diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..03ae7fb --- /dev/null +++ b/.editorconfig @@ -0,0 +1,15 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 4 +trim_trailing_whitespace = true + +[*.{json,yml,yaml}] +indent_size = 2 + +[*.md] +trim_trailing_whitespace = false diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..ca172a0 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,17 @@ +* text=auto eol=lf + +/.github export-ignore +/contracts export-ignore +/docs export-ignore +/fixtures export-ignore +/tests export-ignore +/tools export-ignore +/.editorconfig export-ignore +/.gitattributes export-ignore +/.gitignore export-ignore +/.php-cs-fixer.dist.php export-ignore +/composer.lock export-ignore +/phpstan.neon.dist export-ignore +/phpunit.xml.dist export-ignore +/phpunit-9.xml.dist export-ignore +/infection.json5.dist export-ignore diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..911afb2 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,2 @@ +custom: + - https://fleetbase.io diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml new file mode 100644 index 0000000..1c23def --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -0,0 +1,38 @@ +name: Bug report +description: Report a reproducible SDK defect +title: "[Bug]: " +labels: [bug, needs-triage] +body: + - type: markdown + attributes: + value: Do not include API keys, authorization headers, personal data, or production payloads. Report vulnerabilities through the Security tab. + - type: input + id: sdk-version + attributes: + label: SDK version + validations: + required: true + - type: input + id: environment + attributes: + label: PHP, Composer, framework, and Fleetbase API versions + validations: + required: true + - type: textarea + id: reproduction + attributes: + label: Minimal sanitized reproduction + validations: + required: true + - type: textarea + id: expected + attributes: + label: Expected behavior + validations: + required: true + - type: textarea + id: actual + attributes: + label: Actual behavior + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..543edef --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,8 @@ +blank_issues_enabled: false +contact_links: + - name: Security report + url: https://github.com/fleetbase/fleetbase-php/security/advisories/new + about: Report vulnerabilities privately. + - name: Usage support + url: https://github.com/fleetbase/fleetbase-php/discussions + about: Ask installation and usage questions. diff --git a/.github/ISSUE_TEMPLATE/feature.yml b/.github/ISSUE_TEMPLATE/feature.yml new file mode 100644 index 0000000..29536b5 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature.yml @@ -0,0 +1,25 @@ +name: Feature request +description: Propose an SDK capability or API mapping +title: "[Feature]: " +labels: [enhancement, needs-triage] +body: + - type: textarea + id: problem + attributes: + label: Problem and use case + validations: + required: true + - type: input + id: contract + attributes: + label: Official Postman request or API documentation link + - type: textarea + id: proposal + attributes: + label: Proposed PHP API + validations: + required: true + - type: textarea + id: compatibility + attributes: + label: Compatibility considerations diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..a1b046a --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,22 @@ +## Summary + +## Contract source and endpoints + +## Compatibility classification + +- [ ] Additive +- [ ] Bug fix +- [ ] Deprecation +- [ ] Breaking change (requires a major release) + +## Verification + +- [ ] Unit and fixture tests +- [ ] Fresh line and branch coverage +- [ ] Static analysis and formatting +- [ ] API snapshot and contract checks +- [ ] Consumer fixtures where applicable + +## Documentation, security, and credentials + +Describe documentation changes, security impact, credential handling, exact commands run, and known limits. diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..1d2fb49 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,17 @@ +version: 2 +updates: + - package-ecosystem: composer + directory: / + schedule: + interval: weekly + open-pull-requests-limit: 10 + groups: + composer-development: + dependency-type: development + composer-runtime: + dependency-type: production + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly + open-pull-requests-limit: 10 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..cbb91f1 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,245 @@ +name: CI + +on: + pull_request: + push: + branches: + - main + - master + - release/** + +permissions: + contents: read + +concurrency: + group: ci-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + quality: + name: Quality and contracts + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - name: Check out source + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Set up PHP + uses: shivammathur/setup-php@db91e1a0e48e84637d325a7ee4d2677e146ceec4 # 2.36.0 + with: + php-version: "8.2" + coverage: none + tools: composer:v2 + - name: Validate Composer metadata + run: composer validate --strict + - name: Install locked dependencies + run: composer install --no-interaction --prefer-dist + - name: Run quality and contract gates + run: composer check + + compatibility: + name: PHP ${{ matrix.php }} / ${{ matrix.dependencies }} + runs-on: ubuntu-latest + timeout-minutes: 20 + strategy: + fail-fast: false + matrix: + php: ["7.4", "8.0", "8.1", "8.2", "8.3", "8.4", "8.5"] + dependencies: [lowest, latest] + steps: + - name: Check out source + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Set up PHP + uses: shivammathur/setup-php@db91e1a0e48e84637d325a7ee4d2677e146ceec4 # 2.36.0 + with: + php-version: ${{ matrix.php }} + coverage: none + tools: composer:v2 + - name: Resolve dependencies + run: composer update --no-interaction --prefer-dist ${{ matrix.dependencies == 'lowest' && '--prefer-lowest' || '' }} + - name: Run hermetic unit tests + run: composer test:unit + + coverage: + name: Coverage evidence + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - name: Check out source + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Set up PHP with Xdebug + uses: shivammathur/setup-php@db91e1a0e48e84637d325a7ee4d2677e146ceec4 # 2.36.0 + with: + php-version: "8.2" + coverage: xdebug + tools: composer:v2 + - name: Install locked dependencies + run: composer install --no-interaction --prefer-dist + - name: Generate fresh line and branch coverage + run: composer test:coverage + env: + XDEBUG_MODE: coverage + - name: Print coverage summary + run: | + cat build/coverage/summary.txt + php tools/report-uncovered.php build/coverage/clover.xml + php tools/report-uncovered-branches.php build/coverage/coverage.php + - name: Enforce complete line and branch coverage + run: php tools/check-coverage.php build/coverage/summary.txt 100 + - name: Upload fresh coverage evidence + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: coverage-evidence + path: | + build/coverage/clover.xml + build/coverage/cobertura.xml + build/coverage/summary.txt + if-no-files-found: error + retention-days: 14 + + mutation: + name: Mutation baseline + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - name: Check out source + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Set up PHP with Xdebug + uses: shivammathur/setup-php@db91e1a0e48e84637d325a7ee4d2677e146ceec4 # 2.36.0 + with: + php-version: "8.3" + coverage: xdebug + tools: composer:v2 + - name: Install locked dependencies + run: composer install --no-interaction --prefer-dist + - name: Download and verify Infection 0.35.3 + run: | + curl --fail --location --silent --show-error --output /tmp/infection.phar https://github.com/infection/infection/releases/download/0.35.3/infection.phar + echo "f7109fe91555eba08657c789a55377a1d27809fdb50d553de5654b196eb221aa /tmp/infection.phar" | sha256sum --check + - name: Run full-source mutation baseline + run: php /tmp/infection.phar --configuration=infection.json5.dist --no-progress + env: + XDEBUG_MODE: coverage + - name: Print mutation summary + if: always() + run: cat build/mutation/summary.log + - name: Upload mutation evidence + if: always() + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: mutation-evidence + path: build/mutation/ + if-no-files-found: warn + retention-days: 14 + + consumers: + name: ${{ matrix.fixture }} consumer + needs: archive + runs-on: ubuntu-latest + timeout-minutes: 15 + strategy: + fail-fast: false + matrix: + fixture: [plain, laravel, symfony] + steps: + - name: Check out source + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Set up PHP + uses: shivammathur/setup-php@db91e1a0e48e84637d325a7ee4d2677e146ceec4 # 2.36.0 + with: + php-version: "8.2" + coverage: none + tools: composer:v2 + - name: Download inspected source archive + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: distribution-archive + path: build/dist + - name: Prepare archive-backed package repository + run: | + mkdir -p build/consumer-source + tar -xzf build/dist/fleetbase-php-dev.tar.gz -C build/consumer-source + php tools/configure-consumer-fixture.php "fixtures/consumer/${{ matrix.fixture }}" "build/consumer-source/fleetbase-php-dev" + - name: Install consumer from inspected archive + run: composer update --working-dir=fixtures/consumer/${{ matrix.fixture }} --no-interaction --prefer-dist + - name: Verify framework integration + run: composer verify --working-dir=fixtures/consumer/${{ matrix.fixture }} + - name: Verify optimized production autoloading + run: composer install --working-dir=fixtures/consumer/${{ matrix.fixture }} --no-interaction --no-dev --optimize-autoloader + + archive: + name: Distribution archive + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - name: Check out source + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Set up PHP + uses: shivammathur/setup-php@db91e1a0e48e84637d325a7ee4d2677e146ceec4 # 2.36.0 + with: + php-version: "8.2" + coverage: none + - name: Build deterministic source archive + run: | + mkdir -p build/dist + git archive --format=tar.gz --prefix=fleetbase-php-dev/ --output=build/dist/fleetbase-php-dev.tar.gz HEAD + - name: Inspect distribution contents + run: php tools/check-release-archive.php build/dist/fleetbase-php-dev.tar.gz + - name: Upload inspected source archive + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: distribution-archive + path: build/dist/fleetbase-php-dev.tar.gz + if-no-files-found: error + retention-days: 14 + + release-candidate: + name: Release candidate dry run + needs: [quality, compatibility, coverage, mutation, consumers, archive] + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - name: Check out complete source history + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + fetch-depth: 0 + - name: Set up PHP and Composer + uses: shivammathur/setup-php@db91e1a0e48e84637d325a7ee4d2677e146ceec4 # 2.36.0 + with: + php-version: "8.2" + coverage: none + tools: composer:v2 + - name: Validate release identity and dependency security + run: | + php tools/check-release-version.php 1.1.0 --allow-non-main + composer audit --locked --no-interaction + - name: Download exact coverage evidence + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: coverage-evidence + path: build/coverage + - name: Build and inspect the release archive + run: | + mkdir -p build/release-candidate + git archive --format=tar.gz --prefix=fleetbase-php-1.1.0/ --output=build/release-candidate/fleetbase-php-1.1.0.tar.gz HEAD + php tools/check-release-archive.php build/release-candidate/fleetbase-php-1.1.0.tar.gz + - name: Generate CycloneDX SBOM + uses: anchore/sbom-action@3ad7283483fc7af8ff2b4ea19663c2d5ca935e26 # v0.24.2 + with: + path: . + format: cyclonedx-json + output-file: build/release-candidate/fleetbase-php-1.1.0.sbom.cdx.json + upload-artifact: false + dependency-snapshot: false + - name: Collect release evidence and checksums + run: | + cp build/coverage/summary.txt build/release-candidate/coverage-summary.txt + cp docs/api-coverage.md build/release-candidate/api-coverage.md + cd build/release-candidate + sha256sum fleetbase-php-* > SHA256SUMS + - name: Upload complete release candidate + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: fleetbase-php-1.1.0-release-candidate + path: build/release-candidate/ + if-no-files-found: error + retention-days: 30 diff --git a/.github/workflows/contract-drift.yml b/.github/workflows/contract-drift.yml new file mode 100644 index 0000000..24efb8b --- /dev/null +++ b/.github/workflows/contract-drift.yml @@ -0,0 +1,71 @@ +name: API contract drift + +on: + workflow_dispatch: + schedule: + - cron: "17 2 * * 1" + +permissions: + contents: read + issues: write + +concurrency: + group: contract-drift + cancel-in-progress: true + +jobs: + drift: + name: Compare current Postman contract + runs-on: ubuntu-latest + timeout-minutes: 15 + env: + GH_TOKEN: ${{ github.token }} + steps: + - name: Check out SDK contract lock + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Check out current official Postman contract + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: fleetbase/postman + ref: main + path: .postman + - name: Record current Postman commit + id: postman + run: echo "sha=$(git -C .postman rev-parse HEAD)" >> "$GITHUB_OUTPUT" + - name: Set up PHP + uses: shivammathur/setup-php@db91e1a0e48e84637d325a7ee4d2677e146ceec4 # 2.36.0 + with: + php-version: "8.2" + coverage: none + tools: composer:v2 + - name: Install locked tooling + run: composer install --no-interaction --prefer-dist + - name: Generate current contract inventory + run: php tools/generate-contract-manifest.php --postman=.postman --output=build/contract-drift.json --ref=${{ steps.postman.outputs.sha }} + - name: Compare current contract with SDK lock + id: compare + continue-on-error: true + run: php tools/check-contract-drift.php --candidate=build/contract-drift.json --output=build/contract-drift.md + - name: Open or update drift issue + if: steps.compare.outcome == 'failure' + run: | + gh label create contract-drift --color B60205 --description "Official API contract changed" --force + issue="$(gh issue list --state open --label contract-drift --json number --jq '.[0].number')" + if [ -n "$issue" ]; then + gh issue comment "$issue" --body-file build/contract-drift.md + else + gh issue create --title "Official Postman contract drift detected" --label contract-drift --body-file build/contract-drift.md + fi + - name: Upload drift evidence + if: always() + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: contract-drift + path: | + build/contract-drift.json + build/contract-drift.md + if-no-files-found: error + retention-days: 14 + - name: Enforce no drift + if: steps.compare.outcome == 'failure' + run: exit 1 diff --git a/.github/workflows/contract.yml b/.github/workflows/contract.yml new file mode 100644 index 0000000..c20b9d7 --- /dev/null +++ b/.github/workflows/contract.yml @@ -0,0 +1,149 @@ +name: Disposable API contract + +on: + workflow_dispatch: + schedule: + - cron: "41 3 * * 0" + +permissions: + contents: read + +concurrency: + group: contract-${{ github.ref }} + cancel-in-progress: false + +jobs: + contract: + name: Official Postman and SDK contract + runs-on: ubuntu-latest + timeout-minutes: 55 + env: + FLEETBASE_STACK_REF: d810cee000d42713942a2343264eb706b0b3a59a + POSTMAN_REF: 43253dbf87e5030d95d12be019dc26fcb7151ed6 + SOURCE_TOKEN: ${{ secrets._GITHUB_AUTH_TOKEN || github.token }} + POSTMAN_API_KEY: ${{ secrets.POSTMAN_API_KEY }} + steps: + - name: Require contract-only credentials + run: | + if [ -z "$POSTMAN_API_KEY" ]; then + echo "POSTMAN_API_KEY is required to run the official native collection." >&2 + exit 1 + fi + - name: Check out the locked Fleetbase stack + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: fleetbase/fleetbase + ref: d810cee000d42713942a2343264eb706b0b3a59a + submodules: recursive + token: ${{ env.SOURCE_TOKEN }} + - name: Prove locked package refs + run: | + test "$(git -C packages/core-api rev-parse HEAD)" = "b7691c06ffdfe8f8874352e746aa8e523d5e3531" + test "$(git -C packages/fleetops rev-parse HEAD)" = "a9131daeb1a23ed4b0046dd2d7b632fb100bfba0" + - name: Pin transitive actions in the locked Fleetbase composite + run: | + sed -i 's#actions/checkout@v4#actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1#g' .github/actions/postman-contract/action.yml + sed -i 's#actions/upload-artifact@v4#actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a#g' .github/actions/postman-contract/action.yml + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4.3.0 + - name: Build the locked API stack + run: | + docker build \ + --file docker/Dockerfile \ + --target app-release \ + --build-arg GITHUB_AUTH_KEY="$SOURCE_TOKEN" \ + --tag fleetbase/fleetbase-api:sdk-contract \ + . + docker tag fleetbase/fleetbase-api:sdk-contract fleetbase/fleetbase-api:latest + - name: Prepare non-interactive test configuration + run: | + sudo rm -rf docker/database/mysql + mkdir -p docker/database/mysql + cp api/.env.example api/.env + set_env() { + if grep -q "^$1=" api/.env; then + sed -i "s|^$1=.*|$1=$2|" api/.env + else + echo "$1=$2" >> api/.env + fi + } + set_env THROTTLE_ENABLED false + set_env STOREFRONT_BYPASS_VERIFICATION_CODE 000000 + set_env STOREFRONT_REVIEW_ACCOUNTS '+15555550123' + set_env MAIL_MAILER log + set_env MAIL_FROM_ADDRESS ci-contract@fleetbase.local + - name: Install the disposable stack + run: bash scripts/docker-install.sh --non-interactive + - name: Wait for API health + run: | + for attempt in $(seq 1 40); do + if curl --fail --silent --max-time 5 http://localhost:8000/health | grep -q '"status"'; then + echo "Disposable API is healthy." + exit 0 + fi + sleep 5 + done + echo "Disposable API did not become healthy." >&2 + exit 1 + - name: Run both locked official Postman collections + uses: ./.github/actions/postman-contract + with: + collections: | + Fleetbase API + Fleetbase Core API + postman-ref: ${{ env.POSTMAN_REF }} + postman-api-key: ${{ env.POSTMAN_API_KEY }} + github-token: ${{ env.SOURCE_TOKEN }} + - name: Mint a fresh SDK smoke credential + env: + CI_CUSTOMER_IDENTITY: ci-customer@fleetbase.local + CI_CUSTOMER_PHONE: '+15555550123' + CI_CUSTOMER_PASSWORD: CiCustomerPassw0rd! + CI_CUSTOMER_VERIFICATION_CODE: '000000' + CI_DRIVER_IDENTITY: ci-driver@fleetbase.local + CI_DRIVER_PHONE: '+15555550124' + CI_DRIVER_PASSWORD: CiDriverPassw0rd! + run: | + code="$(base64 scripts/ci/mint-api-key.php | tr -d '\n')" + output="$(docker compose exec -T \ + -e "CI_CUSTOMER_IDENTITY=$CI_CUSTOMER_IDENTITY" \ + -e "CI_CUSTOMER_PHONE=$CI_CUSTOMER_PHONE" \ + -e "CI_CUSTOMER_PASSWORD=$CI_CUSTOMER_PASSWORD" \ + -e "CI_CUSTOMER_VERIFICATION_CODE=$CI_CUSTOMER_VERIFICATION_CODE" \ + -e "CI_DRIVER_IDENTITY=$CI_DRIVER_IDENTITY" \ + -e "CI_DRIVER_PHONE=$CI_DRIVER_PHONE" \ + -e "CI_DRIVER_PASSWORD=$CI_DRIVER_PASSWORD" \ + application php artisan tinker --execute="eval(base64_decode('${code}'));" 2>&1)" + if printf '%s\n' "$output" | grep -q 'MINT_ERROR'; then + printf '%s\n' "$output" | grep -A 2 'MINT_ERROR' + exit 1 + fi + key="$(printf '%s\n' "$output" | grep -oE 'flb_(live|test)_[A-Za-z0-9_-]+' | tail -1)" + if [ -z "$key" ]; then + echo "Unable to mint the disposable SDK credential." >&2 + exit 1 + fi + echo "::add-mask::$key" + echo "FLEETBASE_CONTRACT_API_KEY=$key" >> "$GITHUB_ENV" + - name: Check out the SDK under test + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + path: .sdk + - name: Set up PHP for SDK smoke cases + uses: shivammathur/setup-php@db91e1a0e48e84637d325a7ee4d2677e146ceec4 # 2.36.0 + with: + php-version: "8.2" + coverage: none + tools: composer:v2 + - name: Install SDK dependencies + run: composer install --working-dir=.sdk --no-interaction --prefer-dist + - name: Run SDK cases against the same stack + run: php .sdk/tools/run-live-contract-smoke.php + env: + FLEETBASE_CONTRACT_BASE_URL: http://localhost:8000 + - name: Dump stack logs on failure + if: failure() + run: docker compose logs --no-color --tail=300 + - name: Tear down disposable stack + if: always() + run: docker compose down --volumes diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..eaa15bf --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,149 @@ +name: Release + +on: + workflow_dispatch: + inputs: + version: + description: Semantic version without a v prefix + required: true + type: string + publish: + description: Publish the tag and GitHub Release after approval + required: true + default: false + type: boolean + +permissions: + contents: read + +jobs: + validate: + name: Validate release candidate + runs-on: ubuntu-latest + timeout-minutes: 30 + env: + RELEASE_VERSION: ${{ inputs.version }} + PUBLISH_RELEASE: ${{ inputs.publish }} + steps: + - name: Check out complete history + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + fetch-depth: 0 + - name: Set up PHP with Xdebug + uses: shivammathur/setup-php@db91e1a0e48e84637d325a7ee4d2677e146ceec4 # 2.36.0 + with: + php-version: "8.2" + coverage: xdebug + tools: composer:v2 + - name: Install locked dependencies + run: composer install --no-interaction --prefer-dist + - name: Audit locked dependencies + run: composer audit --locked --no-interaction + - name: Validate version, branch, changelog, and notes + run: | + if [ "$PUBLISH_RELEASE" = "true" ]; then + php tools/check-release-version.php "$RELEASE_VERSION" + else + php tools/check-release-version.php "$RELEASE_VERSION" --allow-non-main + fi + - name: Run authoritative quality and contract gates + run: composer check + - name: Generate and enforce fresh coverage + run: | + composer test:coverage + php tools/check-coverage.php build/coverage/summary.txt 100 + env: + XDEBUG_MODE: coverage + - name: Build and inspect source archive + run: | + mkdir -p build/dist + git archive --format=tar.gz --prefix="fleetbase-php-$RELEASE_VERSION/" --output="build/dist/fleetbase-php-$RELEASE_VERSION.tar.gz" HEAD + php tools/check-release-archive.php "build/dist/fleetbase-php-$RELEASE_VERSION.tar.gz" + - name: Generate CycloneDX SBOM + uses: anchore/sbom-action@3ad7283483fc7af8ff2b4ea19663c2d5ca935e26 # v0.24.2 + with: + path: . + format: cyclonedx-json + output-file: build/dist/fleetbase-php-${{ inputs.version }}.sbom.cdx.json + upload-artifact: false + dependency-snapshot: false + - name: Generate checksums and collect evidence + run: | + cp build/coverage/summary.txt build/dist/coverage-summary.txt + cp docs/api-coverage.md build/dist/api-coverage.md + cd build/dist + sha256sum fleetbase-php-* > SHA256SUMS + - name: Upload release-candidate artifacts + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: fleetbase-php-${{ inputs.version }}-release-candidate + path: build/dist/ + if-no-files-found: error + retention-days: 30 + + publish: + name: Publish approved release + if: inputs.publish == true + needs: validate + runs-on: ubuntu-latest + timeout-minutes: 15 + environment: release + permissions: + contents: write + id-token: write + attestations: write + env: + GH_TOKEN: ${{ github.token }} + RELEASE_VERSION: ${{ inputs.version }} + steps: + - name: Check out reviewed commit + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + fetch-depth: 0 + - name: Download validated release artifacts + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: fleetbase-php-${{ inputs.version }}-release-candidate + path: build/dist + - name: Recheck release identity + run: php tools/check-release-version.php "$RELEASE_VERSION" + - name: Attest release artifacts + uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2 + with: + subject-path: build/dist/* + - name: Create immutable tag and GitHub Release + run: | + gh release create "$RELEASE_VERSION" build/dist/* \ + --target "$GITHUB_SHA" \ + --title "Fleetbase PHP SDK $RELEASE_VERSION" \ + --notes-file "docs/releases/$RELEASE_VERSION.md" + + verify-package: + name: Verify published Packagist install + if: inputs.publish == true + needs: publish + runs-on: ubuntu-latest + timeout-minutes: 20 + env: + RELEASE_VERSION: ${{ inputs.version }} + steps: + - name: Set up PHP and Composer + uses: shivammathur/setup-php@db91e1a0e48e84637d325a7ee4d2677e146ceec4 # 2.36.0 + with: + php-version: "8.2" + coverage: none + tools: composer:v2 + - name: Wait for Packagist and install the exact release + run: | + mkdir -p build/packagist-consumer + composer init --working-dir=build/packagist-consumer --name=fleetbase/release-verifier --no-interaction + for attempt in $(seq 1 20); do + if composer show fleetbase/fleetbase-php "$RELEASE_VERSION" --all --no-interaction >/dev/null 2>&1; then + composer require --working-dir=build/packagist-consumer "fleetbase/fleetbase-php:$RELEASE_VERSION" --no-interaction --prefer-dist + composer install --working-dir=build/packagist-consumer --no-interaction --no-dev --optimize-autoloader + exit 0 + fi + sleep 30 + done + echo "Packagist did not expose fleetbase/fleetbase-php:$RELEASE_VERSION within 10 minutes." >&2 + exit 1 diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml new file mode 100644 index 0000000..709baec --- /dev/null +++ b/.github/workflows/security.yml @@ -0,0 +1,110 @@ +name: Security + +on: + pull_request: + push: + branches: + - main + - master + - release/** + schedule: + - cron: "23 4 * * 1" + +permissions: + contents: read + +concurrency: + group: security-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + composer: + name: Composer audit and license metadata + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - name: Check out source + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Set up PHP + uses: shivammathur/setup-php@db91e1a0e48e84637d325a7ee4d2677e146ceec4 # 2.36.0 + with: + php-version: "8.2" + coverage: none + tools: composer:v2 + - name: Install locked dependencies + run: composer install --no-interaction --prefer-dist + - name: Audit locked dependencies + run: composer audit --locked --no-interaction + - name: Verify AGPL release metadata + run: composer license:check + + dependency-review: + name: Dependency review + if: github.event_name == 'pull_request' + runs-on: ubuntu-latest + timeout-minutes: 10 + permissions: + contents: read + steps: + - name: Check out source + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Review dependency changes + uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 # v5.0.0 + with: + fail-on-severity: moderate + + secrets: + name: Secret scan + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - name: Check out full history + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + fetch-depth: 0 + - name: Scan repository history + uses: trufflesecurity/trufflehog@20652fbbdefffcdaa493a5bf57ab2ac6b1db715b # v3.97.1 + with: + version: 3.97.1 + extra_args: --results=verified + - name: Check out the current source snapshot + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + fetch-depth: 1 + path: current + - name: Scan the current source for verified and unknown secrets + uses: trufflesecurity/trufflehog@20652fbbdefffcdaa493a5bf57ab2ac6b1db715b # v3.97.1 + with: + path: current + head: HEAD + version: 3.97.1 + extra_args: --results=verified,unknown + + codeql: + name: CodeQL (GitHub Actions) + runs-on: ubuntu-latest + timeout-minutes: 15 + permissions: + contents: read + security-events: write + steps: + - name: Check out source + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Initialize CodeQL + uses: github/codeql-action/init@7188fc363630916deb702c7fdcf4e481b751f97a # v4.37.1 + with: + languages: actions + - name: Analyze workflow code + uses: github/codeql-action/analyze@7188fc363630916deb702c7fdcf4e481b751f97a # v4.37.1 + with: + output: build/codeql + upload: never + - name: Enforce clean CodeQL findings + run: php tools/check-sarif.php build/codeql/actions.sarif + - name: Upload CodeQL evidence + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: codeql-actions-sarif + path: build/codeql/actions.sarif + if-no-files-found: error + retention-days: 14 diff --git a/.gitignore b/.gitignore index 9077906..67c05b5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,18 @@ -/vendor -composer.phar -composer.lock +/vendor/ +/fixtures/**/vendor/ +/fixtures/**/composer.lock +/build/ +/.phpunit.cache/ +/.phpunit.result.cache +/phpunit.xml +/.php-cs-fixer.cache +/composer.phar +/infection.json5 +/.idea/ +/.vscode/ .DS_Store Thumbs.db -/phpunit.xml -/.idea -/.vscode -.phpunit.result.cache .env -.env* \ No newline at end of file +.env.* +!.env.example diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php new file mode 100644 index 0000000..a2b0ba9 --- /dev/null +++ b/.php-cs-fixer.dist.php @@ -0,0 +1,25 @@ +in([__DIR__ . '/src', __DIR__ . '/tests', __DIR__ . '/tools']) + ->exclude('fixtures'); + +return (new Config()) + ->setRiskyAllowed(true) + ->setRules([ + '@PSR12' => true, + '@PHP7x4Migration' => true, + 'array_syntax' => ['syntax' => 'short'], + 'declare_strict_types' => true, + 'native_function_invocation' => false, + 'no_unused_imports' => true, + 'ordered_imports' => ['sort_algorithm' => 'alpha'], + 'single_quote' => true, + 'trailing_comma_in_multiline' => ['elements' => ['arrays']], + ]) + ->setFinder($finder); diff --git a/CHANGELOG.md b/CHANGELOG.md index 969327d..f5920a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,27 +8,51 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +## [1.1.0] - 2026-08-31 + ### Added +- PHP 8.0 through 8.5 compatibility and PSR-18/PSR-7 transport injection. +- Typed SDK exception hierarchy, defensive list-response hydration, deterministic contract/API snapshots, hermetic tests, and modern repository guidance. + ### Changed +- Relicensed unreleased 1.1.0 code to `AGPL-3.0-or-later`; released 1.0.x tags remain MIT licensed. +- Preserved the 1.0.x facade while rebuilding request, response, resource, and service internals. +- Modernized Composer dependencies and development tooling. + ### Deprecated ### Removed +- Tracked Composer dependencies under `vendor/` and reliance on `.env.test` for unit tests. + ### Fixed +- Empty API keys are rejected. +- `setApiKey()` retains host, namespace, version, debug, and injected transport configuration. +- Tracking-status resources resolve with the correct spelling. +- Legacy resource lifecycle hooks execute in the documented order and retain caller options. +- Order services can access the transport, and QR/signature subject paths are generated correctly. +- HTTP status, malformed JSON, empty body, transport, and Fleetbase error responses are handled consistently without leaking credentials. + ### Security -## [1.0.0] - YYYY-MM-DD +## [1.0.3] - 2022-05-25 ### Added -* Feature A description -* Feature B description -* Feature C description +- Additional order resource actions. + +## [1.0.2] - 2022-01-03 + +### Changed + +- Latest baseline whose public API is explicitly preserved by 1.1.0. -[Unreleased]: https://github.com/fleetbase/fleetbase-php/compare/1.0.0...HEAD -[1.0.0]: https://github.com/fleetbase/fleetbase-php/commits/1.0.0 +[Unreleased]: https://github.com/fleetbase/fleetbase-php/compare/1.1.0...HEAD +[1.1.0]: https://github.com/fleetbase/fleetbase-php/compare/1.0.3...1.1.0 +[1.0.3]: https://github.com/fleetbase/fleetbase-php/compare/1.0.2...1.0.3 +[1.0.2]: https://github.com/fleetbase/fleetbase-php/compare/1.0.1...1.0.2 diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..9362172 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,29 @@ +# Contributor Covenant Code of Conduct + +## Our pledge + +We pledge to make participation in the Fleetbase community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, experience, education, socioeconomic status, nationality, appearance, race, caste, color, religion, or sexual identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. + +## Our standards + +Positive behavior includes empathy, respect for differing viewpoints, constructive feedback, responsibility, and focus on what is best for the community. Unacceptable behavior includes sexualized conduct, trolling, insults, harassment, publishing private information without permission, and conduct reasonably considered inappropriate in a professional setting. + +## Enforcement responsibilities + +Community leaders will clarify and enforce standards fairly and may remove, edit, or reject contributions or participation that violate this code. They will communicate moderation reasons when appropriate and respect the privacy and security of reporters. + +## Scope + +This code applies in community spaces and when an individual officially represents the community in public spaces. + +## Enforcement + +Report abusive, harassing, or otherwise unacceptable behavior privately through the contact options at [fleetbase.io](https://fleetbase.io). Reports will be reviewed promptly and fairly. Community leaders must respect reporter confidentiality. + +Enforcement may range from a private correction or warning through temporary or permanent exclusion, depending on impact, intent, repetition, and risk to the community. + +## Attribution + +Adapted from the [Contributor Covenant, version 2.1](https://www.contributor-covenant.org/version/2/1/code_of_conduct/), available under the [Creative Commons Attribution 4.0 License](https://creativecommons.org/licenses/by/4.0/). diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..e312467 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,32 @@ +# Contributing + +Thank you for improving the Fleetbase PHP SDK. + +## Setup + +```bash +git clone https://github.com/fleetbase/fleetbase-php.git +cd fleetbase-php +composer install +composer check +``` + +Use a currently supported PHP release for development. Compatibility with PHP 7.4 through 8.5 is enforced in CI. + +## Change requirements + +- Preserve the public API snapshots in `contracts/` unless the change is explicitly classified and approved. +- Trace endpoint changes to the locked Postman, Core API, or Fleet-Ops source and update the contract manifest. +- Add deterministic success, error, and boundary tests. Unit tests must not call a shared or production API. +- Keep line and branch coverage at 100%; meaningful assertions and mutation results remain review gates. +- Run `composer check` and include the commands and results in the pull request. +- Update README, API coverage, changelog, and migration guidance when behavior or usage changes. +- Never commit credentials, `.env` files, caches, generated coverage, or `vendor/`. + +Integration tests use a disposable Fleetbase stack and explicit opt-in workflow. Do not substitute personal or production API keys. + +## Pull requests + +Keep changes bounded and explain the contract source, compatibility classification, tests, coverage, documentation effect, security effect, and known limitations. By contributing, you agree that your contribution is licensed under `AGPL-3.0-or-later` for releases carrying that license. + +Community participation is governed by [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md). Report security issues through [SECURITY.md](SECURITY.md), not a public pull request. diff --git a/LICENSE b/LICENSE index 36b20dc..be3f7b2 100644 --- a/LICENSE +++ b/LICENSE @@ -1,19 +1,661 @@ -Copyright (c) 2021 Fleetbase Pte Ltd. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU Affero General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU Affero General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU Affero General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU Affero General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU AGPL, see +. diff --git a/README.md b/README.md index 3d9b1f4..d09844a 100644 --- a/README.md +++ b/README.md @@ -1,87 +1,256 @@ # Fleetbase PHP SDK -[![Source Code][badge-source]][source] -[![Latest Version][badge-release]][packagist] -[![Software License][badge-license]][license] -[![PHP Version][badge-php]][php] -[![Build Status][badge-build]][build] -[![Coverage Status][badge-coverage]][coverage] -[![Total Downloads][badge-downloads]][downloads] +[![CI](https://github.com/fleetbase/fleetbase-php/actions/workflows/ci.yml/badge.svg)](https://github.com/fleetbase/fleetbase-php/actions/workflows/ci.yml) +[![Security](https://github.com/fleetbase/fleetbase-php/actions/workflows/security.yml/badge.svg)](https://github.com/fleetbase/fleetbase-php/actions/workflows/security.yml) +[![Coverage: 100% lines and branches](https://img.shields.io/badge/coverage-100%25_lines_%26_branches-brightgreen)](https://github.com/fleetbase/fleetbase-php/actions/workflows/ci.yml) +[![Latest release](https://img.shields.io/packagist/v/fleetbase/fleetbase-php.svg)](https://packagist.org/packages/fleetbase/fleetbase-php) +[![PHP versions](https://img.shields.io/packagist/dependency-v/fleetbase/fleetbase-php/php)](https://packagist.org/packages/fleetbase/fleetbase-php) +[![Downloads](https://img.shields.io/packagist/dt/fleetbase/fleetbase-php.svg)](https://packagist.org/packages/fleetbase/fleetbase-php) +[![License: AGPL-3.0-or-later](https://img.shields.io/badge/license-AGPL--3.0--or--later-blue.svg)](LICENSE) -Fleetbase PHP SDK +The official PHP client for the [Fleetbase API](https://fleetbase.io/docs/api). It supports Fleetbase Cloud and self-hosted installations, offers explicit methods for all 220 locked Fleetbase and Core API requests, and retains the public API used by the 1.0.x SDK. -This project adheres to a [Contributor Code of Conduct][conduct]. By -participating in this project and its community, you are expected to uphold this -code. +> The upcoming 1.1.0 release changes the license to `AGPL-3.0-or-later`. Published 1.0.x tags remain under the MIT license shipped with those releases. Review the [migration guide](docs/migration-guide.md) before upgrading. +Maintainers preparing 1.1.0 should use the [release checklist](docs/release-checklist.md) and [default-branch migration runbook](docs/default-branch-migration.md). ## Requirements -PHP 7.4 and later. +- PHP 7.4 or PHP 8.0–8.5 +- Composer 2.2 or newer +- A Fleetbase API key +PHP 7.4 and 8.0 are compatibility targets but no longer receive PHP security fixes. Use a currently supported PHP version in production. ## Installation -The preferred method of installation is via [Composer][]. Run the following -command to install the package and add it as a requirement to your project's -`composer.json`: - ```bash composer require fleetbase/fleetbase-php ``` +Composer installs Guzzle as the default transport. Applications may instead inject any PSR-18 client and compatible PSR-17 request and stream factories. -## Quick Start - -Simple usage looks like: +## Quick start ```php -$fleetbase = new \Fleetbase\Sdk\Fleetbase('< api key here >'); +places->create([ +$place = $fleetbase->places->create([ 'name' => 'Space Needle', 'street1' => '400 Broad Street', 'city' => 'Seattle', 'state' => 'WA', - 'country' => 'US' + 'country' => 'US', +]); + +echo $place->id; +``` + +Never commit an API key. Load it from your runtime secret manager or environment. + +Existing property access remains supported (`$fleetbase->orders`). Explicit accessors such as `$fleetbase->orders()` are available for static analysis and dependency injection. Browse [all 220 generated PHP examples](docs/api-examples.md); CI executes each exact snippet against a hermetic transport. + +## Configuration + +The second constructor argument accepts client configuration. The third legacy argument retains the debug flag without printing requests or credentials. + +```php +$fleetbase = new Fleetbase($_ENV['FLEETBASE_API_KEY'], [ + 'host' => 'https://api.fleetbase.io', + 'namespace' => 'v1', + 'version' => 'v1', + 'max_retries' => 2, + 'retry_delay_ms' => 200, +], false); +``` + +Supported transport configuration includes `httpClient` (or legacy `client`), `requestFactory`, and `streamFactory`. Per-request options include `headers`, `timeout`, `connect_timeout`, `allow_redirects`, TLS `verify`, `proxy`, `idempotency_key`, `max_retries`, `retry_delay_ms`, `multipart`, `form_params`, and a raw string `body`. + +### Self-hosted Fleetbase + +The host may include a path prefix, and the namespace may contain multiple segments. Slashes are normalized without discarding the prefix. + +```php +$fleetbase = new Fleetbase($_ENV['FLEETBASE_API_KEY'], [ + 'host' => 'https://fleetbase.example.com/platform', + 'namespace' => 'api/v1', +]); +``` + +### Injecting a PSR-18 transport + +```php +use Fleetbase\Sdk\Fleetbase; +use GuzzleHttp\Psr7\HttpFactory; +use Symfony\Component\HttpClient\Psr18Client; + +$factory = new HttpFactory(); +$transport = new Psr18Client(null, $factory, $factory); + +$fleetbase = new Fleetbase($_ENV['FLEETBASE_API_KEY'], [ + 'httpClient' => $transport, + 'requestFactory' => $factory, + 'streamFactory' => $factory, +]); +``` + +## Services and responses + +Standard resource services retain `create()`, `update()`, `findRecord()`, `findAll()`, `query()`, `queryRecord()`, and `destroy()`. Dedicated actions use discoverable methods named after the official Postman request. + +```php +$order = $fleetbase->orders->dispatchOrder([ + 'id' => 'order_123', +]); + +$response = $fleetbase->client->request('GET', 'future-endpoint', [ + 'limit' => 10, +]); +``` + +The raw `request()` method is the forward-compatibility escape hatch. It still applies authentication, URL normalization, decoding, retries, hooks, and exception mapping. + +## Errors + +All SDK failures are catchable as `FleetbaseException`. More specific exceptions cover authentication, authorization, validation, missing resources, conflicts, rate limits, server responses, timeouts, transport failures, decoding failures, and unexpected responses. + +```php +use Fleetbase\Sdk\Exception\ValidationException; +use Fleetbase\Sdk\FleetbaseException; + +try { + $fleetbase->places->create($attributes); +} catch (ValidationException $exception) { + foreach ($exception->getDetails() as $field => $messages) { + // Present validation feedback to the caller. + } +} catch (FleetbaseException $exception) { + error_log(sprintf( + 'Fleetbase request %s failed with HTTP %s (request %s)', + $exception->getRequestMethod() ?? 'unknown', + $exception->getStatusCode() ?? 'none', + $exception->getRequestId() ?? 'unavailable' + )); +} +``` + +Exception URLs are sanitized and never include credentials or query strings. Avoid logging request bodies because they may contain customer or authentication data. + +## Uploads and downloads + +Multipart actions accept standard Guzzle multipart parts. The Core file service also exposes the official base64 upload action. + +```php +$file = $fleetbase->files->uploadFile([], [ + 'multipart' => [ + [ + 'name' => 'file', + 'contents' => file_get_contents('/path/to/document.pdf'), + 'filename' => 'document.pdf', + ], + ['name' => 'path', 'contents' => 'documents'], + ], +]); + +$contents = $fleetbase->files->downloadFile([ + 'id' => 'file_123', +]); +``` + +Non-JSON successful responses are returned as strings. The underlying PSR-7 response is available from `$fleetbase->client->getLastPsrResponse()` when headers or streaming behavior are needed. + +## Retries and idempotency + +Retries are opt-in. GET, HEAD, OPTIONS, PUT, and DELETE requests may retry on transport errors, HTTP 429, and HTTP 5xx. A POST or PATCH retries only when it carries an idempotency key. `Retry-After` is honored; otherwise delays use capped exponential backoff. + +```php +$order = $fleetbase->orders->createOrder( + ['body' => $attributes], + [ + 'idempotency_key' => $operationId, + 'max_retries' => 2, + 'retry_delay_ms' => 250, + ] +); +``` + +## Request diagnostics + +Use per-request hooks for application-level tracing without exposing credentials. + +```php +$result = $fleetbase->orders->queryOrders([], [ + 'onBefore' => static function (): void { + // Start a timer or trace span. + }, + 'onAfter' => static function ($decoded): void { + // Close the trace span. + }, ]); + +$status = $fleetbase->client->getLastResponse()->getStatusCode(); ``` -## Documentation +The compatibility `debug` flag is retained as configuration state but deliberately does not dump request bodies or API keys. -Check out the [documentation website][documentation] for detailed information -and code examples. +## Framework integration +The SDK has no required framework dependency. -## Contributing +### Laravel container -Contributions are welcome! Please read [CONTRIBUTING][] for details. +```php +use Fleetbase\Sdk\Fleetbase; +use Illuminate\Contracts\Container\Container; + +$app->singleton(Fleetbase::class, static function (Container $app): Fleetbase { + return new Fleetbase((string) config('services.fleetbase.key'), [ + 'host' => (string) config('services.fleetbase.host'), + 'namespace' => (string) config('services.fleetbase.namespace', 'v1'), + ]); +}); +``` +### Symfony services -## Copyright and License +```yaml +services: + Fleetbase\Sdk\Fleetbase: + arguments: + $publicKey: '%env(FLEETBASE_API_KEY)%' + $config: + host: '%env(resolve:FLEETBASE_API_HOST)%' + namespace: 'v1' +``` + +The repository’s clean consumer fixtures verify plain PHP, Laravel 12 container resolution, Symfony 7.4 dependency injection with `Psr18Client`, and optimized `--no-dev` autoloading. + +## Compatibility and migration + +Version 1.1.0 preserves the documented public/protected surface of both 1.0.2 and 1.0.3 while correcting unusable behavior. See the [migration guide](docs/migration-guide.md) for the license change, PHP constraints, transport behavior, and corrected edge cases. + +The [API coverage matrix](docs/api-coverage.md) maps every request to its source, SDK method, fixture, and deterministic test. Contract sources are locked in [contracts/contract-lock.json](contracts/contract-lock.json). + +## Development + +```bash +composer install +composer check +composer test:coverage +``` -The fleetbase/fleetbase-php library is copyright © [Fleetbase Pte Ltd.](https://fleetbase.io) -and licensed for use under the MIT License (MIT). Please see [LICENSE][] for -more information. +Tests are hermetic by default and must not use production credentials or mutate a shared API. CI enforces PHP 7.4–8.5 with lowest/latest dependencies, PHPStan at max level, generated-contract drift, compatibility snapshots, exact 100% line and branch coverage, consumer fixtures, security checks, and archive inspection. See [CONTRIBUTING.md](CONTRIBUTING.md) for contribution requirements. +## Security and support -[conduct]: https://github.com/fleetbase/fleetbase-php/blob/master/.github/CODE_OF_CONDUCT.md -[composer]: http://getcomposer.org/ -[documentation]: https://fleetbase.github.io/fleetbase-php/ -[contributing]: https://github.com/fleetbase/fleetbase-php/blob/master/.github/CONTRIBUTING.md +Report vulnerabilities privately as described in [SECURITY.md](SECURITY.md). Usage questions and supported-version guidance are in [SUPPORT.md](SUPPORT.md). -[badge-source]: http://img.shields.io/badge/source-fleetbase/fleetbase--php-blue.svg?style=flat-square -[badge-release]: https://img.shields.io/packagist/v/fleetbase/fleetbase-php.svg?style=flat-square&label=release -[badge-license]: https://img.shields.io/packagist/l/fleetbase/fleetbase-php.svg?style=flat-square -[badge-php]: https://img.shields.io/packagist/php-v/fleetbase/fleetbase-php.svg?style=flat-square -[badge-build]: https://img.shields.io/travis/fleetbase/fleetbase-php/master.svg?style=flat-square -[badge-coverage]: https://img.shields.io/coveralls/github/fleetbase/fleetbase-php/master.svg?style=flat-square -[badge-downloads]: https://img.shields.io/packagist/dt/fleetbase/fleetbase-php.svg?style=flat-square&colorB=mediumvioletred +## License -[source]: https://github.com/fleetbase/fleetbase-php -[packagist]: https://packagist.org/packages/fleetbase/fleetbase-php -[license]: https://github.com/fleetbase/fleetbase-php/blob/master/LICENSE -[php]: https://php.net -[build]: https://travis-ci.org/fleetbase/fleetbase-php -[coverage]: https://coveralls.io/r/fleetbase/fleetbase-php?branch=master -[downloads]: https://packagist.org/packages/fleetbase/fleetbase-php +Code prepared for 1.1.0 and later is licensed under the [GNU Affero General Public License v3.0 or later](LICENSE). Previously published tags retain the license shipped with those tags. diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..716bac7 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,13 @@ +# Security policy + +## Supported versions + +Security fixes are provided for the latest released minor version. Older releases may receive a fix when the vulnerability is severe and a safe backport is practical. PHP versions that no longer receive upstream security fixes are compatibility targets, not recommended production runtimes. + +## Reporting a vulnerability + +Do not open a public issue for a suspected vulnerability or include credentials, access tokens, personal data, or exploit details in public discussions. + +Use GitHub's **Report a vulnerability** form in the repository Security tab to create a private security advisory. Include the affected version, impact, reproduction steps, and any suggested remediation. Fleetbase will acknowledge the report, assess severity, coordinate a fix and disclosure date, and credit the reporter if requested. + +If private vulnerability reporting is unavailable, contact Fleetbase through the security contact published at [fleetbase.io](https://fleetbase.io) and reference this repository without sending secrets in the first message. diff --git a/SUPPORT.md b/SUPPORT.md new file mode 100644 index 0000000..e68503b --- /dev/null +++ b/SUPPORT.md @@ -0,0 +1,7 @@ +# Support + +Use [GitHub Discussions](https://github.com/fleetbase/fleetbase-php/discussions) for SDK usage questions and [GitHub Issues](https://github.com/fleetbase/fleetbase-php/issues) for reproducible defects or documentation gaps. + +Before opening an issue, confirm it reproduces on the latest release and include the SDK, PHP, Composer, framework, and Fleetbase API versions. Provide a minimal sanitized example and the expected and actual behavior. Never include API keys, authorization headers, customer data, or production payloads. + +Fleetbase product and commercial support options are available at [fleetbase.io](https://fleetbase.io). Security reports must follow [SECURITY.md](SECURITY.md). diff --git a/composer.json b/composer.json index 3271e46..d365f17 100644 --- a/composer.json +++ b/composer.json @@ -1,10 +1,10 @@ { "name": "fleetbase/fleetbase-php", - "description": "Fleetbase\\PHP\\SDK", + "description": "Official PHP SDK for the Fleetbase logistics and operations APIs", "type": "library", "keywords": ["fleetbase", "logistics-api", "ecommerce-api", "fleetbase-sdk", "fleetbase-api"], "homepage": "https://github.com/fleetbase/fleetbase-php", - "license": "MIT", + "license": "AGPL-3.0-or-later", "authors": [ { "name": "Ronald A. Richardson", @@ -13,25 +13,29 @@ } ], "support": { - "docs": "https://fleetbase.github.io/fleetbase-php/", + "docs": "https://fleetbase.io/docs/api", "issues": "https://github.com/fleetbase/fleetbase-php/issues", "rss": "https://github.com/fleetbase/fleetbase-php/releases.atom", "source": "https://github.com/fleetbase/fleetbase-php.git", "wiki": "https://github.com/fleetbase/fleetbase-php/wiki" }, "require": { - "php": "^7.4", + "php": "^7.4 || ^8.0", "doctrine/inflector": "^2.0", - "guzzlehttp/guzzle": "^7.0" + "guzzlehttp/guzzle": "^7.4", + "psr/http-client": "^1.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0 || ^2.0" }, "require-dev": { - "mockery/mockery": "^1", - "php-parallel-lint/php-parallel-lint": "^1", - "phpstan/phpstan": "^0.11", - "phpstan/phpstan-mockery": "^0.11", - "phpunit/phpunit": "^8", - "squizlabs/php_codesniffer": "^3", - "vlucas/phpdotenv": "^5.4" + "friendsofphp/php-cs-fixer": "^3.64", + "mockery/mockery": "^1.6", + "php-parallel-lint/php-parallel-lint": "^1.4", + "phpstan/phpstan": "^2.2", + "phpstan/phpstan-mockery": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpunit/phpunit": "^9.6 || ^10.5 || ^11.5 || ^12.0", + "symfony/yaml": "^5.4" }, "autoload": { "psr-4": { @@ -44,32 +48,56 @@ } }, "scripts": { - "lint": "parallel-lint src tests", - "phpcs": "phpcs src tests --standard=psr12 -sp --colors", - "phpstan": [ - "phpstan analyse src -c phpstan.neon --level max --no-progress", - "phpstan analyse tests -c phpstan.neon --level 4 --no-progress" + "lint": "parallel-lint src tests tools", + "format": "php-cs-fixer fix --diff --verbose --sequential", + "format:check": "php-cs-fixer fix --dry-run --diff --verbose --sequential", + "analyse": "phpstan analyse --configuration=phpstan.neon.dist --no-progress --debug", + "test:unit": "@php tools/run-unit-tests.php", + "test:unit:legacy": "phpunit --configuration=phpunit-9.xml.dist", + "test:coverage": [ + "@php tools/run-unit-tests.php --coverage-clover=build/coverage/clover.xml --coverage-cobertura=build/coverage/cobertura.xml --coverage-html=build/coverage/html --coverage-php=build/coverage/coverage.php --coverage-text=build/coverage/summary.txt", + "@php tools/merge-terminating-coverage.php" ], - "phpunit": "phpunit --verbose --colors=always", - "phpunit-ci": "phpunit --verbose --coverage-clover build/logs/clover.xml", - "phpunit-coverage": "phpunit --verbose --colors=always --coverage-html build/coverage", - "test": [ - "@lint", - "@phpcs", - "@phpstan", - "@phpunit" + "contract:check": "@php tools/check-contract-manifest.php", + "contract:complete": "@php tools/check-contract-manifest.php --require-complete", + "license:check": "@php tools/check-license.php", + "contract:generated": [ + "@php tools/generate-endpoint-services.php", + "@php tools/generate-api-coverage.php", + "@php tools/generate-api-examples.php", + "git diff --exit-code -- contracts/postman-manifest.json contracts/service-map.json docs/api-coverage.md docs/api-examples.md src/Services tests/Contract" + ], + "api:snapshot": "@php tools/generate-api-snapshot.php --autoload=vendor/autoload.php --label=working-tree --output=build/contracts/public-api-current.json", + "api:compatibility": [ + "@api:snapshot", + "@php tools/check-api-compatibility.php --baseline=contracts/public-api-1.0.2.json --current=build/contracts/public-api-current.json", + "@php tools/check-api-compatibility.php --baseline=contracts/public-api-1.0.3.json --current=build/contracts/public-api-current.json" ], - "test-ci": [ + "check": [ "@lint", - "@phpcs", - "@phpstan", - "@phpunit-ci" + "@format:check", + "@analyse", + "@test:unit", + "@contract:check", + "@contract:generated", + "@license:check", + "@api:compatibility" ] }, + "funding": [ + { + "type": "custom", + "url": "https://fleetbase.io" + } + ], + "minimum-stability": "stable", + "prefer-stable": true, "config": { "sort-packages": true, - "allow-plugins": { - "composer/package-versions-deprecated": true - } + "allow-plugins": {}, + "preferred-install": { + "*": "dist" + }, + "optimize-autoloader": true } } diff --git a/composer.lock b/composer.lock index bbea8f5..0ca82c6 100644 --- a/composer.lock +++ b/composer.lock @@ -4,37 +4,36 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "52cf6dac86c4e7451d0c994a6daf4a25", + "content-hash": "1dcc8fdf60f5cbd496362f8234d6c5a6", "packages": [ { "name": "doctrine/inflector", - "version": "2.0.4", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/doctrine/inflector.git", - "reference": "8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89" + "reference": "6d6c96277ea252fc1304627204c3d5e6e15faa3b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89", - "reference": "8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/6d6c96277ea252fc1304627204c3d5e6e15faa3b", + "reference": "6d6c96277ea252fc1304627204c3d5e6e15faa3b", "shasum": "" }, "require": { "php": "^7.2 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^8.2", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpstan/phpstan-strict-rules": "^0.12", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", - "vimeo/psalm": "^4.10" + "doctrine/coding-standard": "^12.0 || ^13.0", + "phpstan/phpstan": "^1.12 || ^2.0", + "phpstan/phpstan-phpunit": "^1.4 || ^2.0", + "phpstan/phpstan-strict-rules": "^1.6 || ^2.0", + "phpunit/phpunit": "^8.5 || ^12.2" }, "type": "library", "autoload": { "psr-4": { - "Doctrine\\Inflector\\": "lib/Doctrine/Inflector" + "Doctrine\\Inflector\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -79,7 +78,7 @@ ], "support": { "issues": "https://github.com/doctrine/inflector/issues", - "source": "https://github.com/doctrine/inflector/tree/2.0.4" + "source": "https://github.com/doctrine/inflector/tree/2.1.0" }, "funding": [ { @@ -95,38 +94,41 @@ "type": "tidelift" } ], - "time": "2021-10-22T20:16:43+00:00" + "time": "2025-08-10T19:31:58+00:00" }, { "name": "guzzlehttp/guzzle", - "version": "7.4.1", + "version": "7.15.5", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "ee0a041b1760e6a53d2a39c8c34115adc2af2c79" + "reference": "ee80339fd9177ba44c49cdb653ff02a4d1106b9a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/ee0a041b1760e6a53d2a39c8c34115adc2af2c79", - "reference": "ee0a041b1760e6a53d2a39c8c34115adc2af2c79", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/ee80339fd9177ba44c49cdb653ff02a4d1106b9a", + "reference": "ee80339fd9177ba44c49cdb653ff02a4d1106b9a", "shasum": "" }, "require": { "ext-json": "*", - "guzzlehttp/promises": "^1.5", - "guzzlehttp/psr7": "^1.8.3 || ^2.1", + "guzzlehttp/promises": "^2.5.3", + "guzzlehttp/psr7": "^2.13.1", "php": "^7.2.5 || ^8.0", "psr/http-client": "^1.0", - "symfony/deprecation-contracts": "^2.2 || ^3.0" + "symfony/deprecation-contracts": "^2.5 || ^3.0", + "symfony/polyfill-php80": "^1.25" }, "provide": { "psr/http-client-implementation": "1.0" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.4.1", + "bamarni/composer-bin-plugin": "^1.8.2", "ext-curl": "*", - "php-http/client-integration-tests": "^3.0", - "phpunit/phpunit": "^8.5.5 || ^9.3.5", + "guzzle/client-integration-tests": "3.0.3", + "guzzlehttp/test-server": "^0.7", + "php-http/message-factory": "^1.1", + "phpunit/phpunit": "^8.5.52 || ^9.6.34", "psr/log": "^1.1 || ^2.0 || ^3.0" }, "suggest": { @@ -136,17 +138,18 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "7.4-dev" + "bamarni-bin": { + "bin-links": true, + "forward-command": false } }, "autoload": { - "psr-4": { - "GuzzleHttp\\": "src/" - }, "files": [ "src/functions_include.php" - ] + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -203,7 +206,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.4.1" + "source": "https://github.com/guzzle/guzzle/tree/7.15.5" }, "funding": [ { @@ -219,41 +222,41 @@ "type": "tidelift" } ], - "time": "2021-12-06T18:43:05+00:00" + "time": "2026-08-24T09:21:06+00:00" }, { "name": "guzzlehttp/promises", - "version": "1.5.1", + "version": "2.5.3", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da" + "reference": "cde49999552d185d64715fe9c1f77a2aadd2f9f1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da", - "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da", + "url": "https://api.github.com/repos/guzzle/promises/zipball/cde49999552d185d64715fe9c1f77a2aadd2f9f1", + "reference": "cde49999552d185d64715fe9c1f77a2aadd2f9f1", "shasum": "" }, "require": { - "php": ">=5.5" + "php": "^7.2.5 || ^8.0", + "symfony/deprecation-contracts": "^2.5 || ^3.0" }, "require-dev": { - "symfony/phpunit-bridge": "^4.4 || ^5.1" + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.52 || ^9.6.34" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "1.5-dev" + "bamarni-bin": { + "bin-links": true, + "forward-command": false } }, "autoload": { "psr-4": { "GuzzleHttp\\Promise\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -287,7 +290,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/1.5.1" + "source": "https://github.com/guzzle/promises/tree/2.5.3" }, "funding": [ { @@ -303,44 +306,48 @@ "type": "tidelift" } ], - "time": "2021-10-22T20:56:57+00:00" + "time": "2026-08-24T09:11:28+00:00" }, { "name": "guzzlehttp/psr7", - "version": "2.2.1", + "version": "2.13.1", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "c94a94f120803a18554c1805ef2e539f8285f9a2" + "reference": "95e7828100de18b4e269fb1703be530082d5166d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/c94a94f120803a18554c1805ef2e539f8285f9a2", - "reference": "c94a94f120803a18554c1805ef2e539f8285f9a2", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/95e7828100de18b4e269fb1703be530082d5166d", + "reference": "95e7828100de18b4e269fb1703be530082d5166d", "shasum": "" }, "require": { "php": "^7.2.5 || ^8.0", "psr/http-factory": "^1.0", - "psr/http-message": "^1.0", - "ralouphie/getallheaders": "^3.0" + "psr/http-message": "^1.1 || ^2.0", + "ralouphie/getallheaders": "^3.0", + "symfony/deprecation-contracts": "^2.5 || ^3.0", + "symfony/polyfill-php80": "^1.25" }, "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" + "bamarni/composer-bin-plugin": "^1.8.2", + "http-interop/http-factory-tests": "1.1.0", + "jshttp/mime-db": "1.54.0.1", + "phpunit/phpunit": "^8.5.52 || ^9.6.34" }, "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "2.2-dev" + "bamarni-bin": { + "bin-links": true, + "forward-command": false } }, "autoload": { @@ -402,7 +409,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.2.1" + "source": "https://github.com/guzzle/psr7/tree/2.13.1" }, "funding": [ { @@ -418,25 +425,25 @@ "type": "tidelift" } ], - "time": "2022-03-20T21:55:58+00:00" + "time": "2026-08-24T09:13:11+00:00" }, { "name": "psr/http-client", - "version": "1.0.1", + "version": "1.0.3", "source": { "type": "git", "url": "https://github.com/php-fig/http-client.git", - "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621" + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", - "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", "shasum": "" }, "require": { "php": "^7.0 || ^8.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.0 || ^2.0" }, "type": "library", "extra": { @@ -456,7 +463,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for HTTP clients", @@ -468,27 +475,27 @@ "psr-18" ], "support": { - "source": "https://github.com/php-fig/http-client/tree/master" + "source": "https://github.com/php-fig/http-client" }, - "time": "2020-06-29T06:28:15+00:00" + "time": "2023-09-23T14:17:50+00:00" }, { "name": "psr/http-factory", - "version": "1.0.1", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-factory.git", - "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be" + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be", - "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", "shasum": "" }, "require": { - "php": ">=7.0.0", - "psr/http-message": "^1.0" + "php": ">=7.1", + "psr/http-message": "^1.0 || ^2.0" }, "type": "library", "extra": { @@ -508,10 +515,10 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], - "description": "Common interfaces for PSR-7 HTTP message factories", + "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", "keywords": [ "factory", "http", @@ -523,31 +530,31 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-factory/tree/master" + "source": "https://github.com/php-fig/http-factory" }, - "time": "2019-04-30T12:38:16+00:00" + "time": "2024-04-15T12:06:14+00:00" }, { "name": "psr/http-message", - "version": "1.0.1", + "version": "2.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -562,7 +569,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for HTTP messages", @@ -576,9 +583,9 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-message/tree/master" + "source": "https://github.com/php-fig/http-message/tree/2.0" }, - "time": "2016-08-06T14:39:51+00:00" + "time": "2023-04-04T09:54:51+00:00" }, { "name": "ralouphie/getallheaders", @@ -626,29 +633,29 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v2.5.0", + "version": "v3.7.1", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8" + "reference": "f3202fa1b5097b0af062dc978b32ecf63404e31d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/6f981ee24cf69ee7ce9736146d1c57c2780598a8", - "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/f3202fa1b5097b0af062dc978b32ecf63404e31d", + "reference": "f3202fa1b5097b0af062dc978b32ecf63404e31d", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=8.1" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "2.5-dev" - }, "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.7-dev" } }, "autoload": { @@ -673,7 +680,7 @@ "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.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.7.1" }, "funding": [ { @@ -684,52 +691,51 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2021-07-12T14:48:14+00:00" - } - ], - "packages-dev": [ + "time": "2026-06-05T06:23:12+00:00" + }, { - "name": "composer/package-versions-deprecated", - "version": "1.11.99.4", + "name": "symfony/polyfill-php80", + "version": "v1.37.0", "source": { "type": "git", - "url": "https://github.com/composer/package-versions-deprecated.git", - "reference": "b174585d1fe49ceed21928a945138948cb394600" + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "dfb55726c3a76ea3b6459fcfda1ec2d80a682411" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/b174585d1fe49ceed21928a945138948cb394600", - "reference": "b174585d1fe49ceed21928a945138948cb394600", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dfb55726c3a76ea3b6459fcfda1ec2d80a682411", + "reference": "dfb55726c3a76ea3b6459fcfda1ec2d80a682411", "shasum": "" }, "require": { - "composer-plugin-api": "^1.1.0 || ^2.0", - "php": "^7 || ^8" - }, - "replace": { - "ocramius/package-versions": "1.11.99" - }, - "require-dev": { - "composer/composer": "^1.9.3 || ^2.0@dev", - "ext-zip": "^1.13", - "phpunit/phpunit": "^6.5 || ^7" + "php": ">=7.2" }, - "type": "composer-plugin", + "type": "library", "extra": { - "class": "PackageVersions\\Installer", - "branch-alias": { - "dev-master": "1.x-dev" + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { + "files": [ + "bootstrap.php" + ], "psr-4": { - "PackageVersions\\": "src/PackageVersions" - } + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -737,61 +743,77 @@ ], "authors": [ { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com" + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" }, { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], "support": { - "issues": "https://github.com/composer/package-versions-deprecated/issues", - "source": "https://github.com/composer/package-versions-deprecated/tree/1.11.99.4" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.37.0" }, "funding": [ { - "url": "https://packagist.com", + "url": "https://symfony.com/sponsor", "type": "custom" }, { - "url": "https://github.com/composer", + "url": "https://github.com/fabpot", "type": "github" }, { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2021-09-13T08:41:34+00:00" - }, + "time": "2026-04-10T16:19:22+00:00" + } + ], + "packages-dev": [ { - "name": "composer/xdebug-handler", - "version": "1.4.6", + "name": "clue/ndjson-react", + "version": "v1.3.0", "source": { "type": "git", - "url": "https://github.com/composer/xdebug-handler.git", - "reference": "f27e06cd9675801df441b3656569b328e04aa37c" + "url": "https://github.com/clue/reactphp-ndjson.git", + "reference": "392dc165fce93b5bb5c637b67e59619223c931b0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/f27e06cd9675801df441b3656569b328e04aa37c", - "reference": "f27e06cd9675801df441b3656569b328e04aa37c", + "url": "https://api.github.com/repos/clue/reactphp-ndjson/zipball/392dc165fce93b5bb5c637b67e59619223c931b0", + "reference": "392dc165fce93b5bb5c637b67e59619223c931b0", "shasum": "" }, "require": { - "php": "^5.3.2 || ^7.0 || ^8.0", - "psr/log": "^1.0" + "php": ">=5.3", + "react/stream": "^1.2" }, "require-dev": { - "phpstan/phpstan": "^0.12.55", - "symfony/phpunit-bridge": "^4.2 || ^5" + "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35", + "react/event-loop": "^1.2" }, "type": "library", "autoload": { "psr-4": { - "Composer\\XdebugHandler\\": "src" + "Clue\\React\\NDJson\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -800,66 +822,75 @@ ], "authors": [ { - "name": "John Stevenson", - "email": "john-stevenson@blueyonder.co.uk" + "name": "Christian Lück", + "email": "christian@clue.engineering" } ], - "description": "Restarts a process without Xdebug.", + "description": "Streaming newline-delimited JSON (NDJSON) parser and encoder for ReactPHP.", + "homepage": "https://github.com/clue/reactphp-ndjson", "keywords": [ - "Xdebug", - "performance" + "NDJSON", + "json", + "jsonlines", + "newline", + "reactphp", + "streaming" ], "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/1.4.6" + "issues": "https://github.com/clue/reactphp-ndjson/issues", + "source": "https://github.com/clue/reactphp-ndjson/tree/v1.3.0" }, "funding": [ { - "url": "https://packagist.com", + "url": "https://clue.engineering/support", "type": "custom" }, { - "url": "https://github.com/composer", + "url": "https://github.com/clue", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" } ], - "time": "2021-03-25T17:01:18+00:00" + "time": "2022-12-23T10:58:28+00:00" }, { - "name": "doctrine/instantiator", - "version": "1.4.0", + "name": "composer/pcre", + "version": "3.3.2", "source": { "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" + "url": "https://github.com/composer/pcre.git", + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", - "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", + "url": "https://api.github.com/repos/composer/pcre/zipball/b2bed4734f0cc156ee1fe9c0da2550420d99a21e", + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" + "php": "^7.4 || ^8.0" + }, + "conflict": { + "phpstan/phpstan": "<1.11.10" }, "require-dev": { - "doctrine/coding-standard": "^8.0", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^0.13 || 1.0.0-alpha2", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + "phpstan/phpstan": "^1.12 || ^2", + "phpstan/phpstan-strict-rules": "^1 || ^2", + "phpunit/phpunit": "^8 || ^9" }, "type": "library", + "extra": { + "phpstan": { + "includes": [ + "extension.neon" + ] + }, + "branch-alias": { + "dev-main": "3.x-dev" + } + }, "autoload": { "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + "Composer\\Pcre\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -868,62 +899,68 @@ ], "authors": [ { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "https://ocramius.github.io/" + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" } ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", "keywords": [ - "constructor", - "instantiate" + "PCRE", + "preg", + "regex", + "regular expression" ], "support": { - "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.4.0" + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/3.3.2" }, "funding": [ { - "url": "https://www.doctrine-project.org/sponsorship.html", + "url": "https://packagist.com", "type": "custom" }, { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" + "url": "https://github.com/composer", + "type": "github" }, { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", + "url": "https://tidelift.com/funding/github/packagist/composer/composer", "type": "tidelift" } ], - "time": "2020-11-10T18:47:58+00:00" + "time": "2024-11-12T16:29:46+00:00" }, { - "name": "graham-campbell/result-type", - "version": "v1.0.4", + "name": "composer/semver", + "version": "3.4.4", "source": { "type": "git", - "url": "https://github.com/GrahamCampbell/Result-Type.git", - "reference": "0690bde05318336c7221785f2a932467f98b64ca" + "url": "https://github.com/composer/semver.git", + "reference": "198166618906cb2de69b95d7d47e5fa8aa1b2b95" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/0690bde05318336c7221785f2a932467f98b64ca", - "reference": "0690bde05318336c7221785f2a932467f98b64ca", + "url": "https://api.github.com/repos/composer/semver/zipball/198166618906cb2de69b95d7d47e5fa8aa1b2b95", + "reference": "198166618906cb2de69b95d7d47e5fa8aa1b2b95", "shasum": "" }, "require": { - "php": "^7.0 || ^8.0", - "phpoption/phpoption": "^1.8" + "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^6.5.14 || ^7.5.20 || ^8.5.19 || ^9.5.8" + "phpstan/phpstan": "^1.11", + "symfony/phpunit-bridge": "^3 || ^7" }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, "autoload": { "psr-4": { - "GrahamCampbell\\ResultType\\": "src/" + "Composer\\Semver\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -932,116 +969,158 @@ ], "authors": [ { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" } ], - "description": "An Implementation Of The Result Type", + "description": "Semver library that offers utilities, version constraint parsing and validation.", "keywords": [ - "Graham Campbell", - "GrahamCampbell", - "Result Type", - "Result-Type", - "result" + "semantic", + "semver", + "validation", + "versioning" ], "support": { - "issues": "https://github.com/GrahamCampbell/Result-Type/issues", - "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.0.4" + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.4.4" }, "funding": [ { - "url": "https://github.com/GrahamCampbell", - "type": "github" + "url": "https://packagist.com", + "type": "custom" }, { - "url": "https://tidelift.com/funding/github/packagist/graham-campbell/result-type", - "type": "tidelift" + "url": "https://github.com/composer", + "type": "github" } ], - "time": "2021-11-21T21:41:47+00:00" + "time": "2025-08-20T19:15:30+00:00" }, { - "name": "hamcrest/hamcrest-php", - "version": "v2.0.1", + "name": "composer/xdebug-handler", + "version": "3.0.5", "source": { "type": "git", - "url": "https://github.com/hamcrest/hamcrest-php.git", - "reference": "8c3d0a3f6af734494ad8f6fbbee0ba92422859f3" + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/8c3d0a3f6af734494ad8f6fbbee0ba92422859f3", - "reference": "8c3d0a3f6af734494ad8f6fbbee0ba92422859f3", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6c1925561632e83d60a44492e0b344cf48ab85ef", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef", "shasum": "" }, "require": { - "php": "^5.3|^7.0|^8.0" - }, - "replace": { - "cordoval/hamcrest-php": "*", - "davedevelopment/hamcrest-php": "*", - "kodova/hamcrest-php": "*" + "composer/pcre": "^1 || ^2 || ^3", + "php": "^7.2.5 || ^8.0", + "psr/log": "^1 || ^2 || ^3" }, "require-dev": { - "phpunit/php-file-iterator": "^1.4 || ^2.0", - "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0" + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, "autoload": { - "classmap": [ - "hamcrest" - ] + "psr-4": { + "Composer\\XdebugHandler\\": "src" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], - "description": "This is the PHP port of Hamcrest Matchers", + "authors": [ + { + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" + } + ], + "description": "Restarts a process without Xdebug.", "keywords": [ - "test" + "Xdebug", + "performance" ], "support": { - "issues": "https://github.com/hamcrest/hamcrest-php/issues", - "source": "https://github.com/hamcrest/hamcrest-php/tree/v2.0.1" + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/3.0.5" }, - "time": "2020-07-09T08:09:16+00:00" + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-05-06T16:37:16+00:00" }, { - "name": "jean85/pretty-package-versions", - "version": "1.6.0", + "name": "ergebnis/agent-detector", + "version": "1.2.0", "source": { "type": "git", - "url": "https://github.com/Jean85/pretty-package-versions.git", - "reference": "1e0104b46f045868f11942aea058cd7186d6c303" + "url": "https://github.com/ergebnis/agent-detector.git", + "reference": "e211f17928c8b95a51e06040792d57f5462fb271" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/1e0104b46f045868f11942aea058cd7186d6c303", - "reference": "1e0104b46f045868f11942aea058cd7186d6c303", + "url": "https://api.github.com/repos/ergebnis/agent-detector/zipball/e211f17928c8b95a51e06040792d57f5462fb271", + "reference": "e211f17928c8b95a51e06040792d57f5462fb271", "shasum": "" }, "require": { - "composer/package-versions-deprecated": "^1.8.0", - "php": "^7.0|^8.0" + "php": "~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0" }, "require-dev": { - "phpunit/phpunit": "^6.0|^8.5|^9.2" + "ergebnis/composer-normalize": "^2.51.0", + "ergebnis/license": "^2.7.0", + "ergebnis/php-cs-fixer-config": "^6.60.2", + "ergebnis/phpstan-rules": "^2.13.1", + "ergebnis/phpunit-slow-test-detector": "^2.24.0", + "ergebnis/rector-rules": "^1.18.1", + "fakerphp/faker": "^1.24.1", + "infection/infection": "^0.26.6", + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^2.1.54", + "phpstan/phpstan-deprecation-rules": "^2.0.4", + "phpstan/phpstan-phpunit": "^2.0.16", + "phpstan/phpstan-strict-rules": "^2.0.10", + "phpunit/phpunit": "^9.6.34", + "rector/rector": "^2.4.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.x-dev" + "dev-main": "1.2-dev" + }, + "composer-normalize": { + "indent-size": 2, + "indent-style": "space" } }, "autoload": { "psr-4": { - "Jean85\\": "src/" + "Ergebnis\\AgentDetector\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1050,261 +1129,261 @@ ], "authors": [ { - "name": "Alessandro Lai", - "email": "alessandro.lai85@gmail.com" + "name": "Andreas Möller", + "email": "am@localheinz.com", + "homepage": "https://localheinz.com" } ], - "description": "A wrapper for ocramius/package-versions to get pretty versions strings", - "keywords": [ - "composer", - "package", - "release", - "versions" - ], + "description": "Provides a detector for detecting the presence of an agent.", + "homepage": "https://github.com/ergebnis/agent-detector", "support": { - "issues": "https://github.com/Jean85/pretty-package-versions/issues", - "source": "https://github.com/Jean85/pretty-package-versions/tree/1.6.0" + "issues": "https://github.com/ergebnis/agent-detector/issues", + "security": "https://github.com/ergebnis/agent-detector/blob/main/.github/SECURITY.md", + "source": "https://github.com/ergebnis/agent-detector" }, - "time": "2021-02-04T16:20:16+00:00" + "time": "2026-05-07T08:19:07+00:00" }, { - "name": "mockery/mockery", - "version": "1.4.4", + "name": "evenement/evenement", + "version": "v3.0.2", "source": { "type": "git", - "url": "https://github.com/mockery/mockery.git", - "reference": "e01123a0e847d52d186c5eb4b9bf58b0c6d00346" + "url": "https://github.com/igorw/evenement.git", + "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mockery/mockery/zipball/e01123a0e847d52d186c5eb4b9bf58b0c6d00346", - "reference": "e01123a0e847d52d186c5eb4b9bf58b0c6d00346", + "url": "https://api.github.com/repos/igorw/evenement/zipball/0a16b0d71ab13284339abb99d9d2bd813640efbc", + "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc", "shasum": "" }, "require": { - "hamcrest/hamcrest-php": "^2.0.1", - "lib-pcre": ">=7.0", - "php": "^7.3 || ^8.0" - }, - "conflict": { - "phpunit/phpunit": "<8.0" + "php": ">=7.0" }, "require-dev": { - "phpunit/phpunit": "^8.5 || ^9.3" + "phpunit/phpunit": "^9 || ^6" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, "autoload": { - "psr-0": { - "Mockery": "library/" + "psr-4": { + "Evenement\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Pádraic Brady", - "email": "padraic.brady@gmail.com", - "homepage": "http://blog.astrumfutura.com" - }, - { - "name": "Dave Marshall", - "email": "dave.marshall@atstsolutions.co.uk", - "homepage": "http://davedevelopment.co.uk" + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" } ], - "description": "Mockery is a simple yet flexible PHP mock object framework", - "homepage": "https://github.com/mockery/mockery", + "description": "Événement is a very simple event dispatching library for PHP", "keywords": [ - "BDD", - "TDD", - "library", - "mock", - "mock objects", - "mockery", - "stub", - "test", - "test double", - "testing" + "event-dispatcher", + "event-emitter" ], "support": { - "issues": "https://github.com/mockery/mockery/issues", - "source": "https://github.com/mockery/mockery/tree/1.4.4" + "issues": "https://github.com/igorw/evenement/issues", + "source": "https://github.com/igorw/evenement/tree/v3.0.2" }, - "time": "2021-09-13T15:28:59+00:00" + "time": "2023-08-08T05:53:35+00:00" }, { - "name": "myclabs/deep-copy", - "version": "1.10.2", + "name": "fidry/cpu-core-counter", + "version": "1.3.0", "source": { "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220" + "url": "https://github.com/theofidry/cpu-core-counter.git", + "reference": "db9508f7b1474469d9d3c53b86f817e344732678" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220", - "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220", + "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/db9508f7b1474469d9d3c53b86f817e344732678", + "reference": "db9508f7b1474469d9d3c53b86f817e344732678", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" + "php": "^7.2 || ^8.0" }, "require-dev": { - "doctrine/collections": "^1.0", - "doctrine/common": "^2.6", - "phpunit/phpunit": "^7.1" + "fidry/makefile": "^0.2.0", + "fidry/php-cs-fixer-config": "^1.1.2", + "phpstan/extension-installer": "^1.2.0", + "phpstan/phpstan": "^2.0", + "phpstan/phpstan-deprecation-rules": "^2.0.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^8.5.31 || ^9.5.26", + "webmozarts/strict-phpunit": "^7.5" }, "type": "library", "autoload": { "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - }, - "files": [ - "src/DeepCopy/deep_copy.php" - ] + "Fidry\\CpuCoreCounter\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "Create deep copies (clones) of your objects", + "authors": [ + { + "name": "Théo FIDRY", + "email": "theo.fidry@gmail.com" + } + ], + "description": "Tiny utility to get the number of CPU cores.", "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" + "CPU", + "core" ], "support": { - "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.10.2" + "issues": "https://github.com/theofidry/cpu-core-counter/issues", + "source": "https://github.com/theofidry/cpu-core-counter/tree/1.3.0" }, "funding": [ { - "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", - "type": "tidelift" + "url": "https://github.com/theofidry", + "type": "github" } ], - "time": "2020-11-13T09:40:50+00:00" + "time": "2025-08-14T07:29:31+00:00" }, { - "name": "nette/bootstrap", - "version": "v3.1.2", + "name": "friendsofphp/php-cs-fixer", + "version": "v3.95.23", "source": { "type": "git", - "url": "https://github.com/nette/bootstrap.git", - "reference": "3ab4912a08af0c16d541c3709935c3478b5ee090" + "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", + "reference": "b2932a5af3157a0c28324b1efe5e3b556dee09c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/bootstrap/zipball/3ab4912a08af0c16d541c3709935c3478b5ee090", - "reference": "3ab4912a08af0c16d541c3709935c3478b5ee090", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/b2932a5af3157a0c28324b1efe5e3b556dee09c4", + "reference": "b2932a5af3157a0c28324b1efe5e3b556dee09c4", "shasum": "" }, "require": { - "nette/di": "^3.0.5", - "nette/utils": "^3.2.1", - "php": ">=7.2 <8.2" - }, - "conflict": { - "tracy/tracy": "<2.6" + "clue/ndjson-react": "^1.3", + "composer/semver": "^3.4", + "composer/xdebug-handler": "^3.0.5", + "ergebnis/agent-detector": "^1.2", + "ext-filter": "*", + "ext-hash": "*", + "ext-json": "*", + "ext-tokenizer": "*", + "fidry/cpu-core-counter": "^1.3", + "php": "^7.4 || ^8.0", + "react/child-process": "^0.6.6", + "react/event-loop": "^1.5", + "react/socket": "^1.16", + "react/stream": "^1.4", + "sebastian/diff": "^4.0.6 || ^5.1.1 || ^6.0.2 || ^7.0 || ^8.0 || ^9.0", + "symfony/console": "^5.4.47 || ^6.4.24 || ^7.0 || ^8.0", + "symfony/event-dispatcher": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0", + "symfony/filesystem": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0", + "symfony/finder": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0", + "symfony/options-resolver": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0", + "symfony/polyfill-mbstring": "^1.37", + "symfony/polyfill-php80": "^1.37", + "symfony/polyfill-php81": "^1.37", + "symfony/polyfill-php84": "^1.37", + "symfony/process": "^5.4.47 || ^6.4.24 || ^7.2 || ^8.0", + "symfony/stopwatch": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0" }, "require-dev": { - "latte/latte": "^2.8", - "nette/application": "^3.1", - "nette/caching": "^3.0", - "nette/database": "^3.0", - "nette/forms": "^3.0", - "nette/http": "^3.0", - "nette/mail": "^3.0", - "nette/robot-loader": "^3.0", - "nette/safe-stream": "^2.2", - "nette/security": "^3.0", - "nette/tester": "^2.0", - "phpstan/phpstan-nette": "^0.12", - "tracy/tracy": "^2.6" + "facile-it/paraunit": "^1.3.1 || ^2.11.0", + "infection/infection": "^0.32.7", + "justinrainbow/json-schema": "^6.10.0", + "keradus/cli-executor": "^2.3", + "php-coveralls/php-coveralls": "^2.9.1", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.8", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.8", + "phpunit/phpunit": "^9.6.35 || ^10.5.64 || ^11.5.56 || ^12.5.31 || ^13.0.6", + "symfony/polyfill-php85": "^1.38", + "symfony/var-dumper": "^5.4.48 || ^6.4.36 || ^7.4.8 || ^8.1.1", + "symfony/yaml": "^5.4.53 || ^6.4.41 || ^7.4.13 || ^8.1.1" }, "suggest": { - "nette/robot-loader": "to use Configurator::createRobotLoader()", - "tracy/tracy": "to use Configurator::enableTracy()" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1-dev" - } + "ext-dom": "For handling output formats in XML", + "ext-mbstring": "For handling non-UTF8 characters." }, + "bin": [ + "php-cs-fixer" + ], + "type": "application", "autoload": { - "classmap": [ - "src/" + "psr-4": { + "PhpCsFixer\\": "src/" + }, + "exclude-from-classmap": [ + "src/**/Internal/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause", - "GPL-2.0-only", - "GPL-3.0-only" + "MIT" ], "authors": [ { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" + "name": "Dariusz Rumiński", + "email": "dariusz.ruminski@gmail.com" } ], - "description": "🅱 Nette Bootstrap: the simple way to configure and bootstrap your Nette application.", - "homepage": "https://nette.org", + "description": "A tool to automatically fix PHP code style", "keywords": [ - "bootstrapping", - "configurator", - "nette" + "Static code analysis", + "fixer", + "standards", + "static analysis" ], "support": { - "issues": "https://github.com/nette/bootstrap/issues", - "source": "https://github.com/nette/bootstrap/tree/v3.1.2" + "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.95.23" }, - "time": "2021-11-24T16:51:46+00:00" + "funding": [ + { + "url": "https://github.com/keradus", + "type": "github" + } + ], + "time": "2026-08-26T19:54:54+00:00" }, { - "name": "nette/di", - "version": "v3.0.12", + "name": "hamcrest/hamcrest-php", + "version": "v3.0.0", "source": { "type": "git", - "url": "https://github.com/nette/di.git", - "reference": "11c236b9f7bbfc5a95e7b24742ad8847936feeb5" + "url": "https://github.com/hamcrest/hamcrest-php.git", + "reference": "b61cd040da1a4925bc90a51c074f5297e7c0fa52" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/di/zipball/11c236b9f7bbfc5a95e7b24742ad8847936feeb5", - "reference": "11c236b9f7bbfc5a95e7b24742ad8847936feeb5", + "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/b61cd040da1a4925bc90a51c074f5297e7c0fa52", + "reference": "b61cd040da1a4925bc90a51c074f5297e7c0fa52", "shasum": "" }, "require": { - "ext-tokenizer": "*", - "nette/neon": "^3.3", - "nette/php-generator": "^3.5.4", - "nette/robot-loader": "^3.2", - "nette/schema": "^1.1", - "nette/utils": "^3.1.6", - "php": ">=7.1 <8.2" + "ext-ctype": "*", + "ext-dom": "*", + "php": "^7.4|^8.0" }, - "conflict": { - "nette/bootstrap": "<3.0" + "replace": { + "cordoval/hamcrest-php": "*", + "davedevelopment/hamcrest-php": "*", + "kodova/hamcrest-php": "*" }, "require-dev": { - "nette/tester": "^2.2", - "phpstan/phpstan": "^0.12", - "tracy/tracy": "^2.3" + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-phpunit": "^2.0", + "phpunit/php-file-iterator": "^1.4 || ^2.0 || ^3.0", + "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0 || ^8.0 || ^9.0" }, "type": "library", "extra": { @@ -1314,274 +1393,248 @@ }, "autoload": { "classmap": [ - "src/" + "hamcrest" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause", - "GPL-2.0-only", - "GPL-3.0-only" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } + "BSD-3-Clause" ], - "description": "💎 Nette Dependency Injection Container: Flexible, compiled and full-featured DIC with perfectly usable autowiring and support for all new PHP features.", - "homepage": "https://nette.org", + "description": "This is the PHP port of Hamcrest Matchers", "keywords": [ - "compiled", - "di", - "dic", - "factory", - "ioc", - "nette", - "static" + "test" ], "support": { - "issues": "https://github.com/nette/di/issues", - "source": "https://github.com/nette/di/tree/v3.0.12" + "issues": "https://github.com/hamcrest/hamcrest-php/issues", + "source": "https://github.com/hamcrest/hamcrest-php/tree/v3.0.0" }, - "time": "2021-12-15T21:05:11+00:00" + "time": "2026-03-17T11:56:53+00:00" }, { - "name": "nette/finder", - "version": "v2.5.3", + "name": "mockery/mockery", + "version": "1.6.15", "source": { "type": "git", - "url": "https://github.com/nette/finder.git", - "reference": "64dc25b7929b731e72a1bc84a9e57727f5d5d3e8" + "url": "https://github.com/mockery/mockery.git", + "reference": "967a801bd188989a5669bd280f252d51c0fdc9ee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/finder/zipball/64dc25b7929b731e72a1bc84a9e57727f5d5d3e8", - "reference": "64dc25b7929b731e72a1bc84a9e57727f5d5d3e8", + "url": "https://api.github.com/repos/mockery/mockery/zipball/967a801bd188989a5669bd280f252d51c0fdc9ee", + "reference": "967a801bd188989a5669bd280f252d51c0fdc9ee", "shasum": "" }, "require": { - "nette/utils": "^2.4 || ^3.0", - "php": ">=7.1" + "hamcrest/hamcrest-php": "^2.0 || ^3.0", + "php": ">=7.3" }, "conflict": { - "nette/nette": "<2.2" + "phpunit/phpunit": "<8.0" }, "require-dev": { - "nette/tester": "^2.0", - "phpstan/phpstan": "^0.12", - "tracy/tracy": "^2.3" + "phpunit/phpunit": "^9.6.36", + "symplify/easy-coding-standard": "^13.2.17" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.5-dev" - } - }, "autoload": { - "classmap": [ - "src/" - ] + "files": [ + "library/helpers.php", + "library/Mockery.php" + ], + "psr-4": { + "Mockery\\": "library/Mockery" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause", - "GPL-2.0-only", - "GPL-3.0-only" + "BSD-3-Clause" ], "authors": [ { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" + "name": "Pádraic Brady", + "email": "padraic.brady@gmail.com", + "homepage": "https://github.com/padraic", + "role": "Author" + }, + { + "name": "Dave Marshall", + "email": "dave.marshall@atstsolutions.co.uk", + "homepage": "https://davedevelopment.co.uk", + "role": "Developer" }, { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" + "name": "Nathanael Esayeas", + "email": "nathanael.esayeas@protonmail.com", + "homepage": "https://github.com/ghostwriter", + "role": "Lead Developer" } ], - "description": "🔍 Nette Finder: find files and directories with an intuitive API.", - "homepage": "https://nette.org", + "description": "Mockery is a simple yet flexible PHP mock object framework", + "homepage": "https://github.com/mockery/mockery", "keywords": [ - "filesystem", - "glob", - "iterator", - "nette" + "BDD", + "TDD", + "library", + "mock", + "mock objects", + "mockery", + "stub", + "test", + "test double", + "testing" ], "support": { - "issues": "https://github.com/nette/finder/issues", - "source": "https://github.com/nette/finder/tree/v2.5.3" + "docs": "https://docs.mockery.io/", + "issues": "https://github.com/mockery/mockery/issues", + "rss": "https://github.com/mockery/mockery/releases.atom", + "security": "https://github.com/mockery/mockery/security/advisories", + "source": "https://github.com/mockery/mockery" }, - "time": "2021-12-12T17:43:24+00:00" + "time": "2026-08-19T19:37:52+00:00" }, { - "name": "nette/neon", - "version": "v3.3.2", + "name": "myclabs/deep-copy", + "version": "1.14.0", "source": { "type": "git", - "url": "https://github.com/nette/neon.git", - "reference": "54b287d8c2cdbe577b02e28ca1713e275b05ece2" + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "8680aa248f8e07bc8fb43f56f0f5fc77a0c96aae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/neon/zipball/54b287d8c2cdbe577b02e28ca1713e275b05ece2", - "reference": "54b287d8c2cdbe577b02e28ca1713e275b05ece2", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/8680aa248f8e07bc8fb43f56f0f5fc77a0c96aae", + "reference": "8680aa248f8e07bc8fb43f56f0f5fc77a0c96aae", "shasum": "" }, "require": { - "ext-json": "*", - "php": ">=7.1" + "php": "^8.0" + }, + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3 <3.2.2" }, "require-dev": { - "nette/tester": "^2.0", - "phpstan/phpstan": "^0.12", - "tracy/tracy": "^2.7" + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, - "bin": [ - "bin/neon-lint" - ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3-dev" - } - }, "autoload": { - "classmap": [ - "src/" - ] + "files": [ + "src/DeepCopy/deep_copy.php" + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause", - "GPL-2.0-only", - "GPL-3.0-only" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } + "MIT" ], - "description": "🍸 Nette NEON: encodes and decodes NEON file format.", - "homepage": "https://ne-on.org", + "description": "Create deep copies (clones) of your objects", "keywords": [ - "export", - "import", - "neon", - "nette", - "yaml" + "clone", + "copy", + "duplicate", + "object", + "object graph" ], "support": { - "issues": "https://github.com/nette/neon/issues", - "source": "https://github.com/nette/neon/tree/v3.3.2" + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.14.0" }, - "time": "2021-11-25T15:57:41+00:00" + "funding": [ + { + "url": "https://github.com/mnapoli", + "type": "github" + } + ], + "time": "2026-08-11T10:17:44+00:00" }, { - "name": "nette/php-generator", - "version": "v3.6.5", + "name": "nikic/php-parser", + "version": "v5.8.0", "source": { "type": "git", - "url": "https://github.com/nette/php-generator.git", - "reference": "9370403f9d9c25b51c4596ded1fbfe70347f7c82" + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "044a6a392ff8ad0d61f14370a5fbbd0a0107152f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/php-generator/zipball/9370403f9d9c25b51c4596ded1fbfe70347f7c82", - "reference": "9370403f9d9c25b51c4596ded1fbfe70347f7c82", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/044a6a392ff8ad0d61f14370a5fbbd0a0107152f", + "reference": "044a6a392ff8ad0d61f14370a5fbbd0a0107152f", "shasum": "" }, "require": { - "nette/utils": "^3.1.2", - "php": ">=7.2 <8.2" + "ext-json": "*", + "ext-tokenizer": "*", + "php": ">=7.4" }, "require-dev": { - "nette/tester": "^2.4", - "nikic/php-parser": "^4.13", - "phpstan/phpstan": "^0.12", - "tracy/tracy": "^2.8" - }, - "suggest": { - "nikic/php-parser": "to use ClassType::withBodiesFrom() & GlobalFunction::withBodyFrom()" + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^9.0" }, + "bin": [ + "bin/php-parse" + ], "type": "library", "extra": { "branch-alias": { - "dev-master": "3.6-dev" + "dev-master": "5.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause", - "GPL-2.0-only", - "GPL-3.0-only" + "BSD-3-Clause" ], "authors": [ { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" + "name": "Nikita Popov" } ], - "description": "🐘 Nette PHP Generator: generates neat PHP code for you. Supports new PHP 8.1 features.", - "homepage": "https://nette.org", + "description": "A PHP parser written in PHP", "keywords": [ - "code", - "nette", - "php", - "scaffolding" + "parser", + "php" ], "support": { - "issues": "https://github.com/nette/php-generator/issues", - "source": "https://github.com/nette/php-generator/tree/v3.6.5" + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v5.8.0" }, - "time": "2021-11-24T16:23:44+00:00" + "time": "2026-07-04T14:30:18+00:00" }, { - "name": "nette/robot-loader", - "version": "v3.4.1", + "name": "phar-io/manifest", + "version": "2.0.4", "source": { "type": "git", - "url": "https://github.com/nette/robot-loader.git", - "reference": "e2adc334cb958164c050f485d99c44c430f51fe2" + "url": "https://github.com/phar-io/manifest.git", + "reference": "54750ef60c58e43759730615a392c31c80e23176" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/robot-loader/zipball/e2adc334cb958164c050f485d99c44c430f51fe2", - "reference": "e2adc334cb958164c050f485d99c44c430f51fe2", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", "shasum": "" }, "require": { - "ext-tokenizer": "*", - "nette/finder": "^2.5 || ^3.0", - "nette/utils": "^3.0", - "php": ">=7.1" - }, - "require-dev": { - "nette/tester": "^2.0", - "phpstan/phpstan": "^0.12", - "tracy/tracy": "^2.3" + "ext-dom": "*", + "ext-libxml": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -1591,64 +1644,56 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause", - "GPL-2.0-only", - "GPL-3.0-only" + "BSD-3-Clause" ], "authors": [ { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" }, { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" } ], - "description": "🍀 Nette RobotLoader: high performance and comfortable autoloader that will search and autoload classes within your application.", - "homepage": "https://nette.org", - "keywords": [ - "autoload", - "class", - "interface", - "nette", - "trait" - ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", "support": { - "issues": "https://github.com/nette/robot-loader/issues", - "source": "https://github.com/nette/robot-loader/tree/v3.4.1" + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.4" }, - "time": "2021-08-25T15:53:54+00:00" + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:33:53+00:00" }, { - "name": "nette/schema", - "version": "v1.2.2", + "name": "phar-io/version", + "version": "3.2.1", "source": { "type": "git", - "url": "https://github.com/nette/schema.git", - "reference": "9a39cef03a5b34c7de64f551538cbba05c2be5df" + "url": "https://github.com/phar-io/version.git", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/schema/zipball/9a39cef03a5b34c7de64f551538cbba05c2be5df", - "reference": "9a39cef03a5b34c7de64f551538cbba05c2be5df", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", "shasum": "" }, "require": { - "nette/utils": "^2.5.7 || ^3.1.5 || ^4.0", - "php": ">=7.1 <8.2" - }, - "require-dev": { - "nette/tester": "^2.3 || ^2.4", - "phpstan/phpstan-nette": "^0.12", - "tracy/tracy": "^2.7" + "php": "^7.2 || ^8.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2-dev" - } - }, "autoload": { "classmap": [ "src/" @@ -1656,198 +1701,304 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause", - "GPL-2.0-only", - "GPL-3.0-only" + "BSD-3-Clause" ], "authors": [ { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" }, { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" } ], - "description": "📐 Nette Schema: validating data structures against a given Schema.", - "homepage": "https://nette.org", - "keywords": [ - "config", - "nette" - ], + "description": "Library for handling version information and constraints", "support": { - "issues": "https://github.com/nette/schema/issues", - "source": "https://github.com/nette/schema/tree/v1.2.2" + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.2.1" }, - "time": "2021-10-15T11:40:02+00:00" + "time": "2022-02-21T01:04:05+00:00" }, { - "name": "nette/utils", - "version": "v3.2.6", + "name": "php-parallel-lint/php-parallel-lint", + "version": "v1.4.0", "source": { "type": "git", - "url": "https://github.com/nette/utils.git", - "reference": "2f261e55bd6a12057442045bf2c249806abc1d02" + "url": "https://github.com/php-parallel-lint/PHP-Parallel-Lint.git", + "reference": "6db563514f27e19595a19f45a4bf757b6401194e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/utils/zipball/2f261e55bd6a12057442045bf2c249806abc1d02", - "reference": "2f261e55bd6a12057442045bf2c249806abc1d02", + "url": "https://api.github.com/repos/php-parallel-lint/PHP-Parallel-Lint/zipball/6db563514f27e19595a19f45a4bf757b6401194e", + "reference": "6db563514f27e19595a19f45a4bf757b6401194e", "shasum": "" }, "require": { - "php": ">=7.2 <8.2" + "ext-json": "*", + "php": ">=5.3.0" }, - "conflict": { - "nette/di": "<3.0.6" + "replace": { + "grogy/php-parallel-lint": "*", + "jakub-onderka/php-parallel-lint": "*" }, "require-dev": { - "nette/tester": "~2.0", - "phpstan/phpstan": "^1.0", - "tracy/tracy": "^2.3" + "nette/tester": "^1.3 || ^2.0", + "php-parallel-lint/php-console-highlighter": "0.* || ^1.0", + "squizlabs/php_codesniffer": "^3.6" }, "suggest": { - "ext-gd": "to use Image", - "ext-iconv": "to use Strings::webalize(), toAscii(), chr() and reverse()", - "ext-intl": "to use Strings::webalize(), toAscii(), normalize() and compare()", - "ext-json": "to use Nette\\Utils\\Json", - "ext-mbstring": "to use Strings::lower() etc...", - "ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()", - "ext-xml": "to use Strings::length() etc. when mbstring is not available" + "php-parallel-lint/php-console-highlighter": "Highlight syntax in code snippet" }, + "bin": [ + "parallel-lint" + ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, "autoload": { "classmap": [ - "src/" + "./src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause", - "GPL-2.0-only", - "GPL-3.0-only" + "BSD-2-Clause" ], "authors": [ { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" + "name": "Jakub Onderka", + "email": "ahoj@jakubonderka.cz" } ], - "description": "🛠 Nette Utils: lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.", - "homepage": "https://nette.org", + "description": "This tool checks the syntax of PHP files about 20x faster than serial check.", + "homepage": "https://github.com/php-parallel-lint/PHP-Parallel-Lint", "keywords": [ - "array", - "core", - "datetime", - "images", - "json", - "nette", - "paginator", - "password", - "slugify", - "string", - "unicode", - "utf-8", - "utility", - "validation" + "lint", + "static analysis" ], "support": { - "issues": "https://github.com/nette/utils/issues", - "source": "https://github.com/nette/utils/tree/v3.2.6" + "issues": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/issues", + "source": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/tree/v1.4.0" }, - "time": "2021-11-24T15:47:23+00:00" + "time": "2024-03-27T12:14:49+00:00" }, { - "name": "nikic/php-parser", - "version": "v4.13.2", - "source": { - "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "210577fe3cf7badcc5814d99455df46564f3c077" - }, + "name": "phpstan/phpstan", + "version": "2.2.11", "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/210577fe3cf7badcc5814d99455df46564f3c077", - "reference": "210577fe3cf7badcc5814d99455df46564f3c077", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/0eb899d48d9b784eee3f1b58a6c9dc79734cf811", + "reference": "0eb899d48d9b784eee3f1b58a6c9dc79734cf811", "shasum": "" }, "require": { - "ext-tokenizer": "*", - "php": ">=7.0" + "php": "^7.4|^8.0" }, - "require-dev": { - "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + "conflict": { + "phpstan/phpstan-shim": "*" }, "bin": [ - "bin/php-parse" + "phpstan", + "phpstan.phar" ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.9-dev" - } - }, "autoload": { - "psr-4": { - "PhpParser\\": "lib/PhpParser" - } + "files": [ + "bootstrap.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Nikita Popov" + "name": "Ondřej Mirtes" + }, + { + "name": "Markus Staab" + }, + { + "name": "Vincent Langlet" } ], - "description": "A PHP parser written in PHP", + "description": "PHPStan - PHP Static Analysis Tool", "keywords": [ - "parser", - "php" + "dev", + "static analysis" ], "support": { - "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.2" + "docs": "https://phpstan.org/user-guide/getting-started", + "forum": "https://github.com/phpstan/phpstan/discussions", + "issues": "https://github.com/phpstan/phpstan/issues", + "security": "https://github.com/phpstan/phpstan/security/policy", + "source": "https://github.com/phpstan/phpstan-src" }, - "time": "2021-11-30T19:35:32+00:00" + "funding": [ + { + "url": "https://github.com/ondrejmirtes", + "type": "github" + }, + { + "url": "https://github.com/phpstan", + "type": "github" + } + ], + "time": "2026-08-31T10:33:10+00:00" }, { - "name": "phar-io/manifest", - "version": "2.0.3", + "name": "phpstan/phpstan-mockery", + "version": "2.0.0", "source": { "type": "git", - "url": "https://github.com/phar-io/manifest.git", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + "url": "https://github.com/phpstan/phpstan-mockery.git", + "reference": "89a949d0ac64298e88b7c7fa00caee565c198394" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan-mockery/zipball/89a949d0ac64298e88b7c7fa00caee565c198394", + "reference": "89a949d0ac64298e88b7c7fa00caee565c198394", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0", + "phpstan/phpstan": "^2.0" + }, + "require-dev": { + "mockery/mockery": "^1.6.11", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^9.6" + }, + "type": "phpstan-extension", + "extra": { + "phpstan": { + "includes": [ + "extension.neon" + ] + } + }, + "autoload": { + "psr-4": { + "PHPStan\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan Mockery extension", + "support": { + "issues": "https://github.com/phpstan/phpstan-mockery/issues", + "source": "https://github.com/phpstan/phpstan-mockery/tree/2.0.0" + }, + "time": "2024-10-14T03:18:12+00:00" + }, + { + "name": "phpstan/phpstan-phpunit", + "version": "2.0.18", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan-phpunit.git", + "reference": "f5dc20ff8082d02339b60cab68ec3eb0d859fb30" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/f5dc20ff8082d02339b60cab68ec3eb0d859fb30", + "reference": "f5dc20ff8082d02339b60cab68ec3eb0d859fb30", + "shasum": "" + }, + "require": { + "phar-io/version": "^3.2", + "php": "^7.4 || ^8.0", + "phpstan/phpstan": "^2.2.3" + }, + "conflict": { + "phpunit/phpunit": "<7.0" + }, + "require-dev": { + "nikic/php-parser": "^5", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/phpstan-deprecation-rules": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^9.6", + "shipmonk/name-collision-detector": "^2.1" + }, + "type": "phpstan-extension", + "extra": { + "phpstan": { + "includes": [ + "extension.neon", + "rules.neon" + ] + } + }, + "autoload": { + "psr-4": { + "PHPStan\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPUnit extensions and rules for PHPStan", + "keywords": [ + "static analysis" + ], + "support": { + "issues": "https://github.com/phpstan/phpstan-phpunit/issues", + "source": "https://github.com/phpstan/phpstan-phpunit/tree/2.0.18" + }, + "time": "2026-07-04T12:16:09+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "11.0.12", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "2c1ed04922802c15e1de5d7447b4856de949cf56" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2c1ed04922802c15e1de5d7447b4856de949cf56", + "reference": "2c1ed04922802c15e1de5d7447b4856de949cf56", "shasum": "" }, "require": { "ext-dom": "*", - "ext-phar": "*", + "ext-libxml": "*", "ext-xmlwriter": "*", - "phar-io/version": "^3.0.1", - "php": "^7.2 || ^8.0" + "nikic/php-parser": "^5.7.0", + "php": ">=8.2", + "phpunit/php-file-iterator": "^5.1.0", + "phpunit/php-text-template": "^4.0.1", + "sebastian/code-unit-reverse-lookup": "^4.0.1", + "sebastian/complexity": "^4.0.1", + "sebastian/environment": "^7.2.1", + "sebastian/lines-of-code": "^3.0.1", + "sebastian/version": "^5.0.2", + "theseer/tokenizer": "^1.3.1" + }, + "require-dev": { + "phpunit/phpunit": "^11.5.46" + }, + "suggest": { + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-main": "11.0.x-dev" } }, "autoload": { @@ -1860,47 +2011,70 @@ "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" + "role": "lead" } ], - "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "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/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/2.0.3" + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/11.0.12" }, - "time": "2021-07-20T11:28:43+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/php-code-coverage", + "type": "tidelift" + } + ], + "time": "2025-12-24T07:01:01+00:00" }, { - "name": "phar-io/version", - "version": "3.1.0", + "name": "phpunit/php-file-iterator", + "version": "5.1.1", "source": { "type": "git", - "url": "https://github.com/phar-io/version.git", - "reference": "bae7c545bef187884426f042434e561ab1ddb182" + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "2f3a64888c814fc235386b7387dd5b5ed92ad903" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/bae7c545bef187884426f042434e561ab1ddb182", - "reference": "bae7c545bef187884426f042434e561ab1ddb182", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/2f3a64888c814fc235386b7387dd5b5ed92ad903", + "reference": "2f3a64888c814fc235386b7387dd5b5ed92ad903", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.3" }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.1-dev" + } + }, "autoload": { "classmap": [ "src/" @@ -1912,111 +2086,574 @@ ], "authors": [ { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" + "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", + "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/5.1.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" }, { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/php-file-iterator", + "type": "tidelift" + } + ], + "time": "2026-02-02T13:52:54+00:00" + }, + { + "name": "phpunit/php-invoker", + "version": "5.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "c1ca3814734c07492b3d4c5f794f4b0995333da2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/c1ca3814734c07492b3d4c5f794f4b0995333da2", + "reference": "c1ca3814734c07492b3d4c5f794f4b0995333da2", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^11.0" + }, + "suggest": { + "ext-pcntl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "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": "Developer" + "role": "lead" } ], - "description": "Library for handling version information and constraints", + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], "support": { - "issues": "https://github.com/phar-io/version/issues", - "source": "https://github.com/phar-io/version/tree/3.1.0" + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "security": "https://github.com/sebastianbergmann/php-invoker/security/policy", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/5.0.1" }, - "time": "2021-02-23T14:00:09+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T05:07:44+00:00" }, { - "name": "php-parallel-lint/php-parallel-lint", - "version": "v1.3.1", + "name": "phpunit/php-text-template", + "version": "4.0.1", "source": { "type": "git", - "url": "https://github.com/php-parallel-lint/PHP-Parallel-Lint.git", - "reference": "761f3806e30239b5fcd90a0a45d41dc2138de192" + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "3e0404dc6b300e6bf56415467ebcb3fe4f33e964" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-parallel-lint/PHP-Parallel-Lint/zipball/761f3806e30239b5fcd90a0a45d41dc2138de192", - "reference": "761f3806e30239b5fcd90a0a45d41dc2138de192", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/3e0404dc6b300e6bf56415467ebcb3fe4f33e964", + "reference": "3e0404dc6b300e6bf56415467ebcb3fe4f33e964", "shasum": "" }, "require": { - "ext-json": "*", - "php": ">=5.3.0" - }, - "replace": { - "grogy/php-parallel-lint": "*", - "jakub-onderka/php-parallel-lint": "*" + "php": ">=8.2" }, "require-dev": { - "nette/tester": "^1.3 || ^2.0", - "php-parallel-lint/php-console-highlighter": "~0.3", - "squizlabs/php_codesniffer": "^3.6" + "phpunit/phpunit": "^11.0" }, - "suggest": { - "php-parallel-lint/php-console-highlighter": "Highlight syntax in code snippet" + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.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", + "security": "https://github.com/sebastianbergmann/php-text-template/security/policy", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/4.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T05:08:43+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "7.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3b415def83fbcb41f991d9ebf16ae4ad8b7837b3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3b415def83fbcb41f991d9ebf16ae4ad8b7837b3", + "reference": "3b415def83fbcb41f991d9ebf16ae4ad8b7837b3", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "7.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", + "security": "https://github.com/sebastianbergmann/php-timer/security/policy", + "source": "https://github.com/sebastianbergmann/php-timer/tree/7.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T05:09:35+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "11.5.56", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "5f83edffa6967c3db468d48a695ec7bcb02e9256" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/5f83edffa6967c3db468d48a695ec7bcb02e9256", + "reference": "5f83edffa6967c3db468d48a695ec7bcb02e9256", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-filter": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.13.4", + "phar-io/manifest": "^2.0.4", + "phar-io/version": "^3.2.1", + "php": ">=8.2", + "phpunit/php-code-coverage": "^11.0.12", + "phpunit/php-file-iterator": "^5.1.1", + "phpunit/php-invoker": "^5.0.1", + "phpunit/php-text-template": "^4.0.1", + "phpunit/php-timer": "^7.0.1", + "sebastian/cli-parser": "^3.0.2", + "sebastian/code-unit": "^3.0.3", + "sebastian/comparator": "^6.3.3", + "sebastian/diff": "^6.0.2", + "sebastian/environment": "^7.2.1", + "sebastian/exporter": "^6.3.2", + "sebastian/global-state": "^7.0.2", + "sebastian/object-enumerator": "^6.0.1", + "sebastian/recursion-context": "^6.0.3", + "sebastian/type": "^5.1.3", + "sebastian/version": "^5.0.2", + "staabm/side-effects-detector": "^1.0.5" + }, + "suggest": { + "ext-soap": "To be able to generate mocks based on WSDL files" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "11.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", + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.56" + }, + "funding": [ + { + "url": "https://phpunit.de/sponsoring.html", + "type": "other" + } + ], + "time": "2026-07-06T14:52:39+00:00" + }, + { + "name": "psr/container", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "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/2.0.2" + }, + "time": "2021-11-05T16:47:00+00:00" + }, + { + "name": "psr/event-dispatcher", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\EventDispatcher\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Standard interfaces for event handling.", + "keywords": [ + "events", + "psr", + "psr-14" + ], + "support": { + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + }, + "time": "2019-01-08T18:20:26+00:00" + }, + { + "name": "psr/log", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.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/3.0.2" + }, + "time": "2024-09-11T13:17:53+00:00" + }, + { + "name": "react/cache", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/cache.git", + "reference": "d47c472b64aa5608225f47965a484b75c7817d5b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/cache/zipball/d47c472b64aa5608225f47965a484b75c7817d5b", + "reference": "d47c472b64aa5608225f47965a484b75c7817d5b", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "react/promise": "^3.0 || ^2.0 || ^1.1" + }, + "require-dev": { + "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35" }, - "bin": [ - "parallel-lint" - ], "type": "library", "autoload": { - "classmap": [ - "./" - ] + "psr-4": { + "React\\Cache\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-2-Clause" + "MIT" ], "authors": [ { - "name": "Jakub Onderka", - "email": "ahoj@jakubonderka.cz" + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "This tool check syntax of PHP files about 20x faster than serial check.", - "homepage": "https://github.com/php-parallel-lint/PHP-Parallel-Lint", + "description": "Async, Promise-based cache interface for ReactPHP", + "keywords": [ + "cache", + "caching", + "promise", + "reactphp" + ], "support": { - "issues": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/issues", - "source": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/tree/v1.3.1" + "issues": "https://github.com/reactphp/cache/issues", + "source": "https://github.com/reactphp/cache/tree/v1.2.0" }, - "time": "2021-08-13T05:35:13+00:00" + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2022-11-30T15:59:55+00:00" }, { - "name": "phpdocumentor/reflection-common", - "version": "2.2.0", + "name": "react/child-process", + "version": "v0.6.7", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" + "url": "https://github.com/reactphp/child-process.git", + "reference": "970f0e71945556422ee4570ccbabaedc3cf04ad3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "url": "https://api.github.com/repos/reactphp/child-process/zipball/970f0e71945556422ee4570ccbabaedc3cf04ad3", + "reference": "970f0e71945556422ee4570ccbabaedc3cf04ad3", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.0", + "react/event-loop": "^1.2", + "react/stream": "^1.4" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-2.x": "2.x-dev" - } + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/socket": "^1.16", + "sebastian/environment": "^5.0 || ^3.0 || ^2.0 || ^1.0" }, + "type": "library", "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": "src/" + "React\\ChildProcess\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -2025,59 +2662,73 @@ ], "authors": [ { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", + "description": "Event-driven library for executing child processes with ReactPHP.", "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" + "event-driven", + "process", + "reactphp" ], "support": { - "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", - "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" + "issues": "https://github.com/reactphp/child-process/issues", + "source": "https://github.com/reactphp/child-process/tree/v0.6.7" }, - "time": "2020-06-27T09:03:43+00:00" + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2025-12-23T15:25:20+00:00" }, { - "name": "phpdocumentor/reflection-docblock", - "version": "5.1.0", + "name": "react/dns", + "version": "v1.14.0", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e" + "url": "https://github.com/reactphp/dns.git", + "reference": "7562c05391f42701c1fccf189c8225fece1cd7c3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e", - "reference": "cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e", + "url": "https://api.github.com/repos/reactphp/dns/zipball/7562c05391f42701c1fccf189c8225fece1cd7c3", + "reference": "7562c05391f42701c1fccf189c8225fece1cd7c3", "shasum": "" }, "require": { - "ext-filter": "^7.1", - "php": "^7.2", - "phpdocumentor/reflection-common": "^2.0", - "phpdocumentor/type-resolver": "^1.0", - "webmozart/assert": "^1" + "php": ">=5.3.0", + "react/cache": "^1.0 || ^0.6 || ^0.5", + "react/event-loop": "^1.2", + "react/promise": "^3.2 || ^2.7 || ^1.2.1" }, "require-dev": { - "doctrine/instantiator": "^1", - "mockery/mockery": "^1" + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/async": "^4.3 || ^3 || ^2", + "react/promise-timer": "^1.11" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.x-dev" - } - }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": "src" + "React\\Dns\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -2086,52 +2737,72 @@ ], "authors": [ { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" }, { - "name": "Jaap van Otterdijk", - "email": "account@ijaap.nl" + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "description": "Async DNS resolver for ReactPHP", + "keywords": [ + "async", + "dns", + "dns-resolver", + "reactphp" + ], "support": { - "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.1.0" + "issues": "https://github.com/reactphp/dns/issues", + "source": "https://github.com/reactphp/dns/tree/v1.14.0" }, - "time": "2020-02-22T12:28:44+00:00" + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2025-11-18T19:34:28+00:00" }, { - "name": "phpdocumentor/type-resolver", - "version": "1.5.1", + "name": "react/event-loop", + "version": "v1.6.0", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae" + "url": "https://github.com/reactphp/event-loop.git", + "reference": "ba276bda6083df7e0050fd9b33f66ad7a4ac747a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/a12f7e301eb7258bb68acd89d4aefa05c2906cae", - "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae", + "url": "https://api.github.com/repos/reactphp/event-loop/zipball/ba276bda6083df7e0050fd9b33f66ad7a4ac747a", + "reference": "ba276bda6083df7e0050fd9b33f66ad7a4ac747a", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.0" + "php": ">=5.3.0" }, "require-dev": { - "ext-tokenizer": "*", - "psalm/phar": "^4.8" + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-1.x": "1.x-dev" - } + "suggest": { + "ext-pcntl": "For signal handling support when using the StreamSelectLoop" }, + "type": "library", "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": "src" + "React\\EventLoop\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -2140,122 +2811,148 @@ ], "authors": [ { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.", + "keywords": [ + "asynchronous", + "event-loop" + ], "support": { - "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.5.1" + "issues": "https://github.com/reactphp/event-loop/issues", + "source": "https://github.com/reactphp/event-loop/tree/v1.6.0" }, - "time": "2021-10-02T14:08:47+00:00" + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2025-11-17T20:46:25+00:00" }, { - "name": "phpoption/phpoption", - "version": "1.8.1", + "name": "react/promise", + "version": "v3.3.0", "source": { "type": "git", - "url": "https://github.com/schmittjoh/php-option.git", - "reference": "eab7a0df01fe2344d172bff4cd6dbd3f8b84ad15" + "url": "https://github.com/reactphp/promise.git", + "reference": "23444f53a813a3296c1368bb104793ce8d88f04a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/eab7a0df01fe2344d172bff4cd6dbd3f8b84ad15", - "reference": "eab7a0df01fe2344d172bff4cd6dbd3f8b84ad15", + "url": "https://api.github.com/repos/reactphp/promise/zipball/23444f53a813a3296c1368bb104793ce8d88f04a", + "reference": "23444f53a813a3296c1368bb104793ce8d88f04a", "shasum": "" }, "require": { - "php": "^7.0 || ^8.0" + "php": ">=7.1.0" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.4.1", - "phpunit/phpunit": "^6.5.14 || ^7.5.20 || ^8.5.19 || ^9.5.8" + "phpstan/phpstan": "1.12.28 || 1.4.10", + "phpunit/phpunit": "^9.6 || ^7.5" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.8-dev" - } - }, "autoload": { + "files": [ + "src/functions_include.php" + ], "psr-4": { - "PhpOption\\": "src/PhpOption/" + "React\\Promise\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "Apache-2.0" + "MIT" ], "authors": [ { - "name": "Johannes M. Schmitt", - "email": "schmittjoh@gmail.com", - "homepage": "https://github.com/schmittjoh" + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" }, { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "Option Type for PHP", + "description": "A lightweight implementation of CommonJS Promises/A for PHP", "keywords": [ - "language", - "option", - "php", - "type" + "promise", + "promises" ], "support": { - "issues": "https://github.com/schmittjoh/php-option/issues", - "source": "https://github.com/schmittjoh/php-option/tree/1.8.1" + "issues": "https://github.com/reactphp/promise/issues", + "source": "https://github.com/reactphp/promise/tree/v3.3.0" }, "funding": [ { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpoption/phpoption", - "type": "tidelift" + "url": "https://opencollective.com/reactphp", + "type": "open_collective" } ], - "time": "2021-12-04T23:24:31+00:00" + "time": "2025-08-19T18:57:03+00:00" }, { - "name": "phpspec/prophecy", - "version": "1.11.1", + "name": "react/socket", + "version": "v1.17.0", "source": { "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "b20034be5efcdab4fb60ca3a29cba2949aead160" + "url": "https://github.com/reactphp/socket.git", + "reference": "ef5b17b81f6f60504c539313f94f2d826c5faa08" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/b20034be5efcdab4fb60ca3a29cba2949aead160", - "reference": "b20034be5efcdab4fb60ca3a29cba2949aead160", + "url": "https://api.github.com/repos/reactphp/socket/zipball/ef5b17b81f6f60504c539313f94f2d826c5faa08", + "reference": "ef5b17b81f6f60504c539313f94f2d826c5faa08", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.2", - "php": "^7.2", - "phpdocumentor/reflection-docblock": "^5.0", - "sebastian/comparator": "^3.0 || ^4.0", - "sebastian/recursion-context": "^3.0 || ^4.0" + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.0", + "react/dns": "^1.13", + "react/event-loop": "^1.2", + "react/promise": "^3.2 || ^2.6 || ^1.2.1", + "react/stream": "^1.4" }, "require-dev": { - "phpspec/phpspec": "^6.0", - "phpunit/phpunit": "^8.0" + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/async": "^4.3 || ^3.3 || ^2", + "react/promise-stream": "^1.4", + "react/promise-timer": "^1.11" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.11.x-dev" - } - }, "autoload": { "psr-4": { - "Prophecy\\": "src/Prophecy" + "React\\Socket\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -2264,269 +2961,262 @@ ], "authors": [ { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" }, { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", + "description": "Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP", "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" + "Connection", + "Socket", + "async", + "reactphp", + "stream" ], "support": { - "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/master" + "issues": "https://github.com/reactphp/socket/issues", + "source": "https://github.com/reactphp/socket/tree/v1.17.0" }, - "time": "2020-07-08T12:44:21+00:00" + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2025-11-19T20:47:34+00:00" }, { - "name": "phpstan/phpdoc-parser", - "version": "0.3.5", + "name": "react/stream", + "version": "v1.4.0", "source": { "type": "git", - "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "8c4ef2aefd9788238897b678a985e1d5c8df6db4" + "url": "https://github.com/reactphp/stream.git", + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/8c4ef2aefd9788238897b678a985e1d5c8df6db4", - "reference": "8c4ef2aefd9788238897b678a985e1d5c8df6db4", + "url": "https://api.github.com/repos/reactphp/stream/zipball/1e5b0acb8fe55143b5b426817155190eb6f5b18d", + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d", "shasum": "" }, "require": { - "php": "~7.1" + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.8", + "react/event-loop": "^1.2" }, "require-dev": { - "consistence/coding-standard": "^3.5", - "jakub-onderka/php-parallel-lint": "^0.9.2", - "phing/phing": "^2.16.0", - "phpstan/phpstan": "^0.10", - "phpunit/phpunit": "^6.3", - "slevomat/coding-standard": "^4.7.2", - "squizlabs/php_codesniffer": "^3.3.2", - "symfony/process": "^3.4 || ^4.0" + "clue/stream-filter": "~1.2", + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.3-dev" - } - }, "autoload": { "psr-4": { - "PHPStan\\PhpDocParser\\": [ - "src/" - ] + "React\\Stream\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "PHPDoc parser with support for nullable, intersection and generic types", + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Event-driven readable and writable streams for non-blocking I/O in ReactPHP", + "keywords": [ + "event-driven", + "io", + "non-blocking", + "pipe", + "reactphp", + "readable", + "stream", + "writable" + ], "support": { - "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/master" + "issues": "https://github.com/reactphp/stream/issues", + "source": "https://github.com/reactphp/stream/tree/v1.4.0" }, - "time": "2019-06-07T19:13:52+00:00" + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2024-06-11T12:45:25+00:00" }, { - "name": "phpstan/phpstan", - "version": "0.11.20", + "name": "sebastian/cli-parser", + "version": "3.0.2", "source": { "type": "git", - "url": "https://github.com/phpstan/phpstan.git", - "reference": "938dcc03a005280e1a9587ec7684345bff06ebfc" + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "15c5dd40dc4f38794d383bb95465193f5e0ae180" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/938dcc03a005280e1a9587ec7684345bff06ebfc", - "reference": "938dcc03a005280e1a9587ec7684345bff06ebfc", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/15c5dd40dc4f38794d383bb95465193f5e0ae180", + "reference": "15c5dd40dc4f38794d383bb95465193f5e0ae180", "shasum": "" }, "require": { - "composer/xdebug-handler": "^1.3.0", - "jean85/pretty-package-versions": "^1.0.3", - "nette/bootstrap": "^2.4 || ^3.0", - "nette/di": "^2.4.7 || ^3.0", - "nette/neon": "^2.4.3 || ^3.0", - "nette/robot-loader": "^3.0.1", - "nette/schema": "^1.0", - "nette/utils": "^2.4.5 || ^3.0", - "nikic/php-parser": "^4.2.3", - "php": "~7.1", - "phpstan/phpdoc-parser": "^0.3.5", - "symfony/console": "~3.2 || ~4.0", - "symfony/finder": "~3.2 || ~4.0" - }, - "conflict": { - "symfony/console": "3.4.16 || 4.1.5" + "php": ">=8.2" }, "require-dev": { - "brianium/paratest": "^2.0 || ^3.0", - "consistence/coding-standard": "^3.5", - "dealerdirect/phpcodesniffer-composer-installer": "^0.4.4", - "ext-intl": "*", - "ext-mysqli": "*", - "ext-simplexml": "*", - "ext-soap": "*", - "ext-zip": "*", - "jakub-onderka/php-parallel-lint": "^1.0", - "localheinz/composer-normalize": "^1.1.0", - "phing/phing": "^2.16.0", - "phpstan/phpstan-deprecation-rules": "^0.11", - "phpstan/phpstan-php-parser": "^0.11", - "phpstan/phpstan-phpunit": "^0.11", - "phpstan/phpstan-strict-rules": "^0.11", - "phpunit/phpunit": "^7.5.14 || ^8.0", - "slevomat/coding-standard": "^4.7.2", - "squizlabs/php_codesniffer": "^3.3.2" + "phpunit/phpunit": "^11.0" }, - "bin": [ - "bin/phpstan" - ], "type": "library", "extra": { "branch-alias": { - "dev-master": "0.11-dev" + "dev-main": "3.0-dev" } }, "autoload": { - "psr-4": { - "PHPStan\\": [ - "src/" - ] - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], - "description": "PHPStan - PHP Static Analysis Tool", + "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/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/0.11.20" + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/3.0.2" }, "funding": [ { - "url": "https://github.com/ondrejmirtes", + "url": "https://github.com/sebastianbergmann", "type": "github" - }, - { - "url": "https://www.patreon.com/phpstan", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", - "type": "tidelift" } ], - "time": "2020-10-12T14:33:05+00:00" + "time": "2024-07-03T04:41:36+00:00" }, { - "name": "phpstan/phpstan-mockery", - "version": "0.11.3", + "name": "sebastian/code-unit", + "version": "3.0.3", "source": { "type": "git", - "url": "https://github.com/phpstan/phpstan-mockery.git", - "reference": "8f3f0dc0bbc8c413224459a25f89a2cef5924871" + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "54391c61e4af8078e5b276ab082b6d3c54c9ad64" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-mockery/zipball/8f3f0dc0bbc8c413224459a25f89a2cef5924871", - "reference": "8f3f0dc0bbc8c413224459a25f89a2cef5924871", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/54391c61e4af8078e5b276ab082b6d3c54c9ad64", + "reference": "54391c61e4af8078e5b276ab082b6d3c54c9ad64", "shasum": "" }, "require": { - "nikic/php-parser": "^4.0", - "php": "~7.1", - "phpstan/phpdoc-parser": "^0.3", - "phpstan/phpstan": "^0.11.4" + "php": ">=8.2" }, "require-dev": { - "consistence/coding-standard": "^3.0.1", - "dealerdirect/phpcodesniffer-composer-installer": "^0.4.4", - "jakub-onderka/php-parallel-lint": "^1.0", - "mockery/mockery": "^1.1", - "phing/phing": "^2.16.0", - "phpstan/phpstan-phpunit": "^0.11", - "phpstan/phpstan-strict-rules": "^0.11", - "phpunit/phpunit": "^7.2", - "slevomat/coding-standard": "^4.6.3" + "phpunit/phpunit": "^11.5" }, - "type": "phpstan-extension", + "type": "library", "extra": { "branch-alias": { - "dev-master": "0.11-dev" - }, - "phpstan": { - "includes": [ - "extension.neon" - ] + "dev-main": "3.0-dev" } }, "autoload": { - "psr-4": { - "PHPStan\\": "src/" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], - "description": "PHPStan Mockery extension", + "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/phpstan/phpstan-mockery/issues", - "source": "https://github.com/phpstan/phpstan-mockery/tree/0.11.3" + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "security": "https://github.com/sebastianbergmann/code-unit/security/policy", + "source": "https://github.com/sebastianbergmann/code-unit/tree/3.0.3" }, - "time": "2019-08-15T06:50:55+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2025-03-19T07:56:08+00:00" }, { - "name": "phpunit/php-code-coverage", - "version": "7.0.15", + "name": "sebastian/code-unit-reverse-lookup", + "version": "4.0.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "819f92bba8b001d4363065928088de22f25a3a48" + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "183a9b2632194febd219bb9246eee421dad8d45e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/819f92bba8b001d4363065928088de22f25a3a48", - "reference": "819f92bba8b001d4363065928088de22f25a3a48", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/183a9b2632194febd219bb9246eee421dad8d45e", + "reference": "183a9b2632194febd219bb9246eee421dad8d45e", "shasum": "" }, "require": { - "ext-dom": "*", - "ext-xmlwriter": "*", - "php": ">=7.2", - "phpunit/php-file-iterator": "^2.0.2", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^3.1.3 || ^4.0", - "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^4.2.2", - "sebastian/version": "^2.0.1", - "theseer/tokenizer": "^1.1.3" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^8.2.2" - }, - "suggest": { - "ext-xdebug": "^2.7.2" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "7.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -2541,20 +3231,15 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "email": "sebastian@phpunit.de" } ], - "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" - ], + "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/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/7.0.15" + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "security": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/security/policy", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/4.0.1" }, "funding": [ { @@ -2562,32 +3247,39 @@ "type": "github" } ], - "time": "2021-07-26T12:20:09+00:00" + "time": "2024-07-03T04:45:54+00:00" }, { - "name": "phpunit/php-file-iterator", - "version": "2.0.5", + "name": "sebastian/comparator", + "version": "6.3.3", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5" + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "2c95e1e86cb8dd41beb8d502057d1081ccc8eca9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5", - "reference": "42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2c95e1e86cb8dd41beb8d502057d1081ccc8eca9", + "reference": "2c95e1e86cb8dd41beb8d502057d1081ccc8eca9", "shasum": "" }, "require": { - "php": ">=7.1" + "ext-dom": "*", + "ext-mbstring": "*", + "php": ">=8.2", + "sebastian/diff": "^6.0", + "sebastian/exporter": "^6.0" }, "require-dev": { - "phpunit/phpunit": "^8.5" + "phpunit/phpunit": "^11.4" + }, + "suggest": { + "ext-bcmath": "For comparing BcMath\\Number objects" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-main": "6.3-dev" } }, "autoload": { @@ -2602,46 +3294,80 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "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": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", "keywords": [ - "filesystem", - "iterator" + "comparator", + "compare", + "equality" ], "support": { - "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/2.0.5" + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "security": "https://github.com/sebastianbergmann/comparator/security/policy", + "source": "https://github.com/sebastianbergmann/comparator/tree/6.3.3" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/comparator", + "type": "tidelift" } ], - "time": "2021-12-02T12:42:26+00:00" + "time": "2026-01-24T09:26:40+00:00" }, { - "name": "phpunit/php-text-template", - "version": "1.2.1", + "name": "sebastian/complexity", + "version": "4.0.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "ee41d384ab1906c68852636b6de493846e13e5a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/ee41d384ab1906c68852636b6de493846e13e5a0", + "reference": "ee41d384ab1906c68852636b6de493846e13e5a0", "shasum": "" }, "require": { - "php": ">=5.3.3" + "nikic/php-parser": "^5.0", + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, "autoload": { "classmap": [ "src/" @@ -2658,41 +3384,46 @@ "role": "lead" } ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", "support": { - "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/1.2.1" + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "security": "https://github.com/sebastianbergmann/complexity/security/policy", + "source": "https://github.com/sebastianbergmann/complexity/tree/4.0.1" }, - "time": "2015-06-21T13:50:34+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T04:49:50+00:00" }, { - "name": "phpunit/php-timer", - "version": "2.1.3", + "name": "sebastian/diff", + "version": "6.0.2", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "2454ae1765516d20c4ffe103d85a58a9a3bd5662" + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/2454ae1765516d20c4ffe103d85a58a9a3bd5662", - "reference": "2454ae1765516d20c4ffe103d85a58a9a3bd5662", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/b4ccd857127db5d41a5b676f24b51371d76d8544", + "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^8.5" + "phpunit/phpunit": "^11.0", + "symfony/process": "^4.2 || ^5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -2707,18 +3438,25 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" } ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", "keywords": [ - "timer" + "diff", + "udiff", + "unidiff", + "unified diff" ], "support": { - "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/2.1.3" + "issues": "https://github.com/sebastianbergmann/diff/issues", + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/6.0.2" }, "funding": [ { @@ -2726,33 +3464,35 @@ "type": "github" } ], - "time": "2020-11-30T08:20:02+00:00" + "time": "2024-07-03T04:53:05+00:00" }, { - "name": "phpunit/php-token-stream", - "version": "4.0.4", + "name": "sebastian/environment", + "version": "7.2.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "a853a0e183b9db7eed023d7933a858fa1c8d25a3" + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "a5c75038693ad2e8d4b6c15ba2403532647830c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/a853a0e183b9db7eed023d7933a858fa1c8d25a3", - "reference": "a853a0e183b9db7eed023d7933a858fa1c8d25a3", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/a5c75038693ad2e8d4b6c15ba2403532647830c4", + "reference": "a5c75038693ad2e8d4b6c15ba2403532647830c4", "shasum": "" }, "require": { - "ext-tokenizer": "*", - "php": "^7.3 || ^8.0" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^11.3" + }, + "suggest": { + "ext-posix": "*" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "7.2-dev" } }, "autoload": { @@ -2770,80 +3510,64 @@ "email": "sebastian@phpunit.de" } ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "https://github.com/sebastianbergmann/environment", "keywords": [ - "tokenizer" + "Xdebug", + "environment", + "hhvm" ], "support": { - "issues": "https://github.com/sebastianbergmann/php-token-stream/issues", - "source": "https://github.com/sebastianbergmann/php-token-stream/tree/master" + "issues": "https://github.com/sebastianbergmann/environment/issues", + "security": "https://github.com/sebastianbergmann/environment/security/policy", + "source": "https://github.com/sebastianbergmann/environment/tree/7.2.1" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/environment", + "type": "tidelift" } ], - "abandoned": true, - "time": "2020-08-04T08:28:15+00:00" + "time": "2025-05-21T11:55:47+00:00" }, { - "name": "phpunit/phpunit", - "version": "8.5.22", + "name": "sebastian/exporter", + "version": "6.3.2", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "ddd05b9d844260353895a3b950a9258126c11503" + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "70a298763b40b213ec087c51c739efcaa90bcd74" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ddd05b9d844260353895a3b950a9258126c11503", - "reference": "ddd05b9d844260353895a3b950a9258126c11503", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/70a298763b40b213ec087c51c739efcaa90bcd74", + "reference": "70a298763b40b213ec087c51c739efcaa90bcd74", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.3.1", - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", "ext-mbstring": "*", - "ext-xml": "*", - "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.10.0", - "phar-io/manifest": "^2.0.3", - "phar-io/version": "^3.0.2", - "php": ">=7.2", - "phpspec/prophecy": "^1.10.3", - "phpunit/php-code-coverage": "^7.0.12", - "phpunit/php-file-iterator": "^2.0.4", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^2.1.2", - "sebastian/comparator": "^3.0.2", - "sebastian/diff": "^3.0.2", - "sebastian/environment": "^4.2.3", - "sebastian/exporter": "^3.1.2", - "sebastian/global-state": "^3.0.0", - "sebastian/object-enumerator": "^3.0.3", - "sebastian/resource-operations": "^2.0.1", - "sebastian/type": "^1.1.3", - "sebastian/version": "^2.0.1" + "php": ">=8.2", + "sebastian/recursion-context": "^6.0" }, "require-dev": { - "ext-pdo": "*" + "phpunit/phpunit": "^11.3" }, - "suggest": { - "ext-soap": "*", - "ext-xdebug": "*", - "phpunit/php-invoker": "^2.0.0" - }, - "bin": [ - "phpunit" - ], "type": "library", "extra": { "branch-alias": { - "dev-master": "8.5-dev" + "dev-main": "6.3-dev" } }, "autoload": { @@ -2858,155 +3582,202 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "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": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "https://www.github.com/sebastianbergmann/exporter", "keywords": [ - "phpunit", - "testing", - "xunit" + "export", + "exporter" ], "support": { - "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.22" + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "security": "https://github.com/sebastianbergmann/exporter/security/policy", + "source": "https://github.com/sebastianbergmann/exporter/tree/6.3.2" }, "funding": [ - { - "url": "https://phpunit.de/sponsors.html", - "type": "custom" - }, { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/exporter", + "type": "tidelift" } ], - "time": "2021-12-25T06:58:09+00:00" + "time": "2025-09-24T06:12:51+00:00" }, { - "name": "psr/container", - "version": "1.1.2", + "name": "sebastian/global-state", + "version": "7.0.2", "source": { "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "3be331570a721f9a4b5917f4209773de17f747d7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/3be331570a721f9a4b5917f4209773de17f747d7", + "reference": "3be331570a721f9a4b5917f4209773de17f747d7", "shasum": "" }, "require": { - "php": ">=7.4.0" + "php": ">=8.2", + "sebastian/object-reflector": "^4.0", + "sebastian/recursion-context": "^6.0" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^11.0" }, "type": "library", - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" + "extra": { + "branch-alias": { + "dev-main": "7.0-dev" } }, + "autoload": { + "classmap": [ + "src/" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" } ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", + "description": "Snapshotting of global state", + "homepage": "https://www.github.com/sebastianbergmann/global-state", "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" + "global state" ], "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/1.1.2" + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "security": "https://github.com/sebastianbergmann/global-state/security/policy", + "source": "https://github.com/sebastianbergmann/global-state/tree/7.0.2" }, - "time": "2021-11-05T16:50:12+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T04:57:36+00:00" }, { - "name": "psr/log", - "version": "1.1.4", + "name": "sebastian/lines-of-code", + "version": "3.0.1", "source": { "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "d36ad0d782e5756913e42ad87cb2890f4ffe467a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/d36ad0d782e5756913e42ad87cb2890f4ffe467a", + "reference": "d36ad0d782e5756913e42ad87cb2890f4ffe467a", "shasum": "" }, "require": { - "php": ">=5.3.0" + "nikic/php-parser": "^5.0", + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-main": "3.0-dev" } }, "autoload": { - "psr-4": { - "Psr\\Log\\": "Psr/Log/" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", "support": { - "source": "https://github.com/php-fig/log/tree/1.1.4" + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/3.0.1" }, - "time": "2021-05-03T11:20:27+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T04:58:38+00:00" }, { - "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.2", + "name": "sebastian/object-enumerator", + "version": "6.0.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619" + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "f5b498e631a74204185071eb41f33f38d64608aa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/1de8cd5c010cb153fcd68b8d0f64606f523f7619", - "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/f5b498e631a74204185071eb41f33f38d64608aa", + "reference": "f5b498e631a74204185071eb41f33f38d64608aa", "shasum": "" }, "require": { - "php": ">=5.6" + "php": ">=8.2", + "sebastian/object-reflector": "^4.0", + "sebastian/recursion-context": "^6.0" }, "require-dev": { - "phpunit/phpunit": "^8.5" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -3024,11 +3795,12 @@ "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/", + "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/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/1.0.2" + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "security": "https://github.com/sebastianbergmann/object-enumerator/security/policy", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/6.0.1" }, "funding": [ { @@ -3036,34 +3808,32 @@ "type": "github" } ], - "time": "2020-11-30T08:15:22+00:00" + "time": "2024-07-03T05:00:13+00:00" }, { - "name": "sebastian/comparator", - "version": "3.0.3", + "name": "sebastian/object-reflector", + "version": "4.0.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "1071dfcef776a57013124ff35e1fc41ccd294758" + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "6e1a43b411b2ad34146dee7524cb13a068bb35f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1071dfcef776a57013124ff35e1fc41ccd294758", - "reference": "1071dfcef776a57013124ff35e1fc41ccd294758", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/6e1a43b411b2ad34146dee7524cb13a068bb35f9", + "reference": "6e1a43b411b2ad34146dee7524cb13a068bb35f9", "shasum": "" }, "require": { - "php": ">=7.1", - "sebastian/diff": "^3.0", - "sebastian/exporter": "^3.1" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^8.5" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -3079,30 +3849,14 @@ { "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" - ], + "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/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/3.0.3" + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "security": "https://github.com/sebastianbergmann/object-reflector/security/policy", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/4.0.1" }, "funding": [ { @@ -3110,33 +3864,32 @@ "type": "github" } ], - "time": "2020-11-30T08:04:30+00:00" + "time": "2024-07-03T05:01:32+00:00" }, { - "name": "sebastian/diff", - "version": "3.0.3", + "name": "sebastian/recursion-context", + "version": "6.0.3", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "14f72dd46eaf2f2293cbe79c93cc0bc43161a211" + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "f6458abbf32a6c8174f8f26261475dc133b3d9dc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/14f72dd46eaf2f2293cbe79c93cc0bc43161a211", - "reference": "14f72dd46eaf2f2293cbe79c93cc0bc43161a211", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/f6458abbf32a6c8174f8f26261475dc133b3d9dc", + "reference": "f6458abbf32a6c8174f8f26261475dc133b3d9dc", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^7.5 || ^8.0", - "symfony/process": "^2 || ^3.3 || ^4" + "phpunit/phpunit": "^11.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -3154,57 +3907,65 @@ "email": "sebastian@phpunit.de" }, { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" } ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff", - "udiff", - "unidiff", - "unified diff" - ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "https://github.com/sebastianbergmann/recursion-context", "support": { - "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/3.0.3" + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "security": "https://github.com/sebastianbergmann/recursion-context/security/policy", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/6.0.3" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/recursion-context", + "type": "tidelift" } ], - "time": "2020-11-30T07:59:04+00:00" + "time": "2025-08-13T04:42:22+00:00" }, { - "name": "sebastian/environment", - "version": "4.2.4", + "name": "sebastian/type", + "version": "5.1.3", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "d47bbbad83711771f167c72d4e3f25f7fcc1f8b0" + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "f77d2d4e78738c98d9a68d2596fe5e8fa380f449" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/d47bbbad83711771f167c72d4e3f25f7fcc1f8b0", - "reference": "d47bbbad83711771f167c72d4e3f25f7fcc1f8b0", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/f77d2d4e78738c98d9a68d2596fe5e8fa380f449", + "reference": "f77d2d4e78738c98d9a68d2596fe5e8fa380f449", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^7.5" - }, - "suggest": { - "ext-posix": "*" + "phpunit/phpunit": "^11.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev" + "dev-main": "5.1-dev" } }, "autoload": { @@ -3219,54 +3980,58 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], + "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/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/4.2.4" + "issues": "https://github.com/sebastianbergmann/type/issues", + "security": "https://github.com/sebastianbergmann/type/security/policy", + "source": "https://github.com/sebastianbergmann/type/tree/5.1.3" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/type", + "type": "tidelift" } ], - "time": "2020-11-30T07:53:42+00:00" + "time": "2025-08-09T06:55:48+00:00" }, { - "name": "sebastian/exporter", - "version": "3.1.4", + "name": "sebastian/version", + "version": "5.0.2", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "0c32ea2e40dbf59de29f3b49bf375176ce7dd8db" + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c687e3387b99f5b03b6caa64c74b63e2936ff874" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/0c32ea2e40dbf59de29f3b49bf375176ce7dd8db", - "reference": "0c32ea2e40dbf59de29f3b49bf375176ce7dd8db", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c687e3387b99f5b03b6caa64c74b63e2936ff874", + "reference": "c687e3387b99f5b03b6caa64c74b63e2936ff874", "shasum": "" }, "require": { - "php": ">=7.0", - "sebastian/recursion-context": "^3.0" - }, - "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^8.5" + "php": ">=8.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1.x-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -3281,34 +4046,16 @@ "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" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], + "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/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/3.1.4" + "issues": "https://github.com/sebastianbergmann/version/issues", + "security": "https://github.com/sebastianbergmann/version/security/policy", + "source": "https://github.com/sebastianbergmann/version/tree/5.0.2" }, "funding": [ { @@ -3316,512 +4063,649 @@ "type": "github" } ], - "time": "2021-11-11T13:51:24+00:00" + "time": "2024-10-09T05:16:32+00:00" }, { - "name": "sebastian/global-state", - "version": "3.0.1", + "name": "staabm/side-effects-detector", + "version": "1.0.5", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "474fb9edb7ab891665d3bfc6317f42a0a150454b" + "url": "https://github.com/staabm/side-effects-detector.git", + "reference": "d8334211a140ce329c13726d4a715adbddd0a163" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/474fb9edb7ab891665d3bfc6317f42a0a150454b", - "reference": "474fb9edb7ab891665d3bfc6317f42a0a150454b", + "url": "https://api.github.com/repos/staabm/side-effects-detector/zipball/d8334211a140ce329c13726d4a715adbddd0a163", + "reference": "d8334211a140ce329c13726d4a715adbddd0a163", "shasum": "" }, "require": { - "php": ">=7.2", - "sebastian/object-reflector": "^1.1.1", - "sebastian/recursion-context": "^3.0" + "ext-tokenizer": "*", + "php": "^7.4 || ^8.0" }, "require-dev": { - "ext-dom": "*", - "phpunit/phpunit": "^8.0" - }, - "suggest": { - "ext-uopz": "*" + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^1.12.6", + "phpunit/phpunit": "^9.6.21", + "symfony/var-dumper": "^5.4.43", + "tomasvotruba/type-coverage": "1.0.0", + "tomasvotruba/unused-public": "1.0.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, "autoload": { "classmap": [ - "src/" + "lib/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } + "MIT" ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", + "description": "A static analysis tool to detect side effects in PHP code", "keywords": [ - "global state" + "static analysis" ], "support": { - "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/3.0.1" + "issues": "https://github.com/staabm/side-effects-detector/issues", + "source": "https://github.com/staabm/side-effects-detector/tree/1.0.5" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "url": "https://github.com/staabm", "type": "github" } ], - "time": "2020-11-30T07:43:24+00:00" + "time": "2024-10-20T05:08:20+00:00" }, { - "name": "sebastian/object-enumerator", - "version": "3.0.4", + "name": "symfony/console", + "version": "v7.4.18", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2" + "url": "https://github.com/symfony/console.git", + "reference": "23d6f88a29f6d0eac45bd77d70307adf83ba7ab0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2", - "reference": "e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2", + "url": "https://api.github.com/repos/symfony/console/zipball/23d6f88a29f6d0eac45bd77d70307adf83ba7ab0", + "reference": "23d6f88a29f6d0eac45bd77d70307adf83ba7ab0", "shasum": "" }, "require": { - "php": ">=7.0", - "sebastian/object-reflector": "^1.1.1", - "sebastian/recursion-context": "^3.0" + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/string": "^7.2|^8.0" + }, + "conflict": { + "symfony/dependency-injection": "<6.4", + "symfony/dotenv": "<6.4", + "symfony/event-dispatcher": "<6.4", + "symfony/lock": "<6.4", + "symfony/process": "<6.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0|3.0" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "psr/log": "^1|^2|^3", + "symfony/config": "^6.4|^7.0|^8.0", + "symfony/dependency-injection": "^6.4|^7.0|^8.0", + "symfony/event-dispatcher": "^6.4|^7.0|^8.0", + "symfony/http-foundation": "^6.4|^7.0|^8.0", + "symfony/http-kernel": "^6.4|^7.0|^8.0", + "symfony/lock": "^6.4|^7.0|^8.0", + "symfony/messenger": "^6.4|^7.0|^8.0", + "symfony/process": "^6.4|^7.0|^8.0", + "symfony/stopwatch": "^6.4|^7.0|^8.0", + "symfony/var-dumper": "^6.4|^7.0|^8.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - }, "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Traverses array structures and object graphs to enumerate all referenced objects", - "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command-line", + "console", + "terminal" + ], "support": { - "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/3.0.4" + "source": "https://github.com/symfony/console/tree/v7.4.18" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" } ], - "time": "2020-11-30T07:40:27+00:00" + "time": "2026-08-25T14:18:37+00:00" }, { - "name": "sebastian/object-reflector", - "version": "1.1.2", + "name": "symfony/event-dispatcher", + "version": "v7.4.17", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "9b8772b9cbd456ab45d4a598d2dd1a1bced6363d" + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "d269974ee93c61d03620ffee358355bfdb471d66" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/9b8772b9cbd456ab45d4a598d2dd1a1bced6363d", - "reference": "9b8772b9cbd456ab45d4a598d2dd1a1bced6363d", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/d269974ee93c61d03620ffee358355bfdb471d66", + "reference": "d269974ee93c61d03620ffee358355bfdb471d66", "shasum": "" }, "require": { - "php": ">=7.0" + "php": ">=8.2", + "symfony/event-dispatcher-contracts": "^2.5|^3" + }, + "conflict": { + "symfony/dependency-injection": "<6.4", + "symfony/service-contracts": "<2.5" + }, + "provide": { + "psr/event-dispatcher-implementation": "1.0", + "symfony/event-dispatcher-implementation": "2.0|3.0" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "psr/log": "^1|^2|^3", + "symfony/config": "^6.4|^7.0|^8.0", + "symfony/dependency-injection": "^6.4|^7.0|^8.0", + "symfony/error-handler": "^6.4|^7.0|^8.0", + "symfony/expression-language": "^6.4|^7.0|^8.0", + "symfony/framework-bundle": "^6.4|^7.0|^8.0", + "symfony/http-foundation": "^6.4|^7.0|^8.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/stopwatch": "^6.4|^7.0|^8.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Allows reflection of object attributes, including inherited and non-public ones", - "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", + "homepage": "https://symfony.com", "support": { - "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/1.1.2" + "source": "https://github.com/symfony/event-dispatcher/tree/v7.4.17" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" } ], - "time": "2020-11-30T07:37:18+00:00" + "time": "2026-08-21T17:40:08+00:00" }, { - "name": "sebastian/recursion-context", - "version": "3.0.1", + "name": "symfony/event-dispatcher-contracts", + "version": "v3.7.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "367dcba38d6e1977be014dc4b22f47a484dac7fb" + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "c7de7a00ffb67842132da02ea92988a39ccd9f4e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/367dcba38d6e1977be014dc4b22f47a484dac7fb", - "reference": "367dcba38d6e1977be014dc4b22f47a484dac7fb", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/c7de7a00ffb67842132da02ea92988a39ccd9f4e", + "reference": "c7de7a00ffb67842132da02ea92988a39ccd9f4e", "shasum": "" }, "require": { - "php": ">=7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" + "php": ">=8.1", + "psr/event-dispatcher": "^1" }, "type": "library", "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-main": "3.7-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Symfony\\Contracts\\EventDispatcher\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { - "name": "Adam Harvey", - "email": "aharvey@php.net" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "description": "Generic abstractions related to dispatching event", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], "support": { - "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/3.0.1" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.7.1" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" } ], - "time": "2020-11-30T07:34:24+00:00" + "time": "2026-06-05T06:23:12+00:00" }, { - "name": "sebastian/resource-operations", - "version": "2.0.2", + "name": "symfony/filesystem", + "version": "v7.4.18", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "31d35ca87926450c44eae7e2611d45a7a65ea8b3" + "url": "https://github.com/symfony/filesystem.git", + "reference": "90d412aa5277c6819db39e7605aa46b1019e3232" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/31d35ca87926450c44eae7e2611d45a7a65ea8b3", - "reference": "31d35ca87926450c44eae7e2611d45a7a65ea8b3", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/90d412aa5277c6819db39e7605aa46b1019e3232", + "reference": "90d412aa5277c6819db39e7605aa46b1019e3232", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=8.2", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } + "require-dev": { + "symfony/process": "^6.4|^7.0|^8.0" }, + "type": "library", "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "description": "Provides basic utilities for the filesystem", + "homepage": "https://symfony.com", "support": { - "issues": "https://github.com/sebastianbergmann/resource-operations/issues", - "source": "https://github.com/sebastianbergmann/resource-operations/tree/2.0.2" + "source": "https://github.com/symfony/filesystem/tree/v7.4.18" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" } ], - "time": "2020-11-30T07:30:19+00:00" + "time": "2026-08-23T10:03:40+00:00" }, { - "name": "sebastian/type", - "version": "1.1.4", + "name": "symfony/finder", + "version": "v7.4.17", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/type.git", - "reference": "0150cfbc4495ed2df3872fb31b26781e4e077eb4" + "url": "https://github.com/symfony/finder.git", + "reference": "5ce28827081f6d1f0c32eaf3882750f19cb5bbe6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/0150cfbc4495ed2df3872fb31b26781e4e077eb4", - "reference": "0150cfbc4495ed2df3872fb31b26781e4e077eb4", + "url": "https://api.github.com/repos/symfony/finder/zipball/5ce28827081f6d1f0c32eaf3882750f19cb5bbe6", + "reference": "5ce28827081f6d1f0c32eaf3882750f19cb5bbe6", "shasum": "" }, "require": { - "php": ">=7.2" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^8.2" + "symfony/filesystem": "^6.4|^7.0|^8.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Collection of value objects that represent the types of the PHP type system", - "homepage": "https://github.com/sebastianbergmann/type", + "description": "Finds files and directories via an intuitive fluent interface", + "homepage": "https://symfony.com", "support": { - "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/1.1.4" + "source": "https://github.com/symfony/finder/tree/v7.4.17" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" } ], - "time": "2020-11-30T07:25:11+00:00" + "time": "2026-08-21T12:09:28+00:00" }, { - "name": "sebastian/version", - "version": "2.0.1", + "name": "symfony/options-resolver", + "version": "v7.4.8", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + "url": "https://github.com/symfony/options-resolver.git", + "reference": "2888fcdc4dc2fd5f7c7397be78631e8af12e02b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/2888fcdc4dc2fd5f7c7397be78631e8af12e02b4", + "reference": "2888fcdc4dc2fd5f7c7397be78631e8af12e02b4", "shasum": "" }, "require": { - "php": ">=5.6" + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Component\\OptionsResolver\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", + "description": "Provides an improved replacement for the array_replace PHP function", + "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ], "support": { - "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/master" + "source": "https://github.com/symfony/options-resolver/tree/v7.4.8" }, - "time": "2016-10-03T07:35:21+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-03-24T13:12:05+00:00" }, { - "name": "squizlabs/php_codesniffer", - "version": "3.6.2", + "name": "symfony/polyfill-ctype", + "version": "v1.37.0", "source": { "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a" + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "141046a8f9477948ff284fa65be2095baafb94f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/5e4e71592f69da17871dba6e80dd51bce74a351a", - "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/141046a8f9477948ff284fa65be2095baafb94f2", + "reference": "141046a8f9477948ff284fa65be2095baafb94f2", "shasum": "" }, "require": { - "ext-simplexml": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": ">=5.4.0" + "php": ">=7.2" }, - "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" }, - "bin": [ - "bin/phpcs", - "bin/phpcbf" - ], "type": "library", "extra": { - "branch-alias": { - "dev-master": "3.x-dev" + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Greg Sherwood", - "role": "lead" + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "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", + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", "keywords": [ - "phpcs", - "standards" + "compatibility", + "ctype", + "polyfill", + "portable" ], "support": { - "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", - "source": "https://github.com/squizlabs/PHP_CodeSniffer", - "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.37.0" }, - "time": "2021-12-12T21:44:58+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-04-10T16:19:22+00:00" }, { - "name": "symfony/console", - "version": "v4.4.36", + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.41.0", "source": { "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "621379b62bb19af213b569b60013200b11dd576f" + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "bb899c1db0aa8127dc3afe8cda4a67eb24915f8d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/621379b62bb19af213b569b60013200b11dd576f", - "reference": "621379b62bb19af213b569b60013200b11dd576f", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/bb899c1db0aa8127dc3afe8cda4a67eb24915f8d", + "reference": "bb899c1db0aa8127dc3afe8cda4a67eb24915f8d", "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" + "php": ">=7.2" }, "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" + "ext-intl": "For best performance" }, "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, "autoload": { + "files": [ + "bootstrap.php" + ], "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -3829,18 +4713,26 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Eases the creation of beautiful and testable command line interfaces", + "description": "Symfony polyfill for intl's grapheme_* functions", "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], "support": { - "source": "https://github.com/symfony/console/tree/v4.4.36" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.41.0" }, "funding": [ { @@ -3851,38 +4743,53 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2021-12-15T10:33:10+00:00" + "time": "2026-07-28T08:25:59+00:00" }, { - "name": "symfony/finder", - "version": "v4.4.36", + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.42.0", "source": { "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "1fef05633cd61b629e963e5d8200fb6b67ecf42c" + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "aa20edea75bd9c48cfecc8360922e5a6e5c44502" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/1fef05633cd61b629e963e5d8200fb6b67ecf42c", - "reference": "1fef05633cd61b629e963e5d8200fb6b67ecf42c", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/aa20edea75bd9c48cfecc8360922e5a6e5c44502", + "reference": "aa20edea75bd9c48cfecc8360922e5a6e5c44502", "shasum": "" }, "require": { - "php": ">=7.1.3", - "symfony/polyfill-php80": "^1.16" + "php": ">=7.2" + }, + "suggest": { + "ext-intl": "For best performance" }, "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, "autoload": { + "files": [ + "bootstrap.php" + ], "psr-4": { - "Symfony\\Component\\Finder\\": "" + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" }, - "exclude-from-classmap": [ - "/Tests/" + "classmap": [ + "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", @@ -3891,18 +4798,26 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Finds files and directories via an intuitive fluent interface", + "description": "Symfony polyfill for intl's Normalizer class and related functions", "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], "support": { - "source": "https://github.com/symfony/finder/tree/v4.4.36" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.42.0" }, "funding": [ { @@ -3913,50 +4828,55 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2021-12-15T10:33:10+00:00" + "time": "2026-08-07T06:33:24+00:00" }, { - "name": "symfony/polyfill-ctype", - "version": "v1.23.0", + "name": "symfony/polyfill-mbstring", + "version": "v1.38.2", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "d3d318bad5e7a1bfbd026009c8bfb8d8f99ae6b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", - "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/d3d318bad5e7a1bfbd026009c8bfb8d8f99ae6b6", + "reference": "d3d318bad5e7a1bfbd026009c8bfb8d8f99ae6b6", "shasum": "" }, "require": { - "php": ">=7.1" + "ext-iconv": "*", + "php": ">=7.2" + }, + "provide": { + "ext-mbstring": "*" }, "suggest": { - "ext-ctype": "For best performance" + "ext-mbstring": "For best performance" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -3964,24 +4884,25 @@ ], "authors": [ { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for ctype functions", + "description": "Symfony polyfill for the Mbstring extension", "homepage": "https://symfony.com", "keywords": [ "compatibility", - "ctype", + "mbstring", "polyfill", - "portable" + "portable", + "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.38.2" }, "funding": [ { @@ -3992,49 +4913,50 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2021-02-19T12:13:01+00:00" + "time": "2026-05-27T06:59:30+00:00" }, { - "name": "symfony/polyfill-mbstring", - "version": "v1.23.1", + "name": "symfony/polyfill-php81", + "version": "v1.38.1", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "6bfb9c766cacffbc8e118cb87217d08ed84e5cd7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", - "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/6bfb9c766cacffbc8e118cb87217d08ed84e5cd7", + "reference": "6bfb9c766cacffbc8e118cb87217d08ed84e5cd7", "shasum": "" }, "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-mbstring": "For best performance" + "php": ">=7.2" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, "files": [ "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, + "classmap": [ + "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", @@ -4051,17 +4973,16 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for the Mbstring extension", + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ "compatibility", - "mbstring", "polyfill", "portable", "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.38.1" }, "funding": [ { @@ -4072,47 +4993,48 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2021-05-27T12:26:48+00:00" + "time": "2026-05-26T12:45:58+00:00" }, { - "name": "symfony/polyfill-php73", - "version": "v1.23.0", + "name": "symfony/polyfill-php84", + "version": "v1.38.1", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010" + "url": "https://github.com/symfony/polyfill-php84.git", + "reference": "f4e1dfaee5b74aba5964fe1fd4dfc7ba5e3085fa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fba8933c384d6476ab14fb7b8526e5287ca7e010", - "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010", + "url": "https://api.github.com/repos/symfony/polyfill-php84/zipball/f4e1dfaee5b74aba5964fe1fd4dfc7ba5e3085fa", + "reference": "f4e1dfaee5b74aba5964fe1fd4dfc7ba5e3085fa", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" - }, "files": [ "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Php84\\": "" + }, "classmap": [ "Resources/stubs" ] @@ -4131,7 +5053,7 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "description": "Symfony polyfill backporting some PHP 8.4+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ "compatibility", @@ -4140,7 +5062,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-php84/tree/v1.38.1" }, "funding": [ { @@ -4151,49 +5073,41 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2021-02-19T12:13:01+00:00" + "time": "2026-05-26T12:51:13+00:00" }, { - "name": "symfony/polyfill-php80", - "version": "v1.23.1", + "name": "symfony/process", + "version": "v7.4.18", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be" + "url": "https://github.com/symfony/process.git", + "reference": "058d17fc284cce14efb2385783b55014a461b176" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be", - "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be", + "url": "https://api.github.com/repos/symfony/process/zipball/058d17fc284cce14efb2385783b55014a461b176", + "reference": "058d17fc284cce14efb2385783b55014a461b176", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=8.2" }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" + "Symfony\\Component\\Process\\": "" }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -4202,28 +5116,18 @@ ], "authors": [ { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1" + "source": "https://github.com/symfony/process/tree/v7.4.18" }, "funding": [ { @@ -4234,52 +5138,56 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2021-07-28T13:41:28+00:00" + "time": "2026-08-21T17:40:08+00:00" }, { "name": "symfony/service-contracts", - "version": "v2.5.0", + "version": "v3.7.3", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc" + "reference": "15e6a07ec2a2c75ceb1b21dd98105ee8456d2257" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc", - "reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/15e6a07ec2a2c75ceb1b21dd98105ee8456d2257", + "reference": "15e6a07ec2a2c75ceb1b21dd98105ee8456d2257", "shasum": "" }, "require": { - "php": ">=7.2.5", - "psr/container": "^1.1", - "symfony/deprecation-contracts": "^2.1" + "php": ">=8.1", + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.5|^3" }, "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" + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.7-dev" } }, "autoload": { "psr-4": { "Symfony\\Contracts\\Service\\": "" - } + }, + "exclude-from-classmap": [ + "/Test/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -4306,7 +5214,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v2.5.0" + "source": "https://github.com/symfony/service-contracts/tree/v3.7.3" }, "funding": [ { @@ -4317,172 +5225,213 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2021-11-04T16:48:04+00:00" + "time": "2026-07-27T15:39:01+00:00" }, { - "name": "theseer/tokenizer", - "version": "1.2.1", + "name": "symfony/stopwatch", + "version": "v7.4.8", "source": { "type": "git", - "url": "https://github.com/theseer/tokenizer.git", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" + "url": "https://github.com/symfony/stopwatch.git", + "reference": "70a852d72fec4d51efb1f48dcd968efcaf5ccb89" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/70a852d72fec4d51efb1f48dcd968efcaf5ccb89", + "reference": "70a852d72fec4d51efb1f48dcd968efcaf5ccb89", "shasum": "" }, "require": { - "ext-dom": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": "^7.2 || ^8.0" + "php": ">=8.2", + "symfony/service-contracts": "^2.5|^3" }, "type": "library", "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "description": "Provides a way to profile code", + "homepage": "https://symfony.com", "support": { - "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.1" + "source": "https://github.com/symfony/stopwatch/tree/v7.4.8" }, "funding": [ { - "url": "https://github.com/theseer", + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" } ], - "time": "2021-07-28T10:34:58+00:00" + "time": "2026-03-24T13:12:05+00:00" }, { - "name": "vlucas/phpdotenv", - "version": "v5.4.1", + "name": "symfony/string", + "version": "v7.4.15", "source": { "type": "git", - "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "264dce589e7ce37a7ba99cb901eed8249fbec92f" + "url": "https://github.com/symfony/string.git", + "reference": "e394af32256bf9e7bf80849d95e589167c10097b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/264dce589e7ce37a7ba99cb901eed8249fbec92f", - "reference": "264dce589e7ce37a7ba99cb901eed8249fbec92f", + "url": "https://api.github.com/repos/symfony/string/zipball/e394af32256bf9e7bf80849d95e589167c10097b", + "reference": "e394af32256bf9e7bf80849d95e589167c10097b", "shasum": "" }, "require": { - "ext-pcre": "*", - "graham-campbell/result-type": "^1.0.2", - "php": "^7.1.3 || ^8.0", - "phpoption/phpoption": "^1.8", - "symfony/polyfill-ctype": "^1.23", - "symfony/polyfill-mbstring": "^1.23.1", - "symfony/polyfill-php80": "^1.23.1" + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3.0", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.33", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0" }, - "require-dev": { - "bamarni/composer-bin-plugin": "^1.4.1", - "ext-filter": "*", - "phpunit/phpunit": "^7.5.20 || ^8.5.21 || ^9.5.10" + "conflict": { + "symfony/translation-contracts": "<2.5" }, - "suggest": { - "ext-filter": "Required to use the boolean validator." + "require-dev": { + "symfony/emoji": "^7.1|^8.0", + "symfony/http-client": "^6.4|^7.0|^8.0", + "symfony/intl": "^6.4|^7.0|^8.0", + "symfony/translation-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^6.4|^7.0|^8.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.4-dev" - } - }, "autoload": { + "files": [ + "Resources/functions.php" + ], "psr-4": { - "Dotenv\\": "src/" - } + "Symfony\\Component\\String\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { - "name": "Vance Lucas", - "email": "vance@vancelucas.com", - "homepage": "https://github.com/vlucas" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", "keywords": [ - "dotenv", - "env", - "environment" + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" ], "support": { - "issues": "https://github.com/vlucas/phpdotenv/issues", - "source": "https://github.com/vlucas/phpdotenv/tree/v5.4.1" + "source": "https://github.com/symfony/string/tree/v7.4.15" }, "funding": [ { - "url": "https://github.com/GrahamCampbell", + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", "type": "github" }, { - "url": "https://tidelift.com/funding/github/packagist/vlucas/phpdotenv", + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2021-12-12T23:22:04+00:00" + "time": "2026-07-28T07:33:02+00:00" }, { - "name": "webmozart/assert", - "version": "1.8.0", + "name": "symfony/yaml", + "version": "v5.4.53", "source": { "type": "git", - "url": "https://github.com/webmozarts/assert.git", - "reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6" + "url": "https://github.com/symfony/yaml.git", + "reference": "ae0bbb46f77ff56591d0a0259c7f458f4b3e1f77" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/ab2cb0b3b559010b75981b1bdce728da3ee90ad6", - "reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6", + "url": "https://api.github.com/repos/symfony/yaml/zipball/ae0bbb46f77ff56591d0a0259c7f458f4b3e1f77", + "reference": "ae0bbb46f77ff56591d0a0259c7f458f4b3e1f77", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0", + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-ctype": "^1.8" }, "conflict": { - "vimeo/psalm": "<3.9.1" + "symfony/console": "<5.3" }, "require-dev": { - "phpunit/phpunit": "^4.8.36 || ^7.5.13" + "symfony/console": "^5.3|^6.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" }, + "bin": [ + "Resources/bin/yaml-lint" + ], "type": "library", "autoload": { "psr-4": { - "Webmozart\\Assert\\": "src/" - } + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -4490,31 +5439,98 @@ ], "authors": [ { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" + "description": "Loads and dumps YAML files", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/yaml/tree/v5.4.53" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-05-20T17:13:41+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.3.1", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "b7489ce515e168639d17feec34b8847c326b0b3c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b7489ce515e168639d17feec34b8847c326b0b3c", + "reference": "b7489ce515e168639d17feec34b8847c326b0b3c", + "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/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.8.0" + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.3.1" }, - "time": "2020-04-18T12:12:48+00:00" + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2025-11-17T20:03:58+00:00" } ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, + "stability-flags": {}, + "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": "^7.4" + "php": "^7.4 || ^8.0" }, - "platform-dev": [], - "plugin-api-version": "2.3.0" + "platform-dev": {}, + "plugin-api-version": "2.9.0" } diff --git a/contracts/contract-lock.json b/contracts/contract-lock.json new file mode 100644 index 0000000..d9dde78 --- /dev/null +++ b/contracts/contract-lock.json @@ -0,0 +1,46 @@ +{ + "schema_version": 1, + "generated_at": "2026-08-31", + "sdk_baselines": { + "required_compatibility": { + "version": "1.0.2", + "git_ref": "1.0.2", + "commit": "569fe88e0359d567f30588820243d1d69ab418ec" + }, + "latest_published": { + "version": "1.0.3", + "git_ref": "1.0.3", + "commit": "97dabc53fc1c9c96ce99fb2bd88ddbd04164b450" + } + }, + "sources": { + "fleetbase_stack": { + "repository": "https://github.com/fleetbase/fleetbase", + "ref": "origin/main", + "commit": "d810cee000d42713942a2343264eb706b0b3a59a", + "core_api_submodule": "b7691c06ffdfe8f8874352e746aa8e523d5e3531", + "fleetops_submodule": "a9131daeb1a23ed4b0046dd2d7b632fb100bfba0" + }, + "postman": { + "repository": "https://github.com/fleetbase/postman", + "ref": "origin/main", + "commit": "43253dbf87e5030d95d12be019dc26fcb7151ed6", + "scope": [ + "Fleetbase API", + "Fleetbase Core API" + ], + "expected_requests": 220, + "expected_groups": 36 + }, + "core_api": { + "repository": "https://github.com/fleetbase/core-api", + "ref": "origin/main", + "commit": "b7691c06ffdfe8f8874352e746aa8e523d5e3531" + }, + "fleetops": { + "repository": "https://github.com/fleetbase/fleetops", + "ref": "origin/main", + "commit": "a9131daeb1a23ed4b0046dd2d7b632fb100bfba0" + } + } +} diff --git a/contracts/postman-manifest.json b/contracts/postman-manifest.json new file mode 100644 index 0000000..48d3d18 --- /dev/null +++ b/contracts/postman-manifest.json @@ -0,0 +1,6993 @@ +{ + "schema_version": 1, + "source": { + "repository": "https://github.com/fleetbase/postman", + "ref": "43253dbf87e5030d95d12be019dc26fcb7151ed6", + "collections": [ + "Fleetbase API", + "Fleetbase Core API" + ] + }, + "summary": { + "requests": 220, + "groups": 36, + "methods": { + "DELETE": 28, + "GET": 84, + "PATCH": 6, + "POST": 77, + "PUT": 25 + }, + "mapped": 220, + "exceptions": 0, + "unmapped": 0 + }, + "requests": [ + { + "id": "fleetbase-api-contacts-create-a-contact", + "collection": "Fleetbase API", + "group": "Contacts", + "name": "Create a Contact", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/contacts", + "source": "postman/collections/Fleetbase API/Contacts/Create a Contact.request.yaml", + "description": "Creates a contact for the current company. Contacts are used as customers, facilitators, personnel, or other addressable people in FleetOps workflows.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "name": "John Doe", + "type": "customer", + "title": "Mr", + "email": "john@exampleco.com", + "phone": "+1 563-920-4264" + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Contacts/.resources/Create a Contact.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\ContactService::createContact", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-contacts-delete-a-contact", + "collection": "Fleetbase API", + "group": "Contacts", + "name": "Delete a Contact", + "method": "DELETE", + "url": "{{base_url}}/{{namespace}}/contacts/:id", + "source": "postman/collections/Fleetbase API/Contacts/Delete a Contact.request.yaml", + "description": "Delete a Contact.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{contact_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Contacts/.resources/Delete a Contact.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\ContactService::deleteContact", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-contacts-query-contacts", + "collection": "Fleetbase API", + "group": "Contacts", + "name": "Query Contacts", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/contacts", + "source": "postman/collections/Fleetbase API/Contacts/Query Contacts.request.yaml", + "description": "Returns a paginated list of contacts for the current organization. Use filters such as `query`, `limit`, `offset`, and `sort` to narrow and order the results.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": { + "query": "{{contact_name}}", + "limit": "25", + "offset": "0", + "sort": "created_at" + }, + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Contacts/.resources/Query Contacts.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\ContactService::queryContacts", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-contacts-retrieve-a-contact", + "collection": "Fleetbase API", + "group": "Contacts", + "name": "Retrieve a Contact", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/contacts/:id", + "source": "postman/collections/Fleetbase API/Contacts/Retrieve a Contact.request.yaml", + "description": "Retrieve a Contact.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{contact_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Contacts/.resources/Retrieve a Contact.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\ContactService::retrieveContact", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-contacts-update-a-contact", + "collection": "Fleetbase API", + "group": "Contacts", + "name": "Update a Contact", + "method": "PUT", + "url": "{{base_url}}/{{namespace}}/contacts/:id", + "source": "postman/collections/Fleetbase API/Contacts/Update a Contact.request.yaml", + "description": "Updates a contact's profile, type, primary place, photo, or metadata.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{contact_id}}" + }, + "query": [], + "body_type": "json", + "body": { + "name": "John Doe", + "title": "Mr", + "email": "john@exampleco.com", + "phone": "563-920-4264", + "meta": { + "external_ref": "john-doe" + } + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Contacts/.resources/Update a Contact.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\ContactService::updateContact", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-customers-create-a-customer", + "collection": "Fleetbase API", + "group": "Customers", + "name": "Create a Customer", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/customers", + "source": "postman/collections/Fleetbase API/Customers/Create a Customer.request.yaml", + "description": "Creates a customer account (Contact + linked User) after verifying the code from `Request Customer Creation Code`. Returns the customer with a Sanctum `token` \u2014 persist this client-side and send it back as the `Customer-Token` header on authenticated requests.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "identity": "customer_identity-fixture", + "code": "verification_code-fixture", + "name": "Jane Customer", + "password": "customer_password-fixture", + "phone": "randomPhoneNumber-fixture", + "place": { + "name": "Home", + "street1": "123 Main Street", + "city": "Kingston", + "province": "Kingston", + "postal_code": "00000", + "country": "JM" + } + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\CustomerService::createCustomer", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-customers-create-a-customer-order", + "collection": "Fleetbase API", + "group": "Customers", + "name": "Create a Customer Order", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/customers/orders", + "source": "postman/collections/Fleetbase API/Customers/Create a Customer Order.request.yaml", + "description": "Creates an Order on behalf of the authenticated customer. Accepts the canonical Fleet-Ops Order create shape \u2014 the same fields as `POST /v1/orders` would accept from an operator. The customer's `uuid` is automatically attached as `orders.customer_uuid`; any client-supplied `customer` field is ignored. `status` is forced to `created` (customers cannot self-dispatch). The Order lands in the company resolved from the API credential.", + "authentication": "customer-token", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "type": "transport", + "scheduled_at": "2026-05-25T10:00:00Z", + "notes": "Handle with care.", + "pickup": { + "name": "Pickup", + "street1": "4169 N State RD 7", + "city": "Lauderdale Lakes", + "province": "FL", + "postal_code": "33319", + "country": "US" + }, + "dropoff": { + "name": "Dropoff", + "city": "Kingston", + "country": "JM" + }, + "entities": [ + { + "name": "Wireless Headphones", + "description": "Electronics", + "weight": 2.5, + "weight_unit": "lb", + "declared_value": 150, + "currency": "USD" + } + ] + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\CustomerService::createCustomerOrder", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-customers-forgot-customer-password", + "collection": "Fleetbase API", + "group": "Customers", + "name": "Forgot Customer Password", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/customers/forgot-password", + "source": "postman/collections/Fleetbase API/Customers/Forgot Customer Password.request.yaml", + "description": "Sends a password-reset verification code to the customer's email or phone. Always returns `{ status: ok }` regardless of whether the identity matches an account (prevents enumeration).", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "identity": "customer_identity-fixture" + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\CustomerService::forgotCustomerPassword", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-customers-list-customer-orders", + "collection": "Fleetbase API", + "group": "Customers", + "name": "List Customer Orders", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/customers/orders", + "source": "postman/collections/Fleetbase API/Customers/List Customer Orders.request.yaml", + "description": "Lists orders owned by the authenticated customer (scoped to `orders.customer_uuid`).", + "authentication": "customer-token", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\CustomerService::listCustomerOrders", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-customers-list-customer-places", + "collection": "Fleetbase API", + "group": "Customers", + "name": "List Customer Places", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/customers/places", + "source": "postman/collections/Fleetbase API/Customers/List Customer Places.request.yaml", + "description": "Lists the authenticated customer's saved Places (delivery addresses, etc.).", + "authentication": "customer-token", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\CustomerService::listCustomerPlaces", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-customers-login-customer", + "collection": "Fleetbase API", + "group": "Customers", + "name": "Login Customer", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/customers/login", + "source": "postman/collections/Fleetbase API/Customers/Login Customer.request.yaml", + "description": "Authenticates a customer with email/phone + password. Returns the customer with a Sanctum `token` to use as `Customer-Token`.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "identity": "customer_identity-fixture", + "password": "customer_password-fixture" + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\CustomerService::loginCustomer", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-customers-logout-all-customer-sessions", + "collection": "Fleetbase API", + "group": "Customers", + "name": "Logout All Customer Sessions", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/customers/logout-all", + "source": "postman/collections/Fleetbase API/Customers/Logout All Customer Sessions.request.yaml", + "description": "Revokes every Sanctum token issued to the customer's linked user (sign out everywhere).", + "authentication": "customer-token", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\CustomerService::logoutAllCustomerSessions", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-customers-logout-customer", + "collection": "Fleetbase API", + "group": "Customers", + "name": "Logout Customer", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/customers/logout", + "source": "postman/collections/Fleetbase API/Customers/Logout Customer.request.yaml", + "description": "Revokes the Sanctum token used to make this request. The customer's other active sessions are unaffected \u2014 use `Logout All Customer Sessions` to revoke every token for the linked user.", + "authentication": "customer-token", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\CustomerService::logoutCustomer", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-customers-register-customer-device", + "collection": "Fleetbase API", + "group": "Customers", + "name": "Register Customer Device", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/customers/register-device", + "source": "postman/collections/Fleetbase API/Customers/Register Customer Device.request.yaml", + "description": "Registers a push-notification device token against the authenticated customer's linked user.", + "authentication": "customer-token", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "token": "push_token-fixture", + "platform": "ios" + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\CustomerService::registerCustomerDevice", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-customers-request-customer-creation-code", + "collection": "Fleetbase API", + "group": "Customers", + "name": "Request Customer Creation Code", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/customers/request-creation-code", + "source": "postman/collections/Fleetbase API/Customers/Request Customer Creation Code.request.yaml", + "description": "Sends an email or SMS verification code to start a customer signup. Required before calling `Create a Customer`. Optionally include `name` and `phone` so the verification email greets the customer by name and the pending user row is pre-seeded with real values.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "identity": "customer_identity-fixture", + "mode": "email", + "name": "customer_name-fixture", + "phone": "customer_phone-fixture" + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\CustomerService::requestCustomerCreationCode", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-customers-request-customer-login-sms", + "collection": "Fleetbase API", + "group": "Customers", + "name": "Request Customer Login SMS", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/customers/login-with-sms", + "source": "postman/collections/Fleetbase API/Customers/Request Customer Login SMS.request.yaml", + "description": "Starts SMS-based passwordless login by sending a verification code to the customer's phone. Falls back to email if SMS delivery fails and an email is on file.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "phone": "customer_phone-fixture" + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\CustomerService::requestCustomerLoginSms", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-customers-reset-customer-password", + "collection": "Fleetbase API", + "group": "Customers", + "name": "Reset Customer Password", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/customers/reset-password", + "source": "postman/collections/Fleetbase API/Customers/Reset Customer Password.request.yaml", + "description": "Verifies the reset code from `Forgot Customer Password` and sets a new password. All existing tokens for the customer's user are revoked on success.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "identity": "customer_identity-fixture", + "code": "verification_code-fixture", + "password": "customer_password-fixture" + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\CustomerService::resetCustomerPassword", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-customers-retrieve-authenticated-customer", + "collection": "Fleetbase API", + "group": "Customers", + "name": "Retrieve Authenticated Customer", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/customers/me", + "source": "postman/collections/Fleetbase API/Customers/Retrieve Authenticated Customer.request.yaml", + "description": "Returns the profile of the customer identified by the `Customer-Token` header.", + "authentication": "customer-token", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\CustomerService::retrieveAuthenticatedCustomer", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-customers-retrieve-a-customer-order", + "collection": "Fleetbase API", + "group": "Customers", + "name": "Retrieve a Customer Order", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/customers/orders/{{customer_order_id}}", + "source": "postman/collections/Fleetbase API/Customers/Retrieve a Customer Order.request.yaml", + "description": "Fetches a single order by id, public id, or tracking number. Returns 404 if the order doesn't belong to the authenticated customer.", + "authentication": "customer-token", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\CustomerService::retrieveCustomerOrder", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-customers-update-authenticated-customer", + "collection": "Fleetbase API", + "group": "Customers", + "name": "Update Authenticated Customer", + "method": "PUT", + "url": "{{base_url}}/{{namespace}}/customers/me", + "source": "postman/collections/Fleetbase API/Customers/Update Authenticated Customer.request.yaml", + "description": "Updates the authenticated customer's profile. Changes to `name`, `email`, and `phone` are mirrored onto the linked user so subsequent logins work.", + "authentication": "customer-token", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "name": "customer_name-fixture", + "phone": "customer_phone-fixture", + "email": "customer_email-fixture" + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\CustomerService::updateAuthenticatedCustomer", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-customers-verify-customer-login-code", + "collection": "Fleetbase API", + "group": "Customers", + "name": "Verify Customer Login Code", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/customers/verify-code", + "source": "postman/collections/Fleetbase API/Customers/Verify Customer Login Code.request.yaml", + "description": "Verifies the SMS/email code from `Request Customer Login SMS` and returns the customer with a Sanctum `token`. When `for` is `fleetops_create_customer` this proxies to `Create a Customer`.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "identity": "customer_identity-fixture", + "code": "verification_code-fixture", + "for": "fleetops_customer_login" + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\CustomerService::verifyCustomerLoginCode", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-devices-attach-device", + "collection": "Fleetbase API", + "group": "Devices", + "name": "Attach Device", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/devices/{{device_id}}/attach", + "source": "postman/collections/Fleetbase API/Devices/Attach Device.request.yaml", + "description": "Attach this device to a vehicle.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "vehicle": "vehicle_id-fixture" + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Devices/.resources/Attach Device.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\DeviceService::attachDevice", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-devices-create-a-device", + "collection": "Fleetbase API", + "group": "Devices", + "name": "Create a Device", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/devices", + "source": "postman/collections/Fleetbase API/Devices/Create a Device.request.yaml", + "description": "Create a device.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "name": "OBD Tracker 12", + "type": "obd", + "device_id": "OBD-12", + "serial_number": "SN-10001", + "status": "active" + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Devices/.resources/Create a Device.resources/examples/Created.example.yaml", + "status": 201 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\DeviceService::createDevice", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-devices-delete-a-device", + "collection": "Fleetbase API", + "group": "Devices", + "name": "Delete a Device", + "method": "DELETE", + "url": "{{base_url}}/{{namespace}}/devices/{{device_id}}", + "source": "postman/collections/Fleetbase API/Devices/Delete a Device.request.yaml", + "description": "Delete a device.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Devices/.resources/Delete a Device.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\DeviceService::deleteDevice", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-devices-detach-device", + "collection": "Fleetbase API", + "group": "Devices", + "name": "Detach Device", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/devices/{{device_id}}/detach", + "source": "postman/collections/Fleetbase API/Devices/Detach Device.request.yaml", + "description": "Detach this device from its current resource.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Devices/.resources/Detach Device.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\DeviceService::detachDevice", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-devices-query-devices", + "collection": "Fleetbase API", + "group": "Devices", + "name": "Query Devices", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/devices", + "source": "postman/collections/Fleetbase API/Devices/Query Devices.request.yaml", + "description": "Query devices.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Devices/.resources/Query Devices.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\DeviceService::queryDevices", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-devices-retrieve-a-device", + "collection": "Fleetbase API", + "group": "Devices", + "name": "Retrieve a Device", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/devices/{{device_id}}", + "source": "postman/collections/Fleetbase API/Devices/Retrieve a Device.request.yaml", + "description": "Retrieve a device.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Devices/.resources/Retrieve a Device.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\DeviceService::retrieveDevice", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-devices-update-a-device", + "collection": "Fleetbase API", + "group": "Devices", + "name": "Update a Device", + "method": "PUT", + "url": "{{base_url}}/{{namespace}}/devices/{{device_id}}", + "source": "postman/collections/Fleetbase API/Devices/Update a Device.request.yaml", + "description": "Update a device.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "status": "maintenance" + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Devices/.resources/Update a Device.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\DeviceService::updateDevice", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-drivers-change-driver-password", + "collection": "Fleetbase API", + "group": "Drivers", + "name": "Change Driver Password", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/drivers/:id/change-password", + "source": "postman/collections/Fleetbase API/Drivers/Change Driver Password.request.yaml", + "description": "Changes the password of a driver who is signed in, proving the current one.\n\nA password change is an authorisation decision rather than an attribute update, which is why it is not part of `PUT /drivers/:id` \u2014 that endpoint does not accept a password at all. Supplying the wrong `current_password` is refused and changes nothing.\n\nEvery other session is revoked when the password changes, and a fresh token is returned in the same response, so the caller keeps working while other devices are signed out.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{driver_id}}" + }, + "query": [], + "body_type": "json", + "body": { + "current_password": "created_driver_password-fixture", + "password": "driver_new_password-fixture", + "password_confirmation": "driver_new_password-fixture", + "device_name": "navigator" + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\DriverService::changeDriverPassword", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-drivers-create-a-driver", + "collection": "Fleetbase API", + "group": "Drivers", + "name": "Create a Driver", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/drivers", + "source": "postman/collections/Fleetbase API/Drivers/Create a Driver.request.yaml", + "description": "Creates a driver profile and linked user account. Provide a unique email and phone number, then optionally assign a vehicle, vendor, current job, location, or photo.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "name": "John Doe", + "email": "randomEmail-fixture", + "phone": "randomPhoneNumber-fixture", + "password": "driver_seed_password-fixture" + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Drivers/.resources/Create a Driver.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\DriverService::createDriver", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-drivers-delete-a-driver", + "collection": "Fleetbase API", + "group": "Drivers", + "name": "Delete a Driver", + "method": "DELETE", + "url": "{{base_url}}/{{namespace}}/drivers/:id", + "source": "postman/collections/Fleetbase API/Drivers/Delete a Driver.request.yaml", + "description": "Use this endpoint to delete a driver.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{driver_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Drivers/.resources/Delete a Driver.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\DriverService::deleteDriver", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-drivers-get-driver-current-organization", + "collection": "Fleetbase API", + "group": "Drivers", + "name": "Get Driver Current Organization", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/drivers/:id/current-organization", + "source": "postman/collections/Fleetbase API/Drivers/Get Driver Current Organization.request.yaml", + "description": "Returns the driver current organization.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{driver_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\DriverService::getDriverCurrentOrganization", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-drivers-list-driver-manifests", + "collection": "Fleetbase API", + "group": "Drivers", + "name": "List Driver Manifests", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/drivers/:id/manifests", + "source": "postman/collections/Fleetbase API/Drivers/List Driver Manifests.request.yaml", + "description": "Lists the manifests assigned to a driver, newest first.\n\nA manifest is a driver's route: an order-agnostic sequence of stops which may span several orders, or none the driver has seen as an order.\n\nDefaults to a recent window rather than the driver's whole history. Use `status` and `on` to narrow it further.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{driver_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\DriverService::listDriverManifests", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-drivers-list-driver-organizations", + "collection": "Fleetbase API", + "group": "Drivers", + "name": "List Driver Organizations", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/drivers/:id/organizations", + "source": "postman/collections/Fleetbase API/Drivers/List Driver Organizations.request.yaml", + "description": "Lists organizations a driver belongs to.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{driver_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\DriverService::listDriverOrganizations", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-drivers-login-driver", + "collection": "Fleetbase API", + "group": "Drivers", + "name": "Login Driver", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/drivers/login", + "source": "postman/collections/Fleetbase API/Drivers/Login Driver.request.yaml", + "description": "Authenticates a driver with email/phone and password.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "identity": "driver_identity-fixture", + "password": "driver_password-fixture" + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\DriverService::loginDriver", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-drivers-query-drivers", + "collection": "Fleetbase API", + "group": "Drivers", + "name": "Query Drivers", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/drivers", + "source": "postman/collections/Fleetbase API/Drivers/Query Drivers.request.yaml", + "description": "Returns drivers for the current company. Use filters such as `vendor`, search, pagination, or sort parameters to narrow the result set.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": { + "id": "{{driver_id}}" + }, + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Drivers/.resources/Query Drivers.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\DriverService::queryDrivers", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-drivers-register-device", + "collection": "Fleetbase API", + "group": "Drivers", + "name": "Register Device", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/drivers/register-device", + "source": "postman/collections/Fleetbase API/Drivers/Register Device.request.yaml", + "description": "Registers a driver device token through the non-id route.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "token": "device_token-fixture", + "platform": "ios" + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\DriverService::registerDevice", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-drivers-register-driver-device", + "collection": "Fleetbase API", + "group": "Drivers", + "name": "Register Driver Device", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/drivers/:id/register-device", + "source": "postman/collections/Fleetbase API/Drivers/Register Driver Device.request.yaml", + "description": "Registers a device token for a specific driver.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{driver_id}}" + }, + "query": [], + "body_type": "json", + "body": { + "token": "device_token-fixture", + "platform": "ios" + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\DriverService::registerDriverDevice", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-drivers-request-driver-login-sms", + "collection": "Fleetbase API", + "group": "Drivers", + "name": "Request Driver Login SMS", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/drivers/login-with-sms", + "source": "postman/collections/Fleetbase API/Drivers/Request Driver Login SMS.request.yaml", + "description": "Starts driver SMS verification login.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "phone": "driver_phone-fixture" + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\DriverService::requestDriverLoginSms", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-drivers-request-driver-password-reset", + "collection": "Fleetbase API", + "group": "Drivers", + "name": "Request Driver Password Reset", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/drivers/forgot-password", + "source": "postman/collections/Fleetbase API/Drivers/Request Driver Password Reset.request.yaml", + "description": "Sends a password reset code to a driver who cannot sign in.\n\nThe code goes by email or SMS depending on whether `identity` looks like an email address or a phone number.\n\nThe response is the same whether or not the identity belongs to a driver. That is deliberate: an endpoint that answered differently for an unknown number would be a way to enumerate an organization's drivers.\n\n`driver_reset_identity` defaults to a reserved address that belongs to nobody, so running the collection documents the endpoint without sending mail to a stranger. Point it at a real driver to exercise delivery.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "identity": "driver_reset_identity-fixture" + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\DriverService::requestDriverPasswordReset", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-drivers-reset-driver-password", + "collection": "Fleetbase API", + "group": "Drivers", + "name": "Reset Driver Password", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/drivers/reset-password", + "source": "postman/collections/Fleetbase API/Drivers/Reset Driver Password.request.yaml", + "description": "Sets a new password using the code sent by `POST /drivers/forgot-password`.\n\nA wrong code, an expired code and an unknown identity all return the same error, so the endpoint cannot be used to test which of the three happened.\n\nEvery session is revoked on success. A reset is a recovery from losing control of an account, so nothing that was signed in stays signed in.\n\n`driver_password_reset_code` is a code issued for this flow specifically \u2014 a login code will not do, because the endpoint matches on purpose as well as on value. The password is set back to the one already in force so the run stays repeatable and the driver login requests further down still authenticate.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "identity": "driver_identity-fixture", + "code": "driver_password_reset_code-fixture", + "password": "driver_password-fixture" + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\DriverService::resetDriverPassword", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-drivers-retrieve-a-driver", + "collection": "Fleetbase API", + "group": "Drivers", + "name": "Retrieve a Driver", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/drivers/:id", + "source": "postman/collections/Fleetbase API/Drivers/Retrieve a Driver.request.yaml", + "description": "This endpoint allows you to retrieve a driver object to view it's details.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{driver_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Drivers/.resources/Retrieve a Driver.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\DriverService::retrieveDriver", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-drivers-simulate-driver-route", + "collection": "Fleetbase API", + "group": "Drivers", + "name": "Simulate Driver Route", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/drivers/:id/simulate", + "source": "postman/collections/Fleetbase API/Drivers/Simulate Driver Route.request.yaml", + "description": "Simulates driver movement between two resolvable points, or pass order to simulate an order route.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{driver_id}}" + }, + "query": [], + "body_type": "json", + "body": { + "start": { + "latitude": 1.3521, + "longitude": 103.8198 + }, + "end": { + "latitude": 1.2903, + "longitude": 103.8519 + } + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\DriverService::simulateDriverRoute", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-drivers-switch-driver-organization", + "collection": "Fleetbase API", + "group": "Drivers", + "name": "Switch Driver Organization", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/drivers/:id/switch-organization", + "source": "postman/collections/Fleetbase API/Drivers/Switch Driver Organization.request.yaml", + "description": "Switches the driver session to another organization.\n\nThe driver must already belong to the target organization, and it must not be the one they are currently in \u2014 switching to the current organization is rejected. A driver created through `POST /drivers` belongs to a single organization, so this example uses one that belongs to more than one.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{multi_org_driver_id}}" + }, + "query": [], + "body_type": "json", + "body": { + "next": "secondary_organization_id-fixture" + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\DriverService::switchDriverOrganization", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-drivers-toggle-driver-online", + "collection": "Fleetbase API", + "group": "Drivers", + "name": "Toggle Driver Online", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/drivers/:id/toggle-online", + "source": "postman/collections/Fleetbase API/Drivers/Toggle Driver Online.request.yaml", + "description": "Toggles or sets driver online status.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{driver_id}}" + }, + "query": [], + "body_type": "json", + "body": { + "online": true + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\DriverService::toggleDriverOnline", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-drivers-track-driver", + "collection": "Fleetbase API", + "group": "Drivers", + "name": "Track Driver", + "method": "PATCH", + "url": "{{base_url}}/{{namespace}}/drivers/:id/track", + "source": "postman/collections/Fleetbase API/Drivers/Track Driver.request.yaml", + "description": null, + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{driver_id}}" + }, + "query": [], + "body_type": "text", + "body": "{\n \"latitude\": -19.288195,\n \"longitude\": 146.795965,\n \"speed\": 100\n}" + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\DriverService::trackDriver", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-drivers-update-a-driver", + "collection": "Fleetbase API", + "group": "Drivers", + "name": "Update a Driver", + "method": "PUT", + "url": "{{base_url}}/{{namespace}}/drivers/:id", + "source": "postman/collections/Fleetbase API/Drivers/Update a Driver.request.yaml", + "description": "Updates a driver's account fields, assignment, status, location, photo, or metadata.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{driver_id}}" + }, + "query": [], + "body_type": "json", + "body": { + "name": "John Doe", + "email": "randomEmail-fixture", + "phone": "randomPhoneNumber-fixture" + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Drivers/.resources/Update a Driver.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\DriverService::updateDriver", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-drivers-verify-driver-login-code", + "collection": "Fleetbase API", + "group": "Drivers", + "name": "Verify Driver Login Code", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/drivers/verify-code", + "source": "postman/collections/Fleetbase API/Drivers/Verify Driver Login Code.request.yaml", + "description": "Verifies driver login code and returns a driver token.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "identity": "driver_identity-fixture", + "code": "verification_code-fixture" + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\DriverService::verifyDriverLoginCode", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-entities-create-an-entity", + "collection": "Fleetbase API", + "group": "Entities", + "name": "Create an Entity", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/entities", + "source": "postman/collections/Fleetbase API/Entities/Create an Entity.request.yaml", + "description": "Creates an entity such as a parcel, package, or item. Attach it to a payload and optionally set a destination or waypoint within that payload route.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "name": "SampleEntity", + "type": "parcel", + "payload": "payload_id-fixture", + "customer": "ACustomer", + "internal_id": "ENTITY001", + "description": "Sample description", + "meta": { + "warehouse_bin": "1", + "warehouse_rack": "3", + "warehouse_section": "4" + }, + "weight": 2.5, + "weight_unit": "kg", + "length": 10, + "width": 5, + "height": 8, + "dimensions_unit": "mm", + "declared_value": 1500, + "price": 1200, + "sale_price": 900, + "sku": "SKU123", + "currency": "USD" + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Entities/.resources/Create an Entity.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\EntityService::createEntity", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-entities-delete-a-entity", + "collection": "Fleetbase API", + "group": "Entities", + "name": "Delete a Entity", + "method": "DELETE", + "url": "{{base_url}}/{{namespace}}/entities/:id", + "source": "postman/collections/Fleetbase API/Entities/Delete a Entity.request.yaml", + "description": "Delete an Entity.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{entity_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Entities/.resources/Delete a Entity.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\EntityService::deleteEntity", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-entities-query-entities", + "collection": "Fleetbase API", + "group": "Entities", + "name": "Query Entities", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/entities", + "source": "postman/collections/Fleetbase API/Entities/Query Entities.request.yaml", + "description": "Returns entities for the current company. Use filters such as `type`, `payload`, or `destination` to narrow the result set.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": { + "limit": "25", + "offset": "0", + "sort": "created_at", + "type": "parcel" + }, + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\EntityService::queryEntities", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-entities-retrieve-an-entity", + "collection": "Fleetbase API", + "group": "Entities", + "name": "Retrieve an Entity", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/entities/:id", + "source": "postman/collections/Fleetbase API/Entities/Retrieve an Entity.request.yaml", + "description": "Retrieve an Entity.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{entity_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Entities/.resources/Retrieve an Entity.resources/examples/OK.example.yaml", + "status": 200 + }, + { + "source": "postman/collections/Fleetbase API/Entities/.resources/Retrieve an Entity.resources/examples/Retrieve an Entity.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\EntityService::retrieveEntity", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-entities-update-a-entity", + "collection": "Fleetbase API", + "group": "Entities", + "name": "Update a Entity", + "method": "PUT", + "url": "{{base_url}}/{{namespace}}/entities/:id", + "source": "postman/collections/Fleetbase API/Entities/Update a Entity.request.yaml", + "description": "Updates an entity's descriptive fields, payload assignment, destination, dimensions, weight, pricing, or metadata.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{entity_id}}" + }, + "query": [], + "body_type": "json", + "body": { + "internal_id": "ENTITY001-1", + "description": "New entity description", + "destination": "", + "sku": "SKUABC123", + "currency": "SGD" + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Entities/.resources/Update a Entity.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\EntityService::updateEntity", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-equipment-create-equipment", + "collection": "Fleetbase API", + "group": "Equipment", + "name": "Create Equipment", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/equipment", + "source": "postman/collections/Fleetbase API/Equipment/Create Equipment.request.yaml", + "description": "Create equipment.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "name": "Liftgate LG-12", + "code": "LG-12", + "type": "liftgate", + "status": "available", + "serial_number": "LG120045", + "manufacturer": "Maxon", + "model": "BMR", + "currency": "USD" + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Equipment/.resources/Create Equipment.resources/examples/Created.example.yaml", + "status": 201 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\EquipmentService::createEquipment", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-equipment-delete-equipment", + "collection": "Fleetbase API", + "group": "Equipment", + "name": "Delete Equipment", + "method": "DELETE", + "url": "{{base_url}}/{{namespace}}/equipment/{{equipment_id}}", + "source": "postman/collections/Fleetbase API/Equipment/Delete Equipment.request.yaml", + "description": "Delete equipment.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Equipment/.resources/Delete Equipment.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\EquipmentService::deleteEquipment", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-equipment-query-equipment", + "collection": "Fleetbase API", + "group": "Equipment", + "name": "Query Equipment", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/equipment", + "source": "postman/collections/Fleetbase API/Equipment/Query Equipment.request.yaml", + "description": "Query equipment.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Equipment/.resources/Query Equipment.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\EquipmentService::queryEquipment", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-equipment-retrieve-equipment", + "collection": "Fleetbase API", + "group": "Equipment", + "name": "Retrieve Equipment", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/equipment/{{equipment_id}}", + "source": "postman/collections/Fleetbase API/Equipment/Retrieve Equipment.request.yaml", + "description": "Retrieve equipment.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Equipment/.resources/Retrieve Equipment.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\EquipmentService::retrieveEquipment", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-equipment-update-equipment", + "collection": "Fleetbase API", + "group": "Equipment", + "name": "Update Equipment", + "method": "PUT", + "url": "{{base_url}}/{{namespace}}/equipment/{{equipment_id}}", + "source": "postman/collections/Fleetbase API/Equipment/Update Equipment.request.yaml", + "description": "Update equipment.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "status": "maintenance" + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Equipment/.resources/Update Equipment.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\EquipmentService::updateEquipment", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-fleets-create-a-fleet", + "collection": "Fleetbase API", + "group": "Fleets", + "name": "Create a Fleet", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/fleets", + "source": "postman/collections/Fleetbase API/Fleets/Create a Fleet.request.yaml", + "description": "Creates a fleet for grouping drivers and vehicles. Assign a service area when the fleet should be constrained to a specific operating area.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "name": "Haulers", + "service_area": "service_area_id-fixture" + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Fleets/.resources/Create a Fleet.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\FleetService::createFleet", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-fleets-delete-a-fleet", + "collection": "Fleetbase API", + "group": "Fleets", + "name": "Delete a Fleet", + "method": "DELETE", + "url": "{{base_url}}/{{namespace}}/fleets/:id", + "source": "postman/collections/Fleetbase API/Fleets/Delete a Fleet.request.yaml", + "description": "Deletes a fleet.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{fleet_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Fleets/.resources/Delete a Fleet.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\FleetService::deleteFleet", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-fleets-query-fleets", + "collection": "Fleetbase API", + "group": "Fleets", + "name": "Query Fleets", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/fleets", + "source": "postman/collections/Fleetbase API/Fleets/Query Fleets.request.yaml", + "description": "Returns a paginated list of fleets for the current organization. Use pagination and sorting parameters to control the result set.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": { + "limit": "25", + "offset": "0", + "sort": "created_at" + }, + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Fleets/.resources/Query Fleets.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\FleetService::queryFleets", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-fleets-retrieve-a-fleet", + "collection": "Fleetbase API", + "group": "Fleets", + "name": "Retrieve a Fleet", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/fleets/:id", + "source": "postman/collections/Fleetbase API/Fleets/Retrieve a Fleet.request.yaml", + "description": "Retrieves a fleet.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{fleet_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Fleets/.resources/Retrieve a Fleet.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\FleetService::retrieveFleet", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-fleets-update-a-fleet", + "collection": "Fleetbase API", + "group": "Fleets", + "name": "Update a Fleet", + "method": "PUT", + "url": "{{base_url}}/{{namespace}}/fleets/:id", + "source": "postman/collections/Fleetbase API/Fleets/Update a Fleet.request.yaml", + "description": "Updates a fleet's name or assigned service area.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{fleet_id}}" + }, + "query": [], + "body_type": "json", + "body": { + "name": "Haulers", + "service_area": "service_area_id-fixture" + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Fleets/.resources/Update a Fleet.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\FleetService::updateFleet", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-fuel-reports-create-a-fuel-report", + "collection": "Fleetbase API", + "group": "Fuel Reports", + "name": "Create a Fuel Report", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/fuel-reports", + "source": "postman/collections/Fleetbase API/Fuel Reports/Create a Fuel Report.request.yaml", + "description": "Create a Fuel Report", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "driver": "driver_id-fixture", + "odometer": 12042, + "volume": 42.5, + "metric_unit": "liter", + "location": { + "latitude": 1.3521, + "longitude": 103.8198 + }, + "amount": 120.5, + "currency": "USD", + "status": "submitted" + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\FuelReportService::createFuelReport", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-fuel-reports-delete-a-fuel-report", + "collection": "Fleetbase API", + "group": "Fuel Reports", + "name": "Delete a Fuel Report", + "method": "DELETE", + "url": "{{base_url}}/{{namespace}}/fuel-reports/:id", + "source": "postman/collections/Fleetbase API/Fuel Reports/Delete a Fuel Report.request.yaml", + "description": "Delete a Fuel Report", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{fuel_report_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\FuelReportService::deleteFuelReport", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-fuel-reports-query-fuel-reports", + "collection": "Fleetbase API", + "group": "Fuel Reports", + "name": "Query Fuel Reports", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/fuel-reports", + "source": "postman/collections/Fleetbase API/Fuel Reports/Query Fuel Reports.request.yaml", + "description": "Query Fuel Reports", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": { + "limit": "25", + "offset": "0", + "sort": "created_at" + }, + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\FuelReportService::queryFuelReports", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-fuel-reports-retrieve-a-fuel-report", + "collection": "Fleetbase API", + "group": "Fuel Reports", + "name": "Retrieve a Fuel Report", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/fuel-reports/:id", + "source": "postman/collections/Fleetbase API/Fuel Reports/Retrieve a Fuel Report.request.yaml", + "description": "Retrieve a Fuel Report", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{fuel_report_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\FuelReportService::retrieveFuelReport", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-fuel-reports-update-a-fuel-report", + "collection": "Fleetbase API", + "group": "Fuel Reports", + "name": "Update a Fuel Report", + "method": "PUT", + "url": "{{base_url}}/{{namespace}}/fuel-reports/:id", + "source": "postman/collections/Fleetbase API/Fuel Reports/Update a Fuel Report.request.yaml", + "description": "Update a Fuel Report", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{fuel_report_id}}" + }, + "query": [], + "body_type": "json", + "body": { + "odometer": 12050, + "volume": 43.1, + "metric_unit": "liter", + "amount": 122.75, + "currency": "USD", + "status": "approved" + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\FuelReportService::updateFuelReport", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-fuel-transactions-create-a-fuel-transaction", + "collection": "Fleetbase API", + "group": "Fuel Transactions", + "name": "Create a Fuel Transaction", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/fuel-transactions", + "source": "postman/collections/Fleetbase API/Fuel Transactions/Create a Fuel Transaction.request.yaml", + "description": "Create a fuel transaction.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "provider": "petroapp", + "provider_transaction_id": "TX-timestamp-fixture", + "vehicle": "vehicle_id-fixture", + "station_name": "North Depot Fuel", + "transaction_at": "2026-05-07T08:30:00Z", + "volume": 42.5, + "metric_unit": "liter", + "amount": 6500, + "currency": "USD" + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Fuel Transactions/.resources/Create a Fuel Transaction.resources/examples/Created.example.yaml", + "status": 201 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\FuelTransactionService::createFuelTransaction", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-fuel-transactions-delete-a-fuel-transaction", + "collection": "Fleetbase API", + "group": "Fuel Transactions", + "name": "Delete a Fuel Transaction", + "method": "DELETE", + "url": "{{base_url}}/{{namespace}}/fuel-transactions/{{fuel_transaction_id}}", + "source": "postman/collections/Fleetbase API/Fuel Transactions/Delete a Fuel Transaction.request.yaml", + "description": "Delete a fuel transaction.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Fuel Transactions/.resources/Delete a Fuel Transaction.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\FuelTransactionService::deleteFuelTransaction", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-fuel-transactions-match-fuel-transaction-order", + "collection": "Fleetbase API", + "group": "Fuel Transactions", + "name": "Match Fuel Transaction Order", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/fuel-transactions/{{fuel_transaction_id}}/match-order", + "source": "postman/collections/Fleetbase API/Fuel Transactions/Match Fuel Transaction Order.request.yaml", + "description": "Match this fuel transaction to an order.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "order": "order_id-fixture" + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Fuel Transactions/.resources/Match Fuel Transaction Order.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\FuelTransactionService::matchFuelTransactionOrder", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-fuel-transactions-match-fuel-transaction-vehicle", + "collection": "Fleetbase API", + "group": "Fuel Transactions", + "name": "Match Fuel Transaction Vehicle", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/fuel-transactions/{{fuel_transaction_id}}/match-vehicle", + "source": "postman/collections/Fleetbase API/Fuel Transactions/Match Fuel Transaction Vehicle.request.yaml", + "description": "Match this fuel transaction to a vehicle.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "vehicle": "vehicle_id-fixture" + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Fuel Transactions/.resources/Match Fuel Transaction Vehicle.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\FuelTransactionService::matchFuelTransactionVehicle", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-fuel-transactions-query-fuel-transactions", + "collection": "Fleetbase API", + "group": "Fuel Transactions", + "name": "Query Fuel Transactions", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/fuel-transactions", + "source": "postman/collections/Fleetbase API/Fuel Transactions/Query Fuel Transactions.request.yaml", + "description": "Query fuel transactions.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Fuel Transactions/.resources/Query Fuel Transactions.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\FuelTransactionService::queryFuelTransactions", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-fuel-transactions-reprocess-fuel-transaction", + "collection": "Fleetbase API", + "group": "Fuel Transactions", + "name": "Reprocess Fuel Transaction", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/fuel-transactions/{{fuel_transaction_id}}/reprocess", + "source": "postman/collections/Fleetbase API/Fuel Transactions/Reprocess Fuel Transaction.request.yaml", + "description": "Reprocess matching and fuel report generation for this fuel transaction.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Fuel Transactions/.resources/Reprocess Fuel Transaction.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\FuelTransactionService::reprocessFuelTransaction", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-fuel-transactions-retrieve-a-fuel-transaction", + "collection": "Fleetbase API", + "group": "Fuel Transactions", + "name": "Retrieve a Fuel Transaction", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/fuel-transactions/{{fuel_transaction_id}}", + "source": "postman/collections/Fleetbase API/Fuel Transactions/Retrieve a Fuel Transaction.request.yaml", + "description": "Retrieve a fuel transaction.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Fuel Transactions/.resources/Retrieve a Fuel Transaction.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\FuelTransactionService::retrieveFuelTransaction", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-fuel-transactions-review-fuel-transaction", + "collection": "Fleetbase API", + "group": "Fuel Transactions", + "name": "Review Fuel Transaction", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/fuel-transactions/{{fuel_transaction_id}}/review", + "source": "postman/collections/Fleetbase API/Fuel Transactions/Review Fuel Transaction.request.yaml", + "description": "Mark this fuel transaction as reviewed or ignored.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "status": "reviewed" + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Fuel Transactions/.resources/Review Fuel Transaction.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\FuelTransactionService::reviewFuelTransaction", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-fuel-transactions-update-a-fuel-transaction", + "collection": "Fleetbase API", + "group": "Fuel Transactions", + "name": "Update a Fuel Transaction", + "method": "PUT", + "url": "{{base_url}}/{{namespace}}/fuel-transactions/{{fuel_transaction_id}}", + "source": "postman/collections/Fleetbase API/Fuel Transactions/Update a Fuel Transaction.request.yaml", + "description": "Update a fuel transaction.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "sync_status": "reviewed" + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Fuel Transactions/.resources/Update a Fuel Transaction.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\FuelTransactionService::updateFuelTransaction", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-geofences-get-driver-geofence-history", + "collection": "Fleetbase API", + "group": "Geofences", + "name": "Get Driver Geofence History", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/geofences/driver/:driverId/history", + "source": "postman/collections/Fleetbase API/Geofences/Get Driver Geofence History.request.yaml", + "description": "Get Driver Geofence History", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "driverId": "{{driver_id}}" + }, + "query": { + "per_page": "50" + }, + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\GeofenceService::getDriverGeofenceHistory", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-geofences-get-geofence-dwell-report", + "collection": "Fleetbase API", + "group": "Geofences", + "name": "Get Geofence Dwell Report", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/geofences/dwell-report", + "source": "postman/collections/Fleetbase API/Geofences/Get Geofence Dwell Report.request.yaml", + "description": "Get Geofence Dwell Report", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": { + "from": "{{from_datetime}}", + "to": "{{to_datetime}}" + }, + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\GeofenceService::getGeofenceDwellReport", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-geofences-get-geofence-inventory", + "collection": "Fleetbase API", + "group": "Geofences", + "name": "Get Geofence Inventory", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/geofences/inventory", + "source": "postman/collections/Fleetbase API/Geofences/Get Geofence Inventory.request.yaml", + "description": "Get Geofence Inventory", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\GeofenceService::getGeofenceInventory", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-geofences-list-geofence-events", + "collection": "Fleetbase API", + "group": "Geofences", + "name": "List Geofence Events", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/geofences/events", + "source": "postman/collections/Fleetbase API/Geofences/List Geofence Events.request.yaml", + "description": "List Geofence Events", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": { + "per_page": "50", + "event_type": "entered" + }, + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\GeofenceService::listGeofenceEvents", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-issues-create-an-issue", + "collection": "Fleetbase API", + "group": "Issues", + "name": "Create an Issue", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/issues", + "source": "postman/collections/Fleetbase API/Issues/Create an Issue.request.yaml", + "description": "Create an Issue", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "driver": "driver_id-fixture", + "location": { + "latitude": 1.3521, + "longitude": 103.8198 + }, + "report": "Vehicle tire pressure warning", + "category": "vehicle", + "type": "maintenance", + "priority": "medium", + "status": "open" + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\IssueService::createIssue", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-issues-delete-an-issue", + "collection": "Fleetbase API", + "group": "Issues", + "name": "Delete an Issue", + "method": "DELETE", + "url": "{{base_url}}/{{namespace}}/issues/:id", + "source": "postman/collections/Fleetbase API/Issues/Delete an Issue.request.yaml", + "description": "Delete an Issue", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{issue_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\IssueService::deleteIssue", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-issues-query-issues", + "collection": "Fleetbase API", + "group": "Issues", + "name": "Query Issues", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/issues", + "source": "postman/collections/Fleetbase API/Issues/Query Issues.request.yaml", + "description": "Query Issues", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": { + "limit": "25", + "offset": "0", + "sort": "created_at" + }, + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\IssueService::queryIssues", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-issues-retrieve-an-issue", + "collection": "Fleetbase API", + "group": "Issues", + "name": "Retrieve an Issue", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/issues/:id", + "source": "postman/collections/Fleetbase API/Issues/Retrieve an Issue.request.yaml", + "description": "Retrieve an Issue", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{issue_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\IssueService::retrieveIssue", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-issues-update-an-issue", + "collection": "Fleetbase API", + "group": "Issues", + "name": "Update an Issue", + "method": "PUT", + "url": "{{base_url}}/{{namespace}}/issues/:id", + "source": "postman/collections/Fleetbase API/Issues/Update an Issue.request.yaml", + "description": "Update an Issue", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{issue_id}}" + }, + "query": [], + "body_type": "json", + "body": { + "report": "Updated issue report", + "category": "vehicle", + "type": "maintenance", + "priority": "high", + "status": "resolved" + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\IssueService::updateIssue", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-labels-render-label", + "collection": "Fleetbase API", + "group": "Labels", + "name": "Render Label", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/labels/:id", + "source": "postman/collections/Fleetbase API/Labels/Render Label.request.yaml", + "description": "Renders a PDF, text, or base64 label for an order, waypoint, or entity id.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{order_id}}" + }, + "query": { + "format": "stream", + "type": "order" + }, + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\LabelService::renderLabel", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-manifests-optimize-a-manifest", + "collection": "Fleetbase API", + "group": "Manifests", + "name": "Optimize a Manifest", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/manifests/:id/optimize", + "source": "postman/collections/Fleetbase API/Manifests/Optimize a Manifest.request.yaml", + "description": "Re-sequences the stops a driver has not done yet, nearest first.\n\nThis is the driver's optimise, not the orchestrator's. The orchestrator allocates orders across a fleet and produces manifests; this reorders the stops of one manifest that is already assigned.\n\nIt is a nearest-neighbour walk over road distances: from the driver's position to the closest remaining stop, then the closest from there. That is usually a large improvement on an arbitrary order and is not guaranteed optimal.\n\nCompleted and skipped stops keep their place \u2014 a route already driven is not re-planned. A manifest with fewer than three stops still to do is returned unchanged, since there is no ordering to find.\n\nSend `latitude` and `longitude` to start the walk from where the driver actually is. Without them it starts from the first stop still to do.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{manifest_id}}" + }, + "query": [], + "body_type": "json", + "body": { + "latitude": 1.3521, + "longitude": 103.8198 + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\ManifestService::optimizeManifest", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-manifests-retrieve-a-manifest", + "collection": "Fleetbase API", + "group": "Manifests", + "name": "Retrieve a Manifest", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/manifests/:id", + "source": "postman/collections/Fleetbase API/Manifests/Retrieve a Manifest.request.yaml", + "description": "Retrieves a manifest with its stops, in the sequence they are to be driven.\n\nEach stop carries its place inline \u2014 a route of twenty stops is one request, not twenty-one \u2014 along with its status, estimated and actual arrival, and the distance and duration from the previous stop.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{manifest_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\ManifestService::retrieveManifest", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-manifests-update-a-manifest-stop", + "collection": "Fleetbase API", + "group": "Manifests", + "name": "Update a Manifest Stop", + "method": "PATCH", + "url": "{{base_url}}/{{namespace}}/manifest-stops/:id", + "source": "postman/collections/Fleetbase API/Manifests/Update a Manifest Stop.request.yaml", + "description": "Marks a stop on a manifest as arrived, completed or skipped.\n\nStatus changes run through the manifest's own transitions rather than writing a column, so arrival and completion timestamps are recorded and a manifest completes itself when its last stop does.\n\nAny other status is refused and changes nothing.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{manifest_stop_id}}" + }, + "query": [], + "body_type": "json", + "body": { + "status": "arrived" + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\ManifestService::updateManifestStop", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-onboard-get-driver-onboard-settings", + "collection": "Fleetbase API", + "group": "Onboard", + "name": "Get Driver Onboard Settings", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/onboard/driver-onboard-settings/:companyId", + "source": "postman/collections/Fleetbase API/Onboard/Get Driver Onboard Settings.request.yaml", + "description": "Returns driver onboarding settings for an organization.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "companyId": "{{organization_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\OnboardService::getDriverOnboardSettings", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-orchestrator-commit-orchestrator-plan", + "collection": "Fleetbase API", + "group": "Orchestrator", + "name": "Commit Orchestrator Plan", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/orchestrator/commit", + "source": "postman/collections/Fleetbase API/Orchestrator/Commit Orchestrator Plan.request.yaml", + "description": "Commits a proposed orchestrator plan by creating manifests and applying vehicle and driver assignments to orders. Assignment records must use public resource IDs.\n\nThis endpoint is engine-agnostic: commit the `assignments` returned by route-aware VROOM, VROOM capacity-only, native capacity-only, or multi-phase orchestration runs. Do not submit internal UUIDs or database IDs.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "scheduled_date": "2026-05-16", + "assignments": [ + { + "order_id": "order_id-fixture", + "vehicle_id": "vehicle_id-fixture", + "driver_id": "driver_id-fixture", + "sequence": 1, + "arrival": 1778918400, + "duration": 900, + "distance": 4200 + } + ] + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Orchestrator/.resources/Commit Orchestrator Plan.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\OrchestratorService::commitOrchestratorPlan", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-orchestrator-run-orchestrator", + "collection": "Fleetbase API", + "group": "Orchestrator", + "name": "Run Orchestrator", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/orchestrator/run", + "source": "postman/collections/Fleetbase API/Orchestrator/Run Orchestrator.request.yaml", + "description": "Runs an orchestration phase and returns a proposed assignment plan without committing changes. Use `options.engine` to force an engine: `greedy` and `capacity` are built in and need no external service, while `vroom` requires a reachable VROOM instance. Omitting `options.engine` uses the orchestrator engine configured in admin settings, which defaults to `greedy`.\n\nFor normal route-aware VROOM allocation, send `options.engine: \"vroom\"` and omit `allocation_strategy` or set it to `route_aware`. Vehicles must have usable positions because VROOM will solve against route coordinates.\n\nFor capacity-only VROOM allocation, send `options.engine: \"vroom\"` and `options.allocation_strategy: \"capacity_only\"`. This mode answers which vehicles can carry the selected orders by weight, volume, pallets, parcels, skills, and task limits without requiring vehicle locations. Use `options.vehicle_packing: \"minimize_vehicles\"` to bias VROOM toward filling feasible vehicles before opening another vehicle; use `balanced` or `none` to disable that packing bias.\n\nFor Fleetbase's deterministic built-in capacity allocation, send `options.engine: \"capacity\"`. This native engine is useful as a fallback and debugging baseline for capacity-only allocation without VROOM.\n\nThe consumable API accepts and returns public IDs only. Use `order_ids`, `vehicle_ids`, `driver_ids`, `prior_assignments.*_id`, and response `*_id` values as public IDs. Do not submit internal UUIDs.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "mode": "assign_vehicles", + "order_ids": [ + "order_id-fixture" + ], + "vehicle_ids": [ + "vehicle_id-fixture" + ], + "driver_ids": [], + "prior_assignments": [], + "options": { + "engine": "greedy", + "allocation_strategy": "route_aware", + "geometry": false, + "respect_capacity": true, + "respect_skills": true, + "return_to_depot": false + } + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Orchestrator/.resources/Run Orchestrator.resources/examples/Multi-phase Prior Assignments.example.yaml", + "status": 200 + }, + { + "source": "postman/collections/Fleetbase API/Orchestrator/.resources/Run Orchestrator.resources/examples/Native Capacity Allocation.example.yaml", + "status": 200 + }, + { + "source": "postman/collections/Fleetbase API/Orchestrator/.resources/Run Orchestrator.resources/examples/Single-phase VROOM Allocation.example.yaml", + "status": 200 + }, + { + "source": "postman/collections/Fleetbase API/Orchestrator/.resources/Run Orchestrator.resources/examples/VROOM Capacity Only Allocation.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\OrchestratorService::runOrchestrator", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-order-configs-query-order-configs", + "collection": "Fleetbase API", + "group": "Order Configs", + "name": "Query Order Configs", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/order-configs", + "source": "postman/collections/Fleetbase API/Order Configs/Query Order Configs.request.yaml", + "description": "Lists OrderConfigs available to the company resolved from the API credential.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\OrderConfigService::queryOrderConfigs", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-order-configs-retrieve-an-order-config", + "collection": "Fleetbase API", + "group": "Order Configs", + "name": "Retrieve an Order Config", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/order-configs/{{order_config_id}}", + "source": "postman/collections/Fleetbase API/Order Configs/Retrieve an Order Config.request.yaml", + "description": "Fetches a single OrderConfig. The `{id}` segment accepts any identifier supported by `OrderConfig::resolveFromIdentifier` \u2014 `uuid`, `public_id`, `namespace`, or short `key`. Use `transport` to retrieve the system default flow.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\OrderConfigService::retrieveOrderConfig", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-orders-cancel-an-order", + "collection": "Fleetbase API", + "group": "Orders", + "name": "Cancel an Order", + "method": "DELETE", + "url": "{{base_url}}/{{namespace}}/orders/:id/cancel", + "source": "postman/collections/Fleetbase API/Orders/Cancel an Order.request.yaml", + "description": "Cancels an order without deleting the order resource.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{order_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Orders/.resources/Cancel an Order.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\OrderService::cancelOrder", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-orders-capture-photo-for-order", + "collection": "Fleetbase API", + "group": "Orders", + "name": "Capture Photo for Order", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/orders/:id/capture-photo/:subjectId", + "source": "postman/collections/Fleetbase API/Orders/Capture Photo for Order.request.yaml", + "description": "Captures proof photos for an order or order subject.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{order_id}}", + "subjectId": "{{subject_id}}" + }, + "query": [], + "body_type": "json", + "body": { + "photos": [ + "proof_photo_base64-fixture" + ], + "remarks": "Verified by Photo", + "data": [] + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\OrderService::capturePhotoForOrder", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-orders-capture-qr-code-for-order", + "collection": "Fleetbase API", + "group": "Orders", + "name": "Capture QR Code for Order", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/orders/:id/capture-qr/:subject-id", + "source": "postman/collections/Fleetbase API/Orders/Capture QR Code for Order.request.yaml", + "description": "Captures a QR code proof for an order or order subject. The response includes the updated proof data associated with the order.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{order_id}}", + "subject-id": "" + }, + "query": [], + "body_type": "json", + "body": { + "code": "qr_code-fixture", + "data": [], + "raw_data": [] + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Orders/.resources/Capture QR Code for Order.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\OrderService::captureQrCodeForOrder", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-orders-capture-signature-for-order", + "collection": "Fleetbase API", + "group": "Orders", + "name": "Capture Signature for Order", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/orders/:id/capture-signature/:subject-id", + "source": "postman/collections/Fleetbase API/Orders/Capture Signature for Order.request.yaml", + "description": "Captures a signature proof for an order or order subject. Use this when a workflow requires signed proof of delivery or pickup.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{order_id}}", + "subject-id": "" + }, + "query": [], + "body_type": "json", + "body": { + "signature": "proof_signature_base64-fixture", + "data": [] + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Orders/.resources/Capture Signature for Order.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\OrderService::captureSignatureForOrder", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-orders-complete-an-order", + "collection": "Fleetbase API", + "group": "Orders", + "name": "Complete an Order", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/orders/:id/complete", + "source": "postman/collections/Fleetbase API/Orders/Complete an Order.request.yaml", + "description": "Completes an order after all waypoints are complete.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{order_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\OrderService::completeOrder", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-orders-create-an-order", + "collection": "Fleetbase API", + "group": "Orders", + "name": "Create an Order", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/orders", + "source": "postman/collections/Fleetbase API/Orders/Create an Order.request.yaml", + "description": "Creates a new order for the current company. Provide an existing payload ID, an inline payload, a pickup/dropoff pair, or at least two waypoints; Fleetbase creates or attaches the payload before creating the order.\n\nYou can assign a driver, vehicle, facilitator, customer, service quote, or schedule at creation time. When `dispatch` is true, Fleetbase dispatches the order after it is created unless the order belongs to an integrated vendor flow.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "pickup": "Singapore 018971", + "dropoff": "321 Orchard Rd, Singapore", + "waypoints": [ + "10 Bayfront Avenue, Singapore 018956", + "18 Marina Gardens Drive, Singapore 018953", + "80 Mandai Lake Rd, Singapore 729826", + "1 Beach Road, Singapore 189673" + ], + "dispatch": false, + "driver": "driver_id-fixture", + "facilitator": "vendor_id-fixture", + "customer": "contact_id-fixture", + "meta": { + "Warehouse": "WAREHOUSE-123" + }, + "notes": "Order notes" + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Orders/.resources/Create an Order.resources/examples/Create an Order using Complete Payload.example.yaml", + "status": 201 + }, + { + "source": "postman/collections/Fleetbase API/Orders/.resources/Create an Order.resources/examples/Create an Order using Payload.example.yaml", + "status": 200 + }, + { + "source": "postman/collections/Fleetbase API/Orders/.resources/Create an Order.resources/examples/Create an Order using Waypoints and Entities with Photos.example.yaml", + "status": 200 + }, + { + "source": "postman/collections/Fleetbase API/Orders/.resources/Create an Order.resources/examples/Create an Order using Waypoints and Entity Destinations.example.yaml", + "status": 200 + }, + { + "source": "postman/collections/Fleetbase API/Orders/.resources/Create an Order.resources/examples/Create an Order using only Pickup Dropoff.example.yaml", + "status": 200 + }, + { + "source": "postman/collections/Fleetbase API/Orders/.resources/Create an Order.resources/examples/Create an Order using only Waypoints.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\OrderService::createOrder", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-orders-create-an-order-using-complete-payload", + "collection": "Fleetbase API", + "group": "Orders", + "name": "Create an Order using Complete Payload", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/orders", + "source": "postman/collections/Fleetbase API/Orders/Create an Order using Complete Payload.request.yaml", + "description": "Creates an order using the Complete Payload payload shape.\nPromoted from a stored example so the shape is actually exercised: the Postman CLI\nruns requests, never examples, so these shapes had no coverage at all.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "pickup": "Singapore 018971", + "dropoff": "321 Orchard Rd, Singapore", + "dispatch": false, + "driver": "driver_id-fixture", + "customer": "contact_id-fixture", + "notes": "Deliver through receiving bay." + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\OrderService::createOrderUsingCompletePayload", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-orders-create-an-order-using-coordinates", + "collection": "Fleetbase API", + "group": "Orders", + "name": "Create an Order using Coordinates", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/orders", + "source": "postman/collections/Fleetbase API/Orders/Create an Order using Coordinates.request.yaml", + "description": "Creates an order with `pickup` and `dropoff` given as coordinate objects.\n\n`Place::createFromMixed` accepts a place as more than a public id. When the value is\na coordinate pair it resolves through `createFromCoordinates`, so no address lookup\nis involved. Latitude and longitude are read through a list of aliases \u2014 `lat`,\n`latitude`, `x`, `0` and `lon`, `lng`, `longitude`, `y`, `1` \u2014 so several spellings\nare equivalent.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "pickup": { + "latitude": 1.2830632, + "longitude": 103.8579965 + }, + "dropoff": { + "lat": 1.4043, + "lng": 103.793 + } + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\OrderService::createOrderUsingCoordinates", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-orders-create-an-order-using-geojson-points", + "collection": "Fleetbase API", + "group": "Orders", + "name": "Create an Order using GeoJSON Points", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/orders", + "source": "postman/collections/Fleetbase API/Orders/Create an Order using GeoJSON Points.request.yaml", + "description": "Creates an order with `pickup` and `dropoff` given as GeoJSON Point objects.\n\n`Place::createFromMixed` recognises GeoJSON directly, so a client already holding\nGeoJSON geometry does not have to convert it. Note the GeoJSON axis order is\n`[longitude, latitude]`, the reverse of the coordinate-object form.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "pickup": { + "type": "Point", + "coordinates": [ + 103.8579965, + 1.2830632 + ] + }, + "dropoff": { + "type": "Point", + "coordinates": [ + 103.793, + 1.4043 + ] + } + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\OrderService::createOrderUsingGeojsonPoints", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-orders-create-an-order-using-payload", + "collection": "Fleetbase API", + "group": "Orders", + "name": "Create an Order using Payload", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/orders", + "source": "postman/collections/Fleetbase API/Orders/Create an Order using Payload.request.yaml", + "description": "Creates an order using the Payload payload shape.\nPromoted from a stored example so the shape is actually exercised: the Postman CLI\nruns requests, never examples, so these shapes had no coverage at all.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "payload": { + "pickup": "Singapore 018971", + "dropoff": "321 Orchard Rd, Singapore", + "entities": [ + { + "name": "UltraHD 4K Smart TV", + "description": "65-inch high-definition smart TV with vibrant colors and a sleek design.", + "currency": "USD", + "price": 1200 + }, + { + "name": "Bluetooth Wireless Headphones", + "description": "Noise-cancelling, over-ear headphones with long-lasting battery life.", + "currency": "USD", + "price": 250 + }, + { + "name": "Smart Fitness Watch", + "description": "Water-resistant fitness watch with heart rate monitor and GPS tracking.", + "currency": "USD", + "price": 199.99 + } + ] + }, + "meta": { + "Warehouse": "WAREHOUSE-123" + }, + "notes": "Order notes" + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\OrderService::createOrderUsingPayload", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-orders-create-an-order-using-waypoints-and-entities-with-photos", + "collection": "Fleetbase API", + "group": "Orders", + "name": "Create an Order using Waypoints and Entities with Photos", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/orders", + "source": "postman/collections/Fleetbase API/Orders/Create an Order using Waypoints and Entities with Photos.request.yaml", + "description": "Creates an order using the Waypoints and Entities with Photos payload shape.\nPromoted from a stored example so the shape is actually exercised: the Postman CLI\nruns requests, never examples, so these shapes had no coverage at all.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "payload": { + "waypoints": [ + "Singapore 018971", + "321 Orchard Rd, Singapore" + ], + "entities": [ + { + "destination": 0, + "name": "UltraHD 4K Smart TV", + "description": "65-inch high-definition smart TV with vibrant colors and a sleek design.", + "currency": "USD", + "price": 1200, + "photo": "https://cdn.thewirecutter.com/wp-content/media/2025/07/BEST-BUDGET-4K-TV-2048px-3185-2x1-1.jpg?width=1024&quality=75&crop=2:1&auto=webp" + }, + { + "destination": 0, + "name": "Bluetooth Wireless Headphones", + "description": "Noise-cancelling, over-ear headphones with long-lasting battery life.", + "currency": "USD", + "price": 250, + "photo": "https://cdn.thewirecutter.com/wp-content/media/2025/07/BEST-BUDGET-4K-TV-2048px-3185-2x1-1.jpg?width=1024&quality=75&crop=2:1&auto=webp" + }, + { + "destination": 1, + "name": "Smart Fitness Watch", + "description": "Water-resistant fitness watch with heart rate monitor and GPS tracking.", + "currency": "USD", + "price": 199.99, + "photo": "https://cdn.thewirecutter.com/wp-content/media/2025/07/BEST-BUDGET-4K-TV-2048px-3185-2x1-1.jpg?width=1024&quality=75&crop=2:1&auto=webp" + } + ] + }, + "meta": { + "Warehouse": "WAREHOUSE-123" + }, + "notes": "Order notes" + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\OrderService::createOrderUsingWaypointsAndEntitiesWithPhotos", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-orders-create-an-order-using-waypoints-and-entity-destinations", + "collection": "Fleetbase API", + "group": "Orders", + "name": "Create an Order using Waypoints and Entity Destinations", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/orders", + "source": "postman/collections/Fleetbase API/Orders/Create an Order using Waypoints and Entity Destinations.request.yaml", + "description": "Creates an order using the Waypoints and Entity Destinations payload shape.\nPromoted from a stored example so the shape is actually exercised: the Postman CLI\nruns requests, never examples, so these shapes had no coverage at all.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "payload": { + "waypoints": [ + "Singapore 018971", + "321 Orchard Rd, Singapore" + ], + "entities": [ + { + "destination": 0, + "name": "UltraHD 4K Smart TV", + "description": "65-inch high-definition smart TV with vibrant colors and a sleek design.", + "currency": "USD", + "price": 1200 + }, + { + "destination": 0, + "name": "Bluetooth Wireless Headphones", + "description": "Noise-cancelling, over-ear headphones with long-lasting battery life.", + "currency": "USD", + "price": 250 + }, + { + "destination": 1, + "name": "Smart Fitness Watch", + "description": "Water-resistant fitness watch with heart rate monitor and GPS tracking.", + "currency": "USD", + "price": 199.99 + } + ] + }, + "meta": { + "Warehouse": "WAREHOUSE-123" + }, + "notes": "Order notes" + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\OrderService::createOrderUsingWaypointsAndEntityDestinations", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-orders-create-an-order-using-only-pickup-dropoff", + "collection": "Fleetbase API", + "group": "Orders", + "name": "Create an Order using only Pickup Dropoff", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/orders", + "source": "postman/collections/Fleetbase API/Orders/Create an Order using only Pickup Dropoff.request.yaml", + "description": "Creates an order using the only Pickup Dropoff payload shape.\nPromoted from a stored example so the shape is actually exercised: the Postman CLI\nruns requests, never examples, so these shapes had no coverage at all.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "pickup": "Singapore 018971", + "dropoff": "321 Orchard Rd, Singapore" + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\OrderService::createOrderUsingOnlyPickupDropoff", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-orders-create-an-order-using-only-waypoints", + "collection": "Fleetbase API", + "group": "Orders", + "name": "Create an Order using only Waypoints", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/orders", + "source": "postman/collections/Fleetbase API/Orders/Create an Order using only Waypoints.request.yaml", + "description": "Creates an order using the only Waypoints payload shape.\nPromoted from a stored example so the shape is actually exercised: the Postman CLI\nruns requests, never examples, so these shapes had no coverage at all.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "waypoints": [ + [ + 1.3521, + 103.8198 + ], + "10 Bayfront Avenue, Singapore 018956", + "18 Marina Gardens Drive, Singapore 018953", + "80 Mandai Lake Rd, Singapore 729826", + "1 Beach Road, Singapore 189673", + "Sentosa, Singapore" + ] + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\OrderService::createOrderUsingOnlyWaypoints", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-orders-delete-an-order", + "collection": "Fleetbase API", + "group": "Orders", + "name": "Delete an Order", + "method": "DELETE", + "url": "{{base_url}}/{{namespace}}/orders/:id", + "source": "postman/collections/Fleetbase API/Orders/Delete an Order.request.yaml", + "description": "Deletes an order resource.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{order_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\OrderService::deleteOrder", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-orders-dispatch-an-order", + "collection": "Fleetbase API", + "group": "Orders", + "name": "Dispatch an Order", + "method": "PATCH", + "url": "{{base_url}}/{{namespace}}/orders/:id/dispatch", + "source": "postman/collections/Fleetbase API/Orders/Dispatch an Order.request.yaml", + "description": "Dispatches an order to an assigned or eligible driver. The response returns the order after dispatch state has been applied.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{order_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Orders/.resources/Dispatch an Order.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\OrderService::dispatchOrder", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-orders-get-editable-entity-fields", + "collection": "Fleetbase API", + "group": "Orders", + "name": "Get Editable Entity Fields", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/orders/:id/editable-entity-fields", + "source": "postman/collections/Fleetbase API/Orders/Get Editable Entity Fields.request.yaml", + "description": "Returns configured editable entity fields for an order.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{order_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\OrderService::getEditableEntityFields", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-orders-get-order-distance-and-time", + "collection": "Fleetbase API", + "group": "Orders", + "name": "Get Order Distance and Time", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/orders/:id/distance-and-time", + "source": "postman/collections/Fleetbase API/Orders/Get Order Distance and Time.request.yaml", + "description": "Returns and updates the order distance/time matrix.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{order_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\OrderService::getOrderDistanceAndTime", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-orders-get-order-eta", + "collection": "Fleetbase API", + "group": "Orders", + "name": "Get Order ETA", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/orders/:id/eta", + "source": "postman/collections/Fleetbase API/Orders/Get Order ETA.request.yaml", + "description": "Returns ETA data for an order.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{order_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\OrderService::getOrderEta", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-orders-get-order-next-activity", + "collection": "Fleetbase API", + "group": "Orders", + "name": "Get Order Next Activity", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/orders/:id/next-activity", + "source": "postman/collections/Fleetbase API/Orders/Get Order Next Activity.request.yaml", + "description": "Returns the next workflow activity for an order. Use it to determine the next operational step available to the assigned driver or dispatcher.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{order_id}}" + }, + "query": { + "waypoint": "{{current_waypoint_id}}" + }, + "body_type": "json", + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Orders/.resources/Get Order Next Activity.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\OrderService::getOrderNextActivity", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-orders-get-order-tracker", + "collection": "Fleetbase API", + "group": "Orders", + "name": "Get Order Tracker", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/orders/:id/tracker", + "source": "postman/collections/Fleetbase API/Orders/Get Order Tracker.request.yaml", + "description": "Returns public tracking data for an order.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{order_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\OrderService::getOrderTracker", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-orders-list-order-comments", + "collection": "Fleetbase API", + "group": "Orders", + "name": "List Order Comments", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/orders/:id/comments", + "source": "postman/collections/Fleetbase API/Orders/List Order Comments.request.yaml", + "description": "Lists comments attached to an order.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{order_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\OrderService::listOrderComments", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-orders-list-order-proofs", + "collection": "Fleetbase API", + "group": "Orders", + "name": "List Order Proofs", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/orders/:id/proofs/:subjectId", + "source": "postman/collections/Fleetbase API/Orders/List Order Proofs.request.yaml", + "description": "Lists proof of delivery resources for an order or subject.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{order_id}}", + "subjectId": "{{subject_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\OrderService::listOrderProofs", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-orders-query-orders", + "collection": "Fleetbase API", + "group": "Orders", + "name": "Query Orders", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/orders", + "source": "postman/collections/Fleetbase API/Orders/Query Orders.request.yaml", + "description": "Returns orders for the current company. Use filters such as `status`, `payload`, `customer`, `facilitator`, or `nearby` to narrow the result set.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": { + "limit": "25", + "offset": "0", + "sort": "created_at", + "status": "created" + }, + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\OrderService::queryOrders", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-orders-retrieve-an-order", + "collection": "Fleetbase API", + "group": "Orders", + "name": "Retrieve an Order", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/orders/{{order_id}}", + "source": "postman/collections/Fleetbase API/Orders/Retrieve an Order.request.yaml", + "description": "Retrieves a single order by ID. The response includes the public order fields plus loaded payload, tracking, assignment, customer, and facilitator data when available.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Orders/.resources/Retrieve an Order.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\OrderService::retrieveOrder", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-orders-schedule-an-order", + "collection": "Fleetbase API", + "group": "Orders", + "name": "Schedule an Order", + "method": "PATCH", + "url": "{{base_url}}/{{namespace}}/orders/:id/schedule", + "source": "postman/collections/Fleetbase API/Orders/Schedule an Order.request.yaml", + "description": "Schedules an order for a specific date and optional time. Fleetbase parses the schedule using the supplied timezone or the company timezone.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{order_id}}" + }, + "query": [], + "body_type": "json", + "body": { + "date": "2024-02-11", + "time": "8am", + "timezone": "Asia/Singapore" + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Orders/.resources/Schedule an Order.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\OrderService::scheduleOrder", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-orders-set-order-destination", + "collection": "Fleetbase API", + "group": "Orders", + "name": "Set Order Destination", + "method": "PATCH", + "url": "{{base_url}}/{{namespace}}/orders/:id/set-destination/:placeId", + "source": "postman/collections/Fleetbase API/Orders/Set Order Destination.request.yaml", + "description": "Sets the destination waypoint or place for an order. The response returns the updated order after the destination is changed.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{order_id}}", + "placeId": "{{waypoint_id}}" + }, + "query": [], + "body_type": "json", + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Orders/.resources/Set Order Destination.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\OrderService::setOrderDestination", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-orders-start-an-order", + "collection": "Fleetbase API", + "group": "Orders", + "name": "Start an Order", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/orders/:id/start", + "source": "postman/collections/Fleetbase API/Orders/Start an Order.request.yaml", + "description": "Starts an order and transitions it into active execution. Use this when a driver or dispatcher begins fulfillment.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{order_id}}" + }, + "query": [], + "body_type": "json", + "body": { + "skip_dispatch": false + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Orders/.resources/Start an Order.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\OrderService::startOrder", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-orders-update-order-activity", + "collection": "Fleetbase API", + "group": "Orders", + "name": "Update Order Activity", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/orders/:id/update-activity", + "source": "postman/collections/Fleetbase API/Orders/Update Order Activity.request.yaml", + "description": "Updates the current activity state for an order. The response returns the order with the latest workflow activity applied.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{order_id}}" + }, + "query": [], + "body_type": "json", + "body": { + "activity": "next_activity-fixture", + "skip_dispatch": false + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Orders/.resources/Update Order Activity.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\OrderService::updateOrderActivity", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-orders-update-an-order", + "collection": "Fleetbase API", + "group": "Orders", + "name": "Update an Order", + "method": "PUT", + "url": "{{base_url}}/{{namespace}}/orders/:id", + "source": "postman/collections/Fleetbase API/Orders/Update an Order.request.yaml", + "description": "Updates an order and returns the updated order resource. You can update order metadata, notes, status, assignment fields, scheduling fields, proof-of-delivery settings, and payload details.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{order_id}}" + }, + "query": [], + "body_type": "json", + "body": { + "service_quote": "service_quote_id-fixture" + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Orders/.resources/Update an Order.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\OrderService::updateOrder", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-organizations-get-current-organization", + "collection": "Fleetbase API", + "group": "Organizations", + "name": "Get Current Organization", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/organizations/current", + "source": "postman/collections/Fleetbase API/Organizations/Get Current Organization.request.yaml", + "description": "Returns the organization associated with the API key on the request. Use it to confirm which account a credential belongs to, and to obtain the organization's id for endpoints that address an organization by path.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\OrganizationService::getCurrentOrganization", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-organizations-list-organizations", + "collection": "Fleetbase API", + "group": "Organizations", + "name": "List Organizations", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/organizations", + "source": "postman/collections/Fleetbase API/Organizations/List Organizations.request.yaml", + "description": "Lists organizations available for driver onboarding and organization selection.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": { + "limit": "10", + "with_driver_onboard": "false" + }, + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\OrganizationService::listOrganizations", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-parts-create-a-part", + "collection": "Fleetbase API", + "group": "Parts", + "name": "Create a Part", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/parts", + "source": "postman/collections/Fleetbase API/Parts/Create a Part.request.yaml", + "description": "Create a part.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "sku": "FLT-OIL-timestamp-fixture", + "name": "Oil Filter", + "quantity_on_hand": 24, + "unit_cost": 1200, + "currency": "USD", + "status": "in_stock" + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Parts/.resources/Create a Part.resources/examples/Created.example.yaml", + "status": 201 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\PartService::createPart", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-parts-delete-a-part", + "collection": "Fleetbase API", + "group": "Parts", + "name": "Delete a Part", + "method": "DELETE", + "url": "{{base_url}}/{{namespace}}/parts/{{part_id}}", + "source": "postman/collections/Fleetbase API/Parts/Delete a Part.request.yaml", + "description": "Delete a part.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Parts/.resources/Delete a Part.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\PartService::deletePart", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-parts-query-parts", + "collection": "Fleetbase API", + "group": "Parts", + "name": "Query Parts", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/parts", + "source": "postman/collections/Fleetbase API/Parts/Query Parts.request.yaml", + "description": "Query parts.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Parts/.resources/Query Parts.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\PartService::queryParts", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-parts-retrieve-a-part", + "collection": "Fleetbase API", + "group": "Parts", + "name": "Retrieve a Part", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/parts/{{part_id}}", + "source": "postman/collections/Fleetbase API/Parts/Retrieve a Part.request.yaml", + "description": "Retrieve a part.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Parts/.resources/Retrieve a Part.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\PartService::retrievePart", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-parts-update-a-part", + "collection": "Fleetbase API", + "group": "Parts", + "name": "Update a Part", + "method": "PUT", + "url": "{{base_url}}/{{namespace}}/parts/{{part_id}}", + "source": "postman/collections/Fleetbase API/Parts/Update a Part.request.yaml", + "description": "Update a part.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "quantity_on_hand": 18 + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Parts/.resources/Update a Part.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\PartService::updatePart", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-payloads-create-a-payload", + "collection": "Fleetbase API", + "group": "Payloads", + "name": "Create a Payload", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/payloads", + "source": "postman/collections/Fleetbase API/Payloads/Create a Payload.request.yaml", + "description": "Creates a payload containing route endpoints and optional entities. Provide either pickup/dropoff endpoints or a waypoint list, then attach entities as needed.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "pickup": { + "street1": "10 Bayfront Avenue", + "city": "Singapore", + "postal_code": "018956", + "country": "SG" + }, + "dropoff": { + "street1": "80 Mandai Lake Rd", + "city": "Singapore", + "postal_code": "729826", + "country": "SG" + }, + "type": "food_delivery" + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Payloads/.resources/Create a Payload.resources/examples/Create a Payload With Multiple Waypoints.example.yaml", + "status": 200 + }, + { + "source": "postman/collections/Fleetbase API/Payloads/.resources/Create a Payload.resources/examples/Create a Payload.example.yaml", + "status": 201 + }, + { + "source": "postman/collections/Fleetbase API/Payloads/.resources/Create a Payload.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\PayloadService::createPayload", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-payloads-delete-a-payload", + "collection": "Fleetbase API", + "group": "Payloads", + "name": "Delete a Payload", + "method": "DELETE", + "url": "{{base_url}}/{{namespace}}/payloads/:id", + "source": "postman/collections/Fleetbase API/Payloads/Delete a Payload.request.yaml", + "description": "Delete a Payload.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{payload_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Payloads/.resources/Delete a Payload.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\PayloadService::deletePayload", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-payloads-query-payloads", + "collection": "Fleetbase API", + "group": "Payloads", + "name": "Query Payloads", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/payloads", + "source": "postman/collections/Fleetbase API/Payloads/Query Payloads.request.yaml", + "description": "Returns payloads for the current company. Use pagination and sort parameters to page through payload records.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": { + "limit": "25", + "offset": "0", + "sort": "created_at" + }, + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\PayloadService::queryPayloads", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-payloads-retrieve-a-payload", + "collection": "Fleetbase API", + "group": "Payloads", + "name": "Retrieve a Payload", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/payloads/:id", + "source": "postman/collections/Fleetbase API/Payloads/Retrieve a Payload.request.yaml", + "description": "Retrieve a Payload.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{payload_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\PayloadService::retrievePayload", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-payloads-update-a-payload", + "collection": "Fleetbase API", + "group": "Payloads", + "name": "Update a Payload", + "method": "PUT", + "url": "{{base_url}}/{{namespace}}/payloads/:id", + "source": "postman/collections/Fleetbase API/Payloads/Update a Payload.request.yaml", + "description": "Updates a payload's route endpoints, waypoints, entities, cash-on-delivery settings, or metadata. The response returns the updated payload with route and entity data.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{payload_id}}" + }, + "query": [], + "body_type": "json", + "body": { + "pickup": { + "street1": "10 Bayfront Avenue", + "city": "Singapore", + "postal_code": "018956", + "country": "SG" + }, + "dropoff": { + "street1": "80 Mandai Lake Rd", + "city": "Singapore", + "postal_code": "729826", + "country": "SG" + }, + "entities": [ + { + "name": "UltraHD 4K Smart TV", + "description": "65-inch high-definition smart TV with vibrant colors and a sleek design.", + "currency": "USD", + "price": 1200 + }, + { + "name": "Bluetooth Wireless Headphones", + "description": "Noise-cancelling, over-ear headphones with long-lasting battery life.", + "currency": "USD", + "price": 250 + }, + { + "name": "Smart Fitness Watch", + "description": "Water-resistant fitness watch with heart rate monitor and GPS tracking.", + "currency": "USD", + "price": 199.99 + } + ] + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Payloads/.resources/Update a Payload.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\PayloadService::updatePayload", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-places-create-a-place", + "collection": "Fleetbase API", + "group": "Places", + "name": "Create a Place", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/places", + "source": "postman/collections/Fleetbase API/Places/Create a Place.request.yaml", + "description": "Creates a place for the current company. Provide structured address fields, a free-form `address` or `street1` value to geocode, or coordinates for Fleetbase to reverse geocode.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "name": "Central Park", + "street1": "830 5th Ave", + "city": "New York", + "province": "New York", + "postal_code": "10065", + "neighborhood": "Manhattan", + "district": "Midtown", + "building": "Park Area", + "country": "US", + "phone": "+12123106600", + "type": "Park" + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Places/.resources/Create a Place.resources/examples/Create a Place using Coordinates Array.example.yaml", + "status": 200 + }, + { + "source": "postman/collections/Fleetbase API/Places/.resources/Create a Place.resources/examples/Create a Place using Coordinates.example.yaml", + "status": 200 + }, + { + "source": "postman/collections/Fleetbase API/Places/.resources/Create a Place.resources/examples/Create a Place using GeoJSON Point.example.yaml", + "status": 200 + }, + { + "source": "postman/collections/Fleetbase API/Places/.resources/Create a Place.resources/examples/Create a Place using Street Address Only.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\PlaceService::createPlace", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-places-delete-a-place", + "collection": "Fleetbase API", + "group": "Places", + "name": "Delete a Place", + "method": "DELETE", + "url": "{{base_url}}/{{namespace}}/places/:id", + "source": "postman/collections/Fleetbase API/Places/Delete a Place.request.yaml", + "description": "Permanently deletes a place. It cannot be undone. ", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{place_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Places/.resources/Delete a Place.resources/examples/Delete a Place.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\PlaceService::deletePlace", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-places-list-all-places", + "collection": "Fleetbase API", + "group": "Places", + "name": "List all Places", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/places", + "source": "postman/collections/Fleetbase API/Places/List all Places.request.yaml", + "description": "Returns a paginated list of places for the current organization. Places are sorted by creation date unless another sort order is provided.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": { + "limit": "25", + "offset": "0", + "sort": "created_at" + }, + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\PlaceService::listAllPlaces", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-places-query-places", + "collection": "Fleetbase API", + "group": "Places", + "name": "Query Places", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/places", + "source": "postman/collections/Fleetbase API/Places/Query Places.request.yaml", + "description": "Searches and filters places for the current organization. Use query and pagination parameters to find matching saved locations.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": { + "query": "{{place_name}}", + "limit": "25", + "offset": "", + "sort": "created_at" + }, + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\PlaceService::queryPlaces", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-places-retrieve-a-place", + "collection": "Fleetbase API", + "group": "Places", + "name": "Retrieve a Place", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/places/:id", + "source": "postman/collections/Fleetbase API/Places/Retrieve a Place.request.yaml", + "description": "This endpoint allows you to retrieve a place object to view it's details.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{place_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\PlaceService::retrievePlace", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-places-search-places", + "collection": "Fleetbase API", + "group": "Places", + "name": "Search Places", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/places/search", + "source": "postman/collections/Fleetbase API/Places/Search Places.request.yaml", + "description": "Searches places by free-form query and optional lat/lng locale context.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": { + "query": "{{place_query}}", + "ll": "{{place_ll}}", + "locale": "{{locale}}" + }, + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\PlaceService::searchPlaces", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-places-update-a-place", + "collection": "Fleetbase API", + "group": "Places", + "name": "Update a Place", + "method": "PUT", + "url": "{{base_url}}/{{namespace}}/places/:id", + "source": "postman/collections/Fleetbase API/Places/Update a Place.request.yaml", + "description": "Updates a place by setting the fields included in the request. Send address fields, coordinates, owner assignment, type, phone, or metadata to change only those values.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{place_id}}" + }, + "query": [], + "body_type": "json", + "body": { + "name": "Central Park Edit", + "street1": "830 5th Ave a ", + "city": "New York", + "province": "New York", + "postal_code": "10065", + "neighborhood": "Manhattan", + "district": "Midtown", + "building": "Park Area", + "country": "US", + "phone": "+12123106600", + "type": "Park" + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Places/.resources/Update a Place.resources/examples/Update a Place.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\PlaceService::updatePlace", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-purchase-rates-create-a-purchase-rate", + "collection": "Fleetbase API", + "group": "Purchase Rates", + "name": "Create a Purchase Rate", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/purchase-rates", + "source": "postman/collections/Fleetbase API/Purchase Rates/Create a Purchase Rate.request.yaml", + "description": "Only ServiceQuote objects generated using a Payload object may be used to create PurchaseRate objects.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "service_quote": "service_quote_id-fixture" + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Purchase Rates/.resources/Create a Purchase Rate.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\PurchaseRateService::createPurchaseRate", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-purchase-rates-query-purchase-rates", + "collection": "Fleetbase API", + "group": "Purchase Rates", + "name": "Query Purchase Rates", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/purchase-rates", + "source": "postman/collections/Fleetbase API/Purchase Rates/Query Purchase Rates.request.yaml", + "description": "This endpoint allows you to query purchase-rates you have created, it also provides paginated results on all the purchase-rates in your Fleetbase.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": { + "limit": "25", + "offset": "0", + "sort": "created_at" + }, + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\PurchaseRateService::queryPurchaseRates", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-purchase-rates-retrieve-a-purchase-rate", + "collection": "Fleetbase API", + "group": "Purchase Rates", + "name": "Retrieve a Purchase Rate", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/purchase-rates/:id", + "source": "postman/collections/Fleetbase API/Purchase Rates/Retrieve a Purchase Rate.request.yaml", + "description": "This endpoint allows you to retrieve a purchase-rate object to view it's details.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{purchase_rate_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Purchase Rates/.resources/Retrieve a Purchase Rate.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\PurchaseRateService::retrievePurchaseRate", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-sensors-create-a-sensor", + "collection": "Fleetbase API", + "group": "Sensors", + "name": "Create a Sensor", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/sensors", + "source": "postman/collections/Fleetbase API/Sensors/Create a Sensor.request.yaml", + "description": "Create a sensor.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "name": "Cargo Temperature", + "type": "temperature", + "device": "device_id-fixture", + "unit": "celsius", + "status": "active", + "min_threshold": 0, + "max_threshold": 8 + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Sensors/.resources/Create a Sensor.resources/examples/Created.example.yaml", + "status": 201 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\SensorService::createSensor", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-sensors-delete-a-sensor", + "collection": "Fleetbase API", + "group": "Sensors", + "name": "Delete a Sensor", + "method": "DELETE", + "url": "{{base_url}}/{{namespace}}/sensors/{{sensor_id}}", + "source": "postman/collections/Fleetbase API/Sensors/Delete a Sensor.request.yaml", + "description": "Delete a sensor.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Sensors/.resources/Delete a Sensor.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\SensorService::deleteSensor", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-sensors-query-sensors", + "collection": "Fleetbase API", + "group": "Sensors", + "name": "Query Sensors", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/sensors", + "source": "postman/collections/Fleetbase API/Sensors/Query Sensors.request.yaml", + "description": "Query sensors.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Sensors/.resources/Query Sensors.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\SensorService::querySensors", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-sensors-retrieve-a-sensor", + "collection": "Fleetbase API", + "group": "Sensors", + "name": "Retrieve a Sensor", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/sensors/{{sensor_id}}", + "source": "postman/collections/Fleetbase API/Sensors/Retrieve a Sensor.request.yaml", + "description": "Retrieve a sensor.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Sensors/.resources/Retrieve a Sensor.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\SensorService::retrieveSensor", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-sensors-update-a-sensor", + "collection": "Fleetbase API", + "group": "Sensors", + "name": "Update a Sensor", + "method": "PUT", + "url": "{{base_url}}/{{namespace}}/sensors/{{sensor_id}}", + "source": "postman/collections/Fleetbase API/Sensors/Update a Sensor.request.yaml", + "description": "Update a sensor.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "last_value": "4.2", + "last_reading_at": "2026-05-07T08:30:00Z" + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Sensors/.resources/Update a Sensor.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\SensorService::updateSensor", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-service-areas-create-a-service-area", + "collection": "Fleetbase API", + "group": "Service Areas", + "name": "Create a Service Area", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/service-areas", + "source": "postman/collections/Fleetbase API/Service Areas/Create a Service Area.request.yaml", + "description": "A service area is created by simply providing a city, province or country in which Fleetbase will reverse geocode into a service area.\n\nIf the service area cannot be reverse geocoded, Fleetbase will return an error.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "name": "Singapore", + "type": "city", + "latitude": "1.3521", + "longitude": "103.8198", + "radius": "30000", + "country": "SG", + "status": "active" + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Service Areas/.resources/Create a Service Area.resources/examples/Create a Service Area using GeoJSON Point.example.yaml", + "status": 200 + }, + { + "source": "postman/collections/Fleetbase API/Service Areas/.resources/Create a Service Area.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\ServiceAreaService::createServiceArea", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-service-areas-delete-a-service-area", + "collection": "Fleetbase API", + "group": "Service Areas", + "name": "Delete a Service Area", + "method": "DELETE", + "url": "{{base_url}}/{{namespace}}/service-areas/:id", + "source": "postman/collections/Fleetbase API/Service Areas/Delete a Service Area.request.yaml", + "description": "Use this endpoint to delete a service area, deleting a service area will also delete all of the zones within the service area.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{service_area_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Service Areas/.resources/Delete a Service Area.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\ServiceAreaService::deleteServiceArea", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-service-areas-query-service-areas", + "collection": "Fleetbase API", + "group": "Service Areas", + "name": "Query Service Areas", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/service-areas", + "source": "postman/collections/Fleetbase API/Service Areas/Query Service Areas.request.yaml", + "description": "Returns service areas matching the supplied filters. Use this to find configured operating regions by name or other query parameters.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": { + "name": "{{service_area_name}}" + }, + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\ServiceAreaService::queryServiceAreas", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-service-areas-retrieve-a-service-area", + "collection": "Fleetbase API", + "group": "Service Areas", + "name": "Retrieve a Service Area", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/service-areas/:id", + "source": "postman/collections/Fleetbase API/Service Areas/Retrieve a Service Area.request.yaml", + "description": "This endpoint allows you to retrieve a service area object to view it's details.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{service_area_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Service Areas/.resources/Retrieve a Service Area.resources/examples/OK.example.yaml", + "status": 200 + }, + { + "source": "postman/collections/Fleetbase API/Service Areas/.resources/Retrieve a Service Area.resources/examples/Retrieve a Service Area.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\ServiceAreaService::retrieveServiceArea", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-service-areas-update-a-service-area", + "collection": "Fleetbase API", + "group": "Service Areas", + "name": "Update a Service Area", + "method": "PUT", + "url": "{{base_url}}/{{namespace}}/service-areas/:id", + "source": "postman/collections/Fleetbase API/Service Areas/Update a Service Area.request.yaml", + "description": "You are only able to update the service area status", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{service_area_id}}" + }, + "query": [], + "body_type": "json", + "body": { + "status": "active" + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Service Areas/.resources/Update a Service Area.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\ServiceAreaService::updateServiceArea", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-service-quotes-query-service-quotes", + "collection": "Fleetbase API", + "group": "Service Quotes", + "name": "Query Service Quotes", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/service-quotes", + "source": "postman/collections/Fleetbase API/Service Quotes/Query Service Quotes.request.yaml", + "description": "This endpoint is used to get the ServiceRate quotes based on pickup point location and drop off point location, or payload.\n\nFor some quotes such as parcel based, the payload must be included for calculation of the payload cost.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": { + "payload": "{{payload_id}}" + }, + "body_type": "json", + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Service Quotes/.resources/Query Service Quotes.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\ServiceQuoteService::queryServiceQuotes", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-service-quotes-retrieve-a-service-quote", + "collection": "Fleetbase API", + "group": "Service Quotes", + "name": "Retrieve a Service Quote", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/service-quotes/:id", + "source": "postman/collections/Fleetbase API/Service Quotes/Retrieve a Service Quote.request.yaml", + "description": "Retrieves a service quote by id.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{service_quote_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\ServiceQuoteService::retrieveServiceQuote", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-service-rates-create-a-service-rate", + "collection": "Fleetbase API", + "group": "Service Rates", + "name": "Create a Service Rate", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/service-rates", + "source": "postman/collections/Fleetbase API/Service Rates/Create a Service Rate.request.yaml", + "description": "Create a Service Rate.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "service_name": "Food Delivery", + "service_type": "food_delivery", + "rate_calculation_method": "per_meter", + "currency": "USD", + "base_fee": 10, + "per_meter_unit": "km", + "per_meter_flat_rate_fee": 25, + "has_cod_fee": true, + "cod_calculation_method": "percentage", + "cod_flat_fee": 1, + "cod_percent": 0, + "has_peak_hours_fee": true, + "peak_hours_calculation_method": "percentage", + "peak_hours_flat_fee": 3, + "peak_hours_percent": 0, + "peak_hours_start": "17:00", + "peak_hours_end": "18:45", + "duration_terms": "Standard", + "estimated_days": 3 + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Service Rates/.resources/Create a Service Rate.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\ServiceRateService::createServiceRate", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-service-rates-delete-a-service-rate", + "collection": "Fleetbase API", + "group": "Service Rates", + "name": "Delete a Service Rate", + "method": "DELETE", + "url": "{{base_url}}/{{namespace}}/service-rates/:id", + "source": "postman/collections/Fleetbase API/Service Rates/Delete a Service Rate.request.yaml", + "description": "Delete a Service Rate.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{service_rate_id}}" + }, + "query": [], + "body_type": "json", + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Service Rates/.resources/Delete a Service Rate.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\ServiceRateService::deleteServiceRate", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-service-rates-query-service-rates", + "collection": "Fleetbase API", + "group": "Service Rates", + "name": "Query Service Rates", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/service-rates", + "source": "postman/collections/Fleetbase API/Service Rates/Query Service Rates.request.yaml", + "description": "List all service rates.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": { + "limit": "25", + "offset": "0", + "currency": "USD" + }, + "body_type": "json", + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\ServiceRateService::queryServiceRates", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-service-rates-retrieve-a-service-rate", + "collection": "Fleetbase API", + "group": "Service Rates", + "name": "Retrieve a Service Rate", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/service-rates/:id", + "source": "postman/collections/Fleetbase API/Service Rates/Retrieve a Service Rate.request.yaml", + "description": "Retrieves a service rate by ID.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{service_rate_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\ServiceRateService::retrieveServiceRate", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-service-rates-update-a-service-rate", + "collection": "Fleetbase API", + "group": "Service Rates", + "name": "Update a Service Rate", + "method": "PUT", + "url": "{{base_url}}/{{namespace}}/service-rates/:id", + "source": "postman/collections/Fleetbase API/Service Rates/Update a Service Rate.request.yaml", + "description": "Update a Service Rate.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{service_rate_id}}" + }, + "query": [], + "body_type": "json", + "body": { + "currency": "SGD", + "base_fee": 12.66, + "estimated_days": 6 + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Service Rates/.resources/Update a Service Rate.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\ServiceRateService::updateServiceRate", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-tracking-numbers-create-a-tracking-number", + "collection": "Fleetbase API", + "group": "Tracking Numbers", + "name": "Create a Tracking Number", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/tracking-numbers", + "source": "postman/collections/Fleetbase API/Tracking Numbers/Create a Tracking Number.request.yaml", + "description": "This endpoint allows you to retrieve a tracking-number object to view it's details.\n", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "region": "SG", + "owner": "order_id-fixture" + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Tracking Numbers/.resources/Create a Tracking Number.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\TrackingNumberService::createTrackingNumber", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-tracking-numbers-decode-tracking-number-qr", + "collection": "Fleetbase API", + "group": "Tracking Numbers", + "name": "Decode Tracking Number QR", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/tracking-numbers/from-qr", + "source": "postman/collections/Fleetbase API/Tracking Numbers/Decode Tracking Number QR.request.yaml", + "description": "Decodes a tracking/entity/order QR code UUID and returns the matching resource.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "code": "qr_code-fixture" + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\TrackingNumberService::decodeTrackingNumberQr", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-tracking-numbers-delete-a-tracking-number", + "collection": "Fleetbase API", + "group": "Tracking Numbers", + "name": "Delete a Tracking Number", + "method": "DELETE", + "url": "{{base_url}}/{{namespace}}/tracking-numbers/:id", + "source": "postman/collections/Fleetbase API/Tracking Numbers/Delete a Tracking Number.request.yaml", + "description": "Deletes a tracking number by ID.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{tracking_number_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Tracking Numbers/.resources/Delete a Tracking Number.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\TrackingNumberService::deleteTrackingNumber", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-tracking-numbers-query-tracking-numbers", + "collection": "Fleetbase API", + "group": "Tracking Numbers", + "name": "Query Tracking Numbers", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/tracking-numbers", + "source": "postman/collections/Fleetbase API/Tracking Numbers/Query Tracking Numbers.request.yaml", + "description": "This endpoint allows you to query tracking-numbers you have created, it also provides paginated results on all the tracking-numbers in your Fleetbase.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": { + "query": "SG", + "limit": "25", + "offset": "0", + "sort": "created_at" + }, + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Tracking Numbers/.resources/Query Tracking Numbers.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\TrackingNumberService::queryTrackingNumbers", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-tracking-numbers-retrieve-a-tracking-number", + "collection": "Fleetbase API", + "group": "Tracking Numbers", + "name": "Retrieve a Tracking Number", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/tracking-numbers/:id", + "source": "postman/collections/Fleetbase API/Tracking Numbers/Retrieve a Tracking Number.request.yaml", + "description": "This endpoint allows you to retrieve a tracking-number object to view it's details.\n", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{tracking_number_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Tracking Numbers/.resources/Retrieve a Tracking Number.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\TrackingNumberService::retrieveTrackingNumber", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-tracking-statuses-create-a-tracking-status", + "collection": "Fleetbase API", + "group": "Tracking Statuses", + "name": "Create a Tracking Status", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/tracking-statuses", + "source": "postman/collections/Fleetbase API/Tracking Statuses/Create a Tracking Status.request.yaml", + "description": "Create a new Tracking Status.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "status": "Delivery is en-route", + "code": "delivery-en-route", + "details": "Our driver has picked up your order and is on the way to your address!", + "tracking_number": "tracking_number_id-fixture", + "location": [ + 1.3521, + 103.8198 + ], + "city": "Singapore" + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Tracking Statuses/.resources/Create a Tracking Status.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\TrackingStatusService::createTrackingStatus", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-tracking-statuses-delete-a-tracking-status", + "collection": "Fleetbase API", + "group": "Tracking Statuses", + "name": "Delete a Tracking Status", + "method": "DELETE", + "url": "{{base_url}}/{{namespace}}/tracking-statuses/:id", + "source": "postman/collections/Fleetbase API/Tracking Statuses/Delete a Tracking Status.request.yaml", + "description": "Delete a Tracking Status.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{tracking_status_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Tracking Statuses/.resources/Delete a Tracking Status.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\TrackingStatusService::deleteTrackingStatus", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-tracking-statuses-query-tracking-statuses", + "collection": "Fleetbase API", + "group": "Tracking Statuses", + "name": "Query Tracking Statuses", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/tracking-statuses", + "source": "postman/collections/Fleetbase API/Tracking Statuses/Query Tracking Statuses.request.yaml", + "description": "List all Tracking Statuses", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": { + "limit": "25", + "tracking_number": "{{tracking_number_id}}" + }, + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Tracking Statuses/.resources/Query Tracking Statuses.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\TrackingStatusService::queryTrackingStatuses", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-tracking-statuses-retrieve-a-tracking-status", + "collection": "Fleetbase API", + "group": "Tracking Statuses", + "name": "Retrieve a Tracking Status", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/tracking-statuses/:id", + "source": "postman/collections/Fleetbase API/Tracking Statuses/Retrieve a Tracking Status.request.yaml", + "description": "Retrieve a Tracking Status.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{tracking_status_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Tracking Statuses/.resources/Retrieve a Tracking Status.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\TrackingStatusService::retrieveTrackingStatus", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-tracking-statuses-update-a-tracking-status", + "collection": "Fleetbase API", + "group": "Tracking Statuses", + "name": "Update a Tracking Status", + "method": "PUT", + "url": "{{base_url}}/{{namespace}}/tracking-statuses/:id", + "source": "postman/collections/Fleetbase API/Tracking Statuses/Update a Tracking Status.request.yaml", + "description": "Updates an existing tracking status. The response returns the tracking status with the new values applied.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{tracking_status_id}}" + }, + "query": [], + "body_type": "json", + "body": { + "country": "SG" + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Tracking Statuses/.resources/Update a Tracking Status.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\TrackingStatusService::updateTrackingStatus", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-vehicles-create-a-vehicle", + "collection": "Fleetbase API", + "group": "Vehicles", + "name": "Create a Vehicle", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/vehicles", + "source": "postman/collections/Fleetbase API/Vehicles/Create a Vehicle.request.yaml", + "description": "Creates a vehicle for the current company. Send VIN, make/model fields, assignment fields, status, location, capacity, or orchestrator constraints as needed.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "vin": "1GCGSBEA0G1111111", + "year": 2023, + "make": "Toyota", + "model": "Camry", + "trim": "SE", + "plate_number": "ABC123", + "status": "maintenance", + "online": false + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Vehicles/.resources/Create a Vehicle.resources/examples/Created.example.yaml", + "status": 201 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\VehicleService::createVehicle", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-vehicles-delete-a-vehicle", + "collection": "Fleetbase API", + "group": "Vehicles", + "name": "Delete a Vehicle", + "method": "DELETE", + "url": "{{base_url}}/{{namespace}}/vehicles/:id", + "source": "postman/collections/Fleetbase API/Vehicles/Delete a Vehicle.request.yaml", + "description": "Permanently deletes a `Vehicle`. It cannot be undone.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{vehicle_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Vehicles/.resources/Delete a Vehicle.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\VehicleService::deleteVehicle", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-vehicles-query-vehicles", + "collection": "Fleetbase API", + "group": "Vehicles", + "name": "Query Vehicles", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/vehicles", + "source": "postman/collections/Fleetbase API/Vehicles/Query Vehicles.request.yaml", + "description": "This endpoint allows you to query vehicles you have created, it also provides paginated results on all the vehicles in your Fleetbase.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": { + "query": "{{vehicle_name}}", + "limit": "25", + "offset": "0", + "sort": "created_at" + }, + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Vehicles/.resources/Query Vehicles.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\VehicleService::queryVehicles", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-vehicles-retrieve-a-vehicle", + "collection": "Fleetbase API", + "group": "Vehicles", + "name": "Retrieve a Vehicle", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/vehicles/:id", + "source": "postman/collections/Fleetbase API/Vehicles/Retrieve a Vehicle.request.yaml", + "description": "Retrieve details for a specific `Vehicle`.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{vehicle_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Vehicles/.resources/Retrieve a Vehicle.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\VehicleService::retrieveVehicle", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-vehicles-track-vehicle", + "collection": "Fleetbase API", + "group": "Vehicles", + "name": "Track Vehicle", + "method": "PATCH", + "url": "{{base_url}}/{{namespace}}/vehicles/:id/track", + "source": "postman/collections/Fleetbase API/Vehicles/Track Vehicle.request.yaml", + "description": null, + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{vehicle_id}}" + }, + "query": [], + "body_type": "text", + "body": "{\n \"latitude\": -19.288195,\n \"longitude\": 146.795965,\n \"speed\": 100\n}" + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\VehicleService::trackVehicle", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-vehicles-update-a-vehicle", + "collection": "Fleetbase API", + "group": "Vehicles", + "name": "Update a Vehicle", + "method": "PUT", + "url": "{{base_url}}/{{namespace}}/vehicles/:id", + "source": "postman/collections/Fleetbase API/Vehicles/Update a Vehicle.request.yaml", + "description": "Updates a vehicle's identity, operational status, vendor assignment, location, capacity, or orchestrator constraints. Updating the VIN refreshes decoded VIN data.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{vehicle_id}}" + }, + "query": [], + "body_type": "json", + "body": { + "plate_number": "ABC123", + "status": "operational", + "latitude": 40.7484, + "longitude": -73.9857, + "speed": 90 + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Vehicles/.resources/Update a Vehicle.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\VehicleService::updateVehicle", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-vendors-create-a-vendor", + "collection": "Fleetbase API", + "group": "Vendors", + "name": "Create a Vendor", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/vendors", + "source": "postman/collections/Fleetbase API/Vendors/Create a Vendor.request.yaml", + "description": "Creates a vendor for the current company. Vendors can be assigned to orders, vehicles, drivers, places, and facilitator workflows.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "name": "ABC Corporation", + "type": "Supplier", + "email": "abc@example.com", + "phone": "1234567890" + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Vendors/.resources/Create a Vendor.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\VendorService::createVendor", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-vendors-delete-a-vendor", + "collection": "Fleetbase API", + "group": "Vendors", + "name": "Delete a Vendor", + "method": "DELETE", + "url": "{{base_url}}/{{namespace}}/vendors/:id", + "source": "postman/collections/Fleetbase API/Vendors/Delete a Vendor.request.yaml", + "description": "Use this endpoint to delete a vendor.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{vendor_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Vendors/.resources/Delete a Vendor.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\VendorService::deleteVendor", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-vendors-query-vendors", + "collection": "Fleetbase API", + "group": "Vendors", + "name": "Query Vendors", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/vendors", + "source": "postman/collections/Fleetbase API/Vendors/Query Vendors.request.yaml", + "description": "Returns vendors for the current company. Use search, pagination, and sort parameters to narrow the result set.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": { + "id": "{{vendor_id}}" + }, + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Vendors/.resources/Query Vendors.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\VendorService::queryVendors", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-vendors-retrieve-a-vendor", + "collection": "Fleetbase API", + "group": "Vendors", + "name": "Retrieve a Vendor", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/vendors/:id", + "source": "postman/collections/Fleetbase API/Vendors/Retrieve a Vendor.request.yaml", + "description": "This endpoint allows you to retrieve a vendor object to view it's details.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{vendor_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Vendors/.resources/Retrieve a Vendor.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\VendorService::retrieveVendor", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-vendors-update-a-vendor", + "collection": "Fleetbase API", + "group": "Vendors", + "name": "Update a Vendor", + "method": "PUT", + "url": "{{base_url}}/{{namespace}}/vendors/:id", + "source": "postman/collections/Fleetbase API/Vendors/Update a Vendor.request.yaml", + "description": "Updates a vendor's profile, primary address, type, contact fields, or metadata.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{vendor_id}}" + }, + "query": [], + "body_type": "json", + "body": { + "name": "ABC Corporation", + "type": "Supplier", + "email": "abc@example.com", + "phone": "1234567890" + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Vendors/.resources/Update a Vendor.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\VendorService::updateVendor", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-work-orders-create-a-work-order", + "collection": "Fleetbase API", + "group": "Work Orders", + "name": "Create a Work Order", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/work-orders", + "source": "postman/collections/Fleetbase API/Work Orders/Create a Work Order.request.yaml", + "description": "Create a work order.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "subject": "Replace rear tire", + "category": "corrective_maintenance", + "status": "open", + "priority": "high", + "target_type": "fleet-ops:vehicle", + "target": "vehicle_id-fixture", + "assignee_type": "fleet-ops:vendor", + "assignee": "vendor_id-fixture" + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Work Orders/.resources/Create a Work Order.resources/examples/Created.example.yaml", + "status": 201 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\WorkOrderService::createWorkOrder", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-work-orders-delete-a-work-order", + "collection": "Fleetbase API", + "group": "Work Orders", + "name": "Delete a Work Order", + "method": "DELETE", + "url": "{{base_url}}/{{namespace}}/work-orders/{{work_order_id}}", + "source": "postman/collections/Fleetbase API/Work Orders/Delete a Work Order.request.yaml", + "description": "Delete a work order.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Work Orders/.resources/Delete a Work Order.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\WorkOrderService::deleteWorkOrder", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-work-orders-query-work-orders", + "collection": "Fleetbase API", + "group": "Work Orders", + "name": "Query Work Orders", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/work-orders", + "source": "postman/collections/Fleetbase API/Work Orders/Query Work Orders.request.yaml", + "description": "Query work orders.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Work Orders/.resources/Query Work Orders.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\WorkOrderService::queryWorkOrders", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-work-orders-retrieve-a-work-order", + "collection": "Fleetbase API", + "group": "Work Orders", + "name": "Retrieve a Work Order", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/work-orders/{{work_order_id}}", + "source": "postman/collections/Fleetbase API/Work Orders/Retrieve a Work Order.request.yaml", + "description": "Retrieve a work order.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Work Orders/.resources/Retrieve a Work Order.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\WorkOrderService::retrieveWorkOrder", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-work-orders-send-work-order", + "collection": "Fleetbase API", + "group": "Work Orders", + "name": "Send Work Order", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/work-orders/{{work_order_id}}/send", + "source": "postman/collections/Fleetbase API/Work Orders/Send Work Order.request.yaml", + "description": "Send this work order to its assigned vendor or contact.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Work Orders/.resources/Send Work Order.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\WorkOrderService::sendWorkOrder", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-work-orders-update-a-work-order", + "collection": "Fleetbase API", + "group": "Work Orders", + "name": "Update a Work Order", + "method": "PUT", + "url": "{{base_url}}/{{namespace}}/work-orders/{{work_order_id}}", + "source": "postman/collections/Fleetbase API/Work Orders/Update a Work Order.request.yaml", + "description": "Update a work order.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "status": "in_progress" + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Work Orders/.resources/Update a Work Order.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\WorkOrderService::updateWorkOrder", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-zones-create-a-zone", + "collection": "Fleetbase API", + "group": "Zones", + "name": "Create a Zone", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/zones", + "source": "postman/collections/Fleetbase API/Zones/Create a Zone.request.yaml", + "description": "Creates a zone inside a service area. Provide either a GeoJSON boundary or a center point with radius, and Fleetbase will store the zone for geofencing and service coverage checks.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "name": "Center of Singapore", + "service_area": "service_area_id-fixture", + "color": "#66e0ff", + "stroke_color": "#00bfff", + "border": { + "type": "Polygon", + "bbox": [ + 103.867493, + 1.35085, + 103.912125, + 1.383113 + ], + "coordinates": [ + [ + [ + 103.907661, + 1.362863 + ], + [ + 103.892555, + 1.357714 + ], + [ + 103.891525, + 1.353252 + ], + [ + 103.883629, + 1.35085 + ], + [ + 103.874702, + 1.351193 + ], + [ + 103.870583, + 1.358744 + ], + [ + 103.867493, + 1.368354 + ], + [ + 103.870926, + 1.377621 + ], + [ + 103.875732, + 1.38174 + ], + [ + 103.886032, + 1.383113 + ], + [ + 103.900452, + 1.383113 + ], + [ + 103.909721, + 1.381397 + ], + [ + 103.912125, + 1.374189 + ], + [ + 103.907661, + 1.362863 + ] + ] + ] + } + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Zones/.resources/Create a Zone.resources/examples/Create a Zone.example.yaml", + "status": 201 + }, + { + "source": "postman/collections/Fleetbase API/Zones/.resources/Create a Zone.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\ZoneService::createZone", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-zones-delete-a-zone", + "collection": "Fleetbase API", + "group": "Zones", + "name": "Delete a Zone", + "method": "DELETE", + "url": "{{base_url}}/{{namespace}}/zones/:id", + "source": "postman/collections/Fleetbase API/Zones/Delete a Zone.request.yaml", + "description": "Use this endpoint to delete a zone.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{zone_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Zones/.resources/Delete a Zone.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\ZoneService::deleteZone", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-zones-query-zones", + "collection": "Fleetbase API", + "group": "Zones", + "name": "Query Zones", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/zones", + "source": "postman/collections/Fleetbase API/Zones/Query Zones.request.yaml", + "description": "Returns zones matching the supplied filters. Use this to find configured geofences by name or other query parameters.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": { + "name": "{{zone_name}}" + }, + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Zones/.resources/Query Zones.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\ZoneService::queryZones", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-zones-retrieve-a-zone", + "collection": "Fleetbase API", + "group": "Zones", + "name": "Retrieve a zone", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/zones/:id", + "source": "postman/collections/Fleetbase API/Zones/Retrieve a zone.request.yaml", + "description": "Retrieves a single zone by ID. The response includes the zone geometry, display styling, and service area relationship.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{zone_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Zones/.resources/Retrieve a zone.resources/examples/Delete a Zone.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\ZoneService::retrieveZone", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-api-zones-update-a-zone", + "collection": "Fleetbase API", + "group": "Zones", + "name": "Update a Zone", + "method": "PUT", + "url": "{{base_url}}/{{namespace}}/zones/:id", + "source": "postman/collections/Fleetbase API/Zones/Update a Zone.request.yaml", + "description": "You can update all properties of the Zone.\n\n", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{zone_id}}" + }, + "query": [], + "body_type": "json", + "body": { + "color": "#ff00000" + } + }, + "response_fixtures": [ + { + "source": "postman/collections/Fleetbase API/Zones/.resources/Update a Zone.resources/examples/OK.example.yaml", + "status": 200 + } + ], + "implementation": "Fleetbase\\Sdk\\Services\\ZoneService::updateZone", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-core-api-chat-channels-add-participant", + "collection": "Fleetbase Core API", + "group": "Chat Channels", + "name": "Add Participant", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/chat-channels/:id/add-participant", + "source": "postman/collections/Fleetbase Core API/Chat Channels/Add Participant.request.yaml", + "description": "Adds a user in the current organization to an existing chat channel. The response returns the created chat participant resource.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{chat_channel_id}}" + }, + "query": [], + "body_type": "json", + "body": { + "user": "user_id-fixture" + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\ChatChannelService::addParticipant", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-core-api-chat-channels-create-chat-channel", + "collection": "Fleetbase Core API", + "group": "Chat Channels", + "name": "Create Chat Channel", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/chat-channels", + "source": "postman/collections/Fleetbase Core API/Chat Channels/Create Chat Channel.request.yaml", + "description": "Creates a chat channel for the current organization. Include participant user IDs to add those users to the channel immediately after it is created.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "name": "Dispatch", + "participants": [ + "user_id-fixture" + ] + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\ChatChannelService::createChatChannel", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-core-api-chat-channels-create-read-receipt", + "collection": "Fleetbase Core API", + "group": "Chat Channels", + "name": "Create Read Receipt", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/chat-channels/read-message/:chatMessageId", + "source": "postman/collections/Fleetbase Core API/Chat Channels/Create Read Receipt.request.yaml", + "description": "Marks a chat message as read for a participant. If a receipt already exists for the message and participant, Fleetbase returns the existing receipt.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "chatMessageId": "{{chat_message_id}}" + }, + "query": [], + "body_type": "json", + "body": { + "participant": "chat_participant_id-fixture" + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\ChatChannelService::createReadReceipt", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-core-api-chat-channels-delete-chat-channel", + "collection": "Fleetbase Core API", + "group": "Chat Channels", + "name": "Delete Chat Channel", + "method": "DELETE", + "url": "{{base_url}}/{{namespace}}/chat-channels/:id", + "source": "postman/collections/Fleetbase Core API/Chat Channels/Delete Chat Channel.request.yaml", + "description": "Deletes a chat channel by ID. The response returns a deleted-resource envelope for the removed channel.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{chat_channel_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\ChatChannelService::deleteChatChannel", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-core-api-chat-channels-delete-message", + "collection": "Fleetbase Core API", + "group": "Chat Channels", + "name": "Delete Message", + "method": "DELETE", + "url": "{{base_url}}/{{namespace}}/chat-channels/delete-message/:chatMessageId", + "source": "postman/collections/Fleetbase Core API/Chat Channels/Delete Message.request.yaml", + "description": "Deletes a chat message by ID. Use this when a previously sent message should be removed from the channel feed.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "chatMessageId": "{{chat_message_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\ChatChannelService::deleteMessage", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-core-api-chat-channels-list-available-participants", + "collection": "Fleetbase Core API", + "group": "Chat Channels", + "name": "List Available Participants", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/chat-channels/available-participants", + "source": "postman/collections/Fleetbase Core API/Chat Channels/List Available Participants.request.yaml", + "description": "Lists users in the current organization that can be added to a chat channel. When a channel ID is provided, users already participating in that channel are excluded.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": { + "channel": "{{chat_channel_id}}" + }, + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\ChatChannelService::listAvailableParticipants", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-core-api-chat-channels-query-chat-channels", + "collection": "Fleetbase Core API", + "group": "Chat Channels", + "name": "Query Chat Channels", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/chat-channels", + "source": "postman/collections/Fleetbase Core API/Chat Channels/Query Chat Channels.request.yaml", + "description": "Returns chat channels visible to the current organization. Use query parameters to filter, sort, and paginate the result set.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": { + "limit": "25", + "offset": "0", + "sort": "created_at" + }, + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\ChatChannelService::queryChatChannels", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-core-api-chat-channels-remove-participant", + "collection": "Fleetbase Core API", + "group": "Chat Channels", + "name": "Remove Participant", + "method": "DELETE", + "url": "{{base_url}}/{{namespace}}/chat-channels/remove-participant/:participantId", + "source": "postman/collections/Fleetbase Core API/Chat Channels/Remove Participant.request.yaml", + "description": "Removes a participant from a chat channel by participant ID. The channel remains active for the remaining participants.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "participantId": "{{chat_participant_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\ChatChannelService::removeParticipant", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-core-api-chat-channels-retrieve-chat-channel", + "collection": "Fleetbase Core API", + "group": "Chat Channels", + "name": "Retrieve Chat Channel", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/chat-channels/:id", + "source": "postman/collections/Fleetbase Core API/Chat Channels/Retrieve Chat Channel.request.yaml", + "description": "Retrieves a chat channel by ID, including its participants, feed, and latest message metadata.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{chat_channel_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\ChatChannelService::retrieveChatChannel", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-core-api-chat-channels-send-message", + "collection": "Fleetbase Core API", + "group": "Chat Channels", + "name": "Send Message", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/chat-channels/:id/send-message", + "source": "postman/collections/Fleetbase Core API/Chat Channels/Send Message.request.yaml", + "description": "Sends a message to a chat channel as an existing chat participant. File IDs can be included to attach previously uploaded files to the message.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{chat_channel_id}}" + }, + "query": [], + "body_type": "json", + "body": { + "sender": "chat_participant_id-fixture", + "content": "Hello from Fleetbase API", + "files": [] + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\ChatChannelService::sendMessage", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-core-api-chat-channels-update-chat-channel", + "collection": "Fleetbase Core API", + "group": "Chat Channels", + "name": "Update Chat Channel", + "method": "PUT", + "url": "{{base_url}}/{{namespace}}/chat-channels/:id", + "source": "postman/collections/Fleetbase Core API/Chat Channels/Update Chat Channel.request.yaml", + "description": "Updates a chat channel's name. The response returns the updated chat channel resource.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{chat_channel_id}}" + }, + "query": [], + "body_type": "json", + "body": { + "name": "Dispatch Updates" + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\ChatChannelService::updateChatChannel", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-core-api-comments-create-comment", + "collection": "Fleetbase Core API", + "group": "Comments", + "name": "Create Comment", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/comments", + "source": "postman/collections/Fleetbase Core API/Comments/Create Comment.request.yaml", + "description": "Creates a comment on a subject resource or as a reply to an existing comment. Provide either a subject reference or a parent comment ID with the comment content.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "content": "Example comment", + "subject": { + "id": "file_id-fixture", + "type": "file" + } + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\CommentService::createComment", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-core-api-comments-delete-comment", + "collection": "Fleetbase Core API", + "group": "Comments", + "name": "Delete Comment", + "method": "DELETE", + "url": "{{base_url}}/{{namespace}}/comments/:id", + "source": "postman/collections/Fleetbase Core API/Comments/Delete Comment.request.yaml", + "description": "Deletes a comment by ID. The response returns a deleted-resource envelope for the removed comment.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{comment_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\CommentService::deleteComment", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-core-api-comments-query-comments", + "collection": "Fleetbase Core API", + "group": "Comments", + "name": "Query Comments", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/comments", + "source": "postman/collections/Fleetbase Core API/Comments/Query Comments.request.yaml", + "description": "Returns comments for the current organization. Use query parameters to filter, sort, and paginate the result set.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": { + "limit": "25", + "offset": "0", + "sort": "created_at" + }, + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\CommentService::queryComments", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-core-api-comments-retrieve-comment", + "collection": "Fleetbase Core API", + "group": "Comments", + "name": "Retrieve Comment", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/comments/:id", + "source": "postman/collections/Fleetbase Core API/Comments/Retrieve Comment.request.yaml", + "description": "Retrieves a comment by ID, including its author and any nested replies returned by the API resource.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{comment_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\CommentService::retrieveComment", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-core-api-comments-update-comment", + "collection": "Fleetbase Core API", + "group": "Comments", + "name": "Update Comment", + "method": "PUT", + "url": "{{base_url}}/{{namespace}}/comments/:id", + "source": "postman/collections/Fleetbase Core API/Comments/Update Comment.request.yaml", + "description": "Updates the content of an existing comment. The subject and parent linkage are not changed by this endpoint.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{comment_id}}" + }, + "query": [], + "body_type": "json", + "body": { + "content": "Updated comment" + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\CommentService::updateComment", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-core-api-files-delete-a-file", + "collection": "Fleetbase Core API", + "group": "Files", + "name": "Delete a File", + "method": "DELETE", + "url": "{{base_url}}/{{namespace}}/files/:id", + "source": "postman/collections/Fleetbase Core API/Files/Delete a File.request.yaml", + "description": "Deletes a file record by ID. The response returns a deleted-resource envelope for the removed file.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{file_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\FileService::deleteFile", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-core-api-files-download-file", + "collection": "Fleetbase Core API", + "group": "Files", + "name": "Download File", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/files/:id/download", + "source": "postman/collections/Fleetbase Core API/Files/Download File.request.yaml", + "description": "Downloads the binary contents of a file by ID. The API streams the stored file using its original filename.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{file_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\FileService::downloadFile", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-core-api-files-query-files", + "collection": "Fleetbase Core API", + "group": "Files", + "name": "Query Files", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/files", + "source": "postman/collections/Fleetbase Core API/Files/Query Files.request.yaml", + "description": "Returns uploaded files for the current organization. Use query parameters to filter, sort, and paginate the result set.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": { + "limit": "25", + "offset": "0", + "sort": "created_at" + }, + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\FileService::queryFiles", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-core-api-files-retrieve-a-file", + "collection": "Fleetbase Core API", + "group": "Files", + "name": "Retrieve a File", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/files/:id", + "source": "postman/collections/Fleetbase Core API/Files/Retrieve a File.request.yaml", + "description": "Retrieves a file record by ID, including its URL, original filename, content type, size, caption, and metadata.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{file_id}}" + }, + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\FileService::retrieveFile", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-core-api-files-update-file", + "collection": "Fleetbase Core API", + "group": "Files", + "name": "Update File", + "method": "PUT", + "url": "{{base_url}}/{{namespace}}/files/:id", + "source": "postman/collections/Fleetbase Core API/Files/Update File.request.yaml", + "description": "Updates a file record's caption, metadata, or original filename. The uploaded binary object is not replaced.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": { + "id": "{{file_id}}" + }, + "query": [], + "body_type": "json", + "body": { + "caption": "Updated caption", + "meta": [] + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\FileService::updateFile", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-core-api-files-upload-base64-file", + "collection": "Fleetbase Core API", + "group": "Files", + "name": "Upload Base64 File", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/files/base64", + "source": "postman/collections/Fleetbase Core API/Files/Upload Base64 File.request.yaml", + "description": "Creates a file from base64-encoded data. Fleetbase stores the decoded file, creates a file record, and optionally associates it with a subject resource.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "json", + "body": { + "data": "base64_file_data-fixture", + "file_name": "example.png", + "file_type": "image", + "content_type": "image/png", + "path": "uploads" + } + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\FileService::uploadBase64File", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-core-api-files-upload-file", + "collection": "Fleetbase Core API", + "group": "Files", + "name": "Upload File", + "method": "POST", + "url": "{{base_url}}/{{namespace}}/files", + "source": "postman/collections/Fleetbase Core API/Files/Upload File.request.yaml", + "description": "Uploads a multipart file and creates a file record. The response includes the stored file URL and metadata captured from the upload.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": "formdata", + "body": [ + { + "type": "file", + "key": "file", + "src": "postman/collections/Fleetbase Core API/Files/sample-upload.png" + }, + { + "type": "text", + "key": "path", + "value": "uploads" + }, + { + "type": "text", + "key": "type", + "value": "attachment" + } + ] + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\FileService::uploadFile", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + }, + { + "id": "fleetbase-core-api-organizations-get-current-organization", + "collection": "Fleetbase Core API", + "group": "Organizations", + "name": "Get Current Organization", + "method": "GET", + "url": "{{base_url}}/{{namespace}}/organizations/current", + "source": "postman/collections/Fleetbase Core API/Organizations/Get Current Organization.request.yaml", + "description": "Returns the organization associated with the API credential.", + "authentication": "fleetbase-api-key", + "request_fixture": { + "path_variables": [], + "query": [], + "body_type": null, + "body": null + }, + "response_fixtures": [], + "implementation": "Fleetbase\\Sdk\\Services\\OrganizationService::getCurrentOrganization", + "tests": [ + "tests/Contract/EndpointContractTest.php::testEveryEndpointContract" + ], + "status": "complete", + "exception": null + } + ] +} diff --git a/contracts/public-api-1.0.2.json b/contracts/public-api-1.0.2.json new file mode 100644 index 0000000..b5ae5e6 --- /dev/null +++ b/contracts/public-api-1.0.2.json @@ -0,0 +1,1597 @@ +{ + "schema_version": 1, + "release": "1.0.2", + "namespace": "Fleetbase\\Sdk", + "classes": { + "Fleetbase\\Sdk\\Arr": { + "final": false, + "parent": null, + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "any", + "visibility": "public", + "static": true, + "return_type": null, + "parameters": [ + { + "name": "arr", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "predicate", + "type": "callable", + "by_reference": false, + "variadic": false, + "optional": false + } + ] + }, + { + "name": "every", + "visibility": "public", + "static": true, + "return_type": null, + "parameters": [ + { + "name": "arr", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "predicate", + "type": "callable", + "by_reference": false, + "variadic": false, + "optional": false + } + ] + }, + { + "name": "first", + "visibility": "public", + "static": true, + "return_type": null, + "parameters": [ + { + "name": "arr", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": false + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Fleetbase": { + "final": false, + "parent": null, + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "publicKey", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "config", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "debug", + "type": "bool", + "by_reference": false, + "variadic": false, + "optional": true, + "default": false + } + ] + }, + { + "name": "getOptions", + "visibility": "public", + "static": false, + "return_type": "array", + "parameters": [] + }, + { + "name": "getVersion", + "visibility": "public", + "static": false, + "return_type": "string", + "parameters": [] + }, + { + "name": "newInstance", + "visibility": "public", + "static": true, + "return_type": "Fleetbase\\Sdk\\Fleetbase", + "parameters": [] + }, + { + "name": "setApiKey", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\Fleetbase", + "parameters": [ + { + "name": "publicKey", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + } + ] + } + ] + }, + "Fleetbase\\Sdk\\FleetbaseException": { + "final": false, + "parent": "RuntimeException", + "interfaces": [ + "Stringable", + "Throwable" + ], + "constants": [], + "properties": [], + "methods": [] + }, + "Fleetbase\\Sdk\\HttpClient": { + "final": false, + "parent": null, + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "delete", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "path", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "data", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "get", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "path", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "data", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "getHost", + "visibility": "public", + "static": false, + "return_type": "string", + "parameters": [] + }, + { + "name": "getLastResponse", + "visibility": "public", + "static": false, + "return_type": "GuzzleHttp\\Psr7\\Response", + "parameters": [] + }, + { + "name": "getNamespace", + "visibility": "public", + "static": false, + "return_type": "string", + "parameters": [] + }, + { + "name": "getOptions", + "visibility": "public", + "static": false, + "return_type": "array", + "parameters": [] + }, + { + "name": "patch", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "path", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "data", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "post", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "path", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "data", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "put", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "path", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "data", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "setHost", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\HttpClient", + "parameters": [ + { + "name": "host", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + } + ] + }, + { + "name": "setNamespace", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\HttpClient", + "parameters": [ + { + "name": "namespace", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Resource": { + "final": false, + "parent": null, + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "service", + "type": "?Fleetbase\\Sdk\\Service", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "options", + "type": "?array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "__get", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "name", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + } + ] + }, + { + "name": "create", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "destroy", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "getAttribute", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attribute", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "defaultValue", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + } + ] + }, + { + "name": "getAttributes", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "properties", + "type": "?array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "hasAttribute", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "property", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + } + ] + }, + { + "name": "isAttributeFilled", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "property", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + } + ] + }, + { + "name": "isDirty", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attribute", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + } + ] + }, + { + "name": "save", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "options", + "type": "?array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "update", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Resources\\Contact": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__constructor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "service", + "type": "?Fleetbase\\Sdk\\Service", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Resources\\Driver": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__constructor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "service", + "type": "?Fleetbase\\Sdk\\Service", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Resources\\Entity": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__constructor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "service", + "type": "?Fleetbase\\Sdk\\Service", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Resources\\Order": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__constructor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "service", + "type": "?Fleetbase\\Sdk\\Services\\OrderService", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "getDistanceAndTime", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [] + } + ] + }, + "Fleetbase\\Sdk\\Resources\\Payload": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__constructor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "service", + "type": "?Fleetbase\\Sdk\\Service", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Resources\\Place": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__constructor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "service", + "type": "?Fleetbase\\Sdk\\Service", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Resources\\ServiceArea": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__constructor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "service", + "type": "?Fleetbase\\Sdk\\Service", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Resources\\ServiceQuote": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__constructor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "service", + "type": "?Fleetbase\\Sdk\\Service", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Resources\\ServiceRate": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__constructor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "service", + "type": "?Fleetbase\\Sdk\\Service", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Resources\\TrackingStatus": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__constructor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "service", + "type": "?Fleetbase\\Sdk\\Service", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Resources\\Vehicle": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__constructor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "service", + "type": "?Fleetbase\\Sdk\\Service", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Resources\\Vendor": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__constructor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "service", + "type": "?Fleetbase\\Sdk\\Service", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Resources\\Waypoint": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__constructor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "service", + "type": "?Fleetbase\\Sdk\\Service", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Resources\\Zone": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__constructor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "service", + "type": "?Fleetbase\\Sdk\\Service", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Service": { + "final": false, + "parent": null, + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "resource", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "client", + "type": "Fleetbase\\Sdk\\HttpClient", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "create", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "destroy", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "id", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "findAll", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "findRecord", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "id", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "getClient", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\HttpClient", + "parameters": [] + }, + { + "name": "getOptions", + "visibility": "public", + "static": false, + "return_type": "array", + "parameters": [] + }, + { + "name": "query", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "query", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "queryRecord", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "query", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "update", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "id", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Services\\OrderService": { + "final": false, + "parent": "Fleetbase\\Sdk\\Service", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "client", + "type": "Fleetbase\\Sdk\\HttpClient", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "getDistanceAndTime", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "id", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Utils": { + "final": false, + "parent": null, + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "classify", + "visibility": "public", + "static": true, + "return_type": null, + "parameters": [ + { + "name": "string", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + } + ] + }, + { + "name": "createNamespace", + "visibility": "public", + "static": true, + "return_type": null, + "parameters": [ + { + "name": "namespace", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + } + ] + }, + { + "name": "dd", + "visibility": "public", + "static": true, + "return_type": null, + "parameters": [] + }, + { + "name": "get", + "visibility": "public", + "static": true, + "return_type": null, + "parameters": [ + { + "name": "target", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "key", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "default", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + } + ] + }, + { + "name": "pluralize", + "visibility": "public", + "static": true, + "return_type": null, + "parameters": [ + { + "name": "string", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + } + ] + }, + { + "name": "value", + "visibility": "public", + "static": true, + "return_type": null, + "parameters": [ + { + "name": "value", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + } + ] + } + ] + } + }, + "runtime_properties": { + "Fleetbase\\Sdk\\Fleetbase": [ + "client", + "contacts", + "drivers", + "entities", + "orders", + "places", + "serviceAreas", + "serviceQuotes", + "serviceRates", + "trackingStatuses", + "vehicles", + "vendors", + "zones" + ] + } +} diff --git a/contracts/public-api-1.0.3.json b/contracts/public-api-1.0.3.json new file mode 100644 index 0000000..2c11785 --- /dev/null +++ b/contracts/public-api-1.0.3.json @@ -0,0 +1,2202 @@ +{ + "schema_version": 1, + "release": "1.0.3", + "namespace": "Fleetbase\\Sdk", + "classes": { + "Fleetbase\\Sdk\\Arr": { + "final": false, + "parent": null, + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "any", + "visibility": "public", + "static": true, + "return_type": null, + "parameters": [ + { + "name": "arr", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "predicate", + "type": "callable", + "by_reference": false, + "variadic": false, + "optional": false + } + ] + }, + { + "name": "every", + "visibility": "public", + "static": true, + "return_type": null, + "parameters": [ + { + "name": "arr", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "predicate", + "type": "callable", + "by_reference": false, + "variadic": false, + "optional": false + } + ] + }, + { + "name": "first", + "visibility": "public", + "static": true, + "return_type": null, + "parameters": [ + { + "name": "arr", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": false + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Fleetbase": { + "final": false, + "parent": null, + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "publicKey", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "config", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "debug", + "type": "bool", + "by_reference": false, + "variadic": false, + "optional": true, + "default": false + } + ] + }, + { + "name": "getOptions", + "visibility": "public", + "static": false, + "return_type": "array", + "parameters": [] + }, + { + "name": "getVersion", + "visibility": "public", + "static": false, + "return_type": "string", + "parameters": [] + }, + { + "name": "newInstance", + "visibility": "public", + "static": true, + "return_type": "Fleetbase\\Sdk\\Fleetbase", + "parameters": [] + }, + { + "name": "setApiKey", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\Fleetbase", + "parameters": [ + { + "name": "publicKey", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + } + ] + } + ] + }, + "Fleetbase\\Sdk\\FleetbaseException": { + "final": false, + "parent": "RuntimeException", + "interfaces": [ + "Stringable", + "Throwable" + ], + "constants": [], + "properties": [], + "methods": [] + }, + "Fleetbase\\Sdk\\HttpClient": { + "final": false, + "parent": null, + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "delete", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "path", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "data", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "get", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "path", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "data", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "getHost", + "visibility": "public", + "static": false, + "return_type": "string", + "parameters": [] + }, + { + "name": "getLastResponse", + "visibility": "public", + "static": false, + "return_type": "GuzzleHttp\\Psr7\\Response", + "parameters": [] + }, + { + "name": "getNamespace", + "visibility": "public", + "static": false, + "return_type": "string", + "parameters": [] + }, + { + "name": "getOptions", + "visibility": "public", + "static": false, + "return_type": "array", + "parameters": [] + }, + { + "name": "patch", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "path", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "data", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "post", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "path", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "data", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "put", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "path", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "data", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "setHost", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\HttpClient", + "parameters": [ + { + "name": "host", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + } + ] + }, + { + "name": "setNamespace", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\HttpClient", + "parameters": [ + { + "name": "namespace", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Resource": { + "final": false, + "parent": null, + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "service", + "type": "?Fleetbase\\Sdk\\Service", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "options", + "type": "?array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "__get", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "name", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + } + ] + }, + { + "name": "create", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "destroy", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "getAttribute", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attribute", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "defaultValue", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + } + ] + }, + { + "name": "getAttributes", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "properties", + "type": "?array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "hasAttribute", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "property", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + } + ] + }, + { + "name": "isAttributeFilled", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "property", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + } + ] + }, + { + "name": "isDirty", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attribute", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + } + ] + }, + { + "name": "save", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "options", + "type": "?array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "update", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Resources\\Contact": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__constructor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "service", + "type": "?Fleetbase\\Sdk\\Service", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Resources\\Driver": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__constructor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "service", + "type": "?Fleetbase\\Sdk\\Service", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Resources\\Entity": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__constructor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "service", + "type": "?Fleetbase\\Sdk\\Service", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Resources\\Order": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__constructor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "service", + "type": "?Fleetbase\\Sdk\\Services\\OrderService", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "cancel", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "params", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "captureQrCode", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "subjectId", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "params", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "captureSignature", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "subjectId", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "params", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "complete", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "params", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "dispatch", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "params", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "getDistanceAndTime", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "params", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "getNextActivity", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "params", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "setDestination", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "destinationId", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "params", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "start", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "params", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "updateActivity", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "params", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Resources\\Payload": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__constructor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "service", + "type": "?Fleetbase\\Sdk\\Service", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Resources\\Place": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__constructor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "service", + "type": "?Fleetbase\\Sdk\\Service", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Resources\\ServiceArea": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__constructor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "service", + "type": "?Fleetbase\\Sdk\\Service", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Resources\\ServiceQuote": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__constructor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "service", + "type": "?Fleetbase\\Sdk\\Service", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Resources\\ServiceRate": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__constructor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "service", + "type": "?Fleetbase\\Sdk\\Service", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Resources\\TrackingStatus": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__constructor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "service", + "type": "?Fleetbase\\Sdk\\Service", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Resources\\Vehicle": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__constructor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "service", + "type": "?Fleetbase\\Sdk\\Service", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Resources\\Vendor": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__constructor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "service", + "type": "?Fleetbase\\Sdk\\Service", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Resources\\Waypoint": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__constructor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "service", + "type": "?Fleetbase\\Sdk\\Service", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Resources\\Zone": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__constructor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "service", + "type": "?Fleetbase\\Sdk\\Service", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Service": { + "final": false, + "parent": null, + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "resource", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "client", + "type": "Fleetbase\\Sdk\\HttpClient", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "create", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "destroy", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "id", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "findAll", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "findRecord", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "id", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "getClient", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\HttpClient", + "parameters": [] + }, + { + "name": "getOptions", + "visibility": "public", + "static": false, + "return_type": "array", + "parameters": [] + }, + { + "name": "query", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "query", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "queryRecord", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "query", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "update", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "id", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "uri", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "path", + "type": "?string", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + } + ] + }, + { + "name": "uriForResource", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "id", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "path", + "type": "?string", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Services\\OrderService": { + "final": false, + "parent": "Fleetbase\\Sdk\\Service", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "client", + "type": "Fleetbase\\Sdk\\HttpClient", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "cancel", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "id", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "params", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "captureQrCode", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "id", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "subjectId", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "params", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "captureSignature", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "id", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "subjectId", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "params", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "complete", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "id", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "params", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "dispatch", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "id", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "params", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "getDistanceAndTime", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "id", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "params", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "getNextActivity", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "id", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "params", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "setDestination", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "id", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "destinationId", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "params", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "start", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "id", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "params", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "updateActivity", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "id", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "params", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Utils": { + "final": false, + "parent": null, + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "classify", + "visibility": "public", + "static": true, + "return_type": null, + "parameters": [ + { + "name": "string", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + } + ] + }, + { + "name": "createNamespace", + "visibility": "public", + "static": true, + "return_type": null, + "parameters": [ + { + "name": "namespace", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + } + ] + }, + { + "name": "dd", + "visibility": "public", + "static": true, + "return_type": null, + "parameters": [] + }, + { + "name": "get", + "visibility": "public", + "static": true, + "return_type": null, + "parameters": [ + { + "name": "target", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "key", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "default", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + } + ] + }, + { + "name": "pluralize", + "visibility": "public", + "static": true, + "return_type": null, + "parameters": [ + { + "name": "string", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + } + ] + }, + { + "name": "value", + "visibility": "public", + "static": true, + "return_type": null, + "parameters": [ + { + "name": "value", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + } + ] + } + ] + } + }, + "runtime_properties": { + "Fleetbase\\Sdk\\Fleetbase": [ + "client", + "contacts", + "drivers", + "entities", + "orders", + "places", + "serviceAreas", + "serviceQuotes", + "serviceRates", + "trackingStatuses", + "vehicles", + "vendors", + "zones" + ] + } +} diff --git a/contracts/public-api-current.json b/contracts/public-api-current.json new file mode 100644 index 0000000..523b320 --- /dev/null +++ b/contracts/public-api-current.json @@ -0,0 +1,9892 @@ +{ + "schema_version": 1, + "release": "working-tree", + "namespace": "Fleetbase\\Sdk", + "classes": { + "Fleetbase\\Sdk\\Arr": { + "final": false, + "parent": null, + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "any", + "visibility": "public", + "static": true, + "return_type": null, + "parameters": [ + { + "name": "arr", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "predicate", + "type": "callable", + "by_reference": false, + "variadic": false, + "optional": false + } + ] + }, + { + "name": "every", + "visibility": "public", + "static": true, + "return_type": null, + "parameters": [ + { + "name": "arr", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "predicate", + "type": "callable", + "by_reference": false, + "variadic": false, + "optional": false + } + ] + }, + { + "name": "first", + "visibility": "public", + "static": true, + "return_type": null, + "parameters": [ + { + "name": "arr", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": false + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Configuration": { + "final": true, + "parent": null, + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "apiKey", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "debug", + "type": "bool", + "by_reference": false, + "variadic": false, + "optional": true, + "default": false + } + ] + }, + { + "name": "getApiKey", + "visibility": "public", + "static": false, + "return_type": "string", + "parameters": [] + }, + { + "name": "getBaseUri", + "visibility": "public", + "static": false, + "return_type": "string", + "parameters": [] + }, + { + "name": "getHost", + "visibility": "public", + "static": false, + "return_type": "string", + "parameters": [] + }, + { + "name": "getNamespace", + "visibility": "public", + "static": false, + "return_type": "string", + "parameters": [] + }, + { + "name": "getVersion", + "visibility": "public", + "static": false, + "return_type": "string", + "parameters": [] + }, + { + "name": "isDebug", + "visibility": "public", + "static": false, + "return_type": "bool", + "parameters": [] + }, + { + "name": "toArray", + "visibility": "public", + "static": false, + "return_type": "array", + "parameters": [] + } + ] + }, + "Fleetbase\\Sdk\\EndpointService": { + "final": false, + "parent": "Fleetbase\\Sdk\\Service", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [] + }, + "Fleetbase\\Sdk\\Fleetbase": { + "final": false, + "parent": null, + "interfaces": [], + "constants": [], + "properties": [ + { + "name": "chatChannels", + "visibility": "public", + "static": false, + "type": null + }, + { + "name": "client", + "visibility": "public", + "static": false, + "type": null + }, + { + "name": "comments", + "visibility": "public", + "static": false, + "type": null + }, + { + "name": "contacts", + "visibility": "public", + "static": false, + "type": null + }, + { + "name": "customers", + "visibility": "public", + "static": false, + "type": null + }, + { + "name": "devices", + "visibility": "public", + "static": false, + "type": null + }, + { + "name": "drivers", + "visibility": "public", + "static": false, + "type": null + }, + { + "name": "entities", + "visibility": "public", + "static": false, + "type": null + }, + { + "name": "equipment", + "visibility": "public", + "static": false, + "type": null + }, + { + "name": "files", + "visibility": "public", + "static": false, + "type": null + }, + { + "name": "fleets", + "visibility": "public", + "static": false, + "type": null + }, + { + "name": "fuelReports", + "visibility": "public", + "static": false, + "type": null + }, + { + "name": "fuelTransactions", + "visibility": "public", + "static": false, + "type": null + }, + { + "name": "geofences", + "visibility": "public", + "static": false, + "type": null + }, + { + "name": "issues", + "visibility": "public", + "static": false, + "type": null + }, + { + "name": "labels", + "visibility": "public", + "static": false, + "type": null + }, + { + "name": "manifests", + "visibility": "public", + "static": false, + "type": null + }, + { + "name": "onboard", + "visibility": "public", + "static": false, + "type": null + }, + { + "name": "orchestrator", + "visibility": "public", + "static": false, + "type": null + }, + { + "name": "orderConfigs", + "visibility": "public", + "static": false, + "type": null + }, + { + "name": "orders", + "visibility": "public", + "static": false, + "type": null + }, + { + "name": "organizations", + "visibility": "public", + "static": false, + "type": null + }, + { + "name": "parts", + "visibility": "public", + "static": false, + "type": null + }, + { + "name": "payloads", + "visibility": "public", + "static": false, + "type": null + }, + { + "name": "places", + "visibility": "public", + "static": false, + "type": null + }, + { + "name": "purchaseRates", + "visibility": "public", + "static": false, + "type": null + }, + { + "name": "sensors", + "visibility": "public", + "static": false, + "type": null + }, + { + "name": "serviceAreas", + "visibility": "public", + "static": false, + "type": null + }, + { + "name": "serviceQuotes", + "visibility": "public", + "static": false, + "type": null + }, + { + "name": "serviceRates", + "visibility": "public", + "static": false, + "type": null + }, + { + "name": "trackingNumbers", + "visibility": "public", + "static": false, + "type": null + }, + { + "name": "trackingStatuses", + "visibility": "public", + "static": false, + "type": null + }, + { + "name": "vehicles", + "visibility": "public", + "static": false, + "type": null + }, + { + "name": "vendors", + "visibility": "public", + "static": false, + "type": null + }, + { + "name": "workOrders", + "visibility": "public", + "static": false, + "type": null + }, + { + "name": "zones", + "visibility": "public", + "static": false, + "type": null + } + ], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "publicKey", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "config", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "debug", + "type": "bool", + "by_reference": false, + "variadic": false, + "optional": true, + "default": false + } + ] + }, + { + "name": "chatChannels", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\Service", + "parameters": [] + }, + { + "name": "comments", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\Service", + "parameters": [] + }, + { + "name": "contacts", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\Service", + "parameters": [] + }, + { + "name": "customers", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\Services\\CustomerService", + "parameters": [] + }, + { + "name": "devices", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\Services\\DeviceService", + "parameters": [] + }, + { + "name": "drivers", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\Service", + "parameters": [] + }, + { + "name": "entities", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\Services\\EntityService", + "parameters": [] + }, + { + "name": "equipment", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\Services\\EquipmentService", + "parameters": [] + }, + { + "name": "files", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\Service", + "parameters": [] + }, + { + "name": "fleets", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\Services\\FleetService", + "parameters": [] + }, + { + "name": "fuelReports", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\Services\\FuelReportService", + "parameters": [] + }, + { + "name": "fuelTransactions", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\Services\\FuelTransactionService", + "parameters": [] + }, + { + "name": "geofences", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\Services\\GeofenceService", + "parameters": [] + }, + { + "name": "getOptions", + "visibility": "public", + "static": false, + "return_type": "array", + "parameters": [] + }, + { + "name": "getVersion", + "visibility": "public", + "static": false, + "return_type": "string", + "parameters": [] + }, + { + "name": "issues", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\Services\\IssueService", + "parameters": [] + }, + { + "name": "labels", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\Services\\LabelService", + "parameters": [] + }, + { + "name": "manifests", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\Services\\ManifestService", + "parameters": [] + }, + { + "name": "newInstance", + "visibility": "public", + "static": true, + "return_type": "Fleetbase\\Sdk\\Fleetbase", + "parameters": [] + }, + { + "name": "onboard", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\Services\\OnboardService", + "parameters": [] + }, + { + "name": "orchestrator", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\Services\\OrchestratorService", + "parameters": [] + }, + { + "name": "orderConfigs", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\Services\\OrderConfigService", + "parameters": [] + }, + { + "name": "orders", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\Services\\OrderService", + "parameters": [] + }, + { + "name": "organizations", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\Service", + "parameters": [] + }, + { + "name": "parts", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\Services\\PartService", + "parameters": [] + }, + { + "name": "payloads", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\Service", + "parameters": [] + }, + { + "name": "places", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\Service", + "parameters": [] + }, + { + "name": "purchaseRates", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\Services\\PurchaseRateService", + "parameters": [] + }, + { + "name": "sensors", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\Services\\SensorService", + "parameters": [] + }, + { + "name": "service", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\Service", + "parameters": [ + { + "name": "name", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + } + ] + }, + { + "name": "serviceAreas", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\Services\\ServiceAreaService", + "parameters": [] + }, + { + "name": "serviceQuotes", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\Services\\ServiceQuoteService", + "parameters": [] + }, + { + "name": "serviceRates", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\Services\\ServiceRateService", + "parameters": [] + }, + { + "name": "setApiKey", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\Fleetbase", + "parameters": [ + { + "name": "publicKey", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + } + ] + }, + { + "name": "trackingNumbers", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\Services\\TrackingNumberService", + "parameters": [] + }, + { + "name": "trackingStatuses", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\Services\\TrackingStatusService", + "parameters": [] + }, + { + "name": "vehicles", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\Service", + "parameters": [] + }, + { + "name": "vendors", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\Service", + "parameters": [] + }, + { + "name": "workOrders", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\Services\\WorkOrderService", + "parameters": [] + }, + { + "name": "zones", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\Services\\ZoneService", + "parameters": [] + } + ] + }, + "Fleetbase\\Sdk\\FleetbaseException": { + "final": false, + "parent": "RuntimeException", + "interfaces": [ + "Stringable", + "Throwable" + ], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "message", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "statusCode", + "type": "?int", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "errorCode", + "type": "?string", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "details", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "requestId", + "type": "?string", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "method", + "type": "?string", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "url", + "type": "?string", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "previous", + "type": "?Throwable", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + } + ] + }, + { + "name": "getDetails", + "visibility": "public", + "static": false, + "return_type": "array", + "parameters": [] + }, + { + "name": "getErrorCode", + "visibility": "public", + "static": false, + "return_type": "?string", + "parameters": [] + }, + { + "name": "getRequestId", + "visibility": "public", + "static": false, + "return_type": "?string", + "parameters": [] + }, + { + "name": "getRequestMethod", + "visibility": "public", + "static": false, + "return_type": "?string", + "parameters": [] + }, + { + "name": "getRequestUrl", + "visibility": "public", + "static": false, + "return_type": "?string", + "parameters": [] + }, + { + "name": "getStatusCode", + "visibility": "public", + "static": false, + "return_type": "?int", + "parameters": [] + } + ] + }, + "Fleetbase\\Sdk\\HttpClient": { + "final": false, + "parent": null, + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "delete", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "path", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "data", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "get", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "path", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "data", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "getHost", + "visibility": "public", + "static": false, + "return_type": "string", + "parameters": [] + }, + { + "name": "getLastPsrResponse", + "visibility": "public", + "static": false, + "return_type": "?Psr\\Http\\Message\\ResponseInterface", + "parameters": [] + }, + { + "name": "getLastResponse", + "visibility": "public", + "static": false, + "return_type": "GuzzleHttp\\Psr7\\Response", + "parameters": [] + }, + { + "name": "getNamespace", + "visibility": "public", + "static": false, + "return_type": "string", + "parameters": [] + }, + { + "name": "getOptions", + "visibility": "public", + "static": false, + "return_type": "array", + "parameters": [] + }, + { + "name": "patch", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "path", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "data", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "post", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "path", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "data", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "put", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "path", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "data", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "request", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "method", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "path", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "data", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "setHost", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\HttpClient", + "parameters": [ + { + "name": "host", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + } + ] + }, + { + "name": "setNamespace", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\HttpClient", + "parameters": [ + { + "name": "namespace", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Resource": { + "final": false, + "parent": null, + "interfaces": [ + "JsonSerializable" + ], + "constants": [], + "properties": [ + { + "name": "attributes", + "visibility": "protected", + "static": false, + "type": "array" + }, + { + "name": "options", + "visibility": "protected", + "static": false, + "type": "array" + }, + { + "name": "originalAttributes", + "visibility": "protected", + "static": false, + "type": "array" + }, + { + "name": "service", + "visibility": "protected", + "static": false, + "type": "?Fleetbase\\Sdk\\Service" + } + ], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "service", + "type": "?Fleetbase\\Sdk\\Service", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "options", + "type": "?array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "__get", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "name", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + } + ] + }, + { + "name": "__isset", + "visibility": "public", + "static": false, + "return_type": "bool", + "parameters": [ + { + "name": "name", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + } + ] + }, + { + "name": "__set", + "visibility": "public", + "static": false, + "return_type": "void", + "parameters": [ + { + "name": "name", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "value", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + } + ] + }, + { + "name": "create", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "destroy", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "getAttribute", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attribute", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "defaultValue", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + } + ] + }, + { + "name": "getAttributes", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "properties", + "type": "?array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "getChanges", + "visibility": "public", + "static": false, + "return_type": "array", + "parameters": [] + }, + { + "name": "getDirtyAttributes", + "visibility": "public", + "static": false, + "return_type": "array", + "parameters": [] + }, + { + "name": "getService", + "visibility": "public", + "static": false, + "return_type": "?Fleetbase\\Sdk\\Service", + "parameters": [] + }, + { + "name": "hasAttribute", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "property", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + } + ] + }, + { + "name": "isAttributeFilled", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "property", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + } + ] + }, + { + "name": "isDirty", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attribute", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + } + ] + }, + { + "name": "jsonSerialize", + "visibility": "public", + "static": false, + "return_type": "array", + "parameters": [] + }, + { + "name": "offsetExists", + "visibility": "public", + "static": false, + "return_type": "bool", + "parameters": [ + { + "name": "offset", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + } + ] + }, + { + "name": "offsetGet", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "offset", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + } + ] + }, + { + "name": "offsetSet", + "visibility": "public", + "static": false, + "return_type": "void", + "parameters": [ + { + "name": "offset", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "value", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + } + ] + }, + { + "name": "offsetUnset", + "visibility": "public", + "static": false, + "return_type": "void", + "parameters": [ + { + "name": "offset", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + } + ] + }, + { + "name": "reload", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\Resource", + "parameters": [ + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "requireService", + "visibility": "protected", + "static": false, + "return_type": "Fleetbase\\Sdk\\Service", + "parameters": [] + }, + { + "name": "save", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "options", + "type": "?array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "setAttribute", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\Resource", + "parameters": [ + { + "name": "attribute", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "value", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + } + ] + }, + { + "name": "toArray", + "visibility": "public", + "static": false, + "return_type": "array", + "parameters": [] + }, + { + "name": "update", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Resources\\ChatChannel": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [ + "JsonSerializable" + ], + "constants": [], + "properties": [], + "methods": [] + }, + "Fleetbase\\Sdk\\Resources\\Comment": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [ + "JsonSerializable" + ], + "constants": [], + "properties": [], + "methods": [] + }, + "Fleetbase\\Sdk\\Resources\\Contact": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [ + "JsonSerializable" + ], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__constructor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "service", + "type": "?Fleetbase\\Sdk\\Service", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Resources\\Customer": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [ + "JsonSerializable" + ], + "constants": [], + "properties": [], + "methods": [] + }, + "Fleetbase\\Sdk\\Resources\\Device": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [ + "JsonSerializable" + ], + "constants": [], + "properties": [], + "methods": [] + }, + "Fleetbase\\Sdk\\Resources\\Driver": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [ + "JsonSerializable" + ], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__constructor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "service", + "type": "?Fleetbase\\Sdk\\Service", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Resources\\Entity": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [ + "JsonSerializable" + ], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__constructor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "service", + "type": "?Fleetbase\\Sdk\\Service", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Resources\\Equipment": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [ + "JsonSerializable" + ], + "constants": [], + "properties": [], + "methods": [] + }, + "Fleetbase\\Sdk\\Resources\\File": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [ + "JsonSerializable" + ], + "constants": [], + "properties": [], + "methods": [] + }, + "Fleetbase\\Sdk\\Resources\\Fleet": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [ + "JsonSerializable" + ], + "constants": [], + "properties": [], + "methods": [] + }, + "Fleetbase\\Sdk\\Resources\\FuelReport": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [ + "JsonSerializable" + ], + "constants": [], + "properties": [], + "methods": [] + }, + "Fleetbase\\Sdk\\Resources\\FuelTransaction": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [ + "JsonSerializable" + ], + "constants": [], + "properties": [], + "methods": [] + }, + "Fleetbase\\Sdk\\Resources\\Geofence": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [ + "JsonSerializable" + ], + "constants": [], + "properties": [], + "methods": [] + }, + "Fleetbase\\Sdk\\Resources\\Issue": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [ + "JsonSerializable" + ], + "constants": [], + "properties": [], + "methods": [] + }, + "Fleetbase\\Sdk\\Resources\\Label": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [ + "JsonSerializable" + ], + "constants": [], + "properties": [], + "methods": [] + }, + "Fleetbase\\Sdk\\Resources\\Manifest": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [ + "JsonSerializable" + ], + "constants": [], + "properties": [], + "methods": [] + }, + "Fleetbase\\Sdk\\Resources\\Onboard": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [ + "JsonSerializable" + ], + "constants": [], + "properties": [], + "methods": [] + }, + "Fleetbase\\Sdk\\Resources\\Orchestrator": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [ + "JsonSerializable" + ], + "constants": [], + "properties": [], + "methods": [] + }, + "Fleetbase\\Sdk\\Resources\\Order": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [ + "JsonSerializable" + ], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__constructor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "service", + "type": "?Fleetbase\\Sdk\\Services\\OrderService", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "cancel", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "params", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "captureQrCode", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "subjectId", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "params", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "captureSignature", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "subjectId", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "params", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "complete", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "params", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "dispatch", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "params", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "getDistanceAndTime", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "params", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "getNextActivity", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "params", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "setDestination", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "destinationId", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "params", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "start", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "params", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "updateActivity", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "params", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Resources\\OrderConfig": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [ + "JsonSerializable" + ], + "constants": [], + "properties": [], + "methods": [] + }, + "Fleetbase\\Sdk\\Resources\\Organization": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [ + "JsonSerializable" + ], + "constants": [], + "properties": [], + "methods": [] + }, + "Fleetbase\\Sdk\\Resources\\Part": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [ + "JsonSerializable" + ], + "constants": [], + "properties": [], + "methods": [] + }, + "Fleetbase\\Sdk\\Resources\\Payload": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [ + "JsonSerializable" + ], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__constructor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "service", + "type": "?Fleetbase\\Sdk\\Service", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Resources\\Place": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [ + "JsonSerializable" + ], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__constructor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "service", + "type": "?Fleetbase\\Sdk\\Service", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Resources\\PurchaseRate": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [ + "JsonSerializable" + ], + "constants": [], + "properties": [], + "methods": [] + }, + "Fleetbase\\Sdk\\Resources\\Sensor": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [ + "JsonSerializable" + ], + "constants": [], + "properties": [], + "methods": [] + }, + "Fleetbase\\Sdk\\Resources\\ServiceArea": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [ + "JsonSerializable" + ], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__constructor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "service", + "type": "?Fleetbase\\Sdk\\Service", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Resources\\ServiceQuote": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [ + "JsonSerializable" + ], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__constructor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "service", + "type": "?Fleetbase\\Sdk\\Service", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Resources\\ServiceRate": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [ + "JsonSerializable" + ], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__constructor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "service", + "type": "?Fleetbase\\Sdk\\Service", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Resources\\TrackingNumber": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [ + "JsonSerializable" + ], + "constants": [], + "properties": [], + "methods": [] + }, + "Fleetbase\\Sdk\\Resources\\TrackingStatus": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [ + "JsonSerializable" + ], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__constructor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "service", + "type": "?Fleetbase\\Sdk\\Service", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Resources\\Vehicle": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [ + "JsonSerializable" + ], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__constructor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "service", + "type": "?Fleetbase\\Sdk\\Service", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Resources\\Vendor": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [ + "JsonSerializable" + ], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__constructor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "service", + "type": "?Fleetbase\\Sdk\\Service", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Resources\\Waypoint": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [ + "JsonSerializable" + ], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__constructor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "service", + "type": "?Fleetbase\\Sdk\\Service", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Resources\\WorkOrder": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [ + "JsonSerializable" + ], + "constants": [], + "properties": [], + "methods": [] + }, + "Fleetbase\\Sdk\\Resources\\Zone": { + "final": false, + "parent": "Fleetbase\\Sdk\\Resource", + "interfaces": [ + "JsonSerializable" + ], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__constructor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "service", + "type": "?Fleetbase\\Sdk\\Service", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Service": { + "final": false, + "parent": null, + "interfaces": [], + "constants": [], + "properties": [ + { + "name": "client", + "visibility": "protected", + "static": false, + "type": "Fleetbase\\Sdk\\HttpClient" + }, + { + "name": "namespace", + "visibility": "protected", + "static": false, + "type": "string" + }, + { + "name": "options", + "visibility": "protected", + "static": false, + "type": "array" + }, + { + "name": "resource", + "visibility": "protected", + "static": false, + "type": "string" + } + ], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "resource", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "client", + "type": "Fleetbase\\Sdk\\HttpClient", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "action", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "method", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "path", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "data", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "create", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "destroy", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "id", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "endpoint", + "visibility": "protected", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "method", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "template", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "findAll", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "findRecord", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "id", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "getClient", + "visibility": "public", + "static": false, + "return_type": "Fleetbase\\Sdk\\HttpClient", + "parameters": [] + }, + { + "name": "getOptions", + "visibility": "public", + "static": false, + "return_type": "array", + "parameters": [] + }, + { + "name": "query", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "query", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "queryRecord", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "query", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "resolve", + "visibility": "protected", + "static": false, + "return_type": "Fleetbase\\Sdk\\Resource", + "parameters": [ + { + "name": "data", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + } + ] + }, + { + "name": "resolveCollection", + "visibility": "protected", + "static": false, + "return_type": "?array", + "parameters": [ + { + "name": "data", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + } + ] + }, + { + "name": "update", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "id", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "attributes", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "uri", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "path", + "type": "?string", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + } + ] + }, + { + "name": "uriForResource", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "id", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "path", + "type": "?string", + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Services\\ChatChannelService": { + "final": false, + "parent": "Fleetbase\\Sdk\\EndpointService", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "client", + "type": "Fleetbase\\Sdk\\HttpClient", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "addParticipant", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "createChatChannel", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "createReadReceipt", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "deleteChatChannel", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "deleteMessage", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "listAvailableParticipants", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "queryChatChannels", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "removeParticipant", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "retrieveChatChannel", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "sendMessage", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "updateChatChannel", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Services\\CommentService": { + "final": false, + "parent": "Fleetbase\\Sdk\\EndpointService", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "client", + "type": "Fleetbase\\Sdk\\HttpClient", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "createComment", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "deleteComment", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "queryComments", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "retrieveComment", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "updateComment", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Services\\ContactService": { + "final": false, + "parent": "Fleetbase\\Sdk\\EndpointService", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "client", + "type": "Fleetbase\\Sdk\\HttpClient", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "createContact", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "deleteContact", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "queryContacts", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "retrieveContact", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "updateContact", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Services\\CustomerService": { + "final": false, + "parent": "Fleetbase\\Sdk\\EndpointService", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "client", + "type": "Fleetbase\\Sdk\\HttpClient", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "createCustomer", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "createCustomerOrder", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "forgotCustomerPassword", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "listCustomerOrders", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "listCustomerPlaces", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "loginCustomer", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "logoutAllCustomerSessions", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "logoutCustomer", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "registerCustomerDevice", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "requestCustomerCreationCode", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "requestCustomerLoginSms", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "resetCustomerPassword", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "retrieveAuthenticatedCustomer", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "retrieveCustomerOrder", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "updateAuthenticatedCustomer", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "verifyCustomerLoginCode", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Services\\DeviceService": { + "final": false, + "parent": "Fleetbase\\Sdk\\EndpointService", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "client", + "type": "Fleetbase\\Sdk\\HttpClient", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "attachDevice", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "createDevice", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "deleteDevice", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "detachDevice", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "queryDevices", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "retrieveDevice", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "updateDevice", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Services\\DriverService": { + "final": false, + "parent": "Fleetbase\\Sdk\\EndpointService", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "client", + "type": "Fleetbase\\Sdk\\HttpClient", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "changeDriverPassword", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "createDriver", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "deleteDriver", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "getDriverCurrentOrganization", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "listDriverManifests", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "listDriverOrganizations", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "loginDriver", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "queryDrivers", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "registerDevice", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "registerDriverDevice", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "requestDriverLoginSms", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "requestDriverPasswordReset", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "resetDriverPassword", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "retrieveDriver", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "simulateDriverRoute", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "switchDriverOrganization", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "toggleDriverOnline", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "trackDriver", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "updateDriver", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "verifyDriverLoginCode", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Services\\EntityService": { + "final": false, + "parent": "Fleetbase\\Sdk\\EndpointService", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "client", + "type": "Fleetbase\\Sdk\\HttpClient", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "createEntity", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "deleteEntity", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "queryEntities", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "retrieveEntity", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "updateEntity", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Services\\EquipmentService": { + "final": false, + "parent": "Fleetbase\\Sdk\\EndpointService", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "client", + "type": "Fleetbase\\Sdk\\HttpClient", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "createEquipment", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "deleteEquipment", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "queryEquipment", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "retrieveEquipment", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "updateEquipment", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Services\\FileService": { + "final": false, + "parent": "Fleetbase\\Sdk\\EndpointService", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "client", + "type": "Fleetbase\\Sdk\\HttpClient", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "deleteFile", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "downloadFile", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "queryFiles", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "retrieveFile", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "updateFile", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "uploadBase64File", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "uploadFile", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Services\\FleetService": { + "final": false, + "parent": "Fleetbase\\Sdk\\EndpointService", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "client", + "type": "Fleetbase\\Sdk\\HttpClient", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "createFleet", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "deleteFleet", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "queryFleets", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "retrieveFleet", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "updateFleet", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Services\\FuelReportService": { + "final": false, + "parent": "Fleetbase\\Sdk\\EndpointService", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "client", + "type": "Fleetbase\\Sdk\\HttpClient", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "createFuelReport", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "deleteFuelReport", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "queryFuelReports", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "retrieveFuelReport", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "updateFuelReport", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Services\\FuelTransactionService": { + "final": false, + "parent": "Fleetbase\\Sdk\\EndpointService", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "client", + "type": "Fleetbase\\Sdk\\HttpClient", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "createFuelTransaction", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "deleteFuelTransaction", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "matchFuelTransactionOrder", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "matchFuelTransactionVehicle", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "queryFuelTransactions", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "reprocessFuelTransaction", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "retrieveFuelTransaction", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "reviewFuelTransaction", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "updateFuelTransaction", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Services\\GeofenceService": { + "final": false, + "parent": "Fleetbase\\Sdk\\EndpointService", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "client", + "type": "Fleetbase\\Sdk\\HttpClient", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "getDriverGeofenceHistory", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "getGeofenceDwellReport", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "getGeofenceInventory", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "listGeofenceEvents", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Services\\IssueService": { + "final": false, + "parent": "Fleetbase\\Sdk\\EndpointService", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "client", + "type": "Fleetbase\\Sdk\\HttpClient", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "createIssue", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "deleteIssue", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "queryIssues", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "retrieveIssue", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "updateIssue", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Services\\LabelService": { + "final": false, + "parent": "Fleetbase\\Sdk\\EndpointService", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "client", + "type": "Fleetbase\\Sdk\\HttpClient", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "renderLabel", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Services\\ManifestService": { + "final": false, + "parent": "Fleetbase\\Sdk\\EndpointService", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "client", + "type": "Fleetbase\\Sdk\\HttpClient", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "optimizeManifest", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "retrieveManifest", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "updateManifestStop", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Services\\OnboardService": { + "final": false, + "parent": "Fleetbase\\Sdk\\EndpointService", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "client", + "type": "Fleetbase\\Sdk\\HttpClient", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "getDriverOnboardSettings", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Services\\OrchestratorService": { + "final": false, + "parent": "Fleetbase\\Sdk\\EndpointService", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "client", + "type": "Fleetbase\\Sdk\\HttpClient", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "commitOrchestratorPlan", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "runOrchestrator", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Services\\OrderConfigService": { + "final": false, + "parent": "Fleetbase\\Sdk\\EndpointService", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "client", + "type": "Fleetbase\\Sdk\\HttpClient", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "queryOrderConfigs", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "retrieveOrderConfig", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Services\\OrderService": { + "final": false, + "parent": "Fleetbase\\Sdk\\Service", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "client", + "type": "Fleetbase\\Sdk\\HttpClient", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "cancel", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "id", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "params", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "cancelOrder", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "capturePhotoForOrder", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "captureQrCode", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "id", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "subjectId", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "params", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "captureQrCodeForOrder", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "captureSignature", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "id", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "subjectId", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + }, + { + "name": "params", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "captureSignatureForOrder", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "complete", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "id", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "params", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "completeOrder", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "createOrder", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "createOrderUsingCompletePayload", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "createOrderUsingCoordinates", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "createOrderUsingGeojsonPoints", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "createOrderUsingOnlyPickupDropoff", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "createOrderUsingOnlyWaypoints", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "createOrderUsingPayload", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "createOrderUsingWaypointsAndEntitiesWithPhotos", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "createOrderUsingWaypointsAndEntityDestinations", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "deleteOrder", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "dispatch", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "id", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "params", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "dispatchOrder", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "getDistanceAndTime", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "id", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "params", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "getEditableEntityFields", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "getNextActivity", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "id", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "params", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "getOrderDistanceAndTime", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "getOrderEta", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "getOrderNextActivity", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "getOrderTracker", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "listOrderComments", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "listOrderProofs", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "queryOrders", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "retrieveOrder", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "scheduleOrder", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "setDestination", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "id", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "destinationId", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "params", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "setOrderDestination", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "start", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "id", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "params", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "startOrder", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "updateActivity", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "id", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "params", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "updateOrder", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "updateOrderActivity", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Services\\OrganizationService": { + "final": false, + "parent": "Fleetbase\\Sdk\\EndpointService", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "client", + "type": "Fleetbase\\Sdk\\HttpClient", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "getCurrentOrganization", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "listOrganizations", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Services\\PartService": { + "final": false, + "parent": "Fleetbase\\Sdk\\EndpointService", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "client", + "type": "Fleetbase\\Sdk\\HttpClient", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "createPart", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "deletePart", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "queryParts", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "retrievePart", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "updatePart", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Services\\PayloadService": { + "final": false, + "parent": "Fleetbase\\Sdk\\EndpointService", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "client", + "type": "Fleetbase\\Sdk\\HttpClient", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "createPayload", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "deletePayload", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "queryPayloads", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "retrievePayload", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "updatePayload", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Services\\PlaceService": { + "final": false, + "parent": "Fleetbase\\Sdk\\EndpointService", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "client", + "type": "Fleetbase\\Sdk\\HttpClient", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "createPlace", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "deletePlace", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "listAllPlaces", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "queryPlaces", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "retrievePlace", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "searchPlaces", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "updatePlace", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Services\\PurchaseRateService": { + "final": false, + "parent": "Fleetbase\\Sdk\\EndpointService", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "client", + "type": "Fleetbase\\Sdk\\HttpClient", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "createPurchaseRate", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "queryPurchaseRates", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "retrievePurchaseRate", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Services\\SensorService": { + "final": false, + "parent": "Fleetbase\\Sdk\\EndpointService", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "client", + "type": "Fleetbase\\Sdk\\HttpClient", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "createSensor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "deleteSensor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "querySensors", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "retrieveSensor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "updateSensor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Services\\ServiceAreaService": { + "final": false, + "parent": "Fleetbase\\Sdk\\EndpointService", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "client", + "type": "Fleetbase\\Sdk\\HttpClient", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "createServiceArea", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "deleteServiceArea", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "queryServiceAreas", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "retrieveServiceArea", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "updateServiceArea", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Services\\ServiceQuoteService": { + "final": false, + "parent": "Fleetbase\\Sdk\\EndpointService", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "client", + "type": "Fleetbase\\Sdk\\HttpClient", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "queryServiceQuotes", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "retrieveServiceQuote", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Services\\ServiceRateService": { + "final": false, + "parent": "Fleetbase\\Sdk\\EndpointService", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "client", + "type": "Fleetbase\\Sdk\\HttpClient", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "createServiceRate", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "deleteServiceRate", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "queryServiceRates", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "retrieveServiceRate", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "updateServiceRate", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Services\\TrackingNumberService": { + "final": false, + "parent": "Fleetbase\\Sdk\\EndpointService", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "client", + "type": "Fleetbase\\Sdk\\HttpClient", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "createTrackingNumber", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "decodeTrackingNumberQr", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "deleteTrackingNumber", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "queryTrackingNumbers", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "retrieveTrackingNumber", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Services\\TrackingStatusService": { + "final": false, + "parent": "Fleetbase\\Sdk\\EndpointService", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "client", + "type": "Fleetbase\\Sdk\\HttpClient", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "createTrackingStatus", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "deleteTrackingStatus", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "queryTrackingStatuses", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "retrieveTrackingStatus", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "updateTrackingStatus", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Services\\VehicleService": { + "final": false, + "parent": "Fleetbase\\Sdk\\EndpointService", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "client", + "type": "Fleetbase\\Sdk\\HttpClient", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "createVehicle", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "deleteVehicle", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "queryVehicles", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "retrieveVehicle", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "trackVehicle", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "updateVehicle", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Services\\VendorService": { + "final": false, + "parent": "Fleetbase\\Sdk\\EndpointService", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "client", + "type": "Fleetbase\\Sdk\\HttpClient", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "createVendor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "deleteVendor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "queryVendors", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "retrieveVendor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "updateVendor", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Services\\WorkOrderService": { + "final": false, + "parent": "Fleetbase\\Sdk\\EndpointService", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "client", + "type": "Fleetbase\\Sdk\\HttpClient", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "createWorkOrder", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "deleteWorkOrder", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "queryWorkOrders", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "retrieveWorkOrder", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "sendWorkOrder", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "updateWorkOrder", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Services\\ZoneService": { + "final": false, + "parent": "Fleetbase\\Sdk\\EndpointService", + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "__construct", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "client", + "type": "Fleetbase\\Sdk\\HttpClient", + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "createZone", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "deleteZone", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "queryZones", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "retrieveZone", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + }, + { + "name": "updateZone", + "visibility": "public", + "static": false, + "return_type": null, + "parameters": [ + { + "name": "parameters", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + }, + { + "name": "options", + "type": "array", + "by_reference": false, + "variadic": false, + "optional": true, + "default": [] + } + ] + } + ] + }, + "Fleetbase\\Sdk\\Utils": { + "final": false, + "parent": null, + "interfaces": [], + "constants": [], + "properties": [], + "methods": [ + { + "name": "classify", + "visibility": "public", + "static": true, + "return_type": null, + "parameters": [ + { + "name": "string", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + } + ] + }, + { + "name": "createNamespace", + "visibility": "public", + "static": true, + "return_type": null, + "parameters": [ + { + "name": "namespace", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + } + ] + }, + { + "name": "dd", + "visibility": "public", + "static": true, + "return_type": null, + "parameters": [] + }, + { + "name": "get", + "visibility": "public", + "static": true, + "return_type": null, + "parameters": [ + { + "name": "target", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "key", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + }, + { + "name": "default", + "type": null, + "by_reference": false, + "variadic": false, + "optional": true, + "default": null + } + ] + }, + { + "name": "pluralize", + "visibility": "public", + "static": true, + "return_type": null, + "parameters": [ + { + "name": "string", + "type": "string", + "by_reference": false, + "variadic": false, + "optional": false + } + ] + }, + { + "name": "value", + "visibility": "public", + "static": true, + "return_type": null, + "parameters": [ + { + "name": "value", + "type": null, + "by_reference": false, + "variadic": false, + "optional": false + } + ] + } + ] + } + }, + "runtime_properties": { + "Fleetbase\\Sdk\\Fleetbase": [ + "chatChannels", + "client", + "comments", + "contacts", + "customers", + "devices", + "drivers", + "entities", + "equipment", + "files", + "fleets", + "fuelReports", + "fuelTransactions", + "geofences", + "issues", + "labels", + "manifests", + "onboard", + "orchestrator", + "orderConfigs", + "orders", + "organizations", + "parts", + "payloads", + "places", + "purchaseRates", + "sensors", + "serviceAreas", + "serviceQuotes", + "serviceRates", + "trackingNumbers", + "trackingStatuses", + "vehicles", + "vendors", + "workOrders", + "zones" + ] + } +} diff --git a/contracts/service-map.json b/contracts/service-map.json new file mode 100644 index 0000000..a4f7e2a --- /dev/null +++ b/contracts/service-map.json @@ -0,0 +1,188 @@ +{ + "schema_version": 1, + "generated_from": { + "repository": "https://github.com/fleetbase/postman", + "ref": "43253dbf87e5030d95d12be019dc26fcb7151ed6", + "collections": [ + "Fleetbase API", + "Fleetbase Core API" + ] + }, + "groups": { + "Chat Channels": { + "service": "Fleetbase\\Sdk\\Services\\ChatChannelService", + "trait": "Fleetbase\\Sdk\\Services\\Concerns\\ChatChannelServiceEndpoints", + "requests": 11 + }, + "Comments": { + "service": "Fleetbase\\Sdk\\Services\\CommentService", + "trait": "Fleetbase\\Sdk\\Services\\Concerns\\CommentServiceEndpoints", + "requests": 5 + }, + "Contacts": { + "service": "Fleetbase\\Sdk\\Services\\ContactService", + "trait": "Fleetbase\\Sdk\\Services\\Concerns\\ContactServiceEndpoints", + "requests": 5 + }, + "Customers": { + "service": "Fleetbase\\Sdk\\Services\\CustomerService", + "trait": "Fleetbase\\Sdk\\Services\\Concerns\\CustomerServiceEndpoints", + "requests": 16 + }, + "Devices": { + "service": "Fleetbase\\Sdk\\Services\\DeviceService", + "trait": "Fleetbase\\Sdk\\Services\\Concerns\\DeviceServiceEndpoints", + "requests": 7 + }, + "Drivers": { + "service": "Fleetbase\\Sdk\\Services\\DriverService", + "trait": "Fleetbase\\Sdk\\Services\\Concerns\\DriverServiceEndpoints", + "requests": 20 + }, + "Entities": { + "service": "Fleetbase\\Sdk\\Services\\EntityService", + "trait": "Fleetbase\\Sdk\\Services\\Concerns\\EntityServiceEndpoints", + "requests": 5 + }, + "Equipment": { + "service": "Fleetbase\\Sdk\\Services\\EquipmentService", + "trait": "Fleetbase\\Sdk\\Services\\Concerns\\EquipmentServiceEndpoints", + "requests": 5 + }, + "Files": { + "service": "Fleetbase\\Sdk\\Services\\FileService", + "trait": "Fleetbase\\Sdk\\Services\\Concerns\\FileServiceEndpoints", + "requests": 7 + }, + "Fleets": { + "service": "Fleetbase\\Sdk\\Services\\FleetService", + "trait": "Fleetbase\\Sdk\\Services\\Concerns\\FleetServiceEndpoints", + "requests": 5 + }, + "Fuel Reports": { + "service": "Fleetbase\\Sdk\\Services\\FuelReportService", + "trait": "Fleetbase\\Sdk\\Services\\Concerns\\FuelReportServiceEndpoints", + "requests": 5 + }, + "Fuel Transactions": { + "service": "Fleetbase\\Sdk\\Services\\FuelTransactionService", + "trait": "Fleetbase\\Sdk\\Services\\Concerns\\FuelTransactionServiceEndpoints", + "requests": 9 + }, + "Geofences": { + "service": "Fleetbase\\Sdk\\Services\\GeofenceService", + "trait": "Fleetbase\\Sdk\\Services\\Concerns\\GeofenceServiceEndpoints", + "requests": 4 + }, + "Issues": { + "service": "Fleetbase\\Sdk\\Services\\IssueService", + "trait": "Fleetbase\\Sdk\\Services\\Concerns\\IssueServiceEndpoints", + "requests": 5 + }, + "Labels": { + "service": "Fleetbase\\Sdk\\Services\\LabelService", + "trait": "Fleetbase\\Sdk\\Services\\Concerns\\LabelServiceEndpoints", + "requests": 1 + }, + "Manifests": { + "service": "Fleetbase\\Sdk\\Services\\ManifestService", + "trait": "Fleetbase\\Sdk\\Services\\Concerns\\ManifestServiceEndpoints", + "requests": 3 + }, + "Onboard": { + "service": "Fleetbase\\Sdk\\Services\\OnboardService", + "trait": "Fleetbase\\Sdk\\Services\\Concerns\\OnboardServiceEndpoints", + "requests": 1 + }, + "Orchestrator": { + "service": "Fleetbase\\Sdk\\Services\\OrchestratorService", + "trait": "Fleetbase\\Sdk\\Services\\Concerns\\OrchestratorServiceEndpoints", + "requests": 2 + }, + "Order Configs": { + "service": "Fleetbase\\Sdk\\Services\\OrderConfigService", + "trait": "Fleetbase\\Sdk\\Services\\Concerns\\OrderConfigServiceEndpoints", + "requests": 2 + }, + "Orders": { + "service": "Fleetbase\\Sdk\\Services\\OrderService", + "trait": "Fleetbase\\Sdk\\Services\\Concerns\\OrderServiceEndpoints", + "requests": 30 + }, + "Organizations": { + "service": "Fleetbase\\Sdk\\Services\\OrganizationService", + "trait": "Fleetbase\\Sdk\\Services\\Concerns\\OrganizationServiceEndpoints", + "requests": 2 + }, + "Parts": { + "service": "Fleetbase\\Sdk\\Services\\PartService", + "trait": "Fleetbase\\Sdk\\Services\\Concerns\\PartServiceEndpoints", + "requests": 5 + }, + "Payloads": { + "service": "Fleetbase\\Sdk\\Services\\PayloadService", + "trait": "Fleetbase\\Sdk\\Services\\Concerns\\PayloadServiceEndpoints", + "requests": 5 + }, + "Places": { + "service": "Fleetbase\\Sdk\\Services\\PlaceService", + "trait": "Fleetbase\\Sdk\\Services\\Concerns\\PlaceServiceEndpoints", + "requests": 7 + }, + "Purchase Rates": { + "service": "Fleetbase\\Sdk\\Services\\PurchaseRateService", + "trait": "Fleetbase\\Sdk\\Services\\Concerns\\PurchaseRateServiceEndpoints", + "requests": 3 + }, + "Sensors": { + "service": "Fleetbase\\Sdk\\Services\\SensorService", + "trait": "Fleetbase\\Sdk\\Services\\Concerns\\SensorServiceEndpoints", + "requests": 5 + }, + "Service Areas": { + "service": "Fleetbase\\Sdk\\Services\\ServiceAreaService", + "trait": "Fleetbase\\Sdk\\Services\\Concerns\\ServiceAreaServiceEndpoints", + "requests": 5 + }, + "Service Quotes": { + "service": "Fleetbase\\Sdk\\Services\\ServiceQuoteService", + "trait": "Fleetbase\\Sdk\\Services\\Concerns\\ServiceQuoteServiceEndpoints", + "requests": 2 + }, + "Service Rates": { + "service": "Fleetbase\\Sdk\\Services\\ServiceRateService", + "trait": "Fleetbase\\Sdk\\Services\\Concerns\\ServiceRateServiceEndpoints", + "requests": 5 + }, + "Tracking Numbers": { + "service": "Fleetbase\\Sdk\\Services\\TrackingNumberService", + "trait": "Fleetbase\\Sdk\\Services\\Concerns\\TrackingNumberServiceEndpoints", + "requests": 5 + }, + "Tracking Statuses": { + "service": "Fleetbase\\Sdk\\Services\\TrackingStatusService", + "trait": "Fleetbase\\Sdk\\Services\\Concerns\\TrackingStatusServiceEndpoints", + "requests": 5 + }, + "Vehicles": { + "service": "Fleetbase\\Sdk\\Services\\VehicleService", + "trait": "Fleetbase\\Sdk\\Services\\Concerns\\VehicleServiceEndpoints", + "requests": 6 + }, + "Vendors": { + "service": "Fleetbase\\Sdk\\Services\\VendorService", + "trait": "Fleetbase\\Sdk\\Services\\Concerns\\VendorServiceEndpoints", + "requests": 5 + }, + "Work Orders": { + "service": "Fleetbase\\Sdk\\Services\\WorkOrderService", + "trait": "Fleetbase\\Sdk\\Services\\Concerns\\WorkOrderServiceEndpoints", + "requests": 6 + }, + "Zones": { + "service": "Fleetbase\\Sdk\\Services\\ZoneService", + "trait": "Fleetbase\\Sdk\\Services\\Concerns\\ZoneServiceEndpoints", + "requests": 5 + } + } +} diff --git a/docs/MODERNIZATION_PLAN.md b/docs/MODERNIZATION_PLAN.md new file mode 100644 index 0000000..5703fda --- /dev/null +++ b/docs/MODERNIZATION_PLAN.md @@ -0,0 +1,459 @@ +# Fleetbase PHP SDK v1.1.0 Modernization Plan + +Status: proposed for maintainer review + +Prepared: 2026-08-31 + +Target: a backwards-compatible `1.1.0` release, followed by an optional `2.0.0` cleanup only after a documented deprecation window + +## Executive summary + +The current SDK is a 2022 prototype rather than a production-ready client library. It has no repository CI or release automation, vendors 4,394 dependency files, supports PHP 7.4 but excludes every PHP 8 release through its Composer constraint, performs destructive integration tests against a live API, and exposes only a fraction of the current Fleetbase API. The modernization will also move the project from MIT to `AGPL-3.0-or-later`, matching current Fleetbase Core API and Fleet-Ops licensing. + +The official merged Postman collections currently define 220 requests across 36 collection groups: + +- Fleetbase API: 196 requests (`75 GET`, `70 POST`, `22 PUT`, `6 PATCH`, `23 DELETE`) across 32 groups. +- Fleetbase Core API: 24 requests (`9 GET`, `7 POST`, `3 PUT`, `5 DELETE`) across 4 groups. + +By comparison, the SDK exposes 12 top-level stores and 14 resource classes. Its sole specialized service, `OrderService`, cannot execute because it accesses private members of its parent class. The modernization must therefore rebuild the internals, preserve the existing public entry points, add the complete documented contract, and establish repeatable quality and release gates. + +This plan treats the Postman Native Git collections as the public contract inventory and uses Core API and Fleet-Ops routes, controllers, request validation, and resources to verify behavior. No SDK method should be invented from a route name alone. + +## Evidence reviewed + +### SDK baseline + +- Repository: `fleetbase/fleetbase-php` +- Default branch: `master` +- Required compatibility baseline: `569fe88` / `1.0.2` +- Latest published tag after refreshing official refs: `97dabc5` / `1.0.3` +- Baseline commit date: 2022-01-03 +- The 1.0.3 delta adds order actions that are also part of the compatibility surface; it changes the second `OrderService::getDistanceAndTime()` argument and contains malformed QR/signature path expressions, so callability and corrected behavior both require regression tests. +- Production source and tests: 1,307 lines across 25 PHP files +- Tracked dependencies: 4,394 files under `vendor/` +- CI/release configuration: none +- Local checks on PHP 8.2.10: + - syntax lint: pass + - Composer validation: pass + - PSR-12: fail with 23 errors and 1 warning + - PHPStan 0.11.20: fail with 28 errors and PHP 8.2 deprecations + - PHPUnit: intentionally not run because the suite reads a local API key and creates, updates, and deletes live resources + - Composer audit: not completed because the sandbox could not reach Packagist; this remains a required first implementation check + - GitHub dependency baseline reported during the branch push: 21 known vulnerabilities on the default branch (`8 high`, `13 moderate`) + +### Contract sources + +The inventory was taken from the merged/default branches at these exact local references: + +- `fleetbase/postman` `origin/main` at `43253dbf87e5030d95d12be019dc26fcb7151ed6` +- `fleetbase/core-api` `origin/main` at `b7691c06ffdfe8f8874352e746aa8e523d5e3531` (`v1.6.60`) +- `fleetbase/fleetops` `origin/main` at `a9131daeb1a23ed4b0046dd2d7b632fb100bfba0` (`v0.6.61`) + +Public sources: + +- [Fleetbase Postman collections](https://github.com/fleetbase/postman) +- [Fleetbase Core API](https://github.com/fleetbase/core-api) +- [Fleet-Ops](https://github.com/fleetbase/fleetops) +- [Fleetbase API reference](https://fleetbase.io/docs/api) +- [Composer library guidance](https://getcomposer.org/doc/02-libraries.md) +- [Packagist publishing and update hooks](https://packagist.org/about) +- [PHPUnit coverage metrics](https://docs.phpunit.de/en/13.4/code-coverage.html) + +The API reference generator already maps PHP SDK examples for only 13 Fleetbase stores and falls back to raw HTTP elsewhere. Core API has no PHP SDK mapping. Completion of this plan must also update that generator so published examples represent real SDK methods. + +## Findings and feedback + +### 1. Public API and runtime defects + +The current public shape must be captured before refactoring, but known defects must not be enshrined as correct behavior. + +- `composer.json` requires `php: ^7.4`, which means `>=7.4 <8.0`; the README claim of “PHP 7.4 and later” is incorrect. +- `Fleetbase` assigns undeclared properties such as `$places` and `$orders`. These are dynamic properties and are deprecated on PHP 8.2. +- API-key validation can never reject an empty key because the constructor type already guarantees a string and the condition uses `&&` with `!is_string()`. +- `setApiKey()` creates a new client but silently loses the existing host, namespace, version, and debug configuration. +- `trackingStatuses` is configured with `TrackingStatues`, causing resource resolution to target a class that does not exist. +- Every concrete resource declares `__constructor()` rather than `__construct()`. These methods never run. +- `OrderService` calls the private `Service::uri()` method and reads the private `$client` property. +- `Order` reads the private `Resource::$service` property. +- `Resource::create()` builds request hooks and then discards them by passing `[]` to the service. +- `Resource::save()` discards its `$options` argument. +- Resource dirty state, changes, lifecycle flags, reload behavior, and flag setter exist only as unused fields or empty methods. +- `HttpClient` invokes `onBefore` after the network request. +- HTTP failures are detected only when a decoded object has an `error` property. Status codes, validation envelopes, malformed JSON, empty bodies, transport failures, and response metadata are not modeled safely. +- `getLastResponse()` is typed as Guzzle's concrete response while Guzzle returns the PSR response interface. +- List/query handling supports only a bare JSON array and does not defensively recognize common response envelopes. Fleetbase API v1 does not define an SDK pagination contract. +- File upload/download, multipart bodies, streams, custom headers, idempotency keys, retries, timeouts, and cancellation are unsupported. +- URL and namespace configuration is insufficient for self-hosted installations with path prefixes. + +### 2. Contract completeness gap + +The SDK exposes these stores today: + +`orders`, `entities`, `places`, `drivers`, `vehicles`, `vendors`, `contacts`, `serviceAreas`, `zones`, `trackingStatuses`, `serviceRates`, and `serviceQuotes`. + +The Postman Fleetbase collection also covers customers, devices, equipment, fleets, fuel reports, fuel transactions, geofences, issues, labels, manifests, onboarding, orchestrator operations, order configs, organizations, parts, payloads, purchase rates, sensors, tracking numbers, work orders, and numerous resource-specific actions. The Core collection adds chat channels, comments, files, and current-organization operations. + +Even existing stores are incomplete. Orders alone have 30 documented requests, including dispatch, start, cancel, activity, destination, signature, QR, route, proof, schedule, and related-resource operations. A generic CRUD service cannot represent these actions clearly or safely. + +### 3. Test and quality risks + +- Only two test classes exist. +- Tests instantiate the real client using `.env.test` and mutate API state. +- There are no mock transport tests, exception-path tests, serialization tests, list-response tests, compatibility tests, or contract tests. +- The suite does not produce trustworthy coverage evidence for the current source. +- PHPUnit 8 and PHPStan 0.11 are obsolete. +- The PHPUnit configuration uses the removed `filter/whitelist` schema. +- No test verifies installation from a clean Composer consumer project. +- No test protects the existing public class names, constructor signatures, dynamic store access, resource methods, or return shapes. + +### 4. Package and repository hygiene + +- `vendor/`, `.env.test`, and `.phpunit.result.cache` are committed. +- The published archive therefore carries development dependencies and local test configuration. +- README links point to missing or stale files and services, including Travis CI and `master`-based badges. +- README badges do not represent current CI, coverage, PHP support, branch naming, or license status. +- There is no `SECURITY.md`, `CONTRIBUTING.md`, code of conduct, support policy, issue template, PR template, funding/config metadata, or Dependabot/Renovate setup at the repository level. +- `CHANGELOG.md` does not provide a reliable release history or migration guidance. +- There are no `.gitattributes` export rules, so package archives are not intentionally minimized. +- The repository and Composer metadata currently declare MIT; the requested move to AGPL v3 must be applied consistently and must not misrepresent the terms of already-published releases. + +### 5. Release and supply-chain gaps + +- Releases are hand-tagged with no automated validation. +- There is no proof that the tag matches a reviewed commit. +- There is no automated GitHub Release, changelog generation, SBOM, provenance/attestation, or Packagist sync verification. +- There is no dependency vulnerability scan, dependency review, CodeQL, secret scan, or pinned-action policy. +- There are no branch protections or required checks represented in repository files; repository settings must be audited separately by an administrator. + +## Compatibility policy + +### v1.1.0 promise + +`1.1.0` will preserve these existing consumer entry points: + +- namespace `Fleetbase\Sdk` +- `new Fleetbase(string $publicKey, array $config = [], bool $debug = false)` +- existing top-level store property names +- `Fleetbase::newInstance()`, `setApiKey()`, `getVersion()`, and `getOptions()` +- `HttpClient` verb methods and host/namespace accessors +- generic `Service` CRUD/query method names +- `Resource` lifecycle and attribute method names +- all existing resource class names + +The implementation may correct behavior that is demonstrably unusable, such as inaccessible private members and misspelled constructors. Each correction must have a regression test and a changelog entry. New return or parameter types must not make subclassing more restrictive in the `1.x` line. + +### Compatibility verification + +Before changing production code: + +1. Generate a reflection-based API snapshot of every public/protected class, method, property, signature, and default value at `1.0.2`. +2. Add characterization tests for observable `1.0.2` behavior that consumers could reasonably depend on. +3. Add a backwards-compatibility checker against the latest stable tag. +4. Run real fixture applications using the old README examples and representative subclass/injected-client cases. +5. Classify every compatibility difference as additive, bug fix, deprecation, or breaking change. + +Any unavoidable breaking change moves to `2.0.0`; it must not be hidden in `1.1.0`. + +### PHP support + +The preferred bridge constraint is `^7.4 || ^8.0`, verified on PHP 7.4, 8.0, 8.1, 8.2, 8.3, 8.4, and 8.5 with both lowest and highest dependency sets. This widens actual compatibility without immediately abandoning installed 1.0 consumers. + +PHP 7.4 and 8.0 are end-of-life. They should receive compatibility testing only, with an explicit support notice that production users must run a security-supported PHP version. A later `2.0.0` may set the runtime floor to the oldest security-supported PHP version after usage and framework compatibility are reviewed. + +## Target architecture + +### Stable facade + +Keep `Fleetbase` as the backwards-compatible facade. Declare all existing stores explicitly and add the missing stores with documented types. A registry/lazy resolver may construct services internally, but property names must remain stable. + +Add explicit accessors alongside property access so static analysis and dependency injection work without magic: + +```php +$fleetbase->places; +$fleetbase->places(); +``` + +The first form preserves compatibility; the second is the preferred modern API. + +### Transport boundary + +Split request construction, transport, response decoding, and error mapping. + +- Depend on PSR-18 (`psr/http-client`) and PSR-7 request/stream factories at the boundary. +- Keep Guzzle as the zero-configuration default and preserve `HttpClient` as the compatibility adapter. +- Allow injected PSR-18 clients so Symfony HttpClient, Laravel-managed Guzzle clients, HTTPlug-compatible transports, and test doubles can be used. +- Introduce immutable client configuration for base URI, namespace/version, API key, user agent, timeouts, retry policy, headers, debug behavior, and idempotency keys. +- Preserve self-hosted path prefixes and normalize slashes without altering URLs. +- Provide JSON, query, form, multipart, stream, and download request modes. +- Expose response status, headers, request ID, and raw PSR response when needed. + +### Error model + +Introduce a `FleetbaseException` hierarchy while keeping the existing base exception catchable: + +- authentication/authorization +- validation, including field errors +- not found/conflict/rate limit +- server response +- transport/timeout +- decoding/unexpected response + +Exceptions should retain status, Fleetbase error code/message, validation details, request ID, method, sanitized URL, and the previous exception. They must never include API keys or sensitive payload values in messages. + +### Services and resources + +Use a common typed service for standard CRUD/query behavior and dedicated services for every custom endpoint. Keep resources lightweight and predictable: + +- immutable response snapshot plus controlled local changes +- nested object/array hydration without lossy casts +- `ArrayAccess`, `JsonSerializable`, and explicit `toArray()` only if added without changing legacy attribute access +- correct dirty/change tracking +- save, reload, and destroy state transitions +- stable access to the owning service +- defensive list-response hydration that preserves the legacy array return without inventing SDK-side pagination + +Avoid generating opaque magic methods from endpoint names. A checked-in contract manifest may be generated from Postman, but human-reviewed service methods should define the public SDK experience. + +### Endpoint coverage model + +Create `docs/api-coverage.md` as a machine-checkable matrix with one row for every Postman request: + +| Field | Purpose | +|---|---| +| Collection/ref | exact source commit | +| Group and request | stable contract identity | +| Method and path | transport contract | +| Authentication | API key, driver/customer token, or special flow | +| SDK service/action | public PHP entry point | +| Request fixture | validated happy-path input | +| Response fixture | success hydration shape | +| Error fixtures | 401/403/404/422/429/5xx as applicable | +| Unit test | deterministic transport/serialization test | +| Contract test | live implementation verification | +| Status | missing, partial, complete, or intentionally raw-only | + +Completion means every one of the 220 requests is mapped to a first-class method or has an explicitly approved raw-transport rationale. “The generic client can technically call it” is not sufficient for a documented resource action. + +## Implementation workstreams + +### Phase 0 — freeze and baseline + +Deliverables: + +- Record the exact Postman, Core API, and Fleet-Ops refs in a contract lock file. +- Capture the `1.0.2` public API snapshot and behavioral characterization suite. +- Add Architecture Decision Records for PHP support, PSR transport, list responses/resources, endpoint generation, exceptions, and release automation. +- Audit Packagist ownership, auto-update status, download metadata, and the unpublished/visible contents of `1.0.2`. +- Audit repository administrators, branch protection, environments, secrets, webhooks, and signing policy without exposing secret values. +- Confirm Fleetbase has the rights required to relicense all existing SDK code and record the effective release; previously published MIT tags remain under their original license. +- Decide whether the existing `.env.test` value was ever real; if so, rotate it outside the repository work and purge it from history in a separately approved security operation. + +Exit gate: the public surface and release infrastructure are documented, secrets risk is resolved, and the contract refs are reproducible. + +### Phase 1 — repository and toolchain hygiene + +Deliverables: + +- Remove tracked `vendor/`, `.env.test`, and PHPUnit cache files from the next commit and cover them in `.gitignore`/`.gitattributes`. +- Retain `composer.lock` for reproducible contributor tooling, but exclude it from distribution archives if the maintainer adopts that library policy. +- Refresh Composer metadata: precise description, minimum-stability policy, `prefer-stable`, funding/support links, autoload exclusions, and a platform/config policy. +- Replace the MIT license with the canonical GNU Affero General Public License v3 text, set Composer's SPDX identifier to `AGPL-3.0-or-later`, update source headers/notices and documentation, and verify GitHub and Packagist detect the new license on the release branch/tag. +- Upgrade PHPUnit, PHPStan, coding standard tooling, Mockery if retained, and coverage dependencies using PHP-version-specific dev resolution where necessary. +- Add PHP-CS-Fixer or a maintained PSR-12 rule set, EditorConfig, static-analysis config, and Composer scripts with consistent names. +- Add `SECURITY.md`, `CONTRIBUTING.md`, `CODE_OF_CONDUCT.md`, support policy, templates, and a current README. Replace stale Travis/`master` badges with verified badges for current CI, coverage, PHP support, Packagist release/downloads, and `AGPL-3.0-or-later`; every badge must link to its authoritative report or package page. +- Add Dependabot or Renovate for Composer and GitHub Actions. + +Exit gate: a fresh clone installs with Composer, contains no vendored dependencies or secrets, and all local non-network checks are green. + +### Phase 2 — transport and compatibility foundation + +Deliverables: + +- Introduce configuration, request builder, PSR transport adapter, response decoder, error mapper, and sanitized diagnostics. +- Reimplement the existing `HttpClient` API on the new internals. +- Declare existing facade properties and correct resource construction without changing consumer names. +- Add raw `request()` escape hatch for forward compatibility. +- Support injected PSR-18 clients plus default Guzzle. +- Correct hooks with a documented order and preserve legacy hook names. +- Add retries only for safe/idempotent requests or requests carrying an idempotency key; honor `Retry-After` and make retry policy opt-in/configurable. + +Exit gate: old examples and characterization fixtures pass on all supported PHP versions, and transport/error tests cover every branch. + +### Phase 3 — standard resource completion + +Implement and test standard CRUD/query services for all public collection groups, including the currently missing groups. Add filtering, sorting, includes, sparse fields where supported, and resource hydration based on actual response resources. Do not add an SDK pagination abstraction until the API exposes a verified pagination contract. + +Suggested batches: + +1. Existing surface: places, service areas, zones, contacts, vendors, vehicles, drivers, orders, entities, service rates, service quotes, tracking statuses. +2. Existing models not exposed: payloads and waypoints. +3. Fleet operations: fleets, equipment, fuel reports, fuel transactions, issues, manifests, parts, purchase rates, sensors, tracking numbers, work orders. +4. Identity/organization: customers, devices, organizations, onboarding. +5. Core collaboration: comments, files, and chat channels. + +Exit gate: every standard request is present in the coverage matrix and has deterministic success/error tests. + +### Phase 4 — custom action completion + +Implement specialized methods for non-CRUD operations, using Postman names and server behavior as the traceability keys. This includes, but is not limited to: + +- Orders: dispatch, start, cancel, activity transitions, next activity, destination, route/distance, schedule, proofs, QR/signature capture, and related resources. +- Drivers/customers: authentication flows, verification, password reset/change, device registration, organization switching, online/track actions, customer orders and places. +- Devices/vehicles/vendors: attach/detach, assignments, and status/action endpoints. +- Fuel transactions/reports, geofence reporting, manifests, labels, tracking numbers, work orders, service quotes, orchestrator, and onboarding actions. +- Core files: multipart upload, base64 upload, metadata update, download/stream, and delete. +- Core chat/comments: participants, messages, read/delete actions, subject queries, and lifecycle operations. + +Use explicit request DTOs only where they improve validation and discovery without preventing array-based legacy calls. Continue accepting arrays in the `1.x` line. + +Exit gate: all 220 Postman requests have an approved mapping and the public docs generator emits valid PHP samples for each supported method. + +### Phase 5 — documentation and framework integration + +Deliverables: + +- Rewrite README quick start, configuration, self-hosted base URL, error handling, list/query behavior, uploads/downloads, retries, debugging, and migration sections. +- Document the license change prominently in the README, changelog, migration guide, release notes, Composer metadata, and GitHub Release so downstream users can assess AGPL obligations before upgrading. +- Add framework recipes for plain PHP, Laravel container/service provider configuration, Symfony service configuration, and generic PSR-11/PSR-18 applications without forcing framework dependencies. +- Verify Composer 2.2 LTS/current installation, prefer-lowest/current dependency resolution, Packagist dist installation, Git VCS installation, and optimized/no-dev autoloading. +- Add PHP SDK mappings to the Fleetbase API reference generator for Core and every newly supported store/action in a coordinated `fleetbase/fleetbase.io` PR. +- Correct public claims that the SDK already has typed access to all core resources until the matrix is complete. + +Exit gate: every documented snippet is executed in CI and the generated Fleetbase API reference contains no stale or fictional PHP call. + +### Phase 6 — CI, security, and release automation + +Required workflows, with third-party actions pinned to reviewed commit SHAs: + +#### Pull request CI + +- Composer strict validation and lock consistency. +- PHP syntax and coding-standard checks. +- PHPStan at max level with no ignored baseline growth. +- Unit/fixture tests on PHP 7.4–8.5. +- lowest-supported and latest-compatible dependency jobs. +- 100% line coverage and 100% branch coverage using Xdebug on the designated coverage runtime. +- mutation testing threshold for behavior quality; surviving mutations require review even when line coverage is 100%. +- backwards-compatibility comparison against the latest stable tag. +- clean consumer installs for plain PHP, Laravel, and Symfony fixture applications. +- dependency review, Composer audit, CodeQL, secret scanning, and license checks. +- built archive inspection proving excluded files are absent. + +#### Contract CI + +- Opt-in/integration workflow against an ephemeral Fleetbase stack pinned to the contract refs. +- Run the official Fleetbase and Core Postman collections first to prove the server fixture. +- Run SDK contract cases against the same stack. +- Never use production credentials or mutate a shared environment. +- Scheduled contract-drift job compares the locked Postman manifest to current `main` and opens an issue or PR when requests change. + +#### Release workflow + +- Use a protected GitHub `release` environment with maintainer approval. +- Accept an explicit semantic version and verify it is greater than the latest tag. +- Require the release commit to be on `main`, the worktree to be clean, all required checks to be successful, and the changelog/version notes to match. +- Re-run the authoritative test, coverage, compatibility, archive, and security gates. +- Create the tag and GitHub Release from the reviewed commit; do not publish from an arbitrary branch. +- Attach checksums, SBOM, coverage summary, API coverage matrix, and provenance/attestation where GitHub supports the artifact type. +- Let Packagist derive the version from the VCS tag; verify the Packagist GitHub hook updates the package and that a clean consumer can install the exact version. +- If post-publication verification fails, mark the release and publish a corrective version; never move or overwrite a published tag. + +Exit gate: a dry-run release candidate completes without secrets in logs, and a maintainer-approved `1.1.0` release installs from Packagist into clean fixture applications. + +### Phase 7 — default branch migration + +The branch rename is a repository administration operation and should occur only after workflows and documentation are prepared. + +1. Create `main` at the reviewed `master` head. +2. Update workflow triggers, branch protections, required checks, release rules, CodeQL/default setup, Dependabot, badges, links, templates, API docs, Packagist metadata, and external integrations to `main`. +3. Change the GitHub default branch to `main`. +4. Verify new clones, PR targets, GitHub Pages/docs, Packagist, and release automation. +5. Publish local-clone migration commands in the release notes. +6. Keep `master` temporarily protected and non-writable if external consumers need a transition period, then remove it only after confirming no required integration still targets it. + +Exit gate: GitHub reports `main` as default, all required checks run on it, Packagist resolves `dev-main`, and no maintained link or workflow targets `master`. + +## Test strategy and definition of 100% + +“100% test coverage” means all of the following, not just a badge: + +- 100% executable line coverage over `src/`. +- 100% branch coverage over `src/` using Xdebug. +- Every public method has success, validation/error, and boundary tests appropriate to its behavior. +- Every transport verb/body mode is tested for request method, URL, headers, sanitized authentication, query/body encoding, and response decoding. +- Every exception type is tested with representative server and transport failures. +- Every resource lifecycle transition is tested. +- Every Postman request has a coverage-matrix entry and a deterministic fixture test. +- Contract tests exercise representative happy and failure paths against an isolated real API; destructive workflows clean up their own fixtures. +- Mutation testing prevents assertion-free execution from satisfying the numeric target. +- Coverage is generated fresh in CI, uploaded as Clover/XML plus human-readable summary, and enforced with a hard failure below 100.00%. + +Recommended layers: + +1. Unit tests with PSR/Guzzle mock transports: fast, hermetic, exhaustive. +2. Serialization/hydration golden fixtures derived from sanitized official examples. +3. Consumer compatibility fixtures for old usage and framework integration. +4. Isolated integration tests against a disposable Fleetbase stack. +5. Official Postman contract run as the server-side prerequisite and drift oracle. + +## Pull request and delivery structure + +Do not implement this as one unreviewable rewrite. Use the release branch as the integration target and land bounded PRs in this order: + +1. Baseline, compatibility snapshot, and repository hygiene. +2. CI/toolchain with the old implementation still characterized. +3. Transport/configuration/error internals behind the legacy facade. +4. Existing service/resource parity. +5. Missing standard resources in small domain batches. +6. Custom actions in small domain batches. +7. Core collaboration/files and multipart/streaming support. +8. Docs, examples, framework fixtures, and API-reference coordination. +9. Release automation, release candidate, and Packagist verification. +10. Default-branch migration. + +Every implementation PR must include: + +- contract source/ref and endpoints affected +- compatibility classification +- tests and fresh coverage evidence +- static analysis/coding-standard result +- API coverage matrix delta +- documentation impact +- security/credential impact +- exact validation commands and known limits + +## Release acceptance checklist + +`1.1.0` is ready only when: + +- [ ] All 220 official Postman requests are mapped or explicitly approved as raw-only. +- [ ] All existing public entry points pass the compatibility suite. +- [ ] PHP 7.4–8.5 and lowest/latest dependency jobs pass. +- [ ] Line and branch coverage are both 100% with fresh CI artifacts. +- [ ] Mutation results meet the approved threshold with no unexplained survivors in critical transport/auth/error code. +- [ ] PHPStan max and coding standards pass without a growing baseline. +- [ ] Official Postman and SDK contract suites pass against the same disposable stack. +- [ ] Plain PHP, Laravel, and Symfony fixture installs pass from the built archive. +- [ ] Composer audit, dependency review, CodeQL, secret scan, and license checks pass. +- [ ] The archive contains no `vendor/`, credentials, caches, tests fixtures with secrets, or local paths. +- [ ] README, authoritative badges, changelog, migration guide, API coverage matrix, and generated API examples are current. +- [ ] `LICENSE`, Composer metadata, source notices, GitHub detection, Packagist metadata, and release notes consistently report `AGPL-3.0-or-later`, while old tags retain their original MIT terms. +- [ ] Release automation completes a no-publish dry run. +- [ ] A maintainer approves the protected release environment and the GitHub/Packagist release is verified after publication. +- [ ] `main` is the default branch and all integrations have been verified against it. + +## Decisions requiring maintainer approval + +These choices should be confirmed during Phase 0 before implementation diverges: + +1. Whether `1.1.0` must retain runtime compatibility with end-of-life PHP 7.4/8.0 or whether modernization should be a `2.0.0` release with a supported-PHP floor. +2. Whether the SDK scope is strictly the 220 Fleetbase/Core requests or should also add separate Storefront and Ledger clients. This plan excludes Storefront and Ledger because their collections use distinct prefixes and currently have no PHP SDK mapping. +3. Whether `composer.lock` remains committed for contributor reproducibility; it must not dictate dependency versions for consumers. +4. Whether resource objects remain mutable in `1.x`; this plan preserves mutation and defers any immutable-only API to `2.x`. +5. Required mutation score and whether non-critical compatibility shims may be excluded with written justification. +6. Release signing/attestation policy and who approves the protected release environment. +7. Length of the protected `master` transition period after `main` becomes default. + +## Out of scope for this planning pull request + +This document does not modify production SDK code, dependencies, Git history, repository settings, Packagist settings, credentials, tags, releases, or the default branch. Those changes require the gated implementation work above. In particular, removing a possibly real key from Git history or rotating it must be handled as a separately approved security operation. diff --git a/docs/adr/0001-php-support.md b/docs/adr/0001-php-support.md new file mode 100644 index 0000000..d08047f --- /dev/null +++ b/docs/adr/0001-php-support.md @@ -0,0 +1,18 @@ +# ADR 0001: PHP support policy + +- Status: accepted for v1.1.0 implementation +- Date: 2026-08-31 + +## Context + +Version 1.0.x declares `^7.4`, unintentionally excluding PHP 8. Existing consumers must not be abandoned during a backwards-compatible release, but PHP 7.4 and 8.0 no longer receive upstream security fixes. + +## Decision + +Version 1.1.0 will declare `php: ^7.4 || ^8.0` and test PHP 7.4 through 8.5. CI will resolve both the lowest and current compatible dependency sets. Documentation will distinguish compatibility from security support and recommend a PHP version still supported by php.net. + +Development-only tools that cannot run on every supported runtime may use isolated Composer tool projects. Runtime source will remain syntactically valid on PHP 7.4. + +## Consequences + +Consumers gain PHP 8 compatibility without a major release. Supporting the old runtimes increases CI and dependency-resolution complexity. Raising the runtime floor is deferred to 2.0.0. diff --git a/docs/adr/0002-psr-18-transport.md b/docs/adr/0002-psr-18-transport.md new file mode 100644 index 0000000..c1052d5 --- /dev/null +++ b/docs/adr/0002-psr-18-transport.md @@ -0,0 +1,18 @@ +# ADR 0002: PSR-18 transport boundary + +- Status: accepted for v1.1.0 implementation +- Date: 2026-08-31 + +## Context + +The 1.0.x client constructs Guzzle directly, mixes request building with decoding, and cannot accept framework-managed HTTP clients or deterministic PSR test doubles. + +## Decision + +The internal transport boundary will use PSR-18 plus PSR-7 request and stream factories. Guzzle remains the default zero-configuration implementation. The public `Fleetbase\Sdk\HttpClient` class and its verb methods remain as compatibility adapters, while a public raw `request()` method provides forward compatibility. + +Configuration, request construction, transport, response decoding, and error mapping will be separate components. Configuration will preserve self-hosted path prefixes and sanitize credentials from diagnostics. + +## Consequences + +Laravel, Symfony, HTTPlug-compatible, and custom PSR-18 clients can be injected without framework runtime dependencies. Guzzle-specific behavior is no longer allowed to leak through new APIs, although the legacy facade remains callable. diff --git a/docs/adr/0003-list-responses-and-resources.md b/docs/adr/0003-list-responses-and-resources.md new file mode 100644 index 0000000..d341d17 --- /dev/null +++ b/docs/adr/0003-list-responses-and-resources.md @@ -0,0 +1,19 @@ +# ADR 0003: List responses and mutable resources + +- Status: accepted for v1.1.0 implementation +- Date: 2026-08-31 +- Corrected: 2026-09-02 after maintainer API-contract review + +## Context + +Version 1.0.x returns list responses as arrays and exposes mutable resource objects. Fleetbase API v1 does not define a pagination response contract. Replacing mutable resources in a minor release would break consumers. + +## Decision + +Resources remain mutable in 1.x. Their implementation gains correct dirty/change tracking, lifecycle state, lossless nested hydration, `toArray()`, `JsonSerializable`, and `ArrayAccess` where these additions do not alter legacy access. + +List methods preserve their documented array behavior. The SDK may defensively hydrate recognized `data`, `results`, or `items` envelopes, but it does not expose pagination methods or invent client-side pagination without an API contract. + +## Consequences + +Existing resource and list workflows remain viable without implying unsupported server behavior. An immutable-only resource API, if desired, requires 2.0.0. diff --git a/docs/adr/0004-contract-manifest.md b/docs/adr/0004-contract-manifest.md new file mode 100644 index 0000000..e5de81d --- /dev/null +++ b/docs/adr/0004-contract-manifest.md @@ -0,0 +1,20 @@ +# ADR 0004: Generated endpoint inventory, reviewed SDK methods + +- Status: accepted for v1.1.0 implementation +- Date: 2026-08-31 + +## Context + +The Fleetbase and Core Postman collections define 220 in-scope requests. Hand-maintained endpoint lists drift, while mechanically generated public methods produce poor naming and can encode server quirks without review. + +## Decision + +`contracts/postman-manifest.json` is generated deterministically from the two locked Postman collections. Every row retains its source file, verb, URL, implementation, test references, mapping status, and any approved exception. + +The manifest is the completeness gate, not runtime magic. A deterministic scaffold writes explicit, checked-in service methods so the locked contract can be reproduced, but those names and signatures are reviewed as public API before commit. Contract CI fails on unmapped requests, duplicate identities, count drift, stale source refs, missing implementations, missing tests, or unapproved exceptions. + +Storefront, Ledger, and Integrated Vendor Flow collections are excluded from v1.1.0 because they represent separate product contracts. Their support requires a separately approved scope. + +## Consequences + +The exact 220-request scope is auditable and reproducible. Public methods remain visible to reflection and static analysis, and generator output is treated as reviewable source rather than proof of correctness by itself. diff --git a/docs/adr/0005-exception-hierarchy.md b/docs/adr/0005-exception-hierarchy.md new file mode 100644 index 0000000..d76f606 --- /dev/null +++ b/docs/adr/0005-exception-hierarchy.md @@ -0,0 +1,20 @@ +# ADR 0005: Exception compatibility and diagnostics + +- Status: accepted for v1.1.0 implementation +- Date: 2026-08-31 + +## Context + +Version 1.0.x throws generic exceptions based only on an `error` JSON property. Consumers need typed failures and response context, but existing code may catch `FleetbaseException` or PHP's base `Exception`. + +## Decision + +All SDK failures will extend `Fleetbase\Sdk\FleetbaseException`. Specialized exceptions will cover authentication, authorization, validation, not found, conflict, rate limiting, server response, transport, timeout, decoding, and unexpected responses. + +Exceptions may retain status, Fleetbase code, validation details, request ID, method, sanitized URL, raw response metadata, and previous exceptions. Messages and serialization must never expose authorization headers, API keys, or sensitive request bodies. + +Legacy catch behavior remains valid because the existing base class name is retained and continues to extend `Exception`. + +## Consequences + +Consumers can handle precise failures while broad legacy catches continue to work. Every mapper branch and sanitization path requires deterministic tests. diff --git a/docs/adr/0006-release-automation.md b/docs/adr/0006-release-automation.md new file mode 100644 index 0000000..2c4ba02 --- /dev/null +++ b/docs/adr/0006-release-automation.md @@ -0,0 +1,20 @@ +# ADR 0006: Review-gated release automation + +- Status: accepted for implementation; signing authority pending maintainer approval +- Date: 2026-08-31 + +## Context + +Existing tags are unsigned and releases have no automated validation, provenance, archive inspection, or post-publication installation check. + +## Decision + +Pull requests and release candidates will run the same authoritative quality gates. The release workflow will use a protected GitHub `release` environment, accept an explicit semantic version, require the commit on `main`, verify a clean tree and matching changelog, rebuild all evidence, then create an immutable tag and GitHub Release after maintainer approval. + +Artifacts will include checksums, an SBOM, coverage and API-mapping summaries, and GitHub-supported provenance. Packagist will derive versions from VCS tags; the workflow will verify availability and a clean consumer install. A dry-run mode must execute every step except tag, release, and Packagist publication. + +The signing mechanism and authorized release approvers must be selected by a maintainer before publication. Automation will never rewrite a released tag. + +## Consequences + +Release inputs and outputs become reproducible and reviewable. Publishing remains intentionally human-gated. diff --git a/docs/api-coverage.md b/docs/api-coverage.md new file mode 100644 index 0000000..064fc0b --- /dev/null +++ b/docs/api-coverage.md @@ -0,0 +1,228 @@ +# Fleetbase PHP SDK API coverage + +Generated from the locked Postman contract at `43253dbf87e5030d95d12be019dc26fcb7151ed6`. This matrix contains exactly 220 requests. + +“Mapped” means the public method and deterministic request fixture test exist. Live contract verification remains a separate isolated-stack release gate. + +| Collection / request | Method and path | Authentication | SDK service / action | Request fixture | Response fixture | Error fixture | Deterministic test | Live contract | Status | +|---|---|---|---|---|---|---|---|---|---| +| [Fleetbase API / Create a Contact](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Contacts/Create%20a%20Contact.request.yaml) | `POST {{base_url}}/{{namespace}}/contacts` | fleetbase-api-key | `Fleetbase\Sdk\Services\ContactService::createContact` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Contacts/Create%20a%20Contact.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Contacts/.resources/Create%20a%20Contact.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Delete a Contact](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Contacts/Delete%20a%20Contact.request.yaml) | `DELETE {{base_url}}/{{namespace}}/contacts/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\ContactService::deleteContact` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Contacts/Delete%20a%20Contact.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Contacts/.resources/Delete%20a%20Contact.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Query Contacts](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Contacts/Query%20Contacts.request.yaml) | `GET {{base_url}}/{{namespace}}/contacts` | fleetbase-api-key | `Fleetbase\Sdk\Services\ContactService::queryContacts` | query ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Contacts/Query%20Contacts.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Contacts/.resources/Query%20Contacts.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Retrieve a Contact](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Contacts/Retrieve%20a%20Contact.request.yaml) | `GET {{base_url}}/{{namespace}}/contacts/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\ContactService::retrieveContact` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Contacts/Retrieve%20a%20Contact.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Contacts/.resources/Retrieve%20a%20Contact.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Update a Contact](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Contacts/Update%20a%20Contact.request.yaml) | `PUT {{base_url}}/{{namespace}}/contacts/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\ContactService::updateContact` | path, json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Contacts/Update%20a%20Contact.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Contacts/.resources/Update%20a%20Contact.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Create a Customer](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Customers/Create%20a%20Customer.request.yaml) | `POST {{base_url}}/{{namespace}}/customers` | fleetbase-api-key | `Fleetbase\Sdk\Services\CustomerService::createCustomer` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Customers/Create%20a%20Customer.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Create a Customer Order](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Customers/Create%20a%20Customer%20Order.request.yaml) | `POST {{base_url}}/{{namespace}}/customers/orders` | customer-token | `Fleetbase\Sdk\Services\CustomerService::createCustomerOrder` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Customers/Create%20a%20Customer%20Order.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Forgot Customer Password](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Customers/Forgot%20Customer%20Password.request.yaml) | `POST {{base_url}}/{{namespace}}/customers/forgot-password` | fleetbase-api-key | `Fleetbase\Sdk\Services\CustomerService::forgotCustomerPassword` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Customers/Forgot%20Customer%20Password.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / List Customer Orders](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Customers/List%20Customer%20Orders.request.yaml) | `GET {{base_url}}/{{namespace}}/customers/orders` | customer-token | `Fleetbase\Sdk\Services\CustomerService::listCustomerOrders` | path/method only ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Customers/List%20Customer%20Orders.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / List Customer Places](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Customers/List%20Customer%20Places.request.yaml) | `GET {{base_url}}/{{namespace}}/customers/places` | customer-token | `Fleetbase\Sdk\Services\CustomerService::listCustomerPlaces` | path/method only ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Customers/List%20Customer%20Places.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Login Customer](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Customers/Login%20Customer.request.yaml) | `POST {{base_url}}/{{namespace}}/customers/login` | fleetbase-api-key | `Fleetbase\Sdk\Services\CustomerService::loginCustomer` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Customers/Login%20Customer.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Logout All Customer Sessions](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Customers/Logout%20All%20Customer%20Sessions.request.yaml) | `POST {{base_url}}/{{namespace}}/customers/logout-all` | customer-token | `Fleetbase\Sdk\Services\CustomerService::logoutAllCustomerSessions` | path/method only ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Customers/Logout%20All%20Customer%20Sessions.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Logout Customer](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Customers/Logout%20Customer.request.yaml) | `POST {{base_url}}/{{namespace}}/customers/logout` | customer-token | `Fleetbase\Sdk\Services\CustomerService::logoutCustomer` | path/method only ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Customers/Logout%20Customer.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Register Customer Device](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Customers/Register%20Customer%20Device.request.yaml) | `POST {{base_url}}/{{namespace}}/customers/register-device` | customer-token | `Fleetbase\Sdk\Services\CustomerService::registerCustomerDevice` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Customers/Register%20Customer%20Device.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Request Customer Creation Code](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Customers/Request%20Customer%20Creation%20Code.request.yaml) | `POST {{base_url}}/{{namespace}}/customers/request-creation-code` | fleetbase-api-key | `Fleetbase\Sdk\Services\CustomerService::requestCustomerCreationCode` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Customers/Request%20Customer%20Creation%20Code.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Request Customer Login SMS](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Customers/Request%20Customer%20Login%20SMS.request.yaml) | `POST {{base_url}}/{{namespace}}/customers/login-with-sms` | fleetbase-api-key | `Fleetbase\Sdk\Services\CustomerService::requestCustomerLoginSms` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Customers/Request%20Customer%20Login%20SMS.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Reset Customer Password](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Customers/Reset%20Customer%20Password.request.yaml) | `POST {{base_url}}/{{namespace}}/customers/reset-password` | fleetbase-api-key | `Fleetbase\Sdk\Services\CustomerService::resetCustomerPassword` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Customers/Reset%20Customer%20Password.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Retrieve Authenticated Customer](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Customers/Retrieve%20Authenticated%20Customer.request.yaml) | `GET {{base_url}}/{{namespace}}/customers/me` | customer-token | `Fleetbase\Sdk\Services\CustomerService::retrieveAuthenticatedCustomer` | path/method only ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Customers/Retrieve%20Authenticated%20Customer.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Retrieve a Customer Order](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Customers/Retrieve%20a%20Customer%20Order.request.yaml) | `GET {{base_url}}/{{namespace}}/customers/orders/{{customer_order_id}}` | customer-token | `Fleetbase\Sdk\Services\CustomerService::retrieveCustomerOrder` | path/method only ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Customers/Retrieve%20a%20Customer%20Order.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Update Authenticated Customer](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Customers/Update%20Authenticated%20Customer.request.yaml) | `PUT {{base_url}}/{{namespace}}/customers/me` | customer-token | `Fleetbase\Sdk\Services\CustomerService::updateAuthenticatedCustomer` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Customers/Update%20Authenticated%20Customer.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Verify Customer Login Code](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Customers/Verify%20Customer%20Login%20Code.request.yaml) | `POST {{base_url}}/{{namespace}}/customers/verify-code` | fleetbase-api-key | `Fleetbase\Sdk\Services\CustomerService::verifyCustomerLoginCode` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Customers/Verify%20Customer%20Login%20Code.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Attach Device](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Devices/Attach%20Device.request.yaml) | `POST {{base_url}}/{{namespace}}/devices/{{device_id}}/attach` | fleetbase-api-key | `Fleetbase\Sdk\Services\DeviceService::attachDevice` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Devices/Attach%20Device.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Devices/.resources/Attach%20Device.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Create a Device](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Devices/Create%20a%20Device.request.yaml) | `POST {{base_url}}/{{namespace}}/devices` | fleetbase-api-key | `Fleetbase\Sdk\Services\DeviceService::createDevice` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Devices/Create%20a%20Device.request.yaml)) | [201](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Devices/.resources/Create%20a%20Device.resources/examples/Created.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Delete a Device](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Devices/Delete%20a%20Device.request.yaml) | `DELETE {{base_url}}/{{namespace}}/devices/{{device_id}}` | fleetbase-api-key | `Fleetbase\Sdk\Services\DeviceService::deleteDevice` | path/method only ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Devices/Delete%20a%20Device.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Devices/.resources/Delete%20a%20Device.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Detach Device](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Devices/Detach%20Device.request.yaml) | `POST {{base_url}}/{{namespace}}/devices/{{device_id}}/detach` | fleetbase-api-key | `Fleetbase\Sdk\Services\DeviceService::detachDevice` | path/method only ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Devices/Detach%20Device.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Devices/.resources/Detach%20Device.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Query Devices](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Devices/Query%20Devices.request.yaml) | `GET {{base_url}}/{{namespace}}/devices` | fleetbase-api-key | `Fleetbase\Sdk\Services\DeviceService::queryDevices` | path/method only ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Devices/Query%20Devices.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Devices/.resources/Query%20Devices.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Retrieve a Device](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Devices/Retrieve%20a%20Device.request.yaml) | `GET {{base_url}}/{{namespace}}/devices/{{device_id}}` | fleetbase-api-key | `Fleetbase\Sdk\Services\DeviceService::retrieveDevice` | path/method only ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Devices/Retrieve%20a%20Device.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Devices/.resources/Retrieve%20a%20Device.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Update a Device](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Devices/Update%20a%20Device.request.yaml) | `PUT {{base_url}}/{{namespace}}/devices/{{device_id}}` | fleetbase-api-key | `Fleetbase\Sdk\Services\DeviceService::updateDevice` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Devices/Update%20a%20Device.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Devices/.resources/Update%20a%20Device.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Change Driver Password](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Drivers/Change%20Driver%20Password.request.yaml) | `POST {{base_url}}/{{namespace}}/drivers/:id/change-password` | fleetbase-api-key | `Fleetbase\Sdk\Services\DriverService::changeDriverPassword` | path, json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Drivers/Change%20Driver%20Password.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Create a Driver](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Drivers/Create%20a%20Driver.request.yaml) | `POST {{base_url}}/{{namespace}}/drivers` | fleetbase-api-key | `Fleetbase\Sdk\Services\DriverService::createDriver` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Drivers/Create%20a%20Driver.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Drivers/.resources/Create%20a%20Driver.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Delete a Driver](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Drivers/Delete%20a%20Driver.request.yaml) | `DELETE {{base_url}}/{{namespace}}/drivers/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\DriverService::deleteDriver` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Drivers/Delete%20a%20Driver.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Drivers/.resources/Delete%20a%20Driver.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Get Driver Current Organization](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Drivers/Get%20Driver%20Current%20Organization.request.yaml) | `GET {{base_url}}/{{namespace}}/drivers/:id/current-organization` | fleetbase-api-key | `Fleetbase\Sdk\Services\DriverService::getDriverCurrentOrganization` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Drivers/Get%20Driver%20Current%20Organization.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / List Driver Manifests](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Drivers/List%20Driver%20Manifests.request.yaml) | `GET {{base_url}}/{{namespace}}/drivers/:id/manifests` | fleetbase-api-key | `Fleetbase\Sdk\Services\DriverService::listDriverManifests` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Drivers/List%20Driver%20Manifests.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / List Driver Organizations](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Drivers/List%20Driver%20Organizations.request.yaml) | `GET {{base_url}}/{{namespace}}/drivers/:id/organizations` | fleetbase-api-key | `Fleetbase\Sdk\Services\DriverService::listDriverOrganizations` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Drivers/List%20Driver%20Organizations.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Login Driver](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Drivers/Login%20Driver.request.yaml) | `POST {{base_url}}/{{namespace}}/drivers/login` | fleetbase-api-key | `Fleetbase\Sdk\Services\DriverService::loginDriver` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Drivers/Login%20Driver.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Query Drivers](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Drivers/Query%20Drivers.request.yaml) | `GET {{base_url}}/{{namespace}}/drivers` | fleetbase-api-key | `Fleetbase\Sdk\Services\DriverService::queryDrivers` | query ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Drivers/Query%20Drivers.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Drivers/.resources/Query%20Drivers.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Register Device](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Drivers/Register%20Device.request.yaml) | `POST {{base_url}}/{{namespace}}/drivers/register-device` | fleetbase-api-key | `Fleetbase\Sdk\Services\DriverService::registerDevice` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Drivers/Register%20Device.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Register Driver Device](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Drivers/Register%20Driver%20Device.request.yaml) | `POST {{base_url}}/{{namespace}}/drivers/:id/register-device` | fleetbase-api-key | `Fleetbase\Sdk\Services\DriverService::registerDriverDevice` | path, json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Drivers/Register%20Driver%20Device.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Request Driver Login SMS](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Drivers/Request%20Driver%20Login%20SMS.request.yaml) | `POST {{base_url}}/{{namespace}}/drivers/login-with-sms` | fleetbase-api-key | `Fleetbase\Sdk\Services\DriverService::requestDriverLoginSms` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Drivers/Request%20Driver%20Login%20SMS.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Request Driver Password Reset](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Drivers/Request%20Driver%20Password%20Reset.request.yaml) | `POST {{base_url}}/{{namespace}}/drivers/forgot-password` | fleetbase-api-key | `Fleetbase\Sdk\Services\DriverService::requestDriverPasswordReset` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Drivers/Request%20Driver%20Password%20Reset.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Reset Driver Password](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Drivers/Reset%20Driver%20Password.request.yaml) | `POST {{base_url}}/{{namespace}}/drivers/reset-password` | fleetbase-api-key | `Fleetbase\Sdk\Services\DriverService::resetDriverPassword` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Drivers/Reset%20Driver%20Password.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Retrieve a Driver](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Drivers/Retrieve%20a%20Driver.request.yaml) | `GET {{base_url}}/{{namespace}}/drivers/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\DriverService::retrieveDriver` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Drivers/Retrieve%20a%20Driver.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Drivers/.resources/Retrieve%20a%20Driver.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Simulate Driver Route](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Drivers/Simulate%20Driver%20Route.request.yaml) | `POST {{base_url}}/{{namespace}}/drivers/:id/simulate` | fleetbase-api-key | `Fleetbase\Sdk\Services\DriverService::simulateDriverRoute` | path, json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Drivers/Simulate%20Driver%20Route.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Switch Driver Organization](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Drivers/Switch%20Driver%20Organization.request.yaml) | `POST {{base_url}}/{{namespace}}/drivers/:id/switch-organization` | fleetbase-api-key | `Fleetbase\Sdk\Services\DriverService::switchDriverOrganization` | path, json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Drivers/Switch%20Driver%20Organization.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Toggle Driver Online](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Drivers/Toggle%20Driver%20Online.request.yaml) | `POST {{base_url}}/{{namespace}}/drivers/:id/toggle-online` | fleetbase-api-key | `Fleetbase\Sdk\Services\DriverService::toggleDriverOnline` | path, json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Drivers/Toggle%20Driver%20Online.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Track Driver](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Drivers/Track%20Driver.request.yaml) | `PATCH {{base_url}}/{{namespace}}/drivers/:id/track` | fleetbase-api-key | `Fleetbase\Sdk\Services\DriverService::trackDriver` | path, text body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Drivers/Track%20Driver.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Update a Driver](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Drivers/Update%20a%20Driver.request.yaml) | `PUT {{base_url}}/{{namespace}}/drivers/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\DriverService::updateDriver` | path, json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Drivers/Update%20a%20Driver.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Drivers/.resources/Update%20a%20Driver.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Verify Driver Login Code](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Drivers/Verify%20Driver%20Login%20Code.request.yaml) | `POST {{base_url}}/{{namespace}}/drivers/verify-code` | fleetbase-api-key | `Fleetbase\Sdk\Services\DriverService::verifyDriverLoginCode` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Drivers/Verify%20Driver%20Login%20Code.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Create an Entity](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Entities/Create%20an%20Entity.request.yaml) | `POST {{base_url}}/{{namespace}}/entities` | fleetbase-api-key | `Fleetbase\Sdk\Services\EntityService::createEntity` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Entities/Create%20an%20Entity.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Entities/.resources/Create%20an%20Entity.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Delete a Entity](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Entities/Delete%20a%20Entity.request.yaml) | `DELETE {{base_url}}/{{namespace}}/entities/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\EntityService::deleteEntity` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Entities/Delete%20a%20Entity.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Entities/.resources/Delete%20a%20Entity.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Query Entities](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Entities/Query%20Entities.request.yaml) | `GET {{base_url}}/{{namespace}}/entities` | fleetbase-api-key | `Fleetbase\Sdk\Services\EntityService::queryEntities` | query ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Entities/Query%20Entities.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Retrieve an Entity](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Entities/Retrieve%20an%20Entity.request.yaml) | `GET {{base_url}}/{{namespace}}/entities/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\EntityService::retrieveEntity` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Entities/Retrieve%20an%20Entity.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Entities/.resources/Retrieve%20an%20Entity.resources/examples/OK.example.yaml), [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Entities/.resources/Retrieve%20an%20Entity.resources/examples/Retrieve%20an%20Entity.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Update a Entity](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Entities/Update%20a%20Entity.request.yaml) | `PUT {{base_url}}/{{namespace}}/entities/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\EntityService::updateEntity` | path, json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Entities/Update%20a%20Entity.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Entities/.resources/Update%20a%20Entity.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Create Equipment](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Equipment/Create%20Equipment.request.yaml) | `POST {{base_url}}/{{namespace}}/equipment` | fleetbase-api-key | `Fleetbase\Sdk\Services\EquipmentService::createEquipment` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Equipment/Create%20Equipment.request.yaml)) | [201](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Equipment/.resources/Create%20Equipment.resources/examples/Created.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Delete Equipment](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Equipment/Delete%20Equipment.request.yaml) | `DELETE {{base_url}}/{{namespace}}/equipment/{{equipment_id}}` | fleetbase-api-key | `Fleetbase\Sdk\Services\EquipmentService::deleteEquipment` | path/method only ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Equipment/Delete%20Equipment.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Equipment/.resources/Delete%20Equipment.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Query Equipment](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Equipment/Query%20Equipment.request.yaml) | `GET {{base_url}}/{{namespace}}/equipment` | fleetbase-api-key | `Fleetbase\Sdk\Services\EquipmentService::queryEquipment` | path/method only ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Equipment/Query%20Equipment.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Equipment/.resources/Query%20Equipment.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Retrieve Equipment](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Equipment/Retrieve%20Equipment.request.yaml) | `GET {{base_url}}/{{namespace}}/equipment/{{equipment_id}}` | fleetbase-api-key | `Fleetbase\Sdk\Services\EquipmentService::retrieveEquipment` | path/method only ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Equipment/Retrieve%20Equipment.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Equipment/.resources/Retrieve%20Equipment.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Update Equipment](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Equipment/Update%20Equipment.request.yaml) | `PUT {{base_url}}/{{namespace}}/equipment/{{equipment_id}}` | fleetbase-api-key | `Fleetbase\Sdk\Services\EquipmentService::updateEquipment` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Equipment/Update%20Equipment.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Equipment/.resources/Update%20Equipment.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Create a Fleet](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fleets/Create%20a%20Fleet.request.yaml) | `POST {{base_url}}/{{namespace}}/fleets` | fleetbase-api-key | `Fleetbase\Sdk\Services\FleetService::createFleet` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fleets/Create%20a%20Fleet.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fleets/.resources/Create%20a%20Fleet.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Delete a Fleet](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fleets/Delete%20a%20Fleet.request.yaml) | `DELETE {{base_url}}/{{namespace}}/fleets/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\FleetService::deleteFleet` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fleets/Delete%20a%20Fleet.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fleets/.resources/Delete%20a%20Fleet.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Query Fleets](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fleets/Query%20Fleets.request.yaml) | `GET {{base_url}}/{{namespace}}/fleets` | fleetbase-api-key | `Fleetbase\Sdk\Services\FleetService::queryFleets` | query ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fleets/Query%20Fleets.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fleets/.resources/Query%20Fleets.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Retrieve a Fleet](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fleets/Retrieve%20a%20Fleet.request.yaml) | `GET {{base_url}}/{{namespace}}/fleets/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\FleetService::retrieveFleet` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fleets/Retrieve%20a%20Fleet.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fleets/.resources/Retrieve%20a%20Fleet.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Update a Fleet](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fleets/Update%20a%20Fleet.request.yaml) | `PUT {{base_url}}/{{namespace}}/fleets/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\FleetService::updateFleet` | path, json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fleets/Update%20a%20Fleet.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fleets/.resources/Update%20a%20Fleet.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Create a Fuel Report](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fuel%20Reports/Create%20a%20Fuel%20Report.request.yaml) | `POST {{base_url}}/{{namespace}}/fuel-reports` | fleetbase-api-key | `Fleetbase\Sdk\Services\FuelReportService::createFuelReport` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fuel%20Reports/Create%20a%20Fuel%20Report.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Delete a Fuel Report](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fuel%20Reports/Delete%20a%20Fuel%20Report.request.yaml) | `DELETE {{base_url}}/{{namespace}}/fuel-reports/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\FuelReportService::deleteFuelReport` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fuel%20Reports/Delete%20a%20Fuel%20Report.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Query Fuel Reports](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fuel%20Reports/Query%20Fuel%20Reports.request.yaml) | `GET {{base_url}}/{{namespace}}/fuel-reports` | fleetbase-api-key | `Fleetbase\Sdk\Services\FuelReportService::queryFuelReports` | query ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fuel%20Reports/Query%20Fuel%20Reports.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Retrieve a Fuel Report](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fuel%20Reports/Retrieve%20a%20Fuel%20Report.request.yaml) | `GET {{base_url}}/{{namespace}}/fuel-reports/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\FuelReportService::retrieveFuelReport` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fuel%20Reports/Retrieve%20a%20Fuel%20Report.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Update a Fuel Report](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fuel%20Reports/Update%20a%20Fuel%20Report.request.yaml) | `PUT {{base_url}}/{{namespace}}/fuel-reports/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\FuelReportService::updateFuelReport` | path, json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fuel%20Reports/Update%20a%20Fuel%20Report.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Create a Fuel Transaction](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fuel%20Transactions/Create%20a%20Fuel%20Transaction.request.yaml) | `POST {{base_url}}/{{namespace}}/fuel-transactions` | fleetbase-api-key | `Fleetbase\Sdk\Services\FuelTransactionService::createFuelTransaction` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fuel%20Transactions/Create%20a%20Fuel%20Transaction.request.yaml)) | [201](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fuel%20Transactions/.resources/Create%20a%20Fuel%20Transaction.resources/examples/Created.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Delete a Fuel Transaction](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fuel%20Transactions/Delete%20a%20Fuel%20Transaction.request.yaml) | `DELETE {{base_url}}/{{namespace}}/fuel-transactions/{{fuel_transaction_id}}` | fleetbase-api-key | `Fleetbase\Sdk\Services\FuelTransactionService::deleteFuelTransaction` | path/method only ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fuel%20Transactions/Delete%20a%20Fuel%20Transaction.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fuel%20Transactions/.resources/Delete%20a%20Fuel%20Transaction.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Match Fuel Transaction Order](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fuel%20Transactions/Match%20Fuel%20Transaction%20Order.request.yaml) | `POST {{base_url}}/{{namespace}}/fuel-transactions/{{fuel_transaction_id}}/match-order` | fleetbase-api-key | `Fleetbase\Sdk\Services\FuelTransactionService::matchFuelTransactionOrder` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fuel%20Transactions/Match%20Fuel%20Transaction%20Order.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fuel%20Transactions/.resources/Match%20Fuel%20Transaction%20Order.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Match Fuel Transaction Vehicle](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fuel%20Transactions/Match%20Fuel%20Transaction%20Vehicle.request.yaml) | `POST {{base_url}}/{{namespace}}/fuel-transactions/{{fuel_transaction_id}}/match-vehicle` | fleetbase-api-key | `Fleetbase\Sdk\Services\FuelTransactionService::matchFuelTransactionVehicle` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fuel%20Transactions/Match%20Fuel%20Transaction%20Vehicle.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fuel%20Transactions/.resources/Match%20Fuel%20Transaction%20Vehicle.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Query Fuel Transactions](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fuel%20Transactions/Query%20Fuel%20Transactions.request.yaml) | `GET {{base_url}}/{{namespace}}/fuel-transactions` | fleetbase-api-key | `Fleetbase\Sdk\Services\FuelTransactionService::queryFuelTransactions` | path/method only ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fuel%20Transactions/Query%20Fuel%20Transactions.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fuel%20Transactions/.resources/Query%20Fuel%20Transactions.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Reprocess Fuel Transaction](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fuel%20Transactions/Reprocess%20Fuel%20Transaction.request.yaml) | `POST {{base_url}}/{{namespace}}/fuel-transactions/{{fuel_transaction_id}}/reprocess` | fleetbase-api-key | `Fleetbase\Sdk\Services\FuelTransactionService::reprocessFuelTransaction` | path/method only ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fuel%20Transactions/Reprocess%20Fuel%20Transaction.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fuel%20Transactions/.resources/Reprocess%20Fuel%20Transaction.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Retrieve a Fuel Transaction](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fuel%20Transactions/Retrieve%20a%20Fuel%20Transaction.request.yaml) | `GET {{base_url}}/{{namespace}}/fuel-transactions/{{fuel_transaction_id}}` | fleetbase-api-key | `Fleetbase\Sdk\Services\FuelTransactionService::retrieveFuelTransaction` | path/method only ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fuel%20Transactions/Retrieve%20a%20Fuel%20Transaction.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fuel%20Transactions/.resources/Retrieve%20a%20Fuel%20Transaction.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Review Fuel Transaction](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fuel%20Transactions/Review%20Fuel%20Transaction.request.yaml) | `POST {{base_url}}/{{namespace}}/fuel-transactions/{{fuel_transaction_id}}/review` | fleetbase-api-key | `Fleetbase\Sdk\Services\FuelTransactionService::reviewFuelTransaction` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fuel%20Transactions/Review%20Fuel%20Transaction.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fuel%20Transactions/.resources/Review%20Fuel%20Transaction.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Update a Fuel Transaction](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fuel%20Transactions/Update%20a%20Fuel%20Transaction.request.yaml) | `PUT {{base_url}}/{{namespace}}/fuel-transactions/{{fuel_transaction_id}}` | fleetbase-api-key | `Fleetbase\Sdk\Services\FuelTransactionService::updateFuelTransaction` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fuel%20Transactions/Update%20a%20Fuel%20Transaction.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Fuel%20Transactions/.resources/Update%20a%20Fuel%20Transaction.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Get Driver Geofence History](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Geofences/Get%20Driver%20Geofence%20History.request.yaml) | `GET {{base_url}}/{{namespace}}/geofences/driver/:driverId/history` | fleetbase-api-key | `Fleetbase\Sdk\Services\GeofenceService::getDriverGeofenceHistory` | path, query ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Geofences/Get%20Driver%20Geofence%20History.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Get Geofence Dwell Report](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Geofences/Get%20Geofence%20Dwell%20Report.request.yaml) | `GET {{base_url}}/{{namespace}}/geofences/dwell-report` | fleetbase-api-key | `Fleetbase\Sdk\Services\GeofenceService::getGeofenceDwellReport` | query ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Geofences/Get%20Geofence%20Dwell%20Report.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Get Geofence Inventory](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Geofences/Get%20Geofence%20Inventory.request.yaml) | `GET {{base_url}}/{{namespace}}/geofences/inventory` | fleetbase-api-key | `Fleetbase\Sdk\Services\GeofenceService::getGeofenceInventory` | path/method only ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Geofences/Get%20Geofence%20Inventory.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / List Geofence Events](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Geofences/List%20Geofence%20Events.request.yaml) | `GET {{base_url}}/{{namespace}}/geofences/events` | fleetbase-api-key | `Fleetbase\Sdk\Services\GeofenceService::listGeofenceEvents` | query ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Geofences/List%20Geofence%20Events.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Create an Issue](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Issues/Create%20an%20Issue.request.yaml) | `POST {{base_url}}/{{namespace}}/issues` | fleetbase-api-key | `Fleetbase\Sdk\Services\IssueService::createIssue` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Issues/Create%20an%20Issue.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Delete an Issue](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Issues/Delete%20an%20Issue.request.yaml) | `DELETE {{base_url}}/{{namespace}}/issues/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\IssueService::deleteIssue` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Issues/Delete%20an%20Issue.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Query Issues](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Issues/Query%20Issues.request.yaml) | `GET {{base_url}}/{{namespace}}/issues` | fleetbase-api-key | `Fleetbase\Sdk\Services\IssueService::queryIssues` | query ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Issues/Query%20Issues.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Retrieve an Issue](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Issues/Retrieve%20an%20Issue.request.yaml) | `GET {{base_url}}/{{namespace}}/issues/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\IssueService::retrieveIssue` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Issues/Retrieve%20an%20Issue.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Update an Issue](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Issues/Update%20an%20Issue.request.yaml) | `PUT {{base_url}}/{{namespace}}/issues/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\IssueService::updateIssue` | path, json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Issues/Update%20an%20Issue.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Render Label](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Labels/Render%20Label.request.yaml) | `GET {{base_url}}/{{namespace}}/labels/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\LabelService::renderLabel` | path, query ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Labels/Render%20Label.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Optimize a Manifest](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Manifests/Optimize%20a%20Manifest.request.yaml) | `POST {{base_url}}/{{namespace}}/manifests/:id/optimize` | fleetbase-api-key | `Fleetbase\Sdk\Services\ManifestService::optimizeManifest` | path, json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Manifests/Optimize%20a%20Manifest.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Retrieve a Manifest](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Manifests/Retrieve%20a%20Manifest.request.yaml) | `GET {{base_url}}/{{namespace}}/manifests/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\ManifestService::retrieveManifest` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Manifests/Retrieve%20a%20Manifest.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Update a Manifest Stop](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Manifests/Update%20a%20Manifest%20Stop.request.yaml) | `PATCH {{base_url}}/{{namespace}}/manifest-stops/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\ManifestService::updateManifestStop` | path, json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Manifests/Update%20a%20Manifest%20Stop.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Get Driver Onboard Settings](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Onboard/Get%20Driver%20Onboard%20Settings.request.yaml) | `GET {{base_url}}/{{namespace}}/onboard/driver-onboard-settings/:companyId` | fleetbase-api-key | `Fleetbase\Sdk\Services\OnboardService::getDriverOnboardSettings` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Onboard/Get%20Driver%20Onboard%20Settings.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Commit Orchestrator Plan](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orchestrator/Commit%20Orchestrator%20Plan.request.yaml) | `POST {{base_url}}/{{namespace}}/orchestrator/commit` | fleetbase-api-key | `Fleetbase\Sdk\Services\OrchestratorService::commitOrchestratorPlan` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orchestrator/Commit%20Orchestrator%20Plan.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orchestrator/.resources/Commit%20Orchestrator%20Plan.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Run Orchestrator](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orchestrator/Run%20Orchestrator.request.yaml) | `POST {{base_url}}/{{namespace}}/orchestrator/run` | fleetbase-api-key | `Fleetbase\Sdk\Services\OrchestratorService::runOrchestrator` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orchestrator/Run%20Orchestrator.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orchestrator/.resources/Run%20Orchestrator.resources/examples/Multi-phase%20Prior%20Assignments.example.yaml), [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orchestrator/.resources/Run%20Orchestrator.resources/examples/Native%20Capacity%20Allocation.example.yaml), [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orchestrator/.resources/Run%20Orchestrator.resources/examples/Single-phase%20VROOM%20Allocation.example.yaml), [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orchestrator/.resources/Run%20Orchestrator.resources/examples/VROOM%20Capacity%20Only%20Allocation.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Query Order Configs](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Order%20Configs/Query%20Order%20Configs.request.yaml) | `GET {{base_url}}/{{namespace}}/order-configs` | fleetbase-api-key | `Fleetbase\Sdk\Services\OrderConfigService::queryOrderConfigs` | path/method only ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Order%20Configs/Query%20Order%20Configs.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Retrieve an Order Config](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Order%20Configs/Retrieve%20an%20Order%20Config.request.yaml) | `GET {{base_url}}/{{namespace}}/order-configs/{{order_config_id}}` | fleetbase-api-key | `Fleetbase\Sdk\Services\OrderConfigService::retrieveOrderConfig` | path/method only ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Order%20Configs/Retrieve%20an%20Order%20Config.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Cancel an Order](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Cancel%20an%20Order.request.yaml) | `DELETE {{base_url}}/{{namespace}}/orders/:id/cancel` | fleetbase-api-key | `Fleetbase\Sdk\Services\OrderService::cancelOrder` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Cancel%20an%20Order.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/.resources/Cancel%20an%20Order.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Capture Photo for Order](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Capture%20Photo%20for%20Order.request.yaml) | `POST {{base_url}}/{{namespace}}/orders/:id/capture-photo/:subjectId` | fleetbase-api-key | `Fleetbase\Sdk\Services\OrderService::capturePhotoForOrder` | path, json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Capture%20Photo%20for%20Order.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Capture QR Code for Order](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Capture%20QR%20Code%20for%20Order.request.yaml) | `POST {{base_url}}/{{namespace}}/orders/:id/capture-qr/:subject-id` | fleetbase-api-key | `Fleetbase\Sdk\Services\OrderService::captureQrCodeForOrder` | path, json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Capture%20QR%20Code%20for%20Order.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/.resources/Capture%20QR%20Code%20for%20Order.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Capture Signature for Order](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Capture%20Signature%20for%20Order.request.yaml) | `POST {{base_url}}/{{namespace}}/orders/:id/capture-signature/:subject-id` | fleetbase-api-key | `Fleetbase\Sdk\Services\OrderService::captureSignatureForOrder` | path, json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Capture%20Signature%20for%20Order.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/.resources/Capture%20Signature%20for%20Order.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Complete an Order](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Complete%20an%20Order.request.yaml) | `POST {{base_url}}/{{namespace}}/orders/:id/complete` | fleetbase-api-key | `Fleetbase\Sdk\Services\OrderService::completeOrder` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Complete%20an%20Order.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Create an Order](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Create%20an%20Order.request.yaml) | `POST {{base_url}}/{{namespace}}/orders` | fleetbase-api-key | `Fleetbase\Sdk\Services\OrderService::createOrder` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Create%20an%20Order.request.yaml)) | [201](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/.resources/Create%20an%20Order.resources/examples/Create%20an%20Order%20using%20Complete%20Payload.example.yaml), [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/.resources/Create%20an%20Order.resources/examples/Create%20an%20Order%20using%20Payload.example.yaml), [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/.resources/Create%20an%20Order.resources/examples/Create%20an%20Order%20using%20Waypoints%20and%20Entities%20with%20Photos.example.yaml), [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/.resources/Create%20an%20Order.resources/examples/Create%20an%20Order%20using%20Waypoints%20and%20Entity%20Destinations.example.yaml), [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/.resources/Create%20an%20Order.resources/examples/Create%20an%20Order%20using%20only%20Pickup%20Dropoff.example.yaml), [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/.resources/Create%20an%20Order.resources/examples/Create%20an%20Order%20using%20only%20Waypoints.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Create an Order using Complete Payload](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Create%20an%20Order%20using%20Complete%20Payload.request.yaml) | `POST {{base_url}}/{{namespace}}/orders` | fleetbase-api-key | `Fleetbase\Sdk\Services\OrderService::createOrderUsingCompletePayload` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Create%20an%20Order%20using%20Complete%20Payload.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Create an Order using Coordinates](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Create%20an%20Order%20using%20Coordinates.request.yaml) | `POST {{base_url}}/{{namespace}}/orders` | fleetbase-api-key | `Fleetbase\Sdk\Services\OrderService::createOrderUsingCoordinates` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Create%20an%20Order%20using%20Coordinates.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Create an Order using GeoJSON Points](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Create%20an%20Order%20using%20GeoJSON%20Points.request.yaml) | `POST {{base_url}}/{{namespace}}/orders` | fleetbase-api-key | `Fleetbase\Sdk\Services\OrderService::createOrderUsingGeojsonPoints` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Create%20an%20Order%20using%20GeoJSON%20Points.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Create an Order using Payload](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Create%20an%20Order%20using%20Payload.request.yaml) | `POST {{base_url}}/{{namespace}}/orders` | fleetbase-api-key | `Fleetbase\Sdk\Services\OrderService::createOrderUsingPayload` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Create%20an%20Order%20using%20Payload.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Create an Order using Waypoints and Entities with Photos](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Create%20an%20Order%20using%20Waypoints%20and%20Entities%20with%20Photos.request.yaml) | `POST {{base_url}}/{{namespace}}/orders` | fleetbase-api-key | `Fleetbase\Sdk\Services\OrderService::createOrderUsingWaypointsAndEntitiesWithPhotos` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Create%20an%20Order%20using%20Waypoints%20and%20Entities%20with%20Photos.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Create an Order using Waypoints and Entity Destinations](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Create%20an%20Order%20using%20Waypoints%20and%20Entity%20Destinations.request.yaml) | `POST {{base_url}}/{{namespace}}/orders` | fleetbase-api-key | `Fleetbase\Sdk\Services\OrderService::createOrderUsingWaypointsAndEntityDestinations` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Create%20an%20Order%20using%20Waypoints%20and%20Entity%20Destinations.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Create an Order using only Pickup Dropoff](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Create%20an%20Order%20using%20only%20Pickup%20Dropoff.request.yaml) | `POST {{base_url}}/{{namespace}}/orders` | fleetbase-api-key | `Fleetbase\Sdk\Services\OrderService::createOrderUsingOnlyPickupDropoff` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Create%20an%20Order%20using%20only%20Pickup%20Dropoff.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Create an Order using only Waypoints](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Create%20an%20Order%20using%20only%20Waypoints.request.yaml) | `POST {{base_url}}/{{namespace}}/orders` | fleetbase-api-key | `Fleetbase\Sdk\Services\OrderService::createOrderUsingOnlyWaypoints` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Create%20an%20Order%20using%20only%20Waypoints.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Delete an Order](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Delete%20an%20Order.request.yaml) | `DELETE {{base_url}}/{{namespace}}/orders/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\OrderService::deleteOrder` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Delete%20an%20Order.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Dispatch an Order](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Dispatch%20an%20Order.request.yaml) | `PATCH {{base_url}}/{{namespace}}/orders/:id/dispatch` | fleetbase-api-key | `Fleetbase\Sdk\Services\OrderService::dispatchOrder` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Dispatch%20an%20Order.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/.resources/Dispatch%20an%20Order.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Get Editable Entity Fields](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Get%20Editable%20Entity%20Fields.request.yaml) | `GET {{base_url}}/{{namespace}}/orders/:id/editable-entity-fields` | fleetbase-api-key | `Fleetbase\Sdk\Services\OrderService::getEditableEntityFields` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Get%20Editable%20Entity%20Fields.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Get Order Distance and Time](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Get%20Order%20Distance%20and%20Time.request.yaml) | `GET {{base_url}}/{{namespace}}/orders/:id/distance-and-time` | fleetbase-api-key | `Fleetbase\Sdk\Services\OrderService::getOrderDistanceAndTime` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Get%20Order%20Distance%20and%20Time.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Get Order ETA](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Get%20Order%20ETA.request.yaml) | `GET {{base_url}}/{{namespace}}/orders/:id/eta` | fleetbase-api-key | `Fleetbase\Sdk\Services\OrderService::getOrderEta` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Get%20Order%20ETA.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Get Order Next Activity](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Get%20Order%20Next%20Activity.request.yaml) | `GET {{base_url}}/{{namespace}}/orders/:id/next-activity` | fleetbase-api-key | `Fleetbase\Sdk\Services\OrderService::getOrderNextActivity` | path, query, json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Get%20Order%20Next%20Activity.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/.resources/Get%20Order%20Next%20Activity.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Get Order Tracker](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Get%20Order%20Tracker.request.yaml) | `GET {{base_url}}/{{namespace}}/orders/:id/tracker` | fleetbase-api-key | `Fleetbase\Sdk\Services\OrderService::getOrderTracker` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Get%20Order%20Tracker.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / List Order Comments](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/List%20Order%20Comments.request.yaml) | `GET {{base_url}}/{{namespace}}/orders/:id/comments` | fleetbase-api-key | `Fleetbase\Sdk\Services\OrderService::listOrderComments` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/List%20Order%20Comments.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / List Order Proofs](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/List%20Order%20Proofs.request.yaml) | `GET {{base_url}}/{{namespace}}/orders/:id/proofs/:subjectId` | fleetbase-api-key | `Fleetbase\Sdk\Services\OrderService::listOrderProofs` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/List%20Order%20Proofs.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Query Orders](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Query%20Orders.request.yaml) | `GET {{base_url}}/{{namespace}}/orders` | fleetbase-api-key | `Fleetbase\Sdk\Services\OrderService::queryOrders` | query ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Query%20Orders.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Retrieve an Order](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Retrieve%20an%20Order.request.yaml) | `GET {{base_url}}/{{namespace}}/orders/{{order_id}}` | fleetbase-api-key | `Fleetbase\Sdk\Services\OrderService::retrieveOrder` | path/method only ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Retrieve%20an%20Order.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/.resources/Retrieve%20an%20Order.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Schedule an Order](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Schedule%20an%20Order.request.yaml) | `PATCH {{base_url}}/{{namespace}}/orders/:id/schedule` | fleetbase-api-key | `Fleetbase\Sdk\Services\OrderService::scheduleOrder` | path, json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Schedule%20an%20Order.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/.resources/Schedule%20an%20Order.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Set Order Destination](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Set%20Order%20Destination.request.yaml) | `PATCH {{base_url}}/{{namespace}}/orders/:id/set-destination/:placeId` | fleetbase-api-key | `Fleetbase\Sdk\Services\OrderService::setOrderDestination` | path, json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Set%20Order%20Destination.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/.resources/Set%20Order%20Destination.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Start an Order](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Start%20an%20Order.request.yaml) | `POST {{base_url}}/{{namespace}}/orders/:id/start` | fleetbase-api-key | `Fleetbase\Sdk\Services\OrderService::startOrder` | path, json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Start%20an%20Order.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/.resources/Start%20an%20Order.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Update Order Activity](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Update%20Order%20Activity.request.yaml) | `POST {{base_url}}/{{namespace}}/orders/:id/update-activity` | fleetbase-api-key | `Fleetbase\Sdk\Services\OrderService::updateOrderActivity` | path, json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Update%20Order%20Activity.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/.resources/Update%20Order%20Activity.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Update an Order](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Update%20an%20Order.request.yaml) | `PUT {{base_url}}/{{namespace}}/orders/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\OrderService::updateOrder` | path, json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/Update%20an%20Order.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Orders/.resources/Update%20an%20Order.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Get Current Organization](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Organizations/Get%20Current%20Organization.request.yaml) | `GET {{base_url}}/{{namespace}}/organizations/current` | fleetbase-api-key | `Fleetbase\Sdk\Services\OrganizationService::getCurrentOrganization` | path/method only ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Organizations/Get%20Current%20Organization.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / List Organizations](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Organizations/List%20Organizations.request.yaml) | `GET {{base_url}}/{{namespace}}/organizations` | fleetbase-api-key | `Fleetbase\Sdk\Services\OrganizationService::listOrganizations` | query ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Organizations/List%20Organizations.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Create a Part](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Parts/Create%20a%20Part.request.yaml) | `POST {{base_url}}/{{namespace}}/parts` | fleetbase-api-key | `Fleetbase\Sdk\Services\PartService::createPart` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Parts/Create%20a%20Part.request.yaml)) | [201](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Parts/.resources/Create%20a%20Part.resources/examples/Created.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Delete a Part](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Parts/Delete%20a%20Part.request.yaml) | `DELETE {{base_url}}/{{namespace}}/parts/{{part_id}}` | fleetbase-api-key | `Fleetbase\Sdk\Services\PartService::deletePart` | path/method only ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Parts/Delete%20a%20Part.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Parts/.resources/Delete%20a%20Part.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Query Parts](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Parts/Query%20Parts.request.yaml) | `GET {{base_url}}/{{namespace}}/parts` | fleetbase-api-key | `Fleetbase\Sdk\Services\PartService::queryParts` | path/method only ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Parts/Query%20Parts.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Parts/.resources/Query%20Parts.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Retrieve a Part](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Parts/Retrieve%20a%20Part.request.yaml) | `GET {{base_url}}/{{namespace}}/parts/{{part_id}}` | fleetbase-api-key | `Fleetbase\Sdk\Services\PartService::retrievePart` | path/method only ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Parts/Retrieve%20a%20Part.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Parts/.resources/Retrieve%20a%20Part.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Update a Part](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Parts/Update%20a%20Part.request.yaml) | `PUT {{base_url}}/{{namespace}}/parts/{{part_id}}` | fleetbase-api-key | `Fleetbase\Sdk\Services\PartService::updatePart` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Parts/Update%20a%20Part.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Parts/.resources/Update%20a%20Part.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Create a Payload](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Payloads/Create%20a%20Payload.request.yaml) | `POST {{base_url}}/{{namespace}}/payloads` | fleetbase-api-key | `Fleetbase\Sdk\Services\PayloadService::createPayload` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Payloads/Create%20a%20Payload.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Payloads/.resources/Create%20a%20Payload.resources/examples/Create%20a%20Payload%20With%20Multiple%20Waypoints.example.yaml), [201](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Payloads/.resources/Create%20a%20Payload.resources/examples/Create%20a%20Payload.example.yaml), [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Payloads/.resources/Create%20a%20Payload.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Delete a Payload](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Payloads/Delete%20a%20Payload.request.yaml) | `DELETE {{base_url}}/{{namespace}}/payloads/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\PayloadService::deletePayload` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Payloads/Delete%20a%20Payload.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Payloads/.resources/Delete%20a%20Payload.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Query Payloads](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Payloads/Query%20Payloads.request.yaml) | `GET {{base_url}}/{{namespace}}/payloads` | fleetbase-api-key | `Fleetbase\Sdk\Services\PayloadService::queryPayloads` | query ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Payloads/Query%20Payloads.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Retrieve a Payload](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Payloads/Retrieve%20a%20Payload.request.yaml) | `GET {{base_url}}/{{namespace}}/payloads/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\PayloadService::retrievePayload` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Payloads/Retrieve%20a%20Payload.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Update a Payload](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Payloads/Update%20a%20Payload.request.yaml) | `PUT {{base_url}}/{{namespace}}/payloads/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\PayloadService::updatePayload` | path, json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Payloads/Update%20a%20Payload.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Payloads/.resources/Update%20a%20Payload.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Create a Place](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Places/Create%20a%20Place.request.yaml) | `POST {{base_url}}/{{namespace}}/places` | fleetbase-api-key | `Fleetbase\Sdk\Services\PlaceService::createPlace` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Places/Create%20a%20Place.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Places/.resources/Create%20a%20Place.resources/examples/Create%20a%20Place%20using%20Coordinates%20Array.example.yaml), [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Places/.resources/Create%20a%20Place.resources/examples/Create%20a%20Place%20using%20Coordinates.example.yaml), [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Places/.resources/Create%20a%20Place.resources/examples/Create%20a%20Place%20using%20GeoJSON%20Point.example.yaml), [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Places/.resources/Create%20a%20Place.resources/examples/Create%20a%20Place%20using%20Street%20Address%20Only.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Delete a Place](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Places/Delete%20a%20Place.request.yaml) | `DELETE {{base_url}}/{{namespace}}/places/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\PlaceService::deletePlace` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Places/Delete%20a%20Place.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Places/.resources/Delete%20a%20Place.resources/examples/Delete%20a%20Place.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / List all Places](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Places/List%20all%20Places.request.yaml) | `GET {{base_url}}/{{namespace}}/places` | fleetbase-api-key | `Fleetbase\Sdk\Services\PlaceService::listAllPlaces` | query ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Places/List%20all%20Places.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Query Places](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Places/Query%20Places.request.yaml) | `GET {{base_url}}/{{namespace}}/places` | fleetbase-api-key | `Fleetbase\Sdk\Services\PlaceService::queryPlaces` | query ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Places/Query%20Places.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Retrieve a Place](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Places/Retrieve%20a%20Place.request.yaml) | `GET {{base_url}}/{{namespace}}/places/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\PlaceService::retrievePlace` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Places/Retrieve%20a%20Place.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Search Places](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Places/Search%20Places.request.yaml) | `GET {{base_url}}/{{namespace}}/places/search` | fleetbase-api-key | `Fleetbase\Sdk\Services\PlaceService::searchPlaces` | query ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Places/Search%20Places.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Update a Place](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Places/Update%20a%20Place.request.yaml) | `PUT {{base_url}}/{{namespace}}/places/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\PlaceService::updatePlace` | path, json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Places/Update%20a%20Place.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Places/.resources/Update%20a%20Place.resources/examples/Update%20a%20Place.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Create a Purchase Rate](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Purchase%20Rates/Create%20a%20Purchase%20Rate.request.yaml) | `POST {{base_url}}/{{namespace}}/purchase-rates` | fleetbase-api-key | `Fleetbase\Sdk\Services\PurchaseRateService::createPurchaseRate` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Purchase%20Rates/Create%20a%20Purchase%20Rate.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Purchase%20Rates/.resources/Create%20a%20Purchase%20Rate.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Query Purchase Rates](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Purchase%20Rates/Query%20Purchase%20Rates.request.yaml) | `GET {{base_url}}/{{namespace}}/purchase-rates` | fleetbase-api-key | `Fleetbase\Sdk\Services\PurchaseRateService::queryPurchaseRates` | query ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Purchase%20Rates/Query%20Purchase%20Rates.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Retrieve a Purchase Rate](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Purchase%20Rates/Retrieve%20a%20Purchase%20Rate.request.yaml) | `GET {{base_url}}/{{namespace}}/purchase-rates/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\PurchaseRateService::retrievePurchaseRate` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Purchase%20Rates/Retrieve%20a%20Purchase%20Rate.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Purchase%20Rates/.resources/Retrieve%20a%20Purchase%20Rate.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Create a Sensor](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Sensors/Create%20a%20Sensor.request.yaml) | `POST {{base_url}}/{{namespace}}/sensors` | fleetbase-api-key | `Fleetbase\Sdk\Services\SensorService::createSensor` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Sensors/Create%20a%20Sensor.request.yaml)) | [201](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Sensors/.resources/Create%20a%20Sensor.resources/examples/Created.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Delete a Sensor](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Sensors/Delete%20a%20Sensor.request.yaml) | `DELETE {{base_url}}/{{namespace}}/sensors/{{sensor_id}}` | fleetbase-api-key | `Fleetbase\Sdk\Services\SensorService::deleteSensor` | path/method only ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Sensors/Delete%20a%20Sensor.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Sensors/.resources/Delete%20a%20Sensor.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Query Sensors](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Sensors/Query%20Sensors.request.yaml) | `GET {{base_url}}/{{namespace}}/sensors` | fleetbase-api-key | `Fleetbase\Sdk\Services\SensorService::querySensors` | path/method only ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Sensors/Query%20Sensors.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Sensors/.resources/Query%20Sensors.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Retrieve a Sensor](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Sensors/Retrieve%20a%20Sensor.request.yaml) | `GET {{base_url}}/{{namespace}}/sensors/{{sensor_id}}` | fleetbase-api-key | `Fleetbase\Sdk\Services\SensorService::retrieveSensor` | path/method only ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Sensors/Retrieve%20a%20Sensor.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Sensors/.resources/Retrieve%20a%20Sensor.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Update a Sensor](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Sensors/Update%20a%20Sensor.request.yaml) | `PUT {{base_url}}/{{namespace}}/sensors/{{sensor_id}}` | fleetbase-api-key | `Fleetbase\Sdk\Services\SensorService::updateSensor` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Sensors/Update%20a%20Sensor.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Sensors/.resources/Update%20a%20Sensor.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Create a Service Area](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Service%20Areas/Create%20a%20Service%20Area.request.yaml) | `POST {{base_url}}/{{namespace}}/service-areas` | fleetbase-api-key | `Fleetbase\Sdk\Services\ServiceAreaService::createServiceArea` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Service%20Areas/Create%20a%20Service%20Area.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Service%20Areas/.resources/Create%20a%20Service%20Area.resources/examples/Create%20a%20Service%20Area%20using%20GeoJSON%20Point.example.yaml), [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Service%20Areas/.resources/Create%20a%20Service%20Area.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Delete a Service Area](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Service%20Areas/Delete%20a%20Service%20Area.request.yaml) | `DELETE {{base_url}}/{{namespace}}/service-areas/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\ServiceAreaService::deleteServiceArea` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Service%20Areas/Delete%20a%20Service%20Area.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Service%20Areas/.resources/Delete%20a%20Service%20Area.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Query Service Areas](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Service%20Areas/Query%20Service%20Areas.request.yaml) | `GET {{base_url}}/{{namespace}}/service-areas` | fleetbase-api-key | `Fleetbase\Sdk\Services\ServiceAreaService::queryServiceAreas` | query ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Service%20Areas/Query%20Service%20Areas.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Retrieve a Service Area](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Service%20Areas/Retrieve%20a%20Service%20Area.request.yaml) | `GET {{base_url}}/{{namespace}}/service-areas/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\ServiceAreaService::retrieveServiceArea` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Service%20Areas/Retrieve%20a%20Service%20Area.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Service%20Areas/.resources/Retrieve%20a%20Service%20Area.resources/examples/OK.example.yaml), [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Service%20Areas/.resources/Retrieve%20a%20Service%20Area.resources/examples/Retrieve%20a%20Service%20Area.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Update a Service Area](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Service%20Areas/Update%20a%20Service%20Area.request.yaml) | `PUT {{base_url}}/{{namespace}}/service-areas/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\ServiceAreaService::updateServiceArea` | path, json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Service%20Areas/Update%20a%20Service%20Area.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Service%20Areas/.resources/Update%20a%20Service%20Area.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Query Service Quotes](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Service%20Quotes/Query%20Service%20Quotes.request.yaml) | `GET {{base_url}}/{{namespace}}/service-quotes` | fleetbase-api-key | `Fleetbase\Sdk\Services\ServiceQuoteService::queryServiceQuotes` | query, json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Service%20Quotes/Query%20Service%20Quotes.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Service%20Quotes/.resources/Query%20Service%20Quotes.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Retrieve a Service Quote](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Service%20Quotes/Retrieve%20a%20Service%20Quote.request.yaml) | `GET {{base_url}}/{{namespace}}/service-quotes/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\ServiceQuoteService::retrieveServiceQuote` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Service%20Quotes/Retrieve%20a%20Service%20Quote.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Create a Service Rate](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Service%20Rates/Create%20a%20Service%20Rate.request.yaml) | `POST {{base_url}}/{{namespace}}/service-rates` | fleetbase-api-key | `Fleetbase\Sdk\Services\ServiceRateService::createServiceRate` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Service%20Rates/Create%20a%20Service%20Rate.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Service%20Rates/.resources/Create%20a%20Service%20Rate.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Delete a Service Rate](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Service%20Rates/Delete%20a%20Service%20Rate.request.yaml) | `DELETE {{base_url}}/{{namespace}}/service-rates/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\ServiceRateService::deleteServiceRate` | path, json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Service%20Rates/Delete%20a%20Service%20Rate.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Service%20Rates/.resources/Delete%20a%20Service%20Rate.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Query Service Rates](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Service%20Rates/Query%20Service%20Rates.request.yaml) | `GET {{base_url}}/{{namespace}}/service-rates` | fleetbase-api-key | `Fleetbase\Sdk\Services\ServiceRateService::queryServiceRates` | query, json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Service%20Rates/Query%20Service%20Rates.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Retrieve a Service Rate](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Service%20Rates/Retrieve%20a%20Service%20Rate.request.yaml) | `GET {{base_url}}/{{namespace}}/service-rates/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\ServiceRateService::retrieveServiceRate` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Service%20Rates/Retrieve%20a%20Service%20Rate.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Update a Service Rate](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Service%20Rates/Update%20a%20Service%20Rate.request.yaml) | `PUT {{base_url}}/{{namespace}}/service-rates/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\ServiceRateService::updateServiceRate` | path, json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Service%20Rates/Update%20a%20Service%20Rate.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Service%20Rates/.resources/Update%20a%20Service%20Rate.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Create a Tracking Number](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Tracking%20Numbers/Create%20a%20Tracking%20Number.request.yaml) | `POST {{base_url}}/{{namespace}}/tracking-numbers` | fleetbase-api-key | `Fleetbase\Sdk\Services\TrackingNumberService::createTrackingNumber` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Tracking%20Numbers/Create%20a%20Tracking%20Number.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Tracking%20Numbers/.resources/Create%20a%20Tracking%20Number.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Decode Tracking Number QR](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Tracking%20Numbers/Decode%20Tracking%20Number%20QR.request.yaml) | `POST {{base_url}}/{{namespace}}/tracking-numbers/from-qr` | fleetbase-api-key | `Fleetbase\Sdk\Services\TrackingNumberService::decodeTrackingNumberQr` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Tracking%20Numbers/Decode%20Tracking%20Number%20QR.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Delete a Tracking Number](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Tracking%20Numbers/Delete%20a%20Tracking%20Number.request.yaml) | `DELETE {{base_url}}/{{namespace}}/tracking-numbers/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\TrackingNumberService::deleteTrackingNumber` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Tracking%20Numbers/Delete%20a%20Tracking%20Number.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Tracking%20Numbers/.resources/Delete%20a%20Tracking%20Number.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Query Tracking Numbers](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Tracking%20Numbers/Query%20Tracking%20Numbers.request.yaml) | `GET {{base_url}}/{{namespace}}/tracking-numbers` | fleetbase-api-key | `Fleetbase\Sdk\Services\TrackingNumberService::queryTrackingNumbers` | query ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Tracking%20Numbers/Query%20Tracking%20Numbers.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Tracking%20Numbers/.resources/Query%20Tracking%20Numbers.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Retrieve a Tracking Number](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Tracking%20Numbers/Retrieve%20a%20Tracking%20Number.request.yaml) | `GET {{base_url}}/{{namespace}}/tracking-numbers/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\TrackingNumberService::retrieveTrackingNumber` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Tracking%20Numbers/Retrieve%20a%20Tracking%20Number.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Tracking%20Numbers/.resources/Retrieve%20a%20Tracking%20Number.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Create a Tracking Status](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Tracking%20Statuses/Create%20a%20Tracking%20Status.request.yaml) | `POST {{base_url}}/{{namespace}}/tracking-statuses` | fleetbase-api-key | `Fleetbase\Sdk\Services\TrackingStatusService::createTrackingStatus` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Tracking%20Statuses/Create%20a%20Tracking%20Status.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Tracking%20Statuses/.resources/Create%20a%20Tracking%20Status.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Delete a Tracking Status](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Tracking%20Statuses/Delete%20a%20Tracking%20Status.request.yaml) | `DELETE {{base_url}}/{{namespace}}/tracking-statuses/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\TrackingStatusService::deleteTrackingStatus` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Tracking%20Statuses/Delete%20a%20Tracking%20Status.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Tracking%20Statuses/.resources/Delete%20a%20Tracking%20Status.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Query Tracking Statuses](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Tracking%20Statuses/Query%20Tracking%20Statuses.request.yaml) | `GET {{base_url}}/{{namespace}}/tracking-statuses` | fleetbase-api-key | `Fleetbase\Sdk\Services\TrackingStatusService::queryTrackingStatuses` | query ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Tracking%20Statuses/Query%20Tracking%20Statuses.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Tracking%20Statuses/.resources/Query%20Tracking%20Statuses.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Retrieve a Tracking Status](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Tracking%20Statuses/Retrieve%20a%20Tracking%20Status.request.yaml) | `GET {{base_url}}/{{namespace}}/tracking-statuses/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\TrackingStatusService::retrieveTrackingStatus` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Tracking%20Statuses/Retrieve%20a%20Tracking%20Status.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Tracking%20Statuses/.resources/Retrieve%20a%20Tracking%20Status.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Update a Tracking Status](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Tracking%20Statuses/Update%20a%20Tracking%20Status.request.yaml) | `PUT {{base_url}}/{{namespace}}/tracking-statuses/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\TrackingStatusService::updateTrackingStatus` | path, json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Tracking%20Statuses/Update%20a%20Tracking%20Status.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Tracking%20Statuses/.resources/Update%20a%20Tracking%20Status.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Create a Vehicle](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Vehicles/Create%20a%20Vehicle.request.yaml) | `POST {{base_url}}/{{namespace}}/vehicles` | fleetbase-api-key | `Fleetbase\Sdk\Services\VehicleService::createVehicle` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Vehicles/Create%20a%20Vehicle.request.yaml)) | [201](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Vehicles/.resources/Create%20a%20Vehicle.resources/examples/Created.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Delete a Vehicle](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Vehicles/Delete%20a%20Vehicle.request.yaml) | `DELETE {{base_url}}/{{namespace}}/vehicles/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\VehicleService::deleteVehicle` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Vehicles/Delete%20a%20Vehicle.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Vehicles/.resources/Delete%20a%20Vehicle.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Query Vehicles](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Vehicles/Query%20Vehicles.request.yaml) | `GET {{base_url}}/{{namespace}}/vehicles` | fleetbase-api-key | `Fleetbase\Sdk\Services\VehicleService::queryVehicles` | query ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Vehicles/Query%20Vehicles.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Vehicles/.resources/Query%20Vehicles.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Retrieve a Vehicle](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Vehicles/Retrieve%20a%20Vehicle.request.yaml) | `GET {{base_url}}/{{namespace}}/vehicles/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\VehicleService::retrieveVehicle` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Vehicles/Retrieve%20a%20Vehicle.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Vehicles/.resources/Retrieve%20a%20Vehicle.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Track Vehicle](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Vehicles/Track%20Vehicle.request.yaml) | `PATCH {{base_url}}/{{namespace}}/vehicles/:id/track` | fleetbase-api-key | `Fleetbase\Sdk\Services\VehicleService::trackVehicle` | path, text body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Vehicles/Track%20Vehicle.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Update a Vehicle](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Vehicles/Update%20a%20Vehicle.request.yaml) | `PUT {{base_url}}/{{namespace}}/vehicles/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\VehicleService::updateVehicle` | path, json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Vehicles/Update%20a%20Vehicle.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Vehicles/.resources/Update%20a%20Vehicle.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Create a Vendor](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Vendors/Create%20a%20Vendor.request.yaml) | `POST {{base_url}}/{{namespace}}/vendors` | fleetbase-api-key | `Fleetbase\Sdk\Services\VendorService::createVendor` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Vendors/Create%20a%20Vendor.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Vendors/.resources/Create%20a%20Vendor.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Delete a Vendor](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Vendors/Delete%20a%20Vendor.request.yaml) | `DELETE {{base_url}}/{{namespace}}/vendors/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\VendorService::deleteVendor` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Vendors/Delete%20a%20Vendor.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Vendors/.resources/Delete%20a%20Vendor.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Query Vendors](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Vendors/Query%20Vendors.request.yaml) | `GET {{base_url}}/{{namespace}}/vendors` | fleetbase-api-key | `Fleetbase\Sdk\Services\VendorService::queryVendors` | query ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Vendors/Query%20Vendors.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Vendors/.resources/Query%20Vendors.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Retrieve a Vendor](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Vendors/Retrieve%20a%20Vendor.request.yaml) | `GET {{base_url}}/{{namespace}}/vendors/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\VendorService::retrieveVendor` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Vendors/Retrieve%20a%20Vendor.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Vendors/.resources/Retrieve%20a%20Vendor.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Update a Vendor](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Vendors/Update%20a%20Vendor.request.yaml) | `PUT {{base_url}}/{{namespace}}/vendors/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\VendorService::updateVendor` | path, json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Vendors/Update%20a%20Vendor.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Vendors/.resources/Update%20a%20Vendor.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Create a Work Order](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Work%20Orders/Create%20a%20Work%20Order.request.yaml) | `POST {{base_url}}/{{namespace}}/work-orders` | fleetbase-api-key | `Fleetbase\Sdk\Services\WorkOrderService::createWorkOrder` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Work%20Orders/Create%20a%20Work%20Order.request.yaml)) | [201](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Work%20Orders/.resources/Create%20a%20Work%20Order.resources/examples/Created.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Delete a Work Order](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Work%20Orders/Delete%20a%20Work%20Order.request.yaml) | `DELETE {{base_url}}/{{namespace}}/work-orders/{{work_order_id}}` | fleetbase-api-key | `Fleetbase\Sdk\Services\WorkOrderService::deleteWorkOrder` | path/method only ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Work%20Orders/Delete%20a%20Work%20Order.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Work%20Orders/.resources/Delete%20a%20Work%20Order.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Query Work Orders](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Work%20Orders/Query%20Work%20Orders.request.yaml) | `GET {{base_url}}/{{namespace}}/work-orders` | fleetbase-api-key | `Fleetbase\Sdk\Services\WorkOrderService::queryWorkOrders` | path/method only ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Work%20Orders/Query%20Work%20Orders.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Work%20Orders/.resources/Query%20Work%20Orders.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Retrieve a Work Order](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Work%20Orders/Retrieve%20a%20Work%20Order.request.yaml) | `GET {{base_url}}/{{namespace}}/work-orders/{{work_order_id}}` | fleetbase-api-key | `Fleetbase\Sdk\Services\WorkOrderService::retrieveWorkOrder` | path/method only ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Work%20Orders/Retrieve%20a%20Work%20Order.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Work%20Orders/.resources/Retrieve%20a%20Work%20Order.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Send Work Order](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Work%20Orders/Send%20Work%20Order.request.yaml) | `POST {{base_url}}/{{namespace}}/work-orders/{{work_order_id}}/send` | fleetbase-api-key | `Fleetbase\Sdk\Services\WorkOrderService::sendWorkOrder` | path/method only ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Work%20Orders/Send%20Work%20Order.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Work%20Orders/.resources/Send%20Work%20Order.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Update a Work Order](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Work%20Orders/Update%20a%20Work%20Order.request.yaml) | `PUT {{base_url}}/{{namespace}}/work-orders/{{work_order_id}}` | fleetbase-api-key | `Fleetbase\Sdk\Services\WorkOrderService::updateWorkOrder` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Work%20Orders/Update%20a%20Work%20Order.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Work%20Orders/.resources/Update%20a%20Work%20Order.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Create a Zone](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Zones/Create%20a%20Zone.request.yaml) | `POST {{base_url}}/{{namespace}}/zones` | fleetbase-api-key | `Fleetbase\Sdk\Services\ZoneService::createZone` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Zones/Create%20a%20Zone.request.yaml)) | [201](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Zones/.resources/Create%20a%20Zone.resources/examples/Create%20a%20Zone.example.yaml), [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Zones/.resources/Create%20a%20Zone.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Delete a Zone](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Zones/Delete%20a%20Zone.request.yaml) | `DELETE {{base_url}}/{{namespace}}/zones/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\ZoneService::deleteZone` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Zones/Delete%20a%20Zone.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Zones/.resources/Delete%20a%20Zone.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Query Zones](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Zones/Query%20Zones.request.yaml) | `GET {{base_url}}/{{namespace}}/zones` | fleetbase-api-key | `Fleetbase\Sdk\Services\ZoneService::queryZones` | query ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Zones/Query%20Zones.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Zones/.resources/Query%20Zones.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Retrieve a zone](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Zones/Retrieve%20a%20zone.request.yaml) | `GET {{base_url}}/{{namespace}}/zones/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\ZoneService::retrieveZone` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Zones/Retrieve%20a%20zone.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Zones/.resources/Retrieve%20a%20zone.resources/examples/Delete%20a%20Zone.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase API / Update a Zone](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Zones/Update%20a%20Zone.request.yaml) | `PUT {{base_url}}/{{namespace}}/zones/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\ZoneService::updateZone` | path, json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Zones/Update%20a%20Zone.request.yaml)) | [200](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20API/Zones/.resources/Update%20a%20Zone.resources/examples/OK.example.yaml) | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase Core API / Add Participant](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Chat%20Channels/Add%20Participant.request.yaml) | `POST {{base_url}}/{{namespace}}/chat-channels/:id/add-participant` | fleetbase-api-key | `Fleetbase\Sdk\Services\ChatChannelService::addParticipant` | path, json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Chat%20Channels/Add%20Participant.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase Core API / Create Chat Channel](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Chat%20Channels/Create%20Chat%20Channel.request.yaml) | `POST {{base_url}}/{{namespace}}/chat-channels` | fleetbase-api-key | `Fleetbase\Sdk\Services\ChatChannelService::createChatChannel` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Chat%20Channels/Create%20Chat%20Channel.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase Core API / Create Read Receipt](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Chat%20Channels/Create%20Read%20Receipt.request.yaml) | `POST {{base_url}}/{{namespace}}/chat-channels/read-message/:chatMessageId` | fleetbase-api-key | `Fleetbase\Sdk\Services\ChatChannelService::createReadReceipt` | path, json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Chat%20Channels/Create%20Read%20Receipt.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase Core API / Delete Chat Channel](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Chat%20Channels/Delete%20Chat%20Channel.request.yaml) | `DELETE {{base_url}}/{{namespace}}/chat-channels/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\ChatChannelService::deleteChatChannel` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Chat%20Channels/Delete%20Chat%20Channel.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase Core API / Delete Message](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Chat%20Channels/Delete%20Message.request.yaml) | `DELETE {{base_url}}/{{namespace}}/chat-channels/delete-message/:chatMessageId` | fleetbase-api-key | `Fleetbase\Sdk\Services\ChatChannelService::deleteMessage` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Chat%20Channels/Delete%20Message.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase Core API / List Available Participants](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Chat%20Channels/List%20Available%20Participants.request.yaml) | `GET {{base_url}}/{{namespace}}/chat-channels/available-participants` | fleetbase-api-key | `Fleetbase\Sdk\Services\ChatChannelService::listAvailableParticipants` | query ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Chat%20Channels/List%20Available%20Participants.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase Core API / Query Chat Channels](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Chat%20Channels/Query%20Chat%20Channels.request.yaml) | `GET {{base_url}}/{{namespace}}/chat-channels` | fleetbase-api-key | `Fleetbase\Sdk\Services\ChatChannelService::queryChatChannels` | query ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Chat%20Channels/Query%20Chat%20Channels.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase Core API / Remove Participant](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Chat%20Channels/Remove%20Participant.request.yaml) | `DELETE {{base_url}}/{{namespace}}/chat-channels/remove-participant/:participantId` | fleetbase-api-key | `Fleetbase\Sdk\Services\ChatChannelService::removeParticipant` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Chat%20Channels/Remove%20Participant.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase Core API / Retrieve Chat Channel](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Chat%20Channels/Retrieve%20Chat%20Channel.request.yaml) | `GET {{base_url}}/{{namespace}}/chat-channels/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\ChatChannelService::retrieveChatChannel` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Chat%20Channels/Retrieve%20Chat%20Channel.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase Core API / Send Message](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Chat%20Channels/Send%20Message.request.yaml) | `POST {{base_url}}/{{namespace}}/chat-channels/:id/send-message` | fleetbase-api-key | `Fleetbase\Sdk\Services\ChatChannelService::sendMessage` | path, json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Chat%20Channels/Send%20Message.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase Core API / Update Chat Channel](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Chat%20Channels/Update%20Chat%20Channel.request.yaml) | `PUT {{base_url}}/{{namespace}}/chat-channels/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\ChatChannelService::updateChatChannel` | path, json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Chat%20Channels/Update%20Chat%20Channel.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase Core API / Create Comment](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Comments/Create%20Comment.request.yaml) | `POST {{base_url}}/{{namespace}}/comments` | fleetbase-api-key | `Fleetbase\Sdk\Services\CommentService::createComment` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Comments/Create%20Comment.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase Core API / Delete Comment](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Comments/Delete%20Comment.request.yaml) | `DELETE {{base_url}}/{{namespace}}/comments/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\CommentService::deleteComment` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Comments/Delete%20Comment.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase Core API / Query Comments](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Comments/Query%20Comments.request.yaml) | `GET {{base_url}}/{{namespace}}/comments` | fleetbase-api-key | `Fleetbase\Sdk\Services\CommentService::queryComments` | query ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Comments/Query%20Comments.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase Core API / Retrieve Comment](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Comments/Retrieve%20Comment.request.yaml) | `GET {{base_url}}/{{namespace}}/comments/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\CommentService::retrieveComment` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Comments/Retrieve%20Comment.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase Core API / Update Comment](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Comments/Update%20Comment.request.yaml) | `PUT {{base_url}}/{{namespace}}/comments/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\CommentService::updateComment` | path, json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Comments/Update%20Comment.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase Core API / Delete a File](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Files/Delete%20a%20File.request.yaml) | `DELETE {{base_url}}/{{namespace}}/files/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\FileService::deleteFile` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Files/Delete%20a%20File.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase Core API / Download File](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Files/Download%20File.request.yaml) | `GET {{base_url}}/{{namespace}}/files/:id/download` | fleetbase-api-key | `Fleetbase\Sdk\Services\FileService::downloadFile` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Files/Download%20File.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase Core API / Query Files](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Files/Query%20Files.request.yaml) | `GET {{base_url}}/{{namespace}}/files` | fleetbase-api-key | `Fleetbase\Sdk\Services\FileService::queryFiles` | query ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Files/Query%20Files.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase Core API / Retrieve a File](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Files/Retrieve%20a%20File.request.yaml) | `GET {{base_url}}/{{namespace}}/files/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\FileService::retrieveFile` | path ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Files/Retrieve%20a%20File.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase Core API / Update File](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Files/Update%20File.request.yaml) | `PUT {{base_url}}/{{namespace}}/files/:id` | fleetbase-api-key | `Fleetbase\Sdk\Services\FileService::updateFile` | path, json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Files/Update%20File.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase Core API / Upload Base64 File](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Files/Upload%20Base64%20File.request.yaml) | `POST {{base_url}}/{{namespace}}/files/base64` | fleetbase-api-key | `Fleetbase\Sdk\Services\FileService::uploadBase64File` | json body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Files/Upload%20Base64%20File.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase Core API / Upload File](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Files/Upload%20File.request.yaml) | `POST {{base_url}}/{{namespace}}/files` | fleetbase-api-key | `Fleetbase\Sdk\Services\FileService::uploadFile` | formdata body ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Files/Upload%20File.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | +| [Fleetbase Core API / Get Current Organization](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Organizations/Get%20Current%20Organization.request.yaml) | `GET {{base_url}}/{{namespace}}/organizations/current` | fleetbase-api-key | `Fleetbase\Sdk\Services\OrganizationService::getCurrentOrganization` | path/method only ([source](https://github.com/fleetbase/postman/blob/43253dbf87e5030d95d12be019dc26fcb7151ed6/postman/collections/Fleetbase%20Core%20API/Organizations/Get%20Current%20Organization.request.yaml)) | No official example | [HTTP status mapping](../tests/HttpClientTest.php) | [endpoint fixture](../tests/Contract/EndpointContractTest.php) | Pending isolated stack | complete | diff --git a/docs/api-examples.md b/docs/api-examples.md new file mode 100644 index 0000000..23f1876 --- /dev/null +++ b/docs/api-examples.md @@ -0,0 +1,4266 @@ +# Fleetbase PHP SDK API examples + +These 220 examples are generated from the locked official Postman contract. CI executes every fenced snippet against a hermetic PSR-18 transport. + +Create `$fleetbase` once as shown in the README, then use the relevant service call below. Fixture identifiers and payloads are illustrative; replace them with values from your application. + +## Contacts + +### Create a Contact + +Creates a contact for the current company. Contacts are used as customers, facilitators, personnel, or other addressable people in Fleet-Ops workflows. + +`POST {{base_url}}/{{namespace}}/contacts` + +```php +$result = $fleetbase->contacts->createContact( + [ + 'body' => [ + 'name' => 'John Doe', + 'type' => 'customer', + 'title' => 'Mr', + 'email' => 'john@exampleco.com', + 'phone' => '+1 563-920-4264', + ], + ], + [] +); +``` + +### Delete a Contact + +Delete a Contact. + +`DELETE {{base_url}}/{{namespace}}/contacts/:id` + +```php +$result = $fleetbase->contacts->deleteContact( + [ + 'id' => 'contact_id-fixture', + ], + [] +); +``` + +### Query Contacts + +Returns a paginated list of contacts for the current organization. Use filters such as `query`, `limit`, `offset`, and `sort` to narrow and order the results. + +`GET {{base_url}}/{{namespace}}/contacts` + +```php +$result = $fleetbase->contacts->queryContacts( + [], + [ + 'query' => [ + 'query' => 'contact_name-fixture', + 'limit' => '25', + 'offset' => '0', + 'sort' => 'created_at', + ], + ] +); +``` + +### Retrieve a Contact + +Retrieve a Contact. + +`GET {{base_url}}/{{namespace}}/contacts/:id` + +```php +$result = $fleetbase->contacts->retrieveContact( + [ + 'id' => 'contact_id-fixture', + ], + [] +); +``` + +### Update a Contact + +Updates a contact's profile, type, primary place, photo, or metadata. + +`PUT {{base_url}}/{{namespace}}/contacts/:id` + +```php +$result = $fleetbase->contacts->updateContact( + [ + 'id' => 'contact_id-fixture', + 'body' => [ + 'name' => 'John Doe', + 'title' => 'Mr', + 'email' => 'john@exampleco.com', + 'phone' => '563-920-4264', + 'meta' => [ + 'external_ref' => 'john-doe', + ], + ], + ], + [] +); +``` + +## Customers + +### Create a Customer + +Creates a customer account (Contact + linked User) after verifying the code from `Request Customer Creation Code`. Returns the customer with a Sanctum `token` — persist this client-side and send it back as the `Customer-Token` header on authenticated requests. + +`POST {{base_url}}/{{namespace}}/customers` + +```php +$result = $fleetbase->customers->createCustomer( + [ + 'body' => [ + 'identity' => 'customer_identity-fixture', + 'code' => 'verification_code-fixture', + 'name' => 'Jane Customer', + 'password' => 'customer_password-fixture', + 'phone' => 'randomPhoneNumber-fixture', + 'place' => [ + 'name' => 'Home', + 'street1' => '123 Main Street', + 'city' => 'Kingston', + 'province' => 'Kingston', + 'postal_code' => '00000', + 'country' => 'JM', + ], + ], + ], + [] +); +``` + +### Create a Customer Order + +Creates an Order on behalf of the authenticated customer. Accepts the canonical Fleet-Ops Order create shape — the same fields as `POST /v1/orders` would accept from an operator. The customer's `uuid` is automatically attached as `orders.customer_uuid`; any client-supplied `customer` field is ignored. `status` is forced to `created` (customers cannot self-dispatch). The Order lands in the company resolved from the API credential. + +`POST {{base_url}}/{{namespace}}/customers/orders` + +```php +$result = $fleetbase->customers->createCustomerOrder( + [ + 'body' => [ + 'type' => 'transport', + 'scheduled_at' => '2026-05-25T10:00:00Z', + 'notes' => 'Handle with care.', + 'pickup' => [ + 'name' => 'Pickup', + 'street1' => '4169 N State RD 7', + 'city' => 'Lauderdale Lakes', + 'province' => 'FL', + 'postal_code' => '33319', + 'country' => 'US', + ], + 'dropoff' => [ + 'name' => 'Dropoff', + 'city' => 'Kingston', + 'country' => 'JM', + ], + 'entities' => [ + [ + 'name' => 'Wireless Headphones', + 'description' => 'Electronics', + 'weight' => 2.5, + 'weight_unit' => 'lb', + 'declared_value' => 150, + 'currency' => 'USD', + ], + ], + ], + ], + [] +); +``` + +### Forgot Customer Password + +Sends a password-reset verification code to the customer's email or phone. Always returns `{ status: ok }` regardless of whether the identity matches an account (prevents enumeration). + +`POST {{base_url}}/{{namespace}}/customers/forgot-password` + +```php +$result = $fleetbase->customers->forgotCustomerPassword( + [ + 'body' => [ + 'identity' => 'customer_identity-fixture', + ], + ], + [] +); +``` + +### List Customer Orders + +Lists orders owned by the authenticated customer (scoped to `orders.customer_uuid`). + +`GET {{base_url}}/{{namespace}}/customers/orders` + +```php +$result = $fleetbase->customers->listCustomerOrders( + [], + [] +); +``` + +### List Customer Places + +Lists the authenticated customer's saved Places (delivery addresses, etc.). + +`GET {{base_url}}/{{namespace}}/customers/places` + +```php +$result = $fleetbase->customers->listCustomerPlaces( + [], + [] +); +``` + +### Login Customer + +Authenticates a customer with email/phone + password. Returns the customer with a Sanctum `token` to use as `Customer-Token`. + +`POST {{base_url}}/{{namespace}}/customers/login` + +```php +$result = $fleetbase->customers->loginCustomer( + [ + 'body' => [ + 'identity' => 'customer_identity-fixture', + 'password' => 'customer_password-fixture', + ], + ], + [] +); +``` + +### Logout All Customer Sessions + +Revokes every Sanctum token issued to the customer's linked user (sign out everywhere). + +`POST {{base_url}}/{{namespace}}/customers/logout-all` + +```php +$result = $fleetbase->customers->logoutAllCustomerSessions( + [], + [] +); +``` + +### Logout Customer + +Revokes the Sanctum token used to make this request. The customer's other active sessions are unaffected — use `Logout All Customer Sessions` to revoke every token for the linked user. + +`POST {{base_url}}/{{namespace}}/customers/logout` + +```php +$result = $fleetbase->customers->logoutCustomer( + [], + [] +); +``` + +### Register Customer Device + +Registers a push-notification device token against the authenticated customer's linked user. + +`POST {{base_url}}/{{namespace}}/customers/register-device` + +```php +$result = $fleetbase->customers->registerCustomerDevice( + [ + 'body' => [ + 'token' => 'push_token-fixture', + 'platform' => 'ios', + ], + ], + [] +); +``` + +### Request Customer Creation Code + +Sends an email or SMS verification code to start a customer signup. Required before calling `Create a Customer`. Optionally include `name` and `phone` so the verification email greets the customer by name and the pending user row is pre-seeded with real values. + +`POST {{base_url}}/{{namespace}}/customers/request-creation-code` + +```php +$result = $fleetbase->customers->requestCustomerCreationCode( + [ + 'body' => [ + 'identity' => 'customer_identity-fixture', + 'mode' => 'email', + 'name' => 'customer_name-fixture', + 'phone' => 'customer_phone-fixture', + ], + ], + [] +); +``` + +### Request Customer Login SMS + +Starts SMS-based passwordless login by sending a verification code to the customer's phone. Falls back to email if SMS delivery fails and an email is on file. + +`POST {{base_url}}/{{namespace}}/customers/login-with-sms` + +```php +$result = $fleetbase->customers->requestCustomerLoginSms( + [ + 'body' => [ + 'phone' => 'customer_phone-fixture', + ], + ], + [] +); +``` + +### Reset Customer Password + +Verifies the reset code from `Forgot Customer Password` and sets a new password. All existing tokens for the customer's user are revoked on success. + +`POST {{base_url}}/{{namespace}}/customers/reset-password` + +```php +$result = $fleetbase->customers->resetCustomerPassword( + [ + 'body' => [ + 'identity' => 'customer_identity-fixture', + 'code' => 'verification_code-fixture', + 'password' => 'customer_password-fixture', + ], + ], + [] +); +``` + +### Retrieve Authenticated Customer + +Returns the profile of the customer identified by the `Customer-Token` header. + +`GET {{base_url}}/{{namespace}}/customers/me` + +```php +$result = $fleetbase->customers->retrieveAuthenticatedCustomer( + [], + [] +); +``` + +### Retrieve a Customer Order + +Fetches a single order by id, public id, or tracking number. Returns 404 if the order doesn't belong to the authenticated customer. + +`GET {{base_url}}/{{namespace}}/customers/orders/{{customer_order_id}}` + +```php +$result = $fleetbase->customers->retrieveCustomerOrder( + [ + 'customer_order_id' => 'customer_order_id-fixture', + ], + [] +); +``` + +### Update Authenticated Customer + +Updates the authenticated customer's profile. Changes to `name`, `email`, and `phone` are mirrored onto the linked user so subsequent logins work. + +`PUT {{base_url}}/{{namespace}}/customers/me` + +```php +$result = $fleetbase->customers->updateAuthenticatedCustomer( + [ + 'body' => [ + 'name' => 'customer_name-fixture', + 'phone' => 'customer_phone-fixture', + 'email' => 'customer_email-fixture', + ], + ], + [] +); +``` + +### Verify Customer Login Code + +Verifies the SMS/email code from `Request Customer Login SMS` and returns the customer with a Sanctum `token`. When `for` is `fleetops_create_customer` this proxies to `Create a Customer`. + +`POST {{base_url}}/{{namespace}}/customers/verify-code` + +```php +$result = $fleetbase->customers->verifyCustomerLoginCode( + [ + 'body' => [ + 'identity' => 'customer_identity-fixture', + 'code' => 'verification_code-fixture', + 'for' => 'fleetops_customer_login', + ], + ], + [] +); +``` + +## Devices + +### Attach Device + +Attach this device to a vehicle. + +`POST {{base_url}}/{{namespace}}/devices/{{device_id}}/attach` + +```php +$result = $fleetbase->devices->attachDevice( + [ + 'device_id' => 'device_id-fixture', + 'body' => [ + 'vehicle' => 'vehicle_id-fixture', + ], + ], + [] +); +``` + +### Create a Device + +Create a device. + +`POST {{base_url}}/{{namespace}}/devices` + +```php +$result = $fleetbase->devices->createDevice( + [ + 'body' => [ + 'name' => 'OBD Tracker 12', + 'type' => 'obd', + 'device_id' => 'OBD-12', + 'serial_number' => 'SN-10001', + 'status' => 'active', + ], + ], + [] +); +``` + +### Delete a Device + +Delete a device. + +`DELETE {{base_url}}/{{namespace}}/devices/{{device_id}}` + +```php +$result = $fleetbase->devices->deleteDevice( + [ + 'device_id' => 'device_id-fixture', + ], + [] +); +``` + +### Detach Device + +Detach this device from its current resource. + +`POST {{base_url}}/{{namespace}}/devices/{{device_id}}/detach` + +```php +$result = $fleetbase->devices->detachDevice( + [ + 'device_id' => 'device_id-fixture', + ], + [] +); +``` + +### Query Devices + +Query devices. + +`GET {{base_url}}/{{namespace}}/devices` + +```php +$result = $fleetbase->devices->queryDevices( + [], + [] +); +``` + +### Retrieve a Device + +Retrieve a device. + +`GET {{base_url}}/{{namespace}}/devices/{{device_id}}` + +```php +$result = $fleetbase->devices->retrieveDevice( + [ + 'device_id' => 'device_id-fixture', + ], + [] +); +``` + +### Update a Device + +Update a device. + +`PUT {{base_url}}/{{namespace}}/devices/{{device_id}}` + +```php +$result = $fleetbase->devices->updateDevice( + [ + 'device_id' => 'device_id-fixture', + 'body' => [ + 'status' => 'maintenance', + ], + ], + [] +); +``` + +## Drivers + +### Change Driver Password + +Changes the password of a driver who is signed in, proving the current one. A password change is an authorisation decision rather than an attribute update, which is why it is not part of `PUT /drivers/:id` — that endpoint does not accept a password at all. Supplying the wrong `current_password` is refused and changes nothing. Every other session is revoked when the password changes, and a fresh token is returned in the same response, so the caller keeps working while other devices are signed out. + +`POST {{base_url}}/{{namespace}}/drivers/:id/change-password` + +```php +$result = $fleetbase->drivers->changeDriverPassword( + [ + 'id' => 'driver_id-fixture', + 'body' => [ + 'current_password' => 'created_driver_password-fixture', + 'password' => 'driver_new_password-fixture', + 'password_confirmation' => 'driver_new_password-fixture', + 'device_name' => 'navigator', + ], + ], + [] +); +``` + +### Create a Driver + +Creates a driver profile and linked user account. Provide a unique email and phone number, then optionally assign a vehicle, vendor, current job, location, or photo. + +`POST {{base_url}}/{{namespace}}/drivers` + +```php +$result = $fleetbase->drivers->createDriver( + [ + 'body' => [ + 'name' => 'John Doe', + 'email' => 'randomEmail-fixture', + 'phone' => 'randomPhoneNumber-fixture', + 'password' => 'driver_seed_password-fixture', + ], + ], + [] +); +``` + +### Delete a Driver + +Use this endpoint to delete a driver. + +`DELETE {{base_url}}/{{namespace}}/drivers/:id` + +```php +$result = $fleetbase->drivers->deleteDriver( + [ + 'id' => 'driver_id-fixture', + ], + [] +); +``` + +### Get Driver Current Organization + +Returns the driver current organization. + +`GET {{base_url}}/{{namespace}}/drivers/:id/current-organization` + +```php +$result = $fleetbase->drivers->getDriverCurrentOrganization( + [ + 'id' => 'driver_id-fixture', + ], + [] +); +``` + +### List Driver Manifests + +Lists the manifests assigned to a driver, newest first. A manifest is a driver's route: an order-agnostic sequence of stops which may span several orders, or none the driver has seen as an order. Defaults to a recent window rather than the driver's whole history. Use `status` and `on` to narrow it further. + +`GET {{base_url}}/{{namespace}}/drivers/:id/manifests` + +```php +$result = $fleetbase->drivers->listDriverManifests( + [ + 'id' => 'driver_id-fixture', + ], + [] +); +``` + +### List Driver Organizations + +Lists organizations a driver belongs to. + +`GET {{base_url}}/{{namespace}}/drivers/:id/organizations` + +```php +$result = $fleetbase->drivers->listDriverOrganizations( + [ + 'id' => 'driver_id-fixture', + ], + [] +); +``` + +### Login Driver + +Authenticates a driver with email/phone and password. + +`POST {{base_url}}/{{namespace}}/drivers/login` + +```php +$result = $fleetbase->drivers->loginDriver( + [ + 'body' => [ + 'identity' => 'driver_identity-fixture', + 'password' => 'driver_password-fixture', + ], + ], + [] +); +``` + +### Query Drivers + +Returns drivers for the current company. Use filters such as `vendor`, search, pagination, or sort parameters to narrow the result set. + +`GET {{base_url}}/{{namespace}}/drivers` + +```php +$result = $fleetbase->drivers->queryDrivers( + [], + [ + 'query' => [ + 'id' => 'driver_id-fixture', + ], + ] +); +``` + +### Register Device + +Registers a driver device token through the non-id route. + +`POST {{base_url}}/{{namespace}}/drivers/register-device` + +```php +$result = $fleetbase->drivers->registerDevice( + [ + 'body' => [ + 'token' => 'device_token-fixture', + 'platform' => 'ios', + ], + ], + [] +); +``` + +### Register Driver Device + +Registers a device token for a specific driver. + +`POST {{base_url}}/{{namespace}}/drivers/:id/register-device` + +```php +$result = $fleetbase->drivers->registerDriverDevice( + [ + 'id' => 'driver_id-fixture', + 'body' => [ + 'token' => 'device_token-fixture', + 'platform' => 'ios', + ], + ], + [] +); +``` + +### Request Driver Login SMS + +Starts driver SMS verification login. + +`POST {{base_url}}/{{namespace}}/drivers/login-with-sms` + +```php +$result = $fleetbase->drivers->requestDriverLoginSms( + [ + 'body' => [ + 'phone' => 'driver_phone-fixture', + ], + ], + [] +); +``` + +### Request Driver Password Reset + +Sends a password reset code to a driver who cannot sign in. The code goes by email or SMS depending on whether `identity` looks like an email address or a phone number. The response is the same whether or not the identity belongs to a driver. That is deliberate: an endpoint that answered differently for an unknown number would be a way to enumerate an organization's drivers. `driver_reset_identity` defaults to a reserved address that belongs to nobody, so running the collection documents the endpoint without sending mail to a stranger. Point it at a real driver to exercise delivery. + +`POST {{base_url}}/{{namespace}}/drivers/forgot-password` + +```php +$result = $fleetbase->drivers->requestDriverPasswordReset( + [ + 'body' => [ + 'identity' => 'driver_reset_identity-fixture', + ], + ], + [] +); +``` + +### Reset Driver Password + +Sets a new password using the code sent by `POST /drivers/forgot-password`. A wrong code, an expired code and an unknown identity all return the same error, so the endpoint cannot be used to test which of the three happened. Every session is revoked on success. A reset is a recovery from losing control of an account, so nothing that was signed in stays signed in. `driver_password_reset_code` is a code issued for this flow specifically — a login code will not do, because the endpoint matches on purpose as well as on value. The password is set back to the one already in force so the run stays repeatable and the driver login requests further down still authenticate. + +`POST {{base_url}}/{{namespace}}/drivers/reset-password` + +```php +$result = $fleetbase->drivers->resetDriverPassword( + [ + 'body' => [ + 'identity' => 'driver_identity-fixture', + 'code' => 'driver_password_reset_code-fixture', + 'password' => 'driver_password-fixture', + ], + ], + [] +); +``` + +### Retrieve a Driver + +This endpoint allows you to retrieve a driver object to view it's details. + +`GET {{base_url}}/{{namespace}}/drivers/:id` + +```php +$result = $fleetbase->drivers->retrieveDriver( + [ + 'id' => 'driver_id-fixture', + ], + [] +); +``` + +### Simulate Driver Route + +Simulates driver movement between two resolvable points, or pass order to simulate an order route. + +`POST {{base_url}}/{{namespace}}/drivers/:id/simulate` + +```php +$result = $fleetbase->drivers->simulateDriverRoute( + [ + 'id' => 'driver_id-fixture', + 'body' => [ + 'start' => [ + 'latitude' => 1.3521, + 'longitude' => 103.8198, + ], + 'end' => [ + 'latitude' => 1.2903, + 'longitude' => 103.8519, + ], + ], + ], + [] +); +``` + +### Switch Driver Organization + +Switches the driver session to another organization. The driver must already belong to the target organization, and it must not be the one they are currently in — switching to the current organization is rejected. A driver created through `POST /drivers` belongs to a single organization, so this example uses one that belongs to more than one. + +`POST {{base_url}}/{{namespace}}/drivers/:id/switch-organization` + +```php +$result = $fleetbase->drivers->switchDriverOrganization( + [ + 'id' => 'multi_org_driver_id-fixture', + 'body' => [ + 'next' => 'secondary_organization_id-fixture', + ], + ], + [] +); +``` + +### Toggle Driver Online + +Toggles or sets driver online status. + +`POST {{base_url}}/{{namespace}}/drivers/:id/toggle-online` + +```php +$result = $fleetbase->drivers->toggleDriverOnline( + [ + 'id' => 'driver_id-fixture', + 'body' => [ + 'online' => true, + ], + ], + [] +); +``` + +### Track Driver + +`PATCH {{base_url}}/{{namespace}}/drivers/:id/track` + +```php +$result = $fleetbase->drivers->trackDriver( + [ + 'id' => 'driver_id-fixture', + ], + [] +); +``` + +### Update a Driver + +Updates a driver's account fields, assignment, status, location, photo, or metadata. + +`PUT {{base_url}}/{{namespace}}/drivers/:id` + +```php +$result = $fleetbase->drivers->updateDriver( + [ + 'id' => 'driver_id-fixture', + 'body' => [ + 'name' => 'John Doe', + 'email' => 'randomEmail-fixture', + 'phone' => 'randomPhoneNumber-fixture', + ], + ], + [] +); +``` + +### Verify Driver Login Code + +Verifies driver login code and returns a driver token. + +`POST {{base_url}}/{{namespace}}/drivers/verify-code` + +```php +$result = $fleetbase->drivers->verifyDriverLoginCode( + [ + 'body' => [ + 'identity' => 'driver_identity-fixture', + 'code' => 'verification_code-fixture', + ], + ], + [] +); +``` + +## Entities + +### Create an Entity + +Creates an entity such as a parcel, package, or item. Attach it to a payload and optionally set a destination or waypoint within that payload route. + +`POST {{base_url}}/{{namespace}}/entities` + +```php +$result = $fleetbase->entities->createEntity( + [ + 'body' => [ + 'name' => 'SampleEntity', + 'type' => 'parcel', + 'payload' => 'payload_id-fixture', + 'customer' => 'ACustomer', + 'internal_id' => 'ENTITY001', + 'description' => 'Sample description', + 'meta' => [ + 'warehouse_bin' => '1', + 'warehouse_rack' => '3', + 'warehouse_section' => '4', + ], + 'weight' => 2.5, + 'weight_unit' => 'kg', + 'length' => 10, + 'width' => 5, + 'height' => 8, + 'dimensions_unit' => 'mm', + 'declared_value' => 1500, + 'price' => 1200, + 'sale_price' => 900, + 'sku' => 'SKU123', + 'currency' => 'USD', + ], + ], + [] +); +``` + +### Delete a Entity + +Delete an Entity. + +`DELETE {{base_url}}/{{namespace}}/entities/:id` + +```php +$result = $fleetbase->entities->deleteEntity( + [ + 'id' => 'entity_id-fixture', + ], + [] +); +``` + +### Query Entities + +Returns entities for the current company. Use filters such as `type`, `payload`, or `destination` to narrow the result set. + +`GET {{base_url}}/{{namespace}}/entities` + +```php +$result = $fleetbase->entities->queryEntities( + [], + [ + 'query' => [ + 'limit' => '25', + 'offset' => '0', + 'sort' => 'created_at', + 'type' => 'parcel', + ], + ] +); +``` + +### Retrieve an Entity + +Retrieve an Entity. + +`GET {{base_url}}/{{namespace}}/entities/:id` + +```php +$result = $fleetbase->entities->retrieveEntity( + [ + 'id' => 'entity_id-fixture', + ], + [] +); +``` + +### Update a Entity + +Updates an entity's descriptive fields, payload assignment, destination, dimensions, weight, pricing, or metadata. + +`PUT {{base_url}}/{{namespace}}/entities/:id` + +```php +$result = $fleetbase->entities->updateEntity( + [ + 'id' => 'entity_id-fixture', + 'body' => [ + 'internal_id' => 'ENTITY001-1', + 'description' => 'New entity description', + 'destination' => '', + 'sku' => 'SKUABC123', + 'currency' => 'SGD', + ], + ], + [] +); +``` + +## Equipment + +### Create Equipment + +Create equipment. + +`POST {{base_url}}/{{namespace}}/equipment` + +```php +$result = $fleetbase->equipment->createEquipment( + [ + 'body' => [ + 'name' => 'Liftgate LG-12', + 'code' => 'LG-12', + 'type' => 'liftgate', + 'status' => 'available', + 'serial_number' => 'LG120045', + 'manufacturer' => 'Maxon', + 'model' => 'BMR', + 'currency' => 'USD', + ], + ], + [] +); +``` + +### Delete Equipment + +Delete equipment. + +`DELETE {{base_url}}/{{namespace}}/equipment/{{equipment_id}}` + +```php +$result = $fleetbase->equipment->deleteEquipment( + [ + 'equipment_id' => 'equipment_id-fixture', + ], + [] +); +``` + +### Query Equipment + +Query equipment. + +`GET {{base_url}}/{{namespace}}/equipment` + +```php +$result = $fleetbase->equipment->queryEquipment( + [], + [] +); +``` + +### Retrieve Equipment + +Retrieve equipment. + +`GET {{base_url}}/{{namespace}}/equipment/{{equipment_id}}` + +```php +$result = $fleetbase->equipment->retrieveEquipment( + [ + 'equipment_id' => 'equipment_id-fixture', + ], + [] +); +``` + +### Update Equipment + +Update equipment. + +`PUT {{base_url}}/{{namespace}}/equipment/{{equipment_id}}` + +```php +$result = $fleetbase->equipment->updateEquipment( + [ + 'equipment_id' => 'equipment_id-fixture', + 'body' => [ + 'status' => 'maintenance', + ], + ], + [] +); +``` + +## Fleets + +### Create a Fleet + +Creates a fleet for grouping drivers and vehicles. Assign a service area when the fleet should be constrained to a specific operating area. + +`POST {{base_url}}/{{namespace}}/fleets` + +```php +$result = $fleetbase->fleets->createFleet( + [ + 'body' => [ + 'name' => 'Haulers', + 'service_area' => 'service_area_id-fixture', + ], + ], + [] +); +``` + +### Delete a Fleet + +Deletes a fleet. + +`DELETE {{base_url}}/{{namespace}}/fleets/:id` + +```php +$result = $fleetbase->fleets->deleteFleet( + [ + 'id' => 'fleet_id-fixture', + ], + [] +); +``` + +### Query Fleets + +Returns a paginated list of fleets for the current organization. Use pagination and sorting parameters to control the result set. + +`GET {{base_url}}/{{namespace}}/fleets` + +```php +$result = $fleetbase->fleets->queryFleets( + [], + [ + 'query' => [ + 'limit' => '25', + 'offset' => '0', + 'sort' => 'created_at', + ], + ] +); +``` + +### Retrieve a Fleet + +Retrieves a fleet. + +`GET {{base_url}}/{{namespace}}/fleets/:id` + +```php +$result = $fleetbase->fleets->retrieveFleet( + [ + 'id' => 'fleet_id-fixture', + ], + [] +); +``` + +### Update a Fleet + +Updates a fleet's name or assigned service area. + +`PUT {{base_url}}/{{namespace}}/fleets/:id` + +```php +$result = $fleetbase->fleets->updateFleet( + [ + 'id' => 'fleet_id-fixture', + 'body' => [ + 'name' => 'Haulers', + 'service_area' => 'service_area_id-fixture', + ], + ], + [] +); +``` + +## Fuel Reports + +### Create a Fuel Report + +Create a Fuel Report + +`POST {{base_url}}/{{namespace}}/fuel-reports` + +```php +$result = $fleetbase->fuelReports->createFuelReport( + [ + 'body' => [ + 'driver' => 'driver_id-fixture', + 'odometer' => 12042, + 'volume' => 42.5, + 'metric_unit' => 'liter', + 'location' => [ + 'latitude' => 1.3521, + 'longitude' => 103.8198, + ], + 'amount' => 120.5, + 'currency' => 'USD', + 'status' => 'submitted', + ], + ], + [] +); +``` + +### Delete a Fuel Report + +Delete a Fuel Report + +`DELETE {{base_url}}/{{namespace}}/fuel-reports/:id` + +```php +$result = $fleetbase->fuelReports->deleteFuelReport( + [ + 'id' => 'fuel_report_id-fixture', + ], + [] +); +``` + +### Query Fuel Reports + +Query Fuel Reports + +`GET {{base_url}}/{{namespace}}/fuel-reports` + +```php +$result = $fleetbase->fuelReports->queryFuelReports( + [], + [ + 'query' => [ + 'limit' => '25', + 'offset' => '0', + 'sort' => 'created_at', + ], + ] +); +``` + +### Retrieve a Fuel Report + +Retrieve a Fuel Report + +`GET {{base_url}}/{{namespace}}/fuel-reports/:id` + +```php +$result = $fleetbase->fuelReports->retrieveFuelReport( + [ + 'id' => 'fuel_report_id-fixture', + ], + [] +); +``` + +### Update a Fuel Report + +Update a Fuel Report + +`PUT {{base_url}}/{{namespace}}/fuel-reports/:id` + +```php +$result = $fleetbase->fuelReports->updateFuelReport( + [ + 'id' => 'fuel_report_id-fixture', + 'body' => [ + 'odometer' => 12050, + 'volume' => 43.1, + 'metric_unit' => 'liter', + 'amount' => 122.75, + 'currency' => 'USD', + 'status' => 'approved', + ], + ], + [] +); +``` + +## Fuel Transactions + +### Create a Fuel Transaction + +Create a fuel transaction. + +`POST {{base_url}}/{{namespace}}/fuel-transactions` + +```php +$result = $fleetbase->fuelTransactions->createFuelTransaction( + [ + 'body' => [ + 'provider' => 'petroapp', + 'provider_transaction_id' => 'TX-timestamp-fixture', + 'vehicle' => 'vehicle_id-fixture', + 'station_name' => 'North Depot Fuel', + 'transaction_at' => '2026-05-07T08:30:00Z', + 'volume' => 42.5, + 'metric_unit' => 'liter', + 'amount' => 6500, + 'currency' => 'USD', + ], + ], + [] +); +``` + +### Delete a Fuel Transaction + +Delete a fuel transaction. + +`DELETE {{base_url}}/{{namespace}}/fuel-transactions/{{fuel_transaction_id}}` + +```php +$result = $fleetbase->fuelTransactions->deleteFuelTransaction( + [ + 'fuel_transaction_id' => 'fuel_transaction_id-fixture', + ], + [] +); +``` + +### Match Fuel Transaction Order + +Match this fuel transaction to an order. + +`POST {{base_url}}/{{namespace}}/fuel-transactions/{{fuel_transaction_id}}/match-order` + +```php +$result = $fleetbase->fuelTransactions->matchFuelTransactionOrder( + [ + 'fuel_transaction_id' => 'fuel_transaction_id-fixture', + 'body' => [ + 'order' => 'order_id-fixture', + ], + ], + [] +); +``` + +### Match Fuel Transaction Vehicle + +Match this fuel transaction to a vehicle. + +`POST {{base_url}}/{{namespace}}/fuel-transactions/{{fuel_transaction_id}}/match-vehicle` + +```php +$result = $fleetbase->fuelTransactions->matchFuelTransactionVehicle( + [ + 'fuel_transaction_id' => 'fuel_transaction_id-fixture', + 'body' => [ + 'vehicle' => 'vehicle_id-fixture', + ], + ], + [] +); +``` + +### Query Fuel Transactions + +Query fuel transactions. + +`GET {{base_url}}/{{namespace}}/fuel-transactions` + +```php +$result = $fleetbase->fuelTransactions->queryFuelTransactions( + [], + [] +); +``` + +### Reprocess Fuel Transaction + +Reprocess matching and fuel report generation for this fuel transaction. + +`POST {{base_url}}/{{namespace}}/fuel-transactions/{{fuel_transaction_id}}/reprocess` + +```php +$result = $fleetbase->fuelTransactions->reprocessFuelTransaction( + [ + 'fuel_transaction_id' => 'fuel_transaction_id-fixture', + ], + [] +); +``` + +### Retrieve a Fuel Transaction + +Retrieve a fuel transaction. + +`GET {{base_url}}/{{namespace}}/fuel-transactions/{{fuel_transaction_id}}` + +```php +$result = $fleetbase->fuelTransactions->retrieveFuelTransaction( + [ + 'fuel_transaction_id' => 'fuel_transaction_id-fixture', + ], + [] +); +``` + +### Review Fuel Transaction + +Mark this fuel transaction as reviewed or ignored. + +`POST {{base_url}}/{{namespace}}/fuel-transactions/{{fuel_transaction_id}}/review` + +```php +$result = $fleetbase->fuelTransactions->reviewFuelTransaction( + [ + 'fuel_transaction_id' => 'fuel_transaction_id-fixture', + 'body' => [ + 'status' => 'reviewed', + ], + ], + [] +); +``` + +### Update a Fuel Transaction + +Update a fuel transaction. + +`PUT {{base_url}}/{{namespace}}/fuel-transactions/{{fuel_transaction_id}}` + +```php +$result = $fleetbase->fuelTransactions->updateFuelTransaction( + [ + 'fuel_transaction_id' => 'fuel_transaction_id-fixture', + 'body' => [ + 'sync_status' => 'reviewed', + ], + ], + [] +); +``` + +## Geofences + +### Get Driver Geofence History + +Get Driver Geofence History + +`GET {{base_url}}/{{namespace}}/geofences/driver/:driverId/history` + +```php +$result = $fleetbase->geofences->getDriverGeofenceHistory( + [ + 'driverId' => 'driver_id-fixture', + ], + [ + 'query' => [ + 'per_page' => '50', + ], + ] +); +``` + +### Get Geofence Dwell Report + +Get Geofence Dwell Report + +`GET {{base_url}}/{{namespace}}/geofences/dwell-report` + +```php +$result = $fleetbase->geofences->getGeofenceDwellReport( + [], + [ + 'query' => [ + 'from' => 'from_datetime-fixture', + 'to' => 'to_datetime-fixture', + ], + ] +); +``` + +### Get Geofence Inventory + +Get Geofence Inventory + +`GET {{base_url}}/{{namespace}}/geofences/inventory` + +```php +$result = $fleetbase->geofences->getGeofenceInventory( + [], + [] +); +``` + +### List Geofence Events + +List Geofence Events + +`GET {{base_url}}/{{namespace}}/geofences/events` + +```php +$result = $fleetbase->geofences->listGeofenceEvents( + [], + [ + 'query' => [ + 'per_page' => '50', + 'event_type' => 'entered', + ], + ] +); +``` + +## Issues + +### Create an Issue + +Create an Issue + +`POST {{base_url}}/{{namespace}}/issues` + +```php +$result = $fleetbase->issues->createIssue( + [ + 'body' => [ + 'driver' => 'driver_id-fixture', + 'location' => [ + 'latitude' => 1.3521, + 'longitude' => 103.8198, + ], + 'report' => 'Vehicle tire pressure warning', + 'category' => 'vehicle', + 'type' => 'maintenance', + 'priority' => 'medium', + 'status' => 'open', + ], + ], + [] +); +``` + +### Delete an Issue + +Delete an Issue + +`DELETE {{base_url}}/{{namespace}}/issues/:id` + +```php +$result = $fleetbase->issues->deleteIssue( + [ + 'id' => 'issue_id-fixture', + ], + [] +); +``` + +### Query Issues + +Query Issues + +`GET {{base_url}}/{{namespace}}/issues` + +```php +$result = $fleetbase->issues->queryIssues( + [], + [ + 'query' => [ + 'limit' => '25', + 'offset' => '0', + 'sort' => 'created_at', + ], + ] +); +``` + +### Retrieve an Issue + +Retrieve an Issue + +`GET {{base_url}}/{{namespace}}/issues/:id` + +```php +$result = $fleetbase->issues->retrieveIssue( + [ + 'id' => 'issue_id-fixture', + ], + [] +); +``` + +### Update an Issue + +Update an Issue + +`PUT {{base_url}}/{{namespace}}/issues/:id` + +```php +$result = $fleetbase->issues->updateIssue( + [ + 'id' => 'issue_id-fixture', + 'body' => [ + 'report' => 'Updated issue report', + 'category' => 'vehicle', + 'type' => 'maintenance', + 'priority' => 'high', + 'status' => 'resolved', + ], + ], + [] +); +``` + +## Labels + +### Render Label + +Renders a PDF, text, or base64 label for an order, waypoint, or entity id. + +`GET {{base_url}}/{{namespace}}/labels/:id` + +```php +$result = $fleetbase->labels->renderLabel( + [ + 'id' => 'order_id-fixture', + ], + [ + 'query' => [ + 'format' => 'stream', + 'type' => 'order', + ], + ] +); +``` + +## Manifests + +### Optimize a Manifest + +Re-sequences the stops a driver has not done yet, nearest first. This is the driver's optimise, not the orchestrator's. The orchestrator allocates orders across a fleet and produces manifests; this reorders the stops of one manifest that is already assigned. It is a nearest-neighbour walk over road distances: from the driver's position to the closest remaining stop, then the closest from there. That is usually a large improvement on an arbitrary order and is not guaranteed optimal. Completed and skipped stops keep their place — a route already driven is not re-planned. A manifest with fewer than three stops still to do is returned unchanged, since there is no ordering to find. Send `latitude` and `longitude` to start the walk from where the driver actually is. Without them it starts from the first stop still to do. + +`POST {{base_url}}/{{namespace}}/manifests/:id/optimize` + +```php +$result = $fleetbase->manifests->optimizeManifest( + [ + 'id' => 'manifest_id-fixture', + 'body' => [ + 'latitude' => 1.3521, + 'longitude' => 103.8198, + ], + ], + [] +); +``` + +### Retrieve a Manifest + +Retrieves a manifest with its stops, in the sequence they are to be driven. Each stop carries its place inline — a route of twenty stops is one request, not twenty-one — along with its status, estimated and actual arrival, and the distance and duration from the previous stop. + +`GET {{base_url}}/{{namespace}}/manifests/:id` + +```php +$result = $fleetbase->manifests->retrieveManifest( + [ + 'id' => 'manifest_id-fixture', + ], + [] +); +``` + +### Update a Manifest Stop + +Marks a stop on a manifest as arrived, completed or skipped. Status changes run through the manifest's own transitions rather than writing a column, so arrival and completion timestamps are recorded and a manifest completes itself when its last stop does. Any other status is refused and changes nothing. + +`PATCH {{base_url}}/{{namespace}}/manifest-stops/:id` + +```php +$result = $fleetbase->manifests->updateManifestStop( + [ + 'id' => 'manifest_stop_id-fixture', + 'body' => [ + 'status' => 'arrived', + ], + ], + [] +); +``` + +## Onboard + +### Get Driver Onboard Settings + +Returns driver onboarding settings for an organization. + +`GET {{base_url}}/{{namespace}}/onboard/driver-onboard-settings/:companyId` + +```php +$result = $fleetbase->onboard->getDriverOnboardSettings( + [ + 'companyId' => 'organization_id-fixture', + ], + [] +); +``` + +## Orchestrator + +### Commit Orchestrator Plan + +Commits a proposed orchestrator plan by creating manifests and applying vehicle and driver assignments to orders. Assignment records must use public resource IDs. This endpoint is engine-agnostic: commit the `assignments` returned by route-aware VROOM, VROOM capacity-only, native capacity-only, or multi-phase orchestration runs. Do not submit internal UUIDs or database IDs. + +`POST {{base_url}}/{{namespace}}/orchestrator/commit` + +```php +$result = $fleetbase->orchestrator->commitOrchestratorPlan( + [ + 'body' => [ + 'scheduled_date' => '2026-05-16', + 'assignments' => [ + [ + 'order_id' => 'order_id-fixture', + 'vehicle_id' => 'vehicle_id-fixture', + 'driver_id' => 'driver_id-fixture', + 'sequence' => 1, + 'arrival' => 1778918400, + 'duration' => 900, + 'distance' => 4200, + ], + ], + ], + ], + [] +); +``` + +### Run Orchestrator + +Runs an orchestration phase and returns a proposed assignment plan without committing changes. Use `options.engine` to force an engine: `greedy` and `capacity` are built in and need no external service, while `vroom` requires a reachable VROOM instance. Omitting `options.engine` uses the orchestrator engine configured in admin settings, which defaults to `greedy`. For normal route-aware VROOM allocation, send `options.engine: "vroom"` and omit `allocation_strategy` or set it to `route_aware`. Vehicles must have usable positions because VROOM will solve against route coordinates. For capacity-only VROOM allocation, send `options.engine: "vroom"` and `options.allocation_strategy: "capacity_only"`. This mode answers which vehicles can carry the selected orders by weight, volume, pallets, parcels, skills, and task limits without requiring vehicle locations. Use `options.vehicle_packing: "minimize_vehicles"` to bias VROOM toward filling feasible vehicles before opening another vehicle; use `balanced` or `none` to disable that packing bias. For Fleetbase's deterministic built-in capacity allocation, send `options.engine: "capacity"`. This native engine is useful as a fallback and debugging baseline for capacity-only allocation without VROOM. The consumable API accepts and returns public IDs only. Use `order_ids`, `vehicle_ids`, `driver_ids`, `prior_assignments.*_id`, and response `*_id` values as public IDs. Do not submit internal UUIDs. + +`POST {{base_url}}/{{namespace}}/orchestrator/run` + +```php +$result = $fleetbase->orchestrator->runOrchestrator( + [ + 'body' => [ + 'mode' => 'assign_vehicles', + 'order_ids' => [ + 'order_id-fixture', + ], + 'vehicle_ids' => [ + 'vehicle_id-fixture', + ], + 'driver_ids' => [], + 'prior_assignments' => [], + 'options' => [ + 'engine' => 'greedy', + 'allocation_strategy' => 'route_aware', + 'geometry' => false, + 'respect_capacity' => true, + 'respect_skills' => true, + 'return_to_depot' => false, + ], + ], + ], + [] +); +``` + +## Order Configs + +### Query Order Configs + +Lists OrderConfigs available to the company resolved from the API credential. + +`GET {{base_url}}/{{namespace}}/order-configs` + +```php +$result = $fleetbase->orderConfigs->queryOrderConfigs( + [], + [] +); +``` + +### Retrieve an Order Config + +Fetches a single OrderConfig. The `{id}` segment accepts any identifier supported by `OrderConfig::resolveFromIdentifier` — `uuid`, `public_id`, `namespace`, or short `key`. Use `transport` to retrieve the system default flow. + +`GET {{base_url}}/{{namespace}}/order-configs/{{order_config_id}}` + +```php +$result = $fleetbase->orderConfigs->retrieveOrderConfig( + [ + 'order_config_id' => 'order_config_id-fixture', + ], + [] +); +``` + +## Orders + +### Cancel an Order + +Cancels an order without deleting the order resource. + +`DELETE {{base_url}}/{{namespace}}/orders/:id/cancel` + +```php +$result = $fleetbase->orders->cancelOrder( + [ + 'id' => 'order_id-fixture', + ], + [] +); +``` + +### Capture Photo for Order + +Captures proof photos for an order or order subject. + +`POST {{base_url}}/{{namespace}}/orders/:id/capture-photo/:subjectId` + +```php +$result = $fleetbase->orders->capturePhotoForOrder( + [ + 'id' => 'order_id-fixture', + 'subjectId' => 'subject_id-fixture', + 'body' => [ + 'photos' => [ + 'proof_photo_base64-fixture', + ], + 'remarks' => 'Verified by Photo', + 'data' => [], + ], + ], + [] +); +``` + +### Capture QR Code for Order + +Captures a QR code proof for an order or order subject. The response includes the updated proof data associated with the order. + +`POST {{base_url}}/{{namespace}}/orders/:id/capture-qr/:subject-id` + +```php +$result = $fleetbase->orders->captureQrCodeForOrder( + [ + 'id' => 'order_id-fixture', + 'subject-id' => '', + 'body' => [ + 'code' => 'qr_code-fixture', + 'data' => [], + 'raw_data' => [], + ], + ], + [] +); +``` + +### Capture Signature for Order + +Captures a signature proof for an order or order subject. Use this when a workflow requires signed proof of delivery or pickup. + +`POST {{base_url}}/{{namespace}}/orders/:id/capture-signature/:subject-id` + +```php +$result = $fleetbase->orders->captureSignatureForOrder( + [ + 'id' => 'order_id-fixture', + 'subject-id' => '', + 'body' => [ + 'signature' => 'proof_signature_base64-fixture', + 'data' => [], + ], + ], + [] +); +``` + +### Complete an Order + +Completes an order after all waypoints are complete. + +`POST {{base_url}}/{{namespace}}/orders/:id/complete` + +```php +$result = $fleetbase->orders->completeOrder( + [ + 'id' => 'order_id-fixture', + ], + [] +); +``` + +### Create an Order + +Creates a new order for the current company. Provide an existing payload ID, an inline payload, a pickup/dropoff pair, or at least two waypoints; Fleetbase creates or attaches the payload before creating the order. You can assign a driver, vehicle, facilitator, customer, service quote, or schedule at creation time. When `dispatch` is true, Fleetbase dispatches the order after it is created unless the order belongs to an integrated vendor flow. + +`POST {{base_url}}/{{namespace}}/orders` + +```php +$result = $fleetbase->orders->createOrder( + [ + 'body' => [ + 'pickup' => 'Singapore 018971', + 'dropoff' => '321 Orchard Rd, Singapore', + 'waypoints' => [ + '10 Bayfront Avenue, Singapore 018956', + '18 Marina Gardens Drive, Singapore 018953', + '80 Mandai Lake Rd, Singapore 729826', + '1 Beach Road, Singapore 189673', + ], + 'dispatch' => false, + 'driver' => 'driver_id-fixture', + 'facilitator' => 'vendor_id-fixture', + 'customer' => 'contact_id-fixture', + 'meta' => [ + 'Warehouse' => 'WAREHOUSE-123', + ], + 'notes' => 'Order notes', + ], + ], + [] +); +``` + +### Create an Order using Complete Payload + +Creates an order using the Complete Payload payload shape. Promoted from a stored example so the shape is actually exercised: the Postman CLI runs requests, never examples, so these shapes had no coverage at all. + +`POST {{base_url}}/{{namespace}}/orders` + +```php +$result = $fleetbase->orders->createOrderUsingCompletePayload( + [ + 'body' => [ + 'pickup' => 'Singapore 018971', + 'dropoff' => '321 Orchard Rd, Singapore', + 'dispatch' => false, + 'driver' => 'driver_id-fixture', + 'customer' => 'contact_id-fixture', + 'notes' => 'Deliver through receiving bay.', + ], + ], + [] +); +``` + +### Create an Order using Coordinates + +Creates an order with `pickup` and `dropoff` given as coordinate objects. `Place::createFromMixed` accepts a place as more than a public id. When the value is a coordinate pair it resolves through `createFromCoordinates`, so no address lookup is involved. Latitude and longitude are read through a list of aliases — `lat`, `latitude`, `x`, `0` and `lon`, `lng`, `longitude`, `y`, `1` — so several spellings are equivalent. + +`POST {{base_url}}/{{namespace}}/orders` + +```php +$result = $fleetbase->orders->createOrderUsingCoordinates( + [ + 'body' => [ + 'pickup' => [ + 'latitude' => 1.2830632, + 'longitude' => 103.8579965, + ], + 'dropoff' => [ + 'lat' => 1.4043, + 'lng' => 103.793, + ], + ], + ], + [] +); +``` + +### Create an Order using GeoJSON Points + +Creates an order with `pickup` and `dropoff` given as GeoJSON Point objects. `Place::createFromMixed` recognises GeoJSON directly, so a client already holding GeoJSON geometry does not have to convert it. Note the GeoJSON axis order is `[longitude, latitude]`, the reverse of the coordinate-object form. + +`POST {{base_url}}/{{namespace}}/orders` + +```php +$result = $fleetbase->orders->createOrderUsingGeojsonPoints( + [ + 'body' => [ + 'pickup' => [ + 'type' => 'Point', + 'coordinates' => [ + 103.8579965, + 1.2830632, + ], + ], + 'dropoff' => [ + 'type' => 'Point', + 'coordinates' => [ + 103.793, + 1.4043, + ], + ], + ], + ], + [] +); +``` + +### Create an Order using Payload + +Creates an order using the Payload payload shape. Promoted from a stored example so the shape is actually exercised: the Postman CLI runs requests, never examples, so these shapes had no coverage at all. + +`POST {{base_url}}/{{namespace}}/orders` + +```php +$result = $fleetbase->orders->createOrderUsingPayload( + [ + 'body' => [ + 'payload' => [ + 'pickup' => 'Singapore 018971', + 'dropoff' => '321 Orchard Rd, Singapore', + 'entities' => [ + [ + 'name' => 'UltraHD 4K Smart TV', + 'description' => '65-inch high-definition smart TV with vibrant colors and a sleek design.', + 'currency' => 'USD', + 'price' => 1200, + ], + [ + 'name' => 'Bluetooth Wireless Headphones', + 'description' => 'Noise-cancelling, over-ear headphones with long-lasting battery life.', + 'currency' => 'USD', + 'price' => 250, + ], + [ + 'name' => 'Smart Fitness Watch', + 'description' => 'Water-resistant fitness watch with heart rate monitor and GPS tracking.', + 'currency' => 'USD', + 'price' => 199.99, + ], + ], + ], + 'meta' => [ + 'Warehouse' => 'WAREHOUSE-123', + ], + 'notes' => 'Order notes', + ], + ], + [] +); +``` + +### Create an Order using Waypoints and Entities with Photos + +Creates an order using the Waypoints and Entities with Photos payload shape. Promoted from a stored example so the shape is actually exercised: the Postman CLI runs requests, never examples, so these shapes had no coverage at all. + +`POST {{base_url}}/{{namespace}}/orders` + +```php +$result = $fleetbase->orders->createOrderUsingWaypointsAndEntitiesWithPhotos( + [ + 'body' => [ + 'payload' => [ + 'waypoints' => [ + 'Singapore 018971', + '321 Orchard Rd, Singapore', + ], + 'entities' => [ + [ + 'destination' => 0, + 'name' => 'UltraHD 4K Smart TV', + 'description' => '65-inch high-definition smart TV with vibrant colors and a sleek design.', + 'currency' => 'USD', + 'price' => 1200, + 'photo' => 'https://cdn.thewirecutter.com/wp-content/media/2025/07/BEST-BUDGET-4K-TV-2048px-3185-2x1-1.jpg?width=1024&quality=75&crop=2:1&auto=webp', + ], + [ + 'destination' => 0, + 'name' => 'Bluetooth Wireless Headphones', + 'description' => 'Noise-cancelling, over-ear headphones with long-lasting battery life.', + 'currency' => 'USD', + 'price' => 250, + 'photo' => 'https://cdn.thewirecutter.com/wp-content/media/2025/07/BEST-BUDGET-4K-TV-2048px-3185-2x1-1.jpg?width=1024&quality=75&crop=2:1&auto=webp', + ], + [ + 'destination' => 1, + 'name' => 'Smart Fitness Watch', + 'description' => 'Water-resistant fitness watch with heart rate monitor and GPS tracking.', + 'currency' => 'USD', + 'price' => 199.99, + 'photo' => 'https://cdn.thewirecutter.com/wp-content/media/2025/07/BEST-BUDGET-4K-TV-2048px-3185-2x1-1.jpg?width=1024&quality=75&crop=2:1&auto=webp', + ], + ], + ], + 'meta' => [ + 'Warehouse' => 'WAREHOUSE-123', + ], + 'notes' => 'Order notes', + ], + ], + [] +); +``` + +### Create an Order using Waypoints and Entity Destinations + +Creates an order using the Waypoints and Entity Destinations payload shape. Promoted from a stored example so the shape is actually exercised: the Postman CLI runs requests, never examples, so these shapes had no coverage at all. + +`POST {{base_url}}/{{namespace}}/orders` + +```php +$result = $fleetbase->orders->createOrderUsingWaypointsAndEntityDestinations( + [ + 'body' => [ + 'payload' => [ + 'waypoints' => [ + 'Singapore 018971', + '321 Orchard Rd, Singapore', + ], + 'entities' => [ + [ + 'destination' => 0, + 'name' => 'UltraHD 4K Smart TV', + 'description' => '65-inch high-definition smart TV with vibrant colors and a sleek design.', + 'currency' => 'USD', + 'price' => 1200, + ], + [ + 'destination' => 0, + 'name' => 'Bluetooth Wireless Headphones', + 'description' => 'Noise-cancelling, over-ear headphones with long-lasting battery life.', + 'currency' => 'USD', + 'price' => 250, + ], + [ + 'destination' => 1, + 'name' => 'Smart Fitness Watch', + 'description' => 'Water-resistant fitness watch with heart rate monitor and GPS tracking.', + 'currency' => 'USD', + 'price' => 199.99, + ], + ], + ], + 'meta' => [ + 'Warehouse' => 'WAREHOUSE-123', + ], + 'notes' => 'Order notes', + ], + ], + [] +); +``` + +### Create an Order using only Pickup Dropoff + +Creates an order using the only Pickup Dropoff payload shape. Promoted from a stored example so the shape is actually exercised: the Postman CLI runs requests, never examples, so these shapes had no coverage at all. + +`POST {{base_url}}/{{namespace}}/orders` + +```php +$result = $fleetbase->orders->createOrderUsingOnlyPickupDropoff( + [ + 'body' => [ + 'pickup' => 'Singapore 018971', + 'dropoff' => '321 Orchard Rd, Singapore', + ], + ], + [] +); +``` + +### Create an Order using only Waypoints + +Creates an order using the only Waypoints payload shape. Promoted from a stored example so the shape is actually exercised: the Postman CLI runs requests, never examples, so these shapes had no coverage at all. + +`POST {{base_url}}/{{namespace}}/orders` + +```php +$result = $fleetbase->orders->createOrderUsingOnlyWaypoints( + [ + 'body' => [ + 'waypoints' => [ + [ + 1.3521, + 103.8198, + ], + '10 Bayfront Avenue, Singapore 018956', + '18 Marina Gardens Drive, Singapore 018953', + '80 Mandai Lake Rd, Singapore 729826', + '1 Beach Road, Singapore 189673', + 'Sentosa, Singapore', + ], + ], + ], + [] +); +``` + +### Delete an Order + +Deletes an order resource. + +`DELETE {{base_url}}/{{namespace}}/orders/:id` + +```php +$result = $fleetbase->orders->deleteOrder( + [ + 'id' => 'order_id-fixture', + ], + [] +); +``` + +### Dispatch an Order + +Dispatches an order to an assigned or eligible driver. The response returns the order after dispatch state has been applied. + +`PATCH {{base_url}}/{{namespace}}/orders/:id/dispatch` + +```php +$result = $fleetbase->orders->dispatchOrder( + [ + 'id' => 'order_id-fixture', + ], + [] +); +``` + +### Get Editable Entity Fields + +Returns configured editable entity fields for an order. + +`GET {{base_url}}/{{namespace}}/orders/:id/editable-entity-fields` + +```php +$result = $fleetbase->orders->getEditableEntityFields( + [ + 'id' => 'order_id-fixture', + ], + [] +); +``` + +### Get Order Distance and Time + +Returns and updates the order distance/time matrix. + +`GET {{base_url}}/{{namespace}}/orders/:id/distance-and-time` + +```php +$result = $fleetbase->orders->getOrderDistanceAndTime( + [ + 'id' => 'order_id-fixture', + ], + [] +); +``` + +### Get Order ETA + +Returns ETA data for an order. + +`GET {{base_url}}/{{namespace}}/orders/:id/eta` + +```php +$result = $fleetbase->orders->getOrderEta( + [ + 'id' => 'order_id-fixture', + ], + [] +); +``` + +### Get Order Next Activity + +Returns the next workflow activity for an order. Use it to determine the next operational step available to the assigned driver or dispatcher. + +`GET {{base_url}}/{{namespace}}/orders/:id/next-activity` + +```php +$result = $fleetbase->orders->getOrderNextActivity( + [ + 'id' => 'order_id-fixture', + ], + [ + 'query' => [ + 'waypoint' => 'current_waypoint_id-fixture', + ], + ] +); +``` + +### Get Order Tracker + +Returns public tracking data for an order. + +`GET {{base_url}}/{{namespace}}/orders/:id/tracker` + +```php +$result = $fleetbase->orders->getOrderTracker( + [ + 'id' => 'order_id-fixture', + ], + [] +); +``` + +### List Order Comments + +Lists comments attached to an order. + +`GET {{base_url}}/{{namespace}}/orders/:id/comments` + +```php +$result = $fleetbase->orders->listOrderComments( + [ + 'id' => 'order_id-fixture', + ], + [] +); +``` + +### List Order Proofs + +Lists proof of delivery resources for an order or subject. + +`GET {{base_url}}/{{namespace}}/orders/:id/proofs/:subjectId` + +```php +$result = $fleetbase->orders->listOrderProofs( + [ + 'id' => 'order_id-fixture', + 'subjectId' => 'subject_id-fixture', + ], + [] +); +``` + +### Query Orders + +Returns orders for the current company. Use filters such as `status`, `payload`, `customer`, `facilitator`, or `nearby` to narrow the result set. + +`GET {{base_url}}/{{namespace}}/orders` + +```php +$result = $fleetbase->orders->queryOrders( + [], + [ + 'query' => [ + 'limit' => '25', + 'offset' => '0', + 'sort' => 'created_at', + 'status' => 'created', + ], + ] +); +``` + +### Retrieve an Order + +Retrieves a single order by ID. The response includes the public order fields plus loaded payload, tracking, assignment, customer, and facilitator data when available. + +`GET {{base_url}}/{{namespace}}/orders/{{order_id}}` + +```php +$result = $fleetbase->orders->retrieveOrder( + [ + 'order_id' => 'order_id-fixture', + ], + [] +); +``` + +### Schedule an Order + +Schedules an order for a specific date and optional time. Fleetbase parses the schedule using the supplied timezone or the company timezone. + +`PATCH {{base_url}}/{{namespace}}/orders/:id/schedule` + +```php +$result = $fleetbase->orders->scheduleOrder( + [ + 'id' => 'order_id-fixture', + 'body' => [ + 'date' => '2024-02-11', + 'time' => '8am', + 'timezone' => 'Asia/Singapore', + ], + ], + [] +); +``` + +### Set Order Destination + +Sets the destination waypoint or place for an order. The response returns the updated order after the destination is changed. + +`PATCH {{base_url}}/{{namespace}}/orders/:id/set-destination/:placeId` + +```php +$result = $fleetbase->orders->setOrderDestination( + [ + 'id' => 'order_id-fixture', + 'placeId' => 'waypoint_id-fixture', + ], + [] +); +``` + +### Start an Order + +Starts an order and transitions it into active execution. Use this when a driver or dispatcher begins fulfillment. + +`POST {{base_url}}/{{namespace}}/orders/:id/start` + +```php +$result = $fleetbase->orders->startOrder( + [ + 'id' => 'order_id-fixture', + 'body' => [ + 'skip_dispatch' => false, + ], + ], + [] +); +``` + +### Update Order Activity + +Updates the current activity state for an order. The response returns the order with the latest workflow activity applied. + +`POST {{base_url}}/{{namespace}}/orders/:id/update-activity` + +```php +$result = $fleetbase->orders->updateOrderActivity( + [ + 'id' => 'order_id-fixture', + 'body' => [ + 'activity' => 'next_activity-fixture', + 'skip_dispatch' => false, + ], + ], + [] +); +``` + +### Update an Order + +Updates an order and returns the updated order resource. You can update order metadata, notes, status, assignment fields, scheduling fields, proof-of-delivery settings, and payload details. + +`PUT {{base_url}}/{{namespace}}/orders/:id` + +```php +$result = $fleetbase->orders->updateOrder( + [ + 'id' => 'order_id-fixture', + 'body' => [ + 'service_quote' => 'service_quote_id-fixture', + ], + ], + [] +); +``` + +## Organizations + +### Get Current Organization + +Returns the organization associated with the API key on the request. Use it to confirm which account a credential belongs to, and to obtain the organization's id for endpoints that address an organization by path. + +`GET {{base_url}}/{{namespace}}/organizations/current` + +```php +$result = $fleetbase->organizations->getCurrentOrganization( + [], + [] +); +``` + +### List Organizations + +Lists organizations available for driver onboarding and organization selection. + +`GET {{base_url}}/{{namespace}}/organizations` + +```php +$result = $fleetbase->organizations->listOrganizations( + [], + [ + 'query' => [ + 'limit' => '10', + 'with_driver_onboard' => 'false', + ], + ] +); +``` + +## Parts + +### Create a Part + +Create a part. + +`POST {{base_url}}/{{namespace}}/parts` + +```php +$result = $fleetbase->parts->createPart( + [ + 'body' => [ + 'sku' => 'FLT-OIL-timestamp-fixture', + 'name' => 'Oil Filter', + 'quantity_on_hand' => 24, + 'unit_cost' => 1200, + 'currency' => 'USD', + 'status' => 'in_stock', + ], + ], + [] +); +``` + +### Delete a Part + +Delete a part. + +`DELETE {{base_url}}/{{namespace}}/parts/{{part_id}}` + +```php +$result = $fleetbase->parts->deletePart( + [ + 'part_id' => 'part_id-fixture', + ], + [] +); +``` + +### Query Parts + +Query parts. + +`GET {{base_url}}/{{namespace}}/parts` + +```php +$result = $fleetbase->parts->queryParts( + [], + [] +); +``` + +### Retrieve a Part + +Retrieve a part. + +`GET {{base_url}}/{{namespace}}/parts/{{part_id}}` + +```php +$result = $fleetbase->parts->retrievePart( + [ + 'part_id' => 'part_id-fixture', + ], + [] +); +``` + +### Update a Part + +Update a part. + +`PUT {{base_url}}/{{namespace}}/parts/{{part_id}}` + +```php +$result = $fleetbase->parts->updatePart( + [ + 'part_id' => 'part_id-fixture', + 'body' => [ + 'quantity_on_hand' => 18, + ], + ], + [] +); +``` + +## Payloads + +### Create a Payload + +Creates a payload containing route endpoints and optional entities. Provide either pickup/dropoff endpoints or a waypoint list, then attach entities as needed. + +`POST {{base_url}}/{{namespace}}/payloads` + +```php +$result = $fleetbase->payloads->createPayload( + [ + 'body' => [ + 'pickup' => [ + 'street1' => '10 Bayfront Avenue', + 'city' => 'Singapore', + 'postal_code' => '018956', + 'country' => 'SG', + ], + 'dropoff' => [ + 'street1' => '80 Mandai Lake Rd', + 'city' => 'Singapore', + 'postal_code' => '729826', + 'country' => 'SG', + ], + 'type' => 'food_delivery', + ], + ], + [] +); +``` + +### Delete a Payload + +Delete a Payload. + +`DELETE {{base_url}}/{{namespace}}/payloads/:id` + +```php +$result = $fleetbase->payloads->deletePayload( + [ + 'id' => 'payload_id-fixture', + ], + [] +); +``` + +### Query Payloads + +Returns payloads for the current company. Use pagination and sort parameters to page through payload records. + +`GET {{base_url}}/{{namespace}}/payloads` + +```php +$result = $fleetbase->payloads->queryPayloads( + [], + [ + 'query' => [ + 'limit' => '25', + 'offset' => '0', + 'sort' => 'created_at', + ], + ] +); +``` + +### Retrieve a Payload + +Retrieve a Payload. + +`GET {{base_url}}/{{namespace}}/payloads/:id` + +```php +$result = $fleetbase->payloads->retrievePayload( + [ + 'id' => 'payload_id-fixture', + ], + [] +); +``` + +### Update a Payload + +Updates a payload's route endpoints, waypoints, entities, cash-on-delivery settings, or metadata. The response returns the updated payload with route and entity data. + +`PUT {{base_url}}/{{namespace}}/payloads/:id` + +```php +$result = $fleetbase->payloads->updatePayload( + [ + 'id' => 'payload_id-fixture', + 'body' => [ + 'pickup' => [ + 'street1' => '10 Bayfront Avenue', + 'city' => 'Singapore', + 'postal_code' => '018956', + 'country' => 'SG', + ], + 'dropoff' => [ + 'street1' => '80 Mandai Lake Rd', + 'city' => 'Singapore', + 'postal_code' => '729826', + 'country' => 'SG', + ], + 'entities' => [ + [ + 'name' => 'UltraHD 4K Smart TV', + 'description' => '65-inch high-definition smart TV with vibrant colors and a sleek design.', + 'currency' => 'USD', + 'price' => 1200, + ], + [ + 'name' => 'Bluetooth Wireless Headphones', + 'description' => 'Noise-cancelling, over-ear headphones with long-lasting battery life.', + 'currency' => 'USD', + 'price' => 250, + ], + [ + 'name' => 'Smart Fitness Watch', + 'description' => 'Water-resistant fitness watch with heart rate monitor and GPS tracking.', + 'currency' => 'USD', + 'price' => 199.99, + ], + ], + ], + ], + [] +); +``` + +## Places + +### Create a Place + +Creates a place for the current company. Provide structured address fields, a free-form `address` or `street1` value to geocode, or coordinates for Fleetbase to reverse geocode. + +`POST {{base_url}}/{{namespace}}/places` + +```php +$result = $fleetbase->places->createPlace( + [ + 'body' => [ + 'name' => 'Central Park', + 'street1' => '830 5th Ave', + 'city' => 'New York', + 'province' => 'New York', + 'postal_code' => '10065', + 'neighborhood' => 'Manhattan', + 'district' => 'Midtown', + 'building' => 'Park Area', + 'country' => 'US', + 'phone' => '+12123106600', + 'type' => 'Park', + ], + ], + [] +); +``` + +### Delete a Place + +Permanently deletes a place. It cannot be undone. + +`DELETE {{base_url}}/{{namespace}}/places/:id` + +```php +$result = $fleetbase->places->deletePlace( + [ + 'id' => 'place_id-fixture', + ], + [] +); +``` + +### List all Places + +Returns a paginated list of places for the current organization. Places are sorted by creation date unless another sort order is provided. + +`GET {{base_url}}/{{namespace}}/places` + +```php +$result = $fleetbase->places->listAllPlaces( + [], + [ + 'query' => [ + 'limit' => '25', + 'offset' => '0', + 'sort' => 'created_at', + ], + ] +); +``` + +### Query Places + +Searches and filters places for the current organization. Use query and pagination parameters to find matching saved locations. + +`GET {{base_url}}/{{namespace}}/places` + +```php +$result = $fleetbase->places->queryPlaces( + [], + [ + 'query' => [ + 'query' => 'place_name-fixture', + 'limit' => '25', + 'offset' => '', + 'sort' => 'created_at', + ], + ] +); +``` + +### Retrieve a Place + +This endpoint allows you to retrieve a place object to view it's details. + +`GET {{base_url}}/{{namespace}}/places/:id` + +```php +$result = $fleetbase->places->retrievePlace( + [ + 'id' => 'place_id-fixture', + ], + [] +); +``` + +### Search Places + +Searches places by free-form query and optional lat/lng locale context. + +`GET {{base_url}}/{{namespace}}/places/search` + +```php +$result = $fleetbase->places->searchPlaces( + [], + [ + 'query' => [ + 'query' => 'place_query-fixture', + 'll' => 'place_ll-fixture', + 'locale' => 'locale-fixture', + ], + ] +); +``` + +### Update a Place + +Updates a place by setting the fields included in the request. Send address fields, coordinates, owner assignment, type, phone, or metadata to change only those values. + +`PUT {{base_url}}/{{namespace}}/places/:id` + +```php +$result = $fleetbase->places->updatePlace( + [ + 'id' => 'place_id-fixture', + 'body' => [ + 'name' => 'Central Park Edit', + 'street1' => '830 5th Ave a ', + 'city' => 'New York', + 'province' => 'New York', + 'postal_code' => '10065', + 'neighborhood' => 'Manhattan', + 'district' => 'Midtown', + 'building' => 'Park Area', + 'country' => 'US', + 'phone' => '+12123106600', + 'type' => 'Park', + ], + ], + [] +); +``` + +## Purchase Rates + +### Create a Purchase Rate + +Only ServiceQuote objects generated using a Payload object may be used to create PurchaseRate objects. + +`POST {{base_url}}/{{namespace}}/purchase-rates` + +```php +$result = $fleetbase->purchaseRates->createPurchaseRate( + [ + 'body' => [ + 'service_quote' => 'service_quote_id-fixture', + ], + ], + [] +); +``` + +### Query Purchase Rates + +This endpoint allows you to query purchase-rates you have created, it also provides paginated results on all the purchase-rates in your Fleetbase. + +`GET {{base_url}}/{{namespace}}/purchase-rates` + +```php +$result = $fleetbase->purchaseRates->queryPurchaseRates( + [], + [ + 'query' => [ + 'limit' => '25', + 'offset' => '0', + 'sort' => 'created_at', + ], + ] +); +``` + +### Retrieve a Purchase Rate + +This endpoint allows you to retrieve a purchase-rate object to view it's details. + +`GET {{base_url}}/{{namespace}}/purchase-rates/:id` + +```php +$result = $fleetbase->purchaseRates->retrievePurchaseRate( + [ + 'id' => 'purchase_rate_id-fixture', + ], + [] +); +``` + +## Sensors + +### Create a Sensor + +Create a sensor. + +`POST {{base_url}}/{{namespace}}/sensors` + +```php +$result = $fleetbase->sensors->createSensor( + [ + 'body' => [ + 'name' => 'Cargo Temperature', + 'type' => 'temperature', + 'device' => 'device_id-fixture', + 'unit' => 'celsius', + 'status' => 'active', + 'min_threshold' => 0, + 'max_threshold' => 8, + ], + ], + [] +); +``` + +### Delete a Sensor + +Delete a sensor. + +`DELETE {{base_url}}/{{namespace}}/sensors/{{sensor_id}}` + +```php +$result = $fleetbase->sensors->deleteSensor( + [ + 'sensor_id' => 'sensor_id-fixture', + ], + [] +); +``` + +### Query Sensors + +Query sensors. + +`GET {{base_url}}/{{namespace}}/sensors` + +```php +$result = $fleetbase->sensors->querySensors( + [], + [] +); +``` + +### Retrieve a Sensor + +Retrieve a sensor. + +`GET {{base_url}}/{{namespace}}/sensors/{{sensor_id}}` + +```php +$result = $fleetbase->sensors->retrieveSensor( + [ + 'sensor_id' => 'sensor_id-fixture', + ], + [] +); +``` + +### Update a Sensor + +Update a sensor. + +`PUT {{base_url}}/{{namespace}}/sensors/{{sensor_id}}` + +```php +$result = $fleetbase->sensors->updateSensor( + [ + 'sensor_id' => 'sensor_id-fixture', + 'body' => [ + 'last_value' => '4.2', + 'last_reading_at' => '2026-05-07T08:30:00Z', + ], + ], + [] +); +``` + +## Service Areas + +### Create a Service Area + +A service area is created by simply providing a city, province or country in which Fleetbase will reverse geocode into a service area. If the service area cannot be reverse geocoded, Fleetbase will return an error. + +`POST {{base_url}}/{{namespace}}/service-areas` + +```php +$result = $fleetbase->serviceAreas->createServiceArea( + [ + 'body' => [ + 'name' => 'Singapore', + 'type' => 'city', + 'latitude' => '1.3521', + 'longitude' => '103.8198', + 'radius' => '30000', + 'country' => 'SG', + 'status' => 'active', + ], + ], + [] +); +``` + +### Delete a Service Area + +Use this endpoint to delete a service area, deleting a service area will also delete all of the zones within the service area. + +`DELETE {{base_url}}/{{namespace}}/service-areas/:id` + +```php +$result = $fleetbase->serviceAreas->deleteServiceArea( + [ + 'id' => 'service_area_id-fixture', + ], + [] +); +``` + +### Query Service Areas + +Returns service areas matching the supplied filters. Use this to find configured operating regions by name or other query parameters. + +`GET {{base_url}}/{{namespace}}/service-areas` + +```php +$result = $fleetbase->serviceAreas->queryServiceAreas( + [], + [ + 'query' => [ + 'name' => 'service_area_name-fixture', + ], + ] +); +``` + +### Retrieve a Service Area + +This endpoint allows you to retrieve a service area object to view it's details. + +`GET {{base_url}}/{{namespace}}/service-areas/:id` + +```php +$result = $fleetbase->serviceAreas->retrieveServiceArea( + [ + 'id' => 'service_area_id-fixture', + ], + [] +); +``` + +### Update a Service Area + +You are only able to update the service area status + +`PUT {{base_url}}/{{namespace}}/service-areas/:id` + +```php +$result = $fleetbase->serviceAreas->updateServiceArea( + [ + 'id' => 'service_area_id-fixture', + 'body' => [ + 'status' => 'active', + ], + ], + [] +); +``` + +## Service Quotes + +### Query Service Quotes + +This endpoint is used to get the ServiceRate quotes based on pickup point location and drop off point location, or payload. For some quotes such as parcel based, the payload must be included for calculation of the payload cost. + +`GET {{base_url}}/{{namespace}}/service-quotes` + +```php +$result = $fleetbase->serviceQuotes->queryServiceQuotes( + [], + [ + 'query' => [ + 'payload' => 'payload_id-fixture', + ], + ] +); +``` + +### Retrieve a Service Quote + +Retrieves a service quote by id. + +`GET {{base_url}}/{{namespace}}/service-quotes/:id` + +```php +$result = $fleetbase->serviceQuotes->retrieveServiceQuote( + [ + 'id' => 'service_quote_id-fixture', + ], + [] +); +``` + +## Service Rates + +### Create a Service Rate + +Create a Service Rate. + +`POST {{base_url}}/{{namespace}}/service-rates` + +```php +$result = $fleetbase->serviceRates->createServiceRate( + [ + 'body' => [ + 'service_name' => 'Food Delivery', + 'service_type' => 'food_delivery', + 'rate_calculation_method' => 'per_meter', + 'currency' => 'USD', + 'base_fee' => 10, + 'per_meter_unit' => 'km', + 'per_meter_flat_rate_fee' => 25, + 'has_cod_fee' => true, + 'cod_calculation_method' => 'percentage', + 'cod_flat_fee' => 1, + 'cod_percent' => 0, + 'has_peak_hours_fee' => true, + 'peak_hours_calculation_method' => 'percentage', + 'peak_hours_flat_fee' => 3, + 'peak_hours_percent' => 0, + 'peak_hours_start' => '17:00', + 'peak_hours_end' => '18:45', + 'duration_terms' => 'Standard', + 'estimated_days' => 3, + ], + ], + [] +); +``` + +### Delete a Service Rate + +Delete a Service Rate. + +`DELETE {{base_url}}/{{namespace}}/service-rates/:id` + +```php +$result = $fleetbase->serviceRates->deleteServiceRate( + [ + 'id' => 'service_rate_id-fixture', + ], + [] +); +``` + +### Query Service Rates + +List all service rates. + +`GET {{base_url}}/{{namespace}}/service-rates` + +```php +$result = $fleetbase->serviceRates->queryServiceRates( + [], + [ + 'query' => [ + 'limit' => '25', + 'offset' => '0', + 'currency' => 'USD', + ], + ] +); +``` + +### Retrieve a Service Rate + +Retrieves a service rate by ID. + +`GET {{base_url}}/{{namespace}}/service-rates/:id` + +```php +$result = $fleetbase->serviceRates->retrieveServiceRate( + [ + 'id' => 'service_rate_id-fixture', + ], + [] +); +``` + +### Update a Service Rate + +Update a Service Rate. + +`PUT {{base_url}}/{{namespace}}/service-rates/:id` + +```php +$result = $fleetbase->serviceRates->updateServiceRate( + [ + 'id' => 'service_rate_id-fixture', + 'body' => [ + 'currency' => 'SGD', + 'base_fee' => 12.66, + 'estimated_days' => 6, + ], + ], + [] +); +``` + +## Tracking Numbers + +### Create a Tracking Number + +This endpoint allows you to retrieve a tracking-number object to view it's details. + +`POST {{base_url}}/{{namespace}}/tracking-numbers` + +```php +$result = $fleetbase->trackingNumbers->createTrackingNumber( + [ + 'body' => [ + 'region' => 'SG', + 'owner' => 'order_id-fixture', + ], + ], + [] +); +``` + +### Decode Tracking Number QR + +Decodes a tracking/entity/order QR code UUID and returns the matching resource. + +`POST {{base_url}}/{{namespace}}/tracking-numbers/from-qr` + +```php +$result = $fleetbase->trackingNumbers->decodeTrackingNumberQr( + [ + 'body' => [ + 'code' => 'qr_code-fixture', + ], + ], + [] +); +``` + +### Delete a Tracking Number + +Deletes a tracking number by ID. + +`DELETE {{base_url}}/{{namespace}}/tracking-numbers/:id` + +```php +$result = $fleetbase->trackingNumbers->deleteTrackingNumber( + [ + 'id' => 'tracking_number_id-fixture', + ], + [] +); +``` + +### Query Tracking Numbers + +This endpoint allows you to query tracking-numbers you have created, it also provides paginated results on all the tracking-numbers in your Fleetbase. + +`GET {{base_url}}/{{namespace}}/tracking-numbers` + +```php +$result = $fleetbase->trackingNumbers->queryTrackingNumbers( + [], + [ + 'query' => [ + 'query' => 'SG', + 'limit' => '25', + 'offset' => '0', + 'sort' => 'created_at', + ], + ] +); +``` + +### Retrieve a Tracking Number + +This endpoint allows you to retrieve a tracking-number object to view it's details. + +`GET {{base_url}}/{{namespace}}/tracking-numbers/:id` + +```php +$result = $fleetbase->trackingNumbers->retrieveTrackingNumber( + [ + 'id' => 'tracking_number_id-fixture', + ], + [] +); +``` + +## Tracking Statuses + +### Create a Tracking Status + +Create a new Tracking Status. + +`POST {{base_url}}/{{namespace}}/tracking-statuses` + +```php +$result = $fleetbase->trackingStatuses->createTrackingStatus( + [ + 'body' => [ + 'status' => 'Delivery is en-route', + 'code' => 'delivery-en-route', + 'details' => 'Our driver has picked up your order and is on the way to your address!', + 'tracking_number' => 'tracking_number_id-fixture', + 'location' => [ + 1.3521, + 103.8198, + ], + 'city' => 'Singapore', + ], + ], + [] +); +``` + +### Delete a Tracking Status + +Delete a Tracking Status. + +`DELETE {{base_url}}/{{namespace}}/tracking-statuses/:id` + +```php +$result = $fleetbase->trackingStatuses->deleteTrackingStatus( + [ + 'id' => 'tracking_status_id-fixture', + ], + [] +); +``` + +### Query Tracking Statuses + +List all Tracking Statuses + +`GET {{base_url}}/{{namespace}}/tracking-statuses` + +```php +$result = $fleetbase->trackingStatuses->queryTrackingStatuses( + [], + [ + 'query' => [ + 'limit' => '25', + 'tracking_number' => 'tracking_number_id-fixture', + ], + ] +); +``` + +### Retrieve a Tracking Status + +Retrieve a Tracking Status. + +`GET {{base_url}}/{{namespace}}/tracking-statuses/:id` + +```php +$result = $fleetbase->trackingStatuses->retrieveTrackingStatus( + [ + 'id' => 'tracking_status_id-fixture', + ], + [] +); +``` + +### Update a Tracking Status + +Updates an existing tracking status. The response returns the tracking status with the new values applied. + +`PUT {{base_url}}/{{namespace}}/tracking-statuses/:id` + +```php +$result = $fleetbase->trackingStatuses->updateTrackingStatus( + [ + 'id' => 'tracking_status_id-fixture', + 'body' => [ + 'country' => 'SG', + ], + ], + [] +); +``` + +## Vehicles + +### Create a Vehicle + +Creates a vehicle for the current company. Send VIN, make/model fields, assignment fields, status, location, capacity, or orchestrator constraints as needed. + +`POST {{base_url}}/{{namespace}}/vehicles` + +```php +$result = $fleetbase->vehicles->createVehicle( + [ + 'body' => [ + 'vin' => '1GCGSBEA0G1111111', + 'year' => 2023, + 'make' => 'Toyota', + 'model' => 'Camry', + 'trim' => 'SE', + 'plate_number' => 'ABC123', + 'status' => 'maintenance', + 'online' => false, + ], + ], + [] +); +``` + +### Delete a Vehicle + +Permanently deletes a `Vehicle`. It cannot be undone. + +`DELETE {{base_url}}/{{namespace}}/vehicles/:id` + +```php +$result = $fleetbase->vehicles->deleteVehicle( + [ + 'id' => 'vehicle_id-fixture', + ], + [] +); +``` + +### Query Vehicles + +This endpoint allows you to query vehicles you have created, it also provides paginated results on all the vehicles in your Fleetbase. + +`GET {{base_url}}/{{namespace}}/vehicles` + +```php +$result = $fleetbase->vehicles->queryVehicles( + [], + [ + 'query' => [ + 'query' => 'vehicle_name-fixture', + 'limit' => '25', + 'offset' => '0', + 'sort' => 'created_at', + ], + ] +); +``` + +### Retrieve a Vehicle + +Retrieve details for a specific `Vehicle`. + +`GET {{base_url}}/{{namespace}}/vehicles/:id` + +```php +$result = $fleetbase->vehicles->retrieveVehicle( + [ + 'id' => 'vehicle_id-fixture', + ], + [] +); +``` + +### Track Vehicle + +`PATCH {{base_url}}/{{namespace}}/vehicles/:id/track` + +```php +$result = $fleetbase->vehicles->trackVehicle( + [ + 'id' => 'vehicle_id-fixture', + ], + [] +); +``` + +### Update a Vehicle + +Updates a vehicle's identity, operational status, vendor assignment, location, capacity, or orchestrator constraints. Updating the VIN refreshes decoded VIN data. + +`PUT {{base_url}}/{{namespace}}/vehicles/:id` + +```php +$result = $fleetbase->vehicles->updateVehicle( + [ + 'id' => 'vehicle_id-fixture', + 'body' => [ + 'plate_number' => 'ABC123', + 'status' => 'operational', + 'latitude' => 40.7484, + 'longitude' => -73.9857, + 'speed' => 90, + ], + ], + [] +); +``` + +## Vendors + +### Create a Vendor + +Creates a vendor for the current company. Vendors can be assigned to orders, vehicles, drivers, places, and facilitator workflows. + +`POST {{base_url}}/{{namespace}}/vendors` + +```php +$result = $fleetbase->vendors->createVendor( + [ + 'body' => [ + 'name' => 'ABC Corporation', + 'type' => 'Supplier', + 'email' => 'abc@example.com', + 'phone' => '1234567890', + ], + ], + [] +); +``` + +### Delete a Vendor + +Use this endpoint to delete a vendor. + +`DELETE {{base_url}}/{{namespace}}/vendors/:id` + +```php +$result = $fleetbase->vendors->deleteVendor( + [ + 'id' => 'vendor_id-fixture', + ], + [] +); +``` + +### Query Vendors + +Returns vendors for the current company. Use search, pagination, and sort parameters to narrow the result set. + +`GET {{base_url}}/{{namespace}}/vendors` + +```php +$result = $fleetbase->vendors->queryVendors( + [], + [ + 'query' => [ + 'id' => 'vendor_id-fixture', + ], + ] +); +``` + +### Retrieve a Vendor + +This endpoint allows you to retrieve a vendor object to view it's details. + +`GET {{base_url}}/{{namespace}}/vendors/:id` + +```php +$result = $fleetbase->vendors->retrieveVendor( + [ + 'id' => 'vendor_id-fixture', + ], + [] +); +``` + +### Update a Vendor + +Updates a vendor's profile, primary address, type, contact fields, or metadata. + +`PUT {{base_url}}/{{namespace}}/vendors/:id` + +```php +$result = $fleetbase->vendors->updateVendor( + [ + 'id' => 'vendor_id-fixture', + 'body' => [ + 'name' => 'ABC Corporation', + 'type' => 'Supplier', + 'email' => 'abc@example.com', + 'phone' => '1234567890', + ], + ], + [] +); +``` + +## Work Orders + +### Create a Work Order + +Create a work order. + +`POST {{base_url}}/{{namespace}}/work-orders` + +```php +$result = $fleetbase->workOrders->createWorkOrder( + [ + 'body' => [ + 'subject' => 'Replace rear tire', + 'category' => 'corrective_maintenance', + 'status' => 'open', + 'priority' => 'high', + 'target_type' => 'fleet-ops:vehicle', + 'target' => 'vehicle_id-fixture', + 'assignee_type' => 'fleet-ops:vendor', + 'assignee' => 'vendor_id-fixture', + ], + ], + [] +); +``` + +### Delete a Work Order + +Delete a work order. + +`DELETE {{base_url}}/{{namespace}}/work-orders/{{work_order_id}}` + +```php +$result = $fleetbase->workOrders->deleteWorkOrder( + [ + 'work_order_id' => 'work_order_id-fixture', + ], + [] +); +``` + +### Query Work Orders + +Query work orders. + +`GET {{base_url}}/{{namespace}}/work-orders` + +```php +$result = $fleetbase->workOrders->queryWorkOrders( + [], + [] +); +``` + +### Retrieve a Work Order + +Retrieve a work order. + +`GET {{base_url}}/{{namespace}}/work-orders/{{work_order_id}}` + +```php +$result = $fleetbase->workOrders->retrieveWorkOrder( + [ + 'work_order_id' => 'work_order_id-fixture', + ], + [] +); +``` + +### Send Work Order + +Send this work order to its assigned vendor or contact. + +`POST {{base_url}}/{{namespace}}/work-orders/{{work_order_id}}/send` + +```php +$result = $fleetbase->workOrders->sendWorkOrder( + [ + 'work_order_id' => 'work_order_id-fixture', + ], + [] +); +``` + +### Update a Work Order + +Update a work order. + +`PUT {{base_url}}/{{namespace}}/work-orders/{{work_order_id}}` + +```php +$result = $fleetbase->workOrders->updateWorkOrder( + [ + 'work_order_id' => 'work_order_id-fixture', + 'body' => [ + 'status' => 'in_progress', + ], + ], + [] +); +``` + +## Zones + +### Create a Zone + +Creates a zone inside a service area. Provide either a GeoJSON boundary or a center point with radius, and Fleetbase will store the zone for geofencing and service coverage checks. + +`POST {{base_url}}/{{namespace}}/zones` + +```php +$result = $fleetbase->zones->createZone( + [ + 'body' => [ + 'name' => 'Center of Singapore', + 'service_area' => 'service_area_id-fixture', + 'color' => '#66e0ff', + 'stroke_color' => '#00bfff', + 'border' => [ + 'type' => 'Polygon', + 'bbox' => [ + 103.867493, + 1.35085, + 103.912125, + 1.383113, + ], + 'coordinates' => [ + [ + [ + 103.907661, + 1.362863, + ], + [ + 103.892555, + 1.357714, + ], + [ + 103.891525, + 1.353252, + ], + [ + 103.883629, + 1.35085, + ], + [ + 103.874702, + 1.351193, + ], + [ + 103.870583, + 1.358744, + ], + [ + 103.867493, + 1.368354, + ], + [ + 103.870926, + 1.377621, + ], + [ + 103.875732, + 1.38174, + ], + [ + 103.886032, + 1.383113, + ], + [ + 103.900452, + 1.383113, + ], + [ + 103.909721, + 1.381397, + ], + [ + 103.912125, + 1.374189, + ], + [ + 103.907661, + 1.362863, + ], + ], + ], + ], + ], + ], + [] +); +``` + +### Delete a Zone + +Use this endpoint to delete a zone. + +`DELETE {{base_url}}/{{namespace}}/zones/:id` + +```php +$result = $fleetbase->zones->deleteZone( + [ + 'id' => 'zone_id-fixture', + ], + [] +); +``` + +### Query Zones + +Returns zones matching the supplied filters. Use this to find configured geofences by name or other query parameters. + +`GET {{base_url}}/{{namespace}}/zones` + +```php +$result = $fleetbase->zones->queryZones( + [], + [ + 'query' => [ + 'name' => 'zone_name-fixture', + ], + ] +); +``` + +### Retrieve a zone + +Retrieves a single zone by ID. The response includes the zone geometry, display styling, and service area relationship. + +`GET {{base_url}}/{{namespace}}/zones/:id` + +```php +$result = $fleetbase->zones->retrieveZone( + [ + 'id' => 'zone_id-fixture', + ], + [] +); +``` + +### Update a Zone + +You can update all properties of the Zone. + +`PUT {{base_url}}/{{namespace}}/zones/:id` + +```php +$result = $fleetbase->zones->updateZone( + [ + 'id' => 'zone_id-fixture', + 'body' => [ + 'color' => '#ff00000', + ], + ], + [] +); +``` + +## Chat Channels + +### Add Participant + +Adds a user in the current organization to an existing chat channel. The response returns the created chat participant resource. + +`POST {{base_url}}/{{namespace}}/chat-channels/:id/add-participant` + +```php +$result = $fleetbase->chatChannels->addParticipant( + [ + 'id' => 'chat_channel_id-fixture', + 'body' => [ + 'user' => 'user_id-fixture', + ], + ], + [] +); +``` + +### Create Chat Channel + +Creates a chat channel for the current organization. Include participant user IDs to add those users to the channel immediately after it is created. + +`POST {{base_url}}/{{namespace}}/chat-channels` + +```php +$result = $fleetbase->chatChannels->createChatChannel( + [ + 'body' => [ + 'name' => 'Dispatch', + 'participants' => [ + 'user_id-fixture', + ], + ], + ], + [] +); +``` + +### Create Read Receipt + +Marks a chat message as read for a participant. If a receipt already exists for the message and participant, Fleetbase returns the existing receipt. + +`POST {{base_url}}/{{namespace}}/chat-channels/read-message/:chatMessageId` + +```php +$result = $fleetbase->chatChannels->createReadReceipt( + [ + 'chatMessageId' => 'chat_message_id-fixture', + 'body' => [ + 'participant' => 'chat_participant_id-fixture', + ], + ], + [] +); +``` + +### Delete Chat Channel + +Deletes a chat channel by ID. The response returns a deleted-resource envelope for the removed channel. + +`DELETE {{base_url}}/{{namespace}}/chat-channels/:id` + +```php +$result = $fleetbase->chatChannels->deleteChatChannel( + [ + 'id' => 'chat_channel_id-fixture', + ], + [] +); +``` + +### Delete Message + +Deletes a chat message by ID. Use this when a previously sent message should be removed from the channel feed. + +`DELETE {{base_url}}/{{namespace}}/chat-channels/delete-message/:chatMessageId` + +```php +$result = $fleetbase->chatChannels->deleteMessage( + [ + 'chatMessageId' => 'chat_message_id-fixture', + ], + [] +); +``` + +### List Available Participants + +Lists users in the current organization that can be added to a chat channel. When a channel ID is provided, users already participating in that channel are excluded. + +`GET {{base_url}}/{{namespace}}/chat-channels/available-participants` + +```php +$result = $fleetbase->chatChannels->listAvailableParticipants( + [], + [ + 'query' => [ + 'channel' => 'chat_channel_id-fixture', + ], + ] +); +``` + +### Query Chat Channels + +Returns chat channels visible to the current organization. Use query parameters to filter, sort, and paginate the result set. + +`GET {{base_url}}/{{namespace}}/chat-channels` + +```php +$result = $fleetbase->chatChannels->queryChatChannels( + [], + [ + 'query' => [ + 'limit' => '25', + 'offset' => '0', + 'sort' => 'created_at', + ], + ] +); +``` + +### Remove Participant + +Removes a participant from a chat channel by participant ID. The channel remains active for the remaining participants. + +`DELETE {{base_url}}/{{namespace}}/chat-channels/remove-participant/:participantId` + +```php +$result = $fleetbase->chatChannels->removeParticipant( + [ + 'participantId' => 'chat_participant_id-fixture', + ], + [] +); +``` + +### Retrieve Chat Channel + +Retrieves a chat channel by ID, including its participants, feed, and latest message metadata. + +`GET {{base_url}}/{{namespace}}/chat-channels/:id` + +```php +$result = $fleetbase->chatChannels->retrieveChatChannel( + [ + 'id' => 'chat_channel_id-fixture', + ], + [] +); +``` + +### Send Message + +Sends a message to a chat channel as an existing chat participant. File IDs can be included to attach previously uploaded files to the message. + +`POST {{base_url}}/{{namespace}}/chat-channels/:id/send-message` + +```php +$result = $fleetbase->chatChannels->sendMessage( + [ + 'id' => 'chat_channel_id-fixture', + 'body' => [ + 'sender' => 'chat_participant_id-fixture', + 'content' => 'Hello from Fleetbase API', + 'files' => [], + ], + ], + [] +); +``` + +### Update Chat Channel + +Updates a chat channel's name. The response returns the updated chat channel resource. + +`PUT {{base_url}}/{{namespace}}/chat-channels/:id` + +```php +$result = $fleetbase->chatChannels->updateChatChannel( + [ + 'id' => 'chat_channel_id-fixture', + 'body' => [ + 'name' => 'Dispatch Updates', + ], + ], + [] +); +``` + +## Comments + +### Create Comment + +Creates a comment on a subject resource or as a reply to an existing comment. Provide either a subject reference or a parent comment ID with the comment content. + +`POST {{base_url}}/{{namespace}}/comments` + +```php +$result = $fleetbase->comments->createComment( + [ + 'body' => [ + 'content' => 'Example comment', + 'subject' => [ + 'id' => 'file_id-fixture', + 'type' => 'file', + ], + ], + ], + [] +); +``` + +### Delete Comment + +Deletes a comment by ID. The response returns a deleted-resource envelope for the removed comment. + +`DELETE {{base_url}}/{{namespace}}/comments/:id` + +```php +$result = $fleetbase->comments->deleteComment( + [ + 'id' => 'comment_id-fixture', + ], + [] +); +``` + +### Query Comments + +Returns comments for the current organization. Use query parameters to filter, sort, and paginate the result set. + +`GET {{base_url}}/{{namespace}}/comments` + +```php +$result = $fleetbase->comments->queryComments( + [], + [ + 'query' => [ + 'limit' => '25', + 'offset' => '0', + 'sort' => 'created_at', + ], + ] +); +``` + +### Retrieve Comment + +Retrieves a comment by ID, including its author and any nested replies returned by the API resource. + +`GET {{base_url}}/{{namespace}}/comments/:id` + +```php +$result = $fleetbase->comments->retrieveComment( + [ + 'id' => 'comment_id-fixture', + ], + [] +); +``` + +### Update Comment + +Updates the content of an existing comment. The subject and parent linkage are not changed by this endpoint. + +`PUT {{base_url}}/{{namespace}}/comments/:id` + +```php +$result = $fleetbase->comments->updateComment( + [ + 'id' => 'comment_id-fixture', + 'body' => [ + 'content' => 'Updated comment', + ], + ], + [] +); +``` + +## Files + +### Delete a File + +Deletes a file record by ID. The response returns a deleted-resource envelope for the removed file. + +`DELETE {{base_url}}/{{namespace}}/files/:id` + +```php +$result = $fleetbase->files->deleteFile( + [ + 'id' => 'file_id-fixture', + ], + [] +); +``` + +### Download File + +Downloads the binary contents of a file by ID. The API streams the stored file using its original filename. + +`GET {{base_url}}/{{namespace}}/files/:id/download` + +```php +$result = $fleetbase->files->downloadFile( + [ + 'id' => 'file_id-fixture', + ], + [] +); +``` + +### Query Files + +Returns uploaded files for the current organization. Use query parameters to filter, sort, and paginate the result set. + +`GET {{base_url}}/{{namespace}}/files` + +```php +$result = $fleetbase->files->queryFiles( + [], + [ + 'query' => [ + 'limit' => '25', + 'offset' => '0', + 'sort' => 'created_at', + ], + ] +); +``` + +### Retrieve a File + +Retrieves a file record by ID, including its URL, original filename, content type, size, caption, and metadata. + +`GET {{base_url}}/{{namespace}}/files/:id` + +```php +$result = $fleetbase->files->retrieveFile( + [ + 'id' => 'file_id-fixture', + ], + [] +); +``` + +### Update File + +Updates a file record's caption, metadata, or original filename. The uploaded binary object is not replaced. + +`PUT {{base_url}}/{{namespace}}/files/:id` + +```php +$result = $fleetbase->files->updateFile( + [ + 'id' => 'file_id-fixture', + 'body' => [ + 'caption' => 'Updated caption', + 'meta' => [], + ], + ], + [] +); +``` + +### Upload Base64 File + +Creates a file from base64-encoded data. Fleetbase stores the decoded file, creates a file record, and optionally associates it with a subject resource. + +`POST {{base_url}}/{{namespace}}/files/base64` + +```php +$result = $fleetbase->files->uploadBase64File( + [ + 'body' => [ + 'data' => 'base64_file_data-fixture', + 'file_name' => 'example.png', + 'file_type' => 'image', + 'content_type' => 'image/png', + 'path' => 'uploads', + ], + ], + [] +); +``` + +### Upload File + +Uploads a multipart file and creates a file record. The response includes the stored file URL and metadata captured from the upload. + +`POST {{base_url}}/{{namespace}}/files` + +```php +$result = $fleetbase->files->uploadFile( + [], + [ + 'multipart' => [ + [ + 'name' => 'file', + 'contents' => 'replace-with-file-contents', + ], + [ + 'name' => 'path', + 'contents' => 'uploads', + ], + [ + 'name' => 'type', + 'contents' => 'attachment', + ], + ], + ] +); +``` + +## Organizations + +### Get Current Organization + +Returns the organization associated with the API credential. + +`GET {{base_url}}/{{namespace}}/organizations/current` + +```php +$result = $fleetbase->organizations->getCurrentOrganization( + [], + [] +); +``` diff --git a/docs/api-reference-handoff.md b/docs/api-reference-handoff.md new file mode 100644 index 0000000..ccc6ce0 --- /dev/null +++ b/docs/api-reference-handoff.md @@ -0,0 +1,21 @@ +# Fleetbase API-reference handoff + +The SDK repository now owns executable examples for every one of the 220 locked Fleetbase and Core API requests. The API-reference repository should consume these reviewed examples instead of maintaining a second hand-written PHP mapping. + +Authoritative inputs: + +- `contracts/postman-manifest.json` — locked request IDs, verbs, URLs, authentication, fixtures, and source references; +- `contracts/service-map.json` — request-to-service and request-to-method mapping; +- `docs/api-examples.md` — generated, executable PHP snippets; +- `docs/api-coverage.md` — the complete human-readable coverage matrix. + +The coordinated API-reference change should: + +1. Key PHP examples by the stable request ID in the manifest. +2. Render the matching fenced snippet from `docs/api-examples.md` for Fleetbase and Core requests. +3. Fail its build when a request ID has no SDK example or when a stale request ID remains. +4. Preserve raw HTTP examples alongside PHP rather than using raw HTTP as a silent PHP fallback. +5. Pin the SDK release or reviewed commit used to generate the documentation. +6. Add a fixture test proving all 220 request IDs render a real SDK call. + +The API-reference repository is outside this SDK change set. Its pull request requires explicit maintainer authorization and should reference the reviewed SDK release commit. diff --git a/docs/default-branch-migration.md b/docs/default-branch-migration.md new file mode 100644 index 0000000..6992f67 --- /dev/null +++ b/docs/default-branch-migration.md @@ -0,0 +1,45 @@ +# Default branch migration: `master` to `main` + +This is the maintainer runbook for the repository-setting change. Complete it only after the release integration pull request is approved and all required checks are green. The SDK workflows already accept both branch names during the transition. + +## Before changing GitHub settings + +1. Confirm the reviewed release-integration commit is the desired tip for both branches. +2. Create `main` from that exact commit and push it without rewriting `master`. +3. Configure the protected `release` environment and its required approvers. +4. Add required checks for quality/contracts, the PHP compatibility matrix, exact coverage, mutation baseline, archive consumers, Composer audit/license metadata, dependency review, secret scanning, and CodeQL. +5. Add the `POSTMAN_API_KEY` Actions secret used only by the disposable official-collection workflow. +6. Confirm the Packagist webhook owner and target repository. + +## Change the default branch + +In GitHub, open **Settings → Branches → Default branch**, choose `main`, and confirm. Do not delete or force-update `master` during this change. + +Immediately verify: + +- a new pull request targets `main` by default; +- CI and security workflows run on a push to `main`; +- the API contract-drift and disposable-contract workflows are visible in Actions and can be manually dispatched; +- release validation rejects publishing from every branch except `main`; +- CodeQL/default setup, Dependabot, repository rules, badges, and external integrations use `main`; +- Packagist exposes `dev-main` and its webhook still receives events; +- a clean clone checks out `main`. + +## Consumer transition + +Keep `master` protected and read-only during the agreed transition period. Add a final pointer commit only if maintainers decide consumers need one; do not continually mirror changes between the branches. Consumers following tagged releases are unaffected. + +For existing local clones: + +```bash +git fetch origin +git branch -m master main +git branch --set-upstream-to=origin/main main +git remote set-head origin -a +``` + +Remove `master` only after repository search, webhook review, Packagist verification, documentation checks, and the agreed transition window show that no maintained integration still depends on it. + +## Rollback + +If a required integration fails, set the GitHub default branch back to `master` and repair the integration without rewriting either branch. A default-branch setting change does not require deleting `main` or changing published tags. diff --git a/docs/migration-guide.md b/docs/migration-guide.md new file mode 100644 index 0000000..c229769 --- /dev/null +++ b/docs/migration-guide.md @@ -0,0 +1,17 @@ +# Migrating from 1.0.x to 1.1.0 + +This guide is being completed with the v1.1.0 implementation. It records changes that downstream consumers must assess before upgrading. + +## License change + +Version 1.1.0 changes the project license from MIT to `AGPL-3.0-or-later`. Versions 1.0.0 through 1.0.3 remain under the MIT license included in those tags. Review the AGPL terms and obtain your own legal advice about distribution, modification, and network use before adopting 1.1.0. + +## PHP and Composer + +The runtime constraint widens from `^7.4` to `^7.4 || ^8.0`. PHP 7.4 and 8.0 are tested only for backwards compatibility; use a PHP version that still receives upstream security fixes. Composer 2.2 or newer is required for development and verified consumer installs. + +## Compatibility policy + +The 1.1.0 release preserves the `Fleetbase\Sdk` namespace, facade constructor, existing store properties, `HttpClient` verbs and accessors, generic service methods, resource lifecycle/attribute methods, resource classes, and published order actions. Demonstrably unusable behavior is corrected with regression tests and changelog entries. + +The final guide will list every corrected behavior, new exception type, transport injection option, and framework recipe before release. Fleetbase API v1 does not expose an SDK pagination contract, so 1.1.0 retains the legacy array return from `findAll()` and `query()` and does not introduce a speculative pagination method. diff --git a/docs/progress.md b/docs/progress.md new file mode 100644 index 0000000..fe4c6da --- /dev/null +++ b/docs/progress.md @@ -0,0 +1,83 @@ +# v1.1.0 implementation progress + +This log records completed checkpoints and evidence. A passing local check is not represented as CI success. + +## 2026-08-31 — baseline refresh and contract freeze + +- Refreshed official Git refs and found published 1.0.3, which was absent from the stale local `origin/master` reference. +- Merged current `origin/master` into `release/v1.1.0` at `e4a368d`; retained 1.0.2 as the required compatibility baseline. +- Locked Postman, Core API, Fleet-Ops, 1.0.2, and 1.0.3 commits in `contracts/contract-lock.json`. +- Generated public/protected API snapshots: 1.0.2 has 22 classes, 64 declared public/protected methods, and 13 facade runtime properties; 1.0.3 has 22 classes, 84 declared public/protected methods, and 13 facade runtime properties. +- Generated the Postman contract manifest: 220 requests across 36 groups (`84 GET`, `77 POST`, `25 PUT`, `6 PATCH`, `28 DELETE`). All begin as explicitly unmapped. +- Added six architecture decisions and the non-secret repository/release audit. +- Local generator syntax checks: pass on PHP 8.2.10. +- Deterministic manifest count check: pass (220 requests, 36 groups). +- Working tree passes the 1.0.3 public API check. The 1.0.2 check correctly detects the published `getDistanceAndTime()` parameter rename in 1.0.3; the compatibility implementation must restore the legacy named argument while accepting the 1.0.3 query form. + +Remaining in Phase 0: characterize observable legacy behavior, add automated snapshot/manifest verification, establish backwards-compatibility tooling, and receive maintainer confirmation of relicensing rights. Phase 1 repository hygiene can proceed independently of the human licensing confirmation, but the new license cannot be published until confirmation. + +## 2026-08-31 — hygiene and compatibility foundation in progress + +- Removed 4,394 tracked `vendor/` files. The local `.env.test` and PHPUnit cache were confirmed ignored and untracked, rather than repository content at the current baseline. +- Widened runtime support to `^7.4 || ^8.0`; added PSR HTTP contracts and maintained development tools. Composer strict validation passes and a fresh advisory audit reports zero known vulnerabilities in the new lock. +- Replaced live, credential-dependent tests with a hermetic Guzzle mock suite: pass on PHP 8.2 / PHPUnit 11.5 with 5 tests, 45 assertions, no deprecations. +- Added canonical AGPL v3 text, `AGPL-3.0-or-later` Composer/source notices, migration warning, README/badges, community health files, Dependabot configuration, and a pinned-action baseline CI matrix. +- Added configuration validation, declared legacy facade properties, injectable PSR-18 transport, response/error mapping, mutable resource state tracking, and repaired order-service access/path behavior. +- Public API compatibility checks pass against both 1.0.2 and 1.0.3. The contract manifest structure passes with all 220 requests still explicitly unmapped. +- PHPStan 2.2 at max initially reported 307 errors across source/tests after excluding standalone build tools. The foundation refactor resolved all 307 without a baseline or ignore entry; max-level analysis now passes. + +The aggregate `composer check` gate now passes locally: syntax, formatting, max-level analysis, hermetic tests, contract structure, and compatibility against 1.0.2/1.0.3. Remaining work includes exhaustive transport/resource tests, fresh 100% line/branch coverage, the full endpoint service mapping, framework fixtures, and expanded security/release workflows. + +## 2026-08-31 — official endpoint surface mapped + +- Mapped all 220 locked Postman requests to 35 explicit service classes and checked-in endpoint methods; the 36 source groups collapse to 35 services because both collections contain the Organizations group. +- Added deterministic placeholder handling for both `{{name}}` and Postman `:name` path forms, including URL encoding and required-parameter failures. +- Added a hermetic transport contract that executes every manifest row and asserts the HTTP verb and resolved path. The manifest validator now proves each implementation and test reference exists. +- Added dedicated facade service instances and accessors for every in-scope group while preserving every 1.0.2 and 1.0.3 entry point. +- Added concrete resource hydration classes for every service group and opt-in retry behavior limited to safe/idempotent requests, including `Retry-After` handling. +- Current local evidence: PHPStan max passes, PHPUnit 11.5 passes with 13 tests and 1,489 assertions, all 220 mappings are complete, and API compatibility passes against 1.0.2 and 1.0.3. + +Fresh Xdebug line/branch coverage is being added as a visible CI diagnostic before the 100.00% hard threshold is enabled. Remaining work includes exhaustive lifecycle/utility branches, request and response fixtures from official examples, consumer/framework fixtures, mutation testing, security/release workflows, API-reference coordination, and human-gated repository/release administration. + +## 2026-08-31 — request fixtures, coverage, and consumer integration + +- Enriched the locked manifest with official descriptions, authentication modes, path/query/body fixtures, and 127 response-example references. Generated a 220-row API coverage matrix, and made generated service/tests/docs drift a CI failure. +- Deterministic contract tests now validate official JSON, query, and multipart request fixtures in addition to every method and path. PHPUnit 11.5 currently passes with 34 tests and 1,869 assertions. +- Fresh CI coverage advanced from 69.00% lines / 67.56% branches to complete ordinary executable coverage before the isolated terminating-helper probe closed the final legacy `Utils::dd()` gap. Exact uncovered line and branch diagnostics are emitted from Clover and serialized Xdebug evidence. +- The full CI dependency matrix remains green on PHP 7.4–8.5. Clean copied installs now pass locally for plain PHP, Laravel 12's container, and Symfony 7.4's dependency-injection and PSR-18 client, including optimized `--no-dev` autoload generation. +- Added machine-enforced AGPL metadata/source notices and distribution archive inspection. Security and release workflows are being completed with exact action commit pins, dependency review, Composer audit, secret scanning, CodeQL workflow analysis, SBOM generation, provenance, and a protected `release` environment. + +At this checkpoint, remaining work included the final hard coverage gate, mutation testing, archive-based consumer installs, isolated Fleetbase/Postman contract CI, generated PHP examples, full documentation recipes, and release dry-run validation. + +## 2026-08-31 — exact coverage and release evidence + +- Executed the compatibility-preserved, process-terminating `Utils::dd()` helper in an isolated Xdebug subprocess and merged its real path data into PHPUnit's report; no source exclusion or ignored branch was added. +- Fresh CI run `33399571702` reports 100.00% classes (93/93), methods (450/450), branches (957/957), and lines (1,039/1,039). The hard 100.00% line/branch gate is now enabled for pull requests and releases. +- Built and inspected a source archive with 136 files and no forbidden development state. The 1.1.0 release identity check passes against latest tag 1.0.3. +- The first security run passed Composer audit/license verification and dependency review. It also exposed two actionable workflow findings: a test-only malformed URI triggered TruffleHog's unverified URI detector, and repository-level CodeQL default setup rejected a duplicate advanced SARIF upload. The fixture is now scanner-safe, while advanced Actions analysis remains locally enforced from SARIF without competing with default setup. +- Generated a first-class PHP example for each of the 220 locked requests. The exact fenced snippets execute through the public `Fleetbase` facade and a hermetic Guzzle transport in the unit suite (35 tests, 2,311 assertions), and generated-doc drift is part of `composer check`. +- Replaced the abbreviated README with configuration, self-hosting, PSR-18, services, errors, uploads/downloads, retries, diagnostics, Laravel, Symfony, compatibility, security, and license guidance backed by the implemented APIs. +- Changed consumer CI to download, inspect, extract, and install the built source archive before running the plain PHP, Laravel, and Symfony verifiers; path-based checkout installs no longer satisfy this gate. + +Remaining automatable gates include mutation testing, isolated Fleetbase/Postman contract CI, and release dry-run validation. Human approval remains required for relicensing rights, the mutation threshold, protected release approvers/signing, Packagist verification, the API-reference repository change, and the final default-branch change. + +## 2026-08-31 — disposable upstream contract gates + +- Locked the full Fleetbase stack commit that contains the exact Core API and Fleet-Ops package revisions used by the 220-request SDK contract. +- Added a weekly/manual disposable-stack workflow that builds those locked sources, proves both package revisions, runs both official Postman collections, mints a fresh test credential, and exercises representative SDK success and failure paths against the same API instance. +- Added a separate weekly/manual drift workflow that compares the current official Postman collections with the SDK lock, uploads machine-readable evidence, and opens or updates a repository issue when requests are added, removed, or materially changed. +- The local drift comparison against the locked Postman revision passes across all 220 requests. Workflow syntax, PHP syntax/formatting, max-level PHPStan, generated-artifact drift, compatibility, and the complete hermetic test suite also pass locally. + +The disposable native Postman run requires a repository or organization `POSTMAN_API_KEY`; its CI result is intentionally not claimed until the secret-backed workflow has executed. Release dry-run validation and mutation-survivor review remain automatable work. Human approval is still required for the policy and repository-administration items listed above. + +## 2026-08-31 — mutation and secret-scan baseline review + +- The first full-source Infection run generated 1,588 mutants: 1,370 killed, 214 escaped, 4 timed out, and none uncovered, errored, skipped, or ignored. Its measured mutation score indicator is 86.27% with 100% mutation-code coverage. +- CI now permits the four observed timeout-killed mutants with a narrow ceiling of five; additional timeout growth remains a failure. The permanent minimum mutation-score policy remains an explicit maintainer decision, while the complete report stays visible as a CI artifact. +- The secret workflow now separates verified-secret history scanning from verified-and-unknown scanning of the current source snapshot. This keeps full historical credential validation while preventing a repaired test-only URI false positive in an intermediate review commit from permanently blocking the branch without rewriting history. +- Pull-request CI now assembles the complete 1.1.0 release candidate only after quality, compatibility, exact coverage, mutation, archive, and all consumer gates pass. The standalone release workflow additionally audits dependencies and verifies that a published version becomes installable from Packagist. + +## 2026-09-02 — pagination contract correction + +- Maintainer review confirmed that Fleetbase API v1 does not expose an SDK pagination contract. Removed the unreleased speculative `Service::paginate()` method, its collection metadata abstraction, tests, README example, and release claims. +- `findAll()` and `query()` continue returning arrays for 1.0.x compatibility. They retain defensive hydration for bare arrays and recognized `data`, `results`, or `items` list envelopes, but do not page, slice, or automatically issue follow-up requests. diff --git a/docs/release-checklist.md b/docs/release-checklist.md new file mode 100644 index 0000000..69731f6 --- /dev/null +++ b/docs/release-checklist.md @@ -0,0 +1,37 @@ +# 1.1.0 release checklist + +The release workflow validates and packages the candidate automatically. Publication remains an explicit maintainer-approved operation. + +## Maintainer decisions before publication + +- Fleetbase ownership and authorization to publish the new release under `AGPL-3.0-or-later` was confirmed by the maintainer. +- An 85% minimum mutation score was approved. The final pre-release baseline measured 86.02% with 100% mutation-code coverage and no ignored source. +- Select protected `release` environment approvers and the signing/attestation identity. +- Verify Packagist ownership and the GitHub update hook. +- Approve the coordinated Fleetbase API-reference generator update. +- Approve the default-branch migration and the protected `master` transition period. + +## Repository preparation + +1. Merge the implementation pull request into `release/v1.1.0` after every pull-request check succeeds. +2. Review and merge the release integration into `main` after the default-branch runbook is approved. +3. Configure required checks and the protected `release` environment without granting workflow bypasses. +4. Add `POSTMAN_API_KEY`, run both disposable contract workflows, and retain their evidence. +5. Run the release workflow with version `1.1.0` and `publish=false`; review the archive, SBOM, checksums, coverage summary, API matrix, and workflow logs. + +## Publication + +1. Re-run the release workflow from the reviewed `main` commit with version `1.1.0` and `publish=true`. +2. Approve the protected `release` environment only after the validation job succeeds. +3. Confirm the immutable `1.1.0` tag and GitHub Release target the reviewed commit and contain the expected artifacts and provenance. +4. Verify GitHub and Packagist identify `AGPL-3.0-or-later` for 1.1.0 while older tags retain their original MIT terms. +5. Install the exact public package into clean plain PHP, Laravel, and Symfony fixtures: + +```bash +composer require fleetbase/fleetbase-php:1.1.0 +composer install --no-dev --optimize-autoloader +``` + +6. Confirm the public API reference renders the checked-in 1.1.0 PHP examples. + +Never reuse, move, or rewrite a published tag. If validation fails after publication, publish a new patch release. diff --git a/docs/releases/1.1.0.md b/docs/releases/1.1.0.md new file mode 100644 index 0000000..f18b309 --- /dev/null +++ b/docs/releases/1.1.0.md @@ -0,0 +1,15 @@ +# Fleetbase PHP SDK 1.1.0 + +Version 1.1.0 modernizes the official Fleetbase PHP SDK while preserving the public API used by 1.0.2 and 1.0.3 consumers. + +Highlights: + +- all 220 locked Fleetbase and Core API Postman requests have explicit SDK methods and deterministic request fixtures; +- PHP 7.4 through 8.5 are covered by lowest/latest dependency CI; +- PSR-18 transport injection, structured exceptions, retries, uploads, and improved resource lifecycle behavior; +- clean plain PHP, Laravel container, and Symfony container/HTTP client integration fixtures; +- reproducible release archives, coverage evidence, SBOM generation, and review-gated release automation. + +License change: version 1.1.0 is distributed under `AGPL-3.0-or-later`. Published 1.0.x tags remain under the MIT license shipped with those releases. Review the license and the migration guide before upgrading. + +No release is published automatically from a pull request. Publishing requires the reviewed commit on `main`, a protected `release` environment approval, successful release gates, and an explicit workflow input. diff --git a/docs/repository-audit.md b/docs/repository-audit.md new file mode 100644 index 0000000..02469f3 --- /dev/null +++ b/docs/repository-audit.md @@ -0,0 +1,49 @@ +# Repository and release-infrastructure audit + +Snapshot date: 2026-08-31 + +This document records non-secret metadata used to prepare v1.1.0. Secret values were not requested or displayed. + +## Published package baseline + +- GitHub repository: `fleetbase/fleetbase-php`, public. +- GitHub default branch: `master`. +- Latest published tag discovered after refreshing official refs: `1.0.3`, dereferencing to commit `97dabc53fc1c9c96ce99fb2bd88ddbd04164b450`. +- Required compatibility baseline: `1.0.2`, commit `569fe88e0359d567f30588820243d1d69ab418ec`. +- The 1.0.3 commit and annotated tag are unsigned according to GitHub verification metadata. +- Packagist package: `fleetbase/fleetbase-php`; public metadata reported 33 total downloads, four favers, and zero dependents at audit time. +- Packagist exposes 1.0.3 and development branches. Packagist ownership, hook delivery state, and organization-level permissions are not publicly observable and require an owner to verify in Packagist. +- Existing published versions remain MIT-licensed. The requested AGPL change takes effect only in the new release after rights confirmation. + +## Repository administration + +- Administrators returned by the GitHub collaborators API: `roncodes`, `shivthakker`. +- `master` has no branch-protection rule. +- GitHub Actions environments: 0. +- GitHub Actions repository secrets: 0 names reported. +- GitHub Actions repository variables: 0 names reported. +- Active repository webhooks: one Packagist webhook. No credential-bearing URL was recorded. +- Secret scanning: enabled. +- Push protection: enabled. +- Non-provider pattern scanning and validity checks: enabled. +- Secret-scanning alerts: 0 at audit time. +- Dependabot security updates: disabled. +- GitHub's dependency alert reported on push: 21 known vulnerabilities on the default branch (8 high, 13 moderate). + +## Tracked-content and credential assessment + +- `vendor/` contains 4,394 tracked dependency files. +- `.phpunit.result.cache` and `.env.test` are tracked. +- The only `FLEETBASE_KEY` value in `.env.test` is an obvious placeholder by content and length; it is not being treated as a credential. The value is intentionally not reproduced here. +- No rotation or history rewrite is indicated by the available evidence. If a maintainer knows the placeholder was ever replaced with a real key in another revision, rotation and history remediation require a separately approved security operation. + +## Human approvals still required + +1. Confirm Fleetbase owns or has permission to relicense every contribution included in the new release as `AGPL-3.0-or-later`. +2. Verify Packagist owners and the GitHub update hook from the authenticated Packagist UI. +3. Select release-signing/attestation identity and protected-environment approvers. +4. Approve and apply repository rules, environments, required checks, and the final `master` to `main` default-branch change after workflows are ready. + +## Planned remediations + +The implementation will remove tracked dependencies and local state, regenerate dependencies from Composer, enable dependency update automation, add required CI/security/release workflows, and prepare repository-rule/default-branch instructions. Administrative changes and publication remain outside automation until explicitly approved. diff --git a/fixtures/consumer/laravel/composer.json b/fixtures/consumer/laravel/composer.json new file mode 100644 index 0000000..30d1700 --- /dev/null +++ b/fixtures/consumer/laravel/composer.json @@ -0,0 +1,25 @@ +{ + "name": "fleetbase/sdk-laravel-consumer-fixture", + "description": "Laravel container consumer fixture for fleetbase/fleetbase-php", + "type": "project", + "license": "proprietary", + "repositories": [ + { + "type": "path", + "url": "../../..", + "options": { + "symlink": false, + "versions": { "fleetbase/fleetbase-php": "1.1.0-dev" } + } + } + ], + "require": { + "fleetbase/fleetbase-php": "^1.1@dev", + "illuminate/container": "^12.0" + }, + "scripts": { + "verify": "@php verify.php" + }, + "minimum-stability": "dev", + "prefer-stable": true +} diff --git a/fixtures/consumer/laravel/verify.php b/fixtures/consumer/laravel/verify.php new file mode 100644 index 0000000..e4df1f1 --- /dev/null +++ b/fixtures/consumer/laravel/verify.php @@ -0,0 +1,23 @@ +singleton(Fleetbase::class, static function (): Fleetbase { + return new Fleetbase('fixture_key', [ + 'host' => 'https://fleetbase.example.test', + 'namespace' => 'api/v1', + ]); +}); + +$sdk = $container->make(Fleetbase::class); +if (!$sdk instanceof Fleetbase || $container->make(Fleetbase::class) !== $sdk) { + throw new RuntimeException('The Laravel container did not resolve the Fleetbase singleton.'); +} + +fwrite(STDOUT, "Laravel container consumer verified.\n"); diff --git a/fixtures/consumer/plain/composer.json b/fixtures/consumer/plain/composer.json new file mode 100644 index 0000000..d6701d6 --- /dev/null +++ b/fixtures/consumer/plain/composer.json @@ -0,0 +1,24 @@ +{ + "name": "fleetbase/sdk-plain-consumer-fixture", + "description": "Plain PHP consumer fixture for fleetbase/fleetbase-php", + "type": "project", + "license": "proprietary", + "repositories": [ + { + "type": "path", + "url": "../../..", + "options": { + "symlink": false, + "versions": { "fleetbase/fleetbase-php": "1.1.0-dev" } + } + } + ], + "require": { + "fleetbase/fleetbase-php": "^1.1@dev" + }, + "scripts": { + "verify": "@php verify.php" + }, + "minimum-stability": "dev", + "prefer-stable": true +} diff --git a/fixtures/consumer/plain/verify.php b/fixtures/consumer/plain/verify.php new file mode 100644 index 0000000..f4b6436 --- /dev/null +++ b/fixtures/consumer/plain/verify.php @@ -0,0 +1,19 @@ + 'https://fleetbase.example.test', + 'namespace' => 'api/v1', +]); + +if (!$sdk->orders() instanceof OrderService || $sdk->getVersion() !== 'v1') { + throw new RuntimeException('The plain PHP consumer could not resolve the SDK facade.'); +} + +fwrite(STDOUT, "Plain PHP consumer verified.\n"); diff --git a/fixtures/consumer/symfony/composer.json b/fixtures/consumer/symfony/composer.json new file mode 100644 index 0000000..26c8452 --- /dev/null +++ b/fixtures/consumer/symfony/composer.json @@ -0,0 +1,26 @@ +{ + "name": "fleetbase/sdk-symfony-consumer-fixture", + "description": "Symfony container and PSR-18 consumer fixture for fleetbase/fleetbase-php", + "type": "project", + "license": "proprietary", + "repositories": [ + { + "type": "path", + "url": "../../..", + "options": { + "symlink": false, + "versions": { "fleetbase/fleetbase-php": "1.1.0-dev" } + } + } + ], + "require": { + "fleetbase/fleetbase-php": "^1.1@dev", + "symfony/dependency-injection": "^7.4", + "symfony/http-client": "^7.4" + }, + "scripts": { + "verify": "@php verify.php" + }, + "minimum-stability": "dev", + "prefer-stable": true +} diff --git a/fixtures/consumer/symfony/verify.php b/fixtures/consumer/symfony/verify.php new file mode 100644 index 0000000..c5b5e80 --- /dev/null +++ b/fixtures/consumer/symfony/verify.php @@ -0,0 +1,37 @@ +register('fleetbase.psr17_factory', HttpFactory::class); +$container->register('fleetbase.transport', Psr18Client::class)->setArguments([ + null, + new Reference('fleetbase.psr17_factory'), + new Reference('fleetbase.psr17_factory'), +]); +$container->register(Fleetbase::class, Fleetbase::class) + ->setPublic(true) + ->setArguments([ + 'fixture_key', + [ + 'host' => 'https://fleetbase.example.test', + 'namespace' => 'api/v1', + 'httpClient' => new Reference('fleetbase.transport'), + ], + ]); +$container->compile(); + +$sdk = $container->get(Fleetbase::class); +if (!$sdk instanceof Fleetbase || !$sdk->getOptions()['httpClient'] instanceof Psr18Client) { + throw new RuntimeException('The Symfony container did not inject its PSR-18 transport.'); +} + +fwrite(STDOUT, "Symfony container consumer verified.\n"); diff --git a/infection.json5.dist b/infection.json5.dist new file mode 100644 index 0000000..ac7e8f6 --- /dev/null +++ b/infection.json5.dist @@ -0,0 +1,31 @@ +{ + source: { + directories: [ + "src" + ] + }, + timeout: 10, + threads: "max", + testFramework: "phpunit", + phpUnit: { + configDir: "." + }, + // The 1.1.0 maintainer-approved quality floor. The release baseline is + // 86.02%, leaving limited headroom while preventing silent regression. + minMsi: 85, + minCoveredMsi: 85, + timeoutsAsEscaped: true, + // Four timeout-killed mutants were observed in the first complete baseline. + // Keep a small explicit ceiling so new timeout growth still fails CI. + maxTimeouts: 5, + logs: { + text: "build/mutation/infection.log", + summary: "build/mutation/summary.log", + summaryJson: "build/mutation/summary.json", + html: "build/mutation/report.html", + github: true + }, + mutators: { + "@default": true + } +} diff --git a/phpstan.neon b/phpstan.neon deleted file mode 100644 index b59e9f2..0000000 --- a/phpstan.neon +++ /dev/null @@ -1,2 +0,0 @@ -includes: - - vendor/phpstan/phpstan-mockery/extension.neon diff --git a/phpstan.neon.dist b/phpstan.neon.dist new file mode 100644 index 0000000..e1fcde8 --- /dev/null +++ b/phpstan.neon.dist @@ -0,0 +1,11 @@ +includes: + - vendor/phpstan/phpstan-mockery/extension.neon + - vendor/phpstan/phpstan-phpunit/extension.neon + +parameters: + level: max + paths: + - src + - tests + tmpDir: build/phpstan + treatPhpDocTypesAsCertain: false diff --git a/phpunit-9.xml.dist b/phpunit-9.xml.dist new file mode 100644 index 0000000..7720dfd --- /dev/null +++ b/phpunit-9.xml.dist @@ -0,0 +1,20 @@ + + + + + tests + + + + + src + + + diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 4828f96..5286525 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,13 +1,21 @@ - + - - ./tests + + tests - - - ./src - - + + + src + + + diff --git a/src/Arr.php b/src/Arr.php index 7a0ca5e..bca1025 100644 --- a/src/Arr.php +++ b/src/Arr.php @@ -7,7 +7,7 @@ * file that was distributed with this source code. * * @copyright Copyright (c) Fleetbase Pte Ltd. - * @license http://opensource.org/licenses/MIT MIT + * @license https://www.gnu.org/licenses/agpl-3.0.html AGPL-3.0-or-later */ declare(strict_types=1); @@ -19,6 +19,12 @@ */ class Arr { + /** + * @template T + * @param array $arr + * @param callable(T): bool $predicate + * @return bool + */ public static function every(array $arr, callable $predicate) { foreach ($arr as $e) { @@ -30,16 +36,27 @@ public static function every(array $arr, callable $predicate) return true; } + /** + * @template T + * @param array $arr + * @param callable(T): bool $predicate + * @return bool + */ public static function any(array $arr, callable $predicate) { return !static::every( $arr, - function ($e) use ($predicate) { + function ($e) use ($predicate): bool { return !call_user_func($predicate, $e); } ); } + /** + * @template T + * @param array $arr + * @return T|-1 + */ public static function first(array $arr) { $arr = array_values($arr); diff --git a/src/Configuration.php b/src/Configuration.php new file mode 100644 index 0000000..23fa413 --- /dev/null +++ b/src/Configuration.php @@ -0,0 +1,100 @@ + + * @license https://www.gnu.org/licenses/agpl-3.0.html AGPL-3.0-or-later + */ + +declare(strict_types=1); + +namespace Fleetbase\Sdk; + +use Fleetbase\Sdk\Exception\InvalidConfigurationException; + +final class Configuration +{ + private string $apiKey; + private string $host; + private string $namespace; + private string $version; + private bool $debug; + + /** @var array */ + private array $options; + + /** @param array $options */ + public function __construct(string $apiKey, array $options = [], bool $debug = false) + { + if (trim($apiKey) === '') { + throw new InvalidConfigurationException('A non-empty Fleetbase API key is required.'); + } + + $version = $options['version'] ?? 'v1'; + $host = $options['host'] ?? 'https://api.fleetbase.io'; + $namespace = $options['namespace'] ?? $version; + + if (!is_string($version) || trim($version) === '') { + throw new InvalidConfigurationException('Fleetbase API version must be a non-empty string.'); + } + if (!is_string($host) || filter_var($host, FILTER_VALIDATE_URL) === false) { + throw new InvalidConfigurationException('Fleetbase host must be an absolute HTTP(S) URL.'); + } + if (!in_array(strtolower((string) parse_url($host, PHP_URL_SCHEME)), ['http', 'https'], true)) { + throw new InvalidConfigurationException('Fleetbase host must use HTTP or HTTPS.'); + } + if (!is_string($namespace)) { + throw new InvalidConfigurationException('Fleetbase namespace must be a string.'); + } + + $this->apiKey = $apiKey; + $this->host = rtrim($host, '/'); + $this->namespace = trim($namespace, '/'); + $this->version = $version; + $this->debug = $debug; + $this->options = $options; + } + + public function getApiKey(): string + { + return $this->apiKey; + } + + public function getHost(): string + { + return $this->host; + } + + public function getNamespace(): string + { + return $this->namespace; + } + + public function getVersion(): string + { + return $this->version; + } + + public function isDebug(): bool + { + return $this->debug; + } + + public function getBaseUri(): string + { + return $this->host . ($this->namespace !== '' ? '/' . $this->namespace : '') . '/'; + } + + /** @return array */ + public function toArray(): array + { + return array_merge($this->options, [ + 'version' => $this->version, + 'host' => $this->host, + 'namespace' => $this->namespace, + 'debug' => $this->debug, + 'publicKey' => $this->apiKey, + ]); + } +} diff --git a/src/EndpointService.php b/src/EndpointService.php new file mode 100644 index 0000000..668f935 --- /dev/null +++ b/src/EndpointService.php @@ -0,0 +1,16 @@ + + * @license https://www.gnu.org/licenses/agpl-3.0.html AGPL-3.0-or-later + */ + +declare(strict_types=1); + +namespace Fleetbase\Sdk; + +abstract class EndpointService extends Service +{ +} diff --git a/src/Exception/AuthenticationException.php b/src/Exception/AuthenticationException.php new file mode 100644 index 0000000..1beb236 --- /dev/null +++ b/src/Exception/AuthenticationException.php @@ -0,0 +1,17 @@ + - * @license http://opensource.org/licenses/MIT MIT + * @license https://www.gnu.org/licenses/agpl-3.0.html AGPL-3.0-or-later */ declare(strict_types=1); namespace Fleetbase\Sdk; -use Exception; -use Fleetbase\Sdk\HttpClient; +use Fleetbase\Sdk\Services\ChatChannelService; +use Fleetbase\Sdk\Services\CommentService; +use Fleetbase\Sdk\Services\ContactService; +use Fleetbase\Sdk\Services\CustomerService; +use Fleetbase\Sdk\Services\DeviceService; +use Fleetbase\Sdk\Services\DriverService; +use Fleetbase\Sdk\Services\EntityService; +use Fleetbase\Sdk\Services\EquipmentService; +use Fleetbase\Sdk\Services\FileService; +use Fleetbase\Sdk\Services\FleetService; +use Fleetbase\Sdk\Services\FuelReportService; +use Fleetbase\Sdk\Services\FuelTransactionService; +use Fleetbase\Sdk\Services\GeofenceService; +use Fleetbase\Sdk\Services\IssueService; +use Fleetbase\Sdk\Services\LabelService; +use Fleetbase\Sdk\Services\ManifestService; +use Fleetbase\Sdk\Services\OnboardService; +use Fleetbase\Sdk\Services\OrchestratorService; +use Fleetbase\Sdk\Services\OrderConfigService; use Fleetbase\Sdk\Services\OrderService; +use Fleetbase\Sdk\Services\OrganizationService; +use Fleetbase\Sdk\Services\PartService; +use Fleetbase\Sdk\Services\PayloadService; +use Fleetbase\Sdk\Services\PlaceService; +use Fleetbase\Sdk\Services\PurchaseRateService; +use Fleetbase\Sdk\Services\SensorService; +use Fleetbase\Sdk\Services\ServiceAreaService; +use Fleetbase\Sdk\Services\ServiceQuoteService; +use Fleetbase\Sdk\Services\ServiceRateService; +use Fleetbase\Sdk\Services\TrackingNumberService; +use Fleetbase\Sdk\Services\TrackingStatusService; +use Fleetbase\Sdk\Services\VehicleService; +use Fleetbase\Sdk\Services\VendorService; +use Fleetbase\Sdk\Services\WorkOrderService; +use Fleetbase\Sdk\Services\ZoneService; -/** - * Fleetbase PHP SDK - */ +/** @phpstan-consistent-constructor */ class Fleetbase { private string $version; + + /** @var array */ private array $options; + /** @var HttpClient */ + public $client; + + /** @var OrderService */ + public $orders; + + /** @var EntityService */ + public $entities; + + /** @var PlaceService */ + public $places; + + /** @var DriverService */ + public $drivers; + + /** @var VehicleService */ + public $vehicles; + + /** @var VendorService */ + public $vendors; + + /** @var ContactService */ + public $contacts; + + /** @var ServiceAreaService */ + public $serviceAreas; + + /** @var ZoneService */ + public $zones; + + /** @var TrackingStatusService */ + public $trackingStatuses; + + /** @var ServiceRateService */ + public $serviceRates; + + /** @var ServiceQuoteService */ + public $serviceQuotes; + + /** @var CustomerService */ + public $customers; + + /** @var DeviceService */ + public $devices; + + /** @var EquipmentService */ + public $equipment; + + /** @var FleetService */ + public $fleets; + + /** @var FuelReportService */ + public $fuelReports; + + /** @var FuelTransactionService */ + public $fuelTransactions; + + /** @var GeofenceService */ + public $geofences; + + /** @var IssueService */ + public $issues; + + /** @var LabelService */ + public $labels; + + /** @var ManifestService */ + public $manifests; + + /** @var OnboardService */ + public $onboard; + + /** @var OrchestratorService */ + public $orchestrator; + + /** @var OrderConfigService */ + public $orderConfigs; + + /** @var OrganizationService */ + public $organizations; + + /** @var PartService */ + public $parts; + + /** @var PayloadService */ + public $payloads; + + /** @var PurchaseRateService */ + public $purchaseRates; + + /** @var SensorService */ + public $sensors; + + /** @var TrackingNumberService */ + public $trackingNumbers; + + /** @var WorkOrderService */ + public $workOrders; + + /** @var ChatChannelService */ + public $chatChannels; + + /** @var CommentService */ + public $comments; + + /** @var FileService */ + public $files; + + /** @param array $config */ public function __construct(string $publicKey, array $config = [], bool $debug = false) { - $this->version = $config['version'] ?? 'v1'; - $this->options = $options = [ - 'version' => $this->version, - 'host' => $config['host'] ?? 'https://api.fleetbase.io', - 'namespace' => $config['namespace'] ?? $this->version, - 'debug' => $debug, - 'publicKey' => $publicKey - ]; - - if (!is_string($publicKey) && count($publicKey) === 0) { - throw new Exception('⚠️ Invalid public key given to Fleetbase SDK'); - } + $configuration = new Configuration($publicKey, $config, $debug); + $this->version = $configuration->getVersion(); + $this->options = $configuration->toArray(); + $this->client = new HttpClient($this->options); - $this->client = $client = new HttpClient($options); - $this->orders = new OrderService($client); - $this->entities = new Service('Entity', $client); - $this->places = new Service('Place', $client); - $this->drivers = new Service('Driver', $client); - $this->vehicles = new Service('Vehicle', $client); - $this->vendors = new Service('Vendor', $client); - $this->contacts = new Service('Contact', $client); - $this->serviceAreas = new Service('ServiceArea', $client); - $this->zones = new Service('Zone', $client); - $this->trackingStatuses = new Service('TrackingStatues', $client); - $this->serviceRates = new Service('ServiceRate', $client); - $this->serviceQuotes = new Service('ServiceQuote', $client); + $this->orders = new OrderService($this->client); + $this->entities = new EntityService($this->client); + $this->places = new PlaceService($this->client); + $this->drivers = new DriverService($this->client); + $this->vehicles = new VehicleService($this->client); + $this->vendors = new VendorService($this->client); + $this->contacts = new ContactService($this->client); + $this->serviceAreas = new ServiceAreaService($this->client); + $this->zones = new ZoneService($this->client); + $this->trackingStatuses = new TrackingStatusService($this->client); + $this->serviceRates = new ServiceRateService($this->client); + $this->serviceQuotes = new ServiceQuoteService($this->client); + $this->customers = new CustomerService($this->client); + $this->devices = new DeviceService($this->client); + $this->equipment = new EquipmentService($this->client); + $this->fleets = new FleetService($this->client); + $this->fuelReports = new FuelReportService($this->client); + $this->fuelTransactions = new FuelTransactionService($this->client); + $this->geofences = new GeofenceService($this->client); + $this->issues = new IssueService($this->client); + $this->labels = new LabelService($this->client); + $this->manifests = new ManifestService($this->client); + $this->onboard = new OnboardService($this->client); + $this->orchestrator = new OrchestratorService($this->client); + $this->orderConfigs = new OrderConfigService($this->client); + $this->organizations = new OrganizationService($this->client); + $this->parts = new PartService($this->client); + $this->payloads = new PayloadService($this->client); + $this->purchaseRates = new PurchaseRateService($this->client); + $this->sensors = new SensorService($this->client); + $this->trackingNumbers = new TrackingNumberService($this->client); + $this->workOrders = new WorkOrderService($this->client); + $this->chatChannels = new ChatChannelService($this->client); + $this->comments = new CommentService($this->client); + $this->files = new FileService($this->client); } public function setApiKey(string $publicKey): Fleetbase { - return static::newInstance($publicKey); + $config = $this->options; + unset($config['publicKey'], $config['debug']); + return static::newInstance($publicKey, $config, (bool) $this->options['debug']); } public static function newInstance(): Fleetbase { + /** @var array $args */ $args = func_get_args(); - return new static(...$args); + $publicKey = $args[0] ?? null; + $config = $args[1] ?? []; + $debug = $args[2] ?? false; + if (!is_string($publicKey) || !is_array($config) || !is_bool($debug)) { + throw new \InvalidArgumentException('Fleetbase::newInstance() expects an API key, configuration array, and debug boolean.'); + } + + $normalizedConfig = []; + foreach ($config as $key => $value) { + if (is_string($key)) { + $normalizedConfig[$key] = $value; + } + } + + return new static($publicKey, $normalizedConfig, $debug); } public function getVersion(): string @@ -72,8 +241,193 @@ public function getVersion(): string return $this->version; } + /** @return array */ public function getOptions(): array { return $this->options; } + + public function orders(): OrderService + { + return $this->orders; + } + + public function service(string $name): Service + { + if (!property_exists($this, $name) || !$this->{$name} instanceof Service) { + throw new \InvalidArgumentException(sprintf('Unknown Fleetbase service "%s".', $name)); + } + + return $this->{$name}; + } + + public function places(): Service + { + return $this->places; + } + + public function drivers(): Service + { + return $this->drivers; + } + + public function vehicles(): Service + { + return $this->vehicles; + } + + public function vendors(): Service + { + return $this->vendors; + } + + public function contacts(): Service + { + return $this->contacts; + } + + public function payloads(): Service + { + return $this->payloads; + } + + public function organizations(): Service + { + return $this->organizations; + } + + public function comments(): Service + { + return $this->comments; + } + + public function files(): Service + { + return $this->files; + } + + public function chatChannels(): Service + { + return $this->chatChannels; + } + + public function entities(): EntityService + { + return $this->entities; + } + + public function serviceAreas(): ServiceAreaService + { + return $this->serviceAreas; + } + + public function zones(): ZoneService + { + return $this->zones; + } + + public function trackingStatuses(): TrackingStatusService + { + return $this->trackingStatuses; + } + + public function serviceRates(): ServiceRateService + { + return $this->serviceRates; + } + + public function serviceQuotes(): ServiceQuoteService + { + return $this->serviceQuotes; + } + + public function customers(): CustomerService + { + return $this->customers; + } + + public function devices(): DeviceService + { + return $this->devices; + } + + public function equipment(): EquipmentService + { + return $this->equipment; + } + + public function fleets(): FleetService + { + return $this->fleets; + } + + public function fuelReports(): FuelReportService + { + return $this->fuelReports; + } + + public function fuelTransactions(): FuelTransactionService + { + return $this->fuelTransactions; + } + + public function geofences(): GeofenceService + { + return $this->geofences; + } + + public function issues(): IssueService + { + return $this->issues; + } + + public function labels(): LabelService + { + return $this->labels; + } + + public function manifests(): ManifestService + { + return $this->manifests; + } + + public function onboard(): OnboardService + { + return $this->onboard; + } + + public function orchestrator(): OrchestratorService + { + return $this->orchestrator; + } + + public function orderConfigs(): OrderConfigService + { + return $this->orderConfigs; + } + + public function parts(): PartService + { + return $this->parts; + } + + public function purchaseRates(): PurchaseRateService + { + return $this->purchaseRates; + } + + public function sensors(): SensorService + { + return $this->sensors; + } + + public function trackingNumbers(): TrackingNumberService + { + return $this->trackingNumbers; + } + + public function workOrders(): WorkOrderService + { + return $this->workOrders; + } } diff --git a/src/FleetbaseException.php b/src/FleetbaseException.php index f065f4a..42fcf25 100644 --- a/src/FleetbaseException.php +++ b/src/FleetbaseException.php @@ -7,7 +7,7 @@ * file that was distributed with this source code. * * @copyright Copyright (c) Fleetbase Pte Ltd. - * @license http://opensource.org/licenses/MIT MIT + * @license https://www.gnu.org/licenses/agpl-3.0.html AGPL-3.0-or-later */ declare(strict_types=1); @@ -19,4 +19,65 @@ */ class FleetbaseException extends \RuntimeException { + private ?int $statusCode; + private ?string $errorCode; + private ?string $requestId; + private ?string $method; + private ?string $url; + + /** @var array */ + private array $details; + + /** + * @param array $details + */ + public function __construct( + string $message, + ?int $statusCode = null, + ?string $errorCode = null, + array $details = [], + ?string $requestId = null, + ?string $method = null, + ?string $url = null, + ?\Throwable $previous = null + ) { + parent::__construct($message, $statusCode ?? 0, $previous); + $this->statusCode = $statusCode; + $this->errorCode = $errorCode; + $this->details = $details; + $this->requestId = $requestId; + $this->method = $method; + $this->url = $url; + } + + public function getStatusCode(): ?int + { + return $this->statusCode; + } + + public function getErrorCode(): ?string + { + return $this->errorCode; + } + + /** @return array */ + public function getDetails(): array + { + return $this->details; + } + + public function getRequestId(): ?string + { + return $this->requestId; + } + + public function getRequestMethod(): ?string + { + return $this->method; + } + + public function getRequestUrl(): ?string + { + return $this->url; + } } diff --git a/src/HttpClient.php b/src/HttpClient.php index 90eba2c..2f9af7c 100644 --- a/src/HttpClient.php +++ b/src/HttpClient.php @@ -1,160 +1,648 @@ - * @license http://opensource.org/licenses/MIT MIT + * @license https://www.gnu.org/licenses/agpl-3.0.html AGPL-3.0-or-later */ declare(strict_types=1); namespace Fleetbase\Sdk; +use Fleetbase\Sdk\Exception\AuthenticationException; +use Fleetbase\Sdk\Exception\AuthorizationException; +use Fleetbase\Sdk\Exception\ConflictException; +use Fleetbase\Sdk\Exception\DecodingException; +use Fleetbase\Sdk\Exception\NotFoundException; +use Fleetbase\Sdk\Exception\RateLimitException; +use Fleetbase\Sdk\Exception\ServerException; +use Fleetbase\Sdk\Exception\TimeoutException; +use Fleetbase\Sdk\Exception\TransportException; +use Fleetbase\Sdk\Exception\UnexpectedResponseException; +use Fleetbase\Sdk\Exception\ValidationException; use GuzzleHttp\Client; +use GuzzleHttp\ClientInterface as GuzzleClientInterface; +use GuzzleHttp\Exception\ConnectException; +use GuzzleHttp\Psr7\HttpFactory; +use GuzzleHttp\Psr7\MultipartStream; use GuzzleHttp\Psr7\Response; -use Exception; +use Psr\Http\Client\ClientExceptionInterface; +use Psr\Http\Client\ClientInterface; +use Psr\Http\Message\RequestFactoryInterface; +use Psr\Http\Message\RequestInterface; +use Psr\Http\Message\ResponseInterface; +use Psr\Http\Message\StreamFactoryInterface; +use Throwable; -/** - * Fleetbase PHP SDK HTTP Client - */ class HttpClient { private string $host; private string $namespace; + private string $apiKey; + + /** @var array */ private array $options = []; - private Client $client; + + private ClientInterface $client; + private RequestFactoryInterface $requestFactory; + private StreamFactoryInterface $streamFactory; private Response $lastResponse; + private ?ResponseInterface $lastPsrResponse = null; + /** @param array $options */ public function __construct(array $options = []) { - $this->options = $options; - $this->host = $options['host']; - $this->namespace = $options['namespace']; - $this->client = $this->createClient($options); + $configuration = new Configuration( + is_string($options['publicKey'] ?? null) ? $options['publicKey'] : '', + $options, + (bool) ($options['debug'] ?? false) + ); + + $this->options = $configuration->toArray(); + $this->host = $configuration->getHost(); + $this->namespace = $configuration->getNamespace(); + $this->apiKey = $configuration->getApiKey(); + $this->requestFactory = $this->resolveRequestFactory($options); + $this->streamFactory = $this->resolveStreamFactory($options); + $this->client = $this->resolveClient($options); } - public function setHost(string $host) : HttpClient + public function setHost(string $host): HttpClient { - $this->host = $this->options['host'] = $host; - $this->client = $this->createClient(); + $configuration = new Configuration( + $this->apiKey, + array_merge($this->options, ['host' => $host]), + (bool) ($this->options['debug'] ?? false) + ); + $this->host = $configuration->getHost(); + $this->options = $configuration->toArray(); return $this; } - public function setNamespace(string $namespace) : HttpClient + public function setNamespace(string $namespace): HttpClient { - $this->namespace = $this->options['namespace'] = $namespace; - $this->client = $this->createClient(); + $configuration = new Configuration( + $this->apiKey, + array_merge($this->options, ['namespace' => $namespace]), + (bool) ($this->options['debug'] ?? false) + ); + $this->namespace = $configuration->getNamespace(); + $this->options = $configuration->toArray(); return $this; } - public function getHost() : string + public function getHost(): string { return $this->host; } - public function getNamespace() : string + public function getNamespace(): string { return $this->namespace; } - public function getOptions() : array + /** @return array */ + public function getOptions(): array { return $this->options; } - public function getLastResponse() : Response + public function getLastResponse(): Response { + if (!isset($this->lastResponse)) { + throw new UnexpectedResponseException('No Fleetbase response has been received.'); + } + return $this->lastResponse; } - private function createClient(?array $options = null) : Client + public function getLastPsrResponse(): ?ResponseInterface { - $options = $options ?? $this->getOptions(); + return $this->lastPsrResponse; + } - $client = new Client( - [ - 'base_uri' => $this->buildRequestUrl(), - 'headers' => [ - 'Accept' => 'application/json', - 'Content-Type' => 'application/json', - 'Authorization' => 'Bearer ' . $options['publicKey'] - ] - ] - ); + /** + * @param array $data + * @param array $options + * @return mixed + */ + public function request(string $method, string $path, array $data = [], array $options = []) + { + $method = strtoupper($method); + $request = $this->buildRequest($method, $path, $data, $options); + + if (isset($options['onBefore']) && is_callable($options['onBefore'])) { + call_user_func($options['onBefore']); + } + + try { + $response = $this->sendWithRetries($request, $options); + } catch (ConnectException $exception) { + $message = stripos($exception->getMessage(), 'timed out') !== false + ? 'The Fleetbase request timed out.' + : 'Unable to connect to the Fleetbase API.'; + $class = stripos($exception->getMessage(), 'timed out') !== false + ? TimeoutException::class + : TransportException::class; + throw new $class($message, null, null, [], null, $method, $this->sanitizeUrl((string) $request->getUri()), $exception); + } catch (ClientExceptionInterface $exception) { + throw new TransportException( + 'The Fleetbase transport failed.', + null, + null, + [], + null, + $method, + $this->sanitizeUrl((string) $request->getUri()), + $exception + ); + } + + $this->lastPsrResponse = $response; + $this->lastResponse = $this->normalizeResponse($response); + $decoded = $this->decodeResponse($response, $method, (string) $request->getUri()); + + if (isset($options['onAfter']) && is_callable($options['onAfter'])) { + call_user_func($options['onAfter'], $decoded); + } + + return $decoded; + } + + /** + * @param array $data + * @param array|null $options + * @return mixed + */ + public function post(string $path, array $data = [], $options = []) + { + return $this->request('POST', $path, $data, $this->normalizeOptions($options)); + } + + /** + * @param array $data + * @param array|null $options + * @return mixed + */ + public function get(string $path, array $data = [], $options = []) + { + return $this->request('GET', $path, $data, $this->normalizeOptions($options)); + } + + /** + * @param array $data + * @param array|null $options + * @return mixed + */ + public function delete(string $path, array $data = [], $options = []) + { + return $this->request('DELETE', $path, $data, $this->normalizeOptions($options)); + } + + /** + * @param array $data + * @param array|null $options + * @return mixed + */ + public function put(string $path, array $data = [], $options = []) + { + return $this->request('PUT', $path, $data, $this->normalizeOptions($options)); + } - return $client; + /** + * @param array $data + * @param array|null $options + * @return mixed + */ + public function patch(string $path, array $data = [], $options = []) + { + return $this->request('PATCH', $path, $data, $this->normalizeOptions($options)); + } + + /** @param array $options */ + private function resolveClient(array $options): ClientInterface + { + $client = $options['httpClient'] ?? $options['client'] ?? null; + if ($client instanceof ClientInterface) { + return $client; + } + + return new Client(['http_errors' => false]); + } + + /** @param array $options */ + private function resolveRequestFactory(array $options): RequestFactoryInterface + { + $factory = $options['requestFactory'] ?? null; + return $factory instanceof RequestFactoryInterface ? $factory : new HttpFactory(); + } + + /** @param array $options */ + private function resolveStreamFactory(array $options): StreamFactoryInterface + { + $factory = $options['streamFactory'] ?? null; + return $factory instanceof StreamFactoryInterface ? $factory : new HttpFactory(); + } + + /** + * @param array $data + * @param array $options + */ + private function buildRequest(string $method, string $path, array $data, array $options): RequestInterface + { + $url = $this->buildRequestUrl($path); + if (in_array($method, ['GET', 'HEAD'], true) && $data !== []) { + $separator = strpos($url, '?') === false ? '?' : '&'; + $url .= $separator . http_build_query($data, '', '&', PHP_QUERY_RFC3986); + } + + $headers = [ + 'Accept' => 'application/json', + 'Authorization' => 'Bearer ' . $this->apiKey, + 'User-Agent' => 'fleetbase-php/1.1.0 PHP/' . PHP_VERSION, + ]; + if (is_array($options['headers'] ?? null)) { + foreach ($options['headers'] as $name => $value) { + if (is_string($name) && is_string($value)) { + $headers[$name] = $value; + } elseif (is_string($name) && is_array($value)) { + $headerValues = array_values(array_filter($value, 'is_string')); + $headers[$name] = $headerValues; + } + } + } + if (isset($options['idempotency_key']) && is_string($options['idempotency_key'])) { + $headers['Idempotency-Key'] = $options['idempotency_key']; + } + + $request = $this->requestFactory->createRequest($method, $url); + foreach ($headers as $name => $value) { + $request = $request->withHeader($name, $value); + } + + if (isset($options['multipart']) && is_array($options['multipart'])) { + $stream = new MultipartStream($options['multipart']); + return $request + ->withHeader('Content-Type', 'multipart/form-data; boundary=' . $stream->getBoundary()) + ->withBody($stream); + } + + if (isset($options['body'])) { + if (!is_string($options['body']) + && !(is_object($options['body']) && method_exists($options['body'], '__toString'))) { + throw new \InvalidArgumentException('Raw request bodies must be strings or stringable objects.'); + } + $body = (string) $options['body']; + return $request->withBody($this->streamFactory->createStream($body)); + } + + if (isset($options['form_params']) && is_array($options['form_params'])) { + $body = http_build_query($options['form_params'], '', '&', PHP_QUERY_RFC3986); + return $request + ->withHeader('Content-Type', 'application/x-www-form-urlencoded') + ->withBody($this->streamFactory->createStream($body)); + } + + if (!in_array($method, ['GET', 'HEAD'], true) && $data !== []) { + $json = json_encode($data, JSON_THROW_ON_ERROR); + return $request + ->withHeader('Content-Type', 'application/json') + ->withBody($this->streamFactory->createStream($json)); + } + + return $request; } - private function buildRequestUrl(string $path = '') : string + /** @param array $options */ + private function send(RequestInterface $request, array $options): ResponseInterface { - $url = trim($this->host . '/' . $this->namespace . '/' . $path); - return $url; + if ($this->client instanceof GuzzleClientInterface) { + $transportOptions = []; + foreach (['timeout', 'connect_timeout', 'allow_redirects', 'verify', 'proxy'] as $key) { + if (array_key_exists($key, $options)) { + $transportOptions[$key] = $options[$key]; + } + } + $transportOptions['http_errors'] = false; + return $this->client->send($request, $transportOptions); + } + + return $this->client->sendRequest($request); + } + + /** @param array $options */ + private function sendWithRetries(RequestInterface $request, array $options): ResponseInterface + { + $configuredRetries = $options['max_retries'] ?? $this->options['max_retries'] ?? 0; + if (!is_int($configuredRetries) || $configuredRetries < 0) { + throw new \InvalidArgumentException('The Fleetbase retry count must be a non-negative integer.'); + } + + return $this->sendAttempt($request, $options, $configuredRetries, 0); } - private function makeRequest(string $path, string $method = 'GET', array $data = [], array $options = []) + /** @param array $options */ + private function sendAttempt(RequestInterface $request, array $options, int $configuredRetries, int $attempt): ResponseInterface { - if ($method === 'GET') { - $options['query'] = $data; + try { + $response = $this->send($request, $options); + } catch (ClientExceptionInterface $exception) { + if ($attempt >= $configuredRetries || !$this->isRetryableRequest($request)) { + throw $exception; + } + + ++$attempt; + $this->waitBeforeRetry($attempt, null, $options); + + return $this->sendAttempt($request, $options, $configuredRetries, $attempt); + } + + if ($attempt >= $configuredRetries + || !$this->isRetryableRequest($request) + || !$this->isRetryableStatus($response->getStatusCode())) { + return $response; + } + + ++$attempt; + $this->waitBeforeRetry($attempt, $response, $options); + + return $this->sendAttempt($request, $options, $configuredRetries, $attempt); + } + + private function isRetryableRequest(RequestInterface $request): bool + { + if ($request->hasHeader('Idempotency-Key')) { + return true; + } + + return in_array($request->getMethod(), ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE'], true); + } + + private function isRetryableStatus(int $status): bool + { + return $status === 429 || $status >= 500; + } + + /** @param array $options */ + private function waitBeforeRetry(int $attempt, ?ResponseInterface $response, array $options): void + { + $milliseconds = $this->retryAfterMilliseconds($response); + if ($milliseconds === null) { + $configuredDelay = $options['retry_delay_ms'] ?? $this->options['retry_delay_ms'] ?? 100; + if (!is_int($configuredDelay) || $configuredDelay < 0) { + throw new \InvalidArgumentException('The Fleetbase retry delay must be a non-negative integer.'); + } + $milliseconds = min(30000, $configuredDelay * (1 << min(8, $attempt - 1))); + } + + $sleeper = $options['retry_sleep'] ?? $this->options['retry_sleep'] ?? null; + if (is_callable($sleeper)) { + call_user_func($sleeper, $milliseconds, $attempt); + return; + } + + if ($milliseconds > 0) { + usleep($milliseconds * 1000); + } + } + + private function retryAfterMilliseconds(?ResponseInterface $response): ?int + { + if (!$response instanceof ResponseInterface) { + return null; + } + $retryAfter = trim($response->getHeaderLine('Retry-After')); + if ($retryAfter === '') { + return null; + } + if (ctype_digit($retryAfter)) { + return min(30000, ((int) $retryAfter) * 1000); + } + + $timestamp = strtotime($retryAfter); + if ($timestamp === false) { + return null; + } + + return min(30000, max(0, ($timestamp - time()) * 1000)); + } + + /** @return mixed */ + private function decodeResponse(ResponseInterface $response, string $method, string $url) + { + $status = $response->getStatusCode(); + $contents = (string) $response->getBody(); + $decoded = null; + + if ($contents !== '') { + try { + $decoded = json_decode($contents, false, 512, JSON_THROW_ON_ERROR); + } catch (Throwable $exception) { + if ($status >= 400 || stripos($response->getHeaderLine('Content-Type'), 'json') !== false) { + throw new DecodingException( + 'Fleetbase returned malformed JSON.', + $status, + null, + [], + $this->requestId($response), + $method, + $this->sanitizeUrl($url), + $exception + ); + } + + return $contents; + } + } + + if ($status >= 400) { + $this->throwForError($response, $decoded, $method, $url); + } + + return $decoded; + } + + /** @param mixed $decoded */ + private function throwForError(ResponseInterface $response, $decoded, string $method, string $url): void + { + $status = $response->getStatusCode(); + $payload = is_object($decoded) ? $this->objectToArray($decoded) : []; + $message = $this->extractString($payload, ['message', 'error', 'detail']) + ?? sprintf('Fleetbase API request failed with HTTP %d.', $status); + $code = $this->extractString($payload, ['code', 'error_code']); + $errorDetails = $payload['errors'] ?? null; + if (is_object($errorDetails)) { + $details = $this->objectToArray($errorDetails); + } elseif (is_array($errorDetails)) { + $details = $this->stringKeyedArray($errorDetails); } else { - $options['json'] = $data; + $details = []; } + $class = $this->exceptionClassForStatus($status); - $options['http_errors'] = false; + throw new $class( + $message, + $status, + $code, + $details, + $this->requestId($response), + $method, + $this->sanitizeUrl($url) + ); + } - // make request via client - $this->lastResponse = $response = $this->client->request($method, $path, $options); + /** + * @param array $payload + * @param array $keys + */ + private function extractString(array $payload, array $keys): ?string + { + foreach ($keys as $key) { + if (isset($payload[$key]) && is_string($payload[$key])) { + return $payload[$key]; + } + } - // run before hook - if (isset($options['onBefore']) && is_callable($options['onBefore'])) { - call_user_func($options['onBefore']); + return null; + } + + /** @return class-string */ + private function exceptionClassForStatus(int $status): string + { + if ($status === 401) { + return AuthenticationException::class; + } + if ($status === 403) { + return AuthorizationException::class; + } + if ($status === 404) { + return NotFoundException::class; + } + if ($status === 409) { + return ConflictException::class; + } + if ($status === 422) { + return ValidationException::class; + } + if ($status === 429) { + return RateLimitException::class; + } + if ($status >= 500) { + return ServerException::class; } - // get response body and contents - $body = $response->getBody(); - $contents = $body->getContents(); - $json = json_decode($contents); + return UnexpectedResponseException::class; + } - // if error response throw exception - if (is_object($json) && isset($json->error)) { - throw new Exception($json->error); + private function requestId(ResponseInterface $response): ?string + { + foreach (['X-Request-Id', 'X-Fleetbase-Request-Id', 'Request-Id'] as $header) { + $value = $response->getHeaderLine($header); + if ($value !== '') { + return $value; + } } - // run after hook - if (isset($options['onAfter']) && is_callable($options['onAfter'])) { - call_user_func($options['onAfter'], $json); + return null; + } + + private function normalizeResponse(ResponseInterface $response): Response + { + if ($response instanceof Response) { + return $response; } - return $json; + return new Response( + $response->getStatusCode(), + $response->getHeaders(), + (string) $response->getBody(), + $response->getProtocolVersion(), + $response->getReasonPhrase() + ); } - public function post(string $path, array $data = [], $options = []) + private function buildRequestUrl(string $path = ''): string { - return $this->makeRequest($path, 'POST', $data, $options); + if (preg_match('#^https?://#i', $path) === 1) { + return $path; + } + + $base = rtrim($this->host, '/'); + if ($this->namespace !== '') { + $base .= '/' . trim($this->namespace, '/'); + } + + return $base . '/' . ltrim($path, '/'); } - public function get(string $path, array $data = [], $options = []) + private function sanitizeUrl(string $url): string { - return $this->makeRequest($path, 'GET', $data, $options); + $parts = parse_url($url); + if ($parts === false) { + return '[invalid-url]'; + } + + $scheme = isset($parts['scheme']) ? $parts['scheme'] . '://' : ''; + $host = $parts['host'] ?? ''; + $port = isset($parts['port']) ? ':' . $parts['port'] : ''; + $path = $parts['path'] ?? ''; + + return $scheme . $host . $port . $path; } - public function delete(string $path, array $data = [], $options = []) + /** + * @param mixed $options + * @return array + */ + private function normalizeOptions($options): array { - return $this->makeRequest($path, 'DELETE', $data, $options); + if ($options === null) { + return []; + } + if (!is_array($options)) { + throw new \InvalidArgumentException('HTTP request options must be an array.'); + } + + $normalized = []; + foreach ($options as $key => $value) { + if (is_string($key)) { + $normalized[$key] = $value; + } + } + + return $normalized; } - public function put(string $path, array $data = [], $options = []) + /** @return array */ + private function objectToArray(object $value): array { - return $this->makeRequest($path, 'PUT', $data, $options); + $result = []; + foreach (get_object_vars($value) as $key => $item) { + if (is_string($key)) { + $result[$key] = $item; + } + } + + return $result; } - public function patch(string $path, array $data = [], $options = []) + /** + * @param array $value + * @return array + */ + private function stringKeyedArray(array $value): array { - return $this->makeRequest($path, 'PATCH', $data, $options); + $result = []; + foreach ($value as $key => $item) { + if (is_string($key)) { + $result[$key] = $item; + } + } + + return $result; } } diff --git a/src/Resource.php b/src/Resource.php index b480e90..fbd2c1a 100644 --- a/src/Resource.php +++ b/src/Resource.php @@ -1,193 +1,445 @@ - * @license http://opensource.org/licenses/MIT MIT + * @license https://www.gnu.org/licenses/agpl-3.0.html AGPL-3.0-or-later */ declare(strict_types=1); namespace Fleetbase\Sdk; -use Exception; +use JsonSerializable; -/** - * Fleetbase PHP SDK Base Resource - */ -class Resource +class Resource implements JsonSerializable { - private array $attributes = []; - private string $version = 'v1'; - private array $options = []; + /** @var array */ + protected array $attributes = []; + + /** @var array */ + protected array $originalAttributes = []; + + /** @var array */ + protected array $options = []; + + /** @var array */ private array $dirtyAttributes = []; + + /** @var array */ private array $changes = []; + private bool $isSaving = false; private bool $isLoading = false; private bool $isDestroying = false; private bool $isReloading = false; - private ?Service $service; + protected ?Service $service; + /** + * @param array $attributes + * @param array|null $options + */ public function __construct(array $attributes = [], ?Service $service = null, ?array $options = []) { $this->attributes = $attributes; + $this->originalAttributes = $attributes; $this->service = $service; - $this->options = $options; - $this->version = $options['version'] ?? 'v1'; + $this->options = $options ?? []; } + /** @return mixed */ public function __get(string $name) { - if ($name === 'id') { - return $this->getAttribute('id'); - } - if ($name === 'isDestroyed') { - return isset($this->attributes['deleted']) && $this->attributes['deleted'] === true; + return ($this->attributes['deleted'] ?? false) === true; } + if (in_array($name, ['isSaving', 'isLoading', 'isDestroying', 'isReloading'], true)) { + return $this->{$name}; + } + + return $this->getAttribute($name); + } + + /** @param mixed $value */ + public function __set(string $name, $value): void + { + $this->setAttribute($name, $value); } + public function __isset(string $name): bool + { + return $this->hasAttribute($name); + } + + /** + * @param array $attributes + * @param array $options + * @return Resource + */ public function create($attributes = [], $options = []) { - $options = array_merge($options, [ - 'onAfter' => function ($response) { - $this->mergeAttributes((array) $response); - } - ]); - - return $this->service->create($attributes, $options = []); + $service = $this->requireService(); + $this->isSaving = true; + $options = $this->withAfterHook($options, function ($response): void { + $this->resetAttributes($this->stringKeyedArray((array) $response)); + }); + + try { + return $service->create(is_array($attributes) ? $attributes : [], $options); + } finally { + $this->isSaving = false; + } } + /** + * @param array $attributes + * @param array $options + * @return Resource + */ public function update($attributes = [], $options = []) { - $options = array_merge($options, [ - 'onAfter' => function ($response) { - $this->mergeAttributes((array) $response); - } - ]); - - return $this->service->update($this->id, $attributes, $options); + $service = $this->requireService(); + $id = $this->requireId(); + $this->isSaving = true; + $options = $this->withAfterHook($options, function ($response): void { + $this->resetAttributes($this->stringKeyedArray((array) $response)); + }); + + try { + return $service->update($id, is_array($attributes) ? $attributes : [], $options); + } finally { + $this->isSaving = false; + } } + /** + * @param array $options + * @return Resource + */ public function destroy($options = []) { - $options = array_merge($options, [ - 'onAfter' => function ($response) { - $this->resetAttributes((array) $response); + $service = $this->requireService(); + $id = $this->requireId(); + $this->isDestroying = true; + $options = $this->withAfterHook($options, function ($response): void { + $attributes = $this->stringKeyedArray((array) $response); + if (!array_key_exists('deleted', $attributes)) { + $attributes['deleted'] = true; } - ]); + if (!array_key_exists('id', $attributes)) { + $attributes['id'] = $this->getAttribute('id'); + } + $this->resetAttributes($attributes); + }); - return $this->service->destroy($this->id, $options); + try { + return $service->destroy($id, $options); + } finally { + $this->isDestroying = false; + } } + /** + * @param array|null $options + * @return Resource + */ public function save(?array $options = []) { - $attributes = $this->getAttributes(); - - if (!$this->id) { - return $this->create($attributes); + $options ??= []; + if ($this->getAttribute('id') === null) { + return $this->create($this->getAttributes(), $options); } - return $this->update($attributes); + $attributes = $this->dirtyAttributes !== [] ? $this->dirtyAttributes : $this->getAttributes(); + return $this->update($attributes, $options); } + /** @param array $options */ + public function reload(array $options = []): Resource + { + $this->isReloading = true; + try { + $resource = $this->requireService()->findRecord($this->requireId(), $options); + if (!$resource instanceof Resource) { + throw new \UnexpectedValueException('Fleetbase reload did not return a resource.'); + } + $this->resetAttributes($resource->toArray()); + return $this; + } finally { + $this->isReloading = false; + } + } + + /** + * @param string|array $attribute + * @param mixed $defaultValue + * @return mixed + */ public function getAttribute($attribute, $defaultValue = null) { if (is_array($attribute)) { return $this->getAttributes($attribute); } + if (!is_string($attribute)) { + return $defaultValue; + } return Utils::get($this->attributes, $attribute, $defaultValue); } + /** @param mixed $value */ + public function setAttribute(string $attribute, $value): Resource + { + $old = $this->attributes[$attribute] ?? null; + $this->attributes[$attribute] = $value; + + if (!array_key_exists($attribute, $this->originalAttributes) || $this->originalAttributes[$attribute] !== $value) { + $this->dirtyAttributes[$attribute] = $value; + $this->changes[$attribute] = ['old' => $old, 'new' => $value]; + } else { + unset($this->dirtyAttributes[$attribute], $this->changes[$attribute]); + } + + return $this; + } + + /** + * @param string|array $property + * @return bool + */ public function hasAttribute($property) { if (is_array($property)) { - return Arr::every( - $property, - function ($prop) { - return $this->hasAttribute($prop); - } - ); + return Arr::every($property, function ($item): bool { + return is_string($item) && $this->hasAttribute($item); + }); } - return in_array($property, array_keys($this->attributes ?? [])); + return is_string($property) && array_key_exists($property, $this->attributes); } + /** + * @param string|array $property + * @return bool + */ public function isAttributeFilled($property) { if (is_array($property)) { - return $this->hasAttribute($property) && Arr::every( - $property, - function ($prop) { - return !empty($this->getAttribute($prop)); - } - ); + return $this->hasAttribute($property) && Arr::every($property, function ($item): bool { + return is_string($item) && $this->getAttribute($item) !== null && $this->getAttribute($item) !== ''; + }); } - return $this->hasAttribute($property) && !empty($this->getAttribute($property)); + return $this->hasAttribute($property) + && $this->getAttribute($property) !== null + && $this->getAttribute($property) !== ''; } + /** + * @param array|null $properties + * @return array + */ public function getAttributes(?array $properties = []) { - $attributes = []; - - if (empty($properties)) { + if ($properties === null || $properties === []) { return $this->attributes; } - if (is_string($properties)) { - return $this->getAttributes([$properties]); + $attributes = []; + foreach ($properties as $property) { + $value = $this->getAttribute($property); + if ($value instanceof self) { + $value = $value->toArray(); + } + $attributes[$property] = $value; } - if (!is_array($properties)) { - throw new Exception('No attribute properties provided!'); + return $attributes; + } + + /** @return array */ + public function toArray(): array + { + $values = []; + foreach ($this->attributes as $key => $value) { + $values[$key] = $this->normalizeValue($value); } - for ($i = 0; $i < count($properties); $i++) { - $property = $properties[$i]; + return $values; + } - if (!is_string($property)) { - continue; - } + /** @return array */ + public function getChanges(): array + { + return $this->changes; + } - $value = $this->getAttribute($property); + /** @return array */ + public function getDirtyAttributes(): array + { + return $this->dirtyAttributes; + } - if (is_object($value) && isset($value->attributes)) { - $value = $value->attributes; - } + /** + * @param string|array|null $attribute + * @return bool + */ + public function isDirty($attribute) + { + if ($attribute === null) { + return $this->dirtyAttributes !== []; + } + if (is_array($attribute)) { + return Arr::any($attribute, function ($item): bool { + return is_string($item) && array_key_exists($item, $this->dirtyAttributes); + }); + } - $attributes[$property] = $value; + return is_string($attribute) && array_key_exists($attribute, $this->dirtyAttributes); + } + + public function getService(): ?Service + { + return $this->service; + } + + /** @param mixed $offset */ + public function offsetExists($offset): bool + { + return is_string($offset) && $this->hasAttribute($offset); + } + + /** + * @param mixed $offset + * @return mixed + */ + public function offsetGet($offset) + { + return is_string($offset) ? $this->getAttribute($offset) : null; + } + + /** + * @param mixed $offset + * @param mixed $value + */ + public function offsetSet($offset, $value): void + { + if (!is_string($offset) || $offset === '') { + throw new \InvalidArgumentException('Resource attribute names must be non-empty strings.'); } + $this->setAttribute($offset, $value); + } - return $attributes; + /** @param mixed $offset */ + public function offsetUnset($offset): void + { + if (!is_string($offset) || !array_key_exists($offset, $this->attributes)) { + return; + } + $old = $this->attributes[$offset]; + unset($this->attributes[$offset]); + $this->dirtyAttributes[$offset] = null; + $this->changes[$offset] = ['old' => $old, 'new' => null]; } - private function mergeAttributes(array $attributes = []) + /** @return array */ + public function jsonSerialize(): array { - $this->attributes = array_merge($this->attributes, $attributes); + return $this->toArray(); } - private function resetAttributes(array $attributes) + protected function requireService(): Service + { + if (!$this->service instanceof Service) { + throw new \LogicException('This resource is not attached to a Fleetbase service.'); + } + + return $this->service; + } + + private function requireId(): string + { + $id = $this->getAttribute('id'); + if (!is_string($id) || $id === '') { + throw new \LogicException('This Fleetbase resource does not have an ID.'); + } + + return $id; + } + + /** @param array $attributes */ + private function resetAttributes(array $attributes): void { $this->attributes = $attributes; + $this->originalAttributes = $attributes; + $this->dirtyAttributes = []; + $this->changes = []; } - private function getDirtyAttributes(): array + /** + * @param mixed $options + * @return array + */ + private function withAfterHook($options, callable $resourceHook): array { - return $this->dirtyAttributes; + if (!is_array($options)) { + throw new \InvalidArgumentException('Resource options must be an array.'); + } + $consumerHook = $options['onAfter'] ?? null; + $options['onAfter'] = static function ($response) use ($resourceHook, $consumerHook): void { + $resourceHook($response); + if (is_callable($consumerHook)) { + call_user_func($consumerHook, $response); + } + }; + + $normalized = []; + foreach ($options as $key => $value) { + if (is_string($key)) { + $normalized[$key] = $value; + } + } + + return $normalized; } - public function isDirty($attribute) + /** + * @param mixed $value + * @return mixed + */ + private function normalizeValue($value) { - return in_array($attribute, array_keys($this->dirtyAttributes)); + if ($value instanceof self) { + return $value->toArray(); + } + if (is_array($value)) { + $values = []; + foreach ($value as $key => $item) { + $values[$key] = $this->normalizeValue($item); + } + return $values; + } + if ($value instanceof JsonSerializable) { + return $value->jsonSerialize(); + } + + return $value; } - private function setFlags(array $flags = []) + /** + * @param array $value + * @return array + */ + private function stringKeyedArray(array $value): array { + $result = []; + foreach ($value as $key => $item) { + if (is_string($key)) { + $result[$key] = $item; + } + } + + return $result; } } diff --git a/src/Resources/ChatChannel.php b/src/Resources/ChatChannel.php new file mode 100644 index 0000000..cf6b70d --- /dev/null +++ b/src/Resources/ChatChannel.php @@ -0,0 +1,18 @@ + - * @license http://opensource.org/licenses/MIT MIT + * @license https://www.gnu.org/licenses/agpl-3.0.html AGPL-3.0-or-later */ declare(strict_types=1); @@ -22,6 +22,11 @@ */ class Contact extends Resource { + /** + * @param array $attributes + * @param array $options + * @return void + */ public function __constructor(array $attributes = [], ?Service $service = null, array $options = []) { parent::__construct($attributes, $service, $options); diff --git a/src/Resources/Customer.php b/src/Resources/Customer.php new file mode 100644 index 0000000..dc05dc6 --- /dev/null +++ b/src/Resources/Customer.php @@ -0,0 +1,18 @@ + - * @license http://opensource.org/licenses/MIT MIT + * @license https://www.gnu.org/licenses/agpl-3.0.html AGPL-3.0-or-later */ declare(strict_types=1); @@ -22,6 +22,11 @@ */ class Driver extends Resource { + /** + * @param array $attributes + * @param array $options + * @return void + */ public function __constructor(array $attributes = [], ?Service $service = null, array $options = []) { parent::__construct($attributes, $service, $options); diff --git a/src/Resources/Entity.php b/src/Resources/Entity.php index c6a0ca4..9487122 100644 --- a/src/Resources/Entity.php +++ b/src/Resources/Entity.php @@ -7,7 +7,7 @@ * file that was distributed with this source code. * * @copyright Copyright (c) Fleetbase Pte Ltd. - * @license http://opensource.org/licenses/MIT MIT + * @license https://www.gnu.org/licenses/agpl-3.0.html AGPL-3.0-or-later */ declare(strict_types=1); @@ -22,6 +22,11 @@ */ class Entity extends Resource { + /** + * @param array $attributes + * @param array $options + * @return void + */ public function __constructor(array $attributes = [], ?Service $service = null, array $options = []) { parent::__construct($attributes, $service, $options); diff --git a/src/Resources/Equipment.php b/src/Resources/Equipment.php new file mode 100644 index 0000000..6696065 --- /dev/null +++ b/src/Resources/Equipment.php @@ -0,0 +1,18 @@ + - * @license http://opensource.org/licenses/MIT MIT + * @license https://www.gnu.org/licenses/agpl-3.0.html AGPL-3.0-or-later */ declare(strict_types=1); @@ -22,58 +22,135 @@ */ class Order extends Resource { + /** + * @param array $attributes + * @param array $options + * @return void + */ public function __constructor(array $attributes = [], ?OrderService $service = null, array $options = []) { parent::__construct($attributes, $service, $options); } + /** + * @param array $params + * @param array $options + * @return mixed + */ public function getDistanceAndTime($params = [], $options = []) { - return $this->service->getDistanceAndTime($this->id, $params, $options); + return $this->orderService()->getDistanceAndTime($this->resourceId(), $params, $options); } + /** + * @param array $params + * @param array $options + * @return mixed + */ public function getNextActivity($params = [], $options = []) { - return $this->service->getNextActivity($this->id, $params, $options); + return $this->orderService()->getNextActivity($this->resourceId(), $params, $options); } + /** + * @param array $params + * @param array $options + * @return mixed + */ public function dispatch($params = [], $options = []) { - return $this->service->dispatch($this->id, $params, $options); + return $this->orderService()->dispatch($this->resourceId(), $params, $options); } + /** + * @param array $params + * @param array $options + * @return mixed + */ public function start($params = [], $options = []) { - return $this->service->start($this->id, $params, $options); + return $this->orderService()->start($this->resourceId(), $params, $options); } + /** + * @param array $params + * @param array $options + * @return mixed + */ public function updateActivity($params = [], $options = []) { - return $this->service->updateActivity($this->id, $params, $options); + return $this->orderService()->updateActivity($this->resourceId(), $params, $options); } + /** + * @param string $destinationId + * @param array $params + * @param array $options + * @return mixed + */ public function setDestination($destinationId, $params = [], $options = []) { - return $this->service->setDestination($this->id, $destinationId, $params, $options); + return $this->orderService()->setDestination($this->resourceId(), $destinationId, $params, $options); } + /** + * @param string|null $subjectId + * @param array $params + * @param array $options + * @return mixed + */ public function captureQrCode($subjectId = null, $params = [], $options = []) { - return $this->service->captureQrCode($this->id, $subjectId, $params, $options); + return $this->orderService()->captureQrCode($this->resourceId(), $subjectId, $params, $options); } + /** + * @param string|null $subjectId + * @param array $params + * @param array $options + * @return mixed + */ public function captureSignature($subjectId = null, $params = [], $options = []) { - return $this->service->captureSignature($this->id, $subjectId, $params, $options); + return $this->orderService()->captureSignature($this->resourceId(), $subjectId, $params, $options); } + /** + * @param array $params + * @param array $options + * @return mixed + */ public function complete($params = [], $options = []) { - return $this->service->complete($this->id, $params, $options); + return $this->orderService()->complete($this->resourceId(), $params, $options); } + /** + * @param array $params + * @param array $options + * @return mixed + */ public function cancel($params = [], $options = []) { - return $this->service->cancel($this->id, $params, $options); + return $this->orderService()->cancel($this->resourceId(), $params, $options); + } + + private function orderService(): OrderService + { + if (!$this->service instanceof OrderService) { + throw new \LogicException('This order is not attached to an OrderService.'); + } + + return $this->service; + } + + private function resourceId(): string + { + $id = $this->getAttribute('id'); + if (!is_string($id) || $id === '') { + throw new \LogicException('This order does not have an ID.'); + } + + return $id; } } diff --git a/src/Resources/OrderConfig.php b/src/Resources/OrderConfig.php new file mode 100644 index 0000000..b903fd6 --- /dev/null +++ b/src/Resources/OrderConfig.php @@ -0,0 +1,18 @@ + - * @license http://opensource.org/licenses/MIT MIT + * @license https://www.gnu.org/licenses/agpl-3.0.html AGPL-3.0-or-later */ declare(strict_types=1); @@ -22,6 +22,11 @@ */ class Payload extends Resource { + /** + * @param array $attributes + * @param array $options + * @return void + */ public function __constructor(array $attributes = [], ?Service $service = null, array $options = []) { parent::__construct($attributes, $service, $options); diff --git a/src/Resources/Place.php b/src/Resources/Place.php index 3ed850e..35079f8 100644 --- a/src/Resources/Place.php +++ b/src/Resources/Place.php @@ -7,7 +7,7 @@ * file that was distributed with this source code. * * @copyright Copyright (c) Fleetbase Pte Ltd. - * @license http://opensource.org/licenses/MIT MIT + * @license https://www.gnu.org/licenses/agpl-3.0.html AGPL-3.0-or-later */ declare(strict_types=1); @@ -22,6 +22,11 @@ */ class Place extends Resource { + /** + * @param array $attributes + * @param array $options + * @return void + */ public function __constructor(array $attributes = [], ?Service $service = null, array $options = []) { parent::__construct($attributes, $service, $options); diff --git a/src/Resources/PurchaseRate.php b/src/Resources/PurchaseRate.php new file mode 100644 index 0000000..99aed24 --- /dev/null +++ b/src/Resources/PurchaseRate.php @@ -0,0 +1,18 @@ + - * @license http://opensource.org/licenses/MIT MIT + * @license https://www.gnu.org/licenses/agpl-3.0.html AGPL-3.0-or-later */ declare(strict_types=1); @@ -22,6 +22,11 @@ */ class ServiceArea extends Resource { + /** + * @param array $attributes + * @param array $options + * @return void + */ public function __constructor(array $attributes = [], ?Service $service = null, array $options = []) { parent::__construct($attributes, $service, $options); diff --git a/src/Resources/ServiceQuote.php b/src/Resources/ServiceQuote.php index a122c54..219911e 100644 --- a/src/Resources/ServiceQuote.php +++ b/src/Resources/ServiceQuote.php @@ -7,7 +7,7 @@ * file that was distributed with this source code. * * @copyright Copyright (c) Fleetbase Pte Ltd. - * @license http://opensource.org/licenses/MIT MIT + * @license https://www.gnu.org/licenses/agpl-3.0.html AGPL-3.0-or-later */ declare(strict_types=1); @@ -22,6 +22,11 @@ */ class ServiceQuote extends Resource { + /** + * @param array $attributes + * @param array $options + * @return void + */ public function __constructor(array $attributes = [], ?Service $service = null, array $options = []) { parent::__construct($attributes, $service, $options); diff --git a/src/Resources/ServiceRate.php b/src/Resources/ServiceRate.php index 4665a39..75ea590 100644 --- a/src/Resources/ServiceRate.php +++ b/src/Resources/ServiceRate.php @@ -7,7 +7,7 @@ * file that was distributed with this source code. * * @copyright Copyright (c) Fleetbase Pte Ltd. - * @license http://opensource.org/licenses/MIT MIT + * @license https://www.gnu.org/licenses/agpl-3.0.html AGPL-3.0-or-later */ declare(strict_types=1); @@ -22,6 +22,11 @@ */ class ServiceRate extends Resource { + /** + * @param array $attributes + * @param array $options + * @return void + */ public function __constructor(array $attributes = [], ?Service $service = null, array $options = []) { parent::__construct($attributes, $service, $options); diff --git a/src/Resources/TrackingNumber.php b/src/Resources/TrackingNumber.php new file mode 100644 index 0000000..1f2b824 --- /dev/null +++ b/src/Resources/TrackingNumber.php @@ -0,0 +1,18 @@ + - * @license http://opensource.org/licenses/MIT MIT + * @license https://www.gnu.org/licenses/agpl-3.0.html AGPL-3.0-or-later */ declare(strict_types=1); @@ -22,6 +22,11 @@ */ class TrackingStatus extends Resource { + /** + * @param array $attributes + * @param array $options + * @return void + */ public function __constructor(array $attributes = [], ?Service $service = null, array $options = []) { parent::__construct($attributes, $service, $options); diff --git a/src/Resources/Vehicle.php b/src/Resources/Vehicle.php index 0edec53..56138ae 100644 --- a/src/Resources/Vehicle.php +++ b/src/Resources/Vehicle.php @@ -7,7 +7,7 @@ * file that was distributed with this source code. * * @copyright Copyright (c) Fleetbase Pte Ltd. - * @license http://opensource.org/licenses/MIT MIT + * @license https://www.gnu.org/licenses/agpl-3.0.html AGPL-3.0-or-later */ declare(strict_types=1); @@ -22,6 +22,11 @@ */ class Vehicle extends Resource { + /** + * @param array $attributes + * @param array $options + * @return void + */ public function __constructor(array $attributes = [], ?Service $service = null, array $options = []) { parent::__construct($attributes, $service, $options); diff --git a/src/Resources/Vendor.php b/src/Resources/Vendor.php index 57662bf..4d9c007 100644 --- a/src/Resources/Vendor.php +++ b/src/Resources/Vendor.php @@ -7,7 +7,7 @@ * file that was distributed with this source code. * * @copyright Copyright (c) Fleetbase Pte Ltd. - * @license http://opensource.org/licenses/MIT MIT + * @license https://www.gnu.org/licenses/agpl-3.0.html AGPL-3.0-or-later */ declare(strict_types=1); @@ -22,6 +22,11 @@ */ class Vendor extends Resource { + /** + * @param array $attributes + * @param array $options + * @return void + */ public function __constructor(array $attributes = [], ?Service $service = null, array $options = []) { parent::__construct($attributes, $service, $options); diff --git a/src/Resources/Waypoint.php b/src/Resources/Waypoint.php index 986102c..3e31606 100644 --- a/src/Resources/Waypoint.php +++ b/src/Resources/Waypoint.php @@ -7,7 +7,7 @@ * file that was distributed with this source code. * * @copyright Copyright (c) Fleetbase Pte Ltd. - * @license http://opensource.org/licenses/MIT MIT + * @license https://www.gnu.org/licenses/agpl-3.0.html AGPL-3.0-or-later */ declare(strict_types=1); @@ -22,6 +22,11 @@ */ class Waypoint extends Resource { + /** + * @param array $attributes + * @param array $options + * @return void + */ public function __constructor(array $attributes = [], ?Service $service = null, array $options = []) { parent::__construct($attributes, $service, $options); diff --git a/src/Resources/WorkOrder.php b/src/Resources/WorkOrder.php new file mode 100644 index 0000000..11b3701 --- /dev/null +++ b/src/Resources/WorkOrder.php @@ -0,0 +1,18 @@ + - * @license http://opensource.org/licenses/MIT MIT + * @license https://www.gnu.org/licenses/agpl-3.0.html AGPL-3.0-or-later */ declare(strict_types=1); @@ -22,6 +22,11 @@ */ class Zone extends Resource { + /** + * @param array $attributes + * @param array $options + * @return void + */ public function __constructor(array $attributes = [], ?Service $service = null, array $options = []) { parent::__construct($attributes, $service, $options); diff --git a/src/Service.php b/src/Service.php index b31514a..d5d3b9c 100644 --- a/src/Service.php +++ b/src/Service.php @@ -1,133 +1,195 @@ - * @license http://opensource.org/licenses/MIT MIT + * @license https://www.gnu.org/licenses/agpl-3.0.html AGPL-3.0-or-later */ declare(strict_types=1); namespace Fleetbase\Sdk; -/** - * Fleetbase PHP SDK Base Service - */ class Service { - private string $resource; - private string $namespace; - private array $options = []; - private HttpClient $client; + protected string $resource; + protected string $namespace; + + /** @var array */ + protected array $options = []; + protected HttpClient $client; + + /** @param array $options */ public function __construct(string $resource, HttpClient $client, array $options = []) { $this->resource = $resource; - $this->namespace = Utils::createNamespace($resource); + $namespace = $options['namespace'] ?? null; + $this->namespace = is_string($namespace) + ? trim($namespace, '/') + : Utils::createNamespace($resource); $this->client = $client; $this->options = $options; } - private function resolve($data) - { - $class = "Fleetbase\\Sdk\\Resources\\" . Utils::classify($this->resource); - return new $class((array) $data, $this); - } - + /** @return string */ public function uri(?string $path = null) { - return $this->namespace . ($path ? '/' . $path : ''); + return $this->namespace . ($path !== null && $path !== '' ? '/' . ltrim($path, '/') : ''); } + /** @return string */ public function uriForResource(string $id, ?string $path = null) { - return $this->namespace . '/' . $id . ($path ? '/' . $path : ''); + return $this->uri(rawurlencode($id) . ($path !== null && $path !== '' ? '/' . ltrim($path, '/') : '')); } + /** + * @param array $attributes + * @param array $options + * @return Resource + */ public function create(array $attributes = [], array $options = []) { - $uri = $this->uri(); - $data = $this->client->post($uri, $attributes, $options); - - return $this->resolve($data); + return $this->resolve($this->client->post($this->uri(), $attributes, $options)); } + /** + * @param array $attributes + * @param array $options + * @return Resource + */ public function update(string $id, array $attributes = [], array $options = []) { - $uri = $this->uri($id); - $data = $this->client->put($uri, $attributes, $options); - - return $this->resolve($data); + return $this->resolve($this->client->put($this->uriForResource($id), $attributes, $options)); } + /** + * @param array $options + * @return Resource + */ public function findRecord(string $id, array $options = []) { - $uri = $this->uri($id); - $data = $this->client->get($uri, [], $options); - - return $this->resolve($data); + return $this->resolve($this->client->get($this->uriForResource($id), [], $options)); } + /** + * @param array $options + * @return mixed + */ public function findAll(array $options = []) { - $uri = $this->uri(); - $data = $this->client->get($uri, [], $options); + $data = $this->client->get($this->uri(), [], $options); + $collection = $this->resolveCollection($data); - if (is_array($data)) { - return array_map( - function ($item) { - return $this->resolve($item); - }, - $data - ); - } - - return $data; + return is_array($collection) ? $collection : $data; } + /** + * @param array $query + * @param array $options + * @return mixed + */ public function query(array $query = [], array $options = []) { - $uri = $this->uri(); - $data = $this->client->get($uri, $query, $options); + $data = $this->client->get($this->uri(), $query, $options); + $collection = $this->resolveCollection($data); - if (is_array($data)) { - return array_map( - function ($item) { - return $this->resolve($item); - }, - $data - ); - } - - return $data; + return is_array($collection) ? $collection : $data; } + /** + * @param array $query + * @param array $options + * @return Resource + */ public function queryRecord(array $query = [], array $options = []) { $query['single'] = true; - - $uri = $this->uri(); - $data = $this->client->get($uri, $query, $options); - - return $this->resolve($data); + return $this->resolve($this->client->get($this->uri(), $query, $options)); } + /** + * @param Resource|string $id + * @param array $options + * @return Resource + */ public function destroy($id, array $options = []) { if ($id instanceof Resource) { $id = $id->getAttribute('id'); } + if (!is_string($id) || $id === '') { + throw new \InvalidArgumentException('A resource ID is required for deletion.'); + } - $uri = $this->uri($id); - $data = $this->client->delete($uri, [], $options); + return $this->resolve($this->client->delete($this->uriForResource($id), [], $options)); + } - return $this->resolve($data); + /** + * Call an explicit non-CRUD endpoint without bypassing client behavior. + * + * @param array $data + * @param array $options + * @return mixed + */ + public function action(string $method, string $path, array $data = [], array $options = []) + { + return $this->client->request($method, $this->uri($path), $data, $options); } + /** + * Execute an endpoint copied from the locked official API contract. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + protected function endpoint(string $method, string $template, array $parameters = [], array $options = []) + { + $path = $template; + $prefix = '{{base_url}}/{{namespace}}'; + if (strncasecmp($path, $prefix, strlen($prefix)) === 0) { + $path = ltrim(substr($path, strlen($prefix)), '/'); + } + + $used = []; + foreach (['/\{\{([^}]+)\}\}/', '/:([A-Za-z][A-Za-z0-9_-]*)/'] as $pattern) { + while (preg_match($pattern, $path, $matches) === 1) { + $placeholder = $matches[0]; + $name = $matches[1]; + if (!array_key_exists($name, $parameters) || !is_scalar($parameters[$name])) { + throw new \InvalidArgumentException(sprintf('Endpoint parameter "%s" is required.', $name)); + } + $used[$name] = true; + $path = str_replace($placeholder, rawurlencode((string) $parameters[$name]), $path); + } + } + + $data = []; + if (isset($parameters['body']) && is_array($parameters['body'])) { + $data = $this->stringKeyedArray($parameters['body']); + } else { + foreach ($parameters as $name => $value) { + if ($name !== 'body' && !isset($used[$name])) { + $data[$name] = $value; + } + } + } + + if (isset($options['query']) && is_array($options['query'])) { + $query = http_build_query($options['query'], '', '&', PHP_QUERY_RFC3986); + if ($query !== '') { + $path .= (strpos($path, '?') === false ? '?' : '&') . $query; + } + unset($options['query']); + } + + return $this->client->request($method, $path, $data, $options); + } + + /** @return array */ public function getOptions(): array { return $this->options; @@ -137,4 +199,71 @@ public function getClient(): HttpClient { return $this->client; } + + /** @param mixed $data */ + protected function resolve($data): Resource + { + if (is_object($data) && isset($data->data) && is_object($data->data)) { + $data = $data->data; + } + if (!is_object($data) && !is_array($data)) { + throw new \UnexpectedValueException('Fleetbase resource responses must be objects or arrays.'); + } + + $class = 'Fleetbase\\Sdk\\Resources\\' . Utils::classify($this->resource); + if (!class_exists($class) || !is_subclass_of($class, Resource::class)) { + $class = Resource::class; + } + + /** @var Resource $resource */ + $resource = new $class($this->stringKeyedArray((array) $data), $this, $this->options); + return $resource; + } + + /** + * @param mixed $data + * @return array|null + */ + protected function resolveCollection($data): ?array + { + $items = null; + + if (is_array($data)) { + $items = $data; + } elseif (is_object($data)) { + foreach (['data', 'results', 'items'] as $key) { + if (isset($data->{$key}) && is_array($data->{$key})) { + $items = $data->{$key}; + break; + } + } + } + + if ($items === null) { + return null; + } + + $resources = []; + foreach ($items as $item) { + $resources[] = $this->resolve($item); + } + + return $resources; + } + + /** + * @param array $value + * @return array + */ + private function stringKeyedArray(array $value): array + { + $result = []; + foreach ($value as $key => $item) { + if (is_string($key)) { + $result[$key] = $item; + } + } + + return $result; + } } diff --git a/src/Services/ChatChannelService.php b/src/Services/ChatChannelService.php new file mode 100644 index 0000000..3903011 --- /dev/null +++ b/src/Services/ChatChannelService.php @@ -0,0 +1,27 @@ + $options */ + public function __construct(HttpClient $client, array $options = []) + { + parent::__construct('ChatChannel', $client, array_merge(['namespace' => 'chat-channels'], $options)); + } +} diff --git a/src/Services/CommentService.php b/src/Services/CommentService.php new file mode 100644 index 0000000..8485c03 --- /dev/null +++ b/src/Services/CommentService.php @@ -0,0 +1,27 @@ + $options */ + public function __construct(HttpClient $client, array $options = []) + { + parent::__construct('Comment', $client, array_merge(['namespace' => 'comments'], $options)); + } +} diff --git a/src/Services/Concerns/ChatChannelServiceEndpoints.php b/src/Services/Concerns/ChatChannelServiceEndpoints.php new file mode 100644 index 0000000..44ccdea --- /dev/null +++ b/src/Services/Concerns/ChatChannelServiceEndpoints.php @@ -0,0 +1,147 @@ + $parameters + * @param array $options + * @return mixed + */ + public function addParticipant(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/chat-channels/:id/add-participant', $parameters, $options); + } + + /** + * Create Chat Channel. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function createChatChannel(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/chat-channels', $parameters, $options); + } + + /** + * Create Read Receipt. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function createReadReceipt(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/chat-channels/read-message/:chatMessageId', $parameters, $options); + } + + /** + * Delete Chat Channel. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function deleteChatChannel(array $parameters = [], array $options = []) + { + return $this->endpoint('DELETE', '{{base_url}}/{{namespace}}/chat-channels/:id', $parameters, $options); + } + + /** + * Delete Message. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function deleteMessage(array $parameters = [], array $options = []) + { + return $this->endpoint('DELETE', '{{base_url}}/{{namespace}}/chat-channels/delete-message/:chatMessageId', $parameters, $options); + } + + /** + * List Available Participants. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function listAvailableParticipants(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/chat-channels/available-participants', $parameters, $options); + } + + /** + * Query Chat Channels. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function queryChatChannels(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/chat-channels', $parameters, $options); + } + + /** + * Remove Participant. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function removeParticipant(array $parameters = [], array $options = []) + { + return $this->endpoint('DELETE', '{{base_url}}/{{namespace}}/chat-channels/remove-participant/:participantId', $parameters, $options); + } + + /** + * Retrieve Chat Channel. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function retrieveChatChannel(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/chat-channels/:id', $parameters, $options); + } + + /** + * Send Message. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function sendMessage(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/chat-channels/:id/send-message', $parameters, $options); + } + + /** + * Update Chat Channel. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function updateChatChannel(array $parameters = [], array $options = []) + { + return $this->endpoint('PUT', '{{base_url}}/{{namespace}}/chat-channels/:id', $parameters, $options); + } +} diff --git a/src/Services/Concerns/CommentServiceEndpoints.php b/src/Services/Concerns/CommentServiceEndpoints.php new file mode 100644 index 0000000..5d2fc50 --- /dev/null +++ b/src/Services/Concerns/CommentServiceEndpoints.php @@ -0,0 +1,75 @@ + $parameters + * @param array $options + * @return mixed + */ + public function createComment(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/comments', $parameters, $options); + } + + /** + * Delete Comment. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function deleteComment(array $parameters = [], array $options = []) + { + return $this->endpoint('DELETE', '{{base_url}}/{{namespace}}/comments/:id', $parameters, $options); + } + + /** + * Query Comments. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function queryComments(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/comments', $parameters, $options); + } + + /** + * Retrieve Comment. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function retrieveComment(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/comments/:id', $parameters, $options); + } + + /** + * Update Comment. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function updateComment(array $parameters = [], array $options = []) + { + return $this->endpoint('PUT', '{{base_url}}/{{namespace}}/comments/:id', $parameters, $options); + } +} diff --git a/src/Services/Concerns/ContactServiceEndpoints.php b/src/Services/Concerns/ContactServiceEndpoints.php new file mode 100644 index 0000000..eb81f60 --- /dev/null +++ b/src/Services/Concerns/ContactServiceEndpoints.php @@ -0,0 +1,75 @@ + $parameters + * @param array $options + * @return mixed + */ + public function createContact(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/contacts', $parameters, $options); + } + + /** + * Delete a Contact. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function deleteContact(array $parameters = [], array $options = []) + { + return $this->endpoint('DELETE', '{{base_url}}/{{namespace}}/contacts/:id', $parameters, $options); + } + + /** + * Query Contacts. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function queryContacts(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/contacts', $parameters, $options); + } + + /** + * Retrieve a Contact. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function retrieveContact(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/contacts/:id', $parameters, $options); + } + + /** + * Update a Contact. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function updateContact(array $parameters = [], array $options = []) + { + return $this->endpoint('PUT', '{{base_url}}/{{namespace}}/contacts/:id', $parameters, $options); + } +} diff --git a/src/Services/Concerns/CustomerServiceEndpoints.php b/src/Services/Concerns/CustomerServiceEndpoints.php new file mode 100644 index 0000000..88f711c --- /dev/null +++ b/src/Services/Concerns/CustomerServiceEndpoints.php @@ -0,0 +1,207 @@ + $parameters + * @param array $options + * @return mixed + */ + public function createCustomer(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/customers', $parameters, $options); + } + + /** + * Create a Customer Order. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function createCustomerOrder(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/customers/orders', $parameters, $options); + } + + /** + * Forgot Customer Password. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function forgotCustomerPassword(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/customers/forgot-password', $parameters, $options); + } + + /** + * List Customer Orders. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function listCustomerOrders(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/customers/orders', $parameters, $options); + } + + /** + * List Customer Places. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function listCustomerPlaces(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/customers/places', $parameters, $options); + } + + /** + * Login Customer. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function loginCustomer(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/customers/login', $parameters, $options); + } + + /** + * Logout All Customer Sessions. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function logoutAllCustomerSessions(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/customers/logout-all', $parameters, $options); + } + + /** + * Logout Customer. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function logoutCustomer(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/customers/logout', $parameters, $options); + } + + /** + * Register Customer Device. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function registerCustomerDevice(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/customers/register-device', $parameters, $options); + } + + /** + * Request Customer Creation Code. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function requestCustomerCreationCode(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/customers/request-creation-code', $parameters, $options); + } + + /** + * Request Customer Login SMS. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function requestCustomerLoginSms(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/customers/login-with-sms', $parameters, $options); + } + + /** + * Reset Customer Password. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function resetCustomerPassword(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/customers/reset-password', $parameters, $options); + } + + /** + * Retrieve Authenticated Customer. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function retrieveAuthenticatedCustomer(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/customers/me', $parameters, $options); + } + + /** + * Retrieve a Customer Order. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function retrieveCustomerOrder(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/customers/orders/{{customer_order_id}}', $parameters, $options); + } + + /** + * Update Authenticated Customer. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function updateAuthenticatedCustomer(array $parameters = [], array $options = []) + { + return $this->endpoint('PUT', '{{base_url}}/{{namespace}}/customers/me', $parameters, $options); + } + + /** + * Verify Customer Login Code. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function verifyCustomerLoginCode(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/customers/verify-code', $parameters, $options); + } +} diff --git a/src/Services/Concerns/DeviceServiceEndpoints.php b/src/Services/Concerns/DeviceServiceEndpoints.php new file mode 100644 index 0000000..8490195 --- /dev/null +++ b/src/Services/Concerns/DeviceServiceEndpoints.php @@ -0,0 +1,99 @@ + $parameters + * @param array $options + * @return mixed + */ + public function attachDevice(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/devices/{{device_id}}/attach', $parameters, $options); + } + + /** + * Create a Device. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function createDevice(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/devices', $parameters, $options); + } + + /** + * Delete a Device. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function deleteDevice(array $parameters = [], array $options = []) + { + return $this->endpoint('DELETE', '{{base_url}}/{{namespace}}/devices/{{device_id}}', $parameters, $options); + } + + /** + * Detach Device. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function detachDevice(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/devices/{{device_id}}/detach', $parameters, $options); + } + + /** + * Query Devices. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function queryDevices(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/devices', $parameters, $options); + } + + /** + * Retrieve a Device. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function retrieveDevice(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/devices/{{device_id}}', $parameters, $options); + } + + /** + * Update a Device. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function updateDevice(array $parameters = [], array $options = []) + { + return $this->endpoint('PUT', '{{base_url}}/{{namespace}}/devices/{{device_id}}', $parameters, $options); + } +} diff --git a/src/Services/Concerns/DriverServiceEndpoints.php b/src/Services/Concerns/DriverServiceEndpoints.php new file mode 100644 index 0000000..d463363 --- /dev/null +++ b/src/Services/Concerns/DriverServiceEndpoints.php @@ -0,0 +1,255 @@ + $parameters + * @param array $options + * @return mixed + */ + public function changeDriverPassword(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/drivers/:id/change-password', $parameters, $options); + } + + /** + * Create a Driver. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function createDriver(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/drivers', $parameters, $options); + } + + /** + * Delete a Driver. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function deleteDriver(array $parameters = [], array $options = []) + { + return $this->endpoint('DELETE', '{{base_url}}/{{namespace}}/drivers/:id', $parameters, $options); + } + + /** + * Get Driver Current Organization. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function getDriverCurrentOrganization(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/drivers/:id/current-organization', $parameters, $options); + } + + /** + * List Driver Manifests. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function listDriverManifests(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/drivers/:id/manifests', $parameters, $options); + } + + /** + * List Driver Organizations. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function listDriverOrganizations(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/drivers/:id/organizations', $parameters, $options); + } + + /** + * Login Driver. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function loginDriver(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/drivers/login', $parameters, $options); + } + + /** + * Query Drivers. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function queryDrivers(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/drivers', $parameters, $options); + } + + /** + * Register Device. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function registerDevice(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/drivers/register-device', $parameters, $options); + } + + /** + * Register Driver Device. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function registerDriverDevice(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/drivers/:id/register-device', $parameters, $options); + } + + /** + * Request Driver Login SMS. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function requestDriverLoginSms(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/drivers/login-with-sms', $parameters, $options); + } + + /** + * Request Driver Password Reset. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function requestDriverPasswordReset(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/drivers/forgot-password', $parameters, $options); + } + + /** + * Reset Driver Password. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function resetDriverPassword(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/drivers/reset-password', $parameters, $options); + } + + /** + * Retrieve a Driver. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function retrieveDriver(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/drivers/:id', $parameters, $options); + } + + /** + * Simulate Driver Route. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function simulateDriverRoute(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/drivers/:id/simulate', $parameters, $options); + } + + /** + * Switch Driver Organization. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function switchDriverOrganization(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/drivers/:id/switch-organization', $parameters, $options); + } + + /** + * Toggle Driver Online. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function toggleDriverOnline(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/drivers/:id/toggle-online', $parameters, $options); + } + + /** + * Track Driver. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function trackDriver(array $parameters = [], array $options = []) + { + return $this->endpoint('PATCH', '{{base_url}}/{{namespace}}/drivers/:id/track', $parameters, $options); + } + + /** + * Update a Driver. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function updateDriver(array $parameters = [], array $options = []) + { + return $this->endpoint('PUT', '{{base_url}}/{{namespace}}/drivers/:id', $parameters, $options); + } + + /** + * Verify Driver Login Code. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function verifyDriverLoginCode(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/drivers/verify-code', $parameters, $options); + } +} diff --git a/src/Services/Concerns/EntityServiceEndpoints.php b/src/Services/Concerns/EntityServiceEndpoints.php new file mode 100644 index 0000000..5c5e00c --- /dev/null +++ b/src/Services/Concerns/EntityServiceEndpoints.php @@ -0,0 +1,75 @@ + $parameters + * @param array $options + * @return mixed + */ + public function createEntity(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/entities', $parameters, $options); + } + + /** + * Delete a Entity. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function deleteEntity(array $parameters = [], array $options = []) + { + return $this->endpoint('DELETE', '{{base_url}}/{{namespace}}/entities/:id', $parameters, $options); + } + + /** + * Query Entities. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function queryEntities(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/entities', $parameters, $options); + } + + /** + * Retrieve an Entity. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function retrieveEntity(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/entities/:id', $parameters, $options); + } + + /** + * Update a Entity. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function updateEntity(array $parameters = [], array $options = []) + { + return $this->endpoint('PUT', '{{base_url}}/{{namespace}}/entities/:id', $parameters, $options); + } +} diff --git a/src/Services/Concerns/EquipmentServiceEndpoints.php b/src/Services/Concerns/EquipmentServiceEndpoints.php new file mode 100644 index 0000000..da1508f --- /dev/null +++ b/src/Services/Concerns/EquipmentServiceEndpoints.php @@ -0,0 +1,75 @@ + $parameters + * @param array $options + * @return mixed + */ + public function createEquipment(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/equipment', $parameters, $options); + } + + /** + * Delete Equipment. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function deleteEquipment(array $parameters = [], array $options = []) + { + return $this->endpoint('DELETE', '{{base_url}}/{{namespace}}/equipment/{{equipment_id}}', $parameters, $options); + } + + /** + * Query Equipment. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function queryEquipment(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/equipment', $parameters, $options); + } + + /** + * Retrieve Equipment. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function retrieveEquipment(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/equipment/{{equipment_id}}', $parameters, $options); + } + + /** + * Update Equipment. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function updateEquipment(array $parameters = [], array $options = []) + { + return $this->endpoint('PUT', '{{base_url}}/{{namespace}}/equipment/{{equipment_id}}', $parameters, $options); + } +} diff --git a/src/Services/Concerns/FileServiceEndpoints.php b/src/Services/Concerns/FileServiceEndpoints.php new file mode 100644 index 0000000..b893ddb --- /dev/null +++ b/src/Services/Concerns/FileServiceEndpoints.php @@ -0,0 +1,99 @@ + $parameters + * @param array $options + * @return mixed + */ + public function deleteFile(array $parameters = [], array $options = []) + { + return $this->endpoint('DELETE', '{{base_url}}/{{namespace}}/files/:id', $parameters, $options); + } + + /** + * Download File. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function downloadFile(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/files/:id/download', $parameters, $options); + } + + /** + * Query Files. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function queryFiles(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/files', $parameters, $options); + } + + /** + * Retrieve a File. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function retrieveFile(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/files/:id', $parameters, $options); + } + + /** + * Update File. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function updateFile(array $parameters = [], array $options = []) + { + return $this->endpoint('PUT', '{{base_url}}/{{namespace}}/files/:id', $parameters, $options); + } + + /** + * Upload Base64 File. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function uploadBase64File(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/files/base64', $parameters, $options); + } + + /** + * Upload File. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function uploadFile(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/files', $parameters, $options); + } +} diff --git a/src/Services/Concerns/FleetServiceEndpoints.php b/src/Services/Concerns/FleetServiceEndpoints.php new file mode 100644 index 0000000..b745417 --- /dev/null +++ b/src/Services/Concerns/FleetServiceEndpoints.php @@ -0,0 +1,75 @@ + $parameters + * @param array $options + * @return mixed + */ + public function createFleet(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/fleets', $parameters, $options); + } + + /** + * Delete a Fleet. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function deleteFleet(array $parameters = [], array $options = []) + { + return $this->endpoint('DELETE', '{{base_url}}/{{namespace}}/fleets/:id', $parameters, $options); + } + + /** + * Query Fleets. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function queryFleets(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/fleets', $parameters, $options); + } + + /** + * Retrieve a Fleet. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function retrieveFleet(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/fleets/:id', $parameters, $options); + } + + /** + * Update a Fleet. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function updateFleet(array $parameters = [], array $options = []) + { + return $this->endpoint('PUT', '{{base_url}}/{{namespace}}/fleets/:id', $parameters, $options); + } +} diff --git a/src/Services/Concerns/FuelReportServiceEndpoints.php b/src/Services/Concerns/FuelReportServiceEndpoints.php new file mode 100644 index 0000000..1f2f64e --- /dev/null +++ b/src/Services/Concerns/FuelReportServiceEndpoints.php @@ -0,0 +1,75 @@ + $parameters + * @param array $options + * @return mixed + */ + public function createFuelReport(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/fuel-reports', $parameters, $options); + } + + /** + * Delete a Fuel Report. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function deleteFuelReport(array $parameters = [], array $options = []) + { + return $this->endpoint('DELETE', '{{base_url}}/{{namespace}}/fuel-reports/:id', $parameters, $options); + } + + /** + * Query Fuel Reports. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function queryFuelReports(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/fuel-reports', $parameters, $options); + } + + /** + * Retrieve a Fuel Report. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function retrieveFuelReport(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/fuel-reports/:id', $parameters, $options); + } + + /** + * Update a Fuel Report. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function updateFuelReport(array $parameters = [], array $options = []) + { + return $this->endpoint('PUT', '{{base_url}}/{{namespace}}/fuel-reports/:id', $parameters, $options); + } +} diff --git a/src/Services/Concerns/FuelTransactionServiceEndpoints.php b/src/Services/Concerns/FuelTransactionServiceEndpoints.php new file mode 100644 index 0000000..162cedd --- /dev/null +++ b/src/Services/Concerns/FuelTransactionServiceEndpoints.php @@ -0,0 +1,123 @@ + $parameters + * @param array $options + * @return mixed + */ + public function createFuelTransaction(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/fuel-transactions', $parameters, $options); + } + + /** + * Delete a Fuel Transaction. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function deleteFuelTransaction(array $parameters = [], array $options = []) + { + return $this->endpoint('DELETE', '{{base_url}}/{{namespace}}/fuel-transactions/{{fuel_transaction_id}}', $parameters, $options); + } + + /** + * Match Fuel Transaction Order. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function matchFuelTransactionOrder(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/fuel-transactions/{{fuel_transaction_id}}/match-order', $parameters, $options); + } + + /** + * Match Fuel Transaction Vehicle. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function matchFuelTransactionVehicle(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/fuel-transactions/{{fuel_transaction_id}}/match-vehicle', $parameters, $options); + } + + /** + * Query Fuel Transactions. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function queryFuelTransactions(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/fuel-transactions', $parameters, $options); + } + + /** + * Reprocess Fuel Transaction. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function reprocessFuelTransaction(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/fuel-transactions/{{fuel_transaction_id}}/reprocess', $parameters, $options); + } + + /** + * Retrieve a Fuel Transaction. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function retrieveFuelTransaction(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/fuel-transactions/{{fuel_transaction_id}}', $parameters, $options); + } + + /** + * Review Fuel Transaction. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function reviewFuelTransaction(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/fuel-transactions/{{fuel_transaction_id}}/review', $parameters, $options); + } + + /** + * Update a Fuel Transaction. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function updateFuelTransaction(array $parameters = [], array $options = []) + { + return $this->endpoint('PUT', '{{base_url}}/{{namespace}}/fuel-transactions/{{fuel_transaction_id}}', $parameters, $options); + } +} diff --git a/src/Services/Concerns/GeofenceServiceEndpoints.php b/src/Services/Concerns/GeofenceServiceEndpoints.php new file mode 100644 index 0000000..0fa1e3c --- /dev/null +++ b/src/Services/Concerns/GeofenceServiceEndpoints.php @@ -0,0 +1,63 @@ + $parameters + * @param array $options + * @return mixed + */ + public function getDriverGeofenceHistory(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/geofences/driver/:driverId/history', $parameters, $options); + } + + /** + * Get Geofence Dwell Report. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function getGeofenceDwellReport(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/geofences/dwell-report', $parameters, $options); + } + + /** + * Get Geofence Inventory. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function getGeofenceInventory(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/geofences/inventory', $parameters, $options); + } + + /** + * List Geofence Events. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function listGeofenceEvents(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/geofences/events', $parameters, $options); + } +} diff --git a/src/Services/Concerns/IssueServiceEndpoints.php b/src/Services/Concerns/IssueServiceEndpoints.php new file mode 100644 index 0000000..abdcb9f --- /dev/null +++ b/src/Services/Concerns/IssueServiceEndpoints.php @@ -0,0 +1,75 @@ + $parameters + * @param array $options + * @return mixed + */ + public function createIssue(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/issues', $parameters, $options); + } + + /** + * Delete an Issue. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function deleteIssue(array $parameters = [], array $options = []) + { + return $this->endpoint('DELETE', '{{base_url}}/{{namespace}}/issues/:id', $parameters, $options); + } + + /** + * Query Issues. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function queryIssues(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/issues', $parameters, $options); + } + + /** + * Retrieve an Issue. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function retrieveIssue(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/issues/:id', $parameters, $options); + } + + /** + * Update an Issue. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function updateIssue(array $parameters = [], array $options = []) + { + return $this->endpoint('PUT', '{{base_url}}/{{namespace}}/issues/:id', $parameters, $options); + } +} diff --git a/src/Services/Concerns/LabelServiceEndpoints.php b/src/Services/Concerns/LabelServiceEndpoints.php new file mode 100644 index 0000000..af714c4 --- /dev/null +++ b/src/Services/Concerns/LabelServiceEndpoints.php @@ -0,0 +1,27 @@ + $parameters + * @param array $options + * @return mixed + */ + public function renderLabel(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/labels/:id', $parameters, $options); + } +} diff --git a/src/Services/Concerns/ManifestServiceEndpoints.php b/src/Services/Concerns/ManifestServiceEndpoints.php new file mode 100644 index 0000000..c20ddd3 --- /dev/null +++ b/src/Services/Concerns/ManifestServiceEndpoints.php @@ -0,0 +1,51 @@ + $parameters + * @param array $options + * @return mixed + */ + public function optimizeManifest(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/manifests/:id/optimize', $parameters, $options); + } + + /** + * Retrieve a Manifest. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function retrieveManifest(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/manifests/:id', $parameters, $options); + } + + /** + * Update a Manifest Stop. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function updateManifestStop(array $parameters = [], array $options = []) + { + return $this->endpoint('PATCH', '{{base_url}}/{{namespace}}/manifest-stops/:id', $parameters, $options); + } +} diff --git a/src/Services/Concerns/OnboardServiceEndpoints.php b/src/Services/Concerns/OnboardServiceEndpoints.php new file mode 100644 index 0000000..1e79904 --- /dev/null +++ b/src/Services/Concerns/OnboardServiceEndpoints.php @@ -0,0 +1,27 @@ + $parameters + * @param array $options + * @return mixed + */ + public function getDriverOnboardSettings(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/onboard/driver-onboard-settings/:companyId', $parameters, $options); + } +} diff --git a/src/Services/Concerns/OrchestratorServiceEndpoints.php b/src/Services/Concerns/OrchestratorServiceEndpoints.php new file mode 100644 index 0000000..7e1c9db --- /dev/null +++ b/src/Services/Concerns/OrchestratorServiceEndpoints.php @@ -0,0 +1,39 @@ + $parameters + * @param array $options + * @return mixed + */ + public function commitOrchestratorPlan(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/orchestrator/commit', $parameters, $options); + } + + /** + * Run Orchestrator. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function runOrchestrator(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/orchestrator/run', $parameters, $options); + } +} diff --git a/src/Services/Concerns/OrderConfigServiceEndpoints.php b/src/Services/Concerns/OrderConfigServiceEndpoints.php new file mode 100644 index 0000000..43b5f2f --- /dev/null +++ b/src/Services/Concerns/OrderConfigServiceEndpoints.php @@ -0,0 +1,39 @@ + $parameters + * @param array $options + * @return mixed + */ + public function queryOrderConfigs(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/order-configs', $parameters, $options); + } + + /** + * Retrieve an Order Config. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function retrieveOrderConfig(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/order-configs/{{order_config_id}}', $parameters, $options); + } +} diff --git a/src/Services/Concerns/OrderServiceEndpoints.php b/src/Services/Concerns/OrderServiceEndpoints.php new file mode 100644 index 0000000..1ed2d23 --- /dev/null +++ b/src/Services/Concerns/OrderServiceEndpoints.php @@ -0,0 +1,375 @@ + $parameters + * @param array $options + * @return mixed + */ + public function cancelOrder(array $parameters = [], array $options = []) + { + return $this->endpoint('DELETE', '{{base_url}}/{{namespace}}/orders/:id/cancel', $parameters, $options); + } + + /** + * Capture Photo for Order. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function capturePhotoForOrder(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/orders/:id/capture-photo/:subjectId', $parameters, $options); + } + + /** + * Capture QR Code for Order. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function captureQrCodeForOrder(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/orders/:id/capture-qr/:subject-id', $parameters, $options); + } + + /** + * Capture Signature for Order. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function captureSignatureForOrder(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/orders/:id/capture-signature/:subject-id', $parameters, $options); + } + + /** + * Complete an Order. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function completeOrder(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/orders/:id/complete', $parameters, $options); + } + + /** + * Create an Order. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function createOrder(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/orders', $parameters, $options); + } + + /** + * Create an Order using Complete Payload. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function createOrderUsingCompletePayload(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/orders', $parameters, $options); + } + + /** + * Create an Order using Coordinates. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function createOrderUsingCoordinates(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/orders', $parameters, $options); + } + + /** + * Create an Order using GeoJSON Points. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function createOrderUsingGeojsonPoints(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/orders', $parameters, $options); + } + + /** + * Create an Order using only Pickup Dropoff. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function createOrderUsingOnlyPickupDropoff(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/orders', $parameters, $options); + } + + /** + * Create an Order using only Waypoints. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function createOrderUsingOnlyWaypoints(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/orders', $parameters, $options); + } + + /** + * Create an Order using Payload. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function createOrderUsingPayload(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/orders', $parameters, $options); + } + + /** + * Create an Order using Waypoints and Entities with Photos. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function createOrderUsingWaypointsAndEntitiesWithPhotos(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/orders', $parameters, $options); + } + + /** + * Create an Order using Waypoints and Entity Destinations. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function createOrderUsingWaypointsAndEntityDestinations(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/orders', $parameters, $options); + } + + /** + * Delete an Order. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function deleteOrder(array $parameters = [], array $options = []) + { + return $this->endpoint('DELETE', '{{base_url}}/{{namespace}}/orders/:id', $parameters, $options); + } + + /** + * Dispatch an Order. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function dispatchOrder(array $parameters = [], array $options = []) + { + return $this->endpoint('PATCH', '{{base_url}}/{{namespace}}/orders/:id/dispatch', $parameters, $options); + } + + /** + * Get Editable Entity Fields. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function getEditableEntityFields(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/orders/:id/editable-entity-fields', $parameters, $options); + } + + /** + * Get Order Distance and Time. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function getOrderDistanceAndTime(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/orders/:id/distance-and-time', $parameters, $options); + } + + /** + * Get Order ETA. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function getOrderEta(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/orders/:id/eta', $parameters, $options); + } + + /** + * Get Order Next Activity. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function getOrderNextActivity(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/orders/:id/next-activity', $parameters, $options); + } + + /** + * Get Order Tracker. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function getOrderTracker(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/orders/:id/tracker', $parameters, $options); + } + + /** + * List Order Comments. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function listOrderComments(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/orders/:id/comments', $parameters, $options); + } + + /** + * List Order Proofs. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function listOrderProofs(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/orders/:id/proofs/:subjectId', $parameters, $options); + } + + /** + * Query Orders. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function queryOrders(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/orders', $parameters, $options); + } + + /** + * Retrieve an Order. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function retrieveOrder(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/orders/{{order_id}}', $parameters, $options); + } + + /** + * Schedule an Order. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function scheduleOrder(array $parameters = [], array $options = []) + { + return $this->endpoint('PATCH', '{{base_url}}/{{namespace}}/orders/:id/schedule', $parameters, $options); + } + + /** + * Set Order Destination. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function setOrderDestination(array $parameters = [], array $options = []) + { + return $this->endpoint('PATCH', '{{base_url}}/{{namespace}}/orders/:id/set-destination/:placeId', $parameters, $options); + } + + /** + * Start an Order. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function startOrder(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/orders/:id/start', $parameters, $options); + } + + /** + * Update an Order. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function updateOrder(array $parameters = [], array $options = []) + { + return $this->endpoint('PUT', '{{base_url}}/{{namespace}}/orders/:id', $parameters, $options); + } + + /** + * Update Order Activity. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function updateOrderActivity(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/orders/:id/update-activity', $parameters, $options); + } +} diff --git a/src/Services/Concerns/OrganizationServiceEndpoints.php b/src/Services/Concerns/OrganizationServiceEndpoints.php new file mode 100644 index 0000000..091760a --- /dev/null +++ b/src/Services/Concerns/OrganizationServiceEndpoints.php @@ -0,0 +1,39 @@ + $parameters + * @param array $options + * @return mixed + */ + public function getCurrentOrganization(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/organizations/current', $parameters, $options); + } + + /** + * List Organizations. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function listOrganizations(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/organizations', $parameters, $options); + } +} diff --git a/src/Services/Concerns/PartServiceEndpoints.php b/src/Services/Concerns/PartServiceEndpoints.php new file mode 100644 index 0000000..5acce27 --- /dev/null +++ b/src/Services/Concerns/PartServiceEndpoints.php @@ -0,0 +1,75 @@ + $parameters + * @param array $options + * @return mixed + */ + public function createPart(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/parts', $parameters, $options); + } + + /** + * Delete a Part. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function deletePart(array $parameters = [], array $options = []) + { + return $this->endpoint('DELETE', '{{base_url}}/{{namespace}}/parts/{{part_id}}', $parameters, $options); + } + + /** + * Query Parts. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function queryParts(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/parts', $parameters, $options); + } + + /** + * Retrieve a Part. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function retrievePart(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/parts/{{part_id}}', $parameters, $options); + } + + /** + * Update a Part. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function updatePart(array $parameters = [], array $options = []) + { + return $this->endpoint('PUT', '{{base_url}}/{{namespace}}/parts/{{part_id}}', $parameters, $options); + } +} diff --git a/src/Services/Concerns/PayloadServiceEndpoints.php b/src/Services/Concerns/PayloadServiceEndpoints.php new file mode 100644 index 0000000..d008024 --- /dev/null +++ b/src/Services/Concerns/PayloadServiceEndpoints.php @@ -0,0 +1,75 @@ + $parameters + * @param array $options + * @return mixed + */ + public function createPayload(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/payloads', $parameters, $options); + } + + /** + * Delete a Payload. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function deletePayload(array $parameters = [], array $options = []) + { + return $this->endpoint('DELETE', '{{base_url}}/{{namespace}}/payloads/:id', $parameters, $options); + } + + /** + * Query Payloads. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function queryPayloads(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/payloads', $parameters, $options); + } + + /** + * Retrieve a Payload. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function retrievePayload(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/payloads/:id', $parameters, $options); + } + + /** + * Update a Payload. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function updatePayload(array $parameters = [], array $options = []) + { + return $this->endpoint('PUT', '{{base_url}}/{{namespace}}/payloads/:id', $parameters, $options); + } +} diff --git a/src/Services/Concerns/PlaceServiceEndpoints.php b/src/Services/Concerns/PlaceServiceEndpoints.php new file mode 100644 index 0000000..57d55c7 --- /dev/null +++ b/src/Services/Concerns/PlaceServiceEndpoints.php @@ -0,0 +1,99 @@ + $parameters + * @param array $options + * @return mixed + */ + public function createPlace(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/places', $parameters, $options); + } + + /** + * Delete a Place. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function deletePlace(array $parameters = [], array $options = []) + { + return $this->endpoint('DELETE', '{{base_url}}/{{namespace}}/places/:id', $parameters, $options); + } + + /** + * List all Places. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function listAllPlaces(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/places', $parameters, $options); + } + + /** + * Query Places. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function queryPlaces(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/places', $parameters, $options); + } + + /** + * Retrieve a Place. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function retrievePlace(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/places/:id', $parameters, $options); + } + + /** + * Search Places. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function searchPlaces(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/places/search', $parameters, $options); + } + + /** + * Update a Place. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function updatePlace(array $parameters = [], array $options = []) + { + return $this->endpoint('PUT', '{{base_url}}/{{namespace}}/places/:id', $parameters, $options); + } +} diff --git a/src/Services/Concerns/PurchaseRateServiceEndpoints.php b/src/Services/Concerns/PurchaseRateServiceEndpoints.php new file mode 100644 index 0000000..62b2cb3 --- /dev/null +++ b/src/Services/Concerns/PurchaseRateServiceEndpoints.php @@ -0,0 +1,51 @@ + $parameters + * @param array $options + * @return mixed + */ + public function createPurchaseRate(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/purchase-rates', $parameters, $options); + } + + /** + * Query Purchase Rates. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function queryPurchaseRates(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/purchase-rates', $parameters, $options); + } + + /** + * Retrieve a Purchase Rate. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function retrievePurchaseRate(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/purchase-rates/:id', $parameters, $options); + } +} diff --git a/src/Services/Concerns/SensorServiceEndpoints.php b/src/Services/Concerns/SensorServiceEndpoints.php new file mode 100644 index 0000000..772d0d3 --- /dev/null +++ b/src/Services/Concerns/SensorServiceEndpoints.php @@ -0,0 +1,75 @@ + $parameters + * @param array $options + * @return mixed + */ + public function createSensor(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/sensors', $parameters, $options); + } + + /** + * Delete a Sensor. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function deleteSensor(array $parameters = [], array $options = []) + { + return $this->endpoint('DELETE', '{{base_url}}/{{namespace}}/sensors/{{sensor_id}}', $parameters, $options); + } + + /** + * Query Sensors. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function querySensors(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/sensors', $parameters, $options); + } + + /** + * Retrieve a Sensor. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function retrieveSensor(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/sensors/{{sensor_id}}', $parameters, $options); + } + + /** + * Update a Sensor. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function updateSensor(array $parameters = [], array $options = []) + { + return $this->endpoint('PUT', '{{base_url}}/{{namespace}}/sensors/{{sensor_id}}', $parameters, $options); + } +} diff --git a/src/Services/Concerns/ServiceAreaServiceEndpoints.php b/src/Services/Concerns/ServiceAreaServiceEndpoints.php new file mode 100644 index 0000000..1f7d5f1 --- /dev/null +++ b/src/Services/Concerns/ServiceAreaServiceEndpoints.php @@ -0,0 +1,75 @@ + $parameters + * @param array $options + * @return mixed + */ + public function createServiceArea(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/service-areas', $parameters, $options); + } + + /** + * Delete a Service Area. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function deleteServiceArea(array $parameters = [], array $options = []) + { + return $this->endpoint('DELETE', '{{base_url}}/{{namespace}}/service-areas/:id', $parameters, $options); + } + + /** + * Query Service Areas. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function queryServiceAreas(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/service-areas', $parameters, $options); + } + + /** + * Retrieve a Service Area. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function retrieveServiceArea(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/service-areas/:id', $parameters, $options); + } + + /** + * Update a Service Area. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function updateServiceArea(array $parameters = [], array $options = []) + { + return $this->endpoint('PUT', '{{base_url}}/{{namespace}}/service-areas/:id', $parameters, $options); + } +} diff --git a/src/Services/Concerns/ServiceQuoteServiceEndpoints.php b/src/Services/Concerns/ServiceQuoteServiceEndpoints.php new file mode 100644 index 0000000..9c93768 --- /dev/null +++ b/src/Services/Concerns/ServiceQuoteServiceEndpoints.php @@ -0,0 +1,39 @@ + $parameters + * @param array $options + * @return mixed + */ + public function queryServiceQuotes(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/service-quotes', $parameters, $options); + } + + /** + * Retrieve a Service Quote. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function retrieveServiceQuote(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/service-quotes/:id', $parameters, $options); + } +} diff --git a/src/Services/Concerns/ServiceRateServiceEndpoints.php b/src/Services/Concerns/ServiceRateServiceEndpoints.php new file mode 100644 index 0000000..5b1237d --- /dev/null +++ b/src/Services/Concerns/ServiceRateServiceEndpoints.php @@ -0,0 +1,75 @@ + $parameters + * @param array $options + * @return mixed + */ + public function createServiceRate(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/service-rates', $parameters, $options); + } + + /** + * Delete a Service Rate. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function deleteServiceRate(array $parameters = [], array $options = []) + { + return $this->endpoint('DELETE', '{{base_url}}/{{namespace}}/service-rates/:id', $parameters, $options); + } + + /** + * Query Service Rates. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function queryServiceRates(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/service-rates', $parameters, $options); + } + + /** + * Retrieve a Service Rate. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function retrieveServiceRate(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/service-rates/:id', $parameters, $options); + } + + /** + * Update a Service Rate. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function updateServiceRate(array $parameters = [], array $options = []) + { + return $this->endpoint('PUT', '{{base_url}}/{{namespace}}/service-rates/:id', $parameters, $options); + } +} diff --git a/src/Services/Concerns/TrackingNumberServiceEndpoints.php b/src/Services/Concerns/TrackingNumberServiceEndpoints.php new file mode 100644 index 0000000..043251c --- /dev/null +++ b/src/Services/Concerns/TrackingNumberServiceEndpoints.php @@ -0,0 +1,75 @@ + $parameters + * @param array $options + * @return mixed + */ + public function createTrackingNumber(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/tracking-numbers', $parameters, $options); + } + + /** + * Decode Tracking Number QR. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function decodeTrackingNumberQr(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/tracking-numbers/from-qr', $parameters, $options); + } + + /** + * Delete a Tracking Number. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function deleteTrackingNumber(array $parameters = [], array $options = []) + { + return $this->endpoint('DELETE', '{{base_url}}/{{namespace}}/tracking-numbers/:id', $parameters, $options); + } + + /** + * Query Tracking Numbers. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function queryTrackingNumbers(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/tracking-numbers', $parameters, $options); + } + + /** + * Retrieve a Tracking Number. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function retrieveTrackingNumber(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/tracking-numbers/:id', $parameters, $options); + } +} diff --git a/src/Services/Concerns/TrackingStatusServiceEndpoints.php b/src/Services/Concerns/TrackingStatusServiceEndpoints.php new file mode 100644 index 0000000..81fd874 --- /dev/null +++ b/src/Services/Concerns/TrackingStatusServiceEndpoints.php @@ -0,0 +1,75 @@ + $parameters + * @param array $options + * @return mixed + */ + public function createTrackingStatus(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/tracking-statuses', $parameters, $options); + } + + /** + * Delete a Tracking Status. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function deleteTrackingStatus(array $parameters = [], array $options = []) + { + return $this->endpoint('DELETE', '{{base_url}}/{{namespace}}/tracking-statuses/:id', $parameters, $options); + } + + /** + * Query Tracking Statuses. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function queryTrackingStatuses(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/tracking-statuses', $parameters, $options); + } + + /** + * Retrieve a Tracking Status. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function retrieveTrackingStatus(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/tracking-statuses/:id', $parameters, $options); + } + + /** + * Update a Tracking Status. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function updateTrackingStatus(array $parameters = [], array $options = []) + { + return $this->endpoint('PUT', '{{base_url}}/{{namespace}}/tracking-statuses/:id', $parameters, $options); + } +} diff --git a/src/Services/Concerns/VehicleServiceEndpoints.php b/src/Services/Concerns/VehicleServiceEndpoints.php new file mode 100644 index 0000000..c730b36 --- /dev/null +++ b/src/Services/Concerns/VehicleServiceEndpoints.php @@ -0,0 +1,87 @@ + $parameters + * @param array $options + * @return mixed + */ + public function createVehicle(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/vehicles', $parameters, $options); + } + + /** + * Delete a Vehicle. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function deleteVehicle(array $parameters = [], array $options = []) + { + return $this->endpoint('DELETE', '{{base_url}}/{{namespace}}/vehicles/:id', $parameters, $options); + } + + /** + * Query Vehicles. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function queryVehicles(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/vehicles', $parameters, $options); + } + + /** + * Retrieve a Vehicle. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function retrieveVehicle(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/vehicles/:id', $parameters, $options); + } + + /** + * Track Vehicle. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function trackVehicle(array $parameters = [], array $options = []) + { + return $this->endpoint('PATCH', '{{base_url}}/{{namespace}}/vehicles/:id/track', $parameters, $options); + } + + /** + * Update a Vehicle. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function updateVehicle(array $parameters = [], array $options = []) + { + return $this->endpoint('PUT', '{{base_url}}/{{namespace}}/vehicles/:id', $parameters, $options); + } +} diff --git a/src/Services/Concerns/VendorServiceEndpoints.php b/src/Services/Concerns/VendorServiceEndpoints.php new file mode 100644 index 0000000..fa413b6 --- /dev/null +++ b/src/Services/Concerns/VendorServiceEndpoints.php @@ -0,0 +1,75 @@ + $parameters + * @param array $options + * @return mixed + */ + public function createVendor(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/vendors', $parameters, $options); + } + + /** + * Delete a Vendor. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function deleteVendor(array $parameters = [], array $options = []) + { + return $this->endpoint('DELETE', '{{base_url}}/{{namespace}}/vendors/:id', $parameters, $options); + } + + /** + * Query Vendors. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function queryVendors(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/vendors', $parameters, $options); + } + + /** + * Retrieve a Vendor. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function retrieveVendor(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/vendors/:id', $parameters, $options); + } + + /** + * Update a Vendor. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function updateVendor(array $parameters = [], array $options = []) + { + return $this->endpoint('PUT', '{{base_url}}/{{namespace}}/vendors/:id', $parameters, $options); + } +} diff --git a/src/Services/Concerns/WorkOrderServiceEndpoints.php b/src/Services/Concerns/WorkOrderServiceEndpoints.php new file mode 100644 index 0000000..2717e0e --- /dev/null +++ b/src/Services/Concerns/WorkOrderServiceEndpoints.php @@ -0,0 +1,87 @@ + $parameters + * @param array $options + * @return mixed + */ + public function createWorkOrder(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/work-orders', $parameters, $options); + } + + /** + * Delete a Work Order. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function deleteWorkOrder(array $parameters = [], array $options = []) + { + return $this->endpoint('DELETE', '{{base_url}}/{{namespace}}/work-orders/{{work_order_id}}', $parameters, $options); + } + + /** + * Query Work Orders. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function queryWorkOrders(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/work-orders', $parameters, $options); + } + + /** + * Retrieve a Work Order. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function retrieveWorkOrder(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/work-orders/{{work_order_id}}', $parameters, $options); + } + + /** + * Send Work Order. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function sendWorkOrder(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/work-orders/{{work_order_id}}/send', $parameters, $options); + } + + /** + * Update a Work Order. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function updateWorkOrder(array $parameters = [], array $options = []) + { + return $this->endpoint('PUT', '{{base_url}}/{{namespace}}/work-orders/{{work_order_id}}', $parameters, $options); + } +} diff --git a/src/Services/Concerns/ZoneServiceEndpoints.php b/src/Services/Concerns/ZoneServiceEndpoints.php new file mode 100644 index 0000000..f5267a2 --- /dev/null +++ b/src/Services/Concerns/ZoneServiceEndpoints.php @@ -0,0 +1,75 @@ + $parameters + * @param array $options + * @return mixed + */ + public function createZone(array $parameters = [], array $options = []) + { + return $this->endpoint('POST', '{{base_url}}/{{namespace}}/zones', $parameters, $options); + } + + /** + * Delete a Zone. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function deleteZone(array $parameters = [], array $options = []) + { + return $this->endpoint('DELETE', '{{base_url}}/{{namespace}}/zones/:id', $parameters, $options); + } + + /** + * Query Zones. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function queryZones(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/zones', $parameters, $options); + } + + /** + * Retrieve a zone. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function retrieveZone(array $parameters = [], array $options = []) + { + return $this->endpoint('GET', '{{base_url}}/{{namespace}}/zones/:id', $parameters, $options); + } + + /** + * Update a Zone. + * + * @param array $parameters + * @param array $options + * @return mixed + */ + public function updateZone(array $parameters = [], array $options = []) + { + return $this->endpoint('PUT', '{{base_url}}/{{namespace}}/zones/:id', $parameters, $options); + } +} diff --git a/src/Services/ContactService.php b/src/Services/ContactService.php new file mode 100644 index 0000000..4725645 --- /dev/null +++ b/src/Services/ContactService.php @@ -0,0 +1,27 @@ + $options */ + public function __construct(HttpClient $client, array $options = []) + { + parent::__construct('Contact', $client, array_merge(['namespace' => 'contacts'], $options)); + } +} diff --git a/src/Services/CustomerService.php b/src/Services/CustomerService.php new file mode 100644 index 0000000..ff54df4 --- /dev/null +++ b/src/Services/CustomerService.php @@ -0,0 +1,27 @@ + $options */ + public function __construct(HttpClient $client, array $options = []) + { + parent::__construct('Customer', $client, array_merge(['namespace' => 'customers'], $options)); + } +} diff --git a/src/Services/DeviceService.php b/src/Services/DeviceService.php new file mode 100644 index 0000000..47c3838 --- /dev/null +++ b/src/Services/DeviceService.php @@ -0,0 +1,27 @@ + $options */ + public function __construct(HttpClient $client, array $options = []) + { + parent::__construct('Device', $client, array_merge(['namespace' => 'devices'], $options)); + } +} diff --git a/src/Services/DriverService.php b/src/Services/DriverService.php new file mode 100644 index 0000000..42ce86d --- /dev/null +++ b/src/Services/DriverService.php @@ -0,0 +1,27 @@ + $options */ + public function __construct(HttpClient $client, array $options = []) + { + parent::__construct('Driver', $client, array_merge(['namespace' => 'drivers'], $options)); + } +} diff --git a/src/Services/EntityService.php b/src/Services/EntityService.php new file mode 100644 index 0000000..87fac55 --- /dev/null +++ b/src/Services/EntityService.php @@ -0,0 +1,27 @@ + $options */ + public function __construct(HttpClient $client, array $options = []) + { + parent::__construct('Entity', $client, array_merge(['namespace' => 'entities'], $options)); + } +} diff --git a/src/Services/EquipmentService.php b/src/Services/EquipmentService.php new file mode 100644 index 0000000..4b76d1b --- /dev/null +++ b/src/Services/EquipmentService.php @@ -0,0 +1,27 @@ + $options */ + public function __construct(HttpClient $client, array $options = []) + { + parent::__construct('Equipment', $client, array_merge(['namespace' => 'equipment'], $options)); + } +} diff --git a/src/Services/FileService.php b/src/Services/FileService.php new file mode 100644 index 0000000..6223225 --- /dev/null +++ b/src/Services/FileService.php @@ -0,0 +1,27 @@ + $options */ + public function __construct(HttpClient $client, array $options = []) + { + parent::__construct('File', $client, array_merge(['namespace' => 'files'], $options)); + } +} diff --git a/src/Services/FleetService.php b/src/Services/FleetService.php new file mode 100644 index 0000000..e8a0c22 --- /dev/null +++ b/src/Services/FleetService.php @@ -0,0 +1,27 @@ + $options */ + public function __construct(HttpClient $client, array $options = []) + { + parent::__construct('Fleet', $client, array_merge(['namespace' => 'fleets'], $options)); + } +} diff --git a/src/Services/FuelReportService.php b/src/Services/FuelReportService.php new file mode 100644 index 0000000..4b977d0 --- /dev/null +++ b/src/Services/FuelReportService.php @@ -0,0 +1,27 @@ + $options */ + public function __construct(HttpClient $client, array $options = []) + { + parent::__construct('FuelReport', $client, array_merge(['namespace' => 'fuel-reports'], $options)); + } +} diff --git a/src/Services/FuelTransactionService.php b/src/Services/FuelTransactionService.php new file mode 100644 index 0000000..8674211 --- /dev/null +++ b/src/Services/FuelTransactionService.php @@ -0,0 +1,27 @@ + $options */ + public function __construct(HttpClient $client, array $options = []) + { + parent::__construct('FuelTransaction', $client, array_merge(['namespace' => 'fuel-transactions'], $options)); + } +} diff --git a/src/Services/GeofenceService.php b/src/Services/GeofenceService.php new file mode 100644 index 0000000..16b134c --- /dev/null +++ b/src/Services/GeofenceService.php @@ -0,0 +1,27 @@ + $options */ + public function __construct(HttpClient $client, array $options = []) + { + parent::__construct('Geofence', $client, array_merge(['namespace' => 'geofences'], $options)); + } +} diff --git a/src/Services/IssueService.php b/src/Services/IssueService.php new file mode 100644 index 0000000..ddc41c4 --- /dev/null +++ b/src/Services/IssueService.php @@ -0,0 +1,27 @@ + $options */ + public function __construct(HttpClient $client, array $options = []) + { + parent::__construct('Issue', $client, array_merge(['namespace' => 'issues'], $options)); + } +} diff --git a/src/Services/LabelService.php b/src/Services/LabelService.php new file mode 100644 index 0000000..60220d6 --- /dev/null +++ b/src/Services/LabelService.php @@ -0,0 +1,27 @@ + $options */ + public function __construct(HttpClient $client, array $options = []) + { + parent::__construct('Label', $client, array_merge(['namespace' => 'labels'], $options)); + } +} diff --git a/src/Services/ManifestService.php b/src/Services/ManifestService.php new file mode 100644 index 0000000..19c3242 --- /dev/null +++ b/src/Services/ManifestService.php @@ -0,0 +1,27 @@ + $options */ + public function __construct(HttpClient $client, array $options = []) + { + parent::__construct('Manifest', $client, array_merge(['namespace' => 'manifests'], $options)); + } +} diff --git a/src/Services/OnboardService.php b/src/Services/OnboardService.php new file mode 100644 index 0000000..ab3417f --- /dev/null +++ b/src/Services/OnboardService.php @@ -0,0 +1,27 @@ + $options */ + public function __construct(HttpClient $client, array $options = []) + { + parent::__construct('Onboard', $client, array_merge(['namespace' => 'onboard'], $options)); + } +} diff --git a/src/Services/OrchestratorService.php b/src/Services/OrchestratorService.php new file mode 100644 index 0000000..e44c3e7 --- /dev/null +++ b/src/Services/OrchestratorService.php @@ -0,0 +1,27 @@ + $options */ + public function __construct(HttpClient $client, array $options = []) + { + parent::__construct('Orchestrator', $client, array_merge(['namespace' => 'orchestrator'], $options)); + } +} diff --git a/src/Services/OrderConfigService.php b/src/Services/OrderConfigService.php new file mode 100644 index 0000000..f346707 --- /dev/null +++ b/src/Services/OrderConfigService.php @@ -0,0 +1,27 @@ + $options */ + public function __construct(HttpClient $client, array $options = []) + { + parent::__construct('OrderConfig', $client, array_merge(['namespace' => 'order-configs'], $options)); + } +} diff --git a/src/Services/OrderService.php b/src/Services/OrderService.php index 978a02c..f472cab 100644 --- a/src/Services/OrderService.php +++ b/src/Services/OrderService.php @@ -7,33 +7,56 @@ * file that was distributed with this source code. * * @copyright Copyright (c) Fleetbase Pte Ltd. - * @license http://opensource.org/licenses/MIT MIT + * @license https://www.gnu.org/licenses/agpl-3.0.html AGPL-3.0-or-later */ declare(strict_types=1); namespace Fleetbase\Sdk\Services; -use Fleetbase\Sdk\Service; use Fleetbase\Sdk\HttpClient; +use Fleetbase\Sdk\Service; +use Fleetbase\Sdk\Services\Concerns\OrderServiceEndpoints; /** * Fleetbase PHP SDK Base Resource */ class OrderService extends Service { + use OrderServiceEndpoints; + public function __construct(HttpClient $client, array $options = []) { parent::__construct('Order', $client, $options); } + /** + * @param string $id + * @param array $params + * @param array $options + * @return mixed + */ public function getDistanceAndTime($id, $params = [], $options = []) { + if (!is_array($params) || !is_array($options)) { + throw new \InvalidArgumentException('Order action parameters and options must be arrays.'); + } + $legacyOptionKeys = ['onBefore', 'onAfter', 'headers', 'timeout', 'connect_timeout', 'verify', 'proxy']; + if (array_intersect($legacyOptionKeys, array_keys($params)) !== []) { + $options = array_merge($params, $options); + $params = []; + } $uri = $this->uriForResource($id, 'distance-and-time'); return $this->client->get($uri, $params, $options); } + /** + * @param string $id + * @param array $params + * @param array $options + * @return mixed + */ public function getNextActivity($id, $params = [], $options = []) { $uri = $this->uriForResource($id, 'next-activity'); @@ -41,6 +64,12 @@ public function getNextActivity($id, $params = [], $options = []) return $this->client->get($uri, $params, $options); } + /** + * @param string $id + * @param array $params + * @param array $options + * @return mixed + */ public function dispatch($id, $params = [], $options = []) { $uri = $this->uriForResource($id, 'dispatch'); @@ -48,6 +77,12 @@ public function dispatch($id, $params = [], $options = []) return $this->client->post($uri, $params, $options); } + /** + * @param string $id + * @param array $params + * @param array $options + * @return mixed + */ public function start($id, $params = [], $options = []) { $uri = $this->uriForResource($id, 'start'); @@ -55,6 +90,12 @@ public function start($id, $params = [], $options = []) return $this->client->post($uri, $params, $options); } + /** + * @param string $id + * @param array $params + * @param array $options + * @return mixed + */ public function updateActivity($id, $params = [], $options = []) { $uri = $this->uriForResource($id, 'update-activity'); @@ -62,27 +103,56 @@ public function updateActivity($id, $params = [], $options = []) return $this->client->post($uri, $params, $options); } + /** + * @param string $id + * @param string $destinationId + * @param array $params + * @param array $options + * @return mixed + */ public function setDestination($id, $destinationId, $params = [], $options = []) { - $uri = $this->uriForResource($id, 'set-destination/' . $destinationId); + $uri = $this->uriForResource($id, 'set-destination/' . rawurlencode((string) $destinationId)); return $this->client->post($uri, $params, $options); } + /** + * @param string $id + * @param string|null $subjectId + * @param array $params + * @param array $options + * @return mixed + */ public function captureQrCode($id, $subjectId = null, $params = [], $options = []) { - $uri = $this->uriForResource($id, 'capture-qr' . $subjectId ? '' : '/' . $subjectId); + $path = 'capture-qr' . ($subjectId !== null ? '/' . rawurlencode((string) $subjectId) : ''); + $uri = $this->uriForResource($id, $path); return $this->client->post($uri, $params, $options); } + /** + * @param string $id + * @param string|null $subjectId + * @param array $params + * @param array $options + * @return mixed + */ public function captureSignature($id, $subjectId = null, $params = [], $options = []) { - $uri = $this->uriForResource($id, 'capture-signature' . $subjectId ? '' : '/' . $subjectId); + $path = 'capture-signature' . ($subjectId !== null ? '/' . rawurlencode((string) $subjectId) : ''); + $uri = $this->uriForResource($id, $path); return $this->client->post($uri, $params, $options); } + /** + * @param string $id + * @param array $params + * @param array $options + * @return mixed + */ public function complete($id, $params = [], $options = []) { $uri = $this->uriForResource($id, 'complete'); @@ -90,6 +160,12 @@ public function complete($id, $params = [], $options = []) return $this->client->post($uri, $params, $options); } + /** + * @param string $id + * @param array $params + * @param array $options + * @return mixed + */ public function cancel($id, $params = [], $options = []) { $uri = $this->uriForResource($id, 'cancel'); diff --git a/src/Services/OrganizationService.php b/src/Services/OrganizationService.php new file mode 100644 index 0000000..1ec13fe --- /dev/null +++ b/src/Services/OrganizationService.php @@ -0,0 +1,27 @@ + $options */ + public function __construct(HttpClient $client, array $options = []) + { + parent::__construct('Organization', $client, array_merge(['namespace' => 'organizations'], $options)); + } +} diff --git a/src/Services/PartService.php b/src/Services/PartService.php new file mode 100644 index 0000000..769f1d1 --- /dev/null +++ b/src/Services/PartService.php @@ -0,0 +1,27 @@ + $options */ + public function __construct(HttpClient $client, array $options = []) + { + parent::__construct('Part', $client, array_merge(['namespace' => 'parts'], $options)); + } +} diff --git a/src/Services/PayloadService.php b/src/Services/PayloadService.php new file mode 100644 index 0000000..51e0111 --- /dev/null +++ b/src/Services/PayloadService.php @@ -0,0 +1,27 @@ + $options */ + public function __construct(HttpClient $client, array $options = []) + { + parent::__construct('Payload', $client, array_merge(['namespace' => 'payloads'], $options)); + } +} diff --git a/src/Services/PlaceService.php b/src/Services/PlaceService.php new file mode 100644 index 0000000..55150b2 --- /dev/null +++ b/src/Services/PlaceService.php @@ -0,0 +1,27 @@ + $options */ + public function __construct(HttpClient $client, array $options = []) + { + parent::__construct('Place', $client, array_merge(['namespace' => 'places'], $options)); + } +} diff --git a/src/Services/PurchaseRateService.php b/src/Services/PurchaseRateService.php new file mode 100644 index 0000000..4629b04 --- /dev/null +++ b/src/Services/PurchaseRateService.php @@ -0,0 +1,27 @@ + $options */ + public function __construct(HttpClient $client, array $options = []) + { + parent::__construct('PurchaseRate', $client, array_merge(['namespace' => 'purchase-rates'], $options)); + } +} diff --git a/src/Services/SensorService.php b/src/Services/SensorService.php new file mode 100644 index 0000000..3387a34 --- /dev/null +++ b/src/Services/SensorService.php @@ -0,0 +1,27 @@ + $options */ + public function __construct(HttpClient $client, array $options = []) + { + parent::__construct('Sensor', $client, array_merge(['namespace' => 'sensors'], $options)); + } +} diff --git a/src/Services/ServiceAreaService.php b/src/Services/ServiceAreaService.php new file mode 100644 index 0000000..6f7e932 --- /dev/null +++ b/src/Services/ServiceAreaService.php @@ -0,0 +1,27 @@ + $options */ + public function __construct(HttpClient $client, array $options = []) + { + parent::__construct('ServiceArea', $client, array_merge(['namespace' => 'service-areas'], $options)); + } +} diff --git a/src/Services/ServiceQuoteService.php b/src/Services/ServiceQuoteService.php new file mode 100644 index 0000000..7588a82 --- /dev/null +++ b/src/Services/ServiceQuoteService.php @@ -0,0 +1,27 @@ + $options */ + public function __construct(HttpClient $client, array $options = []) + { + parent::__construct('ServiceQuote', $client, array_merge(['namespace' => 'service-quotes'], $options)); + } +} diff --git a/src/Services/ServiceRateService.php b/src/Services/ServiceRateService.php new file mode 100644 index 0000000..68a2d26 --- /dev/null +++ b/src/Services/ServiceRateService.php @@ -0,0 +1,27 @@ + $options */ + public function __construct(HttpClient $client, array $options = []) + { + parent::__construct('ServiceRate', $client, array_merge(['namespace' => 'service-rates'], $options)); + } +} diff --git a/src/Services/TrackingNumberService.php b/src/Services/TrackingNumberService.php new file mode 100644 index 0000000..f01d827 --- /dev/null +++ b/src/Services/TrackingNumberService.php @@ -0,0 +1,27 @@ + $options */ + public function __construct(HttpClient $client, array $options = []) + { + parent::__construct('TrackingNumber', $client, array_merge(['namespace' => 'tracking-numbers'], $options)); + } +} diff --git a/src/Services/TrackingStatusService.php b/src/Services/TrackingStatusService.php new file mode 100644 index 0000000..da8266e --- /dev/null +++ b/src/Services/TrackingStatusService.php @@ -0,0 +1,27 @@ + $options */ + public function __construct(HttpClient $client, array $options = []) + { + parent::__construct('TrackingStatus', $client, array_merge(['namespace' => 'tracking-statuses'], $options)); + } +} diff --git a/src/Services/VehicleService.php b/src/Services/VehicleService.php new file mode 100644 index 0000000..4792c56 --- /dev/null +++ b/src/Services/VehicleService.php @@ -0,0 +1,27 @@ + $options */ + public function __construct(HttpClient $client, array $options = []) + { + parent::__construct('Vehicle', $client, array_merge(['namespace' => 'vehicles'], $options)); + } +} diff --git a/src/Services/VendorService.php b/src/Services/VendorService.php new file mode 100644 index 0000000..aeb18e1 --- /dev/null +++ b/src/Services/VendorService.php @@ -0,0 +1,27 @@ + $options */ + public function __construct(HttpClient $client, array $options = []) + { + parent::__construct('Vendor', $client, array_merge(['namespace' => 'vendors'], $options)); + } +} diff --git a/src/Services/WorkOrderService.php b/src/Services/WorkOrderService.php new file mode 100644 index 0000000..c0e7837 --- /dev/null +++ b/src/Services/WorkOrderService.php @@ -0,0 +1,27 @@ + $options */ + public function __construct(HttpClient $client, array $options = []) + { + parent::__construct('WorkOrder', $client, array_merge(['namespace' => 'work-orders'], $options)); + } +} diff --git a/src/Services/ZoneService.php b/src/Services/ZoneService.php new file mode 100644 index 0000000..b51f0cd --- /dev/null +++ b/src/Services/ZoneService.php @@ -0,0 +1,27 @@ + $options */ + public function __construct(HttpClient $client, array $options = []) + { + parent::__construct('Zone', $client, array_merge(['namespace' => 'zones'], $options)); + } +} diff --git a/src/Utils.php b/src/Utils.php index 67df3e7..61f0850 100644 --- a/src/Utils.php +++ b/src/Utils.php @@ -7,42 +7,54 @@ * file that was distributed with this source code. * * @copyright Copyright (c) Fleetbase Pte Ltd. - * @license http://opensource.org/licenses/MIT MIT + * @license https://www.gnu.org/licenses/agpl-3.0.html AGPL-3.0-or-later */ declare(strict_types=1); namespace Fleetbase\Sdk; -use Doctrine\Inflector\InflectorFactory; use Closure; +use Doctrine\Inflector\InflectorFactory; /** * Fleetbase PHP SDK Utility Functions */ class Utils { + /** @return string */ public static function pluralize(string $string) { $inflector = InflectorFactory::create()->build(); return $inflector->pluralize($string); } + /** @return string */ public static function classify(string $string) { $inflector = InflectorFactory::create()->build(); return $inflector->classify($string); } + /** @return string */ public static function createNamespace(string $namespace) { - $words = preg_split('/(?=[A-Z])/', $namespace, -1, PREG_SPLIT_NO_EMPTY); + $words = preg_split('/(?=[A-Z])/', $namespace, -1, PREG_SPLIT_NO_EMPTY); + if (!$words) { + return strtolower(static::pluralize($namespace)); + } $namespace = implode('-', $words); $namespace = strtolower(Utils::pluralize($namespace)); return $namespace; } + /** + * @param mixed $target + * @param string|null $key + * @param mixed $default + * @return mixed + */ public static function get($target, $key, $default = null) { if (is_null($key) || trim($key) === '') { @@ -70,11 +82,16 @@ public static function get($target, $key, $default = null) return $target; } + /** + * @param mixed $value + * @return mixed + */ public static function value($value) { return $value instanceof Closure ? $value() : $value; } + /** @return never */ public static function dd() { array_map(function ($x) { diff --git a/tests/ConfigurationUtilityTest.php b/tests/ConfigurationUtilityTest.php new file mode 100644 index 0000000..6adf4cd --- /dev/null +++ b/tests/ConfigurationUtilityTest.php @@ -0,0 +1,90 @@ + 'https://fleetbase.example.test/root/', + 'namespace' => '/api/v2/', + 'version' => 'v2', + 'custom' => true, + ], true); + + self::assertSame(' key ', $configuration->getApiKey()); + self::assertSame('https://fleetbase.example.test/root', $configuration->getHost()); + self::assertSame('api/v2', $configuration->getNamespace()); + self::assertSame('v2', $configuration->getVersion()); + self::assertTrue($configuration->isDebug()); + self::assertSame('https://fleetbase.example.test/root/api/v2/', $configuration->getBaseUri()); + self::assertTrue($configuration->toArray()['custom']); + + $withoutNamespace = new Configuration('key', ['namespace' => '']); + self::assertSame('https://api.fleetbase.io/', $withoutNamespace->getBaseUri()); + } + + public function testRejectsEveryInvalidConfigurationBoundary(): void + { + $cases = [ + ['', [], 'API key'], + ['key', ['version' => ''], 'version'], + ['key', ['version' => 1], 'version'], + ['key', ['host' => 'relative/path'], 'absolute'], + ['key', ['host' => 'ftp://fleetbase.example.test'], 'HTTP'], + ['key', ['namespace' => []], 'namespace'], + ]; + + foreach ($cases as $case) { + try { + new Configuration($case[0], $case[1]); + self::fail('Expected invalid configuration to fail.'); + } catch (InvalidConfigurationException $exception) { + self::assertStringContainsString($case[2], $exception->getMessage()); + } + } + } + + public function testArrayAndObjectUtilitiesCoverNestedAndDefaultValues(): void + { + self::assertTrue(Arr::every([2, 4], static function (int $value): bool { + return $value % 2 === 0; + })); + self::assertFalse(Arr::every([2, 3], static function (int $value): bool { + return $value % 2 === 0; + })); + self::assertTrue(Arr::any([1, 2], static function (int $value): bool { + return $value === 2; + })); + self::assertFalse(Arr::any([], static function (): bool { + return true; + })); + self::assertSame('first', Arr::first(['key' => 'first'])); + self::assertSame(-1, Arr::first([])); + + $target = ['child' => (object) ['value' => 42]]; + self::assertSame($target, Utils::get($target, null)); + self::assertSame($target, Utils::get($target, ' ')); + self::assertSame(42, Utils::get($target, 'child.value')); + self::assertSame('fallback', Utils::get($target, 'child.missing', static function (): string { + return 'fallback'; + })); + self::assertSame('fallback', Utils::get((object) [], 'missing', 'fallback')); + self::assertSame('value', Utils::value('value')); + self::assertSame('resolved', Utils::value(static function (): string { + return 'resolved'; + })); + self::assertSame('companies', Utils::pluralize('company')); + self::assertSame('FuelReport', Utils::classify('fuel_report')); + self::assertSame('tracking-statuses', Utils::createNamespace('TrackingStatus')); + self::assertSame('', Utils::createNamespace('')); + } +} diff --git a/tests/Contract/ApiExamplesTest.php b/tests/Contract/ApiExamplesTest.php new file mode 100644 index 0000000..4c634b7 --- /dev/null +++ b/tests/Contract/ApiExamplesTest.php @@ -0,0 +1,44 @@ + 'application/json'], '{}')); + $handler = HandlerStack::create(new MockHandler($responses)); + $handler->push(Middleware::history($history)); + if (!is_array($history)) { + throw new \LogicException('Guzzle history middleware did not preserve its array container.'); + } + $fleetbase = new Fleetbase('test_public_key', [ + 'host' => 'https://api.example.test', + 'namespace' => 'v1', + 'httpClient' => new Client(['handler' => $handler]), + ]); + + foreach ($snippets as $index => $snippet) { + self::assertIsString($snippet); + eval($snippet); + self::assertCount($index + 1, $history); + } + } +} diff --git a/tests/Contract/EndpointContractTest.php b/tests/Contract/EndpointContractTest.php new file mode 100644 index 0000000..23b7fa4 --- /dev/null +++ b/tests/Contract/EndpointContractTest.php @@ -0,0 +1,160 @@ + $part['key'], 'contents' => $contents]; + $expectedMultipart[$part['key']] = $contents; + } + } + $client = $this->mockHttpClient([new Response(200, ['Content-Type' => 'application/json'], '{}')]); + $reflection = new ReflectionClass($serviceClass); + $service = $reflection->newInstance($client); + $service->{$method}($parameters, $options); + + $transaction = $this->history[0] ?? null; + self::assertIsArray($transaction); + $request = $transaction['request'] ?? null; + self::assertInstanceOf(RequestInterface::class, $request); + self::assertSame($httpMethod, $request->getMethod()); + + $expected = preg_replace('#^\{\{base_url\}\}/\{\{namespace\}\}/?#i', '', $urlTemplate); + self::assertIsString($expected); + foreach ($parameters as $name => $value) { + if ($name === 'body') { + continue; + } + if (!is_scalar($value)) { + throw new \RuntimeException('Endpoint path parameters must be scalar.'); + } + $expected = str_replace('{{' . $name . '}}', rawurlencode((string) $value), $expected); + $expected = preg_replace('/:' . preg_quote($name, '/') . '(?![A-Za-z0-9_-])/', rawurlencode((string) $value), $expected); + self::assertIsString($expected); + } + if (is_array($query) && $query !== []) { + $expected .= (strpos($expected, '?') === false ? '?' : '&') + . http_build_query($query, '', '&', PHP_QUERY_RFC3986); + } + self::assertSame('/v1/' . ltrim($expected, '/'), $request->getUri()->getPath() + . ($request->getUri()->getQuery() !== '' ? '?' . $request->getUri()->getQuery() : '')); + if (is_array($expectedBody)) { + self::assertSame($expectedBody, json_decode((string) $request->getBody(), true, 512, JSON_THROW_ON_ERROR)); + } + foreach ($expectedMultipart as $name => $contents) { + self::assertStringContainsString('name="' . $name . '"', (string) $request->getBody()); + self::assertStringContainsString($contents, (string) $request->getBody()); + } + } + } + + /** @return iterable, string, string, string, array, array}> */ + private static function endpointCases(): iterable + { + $contents = file_get_contents(dirname(__DIR__, 2) . '/contracts/postman-manifest.json'); + if (!is_string($contents)) { + throw new \RuntimeException('Unable to read the endpoint contract manifest.'); + } + $manifest = json_decode($contents, true, 512, JSON_THROW_ON_ERROR); + if (!is_array($manifest) || !is_array($manifest['requests'] ?? null)) { + throw new \RuntimeException('The endpoint contract manifest is invalid.'); + } + foreach ($manifest['requests'] as $request) { + if (!is_array($request)) { + throw new \RuntimeException('The endpoint contract request is invalid.'); + } + $id = $request['id'] ?? null; + $implementationName = $request['implementation'] ?? null; + $httpMethod = $request['method'] ?? null; + $url = $request['url'] ?? null; + $requestFixture = $request['request_fixture'] ?? null; + if (!is_string($id) || !is_string($implementationName) || !is_string($httpMethod) || !is_string($url) || !is_array($requestFixture)) { + throw new \RuntimeException('The endpoint contract request fields are invalid.'); + } + $implementation = explode('::', $implementationName, 2); + $serviceClass = $implementation[0] ?? ''; + $serviceMethod = $implementation[1] ?? ''; + if (!class_exists($serviceClass) || !is_subclass_of($serviceClass, Service::class) || !method_exists($serviceClass, $serviceMethod)) { + throw new \RuntimeException('The endpoint contract implementation is invalid.'); + } + $normalizedRequestFixture = []; + foreach ($requestFixture as $fixtureKey => $fixtureValue) { + if (is_string($fixtureKey)) { + $normalizedRequestFixture[$fixtureKey] = $fixtureValue; + } + } + $parameters = []; + preg_match_all('/(?:\{\{([^}]+)\}\}|:([A-Za-z][A-Za-z0-9_-]*))/', $url, $matches, PREG_SET_ORDER); + foreach ($matches as $match) { + $bracedName = $match[1] ?? ''; + $colonName = $match[2] ?? ''; + $name = $bracedName !== '' ? $bracedName : $colonName; + if (!in_array($name, ['base_url', 'namespace'], true)) { + $parameters[$name] = $name . '-fixture'; + } + } + yield $id => [ + $serviceClass, + $serviceMethod, + $httpMethod, + $url, + $parameters, + $normalizedRequestFixture, + ]; + } + } + + /** + * @param mixed $value + * @return mixed + */ + private static function normalizeFixture($value) + { + if (is_array($value)) { + foreach ($value as $key => $item) { + $value[$key] = self::normalizeFixture($item); + } + return $value; + } + if (!is_string($value)) { + return $value; + } + + return preg_replace_callback('/\{\{([^}]+)\}\}/', static function (array $matches): string { + return trim($matches[1], '$') . '-fixture'; + }, $value) ?? $value; + } +} diff --git a/tests/Fleetbase/FleetbaseTest.php b/tests/Fleetbase/FleetbaseTest.php index ad867bd..e6a85c0 100644 --- a/tests/Fleetbase/FleetbaseTest.php +++ b/tests/Fleetbase/FleetbaseTest.php @@ -5,23 +5,115 @@ namespace Fleetbase\Sdk\Test\Fleetbase; use Fleetbase\Sdk\Fleetbase; +use Fleetbase\Sdk\Service; use Fleetbase\Sdk\Test\TestCase; final class FleetbaseTest extends TestCase { - public function testInitializeSdk() + public function testInitializesLegacyFacadeAndStores(): void { - $publicKey = $_ENV['FLEETBASE_KEY']; - $sdk = new Fleetbase($publicKey); - - $this->assertInstanceOf(Fleetbase::class, $sdk); + $sdk = new Fleetbase('test_public_key'); + + foreach (self::services() as $store => $serviceClass) { + self::assertInstanceOf($serviceClass, $sdk->{$store}); + self::assertSame($sdk->{$store}, $sdk->service($store)); + self::assertSame($sdk->{$store}, $sdk->{$store}()); + } } - public function testGetVersion() + public function testPreservesConfigurationAndVersion(): void { - $publicKey = $_ENV['FLEETBASE_KEY']; - $sdk = new Fleetbase($publicKey); + $sdk = new Fleetbase('test_public_key', [ + 'version' => 'v2', + 'host' => 'https://fleetbase.example.test/base', + 'namespace' => 'custom', + ], true); + + $this->assertSame('v2', $sdk->getVersion()); + $this->assertSame([ + 'version' => 'v2', + 'host' => 'https://fleetbase.example.test/base', + 'namespace' => 'custom', + 'debug' => true, + 'publicKey' => 'test_public_key', + ], $sdk->getOptions()); + } + + public function testNewInstanceKeepsLegacyVariadicFactory(): void + { + $sdk = Fleetbase::newInstance('test_public_key', ['namespace' => 'api']); + + $this->assertSame('api', $sdk->getOptions()['namespace']); + } - $this->assertSame('v1', $sdk->getVersion()); + public function testRekeysFacadeAndRejectsInvalidFactoriesAndServices(): void + { + $sdk = new Fleetbase('old_key', ['host' => 'https://self.example.test/root', 'namespace' => 'api/v2'], true); + $replacement = $sdk->setApiKey('new_key'); + self::assertNotSame($sdk, $replacement); + self::assertSame('new_key', $replacement->getOptions()['publicKey']); + self::assertSame('https://self.example.test/root', $replacement->getOptions()['host']); + self::assertSame('api/v2', $replacement->getOptions()['namespace']); + self::assertTrue($replacement->getOptions()['debug']); + + foreach ([[], [123], ['key', 'invalid'], ['key', [], 'invalid']] as $arguments) { + try { + Fleetbase::newInstance(...$arguments); + self::fail('Expected invalid factory arguments.'); + } catch (\InvalidArgumentException $exception) { + self::assertStringContainsString('expects an API key', $exception->getMessage()); + } + } + + foreach (['missing', 'client'] as $name) { + try { + $sdk->service($name); + self::fail('Expected an unknown service.'); + } catch (\InvalidArgumentException $exception) { + self::assertStringContainsString($name, $exception->getMessage()); + } + } + } + + /** @return array> */ + private static function services(): array + { + return [ + 'orders' => \Fleetbase\Sdk\Services\OrderService::class, + 'entities' => \Fleetbase\Sdk\Services\EntityService::class, + 'places' => \Fleetbase\Sdk\Services\PlaceService::class, + 'drivers' => \Fleetbase\Sdk\Services\DriverService::class, + 'vehicles' => \Fleetbase\Sdk\Services\VehicleService::class, + 'vendors' => \Fleetbase\Sdk\Services\VendorService::class, + 'contacts' => \Fleetbase\Sdk\Services\ContactService::class, + 'serviceAreas' => \Fleetbase\Sdk\Services\ServiceAreaService::class, + 'zones' => \Fleetbase\Sdk\Services\ZoneService::class, + 'trackingStatuses' => \Fleetbase\Sdk\Services\TrackingStatusService::class, + 'serviceRates' => \Fleetbase\Sdk\Services\ServiceRateService::class, + 'serviceQuotes' => \Fleetbase\Sdk\Services\ServiceQuoteService::class, + 'customers' => \Fleetbase\Sdk\Services\CustomerService::class, + 'devices' => \Fleetbase\Sdk\Services\DeviceService::class, + 'equipment' => \Fleetbase\Sdk\Services\EquipmentService::class, + 'fleets' => \Fleetbase\Sdk\Services\FleetService::class, + 'fuelReports' => \Fleetbase\Sdk\Services\FuelReportService::class, + 'fuelTransactions' => \Fleetbase\Sdk\Services\FuelTransactionService::class, + 'geofences' => \Fleetbase\Sdk\Services\GeofenceService::class, + 'issues' => \Fleetbase\Sdk\Services\IssueService::class, + 'labels' => \Fleetbase\Sdk\Services\LabelService::class, + 'manifests' => \Fleetbase\Sdk\Services\ManifestService::class, + 'onboard' => \Fleetbase\Sdk\Services\OnboardService::class, + 'orchestrator' => \Fleetbase\Sdk\Services\OrchestratorService::class, + 'orderConfigs' => \Fleetbase\Sdk\Services\OrderConfigService::class, + 'organizations' => \Fleetbase\Sdk\Services\OrganizationService::class, + 'parts' => \Fleetbase\Sdk\Services\PartService::class, + 'payloads' => \Fleetbase\Sdk\Services\PayloadService::class, + 'purchaseRates' => \Fleetbase\Sdk\Services\PurchaseRateService::class, + 'sensors' => \Fleetbase\Sdk\Services\SensorService::class, + 'trackingNumbers' => \Fleetbase\Sdk\Services\TrackingNumberService::class, + 'workOrders' => \Fleetbase\Sdk\Services\WorkOrderService::class, + 'chatChannels' => \Fleetbase\Sdk\Services\ChatChannelService::class, + 'comments' => \Fleetbase\Sdk\Services\CommentService::class, + 'files' => \Fleetbase\Sdk\Services\FileService::class, + ]; } -} \ No newline at end of file +} diff --git a/tests/Fleetbase/OrderTest.php b/tests/Fleetbase/OrderTest.php index 304d49f..9c4c35b 100644 --- a/tests/Fleetbase/OrderTest.php +++ b/tests/Fleetbase/OrderTest.php @@ -4,87 +4,114 @@ namespace Fleetbase\Sdk\Test\Fleetbase; -use Fleetbase\Sdk\Fleetbase; use Fleetbase\Sdk\Resources\Order; +use Fleetbase\Sdk\Service; +use Fleetbase\Sdk\Services\OrderService; use Fleetbase\Sdk\Test\TestCase; +use GuzzleHttp\Psr7\Response; +use Psr\Http\Message\RequestInterface; final class OrderTest extends TestCase { - const TEST_RESOURCE_ID = 'order_123'; - - public function testIsCreatable() - { - $publicKey = $_ENV['FLEETBASE_KEY']; - $fleetbase = new Fleetbase($publicKey); - - $resource = $fleetbase->orders->create([ - 'internal_id' => 'SDKTEST123', - 'payload' => [ - 'pickup' => '9 Raffles Place, Republic Plaza, Singapore', - 'dropoff' => '2 Orchard Turn, Singapore 238801' - ] - ]); - - $this->assertInstanceOf(Order::class, $resource); - } - - public function testIsListable() + public function testPublishedOrderResourceActionSurfaceRemainsCallable(): void { - $publicKey = $_ENV['FLEETBASE_KEY']; - $fleetbase = new Fleetbase($publicKey); - - $resources = $fleetbase->orders->findAll(); - - $this->assertIsArray($resources); - $this->assertInstanceOf(Order::class, $resources[0]); + foreach ( + [ + 'getDistanceAndTime', + 'getNextActivity', + 'dispatch', + 'start', + 'updateActivity', + 'setDestination', + 'captureQrCode', + 'captureSignature', + 'complete', + 'cancel', + ] as $method + ) { + $this->assertTrue(method_exists(Order::class, $method), $method . ' is missing from Order'); + $this->assertTrue(method_exists(OrderService::class, $method), $method . ' is missing from OrderService'); + } } - public function testIsRetrievable() + public function testLegacyOrderServiceAndResourceActionsResolveCorrectPaths(): void { - $publicKey = $_ENV['FLEETBASE_KEY']; - $fleetbase = new Fleetbase($publicKey); - - $resource = $fleetbase->orders->findRecord(self::TEST_RESOURCE_ID); - - $this->assertInstanceOf(Order::class, $resource); + $client = $this->mockHttpClient(array_fill(0, 24, new Response(200, ['Content-Type' => 'application/json'], '{}'))); + $service = new OrderService($client); + $before = false; + + $service->getDistanceAndTime('order_1', ['include' => 'route']); + $service->getDistanceAndTime('order_1', ['onBefore' => function () use (&$before): void { + $before = true; + }]); + $service->getNextActivity('order_1'); + $service->dispatch('order_1'); + $service->start('order_1'); + $service->updateActivity('order_1'); + $service->setDestination('order_1', 'destination with space'); + $service->captureQrCode('order_1'); + $service->captureQrCode('order_1', 'subject with space'); + $service->captureSignature('order_1'); + $service->captureSignature('order_1', 'subject with space'); + $service->complete('order_1'); + $service->cancel('order_1'); + + $order = new Order(['id' => 'order_2'], $service); + $order->__constructor(['id' => 'order_2'], $service); + $order->getDistanceAndTime(); + $order->getNextActivity(); + $order->dispatch(); + $order->start(); + $order->updateActivity(); + $order->setDestination('destination_2'); + $order->captureQrCode('subject_2'); + $order->captureSignature('subject_2'); + $order->complete(); + $order->cancel(); + + self::assertTrue($before); + self::assertCount(23, $this->history); + $paths = array_map(function ($transaction): string { + self::assertIsArray($transaction); + $request = $transaction['request'] ?? null; + self::assertInstanceOf(RequestInterface::class, $request); + return $request->getMethod() . ' ' . $request->getUri()->getPath() + . ($request->getUri()->getQuery() !== '' ? '?' . $request->getUri()->getQuery() : ''); + }, $this->history); + self::assertContains('GET /v1/orders/order_1/distance-and-time?include=route', $paths); + self::assertContains('POST /v1/orders/order_1/set-destination/destination%20with%20space', $paths); + self::assertContains('POST /v1/orders/order_1/capture-qr', $paths); + self::assertContains('POST /v1/orders/order_1/capture-qr/subject%20with%20space', $paths); + self::assertContains('POST /v1/orders/order_1/capture-signature', $paths); + self::assertContains('DELETE /v1/orders/order_2/cancel', $paths); } - public function testIsSaveable() + public function testOrderActionsValidateLegacyArgumentsAndAttachment(): void { - $publicKey = $_ENV['FLEETBASE_KEY']; - $fleetbase = new Fleetbase($publicKey); - - $resource = $fleetbase->orders->findRecord(self::TEST_RESOURCE_ID); - $resource->save(); - - $this->assertInstanceOf(Order::class, $resource); - } - - public function testIsUpdatable() - { - $publicKey = $_ENV['FLEETBASE_KEY']; - $fleetbase = new Fleetbase($publicKey); - - $newInternalId = 'SDKTEST1232'; - - $resource = $fleetbase->orders->findRecord(self::TEST_RESOURCE_ID); - $resource->update(['internal_id' => $newInternalId]); - - $this->assertInstanceOf(Order::class, $resource); - $this->assertEquals($newInternalId, $resource->getAttribute('internal_id')); - } - - public function testIsDeletable() - { - $publicKey = $_ENV['FLEETBASE_KEY']; - $fleetbase = new Fleetbase($publicKey); - - $resource = $fleetbase->orders->findRecord(self::TEST_RESOURCE_ID); - $resource->destroy(); - - $this->assertIsObject($resource); - $this->assertTrue($resource->getAttribute('deleted')); - $this->assertTrue($resource->isDestroyed); - $this->assertEquals(self::TEST_RESOURCE_ID, $resource->id); + $service = new OrderService($this->mockHttpClient([])); + foreach ([['invalid', []], [[], 'invalid']] as $arguments) { + try { + (new \ReflectionMethod($service, 'getDistanceAndTime'))->invoke($service, 'order_1', $arguments[0], $arguments[1]); + self::fail('Expected invalid action arguments.'); + } catch (\InvalidArgumentException $exception) { + self::assertStringContainsString('arrays', $exception->getMessage()); + } + } + + foreach ([new Order(), new Order(['id' => 'order_1'], new Service('Order', $this->mockHttpClient([])))] as $order) { + try { + $order->cancel(); + self::fail('Expected an invalid order attachment.'); + } catch (\LogicException $exception) { + self::assertStringContainsString($order->getService() === null ? 'OrderService' : 'OrderService', $exception->getMessage()); + } + } + + try { + (new Order([], $service))->cancel(); + self::fail('Expected a missing order ID.'); + } catch (\LogicException $exception) { + self::assertStringContainsString('ID', $exception->getMessage()); + } } } diff --git a/tests/Fleetbase/PlaceTest.php b/tests/Fleetbase/PlaceTest.php index 7de7650..c815239 100644 --- a/tests/Fleetbase/PlaceTest.php +++ b/tests/Fleetbase/PlaceTest.php @@ -4,87 +4,76 @@ namespace Fleetbase\Sdk\Test\Fleetbase; -use Fleetbase\Sdk\Fleetbase; use Fleetbase\Sdk\Resources\Place; +use Fleetbase\Sdk\Service; use Fleetbase\Sdk\Test\TestCase; +use GuzzleHttp\Psr7\Response; +use Psr\Http\Message\RequestInterface; final class PlaceTest extends TestCase { - const TEST_RESOURCE_ID = 'place_123'; + private const TEST_RESOURCE_ID = 'place_123'; - public function testIsCreatable() + public function testGenericServiceCrudAndQueryContract(): void { - $publicKey = $_ENV['FLEETBASE_KEY']; - $fleetbase = new Fleetbase($publicKey); - - $resource = $fleetbase->places->create([ - 'name' => 'Space Needle', - 'street1' => '400 Broad Street', - 'city' => 'Seattle', - 'state' => 'WA', - 'country' => 'US' + $client = $this->mockHttpClient([ + $this->jsonResponse(['id' => self::TEST_RESOURCE_ID, 'name' => 'HQ']), + $this->jsonResponse(['id' => self::TEST_RESOURCE_ID, 'name' => 'HQ']), + $this->jsonResponse([ + ['id' => self::TEST_RESOURCE_ID], + ['id' => 'place_456'], + ]), + $this->jsonResponse([['id' => self::TEST_RESOURCE_ID]]), + $this->jsonResponse(['id' => self::TEST_RESOURCE_ID]), + $this->jsonResponse(['id' => self::TEST_RESOURCE_ID, 'name' => 'Updated']), + $this->jsonResponse(['id' => self::TEST_RESOURCE_ID, 'deleted' => true]), ]); - - $this->assertInstanceOf(Place::class, $resource); - } - - public function testIsListable() - { - $publicKey = $_ENV['FLEETBASE_KEY']; - $fleetbase = new Fleetbase($publicKey); - - $resources = $fleetbase->places->findAll(); - - $this->assertIsArray($resources); - $this->assertInstanceOf(Place::class, $resources[0]); + $service = new Service('Place', $client); + + $created = $service->create(['name' => 'HQ']); + $found = $service->findRecord(self::TEST_RESOURCE_ID); + $all = $service->findAll(); + $queried = $service->query(['page' => 2]); + $single = $service->queryRecord(['name' => 'HQ']); + $updated = $service->update(self::TEST_RESOURCE_ID, ['name' => 'Updated']); + $destroyed = $service->destroy(self::TEST_RESOURCE_ID); + + $this->assertInstanceOf(Place::class, $created); + $this->assertInstanceOf(Place::class, $found); + $this->assertIsArray($all); + $this->assertIsArray($queried); + $this->assertContainsOnlyInstancesOf(Place::class, $all); + $this->assertContainsOnlyInstancesOf(Place::class, $queried); + $this->assertInstanceOf(Place::class, $single); + $this->assertInstanceOf(Place::class, $updated); + $this->assertInstanceOf(Place::class, $destroyed); + $this->assertSame('Updated', $updated->getAttribute('name')); + $this->assertTrue($destroyed->getAttribute('deleted')); + + $requests = []; + foreach ($this->history as $transaction) { + if (!is_array($transaction) || !($transaction['request'] ?? null) instanceof RequestInterface) { + self::fail('Guzzle history contained an invalid transaction.'); + } + $request = $transaction['request']; + $requests[] = $request->getMethod() . ' ' . $request->getUri()->getPath() + . ($request->getUri()->getQuery() !== '' ? '?' . $request->getUri()->getQuery() : ''); + } + + $this->assertSame([ + 'POST /v1/places', + 'GET /v1/places/place_123', + 'GET /v1/places', + 'GET /v1/places?page=2', + 'GET /v1/places?name=HQ&single=1', + 'PUT /v1/places/place_123', + 'DELETE /v1/places/place_123', + ], $requests); } - public function testIsRetrievable() + /** @param mixed $data */ + private function jsonResponse($data, int $status = 200): Response { - $publicKey = $_ENV['FLEETBASE_KEY']; - $fleetbase = new Fleetbase($publicKey); - - $resource = $fleetbase->places->findRecord(self::TEST_RESOURCE_ID); - - $this->assertInstanceOf(Place::class, $resource); - } - - public function testIsSaveable() - { - $publicKey = $_ENV['FLEETBASE_KEY']; - $fleetbase = new Fleetbase($publicKey); - - $resource = $fleetbase->places->findRecord(self::TEST_RESOURCE_ID); - $resource->save(); - - $this->assertInstanceOf(Place::class, $resource); - } - - public function testIsUpdatable() - { - $publicKey = $_ENV['FLEETBASE_KEY']; - $fleetbase = new Fleetbase($publicKey); - - $newName = 'Space Needle 2'; - - $resource = $fleetbase->places->findRecord(self::TEST_RESOURCE_ID); - $resource->update(['name' => $newName]); - - $this->assertInstanceOf(Place::class, $resource); - $this->assertEquals($newName, $resource->getAttribute('name')); - } - - public function testIsDeletable() - { - $publicKey = $_ENV['FLEETBASE_KEY']; - $fleetbase = new Fleetbase($publicKey); - - $resource = $fleetbase->places->findRecord(self::TEST_RESOURCE_ID); - $resource->destroy(); - - $this->assertIsObject($resource); - $this->assertTrue($resource->getAttribute('deleted')); - $this->assertTrue($resource->isDestroyed); - $this->assertEquals(self::TEST_RESOURCE_ID, $resource->id); + return new Response($status, ['Content-Type' => 'application/json'], json_encode($data, JSON_THROW_ON_ERROR)); } } diff --git a/tests/HttpClientTest.php b/tests/HttpClientTest.php new file mode 100644 index 0000000..2fdf76d --- /dev/null +++ b/tests/HttpClientTest.php @@ -0,0 +1,492 @@ +mockHttpClient(array_fill(0, 6, new Response(200, ['Content-Type' => 'application/json'], '{}'))); + $events = []; + + $client->get('things', ['filter' => 'active'], [ + 'headers' => ['X-String' => 'yes', 'X-Many' => ['one', 2, 'two']], + 'onBefore' => function () use (&$events): void { + $events[] = 'before'; + }, + 'onAfter' => function () use (&$events): void { + $events[] = 'after'; + }, + ]); + $client->post('things', ['name' => 'JSON']); + $client->put('things/1', [], ['form_params' => ['name' => 'Form Value']]); + $client->patch('things/1', [], ['body' => new class () { + public function __toString(): string + { + return 'raw-body'; + } + }]); + $client->delete('things/1', [], [ + 'multipart' => [['name' => 'attachment', 'contents' => 'file-content']], + 'idempotency_key' => 'idem-1', + ]); + $client->request('HEAD', 'things', ['ignored' => 'query']); + + self::assertSame(['before', 'after'], $events); + self::assertCount(6, $this->history); + $get = $this->requestAt(0); + self::assertSame('filter=active', $get->getUri()->getQuery()); + self::assertSame('Bearer test_public_key', $get->getHeaderLine('Authorization')); + self::assertSame('yes', $get->getHeaderLine('X-String')); + self::assertSame('one, two', $get->getHeaderLine('X-Many')); + self::assertStringStartsWith('fleetbase-php/1.1.0 PHP/', $get->getHeaderLine('User-Agent')); + + $json = $this->requestAt(1); + self::assertSame('application/json', $json->getHeaderLine('Content-Type')); + self::assertSame('{"name":"JSON"}', (string) $json->getBody()); + + $form = $this->requestAt(2); + self::assertSame('application/x-www-form-urlencoded', $form->getHeaderLine('Content-Type')); + self::assertSame('name=Form%20Value', (string) $form->getBody()); + + self::assertSame('raw-body', (string) $this->requestAt(3)->getBody()); + $multipart = $this->requestAt(4); + self::assertStringStartsWith('multipart/form-data; boundary=', $multipart->getHeaderLine('Content-Type')); + self::assertStringContainsString('file-content', (string) $multipart->getBody()); + self::assertSame('idem-1', $multipart->getHeaderLine('Idempotency-Key')); + self::assertSame('ignored=query', $this->requestAt(5)->getUri()->getQuery()); + } + + public function testTracksResponsesAndSupportsPlainTextAndEmptyBodies(): void + { + $client = $this->mockHttpClient([ + new Response(200, ['Content-Type' => 'text/plain'], 'download-content'), + new Response(204), + ]); + + self::assertSame('download-content', $client->get('files/1/download')); + self::assertSame(200, $client->getLastResponse()->getStatusCode()); + self::assertSame($client->getLastPsrResponse(), $client->getLastResponse()); + self::assertNull($client->delete('files/1')); + } + + public function testMapsEveryHttpErrorAndRetainsMetadata(): void + { + $cases = [ + 400 => UnexpectedResponseException::class, + 401 => AuthenticationException::class, + 403 => AuthorizationException::class, + 404 => NotFoundException::class, + 409 => ConflictException::class, + 422 => ValidationException::class, + 429 => RateLimitException::class, + 500 => ServerException::class, + ]; + + foreach ($cases as $status => $exceptionClass) { + $client = $this->mockHttpClient([new Response($status, [ + 'Content-Type' => 'application/json', + 'X-Fleetbase-Request-Id' => 'request-' . $status, + ], '{"message":"failed","code":"E_TEST","errors":{"field":["invalid"]}}')]); + try { + $client->get('things?api_key=must-not-leak'); + self::fail('Expected an HTTP exception.'); + } catch (FleetbaseException $exception) { + self::assertInstanceOf($exceptionClass, $exception); + self::assertSame($status, $exception->getStatusCode()); + self::assertSame('E_TEST', $exception->getErrorCode()); + self::assertSame(['field' => ['invalid']], $exception->getDetails()); + self::assertSame('request-' . $status, $exception->getRequestId()); + self::assertSame('GET', $exception->getRequestMethod()); + self::assertSame('https://api.example.test/v1/things', $exception->getRequestUrl()); + self::assertStringNotContainsString('must-not-leak', (string) $exception->getRequestUrl()); + } + } + } + + public function testRejectsMalformedJsonAndInvalidOptions(): void + { + $client = $this->mockHttpClient([ + new Response(200, ['Content-Type' => 'application/json'], '{bad'), + new Response(500, ['Content-Type' => 'text/plain'], 'not-json'), + new Response(200), + ]); + + foreach (['json-success', 'error-response'] as $path) { + try { + $client->get($path); + self::fail('Expected malformed JSON to fail.'); + } catch (DecodingException $exception) { + self::assertSame('GET', $exception->getRequestMethod()); + } + } + + try { + $client->post('things', [], ['body' => []]); + self::fail('Expected an invalid raw body exception.'); + } catch (\InvalidArgumentException $exception) { + self::assertStringContainsString('Raw request bodies', $exception->getMessage()); + } + + try { + (new \ReflectionMethod($client, 'get'))->invoke($client, 'things', [], 'invalid'); + self::fail('Expected invalid request options to fail.'); + } catch (\InvalidArgumentException $exception) { + self::assertStringContainsString('options', $exception->getMessage()); + } + } + + public function testRetriesOnlySafeOrIdempotentRequests(): void + { + $delays = []; + $client = $this->mockHttpClient([ + new Response(429, ['Retry-After' => '2'], '{"message":"wait"}'), + new Response(200, ['Content-Type' => 'application/json'], '{"ok":true}'), + new Response(503, ['Content-Type' => 'application/json'], '{"message":"down"}'), + new Response(503, ['Content-Type' => 'application/json'], '{"message":"down"}'), + new Response(200, ['Content-Type' => 'application/json'], '{"ok":true}'), + ]); + $options = [ + 'max_retries' => 1, + 'retry_delay_ms' => 5, + 'retry_sleep' => function (int $milliseconds, int $attempt) use (&$delays): void { + $delays[] = [$milliseconds, $attempt]; + }, + ]; + + $get = $client->get('things', [], $options); + self::assertIsObject($get); + self::assertSame(true, get_object_vars($get)['ok'] ?? null); + + try { + $client->post('things', ['name' => 'unsafe'], $options); + self::fail('Expected an unsafe POST not to retry.'); + } catch (ServerException $exception) { + self::assertSame(503, $exception->getStatusCode()); + } + + $post = $client->post('things', ['name' => 'safe'], array_merge($options, ['idempotency_key' => 'safe-post'])); + self::assertIsObject($post); + self::assertSame(true, get_object_vars($post)['ok'] ?? null); + self::assertSame([[2000, 1], [5, 1]], $delays); + self::assertCount(5, $this->history); + } + + public function testMapsPsrTransportFailuresAndUsesInjectedClient(): void + { + $request = new Request('GET', 'https://api.example.test/v1/things'); + $connectionFailure = new ConnectException('connection refused', $request); + $client = $this->mockHttpClient([$connectionFailure]); + try { + $client->get('things'); + self::fail('Expected a connection failure.'); + } catch (TransportException $exception) { + self::assertSame($connectionFailure, $exception->getPrevious()); + } + + $psrClient = new class () implements ClientInterface { + /** @var RequestInterface|null */ + public $request; + + public function sendRequest(RequestInterface $request): ResponseInterface + { + $this->request = $request; + return new Response(200, ['Content-Type' => 'application/json'], '{"transport":"psr18"}'); + } + }; + $injected = new HttpClient([ + 'publicKey' => 'test_public_key', + 'httpClient' => $psrClient, + 'host' => 'https://self-hosted.example.test/prefix', + 'namespace' => 'api/v1', + ]); + $decoded = $injected->get('things'); + self::assertIsObject($decoded); + self::assertSame('psr18', get_object_vars($decoded)['transport'] ?? null); + self::assertInstanceOf(RequestInterface::class, $psrClient->request); + self::assertSame('https://self-hosted.example.test/prefix/api/v1/things', (string) $psrClient->request->getUri()); + + $genericFailure = new class ('failed') extends \RuntimeException implements ClientExceptionInterface { + }; + $failingClient = new class ($genericFailure) implements ClientInterface { + /** @var ClientExceptionInterface */ + private $exception; + + public function __construct(ClientExceptionInterface $exception) + { + $this->exception = $exception; + } + + public function sendRequest(RequestInterface $request): ResponseInterface + { + throw $this->exception; + } + }; + try { + (new HttpClient(['publicKey' => 'test_public_key', 'httpClient' => $failingClient]))->get('things'); + self::fail('Expected a PSR transport failure.'); + } catch (TransportException $exception) { + self::assertSame($genericFailure, $exception->getPrevious()); + } + } + + public function testMutatesHostAndNamespaceWithoutLosingConfiguration(): void + { + $client = $this->mockHttpClient([new Response(200)]); + self::assertSame('https://api.example.test', $client->getHost()); + self::assertSame('v1', $client->getNamespace()); + self::assertSame($client, $client->setHost('https://self.example.test/root')); + self::assertSame($client, $client->setNamespace('api/v2')); + self::assertSame('https://self.example.test/root', $client->getHost()); + self::assertSame('api/v2', $client->getNamespace()); + self::assertSame('test_public_key', $client->getOptions()['publicKey']); + } + + public function testCoversResponseAndUrlBoundaries(): void + { + $client = $this->mockHttpClient([]); + try { + $client->getLastResponse(); + self::fail('Expected a missing last response to fail.'); + } catch (UnexpectedResponseException $exception) { + self::assertStringContainsString('No Fleetbase response', $exception->getMessage()); + } + + $response = \Mockery::mock(ResponseInterface::class); + $response->shouldReceive('getStatusCode')->andReturn(200); + $response->shouldReceive('getHeaders')->andReturn(['Content-Type' => ['application/json']]); + $response->shouldReceive('getBody')->andReturnUsing(static function () { + return (new HttpFactory())->createStream('{"wrapped":true}'); + }); + $response->shouldReceive('getProtocolVersion')->andReturn('1.1'); + $response->shouldReceive('getReasonPhrase')->andReturn('OK'); + $response->shouldReceive('getHeaderLine')->with('Content-Type')->andReturn('application/json'); + + $psrClient = new class ($response) implements ClientInterface { + private ResponseInterface $response; + + public function __construct(ResponseInterface $response) + { + $this->response = $response; + } + + public function sendRequest(RequestInterface $request): ResponseInterface + { + return $this->response; + } + }; + $wrapped = new HttpClient([ + 'publicKey' => 'test_public_key', + 'httpClient' => $psrClient, + 'requestFactory' => new HttpFactory(), + 'streamFactory' => new HttpFactory(), + ]); + $decoded = $wrapped->get('https://api.example.test/direct'); + self::assertIsObject($decoded); + self::assertTrue(get_object_vars($decoded)['wrapped'] ?? false); + self::assertSame(200, $wrapped->getLastResponse()->getStatusCode()); + self::assertSame($response, $wrapped->getLastPsrResponse()); + + $sanitize = new \ReflectionMethod($wrapped, 'sanitizeUrl'); + $sanitize->setAccessible(true); + self::assertSame('[invalid-url]', $sanitize->invoke($wrapped, ':')); + $credentialUrl = implode('', ['https://', 'user', ':', 'secret', '@example.test:8443/path?', 'api_key', '=', 'secret']); + self::assertSame('https://example.test:8443/path', $sanitize->invoke($wrapped, $credentialUrl)); + } + + public function testCoversRetryAndTransportFailureBoundaries(): void + { + $request = new Request('GET', 'https://api.example.test/v1/things'); + $timeout = new ConnectException('operation timed out', $request); + try { + $this->mockHttpClient([$timeout])->get('things'); + self::fail('Expected timeout mapping.'); + } catch (TimeoutException $exception) { + self::assertSame($timeout, $exception->getPrevious()); + } + + $delays = []; + $transportFailure = new class ('temporary') extends \RuntimeException implements ClientExceptionInterface { + }; + $queueClient = new class ([$transportFailure, new Response(200, ['Content-Type' => 'application/json'], '{}')]) implements ClientInterface { + /** @var array */ + private array $queue; + + /** @param array $queue */ + public function __construct(array $queue) + { + $this->queue = $queue; + } + + public function sendRequest(RequestInterface $request): ResponseInterface + { + $next = array_shift($this->queue); + if ($next instanceof ClientExceptionInterface) { + throw $next; + } + if (!$next instanceof ResponseInterface) { + throw new \RuntimeException('Test queue exhausted.'); + } + return $next; + } + }; + $retrying = new HttpClient([ + 'publicKey' => 'test_public_key', + 'httpClient' => $queueClient, + 'max_retries' => 1, + 'retry_delay_ms' => 0, + 'retry_sleep' => static function (int $milliseconds, int $attempt) use (&$delays): void { + $delays[] = [$milliseconds, $attempt]; + }, + ]); + self::assertIsObject($retrying->get('things')); + self::assertSame([[0, 1]], $delays); + + foreach ([ + ['max_retries' => -1, 'message' => 'retry count'], + ['max_retries' => 1, 'retry_delay_ms' => -1, 'message' => 'retry delay'], + ] as $options) { + $invalid = $this->mockHttpClient([new Response(503)]); + try { + $invalid->get('things', [], $options); + self::fail('Expected invalid retry configuration.'); + } catch (\InvalidArgumentException $exception) { + self::assertStringContainsString($options['message'], $exception->getMessage()); + } + } + } + + public function testCoversRetryAfterAndErrorPayloadVariants(): void + { + $delays = []; + $client = $this->mockHttpClient([ + new Response(503, ['Retry-After' => gmdate(DATE_RFC7231, time() - 60)]), + new Response(200, ['Content-Type' => 'application/json'], '{}'), + new Response(503, ['Retry-After' => 'not-a-date']), + new Response(200, ['Content-Type' => 'application/json'], '{}'), + new Response(400, ['Content-Type' => 'application/json', 'X-Request-Id' => 'first'], '{"error":"bad","error_code":"E_ALT","errors":{"field":"invalid"}}'), + new Response(400, ['Content-Type' => 'application/json', 'Request-Id' => 'second'], '{"detail":"detail only","errors":"invalid"}'), + new Response(400, ['Content-Type' => 'application/json'], '{}'), + new Response(400, ['Content-Type' => 'application/json'], '{"errors":["invalid"]}'), + ]); + $options = [ + 'max_retries' => 1, + 'retry_delay_ms' => 7, + 'retry_sleep' => static function (int $milliseconds) use (&$delays): void { + $delays[] = $milliseconds; + }, + ]; + $client->get('past-date', [], $options); + $client->get('bad-date', [], $options); + self::assertSame([0, 7], $delays); + + $expected = [ + ['bad', 'E_ALT', ['field' => 'invalid'], 'first'], + ['detail only', null, [], 'second'], + ['Fleetbase API request failed with HTTP 400.', null, [], null], + ['Fleetbase API request failed with HTTP 400.', null, [], null], + ]; + foreach ($expected as $index => $values) { + try { + $client->get('error-' . $index); + self::fail('Expected error response.'); + } catch (UnexpectedResponseException $exception) { + self::assertSame($values[0], $exception->getMessage()); + self::assertSame($values[1], $exception->getErrorCode()); + self::assertSame($values[2], $exception->getDetails()); + self::assertSame($values[3], $exception->getRequestId()); + } + } + } + + public function testCoversTransportOptionsDefaultSleepAndLegacyNullOptions(): void + { + $client = $this->mockHttpClient([ + new Response(200, ['Content-Type' => 'application/json'], '{}'), + new Response(503), + new Response(200, ['Content-Type' => 'application/json'], '{}'), + new Response(200, ['Content-Type' => 'application/json'], '{}'), + ]); + $client->get('transport-options', [], [ + 'timeout' => 1.5, + 'connect_timeout' => 0.5, + 'allow_redirects' => false, + 'verify' => false, + 'proxy' => 'http://proxy.example.test', + ]); + $transaction = $this->history[0] ?? null; + self::assertIsArray($transaction); + $options = $transaction['options'] ?? null; + self::assertIsArray($options); + self::assertSame(1.5, $options['timeout'] ?? null); + self::assertSame(0.5, $options['connect_timeout'] ?? null); + self::assertFalse($options['allow_redirects'] ?? true); + self::assertFalse($options['verify'] ?? true); + self::assertSame('http://proxy.example.test', $options['proxy'] ?? null); + self::assertFalse($options['http_errors'] ?? true); + + $client->get('short-sleep', [], ['max_retries' => 1, 'retry_delay_ms' => 1]); + self::assertIsObject((new \ReflectionMethod($client, 'get'))->invoke($client, 'null-options', [], null)); + + $filter = new \ReflectionMethod($client, 'stringKeyedArray'); + $filter->setAccessible(true); + self::assertSame(['kept' => true], $filter->invoke($client, [0 => false, 'kept' => true])); + } + + public function testCoversConstructorErrorAndNonJsonErrorBranches(): void + { + try { + new HttpClient(['publicKey' => 123]); + self::fail('Expected a non-string public key to fail configuration.'); + } catch (InvalidConfigurationException $exception) { + self::assertStringContainsString('API key', $exception->getMessage()); + } + + $client = $this->mockHttpClient([new Response(400)]); + try { + $client->get('empty-error'); + self::fail('Expected an empty HTTP error response.'); + } catch (UnexpectedResponseException $exception) { + self::assertSame('Fleetbase API request failed with HTTP 400.', $exception->getMessage()); + } + + $sanitize = new \ReflectionMethod($client, 'sanitizeUrl'); + $sanitize->setAccessible(true); + self::assertSame('/relative/path', $sanitize->invoke($client, '/relative/path?api_key=secret')); + } + + private function requestAt(int $index): RequestInterface + { + $transaction = $this->history[$index] ?? null; + self::assertIsArray($transaction); + $request = $transaction['request'] ?? null; + self::assertInstanceOf(RequestInterface::class, $request); + return $request; + } + +} diff --git a/tests/ResourceServiceTest.php b/tests/ResourceServiceTest.php new file mode 100644 index 0000000..2718e0a --- /dev/null +++ b/tests/ResourceServiceTest.php @@ -0,0 +1,377 @@ +mockHttpClient([ + $this->jsonResponse(['id' => 'place_1', 'name' => 'Created']), + $this->jsonResponse(['id' => 'place_1', 'name' => 'Saved']), + $this->jsonResponse(['id' => 'place_1', 'name' => 'Reloaded']), + $this->jsonResponse([]), + ]); + $service = new Service('Place', $client); + $resource = new Place([], $service); + $states = []; + $consumerResponse = null; + + $created = $resource->create(['name' => 'Created'], [ + 'onBefore' => function () use ($resource, &$states): void { + $states[] = $resource->__get('isSaving'); + }, + 'onAfter' => function ($response) use (&$consumerResponse): void { + $consumerResponse = $response; + }, + ]); + self::assertInstanceOf(Place::class, $created); + self::assertSame('place_1', $resource->getAttribute('id')); + self::assertSame([true], $states); + self::assertIsObject($consumerResponse); + self::assertFalse($resource->__get('isSaving')); + + $resource->__set('name', 'Changed'); + self::assertTrue(isset($resource->name)); + self::assertTrue($resource->isDirty(null)); + self::assertTrue($resource->isDirty('name')); + self::assertTrue($resource->isDirty(['missing', 'name'])); + self::assertSame(['name' => 'Changed'], $resource->getDirtyAttributes()); + self::assertSame(['old' => 'Created', 'new' => 'Changed'], $resource->getChanges()['name']); + + $saved = $resource->save(); + self::assertInstanceOf(Place::class, $saved); + self::assertSame('Saved', $resource->__get('name')); + self::assertFalse($resource->isDirty(null)); + self::assertSame($resource, $resource->reload()); + self::assertSame('Reloaded', $resource->__get('name')); + self::assertFalse($resource->__get('isReloading')); + + $destroyed = $resource->destroy(); + self::assertInstanceOf(Place::class, $destroyed); + self::assertTrue($resource->__get('isDestroyed')); + self::assertSame('place_1', $resource->__get('id')); + self::assertFalse($resource->__get('isDestroying')); + self::assertSame($service, $resource->getService()); + + $updateTransaction = $this->history[1] ?? null; + self::assertIsArray($updateTransaction); + $updateRequest = $updateTransaction['request'] ?? null; + self::assertInstanceOf(\Psr\Http\Message\RequestInterface::class, $updateRequest); + self::assertSame('{"name":"Changed"}', (string) $updateRequest->getBody()); + } + + public function testResourceAttributeAndSerializationBoundaries(): void + { + $nested = new Resource(['id' => 'nested']); + $serializable = new class () implements JsonSerializable { + /** @return array */ + public function jsonSerialize(): array + { + return ['serialized' => 'yes']; + } + }; + $resource = new Resource([ + 'id' => 'resource_1', + 'empty' => '', + 'null' => null, + 'nested' => $nested, + 'list' => [$nested, $serializable], + ]); + + self::assertSame('resource_1', $resource->getAttribute('id')); + self::assertSame(['id' => 'resource_1'], $resource->getAttribute(['id'])); + self::assertSame('default', (new \ReflectionMethod($resource, 'getAttribute'))->invoke($resource, 123, 'default')); + self::assertTrue($resource->hasAttribute(['id', 'empty'])); + self::assertFalse((new \ReflectionMethod($resource, 'hasAttribute'))->invoke($resource, ['id', 2])); + self::assertTrue($resource->isAttributeFilled('id')); + self::assertFalse($resource->isAttributeFilled(['id', 'empty'])); + self::assertFalse($resource->isAttributeFilled('missing')); + self::assertSame(['id' => 'resource_1'], $resource->getAttributes(['id'])); + self::assertSame(['nested' => ['id' => 'nested']], $resource->getAttributes(['nested'])); + self::assertSame($resource->getAttributes(), $resource->getAttributes(null)); + self::assertSame([ + 'id' => 'resource_1', + 'empty' => '', + 'null' => null, + 'nested' => ['id' => 'nested'], + 'list' => [['id' => 'nested'], ['serialized' => 'yes']], + ], $resource->toArray()); + self::assertSame($resource->toArray(), $resource->jsonSerialize()); + + self::assertTrue($resource->offsetExists('id')); + self::assertFalse($resource->offsetExists(0)); + self::assertSame('resource_1', $resource->offsetGet('id')); + self::assertNull($resource->offsetGet(0)); + $resource->offsetSet('new', 'value'); + self::assertSame('value', $resource->getAttribute('new')); + $resource->offsetUnset('new'); + self::assertFalse(isset($resource->new)); + $resource->offsetUnset(0); + + try { + $resource->offsetSet('', 'invalid'); + self::fail('Expected an invalid resource offset.'); + } catch (\InvalidArgumentException $exception) { + self::assertStringContainsString('non-empty', $exception->getMessage()); + } + } + + public function testResourceRequiresAnAttachedServiceAndIdentifier(): void + { + $resource = new Resource(); + foreach (['save', 'reload', 'destroy'] as $method) { + try { + $resource->{$method}(); + self::fail('Expected lifecycle method to reject an unattached resource.'); + } catch (\LogicException $exception) { + self::assertStringContainsString('service', $exception->getMessage()); + } + } + + $attached = new Resource([], new Service('Unknown', $this->mockHttpClient([]))); + try { + $attached->reload(); + self::fail('Expected reload to require an ID.'); + } catch (\LogicException $exception) { + self::assertStringContainsString('ID', $exception->getMessage()); + } + } + + public function testServiceHydratesListShapesFallbacksAndActions(): void + { + $client = $this->mockHttpClient([ + $this->jsonResponse(['data' => [['id' => 'one']], 'meta' => ['page' => 1], 'links' => ['next' => null]]), + $this->jsonResponse(['results' => [['id' => 'two']]]), + $this->jsonResponse(['items' => [['id' => 'three']]]), + $this->jsonResponse(['unrecognized' => true]), + $this->jsonResponse(['id' => 'fallback']), + new Response(200, ['Content-Type' => 'application/json'], '"scalar"'), + $this->jsonResponse(['ok' => true]), + ]); + $places = new Service('Place', $client); + $all = $places->findAll(); + $queried = $places->query(); + $items = $places->query(); + $unrecognized = $places->findAll(); + self::assertIsArray($all); + self::assertIsArray($queried); + self::assertIsArray($items); + self::assertContainsOnlyInstancesOf(Place::class, $all); + self::assertContainsOnlyInstancesOf(Place::class, $queried); + self::assertContainsOnlyInstancesOf(Place::class, $items); + self::assertSame('one', $all[0]->getAttribute('id')); + self::assertSame('two', $queried[0]->getAttribute('id')); + self::assertSame('three', $items[0]->getAttribute('id')); + self::assertIsObject($unrecognized); + self::assertTrue(get_object_vars($unrecognized)['unrecognized'] ?? false); + + $fallback = (new Service('MissingResource', $client))->findRecord('fallback'); + self::assertSame(Resource::class, get_class($fallback)); + try { + $places->findRecord('scalar'); + self::fail('Expected scalar resource payload to fail.'); + } catch (\UnexpectedValueException $exception) { + self::assertStringContainsString('objects or arrays', $exception->getMessage()); + } + $action = $places->action('POST', 'custom', ['value' => true]); + self::assertIsObject($action); + self::assertSame(true, get_object_vars($action)['ok'] ?? null); + self::assertSame('places/id%20with%20space/child', $places->uriForResource('id with space', 'child')); + self::assertSame('places', $places->uri('')); + self::assertSame([], $places->getOptions()); + self::assertSame($client, $places->getClient()); + } + + public function testResourceCoversSaveDefaultsValidationAndFailureState(): void + { + $client = $this->mockHttpClient([ + $this->jsonResponse(['id' => 'new_1', 'name' => 'New']), + $this->jsonResponse(['id' => 'same_1', 'name' => 'Same']), + $this->jsonResponse(['id' => 'same_1', 'name' => 'Same', 'deleted' => false]), + new \RuntimeException('save failed'), + ]); + $service = new Service('Place', $client); + + $new = new Place(['name' => 'New'], $service); + self::assertInstanceOf(Place::class, $new->save(null)); + self::assertSame('new_1', $new->getAttribute('id')); + + $same = new Place(['id' => 'same_1', 'name' => 'Same'], $service); + self::assertInstanceOf(Place::class, $same->save()); + self::assertSame('{"id":"same_1","name":"Same"}', (string) $this->requestAt(1)->getBody()); + self::assertInstanceOf(Place::class, $same->destroy()); + self::assertFalse($same->__get('isDestroyed')); + + try { + $same->update(['name' => 'Failure']); + self::fail('Expected update failure.'); + } catch (\RuntimeException $exception) { + self::assertSame('save failed', $exception->getMessage()); + self::assertFalse($same->__get('isSaving')); + } + + foreach (['create', 'update', 'destroy'] as $method) { + try { + $arguments = $method === 'update' ? [[], 'invalid'] : ($method === 'create' ? [[], 'invalid'] : ['invalid']); + (new \ReflectionMethod($same, $method))->invokeArgs($same, $arguments); + self::fail('Expected invalid resource options.'); + } catch (\InvalidArgumentException $exception) { + self::assertStringContainsString('options', $exception->getMessage()); + } + } + + $same->setAttribute('name', 'Changed')->setAttribute('name', 'Same'); + self::assertFalse($same->isDirty('name')); + self::assertFalse((new \ReflectionMethod($same, 'isDirty'))->invoke($same, 42)); + self::assertFalse((new \ReflectionMethod($same, 'isDirty'))->invoke($same, ['missing', 42])); + self::assertFalse((new \ReflectionMethod($same, 'isAttributeFilled'))->invoke($same, 42)); + + $boundaryClient = $this->mockHttpClient([ + $this->jsonResponse(['id' => 'boundary']), + $this->jsonResponse(['id' => 'boundary']), + ]); + $boundary = new Place(['id' => 'boundary'], new Service('Place', $boundaryClient)); + self::assertInstanceOf(Place::class, (new \ReflectionMethod($boundary, 'create'))->invoke($boundary, 'invalid')); + self::assertInstanceOf(Place::class, (new \ReflectionMethod($boundary, 'update'))->invoke($boundary, 'invalid')); + } + + public function testServiceCoversDirectCollectionsEnvelopesDeletionAndEndpointBoundaries(): void + { + $client = $this->mockHttpClient([ + $this->jsonResponse([['id' => 'direct']]), + $this->jsonResponse(['data' => ['id' => 'enveloped']]), + $this->jsonResponse(['id' => 'deleted']), + $this->jsonResponse(['ok' => true]), + $this->jsonResponse(['ok' => true]), + ]); + $service = new class ('Place', $client, ['namespace' => '/custom/']) extends Service { + /** + * @param array $parameters + * @param array $options + * @return mixed + */ + public function callEndpoint(string $method, string $template, array $parameters = [], array $options = []) + { + return $this->endpoint($method, $template, $parameters, $options); + } + }; + + $all = $service->findAll(); + self::assertIsArray($all); + self::assertCount(1, $all); + self::assertSame('enveloped', $service->findRecord('enveloped')->getAttribute('id')); + self::assertSame('deleted', $service->destroy(new Place(['id' => 'deleted']))->getAttribute('id')); + foreach ([null, '', 123, new Place()] as $invalid) { + try { + (new \ReflectionMethod($service, 'destroy'))->invoke($service, $invalid); + self::fail('Expected deletion to require an ID.'); + } catch (\InvalidArgumentException $exception) { + self::assertStringContainsString('ID', $exception->getMessage()); + } + } + + $result = $service->callEndpoint('GET', '{{base_url}}/{{namespace}}/places/{{place}}?existing=yes', [ + 'place' => 'place one', + 'ignored' => 'value', + ], ['query' => ['page' => 2]]); + self::assertIsObject($result); + self::assertTrue(get_object_vars($result)['ok'] ?? false); + $service->callEndpoint('POST', 'places/:place', [ + 'place' => 'place-two', + 'body' => ['name' => 'Body', 0 => 'ignored'], + ], ['query' => []]); + self::assertSame('existing=yes&page=2&ignored=value', $this->requestAt(3)->getUri()->getQuery()); + self::assertSame('{"name":"Body"}', (string) $this->requestAt(4)->getBody()); + + try { + $service->callEndpoint('GET', 'places/{{missing}}'); + self::fail('Expected a required endpoint parameter.'); + } catch (\InvalidArgumentException $exception) { + self::assertStringContainsString('missing', $exception->getMessage()); + } + } + + public function testReloadRejectsUnexpectedServiceResultAndRestoresState(): void + { + $service = new class ('Place', $this->mockHttpClient([])) extends Service { + /** @return mixed */ + public function findRecord(string $id, array $options = []) + { + return (object) ['not' => 'a resource']; + } + }; + $resource = new Place(['id' => 'place_1'], $service); + try { + $resource->reload(); + self::fail('Expected invalid reload result.'); + } catch (\UnexpectedValueException $exception) { + self::assertStringContainsString('did not return a resource', $exception->getMessage()); + self::assertFalse($resource->__get('isReloading')); + } + } + + public function testFindAllAndQueryPreserveUnrecognizedRawResponses(): void + { + $client = $this->mockHttpClient([ + $this->jsonResponse(['unrecognized' => 'all']), + $this->jsonResponse(['unrecognized' => 'query']), + ]); + $service = new Service('Place', $client); + + $all = $service->findAll(); + $query = $service->query(['filter' => 'active']); + self::assertIsObject($all); + self::assertIsObject($query); + self::assertSame('all', get_object_vars($all)['unrecognized'] ?? null); + self::assertSame('query', get_object_vars($query)['unrecognized'] ?? null); + } + + public function testPreservesLegacyResourceConstructorAliases(): void + { + $classes = [ + \Fleetbase\Sdk\Resources\Contact::class, + \Fleetbase\Sdk\Resources\Driver::class, + \Fleetbase\Sdk\Resources\Entity::class, + \Fleetbase\Sdk\Resources\Payload::class, + \Fleetbase\Sdk\Resources\Place::class, + \Fleetbase\Sdk\Resources\ServiceArea::class, + \Fleetbase\Sdk\Resources\ServiceQuote::class, + \Fleetbase\Sdk\Resources\ServiceRate::class, + \Fleetbase\Sdk\Resources\TrackingStatus::class, + \Fleetbase\Sdk\Resources\Vehicle::class, + \Fleetbase\Sdk\Resources\Vendor::class, + \Fleetbase\Sdk\Resources\Waypoint::class, + \Fleetbase\Sdk\Resources\Zone::class, + ]; + + foreach ($classes as $class) { + $resource = new $class(); + $resource->__constructor(['id' => 'legacy']); + self::assertSame('legacy', $resource->getAttribute('id')); + } + } + + /** @param mixed $data */ + private function jsonResponse($data, int $status = 200): Response + { + return new Response($status, ['Content-Type' => 'application/json'], json_encode($data, JSON_THROW_ON_ERROR)); + } + + private function requestAt(int $index): \Psr\Http\Message\RequestInterface + { + $transaction = $this->history[$index] ?? null; + self::assertIsArray($transaction); + $request = $transaction['request'] ?? null; + self::assertInstanceOf(\Psr\Http\Message\RequestInterface::class, $request); + return $request; + } +} diff --git a/tests/TestCase.php b/tests/TestCase.php index f4a6ad2..0e909be 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -4,20 +4,46 @@ namespace Fleetbase\Sdk\Test; +use Fleetbase\Sdk\HttpClient; +use GuzzleHttp\Client; +use GuzzleHttp\Handler\MockHandler; +use GuzzleHttp\HandlerStack; +use GuzzleHttp\Middleware; use Mockery\Adapter\Phpunit\MockeryTestCase; -use Dotenv\Dotenv; +use Psr\Http\Message\RequestInterface; +use Psr\Http\Message\ResponseInterface; +use Throwable; -class TestCase extends MockeryTestCase +abstract class TestCase extends MockeryTestCase { - public function __construct() - { - parent::__construct(); - static::__loadEnv(); - } + /** @var array */ + protected array $history = []; - private static function __loadEnv() + /** + * @param array $responses + */ + protected function mockHttpClient(array $responses): HttpClient { - $dotenv = Dotenv::createImmutable(dirname(__DIR__), '.env.test'); - return $dotenv->load(); + /** @var array}> $history */ + $history = []; + $handler = HandlerStack::create(new MockHandler($responses)); + $handler->push(Middleware::history($history)); + if (!is_array($history)) { + throw new \LogicException('Guzzle history middleware did not preserve its array container.'); + } + $guzzle = new Client([ + 'base_uri' => 'https://api.example.test/v1/', + 'handler' => $handler, + ]); + + $client = new HttpClient([ + 'host' => 'https://api.example.test', + 'namespace' => 'v1', + 'publicKey' => 'test_public_key', + 'httpClient' => $guzzle, + ]); + $this->history = & $history; + + return $client; } } diff --git a/tools/capture-terminating-coverage-child.php b/tools/capture-terminating-coverage-child.php new file mode 100644 index 0000000..bdce375 --- /dev/null +++ b/tools/capture-terminating-coverage-child.php @@ -0,0 +1,31 @@ + $baselineClass) { + if (!isset($current['classes'][$className])) { + $errors[] = sprintf('Removed class %s', $className); + continue; + } + + $currentClass = $current['classes'][$className]; + if (($baselineClass['final'] ?? false) === false && ($currentClass['final'] ?? false) === true) { + $errors[] = sprintf('Class %s became final', $className); + } + if (($baselineClass['parent'] ?? null) !== ($currentClass['parent'] ?? null)) { + $errors[] = sprintf('Class %s changed parent', $className); + } + + foreach ($baselineClass['interfaces'] ?? [] as $interface) { + if (!in_array($interface, $currentClass['interfaces'] ?? [], true)) { + $errors[] = sprintf('Class %s removed interface %s', $className, $interface); + } + } + + foreach ($baselineClass['constants'] ?? [] as $constant => $value) { + if (!array_key_exists($constant, $currentClass['constants'] ?? [])) { + $errors[] = sprintf('Class %s removed constant %s', $className, $constant); + } elseif (($currentClass['constants'][$constant] ?? null) !== $value) { + $errors[] = sprintf('Class %s changed constant %s', $className, $constant); + } + } + + compareMembers($errors, $className, 'property', $baselineClass['properties'] ?? [], $currentClass['properties'] ?? []); + compareMethods($errors, $className, $baselineClass['methods'] ?? [], $currentClass['methods'] ?? []); +} + +foreach ($baseline['runtime_properties'] ?? [] as $className => $properties) { + $currentProperties = $current['runtime_properties'][$className] ?? []; + foreach ($properties as $property) { + if (!in_array($property, $currentProperties, true)) { + $errors[] = sprintf('Class %s removed runtime property %s', $className, $property); + } + } +} + +if ($errors !== []) { + fwrite(STDERR, "Backwards-compatibility check failed:\n- " . implode("\n- ", $errors) . "\n"); + exit(1); +} + +printf( + "API compatibility passed: %s is compatible with %s.\n", + $current['release'] ?? $options['current'], + $baseline['release'] ?? $options['baseline'] +); + +/** + * @return array + */ +function readSnapshot(string $path): array +{ + $contents = file_get_contents($path); + if (!is_string($contents)) { + fwrite(STDERR, sprintf("Unable to read snapshot: %s\n", $path)); + exit(2); + } + + $snapshot = json_decode($contents, true); + if (!is_array($snapshot) || !isset($snapshot['classes'])) { + fwrite(STDERR, sprintf("Invalid snapshot: %s\n", $path)); + exit(2); + } + + return $snapshot; +} + +/** + * @param array $errors + * @param array> $baselineMembers + * @param array> $currentMembers + */ +function compareMembers(array &$errors, string $className, string $kind, array $baselineMembers, array $currentMembers): void +{ + $currentByName = indexByName($currentMembers); + foreach ($baselineMembers as $baselineMember) { + $name = (string) $baselineMember['name']; + if (!isset($currentByName[$name])) { + $errors[] = sprintf('Class %s removed %s %s', $className, $kind, $name); + continue; + } + + $currentMember = $currentByName[$name]; + if (($baselineMember['visibility'] ?? 'public') === 'public' && ($currentMember['visibility'] ?? 'public') !== 'public') { + $errors[] = sprintf('Class %s narrowed visibility of %s %s', $className, $kind, $name); + } + if (($baselineMember['static'] ?? false) !== ($currentMember['static'] ?? false)) { + $errors[] = sprintf('Class %s changed static flag of %s %s', $className, $kind, $name); + } + if (($baselineMember['type'] ?? null) !== ($currentMember['type'] ?? null)) { + $errors[] = sprintf('Class %s changed type of %s %s', $className, $kind, $name); + } + } +} + +/** + * @param array $errors + * @param array> $baselineMethods + * @param array> $currentMethods + */ +function compareMethods(array &$errors, string $className, array $baselineMethods, array $currentMethods): void +{ + $currentByName = indexByName($currentMethods); + foreach ($baselineMethods as $baselineMethod) { + $name = (string) $baselineMethod['name']; + if (!isset($currentByName[$name])) { + $errors[] = sprintf('Class %s removed method %s', $className, $name); + continue; + } + + $currentMethod = $currentByName[$name]; + if (($baselineMethod['visibility'] ?? 'public') === 'public' && ($currentMethod['visibility'] ?? 'public') !== 'public') { + $errors[] = sprintf('Class %s narrowed visibility of method %s', $className, $name); + } + if (($baselineMethod['static'] ?? false) !== ($currentMethod['static'] ?? false)) { + $errors[] = sprintf('Class %s changed static flag of method %s', $className, $name); + } + if (($baselineMethod['return_type'] ?? null) !== ($currentMethod['return_type'] ?? null)) { + $errors[] = sprintf('Class %s changed return type of method %s', $className, $name); + } + + $baselineParameters = $baselineMethod['parameters'] ?? []; + $currentParameters = $currentMethod['parameters'] ?? []; + if (count($currentParameters) < count($baselineParameters)) { + $errors[] = sprintf('Class %s removed parameters from method %s', $className, $name); + continue; + } + + foreach ($baselineParameters as $index => $baselineParameter) { + $currentParameter = $currentParameters[$index]; + if (($baselineParameter['name'] ?? null) !== ($currentParameter['name'] ?? null) + && !hasCompatibleNamedParameter($baselineParameter, $currentParameters)) { + $errors[] = sprintf('Class %s removed named parameter %s from method %s', $className, $baselineParameter['name'], $name); + } + foreach (['type', 'by_reference', 'variadic'] as $field) { + if (($baselineParameter[$field] ?? null) !== ($currentParameter[$field] ?? null)) { + $errors[] = sprintf('Class %s changed parameter %d %s of method %s', $className, $index + 1, $field, $name); + } + } + if (($baselineParameter['optional'] ?? false) !== ($currentParameter['optional'] ?? false)) { + $errors[] = sprintf('Class %s changed optionality of parameter %d on method %s', $className, $index + 1, $name); + } + if (array_key_exists('default', $baselineParameter) + && (!array_key_exists('default', $currentParameter) || $baselineParameter['default'] !== $currentParameter['default'])) { + $errors[] = sprintf('Class %s changed default of parameter %d on method %s', $className, $index + 1, $name); + } + } + + foreach (array_slice($currentParameters, count($baselineParameters)) as $newParameter) { + if (($newParameter['optional'] ?? false) !== true && ($newParameter['variadic'] ?? false) !== true) { + $errors[] = sprintf('Class %s added required parameter %s to method %s', $className, $newParameter['name'], $name); + } + } + } +} + +/** + * PHP 8 named calls remain compatible when an optional parameter moves to a + * later optional position with the same name and declaration. + * + * @param array $baselineParameter + * @param array> $currentParameters + */ +function hasCompatibleNamedParameter(array $baselineParameter, array $currentParameters): bool +{ + foreach ($currentParameters as $currentParameter) { + if (($currentParameter['name'] ?? null) !== ($baselineParameter['name'] ?? null)) { + continue; + } + + foreach (['type', 'by_reference', 'variadic', 'optional'] as $field) { + if (($currentParameter[$field] ?? null) !== ($baselineParameter[$field] ?? null)) { + return false; + } + } + + return !array_key_exists('default', $baselineParameter) + || (array_key_exists('default', $currentParameter) && $currentParameter['default'] === $baselineParameter['default']); + } + + return false; +} + +/** + * @param array> $members + * @return array> + */ +function indexByName(array $members): array +{ + $indexed = []; + foreach ($members as $member) { + $indexed[(string) $member['name']] = $member; + } + + return $indexed; +} diff --git a/tools/check-contract-drift.php b/tools/check-contract-drift.php new file mode 100644 index 0000000..bb50466 --- /dev/null +++ b/tools/check-contract-drift.php @@ -0,0 +1,119 @@ + $added, 'Removed' => $removed, 'Changed' => $changed] as $heading => $ids) { + if ($ids === []) { + continue; + } + $lines[] = ''; + $lines[] = '## ' . $heading; + $lines[] = ''; + foreach ($ids as $id) { + $lines[] = '- `' . $id . '`'; + } +} + +$directory = dirname($outputPath); +if (!is_dir($directory) && !mkdir($directory, 0777, true) && !is_dir($directory)) { + fail('Unable to create the contract drift report directory.'); +} +if (file_put_contents($outputPath, implode("\n", $lines) . "\n") === false) { + fail('Unable to write the contract drift report.'); +} + +if ($added !== [] || $removed !== [] || $changed !== []) { + fail(sprintf('Postman contract drift detected: %d added, %d removed, %d changed.', count($added), count($removed), count($changed))); +} + +printf("No Postman contract drift across %d requests.\n", count($locked)); + +/** @return array> */ +function requests(string $path): array +{ + $contents = file_get_contents($path); + $document = is_string($contents) ? json_decode($contents, true) : null; + if (!is_array($document) || !is_array($document['requests'] ?? null)) { + fail(sprintf('Unable to read contract requests from %s.', $path)); + } + $indexed = []; + foreach ($document['requests'] as $request) { + if (!is_array($request) || !is_string($request['id'] ?? null)) { + fail(sprintf('Contract request in %s has no ID.', $path)); + } + $indexed[$request['id']] = $request; + } + ksort($indexed); + return $indexed; +} + +/** @param array $request */ +function canonical(array $request): string +{ + $contract = []; + foreach (['collection', 'group', 'name', 'method', 'url', 'source', 'authentication', 'response_fixtures'] as $field) { + $contract[$field] = $request[$field] ?? null; + } + $contract['request_fixture'] = normalizedFixture($request['request_fixture'] ?? null); + $json = json_encode($contract, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); + if (!is_string($json)) { + fail('Unable to canonicalize a contract request.'); + } + return $json; +} + +/** @param mixed $value @return mixed */ +function normalizedFixture($value) +{ + if (is_array($value)) { + foreach ($value as $key => $item) { + $value[$key] = normalizedFixture($item); + } + return $value; + } + if (is_string($value) && (substr($value, -8) === '-fixture' || preg_match('/^\{\{[^}]+\}\}$/', $value) === 1)) { + return ''; + } + return $value; +} + +function fail(string $message): void +{ + fwrite(STDERR, $message . "\n"); + exit(1); +} diff --git a/tools/check-contract-manifest.php b/tools/check-contract-manifest.php new file mode 100644 index 0000000..0fd46cb --- /dev/null +++ b/tools/check-contract-manifest.php @@ -0,0 +1,145 @@ + 0, 'exceptions' => 0, 'unmapped' => 0]; +foreach ($requests as $index => $request) { + foreach (['id', 'collection', 'group', 'name', 'method', 'url', 'source', 'status'] as $field) { + if (!isset($request[$field]) || !is_string($request[$field]) || $request[$field] === '') { + $errors[] = sprintf('Request %d has invalid %s', $index + 1, $field); + } + } + + $id = $request['id'] ?? ''; + $source = $request['source'] ?? ''; + if (isset($ids[$id])) { + $errors[] = sprintf('Duplicate request id: %s', $id); + } + if (isset($sources[$source])) { + $errors[] = sprintf('Duplicate request source: %s', $source); + } + $ids[$id] = true; + $sources[$source] = true; + + $status = $request['status'] ?? ''; + if ($status === 'complete') { + ++$counts['mapped']; + if (!is_string($request['implementation'] ?? null) || $request['implementation'] === '') { + $errors[] = sprintf('Complete request %s has no implementation', $id); + } else { + $implementation = explode('::', $request['implementation'], 2); + $class = $implementation[0] ?? ''; + $method = $implementation[1] ?? ''; + if (!class_exists($class) || !method_exists($class, $method)) { + $errors[] = sprintf('Complete request %s points to missing implementation %s', $id, $request['implementation']); + } + } + if (!is_array($request['tests'] ?? null) || $request['tests'] === []) { + $errors[] = sprintf('Complete request %s has no tests', $id); + } else { + foreach ($request['tests'] as $test) { + if (!is_string($test)) { + $errors[] = sprintf('Complete request %s has an invalid test reference', $id); + continue; + } + $testReference = explode('::', $test, 2); + $testFile = $testReference[0] ?? ''; + $testMethod = $testReference[1] ?? ''; + $testContents = is_file($testFile) ? file_get_contents($testFile) : false; + if (!is_string($testContents) || !preg_match('/function\s+' . preg_quote($testMethod, '/') . '\s*\(/', $testContents)) { + $errors[] = sprintf('Complete request %s points to missing test %s', $id, $test); + } + } + } + } elseif ($status === 'exception') { + ++$counts['exceptions']; + if (!is_string($request['exception'] ?? null) || $request['exception'] === '') { + $errors[] = sprintf('Exception request %s has no rationale', $id); + } + } elseif ($status === 'unmapped' || $status === 'partial') { + ++$counts['unmapped']; + } else { + $errors[] = sprintf('Request %s has unsupported status %s', $id, (string) $status); + } +} + +foreach ($counts as $field => $value) { + if (($manifest['summary'][$field] ?? null) !== $value) { + $errors[] = sprintf('Summary %s is %s, calculated %d', $field, (string) ($manifest['summary'][$field] ?? 'missing'), $value); + } +} + +if (array_key_exists('require-complete', $options) && $counts['unmapped'] !== 0) { + $errors[] = sprintf('%d requests remain unmapped or partial', $counts['unmapped']); +} + +if ($errors !== []) { + fwrite(STDERR, "Contract manifest check failed:\n- " . implode("\n- ", $errors) . "\n"); + exit(1); +} + +printf( + "Contract manifest passed: %d requests, %d mapped, %d exceptions, %d unmapped.\n", + count($requests), + $counts['mapped'], + $counts['exceptions'], + $counts['unmapped'] +); + +/** + * @return array + */ +function readJson(string $path): array +{ + $contents = file_get_contents($path); + if (!is_string($contents)) { + fwrite(STDERR, sprintf("Unable to read JSON: %s\n", $path)); + exit(2); + } + + $data = json_decode($contents, true); + if (!is_array($data)) { + fwrite(STDERR, sprintf("Invalid JSON: %s\n", $path)); + exit(2); + } + + return $data; +} diff --git a/tools/check-coverage.php b/tools/check-coverage.php new file mode 100644 index 0000000..5133571 --- /dev/null +++ b/tools/check-coverage.php @@ -0,0 +1,29 @@ +isFile() || $file->getExtension() !== 'php') { + continue; + } + if (strpos((string) file_get_contents($file->getPathname()), 'AGPL-3.0-or-later') === false) { + fail(sprintf('Missing AGPL-3.0-or-later notice: %s', $file->getPathname())); + } +} + +foreach (['README.md', 'CHANGELOG.md', 'docs/migration-guide.md'] as $relativePath) { + if (strpos((string) file_get_contents($root . '/' . $relativePath), 'AGPL-3.0-or-later') === false) { + fail(sprintf('Missing release license notice: %s', $relativePath)); + } +} + +fwrite(STDOUT, "AGPL-3.0-or-later metadata and source notices verified.\n"); + +function fail(string $message): void +{ + fwrite(STDERR, $message . "\n"); + exit(1); +} diff --git a/tools/check-release-archive.php b/tools/check-release-archive.php new file mode 100644 index 0000000..1f34acb --- /dev/null +++ b/tools/check-release-archive.php @@ -0,0 +1,53 @@ +'); +} + +$archive = new PharData($path); +$entries = []; +foreach (new RecursiveIteratorIterator($archive) as $file) { + if ($file instanceof SplFileInfo && $file->isFile()) { + $entry = preg_replace('#^phar://.+\.tar\.gz/#', '', $file->getPathname()); + if (!is_string($entry)) { + fail('Unable to normalize a release archive entry.'); + } + $entries[] = $entry; + } +} + +$forbidden = [ + '#/(?:vendor|build|tests|tools|docs|contracts|fixtures)/#', + '#/(?:\.env(?:\..*)?|\.phpunit\.result\.cache|composer\.lock)$#', + '#/(?:\.github|\.git)(?:/|$)#', + '#(?:^|/)Users/[^/]+/#', +]; +foreach ($entries as $entry) { + foreach ($forbidden as $pattern) { + if (preg_match($pattern, '/' . $entry) === 1) { + fail(sprintf('Forbidden release archive entry: %s', $entry)); + } + } +} + +foreach (['LICENSE', 'README.md', 'composer.json', 'src/Fleetbase.php'] as $required) { + $matches = array_filter($entries, static function (string $entry) use ($required): bool { + return substr($entry, -strlen('/' . $required)) === '/' . $required; + }); + if (count($matches) !== 1) { + fail(sprintf('Release archive must contain exactly one %s.', $required)); + } +} + +printf("Release archive verified: %d files, no forbidden development state.\n", count($entries)); + +function fail(string $message): void +{ + fwrite(STDERR, $message . "\n"); + exit(1); +} diff --git a/tools/check-release-version.php b/tools/check-release-version.php new file mode 100644 index 0000000..76e7401 --- /dev/null +++ b/tools/check-release-version.php @@ -0,0 +1,64 @@ +'); +} + +$findings = []; +foreach ($sarif['runs'] as $run) { + if (!is_array($run)) { + continue; + } + foreach (is_array($run['results'] ?? null) ? $run['results'] : [] as $result) { + if (!is_array($result)) { + continue; + } + $level = is_string($result['level'] ?? null) ? $result['level'] : 'warning'; + if (!in_array($level, ['warning', 'error'], true)) { + continue; + } + $rule = is_string($result['ruleId'] ?? null) ? $result['ruleId'] : '[unknown rule]'; + $message = $result['message']['text'] ?? '[no message]'; + $findings[] = sprintf('%s (%s): %s', $rule, $level, is_string($message) ? $message : '[no message]'); + } +} + +if ($findings !== []) { + fail("CodeQL reported actionable findings:\n- " . implode("\n- ", $findings)); +} + +fwrite(STDOUT, "CodeQL SARIF contains no warning- or error-level findings.\n"); + +function fail(string $message): void +{ + fwrite(STDERR, $message . "\n"); + exit(1); +} diff --git a/tools/configure-consumer-fixture.php b/tools/configure-consumer-fixture.php new file mode 100644 index 0000000..d25a66a --- /dev/null +++ b/tools/configure-consumer-fixture.php @@ -0,0 +1,40 @@ + '); +} + +$composerPath = $fixtureDirectory . '/composer.json'; +$contents = file_get_contents($composerPath); +$composer = is_string($contents) ? json_decode($contents, true) : null; +if (!is_array($composer)) { + fail('The consumer fixture has no valid composer.json.'); +} + +$composer['repositories'] = [[ + 'type' => 'path', + 'url' => $sourceDirectory, + 'options' => [ + 'symlink' => false, + 'versions' => ['fleetbase/fleetbase-php' => '1.1.0-dev'], + ], +]]; + +$json = json_encode($composer, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); +if (!is_string($json) || file_put_contents($composerPath, $json . "\n") === false) { + fail('Unable to configure the archive-backed consumer fixture.'); +} + +printf("Configured %s to install SDK source from %s.\n", basename($fixtureDirectory), $sourceDirectory); + +function fail(string $message): void +{ + fwrite(STDERR, $message . "\n"); + exit(1); +} diff --git a/tools/generate-api-coverage.php b/tools/generate-api-coverage.php new file mode 100644 index 0000000..3781ec0 --- /dev/null +++ b/tools/generate-api-coverage.php @@ -0,0 +1,110 @@ +%s->%s(\n %s,\n %s\n);", + $property, + $method, + exported($parameters, 1), + exported($callOptions, 1) + ); + + $lines[] = ''; + $lines[] = '### ' . requiredString($request, 'name'); + $description = $request['description'] ?? null; + if (is_string($description) && trim($description) !== '') { + $lines[] = ''; + $normalizedDescription = trim(preg_replace('/\s+/', ' ', $description) ?? $description); + $lines[] = str_replace('FleetOps', 'Fleet-Ops', $normalizedDescription); + } + $lines[] = ''; + $lines[] = sprintf('`%s %s`', requiredString($request, 'method'), requiredString($request, 'url')); + $lines[] = ''; + $lines[] = '```php'; + $lines[] = $call; + $lines[] = '```'; +} + +$directory = dirname($outputPath); +if (!is_dir($directory) && !mkdir($directory, 0777, true) && !is_dir($directory)) { + fail('Unable to create the API examples directory.'); +} +if (file_put_contents($outputPath, implode("\n", $lines) . "\n") === false) { + fail('Unable to write the API examples.'); +} + +printf("Generated %d executable API examples.\n", count($manifest['requests'])); + +/** @param array $request @return array{array, array} */ +function arguments(array $request): array +{ + $fixture = is_array($request['request_fixture'] ?? null) ? $request['request_fixture'] : []; + $pathVariables = is_array($fixture['path_variables'] ?? null) ? $fixture['path_variables'] : []; + $parameters = []; + preg_match_all('/(?:\{\{([^}]+)\}\}|:([A-Za-z][A-Za-z0-9_-]*))/', requiredString($request, 'url'), $matches, PREG_SET_ORDER); + foreach ($matches as $match) { + $name = ($match[1] ?? '') !== '' ? $match[1] : ($match[2] ?? ''); + if ($name === '' || in_array($name, ['base_url', 'namespace'], true)) { + continue; + } + $parameters[$name] = normalized($pathVariables[$name] ?? $name . '-fixture'); + } + + $callOptions = []; + $query = normalized($fixture['query'] ?? []); + if (is_array($query) && $query !== []) { + $callOptions['query'] = $query; + } + $body = normalized($fixture['body'] ?? null); + if (($fixture['body_type'] ?? null) === 'json' && is_array($body)) { + $parameters['body'] = $body; + } elseif (($fixture['body_type'] ?? null) === 'formdata' && is_array($body)) { + foreach ($body as $part) { + if (!is_array($part) || !is_string($part['key'] ?? null)) { + continue; + } + $value = normalized($part['value'] ?? ''); + $callOptions['multipart'][] = [ + 'name' => $part['key'], + 'contents' => ($part['type'] ?? null) === 'file' + ? 'replace-with-file-contents' + : (is_scalar($value) ? (string) $value : ''), + ]; + } + } + + return [$parameters, $callOptions]; +} + +/** @param mixed $value @return mixed */ +function normalized($value) +{ + if (is_array($value)) { + foreach ($value as $key => $item) { + $value[$key] = normalized($item); + } + return $value; + } + if (!is_string($value)) { + return $value; + } + return preg_replace_callback('/\{\{([^}]+)\}\}/', static function (array $matches): string { + return trim($matches[1], '$') . '-fixture'; + }, $value) ?? $value; +} + +/** @param mixed $value */ +function exported($value, int $level): string +{ + if (!is_array($value)) { + return var_export($value, true); + } + if ($value === []) { + return '[]'; + } + + $lines = ['[']; + $isList = array_keys($value) === range(0, count($value) - 1); + foreach ($value as $key => $item) { + $prefix = $isList ? '' : var_export($key, true) . ' => '; + $lines[] = str_repeat(' ', $level + 1) . $prefix . exported($item, $level + 1) . ','; + } + $lines[] = str_repeat(' ', $level) . ']'; + + return implode("\n", $lines); +} + +function serviceProperty(string $group): string +{ + $classified = Doctrine\Inflector\InflectorFactory::create()->build()->classify(strtolower($group)); + return lcfirst($classified); +} + +/** @param array $data */ +function requiredString(array $data, string $key): string +{ + $value = $data[$key] ?? null; + if (!is_string($value) || $value === '') { + fail(sprintf('Missing endpoint contract field: %s.', $key)); + } + return $value; +} + +function fail(string $message): void +{ + fwrite(STDERR, $message . "\n"); + exit(1); +} diff --git a/tools/generate-api-snapshot.php b/tools/generate-api-snapshot.php new file mode 100644 index 0000000..6545dac --- /dev/null +++ b/tools/generate-api-snapshot.php @@ -0,0 +1,194 @@ + 1, + 'release' => $options['label'], + 'namespace' => 'Fleetbase\\Sdk', + 'classes' => [], + 'runtime_properties' => [], +]; + +foreach ($classes as $class) { + $reflection = new ReflectionClass($class); + $constants = []; + foreach ($reflection->getReflectionConstants() as $constant) { + if ($constant->isPublic()) { + $constants[$constant->getName()] = $constant->getValue(); + } + } + ksort($constants); + + $properties = []; + foreach ($reflection->getProperties(ReflectionProperty::IS_PUBLIC | ReflectionProperty::IS_PROTECTED) as $property) { + if ($property->getDeclaringClass()->getName() !== $class) { + continue; + } + + $properties[] = [ + 'name' => $property->getName(), + 'visibility' => $property->isPublic() ? 'public' : 'protected', + 'static' => $property->isStatic(), + 'type' => method_exists($property, 'getType') ? formatType($property->getType()) : null, + ]; + } + usort($properties, static function (array $left, array $right): int { + return strcmp($left['name'], $right['name']); + }); + + $methods = []; + foreach ($reflection->getMethods(ReflectionMethod::IS_PUBLIC | ReflectionMethod::IS_PROTECTED) as $method) { + if ($method->getDeclaringClass()->getName() !== $class) { + continue; + } + + $parameters = []; + foreach ($method->getParameters() as $parameter) { + $item = [ + 'name' => $parameter->getName(), + 'type' => formatType($parameter->getType()), + 'by_reference' => $parameter->isPassedByReference(), + 'variadic' => $parameter->isVariadic(), + 'optional' => $parameter->isOptional(), + ]; + + if ($parameter->isDefaultValueAvailable()) { + $item['default'] = normalizeValue($parameter->getDefaultValue()); + } + + $parameters[] = $item; + } + + $methods[] = [ + 'name' => $method->getName(), + 'visibility' => $method->isPublic() ? 'public' : 'protected', + 'static' => $method->isStatic(), + 'return_type' => formatType($method->getReturnType()), + 'parameters' => $parameters, + ]; + } + usort($methods, static function (array $left, array $right): int { + return strcmp($left['name'], $right['name']); + }); + + $snapshot['classes'][$class] = [ + 'final' => $reflection->isFinal(), + 'parent' => ($parent = $reflection->getParentClass()) ? $parent->getName() : null, + 'interfaces' => array_values($reflection->getInterfaceNames()), + 'constants' => normalizeValue($constants), + 'properties' => $properties, + 'methods' => $methods, + ]; +} + +if (class_exists('Fleetbase\\Sdk\\Fleetbase')) { + set_error_handler(static function (int $severity): bool { + return $severity === E_DEPRECATED; + }); + try { + $fleetbase = new Fleetbase\Sdk\Fleetbase('contract-snapshot-placeholder-key'); + $runtimeProperties = array_keys(get_object_vars($fleetbase)); + sort($runtimeProperties); + $snapshot['runtime_properties']['Fleetbase\\Sdk\\Fleetbase'] = $runtimeProperties; + } finally { + restore_error_handler(); + } +} + +ksort($snapshot['classes']); +ksort($snapshot['runtime_properties']); + +$json = json_encode($snapshot, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); +if (!is_string($json)) { + fwrite(STDERR, "Unable to encode API snapshot.\n"); + exit(1); +} + +$outputDirectory = dirname($options['output']); +if (!is_dir($outputDirectory) && !mkdir($outputDirectory, 0777, true) && !is_dir($outputDirectory)) { + fwrite(STDERR, sprintf("Unable to create output directory: %s\n", $outputDirectory)); + exit(1); +} + +if (file_put_contents($options['output'], $json . "\n") === false) { + fwrite(STDERR, sprintf("Unable to write snapshot: %s\n", $options['output'])); + exit(1); +} + +function formatType(?ReflectionType $type): ?string +{ + if ($type === null) { + return null; + } + + if ($type instanceof ReflectionNamedType) { + return ($type->allowsNull() && $type->getName() !== 'mixed' ? '?' : '') . $type->getName(); + } + + return (string) $type; +} + +/** + * @param mixed $value + * @return mixed + */ +function normalizeValue($value) +{ + if (is_array($value)) { + foreach ($value as $key => $item) { + $value[$key] = normalizeValue($item); + } + } + + if (is_object($value)) { + return ['class' => get_class($value)]; + } + + if (is_resource($value)) { + return ['resource' => get_resource_type($value)]; + } + + return $value; +} diff --git a/tools/generate-contract-manifest.php b/tools/generate-contract-manifest.php new file mode 100644 index 0000000..8f808ff --- /dev/null +++ b/tools/generate-contract-manifest.php @@ -0,0 +1,265 @@ + + */ + +$options = getopt('', ['postman:', 'output:', 'ref:']); +foreach (['postman', 'output', 'ref'] as $required) { + if (!isset($options[$required]) || !is_string($options[$required]) || $options[$required] === '') { + fwrite(STDERR, sprintf("Missing required --%s option.\n", $required)); + exit(2); + } +} + +require dirname(__DIR__) . '/vendor/autoload.php'; + +$postmanRoot = realpath($options['postman']); +if ($postmanRoot === false || !is_dir($postmanRoot)) { + fwrite(STDERR, sprintf("Postman checkout not found: %s\n", $options['postman'])); + exit(2); +} + +$collectionsRoot = $postmanRoot . '/postman/collections'; +$scopes = ['Fleetbase API', 'Fleetbase Core API']; +$requests = []; + +foreach ($scopes as $collection) { + $directory = $collectionsRoot . '/' . $collection; + $iterator = new RecursiveIteratorIterator( + new RecursiveDirectoryIterator($directory, FilesystemIterator::SKIP_DOTS) + ); + + foreach ($iterator as $file) { + if (!$file->isFile() || substr($file->getFilename(), -13) !== '.request.yaml') { + continue; + } + + $contents = file_get_contents($file->getPathname()); + if (!is_string($contents)) { + fwrite(STDERR, sprintf("Unable to read request: %s\n", $file->getPathname())); + exit(1); + } + + $relative = str_replace('\\', '/', substr($file->getPathname(), strlen($postmanRoot) + 1)); + $withinCollection = substr($relative, strlen('postman/collections/' . $collection . '/')); + $segments = explode('/', $withinCollection); + $requestName = preg_replace('/\.request\.yaml$/', '', array_pop($segments)); + $group = implode(' / ', $segments); + $method = extractScalar($contents, 'method'); + $url = extractScalar($contents, 'url'); + $document = Symfony\Component\Yaml\Yaml::parse($contents); + + if ($method === null || $url === null || !is_string($requestName) || !is_array($document)) { + fwrite(STDERR, sprintf("Request is missing method, URL, or name: %s\n", $relative)); + exit(1); + } + + $requests[] = [ + 'id' => slug($collection . '-' . $group . '-' . $requestName), + 'collection' => $collection, + 'group' => $group, + 'name' => $requestName, + 'method' => strtoupper($method), + 'url' => $url, + 'source' => $relative, + 'description' => is_string($document['description'] ?? null) ? $document['description'] : null, + 'authentication' => authentication($document), + 'request_fixture' => requestFixture($document), + 'response_fixtures' => responseFixtures($file->getPathname(), $document, $postmanRoot), + 'implementation' => null, + 'tests' => [], + 'status' => 'unmapped', + 'exception' => null, + ]; + } +} + +/** @param array $document */ +function authentication(array $document): string +{ + $headers = is_array($document['headers'] ?? null) ? $document['headers'] : []; + if (array_key_exists('Customer-Token', $headers)) { + return 'customer-token'; + } + if (array_key_exists('Driver-Token', $headers)) { + return 'driver-token'; + } + + return 'fleetbase-api-key'; +} + +/** + * @param array $document + * @return array + */ +function requestFixture(array $document): array +{ + $fixture = [ + 'path_variables' => normalizeParameters($document['pathVariables'] ?? []), + 'query' => normalizeParameters($document['queryParams'] ?? []), + 'body_type' => null, + 'body' => null, + ]; + $body = $document['body'] ?? null; + if (!is_array($body)) { + return $fixture; + } + + $fixture['body_type'] = is_string($body['type'] ?? null) ? $body['type'] : null; + $content = $body['content'] ?? null; + if ($fixture['body_type'] === 'json' && is_string($content)) { + $fixture['body'] = decodeJsonFixture($content); + } elseif (is_array($content)) { + $fixture['body'] = array_values($content); + } elseif (is_string($content)) { + $fixture['body'] = $content; + } + + return $fixture; +} + +/** + * @param mixed $parameters + * @return array + */ +function normalizeParameters($parameters): array +{ + if (!is_array($parameters)) { + return []; + } + $normalized = []; + foreach ($parameters as $key => $value) { + if (is_string($key)) { + $normalized[$key] = $value; + } elseif (is_array($value) && is_string($value['key'] ?? null)) { + $normalized[$value['key']] = $value['value'] ?? null; + } + } + return $normalized; +} + +/** @return mixed */ +function decodeJsonFixture(string $content) +{ + if (trim($content) === '') { + return null; + } + $content = preg_replace_callback('/\{\{([^}]+)\}\}/', static function (array $matches): string { + return trim($matches[1], '$') . '-fixture'; + }, $content) ?? $content; + + if (json_decode($content, true) === null && json_last_error() !== JSON_ERROR_NONE) { + $content = preg_replace_callback('/(:\s*)([A-Za-z_$][A-Za-z0-9_$-]*-fixture)(?=\s*[,}])/', static function (array $matches): string { + return $matches[1] . json_encode($matches[2], JSON_THROW_ON_ERROR); + }, $content) ?? $content; + } + + return json_decode($content, true, 512, JSON_THROW_ON_ERROR); +} + +/** + * @param array $document + * @return array + */ +function responseFixtures(string $requestPath, array $document, string $postmanRoot): array +{ + $examples = $document['examples'] ?? null; + if (!is_string($examples) || $examples === '') { + return []; + } + $directory = realpath(dirname($requestPath) . '/' . $examples); + if ($directory === false || !is_dir($directory)) { + return []; + } + + $fixtures = []; + foreach (glob($directory . '/*.example.yaml') ?: [] as $examplePath) { + $example = Symfony\Component\Yaml\Yaml::parseFile($examplePath); + $status = is_array($example) && is_int($example['response']['statusCode'] ?? null) + ? $example['response']['statusCode'] + : null; + $fixtures[] = [ + 'source' => str_replace('\\', '/', substr($examplePath, strlen($postmanRoot) + 1)), + 'status' => $status, + ]; + } + usort($fixtures, static function (array $left, array $right): int { + return strcmp($left['source'], $right['source']); + }); + return $fixtures; +} + +usort($requests, static function (array $left, array $right): int { + return [$left['collection'], $left['group'], $left['name']] <=> [$right['collection'], $right['group'], $right['name']]; +}); + +$methods = []; +$groups = []; +foreach ($requests as $request) { + $methods[$request['method']] = ($methods[$request['method']] ?? 0) + 1; + $groups[$request['collection'] . '/' . $request['group']] = true; +} +ksort($methods); + +$manifest = [ + 'schema_version' => 1, + 'source' => [ + 'repository' => 'https://github.com/fleetbase/postman', + 'ref' => $options['ref'], + 'collections' => $scopes, + ], + 'summary' => [ + 'requests' => count($requests), + 'groups' => count($groups), + 'methods' => $methods, + 'mapped' => 0, + 'exceptions' => 0, + 'unmapped' => count($requests), + ], + 'requests' => $requests, +]; + +$json = json_encode($manifest, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); +if (!is_string($json)) { + fwrite(STDERR, "Unable to encode contract manifest.\n"); + exit(1); +} + +$outputDirectory = dirname($options['output']); +if (!is_dir($outputDirectory) && !mkdir($outputDirectory, 0777, true) && !is_dir($outputDirectory)) { + fwrite(STDERR, sprintf("Unable to create output directory: %s\n", $outputDirectory)); + exit(1); +} + +if (file_put_contents($options['output'], $json . "\n") === false) { + fwrite(STDERR, sprintf("Unable to write manifest: %s\n", $options['output'])); + exit(1); +} + +function extractScalar(string $yaml, string $key): ?string +{ + if (!preg_match('/^' . preg_quote($key, '/') . ':\\s*(?:"([^"]*)"|\'([^\']*)\'|([^\\r\\n#]+))/m', $yaml, $matches)) { + return null; + } + + foreach ([1, 2, 3] as $index) { + if (isset($matches[$index]) && $matches[$index] !== '') { + return trim($matches[$index]); + } + } + + return ''; +} + +function slug(string $value): string +{ + $value = strtolower($value); + $value = preg_replace('/[^a-z0-9]+/', '-', $value) ?? ''; + return trim($value, '-'); +} diff --git a/tools/generate-endpoint-services.php b/tools/generate-endpoint-services.php new file mode 100644 index 0000000..073ce30 --- /dev/null +++ b/tools/generate-endpoint-services.php @@ -0,0 +1,401 @@ + $request) { + if (!is_array($request)) { + fail(sprintf('Manifest request %d is invalid.', $index + 1)); + } + $group = requiredString($request, 'group'); + $service = serviceName($group); + $method = methodName(requiredString($request, 'name')); + $key = $service . '::' . $method; + if (isset($groups[$service]['methods'][$method])) { + $existing = $groups[$service]['methods'][$method]; + if ($existing['method'] !== $request['method'] || $existing['url'] !== $request['url']) { + fail(sprintf('Method collision for %s', $key)); + } + } else { + $groups[$service]['group'] = $group; + $groups[$service]['methods'][$method] = $request; + } + + $requests[$index]['implementation'] = 'Fleetbase\\Sdk\\Services\\' . $service . '::' . $method; + $requests[$index]['tests'] = ['tests/Contract/EndpointContractTest.php::testEveryEndpointContract']; + $requests[$index]['status'] = 'complete'; + $requests[$index]['exception'] = null; +} + +ksort($groups); +$concernsDirectory = $sourceRoot . '/Concerns'; +$resourcesDirectory = dirname($sourceRoot) . '/Resources'; +ensureDirectory($concernsDirectory); +ensureDirectory($resourcesDirectory); + +$serviceMap = []; +foreach ($groups as $service => $definition) { + $group = $definition['group']; + $trait = $service . 'Endpoints'; + $methods = $definition['methods']; + ksort($methods); + $traitCode = renderTrait($trait, $methods); + writeGenerated($concernsDirectory . '/' . $trait . '.php', $traitCode); + + if ($service !== 'OrderService') { + $resource = substr($service, 0, -strlen('Service')); + $namespace = namespaceFromRequest(reset($methods)); + writeGenerated($sourceRoot . '/' . $service . '.php', renderService($service, $trait, $resource, $namespace)); + } + + $resource = substr($service, 0, -strlen('Service')); + $resourcePath = $resourcesDirectory . '/' . $resource . '.php'; + if (!is_file($resourcePath)) { + writeGenerated($resourcePath, renderResource($resource)); + } + + $serviceMap[$group] = [ + 'service' => 'Fleetbase\\Sdk\\Services\\' . $service, + 'trait' => 'Fleetbase\\Sdk\\Services\\Concerns\\' . $trait, + 'requests' => count($methods), + ]; +} + +$manifest['requests'] = $requests; +$manifest['summary']['mapped'] = count($requests); +$manifest['summary']['exceptions'] = 0; +$manifest['summary']['unmapped'] = 0; +writeJson($manifestPath, $manifest); +writeJson('contracts/service-map.json', [ + 'schema_version' => 1, + 'generated_from' => $manifest['source'], + 'groups' => $serviceMap, +]); +writeGenerated($testPath, renderContractTest() . "\n"); + +printf("Generated %d service groups and mapped %d requests.\n", count($groups), count($requests)); + +/** @return array */ +function readManifest(string $path): array +{ + $contents = file_get_contents($path); + if (!is_string($contents)) { + fail(sprintf('Unable to read manifest: %s', $path)); + } + $data = json_decode($contents, true); + if (!is_array($data)) { + fail(sprintf('Invalid manifest JSON: %s', $path)); + } + return $data; +} + +/** @param array $data */ +function requiredString(array $data, string $key): string +{ + $value = $data[$key] ?? null; + if (!is_string($value) || $value === '') { + fail(sprintf('Missing manifest field: %s', $key)); + } + return $value; +} + +function serviceName(string $group): string +{ + $singular = Doctrine\Inflector\InflectorFactory::create()->build()->singularize($group); + return Doctrine\Inflector\InflectorFactory::create()->build()->classify($singular) . 'Service'; +} + +function methodName(string $name): string +{ + $name = preg_replace('/\b(?:a|an|the)\b/i', ' ', $name) ?? $name; + $name = preg_replace('/[^A-Za-z0-9]+/', ' ', $name) ?? $name; + $classified = Doctrine\Inflector\InflectorFactory::create()->build()->classify(strtolower(trim($name))); + return lcfirst($classified); +} + +/** @param array> $methods */ +function renderTrait(string $trait, array $methods): string +{ + $code = generatedHeader('Fleetbase\\Sdk\\Services\\Concerns'); + $code .= "trait {$trait}\n{\n"; + foreach ($methods as $method => $request) { + $verb = var_export(requiredString($request, 'method'), true); + $url = var_export(requiredString($request, 'url'), true); + $description = str_replace('*/', '* /', requiredString($request, 'name')); + $code .= " /**\n"; + $code .= " * {$description}.\n"; + $code .= " *\n"; + $code .= " * @param array \$parameters\n"; + $code .= " * @param array \$options\n"; + $code .= " * @return mixed\n"; + $code .= " */\n"; + $code .= " public function {$method}(array \$parameters = [], array \$options = [])\n"; + $code .= " {\n"; + $code .= " return \$this->endpoint({$verb}, {$url}, \$parameters, \$options);\n"; + $code .= " }\n\n"; + } + return rtrim($code) . "\n}\n"; +} + +function renderService(string $service, string $trait, string $resource, string $namespace): string +{ + $code = generatedHeader('Fleetbase\\Sdk\\Services'); + $code .= "use Fleetbase\\Sdk\\EndpointService;\n"; + $code .= "use Fleetbase\\Sdk\\HttpClient;\n"; + $code .= "use Fleetbase\\Sdk\\Services\\Concerns\\{$trait};\n\n"; + $code .= "class {$service} extends EndpointService\n{\n"; + $code .= " use {$trait};\n\n"; + $code .= " /** @param array \$options */\n"; + $code .= " public function __construct(HttpClient \$client, array \$options = [])\n"; + $code .= " {\n"; + $code .= ' parent::__construct(' . var_export($resource, true) . ", \$client, array_merge(['namespace' => " . var_export($namespace, true) . "], \$options));\n"; + $code .= " }\n"; + $code .= "}\n"; + return $code; +} + +function renderResource(string $resource): string +{ + $code = generatedHeader('Fleetbase\\Sdk\\Resources'); + $code .= "use Fleetbase\\Sdk\\Resource;\n\n"; + $code .= "class {$resource} extends Resource\n{\n}\n"; + return $code; +} + +/** @param array|false $request */ +function namespaceFromRequest($request): string +{ + if (!is_array($request)) { + fail('Unable to determine service namespace.'); + } + $url = requiredString($request, 'url'); + $path = preg_replace('#^\{\{base_url\}\}/\{\{namespace\}\}/?#i', '', $url) ?? $url; + $path = explode('?', $path, 2)[0]; + $segment = explode('/', trim($path, '/'))[0] ?? ''; + if ($segment === '' || strpos($segment, '{{') !== false) { + fail(sprintf('Unable to determine namespace from URL: %s', $url)); + } + return $segment; +} + +function generatedHeader(string $namespace): string +{ + return " $part['key'], 'contents' => $contents]; + $expectedMultipart[$part['key']] = $contents; + } + } + $client = $this->mockHttpClient([new Response(200, ['Content-Type' => 'application/json'], '{}')]); + $reflection = new ReflectionClass($serviceClass); + $service = $reflection->newInstance($client); + $service->{$method}($parameters, $options); + + $transaction = $this->history[0] ?? null; + self::assertIsArray($transaction); + $request = $transaction['request'] ?? null; + self::assertInstanceOf(RequestInterface::class, $request); + self::assertSame($httpMethod, $request->getMethod()); + + $expected = preg_replace('#^\{\{base_url\}\}/\{\{namespace\}\}/?#i', '', $urlTemplate); + self::assertIsString($expected); + foreach ($parameters as $name => $value) { + if ($name === 'body') { + continue; + } + if (!is_scalar($value)) { + throw new \RuntimeException('Endpoint path parameters must be scalar.'); + } + $expected = str_replace('{{' . $name . '}}', rawurlencode((string) $value), $expected); + $expected = preg_replace('/:' . preg_quote($name, '/') . '(?![A-Za-z0-9_-])/', rawurlencode((string) $value), $expected); + self::assertIsString($expected); + } + if (is_array($query) && $query !== []) { + $expected .= (strpos($expected, '?') === false ? '?' : '&') + . http_build_query($query, '', '&', PHP_QUERY_RFC3986); + } + self::assertSame('/v1/' . ltrim($expected, '/'), $request->getUri()->getPath() + . ($request->getUri()->getQuery() !== '' ? '?' . $request->getUri()->getQuery() : '')); + if (is_array($expectedBody)) { + self::assertSame($expectedBody, json_decode((string) $request->getBody(), true, 512, JSON_THROW_ON_ERROR)); + } + foreach ($expectedMultipart as $name => $contents) { + self::assertStringContainsString('name="' . $name . '"', (string) $request->getBody()); + self::assertStringContainsString($contents, (string) $request->getBody()); + } + } + } + + /** @return iterable, string, string, string, array, array}> */ + private static function endpointCases(): iterable + { + $contents = file_get_contents(dirname(__DIR__, 2) . '/contracts/postman-manifest.json'); + if (!is_string($contents)) { + throw new \RuntimeException('Unable to read the endpoint contract manifest.'); + } + $manifest = json_decode($contents, true, 512, JSON_THROW_ON_ERROR); + if (!is_array($manifest) || !is_array($manifest['requests'] ?? null)) { + throw new \RuntimeException('The endpoint contract manifest is invalid.'); + } + foreach ($manifest['requests'] as $request) { + if (!is_array($request)) { + throw new \RuntimeException('The endpoint contract request is invalid.'); + } + $id = $request['id'] ?? null; + $implementationName = $request['implementation'] ?? null; + $httpMethod = $request['method'] ?? null; + $url = $request['url'] ?? null; + $requestFixture = $request['request_fixture'] ?? null; + if (!is_string($id) || !is_string($implementationName) || !is_string($httpMethod) || !is_string($url) || !is_array($requestFixture)) { + throw new \RuntimeException('The endpoint contract request fields are invalid.'); + } + $implementation = explode('::', $implementationName, 2); + $serviceClass = $implementation[0] ?? ''; + $serviceMethod = $implementation[1] ?? ''; + if (!class_exists($serviceClass) || !is_subclass_of($serviceClass, Service::class) || !method_exists($serviceClass, $serviceMethod)) { + throw new \RuntimeException('The endpoint contract implementation is invalid.'); + } + $normalizedRequestFixture = []; + foreach ($requestFixture as $fixtureKey => $fixtureValue) { + if (is_string($fixtureKey)) { + $normalizedRequestFixture[$fixtureKey] = $fixtureValue; + } + } + $parameters = []; + preg_match_all('/(?:\{\{([^}]+)\}\}|:([A-Za-z][A-Za-z0-9_-]*))/', $url, $matches, PREG_SET_ORDER); + foreach ($matches as $match) { + $bracedName = $match[1] ?? ''; + $colonName = $match[2] ?? ''; + $name = $bracedName !== '' ? $bracedName : $colonName; + if (!in_array($name, ['base_url', 'namespace'], true)) { + $parameters[$name] = $name . '-fixture'; + } + } + yield $id => [ + $serviceClass, + $serviceMethod, + $httpMethod, + $url, + $parameters, + $normalizedRequestFixture, + ]; + } + } + + /** + * @param mixed $value + * @return mixed + */ + private static function normalizeFixture($value) + { + if (is_array($value)) { + foreach ($value as $key => $item) { + $value[$key] = self::normalizeFixture($item); + } + return $value; + } + if (!is_string($value)) { + return $value; + } + + return preg_replace_callback('/\{\{([^}]+)\}\}/', static function (array $matches): string { + return trim($matches[1], '$') . '-fixture'; + }, $value) ?? $value; + } + } + PHP; +} + +/** @param array $data */ +function writeJson(string $path, array $data): void +{ + $json = json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); + if (!is_string($json)) { + fail(sprintf('Unable to encode JSON: %s', $path)); + } + writeGenerated($path, $json . "\n"); +} + +function writeGenerated(string $path, string $contents): void +{ + ensureDirectory(dirname($path)); + if (file_put_contents($path, $contents) === false) { + fail(sprintf('Unable to write generated file: %s', $path)); + } +} + +function ensureDirectory(string $path): void +{ + if (!is_dir($path) && !mkdir($path, 0777, true) && !is_dir($path)) { + fail(sprintf('Unable to create directory: %s', $path)); + } +} + +function fail(string $message): void +{ + fwrite(STDERR, $message . "\n"); + exit(1); +} diff --git a/tools/merge-terminating-coverage.php b/tools/merge-terminating-coverage.php new file mode 100644 index 0000000..8e4fe57 --- /dev/null +++ b/tools/merge-terminating-coverage.php @@ -0,0 +1,77 @@ + ['pipe', 'r'], + 1 => ['pipe', 'w'], + 2 => ['pipe', 'w'], +]; +$environment = array_merge($_ENV, ['XDEBUG_MODE' => 'coverage']); +$process = proc_open($command, $descriptorSpec, $pipes, $root, $environment); +if (!is_resource($process)) { + fail('Unable to start the terminating-helper coverage process.'); +} + +fclose($pipes[0]); +$stdout = stream_get_contents($pipes[1]); +$stderr = stream_get_contents($pipes[2]); +fclose($pipes[1]); +fclose($pipes[2]); +$exitCode = proc_close($process); + +if ($exitCode !== 1 || !is_string($stdout) || strpos($stdout, 'fleetbase-terminating-coverage') === false) { + fail(sprintf('Terminating-helper probe failed with exit %d: %s%s', $exitCode, $stdout ?: '', $stderr ?: '')); +} + +$serializedRaw = file_get_contents($rawPath); +$raw = is_string($serializedRaw) ? unserialize($serializedRaw, ['allowed_classes' => false]) : false; +if (!is_array($raw)) { + fail('Unable to load terminating-helper Xdebug coverage.'); +} + +$coverage = is_file($coveragePath) ? require $coveragePath : null; +if (!$coverage instanceof CodeCoverage) { + fail('Unable to load PHPUnit coverage for merging.'); +} + +$coverage->append(RawCodeCoverageData::fromXdebugWithPathCoverage($raw), 'terminating-helper'); + +$serializedCoverage = serialize($coverage); +$php = "process($coverage, $root . '/build/coverage/clover.xml'); +(new Cobertura())->process($coverage, $root . '/build/coverage/cobertura.xml'); +(new HtmlReport())->process($coverage, $root . '/build/coverage/html'); +$summary = (new Text(Thresholds::default(), false, false))->process($coverage, false); +if (file_put_contents($root . '/build/coverage/summary.txt', $summary) === false) { + fail('Unable to rewrite merged text coverage.'); +} + +@unlink($rawPath); +fwrite(STDOUT, "Merged terminating-helper coverage.\n"); + +function fail(string $message): void +{ + fwrite(STDERR, $message . "\n"); + exit(1); +} diff --git a/tools/report-uncovered-branches.php b/tools/report-uncovered-branches.php new file mode 100644 index 0000000..8884165 --- /dev/null +++ b/tools/report-uncovered-branches.php @@ -0,0 +1,52 @@ + + * @license https://www.gnu.org/licenses/agpl-3.0.html AGPL-3.0-or-later + */ + +declare(strict_types=1); + +use SebastianBergmann\CodeCoverage\CodeCoverage; + +require dirname(__DIR__) . '/vendor/autoload.php'; + +$path = $argv[1] ?? 'build/coverage/coverage.php'; +if (!is_string($path) || !is_file($path)) { + fwrite(STDERR, sprintf("Serialized coverage report not found: %s\n", is_string($path) ? $path : '[invalid]')); + exit(1); +} + +$coverage = require $path; +if (!$coverage instanceof CodeCoverage) { + fwrite(STDERR, sprintf("Invalid serialized coverage report: %s\n", $path)); + exit(1); +} + +$uncovered = []; +foreach ($coverage->getData()->functionCoverage() as $file => $functions) { + foreach ($functions as $function => $data) { + foreach ($data['branches'] as $branchId => $branch) { + if ($branch['hit'] === []) { + $uncovered[] = sprintf( + '%s:%d-%d %s branch %d -> [%s]', + $file, + $branch['line_start'], + $branch['line_end'], + $function, + $branchId, + implode(', ', $branch['out']) + ); + } + } + } +} + +if ($uncovered === []) { + fwrite(STDOUT, "All executable branches are covered.\n"); + exit(0); +} + +fwrite(STDOUT, "Uncovered executable branches:\n" . implode("\n", $uncovered) . "\n"); diff --git a/tools/report-uncovered.php b/tools/report-uncovered.php new file mode 100644 index 0000000..c3284e7 --- /dev/null +++ b/tools/report-uncovered.php @@ -0,0 +1,48 @@ + + * @license https://www.gnu.org/licenses/agpl-3.0.html AGPL-3.0-or-later + */ + +declare(strict_types=1); + +$path = $argv[1] ?? 'build/coverage/clover.xml'; +if (!is_string($path) || !is_file($path)) { + fwrite(STDERR, sprintf("Coverage report not found: %s\n", is_string($path) ? $path : '[invalid]')); + exit(1); +} + +$document = new DOMDocument(); +if (!$document->load($path)) { + fwrite(STDERR, sprintf("Unable to parse coverage report: %s\n", $path)); + exit(1); +} + +$uncovered = []; +/** @var DOMElement $file */ +foreach ($document->getElementsByTagName('file') as $file) { + $name = $file->getAttribute('name'); + $lines = []; + /** @var DOMElement $line */ + foreach ($file->getElementsByTagName('line') as $line) { + if ($line->getAttribute('type') === 'stmt' && (int) $line->getAttribute('count') === 0) { + $lines[] = (int) $line->getAttribute('num'); + } + } + if ($lines !== []) { + $uncovered[$name] = $lines; + } +} + +if ($uncovered === []) { + fwrite(STDOUT, "All executable lines are covered.\n"); + exit(0); +} + +fwrite(STDOUT, "Uncovered executable lines:\n"); +foreach ($uncovered as $file => $lines) { + fwrite(STDOUT, sprintf("%s: %s\n", $file, implode(', ', $lines))); +} diff --git a/tools/run-live-contract-smoke.php b/tools/run-live-contract-smoke.php new file mode 100644 index 0000000..d8f4860 --- /dev/null +++ b/tools/run-live-contract-smoke.php @@ -0,0 +1,110 @@ + $baseUrl, 'namespace' => 'v1']); +$createdId = null; + +try { + $organization = $fleetbase->organizations->getCurrentOrganization(); + if (!is_object($organization)) { + fail('Current organization did not return an object.'); + } + + try { + $fleetbase->places->createPlace(['body' => []]); + fail('An invalid place unexpectedly passed validation.'); + } catch (ValidationException $exception) { + if ($exception->getStatusCode() !== 422) { + fail('Validation failure did not retain HTTP 422.'); + } + } + + $created = $fleetbase->places->createPlace(['body' => [ + 'name' => 'SDK Contract Fixture', + 'street1' => '1 Contract Test Way', + 'city' => 'Singapore', + 'country' => 'SG', + 'latitude' => 1.29027, + 'longitude' => 103.851959, + ]]); + $createdId = publicId($created); + if ($createdId === null) { + fail('Created place response had no public ID.'); + } + + $retrieved = $fleetbase->places->retrievePlace(['id' => $createdId]); + if (publicId($retrieved) !== $createdId) { + fail('Retrieved place did not match the created public ID.'); + } + + $fleetbase->places->deletePlace(['id' => $createdId]); + $createdId = null; + + try { + $fleetbase->places->retrievePlace(['id' => 'place_sdk_contract_missing']); + fail('A missing place unexpectedly returned successfully.'); + } catch (NotFoundException $exception) { + if ($exception->getStatusCode() !== 404) { + fail('Not-found failure did not retain HTTP 404.'); + } + } + + try { + (new Fleetbase('flb_test_invalid_contract_key', ['host' => $baseUrl])) + ->organizations + ->getCurrentOrganization(); + fail('An invalid API key unexpectedly authenticated.'); + } catch (AuthenticationException $exception) { + if ($exception->getStatusCode() !== 401) { + fail('Authentication failure did not retain HTTP 401.'); + } + } +} finally { + if (is_string($createdId)) { + try { + $fleetbase->places->deletePlace(['id' => $createdId]); + } catch (Throwable $exception) { + fwrite(STDERR, "Unable to clean up the disposable place fixture.\n"); + } + } +} + +fwrite(STDOUT, "SDK live contract smoke passed: auth, validation, create, retrieve, delete, and not-found.\n"); + +/** @param mixed $response */ +function publicId($response): ?string +{ + if (!is_object($response)) { + return null; + } + if (isset($response->id) && is_string($response->id)) { + return $response->id; + } + if (isset($response->data) && is_object($response->data) && isset($response->data->id) && is_string($response->data->id)) { + return $response->data->id; + } + + return null; +} + +function fail(string $message): void +{ + fwrite(STDERR, $message . "\n"); + exit(1); +} diff --git a/tools/run-unit-tests.php b/tools/run-unit-tests.php new file mode 100644 index 0000000..62e2efc --- /dev/null +++ b/tools/run-unit-tests.php @@ -0,0 +1,18 @@ +handle = fopen($opened_path, $mode); - $this->position = 0; - - // remove all traces of this stream wrapper once it has been used - stream_wrapper_unregister('composer-bin-proxy'); - - return (bool) $this->handle; - } - - public function stream_read($count) - { - $data = fread($this->handle, $count); - - if ($this->position === 0) { - $data = preg_replace('{^#!.*\r?\n}', '', $data); - } - - $this->position += strlen($data); - - return $data; - } - - public function stream_cast($castAs) - { - return $this->handle; - } - - public function stream_close() - { - fclose($this->handle); - } - - public function stream_lock($operation) - { - return $operation ? flock($this->handle, $operation) : true; - } - - public function stream_tell() - { - return $this->position; - } - - public function stream_eof() - { - return feof($this->handle); - } - - public function stream_stat() - { - return fstat($this->handle); - } - - public function stream_set_option($option, $arg1, $arg2) - { - return true; - } - } - } - - if (function_exists('stream_wrapper_register') && stream_wrapper_register('composer-bin-proxy', 'Composer\BinProxyWrapper')) { - include("composer-bin-proxy://" . __DIR__ . '/..'.'/nette/neon/bin/neon-lint'); - exit(0); - } -} - -include __DIR__ . '/..'.'/nette/neon/bin/neon-lint'; diff --git a/vendor/bin/parallel-lint b/vendor/bin/parallel-lint deleted file mode 100755 index c60f322..0000000 --- a/vendor/bin/parallel-lint +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/env php -handle = fopen($opened_path, $mode); - $this->position = 0; - - // remove all traces of this stream wrapper once it has been used - stream_wrapper_unregister('composer-bin-proxy'); - - return (bool) $this->handle; - } - - public function stream_read($count) - { - $data = fread($this->handle, $count); - - if ($this->position === 0) { - $data = preg_replace('{^#!.*\r?\n}', '', $data); - } - - $this->position += strlen($data); - - return $data; - } - - public function stream_cast($castAs) - { - return $this->handle; - } - - public function stream_close() - { - fclose($this->handle); - } - - public function stream_lock($operation) - { - return $operation ? flock($this->handle, $operation) : true; - } - - public function stream_tell() - { - return $this->position; - } - - public function stream_eof() - { - return feof($this->handle); - } - - public function stream_stat() - { - return fstat($this->handle); - } - - public function stream_set_option($option, $arg1, $arg2) - { - return true; - } - } - } - - if (function_exists('stream_wrapper_register') && stream_wrapper_register('composer-bin-proxy', 'Composer\BinProxyWrapper')) { - include("composer-bin-proxy://" . __DIR__ . '/..'.'/php-parallel-lint/php-parallel-lint/parallel-lint'); - exit(0); - } -} - -include __DIR__ . '/..'.'/php-parallel-lint/php-parallel-lint/parallel-lint'; diff --git a/vendor/bin/php-parse b/vendor/bin/php-parse deleted file mode 100755 index 9d218fa..0000000 --- a/vendor/bin/php-parse +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/env php -handle = fopen($opened_path, $mode); - $this->position = 0; - - // remove all traces of this stream wrapper once it has been used - stream_wrapper_unregister('composer-bin-proxy'); - - return (bool) $this->handle; - } - - public function stream_read($count) - { - $data = fread($this->handle, $count); - - if ($this->position === 0) { - $data = preg_replace('{^#!.*\r?\n}', '', $data); - } - - $this->position += strlen($data); - - return $data; - } - - public function stream_cast($castAs) - { - return $this->handle; - } - - public function stream_close() - { - fclose($this->handle); - } - - public function stream_lock($operation) - { - return $operation ? flock($this->handle, $operation) : true; - } - - public function stream_tell() - { - return $this->position; - } - - public function stream_eof() - { - return feof($this->handle); - } - - public function stream_stat() - { - return fstat($this->handle); - } - - public function stream_set_option($option, $arg1, $arg2) - { - return true; - } - } - } - - if (function_exists('stream_wrapper_register') && stream_wrapper_register('composer-bin-proxy', 'Composer\BinProxyWrapper')) { - include("composer-bin-proxy://" . __DIR__ . '/..'.'/nikic/php-parser/bin/php-parse'); - exit(0); - } -} - -include __DIR__ . '/..'.'/nikic/php-parser/bin/php-parse'; diff --git a/vendor/bin/phpcbf b/vendor/bin/phpcbf deleted file mode 100755 index 2cc18d7..0000000 --- a/vendor/bin/phpcbf +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/env php -handle = fopen($opened_path, $mode); - $this->position = 0; - - // remove all traces of this stream wrapper once it has been used - stream_wrapper_unregister('composer-bin-proxy'); - - return (bool) $this->handle; - } - - public function stream_read($count) - { - $data = fread($this->handle, $count); - - if ($this->position === 0) { - $data = preg_replace('{^#!.*\r?\n}', '', $data); - } - - $this->position += strlen($data); - - return $data; - } - - public function stream_cast($castAs) - { - return $this->handle; - } - - public function stream_close() - { - fclose($this->handle); - } - - public function stream_lock($operation) - { - return $operation ? flock($this->handle, $operation) : true; - } - - public function stream_tell() - { - return $this->position; - } - - public function stream_eof() - { - return feof($this->handle); - } - - public function stream_stat() - { - return fstat($this->handle); - } - - public function stream_set_option($option, $arg1, $arg2) - { - return true; - } - } - } - - if (function_exists('stream_wrapper_register') && stream_wrapper_register('composer-bin-proxy', 'Composer\BinProxyWrapper')) { - include("composer-bin-proxy://" . __DIR__ . '/..'.'/squizlabs/php_codesniffer/bin/phpcbf'); - exit(0); - } -} - -include __DIR__ . '/..'.'/squizlabs/php_codesniffer/bin/phpcbf'; diff --git a/vendor/bin/phpcs b/vendor/bin/phpcs deleted file mode 100755 index 8b01722..0000000 --- a/vendor/bin/phpcs +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/env php -handle = fopen($opened_path, $mode); - $this->position = 0; - - // remove all traces of this stream wrapper once it has been used - stream_wrapper_unregister('composer-bin-proxy'); - - return (bool) $this->handle; - } - - public function stream_read($count) - { - $data = fread($this->handle, $count); - - if ($this->position === 0) { - $data = preg_replace('{^#!.*\r?\n}', '', $data); - } - - $this->position += strlen($data); - - return $data; - } - - public function stream_cast($castAs) - { - return $this->handle; - } - - public function stream_close() - { - fclose($this->handle); - } - - public function stream_lock($operation) - { - return $operation ? flock($this->handle, $operation) : true; - } - - public function stream_tell() - { - return $this->position; - } - - public function stream_eof() - { - return feof($this->handle); - } - - public function stream_stat() - { - return fstat($this->handle); - } - - public function stream_set_option($option, $arg1, $arg2) - { - return true; - } - } - } - - if (function_exists('stream_wrapper_register') && stream_wrapper_register('composer-bin-proxy', 'Composer\BinProxyWrapper')) { - include("composer-bin-proxy://" . __DIR__ . '/..'.'/squizlabs/php_codesniffer/bin/phpcs'); - exit(0); - } -} - -include __DIR__ . '/..'.'/squizlabs/php_codesniffer/bin/phpcs'; diff --git a/vendor/bin/phpstan b/vendor/bin/phpstan deleted file mode 100755 index adf7e43..0000000 --- a/vendor/bin/phpstan +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/env php -handle = fopen($opened_path, $mode); - $this->position = 0; - - // remove all traces of this stream wrapper once it has been used - stream_wrapper_unregister('composer-bin-proxy'); - - return (bool) $this->handle; - } - - public function stream_read($count) - { - $data = fread($this->handle, $count); - - if ($this->position === 0) { - $data = preg_replace('{^#!.*\r?\n}', '', $data); - } - - $this->position += strlen($data); - - return $data; - } - - public function stream_cast($castAs) - { - return $this->handle; - } - - public function stream_close() - { - fclose($this->handle); - } - - public function stream_lock($operation) - { - return $operation ? flock($this->handle, $operation) : true; - } - - public function stream_tell() - { - return $this->position; - } - - public function stream_eof() - { - return feof($this->handle); - } - - public function stream_stat() - { - return fstat($this->handle); - } - - public function stream_set_option($option, $arg1, $arg2) - { - return true; - } - } - } - - if (function_exists('stream_wrapper_register') && stream_wrapper_register('composer-bin-proxy', 'Composer\BinProxyWrapper')) { - include("composer-bin-proxy://" . __DIR__ . '/..'.'/phpstan/phpstan/bin/phpstan'); - exit(0); - } -} - -include __DIR__ . '/..'.'/phpstan/phpstan/bin/phpstan'; diff --git a/vendor/bin/phpunit b/vendor/bin/phpunit deleted file mode 100755 index 6d0dc1b..0000000 --- a/vendor/bin/phpunit +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/env php -handle = fopen($opened_path, $mode); - $this->position = 0; - - // remove all traces of this stream wrapper once it has been used - stream_wrapper_unregister('composer-bin-proxy'); - - return (bool) $this->handle; - } - - public function stream_read($count) - { - $data = fread($this->handle, $count); - - if ($this->position === 0) { - $data = preg_replace('{^#!.*\r?\n}', '', $data); - } - - $this->position += strlen($data); - - return $data; - } - - public function stream_cast($castAs) - { - return $this->handle; - } - - public function stream_close() - { - fclose($this->handle); - } - - public function stream_lock($operation) - { - return $operation ? flock($this->handle, $operation) : true; - } - - public function stream_tell() - { - return $this->position; - } - - public function stream_eof() - { - return feof($this->handle); - } - - public function stream_stat() - { - return fstat($this->handle); - } - - public function stream_set_option($option, $arg1, $arg2) - { - return true; - } - } - } - - if (function_exists('stream_wrapper_register') && stream_wrapper_register('composer-bin-proxy', 'Composer\BinProxyWrapper')) { - include("composer-bin-proxy://" . __DIR__ . '/..'.'/phpunit/phpunit/phpunit'); - exit(0); - } -} - -include __DIR__ . '/..'.'/phpunit/phpunit/phpunit'; diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php deleted file mode 100644 index afef3fa..0000000 --- a/vendor/composer/ClassLoader.php +++ /dev/null @@ -1,572 +0,0 @@ - - * Jordi Boggiano - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Composer\Autoload; - -/** - * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. - * - * $loader = new \Composer\Autoload\ClassLoader(); - * - * // register classes with namespaces - * $loader->add('Symfony\Component', __DIR__.'/component'); - * $loader->add('Symfony', __DIR__.'/framework'); - * - * // activate the autoloader - * $loader->register(); - * - * // to enable searching the include path (eg. for PEAR packages) - * $loader->setUseIncludePath(true); - * - * In this example, if you try to use a class in the Symfony\Component - * namespace or one of its children (Symfony\Component\Console for instance), - * the autoloader will first look for the class under the component/ - * directory, and it will then fallback to the framework/ directory if not - * found before giving up. - * - * This class is loosely based on the Symfony UniversalClassLoader. - * - * @author Fabien Potencier - * @author Jordi Boggiano - * @see https://www.php-fig.org/psr/psr-0/ - * @see https://www.php-fig.org/psr/psr-4/ - */ -class ClassLoader -{ - /** @var ?string */ - private $vendorDir; - - // PSR-4 - /** - * @var array[] - * @psalm-var array> - */ - private $prefixLengthsPsr4 = array(); - /** - * @var array[] - * @psalm-var array> - */ - private $prefixDirsPsr4 = array(); - /** - * @var array[] - * @psalm-var array - */ - private $fallbackDirsPsr4 = array(); - - // PSR-0 - /** - * @var array[] - * @psalm-var array> - */ - private $prefixesPsr0 = array(); - /** - * @var array[] - * @psalm-var array - */ - private $fallbackDirsPsr0 = array(); - - /** @var bool */ - private $useIncludePath = false; - - /** - * @var string[] - * @psalm-var array - */ - private $classMap = array(); - - /** @var bool */ - private $classMapAuthoritative = false; - - /** - * @var bool[] - * @psalm-var array - */ - private $missingClasses = array(); - - /** @var ?string */ - private $apcuPrefix; - - /** - * @var self[] - */ - private static $registeredLoaders = array(); - - /** - * @param ?string $vendorDir - */ - public function __construct($vendorDir = null) - { - $this->vendorDir = $vendorDir; - } - - /** - * @return string[] - */ - public function getPrefixes() - { - if (!empty($this->prefixesPsr0)) { - return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); - } - - return array(); - } - - /** - * @return array[] - * @psalm-return array> - */ - public function getPrefixesPsr4() - { - return $this->prefixDirsPsr4; - } - - /** - * @return array[] - * @psalm-return array - */ - public function getFallbackDirs() - { - return $this->fallbackDirsPsr0; - } - - /** - * @return array[] - * @psalm-return array - */ - public function getFallbackDirsPsr4() - { - return $this->fallbackDirsPsr4; - } - - /** - * @return string[] Array of classname => path - * @psalm-return array - */ - public function getClassMap() - { - return $this->classMap; - } - - /** - * @param string[] $classMap Class to filename map - * @psalm-param array $classMap - * - * @return void - */ - public function addClassMap(array $classMap) - { - if ($this->classMap) { - $this->classMap = array_merge($this->classMap, $classMap); - } else { - $this->classMap = $classMap; - } - } - - /** - * Registers a set of PSR-0 directories for a given prefix, either - * appending or prepending to the ones previously set for this prefix. - * - * @param string $prefix The prefix - * @param string[]|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories - * - * @return void - */ - public function add($prefix, $paths, $prepend = false) - { - if (!$prefix) { - if ($prepend) { - $this->fallbackDirsPsr0 = array_merge( - (array) $paths, - $this->fallbackDirsPsr0 - ); - } else { - $this->fallbackDirsPsr0 = array_merge( - $this->fallbackDirsPsr0, - (array) $paths - ); - } - - return; - } - - $first = $prefix[0]; - if (!isset($this->prefixesPsr0[$first][$prefix])) { - $this->prefixesPsr0[$first][$prefix] = (array) $paths; - - return; - } - if ($prepend) { - $this->prefixesPsr0[$first][$prefix] = array_merge( - (array) $paths, - $this->prefixesPsr0[$first][$prefix] - ); - } else { - $this->prefixesPsr0[$first][$prefix] = array_merge( - $this->prefixesPsr0[$first][$prefix], - (array) $paths - ); - } - } - - /** - * Registers a set of PSR-4 directories for a given namespace, either - * appending or prepending to the ones previously set for this namespace. - * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param string[]|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories - * - * @throws \InvalidArgumentException - * - * @return void - */ - public function addPsr4($prefix, $paths, $prepend = false) - { - if (!$prefix) { - // Register directories for the root namespace. - if ($prepend) { - $this->fallbackDirsPsr4 = array_merge( - (array) $paths, - $this->fallbackDirsPsr4 - ); - } else { - $this->fallbackDirsPsr4 = array_merge( - $this->fallbackDirsPsr4, - (array) $paths - ); - } - } elseif (!isset($this->prefixDirsPsr4[$prefix])) { - // Register directories for a new namespace. - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; - } elseif ($prepend) { - // Prepend directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - (array) $paths, - $this->prefixDirsPsr4[$prefix] - ); - } else { - // Append directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - $this->prefixDirsPsr4[$prefix], - (array) $paths - ); - } - } - - /** - * Registers a set of PSR-0 directories for a given prefix, - * replacing any others previously set for this prefix. - * - * @param string $prefix The prefix - * @param string[]|string $paths The PSR-0 base directories - * - * @return void - */ - public function set($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirsPsr0 = (array) $paths; - } else { - $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; - } - } - - /** - * Registers a set of PSR-4 directories for a given namespace, - * replacing any others previously set for this namespace. - * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param string[]|string $paths The PSR-4 base directories - * - * @throws \InvalidArgumentException - * - * @return void - */ - public function setPsr4($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirsPsr4 = (array) $paths; - } else { - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; - } - } - - /** - * Turns on searching the include path for class files. - * - * @param bool $useIncludePath - * - * @return void - */ - public function setUseIncludePath($useIncludePath) - { - $this->useIncludePath = $useIncludePath; - } - - /** - * Can be used to check if the autoloader uses the include path to check - * for classes. - * - * @return bool - */ - public function getUseIncludePath() - { - return $this->useIncludePath; - } - - /** - * Turns off searching the prefix and fallback directories for classes - * that have not been registered with the class map. - * - * @param bool $classMapAuthoritative - * - * @return void - */ - public function setClassMapAuthoritative($classMapAuthoritative) - { - $this->classMapAuthoritative = $classMapAuthoritative; - } - - /** - * Should class lookup fail if not found in the current class map? - * - * @return bool - */ - public function isClassMapAuthoritative() - { - return $this->classMapAuthoritative; - } - - /** - * APCu prefix to use to cache found/not-found classes, if the extension is enabled. - * - * @param string|null $apcuPrefix - * - * @return void - */ - public function setApcuPrefix($apcuPrefix) - { - $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; - } - - /** - * The APCu prefix in use, or null if APCu caching is not enabled. - * - * @return string|null - */ - public function getApcuPrefix() - { - return $this->apcuPrefix; - } - - /** - * Registers this instance as an autoloader. - * - * @param bool $prepend Whether to prepend the autoloader or not - * - * @return void - */ - public function register($prepend = false) - { - spl_autoload_register(array($this, 'loadClass'), true, $prepend); - - if (null === $this->vendorDir) { - return; - } - - if ($prepend) { - self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; - } else { - unset(self::$registeredLoaders[$this->vendorDir]); - self::$registeredLoaders[$this->vendorDir] = $this; - } - } - - /** - * Unregisters this instance as an autoloader. - * - * @return void - */ - public function unregister() - { - spl_autoload_unregister(array($this, 'loadClass')); - - if (null !== $this->vendorDir) { - unset(self::$registeredLoaders[$this->vendorDir]); - } - } - - /** - * Loads the given class or interface. - * - * @param string $class The name of the class - * @return true|null True if loaded, null otherwise - */ - public function loadClass($class) - { - if ($file = $this->findFile($class)) { - includeFile($file); - - return true; - } - - return null; - } - - /** - * Finds the path to the file where the class is defined. - * - * @param string $class The name of the class - * - * @return string|false The path if found, false otherwise - */ - public function findFile($class) - { - // class map lookup - if (isset($this->classMap[$class])) { - return $this->classMap[$class]; - } - if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { - return false; - } - if (null !== $this->apcuPrefix) { - $file = apcu_fetch($this->apcuPrefix.$class, $hit); - if ($hit) { - return $file; - } - } - - $file = $this->findFileWithExtension($class, '.php'); - - // Search for Hack files if we are running on HHVM - if (false === $file && defined('HHVM_VERSION')) { - $file = $this->findFileWithExtension($class, '.hh'); - } - - if (null !== $this->apcuPrefix) { - apcu_add($this->apcuPrefix.$class, $file); - } - - if (false === $file) { - // Remember that this class does not exist. - $this->missingClasses[$class] = true; - } - - return $file; - } - - /** - * Returns the currently registered loaders indexed by their corresponding vendor directories. - * - * @return self[] - */ - public static function getRegisteredLoaders() - { - return self::$registeredLoaders; - } - - /** - * @param string $class - * @param string $ext - * @return string|false - */ - private function findFileWithExtension($class, $ext) - { - // PSR-4 lookup - $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; - - $first = $class[0]; - if (isset($this->prefixLengthsPsr4[$first])) { - $subPath = $class; - while (false !== $lastPos = strrpos($subPath, '\\')) { - $subPath = substr($subPath, 0, $lastPos); - $search = $subPath . '\\'; - if (isset($this->prefixDirsPsr4[$search])) { - $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); - foreach ($this->prefixDirsPsr4[$search] as $dir) { - if (file_exists($file = $dir . $pathEnd)) { - return $file; - } - } - } - } - } - - // PSR-4 fallback dirs - foreach ($this->fallbackDirsPsr4 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { - return $file; - } - } - - // PSR-0 lookup - if (false !== $pos = strrpos($class, '\\')) { - // namespaced class name - $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) - . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); - } else { - // PEAR-like class name - $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; - } - - if (isset($this->prefixesPsr0[$first])) { - foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { - if (0 === strpos($class, $prefix)) { - foreach ($dirs as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - } - } - } - - // PSR-0 fallback dirs - foreach ($this->fallbackDirsPsr0 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - - // PSR-0 include paths. - if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { - return $file; - } - - return false; - } -} - -/** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - * - * @param string $file - * @return void - * @private - */ -function includeFile($file) -{ - include $file; -} diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php deleted file mode 100644 index d50e0c9..0000000 --- a/vendor/composer/InstalledVersions.php +++ /dev/null @@ -1,350 +0,0 @@ - - * Jordi Boggiano - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Composer; - -use Composer\Autoload\ClassLoader; -use Composer\Semver\VersionParser; - -/** - * This class is copied in every Composer installed project and available to all - * - * See also https://getcomposer.org/doc/07-runtime.md#installed-versions - * - * To require its presence, you can require `composer-runtime-api ^2.0` - */ -class InstalledVersions -{ - /** - * @var mixed[]|null - * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array}|array{}|null - */ - private static $installed; - - /** - * @var bool|null - */ - private static $canGetVendors; - - /** - * @var array[] - * @psalm-var array}> - */ - private static $installedByVendor = array(); - - /** - * Returns a list of all package names which are present, either by being installed, replaced or provided - * - * @return string[] - * @psalm-return list - */ - public static function getInstalledPackages() - { - $packages = array(); - foreach (self::getInstalled() as $installed) { - $packages[] = array_keys($installed['versions']); - } - - if (1 === \count($packages)) { - return $packages[0]; - } - - return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); - } - - /** - * Returns a list of all package names with a specific type e.g. 'library' - * - * @param string $type - * @return string[] - * @psalm-return list - */ - public static function getInstalledPackagesByType($type) - { - $packagesByType = array(); - - foreach (self::getInstalled() as $installed) { - foreach ($installed['versions'] as $name => $package) { - if (isset($package['type']) && $package['type'] === $type) { - $packagesByType[] = $name; - } - } - } - - return $packagesByType; - } - - /** - * Checks whether the given package is installed - * - * This also returns true if the package name is provided or replaced by another package - * - * @param string $packageName - * @param bool $includeDevRequirements - * @return bool - */ - public static function isInstalled($packageName, $includeDevRequirements = true) - { - foreach (self::getInstalled() as $installed) { - if (isset($installed['versions'][$packageName])) { - return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']); - } - } - - return false; - } - - /** - * Checks whether the given package satisfies a version constraint - * - * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: - * - * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') - * - * @param VersionParser $parser Install composer/semver to have access to this class and functionality - * @param string $packageName - * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package - * @return bool - */ - public static function satisfies(VersionParser $parser, $packageName, $constraint) - { - $constraint = $parser->parseConstraints($constraint); - $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); - - return $provided->matches($constraint); - } - - /** - * Returns a version constraint representing all the range(s) which are installed for a given package - * - * It is easier to use this via isInstalled() with the $constraint argument if you need to check - * whether a given version of a package is installed, and not just whether it exists - * - * @param string $packageName - * @return string Version constraint usable with composer/semver - */ - public static function getVersionRanges($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - $ranges = array(); - if (isset($installed['versions'][$packageName]['pretty_version'])) { - $ranges[] = $installed['versions'][$packageName]['pretty_version']; - } - if (array_key_exists('aliases', $installed['versions'][$packageName])) { - $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); - } - if (array_key_exists('replaced', $installed['versions'][$packageName])) { - $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); - } - if (array_key_exists('provided', $installed['versions'][$packageName])) { - $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); - } - - return implode(' || ', $ranges); - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present - */ - public static function getVersion($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - if (!isset($installed['versions'][$packageName]['version'])) { - return null; - } - - return $installed['versions'][$packageName]['version']; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present - */ - public static function getPrettyVersion($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - if (!isset($installed['versions'][$packageName]['pretty_version'])) { - return null; - } - - return $installed['versions'][$packageName]['pretty_version']; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference - */ - public static function getReference($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - if (!isset($installed['versions'][$packageName]['reference'])) { - return null; - } - - return $installed['versions'][$packageName]['reference']; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. - */ - public static function getInstallPath($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @return array - * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string} - */ - public static function getRootPackage() - { - $installed = self::getInstalled(); - - return $installed[0]['root']; - } - - /** - * Returns the raw installed.php data for custom implementations - * - * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. - * @return array[] - * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} - */ - public static function getRawData() - { - @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); - - if (null === self::$installed) { - // only require the installed.php file if this file is loaded from its dumped location, - // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 - if (substr(__DIR__, -8, 1) !== 'C') { - self::$installed = include __DIR__ . '/installed.php'; - } else { - self::$installed = array(); - } - } - - return self::$installed; - } - - /** - * Returns the raw data of all installed.php which are currently loaded for custom implementations - * - * @return array[] - * @psalm-return list}> - */ - public static function getAllRawData() - { - return self::getInstalled(); - } - - /** - * Lets you reload the static array from another file - * - * This is only useful for complex integrations in which a project needs to use - * this class but then also needs to execute another project's autoloader in process, - * and wants to ensure both projects have access to their version of installed.php. - * - * A typical case would be PHPUnit, where it would need to make sure it reads all - * the data it needs from this class, then call reload() with - * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure - * the project in which it runs can then also use this class safely, without - * interference between PHPUnit's dependencies and the project's dependencies. - * - * @param array[] $data A vendor/composer/installed.php data set - * @return void - * - * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} $data - */ - public static function reload($data) - { - self::$installed = $data; - self::$installedByVendor = array(); - } - - /** - * @return array[] - * @psalm-return list}> - */ - private static function getInstalled() - { - if (null === self::$canGetVendors) { - self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); - } - - $installed = array(); - - if (self::$canGetVendors) { - foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { - if (isset(self::$installedByVendor[$vendorDir])) { - $installed[] = self::$installedByVendor[$vendorDir]; - } elseif (is_file($vendorDir.'/composer/installed.php')) { - $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; - if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { - self::$installed = $installed[count($installed) - 1]; - } - } - } - } - - if (null === self::$installed) { - // only require the installed.php file if this file is loaded from its dumped location, - // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 - if (substr(__DIR__, -8, 1) !== 'C') { - self::$installed = require __DIR__ . '/installed.php'; - } else { - self::$installed = array(); - } - } - $installed[] = self::$installed; - - return $installed; - } -} diff --git a/vendor/composer/LICENSE b/vendor/composer/LICENSE deleted file mode 100644 index f27399a..0000000 --- a/vendor/composer/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - -Copyright (c) Nils Adermann, Jordi Boggiano - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php deleted file mode 100644 index 0db217c..0000000 --- a/vendor/composer/autoload_classmap.php +++ /dev/null @@ -1,854 +0,0 @@ - $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', - 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', - 'Hamcrest\\Arrays\\IsArray' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArray.php', - 'Hamcrest\\Arrays\\IsArrayContaining' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContaining.php', - 'Hamcrest\\Arrays\\IsArrayContainingInAnyOrder' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContainingInAnyOrder.php', - 'Hamcrest\\Arrays\\IsArrayContainingInOrder' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContainingInOrder.php', - 'Hamcrest\\Arrays\\IsArrayContainingKey' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContainingKey.php', - 'Hamcrest\\Arrays\\IsArrayContainingKeyValuePair' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContainingKeyValuePair.php', - 'Hamcrest\\Arrays\\IsArrayWithSize' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayWithSize.php', - 'Hamcrest\\Arrays\\MatchingOnce' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/MatchingOnce.php', - 'Hamcrest\\Arrays\\SeriesMatchingOnce' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/SeriesMatchingOnce.php', - 'Hamcrest\\AssertionError' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/AssertionError.php', - 'Hamcrest\\BaseDescription' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/BaseDescription.php', - 'Hamcrest\\BaseMatcher' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/BaseMatcher.php', - 'Hamcrest\\Collection\\IsEmptyTraversable' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Collection/IsEmptyTraversable.php', - 'Hamcrest\\Collection\\IsTraversableWithSize' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Collection/IsTraversableWithSize.php', - 'Hamcrest\\Core\\AllOf' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/AllOf.php', - 'Hamcrest\\Core\\AnyOf' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/AnyOf.php', - 'Hamcrest\\Core\\CombinableMatcher' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/CombinableMatcher.php', - 'Hamcrest\\Core\\DescribedAs' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/DescribedAs.php', - 'Hamcrest\\Core\\Every' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/Every.php', - 'Hamcrest\\Core\\HasToString' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/HasToString.php', - 'Hamcrest\\Core\\Is' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/Is.php', - 'Hamcrest\\Core\\IsAnything' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsAnything.php', - 'Hamcrest\\Core\\IsCollectionContaining' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsCollectionContaining.php', - 'Hamcrest\\Core\\IsEqual' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsEqual.php', - 'Hamcrest\\Core\\IsIdentical' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsIdentical.php', - 'Hamcrest\\Core\\IsInstanceOf' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsInstanceOf.php', - 'Hamcrest\\Core\\IsNot' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsNot.php', - 'Hamcrest\\Core\\IsNull' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsNull.php', - 'Hamcrest\\Core\\IsSame' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsSame.php', - 'Hamcrest\\Core\\IsTypeOf' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsTypeOf.php', - 'Hamcrest\\Core\\Set' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/Set.php', - 'Hamcrest\\Core\\ShortcutCombination' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/ShortcutCombination.php', - 'Hamcrest\\Description' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Description.php', - 'Hamcrest\\DiagnosingMatcher' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/DiagnosingMatcher.php', - 'Hamcrest\\FeatureMatcher' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/FeatureMatcher.php', - 'Hamcrest\\Internal\\SelfDescribingValue' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Internal/SelfDescribingValue.php', - 'Hamcrest\\Matcher' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Matcher.php', - 'Hamcrest\\MatcherAssert' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/MatcherAssert.php', - 'Hamcrest\\Matchers' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Matchers.php', - 'Hamcrest\\NullDescription' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/NullDescription.php', - 'Hamcrest\\Number\\IsCloseTo' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Number/IsCloseTo.php', - 'Hamcrest\\Number\\OrderingComparison' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Number/OrderingComparison.php', - 'Hamcrest\\SelfDescribing' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/SelfDescribing.php', - 'Hamcrest\\StringDescription' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/StringDescription.php', - 'Hamcrest\\Text\\IsEmptyString' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/IsEmptyString.php', - 'Hamcrest\\Text\\IsEqualIgnoringCase' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/IsEqualIgnoringCase.php', - 'Hamcrest\\Text\\IsEqualIgnoringWhiteSpace' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/IsEqualIgnoringWhiteSpace.php', - 'Hamcrest\\Text\\MatchesPattern' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/MatchesPattern.php', - 'Hamcrest\\Text\\StringContains' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringContains.php', - 'Hamcrest\\Text\\StringContainsIgnoringCase' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringContainsIgnoringCase.php', - 'Hamcrest\\Text\\StringContainsInOrder' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringContainsInOrder.php', - 'Hamcrest\\Text\\StringEndsWith' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringEndsWith.php', - 'Hamcrest\\Text\\StringStartsWith' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringStartsWith.php', - 'Hamcrest\\Text\\SubstringMatcher' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/SubstringMatcher.php', - 'Hamcrest\\TypeSafeDiagnosingMatcher' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/TypeSafeDiagnosingMatcher.php', - 'Hamcrest\\TypeSafeMatcher' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/TypeSafeMatcher.php', - 'Hamcrest\\Type\\IsArray' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsArray.php', - 'Hamcrest\\Type\\IsBoolean' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsBoolean.php', - 'Hamcrest\\Type\\IsCallable' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsCallable.php', - 'Hamcrest\\Type\\IsDouble' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsDouble.php', - 'Hamcrest\\Type\\IsInteger' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsInteger.php', - 'Hamcrest\\Type\\IsNumeric' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsNumeric.php', - 'Hamcrest\\Type\\IsObject' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsObject.php', - 'Hamcrest\\Type\\IsResource' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsResource.php', - 'Hamcrest\\Type\\IsScalar' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsScalar.php', - 'Hamcrest\\Type\\IsString' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsString.php', - 'Hamcrest\\Util' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Util.php', - 'Hamcrest\\Xml\\HasXPath' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Xml/HasXPath.php', - 'JakubOnderka\\PhpParallelLint\\Application' => $vendorDir . '/php-parallel-lint/php-parallel-lint/src/Application.php', - 'JakubOnderka\\PhpParallelLint\\ArrayIterator' => $vendorDir . '/php-parallel-lint/php-parallel-lint/src/Settings.php', - 'JakubOnderka\\PhpParallelLint\\Blame' => $vendorDir . '/php-parallel-lint/php-parallel-lint/src/Error.php', - 'JakubOnderka\\PhpParallelLint\\CheckstyleOutput' => $vendorDir . '/php-parallel-lint/php-parallel-lint/src/Output.php', - 'JakubOnderka\\PhpParallelLint\\ConsoleWriter' => $vendorDir . '/php-parallel-lint/php-parallel-lint/src/Output.php', - 'JakubOnderka\\PhpParallelLint\\Contracts\\SyntaxErrorCallback' => $vendorDir . '/php-parallel-lint/php-parallel-lint/src/Contracts/SyntaxErrorCallback.php', - 'JakubOnderka\\PhpParallelLint\\Error' => $vendorDir . '/php-parallel-lint/php-parallel-lint/src/Error.php', - 'JakubOnderka\\PhpParallelLint\\ErrorFormatter' => $vendorDir . '/php-parallel-lint/php-parallel-lint/src/ErrorFormatter.php', - 'JakubOnderka\\PhpParallelLint\\Exception' => $vendorDir . '/php-parallel-lint/php-parallel-lint/src/exceptions.php', - 'JakubOnderka\\PhpParallelLint\\FileWriter' => $vendorDir . '/php-parallel-lint/php-parallel-lint/src/Output.php', - 'JakubOnderka\\PhpParallelLint\\GitLabOutput' => $vendorDir . '/php-parallel-lint/php-parallel-lint/src/Output.php', - 'JakubOnderka\\PhpParallelLint\\IWriter' => $vendorDir . '/php-parallel-lint/php-parallel-lint/src/Output.php', - 'JakubOnderka\\PhpParallelLint\\InvalidArgumentException' => $vendorDir . '/php-parallel-lint/php-parallel-lint/src/exceptions.php', - 'JakubOnderka\\PhpParallelLint\\JsonOutput' => $vendorDir . '/php-parallel-lint/php-parallel-lint/src/Output.php', - 'JakubOnderka\\PhpParallelLint\\Manager' => $vendorDir . '/php-parallel-lint/php-parallel-lint/src/Manager.php', - 'JakubOnderka\\PhpParallelLint\\MultipleWriter' => $vendorDir . '/php-parallel-lint/php-parallel-lint/src/Output.php', - 'JakubOnderka\\PhpParallelLint\\NotExistsClassException' => $vendorDir . '/php-parallel-lint/php-parallel-lint/src/exceptions.php', - 'JakubOnderka\\PhpParallelLint\\NotExistsPathException' => $vendorDir . '/php-parallel-lint/php-parallel-lint/src/exceptions.php', - 'JakubOnderka\\PhpParallelLint\\NotImplementCallbackException' => $vendorDir . '/php-parallel-lint/php-parallel-lint/src/exceptions.php', - 'JakubOnderka\\PhpParallelLint\\NullWriter' => $vendorDir . '/php-parallel-lint/php-parallel-lint/src/Output.php', - 'JakubOnderka\\PhpParallelLint\\Output' => $vendorDir . '/php-parallel-lint/php-parallel-lint/src/Output.php', - 'JakubOnderka\\PhpParallelLint\\ParallelLint' => $vendorDir . '/php-parallel-lint/php-parallel-lint/src/ParallelLint.php', - 'JakubOnderka\\PhpParallelLint\\Process\\GitBlameProcess' => $vendorDir . '/php-parallel-lint/php-parallel-lint/src/Process/GitBlameProcess.php', - 'JakubOnderka\\PhpParallelLint\\Process\\LintProcess' => $vendorDir . '/php-parallel-lint/php-parallel-lint/src/Process/LintProcess.php', - 'JakubOnderka\\PhpParallelLint\\Process\\PhpExecutable' => $vendorDir . '/php-parallel-lint/php-parallel-lint/src/Process/PhpExecutable.php', - 'JakubOnderka\\PhpParallelLint\\Process\\PhpProcess' => $vendorDir . '/php-parallel-lint/php-parallel-lint/src/Process/PhpProcess.php', - 'JakubOnderka\\PhpParallelLint\\Process\\Process' => $vendorDir . '/php-parallel-lint/php-parallel-lint/src/Process/Process.php', - 'JakubOnderka\\PhpParallelLint\\Process\\SkipLintProcess' => $vendorDir . '/php-parallel-lint/php-parallel-lint/src/Process/SkipLintProcess.php', - 'JakubOnderka\\PhpParallelLint\\RecursiveDirectoryFilterIterator' => $vendorDir . '/php-parallel-lint/php-parallel-lint/src/Manager.php', - 'JakubOnderka\\PhpParallelLint\\Result' => $vendorDir . '/php-parallel-lint/php-parallel-lint/src/Result.php', - 'JakubOnderka\\PhpParallelLint\\RunTimeException' => $vendorDir . '/php-parallel-lint/php-parallel-lint/src/exceptions.php', - 'JakubOnderka\\PhpParallelLint\\Settings' => $vendorDir . '/php-parallel-lint/php-parallel-lint/src/Settings.php', - 'JakubOnderka\\PhpParallelLint\\SyntaxError' => $vendorDir . '/php-parallel-lint/php-parallel-lint/src/Error.php', - 'JakubOnderka\\PhpParallelLint\\TextOutput' => $vendorDir . '/php-parallel-lint/php-parallel-lint/src/Output.php', - 'JakubOnderka\\PhpParallelLint\\TextOutputColored' => $vendorDir . '/php-parallel-lint/php-parallel-lint/src/Output.php', - 'JsonException' => $vendorDir . '/symfony/polyfill-php73/Resources/stubs/JsonException.php', - 'JsonSerializable' => $vendorDir . '/php-parallel-lint/php-parallel-lint/src/polyfill.php', - 'Nette\\ArgumentOutOfRangeException' => $vendorDir . '/nette/utils/src/exceptions.php', - 'Nette\\Bootstrap\\Configurator' => $vendorDir . '/nette/bootstrap/src/Bootstrap/Configurator.php', - 'Nette\\Bootstrap\\Extensions\\ConstantsExtension' => $vendorDir . '/nette/bootstrap/src/Bootstrap/Extensions/ConstantsExtension.php', - 'Nette\\Bootstrap\\Extensions\\PhpExtension' => $vendorDir . '/nette/bootstrap/src/Bootstrap/Extensions/PhpExtension.php', - 'Nette\\Bridges\\DITracy\\ContainerPanel' => $vendorDir . '/nette/di/src/Bridges/DITracy/ContainerPanel.php', - 'Nette\\Configurator' => $vendorDir . '/nette/bootstrap/src/Configurator.php', - 'Nette\\DI\\Attributes\\Inject' => $vendorDir . '/nette/di/src/DI/Attributes/Inject.php', - 'Nette\\DI\\Autowiring' => $vendorDir . '/nette/di/src/DI/Autowiring.php', - 'Nette\\DI\\Compiler' => $vendorDir . '/nette/di/src/DI/Compiler.php', - 'Nette\\DI\\CompilerExtension' => $vendorDir . '/nette/di/src/DI/CompilerExtension.php', - 'Nette\\DI\\Config\\Adapter' => $vendorDir . '/nette/di/src/DI/Config/Adapter.php', - 'Nette\\DI\\Config\\Adapters\\NeonAdapter' => $vendorDir . '/nette/di/src/DI/Config/Adapters/NeonAdapter.php', - 'Nette\\DI\\Config\\Adapters\\PhpAdapter' => $vendorDir . '/nette/di/src/DI/Config/Adapters/PhpAdapter.php', - 'Nette\\DI\\Config\\DefinitionSchema' => $vendorDir . '/nette/di/src/DI/Config/DefinitionSchema.php', - 'Nette\\DI\\Config\\Helpers' => $vendorDir . '/nette/di/src/DI/Config/Helpers.php', - 'Nette\\DI\\Config\\IAdapter' => $vendorDir . '/nette/di/src/compatibility.php', - 'Nette\\DI\\Config\\Loader' => $vendorDir . '/nette/di/src/DI/Config/Loader.php', - 'Nette\\DI\\Container' => $vendorDir . '/nette/di/src/DI/Container.php', - 'Nette\\DI\\ContainerBuilder' => $vendorDir . '/nette/di/src/DI/ContainerBuilder.php', - 'Nette\\DI\\ContainerLoader' => $vendorDir . '/nette/di/src/DI/ContainerLoader.php', - 'Nette\\DI\\Definitions\\AccessorDefinition' => $vendorDir . '/nette/di/src/DI/Definitions/AccessorDefinition.php', - 'Nette\\DI\\Definitions\\Definition' => $vendorDir . '/nette/di/src/DI/Definitions/Definition.php', - 'Nette\\DI\\Definitions\\FactoryDefinition' => $vendorDir . '/nette/di/src/DI/Definitions/FactoryDefinition.php', - 'Nette\\DI\\Definitions\\ImportedDefinition' => $vendorDir . '/nette/di/src/DI/Definitions/ImportedDefinition.php', - 'Nette\\DI\\Definitions\\LocatorDefinition' => $vendorDir . '/nette/di/src/DI/Definitions/LocatorDefinition.php', - 'Nette\\DI\\Definitions\\Reference' => $vendorDir . '/nette/di/src/DI/Definitions/Reference.php', - 'Nette\\DI\\Definitions\\ServiceDefinition' => $vendorDir . '/nette/di/src/DI/Definitions/ServiceDefinition.php', - 'Nette\\DI\\Definitions\\Statement' => $vendorDir . '/nette/di/src/DI/Definitions/Statement.php', - 'Nette\\DI\\DependencyChecker' => $vendorDir . '/nette/di/src/DI/DependencyChecker.php', - 'Nette\\DI\\DynamicParameter' => $vendorDir . '/nette/di/src/DI/DynamicParameter.php', - 'Nette\\DI\\Extensions\\ConstantsExtension' => $vendorDir . '/nette/di/src/DI/Extensions/ConstantsExtension.php', - 'Nette\\DI\\Extensions\\DIExtension' => $vendorDir . '/nette/di/src/DI/Extensions/DIExtension.php', - 'Nette\\DI\\Extensions\\DecoratorExtension' => $vendorDir . '/nette/di/src/DI/Extensions/DecoratorExtension.php', - 'Nette\\DI\\Extensions\\ExtensionsExtension' => $vendorDir . '/nette/di/src/DI/Extensions/ExtensionsExtension.php', - 'Nette\\DI\\Extensions\\InjectExtension' => $vendorDir . '/nette/di/src/DI/Extensions/InjectExtension.php', - 'Nette\\DI\\Extensions\\ParametersExtension' => $vendorDir . '/nette/di/src/DI/Extensions/ParametersExtension.php', - 'Nette\\DI\\Extensions\\PhpExtension' => $vendorDir . '/nette/di/src/DI/Extensions/PhpExtension.php', - 'Nette\\DI\\Extensions\\SearchExtension' => $vendorDir . '/nette/di/src/DI/Extensions/SearchExtension.php', - 'Nette\\DI\\Extensions\\ServicesExtension' => $vendorDir . '/nette/di/src/DI/Extensions/ServicesExtension.php', - 'Nette\\DI\\Helpers' => $vendorDir . '/nette/di/src/DI/Helpers.php', - 'Nette\\DI\\InvalidConfigurationException' => $vendorDir . '/nette/di/src/DI/exceptions.php', - 'Nette\\DI\\MissingServiceException' => $vendorDir . '/nette/di/src/DI/exceptions.php', - 'Nette\\DI\\NotAllowedDuringResolvingException' => $vendorDir . '/nette/di/src/DI/exceptions.php', - 'Nette\\DI\\PhpGenerator' => $vendorDir . '/nette/di/src/DI/PhpGenerator.php', - 'Nette\\DI\\Resolver' => $vendorDir . '/nette/di/src/DI/Resolver.php', - 'Nette\\DI\\ServiceCreationException' => $vendorDir . '/nette/di/src/DI/exceptions.php', - 'Nette\\DI\\ServiceDefinition' => $vendorDir . '/nette/di/src/compatibility.php', - 'Nette\\DI\\Statement' => $vendorDir . '/nette/di/src/compatibility.php', - 'Nette\\DeprecatedException' => $vendorDir . '/nette/utils/src/exceptions.php', - 'Nette\\DirectoryNotFoundException' => $vendorDir . '/nette/utils/src/exceptions.php', - 'Nette\\FileNotFoundException' => $vendorDir . '/nette/utils/src/exceptions.php', - 'Nette\\HtmlStringable' => $vendorDir . '/nette/utils/src/HtmlStringable.php', - 'Nette\\IOException' => $vendorDir . '/nette/utils/src/exceptions.php', - 'Nette\\InvalidArgumentException' => $vendorDir . '/nette/utils/src/exceptions.php', - 'Nette\\InvalidStateException' => $vendorDir . '/nette/utils/src/exceptions.php', - 'Nette\\Iterators\\CachingIterator' => $vendorDir . '/nette/utils/src/Iterators/CachingIterator.php', - 'Nette\\Iterators\\Mapper' => $vendorDir . '/nette/utils/src/Iterators/Mapper.php', - 'Nette\\Loaders\\RobotLoader' => $vendorDir . '/nette/robot-loader/src/RobotLoader/RobotLoader.php', - 'Nette\\Localization\\ITranslator' => $vendorDir . '/nette/utils/src/compatibility.php', - 'Nette\\Localization\\Translator' => $vendorDir . '/nette/utils/src/Translator.php', - 'Nette\\MemberAccessException' => $vendorDir . '/nette/utils/src/exceptions.php', - 'Nette\\Neon\\Decoder' => $vendorDir . '/nette/neon/src/Neon/Decoder.php', - 'Nette\\Neon\\Encoder' => $vendorDir . '/nette/neon/src/Neon/Encoder.php', - 'Nette\\Neon\\Entity' => $vendorDir . '/nette/neon/src/Neon/Entity.php', - 'Nette\\Neon\\Exception' => $vendorDir . '/nette/neon/src/Neon/Exception.php', - 'Nette\\Neon\\Lexer' => $vendorDir . '/nette/neon/src/Neon/Lexer.php', - 'Nette\\Neon\\Neon' => $vendorDir . '/nette/neon/src/Neon/Neon.php', - 'Nette\\Neon\\Node' => $vendorDir . '/nette/neon/src/Neon/Node.php', - 'Nette\\Neon\\Node\\ArrayItemNode' => $vendorDir . '/nette/neon/src/Neon/Node/ArrayItemNode.php', - 'Nette\\Neon\\Node\\ArrayNode' => $vendorDir . '/nette/neon/src/Neon/Node/ArrayNode.php', - 'Nette\\Neon\\Node\\BlockArrayNode' => $vendorDir . '/nette/neon/src/Neon/Node/BlockArrayNode.php', - 'Nette\\Neon\\Node\\EntityChainNode' => $vendorDir . '/nette/neon/src/Neon/Node/EntityChainNode.php', - 'Nette\\Neon\\Node\\EntityNode' => $vendorDir . '/nette/neon/src/Neon/Node/EntityNode.php', - 'Nette\\Neon\\Node\\InlineArrayNode' => $vendorDir . '/nette/neon/src/Neon/Node/InlineArrayNode.php', - 'Nette\\Neon\\Node\\LiteralNode' => $vendorDir . '/nette/neon/src/Neon/Node/LiteralNode.php', - 'Nette\\Neon\\Node\\StringNode' => $vendorDir . '/nette/neon/src/Neon/Node/StringNode.php', - 'Nette\\Neon\\Parser' => $vendorDir . '/nette/neon/src/Neon/Parser.php', - 'Nette\\Neon\\Token' => $vendorDir . '/nette/neon/src/Neon/Token.php', - 'Nette\\Neon\\TokenStream' => $vendorDir . '/nette/neon/src/Neon/TokenStream.php', - 'Nette\\Neon\\Traverser' => $vendorDir . '/nette/neon/src/Neon/Traverser.php', - 'Nette\\NotImplementedException' => $vendorDir . '/nette/utils/src/exceptions.php', - 'Nette\\NotSupportedException' => $vendorDir . '/nette/utils/src/exceptions.php', - 'Nette\\OutOfRangeException' => $vendorDir . '/nette/utils/src/exceptions.php', - 'Nette\\PhpGenerator\\Attribute' => $vendorDir . '/nette/php-generator/src/PhpGenerator/Attribute.php', - 'Nette\\PhpGenerator\\ClassType' => $vendorDir . '/nette/php-generator/src/PhpGenerator/ClassType.php', - 'Nette\\PhpGenerator\\Closure' => $vendorDir . '/nette/php-generator/src/PhpGenerator/Closure.php', - 'Nette\\PhpGenerator\\Constant' => $vendorDir . '/nette/php-generator/src/PhpGenerator/Constant.php', - 'Nette\\PhpGenerator\\Dumper' => $vendorDir . '/nette/php-generator/src/PhpGenerator/Dumper.php', - 'Nette\\PhpGenerator\\EnumCase' => $vendorDir . '/nette/php-generator/src/PhpGenerator/EnumCase.php', - 'Nette\\PhpGenerator\\Extractor' => $vendorDir . '/nette/php-generator/src/PhpGenerator/Extractor.php', - 'Nette\\PhpGenerator\\Factory' => $vendorDir . '/nette/php-generator/src/PhpGenerator/Factory.php', - 'Nette\\PhpGenerator\\GlobalFunction' => $vendorDir . '/nette/php-generator/src/PhpGenerator/GlobalFunction.php', - 'Nette\\PhpGenerator\\Helpers' => $vendorDir . '/nette/php-generator/src/PhpGenerator/Helpers.php', - 'Nette\\PhpGenerator\\Literal' => $vendorDir . '/nette/php-generator/src/PhpGenerator/Literal.php', - 'Nette\\PhpGenerator\\Method' => $vendorDir . '/nette/php-generator/src/PhpGenerator/Method.php', - 'Nette\\PhpGenerator\\Parameter' => $vendorDir . '/nette/php-generator/src/PhpGenerator/Parameter.php', - 'Nette\\PhpGenerator\\PhpFile' => $vendorDir . '/nette/php-generator/src/PhpGenerator/PhpFile.php', - 'Nette\\PhpGenerator\\PhpLiteral' => $vendorDir . '/nette/php-generator/src/PhpGenerator/PhpLiteral.php', - 'Nette\\PhpGenerator\\PhpNamespace' => $vendorDir . '/nette/php-generator/src/PhpGenerator/PhpNamespace.php', - 'Nette\\PhpGenerator\\Printer' => $vendorDir . '/nette/php-generator/src/PhpGenerator/Printer.php', - 'Nette\\PhpGenerator\\PromotedParameter' => $vendorDir . '/nette/php-generator/src/PhpGenerator/PromotedParameter.php', - 'Nette\\PhpGenerator\\Property' => $vendorDir . '/nette/php-generator/src/PhpGenerator/Property.php', - 'Nette\\PhpGenerator\\PsrPrinter' => $vendorDir . '/nette/php-generator/src/PhpGenerator/PsrPrinter.php', - 'Nette\\PhpGenerator\\TraitUse' => $vendorDir . '/nette/php-generator/src/PhpGenerator/TraitUse.php', - 'Nette\\PhpGenerator\\Traits\\AttributeAware' => $vendorDir . '/nette/php-generator/src/PhpGenerator/Traits/AttributeAware.php', - 'Nette\\PhpGenerator\\Traits\\CommentAware' => $vendorDir . '/nette/php-generator/src/PhpGenerator/Traits/CommentAware.php', - 'Nette\\PhpGenerator\\Traits\\FunctionLike' => $vendorDir . '/nette/php-generator/src/PhpGenerator/Traits/FunctionLike.php', - 'Nette\\PhpGenerator\\Traits\\NameAware' => $vendorDir . '/nette/php-generator/src/PhpGenerator/Traits/NameAware.php', - 'Nette\\PhpGenerator\\Traits\\VisibilityAware' => $vendorDir . '/nette/php-generator/src/PhpGenerator/Traits/VisibilityAware.php', - 'Nette\\PhpGenerator\\Type' => $vendorDir . '/nette/php-generator/src/PhpGenerator/Type.php', - 'Nette\\Schema\\Context' => $vendorDir . '/nette/schema/src/Schema/Context.php', - 'Nette\\Schema\\DynamicParameter' => $vendorDir . '/nette/schema/src/Schema/DynamicParameter.php', - 'Nette\\Schema\\Elements\\AnyOf' => $vendorDir . '/nette/schema/src/Schema/Elements/AnyOf.php', - 'Nette\\Schema\\Elements\\Base' => $vendorDir . '/nette/schema/src/Schema/Elements/Base.php', - 'Nette\\Schema\\Elements\\Structure' => $vendorDir . '/nette/schema/src/Schema/Elements/Structure.php', - 'Nette\\Schema\\Elements\\Type' => $vendorDir . '/nette/schema/src/Schema/Elements/Type.php', - 'Nette\\Schema\\Expect' => $vendorDir . '/nette/schema/src/Schema/Expect.php', - 'Nette\\Schema\\Helpers' => $vendorDir . '/nette/schema/src/Schema/Helpers.php', - 'Nette\\Schema\\Message' => $vendorDir . '/nette/schema/src/Schema/Message.php', - 'Nette\\Schema\\Processor' => $vendorDir . '/nette/schema/src/Schema/Processor.php', - 'Nette\\Schema\\Schema' => $vendorDir . '/nette/schema/src/Schema/Schema.php', - 'Nette\\Schema\\ValidationException' => $vendorDir . '/nette/schema/src/Schema/ValidationException.php', - 'Nette\\SmartObject' => $vendorDir . '/nette/utils/src/SmartObject.php', - 'Nette\\StaticClass' => $vendorDir . '/nette/utils/src/StaticClass.php', - 'Nette\\UnexpectedValueException' => $vendorDir . '/nette/utils/src/exceptions.php', - 'Nette\\Utils\\ArrayHash' => $vendorDir . '/nette/utils/src/Utils/ArrayHash.php', - 'Nette\\Utils\\ArrayList' => $vendorDir . '/nette/utils/src/Utils/ArrayList.php', - 'Nette\\Utils\\Arrays' => $vendorDir . '/nette/utils/src/Utils/Arrays.php', - 'Nette\\Utils\\AssertionException' => $vendorDir . '/nette/utils/src/Utils/exceptions.php', - 'Nette\\Utils\\Callback' => $vendorDir . '/nette/utils/src/Utils/Callback.php', - 'Nette\\Utils\\DateTime' => $vendorDir . '/nette/utils/src/Utils/DateTime.php', - 'Nette\\Utils\\FileSystem' => $vendorDir . '/nette/utils/src/Utils/FileSystem.php', - 'Nette\\Utils\\Finder' => $vendorDir . '/nette/finder/src/Utils/Finder.php', - 'Nette\\Utils\\Floats' => $vendorDir . '/nette/utils/src/Utils/Floats.php', - 'Nette\\Utils\\Helpers' => $vendorDir . '/nette/utils/src/Utils/Helpers.php', - 'Nette\\Utils\\Html' => $vendorDir . '/nette/utils/src/Utils/Html.php', - 'Nette\\Utils\\IHtmlString' => $vendorDir . '/nette/utils/src/compatibility.php', - 'Nette\\Utils\\Image' => $vendorDir . '/nette/utils/src/Utils/Image.php', - 'Nette\\Utils\\ImageException' => $vendorDir . '/nette/utils/src/Utils/exceptions.php', - 'Nette\\Utils\\Json' => $vendorDir . '/nette/utils/src/Utils/Json.php', - 'Nette\\Utils\\JsonException' => $vendorDir . '/nette/utils/src/Utils/exceptions.php', - 'Nette\\Utils\\ObjectHelpers' => $vendorDir . '/nette/utils/src/Utils/ObjectHelpers.php', - 'Nette\\Utils\\ObjectMixin' => $vendorDir . '/nette/utils/src/Utils/ObjectMixin.php', - 'Nette\\Utils\\Paginator' => $vendorDir . '/nette/utils/src/Utils/Paginator.php', - 'Nette\\Utils\\Random' => $vendorDir . '/nette/utils/src/Utils/Random.php', - 'Nette\\Utils\\Reflection' => $vendorDir . '/nette/utils/src/Utils/Reflection.php', - 'Nette\\Utils\\RegexpException' => $vendorDir . '/nette/utils/src/Utils/exceptions.php', - 'Nette\\Utils\\Strings' => $vendorDir . '/nette/utils/src/Utils/Strings.php', - 'Nette\\Utils\\Type' => $vendorDir . '/nette/utils/src/Utils/Type.php', - 'Nette\\Utils\\UnknownImageFileException' => $vendorDir . '/nette/utils/src/Utils/exceptions.php', - 'Nette\\Utils\\Validators' => $vendorDir . '/nette/utils/src/Utils/Validators.php', - 'PHPUnit\\Exception' => $vendorDir . '/phpunit/phpunit/src/Exception.php', - 'PHPUnit\\Framework\\Assert' => $vendorDir . '/phpunit/phpunit/src/Framework/Assert.php', - 'PHPUnit\\Framework\\AssertionFailedError' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/AssertionFailedError.php', - 'PHPUnit\\Framework\\CodeCoverageException' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/CodeCoverageException.php', - 'PHPUnit\\Framework\\Constraint\\ArrayHasKey' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/ArrayHasKey.php', - 'PHPUnit\\Framework\\Constraint\\ArraySubset' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/ArraySubset.php', - 'PHPUnit\\Framework\\Constraint\\Attribute' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Attribute.php', - 'PHPUnit\\Framework\\Constraint\\Callback' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Callback.php', - 'PHPUnit\\Framework\\Constraint\\ClassHasAttribute' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/ClassHasAttribute.php', - 'PHPUnit\\Framework\\Constraint\\ClassHasStaticAttribute' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/ClassHasStaticAttribute.php', - 'PHPUnit\\Framework\\Constraint\\Composite' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Composite.php', - 'PHPUnit\\Framework\\Constraint\\Constraint' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Constraint.php', - 'PHPUnit\\Framework\\Constraint\\Count' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Count.php', - 'PHPUnit\\Framework\\Constraint\\DirectoryExists' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/DirectoryExists.php', - 'PHPUnit\\Framework\\Constraint\\Exception' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Exception.php', - 'PHPUnit\\Framework\\Constraint\\ExceptionCode' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/ExceptionCode.php', - 'PHPUnit\\Framework\\Constraint\\ExceptionMessage' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/ExceptionMessage.php', - 'PHPUnit\\Framework\\Constraint\\ExceptionMessageRegularExpression' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/ExceptionMessageRegularExpression.php', - 'PHPUnit\\Framework\\Constraint\\FileExists' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/FileExists.php', - 'PHPUnit\\Framework\\Constraint\\GreaterThan' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/GreaterThan.php', - 'PHPUnit\\Framework\\Constraint\\IsAnything' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/IsAnything.php', - 'PHPUnit\\Framework\\Constraint\\IsEmpty' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/IsEmpty.php', - 'PHPUnit\\Framework\\Constraint\\IsEqual' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/IsEqual.php', - 'PHPUnit\\Framework\\Constraint\\IsFalse' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/IsFalse.php', - 'PHPUnit\\Framework\\Constraint\\IsFinite' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/IsFinite.php', - 'PHPUnit\\Framework\\Constraint\\IsIdentical' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/IsIdentical.php', - 'PHPUnit\\Framework\\Constraint\\IsInfinite' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/IsInfinite.php', - 'PHPUnit\\Framework\\Constraint\\IsInstanceOf' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/IsInstanceOf.php', - 'PHPUnit\\Framework\\Constraint\\IsJson' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/IsJson.php', - 'PHPUnit\\Framework\\Constraint\\IsNan' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/IsNan.php', - 'PHPUnit\\Framework\\Constraint\\IsNull' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/IsNull.php', - 'PHPUnit\\Framework\\Constraint\\IsReadable' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/IsReadable.php', - 'PHPUnit\\Framework\\Constraint\\IsTrue' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/IsTrue.php', - 'PHPUnit\\Framework\\Constraint\\IsType' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/IsType.php', - 'PHPUnit\\Framework\\Constraint\\IsWritable' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/IsWritable.php', - 'PHPUnit\\Framework\\Constraint\\JsonMatches' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/JsonMatches.php', - 'PHPUnit\\Framework\\Constraint\\JsonMatchesErrorMessageProvider' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/JsonMatchesErrorMessageProvider.php', - 'PHPUnit\\Framework\\Constraint\\LessThan' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/LessThan.php', - 'PHPUnit\\Framework\\Constraint\\LogicalAnd' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/LogicalAnd.php', - 'PHPUnit\\Framework\\Constraint\\LogicalNot' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/LogicalNot.php', - 'PHPUnit\\Framework\\Constraint\\LogicalOr' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/LogicalOr.php', - 'PHPUnit\\Framework\\Constraint\\LogicalXor' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/LogicalXor.php', - 'PHPUnit\\Framework\\Constraint\\ObjectHasAttribute' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/ObjectHasAttribute.php', - 'PHPUnit\\Framework\\Constraint\\RegularExpression' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/RegularExpression.php', - 'PHPUnit\\Framework\\Constraint\\SameSize' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/SameSize.php', - 'PHPUnit\\Framework\\Constraint\\StringContains' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/StringContains.php', - 'PHPUnit\\Framework\\Constraint\\StringEndsWith' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/StringEndsWith.php', - 'PHPUnit\\Framework\\Constraint\\StringMatchesFormatDescription' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/StringMatchesFormatDescription.php', - 'PHPUnit\\Framework\\Constraint\\StringStartsWith' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/StringStartsWith.php', - 'PHPUnit\\Framework\\Constraint\\TraversableContains' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/TraversableContains.php', - 'PHPUnit\\Framework\\Constraint\\TraversableContainsEqual' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/TraversableContainsEqual.php', - 'PHPUnit\\Framework\\Constraint\\TraversableContainsIdentical' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/TraversableContainsIdentical.php', - 'PHPUnit\\Framework\\Constraint\\TraversableContainsOnly' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/TraversableContainsOnly.php', - 'PHPUnit\\Framework\\CoveredCodeNotExecutedException' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/CoveredCodeNotExecutedException.php', - 'PHPUnit\\Framework\\DataProviderTestSuite' => $vendorDir . '/phpunit/phpunit/src/Framework/DataProviderTestSuite.php', - 'PHPUnit\\Framework\\Error\\Deprecated' => $vendorDir . '/phpunit/phpunit/src/Framework/Error/Deprecated.php', - 'PHPUnit\\Framework\\Error\\Error' => $vendorDir . '/phpunit/phpunit/src/Framework/Error/Error.php', - 'PHPUnit\\Framework\\Error\\Notice' => $vendorDir . '/phpunit/phpunit/src/Framework/Error/Notice.php', - 'PHPUnit\\Framework\\Error\\Warning' => $vendorDir . '/phpunit/phpunit/src/Framework/Error/Warning.php', - 'PHPUnit\\Framework\\Exception' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/Exception.php', - 'PHPUnit\\Framework\\ExceptionWrapper' => $vendorDir . '/phpunit/phpunit/src/Framework/ExceptionWrapper.php', - 'PHPUnit\\Framework\\ExpectationFailedException' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/ExpectationFailedException.php', - 'PHPUnit\\Framework\\IncompleteTest' => $vendorDir . '/phpunit/phpunit/src/Framework/IncompleteTest.php', - 'PHPUnit\\Framework\\IncompleteTestCase' => $vendorDir . '/phpunit/phpunit/src/Framework/IncompleteTestCase.php', - 'PHPUnit\\Framework\\IncompleteTestError' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/IncompleteTestError.php', - 'PHPUnit\\Framework\\InvalidArgumentException' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/InvalidArgumentException.php', - 'PHPUnit\\Framework\\InvalidCoversTargetException' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/InvalidCoversTargetException.php', - 'PHPUnit\\Framework\\InvalidDataProviderException' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/InvalidDataProviderException.php', - 'PHPUnit\\Framework\\InvalidParameterGroupException' => $vendorDir . '/phpunit/phpunit/src/Framework/InvalidParameterGroupException.php', - 'PHPUnit\\Framework\\MissingCoversAnnotationException' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/MissingCoversAnnotationException.php', - 'PHPUnit\\Framework\\MockObject\\Api' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Api/Api.php', - 'PHPUnit\\Framework\\MockObject\\BadMethodCallException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/BadMethodCallException.php', - 'PHPUnit\\Framework\\MockObject\\Builder\\Identity' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Builder/Identity.php', - 'PHPUnit\\Framework\\MockObject\\Builder\\InvocationMocker' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationMocker.php', - 'PHPUnit\\Framework\\MockObject\\Builder\\InvocationStubber' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationStubber.php', - 'PHPUnit\\Framework\\MockObject\\Builder\\Match_' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Builder/Match_.php', - 'PHPUnit\\Framework\\MockObject\\Builder\\MethodNameMatch' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Builder/MethodNameMatch.php', - 'PHPUnit\\Framework\\MockObject\\Builder\\ParametersMatch' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Builder/ParametersMatch.php', - 'PHPUnit\\Framework\\MockObject\\Builder\\Stub' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Builder/Stub.php', - 'PHPUnit\\Framework\\MockObject\\ConfigurableMethod' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/ConfigurableMethod.php', - 'PHPUnit\\Framework\\MockObject\\ConfigurableMethodsAlreadyInitializedException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/ConfigurableMethodsAlreadyInitializedException.php', - 'PHPUnit\\Framework\\MockObject\\Exception' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/Exception.php', - 'PHPUnit\\Framework\\MockObject\\Generator' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Generator.php', - 'PHPUnit\\Framework\\MockObject\\IncompatibleReturnValueException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/IncompatibleReturnValueException.php', - 'PHPUnit\\Framework\\MockObject\\Invocation' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Invocation.php', - 'PHPUnit\\Framework\\MockObject\\InvocationHandler' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/InvocationHandler.php', - 'PHPUnit\\Framework\\MockObject\\Matcher' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Matcher.php', - 'PHPUnit\\Framework\\MockObject\\Method' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Api/Method.php', - 'PHPUnit\\Framework\\MockObject\\MethodNameConstraint' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/MethodNameConstraint.php', - 'PHPUnit\\Framework\\MockObject\\MockBuilder' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/MockBuilder.php', - 'PHPUnit\\Framework\\MockObject\\MockClass' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/MockClass.php', - 'PHPUnit\\Framework\\MockObject\\MockMethod' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/MockMethod.php', - 'PHPUnit\\Framework\\MockObject\\MockMethodSet' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/MockMethodSet.php', - 'PHPUnit\\Framework\\MockObject\\MockObject' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/MockObject.php', - 'PHPUnit\\Framework\\MockObject\\MockTrait' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/MockTrait.php', - 'PHPUnit\\Framework\\MockObject\\MockType' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/MockType.php', - 'PHPUnit\\Framework\\MockObject\\MockedCloneMethod' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Api/MockedCloneMethod.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\AnyInvokedCount' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Rule/AnyInvokedCount.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\AnyParameters' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Rule/AnyParameters.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\ConsecutiveParameters' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Rule/ConsecutiveParameters.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\InvocationOrder' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Rule/InvocationOrder.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\InvokedAtIndex' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtIndex.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\InvokedAtLeastCount' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastCount.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\InvokedAtLeastOnce' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastOnce.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\InvokedAtMostCount' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtMostCount.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\InvokedCount' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedCount.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\MethodName' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Rule/MethodName.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\Parameters' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Rule/Parameters.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\ParametersRule' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Rule/ParametersRule.php', - 'PHPUnit\\Framework\\MockObject\\RuntimeException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/RuntimeException.php', - 'PHPUnit\\Framework\\MockObject\\Stub' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Stub.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\ConsecutiveCalls' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Stub/ConsecutiveCalls.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\Exception' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Stub/Exception.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnArgument' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnArgument.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnCallback' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnCallback.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnReference' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnReference.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnSelf' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnSelf.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnStub' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnStub.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnValueMap' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnValueMap.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\Stub' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Stub/Stub.php', - 'PHPUnit\\Framework\\MockObject\\UnmockedCloneMethod' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Api/UnmockedCloneMethod.php', - 'PHPUnit\\Framework\\MockObject\\Verifiable' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Verifiable.php', - 'PHPUnit\\Framework\\NoChildTestSuiteException' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/NoChildTestSuiteException.php', - 'PHPUnit\\Framework\\OutputError' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/OutputError.php', - 'PHPUnit\\Framework\\PHPTAssertionFailedError' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/PHPTAssertionFailedError.php', - 'PHPUnit\\Framework\\RiskyTestError' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/RiskyTestError.php', - 'PHPUnit\\Framework\\SelfDescribing' => $vendorDir . '/phpunit/phpunit/src/Framework/SelfDescribing.php', - 'PHPUnit\\Framework\\SkippedTest' => $vendorDir . '/phpunit/phpunit/src/Framework/SkippedTest.php', - 'PHPUnit\\Framework\\SkippedTestCase' => $vendorDir . '/phpunit/phpunit/src/Framework/SkippedTestCase.php', - 'PHPUnit\\Framework\\SkippedTestError' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/SkippedTestError.php', - 'PHPUnit\\Framework\\SkippedTestSuiteError' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/SkippedTestSuiteError.php', - 'PHPUnit\\Framework\\SyntheticError' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/SyntheticError.php', - 'PHPUnit\\Framework\\SyntheticSkippedError' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/SyntheticSkippedError.php', - 'PHPUnit\\Framework\\Test' => $vendorDir . '/phpunit/phpunit/src/Framework/Test.php', - 'PHPUnit\\Framework\\TestBuilder' => $vendorDir . '/phpunit/phpunit/src/Framework/TestBuilder.php', - 'PHPUnit\\Framework\\TestCase' => $vendorDir . '/phpunit/phpunit/src/Framework/TestCase.php', - 'PHPUnit\\Framework\\TestFailure' => $vendorDir . '/phpunit/phpunit/src/Framework/TestFailure.php', - 'PHPUnit\\Framework\\TestListener' => $vendorDir . '/phpunit/phpunit/src/Framework/TestListener.php', - 'PHPUnit\\Framework\\TestListenerDefaultImplementation' => $vendorDir . '/phpunit/phpunit/src/Framework/TestListenerDefaultImplementation.php', - 'PHPUnit\\Framework\\TestResult' => $vendorDir . '/phpunit/phpunit/src/Framework/TestResult.php', - 'PHPUnit\\Framework\\TestSuite' => $vendorDir . '/phpunit/phpunit/src/Framework/TestSuite.php', - 'PHPUnit\\Framework\\TestSuiteIterator' => $vendorDir . '/phpunit/phpunit/src/Framework/TestSuiteIterator.php', - 'PHPUnit\\Framework\\UnintentionallyCoveredCodeError' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/UnintentionallyCoveredCodeError.php', - 'PHPUnit\\Framework\\Warning' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/Warning.php', - 'PHPUnit\\Framework\\WarningTestCase' => $vendorDir . '/phpunit/phpunit/src/Framework/WarningTestCase.php', - 'PHPUnit\\Runner\\AfterIncompleteTestHook' => $vendorDir . '/phpunit/phpunit/src/Runner/Hook/AfterIncompleteTestHook.php', - 'PHPUnit\\Runner\\AfterLastTestHook' => $vendorDir . '/phpunit/phpunit/src/Runner/Hook/AfterLastTestHook.php', - 'PHPUnit\\Runner\\AfterRiskyTestHook' => $vendorDir . '/phpunit/phpunit/src/Runner/Hook/AfterRiskyTestHook.php', - 'PHPUnit\\Runner\\AfterSkippedTestHook' => $vendorDir . '/phpunit/phpunit/src/Runner/Hook/AfterSkippedTestHook.php', - 'PHPUnit\\Runner\\AfterSuccessfulTestHook' => $vendorDir . '/phpunit/phpunit/src/Runner/Hook/AfterSuccessfulTestHook.php', - 'PHPUnit\\Runner\\AfterTestErrorHook' => $vendorDir . '/phpunit/phpunit/src/Runner/Hook/AfterTestErrorHook.php', - 'PHPUnit\\Runner\\AfterTestFailureHook' => $vendorDir . '/phpunit/phpunit/src/Runner/Hook/AfterTestFailureHook.php', - 'PHPUnit\\Runner\\AfterTestHook' => $vendorDir . '/phpunit/phpunit/src/Runner/Hook/AfterTestHook.php', - 'PHPUnit\\Runner\\AfterTestWarningHook' => $vendorDir . '/phpunit/phpunit/src/Runner/Hook/AfterTestWarningHook.php', - 'PHPUnit\\Runner\\BaseTestRunner' => $vendorDir . '/phpunit/phpunit/src/Runner/BaseTestRunner.php', - 'PHPUnit\\Runner\\BeforeFirstTestHook' => $vendorDir . '/phpunit/phpunit/src/Runner/Hook/BeforeFirstTestHook.php', - 'PHPUnit\\Runner\\BeforeTestHook' => $vendorDir . '/phpunit/phpunit/src/Runner/Hook/BeforeTestHook.php', - 'PHPUnit\\Runner\\DefaultTestResultCache' => $vendorDir . '/phpunit/phpunit/src/Runner/DefaultTestResultCache.php', - 'PHPUnit\\Runner\\Exception' => $vendorDir . '/phpunit/phpunit/src/Runner/Exception.php', - 'PHPUnit\\Runner\\Filter\\ExcludeGroupFilterIterator' => $vendorDir . '/phpunit/phpunit/src/Runner/Filter/ExcludeGroupFilterIterator.php', - 'PHPUnit\\Runner\\Filter\\Factory' => $vendorDir . '/phpunit/phpunit/src/Runner/Filter/Factory.php', - 'PHPUnit\\Runner\\Filter\\GroupFilterIterator' => $vendorDir . '/phpunit/phpunit/src/Runner/Filter/GroupFilterIterator.php', - 'PHPUnit\\Runner\\Filter\\IncludeGroupFilterIterator' => $vendorDir . '/phpunit/phpunit/src/Runner/Filter/IncludeGroupFilterIterator.php', - 'PHPUnit\\Runner\\Filter\\NameFilterIterator' => $vendorDir . '/phpunit/phpunit/src/Runner/Filter/NameFilterIterator.php', - 'PHPUnit\\Runner\\Hook' => $vendorDir . '/phpunit/phpunit/src/Runner/Hook/Hook.php', - 'PHPUnit\\Runner\\NullTestResultCache' => $vendorDir . '/phpunit/phpunit/src/Runner/NullTestResultCache.php', - 'PHPUnit\\Runner\\PhptTestCase' => $vendorDir . '/phpunit/phpunit/src/Runner/PhptTestCase.php', - 'PHPUnit\\Runner\\ResultCacheExtension' => $vendorDir . '/phpunit/phpunit/src/Runner/ResultCacheExtension.php', - 'PHPUnit\\Runner\\StandardTestSuiteLoader' => $vendorDir . '/phpunit/phpunit/src/Runner/StandardTestSuiteLoader.php', - 'PHPUnit\\Runner\\TestHook' => $vendorDir . '/phpunit/phpunit/src/Runner/Hook/TestHook.php', - 'PHPUnit\\Runner\\TestListenerAdapter' => $vendorDir . '/phpunit/phpunit/src/Runner/Hook/TestListenerAdapter.php', - 'PHPUnit\\Runner\\TestResultCache' => $vendorDir . '/phpunit/phpunit/src/Runner/TestResultCache.php', - 'PHPUnit\\Runner\\TestSuiteLoader' => $vendorDir . '/phpunit/phpunit/src/Runner/TestSuiteLoader.php', - 'PHPUnit\\Runner\\TestSuiteSorter' => $vendorDir . '/phpunit/phpunit/src/Runner/TestSuiteSorter.php', - 'PHPUnit\\Runner\\Version' => $vendorDir . '/phpunit/phpunit/src/Runner/Version.php', - 'PHPUnit\\TextUI\\Command' => $vendorDir . '/phpunit/phpunit/src/TextUI/Command.php', - 'PHPUnit\\TextUI\\Exception' => $vendorDir . '/phpunit/phpunit/src/TextUI/Exception.php', - 'PHPUnit\\TextUI\\Help' => $vendorDir . '/phpunit/phpunit/src/TextUI/Help.php', - 'PHPUnit\\TextUI\\ResultPrinter' => $vendorDir . '/phpunit/phpunit/src/TextUI/ResultPrinter.php', - 'PHPUnit\\TextUI\\TestRunner' => $vendorDir . '/phpunit/phpunit/src/TextUI/TestRunner.php', - 'PHPUnit\\Util\\Annotation\\DocBlock' => $vendorDir . '/phpunit/phpunit/src/Util/Annotation/DocBlock.php', - 'PHPUnit\\Util\\Annotation\\Registry' => $vendorDir . '/phpunit/phpunit/src/Util/Annotation/Registry.php', - 'PHPUnit\\Util\\Blacklist' => $vendorDir . '/phpunit/phpunit/src/Util/Blacklist.php', - 'PHPUnit\\Util\\Color' => $vendorDir . '/phpunit/phpunit/src/Util/Color.php', - 'PHPUnit\\Util\\Configuration' => $vendorDir . '/phpunit/phpunit/src/Util/Configuration.php', - 'PHPUnit\\Util\\ConfigurationGenerator' => $vendorDir . '/phpunit/phpunit/src/Util/ConfigurationGenerator.php', - 'PHPUnit\\Util\\ErrorHandler' => $vendorDir . '/phpunit/phpunit/src/Util/ErrorHandler.php', - 'PHPUnit\\Util\\Exception' => $vendorDir . '/phpunit/phpunit/src/Util/Exception.php', - 'PHPUnit\\Util\\FileLoader' => $vendorDir . '/phpunit/phpunit/src/Util/FileLoader.php', - 'PHPUnit\\Util\\Filesystem' => $vendorDir . '/phpunit/phpunit/src/Util/Filesystem.php', - 'PHPUnit\\Util\\Filter' => $vendorDir . '/phpunit/phpunit/src/Util/Filter.php', - 'PHPUnit\\Util\\Getopt' => $vendorDir . '/phpunit/phpunit/src/Util/Getopt.php', - 'PHPUnit\\Util\\GlobalState' => $vendorDir . '/phpunit/phpunit/src/Util/GlobalState.php', - 'PHPUnit\\Util\\InvalidDataSetException' => $vendorDir . '/phpunit/phpunit/src/Util/InvalidDataSetException.php', - 'PHPUnit\\Util\\Json' => $vendorDir . '/phpunit/phpunit/src/Util/Json.php', - 'PHPUnit\\Util\\Log\\JUnit' => $vendorDir . '/phpunit/phpunit/src/Util/Log/JUnit.php', - 'PHPUnit\\Util\\Log\\TeamCity' => $vendorDir . '/phpunit/phpunit/src/Util/Log/TeamCity.php', - 'PHPUnit\\Util\\PHP\\AbstractPhpProcess' => $vendorDir . '/phpunit/phpunit/src/Util/PHP/AbstractPhpProcess.php', - 'PHPUnit\\Util\\PHP\\DefaultPhpProcess' => $vendorDir . '/phpunit/phpunit/src/Util/PHP/DefaultPhpProcess.php', - 'PHPUnit\\Util\\PHP\\WindowsPhpProcess' => $vendorDir . '/phpunit/phpunit/src/Util/PHP/WindowsPhpProcess.php', - 'PHPUnit\\Util\\Printer' => $vendorDir . '/phpunit/phpunit/src/Util/Printer.php', - 'PHPUnit\\Util\\RegularExpression' => $vendorDir . '/phpunit/phpunit/src/Util/RegularExpression.php', - 'PHPUnit\\Util\\Test' => $vendorDir . '/phpunit/phpunit/src/Util/Test.php', - 'PHPUnit\\Util\\TestDox\\CliTestDoxPrinter' => $vendorDir . '/phpunit/phpunit/src/Util/TestDox/CliTestDoxPrinter.php', - 'PHPUnit\\Util\\TestDox\\HtmlResultPrinter' => $vendorDir . '/phpunit/phpunit/src/Util/TestDox/HtmlResultPrinter.php', - 'PHPUnit\\Util\\TestDox\\NamePrettifier' => $vendorDir . '/phpunit/phpunit/src/Util/TestDox/NamePrettifier.php', - 'PHPUnit\\Util\\TestDox\\ResultPrinter' => $vendorDir . '/phpunit/phpunit/src/Util/TestDox/ResultPrinter.php', - 'PHPUnit\\Util\\TestDox\\TestDoxPrinter' => $vendorDir . '/phpunit/phpunit/src/Util/TestDox/TestDoxPrinter.php', - 'PHPUnit\\Util\\TestDox\\TextResultPrinter' => $vendorDir . '/phpunit/phpunit/src/Util/TestDox/TextResultPrinter.php', - 'PHPUnit\\Util\\TestDox\\XmlResultPrinter' => $vendorDir . '/phpunit/phpunit/src/Util/TestDox/XmlResultPrinter.php', - 'PHPUnit\\Util\\TextTestListRenderer' => $vendorDir . '/phpunit/phpunit/src/Util/TextTestListRenderer.php', - 'PHPUnit\\Util\\Type' => $vendorDir . '/phpunit/phpunit/src/Util/Type.php', - 'PHPUnit\\Util\\VersionComparisonOperator' => $vendorDir . '/phpunit/phpunit/src/Util/VersionComparisonOperator.php', - 'PHPUnit\\Util\\XdebugFilterScriptGenerator' => $vendorDir . '/phpunit/phpunit/src/Util/XdebugFilterScriptGenerator.php', - 'PHPUnit\\Util\\Xml' => $vendorDir . '/phpunit/phpunit/src/Util/Xml.php', - 'PHPUnit\\Util\\XmlTestListRenderer' => $vendorDir . '/phpunit/phpunit/src/Util/XmlTestListRenderer.php', - 'PHP_Token' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_TokenWithScope' => $vendorDir . '/phpunit/php-token-stream/src/TokenWithScope.php', - 'PHP_TokenWithScopeAndVisibility' => $vendorDir . '/phpunit/php-token-stream/src/TokenWithScopeAndVisibility.php', - 'PHP_Token_ABSTRACT' => $vendorDir . '/phpunit/php-token-stream/src/Abstract.php', - 'PHP_Token_AMPERSAND' => $vendorDir . '/phpunit/php-token-stream/src/Ampersand.php', - 'PHP_Token_AND_EQUAL' => $vendorDir . '/phpunit/php-token-stream/src/AndEqual.php', - 'PHP_Token_ARRAY' => $vendorDir . '/phpunit/php-token-stream/src/Array.php', - 'PHP_Token_ARRAY_CAST' => $vendorDir . '/phpunit/php-token-stream/src/ArrayCast.php', - 'PHP_Token_AS' => $vendorDir . '/phpunit/php-token-stream/src/As.php', - 'PHP_Token_AT' => $vendorDir . '/phpunit/php-token-stream/src/At.php', - 'PHP_Token_BACKTICK' => $vendorDir . '/phpunit/php-token-stream/src/Backtick.php', - 'PHP_Token_BAD_CHARACTER' => $vendorDir . '/phpunit/php-token-stream/src/BadCharacter.php', - 'PHP_Token_BOOLEAN_AND' => $vendorDir . '/phpunit/php-token-stream/src/BooleanAnd.php', - 'PHP_Token_BOOLEAN_OR' => $vendorDir . '/phpunit/php-token-stream/src/BooleanOr.php', - 'PHP_Token_BOOL_CAST' => $vendorDir . '/phpunit/php-token-stream/src/BoolCast.php', - 'PHP_Token_BREAK' => $vendorDir . '/phpunit/php-token-stream/src/break.php', - 'PHP_Token_CALLABLE' => $vendorDir . '/phpunit/php-token-stream/src/Callable.php', - 'PHP_Token_CARET' => $vendorDir . '/phpunit/php-token-stream/src/Caret.php', - 'PHP_Token_CASE' => $vendorDir . '/phpunit/php-token-stream/src/Case.php', - 'PHP_Token_CATCH' => $vendorDir . '/phpunit/php-token-stream/src/Catch.php', - 'PHP_Token_CHARACTER' => $vendorDir . '/phpunit/php-token-stream/src/Character.php', - 'PHP_Token_CLASS' => $vendorDir . '/phpunit/php-token-stream/src/Class.php', - 'PHP_Token_CLASS_C' => $vendorDir . '/phpunit/php-token-stream/src/ClassC.php', - 'PHP_Token_CLASS_NAME_CONSTANT' => $vendorDir . '/phpunit/php-token-stream/src/ClassNameConstant.php', - 'PHP_Token_CLONE' => $vendorDir . '/phpunit/php-token-stream/src/Clone.php', - 'PHP_Token_CLOSE_BRACKET' => $vendorDir . '/phpunit/php-token-stream/src/CloseBracket.php', - 'PHP_Token_CLOSE_CURLY' => $vendorDir . '/phpunit/php-token-stream/src/CloseCurly.php', - 'PHP_Token_CLOSE_SQUARE' => $vendorDir . '/phpunit/php-token-stream/src/CloseSquare.php', - 'PHP_Token_CLOSE_TAG' => $vendorDir . '/phpunit/php-token-stream/src/CloseTag.php', - 'PHP_Token_COALESCE' => $vendorDir . '/phpunit/php-token-stream/src/Coalesce.php', - 'PHP_Token_COALESCE_EQUAL' => $vendorDir . '/phpunit/php-token-stream/src/CoalesceEqual.php', - 'PHP_Token_COLON' => $vendorDir . '/phpunit/php-token-stream/src/Colon.php', - 'PHP_Token_COMMA' => $vendorDir . '/phpunit/php-token-stream/src/Comma.php', - 'PHP_Token_COMMENT' => $vendorDir . '/phpunit/php-token-stream/src/Comment.php', - 'PHP_Token_CONCAT_EQUAL' => $vendorDir . '/phpunit/php-token-stream/src/ConcatEqual.php', - 'PHP_Token_CONST' => $vendorDir . '/phpunit/php-token-stream/src/Const.php', - 'PHP_Token_CONSTANT_ENCAPSED_STRING' => $vendorDir . '/phpunit/php-token-stream/src/ConstantEncapsedString.php', - 'PHP_Token_CONTINUE' => $vendorDir . '/phpunit/php-token-stream/src/Continue.php', - 'PHP_Token_CURLY_OPEN' => $vendorDir . '/phpunit/php-token-stream/src/CurlyOpen.php', - 'PHP_Token_DEC' => $vendorDir . '/phpunit/php-token-stream/src/Dec.php', - 'PHP_Token_DECLARE' => $vendorDir . '/phpunit/php-token-stream/src/Declare.php', - 'PHP_Token_DEFAULT' => $vendorDir . '/phpunit/php-token-stream/src/Default.php', - 'PHP_Token_DIR' => $vendorDir . '/phpunit/php-token-stream/src/Dir.php', - 'PHP_Token_DIV' => $vendorDir . '/phpunit/php-token-stream/src/Div.php', - 'PHP_Token_DIV_EQUAL' => $vendorDir . '/phpunit/php-token-stream/src/DivEqual.php', - 'PHP_Token_DNUMBER' => $vendorDir . '/phpunit/php-token-stream/src/DNumber.php', - 'PHP_Token_DO' => $vendorDir . '/phpunit/php-token-stream/src/Do.php', - 'PHP_Token_DOC_COMMENT' => $vendorDir . '/phpunit/php-token-stream/src/DocComment.php', - 'PHP_Token_DOLLAR' => $vendorDir . '/phpunit/php-token-stream/src/Dollar.php', - 'PHP_Token_DOLLAR_OPEN_CURLY_BRACES' => $vendorDir . '/phpunit/php-token-stream/src/DollarOpenCurlyBraces.php', - 'PHP_Token_DOT' => $vendorDir . '/phpunit/php-token-stream/src/Dot.php', - 'PHP_Token_DOUBLE_ARROW' => $vendorDir . '/phpunit/php-token-stream/src/DoubleArrow.php', - 'PHP_Token_DOUBLE_CAST' => $vendorDir . '/phpunit/php-token-stream/src/DoubleCast.php', - 'PHP_Token_DOUBLE_COLON' => $vendorDir . '/phpunit/php-token-stream/src/DoubleColon.php', - 'PHP_Token_DOUBLE_QUOTES' => $vendorDir . '/phpunit/php-token-stream/src/DoubleQuotes.php', - 'PHP_Token_ECHO' => $vendorDir . '/phpunit/php-token-stream/src/Echo.php', - 'PHP_Token_ELLIPSIS' => $vendorDir . '/phpunit/php-token-stream/src/Ellipsis.php', - 'PHP_Token_ELSE' => $vendorDir . '/phpunit/php-token-stream/src/Else.php', - 'PHP_Token_ELSEIF' => $vendorDir . '/phpunit/php-token-stream/src/Elseif.php', - 'PHP_Token_EMPTY' => $vendorDir . '/phpunit/php-token-stream/src/Empty.php', - 'PHP_Token_ENCAPSED_AND_WHITESPACE' => $vendorDir . '/phpunit/php-token-stream/src/EncapsedAndWhitespace.php', - 'PHP_Token_ENDDECLARE' => $vendorDir . '/phpunit/php-token-stream/src/Enddeclare.php', - 'PHP_Token_ENDFOR' => $vendorDir . '/phpunit/php-token-stream/src/Endfor.php', - 'PHP_Token_ENDFOREACH' => $vendorDir . '/phpunit/php-token-stream/src/Endforeach.php', - 'PHP_Token_ENDIF' => $vendorDir . '/phpunit/php-token-stream/src/Endif.php', - 'PHP_Token_ENDSWITCH' => $vendorDir . '/phpunit/php-token-stream/src/Endswitch.php', - 'PHP_Token_ENDWHILE' => $vendorDir . '/phpunit/php-token-stream/src/Endwhile.php', - 'PHP_Token_END_HEREDOC' => $vendorDir . '/phpunit/php-token-stream/src/EndHeredoc.php', - 'PHP_Token_EQUAL' => $vendorDir . '/phpunit/php-token-stream/src/Equal.php', - 'PHP_Token_EVAL' => $vendorDir . '/phpunit/php-token-stream/src/Eval.php', - 'PHP_Token_EXCLAMATION_MARK' => $vendorDir . '/phpunit/php-token-stream/src/ExclamationMark.php', - 'PHP_Token_EXIT' => $vendorDir . '/phpunit/php-token-stream/src/Exit.php', - 'PHP_Token_EXTENDS' => $vendorDir . '/phpunit/php-token-stream/src/Extends.php', - 'PHP_Token_FILE' => $vendorDir . '/phpunit/php-token-stream/src/File.php', - 'PHP_Token_FINAL' => $vendorDir . '/phpunit/php-token-stream/src/Final.php', - 'PHP_Token_FINALLY' => $vendorDir . '/phpunit/php-token-stream/src/Finally.php', - 'PHP_Token_FN' => $vendorDir . '/phpunit/php-token-stream/src/Fn.php', - 'PHP_Token_FOR' => $vendorDir . '/phpunit/php-token-stream/src/For.php', - 'PHP_Token_FOREACH' => $vendorDir . '/phpunit/php-token-stream/src/Foreach.php', - 'PHP_Token_FUNCTION' => $vendorDir . '/phpunit/php-token-stream/src/Function.php', - 'PHP_Token_FUNC_C' => $vendorDir . '/phpunit/php-token-stream/src/FuncC.php', - 'PHP_Token_GLOBAL' => $vendorDir . '/phpunit/php-token-stream/src/Global.php', - 'PHP_Token_GOTO' => $vendorDir . '/phpunit/php-token-stream/src/Goto.php', - 'PHP_Token_GT' => $vendorDir . '/phpunit/php-token-stream/src/Gt.php', - 'PHP_Token_HALT_COMPILER' => $vendorDir . '/phpunit/php-token-stream/src/HaltCompiler.php', - 'PHP_Token_IF' => $vendorDir . '/phpunit/php-token-stream/src/If.php', - 'PHP_Token_IMPLEMENTS' => $vendorDir . '/phpunit/php-token-stream/src/Implements.php', - 'PHP_Token_INC' => $vendorDir . '/phpunit/php-token-stream/src/Inc.php', - 'PHP_Token_INCLUDE' => $vendorDir . '/phpunit/php-token-stream/src/Include.php', - 'PHP_Token_INCLUDE_ONCE' => $vendorDir . '/phpunit/php-token-stream/src/IncludeOnce.php', - 'PHP_Token_INLINE_HTML' => $vendorDir . '/phpunit/php-token-stream/src/InlineHtml.php', - 'PHP_Token_INSTANCEOF' => $vendorDir . '/phpunit/php-token-stream/src/Instanceof.php', - 'PHP_Token_INSTEADOF' => $vendorDir . '/phpunit/php-token-stream/src/Insteadof.php', - 'PHP_Token_INTERFACE' => $vendorDir . '/phpunit/php-token-stream/src/Interface.php', - 'PHP_Token_INT_CAST' => $vendorDir . '/phpunit/php-token-stream/src/IntCast.php', - 'PHP_Token_ISSET' => $vendorDir . '/phpunit/php-token-stream/src/Isset.php', - 'PHP_Token_IS_EQUAL' => $vendorDir . '/phpunit/php-token-stream/src/IsEqual.php', - 'PHP_Token_IS_GREATER_OR_EQUAL' => $vendorDir . '/phpunit/php-token-stream/src/IsGreaterOrEqual.php', - 'PHP_Token_IS_IDENTICAL' => $vendorDir . '/phpunit/php-token-stream/src/IsIdentical.php', - 'PHP_Token_IS_NOT_EQUAL' => $vendorDir . '/phpunit/php-token-stream/src/IsNotEqual.php', - 'PHP_Token_IS_NOT_IDENTICAL' => $vendorDir . '/phpunit/php-token-stream/src/IsNotIdentical.php', - 'PHP_Token_IS_SMALLER_OR_EQUAL' => $vendorDir . '/phpunit/php-token-stream/src/IsSmallerOrEqual.php', - 'PHP_Token_Includes' => $vendorDir . '/phpunit/php-token-stream/src/Includes.php', - 'PHP_Token_LINE' => $vendorDir . '/phpunit/php-token-stream/src/Line.php', - 'PHP_Token_LIST' => $vendorDir . '/phpunit/php-token-stream/src/List.php', - 'PHP_Token_LNUMBER' => $vendorDir . '/phpunit/php-token-stream/src/Lnumber.php', - 'PHP_Token_LOGICAL_AND' => $vendorDir . '/phpunit/php-token-stream/src/LogicalAnd.php', - 'PHP_Token_LOGICAL_OR' => $vendorDir . '/phpunit/php-token-stream/src/LogicalOr.php', - 'PHP_Token_LOGICAL_XOR' => $vendorDir . '/phpunit/php-token-stream/src/LogicalXor.php', - 'PHP_Token_LT' => $vendorDir . '/phpunit/php-token-stream/src/Lt.php', - 'PHP_Token_METHOD_C' => $vendorDir . '/phpunit/php-token-stream/src/MethodC.php', - 'PHP_Token_MINUS' => $vendorDir . '/phpunit/php-token-stream/src/Minus.php', - 'PHP_Token_MINUS_EQUAL' => $vendorDir . '/phpunit/php-token-stream/src/MinusEqual.php', - 'PHP_Token_MOD_EQUAL' => $vendorDir . '/phpunit/php-token-stream/src/ModEqual.php', - 'PHP_Token_MULT' => $vendorDir . '/phpunit/php-token-stream/src/Mult.php', - 'PHP_Token_MUL_EQUAL' => $vendorDir . '/phpunit/php-token-stream/src/MulEqual.php', - 'PHP_Token_NAMESPACE' => $vendorDir . '/phpunit/php-token-stream/src/Namespace.php', - 'PHP_Token_NAME_FULLY_QUALIFIED' => $vendorDir . '/phpunit/php-token-stream/src/NameFullyQualified.php', - 'PHP_Token_NAME_QUALIFIED' => $vendorDir . '/phpunit/php-token-stream/src/NameQualified.php', - 'PHP_Token_NAME_RELATIVE' => $vendorDir . '/phpunit/php-token-stream/src/NameRelative.php', - 'PHP_Token_NEW' => $vendorDir . '/phpunit/php-token-stream/src/New.php', - 'PHP_Token_NS_C' => $vendorDir . '/phpunit/php-token-stream/src/NsC.php', - 'PHP_Token_NS_SEPARATOR' => $vendorDir . '/phpunit/php-token-stream/src/NsSeparator.php', - 'PHP_Token_NUM_STRING' => $vendorDir . '/phpunit/php-token-stream/src/NumString.php', - 'PHP_Token_OBJECT_CAST' => $vendorDir . '/phpunit/php-token-stream/src/ObjectCast.php', - 'PHP_Token_OBJECT_OPERATOR' => $vendorDir . '/phpunit/php-token-stream/src/ObjectOperator.php', - 'PHP_Token_OPEN_BRACKET' => $vendorDir . '/phpunit/php-token-stream/src/OpenBracket.php', - 'PHP_Token_OPEN_CURLY' => $vendorDir . '/phpunit/php-token-stream/src/OpenCurly.php', - 'PHP_Token_OPEN_SQUARE' => $vendorDir . '/phpunit/php-token-stream/src/OpenSquare.php', - 'PHP_Token_OPEN_TAG' => $vendorDir . '/phpunit/php-token-stream/src/OpenTag.php', - 'PHP_Token_OPEN_TAG_WITH_ECHO' => $vendorDir . '/phpunit/php-token-stream/src/OpenTagWithEcho.php', - 'PHP_Token_OR_EQUAL' => $vendorDir . '/phpunit/php-token-stream/src/OrEqual.php', - 'PHP_Token_PAAMAYIM_NEKUDOTAYIM' => $vendorDir . '/phpunit/php-token-stream/src/PaamayimNekudotayim.php', - 'PHP_Token_PERCENT' => $vendorDir . '/phpunit/php-token-stream/src/Percent.php', - 'PHP_Token_PIPE' => $vendorDir . '/phpunit/php-token-stream/src/Pipe.php', - 'PHP_Token_PLUS' => $vendorDir . '/phpunit/php-token-stream/src/Plus.php', - 'PHP_Token_PLUS_EQUAL' => $vendorDir . '/phpunit/php-token-stream/src/PlusEqual.php', - 'PHP_Token_POW' => $vendorDir . '/phpunit/php-token-stream/src/Pow.php', - 'PHP_Token_POW_EQUAL' => $vendorDir . '/phpunit/php-token-stream/src/PowEqual.php', - 'PHP_Token_PRINT' => $vendorDir . '/phpunit/php-token-stream/src/Print.php', - 'PHP_Token_PRIVATE' => $vendorDir . '/phpunit/php-token-stream/src/Private.php', - 'PHP_Token_PROTECTED' => $vendorDir . '/phpunit/php-token-stream/src/Protected.php', - 'PHP_Token_PUBLIC' => $vendorDir . '/phpunit/php-token-stream/src/Public.php', - 'PHP_Token_QUESTION_MARK' => $vendorDir . '/phpunit/php-token-stream/src/QuestionMark.php', - 'PHP_Token_REQUIRE' => $vendorDir . '/phpunit/php-token-stream/src/Require.php', - 'PHP_Token_REQUIRE_ONCE' => $vendorDir . '/phpunit/php-token-stream/src/RequireOnce.php', - 'PHP_Token_RETURN' => $vendorDir . '/phpunit/php-token-stream/src/Return.php', - 'PHP_Token_SEMICOLON' => $vendorDir . '/phpunit/php-token-stream/src/Semicolon.php', - 'PHP_Token_SL' => $vendorDir . '/phpunit/php-token-stream/src/Sl.php', - 'PHP_Token_SL_EQUAL' => $vendorDir . '/phpunit/php-token-stream/src/SlEqual.php', - 'PHP_Token_SPACESHIP' => $vendorDir . '/phpunit/php-token-stream/src/Spaceship.php', - 'PHP_Token_SR' => $vendorDir . '/phpunit/php-token-stream/src/Sr.php', - 'PHP_Token_SR_EQUAL' => $vendorDir . '/phpunit/php-token-stream/src/SrEqual.php', - 'PHP_Token_START_HEREDOC' => $vendorDir . '/phpunit/php-token-stream/src/StartHeredoc.php', - 'PHP_Token_STATIC' => $vendorDir . '/phpunit/php-token-stream/src/Static.php', - 'PHP_Token_STRING' => $vendorDir . '/phpunit/php-token-stream/src/String.php', - 'PHP_Token_STRING_CAST' => $vendorDir . '/phpunit/php-token-stream/src/StringCast.php', - 'PHP_Token_STRING_VARNAME' => $vendorDir . '/phpunit/php-token-stream/src/StringVarname.php', - 'PHP_Token_SWITCH' => $vendorDir . '/phpunit/php-token-stream/src/Switch.php', - 'PHP_Token_Stream' => $vendorDir . '/phpunit/php-token-stream/src/Stream.php', - 'PHP_Token_Stream_CachingFactory' => $vendorDir . '/phpunit/php-token-stream/src/CachingFactory.php', - 'PHP_Token_THROW' => $vendorDir . '/phpunit/php-token-stream/src/Throw.php', - 'PHP_Token_TILDE' => $vendorDir . '/phpunit/php-token-stream/src/Tilde.php', - 'PHP_Token_TRAIT' => $vendorDir . '/phpunit/php-token-stream/src/Trait.php', - 'PHP_Token_TRAIT_C' => $vendorDir . '/phpunit/php-token-stream/src/TraitC.php', - 'PHP_Token_TRY' => $vendorDir . '/phpunit/php-token-stream/src/Try.php', - 'PHP_Token_UNSET' => $vendorDir . '/phpunit/php-token-stream/src/Unset.php', - 'PHP_Token_UNSET_CAST' => $vendorDir . '/phpunit/php-token-stream/src/UnsetCast.php', - 'PHP_Token_USE' => $vendorDir . '/phpunit/php-token-stream/src/Use.php', - 'PHP_Token_USE_FUNCTION' => $vendorDir . '/phpunit/php-token-stream/src/UseFunction.php', - 'PHP_Token_Util' => $vendorDir . '/phpunit/php-token-stream/src/Util.php', - 'PHP_Token_VAR' => $vendorDir . '/phpunit/php-token-stream/src/Var.php', - 'PHP_Token_VARIABLE' => $vendorDir . '/phpunit/php-token-stream/src/Variable.php', - 'PHP_Token_WHILE' => $vendorDir . '/phpunit/php-token-stream/src/While.php', - 'PHP_Token_WHITESPACE' => $vendorDir . '/phpunit/php-token-stream/src/Whitespace.php', - 'PHP_Token_XOR_EQUAL' => $vendorDir . '/phpunit/php-token-stream/src/XorEqual.php', - 'PHP_Token_YIELD' => $vendorDir . '/phpunit/php-token-stream/src/Yield.php', - 'PHP_Token_YIELD_FROM' => $vendorDir . '/phpunit/php-token-stream/src/YieldFrom.php', - 'PharIo\\Manifest\\Application' => $vendorDir . '/phar-io/manifest/src/values/Application.php', - 'PharIo\\Manifest\\ApplicationName' => $vendorDir . '/phar-io/manifest/src/values/ApplicationName.php', - 'PharIo\\Manifest\\Author' => $vendorDir . '/phar-io/manifest/src/values/Author.php', - 'PharIo\\Manifest\\AuthorCollection' => $vendorDir . '/phar-io/manifest/src/values/AuthorCollection.php', - 'PharIo\\Manifest\\AuthorCollectionIterator' => $vendorDir . '/phar-io/manifest/src/values/AuthorCollectionIterator.php', - 'PharIo\\Manifest\\AuthorElement' => $vendorDir . '/phar-io/manifest/src/xml/AuthorElement.php', - 'PharIo\\Manifest\\AuthorElementCollection' => $vendorDir . '/phar-io/manifest/src/xml/AuthorElementCollection.php', - 'PharIo\\Manifest\\BundledComponent' => $vendorDir . '/phar-io/manifest/src/values/BundledComponent.php', - 'PharIo\\Manifest\\BundledComponentCollection' => $vendorDir . '/phar-io/manifest/src/values/BundledComponentCollection.php', - 'PharIo\\Manifest\\BundledComponentCollectionIterator' => $vendorDir . '/phar-io/manifest/src/values/BundledComponentCollectionIterator.php', - 'PharIo\\Manifest\\BundlesElement' => $vendorDir . '/phar-io/manifest/src/xml/BundlesElement.php', - 'PharIo\\Manifest\\ComponentElement' => $vendorDir . '/phar-io/manifest/src/xml/ComponentElement.php', - 'PharIo\\Manifest\\ComponentElementCollection' => $vendorDir . '/phar-io/manifest/src/xml/ComponentElementCollection.php', - 'PharIo\\Manifest\\ContainsElement' => $vendorDir . '/phar-io/manifest/src/xml/ContainsElement.php', - 'PharIo\\Manifest\\CopyrightElement' => $vendorDir . '/phar-io/manifest/src/xml/CopyrightElement.php', - 'PharIo\\Manifest\\CopyrightInformation' => $vendorDir . '/phar-io/manifest/src/values/CopyrightInformation.php', - 'PharIo\\Manifest\\ElementCollection' => $vendorDir . '/phar-io/manifest/src/xml/ElementCollection.php', - 'PharIo\\Manifest\\ElementCollectionException' => $vendorDir . '/phar-io/manifest/src/exceptions/ElementCollectionException.php', - 'PharIo\\Manifest\\Email' => $vendorDir . '/phar-io/manifest/src/values/Email.php', - 'PharIo\\Manifest\\Exception' => $vendorDir . '/phar-io/manifest/src/exceptions/Exception.php', - 'PharIo\\Manifest\\ExtElement' => $vendorDir . '/phar-io/manifest/src/xml/ExtElement.php', - 'PharIo\\Manifest\\ExtElementCollection' => $vendorDir . '/phar-io/manifest/src/xml/ExtElementCollection.php', - 'PharIo\\Manifest\\Extension' => $vendorDir . '/phar-io/manifest/src/values/Extension.php', - 'PharIo\\Manifest\\ExtensionElement' => $vendorDir . '/phar-io/manifest/src/xml/ExtensionElement.php', - 'PharIo\\Manifest\\InvalidApplicationNameException' => $vendorDir . '/phar-io/manifest/src/exceptions/InvalidApplicationNameException.php', - 'PharIo\\Manifest\\InvalidEmailException' => $vendorDir . '/phar-io/manifest/src/exceptions/InvalidEmailException.php', - 'PharIo\\Manifest\\InvalidUrlException' => $vendorDir . '/phar-io/manifest/src/exceptions/InvalidUrlException.php', - 'PharIo\\Manifest\\Library' => $vendorDir . '/phar-io/manifest/src/values/Library.php', - 'PharIo\\Manifest\\License' => $vendorDir . '/phar-io/manifest/src/values/License.php', - 'PharIo\\Manifest\\LicenseElement' => $vendorDir . '/phar-io/manifest/src/xml/LicenseElement.php', - 'PharIo\\Manifest\\Manifest' => $vendorDir . '/phar-io/manifest/src/values/Manifest.php', - 'PharIo\\Manifest\\ManifestDocument' => $vendorDir . '/phar-io/manifest/src/xml/ManifestDocument.php', - 'PharIo\\Manifest\\ManifestDocumentException' => $vendorDir . '/phar-io/manifest/src/exceptions/ManifestDocumentException.php', - 'PharIo\\Manifest\\ManifestDocumentLoadingException' => $vendorDir . '/phar-io/manifest/src/exceptions/ManifestDocumentLoadingException.php', - 'PharIo\\Manifest\\ManifestDocumentMapper' => $vendorDir . '/phar-io/manifest/src/ManifestDocumentMapper.php', - 'PharIo\\Manifest\\ManifestDocumentMapperException' => $vendorDir . '/phar-io/manifest/src/exceptions/ManifestDocumentMapperException.php', - 'PharIo\\Manifest\\ManifestElement' => $vendorDir . '/phar-io/manifest/src/xml/ManifestElement.php', - 'PharIo\\Manifest\\ManifestElementException' => $vendorDir . '/phar-io/manifest/src/exceptions/ManifestElementException.php', - 'PharIo\\Manifest\\ManifestLoader' => $vendorDir . '/phar-io/manifest/src/ManifestLoader.php', - 'PharIo\\Manifest\\ManifestLoaderException' => $vendorDir . '/phar-io/manifest/src/exceptions/ManifestLoaderException.php', - 'PharIo\\Manifest\\ManifestSerializer' => $vendorDir . '/phar-io/manifest/src/ManifestSerializer.php', - 'PharIo\\Manifest\\PhpElement' => $vendorDir . '/phar-io/manifest/src/xml/PhpElement.php', - 'PharIo\\Manifest\\PhpExtensionRequirement' => $vendorDir . '/phar-io/manifest/src/values/PhpExtensionRequirement.php', - 'PharIo\\Manifest\\PhpVersionRequirement' => $vendorDir . '/phar-io/manifest/src/values/PhpVersionRequirement.php', - 'PharIo\\Manifest\\Requirement' => $vendorDir . '/phar-io/manifest/src/values/Requirement.php', - 'PharIo\\Manifest\\RequirementCollection' => $vendorDir . '/phar-io/manifest/src/values/RequirementCollection.php', - 'PharIo\\Manifest\\RequirementCollectionIterator' => $vendorDir . '/phar-io/manifest/src/values/RequirementCollectionIterator.php', - 'PharIo\\Manifest\\RequiresElement' => $vendorDir . '/phar-io/manifest/src/xml/RequiresElement.php', - 'PharIo\\Manifest\\Type' => $vendorDir . '/phar-io/manifest/src/values/Type.php', - 'PharIo\\Manifest\\Url' => $vendorDir . '/phar-io/manifest/src/values/Url.php', - 'PharIo\\Version\\AbstractVersionConstraint' => $vendorDir . '/phar-io/version/src/constraints/AbstractVersionConstraint.php', - 'PharIo\\Version\\AndVersionConstraintGroup' => $vendorDir . '/phar-io/version/src/constraints/AndVersionConstraintGroup.php', - 'PharIo\\Version\\AnyVersionConstraint' => $vendorDir . '/phar-io/version/src/constraints/AnyVersionConstraint.php', - 'PharIo\\Version\\ExactVersionConstraint' => $vendorDir . '/phar-io/version/src/constraints/ExactVersionConstraint.php', - 'PharIo\\Version\\Exception' => $vendorDir . '/phar-io/version/src/exceptions/Exception.php', - 'PharIo\\Version\\GreaterThanOrEqualToVersionConstraint' => $vendorDir . '/phar-io/version/src/constraints/GreaterThanOrEqualToVersionConstraint.php', - 'PharIo\\Version\\InvalidPreReleaseSuffixException' => $vendorDir . '/phar-io/version/src/exceptions/InvalidPreReleaseSuffixException.php', - 'PharIo\\Version\\InvalidVersionException' => $vendorDir . '/phar-io/version/src/exceptions/InvalidVersionException.php', - 'PharIo\\Version\\NoPreReleaseSuffixException' => $vendorDir . '/phar-io/version/src/exceptions/NoPreReleaseSuffixException.php', - 'PharIo\\Version\\OrVersionConstraintGroup' => $vendorDir . '/phar-io/version/src/constraints/OrVersionConstraintGroup.php', - 'PharIo\\Version\\PreReleaseSuffix' => $vendorDir . '/phar-io/version/src/PreReleaseSuffix.php', - 'PharIo\\Version\\SpecificMajorAndMinorVersionConstraint' => $vendorDir . '/phar-io/version/src/constraints/SpecificMajorAndMinorVersionConstraint.php', - 'PharIo\\Version\\SpecificMajorVersionConstraint' => $vendorDir . '/phar-io/version/src/constraints/SpecificMajorVersionConstraint.php', - 'PharIo\\Version\\UnsupportedVersionConstraintException' => $vendorDir . '/phar-io/version/src/exceptions/UnsupportedVersionConstraintException.php', - 'PharIo\\Version\\Version' => $vendorDir . '/phar-io/version/src/Version.php', - 'PharIo\\Version\\VersionConstraint' => $vendorDir . '/phar-io/version/src/constraints/VersionConstraint.php', - 'PharIo\\Version\\VersionConstraintParser' => $vendorDir . '/phar-io/version/src/VersionConstraintParser.php', - 'PharIo\\Version\\VersionConstraintValue' => $vendorDir . '/phar-io/version/src/VersionConstraintValue.php', - 'PharIo\\Version\\VersionNumber' => $vendorDir . '/phar-io/version/src/VersionNumber.php', - 'SebastianBergmann\\CodeCoverage\\CodeCoverage' => $vendorDir . '/phpunit/php-code-coverage/src/CodeCoverage.php', - 'SebastianBergmann\\CodeCoverage\\CoveredCodeNotExecutedException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/CoveredCodeNotExecutedException.php', - 'SebastianBergmann\\CodeCoverage\\Driver\\Driver' => $vendorDir . '/phpunit/php-code-coverage/src/Driver/Driver.php', - 'SebastianBergmann\\CodeCoverage\\Driver\\PCOV' => $vendorDir . '/phpunit/php-code-coverage/src/Driver/PCOV.php', - 'SebastianBergmann\\CodeCoverage\\Driver\\PHPDBG' => $vendorDir . '/phpunit/php-code-coverage/src/Driver/PHPDBG.php', - 'SebastianBergmann\\CodeCoverage\\Driver\\Xdebug' => $vendorDir . '/phpunit/php-code-coverage/src/Driver/Xdebug.php', - 'SebastianBergmann\\CodeCoverage\\Exception' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/Exception.php', - 'SebastianBergmann\\CodeCoverage\\Filter' => $vendorDir . '/phpunit/php-code-coverage/src/Filter.php', - 'SebastianBergmann\\CodeCoverage\\InvalidArgumentException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/InvalidArgumentException.php', - 'SebastianBergmann\\CodeCoverage\\MissingCoversAnnotationException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/MissingCoversAnnotationException.php', - 'SebastianBergmann\\CodeCoverage\\Node\\AbstractNode' => $vendorDir . '/phpunit/php-code-coverage/src/Node/AbstractNode.php', - 'SebastianBergmann\\CodeCoverage\\Node\\Builder' => $vendorDir . '/phpunit/php-code-coverage/src/Node/Builder.php', - 'SebastianBergmann\\CodeCoverage\\Node\\Directory' => $vendorDir . '/phpunit/php-code-coverage/src/Node/Directory.php', - 'SebastianBergmann\\CodeCoverage\\Node\\File' => $vendorDir . '/phpunit/php-code-coverage/src/Node/File.php', - 'SebastianBergmann\\CodeCoverage\\Node\\Iterator' => $vendorDir . '/phpunit/php-code-coverage/src/Node/Iterator.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Clover' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Clover.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Crap4j' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Crap4j.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Html\\Dashboard' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Html/Renderer/Dashboard.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Html\\Directory' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Html/Renderer/Directory.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Html\\Facade' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Html/Facade.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Html\\File' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Html/Renderer/File.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Html\\Renderer' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Html/Renderer.php', - 'SebastianBergmann\\CodeCoverage\\Report\\PHP' => $vendorDir . '/phpunit/php-code-coverage/src/Report/PHP.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Text' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Text.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\BuildInformation' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Xml/BuildInformation.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Coverage' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Xml/Coverage.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Directory' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Xml/Directory.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Facade' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Xml/Facade.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\File' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Xml/File.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Method' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Xml/Method.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Node' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Xml/Node.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Project' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Xml/Project.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Report' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Xml/Report.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Source' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Xml/Source.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Tests' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Xml/Tests.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Totals' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Xml/Totals.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Unit' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Xml/Unit.php', - 'SebastianBergmann\\CodeCoverage\\RuntimeException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/RuntimeException.php', - 'SebastianBergmann\\CodeCoverage\\UnintentionallyCoveredCodeException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/UnintentionallyCoveredCodeException.php', - 'SebastianBergmann\\CodeCoverage\\Util' => $vendorDir . '/phpunit/php-code-coverage/src/Util.php', - 'SebastianBergmann\\CodeCoverage\\Version' => $vendorDir . '/phpunit/php-code-coverage/src/Version.php', - 'SebastianBergmann\\CodeUnitReverseLookup\\Wizard' => $vendorDir . '/sebastian/code-unit-reverse-lookup/src/Wizard.php', - 'SebastianBergmann\\Comparator\\ArrayComparator' => $vendorDir . '/sebastian/comparator/src/ArrayComparator.php', - 'SebastianBergmann\\Comparator\\Comparator' => $vendorDir . '/sebastian/comparator/src/Comparator.php', - 'SebastianBergmann\\Comparator\\ComparisonFailure' => $vendorDir . '/sebastian/comparator/src/ComparisonFailure.php', - 'SebastianBergmann\\Comparator\\DOMNodeComparator' => $vendorDir . '/sebastian/comparator/src/DOMNodeComparator.php', - 'SebastianBergmann\\Comparator\\DateTimeComparator' => $vendorDir . '/sebastian/comparator/src/DateTimeComparator.php', - 'SebastianBergmann\\Comparator\\DoubleComparator' => $vendorDir . '/sebastian/comparator/src/DoubleComparator.php', - 'SebastianBergmann\\Comparator\\ExceptionComparator' => $vendorDir . '/sebastian/comparator/src/ExceptionComparator.php', - 'SebastianBergmann\\Comparator\\Factory' => $vendorDir . '/sebastian/comparator/src/Factory.php', - 'SebastianBergmann\\Comparator\\MockObjectComparator' => $vendorDir . '/sebastian/comparator/src/MockObjectComparator.php', - 'SebastianBergmann\\Comparator\\NumericComparator' => $vendorDir . '/sebastian/comparator/src/NumericComparator.php', - 'SebastianBergmann\\Comparator\\ObjectComparator' => $vendorDir . '/sebastian/comparator/src/ObjectComparator.php', - 'SebastianBergmann\\Comparator\\ResourceComparator' => $vendorDir . '/sebastian/comparator/src/ResourceComparator.php', - 'SebastianBergmann\\Comparator\\ScalarComparator' => $vendorDir . '/sebastian/comparator/src/ScalarComparator.php', - 'SebastianBergmann\\Comparator\\SplObjectStorageComparator' => $vendorDir . '/sebastian/comparator/src/SplObjectStorageComparator.php', - 'SebastianBergmann\\Comparator\\TypeComparator' => $vendorDir . '/sebastian/comparator/src/TypeComparator.php', - 'SebastianBergmann\\Diff\\Chunk' => $vendorDir . '/sebastian/diff/src/Chunk.php', - 'SebastianBergmann\\Diff\\ConfigurationException' => $vendorDir . '/sebastian/diff/src/Exception/ConfigurationException.php', - 'SebastianBergmann\\Diff\\Diff' => $vendorDir . '/sebastian/diff/src/Diff.php', - 'SebastianBergmann\\Diff\\Differ' => $vendorDir . '/sebastian/diff/src/Differ.php', - 'SebastianBergmann\\Diff\\Exception' => $vendorDir . '/sebastian/diff/src/Exception/Exception.php', - 'SebastianBergmann\\Diff\\InvalidArgumentException' => $vendorDir . '/sebastian/diff/src/Exception/InvalidArgumentException.php', - 'SebastianBergmann\\Diff\\Line' => $vendorDir . '/sebastian/diff/src/Line.php', - 'SebastianBergmann\\Diff\\LongestCommonSubsequenceCalculator' => $vendorDir . '/sebastian/diff/src/LongestCommonSubsequenceCalculator.php', - 'SebastianBergmann\\Diff\\MemoryEfficientLongestCommonSubsequenceCalculator' => $vendorDir . '/sebastian/diff/src/MemoryEfficientLongestCommonSubsequenceCalculator.php', - 'SebastianBergmann\\Diff\\Output\\AbstractChunkOutputBuilder' => $vendorDir . '/sebastian/diff/src/Output/AbstractChunkOutputBuilder.php', - 'SebastianBergmann\\Diff\\Output\\DiffOnlyOutputBuilder' => $vendorDir . '/sebastian/diff/src/Output/DiffOnlyOutputBuilder.php', - 'SebastianBergmann\\Diff\\Output\\DiffOutputBuilderInterface' => $vendorDir . '/sebastian/diff/src/Output/DiffOutputBuilderInterface.php', - 'SebastianBergmann\\Diff\\Output\\StrictUnifiedDiffOutputBuilder' => $vendorDir . '/sebastian/diff/src/Output/StrictUnifiedDiffOutputBuilder.php', - 'SebastianBergmann\\Diff\\Output\\UnifiedDiffOutputBuilder' => $vendorDir . '/sebastian/diff/src/Output/UnifiedDiffOutputBuilder.php', - 'SebastianBergmann\\Diff\\Parser' => $vendorDir . '/sebastian/diff/src/Parser.php', - 'SebastianBergmann\\Diff\\TimeEfficientLongestCommonSubsequenceCalculator' => $vendorDir . '/sebastian/diff/src/TimeEfficientLongestCommonSubsequenceCalculator.php', - 'SebastianBergmann\\Environment\\Console' => $vendorDir . '/sebastian/environment/src/Console.php', - 'SebastianBergmann\\Environment\\OperatingSystem' => $vendorDir . '/sebastian/environment/src/OperatingSystem.php', - 'SebastianBergmann\\Environment\\Runtime' => $vendorDir . '/sebastian/environment/src/Runtime.php', - 'SebastianBergmann\\Exporter\\Exporter' => $vendorDir . '/sebastian/exporter/src/Exporter.php', - 'SebastianBergmann\\FileIterator\\Facade' => $vendorDir . '/phpunit/php-file-iterator/src/Facade.php', - 'SebastianBergmann\\FileIterator\\Factory' => $vendorDir . '/phpunit/php-file-iterator/src/Factory.php', - 'SebastianBergmann\\FileIterator\\Iterator' => $vendorDir . '/phpunit/php-file-iterator/src/Iterator.php', - 'SebastianBergmann\\GlobalState\\Blacklist' => $vendorDir . '/sebastian/global-state/src/Blacklist.php', - 'SebastianBergmann\\GlobalState\\CodeExporter' => $vendorDir . '/sebastian/global-state/src/CodeExporter.php', - 'SebastianBergmann\\GlobalState\\Exception' => $vendorDir . '/sebastian/global-state/src/exceptions/Exception.php', - 'SebastianBergmann\\GlobalState\\Restorer' => $vendorDir . '/sebastian/global-state/src/Restorer.php', - 'SebastianBergmann\\GlobalState\\RuntimeException' => $vendorDir . '/sebastian/global-state/src/exceptions/RuntimeException.php', - 'SebastianBergmann\\GlobalState\\Snapshot' => $vendorDir . '/sebastian/global-state/src/Snapshot.php', - 'SebastianBergmann\\ObjectEnumerator\\Enumerator' => $vendorDir . '/sebastian/object-enumerator/src/Enumerator.php', - 'SebastianBergmann\\ObjectEnumerator\\Exception' => $vendorDir . '/sebastian/object-enumerator/src/Exception.php', - 'SebastianBergmann\\ObjectEnumerator\\InvalidArgumentException' => $vendorDir . '/sebastian/object-enumerator/src/InvalidArgumentException.php', - 'SebastianBergmann\\ObjectReflector\\Exception' => $vendorDir . '/sebastian/object-reflector/src/Exception.php', - 'SebastianBergmann\\ObjectReflector\\InvalidArgumentException' => $vendorDir . '/sebastian/object-reflector/src/InvalidArgumentException.php', - 'SebastianBergmann\\ObjectReflector\\ObjectReflector' => $vendorDir . '/sebastian/object-reflector/src/ObjectReflector.php', - 'SebastianBergmann\\RecursionContext\\Context' => $vendorDir . '/sebastian/recursion-context/src/Context.php', - 'SebastianBergmann\\RecursionContext\\Exception' => $vendorDir . '/sebastian/recursion-context/src/Exception.php', - 'SebastianBergmann\\RecursionContext\\InvalidArgumentException' => $vendorDir . '/sebastian/recursion-context/src/InvalidArgumentException.php', - 'SebastianBergmann\\ResourceOperations\\ResourceOperations' => $vendorDir . '/sebastian/resource-operations/src/ResourceOperations.php', - 'SebastianBergmann\\Timer\\Exception' => $vendorDir . '/phpunit/php-timer/src/Exception.php', - 'SebastianBergmann\\Timer\\RuntimeException' => $vendorDir . '/phpunit/php-timer/src/RuntimeException.php', - 'SebastianBergmann\\Timer\\Timer' => $vendorDir . '/phpunit/php-timer/src/Timer.php', - 'SebastianBergmann\\Type\\CallableType' => $vendorDir . '/sebastian/type/src/CallableType.php', - 'SebastianBergmann\\Type\\Exception' => $vendorDir . '/sebastian/type/src/exception/Exception.php', - 'SebastianBergmann\\Type\\GenericObjectType' => $vendorDir . '/sebastian/type/src/GenericObjectType.php', - 'SebastianBergmann\\Type\\IterableType' => $vendorDir . '/sebastian/type/src/IterableType.php', - 'SebastianBergmann\\Type\\NullType' => $vendorDir . '/sebastian/type/src/NullType.php', - 'SebastianBergmann\\Type\\ObjectType' => $vendorDir . '/sebastian/type/src/ObjectType.php', - 'SebastianBergmann\\Type\\RuntimeException' => $vendorDir . '/sebastian/type/src/exception/RuntimeException.php', - 'SebastianBergmann\\Type\\SimpleType' => $vendorDir . '/sebastian/type/src/SimpleType.php', - 'SebastianBergmann\\Type\\Type' => $vendorDir . '/sebastian/type/src/Type.php', - 'SebastianBergmann\\Type\\TypeName' => $vendorDir . '/sebastian/type/src/TypeName.php', - 'SebastianBergmann\\Type\\UnknownType' => $vendorDir . '/sebastian/type/src/UnknownType.php', - 'SebastianBergmann\\Type\\VoidType' => $vendorDir . '/sebastian/type/src/VoidType.php', - 'SebastianBergmann\\Version' => $vendorDir . '/sebastian/version/src/Version.php', - 'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', - 'Text_Template' => $vendorDir . '/phpunit/php-text-template/src/Template.php', - 'TheSeer\\Tokenizer\\Exception' => $vendorDir . '/theseer/tokenizer/src/Exception.php', - 'TheSeer\\Tokenizer\\NamespaceUri' => $vendorDir . '/theseer/tokenizer/src/NamespaceUri.php', - 'TheSeer\\Tokenizer\\NamespaceUriException' => $vendorDir . '/theseer/tokenizer/src/NamespaceUriException.php', - 'TheSeer\\Tokenizer\\Token' => $vendorDir . '/theseer/tokenizer/src/Token.php', - 'TheSeer\\Tokenizer\\TokenCollection' => $vendorDir . '/theseer/tokenizer/src/TokenCollection.php', - 'TheSeer\\Tokenizer\\TokenCollectionException' => $vendorDir . '/theseer/tokenizer/src/TokenCollectionException.php', - 'TheSeer\\Tokenizer\\Tokenizer' => $vendorDir . '/theseer/tokenizer/src/Tokenizer.php', - 'TheSeer\\Tokenizer\\XMLSerializer' => $vendorDir . '/theseer/tokenizer/src/XMLSerializer.php', - 'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', - 'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', -); diff --git a/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php deleted file mode 100644 index 364bfee..0000000 --- a/vendor/composer/autoload_files.php +++ /dev/null @@ -1,18 +0,0 @@ - $vendorDir . '/symfony/polyfill-php80/bootstrap.php', - '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', - '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', - '0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php', - '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php', - '7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', - 'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php', - '6124b4c8570aa390c21fafd04a26c69f' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php', - '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php', -); diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php deleted file mode 100644 index 631bf71..0000000 --- a/vendor/composer/autoload_namespaces.php +++ /dev/null @@ -1,10 +0,0 @@ - array($vendorDir . '/mockery/mockery/library'), -); diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php deleted file mode 100644 index 286c22d..0000000 --- a/vendor/composer/autoload_psr4.php +++ /dev/null @@ -1,40 +0,0 @@ - array($vendorDir . '/phpdocumentor/reflection-common/src', $vendorDir . '/phpdocumentor/reflection-docblock/src', $vendorDir . '/phpdocumentor/type-resolver/src'), - 'Webmozart\\Assert\\' => array($vendorDir . '/webmozart/assert/src'), - 'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'), - 'Symfony\\Polyfill\\Php73\\' => array($vendorDir . '/symfony/polyfill-php73'), - 'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'), - 'Symfony\\Polyfill\\Ctype\\' => array($vendorDir . '/symfony/polyfill-ctype'), - 'Symfony\\Contracts\\Service\\' => array($vendorDir . '/symfony/service-contracts'), - 'Symfony\\Component\\Finder\\' => array($vendorDir . '/symfony/finder'), - 'Symfony\\Component\\Console\\' => array($vendorDir . '/symfony/console'), - 'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'), - 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-factory/src', $vendorDir . '/psr/http-message/src'), - 'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'), - 'Psr\\Container\\' => array($vendorDir . '/psr/container/src'), - 'Prophecy\\' => array($vendorDir . '/phpspec/prophecy/src/Prophecy'), - 'PhpParser\\' => array($vendorDir . '/nikic/php-parser/lib/PhpParser'), - 'PhpOption\\' => array($vendorDir . '/phpoption/phpoption/src/PhpOption'), - 'PackageVersions\\' => array($vendorDir . '/composer/package-versions-deprecated/src/PackageVersions'), - 'PHPStan\\PhpDocParser\\' => array($vendorDir . '/phpstan/phpdoc-parser/src'), - 'PHPStan\\' => array($vendorDir . '/phpstan/phpstan/src', $vendorDir . '/phpstan/phpstan-mockery/src'), - 'Jean85\\' => array($vendorDir . '/jean85/pretty-package-versions/src'), - 'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'), - 'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'), - 'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'), - 'GrahamCampbell\\ResultType\\' => array($vendorDir . '/graham-campbell/result-type/src'), - 'Fleetbase\\Sdk\\Test\\' => array($baseDir . '/tests'), - 'Fleetbase\\Sdk\\' => array($baseDir . '/src'), - 'Dotenv\\' => array($vendorDir . '/vlucas/phpdotenv/src'), - 'Doctrine\\Instantiator\\' => array($vendorDir . '/doctrine/instantiator/src/Doctrine/Instantiator'), - 'Doctrine\\Inflector\\' => array($vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector'), - 'DeepCopy\\' => array($vendorDir . '/myclabs/deep-copy/src/DeepCopy'), - 'Composer\\XdebugHandler\\' => array($vendorDir . '/composer/xdebug-handler/src'), -); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php deleted file mode 100644 index 80cf889..0000000 --- a/vendor/composer/autoload_real.php +++ /dev/null @@ -1,80 +0,0 @@ -= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); - if ($useStaticLoader) { - require __DIR__ . '/autoload_static.php'; - - call_user_func(\Composer\Autoload\ComposerStaticInitfc5fc5108939805e5e233eb748dce4ed::getInitializer($loader)); - } else { - $map = require __DIR__ . '/autoload_namespaces.php'; - foreach ($map as $namespace => $path) { - $loader->set($namespace, $path); - } - - $map = require __DIR__ . '/autoload_psr4.php'; - foreach ($map as $namespace => $path) { - $loader->setPsr4($namespace, $path); - } - - $classMap = require __DIR__ . '/autoload_classmap.php'; - if ($classMap) { - $loader->addClassMap($classMap); - } - } - - $loader->register(true); - - if ($useStaticLoader) { - $includeFiles = Composer\Autoload\ComposerStaticInitfc5fc5108939805e5e233eb748dce4ed::$files; - } else { - $includeFiles = require __DIR__ . '/autoload_files.php'; - } - foreach ($includeFiles as $fileIdentifier => $file) { - composerRequirefc5fc5108939805e5e233eb748dce4ed($fileIdentifier, $file); - } - - return $loader; - } -} - -/** - * @param string $fileIdentifier - * @param string $file - * @return void - */ -function composerRequirefc5fc5108939805e5e233eb748dce4ed($fileIdentifier, $file) -{ - if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { - $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; - - require $file; - } -} diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php deleted file mode 100644 index 3d30865..0000000 --- a/vendor/composer/autoload_static.php +++ /dev/null @@ -1,1081 +0,0 @@ - __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', - '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', - '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', - '0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php', - '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', - '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php', - 'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php', - '6124b4c8570aa390c21fafd04a26c69f' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php', - '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php', - ); - - public static $prefixLengthsPsr4 = array ( - 'p' => - array ( - 'phpDocumentor\\Reflection\\' => 25, - ), - 'W' => - array ( - 'Webmozart\\Assert\\' => 17, - ), - 'S' => - array ( - 'Symfony\\Polyfill\\Php80\\' => 23, - 'Symfony\\Polyfill\\Php73\\' => 23, - 'Symfony\\Polyfill\\Mbstring\\' => 26, - 'Symfony\\Polyfill\\Ctype\\' => 23, - 'Symfony\\Contracts\\Service\\' => 26, - 'Symfony\\Component\\Finder\\' => 25, - 'Symfony\\Component\\Console\\' => 26, - ), - 'P' => - array ( - 'Psr\\Log\\' => 8, - 'Psr\\Http\\Message\\' => 17, - 'Psr\\Http\\Client\\' => 16, - 'Psr\\Container\\' => 14, - 'Prophecy\\' => 9, - 'PhpParser\\' => 10, - 'PhpOption\\' => 10, - 'PackageVersions\\' => 16, - 'PHPStan\\PhpDocParser\\' => 21, - 'PHPStan\\' => 8, - ), - 'J' => - array ( - 'Jean85\\' => 7, - ), - 'G' => - array ( - 'GuzzleHttp\\Psr7\\' => 16, - 'GuzzleHttp\\Promise\\' => 19, - 'GuzzleHttp\\' => 11, - 'GrahamCampbell\\ResultType\\' => 26, - ), - 'F' => - array ( - 'Fleetbase\\Sdk\\Test\\' => 19, - 'Fleetbase\\Sdk\\' => 14, - ), - 'D' => - array ( - 'Dotenv\\' => 7, - 'Doctrine\\Instantiator\\' => 22, - 'Doctrine\\Inflector\\' => 19, - 'DeepCopy\\' => 9, - ), - 'C' => - array ( - 'Composer\\XdebugHandler\\' => 23, - ), - ); - - public static $prefixDirsPsr4 = array ( - 'phpDocumentor\\Reflection\\' => - array ( - 0 => __DIR__ . '/..' . '/phpdocumentor/reflection-common/src', - 1 => __DIR__ . '/..' . '/phpdocumentor/reflection-docblock/src', - 2 => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src', - ), - 'Webmozart\\Assert\\' => - array ( - 0 => __DIR__ . '/..' . '/webmozart/assert/src', - ), - 'Symfony\\Polyfill\\Php80\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-php80', - ), - 'Symfony\\Polyfill\\Php73\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-php73', - ), - 'Symfony\\Polyfill\\Mbstring\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring', - ), - 'Symfony\\Polyfill\\Ctype\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-ctype', - ), - 'Symfony\\Contracts\\Service\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/service-contracts', - ), - 'Symfony\\Component\\Finder\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/finder', - ), - 'Symfony\\Component\\Console\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/console', - ), - 'Psr\\Log\\' => - array ( - 0 => __DIR__ . '/..' . '/psr/log/Psr/Log', - ), - 'Psr\\Http\\Message\\' => - array ( - 0 => __DIR__ . '/..' . '/psr/http-factory/src', - 1 => __DIR__ . '/..' . '/psr/http-message/src', - ), - 'Psr\\Http\\Client\\' => - array ( - 0 => __DIR__ . '/..' . '/psr/http-client/src', - ), - 'Psr\\Container\\' => - array ( - 0 => __DIR__ . '/..' . '/psr/container/src', - ), - 'Prophecy\\' => - array ( - 0 => __DIR__ . '/..' . '/phpspec/prophecy/src/Prophecy', - ), - 'PhpParser\\' => - array ( - 0 => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser', - ), - 'PhpOption\\' => - array ( - 0 => __DIR__ . '/..' . '/phpoption/phpoption/src/PhpOption', - ), - 'PackageVersions\\' => - array ( - 0 => __DIR__ . '/..' . '/composer/package-versions-deprecated/src/PackageVersions', - ), - 'PHPStan\\PhpDocParser\\' => - array ( - 0 => __DIR__ . '/..' . '/phpstan/phpdoc-parser/src', - ), - 'PHPStan\\' => - array ( - 0 => __DIR__ . '/..' . '/phpstan/phpstan/src', - 1 => __DIR__ . '/..' . '/phpstan/phpstan-mockery/src', - ), - 'Jean85\\' => - array ( - 0 => __DIR__ . '/..' . '/jean85/pretty-package-versions/src', - ), - 'GuzzleHttp\\Psr7\\' => - array ( - 0 => __DIR__ . '/..' . '/guzzlehttp/psr7/src', - ), - 'GuzzleHttp\\Promise\\' => - array ( - 0 => __DIR__ . '/..' . '/guzzlehttp/promises/src', - ), - 'GuzzleHttp\\' => - array ( - 0 => __DIR__ . '/..' . '/guzzlehttp/guzzle/src', - ), - 'GrahamCampbell\\ResultType\\' => - array ( - 0 => __DIR__ . '/..' . '/graham-campbell/result-type/src', - ), - 'Fleetbase\\Sdk\\Test\\' => - array ( - 0 => __DIR__ . '/../..' . '/tests', - ), - 'Fleetbase\\Sdk\\' => - array ( - 0 => __DIR__ . '/../..' . '/src', - ), - 'Dotenv\\' => - array ( - 0 => __DIR__ . '/..' . '/vlucas/phpdotenv/src', - ), - 'Doctrine\\Instantiator\\' => - array ( - 0 => __DIR__ . '/..' . '/doctrine/instantiator/src/Doctrine/Instantiator', - ), - 'Doctrine\\Inflector\\' => - array ( - 0 => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector', - ), - 'DeepCopy\\' => - array ( - 0 => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy', - ), - 'Composer\\XdebugHandler\\' => - array ( - 0 => __DIR__ . '/..' . '/composer/xdebug-handler/src', - ), - ); - - public static $prefixesPsr0 = array ( - 'M' => - array ( - 'Mockery' => - array ( - 0 => __DIR__ . '/..' . '/mockery/mockery/library', - ), - ), - ); - - public static $classMap = array ( - 'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', - 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', - 'Hamcrest\\Arrays\\IsArray' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArray.php', - 'Hamcrest\\Arrays\\IsArrayContaining' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContaining.php', - 'Hamcrest\\Arrays\\IsArrayContainingInAnyOrder' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContainingInAnyOrder.php', - 'Hamcrest\\Arrays\\IsArrayContainingInOrder' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContainingInOrder.php', - 'Hamcrest\\Arrays\\IsArrayContainingKey' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContainingKey.php', - 'Hamcrest\\Arrays\\IsArrayContainingKeyValuePair' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContainingKeyValuePair.php', - 'Hamcrest\\Arrays\\IsArrayWithSize' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayWithSize.php', - 'Hamcrest\\Arrays\\MatchingOnce' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/MatchingOnce.php', - 'Hamcrest\\Arrays\\SeriesMatchingOnce' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/SeriesMatchingOnce.php', - 'Hamcrest\\AssertionError' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/AssertionError.php', - 'Hamcrest\\BaseDescription' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/BaseDescription.php', - 'Hamcrest\\BaseMatcher' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/BaseMatcher.php', - 'Hamcrest\\Collection\\IsEmptyTraversable' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Collection/IsEmptyTraversable.php', - 'Hamcrest\\Collection\\IsTraversableWithSize' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Collection/IsTraversableWithSize.php', - 'Hamcrest\\Core\\AllOf' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/AllOf.php', - 'Hamcrest\\Core\\AnyOf' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/AnyOf.php', - 'Hamcrest\\Core\\CombinableMatcher' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/CombinableMatcher.php', - 'Hamcrest\\Core\\DescribedAs' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/DescribedAs.php', - 'Hamcrest\\Core\\Every' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/Every.php', - 'Hamcrest\\Core\\HasToString' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/HasToString.php', - 'Hamcrest\\Core\\Is' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/Is.php', - 'Hamcrest\\Core\\IsAnything' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsAnything.php', - 'Hamcrest\\Core\\IsCollectionContaining' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsCollectionContaining.php', - 'Hamcrest\\Core\\IsEqual' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsEqual.php', - 'Hamcrest\\Core\\IsIdentical' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsIdentical.php', - 'Hamcrest\\Core\\IsInstanceOf' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsInstanceOf.php', - 'Hamcrest\\Core\\IsNot' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsNot.php', - 'Hamcrest\\Core\\IsNull' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsNull.php', - 'Hamcrest\\Core\\IsSame' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsSame.php', - 'Hamcrest\\Core\\IsTypeOf' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsTypeOf.php', - 'Hamcrest\\Core\\Set' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/Set.php', - 'Hamcrest\\Core\\ShortcutCombination' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/ShortcutCombination.php', - 'Hamcrest\\Description' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Description.php', - 'Hamcrest\\DiagnosingMatcher' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/DiagnosingMatcher.php', - 'Hamcrest\\FeatureMatcher' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/FeatureMatcher.php', - 'Hamcrest\\Internal\\SelfDescribingValue' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Internal/SelfDescribingValue.php', - 'Hamcrest\\Matcher' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Matcher.php', - 'Hamcrest\\MatcherAssert' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/MatcherAssert.php', - 'Hamcrest\\Matchers' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Matchers.php', - 'Hamcrest\\NullDescription' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/NullDescription.php', - 'Hamcrest\\Number\\IsCloseTo' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Number/IsCloseTo.php', - 'Hamcrest\\Number\\OrderingComparison' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Number/OrderingComparison.php', - 'Hamcrest\\SelfDescribing' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/SelfDescribing.php', - 'Hamcrest\\StringDescription' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/StringDescription.php', - 'Hamcrest\\Text\\IsEmptyString' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/IsEmptyString.php', - 'Hamcrest\\Text\\IsEqualIgnoringCase' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/IsEqualIgnoringCase.php', - 'Hamcrest\\Text\\IsEqualIgnoringWhiteSpace' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/IsEqualIgnoringWhiteSpace.php', - 'Hamcrest\\Text\\MatchesPattern' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/MatchesPattern.php', - 'Hamcrest\\Text\\StringContains' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringContains.php', - 'Hamcrest\\Text\\StringContainsIgnoringCase' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringContainsIgnoringCase.php', - 'Hamcrest\\Text\\StringContainsInOrder' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringContainsInOrder.php', - 'Hamcrest\\Text\\StringEndsWith' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringEndsWith.php', - 'Hamcrest\\Text\\StringStartsWith' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringStartsWith.php', - 'Hamcrest\\Text\\SubstringMatcher' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/SubstringMatcher.php', - 'Hamcrest\\TypeSafeDiagnosingMatcher' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/TypeSafeDiagnosingMatcher.php', - 'Hamcrest\\TypeSafeMatcher' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/TypeSafeMatcher.php', - 'Hamcrest\\Type\\IsArray' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsArray.php', - 'Hamcrest\\Type\\IsBoolean' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsBoolean.php', - 'Hamcrest\\Type\\IsCallable' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsCallable.php', - 'Hamcrest\\Type\\IsDouble' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsDouble.php', - 'Hamcrest\\Type\\IsInteger' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsInteger.php', - 'Hamcrest\\Type\\IsNumeric' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsNumeric.php', - 'Hamcrest\\Type\\IsObject' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsObject.php', - 'Hamcrest\\Type\\IsResource' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsResource.php', - 'Hamcrest\\Type\\IsScalar' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsScalar.php', - 'Hamcrest\\Type\\IsString' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsString.php', - 'Hamcrest\\Util' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Util.php', - 'Hamcrest\\Xml\\HasXPath' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Xml/HasXPath.php', - 'JakubOnderka\\PhpParallelLint\\Application' => __DIR__ . '/..' . '/php-parallel-lint/php-parallel-lint/src/Application.php', - 'JakubOnderka\\PhpParallelLint\\ArrayIterator' => __DIR__ . '/..' . '/php-parallel-lint/php-parallel-lint/src/Settings.php', - 'JakubOnderka\\PhpParallelLint\\Blame' => __DIR__ . '/..' . '/php-parallel-lint/php-parallel-lint/src/Error.php', - 'JakubOnderka\\PhpParallelLint\\CheckstyleOutput' => __DIR__ . '/..' . '/php-parallel-lint/php-parallel-lint/src/Output.php', - 'JakubOnderka\\PhpParallelLint\\ConsoleWriter' => __DIR__ . '/..' . '/php-parallel-lint/php-parallel-lint/src/Output.php', - 'JakubOnderka\\PhpParallelLint\\Contracts\\SyntaxErrorCallback' => __DIR__ . '/..' . '/php-parallel-lint/php-parallel-lint/src/Contracts/SyntaxErrorCallback.php', - 'JakubOnderka\\PhpParallelLint\\Error' => __DIR__ . '/..' . '/php-parallel-lint/php-parallel-lint/src/Error.php', - 'JakubOnderka\\PhpParallelLint\\ErrorFormatter' => __DIR__ . '/..' . '/php-parallel-lint/php-parallel-lint/src/ErrorFormatter.php', - 'JakubOnderka\\PhpParallelLint\\Exception' => __DIR__ . '/..' . '/php-parallel-lint/php-parallel-lint/src/exceptions.php', - 'JakubOnderka\\PhpParallelLint\\FileWriter' => __DIR__ . '/..' . '/php-parallel-lint/php-parallel-lint/src/Output.php', - 'JakubOnderka\\PhpParallelLint\\GitLabOutput' => __DIR__ . '/..' . '/php-parallel-lint/php-parallel-lint/src/Output.php', - 'JakubOnderka\\PhpParallelLint\\IWriter' => __DIR__ . '/..' . '/php-parallel-lint/php-parallel-lint/src/Output.php', - 'JakubOnderka\\PhpParallelLint\\InvalidArgumentException' => __DIR__ . '/..' . '/php-parallel-lint/php-parallel-lint/src/exceptions.php', - 'JakubOnderka\\PhpParallelLint\\JsonOutput' => __DIR__ . '/..' . '/php-parallel-lint/php-parallel-lint/src/Output.php', - 'JakubOnderka\\PhpParallelLint\\Manager' => __DIR__ . '/..' . '/php-parallel-lint/php-parallel-lint/src/Manager.php', - 'JakubOnderka\\PhpParallelLint\\MultipleWriter' => __DIR__ . '/..' . '/php-parallel-lint/php-parallel-lint/src/Output.php', - 'JakubOnderka\\PhpParallelLint\\NotExistsClassException' => __DIR__ . '/..' . '/php-parallel-lint/php-parallel-lint/src/exceptions.php', - 'JakubOnderka\\PhpParallelLint\\NotExistsPathException' => __DIR__ . '/..' . '/php-parallel-lint/php-parallel-lint/src/exceptions.php', - 'JakubOnderka\\PhpParallelLint\\NotImplementCallbackException' => __DIR__ . '/..' . '/php-parallel-lint/php-parallel-lint/src/exceptions.php', - 'JakubOnderka\\PhpParallelLint\\NullWriter' => __DIR__ . '/..' . '/php-parallel-lint/php-parallel-lint/src/Output.php', - 'JakubOnderka\\PhpParallelLint\\Output' => __DIR__ . '/..' . '/php-parallel-lint/php-parallel-lint/src/Output.php', - 'JakubOnderka\\PhpParallelLint\\ParallelLint' => __DIR__ . '/..' . '/php-parallel-lint/php-parallel-lint/src/ParallelLint.php', - 'JakubOnderka\\PhpParallelLint\\Process\\GitBlameProcess' => __DIR__ . '/..' . '/php-parallel-lint/php-parallel-lint/src/Process/GitBlameProcess.php', - 'JakubOnderka\\PhpParallelLint\\Process\\LintProcess' => __DIR__ . '/..' . '/php-parallel-lint/php-parallel-lint/src/Process/LintProcess.php', - 'JakubOnderka\\PhpParallelLint\\Process\\PhpExecutable' => __DIR__ . '/..' . '/php-parallel-lint/php-parallel-lint/src/Process/PhpExecutable.php', - 'JakubOnderka\\PhpParallelLint\\Process\\PhpProcess' => __DIR__ . '/..' . '/php-parallel-lint/php-parallel-lint/src/Process/PhpProcess.php', - 'JakubOnderka\\PhpParallelLint\\Process\\Process' => __DIR__ . '/..' . '/php-parallel-lint/php-parallel-lint/src/Process/Process.php', - 'JakubOnderka\\PhpParallelLint\\Process\\SkipLintProcess' => __DIR__ . '/..' . '/php-parallel-lint/php-parallel-lint/src/Process/SkipLintProcess.php', - 'JakubOnderka\\PhpParallelLint\\RecursiveDirectoryFilterIterator' => __DIR__ . '/..' . '/php-parallel-lint/php-parallel-lint/src/Manager.php', - 'JakubOnderka\\PhpParallelLint\\Result' => __DIR__ . '/..' . '/php-parallel-lint/php-parallel-lint/src/Result.php', - 'JakubOnderka\\PhpParallelLint\\RunTimeException' => __DIR__ . '/..' . '/php-parallel-lint/php-parallel-lint/src/exceptions.php', - 'JakubOnderka\\PhpParallelLint\\Settings' => __DIR__ . '/..' . '/php-parallel-lint/php-parallel-lint/src/Settings.php', - 'JakubOnderka\\PhpParallelLint\\SyntaxError' => __DIR__ . '/..' . '/php-parallel-lint/php-parallel-lint/src/Error.php', - 'JakubOnderka\\PhpParallelLint\\TextOutput' => __DIR__ . '/..' . '/php-parallel-lint/php-parallel-lint/src/Output.php', - 'JakubOnderka\\PhpParallelLint\\TextOutputColored' => __DIR__ . '/..' . '/php-parallel-lint/php-parallel-lint/src/Output.php', - 'JsonException' => __DIR__ . '/..' . '/symfony/polyfill-php73/Resources/stubs/JsonException.php', - 'JsonSerializable' => __DIR__ . '/..' . '/php-parallel-lint/php-parallel-lint/src/polyfill.php', - 'Nette\\ArgumentOutOfRangeException' => __DIR__ . '/..' . '/nette/utils/src/exceptions.php', - 'Nette\\Bootstrap\\Configurator' => __DIR__ . '/..' . '/nette/bootstrap/src/Bootstrap/Configurator.php', - 'Nette\\Bootstrap\\Extensions\\ConstantsExtension' => __DIR__ . '/..' . '/nette/bootstrap/src/Bootstrap/Extensions/ConstantsExtension.php', - 'Nette\\Bootstrap\\Extensions\\PhpExtension' => __DIR__ . '/..' . '/nette/bootstrap/src/Bootstrap/Extensions/PhpExtension.php', - 'Nette\\Bridges\\DITracy\\ContainerPanel' => __DIR__ . '/..' . '/nette/di/src/Bridges/DITracy/ContainerPanel.php', - 'Nette\\Configurator' => __DIR__ . '/..' . '/nette/bootstrap/src/Configurator.php', - 'Nette\\DI\\Attributes\\Inject' => __DIR__ . '/..' . '/nette/di/src/DI/Attributes/Inject.php', - 'Nette\\DI\\Autowiring' => __DIR__ . '/..' . '/nette/di/src/DI/Autowiring.php', - 'Nette\\DI\\Compiler' => __DIR__ . '/..' . '/nette/di/src/DI/Compiler.php', - 'Nette\\DI\\CompilerExtension' => __DIR__ . '/..' . '/nette/di/src/DI/CompilerExtension.php', - 'Nette\\DI\\Config\\Adapter' => __DIR__ . '/..' . '/nette/di/src/DI/Config/Adapter.php', - 'Nette\\DI\\Config\\Adapters\\NeonAdapter' => __DIR__ . '/..' . '/nette/di/src/DI/Config/Adapters/NeonAdapter.php', - 'Nette\\DI\\Config\\Adapters\\PhpAdapter' => __DIR__ . '/..' . '/nette/di/src/DI/Config/Adapters/PhpAdapter.php', - 'Nette\\DI\\Config\\DefinitionSchema' => __DIR__ . '/..' . '/nette/di/src/DI/Config/DefinitionSchema.php', - 'Nette\\DI\\Config\\Helpers' => __DIR__ . '/..' . '/nette/di/src/DI/Config/Helpers.php', - 'Nette\\DI\\Config\\IAdapter' => __DIR__ . '/..' . '/nette/di/src/compatibility.php', - 'Nette\\DI\\Config\\Loader' => __DIR__ . '/..' . '/nette/di/src/DI/Config/Loader.php', - 'Nette\\DI\\Container' => __DIR__ . '/..' . '/nette/di/src/DI/Container.php', - 'Nette\\DI\\ContainerBuilder' => __DIR__ . '/..' . '/nette/di/src/DI/ContainerBuilder.php', - 'Nette\\DI\\ContainerLoader' => __DIR__ . '/..' . '/nette/di/src/DI/ContainerLoader.php', - 'Nette\\DI\\Definitions\\AccessorDefinition' => __DIR__ . '/..' . '/nette/di/src/DI/Definitions/AccessorDefinition.php', - 'Nette\\DI\\Definitions\\Definition' => __DIR__ . '/..' . '/nette/di/src/DI/Definitions/Definition.php', - 'Nette\\DI\\Definitions\\FactoryDefinition' => __DIR__ . '/..' . '/nette/di/src/DI/Definitions/FactoryDefinition.php', - 'Nette\\DI\\Definitions\\ImportedDefinition' => __DIR__ . '/..' . '/nette/di/src/DI/Definitions/ImportedDefinition.php', - 'Nette\\DI\\Definitions\\LocatorDefinition' => __DIR__ . '/..' . '/nette/di/src/DI/Definitions/LocatorDefinition.php', - 'Nette\\DI\\Definitions\\Reference' => __DIR__ . '/..' . '/nette/di/src/DI/Definitions/Reference.php', - 'Nette\\DI\\Definitions\\ServiceDefinition' => __DIR__ . '/..' . '/nette/di/src/DI/Definitions/ServiceDefinition.php', - 'Nette\\DI\\Definitions\\Statement' => __DIR__ . '/..' . '/nette/di/src/DI/Definitions/Statement.php', - 'Nette\\DI\\DependencyChecker' => __DIR__ . '/..' . '/nette/di/src/DI/DependencyChecker.php', - 'Nette\\DI\\DynamicParameter' => __DIR__ . '/..' . '/nette/di/src/DI/DynamicParameter.php', - 'Nette\\DI\\Extensions\\ConstantsExtension' => __DIR__ . '/..' . '/nette/di/src/DI/Extensions/ConstantsExtension.php', - 'Nette\\DI\\Extensions\\DIExtension' => __DIR__ . '/..' . '/nette/di/src/DI/Extensions/DIExtension.php', - 'Nette\\DI\\Extensions\\DecoratorExtension' => __DIR__ . '/..' . '/nette/di/src/DI/Extensions/DecoratorExtension.php', - 'Nette\\DI\\Extensions\\ExtensionsExtension' => __DIR__ . '/..' . '/nette/di/src/DI/Extensions/ExtensionsExtension.php', - 'Nette\\DI\\Extensions\\InjectExtension' => __DIR__ . '/..' . '/nette/di/src/DI/Extensions/InjectExtension.php', - 'Nette\\DI\\Extensions\\ParametersExtension' => __DIR__ . '/..' . '/nette/di/src/DI/Extensions/ParametersExtension.php', - 'Nette\\DI\\Extensions\\PhpExtension' => __DIR__ . '/..' . '/nette/di/src/DI/Extensions/PhpExtension.php', - 'Nette\\DI\\Extensions\\SearchExtension' => __DIR__ . '/..' . '/nette/di/src/DI/Extensions/SearchExtension.php', - 'Nette\\DI\\Extensions\\ServicesExtension' => __DIR__ . '/..' . '/nette/di/src/DI/Extensions/ServicesExtension.php', - 'Nette\\DI\\Helpers' => __DIR__ . '/..' . '/nette/di/src/DI/Helpers.php', - 'Nette\\DI\\InvalidConfigurationException' => __DIR__ . '/..' . '/nette/di/src/DI/exceptions.php', - 'Nette\\DI\\MissingServiceException' => __DIR__ . '/..' . '/nette/di/src/DI/exceptions.php', - 'Nette\\DI\\NotAllowedDuringResolvingException' => __DIR__ . '/..' . '/nette/di/src/DI/exceptions.php', - 'Nette\\DI\\PhpGenerator' => __DIR__ . '/..' . '/nette/di/src/DI/PhpGenerator.php', - 'Nette\\DI\\Resolver' => __DIR__ . '/..' . '/nette/di/src/DI/Resolver.php', - 'Nette\\DI\\ServiceCreationException' => __DIR__ . '/..' . '/nette/di/src/DI/exceptions.php', - 'Nette\\DI\\ServiceDefinition' => __DIR__ . '/..' . '/nette/di/src/compatibility.php', - 'Nette\\DI\\Statement' => __DIR__ . '/..' . '/nette/di/src/compatibility.php', - 'Nette\\DeprecatedException' => __DIR__ . '/..' . '/nette/utils/src/exceptions.php', - 'Nette\\DirectoryNotFoundException' => __DIR__ . '/..' . '/nette/utils/src/exceptions.php', - 'Nette\\FileNotFoundException' => __DIR__ . '/..' . '/nette/utils/src/exceptions.php', - 'Nette\\HtmlStringable' => __DIR__ . '/..' . '/nette/utils/src/HtmlStringable.php', - 'Nette\\IOException' => __DIR__ . '/..' . '/nette/utils/src/exceptions.php', - 'Nette\\InvalidArgumentException' => __DIR__ . '/..' . '/nette/utils/src/exceptions.php', - 'Nette\\InvalidStateException' => __DIR__ . '/..' . '/nette/utils/src/exceptions.php', - 'Nette\\Iterators\\CachingIterator' => __DIR__ . '/..' . '/nette/utils/src/Iterators/CachingIterator.php', - 'Nette\\Iterators\\Mapper' => __DIR__ . '/..' . '/nette/utils/src/Iterators/Mapper.php', - 'Nette\\Loaders\\RobotLoader' => __DIR__ . '/..' . '/nette/robot-loader/src/RobotLoader/RobotLoader.php', - 'Nette\\Localization\\ITranslator' => __DIR__ . '/..' . '/nette/utils/src/compatibility.php', - 'Nette\\Localization\\Translator' => __DIR__ . '/..' . '/nette/utils/src/Translator.php', - 'Nette\\MemberAccessException' => __DIR__ . '/..' . '/nette/utils/src/exceptions.php', - 'Nette\\Neon\\Decoder' => __DIR__ . '/..' . '/nette/neon/src/Neon/Decoder.php', - 'Nette\\Neon\\Encoder' => __DIR__ . '/..' . '/nette/neon/src/Neon/Encoder.php', - 'Nette\\Neon\\Entity' => __DIR__ . '/..' . '/nette/neon/src/Neon/Entity.php', - 'Nette\\Neon\\Exception' => __DIR__ . '/..' . '/nette/neon/src/Neon/Exception.php', - 'Nette\\Neon\\Lexer' => __DIR__ . '/..' . '/nette/neon/src/Neon/Lexer.php', - 'Nette\\Neon\\Neon' => __DIR__ . '/..' . '/nette/neon/src/Neon/Neon.php', - 'Nette\\Neon\\Node' => __DIR__ . '/..' . '/nette/neon/src/Neon/Node.php', - 'Nette\\Neon\\Node\\ArrayItemNode' => __DIR__ . '/..' . '/nette/neon/src/Neon/Node/ArrayItemNode.php', - 'Nette\\Neon\\Node\\ArrayNode' => __DIR__ . '/..' . '/nette/neon/src/Neon/Node/ArrayNode.php', - 'Nette\\Neon\\Node\\BlockArrayNode' => __DIR__ . '/..' . '/nette/neon/src/Neon/Node/BlockArrayNode.php', - 'Nette\\Neon\\Node\\EntityChainNode' => __DIR__ . '/..' . '/nette/neon/src/Neon/Node/EntityChainNode.php', - 'Nette\\Neon\\Node\\EntityNode' => __DIR__ . '/..' . '/nette/neon/src/Neon/Node/EntityNode.php', - 'Nette\\Neon\\Node\\InlineArrayNode' => __DIR__ . '/..' . '/nette/neon/src/Neon/Node/InlineArrayNode.php', - 'Nette\\Neon\\Node\\LiteralNode' => __DIR__ . '/..' . '/nette/neon/src/Neon/Node/LiteralNode.php', - 'Nette\\Neon\\Node\\StringNode' => __DIR__ . '/..' . '/nette/neon/src/Neon/Node/StringNode.php', - 'Nette\\Neon\\Parser' => __DIR__ . '/..' . '/nette/neon/src/Neon/Parser.php', - 'Nette\\Neon\\Token' => __DIR__ . '/..' . '/nette/neon/src/Neon/Token.php', - 'Nette\\Neon\\TokenStream' => __DIR__ . '/..' . '/nette/neon/src/Neon/TokenStream.php', - 'Nette\\Neon\\Traverser' => __DIR__ . '/..' . '/nette/neon/src/Neon/Traverser.php', - 'Nette\\NotImplementedException' => __DIR__ . '/..' . '/nette/utils/src/exceptions.php', - 'Nette\\NotSupportedException' => __DIR__ . '/..' . '/nette/utils/src/exceptions.php', - 'Nette\\OutOfRangeException' => __DIR__ . '/..' . '/nette/utils/src/exceptions.php', - 'Nette\\PhpGenerator\\Attribute' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/Attribute.php', - 'Nette\\PhpGenerator\\ClassType' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/ClassType.php', - 'Nette\\PhpGenerator\\Closure' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/Closure.php', - 'Nette\\PhpGenerator\\Constant' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/Constant.php', - 'Nette\\PhpGenerator\\Dumper' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/Dumper.php', - 'Nette\\PhpGenerator\\EnumCase' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/EnumCase.php', - 'Nette\\PhpGenerator\\Extractor' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/Extractor.php', - 'Nette\\PhpGenerator\\Factory' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/Factory.php', - 'Nette\\PhpGenerator\\GlobalFunction' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/GlobalFunction.php', - 'Nette\\PhpGenerator\\Helpers' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/Helpers.php', - 'Nette\\PhpGenerator\\Literal' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/Literal.php', - 'Nette\\PhpGenerator\\Method' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/Method.php', - 'Nette\\PhpGenerator\\Parameter' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/Parameter.php', - 'Nette\\PhpGenerator\\PhpFile' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/PhpFile.php', - 'Nette\\PhpGenerator\\PhpLiteral' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/PhpLiteral.php', - 'Nette\\PhpGenerator\\PhpNamespace' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/PhpNamespace.php', - 'Nette\\PhpGenerator\\Printer' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/Printer.php', - 'Nette\\PhpGenerator\\PromotedParameter' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/PromotedParameter.php', - 'Nette\\PhpGenerator\\Property' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/Property.php', - 'Nette\\PhpGenerator\\PsrPrinter' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/PsrPrinter.php', - 'Nette\\PhpGenerator\\TraitUse' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/TraitUse.php', - 'Nette\\PhpGenerator\\Traits\\AttributeAware' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/Traits/AttributeAware.php', - 'Nette\\PhpGenerator\\Traits\\CommentAware' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/Traits/CommentAware.php', - 'Nette\\PhpGenerator\\Traits\\FunctionLike' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/Traits/FunctionLike.php', - 'Nette\\PhpGenerator\\Traits\\NameAware' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/Traits/NameAware.php', - 'Nette\\PhpGenerator\\Traits\\VisibilityAware' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/Traits/VisibilityAware.php', - 'Nette\\PhpGenerator\\Type' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/Type.php', - 'Nette\\Schema\\Context' => __DIR__ . '/..' . '/nette/schema/src/Schema/Context.php', - 'Nette\\Schema\\DynamicParameter' => __DIR__ . '/..' . '/nette/schema/src/Schema/DynamicParameter.php', - 'Nette\\Schema\\Elements\\AnyOf' => __DIR__ . '/..' . '/nette/schema/src/Schema/Elements/AnyOf.php', - 'Nette\\Schema\\Elements\\Base' => __DIR__ . '/..' . '/nette/schema/src/Schema/Elements/Base.php', - 'Nette\\Schema\\Elements\\Structure' => __DIR__ . '/..' . '/nette/schema/src/Schema/Elements/Structure.php', - 'Nette\\Schema\\Elements\\Type' => __DIR__ . '/..' . '/nette/schema/src/Schema/Elements/Type.php', - 'Nette\\Schema\\Expect' => __DIR__ . '/..' . '/nette/schema/src/Schema/Expect.php', - 'Nette\\Schema\\Helpers' => __DIR__ . '/..' . '/nette/schema/src/Schema/Helpers.php', - 'Nette\\Schema\\Message' => __DIR__ . '/..' . '/nette/schema/src/Schema/Message.php', - 'Nette\\Schema\\Processor' => __DIR__ . '/..' . '/nette/schema/src/Schema/Processor.php', - 'Nette\\Schema\\Schema' => __DIR__ . '/..' . '/nette/schema/src/Schema/Schema.php', - 'Nette\\Schema\\ValidationException' => __DIR__ . '/..' . '/nette/schema/src/Schema/ValidationException.php', - 'Nette\\SmartObject' => __DIR__ . '/..' . '/nette/utils/src/SmartObject.php', - 'Nette\\StaticClass' => __DIR__ . '/..' . '/nette/utils/src/StaticClass.php', - 'Nette\\UnexpectedValueException' => __DIR__ . '/..' . '/nette/utils/src/exceptions.php', - 'Nette\\Utils\\ArrayHash' => __DIR__ . '/..' . '/nette/utils/src/Utils/ArrayHash.php', - 'Nette\\Utils\\ArrayList' => __DIR__ . '/..' . '/nette/utils/src/Utils/ArrayList.php', - 'Nette\\Utils\\Arrays' => __DIR__ . '/..' . '/nette/utils/src/Utils/Arrays.php', - 'Nette\\Utils\\AssertionException' => __DIR__ . '/..' . '/nette/utils/src/Utils/exceptions.php', - 'Nette\\Utils\\Callback' => __DIR__ . '/..' . '/nette/utils/src/Utils/Callback.php', - 'Nette\\Utils\\DateTime' => __DIR__ . '/..' . '/nette/utils/src/Utils/DateTime.php', - 'Nette\\Utils\\FileSystem' => __DIR__ . '/..' . '/nette/utils/src/Utils/FileSystem.php', - 'Nette\\Utils\\Finder' => __DIR__ . '/..' . '/nette/finder/src/Utils/Finder.php', - 'Nette\\Utils\\Floats' => __DIR__ . '/..' . '/nette/utils/src/Utils/Floats.php', - 'Nette\\Utils\\Helpers' => __DIR__ . '/..' . '/nette/utils/src/Utils/Helpers.php', - 'Nette\\Utils\\Html' => __DIR__ . '/..' . '/nette/utils/src/Utils/Html.php', - 'Nette\\Utils\\IHtmlString' => __DIR__ . '/..' . '/nette/utils/src/compatibility.php', - 'Nette\\Utils\\Image' => __DIR__ . '/..' . '/nette/utils/src/Utils/Image.php', - 'Nette\\Utils\\ImageException' => __DIR__ . '/..' . '/nette/utils/src/Utils/exceptions.php', - 'Nette\\Utils\\Json' => __DIR__ . '/..' . '/nette/utils/src/Utils/Json.php', - 'Nette\\Utils\\JsonException' => __DIR__ . '/..' . '/nette/utils/src/Utils/exceptions.php', - 'Nette\\Utils\\ObjectHelpers' => __DIR__ . '/..' . '/nette/utils/src/Utils/ObjectHelpers.php', - 'Nette\\Utils\\ObjectMixin' => __DIR__ . '/..' . '/nette/utils/src/Utils/ObjectMixin.php', - 'Nette\\Utils\\Paginator' => __DIR__ . '/..' . '/nette/utils/src/Utils/Paginator.php', - 'Nette\\Utils\\Random' => __DIR__ . '/..' . '/nette/utils/src/Utils/Random.php', - 'Nette\\Utils\\Reflection' => __DIR__ . '/..' . '/nette/utils/src/Utils/Reflection.php', - 'Nette\\Utils\\RegexpException' => __DIR__ . '/..' . '/nette/utils/src/Utils/exceptions.php', - 'Nette\\Utils\\Strings' => __DIR__ . '/..' . '/nette/utils/src/Utils/Strings.php', - 'Nette\\Utils\\Type' => __DIR__ . '/..' . '/nette/utils/src/Utils/Type.php', - 'Nette\\Utils\\UnknownImageFileException' => __DIR__ . '/..' . '/nette/utils/src/Utils/exceptions.php', - 'Nette\\Utils\\Validators' => __DIR__ . '/..' . '/nette/utils/src/Utils/Validators.php', - 'PHPUnit\\Exception' => __DIR__ . '/..' . '/phpunit/phpunit/src/Exception.php', - 'PHPUnit\\Framework\\Assert' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Assert.php', - 'PHPUnit\\Framework\\AssertionFailedError' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/AssertionFailedError.php', - 'PHPUnit\\Framework\\CodeCoverageException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/CodeCoverageException.php', - 'PHPUnit\\Framework\\Constraint\\ArrayHasKey' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/ArrayHasKey.php', - 'PHPUnit\\Framework\\Constraint\\ArraySubset' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/ArraySubset.php', - 'PHPUnit\\Framework\\Constraint\\Attribute' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Attribute.php', - 'PHPUnit\\Framework\\Constraint\\Callback' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Callback.php', - 'PHPUnit\\Framework\\Constraint\\ClassHasAttribute' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/ClassHasAttribute.php', - 'PHPUnit\\Framework\\Constraint\\ClassHasStaticAttribute' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/ClassHasStaticAttribute.php', - 'PHPUnit\\Framework\\Constraint\\Composite' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Composite.php', - 'PHPUnit\\Framework\\Constraint\\Constraint' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Constraint.php', - 'PHPUnit\\Framework\\Constraint\\Count' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Count.php', - 'PHPUnit\\Framework\\Constraint\\DirectoryExists' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/DirectoryExists.php', - 'PHPUnit\\Framework\\Constraint\\Exception' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Exception.php', - 'PHPUnit\\Framework\\Constraint\\ExceptionCode' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/ExceptionCode.php', - 'PHPUnit\\Framework\\Constraint\\ExceptionMessage' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/ExceptionMessage.php', - 'PHPUnit\\Framework\\Constraint\\ExceptionMessageRegularExpression' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/ExceptionMessageRegularExpression.php', - 'PHPUnit\\Framework\\Constraint\\FileExists' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/FileExists.php', - 'PHPUnit\\Framework\\Constraint\\GreaterThan' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/GreaterThan.php', - 'PHPUnit\\Framework\\Constraint\\IsAnything' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/IsAnything.php', - 'PHPUnit\\Framework\\Constraint\\IsEmpty' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/IsEmpty.php', - 'PHPUnit\\Framework\\Constraint\\IsEqual' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/IsEqual.php', - 'PHPUnit\\Framework\\Constraint\\IsFalse' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/IsFalse.php', - 'PHPUnit\\Framework\\Constraint\\IsFinite' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/IsFinite.php', - 'PHPUnit\\Framework\\Constraint\\IsIdentical' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/IsIdentical.php', - 'PHPUnit\\Framework\\Constraint\\IsInfinite' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/IsInfinite.php', - 'PHPUnit\\Framework\\Constraint\\IsInstanceOf' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/IsInstanceOf.php', - 'PHPUnit\\Framework\\Constraint\\IsJson' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/IsJson.php', - 'PHPUnit\\Framework\\Constraint\\IsNan' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/IsNan.php', - 'PHPUnit\\Framework\\Constraint\\IsNull' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/IsNull.php', - 'PHPUnit\\Framework\\Constraint\\IsReadable' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/IsReadable.php', - 'PHPUnit\\Framework\\Constraint\\IsTrue' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/IsTrue.php', - 'PHPUnit\\Framework\\Constraint\\IsType' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/IsType.php', - 'PHPUnit\\Framework\\Constraint\\IsWritable' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/IsWritable.php', - 'PHPUnit\\Framework\\Constraint\\JsonMatches' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/JsonMatches.php', - 'PHPUnit\\Framework\\Constraint\\JsonMatchesErrorMessageProvider' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/JsonMatchesErrorMessageProvider.php', - 'PHPUnit\\Framework\\Constraint\\LessThan' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/LessThan.php', - 'PHPUnit\\Framework\\Constraint\\LogicalAnd' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/LogicalAnd.php', - 'PHPUnit\\Framework\\Constraint\\LogicalNot' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/LogicalNot.php', - 'PHPUnit\\Framework\\Constraint\\LogicalOr' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/LogicalOr.php', - 'PHPUnit\\Framework\\Constraint\\LogicalXor' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/LogicalXor.php', - 'PHPUnit\\Framework\\Constraint\\ObjectHasAttribute' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/ObjectHasAttribute.php', - 'PHPUnit\\Framework\\Constraint\\RegularExpression' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/RegularExpression.php', - 'PHPUnit\\Framework\\Constraint\\SameSize' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/SameSize.php', - 'PHPUnit\\Framework\\Constraint\\StringContains' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/StringContains.php', - 'PHPUnit\\Framework\\Constraint\\StringEndsWith' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/StringEndsWith.php', - 'PHPUnit\\Framework\\Constraint\\StringMatchesFormatDescription' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/StringMatchesFormatDescription.php', - 'PHPUnit\\Framework\\Constraint\\StringStartsWith' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/StringStartsWith.php', - 'PHPUnit\\Framework\\Constraint\\TraversableContains' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/TraversableContains.php', - 'PHPUnit\\Framework\\Constraint\\TraversableContainsEqual' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/TraversableContainsEqual.php', - 'PHPUnit\\Framework\\Constraint\\TraversableContainsIdentical' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/TraversableContainsIdentical.php', - 'PHPUnit\\Framework\\Constraint\\TraversableContainsOnly' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/TraversableContainsOnly.php', - 'PHPUnit\\Framework\\CoveredCodeNotExecutedException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/CoveredCodeNotExecutedException.php', - 'PHPUnit\\Framework\\DataProviderTestSuite' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/DataProviderTestSuite.php', - 'PHPUnit\\Framework\\Error\\Deprecated' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Error/Deprecated.php', - 'PHPUnit\\Framework\\Error\\Error' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Error/Error.php', - 'PHPUnit\\Framework\\Error\\Notice' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Error/Notice.php', - 'PHPUnit\\Framework\\Error\\Warning' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Error/Warning.php', - 'PHPUnit\\Framework\\Exception' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/Exception.php', - 'PHPUnit\\Framework\\ExceptionWrapper' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/ExceptionWrapper.php', - 'PHPUnit\\Framework\\ExpectationFailedException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/ExpectationFailedException.php', - 'PHPUnit\\Framework\\IncompleteTest' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/IncompleteTest.php', - 'PHPUnit\\Framework\\IncompleteTestCase' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/IncompleteTestCase.php', - 'PHPUnit\\Framework\\IncompleteTestError' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/IncompleteTestError.php', - 'PHPUnit\\Framework\\InvalidArgumentException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/InvalidArgumentException.php', - 'PHPUnit\\Framework\\InvalidCoversTargetException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/InvalidCoversTargetException.php', - 'PHPUnit\\Framework\\InvalidDataProviderException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/InvalidDataProviderException.php', - 'PHPUnit\\Framework\\InvalidParameterGroupException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/InvalidParameterGroupException.php', - 'PHPUnit\\Framework\\MissingCoversAnnotationException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/MissingCoversAnnotationException.php', - 'PHPUnit\\Framework\\MockObject\\Api' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Api/Api.php', - 'PHPUnit\\Framework\\MockObject\\BadMethodCallException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/BadMethodCallException.php', - 'PHPUnit\\Framework\\MockObject\\Builder\\Identity' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Builder/Identity.php', - 'PHPUnit\\Framework\\MockObject\\Builder\\InvocationMocker' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationMocker.php', - 'PHPUnit\\Framework\\MockObject\\Builder\\InvocationStubber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationStubber.php', - 'PHPUnit\\Framework\\MockObject\\Builder\\Match_' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Builder/Match_.php', - 'PHPUnit\\Framework\\MockObject\\Builder\\MethodNameMatch' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Builder/MethodNameMatch.php', - 'PHPUnit\\Framework\\MockObject\\Builder\\ParametersMatch' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Builder/ParametersMatch.php', - 'PHPUnit\\Framework\\MockObject\\Builder\\Stub' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Builder/Stub.php', - 'PHPUnit\\Framework\\MockObject\\ConfigurableMethod' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/ConfigurableMethod.php', - 'PHPUnit\\Framework\\MockObject\\ConfigurableMethodsAlreadyInitializedException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/ConfigurableMethodsAlreadyInitializedException.php', - 'PHPUnit\\Framework\\MockObject\\Exception' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/Exception.php', - 'PHPUnit\\Framework\\MockObject\\Generator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Generator.php', - 'PHPUnit\\Framework\\MockObject\\IncompatibleReturnValueException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/IncompatibleReturnValueException.php', - 'PHPUnit\\Framework\\MockObject\\Invocation' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Invocation.php', - 'PHPUnit\\Framework\\MockObject\\InvocationHandler' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/InvocationHandler.php', - 'PHPUnit\\Framework\\MockObject\\Matcher' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Matcher.php', - 'PHPUnit\\Framework\\MockObject\\Method' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Api/Method.php', - 'PHPUnit\\Framework\\MockObject\\MethodNameConstraint' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/MethodNameConstraint.php', - 'PHPUnit\\Framework\\MockObject\\MockBuilder' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/MockBuilder.php', - 'PHPUnit\\Framework\\MockObject\\MockClass' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/MockClass.php', - 'PHPUnit\\Framework\\MockObject\\MockMethod' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/MockMethod.php', - 'PHPUnit\\Framework\\MockObject\\MockMethodSet' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/MockMethodSet.php', - 'PHPUnit\\Framework\\MockObject\\MockObject' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/MockObject.php', - 'PHPUnit\\Framework\\MockObject\\MockTrait' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/MockTrait.php', - 'PHPUnit\\Framework\\MockObject\\MockType' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/MockType.php', - 'PHPUnit\\Framework\\MockObject\\MockedCloneMethod' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Api/MockedCloneMethod.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\AnyInvokedCount' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Rule/AnyInvokedCount.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\AnyParameters' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Rule/AnyParameters.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\ConsecutiveParameters' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Rule/ConsecutiveParameters.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\InvocationOrder' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Rule/InvocationOrder.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\InvokedAtIndex' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtIndex.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\InvokedAtLeastCount' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastCount.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\InvokedAtLeastOnce' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastOnce.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\InvokedAtMostCount' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtMostCount.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\InvokedCount' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedCount.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\MethodName' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Rule/MethodName.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\Parameters' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Rule/Parameters.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\ParametersRule' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Rule/ParametersRule.php', - 'PHPUnit\\Framework\\MockObject\\RuntimeException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/RuntimeException.php', - 'PHPUnit\\Framework\\MockObject\\Stub' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Stub.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\ConsecutiveCalls' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Stub/ConsecutiveCalls.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\Exception' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Stub/Exception.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnArgument' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnArgument.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnCallback' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnCallback.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnReference' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnReference.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnSelf' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnSelf.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnStub' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnStub.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnValueMap' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnValueMap.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\Stub' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Stub/Stub.php', - 'PHPUnit\\Framework\\MockObject\\UnmockedCloneMethod' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Api/UnmockedCloneMethod.php', - 'PHPUnit\\Framework\\MockObject\\Verifiable' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Verifiable.php', - 'PHPUnit\\Framework\\NoChildTestSuiteException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/NoChildTestSuiteException.php', - 'PHPUnit\\Framework\\OutputError' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/OutputError.php', - 'PHPUnit\\Framework\\PHPTAssertionFailedError' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/PHPTAssertionFailedError.php', - 'PHPUnit\\Framework\\RiskyTestError' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/RiskyTestError.php', - 'PHPUnit\\Framework\\SelfDescribing' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/SelfDescribing.php', - 'PHPUnit\\Framework\\SkippedTest' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/SkippedTest.php', - 'PHPUnit\\Framework\\SkippedTestCase' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/SkippedTestCase.php', - 'PHPUnit\\Framework\\SkippedTestError' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/SkippedTestError.php', - 'PHPUnit\\Framework\\SkippedTestSuiteError' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/SkippedTestSuiteError.php', - 'PHPUnit\\Framework\\SyntheticError' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/SyntheticError.php', - 'PHPUnit\\Framework\\SyntheticSkippedError' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/SyntheticSkippedError.php', - 'PHPUnit\\Framework\\Test' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Test.php', - 'PHPUnit\\Framework\\TestBuilder' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/TestBuilder.php', - 'PHPUnit\\Framework\\TestCase' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/TestCase.php', - 'PHPUnit\\Framework\\TestFailure' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/TestFailure.php', - 'PHPUnit\\Framework\\TestListener' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/TestListener.php', - 'PHPUnit\\Framework\\TestListenerDefaultImplementation' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/TestListenerDefaultImplementation.php', - 'PHPUnit\\Framework\\TestResult' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/TestResult.php', - 'PHPUnit\\Framework\\TestSuite' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/TestSuite.php', - 'PHPUnit\\Framework\\TestSuiteIterator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/TestSuiteIterator.php', - 'PHPUnit\\Framework\\UnintentionallyCoveredCodeError' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/UnintentionallyCoveredCodeError.php', - 'PHPUnit\\Framework\\Warning' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/Warning.php', - 'PHPUnit\\Framework\\WarningTestCase' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/WarningTestCase.php', - 'PHPUnit\\Runner\\AfterIncompleteTestHook' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Hook/AfterIncompleteTestHook.php', - 'PHPUnit\\Runner\\AfterLastTestHook' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Hook/AfterLastTestHook.php', - 'PHPUnit\\Runner\\AfterRiskyTestHook' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Hook/AfterRiskyTestHook.php', - 'PHPUnit\\Runner\\AfterSkippedTestHook' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Hook/AfterSkippedTestHook.php', - 'PHPUnit\\Runner\\AfterSuccessfulTestHook' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Hook/AfterSuccessfulTestHook.php', - 'PHPUnit\\Runner\\AfterTestErrorHook' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Hook/AfterTestErrorHook.php', - 'PHPUnit\\Runner\\AfterTestFailureHook' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Hook/AfterTestFailureHook.php', - 'PHPUnit\\Runner\\AfterTestHook' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Hook/AfterTestHook.php', - 'PHPUnit\\Runner\\AfterTestWarningHook' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Hook/AfterTestWarningHook.php', - 'PHPUnit\\Runner\\BaseTestRunner' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/BaseTestRunner.php', - 'PHPUnit\\Runner\\BeforeFirstTestHook' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Hook/BeforeFirstTestHook.php', - 'PHPUnit\\Runner\\BeforeTestHook' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Hook/BeforeTestHook.php', - 'PHPUnit\\Runner\\DefaultTestResultCache' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/DefaultTestResultCache.php', - 'PHPUnit\\Runner\\Exception' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Exception.php', - 'PHPUnit\\Runner\\Filter\\ExcludeGroupFilterIterator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Filter/ExcludeGroupFilterIterator.php', - 'PHPUnit\\Runner\\Filter\\Factory' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Filter/Factory.php', - 'PHPUnit\\Runner\\Filter\\GroupFilterIterator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Filter/GroupFilterIterator.php', - 'PHPUnit\\Runner\\Filter\\IncludeGroupFilterIterator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Filter/IncludeGroupFilterIterator.php', - 'PHPUnit\\Runner\\Filter\\NameFilterIterator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Filter/NameFilterIterator.php', - 'PHPUnit\\Runner\\Hook' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Hook/Hook.php', - 'PHPUnit\\Runner\\NullTestResultCache' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/NullTestResultCache.php', - 'PHPUnit\\Runner\\PhptTestCase' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/PhptTestCase.php', - 'PHPUnit\\Runner\\ResultCacheExtension' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/ResultCacheExtension.php', - 'PHPUnit\\Runner\\StandardTestSuiteLoader' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/StandardTestSuiteLoader.php', - 'PHPUnit\\Runner\\TestHook' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Hook/TestHook.php', - 'PHPUnit\\Runner\\TestListenerAdapter' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Hook/TestListenerAdapter.php', - 'PHPUnit\\Runner\\TestResultCache' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/TestResultCache.php', - 'PHPUnit\\Runner\\TestSuiteLoader' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/TestSuiteLoader.php', - 'PHPUnit\\Runner\\TestSuiteSorter' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/TestSuiteSorter.php', - 'PHPUnit\\Runner\\Version' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Version.php', - 'PHPUnit\\TextUI\\Command' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Command.php', - 'PHPUnit\\TextUI\\Exception' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Exception.php', - 'PHPUnit\\TextUI\\Help' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Help.php', - 'PHPUnit\\TextUI\\ResultPrinter' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/ResultPrinter.php', - 'PHPUnit\\TextUI\\TestRunner' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/TestRunner.php', - 'PHPUnit\\Util\\Annotation\\DocBlock' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Annotation/DocBlock.php', - 'PHPUnit\\Util\\Annotation\\Registry' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Annotation/Registry.php', - 'PHPUnit\\Util\\Blacklist' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Blacklist.php', - 'PHPUnit\\Util\\Color' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Color.php', - 'PHPUnit\\Util\\Configuration' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Configuration.php', - 'PHPUnit\\Util\\ConfigurationGenerator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/ConfigurationGenerator.php', - 'PHPUnit\\Util\\ErrorHandler' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/ErrorHandler.php', - 'PHPUnit\\Util\\Exception' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Exception.php', - 'PHPUnit\\Util\\FileLoader' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/FileLoader.php', - 'PHPUnit\\Util\\Filesystem' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Filesystem.php', - 'PHPUnit\\Util\\Filter' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Filter.php', - 'PHPUnit\\Util\\Getopt' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Getopt.php', - 'PHPUnit\\Util\\GlobalState' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/GlobalState.php', - 'PHPUnit\\Util\\InvalidDataSetException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/InvalidDataSetException.php', - 'PHPUnit\\Util\\Json' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Json.php', - 'PHPUnit\\Util\\Log\\JUnit' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Log/JUnit.php', - 'PHPUnit\\Util\\Log\\TeamCity' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Log/TeamCity.php', - 'PHPUnit\\Util\\PHP\\AbstractPhpProcess' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/PHP/AbstractPhpProcess.php', - 'PHPUnit\\Util\\PHP\\DefaultPhpProcess' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/PHP/DefaultPhpProcess.php', - 'PHPUnit\\Util\\PHP\\WindowsPhpProcess' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/PHP/WindowsPhpProcess.php', - 'PHPUnit\\Util\\Printer' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Printer.php', - 'PHPUnit\\Util\\RegularExpression' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/RegularExpression.php', - 'PHPUnit\\Util\\Test' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Test.php', - 'PHPUnit\\Util\\TestDox\\CliTestDoxPrinter' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/TestDox/CliTestDoxPrinter.php', - 'PHPUnit\\Util\\TestDox\\HtmlResultPrinter' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/TestDox/HtmlResultPrinter.php', - 'PHPUnit\\Util\\TestDox\\NamePrettifier' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/TestDox/NamePrettifier.php', - 'PHPUnit\\Util\\TestDox\\ResultPrinter' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/TestDox/ResultPrinter.php', - 'PHPUnit\\Util\\TestDox\\TestDoxPrinter' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/TestDox/TestDoxPrinter.php', - 'PHPUnit\\Util\\TestDox\\TextResultPrinter' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/TestDox/TextResultPrinter.php', - 'PHPUnit\\Util\\TestDox\\XmlResultPrinter' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/TestDox/XmlResultPrinter.php', - 'PHPUnit\\Util\\TextTestListRenderer' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/TextTestListRenderer.php', - 'PHPUnit\\Util\\Type' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Type.php', - 'PHPUnit\\Util\\VersionComparisonOperator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/VersionComparisonOperator.php', - 'PHPUnit\\Util\\XdebugFilterScriptGenerator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/XdebugFilterScriptGenerator.php', - 'PHPUnit\\Util\\Xml' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Xml.php', - 'PHPUnit\\Util\\XmlTestListRenderer' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/XmlTestListRenderer.php', - 'PHP_Token' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', - 'PHP_TokenWithScope' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/TokenWithScope.php', - 'PHP_TokenWithScopeAndVisibility' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/TokenWithScopeAndVisibility.php', - 'PHP_Token_ABSTRACT' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Abstract.php', - 'PHP_Token_AMPERSAND' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Ampersand.php', - 'PHP_Token_AND_EQUAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/AndEqual.php', - 'PHP_Token_ARRAY' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Array.php', - 'PHP_Token_ARRAY_CAST' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/ArrayCast.php', - 'PHP_Token_AS' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/As.php', - 'PHP_Token_AT' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/At.php', - 'PHP_Token_BACKTICK' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Backtick.php', - 'PHP_Token_BAD_CHARACTER' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/BadCharacter.php', - 'PHP_Token_BOOLEAN_AND' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/BooleanAnd.php', - 'PHP_Token_BOOLEAN_OR' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/BooleanOr.php', - 'PHP_Token_BOOL_CAST' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/BoolCast.php', - 'PHP_Token_BREAK' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/break.php', - 'PHP_Token_CALLABLE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Callable.php', - 'PHP_Token_CARET' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Caret.php', - 'PHP_Token_CASE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Case.php', - 'PHP_Token_CATCH' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Catch.php', - 'PHP_Token_CHARACTER' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Character.php', - 'PHP_Token_CLASS' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Class.php', - 'PHP_Token_CLASS_C' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/ClassC.php', - 'PHP_Token_CLASS_NAME_CONSTANT' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/ClassNameConstant.php', - 'PHP_Token_CLONE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Clone.php', - 'PHP_Token_CLOSE_BRACKET' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/CloseBracket.php', - 'PHP_Token_CLOSE_CURLY' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/CloseCurly.php', - 'PHP_Token_CLOSE_SQUARE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/CloseSquare.php', - 'PHP_Token_CLOSE_TAG' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/CloseTag.php', - 'PHP_Token_COALESCE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Coalesce.php', - 'PHP_Token_COALESCE_EQUAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/CoalesceEqual.php', - 'PHP_Token_COLON' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Colon.php', - 'PHP_Token_COMMA' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Comma.php', - 'PHP_Token_COMMENT' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Comment.php', - 'PHP_Token_CONCAT_EQUAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/ConcatEqual.php', - 'PHP_Token_CONST' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Const.php', - 'PHP_Token_CONSTANT_ENCAPSED_STRING' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/ConstantEncapsedString.php', - 'PHP_Token_CONTINUE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Continue.php', - 'PHP_Token_CURLY_OPEN' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/CurlyOpen.php', - 'PHP_Token_DEC' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Dec.php', - 'PHP_Token_DECLARE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Declare.php', - 'PHP_Token_DEFAULT' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Default.php', - 'PHP_Token_DIR' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Dir.php', - 'PHP_Token_DIV' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Div.php', - 'PHP_Token_DIV_EQUAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/DivEqual.php', - 'PHP_Token_DNUMBER' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/DNumber.php', - 'PHP_Token_DO' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Do.php', - 'PHP_Token_DOC_COMMENT' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/DocComment.php', - 'PHP_Token_DOLLAR' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Dollar.php', - 'PHP_Token_DOLLAR_OPEN_CURLY_BRACES' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/DollarOpenCurlyBraces.php', - 'PHP_Token_DOT' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Dot.php', - 'PHP_Token_DOUBLE_ARROW' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/DoubleArrow.php', - 'PHP_Token_DOUBLE_CAST' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/DoubleCast.php', - 'PHP_Token_DOUBLE_COLON' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/DoubleColon.php', - 'PHP_Token_DOUBLE_QUOTES' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/DoubleQuotes.php', - 'PHP_Token_ECHO' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Echo.php', - 'PHP_Token_ELLIPSIS' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Ellipsis.php', - 'PHP_Token_ELSE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Else.php', - 'PHP_Token_ELSEIF' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Elseif.php', - 'PHP_Token_EMPTY' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Empty.php', - 'PHP_Token_ENCAPSED_AND_WHITESPACE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/EncapsedAndWhitespace.php', - 'PHP_Token_ENDDECLARE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Enddeclare.php', - 'PHP_Token_ENDFOR' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Endfor.php', - 'PHP_Token_ENDFOREACH' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Endforeach.php', - 'PHP_Token_ENDIF' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Endif.php', - 'PHP_Token_ENDSWITCH' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Endswitch.php', - 'PHP_Token_ENDWHILE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Endwhile.php', - 'PHP_Token_END_HEREDOC' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/EndHeredoc.php', - 'PHP_Token_EQUAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Equal.php', - 'PHP_Token_EVAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Eval.php', - 'PHP_Token_EXCLAMATION_MARK' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/ExclamationMark.php', - 'PHP_Token_EXIT' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Exit.php', - 'PHP_Token_EXTENDS' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Extends.php', - 'PHP_Token_FILE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/File.php', - 'PHP_Token_FINAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Final.php', - 'PHP_Token_FINALLY' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Finally.php', - 'PHP_Token_FN' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Fn.php', - 'PHP_Token_FOR' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/For.php', - 'PHP_Token_FOREACH' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Foreach.php', - 'PHP_Token_FUNCTION' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Function.php', - 'PHP_Token_FUNC_C' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/FuncC.php', - 'PHP_Token_GLOBAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Global.php', - 'PHP_Token_GOTO' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Goto.php', - 'PHP_Token_GT' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Gt.php', - 'PHP_Token_HALT_COMPILER' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/HaltCompiler.php', - 'PHP_Token_IF' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/If.php', - 'PHP_Token_IMPLEMENTS' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Implements.php', - 'PHP_Token_INC' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Inc.php', - 'PHP_Token_INCLUDE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Include.php', - 'PHP_Token_INCLUDE_ONCE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/IncludeOnce.php', - 'PHP_Token_INLINE_HTML' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/InlineHtml.php', - 'PHP_Token_INSTANCEOF' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Instanceof.php', - 'PHP_Token_INSTEADOF' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Insteadof.php', - 'PHP_Token_INTERFACE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Interface.php', - 'PHP_Token_INT_CAST' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/IntCast.php', - 'PHP_Token_ISSET' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Isset.php', - 'PHP_Token_IS_EQUAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/IsEqual.php', - 'PHP_Token_IS_GREATER_OR_EQUAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/IsGreaterOrEqual.php', - 'PHP_Token_IS_IDENTICAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/IsIdentical.php', - 'PHP_Token_IS_NOT_EQUAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/IsNotEqual.php', - 'PHP_Token_IS_NOT_IDENTICAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/IsNotIdentical.php', - 'PHP_Token_IS_SMALLER_OR_EQUAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/IsSmallerOrEqual.php', - 'PHP_Token_Includes' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Includes.php', - 'PHP_Token_LINE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Line.php', - 'PHP_Token_LIST' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/List.php', - 'PHP_Token_LNUMBER' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Lnumber.php', - 'PHP_Token_LOGICAL_AND' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/LogicalAnd.php', - 'PHP_Token_LOGICAL_OR' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/LogicalOr.php', - 'PHP_Token_LOGICAL_XOR' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/LogicalXor.php', - 'PHP_Token_LT' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Lt.php', - 'PHP_Token_METHOD_C' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/MethodC.php', - 'PHP_Token_MINUS' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Minus.php', - 'PHP_Token_MINUS_EQUAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/MinusEqual.php', - 'PHP_Token_MOD_EQUAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/ModEqual.php', - 'PHP_Token_MULT' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Mult.php', - 'PHP_Token_MUL_EQUAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/MulEqual.php', - 'PHP_Token_NAMESPACE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Namespace.php', - 'PHP_Token_NAME_FULLY_QUALIFIED' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/NameFullyQualified.php', - 'PHP_Token_NAME_QUALIFIED' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/NameQualified.php', - 'PHP_Token_NAME_RELATIVE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/NameRelative.php', - 'PHP_Token_NEW' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/New.php', - 'PHP_Token_NS_C' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/NsC.php', - 'PHP_Token_NS_SEPARATOR' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/NsSeparator.php', - 'PHP_Token_NUM_STRING' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/NumString.php', - 'PHP_Token_OBJECT_CAST' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/ObjectCast.php', - 'PHP_Token_OBJECT_OPERATOR' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/ObjectOperator.php', - 'PHP_Token_OPEN_BRACKET' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/OpenBracket.php', - 'PHP_Token_OPEN_CURLY' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/OpenCurly.php', - 'PHP_Token_OPEN_SQUARE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/OpenSquare.php', - 'PHP_Token_OPEN_TAG' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/OpenTag.php', - 'PHP_Token_OPEN_TAG_WITH_ECHO' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/OpenTagWithEcho.php', - 'PHP_Token_OR_EQUAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/OrEqual.php', - 'PHP_Token_PAAMAYIM_NEKUDOTAYIM' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/PaamayimNekudotayim.php', - 'PHP_Token_PERCENT' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Percent.php', - 'PHP_Token_PIPE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Pipe.php', - 'PHP_Token_PLUS' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Plus.php', - 'PHP_Token_PLUS_EQUAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/PlusEqual.php', - 'PHP_Token_POW' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Pow.php', - 'PHP_Token_POW_EQUAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/PowEqual.php', - 'PHP_Token_PRINT' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Print.php', - 'PHP_Token_PRIVATE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Private.php', - 'PHP_Token_PROTECTED' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Protected.php', - 'PHP_Token_PUBLIC' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Public.php', - 'PHP_Token_QUESTION_MARK' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/QuestionMark.php', - 'PHP_Token_REQUIRE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Require.php', - 'PHP_Token_REQUIRE_ONCE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/RequireOnce.php', - 'PHP_Token_RETURN' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Return.php', - 'PHP_Token_SEMICOLON' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Semicolon.php', - 'PHP_Token_SL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Sl.php', - 'PHP_Token_SL_EQUAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/SlEqual.php', - 'PHP_Token_SPACESHIP' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Spaceship.php', - 'PHP_Token_SR' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Sr.php', - 'PHP_Token_SR_EQUAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/SrEqual.php', - 'PHP_Token_START_HEREDOC' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/StartHeredoc.php', - 'PHP_Token_STATIC' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Static.php', - 'PHP_Token_STRING' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/String.php', - 'PHP_Token_STRING_CAST' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/StringCast.php', - 'PHP_Token_STRING_VARNAME' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/StringVarname.php', - 'PHP_Token_SWITCH' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Switch.php', - 'PHP_Token_Stream' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Stream.php', - 'PHP_Token_Stream_CachingFactory' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/CachingFactory.php', - 'PHP_Token_THROW' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Throw.php', - 'PHP_Token_TILDE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Tilde.php', - 'PHP_Token_TRAIT' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Trait.php', - 'PHP_Token_TRAIT_C' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/TraitC.php', - 'PHP_Token_TRY' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Try.php', - 'PHP_Token_UNSET' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Unset.php', - 'PHP_Token_UNSET_CAST' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/UnsetCast.php', - 'PHP_Token_USE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Use.php', - 'PHP_Token_USE_FUNCTION' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/UseFunction.php', - 'PHP_Token_Util' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Util.php', - 'PHP_Token_VAR' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Var.php', - 'PHP_Token_VARIABLE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Variable.php', - 'PHP_Token_WHILE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/While.php', - 'PHP_Token_WHITESPACE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Whitespace.php', - 'PHP_Token_XOR_EQUAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/XorEqual.php', - 'PHP_Token_YIELD' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Yield.php', - 'PHP_Token_YIELD_FROM' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/YieldFrom.php', - 'PharIo\\Manifest\\Application' => __DIR__ . '/..' . '/phar-io/manifest/src/values/Application.php', - 'PharIo\\Manifest\\ApplicationName' => __DIR__ . '/..' . '/phar-io/manifest/src/values/ApplicationName.php', - 'PharIo\\Manifest\\Author' => __DIR__ . '/..' . '/phar-io/manifest/src/values/Author.php', - 'PharIo\\Manifest\\AuthorCollection' => __DIR__ . '/..' . '/phar-io/manifest/src/values/AuthorCollection.php', - 'PharIo\\Manifest\\AuthorCollectionIterator' => __DIR__ . '/..' . '/phar-io/manifest/src/values/AuthorCollectionIterator.php', - 'PharIo\\Manifest\\AuthorElement' => __DIR__ . '/..' . '/phar-io/manifest/src/xml/AuthorElement.php', - 'PharIo\\Manifest\\AuthorElementCollection' => __DIR__ . '/..' . '/phar-io/manifest/src/xml/AuthorElementCollection.php', - 'PharIo\\Manifest\\BundledComponent' => __DIR__ . '/..' . '/phar-io/manifest/src/values/BundledComponent.php', - 'PharIo\\Manifest\\BundledComponentCollection' => __DIR__ . '/..' . '/phar-io/manifest/src/values/BundledComponentCollection.php', - 'PharIo\\Manifest\\BundledComponentCollectionIterator' => __DIR__ . '/..' . '/phar-io/manifest/src/values/BundledComponentCollectionIterator.php', - 'PharIo\\Manifest\\BundlesElement' => __DIR__ . '/..' . '/phar-io/manifest/src/xml/BundlesElement.php', - 'PharIo\\Manifest\\ComponentElement' => __DIR__ . '/..' . '/phar-io/manifest/src/xml/ComponentElement.php', - 'PharIo\\Manifest\\ComponentElementCollection' => __DIR__ . '/..' . '/phar-io/manifest/src/xml/ComponentElementCollection.php', - 'PharIo\\Manifest\\ContainsElement' => __DIR__ . '/..' . '/phar-io/manifest/src/xml/ContainsElement.php', - 'PharIo\\Manifest\\CopyrightElement' => __DIR__ . '/..' . '/phar-io/manifest/src/xml/CopyrightElement.php', - 'PharIo\\Manifest\\CopyrightInformation' => __DIR__ . '/..' . '/phar-io/manifest/src/values/CopyrightInformation.php', - 'PharIo\\Manifest\\ElementCollection' => __DIR__ . '/..' . '/phar-io/manifest/src/xml/ElementCollection.php', - 'PharIo\\Manifest\\ElementCollectionException' => __DIR__ . '/..' . '/phar-io/manifest/src/exceptions/ElementCollectionException.php', - 'PharIo\\Manifest\\Email' => __DIR__ . '/..' . '/phar-io/manifest/src/values/Email.php', - 'PharIo\\Manifest\\Exception' => __DIR__ . '/..' . '/phar-io/manifest/src/exceptions/Exception.php', - 'PharIo\\Manifest\\ExtElement' => __DIR__ . '/..' . '/phar-io/manifest/src/xml/ExtElement.php', - 'PharIo\\Manifest\\ExtElementCollection' => __DIR__ . '/..' . '/phar-io/manifest/src/xml/ExtElementCollection.php', - 'PharIo\\Manifest\\Extension' => __DIR__ . '/..' . '/phar-io/manifest/src/values/Extension.php', - 'PharIo\\Manifest\\ExtensionElement' => __DIR__ . '/..' . '/phar-io/manifest/src/xml/ExtensionElement.php', - 'PharIo\\Manifest\\InvalidApplicationNameException' => __DIR__ . '/..' . '/phar-io/manifest/src/exceptions/InvalidApplicationNameException.php', - 'PharIo\\Manifest\\InvalidEmailException' => __DIR__ . '/..' . '/phar-io/manifest/src/exceptions/InvalidEmailException.php', - 'PharIo\\Manifest\\InvalidUrlException' => __DIR__ . '/..' . '/phar-io/manifest/src/exceptions/InvalidUrlException.php', - 'PharIo\\Manifest\\Library' => __DIR__ . '/..' . '/phar-io/manifest/src/values/Library.php', - 'PharIo\\Manifest\\License' => __DIR__ . '/..' . '/phar-io/manifest/src/values/License.php', - 'PharIo\\Manifest\\LicenseElement' => __DIR__ . '/..' . '/phar-io/manifest/src/xml/LicenseElement.php', - 'PharIo\\Manifest\\Manifest' => __DIR__ . '/..' . '/phar-io/manifest/src/values/Manifest.php', - 'PharIo\\Manifest\\ManifestDocument' => __DIR__ . '/..' . '/phar-io/manifest/src/xml/ManifestDocument.php', - 'PharIo\\Manifest\\ManifestDocumentException' => __DIR__ . '/..' . '/phar-io/manifest/src/exceptions/ManifestDocumentException.php', - 'PharIo\\Manifest\\ManifestDocumentLoadingException' => __DIR__ . '/..' . '/phar-io/manifest/src/exceptions/ManifestDocumentLoadingException.php', - 'PharIo\\Manifest\\ManifestDocumentMapper' => __DIR__ . '/..' . '/phar-io/manifest/src/ManifestDocumentMapper.php', - 'PharIo\\Manifest\\ManifestDocumentMapperException' => __DIR__ . '/..' . '/phar-io/manifest/src/exceptions/ManifestDocumentMapperException.php', - 'PharIo\\Manifest\\ManifestElement' => __DIR__ . '/..' . '/phar-io/manifest/src/xml/ManifestElement.php', - 'PharIo\\Manifest\\ManifestElementException' => __DIR__ . '/..' . '/phar-io/manifest/src/exceptions/ManifestElementException.php', - 'PharIo\\Manifest\\ManifestLoader' => __DIR__ . '/..' . '/phar-io/manifest/src/ManifestLoader.php', - 'PharIo\\Manifest\\ManifestLoaderException' => __DIR__ . '/..' . '/phar-io/manifest/src/exceptions/ManifestLoaderException.php', - 'PharIo\\Manifest\\ManifestSerializer' => __DIR__ . '/..' . '/phar-io/manifest/src/ManifestSerializer.php', - 'PharIo\\Manifest\\PhpElement' => __DIR__ . '/..' . '/phar-io/manifest/src/xml/PhpElement.php', - 'PharIo\\Manifest\\PhpExtensionRequirement' => __DIR__ . '/..' . '/phar-io/manifest/src/values/PhpExtensionRequirement.php', - 'PharIo\\Manifest\\PhpVersionRequirement' => __DIR__ . '/..' . '/phar-io/manifest/src/values/PhpVersionRequirement.php', - 'PharIo\\Manifest\\Requirement' => __DIR__ . '/..' . '/phar-io/manifest/src/values/Requirement.php', - 'PharIo\\Manifest\\RequirementCollection' => __DIR__ . '/..' . '/phar-io/manifest/src/values/RequirementCollection.php', - 'PharIo\\Manifest\\RequirementCollectionIterator' => __DIR__ . '/..' . '/phar-io/manifest/src/values/RequirementCollectionIterator.php', - 'PharIo\\Manifest\\RequiresElement' => __DIR__ . '/..' . '/phar-io/manifest/src/xml/RequiresElement.php', - 'PharIo\\Manifest\\Type' => __DIR__ . '/..' . '/phar-io/manifest/src/values/Type.php', - 'PharIo\\Manifest\\Url' => __DIR__ . '/..' . '/phar-io/manifest/src/values/Url.php', - 'PharIo\\Version\\AbstractVersionConstraint' => __DIR__ . '/..' . '/phar-io/version/src/constraints/AbstractVersionConstraint.php', - 'PharIo\\Version\\AndVersionConstraintGroup' => __DIR__ . '/..' . '/phar-io/version/src/constraints/AndVersionConstraintGroup.php', - 'PharIo\\Version\\AnyVersionConstraint' => __DIR__ . '/..' . '/phar-io/version/src/constraints/AnyVersionConstraint.php', - 'PharIo\\Version\\ExactVersionConstraint' => __DIR__ . '/..' . '/phar-io/version/src/constraints/ExactVersionConstraint.php', - 'PharIo\\Version\\Exception' => __DIR__ . '/..' . '/phar-io/version/src/exceptions/Exception.php', - 'PharIo\\Version\\GreaterThanOrEqualToVersionConstraint' => __DIR__ . '/..' . '/phar-io/version/src/constraints/GreaterThanOrEqualToVersionConstraint.php', - 'PharIo\\Version\\InvalidPreReleaseSuffixException' => __DIR__ . '/..' . '/phar-io/version/src/exceptions/InvalidPreReleaseSuffixException.php', - 'PharIo\\Version\\InvalidVersionException' => __DIR__ . '/..' . '/phar-io/version/src/exceptions/InvalidVersionException.php', - 'PharIo\\Version\\NoPreReleaseSuffixException' => __DIR__ . '/..' . '/phar-io/version/src/exceptions/NoPreReleaseSuffixException.php', - 'PharIo\\Version\\OrVersionConstraintGroup' => __DIR__ . '/..' . '/phar-io/version/src/constraints/OrVersionConstraintGroup.php', - 'PharIo\\Version\\PreReleaseSuffix' => __DIR__ . '/..' . '/phar-io/version/src/PreReleaseSuffix.php', - 'PharIo\\Version\\SpecificMajorAndMinorVersionConstraint' => __DIR__ . '/..' . '/phar-io/version/src/constraints/SpecificMajorAndMinorVersionConstraint.php', - 'PharIo\\Version\\SpecificMajorVersionConstraint' => __DIR__ . '/..' . '/phar-io/version/src/constraints/SpecificMajorVersionConstraint.php', - 'PharIo\\Version\\UnsupportedVersionConstraintException' => __DIR__ . '/..' . '/phar-io/version/src/exceptions/UnsupportedVersionConstraintException.php', - 'PharIo\\Version\\Version' => __DIR__ . '/..' . '/phar-io/version/src/Version.php', - 'PharIo\\Version\\VersionConstraint' => __DIR__ . '/..' . '/phar-io/version/src/constraints/VersionConstraint.php', - 'PharIo\\Version\\VersionConstraintParser' => __DIR__ . '/..' . '/phar-io/version/src/VersionConstraintParser.php', - 'PharIo\\Version\\VersionConstraintValue' => __DIR__ . '/..' . '/phar-io/version/src/VersionConstraintValue.php', - 'PharIo\\Version\\VersionNumber' => __DIR__ . '/..' . '/phar-io/version/src/VersionNumber.php', - 'SebastianBergmann\\CodeCoverage\\CodeCoverage' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/CodeCoverage.php', - 'SebastianBergmann\\CodeCoverage\\CoveredCodeNotExecutedException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/CoveredCodeNotExecutedException.php', - 'SebastianBergmann\\CodeCoverage\\Driver\\Driver' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Driver/Driver.php', - 'SebastianBergmann\\CodeCoverage\\Driver\\PCOV' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Driver/PCOV.php', - 'SebastianBergmann\\CodeCoverage\\Driver\\PHPDBG' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Driver/PHPDBG.php', - 'SebastianBergmann\\CodeCoverage\\Driver\\Xdebug' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Driver/Xdebug.php', - 'SebastianBergmann\\CodeCoverage\\Exception' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/Exception.php', - 'SebastianBergmann\\CodeCoverage\\Filter' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Filter.php', - 'SebastianBergmann\\CodeCoverage\\InvalidArgumentException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/InvalidArgumentException.php', - 'SebastianBergmann\\CodeCoverage\\MissingCoversAnnotationException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/MissingCoversAnnotationException.php', - 'SebastianBergmann\\CodeCoverage\\Node\\AbstractNode' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Node/AbstractNode.php', - 'SebastianBergmann\\CodeCoverage\\Node\\Builder' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Node/Builder.php', - 'SebastianBergmann\\CodeCoverage\\Node\\Directory' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Node/Directory.php', - 'SebastianBergmann\\CodeCoverage\\Node\\File' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Node/File.php', - 'SebastianBergmann\\CodeCoverage\\Node\\Iterator' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Node/Iterator.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Clover' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Clover.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Crap4j' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Crap4j.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Html\\Dashboard' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Html/Renderer/Dashboard.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Html\\Directory' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Html/Renderer/Directory.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Html\\Facade' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Html/Facade.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Html\\File' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Html/Renderer/File.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Html\\Renderer' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Html/Renderer.php', - 'SebastianBergmann\\CodeCoverage\\Report\\PHP' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/PHP.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Text' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Text.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\BuildInformation' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Xml/BuildInformation.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Coverage' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Xml/Coverage.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Directory' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Xml/Directory.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Facade' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Xml/Facade.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\File' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Xml/File.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Method' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Xml/Method.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Node' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Xml/Node.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Project' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Xml/Project.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Report' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Xml/Report.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Source' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Xml/Source.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Tests' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Xml/Tests.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Totals' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Xml/Totals.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Unit' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Xml/Unit.php', - 'SebastianBergmann\\CodeCoverage\\RuntimeException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/RuntimeException.php', - 'SebastianBergmann\\CodeCoverage\\UnintentionallyCoveredCodeException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/UnintentionallyCoveredCodeException.php', - 'SebastianBergmann\\CodeCoverage\\Util' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Util.php', - 'SebastianBergmann\\CodeCoverage\\Version' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Version.php', - 'SebastianBergmann\\CodeUnitReverseLookup\\Wizard' => __DIR__ . '/..' . '/sebastian/code-unit-reverse-lookup/src/Wizard.php', - 'SebastianBergmann\\Comparator\\ArrayComparator' => __DIR__ . '/..' . '/sebastian/comparator/src/ArrayComparator.php', - 'SebastianBergmann\\Comparator\\Comparator' => __DIR__ . '/..' . '/sebastian/comparator/src/Comparator.php', - 'SebastianBergmann\\Comparator\\ComparisonFailure' => __DIR__ . '/..' . '/sebastian/comparator/src/ComparisonFailure.php', - 'SebastianBergmann\\Comparator\\DOMNodeComparator' => __DIR__ . '/..' . '/sebastian/comparator/src/DOMNodeComparator.php', - 'SebastianBergmann\\Comparator\\DateTimeComparator' => __DIR__ . '/..' . '/sebastian/comparator/src/DateTimeComparator.php', - 'SebastianBergmann\\Comparator\\DoubleComparator' => __DIR__ . '/..' . '/sebastian/comparator/src/DoubleComparator.php', - 'SebastianBergmann\\Comparator\\ExceptionComparator' => __DIR__ . '/..' . '/sebastian/comparator/src/ExceptionComparator.php', - 'SebastianBergmann\\Comparator\\Factory' => __DIR__ . '/..' . '/sebastian/comparator/src/Factory.php', - 'SebastianBergmann\\Comparator\\MockObjectComparator' => __DIR__ . '/..' . '/sebastian/comparator/src/MockObjectComparator.php', - 'SebastianBergmann\\Comparator\\NumericComparator' => __DIR__ . '/..' . '/sebastian/comparator/src/NumericComparator.php', - 'SebastianBergmann\\Comparator\\ObjectComparator' => __DIR__ . '/..' . '/sebastian/comparator/src/ObjectComparator.php', - 'SebastianBergmann\\Comparator\\ResourceComparator' => __DIR__ . '/..' . '/sebastian/comparator/src/ResourceComparator.php', - 'SebastianBergmann\\Comparator\\ScalarComparator' => __DIR__ . '/..' . '/sebastian/comparator/src/ScalarComparator.php', - 'SebastianBergmann\\Comparator\\SplObjectStorageComparator' => __DIR__ . '/..' . '/sebastian/comparator/src/SplObjectStorageComparator.php', - 'SebastianBergmann\\Comparator\\TypeComparator' => __DIR__ . '/..' . '/sebastian/comparator/src/TypeComparator.php', - 'SebastianBergmann\\Diff\\Chunk' => __DIR__ . '/..' . '/sebastian/diff/src/Chunk.php', - 'SebastianBergmann\\Diff\\ConfigurationException' => __DIR__ . '/..' . '/sebastian/diff/src/Exception/ConfigurationException.php', - 'SebastianBergmann\\Diff\\Diff' => __DIR__ . '/..' . '/sebastian/diff/src/Diff.php', - 'SebastianBergmann\\Diff\\Differ' => __DIR__ . '/..' . '/sebastian/diff/src/Differ.php', - 'SebastianBergmann\\Diff\\Exception' => __DIR__ . '/..' . '/sebastian/diff/src/Exception/Exception.php', - 'SebastianBergmann\\Diff\\InvalidArgumentException' => __DIR__ . '/..' . '/sebastian/diff/src/Exception/InvalidArgumentException.php', - 'SebastianBergmann\\Diff\\Line' => __DIR__ . '/..' . '/sebastian/diff/src/Line.php', - 'SebastianBergmann\\Diff\\LongestCommonSubsequenceCalculator' => __DIR__ . '/..' . '/sebastian/diff/src/LongestCommonSubsequenceCalculator.php', - 'SebastianBergmann\\Diff\\MemoryEfficientLongestCommonSubsequenceCalculator' => __DIR__ . '/..' . '/sebastian/diff/src/MemoryEfficientLongestCommonSubsequenceCalculator.php', - 'SebastianBergmann\\Diff\\Output\\AbstractChunkOutputBuilder' => __DIR__ . '/..' . '/sebastian/diff/src/Output/AbstractChunkOutputBuilder.php', - 'SebastianBergmann\\Diff\\Output\\DiffOnlyOutputBuilder' => __DIR__ . '/..' . '/sebastian/diff/src/Output/DiffOnlyOutputBuilder.php', - 'SebastianBergmann\\Diff\\Output\\DiffOutputBuilderInterface' => __DIR__ . '/..' . '/sebastian/diff/src/Output/DiffOutputBuilderInterface.php', - 'SebastianBergmann\\Diff\\Output\\StrictUnifiedDiffOutputBuilder' => __DIR__ . '/..' . '/sebastian/diff/src/Output/StrictUnifiedDiffOutputBuilder.php', - 'SebastianBergmann\\Diff\\Output\\UnifiedDiffOutputBuilder' => __DIR__ . '/..' . '/sebastian/diff/src/Output/UnifiedDiffOutputBuilder.php', - 'SebastianBergmann\\Diff\\Parser' => __DIR__ . '/..' . '/sebastian/diff/src/Parser.php', - 'SebastianBergmann\\Diff\\TimeEfficientLongestCommonSubsequenceCalculator' => __DIR__ . '/..' . '/sebastian/diff/src/TimeEfficientLongestCommonSubsequenceCalculator.php', - 'SebastianBergmann\\Environment\\Console' => __DIR__ . '/..' . '/sebastian/environment/src/Console.php', - 'SebastianBergmann\\Environment\\OperatingSystem' => __DIR__ . '/..' . '/sebastian/environment/src/OperatingSystem.php', - 'SebastianBergmann\\Environment\\Runtime' => __DIR__ . '/..' . '/sebastian/environment/src/Runtime.php', - 'SebastianBergmann\\Exporter\\Exporter' => __DIR__ . '/..' . '/sebastian/exporter/src/Exporter.php', - 'SebastianBergmann\\FileIterator\\Facade' => __DIR__ . '/..' . '/phpunit/php-file-iterator/src/Facade.php', - 'SebastianBergmann\\FileIterator\\Factory' => __DIR__ . '/..' . '/phpunit/php-file-iterator/src/Factory.php', - 'SebastianBergmann\\FileIterator\\Iterator' => __DIR__ . '/..' . '/phpunit/php-file-iterator/src/Iterator.php', - 'SebastianBergmann\\GlobalState\\Blacklist' => __DIR__ . '/..' . '/sebastian/global-state/src/Blacklist.php', - 'SebastianBergmann\\GlobalState\\CodeExporter' => __DIR__ . '/..' . '/sebastian/global-state/src/CodeExporter.php', - 'SebastianBergmann\\GlobalState\\Exception' => __DIR__ . '/..' . '/sebastian/global-state/src/exceptions/Exception.php', - 'SebastianBergmann\\GlobalState\\Restorer' => __DIR__ . '/..' . '/sebastian/global-state/src/Restorer.php', - 'SebastianBergmann\\GlobalState\\RuntimeException' => __DIR__ . '/..' . '/sebastian/global-state/src/exceptions/RuntimeException.php', - 'SebastianBergmann\\GlobalState\\Snapshot' => __DIR__ . '/..' . '/sebastian/global-state/src/Snapshot.php', - 'SebastianBergmann\\ObjectEnumerator\\Enumerator' => __DIR__ . '/..' . '/sebastian/object-enumerator/src/Enumerator.php', - 'SebastianBergmann\\ObjectEnumerator\\Exception' => __DIR__ . '/..' . '/sebastian/object-enumerator/src/Exception.php', - 'SebastianBergmann\\ObjectEnumerator\\InvalidArgumentException' => __DIR__ . '/..' . '/sebastian/object-enumerator/src/InvalidArgumentException.php', - 'SebastianBergmann\\ObjectReflector\\Exception' => __DIR__ . '/..' . '/sebastian/object-reflector/src/Exception.php', - 'SebastianBergmann\\ObjectReflector\\InvalidArgumentException' => __DIR__ . '/..' . '/sebastian/object-reflector/src/InvalidArgumentException.php', - 'SebastianBergmann\\ObjectReflector\\ObjectReflector' => __DIR__ . '/..' . '/sebastian/object-reflector/src/ObjectReflector.php', - 'SebastianBergmann\\RecursionContext\\Context' => __DIR__ . '/..' . '/sebastian/recursion-context/src/Context.php', - 'SebastianBergmann\\RecursionContext\\Exception' => __DIR__ . '/..' . '/sebastian/recursion-context/src/Exception.php', - 'SebastianBergmann\\RecursionContext\\InvalidArgumentException' => __DIR__ . '/..' . '/sebastian/recursion-context/src/InvalidArgumentException.php', - 'SebastianBergmann\\ResourceOperations\\ResourceOperations' => __DIR__ . '/..' . '/sebastian/resource-operations/src/ResourceOperations.php', - 'SebastianBergmann\\Timer\\Exception' => __DIR__ . '/..' . '/phpunit/php-timer/src/Exception.php', - 'SebastianBergmann\\Timer\\RuntimeException' => __DIR__ . '/..' . '/phpunit/php-timer/src/RuntimeException.php', - 'SebastianBergmann\\Timer\\Timer' => __DIR__ . '/..' . '/phpunit/php-timer/src/Timer.php', - 'SebastianBergmann\\Type\\CallableType' => __DIR__ . '/..' . '/sebastian/type/src/CallableType.php', - 'SebastianBergmann\\Type\\Exception' => __DIR__ . '/..' . '/sebastian/type/src/exception/Exception.php', - 'SebastianBergmann\\Type\\GenericObjectType' => __DIR__ . '/..' . '/sebastian/type/src/GenericObjectType.php', - 'SebastianBergmann\\Type\\IterableType' => __DIR__ . '/..' . '/sebastian/type/src/IterableType.php', - 'SebastianBergmann\\Type\\NullType' => __DIR__ . '/..' . '/sebastian/type/src/NullType.php', - 'SebastianBergmann\\Type\\ObjectType' => __DIR__ . '/..' . '/sebastian/type/src/ObjectType.php', - 'SebastianBergmann\\Type\\RuntimeException' => __DIR__ . '/..' . '/sebastian/type/src/exception/RuntimeException.php', - 'SebastianBergmann\\Type\\SimpleType' => __DIR__ . '/..' . '/sebastian/type/src/SimpleType.php', - 'SebastianBergmann\\Type\\Type' => __DIR__ . '/..' . '/sebastian/type/src/Type.php', - 'SebastianBergmann\\Type\\TypeName' => __DIR__ . '/..' . '/sebastian/type/src/TypeName.php', - 'SebastianBergmann\\Type\\UnknownType' => __DIR__ . '/..' . '/sebastian/type/src/UnknownType.php', - 'SebastianBergmann\\Type\\VoidType' => __DIR__ . '/..' . '/sebastian/type/src/VoidType.php', - 'SebastianBergmann\\Version' => __DIR__ . '/..' . '/sebastian/version/src/Version.php', - 'Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', - 'Text_Template' => __DIR__ . '/..' . '/phpunit/php-text-template/src/Template.php', - 'TheSeer\\Tokenizer\\Exception' => __DIR__ . '/..' . '/theseer/tokenizer/src/Exception.php', - 'TheSeer\\Tokenizer\\NamespaceUri' => __DIR__ . '/..' . '/theseer/tokenizer/src/NamespaceUri.php', - 'TheSeer\\Tokenizer\\NamespaceUriException' => __DIR__ . '/..' . '/theseer/tokenizer/src/NamespaceUriException.php', - 'TheSeer\\Tokenizer\\Token' => __DIR__ . '/..' . '/theseer/tokenizer/src/Token.php', - 'TheSeer\\Tokenizer\\TokenCollection' => __DIR__ . '/..' . '/theseer/tokenizer/src/TokenCollection.php', - 'TheSeer\\Tokenizer\\TokenCollectionException' => __DIR__ . '/..' . '/theseer/tokenizer/src/TokenCollectionException.php', - 'TheSeer\\Tokenizer\\Tokenizer' => __DIR__ . '/..' . '/theseer/tokenizer/src/Tokenizer.php', - 'TheSeer\\Tokenizer\\XMLSerializer' => __DIR__ . '/..' . '/theseer/tokenizer/src/XMLSerializer.php', - 'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', - 'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', - ); - - public static function getInitializer(ClassLoader $loader) - { - return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInitfc5fc5108939805e5e233eb748dce4ed::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInitfc5fc5108939805e5e233eb748dce4ed::$prefixDirsPsr4; - $loader->prefixesPsr0 = ComposerStaticInitfc5fc5108939805e5e233eb748dce4ed::$prefixesPsr0; - $loader->classMap = ComposerStaticInitfc5fc5108939805e5e233eb748dce4ed::$classMap; - - }, null, ClassLoader::class); - } -} diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json deleted file mode 100644 index 2156068..0000000 --- a/vendor/composer/installed.json +++ /dev/null @@ -1,4768 +0,0 @@ -{ - "packages": [ - { - "name": "composer/package-versions-deprecated", - "version": "1.11.99.4", - "version_normalized": "1.11.99.4", - "source": { - "type": "git", - "url": "https://github.com/composer/package-versions-deprecated.git", - "reference": "b174585d1fe49ceed21928a945138948cb394600" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/b174585d1fe49ceed21928a945138948cb394600", - "reference": "b174585d1fe49ceed21928a945138948cb394600", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.1.0 || ^2.0", - "php": "^7 || ^8" - }, - "replace": { - "ocramius/package-versions": "1.11.99" - }, - "require-dev": { - "composer/composer": "^1.9.3 || ^2.0@dev", - "ext-zip": "^1.13", - "phpunit/phpunit": "^6.5 || ^7" - }, - "time": "2021-09-13T08:41:34+00:00", - "type": "composer-plugin", - "extra": { - "class": "PackageVersions\\Installer", - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "PackageVersions\\": "src/PackageVersions" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be" - } - ], - "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", - "support": { - "issues": "https://github.com/composer/package-versions-deprecated/issues", - "source": "https://github.com/composer/package-versions-deprecated/tree/1.11.99.4" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "install-path": "./package-versions-deprecated" - }, - { - "name": "composer/xdebug-handler", - "version": "1.4.6", - "version_normalized": "1.4.6.0", - "source": { - "type": "git", - "url": "https://github.com/composer/xdebug-handler.git", - "reference": "f27e06cd9675801df441b3656569b328e04aa37c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/f27e06cd9675801df441b3656569b328e04aa37c", - "reference": "f27e06cd9675801df441b3656569b328e04aa37c", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0 || ^8.0", - "psr/log": "^1.0" - }, - "require-dev": { - "phpstan/phpstan": "^0.12.55", - "symfony/phpunit-bridge": "^4.2 || ^5" - }, - "time": "2021-03-25T17:01:18+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Composer\\XdebugHandler\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "John Stevenson", - "email": "john-stevenson@blueyonder.co.uk" - } - ], - "description": "Restarts a process without Xdebug.", - "keywords": [ - "Xdebug", - "performance" - ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/1.4.6" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "install-path": "./xdebug-handler" - }, - { - "name": "doctrine/inflector", - "version": "2.0.4", - "version_normalized": "2.0.4.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/inflector.git", - "reference": "8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89", - "reference": "8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^8.2", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpstan/phpstan-strict-rules": "^0.12", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", - "vimeo/psalm": "^4.10" - }, - "time": "2021-10-22T20:16:43+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Doctrine\\Inflector\\": "lib/Doctrine/Inflector" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.", - "homepage": "https://www.doctrine-project.org/projects/inflector.html", - "keywords": [ - "inflection", - "inflector", - "lowercase", - "manipulation", - "php", - "plural", - "singular", - "strings", - "uppercase", - "words" - ], - "support": { - "issues": "https://github.com/doctrine/inflector/issues", - "source": "https://github.com/doctrine/inflector/tree/2.0.4" - }, - "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%2Finflector", - "type": "tidelift" - } - ], - "install-path": "../doctrine/inflector" - }, - { - "name": "doctrine/instantiator", - "version": "1.4.0", - "version_normalized": "1.4.0.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", - "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^8.0", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^0.13 || 1.0.0-alpha2", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" - }, - "time": "2020-11-10T18:47:58+00:00", - "type": "library", - "installation-source": "dist", - "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.0" - }, - "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" - } - ], - "install-path": "../doctrine/instantiator" - }, - { - "name": "graham-campbell/result-type", - "version": "v1.0.4", - "version_normalized": "1.0.4.0", - "source": { - "type": "git", - "url": "https://github.com/GrahamCampbell/Result-Type.git", - "reference": "0690bde05318336c7221785f2a932467f98b64ca" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/0690bde05318336c7221785f2a932467f98b64ca", - "reference": "0690bde05318336c7221785f2a932467f98b64ca", - "shasum": "" - }, - "require": { - "php": "^7.0 || ^8.0", - "phpoption/phpoption": "^1.8" - }, - "require-dev": { - "phpunit/phpunit": "^6.5.14 || ^7.5.20 || ^8.5.19 || ^9.5.8" - }, - "time": "2021-11-21T21:41:47+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "GrahamCampbell\\ResultType\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - } - ], - "description": "An Implementation Of The Result Type", - "keywords": [ - "Graham Campbell", - "GrahamCampbell", - "Result Type", - "Result-Type", - "result" - ], - "support": { - "issues": "https://github.com/GrahamCampbell/Result-Type/issues", - "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.0.4" - }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/graham-campbell/result-type", - "type": "tidelift" - } - ], - "install-path": "../graham-campbell/result-type" - }, - { - "name": "guzzlehttp/guzzle", - "version": "7.4.1", - "version_normalized": "7.4.1.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "ee0a041b1760e6a53d2a39c8c34115adc2af2c79" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/ee0a041b1760e6a53d2a39c8c34115adc2af2c79", - "reference": "ee0a041b1760e6a53d2a39c8c34115adc2af2c79", - "shasum": "" - }, - "require": { - "ext-json": "*", - "guzzlehttp/promises": "^1.5", - "guzzlehttp/psr7": "^1.8.3 || ^2.1", - "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" - }, - "time": "2021-12-06T18:43:05+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "7.4-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "GuzzleHttp\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "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.1" - }, - "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" - } - ], - "install-path": "../guzzlehttp/guzzle" - }, - { - "name": "guzzlehttp/promises", - "version": "1.5.1", - "version_normalized": "1.5.1.0", - "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" - }, - "time": "2021-10-22T20:56:57+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.5-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "GuzzleHttp\\Promise\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "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" - } - ], - "install-path": "../guzzlehttp/promises" - }, - { - "name": "guzzlehttp/psr7", - "version": "2.1.0", - "version_normalized": "2.1.0.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/psr7.git", - "reference": "089edd38f5b8abba6cb01567c2a8aaa47cec4c72" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/089edd38f5b8abba6cb01567c2a8aaa47cec4c72", - "reference": "089edd38f5b8abba6cb01567c2a8aaa47cec4c72", - "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" - }, - "time": "2021-10-06T17:43:30+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, - "installation-source": "dist", - "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.1.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" - } - ], - "install-path": "../guzzlehttp/psr7" - }, - { - "name": "hamcrest/hamcrest-php", - "version": "v2.0.1", - "version_normalized": "2.0.1.0", - "source": { - "type": "git", - "url": "https://github.com/hamcrest/hamcrest-php.git", - "reference": "8c3d0a3f6af734494ad8f6fbbee0ba92422859f3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/8c3d0a3f6af734494ad8f6fbbee0ba92422859f3", - "reference": "8c3d0a3f6af734494ad8f6fbbee0ba92422859f3", - "shasum": "" - }, - "require": { - "php": "^5.3|^7.0|^8.0" - }, - "replace": { - "cordoval/hamcrest-php": "*", - "davedevelopment/hamcrest-php": "*", - "kodova/hamcrest-php": "*" - }, - "require-dev": { - "phpunit/php-file-iterator": "^1.4 || ^2.0", - "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0" - }, - "time": "2020-07-09T08:09:16+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "hamcrest" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "This is the PHP port of Hamcrest Matchers", - "keywords": [ - "test" - ], - "support": { - "issues": "https://github.com/hamcrest/hamcrest-php/issues", - "source": "https://github.com/hamcrest/hamcrest-php/tree/v2.0.1" - }, - "install-path": "../hamcrest/hamcrest-php" - }, - { - "name": "jean85/pretty-package-versions", - "version": "1.6.0", - "version_normalized": "1.6.0.0", - "source": { - "type": "git", - "url": "https://github.com/Jean85/pretty-package-versions.git", - "reference": "1e0104b46f045868f11942aea058cd7186d6c303" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/1e0104b46f045868f11942aea058cd7186d6c303", - "reference": "1e0104b46f045868f11942aea058cd7186d6c303", - "shasum": "" - }, - "require": { - "composer/package-versions-deprecated": "^1.8.0", - "php": "^7.0|^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0|^8.5|^9.2" - }, - "time": "2021-02-04T16:20:16+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Jean85\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Alessandro Lai", - "email": "alessandro.lai85@gmail.com" - } - ], - "description": "A wrapper for ocramius/package-versions to get pretty versions strings", - "keywords": [ - "composer", - "package", - "release", - "versions" - ], - "support": { - "issues": "https://github.com/Jean85/pretty-package-versions/issues", - "source": "https://github.com/Jean85/pretty-package-versions/tree/1.6.0" - }, - "install-path": "../jean85/pretty-package-versions" - }, - { - "name": "mockery/mockery", - "version": "1.4.4", - "version_normalized": "1.4.4.0", - "source": { - "type": "git", - "url": "https://github.com/mockery/mockery.git", - "reference": "e01123a0e847d52d186c5eb4b9bf58b0c6d00346" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mockery/mockery/zipball/e01123a0e847d52d186c5eb4b9bf58b0c6d00346", - "reference": "e01123a0e847d52d186c5eb4b9bf58b0c6d00346", - "shasum": "" - }, - "require": { - "hamcrest/hamcrest-php": "^2.0.1", - "lib-pcre": ">=7.0", - "php": "^7.3 || ^8.0" - }, - "conflict": { - "phpunit/phpunit": "<8.0" - }, - "require-dev": { - "phpunit/phpunit": "^8.5 || ^9.3" - }, - "time": "2021-09-13T15:28:59+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Mockery": "library/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Pádraic Brady", - "email": "padraic.brady@gmail.com", - "homepage": "http://blog.astrumfutura.com" - }, - { - "name": "Dave Marshall", - "email": "dave.marshall@atstsolutions.co.uk", - "homepage": "http://davedevelopment.co.uk" - } - ], - "description": "Mockery is a simple yet flexible PHP mock object framework", - "homepage": "https://github.com/mockery/mockery", - "keywords": [ - "BDD", - "TDD", - "library", - "mock", - "mock objects", - "mockery", - "stub", - "test", - "test double", - "testing" - ], - "support": { - "issues": "https://github.com/mockery/mockery/issues", - "source": "https://github.com/mockery/mockery/tree/1.4.4" - }, - "install-path": "../mockery/mockery" - }, - { - "name": "myclabs/deep-copy", - "version": "1.10.2", - "version_normalized": "1.10.2.0", - "source": { - "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220", - "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/collections": "^1.0", - "doctrine/common": "^2.6", - "phpunit/phpunit": "^7.1" - }, - "time": "2020-11-13T09:40:50+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - }, - "files": [ - "src/DeepCopy/deep_copy.php" - ] - }, - "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.10.2" - }, - "funding": [ - { - "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", - "type": "tidelift" - } - ], - "install-path": "../myclabs/deep-copy" - }, - { - "name": "nette/bootstrap", - "version": "v3.1.2", - "version_normalized": "3.1.2.0", - "source": { - "type": "git", - "url": "https://github.com/nette/bootstrap.git", - "reference": "3ab4912a08af0c16d541c3709935c3478b5ee090" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/bootstrap/zipball/3ab4912a08af0c16d541c3709935c3478b5ee090", - "reference": "3ab4912a08af0c16d541c3709935c3478b5ee090", - "shasum": "" - }, - "require": { - "nette/di": "^3.0.5", - "nette/utils": "^3.2.1", - "php": ">=7.2 <8.2" - }, - "conflict": { - "tracy/tracy": "<2.6" - }, - "require-dev": { - "latte/latte": "^2.8", - "nette/application": "^3.1", - "nette/caching": "^3.0", - "nette/database": "^3.0", - "nette/forms": "^3.0", - "nette/http": "^3.0", - "nette/mail": "^3.0", - "nette/robot-loader": "^3.0", - "nette/safe-stream": "^2.2", - "nette/security": "^3.0", - "nette/tester": "^2.0", - "phpstan/phpstan-nette": "^0.12", - "tracy/tracy": "^2.6" - }, - "suggest": { - "nette/robot-loader": "to use Configurator::createRobotLoader()", - "tracy/tracy": "to use Configurator::enableTracy()" - }, - "time": "2021-11-24T16:51:46+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0-only", - "GPL-3.0-only" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "🅱 Nette Bootstrap: the simple way to configure and bootstrap your Nette application.", - "homepage": "https://nette.org", - "keywords": [ - "bootstrapping", - "configurator", - "nette" - ], - "support": { - "issues": "https://github.com/nette/bootstrap/issues", - "source": "https://github.com/nette/bootstrap/tree/v3.1.2" - }, - "install-path": "../nette/bootstrap" - }, - { - "name": "nette/di", - "version": "v3.0.12", - "version_normalized": "3.0.12.0", - "source": { - "type": "git", - "url": "https://github.com/nette/di.git", - "reference": "11c236b9f7bbfc5a95e7b24742ad8847936feeb5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/di/zipball/11c236b9f7bbfc5a95e7b24742ad8847936feeb5", - "reference": "11c236b9f7bbfc5a95e7b24742ad8847936feeb5", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "nette/neon": "^3.3", - "nette/php-generator": "^3.5.4", - "nette/robot-loader": "^3.2", - "nette/schema": "^1.1", - "nette/utils": "^3.1.6", - "php": ">=7.1 <8.2" - }, - "conflict": { - "nette/bootstrap": "<3.0" - }, - "require-dev": { - "nette/tester": "^2.2", - "phpstan/phpstan": "^0.12", - "tracy/tracy": "^2.3" - }, - "time": "2021-12-15T21:05:11+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0-only", - "GPL-3.0-only" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "💎 Nette Dependency Injection Container: Flexible, compiled and full-featured DIC with perfectly usable autowiring and support for all new PHP features.", - "homepage": "https://nette.org", - "keywords": [ - "compiled", - "di", - "dic", - "factory", - "ioc", - "nette", - "static" - ], - "support": { - "issues": "https://github.com/nette/di/issues", - "source": "https://github.com/nette/di/tree/v3.0.12" - }, - "install-path": "../nette/di" - }, - { - "name": "nette/finder", - "version": "v2.5.3", - "version_normalized": "2.5.3.0", - "source": { - "type": "git", - "url": "https://github.com/nette/finder.git", - "reference": "64dc25b7929b731e72a1bc84a9e57727f5d5d3e8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/finder/zipball/64dc25b7929b731e72a1bc84a9e57727f5d5d3e8", - "reference": "64dc25b7929b731e72a1bc84a9e57727f5d5d3e8", - "shasum": "" - }, - "require": { - "nette/utils": "^2.4 || ^3.0", - "php": ">=7.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/tester": "^2.0", - "phpstan/phpstan": "^0.12", - "tracy/tracy": "^2.3" - }, - "time": "2021-12-12T17:43:24+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.5-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0-only", - "GPL-3.0-only" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "🔍 Nette Finder: find files and directories with an intuitive API.", - "homepage": "https://nette.org", - "keywords": [ - "filesystem", - "glob", - "iterator", - "nette" - ], - "support": { - "issues": "https://github.com/nette/finder/issues", - "source": "https://github.com/nette/finder/tree/v2.5.3" - }, - "install-path": "../nette/finder" - }, - { - "name": "nette/neon", - "version": "v3.3.2", - "version_normalized": "3.3.2.0", - "source": { - "type": "git", - "url": "https://github.com/nette/neon.git", - "reference": "54b287d8c2cdbe577b02e28ca1713e275b05ece2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/neon/zipball/54b287d8c2cdbe577b02e28ca1713e275b05ece2", - "reference": "54b287d8c2cdbe577b02e28ca1713e275b05ece2", - "shasum": "" - }, - "require": { - "ext-json": "*", - "php": ">=7.1" - }, - "require-dev": { - "nette/tester": "^2.0", - "phpstan/phpstan": "^0.12", - "tracy/tracy": "^2.7" - }, - "time": "2021-11-25T15:57:41+00:00", - "bin": [ - "bin/neon-lint" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0-only", - "GPL-3.0-only" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "🍸 Nette NEON: encodes and decodes NEON file format.", - "homepage": "https://ne-on.org", - "keywords": [ - "export", - "import", - "neon", - "nette", - "yaml" - ], - "support": { - "issues": "https://github.com/nette/neon/issues", - "source": "https://github.com/nette/neon/tree/v3.3.2" - }, - "install-path": "../nette/neon" - }, - { - "name": "nette/php-generator", - "version": "v3.6.5", - "version_normalized": "3.6.5.0", - "source": { - "type": "git", - "url": "https://github.com/nette/php-generator.git", - "reference": "9370403f9d9c25b51c4596ded1fbfe70347f7c82" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/php-generator/zipball/9370403f9d9c25b51c4596ded1fbfe70347f7c82", - "reference": "9370403f9d9c25b51c4596ded1fbfe70347f7c82", - "shasum": "" - }, - "require": { - "nette/utils": "^3.1.2", - "php": ">=7.2 <8.2" - }, - "require-dev": { - "nette/tester": "^2.4", - "nikic/php-parser": "^4.13", - "phpstan/phpstan": "^0.12", - "tracy/tracy": "^2.8" - }, - "suggest": { - "nikic/php-parser": "to use ClassType::withBodiesFrom() & GlobalFunction::withBodyFrom()" - }, - "time": "2021-11-24T16:23:44+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.6-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0-only", - "GPL-3.0-only" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "🐘 Nette PHP Generator: generates neat PHP code for you. Supports new PHP 8.1 features.", - "homepage": "https://nette.org", - "keywords": [ - "code", - "nette", - "php", - "scaffolding" - ], - "support": { - "issues": "https://github.com/nette/php-generator/issues", - "source": "https://github.com/nette/php-generator/tree/v3.6.5" - }, - "install-path": "../nette/php-generator" - }, - { - "name": "nette/robot-loader", - "version": "v3.4.1", - "version_normalized": "3.4.1.0", - "source": { - "type": "git", - "url": "https://github.com/nette/robot-loader.git", - "reference": "e2adc334cb958164c050f485d99c44c430f51fe2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/robot-loader/zipball/e2adc334cb958164c050f485d99c44c430f51fe2", - "reference": "e2adc334cb958164c050f485d99c44c430f51fe2", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "nette/finder": "^2.5 || ^3.0", - "nette/utils": "^3.0", - "php": ">=7.1" - }, - "require-dev": { - "nette/tester": "^2.0", - "phpstan/phpstan": "^0.12", - "tracy/tracy": "^2.3" - }, - "time": "2021-08-25T15:53:54+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0-only", - "GPL-3.0-only" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "🍀 Nette RobotLoader: high performance and comfortable autoloader that will search and autoload classes within your application.", - "homepage": "https://nette.org", - "keywords": [ - "autoload", - "class", - "interface", - "nette", - "trait" - ], - "support": { - "issues": "https://github.com/nette/robot-loader/issues", - "source": "https://github.com/nette/robot-loader/tree/v3.4.1" - }, - "install-path": "../nette/robot-loader" - }, - { - "name": "nette/schema", - "version": "v1.2.2", - "version_normalized": "1.2.2.0", - "source": { - "type": "git", - "url": "https://github.com/nette/schema.git", - "reference": "9a39cef03a5b34c7de64f551538cbba05c2be5df" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/schema/zipball/9a39cef03a5b34c7de64f551538cbba05c2be5df", - "reference": "9a39cef03a5b34c7de64f551538cbba05c2be5df", - "shasum": "" - }, - "require": { - "nette/utils": "^2.5.7 || ^3.1.5 || ^4.0", - "php": ">=7.1 <8.2" - }, - "require-dev": { - "nette/tester": "^2.3 || ^2.4", - "phpstan/phpstan-nette": "^0.12", - "tracy/tracy": "^2.7" - }, - "time": "2021-10-15T11:40:02+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0-only", - "GPL-3.0-only" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "📐 Nette Schema: validating data structures against a given Schema.", - "homepage": "https://nette.org", - "keywords": [ - "config", - "nette" - ], - "support": { - "issues": "https://github.com/nette/schema/issues", - "source": "https://github.com/nette/schema/tree/v1.2.2" - }, - "install-path": "../nette/schema" - }, - { - "name": "nette/utils", - "version": "v3.2.6", - "version_normalized": "3.2.6.0", - "source": { - "type": "git", - "url": "https://github.com/nette/utils.git", - "reference": "2f261e55bd6a12057442045bf2c249806abc1d02" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/utils/zipball/2f261e55bd6a12057442045bf2c249806abc1d02", - "reference": "2f261e55bd6a12057442045bf2c249806abc1d02", - "shasum": "" - }, - "require": { - "php": ">=7.2 <8.2" - }, - "conflict": { - "nette/di": "<3.0.6" - }, - "require-dev": { - "nette/tester": "~2.0", - "phpstan/phpstan": "^1.0", - "tracy/tracy": "^2.3" - }, - "suggest": { - "ext-gd": "to use Image", - "ext-iconv": "to use Strings::webalize(), toAscii(), chr() and reverse()", - "ext-intl": "to use Strings::webalize(), toAscii(), normalize() and compare()", - "ext-json": "to use Nette\\Utils\\Json", - "ext-mbstring": "to use Strings::lower() etc...", - "ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()", - "ext-xml": "to use Strings::length() etc. when mbstring is not available" - }, - "time": "2021-11-24T15:47:23+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0-only", - "GPL-3.0-only" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "🛠 Nette Utils: lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.", - "homepage": "https://nette.org", - "keywords": [ - "array", - "core", - "datetime", - "images", - "json", - "nette", - "paginator", - "password", - "slugify", - "string", - "unicode", - "utf-8", - "utility", - "validation" - ], - "support": { - "issues": "https://github.com/nette/utils/issues", - "source": "https://github.com/nette/utils/tree/v3.2.6" - }, - "install-path": "../nette/utils" - }, - { - "name": "nikic/php-parser", - "version": "v4.13.2", - "version_normalized": "4.13.2.0", - "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" - }, - "time": "2021-11-30T19:35:32+00:00", - "bin": [ - "bin/php-parse" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.9-dev" - } - }, - "installation-source": "dist", - "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" - }, - "install-path": "../nikic/php-parser" - }, - { - "name": "phar-io/manifest", - "version": "2.0.3", - "version_normalized": "2.0.3.0", - "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" - }, - "time": "2021-07-20T11:28:43+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "installation-source": "dist", - "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" - }, - "install-path": "../phar-io/manifest" - }, - { - "name": "phar-io/version", - "version": "3.1.0", - "version_normalized": "3.1.0.0", - "source": { - "type": "git", - "url": "https://github.com/phar-io/version.git", - "reference": "bae7c545bef187884426f042434e561ab1ddb182" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/bae7c545bef187884426f042434e561ab1ddb182", - "reference": "bae7c545bef187884426f042434e561ab1ddb182", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "time": "2021-02-23T14:00:09+00:00", - "type": "library", - "installation-source": "dist", - "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.1.0" - }, - "install-path": "../phar-io/version" - }, - { - "name": "php-parallel-lint/php-parallel-lint", - "version": "v1.3.1", - "version_normalized": "1.3.1.0", - "source": { - "type": "git", - "url": "https://github.com/php-parallel-lint/PHP-Parallel-Lint.git", - "reference": "761f3806e30239b5fcd90a0a45d41dc2138de192" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-parallel-lint/PHP-Parallel-Lint/zipball/761f3806e30239b5fcd90a0a45d41dc2138de192", - "reference": "761f3806e30239b5fcd90a0a45d41dc2138de192", - "shasum": "" - }, - "require": { - "ext-json": "*", - "php": ">=5.3.0" - }, - "replace": { - "grogy/php-parallel-lint": "*", - "jakub-onderka/php-parallel-lint": "*" - }, - "require-dev": { - "nette/tester": "^1.3 || ^2.0", - "php-parallel-lint/php-console-highlighter": "~0.3", - "squizlabs/php_codesniffer": "^3.6" - }, - "suggest": { - "php-parallel-lint/php-console-highlighter": "Highlight syntax in code snippet" - }, - "time": "2021-08-13T05:35:13+00:00", - "bin": [ - "parallel-lint" - ], - "type": "library", - "installation-source": "dist", - "autoload": { - "classmap": [ - "./" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-2-Clause" - ], - "authors": [ - { - "name": "Jakub Onderka", - "email": "ahoj@jakubonderka.cz" - } - ], - "description": "This tool check syntax of PHP files about 20x faster than serial check.", - "homepage": "https://github.com/php-parallel-lint/PHP-Parallel-Lint", - "support": { - "issues": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/issues", - "source": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/tree/v1.3.1" - }, - "install-path": "../php-parallel-lint/php-parallel-lint" - }, - { - "name": "phpdocumentor/reflection-common", - "version": "2.2.0", - "version_normalized": "2.2.0.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" - }, - "time": "2020-06-27T09:03:43+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-2.x": "2.x-dev" - } - }, - "installation-source": "dist", - "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" - }, - "install-path": "../phpdocumentor/reflection-common" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "5.1.0", - "version_normalized": "5.1.0.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e", - "reference": "cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e", - "shasum": "" - }, - "require": { - "ext-filter": "^7.1", - "php": "^7.2", - "phpdocumentor/reflection-common": "^2.0", - "phpdocumentor/type-resolver": "^1.0", - "webmozart/assert": "^1" - }, - "require-dev": { - "doctrine/instantiator": "^1", - "mockery/mockery": "^1" - }, - "time": "2020-02-22T12:28:44+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.x-dev" - } - }, - "installation-source": "dist", - "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.1.0" - }, - "install-path": "../phpdocumentor/reflection-docblock" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "1.5.1", - "version_normalized": "1.5.1.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/a12f7e301eb7258bb68acd89d4aefa05c2906cae", - "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.0" - }, - "require-dev": { - "ext-tokenizer": "*", - "psalm/phar": "^4.8" - }, - "time": "2021-10-02T14:08:47+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-1.x": "1.x-dev" - } - }, - "installation-source": "dist", - "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.5.1" - }, - "install-path": "../phpdocumentor/type-resolver" - }, - { - "name": "phpoption/phpoption", - "version": "1.8.1", - "version_normalized": "1.8.1.0", - "source": { - "type": "git", - "url": "https://github.com/schmittjoh/php-option.git", - "reference": "eab7a0df01fe2344d172bff4cd6dbd3f8b84ad15" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/eab7a0df01fe2344d172bff4cd6dbd3f8b84ad15", - "reference": "eab7a0df01fe2344d172bff4cd6dbd3f8b84ad15", - "shasum": "" - }, - "require": { - "php": "^7.0 || ^8.0" - }, - "require-dev": { - "bamarni/composer-bin-plugin": "^1.4.1", - "phpunit/phpunit": "^6.5.14 || ^7.5.20 || ^8.5.19 || ^9.5.8" - }, - "time": "2021-12-04T23:24:31+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.8-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "PhpOption\\": "src/PhpOption/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Johannes M. Schmitt", - "email": "schmittjoh@gmail.com", - "homepage": "https://github.com/schmittjoh" - }, - { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - } - ], - "description": "Option Type for PHP", - "keywords": [ - "language", - "option", - "php", - "type" - ], - "support": { - "issues": "https://github.com/schmittjoh/php-option/issues", - "source": "https://github.com/schmittjoh/php-option/tree/1.8.1" - }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpoption/phpoption", - "type": "tidelift" - } - ], - "install-path": "../phpoption/phpoption" - }, - { - "name": "phpspec/prophecy", - "version": "1.11.1", - "version_normalized": "1.11.1.0", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "b20034be5efcdab4fb60ca3a29cba2949aead160" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/b20034be5efcdab4fb60ca3a29cba2949aead160", - "reference": "b20034be5efcdab4fb60ca3a29cba2949aead160", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.2", - "php": "^7.2", - "phpdocumentor/reflection-docblock": "^5.0", - "sebastian/comparator": "^3.0 || ^4.0", - "sebastian/recursion-context": "^3.0 || ^4.0" - }, - "require-dev": { - "phpspec/phpspec": "^6.0", - "phpunit/phpunit": "^8.0" - }, - "time": "2020-07-08T12:44:21+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.11.x-dev" - } - }, - "installation-source": "dist", - "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/master" - }, - "install-path": "../phpspec/prophecy" - }, - { - "name": "phpstan/phpdoc-parser", - "version": "0.3.5", - "version_normalized": "0.3.5.0", - "source": { - "type": "git", - "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "8c4ef2aefd9788238897b678a985e1d5c8df6db4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/8c4ef2aefd9788238897b678a985e1d5c8df6db4", - "reference": "8c4ef2aefd9788238897b678a985e1d5c8df6db4", - "shasum": "" - }, - "require": { - "php": "~7.1" - }, - "require-dev": { - "consistence/coding-standard": "^3.5", - "jakub-onderka/php-parallel-lint": "^0.9.2", - "phing/phing": "^2.16.0", - "phpstan/phpstan": "^0.10", - "phpunit/phpunit": "^6.3", - "slevomat/coding-standard": "^4.7.2", - "squizlabs/php_codesniffer": "^3.3.2", - "symfony/process": "^3.4 || ^4.0" - }, - "time": "2019-06-07T19:13:52+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.3-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "PHPStan\\PhpDocParser\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "PHPDoc parser with support for nullable, intersection and generic types", - "support": { - "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/master" - }, - "install-path": "../phpstan/phpdoc-parser" - }, - { - "name": "phpstan/phpstan", - "version": "0.11.20", - "version_normalized": "0.11.20.0", - "source": { - "type": "git", - "url": "https://github.com/phpstan/phpstan.git", - "reference": "938dcc03a005280e1a9587ec7684345bff06ebfc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/938dcc03a005280e1a9587ec7684345bff06ebfc", - "reference": "938dcc03a005280e1a9587ec7684345bff06ebfc", - "shasum": "" - }, - "require": { - "composer/xdebug-handler": "^1.3.0", - "jean85/pretty-package-versions": "^1.0.3", - "nette/bootstrap": "^2.4 || ^3.0", - "nette/di": "^2.4.7 || ^3.0", - "nette/neon": "^2.4.3 || ^3.0", - "nette/robot-loader": "^3.0.1", - "nette/schema": "^1.0", - "nette/utils": "^2.4.5 || ^3.0", - "nikic/php-parser": "^4.2.3", - "php": "~7.1", - "phpstan/phpdoc-parser": "^0.3.5", - "symfony/console": "~3.2 || ~4.0", - "symfony/finder": "~3.2 || ~4.0" - }, - "conflict": { - "symfony/console": "3.4.16 || 4.1.5" - }, - "require-dev": { - "brianium/paratest": "^2.0 || ^3.0", - "consistence/coding-standard": "^3.5", - "dealerdirect/phpcodesniffer-composer-installer": "^0.4.4", - "ext-intl": "*", - "ext-mysqli": "*", - "ext-simplexml": "*", - "ext-soap": "*", - "ext-zip": "*", - "jakub-onderka/php-parallel-lint": "^1.0", - "localheinz/composer-normalize": "^1.1.0", - "phing/phing": "^2.16.0", - "phpstan/phpstan-deprecation-rules": "^0.11", - "phpstan/phpstan-php-parser": "^0.11", - "phpstan/phpstan-phpunit": "^0.11", - "phpstan/phpstan-strict-rules": "^0.11", - "phpunit/phpunit": "^7.5.14 || ^8.0", - "slevomat/coding-standard": "^4.7.2", - "squizlabs/php_codesniffer": "^3.3.2" - }, - "time": "2020-10-12T14:33:05+00:00", - "bin": [ - "bin/phpstan" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.11-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "PHPStan\\": [ - "src/" - ] - } - }, - "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/0.11.20" - }, - "funding": [ - { - "url": "https://github.com/ondrejmirtes", - "type": "github" - }, - { - "url": "https://www.patreon.com/phpstan", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", - "type": "tidelift" - } - ], - "install-path": "../phpstan/phpstan" - }, - { - "name": "phpstan/phpstan-mockery", - "version": "0.11.3", - "version_normalized": "0.11.3.0", - "source": { - "type": "git", - "url": "https://github.com/phpstan/phpstan-mockery.git", - "reference": "8f3f0dc0bbc8c413224459a25f89a2cef5924871" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-mockery/zipball/8f3f0dc0bbc8c413224459a25f89a2cef5924871", - "reference": "8f3f0dc0bbc8c413224459a25f89a2cef5924871", - "shasum": "" - }, - "require": { - "nikic/php-parser": "^4.0", - "php": "~7.1", - "phpstan/phpdoc-parser": "^0.3", - "phpstan/phpstan": "^0.11.4" - }, - "require-dev": { - "consistence/coding-standard": "^3.0.1", - "dealerdirect/phpcodesniffer-composer-installer": "^0.4.4", - "jakub-onderka/php-parallel-lint": "^1.0", - "mockery/mockery": "^1.1", - "phing/phing": "^2.16.0", - "phpstan/phpstan-phpunit": "^0.11", - "phpstan/phpstan-strict-rules": "^0.11", - "phpunit/phpunit": "^7.2", - "slevomat/coding-standard": "^4.6.3" - }, - "time": "2019-08-15T06:50:55+00:00", - "type": "phpstan-extension", - "extra": { - "branch-alias": { - "dev-master": "0.11-dev" - }, - "phpstan": { - "includes": [ - "extension.neon" - ] - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "PHPStan\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "PHPStan Mockery extension", - "support": { - "issues": "https://github.com/phpstan/phpstan-mockery/issues", - "source": "https://github.com/phpstan/phpstan-mockery/tree/0.11.3" - }, - "install-path": "../phpstan/phpstan-mockery" - }, - { - "name": "phpunit/php-code-coverage", - "version": "7.0.15", - "version_normalized": "7.0.15.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "819f92bba8b001d4363065928088de22f25a3a48" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/819f92bba8b001d4363065928088de22f25a3a48", - "reference": "819f92bba8b001d4363065928088de22f25a3a48", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-xmlwriter": "*", - "php": ">=7.2", - "phpunit/php-file-iterator": "^2.0.2", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^3.1.3 || ^4.0", - "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^4.2.2", - "sebastian/version": "^2.0.1", - "theseer/tokenizer": "^1.1.3" - }, - "require-dev": { - "phpunit/phpunit": "^8.2.2" - }, - "suggest": { - "ext-xdebug": "^2.7.2" - }, - "time": "2021-07-26T12:20:09+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "7.0-dev" - } - }, - "installation-source": "dist", - "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/7.0.15" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "install-path": "../phpunit/php-code-coverage" - }, - { - "name": "phpunit/php-file-iterator", - "version": "2.0.5", - "version_normalized": "2.0.5.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5", - "reference": "42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "^8.5" - }, - "time": "2021-12-02T12:42:26+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "installation-source": "dist", - "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/2.0.5" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "install-path": "../phpunit/php-file-iterator" - }, - { - "name": "phpunit/php-text-template", - "version": "1.2.1", - "version_normalized": "1.2.1.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "time": "2015-06-21T13:50:34+00:00", - "type": "library", - "installation-source": "dist", - "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/1.2.1" - }, - "install-path": "../phpunit/php-text-template" - }, - { - "name": "phpunit/php-timer", - "version": "2.1.3", - "version_normalized": "2.1.3.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "2454ae1765516d20c4ffe103d85a58a9a3bd5662" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/2454ae1765516d20c4ffe103d85a58a9a3bd5662", - "reference": "2454ae1765516d20c4ffe103d85a58a9a3bd5662", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "^8.5" - }, - "time": "2020-11-30T08:20:02+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, - "installation-source": "dist", - "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/2.1.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "install-path": "../phpunit/php-timer" - }, - { - "name": "phpunit/php-token-stream", - "version": "4.0.4", - "version_normalized": "4.0.4.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "a853a0e183b9db7eed023d7933a858fa1c8d25a3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/a853a0e183b9db7eed023d7933a858fa1c8d25a3", - "reference": "a853a0e183b9db7eed023d7933a858fa1c8d25a3", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": "^7.3 || ^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.0" - }, - "time": "2020-08-04T08:28:15+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-token-stream/issues", - "source": "https://github.com/sebastianbergmann/php-token-stream/tree/master" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "abandoned": true, - "install-path": "../phpunit/php-token-stream" - }, - { - "name": "phpunit/phpunit", - "version": "8.5.22", - "version_normalized": "8.5.22.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "ddd05b9d844260353895a3b950a9258126c11503" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ddd05b9d844260353895a3b950a9258126c11503", - "reference": "ddd05b9d844260353895a3b950a9258126c11503", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.3.1", - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.10.0", - "phar-io/manifest": "^2.0.3", - "phar-io/version": "^3.0.2", - "php": ">=7.2", - "phpspec/prophecy": "^1.10.3", - "phpunit/php-code-coverage": "^7.0.12", - "phpunit/php-file-iterator": "^2.0.4", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^2.1.2", - "sebastian/comparator": "^3.0.2", - "sebastian/diff": "^3.0.2", - "sebastian/environment": "^4.2.3", - "sebastian/exporter": "^3.1.2", - "sebastian/global-state": "^3.0.0", - "sebastian/object-enumerator": "^3.0.3", - "sebastian/resource-operations": "^2.0.1", - "sebastian/type": "^1.1.3", - "sebastian/version": "^2.0.1" - }, - "require-dev": { - "ext-pdo": "*" - }, - "suggest": { - "ext-soap": "*", - "ext-xdebug": "*", - "phpunit/php-invoker": "^2.0.0" - }, - "time": "2021-12-25T06:58:09+00:00", - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "8.5-dev" - } - }, - "installation-source": "dist", - "autoload": { - "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/8.5.22" - }, - "funding": [ - { - "url": "https://phpunit.de/sponsors.html", - "type": "custom" - }, - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "install-path": "../phpunit/phpunit" - }, - { - "name": "psr/container", - "version": "1.1.2", - "version_normalized": "1.1.2.0", - "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" - }, - "time": "2021-11-05T16:50:12+00:00", - "type": "library", - "installation-source": "dist", - "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" - }, - "install-path": "../psr/container" - }, - { - "name": "psr/http-client", - "version": "1.0.1", - "version_normalized": "1.0.1.0", - "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" - }, - "time": "2020-06-29T06:28:15+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "installation-source": "dist", - "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" - }, - "install-path": "../psr/http-client" - }, - { - "name": "psr/http-factory", - "version": "1.0.1", - "version_normalized": "1.0.1.0", - "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" - }, - "time": "2019-04-30T12:38:16+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "installation-source": "dist", - "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" - }, - "install-path": "../psr/http-factory" - }, - { - "name": "psr/http-message", - "version": "1.0.1", - "version_normalized": "1.0.1.0", - "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" - }, - "time": "2016-08-06T14:39:51+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "installation-source": "dist", - "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" - }, - "install-path": "../psr/http-message" - }, - { - "name": "psr/log", - "version": "1.1.4", - "version_normalized": "1.1.4.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "time": "2021-05-03T11:20:27+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Psr\\Log\\": "Psr/Log/" - } - }, - "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/1.1.4" - }, - "install-path": "../psr/log" - }, - { - "name": "ralouphie/getallheaders", - "version": "3.0.3", - "version_normalized": "3.0.3.0", - "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" - }, - "time": "2019-03-08T08:55:37+00:00", - "type": "library", - "installation-source": "dist", - "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" - }, - "install-path": "../ralouphie/getallheaders" - }, - { - "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.2", - "version_normalized": "1.0.2.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/1de8cd5c010cb153fcd68b8d0f64606f523f7619", - "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "require-dev": { - "phpunit/phpunit": "^8.5" - }, - "time": "2020-11-30T08:15:22+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "installation-source": "dist", - "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/1.0.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "install-path": "../sebastian/code-unit-reverse-lookup" - }, - { - "name": "sebastian/comparator", - "version": "3.0.3", - "version_normalized": "3.0.3.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "1071dfcef776a57013124ff35e1fc41ccd294758" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1071dfcef776a57013124ff35e1fc41ccd294758", - "reference": "1071dfcef776a57013124ff35e1fc41ccd294758", - "shasum": "" - }, - "require": { - "php": ">=7.1", - "sebastian/diff": "^3.0", - "sebastian/exporter": "^3.1" - }, - "require-dev": { - "phpunit/phpunit": "^8.5" - }, - "time": "2020-11-30T08:04:30+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "installation-source": "dist", - "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/3.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "install-path": "../sebastian/comparator" - }, - { - "name": "sebastian/diff", - "version": "3.0.3", - "version_normalized": "3.0.3.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "14f72dd46eaf2f2293cbe79c93cc0bc43161a211" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/14f72dd46eaf2f2293cbe79c93cc0bc43161a211", - "reference": "14f72dd46eaf2f2293cbe79c93cc0bc43161a211", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.5 || ^8.0", - "symfony/process": "^2 || ^3.3 || ^4" - }, - "time": "2020-11-30T07:59:04+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "installation-source": "dist", - "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/3.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "install-path": "../sebastian/diff" - }, - { - "name": "sebastian/environment", - "version": "4.2.4", - "version_normalized": "4.2.4.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "d47bbbad83711771f167c72d4e3f25f7fcc1f8b0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/d47bbbad83711771f167c72d4e3f25f7fcc1f8b0", - "reference": "d47bbbad83711771f167c72d4e3f25f7fcc1f8b0", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.5" - }, - "suggest": { - "ext-posix": "*" - }, - "time": "2020-11-30T07:53:42+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.2-dev" - } - }, - "installation-source": "dist", - "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/4.2.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "install-path": "../sebastian/environment" - }, - { - "name": "sebastian/exporter", - "version": "3.1.4", - "version_normalized": "3.1.4.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "0c32ea2e40dbf59de29f3b49bf375176ce7dd8db" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/0c32ea2e40dbf59de29f3b49bf375176ce7dd8db", - "reference": "0c32ea2e40dbf59de29f3b49bf375176ce7dd8db", - "shasum": "" - }, - "require": { - "php": ">=7.0", - "sebastian/recursion-context": "^3.0" - }, - "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^8.5" - }, - "time": "2021-11-11T13:51:24+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1.x-dev" - } - }, - "installation-source": "dist", - "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": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/3.1.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "install-path": "../sebastian/exporter" - }, - { - "name": "sebastian/global-state", - "version": "3.0.1", - "version_normalized": "3.0.1.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "474fb9edb7ab891665d3bfc6317f42a0a150454b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/474fb9edb7ab891665d3bfc6317f42a0a150454b", - "reference": "474fb9edb7ab891665d3bfc6317f42a0a150454b", - "shasum": "" - }, - "require": { - "php": ">=7.2", - "sebastian/object-reflector": "^1.1.1", - "sebastian/recursion-context": "^3.0" - }, - "require-dev": { - "ext-dom": "*", - "phpunit/phpunit": "^8.0" - }, - "suggest": { - "ext-uopz": "*" - }, - "time": "2020-11-30T07:43:24+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "installation-source": "dist", - "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/3.0.1" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "install-path": "../sebastian/global-state" - }, - { - "name": "sebastian/object-enumerator", - "version": "3.0.4", - "version_normalized": "3.0.4.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2", - "reference": "e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2", - "shasum": "" - }, - "require": { - "php": ">=7.0", - "sebastian/object-reflector": "^1.1.1", - "sebastian/recursion-context": "^3.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "time": "2020-11-30T07:40:27+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - }, - "installation-source": "dist", - "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/3.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "install-path": "../sebastian/object-enumerator" - }, - { - "name": "sebastian/object-reflector", - "version": "1.1.2", - "version_normalized": "1.1.2.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "9b8772b9cbd456ab45d4a598d2dd1a1bced6363d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/9b8772b9cbd456ab45d4a598d2dd1a1bced6363d", - "reference": "9b8772b9cbd456ab45d4a598d2dd1a1bced6363d", - "shasum": "" - }, - "require": { - "php": ">=7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "time": "2020-11-30T07:37:18+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "installation-source": "dist", - "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/1.1.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "install-path": "../sebastian/object-reflector" - }, - { - "name": "sebastian/recursion-context", - "version": "3.0.1", - "version_normalized": "3.0.1.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "367dcba38d6e1977be014dc4b22f47a484dac7fb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/367dcba38d6e1977be014dc4b22f47a484dac7fb", - "reference": "367dcba38d6e1977be014dc4b22f47a484dac7fb", - "shasum": "" - }, - "require": { - "php": ">=7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "time": "2020-11-30T07:34:24+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - }, - "installation-source": "dist", - "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/3.0.1" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "install-path": "../sebastian/recursion-context" - }, - { - "name": "sebastian/resource-operations", - "version": "2.0.2", - "version_normalized": "2.0.2.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "31d35ca87926450c44eae7e2611d45a7a65ea8b3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/31d35ca87926450c44eae7e2611d45a7a65ea8b3", - "reference": "31d35ca87926450c44eae7e2611d45a7a65ea8b3", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "time": "2020-11-30T07:30:19+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "installation-source": "dist", - "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/2.0.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "install-path": "../sebastian/resource-operations" - }, - { - "name": "sebastian/type", - "version": "1.1.4", - "version_normalized": "1.1.4.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/type.git", - "reference": "0150cfbc4495ed2df3872fb31b26781e4e077eb4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/0150cfbc4495ed2df3872fb31b26781e4e077eb4", - "reference": "0150cfbc4495ed2df3872fb31b26781e4e077eb4", - "shasum": "" - }, - "require": { - "php": ">=7.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.2" - }, - "time": "2020-11-30T07:25:11+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "installation-source": "dist", - "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/1.1.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "install-path": "../sebastian/type" - }, - { - "name": "sebastian/version", - "version": "2.0.1", - "version_normalized": "2.0.1.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "time": "2016-10-03T07:35:21+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "installation-source": "dist", - "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/master" - }, - "install-path": "../sebastian/version" - }, - { - "name": "squizlabs/php_codesniffer", - "version": "3.6.2", - "version_normalized": "3.6.2.0", - "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" - }, - "time": "2021-12-12T21:44:58+00:00", - "bin": [ - "bin/phpcs", - "bin/phpcbf" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, - "installation-source": "dist", - "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" - }, - "install-path": "../squizlabs/php_codesniffer" - }, - { - "name": "symfony/console", - "version": "v4.4.36", - "version_normalized": "4.4.36.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "621379b62bb19af213b569b60013200b11dd576f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/621379b62bb19af213b569b60013200b11dd576f", - "reference": "621379b62bb19af213b569b60013200b11dd576f", - "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": "" - }, - "time": "2021-12-15T10:33:10+00:00", - "type": "library", - "installation-source": "dist", - "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.36" - }, - "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" - } - ], - "install-path": "../symfony/console" - }, - { - "name": "symfony/deprecation-contracts", - "version": "v2.5.0", - "version_normalized": "2.5.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/6f981ee24cf69ee7ce9736146d1c57c2780598a8", - "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "time": "2021-07-12T14:48:14+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "installation-source": "dist", - "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.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" - } - ], - "install-path": "../symfony/deprecation-contracts" - }, - { - "name": "symfony/finder", - "version": "v4.4.36", - "version_normalized": "4.4.36.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "1fef05633cd61b629e963e5d8200fb6b67ecf42c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/1fef05633cd61b629e963e5d8200fb6b67ecf42c", - "reference": "1fef05633cd61b629e963e5d8200fb6b67ecf42c", - "shasum": "" - }, - "require": { - "php": ">=7.1.3", - "symfony/polyfill-php80": "^1.16" - }, - "time": "2021-12-15T10:33:10+00:00", - "type": "library", - "installation-source": "dist", - "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.36" - }, - "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" - } - ], - "install-path": "../symfony/finder" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.23.0", - "version_normalized": "1.23.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", - "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "time": "2021-02-19T12:13:01+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "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.23.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" - } - ], - "install-path": "../symfony/polyfill-ctype" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.23.1", - "version_normalized": "1.23.1.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", - "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "time": "2021-05-27T12:26:48+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, - "files": [ - "bootstrap.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": "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.23.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" - } - ], - "install-path": "../symfony/polyfill-mbstring" - }, - { - "name": "symfony/polyfill-php73", - "version": "v1.23.0", - "version_normalized": "1.23.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fba8933c384d6476ab14fb7b8526e5287ca7e010", - "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "time": "2021-02-19T12:13:01+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" - }, - "files": [ - "bootstrap.php" - ], - "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.23.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" - } - ], - "install-path": "../symfony/polyfill-php73" - }, - { - "name": "symfony/polyfill-php80", - "version": "v1.23.1", - "version_normalized": "1.23.1.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be", - "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "time": "2021-07-28T13:41:28+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, - "files": [ - "bootstrap.php" - ], - "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.23.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" - } - ], - "install-path": "../symfony/polyfill-php80" - }, - { - "name": "symfony/service-contracts", - "version": "v2.5.0", - "version_normalized": "2.5.0.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": "" - }, - "time": "2021-11-04T16:48:04+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "installation-source": "dist", - "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" - } - ], - "install-path": "../symfony/service-contracts" - }, - { - "name": "theseer/tokenizer", - "version": "1.2.1", - "version_normalized": "1.2.1.0", - "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" - }, - "time": "2021-07-28T10:34:58+00:00", - "type": "library", - "installation-source": "dist", - "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" - } - ], - "install-path": "../theseer/tokenizer" - }, - { - "name": "vlucas/phpdotenv", - "version": "v5.4.1", - "version_normalized": "5.4.1.0", - "source": { - "type": "git", - "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "264dce589e7ce37a7ba99cb901eed8249fbec92f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/264dce589e7ce37a7ba99cb901eed8249fbec92f", - "reference": "264dce589e7ce37a7ba99cb901eed8249fbec92f", - "shasum": "" - }, - "require": { - "ext-pcre": "*", - "graham-campbell/result-type": "^1.0.2", - "php": "^7.1.3 || ^8.0", - "phpoption/phpoption": "^1.8", - "symfony/polyfill-ctype": "^1.23", - "symfony/polyfill-mbstring": "^1.23.1", - "symfony/polyfill-php80": "^1.23.1" - }, - "require-dev": { - "bamarni/composer-bin-plugin": "^1.4.1", - "ext-filter": "*", - "phpunit/phpunit": "^7.5.20 || ^8.5.21 || ^9.5.10" - }, - "suggest": { - "ext-filter": "Required to use the boolean validator." - }, - "time": "2021-12-12T23:22:04+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.4-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Dotenv\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - }, - { - "name": "Vance Lucas", - "email": "vance@vancelucas.com", - "homepage": "https://github.com/vlucas" - } - ], - "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", - "keywords": [ - "dotenv", - "env", - "environment" - ], - "support": { - "issues": "https://github.com/vlucas/phpdotenv/issues", - "source": "https://github.com/vlucas/phpdotenv/tree/v5.4.1" - }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/vlucas/phpdotenv", - "type": "tidelift" - } - ], - "install-path": "../vlucas/phpdotenv" - }, - { - "name": "webmozart/assert", - "version": "1.8.0", - "version_normalized": "1.8.0.0", - "source": { - "type": "git", - "url": "https://github.com/webmozarts/assert.git", - "reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/ab2cb0b3b559010b75981b1bdce728da3ee90ad6", - "reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0", - "symfony/polyfill-ctype": "^1.8" - }, - "conflict": { - "vimeo/psalm": "<3.9.1" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.36 || ^7.5.13" - }, - "time": "2020-04-18T12:12:48+00:00", - "type": "library", - "installation-source": "dist", - "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.8.0" - }, - "install-path": "../webmozart/assert" - } - ], - "dev": true, - "dev-package-names": [ - "composer/package-versions-deprecated", - "composer/xdebug-handler", - "doctrine/instantiator", - "graham-campbell/result-type", - "hamcrest/hamcrest-php", - "jean85/pretty-package-versions", - "mockery/mockery", - "myclabs/deep-copy", - "nette/bootstrap", - "nette/di", - "nette/finder", - "nette/neon", - "nette/php-generator", - "nette/robot-loader", - "nette/schema", - "nette/utils", - "nikic/php-parser", - "phar-io/manifest", - "phar-io/version", - "php-parallel-lint/php-parallel-lint", - "phpdocumentor/reflection-common", - "phpdocumentor/reflection-docblock", - "phpdocumentor/type-resolver", - "phpoption/phpoption", - "phpspec/prophecy", - "phpstan/phpdoc-parser", - "phpstan/phpstan", - "phpstan/phpstan-mockery", - "phpunit/php-code-coverage", - "phpunit/php-file-iterator", - "phpunit/php-text-template", - "phpunit/php-timer", - "phpunit/php-token-stream", - "phpunit/phpunit", - "psr/container", - "psr/log", - "sebastian/code-unit-reverse-lookup", - "sebastian/comparator", - "sebastian/diff", - "sebastian/environment", - "sebastian/exporter", - "sebastian/global-state", - "sebastian/object-enumerator", - "sebastian/object-reflector", - "sebastian/recursion-context", - "sebastian/resource-operations", - "sebastian/type", - "sebastian/version", - "squizlabs/php_codesniffer", - "symfony/console", - "symfony/finder", - "symfony/polyfill-ctype", - "symfony/polyfill-mbstring", - "symfony/polyfill-php73", - "symfony/polyfill-php80", - "symfony/service-contracts", - "theseer/tokenizer", - "vlucas/phpdotenv", - "webmozart/assert" - ] -} diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php deleted file mode 100644 index 975d63e..0000000 --- a/vendor/composer/installed.php +++ /dev/null @@ -1,695 +0,0 @@ - array( - 'pretty_version' => 'dev-master', - 'version' => 'dev-master', - 'type' => 'library', - 'install_path' => __DIR__ . '/../../', - 'aliases' => array(), - 'reference' => 'd7bd69649a7e68fd61dcddbfc0549f033e9d94ce', - 'name' => 'fleetbase/fleetbase-php', - 'dev' => true, - ), - 'versions' => array( - 'composer/package-versions-deprecated' => array( - 'pretty_version' => '1.11.99.4', - 'version' => '1.11.99.4', - 'type' => 'composer-plugin', - 'install_path' => __DIR__ . '/./package-versions-deprecated', - 'aliases' => array(), - 'reference' => 'b174585d1fe49ceed21928a945138948cb394600', - 'dev_requirement' => true, - ), - 'composer/xdebug-handler' => array( - 'pretty_version' => '1.4.6', - 'version' => '1.4.6.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/./xdebug-handler', - 'aliases' => array(), - 'reference' => 'f27e06cd9675801df441b3656569b328e04aa37c', - 'dev_requirement' => true, - ), - 'cordoval/hamcrest-php' => array( - 'dev_requirement' => true, - 'replaced' => array( - 0 => '*', - ), - ), - 'davedevelopment/hamcrest-php' => array( - 'dev_requirement' => true, - 'replaced' => array( - 0 => '*', - ), - ), - 'doctrine/inflector' => array( - 'pretty_version' => '2.0.4', - 'version' => '2.0.4.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../doctrine/inflector', - 'aliases' => array(), - 'reference' => '8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89', - 'dev_requirement' => false, - ), - 'doctrine/instantiator' => array( - 'pretty_version' => '1.4.0', - 'version' => '1.4.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../doctrine/instantiator', - 'aliases' => array(), - 'reference' => 'd56bf6102915de5702778fe20f2de3b2fe570b5b', - 'dev_requirement' => true, - ), - 'fleetbase/fleetbase-php' => array( - 'pretty_version' => 'dev-master', - 'version' => 'dev-master', - 'type' => 'library', - 'install_path' => __DIR__ . '/../../', - 'aliases' => array(), - 'reference' => 'd7bd69649a7e68fd61dcddbfc0549f033e9d94ce', - 'dev_requirement' => false, - ), - 'graham-campbell/result-type' => array( - 'pretty_version' => 'v1.0.4', - 'version' => '1.0.4.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../graham-campbell/result-type', - 'aliases' => array(), - 'reference' => '0690bde05318336c7221785f2a932467f98b64ca', - 'dev_requirement' => true, - ), - 'grogy/php-parallel-lint' => array( - 'dev_requirement' => true, - 'replaced' => array( - 0 => '*', - ), - ), - 'guzzlehttp/guzzle' => array( - 'pretty_version' => '7.4.1', - 'version' => '7.4.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../guzzlehttp/guzzle', - 'aliases' => array(), - 'reference' => 'ee0a041b1760e6a53d2a39c8c34115adc2af2c79', - 'dev_requirement' => false, - ), - 'guzzlehttp/promises' => array( - 'pretty_version' => '1.5.1', - 'version' => '1.5.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../guzzlehttp/promises', - 'aliases' => array(), - 'reference' => 'fe752aedc9fd8fcca3fe7ad05d419d32998a06da', - 'dev_requirement' => false, - ), - 'guzzlehttp/psr7' => array( - 'pretty_version' => '2.1.0', - 'version' => '2.1.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../guzzlehttp/psr7', - 'aliases' => array(), - 'reference' => '089edd38f5b8abba6cb01567c2a8aaa47cec4c72', - 'dev_requirement' => false, - ), - 'hamcrest/hamcrest-php' => array( - 'pretty_version' => 'v2.0.1', - 'version' => '2.0.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../hamcrest/hamcrest-php', - 'aliases' => array(), - 'reference' => '8c3d0a3f6af734494ad8f6fbbee0ba92422859f3', - 'dev_requirement' => true, - ), - 'jakub-onderka/php-parallel-lint' => array( - 'dev_requirement' => true, - 'replaced' => array( - 0 => '*', - ), - ), - 'jean85/pretty-package-versions' => array( - 'pretty_version' => '1.6.0', - 'version' => '1.6.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../jean85/pretty-package-versions', - 'aliases' => array(), - 'reference' => '1e0104b46f045868f11942aea058cd7186d6c303', - 'dev_requirement' => true, - ), - 'kodova/hamcrest-php' => array( - 'dev_requirement' => true, - 'replaced' => array( - 0 => '*', - ), - ), - 'mockery/mockery' => array( - 'pretty_version' => '1.4.4', - 'version' => '1.4.4.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../mockery/mockery', - 'aliases' => array(), - 'reference' => 'e01123a0e847d52d186c5eb4b9bf58b0c6d00346', - 'dev_requirement' => true, - ), - 'myclabs/deep-copy' => array( - 'pretty_version' => '1.10.2', - 'version' => '1.10.2.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../myclabs/deep-copy', - 'aliases' => array(), - 'reference' => '776f831124e9c62e1a2c601ecc52e776d8bb7220', - 'dev_requirement' => true, - ), - 'nette/bootstrap' => array( - 'pretty_version' => 'v3.1.2', - 'version' => '3.1.2.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../nette/bootstrap', - 'aliases' => array(), - 'reference' => '3ab4912a08af0c16d541c3709935c3478b5ee090', - 'dev_requirement' => true, - ), - 'nette/di' => array( - 'pretty_version' => 'v3.0.12', - 'version' => '3.0.12.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../nette/di', - 'aliases' => array(), - 'reference' => '11c236b9f7bbfc5a95e7b24742ad8847936feeb5', - 'dev_requirement' => true, - ), - 'nette/finder' => array( - 'pretty_version' => 'v2.5.3', - 'version' => '2.5.3.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../nette/finder', - 'aliases' => array(), - 'reference' => '64dc25b7929b731e72a1bc84a9e57727f5d5d3e8', - 'dev_requirement' => true, - ), - 'nette/neon' => array( - 'pretty_version' => 'v3.3.2', - 'version' => '3.3.2.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../nette/neon', - 'aliases' => array(), - 'reference' => '54b287d8c2cdbe577b02e28ca1713e275b05ece2', - 'dev_requirement' => true, - ), - 'nette/php-generator' => array( - 'pretty_version' => 'v3.6.5', - 'version' => '3.6.5.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../nette/php-generator', - 'aliases' => array(), - 'reference' => '9370403f9d9c25b51c4596ded1fbfe70347f7c82', - 'dev_requirement' => true, - ), - 'nette/robot-loader' => array( - 'pretty_version' => 'v3.4.1', - 'version' => '3.4.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../nette/robot-loader', - 'aliases' => array(), - 'reference' => 'e2adc334cb958164c050f485d99c44c430f51fe2', - 'dev_requirement' => true, - ), - 'nette/schema' => array( - 'pretty_version' => 'v1.2.2', - 'version' => '1.2.2.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../nette/schema', - 'aliases' => array(), - 'reference' => '9a39cef03a5b34c7de64f551538cbba05c2be5df', - 'dev_requirement' => true, - ), - 'nette/utils' => array( - 'pretty_version' => 'v3.2.6', - 'version' => '3.2.6.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../nette/utils', - 'aliases' => array(), - 'reference' => '2f261e55bd6a12057442045bf2c249806abc1d02', - 'dev_requirement' => true, - ), - 'nikic/php-parser' => array( - 'pretty_version' => 'v4.13.2', - 'version' => '4.13.2.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../nikic/php-parser', - 'aliases' => array(), - 'reference' => '210577fe3cf7badcc5814d99455df46564f3c077', - 'dev_requirement' => true, - ), - 'ocramius/package-versions' => array( - 'dev_requirement' => true, - 'replaced' => array( - 0 => '1.11.99', - ), - ), - 'phar-io/manifest' => array( - 'pretty_version' => '2.0.3', - 'version' => '2.0.3.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../phar-io/manifest', - 'aliases' => array(), - 'reference' => '97803eca37d319dfa7826cc2437fc020857acb53', - 'dev_requirement' => true, - ), - 'phar-io/version' => array( - 'pretty_version' => '3.1.0', - 'version' => '3.1.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../phar-io/version', - 'aliases' => array(), - 'reference' => 'bae7c545bef187884426f042434e561ab1ddb182', - 'dev_requirement' => true, - ), - 'php-parallel-lint/php-parallel-lint' => array( - 'pretty_version' => 'v1.3.1', - 'version' => '1.3.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../php-parallel-lint/php-parallel-lint', - 'aliases' => array(), - 'reference' => '761f3806e30239b5fcd90a0a45d41dc2138de192', - 'dev_requirement' => true, - ), - 'phpdocumentor/reflection-common' => array( - 'pretty_version' => '2.2.0', - 'version' => '2.2.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../phpdocumentor/reflection-common', - 'aliases' => array(), - 'reference' => '1d01c49d4ed62f25aa84a747ad35d5a16924662b', - 'dev_requirement' => true, - ), - 'phpdocumentor/reflection-docblock' => array( - 'pretty_version' => '5.1.0', - 'version' => '5.1.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../phpdocumentor/reflection-docblock', - 'aliases' => array(), - 'reference' => 'cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e', - 'dev_requirement' => true, - ), - 'phpdocumentor/type-resolver' => array( - 'pretty_version' => '1.5.1', - 'version' => '1.5.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../phpdocumentor/type-resolver', - 'aliases' => array(), - 'reference' => 'a12f7e301eb7258bb68acd89d4aefa05c2906cae', - 'dev_requirement' => true, - ), - 'phpoption/phpoption' => array( - 'pretty_version' => '1.8.1', - 'version' => '1.8.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../phpoption/phpoption', - 'aliases' => array(), - 'reference' => 'eab7a0df01fe2344d172bff4cd6dbd3f8b84ad15', - 'dev_requirement' => true, - ), - 'phpspec/prophecy' => array( - 'pretty_version' => '1.11.1', - 'version' => '1.11.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../phpspec/prophecy', - 'aliases' => array(), - 'reference' => 'b20034be5efcdab4fb60ca3a29cba2949aead160', - 'dev_requirement' => true, - ), - 'phpstan/phpdoc-parser' => array( - 'pretty_version' => '0.3.5', - 'version' => '0.3.5.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../phpstan/phpdoc-parser', - 'aliases' => array(), - 'reference' => '8c4ef2aefd9788238897b678a985e1d5c8df6db4', - 'dev_requirement' => true, - ), - 'phpstan/phpstan' => array( - 'pretty_version' => '0.11.20', - 'version' => '0.11.20.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../phpstan/phpstan', - 'aliases' => array(), - 'reference' => '938dcc03a005280e1a9587ec7684345bff06ebfc', - 'dev_requirement' => true, - ), - 'phpstan/phpstan-mockery' => array( - 'pretty_version' => '0.11.3', - 'version' => '0.11.3.0', - 'type' => 'phpstan-extension', - 'install_path' => __DIR__ . '/../phpstan/phpstan-mockery', - 'aliases' => array(), - 'reference' => '8f3f0dc0bbc8c413224459a25f89a2cef5924871', - 'dev_requirement' => true, - ), - 'phpunit/php-code-coverage' => array( - 'pretty_version' => '7.0.15', - 'version' => '7.0.15.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../phpunit/php-code-coverage', - 'aliases' => array(), - 'reference' => '819f92bba8b001d4363065928088de22f25a3a48', - 'dev_requirement' => true, - ), - 'phpunit/php-file-iterator' => array( - 'pretty_version' => '2.0.5', - 'version' => '2.0.5.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../phpunit/php-file-iterator', - 'aliases' => array(), - 'reference' => '42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5', - 'dev_requirement' => true, - ), - 'phpunit/php-text-template' => array( - 'pretty_version' => '1.2.1', - 'version' => '1.2.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../phpunit/php-text-template', - 'aliases' => array(), - 'reference' => '31f8b717e51d9a2afca6c9f046f5d69fc27c8686', - 'dev_requirement' => true, - ), - 'phpunit/php-timer' => array( - 'pretty_version' => '2.1.3', - 'version' => '2.1.3.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../phpunit/php-timer', - 'aliases' => array(), - 'reference' => '2454ae1765516d20c4ffe103d85a58a9a3bd5662', - 'dev_requirement' => true, - ), - 'phpunit/php-token-stream' => array( - 'pretty_version' => '4.0.4', - 'version' => '4.0.4.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../phpunit/php-token-stream', - 'aliases' => array(), - 'reference' => 'a853a0e183b9db7eed023d7933a858fa1c8d25a3', - 'dev_requirement' => true, - ), - 'phpunit/phpunit' => array( - 'pretty_version' => '8.5.22', - 'version' => '8.5.22.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../phpunit/phpunit', - 'aliases' => array(), - 'reference' => 'ddd05b9d844260353895a3b950a9258126c11503', - 'dev_requirement' => true, - ), - 'psr/container' => array( - 'pretty_version' => '1.1.2', - 'version' => '1.1.2.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../psr/container', - 'aliases' => array(), - 'reference' => '513e0666f7216c7459170d56df27dfcefe1689ea', - 'dev_requirement' => true, - ), - 'psr/http-client' => array( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../psr/http-client', - 'aliases' => array(), - 'reference' => '2dfb5f6c5eff0e91e20e913f8c5452ed95b86621', - 'dev_requirement' => false, - ), - 'psr/http-client-implementation' => array( - 'dev_requirement' => false, - 'provided' => array( - 0 => '1.0', - ), - ), - 'psr/http-factory' => array( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../psr/http-factory', - 'aliases' => array(), - 'reference' => '12ac7fcd07e5b077433f5f2bee95b3a771bf61be', - 'dev_requirement' => false, - ), - 'psr/http-factory-implementation' => array( - 'dev_requirement' => false, - 'provided' => array( - 0 => '1.0', - ), - ), - 'psr/http-message' => array( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../psr/http-message', - 'aliases' => array(), - 'reference' => 'f6561bf28d520154e4b0ec72be95418abe6d9363', - 'dev_requirement' => false, - ), - 'psr/http-message-implementation' => array( - 'dev_requirement' => false, - 'provided' => array( - 0 => '1.0', - ), - ), - 'psr/log' => array( - 'pretty_version' => '1.1.4', - 'version' => '1.1.4.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../psr/log', - 'aliases' => array(), - 'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11', - 'dev_requirement' => true, - ), - 'psr/log-implementation' => array( - 'dev_requirement' => true, - 'provided' => array( - 0 => '1.0|2.0', - ), - ), - 'ralouphie/getallheaders' => array( - 'pretty_version' => '3.0.3', - 'version' => '3.0.3.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../ralouphie/getallheaders', - 'aliases' => array(), - 'reference' => '120b605dfeb996808c31b6477290a714d356e822', - 'dev_requirement' => false, - ), - 'sebastian/code-unit-reverse-lookup' => array( - 'pretty_version' => '1.0.2', - 'version' => '1.0.2.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../sebastian/code-unit-reverse-lookup', - 'aliases' => array(), - 'reference' => '1de8cd5c010cb153fcd68b8d0f64606f523f7619', - 'dev_requirement' => true, - ), - 'sebastian/comparator' => array( - 'pretty_version' => '3.0.3', - 'version' => '3.0.3.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../sebastian/comparator', - 'aliases' => array(), - 'reference' => '1071dfcef776a57013124ff35e1fc41ccd294758', - 'dev_requirement' => true, - ), - 'sebastian/diff' => array( - 'pretty_version' => '3.0.3', - 'version' => '3.0.3.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../sebastian/diff', - 'aliases' => array(), - 'reference' => '14f72dd46eaf2f2293cbe79c93cc0bc43161a211', - 'dev_requirement' => true, - ), - 'sebastian/environment' => array( - 'pretty_version' => '4.2.4', - 'version' => '4.2.4.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../sebastian/environment', - 'aliases' => array(), - 'reference' => 'd47bbbad83711771f167c72d4e3f25f7fcc1f8b0', - 'dev_requirement' => true, - ), - 'sebastian/exporter' => array( - 'pretty_version' => '3.1.4', - 'version' => '3.1.4.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../sebastian/exporter', - 'aliases' => array(), - 'reference' => '0c32ea2e40dbf59de29f3b49bf375176ce7dd8db', - 'dev_requirement' => true, - ), - 'sebastian/global-state' => array( - 'pretty_version' => '3.0.1', - 'version' => '3.0.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../sebastian/global-state', - 'aliases' => array(), - 'reference' => '474fb9edb7ab891665d3bfc6317f42a0a150454b', - 'dev_requirement' => true, - ), - 'sebastian/object-enumerator' => array( - 'pretty_version' => '3.0.4', - 'version' => '3.0.4.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../sebastian/object-enumerator', - 'aliases' => array(), - 'reference' => 'e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2', - 'dev_requirement' => true, - ), - 'sebastian/object-reflector' => array( - 'pretty_version' => '1.1.2', - 'version' => '1.1.2.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../sebastian/object-reflector', - 'aliases' => array(), - 'reference' => '9b8772b9cbd456ab45d4a598d2dd1a1bced6363d', - 'dev_requirement' => true, - ), - 'sebastian/recursion-context' => array( - 'pretty_version' => '3.0.1', - 'version' => '3.0.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../sebastian/recursion-context', - 'aliases' => array(), - 'reference' => '367dcba38d6e1977be014dc4b22f47a484dac7fb', - 'dev_requirement' => true, - ), - 'sebastian/resource-operations' => array( - 'pretty_version' => '2.0.2', - 'version' => '2.0.2.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../sebastian/resource-operations', - 'aliases' => array(), - 'reference' => '31d35ca87926450c44eae7e2611d45a7a65ea8b3', - 'dev_requirement' => true, - ), - 'sebastian/type' => array( - 'pretty_version' => '1.1.4', - 'version' => '1.1.4.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../sebastian/type', - 'aliases' => array(), - 'reference' => '0150cfbc4495ed2df3872fb31b26781e4e077eb4', - 'dev_requirement' => true, - ), - 'sebastian/version' => array( - 'pretty_version' => '2.0.1', - 'version' => '2.0.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../sebastian/version', - 'aliases' => array(), - 'reference' => '99732be0ddb3361e16ad77b68ba41efc8e979019', - 'dev_requirement' => true, - ), - 'squizlabs/php_codesniffer' => array( - 'pretty_version' => '3.6.2', - 'version' => '3.6.2.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../squizlabs/php_codesniffer', - 'aliases' => array(), - 'reference' => '5e4e71592f69da17871dba6e80dd51bce74a351a', - 'dev_requirement' => true, - ), - 'symfony/console' => array( - 'pretty_version' => 'v4.4.36', - 'version' => '4.4.36.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/console', - 'aliases' => array(), - 'reference' => '621379b62bb19af213b569b60013200b11dd576f', - 'dev_requirement' => true, - ), - 'symfony/deprecation-contracts' => array( - 'pretty_version' => 'v2.5.0', - 'version' => '2.5.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', - 'aliases' => array(), - 'reference' => '6f981ee24cf69ee7ce9736146d1c57c2780598a8', - 'dev_requirement' => false, - ), - 'symfony/finder' => array( - 'pretty_version' => 'v4.4.36', - 'version' => '4.4.36.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/finder', - 'aliases' => array(), - 'reference' => '1fef05633cd61b629e963e5d8200fb6b67ecf42c', - 'dev_requirement' => true, - ), - 'symfony/polyfill-ctype' => array( - 'pretty_version' => 'v1.23.0', - 'version' => '1.23.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-ctype', - 'aliases' => array(), - 'reference' => '46cd95797e9df938fdd2b03693b5fca5e64b01ce', - 'dev_requirement' => true, - ), - 'symfony/polyfill-mbstring' => array( - 'pretty_version' => 'v1.23.1', - 'version' => '1.23.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', - 'aliases' => array(), - 'reference' => '9174a3d80210dca8daa7f31fec659150bbeabfc6', - 'dev_requirement' => true, - ), - 'symfony/polyfill-php73' => array( - 'pretty_version' => 'v1.23.0', - 'version' => '1.23.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-php73', - 'aliases' => array(), - 'reference' => 'fba8933c384d6476ab14fb7b8526e5287ca7e010', - 'dev_requirement' => true, - ), - 'symfony/polyfill-php80' => array( - 'pretty_version' => 'v1.23.1', - 'version' => '1.23.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-php80', - 'aliases' => array(), - 'reference' => '1100343ed1a92e3a38f9ae122fc0eb21602547be', - 'dev_requirement' => true, - ), - 'symfony/service-contracts' => array( - 'pretty_version' => 'v2.5.0', - 'version' => '2.5.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/service-contracts', - 'aliases' => array(), - 'reference' => '1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc', - 'dev_requirement' => true, - ), - 'theseer/tokenizer' => array( - 'pretty_version' => '1.2.1', - 'version' => '1.2.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../theseer/tokenizer', - 'aliases' => array(), - 'reference' => '34a41e998c2183e22995f158c581e7b5e755ab9e', - 'dev_requirement' => true, - ), - 'vlucas/phpdotenv' => array( - 'pretty_version' => 'v5.4.1', - 'version' => '5.4.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../vlucas/phpdotenv', - 'aliases' => array(), - 'reference' => '264dce589e7ce37a7ba99cb901eed8249fbec92f', - 'dev_requirement' => true, - ), - 'webmozart/assert' => array( - 'pretty_version' => '1.8.0', - 'version' => '1.8.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../webmozart/assert', - 'aliases' => array(), - 'reference' => 'ab2cb0b3b559010b75981b1bdce728da3ee90ad6', - 'dev_requirement' => true, - ), - ), -); diff --git a/vendor/composer/package-versions-deprecated/CHANGELOG.md b/vendor/composer/package-versions-deprecated/CHANGELOG.md deleted file mode 100644 index a838c56..0000000 --- a/vendor/composer/package-versions-deprecated/CHANGELOG.md +++ /dev/null @@ -1,120 +0,0 @@ -# CHANGELOG - -## 1.1.3 - 2017-09-06 - -This release fixes a bug that caused PackageVersions to prevent -the `composer remove` and `composer update` commands to fail when -this package is removed. - -In addition to that, mutation testing has been added to the suite, -ensuring that the package is accurately and extensively tested. - -Total issues resolved: **3** - -- [40: Mutation testing, PHP 7.1 testing](https://github.com/Ocramius/PackageVersions/pull/40) thanks to @Ocramius -- [41: Removing this package on install results in file access error](https://github.com/Ocramius/PackageVersions/issues/41) thanks to @Xerkus -- [46: #41 Avoid issues when the package is scheduled for removal](https://github.com/Ocramius/PackageVersions/pull/46) thanks to @Jean85 - -## 1.1.2 - 2016-12-30 - -This release fixes a bug that caused PackageVersions to be enabled -even when it was part of a globally installed package. - -Total issues resolved: **3** - -- [35: remove all temp directories](https://github.com/Ocramius/PackageVersions/pull/35) -- [38: Interferes with other projects when installed globally](https://github.com/Ocramius/PackageVersions/issues/38) -- [39: Ignore the global plugin when updating local projects](https://github.com/Ocramius/PackageVersions/pull/39) - -## 1.1.1 - 2016-07-25 - -This release removes the [`"files"`](https://getcomposer.org/doc/04-schema.md#files) directive from -[`composer.json`](https://github.com/Ocramius/PackageVersions/commit/86f2636f7c5e7b56fa035fa3826d5fcf80b6dc72), -as it is no longer needed for `composer install --classmap-authoritative`. -Also, that directive was causing issues with HHVM installations, since -PackageVersions is not compatible with it. - -Total issues resolved: **1** - -- [34: Fatal error during travis build after update to 1.1.0](https://github.com/Ocramius/PackageVersions/issues/34) - -## 1.1.0 - 2016-07-22 - -This release introduces support for running `composer install --classmap-authoritative` -and `composer install --no-scripts`. Please note that performance -while using these modes may be degraded, but the package will -still work. - -Additionally, the package was tuned to prevent the plugin from -running twice at installation. - -Total issues resolved: **10** - -- [18: Fails when using composer install --no-scripts](https://github.com/Ocramius/PackageVersions/issues/18) -- [20: CS (spacing)](https://github.com/Ocramius/PackageVersions/pull/20) -- [22: Document the way the require-dev section is treated](https://github.com/Ocramius/PackageVersions/issues/22) -- [23: Underline that composer.lock is used as source of information](https://github.com/Ocramius/PackageVersions/pull/23) -- [27: Fix incompatibility with --classmap-authoritative](https://github.com/Ocramius/PackageVersions/pull/27) -- [29: mention optimize-autoloader composer.json config option in README](https://github.com/Ocramius/PackageVersions/pull/29) -- [30: The version class is generated twice during composer update](https://github.com/Ocramius/PackageVersions/issues/30) -- [31: Remove double registration of the event listeners](https://github.com/Ocramius/PackageVersions/pull/31) -- [32: Update the usage of mock APIs to use the new API](https://github.com/Ocramius/PackageVersions/pull/32) -- [33: Fix for #18 - support running with --no-scripts flag](https://github.com/Ocramius/PackageVersions/pull/33) - -## 1.0.4 - 2016-04-23 - -This release includes a fix/workaround for composer/composer#5237, -which causes `ocramius/package-versions` to sometimes generate a -`Versions` class with malformed name (something like -`Versions_composer_tmp0`) when running `composer require `. - -Total issues resolved: **2** - -- [16: Workaround for composer/composer#5237 - class parsing](https://github.com/Ocramius/PackageVersions/pull/16) -- [17: Weird Class name being generated](https://github.com/Ocramius/PackageVersions/issues/17) - -## 1.0.3 - 2016-02-26 - -This release fixes an issue related to concurrent autoloader -re-generation caused by multiple composer plugins being installed. -The issue was solved by removing autoloader re-generation from this -package, but it may still affect other packages. - -It is now recommended that you run `composer dump-autoload --optimize` -after installation when using this particular package. -Please note that `composer (install|update) -o` is not sufficient -to avoid autoload overhead when using this particular package. - -Total issues resolved: **1** - -- [15: Remove autoload re-dump optimization](https://github.com/Ocramius/PackageVersions/pull/15) - -## 1.0.2 - 2016-02-24 - -This release fixes issues related to installing the component without -any dev dependencies or with packages that don't have a source or dist -reference, which is usual with packages defined directly in the -`composer.json`. - -Total issues resolved: **3** - -- [11: fix composer install --no-dev PHP7](https://github.com/Ocramius/PackageVersions/pull/11) -- [12: Packages don't always have a source/reference](https://github.com/Ocramius/PackageVersions/issues/12) -- [13: Fix #12 - support dist and missing package version references](https://github.com/Ocramius/PackageVersions/pull/13) - -## 1.0.1 - 2016-02-01 - -This release fixes an issue related with composer updates to -already installed versions. -Using `composer require` within a package that already used -`ocramius/package-versions` caused the installation to be unable -to write the `PackageVersions\Versions` class to a file. - -Total issues resolved: **6** - -- [2: remove unused use statement](https://github.com/Ocramius/PackageVersions/pull/2) -- [3: Remove useless files from dist package](https://github.com/Ocramius/PackageVersions/pull/3) -- [5: failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly](https://github.com/Ocramius/PackageVersions/issues/5) -- [6: Fix/#5 use composer vendor dir](https://github.com/Ocramius/PackageVersions/pull/6) -- [7: Hotfix - #5 generate package versions also when in phar context](https://github.com/Ocramius/PackageVersions/pull/7) -- [8: Versions class should be ignored by VCS, as it is an install-time artifact](https://github.com/Ocramius/PackageVersions/pull/8) diff --git a/vendor/composer/package-versions-deprecated/CONTRIBUTING.md b/vendor/composer/package-versions-deprecated/CONTRIBUTING.md deleted file mode 100644 index 7180617..0000000 --- a/vendor/composer/package-versions-deprecated/CONTRIBUTING.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -title: Contributing ---- - -# Contributing - - * Coding standard for the project is [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) - * The project will follow strict [object calisthenics](http://www.slideshare.net/guilhermeblanco/object-calisthenics-applied-to-php) - * Any contribution must provide tests for additional introduced conditions - * Any un-confirmed issue needs a failing test case before being accepted - * Pull requests must be sent from a new hotfix/feature branch, not from `master`. - -## Installation - -To install the project and run the tests, you need to clone it first: - -```sh -$ git clone git://github.com/Ocramius/PackageVersions.git -``` - -You will then need to run a composer installation: - -```sh -$ cd PackageVersions -$ curl -s https://getcomposer.org/installer | php -$ php composer.phar update -``` - -## Testing - -The PHPUnit version to be used is the one installed as a dev- dependency via composer: - -```sh -$ ./vendor/bin/phpunit -``` - -Accepted coverage for new contributions is 80%. Any contribution not satisfying this requirement -won't be merged. - diff --git a/vendor/composer/package-versions-deprecated/LICENSE b/vendor/composer/package-versions-deprecated/LICENSE deleted file mode 100644 index a90b079..0000000 --- a/vendor/composer/package-versions-deprecated/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2016 Marco Pivetta - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/composer/package-versions-deprecated/README.md b/vendor/composer/package-versions-deprecated/README.md deleted file mode 100644 index 7fe2097..0000000 --- a/vendor/composer/package-versions-deprecated/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Package Versions - -**`composer/package-versions-deprecated` is a fully-compatible fork of [`ocramius/package-versions`](https://github.com/Ocramius/PackageVersions)** which provides compatibility with Composer 1 and 2 on PHP 7+. It replaces ocramius/package-versions so if you have a dependency requiring it and you want to use Composer v2 but can not upgrade to PHP 7.4 just yet, you can require this package instead. - -If you have a direct dependency on ocramius/package-versions, we recommend instead that once you migrated to Composer 2 you also migrate to use the `Composer\InstalledVersions` class which offers the functionality present here out of the box. diff --git a/vendor/composer/package-versions-deprecated/SECURITY.md b/vendor/composer/package-versions-deprecated/SECURITY.md deleted file mode 100644 index da9c516..0000000 --- a/vendor/composer/package-versions-deprecated/SECURITY.md +++ /dev/null @@ -1,5 +0,0 @@ -## Security contact information - -To report a security vulnerability, please use the -[Tidelift security contact](https://tidelift.com/security). -Tidelift will coordinate the fix and disclosure. diff --git a/vendor/composer/package-versions-deprecated/composer.json b/vendor/composer/package-versions-deprecated/composer.json deleted file mode 100644 index d5a40da..0000000 --- a/vendor/composer/package-versions-deprecated/composer.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "composer/package-versions-deprecated", - "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", - "type": "composer-plugin", - "license": "MIT", - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be" - } - ], - "require": { - "php": "^7 || ^8", - "composer-plugin-api": "^1.1.0 || ^2.0" - }, - "replace": { - "ocramius/package-versions": "1.11.99" - }, - "require-dev": { - "phpunit/phpunit": "^6.5 || ^7", - "composer/composer": "^1.9.3 || ^2.0@dev", - "ext-zip": "^1.13" - }, - "autoload": { - "psr-4": { - "PackageVersions\\": "src/PackageVersions" - } - }, - "autoload-dev": { - "psr-4": { - "PackageVersionsTest\\": "test/PackageVersionsTest" - } - }, - "extra": { - "class": "PackageVersions\\Installer", - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "scripts": { - "post-update-cmd": "PackageVersions\\Installer::dumpVersionsClass", - "post-install-cmd": "PackageVersions\\Installer::dumpVersionsClass" - } -} diff --git a/vendor/composer/package-versions-deprecated/composer.lock b/vendor/composer/package-versions-deprecated/composer.lock deleted file mode 100644 index b711f6b..0000000 --- a/vendor/composer/package-versions-deprecated/composer.lock +++ /dev/null @@ -1,2603 +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": "6bfe0a7d7a51c4bdf14a2d7ea1d22d11", - "packages": [], - "packages-dev": [ - { - "name": "composer/ca-bundle", - "version": "1.2.7", - "source": { - "type": "git", - "url": "https://github.com/composer/ca-bundle.git", - "reference": "95c63ab2117a72f48f5a55da9740a3273d45b7fd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/95c63ab2117a72f48f5a55da9740a3273d45b7fd", - "reference": "95c63ab2117a72f48f5a55da9740a3273d45b7fd", - "shasum": "" - }, - "require": { - "ext-openssl": "*", - "ext-pcre": "*", - "php": "^5.3.2 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8", - "psr/log": "^1.0", - "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\CaBundle\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", - "keywords": [ - "cabundle", - "cacert", - "certificate", - "ssl", - "tls" - ], - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2020-04-08T08:27:21+00:00" - }, - { - "name": "composer/composer", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/composer/composer.git", - "reference": "a8c105da344dd84ebd5d11be7943a45b09dc076f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/a8c105da344dd84ebd5d11be7943a45b09dc076f", - "reference": "a8c105da344dd84ebd5d11be7943a45b09dc076f", - "shasum": "" - }, - "require": { - "composer/ca-bundle": "^1.0", - "composer/semver": "^1.0", - "composer/spdx-licenses": "^1.2", - "composer/xdebug-handler": "^1.1", - "justinrainbow/json-schema": "^3.0 || ^4.0 || ^5.0", - "php": "^5.3.2 || ^7.0", - "psr/log": "^1.0", - "seld/jsonlint": "^1.4", - "seld/phar-utils": "^1.0", - "symfony/console": "^2.7 || ^3.0 || ^4.0 || ^5.0", - "symfony/filesystem": "^2.7 || ^3.0 || ^4.0 || ^5.0", - "symfony/finder": "^2.7 || ^3.0 || ^4.0 || ^5.0", - "symfony/process": "^2.7 || ^3.0 || ^4.0 || ^5.0" - }, - "conflict": { - "symfony/console": "2.8.38" - }, - "require-dev": { - "phpspec/prophecy": "^1.10", - "symfony/phpunit-bridge": "^3.4" - }, - "suggest": { - "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages", - "ext-zip": "Enabling the zip extension allows you to unzip archives", - "ext-zlib": "Allow gzip compression of HTTP requests" - }, - "bin": [ - "bin/composer" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\": "src/Composer" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "Composer helps you declare, manage and install dependencies of PHP projects. It ensures you have the right stack everywhere.", - "homepage": "https://getcomposer.org/", - "keywords": [ - "autoload", - "dependency", - "package" - ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/composer/issues", - "source": "https://github.com/composer/composer/tree/master" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2020-03-29T14:59:26+00:00" - }, - { - "name": "composer/semver", - "version": "1.5.1", - "source": { - "type": "git", - "url": "https://github.com/composer/semver.git", - "reference": "c6bea70230ef4dd483e6bbcab6005f682ed3a8de" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/c6bea70230ef4dd483e6bbcab6005f682ed3a8de", - "reference": "c6bea70230ef4dd483e6bbcab6005f682ed3a8de", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.5 || ^5.0.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Semver\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - }, - { - "name": "Rob Bast", - "email": "rob.bast@gmail.com", - "homepage": "http://robbast.nl" - } - ], - "description": "Semver library that offers utilities, version constraint parsing and validation.", - "keywords": [ - "semantic", - "semver", - "validation", - "versioning" - ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/1.5.1" - }, - "time": "2020-01-13T12:06:48+00:00" - }, - { - "name": "composer/spdx-licenses", - "version": "1.5.3", - "source": { - "type": "git", - "url": "https://github.com/composer/spdx-licenses.git", - "reference": "0c3e51e1880ca149682332770e25977c70cf9dae" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/0c3e51e1880ca149682332770e25977c70cf9dae", - "reference": "0c3e51e1880ca149682332770e25977c70cf9dae", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 7" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Spdx\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - }, - { - "name": "Rob Bast", - "email": "rob.bast@gmail.com", - "homepage": "http://robbast.nl" - } - ], - "description": "SPDX licenses list and validation library.", - "keywords": [ - "license", - "spdx", - "validator" - ], - "time": "2020-02-14T07:44:31+00:00" - }, - { - "name": "composer/xdebug-handler", - "version": "1.4.1", - "source": { - "type": "git", - "url": "https://github.com/composer/xdebug-handler.git", - "reference": "1ab9842d69e64fb3a01be6b656501032d1b78cb7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/1ab9842d69e64fb3a01be6b656501032d1b78cb7", - "reference": "1ab9842d69e64fb3a01be6b656501032d1b78cb7", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0 || ^8.0", - "psr/log": "^1.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8" - }, - "type": "library", - "autoload": { - "psr-4": { - "Composer\\XdebugHandler\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "John Stevenson", - "email": "john-stevenson@blueyonder.co.uk" - } - ], - "description": "Restarts a process without Xdebug.", - "keywords": [ - "Xdebug", - "performance" - ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/master" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - } - ], - "time": "2020-03-01T12:26:26+00:00" - }, - { - "name": "doctrine/instantiator", - "version": "1.3.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "ae466f726242e637cebdd526a7d991b9433bacf1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/ae466f726242e637cebdd526a7d991b9433bacf1", - "reference": "ae466f726242e637cebdd526a7d991b9433bacf1", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "require-dev": { - "doctrine/coding-standard": "^6.0", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^0.13", - "phpstan/phpstan-phpunit": "^0.11", - "phpstan/phpstan-shim": "^0.11", - "phpunit/phpunit": "^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "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": "http://ocramius.github.com/" - } - ], - "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/master" - }, - "time": "2019-10-21T16:45:58+00:00" - }, - { - "name": "justinrainbow/json-schema", - "version": "5.2.9", - "source": { - "type": "git", - "url": "https://github.com/justinrainbow/json-schema.git", - "reference": "44c6787311242a979fa15c704327c20e7221a0e4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/44c6787311242a979fa15c704327c20e7221a0e4", - "reference": "44c6787311242a979fa15c704327c20e7221a0e4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "~2.2.20||~2.15.1", - "json-schema/json-schema-test-suite": "1.2.0", - "phpunit/phpunit": "^4.8.35" - }, - "bin": [ - "bin/validate-json" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "JsonSchema\\": "src/JsonSchema/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bruno Prieto Reis", - "email": "bruno.p.reis@gmail.com" - }, - { - "name": "Justin Rainbow", - "email": "justin.rainbow@gmail.com" - }, - { - "name": "Igor Wiedler", - "email": "igor@wiedler.ch" - }, - { - "name": "Robert Schönthal", - "email": "seroscho@googlemail.com" - } - ], - "description": "A library to validate a json schema.", - "homepage": "https://github.com/justinrainbow/json-schema", - "keywords": [ - "json", - "schema" - ], - "support": { - "issues": "https://github.com/justinrainbow/json-schema/issues", - "source": "https://github.com/justinrainbow/json-schema/tree/5.2.9" - }, - "time": "2019-09-25T14:49:45+00:00" - }, - { - "name": "myclabs/deep-copy", - "version": "1.9.5", - "source": { - "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/b2c28789e80a97badd14145fda39b545d83ca3ef", - "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "replace": { - "myclabs/deep-copy": "self.version" - }, - "require-dev": { - "doctrine/collections": "^1.0", - "doctrine/common": "^2.6", - "phpunit/phpunit": "^7.1" - }, - "type": "library", - "autoload": { - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - }, - "files": [ - "src/DeepCopy/deep_copy.php" - ] - }, - "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.9.5" - }, - "time": "2020-01-17T21:11:47+00:00" - }, - { - "name": "phar-io/manifest", - "version": "1.0.3", - "source": { - "type": "git", - "url": "https://github.com/phar-io/manifest.git", - "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", - "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-phar": "*", - "phar-io/version": "^2.0", - "php": "^5.6 || ^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.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)", - "time": "2018-07-08T19:23:20+00:00" - }, - { - "name": "phar-io/version", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/phar-io/version.git", - "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/45a2ec53a73c70ce41d55cedef9063630abaf1b6", - "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.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", - "time": "2018-07-08T19:19:57+00:00" - }, - { - "name": "phpdocumentor/reflection-common", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/63a995caa1ca9e5590304cd845c15ad6d482a62a", - "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "~6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", - "time": "2018-08-07T13:53:10+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "5.1.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e", - "reference": "cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e", - "shasum": "" - }, - "require": { - "ext-filter": "^7.1", - "php": "^7.2", - "phpdocumentor/reflection-common": "^2.0", - "phpdocumentor/type-resolver": "^1.0", - "webmozart/assert": "^1" - }, - "require-dev": { - "doctrine/instantiator": "^1", - "mockery/mockery": "^1" - }, - "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.", - "time": "2020-02-22T12:28:44+00:00" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "1.1.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "7462d5f123dfc080dfdf26897032a6513644fc95" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/7462d5f123dfc080dfdf26897032a6513644fc95", - "reference": "7462d5f123dfc080dfdf26897032a6513644fc95", - "shasum": "" - }, - "require": { - "php": "^7.2", - "phpdocumentor/reflection-common": "^2.0" - }, - "require-dev": { - "ext-tokenizer": "^7.2", - "mockery/mockery": "~1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "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/master" - }, - "time": "2020-02-18T18:59:58+00:00" - }, - { - "name": "phpspec/prophecy", - "version": "v1.10.3", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "451c3cd1418cf640de218914901e51b064abb093" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/451c3cd1418cf640de218914901e51b064abb093", - "reference": "451c3cd1418cf640de218914901e51b064abb093", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", - "sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0", - "sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0" - }, - "require-dev": { - "phpspec/phpspec": "^2.5 || ^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10.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.10.3" - }, - "time": "2020-03-05T15:02:03+00:00" - }, - { - "name": "phpunit/php-code-coverage", - "version": "6.1.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", - "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-xmlwriter": "*", - "php": "^7.1", - "phpunit/php-file-iterator": "^2.0", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^3.0", - "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^3.1 || ^4.0", - "sebastian/version": "^2.0.1", - "theseer/tokenizer": "^1.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.0" - }, - "suggest": { - "ext-xdebug": "^2.6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "6.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": "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" - ], - "time": "2018-10-31T16:06:48+00:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "050bedf145a257b1ff02746c31894800e5122946" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/050bedf145a257b1ff02746c31894800e5122946", - "reference": "050bedf145a257b1ff02746c31894800e5122946", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.1" - }, - "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": "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" - ], - "time": "2018-09-13T20:33:42+00:00" - }, - { - "name": "phpunit/php-text-template", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "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" - ], - "time": "2015-06-21T13:50:34+00:00" - }, - { - "name": "phpunit/php-timer", - "version": "2.1.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "1038454804406b0b5f5f520358e78c1c2f71501e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/1038454804406b0b5f5f520358e78c1c2f71501e", - "reference": "1038454804406b0b5f5f520358e78c1c2f71501e", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.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": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "time": "2019-06-07T04:22:29+00:00" - }, - { - "name": "phpunit/php-token-stream", - "version": "3.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/995192df77f63a59e47f025390d2d1fdf8f425ff", - "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": "^7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.0" - }, - "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" - } - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "time": "2019-09-17T06:23:10+00:00" - }, - { - "name": "phpunit/phpunit", - "version": "7.5.20", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "9467db479d1b0487c99733bb1e7944d32deded2c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9467db479d1b0487c99733bb1e7944d32deded2c", - "reference": "9467db479d1b0487c99733bb1e7944d32deded2c", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.1", - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "myclabs/deep-copy": "^1.7", - "phar-io/manifest": "^1.0.2", - "phar-io/version": "^2.0", - "php": "^7.1", - "phpspec/prophecy": "^1.7", - "phpunit/php-code-coverage": "^6.0.7", - "phpunit/php-file-iterator": "^2.0.1", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^2.1", - "sebastian/comparator": "^3.0", - "sebastian/diff": "^3.0", - "sebastian/environment": "^4.0", - "sebastian/exporter": "^3.1", - "sebastian/global-state": "^2.0", - "sebastian/object-enumerator": "^3.0.3", - "sebastian/resource-operations": "^2.0", - "sebastian/version": "^2.0.1" - }, - "conflict": { - "phpunit/phpunit-mock-objects": "*" - }, - "require-dev": { - "ext-pdo": "*" - }, - "suggest": { - "ext-soap": "*", - "ext-xdebug": "*", - "phpunit/php-invoker": "^2.0" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "7.5-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": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "time": "2020-01-08T08:45:45+00:00" - }, - { - "name": "psr/container", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "time": "2017-02-14T16:28:37+00:00" - }, - { - "name": "psr/log", - "version": "1.1.3", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Log\\": "Psr/Log/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "time": "2020-03-23T09:12:05+00:00" - }, - { - "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.7 || ^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-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/", - "time": "2017-03-04T06:30:41+00:00" - }, - { - "name": "sebastian/comparator", - "version": "3.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/5de4fc177adf9bce8df98d8d141a7559d7ccf6da", - "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da", - "shasum": "" - }, - "require": { - "php": "^7.1", - "sebastian/diff": "^3.0", - "sebastian/exporter": "^3.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.1" - }, - "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": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "https://github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "time": "2018-07-12T15:12:46+00:00" - }, - { - "name": "sebastian/diff", - "version": "3.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/720fcc7e9b5cf384ea68d9d930d480907a0c1a29", - "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.5 || ^8.0", - "symfony/process": "^2 || ^3.3 || ^4" - }, - "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": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff", - "udiff", - "unidiff", - "unified diff" - ], - "time": "2019-02-04T06:01:07+00:00" - }, - { - "name": "sebastian/environment", - "version": "4.2.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/464c90d7bdf5ad4e8a6aea15c091fec0603d4368", - "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.5" - }, - "suggest": { - "ext-posix": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.2-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" - ], - "time": "2019-11-20T08:46:58+00:00" - }, - { - "name": "sebastian/exporter", - "version": "3.1.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/68609e1261d215ea5b21b7987539cbfbe156ec3e", - "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e", - "shasum": "" - }, - "require": { - "php": "^7.0", - "sebastian/recursion-context": "^3.0" - }, - "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1.x-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": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "time": "2019-09-14T09:02:43+00:00" - }, - { - "name": "sebastian/global-state", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", - "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", - "shasum": "" - }, - "require": { - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "suggest": { - "ext-uopz": "*" - }, - "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": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "time": "2017-04-27T15:39:26+00:00" - }, - { - "name": "sebastian/object-enumerator", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", - "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", - "shasum": "" - }, - "require": { - "php": "^7.0", - "sebastian/object-reflector": "^1.1.1", - "sebastian/recursion-context": "^3.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0.x-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/", - "time": "2017-08-03T12:35:26+00:00" - }, - { - "name": "sebastian/object-reflector", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "773f97c67f28de00d397be301821b06708fca0be" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", - "reference": "773f97c67f28de00d397be301821b06708fca0be", - "shasum": "" - }, - "require": { - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-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/", - "time": "2017-03-29T09:07:27+00:00" - }, - { - "name": "sebastian/recursion-context", - "version": "3.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", - "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", - "shasum": "" - }, - "require": { - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2017-03-03T06:23:57+00:00" - }, - { - "name": "sebastian/resource-operations", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/4d7a795d35b889bf80a0cc04e08d77cedfa917a9", - "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "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": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2018-10-04T04:07:39+00:00" - }, - { - "name": "sebastian/version", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "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": "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", - "time": "2016-10-03T07:35:21+00:00" - }, - { - "name": "seld/jsonlint", - "version": "1.7.2", - "source": { - "type": "git", - "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "e2e5d290e4d2a4f0eb449f510071392e00e10d19" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/e2e5d290e4d2a4f0eb449f510071392e00e10d19", - "reference": "e2e5d290e4d2a4f0eb449f510071392e00e10d19", - "shasum": "" - }, - "require": { - "php": "^5.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" - }, - "bin": [ - "bin/jsonlint" - ], - "type": "library", - "autoload": { - "psr-4": { - "Seld\\JsonLint\\": "src/Seld/JsonLint/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "JSON Linter", - "keywords": [ - "json", - "linter", - "parser", - "validator" - ], - "support": { - "issues": "https://github.com/Seldaek/jsonlint/issues", - "source": "https://github.com/Seldaek/jsonlint/tree/1.7.2" - }, - "time": "2019-10-24T14:27:39+00:00" - }, - { - "name": "seld/phar-utils", - "version": "1.1.0", - "source": { - "type": "git", - "url": "https://github.com/Seldaek/phar-utils.git", - "reference": "8800503d56b9867d43d9c303b9cbcc26016e82f0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/8800503d56b9867d43d9c303b9cbcc26016e82f0", - "reference": "8800503d56b9867d43d9c303b9cbcc26016e82f0", - "shasum": "" - }, - "require": { - "php": ">=5.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Seld\\PharUtils\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be" - } - ], - "description": "PHAR file format utilities, for when PHP phars you up", - "keywords": [ - "phar" - ], - "support": { - "issues": "https://github.com/Seldaek/phar-utils/issues", - "source": "https://github.com/Seldaek/phar-utils/tree/1.1.0" - }, - "time": "2020-02-14T15:25:33+00:00" - }, - { - "name": "symfony/console", - "version": "v5.0.7", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "5fa1caadc8cdaa17bcfb25219f3b53fe294a9935" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/5fa1caadc8cdaa17bcfb25219f3b53fe294a9935", - "reference": "5fa1caadc8cdaa17bcfb25219f3b53fe294a9935", - "shasum": "" - }, - "require": { - "php": "^7.2.5", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.8", - "symfony/service-contracts": "^1.1|^2" - }, - "conflict": { - "symfony/dependency-injection": "<4.4", - "symfony/event-dispatcher": "<4.4", - "symfony/lock": "<4.4", - "symfony/process": "<4.4" - }, - "provide": { - "psr/log-implementation": "1.0" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "^4.4|^5.0", - "symfony/dependency-injection": "^4.4|^5.0", - "symfony/event-dispatcher": "^4.4|^5.0", - "symfony/lock": "^4.4|^5.0", - "symfony/process": "^4.4|^5.0", - "symfony/var-dumper": "^4.4|^5.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } - }, - "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": "Symfony Console Component", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/console/tree/v5.0.7" - }, - "time": "2020-03-30T11:42:42+00:00" - }, - { - "name": "symfony/filesystem", - "version": "v5.0.7", - "source": { - "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "ca3b87dd09fff9b771731637f5379965fbfab420" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/ca3b87dd09fff9b771731637f5379965fbfab420", - "reference": "ca3b87dd09fff9b771731637f5379965fbfab420", - "shasum": "" - }, - "require": { - "php": "^7.2.5", - "symfony/polyfill-ctype": "~1.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } - }, - "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": "Symfony Filesystem Component", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.0.7" - }, - "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": "2020-03-27T16:56:45+00:00" - }, - { - "name": "symfony/finder", - "version": "v5.0.7", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "600a52c29afc0d1caa74acbec8d3095ca7e9910d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/600a52c29afc0d1caa74acbec8d3095ca7e9910d", - "reference": "600a52c29afc0d1caa74acbec8d3095ca7e9910d", - "shasum": "" - }, - "require": { - "php": "^7.2.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } - }, - "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": "Symfony Finder Component", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/finder/tree/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": "2020-03-27T16:56:45+00:00" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.15.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "4719fa9c18b0464d399f1a63bf624b42b6fa8d14" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/4719fa9c18b0464d399f1a63bf624b42b6fa8d14", - "reference": "4719fa9c18b0464d399f1a63bf624b42b6fa8d14", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.15-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "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.15.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": "2020-02-27T09:26:54+00:00" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.15.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "81ffd3a9c6d707be22e3012b827de1c9775fc5ac" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/81ffd3a9c6d707be22e3012b827de1c9775fc5ac", - "reference": "81ffd3a9c6d707be22e3012b827de1c9775fc5ac", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.15-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, - "files": [ - "bootstrap.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": "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.15.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": "2020-03-09T19:04:49+00:00" - }, - { - "name": "symfony/polyfill-php73", - "version": "v1.15.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "0f27e9f464ea3da33cbe7ca3bdf4eb66def9d0f7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/0f27e9f464ea3da33cbe7ca3bdf4eb66def9d0f7", - "reference": "0f27e9f464ea3da33cbe7ca3bdf4eb66def9d0f7", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.15-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" - }, - "files": [ - "bootstrap.php" - ], - "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.15.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": "2020-02-27T09:26:54+00:00" - }, - { - "name": "symfony/process", - "version": "v5.0.7", - "source": { - "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "c5ca4a0fc16a0c888067d43fbcfe1f8a53d8e70e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/c5ca4a0fc16a0c888067d43fbcfe1f8a53d8e70e", - "reference": "c5ca4a0fc16a0c888067d43fbcfe1f8a53d8e70e", - "shasum": "" - }, - "require": { - "php": "^7.2.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } - }, - "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": "Symfony Process Component", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/process/tree/v5.0.7" - }, - "time": "2020-03-27T16:56:45+00:00" - }, - { - "name": "symfony/service-contracts", - "version": "v2.0.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "144c5e51266b281231e947b51223ba14acf1a749" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/144c5e51266b281231e947b51223ba14acf1a749", - "reference": "144c5e51266b281231e947b51223ba14acf1a749", - "shasum": "" - }, - "require": { - "php": "^7.2.5", - "psr/container": "^1.0" - }, - "suggest": { - "symfony/service-implementation": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "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.0.1" - }, - "time": "2019-11-18T17:27:11+00:00" - }, - { - "name": "theseer/tokenizer", - "version": "1.1.3", - "source": { - "type": "git", - "url": "https://github.com/theseer/tokenizer.git", - "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/11336f6f84e16a720dae9d8e6ed5019efa85a0f9", - "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": "^7.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", - "time": "2019-06-13T22:48:21+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.8.0", - "source": { - "type": "git", - "url": "https://github.com/webmozart/assert.git", - "reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/ab2cb0b3b559010b75981b1bdce728da3ee90ad6", - "reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0", - "symfony/polyfill-ctype": "^1.8" - }, - "conflict": { - "vimeo/psalm": "<3.9.1" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.36 || ^7.5.13" - }, - "type": "library", - "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/webmozart/assert/issues", - "source": "https://github.com/webmozart/assert/tree/master" - }, - "time": "2020-04-18T12:12:48+00:00" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": { - "composer/composer": 20 - }, - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": "^7", - "composer-plugin-api": "^1.1.0 || ^2.0" - }, - "platform-dev": { - "ext-zip": "^1.13" - }, - "plugin-api-version": "1.1.0" -} diff --git a/vendor/composer/package-versions-deprecated/src/PackageVersions/FallbackVersions.php b/vendor/composer/package-versions-deprecated/src/PackageVersions/FallbackVersions.php deleted file mode 100644 index 18e5fe6..0000000 --- a/vendor/composer/package-versions-deprecated/src/PackageVersions/FallbackVersions.php +++ /dev/null @@ -1,128 +0,0 @@ - - */ - private static function getVersions(array $packageData): Generator - { - foreach ($packageData as $package) { - yield $package['name'] => $package['version'] . '@' . ( - $package['source']['reference'] ?? $package['dist']['reference'] ?? '' - ); - } - - yield self::ROOT_PACKAGE_NAME => self::ROOT_PACKAGE_NAME; - } -} diff --git a/vendor/composer/package-versions-deprecated/src/PackageVersions/Installer.php b/vendor/composer/package-versions-deprecated/src/PackageVersions/Installer.php deleted file mode 100644 index 05bdac9..0000000 --- a/vendor/composer/package-versions-deprecated/src/PackageVersions/Installer.php +++ /dev/null @@ -1,290 +0,0 @@ - - * @internal - */ - const VERSIONS = %s; - - private function __construct() - { - } - - /** - * @psalm-pure - * - * @psalm-suppress ImpureMethodCall we know that {@see InstalledVersions} interaction does not - * cause any side effects here. - */ - public static function rootPackageName() : string - { - if (!self::composer2ApiUsable()) { - return self::ROOT_PACKAGE_NAME; - } - - return InstalledVersions::getRootPackage()['name']; - } - - /** - * @throws OutOfBoundsException If a version cannot be located. - * - * @psalm-param key-of $packageName - * @psalm-pure - * - * @psalm-suppress ImpureMethodCall we know that {@see InstalledVersions} interaction does not - * cause any side effects here. - */ - public static function getVersion(string $packageName): string - { - if (self::composer2ApiUsable()) { - return InstalledVersions::getPrettyVersion($packageName) - . '@' . InstalledVersions::getReference($packageName); - } - - if (isset(self::VERSIONS[$packageName])) { - return self::VERSIONS[$packageName]; - } - - throw new OutOfBoundsException( - 'Required package "' . $packageName . '" is not installed: check your ./vendor/composer/installed.json and/or ./composer.lock files' - ); - } - - private static function composer2ApiUsable(): bool - { - if (!class_exists(InstalledVersions::class, false)) { - return false; - } - - if (method_exists(InstalledVersions::class, 'getAllRawData')) { - $rawData = InstalledVersions::getAllRawData(); - if (count($rawData) === 1 && count($rawData[0]) === 0) { - return false; - } - } else { - $rawData = InstalledVersions::getRawData(); - if ($rawData === null || $rawData === []) { - return false; - } - } - - return true; - } -} - -PHP; - - public function activate(Composer $composer, IOInterface $io) - { - // Nothing to do here, as all features are provided through event listeners - } - - public function deactivate(Composer $composer, IOInterface $io) - { - // Nothing to do here, as all features are provided through event listeners - } - - public function uninstall(Composer $composer, IOInterface $io) - { - // Nothing to do here, as all features are provided through event listeners - } - - /** - * {@inheritDoc} - */ - public static function getSubscribedEvents(): array - { - return [ScriptEvents::POST_AUTOLOAD_DUMP => 'dumpVersionsClass']; - } - - /** - * @throws RuntimeException - */ - public static function dumpVersionsClass(Event $composerEvent) - { - $composer = $composerEvent->getComposer(); - $rootPackage = $composer->getPackage(); - $versions = iterator_to_array(self::getVersions($composer->getLocker(), $rootPackage)); - - if (! array_key_exists('composer/package-versions-deprecated', $versions)) { - //plugin must be globally installed - we only want to generate versions for projects which specifically - //require composer/package-versions-deprecated - return; - } - - $versionClass = self::generateVersionsClass($rootPackage->getName(), $versions); - - self::writeVersionClassToFile($versionClass, $composer, $composerEvent->getIO()); - } - - /** - * @param string[] $versions - */ - private static function generateVersionsClass(string $rootPackageName, array $versions): string - { - return sprintf( - self::$generatedClassTemplate, - 'fin' . 'al ' . 'cla' . 'ss ' . 'Versions', // note: workaround for regex-based code parsers :-( - $rootPackageName, - var_export($versions, true) - ); - } - - /** - * @throws RuntimeException - */ - private static function writeVersionClassToFile(string $versionClassSource, Composer $composer, IOInterface $io) - { - $installPath = self::locateRootPackageInstallPath($composer->getConfig(), $composer->getPackage()) - . '/src/PackageVersions/Versions.php'; - - $installDir = dirname($installPath); - if (! file_exists($installDir)) { - $io->write('composer/package-versions-deprecated: Package not found (probably scheduled for removal); generation of version class skipped.'); - - return; - } - - if (! is_writable($installDir)) { - $io->write( - sprintf( - 'composer/package-versions-deprecated: %s is not writable; generation of version class skipped.', - $installDir - ) - ); - - return; - } - - $io->write('composer/package-versions-deprecated: Generating version class...'); - - $installPathTmp = $installPath . '_' . uniqid('tmp', true); - file_put_contents($installPathTmp, $versionClassSource); - chmod($installPathTmp, 0664); - rename($installPathTmp, $installPath); - - $io->write('composer/package-versions-deprecated: ...done generating version class'); - } - - /** - * @throws RuntimeException - */ - private static function locateRootPackageInstallPath( - Config $composerConfig, - RootPackageInterface $rootPackage - ): string { - if (self::getRootPackageAlias($rootPackage)->getName() === 'composer/package-versions-deprecated') { - return dirname($composerConfig->get('vendor-dir')); - } - - return $composerConfig->get('vendor-dir') . '/composer/package-versions-deprecated'; - } - - private static function getRootPackageAlias(RootPackageInterface $rootPackage): PackageInterface - { - $package = $rootPackage; - - while ($package instanceof AliasPackage) { - $package = $package->getAliasOf(); - } - - return $package; - } - - /** - * @return Generator&string[] - * - * @psalm-return Generator - */ - private static function getVersions(Locker $locker, RootPackageInterface $rootPackage): Generator - { - $lockData = $locker->getLockData(); - - $lockData['packages-dev'] = $lockData['packages-dev'] ?? []; - - $packages = $lockData['packages']; - if (getenv('COMPOSER_DEV_MODE') !== '0') { - $packages = array_merge($packages, $lockData['packages-dev']); - } - foreach ($packages as $package) { - yield $package['name'] => $package['version'] . '@' . ( - $package['source']['reference'] ?? $package['dist']['reference'] ?? '' - ); - } - - foreach ($rootPackage->getReplaces() as $replace) { - $version = $replace->getPrettyConstraint(); - if ($version === 'self.version') { - $version = $rootPackage->getPrettyVersion(); - } - - yield $replace->getTarget() => $version . '@' . $rootPackage->getSourceReference(); - } - - yield $rootPackage->getName() => $rootPackage->getPrettyVersion() . '@' . $rootPackage->getSourceReference(); - } -} diff --git a/vendor/composer/package-versions-deprecated/src/PackageVersions/Versions.php b/vendor/composer/package-versions-deprecated/src/PackageVersions/Versions.php deleted file mode 100644 index 78ab7ab..0000000 --- a/vendor/composer/package-versions-deprecated/src/PackageVersions/Versions.php +++ /dev/null @@ -1,171 +0,0 @@ - - * @internal - */ - const VERSIONS = array ( - 'doctrine/inflector' => '2.0.4@8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89', - 'guzzlehttp/guzzle' => '7.4.1@ee0a041b1760e6a53d2a39c8c34115adc2af2c79', - 'guzzlehttp/promises' => '1.5.1@fe752aedc9fd8fcca3fe7ad05d419d32998a06da', - 'guzzlehttp/psr7' => '2.1.0@089edd38f5b8abba6cb01567c2a8aaa47cec4c72', - 'psr/http-client' => '1.0.1@2dfb5f6c5eff0e91e20e913f8c5452ed95b86621', - 'psr/http-factory' => '1.0.1@12ac7fcd07e5b077433f5f2bee95b3a771bf61be', - 'psr/http-message' => '1.0.1@f6561bf28d520154e4b0ec72be95418abe6d9363', - 'ralouphie/getallheaders' => '3.0.3@120b605dfeb996808c31b6477290a714d356e822', - 'symfony/deprecation-contracts' => 'v2.5.0@6f981ee24cf69ee7ce9736146d1c57c2780598a8', - 'composer/package-versions-deprecated' => '1.11.99.4@b174585d1fe49ceed21928a945138948cb394600', - 'composer/xdebug-handler' => '1.4.6@f27e06cd9675801df441b3656569b328e04aa37c', - 'doctrine/instantiator' => '1.4.0@d56bf6102915de5702778fe20f2de3b2fe570b5b', - 'graham-campbell/result-type' => 'v1.0.4@0690bde05318336c7221785f2a932467f98b64ca', - 'hamcrest/hamcrest-php' => 'v2.0.1@8c3d0a3f6af734494ad8f6fbbee0ba92422859f3', - 'jean85/pretty-package-versions' => '1.6.0@1e0104b46f045868f11942aea058cd7186d6c303', - 'mockery/mockery' => '1.4.4@e01123a0e847d52d186c5eb4b9bf58b0c6d00346', - 'myclabs/deep-copy' => '1.10.2@776f831124e9c62e1a2c601ecc52e776d8bb7220', - 'nette/bootstrap' => 'v3.1.2@3ab4912a08af0c16d541c3709935c3478b5ee090', - 'nette/di' => 'v3.0.12@11c236b9f7bbfc5a95e7b24742ad8847936feeb5', - 'nette/finder' => 'v2.5.3@64dc25b7929b731e72a1bc84a9e57727f5d5d3e8', - 'nette/neon' => 'v3.3.2@54b287d8c2cdbe577b02e28ca1713e275b05ece2', - 'nette/php-generator' => 'v3.6.5@9370403f9d9c25b51c4596ded1fbfe70347f7c82', - 'nette/robot-loader' => 'v3.4.1@e2adc334cb958164c050f485d99c44c430f51fe2', - 'nette/schema' => 'v1.2.2@9a39cef03a5b34c7de64f551538cbba05c2be5df', - 'nette/utils' => 'v3.2.6@2f261e55bd6a12057442045bf2c249806abc1d02', - 'nikic/php-parser' => 'v4.13.2@210577fe3cf7badcc5814d99455df46564f3c077', - 'phar-io/manifest' => '2.0.3@97803eca37d319dfa7826cc2437fc020857acb53', - 'phar-io/version' => '3.1.0@bae7c545bef187884426f042434e561ab1ddb182', - 'php-parallel-lint/php-parallel-lint' => 'v1.3.1@761f3806e30239b5fcd90a0a45d41dc2138de192', - 'phpdocumentor/reflection-common' => '2.2.0@1d01c49d4ed62f25aa84a747ad35d5a16924662b', - 'phpdocumentor/reflection-docblock' => '5.1.0@cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e', - 'phpdocumentor/type-resolver' => '1.5.1@a12f7e301eb7258bb68acd89d4aefa05c2906cae', - 'phpoption/phpoption' => '1.8.1@eab7a0df01fe2344d172bff4cd6dbd3f8b84ad15', - 'phpspec/prophecy' => '1.11.1@b20034be5efcdab4fb60ca3a29cba2949aead160', - 'phpstan/phpdoc-parser' => '0.3.5@8c4ef2aefd9788238897b678a985e1d5c8df6db4', - 'phpstan/phpstan' => '0.11.20@938dcc03a005280e1a9587ec7684345bff06ebfc', - 'phpstan/phpstan-mockery' => '0.11.3@8f3f0dc0bbc8c413224459a25f89a2cef5924871', - 'phpunit/php-code-coverage' => '7.0.15@819f92bba8b001d4363065928088de22f25a3a48', - 'phpunit/php-file-iterator' => '2.0.5@42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5', - 'phpunit/php-text-template' => '1.2.1@31f8b717e51d9a2afca6c9f046f5d69fc27c8686', - 'phpunit/php-timer' => '2.1.3@2454ae1765516d20c4ffe103d85a58a9a3bd5662', - 'phpunit/php-token-stream' => '4.0.4@a853a0e183b9db7eed023d7933a858fa1c8d25a3', - 'phpunit/phpunit' => '8.5.22@ddd05b9d844260353895a3b950a9258126c11503', - 'psr/container' => '1.1.2@513e0666f7216c7459170d56df27dfcefe1689ea', - 'psr/log' => '1.1.4@d49695b909c3b7628b6289db5479a1c204601f11', - 'sebastian/code-unit-reverse-lookup' => '1.0.2@1de8cd5c010cb153fcd68b8d0f64606f523f7619', - 'sebastian/comparator' => '3.0.3@1071dfcef776a57013124ff35e1fc41ccd294758', - 'sebastian/diff' => '3.0.3@14f72dd46eaf2f2293cbe79c93cc0bc43161a211', - 'sebastian/environment' => '4.2.4@d47bbbad83711771f167c72d4e3f25f7fcc1f8b0', - 'sebastian/exporter' => '3.1.4@0c32ea2e40dbf59de29f3b49bf375176ce7dd8db', - 'sebastian/global-state' => '3.0.1@474fb9edb7ab891665d3bfc6317f42a0a150454b', - 'sebastian/object-enumerator' => '3.0.4@e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2', - 'sebastian/object-reflector' => '1.1.2@9b8772b9cbd456ab45d4a598d2dd1a1bced6363d', - 'sebastian/recursion-context' => '3.0.1@367dcba38d6e1977be014dc4b22f47a484dac7fb', - 'sebastian/resource-operations' => '2.0.2@31d35ca87926450c44eae7e2611d45a7a65ea8b3', - 'sebastian/type' => '1.1.4@0150cfbc4495ed2df3872fb31b26781e4e077eb4', - 'sebastian/version' => '2.0.1@99732be0ddb3361e16ad77b68ba41efc8e979019', - 'squizlabs/php_codesniffer' => '3.6.2@5e4e71592f69da17871dba6e80dd51bce74a351a', - 'symfony/console' => 'v4.4.36@621379b62bb19af213b569b60013200b11dd576f', - 'symfony/finder' => 'v4.4.36@1fef05633cd61b629e963e5d8200fb6b67ecf42c', - 'symfony/polyfill-ctype' => 'v1.23.0@46cd95797e9df938fdd2b03693b5fca5e64b01ce', - 'symfony/polyfill-mbstring' => 'v1.23.1@9174a3d80210dca8daa7f31fec659150bbeabfc6', - 'symfony/polyfill-php73' => 'v1.23.0@fba8933c384d6476ab14fb7b8526e5287ca7e010', - 'symfony/polyfill-php80' => 'v1.23.1@1100343ed1a92e3a38f9ae122fc0eb21602547be', - 'symfony/service-contracts' => 'v2.5.0@1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc', - 'theseer/tokenizer' => '1.2.1@34a41e998c2183e22995f158c581e7b5e755ab9e', - 'vlucas/phpdotenv' => 'v5.4.1@264dce589e7ce37a7ba99cb901eed8249fbec92f', - 'webmozart/assert' => '1.8.0@ab2cb0b3b559010b75981b1bdce728da3ee90ad6', - 'fleetbase/fleetbase-php' => 'dev-master@d7bd69649a7e68fd61dcddbfc0549f033e9d94ce', -); - - private function __construct() - { - } - - /** - * @psalm-pure - * - * @psalm-suppress ImpureMethodCall we know that {@see InstalledVersions} interaction does not - * cause any side effects here. - */ - public static function rootPackageName() : string - { - if (!self::composer2ApiUsable()) { - return self::ROOT_PACKAGE_NAME; - } - - return InstalledVersions::getRootPackage()['name']; - } - - /** - * @throws OutOfBoundsException If a version cannot be located. - * - * @psalm-param key-of $packageName - * @psalm-pure - * - * @psalm-suppress ImpureMethodCall we know that {@see InstalledVersions} interaction does not - * cause any side effects here. - */ - public static function getVersion(string $packageName): string - { - if (self::composer2ApiUsable()) { - return InstalledVersions::getPrettyVersion($packageName) - . '@' . InstalledVersions::getReference($packageName); - } - - if (isset(self::VERSIONS[$packageName])) { - return self::VERSIONS[$packageName]; - } - - throw new OutOfBoundsException( - 'Required package "' . $packageName . '" is not installed: check your ./vendor/composer/installed.json and/or ./composer.lock files' - ); - } - - private static function composer2ApiUsable(): bool - { - if (!class_exists(InstalledVersions::class, false)) { - return false; - } - - if (method_exists(InstalledVersions::class, 'getAllRawData')) { - $rawData = InstalledVersions::getAllRawData(); - if (count($rawData) === 1 && count($rawData[0]) === 0) { - return false; - } - } else { - $rawData = InstalledVersions::getRawData(); - if ($rawData === null || $rawData === []) { - return false; - } - } - - return true; - } -} diff --git a/vendor/composer/platform_check.php b/vendor/composer/platform_check.php deleted file mode 100644 index 580fa96..0000000 --- a/vendor/composer/platform_check.php +++ /dev/null @@ -1,26 +0,0 @@ -= 70400)) { - $issues[] = 'Your Composer dependencies require a PHP version ">= 7.4.0". You are running ' . PHP_VERSION . '.'; -} - -if ($issues) { - if (!headers_sent()) { - header('HTTP/1.1 500 Internal Server Error'); - } - if (!ini_get('display_errors')) { - if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { - fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); - } elseif (!headers_sent()) { - echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; - } - } - trigger_error( - 'Composer detected issues in your platform: ' . implode(' ', $issues), - E_USER_ERROR - ); -} diff --git a/vendor/composer/xdebug-handler/CHANGELOG.md b/vendor/composer/xdebug-handler/CHANGELOG.md deleted file mode 100644 index 38fa75c..0000000 --- a/vendor/composer/xdebug-handler/CHANGELOG.md +++ /dev/null @@ -1,91 +0,0 @@ -## [Unreleased] - -## [1.4.6] - 2021-03-25 - * Fixed: fail restart if `proc_open` has been disabled in `disable_functions`. - * Fixed: enable Windows CTRL event handling in the restarted process. - -## [1.4.5] - 2020-11-13 - * Fixed: use `proc_open` when available for correct FD forwarding to the restarted process. - -## [1.4.4] - 2020-10-24 - * Fix: exception if 'pcntl_signal' is disabled. - -## [1.4.3] - 2020-08-19 - * Fixed: restore SIGINT to default handler in restarted process if no other handler exists. - -## [1.4.2] - 2020-06-04 - * Fixed: ignore SIGINTs to let the restarted process handle them. - -## [1.4.1] - 2020-03-01 - * Fixed: restart fails if an ini file is empty. - -## [1.4.0] - 2019-11-06 - * Added: support for `NO_COLOR` environment variable: https://no-color.org - * Added: color support for Hyper terminal: https://github.com/zeit/hyper - * Fixed: correct capitalization of Xdebug (apparently). - * Fixed: improved handling for uopz extension. - -## [1.3.3] - 2019-05-27 - * Fixed: add environment changes to `$_ENV` if it is being used. - -## [1.3.2] - 2019-01-28 - * Fixed: exit call being blocked by uopz extension, resulting in application code running twice. - -## [1.3.1] - 2018-11-29 - * Fixed: fail restart if `passthru` has been disabled in `disable_functions`. - * Fixed: fail restart if an ini file cannot be opened, otherwise settings will be missing. - -## [1.3.0] - 2018-08-31 - * Added: `setPersistent` method to use environment variables for the restart. - * Fixed: improved debugging by writing output to stderr. - * Fixed: no restart when `php_ini_scanned_files` is not functional and is needed. - -## [1.2.1] - 2018-08-23 - * Fixed: fatal error with apc, when using `apc.mmap_file_mask`. - -## [1.2.0] - 2018-08-16 - * Added: debug information using `XDEBUG_HANDLER_DEBUG`. - * Added: fluent interface for setters. - * Added: `PhpConfig` helper class for calling PHP sub-processes. - * Added: `PHPRC` original value to restart stettings, for use in a restarted process. - * Changed: internal procedure to disable ini-scanning, using `-n` command-line option. - * Fixed: replaced `escapeshellarg` usage to avoid locale problems. - * Fixed: improved color-option handling to respect double-dash delimiter. - * Fixed: color-option handling regression from main script changes. - * Fixed: improved handling when checking main script. - * Fixed: handling for standard input, that never actually did anything. - * Fixed: fatal error when ctype extension is not available. - -## [1.1.0] - 2018-04-11 - * Added: `getRestartSettings` method for calling PHP processes in a restarted process. - * Added: API definition and @internal class annotations. - * Added: protected `requiresRestart` method for extending classes. - * Added: `setMainScript` method for applications that change the working directory. - * Changed: private `tmpIni` variable to protected for extending classes. - * Fixed: environment variables not available in $_SERVER when restored in the restart. - * Fixed: relative path problems caused by Phar::interceptFileFuncs. - * Fixed: incorrect handling when script file cannot be found. - -## [1.0.0] - 2018-03-08 - * Added: PSR3 logging for optional status output. - * Added: existing ini settings are merged to catch command-line overrides. - * Added: code, tests and other artefacts to decouple from Composer. - * Break: the following class was renamed: - - `Composer\XdebugHandler` -> `Composer\XdebugHandler\XdebugHandler` - -[Unreleased]: https://github.com/composer/xdebug-handler/compare/1.4.6...HEAD -[1.4.6]: https://github.com/composer/xdebug-handler/compare/1.4.5...1.4.6 -[1.4.5]: https://github.com/composer/xdebug-handler/compare/1.4.4...1.4.5 -[1.4.4]: https://github.com/composer/xdebug-handler/compare/1.4.3...1.4.4 -[1.4.3]: https://github.com/composer/xdebug-handler/compare/1.4.2...1.4.3 -[1.4.2]: https://github.com/composer/xdebug-handler/compare/1.4.1...1.4.2 -[1.4.1]: https://github.com/composer/xdebug-handler/compare/1.4.0...1.4.1 -[1.4.0]: https://github.com/composer/xdebug-handler/compare/1.3.3...1.4.0 -[1.3.3]: https://github.com/composer/xdebug-handler/compare/1.3.2...1.3.3 -[1.3.2]: https://github.com/composer/xdebug-handler/compare/1.3.1...1.3.2 -[1.3.1]: https://github.com/composer/xdebug-handler/compare/1.3.0...1.3.1 -[1.3.0]: https://github.com/composer/xdebug-handler/compare/1.2.1...1.3.0 -[1.2.1]: https://github.com/composer/xdebug-handler/compare/1.2.0...1.2.1 -[1.2.0]: https://github.com/composer/xdebug-handler/compare/1.1.0...1.2.0 -[1.1.0]: https://github.com/composer/xdebug-handler/compare/1.0.0...1.1.0 -[1.0.0]: https://github.com/composer/xdebug-handler/compare/d66f0d15cb57...1.0.0 diff --git a/vendor/composer/xdebug-handler/LICENSE b/vendor/composer/xdebug-handler/LICENSE deleted file mode 100644 index 963618a..0000000 --- a/vendor/composer/xdebug-handler/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2017 Composer - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/composer/xdebug-handler/README.md b/vendor/composer/xdebug-handler/README.md deleted file mode 100644 index 734d958..0000000 --- a/vendor/composer/xdebug-handler/README.md +++ /dev/null @@ -1,293 +0,0 @@ -# composer/xdebug-handler - -[![packagist](https://img.shields.io/packagist/v/composer/xdebug-handler.svg)](https://packagist.org/packages/composer/xdebug-handler) -[![Continuous Integration](https://github.com/composer/xdebug-handler/workflows/Continuous%20Integration/badge.svg?branch=main)](https://github.com/composer/xdebug-handler/actions) -![license](https://img.shields.io/github/license/composer/xdebug-handler.svg) -![php](https://img.shields.io/packagist/php-v/composer/xdebug-handler.svg?colorB=8892BF&label=php) - -Restart a CLI process without loading the Xdebug extension. - -Originally written as part of [composer/composer](https://github.com/composer/composer), -now extracted and made available as a stand-alone library. - -## Installation - -Install the latest version with: - -```bash -$ composer require composer/xdebug-handler -``` - -## Requirements - -* PHP 5.3.2 minimum, although functionality is disabled below PHP 5.4.0. Using the latest PHP version is highly recommended. - -## Basic Usage -```php -use Composer\XdebugHandler\XdebugHandler; - -$xdebug = new XdebugHandler('myapp'); -$xdebug->check(); -unset($xdebug); -``` - -The constructor takes two parameters: - -#### _$envPrefix_ -This is used to create distinct environment variables and is upper-cased and prepended to default base values. The above example enables the use of: - -- `MYAPP_ALLOW_XDEBUG=1` to override automatic restart and allow Xdebug -- `MYAPP_ORIGINAL_INIS` to obtain ini file locations in a restarted process - -#### _$colorOption_ -This optional value is added to the restart command-line and is needed to force color output in a piped child process. Only long-options are supported, for example `--ansi` or `--colors=always` etc. - -If the original command-line contains an argument that pattern matches this value (for example `--no-ansi`, `--colors=never`) then _$colorOption_ is ignored. - -If the pattern match ends with `=auto` (for example `--colors=auto`), the argument is replaced by _$colorOption_. Otherwise it is added at either the end of the command-line, or preceding the first double-dash `--` delimiter. - -## Advanced Usage - -* [How it works](#how-it-works) -* [Limitations](#limitations) -* [Helper methods](#helper-methods) -* [Setter methods](#setter-methods) -* [Process configuration](#process-configuration) -* [Troubleshooting](#troubleshooting) -* [Extending the library](#extending-the-library) - -### How it works - -A temporary ini file is created from the loaded (and scanned) ini files, with any references to the Xdebug extension commented out. Current ini settings are merged, so that most ini settings made on the command-line or by the application are included (see [Limitations](#limitations)) - -* `MYAPP_ALLOW_XDEBUG` is set with internal data to flag and use in the restart. -* The command-line and environment are [configured](#process-configuration) for the restart. -* The application is restarted in a new process. - * The restart settings are stored in the environment. - * `MYAPP_ALLOW_XDEBUG` is unset. - * The application runs and exits. -* The main process exits with the exit code from the restarted process. - -#### Signal handling -From PHP 7.1 with the pcntl extension loaded, asynchronous signal handling is automatically enabled. `SIGINT` is set to `SIG_IGN` in the parent -process and restored to `SIG_DFL` in the restarted process (if no other handler has been set). - -From PHP 7.4 on Windows, `CTRL+C` and `CTRL+BREAK` handling is ignored in the parent process and automatically enabled in the restarted process. - -### Limitations -There are a few things to be aware of when running inside a restarted process. - -* Extensions set on the command-line will not be loaded. -* Ini file locations will be reported as per the restart - see [getAllIniFiles()](#getallinifiles). -* Php sub-processes may be loaded with Xdebug enabled - see [Process configuration](#process-configuration). - -### Helper methods -These static methods provide information from the current process, regardless of whether it has been restarted or not. - -#### _getAllIniFiles()_ -Returns an array of the original ini file locations. Use this instead of calling `php_ini_loaded_file` and `php_ini_scanned_files`, which will report the wrong values in a restarted process. - -```php -use Composer\XdebugHandler\XdebugHandler; - -$files = XdebugHandler::getAllIniFiles(); - -# $files[0] always exists, it could be an empty string -$loadedIni = array_shift($files); -$scannedInis = $files; -``` - -These locations are also available in the `MYAPP_ORIGINAL_INIS` environment variable. This is a path-separated string comprising the location returned from `php_ini_loaded_file`, which could be empty, followed by locations parsed from calling `php_ini_scanned_files`. - -#### _getRestartSettings()_ -Returns an array of settings that can be used with PHP [sub-processes](#sub-processes), or null if the process was not restarted. - -```php -use Composer\XdebugHandler\XdebugHandler; - -$settings = XdebugHandler::getRestartSettings(); -/** - * $settings: array (if the current process was restarted, - * or called with the settings from a previous restart), or null - * - * 'tmpIni' => the temporary ini file used in the restart (string) - * 'scannedInis' => if there were any scanned inis (bool) - * 'scanDir' => the original PHP_INI_SCAN_DIR value (false|string) - * 'phprc' => the original PHPRC value (false|string) - * 'inis' => the original inis from getAllIniFiles (array) - * 'skipped' => the skipped version from getSkippedVersion (string) - */ -``` - -#### _getSkippedVersion()_ -Returns the Xdebug version string that was skipped by the restart, or an empty value if there was no restart (or Xdebug is still loaded, perhaps by an extending class restarting for a reason other than removing Xdebug). - -```php -use Composer\XdebugHandler\XdebugHandler; - -$version = XdebugHandler::getSkippedVersion(); -# $version: '2.6.0' (for example), or an empty string -``` - -### Setter methods -These methods implement a fluent interface and must be called before the main `check()` method. - -#### _setLogger($logger)_ -Enables the output of status messages to an external PSR3 logger. All messages are reported with either `DEBUG` or `WARNING` log levels. For example (showing the level and message): - -``` -// Restart overridden -DEBUG Checking MYAPP_ALLOW_XDEBUG -DEBUG The Xdebug extension is loaded (2.5.0) -DEBUG No restart (MYAPP_ALLOW_XDEBUG=1) - -// Failed restart -DEBUG Checking MYAPP_ALLOW_XDEBUG -DEBUG The Xdebug extension is loaded (2.5.0) -WARNING No restart (Unable to create temp ini file at: ...) -``` - -Status messages can also be output with `XDEBUG_HANDLER_DEBUG`. See [Troubleshooting](#troubleshooting). - -#### _setMainScript($script)_ -Sets the location of the main script to run in the restart. This is only needed in more esoteric use-cases, or if the `argv[0]` location is inaccessible. The script name `--` is supported for standard input. - -#### _setPersistent()_ -Configures the restart using [persistent settings](#persistent-settings), so that Xdebug is not loaded in any sub-process. - -Use this method if your application invokes one or more PHP sub-process and the Xdebug extension is not needed. This avoids the overhead of implementing specific [sub-process](#sub-processes) strategies. - -Alternatively, this method can be used to set up a default _Xdebug-free_ environment which can be changed if a sub-process requires Xdebug, then restored afterwards: - -```php -function SubProcessWithXdebug() -{ - $phpConfig = new Composer\XdebugHandler\PhpConfig(); - - # Set the environment to the original configuration - $phpConfig->useOriginal(); - - # run the process with Xdebug loaded - ... - - # Restore Xdebug-free environment - $phpConfig->usePersistent(); -} -``` - -### Process configuration -The library offers two strategies to invoke a new PHP process without loading Xdebug, using either _standard_ or _persistent_ settings. Note that this is only important if the application calls a PHP sub-process. - -#### Standard settings -Uses command-line options to remove Xdebug from the new process only. - -* The -n option is added to the command-line. This tells PHP not to scan for additional inis. -* The temporary ini is added to the command-line with the -c option. - ->_If the new process calls a PHP sub-process, Xdebug will be loaded in that sub-process (unless it implements xdebug-handler, in which case there will be another restart)._ - -This is the default strategy used in the restart. - -#### Persistent settings -Uses environment variables to remove Xdebug from the new process and persist these settings to any sub-process. - -* `PHP_INI_SCAN_DIR` is set to an empty string. This tells PHP not to scan for additional inis. -* `PHPRC` is set to the temporary ini. - ->_If the new process calls a PHP sub-process, Xdebug will not be loaded in that sub-process._ - -This strategy can be used in the restart by calling [setPersistent()](#setpersistent). - -#### Sub-processes -The `PhpConfig` helper class makes it easy to invoke a PHP sub-process (with or without Xdebug loaded), regardless of whether there has been a restart. - -Each of its methods returns an array of PHP options (to add to the command-line) and sets up the environment for the required strategy. The [getRestartSettings()](#getrestartsettings) method is used internally. - -* `useOriginal()` - Xdebug will be loaded in the new process. -* `useStandard()` - Xdebug will **not** be loaded in the new process - see [standard settings](#standard-settings). -* `userPersistent()` - Xdebug will **not** be loaded in the new process - see [persistent settings](#persistent-settings) - -If there was no restart, an empty options array is returned and the environment is not changed. - -```php -use Composer\XdebugHandler\PhpConfig; - -$config = new PhpConfig; - -$options = $config->useOriginal(); -# $options: empty array -# environment: PHPRC and PHP_INI_SCAN_DIR set to original values - -$options = $config->useStandard(); -# $options: [-n, -c, tmpIni] -# environment: PHPRC and PHP_INI_SCAN_DIR set to original values - -$options = $config->usePersistent(); -# $options: empty array -# environment: PHPRC=tmpIni, PHP_INI_SCAN_DIR='' -``` - -### Troubleshooting -The following environment settings can be used to troubleshoot unexpected behavior: - -* `XDEBUG_HANDLER_DEBUG=1` Outputs status messages to `STDERR`, if it is defined, irrespective of any PSR3 logger. Each message is prefixed `xdebug-handler[pid]`, where pid is the process identifier. - -* `XDEBUG_HANDLER_DEBUG=2` As above, but additionally saves the temporary ini file and reports its location in a status message. - -### Extending the library -The API is defined by classes and their accessible elements that are not annotated as @internal. The main class has two protected methods that can be overridden to provide additional functionality: - -#### _requiresRestart($isLoaded)_ -By default the process will restart if Xdebug is loaded. Extending this method allows an application to decide, by returning a boolean (or equivalent) value. It is only called if `MYAPP_ALLOW_XDEBUG` is empty, so it will not be called in the restarted process (where this variable contains internal data), or if the restart has been overridden. - -Note that the [setMainScript()](#setmainscriptscript) and [setPersistent()](#setpersistent) setters can be used here, if required. - -#### _restart($command)_ -An application can extend this to modify the temporary ini file, its location given in the `tmpIni` property. New settings can be safely appended to the end of the data, which is `PHP_EOL` terminated. - -Note that the `$command` parameter is the escaped command-line string that will be used for the new process and must be treated accordingly. - -Remember to finish with `parent::restart($command)`. - -#### Example -This example demonstrates two ways to extend basic functionality: - -* To avoid the overhead of spinning up a new process, the restart is skipped if a simple help command is requested. - -* The application needs write-access to phar files, so it will force a restart if `phar.readonly` is set (regardless of whether Xdebug is loaded) and change this value in the temporary ini file. - -```php -use Composer\XdebugHandler\XdebugHandler; -use MyApp\Command; - -class MyRestarter extends XdebugHandler -{ - private $required; - - protected function requiresRestart($isLoaded) - { - if (Command::isHelp()) { - # No need to disable Xdebug for this - return false; - } - - $this->required = (bool) ini_get('phar.readonly'); - return $isLoaded || $this->required; - } - - protected function restart($command) - { - if ($this->required) { - # Add required ini setting to tmpIni - $content = file_get_contents($this->tmpIni); - $content .= 'phar.readonly=0'.PHP_EOL; - file_put_contents($this->tmpIni, $content); - } - - parent::restart($command); - } -} -``` - -## License -composer/xdebug-handler is licensed under the MIT License, see the LICENSE file for details. diff --git a/vendor/composer/xdebug-handler/composer.json b/vendor/composer/xdebug-handler/composer.json deleted file mode 100644 index 7df9ea6..0000000 --- a/vendor/composer/xdebug-handler/composer.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "composer/xdebug-handler", - "description": "Restarts a process without Xdebug.", - "type": "library", - "license": "MIT", - "keywords": [ - "xdebug", - "performance" - ], - "authors": [ - { - "name": "John Stevenson", - "email": "john-stevenson@blueyonder.co.uk" - } - ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/xdebug-handler/issues" - }, - "require": { - "php": "^5.3.2 || ^7.0 || ^8.0", - "psr/log": "^1.0" - }, - "require-dev": { - "symfony/phpunit-bridge": "^4.2 || ^5", - "phpstan/phpstan": "^0.12.55" - }, - "autoload": { - "psr-4": { - "Composer\\XdebugHandler\\": "src" - } - }, - "autoload-dev": { - "psr-4": { - "Composer\\XdebugHandler\\": "tests" - } - }, - "scripts": { - "test": "SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT=1 vendor/bin/simple-phpunit", - "phpstan": "vendor/bin/phpstan analyse" - } -} diff --git a/vendor/composer/xdebug-handler/phpstan.neon.dist b/vendor/composer/xdebug-handler/phpstan.neon.dist deleted file mode 100644 index 46b0f47..0000000 --- a/vendor/composer/xdebug-handler/phpstan.neon.dist +++ /dev/null @@ -1,5 +0,0 @@ -parameters: - level: 5 - paths: - - src - - tests diff --git a/vendor/composer/xdebug-handler/src/PhpConfig.php b/vendor/composer/xdebug-handler/src/PhpConfig.php deleted file mode 100644 index 5535eca..0000000 --- a/vendor/composer/xdebug-handler/src/PhpConfig.php +++ /dev/null @@ -1,73 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -namespace Composer\XdebugHandler; - -/** - * @author John Stevenson - */ -class PhpConfig -{ - /** - * Use the original PHP configuration - * - * @return array PHP cli options - */ - public function useOriginal() - { - $this->getDataAndReset(); - return array(); - } - - /** - * Use standard restart settings - * - * @return array PHP cli options - */ - public function useStandard() - { - if ($data = $this->getDataAndReset()) { - return array('-n', '-c', $data['tmpIni']); - } - - return array(); - } - - /** - * Use environment variables to persist settings - * - * @return array PHP cli options - */ - public function usePersistent() - { - if ($data = $this->getDataAndReset()) { - Process::setEnv('PHPRC', $data['tmpIni']); - Process::setEnv('PHP_INI_SCAN_DIR', ''); - } - - return array(); - } - - /** - * Returns restart data if available and resets the environment - * - * @return array|null - */ - private function getDataAndReset() - { - if ($data = XdebugHandler::getRestartSettings()) { - Process::setEnv('PHPRC', $data['phprc']); - Process::setEnv('PHP_INI_SCAN_DIR', $data['scanDir']); - } - - return $data; - } -} diff --git a/vendor/composer/xdebug-handler/src/Process.php b/vendor/composer/xdebug-handler/src/Process.php deleted file mode 100644 index eb2ad2b..0000000 --- a/vendor/composer/xdebug-handler/src/Process.php +++ /dev/null @@ -1,181 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -namespace Composer\XdebugHandler; - -/** - * Provides utility functions to prepare a child process command-line and set - * environment variables in that process. - * - * @author John Stevenson - * @internal - */ -class Process -{ - /** - * Returns an array of parameters, including a color option if required - * - * A color option is needed because child process output is piped. - * - * @param array $args The script parameters - * @param string $colorOption The long option to force color output - * - * @return array - */ - public static function addColorOption(array $args, $colorOption) - { - if (!$colorOption - || in_array($colorOption, $args) - || !preg_match('/^--([a-z]+$)|(^--[a-z]+=)/', $colorOption, $matches)) { - return $args; - } - - if (isset($matches[2])) { - // Handle --color(s)= options - if (false !== ($index = array_search($matches[2].'auto', $args))) { - $args[$index] = $colorOption; - return $args; - } elseif (preg_grep('/^'.$matches[2].'/', $args)) { - return $args; - } - } elseif (in_array('--no-'.$matches[1], $args)) { - return $args; - } - - // Check for NO_COLOR variable (https://no-color.org/) - if (false !== getenv('NO_COLOR')) { - return $args; - } - - if (false !== ($index = array_search('--', $args))) { - // Position option before double-dash delimiter - array_splice($args, $index, 0, $colorOption); - } else { - $args[] = $colorOption; - } - - return $args; - } - - /** - * Escapes a string to be used as a shell argument. - * - * From https://github.com/johnstevenson/winbox-args - * MIT Licensed (c) John Stevenson - * - * @param string $arg The argument to be escaped - * @param bool $meta Additionally escape cmd.exe meta characters - * @param bool $module The argument is the module to invoke - * - * @return string The escaped argument - */ - public static function escape($arg, $meta = true, $module = false) - { - if (!defined('PHP_WINDOWS_VERSION_BUILD')) { - return "'".str_replace("'", "'\\''", $arg)."'"; - } - - $quote = strpbrk($arg, " \t") !== false || $arg === ''; - - $arg = preg_replace('/(\\\\*)"/', '$1$1\\"', $arg, -1, $dquotes); - - if ($meta) { - $meta = $dquotes || preg_match('/%[^%]+%/', $arg); - - if (!$meta) { - $quote = $quote || strpbrk($arg, '^&|<>()') !== false; - } elseif ($module && !$dquotes && $quote) { - $meta = false; - } - } - - if ($quote) { - $arg = '"'.preg_replace('/(\\\\*)$/', '$1$1', $arg).'"'; - } - - if ($meta) { - $arg = preg_replace('/(["^&|<>()%])/', '^$1', $arg); - } - - return $arg; - } - - /** - * Returns true if the output stream supports colors - * - * This is tricky on Windows, because Cygwin, Msys2 etc emulate pseudo - * terminals via named pipes, so we can only check the environment. - * - * @param mixed $output A valid CLI output stream - * - * @return bool - */ - public static function supportsColor($output) - { - if ('Hyper' === getenv('TERM_PROGRAM')) { - return true; - } - - if (defined('PHP_WINDOWS_VERSION_BUILD')) { - return (function_exists('sapi_windows_vt100_support') - && sapi_windows_vt100_support($output)) - || false !== getenv('ANSICON') - || 'ON' === getenv('ConEmuANSI') - || 'xterm' === getenv('TERM'); - } - - if (function_exists('stream_isatty')) { - return stream_isatty($output); - } - - if (function_exists('posix_isatty')) { - return posix_isatty($output); - } - - $stat = fstat($output); - // Check if formatted mode is S_IFCHR - return $stat ? 0020000 === ($stat['mode'] & 0170000) : false; - } - - /** - * Makes putenv environment changes available in $_SERVER and $_ENV - * - * @param string $name - * @param string|false $value A false value unsets the variable - * - * @return bool Whether the environment variable was set - */ - public static function setEnv($name, $value = false) - { - $unset = false === $value; - - if (!putenv($unset ? $name : $name.'='.$value)) { - return false; - } - - if ($unset) { - unset($_SERVER[$name]); - } else { - $_SERVER[$name] = $value; - } - - // Update $_ENV if it is being used - if (false !== stripos((string) ini_get('variables_order'), 'E')) { - if ($unset) { - unset($_ENV[$name]); - } else { - $_ENV[$name] = $value; - } - } - - return true; - } -} diff --git a/vendor/composer/xdebug-handler/src/Status.php b/vendor/composer/xdebug-handler/src/Status.php deleted file mode 100644 index e714b1c..0000000 --- a/vendor/composer/xdebug-handler/src/Status.php +++ /dev/null @@ -1,163 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -namespace Composer\XdebugHandler; - -use Psr\Log\LoggerInterface; -use Psr\Log\LogLevel; - -/** - * @author John Stevenson - * @internal - */ -class Status -{ - const ENV_RESTART = 'XDEBUG_HANDLER_RESTART'; - const CHECK = 'Check'; - const ERROR = 'Error'; - const INFO = 'Info'; - const NORESTART = 'NoRestart'; - const RESTART = 'Restart'; - const RESTARTING = 'Restarting'; - const RESTARTED = 'Restarted'; - - private $debug; - private $envAllowXdebug; - private $loaded; - private $logger; - private $time; - - /** - * Constructor - * - * @param string $envAllowXdebug Prefixed _ALLOW_XDEBUG name - * @param bool $debug Whether debug output is required - */ - public function __construct($envAllowXdebug, $debug) - { - $start = getenv(self::ENV_RESTART); - Process::setEnv(self::ENV_RESTART); - $this->time = $start ? round((microtime(true) - $start) * 1000) : 0; - - $this->envAllowXdebug = $envAllowXdebug; - $this->debug = $debug && defined('STDERR'); - } - - /** - * @param LoggerInterface $logger - */ - public function setLogger(LoggerInterface $logger) - { - $this->logger = $logger; - } - - /** - * Calls a handler method to report a message - * - * @param string $op The handler constant - * @param null|string $data Data required by the handler - */ - public function report($op, $data) - { - if ($this->logger || $this->debug) { - call_user_func(array($this, 'report'.$op), $data); - } - } - - /** - * Outputs a status message - * - * @param string $text - * @param string $level - */ - private function output($text, $level = null) - { - if ($this->logger) { - $this->logger->log($level ?: LogLevel::DEBUG, $text); - } - - if ($this->debug) { - fwrite(STDERR, sprintf('xdebug-handler[%d] %s', getmypid(), $text.PHP_EOL)); - } - } - - private function reportCheck($loaded) - { - $this->loaded = $loaded; - $this->output('Checking '.$this->envAllowXdebug); - } - - private function reportError($error) - { - $this->output(sprintf('No restart (%s)', $error), LogLevel::WARNING); - } - - private function reportInfo($info) - { - $this->output($info); - } - - private function reportNoRestart() - { - $this->output($this->getLoadedMessage()); - - if ($this->loaded) { - $text = sprintf('No restart (%s)', $this->getEnvAllow()); - if (!getenv($this->envAllowXdebug)) { - $text .= ' Allowed by application'; - } - $this->output($text); - } - } - - private function reportRestart() - { - $this->output($this->getLoadedMessage()); - Process::setEnv(self::ENV_RESTART, (string) microtime(true)); - } - - private function reportRestarted() - { - $loaded = $this->getLoadedMessage(); - $text = sprintf('Restarted (%d ms). %s', $this->time, $loaded); - $level = $this->loaded ? LogLevel::WARNING : null; - $this->output($text, $level); - } - - private function reportRestarting($command) - { - $text = sprintf('Process restarting (%s)', $this->getEnvAllow()); - $this->output($text); - $text = 'Running '.$command; - $this->output($text); - } - - /** - * Returns the _ALLOW_XDEBUG environment variable as name=value - * - * @return string - */ - private function getEnvAllow() - { - return $this->envAllowXdebug.'='.getenv($this->envAllowXdebug); - } - - /** - * Returns the Xdebug status and version - * - * @return string - */ - private function getLoadedMessage() - { - $loaded = $this->loaded ? sprintf('loaded (%s)', $this->loaded) : 'not loaded'; - return 'The Xdebug extension is '.$loaded; - } -} diff --git a/vendor/composer/xdebug-handler/src/XdebugHandler.php b/vendor/composer/xdebug-handler/src/XdebugHandler.php deleted file mode 100644 index 30391f0..0000000 --- a/vendor/composer/xdebug-handler/src/XdebugHandler.php +++ /dev/null @@ -1,620 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -namespace Composer\XdebugHandler; - -use Psr\Log\LoggerInterface; - -/** - * @author John Stevenson - */ -class XdebugHandler -{ - const SUFFIX_ALLOW = '_ALLOW_XDEBUG'; - const SUFFIX_INIS = '_ORIGINAL_INIS'; - const RESTART_ID = 'internal'; - const RESTART_SETTINGS = 'XDEBUG_HANDLER_SETTINGS'; - const DEBUG = 'XDEBUG_HANDLER_DEBUG'; - - /** @var string|null */ - protected $tmpIni; - - private static $inRestart; - private static $name; - private static $skipped; - - private $cli; - private $colorOption; - private $debug; - private $envAllowXdebug; - private $envOriginalInis; - private $loaded; - private $persistent; - private $script; - /** @var Status|null */ - private $statusWriter; - - /** - * Constructor - * - * The $envPrefix is used to create distinct environment variables. It is - * uppercased and prepended to the default base values. For example 'myapp' - * would result in MYAPP_ALLOW_XDEBUG and MYAPP_ORIGINAL_INIS. - * - * @param string $envPrefix Value used in environment variables - * @param string $colorOption Command-line long option to force color output - * @throws \RuntimeException If a parameter is invalid - */ - public function __construct($envPrefix, $colorOption = '') - { - if (!is_string($envPrefix) || empty($envPrefix) || !is_string($colorOption)) { - throw new \RuntimeException('Invalid constructor parameter'); - } - - self::$name = strtoupper($envPrefix); - $this->envAllowXdebug = self::$name.self::SUFFIX_ALLOW; - $this->envOriginalInis = self::$name.self::SUFFIX_INIS; - - $this->colorOption = $colorOption; - - if (extension_loaded('xdebug')) { - $ext = new \ReflectionExtension('xdebug'); - $this->loaded = $ext->getVersion() ?: 'unknown'; - } - - if ($this->cli = PHP_SAPI === 'cli') { - $this->debug = getenv(self::DEBUG); - } - - $this->statusWriter = new Status($this->envAllowXdebug, (bool) $this->debug); - } - - /** - * Activates status message output to a PSR3 logger - * - * @param LoggerInterface $logger - * - * @return $this - */ - public function setLogger(LoggerInterface $logger) - { - $this->statusWriter->setLogger($logger); - return $this; - } - - /** - * Sets the main script location if it cannot be called from argv - * - * @param string $script - * - * @return $this - */ - public function setMainScript($script) - { - $this->script = $script; - return $this; - } - - /** - * Persist the settings to keep Xdebug out of sub-processes - * - * @return $this - */ - public function setPersistent() - { - $this->persistent = true; - return $this; - } - - /** - * Checks if Xdebug is loaded and the process needs to be restarted - * - * This behaviour can be disabled by setting the MYAPP_ALLOW_XDEBUG - * environment variable to 1. This variable is used internally so that - * the restarted process is created only once. - */ - public function check() - { - $this->notify(Status::CHECK, $this->loaded); - $envArgs = explode('|', (string) getenv($this->envAllowXdebug)); - - if (empty($envArgs[0]) && $this->requiresRestart((bool) $this->loaded)) { - // Restart required - $this->notify(Status::RESTART); - - if ($this->prepareRestart()) { - $command = $this->getCommand(); - $this->restart($command); - } - return; - } - - if (self::RESTART_ID === $envArgs[0] && count($envArgs) === 5) { - // Restarted, so unset environment variable and use saved values - $this->notify(Status::RESTARTED); - - Process::setEnv($this->envAllowXdebug); - self::$inRestart = true; - - if (!$this->loaded) { - // Skipped version is only set if Xdebug is not loaded - self::$skipped = $envArgs[1]; - } - - $this->tryEnableSignals(); - - // Put restart settings in the environment - $this->setEnvRestartSettings($envArgs); - return; - } - - $this->notify(Status::NORESTART); - - if ($settings = self::getRestartSettings()) { - // Called with existing settings, so sync our settings - $this->syncSettings($settings); - } - } - - /** - * Returns an array of php.ini locations with at least one entry - * - * The equivalent of calling php_ini_loaded_file then php_ini_scanned_files. - * The loaded ini location is the first entry and may be empty. - * - * @return array - */ - public static function getAllIniFiles() - { - if (!empty(self::$name)) { - $env = getenv(self::$name.self::SUFFIX_INIS); - - if (false !== $env) { - return explode(PATH_SEPARATOR, $env); - } - } - - $paths = array((string) php_ini_loaded_file()); - - if ($scanned = php_ini_scanned_files()) { - $paths = array_merge($paths, array_map('trim', explode(',', $scanned))); - } - - return $paths; - } - - /** - * Returns an array of restart settings or null - * - * Settings will be available if the current process was restarted, or - * called with the settings from an existing restart. - * - * @return array|null - */ - public static function getRestartSettings() - { - $envArgs = explode('|', (string) getenv(self::RESTART_SETTINGS)); - - if (count($envArgs) !== 6 - || (!self::$inRestart && php_ini_loaded_file() !== $envArgs[0])) { - return null; - } - - return array( - 'tmpIni' => $envArgs[0], - 'scannedInis' => (bool) $envArgs[1], - 'scanDir' => '*' === $envArgs[2] ? false : $envArgs[2], - 'phprc' => '*' === $envArgs[3] ? false : $envArgs[3], - 'inis' => explode(PATH_SEPARATOR, $envArgs[4]), - 'skipped' => $envArgs[5], - ); - } - - /** - * Returns the Xdebug version that triggered a successful restart - * - * @return string - */ - public static function getSkippedVersion() - { - return (string) self::$skipped; - } - - /** - * Returns true if Xdebug is loaded, or as directed by an extending class - * - * @param bool $isLoaded Whether Xdebug is loaded - * - * @return bool - */ - protected function requiresRestart($isLoaded) - { - return $isLoaded; - } - - /** - * Allows an extending class to access the tmpIni - * - * @param string $command - */ - protected function restart($command) - { - $this->doRestart($command); - } - - /** - * Executes the restarted command then deletes the tmp ini - * - * @param string $command - */ - private function doRestart($command) - { - $this->tryEnableSignals(); - $this->notify(Status::RESTARTING, $command); - - // Prefer proc_open to keep fds intact, because passthru pipes to stdout - if (function_exists('proc_open')) { - if (defined('PHP_WINDOWS_VERSION_BUILD') && PHP_VERSION_ID < 80000) { - $command = '"'.$command.'"'; - } - $process = proc_open($command, array(), $pipes); - if (is_resource($process)) { - $exitCode = proc_close($process); - } - } else { - passthru($command, $exitCode); - } - - if (!isset($exitCode)) { - // Unlikely that the default shell cannot be invoked - $this->notify(Status::ERROR, 'Unable to restart process'); - $exitCode = -1; - } else { - $this->notify(Status::INFO, 'Restarted process exited '.$exitCode); - } - - if ($this->debug === '2') { - $this->notify(Status::INFO, 'Temp ini saved: '.$this->tmpIni); - } else { - @unlink($this->tmpIni); - } - - exit($exitCode); - } - - /** - * Returns true if everything was written for the restart - * - * If any of the following fails (however unlikely) we must return false to - * stop potential recursion: - * - tmp ini file creation - * - environment variable creation - * - * @return bool - */ - private function prepareRestart() - { - $error = ''; - $iniFiles = self::getAllIniFiles(); - $scannedInis = count($iniFiles) > 1; - $tmpDir = sys_get_temp_dir(); - - if (!$this->cli) { - $error = 'Unsupported SAPI: '.PHP_SAPI; - } elseif (!defined('PHP_BINARY')) { - $error = 'PHP version is too old: '.PHP_VERSION; - } elseif (!$this->checkConfiguration($info)) { - $error = $info; - } elseif (!$this->checkScanDirConfig()) { - $error = 'PHP version does not report scanned inis: '.PHP_VERSION; - } elseif (!$this->checkMainScript()) { - $error = 'Unable to access main script: '.$this->script; - } elseif (!$this->writeTmpIni($iniFiles, $tmpDir, $error)) { - $error = $error ?: 'Unable to create temp ini file at: '.$tmpDir; - } elseif (!$this->setEnvironment($scannedInis, $iniFiles)) { - $error = 'Unable to set environment variables'; - } - - if ($error) { - $this->notify(Status::ERROR, $error); - } - - return empty($error); - } - - /** - * Returns true if the tmp ini file was written - * - * @param array $iniFiles All ini files used in the current process - * @param string $tmpDir The system temporary directory - * @param string $error Set by method if ini file cannot be read - * - * @return bool - */ - private function writeTmpIni(array $iniFiles, $tmpDir, &$error) - { - if (!$this->tmpIni = @tempnam($tmpDir, '')) { - return false; - } - - // $iniFiles has at least one item and it may be empty - if (empty($iniFiles[0])) { - array_shift($iniFiles); - } - - $content = ''; - $regex = '/^\s*(zend_extension\s*=.*xdebug.*)$/mi'; - - foreach ($iniFiles as $file) { - // Check for inaccessible ini files - if (($data = @file_get_contents($file)) === false) { - $error = 'Unable to read ini: '.$file; - return false; - } - $content .= preg_replace($regex, ';$1', $data).PHP_EOL; - } - - // Merge loaded settings into our ini content, if it is valid - if ($config = parse_ini_string($content)) { - $loaded = ini_get_all(null, false); - $content .= $this->mergeLoadedConfig($loaded, $config); - } - - // Work-around for https://bugs.php.net/bug.php?id=75932 - $content .= 'opcache.enable_cli=0'.PHP_EOL; - - return @file_put_contents($this->tmpIni, $content); - } - - /** - * Returns the restart command line - * - * @return string - */ - private function getCommand() - { - $php = array(PHP_BINARY); - $args = array_slice($_SERVER['argv'], 1); - - if (!$this->persistent) { - // Use command-line options - array_push($php, '-n', '-c', $this->tmpIni); - } - - if (defined('STDOUT') && Process::supportsColor(STDOUT)) { - $args = Process::addColorOption($args, $this->colorOption); - } - - $args = array_merge($php, array($this->script), $args); - - $cmd = Process::escape(array_shift($args), true, true); - foreach ($args as $arg) { - $cmd .= ' '.Process::escape($arg); - } - - return $cmd; - } - - /** - * Returns true if the restart environment variables were set - * - * No need to update $_SERVER since this is set in the restarted process. - * - * @param bool $scannedInis Whether there were scanned ini files - * @param array $iniFiles All ini files used in the current process - * - * @return bool - */ - private function setEnvironment($scannedInis, array $iniFiles) - { - $scanDir = getenv('PHP_INI_SCAN_DIR'); - $phprc = getenv('PHPRC'); - - // Make original inis available to restarted process - if (!putenv($this->envOriginalInis.'='.implode(PATH_SEPARATOR, $iniFiles))) { - return false; - } - - if ($this->persistent) { - // Use the environment to persist the settings - if (!putenv('PHP_INI_SCAN_DIR=') || !putenv('PHPRC='.$this->tmpIni)) { - return false; - } - } - - // Flag restarted process and save values for it to use - $envArgs = array( - self::RESTART_ID, - $this->loaded, - (int) $scannedInis, - false === $scanDir ? '*' : $scanDir, - false === $phprc ? '*' : $phprc, - ); - - return putenv($this->envAllowXdebug.'='.implode('|', $envArgs)); - } - - /** - * Logs status messages - * - * @param string $op Status handler constant - * @param null|string $data Optional data - */ - private function notify($op, $data = null) - { - $this->statusWriter->report($op, $data); - } - - /** - * Returns default, changed and command-line ini settings - * - * @param array $loadedConfig All current ini settings - * @param array $iniConfig Settings from user ini files - * - * @return string - */ - private function mergeLoadedConfig(array $loadedConfig, array $iniConfig) - { - $content = ''; - - foreach ($loadedConfig as $name => $value) { - // Value will either be null, string or array (HHVM only) - if (!is_string($value) - || strpos($name, 'xdebug') === 0 - || $name === 'apc.mmap_file_mask') { - continue; - } - - if (!isset($iniConfig[$name]) || $iniConfig[$name] !== $value) { - // Double-quote escape each value - $content .= $name.'="'.addcslashes($value, '\\"').'"'.PHP_EOL; - } - } - - return $content; - } - - /** - * Returns true if the script name can be used - * - * @return bool - */ - private function checkMainScript() - { - if (null !== $this->script) { - // Allow an application to set -- for standard input - return file_exists($this->script) || '--' === $this->script; - } - - if (file_exists($this->script = $_SERVER['argv'][0])) { - return true; - } - - // Use a backtrace to resolve Phar and chdir issues - $options = PHP_VERSION_ID >= 50306 ? DEBUG_BACKTRACE_IGNORE_ARGS : false; - $trace = debug_backtrace($options); - - if (($main = end($trace)) && isset($main['file'])) { - return file_exists($this->script = $main['file']); - } - - return false; - } - - /** - * Adds restart settings to the environment - * - * @param string[] $envArgs - */ - private function setEnvRestartSettings($envArgs) - { - $settings = array( - php_ini_loaded_file(), - $envArgs[2], - $envArgs[3], - $envArgs[4], - getenv($this->envOriginalInis), - self::$skipped, - ); - - Process::setEnv(self::RESTART_SETTINGS, implode('|', $settings)); - } - - /** - * Syncs settings and the environment if called with existing settings - * - * @param array $settings - */ - private function syncSettings(array $settings) - { - if (false === getenv($this->envOriginalInis)) { - // Called by another app, so make original inis available - Process::setEnv($this->envOriginalInis, implode(PATH_SEPARATOR, $settings['inis'])); - } - - self::$skipped = $settings['skipped']; - $this->notify(Status::INFO, 'Process called with existing restart settings'); - } - - /** - * Returns true if there are scanned inis and PHP is able to report them - * - * php_ini_scanned_files will fail when PHP_CONFIG_FILE_SCAN_DIR is empty. - * Fixed in 7.1.13 and 7.2.1 - * - * @return bool - */ - private function checkScanDirConfig() - { - return !(getenv('PHP_INI_SCAN_DIR') - && !PHP_CONFIG_FILE_SCAN_DIR - && (PHP_VERSION_ID < 70113 - || PHP_VERSION_ID === 70200)); - } - - /** - * Returns true if there are no known configuration issues - * - * @param string $info Set by method - * @return bool - */ - private function checkConfiguration(&$info) - { - if (!function_exists('proc_open') && !function_exists('passthru')) { - $info = 'execution functions have been disabled (proc_open or passthru required)'; - return false; - } - - if (extension_loaded('uopz') && !ini_get('uopz.disable')) { - // uopz works at opcode level and disables exit calls - if (function_exists('uopz_allow_exit')) { - @uopz_allow_exit(true); - } else { - $info = 'uopz extension is not compatible'; - return false; - } - } - - return true; - } - - /** - * Enables async signals and control interrupts in the restarted process - * - * Available on Unix PHP 7.1+ with the pcntl extension and Windows PHP 7.4+. - */ - private function tryEnableSignals() - { - if (function_exists('pcntl_async_signals') && function_exists('pcntl_signal')) { - pcntl_async_signals(true); - $message = 'Async signals enabled'; - - if (!self::$inRestart) { - // Restarting, so ignore SIGINT in parent - pcntl_signal(SIGINT, SIG_IGN); - $message .= ' (SIGINT = SIG_IGN)'; - } elseif (is_int(pcntl_signal_get_handler(SIGINT))) { - // Restarted, no handler set so force default action - pcntl_signal(SIGINT, SIG_DFL); - $message .= ' (SIGINT = SIG_DFL)'; - } - $this->notify(Status::INFO, $message); - } - - if (!self::$inRestart && function_exists('sapi_windows_set_ctrl_handler')) { - // Restarting, so set a handler to ignore CTRL events in the parent. - // This ensures that CTRL+C events will be available in the child - // process without having to enable them there, which is unreliable. - sapi_windows_set_ctrl_handler(function ($evt) {}); - $this->notify(Status::INFO, 'CTRL signals suppressed'); - } - } -} diff --git a/vendor/doctrine/inflector/LICENSE b/vendor/doctrine/inflector/LICENSE deleted file mode 100644 index 8c38cc1..0000000 --- a/vendor/doctrine/inflector/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2006-2015 Doctrine Project - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/doctrine/inflector/README.md b/vendor/doctrine/inflector/README.md deleted file mode 100644 index 6e3a97f..0000000 --- a/vendor/doctrine/inflector/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# Doctrine Inflector - -Doctrine Inflector is a small library that can perform string manipulations -with regard to uppercase/lowercase and singular/plural forms of words. - -[![Build Status](https://github.com/doctrine/inflector/workflows/Continuous%20Integration/badge.svg)](https://github.com/doctrine/inflector/actions?query=workflow%3A%22Continuous+Integration%22+branch%3A4.0.x) -[![Code Coverage](https://codecov.io/gh/doctrine/inflector/branch/2.0.x/graph/badge.svg)](https://codecov.io/gh/doctrine/inflector/branch/2.0.x) diff --git a/vendor/doctrine/inflector/composer.json b/vendor/doctrine/inflector/composer.json deleted file mode 100644 index f08fdc3..0000000 --- a/vendor/doctrine/inflector/composer.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "doctrine/inflector", - "type": "library", - "description": "PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.", - "keywords": ["php", "strings", "words", "manipulation", "inflector", "inflection", "uppercase", "lowercase", "singular", "plural"], - "homepage": "https://www.doctrine-project.org/projects/inflector.html", - "license": "MIT", - "authors": [ - {"name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com"}, - {"name": "Roman Borschel", "email": "roman@code-factory.org"}, - {"name": "Benjamin Eberlei", "email": "kontakt@beberlei.de"}, - {"name": "Jonathan Wage", "email": "jonwage@gmail.com"}, - {"name": "Johannes Schmitt", "email": "schmittjoh@gmail.com"} - ], - "require": { - "php": "^7.2 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^8.2", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpstan/phpstan-strict-rules": "^0.12", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", - "vimeo/psalm": "^4.10" - }, - "autoload": { - "psr-4": { - "Doctrine\\Inflector\\": "lib/Doctrine/Inflector" - } - }, - "autoload-dev": { - "psr-4": { - "Doctrine\\Tests\\Inflector\\": "tests/Doctrine/Tests/Inflector" - } - } -} diff --git a/vendor/doctrine/inflector/docs/en/index.rst b/vendor/doctrine/inflector/docs/en/index.rst deleted file mode 100644 index 29866f4..0000000 --- a/vendor/doctrine/inflector/docs/en/index.rst +++ /dev/null @@ -1,226 +0,0 @@ -Introduction -============ - -The Doctrine Inflector has methods for inflecting text. The features include pluralization, -singularization, converting between camelCase and under_score and capitalizing -words. - -Installation -============ - -You can install the Inflector with composer: - -.. code-block:: console - - $ composer require doctrine/inflector - -Usage -===== - -Using the inflector is easy, you can create a new ``Doctrine\Inflector\Inflector`` instance by using -the ``Doctrine\Inflector\InflectorFactory`` class: - -.. code-block:: php - - use Doctrine\Inflector\InflectorFactory; - - $inflector = InflectorFactory::create()->build(); - -By default it will create an English inflector. If you want to use another language, just pass the language -you want to create an inflector for to the ``createForLanguage()`` method: - -.. code-block:: php - - use Doctrine\Inflector\InflectorFactory; - use Doctrine\Inflector\Language; - - $inflector = InflectorFactory::createForLanguage(Language::SPANISH)->build(); - -The supported languages are as follows: - -- ``Language::ENGLISH`` -- ``Language::FRENCH`` -- ``Language::NORWEGIAN_BOKMAL`` -- ``Language::PORTUGUESE`` -- ``Language::SPANISH`` -- ``Language::TURKISH`` - -If you want to manually construct the inflector instead of using a factory, you can do so like this: - -.. code-block:: php - - use Doctrine\Inflector\CachedWordInflector; - use Doctrine\Inflector\RulesetInflector; - use Doctrine\Inflector\Rules\English; - - $inflector = new Inflector( - new CachedWordInflector(new RulesetInflector( - English\Rules::getSingularRuleset() - )), - new CachedWordInflector(new RulesetInflector( - English\Rules::getPluralRuleset() - )) - ); - -Adding Languages ----------------- - -If you are interested in adding support for your language, take a look at the other languages defined in the -``Doctrine\Inflector\Rules`` namespace and the tests located in ``Doctrine\Tests\Inflector\Rules``. You can copy -one of the languages and update the rules for your language. - -Once you have done this, send a pull request to the ``doctrine/inflector`` repository with the additions. - -Custom Setup -============ - -If you want to setup custom singular and plural rules, you can configure these in the factory: - -.. code-block:: php - - use Doctrine\Inflector\InflectorFactory; - use Doctrine\Inflector\Rules\Pattern; - use Doctrine\Inflector\Rules\Patterns; - use Doctrine\Inflector\Rules\Ruleset; - use Doctrine\Inflector\Rules\Substitution; - use Doctrine\Inflector\Rules\Substitutions; - use Doctrine\Inflector\Rules\Transformation; - use Doctrine\Inflector\Rules\Transformations; - use Doctrine\Inflector\Rules\Word; - - $inflector = InflectorFactory::create() - ->withSingularRules( - new Ruleset( - new Transformations( - new Transformation(new Pattern('/^(bil)er$/i'), '\1'), - new Transformation(new Pattern('/^(inflec|contribu)tors$/i'), '\1ta') - ), - new Patterns(new Pattern('singulars')), - new Substitutions(new Substitution(new Word('spins'), new Word('spinor'))) - ) - ) - ->withPluralRules( - new Ruleset( - new Transformations( - new Transformation(new Pattern('^(bil)er$'), '\1'), - new Transformation(new Pattern('^(inflec|contribu)tors$'), '\1ta') - ), - new Patterns(new Pattern('noflect'), new Pattern('abtuse')), - new Substitutions( - new Substitution(new Word('amaze'), new Word('amazable')), - new Substitution(new Word('phone'), new Word('phonezes')) - ) - ) - ) - ->build(); - -No operation inflector ----------------------- - -The ``Doctrine\Inflector\NoopWordInflector`` may be used to configure an inflector that doesn't perform any operation for -pluralization and/or singularization. If will simply return the input as output. - -This is an implementation of the `Null Object design pattern `_. - -.. code-block:: php - - use Doctrine\Inflector\Inflector; - use Doctrine\Inflector\NoopWordInflector; - - $inflector = new Inflector(new NoopWordInflector(), new NoopWordInflector()); - -Tableize -======== - -Converts ``ModelName`` to ``model_name``: - -.. code-block:: php - - echo $inflector->tableize('ModelName'); // model_name - -Classify -======== - -Converts ``model_name`` to ``ModelName``: - -.. code-block:: php - - echo $inflector->classify('model_name'); // ModelName - -Camelize -======== - -This method uses `Classify`_ and then converts the first character to lowercase: - -.. code-block:: php - - echo $inflector->camelize('model_name'); // modelName - -Capitalize -========== - -Takes a string and capitalizes all of the words, like PHP's built-in -``ucwords`` function. This extends that behavior, however, by allowing the -word delimiters to be configured, rather than only separating on -whitespace. - -Here is an example: - -.. code-block:: php - - $string = 'top-o-the-morning to all_of_you!'; - - echo $inflector->capitalize($string); // Top-O-The-Morning To All_of_you! - - echo $inflector->capitalize($string, '-_ '); // Top-O-The-Morning To All_Of_You! - -Pluralize -========= - -Returns a word in plural form. - -.. code-block:: php - - echo $inflector->pluralize('browser'); // browsers - -Singularize -=========== - -Returns a word in singular form. - -.. code-block:: php - - echo $inflector->singularize('browsers'); // browser - -Urlize -====== - -Generate a URL friendly string from a string of text: - -.. code-block:: php - - echo $inflector->urlize('My first blog post'); // my-first-blog-post - -Unaccent -======== - -You can unaccent a string of text using the ``unaccent()`` method: - -.. code-block:: php - - echo $inflector->unaccent('año'); // ano - -Legacy API -========== - -The API present in Inflector 1.x is still available, but will be deprecated in a future release and dropped for 3.0. -Support for languages other than English is available in the 2.0 API only. - -Acknowledgements -================ - -The language rules in this library have been adapted from several different sources, including but not limited to: - -- `Ruby On Rails Inflector `_ -- `ICanBoogie Inflector `_ -- `CakePHP Inflector `_ diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/CachedWordInflector.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/CachedWordInflector.php deleted file mode 100644 index 2d52908..0000000 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/CachedWordInflector.php +++ /dev/null @@ -1,24 +0,0 @@ -wordInflector = $wordInflector; - } - - public function inflect(string $word): string - { - return $this->cache[$word] ?? $this->cache[$word] = $this->wordInflector->inflect($word); - } -} diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/GenericLanguageInflectorFactory.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/GenericLanguageInflectorFactory.php deleted file mode 100644 index 166061d..0000000 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/GenericLanguageInflectorFactory.php +++ /dev/null @@ -1,66 +0,0 @@ -singularRulesets[] = $this->getSingularRuleset(); - $this->pluralRulesets[] = $this->getPluralRuleset(); - } - - final public function build(): Inflector - { - return new Inflector( - new CachedWordInflector(new RulesetInflector( - ...$this->singularRulesets - )), - new CachedWordInflector(new RulesetInflector( - ...$this->pluralRulesets - )) - ); - } - - final public function withSingularRules(?Ruleset $singularRules, bool $reset = false): LanguageInflectorFactory - { - if ($reset) { - $this->singularRulesets = []; - } - - if ($singularRules instanceof Ruleset) { - array_unshift($this->singularRulesets, $singularRules); - } - - return $this; - } - - final public function withPluralRules(?Ruleset $pluralRules, bool $reset = false): LanguageInflectorFactory - { - if ($reset) { - $this->pluralRulesets = []; - } - - if ($pluralRules instanceof Ruleset) { - array_unshift($this->pluralRulesets, $pluralRules); - } - - return $this; - } - - abstract protected function getSingularRuleset(): Ruleset; - - abstract protected function getPluralRuleset(): Ruleset; -} diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Inflector.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Inflector.php deleted file mode 100644 index 610a4cf..0000000 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Inflector.php +++ /dev/null @@ -1,507 +0,0 @@ - 'A', - 'Á' => 'A', - 'Â' => 'A', - 'Ã' => 'A', - 'Ä' => 'Ae', - 'Æ' => 'Ae', - 'Å' => 'Aa', - 'æ' => 'a', - 'Ç' => 'C', - 'È' => 'E', - 'É' => 'E', - 'Ê' => 'E', - 'Ë' => 'E', - 'Ì' => 'I', - 'Í' => 'I', - 'Î' => 'I', - 'Ï' => 'I', - 'Ñ' => 'N', - 'Ò' => 'O', - 'Ó' => 'O', - 'Ô' => 'O', - 'Õ' => 'O', - 'Ö' => 'Oe', - 'Ù' => 'U', - 'Ú' => 'U', - 'Û' => 'U', - 'Ü' => 'Ue', - 'Ý' => 'Y', - 'ß' => 'ss', - 'à' => 'a', - 'á' => 'a', - 'â' => 'a', - 'ã' => 'a', - 'ä' => 'ae', - 'å' => 'aa', - 'ç' => 'c', - 'è' => 'e', - 'é' => 'e', - 'ê' => 'e', - 'ë' => 'e', - 'ì' => 'i', - 'í' => 'i', - 'î' => 'i', - 'ï' => 'i', - 'ñ' => 'n', - 'ò' => 'o', - 'ó' => 'o', - 'ô' => 'o', - 'õ' => 'o', - 'ö' => 'oe', - 'ù' => 'u', - 'ú' => 'u', - 'û' => 'u', - 'ü' => 'ue', - 'ý' => 'y', - 'ÿ' => 'y', - 'Ā' => 'A', - 'ā' => 'a', - 'Ă' => 'A', - 'ă' => 'a', - 'Ą' => 'A', - 'ą' => 'a', - 'Ć' => 'C', - 'ć' => 'c', - 'Ĉ' => 'C', - 'ĉ' => 'c', - 'Ċ' => 'C', - 'ċ' => 'c', - 'Č' => 'C', - 'č' => 'c', - 'Ď' => 'D', - 'ď' => 'd', - 'Đ' => 'D', - 'đ' => 'd', - 'Ē' => 'E', - 'ē' => 'e', - 'Ĕ' => 'E', - 'ĕ' => 'e', - 'Ė' => 'E', - 'ė' => 'e', - 'Ę' => 'E', - 'ę' => 'e', - 'Ě' => 'E', - 'ě' => 'e', - 'Ĝ' => 'G', - 'ĝ' => 'g', - 'Ğ' => 'G', - 'ğ' => 'g', - 'Ġ' => 'G', - 'ġ' => 'g', - 'Ģ' => 'G', - 'ģ' => 'g', - 'Ĥ' => 'H', - 'ĥ' => 'h', - 'Ħ' => 'H', - 'ħ' => 'h', - 'Ĩ' => 'I', - 'ĩ' => 'i', - 'Ī' => 'I', - 'ī' => 'i', - 'Ĭ' => 'I', - 'ĭ' => 'i', - 'Į' => 'I', - 'į' => 'i', - 'İ' => 'I', - 'ı' => 'i', - 'IJ' => 'IJ', - 'ij' => 'ij', - 'Ĵ' => 'J', - 'ĵ' => 'j', - 'Ķ' => 'K', - 'ķ' => 'k', - 'ĸ' => 'k', - 'Ĺ' => 'L', - 'ĺ' => 'l', - 'Ļ' => 'L', - 'ļ' => 'l', - 'Ľ' => 'L', - 'ľ' => 'l', - 'Ŀ' => 'L', - 'ŀ' => 'l', - 'Ł' => 'L', - 'ł' => 'l', - 'Ń' => 'N', - 'ń' => 'n', - 'Ņ' => 'N', - 'ņ' => 'n', - 'Ň' => 'N', - 'ň' => 'n', - 'ʼn' => 'N', - 'Ŋ' => 'n', - 'ŋ' => 'N', - 'Ō' => 'O', - 'ō' => 'o', - 'Ŏ' => 'O', - 'ŏ' => 'o', - 'Ő' => 'O', - 'ő' => 'o', - 'Œ' => 'OE', - 'œ' => 'oe', - 'Ø' => 'O', - 'ø' => 'o', - 'Ŕ' => 'R', - 'ŕ' => 'r', - 'Ŗ' => 'R', - 'ŗ' => 'r', - 'Ř' => 'R', - 'ř' => 'r', - 'Ś' => 'S', - 'ś' => 's', - 'Ŝ' => 'S', - 'ŝ' => 's', - 'Ş' => 'S', - 'ş' => 's', - 'Š' => 'S', - 'š' => 's', - 'Ţ' => 'T', - 'ţ' => 't', - 'Ť' => 'T', - 'ť' => 't', - 'Ŧ' => 'T', - 'ŧ' => 't', - 'Ũ' => 'U', - 'ũ' => 'u', - 'Ū' => 'U', - 'ū' => 'u', - 'Ŭ' => 'U', - 'ŭ' => 'u', - 'Ů' => 'U', - 'ů' => 'u', - 'Ű' => 'U', - 'ű' => 'u', - 'Ų' => 'U', - 'ų' => 'u', - 'Ŵ' => 'W', - 'ŵ' => 'w', - 'Ŷ' => 'Y', - 'ŷ' => 'y', - 'Ÿ' => 'Y', - 'Ź' => 'Z', - 'ź' => 'z', - 'Ż' => 'Z', - 'ż' => 'z', - 'Ž' => 'Z', - 'ž' => 'z', - 'ſ' => 's', - '€' => 'E', - '£' => '', - ]; - - /** @var WordInflector */ - private $singularizer; - - /** @var WordInflector */ - private $pluralizer; - - public function __construct(WordInflector $singularizer, WordInflector $pluralizer) - { - $this->singularizer = $singularizer; - $this->pluralizer = $pluralizer; - } - - /** - * Converts a word into the format for a Doctrine table name. Converts 'ModelName' to 'model_name'. - */ - public function tableize(string $word): string - { - $tableized = preg_replace('~(?<=\\w)([A-Z])~u', '_$1', $word); - - if ($tableized === null) { - throw new RuntimeException(sprintf( - 'preg_replace returned null for value "%s"', - $word - )); - } - - return mb_strtolower($tableized); - } - - /** - * Converts a word into the format for a Doctrine class name. Converts 'table_name' to 'TableName'. - */ - public function classify(string $word): string - { - return str_replace([' ', '_', '-'], '', ucwords($word, ' _-')); - } - - /** - * Camelizes a word. This uses the classify() method and turns the first character to lowercase. - */ - public function camelize(string $word): string - { - return lcfirst($this->classify($word)); - } - - /** - * Uppercases words with configurable delimiters between words. - * - * Takes a string and capitalizes all of the words, like PHP's built-in - * ucwords function. This extends that behavior, however, by allowing the - * word delimiters to be configured, rather than only separating on - * whitespace. - * - * Here is an example: - * - * capitalize($string); - * // Top-O-The-Morning To All_of_you! - * - * echo $inflector->capitalize($string, '-_ '); - * // Top-O-The-Morning To All_Of_You! - * ?> - * - * - * @param string $string The string to operate on. - * @param string $delimiters A list of word separators. - * - * @return string The string with all delimiter-separated words capitalized. - */ - public function capitalize(string $string, string $delimiters = " \n\t\r\0\x0B-"): string - { - return ucwords($string, $delimiters); - } - - /** - * Checks if the given string seems like it has utf8 characters in it. - * - * @param string $string The string to check for utf8 characters in. - */ - public function seemsUtf8(string $string): bool - { - for ($i = 0; $i < strlen($string); $i++) { - if (ord($string[$i]) < 0x80) { - continue; // 0bbbbbbb - } - - if ((ord($string[$i]) & 0xE0) === 0xC0) { - $n = 1; // 110bbbbb - } elseif ((ord($string[$i]) & 0xF0) === 0xE0) { - $n = 2; // 1110bbbb - } elseif ((ord($string[$i]) & 0xF8) === 0xF0) { - $n = 3; // 11110bbb - } elseif ((ord($string[$i]) & 0xFC) === 0xF8) { - $n = 4; // 111110bb - } elseif ((ord($string[$i]) & 0xFE) === 0xFC) { - $n = 5; // 1111110b - } else { - return false; // Does not match any model - } - - for ($j = 0; $j < $n; $j++) { // n bytes matching 10bbbbbb follow ? - if (++$i === strlen($string) || ((ord($string[$i]) & 0xC0) !== 0x80)) { - return false; - } - } - } - - return true; - } - - /** - * Remove any illegal characters, accents, etc. - * - * @param string $string String to unaccent - * - * @return string Unaccented string - */ - public function unaccent(string $string): string - { - if (preg_match('/[\x80-\xff]/', $string) === false) { - return $string; - } - - if ($this->seemsUtf8($string)) { - $string = strtr($string, self::ACCENTED_CHARACTERS); - } else { - $characters = []; - - // Assume ISO-8859-1 if not UTF-8 - $characters['in'] = - chr(128) - . chr(131) - . chr(138) - . chr(142) - . chr(154) - . chr(158) - . chr(159) - . chr(162) - . chr(165) - . chr(181) - . chr(192) - . chr(193) - . chr(194) - . chr(195) - . chr(196) - . chr(197) - . chr(199) - . chr(200) - . chr(201) - . chr(202) - . chr(203) - . chr(204) - . chr(205) - . chr(206) - . chr(207) - . chr(209) - . chr(210) - . chr(211) - . chr(212) - . chr(213) - . chr(214) - . chr(216) - . chr(217) - . chr(218) - . chr(219) - . chr(220) - . chr(221) - . chr(224) - . chr(225) - . chr(226) - . chr(227) - . chr(228) - . chr(229) - . chr(231) - . chr(232) - . chr(233) - . chr(234) - . chr(235) - . chr(236) - . chr(237) - . chr(238) - . chr(239) - . chr(241) - . chr(242) - . chr(243) - . chr(244) - . chr(245) - . chr(246) - . chr(248) - . chr(249) - . chr(250) - . chr(251) - . chr(252) - . chr(253) - . chr(255); - - $characters['out'] = 'EfSZszYcYuAAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy'; - - $string = strtr($string, $characters['in'], $characters['out']); - - $doubleChars = []; - - $doubleChars['in'] = [ - chr(140), - chr(156), - chr(198), - chr(208), - chr(222), - chr(223), - chr(230), - chr(240), - chr(254), - ]; - - $doubleChars['out'] = ['OE', 'oe', 'AE', 'DH', 'TH', 'ss', 'ae', 'dh', 'th']; - - $string = str_replace($doubleChars['in'], $doubleChars['out'], $string); - } - - return $string; - } - - /** - * Convert any passed string to a url friendly string. - * Converts 'My first blog post' to 'my-first-blog-post' - * - * @param string $string String to urlize. - * - * @return string Urlized string. - */ - public function urlize(string $string): string - { - // Remove all non url friendly characters with the unaccent function - $unaccented = $this->unaccent($string); - - if (function_exists('mb_strtolower')) { - $lowered = mb_strtolower($unaccented); - } else { - $lowered = strtolower($unaccented); - } - - $replacements = [ - '/\W/' => ' ', - '/([A-Z]+)([A-Z][a-z])/' => '\1_\2', - '/([a-z\d])([A-Z])/' => '\1_\2', - '/[^A-Z^a-z^0-9^\/]+/' => '-', - ]; - - $urlized = $lowered; - - foreach ($replacements as $pattern => $replacement) { - $replaced = preg_replace($pattern, $replacement, $urlized); - - if ($replaced === null) { - throw new RuntimeException(sprintf( - 'preg_replace returned null for value "%s"', - $urlized - )); - } - - $urlized = $replaced; - } - - return trim($urlized, '-'); - } - - /** - * Returns a word in singular form. - * - * @param string $word The word in plural form. - * - * @return string The word in singular form. - */ - public function singularize(string $word): string - { - return $this->singularizer->inflect($word); - } - - /** - * Returns a word in plural form. - * - * @param string $word The word in singular form. - * - * @return string The word in plural form. - */ - public function pluralize(string $word): string - { - return $this->pluralizer->inflect($word); - } -} diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/InflectorFactory.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/InflectorFactory.php deleted file mode 100644 index a0740a7..0000000 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/InflectorFactory.php +++ /dev/null @@ -1,52 +0,0 @@ -getFlippedSubstitutions() - ); - } - - public static function getPluralRuleset(): Ruleset - { - return new Ruleset( - new Transformations(...Inflectible::getPlural()), - new Patterns(...Uninflected::getPlural()), - new Substitutions(...Inflectible::getIrregular()) - ); - } -} diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Uninflected.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Uninflected.php deleted file mode 100644 index e2656cc..0000000 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Uninflected.php +++ /dev/null @@ -1,193 +0,0 @@ -getFlippedSubstitutions() - ); - } - - public static function getPluralRuleset(): Ruleset - { - return new Ruleset( - new Transformations(...Inflectible::getPlural()), - new Patterns(...Uninflected::getPlural()), - new Substitutions(...Inflectible::getIrregular()) - ); - } -} diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Uninflected.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Uninflected.php deleted file mode 100644 index 3cf2444..0000000 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Uninflected.php +++ /dev/null @@ -1,34 +0,0 @@ -getFlippedSubstitutions() - ); - } - - public static function getPluralRuleset(): Ruleset - { - return new Ruleset( - new Transformations(...Inflectible::getPlural()), - new Patterns(...Uninflected::getPlural()), - new Substitutions(...Inflectible::getIrregular()) - ); - } -} diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Uninflected.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Uninflected.php deleted file mode 100644 index 5d878c6..0000000 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Uninflected.php +++ /dev/null @@ -1,36 +0,0 @@ -pattern = $pattern; - - if (isset($this->pattern[0]) && $this->pattern[0] === '/') { - $this->regex = $this->pattern; - } else { - $this->regex = '/' . $this->pattern . '/i'; - } - } - - public function getPattern(): string - { - return $this->pattern; - } - - public function getRegex(): string - { - return $this->regex; - } - - public function matches(string $word): bool - { - return preg_match($this->getRegex(), $word) === 1; - } -} diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Patterns.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Patterns.php deleted file mode 100644 index e8d45cb..0000000 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Patterns.php +++ /dev/null @@ -1,34 +0,0 @@ -patterns = $patterns; - - $patterns = array_map(static function (Pattern $pattern): string { - return $pattern->getPattern(); - }, $this->patterns); - - $this->regex = '/^(?:' . implode('|', $patterns) . ')$/i'; - } - - public function matches(string $word): bool - { - return preg_match($this->regex, $word, $regs) === 1; - } -} diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Inflectible.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Inflectible.php deleted file mode 100644 index 95564d4..0000000 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Inflectible.php +++ /dev/null @@ -1,104 +0,0 @@ -getFlippedSubstitutions() - ); - } - - public static function getPluralRuleset(): Ruleset - { - return new Ruleset( - new Transformations(...Inflectible::getPlural()), - new Patterns(...Uninflected::getPlural()), - new Substitutions(...Inflectible::getIrregular()) - ); - } -} diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Uninflected.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Uninflected.php deleted file mode 100644 index 58c34f9..0000000 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Uninflected.php +++ /dev/null @@ -1,38 +0,0 @@ -regular = $regular; - $this->uninflected = $uninflected; - $this->irregular = $irregular; - } - - public function getRegular(): Transformations - { - return $this->regular; - } - - public function getUninflected(): Patterns - { - return $this->uninflected; - } - - public function getIrregular(): Substitutions - { - return $this->irregular; - } -} diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Inflectible.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Inflectible.php deleted file mode 100644 index c6862fa..0000000 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Inflectible.php +++ /dev/null @@ -1,53 +0,0 @@ -getFlippedSubstitutions() - ); - } - - public static function getPluralRuleset(): Ruleset - { - return new Ruleset( - new Transformations(...Inflectible::getPlural()), - new Patterns(...Uninflected::getPlural()), - new Substitutions(...Inflectible::getIrregular()) - ); - } -} diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Uninflected.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Uninflected.php deleted file mode 100644 index c743b39..0000000 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Uninflected.php +++ /dev/null @@ -1,36 +0,0 @@ -from = $from; - $this->to = $to; - } - - public function getFrom(): Word - { - return $this->from; - } - - public function getTo(): Word - { - return $this->to; - } -} diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Substitutions.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Substitutions.php deleted file mode 100644 index 17ee296..0000000 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Substitutions.php +++ /dev/null @@ -1,57 +0,0 @@ -substitutions[$substitution->getFrom()->getWord()] = $substitution; - } - } - - public function getFlippedSubstitutions(): Substitutions - { - $substitutions = []; - - foreach ($this->substitutions as $substitution) { - $substitutions[] = new Substitution( - $substitution->getTo(), - $substitution->getFrom() - ); - } - - return new Substitutions(...$substitutions); - } - - public function inflect(string $word): string - { - $lowerWord = strtolower($word); - - if (isset($this->substitutions[$lowerWord])) { - $firstLetterUppercase = $lowerWord[0] !== $word[0]; - - $toWord = $this->substitutions[$lowerWord]->getTo()->getWord(); - - if ($firstLetterUppercase) { - return strtoupper($toWord[0]) . substr($toWord, 1); - } - - return $toWord; - } - - return $word; - } -} diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Transformation.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Transformation.php deleted file mode 100644 index 30dcd59..0000000 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Transformation.php +++ /dev/null @@ -1,39 +0,0 @@ -pattern = $pattern; - $this->replacement = $replacement; - } - - public function getPattern(): Pattern - { - return $this->pattern; - } - - public function getReplacement(): string - { - return $this->replacement; - } - - public function inflect(string $word): string - { - return (string) preg_replace($this->pattern->getRegex(), $this->replacement, $word); - } -} diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Transformations.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Transformations.php deleted file mode 100644 index b6a48fa..0000000 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Transformations.php +++ /dev/null @@ -1,29 +0,0 @@ -transformations = $transformations; - } - - public function inflect(string $word): string - { - foreach ($this->transformations as $transformation) { - if ($transformation->getPattern()->matches($word)) { - return $transformation->inflect($word); - } - } - - return $word; - } -} diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Inflectible.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Inflectible.php deleted file mode 100644 index d7b7064..0000000 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Inflectible.php +++ /dev/null @@ -1,40 +0,0 @@ -getFlippedSubstitutions() - ); - } - - public static function getPluralRuleset(): Ruleset - { - return new Ruleset( - new Transformations(...Inflectible::getPlural()), - new Patterns(...Uninflected::getPlural()), - new Substitutions(...Inflectible::getIrregular()) - ); - } -} diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Uninflected.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Uninflected.php deleted file mode 100644 index a75d248..0000000 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Uninflected.php +++ /dev/null @@ -1,36 +0,0 @@ -word = $word; - } - - public function getWord(): string - { - return $this->word; - } -} diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/RulesetInflector.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/RulesetInflector.php deleted file mode 100644 index 12b2ed5..0000000 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/RulesetInflector.php +++ /dev/null @@ -1,56 +0,0 @@ -rulesets = array_merge([$ruleset], $rulesets); - } - - public function inflect(string $word): string - { - if ($word === '') { - return ''; - } - - foreach ($this->rulesets as $ruleset) { - if ($ruleset->getUninflected()->matches($word)) { - return $word; - } - - $inflected = $ruleset->getIrregular()->inflect($word); - - if ($inflected !== $word) { - return $inflected; - } - - $inflected = $ruleset->getRegular()->inflect($word); - - if ($inflected !== $word) { - return $inflected; - } - } - - return $word; - } -} diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/WordInflector.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/WordInflector.php deleted file mode 100644 index b88b1d6..0000000 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/WordInflector.php +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - diff --git a/vendor/doctrine/instantiator/.doctrine-project.json b/vendor/doctrine/instantiator/.doctrine-project.json deleted file mode 100644 index eb4f455..0000000 --- a/vendor/doctrine/instantiator/.doctrine-project.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "active": true, - "name": "Instantiator", - "slug": "instantiator", - "docsSlug": "doctrine-instantiator", - "codePath": "/src", - "versions": [ - { - "name": "1.4", - "branchName": "master", - "slug": "latest", - "upcoming": true - }, - { - "name": "1.3", - "branchName": "1.3.x", - "slug": "1.3", - "aliases": [ - "current", - "stable" - ], - "maintained": true, - "current": true - }, - { - "name": "1.2", - "branchName": "1.2.x", - "slug": "1.2" - }, - { - "name": "1.1", - "branchName": "1.1.x", - "slug": "1.1" - }, - { - "name": "1.0", - "branchName": "1.0.x", - "slug": "1.0" - } - ] -} diff --git a/vendor/doctrine/instantiator/.github/FUNDING.yml b/vendor/doctrine/instantiator/.github/FUNDING.yml deleted file mode 100644 index 9a35064..0000000 --- a/vendor/doctrine/instantiator/.github/FUNDING.yml +++ /dev/null @@ -1,3 +0,0 @@ -patreon: phpdoctrine -tidelift: packagist/doctrine%2Finstantiator -custom: https://www.doctrine-project.org/sponsorship.html diff --git a/vendor/doctrine/instantiator/.github/workflows/coding-standards.yml b/vendor/doctrine/instantiator/.github/workflows/coding-standards.yml deleted file mode 100644 index 92981b1..0000000 --- a/vendor/doctrine/instantiator/.github/workflows/coding-standards.yml +++ /dev/null @@ -1,48 +0,0 @@ - -name: "Coding Standards" - -on: - pull_request: - branches: - - "*.x" - push: - branches: - - "*.x" - -env: - COMPOSER_ROOT_VERSION: "1.4" - -jobs: - coding-standards: - name: "Coding Standards" - runs-on: "ubuntu-20.04" - - strategy: - matrix: - php-version: - - "7.4" - - steps: - - name: "Checkout" - uses: "actions/checkout@v2" - - - name: "Install PHP" - uses: "shivammathur/setup-php@v2" - with: - coverage: "none" - php-version: "${{ matrix.php-version }}" - tools: "cs2pr" - - - name: "Cache dependencies installed with Composer" - uses: "actions/cache@v2" - with: - path: "~/.composer/cache" - key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}" - restore-keys: "php-${{ matrix.php-version }}-composer-locked-" - - - name: "Install dependencies with Composer" - run: "composer install --no-interaction --no-progress" - - # https://github.com/doctrine/.github/issues/3 - - name: "Run PHP_CodeSniffer" - run: "vendor/bin/phpcs -q --no-colors --report=checkstyle | cs2pr" diff --git a/vendor/doctrine/instantiator/.github/workflows/continuous-integration.yml b/vendor/doctrine/instantiator/.github/workflows/continuous-integration.yml deleted file mode 100644 index 493374f..0000000 --- a/vendor/doctrine/instantiator/.github/workflows/continuous-integration.yml +++ /dev/null @@ -1,91 +0,0 @@ - -name: "Continuous Integration" - -on: - pull_request: - branches: - - "*.x" - push: - branches: - - "*.x" - -env: - fail-fast: true - COMPOSER_ROOT_VERSION: "1.4" - -jobs: - phpunit: - name: "PHPUnit with SQLite" - runs-on: "ubuntu-20.04" - - strategy: - matrix: - php-version: - - "7.1" - - "7.2" - - "7.3" - - "7.4" - - "8.0" - - steps: - - name: "Checkout" - uses: "actions/checkout@v2" - with: - fetch-depth: 2 - - - name: "Install PHP with XDebug" - uses: "shivammathur/setup-php@v2" - if: "${{ matrix.php-version == '7.1' }}" - with: - php-version: "${{ matrix.php-version }}" - coverage: "xdebug" - ini-values: "zend.assertions=1" - - - name: "Install PHP with PCOV" - uses: "shivammathur/setup-php@v2" - if: "${{ matrix.php-version != '7.1' }}" - with: - php-version: "${{ matrix.php-version }}" - coverage: "pcov" - ini-values: "zend.assertions=1" - - - name: "Cache dependencies installed with composer" - uses: "actions/cache@v2" - with: - path: "~/.composer/cache" - key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}" - restore-keys: "php-${{ matrix.php-version }}-composer-locked-" - - - name: "Install dependencies with composer" - run: "composer update --no-interaction --no-progress" - - - name: "Run PHPUnit" - run: "vendor/bin/phpunit --coverage-clover=coverage.xml" - - - name: "Upload coverage file" - uses: "actions/upload-artifact@v2" - with: - name: "phpunit-${{ matrix.php-version }}.coverage" - path: "coverage.xml" - - upload_coverage: - name: "Upload coverage to Codecov" - runs-on: "ubuntu-20.04" - needs: - - "phpunit" - - steps: - - name: "Checkout" - uses: "actions/checkout@v2" - with: - fetch-depth: 2 - - - name: "Download coverage files" - uses: "actions/download-artifact@v2" - with: - path: "reports" - - - name: "Upload to Codecov" - uses: "codecov/codecov-action@v1" - with: - directory: reports diff --git a/vendor/doctrine/instantiator/.github/workflows/phpbench.yml b/vendor/doctrine/instantiator/.github/workflows/phpbench.yml deleted file mode 100644 index 9d131e7..0000000 --- a/vendor/doctrine/instantiator/.github/workflows/phpbench.yml +++ /dev/null @@ -1,50 +0,0 @@ - -name: "Performance benchmark" - -on: - pull_request: - branches: - - "*.x" - push: - branches: - - "*.x" - -env: - fail-fast: true - COMPOSER_ROOT_VERSION: "1.4" - -jobs: - phpbench: - name: "PHPBench" - runs-on: "ubuntu-20.04" - - strategy: - matrix: - php-version: - - "7.4" - - steps: - - name: "Checkout" - uses: "actions/checkout@v2" - with: - fetch-depth: 2 - - - name: "Install PHP" - uses: "shivammathur/setup-php@v2" - with: - php-version: "${{ matrix.php-version }}" - coverage: "pcov" - ini-values: "zend.assertions=1" - - - name: "Cache dependencies installed with composer" - uses: "actions/cache@v2" - with: - path: "~/.composer/cache" - key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}" - restore-keys: "php-${{ matrix.php-version }}-composer-locked-" - - - name: "Install dependencies with composer" - run: "composer update --no-interaction --no-progress" - - - name: "Run PHPBench" - run: "php ./vendor/bin/phpbench run --iterations=3 --warmup=1 --report=aggregate" diff --git a/vendor/doctrine/instantiator/.github/workflows/release-on-milestone-closed.yml b/vendor/doctrine/instantiator/.github/workflows/release-on-milestone-closed.yml deleted file mode 100644 index b7a56f7..0000000 --- a/vendor/doctrine/instantiator/.github/workflows/release-on-milestone-closed.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: "Automatic Releases" - -on: - milestone: - types: - - "closed" - -jobs: - release: - name: "Git tag, release & create merge-up PR" - runs-on: "ubuntu-20.04" - - steps: - - name: "Checkout" - uses: "actions/checkout@v2" - - - name: "Release" - uses: "laminas/automatic-releases@v1" - with: - command-name: "laminas:automatic-releases:release" - env: - "GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }} - "SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }} - "GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }} - "GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }} - - - name: "Create Merge-Up Pull Request" - uses: "laminas/automatic-releases@v1" - with: - command-name: "laminas:automatic-releases:create-merge-up-pull-request" - env: - "GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }} - "SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }} - "GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }} - "GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }} - - - name: "Create new milestones" - uses: "laminas/automatic-releases@v1" - with: - command-name: "laminas:automatic-releases:create-milestones" - env: - "GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }} - "SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }} - "GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }} - "GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }} diff --git a/vendor/doctrine/instantiator/.github/workflows/static-analysis.yml b/vendor/doctrine/instantiator/.github/workflows/static-analysis.yml deleted file mode 100644 index 4a58318..0000000 --- a/vendor/doctrine/instantiator/.github/workflows/static-analysis.yml +++ /dev/null @@ -1,47 +0,0 @@ - -name: "Static Analysis" - -on: - pull_request: - branches: - - "*.x" - push: - branches: - - "*.x" - -env: - COMPOSER_ROOT_VERSION: "1.4" - -jobs: - static-analysis-phpstan: - name: "Static Analysis with PHPStan" - runs-on: "ubuntu-20.04" - - strategy: - matrix: - php-version: - - "7.4" - - steps: - - name: "Checkout code" - uses: "actions/checkout@v2" - - - name: "Install PHP" - uses: "shivammathur/setup-php@v2" - with: - coverage: "none" - php-version: "${{ matrix.php-version }}" - tools: "cs2pr" - - - name: "Cache dependencies installed with composer" - uses: "actions/cache@v2" - with: - path: "~/.composer/cache" - key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}" - restore-keys: "php-${{ matrix.php-version }}-composer-locked-" - - - name: "Install dependencies with composer" - run: "composer install --no-interaction --no-progress" - - - name: "Run a static analysis with phpstan/phpstan" - run: "vendor/bin/phpstan analyse --error-format=checkstyle | cs2pr" diff --git a/vendor/doctrine/instantiator/CONTRIBUTING.md b/vendor/doctrine/instantiator/CONTRIBUTING.md deleted file mode 100644 index c1a2c42..0000000 --- a/vendor/doctrine/instantiator/CONTRIBUTING.md +++ /dev/null @@ -1,35 +0,0 @@ -# Contributing - - * Follow the [Doctrine Coding Standard](https://github.com/doctrine/coding-standard) - * The project will follow strict [object calisthenics](http://www.slideshare.net/guilhermeblanco/object-calisthenics-applied-to-php) - * Any contribution must provide tests for additional introduced conditions - * Any un-confirmed issue needs a failing test case before being accepted - * Pull requests must be sent from a new hotfix/feature branch, not from `master`. - -## Installation - -To install the project and run the tests, you need to clone it first: - -```sh -$ git clone git://github.com/doctrine/instantiator.git -``` - -You will then need to run a composer installation: - -```sh -$ cd Instantiator -$ curl -s https://getcomposer.org/installer | php -$ php composer.phar update -``` - -## Testing - -The PHPUnit version to be used is the one installed as a dev- dependency via composer: - -```sh -$ ./vendor/bin/phpunit -``` - -Accepted coverage for new contributions is 80%. Any contribution not satisfying this requirement -won't be merged. - diff --git a/vendor/doctrine/instantiator/LICENSE b/vendor/doctrine/instantiator/LICENSE deleted file mode 100644 index 4d983d1..0000000 --- a/vendor/doctrine/instantiator/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2014 Doctrine Project - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/doctrine/instantiator/README.md b/vendor/doctrine/instantiator/README.md deleted file mode 100644 index 4bc02b6..0000000 --- a/vendor/doctrine/instantiator/README.md +++ /dev/null @@ -1,38 +0,0 @@ -# Instantiator - -This library provides a way of avoiding usage of constructors when instantiating PHP classes. - -[![Build Status](https://travis-ci.org/doctrine/instantiator.svg?branch=master)](https://travis-ci.org/doctrine/instantiator) -[![Code Coverage](https://codecov.io/gh/doctrine/instantiator/branch/master/graph/badge.svg)](https://codecov.io/gh/doctrine/instantiator/branch/master) -[![Dependency Status](https://www.versioneye.com/package/php--doctrine--instantiator/badge.svg)](https://www.versioneye.com/package/php--doctrine--instantiator) - -[![Latest Stable Version](https://poser.pugx.org/doctrine/instantiator/v/stable.png)](https://packagist.org/packages/doctrine/instantiator) -[![Latest Unstable Version](https://poser.pugx.org/doctrine/instantiator/v/unstable.png)](https://packagist.org/packages/doctrine/instantiator) - -## Installation - -The suggested installation method is via [composer](https://getcomposer.org/): - -```sh -php composer.phar require "doctrine/instantiator:~1.0.3" -``` - -## Usage - -The instantiator is able to create new instances of any class without using the constructor or any API of the class -itself: - -```php -$instantiator = new \Doctrine\Instantiator\Instantiator(); - -$instance = $instantiator->instantiate(\My\ClassName\Here::class); -``` - -## Contributing - -Please read the [CONTRIBUTING.md](CONTRIBUTING.md) contents if you wish to help out! - -## Credits - -This library was migrated from [ocramius/instantiator](https://github.com/Ocramius/Instantiator), which -has been donated to the doctrine organization, and which is now deprecated in favour of this package. diff --git a/vendor/doctrine/instantiator/composer.json b/vendor/doctrine/instantiator/composer.json deleted file mode 100644 index 1ce3473..0000000 --- a/vendor/doctrine/instantiator/composer.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "doctrine/instantiator", - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "type": "library", - "license": "MIT", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", - "keywords": [ - "instantiate", - "constructor" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "https://ocramius.github.io/" - } - ], - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "ext-phar": "*", - "ext-pdo": "*", - "doctrine/coding-standard": "^8.0", - "phpbench/phpbench": "^0.13 || 1.0.0-alpha2", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" - }, - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "autoload-dev": { - "psr-0": { - "DoctrineTest\\InstantiatorPerformance\\": "tests", - "DoctrineTest\\InstantiatorTest\\": "tests", - "DoctrineTest\\InstantiatorTestAsset\\": "tests" - } - } -} diff --git a/vendor/doctrine/instantiator/docs/en/index.rst b/vendor/doctrine/instantiator/docs/en/index.rst deleted file mode 100644 index 0c85da0..0000000 --- a/vendor/doctrine/instantiator/docs/en/index.rst +++ /dev/null @@ -1,68 +0,0 @@ -Introduction -============ - -This library provides a way of avoiding usage of constructors when instantiating PHP classes. - -Installation -============ - -The suggested installation method is via `composer`_: - -.. code-block:: console - - $ composer require doctrine/instantiator - -Usage -===== - -The instantiator is able to create new instances of any class without -using the constructor or any API of the class itself: - -.. code-block:: php - - instantiate(User::class); - -Contributing -============ - -- Follow the `Doctrine Coding Standard`_ -- The project will follow strict `object calisthenics`_ -- Any contribution must provide tests for additional introduced - conditions -- Any un-confirmed issue needs a failing test case before being - accepted -- Pull requests must be sent from a new hotfix/feature branch, not from - ``master``. - -Testing -======= - -The PHPUnit version to be used is the one installed as a dev- dependency -via composer: - -.. code-block:: console - - $ ./vendor/bin/phpunit - -Accepted coverage for new contributions is 80%. Any contribution not -satisfying this requirement won’t be merged. - -Credits -======= - -This library was migrated from `ocramius/instantiator`_, which has been -donated to the doctrine organization, and which is now deprecated in -favour of this package. - -.. _composer: https://getcomposer.org/ -.. _CONTRIBUTING.md: CONTRIBUTING.md -.. _ocramius/instantiator: https://github.com/Ocramius/Instantiator -.. _Doctrine Coding Standard: https://github.com/doctrine/coding-standard -.. _object calisthenics: http://www.slideshare.net/guilhermeblanco/object-calisthenics-applied-to-php diff --git a/vendor/doctrine/instantiator/docs/en/sidebar.rst b/vendor/doctrine/instantiator/docs/en/sidebar.rst deleted file mode 100644 index 0c36479..0000000 --- a/vendor/doctrine/instantiator/docs/en/sidebar.rst +++ /dev/null @@ -1,4 +0,0 @@ -.. toctree:: - :depth: 3 - - index diff --git a/vendor/doctrine/instantiator/phpbench.json b/vendor/doctrine/instantiator/phpbench.json deleted file mode 100644 index fce5dd6..0000000 --- a/vendor/doctrine/instantiator/phpbench.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "bootstrap": "vendor/autoload.php", - "path": "tests/DoctrineTest/InstantiatorPerformance" -} diff --git a/vendor/doctrine/instantiator/phpcs.xml.dist b/vendor/doctrine/instantiator/phpcs.xml.dist deleted file mode 100644 index 4e08b16..0000000 --- a/vendor/doctrine/instantiator/phpcs.xml.dist +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - src - tests - - - - - - - - - - - - - - - - - */src/* - - - - */src/* - - - - tests/DoctrineTest/InstantiatorTestAsset/AbstractClassAsset.php - - - - src/Doctrine/Instantiator/Exception/UnexpectedValueException.php - src/Doctrine/Instantiator/Exception/InvalidArgumentException.php - - - - src/Doctrine/Instantiator/Exception/ExceptionInterface.php - src/Doctrine/Instantiator/InstantiatorInterface.php - - diff --git a/vendor/doctrine/instantiator/phpstan.neon.dist b/vendor/doctrine/instantiator/phpstan.neon.dist deleted file mode 100644 index 60bec6b..0000000 --- a/vendor/doctrine/instantiator/phpstan.neon.dist +++ /dev/null @@ -1,15 +0,0 @@ -includes: - - vendor/phpstan/phpstan-phpunit/extension.neon - - vendor/phpstan/phpstan-phpunit/rules.neon - -parameters: - level: max - paths: - - src - - tests - - ignoreErrors: - # dynamic properties confuse static analysis - - - message: '#Access to an undefined property object::\$foo\.#' - path: '*/tests/DoctrineTest/InstantiatorTest/InstantiatorTest.php' diff --git a/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/ExceptionInterface.php b/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/ExceptionInterface.php deleted file mode 100644 index e6a5195..0000000 --- a/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/ExceptionInterface.php +++ /dev/null @@ -1,12 +0,0 @@ - $reflectionClass - */ - public static function fromAbstractClass(ReflectionClass $reflectionClass): self - { - return new self(sprintf( - 'The provided class "%s" is abstract, and can not be instantiated', - $reflectionClass->getName() - )); - } -} diff --git a/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/UnexpectedValueException.php b/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/UnexpectedValueException.php deleted file mode 100644 index 19842bb..0000000 --- a/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/UnexpectedValueException.php +++ /dev/null @@ -1,57 +0,0 @@ - $reflectionClass - */ - public static function fromSerializationTriggeredException( - ReflectionClass $reflectionClass, - Exception $exception - ): self { - return new self( - sprintf( - 'An exception was raised while trying to instantiate an instance of "%s" via un-serialization', - $reflectionClass->getName() - ), - 0, - $exception - ); - } - - /** - * @template T of object - * @phpstan-param ReflectionClass $reflectionClass - */ - public static function fromUncleanUnSerialization( - ReflectionClass $reflectionClass, - string $errorString, - int $errorCode, - string $errorFile, - int $errorLine - ): self { - return new self( - sprintf( - 'Could not produce an instance of "%s" via un-serialization, since an error was triggered ' - . 'in file "%s" at line "%d"', - $reflectionClass->getName(), - $errorFile, - $errorLine - ), - 0, - new Exception($errorString, $errorCode) - ); - } -} diff --git a/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Instantiator.php b/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Instantiator.php deleted file mode 100644 index ee4803c..0000000 --- a/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Instantiator.php +++ /dev/null @@ -1,232 +0,0 @@ -buildAndCacheFromFactory($className); - } - - /** - * Builds the requested object and caches it in static properties for performance - * - * @return object - * - * @template T of object - * @phpstan-param class-string $className - * - * @phpstan-return T - */ - private function buildAndCacheFromFactory(string $className) - { - $factory = self::$cachedInstantiators[$className] = $this->buildFactory($className); - $instance = $factory(); - - if ($this->isSafeToClone(new ReflectionClass($instance))) { - self::$cachedCloneables[$className] = clone $instance; - } - - return $instance; - } - - /** - * Builds a callable capable of instantiating the given $className without - * invoking its constructor. - * - * @throws InvalidArgumentException - * @throws UnexpectedValueException - * @throws ReflectionException - * - * @template T of object - * @phpstan-param class-string $className - * - * @phpstan-return callable(): T - */ - private function buildFactory(string $className): callable - { - $reflectionClass = $this->getReflectionClass($className); - - if ($this->isInstantiableViaReflection($reflectionClass)) { - return [$reflectionClass, 'newInstanceWithoutConstructor']; - } - - $serializedString = sprintf( - '%s:%d:"%s":0:{}', - is_subclass_of($className, Serializable::class) ? self::SERIALIZATION_FORMAT_USE_UNSERIALIZER : self::SERIALIZATION_FORMAT_AVOID_UNSERIALIZER, - strlen($className), - $className - ); - - $this->checkIfUnSerializationIsSupported($reflectionClass, $serializedString); - - return static function () use ($serializedString) { - return unserialize($serializedString); - }; - } - - /** - * @throws InvalidArgumentException - * @throws ReflectionException - * - * @template T of object - * @phpstan-param class-string $className - * - * @phpstan-return ReflectionClass - */ - private function getReflectionClass(string $className): ReflectionClass - { - if (! class_exists($className)) { - throw InvalidArgumentException::fromNonExistingClass($className); - } - - $reflection = new ReflectionClass($className); - - if ($reflection->isAbstract()) { - throw InvalidArgumentException::fromAbstractClass($reflection); - } - - return $reflection; - } - - /** - * @throws UnexpectedValueException - * - * @template T of object - * @phpstan-param ReflectionClass $reflectionClass - */ - private function checkIfUnSerializationIsSupported(ReflectionClass $reflectionClass, string $serializedString): void - { - set_error_handler(static function (int $code, string $message, string $file, int $line) use ($reflectionClass, &$error): bool { - $error = UnexpectedValueException::fromUncleanUnSerialization( - $reflectionClass, - $message, - $code, - $file, - $line - ); - - return true; - }); - - try { - $this->attemptInstantiationViaUnSerialization($reflectionClass, $serializedString); - } finally { - restore_error_handler(); - } - - if ($error) { - throw $error; - } - } - - /** - * @throws UnexpectedValueException - * - * @template T of object - * @phpstan-param ReflectionClass $reflectionClass - */ - private function attemptInstantiationViaUnSerialization(ReflectionClass $reflectionClass, string $serializedString): void - { - try { - unserialize($serializedString); - } catch (Exception $exception) { - throw UnexpectedValueException::fromSerializationTriggeredException($reflectionClass, $exception); - } - } - - /** - * @template T of object - * @phpstan-param ReflectionClass $reflectionClass - */ - private function isInstantiableViaReflection(ReflectionClass $reflectionClass): bool - { - return ! ($this->hasInternalAncestors($reflectionClass) && $reflectionClass->isFinal()); - } - - /** - * Verifies whether the given class is to be considered internal - * - * @template T of object - * @phpstan-param ReflectionClass $reflectionClass - */ - private function hasInternalAncestors(ReflectionClass $reflectionClass): bool - { - do { - if ($reflectionClass->isInternal()) { - return true; - } - - $reflectionClass = $reflectionClass->getParentClass(); - } while ($reflectionClass); - - return false; - } - - /** - * Checks if a class is cloneable - * - * Classes implementing `__clone` cannot be safely cloned, as that may cause side-effects. - * - * @template T of object - * @phpstan-param ReflectionClass $reflectionClass - */ - private function isSafeToClone(ReflectionClass $reflectionClass): bool - { - return $reflectionClass->isCloneable() - && ! $reflectionClass->hasMethod('__clone') - && ! $reflectionClass->isSubclassOf(ArrayIterator::class); - } -} diff --git a/vendor/doctrine/instantiator/src/Doctrine/Instantiator/InstantiatorInterface.php b/vendor/doctrine/instantiator/src/Doctrine/Instantiator/InstantiatorInterface.php deleted file mode 100644 index 3ffff82..0000000 --- a/vendor/doctrine/instantiator/src/Doctrine/Instantiator/InstantiatorInterface.php +++ /dev/null @@ -1,23 +0,0 @@ - $className - */ - public function instantiate($className); -} diff --git a/vendor/guzzlehttp/guzzle/CHANGELOG.md b/vendor/guzzlehttp/guzzle/CHANGELOG.md deleted file mode 100644 index b278efc..0000000 --- a/vendor/guzzlehttp/guzzle/CHANGELOG.md +++ /dev/null @@ -1,1490 +0,0 @@ -# Change Log - -Please refer to [UPGRADING](UPGRADING.md) guide for upgrading to a major version. - -## 7.4.1 - 2021-12-06 - -### Changed - -- Replaced implicit URI to string coercion [#2946](https://github.com/guzzle/guzzle/pull/2946) -- Allow `symfony/deprecation-contracts` version 3 [#2961](https://github.com/guzzle/guzzle/pull/2961) - -### Fixed - -- Only close curl handle if it's done [#2950](https://github.com/guzzle/guzzle/pull/2950) - -## 7.4.0 - 2021-10-18 - -### Added - -- Support PHP 8.1 [#2929](https://github.com/guzzle/guzzle/pull/2929), [#2939](https://github.com/guzzle/guzzle/pull/2939) -- Support `psr/log` version 2 and 3 [#2943](https://github.com/guzzle/guzzle/pull/2943) - -### Fixed - -- Make sure we always call `restore_error_handler()` [#2915](https://github.com/guzzle/guzzle/pull/2915) -- Fix progress parameter type compatibility between the cURL and stream handlers [#2936](https://github.com/guzzle/guzzle/pull/2936) -- Throw `InvalidArgumentException` when an incorrect `headers` array is provided [#2916](https://github.com/guzzle/guzzle/pull/2916), [#2942](https://github.com/guzzle/guzzle/pull/2942) - -### Changed - -- Be more strict with types [#2914](https://github.com/guzzle/guzzle/pull/2914), [#2917](https://github.com/guzzle/guzzle/pull/2917), [#2919](https://github.com/guzzle/guzzle/pull/2919), [#2945](https://github.com/guzzle/guzzle/pull/2945) - -## 7.3.0 - 2021-03-23 - -### Added - -- Support for DER and P12 certificates [#2413](https://github.com/guzzle/guzzle/pull/2413) -- Support the cURL (http://) scheme for StreamHandler proxies [#2850](https://github.com/guzzle/guzzle/pull/2850) -- Support for `guzzlehttp/psr7:^2.0` [#2878](https://github.com/guzzle/guzzle/pull/2878) - -### Fixed - -- Handle exceptions on invalid header consistently between PHP versions and handlers [#2872](https://github.com/guzzle/guzzle/pull/2872) - -## 7.2.0 - 2020-10-10 - -### Added - -- Support for PHP 8 [#2712](https://github.com/guzzle/guzzle/pull/2712), [#2715](https://github.com/guzzle/guzzle/pull/2715), [#2789](https://github.com/guzzle/guzzle/pull/2789) -- Support passing a body summarizer to the http errors middleware [#2795](https://github.com/guzzle/guzzle/pull/2795) - -### Fixed - -- Handle exceptions during response creation [#2591](https://github.com/guzzle/guzzle/pull/2591) -- Fix CURLOPT_ENCODING not to be overwritten [#2595](https://github.com/guzzle/guzzle/pull/2595) -- Make sure the Request always has a body object [#2804](https://github.com/guzzle/guzzle/pull/2804) - -### Changed - -- The `TooManyRedirectsException` has a response [#2660](https://github.com/guzzle/guzzle/pull/2660) -- Avoid "functions" from dependencies [#2712](https://github.com/guzzle/guzzle/pull/2712) - -### Deprecated - -- Using environment variable GUZZLE_CURL_SELECT_TIMEOUT [#2786](https://github.com/guzzle/guzzle/pull/2786) - -## 7.1.1 - 2020-09-30 - -### Fixed - -- Incorrect EOF detection for response body streams on Windows. - -### Changed - -- We dont connect curl `sink` on HEAD requests. -- Removed some PHP 5 workarounds - -## 7.1.0 - 2020-09-22 - -### Added - -- `GuzzleHttp\MessageFormatterInterface` - -### Fixed - -- Fixed issue that caused cookies with no value not to be stored. -- On redirects, we allow all safe methods like GET, HEAD and OPTIONS. -- Fixed logging on empty responses. -- Make sure MessageFormatter::format returns string - -### Deprecated - -- All functions in `GuzzleHttp` has been deprecated. Use static methods on `Utils` instead. -- `ClientInterface::getConfig()` -- `Client::getConfig()` -- `Client::__call()` -- `Utils::defaultCaBundle()` -- `CurlFactory::LOW_CURL_VERSION_NUMBER` - -## 7.0.1 - 2020-06-27 - -* Fix multiply defined functions fatal error [#2699](https://github.com/guzzle/guzzle/pull/2699) - -## 7.0.0 - 2020-06-27 - -No changes since 7.0.0-rc1. - -## 7.0.0-rc1 - 2020-06-15 - -### Changed - -* Use error level for logging errors in Middleware [#2629](https://github.com/guzzle/guzzle/pull/2629) -* Disabled IDN support by default and require ext-intl to use it [#2675](https://github.com/guzzle/guzzle/pull/2675) - -## 7.0.0-beta2 - 2020-05-25 - -### Added - -* Using `Utils` class instead of functions in the `GuzzleHttp` namespace. [#2546](https://github.com/guzzle/guzzle/pull/2546) -* `ClientInterface::MAJOR_VERSION` [#2583](https://github.com/guzzle/guzzle/pull/2583) - -### Changed - -* Avoid the `getenv` function when unsafe [#2531](https://github.com/guzzle/guzzle/pull/2531) -* Added real client methods [#2529](https://github.com/guzzle/guzzle/pull/2529) -* Avoid functions due to global install conflicts [#2546](https://github.com/guzzle/guzzle/pull/2546) -* Use Symfony intl-idn polyfill [#2550](https://github.com/guzzle/guzzle/pull/2550) -* Adding methods for HTTP verbs like `Client::get()`, `Client::head()`, `Client::patch()` etc [#2529](https://github.com/guzzle/guzzle/pull/2529) -* `ConnectException` extends `TransferException` [#2541](https://github.com/guzzle/guzzle/pull/2541) -* Updated the default User Agent to "GuzzleHttp/7" [#2654](https://github.com/guzzle/guzzle/pull/2654) - -### Fixed - -* Various intl icu issues [#2626](https://github.com/guzzle/guzzle/pull/2626) - -### Removed - -* Pool option `pool_size` [#2528](https://github.com/guzzle/guzzle/pull/2528) - -## 7.0.0-beta1 - 2019-12-30 - -The diff might look very big but 95% of Guzzle users will be able to upgrade without modification. -Please see [the upgrade document](UPGRADING.md) that describes all BC breaking changes. - -### Added - -* Implement PSR-18 and dropped PHP 5 support [#2421](https://github.com/guzzle/guzzle/pull/2421) [#2474](https://github.com/guzzle/guzzle/pull/2474) -* PHP 7 types [#2442](https://github.com/guzzle/guzzle/pull/2442) [#2449](https://github.com/guzzle/guzzle/pull/2449) [#2466](https://github.com/guzzle/guzzle/pull/2466) [#2497](https://github.com/guzzle/guzzle/pull/2497) [#2499](https://github.com/guzzle/guzzle/pull/2499) -* IDN support for redirects [2424](https://github.com/guzzle/guzzle/pull/2424) - -### Changed - -* Dont allow passing null as third argument to `BadResponseException::__construct()` [#2427](https://github.com/guzzle/guzzle/pull/2427) -* Use SAPI constant instead of method call [#2450](https://github.com/guzzle/guzzle/pull/2450) -* Use native function invocation [#2444](https://github.com/guzzle/guzzle/pull/2444) -* Better defaults for PHP installations with old ICU lib [2454](https://github.com/guzzle/guzzle/pull/2454) -* Added visibility to all constants [#2462](https://github.com/guzzle/guzzle/pull/2462) -* Dont allow passing `null` as URI to `Client::request()` and `Client::requestAsync()` [#2461](https://github.com/guzzle/guzzle/pull/2461) -* Widen the exception argument to throwable [#2495](https://github.com/guzzle/guzzle/pull/2495) - -### Fixed - -* Logging when Promise rejected with a string [#2311](https://github.com/guzzle/guzzle/pull/2311) - -### Removed - -* Class `SeekException` [#2162](https://github.com/guzzle/guzzle/pull/2162) -* `RequestException::getResponseBodySummary()` [#2425](https://github.com/guzzle/guzzle/pull/2425) -* `CookieJar::getCookieValue()` [#2433](https://github.com/guzzle/guzzle/pull/2433) -* `uri_template()` and `UriTemplate` [#2440](https://github.com/guzzle/guzzle/pull/2440) -* Request options `save_to` and `exceptions` [#2464](https://github.com/guzzle/guzzle/pull/2464) - -## 6.5.2 - 2019-12-23 - -* idn_to_ascii() fix for old PHP versions [#2489](https://github.com/guzzle/guzzle/pull/2489) - -## 6.5.1 - 2019-12-21 - -* Better defaults for PHP installations with old ICU lib [#2454](https://github.com/guzzle/guzzle/pull/2454) -* IDN support for redirects [#2424](https://github.com/guzzle/guzzle/pull/2424) - -## 6.5.0 - 2019-12-07 - -* Improvement: Added support for reset internal queue in MockHandler. [#2143](https://github.com/guzzle/guzzle/pull/2143) -* Improvement: Added support to pass arbitrary options to `curl_multi_init`. [#2287](https://github.com/guzzle/guzzle/pull/2287) -* Fix: Gracefully handle passing `null` to the `header` option. [#2132](https://github.com/guzzle/guzzle/pull/2132) -* Fix: `RetryMiddleware` did not do exponential delay between retires due unit mismatch. [#2132](https://github.com/guzzle/guzzle/pull/2132) -* Fix: Prevent undefined offset when using array for ssl_key options. [#2348](https://github.com/guzzle/guzzle/pull/2348) -* Deprecated `ClientInterface::VERSION` - -## 6.4.1 - 2019-10-23 - -* No `guzzle.phar` was created in 6.4.0 due expired API token. This release will fix that -* Added `parent::__construct()` to `FileCookieJar` and `SessionCookieJar` - -## 6.4.0 - 2019-10-23 - -* Improvement: Improved error messages when using curl < 7.21.2 [#2108](https://github.com/guzzle/guzzle/pull/2108) -* Fix: Test if response is readable before returning a summary in `RequestException::getResponseBodySummary()` [#2081](https://github.com/guzzle/guzzle/pull/2081) -* Fix: Add support for GUZZLE_CURL_SELECT_TIMEOUT environment variable [#2161](https://github.com/guzzle/guzzle/pull/2161) -* Improvement: Added `GuzzleHttp\Exception\InvalidArgumentException` [#2163](https://github.com/guzzle/guzzle/pull/2163) -* Improvement: Added `GuzzleHttp\_current_time()` to use `hrtime()` if that function exists. [#2242](https://github.com/guzzle/guzzle/pull/2242) -* Improvement: Added curl's `appconnect_time` in `TransferStats` [#2284](https://github.com/guzzle/guzzle/pull/2284) -* Improvement: Make GuzzleException extend Throwable wherever it's available [#2273](https://github.com/guzzle/guzzle/pull/2273) -* Fix: Prevent concurrent writes to file when saving `CookieJar` [#2335](https://github.com/guzzle/guzzle/pull/2335) -* Improvement: Update `MockHandler` so we can test transfer time [#2362](https://github.com/guzzle/guzzle/pull/2362) - -## 6.3.3 - 2018-04-22 - -* Fix: Default headers when decode_content is specified - - -## 6.3.2 - 2018-03-26 - -* Fix: Release process - - -## 6.3.1 - 2018-03-26 - -* Bug fix: Parsing 0 epoch expiry times in cookies [#2014](https://github.com/guzzle/guzzle/pull/2014) -* Improvement: Better ConnectException detection [#2012](https://github.com/guzzle/guzzle/pull/2012) -* Bug fix: Malformed domain that contains a "/" [#1999](https://github.com/guzzle/guzzle/pull/1999) -* Bug fix: Undefined offset when a cookie has no first key-value pair [#1998](https://github.com/guzzle/guzzle/pull/1998) -* Improvement: Support PHPUnit 6 [#1953](https://github.com/guzzle/guzzle/pull/1953) -* Bug fix: Support empty headers [#1915](https://github.com/guzzle/guzzle/pull/1915) -* Bug fix: Ignore case during header modifications [#1916](https://github.com/guzzle/guzzle/pull/1916) - -+ Minor code cleanups, documentation fixes and clarifications. - - -## 6.3.0 - 2017-06-22 - -* Feature: force IP resolution (ipv4 or ipv6) [#1608](https://github.com/guzzle/guzzle/pull/1608), [#1659](https://github.com/guzzle/guzzle/pull/1659) -* Improvement: Don't include summary in exception message when body is empty [#1621](https://github.com/guzzle/guzzle/pull/1621) -* Improvement: Handle `on_headers` option in MockHandler [#1580](https://github.com/guzzle/guzzle/pull/1580) -* Improvement: Added SUSE Linux CA path [#1609](https://github.com/guzzle/guzzle/issues/1609) -* Improvement: Use class reference for getting the name of the class instead of using hardcoded strings [#1641](https://github.com/guzzle/guzzle/pull/1641) -* Feature: Added `read_timeout` option [#1611](https://github.com/guzzle/guzzle/pull/1611) -* Bug fix: PHP 7.x fixes [#1685](https://github.com/guzzle/guzzle/pull/1685), [#1686](https://github.com/guzzle/guzzle/pull/1686), [#1811](https://github.com/guzzle/guzzle/pull/1811) -* Deprecation: BadResponseException instantiation without a response [#1642](https://github.com/guzzle/guzzle/pull/1642) -* Feature: Added NTLM auth [#1569](https://github.com/guzzle/guzzle/pull/1569) -* Feature: Track redirect HTTP status codes [#1711](https://github.com/guzzle/guzzle/pull/1711) -* Improvement: Check handler type during construction [#1745](https://github.com/guzzle/guzzle/pull/1745) -* Improvement: Always include the Content-Length if there's a body [#1721](https://github.com/guzzle/guzzle/pull/1721) -* Feature: Added convenience method to access a cookie by name [#1318](https://github.com/guzzle/guzzle/pull/1318) -* Bug fix: Fill `CURLOPT_CAPATH` and `CURLOPT_CAINFO` properly [#1684](https://github.com/guzzle/guzzle/pull/1684) -* Improvement: Use `\GuzzleHttp\Promise\rejection_for` function instead of object init [#1827](https://github.com/guzzle/guzzle/pull/1827) - - -+ Minor code cleanups, documentation fixes and clarifications. - -## 6.2.3 - 2017-02-28 - -* Fix deprecations with guzzle/psr7 version 1.4 - -## 6.2.2 - 2016-10-08 - -* Allow to pass nullable Response to delay callable -* Only add scheme when host is present -* Fix drain case where content-length is the literal string zero -* Obfuscate in-URL credentials in exceptions - -## 6.2.1 - 2016-07-18 - -* Address HTTP_PROXY security vulnerability, CVE-2016-5385: - https://httpoxy.org/ -* Fixing timeout bug with StreamHandler: - https://github.com/guzzle/guzzle/pull/1488 -* Only read up to `Content-Length` in PHP StreamHandler to avoid timeouts when - a server does not honor `Connection: close`. -* Ignore URI fragment when sending requests. - -## 6.2.0 - 2016-03-21 - -* Feature: added `GuzzleHttp\json_encode` and `GuzzleHttp\json_decode`. - https://github.com/guzzle/guzzle/pull/1389 -* Bug fix: Fix sleep calculation when waiting for delayed requests. - https://github.com/guzzle/guzzle/pull/1324 -* Feature: More flexible history containers. - https://github.com/guzzle/guzzle/pull/1373 -* Bug fix: defer sink stream opening in StreamHandler. - https://github.com/guzzle/guzzle/pull/1377 -* Bug fix: do not attempt to escape cookie values. - https://github.com/guzzle/guzzle/pull/1406 -* Feature: report original content encoding and length on decoded responses. - https://github.com/guzzle/guzzle/pull/1409 -* Bug fix: rewind seekable request bodies before dispatching to cURL. - https://github.com/guzzle/guzzle/pull/1422 -* Bug fix: provide an empty string to `http_build_query` for HHVM workaround. - https://github.com/guzzle/guzzle/pull/1367 - -## 6.1.1 - 2015-11-22 - -* Bug fix: Proxy::wrapSync() now correctly proxies to the appropriate handler - https://github.com/guzzle/guzzle/commit/911bcbc8b434adce64e223a6d1d14e9a8f63e4e4 -* Feature: HandlerStack is now more generic. - https://github.com/guzzle/guzzle/commit/f2102941331cda544745eedd97fc8fd46e1ee33e -* Bug fix: setting verify to false in the StreamHandler now disables peer - verification. https://github.com/guzzle/guzzle/issues/1256 -* Feature: Middleware now uses an exception factory, including more error - context. https://github.com/guzzle/guzzle/pull/1282 -* Feature: better support for disabled functions. - https://github.com/guzzle/guzzle/pull/1287 -* Bug fix: fixed regression where MockHandler was not using `sink`. - https://github.com/guzzle/guzzle/pull/1292 - -## 6.1.0 - 2015-09-08 - -* Feature: Added the `on_stats` request option to provide access to transfer - statistics for requests. https://github.com/guzzle/guzzle/pull/1202 -* Feature: Added the ability to persist session cookies in CookieJars. - https://github.com/guzzle/guzzle/pull/1195 -* Feature: Some compatibility updates for Google APP Engine - https://github.com/guzzle/guzzle/pull/1216 -* Feature: Added support for NO_PROXY to prevent the use of a proxy based on - a simple set of rules. https://github.com/guzzle/guzzle/pull/1197 -* Feature: Cookies can now contain square brackets. - https://github.com/guzzle/guzzle/pull/1237 -* Bug fix: Now correctly parsing `=` inside of quotes in Cookies. - https://github.com/guzzle/guzzle/pull/1232 -* Bug fix: Cusotm cURL options now correctly override curl options of the - same name. https://github.com/guzzle/guzzle/pull/1221 -* Bug fix: Content-Type header is now added when using an explicitly provided - multipart body. https://github.com/guzzle/guzzle/pull/1218 -* Bug fix: Now ignoring Set-Cookie headers that have no name. -* Bug fix: Reason phrase is no longer cast to an int in some cases in the - cURL handler. https://github.com/guzzle/guzzle/pull/1187 -* Bug fix: Remove the Authorization header when redirecting if the Host - header changes. https://github.com/guzzle/guzzle/pull/1207 -* Bug fix: Cookie path matching fixes - https://github.com/guzzle/guzzle/issues/1129 -* Bug fix: Fixing the cURL `body_as_string` setting - https://github.com/guzzle/guzzle/pull/1201 -* Bug fix: quotes are no longer stripped when parsing cookies. - https://github.com/guzzle/guzzle/issues/1172 -* Bug fix: `form_params` and `query` now always uses the `&` separator. - https://github.com/guzzle/guzzle/pull/1163 -* Bug fix: Adding a Content-Length to PHP stream wrapper requests if not set. - https://github.com/guzzle/guzzle/pull/1189 - -## 6.0.2 - 2015-07-04 - -* Fixed a memory leak in the curl handlers in which references to callbacks - were not being removed by `curl_reset`. -* Cookies are now extracted properly before redirects. -* Cookies now allow more character ranges. -* Decoded Content-Encoding responses are now modified to correctly reflect - their state if the encoding was automatically removed by a handler. This - means that the `Content-Encoding` header may be removed an the - `Content-Length` modified to reflect the message size after removing the - encoding. -* Added a more explicit error message when trying to use `form_params` and - `multipart` in the same request. -* Several fixes for HHVM support. -* Functions are now conditionally required using an additional level of - indirection to help with global Composer installations. - -## 6.0.1 - 2015-05-27 - -* Fixed a bug with serializing the `query` request option where the `&` - separator was missing. -* Added a better error message for when `body` is provided as an array. Please - use `form_params` or `multipart` instead. -* Various doc fixes. - -## 6.0.0 - 2015-05-26 - -* See the UPGRADING.md document for more information. -* Added `multipart` and `form_params` request options. -* Added `synchronous` request option. -* Added the `on_headers` request option. -* Fixed `expect` handling. -* No longer adding default middlewares in the client ctor. These need to be - present on the provided handler in order to work. -* Requests are no longer initiated when sending async requests with the - CurlMultiHandler. This prevents unexpected recursion from requests completing - while ticking the cURL loop. -* Removed the semantics of setting `default` to `true`. This is no longer - required now that the cURL loop is not ticked for async requests. -* Added request and response logging middleware. -* No longer allowing self signed certificates when using the StreamHandler. -* Ensuring that `sink` is valid if saving to a file. -* Request exceptions now include a "handler context" which provides handler - specific contextual information. -* Added `GuzzleHttp\RequestOptions` to allow request options to be applied - using constants. -* `$maxHandles` has been removed from CurlMultiHandler. -* `MultipartPostBody` is now part of the `guzzlehttp/psr7` package. - -## 5.3.0 - 2015-05-19 - -* Mock now supports `save_to` -* Marked `AbstractRequestEvent::getTransaction()` as public. -* Fixed a bug in which multiple headers using different casing would overwrite - previous headers in the associative array. -* Added `Utils::getDefaultHandler()` -* Marked `GuzzleHttp\Client::getDefaultUserAgent` as deprecated. -* URL scheme is now always lowercased. - -## 6.0.0-beta.1 - -* Requires PHP >= 5.5 -* Updated to use PSR-7 - * Requires immutable messages, which basically means an event based system - owned by a request instance is no longer possible. - * Utilizing the [Guzzle PSR-7 package](https://github.com/guzzle/psr7). - * Removed the dependency on `guzzlehttp/streams`. These stream abstractions - are available in the `guzzlehttp/psr7` package under the `GuzzleHttp\Psr7` - namespace. -* Added middleware and handler system - * Replaced the Guzzle event and subscriber system with a middleware system. - * No longer depends on RingPHP, but rather places the HTTP handlers directly - in Guzzle, operating on PSR-7 messages. - * Retry logic is now encapsulated in `GuzzleHttp\Middleware::retry`, which - means the `guzzlehttp/retry-subscriber` is now obsolete. - * Mocking responses is now handled using `GuzzleHttp\Handler\MockHandler`. -* Asynchronous responses - * No longer supports the `future` request option to send an async request. - Instead, use one of the `*Async` methods of a client (e.g., `requestAsync`, - `getAsync`, etc.). - * Utilizing `GuzzleHttp\Promise` instead of React's promise library to avoid - recursion required by chaining and forwarding react promises. See - https://github.com/guzzle/promises - * Added `requestAsync` and `sendAsync` to send request asynchronously. - * Added magic methods for `getAsync()`, `postAsync()`, etc. to send requests - asynchronously. -* Request options - * POST and form updates - * Added the `form_fields` and `form_files` request options. - * Removed the `GuzzleHttp\Post` namespace. - * The `body` request option no longer accepts an array for POST requests. - * The `exceptions` request option has been deprecated in favor of the - `http_errors` request options. - * The `save_to` request option has been deprecated in favor of `sink` request - option. -* Clients no longer accept an array of URI template string and variables for - URI variables. You will need to expand URI templates before passing them - into a client constructor or request method. -* Client methods `get()`, `post()`, `put()`, `patch()`, `options()`, etc. are - now magic methods that will send synchronous requests. -* Replaced `Utils.php` with plain functions in `functions.php`. -* Removed `GuzzleHttp\Collection`. -* Removed `GuzzleHttp\BatchResults`. Batched pool results are now returned as - an array. -* Removed `GuzzleHttp\Query`. Query string handling is now handled using an - associative array passed into the `query` request option. The query string - is serialized using PHP's `http_build_query`. If you need more control, you - can pass the query string in as a string. -* `GuzzleHttp\QueryParser` has been replaced with the - `GuzzleHttp\Psr7\parse_query`. - -## 5.2.0 - 2015-01-27 - -* Added `AppliesHeadersInterface` to make applying headers to a request based - on the body more generic and not specific to `PostBodyInterface`. -* Reduced the number of stack frames needed to send requests. -* Nested futures are now resolved in the client rather than the RequestFsm -* Finishing state transitions is now handled in the RequestFsm rather than the - RingBridge. -* Added a guard in the Pool class to not use recursion for request retries. - -## 5.1.0 - 2014-12-19 - -* Pool class no longer uses recursion when a request is intercepted. -* The size of a Pool can now be dynamically adjusted using a callback. - See https://github.com/guzzle/guzzle/pull/943. -* Setting a request option to `null` when creating a request with a client will - ensure that the option is not set. This allows you to overwrite default - request options on a per-request basis. - See https://github.com/guzzle/guzzle/pull/937. -* Added the ability to limit which protocols are allowed for redirects by - specifying a `protocols` array in the `allow_redirects` request option. -* Nested futures due to retries are now resolved when waiting for synchronous - responses. See https://github.com/guzzle/guzzle/pull/947. -* `"0"` is now an allowed URI path. See - https://github.com/guzzle/guzzle/pull/935. -* `Query` no longer typehints on the `$query` argument in the constructor, - allowing for strings and arrays. -* Exceptions thrown in the `end` event are now correctly wrapped with Guzzle - specific exceptions if necessary. - -## 5.0.3 - 2014-11-03 - -This change updates query strings so that they are treated as un-encoded values -by default where the value represents an un-encoded value to send over the -wire. A Query object then encodes the value before sending over the wire. This -means that even value query string values (e.g., ":") are url encoded. This -makes the Query class match PHP's http_build_query function. However, if you -want to send requests over the wire using valid query string characters that do -not need to be encoded, then you can provide a string to Url::setQuery() and -pass true as the second argument to specify that the query string is a raw -string that should not be parsed or encoded (unless a call to getQuery() is -subsequently made, forcing the query-string to be converted into a Query -object). - -## 5.0.2 - 2014-10-30 - -* Added a trailing `\r\n` to multipart/form-data payloads. See - https://github.com/guzzle/guzzle/pull/871 -* Added a `GuzzleHttp\Pool::send()` convenience method to match the docs. -* Status codes are now returned as integers. See - https://github.com/guzzle/guzzle/issues/881 -* No longer overwriting an existing `application/x-www-form-urlencoded` header - when sending POST requests, allowing for customized headers. See - https://github.com/guzzle/guzzle/issues/877 -* Improved path URL serialization. - - * No longer double percent-encoding characters in the path or query string if - they are already encoded. - * Now properly encoding the supplied path to a URL object, instead of only - encoding ' ' and '?'. - * Note: This has been changed in 5.0.3 to now encode query string values by - default unless the `rawString` argument is provided when setting the query - string on a URL: Now allowing many more characters to be present in the - query string without being percent encoded. See https://tools.ietf.org/html/rfc3986#appendix-A - -## 5.0.1 - 2014-10-16 - -Bugfix release. - -* Fixed an issue where connection errors still returned response object in - error and end events event though the response is unusable. This has been - corrected so that a response is not returned in the `getResponse` method of - these events if the response did not complete. https://github.com/guzzle/guzzle/issues/867 -* Fixed an issue where transfer statistics were not being populated in the - RingBridge. https://github.com/guzzle/guzzle/issues/866 - -## 5.0.0 - 2014-10-12 - -Adding support for non-blocking responses and some minor API cleanup. - -### New Features - -* Added support for non-blocking responses based on `guzzlehttp/guzzle-ring`. -* Added a public API for creating a default HTTP adapter. -* Updated the redirect plugin to be non-blocking so that redirects are sent - concurrently. Other plugins like this can now be updated to be non-blocking. -* Added a "progress" event so that you can get upload and download progress - events. -* Added `GuzzleHttp\Pool` which implements FutureInterface and transfers - requests concurrently using a capped pool size as efficiently as possible. -* Added `hasListeners()` to EmitterInterface. -* Removed `GuzzleHttp\ClientInterface::sendAll` and marked - `GuzzleHttp\Client::sendAll` as deprecated (it's still there, just not the - recommended way). - -### Breaking changes - -The breaking changes in this release are relatively minor. The biggest thing to -look out for is that request and response objects no longer implement fluent -interfaces. - -* Removed the fluent interfaces (i.e., `return $this`) from requests, - responses, `GuzzleHttp\Collection`, `GuzzleHttp\Url`, - `GuzzleHttp\Query`, `GuzzleHttp\Post\PostBody`, and - `GuzzleHttp\Cookie\SetCookie`. This blog post provides a good outline of - why I did this: https://ocramius.github.io/blog/fluent-interfaces-are-evil/. - This also makes the Guzzle message interfaces compatible with the current - PSR-7 message proposal. -* Removed "functions.php", so that Guzzle is truly PSR-4 compliant. Except - for the HTTP request functions from function.php, these functions are now - implemented in `GuzzleHttp\Utils` using camelCase. `GuzzleHttp\json_decode` - moved to `GuzzleHttp\Utils::jsonDecode`. `GuzzleHttp\get_path` moved to - `GuzzleHttp\Utils::getPath`. `GuzzleHttp\set_path` moved to - `GuzzleHttp\Utils::setPath`. `GuzzleHttp\batch` should now be - `GuzzleHttp\Pool::batch`, which returns an `objectStorage`. Using functions.php - caused problems for many users: they aren't PSR-4 compliant, require an - explicit include, and needed an if-guard to ensure that the functions are not - declared multiple times. -* Rewrote adapter layer. - * Removing all classes from `GuzzleHttp\Adapter`, these are now - implemented as callables that are stored in `GuzzleHttp\Ring\Client`. - * Removed the concept of "parallel adapters". Sending requests serially or - concurrently is now handled using a single adapter. - * Moved `GuzzleHttp\Adapter\Transaction` to `GuzzleHttp\Transaction`. The - Transaction object now exposes the request, response, and client as public - properties. The getters and setters have been removed. -* Removed the "headers" event. This event was only useful for changing the - body a response once the headers of the response were known. You can implement - a similar behavior in a number of ways. One example might be to use a - FnStream that has access to the transaction being sent. For example, when the - first byte is written, you could check if the response headers match your - expectations, and if so, change the actual stream body that is being - written to. -* Removed the `asArray` parameter from - `GuzzleHttp\Message\MessageInterface::getHeader`. If you want to get a header - value as an array, then use the newly added `getHeaderAsArray()` method of - `MessageInterface`. This change makes the Guzzle interfaces compatible with - the PSR-7 interfaces. -* `GuzzleHttp\Message\MessageFactory` no longer allows subclasses to add - custom request options using double-dispatch (this was an implementation - detail). Instead, you should now provide an associative array to the - constructor which is a mapping of the request option name mapping to a - function that applies the option value to a request. -* Removed the concept of "throwImmediately" from exceptions and error events. - This control mechanism was used to stop a transfer of concurrent requests - from completing. This can now be handled by throwing the exception or by - cancelling a pool of requests or each outstanding future request individually. -* Updated to "GuzzleHttp\Streams" 3.0. - * `GuzzleHttp\Stream\StreamInterface::getContents()` no longer accepts a - `maxLen` parameter. This update makes the Guzzle streams project - compatible with the current PSR-7 proposal. - * `GuzzleHttp\Stream\Stream::__construct`, - `GuzzleHttp\Stream\Stream::factory`, and - `GuzzleHttp\Stream\Utils::create` no longer accept a size in the second - argument. They now accept an associative array of options, including the - "size" key and "metadata" key which can be used to provide custom metadata. - -## 4.2.2 - 2014-09-08 - -* Fixed a memory leak in the CurlAdapter when reusing cURL handles. -* No longer using `request_fulluri` in stream adapter proxies. -* Relative redirects are now based on the last response, not the first response. - -## 4.2.1 - 2014-08-19 - -* Ensuring that the StreamAdapter does not always add a Content-Type header -* Adding automated github releases with a phar and zip - -## 4.2.0 - 2014-08-17 - -* Now merging in default options using a case-insensitive comparison. - Closes https://github.com/guzzle/guzzle/issues/767 -* Added the ability to automatically decode `Content-Encoding` response bodies - using the `decode_content` request option. This is set to `true` by default - to decode the response body if it comes over the wire with a - `Content-Encoding`. Set this value to `false` to disable decoding the - response content, and pass a string to provide a request `Accept-Encoding` - header and turn on automatic response decoding. This feature now allows you - to pass an `Accept-Encoding` header in the headers of a request but still - disable automatic response decoding. - Closes https://github.com/guzzle/guzzle/issues/764 -* Added the ability to throw an exception immediately when transferring - requests in parallel. Closes https://github.com/guzzle/guzzle/issues/760 -* Updating guzzlehttp/streams dependency to ~2.1 -* No longer utilizing the now deprecated namespaced methods from the stream - package. - -## 4.1.8 - 2014-08-14 - -* Fixed an issue in the CurlFactory that caused setting the `stream=false` - request option to throw an exception. - See: https://github.com/guzzle/guzzle/issues/769 -* TransactionIterator now calls rewind on the inner iterator. - See: https://github.com/guzzle/guzzle/pull/765 -* You can now set the `Content-Type` header to `multipart/form-data` - when creating POST requests to force multipart bodies. - See https://github.com/guzzle/guzzle/issues/768 - -## 4.1.7 - 2014-08-07 - -* Fixed an error in the HistoryPlugin that caused the same request and response - to be logged multiple times when an HTTP protocol error occurs. -* Ensuring that cURL does not add a default Content-Type when no Content-Type - has been supplied by the user. This prevents the adapter layer from modifying - the request that is sent over the wire after any listeners may have already - put the request in a desired state (e.g., signed the request). -* Throwing an exception when you attempt to send requests that have the - "stream" set to true in parallel using the MultiAdapter. -* Only calling curl_multi_select when there are active cURL handles. This was - previously changed and caused performance problems on some systems due to PHP - always selecting until the maximum select timeout. -* Fixed a bug where multipart/form-data POST fields were not correctly - aggregated (e.g., values with "&"). - -## 4.1.6 - 2014-08-03 - -* Added helper methods to make it easier to represent messages as strings, - including getting the start line and getting headers as a string. - -## 4.1.5 - 2014-08-02 - -* Automatically retrying cURL "Connection died, retrying a fresh connect" - errors when possible. -* cURL implementation cleanup -* Allowing multiple event subscriber listeners to be registered per event by - passing an array of arrays of listener configuration. - -## 4.1.4 - 2014-07-22 - -* Fixed a bug that caused multi-part POST requests with more than one field to - serialize incorrectly. -* Paths can now be set to "0" -* `ResponseInterface::xml` now accepts a `libxml_options` option and added a - missing default argument that was required when parsing XML response bodies. -* A `save_to` stream is now created lazily, which means that files are not - created on disk unless a request succeeds. - -## 4.1.3 - 2014-07-15 - -* Various fixes to multipart/form-data POST uploads -* Wrapping function.php in an if-statement to ensure Guzzle can be used - globally and in a Composer install -* Fixed an issue with generating and merging in events to an event array -* POST headers are only applied before sending a request to allow you to change - the query aggregator used before uploading -* Added much more robust query string parsing -* Fixed various parsing and normalization issues with URLs -* Fixing an issue where multi-valued headers were not being utilized correctly - in the StreamAdapter - -## 4.1.2 - 2014-06-18 - -* Added support for sending payloads with GET requests - -## 4.1.1 - 2014-06-08 - -* Fixed an issue related to using custom message factory options in subclasses -* Fixed an issue with nested form fields in a multi-part POST -* Fixed an issue with using the `json` request option for POST requests -* Added `ToArrayInterface` to `GuzzleHttp\Cookie\CookieJar` - -## 4.1.0 - 2014-05-27 - -* Added a `json` request option to easily serialize JSON payloads. -* Added a `GuzzleHttp\json_decode()` wrapper to safely parse JSON. -* Added `setPort()` and `getPort()` to `GuzzleHttp\Message\RequestInterface`. -* Added the ability to provide an emitter to a client in the client constructor. -* Added the ability to persist a cookie session using $_SESSION. -* Added a trait that can be used to add event listeners to an iterator. -* Removed request method constants from RequestInterface. -* Fixed warning when invalid request start-lines are received. -* Updated MessageFactory to work with custom request option methods. -* Updated cacert bundle to latest build. - -4.0.2 (2014-04-16) ------------------- - -* Proxy requests using the StreamAdapter now properly use request_fulluri (#632) -* Added the ability to set scalars as POST fields (#628) - -## 4.0.1 - 2014-04-04 - -* The HTTP status code of a response is now set as the exception code of - RequestException objects. -* 303 redirects will now correctly switch from POST to GET requests. -* The default parallel adapter of a client now correctly uses the MultiAdapter. -* HasDataTrait now initializes the internal data array as an empty array so - that the toArray() method always returns an array. - -## 4.0.0 - 2014-03-29 - -* For information on changes and upgrading, see: - https://github.com/guzzle/guzzle/blob/master/UPGRADING.md#3x-to-40 -* Added `GuzzleHttp\batch()` as a convenience function for sending requests in - parallel without needing to write asynchronous code. -* Restructured how events are added to `GuzzleHttp\ClientInterface::sendAll()`. - You can now pass a callable or an array of associative arrays where each - associative array contains the "fn", "priority", and "once" keys. - -## 4.0.0.rc-2 - 2014-03-25 - -* Removed `getConfig()` and `setConfig()` from clients to avoid confusion - around whether things like base_url, message_factory, etc. should be able to - be retrieved or modified. -* Added `getDefaultOption()` and `setDefaultOption()` to ClientInterface -* functions.php functions were renamed using snake_case to match PHP idioms -* Added support for `HTTP_PROXY`, `HTTPS_PROXY`, and - `GUZZLE_CURL_SELECT_TIMEOUT` environment variables -* Added the ability to specify custom `sendAll()` event priorities -* Added the ability to specify custom stream context options to the stream - adapter. -* Added a functions.php function for `get_path()` and `set_path()` -* CurlAdapter and MultiAdapter now use a callable to generate curl resources -* MockAdapter now properly reads a body and emits a `headers` event -* Updated Url class to check if a scheme and host are set before adding ":" - and "//". This allows empty Url (e.g., "") to be serialized as "". -* Parsing invalid XML no longer emits warnings -* Curl classes now properly throw AdapterExceptions -* Various performance optimizations -* Streams are created with the faster `Stream\create()` function -* Marked deprecation_proxy() as internal -* Test server is now a collection of static methods on a class - -## 4.0.0-rc.1 - 2014-03-15 - -* See https://github.com/guzzle/guzzle/blob/master/UPGRADING.md#3x-to-40 - -## 3.8.1 - 2014-01-28 - -* Bug: Always using GET requests when redirecting from a 303 response -* Bug: CURLOPT_SSL_VERIFYHOST is now correctly set to false when setting `$certificateAuthority` to false in - `Guzzle\Http\ClientInterface::setSslVerification()` -* Bug: RedirectPlugin now uses strict RFC 3986 compliance when combining a base URL with a relative URL -* Bug: The body of a request can now be set to `"0"` -* Sending PHP stream requests no longer forces `HTTP/1.0` -* Adding more information to ExceptionCollection exceptions so that users have more context, including a stack trace of - each sub-exception -* Updated the `$ref` attribute in service descriptions to merge over any existing parameters of a schema (rather than - clobbering everything). -* Merging URLs will now use the query string object from the relative URL (thus allowing custom query aggregators) -* Query strings are now parsed in a way that they do no convert empty keys with no value to have a dangling `=`. - For example `foo&bar=baz` is now correctly parsed and recognized as `foo&bar=baz` rather than `foo=&bar=baz`. -* Now properly escaping the regular expression delimiter when matching Cookie domains. -* Network access is now disabled when loading XML documents - -## 3.8.0 - 2013-12-05 - -* Added the ability to define a POST name for a file -* JSON response parsing now properly walks additionalProperties -* cURL error code 18 is now retried automatically in the BackoffPlugin -* Fixed a cURL error when URLs contain fragments -* Fixed an issue in the BackoffPlugin retry event where it was trying to access all exceptions as if they were - CurlExceptions -* CURLOPT_PROGRESS function fix for PHP 5.5 (69fcc1e) -* Added the ability for Guzzle to work with older versions of cURL that do not support `CURLOPT_TIMEOUT_MS` -* Fixed a bug that was encountered when parsing empty header parameters -* UriTemplate now has a `setRegex()` method to match the docs -* The `debug` request parameter now checks if it is truthy rather than if it exists -* Setting the `debug` request parameter to true shows verbose cURL output instead of using the LogPlugin -* Added the ability to combine URLs using strict RFC 3986 compliance -* Command objects can now return the validation errors encountered by the command -* Various fixes to cache revalidation (#437 and 29797e5) -* Various fixes to the AsyncPlugin -* Cleaned up build scripts - -## 3.7.4 - 2013-10-02 - -* Bug fix: 0 is now an allowed value in a description parameter that has a default value (#430) -* Bug fix: SchemaFormatter now returns an integer when formatting to a Unix timestamp - (see https://github.com/aws/aws-sdk-php/issues/147) -* Bug fix: Cleaned up and fixed URL dot segment removal to properly resolve internal dots -* Minimum PHP version is now properly specified as 5.3.3 (up from 5.3.2) (#420) -* Updated the bundled cacert.pem (#419) -* OauthPlugin now supports adding authentication to headers or query string (#425) - -## 3.7.3 - 2013-09-08 - -* Added the ability to get the exception associated with a request/command when using `MultiTransferException` and - `CommandTransferException`. -* Setting `additionalParameters` of a response to false is now honored when parsing responses with a service description -* Schemas are only injected into response models when explicitly configured. -* No longer guessing Content-Type based on the path of a request. Content-Type is now only guessed based on the path of - an EntityBody. -* Bug fix: ChunkedIterator can now properly chunk a \Traversable as well as an \Iterator. -* Bug fix: FilterIterator now relies on `\Iterator` instead of `\Traversable`. -* Bug fix: Gracefully handling malformed responses in RequestMediator::writeResponseBody() -* Bug fix: Replaced call to canCache with canCacheRequest in the CallbackCanCacheStrategy of the CachePlugin -* Bug fix: Visiting XML attributes first before visiting XML children when serializing requests -* Bug fix: Properly parsing headers that contain commas contained in quotes -* Bug fix: mimetype guessing based on a filename is now case-insensitive - -## 3.7.2 - 2013-08-02 - -* Bug fix: Properly URL encoding paths when using the PHP-only version of the UriTemplate expander - See https://github.com/guzzle/guzzle/issues/371 -* Bug fix: Cookie domains are now matched correctly according to RFC 6265 - See https://github.com/guzzle/guzzle/issues/377 -* Bug fix: GET parameters are now used when calculating an OAuth signature -* Bug fix: Fixed an issue with cache revalidation where the If-None-Match header was being double quoted -* `Guzzle\Common\AbstractHasDispatcher::dispatch()` now returns the event that was dispatched -* `Guzzle\Http\QueryString::factory()` now guesses the most appropriate query aggregator to used based on the input. - See https://github.com/guzzle/guzzle/issues/379 -* Added a way to add custom domain objects to service description parsing using the `operation.parse_class` event. See - https://github.com/guzzle/guzzle/pull/380 -* cURL multi cleanup and optimizations - -## 3.7.1 - 2013-07-05 - -* Bug fix: Setting default options on a client now works -* Bug fix: Setting options on HEAD requests now works. See #352 -* Bug fix: Moving stream factory before send event to before building the stream. See #353 -* Bug fix: Cookies no longer match on IP addresses per RFC 6265 -* Bug fix: Correctly parsing header parameters that are in `<>` and quotes -* Added `cert` and `ssl_key` as request options -* `Host` header can now diverge from the host part of a URL if the header is set manually -* `Guzzle\Service\Command\LocationVisitor\Request\XmlVisitor` was rewritten to change from using SimpleXML to XMLWriter -* OAuth parameters are only added via the plugin if they aren't already set -* Exceptions are now thrown when a URL cannot be parsed -* Returning `false` if `Guzzle\Http\EntityBody::getContentMd5()` fails -* Not setting a `Content-MD5` on a command if calculating the Content-MD5 fails via the CommandContentMd5Plugin - -## 3.7.0 - 2013-06-10 - -* See UPGRADING.md for more information on how to upgrade. -* Requests now support the ability to specify an array of $options when creating a request to more easily modify a - request. You can pass a 'request.options' configuration setting to a client to apply default request options to - every request created by a client (e.g. default query string variables, headers, curl options, etc.). -* Added a static facade class that allows you to use Guzzle with static methods and mount the class to `\Guzzle`. - See `Guzzle\Http\StaticClient::mount`. -* Added `command.request_options` to `Guzzle\Service\Command\AbstractCommand` to pass request options to requests - created by a command (e.g. custom headers, query string variables, timeout settings, etc.). -* Stream size in `Guzzle\Stream\PhpStreamRequestFactory` will now be set if Content-Length is returned in the - headers of a response -* Added `Guzzle\Common\Collection::setPath($path, $value)` to set a value into an array using a nested key - (e.g. `$collection->setPath('foo/baz/bar', 'test'); echo $collection['foo']['bar']['bar'];`) -* ServiceBuilders now support storing and retrieving arbitrary data -* CachePlugin can now purge all resources for a given URI -* CachePlugin can automatically purge matching cached items when a non-idempotent request is sent to a resource -* CachePlugin now uses the Vary header to determine if a resource is a cache hit -* `Guzzle\Http\Message\Response` now implements `\Serializable` -* Added `Guzzle\Cache\CacheAdapterFactory::fromCache()` to more easily create cache adapters -* `Guzzle\Service\ClientInterface::execute()` now accepts an array, single command, or Traversable -* Fixed a bug in `Guzzle\Http\Message\Header\Link::addLink()` -* Better handling of calculating the size of a stream in `Guzzle\Stream\Stream` using fstat() and caching the size -* `Guzzle\Common\Exception\ExceptionCollection` now creates a more readable exception message -* Fixing BC break: Added back the MonologLogAdapter implementation rather than extending from PsrLog so that older - Symfony users can still use the old version of Monolog. -* Fixing BC break: Added the implementation back in for `Guzzle\Http\Message\AbstractMessage::getTokenizedHeader()`. - Now triggering an E_USER_DEPRECATED warning when used. Use `$message->getHeader()->parseParams()`. -* Several performance improvements to `Guzzle\Common\Collection` -* Added an `$options` argument to the end of the following methods of `Guzzle\Http\ClientInterface`: - createRequest, head, delete, put, patch, post, options, prepareRequest -* Added an `$options` argument to the end of `Guzzle\Http\Message\Request\RequestFactoryInterface::createRequest()` -* Added an `applyOptions()` method to `Guzzle\Http\Message\Request\RequestFactoryInterface` -* Changed `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $body = null)` to - `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $options = array())`. You can still pass in a - resource, string, or EntityBody into the $options parameter to specify the download location of the response. -* Changed `Guzzle\Common\Collection::__construct($data)` to no longer accepts a null value for `$data` but a - default `array()` -* Added `Guzzle\Stream\StreamInterface::isRepeatable` -* Removed `Guzzle\Http\ClientInterface::setDefaultHeaders(). Use - $client->getConfig()->setPath('request.options/headers/{header_name}', 'value')`. or - $client->getConfig()->setPath('request.options/headers', array('header_name' => 'value'))`. -* Removed `Guzzle\Http\ClientInterface::getDefaultHeaders(). Use $client->getConfig()->getPath('request.options/headers')`. -* Removed `Guzzle\Http\ClientInterface::expandTemplate()` -* Removed `Guzzle\Http\ClientInterface::setRequestFactory()` -* Removed `Guzzle\Http\ClientInterface::getCurlMulti()` -* Removed `Guzzle\Http\Message\RequestInterface::canCache` -* Removed `Guzzle\Http\Message\RequestInterface::setIsRedirect` -* Removed `Guzzle\Http\Message\RequestInterface::isRedirect` -* Made `Guzzle\Http\Client::expandTemplate` and `getUriTemplate` protected methods. -* You can now enable E_USER_DEPRECATED warnings to see if you are using a deprecated method by setting - `Guzzle\Common\Version::$emitWarnings` to true. -* Marked `Guzzle\Http\Message\Request::isResponseBodyRepeatable()` as deprecated. Use - `$request->getResponseBody()->isRepeatable()` instead. -* Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use - `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead. -* Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use - `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead. -* Marked `Guzzle\Http\Message\Request::setIsRedirect()` as deprecated. Use the HistoryPlugin instead. -* Marked `Guzzle\Http\Message\Request::isRedirect()` as deprecated. Use the HistoryPlugin instead. -* Marked `Guzzle\Cache\CacheAdapterFactory::factory()` as deprecated -* Marked 'command.headers', 'command.response_body' and 'command.on_complete' as deprecated for AbstractCommand. - These will work through Guzzle 4.0 -* Marked 'request.params' for `Guzzle\Http\Client` as deprecated. Use [request.options][params]. -* Marked `Guzzle\Service\Client::enableMagicMethods()` as deprecated. Magic methods can no longer be disabled on a Guzzle\Service\Client. -* Marked `Guzzle\Service\Client::getDefaultHeaders()` as deprecated. Use $client->getConfig()->getPath('request.options/headers')`. -* Marked `Guzzle\Service\Client::setDefaultHeaders()` as deprecated. Use $client->getConfig()->setPath('request.options/headers/{header_name}', 'value')`. -* Marked `Guzzle\Parser\Url\UrlParser` as deprecated. Just use PHP's `parse_url()` and percent encode your UTF-8. -* Marked `Guzzle\Common\Collection::inject()` as deprecated. -* Marked `Guzzle\Plugin\CurlAuth\CurlAuthPlugin` as deprecated. Use `$client->getConfig()->setPath('request.options/auth', array('user', 'pass', 'Basic|Digest');` -* CacheKeyProviderInterface and DefaultCacheKeyProvider are no longer used. All of this logic is handled in a - CacheStorageInterface. These two objects and interface will be removed in a future version. -* Always setting X-cache headers on cached responses -* Default cache TTLs are now handled by the CacheStorageInterface of a CachePlugin -* `CacheStorageInterface::cache($key, Response $response, $ttl = null)` has changed to `cache(RequestInterface - $request, Response $response);` -* `CacheStorageInterface::fetch($key)` has changed to `fetch(RequestInterface $request);` -* `CacheStorageInterface::delete($key)` has changed to `delete(RequestInterface $request);` -* Added `CacheStorageInterface::purge($url)` -* `DefaultRevalidation::__construct(CacheKeyProviderInterface $cacheKey, CacheStorageInterface $cache, CachePlugin - $plugin)` has changed to `DefaultRevalidation::__construct(CacheStorageInterface $cache, - CanCacheStrategyInterface $canCache = null)` -* Added `RevalidationInterface::shouldRevalidate(RequestInterface $request, Response $response)` - -## 3.6.0 - 2013-05-29 - -* ServiceDescription now implements ToArrayInterface -* Added command.hidden_params to blacklist certain headers from being treated as additionalParameters -* Guzzle can now correctly parse incomplete URLs -* Mixed casing of headers are now forced to be a single consistent casing across all values for that header. -* Messages internally use a HeaderCollection object to delegate handling case-insensitive header resolution -* Removed the whole changedHeader() function system of messages because all header changes now go through addHeader(). -* Specific header implementations can be created for complex headers. When a message creates a header, it uses a - HeaderFactory which can map specific headers to specific header classes. There is now a Link header and - CacheControl header implementation. -* Removed from interface: Guzzle\Http\ClientInterface::setUriTemplate -* Removed from interface: Guzzle\Http\ClientInterface::setCurlMulti() -* Removed Guzzle\Http\Message\Request::receivedRequestHeader() and implemented this functionality in - Guzzle\Http\Curl\RequestMediator -* Removed the optional $asString parameter from MessageInterface::getHeader(). Just cast the header to a string. -* Removed the optional $tryChunkedTransfer option from Guzzle\Http\Message\EntityEnclosingRequestInterface -* Removed the $asObjects argument from Guzzle\Http\Message\MessageInterface::getHeaders() -* Removed Guzzle\Parser\ParserRegister::get(). Use getParser() -* Removed Guzzle\Parser\ParserRegister::set(). Use registerParser(). -* All response header helper functions return a string rather than mixing Header objects and strings inconsistently -* Removed cURL blacklist support. This is no longer necessary now that Expect, Accept, etc. are managed by Guzzle - directly via interfaces -* Removed the injecting of a request object onto a response object. The methods to get and set a request still exist - but are a no-op until removed. -* Most classes that used to require a `Guzzle\Service\Command\CommandInterface` typehint now request a - `Guzzle\Service\Command\ArrayCommandInterface`. -* Added `Guzzle\Http\Message\RequestInterface::startResponse()` to the RequestInterface to handle injecting a response - on a request while the request is still being transferred -* The ability to case-insensitively search for header values -* Guzzle\Http\Message\Header::hasExactHeader -* Guzzle\Http\Message\Header::raw. Use getAll() -* Deprecated cache control specific methods on Guzzle\Http\Message\AbstractMessage. Use the CacheControl header object - instead. -* `Guzzle\Service\Command\CommandInterface` now extends from ToArrayInterface and ArrayAccess -* Added the ability to cast Model objects to a string to view debug information. - -## 3.5.0 - 2013-05-13 - -* Bug: Fixed a regression so that request responses are parsed only once per oncomplete event rather than multiple times -* Bug: Better cleanup of one-time events across the board (when an event is meant to fire once, it will now remove - itself from the EventDispatcher) -* Bug: `Guzzle\Log\MessageFormatter` now properly writes "total_time" and "connect_time" values -* Bug: Cloning an EntityEnclosingRequest now clones the EntityBody too -* Bug: Fixed an undefined index error when parsing nested JSON responses with a sentAs parameter that reference a - non-existent key -* Bug: All __call() method arguments are now required (helps with mocking frameworks) -* Deprecating Response::getRequest() and now using a shallow clone of a request object to remove a circular reference - to help with refcount based garbage collection of resources created by sending a request -* Deprecating ZF1 cache and log adapters. These will be removed in the next major version. -* Deprecating `Response::getPreviousResponse()` (method signature still exists, but it's deprecated). Use the - HistoryPlugin for a history. -* Added a `responseBody` alias for the `response_body` location -* Refactored internals to no longer rely on Response::getRequest() -* HistoryPlugin can now be cast to a string -* HistoryPlugin now logs transactions rather than requests and responses to more accurately keep track of the requests - and responses that are sent over the wire -* Added `getEffectiveUrl()` and `getRedirectCount()` to Response objects - -## 3.4.3 - 2013-04-30 - -* Bug fix: Fixing bug introduced in 3.4.2 where redirect responses are duplicated on the final redirected response -* Added a check to re-extract the temp cacert bundle from the phar before sending each request - -## 3.4.2 - 2013-04-29 - -* Bug fix: Stream objects now work correctly with "a" and "a+" modes -* Bug fix: Removing `Transfer-Encoding: chunked` header when a Content-Length is present -* Bug fix: AsyncPlugin no longer forces HEAD requests -* Bug fix: DateTime timezones are now properly handled when using the service description schema formatter -* Bug fix: CachePlugin now properly handles stale-if-error directives when a request to the origin server fails -* Setting a response on a request will write to the custom request body from the response body if one is specified -* LogPlugin now writes to php://output when STDERR is undefined -* Added the ability to set multiple POST files for the same key in a single call -* application/x-www-form-urlencoded POSTs now use the utf-8 charset by default -* Added the ability to queue CurlExceptions to the MockPlugin -* Cleaned up how manual responses are queued on requests (removed "queued_response" and now using request.before_send) -* Configuration loading now allows remote files - -## 3.4.1 - 2013-04-16 - -* Large refactoring to how CurlMulti handles work. There is now a proxy that sits in front of a pool of CurlMulti - handles. This greatly simplifies the implementation, fixes a couple bugs, and provides a small performance boost. -* Exceptions are now properly grouped when sending requests in parallel -* Redirects are now properly aggregated when a multi transaction fails -* Redirects now set the response on the original object even in the event of a failure -* Bug fix: Model names are now properly set even when using $refs -* Added support for PHP 5.5's CurlFile to prevent warnings with the deprecated @ syntax -* Added support for oauth_callback in OAuth signatures -* Added support for oauth_verifier in OAuth signatures -* Added support to attempt to retrieve a command first literally, then ucfirst, the with inflection - -## 3.4.0 - 2013-04-11 - -* Bug fix: URLs are now resolved correctly based on https://tools.ietf.org/html/rfc3986#section-5.2. #289 -* Bug fix: Absolute URLs with a path in a service description will now properly override the base URL. #289 -* Bug fix: Parsing a query string with a single PHP array value will now result in an array. #263 -* Bug fix: Better normalization of the User-Agent header to prevent duplicate headers. #264. -* Bug fix: Added `number` type to service descriptions. -* Bug fix: empty parameters are removed from an OAuth signature -* Bug fix: Revalidating a cache entry prefers the Last-Modified over the Date header -* Bug fix: Fixed "array to string" error when validating a union of types in a service description -* Bug fix: Removed code that attempted to determine the size of a stream when data is written to the stream -* Bug fix: Not including an `oauth_token` if the value is null in the OauthPlugin. -* Bug fix: Now correctly aggregating successful requests and failed requests in CurlMulti when a redirect occurs. -* The new default CURLOPT_TIMEOUT setting has been increased to 150 seconds so that Guzzle works on poor connections. -* Added a feature to EntityEnclosingRequest::setBody() that will automatically set the Content-Type of the request if - the Content-Type can be determined based on the entity body or the path of the request. -* Added the ability to overwrite configuration settings in a client when grabbing a throwaway client from a builder. -* Added support for a PSR-3 LogAdapter. -* Added a `command.after_prepare` event -* Added `oauth_callback` parameter to the OauthPlugin -* Added the ability to create a custom stream class when using a stream factory -* Added a CachingEntityBody decorator -* Added support for `additionalParameters` in service descriptions to define how custom parameters are serialized. -* The bundled SSL certificate is now provided in the phar file and extracted when running Guzzle from a phar. -* You can now send any EntityEnclosingRequest with POST fields or POST files and cURL will handle creating bodies -* POST requests using a custom entity body are now treated exactly like PUT requests but with a custom cURL method. This - means that the redirect behavior of POST requests with custom bodies will not be the same as POST requests that use - POST fields or files (the latter is only used when emulating a form POST in the browser). -* Lots of cleanup to CurlHandle::factory and RequestFactory::createRequest - -## 3.3.1 - 2013-03-10 - -* Added the ability to create PHP streaming responses from HTTP requests -* Bug fix: Running any filters when parsing response headers with service descriptions -* Bug fix: OauthPlugin fixes to allow for multi-dimensional array signing, and sorting parameters before signing -* Bug fix: Removed the adding of default empty arrays and false Booleans to responses in order to be consistent across - response location visitors. -* Bug fix: Removed the possibility of creating configuration files with circular dependencies -* RequestFactory::create() now uses the key of a POST file when setting the POST file name -* Added xmlAllowEmpty to serialize an XML body even if no XML specific parameters are set - -## 3.3.0 - 2013-03-03 - -* A large number of performance optimizations have been made -* Bug fix: Added 'wb' as a valid write mode for streams -* Bug fix: `Guzzle\Http\Message\Response::json()` now allows scalar values to be returned -* Bug fix: Fixed bug in `Guzzle\Http\Message\Response` where wrapping quotes were stripped from `getEtag()` -* BC: Removed `Guzzle\Http\Utils` class -* BC: Setting a service description on a client will no longer modify the client's command factories. -* BC: Emitting IO events from a RequestMediator is now a parameter that must be set in a request's curl options using - the 'emit_io' key. This was previously set under a request's parameters using 'curl.emit_io' -* BC: `Guzzle\Stream\Stream::getWrapper()` and `Guzzle\Stream\Stream::getSteamType()` are no longer converted to - lowercase -* Operation parameter objects are now lazy loaded internally -* Added ErrorResponsePlugin that can throw errors for responses defined in service description operations' errorResponses -* Added support for instantiating responseType=class responseClass classes. Classes must implement - `Guzzle\Service\Command\ResponseClassInterface` -* Added support for additionalProperties for top-level parameters in responseType=model responseClasses. These - additional properties also support locations and can be used to parse JSON responses where the outermost part of the - JSON is an array -* Added support for nested renaming of JSON models (rename sentAs to name) -* CachePlugin - * Added support for stale-if-error so that the CachePlugin can now serve stale content from the cache on error - * Debug headers can now added to cached response in the CachePlugin - -## 3.2.0 - 2013-02-14 - -* CurlMulti is no longer reused globally. A new multi object is created per-client. This helps to isolate clients. -* URLs with no path no longer contain a "/" by default -* Guzzle\Http\QueryString does no longer manages the leading "?". This is now handled in Guzzle\Http\Url. -* BadResponseException no longer includes the full request and response message -* Adding setData() to Guzzle\Service\Description\ServiceDescriptionInterface -* Adding getResponseBody() to Guzzle\Http\Message\RequestInterface -* Various updates to classes to use ServiceDescriptionInterface type hints rather than ServiceDescription -* Header values can now be normalized into distinct values when multiple headers are combined with a comma separated list -* xmlEncoding can now be customized for the XML declaration of a XML service description operation -* Guzzle\Http\QueryString now uses Guzzle\Http\QueryAggregator\QueryAggregatorInterface objects to add custom value - aggregation and no longer uses callbacks -* The URL encoding implementation of Guzzle\Http\QueryString can now be customized -* Bug fix: Filters were not always invoked for array service description parameters -* Bug fix: Redirects now use a target response body rather than a temporary response body -* Bug fix: The default exponential backoff BackoffPlugin was not giving when the request threshold was exceeded -* Bug fix: Guzzle now takes the first found value when grabbing Cache-Control directives - -## 3.1.2 - 2013-01-27 - -* Refactored how operation responses are parsed. Visitors now include a before() method responsible for parsing the - response body. For example, the XmlVisitor now parses the XML response into an array in the before() method. -* Fixed an issue where cURL would not automatically decompress responses when the Accept-Encoding header was sent -* CURLOPT_SSL_VERIFYHOST is never set to 1 because it is deprecated (see 5e0ff2ef20f839e19d1eeb298f90ba3598784444) -* Fixed a bug where redirect responses were not chained correctly using getPreviousResponse() -* Setting default headers on a client after setting the user-agent will not erase the user-agent setting - -## 3.1.1 - 2013-01-20 - -* Adding wildcard support to Guzzle\Common\Collection::getPath() -* Adding alias support to ServiceBuilder configs -* Adding Guzzle\Service\Resource\CompositeResourceIteratorFactory and cleaning up factory interface - -## 3.1.0 - 2013-01-12 - -* BC: CurlException now extends from RequestException rather than BadResponseException -* BC: Renamed Guzzle\Plugin\Cache\CanCacheStrategyInterface::canCache() to canCacheRequest() and added CanCacheResponse() -* Added getData to ServiceDescriptionInterface -* Added context array to RequestInterface::setState() -* Bug: Removing hard dependency on the BackoffPlugin from Guzzle\Http -* Bug: Adding required content-type when JSON request visitor adds JSON to a command -* Bug: Fixing the serialization of a service description with custom data -* Made it easier to deal with exceptions thrown when transferring commands or requests in parallel by providing - an array of successful and failed responses -* Moved getPath from Guzzle\Service\Resource\Model to Guzzle\Common\Collection -* Added Guzzle\Http\IoEmittingEntityBody -* Moved command filtration from validators to location visitors -* Added `extends` attributes to service description parameters -* Added getModels to ServiceDescriptionInterface - -## 3.0.7 - 2012-12-19 - -* Fixing phar detection when forcing a cacert to system if null or true -* Allowing filename to be passed to `Guzzle\Http\Message\Request::setResponseBody()` -* Cleaning up `Guzzle\Common\Collection::inject` method -* Adding a response_body location to service descriptions - -## 3.0.6 - 2012-12-09 - -* CurlMulti performance improvements -* Adding setErrorResponses() to Operation -* composer.json tweaks - -## 3.0.5 - 2012-11-18 - -* Bug: Fixing an infinite recursion bug caused from revalidating with the CachePlugin -* Bug: Response body can now be a string containing "0" -* Bug: Using Guzzle inside of a phar uses system by default but now allows for a custom cacert -* Bug: QueryString::fromString now properly parses query string parameters that contain equal signs -* Added support for XML attributes in service description responses -* DefaultRequestSerializer now supports array URI parameter values for URI template expansion -* Added better mimetype guessing to requests and post files - -## 3.0.4 - 2012-11-11 - -* Bug: Fixed a bug when adding multiple cookies to a request to use the correct glue value -* Bug: Cookies can now be added that have a name, domain, or value set to "0" -* Bug: Using the system cacert bundle when using the Phar -* Added json and xml methods to Response to make it easier to parse JSON and XML response data into data structures -* Enhanced cookie jar de-duplication -* Added the ability to enable strict cookie jars that throw exceptions when invalid cookies are added -* Added setStream to StreamInterface to actually make it possible to implement custom rewind behavior for entity bodies -* Added the ability to create any sort of hash for a stream rather than just an MD5 hash - -## 3.0.3 - 2012-11-04 - -* Implementing redirects in PHP rather than cURL -* Added PECL URI template extension and using as default parser if available -* Bug: Fixed Content-Length parsing of Response factory -* Adding rewind() method to entity bodies and streams. Allows for custom rewinding of non-repeatable streams. -* Adding ToArrayInterface throughout library -* Fixing OauthPlugin to create unique nonce values per request - -## 3.0.2 - 2012-10-25 - -* Magic methods are enabled by default on clients -* Magic methods return the result of a command -* Service clients no longer require a base_url option in the factory -* Bug: Fixed an issue with URI templates where null template variables were being expanded - -## 3.0.1 - 2012-10-22 - -* Models can now be used like regular collection objects by calling filter, map, etc. -* Models no longer require a Parameter structure or initial data in the constructor -* Added a custom AppendIterator to get around a PHP bug with the `\AppendIterator` - -## 3.0.0 - 2012-10-15 - -* Rewrote service description format to be based on Swagger - * Now based on JSON schema - * Added nested input structures and nested response models - * Support for JSON and XML input and output models - * Renamed `commands` to `operations` - * Removed dot class notation - * Removed custom types -* Broke the project into smaller top-level namespaces to be more component friendly -* Removed support for XML configs and descriptions. Use arrays or JSON files. -* Removed the Validation component and Inspector -* Moved all cookie code to Guzzle\Plugin\Cookie -* Magic methods on a Guzzle\Service\Client now return the command un-executed. -* Calling getResult() or getResponse() on a command will lazily execute the command if needed. -* Now shipping with cURL's CA certs and using it by default -* Added previousResponse() method to response objects -* No longer sending Accept and Accept-Encoding headers on every request -* Only sending an Expect header by default when a payload is greater than 1MB -* Added/moved client options: - * curl.blacklist to curl.option.blacklist - * Added ssl.certificate_authority -* Added a Guzzle\Iterator component -* Moved plugins from Guzzle\Http\Plugin to Guzzle\Plugin -* Added a more robust backoff retry strategy (replaced the ExponentialBackoffPlugin) -* Added a more robust caching plugin -* Added setBody to response objects -* Updating LogPlugin to use a more flexible MessageFormatter -* Added a completely revamped build process -* Cleaning up Collection class and removing default values from the get method -* Fixed ZF2 cache adapters - -## 2.8.8 - 2012-10-15 - -* Bug: Fixed a cookie issue that caused dot prefixed domains to not match where popular browsers did - -## 2.8.7 - 2012-09-30 - -* Bug: Fixed config file aliases for JSON includes -* Bug: Fixed cookie bug on a request object by using CookieParser to parse cookies on requests -* Bug: Removing the path to a file when sending a Content-Disposition header on a POST upload -* Bug: Hardening request and response parsing to account for missing parts -* Bug: Fixed PEAR packaging -* Bug: Fixed Request::getInfo -* Bug: Fixed cases where CURLM_CALL_MULTI_PERFORM return codes were causing curl transactions to fail -* Adding the ability for the namespace Iterator factory to look in multiple directories -* Added more getters/setters/removers from service descriptions -* Added the ability to remove POST fields from OAuth signatures -* OAuth plugin now supports 2-legged OAuth - -## 2.8.6 - 2012-09-05 - -* Added the ability to modify and build service descriptions -* Added the use of visitors to apply parameters to locations in service descriptions using the dynamic command -* Added a `json` parameter location -* Now allowing dot notation for classes in the CacheAdapterFactory -* Using the union of two arrays rather than an array_merge when extending service builder services and service params -* Ensuring that a service is a string before doing strpos() checks on it when substituting services for references - in service builder config files. -* Services defined in two different config files that include one another will by default replace the previously - defined service, but you can now create services that extend themselves and merge their settings over the previous -* The JsonLoader now supports aliasing filenames with different filenames. This allows you to alias something like - '_default' with a default JSON configuration file. - -## 2.8.5 - 2012-08-29 - -* Bug: Suppressed empty arrays from URI templates -* Bug: Added the missing $options argument from ServiceDescription::factory to enable caching -* Added support for HTTP responses that do not contain a reason phrase in the start-line -* AbstractCommand commands are now invokable -* Added a way to get the data used when signing an Oauth request before a request is sent - -## 2.8.4 - 2012-08-15 - -* Bug: Custom delay time calculations are no longer ignored in the ExponentialBackoffPlugin -* Added the ability to transfer entity bodies as a string rather than streamed. This gets around curl error 65. Set `body_as_string` in a request's curl options to enable. -* Added a StreamInterface, EntityBodyInterface, and added ftell() to Guzzle\Common\Stream -* Added an AbstractEntityBodyDecorator and a ReadLimitEntityBody decorator to transfer only a subset of a decorated stream -* Stream and EntityBody objects will now return the file position to the previous position after a read required operation (e.g. getContentMd5()) -* Added additional response status codes -* Removed SSL information from the default User-Agent header -* DELETE requests can now send an entity body -* Added an EventDispatcher to the ExponentialBackoffPlugin and added an ExponentialBackoffLogger to log backoff retries -* Added the ability of the MockPlugin to consume mocked request bodies -* LogPlugin now exposes request and response objects in the extras array - -## 2.8.3 - 2012-07-30 - -* Bug: Fixed a case where empty POST requests were sent as GET requests -* Bug: Fixed a bug in ExponentialBackoffPlugin that caused fatal errors when retrying an EntityEnclosingRequest that does not have a body -* Bug: Setting the response body of a request to null after completing a request, not when setting the state of a request to new -* Added multiple inheritance to service description commands -* Added an ApiCommandInterface and added `getParamNames()` and `hasParam()` -* Removed the default 2mb size cutoff from the Md5ValidatorPlugin so that it now defaults to validating everything -* Changed CurlMulti::perform to pass a smaller timeout to CurlMulti::executeHandles - -## 2.8.2 - 2012-07-24 - -* Bug: Query string values set to 0 are no longer dropped from the query string -* Bug: A Collection object is no longer created each time a call is made to `Guzzle\Service\Command\AbstractCommand::getRequestHeaders()` -* Bug: `+` is now treated as an encoded space when parsing query strings -* QueryString and Collection performance improvements -* Allowing dot notation for class paths in filters attribute of a service descriptions - -## 2.8.1 - 2012-07-16 - -* Loosening Event Dispatcher dependency -* POST redirects can now be customized using CURLOPT_POSTREDIR - -## 2.8.0 - 2012-07-15 - -* BC: Guzzle\Http\Query - * Query strings with empty variables will always show an equal sign unless the variable is set to QueryString::BLANK (e.g. ?acl= vs ?acl) - * Changed isEncodingValues() and isEncodingFields() to isUrlEncoding() - * Changed setEncodeValues(bool) and setEncodeFields(bool) to useUrlEncoding(bool) - * Changed the aggregation functions of QueryString to be static methods - * Can now use fromString() with querystrings that have a leading ? -* cURL configuration values can be specified in service descriptions using `curl.` prefixed parameters -* Content-Length is set to 0 before emitting the request.before_send event when sending an empty request body -* Cookies are no longer URL decoded by default -* Bug: URI template variables set to null are no longer expanded - -## 2.7.2 - 2012-07-02 - -* BC: Moving things to get ready for subtree splits. Moving Inflection into Common. Moving Guzzle\Http\Parser to Guzzle\Parser. -* BC: Removing Guzzle\Common\Batch\Batch::count() and replacing it with isEmpty() -* CachePlugin now allows for a custom request parameter function to check if a request can be cached -* Bug fix: CachePlugin now only caches GET and HEAD requests by default -* Bug fix: Using header glue when transferring headers over the wire -* Allowing deeply nested arrays for composite variables in URI templates -* Batch divisors can now return iterators or arrays - -## 2.7.1 - 2012-06-26 - -* Minor patch to update version number in UA string -* Updating build process - -## 2.7.0 - 2012-06-25 - -* BC: Inflection classes moved to Guzzle\Inflection. No longer static methods. Can now inject custom inflectors into classes. -* BC: Removed magic setX methods from commands -* BC: Magic methods mapped to service description commands are now inflected in the command factory rather than the client __call() method -* Verbose cURL options are no longer enabled by default. Set curl.debug to true on a client to enable. -* Bug: Now allowing colons in a response start-line (e.g. HTTP/1.1 503 Service Unavailable: Back-end server is at capacity) -* Guzzle\Service\Resource\ResourceIteratorApplyBatched now internally uses the Guzzle\Common\Batch namespace -* Added Guzzle\Service\Plugin namespace and a PluginCollectionPlugin -* Added the ability to set POST fields and files in a service description -* Guzzle\Http\EntityBody::factory() now accepts objects with a __toString() method -* Adding a command.before_prepare event to clients -* Added BatchClosureTransfer and BatchClosureDivisor -* BatchTransferException now includes references to the batch divisor and transfer strategies -* Fixed some tests so that they pass more reliably -* Added Guzzle\Common\Log\ArrayLogAdapter - -## 2.6.6 - 2012-06-10 - -* BC: Removing Guzzle\Http\Plugin\BatchQueuePlugin -* BC: Removing Guzzle\Service\Command\CommandSet -* Adding generic batching system (replaces the batch queue plugin and command set) -* Updating ZF cache and log adapters and now using ZF's composer repository -* Bug: Setting the name of each ApiParam when creating through an ApiCommand -* Adding result_type, result_doc, deprecated, and doc_url to service descriptions -* Bug: Changed the default cookie header casing back to 'Cookie' - -## 2.6.5 - 2012-06-03 - -* BC: Renaming Guzzle\Http\Message\RequestInterface::getResourceUri() to getResource() -* BC: Removing unused AUTH_BASIC and AUTH_DIGEST constants from -* BC: Guzzle\Http\Cookie is now used to manage Set-Cookie data, not Cookie data -* BC: Renaming methods in the CookieJarInterface -* Moving almost all cookie logic out of the CookiePlugin and into the Cookie or CookieJar implementations -* Making the default glue for HTTP headers ';' instead of ',' -* Adding a removeValue to Guzzle\Http\Message\Header -* Adding getCookies() to request interface. -* Making it easier to add event subscribers to HasDispatcherInterface classes. Can now directly call addSubscriber() - -## 2.6.4 - 2012-05-30 - -* BC: Cleaning up how POST files are stored in EntityEnclosingRequest objects. Adding PostFile class. -* BC: Moving ApiCommand specific functionality from the Inspector and on to the ApiCommand -* Bug: Fixing magic method command calls on clients -* Bug: Email constraint only validates strings -* Bug: Aggregate POST fields when POST files are present in curl handle -* Bug: Fixing default User-Agent header -* Bug: Only appending or prepending parameters in commands if they are specified -* Bug: Not requiring response reason phrases or status codes to match a predefined list of codes -* Allowing the use of dot notation for class namespaces when using instance_of constraint -* Added any_match validation constraint -* Added an AsyncPlugin -* Passing request object to the calculateWait method of the ExponentialBackoffPlugin -* Allowing the result of a command object to be changed -* Parsing location and type sub values when instantiating a service description rather than over and over at runtime - -## 2.6.3 - 2012-05-23 - -* [BC] Guzzle\Common\FromConfigInterface no longer requires any config options. -* [BC] Refactoring how POST files are stored on an EntityEnclosingRequest. They are now separate from POST fields. -* You can now use an array of data when creating PUT request bodies in the request factory. -* Removing the requirement that HTTPS requests needed a Cache-Control: public directive to be cacheable. -* [Http] Adding support for Content-Type in multipart POST uploads per upload -* [Http] Added support for uploading multiple files using the same name (foo[0], foo[1]) -* Adding more POST data operations for easier manipulation of POST data. -* You can now set empty POST fields. -* The body of a request is only shown on EntityEnclosingRequest objects that do not use POST files. -* Split the Guzzle\Service\Inspector::validateConfig method into two methods. One to initialize when a command is created, and one to validate. -* CS updates - -## 2.6.2 - 2012-05-19 - -* [Http] Better handling of nested scope requests in CurlMulti. Requests are now always prepares in the send() method rather than the addRequest() method. - -## 2.6.1 - 2012-05-19 - -* [BC] Removing 'path' support in service descriptions. Use 'uri'. -* [BC] Guzzle\Service\Inspector::parseDocBlock is now protected. Adding getApiParamsForClass() with cache. -* [BC] Removing Guzzle\Common\NullObject. Use https://github.com/mtdowling/NullObject if you need it. -* [BC] Removing Guzzle\Common\XmlElement. -* All commands, both dynamic and concrete, have ApiCommand objects. -* Adding a fix for CurlMulti so that if all of the connections encounter some sort of curl error, then the loop exits. -* Adding checks to EntityEnclosingRequest so that empty POST files and fields are ignored. -* Making the method signature of Guzzle\Service\Builder\ServiceBuilder::factory more flexible. - -## 2.6.0 - 2012-05-15 - -* [BC] Moving Guzzle\Service\Builder to Guzzle\Service\Builder\ServiceBuilder -* [BC] Executing a Command returns the result of the command rather than the command -* [BC] Moving all HTTP parsing logic to Guzzle\Http\Parsers. Allows for faster C implementations if needed. -* [BC] Changing the Guzzle\Http\Message\Response::setProtocol() method to accept a protocol and version in separate args. -* [BC] Moving ResourceIterator* to Guzzle\Service\Resource -* [BC] Completely refactored ResourceIterators to iterate over a cloned command object -* [BC] Moved Guzzle\Http\UriTemplate to Guzzle\Http\Parser\UriTemplate\UriTemplate -* [BC] Guzzle\Guzzle is now deprecated -* Moving Guzzle\Common\Guzzle::inject to Guzzle\Common\Collection::inject -* Adding Guzzle\Version class to give version information about Guzzle -* Adding Guzzle\Http\Utils class to provide getDefaultUserAgent() and getHttpDate() -* Adding Guzzle\Curl\CurlVersion to manage caching curl_version() data -* ServiceDescription and ServiceBuilder are now cacheable using similar configs -* Changing the format of XML and JSON service builder configs. Backwards compatible. -* Cleaned up Cookie parsing -* Trimming the default Guzzle User-Agent header -* Adding a setOnComplete() method to Commands that is called when a command completes -* Keeping track of requests that were mocked in the MockPlugin -* Fixed a caching bug in the CacheAdapterFactory -* Inspector objects can be injected into a Command object -* Refactoring a lot of code and tests to be case insensitive when dealing with headers -* Adding Guzzle\Http\Message\HeaderComparison for easy comparison of HTTP headers using a DSL -* Adding the ability to set global option overrides to service builder configs -* Adding the ability to include other service builder config files from within XML and JSON files -* Moving the parseQuery method out of Url and on to QueryString::fromString() as a static factory method. - -## 2.5.0 - 2012-05-08 - -* Major performance improvements -* [BC] Simplifying Guzzle\Common\Collection. Please check to see if you are using features that are now deprecated. -* [BC] Using a custom validation system that allows a flyweight implementation for much faster validation. No longer using Symfony2 Validation component. -* [BC] No longer supporting "{{ }}" for injecting into command or UriTemplates. Use "{}" -* Added the ability to passed parameters to all requests created by a client -* Added callback functionality to the ExponentialBackoffPlugin -* Using microtime in ExponentialBackoffPlugin to allow more granular backoff strategies. -* Rewinding request stream bodies when retrying requests -* Exception is thrown when JSON response body cannot be decoded -* Added configurable magic method calls to clients and commands. This is off by default. -* Fixed a defect that added a hash to every parsed URL part -* Fixed duplicate none generation for OauthPlugin. -* Emitting an event each time a client is generated by a ServiceBuilder -* Using an ApiParams object instead of a Collection for parameters of an ApiCommand -* cache.* request parameters should be renamed to params.cache.* -* Added the ability to set arbitrary curl options on requests (disable_wire, progress, etc.). See CurlHandle. -* Added the ability to disable type validation of service descriptions -* ServiceDescriptions and ServiceBuilders are now Serializable diff --git a/vendor/guzzlehttp/guzzle/LICENSE b/vendor/guzzlehttp/guzzle/LICENSE deleted file mode 100644 index fd2375d..0000000 --- a/vendor/guzzlehttp/guzzle/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2011 Michael Dowling -Copyright (c) 2012 Jeremy Lindblom -Copyright (c) 2014 Graham Campbell -Copyright (c) 2015 Márk Sági-Kazár -Copyright (c) 2015 Tobias Schultze -Copyright (c) 2016 Tobias Nyholm -Copyright (c) 2016 George Mponos - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/guzzlehttp/guzzle/README.md b/vendor/guzzlehttp/guzzle/README.md deleted file mode 100644 index 0025aa7..0000000 --- a/vendor/guzzlehttp/guzzle/README.md +++ /dev/null @@ -1,94 +0,0 @@ -![Guzzle](.github/logo.png?raw=true) - -# Guzzle, PHP HTTP client - -[![Latest Version](https://img.shields.io/github/release/guzzle/guzzle.svg?style=flat-square)](https://github.com/guzzle/guzzle/releases) -[![Build Status](https://img.shields.io/github/workflow/status/guzzle/guzzle/CI?label=ci%20build&style=flat-square)](https://github.com/guzzle/guzzle/actions?query=workflow%3ACI) -[![Total Downloads](https://img.shields.io/packagist/dt/guzzlehttp/guzzle.svg?style=flat-square)](https://packagist.org/packages/guzzlehttp/guzzle) - -Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and -trivial to integrate with web services. - -- Simple interface for building query strings, POST requests, streaming large - uploads, streaming large downloads, using HTTP cookies, uploading JSON data, - etc... -- Can send both synchronous and asynchronous requests using the same interface. -- Uses PSR-7 interfaces for requests, responses, and streams. This allows you - to utilize other PSR-7 compatible libraries with Guzzle. -- Supports PSR-18 allowing interoperability between other PSR-18 HTTP Clients. -- Abstracts away the underlying HTTP transport, allowing you to write - environment and transport agnostic code; i.e., no hard dependency on cURL, - PHP streams, sockets, or non-blocking event loops. -- Middleware system allows you to augment and compose client behavior. - -```php -$client = new \GuzzleHttp\Client(); -$response = $client->request('GET', 'https://api.github.com/repos/guzzle/guzzle'); - -echo $response->getStatusCode(); // 200 -echo $response->getHeaderLine('content-type'); // 'application/json; charset=utf8' -echo $response->getBody(); // '{"id": 1420053, "name": "guzzle", ...}' - -// Send an asynchronous request. -$request = new \GuzzleHttp\Psr7\Request('GET', 'http://httpbin.org'); -$promise = $client->sendAsync($request)->then(function ($response) { - echo 'I completed! ' . $response->getBody(); -}); - -$promise->wait(); -``` - -## Help and docs - -We use GitHub issues only to discuss bugs and new features. For support please refer to: - -- [Documentation](http://guzzlephp.org/) -- [Stack Overflow](http://stackoverflow.com/questions/tagged/guzzle) -- [#guzzle](https://app.slack.com/client/T0D2S9JCT/CE6UAAKL4) channel on [PHP-HTTP Slack](http://slack.httplug.io/) -- [Gitter](https://gitter.im/guzzle/guzzle) - - -## Installing Guzzle - -The recommended way to install Guzzle is through -[Composer](https://getcomposer.org/). - -```bash -composer require guzzlehttp/guzzle -``` - - -## Version Guidance - -| Version | Status | Packagist | Namespace | Repo | Docs | PSR-7 | PHP Version | -|---------|------------|---------------------|--------------|---------------------|---------------------|-------|-------------| -| 3.x | EOL | `guzzle/guzzle` | `Guzzle` | [v3][guzzle-3-repo] | [v3][guzzle-3-docs] | No | >= 5.3.3 | -| 4.x | EOL | `guzzlehttp/guzzle` | `GuzzleHttp` | [v4][guzzle-4-repo] | N/A | No | >= 5.4 | -| 5.x | EOL | `guzzlehttp/guzzle` | `GuzzleHttp` | [v5][guzzle-5-repo] | [v5][guzzle-5-docs] | No | >= 5.4 | -| 6.x | Security fixes | `guzzlehttp/guzzle` | `GuzzleHttp` | [v6][guzzle-6-repo] | [v6][guzzle-6-docs] | Yes | >= 5.5 | -| 7.x | Latest | `guzzlehttp/guzzle` | `GuzzleHttp` | [v7][guzzle-7-repo] | [v7][guzzle-7-docs] | Yes | >= 7.2 | - -[guzzle-3-repo]: https://github.com/guzzle/guzzle3 -[guzzle-4-repo]: https://github.com/guzzle/guzzle/tree/4.x -[guzzle-5-repo]: https://github.com/guzzle/guzzle/tree/5.3 -[guzzle-6-repo]: https://github.com/guzzle/guzzle/tree/6.5 -[guzzle-7-repo]: https://github.com/guzzle/guzzle -[guzzle-3-docs]: http://guzzle3.readthedocs.org -[guzzle-5-docs]: http://docs.guzzlephp.org/en/5.3/ -[guzzle-6-docs]: http://docs.guzzlephp.org/en/6.5/ -[guzzle-7-docs]: http://docs.guzzlephp.org/en/latest/ - - -## Security - -If you discover a security vulnerability within this package, please send an email to security@tidelift.com. All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced. Please see [Security Policy](https://github.com/guzzle/guzzle/security/policy) for more information. - -## License - -Guzzle is made available under the MIT License (MIT). Please see [License File](LICENSE) for more information. - -## For Enterprise - -Available as part of the Tidelift Subscription - -The maintainers of Guzzle and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-guzzlehttp-guzzle?utm_source=packagist-guzzlehttp-guzzle&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/vendor/guzzlehttp/guzzle/UPGRADING.md b/vendor/guzzlehttp/guzzle/UPGRADING.md deleted file mode 100644 index 45417a7..0000000 --- a/vendor/guzzlehttp/guzzle/UPGRADING.md +++ /dev/null @@ -1,1253 +0,0 @@ -Guzzle Upgrade Guide -==================== - -6.0 to 7.0 ----------- - -In order to take advantage of the new features of PHP, Guzzle dropped the support -of PHP 5. The minimum supported PHP version is now PHP 7.2. Type hints and return -types for functions and methods have been added wherever possible. - -Please make sure: -- You are calling a function or a method with the correct type. -- If you extend a class of Guzzle; update all signatures on methods you override. - -#### Other backwards compatibility breaking changes - -- Class `GuzzleHttp\UriTemplate` is removed. -- Class `GuzzleHttp\Exception\SeekException` is removed. -- Classes `GuzzleHttp\Exception\BadResponseException`, `GuzzleHttp\Exception\ClientException`, - `GuzzleHttp\Exception\ServerException` can no longer be initialized with an empty - Response as argument. -- Class `GuzzleHttp\Exception\ConnectException` now extends `GuzzleHttp\Exception\TransferException` - instead of `GuzzleHttp\Exception\RequestException`. -- Function `GuzzleHttp\Exception\ConnectException::getResponse()` is removed. -- Function `GuzzleHttp\Exception\ConnectException::hasResponse()` is removed. -- Constant `GuzzleHttp\ClientInterface::VERSION` is removed. Added `GuzzleHttp\ClientInterface::MAJOR_VERSION` instead. -- Function `GuzzleHttp\Exception\RequestException::getResponseBodySummary` is removed. - Use `\GuzzleHttp\Psr7\get_message_body_summary` as an alternative. -- Function `GuzzleHttp\Cookie\CookieJar::getCookieValue` is removed. -- Request option `exception` is removed. Please use `http_errors`. -- Request option `save_to` is removed. Please use `sink`. -- Pool option `pool_size` is removed. Please use `concurrency`. -- We now look for environment variables in the `$_SERVER` super global, due to thread safety issues with `getenv`. We continue to fallback to `getenv` in CLI environments, for maximum compatibility. -- The `get`, `head`, `put`, `post`, `patch`, `delete`, `getAsync`, `headAsync`, `putAsync`, `postAsync`, `patchAsync`, and `deleteAsync` methods are now implemented as genuine methods on `GuzzleHttp\Client`, with strong typing. The original `__call` implementation remains unchanged for now, for maximum backwards compatibility, but won't be invoked under normal operation. -- The `log` middleware will log the errors with level `error` instead of `notice` -- Support for international domain names (IDN) is now disabled by default, and enabling it requires installing ext-intl, linked against a modern version of the C library (ICU 4.6 or higher). - -#### Native functions calls - -All internal native functions calls of Guzzle are now prefixed with a slash. This -change makes it impossible for method overloading by other libraries or applications. -Example: - -```php -// Before: -curl_version(); - -// After: -\curl_version(); -``` - -For the full diff you can check [here](https://github.com/guzzle/guzzle/compare/6.5.4..master). - -5.0 to 6.0 ----------- - -Guzzle now uses [PSR-7](https://www.php-fig.org/psr/psr-7/) for HTTP messages. -Due to the fact that these messages are immutable, this prompted a refactoring -of Guzzle to use a middleware based system rather than an event system. Any -HTTP message interaction (e.g., `GuzzleHttp\Message\Request`) need to be -updated to work with the new immutable PSR-7 request and response objects. Any -event listeners or subscribers need to be updated to become middleware -functions that wrap handlers (or are injected into a -`GuzzleHttp\HandlerStack`). - -- Removed `GuzzleHttp\BatchResults` -- Removed `GuzzleHttp\Collection` -- Removed `GuzzleHttp\HasDataTrait` -- Removed `GuzzleHttp\ToArrayInterface` -- The `guzzlehttp/streams` dependency has been removed. Stream functionality - is now present in the `GuzzleHttp\Psr7` namespace provided by the - `guzzlehttp/psr7` package. -- Guzzle no longer uses ReactPHP promises and now uses the - `guzzlehttp/promises` library. We use a custom promise library for three - significant reasons: - 1. React promises (at the time of writing this) are recursive. Promise - chaining and promise resolution will eventually blow the stack. Guzzle - promises are not recursive as they use a sort of trampolining technique. - Note: there has been movement in the React project to modify promises to - no longer utilize recursion. - 2. Guzzle needs to have the ability to synchronously block on a promise to - wait for a result. Guzzle promises allows this functionality (and does - not require the use of recursion). - 3. Because we need to be able to wait on a result, doing so using React - promises requires wrapping react promises with RingPHP futures. This - overhead is no longer needed, reducing stack sizes, reducing complexity, - and improving performance. -- `GuzzleHttp\Mimetypes` has been moved to a function in - `GuzzleHttp\Psr7\mimetype_from_extension` and - `GuzzleHttp\Psr7\mimetype_from_filename`. -- `GuzzleHttp\Query` and `GuzzleHttp\QueryParser` have been removed. Query - strings must now be passed into request objects as strings, or provided to - the `query` request option when creating requests with clients. The `query` - option uses PHP's `http_build_query` to convert an array to a string. If you - need a different serialization technique, you will need to pass the query - string in as a string. There are a couple helper functions that will make - working with query strings easier: `GuzzleHttp\Psr7\parse_query` and - `GuzzleHttp\Psr7\build_query`. -- Guzzle no longer has a dependency on RingPHP. Due to the use of a middleware - system based on PSR-7, using RingPHP and it's middleware system as well adds - more complexity than the benefits it provides. All HTTP handlers that were - present in RingPHP have been modified to work directly with PSR-7 messages - and placed in the `GuzzleHttp\Handler` namespace. This significantly reduces - complexity in Guzzle, removes a dependency, and improves performance. RingPHP - will be maintained for Guzzle 5 support, but will no longer be a part of - Guzzle 6. -- As Guzzle now uses a middleware based systems the event system and RingPHP - integration has been removed. Note: while the event system has been removed, - it is possible to add your own type of event system that is powered by the - middleware system. - - Removed the `Event` namespace. - - Removed the `Subscriber` namespace. - - Removed `Transaction` class - - Removed `RequestFsm` - - Removed `RingBridge` - - `GuzzleHttp\Subscriber\Cookie` is now provided by - `GuzzleHttp\Middleware::cookies` - - `GuzzleHttp\Subscriber\HttpError` is now provided by - `GuzzleHttp\Middleware::httpError` - - `GuzzleHttp\Subscriber\History` is now provided by - `GuzzleHttp\Middleware::history` - - `GuzzleHttp\Subscriber\Mock` is now provided by - `GuzzleHttp\Handler\MockHandler` - - `GuzzleHttp\Subscriber\Prepare` is now provided by - `GuzzleHttp\PrepareBodyMiddleware` - - `GuzzleHttp\Subscriber\Redirect` is now provided by - `GuzzleHttp\RedirectMiddleware` -- Guzzle now uses `Psr\Http\Message\UriInterface` (implements in - `GuzzleHttp\Psr7\Uri`) for URI support. `GuzzleHttp\Url` is now gone. -- Static functions in `GuzzleHttp\Utils` have been moved to namespaced - functions under the `GuzzleHttp` namespace. This requires either a Composer - based autoloader or you to include functions.php. -- `GuzzleHttp\ClientInterface::getDefaultOption` has been renamed to - `GuzzleHttp\ClientInterface::getConfig`. -- `GuzzleHttp\ClientInterface::setDefaultOption` has been removed. -- The `json` and `xml` methods of response objects has been removed. With the - migration to strictly adhering to PSR-7 as the interface for Guzzle messages, - adding methods to message interfaces would actually require Guzzle messages - to extend from PSR-7 messages rather then work with them directly. - -## Migrating to middleware - -The change to PSR-7 unfortunately required significant refactoring to Guzzle -due to the fact that PSR-7 messages are immutable. Guzzle 5 relied on an event -system from plugins. The event system relied on mutability of HTTP messages and -side effects in order to work. With immutable messages, you have to change your -workflow to become more about either returning a value (e.g., functional -middlewares) or setting a value on an object. Guzzle v6 has chosen the -functional middleware approach. - -Instead of using the event system to listen for things like the `before` event, -you now create a stack based middleware function that intercepts a request on -the way in and the promise of the response on the way out. This is a much -simpler and more predictable approach than the event system and works nicely -with PSR-7 middleware. Due to the use of promises, the middleware system is -also asynchronous. - -v5: - -```php -use GuzzleHttp\Event\BeforeEvent; -$client = new GuzzleHttp\Client(); -// Get the emitter and listen to the before event. -$client->getEmitter()->on('before', function (BeforeEvent $e) { - // Guzzle v5 events relied on mutation - $e->getRequest()->setHeader('X-Foo', 'Bar'); -}); -``` - -v6: - -In v6, you can modify the request before it is sent using the `mapRequest` -middleware. The idiomatic way in v6 to modify the request/response lifecycle is -to setup a handler middleware stack up front and inject the handler into a -client. - -```php -use GuzzleHttp\Middleware; -// Create a handler stack that has all of the default middlewares attached -$handler = GuzzleHttp\HandlerStack::create(); -// Push the handler onto the handler stack -$handler->push(Middleware::mapRequest(function (RequestInterface $request) { - // Notice that we have to return a request object - return $request->withHeader('X-Foo', 'Bar'); -})); -// Inject the handler into the client -$client = new GuzzleHttp\Client(['handler' => $handler]); -``` - -## POST Requests - -This version added the [`form_params`](http://guzzle.readthedocs.org/en/latest/request-options.html#form_params) -and `multipart` request options. `form_params` is an associative array of -strings or array of strings and is used to serialize an -`application/x-www-form-urlencoded` POST request. The -[`multipart`](http://guzzle.readthedocs.org/en/latest/request-options.html#multipart) -option is now used to send a multipart/form-data POST request. - -`GuzzleHttp\Post\PostFile` has been removed. Use the `multipart` option to add -POST files to a multipart/form-data request. - -The `body` option no longer accepts an array to send POST requests. Please use -`multipart` or `form_params` instead. - -The `base_url` option has been renamed to `base_uri`. - -4.x to 5.0 ----------- - -## Rewritten Adapter Layer - -Guzzle now uses [RingPHP](http://ringphp.readthedocs.org/en/latest) to send -HTTP requests. The `adapter` option in a `GuzzleHttp\Client` constructor -is still supported, but it has now been renamed to `handler`. Instead of -passing a `GuzzleHttp\Adapter\AdapterInterface`, you must now pass a PHP -`callable` that follows the RingPHP specification. - -## Removed Fluent Interfaces - -[Fluent interfaces were removed](https://ocramius.github.io/blog/fluent-interfaces-are-evil/) -from the following classes: - -- `GuzzleHttp\Collection` -- `GuzzleHttp\Url` -- `GuzzleHttp\Query` -- `GuzzleHttp\Post\PostBody` -- `GuzzleHttp\Cookie\SetCookie` - -## Removed functions.php - -Removed "functions.php", so that Guzzle is truly PSR-4 compliant. The following -functions can be used as replacements. - -- `GuzzleHttp\json_decode` -> `GuzzleHttp\Utils::jsonDecode` -- `GuzzleHttp\get_path` -> `GuzzleHttp\Utils::getPath` -- `GuzzleHttp\Utils::setPath` -> `GuzzleHttp\set_path` -- `GuzzleHttp\Pool::batch` -> `GuzzleHttp\batch`. This function is, however, - deprecated in favor of using `GuzzleHttp\Pool::batch()`. - -The "procedural" global client has been removed with no replacement (e.g., -`GuzzleHttp\get()`, `GuzzleHttp\post()`, etc.). Use a `GuzzleHttp\Client` -object as a replacement. - -## `throwImmediately` has been removed - -The concept of "throwImmediately" has been removed from exceptions and error -events. This control mechanism was used to stop a transfer of concurrent -requests from completing. This can now be handled by throwing the exception or -by cancelling a pool of requests or each outstanding future request -individually. - -## headers event has been removed - -Removed the "headers" event. This event was only useful for changing the -body a response once the headers of the response were known. You can implement -a similar behavior in a number of ways. One example might be to use a -FnStream that has access to the transaction being sent. For example, when the -first byte is written, you could check if the response headers match your -expectations, and if so, change the actual stream body that is being -written to. - -## Updates to HTTP Messages - -Removed the `asArray` parameter from -`GuzzleHttp\Message\MessageInterface::getHeader`. If you want to get a header -value as an array, then use the newly added `getHeaderAsArray()` method of -`MessageInterface`. This change makes the Guzzle interfaces compatible with -the PSR-7 interfaces. - -3.x to 4.0 ----------- - -## Overarching changes: - -- Now requires PHP 5.4 or greater. -- No longer requires cURL to send requests. -- Guzzle no longer wraps every exception it throws. Only exceptions that are - recoverable are now wrapped by Guzzle. -- Various namespaces have been removed or renamed. -- No longer requiring the Symfony EventDispatcher. A custom event dispatcher - based on the Symfony EventDispatcher is - now utilized in `GuzzleHttp\Event\EmitterInterface` (resulting in significant - speed and functionality improvements). - -Changes per Guzzle 3.x namespace are described below. - -## Batch - -The `Guzzle\Batch` namespace has been removed. This is best left to -third-parties to implement on top of Guzzle's core HTTP library. - -## Cache - -The `Guzzle\Cache` namespace has been removed. (Todo: No suitable replacement -has been implemented yet, but hoping to utilize a PSR cache interface). - -## Common - -- Removed all of the wrapped exceptions. It's better to use the standard PHP - library for unrecoverable exceptions. -- `FromConfigInterface` has been removed. -- `Guzzle\Common\Version` has been removed. The VERSION constant can be found - at `GuzzleHttp\ClientInterface::VERSION`. - -### Collection - -- `getAll` has been removed. Use `toArray` to convert a collection to an array. -- `inject` has been removed. -- `keySearch` has been removed. -- `getPath` no longer supports wildcard expressions. Use something better like - JMESPath for this. -- `setPath` now supports appending to an existing array via the `[]` notation. - -### Events - -Guzzle no longer requires Symfony's EventDispatcher component. Guzzle now uses -`GuzzleHttp\Event\Emitter`. - -- `Symfony\Component\EventDispatcher\EventDispatcherInterface` is replaced by - `GuzzleHttp\Event\EmitterInterface`. -- `Symfony\Component\EventDispatcher\EventDispatcher` is replaced by - `GuzzleHttp\Event\Emitter`. -- `Symfony\Component\EventDispatcher\Event` is replaced by - `GuzzleHttp\Event\Event`, and Guzzle now has an EventInterface in - `GuzzleHttp\Event\EventInterface`. -- `AbstractHasDispatcher` has moved to a trait, `HasEmitterTrait`, and - `HasDispatcherInterface` has moved to `HasEmitterInterface`. Retrieving the - event emitter of a request, client, etc. now uses the `getEmitter` method - rather than the `getDispatcher` method. - -#### Emitter - -- Use the `once()` method to add a listener that automatically removes itself - the first time it is invoked. -- Use the `listeners()` method to retrieve a list of event listeners rather than - the `getListeners()` method. -- Use `emit()` instead of `dispatch()` to emit an event from an emitter. -- Use `attach()` instead of `addSubscriber()` and `detach()` instead of - `removeSubscriber()`. - -```php -$mock = new Mock(); -// 3.x -$request->getEventDispatcher()->addSubscriber($mock); -$request->getEventDispatcher()->removeSubscriber($mock); -// 4.x -$request->getEmitter()->attach($mock); -$request->getEmitter()->detach($mock); -``` - -Use the `on()` method to add a listener rather than the `addListener()` method. - -```php -// 3.x -$request->getEventDispatcher()->addListener('foo', function (Event $event) { /* ... */ } ); -// 4.x -$request->getEmitter()->on('foo', function (Event $event, $name) { /* ... */ } ); -``` - -## Http - -### General changes - -- The cacert.pem certificate has been moved to `src/cacert.pem`. -- Added the concept of adapters that are used to transfer requests over the - wire. -- Simplified the event system. -- Sending requests in parallel is still possible, but batching is no longer a - concept of the HTTP layer. Instead, you must use the `complete` and `error` - events to asynchronously manage parallel request transfers. -- `Guzzle\Http\Url` has moved to `GuzzleHttp\Url`. -- `Guzzle\Http\QueryString` has moved to `GuzzleHttp\Query`. -- QueryAggregators have been rewritten so that they are simply callable - functions. -- `GuzzleHttp\StaticClient` has been removed. Use the functions provided in - `functions.php` for an easy to use static client instance. -- Exceptions in `GuzzleHttp\Exception` have been updated to all extend from - `GuzzleHttp\Exception\TransferException`. - -### Client - -Calling methods like `get()`, `post()`, `head()`, etc. no longer create and -return a request, but rather creates a request, sends the request, and returns -the response. - -```php -// 3.0 -$request = $client->get('/'); -$response = $request->send(); - -// 4.0 -$response = $client->get('/'); - -// or, to mirror the previous behavior -$request = $client->createRequest('GET', '/'); -$response = $client->send($request); -``` - -`GuzzleHttp\ClientInterface` has changed. - -- The `send` method no longer accepts more than one request. Use `sendAll` to - send multiple requests in parallel. -- `setUserAgent()` has been removed. Use a default request option instead. You - could, for example, do something like: - `$client->setConfig('defaults/headers/User-Agent', 'Foo/Bar ' . $client::getDefaultUserAgent())`. -- `setSslVerification()` has been removed. Use default request options instead, - like `$client->setConfig('defaults/verify', true)`. - -`GuzzleHttp\Client` has changed. - -- The constructor now accepts only an associative array. You can include a - `base_url` string or array to use a URI template as the base URL of a client. - You can also specify a `defaults` key that is an associative array of default - request options. You can pass an `adapter` to use a custom adapter, - `batch_adapter` to use a custom adapter for sending requests in parallel, or - a `message_factory` to change the factory used to create HTTP requests and - responses. -- The client no longer emits a `client.create_request` event. -- Creating requests with a client no longer automatically utilize a URI - template. You must pass an array into a creational method (e.g., - `createRequest`, `get`, `put`, etc.) in order to expand a URI template. - -### Messages - -Messages no longer have references to their counterparts (i.e., a request no -longer has a reference to it's response, and a response no loger has a -reference to its request). This association is now managed through a -`GuzzleHttp\Adapter\TransactionInterface` object. You can get references to -these transaction objects using request events that are emitted over the -lifecycle of a request. - -#### Requests with a body - -- `GuzzleHttp\Message\EntityEnclosingRequest` and - `GuzzleHttp\Message\EntityEnclosingRequestInterface` have been removed. The - separation between requests that contain a body and requests that do not - contain a body has been removed, and now `GuzzleHttp\Message\RequestInterface` - handles both use cases. -- Any method that previously accepts a `GuzzleHttp\Response` object now accept a - `GuzzleHttp\Message\ResponseInterface`. -- `GuzzleHttp\Message\RequestFactoryInterface` has been renamed to - `GuzzleHttp\Message\MessageFactoryInterface`. This interface is used to create - both requests and responses and is implemented in - `GuzzleHttp\Message\MessageFactory`. -- POST field and file methods have been removed from the request object. You - must now use the methods made available to `GuzzleHttp\Post\PostBodyInterface` - to control the format of a POST body. Requests that are created using a - standard `GuzzleHttp\Message\MessageFactoryInterface` will automatically use - a `GuzzleHttp\Post\PostBody` body if the body was passed as an array or if - the method is POST and no body is provided. - -```php -$request = $client->createRequest('POST', '/'); -$request->getBody()->setField('foo', 'bar'); -$request->getBody()->addFile(new PostFile('file_key', fopen('/path/to/content', 'r'))); -``` - -#### Headers - -- `GuzzleHttp\Message\Header` has been removed. Header values are now simply - represented by an array of values or as a string. Header values are returned - as a string by default when retrieving a header value from a message. You can - pass an optional argument of `true` to retrieve a header value as an array - of strings instead of a single concatenated string. -- `GuzzleHttp\PostFile` and `GuzzleHttp\PostFileInterface` have been moved to - `GuzzleHttp\Post`. This interface has been simplified and now allows the - addition of arbitrary headers. -- Custom headers like `GuzzleHttp\Message\Header\Link` have been removed. Most - of the custom headers are now handled separately in specific - subscribers/plugins, and `GuzzleHttp\Message\HeaderValues::parseParams()` has - been updated to properly handle headers that contain parameters (like the - `Link` header). - -#### Responses - -- `GuzzleHttp\Message\Response::getInfo()` and - `GuzzleHttp\Message\Response::setInfo()` have been removed. Use the event - system to retrieve this type of information. -- `GuzzleHttp\Message\Response::getRawHeaders()` has been removed. -- `GuzzleHttp\Message\Response::getMessage()` has been removed. -- `GuzzleHttp\Message\Response::calculateAge()` and other cache specific - methods have moved to the CacheSubscriber. -- Header specific helper functions like `getContentMd5()` have been removed. - Just use `getHeader('Content-MD5')` instead. -- `GuzzleHttp\Message\Response::setRequest()` and - `GuzzleHttp\Message\Response::getRequest()` have been removed. Use the event - system to work with request and response objects as a transaction. -- `GuzzleHttp\Message\Response::getRedirectCount()` has been removed. Use the - Redirect subscriber instead. -- `GuzzleHttp\Message\Response::isSuccessful()` and other related methods have - been removed. Use `getStatusCode()` instead. - -#### Streaming responses - -Streaming requests can now be created by a client directly, returning a -`GuzzleHttp\Message\ResponseInterface` object that contains a body stream -referencing an open PHP HTTP stream. - -```php -// 3.0 -use Guzzle\Stream\PhpStreamRequestFactory; -$request = $client->get('/'); -$factory = new PhpStreamRequestFactory(); -$stream = $factory->fromRequest($request); -$data = $stream->read(1024); - -// 4.0 -$response = $client->get('/', ['stream' => true]); -// Read some data off of the stream in the response body -$data = $response->getBody()->read(1024); -``` - -#### Redirects - -The `configureRedirects()` method has been removed in favor of a -`allow_redirects` request option. - -```php -// Standard redirects with a default of a max of 5 redirects -$request = $client->createRequest('GET', '/', ['allow_redirects' => true]); - -// Strict redirects with a custom number of redirects -$request = $client->createRequest('GET', '/', [ - 'allow_redirects' => ['max' => 5, 'strict' => true] -]); -``` - -#### EntityBody - -EntityBody interfaces and classes have been removed or moved to -`GuzzleHttp\Stream`. All classes and interfaces that once required -`GuzzleHttp\EntityBodyInterface` now require -`GuzzleHttp\Stream\StreamInterface`. Creating a new body for a request no -longer uses `GuzzleHttp\EntityBody::factory` but now uses -`GuzzleHttp\Stream\Stream::factory` or even better: -`GuzzleHttp\Stream\create()`. - -- `Guzzle\Http\EntityBodyInterface` is now `GuzzleHttp\Stream\StreamInterface` -- `Guzzle\Http\EntityBody` is now `GuzzleHttp\Stream\Stream` -- `Guzzle\Http\CachingEntityBody` is now `GuzzleHttp\Stream\CachingStream` -- `Guzzle\Http\ReadLimitEntityBody` is now `GuzzleHttp\Stream\LimitStream` -- `Guzzle\Http\IoEmittyinEntityBody` has been removed. - -#### Request lifecycle events - -Requests previously submitted a large number of requests. The number of events -emitted over the lifecycle of a request has been significantly reduced to make -it easier to understand how to extend the behavior of a request. All events -emitted during the lifecycle of a request now emit a custom -`GuzzleHttp\Event\EventInterface` object that contains context providing -methods and a way in which to modify the transaction at that specific point in -time (e.g., intercept the request and set a response on the transaction). - -- `request.before_send` has been renamed to `before` and now emits a - `GuzzleHttp\Event\BeforeEvent` -- `request.complete` has been renamed to `complete` and now emits a - `GuzzleHttp\Event\CompleteEvent`. -- `request.sent` has been removed. Use `complete`. -- `request.success` has been removed. Use `complete`. -- `error` is now an event that emits a `GuzzleHttp\Event\ErrorEvent`. -- `request.exception` has been removed. Use `error`. -- `request.receive.status_line` has been removed. -- `curl.callback.progress` has been removed. Use a custom `StreamInterface` to - maintain a status update. -- `curl.callback.write` has been removed. Use a custom `StreamInterface` to - intercept writes. -- `curl.callback.read` has been removed. Use a custom `StreamInterface` to - intercept reads. - -`headers` is a new event that is emitted after the response headers of a -request have been received before the body of the response is downloaded. This -event emits a `GuzzleHttp\Event\HeadersEvent`. - -You can intercept a request and inject a response using the `intercept()` event -of a `GuzzleHttp\Event\BeforeEvent`, `GuzzleHttp\Event\CompleteEvent`, and -`GuzzleHttp\Event\ErrorEvent` event. - -See: http://docs.guzzlephp.org/en/latest/events.html - -## Inflection - -The `Guzzle\Inflection` namespace has been removed. This is not a core concern -of Guzzle. - -## Iterator - -The `Guzzle\Iterator` namespace has been removed. - -- `Guzzle\Iterator\AppendIterator`, `Guzzle\Iterator\ChunkedIterator`, and - `Guzzle\Iterator\MethodProxyIterator` are nice, but not a core requirement of - Guzzle itself. -- `Guzzle\Iterator\FilterIterator` is no longer needed because an equivalent - class is shipped with PHP 5.4. -- `Guzzle\Iterator\MapIterator` is not really needed when using PHP 5.5 because - it's easier to just wrap an iterator in a generator that maps values. - -For a replacement of these iterators, see https://github.com/nikic/iter - -## Log - -The LogPlugin has moved to https://github.com/guzzle/log-subscriber. The -`Guzzle\Log` namespace has been removed. Guzzle now relies on -`Psr\Log\LoggerInterface` for all logging. The MessageFormatter class has been -moved to `GuzzleHttp\Subscriber\Log\Formatter`. - -## Parser - -The `Guzzle\Parser` namespace has been removed. This was previously used to -make it possible to plug in custom parsers for cookies, messages, URI -templates, and URLs; however, this level of complexity is not needed in Guzzle -so it has been removed. - -- Cookie: Cookie parsing logic has been moved to - `GuzzleHttp\Cookie\SetCookie::fromString`. -- Message: Message parsing logic for both requests and responses has been moved - to `GuzzleHttp\Message\MessageFactory::fromMessage`. Message parsing is only - used in debugging or deserializing messages, so it doesn't make sense for - Guzzle as a library to add this level of complexity to parsing messages. -- UriTemplate: URI template parsing has been moved to - `GuzzleHttp\UriTemplate`. The Guzzle library will automatically use the PECL - URI template library if it is installed. -- Url: URL parsing is now performed in `GuzzleHttp\Url::fromString` (previously - it was `Guzzle\Http\Url::factory()`). If custom URL parsing is necessary, - then developers are free to subclass `GuzzleHttp\Url`. - -## Plugin - -The `Guzzle\Plugin` namespace has been renamed to `GuzzleHttp\Subscriber`. -Several plugins are shipping with the core Guzzle library under this namespace. - -- `GuzzleHttp\Subscriber\Cookie`: Replaces the old CookiePlugin. Cookie jar - code has moved to `GuzzleHttp\Cookie`. -- `GuzzleHttp\Subscriber\History`: Replaces the old HistoryPlugin. -- `GuzzleHttp\Subscriber\HttpError`: Throws errors when a bad HTTP response is - received. -- `GuzzleHttp\Subscriber\Mock`: Replaces the old MockPlugin. -- `GuzzleHttp\Subscriber\Prepare`: Prepares the body of a request just before - sending. This subscriber is attached to all requests by default. -- `GuzzleHttp\Subscriber\Redirect`: Replaces the RedirectPlugin. - -The following plugins have been removed (third-parties are free to re-implement -these if needed): - -- `GuzzleHttp\Plugin\Async` has been removed. -- `GuzzleHttp\Plugin\CurlAuth` has been removed. -- `GuzzleHttp\Plugin\ErrorResponse\ErrorResponsePlugin` has been removed. This - functionality should instead be implemented with event listeners that occur - after normal response parsing occurs in the guzzle/command package. - -The following plugins are not part of the core Guzzle package, but are provided -in separate repositories: - -- `Guzzle\Http\Plugin\BackoffPlugin` has been rewritten to be much simpler - to build custom retry policies using simple functions rather than various - chained classes. See: https://github.com/guzzle/retry-subscriber -- `Guzzle\Http\Plugin\Cache\CachePlugin` has moved to - https://github.com/guzzle/cache-subscriber -- `Guzzle\Http\Plugin\Log\LogPlugin` has moved to - https://github.com/guzzle/log-subscriber -- `Guzzle\Http\Plugin\Md5\Md5Plugin` has moved to - https://github.com/guzzle/message-integrity-subscriber -- `Guzzle\Http\Plugin\Mock\MockPlugin` has moved to - `GuzzleHttp\Subscriber\MockSubscriber`. -- `Guzzle\Http\Plugin\Oauth\OauthPlugin` has moved to - https://github.com/guzzle/oauth-subscriber - -## Service - -The service description layer of Guzzle has moved into two separate packages: - -- http://github.com/guzzle/command Provides a high level abstraction over web - services by representing web service operations using commands. -- http://github.com/guzzle/guzzle-services Provides an implementation of - guzzle/command that provides request serialization and response parsing using - Guzzle service descriptions. - -## Stream - -Stream have moved to a separate package available at -https://github.com/guzzle/streams. - -`Guzzle\Stream\StreamInterface` has been given a large update to cleanly take -on the responsibilities of `Guzzle\Http\EntityBody` and -`Guzzle\Http\EntityBodyInterface` now that they have been removed. The number -of methods implemented by the `StreamInterface` has been drastically reduced to -allow developers to more easily extend and decorate stream behavior. - -## Removed methods from StreamInterface - -- `getStream` and `setStream` have been removed to better encapsulate streams. -- `getMetadata` and `setMetadata` have been removed in favor of - `GuzzleHttp\Stream\MetadataStreamInterface`. -- `getWrapper`, `getWrapperData`, `getStreamType`, and `getUri` have all been - removed. This data is accessible when - using streams that implement `GuzzleHttp\Stream\MetadataStreamInterface`. -- `rewind` has been removed. Use `seek(0)` for a similar behavior. - -## Renamed methods - -- `detachStream` has been renamed to `detach`. -- `feof` has been renamed to `eof`. -- `ftell` has been renamed to `tell`. -- `readLine` has moved from an instance method to a static class method of - `GuzzleHttp\Stream\Stream`. - -## Metadata streams - -`GuzzleHttp\Stream\MetadataStreamInterface` has been added to denote streams -that contain additional metadata accessible via `getMetadata()`. -`GuzzleHttp\Stream\StreamInterface::getMetadata` and -`GuzzleHttp\Stream\StreamInterface::setMetadata` have been removed. - -## StreamRequestFactory - -The entire concept of the StreamRequestFactory has been removed. The way this -was used in Guzzle 3 broke the actual interface of sending streaming requests -(instead of getting back a Response, you got a StreamInterface). Streaming -PHP requests are now implemented through the `GuzzleHttp\Adapter\StreamAdapter`. - -3.6 to 3.7 ----------- - -### Deprecations - -- You can now enable E_USER_DEPRECATED warnings to see if you are using any deprecated methods.: - -```php -\Guzzle\Common\Version::$emitWarnings = true; -``` - -The following APIs and options have been marked as deprecated: - -- Marked `Guzzle\Http\Message\Request::isResponseBodyRepeatable()` as deprecated. Use `$request->getResponseBody()->isRepeatable()` instead. -- Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead. -- Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead. -- Marked `Guzzle\Http\Message\Request::setIsRedirect()` as deprecated. Use the HistoryPlugin instead. -- Marked `Guzzle\Http\Message\Request::isRedirect()` as deprecated. Use the HistoryPlugin instead. -- Marked `Guzzle\Cache\CacheAdapterFactory::factory()` as deprecated -- Marked `Guzzle\Service\Client::enableMagicMethods()` as deprecated. Magic methods can no longer be disabled on a Guzzle\Service\Client. -- Marked `Guzzle\Parser\Url\UrlParser` as deprecated. Just use PHP's `parse_url()` and percent encode your UTF-8. -- Marked `Guzzle\Common\Collection::inject()` as deprecated. -- Marked `Guzzle\Plugin\CurlAuth\CurlAuthPlugin` as deprecated. Use - `$client->getConfig()->setPath('request.options/auth', array('user', 'pass', 'Basic|Digest|NTLM|Any'));` or - `$client->setDefaultOption('auth', array('user', 'pass', 'Basic|Digest|NTLM|Any'));` - -3.7 introduces `request.options` as a parameter for a client configuration and as an optional argument to all creational -request methods. When paired with a client's configuration settings, these options allow you to specify default settings -for various aspects of a request. Because these options make other previous configuration options redundant, several -configuration options and methods of a client and AbstractCommand have been deprecated. - -- Marked `Guzzle\Service\Client::getDefaultHeaders()` as deprecated. Use `$client->getDefaultOption('headers')`. -- Marked `Guzzle\Service\Client::setDefaultHeaders()` as deprecated. Use `$client->setDefaultOption('headers/{header_name}', 'value')`. -- Marked 'request.params' for `Guzzle\Http\Client` as deprecated. Use `$client->setDefaultOption('params/{param_name}', 'value')` -- Marked 'command.headers', 'command.response_body' and 'command.on_complete' as deprecated for AbstractCommand. These will work through Guzzle 4.0 - - $command = $client->getCommand('foo', array( - 'command.headers' => array('Test' => '123'), - 'command.response_body' => '/path/to/file' - )); - - // Should be changed to: - - $command = $client->getCommand('foo', array( - 'command.request_options' => array( - 'headers' => array('Test' => '123'), - 'save_as' => '/path/to/file' - ) - )); - -### Interface changes - -Additions and changes (you will need to update any implementations or subclasses you may have created): - -- Added an `$options` argument to the end of the following methods of `Guzzle\Http\ClientInterface`: - createRequest, head, delete, put, patch, post, options, prepareRequest -- Added an `$options` argument to the end of `Guzzle\Http\Message\Request\RequestFactoryInterface::createRequest()` -- Added an `applyOptions()` method to `Guzzle\Http\Message\Request\RequestFactoryInterface` -- Changed `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $body = null)` to - `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $options = array())`. You can still pass in a - resource, string, or EntityBody into the $options parameter to specify the download location of the response. -- Changed `Guzzle\Common\Collection::__construct($data)` to no longer accepts a null value for `$data` but a - default `array()` -- Added `Guzzle\Stream\StreamInterface::isRepeatable` -- Made `Guzzle\Http\Client::expandTemplate` and `getUriTemplate` protected methods. - -The following methods were removed from interfaces. All of these methods are still available in the concrete classes -that implement them, but you should update your code to use alternative methods: - -- Removed `Guzzle\Http\ClientInterface::setDefaultHeaders(). Use - `$client->getConfig()->setPath('request.options/headers/{header_name}', 'value')`. or - `$client->getConfig()->setPath('request.options/headers', array('header_name' => 'value'))` or - `$client->setDefaultOption('headers/{header_name}', 'value')`. or - `$client->setDefaultOption('headers', array('header_name' => 'value'))`. -- Removed `Guzzle\Http\ClientInterface::getDefaultHeaders(). Use `$client->getConfig()->getPath('request.options/headers')`. -- Removed `Guzzle\Http\ClientInterface::expandTemplate()`. This is an implementation detail. -- Removed `Guzzle\Http\ClientInterface::setRequestFactory()`. This is an implementation detail. -- Removed `Guzzle\Http\ClientInterface::getCurlMulti()`. This is a very specific implementation detail. -- Removed `Guzzle\Http\Message\RequestInterface::canCache`. Use the CachePlugin. -- Removed `Guzzle\Http\Message\RequestInterface::setIsRedirect`. Use the HistoryPlugin. -- Removed `Guzzle\Http\Message\RequestInterface::isRedirect`. Use the HistoryPlugin. - -### Cache plugin breaking changes - -- CacheKeyProviderInterface and DefaultCacheKeyProvider are no longer used. All of this logic is handled in a - CacheStorageInterface. These two objects and interface will be removed in a future version. -- Always setting X-cache headers on cached responses -- Default cache TTLs are now handled by the CacheStorageInterface of a CachePlugin -- `CacheStorageInterface::cache($key, Response $response, $ttl = null)` has changed to `cache(RequestInterface - $request, Response $response);` -- `CacheStorageInterface::fetch($key)` has changed to `fetch(RequestInterface $request);` -- `CacheStorageInterface::delete($key)` has changed to `delete(RequestInterface $request);` -- Added `CacheStorageInterface::purge($url)` -- `DefaultRevalidation::__construct(CacheKeyProviderInterface $cacheKey, CacheStorageInterface $cache, CachePlugin - $plugin)` has changed to `DefaultRevalidation::__construct(CacheStorageInterface $cache, - CanCacheStrategyInterface $canCache = null)` -- Added `RevalidationInterface::shouldRevalidate(RequestInterface $request, Response $response)` - -3.5 to 3.6 ----------- - -* Mixed casing of headers are now forced to be a single consistent casing across all values for that header. -* Messages internally use a HeaderCollection object to delegate handling case-insensitive header resolution -* Removed the whole changedHeader() function system of messages because all header changes now go through addHeader(). - For example, setHeader() first removes the header using unset on a HeaderCollection and then calls addHeader(). - Keeping the Host header and URL host in sync is now handled by overriding the addHeader method in Request. -* Specific header implementations can be created for complex headers. When a message creates a header, it uses a - HeaderFactory which can map specific headers to specific header classes. There is now a Link header and - CacheControl header implementation. -* Moved getLinks() from Response to just be used on a Link header object. - -If you previously relied on Guzzle\Http\Message\Header::raw(), then you will need to update your code to use the -HeaderInterface (e.g. toArray(), getAll(), etc.). - -### Interface changes - -* Removed from interface: Guzzle\Http\ClientInterface::setUriTemplate -* Removed from interface: Guzzle\Http\ClientInterface::setCurlMulti() -* Removed Guzzle\Http\Message\Request::receivedRequestHeader() and implemented this functionality in - Guzzle\Http\Curl\RequestMediator -* Removed the optional $asString parameter from MessageInterface::getHeader(). Just cast the header to a string. -* Removed the optional $tryChunkedTransfer option from Guzzle\Http\Message\EntityEnclosingRequestInterface -* Removed the $asObjects argument from Guzzle\Http\Message\MessageInterface::getHeaders() - -### Removed deprecated functions - -* Removed Guzzle\Parser\ParserRegister::get(). Use getParser() -* Removed Guzzle\Parser\ParserRegister::set(). Use registerParser(). - -### Deprecations - -* The ability to case-insensitively search for header values -* Guzzle\Http\Message\Header::hasExactHeader -* Guzzle\Http\Message\Header::raw. Use getAll() -* Deprecated cache control specific methods on Guzzle\Http\Message\AbstractMessage. Use the CacheControl header object - instead. - -### Other changes - -* All response header helper functions return a string rather than mixing Header objects and strings inconsistently -* Removed cURL blacklist support. This is no longer necessary now that Expect, Accept, etc. are managed by Guzzle - directly via interfaces -* Removed the injecting of a request object onto a response object. The methods to get and set a request still exist - but are a no-op until removed. -* Most classes that used to require a `Guzzle\Service\Command\CommandInterface` typehint now request a - `Guzzle\Service\Command\ArrayCommandInterface`. -* Added `Guzzle\Http\Message\RequestInterface::startResponse()` to the RequestInterface to handle injecting a response - on a request while the request is still being transferred -* `Guzzle\Service\Command\CommandInterface` now extends from ToArrayInterface and ArrayAccess - -3.3 to 3.4 ----------- - -Base URLs of a client now follow the rules of https://tools.ietf.org/html/rfc3986#section-5.2.2 when merging URLs. - -3.2 to 3.3 ----------- - -### Response::getEtag() quote stripping removed - -`Guzzle\Http\Message\Response::getEtag()` no longer strips quotes around the ETag response header - -### Removed `Guzzle\Http\Utils` - -The `Guzzle\Http\Utils` class was removed. This class was only used for testing. - -### Stream wrapper and type - -`Guzzle\Stream\Stream::getWrapper()` and `Guzzle\Stream\Stream::getStreamType()` are no longer converted to lowercase. - -### curl.emit_io became emit_io - -Emitting IO events from a RequestMediator is now a parameter that must be set in a request's curl options using the -'emit_io' key. This was previously set under a request's parameters using 'curl.emit_io' - -3.1 to 3.2 ----------- - -### CurlMulti is no longer reused globally - -Before 3.2, the same CurlMulti object was reused globally for each client. This can cause issue where plugins added -to a single client can pollute requests dispatched from other clients. - -If you still wish to reuse the same CurlMulti object with each client, then you can add a listener to the -ServiceBuilder's `service_builder.create_client` event to inject a custom CurlMulti object into each client as it is -created. - -```php -$multi = new Guzzle\Http\Curl\CurlMulti(); -$builder = Guzzle\Service\Builder\ServiceBuilder::factory('/path/to/config.json'); -$builder->addListener('service_builder.create_client', function ($event) use ($multi) { - $event['client']->setCurlMulti($multi); -} -}); -``` - -### No default path - -URLs no longer have a default path value of '/' if no path was specified. - -Before: - -```php -$request = $client->get('http://www.foo.com'); -echo $request->getUrl(); -// >> http://www.foo.com/ -``` - -After: - -```php -$request = $client->get('http://www.foo.com'); -echo $request->getUrl(); -// >> http://www.foo.com -``` - -### Less verbose BadResponseException - -The exception message for `Guzzle\Http\Exception\BadResponseException` no longer contains the full HTTP request and -response information. You can, however, get access to the request and response object by calling `getRequest()` or -`getResponse()` on the exception object. - -### Query parameter aggregation - -Multi-valued query parameters are no longer aggregated using a callback function. `Guzzle\Http\Query` now has a -setAggregator() method that accepts a `Guzzle\Http\QueryAggregator\QueryAggregatorInterface` object. This object is -responsible for handling the aggregation of multi-valued query string variables into a flattened hash. - -2.8 to 3.x ----------- - -### Guzzle\Service\Inspector - -Change `\Guzzle\Service\Inspector::fromConfig` to `\Guzzle\Common\Collection::fromConfig` - -**Before** - -```php -use Guzzle\Service\Inspector; - -class YourClient extends \Guzzle\Service\Client -{ - public static function factory($config = array()) - { - $default = array(); - $required = array('base_url', 'username', 'api_key'); - $config = Inspector::fromConfig($config, $default, $required); - - $client = new self( - $config->get('base_url'), - $config->get('username'), - $config->get('api_key') - ); - $client->setConfig($config); - - $client->setDescription(ServiceDescription::factory(__DIR__ . DIRECTORY_SEPARATOR . 'client.json')); - - return $client; - } -``` - -**After** - -```php -use Guzzle\Common\Collection; - -class YourClient extends \Guzzle\Service\Client -{ - public static function factory($config = array()) - { - $default = array(); - $required = array('base_url', 'username', 'api_key'); - $config = Collection::fromConfig($config, $default, $required); - - $client = new self( - $config->get('base_url'), - $config->get('username'), - $config->get('api_key') - ); - $client->setConfig($config); - - $client->setDescription(ServiceDescription::factory(__DIR__ . DIRECTORY_SEPARATOR . 'client.json')); - - return $client; - } -``` - -### Convert XML Service Descriptions to JSON - -**Before** - -```xml - - - - - - Get a list of groups - - - Uses a search query to get a list of groups - - - - Create a group - - - - - Delete a group by ID - - - - - - - Update a group - - - - - - -``` - -**After** - -```json -{ - "name": "Zendesk REST API v2", - "apiVersion": "2012-12-31", - "description":"Provides access to Zendesk views, groups, tickets, ticket fields, and users", - "operations": { - "list_groups": { - "httpMethod":"GET", - "uri": "groups.json", - "summary": "Get a list of groups" - }, - "search_groups":{ - "httpMethod":"GET", - "uri": "search.json?query=\"{query} type:group\"", - "summary": "Uses a search query to get a list of groups", - "parameters":{ - "query":{ - "location": "uri", - "description":"Zendesk Search Query", - "type": "string", - "required": true - } - } - }, - "create_group": { - "httpMethod":"POST", - "uri": "groups.json", - "summary": "Create a group", - "parameters":{ - "data": { - "type": "array", - "location": "body", - "description":"Group JSON", - "filters": "json_encode", - "required": true - }, - "Content-Type":{ - "type": "string", - "location":"header", - "static": "application/json" - } - } - }, - "delete_group": { - "httpMethod":"DELETE", - "uri": "groups/{id}.json", - "summary": "Delete a group", - "parameters":{ - "id":{ - "location": "uri", - "description":"Group to delete by ID", - "type": "integer", - "required": true - } - } - }, - "get_group": { - "httpMethod":"GET", - "uri": "groups/{id}.json", - "summary": "Get a ticket", - "parameters":{ - "id":{ - "location": "uri", - "description":"Group to get by ID", - "type": "integer", - "required": true - } - } - }, - "update_group": { - "httpMethod":"PUT", - "uri": "groups/{id}.json", - "summary": "Update a group", - "parameters":{ - "id": { - "location": "uri", - "description":"Group to update by ID", - "type": "integer", - "required": true - }, - "data": { - "type": "array", - "location": "body", - "description":"Group JSON", - "filters": "json_encode", - "required": true - }, - "Content-Type":{ - "type": "string", - "location":"header", - "static": "application/json" - } - } - } -} -``` - -### Guzzle\Service\Description\ServiceDescription - -Commands are now called Operations - -**Before** - -```php -use Guzzle\Service\Description\ServiceDescription; - -$sd = new ServiceDescription(); -$sd->getCommands(); // @returns ApiCommandInterface[] -$sd->hasCommand($name); -$sd->getCommand($name); // @returns ApiCommandInterface|null -$sd->addCommand($command); // @param ApiCommandInterface $command -``` - -**After** - -```php -use Guzzle\Service\Description\ServiceDescription; - -$sd = new ServiceDescription(); -$sd->getOperations(); // @returns OperationInterface[] -$sd->hasOperation($name); -$sd->getOperation($name); // @returns OperationInterface|null -$sd->addOperation($operation); // @param OperationInterface $operation -``` - -### Guzzle\Common\Inflection\Inflector - -Namespace is now `Guzzle\Inflection\Inflector` - -### Guzzle\Http\Plugin - -Namespace is now `Guzzle\Plugin`. Many other changes occur within this namespace and are detailed in their own sections below. - -### Guzzle\Http\Plugin\LogPlugin and Guzzle\Common\Log - -Now `Guzzle\Plugin\Log\LogPlugin` and `Guzzle\Log` respectively. - -**Before** - -```php -use Guzzle\Common\Log\ClosureLogAdapter; -use Guzzle\Http\Plugin\LogPlugin; - -/** @var \Guzzle\Http\Client */ -$client; - -// $verbosity is an integer indicating desired message verbosity level -$client->addSubscriber(new LogPlugin(new ClosureLogAdapter(function($m) { echo $m; }, $verbosity = LogPlugin::LOG_VERBOSE); -``` - -**After** - -```php -use Guzzle\Log\ClosureLogAdapter; -use Guzzle\Log\MessageFormatter; -use Guzzle\Plugin\Log\LogPlugin; - -/** @var \Guzzle\Http\Client */ -$client; - -// $format is a string indicating desired message format -- @see MessageFormatter -$client->addSubscriber(new LogPlugin(new ClosureLogAdapter(function($m) { echo $m; }, $format = MessageFormatter::DEBUG_FORMAT); -``` - -### Guzzle\Http\Plugin\CurlAuthPlugin - -Now `Guzzle\Plugin\CurlAuth\CurlAuthPlugin`. - -### Guzzle\Http\Plugin\ExponentialBackoffPlugin - -Now `Guzzle\Plugin\Backoff\BackoffPlugin`, and other changes. - -**Before** - -```php -use Guzzle\Http\Plugin\ExponentialBackoffPlugin; - -$backoffPlugin = new ExponentialBackoffPlugin($maxRetries, array_merge( - ExponentialBackoffPlugin::getDefaultFailureCodes(), array(429) - )); - -$client->addSubscriber($backoffPlugin); -``` - -**After** - -```php -use Guzzle\Plugin\Backoff\BackoffPlugin; -use Guzzle\Plugin\Backoff\HttpBackoffStrategy; - -// Use convenient factory method instead -- see implementation for ideas of what -// you can do with chaining backoff strategies -$backoffPlugin = BackoffPlugin::getExponentialBackoff($maxRetries, array_merge( - HttpBackoffStrategy::getDefaultFailureCodes(), array(429) - )); -$client->addSubscriber($backoffPlugin); -``` - -### Known Issues - -#### [BUG] Accept-Encoding header behavior changed unintentionally. - -(See #217) (Fixed in 09daeb8c666fb44499a0646d655a8ae36456575e) - -In version 2.8 setting the `Accept-Encoding` header would set the CURLOPT_ENCODING option, which permitted cURL to -properly handle gzip/deflate compressed responses from the server. In versions affected by this bug this does not happen. -See issue #217 for a workaround, or use a version containing the fix. diff --git a/vendor/guzzlehttp/guzzle/composer.json b/vendor/guzzlehttp/guzzle/composer.json deleted file mode 100644 index 2549f78..0000000 --- a/vendor/guzzlehttp/guzzle/composer.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "name": "guzzlehttp/guzzle", - "description": "Guzzle is a PHP HTTP client library", - "keywords": [ - "framework", - "http", - "rest", - "web service", - "curl", - "client", - "HTTP client", - "PSR-7", - "PSR-18" - ], - "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" - } - ], - "require": { - "php": "^7.2.5 || ^8.0", - "ext-json": "*", - "guzzlehttp/promises": "^1.5", - "guzzlehttp/psr7": "^1.8.3 || ^2.1", - "psr/http-client": "^1.0", - "symfony/deprecation-contracts": "^2.2 || ^3.0" - }, - "provide": { - "psr/http-client-implementation": "1.0" - }, - "require-dev": { - "ext-curl": "*", - "bamarni/composer-bin-plugin": "^1.4.1", - "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" - }, - "config": { - "preferred-install": "dist", - "sort-packages": true - }, - "extra": { - "branch-alias": { - "dev-master": "7.4-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "autoload-dev": { - "psr-4": { - "GuzzleHttp\\Tests\\": "tests/" - } - } -} diff --git a/vendor/guzzlehttp/guzzle/src/BodySummarizer.php b/vendor/guzzlehttp/guzzle/src/BodySummarizer.php deleted file mode 100644 index 6eca94e..0000000 --- a/vendor/guzzlehttp/guzzle/src/BodySummarizer.php +++ /dev/null @@ -1,28 +0,0 @@ -truncateAt = $truncateAt; - } - - /** - * Returns a summarized message body. - */ - public function summarize(MessageInterface $message): ?string - { - return $this->truncateAt === null - ? \GuzzleHttp\Psr7\Message::bodySummary($message) - : \GuzzleHttp\Psr7\Message::bodySummary($message, $this->truncateAt); - } -} diff --git a/vendor/guzzlehttp/guzzle/src/BodySummarizerInterface.php b/vendor/guzzlehttp/guzzle/src/BodySummarizerInterface.php deleted file mode 100644 index 3e02e03..0000000 --- a/vendor/guzzlehttp/guzzle/src/BodySummarizerInterface.php +++ /dev/null @@ -1,13 +0,0 @@ - 'http://www.foo.com/1.0/', - * 'timeout' => 0, - * 'allow_redirects' => false, - * 'proxy' => '192.168.16.1:10' - * ]); - * - * Client configuration settings include the following options: - * - * - handler: (callable) Function that transfers HTTP requests over the - * wire. The function is called with a Psr7\Http\Message\RequestInterface - * and array of transfer options, and must return a - * GuzzleHttp\Promise\PromiseInterface that is fulfilled with a - * Psr7\Http\Message\ResponseInterface on success. - * If no handler is provided, a default handler will be created - * that enables all of the request options below by attaching all of the - * default middleware to the handler. - * - base_uri: (string|UriInterface) Base URI of the client that is merged - * into relative URIs. Can be a string or instance of UriInterface. - * - **: any request option - * - * @param array $config Client configuration settings. - * - * @see \GuzzleHttp\RequestOptions for a list of available request options. - */ - public function __construct(array $config = []) - { - if (!isset($config['handler'])) { - $config['handler'] = HandlerStack::create(); - } elseif (!\is_callable($config['handler'])) { - throw new InvalidArgumentException('handler must be a callable'); - } - - // Convert the base_uri to a UriInterface - if (isset($config['base_uri'])) { - $config['base_uri'] = Psr7\Utils::uriFor($config['base_uri']); - } - - $this->configureDefaults($config); - } - - /** - * @param string $method - * @param array $args - * - * @return PromiseInterface|ResponseInterface - * - * @deprecated Client::__call will be removed in guzzlehttp/guzzle:8.0. - */ - public function __call($method, $args) - { - if (\count($args) < 1) { - throw new InvalidArgumentException('Magic request methods require a URI and optional options array'); - } - - $uri = $args[0]; - $opts = $args[1] ?? []; - - return \substr($method, -5) === 'Async' - ? $this->requestAsync(\substr($method, 0, -5), $uri, $opts) - : $this->request($method, $uri, $opts); - } - - /** - * Asynchronously send an HTTP request. - * - * @param array $options Request options to apply to the given - * request and to the transfer. See \GuzzleHttp\RequestOptions. - */ - public function sendAsync(RequestInterface $request, array $options = []): PromiseInterface - { - // Merge the base URI into the request URI if needed. - $options = $this->prepareDefaults($options); - - return $this->transfer( - $request->withUri($this->buildUri($request->getUri(), $options), $request->hasHeader('Host')), - $options - ); - } - - /** - * Send an HTTP request. - * - * @param array $options Request options to apply to the given - * request and to the transfer. See \GuzzleHttp\RequestOptions. - * - * @throws GuzzleException - */ - public function send(RequestInterface $request, array $options = []): ResponseInterface - { - $options[RequestOptions::SYNCHRONOUS] = true; - return $this->sendAsync($request, $options)->wait(); - } - - /** - * The HttpClient PSR (PSR-18) specify this method. - * - * @inheritDoc - */ - public function sendRequest(RequestInterface $request): ResponseInterface - { - $options[RequestOptions::SYNCHRONOUS] = true; - $options[RequestOptions::ALLOW_REDIRECTS] = false; - $options[RequestOptions::HTTP_ERRORS] = false; - - return $this->sendAsync($request, $options)->wait(); - } - - /** - * Create and send an asynchronous HTTP request. - * - * Use an absolute path to override the base path of the client, or a - * relative path to append to the base path of the client. The URL can - * contain the query string as well. Use an array to provide a URL - * template and additional variables to use in the URL template expansion. - * - * @param string $method HTTP method - * @param string|UriInterface $uri URI object or string. - * @param array $options Request options to apply. See \GuzzleHttp\RequestOptions. - */ - public function requestAsync(string $method, $uri = '', array $options = []): PromiseInterface - { - $options = $this->prepareDefaults($options); - // Remove request modifying parameter because it can be done up-front. - $headers = $options['headers'] ?? []; - $body = $options['body'] ?? null; - $version = $options['version'] ?? '1.1'; - // Merge the URI into the base URI. - $uri = $this->buildUri(Psr7\Utils::uriFor($uri), $options); - if (\is_array($body)) { - throw $this->invalidBody(); - } - $request = new Psr7\Request($method, $uri, $headers, $body, $version); - // Remove the option so that they are not doubly-applied. - unset($options['headers'], $options['body'], $options['version']); - - return $this->transfer($request, $options); - } - - /** - * Create and send an HTTP request. - * - * Use an absolute path to override the base path of the client, or a - * relative path to append to the base path of the client. The URL can - * contain the query string as well. - * - * @param string $method HTTP method. - * @param string|UriInterface $uri URI object or string. - * @param array $options Request options to apply. See \GuzzleHttp\RequestOptions. - * - * @throws GuzzleException - */ - public function request(string $method, $uri = '', array $options = []): ResponseInterface - { - $options[RequestOptions::SYNCHRONOUS] = true; - return $this->requestAsync($method, $uri, $options)->wait(); - } - - /** - * Get a client configuration option. - * - * These options include default request options of the client, a "handler" - * (if utilized by the concrete client), and a "base_uri" if utilized by - * the concrete client. - * - * @param string|null $option The config option to retrieve. - * - * @return mixed - * - * @deprecated Client::getConfig will be removed in guzzlehttp/guzzle:8.0. - */ - public function getConfig(?string $option = null) - { - return $option === null - ? $this->config - : ($this->config[$option] ?? null); - } - - private function buildUri(UriInterface $uri, array $config): UriInterface - { - if (isset($config['base_uri'])) { - $uri = Psr7\UriResolver::resolve(Psr7\Utils::uriFor($config['base_uri']), $uri); - } - - if (isset($config['idn_conversion']) && ($config['idn_conversion'] !== false)) { - $idnOptions = ($config['idn_conversion'] === true) ? \IDNA_DEFAULT : $config['idn_conversion']; - $uri = Utils::idnUriConvert($uri, $idnOptions); - } - - return $uri->getScheme() === '' && $uri->getHost() !== '' ? $uri->withScheme('http') : $uri; - } - - /** - * Configures the default options for a client. - */ - private function configureDefaults(array $config): void - { - $defaults = [ - 'allow_redirects' => RedirectMiddleware::$defaultSettings, - 'http_errors' => true, - 'decode_content' => true, - 'verify' => true, - 'cookies' => false, - 'idn_conversion' => false, - ]; - - // Use the standard Linux HTTP_PROXY and HTTPS_PROXY if set. - - // We can only trust the HTTP_PROXY environment variable in a CLI - // process due to the fact that PHP has no reliable mechanism to - // get environment variables that start with "HTTP_". - if (\PHP_SAPI === 'cli' && ($proxy = Utils::getenv('HTTP_PROXY'))) { - $defaults['proxy']['http'] = $proxy; - } - - if ($proxy = Utils::getenv('HTTPS_PROXY')) { - $defaults['proxy']['https'] = $proxy; - } - - if ($noProxy = Utils::getenv('NO_PROXY')) { - $cleanedNoProxy = \str_replace(' ', '', $noProxy); - $defaults['proxy']['no'] = \explode(',', $cleanedNoProxy); - } - - $this->config = $config + $defaults; - - if (!empty($config['cookies']) && $config['cookies'] === true) { - $this->config['cookies'] = new CookieJar(); - } - - // Add the default user-agent header. - if (!isset($this->config['headers'])) { - $this->config['headers'] = ['User-Agent' => Utils::defaultUserAgent()]; - } else { - // Add the User-Agent header if one was not already set. - foreach (\array_keys($this->config['headers']) as $name) { - if (\strtolower($name) === 'user-agent') { - return; - } - } - $this->config['headers']['User-Agent'] = Utils::defaultUserAgent(); - } - } - - /** - * Merges default options into the array. - * - * @param array $options Options to modify by reference - */ - private function prepareDefaults(array $options): array - { - $defaults = $this->config; - - if (!empty($defaults['headers'])) { - // Default headers are only added if they are not present. - $defaults['_conditional'] = $defaults['headers']; - unset($defaults['headers']); - } - - // Special handling for headers is required as they are added as - // conditional headers and as headers passed to a request ctor. - if (\array_key_exists('headers', $options)) { - // Allows default headers to be unset. - if ($options['headers'] === null) { - $defaults['_conditional'] = []; - unset($options['headers']); - } elseif (!\is_array($options['headers'])) { - throw new InvalidArgumentException('headers must be an array'); - } - } - - // Shallow merge defaults underneath options. - $result = $options + $defaults; - - // Remove null values. - foreach ($result as $k => $v) { - if ($v === null) { - unset($result[$k]); - } - } - - return $result; - } - - /** - * Transfers the given request and applies request options. - * - * The URI of the request is not modified and the request options are used - * as-is without merging in default options. - * - * @param array $options See \GuzzleHttp\RequestOptions. - */ - private function transfer(RequestInterface $request, array $options): PromiseInterface - { - $request = $this->applyOptions($request, $options); - /** @var HandlerStack $handler */ - $handler = $options['handler']; - - try { - return P\Create::promiseFor($handler($request, $options)); - } catch (\Exception $e) { - return P\Create::rejectionFor($e); - } - } - - /** - * Applies the array of request options to a request. - */ - private function applyOptions(RequestInterface $request, array &$options): RequestInterface - { - $modify = [ - 'set_headers' => [], - ]; - - if (isset($options['headers'])) { - if (array_keys($options['headers']) === range(0, count($options['headers']) - 1)) { - throw new InvalidArgumentException('The headers array must have header name as keys.'); - } - $modify['set_headers'] = $options['headers']; - unset($options['headers']); - } - - if (isset($options['form_params'])) { - if (isset($options['multipart'])) { - throw new InvalidArgumentException('You cannot use ' - . 'form_params and multipart at the same time. Use the ' - . 'form_params option if you want to send application/' - . 'x-www-form-urlencoded requests, and the multipart ' - . 'option to send multipart/form-data requests.'); - } - $options['body'] = \http_build_query($options['form_params'], '', '&'); - unset($options['form_params']); - // Ensure that we don't have the header in different case and set the new value. - $options['_conditional'] = Psr7\Utils::caselessRemove(['Content-Type'], $options['_conditional']); - $options['_conditional']['Content-Type'] = 'application/x-www-form-urlencoded'; - } - - if (isset($options['multipart'])) { - $options['body'] = new Psr7\MultipartStream($options['multipart']); - unset($options['multipart']); - } - - if (isset($options['json'])) { - $options['body'] = Utils::jsonEncode($options['json']); - unset($options['json']); - // Ensure that we don't have the header in different case and set the new value. - $options['_conditional'] = Psr7\Utils::caselessRemove(['Content-Type'], $options['_conditional']); - $options['_conditional']['Content-Type'] = 'application/json'; - } - - if (!empty($options['decode_content']) - && $options['decode_content'] !== true - ) { - // Ensure that we don't have the header in different case and set the new value. - $options['_conditional'] = Psr7\Utils::caselessRemove(['Accept-Encoding'], $options['_conditional']); - $modify['set_headers']['Accept-Encoding'] = $options['decode_content']; - } - - if (isset($options['body'])) { - if (\is_array($options['body'])) { - throw $this->invalidBody(); - } - $modify['body'] = Psr7\Utils::streamFor($options['body']); - unset($options['body']); - } - - if (!empty($options['auth']) && \is_array($options['auth'])) { - $value = $options['auth']; - $type = isset($value[2]) ? \strtolower($value[2]) : 'basic'; - switch ($type) { - case 'basic': - // Ensure that we don't have the header in different case and set the new value. - $modify['set_headers'] = Psr7\Utils::caselessRemove(['Authorization'], $modify['set_headers']); - $modify['set_headers']['Authorization'] = 'Basic ' - . \base64_encode("$value[0]:$value[1]"); - break; - case 'digest': - // @todo: Do not rely on curl - $options['curl'][\CURLOPT_HTTPAUTH] = \CURLAUTH_DIGEST; - $options['curl'][\CURLOPT_USERPWD] = "$value[0]:$value[1]"; - break; - case 'ntlm': - $options['curl'][\CURLOPT_HTTPAUTH] = \CURLAUTH_NTLM; - $options['curl'][\CURLOPT_USERPWD] = "$value[0]:$value[1]"; - break; - } - } - - if (isset($options['query'])) { - $value = $options['query']; - if (\is_array($value)) { - $value = \http_build_query($value, '', '&', \PHP_QUERY_RFC3986); - } - if (!\is_string($value)) { - throw new InvalidArgumentException('query must be a string or array'); - } - $modify['query'] = $value; - unset($options['query']); - } - - // Ensure that sink is not an invalid value. - if (isset($options['sink'])) { - // TODO: Add more sink validation? - if (\is_bool($options['sink'])) { - throw new InvalidArgumentException('sink must not be a boolean'); - } - } - - $request = Psr7\Utils::modifyRequest($request, $modify); - if ($request->getBody() instanceof Psr7\MultipartStream) { - // Use a multipart/form-data POST if a Content-Type is not set. - // Ensure that we don't have the header in different case and set the new value. - $options['_conditional'] = Psr7\Utils::caselessRemove(['Content-Type'], $options['_conditional']); - $options['_conditional']['Content-Type'] = 'multipart/form-data; boundary=' - . $request->getBody()->getBoundary(); - } - - // Merge in conditional headers if they are not present. - if (isset($options['_conditional'])) { - // Build up the changes so it's in a single clone of the message. - $modify = []; - foreach ($options['_conditional'] as $k => $v) { - if (!$request->hasHeader($k)) { - $modify['set_headers'][$k] = $v; - } - } - $request = Psr7\Utils::modifyRequest($request, $modify); - // Don't pass this internal value along to middleware/handlers. - unset($options['_conditional']); - } - - return $request; - } - - /** - * Return an InvalidArgumentException with pre-set message. - */ - private function invalidBody(): InvalidArgumentException - { - return new InvalidArgumentException('Passing in the "body" request ' - . 'option as an array to send a request is not supported. ' - . 'Please use the "form_params" request option to send a ' - . 'application/x-www-form-urlencoded request, or the "multipart" ' - . 'request option to send a multipart/form-data request.'); - } -} diff --git a/vendor/guzzlehttp/guzzle/src/ClientInterface.php b/vendor/guzzlehttp/guzzle/src/ClientInterface.php deleted file mode 100644 index 6aaee61..0000000 --- a/vendor/guzzlehttp/guzzle/src/ClientInterface.php +++ /dev/null @@ -1,84 +0,0 @@ -request('GET', $uri, $options); - } - - /** - * Create and send an HTTP HEAD request. - * - * Use an absolute path to override the base path of the client, or a - * relative path to append to the base path of the client. The URL can - * contain the query string as well. - * - * @param string|UriInterface $uri URI object or string. - * @param array $options Request options to apply. - * - * @throws GuzzleException - */ - public function head($uri, array $options = []): ResponseInterface - { - return $this->request('HEAD', $uri, $options); - } - - /** - * Create and send an HTTP PUT request. - * - * Use an absolute path to override the base path of the client, or a - * relative path to append to the base path of the client. The URL can - * contain the query string as well. - * - * @param string|UriInterface $uri URI object or string. - * @param array $options Request options to apply. - * - * @throws GuzzleException - */ - public function put($uri, array $options = []): ResponseInterface - { - return $this->request('PUT', $uri, $options); - } - - /** - * Create and send an HTTP POST request. - * - * Use an absolute path to override the base path of the client, or a - * relative path to append to the base path of the client. The URL can - * contain the query string as well. - * - * @param string|UriInterface $uri URI object or string. - * @param array $options Request options to apply. - * - * @throws GuzzleException - */ - public function post($uri, array $options = []): ResponseInterface - { - return $this->request('POST', $uri, $options); - } - - /** - * Create and send an HTTP PATCH request. - * - * Use an absolute path to override the base path of the client, or a - * relative path to append to the base path of the client. The URL can - * contain the query string as well. - * - * @param string|UriInterface $uri URI object or string. - * @param array $options Request options to apply. - * - * @throws GuzzleException - */ - public function patch($uri, array $options = []): ResponseInterface - { - return $this->request('PATCH', $uri, $options); - } - - /** - * Create and send an HTTP DELETE request. - * - * Use an absolute path to override the base path of the client, or a - * relative path to append to the base path of the client. The URL can - * contain the query string as well. - * - * @param string|UriInterface $uri URI object or string. - * @param array $options Request options to apply. - * - * @throws GuzzleException - */ - public function delete($uri, array $options = []): ResponseInterface - { - return $this->request('DELETE', $uri, $options); - } - - /** - * Create and send an asynchronous HTTP request. - * - * Use an absolute path to override the base path of the client, or a - * relative path to append to the base path of the client. The URL can - * contain the query string as well. Use an array to provide a URL - * template and additional variables to use in the URL template expansion. - * - * @param string $method HTTP method - * @param string|UriInterface $uri URI object or string. - * @param array $options Request options to apply. - */ - abstract public function requestAsync(string $method, $uri, array $options = []): PromiseInterface; - - /** - * Create and send an asynchronous HTTP GET request. - * - * Use an absolute path to override the base path of the client, or a - * relative path to append to the base path of the client. The URL can - * contain the query string as well. Use an array to provide a URL - * template and additional variables to use in the URL template expansion. - * - * @param string|UriInterface $uri URI object or string. - * @param array $options Request options to apply. - */ - public function getAsync($uri, array $options = []): PromiseInterface - { - return $this->requestAsync('GET', $uri, $options); - } - - /** - * Create and send an asynchronous HTTP HEAD request. - * - * Use an absolute path to override the base path of the client, or a - * relative path to append to the base path of the client. The URL can - * contain the query string as well. Use an array to provide a URL - * template and additional variables to use in the URL template expansion. - * - * @param string|UriInterface $uri URI object or string. - * @param array $options Request options to apply. - */ - public function headAsync($uri, array $options = []): PromiseInterface - { - return $this->requestAsync('HEAD', $uri, $options); - } - - /** - * Create and send an asynchronous HTTP PUT request. - * - * Use an absolute path to override the base path of the client, or a - * relative path to append to the base path of the client. The URL can - * contain the query string as well. Use an array to provide a URL - * template and additional variables to use in the URL template expansion. - * - * @param string|UriInterface $uri URI object or string. - * @param array $options Request options to apply. - */ - public function putAsync($uri, array $options = []): PromiseInterface - { - return $this->requestAsync('PUT', $uri, $options); - } - - /** - * Create and send an asynchronous HTTP POST request. - * - * Use an absolute path to override the base path of the client, or a - * relative path to append to the base path of the client. The URL can - * contain the query string as well. Use an array to provide a URL - * template and additional variables to use in the URL template expansion. - * - * @param string|UriInterface $uri URI object or string. - * @param array $options Request options to apply. - */ - public function postAsync($uri, array $options = []): PromiseInterface - { - return $this->requestAsync('POST', $uri, $options); - } - - /** - * Create and send an asynchronous HTTP PATCH request. - * - * Use an absolute path to override the base path of the client, or a - * relative path to append to the base path of the client. The URL can - * contain the query string as well. Use an array to provide a URL - * template and additional variables to use in the URL template expansion. - * - * @param string|UriInterface $uri URI object or string. - * @param array $options Request options to apply. - */ - public function patchAsync($uri, array $options = []): PromiseInterface - { - return $this->requestAsync('PATCH', $uri, $options); - } - - /** - * Create and send an asynchronous HTTP DELETE request. - * - * Use an absolute path to override the base path of the client, or a - * relative path to append to the base path of the client. The URL can - * contain the query string as well. Use an array to provide a URL - * template and additional variables to use in the URL template expansion. - * - * @param string|UriInterface $uri URI object or string. - * @param array $options Request options to apply. - */ - public function deleteAsync($uri, array $options = []): PromiseInterface - { - return $this->requestAsync('DELETE', $uri, $options); - } -} diff --git a/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php b/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php deleted file mode 100644 index d6757c6..0000000 --- a/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php +++ /dev/null @@ -1,313 +0,0 @@ -strictMode = $strictMode; - - foreach ($cookieArray as $cookie) { - if (!($cookie instanceof SetCookie)) { - $cookie = new SetCookie($cookie); - } - $this->setCookie($cookie); - } - } - - /** - * Create a new Cookie jar from an associative array and domain. - * - * @param array $cookies Cookies to create the jar from - * @param string $domain Domain to set the cookies to - */ - public static function fromArray(array $cookies, string $domain): self - { - $cookieJar = new self(); - foreach ($cookies as $name => $value) { - $cookieJar->setCookie(new SetCookie([ - 'Domain' => $domain, - 'Name' => $name, - 'Value' => $value, - 'Discard' => true - ])); - } - - return $cookieJar; - } - - /** - * Evaluate if this cookie should be persisted to storage - * that survives between requests. - * - * @param SetCookie $cookie Being evaluated. - * @param bool $allowSessionCookies If we should persist session cookies - */ - public static function shouldPersist(SetCookie $cookie, bool $allowSessionCookies = false): bool - { - if ($cookie->getExpires() || $allowSessionCookies) { - if (!$cookie->getDiscard()) { - return true; - } - } - - return false; - } - - /** - * Finds and returns the cookie based on the name - * - * @param string $name cookie name to search for - * - * @return SetCookie|null cookie that was found or null if not found - */ - public function getCookieByName(string $name): ?SetCookie - { - foreach ($this->cookies as $cookie) { - if ($cookie->getName() !== null && \strcasecmp($cookie->getName(), $name) === 0) { - return $cookie; - } - } - - return null; - } - - /** - * @inheritDoc - */ - public function toArray(): array - { - return \array_map(static function (SetCookie $cookie): array { - return $cookie->toArray(); - }, $this->getIterator()->getArrayCopy()); - } - - /** - * @inheritDoc - */ - public function clear(?string $domain = null, ?string $path = null, ?string $name = null): void - { - if (!$domain) { - $this->cookies = []; - return; - } elseif (!$path) { - $this->cookies = \array_filter( - $this->cookies, - static function (SetCookie $cookie) use ($domain): bool { - return !$cookie->matchesDomain($domain); - } - ); - } elseif (!$name) { - $this->cookies = \array_filter( - $this->cookies, - static function (SetCookie $cookie) use ($path, $domain): bool { - return !($cookie->matchesPath($path) && - $cookie->matchesDomain($domain)); - } - ); - } else { - $this->cookies = \array_filter( - $this->cookies, - static function (SetCookie $cookie) use ($path, $domain, $name) { - return !($cookie->getName() == $name && - $cookie->matchesPath($path) && - $cookie->matchesDomain($domain)); - } - ); - } - } - - /** - * @inheritDoc - */ - public function clearSessionCookies(): void - { - $this->cookies = \array_filter( - $this->cookies, - static function (SetCookie $cookie): bool { - return !$cookie->getDiscard() && $cookie->getExpires(); - } - ); - } - - /** - * @inheritDoc - */ - public function setCookie(SetCookie $cookie): bool - { - // If the name string is empty (but not 0), ignore the set-cookie - // string entirely. - $name = $cookie->getName(); - if (!$name && $name !== '0') { - return false; - } - - // Only allow cookies with set and valid domain, name, value - $result = $cookie->validate(); - if ($result !== true) { - if ($this->strictMode) { - throw new \RuntimeException('Invalid cookie: ' . $result); - } - $this->removeCookieIfEmpty($cookie); - return false; - } - - // Resolve conflicts with previously set cookies - foreach ($this->cookies as $i => $c) { - - // Two cookies are identical, when their path, and domain are - // identical. - if ($c->getPath() != $cookie->getPath() || - $c->getDomain() != $cookie->getDomain() || - $c->getName() != $cookie->getName() - ) { - continue; - } - - // The previously set cookie is a discard cookie and this one is - // not so allow the new cookie to be set - if (!$cookie->getDiscard() && $c->getDiscard()) { - unset($this->cookies[$i]); - continue; - } - - // If the new cookie's expiration is further into the future, then - // replace the old cookie - if ($cookie->getExpires() > $c->getExpires()) { - unset($this->cookies[$i]); - continue; - } - - // If the value has changed, we better change it - if ($cookie->getValue() !== $c->getValue()) { - unset($this->cookies[$i]); - continue; - } - - // The cookie exists, so no need to continue - return false; - } - - $this->cookies[] = $cookie; - - return true; - } - - public function count(): int - { - return \count($this->cookies); - } - - /** - * @return \ArrayIterator - */ - public function getIterator(): \ArrayIterator - { - return new \ArrayIterator(\array_values($this->cookies)); - } - - public function extractCookies(RequestInterface $request, ResponseInterface $response): void - { - if ($cookieHeader = $response->getHeader('Set-Cookie')) { - foreach ($cookieHeader as $cookie) { - $sc = SetCookie::fromString($cookie); - if (!$sc->getDomain()) { - $sc->setDomain($request->getUri()->getHost()); - } - if (0 !== \strpos($sc->getPath(), '/')) { - $sc->setPath($this->getCookiePathFromRequest($request)); - } - $this->setCookie($sc); - } - } - } - - /** - * Computes cookie path following RFC 6265 section 5.1.4 - * - * @link https://tools.ietf.org/html/rfc6265#section-5.1.4 - */ - private function getCookiePathFromRequest(RequestInterface $request): string - { - $uriPath = $request->getUri()->getPath(); - if ('' === $uriPath) { - return '/'; - } - if (0 !== \strpos($uriPath, '/')) { - return '/'; - } - if ('/' === $uriPath) { - return '/'; - } - $lastSlashPos = \strrpos($uriPath, '/'); - if (0 === $lastSlashPos || false === $lastSlashPos) { - return '/'; - } - - return \substr($uriPath, 0, $lastSlashPos); - } - - public function withCookieHeader(RequestInterface $request): RequestInterface - { - $values = []; - $uri = $request->getUri(); - $scheme = $uri->getScheme(); - $host = $uri->getHost(); - $path = $uri->getPath() ?: '/'; - - foreach ($this->cookies as $cookie) { - if ($cookie->matchesPath($path) && - $cookie->matchesDomain($host) && - !$cookie->isExpired() && - (!$cookie->getSecure() || $scheme === 'https') - ) { - $values[] = $cookie->getName() . '=' - . $cookie->getValue(); - } - } - - return $values - ? $request->withHeader('Cookie', \implode('; ', $values)) - : $request; - } - - /** - * If a cookie already exists and the server asks to set it again with a - * null value, the cookie must be deleted. - */ - private function removeCookieIfEmpty(SetCookie $cookie): void - { - $cookieValue = $cookie->getValue(); - if ($cookieValue === null || $cookieValue === '') { - $this->clear( - $cookie->getDomain(), - $cookie->getPath(), - $cookie->getName() - ); - } - } -} diff --git a/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php b/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php deleted file mode 100644 index 7df374b..0000000 --- a/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php +++ /dev/null @@ -1,79 +0,0 @@ - - */ -interface CookieJarInterface extends \Countable, \IteratorAggregate -{ - /** - * Create a request with added cookie headers. - * - * If no matching cookies are found in the cookie jar, then no Cookie - * header is added to the request and the same request is returned. - * - * @param RequestInterface $request Request object to modify. - * - * @return RequestInterface returns the modified request. - */ - public function withCookieHeader(RequestInterface $request): RequestInterface; - - /** - * Extract cookies from an HTTP response and store them in the CookieJar. - * - * @param RequestInterface $request Request that was sent - * @param ResponseInterface $response Response that was received - */ - public function extractCookies(RequestInterface $request, ResponseInterface $response): void; - - /** - * Sets a cookie in the cookie jar. - * - * @param SetCookie $cookie Cookie to set. - * - * @return bool Returns true on success or false on failure - */ - public function setCookie(SetCookie $cookie): bool; - - /** - * Remove cookies currently held in the cookie jar. - * - * Invoking this method without arguments will empty the whole cookie jar. - * If given a $domain argument only cookies belonging to that domain will - * be removed. If given a $domain and $path argument, cookies belonging to - * the specified path within that domain are removed. If given all three - * arguments, then the cookie with the specified name, path and domain is - * removed. - * - * @param string|null $domain Clears cookies matching a domain - * @param string|null $path Clears cookies matching a domain and path - * @param string|null $name Clears cookies matching a domain, path, and name - */ - public function clear(?string $domain = null, ?string $path = null, ?string $name = null): void; - - /** - * Discard all sessions cookies. - * - * Removes cookies that don't have an expire field or a have a discard - * field set to true. To be called when the user agent shuts down according - * to RFC 2965. - */ - public function clearSessionCookies(): void; - - /** - * Converts the cookie jar to an array. - */ - public function toArray(): array; -} diff --git a/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php b/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php deleted file mode 100644 index 290236d..0000000 --- a/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php +++ /dev/null @@ -1,101 +0,0 @@ -filename = $cookieFile; - $this->storeSessionCookies = $storeSessionCookies; - - if (\file_exists($cookieFile)) { - $this->load($cookieFile); - } - } - - /** - * Saves the file when shutting down - */ - public function __destruct() - { - $this->save($this->filename); - } - - /** - * Saves the cookies to a file. - * - * @param string $filename File to save - * - * @throws \RuntimeException if the file cannot be found or created - */ - public function save(string $filename): void - { - $json = []; - /** @var SetCookie $cookie */ - foreach ($this as $cookie) { - if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) { - $json[] = $cookie->toArray(); - } - } - - $jsonStr = Utils::jsonEncode($json); - if (false === \file_put_contents($filename, $jsonStr, \LOCK_EX)) { - throw new \RuntimeException("Unable to save file {$filename}"); - } - } - - /** - * Load cookies from a JSON formatted file. - * - * Old cookies are kept unless overwritten by newly loaded ones. - * - * @param string $filename Cookie file to load. - * - * @throws \RuntimeException if the file cannot be loaded. - */ - public function load(string $filename): void - { - $json = \file_get_contents($filename); - if (false === $json) { - throw new \RuntimeException("Unable to load file {$filename}"); - } - if ($json === '') { - return; - } - - $data = Utils::jsonDecode($json, true); - if (\is_array($data)) { - foreach ($data as $cookie) { - $this->setCookie(new SetCookie($cookie)); - } - } elseif (\is_scalar($data) && !empty($data)) { - throw new \RuntimeException("Invalid cookie file: {$filename}"); - } - } -} diff --git a/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php b/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php deleted file mode 100644 index 5d51ca9..0000000 --- a/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php +++ /dev/null @@ -1,77 +0,0 @@ -sessionKey = $sessionKey; - $this->storeSessionCookies = $storeSessionCookies; - $this->load(); - } - - /** - * Saves cookies to session when shutting down - */ - public function __destruct() - { - $this->save(); - } - - /** - * Save cookies to the client session - */ - public function save(): void - { - $json = []; - /** @var SetCookie $cookie */ - foreach ($this as $cookie) { - if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) { - $json[] = $cookie->toArray(); - } - } - - $_SESSION[$this->sessionKey] = \json_encode($json); - } - - /** - * Load the contents of the client session into the data array - */ - protected function load(): void - { - if (!isset($_SESSION[$this->sessionKey])) { - return; - } - $data = \json_decode($_SESSION[$this->sessionKey], true); - if (\is_array($data)) { - foreach ($data as $cookie) { - $this->setCookie(new SetCookie($cookie)); - } - } elseif (\strlen($data)) { - throw new \RuntimeException("Invalid cookie data"); - } - } -} diff --git a/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php b/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php deleted file mode 100644 index 7c04034..0000000 --- a/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php +++ /dev/null @@ -1,444 +0,0 @@ - null, - 'Value' => null, - 'Domain' => null, - 'Path' => '/', - 'Max-Age' => null, - 'Expires' => null, - 'Secure' => false, - 'Discard' => false, - 'HttpOnly' => false - ]; - - /** - * @var array Cookie data - */ - private $data; - - /** - * Create a new SetCookie object from a string. - * - * @param string $cookie Set-Cookie header string - */ - public static function fromString(string $cookie): self - { - // Create the default return array - $data = self::$defaults; - // Explode the cookie string using a series of semicolons - $pieces = \array_filter(\array_map('trim', \explode(';', $cookie))); - // The name of the cookie (first kvp) must exist and include an equal sign. - if (!isset($pieces[0]) || \strpos($pieces[0], '=') === false) { - return new self($data); - } - - // Add the cookie pieces into the parsed data array - foreach ($pieces as $part) { - $cookieParts = \explode('=', $part, 2); - $key = \trim($cookieParts[0]); - $value = isset($cookieParts[1]) - ? \trim($cookieParts[1], " \n\r\t\0\x0B") - : true; - - // Only check for non-cookies when cookies have been found - if (!isset($data['Name'])) { - $data['Name'] = $key; - $data['Value'] = $value; - } else { - foreach (\array_keys(self::$defaults) as $search) { - if (!\strcasecmp($search, $key)) { - $data[$search] = $value; - continue 2; - } - } - $data[$key] = $value; - } - } - - return new self($data); - } - - /** - * @param array $data Array of cookie data provided by a Cookie parser - */ - public function __construct(array $data = []) - { - /** @var array|null $replaced will be null in case of replace error */ - $replaced = \array_replace(self::$defaults, $data); - if ($replaced === null) { - throw new \InvalidArgumentException('Unable to replace the default values for the Cookie.'); - } - - $this->data = $replaced; - // Extract the Expires value and turn it into a UNIX timestamp if needed - if (!$this->getExpires() && $this->getMaxAge()) { - // Calculate the Expires date - $this->setExpires(\time() + $this->getMaxAge()); - } elseif (null !== ($expires = $this->getExpires()) && !\is_numeric($expires)) { - $this->setExpires($expires); - } - } - - public function __toString() - { - $str = $this->data['Name'] . '=' . ($this->data['Value'] ?? '') . '; '; - foreach ($this->data as $k => $v) { - if ($k !== 'Name' && $k !== 'Value' && $v !== null && $v !== false) { - if ($k === 'Expires') { - $str .= 'Expires=' . \gmdate('D, d M Y H:i:s \G\M\T', $v) . '; '; - } else { - $str .= ($v === true ? $k : "{$k}={$v}") . '; '; - } - } - } - - return \rtrim($str, '; '); - } - - public function toArray(): array - { - return $this->data; - } - - /** - * Get the cookie name. - * - * @return string - */ - public function getName() - { - return $this->data['Name']; - } - - /** - * Set the cookie name. - * - * @param string $name Cookie name - */ - public function setName($name): void - { - if (!is_string($name)) { - trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a string to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__); - } - - $this->data['Name'] = (string) $name; - } - - /** - * Get the cookie value. - * - * @return string|null - */ - public function getValue() - { - return $this->data['Value']; - } - - /** - * Set the cookie value. - * - * @param string $value Cookie value - */ - public function setValue($value): void - { - if (!is_string($value)) { - trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a string to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__); - } - - $this->data['Value'] = (string) $value; - } - - /** - * Get the domain. - * - * @return string|null - */ - public function getDomain() - { - return $this->data['Domain']; - } - - /** - * Set the domain of the cookie. - * - * @param string|null $domain - */ - public function setDomain($domain): void - { - if (!is_string($domain) && null !== $domain) { - trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a string or null to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__); - } - - $this->data['Domain'] = null === $domain ? null : (string) $domain; - } - - /** - * Get the path. - * - * @return string - */ - public function getPath() - { - return $this->data['Path']; - } - - /** - * Set the path of the cookie. - * - * @param string $path Path of the cookie - */ - public function setPath($path): void - { - if (!is_string($path)) { - trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a string to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__); - } - - $this->data['Path'] = (string) $path; - } - - /** - * Maximum lifetime of the cookie in seconds. - * - * @return int|null - */ - public function getMaxAge() - { - return null === $this->data['Max-Age'] ? null : (int) $this->data['Max-Age']; - } - - /** - * Set the max-age of the cookie. - * - * @param int|null $maxAge Max age of the cookie in seconds - */ - public function setMaxAge($maxAge): void - { - if (!is_int($maxAge) && null !== $maxAge) { - trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing an int or null to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__); - } - - $this->data['Max-Age'] = $maxAge === null ? null : (int) $maxAge; - } - - /** - * The UNIX timestamp when the cookie Expires. - * - * @return string|int|null - */ - public function getExpires() - { - return $this->data['Expires']; - } - - /** - * Set the unix timestamp for which the cookie will expire. - * - * @param int|string|null $timestamp Unix timestamp or any English textual datetime description. - */ - public function setExpires($timestamp): void - { - if (!is_int($timestamp) && !is_string($timestamp) && null !== $timestamp) { - trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing an int, string or null to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__); - } - - $this->data['Expires'] = null === $timestamp ? null : (\is_numeric($timestamp) ? (int) $timestamp : \strtotime((string) $timestamp)); - } - - /** - * Get whether or not this is a secure cookie. - * - * @return bool - */ - public function getSecure() - { - return $this->data['Secure']; - } - - /** - * Set whether or not the cookie is secure. - * - * @param bool $secure Set to true or false if secure - */ - public function setSecure($secure): void - { - if (!is_bool($secure)) { - trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a bool to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__); - } - - $this->data['Secure'] = (bool) $secure; - } - - /** - * Get whether or not this is a session cookie. - * - * @return bool|null - */ - public function getDiscard() - { - return $this->data['Discard']; - } - - /** - * Set whether or not this is a session cookie. - * - * @param bool $discard Set to true or false if this is a session cookie - */ - public function setDiscard($discard): void - { - if (!is_bool($discard)) { - trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a bool to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__); - } - - $this->data['Discard'] = (bool) $discard; - } - - /** - * Get whether or not this is an HTTP only cookie. - * - * @return bool - */ - public function getHttpOnly() - { - return $this->data['HttpOnly']; - } - - /** - * Set whether or not this is an HTTP only cookie. - * - * @param bool $httpOnly Set to true or false if this is HTTP only - */ - public function setHttpOnly($httpOnly): void - { - if (!is_bool($httpOnly)) { - trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a bool to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__); - } - - $this->data['HttpOnly'] = (bool) $httpOnly; - } - - /** - * Check if the cookie matches a path value. - * - * A request-path path-matches a given cookie-path if at least one of - * the following conditions holds: - * - * - The cookie-path and the request-path are identical. - * - The cookie-path is a prefix of the request-path, and the last - * character of the cookie-path is %x2F ("/"). - * - The cookie-path is a prefix of the request-path, and the first - * character of the request-path that is not included in the cookie- - * path is a %x2F ("/") character. - * - * @param string $requestPath Path to check against - */ - public function matchesPath(string $requestPath): bool - { - $cookiePath = $this->getPath(); - - // Match on exact matches or when path is the default empty "/" - if ($cookiePath === '/' || $cookiePath == $requestPath) { - return true; - } - - // Ensure that the cookie-path is a prefix of the request path. - if (0 !== \strpos($requestPath, $cookiePath)) { - return false; - } - - // Match if the last character of the cookie-path is "/" - if (\substr($cookiePath, -1, 1) === '/') { - return true; - } - - // Match if the first character not included in cookie path is "/" - return \substr($requestPath, \strlen($cookiePath), 1) === '/'; - } - - /** - * Check if the cookie matches a domain value. - * - * @param string $domain Domain to check against - */ - public function matchesDomain(string $domain): bool - { - $cookieDomain = $this->getDomain(); - if (null === $cookieDomain) { - return true; - } - - // Remove the leading '.' as per spec in RFC 6265. - // https://tools.ietf.org/html/rfc6265#section-5.2.3 - $cookieDomain = \ltrim($cookieDomain, '.'); - - // Domain not set or exact match. - if (!$cookieDomain || !\strcasecmp($domain, $cookieDomain)) { - return true; - } - - // Matching the subdomain according to RFC 6265. - // https://tools.ietf.org/html/rfc6265#section-5.1.3 - if (\filter_var($domain, \FILTER_VALIDATE_IP)) { - return false; - } - - return (bool) \preg_match('/\.' . \preg_quote($cookieDomain, '/') . '$/', $domain); - } - - /** - * Check if the cookie is expired. - */ - public function isExpired(): bool - { - return $this->getExpires() !== null && \time() > $this->getExpires(); - } - - /** - * Check if the cookie is valid according to RFC 6265. - * - * @return bool|string Returns true if valid or an error message if invalid - */ - public function validate() - { - $name = $this->getName(); - if ($name === '') { - return 'The cookie name must not be empty'; - } - - // Check if any of the invalid characters are present in the cookie name - if (\preg_match( - '/[\x00-\x20\x22\x28-\x29\x2c\x2f\x3a-\x40\x5c\x7b\x7d\x7f]/', - $name - )) { - return 'Cookie name must not contain invalid characters: ASCII ' - . 'Control characters (0-31;127), space, tab and the ' - . 'following characters: ()<>@,;:\"/?={}'; - } - - // Value must not be null. 0 and empty string are valid. Empty strings - // are technically against RFC 6265, but known to happen in the wild. - $value = $this->getValue(); - if ($value === null) { - return 'The cookie value must not be empty'; - } - - // Domains must not be empty, but can be 0. "0" is not a valid internet - // domain, but may be used as server name in a private network. - $domain = $this->getDomain(); - if ($domain === null || $domain === '') { - return 'The cookie domain must not be empty'; - } - - return true; - } -} diff --git a/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php b/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php deleted file mode 100644 index a80956c..0000000 --- a/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php +++ /dev/null @@ -1,39 +0,0 @@ -request = $request; - $this->handlerContext = $handlerContext; - } - - /** - * Get the request that caused the exception - */ - public function getRequest(): RequestInterface - { - return $this->request; - } - - /** - * Get contextual information about the error from the underlying handler. - * - * The contents of this array will vary depending on which handler you are - * using. It may also be just an empty array. Relying on this data will - * couple you to a specific handler, but can give more debug information - * when needed. - */ - public function getHandlerContext(): array - { - return $this->handlerContext; - } -} diff --git a/vendor/guzzlehttp/guzzle/src/Exception/GuzzleException.php b/vendor/guzzlehttp/guzzle/src/Exception/GuzzleException.php deleted file mode 100644 index fa3ed69..0000000 --- a/vendor/guzzlehttp/guzzle/src/Exception/GuzzleException.php +++ /dev/null @@ -1,9 +0,0 @@ -getStatusCode() : 0; - parent::__construct($message, $code, $previous); - $this->request = $request; - $this->response = $response; - $this->handlerContext = $handlerContext; - } - - /** - * Wrap non-RequestExceptions with a RequestException - */ - public static function wrapException(RequestInterface $request, \Throwable $e): RequestException - { - return $e instanceof RequestException ? $e : new RequestException($e->getMessage(), $request, null, $e); - } - - /** - * Factory method to create a new exception with a normalized error message - * - * @param RequestInterface $request Request sent - * @param ResponseInterface $response Response received - * @param \Throwable|null $previous Previous exception - * @param array $handlerContext Optional handler context - * @param BodySummarizerInterface|null $bodySummarizer Optional body summarizer - */ - public static function create( - RequestInterface $request, - ResponseInterface $response = null, - \Throwable $previous = null, - array $handlerContext = [], - BodySummarizerInterface $bodySummarizer = null - ): self { - if (!$response) { - return new self( - 'Error completing request', - $request, - null, - $previous, - $handlerContext - ); - } - - $level = (int) \floor($response->getStatusCode() / 100); - if ($level === 4) { - $label = 'Client error'; - $className = ClientException::class; - } elseif ($level === 5) { - $label = 'Server error'; - $className = ServerException::class; - } else { - $label = 'Unsuccessful request'; - $className = __CLASS__; - } - - $uri = $request->getUri(); - $uri = static::obfuscateUri($uri); - - // Client Error: `GET /` resulted in a `404 Not Found` response: - // ... (truncated) - $message = \sprintf( - '%s: `%s %s` resulted in a `%s %s` response', - $label, - $request->getMethod(), - $uri->__toString(), - $response->getStatusCode(), - $response->getReasonPhrase() - ); - - $summary = ($bodySummarizer ?? new BodySummarizer())->summarize($response); - - if ($summary !== null) { - $message .= ":\n{$summary}\n"; - } - - return new $className($message, $request, $response, $previous, $handlerContext); - } - - /** - * Obfuscates URI if there is a username and a password present - */ - private static function obfuscateUri(UriInterface $uri): UriInterface - { - $userInfo = $uri->getUserInfo(); - - if (false !== ($pos = \strpos($userInfo, ':'))) { - return $uri->withUserInfo(\substr($userInfo, 0, $pos), '***'); - } - - return $uri; - } - - /** - * Get the request that caused the exception - */ - public function getRequest(): RequestInterface - { - return $this->request; - } - - /** - * Get the associated response - */ - public function getResponse(): ?ResponseInterface - { - return $this->response; - } - - /** - * Check if a response was received - */ - public function hasResponse(): bool - { - return $this->response !== null; - } - - /** - * Get contextual information about the error from the underlying handler. - * - * The contents of this array will vary depending on which handler you are - * using. It may also be just an empty array. Relying on this data will - * couple you to a specific handler, but can give more debug information - * when needed. - */ - public function getHandlerContext(): array - { - return $this->handlerContext; - } -} diff --git a/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php b/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php deleted file mode 100644 index 8055e06..0000000 --- a/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php +++ /dev/null @@ -1,10 +0,0 @@ -maxHandles = $maxHandles; - } - - public function create(RequestInterface $request, array $options): EasyHandle - { - if (isset($options['curl']['body_as_string'])) { - $options['_body_as_string'] = $options['curl']['body_as_string']; - unset($options['curl']['body_as_string']); - } - - $easy = new EasyHandle; - $easy->request = $request; - $easy->options = $options; - $conf = $this->getDefaultConf($easy); - $this->applyMethod($easy, $conf); - $this->applyHandlerOptions($easy, $conf); - $this->applyHeaders($easy, $conf); - unset($conf['_headers']); - - // Add handler options from the request configuration options - if (isset($options['curl'])) { - $conf = \array_replace($conf, $options['curl']); - } - - $conf[\CURLOPT_HEADERFUNCTION] = $this->createHeaderFn($easy); - $easy->handle = $this->handles ? \array_pop($this->handles) : \curl_init(); - curl_setopt_array($easy->handle, $conf); - - return $easy; - } - - public function release(EasyHandle $easy): void - { - $resource = $easy->handle; - unset($easy->handle); - - if (\count($this->handles) >= $this->maxHandles) { - \curl_close($resource); - } else { - // Remove all callback functions as they can hold onto references - // and are not cleaned up by curl_reset. Using curl_setopt_array - // does not work for some reason, so removing each one - // individually. - \curl_setopt($resource, \CURLOPT_HEADERFUNCTION, null); - \curl_setopt($resource, \CURLOPT_READFUNCTION, null); - \curl_setopt($resource, \CURLOPT_WRITEFUNCTION, null); - \curl_setopt($resource, \CURLOPT_PROGRESSFUNCTION, null); - \curl_reset($resource); - $this->handles[] = $resource; - } - } - - /** - * Completes a cURL transaction, either returning a response promise or a - * rejected promise. - * - * @param callable(RequestInterface, array): PromiseInterface $handler - * @param CurlFactoryInterface $factory Dictates how the handle is released - */ - public static function finish(callable $handler, EasyHandle $easy, CurlFactoryInterface $factory): PromiseInterface - { - if (isset($easy->options['on_stats'])) { - self::invokeStats($easy); - } - - if (!$easy->response || $easy->errno) { - return self::finishError($handler, $easy, $factory); - } - - // Return the response if it is present and there is no error. - $factory->release($easy); - - // Rewind the body of the response if possible. - $body = $easy->response->getBody(); - if ($body->isSeekable()) { - $body->rewind(); - } - - return new FulfilledPromise($easy->response); - } - - private static function invokeStats(EasyHandle $easy): void - { - $curlStats = \curl_getinfo($easy->handle); - $curlStats['appconnect_time'] = \curl_getinfo($easy->handle, \CURLINFO_APPCONNECT_TIME); - $stats = new TransferStats( - $easy->request, - $easy->response, - $curlStats['total_time'], - $easy->errno, - $curlStats - ); - ($easy->options['on_stats'])($stats); - } - - /** - * @param callable(RequestInterface, array): PromiseInterface $handler - */ - private static function finishError(callable $handler, EasyHandle $easy, CurlFactoryInterface $factory): PromiseInterface - { - // Get error information and release the handle to the factory. - $ctx = [ - 'errno' => $easy->errno, - 'error' => \curl_error($easy->handle), - 'appconnect_time' => \curl_getinfo($easy->handle, \CURLINFO_APPCONNECT_TIME), - ] + \curl_getinfo($easy->handle); - $ctx[self::CURL_VERSION_STR] = \curl_version()['version']; - $factory->release($easy); - - // Retry when nothing is present or when curl failed to rewind. - if (empty($easy->options['_err_message']) && (!$easy->errno || $easy->errno == 65)) { - return self::retryFailedRewind($handler, $easy, $ctx); - } - - return self::createRejection($easy, $ctx); - } - - private static function createRejection(EasyHandle $easy, array $ctx): PromiseInterface - { - static $connectionErrors = [ - \CURLE_OPERATION_TIMEOUTED => true, - \CURLE_COULDNT_RESOLVE_HOST => true, - \CURLE_COULDNT_CONNECT => true, - \CURLE_SSL_CONNECT_ERROR => true, - \CURLE_GOT_NOTHING => true, - ]; - - if ($easy->createResponseException) { - return P\Create::rejectionFor( - new RequestException( - 'An error was encountered while creating the response', - $easy->request, - $easy->response, - $easy->createResponseException, - $ctx - ) - ); - } - - // If an exception was encountered during the onHeaders event, then - // return a rejected promise that wraps that exception. - if ($easy->onHeadersException) { - return P\Create::rejectionFor( - new RequestException( - 'An error was encountered during the on_headers event', - $easy->request, - $easy->response, - $easy->onHeadersException, - $ctx - ) - ); - } - - $message = \sprintf( - 'cURL error %s: %s (%s)', - $ctx['errno'], - $ctx['error'], - 'see https://curl.haxx.se/libcurl/c/libcurl-errors.html' - ); - $uriString = (string) $easy->request->getUri(); - if ($uriString !== '' && false === \strpos($ctx['error'], $uriString)) { - $message .= \sprintf(' for %s', $uriString); - } - - // Create a connection exception if it was a specific error code. - $error = isset($connectionErrors[$easy->errno]) - ? new ConnectException($message, $easy->request, null, $ctx) - : new RequestException($message, $easy->request, $easy->response, null, $ctx); - - return P\Create::rejectionFor($error); - } - - /** - * @return array - */ - private function getDefaultConf(EasyHandle $easy): array - { - $conf = [ - '_headers' => $easy->request->getHeaders(), - \CURLOPT_CUSTOMREQUEST => $easy->request->getMethod(), - \CURLOPT_URL => (string) $easy->request->getUri()->withFragment(''), - \CURLOPT_RETURNTRANSFER => false, - \CURLOPT_HEADER => false, - \CURLOPT_CONNECTTIMEOUT => 150, - ]; - - if (\defined('CURLOPT_PROTOCOLS')) { - $conf[\CURLOPT_PROTOCOLS] = \CURLPROTO_HTTP | \CURLPROTO_HTTPS; - } - - $version = $easy->request->getProtocolVersion(); - if ($version == 1.1) { - $conf[\CURLOPT_HTTP_VERSION] = \CURL_HTTP_VERSION_1_1; - } elseif ($version == 2.0) { - $conf[\CURLOPT_HTTP_VERSION] = \CURL_HTTP_VERSION_2_0; - } else { - $conf[\CURLOPT_HTTP_VERSION] = \CURL_HTTP_VERSION_1_0; - } - - return $conf; - } - - private function applyMethod(EasyHandle $easy, array &$conf): void - { - $body = $easy->request->getBody(); - $size = $body->getSize(); - - if ($size === null || $size > 0) { - $this->applyBody($easy->request, $easy->options, $conf); - return; - } - - $method = $easy->request->getMethod(); - if ($method === 'PUT' || $method === 'POST') { - // See https://tools.ietf.org/html/rfc7230#section-3.3.2 - if (!$easy->request->hasHeader('Content-Length')) { - $conf[\CURLOPT_HTTPHEADER][] = 'Content-Length: 0'; - } - } elseif ($method === 'HEAD') { - $conf[\CURLOPT_NOBODY] = true; - unset( - $conf[\CURLOPT_WRITEFUNCTION], - $conf[\CURLOPT_READFUNCTION], - $conf[\CURLOPT_FILE], - $conf[\CURLOPT_INFILE] - ); - } - } - - private function applyBody(RequestInterface $request, array $options, array &$conf): void - { - $size = $request->hasHeader('Content-Length') - ? (int) $request->getHeaderLine('Content-Length') - : null; - - // Send the body as a string if the size is less than 1MB OR if the - // [curl][body_as_string] request value is set. - if (($size !== null && $size < 1000000) || !empty($options['_body_as_string'])) { - $conf[\CURLOPT_POSTFIELDS] = (string) $request->getBody(); - // Don't duplicate the Content-Length header - $this->removeHeader('Content-Length', $conf); - $this->removeHeader('Transfer-Encoding', $conf); - } else { - $conf[\CURLOPT_UPLOAD] = true; - if ($size !== null) { - $conf[\CURLOPT_INFILESIZE] = $size; - $this->removeHeader('Content-Length', $conf); - } - $body = $request->getBody(); - if ($body->isSeekable()) { - $body->rewind(); - } - $conf[\CURLOPT_READFUNCTION] = static function ($ch, $fd, $length) use ($body) { - return $body->read($length); - }; - } - - // If the Expect header is not present, prevent curl from adding it - if (!$request->hasHeader('Expect')) { - $conf[\CURLOPT_HTTPHEADER][] = 'Expect:'; - } - - // cURL sometimes adds a content-type by default. Prevent this. - if (!$request->hasHeader('Content-Type')) { - $conf[\CURLOPT_HTTPHEADER][] = 'Content-Type:'; - } - } - - private function applyHeaders(EasyHandle $easy, array &$conf): void - { - foreach ($conf['_headers'] as $name => $values) { - foreach ($values as $value) { - $value = (string) $value; - if ($value === '') { - // cURL requires a special format for empty headers. - // See https://github.com/guzzle/guzzle/issues/1882 for more details. - $conf[\CURLOPT_HTTPHEADER][] = "$name;"; - } else { - $conf[\CURLOPT_HTTPHEADER][] = "$name: $value"; - } - } - } - - // Remove the Accept header if one was not set - if (!$easy->request->hasHeader('Accept')) { - $conf[\CURLOPT_HTTPHEADER][] = 'Accept:'; - } - } - - /** - * Remove a header from the options array. - * - * @param string $name Case-insensitive header to remove - * @param array $options Array of options to modify - */ - private function removeHeader(string $name, array &$options): void - { - foreach (\array_keys($options['_headers']) as $key) { - if (!\strcasecmp($key, $name)) { - unset($options['_headers'][$key]); - return; - } - } - } - - private function applyHandlerOptions(EasyHandle $easy, array &$conf): void - { - $options = $easy->options; - if (isset($options['verify'])) { - if ($options['verify'] === false) { - unset($conf[\CURLOPT_CAINFO]); - $conf[\CURLOPT_SSL_VERIFYHOST] = 0; - $conf[\CURLOPT_SSL_VERIFYPEER] = false; - } else { - $conf[\CURLOPT_SSL_VERIFYHOST] = 2; - $conf[\CURLOPT_SSL_VERIFYPEER] = true; - if (\is_string($options['verify'])) { - // Throw an error if the file/folder/link path is not valid or doesn't exist. - if (!\file_exists($options['verify'])) { - throw new \InvalidArgumentException("SSL CA bundle not found: {$options['verify']}"); - } - // If it's a directory or a link to a directory use CURLOPT_CAPATH. - // If not, it's probably a file, or a link to a file, so use CURLOPT_CAINFO. - if ( - \is_dir($options['verify']) || - ( - \is_link($options['verify']) === true && - ($verifyLink = \readlink($options['verify'])) !== false && - \is_dir($verifyLink) - ) - ) { - $conf[\CURLOPT_CAPATH] = $options['verify']; - } else { - $conf[\CURLOPT_CAINFO] = $options['verify']; - } - } - } - } - - if (!isset($options['curl'][\CURLOPT_ENCODING]) && !empty($options['decode_content'])) { - $accept = $easy->request->getHeaderLine('Accept-Encoding'); - if ($accept) { - $conf[\CURLOPT_ENCODING] = $accept; - } else { - // The empty string enables all available decoders and implicitly - // sets a matching 'Accept-Encoding' header. - $conf[\CURLOPT_ENCODING] = ''; - // But as the user did not specify any acceptable encodings we need - // to overwrite this implicit header with an empty one. - $conf[\CURLOPT_HTTPHEADER][] = 'Accept-Encoding:'; - } - } - - if (!isset($options['sink'])) { - // Use a default temp stream if no sink was set. - $options['sink'] = \GuzzleHttp\Psr7\Utils::tryFopen('php://temp', 'w+'); - } - $sink = $options['sink']; - if (!\is_string($sink)) { - $sink = \GuzzleHttp\Psr7\Utils::streamFor($sink); - } elseif (!\is_dir(\dirname($sink))) { - // Ensure that the directory exists before failing in curl. - throw new \RuntimeException(\sprintf('Directory %s does not exist for sink value of %s', \dirname($sink), $sink)); - } else { - $sink = new LazyOpenStream($sink, 'w+'); - } - $easy->sink = $sink; - $conf[\CURLOPT_WRITEFUNCTION] = static function ($ch, $write) use ($sink): int { - return $sink->write($write); - }; - - $timeoutRequiresNoSignal = false; - if (isset($options['timeout'])) { - $timeoutRequiresNoSignal |= $options['timeout'] < 1; - $conf[\CURLOPT_TIMEOUT_MS] = $options['timeout'] * 1000; - } - - // CURL default value is CURL_IPRESOLVE_WHATEVER - if (isset($options['force_ip_resolve'])) { - if ('v4' === $options['force_ip_resolve']) { - $conf[\CURLOPT_IPRESOLVE] = \CURL_IPRESOLVE_V4; - } elseif ('v6' === $options['force_ip_resolve']) { - $conf[\CURLOPT_IPRESOLVE] = \CURL_IPRESOLVE_V6; - } - } - - if (isset($options['connect_timeout'])) { - $timeoutRequiresNoSignal |= $options['connect_timeout'] < 1; - $conf[\CURLOPT_CONNECTTIMEOUT_MS] = $options['connect_timeout'] * 1000; - } - - if ($timeoutRequiresNoSignal && \strtoupper(\substr(\PHP_OS, 0, 3)) !== 'WIN') { - $conf[\CURLOPT_NOSIGNAL] = true; - } - - if (isset($options['proxy'])) { - if (!\is_array($options['proxy'])) { - $conf[\CURLOPT_PROXY] = $options['proxy']; - } else { - $scheme = $easy->request->getUri()->getScheme(); - if (isset($options['proxy'][$scheme])) { - $host = $easy->request->getUri()->getHost(); - if (!isset($options['proxy']['no']) || !Utils::isHostInNoProxy($host, $options['proxy']['no'])) { - $conf[\CURLOPT_PROXY] = $options['proxy'][$scheme]; - } - } - } - } - - if (isset($options['cert'])) { - $cert = $options['cert']; - if (\is_array($cert)) { - $conf[\CURLOPT_SSLCERTPASSWD] = $cert[1]; - $cert = $cert[0]; - } - if (!\file_exists($cert)) { - throw new \InvalidArgumentException("SSL certificate not found: {$cert}"); - } - # OpenSSL (versions 0.9.3 and later) also support "P12" for PKCS#12-encoded files. - # see https://curl.se/libcurl/c/CURLOPT_SSLCERTTYPE.html - $ext = pathinfo($cert, \PATHINFO_EXTENSION); - if (preg_match('#^(der|p12)$#i', $ext)) { - $conf[\CURLOPT_SSLCERTTYPE] = strtoupper($ext); - } - $conf[\CURLOPT_SSLCERT] = $cert; - } - - if (isset($options['ssl_key'])) { - if (\is_array($options['ssl_key'])) { - if (\count($options['ssl_key']) === 2) { - [$sslKey, $conf[\CURLOPT_SSLKEYPASSWD]] = $options['ssl_key']; - } else { - [$sslKey] = $options['ssl_key']; - } - } - - $sslKey = $sslKey ?? $options['ssl_key']; - - if (!\file_exists($sslKey)) { - throw new \InvalidArgumentException("SSL private key not found: {$sslKey}"); - } - $conf[\CURLOPT_SSLKEY] = $sslKey; - } - - if (isset($options['progress'])) { - $progress = $options['progress']; - if (!\is_callable($progress)) { - throw new \InvalidArgumentException('progress client option must be callable'); - } - $conf[\CURLOPT_NOPROGRESS] = false; - $conf[\CURLOPT_PROGRESSFUNCTION] = static function ($resource, int $downloadSize, int $downloaded, int $uploadSize, int $uploaded) use ($progress) { - $progress($downloadSize, $downloaded, $uploadSize, $uploaded); - }; - } - - if (!empty($options['debug'])) { - $conf[\CURLOPT_STDERR] = Utils::debugResource($options['debug']); - $conf[\CURLOPT_VERBOSE] = true; - } - } - - /** - * This function ensures that a response was set on a transaction. If one - * was not set, then the request is retried if possible. This error - * typically means you are sending a payload, curl encountered a - * "Connection died, retrying a fresh connect" error, tried to rewind the - * stream, and then encountered a "necessary data rewind wasn't possible" - * error, causing the request to be sent through curl_multi_info_read() - * without an error status. - * - * @param callable(RequestInterface, array): PromiseInterface $handler - */ - private static function retryFailedRewind(callable $handler, EasyHandle $easy, array $ctx): PromiseInterface - { - try { - // Only rewind if the body has been read from. - $body = $easy->request->getBody(); - if ($body->tell() > 0) { - $body->rewind(); - } - } catch (\RuntimeException $e) { - $ctx['error'] = 'The connection unexpectedly failed without ' - . 'providing an error. The request would have been retried, ' - . 'but attempting to rewind the request body failed. ' - . 'Exception: ' . $e; - return self::createRejection($easy, $ctx); - } - - // Retry no more than 3 times before giving up. - if (!isset($easy->options['_curl_retries'])) { - $easy->options['_curl_retries'] = 1; - } elseif ($easy->options['_curl_retries'] == 2) { - $ctx['error'] = 'The cURL request was retried 3 times ' - . 'and did not succeed. The most likely reason for the failure ' - . 'is that cURL was unable to rewind the body of the request ' - . 'and subsequent retries resulted in the same error. Turn on ' - . 'the debug option to see what went wrong. See ' - . 'https://bugs.php.net/bug.php?id=47204 for more information.'; - return self::createRejection($easy, $ctx); - } else { - $easy->options['_curl_retries']++; - } - - return $handler($easy->request, $easy->options); - } - - private function createHeaderFn(EasyHandle $easy): callable - { - if (isset($easy->options['on_headers'])) { - $onHeaders = $easy->options['on_headers']; - - if (!\is_callable($onHeaders)) { - throw new \InvalidArgumentException('on_headers must be callable'); - } - } else { - $onHeaders = null; - } - - return static function ($ch, $h) use ( - $onHeaders, - $easy, - &$startingResponse - ) { - $value = \trim($h); - if ($value === '') { - $startingResponse = true; - try { - $easy->createResponse(); - } catch (\Exception $e) { - $easy->createResponseException = $e; - return -1; - } - if ($onHeaders !== null) { - try { - $onHeaders($easy->response); - } catch (\Exception $e) { - // Associate the exception with the handle and trigger - // a curl header write error by returning 0. - $easy->onHeadersException = $e; - return -1; - } - } - } elseif ($startingResponse) { - $startingResponse = false; - $easy->headers = [$value]; - } else { - $easy->headers[] = $value; - } - return \strlen($h); - }; - } -} diff --git a/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php b/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php deleted file mode 100644 index fe57ed5..0000000 --- a/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php +++ /dev/null @@ -1,25 +0,0 @@ -factory = $options['handle_factory'] - ?? new CurlFactory(3); - } - - public function __invoke(RequestInterface $request, array $options): PromiseInterface - { - if (isset($options['delay'])) { - \usleep($options['delay'] * 1000); - } - - $easy = $this->factory->create($request, $options); - \curl_exec($easy->handle); - $easy->errno = \curl_errno($easy->handle); - - return CurlFactory::finish($this, $easy, $this->factory); - } -} diff --git a/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php b/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php deleted file mode 100644 index 9e2e470..0000000 --- a/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php +++ /dev/null @@ -1,261 +0,0 @@ - An array of delay times, indexed by handle id in `addRequest`. - * - * @see CurlMultiHandler::addRequest - */ - private $delays = []; - - /** - * @var array An associative array of CURLMOPT_* options and corresponding values for curl_multi_setopt() - */ - private $options = []; - - /** - * This handler accepts the following options: - * - * - handle_factory: An optional factory used to create curl handles - * - select_timeout: Optional timeout (in seconds) to block before timing - * out while selecting curl handles. Defaults to 1 second. - * - options: An associative array of CURLMOPT_* options and - * corresponding values for curl_multi_setopt() - */ - public function __construct(array $options = []) - { - $this->factory = $options['handle_factory'] ?? new CurlFactory(50); - - if (isset($options['select_timeout'])) { - $this->selectTimeout = $options['select_timeout']; - } elseif ($selectTimeout = Utils::getenv('GUZZLE_CURL_SELECT_TIMEOUT')) { - @trigger_error('Since guzzlehttp/guzzle 7.2.0: Using environment variable GUZZLE_CURL_SELECT_TIMEOUT is deprecated. Use option "select_timeout" instead.', \E_USER_DEPRECATED); - $this->selectTimeout = (int) $selectTimeout; - } else { - $this->selectTimeout = 1; - } - - $this->options = $options['options'] ?? []; - } - - /** - * @param string $name - * - * @return resource|\CurlMultiHandle - * - * @throws \BadMethodCallException when another field as `_mh` will be gotten - * @throws \RuntimeException when curl can not initialize a multi handle - */ - public function __get($name) - { - if ($name !== '_mh') { - throw new \BadMethodCallException("Can not get other property as '_mh'."); - } - - $multiHandle = \curl_multi_init(); - - if (false === $multiHandle) { - throw new \RuntimeException('Can not initialize curl multi handle.'); - } - - $this->_mh = $multiHandle; - - foreach ($this->options as $option => $value) { - // A warning is raised in case of a wrong option. - curl_multi_setopt($this->_mh, $option, $value); - } - - return $this->_mh; - } - - public function __destruct() - { - if (isset($this->_mh)) { - \curl_multi_close($this->_mh); - unset($this->_mh); - } - } - - public function __invoke(RequestInterface $request, array $options): PromiseInterface - { - $easy = $this->factory->create($request, $options); - $id = (int) $easy->handle; - - $promise = new Promise( - [$this, 'execute'], - function () use ($id) { - return $this->cancel($id); - } - ); - - $this->addRequest(['easy' => $easy, 'deferred' => $promise]); - - return $promise; - } - - /** - * Ticks the curl event loop. - */ - public function tick(): void - { - // Add any delayed handles if needed. - if ($this->delays) { - $currentTime = Utils::currentTime(); - foreach ($this->delays as $id => $delay) { - if ($currentTime >= $delay) { - unset($this->delays[$id]); - \curl_multi_add_handle( - $this->_mh, - $this->handles[$id]['easy']->handle - ); - } - } - } - - // Step through the task queue which may add additional requests. - P\Utils::queue()->run(); - - if ($this->active && \curl_multi_select($this->_mh, $this->selectTimeout) === -1) { - // Perform a usleep if a select returns -1. - // See: https://bugs.php.net/bug.php?id=61141 - \usleep(250); - } - - while (\curl_multi_exec($this->_mh, $this->active) === \CURLM_CALL_MULTI_PERFORM); - - $this->processMessages(); - } - - /** - * Runs until all outstanding connections have completed. - */ - public function execute(): void - { - $queue = P\Utils::queue(); - - while ($this->handles || !$queue->isEmpty()) { - // If there are no transfers, then sleep for the next delay - if (!$this->active && $this->delays) { - \usleep($this->timeToNext()); - } - $this->tick(); - } - } - - private function addRequest(array $entry): void - { - $easy = $entry['easy']; - $id = (int) $easy->handle; - $this->handles[$id] = $entry; - if (empty($easy->options['delay'])) { - \curl_multi_add_handle($this->_mh, $easy->handle); - } else { - $this->delays[$id] = Utils::currentTime() + ($easy->options['delay'] / 1000); - } - } - - /** - * Cancels a handle from sending and removes references to it. - * - * @param int $id Handle ID to cancel and remove. - * - * @return bool True on success, false on failure. - */ - private function cancel($id): bool - { - if (!is_int($id)) { - trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing an integer to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__); - } - - // Cannot cancel if it has been processed. - if (!isset($this->handles[$id])) { - return false; - } - - $handle = $this->handles[$id]['easy']->handle; - unset($this->delays[$id], $this->handles[$id]); - \curl_multi_remove_handle($this->_mh, $handle); - \curl_close($handle); - - return true; - } - - private function processMessages(): void - { - while ($done = \curl_multi_info_read($this->_mh)) { - if ($done['msg'] !== \CURLMSG_DONE) { - // if it's not done, then it would be premature to remove the handle. ref https://github.com/guzzle/guzzle/pull/2892#issuecomment-945150216 - continue; - } - $id = (int) $done['handle']; - \curl_multi_remove_handle($this->_mh, $done['handle']); - - if (!isset($this->handles[$id])) { - // Probably was cancelled. - continue; - } - - $entry = $this->handles[$id]; - unset($this->handles[$id], $this->delays[$id]); - $entry['easy']->errno = $done['result']; - $entry['deferred']->resolve( - CurlFactory::finish($this, $entry['easy'], $this->factory) - ); - } - } - - private function timeToNext(): int - { - $currentTime = Utils::currentTime(); - $nextTime = \PHP_INT_MAX; - foreach ($this->delays as $time) { - if ($time < $nextTime) { - $nextTime = $time; - } - } - - return ((int) \max(0, $nextTime - $currentTime)) * 1000000; - } -} diff --git a/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php b/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php deleted file mode 100644 index 224344d..0000000 --- a/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php +++ /dev/null @@ -1,112 +0,0 @@ -headers); - - $normalizedKeys = Utils::normalizeHeaderKeys($headers); - - if (!empty($this->options['decode_content']) && isset($normalizedKeys['content-encoding'])) { - $headers['x-encoded-content-encoding'] = $headers[$normalizedKeys['content-encoding']]; - unset($headers[$normalizedKeys['content-encoding']]); - if (isset($normalizedKeys['content-length'])) { - $headers['x-encoded-content-length'] = $headers[$normalizedKeys['content-length']]; - - $bodyLength = (int) $this->sink->getSize(); - if ($bodyLength) { - $headers[$normalizedKeys['content-length']] = $bodyLength; - } else { - unset($headers[$normalizedKeys['content-length']]); - } - } - } - - // Attach a response to the easy handle with the parsed headers. - $this->response = new Response( - $status, - $headers, - $this->sink, - $ver, - $reason - ); - } - - /** - * @param string $name - * - * @return void - * - * @throws \BadMethodCallException - */ - public function __get($name) - { - $msg = $name === 'handle' ? 'The EasyHandle has been released' : 'Invalid property: ' . $name; - throw new \BadMethodCallException($msg); - } -} diff --git a/vendor/guzzlehttp/guzzle/src/Handler/HeaderProcessor.php b/vendor/guzzlehttp/guzzle/src/Handler/HeaderProcessor.php deleted file mode 100644 index a098884..0000000 --- a/vendor/guzzlehttp/guzzle/src/Handler/HeaderProcessor.php +++ /dev/null @@ -1,42 +0,0 @@ -|null $queue The parameters to be passed to the append function, as an indexed array. - * @param callable|null $onFulfilled Callback to invoke when the return value is fulfilled. - * @param callable|null $onRejected Callback to invoke when the return value is rejected. - */ - public function __construct(array $queue = null, callable $onFulfilled = null, callable $onRejected = null) - { - $this->onFulfilled = $onFulfilled; - $this->onRejected = $onRejected; - - if ($queue) { - // array_values included for BC - $this->append(...array_values($queue)); - } - } - - public function __invoke(RequestInterface $request, array $options): PromiseInterface - { - if (!$this->queue) { - throw new \OutOfBoundsException('Mock queue is empty'); - } - - if (isset($options['delay']) && \is_numeric($options['delay'])) { - \usleep((int) $options['delay'] * 1000); - } - - $this->lastRequest = $request; - $this->lastOptions = $options; - $response = \array_shift($this->queue); - - if (isset($options['on_headers'])) { - if (!\is_callable($options['on_headers'])) { - throw new \InvalidArgumentException('on_headers must be callable'); - } - try { - $options['on_headers']($response); - } catch (\Exception $e) { - $msg = 'An error was encountered during the on_headers event'; - $response = new RequestException($msg, $request, $response, $e); - } - } - - if (\is_callable($response)) { - $response = $response($request, $options); - } - - $response = $response instanceof \Throwable - ? P\Create::rejectionFor($response) - : P\Create::promiseFor($response); - - return $response->then( - function (?ResponseInterface $value) use ($request, $options) { - $this->invokeStats($request, $options, $value); - if ($this->onFulfilled) { - ($this->onFulfilled)($value); - } - - if ($value !== null && isset($options['sink'])) { - $contents = (string) $value->getBody(); - $sink = $options['sink']; - - if (\is_resource($sink)) { - \fwrite($sink, $contents); - } elseif (\is_string($sink)) { - \file_put_contents($sink, $contents); - } elseif ($sink instanceof StreamInterface) { - $sink->write($contents); - } - } - - return $value; - }, - function ($reason) use ($request, $options) { - $this->invokeStats($request, $options, null, $reason); - if ($this->onRejected) { - ($this->onRejected)($reason); - } - return P\Create::rejectionFor($reason); - } - ); - } - - /** - * Adds one or more variadic requests, exceptions, callables, or promises - * to the queue. - * - * @param mixed ...$values - */ - public function append(...$values): void - { - foreach ($values as $value) { - if ($value instanceof ResponseInterface - || $value instanceof \Throwable - || $value instanceof PromiseInterface - || \is_callable($value) - ) { - $this->queue[] = $value; - } else { - throw new \TypeError('Expected a Response, Promise, Throwable or callable. Found ' . Utils::describeType($value)); - } - } - } - - /** - * Get the last received request. - */ - public function getLastRequest(): ?RequestInterface - { - return $this->lastRequest; - } - - /** - * Get the last received request options. - */ - public function getLastOptions(): array - { - return $this->lastOptions; - } - - /** - * Returns the number of remaining items in the queue. - */ - public function count(): int - { - return \count($this->queue); - } - - public function reset(): void - { - $this->queue = []; - } - - /** - * @param mixed $reason Promise or reason. - */ - private function invokeStats( - RequestInterface $request, - array $options, - ResponseInterface $response = null, - $reason = null - ): void { - if (isset($options['on_stats'])) { - $transferTime = $options['transfer_time'] ?? 0; - $stats = new TransferStats($request, $response, $transferTime, $reason); - ($options['on_stats'])($stats); - } - } -} diff --git a/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php b/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php deleted file mode 100644 index f045b52..0000000 --- a/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php +++ /dev/null @@ -1,51 +0,0 @@ -withoutHeader('Expect'); - - // Append a content-length header if body size is zero to match - // cURL's behavior. - if (0 === $request->getBody()->getSize()) { - $request = $request->withHeader('Content-Length', '0'); - } - - return $this->createResponse( - $request, - $options, - $this->createStream($request, $options), - $startTime - ); - } catch (\InvalidArgumentException $e) { - throw $e; - } catch (\Exception $e) { - // Determine if the error was a networking error. - $message = $e->getMessage(); - // This list can probably get more comprehensive. - if (false !== \strpos($message, 'getaddrinfo') // DNS lookup failed - || false !== \strpos($message, 'Connection refused') - || false !== \strpos($message, "couldn't connect to host") // error on HHVM - || false !== \strpos($message, "connection attempt failed") - ) { - $e = new ConnectException($e->getMessage(), $request, $e); - } else { - $e = RequestException::wrapException($request, $e); - } - $this->invokeStats($options, $request, $startTime, null, $e); - - return P\Create::rejectionFor($e); - } - } - - private function invokeStats( - array $options, - RequestInterface $request, - ?float $startTime, - ResponseInterface $response = null, - \Throwable $error = null - ): void { - if (isset($options['on_stats'])) { - $stats = new TransferStats($request, $response, Utils::currentTime() - $startTime, $error, []); - ($options['on_stats'])($stats); - } - } - - /** - * @param resource $stream - */ - private function createResponse(RequestInterface $request, array $options, $stream, ?float $startTime): PromiseInterface - { - $hdrs = $this->lastHeaders; - $this->lastHeaders = []; - - try { - [$ver, $status, $reason, $headers] = HeaderProcessor::parseHeaders($hdrs); - } catch (\Exception $e) { - return P\Create::rejectionFor( - new RequestException('An error was encountered while creating the response', $request, null, $e) - ); - } - - [$stream, $headers] = $this->checkDecode($options, $headers, $stream); - $stream = Psr7\Utils::streamFor($stream); - $sink = $stream; - - if (\strcasecmp('HEAD', $request->getMethod())) { - $sink = $this->createSink($stream, $options); - } - - try { - $response = new Psr7\Response($status, $headers, $sink, $ver, $reason); - } catch (\Exception $e) { - return P\Create::rejectionFor( - new RequestException('An error was encountered while creating the response', $request, null, $e) - ); - } - - if (isset($options['on_headers'])) { - try { - $options['on_headers']($response); - } catch (\Exception $e) { - return P\Create::rejectionFor( - new RequestException('An error was encountered during the on_headers event', $request, $response, $e) - ); - } - } - - // Do not drain when the request is a HEAD request because they have - // no body. - if ($sink !== $stream) { - $this->drain($stream, $sink, $response->getHeaderLine('Content-Length')); - } - - $this->invokeStats($options, $request, $startTime, $response, null); - - return new FulfilledPromise($response); - } - - private function createSink(StreamInterface $stream, array $options): StreamInterface - { - if (!empty($options['stream'])) { - return $stream; - } - - $sink = $options['sink'] ?? Psr7\Utils::tryFopen('php://temp', 'r+'); - - return \is_string($sink) ? new Psr7\LazyOpenStream($sink, 'w+') : Psr7\Utils::streamFor($sink); - } - - /** - * @param resource $stream - */ - private function checkDecode(array $options, array $headers, $stream): array - { - // Automatically decode responses when instructed. - if (!empty($options['decode_content'])) { - $normalizedKeys = Utils::normalizeHeaderKeys($headers); - if (isset($normalizedKeys['content-encoding'])) { - $encoding = $headers[$normalizedKeys['content-encoding']]; - if ($encoding[0] === 'gzip' || $encoding[0] === 'deflate') { - $stream = new Psr7\InflateStream(Psr7\Utils::streamFor($stream)); - $headers['x-encoded-content-encoding'] = $headers[$normalizedKeys['content-encoding']]; - - // Remove content-encoding header - unset($headers[$normalizedKeys['content-encoding']]); - - // Fix content-length header - if (isset($normalizedKeys['content-length'])) { - $headers['x-encoded-content-length'] = $headers[$normalizedKeys['content-length']]; - $length = (int) $stream->getSize(); - if ($length === 0) { - unset($headers[$normalizedKeys['content-length']]); - } else { - $headers[$normalizedKeys['content-length']] = [$length]; - } - } - } - } - } - - return [$stream, $headers]; - } - - /** - * Drains the source stream into the "sink" client option. - * - * @param string $contentLength Header specifying the amount of - * data to read. - * - * @throws \RuntimeException when the sink option is invalid. - */ - private function drain(StreamInterface $source, StreamInterface $sink, string $contentLength): StreamInterface - { - // If a content-length header is provided, then stop reading once - // that number of bytes has been read. This can prevent infinitely - // reading from a stream when dealing with servers that do not honor - // Connection: Close headers. - Psr7\Utils::copyToStream( - $source, - $sink, - (\strlen($contentLength) > 0 && (int) $contentLength > 0) ? (int) $contentLength : -1 - ); - - $sink->seek(0); - $source->close(); - - return $sink; - } - - /** - * Create a resource and check to ensure it was created successfully - * - * @param callable $callback Callable that returns stream resource - * - * @return resource - * - * @throws \RuntimeException on error - */ - private function createResource(callable $callback) - { - $errors = []; - \set_error_handler(static function ($_, $msg, $file, $line) use (&$errors): bool { - $errors[] = [ - 'message' => $msg, - 'file' => $file, - 'line' => $line - ]; - return true; - }); - - try { - $resource = $callback(); - } finally { - \restore_error_handler(); - } - - if (!$resource) { - $message = 'Error creating resource: '; - foreach ($errors as $err) { - foreach ($err as $key => $value) { - $message .= "[$key] $value" . \PHP_EOL; - } - } - throw new \RuntimeException(\trim($message)); - } - - return $resource; - } - - /** - * @return resource - */ - private function createStream(RequestInterface $request, array $options) - { - static $methods; - if (!$methods) { - $methods = \array_flip(\get_class_methods(__CLASS__)); - } - - // HTTP/1.1 streams using the PHP stream wrapper require a - // Connection: close header - if ($request->getProtocolVersion() == '1.1' - && !$request->hasHeader('Connection') - ) { - $request = $request->withHeader('Connection', 'close'); - } - - // Ensure SSL is verified by default - if (!isset($options['verify'])) { - $options['verify'] = true; - } - - $params = []; - $context = $this->getDefaultContext($request); - - if (isset($options['on_headers']) && !\is_callable($options['on_headers'])) { - throw new \InvalidArgumentException('on_headers must be callable'); - } - - if (!empty($options)) { - foreach ($options as $key => $value) { - $method = "add_{$key}"; - if (isset($methods[$method])) { - $this->{$method}($request, $context, $value, $params); - } - } - } - - if (isset($options['stream_context'])) { - if (!\is_array($options['stream_context'])) { - throw new \InvalidArgumentException('stream_context must be an array'); - } - $context = \array_replace_recursive($context, $options['stream_context']); - } - - // Microsoft NTLM authentication only supported with curl handler - if (isset($options['auth'][2]) && 'ntlm' === $options['auth'][2]) { - throw new \InvalidArgumentException('Microsoft NTLM authentication only supported with curl handler'); - } - - $uri = $this->resolveHost($request, $options); - - $contextResource = $this->createResource( - static function () use ($context, $params) { - return \stream_context_create($context, $params); - } - ); - - return $this->createResource( - function () use ($uri, &$http_response_header, $contextResource, $context, $options, $request) { - $resource = @\fopen((string) $uri, 'r', false, $contextResource); - $this->lastHeaders = $http_response_header; - - if (false === $resource) { - throw new ConnectException(sprintf('Connection refused for URI %s', $uri), $request, null, $context); - } - - if (isset($options['read_timeout'])) { - $readTimeout = $options['read_timeout']; - $sec = (int) $readTimeout; - $usec = ($readTimeout - $sec) * 100000; - \stream_set_timeout($resource, $sec, $usec); - } - - return $resource; - } - ); - } - - private function resolveHost(RequestInterface $request, array $options): UriInterface - { - $uri = $request->getUri(); - - if (isset($options['force_ip_resolve']) && !\filter_var($uri->getHost(), \FILTER_VALIDATE_IP)) { - if ('v4' === $options['force_ip_resolve']) { - $records = \dns_get_record($uri->getHost(), \DNS_A); - if (false === $records || !isset($records[0]['ip'])) { - throw new ConnectException(\sprintf("Could not resolve IPv4 address for host '%s'", $uri->getHost()), $request); - } - return $uri->withHost($records[0]['ip']); - } - if ('v6' === $options['force_ip_resolve']) { - $records = \dns_get_record($uri->getHost(), \DNS_AAAA); - if (false === $records || !isset($records[0]['ipv6'])) { - throw new ConnectException(\sprintf("Could not resolve IPv6 address for host '%s'", $uri->getHost()), $request); - } - return $uri->withHost('[' . $records[0]['ipv6'] . ']'); - } - } - - return $uri; - } - - private function getDefaultContext(RequestInterface $request): array - { - $headers = ''; - foreach ($request->getHeaders() as $name => $value) { - foreach ($value as $val) { - $headers .= "$name: $val\r\n"; - } - } - - $context = [ - 'http' => [ - 'method' => $request->getMethod(), - 'header' => $headers, - 'protocol_version' => $request->getProtocolVersion(), - 'ignore_errors' => true, - 'follow_location' => 0, - ], - ]; - - $body = (string) $request->getBody(); - - if (!empty($body)) { - $context['http']['content'] = $body; - // Prevent the HTTP handler from adding a Content-Type header. - if (!$request->hasHeader('Content-Type')) { - $context['http']['header'] .= "Content-Type:\r\n"; - } - } - - $context['http']['header'] = \rtrim($context['http']['header']); - - return $context; - } - - /** - * @param mixed $value as passed via Request transfer options. - */ - private function add_proxy(RequestInterface $request, array &$options, $value, array &$params): void - { - $uri = null; - - if (!\is_array($value)) { - $uri = $value; - } else { - $scheme = $request->getUri()->getScheme(); - if (isset($value[$scheme])) { - if (!isset($value['no']) || !Utils::isHostInNoProxy($request->getUri()->getHost(), $value['no'])) { - $uri = $value[$scheme]; - } - } - } - - if (!$uri) { - return; - } - - $parsed = $this->parse_proxy($uri); - $options['http']['proxy'] = $parsed['proxy']; - - if ($parsed['auth']) { - if (!isset($options['http']['header'])) { - $options['http']['header'] = []; - } - $options['http']['header'] .= "\r\nProxy-Authorization: {$parsed['auth']}"; - } - } - - /** - * Parses the given proxy URL to make it compatible with the format PHP's stream context expects. - */ - private function parse_proxy(string $url): array - { - $parsed = \parse_url($url); - - if ($parsed !== false && isset($parsed['scheme']) && $parsed['scheme'] === 'http') { - if (isset($parsed['host']) && isset($parsed['port'])) { - $auth = null; - if (isset($parsed['user']) && isset($parsed['pass'])) { - $auth = \base64_encode("{$parsed['user']}:{$parsed['pass']}"); - } - - return [ - 'proxy' => "tcp://{$parsed['host']}:{$parsed['port']}", - 'auth' => $auth ? "Basic {$auth}" : null, - ]; - } - } - - // Return proxy as-is. - return [ - 'proxy' => $url, - 'auth' => null, - ]; - } - - /** - * @param mixed $value as passed via Request transfer options. - */ - private function add_timeout(RequestInterface $request, array &$options, $value, array &$params): void - { - if ($value > 0) { - $options['http']['timeout'] = $value; - } - } - - /** - * @param mixed $value as passed via Request transfer options. - */ - private function add_verify(RequestInterface $request, array &$options, $value, array &$params): void - { - if ($value === false) { - $options['ssl']['verify_peer'] = false; - $options['ssl']['verify_peer_name'] = false; - - return; - } - - if (\is_string($value)) { - $options['ssl']['cafile'] = $value; - if (!\file_exists($value)) { - throw new \RuntimeException("SSL CA bundle not found: $value"); - } - } elseif ($value !== true) { - throw new \InvalidArgumentException('Invalid verify request option'); - } - - $options['ssl']['verify_peer'] = true; - $options['ssl']['verify_peer_name'] = true; - $options['ssl']['allow_self_signed'] = false; - } - - /** - * @param mixed $value as passed via Request transfer options. - */ - private function add_cert(RequestInterface $request, array &$options, $value, array &$params): void - { - if (\is_array($value)) { - $options['ssl']['passphrase'] = $value[1]; - $value = $value[0]; - } - - if (!\file_exists($value)) { - throw new \RuntimeException("SSL certificate not found: {$value}"); - } - - $options['ssl']['local_cert'] = $value; - } - - /** - * @param mixed $value as passed via Request transfer options. - */ - private function add_progress(RequestInterface $request, array &$options, $value, array &$params): void - { - self::addNotification( - $params, - static function ($code, $a, $b, $c, $transferred, $total) use ($value) { - if ($code == \STREAM_NOTIFY_PROGRESS) { - // The upload progress cannot be determined. Use 0 for cURL compatibility: - // https://curl.se/libcurl/c/CURLOPT_PROGRESSFUNCTION.html - $value($total, $transferred, 0, 0); - } - } - ); - } - - /** - * @param mixed $value as passed via Request transfer options. - */ - private function add_debug(RequestInterface $request, array &$options, $value, array &$params): void - { - if ($value === false) { - return; - } - - static $map = [ - \STREAM_NOTIFY_CONNECT => 'CONNECT', - \STREAM_NOTIFY_AUTH_REQUIRED => 'AUTH_REQUIRED', - \STREAM_NOTIFY_AUTH_RESULT => 'AUTH_RESULT', - \STREAM_NOTIFY_MIME_TYPE_IS => 'MIME_TYPE_IS', - \STREAM_NOTIFY_FILE_SIZE_IS => 'FILE_SIZE_IS', - \STREAM_NOTIFY_REDIRECTED => 'REDIRECTED', - \STREAM_NOTIFY_PROGRESS => 'PROGRESS', - \STREAM_NOTIFY_FAILURE => 'FAILURE', - \STREAM_NOTIFY_COMPLETED => 'COMPLETED', - \STREAM_NOTIFY_RESOLVE => 'RESOLVE', - ]; - static $args = ['severity', 'message', 'message_code', 'bytes_transferred', 'bytes_max']; - - $value = Utils::debugResource($value); - $ident = $request->getMethod() . ' ' . $request->getUri()->withFragment(''); - self::addNotification( - $params, - static function (int $code, ...$passed) use ($ident, $value, $map, $args): void { - \fprintf($value, '<%s> [%s] ', $ident, $map[$code]); - foreach (\array_filter($passed) as $i => $v) { - \fwrite($value, $args[$i] . ': "' . $v . '" '); - } - \fwrite($value, "\n"); - } - ); - } - - private static function addNotification(array &$params, callable $notify): void - { - // Wrap the existing function if needed. - if (!isset($params['notification'])) { - $params['notification'] = $notify; - } else { - $params['notification'] = self::callArray([ - $params['notification'], - $notify - ]); - } - } - - private static function callArray(array $functions): callable - { - return static function (...$args) use ($functions) { - foreach ($functions as $fn) { - $fn(...$args); - } - }; - } -} diff --git a/vendor/guzzlehttp/guzzle/src/HandlerStack.php b/vendor/guzzlehttp/guzzle/src/HandlerStack.php deleted file mode 100644 index e0a1d11..0000000 --- a/vendor/guzzlehttp/guzzle/src/HandlerStack.php +++ /dev/null @@ -1,275 +0,0 @@ -push(Middleware::httpErrors(), 'http_errors'); - $stack->push(Middleware::redirect(), 'allow_redirects'); - $stack->push(Middleware::cookies(), 'cookies'); - $stack->push(Middleware::prepareBody(), 'prepare_body'); - - return $stack; - } - - /** - * @param (callable(RequestInterface, array): PromiseInterface)|null $handler Underlying HTTP handler. - */ - public function __construct(callable $handler = null) - { - $this->handler = $handler; - } - - /** - * Invokes the handler stack as a composed handler - * - * @return ResponseInterface|PromiseInterface - */ - public function __invoke(RequestInterface $request, array $options) - { - $handler = $this->resolve(); - - return $handler($request, $options); - } - - /** - * Dumps a string representation of the stack. - * - * @return string - */ - public function __toString() - { - $depth = 0; - $stack = []; - - if ($this->handler !== null) { - $stack[] = "0) Handler: " . $this->debugCallable($this->handler); - } - - $result = ''; - foreach (\array_reverse($this->stack) as $tuple) { - $depth++; - $str = "{$depth}) Name: '{$tuple[1]}', "; - $str .= "Function: " . $this->debugCallable($tuple[0]); - $result = "> {$str}\n{$result}"; - $stack[] = $str; - } - - foreach (\array_keys($stack) as $k) { - $result .= "< {$stack[$k]}\n"; - } - - return $result; - } - - /** - * Set the HTTP handler that actually returns a promise. - * - * @param callable(RequestInterface, array): PromiseInterface $handler Accepts a request and array of options and - * returns a Promise. - */ - public function setHandler(callable $handler): void - { - $this->handler = $handler; - $this->cached = null; - } - - /** - * Returns true if the builder has a handler. - */ - public function hasHandler(): bool - { - return $this->handler !== null ; - } - - /** - * Unshift a middleware to the bottom of the stack. - * - * @param callable(callable): callable $middleware Middleware function - * @param string $name Name to register for this middleware. - */ - public function unshift(callable $middleware, ?string $name = null): void - { - \array_unshift($this->stack, [$middleware, $name]); - $this->cached = null; - } - - /** - * Push a middleware to the top of the stack. - * - * @param callable(callable): callable $middleware Middleware function - * @param string $name Name to register for this middleware. - */ - public function push(callable $middleware, string $name = ''): void - { - $this->stack[] = [$middleware, $name]; - $this->cached = null; - } - - /** - * Add a middleware before another middleware by name. - * - * @param string $findName Middleware to find - * @param callable(callable): callable $middleware Middleware function - * @param string $withName Name to register for this middleware. - */ - public function before(string $findName, callable $middleware, string $withName = ''): void - { - $this->splice($findName, $withName, $middleware, true); - } - - /** - * Add a middleware after another middleware by name. - * - * @param string $findName Middleware to find - * @param callable(callable): callable $middleware Middleware function - * @param string $withName Name to register for this middleware. - */ - public function after(string $findName, callable $middleware, string $withName = ''): void - { - $this->splice($findName, $withName, $middleware, false); - } - - /** - * Remove a middleware by instance or name from the stack. - * - * @param callable|string $remove Middleware to remove by instance or name. - */ - public function remove($remove): void - { - if (!is_string($remove) && !is_callable($remove)) { - trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a callable or string to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__); - } - - $this->cached = null; - $idx = \is_callable($remove) ? 0 : 1; - $this->stack = \array_values(\array_filter( - $this->stack, - static function ($tuple) use ($idx, $remove) { - return $tuple[$idx] !== $remove; - } - )); - } - - /** - * Compose the middleware and handler into a single callable function. - * - * @return callable(RequestInterface, array): PromiseInterface - */ - public function resolve(): callable - { - if ($this->cached === null) { - if (($prev = $this->handler) === null) { - throw new \LogicException('No handler has been specified'); - } - - foreach (\array_reverse($this->stack) as $fn) { - /** @var callable(RequestInterface, array): PromiseInterface $prev */ - $prev = $fn[0]($prev); - } - - $this->cached = $prev; - } - - return $this->cached; - } - - private function findByName(string $name): int - { - foreach ($this->stack as $k => $v) { - if ($v[1] === $name) { - return $k; - } - } - - throw new \InvalidArgumentException("Middleware not found: $name"); - } - - /** - * Splices a function into the middleware list at a specific position. - */ - private function splice(string $findName, string $withName, callable $middleware, bool $before): void - { - $this->cached = null; - $idx = $this->findByName($findName); - $tuple = [$middleware, $withName]; - - if ($before) { - if ($idx === 0) { - \array_unshift($this->stack, $tuple); - } else { - $replacement = [$tuple, $this->stack[$idx]]; - \array_splice($this->stack, $idx, 1, $replacement); - } - } elseif ($idx === \count($this->stack) - 1) { - $this->stack[] = $tuple; - } else { - $replacement = [$this->stack[$idx], $tuple]; - \array_splice($this->stack, $idx, 1, $replacement); - } - } - - /** - * Provides a debug string for a given callable. - * - * @param callable|string $fn Function to write as a string. - */ - private function debugCallable($fn): string - { - if (\is_string($fn)) { - return "callable({$fn})"; - } - - if (\is_array($fn)) { - return \is_string($fn[0]) - ? "callable({$fn[0]}::{$fn[1]})" - : "callable(['" . \get_class($fn[0]) . "', '{$fn[1]}'])"; - } - - /** @var object $fn */ - return 'callable(' . \spl_object_hash($fn) . ')'; - } -} diff --git a/vendor/guzzlehttp/guzzle/src/MessageFormatter.php b/vendor/guzzlehttp/guzzle/src/MessageFormatter.php deleted file mode 100644 index da49954..0000000 --- a/vendor/guzzlehttp/guzzle/src/MessageFormatter.php +++ /dev/null @@ -1,198 +0,0 @@ ->>>>>>>\n{request}\n<<<<<<<<\n{response}\n--------\n{error}"; - public const SHORT = '[{ts}] "{method} {target} HTTP/{version}" {code}'; - - /** - * @var string Template used to format log messages - */ - private $template; - - /** - * @param string $template Log message template - */ - public function __construct(?string $template = self::CLF) - { - $this->template = $template ?: self::CLF; - } - - /** - * Returns a formatted message string. - * - * @param RequestInterface $request Request that was sent - * @param ResponseInterface|null $response Response that was received - * @param \Throwable|null $error Exception that was received - */ - public function format(RequestInterface $request, ?ResponseInterface $response = null, ?\Throwable $error = null): string - { - $cache = []; - - /** @var string */ - return \preg_replace_callback( - '/{\s*([A-Za-z_\-\.0-9]+)\s*}/', - function (array $matches) use ($request, $response, $error, &$cache) { - if (isset($cache[$matches[1]])) { - return $cache[$matches[1]]; - } - - $result = ''; - switch ($matches[1]) { - case 'request': - $result = Psr7\Message::toString($request); - break; - case 'response': - $result = $response ? Psr7\Message::toString($response) : ''; - break; - case 'req_headers': - $result = \trim($request->getMethod() - . ' ' . $request->getRequestTarget()) - . ' HTTP/' . $request->getProtocolVersion() . "\r\n" - . $this->headers($request); - break; - case 'res_headers': - $result = $response ? - \sprintf( - 'HTTP/%s %d %s', - $response->getProtocolVersion(), - $response->getStatusCode(), - $response->getReasonPhrase() - ) . "\r\n" . $this->headers($response) - : 'NULL'; - break; - case 'req_body': - $result = $request->getBody()->__toString(); - break; - case 'res_body': - if (!$response instanceof ResponseInterface) { - $result = 'NULL'; - break; - } - - $body = $response->getBody(); - - if (!$body->isSeekable()) { - $result = 'RESPONSE_NOT_LOGGEABLE'; - break; - } - - $result = $response->getBody()->__toString(); - break; - case 'ts': - case 'date_iso_8601': - $result = \gmdate('c'); - break; - case 'date_common_log': - $result = \date('d/M/Y:H:i:s O'); - break; - case 'method': - $result = $request->getMethod(); - break; - case 'version': - $result = $request->getProtocolVersion(); - break; - case 'uri': - case 'url': - $result = $request->getUri()->__toString(); - break; - case 'target': - $result = $request->getRequestTarget(); - break; - case 'req_version': - $result = $request->getProtocolVersion(); - break; - case 'res_version': - $result = $response - ? $response->getProtocolVersion() - : 'NULL'; - break; - case 'host': - $result = $request->getHeaderLine('Host'); - break; - case 'hostname': - $result = \gethostname(); - break; - case 'code': - $result = $response ? $response->getStatusCode() : 'NULL'; - break; - case 'phrase': - $result = $response ? $response->getReasonPhrase() : 'NULL'; - break; - case 'error': - $result = $error ? $error->getMessage() : 'NULL'; - break; - default: - // handle prefixed dynamic headers - if (\strpos($matches[1], 'req_header_') === 0) { - $result = $request->getHeaderLine(\substr($matches[1], 11)); - } elseif (\strpos($matches[1], 'res_header_') === 0) { - $result = $response - ? $response->getHeaderLine(\substr($matches[1], 11)) - : 'NULL'; - } - } - - $cache[$matches[1]] = $result; - return $result; - }, - $this->template - ); - } - - /** - * Get headers from message as string - */ - private function headers(MessageInterface $message): string - { - $result = ''; - foreach ($message->getHeaders() as $name => $values) { - $result .= $name . ': ' . \implode(', ', $values) . "\r\n"; - } - - return \trim($result); - } -} diff --git a/vendor/guzzlehttp/guzzle/src/MessageFormatterInterface.php b/vendor/guzzlehttp/guzzle/src/MessageFormatterInterface.php deleted file mode 100644 index a39ac24..0000000 --- a/vendor/guzzlehttp/guzzle/src/MessageFormatterInterface.php +++ /dev/null @@ -1,18 +0,0 @@ -withCookieHeader($request); - return $handler($request, $options) - ->then( - static function (ResponseInterface $response) use ($cookieJar, $request): ResponseInterface { - $cookieJar->extractCookies($request, $response); - return $response; - } - ); - }; - }; - } - - /** - * Middleware that throws exceptions for 4xx or 5xx responses when the - * "http_errors" request option is set to true. - * - * @param BodySummarizerInterface|null $bodySummarizer The body summarizer to use in exception messages. - * - * @return callable(callable): callable Returns a function that accepts the next handler. - */ - public static function httpErrors(BodySummarizerInterface $bodySummarizer = null): callable - { - return static function (callable $handler) use ($bodySummarizer): callable { - return static function ($request, array $options) use ($handler, $bodySummarizer) { - if (empty($options['http_errors'])) { - return $handler($request, $options); - } - return $handler($request, $options)->then( - static function (ResponseInterface $response) use ($request, $bodySummarizer) { - $code = $response->getStatusCode(); - if ($code < 400) { - return $response; - } - throw RequestException::create($request, $response, null, [], $bodySummarizer); - } - ); - }; - }; - } - - /** - * Middleware that pushes history data to an ArrayAccess container. - * - * @param array|\ArrayAccess $container Container to hold the history (by reference). - * - * @return callable(callable): callable Returns a function that accepts the next handler. - * - * @throws \InvalidArgumentException if container is not an array or ArrayAccess. - */ - public static function history(&$container): callable - { - if (!\is_array($container) && !$container instanceof \ArrayAccess) { - throw new \InvalidArgumentException('history container must be an array or object implementing ArrayAccess'); - } - - return static function (callable $handler) use (&$container): callable { - return static function (RequestInterface $request, array $options) use ($handler, &$container) { - return $handler($request, $options)->then( - static function ($value) use ($request, &$container, $options) { - $container[] = [ - 'request' => $request, - 'response' => $value, - 'error' => null, - 'options' => $options - ]; - return $value; - }, - static function ($reason) use ($request, &$container, $options) { - $container[] = [ - 'request' => $request, - 'response' => null, - 'error' => $reason, - 'options' => $options - ]; - return P\Create::rejectionFor($reason); - } - ); - }; - }; - } - - /** - * Middleware that invokes a callback before and after sending a request. - * - * The provided listener cannot modify or alter the response. It simply - * "taps" into the chain to be notified before returning the promise. The - * before listener accepts a request and options array, and the after - * listener accepts a request, options array, and response promise. - * - * @param callable $before Function to invoke before forwarding the request. - * @param callable $after Function invoked after forwarding. - * - * @return callable Returns a function that accepts the next handler. - */ - public static function tap(callable $before = null, callable $after = null): callable - { - return static function (callable $handler) use ($before, $after): callable { - return static function (RequestInterface $request, array $options) use ($handler, $before, $after) { - if ($before) { - $before($request, $options); - } - $response = $handler($request, $options); - if ($after) { - $after($request, $options, $response); - } - return $response; - }; - }; - } - - /** - * Middleware that handles request redirects. - * - * @return callable Returns a function that accepts the next handler. - */ - public static function redirect(): callable - { - return static function (callable $handler): RedirectMiddleware { - return new RedirectMiddleware($handler); - }; - } - - /** - * Middleware that retries requests based on the boolean result of - * invoking the provided "decider" function. - * - * If no delay function is provided, a simple implementation of exponential - * backoff will be utilized. - * - * @param callable $decider Function that accepts the number of retries, - * a request, [response], and [exception] and - * returns true if the request is to be retried. - * @param callable $delay Function that accepts the number of retries and - * returns the number of milliseconds to delay. - * - * @return callable Returns a function that accepts the next handler. - */ - public static function retry(callable $decider, callable $delay = null): callable - { - return static function (callable $handler) use ($decider, $delay): RetryMiddleware { - return new RetryMiddleware($decider, $handler, $delay); - }; - } - - /** - * Middleware that logs requests, responses, and errors using a message - * formatter. - * - * @phpstan-param \Psr\Log\LogLevel::* $logLevel Level at which to log requests. - * - * @param LoggerInterface $logger Logs messages. - * @param MessageFormatterInterface|MessageFormatter $formatter Formatter used to create message strings. - * @param string $logLevel Level at which to log requests. - * - * @return callable Returns a function that accepts the next handler. - */ - public static function log(LoggerInterface $logger, $formatter, string $logLevel = 'info'): callable - { - // To be compatible with Guzzle 7.1.x we need to allow users to pass a MessageFormatter - if (!$formatter instanceof MessageFormatter && !$formatter instanceof MessageFormatterInterface) { - throw new \LogicException(sprintf('Argument 2 to %s::log() must be of type %s', self::class, MessageFormatterInterface::class)); - } - - return static function (callable $handler) use ($logger, $formatter, $logLevel): callable { - return static function (RequestInterface $request, array $options = []) use ($handler, $logger, $formatter, $logLevel) { - return $handler($request, $options)->then( - static function ($response) use ($logger, $request, $formatter, $logLevel): ResponseInterface { - $message = $formatter->format($request, $response); - $logger->log($logLevel, $message); - return $response; - }, - static function ($reason) use ($logger, $request, $formatter): PromiseInterface { - $response = $reason instanceof RequestException ? $reason->getResponse() : null; - $message = $formatter->format($request, $response, P\Create::exceptionFor($reason)); - $logger->error($message); - return P\Create::rejectionFor($reason); - } - ); - }; - }; - } - - /** - * This middleware adds a default content-type if possible, a default - * content-length or transfer-encoding header, and the expect header. - */ - public static function prepareBody(): callable - { - return static function (callable $handler): PrepareBodyMiddleware { - return new PrepareBodyMiddleware($handler); - }; - } - - /** - * Middleware that applies a map function to the request before passing to - * the next handler. - * - * @param callable $fn Function that accepts a RequestInterface and returns - * a RequestInterface. - */ - public static function mapRequest(callable $fn): callable - { - return static function (callable $handler) use ($fn): callable { - return static function (RequestInterface $request, array $options) use ($handler, $fn) { - return $handler($fn($request), $options); - }; - }; - } - - /** - * Middleware that applies a map function to the resolved promise's - * response. - * - * @param callable $fn Function that accepts a ResponseInterface and - * returns a ResponseInterface. - */ - public static function mapResponse(callable $fn): callable - { - return static function (callable $handler) use ($fn): callable { - return static function (RequestInterface $request, array $options) use ($handler, $fn) { - return $handler($request, $options)->then($fn); - }; - }; - } -} diff --git a/vendor/guzzlehttp/guzzle/src/Pool.php b/vendor/guzzlehttp/guzzle/src/Pool.php deleted file mode 100644 index 6277c61..0000000 --- a/vendor/guzzlehttp/guzzle/src/Pool.php +++ /dev/null @@ -1,125 +0,0 @@ - $rfn) { - if ($rfn instanceof RequestInterface) { - yield $key => $client->sendAsync($rfn, $opts); - } elseif (\is_callable($rfn)) { - yield $key => $rfn($opts); - } else { - throw new \InvalidArgumentException('Each value yielded by the iterator must be a Psr7\Http\Message\RequestInterface or a callable that returns a promise that fulfills with a Psr7\Message\Http\ResponseInterface object.'); - } - } - }; - - $this->each = new EachPromise($requests(), $config); - } - - /** - * Get promise - */ - public function promise(): PromiseInterface - { - return $this->each->promise(); - } - - /** - * Sends multiple requests concurrently and returns an array of responses - * and exceptions that uses the same ordering as the provided requests. - * - * IMPORTANT: This method keeps every request and response in memory, and - * as such, is NOT recommended when sending a large number or an - * indeterminate number of requests concurrently. - * - * @param ClientInterface $client Client used to send the requests - * @param array|\Iterator $requests Requests to send concurrently. - * @param array $options Passes through the options available in - * {@see \GuzzleHttp\Pool::__construct} - * - * @return array Returns an array containing the response or an exception - * in the same order that the requests were sent. - * - * @throws \InvalidArgumentException if the event format is incorrect. - */ - public static function batch(ClientInterface $client, $requests, array $options = []): array - { - $res = []; - self::cmpCallback($options, 'fulfilled', $res); - self::cmpCallback($options, 'rejected', $res); - $pool = new static($client, $requests, $options); - $pool->promise()->wait(); - \ksort($res); - - return $res; - } - - /** - * Execute callback(s) - */ - private static function cmpCallback(array &$options, string $name, array &$results): void - { - if (!isset($options[$name])) { - $options[$name] = static function ($v, $k) use (&$results) { - $results[$k] = $v; - }; - } else { - $currentFn = $options[$name]; - $options[$name] = static function ($v, $k) use (&$results, $currentFn) { - $currentFn($v, $k); - $results[$k] = $v; - }; - } - } -} diff --git a/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php b/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php deleted file mode 100644 index 7ca6283..0000000 --- a/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php +++ /dev/null @@ -1,104 +0,0 @@ -nextHandler = $nextHandler; - } - - public function __invoke(RequestInterface $request, array $options): PromiseInterface - { - $fn = $this->nextHandler; - - // Don't do anything if the request has no body. - if ($request->getBody()->getSize() === 0) { - return $fn($request, $options); - } - - $modify = []; - - // Add a default content-type if possible. - if (!$request->hasHeader('Content-Type')) { - if ($uri = $request->getBody()->getMetadata('uri')) { - if (is_string($uri) && $type = Psr7\MimeType::fromFilename($uri)) { - $modify['set_headers']['Content-Type'] = $type; - } - } - } - - // Add a default content-length or transfer-encoding header. - if (!$request->hasHeader('Content-Length') - && !$request->hasHeader('Transfer-Encoding') - ) { - $size = $request->getBody()->getSize(); - if ($size !== null) { - $modify['set_headers']['Content-Length'] = $size; - } else { - $modify['set_headers']['Transfer-Encoding'] = 'chunked'; - } - } - - // Add the expect header if needed. - $this->addExpectHeader($request, $options, $modify); - - return $fn(Psr7\Utils::modifyRequest($request, $modify), $options); - } - - /** - * Add expect header - */ - private function addExpectHeader(RequestInterface $request, array $options, array &$modify): void - { - // Determine if the Expect header should be used - if ($request->hasHeader('Expect')) { - return; - } - - $expect = $options['expect'] ?? null; - - // Return if disabled or if you're not using HTTP/1.1 or HTTP/2.0 - if ($expect === false || $request->getProtocolVersion() < 1.1) { - return; - } - - // The expect header is unconditionally enabled - if ($expect === true) { - $modify['set_headers']['Expect'] = '100-Continue'; - return; - } - - // By default, send the expect header when the payload is > 1mb - if ($expect === null) { - $expect = 1048576; - } - - // Always add if the body cannot be rewound, the size cannot be - // determined, or the size is greater than the cutoff threshold - $body = $request->getBody(); - $size = $body->getSize(); - - if ($size === null || $size >= (int) $expect || !$body->isSeekable()) { - $modify['set_headers']['Expect'] = '100-Continue'; - } - } -} diff --git a/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php b/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php deleted file mode 100644 index 1dd3861..0000000 --- a/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php +++ /dev/null @@ -1,216 +0,0 @@ - 5, - 'protocols' => ['http', 'https'], - 'strict' => false, - 'referer' => false, - 'track_redirects' => false, - ]; - - /** - * @var callable(RequestInterface, array): PromiseInterface - */ - private $nextHandler; - - /** - * @param callable(RequestInterface, array): PromiseInterface $nextHandler Next handler to invoke. - */ - public function __construct(callable $nextHandler) - { - $this->nextHandler = $nextHandler; - } - - public function __invoke(RequestInterface $request, array $options): PromiseInterface - { - $fn = $this->nextHandler; - - if (empty($options['allow_redirects'])) { - return $fn($request, $options); - } - - if ($options['allow_redirects'] === true) { - $options['allow_redirects'] = self::$defaultSettings; - } elseif (!\is_array($options['allow_redirects'])) { - throw new \InvalidArgumentException('allow_redirects must be true, false, or array'); - } else { - // Merge the default settings with the provided settings - $options['allow_redirects'] += self::$defaultSettings; - } - - if (empty($options['allow_redirects']['max'])) { - return $fn($request, $options); - } - - return $fn($request, $options) - ->then(function (ResponseInterface $response) use ($request, $options) { - return $this->checkRedirect($request, $options, $response); - }); - } - - /** - * @return ResponseInterface|PromiseInterface - */ - public function checkRedirect(RequestInterface $request, array $options, ResponseInterface $response) - { - if (\strpos((string) $response->getStatusCode(), '3') !== 0 - || !$response->hasHeader('Location') - ) { - return $response; - } - - $this->guardMax($request, $response, $options); - $nextRequest = $this->modifyRequest($request, $options, $response); - - if (isset($options['allow_redirects']['on_redirect'])) { - ($options['allow_redirects']['on_redirect'])( - $request, - $response, - $nextRequest->getUri() - ); - } - - $promise = $this($nextRequest, $options); - - // Add headers to be able to track history of redirects. - if (!empty($options['allow_redirects']['track_redirects'])) { - return $this->withTracking( - $promise, - (string) $nextRequest->getUri(), - $response->getStatusCode() - ); - } - - return $promise; - } - - /** - * Enable tracking on promise. - */ - private function withTracking(PromiseInterface $promise, string $uri, int $statusCode): PromiseInterface - { - return $promise->then( - static function (ResponseInterface $response) use ($uri, $statusCode) { - // Note that we are pushing to the front of the list as this - // would be an earlier response than what is currently present - // in the history header. - $historyHeader = $response->getHeader(self::HISTORY_HEADER); - $statusHeader = $response->getHeader(self::STATUS_HISTORY_HEADER); - \array_unshift($historyHeader, $uri); - \array_unshift($statusHeader, (string) $statusCode); - - return $response->withHeader(self::HISTORY_HEADER, $historyHeader) - ->withHeader(self::STATUS_HISTORY_HEADER, $statusHeader); - } - ); - } - - /** - * Check for too many redirects - * - * @throws TooManyRedirectsException Too many redirects. - */ - private function guardMax(RequestInterface $request, ResponseInterface $response, array &$options): void - { - $current = $options['__redirect_count'] - ?? 0; - $options['__redirect_count'] = $current + 1; - $max = $options['allow_redirects']['max']; - - if ($options['__redirect_count'] > $max) { - throw new TooManyRedirectsException("Will not follow more than {$max} redirects", $request, $response); - } - } - - public function modifyRequest(RequestInterface $request, array $options, ResponseInterface $response): RequestInterface - { - // Request modifications to apply. - $modify = []; - $protocols = $options['allow_redirects']['protocols']; - - // Use a GET request if this is an entity enclosing request and we are - // not forcing RFC compliance, but rather emulating what all browsers - // would do. - $statusCode = $response->getStatusCode(); - if ($statusCode == 303 || - ($statusCode <= 302 && !$options['allow_redirects']['strict']) - ) { - $safeMethods = ['GET', 'HEAD', 'OPTIONS']; - $requestMethod = $request->getMethod(); - - $modify['method'] = in_array($requestMethod, $safeMethods) ? $requestMethod : 'GET'; - $modify['body'] = ''; - } - - $uri = $this->redirectUri($request, $response, $protocols); - if (isset($options['idn_conversion']) && ($options['idn_conversion'] !== false)) { - $idnOptions = ($options['idn_conversion'] === true) ? \IDNA_DEFAULT : $options['idn_conversion']; - $uri = Utils::idnUriConvert($uri, $idnOptions); - } - - $modify['uri'] = $uri; - Psr7\Message::rewindBody($request); - - // Add the Referer header if it is told to do so and only - // add the header if we are not redirecting from https to http. - if ($options['allow_redirects']['referer'] - && $modify['uri']->getScheme() === $request->getUri()->getScheme() - ) { - $uri = $request->getUri()->withUserInfo(''); - $modify['set_headers']['Referer'] = (string) $uri; - } else { - $modify['remove_headers'][] = 'Referer'; - } - - // Remove Authorization header if host is different. - if ($request->getUri()->getHost() !== $modify['uri']->getHost()) { - $modify['remove_headers'][] = 'Authorization'; - } - - return Psr7\Utils::modifyRequest($request, $modify); - } - - /** - * Set the appropriate URL on the request based on the location header - */ - private function redirectUri(RequestInterface $request, ResponseInterface $response, array $protocols): UriInterface - { - $location = Psr7\UriResolver::resolve( - $request->getUri(), - new Psr7\Uri($response->getHeaderLine('Location')) - ); - - // Ensure that the redirect URI is allowed based on the protocols. - if (!\in_array($location->getScheme(), $protocols)) { - throw new BadResponseException(\sprintf('Redirect URI, %s, does not use one of the allowed redirect protocols: %s', $location, \implode(', ', $protocols)), $request, $response); - } - - return $location; - } -} diff --git a/vendor/guzzlehttp/guzzle/src/RequestOptions.php b/vendor/guzzlehttp/guzzle/src/RequestOptions.php deleted file mode 100644 index 20b31bc..0000000 --- a/vendor/guzzlehttp/guzzle/src/RequestOptions.php +++ /dev/null @@ -1,264 +0,0 @@ -decider = $decider; - $this->nextHandler = $nextHandler; - $this->delay = $delay ?: __CLASS__ . '::exponentialDelay'; - } - - /** - * Default exponential backoff delay function. - * - * @return int milliseconds. - */ - public static function exponentialDelay(int $retries): int - { - return (int) \pow(2, $retries - 1) * 1000; - } - - public function __invoke(RequestInterface $request, array $options): PromiseInterface - { - if (!isset($options['retries'])) { - $options['retries'] = 0; - } - - $fn = $this->nextHandler; - return $fn($request, $options) - ->then( - $this->onFulfilled($request, $options), - $this->onRejected($request, $options) - ); - } - - /** - * Execute fulfilled closure - */ - private function onFulfilled(RequestInterface $request, array $options): callable - { - return function ($value) use ($request, $options) { - if (!($this->decider)( - $options['retries'], - $request, - $value, - null - )) { - return $value; - } - return $this->doRetry($request, $options, $value); - }; - } - - /** - * Execute rejected closure - */ - private function onRejected(RequestInterface $req, array $options): callable - { - return function ($reason) use ($req, $options) { - if (!($this->decider)( - $options['retries'], - $req, - null, - $reason - )) { - return P\Create::rejectionFor($reason); - } - return $this->doRetry($req, $options); - }; - } - - private function doRetry(RequestInterface $request, array $options, ResponseInterface $response = null): PromiseInterface - { - $options['delay'] = ($this->delay)(++$options['retries'], $response); - - return $this($request, $options); - } -} diff --git a/vendor/guzzlehttp/guzzle/src/TransferStats.php b/vendor/guzzlehttp/guzzle/src/TransferStats.php deleted file mode 100644 index 93fa334..0000000 --- a/vendor/guzzlehttp/guzzle/src/TransferStats.php +++ /dev/null @@ -1,133 +0,0 @@ -request = $request; - $this->response = $response; - $this->transferTime = $transferTime; - $this->handlerErrorData = $handlerErrorData; - $this->handlerStats = $handlerStats; - } - - public function getRequest(): RequestInterface - { - return $this->request; - } - - /** - * Returns the response that was received (if any). - */ - public function getResponse(): ?ResponseInterface - { - return $this->response; - } - - /** - * Returns true if a response was received. - */ - public function hasResponse(): bool - { - return $this->response !== null; - } - - /** - * Gets handler specific error data. - * - * This might be an exception, a integer representing an error code, or - * anything else. Relying on this value assumes that you know what handler - * you are using. - * - * @return mixed - */ - public function getHandlerErrorData() - { - return $this->handlerErrorData; - } - - /** - * Get the effective URI the request was sent to. - */ - public function getEffectiveUri(): UriInterface - { - return $this->request->getUri(); - } - - /** - * Get the estimated time the request was being transferred by the handler. - * - * @return float|null Time in seconds. - */ - public function getTransferTime(): ?float - { - return $this->transferTime; - } - - /** - * Gets an array of all of the handler specific transfer data. - */ - public function getHandlerStats(): array - { - return $this->handlerStats; - } - - /** - * Get a specific handler statistic from the handler by name. - * - * @param string $stat Handler specific transfer stat to retrieve. - * - * @return mixed|null - */ - public function getHandlerStat(string $stat) - { - return $this->handlerStats[$stat] ?? null; - } -} diff --git a/vendor/guzzlehttp/guzzle/src/Utils.php b/vendor/guzzlehttp/guzzle/src/Utils.php deleted file mode 100644 index 91591da..0000000 --- a/vendor/guzzlehttp/guzzle/src/Utils.php +++ /dev/null @@ -1,382 +0,0 @@ -getHost()) { - $asciiHost = self::idnToAsci($uri->getHost(), $options, $info); - if ($asciiHost === false) { - $errorBitSet = $info['errors'] ?? 0; - - $errorConstants = array_filter(array_keys(get_defined_constants()), static function (string $name): bool { - return substr($name, 0, 11) === 'IDNA_ERROR_'; - }); - - $errors = []; - foreach ($errorConstants as $errorConstant) { - if ($errorBitSet & constant($errorConstant)) { - $errors[] = $errorConstant; - } - } - - $errorMessage = 'IDN conversion failed'; - if ($errors) { - $errorMessage .= ' (errors: ' . implode(', ', $errors) . ')'; - } - - throw new InvalidArgumentException($errorMessage); - } - if ($uri->getHost() !== $asciiHost) { - // Replace URI only if the ASCII version is different - $uri = $uri->withHost($asciiHost); - } - } - - return $uri; - } - - /** - * @internal - */ - public static function getenv(string $name): ?string - { - if (isset($_SERVER[$name])) { - return (string) $_SERVER[$name]; - } - - if (\PHP_SAPI === 'cli' && ($value = \getenv($name)) !== false && $value !== null) { - return (string) $value; - } - - return null; - } - - /** - * @return string|false - */ - private static function idnToAsci(string $domain, int $options, ?array &$info = []) - { - if (\function_exists('idn_to_ascii') && \defined('INTL_IDNA_VARIANT_UTS46')) { - return \idn_to_ascii($domain, $options, \INTL_IDNA_VARIANT_UTS46, $info); - } - - throw new \Error('ext-idn or symfony/polyfill-intl-idn not loaded or too old'); - } -} diff --git a/vendor/guzzlehttp/guzzle/src/functions.php b/vendor/guzzlehttp/guzzle/src/functions.php deleted file mode 100644 index a70d2cb..0000000 --- a/vendor/guzzlehttp/guzzle/src/functions.php +++ /dev/null @@ -1,167 +0,0 @@ - -Copyright (c) 2015 Graham Campbell -Copyright (c) 2017 Tobias Schultze -Copyright (c) 2020 Tobias Nyholm - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/guzzlehttp/promises/Makefile b/vendor/guzzlehttp/promises/Makefile deleted file mode 100644 index 8d5b3ef..0000000 --- a/vendor/guzzlehttp/promises/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -all: clean test - -test: - vendor/bin/phpunit - -coverage: - vendor/bin/phpunit --coverage-html=artifacts/coverage - -view-coverage: - open artifacts/coverage/index.html - -clean: - rm -rf artifacts/* diff --git a/vendor/guzzlehttp/promises/README.md b/vendor/guzzlehttp/promises/README.md deleted file mode 100644 index c175fec..0000000 --- a/vendor/guzzlehttp/promises/README.md +++ /dev/null @@ -1,547 +0,0 @@ -# Guzzle Promises - -[Promises/A+](https://promisesaplus.com/) implementation that handles promise -chaining and resolution iteratively, allowing for "infinite" promise chaining -while keeping the stack size constant. Read [this blog post](https://blog.domenic.me/youre-missing-the-point-of-promises/) -for a general introduction to promises. - -- [Features](#features) -- [Quick start](#quick-start) -- [Synchronous wait](#synchronous-wait) -- [Cancellation](#cancellation) -- [API](#api) - - [Promise](#promise) - - [FulfilledPromise](#fulfilledpromise) - - [RejectedPromise](#rejectedpromise) -- [Promise interop](#promise-interop) -- [Implementation notes](#implementation-notes) - - -# Features - -- [Promises/A+](https://promisesaplus.com/) implementation. -- Promise resolution and chaining is handled iteratively, allowing for - "infinite" promise chaining. -- Promises have a synchronous `wait` method. -- Promises can be cancelled. -- Works with any object that has a `then` function. -- C# style async/await coroutine promises using - `GuzzleHttp\Promise\Coroutine::of()`. - - -# Quick start - -A *promise* represents the eventual result of an asynchronous operation. The -primary way of interacting with a promise is through its `then` method, which -registers callbacks to receive either a promise's eventual value or the reason -why the promise cannot be fulfilled. - - -## Callbacks - -Callbacks are registered with the `then` method by providing an optional -`$onFulfilled` followed by an optional `$onRejected` function. - - -```php -use GuzzleHttp\Promise\Promise; - -$promise = new Promise(); -$promise->then( - // $onFulfilled - function ($value) { - echo 'The promise was fulfilled.'; - }, - // $onRejected - function ($reason) { - echo 'The promise was rejected.'; - } -); -``` - -*Resolving* a promise means that you either fulfill a promise with a *value* or -reject a promise with a *reason*. Resolving a promises triggers callbacks -registered with the promises's `then` method. These callbacks are triggered -only once and in the order in which they were added. - - -## Resolving a promise - -Promises are fulfilled using the `resolve($value)` method. Resolving a promise -with any value other than a `GuzzleHttp\Promise\RejectedPromise` will trigger -all of the onFulfilled callbacks (resolving a promise with a rejected promise -will reject the promise and trigger the `$onRejected` callbacks). - -```php -use GuzzleHttp\Promise\Promise; - -$promise = new Promise(); -$promise - ->then(function ($value) { - // Return a value and don't break the chain - return "Hello, " . $value; - }) - // This then is executed after the first then and receives the value - // returned from the first then. - ->then(function ($value) { - echo $value; - }); - -// Resolving the promise triggers the $onFulfilled callbacks and outputs -// "Hello, reader." -$promise->resolve('reader.'); -``` - - -## Promise forwarding - -Promises can be chained one after the other. Each then in the chain is a new -promise. The return value of a promise is what's forwarded to the next -promise in the chain. Returning a promise in a `then` callback will cause the -subsequent promises in the chain to only be fulfilled when the returned promise -has been fulfilled. The next promise in the chain will be invoked with the -resolved value of the promise. - -```php -use GuzzleHttp\Promise\Promise; - -$promise = new Promise(); -$nextPromise = new Promise(); - -$promise - ->then(function ($value) use ($nextPromise) { - echo $value; - return $nextPromise; - }) - ->then(function ($value) { - echo $value; - }); - -// Triggers the first callback and outputs "A" -$promise->resolve('A'); -// Triggers the second callback and outputs "B" -$nextPromise->resolve('B'); -``` - -## Promise rejection - -When a promise is rejected, the `$onRejected` callbacks are invoked with the -rejection reason. - -```php -use GuzzleHttp\Promise\Promise; - -$promise = new Promise(); -$promise->then(null, function ($reason) { - echo $reason; -}); - -$promise->reject('Error!'); -// Outputs "Error!" -``` - -## Rejection forwarding - -If an exception is thrown in an `$onRejected` callback, subsequent -`$onRejected` callbacks are invoked with the thrown exception as the reason. - -```php -use GuzzleHttp\Promise\Promise; - -$promise = new Promise(); -$promise->then(null, function ($reason) { - throw new Exception($reason); -})->then(null, function ($reason) { - assert($reason->getMessage() === 'Error!'); -}); - -$promise->reject('Error!'); -``` - -You can also forward a rejection down the promise chain by returning a -`GuzzleHttp\Promise\RejectedPromise` in either an `$onFulfilled` or -`$onRejected` callback. - -```php -use GuzzleHttp\Promise\Promise; -use GuzzleHttp\Promise\RejectedPromise; - -$promise = new Promise(); -$promise->then(null, function ($reason) { - return new RejectedPromise($reason); -})->then(null, function ($reason) { - assert($reason === 'Error!'); -}); - -$promise->reject('Error!'); -``` - -If an exception is not thrown in a `$onRejected` callback and the callback -does not return a rejected promise, downstream `$onFulfilled` callbacks are -invoked using the value returned from the `$onRejected` callback. - -```php -use GuzzleHttp\Promise\Promise; - -$promise = new Promise(); -$promise - ->then(null, function ($reason) { - return "It's ok"; - }) - ->then(function ($value) { - assert($value === "It's ok"); - }); - -$promise->reject('Error!'); -``` - -# Synchronous wait - -You can synchronously force promises to complete using a promise's `wait` -method. When creating a promise, you can provide a wait function that is used -to synchronously force a promise to complete. When a wait function is invoked -it is expected to deliver a value to the promise or reject the promise. If the -wait function does not deliver a value, then an exception is thrown. The wait -function provided to a promise constructor is invoked when the `wait` function -of the promise is called. - -```php -$promise = new Promise(function () use (&$promise) { - $promise->resolve('foo'); -}); - -// Calling wait will return the value of the promise. -echo $promise->wait(); // outputs "foo" -``` - -If an exception is encountered while invoking the wait function of a promise, -the promise is rejected with the exception and the exception is thrown. - -```php -$promise = new Promise(function () use (&$promise) { - throw new Exception('foo'); -}); - -$promise->wait(); // throws the exception. -``` - -Calling `wait` on a promise that has been fulfilled will not trigger the wait -function. It will simply return the previously resolved value. - -```php -$promise = new Promise(function () { die('this is not called!'); }); -$promise->resolve('foo'); -echo $promise->wait(); // outputs "foo" -``` - -Calling `wait` on a promise that has been rejected will throw an exception. If -the rejection reason is an instance of `\Exception` the reason is thrown. -Otherwise, a `GuzzleHttp\Promise\RejectionException` is thrown and the reason -can be obtained by calling the `getReason` method of the exception. - -```php -$promise = new Promise(); -$promise->reject('foo'); -$promise->wait(); -``` - -> PHP Fatal error: Uncaught exception 'GuzzleHttp\Promise\RejectionException' with message 'The promise was rejected with value: foo' - - -## Unwrapping a promise - -When synchronously waiting on a promise, you are joining the state of the -promise into the current state of execution (i.e., return the value of the -promise if it was fulfilled or throw an exception if it was rejected). This is -called "unwrapping" the promise. Waiting on a promise will by default unwrap -the promise state. - -You can force a promise to resolve and *not* unwrap the state of the promise -by passing `false` to the first argument of the `wait` function: - -```php -$promise = new Promise(); -$promise->reject('foo'); -// This will not throw an exception. It simply ensures the promise has -// been resolved. -$promise->wait(false); -``` - -When unwrapping a promise, the resolved value of the promise will be waited -upon until the unwrapped value is not a promise. This means that if you resolve -promise A with a promise B and unwrap promise A, the value returned by the -wait function will be the value delivered to promise B. - -**Note**: when you do not unwrap the promise, no value is returned. - - -# Cancellation - -You can cancel a promise that has not yet been fulfilled using the `cancel()` -method of a promise. When creating a promise you can provide an optional -cancel function that when invoked cancels the action of computing a resolution -of the promise. - - -# API - - -## Promise - -When creating a promise object, you can provide an optional `$waitFn` and -`$cancelFn`. `$waitFn` is a function that is invoked with no arguments and is -expected to resolve the promise. `$cancelFn` is a function with no arguments -that is expected to cancel the computation of a promise. It is invoked when the -`cancel()` method of a promise is called. - -```php -use GuzzleHttp\Promise\Promise; - -$promise = new Promise( - function () use (&$promise) { - $promise->resolve('waited'); - }, - function () { - // do something that will cancel the promise computation (e.g., close - // a socket, cancel a database query, etc...) - } -); - -assert('waited' === $promise->wait()); -``` - -A promise has the following methods: - -- `then(callable $onFulfilled, callable $onRejected) : PromiseInterface` - - Appends fulfillment and rejection handlers to the promise, and returns a new promise resolving to the return value of the called handler. - -- `otherwise(callable $onRejected) : PromiseInterface` - - Appends a rejection handler callback to the promise, and returns a new promise resolving to the return value of the callback if it is called, or to its original fulfillment value if the promise is instead fulfilled. - -- `wait($unwrap = true) : mixed` - - Synchronously waits on the promise to complete. - - `$unwrap` controls whether or not the value of the promise is returned for a - fulfilled promise or if an exception is thrown if the promise is rejected. - This is set to `true` by default. - -- `cancel()` - - Attempts to cancel the promise if possible. The promise being cancelled and - the parent most ancestor that has not yet been resolved will also be - cancelled. Any promises waiting on the cancelled promise to resolve will also - be cancelled. - -- `getState() : string` - - Returns the state of the promise. One of `pending`, `fulfilled`, or - `rejected`. - -- `resolve($value)` - - Fulfills the promise with the given `$value`. - -- `reject($reason)` - - Rejects the promise with the given `$reason`. - - -## FulfilledPromise - -A fulfilled promise can be created to represent a promise that has been -fulfilled. - -```php -use GuzzleHttp\Promise\FulfilledPromise; - -$promise = new FulfilledPromise('value'); - -// Fulfilled callbacks are immediately invoked. -$promise->then(function ($value) { - echo $value; -}); -``` - - -## RejectedPromise - -A rejected promise can be created to represent a promise that has been -rejected. - -```php -use GuzzleHttp\Promise\RejectedPromise; - -$promise = new RejectedPromise('Error'); - -// Rejected callbacks are immediately invoked. -$promise->then(null, function ($reason) { - echo $reason; -}); -``` - - -# Promise interop - -This library works with foreign promises that have a `then` method. This means -you can use Guzzle promises with [React promises](https://github.com/reactphp/promise) -for example. When a foreign promise is returned inside of a then method -callback, promise resolution will occur recursively. - -```php -// Create a React promise -$deferred = new React\Promise\Deferred(); -$reactPromise = $deferred->promise(); - -// Create a Guzzle promise that is fulfilled with a React promise. -$guzzlePromise = new GuzzleHttp\Promise\Promise(); -$guzzlePromise->then(function ($value) use ($reactPromise) { - // Do something something with the value... - // Return the React promise - return $reactPromise; -}); -``` - -Please note that wait and cancel chaining is no longer possible when forwarding -a foreign promise. You will need to wrap a third-party promise with a Guzzle -promise in order to utilize wait and cancel functions with foreign promises. - - -## Event Loop Integration - -In order to keep the stack size constant, Guzzle promises are resolved -asynchronously using a task queue. When waiting on promises synchronously, the -task queue will be automatically run to ensure that the blocking promise and -any forwarded promises are resolved. When using promises asynchronously in an -event loop, you will need to run the task queue on each tick of the loop. If -you do not run the task queue, then promises will not be resolved. - -You can run the task queue using the `run()` method of the global task queue -instance. - -```php -// Get the global task queue -$queue = GuzzleHttp\Promise\Utils::queue(); -$queue->run(); -``` - -For example, you could use Guzzle promises with React using a periodic timer: - -```php -$loop = React\EventLoop\Factory::create(); -$loop->addPeriodicTimer(0, [$queue, 'run']); -``` - -*TODO*: Perhaps adding a `futureTick()` on each tick would be faster? - - -# Implementation notes - - -## Promise resolution and chaining is handled iteratively - -By shuffling pending handlers from one owner to another, promises are -resolved iteratively, allowing for "infinite" then chaining. - -```php -then(function ($v) { - // The stack size remains constant (a good thing) - echo xdebug_get_stack_depth() . ', '; - return $v + 1; - }); -} - -$parent->resolve(0); -var_dump($p->wait()); // int(1000) - -``` - -When a promise is fulfilled or rejected with a non-promise value, the promise -then takes ownership of the handlers of each child promise and delivers values -down the chain without using recursion. - -When a promise is resolved with another promise, the original promise transfers -all of its pending handlers to the new promise. When the new promise is -eventually resolved, all of the pending handlers are delivered the forwarded -value. - - -## A promise is the deferred. - -Some promise libraries implement promises using a deferred object to represent -a computation and a promise object to represent the delivery of the result of -the computation. This is a nice separation of computation and delivery because -consumers of the promise cannot modify the value that will be eventually -delivered. - -One side effect of being able to implement promise resolution and chaining -iteratively is that you need to be able for one promise to reach into the state -of another promise to shuffle around ownership of handlers. In order to achieve -this without making the handlers of a promise publicly mutable, a promise is -also the deferred value, allowing promises of the same parent class to reach -into and modify the private properties of promises of the same type. While this -does allow consumers of the value to modify the resolution or rejection of the -deferred, it is a small price to pay for keeping the stack size constant. - -```php -$promise = new Promise(); -$promise->then(function ($value) { echo $value; }); -// The promise is the deferred value, so you can deliver a value to it. -$promise->resolve('foo'); -// prints "foo" -``` - - -## Upgrading from Function API - -A static API was first introduced in 1.4.0, in order to mitigate problems with functions conflicting between global and local copies of the package. The function API will be removed in 2.0.0. A migration table has been provided here for your convenience: - -| Original Function | Replacement Method | -|----------------|----------------| -| `queue` | `Utils::queue` | -| `task` | `Utils::task` | -| `promise_for` | `Create::promiseFor` | -| `rejection_for` | `Create::rejectionFor` | -| `exception_for` | `Create::exceptionFor` | -| `iter_for` | `Create::iterFor` | -| `inspect` | `Utils::inspect` | -| `inspect_all` | `Utils::inspectAll` | -| `unwrap` | `Utils::unwrap` | -| `all` | `Utils::all` | -| `some` | `Utils::some` | -| `any` | `Utils::any` | -| `settle` | `Utils::settle` | -| `each` | `Each::of` | -| `each_limit` | `Each::ofLimit` | -| `each_limit_all` | `Each::ofLimitAll` | -| `!is_fulfilled` | `Is::pending` | -| `is_fulfilled` | `Is::fulfilled` | -| `is_rejected` | `Is::rejected` | -| `is_settled` | `Is::settled` | -| `coroutine` | `Coroutine::of` | - - -## Security - -If you discover a security vulnerability within this package, please send an email to security@tidelift.com. All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced. Please see [Security Policy](https://github.com/guzzle/promises/security/policy) for more information. - -## License - -Guzzle is made available under the MIT License (MIT). Please see [License File](LICENSE) for more information. - -## For Enterprise - -Available as part of the Tidelift Subscription - -The maintainers of Guzzle and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-guzzlehttp-promises?utm_source=packagist-guzzlehttp-promises&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/vendor/guzzlehttp/promises/composer.json b/vendor/guzzlehttp/promises/composer.json deleted file mode 100644 index c959fb3..0000000 --- a/vendor/guzzlehttp/promises/composer.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "guzzlehttp/promises", - "description": "Guzzle promises library", - "keywords": ["promise"], - "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" - } - ], - "require": { - "php": ">=5.5" - }, - "require-dev": { - "symfony/phpunit-bridge": "^4.4 || ^5.1" - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Promise\\": "src/" - }, - "files": ["src/functions_include.php"] - }, - "autoload-dev": { - "psr-4": { - "GuzzleHttp\\Promise\\Tests\\": "tests/" - } - }, - "scripts": { - "test": "vendor/bin/simple-phpunit", - "test-ci": "vendor/bin/simple-phpunit --coverage-text" - }, - "extra": { - "branch-alias": { - "dev-master": "1.5-dev" - } - }, - "config": { - "preferred-install": "dist", - "sort-packages": true - } -} diff --git a/vendor/guzzlehttp/promises/src/AggregateException.php b/vendor/guzzlehttp/promises/src/AggregateException.php deleted file mode 100644 index d2b5712..0000000 --- a/vendor/guzzlehttp/promises/src/AggregateException.php +++ /dev/null @@ -1,17 +0,0 @@ -then(function ($v) { echo $v; }); - * - * @param callable $generatorFn Generator function to wrap into a promise. - * - * @return Promise - * - * @link https://github.com/petkaantonov/bluebird/blob/master/API.md#generators inspiration - */ -final class Coroutine implements PromiseInterface -{ - /** - * @var PromiseInterface|null - */ - private $currentPromise; - - /** - * @var Generator - */ - private $generator; - - /** - * @var Promise - */ - private $result; - - public function __construct(callable $generatorFn) - { - $this->generator = $generatorFn(); - $this->result = new Promise(function () { - while (isset($this->currentPromise)) { - $this->currentPromise->wait(); - } - }); - try { - $this->nextCoroutine($this->generator->current()); - } catch (\Exception $exception) { - $this->result->reject($exception); - } catch (Throwable $throwable) { - $this->result->reject($throwable); - } - } - - /** - * Create a new coroutine. - * - * @return self - */ - public static function of(callable $generatorFn) - { - return new self($generatorFn); - } - - public function then( - callable $onFulfilled = null, - callable $onRejected = null - ) { - return $this->result->then($onFulfilled, $onRejected); - } - - public function otherwise(callable $onRejected) - { - return $this->result->otherwise($onRejected); - } - - public function wait($unwrap = true) - { - return $this->result->wait($unwrap); - } - - public function getState() - { - return $this->result->getState(); - } - - public function resolve($value) - { - $this->result->resolve($value); - } - - public function reject($reason) - { - $this->result->reject($reason); - } - - public function cancel() - { - $this->currentPromise->cancel(); - $this->result->cancel(); - } - - private function nextCoroutine($yielded) - { - $this->currentPromise = Create::promiseFor($yielded) - ->then([$this, '_handleSuccess'], [$this, '_handleFailure']); - } - - /** - * @internal - */ - public function _handleSuccess($value) - { - unset($this->currentPromise); - try { - $next = $this->generator->send($value); - if ($this->generator->valid()) { - $this->nextCoroutine($next); - } else { - $this->result->resolve($value); - } - } catch (Exception $exception) { - $this->result->reject($exception); - } catch (Throwable $throwable) { - $this->result->reject($throwable); - } - } - - /** - * @internal - */ - public function _handleFailure($reason) - { - unset($this->currentPromise); - try { - $nextYield = $this->generator->throw(Create::exceptionFor($reason)); - // The throw was caught, so keep iterating on the coroutine - $this->nextCoroutine($nextYield); - } catch (Exception $exception) { - $this->result->reject($exception); - } catch (Throwable $throwable) { - $this->result->reject($throwable); - } - } -} diff --git a/vendor/guzzlehttp/promises/src/Create.php b/vendor/guzzlehttp/promises/src/Create.php deleted file mode 100644 index 8d038e9..0000000 --- a/vendor/guzzlehttp/promises/src/Create.php +++ /dev/null @@ -1,84 +0,0 @@ -then([$promise, 'resolve'], [$promise, 'reject']); - return $promise; - } - - return new FulfilledPromise($value); - } - - /** - * Creates a rejected promise for a reason if the reason is not a promise. - * If the provided reason is a promise, then it is returned as-is. - * - * @param mixed $reason Promise or reason. - * - * @return PromiseInterface - */ - public static function rejectionFor($reason) - { - if ($reason instanceof PromiseInterface) { - return $reason; - } - - return new RejectedPromise($reason); - } - - /** - * Create an exception for a rejected promise value. - * - * @param mixed $reason - * - * @return \Exception|\Throwable - */ - public static function exceptionFor($reason) - { - if ($reason instanceof \Exception || $reason instanceof \Throwable) { - return $reason; - } - - return new RejectionException($reason); - } - - /** - * Returns an iterator for the given value. - * - * @param mixed $value - * - * @return \Iterator - */ - public static function iterFor($value) - { - if ($value instanceof \Iterator) { - return $value; - } - - if (is_array($value)) { - return new \ArrayIterator($value); - } - - return new \ArrayIterator([$value]); - } -} diff --git a/vendor/guzzlehttp/promises/src/Each.php b/vendor/guzzlehttp/promises/src/Each.php deleted file mode 100644 index 1dda354..0000000 --- a/vendor/guzzlehttp/promises/src/Each.php +++ /dev/null @@ -1,90 +0,0 @@ - $onFulfilled, - 'rejected' => $onRejected - ]))->promise(); - } - - /** - * Like of, but only allows a certain number of outstanding promises at any - * given time. - * - * $concurrency may be an integer or a function that accepts the number of - * pending promises and returns a numeric concurrency limit value to allow - * for dynamic a concurrency size. - * - * @param mixed $iterable - * @param int|callable $concurrency - * @param callable $onFulfilled - * @param callable $onRejected - * - * @return PromiseInterface - */ - public static function ofLimit( - $iterable, - $concurrency, - callable $onFulfilled = null, - callable $onRejected = null - ) { - return (new EachPromise($iterable, [ - 'fulfilled' => $onFulfilled, - 'rejected' => $onRejected, - 'concurrency' => $concurrency - ]))->promise(); - } - - /** - * Like limit, but ensures that no promise in the given $iterable argument - * is rejected. If any promise is rejected, then the aggregate promise is - * rejected with the encountered rejection. - * - * @param mixed $iterable - * @param int|callable $concurrency - * @param callable $onFulfilled - * - * @return PromiseInterface - */ - public static function ofLimitAll( - $iterable, - $concurrency, - callable $onFulfilled = null - ) { - return each_limit( - $iterable, - $concurrency, - $onFulfilled, - function ($reason, $idx, PromiseInterface $aggregate) { - $aggregate->reject($reason); - } - ); - } -} diff --git a/vendor/guzzlehttp/promises/src/EachPromise.php b/vendor/guzzlehttp/promises/src/EachPromise.php deleted file mode 100644 index 38ecb59..0000000 --- a/vendor/guzzlehttp/promises/src/EachPromise.php +++ /dev/null @@ -1,255 +0,0 @@ -iterable = Create::iterFor($iterable); - - if (isset($config['concurrency'])) { - $this->concurrency = $config['concurrency']; - } - - if (isset($config['fulfilled'])) { - $this->onFulfilled = $config['fulfilled']; - } - - if (isset($config['rejected'])) { - $this->onRejected = $config['rejected']; - } - } - - /** @psalm-suppress InvalidNullableReturnType */ - public function promise() - { - if ($this->aggregate) { - return $this->aggregate; - } - - try { - $this->createPromise(); - /** @psalm-assert Promise $this->aggregate */ - $this->iterable->rewind(); - $this->refillPending(); - } catch (\Throwable $e) { - /** - * @psalm-suppress NullReference - * @phpstan-ignore-next-line - */ - $this->aggregate->reject($e); - } catch (\Exception $e) { - /** - * @psalm-suppress NullReference - * @phpstan-ignore-next-line - */ - $this->aggregate->reject($e); - } - - /** - * @psalm-suppress NullableReturnStatement - * @phpstan-ignore-next-line - */ - return $this->aggregate; - } - - private function createPromise() - { - $this->mutex = false; - $this->aggregate = new Promise(function () { - if ($this->checkIfFinished()) { - return; - } - reset($this->pending); - // Consume a potentially fluctuating list of promises while - // ensuring that indexes are maintained (precluding array_shift). - while ($promise = current($this->pending)) { - next($this->pending); - $promise->wait(); - if (Is::settled($this->aggregate)) { - return; - } - } - }); - - // Clear the references when the promise is resolved. - $clearFn = function () { - $this->iterable = $this->concurrency = $this->pending = null; - $this->onFulfilled = $this->onRejected = null; - $this->nextPendingIndex = 0; - }; - - $this->aggregate->then($clearFn, $clearFn); - } - - private function refillPending() - { - if (!$this->concurrency) { - // Add all pending promises. - while ($this->addPending() && $this->advanceIterator()); - return; - } - - // Add only up to N pending promises. - $concurrency = is_callable($this->concurrency) - ? call_user_func($this->concurrency, count($this->pending)) - : $this->concurrency; - $concurrency = max($concurrency - count($this->pending), 0); - // Concurrency may be set to 0 to disallow new promises. - if (!$concurrency) { - return; - } - // Add the first pending promise. - $this->addPending(); - // Note this is special handling for concurrency=1 so that we do - // not advance the iterator after adding the first promise. This - // helps work around issues with generators that might not have the - // next value to yield until promise callbacks are called. - while (--$concurrency - && $this->advanceIterator() - && $this->addPending()); - } - - private function addPending() - { - if (!$this->iterable || !$this->iterable->valid()) { - return false; - } - - $promise = Create::promiseFor($this->iterable->current()); - $key = $this->iterable->key(); - - // Iterable keys may not be unique, so we use a counter to - // guarantee uniqueness - $idx = $this->nextPendingIndex++; - - $this->pending[$idx] = $promise->then( - function ($value) use ($idx, $key) { - if ($this->onFulfilled) { - call_user_func( - $this->onFulfilled, - $value, - $key, - $this->aggregate - ); - } - $this->step($idx); - }, - function ($reason) use ($idx, $key) { - if ($this->onRejected) { - call_user_func( - $this->onRejected, - $reason, - $key, - $this->aggregate - ); - } - $this->step($idx); - } - ); - - return true; - } - - private function advanceIterator() - { - // Place a lock on the iterator so that we ensure to not recurse, - // preventing fatal generator errors. - if ($this->mutex) { - return false; - } - - $this->mutex = true; - - try { - $this->iterable->next(); - $this->mutex = false; - return true; - } catch (\Throwable $e) { - $this->aggregate->reject($e); - $this->mutex = false; - return false; - } catch (\Exception $e) { - $this->aggregate->reject($e); - $this->mutex = false; - return false; - } - } - - private function step($idx) - { - // If the promise was already resolved, then ignore this step. - if (Is::settled($this->aggregate)) { - return; - } - - unset($this->pending[$idx]); - - // Only refill pending promises if we are not locked, preventing the - // EachPromise to recursively invoke the provided iterator, which - // cause a fatal error: "Cannot resume an already running generator" - if ($this->advanceIterator() && !$this->checkIfFinished()) { - // Add more pending promises if possible. - $this->refillPending(); - } - } - - private function checkIfFinished() - { - if (!$this->pending && !$this->iterable->valid()) { - // Resolve the promise if there's nothing left to do. - $this->aggregate->resolve(null); - return true; - } - - return false; - } -} diff --git a/vendor/guzzlehttp/promises/src/FulfilledPromise.php b/vendor/guzzlehttp/promises/src/FulfilledPromise.php deleted file mode 100644 index 98f72a6..0000000 --- a/vendor/guzzlehttp/promises/src/FulfilledPromise.php +++ /dev/null @@ -1,84 +0,0 @@ -value = $value; - } - - public function then( - callable $onFulfilled = null, - callable $onRejected = null - ) { - // Return itself if there is no onFulfilled function. - if (!$onFulfilled) { - return $this; - } - - $queue = Utils::queue(); - $p = new Promise([$queue, 'run']); - $value = $this->value; - $queue->add(static function () use ($p, $value, $onFulfilled) { - if (Is::pending($p)) { - try { - $p->resolve($onFulfilled($value)); - } catch (\Throwable $e) { - $p->reject($e); - } catch (\Exception $e) { - $p->reject($e); - } - } - }); - - return $p; - } - - public function otherwise(callable $onRejected) - { - return $this->then(null, $onRejected); - } - - public function wait($unwrap = true, $defaultDelivery = null) - { - return $unwrap ? $this->value : null; - } - - public function getState() - { - return self::FULFILLED; - } - - public function resolve($value) - { - if ($value !== $this->value) { - throw new \LogicException("Cannot resolve a fulfilled promise"); - } - } - - public function reject($reason) - { - throw new \LogicException("Cannot reject a fulfilled promise"); - } - - public function cancel() - { - // pass - } -} diff --git a/vendor/guzzlehttp/promises/src/Is.php b/vendor/guzzlehttp/promises/src/Is.php deleted file mode 100644 index c3ed8d0..0000000 --- a/vendor/guzzlehttp/promises/src/Is.php +++ /dev/null @@ -1,46 +0,0 @@ -getState() === PromiseInterface::PENDING; - } - - /** - * Returns true if a promise is fulfilled or rejected. - * - * @return bool - */ - public static function settled(PromiseInterface $promise) - { - return $promise->getState() !== PromiseInterface::PENDING; - } - - /** - * Returns true if a promise is fulfilled. - * - * @return bool - */ - public static function fulfilled(PromiseInterface $promise) - { - return $promise->getState() === PromiseInterface::FULFILLED; - } - - /** - * Returns true if a promise is rejected. - * - * @return bool - */ - public static function rejected(PromiseInterface $promise) - { - return $promise->getState() === PromiseInterface::REJECTED; - } -} diff --git a/vendor/guzzlehttp/promises/src/Promise.php b/vendor/guzzlehttp/promises/src/Promise.php deleted file mode 100644 index 7593905..0000000 --- a/vendor/guzzlehttp/promises/src/Promise.php +++ /dev/null @@ -1,278 +0,0 @@ -waitFn = $waitFn; - $this->cancelFn = $cancelFn; - } - - public function then( - callable $onFulfilled = null, - callable $onRejected = null - ) { - if ($this->state === self::PENDING) { - $p = new Promise(null, [$this, 'cancel']); - $this->handlers[] = [$p, $onFulfilled, $onRejected]; - $p->waitList = $this->waitList; - $p->waitList[] = $this; - return $p; - } - - // Return a fulfilled promise and immediately invoke any callbacks. - if ($this->state === self::FULFILLED) { - $promise = Create::promiseFor($this->result); - return $onFulfilled ? $promise->then($onFulfilled) : $promise; - } - - // It's either cancelled or rejected, so return a rejected promise - // and immediately invoke any callbacks. - $rejection = Create::rejectionFor($this->result); - return $onRejected ? $rejection->then(null, $onRejected) : $rejection; - } - - public function otherwise(callable $onRejected) - { - return $this->then(null, $onRejected); - } - - public function wait($unwrap = true) - { - $this->waitIfPending(); - - if ($this->result instanceof PromiseInterface) { - return $this->result->wait($unwrap); - } - if ($unwrap) { - if ($this->state === self::FULFILLED) { - return $this->result; - } - // It's rejected so "unwrap" and throw an exception. - throw Create::exceptionFor($this->result); - } - } - - public function getState() - { - return $this->state; - } - - public function cancel() - { - if ($this->state !== self::PENDING) { - return; - } - - $this->waitFn = $this->waitList = null; - - if ($this->cancelFn) { - $fn = $this->cancelFn; - $this->cancelFn = null; - try { - $fn(); - } catch (\Throwable $e) { - $this->reject($e); - } catch (\Exception $e) { - $this->reject($e); - } - } - - // Reject the promise only if it wasn't rejected in a then callback. - /** @psalm-suppress RedundantCondition */ - if ($this->state === self::PENDING) { - $this->reject(new CancellationException('Promise has been cancelled')); - } - } - - public function resolve($value) - { - $this->settle(self::FULFILLED, $value); - } - - public function reject($reason) - { - $this->settle(self::REJECTED, $reason); - } - - private function settle($state, $value) - { - if ($this->state !== self::PENDING) { - // Ignore calls with the same resolution. - if ($state === $this->state && $value === $this->result) { - return; - } - throw $this->state === $state - ? new \LogicException("The promise is already {$state}.") - : new \LogicException("Cannot change a {$this->state} promise to {$state}"); - } - - if ($value === $this) { - throw new \LogicException('Cannot fulfill or reject a promise with itself'); - } - - // Clear out the state of the promise but stash the handlers. - $this->state = $state; - $this->result = $value; - $handlers = $this->handlers; - $this->handlers = null; - $this->waitList = $this->waitFn = null; - $this->cancelFn = null; - - if (!$handlers) { - return; - } - - // If the value was not a settled promise or a thenable, then resolve - // it in the task queue using the correct ID. - if (!is_object($value) || !method_exists($value, 'then')) { - $id = $state === self::FULFILLED ? 1 : 2; - // It's a success, so resolve the handlers in the queue. - Utils::queue()->add(static function () use ($id, $value, $handlers) { - foreach ($handlers as $handler) { - self::callHandler($id, $value, $handler); - } - }); - } elseif ($value instanceof Promise && Is::pending($value)) { - // We can just merge our handlers onto the next promise. - $value->handlers = array_merge($value->handlers, $handlers); - } else { - // Resolve the handlers when the forwarded promise is resolved. - $value->then( - static function ($value) use ($handlers) { - foreach ($handlers as $handler) { - self::callHandler(1, $value, $handler); - } - }, - static function ($reason) use ($handlers) { - foreach ($handlers as $handler) { - self::callHandler(2, $reason, $handler); - } - } - ); - } - } - - /** - * Call a stack of handlers using a specific callback index and value. - * - * @param int $index 1 (resolve) or 2 (reject). - * @param mixed $value Value to pass to the callback. - * @param array $handler Array of handler data (promise and callbacks). - */ - private static function callHandler($index, $value, array $handler) - { - /** @var PromiseInterface $promise */ - $promise = $handler[0]; - - // The promise may have been cancelled or resolved before placing - // this thunk in the queue. - if (Is::settled($promise)) { - return; - } - - try { - if (isset($handler[$index])) { - /* - * If $f throws an exception, then $handler will be in the exception - * stack trace. Since $handler contains a reference to the callable - * itself we get a circular reference. We clear the $handler - * here to avoid that memory leak. - */ - $f = $handler[$index]; - unset($handler); - $promise->resolve($f($value)); - } elseif ($index === 1) { - // Forward resolution values as-is. - $promise->resolve($value); - } else { - // Forward rejections down the chain. - $promise->reject($value); - } - } catch (\Throwable $reason) { - $promise->reject($reason); - } catch (\Exception $reason) { - $promise->reject($reason); - } - } - - private function waitIfPending() - { - if ($this->state !== self::PENDING) { - return; - } elseif ($this->waitFn) { - $this->invokeWaitFn(); - } elseif ($this->waitList) { - $this->invokeWaitList(); - } else { - // If there's no wait function, then reject the promise. - $this->reject('Cannot wait on a promise that has ' - . 'no internal wait function. You must provide a wait ' - . 'function when constructing the promise to be able to ' - . 'wait on a promise.'); - } - - Utils::queue()->run(); - - /** @psalm-suppress RedundantCondition */ - if ($this->state === self::PENDING) { - $this->reject('Invoking the wait callback did not resolve the promise'); - } - } - - private function invokeWaitFn() - { - try { - $wfn = $this->waitFn; - $this->waitFn = null; - $wfn(true); - } catch (\Exception $reason) { - if ($this->state === self::PENDING) { - // The promise has not been resolved yet, so reject the promise - // with the exception. - $this->reject($reason); - } else { - // The promise was already resolved, so there's a problem in - // the application. - throw $reason; - } - } - } - - private function invokeWaitList() - { - $waitList = $this->waitList; - $this->waitList = null; - - foreach ($waitList as $result) { - do { - $result->waitIfPending(); - $result = $result->result; - } while ($result instanceof Promise); - - if ($result instanceof PromiseInterface) { - $result->wait(false); - } - } - } -} diff --git a/vendor/guzzlehttp/promises/src/PromiseInterface.php b/vendor/guzzlehttp/promises/src/PromiseInterface.php deleted file mode 100644 index e598331..0000000 --- a/vendor/guzzlehttp/promises/src/PromiseInterface.php +++ /dev/null @@ -1,97 +0,0 @@ -reason = $reason; - } - - public function then( - callable $onFulfilled = null, - callable $onRejected = null - ) { - // If there's no onRejected callback then just return self. - if (!$onRejected) { - return $this; - } - - $queue = Utils::queue(); - $reason = $this->reason; - $p = new Promise([$queue, 'run']); - $queue->add(static function () use ($p, $reason, $onRejected) { - if (Is::pending($p)) { - try { - // Return a resolved promise if onRejected does not throw. - $p->resolve($onRejected($reason)); - } catch (\Throwable $e) { - // onRejected threw, so return a rejected promise. - $p->reject($e); - } catch (\Exception $e) { - // onRejected threw, so return a rejected promise. - $p->reject($e); - } - } - }); - - return $p; - } - - public function otherwise(callable $onRejected) - { - return $this->then(null, $onRejected); - } - - public function wait($unwrap = true, $defaultDelivery = null) - { - if ($unwrap) { - throw Create::exceptionFor($this->reason); - } - - return null; - } - - public function getState() - { - return self::REJECTED; - } - - public function resolve($value) - { - throw new \LogicException("Cannot resolve a rejected promise"); - } - - public function reject($reason) - { - if ($reason !== $this->reason) { - throw new \LogicException("Cannot reject a rejected promise"); - } - } - - public function cancel() - { - // pass - } -} diff --git a/vendor/guzzlehttp/promises/src/RejectionException.php b/vendor/guzzlehttp/promises/src/RejectionException.php deleted file mode 100644 index e2f1377..0000000 --- a/vendor/guzzlehttp/promises/src/RejectionException.php +++ /dev/null @@ -1,48 +0,0 @@ -reason = $reason; - - $message = 'The promise was rejected'; - - if ($description) { - $message .= ' with reason: ' . $description; - } elseif (is_string($reason) - || (is_object($reason) && method_exists($reason, '__toString')) - ) { - $message .= ' with reason: ' . $this->reason; - } elseif ($reason instanceof \JsonSerializable) { - $message .= ' with reason: ' - . json_encode($this->reason, JSON_PRETTY_PRINT); - } - - parent::__construct($message); - } - - /** - * Returns the rejection reason. - * - * @return mixed - */ - public function getReason() - { - return $this->reason; - } -} diff --git a/vendor/guzzlehttp/promises/src/TaskQueue.php b/vendor/guzzlehttp/promises/src/TaskQueue.php deleted file mode 100644 index f0fba2c..0000000 --- a/vendor/guzzlehttp/promises/src/TaskQueue.php +++ /dev/null @@ -1,67 +0,0 @@ -run(); - */ -class TaskQueue implements TaskQueueInterface -{ - private $enableShutdown = true; - private $queue = []; - - public function __construct($withShutdown = true) - { - if ($withShutdown) { - register_shutdown_function(function () { - if ($this->enableShutdown) { - // Only run the tasks if an E_ERROR didn't occur. - $err = error_get_last(); - if (!$err || ($err['type'] ^ E_ERROR)) { - $this->run(); - } - } - }); - } - } - - public function isEmpty() - { - return !$this->queue; - } - - public function add(callable $task) - { - $this->queue[] = $task; - } - - public function run() - { - while ($task = array_shift($this->queue)) { - /** @var callable $task */ - $task(); - } - } - - /** - * The task queue will be run and exhausted by default when the process - * exits IFF the exit is not the result of a PHP E_ERROR error. - * - * You can disable running the automatic shutdown of the queue by calling - * this function. If you disable the task queue shutdown process, then you - * MUST either run the task queue (as a result of running your event loop - * or manually using the run() method) or wait on each outstanding promise. - * - * Note: This shutdown will occur before any destructors are triggered. - */ - public function disableShutdown() - { - $this->enableShutdown = false; - } -} diff --git a/vendor/guzzlehttp/promises/src/TaskQueueInterface.php b/vendor/guzzlehttp/promises/src/TaskQueueInterface.php deleted file mode 100644 index 723d4d5..0000000 --- a/vendor/guzzlehttp/promises/src/TaskQueueInterface.php +++ /dev/null @@ -1,24 +0,0 @@ - - * while ($eventLoop->isRunning()) { - * GuzzleHttp\Promise\Utils::queue()->run(); - * } - * - * - * @param TaskQueueInterface $assign Optionally specify a new queue instance. - * - * @return TaskQueueInterface - */ - public static function queue(TaskQueueInterface $assign = null) - { - static $queue; - - if ($assign) { - $queue = $assign; - } elseif (!$queue) { - $queue = new TaskQueue(); - } - - return $queue; - } - - /** - * Adds a function to run in the task queue when it is next `run()` and - * returns a promise that is fulfilled or rejected with the result. - * - * @param callable $task Task function to run. - * - * @return PromiseInterface - */ - public static function task(callable $task) - { - $queue = self::queue(); - $promise = new Promise([$queue, 'run']); - $queue->add(function () use ($task, $promise) { - try { - if (Is::pending($promise)) { - $promise->resolve($task()); - } - } catch (\Throwable $e) { - $promise->reject($e); - } catch (\Exception $e) { - $promise->reject($e); - } - }); - - return $promise; - } - - /** - * Synchronously waits on a promise to resolve and returns an inspection - * state array. - * - * Returns a state associative array containing a "state" key mapping to a - * valid promise state. If the state of the promise is "fulfilled", the - * array will contain a "value" key mapping to the fulfilled value of the - * promise. If the promise is rejected, the array will contain a "reason" - * key mapping to the rejection reason of the promise. - * - * @param PromiseInterface $promise Promise or value. - * - * @return array - */ - public static function inspect(PromiseInterface $promise) - { - try { - return [ - 'state' => PromiseInterface::FULFILLED, - 'value' => $promise->wait() - ]; - } catch (RejectionException $e) { - return ['state' => PromiseInterface::REJECTED, 'reason' => $e->getReason()]; - } catch (\Throwable $e) { - return ['state' => PromiseInterface::REJECTED, 'reason' => $e]; - } catch (\Exception $e) { - return ['state' => PromiseInterface::REJECTED, 'reason' => $e]; - } - } - - /** - * Waits on all of the provided promises, but does not unwrap rejected - * promises as thrown exception. - * - * Returns an array of inspection state arrays. - * - * @see inspect for the inspection state array format. - * - * @param PromiseInterface[] $promises Traversable of promises to wait upon. - * - * @return array - */ - public static function inspectAll($promises) - { - $results = []; - foreach ($promises as $key => $promise) { - $results[$key] = inspect($promise); - } - - return $results; - } - - /** - * Waits on all of the provided promises and returns the fulfilled values. - * - * Returns an array that contains the value of each promise (in the same - * order the promises were provided). An exception is thrown if any of the - * promises are rejected. - * - * @param iterable $promises Iterable of PromiseInterface objects to wait on. - * - * @return array - * - * @throws \Exception on error - * @throws \Throwable on error in PHP >=7 - */ - public static function unwrap($promises) - { - $results = []; - foreach ($promises as $key => $promise) { - $results[$key] = $promise->wait(); - } - - return $results; - } - - /** - * Given an array of promises, return a promise that is fulfilled when all - * the items in the array are fulfilled. - * - * The promise's fulfillment value is an array with fulfillment values at - * respective positions to the original array. If any promise in the array - * rejects, the returned promise is rejected with the rejection reason. - * - * @param mixed $promises Promises or values. - * @param bool $recursive If true, resolves new promises that might have been added to the stack during its own resolution. - * - * @return PromiseInterface - */ - public static function all($promises, $recursive = false) - { - $results = []; - $promise = Each::of( - $promises, - function ($value, $idx) use (&$results) { - $results[$idx] = $value; - }, - function ($reason, $idx, Promise $aggregate) { - $aggregate->reject($reason); - } - )->then(function () use (&$results) { - ksort($results); - return $results; - }); - - if (true === $recursive) { - $promise = $promise->then(function ($results) use ($recursive, &$promises) { - foreach ($promises as $promise) { - if (Is::pending($promise)) { - return self::all($promises, $recursive); - } - } - return $results; - }); - } - - return $promise; - } - - /** - * Initiate a competitive race between multiple promises or values (values - * will become immediately fulfilled promises). - * - * When count amount of promises have been fulfilled, the returned promise - * is fulfilled with an array that contains the fulfillment values of the - * winners in order of resolution. - * - * This promise is rejected with a {@see AggregateException} if the number - * of fulfilled promises is less than the desired $count. - * - * @param int $count Total number of promises. - * @param mixed $promises Promises or values. - * - * @return PromiseInterface - */ - public static function some($count, $promises) - { - $results = []; - $rejections = []; - - return Each::of( - $promises, - function ($value, $idx, PromiseInterface $p) use (&$results, $count) { - if (Is::settled($p)) { - return; - } - $results[$idx] = $value; - if (count($results) >= $count) { - $p->resolve(null); - } - }, - function ($reason) use (&$rejections) { - $rejections[] = $reason; - } - )->then( - function () use (&$results, &$rejections, $count) { - if (count($results) !== $count) { - throw new AggregateException( - 'Not enough promises to fulfill count', - $rejections - ); - } - ksort($results); - return array_values($results); - } - ); - } - - /** - * Like some(), with 1 as count. However, if the promise fulfills, the - * fulfillment value is not an array of 1 but the value directly. - * - * @param mixed $promises Promises or values. - * - * @return PromiseInterface - */ - public static function any($promises) - { - return self::some(1, $promises)->then(function ($values) { - return $values[0]; - }); - } - - /** - * Returns a promise that is fulfilled when all of the provided promises have - * been fulfilled or rejected. - * - * The returned promise is fulfilled with an array of inspection state arrays. - * - * @see inspect for the inspection state array format. - * - * @param mixed $promises Promises or values. - * - * @return PromiseInterface - */ - public static function settle($promises) - { - $results = []; - - return Each::of( - $promises, - function ($value, $idx) use (&$results) { - $results[$idx] = ['state' => PromiseInterface::FULFILLED, 'value' => $value]; - }, - function ($reason, $idx) use (&$results) { - $results[$idx] = ['state' => PromiseInterface::REJECTED, 'reason' => $reason]; - } - )->then(function () use (&$results) { - ksort($results); - return $results; - }); - } -} diff --git a/vendor/guzzlehttp/promises/src/functions.php b/vendor/guzzlehttp/promises/src/functions.php deleted file mode 100644 index c03d39d..0000000 --- a/vendor/guzzlehttp/promises/src/functions.php +++ /dev/null @@ -1,363 +0,0 @@ - - * while ($eventLoop->isRunning()) { - * GuzzleHttp\Promise\queue()->run(); - * } - * - * - * @param TaskQueueInterface $assign Optionally specify a new queue instance. - * - * @return TaskQueueInterface - * - * @deprecated queue will be removed in guzzlehttp/promises:2.0. Use Utils::queue instead. - */ -function queue(TaskQueueInterface $assign = null) -{ - return Utils::queue($assign); -} - -/** - * Adds a function to run in the task queue when it is next `run()` and returns - * a promise that is fulfilled or rejected with the result. - * - * @param callable $task Task function to run. - * - * @return PromiseInterface - * - * @deprecated task will be removed in guzzlehttp/promises:2.0. Use Utils::task instead. - */ -function task(callable $task) -{ - return Utils::task($task); -} - -/** - * Creates a promise for a value if the value is not a promise. - * - * @param mixed $value Promise or value. - * - * @return PromiseInterface - * - * @deprecated promise_for will be removed in guzzlehttp/promises:2.0. Use Create::promiseFor instead. - */ -function promise_for($value) -{ - return Create::promiseFor($value); -} - -/** - * Creates a rejected promise for a reason if the reason is not a promise. If - * the provided reason is a promise, then it is returned as-is. - * - * @param mixed $reason Promise or reason. - * - * @return PromiseInterface - * - * @deprecated rejection_for will be removed in guzzlehttp/promises:2.0. Use Create::rejectionFor instead. - */ -function rejection_for($reason) -{ - return Create::rejectionFor($reason); -} - -/** - * Create an exception for a rejected promise value. - * - * @param mixed $reason - * - * @return \Exception|\Throwable - * - * @deprecated exception_for will be removed in guzzlehttp/promises:2.0. Use Create::exceptionFor instead. - */ -function exception_for($reason) -{ - return Create::exceptionFor($reason); -} - -/** - * Returns an iterator for the given value. - * - * @param mixed $value - * - * @return \Iterator - * - * @deprecated iter_for will be removed in guzzlehttp/promises:2.0. Use Create::iterFor instead. - */ -function iter_for($value) -{ - return Create::iterFor($value); -} - -/** - * Synchronously waits on a promise to resolve and returns an inspection state - * array. - * - * Returns a state associative array containing a "state" key mapping to a - * valid promise state. If the state of the promise is "fulfilled", the array - * will contain a "value" key mapping to the fulfilled value of the promise. If - * the promise is rejected, the array will contain a "reason" key mapping to - * the rejection reason of the promise. - * - * @param PromiseInterface $promise Promise or value. - * - * @return array - * - * @deprecated inspect will be removed in guzzlehttp/promises:2.0. Use Utils::inspect instead. - */ -function inspect(PromiseInterface $promise) -{ - return Utils::inspect($promise); -} - -/** - * Waits on all of the provided promises, but does not unwrap rejected promises - * as thrown exception. - * - * Returns an array of inspection state arrays. - * - * @see inspect for the inspection state array format. - * - * @param PromiseInterface[] $promises Traversable of promises to wait upon. - * - * @return array - * - * @deprecated inspect will be removed in guzzlehttp/promises:2.0. Use Utils::inspectAll instead. - */ -function inspect_all($promises) -{ - return Utils::inspectAll($promises); -} - -/** - * Waits on all of the provided promises and returns the fulfilled values. - * - * Returns an array that contains the value of each promise (in the same order - * the promises were provided). An exception is thrown if any of the promises - * are rejected. - * - * @param iterable $promises Iterable of PromiseInterface objects to wait on. - * - * @return array - * - * @throws \Exception on error - * @throws \Throwable on error in PHP >=7 - * - * @deprecated unwrap will be removed in guzzlehttp/promises:2.0. Use Utils::unwrap instead. - */ -function unwrap($promises) -{ - return Utils::unwrap($promises); -} - -/** - * Given an array of promises, return a promise that is fulfilled when all the - * items in the array are fulfilled. - * - * The promise's fulfillment value is an array with fulfillment values at - * respective positions to the original array. If any promise in the array - * rejects, the returned promise is rejected with the rejection reason. - * - * @param mixed $promises Promises or values. - * @param bool $recursive If true, resolves new promises that might have been added to the stack during its own resolution. - * - * @return PromiseInterface - * - * @deprecated all will be removed in guzzlehttp/promises:2.0. Use Utils::all instead. - */ -function all($promises, $recursive = false) -{ - return Utils::all($promises, $recursive); -} - -/** - * Initiate a competitive race between multiple promises or values (values will - * become immediately fulfilled promises). - * - * When count amount of promises have been fulfilled, the returned promise is - * fulfilled with an array that contains the fulfillment values of the winners - * in order of resolution. - * - * This promise is rejected with a {@see AggregateException} if the number of - * fulfilled promises is less than the desired $count. - * - * @param int $count Total number of promises. - * @param mixed $promises Promises or values. - * - * @return PromiseInterface - * - * @deprecated some will be removed in guzzlehttp/promises:2.0. Use Utils::some instead. - */ -function some($count, $promises) -{ - return Utils::some($count, $promises); -} - -/** - * Like some(), with 1 as count. However, if the promise fulfills, the - * fulfillment value is not an array of 1 but the value directly. - * - * @param mixed $promises Promises or values. - * - * @return PromiseInterface - * - * @deprecated any will be removed in guzzlehttp/promises:2.0. Use Utils::any instead. - */ -function any($promises) -{ - return Utils::any($promises); -} - -/** - * Returns a promise that is fulfilled when all of the provided promises have - * been fulfilled or rejected. - * - * The returned promise is fulfilled with an array of inspection state arrays. - * - * @see inspect for the inspection state array format. - * - * @param mixed $promises Promises or values. - * - * @return PromiseInterface - * - * @deprecated settle will be removed in guzzlehttp/promises:2.0. Use Utils::settle instead. - */ -function settle($promises) -{ - return Utils::settle($promises); -} - -/** - * Given an iterator that yields promises or values, returns a promise that is - * fulfilled with a null value when the iterator has been consumed or the - * aggregate promise has been fulfilled or rejected. - * - * $onFulfilled is a function that accepts the fulfilled value, iterator index, - * and the aggregate promise. The callback can invoke any necessary side - * effects and choose to resolve or reject the aggregate if needed. - * - * $onRejected is a function that accepts the rejection reason, iterator index, - * and the aggregate promise. The callback can invoke any necessary side - * effects and choose to resolve or reject the aggregate if needed. - * - * @param mixed $iterable Iterator or array to iterate over. - * @param callable $onFulfilled - * @param callable $onRejected - * - * @return PromiseInterface - * - * @deprecated each will be removed in guzzlehttp/promises:2.0. Use Each::of instead. - */ -function each( - $iterable, - callable $onFulfilled = null, - callable $onRejected = null -) { - return Each::of($iterable, $onFulfilled, $onRejected); -} - -/** - * Like each, but only allows a certain number of outstanding promises at any - * given time. - * - * $concurrency may be an integer or a function that accepts the number of - * pending promises and returns a numeric concurrency limit value to allow for - * dynamic a concurrency size. - * - * @param mixed $iterable - * @param int|callable $concurrency - * @param callable $onFulfilled - * @param callable $onRejected - * - * @return PromiseInterface - * - * @deprecated each_limit will be removed in guzzlehttp/promises:2.0. Use Each::ofLimit instead. - */ -function each_limit( - $iterable, - $concurrency, - callable $onFulfilled = null, - callable $onRejected = null -) { - return Each::ofLimit($iterable, $concurrency, $onFulfilled, $onRejected); -} - -/** - * Like each_limit, but ensures that no promise in the given $iterable argument - * is rejected. If any promise is rejected, then the aggregate promise is - * rejected with the encountered rejection. - * - * @param mixed $iterable - * @param int|callable $concurrency - * @param callable $onFulfilled - * - * @return PromiseInterface - * - * @deprecated each_limit_all will be removed in guzzlehttp/promises:2.0. Use Each::ofLimitAll instead. - */ -function each_limit_all( - $iterable, - $concurrency, - callable $onFulfilled = null -) { - return Each::ofLimitAll($iterable, $concurrency, $onFulfilled); -} - -/** - * Returns true if a promise is fulfilled. - * - * @return bool - * - * @deprecated is_fulfilled will be removed in guzzlehttp/promises:2.0. Use Is::fulfilled instead. - */ -function is_fulfilled(PromiseInterface $promise) -{ - return Is::fulfilled($promise); -} - -/** - * Returns true if a promise is rejected. - * - * @return bool - * - * @deprecated is_rejected will be removed in guzzlehttp/promises:2.0. Use Is::rejected instead. - */ -function is_rejected(PromiseInterface $promise) -{ - return Is::rejected($promise); -} - -/** - * Returns true if a promise is fulfilled or rejected. - * - * @return bool - * - * @deprecated is_settled will be removed in guzzlehttp/promises:2.0. Use Is::settled instead. - */ -function is_settled(PromiseInterface $promise) -{ - return Is::settled($promise); -} - -/** - * Create a new coroutine. - * - * @see Coroutine - * - * @return PromiseInterface - * - * @deprecated coroutine will be removed in guzzlehttp/promises:2.0. Use Coroutine::of instead. - */ -function coroutine(callable $generatorFn) -{ - return Coroutine::of($generatorFn); -} diff --git a/vendor/guzzlehttp/promises/src/functions_include.php b/vendor/guzzlehttp/promises/src/functions_include.php deleted file mode 100644 index 34cd171..0000000 --- a/vendor/guzzlehttp/promises/src/functions_include.php +++ /dev/null @@ -1,6 +0,0 @@ -withPath('foo')->withHost('example.com')` will throw an exception - because the path of a URI with an authority must start with a slash "/" or be empty - - `(new Uri())->withScheme('http')` will return `'http://localhost'` - -### Deprecated - -- `Uri::resolve` in favor of `UriResolver::resolve` -- `Uri::removeDotSegments` in favor of `UriResolver::removeDotSegments` - -### Fixed - -- `Stream::read` when length parameter <= 0. -- `copy_to_stream` reads bytes in chunks instead of `maxLen` into memory. -- `ServerRequest::getUriFromGlobals` when `Host` header contains port. -- Compatibility of URIs with `file` scheme and empty host. - - -## [1.3.1] - 2016-06-25 - -### Fixed - -- `Uri::__toString` for network path references, e.g. `//example.org`. -- Missing lowercase normalization for host. -- Handling of URI components in case they are `'0'` in a lot of places, - e.g. as a user info password. -- `Uri::withAddedHeader` to correctly merge headers with different case. -- Trimming of header values in `Uri::withAddedHeader`. Header values may - be surrounded by whitespace which should be ignored according to RFC 7230 - Section 3.2.4. This does not apply to header names. -- `Uri::withAddedHeader` with an array of header values. -- `Uri::resolve` when base path has no slash and handling of fragment. -- Handling of encoding in `Uri::with(out)QueryValue` so one can pass the - key/value both in encoded as well as decoded form to those methods. This is - consistent with withPath, withQuery etc. -- `ServerRequest::withoutAttribute` when attribute value is null. - - -## [1.3.0] - 2016-04-13 - -### Added - -- Remaining interfaces needed for full PSR7 compatibility - (ServerRequestInterface, UploadedFileInterface, etc.). -- Support for stream_for from scalars. - -### Changed - -- Can now extend Uri. - -### Fixed -- A bug in validating request methods by making it more permissive. - - -## [1.2.3] - 2016-02-18 - -### Fixed - -- Support in `GuzzleHttp\Psr7\CachingStream` for seeking forward on remote - streams, which can sometimes return fewer bytes than requested with `fread`. -- Handling of gzipped responses with FNAME headers. - - -## [1.2.2] - 2016-01-22 - -### Added - -- Support for URIs without any authority. -- Support for HTTP 451 'Unavailable For Legal Reasons.' -- Support for using '0' as a filename. -- Support for including non-standard ports in Host headers. - - -## [1.2.1] - 2015-11-02 - -### Changes - -- Now supporting negative offsets when seeking to SEEK_END. - - -## [1.2.0] - 2015-08-15 - -### Changed - -- Body as `"0"` is now properly added to a response. -- Now allowing forward seeking in CachingStream. -- Now properly parsing HTTP requests that contain proxy targets in - `parse_request`. -- functions.php is now conditionally required. -- user-info is no longer dropped when resolving URIs. - - -## [1.1.0] - 2015-06-24 - -### Changed - -- URIs can now be relative. -- `multipart/form-data` headers are now overridden case-insensitively. -- URI paths no longer encode the following characters because they are allowed - in URIs: "(", ")", "*", "!", "'" -- A port is no longer added to a URI when the scheme is missing and no port is - present. - - -## 1.0.0 - 2015-05-19 - -Initial release. - -Currently unsupported: - -- `Psr\Http\Message\ServerRequestInterface` -- `Psr\Http\Message\UploadedFileInterface` - - - -[1.6.0]: https://github.com/guzzle/psr7/compare/1.5.2...1.6.0 -[1.5.2]: https://github.com/guzzle/psr7/compare/1.5.1...1.5.2 -[1.5.1]: https://github.com/guzzle/psr7/compare/1.5.0...1.5.1 -[1.5.0]: https://github.com/guzzle/psr7/compare/1.4.2...1.5.0 -[1.4.2]: https://github.com/guzzle/psr7/compare/1.4.1...1.4.2 -[1.4.1]: https://github.com/guzzle/psr7/compare/1.4.0...1.4.1 -[1.4.0]: https://github.com/guzzle/psr7/compare/1.3.1...1.4.0 -[1.3.1]: https://github.com/guzzle/psr7/compare/1.3.0...1.3.1 -[1.3.0]: https://github.com/guzzle/psr7/compare/1.2.3...1.3.0 -[1.2.3]: https://github.com/guzzle/psr7/compare/1.2.2...1.2.3 -[1.2.2]: https://github.com/guzzle/psr7/compare/1.2.1...1.2.2 -[1.2.1]: https://github.com/guzzle/psr7/compare/1.2.0...1.2.1 -[1.2.0]: https://github.com/guzzle/psr7/compare/1.1.0...1.2.0 -[1.1.0]: https://github.com/guzzle/psr7/compare/1.0.0...1.1.0 diff --git a/vendor/guzzlehttp/psr7/LICENSE b/vendor/guzzlehttp/psr7/LICENSE deleted file mode 100644 index 51c7ec8..0000000 --- a/vendor/guzzlehttp/psr7/LICENSE +++ /dev/null @@ -1,26 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Michael Dowling -Copyright (c) 2015 Márk Sági-Kazár -Copyright (c) 2015 Graham Campbell -Copyright (c) 2016 Tobias Schultze -Copyright (c) 2016 George Mponos -Copyright (c) 2018 Tobias Nyholm - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/guzzlehttp/psr7/README.md b/vendor/guzzlehttp/psr7/README.md deleted file mode 100644 index ed81c92..0000000 --- a/vendor/guzzlehttp/psr7/README.md +++ /dev/null @@ -1,823 +0,0 @@ -# PSR-7 Message Implementation - -This repository contains a full [PSR-7](http://www.php-fig.org/psr/psr-7/) -message implementation, several stream decorators, and some helpful -functionality like query string parsing. - -![CI](https://github.com/guzzle/psr7/workflows/CI/badge.svg) -![Static analysis](https://github.com/guzzle/psr7/workflows/Static%20analysis/badge.svg) - - -# Stream implementation - -This package comes with a number of stream implementations and stream -decorators. - - -## AppendStream - -`GuzzleHttp\Psr7\AppendStream` - -Reads from multiple streams, one after the other. - -```php -use GuzzleHttp\Psr7; - -$a = Psr7\Utils::streamFor('abc, '); -$b = Psr7\Utils::streamFor('123.'); -$composed = new Psr7\AppendStream([$a, $b]); - -$composed->addStream(Psr7\Utils::streamFor(' Above all listen to me')); - -echo $composed; // abc, 123. Above all listen to me. -``` - - -## BufferStream - -`GuzzleHttp\Psr7\BufferStream` - -Provides a buffer stream that can be written to fill a buffer, and read -from to remove bytes from the buffer. - -This stream returns a "hwm" metadata value that tells upstream consumers -what the configured high water mark of the stream is, or the maximum -preferred size of the buffer. - -```php -use GuzzleHttp\Psr7; - -// When more than 1024 bytes are in the buffer, it will begin returning -// false to writes. This is an indication that writers should slow down. -$buffer = new Psr7\BufferStream(1024); -``` - - -## CachingStream - -The CachingStream is used to allow seeking over previously read bytes on -non-seekable streams. This can be useful when transferring a non-seekable -entity body fails due to needing to rewind the stream (for example, resulting -from a redirect). Data that is read from the remote stream will be buffered in -a PHP temp stream so that previously read bytes are cached first in memory, -then on disk. - -```php -use GuzzleHttp\Psr7; - -$original = Psr7\Utils::streamFor(fopen('http://www.google.com', 'r')); -$stream = new Psr7\CachingStream($original); - -$stream->read(1024); -echo $stream->tell(); -// 1024 - -$stream->seek(0); -echo $stream->tell(); -// 0 -``` - - -## DroppingStream - -`GuzzleHttp\Psr7\DroppingStream` - -Stream decorator that begins dropping data once the size of the underlying -stream becomes too full. - -```php -use GuzzleHttp\Psr7; - -// Create an empty stream -$stream = Psr7\Utils::streamFor(); - -// Start dropping data when the stream has more than 10 bytes -$dropping = new Psr7\DroppingStream($stream, 10); - -$dropping->write('01234567890123456789'); -echo $stream; // 0123456789 -``` - - -## FnStream - -`GuzzleHttp\Psr7\FnStream` - -Compose stream implementations based on a hash of functions. - -Allows for easy testing and extension of a provided stream without needing -to create a concrete class for a simple extension point. - -```php - -use GuzzleHttp\Psr7; - -$stream = Psr7\Utils::streamFor('hi'); -$fnStream = Psr7\FnStream::decorate($stream, [ - 'rewind' => function () use ($stream) { - echo 'About to rewind - '; - $stream->rewind(); - echo 'rewound!'; - } -]); - -$fnStream->rewind(); -// Outputs: About to rewind - rewound! -``` - - -## InflateStream - -`GuzzleHttp\Psr7\InflateStream` - -Uses PHP's zlib.inflate filter to inflate zlib (HTTP deflate, RFC1950) or gzipped (RFC1952) content. - -This stream decorator converts the provided stream to a PHP stream resource, -then appends the zlib.inflate filter. The stream is then converted back -to a Guzzle stream resource to be used as a Guzzle stream. - - -## LazyOpenStream - -`GuzzleHttp\Psr7\LazyOpenStream` - -Lazily reads or writes to a file that is opened only after an IO operation -take place on the stream. - -```php -use GuzzleHttp\Psr7; - -$stream = new Psr7\LazyOpenStream('/path/to/file', 'r'); -// The file has not yet been opened... - -echo $stream->read(10); -// The file is opened and read from only when needed. -``` - - -## LimitStream - -`GuzzleHttp\Psr7\LimitStream` - -LimitStream can be used to read a subset or slice of an existing stream object. -This can be useful for breaking a large file into smaller pieces to be sent in -chunks (e.g. Amazon S3's multipart upload API). - -```php -use GuzzleHttp\Psr7; - -$original = Psr7\Utils::streamFor(fopen('/tmp/test.txt', 'r+')); -echo $original->getSize(); -// >>> 1048576 - -// Limit the size of the body to 1024 bytes and start reading from byte 2048 -$stream = new Psr7\LimitStream($original, 1024, 2048); -echo $stream->getSize(); -// >>> 1024 -echo $stream->tell(); -// >>> 0 -``` - - -## MultipartStream - -`GuzzleHttp\Psr7\MultipartStream` - -Stream that when read returns bytes for a streaming multipart or -multipart/form-data stream. - - -## NoSeekStream - -`GuzzleHttp\Psr7\NoSeekStream` - -NoSeekStream wraps a stream and does not allow seeking. - -```php -use GuzzleHttp\Psr7; - -$original = Psr7\Utils::streamFor('foo'); -$noSeek = new Psr7\NoSeekStream($original); - -echo $noSeek->read(3); -// foo -var_export($noSeek->isSeekable()); -// false -$noSeek->seek(0); -var_export($noSeek->read(3)); -// NULL -``` - - -## PumpStream - -`GuzzleHttp\Psr7\PumpStream` - -Provides a read only stream that pumps data from a PHP callable. - -When invoking the provided callable, the PumpStream will pass the amount of -data requested to read to the callable. The callable can choose to ignore -this value and return fewer or more bytes than requested. Any extra data -returned by the provided callable is buffered internally until drained using -the read() function of the PumpStream. The provided callable MUST return -false when there is no more data to read. - - -## Implementing stream decorators - -Creating a stream decorator is very easy thanks to the -`GuzzleHttp\Psr7\StreamDecoratorTrait`. This trait provides methods that -implement `Psr\Http\Message\StreamInterface` by proxying to an underlying -stream. Just `use` the `StreamDecoratorTrait` and implement your custom -methods. - -For example, let's say we wanted to call a specific function each time the last -byte is read from a stream. This could be implemented by overriding the -`read()` method. - -```php -use Psr\Http\Message\StreamInterface; -use GuzzleHttp\Psr7\StreamDecoratorTrait; - -class EofCallbackStream implements StreamInterface -{ - use StreamDecoratorTrait; - - private $callback; - - public function __construct(StreamInterface $stream, callable $cb) - { - $this->stream = $stream; - $this->callback = $cb; - } - - public function read($length) - { - $result = $this->stream->read($length); - - // Invoke the callback when EOF is hit. - if ($this->eof()) { - call_user_func($this->callback); - } - - return $result; - } -} -``` - -This decorator could be added to any existing stream and used like so: - -```php -use GuzzleHttp\Psr7; - -$original = Psr7\Utils::streamFor('foo'); - -$eofStream = new EofCallbackStream($original, function () { - echo 'EOF!'; -}); - -$eofStream->read(2); -$eofStream->read(1); -// echoes "EOF!" -$eofStream->seek(0); -$eofStream->read(3); -// echoes "EOF!" -``` - - -## PHP StreamWrapper - -You can use the `GuzzleHttp\Psr7\StreamWrapper` class if you need to use a -PSR-7 stream as a PHP stream resource. - -Use the `GuzzleHttp\Psr7\StreamWrapper::getResource()` method to create a PHP -stream from a PSR-7 stream. - -```php -use GuzzleHttp\Psr7\StreamWrapper; - -$stream = GuzzleHttp\Psr7\Utils::streamFor('hello!'); -$resource = StreamWrapper::getResource($stream); -echo fread($resource, 6); // outputs hello! -``` - - -# Static API - -There are various static methods available under the `GuzzleHttp\Psr7` namespace. - - -## `GuzzleHttp\Psr7\Message::toString` - -`public static function toString(MessageInterface $message): string` - -Returns the string representation of an HTTP message. - -```php -$request = new GuzzleHttp\Psr7\Request('GET', 'http://example.com'); -echo GuzzleHttp\Psr7\Message::toString($request); -``` - - -## `GuzzleHttp\Psr7\Message::bodySummary` - -`public static function bodySummary(MessageInterface $message, int $truncateAt = 120): string|null` - -Get a short summary of the message body. - -Will return `null` if the response is not printable. - - -## `GuzzleHttp\Psr7\Message::rewindBody` - -`public static function rewindBody(MessageInterface $message): void` - -Attempts to rewind a message body and throws an exception on failure. - -The body of the message will only be rewound if a call to `tell()` -returns a value other than `0`. - - -## `GuzzleHttp\Psr7\Message::parseMessage` - -`public static function parseMessage(string $message): array` - -Parses an HTTP message into an associative array. - -The array contains the "start-line" key containing the start line of -the message, "headers" key containing an associative array of header -array values, and a "body" key containing the body of the message. - - -## `GuzzleHttp\Psr7\Message::parseRequestUri` - -`public static function parseRequestUri(string $path, array $headers): string` - -Constructs a URI for an HTTP request message. - - -## `GuzzleHttp\Psr7\Message::parseRequest` - -`public static function parseRequest(string $message): Request` - -Parses a request message string into a request object. - - -## `GuzzleHttp\Psr7\Message::parseResponse` - -`public static function parseResponse(string $message): Response` - -Parses a response message string into a response object. - - -## `GuzzleHttp\Psr7\Header::parse` - -`public static function parse(string|array $header): array` - -Parse an array of header values containing ";" separated data into an -array of associative arrays representing the header key value pair data -of the header. When a parameter does not contain a value, but just -contains a key, this function will inject a key with a '' string value. - - -## `GuzzleHttp\Psr7\Header::normalize` - -`public static function normalize(string|array $header): array` - -Converts an array of header values that may contain comma separated -headers into an array of headers with no comma separated values. - - -## `GuzzleHttp\Psr7\Query::parse` - -`public static function parse(string $str, int|bool $urlEncoding = true): array` - -Parse a query string into an associative array. - -If multiple values are found for the same key, the value of that key -value pair will become an array. This function does not parse nested -PHP style arrays into an associative array (e.g., `foo[a]=1&foo[b]=2` -will be parsed into `['foo[a]' => '1', 'foo[b]' => '2'])`. - - -## `GuzzleHttp\Psr7\Query::build` - -`public static function build(array $params, int|false $encoding = PHP_QUERY_RFC3986): string` - -Build a query string from an array of key value pairs. - -This function can use the return value of `parse()` to build a query -string. This function does not modify the provided keys when an array is -encountered (like `http_build_query()` would). - - -## `GuzzleHttp\Psr7\Utils::caselessRemove` - -`public static function caselessRemove(iterable $keys, $keys, array $data): array` - -Remove the items given by the keys, case insensitively from the data. - - -## `GuzzleHttp\Psr7\Utils::copyToStream` - -`public static function copyToStream(StreamInterface $source, StreamInterface $dest, int $maxLen = -1): void` - -Copy the contents of a stream into another stream until the given number -of bytes have been read. - - -## `GuzzleHttp\Psr7\Utils::copyToString` - -`public static function copyToString(StreamInterface $stream, int $maxLen = -1): string` - -Copy the contents of a stream into a string until the given number of -bytes have been read. - - -## `GuzzleHttp\Psr7\Utils::hash` - -`public static function hash(StreamInterface $stream, string $algo, bool $rawOutput = false): string` - -Calculate a hash of a stream. - -This method reads the entire stream to calculate a rolling hash, based on -PHP's `hash_init` functions. - - -## `GuzzleHttp\Psr7\Utils::modifyRequest` - -`public static function modifyRequest(RequestInterface $request, array $changes): RequestInterface` - -Clone and modify a request with the given changes. - -This method is useful for reducing the number of clones needed to mutate -a message. - -- method: (string) Changes the HTTP method. -- set_headers: (array) Sets the given headers. -- remove_headers: (array) Remove the given headers. -- body: (mixed) Sets the given body. -- uri: (UriInterface) Set the URI. -- query: (string) Set the query string value of the URI. -- version: (string) Set the protocol version. - - -## `GuzzleHttp\Psr7\Utils::readLine` - -`public static function readLine(StreamInterface $stream, int $maxLength = null): string` - -Read a line from the stream up to the maximum allowed buffer length. - - -## `GuzzleHttp\Psr7\Utils::streamFor` - -`public static function streamFor(resource|string|null|int|float|bool|StreamInterface|callable|\Iterator $resource = '', array $options = []): StreamInterface` - -Create a new stream based on the input type. - -Options is an associative array that can contain the following keys: - -- metadata: Array of custom metadata. -- size: Size of the stream. - -This method accepts the following `$resource` types: - -- `Psr\Http\Message\StreamInterface`: Returns the value as-is. -- `string`: Creates a stream object that uses the given string as the contents. -- `resource`: Creates a stream object that wraps the given PHP stream resource. -- `Iterator`: If the provided value implements `Iterator`, then a read-only - stream object will be created that wraps the given iterable. Each time the - stream is read from, data from the iterator will fill a buffer and will be - continuously called until the buffer is equal to the requested read size. - Subsequent read calls will first read from the buffer and then call `next` - on the underlying iterator until it is exhausted. -- `object` with `__toString()`: If the object has the `__toString()` method, - the object will be cast to a string and then a stream will be returned that - uses the string value. -- `NULL`: When `null` is passed, an empty stream object is returned. -- `callable` When a callable is passed, a read-only stream object will be - created that invokes the given callable. The callable is invoked with the - number of suggested bytes to read. The callable can return any number of - bytes, but MUST return `false` when there is no more data to return. The - stream object that wraps the callable will invoke the callable until the - number of requested bytes are available. Any additional bytes will be - buffered and used in subsequent reads. - -```php -$stream = GuzzleHttp\Psr7\Utils::streamFor('foo'); -$stream = GuzzleHttp\Psr7\Utils::streamFor(fopen('/path/to/file', 'r')); - -$generator = function ($bytes) { - for ($i = 0; $i < $bytes; $i++) { - yield ' '; - } -} - -$stream = GuzzleHttp\Psr7\Utils::streamFor($generator(100)); -``` - - -## `GuzzleHttp\Psr7\Utils::tryFopen` - -`public static function tryFopen(string $filename, string $mode): resource` - -Safely opens a PHP stream resource using a filename. - -When fopen fails, PHP normally raises a warning. This function adds an -error handler that checks for errors and throws an exception instead. - - -## `GuzzleHttp\Psr7\Utils::uriFor` - -`public static function uriFor(string|UriInterface $uri): UriInterface` - -Returns a UriInterface for the given value. - -This function accepts a string or UriInterface and returns a -UriInterface for the given value. If the value is already a -UriInterface, it is returned as-is. - - -## `GuzzleHttp\Psr7\MimeType::fromFilename` - -`public static function fromFilename(string $filename): string|null` - -Determines the mimetype of a file by looking at its extension. - - -## `GuzzleHttp\Psr7\MimeType::fromExtension` - -`public static function fromExtension(string $extension): string|null` - -Maps a file extensions to a mimetype. - - -## Upgrading from Function API - -The static API was first introduced in 1.7.0, in order to mitigate problems with functions conflicting between global and local copies of the package. The function API was removed in 2.0.0. A migration table has been provided here for your convenience: - -| Original Function | Replacement Method | -|----------------|----------------| -| `str` | `Message::toString` | -| `uri_for` | `Utils::uriFor` | -| `stream_for` | `Utils::streamFor` | -| `parse_header` | `Header::parse` | -| `normalize_header` | `Header::normalize` | -| `modify_request` | `Utils::modifyRequest` | -| `rewind_body` | `Message::rewindBody` | -| `try_fopen` | `Utils::tryFopen` | -| `copy_to_string` | `Utils::copyToString` | -| `copy_to_stream` | `Utils::copyToStream` | -| `hash` | `Utils::hash` | -| `readline` | `Utils::readLine` | -| `parse_request` | `Message::parseRequest` | -| `parse_response` | `Message::parseResponse` | -| `parse_query` | `Query::parse` | -| `build_query` | `Query::build` | -| `mimetype_from_filename` | `MimeType::fromFilename` | -| `mimetype_from_extension` | `MimeType::fromExtension` | -| `_parse_message` | `Message::parseMessage` | -| `_parse_request_uri` | `Message::parseRequestUri` | -| `get_message_body_summary` | `Message::bodySummary` | -| `_caseless_remove` | `Utils::caselessRemove` | - - -# Additional URI Methods - -Aside from the standard `Psr\Http\Message\UriInterface` implementation in form of the `GuzzleHttp\Psr7\Uri` class, -this library also provides additional functionality when working with URIs as static methods. - -## URI Types - -An instance of `Psr\Http\Message\UriInterface` can either be an absolute URI or a relative reference. -An absolute URI has a scheme. A relative reference is used to express a URI relative to another URI, -the base URI. Relative references can be divided into several forms according to -[RFC 3986 Section 4.2](https://tools.ietf.org/html/rfc3986#section-4.2): - -- network-path references, e.g. `//example.com/path` -- absolute-path references, e.g. `/path` -- relative-path references, e.g. `subpath` - -The following methods can be used to identify the type of the URI. - -### `GuzzleHttp\Psr7\Uri::isAbsolute` - -`public static function isAbsolute(UriInterface $uri): bool` - -Whether the URI is absolute, i.e. it has a scheme. - -### `GuzzleHttp\Psr7\Uri::isNetworkPathReference` - -`public static function isNetworkPathReference(UriInterface $uri): bool` - -Whether the URI is a network-path reference. A relative reference that begins with two slash characters is -termed an network-path reference. - -### `GuzzleHttp\Psr7\Uri::isAbsolutePathReference` - -`public static function isAbsolutePathReference(UriInterface $uri): bool` - -Whether the URI is a absolute-path reference. A relative reference that begins with a single slash character is -termed an absolute-path reference. - -### `GuzzleHttp\Psr7\Uri::isRelativePathReference` - -`public static function isRelativePathReference(UriInterface $uri): bool` - -Whether the URI is a relative-path reference. A relative reference that does not begin with a slash character is -termed a relative-path reference. - -### `GuzzleHttp\Psr7\Uri::isSameDocumentReference` - -`public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = null): bool` - -Whether the URI is a same-document reference. A same-document reference refers to a URI that is, aside from its -fragment component, identical to the base URI. When no base URI is given, only an empty URI reference -(apart from its fragment) is considered a same-document reference. - -## URI Components - -Additional methods to work with URI components. - -### `GuzzleHttp\Psr7\Uri::isDefaultPort` - -`public static function isDefaultPort(UriInterface $uri): bool` - -Whether the URI has the default port of the current scheme. `Psr\Http\Message\UriInterface::getPort` may return null -or the standard port. This method can be used independently of the implementation. - -### `GuzzleHttp\Psr7\Uri::composeComponents` - -`public static function composeComponents($scheme, $authority, $path, $query, $fragment): string` - -Composes a URI reference string from its various components according to -[RFC 3986 Section 5.3](https://tools.ietf.org/html/rfc3986#section-5.3). Usually this method does not need to be called -manually but instead is used indirectly via `Psr\Http\Message\UriInterface::__toString`. - -### `GuzzleHttp\Psr7\Uri::fromParts` - -`public static function fromParts(array $parts): UriInterface` - -Creates a URI from a hash of [`parse_url`](http://php.net/manual/en/function.parse-url.php) components. - - -### `GuzzleHttp\Psr7\Uri::withQueryValue` - -`public static function withQueryValue(UriInterface $uri, $key, $value): UriInterface` - -Creates a new URI with a specific query string value. Any existing query string values that exactly match the -provided key are removed and replaced with the given key value pair. A value of null will set the query string -key without a value, e.g. "key" instead of "key=value". - -### `GuzzleHttp\Psr7\Uri::withQueryValues` - -`public static function withQueryValues(UriInterface $uri, array $keyValueArray): UriInterface` - -Creates a new URI with multiple query string values. It has the same behavior as `withQueryValue()` but for an -associative array of key => value. - -### `GuzzleHttp\Psr7\Uri::withoutQueryValue` - -`public static function withoutQueryValue(UriInterface $uri, $key): UriInterface` - -Creates a new URI with a specific query string value removed. Any existing query string values that exactly match the -provided key are removed. - -## Reference Resolution - -`GuzzleHttp\Psr7\UriResolver` provides methods to resolve a URI reference in the context of a base URI according -to [RFC 3986 Section 5](https://tools.ietf.org/html/rfc3986#section-5). This is for example also what web browsers -do when resolving a link in a website based on the current request URI. - -### `GuzzleHttp\Psr7\UriResolver::resolve` - -`public static function resolve(UriInterface $base, UriInterface $rel): UriInterface` - -Converts the relative URI into a new URI that is resolved against the base URI. - -### `GuzzleHttp\Psr7\UriResolver::removeDotSegments` - -`public static function removeDotSegments(string $path): string` - -Removes dot segments from a path and returns the new path according to -[RFC 3986 Section 5.2.4](https://tools.ietf.org/html/rfc3986#section-5.2.4). - -### `GuzzleHttp\Psr7\UriResolver::relativize` - -`public static function relativize(UriInterface $base, UriInterface $target): UriInterface` - -Returns the target URI as a relative reference from the base URI. This method is the counterpart to resolve(): - -```php -(string) $target === (string) UriResolver::resolve($base, UriResolver::relativize($base, $target)) -``` - -One use-case is to use the current request URI as base URI and then generate relative links in your documents -to reduce the document size or offer self-contained downloadable document archives. - -```php -$base = new Uri('http://example.com/a/b/'); -echo UriResolver::relativize($base, new Uri('http://example.com/a/b/c')); // prints 'c'. -echo UriResolver::relativize($base, new Uri('http://example.com/a/x/y')); // prints '../x/y'. -echo UriResolver::relativize($base, new Uri('http://example.com/a/b/?q')); // prints '?q'. -echo UriResolver::relativize($base, new Uri('http://example.org/a/b/')); // prints '//example.org/a/b/'. -``` - -## Normalization and Comparison - -`GuzzleHttp\Psr7\UriNormalizer` provides methods to normalize and compare URIs according to -[RFC 3986 Section 6](https://tools.ietf.org/html/rfc3986#section-6). - -### `GuzzleHttp\Psr7\UriNormalizer::normalize` - -`public static function normalize(UriInterface $uri, $flags = self::PRESERVING_NORMALIZATIONS): UriInterface` - -Returns a normalized URI. The scheme and host component are already normalized to lowercase per PSR-7 UriInterface. -This methods adds additional normalizations that can be configured with the `$flags` parameter which is a bitmask -of normalizations to apply. The following normalizations are available: - -- `UriNormalizer::PRESERVING_NORMALIZATIONS` - - Default normalizations which only include the ones that preserve semantics. - -- `UriNormalizer::CAPITALIZE_PERCENT_ENCODING` - - All letters within a percent-encoding triplet (e.g., "%3A") are case-insensitive, and should be capitalized. - - Example: `http://example.org/a%c2%b1b` → `http://example.org/a%C2%B1b` - -- `UriNormalizer::DECODE_UNRESERVED_CHARACTERS` - - Decodes percent-encoded octets of unreserved characters. For consistency, percent-encoded octets in the ranges of - ALPHA (%41–%5A and %61–%7A), DIGIT (%30–%39), hyphen (%2D), period (%2E), underscore (%5F), or tilde (%7E) should - not be created by URI producers and, when found in a URI, should be decoded to their corresponding unreserved - characters by URI normalizers. - - Example: `http://example.org/%7Eusern%61me/` → `http://example.org/~username/` - -- `UriNormalizer::CONVERT_EMPTY_PATH` - - Converts the empty path to "/" for http and https URIs. - - Example: `http://example.org` → `http://example.org/` - -- `UriNormalizer::REMOVE_DEFAULT_HOST` - - Removes the default host of the given URI scheme from the URI. Only the "file" scheme defines the default host - "localhost". All of `file:/myfile`, `file:///myfile`, and `file://localhost/myfile` are equivalent according to - RFC 3986. - - Example: `file://localhost/myfile` → `file:///myfile` - -- `UriNormalizer::REMOVE_DEFAULT_PORT` - - Removes the default port of the given URI scheme from the URI. - - Example: `http://example.org:80/` → `http://example.org/` - -- `UriNormalizer::REMOVE_DOT_SEGMENTS` - - Removes unnecessary dot-segments. Dot-segments in relative-path references are not removed as it would - change the semantics of the URI reference. - - Example: `http://example.org/../a/b/../c/./d.html` → `http://example.org/a/c/d.html` - -- `UriNormalizer::REMOVE_DUPLICATE_SLASHES` - - Paths which include two or more adjacent slashes are converted to one. Webservers usually ignore duplicate slashes - and treat those URIs equivalent. But in theory those URIs do not need to be equivalent. So this normalization - may change the semantics. Encoded slashes (%2F) are not removed. - - Example: `http://example.org//foo///bar.html` → `http://example.org/foo/bar.html` - -- `UriNormalizer::SORT_QUERY_PARAMETERS` - - Sort query parameters with their values in alphabetical order. However, the order of parameters in a URI may be - significant (this is not defined by the standard). So this normalization is not safe and may change the semantics - of the URI. - - Example: `?lang=en&article=fred` → `?article=fred&lang=en` - -### `GuzzleHttp\Psr7\UriNormalizer::isEquivalent` - -`public static function isEquivalent(UriInterface $uri1, UriInterface $uri2, $normalizations = self::PRESERVING_NORMALIZATIONS): bool` - -Whether two URIs can be considered equivalent. Both URIs are normalized automatically before comparison with the given -`$normalizations` bitmask. The method also accepts relative URI references and returns true when they are equivalent. -This of course assumes they will be resolved against the same base URI. If this is not the case, determination of -equivalence or difference of relative references does not mean anything. - - -## Security - -If you discover a security vulnerability within this package, please send an email to security@tidelift.com. All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced. Please see [Security Policy](https://github.com/guzzle/psr7/security/policy) for more information. - -## License - -Guzzle is made available under the MIT License (MIT). Please see [License File](LICENSE) for more information. - -## For Enterprise - -Available as part of the Tidelift Subscription - -The maintainers of Guzzle and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-guzzlehttp-psr7?utm_source=packagist-guzzlehttp-psr7&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/vendor/guzzlehttp/psr7/composer.json b/vendor/guzzlehttp/psr7/composer.json deleted file mode 100644 index 885aa1d..0000000 --- a/vendor/guzzlehttp/psr7/composer.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "name": "guzzlehttp/psr7", - "description": "PSR-7 message implementation that also provides common utility methods", - "keywords": [ - "request", - "response", - "message", - "stream", - "http", - "uri", - "url", - "psr-7" - ], - "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" - } - ], - "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" - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "GuzzleHttp\\Tests\\Psr7\\": "tests/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, - "config": { - "preferred-install": "dist", - "sort-packages": true - } -} diff --git a/vendor/guzzlehttp/psr7/src/AppendStream.php b/vendor/guzzlehttp/psr7/src/AppendStream.php deleted file mode 100644 index 967925f..0000000 --- a/vendor/guzzlehttp/psr7/src/AppendStream.php +++ /dev/null @@ -1,249 +0,0 @@ -addStream($stream); - } - } - - public function __toString(): string - { - try { - $this->rewind(); - return $this->getContents(); - } catch (\Throwable $e) { - if (\PHP_VERSION_ID >= 70400) { - throw $e; - } - trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR); - return ''; - } - } - - /** - * Add a stream to the AppendStream - * - * @param StreamInterface $stream Stream to append. Must be readable. - * - * @throws \InvalidArgumentException if the stream is not readable - */ - public function addStream(StreamInterface $stream): void - { - if (!$stream->isReadable()) { - throw new \InvalidArgumentException('Each stream must be readable'); - } - - // The stream is only seekable if all streams are seekable - if (!$stream->isSeekable()) { - $this->seekable = false; - } - - $this->streams[] = $stream; - } - - public function getContents(): string - { - return Utils::copyToString($this); - } - - /** - * Closes each attached stream. - */ - public function close(): void - { - $this->pos = $this->current = 0; - $this->seekable = true; - - foreach ($this->streams as $stream) { - $stream->close(); - } - - $this->streams = []; - } - - /** - * Detaches each attached stream. - * - * Returns null as it's not clear which underlying stream resource to return. - */ - public function detach() - { - $this->pos = $this->current = 0; - $this->seekable = true; - - foreach ($this->streams as $stream) { - $stream->detach(); - } - - $this->streams = []; - - return null; - } - - public function tell(): int - { - return $this->pos; - } - - /** - * Tries to calculate the size by adding the size of each stream. - * - * If any of the streams do not return a valid number, then the size of the - * append stream cannot be determined and null is returned. - */ - public function getSize(): ?int - { - $size = 0; - - foreach ($this->streams as $stream) { - $s = $stream->getSize(); - if ($s === null) { - return null; - } - $size += $s; - } - - return $size; - } - - public function eof(): bool - { - return !$this->streams || - ($this->current >= count($this->streams) - 1 && - $this->streams[$this->current]->eof()); - } - - public function rewind(): void - { - $this->seek(0); - } - - /** - * Attempts to seek to the given position. Only supports SEEK_SET. - */ - public function seek($offset, $whence = SEEK_SET): void - { - if (!$this->seekable) { - throw new \RuntimeException('This AppendStream is not seekable'); - } elseif ($whence !== SEEK_SET) { - throw new \RuntimeException('The AppendStream can only seek with SEEK_SET'); - } - - $this->pos = $this->current = 0; - - // Rewind each stream - foreach ($this->streams as $i => $stream) { - try { - $stream->rewind(); - } catch (\Exception $e) { - throw new \RuntimeException('Unable to seek stream ' - . $i . ' of the AppendStream', 0, $e); - } - } - - // Seek to the actual position by reading from each stream - while ($this->pos < $offset && !$this->eof()) { - $result = $this->read(min(8096, $offset - $this->pos)); - if ($result === '') { - break; - } - } - } - - /** - * Reads from all of the appended streams until the length is met or EOF. - */ - public function read($length): string - { - $buffer = ''; - $total = count($this->streams) - 1; - $remaining = $length; - $progressToNext = false; - - while ($remaining > 0) { - - // Progress to the next stream if needed. - if ($progressToNext || $this->streams[$this->current]->eof()) { - $progressToNext = false; - if ($this->current === $total) { - break; - } - $this->current++; - } - - $result = $this->streams[$this->current]->read($remaining); - - if ($result === '') { - $progressToNext = true; - continue; - } - - $buffer .= $result; - $remaining = $length - strlen($buffer); - } - - $this->pos += strlen($buffer); - - return $buffer; - } - - public function isReadable(): bool - { - return true; - } - - public function isWritable(): bool - { - return false; - } - - public function isSeekable(): bool - { - return $this->seekable; - } - - public function write($string): int - { - throw new \RuntimeException('Cannot write to an AppendStream'); - } - - /** - * {@inheritdoc} - * - * @return mixed - */ - public function getMetadata($key = null) - { - return $key ? null : []; - } -} diff --git a/vendor/guzzlehttp/psr7/src/BufferStream.php b/vendor/guzzlehttp/psr7/src/BufferStream.php deleted file mode 100644 index 21be8c0..0000000 --- a/vendor/guzzlehttp/psr7/src/BufferStream.php +++ /dev/null @@ -1,149 +0,0 @@ -hwm = $hwm; - } - - public function __toString(): string - { - return $this->getContents(); - } - - public function getContents(): string - { - $buffer = $this->buffer; - $this->buffer = ''; - - return $buffer; - } - - public function close(): void - { - $this->buffer = ''; - } - - public function detach() - { - $this->close(); - - return null; - } - - public function getSize(): ?int - { - return strlen($this->buffer); - } - - public function isReadable(): bool - { - return true; - } - - public function isWritable(): bool - { - return true; - } - - public function isSeekable(): bool - { - return false; - } - - public function rewind(): void - { - $this->seek(0); - } - - public function seek($offset, $whence = SEEK_SET): void - { - throw new \RuntimeException('Cannot seek a BufferStream'); - } - - public function eof(): bool - { - return strlen($this->buffer) === 0; - } - - public function tell(): int - { - throw new \RuntimeException('Cannot determine the position of a BufferStream'); - } - - /** - * Reads data from the buffer. - */ - public function read($length): string - { - $currentLength = strlen($this->buffer); - - if ($length >= $currentLength) { - // No need to slice the buffer because we don't have enough data. - $result = $this->buffer; - $this->buffer = ''; - } else { - // Slice up the result to provide a subset of the buffer. - $result = substr($this->buffer, 0, $length); - $this->buffer = substr($this->buffer, $length); - } - - return $result; - } - - /** - * Writes data to the buffer. - */ - public function write($string): int - { - $this->buffer .= $string; - - if (strlen($this->buffer) >= $this->hwm) { - return 0; - } - - return strlen($string); - } - - /** - * {@inheritdoc} - * - * @return mixed - */ - public function getMetadata($key = null) - { - if ($key === 'hwm') { - return $this->hwm; - } - - return $key ? null : []; - } -} diff --git a/vendor/guzzlehttp/psr7/src/CachingStream.php b/vendor/guzzlehttp/psr7/src/CachingStream.php deleted file mode 100644 index 7a70ee9..0000000 --- a/vendor/guzzlehttp/psr7/src/CachingStream.php +++ /dev/null @@ -1,148 +0,0 @@ -remoteStream = $stream; - $this->stream = $target ?: new Stream(Utils::tryFopen('php://temp', 'r+')); - } - - public function getSize(): ?int - { - $remoteSize = $this->remoteStream->getSize(); - - if (null === $remoteSize) { - return null; - } - - return max($this->stream->getSize(), $remoteSize); - } - - public function rewind(): void - { - $this->seek(0); - } - - public function seek($offset, $whence = SEEK_SET): void - { - if ($whence === SEEK_SET) { - $byte = $offset; - } elseif ($whence === SEEK_CUR) { - $byte = $offset + $this->tell(); - } elseif ($whence === SEEK_END) { - $size = $this->remoteStream->getSize(); - if ($size === null) { - $size = $this->cacheEntireStream(); - } - $byte = $size + $offset; - } else { - throw new \InvalidArgumentException('Invalid whence'); - } - - $diff = $byte - $this->stream->getSize(); - - if ($diff > 0) { - // Read the remoteStream until we have read in at least the amount - // of bytes requested, or we reach the end of the file. - while ($diff > 0 && !$this->remoteStream->eof()) { - $this->read($diff); - $diff = $byte - $this->stream->getSize(); - } - } else { - // We can just do a normal seek since we've already seen this byte. - $this->stream->seek($byte); - } - } - - public function read($length): string - { - // Perform a regular read on any previously read data from the buffer - $data = $this->stream->read($length); - $remaining = $length - strlen($data); - - // More data was requested so read from the remote stream - if ($remaining) { - // If data was written to the buffer in a position that would have - // been filled from the remote stream, then we must skip bytes on - // the remote stream to emulate overwriting bytes from that - // position. This mimics the behavior of other PHP stream wrappers. - $remoteData = $this->remoteStream->read( - $remaining + $this->skipReadBytes - ); - - if ($this->skipReadBytes) { - $len = strlen($remoteData); - $remoteData = substr($remoteData, $this->skipReadBytes); - $this->skipReadBytes = max(0, $this->skipReadBytes - $len); - } - - $data .= $remoteData; - $this->stream->write($remoteData); - } - - return $data; - } - - public function write($string): int - { - // When appending to the end of the currently read stream, you'll want - // to skip bytes from being read from the remote stream to emulate - // other stream wrappers. Basically replacing bytes of data of a fixed - // length. - $overflow = (strlen($string) + $this->tell()) - $this->remoteStream->tell(); - if ($overflow > 0) { - $this->skipReadBytes += $overflow; - } - - return $this->stream->write($string); - } - - public function eof(): bool - { - return $this->stream->eof() && $this->remoteStream->eof(); - } - - /** - * Close both the remote stream and buffer stream - */ - public function close(): void - { - $this->remoteStream->close(); - $this->stream->close(); - } - - private function cacheEntireStream(): int - { - $target = new FnStream(['write' => 'strlen']); - Utils::copyToStream($this, $target); - - return $this->tell(); - } -} diff --git a/vendor/guzzlehttp/psr7/src/DroppingStream.php b/vendor/guzzlehttp/psr7/src/DroppingStream.php deleted file mode 100644 index d78070a..0000000 --- a/vendor/guzzlehttp/psr7/src/DroppingStream.php +++ /dev/null @@ -1,46 +0,0 @@ -stream = $stream; - $this->maxLength = $maxLength; - } - - public function write($string): int - { - $diff = $this->maxLength - $this->stream->getSize(); - - // Begin returning 0 when the underlying stream is too large. - if ($diff <= 0) { - return 0; - } - - // Write the stream or a subset of the stream if needed. - if (strlen($string) < $diff) { - return $this->stream->write($string); - } - - return $this->stream->write(substr($string, 0, $diff)); - } -} diff --git a/vendor/guzzlehttp/psr7/src/Exception/MalformedUriException.php b/vendor/guzzlehttp/psr7/src/Exception/MalformedUriException.php deleted file mode 100644 index 3a08477..0000000 --- a/vendor/guzzlehttp/psr7/src/Exception/MalformedUriException.php +++ /dev/null @@ -1,14 +0,0 @@ - */ - private $methods; - - /** - * @param array $methods Hash of method name to a callable. - */ - public function __construct(array $methods) - { - $this->methods = $methods; - - // Create the functions on the class - foreach ($methods as $name => $fn) { - $this->{'_fn_' . $name} = $fn; - } - } - - /** - * Lazily determine which methods are not implemented. - * - * @throws \BadMethodCallException - */ - public function __get(string $name): void - { - throw new \BadMethodCallException(str_replace('_fn_', '', $name) - . '() is not implemented in the FnStream'); - } - - /** - * The close method is called on the underlying stream only if possible. - */ - public function __destruct() - { - if (isset($this->_fn_close)) { - call_user_func($this->_fn_close); - } - } - - /** - * An unserialize would allow the __destruct to run when the unserialized value goes out of scope. - * - * @throws \LogicException - */ - public function __wakeup(): void - { - throw new \LogicException('FnStream should never be unserialized'); - } - - /** - * Adds custom functionality to an underlying stream by intercepting - * specific method calls. - * - * @param StreamInterface $stream Stream to decorate - * @param array $methods Hash of method name to a closure - * - * @return FnStream - */ - public static function decorate(StreamInterface $stream, array $methods) - { - // If any of the required methods were not provided, then simply - // proxy to the decorated stream. - foreach (array_diff(self::SLOTS, array_keys($methods)) as $diff) { - /** @var callable $callable */ - $callable = [$stream, $diff]; - $methods[$diff] = $callable; - } - - return new self($methods); - } - - public function __toString(): string - { - try { - return call_user_func($this->_fn___toString); - } catch (\Throwable $e) { - if (\PHP_VERSION_ID >= 70400) { - throw $e; - } - trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR); - return ''; - } - } - - public function close(): void - { - call_user_func($this->_fn_close); - } - - public function detach() - { - return call_user_func($this->_fn_detach); - } - - public function getSize(): ?int - { - return call_user_func($this->_fn_getSize); - } - - public function tell(): int - { - return call_user_func($this->_fn_tell); - } - - public function eof(): bool - { - return call_user_func($this->_fn_eof); - } - - public function isSeekable(): bool - { - return call_user_func($this->_fn_isSeekable); - } - - public function rewind(): void - { - call_user_func($this->_fn_rewind); - } - - public function seek($offset, $whence = SEEK_SET): void - { - call_user_func($this->_fn_seek, $offset, $whence); - } - - public function isWritable(): bool - { - return call_user_func($this->_fn_isWritable); - } - - public function write($string): int - { - return call_user_func($this->_fn_write, $string); - } - - public function isReadable(): bool - { - return call_user_func($this->_fn_isReadable); - } - - public function read($length): string - { - return call_user_func($this->_fn_read, $length); - } - - public function getContents(): string - { - return call_user_func($this->_fn_getContents); - } - - /** - * {@inheritdoc} - * - * @return mixed - */ - public function getMetadata($key = null) - { - return call_user_func($this->_fn_getMetadata, $key); - } -} diff --git a/vendor/guzzlehttp/psr7/src/Header.php b/vendor/guzzlehttp/psr7/src/Header.php deleted file mode 100644 index 0e79a71..0000000 --- a/vendor/guzzlehttp/psr7/src/Header.php +++ /dev/null @@ -1,69 +0,0 @@ -]+>|[^=]+/', $kvp, $matches)) { - $m = $matches[0]; - if (isset($m[1])) { - $part[trim($m[0], $trimmed)] = trim($m[1], $trimmed); - } else { - $part[] = trim($m[0], $trimmed); - } - } - } - if ($part) { - $params[] = $part; - } - } - - return $params; - } - - /** - * Converts an array of header values that may contain comma separated - * headers into an array of headers with no comma separated values. - * - * @param string|array $header Header to normalize. - */ - public static function normalize($header): array - { - if (!is_array($header)) { - return array_map('trim', explode(',', $header)); - } - - $result = []; - foreach ($header as $value) { - foreach ((array) $value as $v) { - if (strpos($v, ',') === false) { - $result[] = $v; - continue; - } - foreach (preg_split('/,(?=([^"]*"[^"]*")*[^"]*$)/', $v) as $vv) { - $result[] = trim($vv); - } - } - } - - return $result; - } -} diff --git a/vendor/guzzlehttp/psr7/src/HttpFactory.php b/vendor/guzzlehttp/psr7/src/HttpFactory.php deleted file mode 100644 index 30be222..0000000 --- a/vendor/guzzlehttp/psr7/src/HttpFactory.php +++ /dev/null @@ -1,100 +0,0 @@ -getSize(); - } - - return new UploadedFile($stream, $size, $error, $clientFilename, $clientMediaType); - } - - public function createStream(string $content = ''): StreamInterface - { - return Utils::streamFor($content); - } - - public function createStreamFromFile(string $file, string $mode = 'r'): StreamInterface - { - try { - $resource = Utils::tryFopen($file, $mode); - } catch (\RuntimeException $e) { - if ('' === $mode || false === \in_array($mode[0], ['r', 'w', 'a', 'x', 'c'], true)) { - throw new \InvalidArgumentException(sprintf('Invalid file opening mode "%s"', $mode), 0, $e); - } - - throw $e; - } - - return Utils::streamFor($resource); - } - - public function createStreamFromResource($resource): StreamInterface - { - return Utils::streamFor($resource); - } - - public function createServerRequest(string $method, $uri, array $serverParams = []): ServerRequestInterface - { - if (empty($method)) { - if (!empty($serverParams['REQUEST_METHOD'])) { - $method = $serverParams['REQUEST_METHOD']; - } else { - throw new \InvalidArgumentException('Cannot determine HTTP method'); - } - } - - return new ServerRequest($method, $uri, [], null, '1.1', $serverParams); - } - - public function createResponse(int $code = 200, string $reasonPhrase = ''): ResponseInterface - { - return new Response($code, [], null, '1.1', $reasonPhrase); - } - - public function createRequest(string $method, $uri): RequestInterface - { - return new Request($method, $uri); - } - - public function createUri(string $uri = ''): UriInterface - { - return new Uri($uri); - } -} diff --git a/vendor/guzzlehttp/psr7/src/InflateStream.php b/vendor/guzzlehttp/psr7/src/InflateStream.php deleted file mode 100644 index 8e3cf17..0000000 --- a/vendor/guzzlehttp/psr7/src/InflateStream.php +++ /dev/null @@ -1,34 +0,0 @@ - 15 + 32]); - $this->stream = $stream->isSeekable() ? new Stream($resource) : new NoSeekStream(new Stream($resource)); - } -} diff --git a/vendor/guzzlehttp/psr7/src/LazyOpenStream.php b/vendor/guzzlehttp/psr7/src/LazyOpenStream.php deleted file mode 100644 index 6b60429..0000000 --- a/vendor/guzzlehttp/psr7/src/LazyOpenStream.php +++ /dev/null @@ -1,40 +0,0 @@ -filename = $filename; - $this->mode = $mode; - } - - /** - * Creates the underlying stream lazily when required. - */ - protected function createStream(): StreamInterface - { - return Utils::streamFor(Utils::tryFopen($this->filename, $this->mode)); - } -} diff --git a/vendor/guzzlehttp/psr7/src/LimitStream.php b/vendor/guzzlehttp/psr7/src/LimitStream.php deleted file mode 100644 index 9762d38..0000000 --- a/vendor/guzzlehttp/psr7/src/LimitStream.php +++ /dev/null @@ -1,154 +0,0 @@ -stream = $stream; - $this->setLimit($limit); - $this->setOffset($offset); - } - - public function eof(): bool - { - // Always return true if the underlying stream is EOF - if ($this->stream->eof()) { - return true; - } - - // No limit and the underlying stream is not at EOF - if ($this->limit === -1) { - return false; - } - - return $this->stream->tell() >= $this->offset + $this->limit; - } - - /** - * Returns the size of the limited subset of data - */ - public function getSize(): ?int - { - if (null === ($length = $this->stream->getSize())) { - return null; - } elseif ($this->limit === -1) { - return $length - $this->offset; - } else { - return min($this->limit, $length - $this->offset); - } - } - - /** - * Allow for a bounded seek on the read limited stream - */ - public function seek($offset, $whence = SEEK_SET): void - { - if ($whence !== SEEK_SET || $offset < 0) { - throw new \RuntimeException(sprintf( - 'Cannot seek to offset %s with whence %s', - $offset, - $whence - )); - } - - $offset += $this->offset; - - if ($this->limit !== -1) { - if ($offset > $this->offset + $this->limit) { - $offset = $this->offset + $this->limit; - } - } - - $this->stream->seek($offset); - } - - /** - * Give a relative tell() - */ - public function tell(): int - { - return $this->stream->tell() - $this->offset; - } - - /** - * Set the offset to start limiting from - * - * @param int $offset Offset to seek to and begin byte limiting from - * - * @throws \RuntimeException if the stream cannot be seeked. - */ - public function setOffset(int $offset): void - { - $current = $this->stream->tell(); - - if ($current !== $offset) { - // If the stream cannot seek to the offset position, then read to it - if ($this->stream->isSeekable()) { - $this->stream->seek($offset); - } elseif ($current > $offset) { - throw new \RuntimeException("Could not seek to stream offset $offset"); - } else { - $this->stream->read($offset - $current); - } - } - - $this->offset = $offset; - } - - /** - * Set the limit of bytes that the decorator allows to be read from the - * stream. - * - * @param int $limit Number of bytes to allow to be read from the stream. - * Use -1 for no limit. - */ - public function setLimit(int $limit): void - { - $this->limit = $limit; - } - - public function read($length): string - { - if ($this->limit === -1) { - return $this->stream->read($length); - } - - // Check if the current position is less than the total allowed - // bytes + original offset - $remaining = ($this->offset + $this->limit) - $this->stream->tell(); - if ($remaining > 0) { - // Only return the amount of requested data, ensuring that the byte - // limit is not exceeded - return $this->stream->read(min($remaining, $length)); - } - - return ''; - } -} diff --git a/vendor/guzzlehttp/psr7/src/Message.php b/vendor/guzzlehttp/psr7/src/Message.php deleted file mode 100644 index 9b825b3..0000000 --- a/vendor/guzzlehttp/psr7/src/Message.php +++ /dev/null @@ -1,242 +0,0 @@ -getMethod() . ' ' - . $message->getRequestTarget()) - . ' HTTP/' . $message->getProtocolVersion(); - if (!$message->hasHeader('host')) { - $msg .= "\r\nHost: " . $message->getUri()->getHost(); - } - } elseif ($message instanceof ResponseInterface) { - $msg = 'HTTP/' . $message->getProtocolVersion() . ' ' - . $message->getStatusCode() . ' ' - . $message->getReasonPhrase(); - } else { - throw new \InvalidArgumentException('Unknown message type'); - } - - foreach ($message->getHeaders() as $name => $values) { - if (strtolower($name) === 'set-cookie') { - foreach ($values as $value) { - $msg .= "\r\n{$name}: " . $value; - } - } else { - $msg .= "\r\n{$name}: " . implode(', ', $values); - } - } - - return "{$msg}\r\n\r\n" . $message->getBody(); - } - - /** - * Get a short summary of the message body. - * - * Will return `null` if the response is not printable. - * - * @param MessageInterface $message The message to get the body summary - * @param int $truncateAt The maximum allowed size of the summary - */ - public static function bodySummary(MessageInterface $message, int $truncateAt = 120): ?string - { - $body = $message->getBody(); - - if (!$body->isSeekable() || !$body->isReadable()) { - return null; - } - - $size = $body->getSize(); - - if ($size === 0) { - return null; - } - - $summary = $body->read($truncateAt); - $body->rewind(); - - if ($size > $truncateAt) { - $summary .= ' (truncated...)'; - } - - // Matches any printable character, including unicode characters: - // letters, marks, numbers, punctuation, spacing, and separators. - if (preg_match('/[^\pL\pM\pN\pP\pS\pZ\n\r\t]/u', $summary)) { - return null; - } - - return $summary; - } - - /** - * Attempts to rewind a message body and throws an exception on failure. - * - * The body of the message will only be rewound if a call to `tell()` - * returns a value other than `0`. - * - * @param MessageInterface $message Message to rewind - * - * @throws \RuntimeException - */ - public static function rewindBody(MessageInterface $message): void - { - $body = $message->getBody(); - - if ($body->tell()) { - $body->rewind(); - } - } - - /** - * Parses an HTTP message into an associative array. - * - * The array contains the "start-line" key containing the start line of - * the message, "headers" key containing an associative array of header - * array values, and a "body" key containing the body of the message. - * - * @param string $message HTTP request or response to parse. - */ - public static function parseMessage(string $message): array - { - if (!$message) { - throw new \InvalidArgumentException('Invalid message'); - } - - $message = ltrim($message, "\r\n"); - - $messageParts = preg_split("/\r?\n\r?\n/", $message, 2); - - if ($messageParts === false || count($messageParts) !== 2) { - throw new \InvalidArgumentException('Invalid message: Missing header delimiter'); - } - - [$rawHeaders, $body] = $messageParts; - $rawHeaders .= "\r\n"; // Put back the delimiter we split previously - $headerParts = preg_split("/\r?\n/", $rawHeaders, 2); - - if ($headerParts === false || count($headerParts) !== 2) { - throw new \InvalidArgumentException('Invalid message: Missing status line'); - } - - [$startLine, $rawHeaders] = $headerParts; - - if (preg_match("/(?:^HTTP\/|^[A-Z]+ \S+ HTTP\/)(\d+(?:\.\d+)?)/i", $startLine, $matches) && $matches[1] === '1.0') { - // Header folding is deprecated for HTTP/1.1, but allowed in HTTP/1.0 - $rawHeaders = preg_replace(Rfc7230::HEADER_FOLD_REGEX, ' ', $rawHeaders); - } - - /** @var array[] $headerLines */ - $count = preg_match_all(Rfc7230::HEADER_REGEX, $rawHeaders, $headerLines, PREG_SET_ORDER); - - // If these aren't the same, then one line didn't match and there's an invalid header. - if ($count !== substr_count($rawHeaders, "\n")) { - // Folding is deprecated, see https://tools.ietf.org/html/rfc7230#section-3.2.4 - if (preg_match(Rfc7230::HEADER_FOLD_REGEX, $rawHeaders)) { - throw new \InvalidArgumentException('Invalid header syntax: Obsolete line folding'); - } - - throw new \InvalidArgumentException('Invalid header syntax'); - } - - $headers = []; - - foreach ($headerLines as $headerLine) { - $headers[$headerLine[1]][] = $headerLine[2]; - } - - return [ - 'start-line' => $startLine, - 'headers' => $headers, - 'body' => $body, - ]; - } - - /** - * Constructs a URI for an HTTP request message. - * - * @param string $path Path from the start-line - * @param array $headers Array of headers (each value an array). - */ - public static function parseRequestUri(string $path, array $headers): string - { - $hostKey = array_filter(array_keys($headers), function ($k) { - return strtolower($k) === 'host'; - }); - - // If no host is found, then a full URI cannot be constructed. - if (!$hostKey) { - return $path; - } - - $host = $headers[reset($hostKey)][0]; - $scheme = substr($host, -4) === ':443' ? 'https' : 'http'; - - return $scheme . '://' . $host . '/' . ltrim($path, '/'); - } - - /** - * Parses a request message string into a request object. - * - * @param string $message Request message string. - */ - public static function parseRequest(string $message): RequestInterface - { - $data = self::parseMessage($message); - $matches = []; - if (!preg_match('/^[\S]+\s+([a-zA-Z]+:\/\/|\/).*/', $data['start-line'], $matches)) { - throw new \InvalidArgumentException('Invalid request string'); - } - $parts = explode(' ', $data['start-line'], 3); - $version = isset($parts[2]) ? explode('/', $parts[2])[1] : '1.1'; - - $request = new Request( - $parts[0], - $matches[1] === '/' ? self::parseRequestUri($parts[1], $data['headers']) : $parts[1], - $data['headers'], - $data['body'], - $version - ); - - return $matches[1] === '/' ? $request : $request->withRequestTarget($parts[1]); - } - - /** - * Parses a response message string into a response object. - * - * @param string $message Response message string. - */ - public static function parseResponse(string $message): ResponseInterface - { - $data = self::parseMessage($message); - // According to https://tools.ietf.org/html/rfc7230#section-3.1.2 the space - // between status-code and reason-phrase is required. But browsers accept - // responses without space and reason as well. - if (!preg_match('/^HTTP\/.* [0-9]{3}( .*|$)/', $data['start-line'])) { - throw new \InvalidArgumentException('Invalid response string: ' . $data['start-line']); - } - $parts = explode(' ', $data['start-line'], 3); - - return new Response( - (int) $parts[1], - $data['headers'], - $data['body'], - explode('/', $parts[0])[1], - $parts[2] ?? null - ); - } -} diff --git a/vendor/guzzlehttp/psr7/src/MessageTrait.php b/vendor/guzzlehttp/psr7/src/MessageTrait.php deleted file mode 100644 index 503c280..0000000 --- a/vendor/guzzlehttp/psr7/src/MessageTrait.php +++ /dev/null @@ -1,235 +0,0 @@ - Map of all registered headers, as original name => array of values */ - private $headers = []; - - /** @var array Map of lowercase header name => original name at registration */ - private $headerNames = []; - - /** @var string */ - private $protocol = '1.1'; - - /** @var StreamInterface|null */ - private $stream; - - public function getProtocolVersion(): string - { - return $this->protocol; - } - - public function withProtocolVersion($version): MessageInterface - { - if ($this->protocol === $version) { - return $this; - } - - $new = clone $this; - $new->protocol = $version; - return $new; - } - - public function getHeaders(): array - { - return $this->headers; - } - - public function hasHeader($header): bool - { - return isset($this->headerNames[strtolower($header)]); - } - - public function getHeader($header): array - { - $header = strtolower($header); - - if (!isset($this->headerNames[$header])) { - return []; - } - - $header = $this->headerNames[$header]; - - return $this->headers[$header]; - } - - public function getHeaderLine($header): string - { - return implode(', ', $this->getHeader($header)); - } - - public function withHeader($header, $value): MessageInterface - { - $this->assertHeader($header); - $value = $this->normalizeHeaderValue($value); - $normalized = strtolower($header); - - $new = clone $this; - if (isset($new->headerNames[$normalized])) { - unset($new->headers[$new->headerNames[$normalized]]); - } - $new->headerNames[$normalized] = $header; - $new->headers[$header] = $value; - - return $new; - } - - public function withAddedHeader($header, $value): MessageInterface - { - $this->assertHeader($header); - $value = $this->normalizeHeaderValue($value); - $normalized = strtolower($header); - - $new = clone $this; - if (isset($new->headerNames[$normalized])) { - $header = $this->headerNames[$normalized]; - $new->headers[$header] = array_merge($this->headers[$header], $value); - } else { - $new->headerNames[$normalized] = $header; - $new->headers[$header] = $value; - } - - return $new; - } - - public function withoutHeader($header): MessageInterface - { - $normalized = strtolower($header); - - if (!isset($this->headerNames[$normalized])) { - return $this; - } - - $header = $this->headerNames[$normalized]; - - $new = clone $this; - unset($new->headers[$header], $new->headerNames[$normalized]); - - return $new; - } - - public function getBody(): StreamInterface - { - if (!$this->stream) { - $this->stream = Utils::streamFor(''); - } - - return $this->stream; - } - - public function withBody(StreamInterface $body): MessageInterface - { - if ($body === $this->stream) { - return $this; - } - - $new = clone $this; - $new->stream = $body; - return $new; - } - - /** - * @param array $headers - */ - private function setHeaders(array $headers): void - { - $this->headerNames = $this->headers = []; - foreach ($headers as $header => $value) { - if (is_int($header)) { - // Numeric array keys are converted to int by PHP but having a header name '123' is not forbidden by the spec - // and also allowed in withHeader(). So we need to cast it to string again for the following assertion to pass. - $header = (string) $header; - } - $this->assertHeader($header); - $value = $this->normalizeHeaderValue($value); - $normalized = strtolower($header); - if (isset($this->headerNames[$normalized])) { - $header = $this->headerNames[$normalized]; - $this->headers[$header] = array_merge($this->headers[$header], $value); - } else { - $this->headerNames[$normalized] = $header; - $this->headers[$header] = $value; - } - } - } - - /** - * @param mixed $value - * - * @return string[] - */ - private function normalizeHeaderValue($value): array - { - if (!is_array($value)) { - return $this->trimHeaderValues([$value]); - } - - if (count($value) === 0) { - throw new \InvalidArgumentException('Header value can not be an empty array.'); - } - - return $this->trimHeaderValues($value); - } - - /** - * Trims whitespace from the header values. - * - * Spaces and tabs ought to be excluded by parsers when extracting the field value from a header field. - * - * header-field = field-name ":" OWS field-value OWS - * OWS = *( SP / HTAB ) - * - * @param mixed[] $values Header values - * - * @return string[] Trimmed header values - * - * @see https://tools.ietf.org/html/rfc7230#section-3.2.4 - */ - private function trimHeaderValues(array $values): array - { - return array_map(function ($value) { - if (!is_scalar($value) && null !== $value) { - throw new \InvalidArgumentException(sprintf( - 'Header value must be scalar or null but %s provided.', - is_object($value) ? get_class($value) : gettype($value) - )); - } - - return trim((string) $value, " \t"); - }, array_values($values)); - } - - /** - * @see https://tools.ietf.org/html/rfc7230#section-3.2 - * - * @param mixed $header - */ - private function assertHeader($header): void - { - if (!is_string($header)) { - throw new \InvalidArgumentException(sprintf( - 'Header name must be a string but %s provided.', - is_object($header) ? get_class($header) : gettype($header) - )); - } - - if (! preg_match('/^[a-zA-Z0-9\'`#$%&*+.^_|~!-]+$/', $header)) { - throw new \InvalidArgumentException( - sprintf( - '"%s" is not valid header name', - $header - ) - ); - } - } -} diff --git a/vendor/guzzlehttp/psr7/src/MimeType.php b/vendor/guzzlehttp/psr7/src/MimeType.php deleted file mode 100644 index dfa9425..0000000 --- a/vendor/guzzlehttp/psr7/src/MimeType.php +++ /dev/null @@ -1,130 +0,0 @@ - 'video/3gpp', - '7z' => 'application/x-7z-compressed', - 'aac' => 'audio/x-aac', - 'ai' => 'application/postscript', - 'aif' => 'audio/x-aiff', - 'asc' => 'text/plain', - 'asf' => 'video/x-ms-asf', - 'atom' => 'application/atom+xml', - 'avi' => 'video/x-msvideo', - 'bmp' => 'image/bmp', - 'bz2' => 'application/x-bzip2', - 'cer' => 'application/pkix-cert', - 'crl' => 'application/pkix-crl', - 'crt' => 'application/x-x509-ca-cert', - 'css' => 'text/css', - 'csv' => 'text/csv', - 'cu' => 'application/cu-seeme', - 'deb' => 'application/x-debian-package', - 'doc' => 'application/msword', - 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', - 'dvi' => 'application/x-dvi', - 'eot' => 'application/vnd.ms-fontobject', - 'eps' => 'application/postscript', - 'epub' => 'application/epub+zip', - 'etx' => 'text/x-setext', - 'flac' => 'audio/flac', - 'flv' => 'video/x-flv', - 'gif' => 'image/gif', - 'gz' => 'application/gzip', - 'htm' => 'text/html', - 'html' => 'text/html', - 'ico' => 'image/x-icon', - 'ics' => 'text/calendar', - 'ini' => 'text/plain', - 'iso' => 'application/x-iso9660-image', - 'jar' => 'application/java-archive', - 'jpe' => 'image/jpeg', - 'jpeg' => 'image/jpeg', - 'jpg' => 'image/jpeg', - 'js' => 'text/javascript', - 'json' => 'application/json', - 'latex' => 'application/x-latex', - 'log' => 'text/plain', - 'm4a' => 'audio/mp4', - 'm4v' => 'video/mp4', - 'mid' => 'audio/midi', - 'midi' => 'audio/midi', - 'mov' => 'video/quicktime', - 'mkv' => 'video/x-matroska', - 'mp3' => 'audio/mpeg', - 'mp4' => 'video/mp4', - 'mp4a' => 'audio/mp4', - 'mp4v' => 'video/mp4', - 'mpe' => 'video/mpeg', - 'mpeg' => 'video/mpeg', - 'mpg' => 'video/mpeg', - 'mpg4' => 'video/mp4', - 'oga' => 'audio/ogg', - 'ogg' => 'audio/ogg', - 'ogv' => 'video/ogg', - 'ogx' => 'application/ogg', - 'pbm' => 'image/x-portable-bitmap', - 'pdf' => 'application/pdf', - 'pgm' => 'image/x-portable-graymap', - 'png' => 'image/png', - 'pnm' => 'image/x-portable-anymap', - 'ppm' => 'image/x-portable-pixmap', - 'ppt' => 'application/vnd.ms-powerpoint', - 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', - 'ps' => 'application/postscript', - 'qt' => 'video/quicktime', - 'rar' => 'application/x-rar-compressed', - 'ras' => 'image/x-cmu-raster', - 'rss' => 'application/rss+xml', - 'rtf' => 'application/rtf', - 'sgm' => 'text/sgml', - 'sgml' => 'text/sgml', - 'svg' => 'image/svg+xml', - 'swf' => 'application/x-shockwave-flash', - 'tar' => 'application/x-tar', - 'tif' => 'image/tiff', - 'tiff' => 'image/tiff', - 'torrent' => 'application/x-bittorrent', - 'ttf' => 'application/x-font-ttf', - 'txt' => 'text/plain', - 'wav' => 'audio/x-wav', - 'webm' => 'video/webm', - 'webp' => 'image/webp', - 'wma' => 'audio/x-ms-wma', - 'wmv' => 'video/x-ms-wmv', - 'woff' => 'application/x-font-woff', - 'wsdl' => 'application/wsdl+xml', - 'xbm' => 'image/x-xbitmap', - 'xls' => 'application/vnd.ms-excel', - 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', - 'xml' => 'application/xml', - 'xpm' => 'image/x-xpixmap', - 'xwd' => 'image/x-xwindowdump', - 'yaml' => 'text/yaml', - 'yml' => 'text/yaml', - 'zip' => 'application/zip', - ]; - - /** - * Determines the mimetype of a file by looking at its extension. - */ - public static function fromFilename(string $filename): ?string - { - return self::fromExtension(pathinfo($filename, PATHINFO_EXTENSION)); - } - - /** - * Maps a file extensions to a mimetype. - * - * @link http://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x/conf/mime.types - */ - public static function fromExtension(string $extension): ?string - { - return self::MIME_TYPES[strtolower($extension)] ?? null; - } -} diff --git a/vendor/guzzlehttp/psr7/src/MultipartStream.php b/vendor/guzzlehttp/psr7/src/MultipartStream.php deleted file mode 100644 index f76d7c6..0000000 --- a/vendor/guzzlehttp/psr7/src/MultipartStream.php +++ /dev/null @@ -1,153 +0,0 @@ -boundary = $boundary ?: sha1(uniqid('', true)); - $this->stream = $this->createStream($elements); - } - - public function getBoundary(): string - { - return $this->boundary; - } - - public function isWritable(): bool - { - return false; - } - - /** - * Get the headers needed before transferring the content of a POST file - * - * @param array $headers - */ - private function getHeaders(array $headers): string - { - $str = ''; - foreach ($headers as $key => $value) { - $str .= "{$key}: {$value}\r\n"; - } - - return "--{$this->boundary}\r\n" . trim($str) . "\r\n\r\n"; - } - - /** - * Create the aggregate stream that will be used to upload the POST data - */ - protected function createStream(array $elements = []): StreamInterface - { - $stream = new AppendStream(); - - foreach ($elements as $element) { - $this->addElement($stream, $element); - } - - // Add the trailing boundary with CRLF - $stream->addStream(Utils::streamFor("--{$this->boundary}--\r\n")); - - return $stream; - } - - private function addElement(AppendStream $stream, array $element): void - { - foreach (['contents', 'name'] as $key) { - if (!array_key_exists($key, $element)) { - throw new \InvalidArgumentException("A '{$key}' key is required"); - } - } - - $element['contents'] = Utils::streamFor($element['contents']); - - if (empty($element['filename'])) { - $uri = $element['contents']->getMetadata('uri'); - if (substr($uri, 0, 6) !== 'php://') { - $element['filename'] = $uri; - } - } - - [$body, $headers] = $this->createElement( - $element['name'], - $element['contents'], - $element['filename'] ?? null, - $element['headers'] ?? [] - ); - - $stream->addStream(Utils::streamFor($this->getHeaders($headers))); - $stream->addStream($body); - $stream->addStream(Utils::streamFor("\r\n")); - } - - private function createElement(string $name, StreamInterface $stream, ?string $filename, array $headers): array - { - // Set a default content-disposition header if one was no provided - $disposition = $this->getHeader($headers, 'content-disposition'); - if (!$disposition) { - $headers['Content-Disposition'] = ($filename === '0' || $filename) - ? sprintf( - 'form-data; name="%s"; filename="%s"', - $name, - basename($filename) - ) - : "form-data; name=\"{$name}\""; - } - - // Set a default content-length header if one was no provided - $length = $this->getHeader($headers, 'content-length'); - if (!$length) { - if ($length = $stream->getSize()) { - $headers['Content-Length'] = (string) $length; - } - } - - // Set a default Content-Type if one was not supplied - $type = $this->getHeader($headers, 'content-type'); - if (!$type && ($filename === '0' || $filename)) { - if ($type = MimeType::fromFilename($filename)) { - $headers['Content-Type'] = $type; - } - } - - return [$stream, $headers]; - } - - private function getHeader(array $headers, string $key) - { - $lowercaseHeader = strtolower($key); - foreach ($headers as $k => $v) { - if (strtolower($k) === $lowercaseHeader) { - return $v; - } - } - - return null; - } -} diff --git a/vendor/guzzlehttp/psr7/src/NoSeekStream.php b/vendor/guzzlehttp/psr7/src/NoSeekStream.php deleted file mode 100644 index 99e25b9..0000000 --- a/vendor/guzzlehttp/psr7/src/NoSeekStream.php +++ /dev/null @@ -1,25 +0,0 @@ -source = $source; - $this->size = $options['size'] ?? null; - $this->metadata = $options['metadata'] ?? []; - $this->buffer = new BufferStream(); - } - - public function __toString(): string - { - try { - return Utils::copyToString($this); - } catch (\Throwable $e) { - if (\PHP_VERSION_ID >= 70400) { - throw $e; - } - trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR); - return ''; - } - } - - public function close(): void - { - $this->detach(); - } - - public function detach() - { - $this->tellPos = 0; - $this->source = null; - - return null; - } - - public function getSize(): ?int - { - return $this->size; - } - - public function tell(): int - { - return $this->tellPos; - } - - public function eof(): bool - { - return $this->source === null; - } - - public function isSeekable(): bool - { - return false; - } - - public function rewind(): void - { - $this->seek(0); - } - - public function seek($offset, $whence = SEEK_SET): void - { - throw new \RuntimeException('Cannot seek a PumpStream'); - } - - public function isWritable(): bool - { - return false; - } - - public function write($string): int - { - throw new \RuntimeException('Cannot write to a PumpStream'); - } - - public function isReadable(): bool - { - return true; - } - - public function read($length): string - { - $data = $this->buffer->read($length); - $readLen = strlen($data); - $this->tellPos += $readLen; - $remaining = $length - $readLen; - - if ($remaining) { - $this->pump($remaining); - $data .= $this->buffer->read($remaining); - $this->tellPos += strlen($data) - $readLen; - } - - return $data; - } - - public function getContents(): string - { - $result = ''; - while (!$this->eof()) { - $result .= $this->read(1000000); - } - - return $result; - } - - /** - * {@inheritdoc} - * - * @return mixed - */ - public function getMetadata($key = null) - { - if (!$key) { - return $this->metadata; - } - - return $this->metadata[$key] ?? null; - } - - private function pump(int $length): void - { - if ($this->source) { - do { - $data = call_user_func($this->source, $length); - if ($data === false || $data === null) { - $this->source = null; - return; - } - $this->buffer->write($data); - $length -= strlen($data); - } while ($length > 0); - } - } -} diff --git a/vendor/guzzlehttp/psr7/src/Query.php b/vendor/guzzlehttp/psr7/src/Query.php deleted file mode 100644 index 4fd0ca9..0000000 --- a/vendor/guzzlehttp/psr7/src/Query.php +++ /dev/null @@ -1,113 +0,0 @@ - '1', 'foo[b]' => '2'])`. - * - * @param string $str Query string to parse - * @param int|bool $urlEncoding How the query string is encoded - */ - public static function parse(string $str, $urlEncoding = true): array - { - $result = []; - - if ($str === '') { - return $result; - } - - if ($urlEncoding === true) { - $decoder = function ($value) { - return rawurldecode(str_replace('+', ' ', (string) $value)); - }; - } elseif ($urlEncoding === PHP_QUERY_RFC3986) { - $decoder = 'rawurldecode'; - } elseif ($urlEncoding === PHP_QUERY_RFC1738) { - $decoder = 'urldecode'; - } else { - $decoder = function ($str) { - return $str; - }; - } - - foreach (explode('&', $str) as $kvp) { - $parts = explode('=', $kvp, 2); - $key = $decoder($parts[0]); - $value = isset($parts[1]) ? $decoder($parts[1]) : null; - if (!isset($result[$key])) { - $result[$key] = $value; - } else { - if (!is_array($result[$key])) { - $result[$key] = [$result[$key]]; - } - $result[$key][] = $value; - } - } - - return $result; - } - - /** - * Build a query string from an array of key value pairs. - * - * This function can use the return value of `parse()` to build a query - * string. This function does not modify the provided keys when an array is - * encountered (like `http_build_query()` would). - * - * @param array $params Query string parameters. - * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986 - * to encode using RFC3986, or PHP_QUERY_RFC1738 - * to encode using RFC1738. - */ - public static function build(array $params, $encoding = PHP_QUERY_RFC3986): string - { - if (!$params) { - return ''; - } - - if ($encoding === false) { - $encoder = function (string $str): string { - return $str; - }; - } elseif ($encoding === PHP_QUERY_RFC3986) { - $encoder = 'rawurlencode'; - } elseif ($encoding === PHP_QUERY_RFC1738) { - $encoder = 'urlencode'; - } else { - throw new \InvalidArgumentException('Invalid type'); - } - - $qs = ''; - foreach ($params as $k => $v) { - $k = $encoder((string) $k); - if (!is_array($v)) { - $qs .= $k; - $v = is_bool($v) ? (int) $v : $v; - if ($v !== null) { - $qs .= '=' . $encoder((string) $v); - } - $qs .= '&'; - } else { - foreach ($v as $vv) { - $qs .= $k; - $vv = is_bool($vv) ? (int) $vv : $vv; - if ($vv !== null) { - $qs .= '=' . $encoder((string) $vv); - } - $qs .= '&'; - } - } - } - - return $qs ? (string) substr($qs, 0, -1) : ''; - } -} diff --git a/vendor/guzzlehttp/psr7/src/Request.php b/vendor/guzzlehttp/psr7/src/Request.php deleted file mode 100644 index b17af66..0000000 --- a/vendor/guzzlehttp/psr7/src/Request.php +++ /dev/null @@ -1,157 +0,0 @@ - $headers Request headers - * @param string|resource|StreamInterface|null $body Request body - * @param string $version Protocol version - */ - public function __construct( - string $method, - $uri, - array $headers = [], - $body = null, - string $version = '1.1' - ) { - $this->assertMethod($method); - if (!($uri instanceof UriInterface)) { - $uri = new Uri($uri); - } - - $this->method = strtoupper($method); - $this->uri = $uri; - $this->setHeaders($headers); - $this->protocol = $version; - - if (!isset($this->headerNames['host'])) { - $this->updateHostFromUri(); - } - - if ($body !== '' && $body !== null) { - $this->stream = Utils::streamFor($body); - } - } - - public function getRequestTarget(): string - { - if ($this->requestTarget !== null) { - return $this->requestTarget; - } - - $target = $this->uri->getPath(); - if ($target === '') { - $target = '/'; - } - if ($this->uri->getQuery() != '') { - $target .= '?' . $this->uri->getQuery(); - } - - return $target; - } - - public function withRequestTarget($requestTarget): RequestInterface - { - if (preg_match('#\s#', $requestTarget)) { - throw new InvalidArgumentException( - 'Invalid request target provided; cannot contain whitespace' - ); - } - - $new = clone $this; - $new->requestTarget = $requestTarget; - return $new; - } - - public function getMethod(): string - { - return $this->method; - } - - public function withMethod($method): RequestInterface - { - $this->assertMethod($method); - $new = clone $this; - $new->method = strtoupper($method); - return $new; - } - - public function getUri(): UriInterface - { - return $this->uri; - } - - public function withUri(UriInterface $uri, $preserveHost = false): RequestInterface - { - if ($uri === $this->uri) { - return $this; - } - - $new = clone $this; - $new->uri = $uri; - - if (!$preserveHost || !isset($this->headerNames['host'])) { - $new->updateHostFromUri(); - } - - return $new; - } - - private function updateHostFromUri(): void - { - $host = $this->uri->getHost(); - - if ($host == '') { - return; - } - - if (($port = $this->uri->getPort()) !== null) { - $host .= ':' . $port; - } - - if (isset($this->headerNames['host'])) { - $header = $this->headerNames['host']; - } else { - $header = 'Host'; - $this->headerNames['host'] = 'Host'; - } - // Ensure Host is the first header. - // See: http://tools.ietf.org/html/rfc7230#section-5.4 - $this->headers = [$header => [$host]] + $this->headers; - } - - /** - * @param mixed $method - */ - private function assertMethod($method): void - { - if (!is_string($method) || $method === '') { - throw new InvalidArgumentException('Method must be a non-empty string.'); - } - } -} diff --git a/vendor/guzzlehttp/psr7/src/Response.php b/vendor/guzzlehttp/psr7/src/Response.php deleted file mode 100644 index 4c6ee6f..0000000 --- a/vendor/guzzlehttp/psr7/src/Response.php +++ /dev/null @@ -1,160 +0,0 @@ - 'Continue', - 101 => 'Switching Protocols', - 102 => 'Processing', - 200 => 'OK', - 201 => 'Created', - 202 => 'Accepted', - 203 => 'Non-Authoritative Information', - 204 => 'No Content', - 205 => 'Reset Content', - 206 => 'Partial Content', - 207 => 'Multi-status', - 208 => 'Already Reported', - 300 => 'Multiple Choices', - 301 => 'Moved Permanently', - 302 => 'Found', - 303 => 'See Other', - 304 => 'Not Modified', - 305 => 'Use Proxy', - 306 => 'Switch Proxy', - 307 => 'Temporary Redirect', - 308 => 'Permanent Redirect', - 400 => 'Bad Request', - 401 => 'Unauthorized', - 402 => 'Payment Required', - 403 => 'Forbidden', - 404 => 'Not Found', - 405 => 'Method Not Allowed', - 406 => 'Not Acceptable', - 407 => 'Proxy Authentication Required', - 408 => 'Request Time-out', - 409 => 'Conflict', - 410 => 'Gone', - 411 => 'Length Required', - 412 => 'Precondition Failed', - 413 => 'Request Entity Too Large', - 414 => 'Request-URI Too Large', - 415 => 'Unsupported Media Type', - 416 => 'Requested range not satisfiable', - 417 => 'Expectation Failed', - 418 => 'I\'m a teapot', - 422 => 'Unprocessable Entity', - 423 => 'Locked', - 424 => 'Failed Dependency', - 425 => 'Unordered Collection', - 426 => 'Upgrade Required', - 428 => 'Precondition Required', - 429 => 'Too Many Requests', - 431 => 'Request Header Fields Too Large', - 451 => 'Unavailable For Legal Reasons', - 500 => 'Internal Server Error', - 501 => 'Not Implemented', - 502 => 'Bad Gateway', - 503 => 'Service Unavailable', - 504 => 'Gateway Time-out', - 505 => 'HTTP Version not supported', - 506 => 'Variant Also Negotiates', - 507 => 'Insufficient Storage', - 508 => 'Loop Detected', - 510 => 'Not Extended', - 511 => 'Network Authentication Required', - ]; - - /** @var string */ - private $reasonPhrase; - - /** @var int */ - private $statusCode; - - /** - * @param int $status Status code - * @param array $headers Response headers - * @param string|resource|StreamInterface|null $body Response body - * @param string $version Protocol version - * @param string|null $reason Reason phrase (when empty a default will be used based on the status code) - */ - public function __construct( - int $status = 200, - array $headers = [], - $body = null, - string $version = '1.1', - string $reason = null - ) { - $this->assertStatusCodeRange($status); - - $this->statusCode = $status; - - if ($body !== '' && $body !== null) { - $this->stream = Utils::streamFor($body); - } - - $this->setHeaders($headers); - if ($reason == '' && isset(self::PHRASES[$this->statusCode])) { - $this->reasonPhrase = self::PHRASES[$this->statusCode]; - } else { - $this->reasonPhrase = (string) $reason; - } - - $this->protocol = $version; - } - - public function getStatusCode(): int - { - return $this->statusCode; - } - - public function getReasonPhrase(): string - { - return $this->reasonPhrase; - } - - public function withStatus($code, $reasonPhrase = ''): ResponseInterface - { - $this->assertStatusCodeIsInteger($code); - $code = (int) $code; - $this->assertStatusCodeRange($code); - - $new = clone $this; - $new->statusCode = $code; - if ($reasonPhrase == '' && isset(self::PHRASES[$new->statusCode])) { - $reasonPhrase = self::PHRASES[$new->statusCode]; - } - $new->reasonPhrase = (string) $reasonPhrase; - return $new; - } - - /** - * @param mixed $statusCode - */ - private function assertStatusCodeIsInteger($statusCode): void - { - if (filter_var($statusCode, FILTER_VALIDATE_INT) === false) { - throw new \InvalidArgumentException('Status code must be an integer value.'); - } - } - - private function assertStatusCodeRange(int $statusCode): void - { - if ($statusCode < 100 || $statusCode >= 600) { - throw new \InvalidArgumentException('Status code must be an integer value between 1xx and 5xx.'); - } - } -} diff --git a/vendor/guzzlehttp/psr7/src/Rfc7230.php b/vendor/guzzlehttp/psr7/src/Rfc7230.php deleted file mode 100644 index 3022401..0000000 --- a/vendor/guzzlehttp/psr7/src/Rfc7230.php +++ /dev/null @@ -1,23 +0,0 @@ -@,;:\\\"/[\]?={}\x01-\x20\x7F]++):[ \t]*+((?:[ \t]*+[\x21-\x7E\x80-\xFF]++)*+)[ \t]*+\r?\n)m"; - public const HEADER_FOLD_REGEX = "(\r?\n[ \t]++)"; -} diff --git a/vendor/guzzlehttp/psr7/src/ServerRequest.php b/vendor/guzzlehttp/psr7/src/ServerRequest.php deleted file mode 100644 index 6ae3f9b..0000000 --- a/vendor/guzzlehttp/psr7/src/ServerRequest.php +++ /dev/null @@ -1,344 +0,0 @@ - $headers Request headers - * @param string|resource|StreamInterface|null $body Request body - * @param string $version Protocol version - * @param array $serverParams Typically the $_SERVER superglobal - */ - public function __construct( - string $method, - $uri, - array $headers = [], - $body = null, - string $version = '1.1', - array $serverParams = [] - ) { - $this->serverParams = $serverParams; - - parent::__construct($method, $uri, $headers, $body, $version); - } - - /** - * Return an UploadedFile instance array. - * - * @param array $files A array which respect $_FILES structure - * - * @throws InvalidArgumentException for unrecognized values - */ - public static function normalizeFiles(array $files): array - { - $normalized = []; - - foreach ($files as $key => $value) { - if ($value instanceof UploadedFileInterface) { - $normalized[$key] = $value; - } elseif (is_array($value) && isset($value['tmp_name'])) { - $normalized[$key] = self::createUploadedFileFromSpec($value); - } elseif (is_array($value)) { - $normalized[$key] = self::normalizeFiles($value); - continue; - } else { - throw new InvalidArgumentException('Invalid value in files specification'); - } - } - - return $normalized; - } - - /** - * Create and return an UploadedFile instance from a $_FILES specification. - * - * If the specification represents an array of values, this method will - * delegate to normalizeNestedFileSpec() and return that return value. - * - * @param array $value $_FILES struct - * - * @return UploadedFileInterface|UploadedFileInterface[] - */ - private static function createUploadedFileFromSpec(array $value) - { - if (is_array($value['tmp_name'])) { - return self::normalizeNestedFileSpec($value); - } - - return new UploadedFile( - $value['tmp_name'], - (int) $value['size'], - (int) $value['error'], - $value['name'], - $value['type'] - ); - } - - /** - * Normalize an array of file specifications. - * - * Loops through all nested files and returns a normalized array of - * UploadedFileInterface instances. - * - * @return UploadedFileInterface[] - */ - private static function normalizeNestedFileSpec(array $files = []): array - { - $normalizedFiles = []; - - foreach (array_keys($files['tmp_name']) as $key) { - $spec = [ - 'tmp_name' => $files['tmp_name'][$key], - 'size' => $files['size'][$key], - 'error' => $files['error'][$key], - 'name' => $files['name'][$key], - 'type' => $files['type'][$key], - ]; - $normalizedFiles[$key] = self::createUploadedFileFromSpec($spec); - } - - return $normalizedFiles; - } - - /** - * Return a ServerRequest populated with superglobals: - * $_GET - * $_POST - * $_COOKIE - * $_FILES - * $_SERVER - */ - public static function fromGlobals(): ServerRequestInterface - { - $method = $_SERVER['REQUEST_METHOD'] ?? 'GET'; - $headers = getallheaders(); - $uri = self::getUriFromGlobals(); - $body = new CachingStream(new LazyOpenStream('php://input', 'r+')); - $protocol = isset($_SERVER['SERVER_PROTOCOL']) ? str_replace('HTTP/', '', $_SERVER['SERVER_PROTOCOL']) : '1.1'; - - $serverRequest = new ServerRequest($method, $uri, $headers, $body, $protocol, $_SERVER); - - return $serverRequest - ->withCookieParams($_COOKIE) - ->withQueryParams($_GET) - ->withParsedBody($_POST) - ->withUploadedFiles(self::normalizeFiles($_FILES)); - } - - private static function extractHostAndPortFromAuthority(string $authority): array - { - $uri = 'http://' . $authority; - $parts = parse_url($uri); - if (false === $parts) { - return [null, null]; - } - - $host = $parts['host'] ?? null; - $port = $parts['port'] ?? null; - - return [$host, $port]; - } - - /** - * Get a Uri populated with values from $_SERVER. - */ - public static function getUriFromGlobals(): UriInterface - { - $uri = new Uri(''); - - $uri = $uri->withScheme(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' ? 'https' : 'http'); - - $hasPort = false; - if (isset($_SERVER['HTTP_HOST'])) { - [$host, $port] = self::extractHostAndPortFromAuthority($_SERVER['HTTP_HOST']); - if ($host !== null) { - $uri = $uri->withHost($host); - } - - if ($port !== null) { - $hasPort = true; - $uri = $uri->withPort($port); - } - } elseif (isset($_SERVER['SERVER_NAME'])) { - $uri = $uri->withHost($_SERVER['SERVER_NAME']); - } elseif (isset($_SERVER['SERVER_ADDR'])) { - $uri = $uri->withHost($_SERVER['SERVER_ADDR']); - } - - if (!$hasPort && isset($_SERVER['SERVER_PORT'])) { - $uri = $uri->withPort($_SERVER['SERVER_PORT']); - } - - $hasQuery = false; - if (isset($_SERVER['REQUEST_URI'])) { - $requestUriParts = explode('?', $_SERVER['REQUEST_URI'], 2); - $uri = $uri->withPath($requestUriParts[0]); - if (isset($requestUriParts[1])) { - $hasQuery = true; - $uri = $uri->withQuery($requestUriParts[1]); - } - } - - if (!$hasQuery && isset($_SERVER['QUERY_STRING'])) { - $uri = $uri->withQuery($_SERVER['QUERY_STRING']); - } - - return $uri; - } - - public function getServerParams(): array - { - return $this->serverParams; - } - - public function getUploadedFiles(): array - { - return $this->uploadedFiles; - } - - public function withUploadedFiles(array $uploadedFiles): ServerRequestInterface - { - $new = clone $this; - $new->uploadedFiles = $uploadedFiles; - - return $new; - } - - public function getCookieParams(): array - { - return $this->cookieParams; - } - - public function withCookieParams(array $cookies): ServerRequestInterface - { - $new = clone $this; - $new->cookieParams = $cookies; - - return $new; - } - - public function getQueryParams(): array - { - return $this->queryParams; - } - - public function withQueryParams(array $query): ServerRequestInterface - { - $new = clone $this; - $new->queryParams = $query; - - return $new; - } - - /** - * {@inheritdoc} - * - * @return array|object|null - */ - public function getParsedBody() - { - return $this->parsedBody; - } - - public function withParsedBody($data): ServerRequestInterface - { - $new = clone $this; - $new->parsedBody = $data; - - return $new; - } - - public function getAttributes(): array - { - return $this->attributes; - } - - /** - * {@inheritdoc} - * - * @return mixed - */ - public function getAttribute($attribute, $default = null) - { - if (false === array_key_exists($attribute, $this->attributes)) { - return $default; - } - - return $this->attributes[$attribute]; - } - - public function withAttribute($attribute, $value): ServerRequestInterface - { - $new = clone $this; - $new->attributes[$attribute] = $value; - - return $new; - } - - public function withoutAttribute($attribute): ServerRequestInterface - { - if (false === array_key_exists($attribute, $this->attributes)) { - return $this; - } - - $new = clone $this; - unset($new->attributes[$attribute]); - - return $new; - } -} diff --git a/vendor/guzzlehttp/psr7/src/Stream.php b/vendor/guzzlehttp/psr7/src/Stream.php deleted file mode 100644 index d389427..0000000 --- a/vendor/guzzlehttp/psr7/src/Stream.php +++ /dev/null @@ -1,279 +0,0 @@ -size = $options['size']; - } - - $this->customMetadata = $options['metadata'] ?? []; - $this->stream = $stream; - $meta = stream_get_meta_data($this->stream); - $this->seekable = $meta['seekable']; - $this->readable = (bool)preg_match(self::READABLE_MODES, $meta['mode']); - $this->writable = (bool)preg_match(self::WRITABLE_MODES, $meta['mode']); - $this->uri = $this->getMetadata('uri'); - } - - /** - * Closes the stream when the destructed - */ - public function __destruct() - { - $this->close(); - } - - public function __toString(): string - { - try { - if ($this->isSeekable()) { - $this->seek(0); - } - return $this->getContents(); - } catch (\Throwable $e) { - if (\PHP_VERSION_ID >= 70400) { - throw $e; - } - trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR); - return ''; - } - } - - public function getContents(): string - { - if (!isset($this->stream)) { - throw new \RuntimeException('Stream is detached'); - } - - $contents = stream_get_contents($this->stream); - - if ($contents === false) { - throw new \RuntimeException('Unable to read stream contents'); - } - - return $contents; - } - - public function close(): void - { - if (isset($this->stream)) { - if (is_resource($this->stream)) { - fclose($this->stream); - } - $this->detach(); - } - } - - public function detach() - { - if (!isset($this->stream)) { - return null; - } - - $result = $this->stream; - unset($this->stream); - $this->size = $this->uri = null; - $this->readable = $this->writable = $this->seekable = false; - - return $result; - } - - public function getSize(): ?int - { - if ($this->size !== null) { - return $this->size; - } - - if (!isset($this->stream)) { - return null; - } - - // Clear the stat cache if the stream has a URI - if ($this->uri) { - clearstatcache(true, $this->uri); - } - - $stats = fstat($this->stream); - if (is_array($stats) && isset($stats['size'])) { - $this->size = $stats['size']; - return $this->size; - } - - return null; - } - - public function isReadable(): bool - { - return $this->readable; - } - - public function isWritable(): bool - { - return $this->writable; - } - - public function isSeekable(): bool - { - return $this->seekable; - } - - public function eof(): bool - { - if (!isset($this->stream)) { - throw new \RuntimeException('Stream is detached'); - } - - return feof($this->stream); - } - - public function tell(): int - { - if (!isset($this->stream)) { - throw new \RuntimeException('Stream is detached'); - } - - $result = ftell($this->stream); - - if ($result === false) { - throw new \RuntimeException('Unable to determine stream position'); - } - - return $result; - } - - public function rewind(): void - { - $this->seek(0); - } - - public function seek($offset, $whence = SEEK_SET): void - { - $whence = (int) $whence; - - if (!isset($this->stream)) { - throw new \RuntimeException('Stream is detached'); - } - if (!$this->seekable) { - throw new \RuntimeException('Stream is not seekable'); - } - if (fseek($this->stream, $offset, $whence) === -1) { - throw new \RuntimeException('Unable to seek to stream position ' - . $offset . ' with whence ' . var_export($whence, true)); - } - } - - public function read($length): string - { - if (!isset($this->stream)) { - throw new \RuntimeException('Stream is detached'); - } - if (!$this->readable) { - throw new \RuntimeException('Cannot read from non-readable stream'); - } - if ($length < 0) { - throw new \RuntimeException('Length parameter cannot be negative'); - } - - if (0 === $length) { - return ''; - } - - $string = fread($this->stream, $length); - if (false === $string) { - throw new \RuntimeException('Unable to read from stream'); - } - - return $string; - } - - public function write($string): int - { - if (!isset($this->stream)) { - throw new \RuntimeException('Stream is detached'); - } - if (!$this->writable) { - throw new \RuntimeException('Cannot write to a non-writable stream'); - } - - // We can't know the size after writing anything - $this->size = null; - $result = fwrite($this->stream, $string); - - if ($result === false) { - throw new \RuntimeException('Unable to write to stream'); - } - - return $result; - } - - /** - * {@inheritdoc} - * - * @return mixed - */ - public function getMetadata($key = null) - { - if (!isset($this->stream)) { - return $key ? null : []; - } elseif (!$key) { - return $this->customMetadata + stream_get_meta_data($this->stream); - } elseif (isset($this->customMetadata[$key])) { - return $this->customMetadata[$key]; - } - - $meta = stream_get_meta_data($this->stream); - - return $meta[$key] ?? null; - } -} diff --git a/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php b/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php deleted file mode 100644 index 56d4104..0000000 --- a/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php +++ /dev/null @@ -1,155 +0,0 @@ -stream = $stream; - } - - /** - * Magic method used to create a new stream if streams are not added in - * the constructor of a decorator (e.g., LazyOpenStream). - * - * @return StreamInterface - */ - public function __get(string $name) - { - if ($name === 'stream') { - $this->stream = $this->createStream(); - return $this->stream; - } - - throw new \UnexpectedValueException("$name not found on class"); - } - - public function __toString(): string - { - try { - if ($this->isSeekable()) { - $this->seek(0); - } - return $this->getContents(); - } catch (\Throwable $e) { - if (\PHP_VERSION_ID >= 70400) { - throw $e; - } - trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR); - return ''; - } - } - - public function getContents(): string - { - return Utils::copyToString($this); - } - - /** - * Allow decorators to implement custom methods - * - * @return mixed - */ - public function __call(string $method, array $args) - { - /** @var callable $callable */ - $callable = [$this->stream, $method]; - $result = call_user_func_array($callable, $args); - - // Always return the wrapped object if the result is a return $this - return $result === $this->stream ? $this : $result; - } - - public function close(): void - { - $this->stream->close(); - } - - /** - * {@inheritdoc} - * - * @return mixed - */ - public function getMetadata($key = null) - { - return $this->stream->getMetadata($key); - } - - public function detach() - { - return $this->stream->detach(); - } - - public function getSize(): ?int - { - return $this->stream->getSize(); - } - - public function eof(): bool - { - return $this->stream->eof(); - } - - public function tell(): int - { - return $this->stream->tell(); - } - - public function isReadable(): bool - { - return $this->stream->isReadable(); - } - - public function isWritable(): bool - { - return $this->stream->isWritable(); - } - - public function isSeekable(): bool - { - return $this->stream->isSeekable(); - } - - public function rewind(): void - { - $this->seek(0); - } - - public function seek($offset, $whence = SEEK_SET): void - { - $this->stream->seek($offset, $whence); - } - - public function read($length): string - { - return $this->stream->read($length); - } - - public function write($string): int - { - return $this->stream->write($string); - } - - /** - * Implement in subclasses to dynamically create streams when requested. - * - * @throws \BadMethodCallException - */ - protected function createStream(): StreamInterface - { - throw new \BadMethodCallException('Not implemented'); - } -} diff --git a/vendor/guzzlehttp/psr7/src/StreamWrapper.php b/vendor/guzzlehttp/psr7/src/StreamWrapper.php deleted file mode 100644 index 2a93464..0000000 --- a/vendor/guzzlehttp/psr7/src/StreamWrapper.php +++ /dev/null @@ -1,175 +0,0 @@ -isReadable()) { - $mode = $stream->isWritable() ? 'r+' : 'r'; - } elseif ($stream->isWritable()) { - $mode = 'w'; - } else { - throw new \InvalidArgumentException('The stream must be readable, ' - . 'writable, or both.'); - } - - return fopen('guzzle://stream', $mode, false, self::createStreamContext($stream)); - } - - /** - * Creates a stream context that can be used to open a stream as a php stream resource. - * - * @return resource - */ - public static function createStreamContext(StreamInterface $stream) - { - return stream_context_create([ - 'guzzle' => ['stream' => $stream] - ]); - } - - /** - * Registers the stream wrapper if needed - */ - public static function register(): void - { - if (!in_array('guzzle', stream_get_wrappers())) { - stream_wrapper_register('guzzle', __CLASS__); - } - } - - public function stream_open(string $path, string $mode, int $options, string &$opened_path = null): bool - { - $options = stream_context_get_options($this->context); - - if (!isset($options['guzzle']['stream'])) { - return false; - } - - $this->mode = $mode; - $this->stream = $options['guzzle']['stream']; - - return true; - } - - public function stream_read(int $count): string - { - return $this->stream->read($count); - } - - public function stream_write(string $data): int - { - return $this->stream->write($data); - } - - public function stream_tell(): int - { - return $this->stream->tell(); - } - - public function stream_eof(): bool - { - return $this->stream->eof(); - } - - public function stream_seek(int $offset, int $whence): bool - { - $this->stream->seek($offset, $whence); - - return true; - } - - /** - * @return resource|false - */ - public function stream_cast(int $cast_as) - { - $stream = clone($this->stream); - $resource = $stream->detach(); - - return $resource ?? false; - } - - /** - * @return array - */ - public function stream_stat(): array - { - static $modeMap = [ - 'r' => 33060, - 'rb' => 33060, - 'r+' => 33206, - 'w' => 33188, - 'wb' => 33188 - ]; - - return [ - 'dev' => 0, - 'ino' => 0, - 'mode' => $modeMap[$this->mode], - 'nlink' => 0, - 'uid' => 0, - 'gid' => 0, - 'rdev' => 0, - 'size' => $this->stream->getSize() ?: 0, - 'atime' => 0, - 'mtime' => 0, - 'ctime' => 0, - 'blksize' => 0, - 'blocks' => 0 - ]; - } - - /** - * @return array - */ - public function url_stat(string $path, int $flags): array - { - return [ - 'dev' => 0, - 'ino' => 0, - 'mode' => 0, - 'nlink' => 0, - 'uid' => 0, - 'gid' => 0, - 'rdev' => 0, - 'size' => 0, - 'atime' => 0, - 'mtime' => 0, - 'ctime' => 0, - 'blksize' => 0, - 'blocks' => 0 - ]; - } -} diff --git a/vendor/guzzlehttp/psr7/src/UploadedFile.php b/vendor/guzzlehttp/psr7/src/UploadedFile.php deleted file mode 100644 index b1521bc..0000000 --- a/vendor/guzzlehttp/psr7/src/UploadedFile.php +++ /dev/null @@ -1,211 +0,0 @@ -setError($errorStatus); - $this->size = $size; - $this->clientFilename = $clientFilename; - $this->clientMediaType = $clientMediaType; - - if ($this->isOk()) { - $this->setStreamOrFile($streamOrFile); - } - } - - /** - * Depending on the value set file or stream variable - * - * @param StreamInterface|string|resource $streamOrFile - * - * @throws InvalidArgumentException - */ - private function setStreamOrFile($streamOrFile): void - { - if (is_string($streamOrFile)) { - $this->file = $streamOrFile; - } elseif (is_resource($streamOrFile)) { - $this->stream = new Stream($streamOrFile); - } elseif ($streamOrFile instanceof StreamInterface) { - $this->stream = $streamOrFile; - } else { - throw new InvalidArgumentException( - 'Invalid stream or file provided for UploadedFile' - ); - } - } - - /** - * @throws InvalidArgumentException - */ - private function setError(int $error): void - { - if (false === in_array($error, UploadedFile::ERRORS, true)) { - throw new InvalidArgumentException( - 'Invalid error status for UploadedFile' - ); - } - - $this->error = $error; - } - - private function isStringNotEmpty($param): bool - { - return is_string($param) && false === empty($param); - } - - /** - * Return true if there is no upload error - */ - private function isOk(): bool - { - return $this->error === UPLOAD_ERR_OK; - } - - public function isMoved(): bool - { - return $this->moved; - } - - /** - * @throws RuntimeException if is moved or not ok - */ - private function validateActive(): void - { - if (false === $this->isOk()) { - throw new RuntimeException('Cannot retrieve stream due to upload error'); - } - - if ($this->isMoved()) { - throw new RuntimeException('Cannot retrieve stream after it has already been moved'); - } - } - - public function getStream(): StreamInterface - { - $this->validateActive(); - - if ($this->stream instanceof StreamInterface) { - return $this->stream; - } - - /** @var string $file */ - $file = $this->file; - - return new LazyOpenStream($file, 'r+'); - } - - public function moveTo($targetPath): void - { - $this->validateActive(); - - if (false === $this->isStringNotEmpty($targetPath)) { - throw new InvalidArgumentException( - 'Invalid path provided for move operation; must be a non-empty string' - ); - } - - if ($this->file) { - $this->moved = PHP_SAPI === 'cli' - ? rename($this->file, $targetPath) - : move_uploaded_file($this->file, $targetPath); - } else { - Utils::copyToStream( - $this->getStream(), - new LazyOpenStream($targetPath, 'w') - ); - - $this->moved = true; - } - - if (false === $this->moved) { - throw new RuntimeException( - sprintf('Uploaded file could not be moved to %s', $targetPath) - ); - } - } - - public function getSize(): ?int - { - return $this->size; - } - - public function getError(): int - { - return $this->error; - } - - public function getClientFilename(): ?string - { - return $this->clientFilename; - } - - public function getClientMediaType(): ?string - { - return $this->clientMediaType; - } -} diff --git a/vendor/guzzlehttp/psr7/src/Uri.php b/vendor/guzzlehttp/psr7/src/Uri.php deleted file mode 100644 index 3898f78..0000000 --- a/vendor/guzzlehttp/psr7/src/Uri.php +++ /dev/null @@ -1,733 +0,0 @@ - 80, - 'https' => 443, - 'ftp' => 21, - 'gopher' => 70, - 'nntp' => 119, - 'news' => 119, - 'telnet' => 23, - 'tn3270' => 23, - 'imap' => 143, - 'pop' => 110, - 'ldap' => 389, - ]; - - /** - * Unreserved characters for use in a regex. - * - * @link https://tools.ietf.org/html/rfc3986#section-2.3 - */ - private const CHAR_UNRESERVED = 'a-zA-Z0-9_\-\.~'; - - /** - * Sub-delims for use in a regex. - * - * @link https://tools.ietf.org/html/rfc3986#section-2.2 - */ - private const CHAR_SUB_DELIMS = '!\$&\'\(\)\*\+,;='; - private const QUERY_SEPARATORS_REPLACEMENT = ['=' => '%3D', '&' => '%26']; - - /** @var string Uri scheme. */ - private $scheme = ''; - - /** @var string Uri user info. */ - private $userInfo = ''; - - /** @var string Uri host. */ - private $host = ''; - - /** @var int|null Uri port. */ - private $port; - - /** @var string Uri path. */ - private $path = ''; - - /** @var string Uri query string. */ - private $query = ''; - - /** @var string Uri fragment. */ - private $fragment = ''; - - /** @var string|null String representation */ - private $composedComponents; - - public function __construct(string $uri = '') - { - if ($uri !== '') { - $parts = self::parse($uri); - if ($parts === false) { - throw new MalformedUriException("Unable to parse URI: $uri"); - } - $this->applyParts($parts); - } - } - /** - * UTF-8 aware \parse_url() replacement. - * - * The internal function produces broken output for non ASCII domain names - * (IDN) when used with locales other than "C". - * - * On the other hand, cURL understands IDN correctly only when UTF-8 locale - * is configured ("C.UTF-8", "en_US.UTF-8", etc.). - * - * @see https://bugs.php.net/bug.php?id=52923 - * @see https://www.php.net/manual/en/function.parse-url.php#114817 - * @see https://curl.haxx.se/libcurl/c/CURLOPT_URL.html#ENCODING - * - * @return array|false - */ - private static function parse(string $url) - { - // If IPv6 - $prefix = ''; - if (preg_match('%^(.*://\[[0-9:a-f]+\])(.*?)$%', $url, $matches)) { - /** @var array{0:string, 1:string, 2:string} $matches */ - $prefix = $matches[1]; - $url = $matches[2]; - } - - /** @var string */ - $encodedUrl = preg_replace_callback( - '%[^:/@?&=#]+%usD', - static function ($matches) { - return urlencode($matches[0]); - }, - $url - ); - - $result = parse_url($prefix . $encodedUrl); - - if ($result === false) { - return false; - } - - return array_map('urldecode', $result); - } - - public function __toString(): string - { - if ($this->composedComponents === null) { - $this->composedComponents = self::composeComponents( - $this->scheme, - $this->getAuthority(), - $this->path, - $this->query, - $this->fragment - ); - } - - return $this->composedComponents; - } - - /** - * Composes a URI reference string from its various components. - * - * Usually this method does not need to be called manually but instead is used indirectly via - * `Psr\Http\Message\UriInterface::__toString`. - * - * PSR-7 UriInterface treats an empty component the same as a missing component as - * getQuery(), getFragment() etc. always return a string. This explains the slight - * difference to RFC 3986 Section 5.3. - * - * Another adjustment is that the authority separator is added even when the authority is missing/empty - * for the "file" scheme. This is because PHP stream functions like `file_get_contents` only work with - * `file:///myfile` but not with `file:/myfile` although they are equivalent according to RFC 3986. But - * `file:///` is the more common syntax for the file scheme anyway (Chrome for example redirects to - * that format). - * - * @link https://tools.ietf.org/html/rfc3986#section-5.3 - */ - public static function composeComponents(?string $scheme, ?string $authority, string $path, ?string $query, ?string $fragment): string - { - $uri = ''; - - // weak type checks to also accept null until we can add scalar type hints - if ($scheme != '') { - $uri .= $scheme . ':'; - } - - if ($authority != ''|| $scheme === 'file') { - $uri .= '//' . $authority; - } - - $uri .= $path; - - if ($query != '') { - $uri .= '?' . $query; - } - - if ($fragment != '') { - $uri .= '#' . $fragment; - } - - return $uri; - } - - /** - * Whether the URI has the default port of the current scheme. - * - * `Psr\Http\Message\UriInterface::getPort` may return null or the standard port. This method can be used - * independently of the implementation. - */ - public static function isDefaultPort(UriInterface $uri): bool - { - return $uri->getPort() === null - || (isset(self::DEFAULT_PORTS[$uri->getScheme()]) && $uri->getPort() === self::DEFAULT_PORTS[$uri->getScheme()]); - } - - /** - * Whether the URI is absolute, i.e. it has a scheme. - * - * An instance of UriInterface can either be an absolute URI or a relative reference. This method returns true - * if it is the former. An absolute URI has a scheme. A relative reference is used to express a URI relative - * to another URI, the base URI. Relative references can be divided into several forms: - * - network-path references, e.g. '//example.com/path' - * - absolute-path references, e.g. '/path' - * - relative-path references, e.g. 'subpath' - * - * @see Uri::isNetworkPathReference - * @see Uri::isAbsolutePathReference - * @see Uri::isRelativePathReference - * @link https://tools.ietf.org/html/rfc3986#section-4 - */ - public static function isAbsolute(UriInterface $uri): bool - { - return $uri->getScheme() !== ''; - } - - /** - * Whether the URI is a network-path reference. - * - * A relative reference that begins with two slash characters is termed an network-path reference. - * - * @link https://tools.ietf.org/html/rfc3986#section-4.2 - */ - public static function isNetworkPathReference(UriInterface $uri): bool - { - return $uri->getScheme() === '' && $uri->getAuthority() !== ''; - } - - /** - * Whether the URI is a absolute-path reference. - * - * A relative reference that begins with a single slash character is termed an absolute-path reference. - * - * @link https://tools.ietf.org/html/rfc3986#section-4.2 - */ - public static function isAbsolutePathReference(UriInterface $uri): bool - { - return $uri->getScheme() === '' - && $uri->getAuthority() === '' - && isset($uri->getPath()[0]) - && $uri->getPath()[0] === '/'; - } - - /** - * Whether the URI is a relative-path reference. - * - * A relative reference that does not begin with a slash character is termed a relative-path reference. - * - * @link https://tools.ietf.org/html/rfc3986#section-4.2 - */ - public static function isRelativePathReference(UriInterface $uri): bool - { - return $uri->getScheme() === '' - && $uri->getAuthority() === '' - && (!isset($uri->getPath()[0]) || $uri->getPath()[0] !== '/'); - } - - /** - * Whether the URI is a same-document reference. - * - * A same-document reference refers to a URI that is, aside from its fragment - * component, identical to the base URI. When no base URI is given, only an empty - * URI reference (apart from its fragment) is considered a same-document reference. - * - * @param UriInterface $uri The URI to check - * @param UriInterface|null $base An optional base URI to compare against - * - * @link https://tools.ietf.org/html/rfc3986#section-4.4 - */ - public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = null): bool - { - if ($base !== null) { - $uri = UriResolver::resolve($base, $uri); - - return ($uri->getScheme() === $base->getScheme()) - && ($uri->getAuthority() === $base->getAuthority()) - && ($uri->getPath() === $base->getPath()) - && ($uri->getQuery() === $base->getQuery()); - } - - return $uri->getScheme() === '' && $uri->getAuthority() === '' && $uri->getPath() === '' && $uri->getQuery() === ''; - } - - /** - * Creates a new URI with a specific query string value removed. - * - * Any existing query string values that exactly match the provided key are - * removed. - * - * @param UriInterface $uri URI to use as a base. - * @param string $key Query string key to remove. - */ - public static function withoutQueryValue(UriInterface $uri, string $key): UriInterface - { - $result = self::getFilteredQueryString($uri, [$key]); - - return $uri->withQuery(implode('&', $result)); - } - - /** - * Creates a new URI with a specific query string value. - * - * Any existing query string values that exactly match the provided key are - * removed and replaced with the given key value pair. - * - * A value of null will set the query string key without a value, e.g. "key" - * instead of "key=value". - * - * @param UriInterface $uri URI to use as a base. - * @param string $key Key to set. - * @param string|null $value Value to set - */ - public static function withQueryValue(UriInterface $uri, string $key, ?string $value): UriInterface - { - $result = self::getFilteredQueryString($uri, [$key]); - - $result[] = self::generateQueryString($key, $value); - - return $uri->withQuery(implode('&', $result)); - } - - /** - * Creates a new URI with multiple specific query string values. - * - * It has the same behavior as withQueryValue() but for an associative array of key => value. - * - * @param UriInterface $uri URI to use as a base. - * @param array $keyValueArray Associative array of key and values - */ - public static function withQueryValues(UriInterface $uri, array $keyValueArray): UriInterface - { - $result = self::getFilteredQueryString($uri, array_keys($keyValueArray)); - - foreach ($keyValueArray as $key => $value) { - $result[] = self::generateQueryString((string) $key, $value !== null ? (string) $value : null); - } - - return $uri->withQuery(implode('&', $result)); - } - - /** - * Creates a URI from a hash of `parse_url` components. - * - * @link http://php.net/manual/en/function.parse-url.php - * - * @throws MalformedUriException If the components do not form a valid URI. - */ - public static function fromParts(array $parts): UriInterface - { - $uri = new self(); - $uri->applyParts($parts); - $uri->validateState(); - - return $uri; - } - - public function getScheme(): string - { - return $this->scheme; - } - - public function getAuthority(): string - { - $authority = $this->host; - if ($this->userInfo !== '') { - $authority = $this->userInfo . '@' . $authority; - } - - if ($this->port !== null) { - $authority .= ':' . $this->port; - } - - return $authority; - } - - public function getUserInfo(): string - { - return $this->userInfo; - } - - public function getHost(): string - { - return $this->host; - } - - public function getPort(): ?int - { - return $this->port; - } - - public function getPath(): string - { - return $this->path; - } - - public function getQuery(): string - { - return $this->query; - } - - public function getFragment(): string - { - return $this->fragment; - } - - public function withScheme($scheme): UriInterface - { - $scheme = $this->filterScheme($scheme); - - if ($this->scheme === $scheme) { - return $this; - } - - $new = clone $this; - $new->scheme = $scheme; - $new->composedComponents = null; - $new->removeDefaultPort(); - $new->validateState(); - - return $new; - } - - public function withUserInfo($user, $password = null): UriInterface - { - $info = $this->filterUserInfoComponent($user); - if ($password !== null) { - $info .= ':' . $this->filterUserInfoComponent($password); - } - - if ($this->userInfo === $info) { - return $this; - } - - $new = clone $this; - $new->userInfo = $info; - $new->composedComponents = null; - $new->validateState(); - - return $new; - } - - public function withHost($host): UriInterface - { - $host = $this->filterHost($host); - - if ($this->host === $host) { - return $this; - } - - $new = clone $this; - $new->host = $host; - $new->composedComponents = null; - $new->validateState(); - - return $new; - } - - public function withPort($port): UriInterface - { - $port = $this->filterPort($port); - - if ($this->port === $port) { - return $this; - } - - $new = clone $this; - $new->port = $port; - $new->composedComponents = null; - $new->removeDefaultPort(); - $new->validateState(); - - return $new; - } - - public function withPath($path): UriInterface - { - $path = $this->filterPath($path); - - if ($this->path === $path) { - return $this; - } - - $new = clone $this; - $new->path = $path; - $new->composedComponents = null; - $new->validateState(); - - return $new; - } - - public function withQuery($query): UriInterface - { - $query = $this->filterQueryAndFragment($query); - - if ($this->query === $query) { - return $this; - } - - $new = clone $this; - $new->query = $query; - $new->composedComponents = null; - - return $new; - } - - public function withFragment($fragment): UriInterface - { - $fragment = $this->filterQueryAndFragment($fragment); - - if ($this->fragment === $fragment) { - return $this; - } - - $new = clone $this; - $new->fragment = $fragment; - $new->composedComponents = null; - - return $new; - } - - /** - * Apply parse_url parts to a URI. - * - * @param array $parts Array of parse_url parts to apply. - */ - private function applyParts(array $parts): void - { - $this->scheme = isset($parts['scheme']) - ? $this->filterScheme($parts['scheme']) - : ''; - $this->userInfo = isset($parts['user']) - ? $this->filterUserInfoComponent($parts['user']) - : ''; - $this->host = isset($parts['host']) - ? $this->filterHost($parts['host']) - : ''; - $this->port = isset($parts['port']) - ? $this->filterPort($parts['port']) - : null; - $this->path = isset($parts['path']) - ? $this->filterPath($parts['path']) - : ''; - $this->query = isset($parts['query']) - ? $this->filterQueryAndFragment($parts['query']) - : ''; - $this->fragment = isset($parts['fragment']) - ? $this->filterQueryAndFragment($parts['fragment']) - : ''; - if (isset($parts['pass'])) { - $this->userInfo .= ':' . $this->filterUserInfoComponent($parts['pass']); - } - - $this->removeDefaultPort(); - } - - /** - * @param mixed $scheme - * - * @throws \InvalidArgumentException If the scheme is invalid. - */ - private function filterScheme($scheme): string - { - if (!is_string($scheme)) { - throw new \InvalidArgumentException('Scheme must be a string'); - } - - return \strtr($scheme, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); - } - - /** - * @param mixed $component - * - * @throws \InvalidArgumentException If the user info is invalid. - */ - private function filterUserInfoComponent($component): string - { - if (!is_string($component)) { - throw new \InvalidArgumentException('User info must be a string'); - } - - return preg_replace_callback( - '/(?:[^%' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . ']+|%(?![A-Fa-f0-9]{2}))/', - [$this, 'rawurlencodeMatchZero'], - $component - ); - } - - /** - * @param mixed $host - * - * @throws \InvalidArgumentException If the host is invalid. - */ - private function filterHost($host): string - { - if (!is_string($host)) { - throw new \InvalidArgumentException('Host must be a string'); - } - - return \strtr($host, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); - } - - /** - * @param mixed $port - * - * @throws \InvalidArgumentException If the port is invalid. - */ - private function filterPort($port): ?int - { - if ($port === null) { - return null; - } - - $port = (int) $port; - if (0 > $port || 0xffff < $port) { - throw new \InvalidArgumentException( - sprintf('Invalid port: %d. Must be between 0 and 65535', $port) - ); - } - - return $port; - } - - /** - * @param string[] $keys - * - * @return string[] - */ - private static function getFilteredQueryString(UriInterface $uri, array $keys): array - { - $current = $uri->getQuery(); - - if ($current === '') { - return []; - } - - $decodedKeys = array_map('rawurldecode', $keys); - - return array_filter(explode('&', $current), function ($part) use ($decodedKeys) { - return !in_array(rawurldecode(explode('=', $part)[0]), $decodedKeys, true); - }); - } - - private static function generateQueryString(string $key, ?string $value): string - { - // Query string separators ("=", "&") within the key or value need to be encoded - // (while preventing double-encoding) before setting the query string. All other - // chars that need percent-encoding will be encoded by withQuery(). - $queryString = strtr($key, self::QUERY_SEPARATORS_REPLACEMENT); - - if ($value !== null) { - $queryString .= '=' . strtr($value, self::QUERY_SEPARATORS_REPLACEMENT); - } - - return $queryString; - } - - private function removeDefaultPort(): void - { - if ($this->port !== null && self::isDefaultPort($this)) { - $this->port = null; - } - } - - /** - * Filters the path of a URI - * - * @param mixed $path - * - * @throws \InvalidArgumentException If the path is invalid. - */ - private function filterPath($path): string - { - if (!is_string($path)) { - throw new \InvalidArgumentException('Path must be a string'); - } - - return preg_replace_callback( - '/(?:[^' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . '%:@\/]++|%(?![A-Fa-f0-9]{2}))/', - [$this, 'rawurlencodeMatchZero'], - $path - ); - } - - /** - * Filters the query string or fragment of a URI. - * - * @param mixed $str - * - * @throws \InvalidArgumentException If the query or fragment is invalid. - */ - private function filterQueryAndFragment($str): string - { - if (!is_string($str)) { - throw new \InvalidArgumentException('Query and fragment must be a string'); - } - - return preg_replace_callback( - '/(?:[^' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . '%:@\/\?]++|%(?![A-Fa-f0-9]{2}))/', - [$this, 'rawurlencodeMatchZero'], - $str - ); - } - - private function rawurlencodeMatchZero(array $match): string - { - return rawurlencode($match[0]); - } - - private function validateState(): void - { - if ($this->host === '' && ($this->scheme === 'http' || $this->scheme === 'https')) { - $this->host = self::HTTP_DEFAULT_HOST; - } - - if ($this->getAuthority() === '') { - if (0 === strpos($this->path, '//')) { - throw new MalformedUriException('The path of a URI without an authority must not start with two slashes "//"'); - } - if ($this->scheme === '' && false !== strpos(explode('/', $this->path, 2)[0], ':')) { - throw new MalformedUriException('A relative URI must not have a path beginning with a segment containing a colon'); - } - } elseif (isset($this->path[0]) && $this->path[0] !== '/') { - throw new MalformedUriException('The path of a URI with an authority must start with a slash "/" or be empty'); - } - } -} diff --git a/vendor/guzzlehttp/psr7/src/UriNormalizer.php b/vendor/guzzlehttp/psr7/src/UriNormalizer.php deleted file mode 100644 index e12971e..0000000 --- a/vendor/guzzlehttp/psr7/src/UriNormalizer.php +++ /dev/null @@ -1,220 +0,0 @@ -getPath() === '' && - ($uri->getScheme() === 'http' || $uri->getScheme() === 'https') - ) { - $uri = $uri->withPath('/'); - } - - if ($flags & self::REMOVE_DEFAULT_HOST && $uri->getScheme() === 'file' && $uri->getHost() === 'localhost') { - $uri = $uri->withHost(''); - } - - if ($flags & self::REMOVE_DEFAULT_PORT && $uri->getPort() !== null && Uri::isDefaultPort($uri)) { - $uri = $uri->withPort(null); - } - - if ($flags & self::REMOVE_DOT_SEGMENTS && !Uri::isRelativePathReference($uri)) { - $uri = $uri->withPath(UriResolver::removeDotSegments($uri->getPath())); - } - - if ($flags & self::REMOVE_DUPLICATE_SLASHES) { - $uri = $uri->withPath(preg_replace('#//++#', '/', $uri->getPath())); - } - - if ($flags & self::SORT_QUERY_PARAMETERS && $uri->getQuery() !== '') { - $queryKeyValues = explode('&', $uri->getQuery()); - sort($queryKeyValues); - $uri = $uri->withQuery(implode('&', $queryKeyValues)); - } - - return $uri; - } - - /** - * Whether two URIs can be considered equivalent. - * - * Both URIs are normalized automatically before comparison with the given $normalizations bitmask. The method also - * accepts relative URI references and returns true when they are equivalent. This of course assumes they will be - * resolved against the same base URI. If this is not the case, determination of equivalence or difference of - * relative references does not mean anything. - * - * @param UriInterface $uri1 An URI to compare - * @param UriInterface $uri2 An URI to compare - * @param int $normalizations A bitmask of normalizations to apply, see constants - * - * @link https://tools.ietf.org/html/rfc3986#section-6.1 - */ - public static function isEquivalent(UriInterface $uri1, UriInterface $uri2, int $normalizations = self::PRESERVING_NORMALIZATIONS): bool - { - return (string) self::normalize($uri1, $normalizations) === (string) self::normalize($uri2, $normalizations); - } - - private static function capitalizePercentEncoding(UriInterface $uri): UriInterface - { - $regex = '/(?:%[A-Fa-f0-9]{2})++/'; - - $callback = function (array $match) { - return strtoupper($match[0]); - }; - - return - $uri->withPath( - preg_replace_callback($regex, $callback, $uri->getPath()) - )->withQuery( - preg_replace_callback($regex, $callback, $uri->getQuery()) - ); - } - - private static function decodeUnreservedCharacters(UriInterface $uri): UriInterface - { - $regex = '/%(?:2D|2E|5F|7E|3[0-9]|[46][1-9A-F]|[57][0-9A])/i'; - - $callback = function (array $match) { - return rawurldecode($match[0]); - }; - - return - $uri->withPath( - preg_replace_callback($regex, $callback, $uri->getPath()) - )->withQuery( - preg_replace_callback($regex, $callback, $uri->getQuery()) - ); - } - - private function __construct() - { - // cannot be instantiated - } -} diff --git a/vendor/guzzlehttp/psr7/src/UriResolver.php b/vendor/guzzlehttp/psr7/src/UriResolver.php deleted file mode 100644 index 426e5c9..0000000 --- a/vendor/guzzlehttp/psr7/src/UriResolver.php +++ /dev/null @@ -1,211 +0,0 @@ -getScheme() != '') { - return $rel->withPath(self::removeDotSegments($rel->getPath())); - } - - if ($rel->getAuthority() != '') { - $targetAuthority = $rel->getAuthority(); - $targetPath = self::removeDotSegments($rel->getPath()); - $targetQuery = $rel->getQuery(); - } else { - $targetAuthority = $base->getAuthority(); - if ($rel->getPath() === '') { - $targetPath = $base->getPath(); - $targetQuery = $rel->getQuery() != '' ? $rel->getQuery() : $base->getQuery(); - } else { - if ($rel->getPath()[0] === '/') { - $targetPath = $rel->getPath(); - } else { - if ($targetAuthority != '' && $base->getPath() === '') { - $targetPath = '/' . $rel->getPath(); - } else { - $lastSlashPos = strrpos($base->getPath(), '/'); - if ($lastSlashPos === false) { - $targetPath = $rel->getPath(); - } else { - $targetPath = substr($base->getPath(), 0, $lastSlashPos + 1) . $rel->getPath(); - } - } - } - $targetPath = self::removeDotSegments($targetPath); - $targetQuery = $rel->getQuery(); - } - } - - return new Uri(Uri::composeComponents( - $base->getScheme(), - $targetAuthority, - $targetPath, - $targetQuery, - $rel->getFragment() - )); - } - - /** - * Returns the target URI as a relative reference from the base URI. - * - * This method is the counterpart to resolve(): - * - * (string) $target === (string) UriResolver::resolve($base, UriResolver::relativize($base, $target)) - * - * One use-case is to use the current request URI as base URI and then generate relative links in your documents - * to reduce the document size or offer self-contained downloadable document archives. - * - * $base = new Uri('http://example.com/a/b/'); - * echo UriResolver::relativize($base, new Uri('http://example.com/a/b/c')); // prints 'c'. - * echo UriResolver::relativize($base, new Uri('http://example.com/a/x/y')); // prints '../x/y'. - * echo UriResolver::relativize($base, new Uri('http://example.com/a/b/?q')); // prints '?q'. - * echo UriResolver::relativize($base, new Uri('http://example.org/a/b/')); // prints '//example.org/a/b/'. - * - * This method also accepts a target that is already relative and will try to relativize it further. Only a - * relative-path reference will be returned as-is. - * - * echo UriResolver::relativize($base, new Uri('/a/b/c')); // prints 'c' as well - */ - public static function relativize(UriInterface $base, UriInterface $target): UriInterface - { - if ($target->getScheme() !== '' && - ($base->getScheme() !== $target->getScheme() || $target->getAuthority() === '' && $base->getAuthority() !== '') - ) { - return $target; - } - - if (Uri::isRelativePathReference($target)) { - // As the target is already highly relative we return it as-is. It would be possible to resolve - // the target with `$target = self::resolve($base, $target);` and then try make it more relative - // by removing a duplicate query. But let's not do that automatically. - return $target; - } - - if ($target->getAuthority() !== '' && $base->getAuthority() !== $target->getAuthority()) { - return $target->withScheme(''); - } - - // We must remove the path before removing the authority because if the path starts with two slashes, the URI - // would turn invalid. And we also cannot set a relative path before removing the authority, as that is also - // invalid. - $emptyPathUri = $target->withScheme('')->withPath('')->withUserInfo('')->withPort(null)->withHost(''); - - if ($base->getPath() !== $target->getPath()) { - return $emptyPathUri->withPath(self::getRelativePath($base, $target)); - } - - if ($base->getQuery() === $target->getQuery()) { - // Only the target fragment is left. And it must be returned even if base and target fragment are the same. - return $emptyPathUri->withQuery(''); - } - - // If the base URI has a query but the target has none, we cannot return an empty path reference as it would - // inherit the base query component when resolving. - if ($target->getQuery() === '') { - $segments = explode('/', $target->getPath()); - /** @var string $lastSegment */ - $lastSegment = end($segments); - - return $emptyPathUri->withPath($lastSegment === '' ? './' : $lastSegment); - } - - return $emptyPathUri; - } - - private static function getRelativePath(UriInterface $base, UriInterface $target): string - { - $sourceSegments = explode('/', $base->getPath()); - $targetSegments = explode('/', $target->getPath()); - array_pop($sourceSegments); - $targetLastSegment = array_pop($targetSegments); - foreach ($sourceSegments as $i => $segment) { - if (isset($targetSegments[$i]) && $segment === $targetSegments[$i]) { - unset($sourceSegments[$i], $targetSegments[$i]); - } else { - break; - } - } - $targetSegments[] = $targetLastSegment; - $relativePath = str_repeat('../', count($sourceSegments)) . implode('/', $targetSegments); - - // A reference to am empty last segment or an empty first sub-segment must be prefixed with "./". - // This also applies to a segment with a colon character (e.g., "file:colon") that cannot be used - // as the first segment of a relative-path reference, as it would be mistaken for a scheme name. - if ('' === $relativePath || false !== strpos(explode('/', $relativePath, 2)[0], ':')) { - $relativePath = "./$relativePath"; - } elseif ('/' === $relativePath[0]) { - if ($base->getAuthority() != '' && $base->getPath() === '') { - // In this case an extra slash is added by resolve() automatically. So we must not add one here. - $relativePath = ".$relativePath"; - } else { - $relativePath = "./$relativePath"; - } - } - - return $relativePath; - } - - private function __construct() - { - // cannot be instantiated - } -} diff --git a/vendor/guzzlehttp/psr7/src/Utils.php b/vendor/guzzlehttp/psr7/src/Utils.php deleted file mode 100644 index 6cc04ee..0000000 --- a/vendor/guzzlehttp/psr7/src/Utils.php +++ /dev/null @@ -1,412 +0,0 @@ - $v) { - if (!is_string($k) || !in_array(strtolower($k), $keys)) { - $result[$k] = $v; - } - } - - return $result; - } - - /** - * Copy the contents of a stream into another stream until the given number - * of bytes have been read. - * - * @param StreamInterface $source Stream to read from - * @param StreamInterface $dest Stream to write to - * @param int $maxLen Maximum number of bytes to read. Pass -1 - * to read the entire stream. - * - * @throws \RuntimeException on error. - */ - public static function copyToStream(StreamInterface $source, StreamInterface $dest, int $maxLen = -1): void - { - $bufferSize = 8192; - - if ($maxLen === -1) { - while (!$source->eof()) { - if (!$dest->write($source->read($bufferSize))) { - break; - } - } - } else { - $remaining = $maxLen; - while ($remaining > 0 && !$source->eof()) { - $buf = $source->read(min($bufferSize, $remaining)); - $len = strlen($buf); - if (!$len) { - break; - } - $remaining -= $len; - $dest->write($buf); - } - } - } - - /** - * Copy the contents of a stream into a string until the given number of - * bytes have been read. - * - * @param StreamInterface $stream Stream to read - * @param int $maxLen Maximum number of bytes to read. Pass -1 - * to read the entire stream. - * - * @throws \RuntimeException on error. - */ - public static function copyToString(StreamInterface $stream, int $maxLen = -1): string - { - $buffer = ''; - - if ($maxLen === -1) { - while (!$stream->eof()) { - $buf = $stream->read(1048576); - if ($buf === '') { - break; - } - $buffer .= $buf; - } - return $buffer; - } - - $len = 0; - while (!$stream->eof() && $len < $maxLen) { - $buf = $stream->read($maxLen - $len); - if ($buf === '') { - break; - } - $buffer .= $buf; - $len = strlen($buffer); - } - - return $buffer; - } - - /** - * Calculate a hash of a stream. - * - * This method reads the entire stream to calculate a rolling hash, based - * on PHP's `hash_init` functions. - * - * @param StreamInterface $stream Stream to calculate the hash for - * @param string $algo Hash algorithm (e.g. md5, crc32, etc) - * @param bool $rawOutput Whether or not to use raw output - * - * @throws \RuntimeException on error. - */ - public static function hash(StreamInterface $stream, string $algo, bool $rawOutput = false): string - { - $pos = $stream->tell(); - - if ($pos > 0) { - $stream->rewind(); - } - - $ctx = hash_init($algo); - while (!$stream->eof()) { - hash_update($ctx, $stream->read(1048576)); - } - - $out = hash_final($ctx, (bool) $rawOutput); - $stream->seek($pos); - - return $out; - } - - /** - * Clone and modify a request with the given changes. - * - * This method is useful for reducing the number of clones needed to mutate - * a message. - * - * The changes can be one of: - * - method: (string) Changes the HTTP method. - * - set_headers: (array) Sets the given headers. - * - remove_headers: (array) Remove the given headers. - * - body: (mixed) Sets the given body. - * - uri: (UriInterface) Set the URI. - * - query: (string) Set the query string value of the URI. - * - version: (string) Set the protocol version. - * - * @param RequestInterface $request Request to clone and modify. - * @param array $changes Changes to apply. - */ - public static function modifyRequest(RequestInterface $request, array $changes): RequestInterface - { - if (!$changes) { - return $request; - } - - $headers = $request->getHeaders(); - - if (!isset($changes['uri'])) { - $uri = $request->getUri(); - } else { - // Remove the host header if one is on the URI - if ($host = $changes['uri']->getHost()) { - $changes['set_headers']['Host'] = $host; - - if ($port = $changes['uri']->getPort()) { - $standardPorts = ['http' => 80, 'https' => 443]; - $scheme = $changes['uri']->getScheme(); - if (isset($standardPorts[$scheme]) && $port != $standardPorts[$scheme]) { - $changes['set_headers']['Host'] .= ':' . $port; - } - } - } - $uri = $changes['uri']; - } - - if (!empty($changes['remove_headers'])) { - $headers = self::caselessRemove($changes['remove_headers'], $headers); - } - - if (!empty($changes['set_headers'])) { - $headers = self::caselessRemove(array_keys($changes['set_headers']), $headers); - $headers = $changes['set_headers'] + $headers; - } - - if (isset($changes['query'])) { - $uri = $uri->withQuery($changes['query']); - } - - if ($request instanceof ServerRequestInterface) { - $new = (new ServerRequest( - $changes['method'] ?? $request->getMethod(), - $uri, - $headers, - $changes['body'] ?? $request->getBody(), - $changes['version'] ?? $request->getProtocolVersion(), - $request->getServerParams() - )) - ->withParsedBody($request->getParsedBody()) - ->withQueryParams($request->getQueryParams()) - ->withCookieParams($request->getCookieParams()) - ->withUploadedFiles($request->getUploadedFiles()); - - foreach ($request->getAttributes() as $key => $value) { - $new = $new->withAttribute($key, $value); - } - - return $new; - } - - return new Request( - $changes['method'] ?? $request->getMethod(), - $uri, - $headers, - $changes['body'] ?? $request->getBody(), - $changes['version'] ?? $request->getProtocolVersion() - ); - } - - /** - * Read a line from the stream up to the maximum allowed buffer length. - * - * @param StreamInterface $stream Stream to read from - * @param int|null $maxLength Maximum buffer length - */ - public static function readLine(StreamInterface $stream, ?int $maxLength = null): string - { - $buffer = ''; - $size = 0; - - while (!$stream->eof()) { - if ('' === ($byte = $stream->read(1))) { - return $buffer; - } - $buffer .= $byte; - // Break when a new line is found or the max length - 1 is reached - if ($byte === "\n" || ++$size === $maxLength - 1) { - break; - } - } - - return $buffer; - } - - /** - * Create a new stream based on the input type. - * - * Options is an associative array that can contain the following keys: - * - metadata: Array of custom metadata. - * - size: Size of the stream. - * - * This method accepts the following `$resource` types: - * - `Psr\Http\Message\StreamInterface`: Returns the value as-is. - * - `string`: Creates a stream object that uses the given string as the contents. - * - `resource`: Creates a stream object that wraps the given PHP stream resource. - * - `Iterator`: If the provided value implements `Iterator`, then a read-only - * stream object will be created that wraps the given iterable. Each time the - * stream is read from, data from the iterator will fill a buffer and will be - * continuously called until the buffer is equal to the requested read size. - * Subsequent read calls will first read from the buffer and then call `next` - * on the underlying iterator until it is exhausted. - * - `object` with `__toString()`: If the object has the `__toString()` method, - * the object will be cast to a string and then a stream will be returned that - * uses the string value. - * - `NULL`: When `null` is passed, an empty stream object is returned. - * - `callable` When a callable is passed, a read-only stream object will be - * created that invokes the given callable. The callable is invoked with the - * number of suggested bytes to read. The callable can return any number of - * bytes, but MUST return `false` when there is no more data to return. The - * stream object that wraps the callable will invoke the callable until the - * number of requested bytes are available. Any additional bytes will be - * buffered and used in subsequent reads. - * - * @param resource|string|int|float|bool|StreamInterface|callable|\Iterator|null $resource Entity body data - * @param array{size?: int, metadata?: array} $options Additional options - * - * @throws \InvalidArgumentException if the $resource arg is not valid. - */ - public static function streamFor($resource = '', array $options = []): StreamInterface - { - if (is_scalar($resource)) { - $stream = self::tryFopen('php://temp', 'r+'); - if ($resource !== '') { - fwrite($stream, (string) $resource); - fseek($stream, 0); - } - return new Stream($stream, $options); - } - - switch (gettype($resource)) { - case 'resource': - /* - * The 'php://input' is a special stream with quirks and inconsistencies. - * We avoid using that stream by reading it into php://temp - */ - - /** @var resource $resource */ - if ((\stream_get_meta_data($resource)['uri'] ?? '') === 'php://input') { - $stream = self::tryFopen('php://temp', 'w+'); - fwrite($stream, stream_get_contents($resource)); - fseek($stream, 0); - $resource = $stream; - } - return new Stream($resource, $options); - case 'object': - /** @var object $resource */ - if ($resource instanceof StreamInterface) { - return $resource; - } elseif ($resource instanceof \Iterator) { - return new PumpStream(function () use ($resource) { - if (!$resource->valid()) { - return false; - } - $result = $resource->current(); - $resource->next(); - return $result; - }, $options); - } elseif (method_exists($resource, '__toString')) { - return self::streamFor((string) $resource, $options); - } - break; - case 'NULL': - return new Stream(self::tryFopen('php://temp', 'r+'), $options); - } - - if (is_callable($resource)) { - return new PumpStream($resource, $options); - } - - throw new \InvalidArgumentException('Invalid resource type: ' . gettype($resource)); - } - - /** - * Safely opens a PHP stream resource using a filename. - * - * When fopen fails, PHP normally raises a warning. This function adds an - * error handler that checks for errors and throws an exception instead. - * - * @param string $filename File to open - * @param string $mode Mode used to open the file - * - * @return resource - * - * @throws \RuntimeException if the file cannot be opened - */ - public static function tryFopen(string $filename, string $mode) - { - $ex = null; - set_error_handler(static function (int $errno, string $errstr) use ($filename, $mode, &$ex): bool { - $ex = new \RuntimeException(sprintf( - 'Unable to open "%s" using mode "%s": %s', - $filename, - $mode, - $errstr - )); - - return true; - }); - - try { - /** @var resource $handle */ - $handle = fopen($filename, $mode); - } catch (\Throwable $e) { - $ex = new \RuntimeException(sprintf( - 'Unable to open "%s" using mode "%s": %s', - $filename, - $mode, - $e->getMessage() - ), 0, $e); - } - - restore_error_handler(); - - if ($ex) { - /** @var $ex \RuntimeException */ - throw $ex; - } - - return $handle; - } - - /** - * Returns a UriInterface for the given value. - * - * This function accepts a string or UriInterface and returns a - * UriInterface for the given value. If the value is already a - * UriInterface, it is returned as-is. - * - * @param string|UriInterface $uri - * - * @throws \InvalidArgumentException - */ - public static function uriFor($uri): UriInterface - { - if ($uri instanceof UriInterface) { - return $uri; - } - - if (is_string($uri)) { - return new Uri($uri); - } - - throw new \InvalidArgumentException('URI must be a string or UriInterface'); - } -} diff --git a/vendor/guzzlehttp/psr7/vendor-bin/php-cs-fixer/composer.json b/vendor/guzzlehttp/psr7/vendor-bin/php-cs-fixer/composer.json deleted file mode 100644 index d69a683..0000000 --- a/vendor/guzzlehttp/psr7/vendor-bin/php-cs-fixer/composer.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "require": { - "php": "^7.2.5 || ^8.0", - "friendsofphp/php-cs-fixer": "3.2.1" - }, - "config": { - "preferred-install": "dist" - } -} diff --git a/vendor/guzzlehttp/psr7/vendor-bin/phpstan/composer.json b/vendor/guzzlehttp/psr7/vendor-bin/phpstan/composer.json deleted file mode 100644 index bfbc727..0000000 --- a/vendor/guzzlehttp/psr7/vendor-bin/phpstan/composer.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "require": { - "php": "^7.2.5 || ^8.0", - "phpstan/phpstan": "0.12.81", - "phpstan/phpstan-deprecation-rules": "0.12.6" - }, - "config": { - "preferred-install": "dist" - } -} diff --git a/vendor/guzzlehttp/psr7/vendor-bin/psalm/composer.json b/vendor/guzzlehttp/psr7/vendor-bin/psalm/composer.json deleted file mode 100644 index 535a079..0000000 --- a/vendor/guzzlehttp/psr7/vendor-bin/psalm/composer.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "require": { - "php": "^7.2.5 || ^8.0", - "psalm/phar": "4.6.2" - }, - "config": { - "preferred-install": "dist" - } -} diff --git a/vendor/hamcrest/hamcrest-php/.coveralls.yml b/vendor/hamcrest/hamcrest-php/.coveralls.yml deleted file mode 100644 index f2f9ed5..0000000 --- a/vendor/hamcrest/hamcrest-php/.coveralls.yml +++ /dev/null @@ -1 +0,0 @@ -src_dir: hamcrest diff --git a/vendor/hamcrest/hamcrest-php/.github/workflows/tests.yml b/vendor/hamcrest/hamcrest-php/.github/workflows/tests.yml deleted file mode 100644 index 06255a1..0000000 --- a/vendor/hamcrest/hamcrest-php/.github/workflows/tests.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: tests - -on: - push: - pull_request: - -jobs: - tests: - - runs-on: ubuntu-latest - strategy: - matrix: - php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0'] - - name: PHP ${{ matrix.php }} - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: curl - tools: composer:v2 - coverage: none - - - name: Install PHP 7 dependencies - run: composer update --prefer-dist --no-interaction --no-progress - if: "matrix.php != '8.0'" - - - name: Install PHP 8 dependencies - run: composer update --prefer-dist --no-interaction --no-progress --ignore-platform-reqs - if: "matrix.php == '8.0'" - - - name: Execute tests - run: vendor/bin/phpunit -c tests/phpunit.xml.dist diff --git a/vendor/hamcrest/hamcrest-php/.gitignore b/vendor/hamcrest/hamcrest-php/.gitignore deleted file mode 100644 index 987e2a2..0000000 --- a/vendor/hamcrest/hamcrest-php/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -composer.lock -vendor diff --git a/vendor/hamcrest/hamcrest-php/.gush.yml b/vendor/hamcrest/hamcrest-php/.gush.yml deleted file mode 100644 index b7c226d..0000000 --- a/vendor/hamcrest/hamcrest-php/.gush.yml +++ /dev/null @@ -1,7 +0,0 @@ -adapter: github -issue_tracker: github -meta-header: "Copyright (c) 2009-2015 hamcrest.org" -table-pr: - fixed_tickets: ['Fixed Tickets', ''] - license: ['License', MIT] -base: master diff --git a/vendor/hamcrest/hamcrest-php/.travis.yml b/vendor/hamcrest/hamcrest-php/.travis.yml deleted file mode 100644 index 3b5651f..0000000 --- a/vendor/hamcrest/hamcrest-php/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -language: php - -dist: trusty - -matrix: - include: - - name: PHP 5.3 - php: 5.3 - dist: precise - - name: PHP 5.4 - php: 5.4 - - name: PHP 5.5 - php: 5.5 - - name: PHP 5.6 - php: 5.6 - - name: HHVM 3.18 - php: hhvm-3.18 - -install: - - travis_retry composer update --prefer-dist --no-progress - -script: - - vendor/bin/phpunit -c tests/phpunit.xml.dist diff --git a/vendor/hamcrest/hamcrest-php/CHANGES.txt b/vendor/hamcrest/hamcrest-php/CHANGES.txt deleted file mode 100644 index bad8bcf..0000000 --- a/vendor/hamcrest/hamcrest-php/CHANGES.txt +++ /dev/null @@ -1,173 +0,0 @@ -== Version 2.0.1: Released Jul 09 2020 == - -* Added support for PHP 8 - - -== Version 2.0: Released Feb 26 2016 == - -* Removed automatic loading of global functions - - -== Version 1.1.0: Released Feb 2 2012 == - -Issues Fixed: 121, 138, 147 - -* Added non-empty matchers to complement the emptiness-matching forms. - - - nonEmptyString() - - nonEmptyArray() - - nonEmptyTraversable() - -* Added ability to pass variable arguments to several array-based matcher - factory methods so they work like allOf() et al. - - - anArray() - - arrayContainingInAnyOrder(), containsInAnyOrder() - - arrayContaining(), contains() - - stringContainsInOrder() - -* Matchers that accept an array of matchers now also accept variable arguments. - Any non-matcher arguments are wrapped by IsEqual. - -* Added noneOf() as a shortcut for not(anyOf()). - - -== Version 1.0.0: Released Jan 20 2012 == - -Issues Fixed: 119, 136, 139, 141, 148, 149, 172 - -* Moved hamcrest.php into Hamcrest folder and renamed to Hamcrest.php. - This is more in line with PEAR packaging standards. - -* Renamed callable() to callableValue() for compatibility with PHP 5.4. - -* Added Hamcrest_Text_StringContainsIgnoringCase to assert using stripos(). - - assertThat('fOObAr', containsStringIgnoringCase('oba')); - assertThat('fOObAr', containsString('oba')->ignoringCase()); - -* Fixed Hamcrest_Core_IsInstanceOf to return false for native types. - -* Moved string-based matchers to Hamcrest_Text package. - StringContains, StringEndsWith, StringStartsWith, and SubstringMatcher - -* Hamcrest.php and Hamcrest_Matchers.php are now built from @factory doctags. - Added @factory doctag to every static factory method. - -* Hamcrest_Matchers and Hamcrest.php now import each matcher as-needed - and Hamcrest.php calls the matchers directly instead of Hamcrest_Matchers. - - -== Version 0.3.0: Released Jul 26 2010 == - -* Added running count to Hamcrest_MatcherAssert with methods to get and reset it. - This can be used by unit testing frameworks for reporting. - -* Added Hamcrest_Core_HasToString to assert return value of toString() or __toString(). - - assertThat($anObject, hasToString('foo')); - -* Added Hamcrest_Type_IsScalar to assert is_scalar(). - Matches values of type bool, int, float, double, and string. - - assertThat($count, scalarValue()); - assertThat('foo', scalarValue()); - -* Added Hamcrest_Collection package. - - - IsEmptyTraversable - - IsTraversableWithSize - - assertThat($iterator, emptyTraversable()); - assertThat($iterator, traversableWithSize(5)); - -* Added Hamcrest_Xml_HasXPath to assert XPath expressions or the content of nodes in an XML/HTML DOM. - - assertThat($dom, hasXPath('books/book/title')); - assertThat($dom, hasXPath('books/book[contains(title, "Alice")]', 3)); - assertThat($dom, hasXPath('books/book/title', 'Alice in Wonderland')); - assertThat($dom, hasXPath('count(books/book)', greaterThan(10))); - -* Added aliases to match the Java API. - - hasEntry() -> hasKeyValuePair() - hasValue() -> hasItemInArray() - contains() -> arrayContaining() - containsInAnyOrder() -> arrayContainingInAnyOrder() - -* Added optional subtype to Hamcrest_TypeSafeMatcher to enforce object class or resource type. - -* Hamcrest_TypeSafeDiagnosingMatcher now extends Hamcrest_TypeSafeMatcher. - - -== Version 0.2.0: Released Jul 14 2010 == - -Issues Fixed: 109, 111, 114, 115 - -* Description::appendValues() and appendValueList() accept Iterator and IteratorAggregate. [111] - BaseDescription::appendValue() handles IteratorAggregate. - -* assertThat() accepts a single boolean parameter and - wraps any non-Matcher third parameter with equalTo(). - -* Removed null return value from assertThat(). [114] - -* Fixed wrong variable name in contains(). [109] - -* Added Hamcrest_Core_IsSet to assert isset(). - - assertThat(array('foo' => 'bar'), set('foo')); - assertThat(array('foo' => 'bar'), notSet('bar')); - -* Added Hamcrest_Core_IsTypeOf to assert built-in types with gettype(). [115] - Types: array, boolean, double, integer, null, object, resource, and string. - Note that gettype() returns "double" for float values. - - assertThat($count, typeOf('integer')); - assertThat(3.14159, typeOf('double')); - assertThat(array('foo', 'bar'), typeOf('array')); - assertThat(new stdClass(), typeOf('object')); - -* Added type-specific matchers in new Hamcrest_Type package. - - - IsArray - - IsBoolean - - IsDouble (includes float values) - - IsInteger - - IsObject - - IsResource - - IsString - - assertThat($count, integerValue()); - assertThat(3.14159, floatValue()); - assertThat('foo', stringValue()); - -* Added Hamcrest_Type_IsNumeric to assert is_numeric(). - Matches values of type int and float/double or strings that are formatted as numbers. - - assertThat(5, numericValue()); - assertThat('-5e+3', numericValue()); - -* Added Hamcrest_Type_IsCallable to assert is_callable(). - - assertThat('preg_match', callable()); - assertThat(array('SomeClass', 'SomeMethod'), callable()); - assertThat(array($object, 'SomeMethod'), callable()); - assertThat($object, callable()); - assertThat(function ($x, $y) { return $x + $y; }, callable()); - -* Added Hamcrest_Text_MatchesPattern for regex matching with preg_match(). - - assertThat('foobar', matchesPattern('/o+b/')); - -* Added aliases: - - atLeast() for greaterThanOrEqualTo() - - atMost() for lessThanOrEqualTo() - - -== Version 0.1.0: Released Jul 7 2010 == - -* Created PEAR package - -* Core matchers - diff --git a/vendor/hamcrest/hamcrest-php/LICENSE.txt b/vendor/hamcrest/hamcrest-php/LICENSE.txt deleted file mode 100644 index 91cd329..0000000 --- a/vendor/hamcrest/hamcrest-php/LICENSE.txt +++ /dev/null @@ -1,27 +0,0 @@ -BSD License - -Copyright (c) 2000-2014, www.hamcrest.org -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -Redistributions of source code must retain the above copyright notice, this list of -conditions and the following disclaimer. Redistributions in binary form must reproduce -the above copyright notice, this list of conditions and the following disclaimer in -the documentation and/or other materials provided with the distribution. - -Neither the name of Hamcrest nor the names of its contributors may be used to endorse -or promote products derived from this software without specific prior written -permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT -SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY -WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. diff --git a/vendor/hamcrest/hamcrest-php/README.md b/vendor/hamcrest/hamcrest-php/README.md deleted file mode 100644 index 52e2041..0000000 --- a/vendor/hamcrest/hamcrest-php/README.md +++ /dev/null @@ -1,488 +0,0 @@ -This is the PHP port of Hamcrest Matchers -========================================= - -[![Build Status](https://travis-ci.org/hamcrest/hamcrest-php.png?branch=master)](https://travis-ci.org/hamcrest/hamcrest-php) - -Hamcrest is a matching library originally written for Java, but -subsequently ported to many other languages. hamcrest-php is the -official PHP port of Hamcrest and essentially follows a literal -translation of the original Java API for Hamcrest, with a few -Exceptions, mostly down to PHP language barriers: - - 1. `instanceOf($theClass)` is actually `anInstanceOf($theClass)` - - 2. `both(containsString('a'))->and(containsString('b'))` - is actually `both(containsString('a'))->andAlso(containsString('b'))` - - 3. `either(containsString('a'))->or(containsString('b'))` - is actually `either(containsString('a'))->orElse(containsString('b'))` - - 4. Unless it would be non-semantic for a matcher to do so, hamcrest-php - allows dynamic typing for it's input, in "the PHP way". Exception are - where semantics surrounding the type itself would suggest otherwise, - such as stringContains() and greaterThan(). - - 5. Several official matchers have not been ported because they don't - make sense or don't apply in PHP: - - - `typeCompatibleWith($theClass)` - - `eventFrom($source)` - - `hasProperty($name)` ** - - `samePropertyValuesAs($obj)` ** - - 6. When most of the collections matchers are finally ported, PHP-specific - aliases will probably be created due to a difference in naming - conventions between Java's Arrays, Collections, Sets and Maps compared - with PHP's Arrays. - ---- -** [Unless we consider POPO's (Plain Old PHP Objects) akin to JavaBeans] - - The POPO thing is a joke. Java devs coin the term POJO's (Plain Old - Java Objects). - - -Usage ------ - -Hamcrest matchers are easy to use as: - -```php -Hamcrest_MatcherAssert::assertThat('a', Hamcrest_Matchers::equalToIgnoringCase('A')); -``` - -Alternatively, you can use the global proxy-functions: - -```php -$result = true; -// with an identifier -assertThat("result should be true", $result, equalTo(true)); - -// without an identifier -assertThat($result, equalTo(true)); - -// evaluate a boolean expression -assertThat($result === true); - -// with syntactic sugar is() -assertThat(true, is(true)); -``` - -:warning: **NOTE:** the global proxy-functions aren't autoloaded by default, so you will need to load them first: - -```php -\Hamcrest\Util::registerGlobalFunctions(); -``` - -For brevity, all of the examples below use the proxy-functions. - - -Documentation -------------- -A tutorial can be found on the [Hamcrest site](https://code.google.com/archive/p/hamcrest/wikis/TutorialPHP.wiki). - - -Available Matchers ------------------- -* [Array](../master/README.md#array) -* [Collection](../master/README.md#collection) -* [Object](../master/README.md#object) -* [Numbers](../master/README.md#numbers) -* [Type checking](../master/README.md#type-checking) -* [XML](../master/README.md#xml) - - -### Array - -* `anArray` - evaluates an array -```php -assertThat([], anArray()); -``` - -* `hasItemInArray` - check if item exists in array -```php -$list = range(2, 7, 2); -$item = 4; -assertThat($list, hasItemInArray($item)); -``` - -* `hasValue` - alias of hasItemInArray - -* `arrayContainingInAnyOrder` - check if array contains elements in any order -```php -assertThat([2, 4, 6], arrayContainingInAnyOrder([6, 4, 2])); -assertThat([2, 4, 6], arrayContainingInAnyOrder([4, 2, 6])); -``` - -* `containsInAnyOrder` - alias of arrayContainingInAnyOrder - -* `arrayContaining` - An array with elements that match the given matchers in the same order. -```php -assertThat([2, 4, 6], arrayContaining([2, 4, 6])); -assertthat([2, 4, 6], not(arrayContaining([6, 4, 2]))); -``` - -* `contains` - check array in same order -```php -assertThat([2, 4, 6], contains([2, 4, 6])); -``` - -* `hasKeyInArray` - check if array has given key -```php -assertThat(['name'=> 'foobar'], hasKeyInArray('name')); -``` - -* `hasKey` - alias of hasKeyInArray - -* `hasKeyValuePair` - check if arary has given key, value pair -```php -assertThat(['name'=> 'foobar'], hasKeyValuePair('name', 'foobar')); -``` -* `hasEntry` - same as hasKeyValuePair - -* `arrayWithSize` - check array has given size -```php -assertthat([2, 4, 6], arrayWithSize(3)); -``` -* `emptyArray` - check if array is emtpy -```php -assertThat([], emptyArray()); -``` - -* `nonEmptyArray` -```php -assertThat([1], nonEmptyArray()); -``` - -### Collection - -* `emptyTraversable` - check if traversable is empty -```php -$empty_it = new EmptyIterator; -assertThat($empty_it, emptyTraversable()); -``` - -* `nonEmptyTraversable` - check if traversable isn't empty -```php -$non_empty_it = new ArrayIterator(range(1, 10)); -assertThat($non_empty_it, nonEmptyTraversable()); -a -``` - -* `traversableWithSize` -```php -$non_empty_it = new ArrayIterator(range(1, 10)); -assertThat($non_empty_it, traversableWithSize(count(range(1, 10)))); -` -``` - -### Core - -* `allOf` - Evaluates to true only if ALL of the passed in matchers evaluate to true. -```php -assertThat([2,4,6], allOf(hasValue(2), arrayWithSize(3))); -``` - -* `anyOf` - Evaluates to true if ANY of the passed in matchers evaluate to true. -```php -assertThat([2, 4, 6], anyOf(hasValue(8), hasValue(2))); -``` - -* `noneOf` - Evaluates to false if ANY of the passed in matchers evaluate to true. -```php -assertThat([2, 4, 6], noneOf(hasValue(1), hasValue(3))); -``` - -* `both` + `andAlso` - This is useful for fluently combining matchers that must both pass. -```php -assertThat([2, 4, 6], both(hasValue(2))->andAlso(hasValue(4))); -``` - -* `either` + `orElse` - This is useful for fluently combining matchers where either may pass, -```php -assertThat([2, 4, 6], either(hasValue(2))->orElse(hasValue(4))); -``` - -* `describedAs` - Wraps an existing matcher and overrides the description when it fails. -```php -$expected = "Dog"; -$found = null; -// this assertion would result error message as Expected: is not null but: was null -//assertThat("Expected {$expected}, got {$found}", $found, is(notNullValue())); -// and this assertion would result error message as Expected: Dog but: was null -//assertThat($found, describedAs($expected, notNullValue())); -``` - -* `everyItem` - A matcher to apply to every element in an array. -```php -assertThat([2, 4, 6], everyItem(notNullValue())); -``` - -* `hasItem` - check array has given item, it can take a matcher argument -```php -assertThat([2, 4, 6], hasItem(equalTo(2))); -``` - -* `hasItems` - check array has givem items, it can take multiple matcher as arguments -```php -assertThat([1, 3, 5], hasItems(equalTo(1), equalTo(3))); -``` - -### Object - -* `hasToString` - check `__toString` or `toString` method -```php -class Foo { - public $name = null; - - public function __toString() { - return "[Foo]Instance"; - } -} -$foo = new Foo; -assertThat($foo, hasToString(equalTo("[Foo]Instance"))); -``` - -* `equalTo` - compares two instances using comparison operator '==' -```php -$foo = new Foo; -$foo2 = new Foo; -assertThat($foo, equalTo($foo2)); -``` - -* `identicalTo` - compares two instances using identity operator '===' -```php -assertThat($foo, is(not(identicalTo($foo2)))); -``` - -* `anInstanceOf` - check instance is an instance|sub-class of given class -```php -assertThat($foo, anInstanceOf(Foo::class)); -``` - -* `any` - alias of `anInstanceOf` - -* `nullValue` check null -```php -assertThat(null, is(nullValue())); -``` - -* `notNullValue` check not null -```php -assertThat("", notNullValue()); -``` - -* `sameInstance` - check for same instance -```php -assertThat($foo, is(not(sameInstance($foo2)))); -assertThat($foo, is(sameInstance($foo))); -``` - -* `typeOf`- check type -```php -assertThat(1, typeOf("integer")); -``` - -* `notSet` - check if instance property is not set -```php -assertThat($foo, notSet("name")); -``` - -* `set` - check if instance property is set -```php -$foo->name = "bar"; -assertThat($foo, set("name")); -``` - -### Numbers - -* `closeTo` - check value close to a range -```php -assertThat(3, closeTo(3, 0.5)); -``` - -* `comparesEqualTo` - check with '==' -```php -assertThat(2, comparesEqualTo(2)); -``` - -* `greaterThan` - check '>' -``` -assertThat(2, greaterThan(1)); -``` - -* `greaterThanOrEqualTo` -```php -assertThat(2, greaterThanOrEqualTo(2)); -``` - -* `atLeast` - The value is >= given value -```php -assertThat(3, atLeast(2)); -``` -* `lessThan` -```php -assertThat(2, lessThan(3)); -``` - -* `lessThanOrEqualTo` -```php -assertThat(2, lessThanOrEqualTo(3)); -``` - -* `atMost` - The value is <= given value -```php -assertThat(2, atMost(3)); -``` - -### String - -* `emptyString` - check for empty string -```php -assertThat("", emptyString()); -``` - -* `isEmptyOrNullString` -```php -assertThat(null, isEmptyOrNullString()); -``` - -* `nullOrEmptyString` -```php -assertThat("", nullOrEmptyString()); -``` - -* `isNonEmptyString` -```php -assertThat("foo", isNonEmptyString()); -``` - -* `nonEmptyString` -```php -assertThat("foo", nonEmptyString()); -``` - -* `equalToIgnoringCase` -```php -assertThat("Foo", equalToIgnoringCase("foo")); -``` -* `equalToIgnoringWhiteSpace` -```php -assertThat(" Foo ", equalToIgnoringWhiteSpace("Foo")); -``` - -* `matchesPattern` - matches with regex pattern -```php -assertThat("foobarbaz", matchesPattern('/(foo)(bar)(baz)/')); -``` - -* `containsString` - check for substring -```php -assertThat("foobar", containsString("foo")); -``` - -* `containsStringIgnoringCase` -```php -assertThat("fooBar", containsStringIgnoringCase("bar")); -``` - -* `stringContainsInOrder` -```php -assertThat("foo", stringContainsInOrder("foo")); -``` - -* `endsWith` - check string that ends with given value -```php -assertThat("foo", endsWith("oo")); -``` - -* `startsWith` - check string that starts with given value -```php -assertThat("bar", startsWith("ba")); -``` - -### Type-checking - -* `arrayValue` - check array type -```php -assertThat([], arrayValue()); -``` - -* `booleanValue` -```php -assertThat(true, booleanValue()); -``` -* `boolValue` - alias of booleanValue - -* `callableValue` - check if value is callable -```php -$func = function () {}; -assertThat($func, callableValue()); -``` -* `doubleValue` -```php -assertThat(3.14, doubleValue()); -``` - -* `floatValue` -```php -assertThat(3.14, floatValue()); -``` - -* `integerValue` -```php -assertThat(1, integerValue()); -``` - -* `intValue` - alias of `integerValue` - -* `numericValue` - check if value is numeric -```php -assertThat("123", numericValue()); -``` - -* `objectValue` - check for object -```php -$obj = new stdClass; -assertThat($obj, objectValue()); -``` -* `anObject` -```php -assertThat($obj, anObject()); -``` - -* `resourceValue` - check resource type -```php -$fp = fopen("/tmp/foo", "w+"); -assertThat($fp, resourceValue()); -``` - -* `scalarValue` - check for scaler value -```php -assertThat(1, scalarValue()); -``` - -* `stringValue` -```php -assertThat("", stringValue()); -``` - -### XML - -* `hasXPath` - check xml with a xpath -```php -$xml = << - - 1 - - - 2 - - -XML; - -$doc = new DOMDocument; -$doc->loadXML($xml); -assertThat($doc, hasXPath("book", 2)); -``` - diff --git a/vendor/hamcrest/hamcrest-php/composer.json b/vendor/hamcrest/hamcrest-php/composer.json deleted file mode 100644 index 712ad96..0000000 --- a/vendor/hamcrest/hamcrest-php/composer.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "hamcrest/hamcrest-php", - "type": "library", - "description": "This is the PHP port of Hamcrest Matchers", - "keywords": ["test"], - "license": "BSD-3-Clause", - "authors": [ - ], - - "autoload": { - "classmap": ["hamcrest"] - }, - "autoload-dev": { - "classmap": ["tests", "generator"] - }, - - "require": { - "php": "^5.3|^7.0|^8.0" - }, - - "require-dev": { - "phpunit/php-file-iterator": "^1.4 || ^2.0", - "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0" - }, - - "replace": { - "kodova/hamcrest-php": "*", - "davedevelopment/hamcrest-php": "*", - "cordoval/hamcrest-php": "*" - }, - - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - } -} diff --git a/vendor/hamcrest/hamcrest-php/generator/FactoryCall.php b/vendor/hamcrest/hamcrest-php/generator/FactoryCall.php deleted file mode 100644 index 83965b2..0000000 --- a/vendor/hamcrest/hamcrest-php/generator/FactoryCall.php +++ /dev/null @@ -1,41 +0,0 @@ -method = $method; - $this->name = $name; - } - - public function getMethod() - { - return $this->method; - } - - public function getName() - { - return $this->name; - } -} diff --git a/vendor/hamcrest/hamcrest-php/generator/FactoryClass.php b/vendor/hamcrest/hamcrest-php/generator/FactoryClass.php deleted file mode 100644 index a09cb73..0000000 --- a/vendor/hamcrest/hamcrest-php/generator/FactoryClass.php +++ /dev/null @@ -1,71 +0,0 @@ -file = $file; - $this->reflector = $class; - $this->extractFactoryMethods(); - } - - public function extractFactoryMethods() - { - $this->methods = array(); - foreach ($this->getPublicStaticMethods() as $method) { - if ($method->isFactory()) { - $this->methods[] = $method; - } - } - } - - public function getPublicStaticMethods() - { - $methods = array(); - foreach ($this->reflector->getMethods(ReflectionMethod::IS_STATIC) as $method) { - if ($method->isPublic() && $method->getDeclaringClass() == $this->reflector) { - $methods[] = new FactoryMethod($this, $method); - } - } - return $methods; - } - - public function getFile() - { - return $this->file; - } - - public function getName() - { - return $this->reflector->name; - } - - public function isFactory() - { - return !empty($this->methods); - } - - public function getMethods() - { - return $this->methods; - } -} diff --git a/vendor/hamcrest/hamcrest-php/generator/FactoryFile.php b/vendor/hamcrest/hamcrest-php/generator/FactoryFile.php deleted file mode 100644 index dd6109b..0000000 --- a/vendor/hamcrest/hamcrest-php/generator/FactoryFile.php +++ /dev/null @@ -1,121 +0,0 @@ -file = $file; - $this->indent = $indent; - } - - abstract public function addCall(FactoryCall $call); - - abstract public function build(); - - public function addFileHeader() - { - $this->code = ''; - $this->addPart('file_header'); - } - - public function addPart($name) - { - $this->addCode($this->readPart($name)); - } - - public function addCode($code) - { - $this->code .= $code; - } - - public function readPart($name) - { - return file_get_contents(__DIR__ . "/parts/$name.txt"); - } - - public function generateFactoryCall(FactoryCall $call) - { - $method = $call->getMethod(); - $code = $method->getComment($this->indent) . "\n"; - $code .= $this->generateDeclaration($call->getName(), $method); - $code .= $this->generateCall($method); - $code .= $this->generateClosing(); - return $code; - } - - public function generateDeclaration($name, FactoryMethod $method) - { - $code = $this->indent . $this->getDeclarationModifiers() - . 'function ' . $name . '(' - . $this->generateDeclarationArguments($method) - . ')' . "\n" . $this->indent . '{' . "\n"; - return $code; - } - - public function getDeclarationModifiers() - { - return ''; - } - - public function generateDeclarationArguments(FactoryMethod $method) - { - if ($method->acceptsVariableArguments()) { - return '/* args... */'; - } else { - return $method->getParameterDeclarations(); - } - } - - public function generateImport(FactoryMethod $method) - { - return $this->indent . self::INDENT . "require_once '" . $method->getClass()->getFile() . "';" . "\n"; - } - - public function generateCall(FactoryMethod $method) - { - $code = ''; - if ($method->acceptsVariableArguments()) { - $code .= $this->indent . self::INDENT . '$args = func_get_args();' . "\n"; - } - - $code .= $this->indent . self::INDENT . 'return '; - if ($method->acceptsVariableArguments()) { - $code .= 'call_user_func_array(array(\'' - . '\\' . $method->getClassName() . '\', \'' - . $method->getName() . '\'), $args);' . "\n"; - } else { - $code .= '\\' . $method->getClassName() . '::' - . $method->getName() . '(' - . $method->getParameterInvocations() . ');' . "\n"; - } - - return $code; - } - - public function generateClosing() - { - return $this->indent . '}' . "\n"; - } - - public function write() - { - file_put_contents($this->file, $this->code); - } -} diff --git a/vendor/hamcrest/hamcrest-php/generator/FactoryGenerator.php b/vendor/hamcrest/hamcrest-php/generator/FactoryGenerator.php deleted file mode 100644 index 242875a..0000000 --- a/vendor/hamcrest/hamcrest-php/generator/FactoryGenerator.php +++ /dev/null @@ -1,124 +0,0 @@ -path = $path; - $this->factoryFiles = array(); - } - - public function addFactoryFile(FactoryFile $factoryFile) - { - $this->factoryFiles[] = $factoryFile; - } - - public function generate() - { - $classes = $this->getClassesWithFactoryMethods(); - foreach ($classes as $class) { - foreach ($class->getMethods() as $method) { - foreach ($method->getCalls() as $call) { - foreach ($this->factoryFiles as $file) { - $file->addCall($call); - } - } - } - } - } - - public function write() - { - foreach ($this->factoryFiles as $file) { - $file->build(); - $file->write(); - } - } - - public function getClassesWithFactoryMethods() - { - $classes = array(); - $files = $this->getSortedFiles(); - foreach ($files as $file) { - $class = $this->getFactoryClass($file); - if ($class !== null) { - $classes[] = $class; - } - } - - return $classes; - } - - public function getSortedFiles() - { - $iter = $this->getFileIterator(); - $files = array(); - foreach ($iter as $file) { - $files[] = $file; - } - sort($files, SORT_STRING); - - return $files; - } - - private function getFileIterator() - { - $factoryClass = class_exists('File_Iterator_Factory') ? 'File_Iterator_Factory' : 'SebastianBergmann\FileIterator\Factory'; - - $factory = new $factoryClass(); - - return $factory->getFileIterator($this->path, '.php'); - } - - public function getFactoryClass($file) - { - $name = $this->getFactoryClassName($file); - if ($name !== null) { - require_once $file; - - if (class_exists($name)) { - $class = new FactoryClass(substr($file, strpos($file, 'Hamcrest/')), new ReflectionClass($name)); - if ($class->isFactory()) { - return $class; - } - } - } - - return null; - } - - public function getFactoryClassName($file) - { - $content = file_get_contents($file); - if (preg_match('/namespace\s+(.+);/', $content, $namespace) - && preg_match('/\n\s*class\s+(\w+)\s+extends\b/', $content, $className) - && preg_match('/@factory\b/', $content) - ) { - return $namespace[1] . '\\' . $className[1]; - } - - return null; - } -} diff --git a/vendor/hamcrest/hamcrest-php/generator/FactoryMethod.php b/vendor/hamcrest/hamcrest-php/generator/FactoryMethod.php deleted file mode 100644 index 8a05371..0000000 --- a/vendor/hamcrest/hamcrest-php/generator/FactoryMethod.php +++ /dev/null @@ -1,231 +0,0 @@ -class = $class; - $this->reflector = $reflector; - $this->extractCommentWithoutLeadingShashesAndStars(); - $this->extractFactoryNamesFromComment(); - $this->extractParameters(); - } - - public function extractCommentWithoutLeadingShashesAndStars() - { - $this->comment = explode("\n", $this->reflector->getDocComment()); - foreach ($this->comment as &$line) { - $line = preg_replace('#^\s*(/\\*+|\\*+/|\\*)\s?#', '', $line); - } - $this->trimLeadingBlankLinesFromComment(); - $this->trimTrailingBlankLinesFromComment(); - } - - public function trimLeadingBlankLinesFromComment() - { - while (count($this->comment) > 0) { - $line = array_shift($this->comment); - if (trim($line) != '') { - array_unshift($this->comment, $line); - break; - } - } - } - - public function trimTrailingBlankLinesFromComment() - { - while (count($this->comment) > 0) { - $line = array_pop($this->comment); - if (trim($line) != '') { - array_push($this->comment, $line); - break; - } - } - } - - public function extractFactoryNamesFromComment() - { - $this->calls = array(); - for ($i = 0; $i < count($this->comment); $i++) { - if ($this->extractFactoryNamesFromLine($this->comment[$i])) { - unset($this->comment[$i]); - } - } - $this->trimTrailingBlankLinesFromComment(); - } - - public function extractFactoryNamesFromLine($line) - { - if (preg_match('/^\s*@factory(\s+(.+))?$/', $line, $match)) { - $this->createCalls( - $this->extractFactoryNamesFromAnnotation( - isset($match[2]) ? trim($match[2]) : null - ) - ); - return true; - } - return false; - } - - public function extractFactoryNamesFromAnnotation($value) - { - $primaryName = $this->reflector->getName(); - if (empty($value)) { - return array($primaryName); - } - preg_match_all('/(\.{3}|-|[a-zA-Z_][a-zA-Z_0-9]*)/', $value, $match); - $names = $match[0]; - if (in_array('...', $names)) { - $this->isVarArgs = true; - } - if (!in_array('-', $names) && !in_array($primaryName, $names)) { - array_unshift($names, $primaryName); - } - return $names; - } - - public function createCalls(array $names) - { - $names = array_unique($names); - foreach ($names as $name) { - if ($name != '-' && $name != '...') { - $this->calls[] = new FactoryCall($this, $name); - } - } - } - - public function extractParameters() - { - $this->parameters = array(); - if (!$this->isVarArgs) { - foreach ($this->reflector->getParameters() as $parameter) { - $this->parameters[] = new FactoryParameter($this, $parameter); - } - } - } - - public function getParameterDeclarations() - { - if ($this->isVarArgs || !$this->hasParameters()) { - return ''; - } - $params = array(); - foreach ($this->parameters as /** @var $parameter FactoryParameter */ - $parameter) { - $params[] = $parameter->getDeclaration(); - } - return implode(', ', $params); - } - - public function getParameterInvocations() - { - if ($this->isVarArgs) { - return ''; - } - $params = array(); - foreach ($this->parameters as $parameter) { - $params[] = $parameter->getInvocation(); - } - return implode(', ', $params); - } - - - public function getClass() - { - return $this->class; - } - - public function getClassName() - { - return $this->class->getName(); - } - - public function getName() - { - return $this->reflector->name; - } - - public function isFactory() - { - return count($this->calls) > 0; - } - - public function getCalls() - { - return $this->calls; - } - - public function acceptsVariableArguments() - { - return $this->isVarArgs; - } - - public function hasParameters() - { - return !empty($this->parameters); - } - - public function getParameters() - { - return $this->parameters; - } - - public function getFullName() - { - return $this->getClassName() . '::' . $this->getName(); - } - - public function getCommentText() - { - return implode("\n", $this->comment); - } - - public function getComment($indent = '') - { - $comment = $indent . '/**'; - foreach ($this->comment as $line) { - $comment .= "\n" . rtrim($indent . ' * ' . $line); - } - $comment .= "\n" . $indent . ' */'; - return $comment; - } -} diff --git a/vendor/hamcrest/hamcrest-php/generator/FactoryParameter.php b/vendor/hamcrest/hamcrest-php/generator/FactoryParameter.php deleted file mode 100644 index 82b707a..0000000 --- a/vendor/hamcrest/hamcrest-php/generator/FactoryParameter.php +++ /dev/null @@ -1,131 +0,0 @@ -method = $method; - $this->reflector = $reflector; - } - - /** - * Compute the declaration code. - * - * @return string - */ - public function getDeclaration() - { - $code = $this->getTypeCode() . $this->getInvocation(); - - if ($this->reflector->isOptional()) { - $default = $this->reflector->getDefaultValue(); - if (is_null($default)) { - $default = 'null'; - } elseif (is_bool($default)) { - $default = $default ? 'true' : 'false'; - } elseif (is_string($default)) { - $default = "'" . $default . "'"; - } elseif (is_numeric($default)) { - $default = strval($default); - } elseif (is_array($default)) { - $default = 'array()'; - } else { - echo 'Warning: unknown default type for ' . $this->getMethod()->getFullName() . "\n"; - var_dump($default); - $default = 'null'; - } - $code .= ' = ' . $default; - } - return $code; - } - - /** - * Compute the type code for the paramater. - * - * @return string - */ - private function getTypeCode() - { - // Handle PHP 5 separately - if (PHP_VERSION_ID < 70000) { - if ($this->reflector->isArray()) { - return 'array'; - } - - $class = $this->reflector->getClass(); - - return $class ? sprintf('\\%s ', $class->getName()) : ''; - } - - if (!$this->reflector->hasType()) { - return ''; - } - - $type = $this->reflector->getType(); - $name = self::getQualifiedName($type); - - // PHP 7.1+ supports nullable types via a leading question mark - return (PHP_VERSION_ID >= 70100 && $type->allowsNull()) ? sprintf('?%s ', $name) : sprintf('%s ', $name); - } - - /** - * Compute qualified name for the given type. - * - * This function knows how to prefix class names with a leading slash and - * also how to handle PHP 8's union types. - * - * @param ReflectionType $type - * - * @return string - */ - private static function getQualifiedName(ReflectionType $type) - { - // PHP 8 union types can be recursively processed - if ($type instanceof ReflectionUnionType) { - return implode('|', array_map(function (ReflectionType $type) { - // The "self::" call within a Closure is fine here because this - // code will only ever be executed on PHP 7.0+ - return self::getQualifiedName($type); - }, $type->getTypes())); - } - - // PHP 7.0 doesn't have named types, but 7.1+ does - $name = $type instanceof ReflectionNamedType ? $type->getName() : (string) $type; - - return $type->isBuiltin() ? $name : sprintf('\\%s', $name); - } - - /** - * Compute the invocation code. - * - * @return string - */ - public function getInvocation() - { - return sprintf('$%s', $this->reflector->getName()); - } - - /** - * Compute the method name. - * - * @return string - */ - public function getMethod() - { - return $this->method; - } -} diff --git a/vendor/hamcrest/hamcrest-php/generator/GlobalFunctionFile.php b/vendor/hamcrest/hamcrest-php/generator/GlobalFunctionFile.php deleted file mode 100644 index ec8b1b3..0000000 --- a/vendor/hamcrest/hamcrest-php/generator/GlobalFunctionFile.php +++ /dev/null @@ -1,42 +0,0 @@ -functions = ''; - } - - public function addCall(FactoryCall $call) - { - $this->functions .= "\n" . $this->generateFactoryCall($call); - } - - public function build() - { - $this->addFileHeader(); - $this->addPart('functions_imports'); - $this->addPart('functions_header'); - $this->addCode($this->functions); - $this->addPart('functions_footer'); - } - - public function generateFactoryCall(FactoryCall $call) - { - $code = "if (!function_exists('{$call->getName()}')) {\n"; - $code.= parent::generateFactoryCall($call); - $code.= "}\n"; - - return $code; - } -} diff --git a/vendor/hamcrest/hamcrest-php/generator/StaticMethodFile.php b/vendor/hamcrest/hamcrest-php/generator/StaticMethodFile.php deleted file mode 100644 index 44cec02..0000000 --- a/vendor/hamcrest/hamcrest-php/generator/StaticMethodFile.php +++ /dev/null @@ -1,38 +0,0 @@ -methods = ''; - } - - public function addCall(FactoryCall $call) - { - $this->methods .= PHP_EOL . $this->generateFactoryCall($call); - } - - public function getDeclarationModifiers() - { - return 'public static '; - } - - public function build() - { - $this->addFileHeader(); - $this->addPart('matchers_imports'); - $this->addPart('matchers_header'); - $this->addCode($this->methods); - $this->addPart('matchers_footer'); - } -} diff --git a/vendor/hamcrest/hamcrest-php/generator/parts/file_header.txt b/vendor/hamcrest/hamcrest-php/generator/parts/file_header.txt deleted file mode 100644 index 7b352e4..0000000 --- a/vendor/hamcrest/hamcrest-php/generator/parts/file_header.txt +++ /dev/null @@ -1,7 +0,0 @@ - - * //With an identifier - * assertThat("assertion identifier", $apple->flavour(), equalTo("tasty")); - * //Without an identifier - * assertThat($apple->flavour(), equalTo("tasty")); - * //Evaluating a boolean expression - * assertThat("some error", $a > $b); - * - */ - function assertThat() - { - $args = func_get_args(); - call_user_func_array( - array('Hamcrest\MatcherAssert', 'assertThat'), - $args - ); - } -} diff --git a/vendor/hamcrest/hamcrest-php/generator/parts/functions_imports.txt b/vendor/hamcrest/hamcrest-php/generator/parts/functions_imports.txt deleted file mode 100644 index e69de29..0000000 diff --git a/vendor/hamcrest/hamcrest-php/generator/parts/matchers_footer.txt b/vendor/hamcrest/hamcrest-php/generator/parts/matchers_footer.txt deleted file mode 100644 index 5c34318..0000000 --- a/vendor/hamcrest/hamcrest-php/generator/parts/matchers_footer.txt +++ /dev/null @@ -1 +0,0 @@ -} diff --git a/vendor/hamcrest/hamcrest-php/generator/parts/matchers_header.txt b/vendor/hamcrest/hamcrest-php/generator/parts/matchers_header.txt deleted file mode 100644 index 4f8bb2b..0000000 --- a/vendor/hamcrest/hamcrest-php/generator/parts/matchers_header.txt +++ /dev/null @@ -1,7 +0,0 @@ - - -/** - * A series of static factories for all hamcrest matchers. - */ -class Matchers -{ diff --git a/vendor/hamcrest/hamcrest-php/generator/parts/matchers_imports.txt b/vendor/hamcrest/hamcrest-php/generator/parts/matchers_imports.txt deleted file mode 100644 index 7dd6849..0000000 --- a/vendor/hamcrest/hamcrest-php/generator/parts/matchers_imports.txt +++ /dev/null @@ -1,2 +0,0 @@ - -namespace Hamcrest; \ No newline at end of file diff --git a/vendor/hamcrest/hamcrest-php/generator/run.php b/vendor/hamcrest/hamcrest-php/generator/run.php deleted file mode 100644 index 924d752..0000000 --- a/vendor/hamcrest/hamcrest-php/generator/run.php +++ /dev/null @@ -1,37 +0,0 @@ -addFactoryFile(new StaticMethodFile(STATIC_MATCHERS_FILE)); -$generator->addFactoryFile(new GlobalFunctionFile(GLOBAL_FUNCTIONS_FILE)); -$generator->generate(); -$generator->write(); diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest.php deleted file mode 100644 index 55a2dd8..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest.php +++ /dev/null @@ -1,882 +0,0 @@ - - * //With an identifier - * assertThat("assertion identifier", $apple->flavour(), equalTo("tasty")); - * //Without an identifier - * assertThat($apple->flavour(), equalTo("tasty")); - * //Evaluating a boolean expression - * assertThat("some error", $a > $b); - * - */ - function assertThat() - { - $args = func_get_args(); - call_user_func_array( - array('Hamcrest\MatcherAssert', 'assertThat'), - $args - ); - } -} - -if (!function_exists('anArray')) { - /** - * Evaluates to true only if each $matcher[$i] is satisfied by $array[$i]. - */ - function anArray(/* args... */) - { - $args = func_get_args(); - return call_user_func_array(array('\Hamcrest\Arrays\IsArray', 'anArray'), $args); - } -} - -if (!function_exists('hasItemInArray')) { - /** - * Evaluates to true if any item in an array satisfies the given matcher. - * - * @param mixed $item as a {@link Hamcrest\Matcher} or a value. - * - * @return \Hamcrest\Arrays\IsArrayContaining - */ - function hasItemInArray($item) - { - return \Hamcrest\Arrays\IsArrayContaining::hasItemInArray($item); - } -} - -if (!function_exists('hasValue')) { - /** - * Evaluates to true if any item in an array satisfies the given matcher. - * - * @param mixed $item as a {@link Hamcrest\Matcher} or a value. - * - * @return \Hamcrest\Arrays\IsArrayContaining - */ - function hasValue($item) - { - return \Hamcrest\Arrays\IsArrayContaining::hasItemInArray($item); - } -} - -if (!function_exists('arrayContainingInAnyOrder')) { - /** - * An array with elements that match the given matchers. - */ - function arrayContainingInAnyOrder(/* args... */) - { - $args = func_get_args(); - return call_user_func_array(array('\Hamcrest\Arrays\IsArrayContainingInAnyOrder', 'arrayContainingInAnyOrder'), $args); - } -} - -if (!function_exists('containsInAnyOrder')) { - /** - * An array with elements that match the given matchers. - */ - function containsInAnyOrder(/* args... */) - { - $args = func_get_args(); - return call_user_func_array(array('\Hamcrest\Arrays\IsArrayContainingInAnyOrder', 'arrayContainingInAnyOrder'), $args); - } -} - -if (!function_exists('arrayContaining')) { - /** - * An array with elements that match the given matchers in the same order. - */ - function arrayContaining(/* args... */) - { - $args = func_get_args(); - return call_user_func_array(array('\Hamcrest\Arrays\IsArrayContainingInOrder', 'arrayContaining'), $args); - } -} - -if (!function_exists('contains')) { - /** - * An array with elements that match the given matchers in the same order. - */ - function contains(/* args... */) - { - $args = func_get_args(); - return call_user_func_array(array('\Hamcrest\Arrays\IsArrayContainingInOrder', 'arrayContaining'), $args); - } -} - -if (!function_exists('hasKeyInArray')) { - /** - * Evaluates to true if any key in an array matches the given matcher. - * - * @param mixed $key as a {@link Hamcrest\Matcher} or a value. - * - * @return \Hamcrest\Arrays\IsArrayContainingKey - */ - function hasKeyInArray($key) - { - return \Hamcrest\Arrays\IsArrayContainingKey::hasKeyInArray($key); - } -} - -if (!function_exists('hasKey')) { - /** - * Evaluates to true if any key in an array matches the given matcher. - * - * @param mixed $key as a {@link Hamcrest\Matcher} or a value. - * - * @return \Hamcrest\Arrays\IsArrayContainingKey - */ - function hasKey($key) - { - return \Hamcrest\Arrays\IsArrayContainingKey::hasKeyInArray($key); - } -} - -if (!function_exists('hasKeyValuePair')) { - /** - * Test if an array has both an key and value in parity with each other. - */ - function hasKeyValuePair($key, $value) - { - return \Hamcrest\Arrays\IsArrayContainingKeyValuePair::hasKeyValuePair($key, $value); - } -} - -if (!function_exists('hasEntry')) { - /** - * Test if an array has both an key and value in parity with each other. - */ - function hasEntry($key, $value) - { - return \Hamcrest\Arrays\IsArrayContainingKeyValuePair::hasKeyValuePair($key, $value); - } -} - -if (!function_exists('arrayWithSize')) { - /** - * Does array size satisfy a given matcher? - * - * @param \Hamcrest\Matcher|int $size as a {@link Hamcrest\Matcher} or a value. - * - * @return \Hamcrest\Arrays\IsArrayWithSize - */ - function arrayWithSize($size) - { - return \Hamcrest\Arrays\IsArrayWithSize::arrayWithSize($size); - } -} - -if (!function_exists('emptyArray')) { - /** - * Matches an empty array. - */ - function emptyArray() - { - return \Hamcrest\Arrays\IsArrayWithSize::emptyArray(); - } -} - -if (!function_exists('nonEmptyArray')) { - /** - * Matches an empty array. - */ - function nonEmptyArray() - { - return \Hamcrest\Arrays\IsArrayWithSize::nonEmptyArray(); - } -} - -if (!function_exists('emptyTraversable')) { - /** - * Returns true if traversable is empty. - */ - function emptyTraversable() - { - return \Hamcrest\Collection\IsEmptyTraversable::emptyTraversable(); - } -} - -if (!function_exists('nonEmptyTraversable')) { - /** - * Returns true if traversable is not empty. - */ - function nonEmptyTraversable() - { - return \Hamcrest\Collection\IsEmptyTraversable::nonEmptyTraversable(); - } -} - -if (!function_exists('traversableWithSize')) { - /** - * Does traversable size satisfy a given matcher? - */ - function traversableWithSize($size) - { - return \Hamcrest\Collection\IsTraversableWithSize::traversableWithSize($size); - } -} - -if (!function_exists('allOf')) { - /** - * Evaluates to true only if ALL of the passed in matchers evaluate to true. - */ - function allOf(/* args... */) - { - $args = func_get_args(); - return call_user_func_array(array('\Hamcrest\Core\AllOf', 'allOf'), $args); - } -} - -if (!function_exists('anyOf')) { - /** - * Evaluates to true if ANY of the passed in matchers evaluate to true. - */ - function anyOf(/* args... */) - { - $args = func_get_args(); - return call_user_func_array(array('\Hamcrest\Core\AnyOf', 'anyOf'), $args); - } -} - -if (!function_exists('noneOf')) { - /** - * Evaluates to false if ANY of the passed in matchers evaluate to true. - */ - function noneOf(/* args... */) - { - $args = func_get_args(); - return call_user_func_array(array('\Hamcrest\Core\AnyOf', 'noneOf'), $args); - } -} - -if (!function_exists('both')) { - /** - * This is useful for fluently combining matchers that must both pass. - * For example: - *
-     *   assertThat($string, both(containsString("a"))->andAlso(containsString("b")));
-     * 
- */ - function both(\Hamcrest\Matcher $matcher) - { - return \Hamcrest\Core\CombinableMatcher::both($matcher); - } -} - -if (!function_exists('either')) { - /** - * This is useful for fluently combining matchers where either may pass, - * for example: - *
-     *   assertThat($string, either(containsString("a"))->orElse(containsString("b")));
-     * 
- */ - function either(\Hamcrest\Matcher $matcher) - { - return \Hamcrest\Core\CombinableMatcher::either($matcher); - } -} - -if (!function_exists('describedAs')) { - /** - * Wraps an existing matcher and overrides the description when it fails. - */ - function describedAs(/* args... */) - { - $args = func_get_args(); - return call_user_func_array(array('\Hamcrest\Core\DescribedAs', 'describedAs'), $args); - } -} - -if (!function_exists('everyItem')) { - /** - * @param Matcher $itemMatcher - * A matcher to apply to every element in an array. - * - * @return \Hamcrest\Core\Every - * Evaluates to TRUE for a collection in which every item matches $itemMatcher - */ - function everyItem(\Hamcrest\Matcher $itemMatcher) - { - return \Hamcrest\Core\Every::everyItem($itemMatcher); - } -} - -if (!function_exists('hasToString')) { - /** - * Does array size satisfy a given matcher? - */ - function hasToString($matcher) - { - return \Hamcrest\Core\HasToString::hasToString($matcher); - } -} - -if (!function_exists('is')) { - /** - * Decorates another Matcher, retaining the behavior but allowing tests - * to be slightly more expressive. - * - * For example: assertThat($cheese, equalTo($smelly)) - * vs. assertThat($cheese, is(equalTo($smelly))) - */ - function is($value) - { - return \Hamcrest\Core\Is::is($value); - } -} - -if (!function_exists('anything')) { - /** - * This matcher always evaluates to true. - * - * @param string $description A meaningful string used when describing itself. - * - * @return \Hamcrest\Core\IsAnything - */ - function anything($description = 'ANYTHING') - { - return \Hamcrest\Core\IsAnything::anything($description); - } -} - -if (!function_exists('hasItem')) { - /** - * Test if the value is an array containing this matcher. - * - * Example: - *
-     * assertThat(array('a', 'b'), hasItem(equalTo('b')));
-     * //Convenience defaults to equalTo()
-     * assertThat(array('a', 'b'), hasItem('b'));
-     * 
- */ - function hasItem(/* args... */) - { - $args = func_get_args(); - return call_user_func_array(array('\Hamcrest\Core\IsCollectionContaining', 'hasItem'), $args); - } -} - -if (!function_exists('hasItems')) { - /** - * Test if the value is an array containing elements that match all of these - * matchers. - * - * Example: - *
-     * assertThat(array('a', 'b', 'c'), hasItems(equalTo('a'), equalTo('b')));
-     * 
- */ - function hasItems(/* args... */) - { - $args = func_get_args(); - return call_user_func_array(array('\Hamcrest\Core\IsCollectionContaining', 'hasItems'), $args); - } -} - -if (!function_exists('equalTo')) { - /** - * Is the value equal to another value, as tested by the use of the "==" - * comparison operator? - */ - function equalTo($item) - { - return \Hamcrest\Core\IsEqual::equalTo($item); - } -} - -if (!function_exists('identicalTo')) { - /** - * Tests of the value is identical to $value as tested by the "===" operator. - */ - function identicalTo($value) - { - return \Hamcrest\Core\IsIdentical::identicalTo($value); - } -} - -if (!function_exists('anInstanceOf')) { - /** - * Is the value an instance of a particular type? - * This version assumes no relationship between the required type and - * the signature of the method that sets it up, for example in - * assertThat($anObject, anInstanceOf('Thing')); - */ - function anInstanceOf($theClass) - { - return \Hamcrest\Core\IsInstanceOf::anInstanceOf($theClass); - } -} - -if (!function_exists('any')) { - /** - * Is the value an instance of a particular type? - * This version assumes no relationship between the required type and - * the signature of the method that sets it up, for example in - * assertThat($anObject, anInstanceOf('Thing')); - */ - function any($theClass) - { - return \Hamcrest\Core\IsInstanceOf::anInstanceOf($theClass); - } -} - -if (!function_exists('not')) { - /** - * Matches if value does not match $value. - */ - function not($value) - { - return \Hamcrest\Core\IsNot::not($value); - } -} - -if (!function_exists('nullValue')) { - /** - * Matches if value is null. - */ - function nullValue() - { - return \Hamcrest\Core\IsNull::nullValue(); - } -} - -if (!function_exists('notNullValue')) { - /** - * Matches if value is not null. - */ - function notNullValue() - { - return \Hamcrest\Core\IsNull::notNullValue(); - } -} - -if (!function_exists('sameInstance')) { - /** - * Creates a new instance of IsSame. - * - * @param mixed $object - * The predicate evaluates to true only when the argument is - * this object. - * - * @return \Hamcrest\Core\IsSame - */ - function sameInstance($object) - { - return \Hamcrest\Core\IsSame::sameInstance($object); - } -} - -if (!function_exists('typeOf')) { - /** - * Is the value a particular built-in type? - */ - function typeOf($theType) - { - return \Hamcrest\Core\IsTypeOf::typeOf($theType); - } -} - -if (!function_exists('set')) { - /** - * Matches if value (class, object, or array) has named $property. - */ - function set($property) - { - return \Hamcrest\Core\Set::set($property); - } -} - -if (!function_exists('notSet')) { - /** - * Matches if value (class, object, or array) does not have named $property. - */ - function notSet($property) - { - return \Hamcrest\Core\Set::notSet($property); - } -} - -if (!function_exists('closeTo')) { - /** - * Matches if value is a number equal to $value within some range of - * acceptable error $delta. - */ - function closeTo($value, $delta) - { - return \Hamcrest\Number\IsCloseTo::closeTo($value, $delta); - } -} - -if (!function_exists('comparesEqualTo')) { - /** - * The value is not > $value, nor < $value. - */ - function comparesEqualTo($value) - { - return \Hamcrest\Number\OrderingComparison::comparesEqualTo($value); - } -} - -if (!function_exists('greaterThan')) { - /** - * The value is > $value. - */ - function greaterThan($value) - { - return \Hamcrest\Number\OrderingComparison::greaterThan($value); - } -} - -if (!function_exists('greaterThanOrEqualTo')) { - /** - * The value is >= $value. - */ - function greaterThanOrEqualTo($value) - { - return \Hamcrest\Number\OrderingComparison::greaterThanOrEqualTo($value); - } -} - -if (!function_exists('atLeast')) { - /** - * The value is >= $value. - */ - function atLeast($value) - { - return \Hamcrest\Number\OrderingComparison::greaterThanOrEqualTo($value); - } -} - -if (!function_exists('lessThan')) { - /** - * The value is < $value. - */ - function lessThan($value) - { - return \Hamcrest\Number\OrderingComparison::lessThan($value); - } -} - -if (!function_exists('lessThanOrEqualTo')) { - /** - * The value is <= $value. - */ - function lessThanOrEqualTo($value) - { - return \Hamcrest\Number\OrderingComparison::lessThanOrEqualTo($value); - } -} - -if (!function_exists('atMost')) { - /** - * The value is <= $value. - */ - function atMost($value) - { - return \Hamcrest\Number\OrderingComparison::lessThanOrEqualTo($value); - } -} - -if (!function_exists('isEmptyString')) { - /** - * Matches if value is a zero-length string. - */ - function isEmptyString() - { - return \Hamcrest\Text\IsEmptyString::isEmptyString(); - } -} - -if (!function_exists('emptyString')) { - /** - * Matches if value is a zero-length string. - */ - function emptyString() - { - return \Hamcrest\Text\IsEmptyString::isEmptyString(); - } -} - -if (!function_exists('isEmptyOrNullString')) { - /** - * Matches if value is null or a zero-length string. - */ - function isEmptyOrNullString() - { - return \Hamcrest\Text\IsEmptyString::isEmptyOrNullString(); - } -} - -if (!function_exists('nullOrEmptyString')) { - /** - * Matches if value is null or a zero-length string. - */ - function nullOrEmptyString() - { - return \Hamcrest\Text\IsEmptyString::isEmptyOrNullString(); - } -} - -if (!function_exists('isNonEmptyString')) { - /** - * Matches if value is a non-zero-length string. - */ - function isNonEmptyString() - { - return \Hamcrest\Text\IsEmptyString::isNonEmptyString(); - } -} - -if (!function_exists('nonEmptyString')) { - /** - * Matches if value is a non-zero-length string. - */ - function nonEmptyString() - { - return \Hamcrest\Text\IsEmptyString::isNonEmptyString(); - } -} - -if (!function_exists('equalToIgnoringCase')) { - /** - * Matches if value is a string equal to $string, regardless of the case. - */ - function equalToIgnoringCase($string) - { - return \Hamcrest\Text\IsEqualIgnoringCase::equalToIgnoringCase($string); - } -} - -if (!function_exists('equalToIgnoringWhiteSpace')) { - /** - * Matches if value is a string equal to $string, regardless of whitespace. - */ - function equalToIgnoringWhiteSpace($string) - { - return \Hamcrest\Text\IsEqualIgnoringWhiteSpace::equalToIgnoringWhiteSpace($string); - } -} - -if (!function_exists('matchesPattern')) { - /** - * Matches if value is a string that matches regular expression $pattern. - */ - function matchesPattern($pattern) - { - return \Hamcrest\Text\MatchesPattern::matchesPattern($pattern); - } -} - -if (!function_exists('containsString')) { - /** - * Matches if value is a string that contains $substring. - */ - function containsString($substring) - { - return \Hamcrest\Text\StringContains::containsString($substring); - } -} - -if (!function_exists('containsStringIgnoringCase')) { - /** - * Matches if value is a string that contains $substring regardless of the case. - */ - function containsStringIgnoringCase($substring) - { - return \Hamcrest\Text\StringContainsIgnoringCase::containsStringIgnoringCase($substring); - } -} - -if (!function_exists('stringContainsInOrder')) { - /** - * Matches if value contains $substrings in a constrained order. - */ - function stringContainsInOrder(/* args... */) - { - $args = func_get_args(); - return call_user_func_array(array('\Hamcrest\Text\StringContainsInOrder', 'stringContainsInOrder'), $args); - } -} - -if (!function_exists('endsWith')) { - /** - * Matches if value is a string that ends with $substring. - */ - function endsWith($substring) - { - return \Hamcrest\Text\StringEndsWith::endsWith($substring); - } -} - -if (!function_exists('startsWith')) { - /** - * Matches if value is a string that starts with $substring. - */ - function startsWith($substring) - { - return \Hamcrest\Text\StringStartsWith::startsWith($substring); - } -} - -if (!function_exists('arrayValue')) { - /** - * Is the value an array? - */ - function arrayValue() - { - return \Hamcrest\Type\IsArray::arrayValue(); - } -} - -if (!function_exists('booleanValue')) { - /** - * Is the value a boolean? - */ - function booleanValue() - { - return \Hamcrest\Type\IsBoolean::booleanValue(); - } -} - -if (!function_exists('boolValue')) { - /** - * Is the value a boolean? - */ - function boolValue() - { - return \Hamcrest\Type\IsBoolean::booleanValue(); - } -} - -if (!function_exists('callableValue')) { - /** - * Is the value callable? - */ - function callableValue() - { - return \Hamcrest\Type\IsCallable::callableValue(); - } -} - -if (!function_exists('doubleValue')) { - /** - * Is the value a float/double? - */ - function doubleValue() - { - return \Hamcrest\Type\IsDouble::doubleValue(); - } -} - -if (!function_exists('floatValue')) { - /** - * Is the value a float/double? - */ - function floatValue() - { - return \Hamcrest\Type\IsDouble::doubleValue(); - } -} - -if (!function_exists('integerValue')) { - /** - * Is the value an integer? - */ - function integerValue() - { - return \Hamcrest\Type\IsInteger::integerValue(); - } -} - -if (!function_exists('intValue')) { - /** - * Is the value an integer? - */ - function intValue() - { - return \Hamcrest\Type\IsInteger::integerValue(); - } -} - -if (!function_exists('numericValue')) { - /** - * Is the value a numeric? - */ - function numericValue() - { - return \Hamcrest\Type\IsNumeric::numericValue(); - } -} - -if (!function_exists('objectValue')) { - /** - * Is the value an object? - */ - function objectValue() - { - return \Hamcrest\Type\IsObject::objectValue(); - } -} - -if (!function_exists('anObject')) { - /** - * Is the value an object? - */ - function anObject() - { - return \Hamcrest\Type\IsObject::objectValue(); - } -} - -if (!function_exists('resourceValue')) { - /** - * Is the value a resource? - */ - function resourceValue() - { - return \Hamcrest\Type\IsResource::resourceValue(); - } -} - -if (!function_exists('scalarValue')) { - /** - * Is the value a scalar (boolean, integer, double, or string)? - */ - function scalarValue() - { - return \Hamcrest\Type\IsScalar::scalarValue(); - } -} - -if (!function_exists('stringValue')) { - /** - * Is the value a string? - */ - function stringValue() - { - return \Hamcrest\Type\IsString::stringValue(); - } -} - -if (!function_exists('hasXPath')) { - /** - * Wraps $matcher with {@link Hamcrest\Core\IsEqual) - * if it's not a matcher and the XPath in count() - * if it's an integer. - */ - function hasXPath($xpath, $matcher = null) - { - return \Hamcrest\Xml\HasXPath::hasXPath($xpath, $matcher); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArray.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArray.php deleted file mode 100644 index 9ea5697..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArray.php +++ /dev/null @@ -1,118 +0,0 @@ -_elementMatchers = $elementMatchers; - } - - protected function matchesSafely($array) - { - if (array_keys($array) != array_keys($this->_elementMatchers)) { - return false; - } - - /** @var $matcher \Hamcrest\Matcher */ - foreach ($this->_elementMatchers as $k => $matcher) { - if (!$matcher->matches($array[$k])) { - return false; - } - } - - return true; - } - - protected function describeMismatchSafely($actual, Description $mismatchDescription) - { - if (count($actual) != count($this->_elementMatchers)) { - $mismatchDescription->appendText('array length was ' . count($actual)); - - return; - } elseif (array_keys($actual) != array_keys($this->_elementMatchers)) { - $mismatchDescription->appendText('array keys were ') - ->appendValueList( - $this->descriptionStart(), - $this->descriptionSeparator(), - $this->descriptionEnd(), - array_keys($actual) - ) - ; - - return; - } - - /** @var $matcher \Hamcrest\Matcher */ - foreach ($this->_elementMatchers as $k => $matcher) { - if (!$matcher->matches($actual[$k])) { - $mismatchDescription->appendText('element ')->appendValue($k) - ->appendText(' was ')->appendValue($actual[$k]); - - return; - } - } - } - - public function describeTo(Description $description) - { - $description->appendList( - $this->descriptionStart(), - $this->descriptionSeparator(), - $this->descriptionEnd(), - $this->_elementMatchers - ); - } - - /** - * Evaluates to true only if each $matcher[$i] is satisfied by $array[$i]. - * - * @factory ... - */ - public static function anArray(/* args... */) - { - $args = func_get_args(); - - return new self(Util::createMatcherArray($args)); - } - - // -- Protected Methods - - protected function descriptionStart() - { - return '['; - } - - protected function descriptionSeparator() - { - return ', '; - } - - protected function descriptionEnd() - { - return ']'; - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContaining.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContaining.php deleted file mode 100644 index 0e4a1ed..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContaining.php +++ /dev/null @@ -1,63 +0,0 @@ -_elementMatcher = $elementMatcher; - } - - protected function matchesSafely($array) - { - foreach ($array as $element) { - if ($this->_elementMatcher->matches($element)) { - return true; - } - } - - return false; - } - - protected function describeMismatchSafely($array, Description $mismatchDescription) - { - $mismatchDescription->appendText('was ')->appendValue($array); - } - - public function describeTo(Description $description) - { - $description - ->appendText('an array containing ') - ->appendDescriptionOf($this->_elementMatcher) - ; - } - - /** - * Evaluates to true if any item in an array satisfies the given matcher. - * - * @param mixed $item as a {@link Hamcrest\Matcher} or a value. - * - * @return \Hamcrest\Arrays\IsArrayContaining - * @factory hasValue - */ - public static function hasItemInArray($item) - { - return new self(Util::wrapValueWithIsEqual($item)); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContainingInAnyOrder.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContainingInAnyOrder.php deleted file mode 100644 index 9009026..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContainingInAnyOrder.php +++ /dev/null @@ -1,59 +0,0 @@ -_elementMatchers = $elementMatchers; - } - - protected function matchesSafelyWithDiagnosticDescription($array, Description $mismatchDescription) - { - $matching = new MatchingOnce($this->_elementMatchers, $mismatchDescription); - - foreach ($array as $element) { - if (!$matching->matches($element)) { - return false; - } - } - - return $matching->isFinished($array); - } - - public function describeTo(Description $description) - { - $description->appendList('[', ', ', ']', $this->_elementMatchers) - ->appendText(' in any order') - ; - } - - /** - * An array with elements that match the given matchers. - * - * @factory containsInAnyOrder ... - */ - public static function arrayContainingInAnyOrder(/* args... */) - { - $args = func_get_args(); - - return new self(Util::createMatcherArray($args)); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContainingInOrder.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContainingInOrder.php deleted file mode 100644 index 6115740..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContainingInOrder.php +++ /dev/null @@ -1,57 +0,0 @@ -_elementMatchers = $elementMatchers; - } - - protected function matchesSafelyWithDiagnosticDescription($array, Description $mismatchDescription) - { - $series = new SeriesMatchingOnce($this->_elementMatchers, $mismatchDescription); - - foreach ($array as $element) { - if (!$series->matches($element)) { - return false; - } - } - - return $series->isFinished(); - } - - public function describeTo(Description $description) - { - $description->appendList('[', ', ', ']', $this->_elementMatchers); - } - - /** - * An array with elements that match the given matchers in the same order. - * - * @factory contains ... - */ - public static function arrayContaining(/* args... */) - { - $args = func_get_args(); - - return new self(Util::createMatcherArray($args)); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContainingKey.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContainingKey.php deleted file mode 100644 index 523477e..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContainingKey.php +++ /dev/null @@ -1,75 +0,0 @@ -_keyMatcher = $keyMatcher; - } - - protected function matchesSafely($array) - { - foreach ($array as $key => $element) { - if ($this->_keyMatcher->matches($key)) { - return true; - } - } - - return false; - } - - protected function describeMismatchSafely($array, Description $mismatchDescription) - { - //Not using appendValueList() so that keys can be shown - $mismatchDescription->appendText('array was ') - ->appendText('[') - ; - $loop = false; - foreach ($array as $key => $value) { - if ($loop) { - $mismatchDescription->appendText(', '); - } - $mismatchDescription->appendValue($key)->appendText(' => ')->appendValue($value); - $loop = true; - } - $mismatchDescription->appendText(']'); - } - - public function describeTo(Description $description) - { - $description - ->appendText('array with key ') - ->appendDescriptionOf($this->_keyMatcher) - ; - } - - /** - * Evaluates to true if any key in an array matches the given matcher. - * - * @param mixed $key as a {@link Hamcrest\Matcher} or a value. - * - * @return \Hamcrest\Arrays\IsArrayContainingKey - * @factory hasKey - */ - public static function hasKeyInArray($key) - { - return new self(Util::wrapValueWithIsEqual($key)); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContainingKeyValuePair.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContainingKeyValuePair.php deleted file mode 100644 index 9ac3eba..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContainingKeyValuePair.php +++ /dev/null @@ -1,80 +0,0 @@ -_keyMatcher = $keyMatcher; - $this->_valueMatcher = $valueMatcher; - } - - protected function matchesSafely($array) - { - foreach ($array as $key => $value) { - if ($this->_keyMatcher->matches($key) && $this->_valueMatcher->matches($value)) { - return true; - } - } - - return false; - } - - protected function describeMismatchSafely($array, Description $mismatchDescription) - { - //Not using appendValueList() so that keys can be shown - $mismatchDescription->appendText('array was ') - ->appendText('[') - ; - $loop = false; - foreach ($array as $key => $value) { - if ($loop) { - $mismatchDescription->appendText(', '); - } - $mismatchDescription->appendValue($key)->appendText(' => ')->appendValue($value); - $loop = true; - } - $mismatchDescription->appendText(']'); - } - - public function describeTo(Description $description) - { - $description->appendText('array containing [') - ->appendDescriptionOf($this->_keyMatcher) - ->appendText(' => ') - ->appendDescriptionOf($this->_valueMatcher) - ->appendText(']') - ; - } - - /** - * Test if an array has both an key and value in parity with each other. - * - * @factory hasEntry - */ - public static function hasKeyValuePair($key, $value) - { - return new self( - Util::wrapValueWithIsEqual($key), - Util::wrapValueWithIsEqual($value) - ); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayWithSize.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayWithSize.php deleted file mode 100644 index 074375c..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayWithSize.php +++ /dev/null @@ -1,73 +0,0 @@ -_elementMatchers = $elementMatchers; - $this->_mismatchDescription = $mismatchDescription; - } - - public function matches($item) - { - return $this->_isNotSurplus($item) && $this->_isMatched($item); - } - - public function isFinished($items) - { - if (empty($this->_elementMatchers)) { - return true; - } - - $this->_mismatchDescription - ->appendText('No item matches: ')->appendList('', ', ', '', $this->_elementMatchers) - ->appendText(' in ')->appendValueList('[', ', ', ']', $items) - ; - - return false; - } - - // -- Private Methods - - private function _isNotSurplus($item) - { - if (empty($this->_elementMatchers)) { - $this->_mismatchDescription->appendText('Not matched: ')->appendValue($item); - - return false; - } - - return true; - } - - private function _isMatched($item) - { - /** @var $matcher \Hamcrest\Matcher */ - foreach ($this->_elementMatchers as $i => $matcher) { - if ($matcher->matches($item)) { - unset($this->_elementMatchers[$i]); - - return true; - } - } - - $this->_mismatchDescription->appendText('Not matched: ')->appendValue($item); - - return false; - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/SeriesMatchingOnce.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/SeriesMatchingOnce.php deleted file mode 100644 index 12a912d..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/SeriesMatchingOnce.php +++ /dev/null @@ -1,75 +0,0 @@ -_elementMatchers = $elementMatchers; - $this->_keys = array_keys($elementMatchers); - $this->_mismatchDescription = $mismatchDescription; - } - - public function matches($item) - { - return $this->_isNotSurplus($item) && $this->_isMatched($item); - } - - public function isFinished() - { - if (!empty($this->_elementMatchers)) { - $nextMatcher = current($this->_elementMatchers); - $this->_mismatchDescription->appendText('No item matched: ')->appendDescriptionOf($nextMatcher); - - return false; - } - - return true; - } - - // -- Private Methods - - private function _isNotSurplus($item) - { - if (empty($this->_elementMatchers)) { - $this->_mismatchDescription->appendText('Not matched: ')->appendValue($item); - - return false; - } - - return true; - } - - private function _isMatched($item) - { - $this->_nextMatchKey = array_shift($this->_keys); - $nextMatcher = array_shift($this->_elementMatchers); - - if (!$nextMatcher->matches($item)) { - $this->_describeMismatch($nextMatcher, $item); - - return false; - } - - return true; - } - - private function _describeMismatch(Matcher $matcher, $item) - { - $this->_mismatchDescription->appendText('item with key ' . $this->_nextMatchKey . ': '); - $matcher->describeMismatch($item, $this->_mismatchDescription); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/AssertionError.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/AssertionError.php deleted file mode 100644 index 3a2a0e7..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/AssertionError.php +++ /dev/null @@ -1,10 +0,0 @@ -append($text); - - return $this; - } - - public function appendDescriptionOf(SelfDescribing $value) - { - $value->describeTo($this); - - return $this; - } - - public function appendValue($value) - { - if (is_null($value)) { - $this->append('null'); - } elseif (is_string($value)) { - $this->_toPhpSyntax($value); - } elseif (is_float($value)) { - $this->append('<'); - $this->append($value); - $this->append('F>'); - } elseif (is_bool($value)) { - $this->append('<'); - $this->append($value ? 'true' : 'false'); - $this->append('>'); - } elseif (is_array($value) || $value instanceof \Iterator || $value instanceof \IteratorAggregate) { - $this->appendValueList('[', ', ', ']', $value); - } elseif (is_object($value) && !method_exists($value, '__toString')) { - $this->append('<'); - $this->append(get_class($value)); - $this->append('>'); - } else { - $this->append('<'); - $this->append($value); - $this->append('>'); - } - - return $this; - } - - public function appendValueList($start, $separator, $end, $values) - { - $list = array(); - foreach ($values as $v) { - $list[] = new SelfDescribingValue($v); - } - - $this->appendList($start, $separator, $end, $list); - - return $this; - } - - public function appendList($start, $separator, $end, $values) - { - $this->append($start); - - $separate = false; - - foreach ($values as $value) { - /*if (!($value instanceof Hamcrest\SelfDescribing)) { - $value = new Hamcrest\Internal\SelfDescribingValue($value); - }*/ - - if ($separate) { - $this->append($separator); - } - - $this->appendDescriptionOf($value); - - $separate = true; - } - - $this->append($end); - - return $this; - } - - // -- Protected Methods - - /** - * Append the String $str to the description. - */ - abstract protected function append($str); - - // -- Private Methods - - private function _toPhpSyntax($value) - { - $str = '"'; - for ($i = 0, $len = strlen($value); $i < $len; ++$i) { - switch ($value[$i]) { - case '"': - $str .= '\\"'; - break; - - case "\t": - $str .= '\\t'; - break; - - case "\r": - $str .= '\\r'; - break; - - case "\n": - $str .= '\\n'; - break; - - default: - $str .= $value[$i]; - } - } - $str .= '"'; - $this->append($str); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/BaseMatcher.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/BaseMatcher.php deleted file mode 100644 index 0605569..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/BaseMatcher.php +++ /dev/null @@ -1,30 +0,0 @@ -appendText('was ')->appendValue($item); - } - - public function __toString() - { - return StringDescription::toString($this); - } - - public function __invoke() - { - return call_user_func_array(array($this, 'matches'), func_get_args()); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Collection/IsEmptyTraversable.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Collection/IsEmptyTraversable.php deleted file mode 100644 index 8ab58ea..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Collection/IsEmptyTraversable.php +++ /dev/null @@ -1,71 +0,0 @@ -_empty = $empty; - } - - public function matches($item) - { - if (!$item instanceof \Traversable) { - return false; - } - - foreach ($item as $value) { - return !$this->_empty; - } - - return $this->_empty; - } - - public function describeTo(Description $description) - { - $description->appendText($this->_empty ? 'an empty traversable' : 'a non-empty traversable'); - } - - /** - * Returns true if traversable is empty. - * - * @factory - */ - public static function emptyTraversable() - { - if (!self::$_INSTANCE) { - self::$_INSTANCE = new self; - } - - return self::$_INSTANCE; - } - - /** - * Returns true if traversable is not empty. - * - * @factory - */ - public static function nonEmptyTraversable() - { - if (!self::$_NOT_INSTANCE) { - self::$_NOT_INSTANCE = new self(false); - } - - return self::$_NOT_INSTANCE; - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Collection/IsTraversableWithSize.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Collection/IsTraversableWithSize.php deleted file mode 100644 index c95edc5..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Collection/IsTraversableWithSize.php +++ /dev/null @@ -1,47 +0,0 @@ -false. - */ -class AllOf extends DiagnosingMatcher -{ - - private $_matchers; - - public function __construct(array $matchers) - { - Util::checkAllAreMatchers($matchers); - - $this->_matchers = $matchers; - } - - public function matchesWithDiagnosticDescription($item, Description $mismatchDescription) - { - /** @var $matcher \Hamcrest\Matcher */ - foreach ($this->_matchers as $matcher) { - if (!$matcher->matches($item)) { - $mismatchDescription->appendDescriptionOf($matcher)->appendText(' '); - $matcher->describeMismatch($item, $mismatchDescription); - - return false; - } - } - - return true; - } - - public function describeTo(Description $description) - { - $description->appendList('(', ' and ', ')', $this->_matchers); - } - - /** - * Evaluates to true only if ALL of the passed in matchers evaluate to true. - * - * @factory ... - */ - public static function allOf(/* args... */) - { - $args = func_get_args(); - - return new self(Util::createMatcherArray($args)); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/AnyOf.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/AnyOf.php deleted file mode 100644 index 4504279..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/AnyOf.php +++ /dev/null @@ -1,58 +0,0 @@ -true. - */ -class AnyOf extends ShortcutCombination -{ - - public function __construct(array $matchers) - { - parent::__construct($matchers); - } - - public function matches($item) - { - return $this->matchesWithShortcut($item, true); - } - - public function describeTo(Description $description) - { - $this->describeToWithOperator($description, 'or'); - } - - /** - * Evaluates to true if ANY of the passed in matchers evaluate to true. - * - * @factory ... - */ - public static function anyOf(/* args... */) - { - $args = func_get_args(); - - return new self(Util::createMatcherArray($args)); - } - - /** - * Evaluates to false if ANY of the passed in matchers evaluate to true. - * - * @factory ... - */ - public static function noneOf(/* args... */) - { - $args = func_get_args(); - - return IsNot::not( - new self(Util::createMatcherArray($args)) - ); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/CombinableMatcher.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/CombinableMatcher.php deleted file mode 100644 index e3b4aa7..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/CombinableMatcher.php +++ /dev/null @@ -1,78 +0,0 @@ -_matcher = $matcher; - } - - public function matches($item) - { - return $this->_matcher->matches($item); - } - - public function describeTo(Description $description) - { - $description->appendDescriptionOf($this->_matcher); - } - - /** Diversion from Hamcrest-Java... Logical "and" not permitted */ - public function andAlso(Matcher $other) - { - return new self(new AllOf($this->_templatedListWith($other))); - } - - /** Diversion from Hamcrest-Java... Logical "or" not permitted */ - public function orElse(Matcher $other) - { - return new self(new AnyOf($this->_templatedListWith($other))); - } - - /** - * This is useful for fluently combining matchers that must both pass. - * For example: - *
-     *   assertThat($string, both(containsString("a"))->andAlso(containsString("b")));
-     * 
- * - * @factory - */ - public static function both(Matcher $matcher) - { - return new self($matcher); - } - - /** - * This is useful for fluently combining matchers where either may pass, - * for example: - *
-     *   assertThat($string, either(containsString("a"))->orElse(containsString("b")));
-     * 
- * - * @factory - */ - public static function either(Matcher $matcher) - { - return new self($matcher); - } - - // -- Private Methods - - private function _templatedListWith(Matcher $other) - { - return array($this->_matcher, $other); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/DescribedAs.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/DescribedAs.php deleted file mode 100644 index 5b2583f..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/DescribedAs.php +++ /dev/null @@ -1,68 +0,0 @@ -_descriptionTemplate = $descriptionTemplate; - $this->_matcher = $matcher; - $this->_values = $values; - } - - public function matches($item) - { - return $this->_matcher->matches($item); - } - - public function describeTo(Description $description) - { - $textStart = 0; - while (preg_match(self::ARG_PATTERN, $this->_descriptionTemplate, $matches, PREG_OFFSET_CAPTURE, $textStart)) { - $text = $matches[0][0]; - $index = $matches[1][0]; - $offset = $matches[0][1]; - - $description->appendText(substr($this->_descriptionTemplate, $textStart, $offset - $textStart)); - $description->appendValue($this->_values[$index]); - - $textStart = $offset + strlen($text); - } - - if ($textStart < strlen($this->_descriptionTemplate)) { - $description->appendText(substr($this->_descriptionTemplate, $textStart)); - } - } - - /** - * Wraps an existing matcher and overrides the description when it fails. - * - * @factory ... - */ - public static function describedAs(/* $description, Hamcrest\Matcher $matcher, $values... */) - { - $args = func_get_args(); - $description = array_shift($args); - $matcher = array_shift($args); - $values = $args; - - return new self($description, $matcher, $values); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/Every.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/Every.php deleted file mode 100644 index d686f8d..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/Every.php +++ /dev/null @@ -1,56 +0,0 @@ -_matcher = $matcher; - } - - protected function matchesSafelyWithDiagnosticDescription($items, Description $mismatchDescription) - { - foreach ($items as $item) { - if (!$this->_matcher->matches($item)) { - $mismatchDescription->appendText('an item '); - $this->_matcher->describeMismatch($item, $mismatchDescription); - - return false; - } - } - - return true; - } - - public function describeTo(Description $description) - { - $description->appendText('every item is ')->appendDescriptionOf($this->_matcher); - } - - /** - * @param Matcher $itemMatcher - * A matcher to apply to every element in an array. - * - * @return \Hamcrest\Core\Every - * Evaluates to TRUE for a collection in which every item matches $itemMatcher - * - * @factory - */ - public static function everyItem(Matcher $itemMatcher) - { - return new self($itemMatcher); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/HasToString.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/HasToString.php deleted file mode 100644 index 45bd910..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/HasToString.php +++ /dev/null @@ -1,56 +0,0 @@ -toString(); - } - - return (string) $actual; - } - - /** - * Does array size satisfy a given matcher? - * - * @factory - */ - public static function hasToString($matcher) - { - return new self(Util::wrapValueWithIsEqual($matcher)); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/Is.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/Is.php deleted file mode 100644 index 41266dc..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/Is.php +++ /dev/null @@ -1,57 +0,0 @@ -_matcher = $matcher; - } - - public function matches($arg) - { - return $this->_matcher->matches($arg); - } - - public function describeTo(Description $description) - { - $description->appendText('is ')->appendDescriptionOf($this->_matcher); - } - - public function describeMismatch($item, Description $mismatchDescription) - { - $this->_matcher->describeMismatch($item, $mismatchDescription); - } - - /** - * Decorates another Matcher, retaining the behavior but allowing tests - * to be slightly more expressive. - * - * For example: assertThat($cheese, equalTo($smelly)) - * vs. assertThat($cheese, is(equalTo($smelly))) - * - * @factory - */ - public static function is($value) - { - return new self(Util::wrapValueWithIsEqual($value)); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsAnything.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsAnything.php deleted file mode 100644 index f20e6c0..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsAnything.php +++ /dev/null @@ -1,45 +0,0 @@ -true. - */ -class IsAnything extends BaseMatcher -{ - - private $_message; - - public function __construct($message = 'ANYTHING') - { - $this->_message = $message; - } - - public function matches($item) - { - return true; - } - - public function describeTo(Description $description) - { - $description->appendText($this->_message); - } - - /** - * This matcher always evaluates to true. - * - * @param string $description A meaningful string used when describing itself. - * - * @return \Hamcrest\Core\IsAnything - * @factory - */ - public static function anything($description = 'ANYTHING') - { - return new self($description); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsCollectionContaining.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsCollectionContaining.php deleted file mode 100644 index 5e60426..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsCollectionContaining.php +++ /dev/null @@ -1,93 +0,0 @@ -_elementMatcher = $elementMatcher; - } - - protected function matchesSafely($items) - { - foreach ($items as $item) { - if ($this->_elementMatcher->matches($item)) { - return true; - } - } - - return false; - } - - protected function describeMismatchSafely($items, Description $mismatchDescription) - { - $mismatchDescription->appendText('was ')->appendValue($items); - } - - public function describeTo(Description $description) - { - $description - ->appendText('a collection containing ') - ->appendDescriptionOf($this->_elementMatcher) - ; - } - - /** - * Test if the value is an array containing this matcher. - * - * Example: - *
-     * assertThat(array('a', 'b'), hasItem(equalTo('b')));
-     * //Convenience defaults to equalTo()
-     * assertThat(array('a', 'b'), hasItem('b'));
-     * 
- * - * @factory ... - */ - public static function hasItem() - { - $args = func_get_args(); - $firstArg = array_shift($args); - - return new self(Util::wrapValueWithIsEqual($firstArg)); - } - - /** - * Test if the value is an array containing elements that match all of these - * matchers. - * - * Example: - *
-     * assertThat(array('a', 'b', 'c'), hasItems(equalTo('a'), equalTo('b')));
-     * 
- * - * @factory ... - */ - public static function hasItems(/* args... */) - { - $args = func_get_args(); - $matchers = array(); - - foreach ($args as $arg) { - $matchers[] = self::hasItem($arg); - } - - return AllOf::allOf($matchers); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsEqual.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsEqual.php deleted file mode 100644 index 523fba0..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsEqual.php +++ /dev/null @@ -1,44 +0,0 @@ -_item = $item; - } - - public function matches($arg) - { - return (($arg == $this->_item) && ($this->_item == $arg)); - } - - public function describeTo(Description $description) - { - $description->appendValue($this->_item); - } - - /** - * Is the value equal to another value, as tested by the use of the "==" - * comparison operator? - * - * @factory - */ - public static function equalTo($item) - { - return new self($item); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsIdentical.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsIdentical.php deleted file mode 100644 index 28f7b36..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsIdentical.php +++ /dev/null @@ -1,38 +0,0 @@ -_value = $value; - } - - public function describeTo(Description $description) - { - $description->appendValue($this->_value); - } - - /** - * Tests of the value is identical to $value as tested by the "===" operator. - * - * @factory - */ - public static function identicalTo($value) - { - return new self($value); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsInstanceOf.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsInstanceOf.php deleted file mode 100644 index 7a5c92a..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsInstanceOf.php +++ /dev/null @@ -1,67 +0,0 @@ -_theClass = $theClass; - } - - protected function matchesWithDiagnosticDescription($item, Description $mismatchDescription) - { - if (!is_object($item)) { - $mismatchDescription->appendText('was ')->appendValue($item); - - return false; - } - - if (!($item instanceof $this->_theClass)) { - $mismatchDescription->appendText('[' . get_class($item) . '] ') - ->appendValue($item); - - return false; - } - - return true; - } - - public function describeTo(Description $description) - { - $description->appendText('an instance of ') - ->appendText($this->_theClass) - ; - } - - /** - * Is the value an instance of a particular type? - * This version assumes no relationship between the required type and - * the signature of the method that sets it up, for example in - * assertThat($anObject, anInstanceOf('Thing')); - * - * @factory any - */ - public static function anInstanceOf($theClass) - { - return new self($theClass); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsNot.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsNot.php deleted file mode 100644 index 167f0d0..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsNot.php +++ /dev/null @@ -1,44 +0,0 @@ -_matcher = $matcher; - } - - public function matches($arg) - { - return !$this->_matcher->matches($arg); - } - - public function describeTo(Description $description) - { - $description->appendText('not ')->appendDescriptionOf($this->_matcher); - } - - /** - * Matches if value does not match $value. - * - * @factory - */ - public static function not($value) - { - return new self(Util::wrapValueWithIsEqual($value)); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsNull.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsNull.php deleted file mode 100644 index 91a454c..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsNull.php +++ /dev/null @@ -1,56 +0,0 @@ -appendText('null'); - } - - /** - * Matches if value is null. - * - * @factory - */ - public static function nullValue() - { - if (!self::$_INSTANCE) { - self::$_INSTANCE = new self(); - } - - return self::$_INSTANCE; - } - - /** - * Matches if value is not null. - * - * @factory - */ - public static function notNullValue() - { - if (!self::$_NOT_INSTANCE) { - self::$_NOT_INSTANCE = IsNot::not(self::nullValue()); - } - - return self::$_NOT_INSTANCE; - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsSame.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsSame.php deleted file mode 100644 index 8107870..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsSame.php +++ /dev/null @@ -1,51 +0,0 @@ -_object = $object; - } - - public function matches($object) - { - return ($object === $this->_object) && ($this->_object === $object); - } - - public function describeTo(Description $description) - { - $description->appendText('sameInstance(') - ->appendValue($this->_object) - ->appendText(')') - ; - } - - /** - * Creates a new instance of IsSame. - * - * @param mixed $object - * The predicate evaluates to true only when the argument is - * this object. - * - * @return \Hamcrest\Core\IsSame - * @factory - */ - public static function sameInstance($object) - { - return new self($object); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsTypeOf.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsTypeOf.php deleted file mode 100644 index d24f0f9..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsTypeOf.php +++ /dev/null @@ -1,71 +0,0 @@ -_theType = strtolower($theType); - } - - public function matches($item) - { - return strtolower(gettype($item)) == $this->_theType; - } - - public function describeTo(Description $description) - { - $description->appendText(self::getTypeDescription($this->_theType)); - } - - public function describeMismatch($item, Description $description) - { - if ($item === null) { - $description->appendText('was null'); - } else { - $description->appendText('was ') - ->appendText(self::getTypeDescription(strtolower(gettype($item)))) - ->appendText(' ') - ->appendValue($item) - ; - } - } - - public static function getTypeDescription($type) - { - if ($type == 'null') { - return 'null'; - } - - return (strpos('aeiou', substr($type, 0, 1)) === false ? 'a ' : 'an ') - . $type; - } - - /** - * Is the value a particular built-in type? - * - * @factory - */ - public static function typeOf($theType) - { - return new self($theType); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/Set.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/Set.php deleted file mode 100644 index cdc45d5..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/Set.php +++ /dev/null @@ -1,95 +0,0 @@ - - * assertThat(array('a', 'b'), set('b')); - * assertThat($foo, set('bar')); - * assertThat('Server', notSet('defaultPort')); - * - * - * @todo Replace $property with a matcher and iterate all property names. - */ -class Set extends BaseMatcher -{ - - private $_property; - private $_not; - - public function __construct($property, $not = false) - { - $this->_property = $property; - $this->_not = $not; - } - - public function matches($item) - { - if ($item === null) { - return false; - } - $property = $this->_property; - if (is_array($item)) { - $result = isset($item[$property]); - } elseif (is_object($item)) { - $result = isset($item->$property); - } elseif (is_string($item)) { - $result = isset($item::$$property); - } else { - throw new \InvalidArgumentException('Must pass an object, array, or class name'); - } - - return $this->_not ? !$result : $result; - } - - public function describeTo(Description $description) - { - $description->appendText($this->_not ? 'unset property ' : 'set property ')->appendText($this->_property); - } - - public function describeMismatch($item, Description $description) - { - $value = ''; - if (!$this->_not) { - $description->appendText('was not set'); - } else { - $property = $this->_property; - if (is_array($item)) { - $value = $item[$property]; - } elseif (is_object($item)) { - $value = $item->$property; - } elseif (is_string($item)) { - $value = $item::$$property; - } - parent::describeMismatch($value, $description); - } - } - - /** - * Matches if value (class, object, or array) has named $property. - * - * @factory - */ - public static function set($property) - { - return new self($property); - } - - /** - * Matches if value (class, object, or array) does not have named $property. - * - * @factory - */ - public static function notSet($property) - { - return new self($property, true); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/ShortcutCombination.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/ShortcutCombination.php deleted file mode 100644 index d93db74..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/ShortcutCombination.php +++ /dev/null @@ -1,43 +0,0 @@ - - */ - private $_matchers; - - public function __construct(array $matchers) - { - Util::checkAllAreMatchers($matchers); - - $this->_matchers = $matchers; - } - - protected function matchesWithShortcut($item, $shortcut) - { - /** @var $matcher \Hamcrest\Matcher */ - foreach ($this->_matchers as $matcher) { - if ($matcher->matches($item) == $shortcut) { - return $shortcut; - } - } - - return !$shortcut; - } - - public function describeToWithOperator(Description $description, $operator) - { - $description->appendList('(', ' ' . $operator . ' ', ')', $this->_matchers); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Description.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Description.php deleted file mode 100644 index 9a482db..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Description.php +++ /dev/null @@ -1,70 +0,0 @@ -matchesWithDiagnosticDescription($item, new NullDescription()); - } - - public function describeMismatch($item, Description $mismatchDescription) - { - $this->matchesWithDiagnosticDescription($item, $mismatchDescription); - } - - abstract protected function matchesWithDiagnosticDescription($item, Description $mismatchDescription); -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/FeatureMatcher.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/FeatureMatcher.php deleted file mode 100644 index 59f6cc7..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/FeatureMatcher.php +++ /dev/null @@ -1,67 +0,0 @@ -featureValueOf() in a subclass to pull out the feature to be - * matched against. - */ -abstract class FeatureMatcher extends TypeSafeDiagnosingMatcher -{ - - private $_subMatcher; - private $_featureDescription; - private $_featureName; - - /** - * Constructor. - * - * @param string $type - * @param string $subtype - * @param \Hamcrest\Matcher $subMatcher The matcher to apply to the feature - * @param string $featureDescription Descriptive text to use in describeTo - * @param string $featureName Identifying text for mismatch message - */ - public function __construct($type, $subtype, Matcher $subMatcher, $featureDescription, $featureName) - { - parent::__construct($type, $subtype); - - $this->_subMatcher = $subMatcher; - $this->_featureDescription = $featureDescription; - $this->_featureName = $featureName; - } - - /** - * Implement this to extract the interesting feature. - * - * @param mixed $actual the target object - * - * @return mixed the feature to be matched - */ - abstract protected function featureValueOf($actual); - - public function matchesSafelyWithDiagnosticDescription($actual, Description $mismatchDescription) - { - $featureValue = $this->featureValueOf($actual); - - if (!$this->_subMatcher->matches($featureValue)) { - $mismatchDescription->appendText($this->_featureName) - ->appendText(' was ')->appendValue($featureValue); - - return false; - } - - return true; - } - - final public function describeTo(Description $description) - { - $description->appendText($this->_featureDescription)->appendText(' ') - ->appendDescriptionOf($this->_subMatcher) - ; - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Internal/SelfDescribingValue.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Internal/SelfDescribingValue.php deleted file mode 100644 index 995da71..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Internal/SelfDescribingValue.php +++ /dev/null @@ -1,27 +0,0 @@ -_value = $value; - } - - public function describeTo(Description $description) - { - $description->appendValue($this->_value); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Matcher.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Matcher.php deleted file mode 100644 index e5dcf09..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Matcher.php +++ /dev/null @@ -1,50 +0,0 @@ - - * Matcher implementations should NOT directly implement this interface. - * Instead, extend the {@link Hamcrest\BaseMatcher} abstract class, - * which will ensure that the Matcher API can grow to support - * new features and remain compatible with all Matcher implementations. - *

- * For easy access to common Matcher implementations, use the static factory - * methods in {@link Hamcrest\CoreMatchers}. - * - * @see Hamcrest\CoreMatchers - * @see Hamcrest\BaseMatcher - */ -interface Matcher extends SelfDescribing -{ - - /** - * Evaluates the matcher for argument $item. - * - * @param mixed $item the object against which the matcher is evaluated. - * - * @return boolean true if $item matches, - * otherwise false. - * - * @see Hamcrest\BaseMatcher - */ - public function matches($item); - - /** - * Generate a description of why the matcher has not accepted the item. - * The description will be part of a larger description of why a matching - * failed, so it should be concise. - * This method assumes that matches($item) is false, but - * will not check this. - * - * @param mixed $item The item that the Matcher has rejected. - * @param Description $description - * @return - */ - public function describeMismatch($item, Description $description); -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/MatcherAssert.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/MatcherAssert.php deleted file mode 100644 index d546dbe..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/MatcherAssert.php +++ /dev/null @@ -1,118 +0,0 @@ - - * // With an identifier - * assertThat("apple flavour", $apple->flavour(), equalTo("tasty")); - * // Without an identifier - * assertThat($apple->flavour(), equalTo("tasty")); - * // Evaluating a boolean expression - * assertThat("some error", $a > $b); - * assertThat($a > $b); - * - */ - public static function assertThat(/* $args ... */) - { - $args = func_get_args(); - switch (count($args)) { - case 1: - self::$_count++; - if (!$args[0]) { - throw new AssertionError(); - } - break; - - case 2: - self::$_count++; - if ($args[1] instanceof Matcher) { - self::doAssert('', $args[0], $args[1]); - } elseif (!$args[1]) { - throw new AssertionError($args[0]); - } - break; - - case 3: - self::$_count++; - self::doAssert( - $args[0], - $args[1], - Util::wrapValueWithIsEqual($args[2]) - ); - break; - - default: - throw new \InvalidArgumentException('assertThat() requires one to three arguments'); - } - } - - /** - * Returns the number of assertions performed. - * - * @return int - */ - public static function getCount() - { - return self::$_count; - } - - /** - * Resets the number of assertions performed to zero. - */ - public static function resetCount() - { - self::$_count = 0; - } - - /** - * Performs the actual assertion logic. - * - * If $matcher doesn't match $actual, - * throws a {@link Hamcrest\AssertionError} with a description - * of the failure along with the optional $identifier. - * - * @param string $identifier added to the message upon failure - * @param mixed $actual value to compare against $matcher - * @param \Hamcrest\Matcher $matcher applied to $actual - * @throws AssertionError - */ - private static function doAssert($identifier, $actual, Matcher $matcher) - { - if (!$matcher->matches($actual)) { - $description = new StringDescription(); - if (!empty($identifier)) { - $description->appendText($identifier . PHP_EOL); - } - $description->appendText('Expected: ') - ->appendDescriptionOf($matcher) - ->appendText(PHP_EOL . ' but: '); - - $matcher->describeMismatch($actual, $description); - - throw new AssertionError((string) $description); - } - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Matchers.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Matchers.php deleted file mode 100644 index 23232e4..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Matchers.php +++ /dev/null @@ -1,713 +0,0 @@ - - * assertThat($string, both(containsString("a"))->andAlso(containsString("b"))); - * - */ - public static function both(\Hamcrest\Matcher $matcher) - { - return \Hamcrest\Core\CombinableMatcher::both($matcher); - } - - /** - * This is useful for fluently combining matchers where either may pass, - * for example: - *

-     *   assertThat($string, either(containsString("a"))->orElse(containsString("b")));
-     * 
- */ - public static function either(\Hamcrest\Matcher $matcher) - { - return \Hamcrest\Core\CombinableMatcher::either($matcher); - } - - /** - * Wraps an existing matcher and overrides the description when it fails. - */ - public static function describedAs(/* args... */) - { - $args = func_get_args(); - return call_user_func_array(array('\Hamcrest\Core\DescribedAs', 'describedAs'), $args); - } - - /** - * @param Matcher $itemMatcher - * A matcher to apply to every element in an array. - * - * @return \Hamcrest\Core\Every - * Evaluates to TRUE for a collection in which every item matches $itemMatcher - */ - public static function everyItem(\Hamcrest\Matcher $itemMatcher) - { - return \Hamcrest\Core\Every::everyItem($itemMatcher); - } - - /** - * Does array size satisfy a given matcher? - */ - public static function hasToString($matcher) - { - return \Hamcrest\Core\HasToString::hasToString($matcher); - } - - /** - * Decorates another Matcher, retaining the behavior but allowing tests - * to be slightly more expressive. - * - * For example: assertThat($cheese, equalTo($smelly)) - * vs. assertThat($cheese, is(equalTo($smelly))) - */ - public static function is($value) - { - return \Hamcrest\Core\Is::is($value); - } - - /** - * This matcher always evaluates to true. - * - * @param string $description A meaningful string used when describing itself. - * - * @return \Hamcrest\Core\IsAnything - */ - public static function anything($description = 'ANYTHING') - { - return \Hamcrest\Core\IsAnything::anything($description); - } - - /** - * Test if the value is an array containing this matcher. - * - * Example: - *
-     * assertThat(array('a', 'b'), hasItem(equalTo('b')));
-     * //Convenience defaults to equalTo()
-     * assertThat(array('a', 'b'), hasItem('b'));
-     * 
- */ - public static function hasItem(/* args... */) - { - $args = func_get_args(); - return call_user_func_array(array('\Hamcrest\Core\IsCollectionContaining', 'hasItem'), $args); - } - - /** - * Test if the value is an array containing elements that match all of these - * matchers. - * - * Example: - *
-     * assertThat(array('a', 'b', 'c'), hasItems(equalTo('a'), equalTo('b')));
-     * 
- */ - public static function hasItems(/* args... */) - { - $args = func_get_args(); - return call_user_func_array(array('\Hamcrest\Core\IsCollectionContaining', 'hasItems'), $args); - } - - /** - * Is the value equal to another value, as tested by the use of the "==" - * comparison operator? - */ - public static function equalTo($item) - { - return \Hamcrest\Core\IsEqual::equalTo($item); - } - - /** - * Tests of the value is identical to $value as tested by the "===" operator. - */ - public static function identicalTo($value) - { - return \Hamcrest\Core\IsIdentical::identicalTo($value); - } - - /** - * Is the value an instance of a particular type? - * This version assumes no relationship between the required type and - * the signature of the method that sets it up, for example in - * assertThat($anObject, anInstanceOf('Thing')); - */ - public static function anInstanceOf($theClass) - { - return \Hamcrest\Core\IsInstanceOf::anInstanceOf($theClass); - } - - /** - * Is the value an instance of a particular type? - * This version assumes no relationship between the required type and - * the signature of the method that sets it up, for example in - * assertThat($anObject, anInstanceOf('Thing')); - */ - public static function any($theClass) - { - return \Hamcrest\Core\IsInstanceOf::anInstanceOf($theClass); - } - - /** - * Matches if value does not match $value. - */ - public static function not($value) - { - return \Hamcrest\Core\IsNot::not($value); - } - - /** - * Matches if value is null. - */ - public static function nullValue() - { - return \Hamcrest\Core\IsNull::nullValue(); - } - - /** - * Matches if value is not null. - */ - public static function notNullValue() - { - return \Hamcrest\Core\IsNull::notNullValue(); - } - - /** - * Creates a new instance of IsSame. - * - * @param mixed $object - * The predicate evaluates to true only when the argument is - * this object. - * - * @return \Hamcrest\Core\IsSame - */ - public static function sameInstance($object) - { - return \Hamcrest\Core\IsSame::sameInstance($object); - } - - /** - * Is the value a particular built-in type? - */ - public static function typeOf($theType) - { - return \Hamcrest\Core\IsTypeOf::typeOf($theType); - } - - /** - * Matches if value (class, object, or array) has named $property. - */ - public static function set($property) - { - return \Hamcrest\Core\Set::set($property); - } - - /** - * Matches if value (class, object, or array) does not have named $property. - */ - public static function notSet($property) - { - return \Hamcrest\Core\Set::notSet($property); - } - - /** - * Matches if value is a number equal to $value within some range of - * acceptable error $delta. - */ - public static function closeTo($value, $delta) - { - return \Hamcrest\Number\IsCloseTo::closeTo($value, $delta); - } - - /** - * The value is not > $value, nor < $value. - */ - public static function comparesEqualTo($value) - { - return \Hamcrest\Number\OrderingComparison::comparesEqualTo($value); - } - - /** - * The value is > $value. - */ - public static function greaterThan($value) - { - return \Hamcrest\Number\OrderingComparison::greaterThan($value); - } - - /** - * The value is >= $value. - */ - public static function greaterThanOrEqualTo($value) - { - return \Hamcrest\Number\OrderingComparison::greaterThanOrEqualTo($value); - } - - /** - * The value is >= $value. - */ - public static function atLeast($value) - { - return \Hamcrest\Number\OrderingComparison::greaterThanOrEqualTo($value); - } - - /** - * The value is < $value. - */ - public static function lessThan($value) - { - return \Hamcrest\Number\OrderingComparison::lessThan($value); - } - - /** - * The value is <= $value. - */ - public static function lessThanOrEqualTo($value) - { - return \Hamcrest\Number\OrderingComparison::lessThanOrEqualTo($value); - } - - /** - * The value is <= $value. - */ - public static function atMost($value) - { - return \Hamcrest\Number\OrderingComparison::lessThanOrEqualTo($value); - } - - /** - * Matches if value is a zero-length string. - */ - public static function isEmptyString() - { - return \Hamcrest\Text\IsEmptyString::isEmptyString(); - } - - /** - * Matches if value is a zero-length string. - */ - public static function emptyString() - { - return \Hamcrest\Text\IsEmptyString::isEmptyString(); - } - - /** - * Matches if value is null or a zero-length string. - */ - public static function isEmptyOrNullString() - { - return \Hamcrest\Text\IsEmptyString::isEmptyOrNullString(); - } - - /** - * Matches if value is null or a zero-length string. - */ - public static function nullOrEmptyString() - { - return \Hamcrest\Text\IsEmptyString::isEmptyOrNullString(); - } - - /** - * Matches if value is a non-zero-length string. - */ - public static function isNonEmptyString() - { - return \Hamcrest\Text\IsEmptyString::isNonEmptyString(); - } - - /** - * Matches if value is a non-zero-length string. - */ - public static function nonEmptyString() - { - return \Hamcrest\Text\IsEmptyString::isNonEmptyString(); - } - - /** - * Matches if value is a string equal to $string, regardless of the case. - */ - public static function equalToIgnoringCase($string) - { - return \Hamcrest\Text\IsEqualIgnoringCase::equalToIgnoringCase($string); - } - - /** - * Matches if value is a string equal to $string, regardless of whitespace. - */ - public static function equalToIgnoringWhiteSpace($string) - { - return \Hamcrest\Text\IsEqualIgnoringWhiteSpace::equalToIgnoringWhiteSpace($string); - } - - /** - * Matches if value is a string that matches regular expression $pattern. - */ - public static function matchesPattern($pattern) - { - return \Hamcrest\Text\MatchesPattern::matchesPattern($pattern); - } - - /** - * Matches if value is a string that contains $substring. - */ - public static function containsString($substring) - { - return \Hamcrest\Text\StringContains::containsString($substring); - } - - /** - * Matches if value is a string that contains $substring regardless of the case. - */ - public static function containsStringIgnoringCase($substring) - { - return \Hamcrest\Text\StringContainsIgnoringCase::containsStringIgnoringCase($substring); - } - - /** - * Matches if value contains $substrings in a constrained order. - */ - public static function stringContainsInOrder(/* args... */) - { - $args = func_get_args(); - return call_user_func_array(array('\Hamcrest\Text\StringContainsInOrder', 'stringContainsInOrder'), $args); - } - - /** - * Matches if value is a string that ends with $substring. - */ - public static function endsWith($substring) - { - return \Hamcrest\Text\StringEndsWith::endsWith($substring); - } - - /** - * Matches if value is a string that starts with $substring. - */ - public static function startsWith($substring) - { - return \Hamcrest\Text\StringStartsWith::startsWith($substring); - } - - /** - * Is the value an array? - */ - public static function arrayValue() - { - return \Hamcrest\Type\IsArray::arrayValue(); - } - - /** - * Is the value a boolean? - */ - public static function booleanValue() - { - return \Hamcrest\Type\IsBoolean::booleanValue(); - } - - /** - * Is the value a boolean? - */ - public static function boolValue() - { - return \Hamcrest\Type\IsBoolean::booleanValue(); - } - - /** - * Is the value callable? - */ - public static function callableValue() - { - return \Hamcrest\Type\IsCallable::callableValue(); - } - - /** - * Is the value a float/double? - */ - public static function doubleValue() - { - return \Hamcrest\Type\IsDouble::doubleValue(); - } - - /** - * Is the value a float/double? - */ - public static function floatValue() - { - return \Hamcrest\Type\IsDouble::doubleValue(); - } - - /** - * Is the value an integer? - */ - public static function integerValue() - { - return \Hamcrest\Type\IsInteger::integerValue(); - } - - /** - * Is the value an integer? - */ - public static function intValue() - { - return \Hamcrest\Type\IsInteger::integerValue(); - } - - /** - * Is the value a numeric? - */ - public static function numericValue() - { - return \Hamcrest\Type\IsNumeric::numericValue(); - } - - /** - * Is the value an object? - */ - public static function objectValue() - { - return \Hamcrest\Type\IsObject::objectValue(); - } - - /** - * Is the value an object? - */ - public static function anObject() - { - return \Hamcrest\Type\IsObject::objectValue(); - } - - /** - * Is the value a resource? - */ - public static function resourceValue() - { - return \Hamcrest\Type\IsResource::resourceValue(); - } - - /** - * Is the value a scalar (boolean, integer, double, or string)? - */ - public static function scalarValue() - { - return \Hamcrest\Type\IsScalar::scalarValue(); - } - - /** - * Is the value a string? - */ - public static function stringValue() - { - return \Hamcrest\Type\IsString::stringValue(); - } - - /** - * Wraps $matcher with {@link Hamcrest\Core\IsEqual) - * if it's not a matcher and the XPath in count() - * if it's an integer. - */ - public static function hasXPath($xpath, $matcher = null) - { - return \Hamcrest\Xml\HasXPath::hasXPath($xpath, $matcher); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/NullDescription.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/NullDescription.php deleted file mode 100644 index aae8e46..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/NullDescription.php +++ /dev/null @@ -1,43 +0,0 @@ -_value = $value; - $this->_delta = $delta; - } - - protected function matchesSafely($item) - { - return $this->_actualDelta($item) <= 0.0; - } - - protected function describeMismatchSafely($item, Description $mismatchDescription) - { - $mismatchDescription->appendValue($item) - ->appendText(' differed by ') - ->appendValue($this->_actualDelta($item)) - ; - } - - public function describeTo(Description $description) - { - $description->appendText('a numeric value within ') - ->appendValue($this->_delta) - ->appendText(' of ') - ->appendValue($this->_value) - ; - } - - /** - * Matches if value is a number equal to $value within some range of - * acceptable error $delta. - * - * @factory - */ - public static function closeTo($value, $delta) - { - return new self($value, $delta); - } - - // -- Private Methods - - private function _actualDelta($item) - { - return (abs(($item - $this->_value)) - $this->_delta); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Number/OrderingComparison.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Number/OrderingComparison.php deleted file mode 100644 index 369d0cf..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Number/OrderingComparison.php +++ /dev/null @@ -1,132 +0,0 @@ -_value = $value; - $this->_minCompare = $minCompare; - $this->_maxCompare = $maxCompare; - } - - protected function matchesSafely($other) - { - $compare = $this->_compare($this->_value, $other); - - return ($this->_minCompare <= $compare) && ($compare <= $this->_maxCompare); - } - - protected function describeMismatchSafely($item, Description $mismatchDescription) - { - $mismatchDescription - ->appendValue($item)->appendText(' was ') - ->appendText($this->_comparison($this->_compare($this->_value, $item))) - ->appendText(' ')->appendValue($this->_value) - ; - } - - public function describeTo(Description $description) - { - $description->appendText('a value ') - ->appendText($this->_comparison($this->_minCompare)) - ; - if ($this->_minCompare != $this->_maxCompare) { - $description->appendText(' or ') - ->appendText($this->_comparison($this->_maxCompare)) - ; - } - $description->appendText(' ')->appendValue($this->_value); - } - - /** - * The value is not > $value, nor < $value. - * - * @factory - */ - public static function comparesEqualTo($value) - { - return new self($value, 0, 0); - } - - /** - * The value is > $value. - * - * @factory - */ - public static function greaterThan($value) - { - return new self($value, -1, -1); - } - - /** - * The value is >= $value. - * - * @factory atLeast - */ - public static function greaterThanOrEqualTo($value) - { - return new self($value, -1, 0); - } - - /** - * The value is < $value. - * - * @factory - */ - public static function lessThan($value) - { - return new self($value, 1, 1); - } - - /** - * The value is <= $value. - * - * @factory atMost - */ - public static function lessThanOrEqualTo($value) - { - return new self($value, 0, 1); - } - - // -- Private Methods - - private function _compare($left, $right) - { - $a = $left; - $b = $right; - - if ($a < $b) { - return -1; - } elseif ($a == $b) { - return 0; - } else { - return 1; - } - } - - private function _comparison($compare) - { - if ($compare > 0) { - return 'less than'; - } elseif ($compare == 0) { - return 'equal to'; - } else { - return 'greater than'; - } - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/SelfDescribing.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/SelfDescribing.php deleted file mode 100644 index 872fdf9..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/SelfDescribing.php +++ /dev/null @@ -1,23 +0,0 @@ -_out = (string) $out; - } - - public function __toString() - { - return $this->_out; - } - - /** - * Return the description of a {@link Hamcrest\SelfDescribing} object as a - * String. - * - * @param \Hamcrest\SelfDescribing $selfDescribing - * The object to be described. - * - * @return string - * The description of the object. - */ - public static function toString(SelfDescribing $selfDescribing) - { - $self = new self(); - - return (string) $self->appendDescriptionOf($selfDescribing); - } - - /** - * Alias for {@link toString()}. - */ - public static function asString(SelfDescribing $selfDescribing) - { - return self::toString($selfDescribing); - } - - // -- Protected Methods - - protected function append($str) - { - $this->_out .= $str; - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/IsEmptyString.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/IsEmptyString.php deleted file mode 100644 index 2ae61b9..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/IsEmptyString.php +++ /dev/null @@ -1,85 +0,0 @@ -_empty = $empty; - } - - public function matches($item) - { - return $this->_empty - ? ($item === '') - : is_string($item) && $item !== ''; - } - - public function describeTo(Description $description) - { - $description->appendText($this->_empty ? 'an empty string' : 'a non-empty string'); - } - - /** - * Matches if value is a zero-length string. - * - * @factory emptyString - */ - public static function isEmptyString() - { - if (!self::$_INSTANCE) { - self::$_INSTANCE = new self(true); - } - - return self::$_INSTANCE; - } - - /** - * Matches if value is null or a zero-length string. - * - * @factory nullOrEmptyString - */ - public static function isEmptyOrNullString() - { - if (!self::$_NULL_OR_EMPTY_INSTANCE) { - self::$_NULL_OR_EMPTY_INSTANCE = AnyOf::anyOf( - IsNull::nullvalue(), - self::isEmptyString() - ); - } - - return self::$_NULL_OR_EMPTY_INSTANCE; - } - - /** - * Matches if value is a non-zero-length string. - * - * @factory nonEmptyString - */ - public static function isNonEmptyString() - { - if (!self::$_NOT_INSTANCE) { - self::$_NOT_INSTANCE = new self(false); - } - - return self::$_NOT_INSTANCE; - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/IsEqualIgnoringCase.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/IsEqualIgnoringCase.php deleted file mode 100644 index 3836a8c..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/IsEqualIgnoringCase.php +++ /dev/null @@ -1,52 +0,0 @@ -_string = $string; - } - - protected function matchesSafely($item) - { - return strtolower($this->_string) === strtolower($item); - } - - protected function describeMismatchSafely($item, Description $mismatchDescription) - { - $mismatchDescription->appendText('was ')->appendText($item); - } - - public function describeTo(Description $description) - { - $description->appendText('equalToIgnoringCase(') - ->appendValue($this->_string) - ->appendText(')') - ; - } - - /** - * Matches if value is a string equal to $string, regardless of the case. - * - * @factory - */ - public static function equalToIgnoringCase($string) - { - return new self($string); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/IsEqualIgnoringWhiteSpace.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/IsEqualIgnoringWhiteSpace.php deleted file mode 100644 index 853692b..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/IsEqualIgnoringWhiteSpace.php +++ /dev/null @@ -1,66 +0,0 @@ -_string = $string; - } - - protected function matchesSafely($item) - { - return (strtolower($this->_stripSpace($item)) - === strtolower($this->_stripSpace($this->_string))); - } - - protected function describeMismatchSafely($item, Description $mismatchDescription) - { - $mismatchDescription->appendText('was ')->appendText($item); - } - - public function describeTo(Description $description) - { - $description->appendText('equalToIgnoringWhiteSpace(') - ->appendValue($this->_string) - ->appendText(')') - ; - } - - /** - * Matches if value is a string equal to $string, regardless of whitespace. - * - * @factory - */ - public static function equalToIgnoringWhiteSpace($string) - { - return new self($string); - } - - // -- Private Methods - - private function _stripSpace($string) - { - $parts = preg_split("/[\r\n\t ]+/", $string); - foreach ($parts as $i => $part) { - $parts[$i] = trim($part, " \r\n\t"); - } - - return trim(implode(' ', $parts), " \r\n\t"); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/MatchesPattern.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/MatchesPattern.php deleted file mode 100644 index fa0d68e..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/MatchesPattern.php +++ /dev/null @@ -1,40 +0,0 @@ -_substring, (string) $item) >= 1; - } - - protected function relationship() - { - return 'matching'; - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringContains.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringContains.php deleted file mode 100644 index b92786b..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringContains.php +++ /dev/null @@ -1,45 +0,0 @@ -_substring); - } - - /** - * Matches if value is a string that contains $substring. - * - * @factory - */ - public static function containsString($substring) - { - return new self($substring); - } - - // -- Protected Methods - - protected function evalSubstringOf($item) - { - return (false !== strpos((string) $item, $this->_substring)); - } - - protected function relationship() - { - return 'containing'; - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringContainsIgnoringCase.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringContainsIgnoringCase.php deleted file mode 100644 index 69f37c2..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringContainsIgnoringCase.php +++ /dev/null @@ -1,40 +0,0 @@ -_substring)); - } - - protected function relationship() - { - return 'containing in any case'; - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringContainsInOrder.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringContainsInOrder.php deleted file mode 100644 index e75de65..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringContainsInOrder.php +++ /dev/null @@ -1,66 +0,0 @@ -_substrings = $substrings; - } - - protected function matchesSafely($item) - { - $fromIndex = 0; - - foreach ($this->_substrings as $substring) { - if (false === $fromIndex = strpos($item, $substring, $fromIndex)) { - return false; - } - } - - return true; - } - - protected function describeMismatchSafely($item, Description $mismatchDescription) - { - $mismatchDescription->appendText('was ')->appendText($item); - } - - public function describeTo(Description $description) - { - $description->appendText('a string containing ') - ->appendValueList('', ', ', '', $this->_substrings) - ->appendText(' in order') - ; - } - - /** - * Matches if value contains $substrings in a constrained order. - * - * @factory ... - */ - public static function stringContainsInOrder(/* args... */) - { - $args = func_get_args(); - - if (isset($args[0]) && is_array($args[0])) { - $args = $args[0]; - } - - return new self($args); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringEndsWith.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringEndsWith.php deleted file mode 100644 index f802ee4..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringEndsWith.php +++ /dev/null @@ -1,40 +0,0 @@ -_substring))) === $this->_substring); - } - - protected function relationship() - { - return 'ending with'; - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringStartsWith.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringStartsWith.php deleted file mode 100644 index 79c9565..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringStartsWith.php +++ /dev/null @@ -1,40 +0,0 @@ -_substring)) === $this->_substring); - } - - protected function relationship() - { - return 'starting with'; - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/SubstringMatcher.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/SubstringMatcher.php deleted file mode 100644 index e560ad6..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/SubstringMatcher.php +++ /dev/null @@ -1,45 +0,0 @@ -_substring = $substring; - } - - protected function matchesSafely($item) - { - return $this->evalSubstringOf($item); - } - - protected function describeMismatchSafely($item, Description $mismatchDescription) - { - $mismatchDescription->appendText('was "')->appendText($item)->appendText('"'); - } - - public function describeTo(Description $description) - { - $description->appendText('a string ') - ->appendText($this->relationship()) - ->appendText(' ') - ->appendValue($this->_substring) - ; - } - - abstract protected function evalSubstringOf($string); - - abstract protected function relationship(); -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsArray.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsArray.php deleted file mode 100644 index 9179102..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsArray.php +++ /dev/null @@ -1,32 +0,0 @@ -isHexadecimal($item)) { - return true; - } - - return is_numeric($item); - } - - /** - * Return if the string passed is a valid hexadecimal number. - * This check is necessary because PHP 7 doesn't recognize hexadecimal string as numeric anymore. - * - * @param mixed $item - * @return boolean - */ - private function isHexadecimal($item) - { - if (is_string($item) && preg_match('/^0x(.*)$/', $item, $matches)) { - return ctype_xdigit($matches[1]); - } - - return false; - } - - /** - * Is the value a numeric? - * - * @factory - */ - public static function numericValue() - { - return new self; - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsObject.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsObject.php deleted file mode 100644 index 65918fc..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsObject.php +++ /dev/null @@ -1,32 +0,0 @@ -matchesSafelyWithDiagnosticDescription($item, new NullDescription()); - } - - final public function describeMismatchSafely($item, Description $mismatchDescription) - { - $this->matchesSafelyWithDiagnosticDescription($item, $mismatchDescription); - } - - // -- Protected Methods - - /** - * Subclasses should implement these. The item will already have been checked for - * the specific type. - */ - abstract protected function matchesSafelyWithDiagnosticDescription($item, Description $mismatchDescription); -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/TypeSafeMatcher.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/TypeSafeMatcher.php deleted file mode 100644 index 56e299a..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/TypeSafeMatcher.php +++ /dev/null @@ -1,107 +0,0 @@ -_expectedType = $expectedType; - $this->_expectedSubtype = $expectedSubtype; - } - - final public function matches($item) - { - return $this->_isSafeType($item) && $this->matchesSafely($item); - } - - final public function describeMismatch($item, Description $mismatchDescription) - { - if (!$this->_isSafeType($item)) { - parent::describeMismatch($item, $mismatchDescription); - } else { - $this->describeMismatchSafely($item, $mismatchDescription); - } - } - - // -- Protected Methods - - /** - * The item will already have been checked for the specific type and subtype. - */ - abstract protected function matchesSafely($item); - - /** - * The item will already have been checked for the specific type and subtype. - */ - abstract protected function describeMismatchSafely($item, Description $mismatchDescription); - - // -- Private Methods - - private function _isSafeType($value) - { - switch ($this->_expectedType) { - - case self::TYPE_ANY: - return true; - - case self::TYPE_STRING: - return is_string($value) || is_numeric($value); - - case self::TYPE_NUMERIC: - return is_numeric($value) || is_string($value); - - case self::TYPE_ARRAY: - return is_array($value); - - case self::TYPE_OBJECT: - return is_object($value) - && ($this->_expectedSubtype === null - || $value instanceof $this->_expectedSubtype); - - case self::TYPE_RESOURCE: - return is_resource($value) - && ($this->_expectedSubtype === null - || get_resource_type($value) == $this->_expectedSubtype); - - case self::TYPE_BOOLEAN: - return true; - - default: - return true; - - } - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Util.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Util.php deleted file mode 100644 index 169b036..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Util.php +++ /dev/null @@ -1,76 +0,0 @@ - all items are - */ - public static function createMatcherArray(array $items) - { - //Extract single array item - if (count($items) == 1 && is_array($items[0])) { - $items = $items[0]; - } - - //Replace non-matchers - foreach ($items as &$item) { - if (!($item instanceof Matcher)) { - $item = Core\IsEqual::equalTo($item); - } - } - - return $items; - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Xml/HasXPath.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Xml/HasXPath.php deleted file mode 100644 index d9764e4..0000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Xml/HasXPath.php +++ /dev/null @@ -1,195 +0,0 @@ -_xpath = $xpath; - $this->_matcher = $matcher; - } - - /** - * Matches if the XPath matches against the DOM node and the matcher. - * - * @param string|\DOMNode $actual - * @param Description $mismatchDescription - * @return bool - */ - protected function matchesWithDiagnosticDescription($actual, Description $mismatchDescription) - { - if (is_string($actual)) { - $actual = $this->createDocument($actual); - } elseif (!$actual instanceof \DOMNode) { - $mismatchDescription->appendText('was ')->appendValue($actual); - - return false; - } - $result = $this->evaluate($actual); - if ($result instanceof \DOMNodeList) { - return $this->matchesContent($result, $mismatchDescription); - } else { - return $this->matchesExpression($result, $mismatchDescription); - } - } - - /** - * Creates and returns a DOMDocument from the given - * XML or HTML string. - * - * @param string $text - * @return \DOMDocument built from $text - * @throws \InvalidArgumentException if the document is not valid - */ - protected function createDocument($text) - { - $document = new \DOMDocument(); - if (preg_match('/^\s*<\?xml/', $text)) { - if (!@$document->loadXML($text)) { - throw new \InvalidArgumentException('Must pass a valid XML document'); - } - } else { - if (!@$document->loadHTML($text)) { - throw new \InvalidArgumentException('Must pass a valid HTML or XHTML document'); - } - } - - return $document; - } - - /** - * Applies the configured XPath to the DOM node and returns either - * the result if it's an expression or the node list if it's a query. - * - * @param \DOMNode $node context from which to issue query - * @return mixed result of expression or DOMNodeList from query - */ - protected function evaluate(\DOMNode $node) - { - if ($node instanceof \DOMDocument) { - $xpathDocument = new \DOMXPath($node); - - return $xpathDocument->evaluate($this->_xpath); - } else { - $xpathDocument = new \DOMXPath($node->ownerDocument); - - return $xpathDocument->evaluate($this->_xpath, $node); - } - } - - /** - * Matches if the list of nodes is not empty and the content of at least - * one node matches the configured matcher, if supplied. - * - * @param \DOMNodeList $nodes selected by the XPath query - * @param Description $mismatchDescription - * @return bool - */ - protected function matchesContent(\DOMNodeList $nodes, Description $mismatchDescription) - { - if ($nodes->length == 0) { - $mismatchDescription->appendText('XPath returned no results'); - } elseif ($this->_matcher === null) { - return true; - } else { - foreach ($nodes as $node) { - if ($this->_matcher->matches($node->textContent)) { - return true; - } - } - $content = array(); - foreach ($nodes as $node) { - $content[] = $node->textContent; - } - $mismatchDescription->appendText('XPath returned ') - ->appendValue($content); - } - - return false; - } - - /** - * Matches if the result of the XPath expression matches the configured - * matcher or evaluates to true if there is none. - * - * @param mixed $result result of the XPath expression - * @param Description $mismatchDescription - * @return bool - */ - protected function matchesExpression($result, Description $mismatchDescription) - { - if ($this->_matcher === null) { - if ($result) { - return true; - } - $mismatchDescription->appendText('XPath expression result was ') - ->appendValue($result); - } else { - if ($this->_matcher->matches($result)) { - return true; - } - $mismatchDescription->appendText('XPath expression result '); - $this->_matcher->describeMismatch($result, $mismatchDescription); - } - - return false; - } - - public function describeTo(Description $description) - { - $description->appendText('XML or HTML document with XPath "') - ->appendText($this->_xpath) - ->appendText('"'); - if ($this->_matcher !== null) { - $description->appendText(' '); - $this->_matcher->describeTo($description); - } - } - - /** - * Wraps $matcher with {@link Hamcrest\Core\IsEqual) - * if it's not a matcher and the XPath in count() - * if it's an integer. - * - * @factory - */ - public static function hasXPath($xpath, $matcher = null) - { - if ($matcher === null || $matcher instanceof Matcher) { - return new self($xpath, $matcher); - } elseif (is_int($matcher) && strpos($xpath, 'count(') !== 0) { - $xpath = 'count(' . $xpath . ')'; - } - - return new self($xpath, IsEqual::equalTo($matcher)); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/AbstractMatcherTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/AbstractMatcherTest.php deleted file mode 100644 index 8a1fb2a..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/AbstractMatcherTest.php +++ /dev/null @@ -1,68 +0,0 @@ -assertTrue($matcher->matches($arg), $message); - } - - public function assertDoesNotMatch(\Hamcrest\Matcher $matcher, $arg, $message) - { - $this->assertFalse($matcher->matches($arg), $message); - } - - public function assertDescription($expected, \Hamcrest\Matcher $matcher) - { - $description = new \Hamcrest\StringDescription(); - $description->appendDescriptionOf($matcher); - $this->assertEquals($expected, (string) $description, 'Expected description'); - } - - public function assertMismatchDescription($expected, \Hamcrest\Matcher $matcher, $arg) - { - $description = new \Hamcrest\StringDescription(); - $this->assertFalse( - $matcher->matches($arg), - 'Precondtion: Matcher should not match item' - ); - $matcher->describeMismatch($arg, $description); - $this->assertEquals( - $expected, - (string) $description, - 'Expected mismatch description' - ); - } - - public function testIsNullSafe() - { - //Should not generate any notices - $this->createMatcher()->matches(null); - $this->createMatcher()->describeMismatch( - null, - new \Hamcrest\NullDescription() - ); - } - - public function testCopesWithUnknownTypes() - { - //Should not generate any notices - $this->createMatcher()->matches(new UnknownType()); - $this->createMatcher()->describeMismatch( - new UnknownType(), - new NullDescription() - ); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayContainingInAnyOrderTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayContainingInAnyOrderTest.php deleted file mode 100644 index 45d9f13..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayContainingInAnyOrderTest.php +++ /dev/null @@ -1,54 +0,0 @@ -assertDescription('[<1>, <2>] in any order', containsInAnyOrder(array(1, 2))); - } - - public function testMatchesItemsInAnyOrder() - { - $this->assertMatches(containsInAnyOrder(array(1, 2, 3)), array(1, 2, 3), 'in order'); - $this->assertMatches(containsInAnyOrder(array(1, 2, 3)), array(3, 2, 1), 'out of order'); - $this->assertMatches(containsInAnyOrder(array(1)), array(1), 'single'); - } - - public function testAppliesMatchersInAnyOrder() - { - $this->assertMatches( - containsInAnyOrder(array(1, 2, 3)), - array(1, 2, 3), - 'in order' - ); - $this->assertMatches( - containsInAnyOrder(array(1, 2, 3)), - array(3, 2, 1), - 'out of order' - ); - $this->assertMatches( - containsInAnyOrder(array(1)), - array(1), - 'single' - ); - } - - public function testMismatchesItemsInAnyOrder() - { - $matcher = containsInAnyOrder(array(1, 2, 3)); - - $this->assertMismatchDescription('was null', $matcher, null); - $this->assertMismatchDescription('No item matches: <1>, <2>, <3> in []', $matcher, array()); - $this->assertMismatchDescription('No item matches: <2>, <3> in [<1>]', $matcher, array(1)); - $this->assertMismatchDescription('Not matched: <4>', $matcher, array(4, 3, 2, 1)); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayContainingInOrderTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayContainingInOrderTest.php deleted file mode 100644 index a9e4e5b..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayContainingInOrderTest.php +++ /dev/null @@ -1,48 +0,0 @@ -assertDescription('[<1>, <2>]', arrayContaining(array(1, 2))); - } - - public function testMatchesItemsInOrder() - { - $this->assertMatches(arrayContaining(array(1, 2, 3)), array(1, 2, 3), 'in order'); - $this->assertMatches(arrayContaining(array(1)), array(1), 'single'); - } - - public function testAppliesMatchersInOrder() - { - $this->assertMatches( - arrayContaining(array(1, 2, 3)), - array(1, 2, 3), - 'in order' - ); - $this->assertMatches(arrayContaining(array(1)), array(1), 'single'); - } - - public function testMismatchesItemsInAnyOrder() - { - if (defined('HHVM_VERSION')) { - $this->markTestSkipped('Broken on HHVM.'); - } - - $matcher = arrayContaining(array(1, 2, 3)); - $this->assertMismatchDescription('was null', $matcher, null); - $this->assertMismatchDescription('No item matched: <1>', $matcher, array()); - $this->assertMismatchDescription('No item matched: <2>', $matcher, array(1)); - $this->assertMismatchDescription('item with key 0: was <4>', $matcher, array(4, 3, 2, 1)); - $this->assertMismatchDescription('item with key 2: was <4>', $matcher, array(1, 2, 4)); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayContainingKeyTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayContainingKeyTest.php deleted file mode 100644 index 31770d8..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayContainingKeyTest.php +++ /dev/null @@ -1,62 +0,0 @@ -1); - - $this->assertMatches(hasKey('a'), $array, 'Matches single key'); - } - - public function testMatchesArrayContainingKey() - { - $array = array('a'=>1, 'b'=>2, 'c'=>3); - - $this->assertMatches(hasKey('a'), $array, 'Matches a'); - $this->assertMatches(hasKey('c'), $array, 'Matches c'); - } - - public function testMatchesArrayContainingKeyWithIntegerKeys() - { - $array = array(1=>'A', 2=>'B'); - - assertThat($array, hasKey(1)); - } - - public function testMatchesArrayContainingKeyWithNumberKeys() - { - $array = array(1=>'A', 2=>'B'); - - assertThat($array, hasKey(1)); - - // very ugly version! - assertThat($array, IsArrayContainingKey::hasKeyInArray(2)); - } - - public function testHasReadableDescription() - { - $this->assertDescription('array with key "a"', hasKey('a')); - } - - public function testDoesNotMatchEmptyArray() - { - $this->assertMismatchDescription('array was []', hasKey('Foo'), array()); - } - - public function testDoesNotMatchArrayMissingKey() - { - $array = array('a'=>1, 'b'=>2, 'c'=>3); - - $this->assertMismatchDescription('array was ["a" => <1>, "b" => <2>, "c" => <3>]', hasKey('d'), $array); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayContainingKeyValuePairTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayContainingKeyValuePairTest.php deleted file mode 100644 index a415f9f..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayContainingKeyValuePairTest.php +++ /dev/null @@ -1,36 +0,0 @@ -1, 'b'=>2); - - $this->assertMatches(hasKeyValuePair(equalTo('a'), equalTo(1)), $array, 'matcherA'); - $this->assertMatches(hasKeyValuePair(equalTo('b'), equalTo(2)), $array, 'matcherB'); - $this->assertMismatchDescription( - 'array was ["a" => <1>, "b" => <2>]', - hasKeyValuePair(equalTo('c'), equalTo(3)), - $array - ); - } - - public function testDoesNotMatchNull() - { - $this->assertMismatchDescription('was null', hasKeyValuePair(anything(), anything()), null); - } - - public function testHasReadableDescription() - { - $this->assertDescription('array containing ["a" => <2>]', hasKeyValuePair(equalTo('a'), equalTo(2))); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayContainingTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayContainingTest.php deleted file mode 100644 index 8d5bd81..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayContainingTest.php +++ /dev/null @@ -1,50 +0,0 @@ -assertMatches( - hasItemInArray('a'), - array('a', 'b', 'c'), - "should matches array that contains 'a'" - ); - } - - public function testDoesNotMatchAnArrayThatDoesntContainAnElementMatchingTheGivenMatcher() - { - $this->assertDoesNotMatch( - hasItemInArray('a'), - array('b', 'c'), - "should not matches array that doesn't contain 'a'" - ); - $this->assertDoesNotMatch( - hasItemInArray('a'), - array(), - 'should not match empty array' - ); - } - - public function testDoesNotMatchNull() - { - $this->assertDoesNotMatch( - hasItemInArray('a'), - null, - 'should not match null' - ); - } - - public function testHasAReadableDescription() - { - $this->assertDescription('an array containing "a"', hasItemInArray('a')); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayTest.php deleted file mode 100644 index e4db53e..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayTest.php +++ /dev/null @@ -1,89 +0,0 @@ -assertMatches( - anArray(array(equalTo('a'), equalTo('b'), equalTo('c'))), - array('a', 'b', 'c'), - 'should match array with matching elements' - ); - } - - public function testDoesNotMatchAnArrayWhenElementsDoNotMatch() - { - $this->assertDoesNotMatch( - anArray(array(equalTo('a'), equalTo('b'))), - array('b', 'c'), - 'should not match array with different elements' - ); - } - - public function testDoesNotMatchAnArrayOfDifferentSize() - { - $this->assertDoesNotMatch( - anArray(array(equalTo('a'), equalTo('b'))), - array('a', 'b', 'c'), - 'should not match larger array' - ); - $this->assertDoesNotMatch( - anArray(array(equalTo('a'), equalTo('b'))), - array('a'), - 'should not match smaller array' - ); - } - - public function testDoesNotMatchNull() - { - $this->assertDoesNotMatch( - anArray(array(equalTo('a'))), - null, - 'should not match null' - ); - } - - public function testHasAReadableDescription() - { - $this->assertDescription( - '["a", "b"]', - anArray(array(equalTo('a'), equalTo('b'))) - ); - } - - public function testHasAReadableMismatchDescriptionWhenKeysDontMatch() - { - $this->assertMismatchDescription( - 'array keys were [<1>, <2>]', - anArray(array(equalTo('a'), equalTo('b'))), - array(1 => 'a', 2 => 'b') - ); - } - - public function testSupportsMatchesAssociativeArrays() - { - $this->assertMatches( - anArray(array('x'=>equalTo('a'), 'y'=>equalTo('b'), 'z'=>equalTo('c'))), - array('x'=>'a', 'y'=>'b', 'z'=>'c'), - 'should match associative array with matching elements' - ); - } - - public function testDoesNotMatchAnAssociativeArrayWhenKeysDoNotMatch() - { - $this->assertDoesNotMatch( - anArray(array('x'=>equalTo('a'), 'y'=>equalTo('b'))), - array('x'=>'b', 'z'=>'c'), - 'should not match array with different keys' - ); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayWithSizeTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayWithSizeTest.php deleted file mode 100644 index 8413c89..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayWithSizeTest.php +++ /dev/null @@ -1,37 +0,0 @@ -assertMatches(arrayWithSize(equalTo(3)), array(1, 2, 3), 'correct size'); - $this->assertDoesNotMatch(arrayWithSize(equalTo(2)), array(1, 2, 3), 'incorrect size'); - } - - public function testProvidesConvenientShortcutForArrayWithSizeEqualTo() - { - $this->assertMatches(arrayWithSize(3), array(1, 2, 3), 'correct size'); - $this->assertDoesNotMatch(arrayWithSize(2), array(1, 2, 3), 'incorrect size'); - } - - public function testEmptyArray() - { - $this->assertMatches(emptyArray(), array(), 'correct size'); - $this->assertDoesNotMatch(emptyArray(), array(1), 'incorrect size'); - } - - public function testHasAReadableDescription() - { - $this->assertDescription('an array with size <3>', arrayWithSize(equalTo(3))); - $this->assertDescription('an empty array', emptyArray()); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/BaseMatcherTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/BaseMatcherTest.php deleted file mode 100644 index 833e2c3..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/BaseMatcherTest.php +++ /dev/null @@ -1,23 +0,0 @@ -appendText('SOME DESCRIPTION'); - } - - public function testDescribesItselfWithToStringMethod() - { - $someMatcher = new \Hamcrest\SomeMatcher(); - $this->assertEquals('SOME DESCRIPTION', (string) $someMatcher); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Collection/IsEmptyTraversableTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Collection/IsEmptyTraversableTest.php deleted file mode 100644 index 2f15fb4..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Collection/IsEmptyTraversableTest.php +++ /dev/null @@ -1,77 +0,0 @@ -assertMatches( - emptyTraversable(), - new \ArrayObject(array()), - 'an empty traversable' - ); - } - - public function testEmptyMatcherDoesNotMatchWhenNotEmpty() - { - $this->assertDoesNotMatch( - emptyTraversable(), - new \ArrayObject(array(1, 2, 3)), - 'a non-empty traversable' - ); - } - - public function testEmptyMatcherDoesNotMatchNull() - { - $this->assertDoesNotMatch( - emptyTraversable(), - null, - 'should not match null' - ); - } - - public function testEmptyMatcherHasAReadableDescription() - { - $this->assertDescription('an empty traversable', emptyTraversable()); - } - - public function testNonEmptyDoesNotMatchNull() - { - $this->assertDoesNotMatch( - nonEmptyTraversable(), - null, - 'should not match null' - ); - } - - public function testNonEmptyDoesNotMatchWhenEmpty() - { - $this->assertDoesNotMatch( - nonEmptyTraversable(), - new \ArrayObject(array()), - 'an empty traversable' - ); - } - - public function testNonEmptyMatchesWhenNotEmpty() - { - $this->assertMatches( - nonEmptyTraversable(), - new \ArrayObject(array(1, 2, 3)), - 'a non-empty traversable' - ); - } - - public function testNonEmptyNonEmptyMatcherHasAReadableDescription() - { - $this->assertDescription('a non-empty traversable', nonEmptyTraversable()); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Collection/IsTraversableWithSizeTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Collection/IsTraversableWithSizeTest.php deleted file mode 100644 index c1c67a7..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Collection/IsTraversableWithSizeTest.php +++ /dev/null @@ -1,57 +0,0 @@ -assertMatches( - traversableWithSize(equalTo(3)), - new \ArrayObject(array(1, 2, 3)), - 'correct size' - ); - } - - public function testDoesNotMatchWhenSizeIsIncorrect() - { - $this->assertDoesNotMatch( - traversableWithSize(equalTo(2)), - new \ArrayObject(array(1, 2, 3)), - 'incorrect size' - ); - } - - public function testDoesNotMatchNull() - { - $this->assertDoesNotMatch( - traversableWithSize(3), - null, - 'should not match null' - ); - } - - public function testProvidesConvenientShortcutForTraversableWithSizeEqualTo() - { - $this->assertMatches( - traversableWithSize(3), - new \ArrayObject(array(1, 2, 3)), - 'correct size' - ); - } - - public function testHasAReadableDescription() - { - $this->assertDescription( - 'a traversable with size <3>', - traversableWithSize(equalTo(3)) - ); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/AllOfTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/AllOfTest.php deleted file mode 100644 index 86b8c27..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/AllOfTest.php +++ /dev/null @@ -1,56 +0,0 @@ -assertDescription( - '("good" and "bad" and "ugly")', - allOf('good', 'bad', 'ugly') - ); - } - - public function testMismatchDescriptionDescribesFirstFailingMatch() - { - $this->assertMismatchDescription( - '"good" was "bad"', - allOf('bad', 'good'), - 'bad' - ); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/AnyOfTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/AnyOfTest.php deleted file mode 100644 index 3d62b93..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/AnyOfTest.php +++ /dev/null @@ -1,79 +0,0 @@ -assertDescription( - '("good" or "bad" or "ugly")', - anyOf('good', 'bad', 'ugly') - ); - } - - public function testNoneOfEvaluatesToTheLogicalDisjunctionOfTwoOtherMatchers() - { - assertThat('good', not(noneOf('bad', 'good'))); - assertThat('good', not(noneOf('good', 'good'))); - assertThat('good', not(noneOf('good', 'bad'))); - - assertThat('good', noneOf('bad', startsWith('b'))); - } - - public function testNoneOfEvaluatesToTheLogicalDisjunctionOfManyOtherMatchers() - { - assertThat('good', not(noneOf('bad', 'good', 'bad', 'bad', 'bad'))); - assertThat('good', noneOf('bad', 'bad', 'bad', 'bad', 'bad')); - } - - public function testNoneOfSupportsMixedTypes() - { - $combined = noneOf( - equalTo(new \Hamcrest\Core\SampleBaseClass('good')), - equalTo(new \Hamcrest\Core\SampleBaseClass('ugly')), - equalTo(new \Hamcrest\Core\SampleSubClass('good')) - ); - - assertThat(new \Hamcrest\Core\SampleSubClass('bad'), $combined); - } - - public function testNoneOfHasAReadableDescription() - { - $this->assertDescription( - 'not ("good" or "bad" or "ugly")', - noneOf('good', 'bad', 'ugly') - ); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/CombinableMatcherTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/CombinableMatcherTest.php deleted file mode 100644 index 463c754..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/CombinableMatcherTest.php +++ /dev/null @@ -1,59 +0,0 @@ -_either_3_or_4 = \Hamcrest\Core\CombinableMatcher::either(equalTo(3))->orElse(equalTo(4)); - $this->_not_3_and_not_4 = \Hamcrest\Core\CombinableMatcher::both(not(equalTo(3)))->andAlso(not(equalTo(4))); - } - - protected function createMatcher() - { - return \Hamcrest\Core\CombinableMatcher::either(equalTo('irrelevant'))->orElse(equalTo('ignored')); - } - - public function testBothAcceptsAndRejects() - { - assertThat(2, $this->_not_3_and_not_4); - assertThat(3, not($this->_not_3_and_not_4)); - } - - public function testAcceptsAndRejectsThreeAnds() - { - $tripleAnd = $this->_not_3_and_not_4->andAlso(equalTo(2)); - assertThat(2, $tripleAnd); - assertThat(3, not($tripleAnd)); - } - - public function testBothDescribesItself() - { - $this->assertEquals('(not <3> and not <4>)', (string) $this->_not_3_and_not_4); - $this->assertMismatchDescription('was <3>', $this->_not_3_and_not_4, 3); - } - - public function testEitherAcceptsAndRejects() - { - assertThat(3, $this->_either_3_or_4); - assertThat(6, not($this->_either_3_or_4)); - } - - public function testAcceptsAndRejectsThreeOrs() - { - $orTriple = $this->_either_3_or_4->orElse(greaterThan(10)); - - assertThat(11, $orTriple); - assertThat(9, not($orTriple)); - } - - public function testEitherDescribesItself() - { - $this->assertEquals('(<3> or <4>)', (string) $this->_either_3_or_4); - $this->assertMismatchDescription('was <6>', $this->_either_3_or_4, 6); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/DescribedAsTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/DescribedAsTest.php deleted file mode 100644 index 673ab41..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/DescribedAsTest.php +++ /dev/null @@ -1,36 +0,0 @@ -assertDescription('m1 description', $m1); - $this->assertDescription('m2 description', $m2); - } - - public function testAppendsValuesToDescription() - { - $m = describedAs('value 1 = %0, value 2 = %1', anything(), 33, 97); - - $this->assertDescription('value 1 = <33>, value 2 = <97>', $m); - } - - public function testDelegatesMatchingToAnotherMatcher() - { - $m1 = describedAs('irrelevant', anything()); - $m2 = describedAs('irrelevant', not(anything())); - - $this->assertTrue($m1->matches(new \stdClass())); - $this->assertFalse($m2->matches('hi')); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/EveryTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/EveryTest.php deleted file mode 100644 index 5eb153c..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/EveryTest.php +++ /dev/null @@ -1,30 +0,0 @@ -assertEquals('every item is a string containing "a"', (string) $each); - - $this->assertMismatchDescription('an item was "BbB"', $each, array('BbB')); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/HasToStringTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/HasToStringTest.php deleted file mode 100644 index e2e136d..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/HasToStringTest.php +++ /dev/null @@ -1,108 +0,0 @@ -assertMatches( - hasToString(equalTo('php')), - new \Hamcrest\Core\PhpForm(), - 'correct __toString' - ); - $this->assertMatches( - hasToString(equalTo('java')), - new \Hamcrest\Core\JavaForm(), - 'correct toString' - ); - } - - public function testPicksJavaOverPhpToString() - { - $this->assertMatches( - hasToString(equalTo('java')), - new \Hamcrest\Core\BothForms(), - 'correct toString' - ); - } - - public function testDoesNotMatchWhenToStringDoesNotMatch() - { - $this->assertDoesNotMatch( - hasToString(equalTo('mismatch')), - new \Hamcrest\Core\PhpForm(), - 'incorrect __toString' - ); - $this->assertDoesNotMatch( - hasToString(equalTo('mismatch')), - new \Hamcrest\Core\JavaForm(), - 'incorrect toString' - ); - $this->assertDoesNotMatch( - hasToString(equalTo('mismatch')), - new \Hamcrest\Core\BothForms(), - 'incorrect __toString' - ); - } - - public function testDoesNotMatchNull() - { - $this->assertDoesNotMatch( - hasToString(equalTo('a')), - null, - 'should not match null' - ); - } - - public function testProvidesConvenientShortcutForTraversableWithSizeEqualTo() - { - $this->assertMatches( - hasToString(equalTo('php')), - new \Hamcrest\Core\PhpForm(), - 'correct __toString' - ); - } - - public function testHasAReadableDescription() - { - $this->assertDescription( - 'an object with toString() "php"', - hasToString(equalTo('php')) - ); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsAnythingTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsAnythingTest.php deleted file mode 100644 index f68032e..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsAnythingTest.php +++ /dev/null @@ -1,29 +0,0 @@ -assertDescription('ANYTHING', anything()); - } - - public function testCanOverrideDescription() - { - $description = 'description'; - $this->assertDescription($description, anything($description)); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsCollectionContainingTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsCollectionContainingTest.php deleted file mode 100644 index a3929b5..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsCollectionContainingTest.php +++ /dev/null @@ -1,91 +0,0 @@ -assertMatches( - $itemMatcher, - array('a', 'b', 'c'), - "should match list that contains 'a'" - ); - } - - public function testDoesNotMatchCollectionThatDoesntContainAnElementMatchingTheGivenMatcher() - { - $matcher1 = hasItem(equalTo('a')); - $this->assertDoesNotMatch( - $matcher1, - array('b', 'c'), - "should not match list that doesn't contain 'a'" - ); - - $matcher2 = hasItem(equalTo('a')); - $this->assertDoesNotMatch( - $matcher2, - array(), - 'should not match the empty list' - ); - } - - public function testDoesNotMatchNull() - { - $this->assertDoesNotMatch( - hasItem(equalTo('a')), - null, - 'should not match null' - ); - } - - public function testHasAReadableDescription() - { - $this->assertDescription('a collection containing "a"', hasItem(equalTo('a'))); - } - - public function testMatchesAllItemsInCollection() - { - $matcher1 = hasItems(equalTo('a'), equalTo('b'), equalTo('c')); - $this->assertMatches( - $matcher1, - array('a', 'b', 'c'), - 'should match list containing all items' - ); - - $matcher2 = hasItems('a', 'b', 'c'); - $this->assertMatches( - $matcher2, - array('a', 'b', 'c'), - 'should match list containing all items (without matchers)' - ); - - $matcher3 = hasItems(equalTo('a'), equalTo('b'), equalTo('c')); - $this->assertMatches( - $matcher3, - array('c', 'b', 'a'), - 'should match list containing all items in any order' - ); - - $matcher4 = hasItems(equalTo('a'), equalTo('b'), equalTo('c')); - $this->assertMatches( - $matcher4, - array('e', 'c', 'b', 'a', 'd'), - 'should match list containing all items plus others' - ); - - $matcher5 = hasItems(equalTo('a'), equalTo('b'), equalTo('c')); - $this->assertDoesNotMatch( - $matcher5, - array('e', 'c', 'b', 'd'), // 'a' missing - 'should not match list unless it contains all items' - ); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsEqualTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsEqualTest.php deleted file mode 100644 index 73e3ff0..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsEqualTest.php +++ /dev/null @@ -1,102 +0,0 @@ -_arg = $arg; - } - - public function __toString() - { - return $this->_arg; - } -} - -class IsEqualTest extends \Hamcrest\AbstractMatcherTest -{ - - protected function createMatcher() - { - return \Hamcrest\Core\IsEqual::equalTo('irrelevant'); - } - - public function testComparesObjectsUsingEqualityOperator() - { - assertThat("hi", equalTo("hi")); - assertThat("bye", not(equalTo("hi"))); - - assertThat(1, equalTo(1)); - assertThat(1, not(equalTo(2))); - - assertThat("2", equalTo(2)); - } - - public function testCanCompareNullValues() - { - assertThat(null, equalTo(null)); - - assertThat(null, not(equalTo('hi'))); - assertThat('hi', not(equalTo(null))); - } - - public function testComparesTheElementsOfAnArray() - { - $s1 = array('a', 'b'); - $s2 = array('a', 'b'); - $s3 = array('c', 'd'); - $s4 = array('a', 'b', 'c', 'd'); - - assertThat($s1, equalTo($s1)); - assertThat($s2, equalTo($s1)); - assertThat($s3, not(equalTo($s1))); - assertThat($s4, not(equalTo($s1))); - } - - public function testComparesTheElementsOfAnArrayOfPrimitiveTypes() - { - $i1 = array(1, 2); - $i2 = array(1, 2); - $i3 = array(3, 4); - $i4 = array(1, 2, 3, 4); - - assertThat($i1, equalTo($i1)); - assertThat($i2, equalTo($i1)); - assertThat($i3, not(equalTo($i1))); - assertThat($i4, not(equalTo($i1))); - } - - public function testRecursivelyTestsElementsOfArrays() - { - $i1 = array(array(1, 2), array(3, 4)); - $i2 = array(array(1, 2), array(3, 4)); - $i3 = array(array(5, 6), array(7, 8)); - $i4 = array(array(1, 2, 3, 4), array(3, 4)); - - assertThat($i1, equalTo($i1)); - assertThat($i2, equalTo($i1)); - assertThat($i3, not(equalTo($i1))); - assertThat($i4, not(equalTo($i1))); - } - - public function testIncludesTheResultOfCallingToStringOnItsArgumentInTheDescription() - { - $argumentDescription = 'ARGUMENT DESCRIPTION'; - $argument = new \Hamcrest\Core\DummyToStringClass($argumentDescription); - $this->assertDescription('<' . $argumentDescription . '>', equalTo($argument)); - } - - public function testReturnsAnObviousDescriptionIfCreatedWithANestedMatcherByMistake() - { - $innerMatcher = equalTo('NestedMatcher'); - $this->assertDescription('<' . (string) $innerMatcher . '>', equalTo($innerMatcher)); - } - - public function testReturnsGoodDescriptionIfCreatedWithNullReference() - { - $this->assertDescription('null', equalTo(null)); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsIdenticalTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsIdenticalTest.php deleted file mode 100644 index 9cc2794..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsIdenticalTest.php +++ /dev/null @@ -1,30 +0,0 @@ -assertDescription('"ARG"', identicalTo('ARG')); - } - - public function testReturnsReadableDescriptionFromToStringWhenInitialisedWithNull() - { - $this->assertDescription('null', identicalTo(null)); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsInstanceOfTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsInstanceOfTest.php deleted file mode 100644 index f74cfdb..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsInstanceOfTest.php +++ /dev/null @@ -1,51 +0,0 @@ -_baseClassInstance = new \Hamcrest\Core\SampleBaseClass('good'); - $this->_subClassInstance = new \Hamcrest\Core\SampleSubClass('good'); - } - - protected function createMatcher() - { - return \Hamcrest\Core\IsInstanceOf::anInstanceOf('stdClass'); - } - - public function testEvaluatesToTrueIfArgumentIsInstanceOfASpecificClass() - { - assertThat($this->_baseClassInstance, anInstanceOf('Hamcrest\Core\SampleBaseClass')); - assertThat($this->_subClassInstance, anInstanceOf('Hamcrest\Core\SampleSubClass')); - assertThat(null, not(anInstanceOf('Hamcrest\Core\SampleBaseClass'))); - assertThat(new \stdClass(), not(anInstanceOf('Hamcrest\Core\SampleBaseClass'))); - } - - public function testEvaluatesToFalseIfArgumentIsNotAnObject() - { - assertThat(null, not(anInstanceOf('Hamcrest\Core\SampleBaseClass'))); - assertThat(false, not(anInstanceOf('Hamcrest\Core\SampleBaseClass'))); - assertThat(5, not(anInstanceOf('Hamcrest\Core\SampleBaseClass'))); - assertThat('foo', not(anInstanceOf('Hamcrest\Core\SampleBaseClass'))); - assertThat(array(1, 2, 3), not(anInstanceOf('Hamcrest\Core\SampleBaseClass'))); - } - - public function testHasAReadableDescription() - { - $this->assertDescription('an instance of stdClass', anInstanceOf('stdClass')); - } - - public function testDecribesActualClassInMismatchMessage() - { - $this->assertMismatchDescription( - '[Hamcrest\Core\SampleBaseClass] ', - anInstanceOf('Hamcrest\Core\SampleSubClass'), - $this->_baseClassInstance - ); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsNotTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsNotTest.php deleted file mode 100644 index 09d4a65..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsNotTest.php +++ /dev/null @@ -1,31 +0,0 @@ -assertMatches(not(equalTo('A')), 'B', 'should match'); - $this->assertDoesNotMatch(not(equalTo('B')), 'B', 'should not match'); - } - - public function testProvidesConvenientShortcutForNotEqualTo() - { - $this->assertMatches(not('A'), 'B', 'should match'); - $this->assertMatches(not('B'), 'A', 'should match'); - $this->assertDoesNotMatch(not('A'), 'A', 'should not match'); - $this->assertDoesNotMatch(not('B'), 'B', 'should not match'); - } - - public function testUsesDescriptionOfNegatedMatcherWithPrefix() - { - $this->assertDescription('not a value greater than <2>', not(greaterThan(2))); - $this->assertDescription('not "A"', not('A')); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsNullTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsNullTest.php deleted file mode 100644 index bfa4255..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsNullTest.php +++ /dev/null @@ -1,20 +0,0 @@ -assertDescription('sameInstance("ARG")', sameInstance('ARG')); - } - - public function testReturnsReadableDescriptionFromToStringWhenInitialisedWithNull() - { - $this->assertDescription('sameInstance(null)', sameInstance(null)); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsTest.php deleted file mode 100644 index bbd848b..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsTest.php +++ /dev/null @@ -1,33 +0,0 @@ -assertMatches(is(equalTo(true)), true, 'should match'); - $this->assertMatches(is(equalTo(false)), false, 'should match'); - $this->assertDoesNotMatch(is(equalTo(true)), false, 'should not match'); - $this->assertDoesNotMatch(is(equalTo(false)), true, 'should not match'); - } - - public function testGeneratesIsPrefixInDescription() - { - $this->assertDescription('is ', is(equalTo(true))); - } - - public function testProvidesConvenientShortcutForIsEqualTo() - { - $this->assertMatches(is('A'), 'A', 'should match'); - $this->assertMatches(is('B'), 'B', 'should match'); - $this->assertDoesNotMatch(is('A'), 'B', 'should not match'); - $this->assertDoesNotMatch(is('B'), 'A', 'should not match'); - $this->assertDescription('is "A"', is('A')); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsTypeOfTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsTypeOfTest.php deleted file mode 100644 index 3f48dea..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsTypeOfTest.php +++ /dev/null @@ -1,45 +0,0 @@ -assertDescription('a double', typeOf('double')); - $this->assertDescription('an integer', typeOf('integer')); - } - - public function testDecribesActualTypeInMismatchMessage() - { - $this->assertMismatchDescription('was null', typeOf('boolean'), null); - $this->assertMismatchDescription('was an integer <5>', typeOf('float'), 5); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/SampleBaseClass.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/SampleBaseClass.php deleted file mode 100644 index c953e7c..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/SampleBaseClass.php +++ /dev/null @@ -1,18 +0,0 @@ -_arg = $arg; - } - - public function __toString() - { - return $this->_arg; - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/SampleSubClass.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/SampleSubClass.php deleted file mode 100644 index 822f1b6..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/SampleSubClass.php +++ /dev/null @@ -1,6 +0,0 @@ -_instanceProperty); - } - - protected function createMatcher() - { - return \Hamcrest\Core\Set::set('property_name'); - } - - public function testEvaluatesToTrueIfArrayPropertyIsSet() - { - assertThat(array('foo' => 'bar'), set('foo')); - } - - public function testNegatedEvaluatesToFalseIfArrayPropertyIsSet() - { - assertThat(array('foo' => 'bar'), not(notSet('foo'))); - } - - public function testEvaluatesToTrueIfClassPropertyIsSet() - { - self::$_classProperty = 'bar'; - assertThat('Hamcrest\Core\SetTest', set('_classProperty')); - } - - public function testNegatedEvaluatesToFalseIfClassPropertyIsSet() - { - self::$_classProperty = 'bar'; - assertThat('Hamcrest\Core\SetTest', not(notSet('_classProperty'))); - } - - public function testEvaluatesToTrueIfObjectPropertyIsSet() - { - $this->_instanceProperty = 'bar'; - assertThat($this, set('_instanceProperty')); - } - - public function testNegatedEvaluatesToFalseIfObjectPropertyIsSet() - { - $this->_instanceProperty = 'bar'; - assertThat($this, not(notSet('_instanceProperty'))); - } - - public function testEvaluatesToFalseIfArrayPropertyIsNotSet() - { - assertThat(array('foo' => 'bar'), not(set('baz'))); - } - - public function testNegatedEvaluatesToTrueIfArrayPropertyIsNotSet() - { - assertThat(array('foo' => 'bar'), notSet('baz')); - } - - public function testEvaluatesToFalseIfClassPropertyIsNotSet() - { - assertThat('Hamcrest\Core\SetTest', not(set('_classProperty'))); - } - - public function testNegatedEvaluatesToTrueIfClassPropertyIsNotSet() - { - assertThat('Hamcrest\Core\SetTest', notSet('_classProperty')); - } - - public function testEvaluatesToFalseIfObjectPropertyIsNotSet() - { - assertThat($this, not(set('_instanceProperty'))); - } - - public function testNegatedEvaluatesToTrueIfObjectPropertyIsNotSet() - { - assertThat($this, notSet('_instanceProperty')); - } - - public function testHasAReadableDescription() - { - $this->assertDescription('set property foo', set('foo')); - $this->assertDescription('unset property bar', notSet('bar')); - } - - public function testDecribesPropertySettingInMismatchMessage() - { - $this->assertMismatchDescription( - 'was not set', - set('bar'), - array('foo' => 'bar') - ); - $this->assertMismatchDescription( - 'was "bar"', - notSet('foo'), - array('foo' => 'bar') - ); - self::$_classProperty = 'bar'; - $this->assertMismatchDescription( - 'was "bar"', - notSet('_classProperty'), - 'Hamcrest\Core\SetTest' - ); - $this->_instanceProperty = 'bar'; - $this->assertMismatchDescription( - 'was "bar"', - notSet('_instanceProperty'), - $this - ); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/FeatureMatcherTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/FeatureMatcherTest.php deleted file mode 100644 index 1b02304..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/FeatureMatcherTest.php +++ /dev/null @@ -1,73 +0,0 @@ -_result = $result; - } - public function getResult() - { - return $this->_result; - } -} - -/* Test-specific subclass only */ -class ResultMatcher extends \Hamcrest\FeatureMatcher -{ - public function __construct() - { - parent::__construct(self::TYPE_ANY, null, equalTo('bar'), 'Thingy with result', 'result'); - } - public function featureValueOf($actual) - { - if ($actual instanceof \Hamcrest\Thingy) { - return $actual->getResult(); - } - } -} - -class FeatureMatcherTest extends \Hamcrest\AbstractMatcherTest -{ - - private $_resultMatcher; - - protected function setUp() - { - $this->_resultMatcher = $this->_resultMatcher(); - } - - protected function createMatcher() - { - return $this->_resultMatcher(); - } - - public function testMatchesPartOfAnObject() - { - $this->assertMatches($this->_resultMatcher, new \Hamcrest\Thingy('bar'), 'feature'); - $this->assertDescription('Thingy with result "bar"', $this->_resultMatcher); - } - - public function testMismatchesPartOfAnObject() - { - $this->assertMismatchDescription( - 'result was "foo"', - $this->_resultMatcher, - new \Hamcrest\Thingy('foo') - ); - } - - public function testDoesNotGenerateNoticesForNull() - { - $this->assertMismatchDescription('result was null', $this->_resultMatcher, null); - } - - // -- Creation Methods - - private function _resultMatcher() - { - return new \Hamcrest\ResultMatcher(); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/InvokedMatcherTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/InvokedMatcherTest.php deleted file mode 100644 index dfa7700..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/InvokedMatcherTest.php +++ /dev/null @@ -1,31 +0,0 @@ -matchAgainst = $matchAgainst; - } - - public function matches($item) - { - return $item == $this->matchAgainst; - } - -} - -class InvokedMatcherTest extends TestCase -{ - public function testInvokedMatchersCallMatches() - { - $sampleMatcher = new SampleInvokeMatcher('foo'); - - $this->assertTrue($sampleMatcher('foo')); - $this->assertFalse($sampleMatcher('bar')); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/MatcherAssertTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/MatcherAssertTest.php deleted file mode 100644 index dc12fba..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/MatcherAssertTest.php +++ /dev/null @@ -1,192 +0,0 @@ -getMessage()); - } - try { - \Hamcrest\MatcherAssert::assertThat(null); - self::fail('expected assertion failure'); - } catch (\Hamcrest\AssertionError $ex) { - self::assertEquals('', $ex->getMessage()); - } - try { - \Hamcrest\MatcherAssert::assertThat(''); - self::fail('expected assertion failure'); - } catch (\Hamcrest\AssertionError $ex) { - self::assertEquals('', $ex->getMessage()); - } - try { - \Hamcrest\MatcherAssert::assertThat(0); - self::fail('expected assertion failure'); - } catch (\Hamcrest\AssertionError $ex) { - self::assertEquals('', $ex->getMessage()); - } - try { - \Hamcrest\MatcherAssert::assertThat(0.0); - self::fail('expected assertion failure'); - } catch (\Hamcrest\AssertionError $ex) { - self::assertEquals('', $ex->getMessage()); - } - try { - \Hamcrest\MatcherAssert::assertThat(array()); - self::fail('expected assertion failure'); - } catch (\Hamcrest\AssertionError $ex) { - self::assertEquals('', $ex->getMessage()); - } - self::assertEquals(6, \Hamcrest\MatcherAssert::getCount(), 'assertion count'); - } - - public function testAssertThatWithIdentifierAndTrueArgPasses() - { - \Hamcrest\MatcherAssert::assertThat('identifier', true); - \Hamcrest\MatcherAssert::assertThat('identifier', 'non-empty'); - \Hamcrest\MatcherAssert::assertThat('identifier', 1); - \Hamcrest\MatcherAssert::assertThat('identifier', 3.14159); - \Hamcrest\MatcherAssert::assertThat('identifier', array(true)); - self::assertEquals(5, \Hamcrest\MatcherAssert::getCount(), 'assertion count'); - } - - public function testAssertThatWithIdentifierAndFalseArgFails() - { - try { - \Hamcrest\MatcherAssert::assertThat('identifier', false); - self::fail('expected assertion failure'); - } catch (\Hamcrest\AssertionError $ex) { - self::assertEquals('identifier', $ex->getMessage()); - } - try { - \Hamcrest\MatcherAssert::assertThat('identifier', null); - self::fail('expected assertion failure'); - } catch (\Hamcrest\AssertionError $ex) { - self::assertEquals('identifier', $ex->getMessage()); - } - try { - \Hamcrest\MatcherAssert::assertThat('identifier', ''); - self::fail('expected assertion failure'); - } catch (\Hamcrest\AssertionError $ex) { - self::assertEquals('identifier', $ex->getMessage()); - } - try { - \Hamcrest\MatcherAssert::assertThat('identifier', 0); - self::fail('expected assertion failure'); - } catch (\Hamcrest\AssertionError $ex) { - self::assertEquals('identifier', $ex->getMessage()); - } - try { - \Hamcrest\MatcherAssert::assertThat('identifier', 0.0); - self::fail('expected assertion failure'); - } catch (\Hamcrest\AssertionError $ex) { - self::assertEquals('identifier', $ex->getMessage()); - } - try { - \Hamcrest\MatcherAssert::assertThat('identifier', array()); - self::fail('expected assertion failure'); - } catch (\Hamcrest\AssertionError $ex) { - self::assertEquals('identifier', $ex->getMessage()); - } - self::assertEquals(6, \Hamcrest\MatcherAssert::getCount(), 'assertion count'); - } - - public function testAssertThatWithActualValueAndMatcherArgsThatMatchPasses() - { - \Hamcrest\MatcherAssert::assertThat(true, is(true)); - self::assertEquals(1, \Hamcrest\MatcherAssert::getCount(), 'assertion count'); - } - - public function testAssertThatWithActualValueAndMatcherArgsThatDontMatchFails() - { - $expected = 'expected'; - $actual = 'actual'; - - $expectedMessage = - 'Expected: "expected"' . PHP_EOL . - ' but: was "actual"'; - - try { - \Hamcrest\MatcherAssert::assertThat($actual, equalTo($expected)); - self::fail('expected assertion failure'); - } catch (\Hamcrest\AssertionError $ex) { - self::assertEquals($expectedMessage, $ex->getMessage()); - self::assertEquals(1, \Hamcrest\MatcherAssert::getCount(), 'assertion count'); - } - } - - public function testAssertThatWithIdentifierAndActualValueAndMatcherArgsThatMatchPasses() - { - \Hamcrest\MatcherAssert::assertThat('identifier', true, is(true)); - self::assertEquals(1, \Hamcrest\MatcherAssert::getCount(), 'assertion count'); - } - - public function testAssertThatWithIdentifierAndActualValueAndMatcherArgsThatDontMatchFails() - { - $expected = 'expected'; - $actual = 'actual'; - - $expectedMessage = - 'identifier' . PHP_EOL . - 'Expected: "expected"' . PHP_EOL . - ' but: was "actual"'; - - try { - \Hamcrest\MatcherAssert::assertThat('identifier', $actual, equalTo($expected)); - self::fail('expected assertion failure'); - } catch (\Hamcrest\AssertionError $ex) { - self::assertEquals($expectedMessage, $ex->getMessage()); - self::assertEquals(1, \Hamcrest\MatcherAssert::getCount(), 'assertion count'); - } - } - - public function testAssertThatWithNoArgsThrowsErrorAndDoesntIncrementCount() - { - try { - \Hamcrest\MatcherAssert::assertThat(); - self::fail('expected invalid argument exception'); - } catch (\InvalidArgumentException $ex) { - self::assertEquals(0, \Hamcrest\MatcherAssert::getCount(), 'assertion count'); - } - } - - public function testAssertThatWithFourArgsThrowsErrorAndDoesntIncrementCount() - { - try { - \Hamcrest\MatcherAssert::assertThat(1, 2, 3, 4); - self::fail('expected invalid argument exception'); - } catch (\InvalidArgumentException $ex) { - self::assertEquals(0, \Hamcrest\MatcherAssert::getCount(), 'assertion count'); - } - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Number/IsCloseToTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Number/IsCloseToTest.php deleted file mode 100644 index 987d552..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Number/IsCloseToTest.php +++ /dev/null @@ -1,27 +0,0 @@ -assertTrue($p->matches(1.0)); - $this->assertTrue($p->matches(0.5)); - $this->assertTrue($p->matches(1.5)); - - $this->assertDoesNotMatch($p, 2.0, 'too large'); - $this->assertMismatchDescription('<2F> differed by <0.5F>', $p, 2.0); - $this->assertDoesNotMatch($p, 0.0, 'number too small'); - $this->assertMismatchDescription('<0F> differed by <0.5F>', $p, 0.0); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Number/OrderingComparisonTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Number/OrderingComparisonTest.php deleted file mode 100644 index a4c94d3..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Number/OrderingComparisonTest.php +++ /dev/null @@ -1,41 +0,0 @@ -_text = $text; - } - - public function describeTo(\Hamcrest\Description $description) - { - $description->appendText($this->_text); - } -} - -class StringDescriptionTest extends TestCase -{ - - private $_description; - - protected function setUp() - { - $this->_description = new \Hamcrest\StringDescription(); - } - - public function testAppendTextAppendsTextInformation() - { - $this->_description->appendText('foo')->appendText('bar'); - $this->assertEquals('foobar', (string) $this->_description); - } - - public function testAppendValueCanAppendTextTypes() - { - $this->_description->appendValue('foo'); - $this->assertEquals('"foo"', (string) $this->_description); - } - - public function testSpecialCharactersAreEscapedForStringTypes() - { - $this->_description->appendValue("foo\\bar\"zip\r\n"); - $this->assertEquals('"foo\\bar\\"zip\r\n"', (string) $this->_description); - } - - public function testIntegerValuesCanBeAppended() - { - $this->_description->appendValue(42); - $this->assertEquals('<42>', (string) $this->_description); - } - - public function testFloatValuesCanBeAppended() - { - $this->_description->appendValue(42.78); - $this->assertEquals('<42.78F>', (string) $this->_description); - } - - public function testNullValuesCanBeAppended() - { - $this->_description->appendValue(null); - $this->assertEquals('null', (string) $this->_description); - } - - public function testArraysCanBeAppended() - { - $this->_description->appendValue(array('foo', 42.78)); - $this->assertEquals('["foo", <42.78F>]', (string) $this->_description); - } - - public function testObjectsCanBeAppended() - { - $this->_description->appendValue(new \stdClass()); - $this->assertEquals('', (string) $this->_description); - } - - public function testBooleanValuesCanBeAppended() - { - $this->_description->appendValue(false); - $this->assertEquals('', (string) $this->_description); - } - - public function testListsOfvaluesCanBeAppended() - { - $this->_description->appendValue(array('foo', 42.78)); - $this->assertEquals('["foo", <42.78F>]', (string) $this->_description); - } - - public function testIterableOfvaluesCanBeAppended() - { - $items = new \ArrayObject(array('foo', 42.78)); - $this->_description->appendValue($items); - $this->assertEquals('["foo", <42.78F>]', (string) $this->_description); - } - - public function testIteratorOfvaluesCanBeAppended() - { - $items = new \ArrayObject(array('foo', 42.78)); - $this->_description->appendValue($items->getIterator()); - $this->assertEquals('["foo", <42.78F>]', (string) $this->_description); - } - - public function testListsOfvaluesCanBeAppendedManually() - { - $this->_description->appendValueList('@start@', '@sep@ ', '@end@', array('foo', 42.78)); - $this->assertEquals('@start@"foo"@sep@ <42.78F>@end@', (string) $this->_description); - } - - public function testIterableOfvaluesCanBeAppendedManually() - { - $items = new \ArrayObject(array('foo', 42.78)); - $this->_description->appendValueList('@start@', '@sep@ ', '@end@', $items); - $this->assertEquals('@start@"foo"@sep@ <42.78F>@end@', (string) $this->_description); - } - - public function testIteratorOfvaluesCanBeAppendedManually() - { - $items = new \ArrayObject(array('foo', 42.78)); - $this->_description->appendValueList('@start@', '@sep@ ', '@end@', $items->getIterator()); - $this->assertEquals('@start@"foo"@sep@ <42.78F>@end@', (string) $this->_description); - } - - public function testSelfDescribingObjectsCanBeAppended() - { - $this->_description - ->appendDescriptionOf(new \Hamcrest\SampleSelfDescriber('foo')) - ->appendDescriptionOf(new \Hamcrest\SampleSelfDescriber('bar')) - ; - $this->assertEquals('foobar', (string) $this->_description); - } - - public function testSelfDescribingObjectsCanBeAppendedAsLists() - { - $this->_description->appendList('@start@', '@sep@ ', '@end@', array( - new \Hamcrest\SampleSelfDescriber('foo'), - new \Hamcrest\SampleSelfDescriber('bar') - )); - $this->assertEquals('@start@foo@sep@ bar@end@', (string) $this->_description); - } - - public function testSelfDescribingObjectsCanBeAppendedAsIteratedLists() - { - $items = new \ArrayObject(array( - new \Hamcrest\SampleSelfDescriber('foo'), - new \Hamcrest\SampleSelfDescriber('bar') - )); - $this->_description->appendList('@start@', '@sep@ ', '@end@', $items); - $this->assertEquals('@start@foo@sep@ bar@end@', (string) $this->_description); - } - - public function testSelfDescribingObjectsCanBeAppendedAsIterators() - { - $items = new \ArrayObject(array( - new \Hamcrest\SampleSelfDescriber('foo'), - new \Hamcrest\SampleSelfDescriber('bar') - )); - $this->_description->appendList('@start@', '@sep@ ', '@end@', $items->getIterator()); - $this->assertEquals('@start@foo@sep@ bar@end@', (string) $this->_description); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/IsEmptyStringTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/IsEmptyStringTest.php deleted file mode 100644 index 8d5c56b..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/IsEmptyStringTest.php +++ /dev/null @@ -1,86 +0,0 @@ -assertDoesNotMatch(emptyString(), null, 'null'); - } - - public function testEmptyDoesNotMatchZero() - { - $this->assertDoesNotMatch(emptyString(), 0, 'zero'); - } - - public function testEmptyDoesNotMatchFalse() - { - $this->assertDoesNotMatch(emptyString(), false, 'false'); - } - - public function testEmptyDoesNotMatchEmptyArray() - { - $this->assertDoesNotMatch(emptyString(), array(), 'empty array'); - } - - public function testEmptyMatchesEmptyString() - { - $this->assertMatches(emptyString(), '', 'empty string'); - } - - public function testEmptyDoesNotMatchNonEmptyString() - { - $this->assertDoesNotMatch(emptyString(), 'foo', 'non-empty string'); - } - - public function testEmptyHasAReadableDescription() - { - $this->assertDescription('an empty string', emptyString()); - } - - public function testEmptyOrNullMatchesNull() - { - $this->assertMatches(nullOrEmptyString(), null, 'null'); - } - - public function testEmptyOrNullMatchesEmptyString() - { - $this->assertMatches(nullOrEmptyString(), '', 'empty string'); - } - - public function testEmptyOrNullDoesNotMatchNonEmptyString() - { - $this->assertDoesNotMatch(nullOrEmptyString(), 'foo', 'non-empty string'); - } - - public function testEmptyOrNullHasAReadableDescription() - { - $this->assertDescription('(null or an empty string)', nullOrEmptyString()); - } - - public function testNonEmptyDoesNotMatchNull() - { - $this->assertDoesNotMatch(nonEmptyString(), null, 'null'); - } - - public function testNonEmptyDoesNotMatchEmptyString() - { - $this->assertDoesNotMatch(nonEmptyString(), '', 'empty string'); - } - - public function testNonEmptyMatchesNonEmptyString() - { - $this->assertMatches(nonEmptyString(), 'foo', 'non-empty string'); - } - - public function testNonEmptyHasAReadableDescription() - { - $this->assertDescription('a non-empty string', nonEmptyString()); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/IsEqualIgnoringCaseTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/IsEqualIgnoringCaseTest.php deleted file mode 100644 index 0539fd5..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/IsEqualIgnoringCaseTest.php +++ /dev/null @@ -1,40 +0,0 @@ -assertDescription( - 'equalToIgnoringCase("heLLo")', - equalToIgnoringCase('heLLo') - ); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/IsEqualIgnoringWhiteSpaceTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/IsEqualIgnoringWhiteSpaceTest.php deleted file mode 100644 index 27ad338..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/IsEqualIgnoringWhiteSpaceTest.php +++ /dev/null @@ -1,51 +0,0 @@ -_matcher = \Hamcrest\Text\IsEqualIgnoringWhiteSpace::equalToIgnoringWhiteSpace( - "Hello World how\n are we? " - ); - } - - protected function createMatcher() - { - return $this->_matcher; - } - - public function testPassesIfWordsAreSameButWhitespaceDiffers() - { - assertThat('Hello World how are we?', $this->_matcher); - assertThat(" Hello \rWorld \t how are\nwe?", $this->_matcher); - } - - public function testFailsIfTextOtherThanWhitespaceDiffers() - { - assertThat('Hello PLANET how are we?', not($this->_matcher)); - assertThat('Hello World how are we', not($this->_matcher)); - } - - public function testFailsIfWhitespaceIsAddedOrRemovedInMidWord() - { - assertThat('HelloWorld how are we?', not($this->_matcher)); - assertThat('Hello Wo rld how are we?', not($this->_matcher)); - } - - public function testFailsIfMatchingAgainstNull() - { - assertThat(null, not($this->_matcher)); - } - - public function testHasAReadableDescription() - { - $this->assertDescription( - "equalToIgnoringWhiteSpace(\"Hello World how\\n are we? \")", - $this->_matcher - ); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/MatchesPatternTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/MatchesPatternTest.php deleted file mode 100644 index 4891598..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/MatchesPatternTest.php +++ /dev/null @@ -1,30 +0,0 @@ -assertDescription('a string matching "pattern"', matchesPattern('pattern')); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringContainsIgnoringCaseTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringContainsIgnoringCaseTest.php deleted file mode 100644 index 7302300..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringContainsIgnoringCaseTest.php +++ /dev/null @@ -1,80 +0,0 @@ -_stringContains = \Hamcrest\Text\StringContainsIgnoringCase::containsStringIgnoringCase( - strtolower(self::EXCERPT) - ); - } - - protected function createMatcher() - { - return $this->_stringContains; - } - - public function testEvaluatesToTrueIfArgumentContainsSpecifiedSubstring() - { - $this->assertTrue( - $this->_stringContains->matches(self::EXCERPT . 'END'), - 'should be true if excerpt at beginning' - ); - $this->assertTrue( - $this->_stringContains->matches('START' . self::EXCERPT), - 'should be true if excerpt at end' - ); - $this->assertTrue( - $this->_stringContains->matches('START' . self::EXCERPT . 'END'), - 'should be true if excerpt in middle' - ); - $this->assertTrue( - $this->_stringContains->matches(self::EXCERPT . self::EXCERPT), - 'should be true if excerpt is repeated' - ); - - $this->assertFalse( - $this->_stringContains->matches('Something else'), - 'should not be true if excerpt is not in string' - ); - $this->assertFalse( - $this->_stringContains->matches(substr(self::EXCERPT, 1)), - 'should not be true if part of excerpt is in string' - ); - } - - public function testEvaluatesToTrueIfArgumentIsEqualToSubstring() - { - $this->assertTrue( - $this->_stringContains->matches(self::EXCERPT), - 'should be true if excerpt is entire string' - ); - } - - public function testEvaluatesToTrueIfArgumentContainsExactSubstring() - { - $this->assertTrue( - $this->_stringContains->matches(strtolower(self::EXCERPT)), - 'should be false if excerpt is entire string ignoring case' - ); - $this->assertTrue( - $this->_stringContains->matches('START' . strtolower(self::EXCERPT) . 'END'), - 'should be false if excerpt is contained in string ignoring case' - ); - } - - public function testHasAReadableDescription() - { - $this->assertDescription( - 'a string containing in any case "' - . strtolower(self::EXCERPT) . '"', - $this->_stringContains - ); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringContainsInOrderTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringContainsInOrderTest.php deleted file mode 100644 index 4c465b2..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringContainsInOrderTest.php +++ /dev/null @@ -1,42 +0,0 @@ -_m = \Hamcrest\Text\StringContainsInOrder::stringContainsInOrder(array('a', 'b', 'c')); - } - - protected function createMatcher() - { - return $this->_m; - } - - public function testMatchesOnlyIfStringContainsGivenSubstringsInTheSameOrder() - { - $this->assertMatches($this->_m, 'abc', 'substrings in order'); - $this->assertMatches($this->_m, '1a2b3c4', 'substrings separated'); - - $this->assertDoesNotMatch($this->_m, 'cab', 'substrings out of order'); - $this->assertDoesNotMatch($this->_m, 'xyz', 'no substrings in string'); - $this->assertDoesNotMatch($this->_m, 'ac', 'substring missing'); - $this->assertDoesNotMatch($this->_m, '', 'empty string'); - } - - public function testAcceptsVariableArguments() - { - $this->assertMatches(stringContainsInOrder('a', 'b', 'c'), 'abc', 'substrings as variable arguments'); - } - - public function testHasAReadableDescription() - { - $this->assertDescription( - 'a string containing "a", "b", "c" in order', - $this->_m - ); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringContainsTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringContainsTest.php deleted file mode 100644 index bf4afa3..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringContainsTest.php +++ /dev/null @@ -1,86 +0,0 @@ -_stringContains = \Hamcrest\Text\StringContains::containsString(self::EXCERPT); - } - - protected function createMatcher() - { - return $this->_stringContains; - } - - public function testEvaluatesToTrueIfArgumentContainsSubstring() - { - $this->assertTrue( - $this->_stringContains->matches(self::EXCERPT . 'END'), - 'should be true if excerpt at beginning' - ); - $this->assertTrue( - $this->_stringContains->matches('START' . self::EXCERPT), - 'should be true if excerpt at end' - ); - $this->assertTrue( - $this->_stringContains->matches('START' . self::EXCERPT . 'END'), - 'should be true if excerpt in middle' - ); - $this->assertTrue( - $this->_stringContains->matches(self::EXCERPT . self::EXCERPT), - 'should be true if excerpt is repeated' - ); - - $this->assertFalse( - $this->_stringContains->matches('Something else'), - 'should not be true if excerpt is not in string' - ); - $this->assertFalse( - $this->_stringContains->matches(substr(self::EXCERPT, 1)), - 'should not be true if part of excerpt is in string' - ); - } - - public function testEvaluatesToTrueIfArgumentIsEqualToSubstring() - { - $this->assertTrue( - $this->_stringContains->matches(self::EXCERPT), - 'should be true if excerpt is entire string' - ); - } - - public function testEvaluatesToFalseIfArgumentContainsSubstringIgnoringCase() - { - $this->assertFalse( - $this->_stringContains->matches(strtolower(self::EXCERPT)), - 'should be false if excerpt is entire string ignoring case' - ); - $this->assertFalse( - $this->_stringContains->matches('START' . strtolower(self::EXCERPT) . 'END'), - 'should be false if excerpt is contained in string ignoring case' - ); - } - - public function testIgnoringCaseReturnsCorrectMatcher() - { - $this->assertTrue( - $this->_stringContains->ignoringCase()->matches('EXceRpT'), - 'should be true if excerpt is entire string ignoring case' - ); - } - - public function testHasAReadableDescription() - { - $this->assertDescription( - 'a string containing "' - . self::EXCERPT . '"', - $this->_stringContains - ); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringEndsWithTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringEndsWithTest.php deleted file mode 100644 index 9a30f95..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringEndsWithTest.php +++ /dev/null @@ -1,62 +0,0 @@ -_stringEndsWith = \Hamcrest\Text\StringEndsWith::endsWith(self::EXCERPT); - } - - protected function createMatcher() - { - return $this->_stringEndsWith; - } - - public function testEvaluatesToTrueIfArgumentContainsSpecifiedSubstring() - { - $this->assertFalse( - $this->_stringEndsWith->matches(self::EXCERPT . 'END'), - 'should be false if excerpt at beginning' - ); - $this->assertTrue( - $this->_stringEndsWith->matches('START' . self::EXCERPT), - 'should be true if excerpt at end' - ); - $this->assertFalse( - $this->_stringEndsWith->matches('START' . self::EXCERPT . 'END'), - 'should be false if excerpt in middle' - ); - $this->assertTrue( - $this->_stringEndsWith->matches(self::EXCERPT . self::EXCERPT), - 'should be true if excerpt is at end and repeated' - ); - - $this->assertFalse( - $this->_stringEndsWith->matches('Something else'), - 'should be false if excerpt is not in string' - ); - $this->assertFalse( - $this->_stringEndsWith->matches(substr(self::EXCERPT, 0, strlen(self::EXCERPT) - 2)), - 'should be false if part of excerpt is at end of string' - ); - } - - public function testEvaluatesToTrueIfArgumentIsEqualToSubstring() - { - $this->assertTrue( - $this->_stringEndsWith->matches(self::EXCERPT), - 'should be true if excerpt is entire string' - ); - } - - public function testHasAReadableDescription() - { - $this->assertDescription('a string ending with "EXCERPT"', $this->_stringEndsWith); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringStartsWithTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringStartsWithTest.php deleted file mode 100644 index 3be201f..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringStartsWithTest.php +++ /dev/null @@ -1,62 +0,0 @@ -_stringStartsWith = \Hamcrest\Text\StringStartsWith::startsWith(self::EXCERPT); - } - - protected function createMatcher() - { - return $this->_stringStartsWith; - } - - public function testEvaluatesToTrueIfArgumentContainsSpecifiedSubstring() - { - $this->assertTrue( - $this->_stringStartsWith->matches(self::EXCERPT . 'END'), - 'should be true if excerpt at beginning' - ); - $this->assertFalse( - $this->_stringStartsWith->matches('START' . self::EXCERPT), - 'should be false if excerpt at end' - ); - $this->assertFalse( - $this->_stringStartsWith->matches('START' . self::EXCERPT . 'END'), - 'should be false if excerpt in middle' - ); - $this->assertTrue( - $this->_stringStartsWith->matches(self::EXCERPT . self::EXCERPT), - 'should be true if excerpt is at beginning and repeated' - ); - - $this->assertFalse( - $this->_stringStartsWith->matches('Something else'), - 'should be false if excerpt is not in string' - ); - $this->assertFalse( - $this->_stringStartsWith->matches(substr(self::EXCERPT, 1)), - 'should be false if part of excerpt is at start of string' - ); - } - - public function testEvaluatesToTrueIfArgumentIsEqualToSubstring() - { - $this->assertTrue( - $this->_stringStartsWith->matches(self::EXCERPT), - 'should be true if excerpt is entire string' - ); - } - - public function testHasAReadableDescription() - { - $this->assertDescription('a string starting with "EXCERPT"', $this->_stringStartsWith); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsArrayTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsArrayTest.php deleted file mode 100644 index d13c24d..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsArrayTest.php +++ /dev/null @@ -1,35 +0,0 @@ -assertDescription('an array', arrayValue()); - } - - public function testDecribesActualTypeInMismatchMessage() - { - $this->assertMismatchDescription('was null', arrayValue(), null); - $this->assertMismatchDescription('was a string "foo"', arrayValue(), 'foo'); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsBooleanTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsBooleanTest.php deleted file mode 100644 index 24309fc..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsBooleanTest.php +++ /dev/null @@ -1,35 +0,0 @@ -assertDescription('a boolean', booleanValue()); - } - - public function testDecribesActualTypeInMismatchMessage() - { - $this->assertMismatchDescription('was null', booleanValue(), null); - $this->assertMismatchDescription('was a string "foo"', booleanValue(), 'foo'); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsCallableTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsCallableTest.php deleted file mode 100644 index 5098e21..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsCallableTest.php +++ /dev/null @@ -1,103 +0,0 @@ -=')) { - $this->markTestSkipped('Closures require php 5.3'); - } - eval('assertThat(function () {}, callableValue());'); - } - - public function testEvaluatesToTrueIfArgumentImplementsInvoke() - { - if (!version_compare(PHP_VERSION, '5.3', '>=')) { - $this->markTestSkipped('Magic method __invoke() requires php 5.3'); - } - assertThat($this, callableValue()); - } - - public function testEvaluatesToFalseIfArgumentIsInvalidFunctionName() - { - if (function_exists('not_a_Hamcrest_function')) { - $this->markTestSkipped('Function "not_a_Hamcrest_function" must not exist'); - } - - assertThat('not_a_Hamcrest_function', not(callableValue())); - } - - public function testEvaluatesToFalseIfArgumentIsInvalidStaticMethodCallback() - { - assertThat( - array('Hamcrest\Type\IsCallableTest', 'noMethod'), - not(callableValue()) - ); - } - - public function testEvaluatesToFalseIfArgumentIsInvalidInstanceMethodCallback() - { - assertThat(array($this, 'noMethod'), not(callableValue())); - } - - public function testEvaluatesToFalseIfArgumentDoesntImplementInvoke() - { - assertThat(new \stdClass(), not(callableValue())); - } - - public function testEvaluatesToFalseIfArgumentDoesntMatchType() - { - assertThat(false, not(callableValue())); - assertThat(5.2, not(callableValue())); - } - - public function testHasAReadableDescription() - { - $this->assertDescription('a callable', callableValue()); - } - - public function testDecribesActualTypeInMismatchMessage() - { - $this->assertMismatchDescription( - 'was a string "invalid-function"', - callableValue(), - 'invalid-function' - ); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsDoubleTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsDoubleTest.php deleted file mode 100644 index 85c2a96..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsDoubleTest.php +++ /dev/null @@ -1,35 +0,0 @@ -assertDescription('a double', doubleValue()); - } - - public function testDecribesActualTypeInMismatchMessage() - { - $this->assertMismatchDescription('was null', doubleValue(), null); - $this->assertMismatchDescription('was a string "foo"', doubleValue(), 'foo'); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsIntegerTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsIntegerTest.php deleted file mode 100644 index ce5a51a..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsIntegerTest.php +++ /dev/null @@ -1,36 +0,0 @@ -assertDescription('an integer', integerValue()); - } - - public function testDecribesActualTypeInMismatchMessage() - { - $this->assertMismatchDescription('was null', integerValue(), null); - $this->assertMismatchDescription('was a string "foo"', integerValue(), 'foo'); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsNumericTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsNumericTest.php deleted file mode 100644 index 1fd83ef..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsNumericTest.php +++ /dev/null @@ -1,53 +0,0 @@ -assertDescription('a number', numericValue()); - } - - public function testDecribesActualTypeInMismatchMessage() - { - $this->assertMismatchDescription('was null', numericValue(), null); - $this->assertMismatchDescription('was a string "foo"', numericValue(), 'foo'); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsObjectTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsObjectTest.php deleted file mode 100644 index a3b617c..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsObjectTest.php +++ /dev/null @@ -1,34 +0,0 @@ -assertDescription('an object', objectValue()); - } - - public function testDecribesActualTypeInMismatchMessage() - { - $this->assertMismatchDescription('was null', objectValue(), null); - $this->assertMismatchDescription('was a string "foo"', objectValue(), 'foo'); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsResourceTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsResourceTest.php deleted file mode 100644 index d6ea534..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsResourceTest.php +++ /dev/null @@ -1,34 +0,0 @@ -assertDescription('a resource', resourceValue()); - } - - public function testDecribesActualTypeInMismatchMessage() - { - $this->assertMismatchDescription('was null', resourceValue(), null); - $this->assertMismatchDescription('was a string "foo"', resourceValue(), 'foo'); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsScalarTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsScalarTest.php deleted file mode 100644 index 72a188d..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsScalarTest.php +++ /dev/null @@ -1,39 +0,0 @@ -assertDescription('a scalar', scalarValue()); - } - - public function testDecribesActualTypeInMismatchMessage() - { - $this->assertMismatchDescription('was null', scalarValue(), null); - $this->assertMismatchDescription('was an array ["foo"]', scalarValue(), array('foo')); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsStringTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsStringTest.php deleted file mode 100644 index 557d591..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsStringTest.php +++ /dev/null @@ -1,35 +0,0 @@ -assertDescription('a string', stringValue()); - } - - public function testDecribesActualTypeInMismatchMessage() - { - $this->assertMismatchDescription('was null', stringValue(), null); - $this->assertMismatchDescription('was a double <5.2F>', stringValue(), 5.2); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/UtilTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/UtilTest.php deleted file mode 100644 index 7248978..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/UtilTest.php +++ /dev/null @@ -1,82 +0,0 @@ -assertSame($matcher, $newMatcher); - } - - public function testWrapValueWithIsEqualWrapsPrimitive() - { - $matcher = \Hamcrest\Util::wrapValueWithIsEqual('foo'); - $this->assertInstanceOf('Hamcrest\Core\IsEqual', $matcher); - $this->assertTrue($matcher->matches('foo')); - } - - public function testCheckAllAreMatchersAcceptsMatchers() - { - \Hamcrest\Util::checkAllAreMatchers(array( - new \Hamcrest\Text\MatchesPattern('/fo+/'), - new \Hamcrest\Core\IsEqual('foo'), - )); - } - - /** - * @expectedException InvalidArgumentException - */ - public function testCheckAllAreMatchersFailsForPrimitive() - { - \Hamcrest\Util::checkAllAreMatchers(array( - new \Hamcrest\Text\MatchesPattern('/fo+/'), - 'foo', - )); - } - - private function callAndAssertCreateMatcherArray($items) - { - $matchers = \Hamcrest\Util::createMatcherArray($items); - $this->assertInternalType('array', $matchers); - $this->assertSameSize($items, $matchers); - foreach ($matchers as $matcher) { - $this->assertInstanceOf('\Hamcrest\Matcher', $matcher); - } - - return $matchers; - } - - public function testCreateMatcherArrayLeavesMatchersUntouched() - { - $matcher = new \Hamcrest\Text\MatchesPattern('/fo+/'); - $items = array($matcher); - $matchers = $this->callAndAssertCreateMatcherArray($items); - $this->assertSame($matcher, $matchers[0]); - } - - public function testCreateMatcherArrayWrapsPrimitiveWithIsEqualMatcher() - { - $matchers = $this->callAndAssertCreateMatcherArray(array('foo')); - $this->assertInstanceOf('Hamcrest\Core\IsEqual', $matchers[0]); - $this->assertTrue($matchers[0]->matches('foo')); - } - - public function testCreateMatcherArrayDoesntModifyOriginalArray() - { - $items = array('foo'); - $this->callAndAssertCreateMatcherArray($items); - $this->assertSame('foo', $items[0]); - } - - public function testCreateMatcherArrayUnwrapsSingleArrayElement() - { - $matchers = $this->callAndAssertCreateMatcherArray(array(array('foo'))); - $this->assertInstanceOf('Hamcrest\Core\IsEqual', $matchers[0]); - $this->assertTrue($matchers[0]->matches('foo')); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Xml/HasXPathTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Xml/HasXPathTest.php deleted file mode 100644 index 6774887..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Xml/HasXPathTest.php +++ /dev/null @@ -1,198 +0,0 @@ - - - - alice - Alice Frankel - admin - - - bob - Bob Frankel - user - - - charlie - Charlie Chan - user - - -XML; - self::$doc = new \DOMDocument(); - self::$doc->loadXML(self::$xml); - - self::$html = << - - Home Page - - -

Heading

-

Some text

- - -HTML; - } - - protected function createMatcher() - { - return \Hamcrest\Xml\HasXPath::hasXPath('/users/user'); - } - - public function testMatchesWhenXPathIsFound() - { - assertThat('one match', self::$doc, hasXPath('user[id = "bob"]')); - assertThat('two matches', self::$doc, hasXPath('user[role = "user"]')); - } - - public function testDoesNotMatchWhenXPathIsNotFound() - { - assertThat( - 'no match', - self::$doc, - not(hasXPath('user[contains(id, "frank")]')) - ); - } - - public function testMatchesWhenExpressionWithoutMatcherEvaluatesToTrue() - { - assertThat( - 'one match', - self::$doc, - hasXPath('count(user[id = "bob"])') - ); - } - - public function testDoesNotMatchWhenExpressionWithoutMatcherEvaluatesToFalse() - { - assertThat( - 'no matches', - self::$doc, - not(hasXPath('count(user[id = "frank"])')) - ); - } - - public function testMatchesWhenExpressionIsEqual() - { - assertThat( - 'one match', - self::$doc, - hasXPath('count(user[id = "bob"])', 1) - ); - assertThat( - 'two matches', - self::$doc, - hasXPath('count(user[role = "user"])', 2) - ); - } - - public function testDoesNotMatchWhenExpressionIsNotEqual() - { - assertThat( - 'no match', - self::$doc, - not(hasXPath('count(user[id = "frank"])', 2)) - ); - assertThat( - 'one match', - self::$doc, - not(hasXPath('count(user[role = "admin"])', 2)) - ); - } - - public function testMatchesWhenContentMatches() - { - assertThat( - 'one match', - self::$doc, - hasXPath('user/name', containsString('ice')) - ); - assertThat( - 'two matches', - self::$doc, - hasXPath('user/role', equalTo('user')) - ); - } - - public function testDoesNotMatchWhenContentDoesNotMatch() - { - assertThat( - 'no match', - self::$doc, - not(hasXPath('user/name', containsString('Bobby'))) - ); - assertThat( - 'no matches', - self::$doc, - not(hasXPath('user/role', equalTo('owner'))) - ); - } - - public function testProvidesConvenientShortcutForHasXPathEqualTo() - { - assertThat('matches', self::$doc, hasXPath('count(user)', 3)); - assertThat('matches', self::$doc, hasXPath('user[2]/id', 'bob')); - } - - public function testProvidesConvenientShortcutForHasXPathCountEqualTo() - { - assertThat('matches', self::$doc, hasXPath('user[id = "charlie"]', 1)); - } - - public function testMatchesAcceptsXmlString() - { - assertThat('accepts XML string', self::$xml, hasXPath('user')); - } - - public function testMatchesAcceptsHtmlString() - { - assertThat('accepts HTML string', self::$html, hasXPath('body/h1', 'Heading')); - } - - public function testHasAReadableDescription() - { - $this->assertDescription( - 'XML or HTML document with XPath "/users/user"', - hasXPath('/users/user') - ); - $this->assertDescription( - 'XML or HTML document with XPath "count(/users/user)" <2>', - hasXPath('/users/user', 2) - ); - $this->assertDescription( - 'XML or HTML document with XPath "/users/user/name"' - . ' a string starting with "Alice"', - hasXPath('/users/user/name', startsWith('Alice')) - ); - } - - public function testHasAReadableMismatchDescription() - { - $this->assertMismatchDescription( - 'XPath returned no results', - hasXPath('/users/name'), - self::$doc - ); - $this->assertMismatchDescription( - 'XPath expression result was <3F>', - hasXPath('/users/user', 2), - self::$doc - ); - $this->assertMismatchDescription( - 'XPath returned ["alice", "bob", "charlie"]', - hasXPath('/users/user/id', 'Frank'), - self::$doc - ); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/bootstrap.php b/vendor/hamcrest/hamcrest-php/tests/bootstrap.php deleted file mode 100644 index bc4958d..0000000 --- a/vendor/hamcrest/hamcrest-php/tests/bootstrap.php +++ /dev/null @@ -1,11 +0,0 @@ - - - - . - - - - - - ../hamcrest - - -
diff --git a/vendor/jean85/pretty-package-versions/.github/workflows/tests.yaml b/vendor/jean85/pretty-package-versions/.github/workflows/tests.yaml deleted file mode 100644 index f25a092..0000000 --- a/vendor/jean85/pretty-package-versions/.github/workflows/tests.yaml +++ /dev/null @@ -1,48 +0,0 @@ -name: Tests - -on: - pull_request: null - push: - branches: - - 1.x - -jobs: - tests: - runs-on: ubuntu-latest - strategy: - matrix: - php: - - '7.0' - - '7.1' - - '7.2' - - '7.3' - - '7.4' - - '8.0' - - name: PHP ${{ matrix.php }} tests - steps: - # checkout git - - uses: actions/checkout@v2 - # cache - - uses: actions/cache@v2 - with: - path: ~/.composer/cache/files - key: ${{ matrix.php }} - # setup PHP - - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - coverage: xdebug - - run: composer install --no-progress --ansi - if: matrix.php != '8.0' - - run: composer install --no-progress --ansi --ignore-platform-reqs - if: matrix.php == '8.0' - - run: vendor/bin/phpunit --coverage-clover=coverage.xml - if: matrix.php != '8.0' - - run: vendor/bin/phpunit - if: matrix.php == '8.0' - - uses: codecov/codecov-action@v1 - if: matrix.php != '8.0' - with: - file: './coverage.xml' - fail_ci_if_error: true diff --git a/vendor/jean85/pretty-package-versions/LICENSE b/vendor/jean85/pretty-package-versions/LICENSE deleted file mode 100644 index 07c8ecb..0000000 --- a/vendor/jean85/pretty-package-versions/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2017 Alessandro Lai - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/jean85/pretty-package-versions/codecov.yml b/vendor/jean85/pretty-package-versions/codecov.yml deleted file mode 100644 index 69cb760..0000000 --- a/vendor/jean85/pretty-package-versions/codecov.yml +++ /dev/null @@ -1 +0,0 @@ -comment: false diff --git a/vendor/jean85/pretty-package-versions/composer.json b/vendor/jean85/pretty-package-versions/composer.json deleted file mode 100644 index 0843100..0000000 --- a/vendor/jean85/pretty-package-versions/composer.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "jean85/pretty-package-versions", - "description": "A wrapper for ocramius/package-versions to get pretty versions strings", - "type": "library", - "require": { - "php": "^7.0|^8.0", - "composer/package-versions-deprecated": "^1.8.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0|^8.5|^9.2" - }, - "license": "MIT", - "authors": [ - { - "name": "Alessandro Lai", - "email": "alessandro.lai85@gmail.com" - } - ], - "support": { - "issues": "https://github.com/Jean85/pretty-package-versions/issues" - }, - "keywords": [ - "package", - "versions", - "composer", - "release" - ], - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Jean85\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "Tests\\": "tests" - } - } -} diff --git a/vendor/jean85/pretty-package-versions/src/PrettyVersions.php b/vendor/jean85/pretty-package-versions/src/PrettyVersions.php deleted file mode 100644 index 6bd4ff8..0000000 --- a/vendor/jean85/pretty-package-versions/src/PrettyVersions.php +++ /dev/null @@ -1,25 +0,0 @@ -packageName = $packageName; - $splittedVersion = explode('@', $version); - $this->shortVersion = $splittedVersion[0]; - $this->commitHash = $splittedVersion[1]; - $this->versionIsTagged = preg_match('/[^v\d\.]/', $this->getShortVersion()) === 0; - } - - public function getPrettyVersion(): string - { - if ($this->versionIsTagged) { - return $this->getShortVersion(); - } - - return $this->getVersionWithShortCommit(); - } - - public function getFullVersion(): string - { - return $this->getShortVersion() . '@' . $this->getCommitHash(); - } - - public function getVersionWithShortReference(): string - { - return $this->getShortVersion() . '@' . $this->getShortCommitHash(); - } - - /** - * @deprecated since 1.6, use getVersionWithShortReference instead - */ - public function getVersionWithShortCommit(): string - { - return $this->getVersionWithShortReference(); - } - - public function getPackageName(): string - { - return $this->packageName; - } - - public function getShortVersion(): string - { - return $this->shortVersion; - } - - public function getReference(): string - { - return $this->commitHash; - } - - /** - * @deprecated since 1.6, use getReference instead - */ - public function getCommitHash(): string - { - return $this->getReference(); - } - - public function getShortReference(): string - { - return substr($this->commitHash, 0, self::SHORT_COMMIT_LENGTH); - } - - /** - * @deprecated since 1.6, use getShortReference instead - */ - public function getShortCommitHash(): string - { - return $this->getShortReference(); - } - - public function __toString(): string - { - return $this->getPrettyVersion(); - } -} diff --git a/vendor/mockery/mockery/.phpstorm.meta.php b/vendor/mockery/mockery/.phpstorm.meta.php deleted file mode 100644 index 6c53f80..0000000 --- a/vendor/mockery/mockery/.phpstorm.meta.php +++ /dev/null @@ -1,11 +0,0 @@ -setDefaultMatcher($class, $matcherClass)` #1120 - -## 1.4.3 (2021-02-24) -* Fixes calls to fetchMock before initialisation #1113 -* Allow shouldIgnoreMissing() to behave in a recursive fashion #1097 -* Custom object formatters #766 (Needs Docs) -* Fix crash on a union type including null #1106 - -## 1.3.4 (2021-02-24) -* Fixes calls to fetchMock before initialisation #1113 -* Fix crash on a union type including null #1106 - -## 1.4.2 (2020-08-11) -* Fix array to string conversion in ConstantsPass (#1086) -* Fixed nullable PHP 8.0 union types (#1088, #1089) -* Fixed support for PHP 8.0 parent type (#1088, #1089) -* Fixed PHP 8.0 mixed type support (#1088, #1089) -* Fixed PHP 8.0 union return types (#1088, #1089) - -## 1.4.1 (2020-07-09) - -* Allow quick definitions to use 'at least once' expectation - `\Mockery::getConfiguration()->getQuickDefinitions()->shouldBeCalledAtLeastOnce(true)` (#1056) -* Added provisional support for PHP 8.0 (#1068, #1072,#1079) -* Fix mocking methods with iterable return type without specifying a return value (#1075) - -## 1.3.3 (2020-08-11) -* Fix array to string conversion in ConstantsPass (#1086) -* Fixed nullable PHP 8.0 union types (#1088) -* Fixed support for PHP 8.0 parent type (#1088) -* Fixed PHP 8.0 mixed type support (#1088) -* Fixed PHP 8.0 union return types (#1088) - -## 1.3.2 (2020-07-09) -* Fix mocking with anonymous classes (#1039) -* Fix andAnyOthers() to properly match earlier expectations (#1051) -* Added provisional support for PHP 8.0 (#1068, #1072,#1079) -* Fix mocking methods with iterable return type without specifying a return value (#1075) - -## 1.4.0 (2020-05-19) - -* Fix mocking with anonymous classes (#1039) -* Fix andAnyOthers() to properly match earlier expectations (#1051) -* Drops support for PHP < 7.3 and PHPUnit < 8 (#1059) - -## 1.3.1 (2019-12-26) -* Revert improved exception debugging due to BC breaks (#1032) - -## 1.3.0 (2019-11-24) - -* Added capture `Mockery::capture` convenience matcher (#1020) -* Added `andReturnArg` to echo back an argument passed to a an expectation (#992) -* Improved exception debugging (#1000) -* Fixed `andSet` to not reuse properties between mock objects (#1012) - -## 1.2.4 (2019-09-30) - -* Fix a bug introduced with previous release, for empty method definition lists (#1009) - -## 1.2.3 (2019-08-07) - -* Allow mocking classes that have allows and expects methods (#868) -* Allow passing thru __call method in all mock types (experimental) (#969) -* Add support for `!` to blacklist methods (#959) -* Added `withSomeOfArgs` to partial match a list of args (#967) -* Fix chained demeter calls with type hint (#956) - -## 1.2.2 (2019-02-13) - -* Fix a BC breaking change for PHP 5.6/PHPUnit 5.7.27 (#947) - -## 1.2.1 (2019-02-07) - -* Support for PHPUnit 8 (#942) -* Allow mocking static methods called on instance (#938) - -## 1.2.0 (2018-10-02) - -* Starts counting default expectations towards count (#910) -* Adds workaround for some HHVM return types (#909) -* Adds PhpStorm metadata support for autocomplete etc (#904) -* Further attempts to support multiple PHPUnit versions (#903) -* Allows setting constructor expectations on instance mocks (#900) -* Adds workaround for HHVM memoization decorator (#893) -* Adds experimental support for callable spys (#712) - -## 1.1.0 (2018-05-08) - -* Allows use of string method names in allows and expects (#794) -* Finalises allows and expects syntax in API (#799) -* Search for handlers in a case instensitive way (#801) -* Deprecate allowMockingMethodsUnnecessarily (#808) -* Fix risky tests (#769) -* Fix namespace in TestListener (#812) -* Fixed conflicting mock names (#813) -* Clean elses (#819) -* Updated protected method mocking exception message (#826) -* Map of constants to mock (#829) -* Simplify foreach with `in_array` function (#830) -* Typehinted return value on Expectation#verify. (#832) -* Fix shouldNotHaveReceived with HigherOrderMessage (#842) -* Deprecates shouldDeferMissing (#839) -* Adds support for return type hints in Demeter chains (#848) -* Adds shouldNotReceive to composite expectation (#847) -* Fix internal error when using --static-backup (#845) -* Adds `andAnyOtherArgs` as an optional argument matcher (#860) -* Fixes namespace qualifying with namespaced named mocks (#872) -* Added possibility to add Constructor-Expections on hard dependencies, read: Mockery::mock('overload:...') (#781) - -## 1.0.0 (2017-09-06) - -* Destructors (`__destruct`) are stubbed out where it makes sense -* Allow passing a closure argument to `withArgs()` to validate multiple arguments at once. -* `Mockery\Adapter\Phpunit\TestListener` has been rewritten because it - incorrectly marked some tests as risky. It will no longer verify mock - expectations but instead check that tests do that themselves. PHPUnit 6 is - required if you want to use this fail safe. -* Removes SPL Class Loader -* Removed object recorder feature -* Bumped minimum PHP version to 5.6 -* `andThrow` will now throw anything `\Throwable` -* Adds `allows` and `expects` syntax -* Adds optional global helpers for `mock`, `namedMock` and `spy` -* Adds ability to create objects using traits -* `Mockery\Matcher\MustBe` was deprecated -* Marked `Mockery\MockInterface` as internal -* Subset matcher matches recursively -* BC BREAK - Spies return `null` by default from ignored (non-mocked) methods with nullable return type -* Removed extracting getter methods of object instances -* BC BREAK - Remove implicit regex matching when trying to match string arguments, introduce `\Mockery::pattern()` when regex matching is needed -* Fix Mockery not getting closed in cases of failing test cases -* Fix Mockery not setting properties on overloaded instance mocks -* BC BREAK - Fix Mockery not trying default expectations if there is any concrete expectation -* BC BREAK - Mockery's PHPUnit integration will mark a test as risky if it - thinks one it's exceptions has been swallowed in PHPUnit > 5.7.6. Use `$e->dismiss()` to dismiss. - -## 0.9.4 (XXXX-XX-XX) - -* `shouldIgnoreMissing` will respect global `allowMockingNonExistentMethods` - config -* Some support for variadic parameters -* Hamcrest is now a required dependency -* Instance mocks now respect `shouldIgnoreMissing` call on control instance -* This will be the *last version to support PHP 5.3* -* Added `Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration` trait -* Added `makePartial` to `Mockery\MockInterface` as it was missing - -## 0.9.3 (2014-12-22) - -* Added a basic spy implementation -* Added `Mockery\Adapter\Phpunit\MockeryTestCase` for more reliable PHPUnit - integration - -## 0.9.2 (2014-09-03) - -* Some workarounds for the serialisation problems created by changes to PHP in 5.5.13, 5.4.29, - 5.6. -* Demeter chains attempt to reuse doubles as they see fit, so for foo->bar and - foo->baz, we'll attempt to use the same foo - -## 0.9.1 (2014-05-02) - -* Allow specifying consecutive exceptions to be thrown with `andThrowExceptions` -* Allow specifying methods which can be mocked when using - `Mockery\Configuration::allowMockingNonExistentMethods(false)` with - `Mockery\MockInterface::shouldAllowMockingMethod($methodName)` -* Added andReturnSelf method: `$mock->shouldReceive("foo")->andReturnSelf()` -* `shouldIgnoreMissing` now takes an optional value that will be return instead - of null, e.g. `$mock->shouldIgnoreMissing($mock)` - -## 0.9.0 (2014-02-05) - -* Allow mocking classes with final __wakeup() method -* Quick definitions are now always `byDefault` -* Allow mocking of protected methods with `shouldAllowMockingProtectedMethods` -* Support official Hamcrest package -* Generator completely rewritten -* Easily create named mocks with namedMock diff --git a/vendor/mockery/mockery/CONTRIBUTING.md b/vendor/mockery/mockery/CONTRIBUTING.md deleted file mode 100644 index b714f3f..0000000 --- a/vendor/mockery/mockery/CONTRIBUTING.md +++ /dev/null @@ -1,88 +0,0 @@ -# Contributing - - -We'd love you to help out with mockery and no contribution is too small. - - -## Reporting Bugs - -Issues can be reported on the [issue -tracker](https://github.com/padraic/mockery/issues). Please try and report any -bugs with a minimal reproducible example, it will make things easier for other -contributors and your problems will hopefully be resolved quickly. - - -## Requesting Features - -We're always interested to hear about your ideas and you can request features by -creating a ticket in the [issue -tracker](https://github.com/padraic/mockery/issues). We can't always guarantee -someone will jump on it straight away, but putting it out there to see if anyone -else is interested is a good idea. - -Likewise, if a feature you would like is already listed in -the issue tracker, add a :+1: so that other contributors know it's a feature -that would help others. - - -## Contributing code and documentation - -We loosely follow the -[PSR-1](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md) -and -[PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) coding standards, -but we'll probably merge any code that looks close enough. - -* Fork the [repository](https://github.com/padraic/mockery) on GitHub -* Add the code for your feature or bug -* Add some tests for your feature or bug -* Optionally, but preferably, write some documentation -* Optionally, update the CHANGELOG.md file with your feature or - [BC](http://en.wikipedia.org/wiki/Backward_compatibility) break -* Send a [Pull - Request](https://help.github.com/articles/creating-a-pull-request) to the - correct target branch (see below) - -If you have a big change or would like to discuss something, create an issue in -the [issue tracker](https://github.com/padraic/mockery/issues) or jump in to -\#mockery on freenode - - -Any code you contribute must be licensed under the [BSD 3-Clause -License](http://opensource.org/licenses/BSD-3-Clause). - - -## Target Branch - -Mockery may have several active branches at any one time and roughly follows a -[Git Branching Model](https://igor.io/2013/10/21/git-branching-model.html). -Generally, if you're developing a new feature, you want to be targeting the -master branch, if it's a bug fix, you want to be targeting a release branch, -e.g. 0.8. - - -## Testing Mockery - -To run the unit tests for Mockery, clone the git repository, download Composer using -the instructions at [http://getcomposer.org/download/](http://getcomposer.org/download/), -then install the dependencies with `php /path/to/composer.phar install`. - -This will install the required PHPUnit and Hamcrest dev dependencies and create the -autoload files required by the unit tests. You may run the `vendor/bin/phpunit` command -to run the unit tests. If everything goes to plan, there will be no failed tests! - - -## Debugging Mockery - -Mockery and its code generation can be difficult to debug. A good start is to -use the `RequireLoader`, which will dump the code generated by mockery to a file -before requiring it, rather than using eval. This will help with stack traces, -and you will be able to open the mock class in your editor. - -``` php - -// tests/bootstrap.php - -Mockery::setLoader(new Mockery\Loader\RequireLoader(sys_get_temp_dir())); - -``` diff --git a/vendor/mockery/mockery/LICENSE b/vendor/mockery/mockery/LICENSE deleted file mode 100644 index 2e127a6..0000000 --- a/vendor/mockery/mockery/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2010, Pádraic Brady -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - * The name of Pádraic Brady may not be used to endorse or promote - products derived from this software without specific prior written - permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/mockery/mockery/README.md b/vendor/mockery/mockery/README.md deleted file mode 100644 index 55771df..0000000 --- a/vendor/mockery/mockery/README.md +++ /dev/null @@ -1,291 +0,0 @@ -Mockery -======= - -[![Build Status](https://github.com/mockery/mockery/actions/workflows/tests.yml/badge.svg)](https://github.com/mockery/mockery/actions) -[![Latest Stable Version](https://poser.pugx.org/mockery/mockery/v/stable.svg)](https://packagist.org/packages/mockery/mockery) -[![Total Downloads](https://poser.pugx.org/mockery/mockery/downloads.svg)](https://packagist.org/packages/mockery/mockery) - -Mockery is a simple yet flexible PHP mock object framework for use in unit testing -with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a -test double framework with a succinct API capable of clearly defining all possible -object operations and interactions using a human readable Domain Specific Language -(DSL). Designed as a drop in alternative to PHPUnit's phpunit-mock-objects library, -Mockery is easy to integrate with PHPUnit and can operate alongside -phpunit-mock-objects without the World ending. - -Mockery is released under a New BSD License. - -## Installation - -To install Mockery, run the command below and you will get the latest -version - -```sh -composer require --dev mockery/mockery -``` - -## Documentation - -In older versions, this README file was the documentation for Mockery. Over time -we have improved this, and have created an extensive documentation for you. Please -use this README file as a starting point for Mockery, but do read the documentation -to learn how to use Mockery. - -The current version can be seen at [docs.mockery.io](http://docs.mockery.io). - -## PHPUnit Integration - -Mockery ships with some helpers if you are using PHPUnit. You can extend the -[`Mockery\Adapter\Phpunit\MockeryTestCase`](library/Mockery/Adapter/Phpunit/MockeryTestCase.php) -class instead of `PHPUnit\Framework\TestCase`, or if you are already using a -custom base class for your tests, take a look at the traits available in the -[`Mockery\Adapter\Phpunit`](library/Mockery/Adapter/Phpunit) namespace. - -## Test Doubles - -Test doubles (often called mocks) simulate the behaviour of real objects. They are -commonly utilised to offer test isolation, to stand in for objects which do not -yet exist, or to allow for the exploratory design of class APIs without -requiring actual implementation up front. - -The benefits of a test double framework are to allow for the flexible generation -and configuration of test doubles. They allow the setting of expected method calls -and/or return values using a flexible API which is capable of capturing every -possible real object behaviour in way that is stated as close as possible to a -natural language description. Use the `Mockery::mock` method to create a test -double. - -``` php -$double = Mockery::mock(); -``` - -If you need Mockery to create a test double to satisfy a particular type hint, -you can pass the type to the `mock` method. - -``` php -class Book {} - -interface BookRepository { - function find($id): Book; - function findAll(): array; - function add(Book $book): void; -} - -$double = Mockery::mock(BookRepository::class); -``` - -A detailed explanation of creating and working with test doubles is given in the -documentation, [Creating test doubles](http://docs.mockery.io/en/latest/reference/creating_test_doubles.html) -section. - -## Method Stubs 🎫 - -A method stub is a mechanism for having your test double return canned responses -to certain method calls. With stubs, you don't care how many times, if at all, -the method is called. Stubs are used to provide indirect input to the system -under test. - -``` php -$double->allows()->find(123)->andReturns(new Book()); - -$book = $double->find(123); -``` - -If you have used Mockery before, you might see something new in the example -above — we created a method stub using `allows`, instead of the "old" -`shouldReceive` syntax. This is a new feature of Mockery v1, but fear not, -the trusty ol' `shouldReceive` is still here. - -For new users of Mockery, the above example can also be written as: - -``` php -$double->shouldReceive('find')->with(123)->andReturn(new Book()); -$book = $double->find(123); -``` - -If your stub doesn't require specific arguments, you can also use this shortcut -for setting up multiple calls at once: - -``` php -$double->allows([ - "findAll" => [new Book(), new Book()], -]); -``` - -or - -``` php -$double->shouldReceive('findAll') - ->andReturn([new Book(), new Book()]); -``` - -You can also use this shortcut, which creates a double and sets up some stubs in -one call: - -``` php -$double = Mockery::mock(BookRepository::class, [ - "findAll" => [new Book(), new Book()], -]); -``` - -## Method Call Expectations 📲 - -A Method call expectation is a mechanism to allow you to verify that a -particular method has been called. You can specify the parameters and you can -also specify how many times you expect it to be called. Method call expectations -are used to verify indirect output of the system under test. - -``` php -$book = new Book(); - -$double = Mockery::mock(BookRepository::class); -$double->expects()->add($book); -``` - -During the test, Mockery accept calls to the `add` method as prescribed. -After you have finished exercising the system under test, you need to -tell Mockery to check that the method was called as expected, using the -`Mockery::close` method. One way to do that is to add it to your `tearDown` -method in PHPUnit. - -``` php - -public function tearDown() -{ - Mockery::close(); -} -``` - -The `expects()` method automatically sets up an expectation that the method call -(and matching parameters) is called **once and once only**. You can choose to change -this if you are expecting more calls. - -``` php -$double->expects()->add($book)->twice(); -``` - -If you have used Mockery before, you might see something new in the example -above — we created a method expectation using `expects`, instead of the "old" -`shouldReceive` syntax. This is a new feature of Mockery v1, but same as with -`accepts` in the previous section, it can be written in the "old" style. - -For new users of Mockery, the above example can also be written as: - -``` php -$double->shouldReceive('find') - ->with(123) - ->once() - ->andReturn(new Book()); -$book = $double->find(123); -``` - -A detailed explanation of declaring expectations on method calls, please -read the documentation, the [Expectation declarations](http://docs.mockery.io/en/latest/reference/expectations.html) -section. After that, you can also learn about the new `allows` and `expects` methods -in the [Alternative shouldReceive syntax](http://docs.mockery.io/en/latest/reference/alternative_should_receive_syntax.html) -section. - -It is worth mentioning that one way of setting up expectations is no better or worse -than the other. Under the hood, `allows` and `expects` are doing the same thing as -`shouldReceive`, at times in "less words", and as such it comes to a personal preference -of the programmer which way to use. - -## Test Spies 🕵️ - -By default, all test doubles created with the `Mockery::mock` method will only -accept calls that they have been configured to `allow` or `expect` (or in other words, -calls that they `shouldReceive`). Sometimes we don't necessarily care about all of the -calls that are going to be made to an object. To facilitate this, we can tell Mockery -to ignore any calls it has not been told to expect or allow. To do so, we can tell a -test double `shouldIgnoreMissing`, or we can create the double using the `Mocker::spy` -shortcut. - -``` php -// $double = Mockery::mock()->shouldIgnoreMissing(); -$double = Mockery::spy(); - -$double->foo(); // null -$double->bar(); // null -``` - -Further to this, sometimes we want to have the object accept any call during the test execution -and then verify the calls afterwards. For these purposes, we need our test -double to act as a Spy. All mockery test doubles record the calls that are made -to them for verification afterwards by default: - -``` php -$double->baz(123); - -$double->shouldHaveReceived()->baz(123); // null -$double->shouldHaveReceived()->baz(12345); // Uncaught Exception Mockery\Exception\InvalidCountException... -``` - -Please refer to the [Spies](http://docs.mockery.io/en/latest/reference/spies.html) section -of the documentation to learn more about the spies. - -## Utilities 🔌 - -### Global Helpers - -Mockery ships with a handful of global helper methods, you just need to ask -Mockery to declare them. - -``` php -Mockery::globalHelpers(); - -$mock = mock(Some::class); -$spy = spy(Some::class); - -$spy->shouldHaveReceived() - ->foo(anyArgs()); -``` - -All of the global helpers are wrapped in a `!function_exists` call to avoid -conflicts. So if you already have a global function called `spy`, Mockery will -silently skip the declaring its own `spy` function. - -### Testing Traits - -As Mockery ships with code generation capabilities, it was trivial to add -functionality allowing users to create objects on the fly that use particular -traits. Any abstract methods defined by the trait will be created and can have -expectations or stubs configured like normal Test Doubles. - -``` php -trait Foo { - function foo() { - return $this->doFoo(); - } - - abstract function doFoo(); -} - -$double = Mockery::mock(Foo::class); -$double->allows()->doFoo()->andReturns(123); -$double->foo(); // int(123) -``` - -## Versioning - -The Mockery team attempts to adhere to [Semantic Versioning](http://semver.org), -however, some of Mockery's internals are considered private and will be open to -change at any time. Just because a class isn't final, or a method isn't marked -private, does not mean it constitutes part of the API we guarantee under the -versioning scheme. - -### Alternative Runtimes - -Mockery 1.3 was the last version to support HHVM 3 and PHP 5. There is no support for HHVM 4+. - -## A new home for Mockery - -⚠️️ Update your remotes! Mockery has transferred to a new location. While it was once -at `padraic/mockery`, it is now at `mockery/mockery`. While your -existing repositories will redirect transparently for any operations, take some -time to transition to the new URL. -```sh -$ git remote set-url upstream https://github.com/mockery/mockery.git -``` -Replace `upstream` with the name of the remote you use locally; `upstream` is commonly -used but you may be using something else. Run `git remote -v` to see what you're actually -using. diff --git a/vendor/mockery/mockery/composer.json b/vendor/mockery/mockery/composer.json deleted file mode 100644 index 43caba8..0000000 --- a/vendor/mockery/mockery/composer.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "name": "mockery/mockery", - "description": "Mockery is a simple yet flexible PHP mock object framework", - "scripts": { - "docs": "phpdoc -d library -t docs/api" - }, - "keywords": [ - "bdd", - "library", - "mock", - "mock objects", - "mockery", - "stub", - "tdd", - "test", - "test double", - "testing" - ], - "homepage": "https://github.com/mockery/mockery", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Pádraic Brady", - "email": "padraic.brady@gmail.com", - "homepage": "http://blog.astrumfutura.com" - }, - { - "name": "Dave Marshall", - "email": "dave.marshall@atstsolutions.co.uk", - "homepage": "http://davedevelopment.co.uk" - } - ], - "require": { - "php": "^7.3 || ^8.0", - "lib-pcre": ">=7.0", - "hamcrest/hamcrest-php": "^2.0.1" - }, - "require-dev": { - "phpunit/phpunit": "^8.5 || ^9.3" - }, - "conflict": { - "phpunit/phpunit": "<8.0" - }, - "autoload": { - "psr-0": { - "Mockery": "library/" - } - }, - "autoload-dev": { - "psr-4": { - "test\\": "tests/" - } - }, - "config": { - "preferred-install": "dist" - }, - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - } -} diff --git a/vendor/mockery/mockery/docs/README.md b/vendor/mockery/mockery/docs/README.md deleted file mode 100644 index 63ca69d..0000000 --- a/vendor/mockery/mockery/docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -mockery-docs -============ - -Document for the PHP Mockery framework on readthedocs.org \ No newline at end of file diff --git a/vendor/mockery/mockery/docs/conf.py b/vendor/mockery/mockery/docs/conf.py deleted file mode 100644 index 901f040..0000000 --- a/vendor/mockery/mockery/docs/conf.py +++ /dev/null @@ -1,267 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Mockery Docs documentation build configuration file, created by -# sphinx-quickstart on Mon Mar 3 14:04:26 2014. -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys -import os - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -#sys.path.insert(0, os.path.abspath('.')) - -# -- General configuration ------------------------------------------------ - -# If your documentation needs a minimal Sphinx version, state it here. -#needs_sphinx = '1.0' - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - 'sphinx.ext.todo', -] - -# Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] - -# The suffix of source filenames. -source_suffix = '.rst' - -# The encoding of source files. -#source_encoding = 'utf-8-sig' - -# The master toctree document. -master_doc = 'index' - -# General information about the project. -project = u'Mockery Docs' -copyright = u'Pádraic Brady, Dave Marshall and contributors' - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The short X.Y version. -version = '1.0' -# The full version, including alpha/beta/rc tags. -release = '1.0-alpha' - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -#language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -#today = '' -# Else, today_fmt is used as the format for a strftime call. -#today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = ['_build'] - -# The reST default role (used for this markup: `text`) to use for all -# documents. -#default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -#add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -#add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -#show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' - -# A list of ignored prefixes for module index sorting. -#modindex_common_prefix = [] - -# If true, keep warnings as "system message" paragraphs in the built documents. -#keep_warnings = False - - -# -- Options for HTML output ---------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = 'default' - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -#html_theme_options = {} - -# Add any paths that contain custom themes here, relative to this directory. -#html_theme_path = [] - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -#html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] - -# Add any extra paths that contain custom files (such as robots.txt or -# .htaccess) here, relative to this directory. These files are copied -# directly to the root of the documentation. -#html_extra_path = [] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -#html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -#html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -#html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -#html_additional_pages = {} - -# If false, no module index is generated. -#html_domain_indices = True - -# If false, no index is generated. -#html_use_index = True - -# If true, the index is split into individual pages for each letter. -#html_split_index = False - -# If true, links to the reST sources are added to the pages. -#html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -#html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -#html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -#html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -#html_file_suffix = None - -# Output file base name for HTML help builder. -htmlhelp_basename = 'MockeryDocsdoc' - - -# -- Options for LaTeX output --------------------------------------------- - -latex_elements = { -# The paper size ('letterpaper' or 'a4paper'). -#'papersize': 'letterpaper', - -# The font size ('10pt', '11pt' or '12pt'). -#'pointsize': '10pt', - -# Additional stuff for the LaTeX preamble. -#'preamble': '', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - ('index', 'MockeryDocs.tex', u'Mockery Docs Documentation', - u'Pádraic Brady, Dave Marshall, Wouter, Graham Campbell', 'manual'), -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -#latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -#latex_use_parts = False - -# If true, show page references after internal links. -#latex_show_pagerefs = False - -# If true, show URL addresses after external links. -#latex_show_urls = False - -# Documents to append as an appendix to all manuals. -#latex_appendices = [] - -# If false, no module index is generated. -#latex_domain_indices = True - - -# -- Options for manual page output --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - ('index', 'mockerydocs', u'Mockery Docs Documentation', - [u'Pádraic Brady, Dave Marshall, Wouter, Graham Campbell'], 1) -] - -# If true, show URL addresses after external links. -#man_show_urls = False - - -# -- Options for Texinfo output ------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ('index', 'MockeryDocs', u'Mockery Docs Documentation', - u'Pádraic Brady, Dave Marshall, Wouter, Graham Campbell', 'MockeryDocs', 'One line description of project.', - 'Miscellaneous'), -] - -# Documents to append as an appendix to all manuals. -#texinfo_appendices = [] - -# If false, no module index is generated. -#texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -#texinfo_show_urls = 'footnote' - -# If true, do not generate a @detailmenu in the "Top" node's menu. -#texinfo_no_detailmenu = False - - -#on_rtd is whether we are on readthedocs.org, this line of code grabbed from docs.readthedocs.org -on_rtd = os.environ.get('READTHEDOCS', None) == 'True' - -if not on_rtd: # only import and set the theme if we're building docs locally - import sphinx_rtd_theme - html_theme = 'sphinx_rtd_theme' - html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] - print sphinx_rtd_theme.get_html_theme_path() - -# load PhpLexer -from sphinx.highlighting import lexers -from pygments.lexers.web import PhpLexer - -# enable highlighting for PHP code not between by default -lexers['php'] = PhpLexer(startinline=True) -lexers['php-annotations'] = PhpLexer(startinline=True) diff --git a/vendor/mockery/mockery/docs/cookbook/big_parent_class.rst b/vendor/mockery/mockery/docs/cookbook/big_parent_class.rst deleted file mode 100644 index a27d532..0000000 --- a/vendor/mockery/mockery/docs/cookbook/big_parent_class.rst +++ /dev/null @@ -1,52 +0,0 @@ -.. index:: - single: Cookbook; Big Parent Class - -Big Parent Class -================ - -In some application code, especially older legacy code, we can come across some -classes that extend a "big parent class" - a parent class that knows and does -too much: - -.. code-block:: php - - class BigParentClass - { - public function doesEverything() - { - // sets up database connections - // writes to log files - } - } - - class ChildClass extends BigParentClass - { - public function doesOneThing() - { - // but calls on BigParentClass methods - $result = $this->doesEverything(); - // does something with $result - return $result; - } - } - -We want to test our ``ChildClass`` and its ``doesOneThing`` method, but the -problem is that it calls on ``BigParentClass::doesEverything()``. One way to -handle this would be to mock out **all** of the dependencies ``BigParentClass`` -has and needs, and then finally actually test our ``doesOneThing`` method. It's -an awful lot of work to do that. - -What we can do, is to do something... unconventional. We can create a runtime -partial test double of the ``ChildClass`` itself and mock only the parent's -``doesEverything()`` method: - -.. code-block:: php - - $childClass = \Mockery::mock('ChildClass')->makePartial(); - $childClass->shouldReceive('doesEverything') - ->andReturn('some result from parent'); - - $childClass->doesOneThing(); // string("some result from parent"); - -With this approach we mock out only the ``doesEverything()`` method, and all the -unmocked methods are called on the actual ``ChildClass`` instance. diff --git a/vendor/mockery/mockery/docs/cookbook/class_constants.rst b/vendor/mockery/mockery/docs/cookbook/class_constants.rst deleted file mode 100644 index 0b92569..0000000 --- a/vendor/mockery/mockery/docs/cookbook/class_constants.rst +++ /dev/null @@ -1,183 +0,0 @@ -.. index:: - single: Cookbook; Class Constants - -Class Constants -=============== - -When creating a test double for a class, Mockery does not create stubs out of -any class constants defined in the class we are mocking. Sometimes though, the -non-existence of these class constants, setup of the test, and the application -code itself, it can lead to undesired behavior, and even a PHP error: -``PHP Fatal error: Uncaught Error: Undefined class constant 'FOO' in ...`` - -While supporting class constants in Mockery would be possible, it does require -an awful lot of work, for a small number of use cases. - -Named Mocks ------------ - -We can, however, deal with these constants in a way supported by Mockery - by -using :ref:`creating-test-doubles-named-mocks`. - -A named mock is a test double that has a name of the class we want to mock, but -under it is a stubbed out class that mimics the real class with canned responses. - -Lets look at the following made up, but not impossible scenario: - -.. code-block:: php - - class Fetcher - { - const SUCCESS = 0; - const FAILURE = 1; - - public static function fetch() - { - // Fetcher gets something for us from somewhere... - return self::SUCCESS; - } - } - - class MyClass - { - public function doFetching() - { - $response = Fetcher::fetch(); - - if ($response == Fetcher::SUCCESS) { - echo "Thanks!" . PHP_EOL; - } else { - echo "Try again!" . PHP_EOL; - } - } - } - -Our ``MyClass`` calls a ``Fetcher`` that fetches some resource from somewhere - -maybe it downloads a file from a remote web service. Our ``MyClass`` prints out -a response message depending on the response from the ``Fetcher::fetch()`` call. - -When testing ``MyClass`` we don't really want ``Fetcher`` to go and download -random stuff from the internet every time we run our test suite. So we mock it -out: - -.. code-block:: php - - // Using alias: because fetch is called statically! - \Mockery::mock('alias:Fetcher') - ->shouldReceive('fetch') - ->andReturn(0); - - $myClass = new MyClass(); - $myClass->doFetching(); - -If we run this, our test will error out with a nasty -``PHP Fatal error: Uncaught Error: Undefined class constant 'SUCCESS' in ..``. - -Here's how a ``namedMock()`` can help us in a situation like this. - -We create a stub for the ``Fetcher`` class, stubbing out the class constants, -and then use ``namedMock()`` to create a mock named ``Fetcher`` based on our -stub: - -.. code-block:: php - - class FetcherStub - { - const SUCCESS = 0; - const FAILURE = 1; - } - - \Mockery::namedMock('Fetcher', 'FetcherStub') - ->shouldReceive('fetch') - ->andReturn(0); - - $myClass = new MyClass(); - $myClass->doFetching(); - -This works because under the hood, Mockery creates a class called ``Fetcher`` -that extends ``FetcherStub``. - -The same approach will work even if ``Fetcher::fetch()`` is not a static -dependency: - -.. code-block:: php - - class Fetcher - { - const SUCCESS = 0; - const FAILURE = 1; - - public function fetch() - { - // Fetcher gets something for us from somewhere... - return self::SUCCESS; - } - } - - class MyClass - { - public function doFetching($fetcher) - { - $response = $fetcher->fetch(); - - if ($response == Fetcher::SUCCESS) { - echo "Thanks!" . PHP_EOL; - } else { - echo "Try again!" . PHP_EOL; - } - } - } - -And the test will have something like this: - -.. code-block:: php - - class FetcherStub - { - const SUCCESS = 0; - const FAILURE = 1; - } - - $mock = \Mockery::mock('Fetcher', 'FetcherStub') - $mock->shouldReceive('fetch') - ->andReturn(0); - - $myClass = new MyClass(); - $myClass->doFetching($mock); - - -Constants Map -------------- - -Another way of mocking class constants can be with the use of the constants map configuration. - -Given a class with constants: - -.. code-block:: php - - class Fetcher - { - const SUCCESS = 0; - const FAILURE = 1; - - public function fetch() - { - // Fetcher gets something for us from somewhere... - return self::SUCCESS; - } - } - -It can be mocked with: - -.. code-block:: php - - \Mockery::getConfiguration()->setConstantsMap([ - 'Fetcher' => [ - 'SUCCESS' => 'success', - 'FAILURE' => 'fail', - ] - ]); - - $mock = \Mockery::mock('Fetcher'); - var_dump($mock::SUCCESS); // (string) 'success' - var_dump($mock::FAILURE); // (string) 'fail' diff --git a/vendor/mockery/mockery/docs/cookbook/default_expectations.rst b/vendor/mockery/mockery/docs/cookbook/default_expectations.rst deleted file mode 100644 index 2c6fcae..0000000 --- a/vendor/mockery/mockery/docs/cookbook/default_expectations.rst +++ /dev/null @@ -1,17 +0,0 @@ -.. index:: - single: Cookbook; Default Mock Expectations - -Default Mock Expectations -========================= - -Often in unit testing, we end up with sets of tests which use the same object -dependency over and over again. Rather than mocking this class/object within -every single unit test (requiring a mountain of duplicate code), we can -instead define reusable default mocks within the test case's ``setup()`` -method. This even works where unit tests use varying expectations on the same -or similar mock object. - -How this works, is that you can define mocks with default expectations. Then, -in a later unit test, you can add or fine-tune expectations for that specific -test. Any expectation can be set as a default using the ``byDefault()`` -declaration. diff --git a/vendor/mockery/mockery/docs/cookbook/detecting_mock_objects.rst b/vendor/mockery/mockery/docs/cookbook/detecting_mock_objects.rst deleted file mode 100644 index 0210c69..0000000 --- a/vendor/mockery/mockery/docs/cookbook/detecting_mock_objects.rst +++ /dev/null @@ -1,13 +0,0 @@ -.. index:: - single: Cookbook; Detecting Mock Objects - -Detecting Mock Objects -====================== - -Users may find it useful to check whether a given object is a real object or a -simulated Mock Object. All Mockery mocks implement the -``\Mockery\MockInterface`` interface which can be used in a type check. - -.. code-block:: php - - assert($mightBeMocked instanceof \Mockery\MockInterface); diff --git a/vendor/mockery/mockery/docs/cookbook/index.rst b/vendor/mockery/mockery/docs/cookbook/index.rst deleted file mode 100644 index 034e39d..0000000 --- a/vendor/mockery/mockery/docs/cookbook/index.rst +++ /dev/null @@ -1,16 +0,0 @@ -Cookbook -======== - -.. toctree:: - :hidden: - - default_expectations - detecting_mock_objects - not_calling_the_constructor - mocking_hard_dependencies - class_constants - big_parent_class - mockery_on - mocking_class_within_class - -.. include:: map.rst.inc diff --git a/vendor/mockery/mockery/docs/cookbook/map.rst.inc b/vendor/mockery/mockery/docs/cookbook/map.rst.inc deleted file mode 100644 index c9dd99e..0000000 --- a/vendor/mockery/mockery/docs/cookbook/map.rst.inc +++ /dev/null @@ -1,7 +0,0 @@ -* :doc:`/cookbook/default_expectations` -* :doc:`/cookbook/detecting_mock_objects` -* :doc:`/cookbook/not_calling_the_constructor` -* :doc:`/cookbook/mocking_hard_dependencies` -* :doc:`/cookbook/class_constants` -* :doc:`/cookbook/big_parent_class` -* :doc:`/cookbook/mockery_on` diff --git a/vendor/mockery/mockery/docs/cookbook/mockery_on.rst b/vendor/mockery/mockery/docs/cookbook/mockery_on.rst deleted file mode 100644 index 631f124..0000000 --- a/vendor/mockery/mockery/docs/cookbook/mockery_on.rst +++ /dev/null @@ -1,85 +0,0 @@ -.. index:: - single: Cookbook; Complex Argument Matching With Mockery::on - -Complex Argument Matching With Mockery::on -========================================== - -When we need to do a more complex argument matching for an expected method call, -the ``\Mockery::on()`` matcher comes in really handy. It accepts a closure as an -argument and that closure in turn receives the argument passed in to the method, -when called. If the closure returns ``true``, Mockery will consider that the -argument has passed the expectation. If the closure returns ``false``, or a -"falsey" value, the expectation will not pass. - -The ``\Mockery::on()`` matcher can be used in various scenarios — validating -an array argument based on multiple keys and values, complex string matching... - -Say, for example, we have the following code. It doesn't do much; publishes a -post by setting the ``published`` flag in the database to ``1`` and sets the -``published_at`` to the current date and time: - -.. code-block:: php - - model = $model; - } - - public function publishPost($id) - { - $saveData = [ - 'post_id' => $id, - 'published' => 1, - 'published_at' => gmdate('Y-m-d H:i:s'), - ]; - $this->model->save($saveData); - } - } - -In a test we would mock the model and set some expectations on the call of the -``save()`` method: - -.. code-block:: php - - shouldReceive('save') - ->once() - ->with(\Mockery::on(function ($argument) use ($postId) { - $postIdIsSet = isset($argument['post_id']) && $argument['post_id'] === $postId; - $publishedFlagIsSet = isset($argument['published']) && $argument['published'] === 1; - $publishedAtIsSet = isset($argument['published_at']); - - return $postIdIsSet && $publishedFlagIsSet && $publishedAtIsSet; - })); - - $service = new \Service\Post($modelMock); - $service->publishPost($postId); - - \Mockery::close(); - -The important part of the example is inside the closure we pass to the -``\Mockery::on()`` matcher. The ``$argument`` is actually the ``$saveData`` argument -the ``save()`` method gets when it is called. We check for a couple of things in -this argument: - -* the post ID is set, and is same as the post ID we passed in to the - ``publishPost()`` method, -* the ``published`` flag is set, and is ``1``, and -* the ``published_at`` key is present. - -If any of these requirements is not satisfied, the closure will return ``false``, -the method call expectation will not be met, and Mockery will throw a -``NoMatchingExpectationException``. - -.. note:: - - This cookbook entry is an adaption of the blog post titled - `"Complex argument matching in Mockery" `_, - published by Robert Basic on his blog. diff --git a/vendor/mockery/mockery/docs/cookbook/mocking_class_within_class.rst b/vendor/mockery/mockery/docs/cookbook/mocking_class_within_class.rst deleted file mode 100644 index 51f030b..0000000 --- a/vendor/mockery/mockery/docs/cookbook/mocking_class_within_class.rst +++ /dev/null @@ -1,146 +0,0 @@ -.. index:: - single: Cookbook; Mocking class within class - -.. _mocking-class-within-class: - -Mocking class within class -========================== - -Imagine a case where you need to create an instance of a class and use it -within the same method: - -.. code-block:: php - - // Point.php - setPoint($x1, $y1); - - $b = new Point(); - $b->setPoint($x2, $y1); - - $c = new Point(); - $c->setPoint($x2, $y2); - - $d = new Point(); - $d->setPoint($x1, $y2); - - $this->draw([$a, $b, $c, $d]); - } - - public function draw($points) { - echo "Do something with the points"; - } - } - -And that you want to test that a logic in ``Rectangle->create()`` calls -properly each used thing - in this case calls ``Point->setPoint()``, but -``Rectangle->draw()`` does some graphical stuff that you want to avoid calling. - -You set the mocks for ``App\Point`` and ``App\Rectangle``: - -.. code-block:: php - - shouldReceive("setPoint")->andThrow(Exception::class); - - $rect = Mockery::mock("App\Rectangle")->makePartial(); - $rect->shouldReceive("draw"); - - $rect->create(0, 0, 100, 100); // does not throw exception - Mockery::close(); - } - } - -and the test does not work. Why? The mocking relies on the class not being -present yet, but the class is autoloaded therefore the mock alone for -``App\Point`` is useless which you can see with ``echo`` being executed. - -Mocks however work for the first class in the order of loading i.e. -``App\Rectangle``, which loads the ``App\Point`` class. In more complex example -that would be a single point that initiates the whole loading (``use Class``) -such as:: - - A // main loading initiator - |- B // another loading initiator - | |-E - | +-G - | - |- C // another loading initiator - | +-F - | - +- D - -That basically means that the loading prevents mocking and for each such -a loading initiator there needs to be implemented a workaround. -Overloading is one approach, however it pollutes the global state. In this case -we try to completely avoid the global state pollution with custom -``new Class()`` behavior per loading initiator and that can be mocked easily -in few critical places. - -That being said, although we can't stop loading, we can return mocks. Let's -look at ``Rectangle->create()`` method: - -.. code-block:: php - - class Rectangle { - public function newPoint() { - return new Point(); - } - - public function create($x1, $y1, $x2, $y2) { - $a = $this->newPoint(); - $a->setPoint($x1, $y1); - ... - } - ... - } - -We create a custom function to encapsulate ``new`` keyword that would otherwise -just use the autoloaded class ``App\Point`` and in our test we mock that function -so that it returns our mock: - -.. code-block:: php - - shouldReceive("setPoint")->andThrow(Exception::class); - - $rect = Mockery::mock("App\Rectangle")->makePartial(); - $rect->shouldReceive("draw"); - - // pass the App\Point mock into App\Rectangle as an alternative - // to using new App\Point() in-place. - $rect->shouldReceive("newPoint")->andReturn($point); - - $this->expectException(Exception::class); - $rect->create(0, 0, 100, 100); - Mockery::close(); - } - } - -If we run this test now, it should pass. For more complex cases we'd find -the next loader in the program flow and proceed with wrapping and passing -mock instances with predefined behavior into already existing classes. diff --git a/vendor/mockery/mockery/docs/cookbook/mocking_hard_dependencies.rst b/vendor/mockery/mockery/docs/cookbook/mocking_hard_dependencies.rst deleted file mode 100644 index 3391d7b..0000000 --- a/vendor/mockery/mockery/docs/cookbook/mocking_hard_dependencies.rst +++ /dev/null @@ -1,137 +0,0 @@ -.. index:: - single: Cookbook; Mocking Hard Dependencies - -Mocking Hard Dependencies (new Keyword) -======================================= - -One prerequisite to mock hard dependencies is that the code we are trying to test uses autoloading. - -Let's take the following code for an example: - -.. code-block:: php - - sendSomething($param); - return $externalService->getSomething(); - } - } - -The way we can test this without doing any changes to the code itself is by creating :doc:`instance mocks ` by using the ``overload`` prefix. - -.. code-block:: php - - shouldReceive('sendSomething') - ->once() - ->with($param); - $externalMock->shouldReceive('getSomething') - ->once() - ->andReturn('Tested!'); - - $service = new \App\Service(); - - $result = $service->callExternalService($param); - - $this->assertSame('Tested!', $result); - } - } - -If we run this test now, it should pass. Mockery does its job and our ``App\Service`` will use the mocked external service instead of the real one. - -The problem with this is when we want to, for example, test the ``App\Service\External`` itself, or if we use that class somewhere else in our tests. - -When Mockery overloads a class, because of how PHP works with files, that overloaded class file must not be included otherwise Mockery will throw a "class already exists" exception. This is where autoloading kicks in and makes our job a lot easier. - -To make this possible, we'll tell PHPUnit to run the tests that have overloaded classes in separate processes and to not preserve global state. That way we'll avoid having the overloaded class included more than once. Of course this has its downsides as these tests will run slower. - -Our test example from above now becomes: - -.. code-block:: php - - shouldReceive('sendSomething') - ->once() - ->with($param); - $externalMock->shouldReceive('getSomething') - ->once() - ->andReturn('Tested!'); - - $service = new \App\Service(); - - $result = $service->callExternalService($param); - - $this->assertSame('Tested!', $result); - } - } - - - -Testing the constructor arguments of hard Dependencies ------------------------------------------------------- - -Sometimes we might want to ensure that the hard dependency is instantiated with -particular arguments. With overloaded mocks, we can set up expectations on the -constructor. - -.. code-block:: php - - allows('sendSomething'); - $externalMock->shouldReceive('__construct') - ->once() - ->with(5); - - $service = new \App\Service(); - $result = $service->callExternalService($param); - } - } - - -.. note:: - For more straightforward and single-process tests oriented way check - :ref:`mocking-class-within-class`. - -.. note:: - - This cookbook entry is an adaption of the blog post titled - `"Mocking hard dependencies with Mockery" `_, - published by Robert Basic on his blog. diff --git a/vendor/mockery/mockery/docs/cookbook/not_calling_the_constructor.rst b/vendor/mockery/mockery/docs/cookbook/not_calling_the_constructor.rst deleted file mode 100644 index b8157ae..0000000 --- a/vendor/mockery/mockery/docs/cookbook/not_calling_the_constructor.rst +++ /dev/null @@ -1,63 +0,0 @@ -.. index:: - single: Cookbook; Not Calling the Original Constructor - -Not Calling the Original Constructor -==================================== - -When creating generated partial test doubles, Mockery mocks out only the method -which we specifically told it to. This means that the original constructor of -the class we are mocking will be called. - -In some cases this is not a desired behavior, as the constructor might issue -calls to other methods, or other object collaborators, and as such, can create -undesired side-effects in the application's environment when running the tests. - -If this happens, we need to use runtime partial test doubles, as they don't -call the original constructor. - -.. code-block:: php - - class MyClass - { - public function __construct() - { - echo "Original constructor called." . PHP_EOL; - // Other side-effects can happen... - } - } - - // This will print "Original constructor called." - $mock = \Mockery::mock('MyClass[foo]'); - -A better approach is to use runtime partial doubles: - -.. code-block:: php - - class MyClass - { - public function __construct() - { - echo "Original constructor called." . PHP_EOL; - // Other side-effects can happen... - } - } - - // This will not print anything - $mock = \Mockery::mock('MyClass')->makePartial(); - $mock->shouldReceive('foo'); - -This is one of the reason why we don't recommend using generated partial test -doubles, but if possible, always use the runtime partials. - -Read more about :ref:`creating-test-doubles-partial-test-doubles`. - -.. note:: - - The way generated partial test doubles work, is a BC break. If you use a - really old version of Mockery, it might behave in a way that the constructor - is not being called for these generated partials. In the case if you upgrade - to a more recent version of Mockery, you'll probably have to change your - tests to use runtime partials, instead of generated ones. - - This change was introduced in early 2013, so it is highly unlikely that you - are using a Mockery from before that, so this should not be an issue. diff --git a/vendor/mockery/mockery/docs/getting_started/index.rst b/vendor/mockery/mockery/docs/getting_started/index.rst deleted file mode 100644 index 434755c..0000000 --- a/vendor/mockery/mockery/docs/getting_started/index.rst +++ /dev/null @@ -1,12 +0,0 @@ -Getting Started -=============== - -.. toctree:: - :hidden: - - installation - upgrading - simple_example - quick_reference - -.. include:: map.rst.inc diff --git a/vendor/mockery/mockery/docs/getting_started/installation.rst b/vendor/mockery/mockery/docs/getting_started/installation.rst deleted file mode 100644 index f578adc..0000000 --- a/vendor/mockery/mockery/docs/getting_started/installation.rst +++ /dev/null @@ -1,49 +0,0 @@ -.. index:: - single: Installation - -Installation -============ - -Mockery can be installed using Composer or by cloning it from its GitHub -repository. These two options are outlined below. - -Composer --------- - -You can read more about Composer on `getcomposer.org `_. -To install Mockery using Composer, first install Composer for your project -using the instructions on the `Composer download page `_. -You can then define your development dependency on Mockery using the suggested -parameters below. While every effort is made to keep the master branch stable, -you may prefer to use the current stable version tag instead (use the -``@stable`` tag). - -.. code-block:: json - - { - "require-dev": { - "mockery/mockery": "dev-master" - } - } - -To install, you then may call: - -.. code-block:: bash - - php composer.phar update - -This will install Mockery as a development dependency, meaning it won't be -installed when using ``php composer.phar update --no-dev`` in production. - -Other way to install is directly from composer command line, as below. - -.. code-block:: bash - - php composer.phar require --dev mockery/mockery - -Git ---- - -The Git repository hosts the development version in its master branch. You can -install this using Composer by referencing ``dev-master`` as your preferred -version in your project's ``composer.json`` file as the earlier example shows. diff --git a/vendor/mockery/mockery/docs/getting_started/map.rst.inc b/vendor/mockery/mockery/docs/getting_started/map.rst.inc deleted file mode 100644 index 1055945..0000000 --- a/vendor/mockery/mockery/docs/getting_started/map.rst.inc +++ /dev/null @@ -1,4 +0,0 @@ -* :doc:`/getting_started/installation` -* :doc:`/getting_started/upgrading` -* :doc:`/getting_started/simple_example` -* :doc:`/getting_started/quick_reference` diff --git a/vendor/mockery/mockery/docs/getting_started/quick_reference.rst b/vendor/mockery/mockery/docs/getting_started/quick_reference.rst deleted file mode 100644 index e729a85..0000000 --- a/vendor/mockery/mockery/docs/getting_started/quick_reference.rst +++ /dev/null @@ -1,200 +0,0 @@ -.. index:: - single: Quick Reference - -Quick Reference -=============== - -The purpose of this page is to give a quick and short overview of some of the -most common Mockery features. - -Do read the :doc:`../reference/index` to learn about all the Mockery features. - -Integrate Mockery with PHPUnit, either by extending the ``MockeryTestCase``: - -.. code-block:: php - - use \Mockery\Adapter\Phpunit\MockeryTestCase; - - class MyTest extends MockeryTestCase - { - } - -or by using the ``MockeryPHPUnitIntegration`` trait: - -.. code-block:: php - - use \PHPUnit\Framework\TestCase; - use \Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration; - - class MyTest extends TestCase - { - use MockeryPHPUnitIntegration; - } - -Creating a test double: - -.. code-block:: php - - $testDouble = \Mockery::mock('MyClass'); - -Creating a test double that implements a certain interface: - -.. code-block:: php - - $testDouble = \Mockery::mock('MyClass, MyInterface'); - -Expecting a method to be called on a test double: - -.. code-block:: php - - $testDouble = \Mockery::mock('MyClass'); - $testDouble->shouldReceive('foo'); - -Expecting a method to **not** be called on a test double: - -.. code-block:: php - - $testDouble = \Mockery::mock('MyClass'); - $testDouble->shouldNotReceive('foo'); - -Expecting a method to be called on a test double, once, with a certain argument, -and to return a value: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('foo') - ->once() - ->with($arg) - ->andReturn($returnValue); - -Expecting a method to be called on a test double and to return a different value -for each successive call: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('foo') - ->andReturn(1, 2, 3); - - $mock->foo(); // int(1); - $mock->foo(); // int(2); - $mock->foo(); // int(3); - $mock->foo(); // int(3); - -Creating a runtime partial test double: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass')->makePartial(); - -Creating a spy: - -.. code-block:: php - - $spy = \Mockery::spy('MyClass'); - -Expecting that a spy should have received a method call: - -.. code-block:: php - - $spy = \Mockery::spy('MyClass'); - - $spy->foo(); - - $spy->shouldHaveReceived()->foo(); - -Not so simple examples -^^^^^^^^^^^^^^^^^^^^^^ - -Creating a mock object to return a sequence of values from a set of method -calls: - -.. code-block:: php - - use \Mockery\Adapter\Phpunit\MockeryTestCase; - - class SimpleTest extends MockeryTestCase - { - public function testSimpleMock() - { - $mock = \Mockery::mock(array('pi' => 3.1416, 'e' => 2.71)); - $this->assertEquals(3.1416, $mock->pi()); - $this->assertEquals(2.71, $mock->e()); - } - } - -Creating a mock object which returns a self-chaining Undefined object for a -method call: - -.. code-block:: php - - use \Mockery\Adapter\Phpunit\MockeryTestCase; - - class UndefinedTest extends MockeryTestCase - { - public function testUndefinedValues() - { - $mock = \Mockery::mock('mymock'); - $mock->shouldReceive('divideBy')->with(0)->andReturnUndefined(); - $this->assertTrue($mock->divideBy(0) instanceof \Mockery\Undefined); - } - } - -Creating a mock object with multiple query calls and a single update call: - -.. code-block:: php - - use \Mockery\Adapter\Phpunit\MockeryTestCase; - - class DbTest extends MockeryTestCase - { - public function testDbAdapter() - { - $mock = \Mockery::mock('db'); - $mock->shouldReceive('query')->andReturn(1, 2, 3); - $mock->shouldReceive('update')->with(5)->andReturn(NULL)->once(); - - // ... test code here using the mock - } - } - -Expecting all queries to be executed before any updates: - -.. code-block:: php - - use \Mockery\Adapter\Phpunit\MockeryTestCase; - - class DbTest extends MockeryTestCase - { - public function testQueryAndUpdateOrder() - { - $mock = \Mockery::mock('db'); - $mock->shouldReceive('query')->andReturn(1, 2, 3)->ordered(); - $mock->shouldReceive('update')->andReturn(NULL)->once()->ordered(); - - // ... test code here using the mock - } - } - -Creating a mock object where all queries occur after startup, but before finish, -and where queries are expected with several different params: - -.. code-block:: php - - use \Mockery\Adapter\Phpunit\MockeryTestCase; - - class DbTest extends MockeryTestCase - { - public function testOrderedQueries() - { - $db = \Mockery::mock('db'); - $db->shouldReceive('startup')->once()->ordered(); - $db->shouldReceive('query')->with('CPWR')->andReturn(12.3)->once()->ordered('queries'); - $db->shouldReceive('query')->with('MSFT')->andReturn(10.0)->once()->ordered('queries'); - $db->shouldReceive('query')->with(\Mockery::pattern("/^....$/"))->andReturn(3.3)->atLeast()->once()->ordered('queries'); - $db->shouldReceive('finish')->once()->ordered(); - - // ... test code here using the mock - } - } diff --git a/vendor/mockery/mockery/docs/getting_started/simple_example.rst b/vendor/mockery/mockery/docs/getting_started/simple_example.rst deleted file mode 100644 index 32ee269..0000000 --- a/vendor/mockery/mockery/docs/getting_started/simple_example.rst +++ /dev/null @@ -1,70 +0,0 @@ -.. index:: - single: Getting Started; Simple Example - -Simple Example -============== - -Imagine we have a ``Temperature`` class which samples the temperature of a -locale before reporting an average temperature. The data could come from a web -service or any other data source, but we do not have such a class at present. -We can, however, assume some basic interactions with such a class based on its -interaction with the ``Temperature`` class: - -.. code-block:: php - - class Temperature - { - private $service; - - public function __construct($service) - { - $this->service = $service; - } - - public function average() - { - $total = 0; - for ($i=0; $i<3; $i++) { - $total += $this->service->readTemp(); - } - return $total/3; - } - } - -Even without an actual service class, we can see how we expect it to operate. -When writing a test for the ``Temperature`` class, we can now substitute a -mock object for the real service which allows us to test the behaviour of the -``Temperature`` class without actually needing a concrete service instance. - -.. code-block:: php - - use \Mockery; - - class TemperatureTest extends \PHPUnit\Framework\TestCase - { - public function tearDown() - { - Mockery::close(); - } - - public function testGetsAverageTemperatureFromThreeServiceReadings() - { - $service = Mockery::mock('service'); - $service->shouldReceive('readTemp') - ->times(3) - ->andReturn(10, 12, 14); - - $temperature = new Temperature($service); - - $this->assertEquals(12, $temperature->average()); - } - } - -We create a mock object which our ``Temperature`` class will use and set some -expectations for that mock — that it should receive three calls to the ``readTemp`` -method, and these calls will return 10, 12, and 14 as results. - -.. note:: - - PHPUnit integration can remove the need for a ``tearDown()`` method. See - ":doc:`/reference/phpunit_integration`" for more information. diff --git a/vendor/mockery/mockery/docs/getting_started/upgrading.rst b/vendor/mockery/mockery/docs/getting_started/upgrading.rst deleted file mode 100644 index 7201e59..0000000 --- a/vendor/mockery/mockery/docs/getting_started/upgrading.rst +++ /dev/null @@ -1,82 +0,0 @@ -.. index:: - single: Upgrading - -Upgrading -========= - -Upgrading to 1.0.0 ------------------- - -Minimum PHP version -+++++++++++++++++++ - -As of Mockery 1.0.0 the minimum PHP version required is 5.6. - -Using Mockery with PHPUnit -++++++++++++++++++++++++++ - -In the "old days", 0.9.x and older, the way Mockery was integrated with PHPUnit was -through a PHPUnit listener. That listener would in turn call the ``\Mockery::close()`` -method for us. - -As of 1.0.0, PHPUnit test cases where we want to use Mockery, should either use the -``\Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration`` trait, or extend the -``\Mockery\Adapter\Phpunit\MockeryTestCase`` test case. This will in turn call the -``\Mockery::close()`` method for us. - -Read the documentation for a detailed overview of ":doc:`/reference/phpunit_integration`". - -``\Mockery\Matcher\MustBe`` is deprecated -+++++++++++++++++++++++++++++++++++++++++ - -As of 1.0.0 the ``\Mockery\Matcher\MustBe`` matcher is deprecated and will be removed in -Mockery 2.0.0. We recommend instead to use the PHPUnit or Hamcrest equivalents of the -MustBe matcher. - -``allows`` and ``expects`` -++++++++++++++++++++++++++ - -As of 1.0.0, Mockery has two new methods to set up expectations: ``allows`` and ``expects``. -This means that these methods names are now "reserved" for Mockery, or in other words -classes you want to mock with Mockery, can't have methods called ``allows`` or ``expects``. - -Read more in the documentation about this ":doc:`/reference/alternative_should_receive_syntax`". - -No more implicit regex matching for string arguments -++++++++++++++++++++++++++++++++++++++++++++++++++++ - -When setting up string arguments in method expectations, Mockery 0.9.x and older, would try -to match arguments using a regular expression in a "last attempt" scenario. - -As of 1.0.0, Mockery will no longer attempt to do this regex matching, but will only try -first the identical operator ``===``, and failing that, the equals operator ``==``. - -If you want to match an argument using regular expressions, please use the new -``\Mockery\Matcher\Pattern`` matcher. Read more in the documentation about this -pattern matcher in the ":doc:`/reference/argument_validation`" section. - -``andThrow`` ``\Throwable`` -+++++++++++++++++++++++++++ - -As of 1.0.0, the ``andThrow`` can now throw any ``\Throwable``. - -Upgrading to 0.9 ----------------- - -The generator was completely rewritten, so any code with a deep integration to -mockery will need evaluating. - -Upgrading to 0.8 ----------------- - -Since the release of 0.8.0 the following behaviours were altered: - -1. The ``shouldIgnoreMissing()`` behaviour optionally applied to mock objects - returned an instance of ``\Mockery\Undefined`` when methods called did not - match a known expectation. Since 0.8.0, this behaviour was switched to - returning ``null`` instead. You can restore the 0.7.2 behaviour by using the - following: - - .. code-block:: php - - $mock = \Mockery::mock('stdClass')->shouldIgnoreMissing()->asUndefined(); diff --git a/vendor/mockery/mockery/docs/index.rst b/vendor/mockery/mockery/docs/index.rst deleted file mode 100644 index f8cbbd3..0000000 --- a/vendor/mockery/mockery/docs/index.rst +++ /dev/null @@ -1,76 +0,0 @@ -Mockery -======= - -Mockery is a simple yet flexible PHP mock object framework for use in unit -testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is -to offer a test double framework with a succinct API capable of clearly -defining all possible object operations and interactions using a human -readable Domain Specific Language (DSL). Designed as a drop in alternative to -PHPUnit's phpunit-mock-objects library, Mockery is easy to integrate with -PHPUnit and can operate alongside phpunit-mock-objects without the World -ending. - -Mock Objects ------------- - -In unit tests, mock objects simulate the behaviour of real objects. They are -commonly utilised to offer test isolation, to stand in for objects which do -not yet exist, or to allow for the exploratory design of class APIs without -requiring actual implementation up front. - -The benefits of a mock object framework are to allow for the flexible -generation of such mock objects (and stubs). They allow the setting of -expected method calls and return values using a flexible API which is capable -of capturing every possible real object behaviour in way that is stated as -close as possible to a natural language description. - -Getting Started ---------------- - -Ready to dive into the Mockery framework? Then you can get started by reading -the "Getting Started" section! - -.. toctree:: - :hidden: - - getting_started/index - -.. include:: getting_started/map.rst.inc - -Reference ---------- - -The reference contains a complete overview of all features of the Mockery -framework. - -.. toctree:: - :hidden: - - reference/index - -.. include:: reference/map.rst.inc - -Mockery -------- - -Learn about Mockery's configuration, reserved method names, exceptions... - -.. toctree:: - :hidden: - - mockery/index - -.. include:: mockery/map.rst.inc - -Cookbook --------- - -Want to learn some easy tips and tricks? Take a look at the cookbook articles! - -.. toctree:: - :hidden: - - cookbook/index - -.. include:: cookbook/map.rst.inc - diff --git a/vendor/mockery/mockery/docs/mockery/configuration.rst b/vendor/mockery/mockery/docs/mockery/configuration.rst deleted file mode 100644 index 0071336..0000000 --- a/vendor/mockery/mockery/docs/mockery/configuration.rst +++ /dev/null @@ -1,94 +0,0 @@ -.. index:: - single: Mockery; Configuration - -Mockery Global Configuration -============================ - -To allow for a degree of fine-tuning, Mockery utilises a singleton -configuration object to store a small subset of core behaviours. The three -currently present include: - -* Option to allow/disallow the mocking of methods which do not actually exist - fulfilled (i.e. unused) -* Setter/Getter for added a parameter map for internal PHP class methods - (``Reflection`` cannot detect these automatically) -* Option to drive if quick definitions should define a stub or a mock with - an 'at least once' expectation. - -By default, the first behaviour is enabled. Of course, there are -situations where this can lead to unintended consequences. The mocking of -non-existent methods may allow mocks based on real classes/objects to fall out -of sync with the actual implementations, especially when some degree of -integration testing (testing of object wiring) is not being performed. - -You may allow or disallow this behaviour (whether for whole test suites or -just select tests) by using the following call: - -.. code-block:: php - - \Mockery::getConfiguration()->allowMockingNonExistentMethods(bool); - -Passing a true allows the behaviour, false disallows it. It takes effect -immediately until switched back. If the behaviour is detected when not allowed, -it will result in an Exception being thrown at that point. Note that disallowing -this behaviour should be carefully considered since it necessarily removes at -least some of Mockery's flexibility. - -The other two methods are: - -.. code-block:: php - - \Mockery::getConfiguration()->setInternalClassMethodParamMap($class, $method, array $paramMap) - \Mockery::getConfiguration()->getInternalClassMethodParamMap($class, $method) - -These are used to define parameters (i.e. the signature string of each) for the -methods of internal PHP classes (e.g. SPL, or PECL extension classes like -ext/mongo's MongoCollection. Reflection cannot analyse the parameters of internal -classes. Most of the time, you never need to do this. It's mainly needed where an -internal class method uses pass-by-reference for a parameter - you MUST in such -cases ensure the parameter signature includes the ``&`` symbol correctly as Mockery -won't correctly add it automatically for internal classes. Note that internal class -parameter overriding is not available in PHP 8. This is because incompatible -signatures have been reclassified as fatal errors. - -Finally there is the possibility to change what a quick definition produces. -By default quick definitions create stubs but you can change this behaviour -by asking Mockery to use 'at least once' expectations. - -.. code-block:: php - - \Mockery::getConfiguration()->getQuickDefinitions()->shouldBeCalledAtLeastOnce(bool) - -Passing a true allows the behaviour, false disallows it. It takes effect -immediately until switched back. By doing so you can avoid the proliferating of -quick definitions that accumulate overtime in your code since the test would -fail in case the 'at least once' expectation is not fulfilled. - -Disabling reflection caching ----------------------------- - -Mockery heavily uses `"reflection" `_ -to do it's job. To speed up things, Mockery caches internally the information it -gathers via reflection. In some cases, this caching can cause problems. - -The **only** known situation when this occurs is when PHPUnit's ``--static-backup`` option -is used. If you use ``--static-backup`` and you get an error that looks like the -following: - -.. code-block:: php - - Error: Internal error: Failed to retrieve the reflection object - -We suggest turning off the reflection cache as so: - -.. code-block:: php - - \Mockery::getConfiguration()->disableReflectionCache(); - -Turning it back on can be done like so: - -.. code-block:: php - - \Mockery::getConfiguration()->enableReflectionCache(); - -In no other situation should you be required turn this reflection cache off. diff --git a/vendor/mockery/mockery/docs/mockery/exceptions.rst b/vendor/mockery/mockery/docs/mockery/exceptions.rst deleted file mode 100644 index 623b158..0000000 --- a/vendor/mockery/mockery/docs/mockery/exceptions.rst +++ /dev/null @@ -1,65 +0,0 @@ -.. index:: - single: Mockery; Exceptions - -Mockery Exceptions -================== - -Mockery throws three types of exceptions when it cannot verify a mock object. - -#. ``\Mockery\Exception\InvalidCountException`` -#. ``\Mockery\Exception\InvalidOrderException`` -#. ``\Mockery\Exception\NoMatchingExpectationException`` - -You can capture any of these exceptions in a try...catch block to query them -for specific information which is also passed along in the exception message -but is provided separately from getters should they be useful when logging or -reformatting output. - -\Mockery\Exception\InvalidCountException ----------------------------------------- - -The exception class is used when a method is called too many (or too few) -times and offers the following methods: - -* ``getMock()`` - return actual mock object -* ``getMockName()`` - return the name of the mock object -* ``getMethodName()`` - return the name of the method the failing expectation - is attached to -* ``getExpectedCount()`` - return expected calls -* ``getExpectedCountComparative()`` - returns a string, e.g. ``<=`` used to - compare to actual count -* ``getActualCount()`` - return actual calls made with given argument - constraints - -\Mockery\Exception\InvalidOrderException ----------------------------------------- - -The exception class is used when a method is called outside the expected order -set using the ``ordered()`` and ``globally()`` expectation modifiers. It -offers the following methods: - -* ``getMock()`` - return actual mock object -* ``getMockName()`` - return the name of the mock object -* ``getMethodName()`` - return the name of the method the failing expectation - is attached to -* ``getExpectedOrder()`` - returns an integer represented the expected index - for which this call was expected -* ``getActualOrder()`` - return the actual index at which this method call - occurred. - -\Mockery\Exception\NoMatchingExpectationException -------------------------------------------------- - -The exception class is used when a method call does not match any known -expectation. All expectations are uniquely identified in a mock object by the -method name and the list of expected arguments. You can disable this exception -and opt for returning NULL from all unexpected method calls by using the -earlier mentioned shouldIgnoreMissing() behaviour modifier. This exception -class offers the following methods: - -* ``getMock()`` - return actual mock object -* ``getMockName()`` - return the name of the mock object -* ``getMethodName()`` - return the name of the method the failing expectation - is attached to -* ``getActualArguments()`` - return actual arguments used to search for a - matching expectation diff --git a/vendor/mockery/mockery/docs/mockery/gotchas.rst b/vendor/mockery/mockery/docs/mockery/gotchas.rst deleted file mode 100644 index 92c566d..0000000 --- a/vendor/mockery/mockery/docs/mockery/gotchas.rst +++ /dev/null @@ -1,44 +0,0 @@ -.. index:: - single: Mockery; Gotchas - -Gotchas! -======== - -Mocking objects in PHP has its limitations and gotchas. Some functionality -can't be mocked or can't be mocked YET! If you locate such a circumstance, -please please (pretty please with sugar on top) create a new issue on GitHub -so it can be documented and resolved where possible. Here is a list to note: - -1. Classes containing public ``__wakeup()`` methods can be mocked but the - mocked ``__wakeup()`` method will perform no actions and cannot have - expectations set for it. This is necessary since Mockery must serialize and - unserialize objects to avoid some ``__construct()`` insanity and attempting - to mock a ``__wakeup()`` method as normal leads to a - ``BadMethodCallException`` being thrown. - -2. Mockery has two scenarios where real classes are replaced: Instance mocks - and alias mocks. Both will generate PHP fatal errors if the real class is - loaded, usually via a require or include statement. Only use these two mock - types where autoloading is in place and where classes are not explicitly - loaded on a per-file basis using ``require()``, ``require_once()``, etc. - -3. Internal PHP classes are not entirely capable of being fully analysed using - ``Reflection``. For example, ``Reflection`` cannot reveal details of - expected parameters to the methods of such internal classes. As a result, - there will be problems where a method parameter is defined to accept a - value by reference (Mockery cannot detect this condition and will assume a - pass by value on scalars and arrays). If references as internal class - method parameters are needed, you should use the - ``\Mockery\Configuration::setInternalClassMethodParamMap()`` method. - Note, however that internal class parameter overriding is not available in - PHP 8 since incompatible signatures have been reclassified as fatal errors. - -4. Creating a mock implementing a certain interface with incorrect case in the - interface name, and then creating a second mock implementing the same - interface, but this time with the correct case, will have undefined behavior - due to PHP's ``class_exists`` and related functions being case insensitive. - Using the ``::class`` keyword in PHP can help you avoid these mistakes. - -The gotchas noted above are largely down to PHP's architecture and are assumed -to be unavoidable. But - if you figure out a solution (or a better one than -what may exist), let us know! diff --git a/vendor/mockery/mockery/docs/mockery/index.rst b/vendor/mockery/mockery/docs/mockery/index.rst deleted file mode 100644 index b698d6c..0000000 --- a/vendor/mockery/mockery/docs/mockery/index.rst +++ /dev/null @@ -1,12 +0,0 @@ -Mockery -======= - -.. toctree:: - :hidden: - - configuration - exceptions - reserved_method_names - gotchas - -.. include:: map.rst.inc diff --git a/vendor/mockery/mockery/docs/mockery/map.rst.inc b/vendor/mockery/mockery/docs/mockery/map.rst.inc deleted file mode 100644 index 46ffa97..0000000 --- a/vendor/mockery/mockery/docs/mockery/map.rst.inc +++ /dev/null @@ -1,4 +0,0 @@ -* :doc:`/mockery/configuration` -* :doc:`/mockery/exceptions` -* :doc:`/mockery/reserved_method_names` -* :doc:`/mockery/gotchas` diff --git a/vendor/mockery/mockery/docs/mockery/reserved_method_names.rst b/vendor/mockery/mockery/docs/mockery/reserved_method_names.rst deleted file mode 100644 index 5ad58d4..0000000 --- a/vendor/mockery/mockery/docs/mockery/reserved_method_names.rst +++ /dev/null @@ -1,33 +0,0 @@ -.. index:: - single: Reserved Method Names - -Reserved Method Names -===================== - -As you may have noticed, Mockery uses a number of methods called directly on -all mock objects, for example ``shouldReceive()``. Such methods are necessary -in order to setup expectations on the given mock, and so they cannot be -implemented on the classes or objects being mocked without creating a method -name collision (reported as a PHP fatal error). The methods reserved by -Mockery are: - -* ``shouldReceive()`` -* ``shouldNotReceive()`` -* ``allows()`` -* ``expects()`` -* ``shouldAllowMockingMethod()`` -* ``shouldIgnoreMissing()`` -* ``asUndefined()`` -* ``shouldAllowMockingProtectedMethods()`` -* ``makePartial()`` -* ``byDefault()`` -* ``shouldHaveReceived()`` -* ``shouldHaveBeenCalled()`` -* ``shouldNotHaveReceived()`` -* ``shouldNotHaveBeenCalled()`` - - -In addition, all mocks utilise a set of added methods and protected properties -which cannot exist on the class or object being mocked. These are far less -likely to cause collisions. All properties are prefixed with ``_mockery`` and -all method names with ``mockery_``. diff --git a/vendor/mockery/mockery/docs/reference/alternative_should_receive_syntax.rst b/vendor/mockery/mockery/docs/reference/alternative_should_receive_syntax.rst deleted file mode 100644 index 78c1e83..0000000 --- a/vendor/mockery/mockery/docs/reference/alternative_should_receive_syntax.rst +++ /dev/null @@ -1,91 +0,0 @@ -.. index:: - single: Alternative shouldReceive Syntax - -Alternative shouldReceive Syntax -================================ - -As of Mockery 1.0.0, we support calling methods as we would call any PHP method, -and not as string arguments to Mockery ``should*`` methods. - -The two Mockery methods that enable this are ``allows()`` and ``expects()``. - -Allows ------- - -We use ``allows()`` when we create stubs for methods that return a predefined -return value, but for these method stubs we don't care how many times, or if at -all, were they called. - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->allows([ - 'name_of_method_1' => 'return value', - 'name_of_method_2' => 'return value', - ]); - -This is equivalent with the following ``shouldReceive`` syntax: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive([ - 'name_of_method_1' => 'return value', - 'name_of_method_2' => 'return value', - ]); - -Note that with this format, we also tell Mockery that we don't care about the -arguments to the stubbed methods. - -If we do care about the arguments, we would do it like so: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->allows() - ->name_of_method_1($arg1) - ->andReturn('return value'); - -This is equivalent with the following ``shouldReceive`` syntax: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method_1') - ->with($arg1) - ->andReturn('return value'); - -Expects -------- - -We use ``expects()`` when we want to verify that a particular method was called: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->expects() - ->name_of_method_1($arg1) - ->andReturn('return value'); - -This is equivalent with the following ``shouldReceive`` syntax: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method_1') - ->once() - ->with($arg1) - ->andReturn('return value'); - -By default ``expects()`` sets up an expectation that the method should be called -once and once only. If we expect more than one call to the method, we can change -that expectation: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->expects() - ->name_of_method_1($arg1) - ->twice() - ->andReturn('return value'); - diff --git a/vendor/mockery/mockery/docs/reference/argument_validation.rst b/vendor/mockery/mockery/docs/reference/argument_validation.rst deleted file mode 100644 index 9351ce4..0000000 --- a/vendor/mockery/mockery/docs/reference/argument_validation.rst +++ /dev/null @@ -1,338 +0,0 @@ -.. index:: - single: Argument Validation - -Argument Validation -=================== - -The arguments passed to the ``with()`` declaration when setting up an -expectation determine the criteria for matching method calls to expectations. -Thus, we can setup up many expectations for a single method, each -differentiated by the expected arguments. Such argument matching is done on a -"best fit" basis. This ensures explicit matches take precedence over -generalised matches. - -An explicit match is merely where the expected argument and the actual -argument are easily equated (i.e. using ``===`` or ``==``). More generalised -matches are possible using regular expressions, class hinting and the -available generic matchers. The purpose of generalised matchers is to allow -arguments be defined in non-explicit terms, e.g. ``Mockery::any()`` passed to -``with()`` will match **any** argument in that position. - -Mockery's generic matchers do not cover all possibilities but offers optional -support for the Hamcrest library of matchers. Hamcrest is a PHP port of the -similarly named Java library (which has been ported also to Python, Erlang, -etc). By using Hamcrest, Mockery does not need to duplicate Hamcrest's already -impressive utility which itself promotes a natural English DSL. - -The examples below show Mockery matchers and their Hamcrest equivalent, if there -is one. Hamcrest uses functions (no namespacing). - -.. note:: - - If you don't wish to use the global Hamcrest functions, they are all exposed - through the ``\Hamcrest\Matchers`` class as well, as static methods. Thus, - ``identicalTo($arg)`` is the same as ``\Hamcrest\Matchers::identicalTo($arg)`` - -The most common matcher is the ``with()`` matcher: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('foo') - ->with(1): - -It tells mockery that it should receive a call to the ``foo`` method with the -integer ``1`` as an argument. In cases like this, Mockery first tries to match -the arguments using ``===`` (identical) comparison operator. If the argument is -a primitive, and if it fails the identical comparison, Mockery does a fallback -to the ``==`` (equals) comparison operator. - -When matching objects as arguments, Mockery only does the strict ``===`` -comparison, which means only the same ``$object`` will match: - -.. code-block:: php - - $object = new stdClass(); - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive("foo") - ->with($object); - - // Hamcrest equivalent - $mock->shouldReceive("foo") - ->with(identicalTo($object)); - -A different instance of ``stdClass`` will **not** match. - -.. note:: - - The ``Mockery\Matcher\MustBe`` matcher has been deprecated. - -If we need a loose comparison of objects, we can do that using Hamcrest's -``equalTo`` matcher: - -.. code-block:: php - - $mock->shouldReceive("foo") - ->with(equalTo(new stdClass)); - -In cases when we don't care about the type, or the value of an argument, just -that any argument is present, we use ``any()``: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive("foo") - ->with(\Mockery::any()); - - // Hamcrest equivalent - $mock->shouldReceive("foo") - ->with(anything()) - -Anything and everything passed in this argument slot is passed unconstrained. - -Validating Types and Resources ------------------------------- - -The ``type()`` matcher accepts any string which can be attached to ``is_`` to -form a valid type check. - -To match any PHP resource, we could do the following: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive("foo") - ->with(\Mockery::type('resource')); - - // Hamcrest equivalents - $mock->shouldReceive("foo") - ->with(resourceValue()); - $mock->shouldReceive("foo") - ->with(typeOf('resource')); - -It will return a ``true`` from an ``is_resource()`` call, if the provided -argument to the method is a PHP resource. For example, ``\Mockery::type('float')`` -or Hamcrest's ``floatValue()`` and ``typeOf('float')`` checks use ``is_float()``, -and ``\Mockery::type('callable')`` or Hamcrest's ``callable()`` uses -``is_callable()``. - -The ``type()`` matcher also accepts a class or interface name to be used in an -``instanceof`` evaluation of the actual argument. Hamcrest uses ``anInstanceOf()``. - -A full list of the type checkers is available at -`php.net `_ or browse Hamcrest's function -list in -`the Hamcrest code `_. - -.. _argument-validation-complex-argument-validation: - -Complex Argument Validation ---------------------------- - -If we want to perform a complex argument validation, the ``on()`` matcher is -invaluable. It accepts a closure (anonymous function) to which the actual -argument will be passed. - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive("foo") - ->with(\Mockery::on(closure)); - -If the closure evaluates to (i.e. returns) boolean ``true`` then the argument is -assumed to have matched the expectation. - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - - $mock->shouldReceive('foo') - ->with(\Mockery::on(function ($argument) { - if ($argument % 2 == 0) { - return true; - } - return false; - })); - - $mock->foo(4); // matches the expectation - $mock->foo(3); // throws a NoMatchingExpectationException - -.. note:: - - There is no Hamcrest version of the ``on()`` matcher. - -We can also perform argument validation by passing a closure to ``withArgs()`` -method. The closure will receive all arguments passed in the call to the expected -method and if it evaluates (i.e. returns) to boolean ``true``, then the list of -arguments is assumed to have matched the expectation: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive("foo") - ->withArgs(closure); - -The closure can also handle optional parameters, so if an optional parameter is -missing in the call to the expected method, it doesn't necessary means that the -list of arguments doesn't match the expectation. - -.. code-block:: php - - $closure = function ($odd, $even, $sum = null) { - $result = ($odd % 2 != 0) && ($even % 2 == 0); - if (!is_null($sum)) { - return $result && ($odd + $even == $sum); - } - return $result; - }; - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('foo')->withArgs($closure); - - $mock->foo(1, 2); // It matches the expectation: the optional argument is not needed - $mock->foo(1, 2, 3); // It also matches the expectation: the optional argument pass the validation - $mock->foo(1, 2, 4); // It doesn't match the expectation: the optional doesn't pass the validation - -.. note:: - - In previous versions, Mockery's ``with()`` would attempt to do a pattern - matching against the arguments, attempting to use the argument as a - regular expression. Over time this proved to be not such a great idea, so - we removed this functionality, and have introduced ``Mockery::pattern()`` - instead. - -If we would like to match an argument against a regular expression, we can use -the ``\Mockery::pattern()``: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('foo') - ->with(\Mockery::pattern('/^foo/')); - - // Hamcrest equivalent - $mock->shouldReceive('foo') - ->with(matchesPattern('/^foo/')); - -The ``ducktype()`` matcher is an alternative to matching by class type: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('foo') - ->with(\Mockery::ducktype('foo', 'bar')); - -It matches any argument which is an object containing the provided list of -methods to call. - -.. note:: - - There is no Hamcrest version of the ``ducktype()`` matcher. - -Capturing Arguments -------------------- - -If we want to perform multiple validations on a single argument, the ``capture`` -matcher provides a streamlined alternative to using the ``on()`` matcher. -It accepts a variable which the actual argument will be assigned. - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive("foo") - ->with(\Mockery::capture($bar)); - -This will assign *any* argument passed to ``foo`` to the local ``$bar`` variable to -then perform additional validation using assertions. - -.. note:: - - The ``capture`` matcher always evaluates to ``true``. As such, we should always - perform additional argument validation. - -Additional Argument Matchers ----------------------------- - -The ``not()`` matcher matches any argument which is not equal or identical to -the matcher's parameter: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('foo') - ->with(\Mockery::not(2)); - - // Hamcrest equivalent - $mock->shouldReceive('foo') - ->with(not(2)); - -``anyOf()`` matches any argument which equals any one of the given parameters: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('foo') - ->with(\Mockery::anyOf(1, 2)); - - // Hamcrest equivalent - $mock->shouldReceive('foo') - ->with(anyOf(1,2)); - -``notAnyOf()`` matches any argument which is not equal or identical to any of -the given parameters: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('foo') - ->with(\Mockery::notAnyOf(1, 2)); - -.. note:: - - There is no Hamcrest version of the ``notAnyOf()`` matcher. - -``subset()`` matches any argument which is any array containing the given array -subset: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('foo') - ->with(\Mockery::subset(array(0 => 'foo'))); - -This enforces both key naming and values, i.e. both the key and value of each -actual element is compared. - -.. note:: - - There is no Hamcrest version of this functionality, though Hamcrest can check - a single entry using ``hasEntry()`` or ``hasKeyValuePair()``. - -``contains()`` matches any argument which is an array containing the listed -values: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('foo') - ->with(\Mockery::contains(value1, value2)); - -The naming of keys is ignored. - -``hasKey()`` matches any argument which is an array containing the given key -name: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('foo') - ->with(\Mockery::hasKey(key)); - -``hasValue()`` matches any argument which is an array containing the given -value: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('foo') - ->with(\Mockery::hasValue(value)); diff --git a/vendor/mockery/mockery/docs/reference/creating_test_doubles.rst b/vendor/mockery/mockery/docs/reference/creating_test_doubles.rst deleted file mode 100644 index 6f8f8c3..0000000 --- a/vendor/mockery/mockery/docs/reference/creating_test_doubles.rst +++ /dev/null @@ -1,435 +0,0 @@ -.. index:: - single: Reference; Creating Test Doubles - -Creating Test Doubles -===================== - -Mockery's main goal is to help us create test doubles. It can create stubs, -mocks, and spies. - -Stubs and mocks are created the same. The difference between the two is that a -stub only returns a preset result when called, while a mock needs to have -expectations set on the method calls it expects to receive. - -Spies are a type of test doubles that keep track of the calls they received, and -allow us to inspect these calls after the fact. - -When creating a test double object, we can pass in an identifier as a name for -our test double. If we pass it no identifier, the test double name will be -unknown. Furthermore, the identifier does not have to be a class name. It is a -good practice, and our recommendation, to always name the test doubles with the -same name as the underlying class we are creating test doubles for. - -If the identifier we use for our test double is a name of an existing class, -the test double will inherit the type of the class (via inheritance), i.e. the -mock object will pass type hints or ``instanceof`` evaluations for the existing -class. This is useful when a test double must be of a specific type, to satisfy -the expectations our code has. - -Stubs and mocks ---------------- - -Stubs and mocks are created by calling the ``\Mockery::mock()`` method. The -following example shows how to create a stub, or a mock, object named "foo": - -.. code-block:: php - - $mock = \Mockery::mock('foo'); - -The mock object created like this is the loosest form of mocks possible, and is -an instance of ``\Mockery\MockInterface``. - -.. note:: - - All test doubles created with Mockery are an instance of - ``\Mockery\MockInterface``, regardless are they a stub, mock or a spy. - -To create a stub or a mock object with no name, we can call the ``mock()`` -method with no parameters: - -.. code-block:: php - - $mock = \Mockery::mock(); - -As we stated earlier, we don't recommend creating stub or mock objects without -a name. - -Classes, abstracts, interfaces -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -The recommended way to create a stub or a mock object is by using a name of -an existing class we want to create a test double of: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - -This stub or mock object will have the type of ``MyClass``, through inheritance. - -Stub or mock objects can be based on any concrete class, abstract class or even -an interface. The primary purpose is to ensure the mock object inherits a -specific type for type hinting. - -.. code-block:: php - - $mock = \Mockery::mock('MyInterface'); - -This stub or mock object will implement the ``MyInterface`` interface. - -.. note:: - - Classes marked final, or classes that have methods marked final cannot be - mocked fully. Mockery supports creating partial mocks for these cases. - Partial mocks will be explained later in the documentation. - -Mockery also supports creating stub or mock objects based on a single existing -class, which must implement one or more interfaces. We can do this by providing -a comma-separated list of the class and interfaces as the first argument to the -``\Mockery::mock()`` method: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass, MyInterface, OtherInterface'); - -This stub or mock object will now be of type ``MyClass`` and implement the -``MyInterface`` and ``OtherInterface`` interfaces. - -.. note:: - - The class name doesn't need to be the first member of the list but it's a - friendly convention to use for readability. - -We can tell a mock to implement the desired interfaces by passing the list of -interfaces as the second argument: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass', 'MyInterface, OtherInterface'); - -For all intents and purposes, this is the same as the previous example. - -Spies ------ - -The third type of test doubles Mockery supports are spies. The main difference -between spies and mock objects is that with spies we verify the calls made -against our test double after the calls were made. We would use a spy when we -don't necessarily care about all of the calls that are going to be made to an -object. - -A spy will return ``null`` for all method calls it receives. It is not possible -to tell a spy what will be the return value of a method call. If we do that, then -we would deal with a mock object, and not with a spy. - -We create a spy by calling the ``\Mockery::spy()`` method: - -.. code-block:: php - - $spy = \Mockery::spy('MyClass'); - -Just as with stubs or mocks, we can tell Mockery to base a spy on any concrete -or abstract class, or to implement any number of interfaces: - -.. code-block:: php - - $spy = \Mockery::spy('MyClass, MyInterface, OtherInterface'); - -This spy will now be of type ``MyClass`` and implement the ``MyInterface`` and -``OtherInterface`` interfaces. - -.. note:: - - The ``\Mockery::spy()`` method call is actually a shorthand for calling - ``\Mockery::mock()->shouldIgnoreMissing()``. The ``shouldIgnoreMissing`` - method is a "behaviour modifier". We'll discuss them a bit later. - -Mocks vs. Spies ---------------- - -Let's try and illustrate the difference between mocks and spies with the -following example: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $spy = \Mockery::spy('MyClass'); - - $mock->shouldReceive('foo')->andReturn(42); - - $mockResult = $mock->foo(); - $spyResult = $spy->foo(); - - $spy->shouldHaveReceived()->foo(); - - var_dump($mockResult); // int(42) - var_dump($spyResult); // null - -As we can see from this example, with a mock object we set the call expectations -before the call itself, and we get the return result we expect it to return. -With a spy object on the other hand, we verify the call has happened after the -fact. The return result of a method call against a spy is always ``null``. - -We also have a dedicated chapter to :doc:`spies` only. - -.. _creating-test-doubles-partial-test-doubles: - -Partial Test Doubles --------------------- - -Partial doubles are useful when we want to stub out, set expectations for, or -spy on *some* methods of a class, but run the actual code for other methods. - -We differentiate between three types of partial test doubles: - - * runtime partial test doubles, - * generated partial test doubles, and - * proxied partial test doubles. - -Runtime partial test doubles -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -What we call a runtime partial, involves creating a test double and then telling -it to make itself partial. Any method calls that the double hasn't been told to -allow or expect, will act as they would on a normal instance of the object. - -.. code-block:: php - - class Foo { - function foo() { return 123; } - function bar() { return $this->foo(); } - } - - $foo = mock(Foo::class)->makePartial(); - $foo->foo(); // int(123); - -We can then tell the test double to allow or expect calls as with any other -Mockery double. - -.. code-block:: php - - $foo->shouldReceive('foo')->andReturn(456); - $foo->bar(); // int(456) - -See the cookbook entry on :doc:`../cookbook/big_parent_class` for an example -usage of runtime partial test doubles. - -Generated partial test doubles -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -The second type of partial double we can create is what we call a generated -partial. With generated partials, we specifically tell Mockery which methods -we want to be able to allow or expect calls to. All other methods will run the -actual code *directly*, so stubs and expectations on these methods will not -work. - -.. code-block:: php - - class Foo { - function foo() { return 123; } - function bar() { return $this->foo(); } - } - - $foo = mock("Foo[foo]"); - - $foo->foo(); // error, no expectation set - - $foo->shouldReceive('foo')->andReturn(456); - $foo->foo(); // int(456) - - // setting an expectation for this has no effect - $foo->shouldReceive('bar')->andReturn(999); - $foo->bar(); // int(456) - -It's also possible to specify explicitly which methods to run directly using -the `!method` syntax: - -.. code-block:: php - - class Foo { - function foo() { return 123; } - function bar() { return $this->foo(); } - } - - $foo = mock("Foo[!foo]"); - - $foo->foo(); // int(123) - - $foo->bar(); // error, no expectation set - -.. note:: - - Even though we support generated partial test doubles, we do not recommend - using them. - - One of the reasons why is because a generated partial will call the original - constructor of the mocked class. This can have unwanted side-effects during - testing application code. - - See :doc:`../cookbook/not_calling_the_constructor` for more details. - -Proxied partial test doubles -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -A proxied partial mock is a partial of last resort. We may encounter a class -which is simply not capable of being mocked because it has been marked as -final. Similarly, we may find a class with methods marked as final. In such a -scenario, we cannot simply extend the class and override methods to mock - we -need to get creative. - -.. code-block:: php - - $mock = \Mockery::mock(new MyClass); - -Yes, the new mock is a Proxy. It intercepts calls and reroutes them to the -proxied object (which we construct and pass in) for methods which are not -subject to any expectations. Indirectly, this allows us to mock methods -marked final since the Proxy is not subject to those limitations. The tradeoff -should be obvious - a proxied partial will fail any typehint checks for the -class being mocked since it cannot extend that class. - -.. _creating-test-doubles-aliasing: - -Aliasing --------- - -Prefixing the valid name of a class (which is NOT currently loaded) with -"alias:" will generate an "alias mock". Alias mocks create a class alias with -the given classname to stdClass and are generally used to enable the mocking -of public static methods. Expectations set on the new mock object which refer -to static methods will be used by all static calls to this class. - -.. code-block:: php - - $mock = \Mockery::mock('alias:MyClass'); - - -.. note:: - - Even though aliasing classes is supported, we do not recommend it. - -Overloading ------------ - -Prefixing the valid name of a class (which is NOT currently loaded) with -"overload:" will generate an alias mock (as with "alias:") except that created -new instances of that class will import any expectations set on the origin -mock (``$mock``). The origin mock is never verified since it's used an -expectation store for new instances. For this purpose we use the term "instance -mock" to differentiate it from the simpler "alias mock". - -In other words, an instance mock will "intercept" when a new instance of the -mocked class is created, then the mock will be used instead. This is useful -especially when mocking hard dependencies which will be discussed later. - -.. code-block:: php - - $mock = \Mockery::mock('overload:MyClass'); - -.. note:: - - Using alias/instance mocks across more than one test will generate a fatal - error since we can't have two classes of the same name. To avoid this, - run each test of this kind in a separate PHP process (which is supported - out of the box by both PHPUnit and PHPT). - - -.. _creating-test-doubles-named-mocks: - -Named Mocks ------------ - -The ``namedMock()`` method will generate a class called by the first argument, -so in this example ``MyClassName``. The rest of the arguments are treated in the -same way as the ``mock`` method: - -.. code-block:: php - - $mock = \Mockery::namedMock('MyClassName', 'DateTime'); - -This example would create a class called ``MyClassName`` that extends -``DateTime``. - -Named mocks are quite an edge case, but they can be useful when code depends -on the ``__CLASS__`` magic constant, or when we need two derivatives of an -abstract type, that are actually different classes. - -See the cookbook entry on :doc:`../cookbook/class_constants` for an example -usage of named mocks. - -.. note:: - - We can only create a named mock once, any subsequent calls to - ``namedMock``, with different arguments are likely to cause exceptions. - -.. _creating-test-doubles-constructor-arguments: - -Constructor Arguments ---------------------- - -Sometimes the mocked class has required constructor arguments. We can pass these -to Mockery as an indexed array, as the 2nd argument: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass', [$constructorArg1, $constructorArg2]); - -or if we need the ``MyClass`` to implement an interface as well, as the 3rd -argument: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass', 'MyInterface', [$constructorArg1, $constructorArg2]); - -Mockery now knows to pass in ``$constructorArg1`` and ``$constructorArg2`` as -arguments to the constructor. - -.. _creating-test-doubles-behavior-modifiers: - -Behavior Modifiers ------------------- - -When creating a mock object, we may wish to use some commonly preferred -behaviours that are not the default in Mockery. - -The use of the ``shouldIgnoreMissing()`` behaviour modifier will label this -mock object as a Passive Mock: - -.. code-block:: php - - \Mockery::mock('MyClass')->shouldIgnoreMissing(); - -In such a mock object, calls to methods which are not covered by expectations -will return ``null`` instead of the usual error about there being no expectation -matching the call. - -On PHP >= 7.0.0, methods with missing expectations that have a return type -will return either a mock of the object (if return type is a class) or a -"falsy" primitive value, e.g. empty string, empty array, zero for ints and -floats, false for bools, or empty closures. - -On PHP >= 7.1.0, methods with missing expectations and nullable return type -will return null. - -We can optionally prefer to return an object of type ``\Mockery\Undefined`` -(i.e. a ``null`` object) (which was the 0.7.2 behaviour) by using an -additional modifier: - -.. code-block:: php - - \Mockery::mock('MyClass')->shouldIgnoreMissing()->asUndefined(); - -The returned object is nothing more than a placeholder so if, by some act of -fate, it's erroneously used somewhere it shouldn't it will likely not pass a -logic check. - -We have encountered the ``makePartial()`` method before, as it is the method we -use to create runtime partial test doubles: - -.. code-block:: php - - \Mockery::mock('MyClass')->makePartial(); - -This form of mock object will defer all methods not subject to an expectation to -the parent class of the mock, i.e. ``MyClass``. Whereas the previous -``shouldIgnoreMissing()`` returned ``null``, this behaviour simply calls the -parent's matching method. diff --git a/vendor/mockery/mockery/docs/reference/demeter_chains.rst b/vendor/mockery/mockery/docs/reference/demeter_chains.rst deleted file mode 100644 index 1dad5ef..0000000 --- a/vendor/mockery/mockery/docs/reference/demeter_chains.rst +++ /dev/null @@ -1,38 +0,0 @@ -.. index:: - single: Mocking; Demeter Chains - -Mocking Demeter Chains And Fluent Interfaces -============================================ - -Both of these terms refer to the growing practice of invoking statements -similar to: - -.. code-block:: php - - $object->foo()->bar()->zebra()->alpha()->selfDestruct(); - -The long chain of method calls isn't necessarily a bad thing, assuming they -each link back to a local object the calling class knows. As a fun example, -Mockery's long chains (after the first ``shouldReceive()`` method) all call to -the same instance of ``\Mockery\Expectation``. However, sometimes this is not -the case and the chain is constantly crossing object boundaries. - -In either case, mocking such a chain can be a horrible task. To make it easier -Mockery supports demeter chain mocking. Essentially, we shortcut through the -chain and return a defined value from the final call. For example, let's -assume ``selfDestruct()`` returns the string "Ten!" to $object (an instance of -``CaptainsConsole``). Here's how we could mock it. - -.. code-block:: php - - $mock = \Mockery::mock('CaptainsConsole'); - $mock->shouldReceive('foo->bar->zebra->alpha->selfDestruct')->andReturn('Ten!'); - -The above expectation can follow any previously seen format or expectation, -except that the method name is simply the string of all expected chain calls -separated by ``->``. Mockery will automatically setup the chain of expected -calls with its final return values, regardless of whatever intermediary object -might be used in the real implementation. - -Arguments to all members of the chain (except the final call) are ignored in -this process. diff --git a/vendor/mockery/mockery/docs/reference/expectations.rst b/vendor/mockery/mockery/docs/reference/expectations.rst deleted file mode 100644 index 65cf2a2..0000000 --- a/vendor/mockery/mockery/docs/reference/expectations.rst +++ /dev/null @@ -1,505 +0,0 @@ -.. index:: - single: Expectations - -Expectation Declarations -======================== - -.. note:: - - In order for our expectations to work we MUST call ``Mockery::close()``, - preferably in a callback method such as ``tearDown`` or ``_after`` - (depending on whether or not we're integrating Mockery with another - framework). This static call cleans up the Mockery container used by the - current test, and run any verification tasks needed for our expectations. - -Once we have created a mock object, we'll often want to start defining how -exactly it should behave (and how it should be called). This is where the -Mockery expectation declarations take over. - -Declaring Method Call Expectations ----------------------------------- - -To tell our test double to expect a call for a method with a given name, we use -the ``shouldReceive`` method: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method'); - -This is the starting expectation upon which all other expectations and -constraints are appended. - -We can declare more than one method call to be expected: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method_1', 'name_of_method_2'); - -All of these will adopt any chained expectations or constraints. - -It is possible to declare the expectations for the method calls, along with -their return values: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive([ - 'name_of_method_1' => 'return value 1', - 'name_of_method_2' => 'return value 2', - ]); - -There's also a shorthand way of setting up method call expectations and their -return values: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass', ['name_of_method_1' => 'return value 1', 'name_of_method_2' => 'return value 2']); - -All of these will adopt any additional chained expectations or constraints. - -We can declare that a test double should not expect a call to the given method -name: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldNotReceive('name_of_method'); - -This method is a convenience method for calling ``shouldReceive()->never()``. - -Declaring Method Argument Expectations --------------------------------------- - -For every method we declare expectation for, we can add constraints that the -defined expectations apply only to the method calls that match the expected -argument list: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->with($arg1, $arg2, ...); - // or - $mock->shouldReceive('name_of_method') - ->withArgs([$arg1, $arg2, ...]); - -We can add a lot more flexibility to argument matching using the built in -matcher classes (see later). For example, ``\Mockery::any()`` matches any -argument passed to that position in the ``with()`` parameter list. Mockery also -allows Hamcrest library matchers - for example, the Hamcrest function -``anything()`` is equivalent to ``\Mockery::any()``. - -It's important to note that this means all expectations attached only apply to -the given method when it is called with these exact arguments: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - - $mock->shouldReceive('foo')->with('Hello'); - - $mock->foo('Goodbye'); // throws a NoMatchingExpectationException - -This allows for setting up differing expectations based on the arguments -provided to expected calls. - -Argument matching with closures -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Instead of providing a built-in matcher for each argument, we can provide a -closure that matches all passed arguments at once: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->withArgs(closure); - -The given closure receives all the arguments passed in the call to the expected -method. In this way, this expectation only applies to method calls where passed -arguments make the closure evaluate to true: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - - $mock->shouldReceive('foo')->withArgs(function ($arg) { - if ($arg % 2 == 0) { - return true; - } - return false; - }); - - $mock->foo(4); // matches the expectation - $mock->foo(3); // throws a NoMatchingExpectationException - -Argument matching with some of given values -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -We can provide expected arguments that match passed arguments when mocked method -is called. - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->withSomeOfArgs(arg1, arg2, arg3, ...); - -The given expected arguments order doesn't matter. -Check if expected values are included or not, but type should be matched: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('foo') - ->withSomeOfArgs(1, 2); - - $mock->foo(1, 2, 3); // matches the expectation - $mock->foo(3, 2, 1); // matches the expectation (passed order doesn't matter) - $mock->foo('1', '2'); // throws a NoMatchingExpectationException (type should be matched) - $mock->foo(3); // throws a NoMatchingExpectationException - -Any, or no arguments -^^^^^^^^^^^^^^^^^^^^ - -We can declare that the expectation matches a method call regardless of what -arguments are passed: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->withAnyArgs(); - -This is set by default unless otherwise specified. - -We can declare that the expectation matches method calls with zero arguments: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->withNoArgs(); - -Declaring Return Value Expectations ------------------------------------ - -For mock objects, we can tell Mockery what return values to return from the -expected method calls. - -For that we can use the ``andReturn()`` method: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->andReturn($value); - -This sets a value to be returned from the expected method call. - -It is possible to set up expectation for multiple return values. By providing -a sequence of return values, we tell Mockery what value to return on every -subsequent call to the method: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->andReturn($value1, $value2, ...) - -The first call will return ``$value1`` and the second call will return ``$value2``. - -If we call the method more times than the number of return values we declared, -Mockery will return the final value for any subsequent method call: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - - $mock->shouldReceive('foo')->andReturn(1, 2, 3); - - $mock->foo(); // int(1) - $mock->foo(); // int(2) - $mock->foo(); // int(3) - $mock->foo(); // int(3) - -The same can be achieved using the alternative syntax: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->andReturnValues([$value1, $value2, ...]) - -It accepts a simple array instead of a list of parameters. The order of return -is determined by the numerical index of the given array with the last array -member being returned on all calls once previous return values are exhausted. - -The following two options are primarily for communication with test readers: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->andReturnNull(); - // or - $mock->shouldReceive('name_of_method') - ->andReturn([null]); - -They mark the mock object method call as returning ``null`` or nothing. - -Sometimes we want to calculate the return results of the method calls, based on -the arguments passed to the method. We can do that with the ``andReturnUsing()`` -method which accepts one or more closure: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->andReturnUsing(closure, ...); - -Closures can be queued by passing them as extra parameters as for ``andReturn()``. - -Occasionally, it can be useful to echo back one of the arguments that a method -is called with. In this case we can use the ``andReturnArg()`` method; the -argument to be returned is specified by its index in the arguments list: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->andReturnArg(1); - -This returns the second argument (index #1) from the list of arguments when the -method is called. - -.. note:: - - We cannot currently mix ``andReturnUsing()`` or ``andReturnArg`` with - ``andReturn()``. - -If we are mocking fluid interfaces, the following method will be helpful: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->andReturnSelf(); - -It sets the return value to the mocked class name. - -Throwing Exceptions -------------------- - -We can tell the method of mock objects to throw exceptions: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->andThrow(new Exception); - -It will throw the given ``Exception`` object when called. - -Rather than an object, we can pass in the ``Exception`` class, message and/or code to -use when throwing an ``Exception`` from the mocked method: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->andThrow('exception_name', 'message', 123456789); - -.. _expectations-setting-public-properties: - -Setting Public Properties -------------------------- - -Used with an expectation so that when a matching method is called, we can cause -a mock object's public property to be set to a specified value, by using -``andSet()`` or ``set()``: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->andSet($property, $value); - // or - $mock->shouldReceive('name_of_method') - ->set($property, $value); - -In cases where we want to call the real method of the class that was mocked and -return its result, the ``passthru()`` method tells the expectation to bypass -a return queue: - -.. code-block:: php - - passthru() - -It allows expectation matching and call count validation to be applied against -real methods while still calling the real class method with the expected -arguments. - -Declaring Call Count Expectations ---------------------------------- - -Besides setting expectations on the arguments of the method calls, and the -return values of those same calls, we can set expectations on how many times -should any method be called. - -When a call count expectation is not met, a -``\Mockery\Expectation\InvalidCountException`` will be thrown. - -.. note:: - - It is absolutely required to call ``\Mockery::close()`` at the end of our - tests, for example in the ``tearDown()`` method of PHPUnit. Otherwise - Mockery will not verify the calls made against our mock objects. - -We can declare that the expected method may be called zero or more times: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->zeroOrMoreTimes(); - -This is the default for all methods unless otherwise set. - -To tell Mockery to expect an exact number of calls to a method, we can use the -following: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->times($n); - -where ``$n`` is the number of times the method should be called. - -A couple of most common cases got their shorthand methods. - -To declare that the expected method must be called one time only: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->once(); - -To declare that the expected method must be called two times: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->twice(); - -To declare that the expected method must never be called: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->never(); - -Call count modifiers -^^^^^^^^^^^^^^^^^^^^ - -The call count expectations can have modifiers set. - -If we want to tell Mockery the minimum number of times a method should be called, -we use ``atLeast()``: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->atLeast() - ->times(3); - -``atLeast()->times(3)`` means the call must be called at least three times -(given matching method args) but never less than three times. - -Similarly, we can tell Mockery the maximum number of times a method should be -called, using ``atMost()``: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->atMost() - ->times(3); - -``atMost()->times(3)`` means the call must be called no more than three times. -If the method gets no calls at all, the expectation will still be met. - -We can also set a range of call counts, using ``between()``: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->between($min, $max); - -This is actually identical to using ``atLeast()->times($min)->atMost()->times($max)`` -but is provided as a shorthand. It may be followed by a ``times()`` call with no -parameter to preserve the APIs natural language readability. - -Expectation Declaration Utilities ---------------------------------- - -Declares that this method is expected to be called in a specific order in -relation to similarly marked methods. - -.. code-block:: php - - ordered() - -The order is dictated by the order in which this modifier is actually used when -setting up mocks. - -Declares the method as belonging to an order group (which can be named or -numbered). Methods within a group can be called in any order, but the ordered -calls from outside the group are ordered in relation to the group: - -.. code-block:: php - - ordered(group) - -We can set up so that method1 is called before group1 which is in turn called -before method2. - -When called prior to ``ordered()`` or ``ordered(group)``, it declares this -ordering to apply across all mock objects (not just the current mock): - -.. code-block:: php - - globally() - -This allows for dictating order expectations across multiple mocks. - -The ``byDefault()`` marks an expectation as a default. Default expectations are -applied unless a non-default expectation is created: - -.. code-block:: php - - byDefault() - -These later expectations immediately replace the previously defined default. -This is useful so we can setup default mocks in our unit test ``setup()`` and -later tweak them in specific tests as needed. - -Returns the current mock object from an expectation chain: - -.. code-block:: php - - getMock() - -Useful where we prefer to keep mock setups as a single statement, e.g.: - -.. code-block:: php - - $mock = \Mockery::mock('foo')->shouldReceive('foo')->andReturn(1)->getMock(); diff --git a/vendor/mockery/mockery/docs/reference/final_methods_classes.rst b/vendor/mockery/mockery/docs/reference/final_methods_classes.rst deleted file mode 100644 index dd0fa5b..0000000 --- a/vendor/mockery/mockery/docs/reference/final_methods_classes.rst +++ /dev/null @@ -1,29 +0,0 @@ -.. index:: - single: Mocking; Final Classes/Methods - -Dealing with Final Classes/Methods -================================== - -One of the primary restrictions of mock objects in PHP, is that mocking -classes or methods marked final is hard. The final keyword prevents methods so -marked from being replaced in subclasses (subclassing is how mock objects can -inherit the type of the class or object being mocked). - -The simplest solution is to implement an interface in your final class and -typehint against / mock this. - -However this may not be possible in some third party libraries. -Mockery does allow creating "proxy mocks" from classes marked final, or from -classes with methods marked final. This offers all the usual mock object -goodness but the resulting mock will not inherit the class type of the object -being mocked, i.e. it will not pass any instanceof comparison. Methods marked -as final will be proxied to the original method, i.e., final methods can't be -mocked. - -We can create a proxy mock by passing the instantiated object we wish to -mock into ``\Mockery::mock()``, i.e. Mockery will then generate a Proxy to the -real object and selectively intercept method calls for the purposes of setting -and meeting expectations. - -See the :ref:`creating-test-doubles-partial-test-doubles` chapter, the subsection -about proxied partial test doubles. diff --git a/vendor/mockery/mockery/docs/reference/index.rst b/vendor/mockery/mockery/docs/reference/index.rst deleted file mode 100644 index 1e5bf04..0000000 --- a/vendor/mockery/mockery/docs/reference/index.rst +++ /dev/null @@ -1,22 +0,0 @@ -Reference -========= - -.. toctree:: - :hidden: - - creating_test_doubles - expectations - argument_validation - alternative_should_receive_syntax - spies - partial_mocks - protected_methods - public_properties - public_static_properties - pass_by_reference_behaviours - demeter_chains - final_methods_classes - magic_methods - phpunit_integration - -.. include:: map.rst.inc diff --git a/vendor/mockery/mockery/docs/reference/instance_mocking.rst b/vendor/mockery/mockery/docs/reference/instance_mocking.rst deleted file mode 100644 index 9d1aa28..0000000 --- a/vendor/mockery/mockery/docs/reference/instance_mocking.rst +++ /dev/null @@ -1,22 +0,0 @@ -.. index:: - single: Mocking; Instance - -Instance Mocking -================ - -Instance mocking means that a statement like: - -.. code-block:: php - - $obj = new \MyNamespace\Foo; - -...will actually generate a mock object. This is done by replacing the real -class with an instance mock (similar to an alias mock), as with mocking public -methods. The alias will import its expectations from the original mock of -that type (note that the original is never verified and should be ignored -after its expectations are setup). This lets you intercept instantiation where -you can't simply inject a replacement object. - -As before, this does not prevent a require statement from including the real -class and triggering a fatal PHP error. It's intended for use where -autoloading is the primary class loading mechanism. diff --git a/vendor/mockery/mockery/docs/reference/magic_methods.rst b/vendor/mockery/mockery/docs/reference/magic_methods.rst deleted file mode 100644 index 39591cf..0000000 --- a/vendor/mockery/mockery/docs/reference/magic_methods.rst +++ /dev/null @@ -1,16 +0,0 @@ -.. index:: - single: Mocking; Magic Methods - -PHP Magic Methods -================= - -PHP magic methods which are prefixed with a double underscore, e.g. -``__set()``, pose a particular problem in mocking and unit testing in general. -It is strongly recommended that unit tests and mock objects do not directly -refer to magic methods. Instead, refer only to the virtual methods and -properties these magic methods simulate. - -Following this piece of advice will ensure we are testing the real API of -classes and also ensures there is no conflict should Mockery override these -magic methods, which it will inevitably do in order to support its role in -intercepting method calls and properties. diff --git a/vendor/mockery/mockery/docs/reference/map.rst.inc b/vendor/mockery/mockery/docs/reference/map.rst.inc deleted file mode 100644 index 883bc3c..0000000 --- a/vendor/mockery/mockery/docs/reference/map.rst.inc +++ /dev/null @@ -1,14 +0,0 @@ -* :doc:`/reference/creating_test_doubles` -* :doc:`/reference/expectations` -* :doc:`/reference/argument_validation` -* :doc:`/reference/alternative_should_receive_syntax` -* :doc:`/reference/spies` -* :doc:`/reference/partial_mocks` -* :doc:`/reference/protected_methods` -* :doc:`/reference/public_properties` -* :doc:`/reference/public_static_properties` -* :doc:`/reference/pass_by_reference_behaviours` -* :doc:`/reference/demeter_chains` -* :doc:`/reference/final_methods_classes` -* :doc:`/reference/magic_methods` -* :doc:`/reference/phpunit_integration` diff --git a/vendor/mockery/mockery/docs/reference/partial_mocks.rst b/vendor/mockery/mockery/docs/reference/partial_mocks.rst deleted file mode 100644 index 457eb8d..0000000 --- a/vendor/mockery/mockery/docs/reference/partial_mocks.rst +++ /dev/null @@ -1,108 +0,0 @@ -.. index:: - single: Mocking; Partial Mocks - -Creating Partial Mocks -====================== - -Partial mocks are useful when we only need to mock several methods of an -object leaving the remainder free to respond to calls normally (i.e. as -implemented). Mockery implements three distinct strategies for creating -partials. Each has specific advantages and disadvantages so which strategy we -use will depend on our own preferences and the source code in need of -mocking. - -We have previously talked a bit about :ref:`creating-test-doubles-partial-test-doubles`, -but we'd like to expand on the subject a bit here. - -#. Runtime partial test doubles -#. Generated partial test doubles -#. Proxied Partial Mock - -Runtime partial test doubles ----------------------------- - -A runtime partial test double, also known as a passive partial mock, is a kind -of a default state of being for a mocked object. - -.. code-block:: php - - $mock = \Mockery::mock('MyClass')->makePartial(); - -With a runtime partial, we assume that all methods will simply defer to the -parent class (``MyClass``) original methods unless a method call matches a -known expectation. If we have no matching expectation for a specific method -call, that call is deferred to the class being mocked. Since the division -between mocked and unmocked calls depends entirely on the expectations we -define, there is no need to define which methods to mock in advance. - -See the cookbook entry on :doc:`../cookbook/big_parent_class` for an example -usage of runtime partial test doubles. - -Generated Partial Test Doubles ------------------------------- - -A generated partial test double, also known as a traditional partial mock, -defines ahead of time which methods of a class are to be mocked and which are -to be left unmocked (i.e. callable as normal). The syntax for creating -traditional mocks is: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass[foo,bar]'); - -In the above example, the ``foo()`` and ``bar()`` methods of MyClass will be -mocked but no other MyClass methods are touched. We will need to define -expectations for the ``foo()`` and ``bar()`` methods to dictate their mocked -behaviour. - -Don't forget that we can pass in constructor arguments since unmocked methods -may rely on those! - -.. code-block:: php - - $mock = \Mockery::mock('MyNamespace\MyClass[foo]', array($arg1, $arg2)); - -See the :ref:`creating-test-doubles-constructor-arguments` section to read up -on them. - -.. note:: - - Even though we support generated partial test doubles, we do not recommend - using them. - -Proxied Partial Mock --------------------- - -A proxied partial mock is a partial of last resort. We may encounter a class -which is simply not capable of being mocked because it has been marked as -final. Similarly, we may find a class with methods marked as final. In such a -scenario, we cannot simply extend the class and override methods to mock - we -need to get creative. - -.. code-block:: php - - $mock = \Mockery::mock(new MyClass); - -Yes, the new mock is a Proxy. It intercepts calls and reroutes them to the -proxied object (which we construct and pass in) for methods which are not -subject to any expectations. Indirectly, this allows us to mock methods -marked final since the Proxy is not subject to those limitations. The tradeoff -should be obvious - a proxied partial will fail any typehint checks for the -class being mocked since it cannot extend that class. - -Special Internal Cases ----------------------- - -All mock objects, with the exception of Proxied Partials, allows us to make -any expectation call to the underlying real class method using the ``passthru()`` -expectation call. This will return values from the real call and bypass any -mocked return queue (which can simply be omitted obviously). - -There is a fourth kind of partial mock reserved for internal use. This is -automatically generated when we attempt to mock a class containing methods -marked final. Since we cannot override such methods, they are simply left -unmocked. Typically, we don't need to worry about this but if we really -really must mock a final method, the only possible means is through a Proxied -Partial Mock. SplFileInfo, for example, is a common class subject to this form -of automatic internal partial since it contains public final methods used -internally. diff --git a/vendor/mockery/mockery/docs/reference/pass_by_reference_behaviours.rst b/vendor/mockery/mockery/docs/reference/pass_by_reference_behaviours.rst deleted file mode 100644 index 5e2e457..0000000 --- a/vendor/mockery/mockery/docs/reference/pass_by_reference_behaviours.rst +++ /dev/null @@ -1,130 +0,0 @@ -.. index:: - single: Pass-By-Reference Method Parameter Behaviour - -Preserving Pass-By-Reference Method Parameter Behaviour -======================================================= - -PHP Class method may accept parameters by reference. In this case, changes -made to the parameter (a reference to the original variable passed to the -method) are reflected in the original variable. An example: - -.. code-block:: php - - class Foo - { - - public function bar(&$a) - { - $a++; - } - - } - - $baz = 1; - $foo = new Foo; - $foo->bar($baz); - - echo $baz; // will echo the integer 2 - -In the example above, the variable ``$baz`` is passed by reference to -``Foo::bar()`` (notice the ``&`` symbol in front of the parameter?). Any -change ``bar()`` makes to the parameter reference is reflected in the original -variable, ``$baz``. - -Mockery handles references correctly for all methods where it can analyse -the parameter (using ``Reflection``) to see if it is passed by reference. To -mock how a reference is manipulated by the class method, we can use a closure -argument matcher to manipulate it, i.e. ``\Mockery::on()`` - see the -:ref:`argument-validation-complex-argument-validation` chapter. - -There is an exception for internal PHP classes where Mockery cannot analyse -method parameters using ``Reflection`` (a limitation in PHP). To work around -this, we can explicitly declare method parameters for an internal class using -``\Mockery\Configuration::setInternalClassMethodParamMap()``. - -Here's an example using ``MongoCollection::insert()``. ``MongoCollection`` is -an internal class offered by the mongo extension from PECL. Its ``insert()`` -method accepts an array of data as the first parameter, and an optional -options array as the second parameter. The original data array is updated -(i.e. when a ``insert()`` pass-by-reference parameter) to include a new -``_id`` field. We can mock this behaviour using a configured parameter map (to -tell Mockery to expect a pass by reference parameter) and a ``Closure`` -attached to the expected method parameter to be updated. - -Here's a PHPUnit unit test verifying that this pass-by-reference behaviour is -preserved: - -.. code-block:: php - - public function testCanOverrideExpectedParametersOfInternalPHPClassesToPreserveRefs() - { - \Mockery::getConfiguration()->setInternalClassMethodParamMap( - 'MongoCollection', - 'insert', - array('&$data', '$options = array()') - ); - $m = \Mockery::mock('MongoCollection'); - $m->shouldReceive('insert')->with( - \Mockery::on(function(&$data) { - if (!is_array($data)) return false; - $data['_id'] = 123; - return true; - }), - \Mockery::any() - ); - - $data = array('a'=>1,'b'=>2); - $m->insert($data); - - $this->assertTrue(isset($data['_id'])); - $this->assertEquals(123, $data['_id']); - - \Mockery::resetContainer(); - } - -Protected Methods ------------------ - -When dealing with protected methods, and trying to preserve pass by reference -behavior for them, a different approach is required. - -.. code-block:: php - - class Model - { - public function test(&$data) - { - return $this->doTest($data); - } - - protected function doTest(&$data) - { - $data['something'] = 'wrong'; - return $this; - } - } - - class Test extends \PHPUnit\Framework\TestCase - { - public function testModel() - { - $mock = \Mockery::mock('Model[test]')->shouldAllowMockingProtectedMethods(); - - $mock->shouldReceive('test') - ->with(\Mockery::on(function(&$data) { - $data['something'] = 'wrong'; - return true; - })); - - $data = array('foo' => 'bar'); - - $mock->test($data); - $this->assertTrue(isset($data['something'])); - $this->assertEquals('wrong', $data['something']); - } - } - -This is quite an edge case, so we need to change the original code a little bit, -by creating a public method that will call our protected method, and then mock -that, instead of the protected method. This new public method will act as a -proxy to our protected method. diff --git a/vendor/mockery/mockery/docs/reference/phpunit_integration.rst b/vendor/mockery/mockery/docs/reference/phpunit_integration.rst deleted file mode 100644 index 669a8ca..0000000 --- a/vendor/mockery/mockery/docs/reference/phpunit_integration.rst +++ /dev/null @@ -1,145 +0,0 @@ -.. index:: - single: PHPUnit Integration - -PHPUnit Integration -=================== - -Mockery was designed as a simple-to-use *standalone* mock object framework, so -its need for integration with any testing framework is entirely optional. To -integrate Mockery, we need to define a ``tearDown()`` method for our tests -containing the following (we may use a shorter ``\Mockery`` namespace -alias): - -.. code-block:: php - - public function tearDown() { - \Mockery::close(); - } - -This static call cleans up the Mockery container used by the current test, and -run any verification tasks needed for our expectations. - -For some added brevity when it comes to using Mockery, we can also explicitly -use the Mockery namespace with a shorter alias. For example: - -.. code-block:: php - - use \Mockery as m; - - class SimpleTest extends \PHPUnit\Framework\TestCase - { - public function testSimpleMock() { - $mock = m::mock('simplemock'); - $mock->shouldReceive('foo')->with(5, m::any())->once()->andReturn(10); - - $this->assertEquals(10, $mock->foo(5)); - } - - public function tearDown() { - m::close(); - } - } - -Mockery ships with an autoloader so we don't need to litter our tests with -``require_once()`` calls. To use it, ensure Mockery is on our -``include_path`` and add the following to our test suite's ``Bootstrap.php`` -or ``TestHelper.php`` file: - -.. code-block:: php - - require_once 'Mockery/Loader.php'; - require_once 'Hamcrest/Hamcrest.php'; - - $loader = new \Mockery\Loader; - $loader->register(); - -If we are using Composer, we can simplify this to including the Composer -generated autoloader file: - -.. code-block:: php - - require __DIR__ . '/../vendor/autoload.php'; // assuming vendor is one directory up - -.. caution:: - - Prior to Hamcrest 1.0.0, the ``Hamcrest.php`` file name had a small "h" - (i.e. ``hamcrest.php``). If upgrading Hamcrest to 1.0.0 remember to check - the file name is updated for all your projects.) - -To integrate Mockery into PHPUnit and avoid having to call the close method -and have Mockery remove itself from code coverage reports, have your test case -extends the ``\Mockery\Adapter\Phpunit\MockeryTestCase``: - -.. code-block:: php - - class MyTest extends \Mockery\Adapter\Phpunit\MockeryTestCase - { - - } - -An alternative is to use the supplied trait: - -.. code-block:: php - - class MyTest extends \PHPUnit\Framework\TestCase - { - use \Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration; - } - -Extending ``MockeryTestCase`` or using the ``MockeryPHPUnitIntegration`` -trait is **the recommended way** of integrating Mockery with PHPUnit, -since Mockery 1.0.0. - -PHPUnit listener ----------------- - -Before the 1.0.0 release, Mockery provided a PHPUnit listener that would -call ``Mockery::close()`` for us at the end of a test. This has changed -significantly since the 1.0.0 version. - -Now, Mockery provides a PHPUnit listener that makes tests fail if -``Mockery::close()`` has not been called. It can help identify tests where -we've forgotten to include the trait or extend the ``MockeryTestCase``. - -If we are using PHPUnit's XML configuration approach, we can include the -following to load the ``TestListener``: - -.. code-block:: xml - - - - - -Make sure Composer's or Mockery's autoloader is present in the bootstrap file -or we will need to also define a "file" attribute pointing to the file of the -``TestListener`` class. - -If we are creating the test suite programmatically we may add the listener -like this: - -.. code-block:: php - - // Create the suite. - $suite = new PHPUnit\Framework\TestSuite(); - - // Create the listener and add it to the suite. - $result = new PHPUnit\Framework\TestResult(); - $result->addListener(new \Mockery\Adapter\Phpunit\TestListener()); - - // Run the tests. - $suite->run($result); - -.. caution:: - - PHPUnit provides a functionality that allows - `tests to run in a separated process `_, - to ensure better isolation. Mockery verifies the mocks expectations using the - ``Mockery::close()`` method, and provides a PHPUnit listener, that automatically - calls this method for us after every test. - - However, this listener is not called in the right process when using - PHPUnit's process isolation, resulting in expectations that might not be - respected, but without raising any ``Mockery\Exception``. To avoid this, - we cannot rely on the supplied Mockery PHPUnit ``TestListener``, and we need - to explicitly call ``Mockery::close``. The easiest solution to include this - call in the ``tearDown()`` method, as explained previously. diff --git a/vendor/mockery/mockery/docs/reference/protected_methods.rst b/vendor/mockery/mockery/docs/reference/protected_methods.rst deleted file mode 100644 index ec4a5ba..0000000 --- a/vendor/mockery/mockery/docs/reference/protected_methods.rst +++ /dev/null @@ -1,26 +0,0 @@ -.. index:: - single: Mocking; Protected Methods - -Mocking Protected Methods -========================= - -By default, Mockery does not allow mocking protected methods. We do not recommend -mocking protected methods, but there are cases when there is no other solution. - -For those cases we have the ``shouldAllowMockingProtectedMethods()`` method. It -instructs Mockery to specifically allow mocking of protected methods, for that -one class only: - -.. code-block:: php - - class MyClass - { - protected function foo() - { - } - } - - $mock = \Mockery::mock('MyClass') - ->shouldAllowMockingProtectedMethods(); - $mock->shouldReceive('foo'); - diff --git a/vendor/mockery/mockery/docs/reference/public_properties.rst b/vendor/mockery/mockery/docs/reference/public_properties.rst deleted file mode 100644 index 3165668..0000000 --- a/vendor/mockery/mockery/docs/reference/public_properties.rst +++ /dev/null @@ -1,20 +0,0 @@ -.. index:: - single: Mocking; Public Properties - -Mocking Public Properties -========================= - -Mockery allows us to mock properties in several ways. One way is that we can set -a public property and its value on any mock object. The second is that we can -use the expectation methods ``set()`` and ``andSet()`` to set property values if -that expectation is ever met. - -You can read more about :ref:`expectations-setting-public-properties`. - -.. note:: - - In general, Mockery does not support mocking any magic methods since these - are generally not considered a public API (and besides it is a bit difficult - to differentiate them when you badly need them for mocking!). So please mock - virtual properties (those relying on ``__get()`` and ``__set()``) as if they - were actually declared on the class. diff --git a/vendor/mockery/mockery/docs/reference/public_static_properties.rst b/vendor/mockery/mockery/docs/reference/public_static_properties.rst deleted file mode 100644 index 2396efc..0000000 --- a/vendor/mockery/mockery/docs/reference/public_static_properties.rst +++ /dev/null @@ -1,15 +0,0 @@ -.. index:: - single: Mocking; Public Static Methods - -Mocking Public Static Methods -============================= - -Static methods are not called on real objects, so normal mock objects can't -mock them. Mockery supports class aliased mocks, mocks representing a class -name which would normally be loaded (via autoloading or a require statement) -in the system under test. These aliases block that loading (unless via a -require statement - so please use autoloading!) and allow Mockery to intercept -static method calls and add expectations for them. - -See the :ref:`creating-test-doubles-aliasing` section for more information on -creating aliased mocks, for the purpose of mocking public static methods. diff --git a/vendor/mockery/mockery/docs/reference/spies.rst b/vendor/mockery/mockery/docs/reference/spies.rst deleted file mode 100644 index 77f37f3..0000000 --- a/vendor/mockery/mockery/docs/reference/spies.rst +++ /dev/null @@ -1,154 +0,0 @@ -.. index:: - single: Reference; Spies - -Spies -===== - -Spies are a type of test doubles, but they differ from stubs or mocks in that, -that the spies record any interaction between the spy and the System Under Test -(SUT), and allow us to make assertions against those interactions after the fact. - -Creating a spy means we don't have to set up expectations for every method call -the double might receive during the test, some of which may not be relevant to -the current test. A spy allows us to make assertions about the calls we care -about for this test only, reducing the chances of over-specification and making -our tests more clear. - -Spies also allow us to follow the more familiar Arrange-Act-Assert or -Given-When-Then style within our tests. With mocks, we have to follow a less -familiar style, something along the lines of Arrange-Expect-Act-Assert, where -we have to tell our mocks what to expect before we act on the sut, then assert -that those expectations where met: - -.. code-block:: php - - // arrange - $mock = \Mockery::mock('MyDependency'); - $sut = new MyClass($mock); - - // expect - $mock->shouldReceive('foo') - ->once() - ->with('bar'); - - // act - $sut->callFoo(); - - // assert - \Mockery::close(); - -Spies allow us to skip the expect part and move the assertion to after we have -acted on the SUT, usually making our tests more readable: - -.. code-block:: php - - // arrange - $spy = \Mockery::spy('MyDependency'); - $sut = new MyClass($spy); - - // act - $sut->callFoo(); - - // assert - $spy->shouldHaveReceived() - ->foo() - ->with('bar'); - -On the other hand, spies are far less restrictive than mocks, meaning tests are -usually less precise, as they let us get away with more. This is usually a -good thing, they should only be as precise as they need to be, but while spies -make our tests more intent-revealing, they do tend to reveal less about the -design of the SUT. If we're having to setup lots of expectations for a mock, -in lots of different tests, our tests are trying to tell us something - the SUT -is doing too much and probably should be refactored. We don't get this with -spies, they simply ignore the calls that aren't relevant to them. - -Another downside to using spies is debugging. When a mock receives a call that -it wasn't expecting, it immediately throws an exception (failing fast), giving -us a nice stack trace or possibly even invoking our debugger. With spies, we're -simply asserting calls were made after the fact, so if the wrong calls were made, -we don't have quite the same just in time context we have with the mocks. - -Finally, if we need to define a return value for our test double, we can't do -that with a spy, only with a mock object. - -.. note:: - - This documentation page is an adaption of the blog post titled - `"Mockery Spies" `_, - published by Dave Marshall on his blog. Dave is the original author of spies - in Mockery. - -Spies Reference ---------------- - -To verify that a method was called on a spy, we use the ``shouldHaveReceived()`` -method: - -.. code-block:: php - - $spy->shouldHaveReceived('foo'); - -To verify that a method was **not** called on a spy, we use the -``shouldNotHaveReceived()`` method: - -.. code-block:: php - - $spy->shouldNotHaveReceived('foo'); - -We can also do argument matching with spies: - -.. code-block:: php - - $spy->shouldHaveReceived('foo') - ->with('bar'); - -Argument matching is also possible by passing in an array of arguments to -match: - -.. code-block:: php - - $spy->shouldHaveReceived('foo', ['bar']); - -Although when verifying a method was not called, the argument matching can only -be done by supplying the array of arguments as the 2nd argument to the -``shouldNotHaveReceived()`` method: - -.. code-block:: php - - $spy->shouldNotHaveReceived('foo', ['bar']); - -This is due to Mockery's internals. - -Finally, when expecting calls that should have been received, we can also verify -the number of calls: - -.. code-block:: php - - $spy->shouldHaveReceived('foo') - ->with('bar') - ->twice(); - -Alternative shouldReceive syntax -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -As of Mockery 1.0.0, we support calling methods as we would call any PHP method, -and not as string arguments to Mockery ``should*`` methods. - -In cases of spies, this only applies to the ``shouldHaveReceived()`` method: - -.. code-block:: php - - $spy->shouldHaveReceived() - ->foo('bar'); - -We can set expectation on number of calls as well: - -.. code-block:: php - - $spy->shouldHaveReceived() - ->foo('bar') - ->twice(); - -Unfortunately, due to limitations we can't support the same syntax for the -``shouldNotHaveReceived()`` method. diff --git a/vendor/mockery/mockery/library/Mockery.php b/vendor/mockery/mockery/library/Mockery.php deleted file mode 100644 index e147df1..0000000 --- a/vendor/mockery/mockery/library/Mockery.php +++ /dev/null @@ -1,983 +0,0 @@ -shouldIgnoreMissing(); - } - - /** - * Static and Semantic shortcut to \Mockery\Container::mock(). - * - * @param mixed ...$args - * - * @return \Mockery\MockInterface|\Mockery\LegacyMockInterface - */ - public static function instanceMock(...$args) - { - return call_user_func_array(array(self::getContainer(), 'mock'), $args); - } - - /** - * Static shortcut to \Mockery\Container::mock(), first argument names the mock. - * - * @param mixed ...$args - * - * @return \Mockery\MockInterface|\Mockery\LegacyMockInterface - */ - public static function namedMock(...$args) - { - $name = array_shift($args); - - $builder = new MockConfigurationBuilder(); - $builder->setName($name); - - array_unshift($args, $builder); - - return call_user_func_array(array(self::getContainer(), 'mock'), $args); - } - - /** - * Static shortcut to \Mockery\Container::self(). - * - * @throws LogicException - * - * @return \Mockery\MockInterface|\Mockery\LegacyMockInterface - */ - public static function self() - { - if (is_null(self::$_container)) { - throw new \LogicException('You have not declared any mocks yet'); - } - - return self::$_container->self(); - } - - /** - * Static shortcut to closing up and verifying all mocks in the global - * container, and resetting the container static variable to null. - * - * @return void - */ - public static function close() - { - foreach (self::$_filesToCleanUp as $fileName) { - @unlink($fileName); - } - self::$_filesToCleanUp = []; - - if (is_null(self::$_container)) { - return; - } - - $container = self::$_container; - self::$_container = null; - - $container->mockery_teardown(); - $container->mockery_close(); - } - - /** - * Static fetching of a mock associated with a name or explicit class poser. - * - * @param string $name - * - * @return \Mockery\Mock - */ - public static function fetchMock($name) - { - return self::getContainer()->fetchMock($name); - } - - /** - * Lazy loader and getter for - * the container property. - * - * @return Mockery\Container - */ - public static function getContainer() - { - if (is_null(self::$_container)) { - self::$_container = new Mockery\Container(self::getGenerator(), self::getLoader()); - } - - return self::$_container; - } - - /** - * Setter for the $_generator static property. - * - * @param \Mockery\Generator\Generator $generator - */ - public static function setGenerator(Generator $generator) - { - self::$_generator = $generator; - } - - /** - * Lazy loader method and getter for - * the generator property. - * - * @return Generator - */ - public static function getGenerator() - { - if (is_null(self::$_generator)) { - self::$_generator = self::getDefaultGenerator(); - } - - return self::$_generator; - } - - /** - * Creates and returns a default generator - * used inside this class. - * - * @return CachingGenerator - */ - public static function getDefaultGenerator() - { - return new CachingGenerator(StringManipulationGenerator::withDefaultPasses()); - } - - /** - * Setter for the $_loader static property. - * - * @param Loader $loader - */ - public static function setLoader(Loader $loader) - { - self::$_loader = $loader; - } - - /** - * Lazy loader method and getter for - * the $_loader property. - * - * @return Loader - */ - public static function getLoader() - { - if (is_null(self::$_loader)) { - self::$_loader = self::getDefaultLoader(); - } - - return self::$_loader; - } - - /** - * Gets an EvalLoader to be used as default. - * - * @return EvalLoader - */ - public static function getDefaultLoader() - { - return new EvalLoader(); - } - - /** - * Set the container. - * - * @param \Mockery\Container $container - * - * @return \Mockery\Container - */ - public static function setContainer(Mockery\Container $container) - { - return self::$_container = $container; - } - - /** - * Reset the container to null. - * - * @return void - */ - public static function resetContainer() - { - self::$_container = null; - } - - /** - * Return instance of ANY matcher. - * - * @return \Mockery\Matcher\Any - */ - public static function any() - { - return new \Mockery\Matcher\Any(); - } - - /** - * Return instance of AndAnyOtherArgs matcher. - * - * An alternative name to `andAnyOtherArgs` so - * the API stays closer to `any` as well. - * - * @return \Mockery\Matcher\AndAnyOtherArgs - */ - public static function andAnyOthers() - { - return new \Mockery\Matcher\AndAnyOtherArgs(); - } - - /** - * Return instance of AndAnyOtherArgs matcher. - * - * @return \Mockery\Matcher\AndAnyOtherArgs - */ - public static function andAnyOtherArgs() - { - return new \Mockery\Matcher\AndAnyOtherArgs(); - } - - /** - * Return instance of TYPE matcher. - * - * @param mixed $expected - * - * @return \Mockery\Matcher\Type - */ - public static function type($expected) - { - return new \Mockery\Matcher\Type($expected); - } - - /** - * Return instance of DUCKTYPE matcher. - * - * @param array ...$args - * - * @return \Mockery\Matcher\Ducktype - */ - public static function ducktype(...$args) - { - return new \Mockery\Matcher\Ducktype($args); - } - - /** - * Return instance of SUBSET matcher. - * - * @param array $part - * @param bool $strict - (Optional) True for strict comparison, false for loose - * - * @return \Mockery\Matcher\Subset - */ - public static function subset(array $part, $strict = true) - { - return new \Mockery\Matcher\Subset($part, $strict); - } - - /** - * Return instance of CONTAINS matcher. - * - * @param mixed $args - * - * @return \Mockery\Matcher\Contains - */ - public static function contains(...$args) - { - return new \Mockery\Matcher\Contains($args); - } - - /** - * Return instance of HASKEY matcher. - * - * @param mixed $key - * - * @return \Mockery\Matcher\HasKey - */ - public static function hasKey($key) - { - return new \Mockery\Matcher\HasKey($key); - } - - /** - * Return instance of HASVALUE matcher. - * - * @param mixed $val - * - * @return \Mockery\Matcher\HasValue - */ - public static function hasValue($val) - { - return new \Mockery\Matcher\HasValue($val); - } - - /** - * Return instance of CLOSURE matcher. - * - * @param $reference - * - * @return \Mockery\Matcher\Closure - */ - public static function capture(&$reference) - { - $closure = function ($argument) use (&$reference) { - $reference = $argument; - return true; - }; - - return new \Mockery\Matcher\Closure($closure); - } - - /** - * Return instance of CLOSURE matcher. - * - * @param mixed $closure - * - * @return \Mockery\Matcher\Closure - */ - public static function on($closure) - { - return new \Mockery\Matcher\Closure($closure); - } - - /** - * Return instance of MUSTBE matcher. - * - * @param mixed $expected - * - * @return \Mockery\Matcher\MustBe - */ - public static function mustBe($expected) - { - return new \Mockery\Matcher\MustBe($expected); - } - - /** - * Return instance of NOT matcher. - * - * @param mixed $expected - * - * @return \Mockery\Matcher\Not - */ - public static function not($expected) - { - return new \Mockery\Matcher\Not($expected); - } - - /** - * Return instance of ANYOF matcher. - * - * @param array ...$args - * - * @return \Mockery\Matcher\AnyOf - */ - public static function anyOf(...$args) - { - return new \Mockery\Matcher\AnyOf($args); - } - - /** - * Return instance of NOTANYOF matcher. - * - * @param array ...$args - * - * @return \Mockery\Matcher\NotAnyOf - */ - public static function notAnyOf(...$args) - { - return new \Mockery\Matcher\NotAnyOf($args); - } - - /** - * Return instance of PATTERN matcher. - * - * @param mixed $expected - * - * @return \Mockery\Matcher\Pattern - */ - public static function pattern($expected) - { - return new \Mockery\Matcher\Pattern($expected); - } - - /** - * Lazy loader and Getter for the global - * configuration container. - * - * @return \Mockery\Configuration - */ - public static function getConfiguration() - { - if (is_null(self::$_config)) { - self::$_config = new \Mockery\Configuration(); - } - - return self::$_config; - } - - /** - * Utility method to format method name and arguments into a string. - * - * @param string $method - * @param array $arguments - * - * @return string - */ - public static function formatArgs($method, array $arguments = null) - { - if (is_null($arguments)) { - return $method . '()'; - } - - $formattedArguments = array(); - foreach ($arguments as $argument) { - $formattedArguments[] = self::formatArgument($argument); - } - - return $method . '(' . implode(', ', $formattedArguments) . ')'; - } - - /** - * Gets the string representation - * of any passed argument. - * - * @param mixed $argument - * @param int $depth - * - * @return mixed - */ - private static function formatArgument($argument, $depth = 0) - { - if ($argument instanceof MatcherAbstract) { - return (string) $argument; - } - - if (is_object($argument)) { - return 'object(' . get_class($argument) . ')'; - } - - if (is_int($argument) || is_float($argument)) { - return $argument; - } - - if (is_array($argument)) { - if ($depth === 1) { - $argument = '[...]'; - } else { - $sample = array(); - foreach ($argument as $key => $value) { - $key = is_int($key) ? $key : "'$key'"; - $value = self::formatArgument($value, $depth + 1); - $sample[] = "$key => $value"; - } - - $argument = "[" . implode(", ", $sample) . "]"; - } - - return ((strlen($argument) > 1000) ? substr($argument, 0, 1000) . '...]' : $argument); - } - - if (is_bool($argument)) { - return $argument ? 'true' : 'false'; - } - - if (is_resource($argument)) { - return 'resource(...)'; - } - - if (is_null($argument)) { - return 'NULL'; - } - - return "'" . (string) $argument . "'"; - } - - /** - * Utility function to format objects to printable arrays. - * - * @param array $objects - * - * @return string - */ - public static function formatObjects(array $objects = null) - { - static $formatting; - - if ($formatting) { - return '[Recursion]'; - } - - if (is_null($objects)) { - return ''; - } - - $objects = array_filter($objects, 'is_object'); - if (empty($objects)) { - return ''; - } - - $formatting = true; - $parts = array(); - - foreach ($objects as $object) { - $parts[get_class($object)] = self::objectToArray($object); - } - - $formatting = false; - - return 'Objects: ( ' . var_export($parts, true) . ')'; - } - - /** - * Utility function to turn public properties and public get* and is* method values into an array. - * - * @param object $object - * @param int $nesting - * - * @return array - */ - private static function objectToArray($object, $nesting = 3) - { - if ($nesting == 0) { - return array('...'); - } - - $defaultFormatter = function ($object, $nesting) { - return array('properties' => self::extractInstancePublicProperties($object, $nesting)); - }; - - $class = get_class($object); - - $formatter = self::getConfiguration()->getObjectFormatter($class, $defaultFormatter); - - $array = array( - 'class' => $class, - 'identity' => '#' . md5(spl_object_hash($object)) - ); - - $array = array_merge($array, $formatter($object, $nesting)); - - return $array; - } - - /** - * Returns all public instance properties. - * - * @param mixed $object - * @param int $nesting - * - * @return array - */ - private static function extractInstancePublicProperties($object, $nesting) - { - $reflection = new \ReflectionClass(get_class($object)); - $properties = $reflection->getProperties(\ReflectionProperty::IS_PUBLIC); - $cleanedProperties = array(); - - foreach ($properties as $publicProperty) { - if (!$publicProperty->isStatic()) { - $name = $publicProperty->getName(); - try { - $cleanedProperties[$name] = self::cleanupNesting($object->$name, $nesting); - } catch (\Exception $exception) { - $cleanedProperties[$name] = $exception->getMessage(); - } - } - } - - return $cleanedProperties; - } - - /** - * Utility method used for recursively generating - * an object or array representation. - * - * @param mixed $argument - * @param int $nesting - * - * @return mixed - */ - private static function cleanupNesting($argument, $nesting) - { - if (is_object($argument)) { - $object = self::objectToArray($argument, $nesting - 1); - $object['class'] = get_class($argument); - - return $object; - } - - if (is_array($argument)) { - return self::cleanupArray($argument, $nesting - 1); - } - - return $argument; - } - - /** - * Utility method for recursively - * gerating a representation - * of the given array. - * - * @param array $argument - * @param int $nesting - * - * @return mixed - */ - private static function cleanupArray($argument, $nesting = 3) - { - if ($nesting == 0) { - return '...'; - } - - foreach ($argument as $key => $value) { - if (is_array($value)) { - $argument[$key] = self::cleanupArray($value, $nesting - 1); - } elseif (is_object($value)) { - $argument[$key] = self::objectToArray($value, $nesting - 1); - } - } - - return $argument; - } - - /** - * Utility function to parse shouldReceive() arguments and generate - * expectations from such as needed. - * - * @param Mockery\LegacyMockInterface $mock - * @param array ...$args - * @param callable $add - * @return \Mockery\CompositeExpectation - */ - public static function parseShouldReturnArgs(\Mockery\LegacyMockInterface $mock, $args, $add) - { - $composite = new \Mockery\CompositeExpectation(); - - foreach ($args as $arg) { - if (is_array($arg)) { - foreach ($arg as $k => $v) { - $expectation = self::buildDemeterChain($mock, $k, $add)->andReturn($v); - $composite->add($expectation); - } - } elseif (is_string($arg)) { - $expectation = self::buildDemeterChain($mock, $arg, $add); - $composite->add($expectation); - } - } - - return $composite; - } - - /** - * Sets up expectations on the members of the CompositeExpectation and - * builds up any demeter chain that was passed to shouldReceive. - * - * @param \Mockery\LegacyMockInterface $mock - * @param string $arg - * @param callable $add - * @throws Mockery\Exception - * @return \Mockery\ExpectationInterface - */ - protected static function buildDemeterChain(\Mockery\LegacyMockInterface $mock, $arg, $add) - { - /** @var Mockery\Container $container */ - $container = $mock->mockery_getContainer(); - $methodNames = explode('->', $arg); - reset($methodNames); - - if (!\Mockery::getConfiguration()->mockingNonExistentMethodsAllowed() - && !$mock->mockery_isAnonymous() - && !in_array(current($methodNames), $mock->mockery_getMockableMethods()) - ) { - throw new \Mockery\Exception( - 'Mockery\'s configuration currently forbids mocking the method ' - . current($methodNames) . ' as it does not exist on the class or object ' - . 'being mocked' - ); - } - - /** @var ExpectationInterface|null $expectations */ - $expectations = null; - - /** @var Callable $nextExp */ - $nextExp = function ($method) use ($add) { - return $add($method); - }; - - $parent = get_class($mock); - - while (true) { - $method = array_shift($methodNames); - $expectations = $mock->mockery_getExpectationsFor($method); - - if (is_null($expectations) || self::noMoreElementsInChain($methodNames)) { - $expectations = $nextExp($method); - if (self::noMoreElementsInChain($methodNames)) { - break; - } - - $mock = self::getNewDemeterMock($container, $parent, $method, $expectations); - } else { - $demeterMockKey = $container->getKeyOfDemeterMockFor($method, $parent); - if ($demeterMockKey) { - $mock = self::getExistingDemeterMock($container, $demeterMockKey); - } - } - - $parent .= '->' . $method; - - $nextExp = function ($n) use ($mock) { - return $mock->shouldReceive($n); - }; - } - - return $expectations; - } - - /** - * Gets a new demeter configured - * mock from the container. - * - * @param \Mockery\Container $container - * @param string $parent - * @param string $method - * @param Mockery\ExpectationInterface $exp - * - * @return \Mockery\Mock - */ - private static function getNewDemeterMock( - Mockery\Container $container, - $parent, - $method, - Mockery\ExpectationInterface $exp - ) { - $newMockName = 'demeter_' . md5($parent) . '_' . $method; - - $parRef = null; - $parRefMethod = null; - $parRefMethodRetType = null; - - $parentMock = $exp->getMock(); - if ($parentMock !== null) { - $parRef = new ReflectionObject($parentMock); - } - - if ($parRef !== null && $parRef->hasMethod($method)) { - $parRefMethod = $parRef->getMethod($method); - $parRefMethodRetType = Reflector::getReturnType($parRefMethod, true); - - if ($parRefMethodRetType !== null) { - $nameBuilder = new MockNameBuilder(); - $nameBuilder->addPart('\\' . $newMockName); - $mock = self::namedMock($nameBuilder->build(), $parRefMethodRetType); - $exp->andReturn($mock); - - return $mock; - } - } - - $mock = $container->mock($newMockName); - $exp->andReturn($mock); - - return $mock; - } - - /** - * Gets an specific demeter mock from - * the ones kept by the container. - * - * @param \Mockery\Container $container - * @param string $demeterMockKey - * - * @return mixed - */ - private static function getExistingDemeterMock( - Mockery\Container $container, - $demeterMockKey - ) { - $mocks = $container->getMocks(); - $mock = $mocks[$demeterMockKey]; - - return $mock; - } - - /** - * Checks if the passed array representing a demeter - * chain with the method names is empty. - * - * @param array $methodNames - * - * @return bool - */ - private static function noMoreElementsInChain(array $methodNames) - { - return empty($methodNames); - } - - public static function declareClass($fqn) - { - return static::declareType($fqn, "class"); - } - - public static function declareInterface($fqn) - { - return static::declareType($fqn, "interface"); - } - - private static function declareType($fqn, $type) - { - $targetCode = "addMockeryExpectationsToAssertionCount(); - $this->checkMockeryExceptions(); - $this->closeMockery(); - - parent::assertPostConditions(); - } - - protected function addMockeryExpectationsToAssertionCount() - { - $this->addToAssertionCount(Mockery::getContainer()->mockery_getExpectationCount()); - } - - protected function checkMockeryExceptions() - { - if (!method_exists($this, "markAsRisky")) { - return; - } - - foreach (Mockery::getContainer()->mockery_thrownExceptions() as $e) { - if (!$e->dismissed()) { - $this->markAsRisky(); - } - } - } - - protected function closeMockery() - { - Mockery::close(); - $this->mockeryOpen = false; - } - - /** - * @before - */ - protected function startMockery() - { - $this->mockeryOpen = true; - } - - /** - * @after - */ - protected function purgeMockeryContainer() - { - if ($this->mockeryOpen) { - // post conditions wasn't called, so test probably failed - Mockery::close(); - } - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/MockeryPHPUnitIntegrationAssertPostConditions.php b/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/MockeryPHPUnitIntegrationAssertPostConditions.php deleted file mode 100644 index 68fc89e..0000000 --- a/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/MockeryPHPUnitIntegrationAssertPostConditions.php +++ /dev/null @@ -1,31 +0,0 @@ -mockeryAssertPostConditions(); - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/MockeryTestCase.php b/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/MockeryTestCase.php deleted file mode 100644 index f18ce2c..0000000 --- a/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/MockeryTestCase.php +++ /dev/null @@ -1,35 +0,0 @@ -mockeryTestSetUp(); - } - - protected function tearDown(): void - { - $this->mockeryTestTearDown(); - parent::tearDown(); - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/TestListener.php b/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/TestListener.php deleted file mode 100644 index effb8e4..0000000 --- a/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/TestListener.php +++ /dev/null @@ -1,48 +0,0 @@ -trait = new TestListenerTrait(); - } - - public function endTest(Test $test, float $time): void - { - $this->trait->endTest($test, $time); - } - - public function startTestSuite(TestSuite $suite): void - { - $this->trait->startTestSuite(); - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/TestListenerTrait.php b/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/TestListenerTrait.php deleted file mode 100644 index 7b5bfe9..0000000 --- a/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/TestListenerTrait.php +++ /dev/null @@ -1,87 +0,0 @@ -getStatus() !== BaseTestRunner::STATUS_PASSED) { - // If the test didn't pass there is no guarantee that - // verifyMockObjects and assertPostConditions have been called. - // And even if it did, the point here is to prevent false - // negatives, not to make failing tests fail for more reasons. - return; - } - - try { - // The self() call is used as a sentinel. Anything that throws if - // the container is closed already will do. - \Mockery::self(); - } catch (\LogicException $_) { - return; - } - - $e = new ExpectationFailedException( - \sprintf( - "Mockery's expectations have not been verified. Make sure that \Mockery::close() is called at the end of the test. Consider using %s\MockeryPHPUnitIntegration or extending %s\MockeryTestCase.", - __NAMESPACE__, - __NAMESPACE__ - ) - ); - - /** @var \PHPUnit\Framework\TestResult $result */ - $result = $test->getTestResultObject(); - - if ($result !== null) { - $result->addFailure($test, $e, $time); - } - } - - public function startTestSuite() - { - if (method_exists(Blacklist::class, 'addDirectory')) { - (new BlackList())->getBlacklistedDirectories(); - Blacklist::addDirectory(\dirname((new \ReflectionClass(\Mockery::class))->getFileName())); - } else { - Blacklist::$blacklistedClassNames[\Mockery::class] = 1; - } - } -} diff --git a/vendor/mockery/mockery/library/Mockery/ClosureWrapper.php b/vendor/mockery/mockery/library/Mockery/ClosureWrapper.php deleted file mode 100644 index 35ca16d..0000000 --- a/vendor/mockery/mockery/library/Mockery/ClosureWrapper.php +++ /dev/null @@ -1,42 +0,0 @@ -closure = $closure; - } - - public function __invoke() - { - return call_user_func_array($this->closure, func_get_args()); - } -} diff --git a/vendor/mockery/mockery/library/Mockery/CompositeExpectation.php b/vendor/mockery/mockery/library/Mockery/CompositeExpectation.php deleted file mode 100644 index 5231432..0000000 --- a/vendor/mockery/mockery/library/Mockery/CompositeExpectation.php +++ /dev/null @@ -1,154 +0,0 @@ -_expectations[] = $expectation; - } - - /** - * @param mixed ...$args - */ - public function andReturn(...$args) - { - return $this->__call(__FUNCTION__, $args); - } - - /** - * Set a return value, or sequential queue of return values - * - * @param mixed ...$args - * @return self - */ - public function andReturns(...$args) - { - return call_user_func_array([$this, 'andReturn'], $args); - } - - /** - * Intercept any expectation calls and direct against all expectations - * - * @param string $method - * @param array $args - * @return self - */ - public function __call($method, array $args) - { - foreach ($this->_expectations as $expectation) { - call_user_func_array(array($expectation, $method), $args); - } - return $this; - } - - /** - * Return order number of the first expectation - * - * @return int - */ - public function getOrderNumber() - { - reset($this->_expectations); - $first = current($this->_expectations); - return $first->getOrderNumber(); - } - - /** - * Return the parent mock of the first expectation - * - * @return \Mockery\MockInterface|\Mockery\LegacyMockInterface - */ - public function getMock() - { - reset($this->_expectations); - $first = current($this->_expectations); - return $first->getMock(); - } - - /** - * Mockery API alias to getMock - * - * @return \Mockery\LegacyMockInterface|\Mockery\MockInterface - */ - public function mock() - { - return $this->getMock(); - } - - /** - * Starts a new expectation addition on the first mock which is the primary - * target outside of a demeter chain - * - * @param mixed ...$args - * @return \Mockery\Expectation - */ - public function shouldReceive(...$args) - { - reset($this->_expectations); - $first = current($this->_expectations); - return call_user_func_array(array($first->getMock(), 'shouldReceive'), $args); - } - - /** - * Starts a new expectation addition on the first mock which is the primary - * target outside of a demeter chain - * - * @param mixed ...$args - * @return \Mockery\Expectation - */ - public function shouldNotReceive(...$args) - { - reset($this->_expectations); - $first = current($this->_expectations); - return call_user_func_array(array($first->getMock(), 'shouldNotReceive'), $args); - } - - /** - * Return the string summary of this composite expectation - * - * @return string - */ - public function __toString() - { - $return = '['; - $parts = array(); - foreach ($this->_expectations as $exp) { - $parts[] = (string) $exp; - } - $return .= implode(', ', $parts) . ']'; - return $return; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Configuration.php b/vendor/mockery/mockery/library/Mockery/Configuration.php deleted file mode 100644 index bce05f3..0000000 --- a/vendor/mockery/mockery/library/Mockery/Configuration.php +++ /dev/null @@ -1,283 +0,0 @@ -_quickDefinitionsConfiguration = new QuickDefinitionsConfiguration(); - } - - /** - * Custom object formatters - * - * @var array - */ - protected $_objectFormatters = array(); - - /** - * Default argument matchers - * - * @var array - */ - protected $_defaultMatchers = array(); - - /** - * Set boolean to allow/prevent mocking of non-existent methods - * - * @param bool $flag - */ - public function allowMockingNonExistentMethods($flag = true) - { - $this->_allowMockingNonExistentMethod = (bool) $flag; - } - - /** - * Return flag indicating whether mocking non-existent methods allowed - * - * @return bool - */ - public function mockingNonExistentMethodsAllowed() - { - return $this->_allowMockingNonExistentMethod; - } - - /** - * Set boolean to allow/prevent unnecessary mocking of methods - * - * @param bool $flag - * - * @deprecated since 1.4.0 - */ - public function allowMockingMethodsUnnecessarily($flag = true) - { - @trigger_error(sprintf("The %s method is deprecated and will be removed in a future version of Mockery", __METHOD__), E_USER_DEPRECATED); - - $this->_allowMockingMethodsUnnecessarily = (bool) $flag; - } - - /** - * Return flag indicating whether mocking non-existent methods allowed - * - * @return bool - * - * @deprecated since 1.4.0 - */ - public function mockingMethodsUnnecessarilyAllowed() - { - @trigger_error(sprintf("The %s method is deprecated and will be removed in a future version of Mockery", __METHOD__), E_USER_DEPRECATED); - - return $this->_allowMockingMethodsUnnecessarily; - } - - /** - * Set a parameter map (array of param signature strings) for the method - * of an internal PHP class. - * - * @param string $class - * @param string $method - * @param array $map - */ - public function setInternalClassMethodParamMap($class, $method, array $map) - { - if (\PHP_MAJOR_VERSION > 7) { - throw new \LogicException('Internal class parameter overriding is not available in PHP 8. Incompatible signatures have been reclassified as fatal errors.'); - } - - if (!isset($this->_internalClassParamMap[strtolower($class)])) { - $this->_internalClassParamMap[strtolower($class)] = array(); - } - $this->_internalClassParamMap[strtolower($class)][strtolower($method)] = $map; - } - - /** - * Remove all overridden parameter maps from internal PHP classes. - */ - public function resetInternalClassMethodParamMaps() - { - $this->_internalClassParamMap = array(); - } - - /** - * Get the parameter map of an internal PHP class method - * - * @return array|null - */ - public function getInternalClassMethodParamMap($class, $method) - { - if (isset($this->_internalClassParamMap[strtolower($class)][strtolower($method)])) { - return $this->_internalClassParamMap[strtolower($class)][strtolower($method)]; - } - } - - public function getInternalClassMethodParamMaps() - { - return $this->_internalClassParamMap; - } - - public function setConstantsMap(array $map) - { - $this->_constantsMap = $map; - } - - public function getConstantsMap() - { - return $this->_constantsMap; - } - - /** - * Returns the quick definitions configuration - */ - public function getQuickDefinitions(): QuickDefinitionsConfiguration - { - return $this->_quickDefinitionsConfiguration; - } - - /** - * Disable reflection caching - * - * It should be always enabled, except when using - * PHPUnit's --static-backup option. - * - * @see https://github.com/mockery/mockery/issues/268 - */ - public function disableReflectionCache() - { - $this->_reflectionCacheEnabled = false; - } - - /** - * Enable reflection caching - * - * It should be always enabled, except when using - * PHPUnit's --static-backup option. - * - * @see https://github.com/mockery/mockery/issues/268 - */ - public function enableReflectionCache() - { - $this->_reflectionCacheEnabled = true; - } - - /** - * Is reflection cache enabled? - */ - public function reflectionCacheEnabled() - { - return $this->_reflectionCacheEnabled; - } - - public function setObjectFormatter($class, $formatterCallback) - { - $this->_objectFormatters[$class] = $formatterCallback; - } - - public function getObjectFormatter($class, $defaultFormatter) - { - $parentClass = $class; - do { - $classes[] = $parentClass; - $parentClass = get_parent_class($parentClass); - } while ($parentClass); - $classesAndInterfaces = array_merge($classes, class_implements($class)); - foreach ($classesAndInterfaces as $type) { - if (isset($this->_objectFormatters[$type])) { - return $this->_objectFormatters[$type]; - } - } - return $defaultFormatter; - } - - /** - * @param string $class - * @param string $matcherClass - */ - public function setDefaultMatcher($class, $matcherClass) - { - if (!is_a($matcherClass, \Mockery\Matcher\MatcherAbstract::class, true) && - !is_a($matcherClass, \Hamcrest\Matcher::class, true) && - !is_a($matcherClass, \Hamcrest_Matcher::class, true) - ) { - throw new \InvalidArgumentException( - "Matcher class must be either Hamcrest matcher or extend \Mockery\Matcher\MatcherAbstract, " . - "'$matcherClass' given." - ); - } - $this->_defaultMatchers[$class] = $matcherClass; - } - - public function getDefaultMatcher($class) - { - $parentClass = $class; - do { - $classes[] = $parentClass; - $parentClass = get_parent_class($parentClass); - } while ($parentClass); - $classesAndInterfaces = array_merge($classes, class_implements($class)); - foreach ($classesAndInterfaces as $type) { - if (isset($this->_defaultMatchers[$type])) { - return $this->_defaultMatchers[$type]; - } - } - return null; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Container.php b/vendor/mockery/mockery/library/Mockery/Container.php deleted file mode 100644 index 196dc99..0000000 --- a/vendor/mockery/mockery/library/Mockery/Container.php +++ /dev/null @@ -1,535 +0,0 @@ -_generator = $generator ?: \Mockery::getDefaultGenerator(); - $this->_loader = $loader ?: \Mockery::getDefaultLoader(); - } - - /** - * Generates a new mock object for this container - * - * I apologies in advance for this. A God Method just fits the API which - * doesn't require differentiating between classes, interfaces, abstracts, - * names or partials - just so long as it's something that can be mocked. - * I'll refactor it one day so it's easier to follow. - * - * @param array ...$args - * - * @return Mock - * @throws Exception\RuntimeException - */ - public function mock(...$args) - { - $expectationClosure = null; - $quickdefs = array(); - $constructorArgs = null; - $blocks = array(); - $class = null; - - if (count($args) > 1) { - $finalArg = end($args); - reset($args); - if (is_callable($finalArg) && is_object($finalArg)) { - $expectationClosure = array_pop($args); - } - } - - $builder = new MockConfigurationBuilder(); - - foreach ($args as $k => $arg) { - if ($arg instanceof MockConfigurationBuilder) { - $builder = $arg; - unset($args[$k]); - } - } - reset($args); - - $builder->setParameterOverrides(\Mockery::getConfiguration()->getInternalClassMethodParamMaps()); - $builder->setConstantsMap(\Mockery::getConfiguration()->getConstantsMap()); - - while (count($args) > 0) { - $arg = array_shift($args); - // check for multiple interfaces - if (is_string($arg)) { - foreach (explode('|', $arg) as $type) { - if ($arg === 'null') { - // skip PHP 8 'null's - } elseif (strpos($type, ',') && !strpos($type, ']')) { - $interfaces = explode(',', str_replace(' ', '', $type)); - $builder->addTargets($interfaces); - } elseif (substr($type, 0, 6) == 'alias:') { - $type = str_replace('alias:', '', $type); - $builder->addTarget('stdClass'); - $builder->setName($type); - } elseif (substr($type, 0, 9) == 'overload:') { - $type = str_replace('overload:', '', $type); - $builder->setInstanceMock(true); - $builder->addTarget('stdClass'); - $builder->setName($type); - } elseif (substr($type, strlen($type)-1, 1) == ']') { - $parts = explode('[', $type); - if (!class_exists($parts[0], true) && !interface_exists($parts[0], true)) { - throw new \Mockery\Exception('Can only create a partial mock from' - . ' an existing class or interface'); - } - $class = $parts[0]; - $parts[1] = str_replace(' ', '', $parts[1]); - $partialMethods = array_filter(explode(',', strtolower(rtrim($parts[1], ']')))); - $builder->addTarget($class); - foreach ($partialMethods as $partialMethod) { - if ($partialMethod[0] === '!') { - $builder->addBlackListedMethod(substr($partialMethod, 1)); - continue; - } - $builder->addWhiteListedMethod($partialMethod); - } - } elseif (class_exists($type, true) || interface_exists($type, true) || trait_exists($type, true)) { - $builder->addTarget($type); - } elseif (!\Mockery::getConfiguration()->mockingNonExistentMethodsAllowed() && (!class_exists($type, true) && !interface_exists($type, true))) { - throw new \Mockery\Exception("Mockery can't find '$type' so can't mock it"); - } else { - if (!$this->isValidClassName($type)) { - throw new \Mockery\Exception('Class name contains invalid characters'); - } - $builder->addTarget($type); - } - break; // unions are "sum" types and not "intersections", and so we must only process the first part - } - } elseif (is_object($arg)) { - $builder->addTarget($arg); - } elseif (is_array($arg)) { - if (!empty($arg) && array_keys($arg) !== range(0, count($arg) - 1)) { - // if associative array - if (array_key_exists(self::BLOCKS, $arg)) { - $blocks = $arg[self::BLOCKS]; - } - unset($arg[self::BLOCKS]); - $quickdefs = $arg; - } else { - $constructorArgs = $arg; - } - } else { - throw new \Mockery\Exception( - 'Unable to parse arguments sent to ' - . get_class($this) . '::mock()' - ); - } - } - - $builder->addBlackListedMethods($blocks); - - if (!is_null($constructorArgs)) { - $builder->addBlackListedMethod("__construct"); // we need to pass through - } else { - $builder->setMockOriginalDestructor(true); - } - - if (!empty($partialMethods) && $constructorArgs === null) { - $constructorArgs = array(); - } - - $config = $builder->getMockConfiguration(); - - $this->checkForNamedMockClashes($config); - - $def = $this->getGenerator()->generate($config); - - if (class_exists($def->getClassName(), $attemptAutoload = false)) { - $rfc = new \ReflectionClass($def->getClassName()); - if (!$rfc->implementsInterface("Mockery\LegacyMockInterface")) { - throw new \Mockery\Exception\RuntimeException("Could not load mock {$def->getClassName()}, class already exists"); - } - } - - $this->getLoader()->load($def); - - $mock = $this->_getInstance($def->getClassName(), $constructorArgs); - $mock->mockery_init($this, $config->getTargetObject(), $config->isInstanceMock()); - - if (!empty($quickdefs)) { - if (\Mockery::getConfiguration()->getQuickDefinitions()->shouldBeCalledAtLeastOnce()) { - $mock->shouldReceive($quickdefs)->atLeast()->once(); - } else { - $mock->shouldReceive($quickdefs)->byDefault(); - } - } - if (!empty($expectationClosure)) { - $expectationClosure($mock); - } - $this->rememberMock($mock); - return $mock; - } - - public function instanceMock() - { - } - - public function getLoader() - { - return $this->_loader; - } - - public function getGenerator() - { - return $this->_generator; - } - - /** - * @param string $method - * @param string $parent - * @return string|null - */ - public function getKeyOfDemeterMockFor($method, $parent) - { - $keys = array_keys($this->_mocks); - $match = preg_grep("/__demeter_" . md5($parent) . "_{$method}$/", $keys); - if (count($match) == 1) { - $res = array_values($match); - if (count($res) > 0) { - return $res[0]; - } - } - return null; - } - - /** - * @return array - */ - public function getMocks() - { - return $this->_mocks; - } - - /** - * Tear down tasks for this container - * - * @throws \Exception - * @return void - */ - public function mockery_teardown() - { - try { - $this->mockery_verify(); - } catch (\Exception $e) { - $this->mockery_close(); - throw $e; - } - } - - /** - * Verify the container mocks - * - * @return void - */ - public function mockery_verify() - { - foreach ($this->_mocks as $mock) { - $mock->mockery_verify(); - } - } - - /** - * Retrieves all exceptions thrown by mocks - * - * @return array - */ - public function mockery_thrownExceptions() - { - $e = []; - - foreach ($this->_mocks as $mock) { - $e = array_merge($e, $mock->mockery_thrownExceptions()); - } - - return $e; - } - - /** - * Reset the container to its original state - * - * @return void - */ - public function mockery_close() - { - foreach ($this->_mocks as $mock) { - $mock->mockery_teardown(); - } - $this->_mocks = array(); - } - - /** - * Fetch the next available allocation order number - * - * @return int - */ - public function mockery_allocateOrder() - { - $this->_allocatedOrder += 1; - return $this->_allocatedOrder; - } - - /** - * Set ordering for a group - * - * @param mixed $group - * @param int $order - */ - public function mockery_setGroup($group, $order) - { - $this->_groups[$group] = $order; - } - - /** - * Fetch array of ordered groups - * - * @return array - */ - public function mockery_getGroups() - { - return $this->_groups; - } - - /** - * Set current ordered number - * - * @param int $order - * @return int The current order number that was set - */ - public function mockery_setCurrentOrder($order) - { - $this->_currentOrder = $order; - return $this->_currentOrder; - } - - /** - * Get current ordered number - * - * @return int - */ - public function mockery_getCurrentOrder() - { - return $this->_currentOrder; - } - - /** - * Validate the current mock's ordering - * - * @param string $method - * @param int $order - * @throws \Mockery\Exception - * @return void - */ - public function mockery_validateOrder($method, $order, \Mockery\LegacyMockInterface $mock) - { - if ($order < $this->_currentOrder) { - $exception = new \Mockery\Exception\InvalidOrderException( - 'Method ' . $method . ' called out of order: expected order ' - . $order . ', was ' . $this->_currentOrder - ); - $exception->setMock($mock) - ->setMethodName($method) - ->setExpectedOrder($order) - ->setActualOrder($this->_currentOrder); - throw $exception; - } - $this->mockery_setCurrentOrder($order); - } - - /** - * Gets the count of expectations on the mocks - * - * @return int - */ - public function mockery_getExpectationCount() - { - $count = 0; - foreach ($this->_mocks as $mock) { - $count += $mock->mockery_getExpectationCount(); - } - return $count; - } - - /** - * Store a mock and set its container reference - * - * @param \Mockery\Mock $mock - * @return \Mockery\LegacyMockInterface|\Mockery\MockInterface - */ - public function rememberMock(\Mockery\LegacyMockInterface $mock) - { - if (!isset($this->_mocks[get_class($mock)])) { - $this->_mocks[get_class($mock)] = $mock; - } else { - /** - * This condition triggers for an instance mock where origin mock - * is already remembered - */ - $this->_mocks[] = $mock; - } - return $mock; - } - - /** - * Retrieve the last remembered mock object, which is the same as saying - * retrieve the current mock being programmed where you have yet to call - * mock() to change it - thus why the method name is "self" since it will be - * be used during the programming of the same mock. - * - * @return \Mockery\Mock - */ - public function self() - { - $mocks = array_values($this->_mocks); - $index = count($mocks) - 1; - return $mocks[$index]; - } - - /** - * Return a specific remembered mock according to the array index it - * was stored to in this container instance - * - * @return \Mockery\Mock - */ - public function fetchMock($reference) - { - if (isset($this->_mocks[$reference])) { - return $this->_mocks[$reference]; - } - } - - protected function _getInstance($mockName, $constructorArgs = null) - { - if ($constructorArgs !== null) { - $r = new \ReflectionClass($mockName); - return $r->newInstanceArgs($constructorArgs); - } - - try { - $instantiator = new Instantiator(); - $instance = $instantiator->instantiate($mockName); - } catch (\Exception $ex) { - $internalMockName = $mockName . '_Internal'; - - if (!class_exists($internalMockName)) { - eval("class $internalMockName extends $mockName {" . - 'public function __construct() {}' . - '}'); - } - - $instance = new $internalMockName(); - } - - return $instance; - } - - protected function checkForNamedMockClashes($config) - { - $name = $config->getName(); - - if (!$name) { - return; - } - - $hash = $config->getHash(); - - if (isset($this->_namedMocks[$name])) { - if ($hash !== $this->_namedMocks[$name]) { - throw new \Mockery\Exception( - "The mock named '$name' has been already defined with a different mock configuration" - ); - } - } - - $this->_namedMocks[$name] = $hash; - } - - /** - * see http://php.net/manual/en/language.oop5.basic.php - * @param string $className - * @return bool - */ - public function isValidClassName($className) - { - $pos = strpos($className, '\\'); - if ($pos === 0) { - $className = substr($className, 1); // remove the first backslash - } - // all the namespaces and class name should match the regex - $invalidNames = array_filter(explode('\\', $className), function ($name) { - return !preg_match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/', $name); - }); - return empty($invalidNames); - } -} diff --git a/vendor/mockery/mockery/library/Mockery/CountValidator/AtLeast.php b/vendor/mockery/mockery/library/Mockery/CountValidator/AtLeast.php deleted file mode 100644 index f6ac130..0000000 --- a/vendor/mockery/mockery/library/Mockery/CountValidator/AtLeast.php +++ /dev/null @@ -1,62 +0,0 @@ -_limit > $n) { - $exception = new Mockery\Exception\InvalidCountException( - 'Method ' . (string) $this->_expectation - . ' from ' . $this->_expectation->getMock()->mockery_getName() - . ' should be called' . PHP_EOL - . ' at least ' . $this->_limit . ' times but called ' . $n - . ' times.' - ); - $exception->setMock($this->_expectation->getMock()) - ->setMethodName((string) $this->_expectation) - ->setExpectedCountComparative('>=') - ->setExpectedCount($this->_limit) - ->setActualCount($n); - throw $exception; - } - } -} diff --git a/vendor/mockery/mockery/library/Mockery/CountValidator/AtMost.php b/vendor/mockery/mockery/library/Mockery/CountValidator/AtMost.php deleted file mode 100644 index 4d23e28..0000000 --- a/vendor/mockery/mockery/library/Mockery/CountValidator/AtMost.php +++ /dev/null @@ -1,51 +0,0 @@ -_limit < $n) { - $exception = new Mockery\Exception\InvalidCountException( - 'Method ' . (string) $this->_expectation - . ' from ' . $this->_expectation->getMock()->mockery_getName() - . ' should be called' . PHP_EOL - . ' at most ' . $this->_limit . ' times but called ' . $n - . ' times.' - ); - $exception->setMock($this->_expectation->getMock()) - ->setMethodName((string) $this->_expectation) - ->setExpectedCountComparative('<=') - ->setExpectedCount($this->_limit) - ->setActualCount($n); - throw $exception; - } - } -} diff --git a/vendor/mockery/mockery/library/Mockery/CountValidator/CountValidatorAbstract.php b/vendor/mockery/mockery/library/Mockery/CountValidator/CountValidatorAbstract.php deleted file mode 100644 index ae3b0bf..0000000 --- a/vendor/mockery/mockery/library/Mockery/CountValidator/CountValidatorAbstract.php +++ /dev/null @@ -1,69 +0,0 @@ -_expectation = $expectation; - $this->_limit = $limit; - } - - /** - * Checks if the validator can accept an additional nth call - * - * @param int $n - * @return bool - */ - public function isEligible($n) - { - return ($n < $this->_limit); - } - - /** - * Validate the call count against this validator - * - * @param int $n - * @return bool - */ - abstract public function validate($n); -} diff --git a/vendor/mockery/mockery/library/Mockery/CountValidator/Exact.php b/vendor/mockery/mockery/library/Mockery/CountValidator/Exact.php deleted file mode 100644 index 504f080..0000000 --- a/vendor/mockery/mockery/library/Mockery/CountValidator/Exact.php +++ /dev/null @@ -1,54 +0,0 @@ -_limit !== $n) { - $because = $this->_expectation->getExceptionMessage(); - - $exception = new Mockery\Exception\InvalidCountException( - 'Method ' . (string) $this->_expectation - . ' from ' . $this->_expectation->getMock()->mockery_getName() - . ' should be called' . PHP_EOL - . ' exactly ' . $this->_limit . ' times but called ' . $n - . ' times.' - . ($because ? ' Because ' . $this->_expectation->getExceptionMessage() : '') - ); - $exception->setMock($this->_expectation->getMock()) - ->setMethodName((string) $this->_expectation) - ->setExpectedCountComparative('=') - ->setExpectedCount($this->_limit) - ->setActualCount($n); - throw $exception; - } - } -} diff --git a/vendor/mockery/mockery/library/Mockery/CountValidator/Exception.php b/vendor/mockery/mockery/library/Mockery/CountValidator/Exception.php deleted file mode 100644 index b43aad3..0000000 --- a/vendor/mockery/mockery/library/Mockery/CountValidator/Exception.php +++ /dev/null @@ -1,25 +0,0 @@ -dismissed = true; - - // we sometimes stack them - if ($this->getPrevious() && $this->getPrevious() instanceof BadMethodCallException) { - $this->getPrevious()->dismiss(); - } - } - - public function dismissed() - { - return $this->dismissed; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Exception/InvalidArgumentException.php b/vendor/mockery/mockery/library/Mockery/Exception/InvalidArgumentException.php deleted file mode 100644 index ccf5c76..0000000 --- a/vendor/mockery/mockery/library/Mockery/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,25 +0,0 @@ -mockObject = $mock; - return $this; - } - - public function setMethodName($name) - { - $this->method = $name; - return $this; - } - - public function setActualCount($count) - { - $this->actual = $count; - return $this; - } - - public function setExpectedCount($count) - { - $this->expected = $count; - return $this; - } - - public function setExpectedCountComparative($comp) - { - if (!in_array($comp, array('=', '>', '<', '>=', '<='))) { - throw new RuntimeException( - 'Illegal comparative for expected call counts set: ' . $comp - ); - } - $this->expectedComparative = $comp; - return $this; - } - - public function getMock() - { - return $this->mockObject; - } - - public function getMethodName() - { - return $this->method; - } - - public function getActualCount() - { - return $this->actual; - } - - public function getExpectedCount() - { - return $this->expected; - } - - public function getMockName() - { - return $this->getMock()->mockery_getName(); - } - - public function getExpectedCountComparative() - { - return $this->expectedComparative; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Exception/InvalidOrderException.php b/vendor/mockery/mockery/library/Mockery/Exception/InvalidOrderException.php deleted file mode 100644 index 50b8049..0000000 --- a/vendor/mockery/mockery/library/Mockery/Exception/InvalidOrderException.php +++ /dev/null @@ -1,83 +0,0 @@ -mockObject = $mock; - return $this; - } - - public function setMethodName($name) - { - $this->method = $name; - return $this; - } - - public function setActualOrder($count) - { - $this->actual = $count; - return $this; - } - - public function setExpectedOrder($count) - { - $this->expected = $count; - return $this; - } - - public function getMock() - { - return $this->mockObject; - } - - public function getMethodName() - { - return $this->method; - } - - public function getActualOrder() - { - return $this->actual; - } - - public function getExpectedOrder() - { - return $this->expected; - } - - public function getMockName() - { - return $this->getMock()->mockery_getName(); - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Exception/NoMatchingExpectationException.php b/vendor/mockery/mockery/library/Mockery/Exception/NoMatchingExpectationException.php deleted file mode 100644 index fe5f351..0000000 --- a/vendor/mockery/mockery/library/Mockery/Exception/NoMatchingExpectationException.php +++ /dev/null @@ -1,70 +0,0 @@ -mockObject = $mock; - return $this; - } - - public function setMethodName($name) - { - $this->method = $name; - return $this; - } - - public function setActualArguments($count) - { - $this->actual = $count; - return $this; - } - - public function getMock() - { - return $this->mockObject; - } - - public function getMethodName() - { - return $this->method; - } - - public function getActualArguments() - { - return $this->actual; - } - - public function getMockName() - { - return $this->getMock()->mockery_getName(); - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Exception/RuntimeException.php b/vendor/mockery/mockery/library/Mockery/Exception/RuntimeException.php deleted file mode 100644 index 4b2f53c..0000000 --- a/vendor/mockery/mockery/library/Mockery/Exception/RuntimeException.php +++ /dev/null @@ -1,25 +0,0 @@ -_mock = $mock; - $this->_name = $name; - $this->withAnyArgs(); - } - - /** - * Return a string with the method name and arguments formatted - * - * @param string $name Name of the expected method - * @param array $args List of arguments to the method - * @return string - */ - public function __toString() - { - return \Mockery::formatArgs($this->_name, $this->_expectedArgs); - } - - /** - * Verify the current call, i.e. that the given arguments match those - * of this expectation - * - * @param array $args - * @return mixed - */ - public function verifyCall(array $args) - { - $this->validateOrder(); - $this->_actualCount++; - if (true === $this->_passthru) { - return $this->_mock->mockery_callSubjectMethod($this->_name, $args); - } - - $return = $this->_getReturnValue($args); - $this->throwAsNecessary($return); - $this->_setValues(); - - return $return; - } - - /** - * Throws an exception if the expectation has been configured to do so - * - * @throws \Throwable - * @return void - */ - private function throwAsNecessary($return) - { - if (!$this->_throw) { - return; - } - - if ($return instanceof \Throwable) { - throw $return; - } - - return; - } - - /** - * Sets public properties with queued values to the mock object - * - * @param array $args - * @return mixed - */ - protected function _setValues() - { - $mockClass = get_class($this->_mock); - $container = $this->_mock->mockery_getContainer(); - /** @var Mock[] $mocks */ - $mocks = $container->getMocks(); - foreach ($this->_setQueue as $name => &$values) { - if (count($values) > 0) { - $value = array_shift($values); - $this->_mock->{$name} = $value; - foreach ($mocks as $mock) { - if (is_a($mock, $mockClass) && $mock->mockery_isInstance()) { - $mock->{$name} = $value; - } - } - } - } - } - - /** - * Fetch the return value for the matching args - * - * @param array $args - * @return mixed - */ - protected function _getReturnValue(array $args) - { - if (count($this->_closureQueue) > 1) { - return call_user_func_array(array_shift($this->_closureQueue), $args); - } elseif (count($this->_closureQueue) > 0) { - return call_user_func_array(current($this->_closureQueue), $args); - } elseif (count($this->_returnQueue) > 1) { - return array_shift($this->_returnQueue); - } elseif (count($this->_returnQueue) > 0) { - return current($this->_returnQueue); - } - - return $this->_mock->mockery_returnValueForMethod($this->_name); - } - - /** - * Checks if this expectation is eligible for additional calls - * - * @return bool - */ - public function isEligible() - { - foreach ($this->_countValidators as $validator) { - if (!$validator->isEligible($this->_actualCount)) { - return false; - } - } - return true; - } - - /** - * Check if there is a constraint on call count - * - * @return bool - */ - public function isCallCountConstrained() - { - return (count($this->_countValidators) > 0); - } - - /** - * Verify call order - * - * @return void - */ - public function validateOrder() - { - if ($this->_orderNumber) { - $this->_mock->mockery_validateOrder((string) $this, $this->_orderNumber, $this->_mock); - } - if ($this->_globalOrderNumber) { - $this->_mock->mockery_getContainer() - ->mockery_validateOrder((string) $this, $this->_globalOrderNumber, $this->_mock); - } - } - - /** - * Verify this expectation - * - * @return void - */ - public function verify() - { - foreach ($this->_countValidators as $validator) { - $validator->validate($this->_actualCount); - } - } - - /** - * Check if the registered expectation is an ArgumentListMatcher - * @return bool - */ - private function isArgumentListMatcher() - { - return (count($this->_expectedArgs) === 1 && ($this->_expectedArgs[0] instanceof ArgumentListMatcher)); - } - - private function isAndAnyOtherArgumentsMatcher($expectedArg) - { - return $expectedArg instanceof AndAnyOtherArgs; - } - - /** - * Check if passed arguments match an argument expectation - * - * @param array $args - * @return bool - */ - public function matchArgs(array $args) - { - if ($this->isArgumentListMatcher()) { - return $this->_matchArg($this->_expectedArgs[0], $args); - } - $argCount = count($args); - if ($argCount !== count((array) $this->_expectedArgs)) { - $lastExpectedArgument = end($this->_expectedArgs); - reset($this->_expectedArgs); - - if ($this->isAndAnyOtherArgumentsMatcher($lastExpectedArgument)) { - $args = array_slice($args, 0, array_search($lastExpectedArgument, $this->_expectedArgs, true)); - return $this->_matchArgs($args); - } - - return false; - } - - return $this->_matchArgs($args); - } - - /** - * Check if the passed arguments match the expectations, one by one. - * - * @param array $args - * @return bool - */ - protected function _matchArgs($args) - { - $argCount = count($args); - for ($i=0; $i<$argCount; $i++) { - $param =& $args[$i]; - if (!$this->_matchArg($this->_expectedArgs[$i], $param)) { - return false; - } - } - return true; - } - - /** - * Check if passed argument matches an argument expectation - * - * @param mixed $expected - * @param mixed $actual - * @return bool - */ - protected function _matchArg($expected, &$actual) - { - if ($expected === $actual) { - return true; - } - if (!is_object($expected) && !is_object($actual) && $expected == $actual) { - return true; - } - if (is_string($expected) && is_object($actual)) { - $result = $actual instanceof $expected; - if ($result) { - return true; - } - } - if (is_object($expected)) { - $matcher = \Mockery::getConfiguration()->getDefaultMatcher(get_class($expected)); - if ($matcher !== null) { - $expected = new $matcher($expected); - } - } - if ($expected instanceof \Mockery\Matcher\MatcherAbstract) { - return $expected->match($actual); - } - if ($expected instanceof \Hamcrest\Matcher || $expected instanceof \Hamcrest_Matcher) { - return $expected->matches($actual); - } - return false; - } - - /** - * Expected argument setter for the expectation - * - * @param mixed ...$args - * - * @return self - */ - public function with(...$args) - { - return $this->withArgs($args); - } - - /** - * Expected arguments for the expectation passed as an array - * - * @param array $arguments - * @return self - */ - private function withArgsInArray(array $arguments) - { - if (empty($arguments)) { - return $this->withNoArgs(); - } - $this->_expectedArgs = $arguments; - return $this; - } - - /** - * Expected arguments have to be matched by the given closure. - * - * @param Closure $closure - * @return self - */ - private function withArgsMatchedByClosure(Closure $closure) - { - $this->_expectedArgs = [new MultiArgumentClosure($closure)]; - return $this; - } - - /** - * Expected arguments for the expectation passed as an array or a closure that matches each passed argument on - * each function call. - * - * @param array|Closure $argsOrClosure - * @return self - */ - public function withArgs($argsOrClosure) - { - if (is_array($argsOrClosure)) { - $this->withArgsInArray($argsOrClosure); - } elseif ($argsOrClosure instanceof Closure) { - $this->withArgsMatchedByClosure($argsOrClosure); - } else { - throw new \InvalidArgumentException(sprintf('Call to %s with an invalid argument (%s), only array and ' . - 'closure are allowed', __METHOD__, $argsOrClosure)); - } - return $this; - } - - /** - * Set with() as no arguments expected - * - * @return self - */ - public function withNoArgs() - { - $this->_expectedArgs = [new NoArgs()]; - return $this; - } - - /** - * Set expectation that any arguments are acceptable - * - * @return self - */ - public function withAnyArgs() - { - $this->_expectedArgs = [new AnyArgs()]; - return $this; - } - - /** - * Expected arguments should partially match the real arguments - * - * @param mixed ...$expectedArgs - * @return self - */ - public function withSomeOfArgs(...$expectedArgs) - { - return $this->withArgs(function (...$args) use ($expectedArgs) { - foreach ($expectedArgs as $expectedArg) { - if (!in_array($expectedArg, $args, true)) { - return false; - } - } - return true; - }); - } - - /** - * Set a return value, or sequential queue of return values - * - * @param mixed ...$args - * @return self - */ - public function andReturn(...$args) - { - $this->_returnQueue = $args; - return $this; - } - - /** - * Set a return value, or sequential queue of return values - * - * @param mixed ...$args - * @return self - */ - public function andReturns(...$args) - { - return call_user_func_array([$this, 'andReturn'], $args); - } - - /** - * Return this mock, like a fluent interface - * - * @return self - */ - public function andReturnSelf() - { - return $this->andReturn($this->_mock); - } - - /** - * Set a sequential queue of return values with an array - * - * @param array $values - * @return self - */ - public function andReturnValues(array $values) - { - call_user_func_array(array($this, 'andReturn'), $values); - return $this; - } - - /** - * Set a closure or sequence of closures with which to generate return - * values. The arguments passed to the expected method are passed to the - * closures as parameters. - * - * @param callable ...$args - * @return self - */ - public function andReturnUsing(...$args) - { - $this->_closureQueue = $args; - return $this; - } - - /** - * Sets up a closure to return the nth argument from the expected method call - * - * @param int $index - * @return self - */ - public function andReturnArg($index) - { - if (!is_int($index) || $index < 0) { - throw new \InvalidArgumentException("Invalid argument index supplied. Index must be a non-negative integer."); - } - $closure = function (...$args) use ($index) { - if (array_key_exists($index, $args)) { - return $args[$index]; - } - throw new \OutOfBoundsException("Cannot return an argument value. No argument exists for the index $index"); - }; - - $this->_closureQueue = [$closure]; - return $this; - } - - /** - * Return a self-returning black hole object. - * - * @return self - */ - public function andReturnUndefined() - { - $this->andReturn(new \Mockery\Undefined()); - return $this; - } - - /** - * Return null. This is merely a language construct for Mock describing. - * - * @return self - */ - public function andReturnNull() - { - return $this->andReturn(null); - } - - public function andReturnFalse() - { - return $this->andReturn(false); - } - - public function andReturnTrue() - { - return $this->andReturn(true); - } - - /** - * Set Exception class and arguments to that class to be thrown - * - * @param string|\Exception $exception - * @param string $message - * @param int $code - * @param \Exception $previous - * @return self - */ - public function andThrow($exception, $message = '', $code = 0, \Exception $previous = null) - { - $this->_throw = true; - if (is_object($exception)) { - $this->andReturn($exception); - } else { - $this->andReturn(new $exception($message, $code, $previous)); - } - return $this; - } - - public function andThrows($exception, $message = '', $code = 0, \Exception $previous = null) - { - return $this->andThrow($exception, $message, $code, $previous); - } - - /** - * Set Exception classes to be thrown - * - * @param array $exceptions - * @return self - */ - public function andThrowExceptions(array $exceptions) - { - $this->_throw = true; - foreach ($exceptions as $exception) { - if (!is_object($exception)) { - throw new Exception('You must pass an array of exception objects to andThrowExceptions'); - } - } - return $this->andReturnValues($exceptions); - } - - /** - * Register values to be set to a public property each time this expectation occurs - * - * @param string $name - * @param array ...$values - * @return self - */ - public function andSet($name, ...$values) - { - $this->_setQueue[$name] = $values; - return $this; - } - - /** - * Sets up a closure that will yield each of the provided args - * - * @param mixed ...$args - * @return self - */ - public function andYield(...$args) - { - $this->_closureQueue = [ - static function () use ($args) { - foreach ($args as $arg) { - yield $arg; - } - }, - ]; - - return $this; - } - - /** - * Alias to andSet(). Allows the natural English construct - * - set('foo', 'bar')->andReturn('bar') - * - * @param string $name - * @param mixed $value - * @return self - */ - public function set($name, $value) - { - return call_user_func_array(array($this, 'andSet'), func_get_args()); - } - - /** - * Indicates this expectation should occur zero or more times - * - * @return self - */ - public function zeroOrMoreTimes() - { - $this->atLeast()->never(); - } - - /** - * Indicates the number of times this expectation should occur - * - * @param int $limit - * @throws \InvalidArgumentException - * @return self - */ - public function times($limit = null) - { - if (is_null($limit)) { - return $this; - } - if (!is_int($limit)) { - throw new \InvalidArgumentException('The passed Times limit should be an integer value'); - } - $this->_countValidators[$this->_countValidatorClass] = new $this->_countValidatorClass($this, $limit); - $this->_countValidatorClass = 'Mockery\CountValidator\Exact'; - return $this; - } - - /** - * Indicates that this expectation is never expected to be called - * - * @return self - */ - public function never() - { - return $this->times(0); - } - - /** - * Indicates that this expectation is expected exactly once - * - * @return self - */ - public function once() - { - return $this->times(1); - } - - /** - * Indicates that this expectation is expected exactly twice - * - * @return self - */ - public function twice() - { - return $this->times(2); - } - - /** - * Sets next count validator to the AtLeast instance - * - * @return self - */ - public function atLeast() - { - $this->_countValidatorClass = 'Mockery\CountValidator\AtLeast'; - return $this; - } - - /** - * Sets next count validator to the AtMost instance - * - * @return self - */ - public function atMost() - { - $this->_countValidatorClass = 'Mockery\CountValidator\AtMost'; - return $this; - } - - /** - * Shorthand for setting minimum and maximum constraints on call counts - * - * @param int $minimum - * @param int $maximum - */ - public function between($minimum, $maximum) - { - return $this->atLeast()->times($minimum)->atMost()->times($maximum); - } - - - /** - * Set the exception message - * - * @param string $message - * @return $this - */ - public function because($message) - { - $this->_because = $message; - return $this; - } - - /** - * Indicates that this expectation must be called in a specific given order - * - * @param string $group Name of the ordered group - * @return self - */ - public function ordered($group = null) - { - if ($this->_globally) { - $this->_globalOrderNumber = $this->_defineOrdered($group, $this->_mock->mockery_getContainer()); - } else { - $this->_orderNumber = $this->_defineOrdered($group, $this->_mock); - } - $this->_globally = false; - return $this; - } - - /** - * Indicates call order should apply globally - * - * @return self - */ - public function globally() - { - $this->_globally = true; - return $this; - } - - /** - * Setup the ordering tracking on the mock or mock container - * - * @param string $group - * @param object $ordering - * @return int - */ - protected function _defineOrdered($group, $ordering) - { - $groups = $ordering->mockery_getGroups(); - if (is_null($group)) { - $result = $ordering->mockery_allocateOrder(); - } elseif (isset($groups[$group])) { - $result = $groups[$group]; - } else { - $result = $ordering->mockery_allocateOrder(); - $ordering->mockery_setGroup($group, $result); - } - return $result; - } - - /** - * Return order number - * - * @return int - */ - public function getOrderNumber() - { - return $this->_orderNumber; - } - - /** - * Mark this expectation as being a default - * - * @return self - */ - public function byDefault() - { - $director = $this->_mock->mockery_getExpectationsFor($this->_name); - if (!empty($director)) { - $director->makeExpectationDefault($this); - } - return $this; - } - - /** - * Return the parent mock of the expectation - * - * @return \Mockery\LegacyMockInterface|\Mockery\MockInterface - */ - public function getMock() - { - return $this->_mock; - } - - /** - * Flag this expectation as calling the original class method with the - * any provided arguments instead of using a return value queue. - * - * @return self - */ - public function passthru() - { - if ($this->_mock instanceof Mock) { - throw new Exception( - 'Mock Objects not created from a loaded/existing class are ' - . 'incapable of passing method calls through to a parent class' - ); - } - $this->_passthru = true; - return $this; - } - - /** - * Cloning logic - * - */ - public function __clone() - { - $newValidators = array(); - $countValidators = $this->_countValidators; - foreach ($countValidators as $validator) { - $newValidators[] = clone $validator; - } - $this->_countValidators = $newValidators; - } - - public function getName() - { - return $this->_name; - } - - public function getExceptionMessage() - { - return $this->_because; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/ExpectationDirector.php b/vendor/mockery/mockery/library/Mockery/ExpectationDirector.php deleted file mode 100644 index 1310c1b..0000000 --- a/vendor/mockery/mockery/library/Mockery/ExpectationDirector.php +++ /dev/null @@ -1,218 +0,0 @@ -_name = $name; - $this->_mock = $mock; - } - - /** - * Add a new expectation to the director - * - * @param \Mockery\Expectation $expectation - */ - public function addExpectation(\Mockery\Expectation $expectation) - { - $this->_expectations[] = $expectation; - } - - /** - * Handle a method call being directed by this instance - * - * @param array $args - * @return mixed - */ - public function call(array $args) - { - $expectation = $this->findExpectation($args); - if (is_null($expectation)) { - $exception = new \Mockery\Exception\NoMatchingExpectationException( - 'No matching handler found for ' - . $this->_mock->mockery_getName() . '::' - . \Mockery::formatArgs($this->_name, $args) - . '. Either the method was unexpected or its arguments matched' - . ' no expected argument list for this method' - . PHP_EOL . PHP_EOL - . \Mockery::formatObjects($args) - ); - $exception->setMock($this->_mock) - ->setMethodName($this->_name) - ->setActualArguments($args); - throw $exception; - } - return $expectation->verifyCall($args); - } - - /** - * Verify all expectations of the director - * - * @throws \Mockery\CountValidator\Exception - * @return void - */ - public function verify() - { - if (!empty($this->_expectations)) { - foreach ($this->_expectations as $exp) { - $exp->verify(); - } - } else { - foreach ($this->_defaults as $exp) { - $exp->verify(); - } - } - } - - /** - * Attempt to locate an expectation matching the provided args - * - * @param array $args - * @return mixed - */ - public function findExpectation(array $args) - { - $expectation = null; - - if (!empty($this->_expectations)) { - $expectation = $this->_findExpectationIn($this->_expectations, $args); - } - - if ($expectation === null && !empty($this->_defaults)) { - $expectation = $this->_findExpectationIn($this->_defaults, $args); - } - - return $expectation; - } - - /** - * Make the given expectation a default for all others assuming it was - * correctly created last - * - * @param \Mockery\Expectation $expectation - */ - public function makeExpectationDefault(\Mockery\Expectation $expectation) - { - $last = end($this->_expectations); - if ($last === $expectation) { - array_pop($this->_expectations); - array_unshift($this->_defaults, $expectation); - } else { - throw new \Mockery\Exception( - 'Cannot turn a previously defined expectation into a default' - ); - } - } - - /** - * Search current array of expectations for a match - * - * @param array $expectations - * @param array $args - * @return mixed - */ - protected function _findExpectationIn(array $expectations, array $args) - { - foreach ($expectations as $exp) { - if ($exp->isEligible() && $exp->matchArgs($args)) { - return $exp; - } - } - foreach ($expectations as $exp) { - if ($exp->matchArgs($args)) { - return $exp; - } - } - } - - /** - * Return all expectations assigned to this director - * - * @return array - */ - public function getExpectations() - { - return $this->_expectations; - } - - /** - * Return all expectations assigned to this director - * - * @return array - */ - public function getDefaultExpectations() - { - return $this->_defaults; - } - - /** - * Return the number of expectations assigned to this director. - * - * @return int - */ - public function getExpectationCount() - { - return count($this->getExpectations()) ?: count($this->getDefaultExpectations()); - } -} diff --git a/vendor/mockery/mockery/library/Mockery/ExpectationInterface.php b/vendor/mockery/mockery/library/Mockery/ExpectationInterface.php deleted file mode 100644 index f1295ad..0000000 --- a/vendor/mockery/mockery/library/Mockery/ExpectationInterface.php +++ /dev/null @@ -1,46 +0,0 @@ -once(); - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/CachingGenerator.php b/vendor/mockery/mockery/library/Mockery/Generator/CachingGenerator.php deleted file mode 100644 index 6497e88..0000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/CachingGenerator.php +++ /dev/null @@ -1,45 +0,0 @@ -generator = $generator; - } - - public function generate(MockConfiguration $config) - { - $hash = $config->getHash(); - if (isset($this->cache[$hash])) { - return $this->cache[$hash]; - } - - $definition = $this->generator->generate($config); - $this->cache[$hash] = $definition; - - return $definition; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/DefinedTargetClass.php b/vendor/mockery/mockery/library/Mockery/Generator/DefinedTargetClass.php deleted file mode 100644 index 7463f1d..0000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/DefinedTargetClass.php +++ /dev/null @@ -1,110 +0,0 @@ -rfc = $rfc; - $this->name = $alias === null ? $rfc->getName() : $alias; - } - - public static function factory($name, $alias = null) - { - return new self(new \ReflectionClass($name), $alias); - } - - public function getName() - { - return $this->name; - } - - public function isAbstract() - { - return $this->rfc->isAbstract(); - } - - public function isFinal() - { - return $this->rfc->isFinal(); - } - - public function getMethods() - { - return array_map(function ($method) { - return new Method($method); - }, $this->rfc->getMethods()); - } - - public function getInterfaces() - { - $class = __CLASS__; - return array_map(function ($interface) use ($class) { - return new $class($interface); - }, $this->rfc->getInterfaces()); - } - - public function __toString() - { - return $this->getName(); - } - - public function getNamespaceName() - { - return $this->rfc->getNamespaceName(); - } - - public function inNamespace() - { - return $this->rfc->inNamespace(); - } - - public function getShortName() - { - return $this->rfc->getShortName(); - } - - public function implementsInterface($interface) - { - return $this->rfc->implementsInterface($interface); - } - - public function hasInternalAncestor() - { - if ($this->rfc->isInternal()) { - return true; - } - - $child = $this->rfc; - while ($parent = $child->getParentClass()) { - if ($parent->isInternal()) { - return true; - } - $child = $parent; - } - - return false; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/Generator.php b/vendor/mockery/mockery/library/Mockery/Generator/Generator.php deleted file mode 100644 index 459a93c..0000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/Generator.php +++ /dev/null @@ -1,27 +0,0 @@ -method = $method; - } - - public function __call($method, $args) - { - return call_user_func_array(array($this->method, $method), $args); - } - - /** - * @return Parameter[] - */ - public function getParameters() - { - return array_map(function (\ReflectionParameter $parameter) { - return new Parameter($parameter); - }, $this->method->getParameters()); - } - - /** - * @return string|null - */ - public function getReturnType() - { - return Reflector::getReturnType($this->method); - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/MockConfiguration.php b/vendor/mockery/mockery/library/Mockery/Generator/MockConfiguration.php deleted file mode 100644 index 05903e5..0000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/MockConfiguration.php +++ /dev/null @@ -1,556 +0,0 @@ -addTargets($targets); - $this->blackListedMethods = $blackListedMethods; - $this->whiteListedMethods = $whiteListedMethods; - $this->name = $name; - $this->instanceMock = $instanceMock; - $this->parameterOverrides = $parameterOverrides; - $this->mockOriginalDestructor = $mockOriginalDestructor; - $this->constantsMap = $constantsMap; - } - - /** - * Attempt to create a hash of the configuration, in order to allow caching - * - * @TODO workout if this will work - * - * @return string - */ - public function getHash() - { - $vars = array( - 'targetClassName' => $this->targetClassName, - 'targetInterfaceNames' => $this->targetInterfaceNames, - 'targetTraitNames' => $this->targetTraitNames, - 'name' => $this->name, - 'blackListedMethods' => $this->blackListedMethods, - 'whiteListedMethod' => $this->whiteListedMethods, - 'instanceMock' => $this->instanceMock, - 'parameterOverrides' => $this->parameterOverrides, - 'mockOriginalDestructor' => $this->mockOriginalDestructor - ); - - return md5(serialize($vars)); - } - - /** - * Gets a list of methods from the classes, interfaces and objects and - * filters them appropriately. Lot's of filtering going on, perhaps we could - * have filter classes to iterate through - */ - public function getMethodsToMock() - { - $methods = $this->getAllMethods(); - - foreach ($methods as $key => $method) { - if ($method->isFinal()) { - unset($methods[$key]); - } - } - - /** - * Whitelist trumps everything else - */ - if (count($this->getWhiteListedMethods())) { - $whitelist = array_map('strtolower', $this->getWhiteListedMethods()); - $methods = array_filter($methods, function ($method) use ($whitelist) { - return $method->isAbstract() || in_array(strtolower($method->getName()), $whitelist); - }); - - return $methods; - } - - /** - * Remove blacklisted methods - */ - if (count($this->getBlackListedMethods())) { - $blacklist = array_map('strtolower', $this->getBlackListedMethods()); - $methods = array_filter($methods, function ($method) use ($blacklist) { - return !in_array(strtolower($method->getName()), $blacklist); - }); - } - - /** - * Internal objects can not be instantiated with newInstanceArgs and if - * they implement Serializable, unserialize will have to be called. As - * such, we can't mock it and will need a pass to add a dummy - * implementation - */ - if ($this->getTargetClass() - && $this->getTargetClass()->implementsInterface("Serializable") - && $this->getTargetClass()->hasInternalAncestor()) { - $methods = array_filter($methods, function ($method) { - return $method->getName() !== "unserialize"; - }); - } - - return array_values($methods); - } - - /** - * We declare the __call method to handle undefined stuff, if the class - * we're mocking has also defined it, we need to comply with their interface - */ - public function requiresCallTypeHintRemoval() - { - foreach ($this->getAllMethods() as $method) { - if ("__call" === $method->getName()) { - $params = $method->getParameters(); - return !$params[1]->isArray(); - } - } - - return false; - } - - /** - * We declare the __callStatic method to handle undefined stuff, if the class - * we're mocking has also defined it, we need to comply with their interface - */ - public function requiresCallStaticTypeHintRemoval() - { - foreach ($this->getAllMethods() as $method) { - if ("__callStatic" === $method->getName()) { - $params = $method->getParameters(); - return !$params[1]->isArray(); - } - } - - return false; - } - - public function rename($className) - { - $targets = array(); - - if ($this->targetClassName) { - $targets[] = $this->targetClassName; - } - - if ($this->targetInterfaceNames) { - $targets = array_merge($targets, $this->targetInterfaceNames); - } - - if ($this->targetTraitNames) { - $targets = array_merge($targets, $this->targetTraitNames); - } - - if ($this->targetObject) { - $targets[] = $this->targetObject; - } - - return new self( - $targets, - $this->blackListedMethods, - $this->whiteListedMethods, - $className, - $this->instanceMock, - $this->parameterOverrides, - $this->mockOriginalDestructor, - $this->constantsMap - ); - } - - protected function addTarget($target) - { - if (is_object($target)) { - $this->setTargetObject($target); - $this->setTargetClassName(get_class($target)); - return $this; - } - - if ($target[0] !== "\\") { - $target = "\\" . $target; - } - - if (class_exists($target)) { - $this->setTargetClassName($target); - return $this; - } - - if (interface_exists($target)) { - $this->addTargetInterfaceName($target); - return $this; - } - - if (trait_exists($target)) { - $this->addTargetTraitName($target); - return $this; - } - - /** - * Default is to set as class, or interface if class already set - * - * Don't like this condition, can't remember what the default - * targetClass is for - */ - if ($this->getTargetClassName()) { - $this->addTargetInterfaceName($target); - return $this; - } - - $this->setTargetClassName($target); - } - - protected function addTargets($interfaces) - { - foreach ($interfaces as $interface) { - $this->addTarget($interface); - } - } - - public function getTargetClassName() - { - return $this->targetClassName; - } - - public function getTargetClass() - { - if ($this->targetClass) { - return $this->targetClass; - } - - if (!$this->targetClassName) { - return null; - } - - if (class_exists($this->targetClassName)) { - $alias = null; - if (strpos($this->targetClassName, '@') !== false) { - $alias = (new MockNameBuilder()) - ->addPart('anonymous_class') - ->addPart(md5($this->targetClassName)) - ->build(); - class_alias($this->targetClassName, $alias); - } - $dtc = DefinedTargetClass::factory($this->targetClassName, $alias); - - if ($this->getTargetObject() == false && $dtc->isFinal()) { - throw new \Mockery\Exception( - 'The class ' . $this->targetClassName . ' is marked final and its methods' - . ' cannot be replaced. Classes marked final can be passed in' - . ' to \Mockery::mock() as instantiated objects to create a' - . ' partial mock, but only if the mock is not subject to type' - . ' hinting checks.' - ); - } - - $this->targetClass = $dtc; - } else { - $this->targetClass = UndefinedTargetClass::factory($this->targetClassName); - } - - return $this->targetClass; - } - - public function getTargetTraits() - { - if (!empty($this->targetTraits)) { - return $this->targetTraits; - } - - foreach ($this->targetTraitNames as $targetTrait) { - $this->targetTraits[] = DefinedTargetClass::factory($targetTrait); - } - - $this->targetTraits = array_unique($this->targetTraits); // just in case - return $this->targetTraits; - } - - public function getTargetInterfaces() - { - if (!empty($this->targetInterfaces)) { - return $this->targetInterfaces; - } - - foreach ($this->targetInterfaceNames as $targetInterface) { - if (!interface_exists($targetInterface)) { - $this->targetInterfaces[] = UndefinedTargetClass::factory($targetInterface); - continue; - } - - $dtc = DefinedTargetClass::factory($targetInterface); - $extendedInterfaces = array_keys($dtc->getInterfaces()); - $extendedInterfaces[] = $targetInterface; - - $traversableFound = false; - $iteratorShiftedToFront = false; - foreach ($extendedInterfaces as $interface) { - if (!$traversableFound && preg_match("/^\\?Iterator(|Aggregate)$/i", $interface)) { - break; - } - - if (preg_match("/^\\\\?IteratorAggregate$/i", $interface)) { - $this->targetInterfaces[] = DefinedTargetClass::factory("\\IteratorAggregate"); - $iteratorShiftedToFront = true; - } elseif (preg_match("/^\\\\?Iterator$/i", $interface)) { - $this->targetInterfaces[] = DefinedTargetClass::factory("\\Iterator"); - $iteratorShiftedToFront = true; - } elseif (preg_match("/^\\\\?Traversable$/i", $interface)) { - $traversableFound = true; - } - } - - if ($traversableFound && !$iteratorShiftedToFront) { - $this->targetInterfaces[] = DefinedTargetClass::factory("\\IteratorAggregate"); - } - - /** - * We never straight up implement Traversable - */ - if (!preg_match("/^\\\\?Traversable$/i", $targetInterface)) { - $this->targetInterfaces[] = $dtc; - } - } - $this->targetInterfaces = array_unique($this->targetInterfaces); // just in case - return $this->targetInterfaces; - } - - public function getTargetObject() - { - return $this->targetObject; - } - - public function getName() - { - return $this->name; - } - - /** - * Generate a suitable name based on the config - */ - public function generateName() - { - $nameBuilder = new MockNameBuilder(); - - if ($this->getTargetObject()) { - $className = get_class($this->getTargetObject()); - $nameBuilder->addPart(strpos($className, '@') !== false ? md5($className) : $className); - } - - if ($this->getTargetClass()) { - $className = $this->getTargetClass()->getName(); - $nameBuilder->addPart(strpos($className, '@') !== false ? md5($className) : $className); - } - - foreach ($this->getTargetInterfaces() as $targetInterface) { - $nameBuilder->addPart($targetInterface->getName()); - } - - return $nameBuilder->build(); - } - - public function getShortName() - { - $parts = explode("\\", $this->getName()); - return array_pop($parts); - } - - public function getNamespaceName() - { - $parts = explode("\\", $this->getName()); - array_pop($parts); - - if (count($parts)) { - return implode("\\", $parts); - } - - return ""; - } - - public function getBlackListedMethods() - { - return $this->blackListedMethods; - } - - public function getWhiteListedMethods() - { - return $this->whiteListedMethods; - } - - public function isInstanceMock() - { - return $this->instanceMock; - } - - public function getParameterOverrides() - { - return $this->parameterOverrides; - } - - public function isMockOriginalDestructor() - { - return $this->mockOriginalDestructor; - } - - protected function setTargetClassName($targetClassName) - { - $this->targetClassName = $targetClassName; - } - - protected function getAllMethods() - { - if ($this->allMethods) { - return $this->allMethods; - } - - $classes = $this->getTargetInterfaces(); - - if ($this->getTargetClass()) { - $classes[] = $this->getTargetClass(); - } - - $methods = array(); - foreach ($classes as $class) { - $methods = array_merge($methods, $class->getMethods()); - } - - foreach ($this->getTargetTraits() as $trait) { - foreach ($trait->getMethods() as $method) { - if ($method->isAbstract()) { - $methods[] = $method; - } - } - } - - $names = array(); - $methods = array_filter($methods, function ($method) use (&$names) { - if (in_array($method->getName(), $names)) { - return false; - } - - $names[] = $method->getName(); - return true; - }); - - return $this->allMethods = $methods; - } - - /** - * If we attempt to implement Traversable, we must ensure we are also - * implementing either Iterator or IteratorAggregate, and that whichever one - * it is comes before Traversable in the list of implements. - */ - protected function addTargetInterfaceName($targetInterface) - { - $this->targetInterfaceNames[] = $targetInterface; - } - - protected function addTargetTraitName($targetTraitName) - { - $this->targetTraitNames[] = $targetTraitName; - } - - protected function setTargetObject($object) - { - $this->targetObject = $object; - } - - public function getConstantsMap() - { - return $this->constantsMap; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/MockConfigurationBuilder.php b/vendor/mockery/mockery/library/Mockery/Generator/MockConfigurationBuilder.php deleted file mode 100644 index 273b1d8..0000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/MockConfigurationBuilder.php +++ /dev/null @@ -1,174 +0,0 @@ -blackListedMethods = array_diff($this->blackListedMethods, $this->php7SemiReservedKeywords); - } - - public function addTarget($target) - { - $this->targets[] = $target; - - return $this; - } - - public function addTargets($targets) - { - foreach ($targets as $target) { - $this->addTarget($target); - } - - return $this; - } - - public function setName($name) - { - $this->name = $name; - return $this; - } - - public function addBlackListedMethod($blackListedMethod) - { - $this->blackListedMethods[] = $blackListedMethod; - return $this; - } - - public function addBlackListedMethods(array $blackListedMethods) - { - foreach ($blackListedMethods as $method) { - $this->addBlackListedMethod($method); - } - return $this; - } - - public function setBlackListedMethods(array $blackListedMethods) - { - $this->blackListedMethods = $blackListedMethods; - return $this; - } - - public function addWhiteListedMethod($whiteListedMethod) - { - $this->whiteListedMethods[] = $whiteListedMethod; - return $this; - } - - public function addWhiteListedMethods(array $whiteListedMethods) - { - foreach ($whiteListedMethods as $method) { - $this->addWhiteListedMethod($method); - } - return $this; - } - - public function setWhiteListedMethods(array $whiteListedMethods) - { - $this->whiteListedMethods = $whiteListedMethods; - return $this; - } - - public function setInstanceMock($instanceMock) - { - $this->instanceMock = (bool) $instanceMock; - } - - public function setParameterOverrides(array $overrides) - { - $this->parameterOverrides = $overrides; - } - - public function setMockOriginalDestructor($mockDestructor) - { - $this->mockOriginalDestructor = $mockDestructor; - return $this; - } - - public function setConstantsMap(array $map) - { - $this->constantsMap = $map; - } - - public function getMockConfiguration() - { - return new MockConfiguration( - $this->targets, - $this->blackListedMethods, - $this->whiteListedMethods, - $this->name, - $this->instanceMock, - $this->parameterOverrides, - $this->mockOriginalDestructor, - $this->constantsMap - ); - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/MockDefinition.php b/vendor/mockery/mockery/library/Mockery/Generator/MockDefinition.php deleted file mode 100644 index fd6a9fa..0000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/MockDefinition.php +++ /dev/null @@ -1,51 +0,0 @@ -getName()) { - throw new \InvalidArgumentException("MockConfiguration must contain a name"); - } - $this->config = $config; - $this->code = $code; - } - - public function getConfig() - { - return $this->config; - } - - public function getClassName() - { - return $this->config->getName(); - } - - public function getCode() - { - return $this->code; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/MockNameBuilder.php b/vendor/mockery/mockery/library/Mockery/Generator/MockNameBuilder.php deleted file mode 100644 index 204308a..0000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/MockNameBuilder.php +++ /dev/null @@ -1,46 +0,0 @@ -parts[] = $part; - - return $this; - } - - public function build() - { - $parts = ['Mockery', static::$mockCounter++]; - - foreach ($this->parts as $part) { - $parts[] = str_replace("\\", "_", $part); - } - - return implode('_', $parts); - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/Parameter.php b/vendor/mockery/mockery/library/Mockery/Generator/Parameter.php deleted file mode 100644 index 7009533..0000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/Parameter.php +++ /dev/null @@ -1,117 +0,0 @@ -rfp = $rfp; - } - - public function __call($method, array $args) - { - return call_user_func_array(array($this->rfp, $method), $args); - } - - /** - * Get the reflection class for the parameter type, if it exists. - * - * This will be null if there was no type, or it was a scalar or a union. - * - * @return \ReflectionClass|null - * - * @deprecated since 1.3.3 and will be removed in 2.0. - */ - public function getClass() - { - $typeHint = Reflector::getTypeHint($this->rfp, true); - - return \class_exists($typeHint) ? DefinedTargetClass::factory($typeHint, false) : null; - } - - /** - * Get the string representation for the paramater type. - * - * @return string|null - */ - public function getTypeHint() - { - return Reflector::getTypeHint($this->rfp); - } - - /** - * Get the string representation for the paramater type. - * - * @return string - * - * @deprecated since 1.3.2 and will be removed in 2.0. Use getTypeHint() instead. - */ - public function getTypeHintAsString() - { - return (string) Reflector::getTypeHint($this->rfp, true); - } - - /** - * Get the name of the parameter. - * - * Some internal classes have funny looking definitions! - * - * @return string - */ - public function getName() - { - $name = $this->rfp->getName(); - if (!$name || $name == '...') { - $name = 'arg' . self::$parameterCounter++; - } - - return $name; - } - - /** - * Determine if the parameter is an array. - * - * @return bool - */ - public function isArray() - { - return Reflector::isArray($this->rfp); - } - - /** - * Determine if the parameter is variadic. - * - * @return bool - */ - public function isVariadic() - { - return $this->rfp->isVariadic(); - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/AvoidMethodClashPass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/AvoidMethodClashPass.php deleted file mode 100644 index 4531257..0000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/AvoidMethodClashPass.php +++ /dev/null @@ -1,49 +0,0 @@ -getName(); - }, $config->getMethodsToMock()); - - foreach (["allows", "expects"] as $method) { - if (in_array($method, $names)) { - $code = preg_replace( - "#// start method {$method}.*// end method {$method}#ms", - "", - $code - ); - - $code = str_replace(" implements MockInterface", " implements LegacyMockInterface", $code); - } - } - - return $code; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/CallTypeHintPass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/CallTypeHintPass.php deleted file mode 100644 index fd00264..0000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/CallTypeHintPass.php +++ /dev/null @@ -1,47 +0,0 @@ -requiresCallTypeHintRemoval()) { - $code = str_replace( - 'public function __call($method, array $args)', - 'public function __call($method, $args)', - $code - ); - } - - if ($config->requiresCallStaticTypeHintRemoval()) { - $code = str_replace( - 'public static function __callStatic($method, array $args)', - 'public static function __callStatic($method, $args)', - $code - ); - } - - return $code; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ClassNamePass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ClassNamePass.php deleted file mode 100644 index b5a3109..0000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ClassNamePass.php +++ /dev/null @@ -1,49 +0,0 @@ -getNamespaceName(); - - $namespace = ltrim($namespace, "\\"); - - $className = $config->getShortName(); - - $code = str_replace( - 'namespace Mockery;', - $namespace ? 'namespace ' . $namespace . ';' : '', - $code - ); - - $code = str_replace( - 'class Mock', - 'class ' . $className, - $code - ); - - return $code; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ClassPass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ClassPass.php deleted file mode 100644 index 1debcbb..0000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ClassPass.php +++ /dev/null @@ -1,53 +0,0 @@ -getTargetClass(); - - if (!$target) { - return $code; - } - - if ($target->isFinal()) { - return $code; - } - - $className = ltrim($target->getName(), "\\"); - - if (!class_exists($className)) { - \Mockery::declareClass($className); - } - - $code = str_replace( - "implements MockInterface", - "extends \\" . $className . " implements MockInterface", - $code - ); - - return $code; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ConstantsPass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ConstantsPass.php deleted file mode 100644 index df5dd8c..0000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ConstantsPass.php +++ /dev/null @@ -1,33 +0,0 @@ -getConstantsMap(); - if (empty($cm)) { - return $code; - } - - if (!isset($cm[$config->getName()])) { - return $code; - } - - $cm = $cm[$config->getName()]; - - $constantsCode = ''; - foreach ($cm as $constant => $value) { - $constantsCode .= sprintf("\n const %s = %s;\n", $constant, var_export($value, true)); - } - - $i = strrpos($code, '}'); - $code = substr_replace($code, $constantsCode, $i); - $code .= "}\n"; - - return $code; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/InstanceMockPass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/InstanceMockPass.php deleted file mode 100644 index 6279147..0000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/InstanceMockPass.php +++ /dev/null @@ -1,83 +0,0 @@ -_mockery_ignoreVerification = false; - \$associatedRealObject = \Mockery::fetchMock(__CLASS__); - - foreach (get_object_vars(\$this) as \$attr => \$val) { - if (\$attr !== "_mockery_ignoreVerification" && \$attr !== "_mockery_expectations") { - \$this->\$attr = \$associatedRealObject->\$attr; - } - } - - \$directors = \$associatedRealObject->mockery_getExpectations(); - foreach (\$directors as \$method=>\$director) { - // get the director method needed - \$existingDirector = \$this->mockery_getExpectationsFor(\$method); - if (!\$existingDirector) { - \$existingDirector = new \Mockery\ExpectationDirector(\$method, \$this); - \$this->mockery_setExpectationsFor(\$method, \$existingDirector); - } - \$expectations = \$director->getExpectations(); - foreach (\$expectations as \$expectation) { - \$clonedExpectation = clone \$expectation; - \$existingDirector->addExpectation(\$clonedExpectation); - } - \$defaultExpectations = \$director->getDefaultExpectations(); - foreach (array_reverse(\$defaultExpectations) as \$expectation) { - \$clonedExpectation = clone \$expectation; - \$existingDirector->addExpectation(\$clonedExpectation); - \$existingDirector->makeExpectationDefault(\$clonedExpectation); - } - } - \Mockery::getContainer()->rememberMock(\$this); - - \$this->_mockery_constructorCalled(func_get_args()); - } -MOCK; - - public function apply($code, MockConfiguration $config) - { - if ($config->isInstanceMock()) { - $code = $this->appendToClass($code, static::INSTANCE_MOCK_CODE); - } - - return $code; - } - - protected function appendToClass($class, $code) - { - $lastBrace = strrpos($class, "}"); - $class = substr($class, 0, $lastBrace) . $code . "\n }\n"; - return $class; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/InterfacePass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/InterfacePass.php deleted file mode 100644 index 982956e..0000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/InterfacePass.php +++ /dev/null @@ -1,48 +0,0 @@ -getTargetInterfaces() as $i) { - $name = ltrim($i->getName(), "\\"); - if (!interface_exists($name)) { - \Mockery::declareInterface($name); - } - } - - $interfaces = array_reduce((array) $config->getTargetInterfaces(), function ($code, $i) { - return $code . ", \\" . ltrim($i->getName(), "\\"); - }, ""); - - $code = str_replace( - "implements MockInterface", - "implements MockInterface" . $interfaces, - $code - ); - - return $code; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/MagicMethodTypeHintsPass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/MagicMethodTypeHintsPass.php deleted file mode 100644 index ddcdb0b..0000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/MagicMethodTypeHintsPass.php +++ /dev/null @@ -1,212 +0,0 @@ -getMagicMethods($config->getTargetClass()); - foreach ($config->getTargetInterfaces() as $interface) { - $magicMethods = array_merge($magicMethods, $this->getMagicMethods($interface)); - } - - foreach ($magicMethods as $method) { - $code = $this->applyMagicTypeHints($code, $method); - } - - return $code; - } - - /** - * Returns the magic methods within the - * passed DefinedTargetClass. - * - * @param TargetClassInterface $class - * @return array - */ - public function getMagicMethods( - TargetClassInterface $class = null - ) { - if (is_null($class)) { - return array(); - } - return array_filter($class->getMethods(), function (Method $method) { - return in_array($method->getName(), $this->mockMagicMethods); - }); - } - - /** - * Applies type hints of magic methods from - * class to the passed code. - * - * @param int $code - * @param Method $method - * @return string - */ - private function applyMagicTypeHints($code, Method $method) - { - if ($this->isMethodWithinCode($code, $method)) { - $namedParameters = $this->getOriginalParameters( - $code, - $method - ); - $code = preg_replace( - $this->getDeclarationRegex($method->getName()), - $this->getMethodDeclaration($method, $namedParameters), - $code - ); - } - return $code; - } - - /** - * Checks if the method is declared within code. - * - * @param int $code - * @param Method $method - * @return boolean - */ - private function isMethodWithinCode($code, Method $method) - { - return preg_match( - $this->getDeclarationRegex($method->getName()), - $code - ) == 1; - } - - /** - * Returns the method original parameters, as they're - * described in the $code string. - * - * @param int $code - * @param Method $method - * @return array - */ - private function getOriginalParameters($code, Method $method) - { - $matches = []; - $parameterMatches = []; - - preg_match( - $this->getDeclarationRegex($method->getName()), - $code, - $matches - ); - - if (count($matches) > 0) { - preg_match_all( - '/(?<=\$)(\w+)+/i', - $matches[0], - $parameterMatches - ); - } - - $groupMatches = end($parameterMatches); - $parameterNames = is_array($groupMatches) ? $groupMatches : [$groupMatches]; - - return $parameterNames; - } - - /** - * Gets the declaration code, as a string, for the passed method. - * - * @param Method $method - * @param array $namedParameters - * @return string - */ - private function getMethodDeclaration( - Method $method, - array $namedParameters - ) { - $declaration = 'public'; - $declaration .= $method->isStatic() ? ' static' : ''; - $declaration .= ' function ' . $method->getName() . '('; - - foreach ($method->getParameters() as $index => $parameter) { - $declaration .= $this->renderTypeHint($parameter); - $name = isset($namedParameters[$index]) ? $namedParameters[$index] : $parameter->getName(); - $declaration .= '$' . $name; - $declaration .= ','; - } - $declaration = rtrim($declaration, ','); - $declaration .= ') '; - - $returnType = $method->getReturnType(); - if ($returnType !== null) { - $declaration .= sprintf(': %s', $returnType); - } - - return $declaration; - } - - protected function renderTypeHint(Parameter $param) - { - $typeHint = $param->getTypeHint(); - - return $typeHint === null ? '' : sprintf('%s ', $typeHint); - } - - /** - * Returns a regex string used to match the - * declaration of some method. - * - * @param string $methodName - * @return string - */ - private function getDeclarationRegex($methodName) - { - return "/public\s+(?:static\s+)?function\s+$methodName\s*\(.*\)\s*(?=\{)/i"; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/MethodDefinitionPass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/MethodDefinitionPass.php deleted file mode 100644 index 72967cd..0000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/MethodDefinitionPass.php +++ /dev/null @@ -1,166 +0,0 @@ -getMethodsToMock() as $method) { - if ($method->isPublic()) { - $methodDef = 'public'; - } elseif ($method->isProtected()) { - $methodDef = 'protected'; - } else { - $methodDef = 'private'; - } - - if ($method->isStatic()) { - $methodDef .= ' static'; - } - - $methodDef .= ' function '; - $methodDef .= $method->returnsReference() ? ' & ' : ''; - $methodDef .= $method->getName(); - $methodDef .= $this->renderParams($method, $config); - $methodDef .= $this->renderReturnType($method); - $methodDef .= $this->renderMethodBody($method, $config); - - $code = $this->appendToClass($code, $methodDef); - } - - return $code; - } - - protected function renderParams(Method $method, $config) - { - $class = $method->getDeclaringClass(); - if ($class->isInternal()) { - $overrides = $config->getParameterOverrides(); - - if (isset($overrides[strtolower($class->getName())][$method->getName()])) { - return '(' . implode(',', $overrides[strtolower($class->getName())][$method->getName()]) . ')'; - } - } - - $methodParams = array(); - $params = $method->getParameters(); - foreach ($params as $param) { - $paramDef = $this->renderTypeHint($param); - $paramDef .= $param->isPassedByReference() ? '&' : ''; - $paramDef .= $param->isVariadic() ? '...' : ''; - $paramDef .= '$' . $param->getName(); - - if (!$param->isVariadic()) { - if (false !== $param->isDefaultValueAvailable()) { - $paramDef .= ' = ' . var_export($param->getDefaultValue(), true); - } elseif ($param->isOptional()) { - $paramDef .= ' = null'; - } - } - - $methodParams[] = $paramDef; - } - return '(' . implode(', ', $methodParams) . ')'; - } - - protected function renderReturnType(Method $method) - { - $type = $method->getReturnType(); - - return $type ? sprintf(': %s', $type) : ''; - } - - protected function appendToClass($class, $code) - { - $lastBrace = strrpos($class, "}"); - $class = substr($class, 0, $lastBrace) . $code . "\n }\n"; - return $class; - } - - protected function renderTypeHint(Parameter $param) - { - $typeHint = $param->getTypeHint(); - - return $typeHint === null ? '' : sprintf('%s ', $typeHint); - } - - private function renderMethodBody($method, $config) - { - $invoke = $method->isStatic() ? 'static::_mockery_handleStaticMethodCall' : '$this->_mockery_handleMethodCall'; - $body = <<getDeclaringClass(); - $class_name = strtolower($class->getName()); - $overrides = $config->getParameterOverrides(); - if (isset($overrides[$class_name][$method->getName()])) { - $params = array_values($overrides[$class_name][$method->getName()]); - $paramCount = count($params); - for ($i = 0; $i < $paramCount; ++$i) { - $param = $params[$i]; - if (strpos($param, '&') !== false) { - $body .= << $i) { - \$argv[$i] = {$param}; -} - -BODY; - } - } - } else { - $params = array_values($method->getParameters()); - $paramCount = count($params); - for ($i = 0; $i < $paramCount; ++$i) { - $param = $params[$i]; - if (!$param->isPassedByReference()) { - continue; - } - $body .= << $i) { - \$argv[$i] =& \${$param->getName()}; -} - -BODY; - } - } - - $body .= "\$ret = {$invoke}(__FUNCTION__, \$argv);\n"; - - if ($method->getReturnType() !== "void") { - $body .= "return \$ret;\n"; - } - - $body .= "}\n"; - return $body; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/Pass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/Pass.php deleted file mode 100644 index f7b72c9..0000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/Pass.php +++ /dev/null @@ -1,28 +0,0 @@ - '/public function __wakeup\(\)\s+\{.*?\}/sm', - ); - - public function apply($code, MockConfiguration $config) - { - $target = $config->getTargetClass(); - - if (!$target) { - return $code; - } - - foreach ($target->getMethods() as $method) { - if ($method->isFinal() && isset($this->methods[$method->getName()])) { - $code = preg_replace($this->methods[$method->getName()], '', $code); - } - } - - return $code; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/RemoveDestructorPass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/RemoveDestructorPass.php deleted file mode 100644 index ed5a420..0000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/RemoveDestructorPass.php +++ /dev/null @@ -1,45 +0,0 @@ - - */ - -namespace Mockery\Generator\StringManipulation\Pass; - -use Mockery\Generator\MockConfiguration; - -/** - * Remove mock's empty destructor if we tend to use original class destructor - */ -class RemoveDestructorPass -{ - public function apply($code, MockConfiguration $config) - { - $target = $config->getTargetClass(); - - if (!$target) { - return $code; - } - - if (!$config->isMockOriginalDestructor()) { - $code = preg_replace('/public function __destruct\(\)\s+\{.*?\}/sm', '', $code); - } - - return $code; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/RemoveUnserializeForInternalSerializableClassesPass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/RemoveUnserializeForInternalSerializableClassesPass.php deleted file mode 100644 index 0abefe2..0000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/RemoveUnserializeForInternalSerializableClassesPass.php +++ /dev/null @@ -1,59 +0,0 @@ -getTargetClass(); - - if (!$target) { - return $code; - } - - if (!$target->hasInternalAncestor() || !$target->implementsInterface("Serializable")) { - return $code; - } - - $code = $this->appendToClass($code, \PHP_VERSION_ID < 80100 ? self::DUMMY_METHOD_DEFINITION_LEGACY : self::DUMMY_METHOD_DEFINITION); - - return $code; - } - - protected function appendToClass($class, $code) - { - $lastBrace = strrpos($class, "}"); - $class = substr($class, 0, $lastBrace) . $code . "\n }\n"; - return $class; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/TraitPass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/TraitPass.php deleted file mode 100644 index f6db5d7..0000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/TraitPass.php +++ /dev/null @@ -1,47 +0,0 @@ -getTargetTraits(); - - if (empty($traits)) { - return $code; - } - - $useStatements = array_map(function ($trait) { - return "use \\\\" . ltrim($trait->getName(), "\\") . ";"; - }, $traits); - - $code = preg_replace( - '/^{$/m', - "{\n " . implode("\n ", $useStatements) . "\n", - $code - ); - - return $code; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulationGenerator.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulationGenerator.php deleted file mode 100644 index 4bc415f..0000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulationGenerator.php +++ /dev/null @@ -1,89 +0,0 @@ -passes = $passes; - } - - public function generate(MockConfiguration $config) - { - $code = file_get_contents(__DIR__ . '/../Mock.php'); - $className = $config->getName() ?: $config->generateName(); - - $namedConfig = $config->rename($className); - - foreach ($this->passes as $pass) { - $code = $pass->apply($code, $namedConfig); - } - - return new MockDefinition($namedConfig, $code); - } - - public function addPass(Pass $pass) - { - $this->passes[] = $pass; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/TargetClassInterface.php b/vendor/mockery/mockery/library/Mockery/Generator/TargetClassInterface.php deleted file mode 100644 index 7724412..0000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/TargetClassInterface.php +++ /dev/null @@ -1,107 +0,0 @@ -name = $name; - } - - public static function factory($name) - { - return new self($name); - } - - public function getName() - { - return $this->name; - } - - public function isAbstract() - { - return false; - } - - public function isFinal() - { - return false; - } - - public function getMethods() - { - return array(); - } - - public function getInterfaces() - { - return array(); - } - - public function getNamespaceName() - { - $parts = explode("\\", ltrim($this->getName(), "\\")); - array_pop($parts); - return implode("\\", $parts); - } - - public function inNamespace() - { - return $this->getNamespaceName() !== ''; - } - - public function getShortName() - { - $parts = explode("\\", $this->getName()); - return array_pop($parts); - } - - public function implementsInterface($interface) - { - return false; - } - - public function hasInternalAncestor() - { - return false; - } - - public function __toString() - { - return $this->name; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/HigherOrderMessage.php b/vendor/mockery/mockery/library/Mockery/HigherOrderMessage.php deleted file mode 100644 index 1c13c89..0000000 --- a/vendor/mockery/mockery/library/Mockery/HigherOrderMessage.php +++ /dev/null @@ -1,49 +0,0 @@ -mock = $mock; - $this->method = $method; - } - - /** - * @return \Mockery\Expectation - */ - public function __call($method, $args) - { - if ($this->method === 'shouldNotHaveReceived') { - return $this->mock->{$this->method}($method, $args); - } - - $expectation = $this->mock->{$this->method}($method); - return $expectation->withArgs($args); - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Instantiator.php b/vendor/mockery/mockery/library/Mockery/Instantiator.php deleted file mode 100644 index 0eafff7..0000000 --- a/vendor/mockery/mockery/library/Mockery/Instantiator.php +++ /dev/null @@ -1,162 +0,0 @@ -. - */ - -namespace Mockery; - -use Closure; -use ReflectionClass; -use UnexpectedValueException; -use InvalidArgumentException; - -/** - * This is a trimmed down version of https://github.com/doctrine/instantiator, - * basically without the caching - * - * @author Marco Pivetta - */ -final class Instantiator -{ - /** - * {@inheritDoc} - */ - public function instantiate($className) - { - $factory = $this->buildFactory($className); - $instance = $factory(); - - return $instance; - } - - /** - * Builds a {@see \Closure} capable of instantiating the given $className without - * invoking its constructor. - * - * @param string $className - * - * @return Closure - */ - private function buildFactory($className) - { - $reflectionClass = $this->getReflectionClass($className); - - if ($this->isInstantiableViaReflection($reflectionClass)) { - return function () use ($reflectionClass) { - return $reflectionClass->newInstanceWithoutConstructor(); - }; - } - - $serializedString = sprintf( - 'O:%d:"%s":0:{}', - strlen($className), - $className - ); - - $this->attemptInstantiationViaUnSerialization($reflectionClass, $serializedString); - - return function () use ($serializedString) { - return unserialize($serializedString); - }; - } - - /** - * @param string $className - * - * @return ReflectionClass - * - * @throws InvalidArgumentException - */ - private function getReflectionClass($className) - { - if (! class_exists($className)) { - throw new InvalidArgumentException("Class:$className does not exist"); - } - - $reflection = new ReflectionClass($className); - - if ($reflection->isAbstract()) { - throw new InvalidArgumentException("Class:$className is an abstract class"); - } - - return $reflection; - } - - /** - * @param ReflectionClass $reflectionClass - * @param string $serializedString - * - * @throws UnexpectedValueException - * - * @return void - */ - private function attemptInstantiationViaUnSerialization(ReflectionClass $reflectionClass, $serializedString) - { - set_error_handler(function ($code, $message, $file, $line) use ($reflectionClass, & $error) { - $msg = sprintf( - 'Could not produce an instance of "%s" via un-serialization, since an error was triggered in file "%s" at line "%d"', - $reflectionClass->getName(), - $file, - $line - ); - - $error = new UnexpectedValueException($msg, 0, new \Exception($message, $code)); - }); - - try { - unserialize($serializedString); - } catch (\Exception $exception) { - restore_error_handler(); - - throw new UnexpectedValueException("An exception was raised while trying to instantiate an instance of \"{$reflectionClass->getName()}\" via un-serialization", 0, $exception); - } - - restore_error_handler(); - - if ($error) { - throw $error; - } - } - - /** - * @param ReflectionClass $reflectionClass - * - * @return bool - */ - private function isInstantiableViaReflection(ReflectionClass $reflectionClass) - { - return ! ($reflectionClass->isInternal() && $reflectionClass->isFinal()); - } - - /** - * Verifies whether the given class is to be considered internal - * - * @param ReflectionClass $reflectionClass - * - * @return bool - */ - private function hasInternalAncestors(ReflectionClass $reflectionClass) - { - do { - if ($reflectionClass->isInternal()) { - return true; - } - } while ($reflectionClass = $reflectionClass->getParentClass()); - - return false; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/LegacyMockInterface.php b/vendor/mockery/mockery/library/Mockery/LegacyMockInterface.php deleted file mode 100644 index ae0cc2a..0000000 --- a/vendor/mockery/mockery/library/Mockery/LegacyMockInterface.php +++ /dev/null @@ -1,240 +0,0 @@ -getClassName(), false)) { - return; - } - - eval("?>" . $definition->getCode()); - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Loader/Loader.php b/vendor/mockery/mockery/library/Mockery/Loader/Loader.php deleted file mode 100644 index 170ffb6..0000000 --- a/vendor/mockery/mockery/library/Mockery/Loader/Loader.php +++ /dev/null @@ -1,28 +0,0 @@ -path = realpath($path) ?: sys_get_temp_dir(); - } - - public function load(MockDefinition $definition) - { - if (class_exists($definition->getClassName(), false)) { - return; - } - - $tmpfname = $this->path . DIRECTORY_SEPARATOR . "Mockery_" . uniqid() . ".php"; - file_put_contents($tmpfname, $definition->getCode()); - - require $tmpfname; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/AndAnyOtherArgs.php b/vendor/mockery/mockery/library/Mockery/Matcher/AndAnyOtherArgs.php deleted file mode 100644 index e3c3b94..0000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/AndAnyOtherArgs.php +++ /dev/null @@ -1,45 +0,0 @@ -'; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/Any.php b/vendor/mockery/mockery/library/Mockery/Matcher/Any.php deleted file mode 100644 index 1ff440b..0000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/Any.php +++ /dev/null @@ -1,45 +0,0 @@ -'; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/AnyArgs.php b/vendor/mockery/mockery/library/Mockery/Matcher/AnyArgs.php deleted file mode 100644 index 9663a76..0000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/AnyArgs.php +++ /dev/null @@ -1,40 +0,0 @@ -'; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/AnyOf.php b/vendor/mockery/mockery/library/Mockery/Matcher/AnyOf.php deleted file mode 100644 index bcce4b7..0000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/AnyOf.php +++ /dev/null @@ -1,46 +0,0 @@ -_expected, true); - } - - /** - * Return a string representation of this Matcher - * - * @return string - */ - public function __toString() - { - return ''; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/ArgumentListMatcher.php b/vendor/mockery/mockery/library/Mockery/Matcher/ArgumentListMatcher.php deleted file mode 100644 index 04408f5..0000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/ArgumentListMatcher.php +++ /dev/null @@ -1,25 +0,0 @@ -_expected; - $result = $closure($actual); - return $result === true; - } - - /** - * Return a string representation of this Matcher - * - * @return string - */ - public function __toString() - { - return ''; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/Contains.php b/vendor/mockery/mockery/library/Mockery/Matcher/Contains.php deleted file mode 100644 index 79afb73..0000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/Contains.php +++ /dev/null @@ -1,64 +0,0 @@ -_expected as $exp) { - $match = false; - foreach ($values as $val) { - if ($exp === $val || $exp == $val) { - $match = true; - break; - } - } - if ($match === false) { - return false; - } - } - return true; - } - - /** - * Return a string representation of this Matcher - * - * @return string - */ - public function __toString() - { - $return = '_expected as $v) { - $elements[] = (string) $v; - } - $return .= implode(', ', $elements) . ']>'; - return $return; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/Ducktype.php b/vendor/mockery/mockery/library/Mockery/Matcher/Ducktype.php deleted file mode 100644 index 291f422..0000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/Ducktype.php +++ /dev/null @@ -1,53 +0,0 @@ -_expected as $method) { - if (!method_exists($actual, $method)) { - return false; - } - } - return true; - } - - /** - * Return a string representation of this Matcher - * - * @return string - */ - public function __toString() - { - return '_expected) . ']>'; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/HasKey.php b/vendor/mockery/mockery/library/Mockery/Matcher/HasKey.php deleted file mode 100644 index fa983ea..0000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/HasKey.php +++ /dev/null @@ -1,45 +0,0 @@ -_expected, $actual); - } - - /** - * Return a string representation of this Matcher - * - * @return string - */ - public function __toString() - { - return "_expected]>"; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/HasValue.php b/vendor/mockery/mockery/library/Mockery/Matcher/HasValue.php deleted file mode 100644 index 8ca6afd..0000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/HasValue.php +++ /dev/null @@ -1,46 +0,0 @@ -_expected, $actual); - } - - /** - * Return a string representation of this Matcher - * - * @return string - */ - public function __toString() - { - $return = '_expected . ']>'; - return $return; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/MatcherAbstract.php b/vendor/mockery/mockery/library/Mockery/Matcher/MatcherAbstract.php deleted file mode 100644 index 3233079..0000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/MatcherAbstract.php +++ /dev/null @@ -1,58 +0,0 @@ -_expected = $expected; - } - - /** - * Check if the actual value matches the expected. - * Actual passed by reference to preserve reference trail (where applicable) - * back to the original method parameter. - * - * @param mixed $actual - * @return bool - */ - abstract public function match(&$actual); - - /** - * Return a string representation of this Matcher - * - * @return string - */ - abstract public function __toString(); -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/MultiArgumentClosure.php b/vendor/mockery/mockery/library/Mockery/Matcher/MultiArgumentClosure.php deleted file mode 100644 index 63dbff0..0000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/MultiArgumentClosure.php +++ /dev/null @@ -1,48 +0,0 @@ -_expected; - return true === call_user_func_array($closure, $actual); - } - - /** - * Return a string representation of this Matcher - * - * @return string - */ - public function __toString() - { - return ''; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/MustBe.php b/vendor/mockery/mockery/library/Mockery/Matcher/MustBe.php deleted file mode 100644 index 27b5ec5..0000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/MustBe.php +++ /dev/null @@ -1,52 +0,0 @@ -_expected === $actual; - } - - return $this->_expected == $actual; - } - - /** - * Return a string representation of this Matcher - * - * @return string - */ - public function __toString() - { - return ''; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/NoArgs.php b/vendor/mockery/mockery/library/Mockery/Matcher/NoArgs.php deleted file mode 100644 index 5e9e418..0000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/NoArgs.php +++ /dev/null @@ -1,40 +0,0 @@ -'; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/Not.php b/vendor/mockery/mockery/library/Mockery/Matcher/Not.php deleted file mode 100644 index 756ccaa..0000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/Not.php +++ /dev/null @@ -1,46 +0,0 @@ -_expected; - } - - /** - * Return a string representation of this Matcher - * - * @return string - */ - public function __toString() - { - return ''; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/NotAnyOf.php b/vendor/mockery/mockery/library/Mockery/Matcher/NotAnyOf.php deleted file mode 100644 index cd82701..0000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/NotAnyOf.php +++ /dev/null @@ -1,51 +0,0 @@ -_expected as $exp) { - if ($actual === $exp || $actual == $exp) { - return false; - } - } - return true; - } - - /** - * Return a string representation of this Matcher - * - * @return string - */ - public function __toString() - { - return ''; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/PHPUnitConstraint.php b/vendor/mockery/mockery/library/Mockery/Matcher/PHPUnitConstraint.php deleted file mode 100644 index 1187487..0000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/PHPUnitConstraint.php +++ /dev/null @@ -1,76 +0,0 @@ -constraint = $constraint; - $this->rethrow = $rethrow; - } - - /** - * @param mixed $actual - * @return bool - */ - public function match(&$actual) - { - try { - $this->constraint->evaluate($actual); - return true; - } catch (\PHPUnit_Framework_AssertionFailedError $e) { - if ($this->rethrow) { - throw $e; - } - return false; - } catch (\PHPUnit\Framework\AssertionFailedError $e) { - if ($this->rethrow) { - throw $e; - } - return false; - } - } - - /** - * - */ - public function __toString() - { - return ''; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/Pattern.php b/vendor/mockery/mockery/library/Mockery/Matcher/Pattern.php deleted file mode 100644 index 362c366..0000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/Pattern.php +++ /dev/null @@ -1,45 +0,0 @@ -_expected, (string) $actual) >= 1; - } - - /** - * Return a string representation of this Matcher - * - * @return string - */ - public function __toString() - { - return ''; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/Subset.php b/vendor/mockery/mockery/library/Mockery/Matcher/Subset.php deleted file mode 100644 index 5e706c8..0000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/Subset.php +++ /dev/null @@ -1,92 +0,0 @@ -expected = $expected; - $this->strict = $strict; - } - - /** - * @param array $expected Expected subset of data - * - * @return Subset - */ - public static function strict(array $expected) - { - return new static($expected, true); - } - - /** - * @param array $expected Expected subset of data - * - * @return Subset - */ - public static function loose(array $expected) - { - return new static($expected, false); - } - - /** - * Check if the actual value matches the expected. - * - * @param mixed $actual - * @return bool - */ - public function match(&$actual) - { - if (!is_array($actual)) { - return false; - } - - if ($this->strict) { - return $actual === array_replace_recursive($actual, $this->expected); - } - - return $actual == array_replace_recursive($actual, $this->expected); - } - - /** - * Return a string representation of this Matcher - * - * @return string - */ - public function __toString() - { - $return = 'expected as $k=>$v) { - $elements[] = $k . '=' . (string) $v; - } - $return .= implode(', ', $elements) . ']>'; - return $return; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/Type.php b/vendor/mockery/mockery/library/Mockery/Matcher/Type.php deleted file mode 100644 index d81ce83..0000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/Type.php +++ /dev/null @@ -1,56 +0,0 @@ -_expected == 'real') { - $function = 'is_float'; - } else { - $function = 'is_' . strtolower($this->_expected); - } - if (function_exists($function)) { - return $function($actual); - } elseif (is_string($this->_expected) - && (class_exists($this->_expected) || interface_exists($this->_expected))) { - return $actual instanceof $this->_expected; - } - return false; - } - - /** - * Return a string representation of this Matcher - * - * @return string - */ - public function __toString() - { - return '<' . ucfirst($this->_expected) . '>'; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/MethodCall.php b/vendor/mockery/mockery/library/Mockery/MethodCall.php deleted file mode 100644 index db68fd8..0000000 --- a/vendor/mockery/mockery/library/Mockery/MethodCall.php +++ /dev/null @@ -1,43 +0,0 @@ -method = $method; - $this->args = $args; - } - - public function getMethod() - { - return $this->method; - } - - public function getArgs() - { - return $this->args; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Mock.php b/vendor/mockery/mockery/library/Mockery/Mock.php deleted file mode 100644 index d6ac4ff..0000000 --- a/vendor/mockery/mockery/library/Mockery/Mock.php +++ /dev/null @@ -1,974 +0,0 @@ -_mockery_container = $container; - if (!is_null($partialObject)) { - $this->_mockery_partial = $partialObject; - } - - if (!\Mockery::getConfiguration()->mockingNonExistentMethodsAllowed()) { - foreach ($this->mockery_getMethods() as $method) { - if ($method->isPublic()) { - $this->_mockery_mockableMethods[] = $method->getName(); - } - } - } - - $this->_mockery_instanceMock = $instanceMock; - } - - /** - * Set expected method calls - * - * @param string ...$methodNames one or many methods that are expected to be called in this mock - * - * @return \Mockery\ExpectationInterface|\Mockery\Expectation|\Mockery\HigherOrderMessage - */ - public function shouldReceive(...$methodNames) - { - if (count($methodNames) === 0) { - return new HigherOrderMessage($this, "shouldReceive"); - } - - foreach ($methodNames as $method) { - if ("" == $method) { - throw new \InvalidArgumentException("Received empty method name"); - } - } - - $self = $this; - $allowMockingProtectedMethods = $this->_mockery_allowMockingProtectedMethods; - - $lastExpectation = \Mockery::parseShouldReturnArgs( - $this, - $methodNames, - function ($method) use ($self, $allowMockingProtectedMethods) { - $rm = $self->mockery_getMethod($method); - if ($rm) { - if ($rm->isPrivate()) { - throw new \InvalidArgumentException("$method() cannot be mocked as it is a private method"); - } - if (!$allowMockingProtectedMethods && $rm->isProtected()) { - throw new \InvalidArgumentException("$method() cannot be mocked as it is a protected method and mocking protected methods is not enabled for the currently used mock object. Use shouldAllowMockingProtectedMethods() to enable mocking of protected methods."); - } - } - - $director = $self->mockery_getExpectationsFor($method); - if (!$director) { - $director = new \Mockery\ExpectationDirector($method, $self); - $self->mockery_setExpectationsFor($method, $director); - } - $expectation = new \Mockery\Expectation($self, $method); - $director->addExpectation($expectation); - return $expectation; - } - ); - return $lastExpectation; - } - - // start method allows - /** - * @param mixed $something String method name or map of method => return - * @return self|\Mockery\ExpectationInterface|\Mockery\Expectation|\Mockery\HigherOrderMessage - */ - public function allows($something = []) - { - if (is_string($something)) { - return $this->shouldReceive($something); - } - - if (empty($something)) { - return $this->shouldReceive(); - } - - foreach ($something as $method => $returnValue) { - $this->shouldReceive($method)->andReturn($returnValue); - } - - return $this; - } - // end method allows - - // start method expects - /** - /** - * @param mixed $something String method name (optional) - * @return \Mockery\ExpectationInterface|\Mockery\Expectation|ExpectsHigherOrderMessage - */ - public function expects($something = null) - { - if (is_string($something)) { - return $this->shouldReceive($something)->once(); - } - - return new ExpectsHigherOrderMessage($this); - } - // end method expects - - /** - * Shortcut method for setting an expectation that a method should not be called. - * - * @param string ...$methodNames one or many methods that are expected not to be called in this mock - * @return \Mockery\ExpectationInterface|\Mockery\Expectation|\Mockery\HigherOrderMessage - */ - public function shouldNotReceive(...$methodNames) - { - if (count($methodNames) === 0) { - return new HigherOrderMessage($this, "shouldNotReceive"); - } - - $expectation = call_user_func_array(array($this, 'shouldReceive'), $methodNames); - $expectation->never(); - return $expectation; - } - - /** - * Allows additional methods to be mocked that do not explicitly exist on mocked class - * @param String $method name of the method to be mocked - * @return Mock - */ - public function shouldAllowMockingMethod($method) - { - $this->_mockery_mockableMethods[] = $method; - return $this; - } - - /** - * Set mock to ignore unexpected methods and return Undefined class - * @param mixed $returnValue the default return value for calls to missing functions on this mock - * @param bool $recursive Specify if returned mocks should also have shouldIgnoreMissing set - * @return Mock - */ - public function shouldIgnoreMissing($returnValue = null, $recursive = false) - { - $this->_mockery_ignoreMissing = true; - $this->_mockery_ignoreMissingRecursive = $recursive; - $this->_mockery_defaultReturnValue = $returnValue; - return $this; - } - - public function asUndefined() - { - $this->_mockery_ignoreMissing = true; - $this->_mockery_defaultReturnValue = new \Mockery\Undefined(); - return $this; - } - - /** - * @return Mock - */ - public function shouldAllowMockingProtectedMethods() - { - if (!\Mockery::getConfiguration()->mockingNonExistentMethodsAllowed()) { - foreach ($this->mockery_getMethods() as $method) { - if ($method->isProtected()) { - $this->_mockery_mockableMethods[] = $method->getName(); - } - } - } - - $this->_mockery_allowMockingProtectedMethods = true; - return $this; - } - - - /** - * Set mock to defer unexpected methods to it's parent - * - * This is particularly useless for this class, as it doesn't have a parent, - * but included for completeness - * - * @deprecated 2.0.0 Please use makePartial() instead - * - * @return Mock - */ - public function shouldDeferMissing() - { - return $this->makePartial(); - } - - /** - * Set mock to defer unexpected methods to it's parent - * - * It was an alias for shouldDeferMissing(), which will be removed - * in 2.0.0. - * - * @return Mock - */ - public function makePartial() - { - $this->_mockery_deferMissing = true; - return $this; - } - - /** - * In the event shouldReceive() accepting one or more methods/returns, - * this method will switch them from normal expectations to default - * expectations - * - * @return self - */ - public function byDefault() - { - foreach ($this->_mockery_expectations as $director) { - $exps = $director->getExpectations(); - foreach ($exps as $exp) { - $exp->byDefault(); - } - } - return $this; - } - - /** - * Capture calls to this mock - */ - public function __call($method, array $args) - { - return $this->_mockery_handleMethodCall($method, $args); - } - - public static function __callStatic($method, array $args) - { - return self::_mockery_handleStaticMethodCall($method, $args); - } - - /** - * Forward calls to this magic method to the __call method - */ - public function __toString() - { - return $this->__call('__toString', array()); - } - - /** - * Iterate across all expectation directors and validate each - * - * @throws \Mockery\CountValidator\Exception - * @return void - */ - public function mockery_verify() - { - if ($this->_mockery_verified) { - return; - } - if (isset($this->_mockery_ignoreVerification) - && $this->_mockery_ignoreVerification == true) { - return; - } - $this->_mockery_verified = true; - foreach ($this->_mockery_expectations as $director) { - $director->verify(); - } - } - - /** - * Gets a list of exceptions thrown by this mock - * - * @return array - */ - public function mockery_thrownExceptions() - { - return $this->_mockery_thrownExceptions; - } - - /** - * Tear down tasks for this mock - * - * @return void - */ - public function mockery_teardown() - { - } - - /** - * Fetch the next available allocation order number - * - * @return int - */ - public function mockery_allocateOrder() - { - $this->_mockery_allocatedOrder += 1; - return $this->_mockery_allocatedOrder; - } - - /** - * Set ordering for a group - * - * @param mixed $group - * @param int $order - */ - public function mockery_setGroup($group, $order) - { - $this->_mockery_groups[$group] = $order; - } - - /** - * Fetch array of ordered groups - * - * @return array - */ - public function mockery_getGroups() - { - return $this->_mockery_groups; - } - - /** - * Set current ordered number - * - * @param int $order - */ - public function mockery_setCurrentOrder($order) - { - $this->_mockery_currentOrder = $order; - return $this->_mockery_currentOrder; - } - - /** - * Get current ordered number - * - * @return int - */ - public function mockery_getCurrentOrder() - { - return $this->_mockery_currentOrder; - } - - /** - * Validate the current mock's ordering - * - * @param string $method - * @param int $order - * @throws \Mockery\Exception - * @return void - */ - public function mockery_validateOrder($method, $order) - { - if ($order < $this->_mockery_currentOrder) { - $exception = new \Mockery\Exception\InvalidOrderException( - 'Method ' . __CLASS__ . '::' . $method . '()' - . ' called out of order: expected order ' - . $order . ', was ' . $this->_mockery_currentOrder - ); - $exception->setMock($this) - ->setMethodName($method) - ->setExpectedOrder($order) - ->setActualOrder($this->_mockery_currentOrder); - throw $exception; - } - $this->mockery_setCurrentOrder($order); - } - - /** - * Gets the count of expectations for this mock - * - * @return int - */ - public function mockery_getExpectationCount() - { - $count = $this->_mockery_expectations_count; - foreach ($this->_mockery_expectations as $director) { - $count += $director->getExpectationCount(); - } - return $count; - } - - /** - * Return the expectations director for the given method - * - * @var string $method - * @return \Mockery\ExpectationDirector|null - */ - public function mockery_setExpectationsFor($method, \Mockery\ExpectationDirector $director) - { - $this->_mockery_expectations[$method] = $director; - } - - /** - * Return the expectations director for the given method - * - * @var string $method - * @return \Mockery\ExpectationDirector|null - */ - public function mockery_getExpectationsFor($method) - { - if (isset($this->_mockery_expectations[$method])) { - return $this->_mockery_expectations[$method]; - } - } - - /** - * Find an expectation matching the given method and arguments - * - * @var string $method - * @var array $args - * @return \Mockery\Expectation|null - */ - public function mockery_findExpectation($method, array $args) - { - if (!isset($this->_mockery_expectations[$method])) { - return null; - } - $director = $this->_mockery_expectations[$method]; - - return $director->findExpectation($args); - } - - /** - * Return the container for this mock - * - * @return \Mockery\Container - */ - public function mockery_getContainer() - { - return $this->_mockery_container; - } - - /** - * Return the name for this mock - * - * @return string - */ - public function mockery_getName() - { - return __CLASS__; - } - - /** - * @return array - */ - public function mockery_getMockableProperties() - { - return $this->_mockery_mockableProperties; - } - - public function __isset($name) - { - if (false === stripos($name, '_mockery_') && get_parent_class($this) && method_exists(get_parent_class($this), '__isset')) { - return call_user_func('parent::__isset', $name); - } - - return false; - } - - public function mockery_getExpectations() - { - return $this->_mockery_expectations; - } - - /** - * Calls a parent class method and returns the result. Used in a passthru - * expectation where a real return value is required while still taking - * advantage of expectation matching and call count verification. - * - * @param string $name - * @param array $args - * @return mixed - */ - public function mockery_callSubjectMethod($name, array $args) - { - if (!method_exists($this, $name) && get_parent_class($this) && method_exists(get_parent_class($this), '__call')) { - return call_user_func('parent::__call', $name, $args); - } - return call_user_func_array('parent::' . $name, $args); - } - - /** - * @return string[] - */ - public function mockery_getMockableMethods() - { - return $this->_mockery_mockableMethods; - } - - /** - * @return bool - */ - public function mockery_isAnonymous() - { - $rfc = new \ReflectionClass($this); - - // PHP 8 has Stringable interface - $interfaces = array_filter($rfc->getInterfaces(), function ($i) { - return $i->getName() !== 'Stringable'; - }); - - return false === $rfc->getParentClass() && 2 === count($interfaces); - } - - public function mockery_isInstance() - { - return $this->_mockery_instanceMock; - } - - public function __wakeup() - { - /** - * This does not add __wakeup method support. It's a blind method and any - * expected __wakeup work will NOT be performed. It merely cuts off - * annoying errors where a __wakeup exists but is not essential when - * mocking - */ - } - - public function __destruct() - { - /** - * Overrides real class destructor in case if class was created without original constructor - */ - } - - public function mockery_getMethod($name) - { - foreach ($this->mockery_getMethods() as $method) { - if ($method->getName() == $name) { - return $method; - } - } - - return null; - } - - /** - * @param string $name Method name. - * - * @return mixed Generated return value based on the declared return value of the named method. - */ - public function mockery_returnValueForMethod($name) - { - $rm = $this->mockery_getMethod($name); - - if ($rm === null) { - return null; - } - - $returnType = Reflector::getSimplestReturnType($rm); - - switch ($returnType) { - case null: return null; - case 'string': return ''; - case 'int': return 0; - case 'float': return 0.0; - case 'bool': return false; - - case 'array': - case 'iterable': - return []; - - case 'callable': - case '\Closure': - return function () { - }; - - case '\Traversable': - case '\Generator': - $generator = function () { yield; }; - return $generator(); - - case 'void': - return null; - - case 'object': - $mock = \Mockery::mock(); - if ($this->_mockery_ignoreMissingRecursive) { - $mock->shouldIgnoreMissing($this->_mockery_defaultReturnValue, true); - } - return $mock; - - default: - $mock = \Mockery::mock($returnType); - if ($this->_mockery_ignoreMissingRecursive) { - $mock->shouldIgnoreMissing($this->_mockery_defaultReturnValue, true); - } - return $mock; - } - } - - public function shouldHaveReceived($method = null, $args = null) - { - if ($method === null) { - return new HigherOrderMessage($this, "shouldHaveReceived"); - } - - $expectation = new \Mockery\VerificationExpectation($this, $method); - if (null !== $args) { - $expectation->withArgs($args); - } - $expectation->atLeast()->once(); - $director = new \Mockery\VerificationDirector($this->_mockery_getReceivedMethodCalls(), $expectation); - $this->_mockery_expectations_count++; - $director->verify(); - return $director; - } - - public function shouldHaveBeenCalled() - { - return $this->shouldHaveReceived("__invoke"); - } - - public function shouldNotHaveReceived($method = null, $args = null) - { - if ($method === null) { - return new HigherOrderMessage($this, "shouldNotHaveReceived"); - } - - $expectation = new \Mockery\VerificationExpectation($this, $method); - if (null !== $args) { - $expectation->withArgs($args); - } - $expectation->never(); - $director = new \Mockery\VerificationDirector($this->_mockery_getReceivedMethodCalls(), $expectation); - $this->_mockery_expectations_count++; - $director->verify(); - return null; - } - - public function shouldNotHaveBeenCalled(array $args = null) - { - return $this->shouldNotHaveReceived("__invoke", $args); - } - - protected static function _mockery_handleStaticMethodCall($method, array $args) - { - $associatedRealObject = \Mockery::fetchMock(__CLASS__); - try { - return $associatedRealObject->__call($method, $args); - } catch (BadMethodCallException $e) { - throw new BadMethodCallException( - 'Static method ' . $associatedRealObject->mockery_getName() . '::' . $method - . '() does not exist on this mock object', - 0, - $e - ); - } - } - - protected function _mockery_getReceivedMethodCalls() - { - return $this->_mockery_receivedMethodCalls ?: $this->_mockery_receivedMethodCalls = new \Mockery\ReceivedMethodCalls(); - } - - /** - * Called when an instance Mock was created and its constructor is getting called - * - * @see \Mockery\Generator\StringManipulation\Pass\InstanceMockPass - * @param array $args - */ - protected function _mockery_constructorCalled(array $args) - { - if (!isset($this->_mockery_expectations['__construct']) /* _mockery_handleMethodCall runs the other checks */) { - return; - } - $this->_mockery_handleMethodCall('__construct', $args); - } - - protected function _mockery_findExpectedMethodHandler($method) - { - if (isset($this->_mockery_expectations[$method])) { - return $this->_mockery_expectations[$method]; - } - - $lowerCasedMockeryExpectations = array_change_key_case($this->_mockery_expectations, CASE_LOWER); - $lowerCasedMethod = strtolower($method); - - if (isset($lowerCasedMockeryExpectations[$lowerCasedMethod])) { - return $lowerCasedMockeryExpectations[$lowerCasedMethod]; - } - - return null; - } - - protected function _mockery_handleMethodCall($method, array $args) - { - $this->_mockery_getReceivedMethodCalls()->push(new \Mockery\MethodCall($method, $args)); - - $rm = $this->mockery_getMethod($method); - if ($rm && $rm->isProtected() && !$this->_mockery_allowMockingProtectedMethods) { - if ($rm->isAbstract()) { - return; - } - - try { - $prototype = $rm->getPrototype(); - if ($prototype->isAbstract()) { - return; - } - } catch (\ReflectionException $re) { - // noop - there is no hasPrototype method - } - - return call_user_func_array("parent::$method", $args); - } - - $handler = $this->_mockery_findExpectedMethodHandler($method); - - if ($handler !== null && !$this->_mockery_disableExpectationMatching) { - try { - return $handler->call($args); - } catch (\Mockery\Exception\NoMatchingExpectationException $e) { - if (!$this->_mockery_ignoreMissing && !$this->_mockery_deferMissing) { - throw $e; - } - } - } - - if (!is_null($this->_mockery_partial) && - (method_exists($this->_mockery_partial, $method) || method_exists($this->_mockery_partial, '__call')) - ) { - return call_user_func_array(array($this->_mockery_partial, $method), $args); - } elseif ($this->_mockery_deferMissing && is_callable("parent::$method") - && (!$this->hasMethodOverloadingInParentClass() || (get_parent_class($this) && method_exists(get_parent_class($this), $method)))) { - return call_user_func_array("parent::$method", $args); - } elseif ($this->_mockery_deferMissing && get_parent_class($this) && method_exists(get_parent_class($this), '__call')) { - return call_user_func('parent::__call', $method, $args); - } elseif ($method == '__toString') { - // __toString is special because we force its addition to the class API regardless of the - // original implementation. Thus, we should always return a string rather than honor - // _mockery_ignoreMissing and break the API with an error. - return sprintf("%s#%s", __CLASS__, spl_object_hash($this)); - } elseif ($this->_mockery_ignoreMissing) { - if (\Mockery::getConfiguration()->mockingNonExistentMethodsAllowed() || (!is_null($this->_mockery_partial) && method_exists($this->_mockery_partial, $method)) || is_callable("parent::$method")) { - if ($this->_mockery_defaultReturnValue instanceof \Mockery\Undefined) { - return call_user_func_array(array($this->_mockery_defaultReturnValue, $method), $args); - } elseif (null === $this->_mockery_defaultReturnValue) { - return $this->mockery_returnValueForMethod($method); - } - - return $this->_mockery_defaultReturnValue; - } - } - - $message = 'Method ' . __CLASS__ . '::' . $method . - '() does not exist on this mock object'; - - if (!is_null($rm)) { - $message = 'Received ' . __CLASS__ . - '::' . $method . '(), but no expectations were specified'; - } - - $bmce = new BadMethodCallException($message); - $this->_mockery_thrownExceptions[] = $bmce; - throw $bmce; - } - - /** - * Uses reflection to get the list of all - * methods within the current mock object - * - * @return array - */ - protected function mockery_getMethods() - { - if (static::$_mockery_methods && \Mockery::getConfiguration()->reflectionCacheEnabled()) { - return static::$_mockery_methods; - } - - if (isset($this->_mockery_partial)) { - $reflected = new \ReflectionObject($this->_mockery_partial); - } else { - $reflected = new \ReflectionClass($this); - } - - return static::$_mockery_methods = $reflected->getMethods(); - } - - private function hasMethodOverloadingInParentClass() - { - // if there's __call any name would be callable - return is_callable('parent::aFunctionNameThatNoOneWouldEverUseInRealLife12345'); - } - - /** - * @return array - */ - private function getNonPublicMethods() - { - return array_map( - function ($method) { - return $method->getName(); - }, - array_filter($this->mockery_getMethods(), function ($method) { - return !$method->isPublic(); - }) - ); - } -} diff --git a/vendor/mockery/mockery/library/Mockery/MockInterface.php b/vendor/mockery/mockery/library/Mockery/MockInterface.php deleted file mode 100644 index 7c1774b..0000000 --- a/vendor/mockery/mockery/library/Mockery/MockInterface.php +++ /dev/null @@ -1,38 +0,0 @@ - return - * @return self|\Mockery\ExpectationInterface|\Mockery\Expectation|\Mockery\HigherOrderMessage - */ - public function allows($something = []); - - /** - * @param mixed $something String method name (optional) - * @return \Mockery\ExpectationInterface|\Mockery\Expectation|\Mockery\ExpectsHigherOrderMessage - */ - public function expects($something = null); -} diff --git a/vendor/mockery/mockery/library/Mockery/QuickDefinitionsConfiguration.php b/vendor/mockery/mockery/library/Mockery/QuickDefinitionsConfiguration.php deleted file mode 100644 index b0eea66..0000000 --- a/vendor/mockery/mockery/library/Mockery/QuickDefinitionsConfiguration.php +++ /dev/null @@ -1,56 +0,0 @@ -_quickDefinitionsApplicationMode = $newValue - ? self::QUICK_DEFINITIONS_MODE_MOCK_AT_LEAST_ONCE - : self::QUICK_DEFINITIONS_MODE_DEFAULT_EXPECTATION; - } - - return $this->_quickDefinitionsApplicationMode === self::QUICK_DEFINITIONS_MODE_MOCK_AT_LEAST_ONCE; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/ReceivedMethodCalls.php b/vendor/mockery/mockery/library/Mockery/ReceivedMethodCalls.php deleted file mode 100644 index 8ed81f1..0000000 --- a/vendor/mockery/mockery/library/Mockery/ReceivedMethodCalls.php +++ /dev/null @@ -1,48 +0,0 @@ -methodCalls[] = $methodCall; - } - - public function verify(Expectation $expectation) - { - foreach ($this->methodCalls as $methodCall) { - if ($methodCall->getMethod() !== $expectation->getName()) { - continue; - } - - if (!$expectation->matchArgs($methodCall->getArgs())) { - continue; - } - - $expectation->verifyCall($methodCall->getArgs()); - } - - $expectation->verify(); - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Reflector.php b/vendor/mockery/mockery/library/Mockery/Reflector.php deleted file mode 100644 index 9672924..0000000 --- a/vendor/mockery/mockery/library/Mockery/Reflector.php +++ /dev/null @@ -1,224 +0,0 @@ -getType(); - - return $type instanceof \ReflectionNamedType && $type->getName(); - } - - /** - * Compute the string representation for the paramater type. - * - * @param \ReflectionParameter $param - * @param bool $withoutNullable - * - * @return string|null - */ - public static function getTypeHint(\ReflectionParameter $param, $withoutNullable = false) - { - if (!$param->hasType()) { - return null; - } - - $type = $param->getType(); - $declaringClass = $param->getDeclaringClass(); - $typeHint = self::typeToString($type, $declaringClass); - - return (!$withoutNullable && $type->allowsNull()) ? self::formatNullableType($typeHint) : $typeHint; - } - - /** - * Compute the string representation for the return type. - * - * @param \ReflectionParameter $param - * @param bool $withoutNullable - * - * @return string|null - */ - public static function getReturnType(\ReflectionMethod $method, $withoutNullable = false) - { - $type = $method->getReturnType(); - - if (is_null($type) && method_exists($method, 'getTentativeReturnType')) { - $type = $method->getTentativeReturnType(); - } - - if (is_null($type)) { - return null; - } - - $typeHint = self::typeToString($type, $method->getDeclaringClass()); - - return (!$withoutNullable && $type->allowsNull()) ? self::formatNullableType($typeHint) : $typeHint; - } - - /** - * Compute the string representation for the simplest return type. - * - * @param \ReflectionParameter $param - * - * @return string|null - */ - public static function getSimplestReturnType(\ReflectionMethod $method) - { - $type = $method->getReturnType(); - - if (is_null($type) && method_exists($method, 'getTentativeReturnType')) { - $type = $method->getTentativeReturnType(); - } - - if (is_null($type) || $type->allowsNull()) { - return null; - } - - $typeInformation = self::getTypeInformation($type, $method->getDeclaringClass()); - - // return the first primitive type hint - foreach ($typeInformation as $info) { - if ($info['isPrimitive']) { - return $info['typeHint']; - } - } - - // if no primitive type, return the first type - foreach ($typeInformation as $info) { - return $info['typeHint']; - } - - return null; - } - - /** - * Get the string representation of the given type. - * - * @param \ReflectionType $type - * @param string $declaringClass - * - * @return string|null - */ - private static function typeToString(\ReflectionType $type, \ReflectionClass $declaringClass) - { - return \implode('|', \array_map(function (array $typeInformation) { - return $typeInformation['typeHint']; - }, self::getTypeInformation($type, $declaringClass))); - } - - /** - * Get the string representation of the given type. - * - * @param \ReflectionType $type - * @param \ReflectionClass $declaringClass - * - * @return list - */ - private static function getTypeInformation(\ReflectionType $type, \ReflectionClass $declaringClass) - { - // PHP 8 union types can be recursively processed - if ($type instanceof \ReflectionUnionType) { - $types = []; - - foreach ($type->getTypes() as $innterType) { - foreach (self::getTypeInformation($innterType, $declaringClass) as $info) { - if ($info['typeHint'] === 'null' && $info['isPrimitive']) { - continue; - } - - $types[] = $info; - } - } - - return $types; - } - - // $type must be an instance of \ReflectionNamedType - $typeHint = $type->getName(); - - // builtins can be returned as is - if ($type->isBuiltin()) { - return [ - [ - 'typeHint' => $typeHint, - 'isPrimitive' => in_array($typeHint, ['array', 'bool', 'int', 'float', 'null', 'object', 'string']), - ], - ]; - } - - // 'static' can be returned as is - if ($typeHint === 'static') { - return [ - [ - 'typeHint' => $typeHint, - 'isPrimitive' => false, - ], - ]; - } - - // 'self' needs to be resolved to the name of the declaring class - if ($typeHint === 'self') { - $typeHint = $declaringClass->getName(); - } - - // 'parent' needs to be resolved to the name of the parent class - if ($typeHint === 'parent') { - $typeHint = $declaringClass->getParentClass()->getName(); - } - - // class names need prefixing with a slash - return [ - [ - 'typeHint' => sprintf('\\%s', $typeHint), - 'isPrimitive' => false, - ], - ]; - } - - /** - * Format the given type as a nullable type. - * - * @param string $typeHint - * - * @return string - */ - private static function formatNullableType($typeHint) - { - if (\PHP_VERSION_ID < 80000) { - return sprintf('?%s', $typeHint); - } - - return $typeHint === 'mixed' ? 'mixed' : sprintf('%s|null', $typeHint); - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Undefined.php b/vendor/mockery/mockery/library/Mockery/Undefined.php deleted file mode 100644 index 53b05e9..0000000 --- a/vendor/mockery/mockery/library/Mockery/Undefined.php +++ /dev/null @@ -1,46 +0,0 @@ -receivedMethodCalls = $receivedMethodCalls; - $this->expectation = $expectation; - } - - public function verify() - { - return $this->receivedMethodCalls->verify($this->expectation); - } - - public function with(...$args) - { - return $this->cloneApplyAndVerify("with", $args); - } - - public function withArgs($args) - { - return $this->cloneApplyAndVerify("withArgs", array($args)); - } - - public function withNoArgs() - { - return $this->cloneApplyAndVerify("withNoArgs", array()); - } - - public function withAnyArgs() - { - return $this->cloneApplyAndVerify("withAnyArgs", array()); - } - - public function times($limit = null) - { - return $this->cloneWithoutCountValidatorsApplyAndVerify("times", array($limit)); - } - - public function once() - { - return $this->cloneWithoutCountValidatorsApplyAndVerify("once", array()); - } - - public function twice() - { - return $this->cloneWithoutCountValidatorsApplyAndVerify("twice", array()); - } - - public function atLeast() - { - return $this->cloneWithoutCountValidatorsApplyAndVerify("atLeast", array()); - } - - public function atMost() - { - return $this->cloneWithoutCountValidatorsApplyAndVerify("atMost", array()); - } - - public function between($minimum, $maximum) - { - return $this->cloneWithoutCountValidatorsApplyAndVerify("between", array($minimum, $maximum)); - } - - protected function cloneWithoutCountValidatorsApplyAndVerify($method, $args) - { - $expectation = clone $this->expectation; - $expectation->clearCountValidators(); - call_user_func_array(array($expectation, $method), $args); - $director = new VerificationDirector($this->receivedMethodCalls, $expectation); - $director->verify(); - return $director; - } - - protected function cloneApplyAndVerify($method, $args) - { - $expectation = clone $this->expectation; - call_user_func_array(array($expectation, $method), $args); - $director = new VerificationDirector($this->receivedMethodCalls, $expectation); - $director->verify(); - return $director; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/VerificationExpectation.php b/vendor/mockery/mockery/library/Mockery/VerificationExpectation.php deleted file mode 100644 index 3844a09..0000000 --- a/vendor/mockery/mockery/library/Mockery/VerificationExpectation.php +++ /dev/null @@ -1,35 +0,0 @@ -_countValidators = array(); - } - - public function __clone() - { - parent::__clone(); - $this->_actualCount = 0; - } -} diff --git a/vendor/mockery/mockery/library/helpers.php b/vendor/mockery/mockery/library/helpers.php deleted file mode 100644 index 0756a32..0000000 --- a/vendor/mockery/mockery/library/helpers.php +++ /dev/null @@ -1,65 +0,0 @@ -copy($myObject); -``` - - -## Why? - -- How do you create copies of your objects? - -```php -$myCopy = clone $myObject; -``` - -- How do you create **deep** copies of your objects (i.e. copying also all the objects referenced in the properties)? - -You use [`__clone()`](http://www.php.net/manual/en/language.oop5.cloning.php#object.clone) and implement the behavior -yourself. - -- But how do you handle **cycles** in the association graph? - -Now you're in for a big mess :( - -![association graph](doc/graph.png) - - -### Using simply `clone` - -![Using clone](doc/clone.png) - - -### Overridding `__clone()` - -![Overridding __clone](doc/deep-clone.png) - - -### With `DeepCopy` - -![With DeepCopy](doc/deep-copy.png) - - -## How it works - -DeepCopy recursively traverses all the object's properties and clones them. To avoid cloning the same object twice it -keeps a hash map of all instances and thus preserves the object graph. - -To use it: - -```php -use function DeepCopy\deep_copy; - -$copy = deep_copy($var); -``` - -Alternatively, you can create your own `DeepCopy` instance to configure it differently for example: - -```php -use DeepCopy\DeepCopy; - -$copier = new DeepCopy(true); - -$copy = $copier->copy($var); -``` - -You may want to roll your own deep copy function: - -```php -namespace Acme; - -use DeepCopy\DeepCopy; - -function deep_copy($var) -{ - static $copier = null; - - if (null === $copier) { - $copier = new DeepCopy(true); - } - - return $copier->copy($var); -} -``` - - -## Going further - -You can add filters to customize the copy process. - -The method to add a filter is `DeepCopy\DeepCopy::addFilter($filter, $matcher)`, -with `$filter` implementing `DeepCopy\Filter\Filter` -and `$matcher` implementing `DeepCopy\Matcher\Matcher`. - -We provide some generic filters and matchers. - - -### Matchers - - - `DeepCopy\Matcher` applies on a object attribute. - - `DeepCopy\TypeMatcher` applies on any element found in graph, including array elements. - - -#### Property name - -The `PropertyNameMatcher` will match a property by its name: - -```php -use DeepCopy\Matcher\PropertyNameMatcher; - -// Will apply a filter to any property of any objects named "id" -$matcher = new PropertyNameMatcher('id'); -``` - - -#### Specific property - -The `PropertyMatcher` will match a specific property of a specific class: - -```php -use DeepCopy\Matcher\PropertyMatcher; - -// Will apply a filter to the property "id" of any objects of the class "MyClass" -$matcher = new PropertyMatcher('MyClass', 'id'); -``` - - -#### Type - -The `TypeMatcher` will match any element by its type (instance of a class or any value that could be parameter of -[gettype()](http://php.net/manual/en/function.gettype.php) function): - -```php -use DeepCopy\TypeMatcher\TypeMatcher; - -// Will apply a filter to any object that is an instance of Doctrine\Common\Collections\Collection -$matcher = new TypeMatcher('Doctrine\Common\Collections\Collection'); -``` - - -### Filters - -- `DeepCopy\Filter` applies a transformation to the object attribute matched by `DeepCopy\Matcher` -- `DeepCopy\TypeFilter` applies a transformation to any element matched by `DeepCopy\TypeMatcher` - - -#### `SetNullFilter` (filter) - -Let's say for example that you are copying a database record (or a Doctrine entity), so you want the copy not to have -any ID: - -```php -use DeepCopy\DeepCopy; -use DeepCopy\Filter\SetNullFilter; -use DeepCopy\Matcher\PropertyNameMatcher; - -$object = MyClass::load(123); -echo $object->id; // 123 - -$copier = new DeepCopy(); -$copier->addFilter(new SetNullFilter(), new PropertyNameMatcher('id')); - -$copy = $copier->copy($object); - -echo $copy->id; // null -``` - - -#### `KeepFilter` (filter) - -If you want a property to remain untouched (for example, an association to an object): - -```php -use DeepCopy\DeepCopy; -use DeepCopy\Filter\KeepFilter; -use DeepCopy\Matcher\PropertyMatcher; - -$copier = new DeepCopy(); -$copier->addFilter(new KeepFilter(), new PropertyMatcher('MyClass', 'category')); - -$copy = $copier->copy($object); -// $copy->category has not been touched -``` - - -#### `DoctrineCollectionFilter` (filter) - -If you use Doctrine and want to copy an entity, you will need to use the `DoctrineCollectionFilter`: - -```php -use DeepCopy\DeepCopy; -use DeepCopy\Filter\Doctrine\DoctrineCollectionFilter; -use DeepCopy\Matcher\PropertyTypeMatcher; - -$copier = new DeepCopy(); -$copier->addFilter(new DoctrineCollectionFilter(), new PropertyTypeMatcher('Doctrine\Common\Collections\Collection')); - -$copy = $copier->copy($object); -``` - - -#### `DoctrineEmptyCollectionFilter` (filter) - -If you use Doctrine and want to copy an entity who contains a `Collection` that you want to be reset, you can use the -`DoctrineEmptyCollectionFilter` - -```php -use DeepCopy\DeepCopy; -use DeepCopy\Filter\Doctrine\DoctrineEmptyCollectionFilter; -use DeepCopy\Matcher\PropertyMatcher; - -$copier = new DeepCopy(); -$copier->addFilter(new DoctrineEmptyCollectionFilter(), new PropertyMatcher('MyClass', 'myProperty')); - -$copy = $copier->copy($object); - -// $copy->myProperty will return an empty collection -``` - - -#### `DoctrineProxyFilter` (filter) - -If you use Doctrine and use cloning on lazy loaded entities, you might encounter errors mentioning missing fields on a -Doctrine proxy class (...\\\_\_CG\_\_\Proxy). -You can use the `DoctrineProxyFilter` to load the actual entity behind the Doctrine proxy class. -**Make sure, though, to put this as one of your very first filters in the filter chain so that the entity is loaded -before other filters are applied!** - -```php -use DeepCopy\DeepCopy; -use DeepCopy\Filter\Doctrine\DoctrineProxyFilter; -use DeepCopy\Matcher\Doctrine\DoctrineProxyMatcher; - -$copier = new DeepCopy(); -$copier->addFilter(new DoctrineProxyFilter(), new DoctrineProxyMatcher()); - -$copy = $copier->copy($object); - -// $copy should now contain a clone of all entities, including those that were not yet fully loaded. -``` - - -#### `ReplaceFilter` (type filter) - -1. If you want to replace the value of a property: - -```php -use DeepCopy\DeepCopy; -use DeepCopy\Filter\ReplaceFilter; -use DeepCopy\Matcher\PropertyMatcher; - -$copier = new DeepCopy(); -$callback = function ($currentValue) { - return $currentValue . ' (copy)' -}; -$copier->addFilter(new ReplaceFilter($callback), new PropertyMatcher('MyClass', 'title')); - -$copy = $copier->copy($object); - -// $copy->title will contain the data returned by the callback, e.g. 'The title (copy)' -``` - -2. If you want to replace whole element: - -```php -use DeepCopy\DeepCopy; -use DeepCopy\TypeFilter\ReplaceFilter; -use DeepCopy\TypeMatcher\TypeMatcher; - -$copier = new DeepCopy(); -$callback = function (MyClass $myClass) { - return get_class($myClass); -}; -$copier->addTypeFilter(new ReplaceFilter($callback), new TypeMatcher('MyClass')); - -$copy = $copier->copy([new MyClass, 'some string', new MyClass]); - -// $copy will contain ['MyClass', 'some string', 'MyClass'] -``` - - -The `$callback` parameter of the `ReplaceFilter` constructor accepts any PHP callable. - - -#### `ShallowCopyFilter` (type filter) - -Stop *DeepCopy* from recursively copying element, using standard `clone` instead: - -```php -use DeepCopy\DeepCopy; -use DeepCopy\TypeFilter\ShallowCopyFilter; -use DeepCopy\TypeMatcher\TypeMatcher; -use Mockery as m; - -$this->deepCopy = new DeepCopy(); -$this->deepCopy->addTypeFilter( - new ShallowCopyFilter, - new TypeMatcher(m\MockInterface::class) -); - -$myServiceWithMocks = new MyService(m::mock(MyDependency1::class), m::mock(MyDependency2::class)); -// All mocks will be just cloned, not deep copied -``` - - -## Edge cases - -The following structures cannot be deep-copied with PHP Reflection. As a result they are shallow cloned and filters are -not applied. There is two ways for you to handle them: - -- Implement your own `__clone()` method -- Use a filter with a type matcher - - -## Contributing - -DeepCopy is distributed under the MIT license. - - -### Tests - -Running the tests is simple: - -```php -vendor/bin/phpunit -``` - -### Support - -Get professional support via [the Tidelift Subscription](https://tidelift.com/subscription/pkg/packagist-myclabs-deep-copy?utm_source=packagist-myclabs-deep-copy&utm_medium=referral&utm_campaign=readme). diff --git a/vendor/myclabs/deep-copy/composer.json b/vendor/myclabs/deep-copy/composer.json deleted file mode 100644 index 45656c9..0000000 --- a/vendor/myclabs/deep-copy/composer.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "myclabs/deep-copy", - "type": "library", - "description": "Create deep copies (clones) of your objects", - "keywords": ["clone", "copy", "duplicate", "object", "object graph"], - "license": "MIT", - - "autoload": { - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - }, - "files": [ - "src/DeepCopy/deep_copy.php" - ] - }, - "autoload-dev": { - "psr-4": { - "DeepCopy\\": "fixtures/", - "DeepCopyTest\\": "tests/DeepCopyTest/" - } - }, - - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/collections": "^1.0", - "doctrine/common": "^2.6", - "phpunit/phpunit": "^7.1" - }, - "replace": { - "myclabs/deep-copy": "self.version" - }, - - "config": { - "sort-packages": true - } -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/DeepCopy.php b/vendor/myclabs/deep-copy/src/DeepCopy/DeepCopy.php deleted file mode 100644 index 15e5c68..0000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/DeepCopy.php +++ /dev/null @@ -1,298 +0,0 @@ - Filter, 'matcher' => Matcher] pairs. - */ - private $filters = []; - - /** - * Type Filters to apply. - * - * @var array Array of ['filter' => Filter, 'matcher' => Matcher] pairs. - */ - private $typeFilters = []; - - /** - * @var bool - */ - private $skipUncloneable = false; - - /** - * @var bool - */ - private $useCloneMethod; - - /** - * @param bool $useCloneMethod If set to true, when an object implements the __clone() function, it will be used - * instead of the regular deep cloning. - */ - public function __construct($useCloneMethod = false) - { - $this->useCloneMethod = $useCloneMethod; - - $this->addTypeFilter(new ArrayObjectFilter($this), new TypeMatcher(ArrayObject::class)); - $this->addTypeFilter(new DateIntervalFilter(), new TypeMatcher(DateInterval::class)); - $this->addTypeFilter(new SplDoublyLinkedListFilter($this), new TypeMatcher(SplDoublyLinkedList::class)); - } - - /** - * If enabled, will not throw an exception when coming across an uncloneable property. - * - * @param $skipUncloneable - * - * @return $this - */ - public function skipUncloneable($skipUncloneable = true) - { - $this->skipUncloneable = $skipUncloneable; - - return $this; - } - - /** - * Deep copies the given object. - * - * @param mixed $object - * - * @return mixed - */ - public function copy($object) - { - $this->hashMap = []; - - return $this->recursiveCopy($object); - } - - public function addFilter(Filter $filter, Matcher $matcher) - { - $this->filters[] = [ - 'matcher' => $matcher, - 'filter' => $filter, - ]; - } - - public function prependFilter(Filter $filter, Matcher $matcher) - { - array_unshift($this->filters, [ - 'matcher' => $matcher, - 'filter' => $filter, - ]); - } - - public function addTypeFilter(TypeFilter $filter, TypeMatcher $matcher) - { - $this->typeFilters[] = [ - 'matcher' => $matcher, - 'filter' => $filter, - ]; - } - - private function recursiveCopy($var) - { - // Matches Type Filter - if ($filter = $this->getFirstMatchedTypeFilter($this->typeFilters, $var)) { - return $filter->apply($var); - } - - // Resource - if (is_resource($var)) { - return $var; - } - - // Array - if (is_array($var)) { - return $this->copyArray($var); - } - - // Scalar - if (! is_object($var)) { - return $var; - } - - // Object - return $this->copyObject($var); - } - - /** - * Copy an array - * @param array $array - * @return array - */ - private function copyArray(array $array) - { - foreach ($array as $key => $value) { - $array[$key] = $this->recursiveCopy($value); - } - - return $array; - } - - /** - * Copies an object. - * - * @param object $object - * - * @throws CloneException - * - * @return object - */ - private function copyObject($object) - { - $objectHash = spl_object_hash($object); - - if (isset($this->hashMap[$objectHash])) { - return $this->hashMap[$objectHash]; - } - - $reflectedObject = new ReflectionObject($object); - $isCloneable = $reflectedObject->isCloneable(); - - if (false === $isCloneable) { - if ($this->skipUncloneable) { - $this->hashMap[$objectHash] = $object; - - return $object; - } - - throw new CloneException( - sprintf( - 'The class "%s" is not cloneable.', - $reflectedObject->getName() - ) - ); - } - - $newObject = clone $object; - $this->hashMap[$objectHash] = $newObject; - - if ($this->useCloneMethod && $reflectedObject->hasMethod('__clone')) { - return $newObject; - } - - if ($newObject instanceof DateTimeInterface || $newObject instanceof DateTimeZone) { - return $newObject; - } - - foreach (ReflectionHelper::getProperties($reflectedObject) as $property) { - $this->copyObjectProperty($newObject, $property); - } - - return $newObject; - } - - private function copyObjectProperty($object, ReflectionProperty $property) - { - // Ignore static properties - if ($property->isStatic()) { - return; - } - - // Apply the filters - foreach ($this->filters as $item) { - /** @var Matcher $matcher */ - $matcher = $item['matcher']; - /** @var Filter $filter */ - $filter = $item['filter']; - - if ($matcher->matches($object, $property->getName())) { - $filter->apply( - $object, - $property->getName(), - function ($object) { - return $this->recursiveCopy($object); - } - ); - - // If a filter matches, we stop processing this property - return; - } - } - - $property->setAccessible(true); - - // Ignore uninitialized properties (for PHP >7.4) - if (method_exists($property, 'isInitialized') && !$property->isInitialized($object)) { - return; - } - - $propertyValue = $property->getValue($object); - - // Copy the property - $property->setValue($object, $this->recursiveCopy($propertyValue)); - } - - /** - * Returns first filter that matches variable, `null` if no such filter found. - * - * @param array $filterRecords Associative array with 2 members: 'filter' with value of type {@see TypeFilter} and - * 'matcher' with value of type {@see TypeMatcher} - * @param mixed $var - * - * @return TypeFilter|null - */ - private function getFirstMatchedTypeFilter(array $filterRecords, $var) - { - $matched = $this->first( - $filterRecords, - function (array $record) use ($var) { - /* @var TypeMatcher $matcher */ - $matcher = $record['matcher']; - - return $matcher->matches($var); - } - ); - - return isset($matched) ? $matched['filter'] : null; - } - - /** - * Returns first element that matches predicate, `null` if no such element found. - * - * @param array $elements Array of ['filter' => Filter, 'matcher' => Matcher] pairs. - * @param callable $predicate Predicate arguments are: element. - * - * @return array|null Associative array with 2 members: 'filter' with value of type {@see TypeFilter} and 'matcher' - * with value of type {@see TypeMatcher} or `null`. - */ - private function first(array $elements, callable $predicate) - { - foreach ($elements as $element) { - if (call_user_func($predicate, $element)) { - return $element; - } - } - - return null; - } -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Exception/CloneException.php b/vendor/myclabs/deep-copy/src/DeepCopy/Exception/CloneException.php deleted file mode 100644 index c046706..0000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/Exception/CloneException.php +++ /dev/null @@ -1,9 +0,0 @@ -setAccessible(true); - $oldCollection = $reflectionProperty->getValue($object); - - $newCollection = $oldCollection->map( - function ($item) use ($objectCopier) { - return $objectCopier($item); - } - ); - - $reflectionProperty->setValue($object, $newCollection); - } -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineEmptyCollectionFilter.php b/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineEmptyCollectionFilter.php deleted file mode 100644 index 7b33fd5..0000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineEmptyCollectionFilter.php +++ /dev/null @@ -1,28 +0,0 @@ -setAccessible(true); - - $reflectionProperty->setValue($object, new ArrayCollection()); - } -} \ No newline at end of file diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineProxyFilter.php b/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineProxyFilter.php deleted file mode 100644 index 8bee8f7..0000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineProxyFilter.php +++ /dev/null @@ -1,22 +0,0 @@ -__load(); - } -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Filter.php b/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Filter.php deleted file mode 100644 index 85ba18c..0000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Filter.php +++ /dev/null @@ -1,18 +0,0 @@ -callback = $callable; - } - - /** - * Replaces the object property by the result of the callback called with the object property. - * - * {@inheritdoc} - */ - public function apply($object, $property, $objectCopier) - { - $reflectionProperty = ReflectionHelper::getProperty($object, $property); - $reflectionProperty->setAccessible(true); - - $value = call_user_func($this->callback, $reflectionProperty->getValue($object)); - - $reflectionProperty->setValue($object, $value); - } -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Filter/SetNullFilter.php b/vendor/myclabs/deep-copy/src/DeepCopy/Filter/SetNullFilter.php deleted file mode 100644 index bea86b8..0000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/Filter/SetNullFilter.php +++ /dev/null @@ -1,24 +0,0 @@ -setAccessible(true); - $reflectionProperty->setValue($object, null); - } -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/Doctrine/DoctrineProxyMatcher.php b/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/Doctrine/DoctrineProxyMatcher.php deleted file mode 100644 index ec8856f..0000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/Doctrine/DoctrineProxyMatcher.php +++ /dev/null @@ -1,22 +0,0 @@ -class = $class; - $this->property = $property; - } - - /** - * Matches a specific property of a specific class. - * - * {@inheritdoc} - */ - public function matches($object, $property) - { - return ($object instanceof $this->class) && $property == $this->property; - } -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyNameMatcher.php b/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyNameMatcher.php deleted file mode 100644 index c8ec0d2..0000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyNameMatcher.php +++ /dev/null @@ -1,32 +0,0 @@ -property = $property; - } - - /** - * Matches a property by its name. - * - * {@inheritdoc} - */ - public function matches($object, $property) - { - return $property == $this->property; - } -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyTypeMatcher.php b/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyTypeMatcher.php deleted file mode 100644 index c7f4690..0000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyTypeMatcher.php +++ /dev/null @@ -1,52 +0,0 @@ -propertyType = $propertyType; - } - - /** - * {@inheritdoc} - */ - public function matches($object, $property) - { - try { - $reflectionProperty = ReflectionHelper::getProperty($object, $property); - } catch (ReflectionException $exception) { - return false; - } - - $reflectionProperty->setAccessible(true); - - // Uninitialized properties (for PHP >7.4) - if (method_exists($reflectionProperty, 'isInitialized') && !$reflectionProperty->isInitialized($object)) { - // null instanceof $this->propertyType - return false; - } - - return $reflectionProperty->getValue($object) instanceof $this->propertyType; - } -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Reflection/ReflectionHelper.php b/vendor/myclabs/deep-copy/src/DeepCopy/Reflection/ReflectionHelper.php deleted file mode 100644 index 742410c..0000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/Reflection/ReflectionHelper.php +++ /dev/null @@ -1,78 +0,0 @@ -getProperties() does not return private properties from ancestor classes. - * - * @author muratyaman@gmail.com - * @see http://php.net/manual/en/reflectionclass.getproperties.php - * - * @param ReflectionClass $ref - * - * @return ReflectionProperty[] - */ - public static function getProperties(ReflectionClass $ref) - { - $props = $ref->getProperties(); - $propsArr = array(); - - foreach ($props as $prop) { - $propertyName = $prop->getName(); - $propsArr[$propertyName] = $prop; - } - - if ($parentClass = $ref->getParentClass()) { - $parentPropsArr = self::getProperties($parentClass); - foreach ($propsArr as $key => $property) { - $parentPropsArr[$key] = $property; - } - - return $parentPropsArr; - } - - return $propsArr; - } - - /** - * Retrieves property by name from object and all its ancestors. - * - * @param object|string $object - * @param string $name - * - * @throws PropertyException - * @throws ReflectionException - * - * @return ReflectionProperty - */ - public static function getProperty($object, $name) - { - $reflection = is_object($object) ? new ReflectionObject($object) : new ReflectionClass($object); - - if ($reflection->hasProperty($name)) { - return $reflection->getProperty($name); - } - - if ($parentClass = $reflection->getParentClass()) { - return self::getProperty($parentClass->getName(), $name); - } - - throw new PropertyException( - sprintf( - 'The class "%s" doesn\'t have a property with the given name: "%s".', - is_object($object) ? get_class($object) : $object, - $name - ) - ); - } -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Date/DateIntervalFilter.php b/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Date/DateIntervalFilter.php deleted file mode 100644 index becd1cf..0000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Date/DateIntervalFilter.php +++ /dev/null @@ -1,33 +0,0 @@ - $propertyValue) { - $copy->{$propertyName} = $propertyValue; - } - - return $copy; - } -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/ReplaceFilter.php b/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/ReplaceFilter.php deleted file mode 100644 index 164f8b8..0000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/ReplaceFilter.php +++ /dev/null @@ -1,30 +0,0 @@ -callback = $callable; - } - - /** - * {@inheritdoc} - */ - public function apply($element) - { - return call_user_func($this->callback, $element); - } -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/ShallowCopyFilter.php b/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/ShallowCopyFilter.php deleted file mode 100644 index a5fbd7a..0000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/ShallowCopyFilter.php +++ /dev/null @@ -1,17 +0,0 @@ -copier = $copier; - } - - /** - * {@inheritdoc} - */ - public function apply($arrayObject) - { - $clone = clone $arrayObject; - foreach ($arrayObject->getArrayCopy() as $k => $v) { - $clone->offsetSet($k, $this->copier->copy($v)); - } - - return $clone; - } -} - diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/SplDoublyLinkedList.php b/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/SplDoublyLinkedList.php deleted file mode 100644 index c5644cf..0000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/SplDoublyLinkedList.php +++ /dev/null @@ -1,10 +0,0 @@ -copier = $copier; - } - - /** - * {@inheritdoc} - */ - public function apply($element) - { - $newElement = clone $element; - - $copy = $this->createCopyClosure(); - - return $copy($newElement); - } - - private function createCopyClosure() - { - $copier = $this->copier; - - $copy = function (SplDoublyLinkedList $list) use ($copier) { - // Replace each element in the list with a deep copy of itself - for ($i = 1; $i <= $list->count(); $i++) { - $copy = $copier->recursiveCopy($list->shift()); - - $list->push($copy); - } - - return $list; - }; - - return Closure::bind($copy, null, DeepCopy::class); - } -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/TypeFilter.php b/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/TypeFilter.php deleted file mode 100644 index 5785a7d..0000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/TypeFilter.php +++ /dev/null @@ -1,13 +0,0 @@ -type = $type; - } - - /** - * @param mixed $element - * - * @return boolean - */ - public function matches($element) - { - return is_object($element) ? is_a($element, $this->type) : gettype($element) === $this->type; - } -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/deep_copy.php b/vendor/myclabs/deep-copy/src/DeepCopy/deep_copy.php deleted file mode 100644 index 55dcc92..0000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/deep_copy.php +++ /dev/null @@ -1,20 +0,0 @@ -copy($value); - } -} diff --git a/vendor/nette/bootstrap/composer.json b/vendor/nette/bootstrap/composer.json deleted file mode 100644 index 05027c7..0000000 --- a/vendor/nette/bootstrap/composer.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "name": "nette/bootstrap", - "description": "🅱 Nette Bootstrap: the simple way to configure and bootstrap your Nette application.", - "keywords": ["nette", "configurator", "bootstrapping"], - "homepage": "https://nette.org", - "license": ["BSD-3-Clause", "GPL-2.0-only", "GPL-3.0-only"], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "require": { - "php": ">=7.2 <8.2", - "nette/di": "^3.0.5", - "nette/utils": "^3.2.1" - }, - "suggest": { - "nette/robot-loader": "to use Configurator::createRobotLoader()", - "tracy/tracy": "to use Configurator::enableTracy()" - }, - "require-dev": { - "nette/application": "^3.1", - "nette/caching": "^3.0", - "nette/database": "^3.0", - "nette/forms": "^3.0", - "nette/http": "^3.0", - "nette/mail": "^3.0", - "nette/robot-loader": "^3.0", - "nette/safe-stream": "^2.2", - "nette/security": "^3.0", - "nette/tester": "^2.0", - "latte/latte": "^2.8", - "tracy/tracy": "^2.6", - "phpstan/phpstan-nette": "^0.12" - }, - "conflict": { - "tracy/tracy": "<2.6" - }, - "autoload": { - "classmap": ["src/"] - }, - "minimum-stability": "dev", - "scripts": { - "phpstan": "phpstan analyse", - "tester": "tester tests -s" - }, - "extra": { - "branch-alias": { - "dev-master": "3.1-dev" - } - } -} diff --git a/vendor/nette/bootstrap/contributing.md b/vendor/nette/bootstrap/contributing.md deleted file mode 100644 index 184152c..0000000 --- a/vendor/nette/bootstrap/contributing.md +++ /dev/null @@ -1,33 +0,0 @@ -How to contribute & use the issue tracker -========================================= - -Nette welcomes your contributions. There are several ways to help out: - -* Create an issue on GitHub, if you have found a bug -* Write test cases for open bug issues -* Write fixes for open bug/feature issues, preferably with test cases included -* Contribute to the [documentation](https://nette.org/en/writing) - -Issues ------- - -Please **do not use the issue tracker to ask questions**. We will be happy to help you -on [Nette forum](https://forum.nette.org) or chat with us on [Gitter](https://gitter.im/nette/nette). - -A good bug report shouldn't leave others needing to chase you up for more -information. Please try to be as detailed as possible in your report. - -**Feature requests** are welcome. But take a moment to find out whether your idea -fits with the scope and aims of the project. It's up to *you* to make a strong -case to convince the project's developers of the merits of this feature. - -Contributing ------------- - -If you'd like to contribute, please take a moment to read [the contributing guide](https://nette.org/en/contributing). - -The best way to propose a feature is to discuss your ideas on [Nette forum](https://forum.nette.org) before implementing them. - -Please do not fix whitespace, format code, or make a purely cosmetic patch. - -Thanks! :heart: diff --git a/vendor/nette/bootstrap/license.md b/vendor/nette/bootstrap/license.md deleted file mode 100644 index cf741bd..0000000 --- a/vendor/nette/bootstrap/license.md +++ /dev/null @@ -1,60 +0,0 @@ -Licenses -======== - -Good news! You may use Nette Framework under the terms of either -the New BSD License or the GNU General Public License (GPL) version 2 or 3. - -The BSD License is recommended for most projects. It is easy to understand and it -places almost no restrictions on what you can do with the framework. If the GPL -fits better to your project, you can use the framework under this license. - -You don't have to notify anyone which license you are using. You can freely -use Nette Framework in commercial projects as long as the copyright header -remains intact. - -Please be advised that the name "Nette Framework" is a protected trademark and its -usage has some limitations. So please do not use word "Nette" in the name of your -project or top-level domain, and choose a name that stands on its own merits. -If your stuff is good, it will not take long to establish a reputation for yourselves. - - -New BSD License ---------------- - -Copyright (c) 2004, 2014 David Grudl (https://davidgrudl.com) -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - * Neither the name of "Nette Framework" nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -This software is provided by the copyright holders and contributors "as is" and -any express or implied warranties, including, but not limited to, the implied -warranties of merchantability and fitness for a particular purpose are -disclaimed. In no event shall the copyright owner or contributors be liable for -any direct, indirect, incidental, special, exemplary, or consequential damages -(including, but not limited to, procurement of substitute goods or services; -loss of use, data, or profits; or business interruption) however caused and on -any theory of liability, whether in contract, strict liability, or tort -(including negligence or otherwise) arising in any way out of the use of this -software, even if advised of the possibility of such damage. - - -GNU General Public License --------------------------- - -GPL licenses are very very long, so instead of including them here we offer -you URLs with full text: - -- [GPL version 2](http://www.gnu.org/licenses/gpl-2.0.html) -- [GPL version 3](http://www.gnu.org/licenses/gpl-3.0.html) diff --git a/vendor/nette/bootstrap/readme.md b/vendor/nette/bootstrap/readme.md deleted file mode 100644 index 7a94165..0000000 --- a/vendor/nette/bootstrap/readme.md +++ /dev/null @@ -1,30 +0,0 @@ -Nette Bootstrap -=============== - -[![Downloads this Month](https://img.shields.io/packagist/dm/nette/bootstrap.svg)](https://packagist.org/packages/nette/bootstrap) -[![Tests](https://github.com/nette/bootstrap/workflows/Tests/badge.svg?branch=master)](https://github.com/nette/bootstrap/actions) -[![Coverage Status](https://coveralls.io/repos/github/nette/bootstrap/badge.svg?branch=master)](https://coveralls.io/github/nette/bootstrap?branch=master) -[![Latest Stable Version](https://poser.pugx.org/nette/bootstrap/v/stable)](https://github.com/nette/bootstrap/releases) -[![License](https://img.shields.io/badge/license-New%20BSD-blue.svg)](https://github.com/nette/bootstrap/blob/master/license.md) - - -Introduction -============ - -Setting environment and creating a Dependency Injection (DI) container is in Nette in charge of the Nette Bootstrap. - -Documentation can be found on the [website](https://doc.nette.org/bootstrap). - -If you like Nette, **[please make a donation now](https://nette.org/donate)**. Thank you! - - -Installation -============ - -The recommended way to install is via Composer: - -``` -composer require nette/bootstrap -``` - -It requires PHP version 7.2 and supports PHP up to 8.1. diff --git a/vendor/nette/bootstrap/src/Bootstrap/Configurator.php b/vendor/nette/bootstrap/src/Bootstrap/Configurator.php deleted file mode 100644 index 501585a..0000000 --- a/vendor/nette/bootstrap/src/Bootstrap/Configurator.php +++ /dev/null @@ -1,363 +0,0 @@ - [Nette\Bridges\ApplicationDI\ApplicationExtension::class, ['%debugMode%', ['%appDir%'], '%tempDir%/cache/nette.application']], - 'cache' => [Nette\Bridges\CacheDI\CacheExtension::class, ['%tempDir%']], - 'constants' => Extensions\ConstantsExtension::class, - 'database' => [Nette\Bridges\DatabaseDI\DatabaseExtension::class, ['%debugMode%']], - 'decorator' => Nette\DI\Extensions\DecoratorExtension::class, - 'di' => [Nette\DI\Extensions\DIExtension::class, ['%debugMode%']], - 'extensions' => Nette\DI\Extensions\ExtensionsExtension::class, - 'forms' => Nette\Bridges\FormsDI\FormsExtension::class, - 'http' => [Nette\Bridges\HttpDI\HttpExtension::class, ['%consoleMode%']], - 'inject' => Nette\DI\Extensions\InjectExtension::class, - 'latte' => [Nette\Bridges\ApplicationDI\LatteExtension::class, ['%tempDir%/cache/latte', '%debugMode%']], - 'mail' => Nette\Bridges\MailDI\MailExtension::class, - 'php' => Extensions\PhpExtension::class, - 'routing' => [Nette\Bridges\ApplicationDI\RoutingExtension::class, ['%debugMode%']], - 'search' => [Nette\DI\Extensions\SearchExtension::class, ['%tempDir%/cache/nette.search']], - 'security' => [Nette\Bridges\SecurityDI\SecurityExtension::class, ['%debugMode%']], - 'session' => [Nette\Bridges\HttpDI\SessionExtension::class, ['%debugMode%', '%consoleMode%']], - 'tracy' => [Tracy\Bridges\Nette\TracyExtension::class, ['%debugMode%', '%consoleMode%']], - ]; - - /** @var string[] of classes which shouldn't be autowired */ - public $autowireExcludedClasses = [ - \ArrayAccess::class, - \Countable::class, - \IteratorAggregate::class, - \stdClass::class, - \Traversable::class, - ]; - - /** @var array */ - protected $staticParameters; - - /** @var array */ - protected $dynamicParameters = []; - - /** @var array */ - protected $services = []; - - /** @var array of string|array */ - protected $configs = []; - - - public function __construct() - { - $this->staticParameters = $this->getDefaultParameters(); - } - - - /** - * Set parameter %debugMode%. - * @param bool|string|array $value - * @return static - */ - public function setDebugMode($value) - { - if (is_string($value) || is_array($value)) { - $value = static::detectDebugMode($value); - } elseif (!is_bool($value)) { - throw new Nette\InvalidArgumentException(sprintf('Value must be either a string, array, or boolean, %s given.', gettype($value))); - } - $this->staticParameters['debugMode'] = $value; - $this->staticParameters['productionMode'] = !$this->staticParameters['debugMode']; // compatibility - return $this; - } - - - public function isDebugMode(): bool - { - return $this->staticParameters['debugMode']; - } - - - /** - * Sets path to temporary directory. - * @return static - */ - public function setTempDirectory(string $path) - { - $this->staticParameters['tempDir'] = $path; - return $this; - } - - - /** - * Sets the default timezone. - * @return static - */ - public function setTimeZone(string $timezone) - { - date_default_timezone_set($timezone); - @ini_set('date.timezone', $timezone); // @ - function may be disabled - return $this; - } - - - /** - * Alias for addStaticParameters() - * @return static - */ - public function addParameters(array $params) - { - return $this->addStaticParameters($params); - } - - - /** - * Adds new static parameters. - * @return static - */ - public function addStaticParameters(array $params) - { - $this->staticParameters = DI\Config\Helpers::merge($params, $this->staticParameters); - return $this; - } - - - /** - * Adds new dynamic parameters. - * @return static - */ - public function addDynamicParameters(array $params) - { - $this->dynamicParameters = $params + $this->dynamicParameters; - return $this; - } - - - /** - * Add instances of services. - * @return static - */ - public function addServices(array $services) - { - $this->services = $services + $this->services; - return $this; - } - - - protected function getDefaultParameters(): array - { - $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); - $last = end($trace); - $debugMode = static::detectDebugMode(); - $loaderRc = class_exists(ClassLoader::class) - ? new \ReflectionClass(ClassLoader::class) - : null; - return [ - 'appDir' => isset($trace[1]['file']) ? dirname($trace[1]['file']) : null, - 'wwwDir' => isset($last['file']) ? dirname($last['file']) : null, - 'vendorDir' => $loaderRc ? dirname($loaderRc->getFileName(), 2) : null, - 'debugMode' => $debugMode, - 'productionMode' => !$debugMode, - 'consoleMode' => PHP_SAPI === 'cli', - ]; - } - - - public function enableTracy(string $logDirectory = null, string $email = null): void - { - if (!class_exists(Tracy\Debugger::class)) { - throw new Nette\NotSupportedException('Tracy not found, do you have `tracy/tracy` package installed?'); - } - - Tracy\Debugger::$strictMode = true; - Tracy\Debugger::enable(!$this->staticParameters['debugMode'], $logDirectory, $email); - Tracy\Bridges\Nette\Bridge::initialize(); - if (class_exists(Latte\Bridges\Tracy\BlueScreenPanel::class)) { - Latte\Bridges\Tracy\BlueScreenPanel::initialize(); - } - } - - - /** - * Alias for enableTracy() - */ - public function enableDebugger(string $logDirectory = null, string $email = null): void - { - $this->enableTracy($logDirectory, $email); - } - - - /** - * @throws Nette\NotSupportedException if RobotLoader is not available - */ - public function createRobotLoader(): Nette\Loaders\RobotLoader - { - if (!class_exists(Nette\Loaders\RobotLoader::class)) { - throw new Nette\NotSupportedException('RobotLoader not found, do you have `nette/robot-loader` package installed?'); - } - - $loader = new Nette\Loaders\RobotLoader; - $loader->setTempDirectory($this->getCacheDirectory() . '/nette.robotLoader'); - $loader->setAutoRefresh($this->staticParameters['debugMode']); - - if (isset($this->defaultExtensions['application'])) { - $this->defaultExtensions['application'][1][1] = null; - $this->defaultExtensions['application'][1][3] = $loader; - } - return $loader; - } - - - /** - * Adds configuration file. - * @param string|array $config - * @return static - */ - public function addConfig($config) - { - $this->configs[] = $config; - return $this; - } - - - /** - * Returns system DI container. - */ - public function createContainer(): DI\Container - { - $class = $this->loadContainer(); - $container = new $class($this->dynamicParameters); - foreach ($this->services as $name => $service) { - $container->addService($name, $service); - } - $container->initialize(); - return $container; - } - - - /** - * Loads system DI container class and returns its name. - */ - public function loadContainer(): string - { - $loader = new DI\ContainerLoader( - $this->getCacheDirectory() . '/nette.configurator', - $this->staticParameters['debugMode'] - ); - return $loader->load( - [$this, 'generateContainer'], - [ - $this->staticParameters, - array_keys($this->dynamicParameters), - $this->configs, - PHP_VERSION_ID - PHP_RELEASE_VERSION, // minor PHP version - class_exists(ClassLoader::class) ? filemtime((new \ReflectionClass(ClassLoader::class))->getFilename()) : null, // composer update - ] - ); - } - - - /** - * @internal - */ - public function generateContainer(DI\Compiler $compiler): void - { - $loader = $this->createLoader(); - $loader->setParameters($this->staticParameters); - - foreach ($this->configs as $config) { - if (is_string($config)) { - $compiler->loadConfig($config, $loader); - } else { - $compiler->addConfig($config); - } - } - - $compiler->addConfig(['parameters' => DI\Helpers::escape($this->staticParameters)]); - $compiler->setDynamicParameterNames(array_keys($this->dynamicParameters)); - - $builder = $compiler->getContainerBuilder(); - $builder->addExcludedClasses($this->autowireExcludedClasses); - - foreach ($this->defaultExtensions as $name => $extension) { - [$class, $args] = is_string($extension) - ? [$extension, []] - : $extension; - if (class_exists($class)) { - $args = DI\Helpers::expand($args, $this->staticParameters); - $compiler->addExtension($name, (new \ReflectionClass($class))->newInstanceArgs($args)); - } - } - - Nette\Utils\Arrays::invoke($this->onCompile, $this, $compiler); - } - - - protected function createLoader(): DI\Config\Loader - { - return new DI\Config\Loader; - } - - - protected function getCacheDirectory(): string - { - if (empty($this->staticParameters['tempDir'])) { - throw new Nette\InvalidStateException('Set path to temporary directory using setTempDirectory().'); - } - $dir = $this->staticParameters['tempDir'] . '/cache'; - Nette\Utils\FileSystem::createDir($dir); - return $dir; - } - - - /********************* tools ****************d*g**/ - - - /** - * Detects debug mode by IP addresses or computer names whitelist detection. - * @param string|array $list - */ - public static function detectDebugMode($list = null): bool - { - $addr = $_SERVER['REMOTE_ADDR'] ?? php_uname('n'); - $secret = is_string($_COOKIE[self::COOKIE_SECRET] ?? null) - ? $_COOKIE[self::COOKIE_SECRET] - : null; - $list = is_string($list) - ? preg_split('#[,\s]+#', $list) - : (array) $list; - if (!isset($_SERVER['HTTP_X_FORWARDED_FOR']) && !isset($_SERVER['HTTP_FORWARDED'])) { - $list[] = '127.0.0.1'; - $list[] = '::1'; - $list[] = '[::1]'; // workaround for PHP < 7.3.4 - } - return in_array($addr, $list, true) || in_array("$secret@$addr", $list, true); - } -} - - -class_exists(Nette\Configurator::class); diff --git a/vendor/nette/bootstrap/src/Bootstrap/Extensions/ConstantsExtension.php b/vendor/nette/bootstrap/src/Bootstrap/Extensions/ConstantsExtension.php deleted file mode 100644 index 1343371..0000000 --- a/vendor/nette/bootstrap/src/Bootstrap/Extensions/ConstantsExtension.php +++ /dev/null @@ -1,26 +0,0 @@ -getConfig() as $name => $value) { - $this->initialization->addBody('define(?, ?);', [$name, $value]); - } - } -} diff --git a/vendor/nette/bootstrap/src/Bootstrap/Extensions/PhpExtension.php b/vendor/nette/bootstrap/src/Bootstrap/Extensions/PhpExtension.php deleted file mode 100644 index a3e90ea..0000000 --- a/vendor/nette/bootstrap/src/Bootstrap/Extensions/PhpExtension.php +++ /dev/null @@ -1,52 +0,0 @@ -getConfig() as $name => $value) { - if ($value === null) { - continue; - - } elseif ($name === 'include_path') { - $this->initialization->addBody('set_include_path(?);', [str_replace(';', PATH_SEPARATOR, $value)]); - - } elseif ($name === 'ignore_user_abort') { - $this->initialization->addBody('ignore_user_abort(?);', [$value]); - - } elseif ($name === 'max_execution_time') { - $this->initialization->addBody('set_time_limit(?);', [$value]); - - } elseif ($name === 'date.timezone') { - $this->initialization->addBody('date_default_timezone_set(?);', [$value]); - - } elseif (function_exists('ini_set')) { - $this->initialization->addBody('ini_set(?, ?);', [$name, $value === false ? '0' : (string) $value]); - - } elseif (ini_get($name) !== (string) $value) { - throw new Nette\NotSupportedException('Required function ini_set() is disabled.'); - } - } - } -} diff --git a/vendor/nette/bootstrap/src/Configurator.php b/vendor/nette/bootstrap/src/Configurator.php deleted file mode 100644 index b08af68..0000000 --- a/vendor/nette/bootstrap/src/Configurator.php +++ /dev/null @@ -1,19 +0,0 @@ - '@'])); -override(\Nette\DI\ContainerBuilder::addDefinition(1), type(1)); diff --git a/vendor/nette/di/composer.json b/vendor/nette/di/composer.json deleted file mode 100644 index b73aedd..0000000 --- a/vendor/nette/di/composer.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "nette/di", - "description": "💎 Nette Dependency Injection Container: Flexible, compiled and full-featured DIC with perfectly usable autowiring and support for all new PHP features.", - "keywords": ["nette", "di", "dic", "ioc", "factory", "compiled", "static"], - "homepage": "https://nette.org", - "license": ["BSD-3-Clause", "GPL-2.0-only", "GPL-3.0-only"], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "require": { - "php": ">=7.1 <8.2", - "ext-tokenizer": "*", - "nette/neon": "^3.3", - "nette/php-generator": "^3.5.4", - "nette/robot-loader": "^3.2", - "nette/schema": "^1.1", - "nette/utils": "^3.1.6" - }, - "require-dev": { - "nette/tester": "^2.2", - "tracy/tracy": "^2.3", - "phpstan/phpstan": "^0.12" - }, - "conflict": { - "nette/bootstrap": "<3.0" - }, - "autoload": { - "classmap": ["src/"] - }, - "minimum-stability": "dev", - "scripts": { - "phpstan": "phpstan analyse", - "tester": "tester tests -s" - }, - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - } -} diff --git a/vendor/nette/di/contributing.md b/vendor/nette/di/contributing.md deleted file mode 100644 index 184152c..0000000 --- a/vendor/nette/di/contributing.md +++ /dev/null @@ -1,33 +0,0 @@ -How to contribute & use the issue tracker -========================================= - -Nette welcomes your contributions. There are several ways to help out: - -* Create an issue on GitHub, if you have found a bug -* Write test cases for open bug issues -* Write fixes for open bug/feature issues, preferably with test cases included -* Contribute to the [documentation](https://nette.org/en/writing) - -Issues ------- - -Please **do not use the issue tracker to ask questions**. We will be happy to help you -on [Nette forum](https://forum.nette.org) or chat with us on [Gitter](https://gitter.im/nette/nette). - -A good bug report shouldn't leave others needing to chase you up for more -information. Please try to be as detailed as possible in your report. - -**Feature requests** are welcome. But take a moment to find out whether your idea -fits with the scope and aims of the project. It's up to *you* to make a strong -case to convince the project's developers of the merits of this feature. - -Contributing ------------- - -If you'd like to contribute, please take a moment to read [the contributing guide](https://nette.org/en/contributing). - -The best way to propose a feature is to discuss your ideas on [Nette forum](https://forum.nette.org) before implementing them. - -Please do not fix whitespace, format code, or make a purely cosmetic patch. - -Thanks! :heart: diff --git a/vendor/nette/di/license.md b/vendor/nette/di/license.md deleted file mode 100644 index cf741bd..0000000 --- a/vendor/nette/di/license.md +++ /dev/null @@ -1,60 +0,0 @@ -Licenses -======== - -Good news! You may use Nette Framework under the terms of either -the New BSD License or the GNU General Public License (GPL) version 2 or 3. - -The BSD License is recommended for most projects. It is easy to understand and it -places almost no restrictions on what you can do with the framework. If the GPL -fits better to your project, you can use the framework under this license. - -You don't have to notify anyone which license you are using. You can freely -use Nette Framework in commercial projects as long as the copyright header -remains intact. - -Please be advised that the name "Nette Framework" is a protected trademark and its -usage has some limitations. So please do not use word "Nette" in the name of your -project or top-level domain, and choose a name that stands on its own merits. -If your stuff is good, it will not take long to establish a reputation for yourselves. - - -New BSD License ---------------- - -Copyright (c) 2004, 2014 David Grudl (https://davidgrudl.com) -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - * Neither the name of "Nette Framework" nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -This software is provided by the copyright holders and contributors "as is" and -any express or implied warranties, including, but not limited to, the implied -warranties of merchantability and fitness for a particular purpose are -disclaimed. In no event shall the copyright owner or contributors be liable for -any direct, indirect, incidental, special, exemplary, or consequential damages -(including, but not limited to, procurement of substitute goods or services; -loss of use, data, or profits; or business interruption) however caused and on -any theory of liability, whether in contract, strict liability, or tort -(including negligence or otherwise) arising in any way out of the use of this -software, even if advised of the possibility of such damage. - - -GNU General Public License --------------------------- - -GPL licenses are very very long, so instead of including them here we offer -you URLs with full text: - -- [GPL version 2](http://www.gnu.org/licenses/gpl-2.0.html) -- [GPL version 3](http://www.gnu.org/licenses/gpl-3.0.html) diff --git a/vendor/nette/di/readme.md b/vendor/nette/di/readme.md deleted file mode 100644 index 642cfc2..0000000 --- a/vendor/nette/di/readme.md +++ /dev/null @@ -1,356 +0,0 @@ -Nette Dependency Injection (DI) -=============================== - -[![Downloads this Month](https://img.shields.io/packagist/dm/nette/di.svg)](https://packagist.org/packages/nette/di) -[![Tests](https://github.com/nette/di/workflows/Tests/badge.svg?branch=master)](https://github.com/nette/di/actions) -[![Coverage Status](https://coveralls.io/repos/github/nette/di/badge.svg?branch=master)](https://coveralls.io/github/nette/di?branch=master) -[![Latest Stable Version](https://poser.pugx.org/nette/di/v/stable)](https://github.com/nette/di/releases) -[![License](https://img.shields.io/badge/license-New%20BSD-blue.svg)](https://github.com/nette/di/blob/master/license.md) - - -Introduction ------------- - -Purpose of the Dependecy Injection (DI) is to free classes from the responsibility for obtaining objects that they need for its operation (these objects are called **services**). To pass them these services on their instantiation instead. - -Nette DI is one of the most interesting part of framework. It is compiled DI container, extremely fast and easy to configure. - -Documentation can be found on the [website](https://doc.nette.org/dependency-injection). - - -[Support Me](https://github.com/sponsors/dg) --------------------------------------------- - -Do you like Nette DI? Are you looking forward to the new features? - -[![Buy me a coffee](https://files.nette.org/icons/donation-3.svg)](https://github.com/sponsors/dg) - -Thank you! - - -Installation ------------- - -The recommended way to install is via Composer: - -``` -composer require nette/di -``` - -It requires PHP version 7.1 and supports PHP up to 8.1. - - -Usage ------ - -Let's have an application for sending newsletters. The code is maximally simplified and is available on the [GitHub](https://github.com/dg/di-example). - -We have the object representing email: - -```php -class Mail -{ - public $subject; - public $message; -} -``` - -An object which can send emails: - -```php -interface Mailer -{ - function send(Mail $mail, $to); -} -``` - -A support for logging: - -```php -interface Logger -{ - function log($message); -} -``` - -And finally, a class that provides sending newsletters: - -```php -class NewsletterManager -{ - private $mailer; - private $logger; - - function __construct(Mailer $mailer, Logger $logger) - { - $this->mailer = $mailer; - $this->logger = $logger; - } - - function distribute(array $recipients) - { - $mail = new Mail; - ... - foreach ($recipients as $recipient) { - $this->mailer->send($mail, $recipient); - } - $this->logger->log(...); - } -} -``` - -The code respects Dependency Injection, ie. **each object uses only variables which we had passed into it.** - -Also, we have a ability to implement own `Logger` or `Mailer`, like this: - -```php -class SendMailMailer implements Mailer -{ - function send(Mail $mail, $to) - { - mail($to, $mail->subject, $mail->message); - } -} - -class FileLogger implements Logger -{ - private $file; - - function __construct($file) - { - $this->file = $file; - } - - function log($message) - { - file_put_contents($this->file, $message . "\n", FILE_APPEND); - } -} -``` - -**DI container is the supreme architect** which can create individual objects (in the terminology DI called services) and assemble and configure them exactly according to our needs. - -Container for our application might look like this: - -```php -class Container -{ - private $logger; - private $mailer; - - function getLogger() - { - if (!$this->logger) { - $this->logger = new FileLogger('log.txt'); - } - return $this->logger; - } - - function getMailer() - { - if (!$this->mailer) { - $this->mailer = new SendMailMailer; - } - return $this->mailer; - } - - function createNewsletterManager() - { - return new NewsletterManager($this->getMailer(), $this->getLogger()); - } -} -``` - -The implementation looks like this because: -- the individual services are created only on demand (lazy loading) -- doubly called `createNewsletterManager` will use the same logger and mailer instances - -Let's instantiate `Container`, let it create manager and we can start spamming users with newsletters :-) - -```php -$container = new Container; -$manager = $container->createNewsletterManager(); -$manager->distribute(...); -``` - -Significant to Dependency Injection is that no class depends on the container. Thus it can be easily replaced with another one. For example with the container generated by Nette DI. - -Nette DI ----------- - -Nette DI is the generator of containers. We instruct it (usually) with configuration files. This is configuration that leads to generate nearly the same class as the class `Container` above: - -```neon -services: - - FileLogger( log.txt ) - - SendMailMailer - - NewsletterManager -``` - -The big advantage is the shortness of configuration. - -Nette DI actually generates PHP code of container. Therefore it is extremely fast. Developer can see the code, so he knows exactly what it is doing. He can even trace it. - -Usage of Nette DI is very easy. Save the (above) configuration to the file `config.neon` and let's create a container: - -```php -$loader = new Nette\DI\ContainerLoader(__DIR__ . '/temp'); -$class = $loader->load(function($compiler) { - $compiler->loadConfig(__DIR__ . '/config.neon'); -}); -$container = new $class; -``` - -and then use container to create object `NewsletterManager` and we can send e-mails: - -```php -$manager = $container->getByType(NewsletterManager::class); -$manager->distribute(['john@example.com', ...]); -``` - -The container will be generated only once and the code is stored in cache (in directory `__DIR__ . '/temp'`). Therefore the loading of configuration file is placed in the closure in `$loader->load()`, so it is called only once. - -During development it is useful to activate auto-refresh mode which automatically regenerate the container when any class or configuration file is changed. Just in the constructor `ContainerLoader` append `true` as the second argument: - -```php -$loader = new Nette\DI\ContainerLoader(__DIR__ . '/temp', true); -``` - - -Services --------- - -Services are registered in the DI container and their dependencies are automatically passed. - -```neon -services: - manager: NewsletterManager -``` - -All dependencies declared in the constructor of this service will be automatically passed. Constructor passing is the preferred way of dependency injection for services. - -If we want to pass dependencies by the setter, we can add the `setup` section to the service definition: - -```neon -services: - manager: - factory: NewsletterManager - setup: - - setAnotherService -``` - -Class of the service: - -```php -class NewsletterManager -{ - private $anotherService; - - public function setAnotherService(AnotherService $service) - { - $this->anotherService = $service; - } - -... -``` - -We can also add the `inject: yes` directive. This directive will enable automatic call of `inject*` methods and passing dependencies to public variables with `@inject` annotations: - -```neon -services: - foo: - factory: FooClass - inject: yes -``` - -Dependency `Service1` will be passed by calling the `inject*` method, dependency `Service2` will be assigned to the `$service2` variable: - -```php -class FooClass -{ - private $service1; - - // 1) inject* method: - - public function injectService1(Service1 $service) - { - $this->service1 = $service1; - } - - // 2) Assign to the variable with the @inject annotation: - - /** @inject @var Service2 */ - public $service2; -} -``` - -However, this method is not ideal, because the variable must be declared as public and there is no way how you can ensure that the passed object will be of the given type. We also lose the ability to handle the assigned dependency in our code and we violate the principles of encapsulation. - - - -Factories ---------- - -We can use factories generated from an interface. The interface must declare the returning type in the `@return` annotation of the method. Nette will generate a proper implementation of the interface. - -The interface must have exactly one method named `create`. Our factory interface could be declared in the following way: - -```php -interface IBarFactory -{ - /** - * @return Bar - */ - public function create(); -} -``` - -The `create` method will instantiate an `Bar` with the following definition: - -```php -class Bar -{ - private $logger; - - public function __construct(Logger $logger) - { - $this->logger = $logger; - } -} -``` - -The factory will be registered in the `config.neon` file: - -```neon -services: - - IBarFactory -``` - -Nette will check if the declared service is an interface. If yes, it will also generate the corresponding implementation of the factory. The definition can be also written in a more verbose form: - -```neon -services: - barFactory: - implement: IBarFactory -``` - -This full definition allows us to declare additional configuration of the object using the `arguments` and `setup` sections, similarly as for all other services. - -In our code, we only have to obtain the factory instance and call the `create` method: - -```php -class Foo -{ - private $barFactory; - - function __construct(IBarFactory $barFactory) - { - $this->barFactory = $barFactory; - } - - function bar() - { - $bar = $this->barFactory->create(); - } -} -``` diff --git a/vendor/nette/di/src/Bridges/DITracy/ContainerPanel.php b/vendor/nette/di/src/Bridges/DITracy/ContainerPanel.php deleted file mode 100644 index a86747e..0000000 --- a/vendor/nette/di/src/Bridges/DITracy/ContainerPanel.php +++ /dev/null @@ -1,93 +0,0 @@ -container = $container; - $this->elapsedTime = self::$compilationTime - ? microtime(true) - self::$compilationTime - : null; - } - - - /** - * Renders tab. - */ - public function getTab(): string - { - return Nette\Utils\Helpers::capture(function () { - $elapsedTime = $this->elapsedTime; - require __DIR__ . '/templates/ContainerPanel.tab.phtml'; - }); - } - - - /** - * Renders panel. - */ - public function getPanel(): string - { - $rc = new \ReflectionClass($this->container); - $tags = []; - $types = []; - foreach ($rc->getMethods() as $method) { - if (preg_match('#^createService(.+)#', $method->name, $m) && $method->getReturnType()) { - $types[lcfirst(str_replace('__', '.', $m[1]))] = $method->getReturnType()->getName(); - } - } - - $types = $this->getContainerProperty('types') + $types; - ksort($types, SORT_NATURAL); - foreach ($this->getContainerProperty('tags') as $tag => $tmp) { - foreach ($tmp as $service => $val) { - $tags[$service][$tag] = $val; - } - } - - return Nette\Utils\Helpers::capture(function () use ($tags, $types, $rc) { - $container = $this->container; - $file = $rc->getFileName(); - $instances = $this->getContainerProperty('instances'); - $wiring = $this->getContainerProperty('wiring'); - require __DIR__ . '/templates/ContainerPanel.panel.phtml'; - }); - } - - - private function getContainerProperty(string $name) - { - $prop = (new \ReflectionClass(Nette\DI\Container::class))->getProperty($name); - $prop->setAccessible(true); - return $prop->getValue($this->container); - } -} diff --git a/vendor/nette/di/src/Bridges/DITracy/templates/ContainerPanel.panel.phtml b/vendor/nette/di/src/Bridges/DITracy/templates/ContainerPanel.panel.phtml deleted file mode 100644 index 665919f..0000000 --- a/vendor/nette/di/src/Bridges/DITracy/templates/ContainerPanel.panel.phtml +++ /dev/null @@ -1,81 +0,0 @@ - - - -

- -
-
-

Services

- - - - - - - - - - - - $type): ?> - - - - - - - - - - -
NameAutowiredServiceTags
$name" : Helpers::escapeHtml($name) ?> - - true, Dumper::LIVE => true]); ?> - - - - - - true]) - : Dumper::toHtml($tags[$name], [Dumper::COLLAPSE => true]); - } ?>
- -

Parameters

- -
- parameters); ?> -
- -

Source:

-
-
diff --git a/vendor/nette/di/src/Bridges/DITracy/templates/ContainerPanel.tab.phtml b/vendor/nette/di/src/Bridges/DITracy/templates/ContainerPanel.tab.phtml deleted file mode 100644 index 0c6d5a2..0000000 --- a/vendor/nette/di/src/Bridges/DITracy/templates/ContainerPanel.tab.phtml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - diff --git a/vendor/nette/di/src/DI/Attributes/Inject.php b/vendor/nette/di/src/DI/Attributes/Inject.php deleted file mode 100644 index 325e2b2..0000000 --- a/vendor/nette/di/src/DI/Attributes/Inject.php +++ /dev/null @@ -1,18 +0,0 @@ - services, used by getByType() */ - private $highPriority = []; - - /** @var array[] type => services, used by findByType() */ - private $lowPriority = []; - - /** @var string[] of classes excluded from autowiring */ - private $excludedClasses = []; - - - public function __construct(ContainerBuilder $builder) - { - $this->builder = $builder; - } - - - /** - * Resolves service name by type. - * @param bool $throw exception if service not found? - * @throws MissingServiceException when not found - * @throws ServiceCreationException when multiple found - */ - public function getByType(string $type, bool $throw = false): ?string - { - $type = Helpers::normalizeClass($type); - $types = $this->highPriority; - if (empty($types[$type])) { - if ($throw) { - if (!class_exists($type) && !interface_exists($type)) { - throw new MissingServiceException(sprintf("Service of type '%s' not found. Check the class name because it cannot be found.", $type)); - } - - throw new MissingServiceException(sprintf('Service of type %s not found. Did you add it to configuration file?', $type)); - } - - return null; - - } elseif (count($types[$type]) === 1) { - return $types[$type][0]; - - } else { - $list = $types[$type]; - natsort($list); - $hint = count($list) === 2 && ($tmp = strpos($list[0], '.') xor strpos($list[1], '.')) - ? '. If you want to overwrite service ' . $list[$tmp ? 0 : 1] . ', give it proper name.' - : ''; - throw new ServiceCreationException(sprintf( - "Multiple services of type $type found: %s%s", - implode(', ', $list), - $hint - )); - } - } - - - /** - * Gets the service names and definitions of the specified type. - * @return Definitions\Definition[] service name is key - */ - public function findByType(string $type): array - { - $type = Helpers::normalizeClass($type); - $definitions = $this->builder->getDefinitions(); - $names = array_merge($this->highPriority[$type] ?? [], $this->lowPriority[$type] ?? []); - $res = []; - foreach ($names as $name) { - $res[$name] = $definitions[$name]; - } - - return $res; - } - - - /** - * @param string[] $types - */ - public function addExcludedClasses(array $types): void - { - foreach ($types as $type) { - if (class_exists($type) || interface_exists($type)) { - $type = Helpers::normalizeClass($type); - $this->excludedClasses += class_parents($type) + class_implements($type) + [$type => $type]; - } - } - } - - - public function getClassList(): array - { - return [$this->lowPriority, $this->highPriority]; - } - - - public function rebuild(): void - { - $this->lowPriority = $this->highPriority = $preferred = []; - - foreach ($this->builder->getDefinitions() as $name => $def) { - if (!($type = $def->getType())) { - continue; - } - - $autowired = $def->getAutowired(); - if (is_array($autowired)) { - foreach ($autowired as $k => $autowiredType) { - if ($autowiredType === ContainerBuilder::THIS_SERVICE) { - $autowired[$k] = $type; - } elseif (!is_a($type, $autowiredType, true)) { - throw new ServiceCreationException(sprintf( - "Incompatible class %s in autowiring definition of service '%s'.", - $autowiredType, - $name - )); - } - } - } - - foreach (class_parents($type) + class_implements($type) + [$type] as $parent) { - if (!$autowired || isset($this->excludedClasses[$parent])) { - continue; - } elseif (is_array($autowired)) { - $priority = false; - foreach ($autowired as $autowiredType) { - if (is_a($parent, $autowiredType, true)) { - if (empty($preferred[$parent]) && isset($this->highPriority[$parent])) { - $this->lowPriority[$parent] = array_merge($this->lowPriority[$parent] ?? [], $this->highPriority[$parent]); - $this->highPriority[$parent] = []; - } - - $preferred[$parent] = $priority = true; - break; - } - } - } else { - $priority = empty($preferred[$parent]); - } - - $list = $priority ? 'highPriority' : 'lowPriority'; - $this->$list[$parent][] = $name; - } - } - } -} diff --git a/vendor/nette/di/src/DI/Compiler.php b/vendor/nette/di/src/DI/Compiler.php deleted file mode 100644 index b049c87..0000000 --- a/vendor/nette/di/src/DI/Compiler.php +++ /dev/null @@ -1,349 +0,0 @@ - array[]] */ - private $configs = []; - - /** @var string */ - private $sources = ''; - - /** @var DependencyChecker */ - private $dependencies; - - /** @var string */ - private $className = 'Container'; - - - public function __construct(?ContainerBuilder $builder = null) - { - $this->builder = $builder ?: new ContainerBuilder; - $this->dependencies = new DependencyChecker; - $this->addExtension(self::SERVICES, new Extensions\ServicesExtension); - $this->addExtension(self::PARAMETERS, new Extensions\ParametersExtension($this->configs)); - } - - - /** - * Add custom configurator extension. - * @return static - */ - public function addExtension(?string $name, CompilerExtension $extension) - { - if ($name === null) { - $name = '_' . count($this->extensions); - } elseif (isset($this->extensions[$name])) { - throw new Nette\InvalidArgumentException(sprintf("Name '%s' is already used or reserved.", $name)); - } - - $lname = strtolower($name); - foreach (array_keys($this->extensions) as $nm) { - if ($lname === strtolower((string) $nm)) { - throw new Nette\InvalidArgumentException(sprintf( - "Name of extension '%s' has the same name as '%s' in a case-insensitive manner.", - $name, - $nm - )); - } - } - - $this->extensions[$name] = $extension->setCompiler($this, $name); - return $this; - } - - - public function getExtensions(?string $type = null): array - { - return $type - ? array_filter($this->extensions, function ($item) use ($type): bool { return $item instanceof $type; }) - : $this->extensions; - } - - - public function getContainerBuilder(): ContainerBuilder - { - return $this->builder; - } - - - /** @return static */ - public function setClassName(string $className) - { - $this->className = $className; - return $this; - } - - - /** - * Adds new configuration. - * @return static - */ - public function addConfig(array $config) - { - foreach ($config as $section => $data) { - $this->configs[$section][] = $data; - } - - $this->sources .= "// source: array\n"; - return $this; - } - - - /** - * Adds new configuration from file. - * @return static - */ - public function loadConfig(string $file, ?Config\Loader $loader = null) - { - $sources = $this->sources . "// source: $file\n"; - $loader = $loader ?: new Config\Loader; - foreach ($loader->load($file, false) as $data) { - $this->addConfig($data); - } - - $this->dependencies->add($loader->getDependencies()); - $this->sources = $sources; - return $this; - } - - - /** - * Returns configuration. - * @deprecated - */ - public function getConfig(): array - { - return $this->config; - } - - - /** - * Sets the names of dynamic parameters. - * @return static - */ - public function setDynamicParameterNames(array $names) - { - assert($this->extensions[self::PARAMETERS] instanceof Extensions\ParametersExtension); - $this->extensions[self::PARAMETERS]->dynamicParams = $names; - return $this; - } - - - /** - * Adds dependencies to the list. - * @param array $deps of ReflectionClass|\ReflectionFunctionAbstract|string - * @return static - */ - public function addDependencies(array $deps) - { - $this->dependencies->add(array_filter($deps)); - return $this; - } - - - /** - * Exports dependencies. - */ - public function exportDependencies(): array - { - return $this->dependencies->export(); - } - - - /** @return static */ - public function addExportedTag(string $tag) - { - if (isset($this->extensions[self::DI])) { - assert($this->extensions[self::DI] instanceof Extensions\DIExtension); - $this->extensions[self::DI]->exportedTags[$tag] = true; - } - - return $this; - } - - - /** @return static */ - public function addExportedType(string $type) - { - if (isset($this->extensions[self::DI])) { - assert($this->extensions[self::DI] instanceof Extensions\DIExtension); - $this->extensions[self::DI]->exportedTypes[$type] = true; - } - - return $this; - } - - - public function compile(): string - { - $this->processExtensions(); - $this->processBeforeCompile(); - return $this->generateCode(); - } - - - /** @internal */ - public function processExtensions(): void - { - $first = $this->getExtensions(Extensions\ParametersExtension::class) + $this->getExtensions(Extensions\ExtensionsExtension::class); - foreach ($first as $name => $extension) { - $config = $this->processSchema($extension->getConfigSchema(), $this->configs[$name] ?? [], $name); - $extension->setConfig($this->config[$name] = $config); - $extension->loadConfiguration(); - } - - $last = $this->getExtensions(Extensions\InjectExtension::class); - $this->extensions = array_merge(array_diff_key($this->extensions, $last), $last); - - if ($decorator = $this->getExtensions(Extensions\DecoratorExtension::class)) { - Nette\Utils\Arrays::insertBefore($this->extensions, key($decorator), $this->getExtensions(Extensions\SearchExtension::class)); - } - - $extensions = array_diff_key($this->extensions, $first, [self::SERVICES => 1]); - foreach ($extensions as $name => $extension) { - $config = $this->processSchema($extension->getConfigSchema(), $this->configs[$name] ?? [], $name); - $extension->setConfig($this->config[$name] = $config); - } - - foreach ($extensions as $extension) { - $extension->loadConfiguration(); - } - - foreach ($this->getExtensions(Extensions\ServicesExtension::class) as $name => $extension) { - $config = $this->processSchema($extension->getConfigSchema(), $this->configs[$name] ?? [], $name); - $extension->setConfig($this->config[$name] = $config); - $extension->loadConfiguration(); - } - - if ($extra = array_diff_key($this->extensions, $extensions, $first, [self::SERVICES => 1])) { - throw new Nette\DeprecatedException(sprintf( - "Extensions '%s' were added while container was being compiled.", - implode("', '", array_keys($extra)) - )); - - } elseif ($extra = key(array_diff_key($this->configs, $this->extensions))) { - $hint = Nette\Utils\Helpers::getSuggestion(array_keys($this->extensions), $extra); - throw new InvalidConfigurationException( - sprintf("Found section '%s' in configuration, but corresponding extension is missing", $extra) - . ($hint ? ", did you mean '$hint'?" : '.') - ); - } - } - - - private function processBeforeCompile(): void - { - $this->builder->resolve(); - - foreach ($this->extensions as $extension) { - $extension->beforeCompile(); - $this->dependencies->add([(new \ReflectionClass($extension))->getFileName()]); - } - - $this->builder->complete(); - } - - - /** - * Merges and validates configurations against scheme. - * @return array|object - */ - private function processSchema(Schema\Schema $schema, array $configs, $name = null) - { - $processor = new Schema\Processor; - $processor->onNewContext[] = function (Schema\Context $context) use ($name) { - $context->path = $name ? [$name] : []; - $context->dynamics = &$this->extensions[self::PARAMETERS]->dynamicValidators; - }; - try { - $res = $processor->processMultiple($schema, $configs); - } catch (Schema\ValidationException $e) { - throw new Nette\DI\InvalidConfigurationException($e->getMessage()); - } - - foreach ($processor->getWarnings() as $warning) { - trigger_error($warning, E_USER_DEPRECATED); - } - - return $res; - } - - - /** @internal */ - public function generateCode(): string - { - $generator = $this->createPhpGenerator(); - $class = $generator->generate($this->className); - $this->dependencies->add($this->builder->getDependencies()); - - foreach ($this->extensions as $extension) { - $extension->afterCompile($class); - $generator->addInitialization($class, $extension); - } - - return $this->sources . "\n" . $generator->toString($class); - } - - - /** - * Loads list of service definitions from configuration. - */ - public function loadDefinitionsFromConfig(array $configList): void - { - $extension = $this->extensions[self::SERVICES]; - assert($extension instanceof Extensions\ServicesExtension); - $extension->loadDefinitions($this->processSchema($extension->getConfigSchema(), [$configList])); - } - - - protected function createPhpGenerator(): PhpGenerator - { - return new PhpGenerator($this->builder); - } - - - /** @deprecated use non-static Compiler::loadDefinitionsFromConfig() */ - public static function loadDefinitions(): void - { - throw new Nette\DeprecatedException(__METHOD__ . '() is deprecated, use non-static Compiler::loadDefinitionsFromConfig(array $configList).'); - } - - - /** @deprecated use non-static Compiler::loadDefinitionsFromConfig() */ - public static function loadDefinition(): void - { - throw new Nette\DeprecatedException(__METHOD__ . '() is deprecated, use non-static Compiler::loadDefinitionsFromConfig(array $configList).'); - } -} diff --git a/vendor/nette/di/src/DI/CompilerExtension.php b/vendor/nette/di/src/DI/CompilerExtension.php deleted file mode 100644 index 0523448..0000000 --- a/vendor/nette/di/src/DI/CompilerExtension.php +++ /dev/null @@ -1,186 +0,0 @@ -initialization = new Nette\PhpGenerator\Closure; - $this->compiler = $compiler; - $this->name = $name; - return $this; - } - - - /** - * @param array|object $config - * @return static - */ - public function setConfig($config) - { - if (!is_array($config) && !is_object($config)) { - throw new Nette\InvalidArgumentException; - } - - $this->config = $config; - return $this; - } - - - /** - * Returns extension configuration. - * @return array|object - */ - public function getConfig() - { - return $this->config; - } - - - /** - * Returns configuration schema. - */ - public function getConfigSchema(): Nette\Schema\Schema - { - return is_object($this->config) - ? Nette\Schema\Expect::from($this->config) - : Nette\Schema\Expect::array(); - } - - - /** - * Checks whether $config contains only $expected items and returns combined array. - * @throws Nette\InvalidStateException - * @deprecated use getConfigSchema() - */ - public function validateConfig(array $expected, ?array $config = null, ?string $name = null): array - { - if (func_num_args() === 1) { - return $this->config = $this->validateConfig($expected, $this->config); - } - - if ($extra = array_diff_key((array) $config, $expected)) { - $name = $name ? str_replace('.', "\u{a0}›\u{a0}", $name) : $this->name; - $hint = Nette\Utils\Helpers::getSuggestion(array_keys($expected), key($extra)); - throw new Nette\DI\InvalidConfigurationException(sprintf( - "Unknown configuration option '%s\u{a0}›\u{a0}%s'", - $name, - $hint ? key($extra) : implode("', '{$name}\u{a0}›\u{a0}", array_keys($extra)) - ) . ($hint ? ", did you mean '{$name}\u{a0}›\u{a0}{$hint}'?" : '.')); - } - - return Nette\Schema\Helpers::merge($config, $expected); - } - - - public function getContainerBuilder(): ContainerBuilder - { - return $this->compiler->getContainerBuilder(); - } - - - /** - * Reads configuration from file. - */ - public function loadFromFile(string $file): array - { - $loader = $this->createLoader(); - $res = $loader->load($file); - $this->compiler->addDependencies($loader->getDependencies()); - return $res; - } - - - /** - * Loads list of service definitions from configuration. - * Prefixes its names and replaces @extension with name in definition. - */ - public function loadDefinitionsFromConfig(array $configList): void - { - $res = []; - foreach ($configList as $key => $config) { - $key = is_string($key) ? $this->name . '.' . $key : $key; - $res[$key] = Helpers::prefixServiceName($config, $this->name); - } - - $this->compiler->loadDefinitionsFromConfig($res); - } - - - protected function createLoader(): Config\Loader - { - return new Config\Loader; - } - - - public function getInitialization(): Nette\PhpGenerator\Closure - { - return $this->initialization; - } - - - /** - * Prepend extension name to identifier or service name. - */ - public function prefix(string $id): string - { - return substr_replace($id, $this->name . '.', substr($id, 0, 1) === '@' ? 1 : 0, 0); - } - - - /** - * Processes configuration data. Intended to be overridden by descendant. - * @return void - */ - public function loadConfiguration() - { - } - - - /** - * Adjusts DI container before is compiled to PHP class. Intended to be overridden by descendant. - * @return void - */ - public function beforeCompile() - { - } - - - /** - * Adjusts DI container compiled to PHP class. Intended to be overridden by descendant. - * @return void - */ - public function afterCompile(Nette\PhpGenerator\ClassType $class) - { - } -} diff --git a/vendor/nette/di/src/DI/Config/Adapter.php b/vendor/nette/di/src/DI/Config/Adapter.php deleted file mode 100644 index f6bcbe7..0000000 --- a/vendor/nette/di/src/DI/Config/Adapter.php +++ /dev/null @@ -1,30 +0,0 @@ -file = $file; - $decoder = new Neon\Decoder; - $node = $decoder->parseToNode($input); - $traverser = new Neon\Traverser; - $node = $traverser->traverse($node, [$this, 'removeUnderscoreVisitor']); - return $this->process((array) $node->toValue()); - } - - - /** @throws Nette\InvalidStateException */ - public function process(array $arr): array - { - $res = []; - foreach ($arr as $key => $val) { - if (is_string($key) && substr($key, -1) === self::PREVENT_MERGING_SUFFIX) { - if (!is_array($val) && $val !== null) { - throw new Nette\DI\InvalidConfigurationException(sprintf( - "Replacing operator is available only for arrays, item '%s' is not array (used in '%s')", - $key, - $this->file - )); - } - - $key = substr($key, 0, -1); - $val[Helpers::PREVENT_MERGING] = true; - } - - if (is_array($val)) { - $val = $this->process($val); - - } elseif ($val instanceof Neon\Entity) { - if ($val->value === Neon\Neon::CHAIN) { - $tmp = null; - foreach ($this->process($val->attributes) as $st) { - $tmp = new Statement( - $tmp === null ? $st->getEntity() : [$tmp, ltrim(implode('::', (array) $st->getEntity()), ':')], - $st->arguments - ); - } - - $val = $tmp; - } else { - $tmp = $this->process([$val->value]); - if (is_string($tmp[0]) && strpos($tmp[0], '?') !== false) { - trigger_error("Operator ? is deprecated in config files (used in '$this->file')", E_USER_DEPRECATED); - } - - $val = new Statement($tmp[0], $this->process($val->attributes)); - } - } - - $res[$key] = $val; - } - - return $res; - } - - - /** - * Generates configuration in NEON format. - */ - public function dump(array $data): string - { - array_walk_recursive( - $data, - function (&$val): void { - if ($val instanceof Statement) { - $val = self::statementToEntity($val); - } - } - ); - return "# generated by Nette\n\n" . Neon\Neon::encode($data, Neon\Neon::BLOCK); - } - - - private static function statementToEntity(Statement $val): Neon\Entity - { - array_walk_recursive( - $val->arguments, - function (&$val): void { - if ($val instanceof Statement) { - $val = self::statementToEntity($val); - } elseif ($val instanceof Reference) { - $val = '@' . $val->getValue(); - } - } - ); - - $entity = $val->getEntity(); - if ($entity instanceof Reference) { - $entity = '@' . $entity->getValue(); - } elseif (is_array($entity)) { - if ($entity[0] instanceof Statement) { - return new Neon\Entity( - Neon\Neon::CHAIN, - [ - self::statementToEntity($entity[0]), - new Neon\Entity('::' . $entity[1], $val->arguments), - ] - ); - } elseif ($entity[0] instanceof Reference) { - $entity = '@' . $entity[0]->getValue() . '::' . $entity[1]; - } elseif (is_string($entity[0])) { - $entity = $entity[0] . '::' . $entity[1]; - } - } - - return new Neon\Entity($entity, $val->arguments); - } - - - public function removeUnderscoreVisitor(Neon\Node $node) - { - if (!$node instanceof Neon\Node\EntityNode) { - return; - } - - $index = false; - foreach ($node->attributes as $i => $attr) { - if ($index) { - $attr->key = $attr->key ?? new Neon\Node\LiteralNode((string) $i); - } - - if ($attr->value instanceof Neon\Node\LiteralNode && $attr->value->value === '_') { - unset($node->attributes[$i]); - $index = true; - } - } - } -} diff --git a/vendor/nette/di/src/DI/Config/Adapters/PhpAdapter.php b/vendor/nette/di/src/DI/Config/Adapters/PhpAdapter.php deleted file mode 100644 index 1773281..0000000 --- a/vendor/nette/di/src/DI/Config/Adapters/PhpAdapter.php +++ /dev/null @@ -1,38 +0,0 @@ -dump($data) . ';'; - } -} diff --git a/vendor/nette/di/src/DI/Config/DefinitionSchema.php b/vendor/nette/di/src/DI/Config/DefinitionSchema.php deleted file mode 100644 index 72b2f74..0000000 --- a/vendor/nette/di/src/DI/Config/DefinitionSchema.php +++ /dev/null @@ -1,275 +0,0 @@ -builder = $builder; - } - - - public function complete($def, Context $context) - { - if ($def === [false]) { - return (object) $def; - } - - if (Helpers::takeParent($def)) { - $def['reset']['all'] = true; - } - - foreach (['arguments', 'setup', 'tags'] as $k) { - if (isset($def[$k]) && Helpers::takeParent($def[$k])) { - $def['reset'][$k] = true; - } - } - - $def = $this->expandParameters($def); - $type = $this->sniffType(end($context->path), $def); - $def = $this->getSchema($type)->complete($def, $context); - if ($def) { - $def->defType = $type; - } - - return $def; - } - - - public function merge($def, $base) - { - if (!empty($def['alteration'])) { - unset($def['alteration']); - } - - return Nette\Schema\Helpers::merge($def, $base); - } - - - /** - * Normalizes configuration of service definitions. - */ - public function normalize($def, Context $context) - { - if ($def === null || $def === false) { - return (array) $def; - - } elseif (is_string($def) && interface_exists($def)) { - return ['implement' => $def]; - - } elseif ($def instanceof Statement && is_string($def->getEntity()) && interface_exists($def->getEntity())) { - $res = ['implement' => $def->getEntity()]; - if (array_keys($def->arguments) === ['tagged']) { - $res += $def->arguments; - } elseif (count($def->arguments) > 1) { - $res['references'] = $def->arguments; - } elseif ($factory = array_shift($def->arguments)) { - $res['factory'] = $factory; - } - - return $res; - - } elseif (!is_array($def) || isset($def[0], $def[1])) { - return ['factory' => $def]; - - } elseif (is_array($def)) { - if (isset($def['create']) && !isset($def['factory'])) { - $def['factory'] = $def['create']; - unset($def['create']); - } - - if (isset($def['class']) && !isset($def['type'])) { - if ($def['class'] instanceof Statement) { - $key = end($context->path); - trigger_error(sprintf("Service '%s': option 'class' should be changed to 'factory'.", $key), E_USER_DEPRECATED); - $def['factory'] = $def['class']; - unset($def['class']); - } elseif (!isset($def['factory']) && !isset($def['dynamic']) && !isset($def['imported'])) { - $def['factory'] = $def['class']; - unset($def['class']); - } - } - - foreach (['class' => 'type', 'dynamic' => 'imported'] as $alias => $original) { - if (array_key_exists($alias, $def)) { - if (array_key_exists($original, $def)) { - throw new Nette\DI\InvalidConfigurationException(sprintf( - "Options '%s' and '%s' are aliases, use only '%s'.", - $alias, - $original, - $original - )); - } - - $def[$original] = $def[$alias]; - unset($def[$alias]); - } - } - - return $def; - - } else { - throw new Nette\DI\InvalidConfigurationException('Unexpected format of service definition'); - } - } - - - public function completeDefault(Context $context) - { - } - - - private function sniffType($key, array $def): string - { - if (is_string($key)) { - $name = preg_match('#^@[\w\\\\]+$#D', $key) - ? $this->builder->getByType(substr($key, 1), false) - : $key; - - if ($name && $this->builder->hasDefinition($name)) { - return get_class($this->builder->getDefinition($name)); - } - } - - if (isset($def['implement'], $def['references']) || isset($def['implement'], $def['tagged'])) { - return Definitions\LocatorDefinition::class; - - } elseif (isset($def['implement'])) { - return method_exists($def['implement'], 'create') - ? Definitions\FactoryDefinition::class - : Definitions\AccessorDefinition::class; - - } elseif (isset($def['imported'])) { - return Definitions\ImportedDefinition::class; - - } elseif (!$def) { - throw new Nette\DI\InvalidConfigurationException("Service '$key': Empty definition."); - - } else { - return Definitions\ServiceDefinition::class; - } - } - - - private function expandParameters(array $config): array - { - $params = $this->builder->parameters; - if (isset($config['parameters'])) { - foreach ((array) $config['parameters'] as $k => $v) { - $v = explode(' ', is_int($k) ? $v : $k); - $params[end($v)] = $this->builder::literal('$' . end($v)); - } - } - - return Nette\DI\Helpers::expand($config, $params); - } - - - private static function getSchema(string $type): Schema - { - static $cache; - $cache = $cache ?: [ - Definitions\ServiceDefinition::class => self::getServiceSchema(), - Definitions\AccessorDefinition::class => self::getAccessorSchema(), - Definitions\FactoryDefinition::class => self::getFactorySchema(), - Definitions\LocatorDefinition::class => self::getLocatorSchema(), - Definitions\ImportedDefinition::class => self::getImportedSchema(), - ]; - return $cache[$type]; - } - - - private static function getServiceSchema(): Schema - { - return Expect::structure([ - 'type' => Expect::type('string'), - 'factory' => Expect::type('callable|Nette\DI\Definitions\Statement'), - 'arguments' => Expect::array(), - 'setup' => Expect::listOf('callable|Nette\DI\Definitions\Statement|array:1'), - 'inject' => Expect::bool(), - 'autowired' => Expect::type('bool|string|array'), - 'tags' => Expect::array(), - 'reset' => Expect::array(), - 'alteration' => Expect::bool(), - ]); - } - - - private static function getAccessorSchema(): Schema - { - return Expect::structure([ - 'type' => Expect::string(), - 'implement' => Expect::string(), - 'factory' => Expect::type('callable|Nette\DI\Definitions\Statement'), - 'autowired' => Expect::type('bool|string|array'), - 'tags' => Expect::array(), - ]); - } - - - private static function getFactorySchema(): Schema - { - return Expect::structure([ - 'type' => Expect::string(), - 'factory' => Expect::type('callable|Nette\DI\Definitions\Statement'), - 'implement' => Expect::string(), - 'arguments' => Expect::array(), - 'setup' => Expect::listOf('callable|Nette\DI\Definitions\Statement|array:1'), - 'parameters' => Expect::array(), - 'references' => Expect::array(), - 'tagged' => Expect::string(), - 'inject' => Expect::bool(), - 'autowired' => Expect::type('bool|string|array'), - 'tags' => Expect::array(), - 'reset' => Expect::array(), - ]); - } - - - private static function getLocatorSchema(): Schema - { - return Expect::structure([ - 'implement' => Expect::string(), - 'references' => Expect::array(), - 'tagged' => Expect::string(), - 'autowired' => Expect::type('bool|string|array'), - 'tags' => Expect::array(), - ]); - } - - - private static function getImportedSchema(): Schema - { - return Expect::structure([ - 'type' => Expect::string(), - 'imported' => Expect::bool(), - 'autowired' => Expect::type('bool|string|array'), - 'tags' => Expect::array(), - ]); - } -} diff --git a/vendor/nette/di/src/DI/Config/Helpers.php b/vendor/nette/di/src/DI/Config/Helpers.php deleted file mode 100644 index 531d88b..0000000 --- a/vendor/nette/di/src/DI/Config/Helpers.php +++ /dev/null @@ -1,48 +0,0 @@ - Adapters\PhpAdapter::class, - 'neon' => Adapters\NeonAdapter::class, - ]; - - private $dependencies = []; - - private $loadedFiles = []; - - private $parameters = []; - - - /** - * Reads configuration from file. - */ - public function load(string $file, ?bool $merge = true): array - { - if (!is_file($file) || !is_readable($file)) { - throw new Nette\FileNotFoundException(sprintf("File '%s' is missing or is not readable.", $file)); - } - - if (isset($this->loadedFiles[$file])) { - throw new Nette\InvalidStateException(sprintf("Recursive included file '%s'", $file)); - } - - $this->loadedFiles[$file] = true; - - $this->dependencies[] = $file; - $data = $this->getAdapter($file)->load($file); - - $res = []; - if (isset($data[self::INCLUDES_KEY])) { - Validators::assert($data[self::INCLUDES_KEY], 'list', "section 'includes' in file '$file'"); - $includes = Nette\DI\Helpers::expand($data[self::INCLUDES_KEY], $this->parameters); - foreach ($includes as $include) { - $include = $this->expandIncludedFile($include, $file); - $res = Nette\Schema\Helpers::merge($this->load($include, $merge), $res); - } - } - - unset($data[self::INCLUDES_KEY], $this->loadedFiles[$file]); - - if ($merge === false) { - $res[] = $data; - } else { - $res = Nette\Schema\Helpers::merge($data, $res); - } - - return $res; - } - - - /** - * Save configuration to file. - */ - public function save(array $data, string $file): void - { - if (file_put_contents($file, $this->getAdapter($file)->dump($data)) === false) { - throw new Nette\IOException(sprintf("Cannot write file '%s'.", $file)); - } - } - - - /** - * Returns configuration files. - */ - public function getDependencies(): array - { - return array_unique($this->dependencies); - } - - - /** - * Expands included file name. - */ - public function expandIncludedFile(string $includedFile, string $mainFile): string - { - return preg_match('#([a-z]+:)?[/\\\\]#Ai', $includedFile) // is absolute - ? $includedFile - : dirname($mainFile) . '/' . $includedFile; - } - - - /** - * Registers adapter for given file extension. - * @param string|Adapter $adapter - * @return static - */ - public function addAdapter(string $extension, $adapter) - { - $this->adapters[strtolower($extension)] = $adapter; - return $this; - } - - - private function getAdapter(string $file): Adapter - { - $extension = strtolower(pathinfo($file, PATHINFO_EXTENSION)); - if (!isset($this->adapters[$extension])) { - throw new Nette\InvalidArgumentException(sprintf("Unknown file extension '%s'.", $file)); - } - - return is_object($this->adapters[$extension]) - ? $this->adapters[$extension] - : new $this->adapters[$extension]; - } - - - /** @return static */ - public function setParameters(array $params) - { - $this->parameters = $params; - return $this; - } -} diff --git a/vendor/nette/di/src/DI/Container.php b/vendor/nette/di/src/DI/Container.php deleted file mode 100644 index 09518b5..0000000 --- a/vendor/nette/di/src/DI/Container.php +++ /dev/null @@ -1,374 +0,0 @@ - type (complete list of available services) */ - protected $types = []; - - /** @var string[] alias => service name */ - protected $aliases = []; - - /** @var array[] tag name => service name => tag value */ - protected $tags = []; - - /** @var array[] type => level => services */ - protected $wiring = []; - - /** @var object[] service name => instance */ - private $instances = []; - - /** @var array circular reference detector */ - private $creating; - - /** @var array */ - private $methods; - - - public function __construct(array $params = []) - { - $this->parameters = $params; - $this->methods = array_flip(array_filter( - get_class_methods($this), - function ($s) { return preg_match('#^createService.#', $s); } - )); - } - - - public function getParameters(): array - { - return $this->parameters; - } - - - /** - * Adds the service to the container. - * @param object $service service or its factory - * @return static - */ - public function addService(string $name, $service) - { - $name = $this->aliases[$name] ?? $name; - if (isset($this->instances[$name])) { - throw new Nette\InvalidStateException(sprintf("Service '%s' already exists.", $name)); - - } elseif (!is_object($service)) { - throw new Nette\InvalidArgumentException(sprintf("Service '%s' must be a object, %s given.", $name, gettype($service))); - } - - if ($service instanceof \Closure) { - $rt = Nette\Utils\Type::fromReflection(new \ReflectionFunction($service)); - $type = $rt ? Helpers::ensureClassType($rt, 'return type of closure') : ''; - } else { - $type = get_class($service); - } - - if (!isset($this->methods[self::getMethodName($name)])) { - $this->types[$name] = $type; - - } elseif (($expectedType = $this->getServiceType($name)) && !is_a($type, $expectedType, true)) { - throw new Nette\InvalidArgumentException(sprintf( - "Service '%s' must be instance of %s, %s.", - $name, - $expectedType, - $type ? "$type given" : 'add typehint to closure' - )); - } - - if ($service instanceof \Closure) { - $this->methods[self::getMethodName($name)] = $service; - $this->types[$name] = $type; - } else { - $this->instances[$name] = $service; - } - - return $this; - } - - - /** - * Removes the service from the container. - */ - public function removeService(string $name): void - { - $name = $this->aliases[$name] ?? $name; - unset($this->instances[$name]); - } - - - /** - * Gets the service object by name. - * @return object - * @throws MissingServiceException - */ - public function getService(string $name) - { - if (!isset($this->instances[$name])) { - if (isset($this->aliases[$name])) { - return $this->getService($this->aliases[$name]); - } - - $this->instances[$name] = $this->createService($name); - } - - return $this->instances[$name]; - } - - - /** - * Gets the service object by name. - * @return object - * @throws MissingServiceException - */ - public function getByName(string $name) - { - return $this->getService($name); - } - - - /** - * Gets the service type by name. - * @throws MissingServiceException - */ - public function getServiceType(string $name): string - { - $method = self::getMethodName($name); - if (isset($this->aliases[$name])) { - return $this->getServiceType($this->aliases[$name]); - - } elseif (isset($this->types[$name])) { - return $this->types[$name]; - - } elseif (isset($this->methods[$method])) { - $type = (new \ReflectionMethod($this, $method))->getReturnType(); - return $type ? $type->getName() : ''; - - } else { - throw new MissingServiceException(sprintf("Service '%s' not found.", $name)); - } - } - - - /** - * Does the service exist? - */ - public function hasService(string $name): bool - { - $name = $this->aliases[$name] ?? $name; - return isset($this->methods[self::getMethodName($name)]) || isset($this->instances[$name]); - } - - - /** - * Is the service created? - */ - public function isCreated(string $name): bool - { - if (!$this->hasService($name)) { - throw new MissingServiceException(sprintf("Service '%s' not found.", $name)); - } - - $name = $this->aliases[$name] ?? $name; - return isset($this->instances[$name]); - } - - - /** - * Creates new instance of the service. - * @return object - * @throws MissingServiceException - */ - public function createService(string $name, array $args = []) - { - $name = $this->aliases[$name] ?? $name; - $method = self::getMethodName($name); - $cb = $this->methods[$method] ?? null; - if (isset($this->creating[$name])) { - throw new Nette\InvalidStateException(sprintf('Circular reference detected for services: %s.', implode(', ', array_keys($this->creating)))); - - } elseif ($cb === null) { - throw new MissingServiceException(sprintf("Service '%s' not found.", $name)); - } - - try { - $this->creating[$name] = true; - $service = $cb instanceof \Closure - ? $cb(...$args) - : $this->$method(...$args); - - } finally { - unset($this->creating[$name]); - } - - if (!is_object($service)) { - throw new Nette\UnexpectedValueException(sprintf( - "Unable to create service '$name', value returned by %s is not object.", - $cb instanceof \Closure ? 'closure' : "method $method()" - )); - } - - return $service; - } - - - /** - * Resolves service by type. - * @template T - * @param class-string $type - * @return ?T - * @throws MissingServiceException - */ - public function getByType(string $type, bool $throw = true) - { - $type = Helpers::normalizeClass($type); - if (!empty($this->wiring[$type][0])) { - if (count($names = $this->wiring[$type][0]) === 1) { - return $this->getService($names[0]); - } - - natsort($names); - throw new MissingServiceException(sprintf("Multiple services of type $type found: %s.", implode(', ', $names))); - - } elseif ($throw) { - if (!class_exists($type) && !interface_exists($type)) { - throw new MissingServiceException(sprintf("Service of type '%s' not found. Check the class name because it cannot be found.", $type)); - } - - foreach ($this->methods as $method => $foo) { - $methodType = (new \ReflectionMethod(static::class, $method))->getReturnType()->getName(); - if (is_a($methodType, $type, true)) { - throw new MissingServiceException(sprintf( - "Service of type %s is not autowired or is missing in di\u{a0}›\u{a0}export\u{a0}›\u{a0}types.", - $type - )); - } - } - - throw new MissingServiceException(sprintf( - 'Service of type %s not found. Did you add it to configuration file?', - $type - )); - } - - return null; - } - - - /** - * Gets the autowired service names of the specified type. - * @return string[] - * @internal - */ - public function findAutowired(string $type): array - { - $type = Helpers::normalizeClass($type); - return array_merge($this->wiring[$type][0] ?? [], $this->wiring[$type][1] ?? []); - } - - - /** - * Gets the service names of the specified type. - * @return string[] - */ - public function findByType(string $type): array - { - $type = Helpers::normalizeClass($type); - return empty($this->wiring[$type]) - ? [] - : array_merge(...array_values($this->wiring[$type])); - } - - - /** - * Gets the service names of the specified tag. - * @return array of [service name => tag attributes] - */ - public function findByTag(string $tag): array - { - return $this->tags[$tag] ?? []; - } - - - /********************* autowiring ****************d*g**/ - - - /** - * Creates new instance using autowiring. - * @return object - * @throws Nette\InvalidArgumentException - */ - public function createInstance(string $class, array $args = []) - { - $rc = new \ReflectionClass($class); - if (!$rc->isInstantiable()) { - throw new ServiceCreationException(sprintf('Class %s is not instantiable.', $class)); - - } elseif ($constructor = $rc->getConstructor()) { - return $rc->newInstanceArgs($this->autowireArguments($constructor, $args)); - - } elseif ($args) { - throw new ServiceCreationException(sprintf('Unable to pass arguments, class %s has no constructor.', $class)); - } - - return new $class; - } - - - /** - * Calls all methods starting with with "inject" using autowiring. - * @param object $service - */ - public function callInjects($service): void - { - Extensions\InjectExtension::callInjects($this, $service); - } - - - /** - * Calls method using autowiring. - * @return mixed - */ - public function callMethod(callable $function, array $args = []) - { - return $function(...$this->autowireArguments(Nette\Utils\Callback::toReflection($function), $args)); - } - - - private function autowireArguments(\ReflectionFunctionAbstract $function, array $args = []): array - { - return Resolver::autowireArguments($function, $args, function (string $type, bool $single) { - return $single - ? $this->getByType($type) - : array_map([$this, 'getService'], $this->findAutowired($type)); - }); - } - - - public static function getMethodName(string $name): string - { - if ($name === '') { - throw new Nette\InvalidArgumentException('Service name must be a non-empty string.'); - } - - return 'createService' . str_replace('.', '__', ucfirst($name)); - } -} diff --git a/vendor/nette/di/src/DI/ContainerBuilder.php b/vendor/nette/di/src/DI/ContainerBuilder.php deleted file mode 100644 index ebdb1c4..0000000 --- a/vendor/nette/di/src/DI/ContainerBuilder.php +++ /dev/null @@ -1,428 +0,0 @@ - service */ - private $aliases = []; - - /** @var Autowiring */ - private $autowiring; - - /** @var bool */ - private $needsResolve = true; - - /** @var bool */ - private $resolving = false; - - /** @var array */ - private $dependencies = []; - - - public function __construct() - { - $this->autowiring = new Autowiring($this); - $this->addImportedDefinition(self::THIS_CONTAINER)->setType(Container::class); - } - - - /** - * Adds new service definition. - * @return Definitions\ServiceDefinition - */ - public function addDefinition(?string $name, ?Definition $definition = null): Definition - { - $this->needsResolve = true; - if ($name === null) { - for ( - $i = 1; - isset($this->definitions['0' . $i]) || isset($this->aliases['0' . $i]); - $i++ - ); - $name = '0' . $i; // prevents converting to integer in array key - - } elseif (is_int(key([$name => 1])) || !preg_match('#^\w+(\.\w+)*$#D', $name)) { - throw new Nette\InvalidArgumentException(sprintf('Service name must be a alpha-numeric string and not a number, %s given.', gettype($name))); - - } else { - $name = $this->aliases[$name] ?? $name; - if (isset($this->definitions[$name])) { - throw new Nette\InvalidStateException(sprintf("Service '%s' has already been added.", $name)); - } - - $lname = strtolower($name); - foreach ($this->definitions as $nm => $foo) { - if ($lname === strtolower($nm)) { - throw new Nette\InvalidStateException(sprintf( - "Service '%s' has the same name as '%s' in a case-insensitive manner.", - $name, - $nm - )); - } - } - } - - $definition = $definition ?: new Definitions\ServiceDefinition; - $definition->setName($name); - $definition->setNotifier(function (): void { - $this->needsResolve = true; - }); - return $this->definitions[$name] = $definition; - } - - - public function addAccessorDefinition(?string $name): Definitions\AccessorDefinition - { - return $this->addDefinition($name, new Definitions\AccessorDefinition); - } - - - public function addFactoryDefinition(?string $name): Definitions\FactoryDefinition - { - return $this->addDefinition($name, new Definitions\FactoryDefinition); - } - - - public function addLocatorDefinition(?string $name): Definitions\LocatorDefinition - { - return $this->addDefinition($name, new Definitions\LocatorDefinition); - } - - - public function addImportedDefinition(?string $name): Definitions\ImportedDefinition - { - return $this->addDefinition($name, new Definitions\ImportedDefinition); - } - - - /** - * Removes the specified service definition. - */ - public function removeDefinition(string $name): void - { - $this->needsResolve = true; - $name = $this->aliases[$name] ?? $name; - unset($this->definitions[$name]); - } - - - /** - * Gets the service definition. - */ - public function getDefinition(string $name): Definition - { - $service = $this->aliases[$name] ?? $name; - if (!isset($this->definitions[$service])) { - throw new MissingServiceException(sprintf("Service '%s' not found.", $name)); - } - - return $this->definitions[$service]; - } - - - /** - * Gets all service definitions. - * @return Definition[] - */ - public function getDefinitions(): array - { - return $this->definitions; - } - - - /** - * Does the service definition or alias exist? - */ - public function hasDefinition(string $name): bool - { - $name = $this->aliases[$name] ?? $name; - return isset($this->definitions[$name]); - } - - - public function addAlias(string $alias, string $service): void - { - if (!$alias) { // builder is not ready for falsy names such as '0' - throw new Nette\InvalidArgumentException(sprintf('Alias name must be a non-empty string, %s given.', gettype($alias))); - - } elseif (!$service) { // builder is not ready for falsy names such as '0' - throw new Nette\InvalidArgumentException(sprintf('Service name must be a non-empty string, %s given.', gettype($service))); - - } elseif (isset($this->aliases[$alias])) { - throw new Nette\InvalidStateException(sprintf("Alias '%s' has already been added.", $alias)); - - } elseif (isset($this->definitions[$alias])) { - throw new Nette\InvalidStateException(sprintf("Service '%s' has already been added.", $alias)); - } - - $this->aliases[$alias] = $service; - } - - - /** - * Removes the specified alias. - */ - public function removeAlias(string $alias): void - { - unset($this->aliases[$alias]); - } - - - /** - * Gets all service aliases. - */ - public function getAliases(): array - { - return $this->aliases; - } - - - /** - * @param string[] $types - * @return static - */ - public function addExcludedClasses(array $types) - { - $this->needsResolve = true; - $this->autowiring->addExcludedClasses($types); - return $this; - } - - - /** - * Resolves autowired service name by type. - * @param bool $throw exception if service doesn't exist? - * @throws MissingServiceException - */ - public function getByType(string $type, bool $throw = false): ?string - { - $this->needResolved(); - return $this->autowiring->getByType($type, $throw); - } - - - /** - * Gets autowired service definition of the specified type. - * @throws MissingServiceException - */ - public function getDefinitionByType(string $type): Definition - { - return $this->getDefinition($this->getByType($type, true)); - } - - - /** - * Gets the autowired service names and definitions of the specified type. - * @return Definition[] service name is key - * @internal - */ - public function findAutowired(string $type): array - { - $this->needResolved(); - return $this->autowiring->findByType($type); - } - - - /** - * Gets the service names and definitions of the specified type. - * @return Definition[] service name is key - */ - public function findByType(string $type): array - { - $this->needResolved(); - $found = []; - foreach ($this->definitions as $name => $def) { - if (is_a($def->getType(), $type, true)) { - $found[$name] = $def; - } - } - - return $found; - } - - - /** - * Gets the service names and tag values. - * @return array of [service name => tag attributes] - */ - public function findByTag(string $tag): array - { - $found = []; - foreach ($this->definitions as $name => $def) { - if (($tmp = $def->getTag($tag)) !== null) { - $found[$name] = $tmp; - } - } - - return $found; - } - - - /********************* building ****************d*g**/ - - - /** - * Checks services, resolves types and rebuilts autowiring classlist. - */ - public function resolve(): void - { - if ($this->resolving) { - return; - } - - $this->resolving = true; - - $resolver = new Resolver($this); - foreach ($this->definitions as $def) { - $resolver->resolveDefinition($def); - } - - $this->autowiring->rebuild(); - - $this->resolving = $this->needsResolve = false; - } - - - private function needResolved(): void - { - if ($this->resolving) { - throw new NotAllowedDuringResolvingException; - } elseif ($this->needsResolve) { - $this->resolve(); - } - } - - - public function complete(): void - { - $this->resolve(); - foreach ($this->definitions as $def) { - $def->setNotifier(null); - } - - $resolver = new Resolver($this); - foreach ($this->definitions as $def) { - $resolver->completeDefinition($def); - } - } - - - /** - * Adds item to the list of dependencies. - * @param \ReflectionClass|\ReflectionFunctionAbstract|string $dep - * @return static - * @internal - */ - public function addDependency($dep) - { - $this->dependencies[] = $dep; - return $this; - } - - - /** - * Returns the list of dependencies. - */ - public function getDependencies(): array - { - return $this->dependencies; - } - - - /** @internal */ - public function exportMeta(): array - { - $defs = $this->definitions; - ksort($defs); - foreach ($defs as $name => $def) { - if ($def instanceof Definitions\ImportedDefinition) { - $meta['types'][$name] = $def->getType(); - } - - foreach ($def->getTags() as $tag => $value) { - $meta['tags'][$tag][$name] = $value; - } - } - - $meta['aliases'] = $this->aliases; - ksort($meta['aliases']); - - $all = []; - foreach ($this->definitions as $name => $def) { - if ($type = $def->getType()) { - foreach (class_parents($type) + class_implements($type) + [$type] as $class) { - $all[$class][] = $name; - } - } - } - - [$low, $high] = $this->autowiring->getClassList(); - foreach ($all as $class => $names) { - $meta['wiring'][$class] = array_filter([ - $high[$class] ?? [], - $low[$class] ?? [], - array_diff($names, $low[$class] ?? [], $high[$class] ?? []), - ]); - } - - return $meta; - } - - - public static function literal(string $code, ?array $args = null): Nette\PhpGenerator\PhpLiteral - { - return new Nette\PhpGenerator\PhpLiteral( - $args === null ? $code : (new Nette\PhpGenerator\Dumper)->format($code, ...$args) - ); - } - - - /** @deprecated */ - public function formatPhp(string $statement, array $args): string - { - array_walk_recursive($args, function (&$val): void { - if ($val instanceof Statement) { - $val = (new Resolver($this))->completeStatement($val); - - } elseif ($val instanceof Definition) { - $val = new Definitions\Reference($val->getName()); - } - }); - return (new PhpGenerator($this))->formatPhp($statement, $args); - } - - - /** @deprecated use resolve() */ - public function prepareClassList(): void - { - trigger_error(__METHOD__ . '() is deprecated, use resolve()', E_USER_DEPRECATED); - $this->resolve(); - } -} diff --git a/vendor/nette/di/src/DI/ContainerLoader.php b/vendor/nette/di/src/DI/ContainerLoader.php deleted file mode 100644 index e421d80..0000000 --- a/vendor/nette/di/src/DI/ContainerLoader.php +++ /dev/null @@ -1,125 +0,0 @@ -tempDirectory = $tempDirectory; - $this->autoRebuild = $autoRebuild; - } - - - /** - * @param callable $generator function (Nette\DI\Compiler $compiler): string|null - * @param mixed $key - */ - public function load(callable $generator, $key = null): string - { - $class = $this->getClassName($key); - if (!class_exists($class, false)) { - $this->loadFile($class, $generator); - } - - return $class; - } - - - /** - * @param mixed $key - */ - public function getClassName($key): string - { - return 'Container_' . substr(md5(serialize($key)), 0, 10); - } - - - private function loadFile(string $class, callable $generator): void - { - $file = "$this->tempDirectory/$class.php"; - if (!$this->isExpired($file) && (@include $file) !== false) { // @ file may not exist - return; - } - - Nette\Utils\FileSystem::createDir($this->tempDirectory); - - $handle = @fopen("$file.lock", 'c+'); // @ is escalated to exception - if (!$handle) { - throw new Nette\IOException(sprintf("Unable to create file '%s.lock'. %s", $file, Nette\Utils\Helpers::getLastError())); - } elseif (!@flock($handle, LOCK_EX)) { // @ is escalated to exception - // the lock will automatically be freed when $handle goes out of scope - throw new Nette\IOException(sprintf("Unable to acquire exclusive lock on '%s.lock'. %s", $file, Nette\Utils\Helpers::getLastError())); - } - - if (!is_file($file) || $this->isExpired($file, $updatedMeta)) { - if (isset($updatedMeta)) { - $toWrite["$file.meta"] = $updatedMeta; - } else { - [$toWrite[$file], $toWrite["$file.meta"]] = $this->generate($class, $generator); - } - - foreach ($toWrite as $name => $content) { - if (file_put_contents("$name.tmp", $content) !== strlen($content) || !rename("$name.tmp", $name)) { - @unlink("$name.tmp"); // @ - file may not exist - throw new Nette\IOException(sprintf("Unable to create file '%s'.", $name)); - } elseif (function_exists('opcache_invalidate')) { - @opcache_invalidate($name, true); // @ can be restricted - } - } - } - - if ((@include $file) === false) { // @ - error escalated to exception - throw new Nette\IOException(sprintf("Unable to include '%s'.", $file)); - } - } - - - private function isExpired(string $file, ?string &$updatedMeta = null): bool - { - if ($this->autoRebuild) { - $meta = @unserialize((string) file_get_contents("$file.meta")); // @ - file may not exist - $orig = $meta[2] ?? null; - return empty($meta[0]) - || DependencyChecker::isExpired(...$meta) - || ($orig !== $meta[2] && $updatedMeta = serialize($meta)); - } - - return false; - } - - - /** @return array of (code, file[]) */ - protected function generate(string $class, callable $generator): array - { - $compiler = new Compiler; - $compiler->setClassName($class); - $code = $generator(...[&$compiler]) ?: $compiler->compile(); - return [ - "exportDependencies()), - ]; - } -} diff --git a/vendor/nette/di/src/DI/Definitions/AccessorDefinition.php b/vendor/nette/di/src/DI/Definitions/AccessorDefinition.php deleted file mode 100644 index 075a18a..0000000 --- a/vendor/nette/di/src/DI/Definitions/AccessorDefinition.php +++ /dev/null @@ -1,134 +0,0 @@ -getName(), - $interface - )); - } - - $rc = new \ReflectionClass($interface); - - $method = $rc->getMethods()[0] ?? null; - if ( - !$method - || $method->isStatic() - || $method->getName() !== self::METHOD_GET - || count($rc->getMethods()) > 1 - ) { - throw new Nette\InvalidArgumentException(sprintf( - "Service '%s': Interface %s must have just one non-static method get().", - $this->getName(), - $interface - )); - } elseif ($method->getNumberOfParameters()) { - throw new Nette\InvalidArgumentException(sprintf( - "Service '%s': Method %s::get() must have no parameters.", - $this->getName(), - $interface - )); - } - - return parent::setType($interface); - } - - - public function getImplement(): ?string - { - return $this->getType(); - } - - - /** - * @param string|Reference $reference - * @return static - */ - public function setReference($reference) - { - if ($reference instanceof Reference) { - $this->reference = $reference; - } else { - $this->reference = substr($reference, 0, 1) === '@' - ? new Reference(substr($reference, 1)) - : Reference::fromType($reference); - } - - return $this; - } - - - public function getReference(): ?Reference - { - return $this->reference; - } - - - public function resolveType(Nette\DI\Resolver $resolver): void - { - } - - - public function complete(Nette\DI\Resolver $resolver): void - { - if (!$this->reference) { - $interface = $this->getType(); - $method = new \ReflectionMethod($interface, self::METHOD_GET); - $type = Type::fromReflection($method) ?? Helpers::getReturnTypeAnnotation($method); - $this->setReference(Helpers::ensureClassType($type, "return type of $interface::get()")); - } - - $this->reference = $resolver->normalizeReference($this->reference); - } - - - public function generateMethod(Nette\PhpGenerator\Method $method, Nette\DI\PhpGenerator $generator): void - { - $class = (new Nette\PhpGenerator\ClassType) - ->addImplement($this->getType()); - - $class->addProperty('container') - ->setPrivate(); - - $class->addMethod('__construct') - ->addBody('$this->container = $container;') - ->addParameter('container') - ->setType($generator->getClassName()); - - $rm = new \ReflectionMethod($this->getType(), self::METHOD_GET); - - $class->addMethod(self::METHOD_GET) - ->setBody('return $this->container->getService(?);', [$this->reference->getValue()]) - ->setReturnType((string) Type::fromReflection($rm)); - - $method->setBody('return new class ($this) ' . $class . ';'); - } -} diff --git a/vendor/nette/di/src/DI/Definitions/Definition.php b/vendor/nette/di/src/DI/Definitions/Definition.php deleted file mode 100644 index 7be002f..0000000 --- a/vendor/nette/di/src/DI/Definitions/Definition.php +++ /dev/null @@ -1,217 +0,0 @@ -name) { - throw new Nette\InvalidStateException('Name already has been set.'); - } - - $this->name = $name; - return $this; - } - - - final public function getName(): ?string - { - return $this->name; - } - - - /** @return static */ - protected function setType(?string $type) - { - if ($this->autowired && $this->notifier && $this->type !== $type) { - ($this->notifier)(); - } - - if ($type === null) { - $this->type = null; - } elseif (!class_exists($type) && !interface_exists($type)) { - throw new Nette\InvalidArgumentException(sprintf( - "Service '%s': Class or interface '%s' not found.", - $this->name, - $type - )); - } else { - $this->type = Nette\DI\Helpers::normalizeClass($type); - } - - return $this; - } - - - final public function getType(): ?string - { - return $this->type; - } - - - /** @return static */ - final public function setTags(array $tags) - { - $this->tags = $tags; - return $this; - } - - - final public function getTags(): array - { - return $this->tags; - } - - - /** - * @param mixed $attr - * @return static - */ - final public function addTag(string $tag, $attr = true) - { - $this->tags[$tag] = $attr; - return $this; - } - - - /** @return mixed */ - final public function getTag(string $tag) - { - return $this->tags[$tag] ?? null; - } - - - /** - * @param bool|string|string[] $state - * @return static - */ - final public function setAutowired($state = true) - { - if ($this->notifier && $this->autowired !== $state) { - ($this->notifier)(); - } - - $this->autowired = is_string($state) || is_array($state) - ? (array) $state - : (bool) $state; - return $this; - } - - - /** @return bool|string[] */ - final public function getAutowired() - { - return $this->autowired; - } - - - /** @return static */ - public function setExported(bool $state = true) - { - return $this->addTag('nette.exported', $state); - } - - - public function isExported(): bool - { - return (bool) $this->getTag('nette.exported'); - } - - - public function __clone() - { - $this->notifier = $this->name = null; - } - - - /********************* life cycle ****************d*g**/ - - - abstract public function resolveType(Nette\DI\Resolver $resolver): void; - - - abstract public function complete(Nette\DI\Resolver $resolver): void; - - - abstract public function generateMethod(Nette\PhpGenerator\Method $method, Nette\DI\PhpGenerator $generator): void; - - - final public function setNotifier(?callable $notifier): void - { - $this->notifier = $notifier; - } - - - /********************* deprecated stuff from former ServiceDefinition ****************d*g**/ - - - /** @deprecated Use setType() */ - public function setClass(?string $type) - { - return $this->setType($type); - } - - - /** @deprecated Use getType() */ - public function getClass(): ?string - { - return $this->getType(); - } - - - /** @deprecated Use '$def instanceof Nette\DI\Definitions\ImportedDefinition' */ - public function isDynamic(): bool - { - return false; - } - - - /** @deprecated Use Nette\DI\Definitions\FactoryDefinition or AccessorDefinition */ - public function getImplement(): ?string - { - return null; - } - - - /** @deprecated Use getAutowired() */ - public function isAutowired() - { - return $this->autowired; - } -} diff --git a/vendor/nette/di/src/DI/Definitions/FactoryDefinition.php b/vendor/nette/di/src/DI/Definitions/FactoryDefinition.php deleted file mode 100644 index 70ca1ed..0000000 --- a/vendor/nette/di/src/DI/Definitions/FactoryDefinition.php +++ /dev/null @@ -1,333 +0,0 @@ -resultDefinition = new ServiceDefinition; - } - - - /** @return static */ - public function setImplement(string $interface) - { - if (!interface_exists($interface)) { - throw new Nette\InvalidArgumentException(sprintf( - "Service '%s': Interface '%s' not found.", - $this->getName(), - $interface - )); - } - - $rc = new \ReflectionClass($interface); - $method = $rc->getMethods()[0] ?? null; - if (!$method || $method->isStatic() || $method->name !== self::METHOD_CREATE || count($rc->getMethods()) > 1) { - throw new Nette\InvalidArgumentException(sprintf( - "Service '%s': Interface %s must have just one non-static method create().", - $this->getName(), - $interface - )); - } - - return parent::setType($interface); - } - - - public function getImplement(): ?string - { - return $this->getType(); - } - - - final public function getResultType(): ?string - { - return $this->resultDefinition->getType(); - } - - - /** @return static */ - public function setResultDefinition(Definition $definition) - { - $this->resultDefinition = $definition; - return $this; - } - - - /** @return ServiceDefinition */ - public function getResultDefinition(): Definition - { - return $this->resultDefinition; - } - - - /** - * @deprecated use ->getResultDefinition()->setFactory() - * @return static - */ - public function setFactory($factory, array $args = []) - { - trigger_error(sprintf('Service %s: %s() is deprecated, use ->getResultDefinition()->setFactory()', $this->getName(), __METHOD__), E_USER_DEPRECATED); - $this->resultDefinition->setFactory($factory, $args); - return $this; - } - - - /** @deprecated use ->getResultDefinition()->getFactory() */ - public function getFactory(): ?Statement - { - trigger_error(sprintf('Service %s: %s() is deprecated, use ->getResultDefinition()->getFactory()', $this->getName(), __METHOD__), E_USER_DEPRECATED); - return $this->resultDefinition->getFactory(); - } - - - /** - * @deprecated use ->getResultDefinition()->getEntity() - * @return mixed - */ - public function getEntity() - { - trigger_error(sprintf('Service %s: %s() is deprecated, use ->getResultDefinition()->getEntity()', $this->getName(), __METHOD__), E_USER_DEPRECATED); - return $this->resultDefinition->getEntity(); - } - - - /** - * @deprecated use ->getResultDefinition()->setArguments() - * @return static - */ - public function setArguments(array $args = []) - { - trigger_error(sprintf('Service %s: %s() is deprecated, use ->getResultDefinition()->setArguments()', $this->getName(), __METHOD__), E_USER_DEPRECATED); - $this->resultDefinition->setArguments($args); - return $this; - } - - - /** - * @deprecated use ->getResultDefinition()->setSetup() - * @return static - */ - public function setSetup(array $setup) - { - trigger_error(sprintf('Service %s: %s() is deprecated, use ->getResultDefinition()->setSetup()', $this->getName(), __METHOD__), E_USER_DEPRECATED); - $this->resultDefinition->setSetup($setup); - return $this; - } - - - /** @deprecated use ->getResultDefinition()->getSetup() */ - public function getSetup(): array - { - trigger_error(sprintf('Service %s: %s() is deprecated, use ->getResultDefinition()->getSetup()', $this->getName(), __METHOD__), E_USER_DEPRECATED); - return $this->resultDefinition->getSetup(); - } - - - /** - * @deprecated use ->getResultDefinition()->addSetup() - * @return static - */ - public function addSetup($entity, array $args = []) - { - trigger_error(sprintf('Service %s: %s() is deprecated, use ->getResultDefinition()->addSetup()', $this->getName(), __METHOD__), E_USER_DEPRECATED); - $this->resultDefinition->addSetup($entity, $args); - return $this; - } - - - /** @return static */ - public function setParameters(array $params) - { - $this->parameters = $params; - return $this; - } - - - public function getParameters(): array - { - return $this->parameters; - } - - - public function resolveType(Nette\DI\Resolver $resolver): void - { - $interface = $this->getType(); - if (!$interface) { - throw new ServiceCreationException('Type is missing in definition of service.'); - } - - $method = new \ReflectionMethod($interface, self::METHOD_CREATE); - $type = Type::fromReflection($method) ?? Helpers::getReturnTypeAnnotation($method); - - $resultDef = $this->resultDefinition; - try { - $resolver->resolveDefinition($resultDef); - } catch (ServiceCreationException $e) { - if ($resultDef->getType()) { - throw $e; - } - - $resultDef->setType(Helpers::ensureClassType($type, "return type of $interface::create()")); - $resolver->resolveDefinition($resultDef); - } - - if ($type && !$type->allows($resultDef->getType())) { - throw new ServiceCreationException(sprintf( - 'Factory for %s cannot create incompatible %s type.', - $type, - $resultDef->getType() - )); - } - } - - - public function complete(Nette\DI\Resolver $resolver): void - { - $resultDef = $this->resultDefinition; - - if ($resultDef instanceof ServiceDefinition) { - if (!$this->parameters) { - $this->completeParameters($resolver); - } - - $this->convertArguments($resultDef->getFactory()->arguments); - foreach ($resultDef->getSetup() as $setup) { - $this->convertArguments($setup->arguments); - } - - if ($resultDef->getEntity() instanceof Reference && !$resultDef->getFactory()->arguments) { - $resultDef->setFactory([ // render as $container->createMethod() - new Reference(Nette\DI\ContainerBuilder::THIS_CONTAINER), - Nette\DI\Container::getMethodName($resultDef->getEntity()->getValue()), - ]); - } - } - - $resolver->completeDefinition($resultDef); - } - - - private function completeParameters(Nette\DI\Resolver $resolver): void - { - $interface = $this->getType(); - $method = new \ReflectionMethod($interface, self::METHOD_CREATE); - - $ctorParams = []; - if ( - ($class = $resolver->resolveEntityType($this->resultDefinition->getFactory())) - && ($ctor = (new \ReflectionClass($class))->getConstructor()) - ) { - foreach ($ctor->getParameters() as $param) { - $ctorParams[$param->name] = $param; - } - } - - foreach ($method->getParameters() as $param) { - $methodType = Type::fromReflection($param); - if (isset($ctorParams[$param->name])) { - $ctorParam = $ctorParams[$param->name]; - $ctorType = Type::fromReflection($ctorParam); - if ($ctorType && !$ctorType->allows((string) $methodType)) { - throw new ServiceCreationException(sprintf( - "Type of \$%s in %s::create() doesn't match type in %s constructor.", - $param->name, - $interface, - $class - )); - } - - $this->resultDefinition->getFactory()->arguments[$ctorParam->getPosition()] = new Php\Literal('$' . $ctorParam->name); - - } elseif (!$this->resultDefinition->getSetup()) { - $hint = Nette\Utils\Helpers::getSuggestion(array_keys($ctorParams), $param->name); - throw new ServiceCreationException(sprintf( - 'Unused parameter $%s when implementing method %s::create()', - $param->name, - $interface - ) . ($hint ? ", did you mean \${$hint}?" : '.')); - } - - $paramDef = $methodType . ' ' . $param->name; - if ($param->isDefaultValueAvailable()) { - $this->parameters[$paramDef] = Reflection::getParameterDefaultValue($param); - } else { - $this->parameters[] = $paramDef; - } - } - } - - - public function convertArguments(array &$args): void - { - foreach ($args as &$v) { - if (is_string($v) && $v && $v[0] === '$') { - $v = new Php\Literal($v); - } - } - } - - - public function generateMethod(Php\Method $method, Nette\DI\PhpGenerator $generator): void - { - $class = (new Php\ClassType) - ->addImplement($this->getType()); - - $class->addProperty('container') - ->setPrivate(); - - $class->addMethod('__construct') - ->addBody('$this->container = $container;') - ->addParameter('container') - ->setType($generator->getClassName()); - - $methodCreate = $class->addMethod(self::METHOD_CREATE); - $this->resultDefinition->generateMethod($methodCreate, $generator); - $body = $methodCreate->getBody(); - $body = str_replace('$this', '$this->container', $body); - $body = str_replace('$this->container->container', '$this->container', $body); - - $rm = new \ReflectionMethod($this->getType(), self::METHOD_CREATE); - $methodCreate - ->setParameters($generator->convertParameters($this->parameters)) - ->setReturnType((string) (Type::fromReflection($rm) ?? $this->getResultType())) - ->setBody($body); - - $method->setBody('return new class ($this) ' . $class . ';'); - } - - - public function __clone() - { - parent::__clone(); - $this->resultDefinition = unserialize(serialize($this->resultDefinition)); - } -} diff --git a/vendor/nette/di/src/DI/Definitions/ImportedDefinition.php b/vendor/nette/di/src/DI/Definitions/ImportedDefinition.php deleted file mode 100644 index e03c245..0000000 --- a/vendor/nette/di/src/DI/Definitions/ImportedDefinition.php +++ /dev/null @@ -1,53 +0,0 @@ -setReturnType('void') - ->setBody( - 'throw new Nette\\DI\\ServiceCreationException(?);', - ["Unable to create imported service '{$this->getName()}', it must be added using addService()"] - ); - } - - - /** @deprecated use '$def instanceof ImportedDefinition' */ - public function isDynamic(): bool - { - return true; - } -} diff --git a/vendor/nette/di/src/DI/Definitions/LocatorDefinition.php b/vendor/nette/di/src/DI/Definitions/LocatorDefinition.php deleted file mode 100644 index 416ec19..0000000 --- a/vendor/nette/di/src/DI/Definitions/LocatorDefinition.php +++ /dev/null @@ -1,172 +0,0 @@ -getName(), $interface)); - } - - $methods = (new \ReflectionClass($interface))->getMethods(); - if (!$methods) { - throw new Nette\InvalidArgumentException(sprintf("Service '%s': Interface %s must have at least one method.", $this->getName(), $interface)); - } - - foreach ($methods as $method) { - if ($method->isStatic() || !( - (preg_match('#^(get|create)$#', $method->name) && $method->getNumberOfParameters() === 1) - || (preg_match('#^(get|create)[A-Z]#', $method->name) && $method->getNumberOfParameters() === 0) - )) { - throw new Nette\InvalidArgumentException(sprintf( - "Service '%s': Method %s::%s() does not meet the requirements: is create(\$name), get(\$name), create*() or get*() and is non-static.", - $this->getName(), - $interface, - $method->name - )); - } - } - - return parent::setType($interface); - } - - - public function getImplement(): ?string - { - return $this->getType(); - } - - - /** @return static */ - public function setReferences(array $references) - { - $this->references = []; - foreach ($references as $name => $ref) { - $this->references[$name] = substr($ref, 0, 1) === '@' - ? new Reference(substr($ref, 1)) - : Reference::fromType($ref); - } - - return $this; - } - - - /** @return Reference[] */ - public function getReferences(): array - { - return $this->references; - } - - - /** @return static */ - public function setTagged(?string $tagged) - { - $this->tagged = $tagged; - return $this; - } - - - public function getTagged(): ?string - { - return $this->tagged; - } - - - public function resolveType(Nette\DI\Resolver $resolver): void - { - } - - - public function complete(Nette\DI\Resolver $resolver): void - { - if ($this->tagged !== null) { - $this->references = []; - foreach ($resolver->getContainerBuilder()->findByTag($this->tagged) as $name => $tag) { - if (isset($this->references[$tag])) { - trigger_error(sprintf( - "Service '%s': duplicated tag '%s' with value '%s'.", - $this->getName(), - $this->tagged, - $tag - ), E_USER_NOTICE); - } - - $this->references[$tag] = new Reference($name); - } - } - - foreach ($this->references as $name => $ref) { - $this->references[$name] = $resolver->normalizeReference($ref); - } - } - - - public function generateMethod(Nette\PhpGenerator\Method $method, Nette\DI\PhpGenerator $generator): void - { - $class = (new Nette\PhpGenerator\ClassType) - ->addImplement($this->getType()); - - $class->addProperty('container') - ->setPrivate(); - - $class->addMethod('__construct') - ->addBody('$this->container = $container;') - ->addParameter('container') - ->setType($generator->getClassName()); - - foreach ((new \ReflectionClass($this->getType()))->getMethods() as $rm) { - preg_match('#^(get|create)(.*)#', $rm->name, $m); - $name = lcfirst($m[2]); - $nullable = $rm->getReturnType()->allowsNull(); - - $methodInner = $class->addMethod($rm->name) - ->setReturnType((string) Nette\Utils\Type::fromReflection($rm)); - - if (!$name) { - $class->addProperty('mapping', array_map(function ($item) { return $item->getValue(); }, $this->references)) - ->setPrivate(); - - $methodInner->setBody('if (!isset($this->mapping[$name])) { - ' . ($nullable ? 'return null;' : 'throw new Nette\DI\MissingServiceException("Service \'$name\' is not defined.");') . ' -} -return $this->container->' . $m[1] . 'Service($this->mapping[$name]);') - ->addParameter('name'); - - } elseif (isset($this->references[$name])) { - $ref = $this->references[$name]->getValue(); - if ($m[1] === 'get') { - $methodInner->setBody('return $this->container->getService(?);', [$ref]); - } else { - $methodInner->setBody('return $this->container->?();', [Nette\DI\Container::getMethodName($ref)]); - } - } else { - $methodInner->setBody($nullable ? 'return null;' : 'throw new Nette\DI\MissingServiceException("Service is not defined.");'); - } - } - - $method->setBody('return new class ($this) ' . $class . ';'); - } -} diff --git a/vendor/nette/di/src/DI/Definitions/Reference.php b/vendor/nette/di/src/DI/Definitions/Reference.php deleted file mode 100644 index f6de3ad..0000000 --- a/vendor/nette/di/src/DI/Definitions/Reference.php +++ /dev/null @@ -1,66 +0,0 @@ -value = $value; - } - - - public function getValue(): string - { - return $this->value; - } - - - public function isName(): bool - { - return strpos($this->value, '\\') === false && $this->value !== self::SELF; - } - - - public function isType(): bool - { - return strpos($this->value, '\\') !== false; - } - - - public function isSelf(): bool - { - return $this->value === self::SELF; - } -} diff --git a/vendor/nette/di/src/DI/Definitions/ServiceDefinition.php b/vendor/nette/di/src/DI/Definitions/ServiceDefinition.php deleted file mode 100644 index 924059b..0000000 --- a/vendor/nette/di/src/DI/Definitions/ServiceDefinition.php +++ /dev/null @@ -1,269 +0,0 @@ -factory = new Statement(null); - } - - - /** @deprecated Use setType() */ - public function setClass(?string $type) - { - $this->setType($type); - if (func_num_args() > 1) { - trigger_error(sprintf('Service %s: %s() second parameter $args is deprecated, use setFactory()', $this->getName(), __METHOD__), E_USER_DEPRECATED); - if ($args = func_get_arg(1)) { - $this->setFactory($type, $args); - } - } - - return $this; - } - - - /** @return static */ - public function setType(?string $type) - { - return parent::setType($type); - } - - - /** - * @param string|array|Definition|Reference|Statement $factory - * @return static - */ - public function setFactory($factory, array $args = []) - { - return $this->setCreator($factory, $args); - } - - - public function getFactory(): Statement - { - return $this->getCreator(); - } - - - /** - * @param string|array|Definition|Reference|Statement $factory - * @return static - */ - public function setCreator($factory, array $args = []) - { - $this->factory = $factory instanceof Statement - ? $factory - : new Statement($factory, $args); - return $this; - } - - - public function getCreator(): Statement - { - return $this->factory; - } - - - /** @return string|array|Definition|Reference|null */ - public function getEntity() - { - return $this->factory->getEntity(); - } - - - /** @return static */ - public function setArguments(array $args = []) - { - $this->factory->arguments = $args; - return $this; - } - - - /** @return static */ - public function setArgument($key, $value) - { - $this->factory->arguments[$key] = $value; - return $this; - } - - - /** - * @param Statement[] $setup - * @return static - */ - public function setSetup(array $setup) - { - foreach ($setup as $v) { - if (!$v instanceof Statement) { - throw new Nette\InvalidArgumentException('Argument must be Nette\DI\Definitions\Statement[].'); - } - } - - $this->setup = $setup; - return $this; - } - - - /** @return Statement[] */ - public function getSetup(): array - { - return $this->setup; - } - - - /** - * @param string|array|Definition|Reference|Statement $entity - * @return static - */ - public function addSetup($entity, array $args = []) - { - $this->setup[] = $entity instanceof Statement - ? $entity - : new Statement($entity, $args); - return $this; - } - - - /** @deprecated */ - public function setParameters(array $params) - { - throw new Nette\DeprecatedException(sprintf('Service %s: %s() is deprecated.', $this->getName(), __METHOD__)); - } - - - /** @deprecated */ - public function getParameters(): array - { - trigger_error(sprintf('Service %s: %s() is deprecated.', $this->getName(), __METHOD__), E_USER_DEPRECATED); - return []; - } - - - /** @deprecated use $builder->addImportedDefinition(...) */ - public function setDynamic(): void - { - throw new Nette\DeprecatedException(sprintf('Service %s: %s() is deprecated, use $builder->addImportedDefinition(...)', $this->getName(), __METHOD__)); - } - - - /** @deprecated use $builder->addFactoryDefinition(...) or addAccessorDefinition(...) */ - public function setImplement(): void - { - throw new Nette\DeprecatedException(sprintf('Service %s: %s() is deprecated, use $builder->addFactoryDefinition(...)', $this->getName(), __METHOD__)); - } - - - /** @deprecated use addTag('nette.inject') */ - public function setInject(bool $state = true) - { - trigger_error(sprintf('Service %s: %s() is deprecated, use addTag(Nette\DI\Extensions\InjectExtension::TAG_INJECT)', $this->getName(), __METHOD__), E_USER_DEPRECATED); - return $this->addTag(Nette\DI\Extensions\InjectExtension::TAG_INJECT, $state); - } - - - public function resolveType(Nette\DI\Resolver $resolver): void - { - if (!$this->getEntity()) { - if (!$this->getType()) { - throw new ServiceCreationException('Factory and type are missing in definition of service.'); - } - - $this->setFactory($this->getType(), $this->factory->arguments ?? []); - - } elseif (!$this->getType()) { - $type = $resolver->resolveEntityType($this->factory); - if (!$type) { - throw new ServiceCreationException('Unknown service type, specify it or declare return type of factory method.'); - } - - $this->setType($type); - $resolver->addDependency(new \ReflectionClass($type)); - } - - // auto-disable autowiring for aliases - if ($this->getAutowired() === true && $this->getEntity() instanceof Reference) { - $this->setAutowired(false); - } - } - - - public function complete(Nette\DI\Resolver $resolver): void - { - $entity = $this->factory->getEntity(); - if ($entity instanceof Reference && !$this->factory->arguments && !$this->setup) { - $ref = $resolver->normalizeReference($entity); - $this->setFactory([new Reference(Nette\DI\ContainerBuilder::THIS_CONTAINER), 'getService'], [$ref->getValue()]); - } - - $this->factory = $resolver->completeStatement($this->factory); - - foreach ($this->setup as &$setup) { - if ( - is_string($setup->getEntity()) - && strpbrk($setup->getEntity(), ':@?\\') === false - ) { // auto-prepend @self - $setup = new Statement([new Reference(Reference::SELF), $setup->getEntity()], $setup->arguments); - } - - $setup = $resolver->completeStatement($setup, true); - } - } - - - public function generateMethod(Nette\PhpGenerator\Method $method, Nette\DI\PhpGenerator $generator): void - { - $entity = $this->factory->getEntity(); - $code = $generator->formatStatement($this->factory) . ";\n"; - if (!$this->setup) { - $method->setBody('return ' . $code); - return; - } - - $code = '$service = ' . $code; - foreach ($this->setup as $setup) { - $code .= $generator->formatStatement($setup) . ";\n"; - } - - $code .= 'return $service;'; - $method->setBody($code); - } - - - public function __clone() - { - parent::__clone(); - $this->factory = unserialize(serialize($this->factory)); - $this->setup = unserialize(serialize($this->setup)); - } -} - - -class_exists(Nette\DI\ServiceDefinition::class); diff --git a/vendor/nette/di/src/DI/Definitions/Statement.php b/vendor/nette/di/src/DI/Definitions/Statement.php deleted file mode 100644 index 47231c0..0000000 --- a/vendor/nette/di/src/DI/Definitions/Statement.php +++ /dev/null @@ -1,76 +0,0 @@ -entity = $entity; - $this->arguments = $arguments; - } - - - /** @return string|array|Definition|Reference|null */ - public function getEntity() - { - return $this->entity; - } -} - - -class_exists(Nette\DI\Statement::class); diff --git a/vendor/nette/di/src/DI/DependencyChecker.php b/vendor/nette/di/src/DI/DependencyChecker.php deleted file mode 100644 index 663543d..0000000 --- a/vendor/nette/di/src/DI/DependencyChecker.php +++ /dev/null @@ -1,187 +0,0 @@ -dependencies = array_merge($this->dependencies, $deps); - return $this; - } - - - /** - * Exports dependencies. - */ - public function export(): array - { - $files = $phpFiles = $classes = $functions = []; - foreach ($this->dependencies as $dep) { - if (is_string($dep)) { - $files[] = $dep; - - } elseif ($dep instanceof ReflectionClass) { - if (empty($classes[$name = $dep->name])) { - $all = [$name] + class_parents($name) + class_implements($name); - foreach ($all as &$item) { - $all += class_uses($item); - $phpFiles[] = (new ReflectionClass($item))->getFileName(); - $classes[$item] = true; - } - } - } elseif ($dep instanceof \ReflectionFunctionAbstract) { - $phpFiles[] = $dep->getFileName(); - $functions[] = rtrim(Reflection::toString($dep), '()'); - - } else { - throw new Nette\InvalidStateException(sprintf('Unexpected dependency %s', gettype($dep))); - } - } - - $classes = array_keys($classes); - $functions = array_unique($functions, SORT_REGULAR); - $hash = self::calculateHash($classes, $functions); - $files = @array_map('filemtime', array_combine($files, $files)); // @ - file may not exist - $phpFiles = @array_map('filemtime', array_combine($phpFiles, $phpFiles)); // @ - file may not exist - return [self::VERSION, $files, $phpFiles, $classes, $functions, $hash]; - } - - - /** - * Are dependencies expired? - */ - public static function isExpired( - int $version, - array $files, - array &$phpFiles, - array $classes, - array $functions, - string $hash - ): bool { - try { - $currentFiles = @array_map('filemtime', array_combine($tmp = array_keys($files), $tmp)); // @ - files may not exist - $origPhpFiles = $phpFiles; - $phpFiles = @array_map('filemtime', array_combine($tmp = array_keys($phpFiles), $tmp)); // @ - files may not exist - return $version !== self::VERSION - || $files !== $currentFiles - || ($phpFiles !== $origPhpFiles && $hash !== self::calculateHash($classes, $functions)); - } catch (\ReflectionException $e) { - return true; - } - } - - - private static function calculateHash(array $classes, array $functions): string - { - $hash = []; - foreach ($classes as $name) { - $class = new ReflectionClass($name); - $hash[] = [ - $name, - Reflection::getUseStatements($class), - $class->isAbstract(), - get_parent_class($name), - class_implements($name), - class_uses($name), - ]; - - foreach ($class->getProperties(\ReflectionProperty::IS_PUBLIC) as $prop) { - if ($prop->getDeclaringClass() == $class) { // intentionally == - $hash[] = [ - $name, - $prop->name, - $prop->getDocComment(), - (string) Type::fromReflection($prop), - PHP_VERSION_ID >= 80000 ? count($prop->getAttributes(Attributes\Inject::class)) : null, - ]; - } - } - - foreach ($class->getMethods(ReflectionMethod::IS_PUBLIC) as $method) { - if ($method->getDeclaringClass() == $class) { // intentionally == - $hash[] = [ - $name, - $method->name, - $method->getDocComment(), - self::hashParameters($method), - (string) Type::fromReflection($method), - ]; - } - } - } - - $flip = array_flip($classes); - foreach ($functions as $name) { - if (strpos($name, '::')) { - $method = new ReflectionMethod($name); - $class = $method->getDeclaringClass(); - if (isset($flip[$class->name])) { - continue; - } - - $uses = Reflection::getUseStatements($class); - } else { - $method = new \ReflectionFunction($name); - $uses = null; - } - - $hash[] = [ - $name, - $uses, - $method->getDocComment(), - self::hashParameters($method), - (string) Type::fromReflection($method), - ]; - } - - return md5(serialize($hash)); - } - - - private static function hashParameters(\ReflectionFunctionAbstract $method): array - { - $res = []; - foreach ($method->getParameters() as $param) { - $res[] = [ - $param->name, - (string) Type::fromReflection($param), - $param->isVariadic(), - $param->isDefaultValueAvailable() - ? is_object($tmp = Reflection::getParameterDefaultValue($param)) ? ['object' => get_class($tmp)] : ['value' => $tmp] - : null, - ]; - } - - return $res; - } -} diff --git a/vendor/nette/di/src/DI/DynamicParameter.php b/vendor/nette/di/src/DI/DynamicParameter.php deleted file mode 100644 index 6825765..0000000 --- a/vendor/nette/di/src/DI/DynamicParameter.php +++ /dev/null @@ -1,20 +0,0 @@ -getConfig() as $name => $value) { - $this->initialization->addBody('define(?, ?);', [$name, $value]); - } - } -} diff --git a/vendor/nette/di/src/DI/Extensions/DIExtension.php b/vendor/nette/di/src/DI/Extensions/DIExtension.php deleted file mode 100644 index b96f6cf..0000000 --- a/vendor/nette/di/src/DI/Extensions/DIExtension.php +++ /dev/null @@ -1,143 +0,0 @@ -debugMode = $debugMode; - $this->time = microtime(true); - - $this->config = new class { - /** @var ?bool */ - public $debugger; - - /** @var string[] */ - public $excluded = []; - - /** @var ?string */ - public $parentClass; - - /** @var object */ - public $export; - }; - $this->config->export = new class { - /** @var bool */ - public $parameters = true; - - /** @var string[]|bool|null */ - public $tags = true; - - /** @var string[]|bool|null */ - public $types = true; - }; - } - - - public function loadConfiguration() - { - $builder = $this->getContainerBuilder(); - $builder->addExcludedClasses($this->config->excluded); - } - - - public function beforeCompile() - { - if (!$this->config->export->parameters) { - $this->getContainerBuilder()->parameters = []; - } - } - - - public function afterCompile(Nette\PhpGenerator\ClassType $class) - { - if ($this->config->parentClass) { - $class->setExtends($this->config->parentClass); - } - - $this->restrictTags($class); - $this->restrictTypes($class); - - if ( - $this->debugMode && - ($this->config->debugger ?? $this->getContainerBuilder()->getByType(Tracy\Bar::class)) - ) { - $this->enableTracyIntegration(); - } - - $this->initializeTaggedServices(); - } - - - private function restrictTags(Nette\PhpGenerator\ClassType $class): void - { - $option = $this->config->export->tags; - if ($option === true) { - } elseif ($option === false) { - $class->removeProperty('tags'); - } elseif ($prop = $class->getProperties()['tags'] ?? null) { - $prop->setValue(array_intersect_key($prop->getValue(), $this->exportedTags + array_flip((array) $option))); - } - } - - - private function restrictTypes(Nette\PhpGenerator\ClassType $class): void - { - $option = $this->config->export->types; - if ($option === true) { - return; - } - - $prop = $class->getProperty('wiring'); - $prop->setValue(array_intersect_key( - $prop->getValue(), - $this->exportedTypes + (is_array($option) ? array_flip($option) : []) - )); - } - - - private function initializeTaggedServices(): void - { - foreach (array_filter($this->getContainerBuilder()->findByTag('run')) as $name => $on) { - trigger_error("Tag 'run' used in service '$name' definition is deprecated.", E_USER_DEPRECATED); - $this->initialization->addBody('$this->getService(?);', [$name]); - } - } - - - private function enableTracyIntegration(): void - { - Nette\Bridges\DITracy\ContainerPanel::$compilationTime = $this->time; - $this->initialization->addBody($this->getContainerBuilder()->formatPhp('?;', [ - new Nette\DI\Definitions\Statement('@Tracy\Bar::addPanel', [new Nette\DI\Definitions\Statement(Nette\Bridges\DITracy\ContainerPanel::class)]), - ])); - } -} diff --git a/vendor/nette/di/src/DI/Extensions/DecoratorExtension.php b/vendor/nette/di/src/DI/Extensions/DecoratorExtension.php deleted file mode 100644 index b570c3f..0000000 --- a/vendor/nette/di/src/DI/Extensions/DecoratorExtension.php +++ /dev/null @@ -1,85 +0,0 @@ - Expect::list(), - 'tags' => Expect::array(), - 'inject' => Expect::bool(), - ]) - ); - } - - - public function beforeCompile() - { - $this->getContainerBuilder()->resolve(); - foreach ($this->config as $type => $info) { - if (!class_exists($type) && !interface_exists($type)) { - throw new Nette\DI\InvalidConfigurationException(sprintf("Decorated class '%s' not found.", $type)); - } - - if ($info->inject !== null) { - $info->tags[InjectExtension::TAG_INJECT] = $info->inject; - } - - $this->addSetups($type, Nette\DI\Helpers::filterArguments($info->setup)); - $this->addTags($type, Nette\DI\Helpers::filterArguments($info->tags)); - } - } - - - public function addSetups(string $type, array $setups): void - { - foreach ($this->findByType($type) as $def) { - if ($def instanceof Definitions\FactoryDefinition) { - $def = $def->getResultDefinition(); - } - - foreach ($setups as $setup) { - if (is_array($setup)) { - $setup = new Definitions\Statement(key($setup), array_values($setup)); - } - - $def->addSetup($setup); - } - } - } - - - public function addTags(string $type, array $tags): void - { - $tags = Nette\Utils\Arrays::normalize($tags, true); - foreach ($this->findByType($type) as $def) { - $def->setTags($def->getTags() + $tags); - } - } - - - private function findByType(string $type): array - { - return array_filter($this->getContainerBuilder()->getDefinitions(), function (Definitions\Definition $def) use ($type): bool { - return is_a($def->getType(), $type, true) - || ($def instanceof Definitions\FactoryDefinition && is_a($def->getResultType(), $type, true)); - }); - } -} diff --git a/vendor/nette/di/src/DI/Extensions/ExtensionsExtension.php b/vendor/nette/di/src/DI/Extensions/ExtensionsExtension.php deleted file mode 100644 index a444560..0000000 --- a/vendor/nette/di/src/DI/Extensions/ExtensionsExtension.php +++ /dev/null @@ -1,48 +0,0 @@ -getConfig() as $name => $class) { - if (is_int($name)) { - $name = null; - } - - $args = []; - if ($class instanceof Nette\DI\Definitions\Statement) { - [$class, $args] = [$class->getEntity(), $class->arguments]; - } - - if (!is_a($class, Nette\DI\CompilerExtension::class, true)) { - throw new Nette\DI\InvalidConfigurationException(sprintf( - "Extension '%s' not found or is not Nette\\DI\\CompilerExtension descendant.", - $class - )); - } - - $this->compiler->addExtension($name, (new \ReflectionClass($class))->newInstanceArgs($args)); - } - } -} diff --git a/vendor/nette/di/src/DI/Extensions/InjectExtension.php b/vendor/nette/di/src/DI/Extensions/InjectExtension.php deleted file mode 100644 index 4b82731..0000000 --- a/vendor/nette/di/src/DI/Extensions/InjectExtension.php +++ /dev/null @@ -1,161 +0,0 @@ -getContainerBuilder()->getDefinitions() as $def) { - if ($def->getTag(self::TAG_INJECT)) { - $def = $def instanceof Definitions\FactoryDefinition - ? $def->getResultDefinition() - : $def; - if ($def instanceof Definitions\ServiceDefinition) { - $this->updateDefinition($def); - } - } - } - } - - - private function updateDefinition(Definitions\ServiceDefinition $def): void - { - $resolvedType = (new DI\Resolver($this->getContainerBuilder()))->resolveEntityType($def->getFactory()); - $class = is_subclass_of($resolvedType, $def->getType()) - ? $resolvedType - : $def->getType(); - $setups = $def->getSetup(); - - foreach (self::getInjectProperties($class) as $property => $type) { - $builder = $this->getContainerBuilder(); - $inject = new Definitions\Statement('$' . $property, [Definitions\Reference::fromType((string) $type)]); - foreach ($setups as $key => $setup) { - if ($setup->getEntity() === $inject->getEntity()) { - $inject = $setup; - $builder = null; - unset($setups[$key]); - } - } - - array_unshift($setups, $inject); - } - - foreach (array_reverse(self::getInjectMethods($class)) as $method) { - $inject = new Definitions\Statement($method); - foreach ($setups as $key => $setup) { - if ($setup->getEntity() === $inject->getEntity()) { - $inject = $setup; - unset($setups[$key]); - } - } - - array_unshift($setups, $inject); - } - - $def->setSetup($setups); - } - - - /** - * Generates list of inject methods. - * @internal - */ - public static function getInjectMethods(string $class): array - { - $classes = []; - foreach (get_class_methods($class) as $name) { - if (substr($name, 0, 6) === 'inject') { - $classes[$name] = (new \ReflectionMethod($class, $name))->getDeclaringClass()->name; - } - } - - $methods = array_keys($classes); - uksort($classes, function (string $a, string $b) use ($classes, $methods): int { - return $classes[$a] === $classes[$b] - ? array_search($a, $methods, true) <=> array_search($b, $methods, true) - : (is_a($classes[$a], $classes[$b], true) ? 1 : -1); - }); - return array_keys($classes); - } - - - /** - * Generates list of properties with annotation @inject. - * @internal - */ - public static function getInjectProperties(string $class): array - { - $res = []; - foreach ((new \ReflectionClass($class))->getProperties() as $rp) { - $name = $rp->getName(); - $hasAttr = PHP_VERSION_ID >= 80000 && $rp->getAttributes(DI\Attributes\Inject::class); - if ($hasAttr || DI\Helpers::parseAnnotation($rp, 'inject') !== null) { - if (!$rp->isPublic() || $rp->isStatic()) { - trigger_error(sprintf('Property %s for injection must be public and non-static.', Reflection::toString($rp)), E_USER_WARNING); - continue; - } - - if (PHP_VERSION_ID >= 80100 && $rp->isReadOnly()) { - throw new Nette\InvalidStateException(sprintf('Property %s for injection must not be readonly.', Reflection::toString($rp))); - } - - $type = Nette\Utils\Type::fromReflection($rp); - if (!$type && !$hasAttr && ($annotation = DI\Helpers::parseAnnotation($rp, 'var'))) { - $annotation = Reflection::expandClassName($annotation, Reflection::getPropertyDeclaringClass($rp)); - $type = Nette\Utils\Type::fromString($annotation); - } - - $res[$rp->getName()] = DI\Helpers::ensureClassType($type, 'type of property ' . Reflection::toString($rp)); - } - } - - ksort($res); - return $res; - } - - - /** - * Calls all methods starting with with "inject" using autowiring. - * @param object $service - */ - public static function callInjects(DI\Container $container, $service): void - { - if (!is_object($service)) { - throw new Nette\InvalidArgumentException(sprintf('Service must be object, %s given.', gettype($service))); - } - - foreach (self::getInjectMethods(get_class($service)) as $method) { - $container->callMethod([$service, $method]); - } - - foreach (self::getInjectProperties(get_class($service)) as $property => $type) { - $service->$property = $container->getByType($type); - } - } -} diff --git a/vendor/nette/di/src/DI/Extensions/ParametersExtension.php b/vendor/nette/di/src/DI/Extensions/ParametersExtension.php deleted file mode 100644 index b97dfa4..0000000 --- a/vendor/nette/di/src/DI/Extensions/ParametersExtension.php +++ /dev/null @@ -1,78 +0,0 @@ -compilerConfig = &$compilerConfig; - } - - - public function loadConfiguration() - { - $builder = $this->getContainerBuilder(); - $params = $this->config; - $resolver = new Nette\DI\Resolver($builder); - $generator = new Nette\DI\PhpGenerator($builder); - - foreach ($this->dynamicParams as $key) { - $params[$key] = array_key_exists($key, $params) - ? new DynamicParameter($generator->formatPhp('($this->parameters[?] \?\? ?)', $resolver->completeArguments(Nette\DI\Helpers::filterArguments([$key, $params[$key]])))) - : new DynamicParameter((new Nette\PhpGenerator\Dumper)->format('$this->parameters[?]', $key)); - } - - $builder->parameters = Nette\DI\Helpers::expand($params, $params, true); - - // expand all except 'services' - $slice = array_diff_key($this->compilerConfig, ['services' => 1]); - $slice = Nette\DI\Helpers::expand($slice, $builder->parameters); - $this->compilerConfig = $slice + $this->compilerConfig; - } - - - public function afterCompile(Nette\PhpGenerator\ClassType $class) - { - $parameters = $this->getContainerBuilder()->parameters; - array_walk_recursive($parameters, function (&$val): void { - if ($val instanceof Nette\DI\Definitions\Statement || $val instanceof DynamicParameter) { - $val = null; - } - }); - - $cnstr = $class->getMethod('__construct'); - $cnstr->addBody('$this->parameters += ?;', [$parameters]); - foreach ($this->dynamicValidators as [$param, $expected]) { - if ($param instanceof Nette\DI\Definitions\Statement) { - continue; - } - - $cnstr->addBody('Nette\Utils\Validators::assert(?, ?, ?);', [$param, $expected, 'dynamic parameter']); - } - } -} diff --git a/vendor/nette/di/src/DI/Extensions/PhpExtension.php b/vendor/nette/di/src/DI/Extensions/PhpExtension.php deleted file mode 100644 index 6a469e3..0000000 --- a/vendor/nette/di/src/DI/Extensions/PhpExtension.php +++ /dev/null @@ -1,52 +0,0 @@ -getConfig() as $name => $value) { - if ($value === null) { - continue; - - } elseif ($name === 'include_path') { - $this->initialization->addBody('set_include_path(?);', [str_replace(';', PATH_SEPARATOR, $value)]); - - } elseif ($name === 'ignore_user_abort') { - $this->initialization->addBody('ignore_user_abort(?);', [$value]); - - } elseif ($name === 'max_execution_time') { - $this->initialization->addBody('set_time_limit(?);', [$value]); - - } elseif ($name === 'date.timezone') { - $this->initialization->addBody('date_default_timezone_set(?);', [$value]); - - } elseif (function_exists('ini_set')) { - $this->initialization->addBody('ini_set(?, ?);', [$name, $value === false ? '0' : (string) $value]); - - } elseif (ini_get($name) !== (string) $value) { - throw new Nette\NotSupportedException('Required function ini_set() is disabled.'); - } - } - } -} diff --git a/vendor/nette/di/src/DI/Extensions/SearchExtension.php b/vendor/nette/di/src/DI/Extensions/SearchExtension.php deleted file mode 100644 index 34b6dae..0000000 --- a/vendor/nette/di/src/DI/Extensions/SearchExtension.php +++ /dev/null @@ -1,158 +0,0 @@ -tempDir = $tempDir; - } - - - public function getConfigSchema(): Nette\Schema\Schema - { - return Expect::arrayOf( - Expect::structure([ - 'in' => Expect::string()->required(), - 'files' => Expect::anyOf(Expect::listOf('string'), Expect::string()->castTo('array'))->default([]), - 'classes' => Expect::anyOf(Expect::listOf('string'), Expect::string()->castTo('array'))->default([]), - 'extends' => Expect::anyOf(Expect::listOf('string'), Expect::string()->castTo('array'))->default([]), - 'implements' => Expect::anyOf(Expect::listOf('string'), Expect::string()->castTo('array'))->default([]), - 'exclude' => Expect::structure([ - 'classes' => Expect::anyOf(Expect::listOf('string'), Expect::string()->castTo('array'))->default([]), - 'extends' => Expect::anyOf(Expect::listOf('string'), Expect::string()->castTo('array'))->default([]), - 'implements' => Expect::anyOf(Expect::listOf('string'), Expect::string()->castTo('array'))->default([]), - ]), - 'tags' => Expect::array(), - ]) - )->before(function ($val) { - return is_string($val['in'] ?? null) - ? ['default' => $val] - : $val; - }); - } - - - public function loadConfiguration() - { - foreach (array_filter($this->config) as $name => $batch) { - if (!is_dir($batch->in)) { - throw new Nette\DI\InvalidConfigurationException(sprintf( - "Option '%s\u{a0}›\u{a0}%s\u{a0}›\u{a0}in' must be valid directory name, '%s' given.", - $this->name, - $name, - $batch->in - )); - } - - foreach ($this->findClasses($batch) as $class) { - $this->classes[$class] = array_merge($this->classes[$class] ?? [], $batch->tags); - } - } - } - - - public function findClasses(\stdClass $config): array - { - $robot = new RobotLoader; - $robot->setTempDirectory($this->tempDir); - $robot->addDirectory($config->in); - $robot->acceptFiles = $config->files ?: ['*.php']; - $robot->reportParseErrors(false); - $robot->refresh(); - $classes = array_unique(array_keys($robot->getIndexedClasses())); - - $exclude = $config->exclude; - $acceptRE = self::buildNameRegexp($config->classes); - $rejectRE = self::buildNameRegexp($exclude->classes); - $acceptParent = array_merge($config->extends, $config->implements); - $rejectParent = array_merge($exclude->extends, $exclude->implements); - - $found = []; - foreach ($classes as $class) { - if (!class_exists($class) && !interface_exists($class) && !trait_exists($class)) { - throw new Nette\InvalidStateException(sprintf( - 'Class %s was found, but it cannot be loaded by autoloading.', - $class - )); - } - - $rc = new \ReflectionClass($class); - if ( - ($rc->isInstantiable() - || - ($rc->isInterface() - && count($methods = $rc->getMethods()) === 1 - && $methods[0]->name === 'create') - ) - && (!$acceptRE || preg_match($acceptRE, $rc->name)) - && (!$rejectRE || !preg_match($rejectRE, $rc->name)) - && (!$acceptParent || Arrays::some($acceptParent, function ($nm) use ($rc) { return $rc->isSubclassOf($nm); })) - && (!$rejectParent || Arrays::every($rejectParent, function ($nm) use ($rc) { return !$rc->isSubclassOf($nm); })) - ) { - $found[] = $rc->name; - } - } - - return $found; - } - - - public function beforeCompile() - { - $builder = $this->getContainerBuilder(); - - foreach ($this->classes as $class => $foo) { - if ($builder->findByType($class)) { - unset($this->classes[$class]); - } - } - - foreach ($this->classes as $class => $tags) { - $def = class_exists($class) - ? $builder->addDefinition(null)->setType($class) - : $builder->addFactoryDefinition(null)->setImplement($class); - $def->setTags(Arrays::normalize($tags, true)); - } - } - - - private static function buildNameRegexp(array $masks): ?string - { - $res = []; - foreach ((array) $masks as $mask) { - $mask = (strpos($mask, '\\') === false ? '**\\' : '') . $mask; - $mask = preg_quote($mask, '#'); - $mask = str_replace('\*\*\\\\', '(.*\\\\)?', $mask); - $mask = str_replace('\\\\\*\*', '(\\\\.*)?', $mask); - $mask = str_replace('\*', '\w*', $mask); - $res[] = $mask; - } - - return $res ? '#^(' . implode('|', $res) . ')$#i' : null; - } -} diff --git a/vendor/nette/di/src/DI/Extensions/ServicesExtension.php b/vendor/nette/di/src/DI/Extensions/ServicesExtension.php deleted file mode 100644 index 02e83f1..0000000 --- a/vendor/nette/di/src/DI/Extensions/ServicesExtension.php +++ /dev/null @@ -1,252 +0,0 @@ -getContainerBuilder())); - } - - - public function loadConfiguration() - { - $this->loadDefinitions($this->config); - } - - - /** - * Loads list of service definitions. - */ - public function loadDefinitions(array $config) - { - foreach ($config as $key => $defConfig) { - $this->loadDefinition($this->convertKeyToName($key), $defConfig); - } - } - - - /** - * Loads service definition from normalized configuration. - */ - private function loadDefinition(?string $name, \stdClass $config): void - { - try { - if ((array) $config === [false]) { - $this->getContainerBuilder()->removeDefinition($name); - return; - } elseif (!empty($config->alteration) && !$this->getContainerBuilder()->hasDefinition($name)) { - throw new Nette\DI\InvalidConfigurationException('missing original definition for alteration.'); - } - - $def = $this->retrieveDefinition($name, $config); - - static $methods = [ - Definitions\ServiceDefinition::class => 'updateServiceDefinition', - Definitions\AccessorDefinition::class => 'updateAccessorDefinition', - Definitions\FactoryDefinition::class => 'updateFactoryDefinition', - Definitions\LocatorDefinition::class => 'updateLocatorDefinition', - Definitions\ImportedDefinition::class => 'updateImportedDefinition', - ]; - $this->{$methods[$config->defType]}($def, $config); - $this->updateDefinition($def, $config); - } catch (\Throwable $e) { - throw new Nette\DI\InvalidConfigurationException(($name ? "Service '$name': " : '') . $e->getMessage(), 0, $e); - } - } - - - /** - * Updates service definition according to normalized configuration. - */ - private function updateServiceDefinition(Definitions\ServiceDefinition $definition, \stdClass $config): void - { - if ($config->factory) { - $definition->setFactory(Helpers::filterArguments([$config->factory])[0]); - $definition->setType(null); - } - - if ($config->type) { - $definition->setType($config->type); - } - - if ($config->arguments) { - $arguments = Helpers::filterArguments($config->arguments); - if (empty($config->reset['arguments']) && !Nette\Utils\Arrays::isList($arguments)) { - $arguments = array_replace($definition->getFactory()->arguments, $arguments); - } - - $definition->setArguments($arguments); - } - - if (isset($config->setup)) { - if (!empty($config->reset['setup'])) { - $definition->setSetup([]); - } - - foreach (Helpers::filterArguments($config->setup) as $id => $setup) { - if (is_array($setup)) { - $setup = new Statement(key($setup), array_values($setup)); - } - - $definition->addSetup($setup); - } - } - - if (isset($config->inject)) { - $definition->addTag(InjectExtension::TAG_INJECT, $config->inject); - } - } - - - private function updateAccessorDefinition(Definitions\AccessorDefinition $definition, \stdClass $config): void - { - if (isset($config->implement)) { - $definition->setImplement($config->implement); - } - - if ($ref = $config->factory ?? $config->type ?? null) { - $definition->setReference($ref); - } - } - - - private function updateFactoryDefinition(Definitions\FactoryDefinition $definition, \stdClass $config): void - { - $resultDef = $definition->getResultDefinition(); - - if (isset($config->implement)) { - $definition->setImplement($config->implement); - $definition->setAutowired(true); - } - - if ($config->factory) { - $resultDef->setFactory(Helpers::filterArguments([$config->factory])[0]); - } - - if ($config->type) { - $resultDef->setFactory($config->type); - } - - if ($config->arguments) { - $arguments = Helpers::filterArguments($config->arguments); - if (empty($config->reset['arguments']) && !Nette\Utils\Arrays::isList($arguments)) { - $arguments = array_replace($resultDef->getFactory()->arguments, $arguments); - } - - $resultDef->setArguments($arguments); - } - - if (isset($config->setup)) { - if (!empty($config->reset['setup'])) { - $resultDef->setSetup([]); - } - - foreach (Helpers::filterArguments($config->setup) as $id => $setup) { - if (is_array($setup)) { - $setup = new Statement(key($setup), array_values($setup)); - } - - $resultDef->addSetup($setup); - } - } - - if (isset($config->parameters)) { - $definition->setParameters($config->parameters); - } - - if (isset($config->inject)) { - $definition->addTag(InjectExtension::TAG_INJECT, $config->inject); - } - } - - - private function updateLocatorDefinition(Definitions\LocatorDefinition $definition, \stdClass $config): void - { - if (isset($config->implement)) { - $definition->setImplement($config->implement); - } - - if (isset($config->references)) { - $definition->setReferences($config->references); - } - - if (isset($config->tagged)) { - $definition->setTagged($config->tagged); - } - } - - - private function updateImportedDefinition(Definitions\ImportedDefinition $definition, \stdClass $config): void - { - if ($config->type) { - $definition->setType($config->type); - } - } - - - private function updateDefinition(Definitions\Definition $definition, \stdClass $config): void - { - if (isset($config->autowired)) { - $definition->setAutowired($config->autowired); - } - - if (isset($config->tags)) { - if (!empty($config->reset['tags'])) { - $definition->setTags([]); - } - - foreach ($config->tags as $tag => $attrs) { - if (is_int($tag) && is_string($attrs)) { - $definition->addTag($attrs); - } else { - $definition->addTag($tag, $attrs); - } - } - } - } - - - private function convertKeyToName($key): ?string - { - if (is_int($key)) { - return null; - } elseif (preg_match('#^@[\w\\\\]+$#D', $key)) { - return $this->getContainerBuilder()->getByType(substr($key, 1), true); - } - - return $key; - } - - - private function retrieveDefinition(?string $name, \stdClass $config): Definitions\Definition - { - $builder = $this->getContainerBuilder(); - if (!empty($config->reset['all'])) { - $builder->removeDefinition($name); - } - - return $name && $builder->hasDefinition($name) - ? $builder->getDefinition($name) - : $builder->addDefinition($name, new $config->defType); - } -} diff --git a/vendor/nette/di/src/DI/Helpers.php b/vendor/nette/di/src/DI/Helpers.php deleted file mode 100644 index 35d0328..0000000 --- a/vendor/nette/di/src/DI/Helpers.php +++ /dev/null @@ -1,285 +0,0 @@ - $val) { - $res[self::expand($key, $params, $recursive)] = self::expand($val, $params, $recursive); - } - - return $res; - - } elseif ($var instanceof Statement) { - return new Statement(self::expand($var->getEntity(), $params, $recursive), self::expand($var->arguments, $params, $recursive)); - - } elseif ($var === '%parameters%' && !array_key_exists('parameters', $params)) { - return $recursive - ? self::expand($params, $params, (is_array($recursive) ? $recursive : [])) - : $params; - - } elseif (!is_string($var)) { - return $var; - } - - $parts = preg_split('#%([\w.-]*)%#i', $var, -1, PREG_SPLIT_DELIM_CAPTURE); - $res = []; - $php = false; - foreach ($parts as $n => $part) { - if ($n % 2 === 0) { - $res[] = $part; - - } elseif ($part === '') { - $res[] = '%'; - - } elseif (isset($recursive[$part])) { - throw new Nette\InvalidArgumentException(sprintf( - 'Circular reference detected for variables: %s.', - implode(', ', array_keys($recursive)) - )); - - } else { - $val = $params; - foreach (explode('.', $part) as $key) { - if (is_array($val) && array_key_exists($key, $val)) { - $val = $val[$key]; - } elseif ($val instanceof DynamicParameter) { - $val = new DynamicParameter($val . '[' . var_export($key, true) . ']'); - } else { - throw new Nette\InvalidArgumentException(sprintf("Missing parameter '%s'.", $part)); - } - } - - if ($recursive) { - $val = self::expand($val, $params, (is_array($recursive) ? $recursive : []) + [$part => 1]); - } - - if (strlen($part) + 2 === strlen($var)) { - return $val; - } - - if ($val instanceof DynamicParameter) { - $php = true; - } elseif (!is_scalar($val)) { - throw new Nette\InvalidArgumentException(sprintf("Unable to concatenate non-scalar parameter '%s' into '%s'.", $part, $var)); - } - - $res[] = $val; - } - } - - if ($php) { - $res = array_filter($res, function ($val): bool { return $val !== ''; }); - $res = array_map(function ($val): string { - return $val instanceof DynamicParameter - ? "($val)" - : var_export((string) $val, true); - }, $res); - return new DynamicParameter(implode(' . ', $res)); - } - - return implode('', $res); - } - - - /** - * Escapes '%' and '@' - * @param mixed $value - * @return mixed - */ - public static function escape($value) - { - if (is_array($value)) { - $res = []; - foreach ($value as $key => $val) { - $key = is_string($key) ? str_replace('%', '%%', $key) : $key; - $res[$key] = self::escape($val); - } - - return $res; - } elseif (is_string($value)) { - return preg_replace('#^@|%#', '$0$0', $value); - } - - return $value; - } - - - /** - * Removes ... and process constants recursively. - */ - public static function filterArguments(array $args): array - { - foreach ($args as $k => $v) { - if ($v === '...') { - unset($args[$k]); - } elseif ( - PHP_VERSION_ID >= 80100 - && is_string($v) - && preg_match('#^([\w\\\\]+)::\w+$#D', $v, $m) - && enum_exists($m[1]) - ) { - $args[$k] = new Nette\PhpGenerator\PhpLiteral($v); - } elseif (is_string($v) && preg_match('#^[\w\\\\]*::[A-Z][A-Z0-9_]*$#D', $v)) { - $args[$k] = constant(ltrim($v, ':')); - } elseif (is_string($v) && preg_match('#^@[\w\\\\]+$#D', $v)) { - $args[$k] = new Reference(substr($v, 1)); - } elseif (is_array($v)) { - $args[$k] = self::filterArguments($v); - } elseif ($v instanceof Statement) { - [$tmp] = self::filterArguments([$v->getEntity()]); - $args[$k] = new Statement($tmp, self::filterArguments($v->arguments)); - } - } - - return $args; - } - - - /** - * Replaces @extension with real extension name in service definition. - * @param mixed $config - * @return mixed - */ - public static function prefixServiceName($config, string $namespace) - { - if (is_string($config)) { - if (strncmp($config, '@extension.', 10) === 0) { - $config = '@' . $namespace . '.' . substr($config, 11); - } - } elseif ($config instanceof Reference) { - if (strncmp($config->getValue(), 'extension.', 9) === 0) { - $config = new Reference($namespace . '.' . substr($config->getValue(), 10)); - } - } elseif ($config instanceof Statement) { - return new Statement( - self::prefixServiceName($config->getEntity(), $namespace), - self::prefixServiceName($config->arguments, $namespace) - ); - } elseif (is_array($config)) { - foreach ($config as &$val) { - $val = self::prefixServiceName($val, $namespace); - } - } - - return $config; - } - - - /** - * Returns an annotation value. - * @param \ReflectionFunctionAbstract|\ReflectionProperty|\ReflectionClass $ref - */ - public static function parseAnnotation(\Reflector $ref, string $name): ?string - { - if (!Reflection::areCommentsAvailable()) { - throw new Nette\InvalidStateException('You have to enable phpDoc comments in opcode cache.'); - } - - $re = '#[\s*]@' . preg_quote($name, '#') . '(?=\s|$)(?:[ \t]+([^@\s]\S*))?#'; - if ($ref->getDocComment() && preg_match($re, trim($ref->getDocComment(), '/*'), $m)) { - return $m[1] ?? ''; - } - - return null; - } - - - public static function getReturnTypeAnnotation(\ReflectionFunctionAbstract $func): ?Type - { - $type = preg_replace('#[|\s].*#', '', (string) self::parseAnnotation($func, 'return')); - if (!$type || $type === 'object' || $type === 'mixed') { - return null; - } elseif ($func instanceof \ReflectionMethod) { - $type = $type === '$this' ? 'static' : $type; - $type = Reflection::expandClassName($type, $func->getDeclaringClass()); - } - - return Type::fromString($type); - } - - - public static function ensureClassType(?Type $type, string $hint): string - { - if (!$type) { - throw new ServiceCreationException(sprintf('%s is not declared.', ucfirst($hint))); - } elseif (!$type->isClass() || $type->isUnion()) { - throw new ServiceCreationException(sprintf("%s is not expected to be nullable/union/intersection/built-in, '%s' given.", ucfirst($hint), $type)); - } - - $class = $type->getSingleName(); - if (!class_exists($class) && !interface_exists($class)) { - throw new ServiceCreationException(sprintf("Class '%s' not found.\nCheck the %s.", $class, $hint)); - } - - return $class; - } - - - public static function normalizeClass(string $type): string - { - return class_exists($type) || interface_exists($type) - ? (new \ReflectionClass($type))->name - : $type; - } - - - /** - * Non data-loss type conversion. - * @param mixed $value - * @return mixed - * @throws Nette\InvalidStateException - */ - public static function convertType($value, string $type) - { - if (is_scalar($value)) { - $norm = ($value === false ? '0' : (string) $value); - if ($type === 'float') { - $norm = preg_replace('#\.0*$#D', '', $norm); - } - - $orig = $norm; - settype($norm, $type); - if ($orig === ($norm === false ? '0' : (string) $norm)) { - return $norm; - } - } - - throw new Nette\InvalidStateException(sprintf( - 'Cannot convert %s to %s.', - is_scalar($value) ? "'$value'" : gettype($value), - $type - )); - } -} diff --git a/vendor/nette/di/src/DI/PhpGenerator.php b/vendor/nette/di/src/DI/PhpGenerator.php deleted file mode 100644 index c5bad24..0000000 --- a/vendor/nette/di/src/DI/PhpGenerator.php +++ /dev/null @@ -1,219 +0,0 @@ -builder = $builder; - } - - - /** - * Generates PHP classes. First class is the container. - */ - public function generate(string $className): Php\ClassType - { - $this->className = $className; - $class = new Php\ClassType($this->className); - $class->setExtends(Container::class); - $class->addMethod('__construct') - ->addBody('parent::__construct($params);') - ->addParameter('params', []) - ->setType('array'); - - foreach ($this->builder->exportMeta() as $key => $value) { - $class->addProperty($key) - ->setProtected() - ->setValue($value); - } - - $definitions = $this->builder->getDefinitions(); - ksort($definitions); - - foreach ($definitions as $def) { - $class->addMember($this->generateMethod($def)); - } - - $class->getMethod(Container::getMethodName(ContainerBuilder::THIS_CONTAINER)) - ->setReturnType($className) - ->setBody('return $this;'); - - $class->addMethod('initialize'); - - return $class; - } - - - public function toString(Php\ClassType $class): string - { - return '/** @noinspection PhpParamsInspection,PhpMethodMayBeStaticInspection */ - -declare(strict_types=1); - -' . $class->__toString(); - } - - - public function addInitialization(Php\ClassType $class, CompilerExtension $extension): void - { - $closure = $extension->getInitialization(); - if ($closure->getBody()) { - $class->getMethod('initialize') - ->addBody('// ' . $extension->prefix('')) - ->addBody("($closure)();"); - } - } - - - public function generateMethod(Definitions\Definition $def): Php\Method - { - $name = $def->getName(); - try { - $method = new Php\Method(Container::getMethodName($name)); - $method->setPublic(); - $method->setReturnType($def->getType()); - $def->generateMethod($method, $this); - return $method; - - } catch (\Throwable $e) { - throw new ServiceCreationException("Service '$name': " . $e->getMessage(), 0, $e); - } - } - - - /** - * Formats PHP code for class instantiating, function calling or property setting in PHP. - */ - public function formatStatement(Statement $statement): string - { - $entity = $statement->getEntity(); - $arguments = $statement->arguments; - - switch (true) { - case is_string($entity) && Strings::contains($entity, '?'): // PHP literal - return $this->formatPhp($entity, $arguments); - - case is_string($entity): // create class - return $arguments - ? $this->formatPhp("new $entity(...?:)", [$arguments]) - : $this->formatPhp("new $entity", []); - - case is_array($entity): - switch (true) { - case $entity[1][0] === '$': // property getter, setter or appender - $name = substr($entity[1], 1); - if ($append = (substr($name, -2) === '[]')) { - $name = substr($name, 0, -2); - } - - $prop = $entity[0] instanceof Reference - ? $this->formatPhp('?->?', [$entity[0], $name]) - : $this->formatPhp('?::$?', [$entity[0], $name]); - return $arguments - ? $this->formatPhp(($append ? '?[]' : '?') . ' = ?', [new Php\Literal($prop), $arguments[0]]) - : $prop; - - case $entity[0] instanceof Statement: - $inner = $this->formatPhp('?', [$entity[0]]); - if (substr($inner, 0, 4) === 'new ') { - $inner = "($inner)"; - } - - return $this->formatPhp('?->?(...?:)', [new Php\Literal($inner), $entity[1], $arguments]); - - case $entity[0] instanceof Reference: - return $this->formatPhp('?->?(...?:)', [$entity[0], $entity[1], $arguments]); - - case $entity[0] === '': // function call - return $this->formatPhp('?(...?:)', [new Php\Literal($entity[1]), $arguments]); - - case is_string($entity[0]): // static method call - return $this->formatPhp('?::?(...?:)', [new Php\Literal($entity[0]), $entity[1], $arguments]); - } - } - - throw new Nette\InvalidStateException; - } - - - /** - * Formats PHP statement. - * @internal - */ - public function formatPhp(string $statement, array $args): string - { - array_walk_recursive($args, function (&$val): void { - if ($val instanceof Statement) { - $val = new Php\Literal($this->formatStatement($val)); - - } elseif ($val instanceof Reference) { - $name = $val->getValue(); - if ($val->isSelf()) { - $val = new Php\Literal('$service'); - } elseif ($name === ContainerBuilder::THIS_CONTAINER) { - $val = new Php\Literal('$this'); - } else { - $val = ContainerBuilder::literal('$this->getService(?)', [$name]); - } - } - }); - return (new Php\Dumper)->format($statement, ...$args); - } - - - /** - * Converts parameters from Definition to PhpGenerator. - * @return Php\Parameter[] - */ - public function convertParameters(array $parameters): array - { - $res = []; - foreach ($parameters as $k => $v) { - $tmp = explode(' ', is_int($k) ? $v : $k); - $param = $res[] = new Php\Parameter(end($tmp)); - if (!is_int($k)) { - $param->setDefaultValue($v); - } - - if (isset($tmp[1])) { - $param->setType($tmp[0]); - } - } - - return $res; - } - - - public function getClassName(): ?string - { - return $this->className; - } -} diff --git a/vendor/nette/di/src/DI/Resolver.php b/vendor/nette/di/src/DI/Resolver.php deleted file mode 100644 index 56963ca..0000000 --- a/vendor/nette/di/src/DI/Resolver.php +++ /dev/null @@ -1,690 +0,0 @@ -builder = $builder; - $this->recursive = new \SplObjectStorage; - } - - - public function getContainerBuilder(): ContainerBuilder - { - return $this->builder; - } - - - public function resolveDefinition(Definition $def): void - { - if ($this->recursive->contains($def)) { - $names = array_map(function ($item) { return $item->getName(); }, iterator_to_array($this->recursive)); - throw new ServiceCreationException(sprintf('Circular reference detected for services: %s.', implode(', ', $names))); - } - - try { - $this->recursive->attach($def); - - $def->resolveType($this); - - if (!$def->getType()) { - throw new ServiceCreationException('Type of service is unknown.'); - } - } catch (\Throwable $e) { - throw $this->completeException($e, $def); - - } finally { - $this->recursive->detach($def); - } - } - - - public function resolveReferenceType(Reference $ref): ?string - { - if ($ref->isSelf()) { - return $this->currentServiceType; - } elseif ($ref->isType()) { - return ltrim($ref->getValue(), '\\'); - } - - $def = $this->resolveReference($ref); - if (!$def->getType()) { - $this->resolveDefinition($def); - } - - return $def->getType(); - } - - - public function resolveEntityType(Statement $statement): ?string - { - $entity = $this->normalizeEntity($statement); - - if (is_array($entity)) { - if ($entity[0] instanceof Reference || $entity[0] instanceof Statement) { - $entity[0] = $this->resolveEntityType($entity[0] instanceof Statement ? $entity[0] : new Statement($entity[0])); - if (!$entity[0]) { - return null; - } - } - - try { - /** @var \ReflectionMethod|\ReflectionFunction $reflection */ - $reflection = Callback::toReflection($entity[0] === '' ? $entity[1] : $entity); - $refClass = $reflection instanceof \ReflectionMethod - ? $reflection->getDeclaringClass() - : null; - } catch (\ReflectionException $e) { - $refClass = $reflection = null; - } - - if (isset($e) || ($refClass && (!$reflection->isPublic() - || ($refClass->isTrait() && !$reflection->isStatic()) - ))) { - throw new ServiceCreationException(sprintf('Method %s() is not callable.', Callback::toString($entity)), 0, $e ?? null); - } - - $this->addDependency($reflection); - - $type = Nette\Utils\Type::fromReflection($reflection) ?? Helpers::getReturnTypeAnnotation($reflection); - if ($type && !in_array((string) $type, ['object', 'mixed'], true)) { - return Helpers::ensureClassType($type, sprintf('return type of %s()', Callback::toString($entity))); - } - - return null; - - } elseif ($entity instanceof Reference) { // alias or factory - return $this->resolveReferenceType($entity); - - } elseif (is_string($entity)) { // class - if (!class_exists($entity)) { - throw new ServiceCreationException(sprintf( - interface_exists($entity) - ? "Interface %s can not be used as 'factory', did you mean 'implement'?" - : "Class '%s' not found.", - $entity - )); - } - - return $entity; - } - - return null; - } - - - public function completeDefinition(Definition $def): void - { - $this->currentService = in_array($def, $this->builder->getDefinitions(), true) - ? $def - : null; - $this->currentServiceType = $def->getType(); - $this->currentServiceAllowed = false; - - try { - $def->complete($this); - - $this->addDependency(new \ReflectionClass($def->getType())); - - } catch (\Throwable $e) { - throw $this->completeException($e, $def); - - } finally { - $this->currentService = $this->currentServiceType = null; - } - } - - - public function completeStatement(Statement $statement, bool $currentServiceAllowed = false): Statement - { - $this->currentServiceAllowed = $currentServiceAllowed; - $entity = $this->normalizeEntity($statement); - $arguments = $this->convertReferences($statement->arguments); - $getter = function (string $type, bool $single) { - return $single - ? $this->getByType($type) - : array_values(array_filter($this->builder->findAutowired($type), function ($obj) { return $obj !== $this->currentService; })); - }; - - switch (true) { - case is_string($entity) && Strings::contains($entity, '?'): // PHP literal - break; - - case $entity === 'not': - if (count($arguments) > 1) { - throw new ServiceCreationException(sprintf( - 'Function %s() expects at most 1 parameter, %s given.', - $entity, - count($arguments) - )); - } - - $entity = ['', '!']; - break; - - case $entity === 'bool': - case $entity === 'int': - case $entity === 'float': - case $entity === 'string': - if (count($arguments) > 1) { - throw new ServiceCreationException(sprintf( - 'Function %s() expects at most 1 parameter, %s given.', - $entity, - count($arguments) - )); - } - - $arguments = [$arguments[0], $entity]; - $entity = [Helpers::class, 'convertType']; - break; - - case is_string($entity): // create class - if (!class_exists($entity)) { - throw new ServiceCreationException(sprintf("Class '%s' not found.", $entity)); - } elseif ((new ReflectionClass($entity))->isAbstract()) { - throw new ServiceCreationException(sprintf('Class %s is abstract.', $entity)); - } elseif (($rm = (new ReflectionClass($entity))->getConstructor()) !== null && !$rm->isPublic()) { - throw new ServiceCreationException(sprintf('Class %s has %s constructor.', $entity, $rm->isProtected() ? 'protected' : 'private')); - } elseif ($constructor = (new ReflectionClass($entity))->getConstructor()) { - $arguments = self::autowireArguments($constructor, $arguments, $getter); - $this->addDependency($constructor); - } elseif ($arguments) { - throw new ServiceCreationException(sprintf( - 'Unable to pass arguments, class %s has no constructor.', - $entity - )); - } - - break; - - case $entity instanceof Reference: - $entity = [new Reference(ContainerBuilder::THIS_CONTAINER), Container::getMethodName($entity->getValue())]; - break; - - case is_array($entity): - if (!preg_match('#^\$?(\\\\?' . PhpHelpers::PHP_IDENT . ')+(\[\])?$#D', $entity[1])) { - throw new ServiceCreationException(sprintf( - "Expected function, method or property name, '%s' given.", - $entity[1] - )); - } - - switch (true) { - case $entity[0] === '': // function call - if (!Nette\Utils\Arrays::isList($arguments)) { - throw new ServiceCreationException(sprintf( - 'Unable to pass specified arguments to %s.', - $entity[0] - )); - } elseif (!function_exists($entity[1])) { - throw new ServiceCreationException(sprintf("Function %s doesn't exist.", $entity[1])); - } - - $rf = new \ReflectionFunction($entity[1]); - $arguments = self::autowireArguments($rf, $arguments, $getter); - $this->addDependency($rf); - break; - - case $entity[0] instanceof Statement: - $entity[0] = $this->completeStatement($entity[0], $this->currentServiceAllowed); - // break omitted - - case is_string($entity[0]): // static method call - case $entity[0] instanceof Reference: - if ($entity[1][0] === '$') { // property getter, setter or appender - Validators::assert($arguments, 'list:0..1', "setup arguments for '" . Callback::toString($entity) . "'"); - if (!$arguments && substr($entity[1], -2) === '[]') { - throw new ServiceCreationException(sprintf('Missing argument for %s.', $entity[1])); - } - } elseif ( - $type = $entity[0] instanceof Reference - ? $this->resolveReferenceType($entity[0]) - : $this->resolveEntityType($entity[0] instanceof Statement ? $entity[0] : new Statement($entity[0])) - ) { - $rc = new ReflectionClass($type); - if ($rc->hasMethod($entity[1])) { - $rm = $rc->getMethod($entity[1]); - if (!$rm->isPublic()) { - throw new ServiceCreationException(sprintf('%s::%s() is not callable.', $type, $entity[1])); - } - - $arguments = self::autowireArguments($rm, $arguments, $getter); - $this->addDependency($rm); - - } elseif (!Nette\Utils\Arrays::isList($arguments)) { - throw new ServiceCreationException(sprintf('Unable to pass specified arguments to %s::%s().', $type, $entity[1])); - } - } - } - } - - try { - $arguments = $this->completeArguments($arguments); - } catch (ServiceCreationException $e) { - if (!strpos($e->getMessage(), ' (used in')) { - $e->setMessage($e->getMessage() . " (used in {$this->entityToString($entity)})"); - } - - throw $e; - } - - return new Statement($entity, $arguments); - } - - - public function completeArguments(array $arguments): array - { - array_walk_recursive($arguments, function (&$val): void { - if ($val instanceof Statement) { - $entity = $val->getEntity(); - if ($entity === 'typed' || $entity === 'tagged') { - $services = []; - $current = $this->currentService - ? $this->currentService->getName() - : null; - foreach ($val->arguments as $argument) { - foreach ($entity === 'tagged' ? $this->builder->findByTag($argument) : $this->builder->findAutowired($argument) as $name => $foo) { - if ($name !== $current) { - $services[] = new Reference($name); - } - } - } - - $val = $this->completeArguments($services); - } else { - $val = $this->completeStatement($val, $this->currentServiceAllowed); - } - } elseif ($val instanceof Definition || $val instanceof Reference) { - $val = $this->normalizeEntity(new Statement($val)); - } - }); - return $arguments; - } - - - /** @return string|array|Reference literal, Class, Reference, [Class, member], [, globalFunc], [Reference, member], [Statement, member] */ - private function normalizeEntity(Statement $statement) - { - $entity = $statement->getEntity(); - if (is_array($entity)) { - $item = &$entity[0]; - } else { - $item = &$entity; - } - - if ($item instanceof Definition) { - $name = current(array_keys($this->builder->getDefinitions(), $item, true)); - if ($name === false) { - throw new ServiceCreationException(sprintf("Service '%s' not found in definitions.", $item->getName())); - } - - $item = new Reference($name); - } - - if ($item instanceof Reference) { - $item = $this->normalizeReference($item); - } - - return $entity; - } - - - /** - * Normalizes reference to 'self' or named reference (or leaves it typed if it is not possible during resolving) and checks existence of service. - */ - public function normalizeReference(Reference $ref): Reference - { - $service = $ref->getValue(); - if ($ref->isSelf()) { - return $ref; - } elseif ($ref->isName()) { - if (!$this->builder->hasDefinition($service)) { - throw new ServiceCreationException(sprintf("Reference to missing service '%s'.", $service)); - } - - return $this->currentService && $service === $this->currentService->getName() - ? new Reference(Reference::SELF) - : $ref; - } - - try { - return $this->getByType($service); - } catch (NotAllowedDuringResolvingException $e) { - return new Reference($service); - } - } - - - public function resolveReference(Reference $ref): Definition - { - return $ref->isSelf() - ? $this->currentService - : $this->builder->getDefinition($ref->getValue()); - } - - - /** - * Returns named reference to service resolved by type (or 'self' reference for local-autowiring). - * @throws ServiceCreationException when multiple found - * @throws MissingServiceException when not found - */ - public function getByType(string $type): Reference - { - if ( - $this->currentService - && $this->currentServiceAllowed - && is_a($this->currentServiceType, $type, true) - ) { - return new Reference(Reference::SELF); - } - - $name = $this->builder->getByType($type, true); - if ( - !$this->currentServiceAllowed - && $this->currentService === $this->builder->getDefinition($name) - ) { - throw new MissingServiceException; - } - - return new Reference($name); - } - - - /** - * Adds item to the list of dependencies. - * @param \ReflectionClass|\ReflectionFunctionAbstract|string $dep - * @return static - */ - public function addDependency($dep) - { - $this->builder->addDependency($dep); - return $this; - } - - - private function completeException(\Throwable $e, Definition $def): ServiceCreationException - { - if ($e instanceof ServiceCreationException && Strings::startsWith($e->getMessage(), "Service '")) { - return $e; - } - - $name = $def->getName(); - $type = $def->getType(); - if ($name && !ctype_digit($name)) { - $message = "Service '$name'" . ($type ? " (type of $type)" : '') . ': '; - } elseif ($type) { - $message = "Service of type $type: "; - } elseif ($def instanceof Definitions\ServiceDefinition && $def->getEntity()) { - $message = 'Service (' . $this->entityToString($def->getEntity()) . '): '; - } else { - $message = ''; - } - - $message .= $type - ? str_replace("$type::", preg_replace('~.*\\\\~', '', $type) . '::', $e->getMessage()) - : $e->getMessage(); - - return $e instanceof ServiceCreationException - ? $e->setMessage($message) - : new ServiceCreationException($message, 0, $e); - } - - - private function entityToString($entity): string - { - $referenceToText = function (Reference $ref): string { - return $ref->isSelf() && $this->currentService - ? '@' . $this->currentService->getName() - : '@' . $ref->getValue(); - }; - if (is_string($entity)) { - return $entity . '::__construct()'; - } elseif ($entity instanceof Reference) { - $entity = $referenceToText($entity); - } elseif (is_array($entity)) { - if (strpos($entity[1], '$') === false) { - $entity[1] .= '()'; - } - - if ($entity[0] instanceof Reference) { - $entity[0] = $referenceToText($entity[0]); - } elseif (!is_string($entity[0])) { - return $entity[1]; - } - - return implode('::', $entity); - } - - return (string) $entity; - } - - - private function convertReferences(array $arguments): array - { - array_walk_recursive($arguments, function (&$val): void { - if (is_string($val) && strlen($val) > 1 && $val[0] === '@' && $val[1] !== '@') { - $pair = explode('::', substr($val, 1), 2); - if (!isset($pair[1])) { // @service - $val = new Reference($pair[0]); - } elseif (preg_match('#^[A-Z][A-Z0-9_]*$#D', $pair[1], $m)) { // @service::CONSTANT - $val = ContainerBuilder::literal($this->resolveReferenceType(new Reference($pair[0])) . '::' . $pair[1]); - } else { // @service::property - $val = new Statement([new Reference($pair[0]), '$' . $pair[1]]); - } - } elseif (is_string($val) && substr($val, 0, 2) === '@@') { // escaped text @@ - $val = substr($val, 1); - } - }); - return $arguments; - } - - - /** - * Add missing arguments using autowiring. - * @param (callable(string $type, bool $single): (object|object[]|null)) $getter - * @throws ServiceCreationException - */ - public static function autowireArguments( - \ReflectionFunctionAbstract $method, - array $arguments, - callable $getter - ): array { - $optCount = 0; - $useName = false; - $num = -1; - $res = []; - - foreach ($method->getParameters() as $num => $param) { - $paramName = $param->name; - - if ($param->isVariadic()) { - if (array_key_exists($paramName, $arguments)) { - if (!is_array($arguments[$paramName])) { - throw new ServiceCreationException(sprintf( - 'Parameter %s must be array, %s given.', - Reflection::toString($param), - gettype($arguments[$paramName]) - )); - } - - $variadics = $arguments[$paramName]; - unset($arguments[$paramName]); - } else { - $variadics = array_merge($arguments); - $arguments = []; - } - - if ($useName) { - $res[$paramName] = $variadics; - } else { - $res = array_merge($res, $variadics); - } - - $optCount = 0; - break; - - } elseif (array_key_exists($paramName, $arguments)) { - $res[$useName ? $paramName : $num] = $arguments[$paramName]; - unset($arguments[$paramName], $arguments[$num]); - - } elseif (array_key_exists($num, $arguments)) { - $res[$useName ? $paramName : $num] = $arguments[$num]; - unset($arguments[$num]); - - } elseif (($aw = self::autowireArgument($param, $getter)) !== null) { - $res[$useName ? $paramName : $num] = $aw; - - } elseif (PHP_VERSION_ID >= 80000) { - if ($param->isOptional()) { - $useName = true; - } else { - $res[$num] = null; - } - - } else { - $res[$num] = $param->isDefaultValueAvailable() - ? Reflection::getParameterDefaultValue($param) - : null; - } - - if (PHP_VERSION_ID < 80000) { - $optCount = $param->isOptional() && $res[$num] === ($param->isDefaultValueAvailable() ? Reflection::getParameterDefaultValue($param) : null) - ? $optCount + 1 - : 0; - } - } - - // extra parameters - while (!$useName && !$optCount && array_key_exists(++$num, $arguments)) { - $res[$num] = $arguments[$num]; - unset($arguments[$num]); - } - - if ($arguments) { - throw new ServiceCreationException(sprintf( - 'Unable to pass specified arguments to %s.', - Reflection::toString($method) - )); - } elseif ($optCount) { - $res = array_slice($res, 0, -$optCount); - } - - return $res; - } - - - /** - * Resolves missing argument using autowiring. - * @param (callable(string $type, bool $single): (object|object[]|null)) $getter - * @throws ServiceCreationException - * @return mixed - */ - private static function autowireArgument(\ReflectionParameter $parameter, callable $getter) - { - $method = $parameter->getDeclaringFunction(); - $desc = Reflection::toString($parameter); - $type = Nette\Utils\Type::fromReflection($parameter); - - if ($parameter->getType() instanceof \ReflectionIntersectionType) { - throw new ServiceCreationException(sprintf( - 'Parameter %s has intersection type, so its value must be specified.', - $desc - )); - - } elseif ($type && $type->isClass()) { - $class = $type->getSingleName(); - try { - $res = $getter($class, true); - } catch (MissingServiceException $e) { - $res = null; - } catch (ServiceCreationException $e) { - throw new ServiceCreationException("{$e->getMessage()} (required by $desc)", 0, $e); - } - - if ($res !== null || $parameter->allowsNull()) { - return $res; - } elseif (class_exists($class) || interface_exists($class)) { - throw new ServiceCreationException(sprintf( - 'Service of type %s required by %s not found. Did you add it to configuration file?', - $class, - $desc - )); - } else { - throw new ServiceCreationException(sprintf( - "Class '%s' required by %s not found. Check the parameter type and 'use' statements.", - $class, - $desc - )); - } - } elseif ( - $method instanceof \ReflectionMethod - && $type && $type->getSingleName() === 'array' - && preg_match('#@param[ \t]+([\w\\\\]+)\[\][ \t]+\$' . $parameter->name . '#', (string) $method->getDocComment(), $m) - && ($itemType = Reflection::expandClassName($m[1], $method->getDeclaringClass())) - && (class_exists($itemType) || interface_exists($itemType)) - ) { - return $getter($itemType, false); - - } elseif ( - ($type && $parameter->allowsNull()) - || $parameter->isOptional() - || $parameter->isDefaultValueAvailable() - ) { - // !optional + defaultAvailable, !optional + !defaultAvailable since 8.1.0 = func($a = null, $b) - // optional + !defaultAvailable, optional + defaultAvailable since 8.0.0 = i.e. Exception::__construct, mysqli::mysqli, ... - // optional + !defaultAvailable = variadics - // in other cases the optional and defaultAvailable are identical - return null; - - } else { - throw new ServiceCreationException(sprintf( - 'Parameter %s has %s, so its value must be specified.', - $desc, - $type && $type->isUnion() ? 'union type and no default value' : 'no class type or default value' - )); - } - } -} diff --git a/vendor/nette/di/src/DI/exceptions.php b/vendor/nette/di/src/DI/exceptions.php deleted file mode 100644 index b441c5e..0000000 --- a/vendor/nette/di/src/DI/exceptions.php +++ /dev/null @@ -1,49 +0,0 @@ -message = $message; - return $this; - } -} - - -/** - * Not allowed when container is resolving. - */ -class NotAllowedDuringResolvingException extends Nette\InvalidStateException -{ -} - - -/** - * Error in configuration. - */ -class InvalidConfigurationException extends Nette\InvalidStateException -{ -} diff --git a/vendor/nette/di/src/compatibility.php b/vendor/nette/di/src/compatibility.php deleted file mode 100644 index f0a0e53..0000000 --- a/vendor/nette/di/src/compatibility.php +++ /dev/null @@ -1,39 +0,0 @@ -=7.1", - "nette/utils": "^2.4 || ^3.0" - }, - "require-dev": { - "nette/tester": "^2.0", - "tracy/tracy": "^2.3", - "phpstan/phpstan": "^0.12" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "autoload": { - "classmap": ["src/"] - }, - "minimum-stability": "dev", - "scripts": { - "phpstan": "phpstan analyse", - "tester": "tester tests -s" - }, - "extra": { - "branch-alias": { - "dev-master": "2.5-dev" - } - } -} diff --git a/vendor/nette/finder/contributing.md b/vendor/nette/finder/contributing.md deleted file mode 100644 index 184152c..0000000 --- a/vendor/nette/finder/contributing.md +++ /dev/null @@ -1,33 +0,0 @@ -How to contribute & use the issue tracker -========================================= - -Nette welcomes your contributions. There are several ways to help out: - -* Create an issue on GitHub, if you have found a bug -* Write test cases for open bug issues -* Write fixes for open bug/feature issues, preferably with test cases included -* Contribute to the [documentation](https://nette.org/en/writing) - -Issues ------- - -Please **do not use the issue tracker to ask questions**. We will be happy to help you -on [Nette forum](https://forum.nette.org) or chat with us on [Gitter](https://gitter.im/nette/nette). - -A good bug report shouldn't leave others needing to chase you up for more -information. Please try to be as detailed as possible in your report. - -**Feature requests** are welcome. But take a moment to find out whether your idea -fits with the scope and aims of the project. It's up to *you* to make a strong -case to convince the project's developers of the merits of this feature. - -Contributing ------------- - -If you'd like to contribute, please take a moment to read [the contributing guide](https://nette.org/en/contributing). - -The best way to propose a feature is to discuss your ideas on [Nette forum](https://forum.nette.org) before implementing them. - -Please do not fix whitespace, format code, or make a purely cosmetic patch. - -Thanks! :heart: diff --git a/vendor/nette/finder/license.md b/vendor/nette/finder/license.md deleted file mode 100644 index cf741bd..0000000 --- a/vendor/nette/finder/license.md +++ /dev/null @@ -1,60 +0,0 @@ -Licenses -======== - -Good news! You may use Nette Framework under the terms of either -the New BSD License or the GNU General Public License (GPL) version 2 or 3. - -The BSD License is recommended for most projects. It is easy to understand and it -places almost no restrictions on what you can do with the framework. If the GPL -fits better to your project, you can use the framework under this license. - -You don't have to notify anyone which license you are using. You can freely -use Nette Framework in commercial projects as long as the copyright header -remains intact. - -Please be advised that the name "Nette Framework" is a protected trademark and its -usage has some limitations. So please do not use word "Nette" in the name of your -project or top-level domain, and choose a name that stands on its own merits. -If your stuff is good, it will not take long to establish a reputation for yourselves. - - -New BSD License ---------------- - -Copyright (c) 2004, 2014 David Grudl (https://davidgrudl.com) -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - * Neither the name of "Nette Framework" nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -This software is provided by the copyright holders and contributors "as is" and -any express or implied warranties, including, but not limited to, the implied -warranties of merchantability and fitness for a particular purpose are -disclaimed. In no event shall the copyright owner or contributors be liable for -any direct, indirect, incidental, special, exemplary, or consequential damages -(including, but not limited to, procurement of substitute goods or services; -loss of use, data, or profits; or business interruption) however caused and on -any theory of liability, whether in contract, strict liability, or tort -(including negligence or otherwise) arising in any way out of the use of this -software, even if advised of the possibility of such damage. - - -GNU General Public License --------------------------- - -GPL licenses are very very long, so instead of including them here we offer -you URLs with full text: - -- [GPL version 2](http://www.gnu.org/licenses/gpl-2.0.html) -- [GPL version 3](http://www.gnu.org/licenses/gpl-3.0.html) diff --git a/vendor/nette/finder/readme.md b/vendor/nette/finder/readme.md deleted file mode 100644 index 90ebafe..0000000 --- a/vendor/nette/finder/readme.md +++ /dev/null @@ -1,166 +0,0 @@ -Nette Finder: Files Searching -============================= - -[![Downloads this Month](https://img.shields.io/packagist/dm/nette/finder.svg)](https://packagist.org/packages/nette/finder) -[![Tests](https://github.com/nette/finder/workflows/Tests/badge.svg?branch=master)](https://github.com/nette/finder/actions) -[![Coverage Status](https://coveralls.io/repos/github/nette/finder/badge.svg?branch=master)](https://coveralls.io/github/nette/finder?branch=master) -[![Latest Stable Version](https://poser.pugx.org/nette/finder/v/stable)](https://github.com/nette/finder/releases) -[![License](https://img.shields.io/badge/license-New%20BSD-blue.svg)](https://github.com/nette/finder/blob/master/license.md) - - -Introduction ------------- - -Nette Finder makes browsing the directory structure really easy. - -Documentation can be found on the [website](https://doc.nette.org/finder). - - -[Support Me](https://github.com/sponsors/dg) --------------------------------------------- - -Do you like Nette Finder? Are you looking forward to the new features? - -[![Buy me a coffee](https://files.nette.org/icons/donation-3.svg)](https://github.com/sponsors/dg) - -Thank you! - - -Installation ------------- - -```shell -composer require nette/finder -``` - -All examples assume the following class alias is defined: - -```php -use Nette\Utils\Finder; -``` - - -Searching for Files -------------------- - -How to find all `*.txt` files in `$dir` directory and all its subdirectories? - -```php -foreach (Finder::findFiles('*.txt')->from($dir) as $key => $file) { - // $key is a string containing absolute filename with path - // $file is an instance of SplFileInfo -} -``` - -The files in the `$file` variable are instances of the `SplFileInfo` class. - -If the directory does not exist, an `Nette\UnexpectedValueException` is thrown. - -And what about searching for files in a directory without subdirectories? Instead of `from()` use `in()`: - -```php -Finder::findFiles('*.txt')->in($dir) -``` - -Search by multiple masks and even multiple directories at once: - -```php -Finder::findFiles('*.txt', '*.php') - ->in($dir1, $dir2) // or from($dir1, $dir2) -``` - -Parameters can also be arrays: - -```php -Finder::findFiles(['*.txt', '*.php']) - ->in([$dir1, $dir2]) // or from([$dir1, $dir2]) -``` - -Depth of search can be limited using the `limitDepth()` method. - - -Searching for Directories -------------------------- - -In addition to files, it is possible to search for directories using `Finder::findDirectories('subdir*')`. - -Or to search for files and directories together using `Finder::find('*.txt')`, the mask in this case only applies to files. When searching recursively with `from()`, the subdirectory is returned first, followed by the files in it, which can be reversed with `childFirst()`. - - -Mask ----- - -The mask does not have to describe only the file name, but also the path. Example: searching for `*.jpg` files located in a subdirectory starting with `imag`: - -```php -Finder::findFiles('imag*/*.jpg') -``` - -Thus, the known wildcards `*` and `?` represent any characters except the directory separator `/`. The double `**` represents any characters, including the directory separator: - -```php -Finder::findFiles('imag**/*.jpg') -// finds also image/subdir/file.jpg -``` - -In addition you can use in the mask ranges `[...]` or negative ranges `[!...]` known from regular expressions. Searching for `*.txt` files containing a digit in the name: - -```php -Finder::findFiles('*[0-9]*.txt') -``` - - -Excluding ---------- - -Use `exclude()` to pass masks that the file must not match. Searching for `*.txt` files, except those containing '`X`' in the name: - -```php -Finder::findFiles('*.txt') - ->exclude('*X*') -``` - -If `exclude()` is specified **after** `from()`, it applies to crawled subdirectories: - -```php -Finder::findFiles('*.php') - ->from($dir) - ->exclude('temp', '.git') -``` - - - -Filtering ---------- - -You can also filter the results, for example by file size. Here's how to find files of size between 100 and 200 bytes: - -```php -Finder::findFiles('*.php') - ->size('>=', 100) - ->size('<=', 200) - ->from($dir) -``` - -Filtering by date of last change. Example: searching for files changed in the last two weeks: - -```php -Finder::findFiles('*.php') - ->date('>', '- 2 weeks') - ->from($dir) -``` - -Both functions understand the operators `>`, `>=`, `<`, `<=`, `=`, `!=`. - -Here we traverse PHP files with number of lines greater than 1000. As a filter we use a custom callback: - -```php -$hasMoreThan100Lines = function (SplFileInfo $file): bool { - return count(file($file->getPathname())) > 1000; -}; - -Finder::findFiles('*.php') - ->filter($hasMoreThan100Lines) -``` - -Handy, right? You will certainly find a use for Finder in your applications. diff --git a/vendor/nette/finder/src/Utils/Finder.php b/vendor/nette/finder/src/Utils/Finder.php deleted file mode 100644 index 64323fd..0000000 --- a/vendor/nette/finder/src/Utils/Finder.php +++ /dev/null @@ -1,394 +0,0 @@ - - * Finder::findFiles('*.php') - * ->size('> 10kB') - * ->from('.') - * ->exclude('temp'); - * - * - * @implements \IteratorAggregate - */ -class Finder implements \IteratorAggregate, \Countable -{ - use Nette\SmartObject; - - /** @var callable extension methods */ - private static $extMethods = []; - - /** @var array */ - private $paths = []; - - /** @var array of filters */ - private $groups = []; - - /** @var array filter for recursive traversing */ - private $exclude = []; - - /** @var int */ - private $order = RecursiveIteratorIterator::SELF_FIRST; - - /** @var int */ - private $maxDepth = -1; - - /** @var array */ - private $cursor; - - - /** - * Begins search for files and directories matching mask. - * @param string|string[] $masks - * @return static - */ - public static function find(...$masks): self - { - $masks = $masks && is_array($masks[0]) ? $masks[0] : $masks; - return (new static)->select($masks, 'isDir')->select($masks, 'isFile'); - } - - - /** - * Begins search for files matching mask. - * @param string|string[] $masks - * @return static - */ - public static function findFiles(...$masks): self - { - $masks = $masks && is_array($masks[0]) ? $masks[0] : $masks; - return (new static)->select($masks, 'isFile'); - } - - - /** - * Begins search for directories matching mask. - * @param string|string[] $masks - * @return static - */ - public static function findDirectories(...$masks): self - { - $masks = $masks && is_array($masks[0]) ? $masks[0] : $masks; - return (new static)->select($masks, 'isDir'); - } - - - /** - * Creates filtering group by mask & type selector. - * @return static - */ - private function select(array $masks, string $type): self - { - $this->cursor = &$this->groups[]; - $pattern = self::buildPattern($masks); - $this->filter(function (RecursiveDirectoryIterator $file) use ($type, $pattern): bool { - return !$file->isDot() - && $file->$type() - && (!$pattern || preg_match($pattern, '/' . strtr($file->getSubPathName(), '\\', '/'))); - }); - return $this; - } - - - /** - * Searches in the given folder(s). - * @param string|string[] $paths - * @return static - */ - public function in(...$paths): self - { - $this->maxDepth = 0; - return $this->from(...$paths); - } - - - /** - * Searches recursively from the given folder(s). - * @param string|string[] $paths - * @return static - */ - public function from(...$paths): self - { - if ($this->paths) { - throw new Nette\InvalidStateException('Directory to search has already been specified.'); - } - - $this->paths = is_array($paths[0]) ? $paths[0] : $paths; - $this->cursor = &$this->exclude; - return $this; - } - - - /** - * Shows folder content prior to the folder. - * @return static - */ - public function childFirst(): self - { - $this->order = RecursiveIteratorIterator::CHILD_FIRST; - return $this; - } - - - /** - * Converts Finder pattern to regular expression. - */ - private static function buildPattern(array $masks): ?string - { - $pattern = []; - foreach ($masks as $mask) { - $mask = rtrim(strtr($mask, '\\', '/'), '/'); - $prefix = ''; - if ($mask === '') { - continue; - - } elseif ($mask === '*') { - return null; - - } elseif ($mask[0] === '/') { // absolute fixing - $mask = ltrim($mask, '/'); - $prefix = '(?<=^/)'; - } - - $pattern[] = $prefix . strtr( - preg_quote($mask, '#'), - ['\*\*' => '.*', '\*' => '[^/]*', '\?' => '[^/]', '\[\!' => '[^', '\[' => '[', '\]' => ']', '\-' => '-'] - ); - } - - return $pattern ? '#/(' . implode('|', $pattern) . ')$#Di' : null; - } - - - /********************* iterator generator ****************d*g**/ - - - /** - * Get the number of found files and/or directories. - */ - public function count(): int - { - return iterator_count($this->getIterator()); - } - - - /** - * Returns iterator. - */ - public function getIterator(): \Iterator - { - if (!$this->paths) { - throw new Nette\InvalidStateException('Call in() or from() to specify directory to search.'); - - } elseif (count($this->paths) === 1) { - return $this->buildIterator((string) $this->paths[0]); - } - - $iterator = new \AppendIterator; - foreach ($this->paths as $path) { - $iterator->append($this->buildIterator((string) $path)); - } - - return $iterator; - } - - - /** - * Returns per-path iterator. - */ - private function buildIterator(string $path): \Iterator - { - $iterator = new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::FOLLOW_SYMLINKS); - - if ($this->exclude) { - $iterator = new \RecursiveCallbackFilterIterator($iterator, function ($foo, $bar, RecursiveDirectoryIterator $file): bool { - if (!$file->isDot() && !$file->isFile()) { - foreach ($this->exclude as $filter) { - if (!$filter($file)) { - return false; - } - } - } - - return true; - }); - } - - if ($this->maxDepth !== 0) { - $iterator = new RecursiveIteratorIterator($iterator, $this->order); - $iterator->setMaxDepth($this->maxDepth); - } - - $iterator = new \CallbackFilterIterator($iterator, function ($foo, $bar, \Iterator $file): bool { - while ($file instanceof \OuterIterator) { - $file = $file->getInnerIterator(); - } - - foreach ($this->groups as $filters) { - foreach ($filters as $filter) { - if (!$filter($file)) { - continue 2; - } - } - - return true; - } - - return false; - }); - - return $iterator; - } - - - /********************* filtering ****************d*g**/ - - - /** - * Restricts the search using mask. - * Excludes directories from recursive traversing. - * @param string|string[] $masks - * @return static - */ - public function exclude(...$masks): self - { - $masks = $masks && is_array($masks[0]) ? $masks[0] : $masks; - $pattern = self::buildPattern($masks); - if ($pattern) { - $this->filter(function (RecursiveDirectoryIterator $file) use ($pattern): bool { - return !preg_match($pattern, '/' . strtr($file->getSubPathName(), '\\', '/')); - }); - } - - return $this; - } - - - /** - * Restricts the search using callback. - * @param callable $callback function (RecursiveDirectoryIterator $file): bool - * @return static - */ - public function filter(callable $callback): self - { - $this->cursor[] = $callback; - return $this; - } - - - /** - * Limits recursion level. - * @return static - */ - public function limitDepth(int $depth): self - { - $this->maxDepth = $depth; - return $this; - } - - - /** - * Restricts the search by size. - * @param string $operator "[operator] [size] [unit]" example: >=10kB - * @return static - */ - public function size(string $operator, ?int $size = null): self - { - if (func_num_args() === 1) { // in $operator is predicate - if (!preg_match('#^(?:([=<>!]=?|<>)\s*)?((?:\d*\.)?\d+)\s*(K|M|G|)B?$#Di', $operator, $matches)) { - throw new Nette\InvalidArgumentException('Invalid size predicate format.'); - } - - [, $operator, $size, $unit] = $matches; - static $units = ['' => 1, 'k' => 1e3, 'm' => 1e6, 'g' => 1e9]; - $size *= $units[strtolower($unit)]; - $operator = $operator ?: '='; - } - return $this->filter(function (RecursiveDirectoryIterator $file) use ($operator, $size): bool { - return self::compare($file->getSize(), $operator, $size); - }); - } - - - /** - * Restricts the search by modified time. - * @param string $operator "[operator] [date]" example: >1978-01-23 - * @param string|int|\DateTimeInterface $date - * @return static - */ - public function date(string $operator, $date = null): self - { - if (func_num_args() === 1) { // in $operator is predicate - if (!preg_match('#^(?:([=<>!]=?|<>)\s*)?(.+)$#Di', $operator, $matches)) { - throw new Nette\InvalidArgumentException('Invalid date predicate format.'); - } - - [, $operator, $date] = $matches; - $operator = $operator ?: '='; - } - - $date = DateTime::from($date)->format('U'); - return $this->filter(function (RecursiveDirectoryIterator $file) use ($operator, $date): bool { - return self::compare($file->getMTime(), $operator, $date); - }); - } - - - /** - * Compares two values. - */ - public static function compare($l, string $operator, $r): bool - { - switch ($operator) { - case '>': - return $l > $r; - case '>=': - return $l >= $r; - case '<': - return $l < $r; - case '<=': - return $l <= $r; - case '=': - case '==': - return $l == $r; - case '!': - case '!=': - case '<>': - return $l != $r; - default: - throw new Nette\InvalidArgumentException("Unknown operator $operator."); - } - } - - - /********************* extension methods ****************d*g**/ - - - public function __call(string $name, array $args) - { - return isset(self::$extMethods[$name]) - ? (self::$extMethods[$name])($this, ...$args) - : Nette\Utils\ObjectHelpers::strictCall(static::class, $name, array_keys(self::$extMethods)); - } - - - public static function extensionMethod(string $name, callable $callback): void - { - self::$extMethods[$name] = $callback; - } -} diff --git a/vendor/nette/neon/bin/neon-lint b/vendor/nette/neon/bin/neon-lint deleted file mode 100755 index 180fa61..0000000 --- a/vendor/nette/neon/bin/neon-lint +++ /dev/null @@ -1,92 +0,0 @@ -#!/usr/bin/env php -\n"; - exit(1); -} - -$ok = scanPath($argv[1]); -exit($ok ? 0 : 1); - - -function scanPath(string $path): bool -{ - echo "Scanning $path\n"; - - $it = new RecursiveDirectoryIterator($path); - $it = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::LEAVES_ONLY); - $it = new RegexIterator($it, '~\.neon$~'); - - $counter = 0; - $success = true; - foreach ($it as $file) { - echo str_pad(str_repeat('.', $counter++ % 40), 40), "\x0D"; - $success = lintFile((string) $file) && $success; - } - - echo str_pad('', 40), "\x0D"; - echo "Done.\n"; - return $success; -} - - -function lintFile(string $file): bool -{ - set_error_handler(function (int $severity, string $message) use ($file) { - if ($severity === E_USER_DEPRECATED) { - fwrite(STDERR, "[DEPRECATED] $file $message\n"); - return null; - } - return false; - }); - - $s = file_get_contents($file); - if (substr($s, 0, 3) === "\xEF\xBB\xBF") { - fwrite(STDERR, "[WARNING] $file contains BOM\n"); - $contents = substr($s, 3); - } - - try { - Nette\Neon\Neon::decode($s); - return true; - - } catch (Nette\Neon\Exception $e) { - fwrite(STDERR, "[ERROR] $file {$e->getMessage()}\n"); - - } finally { - restore_error_handler(); - } - return false; -} diff --git a/vendor/nette/neon/composer.json b/vendor/nette/neon/composer.json deleted file mode 100644 index ccdf65e..0000000 --- a/vendor/nette/neon/composer.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "nette/neon", - "description": "🍸 Nette NEON: encodes and decodes NEON file format.", - "keywords": ["nette", "neon", "import", "export", "yaml"], - "homepage": "https://ne-on.org", - "license": ["BSD-3-Clause", "GPL-2.0-only", "GPL-3.0-only"], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "require": { - "php": ">=7.1", - "ext-json": "*" - }, - "require-dev": { - "nette/tester": "^2.0", - "tracy/tracy": "^2.7", - "phpstan/phpstan": "^0.12" - }, - "autoload": { - "classmap": ["src/"] - }, - "minimum-stability": "dev", - "bin": ["bin/neon-lint"], - "scripts": { - "phpstan": "phpstan analyse", - "tester": "tester tests -s" - }, - "extra": { - "branch-alias": { - "dev-master": "3.3-dev" - } - } -} diff --git a/vendor/nette/neon/contributing.md b/vendor/nette/neon/contributing.md deleted file mode 100644 index 184152c..0000000 --- a/vendor/nette/neon/contributing.md +++ /dev/null @@ -1,33 +0,0 @@ -How to contribute & use the issue tracker -========================================= - -Nette welcomes your contributions. There are several ways to help out: - -* Create an issue on GitHub, if you have found a bug -* Write test cases for open bug issues -* Write fixes for open bug/feature issues, preferably with test cases included -* Contribute to the [documentation](https://nette.org/en/writing) - -Issues ------- - -Please **do not use the issue tracker to ask questions**. We will be happy to help you -on [Nette forum](https://forum.nette.org) or chat with us on [Gitter](https://gitter.im/nette/nette). - -A good bug report shouldn't leave others needing to chase you up for more -information. Please try to be as detailed as possible in your report. - -**Feature requests** are welcome. But take a moment to find out whether your idea -fits with the scope and aims of the project. It's up to *you* to make a strong -case to convince the project's developers of the merits of this feature. - -Contributing ------------- - -If you'd like to contribute, please take a moment to read [the contributing guide](https://nette.org/en/contributing). - -The best way to propose a feature is to discuss your ideas on [Nette forum](https://forum.nette.org) before implementing them. - -Please do not fix whitespace, format code, or make a purely cosmetic patch. - -Thanks! :heart: diff --git a/vendor/nette/neon/license.md b/vendor/nette/neon/license.md deleted file mode 100644 index a955f5d..0000000 --- a/vendor/nette/neon/license.md +++ /dev/null @@ -1,60 +0,0 @@ -Licenses -======== - -Good news! You may use Nette Framework under the terms of either -the New BSD License or the GNU General Public License (GPL) version 2 or 3. - -The BSD License is recommended for most projects. It is easy to understand and it -places almost no restrictions on what you can do with the framework. If the GPL -fits better to your project, you can use the framework under this license. - -You don't have to notify anyone which license you are using. You can freely -use Nette Framework in commercial projects as long as the copyright header -remains intact. - -Please be advised that the name "Nette Framework" is a protected trademark and its -usage has some limitations. So please do not use word "Nette" in the name of your -project or top-level domain, and choose a name that stands on its own merits. -If your stuff is good, it will not take long to establish a reputation for yourselves. - - -New BSD License ---------------- - -Copyright (c) 2004, 2014 David Grudl (https://davidgrudl.com) -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - * Neither the name of "Nette Framework" nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -This software is provided by the copyright holders and contributors "as is" and -any express or implied warranties, including, but not limited to, the implied -warranties of merchantability and fitness for a particular purpose are -disclaimed. In no event shall the copyright owner or contributors be liable for -any direct, indirect, incidental, special, exemplary, or consequential damages -(including, but not limited to, procurement of substitute goods or services; -loss of use, data, or profits; or business interruption) however caused and on -any theory of liability, whether in contract, strict liability, or tort -(including negligence or otherwise) arising in any way out of the use of this -software, even if advised of the possibility of such damage. - - -GNU General Public License --------------------------- - -GPL licenses are very very long, so instead of including them here we offer -you URLs with full text: - -- [GPL version 2](https://www.gnu.org/licenses/gpl-2.0.html) -- [GPL version 3](https://www.gnu.org/licenses/gpl-3.0.html) diff --git a/vendor/nette/neon/readme.md b/vendor/nette/neon/readme.md deleted file mode 100644 index 7dbd698..0000000 --- a/vendor/nette/neon/readme.md +++ /dev/null @@ -1,490 +0,0 @@ -[NEON](https://ne-on.org): Nette Object Notation -================================================ - -[![Downloads this Month](https://img.shields.io/packagist/dm/nette/neon.svg)](https://packagist.org/packages/nette/neon) -[![Tests](https://github.com/nette/neon/workflows/Tests/badge.svg?branch=master)](https://github.com/nette/neon/actions) -[![Coverage Status](https://coveralls.io/repos/github/nette/neon/badge.svg?branch=master)](https://coveralls.io/github/nette/neon?branch=master) -[![Latest Stable Version](https://poser.pugx.org/nette/neon/v/stable)](https://github.com/nette/neon/releases) -[![License](https://img.shields.io/badge/license-New%20BSD-blue.svg)](https://github.com/nette/neon/blob/master/license.md) - - -Introduction -============ - -NEON is a human-readable structured data format. In Nette, it is used for configuration files. It is also used for structured data such as settings, language translations, etc. [Try it on the sandbox](https://ne-on.org). - -NEON stands for *Nette Object Notation*. It is less complex and ungainly than XML or JSON, but provides similar capabilities. It is very similar to YAML. The main advantage is that NEON has so-called [entities](#entities), thanks to which the configuration of DI services is so sexy. And allows tabs for indentation. - -NEON is built from the ground up to be simple to use. - - -[Support Neon](https://github.com/sponsors/dg) ----------------------------------------------- - -Do you like NEON? Are you looking forward to the new features? - -[![Buy me a coffee](https://files.nette.org/icons/donation-3.svg)](https://github.com/sponsors/dg) - -Thank you! - - -Usage -===== - -Install via Composer: - -``` -composer require nette/neon -``` - -It requires PHP version 7.1 and supports PHP up to 8.1. Documentation can be found on the [website](https://doc.nette.org/neon). - -`Neon::encode()` returns `$value` converted to NEON. As the second parameter `$blockMode` you can pass true, which will create multiline output. The third parameter `$indentation` specifies the characters used for indentation (default is tab). - -```php -use Nette\Neon\Neon; - -$neon = Neon::encode($value); // Returns $value converted to NEON -$neon = Neon::encode($value, true); // Returns $value converted to multiline NEON -``` - -`Neon::decode()` converts given NEON to PHP value: - -```php -$value = Neon::decode('hello: world'); // Returns an array ['hello' => 'world'] -``` - -`Neon::decodeFile()` converts given NEON file to PHP value: - -```php -$value = Neon::decodeFile('config.neon'); -``` - -All methods throw `Nette\Neon\Exception` on error. - - -Integration -=========== - -- NetBeans (has built-in support) -- PhpStorm ([plugin](https://plugins.jetbrains.com/plugin/7060?pr)) -- Visual Studio Code ([plugin](https://marketplace.visualstudio.com/items?itemName=Kasik96.latte)) -- Sublime Text 3 ([plugin](https://github.com/FilipStryk/Nette-Latte-Neon-for-Sublime-Text-3)) -- Sublime Text 2 ([plugin](https://github.com/Michal-Mikolas/Nette-package-for-Sublime-Text-2)) - - -- [NEON for PHP](https://doc.nette.org/neon) -- [NEON for JavaScript](https://github.com/matej21/neon-js) -- [NEON for Python](https://github.com/paveldedik/neon-py). - - -You can check for syntax errors in Neon files using the `neon-lint` console command: - -```shell -vendor/bin/neon-lint -``` - -Syntax -====== - -A file written in NEON usually consists of a sequence or mapping. - - -Mappings --------- -Mapping is a set of key-value pairs, in PHP it would be called an associative array. Each pair is written as `key: value`, a space after `:` is required. The value can be anything: string, number, boolean, null, sequence, or other mapping. - -```neon -street: 742 Evergreen Terrace -city: Springfield -country: USA -``` - -In PHP, the same structure would be written as: - -```php -[ // PHP - 'street' => '742 Evergreen Terrace', - 'city' => 'Springfield', - 'country' => 'USA', -] -``` - -This notation is called a block notation because all items are on a separate line and have the same indentation (none in this case). NEON also supports inline representation for mapping, which is enclosed in brackets, indentation plays no role, and the separator of each element is either a comma or a newline: - -```neon -{street: 742 Evergreen Terrace, city: Springfield, country: USA} -``` - -This is the same written on multiple lines (indentation does not matter): - -```neon -{ - street: 742 Evergreen Terrace - city: Springfield, country: USA -} -``` - -Alternatively, `=` can be used instead of : , both in block and inline notation: - -```neon -{street=742 Evergreen Terrace, city=Springfield, country=USA} -``` - - -Sequences ---------- -Sequences are indexed arrays in PHP. They are written as lines starting with the hyphen `-` followed by a space. Again, the value can be anything: string, number, boolean, null, sequence, or other mapping. - -```neon -- Cat -- Dog -- Goldfish -``` - -In PHP, the same structure would be written as: - -```php -[ // PHP - 'Cat', - 'Dog', - 'Goldfish', -] -``` - -This notation is called a block notation because all items are on a separate line and have the same indentation (none in this case). NEON also supports inline representation for sequences, which is enclosed in brackets, indentation plays no role, and the separator of each element is either a comma or a newline: - -```neon -[Cat, Dog, Goldfish] -``` - -This is the same written on multiple lines (indentation does not matter): - -```neon -[ - Cat, Dog - Goldfish -] -``` - -Hyphens cannot be used in an inline representation. - - -Combination ------------ -Values of mappings and sequences may be other mappings and sequences. The level of indentation plays a major role. In the following example, the hyphen used to indicate sequence items has a greater indent than the `pets` key, so the items become the value of the first line: - -```neon -pets: - - Cat - - Dog -cars: - - Volvo - - Skoda -``` - -In PHP, the same structure would be written as: - -```php -[ // PHP - 'pets' => [ - 'Cat', - 'Dog', - ], - 'cars' => [ - 'Volvo', - 'Skoda', - ], -] -``` - -It is possible to combine block and inline notation: - -```neon -pets: [Cat, Dog] -cars: [ - Volvo, - Skoda, -] -``` - -Block notation can no longer be used inside an inline notation, this does not work: - -```neon -item: [ - pets: - - Cat # THIS IS NOT POSSIBLE!!! - - Dog -] -``` - -Because PHP uses the same structure for mapping and sequences, that is, arrays, both can be merged. The indentation is the same this time: - -```neon -- Cat -street: 742 Evergreen Terrace -- Goldfish -``` - -In PHP, the same structure would be written as: - -```php -[ // PHP - 'Cat', - 'street' => '742 Evergreen Terrace', - 'Goldfish', -] -``` - -Strings -------- -Strings in NEON can be enclosed in single or double quotes. But as you can see, they can also be without quotes. - -```neon -- A unquoted string in NEON -- 'A singled-quoted string in NEON' -- "A double-quoted string in NEON" -``` - -If the string contains characters that can be confused with NEON syntax (hyphens, colons, etc.), it must be enclosed in quotation marks. We recommend using single quotes because they do not use escaping. If you need to enclose a quotation mark in such a string, double it: - -```neon -'A single quote '' inside a single-quoted string' -``` - -Double quotes allow you to use escape sequences to write special characters using backslashes `\`. All escape sequences as in the JSON format are supported, plus `\_`, which is an non-breaking space, ie `\u00A0`. - -```neon -- "\t \n \r \f \b \" \\ \/ \_" -- "\u00A9" -``` - -There are other cases where you need to enclose strings in quotation marks: -- they begin or end with spaces -- look like numbers, booleans, or null -- NEON would understand them as [dates](#dates) - - -Multiline strings ------------------ - -A multiline string begins and ends with a triple quotation mark on separate lines. The indent of the first line is ignored for all lines: - -```neon -''' - first line - second line - third line - ''' -``` - -In PHP we would write the same as: - -```php -"first line\n\tsecond line\nthird line" // PHP -``` - -Escaping sequences only work for strings enclosed in double quotes instead of apostrophes: - -```neon -""" - Copyright \u00A9 -""" -``` - - -Numbers -------- -NEON understands numbers written in so-called scientific notation and also numbers in binary, octal and hexadecimal: - -```neon -- 12 # an integer -- 12.3 # a float -- +1.2e-34 # an exponential number - -- 0b11010 # binary number -- 0o666 # octal number -- 0x7A # hexa number -``` - -Nulls ------ -Null can be expressed in NEON by using `null` or by not specifying a value. Variants with a capital first or all uppercase letters are also allowed. - -```neon -a: null -b: -``` - -Booleans --------- -Boolean values are expressed in NEON using `true` / `false` or `yes` / `no`. Variants with a capital first or all uppercase letters are also allowed. - -```neon -[true, TRUE, True, false, yes, no] -``` - -Dates ------ -NEON uses the following formats to express data and automatically converts them to `DateTimeImmutable` objects: - -```neon -- 2016-06-03 # date -- 2016-06-03 19:00:00 # date & time -- 2016-06-03 19:00:00.1234 # date & microtime -- 2016-06-03 19:00:00 +0200 # date & time & timezone -- 2016-06-03 19:00:00 +02:00 # date & time & timezone -``` - - -Entities --------- -An entity is a structure that resembles a function call: - -```neon -Column(type: int, nulls: yes) -``` - -In PHP, it is parsed as an object [Nette\Neon\Entity](https://api.nette.org/3.0/Nette/Neon/Entity.html): - -```php -// PHP -new Nette\Neon\Entity('Column', ['type' => 'int', 'nulls' => true]) -``` - -Entities can also be chained: - -```neon -Column(type: int, nulls: yes) Field(id: 1) -``` - -Which is parsed in PHP as follows: - -```php -// PHP -new Nette\Neon\Entity(Nette\Neon\Neon::CHAIN, [ - new Nette\Neon\Entity('Column', ['type' => 'int', 'nulls' => true]), - new Nette\Neon\Entity('Field', ['id' => 1]), -]) -``` - -Inside the parentheses, the rules for inline notation used for mapping and sequences apply, so it can be divided into several lines and it is not necessary to add commas: - -```neon -Column( - type: int - nulls: yes -) -``` - - -Comments --------- -Comments start with `#` and all of the following characters on the right are ignored: - -```neon -# this line will be ignored by the interpreter -street: 742 Evergreen Terrace -city: Springfield # this is ignored too -country: USA -``` - - -NEON versus JSON -================ -JSON is a subset of NEON. Each JSON can therefore be parsed as NEON: - -```neon -{ -"php": { - "date.timezone": "Europe\/Prague", - "zlib.output_compression": true -}, -"database": { - "driver": "mysql", - "username": "root", - "password": "beruska92" -}, -"users": [ - "Dave", "Kryten", "Rimmer" -] -} -``` - -What if we could omit quotes? - -```neon -{ -php: { - date.timezone: Europe/Prague, - zlib.output_compression: true -}, -database: { - driver: mysql, - username: root, - password: beruska92 -}, -users: [ - Dave, Kryten, Rimmer -] -} -``` - -How about braces and commas? - -```neon -php: - date.timezone: Europe/Prague - zlib.output_compression: true - -database: - driver: mysql - username: root - password: beruska92 - -users: [ - Dave, Kryten, Rimmer -] -``` - -Are bullets more legible? - -```neon -php: - date.timezone: Europe/Prague - zlib.output_compression: true - -database: - driver: mysql - username: root - password: beruska92 - -users: - - Dave - - Kryten - - Rimmer -``` - -How about comments? - -```neon -# my web application config - -php: - date.timezone: Europe/Prague - zlib.output_compression: true # use gzip - -database: - driver: mysql - username: root - password: beruska92 - -users: - - Dave - - Kryten - - Rimmer -``` - -You found NEON syntax! - -If you like NEON, **[please make a donation now](https://github.com/sponsors/dg)**. Thank you! diff --git a/vendor/nette/neon/src/Neon/Decoder.php b/vendor/nette/neon/src/Neon/Decoder.php deleted file mode 100644 index e93454f..0000000 --- a/vendor/nette/neon/src/Neon/Decoder.php +++ /dev/null @@ -1,37 +0,0 @@ -parseToNode($input); - return $node->toValue(); - } - - - public function parseToNode(string $input): Node - { - $lexer = new Lexer; - $parser = new Parser; - $tokens = $lexer->tokenize($input); - return $parser->parse($tokens); - } -} diff --git a/vendor/nette/neon/src/Neon/Encoder.php b/vendor/nette/neon/src/Neon/Encoder.php deleted file mode 100644 index ca9e6fa..0000000 --- a/vendor/nette/neon/src/Neon/Encoder.php +++ /dev/null @@ -1,95 +0,0 @@ -valueToNode($val, $this->blockMode); - return $node->toString(); - } - - - public function valueToNode($val, bool $blockMode = false): Node - { - if ($val instanceof \DateTimeInterface) { - return new Node\LiteralNode($val); - - } elseif ($val instanceof Entity && $val->value === Neon::CHAIN) { - $node = new Node\EntityChainNode; - foreach ($val->attributes as $entity) { - $node->chain[] = $this->valueToNode($entity); - } - return $node; - - } elseif ($val instanceof Entity) { - return new Node\EntityNode( - $this->valueToNode($val->value), - $this->arrayToNodes((array) $val->attributes) - ); - - } elseif (is_object($val) || is_array($val)) { - if ($blockMode) { - $node = new Node\BlockArrayNode; - } else { - $isList = is_array($val) && (!$val || array_keys($val) === range(0, count($val) - 1)); - $node = new Node\InlineArrayNode($isList ? '[' : '{'); - } - $node->items = $this->arrayToNodes($val, $blockMode); - return $node; - - } elseif (is_string($val) && Lexer::requiresDelimiters($val)) { - return new Node\StringNode($val); - - } else { - return new Node\LiteralNode($val); - } - } - - - private function arrayToNodes($val, bool $blockMode = false): array - { - $res = []; - $counter = 0; - $hide = true; - foreach ($val as $k => $v) { - $res[] = $item = new Node\ArrayItemNode; - $item->key = $hide && $k === $counter ? null : self::valueToNode($k); - $item->value = self::valueToNode($v, $blockMode); - if ($item->value instanceof Node\BlockArrayNode) { - $item->value->indentation = $this->indentation; - } - if ($hide && is_int($k)) { - $hide = $k === $counter; - $counter = max($k + 1, $counter); - } - } - return $res; - } -} diff --git a/vendor/nette/neon/src/Neon/Entity.php b/vendor/nette/neon/src/Neon/Entity.php deleted file mode 100644 index 8cb1afb..0000000 --- a/vendor/nette/neon/src/Neon/Entity.php +++ /dev/null @@ -1,36 +0,0 @@ -value = $value; - $this->attributes = $attrs; - } - - - public static function __set_state(array $properties) - { - return new self($properties['value'], $properties['attributes']); - } -} diff --git a/vendor/nette/neon/src/Neon/Exception.php b/vendor/nette/neon/src/Neon/Exception.php deleted file mode 100644 index 0a37ad9..0000000 --- a/vendor/nette/neon/src/Neon/Exception.php +++ /dev/null @@ -1,18 +0,0 @@ - ' - \'\'\'\n (?:(?: [^\n] | \n(?![\t\ ]*+\'\'\') )*+ \n)?[\t\ ]*+\'\'\' | - """\n (?:(?: [^\n] | \n(?![\t\ ]*+""") )*+ \n)?[\t\ ]*+""" | - \' (?: \'\' | [^\'\n] )*+ \' | - " (?: \\\\. | [^"\\\\\n] )*+ " - ', - - // literal / boolean / integer / float - Token::LITERAL => ' - (?: [^#"\',:=[\]{}()\n\t\ `-] | (? '[,:=[\]{}()-]', - - // comment - Token::COMMENT => '\#.*+', - - // new line - Token::NEWLINE => '\n++', - - // whitespace - Token::WHITESPACE => '[\t\ ]++', - ]; - - - public function tokenize(string $input): TokenStream - { - $input = str_replace("\r", '', $input); - $pattern = '~(' . implode(')|(', self::PATTERNS) . ')~Amixu'; - $res = preg_match_all($pattern, $input, $tokens, PREG_SET_ORDER); - if ($res === false) { - throw new Exception('Invalid UTF-8 sequence.'); - } - - $types = array_keys(self::PATTERNS); - $offset = 0; - foreach ($tokens as &$token) { - $type = null; - for ($i = 1; $i <= count($types); $i++) { - if (!isset($token[$i])) { - break; - } elseif ($token[$i] !== '') { - $type = $types[$i - 1]; - if ($type === Token::CHAR) { - $type = $token[0]; - } - break; - } - } - $token = new Token($token[0], $offset, $type); - $offset += strlen($token->value); - } - - $stream = new TokenStream($tokens); - if ($offset !== strlen($input)) { - $s = str_replace("\n", '\n', substr($input, $offset, 40)); - $stream->error("Unexpected '$s'", count($tokens)); - } - return $stream; - } - - - public static function requiresDelimiters(string $s): bool - { - return preg_match('~[\x00-\x1F]|^[+-.]?\d|^(true|false|yes|no|on|off|null)$~Di', $s) - || !preg_match('~^' . self::PATTERNS[Token::LITERAL] . '$~Dx', $s); - } -} diff --git a/vendor/nette/neon/src/Neon/Neon.php b/vendor/nette/neon/src/Neon/Neon.php deleted file mode 100644 index eff9db6..0000000 --- a/vendor/nette/neon/src/Neon/Neon.php +++ /dev/null @@ -1,62 +0,0 @@ -blockMode = $blockMode; - $encoder->indentation = $indentation; - return $encoder->encode($value); - } - - - /** - * Converts given NEON to PHP value. - * @return mixed - */ - public static function decode(string $input) - { - $decoder = new Decoder; - return $decoder->decode($input); - } - - - /** - * Converts given NEON file to PHP value. - * @return mixed - */ - public static function decodeFile(string $file) - { - if (!is_file($file)) { - throw new Exception("File '$file' does not exist."); - } - $input = file_get_contents($file); - if (substr($input, 0, 3) === "\u{FEFF}") { // BOM - $input = substr($input, 3); - } - return self::decode($input); - } -} diff --git a/vendor/nette/neon/src/Neon/Node.php b/vendor/nette/neon/src/Neon/Node.php deleted file mode 100644 index b047a8c..0000000 --- a/vendor/nette/neon/src/Neon/Node.php +++ /dev/null @@ -1,35 +0,0 @@ -startPos = $this->endPos = $pos; - } - - - /** @param self[] $items */ - public static function itemsToArray(array $items): array - { - $res = []; - foreach ($items as $item) { - if ($item->key === null) { - $res[] = $item->value->toValue(); - } else { - $res[(string) $item->key->toValue()] = $item->value->toValue(); - } - } - return $res; - } - - - /** @param self[] $items */ - public static function itemsToInlineString(array $items): string - { - $res = ''; - foreach ($items as $item) { - $res .= ($res === '' ? '' : ', ') - . ($item->key ? $item->key->toString() . ': ' : '') - . $item->value->toString(); - } - return $res; - } - - - /** @param self[] $items */ - public static function itemsToBlockString(array $items): string - { - $res = ''; - foreach ($items as $item) { - $v = $item->value->toString(); - $res .= ($item->key ? $item->key->toString() . ':' : '-') - . ($item->value instanceof BlockArrayNode && $item->value->items - ? "\n" . $v . (substr($v, -2, 1) === "\n" ? '' : "\n") - : ' ' . $v . "\n"); - } - return $res; - } - - - public function toValue() - { - throw new \LogicException; - } - - - public function toString(): string - { - throw new \LogicException; - } - - - public function getSubNodes(): array - { - return $this->key ? [&$this->key, &$this->value] : [&$this->value]; - } -} diff --git a/vendor/nette/neon/src/Neon/Node/ArrayNode.php b/vendor/nette/neon/src/Neon/Node/ArrayNode.php deleted file mode 100644 index 4dad246..0000000 --- a/vendor/nette/neon/src/Neon/Node/ArrayNode.php +++ /dev/null @@ -1,36 +0,0 @@ -items); - } - - - public function getSubNodes(): array - { - $res = []; - foreach ($this->items as &$item) { - $res[] = &$item; - } - return $res; - } -} diff --git a/vendor/nette/neon/src/Neon/Node/BlockArrayNode.php b/vendor/nette/neon/src/Neon/Node/BlockArrayNode.php deleted file mode 100644 index ae23d5c..0000000 --- a/vendor/nette/neon/src/Neon/Node/BlockArrayNode.php +++ /dev/null @@ -1,35 +0,0 @@ -indentation = $indentation; - $this->startPos = $this->endPos = $pos; - } - - - public function toString(): string - { - if (count($this->items) === 0) { - return '[]'; - } - $res = ArrayItemNode::itemsToBlockString($this->items); - return preg_replace('#^(?=.)#m', $this->indentation, $res); - } -} diff --git a/vendor/nette/neon/src/Neon/Node/EntityChainNode.php b/vendor/nette/neon/src/Neon/Node/EntityChainNode.php deleted file mode 100644 index 8501dff..0000000 --- a/vendor/nette/neon/src/Neon/Node/EntityChainNode.php +++ /dev/null @@ -1,55 +0,0 @@ -chain = $chain; - $this->startPos = $startPos; - $this->endPos = $endPos ?? $startPos; - } - - - public function toValue(): Neon\Entity - { - $entities = []; - foreach ($this->chain as $item) { - $entities[] = $item->toValue(); - } - return new Neon\Entity(Neon\Neon::CHAIN, $entities); - } - - - public function toString(): string - { - return implode('', array_map(function ($entity) { return $entity->toString(); }, $this->chain)); - } - - - public function getSubNodes(): array - { - $res = []; - foreach ($this->chain as &$item) { - $res[] = &$item; - } - return $res; - } -} diff --git a/vendor/nette/neon/src/Neon/Node/EntityNode.php b/vendor/nette/neon/src/Neon/Node/EntityNode.php deleted file mode 100644 index 81a476e..0000000 --- a/vendor/nette/neon/src/Neon/Node/EntityNode.php +++ /dev/null @@ -1,61 +0,0 @@ -value = $value; - $this->attributes = $attributes; - $this->startPos = $startPos; - $this->endPos = $endPos ?? $startPos; - } - - - public function toValue(): Entity - { - return new Entity( - $this->value->toValue(), - ArrayItemNode::itemsToArray($this->attributes) - ); - } - - - public function toString(): string - { - return $this->value->toString() - . '(' - . ($this->attributes ? ArrayItemNode::itemsToInlineString($this->attributes) : '') - . ')'; - } - - - public function getSubNodes(): array - { - $res = [&$this->value]; - foreach ($this->attributes as &$item) { - $res[] = &$item; - } - return $res; - } -} diff --git a/vendor/nette/neon/src/Neon/Node/InlineArrayNode.php b/vendor/nette/neon/src/Neon/Node/InlineArrayNode.php deleted file mode 100644 index 6618c25..0000000 --- a/vendor/nette/neon/src/Neon/Node/InlineArrayNode.php +++ /dev/null @@ -1,33 +0,0 @@ -bracket = $bracket; - $this->startPos = $this->endPos = $pos; - } - - - public function toString(): string - { - return $this->bracket - . ArrayItemNode::itemsToInlineString($this->items) - . ['[' => ']', '{' => '}', '(' => ')'][$this->bracket]; - } -} diff --git a/vendor/nette/neon/src/Neon/Node/LiteralNode.php b/vendor/nette/neon/src/Neon/Node/LiteralNode.php deleted file mode 100644 index 2f8c2e4..0000000 --- a/vendor/nette/neon/src/Neon/Node/LiteralNode.php +++ /dev/null @@ -1,97 +0,0 @@ - true, 'True' => true, 'TRUE' => true, 'yes' => true, 'Yes' => true, 'YES' => true, 'on' => true, 'On' => true, 'ON' => true, - 'false' => false, 'False' => false, 'FALSE' => false, 'no' => false, 'No' => false, 'NO' => false, 'off' => false, 'Off' => false, 'OFF' => false, - 'null' => null, 'Null' => null, 'NULL' => null, - ]; - - private const DEPRECATED_TYPES = ['on' => 1, 'On' => 1, 'ON' => 1, 'off' => 1, 'Off' => 1, 'OFF' => 1]; - - private const PATTERN_DATETIME = '#\d\d\d\d-\d\d?-\d\d?(?:(?:[Tt]| ++)\d\d?:\d\d:\d\d(?:\.\d*+)? *+(?:Z|[-+]\d\d?(?::?\d\d)?)?)?$#DA'; - private const PATTERN_HEX = '#0x[0-9a-fA-F]++$#DA'; - private const PATTERN_OCTAL = '#0o[0-7]++$#DA'; - private const PATTERN_BINARY = '#0b[0-1]++$#DA'; - - /** @var mixed */ - public $value; - - - public function __construct($value, int $pos = null) - { - $this->value = $value; - $this->startPos = $this->endPos = $pos; - } - - - public function toValue() - { - return $this->value; - } - - - /** @return mixed */ - public static function parse(string $value, bool $isKey = false) - { - if (!$isKey && array_key_exists($value, self::SIMPLE_TYPES)) { - if (isset(self::DEPRECATED_TYPES[$value])) { - trigger_error("Neon: keyword '$value' is deprecated, use true/yes or false/no.", E_USER_DEPRECATED); - } - return self::SIMPLE_TYPES[$value]; - - } elseif (is_numeric($value)) { - return $value * 1; - - } elseif (preg_match(self::PATTERN_HEX, $value)) { - return hexdec($value); - - } elseif (preg_match(self::PATTERN_OCTAL, $value)) { - return octdec($value); - - } elseif (preg_match(self::PATTERN_BINARY, $value)) { - return bindec($value); - - } elseif (!$isKey && preg_match(self::PATTERN_DATETIME, $value)) { - return new \DateTimeImmutable($value); - - } else { - return $value; - } - } - - - public function toString(): string - { - if ($this->value instanceof \DateTimeInterface) { - return $this->value->format('Y-m-d H:i:s O'); - - } elseif (is_string($this->value)) { - return $this->value; - - } elseif (is_float($this->value)) { - $res = json_encode($this->value); - return strpos($res, '.') === false ? $res . '.0' : $res; - - } elseif (is_int($this->value) || is_bool($this->value) || $this->value === null) { - return json_encode($this->value); - - } else { - throw new \LogicException; - } - } -} diff --git a/vendor/nette/neon/src/Neon/Node/StringNode.php b/vendor/nette/neon/src/Neon/Node/StringNode.php deleted file mode 100644 index 236a8a5..0000000 --- a/vendor/nette/neon/src/Neon/Node/StringNode.php +++ /dev/null @@ -1,92 +0,0 @@ - "\t", 'n' => "\n", 'r' => "\r", 'f' => "\x0C", 'b' => "\x08", '"' => '"', '\\' => '\\', '/' => '/', '_' => "\u{A0}", - ]; - - /** @var string */ - public $value; - - - public function __construct(string $value, int $pos = null) - { - $this->value = $value; - $this->startPos = $this->endPos = $pos; - } - - - public function toValue(): string - { - return $this->value; - } - - - public static function parse(string $s): string - { - if (preg_match('#^...\n++([\t ]*+)#', $s, $m)) { // multiline - $res = substr($s, 3, -3); - $res = str_replace("\n" . $m[1], "\n", $res); - $res = preg_replace('#^\n|\n[\t ]*+$#D', '', $res); - } else { - $res = substr($s, 1, -1); - if ($s[0] === "'") { - $res = str_replace("''", "'", $res); - } - } - if ($s[0] === "'") { - return $res; - } - return preg_replace_callback( - '#\\\\(?:ud[89ab][0-9a-f]{2}\\\\ud[c-f][0-9a-f]{2}|u[0-9a-f]{4}|x[0-9a-f]{2}|.)#i', - function (array $m): string { - $sq = $m[0]; - if (isset(self::ESCAPE_SEQUENCES[$sq[1]])) { - return self::ESCAPE_SEQUENCES[$sq[1]]; - } elseif ($sq[1] === 'u' && strlen($sq) >= 6) { - if (($res = json_decode('"' . $sq . '"')) !== null) { - return $res; - } - throw new Nette\Neon\Exception("Invalid UTF-8 sequence $sq"); - } elseif ($sq[1] === 'x' && strlen($sq) === 4) { - trigger_error("Neon: '$sq' is deprecated, use '\\uXXXX' instead.", E_USER_DEPRECATED); - return chr(hexdec(substr($sq, 2))); - } else { - throw new Nette\Neon\Exception("Invalid escaping sequence $sq"); - } - }, - $res - ); - } - - - public function toString(): string - { - $res = json_encode($this->value, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); - if ($res === false) { - throw new Nette\Neon\Exception('Invalid UTF-8 sequence: ' . $this->value); - } - if (strpos($this->value, "\n") !== false) { - $res = preg_replace_callback('#[^\\\\]|\\\\(.)#s', function ($m) { - return ['n' => "\n\t", 't' => "\t", '"' => '"'][$m[1] ?? ''] ?? $m[0]; - }, $res); - $res = '"""' . "\n\t" . substr($res, 1, -1) . "\n" . '"""'; - } - return $res; - } -} diff --git a/vendor/nette/neon/src/Neon/Parser.php b/vendor/nette/neon/src/Neon/Parser.php deleted file mode 100644 index 8438226..0000000 --- a/vendor/nette/neon/src/Neon/Parser.php +++ /dev/null @@ -1,214 +0,0 @@ -tokens = $tokens; - while ($this->tokens->consume(Token::NEWLINE)); - $node = $this->parseBlock($this->tokens->getIndentation()); - - while ($this->tokens->consume(Token::NEWLINE)); - if ($this->tokens->isNext()) { - $this->tokens->error(); - } - return $node; - } - - - private function parseBlock(string $indent, bool $onlyBullets = false): Node - { - $res = new Node\BlockArrayNode($indent, $this->tokens->getPos()); - $keyCheck = []; - - loop: - $item = new Node\ArrayItemNode($this->tokens->getPos()); - if ($this->tokens->consume('-')) { - // continue - } elseif (!$this->tokens->isNext() || $onlyBullets) { - return $res->items - ? $res - : new Node\LiteralNode(null, $this->tokens->getPos()); - - } else { - $value = $this->parseValue(); - if ($this->tokens->consume(':', '=')) { - $this->checkArrayKey($value, $keyCheck); - $item->key = $value; - } else { - if ($res->items) { - $this->tokens->error(); - } - return $value; - } - } - - $res->items[] = $item; - $item->value = new Node\LiteralNode(null, $this->tokens->getPos()); - - if ($this->tokens->consume(Token::NEWLINE)) { - while ($this->tokens->consume(Token::NEWLINE)); - $nextIndent = $this->tokens->getIndentation(); - - if (strncmp($nextIndent, $indent, min(strlen($nextIndent), strlen($indent)))) { - $this->tokens->error('Invalid combination of tabs and spaces'); - - } elseif (strlen($nextIndent) > strlen($indent)) { // open new block - $item->value = $this->parseBlock($nextIndent); - - } elseif (strlen($nextIndent) < strlen($indent)) { // close block - return $res; - - } elseif ($item->key !== null && $this->tokens->isNext('-')) { // special dash subblock - $item->value = $this->parseBlock($indent, true); - } - } elseif ($item->key === null) { - $item->value = $this->parseBlock($indent . ' '); // open new block after dash - - } elseif ($this->tokens->isNext()) { - $item->value = $this->parseValue(); - if ($this->tokens->isNext() && !$this->tokens->isNext(Token::NEWLINE)) { - $this->tokens->error(); - } - } - - if ($item->value instanceof Node\BlockArrayNode) { - $item->value->indentation = substr($item->value->indentation, strlen($indent)); - } - - $res->endPos = $item->endPos = $item->value->endPos; - - while ($this->tokens->consume(Token::NEWLINE)); - if (!$this->tokens->isNext()) { - return $res; - } - - $nextIndent = $this->tokens->getIndentation(); - if (strncmp($nextIndent, $indent, min(strlen($nextIndent), strlen($indent)))) { - $this->tokens->error('Invalid combination of tabs and spaces'); - - } elseif (strlen($nextIndent) > strlen($indent)) { - $this->tokens->error('Bad indentation'); - - } elseif (strlen($nextIndent) < strlen($indent)) { // close block - return $res; - } - - goto loop; - } - - - private function parseValue(): Node - { - if ($token = $this->tokens->consume(Token::STRING)) { - try { - $node = new Node\StringNode(Node\StringNode::parse($token->value), $this->tokens->getPos() - 1); - } catch (Exception $e) { - $this->tokens->error($e->getMessage(), $this->tokens->getPos() - 1); - } - - } elseif ($token = $this->tokens->consume(Token::LITERAL)) { - $pos = $this->tokens->getPos() - 1; - $node = new Node\LiteralNode(Node\LiteralNode::parse($token->value, $this->tokens->isNext(':', '=')), $pos); - - } elseif ($this->tokens->isNext('[', '(', '{')) { - $node = $this->parseBraces(); - - } else { - $this->tokens->error(); - } - return $this->parseEntity($node); - } - - - private function parseEntity(Node $node): Node - { - if (!$this->tokens->isNext('(')) { - return $node; - } - - $attributes = $this->parseBraces(); - $entities[] = new Node\EntityNode($node, $attributes->items, $node->startPos, $attributes->endPos); - - while ($token = $this->tokens->consume(Token::LITERAL)) { - $valueNode = new Node\LiteralNode(Node\LiteralNode::parse($token->value), $this->tokens->getPos() - 1); - if ($this->tokens->isNext('(')) { - $attributes = $this->parseBraces(); - $entities[] = new Node\EntityNode($valueNode, $attributes->items, $valueNode->startPos, $attributes->endPos); - } else { - $entities[] = new Node\EntityNode($valueNode, [], $valueNode->startPos); - break; - } - } - return count($entities) === 1 - ? $entities[0] - : new Node\EntityChainNode($entities, $node->startPos, end($entities)->endPos); - } - - - private function parseBraces(): Node\InlineArrayNode - { - $token = $this->tokens->consume(); - $endBrace = ['[' => ']', '{' => '}', '(' => ')'][$token->value]; - $res = new Node\InlineArrayNode($token->value, $this->tokens->getPos() - 1); - $keyCheck = []; - - loop: - while ($this->tokens->consume(Token::NEWLINE)); - if ($this->tokens->consume($endBrace)) { - $res->endPos = $this->tokens->getPos() - 1; - return $res; - } - - $res->items[] = $item = new Node\ArrayItemNode($this->tokens->getPos()); - $value = $this->parseValue(); - - if ($this->tokens->consume(':', '=')) { - $this->checkArrayKey($value, $keyCheck); - $item->key = $value; - $item->value = $this->tokens->isNext(Token::NEWLINE, ',', $endBrace) - ? new Node\LiteralNode(null, $this->tokens->getPos()) - : $this->parseValue(); - } else { - $item->value = $value; - } - $item->endPos = $item->value->endPos; - - if ($this->tokens->consume(',', Token::NEWLINE)) { - goto loop; - } - while ($this->tokens->consume(Token::NEWLINE)); - if (!$this->tokens->isNext($endBrace)) { - $this->tokens->error(); - } - goto loop; - } - - - private function checkArrayKey(Node $key, array &$arr): void - { - if ((!$key instanceof Node\StringNode && !$key instanceof Node\LiteralNode) || !is_scalar($key->value)) { - $this->tokens->error('Unacceptable key', $key->startPos); - } - $k = (string) $key->value; - if (array_key_exists($k, $arr)) { - $this->tokens->error("Duplicated key '$k'", $key->startPos); - } - $arr[$k] = true; - } -} diff --git a/vendor/nette/neon/src/Neon/Token.php b/vendor/nette/neon/src/Neon/Token.php deleted file mode 100644 index c30be3a..0000000 --- a/vendor/nette/neon/src/Neon/Token.php +++ /dev/null @@ -1,39 +0,0 @@ -value = $value; - $this->offset = $offset; - $this->type = $type; - } -} diff --git a/vendor/nette/neon/src/Neon/TokenStream.php b/vendor/nette/neon/src/Neon/TokenStream.php deleted file mode 100644 index b30d046..0000000 --- a/vendor/nette/neon/src/Neon/TokenStream.php +++ /dev/null @@ -1,89 +0,0 @@ -tokens = $tokens; - } - - - public function getPos(): int - { - return $this->pos; - } - - - /** @return Token[] */ - public function getTokens(): array - { - return $this->tokens; - } - - - public function isNext(...$types): bool - { - while (in_array($this->tokens[$this->pos]->type ?? null, [Token::COMMENT, Token::WHITESPACE], true)) { - $this->pos++; - } - return $types - ? in_array($this->tokens[$this->pos]->type ?? null, $types, true) - : isset($this->tokens[$this->pos]); - } - - - public function consume(...$types): ?Token - { - return $this->isNext(...$types) - ? $this->tokens[$this->pos++] - : null; - } - - - public function getIndentation(): string - { - return in_array($this->tokens[$this->pos - 2]->type ?? null, [Token::NEWLINE, null], true) - && ($this->tokens[$this->pos - 1]->type ?? null) === Token::WHITESPACE - ? $this->tokens[$this->pos - 1]->value - : ''; - } - - - /** @return never */ - public function error(string $message = null, int $pos = null): void - { - $pos = $pos ?? $this->pos; - $input = ''; - foreach ($this->tokens as $i => $token) { - if ($i >= $pos) { - break; - } - $input .= $token->value; - } - $line = substr_count($input, "\n") + 1; - $col = strlen($input) - strrpos("\n" . $input, "\n") + 1; - $token = $this->tokens[$pos] ?? null; - $message = $message ?? 'Unexpected ' . ($token === null - ? 'end' - : "'" . str_replace("\n", '', substr($this->tokens[$pos]->value, 0, 40)) . "'"); - throw new Exception("$message on line $line, column $col."); - } -} diff --git a/vendor/nette/neon/src/Neon/Traverser.php b/vendor/nette/neon/src/Neon/Traverser.php deleted file mode 100644 index f25bfe4..0000000 --- a/vendor/nette/neon/src/Neon/Traverser.php +++ /dev/null @@ -1,36 +0,0 @@ -callback = $callback; - return $this->traverseNode($node); - } - - - private function traverseNode(Node $node): Node - { - $node = ($this->callback)($node) ?? $node; - foreach ($node->getSubNodes() as &$subnode) { - $subnode = $this->traverseNode($subnode); - } - return $node; - } -} diff --git a/vendor/nette/php-generator/composer.json b/vendor/nette/php-generator/composer.json deleted file mode 100644 index 388d21c..0000000 --- a/vendor/nette/php-generator/composer.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "nette/php-generator", - "description": "🐘 Nette PHP Generator: generates neat PHP code for you. Supports new PHP 8.1 features.", - "keywords": ["nette", "php", "code", "scaffolding"], - "homepage": "https://nette.org", - "license": ["BSD-3-Clause", "GPL-2.0-only", "GPL-3.0-only"], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "require": { - "php": ">=7.2 <8.2", - "nette/utils": "^3.1.2" - }, - "require-dev": { - "nette/tester": "^2.4", - "nikic/php-parser": "^4.13", - "tracy/tracy": "^2.8", - "phpstan/phpstan": "^0.12" - }, - "suggest": { - "nikic/php-parser": "to use ClassType::withBodiesFrom() & GlobalFunction::withBodyFrom()" - }, - "autoload": { - "classmap": ["src/"] - }, - "minimum-stability": "dev", - "scripts": { - "phpstan": "phpstan analyse", - "tester": "tester tests -s" - }, - "extra": { - "branch-alias": { - "dev-master": "3.6-dev" - } - } -} diff --git a/vendor/nette/php-generator/license.md b/vendor/nette/php-generator/license.md deleted file mode 100644 index cf741bd..0000000 --- a/vendor/nette/php-generator/license.md +++ /dev/null @@ -1,60 +0,0 @@ -Licenses -======== - -Good news! You may use Nette Framework under the terms of either -the New BSD License or the GNU General Public License (GPL) version 2 or 3. - -The BSD License is recommended for most projects. It is easy to understand and it -places almost no restrictions on what you can do with the framework. If the GPL -fits better to your project, you can use the framework under this license. - -You don't have to notify anyone which license you are using. You can freely -use Nette Framework in commercial projects as long as the copyright header -remains intact. - -Please be advised that the name "Nette Framework" is a protected trademark and its -usage has some limitations. So please do not use word "Nette" in the name of your -project or top-level domain, and choose a name that stands on its own merits. -If your stuff is good, it will not take long to establish a reputation for yourselves. - - -New BSD License ---------------- - -Copyright (c) 2004, 2014 David Grudl (https://davidgrudl.com) -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - * Neither the name of "Nette Framework" nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -This software is provided by the copyright holders and contributors "as is" and -any express or implied warranties, including, but not limited to, the implied -warranties of merchantability and fitness for a particular purpose are -disclaimed. In no event shall the copyright owner or contributors be liable for -any direct, indirect, incidental, special, exemplary, or consequential damages -(including, but not limited to, procurement of substitute goods or services; -loss of use, data, or profits; or business interruption) however caused and on -any theory of liability, whether in contract, strict liability, or tort -(including negligence or otherwise) arising in any way out of the use of this -software, even if advised of the possibility of such damage. - - -GNU General Public License --------------------------- - -GPL licenses are very very long, so instead of including them here we offer -you URLs with full text: - -- [GPL version 2](http://www.gnu.org/licenses/gpl-2.0.html) -- [GPL version 3](http://www.gnu.org/licenses/gpl-3.0.html) diff --git a/vendor/nette/php-generator/readme.md b/vendor/nette/php-generator/readme.md deleted file mode 100644 index d3cfe48..0000000 --- a/vendor/nette/php-generator/readme.md +++ /dev/null @@ -1,779 +0,0 @@ -Nette PHP Generator -=================== - -[![Downloads this Month](https://img.shields.io/packagist/dm/nette/php-generator.svg)](https://packagist.org/packages/nette/php-generator) -[![Tests](https://github.com/nette/php-generator/workflows/Tests/badge.svg?branch=master)](https://github.com/nette/php-generator/actions) -[![Coverage Status](https://coveralls.io/repos/github/nette/php-generator/badge.svg?branch=master&v=1)](https://coveralls.io/github/nette/php-generator?branch=master) -[![Latest Stable Version](https://poser.pugx.org/nette/php-generator/v/stable)](https://github.com/nette/php-generator/releases) -[![License](https://img.shields.io/badge/license-New%20BSD-blue.svg)](https://github.com/nette/php-generator/blob/master/license.md) - - -Introduction ------------- - -Do you need to generate PHP code of classes, functions, namespaces, etc.? This library with a friendly API will help you. - -Documentation can be found on the [website](https://doc.nette.org/php-generator). - - -[Support Me](https://github.com/sponsors/dg) --------------------------------------------- - -Do you like PHP Generator? Are you looking forward to the new features? - -[![Buy me a coffee](https://files.nette.org/icons/donation-3.svg)](https://github.com/sponsors/dg) - -Thank you! - - -Installation ------------- - -```shell -composer require nette/php-generator -``` - -- PhpGenerator 3.6 is compatible with PHP 7.2 to 8.1 -- PhpGenerator 3.2 – 3.5 is compatible with PHP 7.1 to 8.0 -- PhpGenerator 3.1 is compatible with PHP 7.1 to 7.3 -- PhpGenerator 3.0 is compatible with PHP 7.0 to 7.3 -- PhpGenerator 2.6 is compatible with PHP 5.6 to 7.3 - - - -Classes -------- - -Let's start with a straightforward example of generating class using [ClassType](https://api.nette.org/php-generator/Nette/PhpGenerator/ClassType.html): - -```php -$class = new Nette\PhpGenerator\ClassType('Demo'); - -$class - ->setFinal() - ->setExtends(ParentClass::class) - ->addImplement(Countable::class) - ->addComment("Description of class.\nSecond line\n") - ->addComment('@property-read Nette\Forms\Form $form'); - -// to generate PHP code simply cast to string or use echo: -echo $class; -``` - -It will render this result: - -```php -/** - * Description of class. - * Second line - * - * @property-read Nette\Forms\Form $form - */ -final class Demo extends ParentClass implements Countable -{ -} -``` - -We can also use a printer to generate the code, which, unlike `echo $class`, we will be able to further configure: - -```php -$printer = new Nette\PhpGenerator\Printer; -echo $printer->printClass($class); -``` - -We can add constants ([Constant](https://api.nette.org/php-generator/Nette/PhpGenerator/Constant.html)) and properties ([Property](https://api.nette.org/php-generator/Nette/PhpGenerator/Property.html)): - -```php -$class->addConstant('ID', 123) - ->setProtected() // constant visiblity - ->setFinal(); - -$class->addProperty('items', [1, 2, 3]) - ->setPrivate() // or setVisibility('private') - ->setStatic() - ->addComment('@var int[]'); - -$class->addProperty('list') - ->setType('array') - ->setNullable() - ->setInitialized(); // prints '= null' -``` - -It generates: - -```php -final protected const ID = 123; - -/** @var int[] */ -private static $items = [1, 2, 3]; - -public ?array $list = null; -``` - -And we can add methods with parameters: - -```php -$method = $class->addMethod('count') - ->addComment('Count it.') - ->addComment('@return int') - ->setFinal() - ->setProtected() - ->setReturnType('int') // method return type - ->setReturnNullable() // nullable return type - ->setBody('return count($items ?: $this->items);'); - -$method->addParameter('items', []) // $items = [] - ->setReference() // &$items = [] - ->setType('array'); // array &$items = [] -``` - -It results in: - -```php -/** - * Count it. - * @return int - */ -final protected function count(array &$items = []): ?int -{ - return count($items ?: $this->items); -} -``` - -Promoted parameters introduced by PHP 8.0 can be passed to the constructor: - -```php -$method = $class->addMethod('__construct'); -$method->addPromotedParameter('name'); -$method->addPromotedParameter('args', []) - ->setPrivate(); -``` - -It results in: - -```php -public function __construct( - public $name, - private $args = [], -) { -} -``` - -Readonly properties introduced by PHP 8.1 can be marked via `setReadOnly()`. - ------- - -If the added property, constant, method or parameter already exist, it will be overwritten. - -Members can be removed using `removeProperty()`, `removeConstant()`, `removeMethod()` or `removeParameter()`. - -You can also add existing `Method`, `Property` or `Constant` objects to the class: - -```php -$method = new Nette\PhpGenerator\Method('getHandle'); -$property = new Nette\PhpGenerator\Property('handle'); -$const = new Nette\PhpGenerator\Constant('ROLE'); - -$class = (new Nette\PhpGenerator\ClassType('Demo')) - ->addMember($method) - ->addMember($property) - ->addMember($const); -``` - -You can clone existing methods, properties and constants with a different name using `cloneWithName()`: - -```php -$methodCount = $class->getMethod('count'); -$methodRecount = $methodCount->cloneWithName('recount'); -$class->addMember($methodRecount); -``` - -Types ------ - -Each type or union/intersection type can be passed as a string, you can also use predefined constants for native types: - -```php -use Nette\PhpGenerator\Type; - -$member->setType('array'); // or Type::ARRAY; -$member->setType('array|string'); // or Type::union('array', 'string') -$member->setType('Foo&Bar'); // or Type::intersection(Foo::class, Bar::class) -$member->setType(null); // removes type -``` - -The same applies to the method `setReturnType()`. - - -Tabs versus Spaces ------------------- - -The generated code uses tabs for indentation. If you want to have the output compatible with PSR-2 or PSR-12, use `PsrPrinter`: - -```php -$class = new Nette\PhpGenerator\ClassType('Demo'); -// ... - -$printer = new Nette\PhpGenerator\PsrPrinter; -echo $printer->printClass($class); // 4 spaces indentation -``` - - -Interface or Trait ------------------- - -You can create interfaces and traits: - -```php -$interface = Nette\PhpGenerator\ClassType::interface('MyInterface'); -$trait = Nette\PhpGenerator\ClassType::trait('MyTrait'); -// in a similar way $class = Nette\PhpGenerator\ClassType::class('MyClass'); -``` - -Enums ------ - -You can easily create the enums that PHP 8.1 brings: - -```php -$enum = Nette\PhpGenerator\ClassType::enum('Suit'); -$enum->addCase('Clubs'); -$enum->addCase('Diamonds'); -$enum->addCase('Hearts'); -$enum->addCase('Spades'); - -echo $enum; -``` - -Result: - -```php -enum Suit -{ - case Clubs; - case Diamonds; - case Hearts; - case Spades; -} -``` - -You can also define scalar equivalents for cases to create a backed enum: - -```php -$enum->addCase('Clubs', '♣'); -$enum->addCase('Diamonds', '♦'); -``` - -It is possible to add a comment or [attributes](#attributes) to each case using `addComment()` or `addAttribute()`. - - -Literals --------- - -With `Literal` you can pass arbitrary PHP code to, for example, default property or parameter values etc: - -```php -use Nette\PhpGenerator\Literal; - -$class = new Nette\PhpGenerator\ClassType('Demo'); - -$class->addProperty('foo', new Literal('Iterator::SELF_FIRST')); - -$class->addMethod('bar') - ->addParameter('id', new Literal('1 + 2')); - -echo $class; -``` - -Result: - -```php -class Demo -{ - public $foo = Iterator::SELF_FIRST; - - public function bar($id = 1 + 2) - { - } -} -``` - -You can also pass parameters to `Literal` and have it formatted into valid PHP code using [special placeholders](#method-and-function-body-generator): - -```php -new Literal('substr(?, ?)', [$a, $b]); -// generates, for example: substr('hello', 5); -``` - - - -Using Traits ------------- - -```php -$class = new Nette\PhpGenerator\ClassType('Demo'); -$class->addTrait('SmartObject'); -$class->addTrait('MyTrait', true) - ->addResolution('sayHello as protected') - ->addComment('@use MyTrait'); -echo $class; -``` - -Result: - -```php -class Demo -{ - use SmartObject; - /** @use MyTrait */ - use MyTrait { - sayHello as protected; - } -} -``` - -Anonymous Class ---------------- - -Give `null` as the name and you have an anonymous class: - -```php -$class = new Nette\PhpGenerator\ClassType(null); -$class->addMethod('__construct') - ->addParameter('foo'); - -echo '$obj = new class ($val) ' . $class . ';'; -``` - -Result: - -```php -$obj = new class ($val) { - - public function __construct($foo) - { - } -}; -``` - -Global Function ---------------- - -Code of functions will generate class [GlobalFunction](https://api.nette.org/php-generator/Nette/PhpGenerator/GlobalFunction.html): - -```php -$function = new Nette\PhpGenerator\GlobalFunction('foo'); -$function->setBody('return $a + $b;'); -$function->addParameter('a'); -$function->addParameter('b'); -echo $function; - -// or use PsrPrinter for output compatible with PSR-2 / PSR-12 -// echo (new Nette\PhpGenerator\PsrPrinter)->printFunction($function); -``` - -Result: - -```php -function foo($a, $b) -{ - return $a + $b; -} -``` - -Closure -------- - -Code of closures will generate class [Closure](https://api.nette.org/php-generator/Nette/PhpGenerator/Closure.html): - -```php -$closure = new Nette\PhpGenerator\Closure; -$closure->setBody('return $a + $b;'); -$closure->addParameter('a'); -$closure->addParameter('b'); -$closure->addUse('c') - ->setReference(); -echo $closure; - -// or use PsrPrinter for output compatible with PSR-2 / PSR-12 -// echo (new Nette\PhpGenerator\PsrPrinter)->printClosure($closure); -``` - -Result: - -```php -function ($a, $b) use (&$c) { - return $a + $b; -} -``` - -Arrow Function --------------- - -You can also print closure as arrow function using printer: - -```php -$closure = new Nette\PhpGenerator\Closure; -$closure->setBody('$a + $b'); -$closure->addParameter('a'); -$closure->addParameter('b'); - -// or use PsrPrinter for output compatible with PSR-2 / PSR-12 -echo (new Nette\PhpGenerator\Printer)->printArrowFunction($closure); -``` - -Result: - -```php -fn($a, $b) => $a + $b -``` - -Attributes ----------- - -You can add PHP 8 attributes to all classes, methods, properties, constants, enum cases, functions, closures and parameters. - -```php -$class = new Nette\PhpGenerator\ClassType('Demo'); -$class->addAttribute('Deprecated'); - -$class->addProperty('list') - ->addAttribute('WithArguments', [1, 2]); - -$method = $class->addMethod('count') - ->addAttribute('Foo\Cached', ['mode' => true]); - -$method->addParameter('items') - ->addAttribute('Bar'); - -echo $class; -``` - -Result: - -```php -#[Deprecated] -class Demo -{ - #[WithArguments(1, 2)] - public $list; - - - #[Foo\Cached(mode: true)] - public function count(#[Bar] $items) - { - } -} -``` - -Method and Function Body Generator ----------------------------------- - -The body can be passed to the `setBody()` method at once or sequentially (line by line) by repeatedly calling `addBody()`: - -```php -$function = new Nette\PhpGenerator\GlobalFunction('foo'); -$function->addBody('$a = rand(10, 20);'); -$function->addBody('return $a;'); -echo $function; -``` - -Result - -```php -function foo() -{ - $a = rand(10, 20); - return $a; -} -``` - -You can use special placeholders for handy way to inject variables. - -Simple placeholders `?` - -```php -$str = 'any string'; -$num = 3; -$function = new Nette\PhpGenerator\GlobalFunction('foo'); -$function->addBody('return substr(?, ?);', [$str, $num]); -echo $function; -``` - -Result: - -```php -function foo() -{ - return substr('any string', 3); -} -``` - -Variadic placeholder `...?` - -```php -$items = [1, 2, 3]; -$function = new Nette\PhpGenerator\GlobalFunction('foo'); -$function->setBody('myfunc(...?);', [$items]); -echo $function; -``` - -Result: - -```php -function foo() -{ - myfunc(1, 2, 3); -} -``` - -You can also use PHP 8 named parameters using placeholder `...?:` - -```php -$items = ['foo' => 1, 'bar' => true]; -$function->setBody('myfunc(...?:);', [$items]); - -// myfunc(foo: 1, bar: true); -``` - -Escape placeholder using slash `\?` - -```php -$num = 3; -$function = new Nette\PhpGenerator\GlobalFunction('foo'); -$function->addParameter('a'); -$function->addBody('return $a \? 10 : ?;', [$num]); -echo $function; -``` - -Result: - -```php -function foo($a) -{ - return $a ? 10 : 3; -} -``` - -Namespace ---------- - -Classes, traits, interfaces and enums (hereinafter classes) can be grouped into namespaces ([PhpNamespace](https://api.nette.org/php-generator/Nette/PhpGenerator/PhpNamespace.html)): - -```php -$namespace = new Nette\PhpGenerator\PhpNamespace('Foo'); - -// create new classes in the namespace -$class = $namespace->addClass('Task'); -$interface = $namespace->addInterface('Countable'); -$trait = $namespace->addTrait('NameAware'); - -// or insert an existing class into the namespace -$class = new Nette\PhpGenerator\ClassType('Task'); -$namespace->add($class); -``` - -If the class already exists, it will be overwritten. - -You can define use-statements: - -```php -// use Http\Request; -$namespace->addUse(Http\Request::class); -// use Http\Request as HttpReq; -$namespace->addUse(Http\Request::class, 'HttpReq'); -// use function iter\range; -$namespace->addUseFunction('iter\range'); -``` - -To simplify a fully qualified class, function or constant name according to the defined aliases, use the `simplifyName` method: - -```php -echo $namespace->simplifyName('Foo\Bar'); // 'Bar', because 'Foo' is current namespace -echo $namespace->simplifyName('iter\range', $namespace::NAME_FUNCTION); // 'range', because of the defined use-statement -``` - -Conversely, you can convert a simplified class, function or constant name to a fully qualified one using the `resolveName` method: - -```php -echo $namespace->resolveName('Bar'); // 'Foo\Bar' -echo $namespace->resolveName('range', $namespace::NAME_FUNCTION); // 'iter\range' -``` - -Class Names Resolving ---------------------- - -**When the class is part of the namespace, it is rendered slightly differently**: all types (ie. type hints, return types, parent class name, -implemented interfaces, used traits and attributes) are automatically *resolved* (unless you turn it off, see below). -It means that you have to **use full class names** in definitions and they will be replaced -with aliases (according to the use-statements) or fully qualified names in the resulting code: - -```php -$namespace = new Nette\PhpGenerator\PhpNamespace('Foo'); -$namespace->addUse('Bar\AliasedClass'); - -$class = $namespace->addClass('Demo'); -$class->addImplement('Foo\A') // it will simplify to A - ->addTrait('Bar\AliasedClass'); // it will simplify to AliasedClass - -$method = $class->addMethod('method'); -$method->addComment('@return ' . $namespace->simplifyType('Foo\D')); // in comments simplify manually -$method->addParameter('arg') - ->setType('Bar\OtherClass'); // it will resolve to \Bar\OtherClass - -echo $namespace; - -// or use PsrPrinter for output compatible with PSR-2 / PSR-12 -// echo (new Nette\PhpGenerator\PsrPrinter)->printNamespace($namespace); -``` - -Result: - -```php -namespace Foo; - -use Bar\AliasedClass; - -class Demo implements A -{ - use AliasedClass; - - /** - * @return D - */ - public function method(\Bar\OtherClass $arg) - { - } -} -``` - -Auto-resolving can be turned off this way: - -```php -$printer = new Nette\PhpGenerator\Printer; // or PsrPrinter -$printer->setTypeResolving(false); -echo $printer->printNamespace($namespace); -``` - -PHP Files ---------- - -Classes, functions and namespaces can be grouped into PHP files represented by the class [PhpFile](https://api.nette.org/php-generator/Nette/PhpGenerator/PhpFile.html): - -```php -$file = new Nette\PhpGenerator\PhpFile; -$file->addComment('This file is auto-generated.'); -$file->setStrictTypes(); // adds declare(strict_types=1) - -$class = $file->addClass('Foo\A'); -$function = $file->addFunction('Foo\foo'); - -// or -// $namespace = $file->addNamespace('Foo'); -// $class = $namespace->addClass('A'); -// $function = $namespace->addFunction('foo'); - -echo $file; - -// or use PsrPrinter for output compatible with PSR-2 / PSR-12 -// echo (new Nette\PhpGenerator\PsrPrinter)->printFile($file); -``` - -Result: - -```php -dump($var); // prints ['a', 'b', 123] -``` - -Custom Printer --------------- - -Need to customize printer behavior? Create your own by inheriting the `Printer` class. You can reconfigure these variables: - -```php -class MyPrinter extends Nette\PhpGenerator\Printer -{ - protected $indentation = "\t"; - protected $linesBetweenProperties = 0; - protected $linesBetweenMethods = 1; - protected $returnTypeColon = ': '; -} -``` diff --git a/vendor/nette/php-generator/src/PhpGenerator/Attribute.php b/vendor/nette/php-generator/src/PhpGenerator/Attribute.php deleted file mode 100644 index 2c0f9a3..0000000 --- a/vendor/nette/php-generator/src/PhpGenerator/Attribute.php +++ /dev/null @@ -1,49 +0,0 @@ -name = $name; - $this->args = $args; - } - - - public function getName(): string - { - return $this->name; - } - - - public function getArguments(): array - { - return $this->args; - } -} diff --git a/vendor/nette/php-generator/src/PhpGenerator/ClassType.php b/vendor/nette/php-generator/src/PhpGenerator/ClassType.php deleted file mode 100644 index fe092a2..0000000 --- a/vendor/nette/php-generator/src/PhpGenerator/ClassType.php +++ /dev/null @@ -1,653 +0,0 @@ - Constant */ - private $consts = []; - - /** @var Property[] name => Property */ - private $properties = []; - - /** @var Method[] name => Method */ - private $methods = []; - - /** @var EnumCase[] name => EnumCase */ - private $cases = []; - - - public static function class(?string $name): self - { - return new self($name); - } - - - public static function interface(string $name): self - { - return (new self($name))->setType(self::TYPE_INTERFACE); - } - - - public static function trait(string $name): self - { - return (new self($name))->setType(self::TYPE_TRAIT); - } - - - public static function enum(string $name): self - { - return (new self($name))->setType(self::TYPE_ENUM); - } - - - /** - * @param string|object $class - */ - public static function from($class, bool $withBodies = false, bool $materializeTraits = true): self - { - return (new Factory) - ->fromClassReflection(new \ReflectionClass($class), $withBodies, $materializeTraits); - } - - - /** - * @param string|object $class - */ - public static function withBodiesFrom($class): self - { - return (new Factory) - ->fromClassReflection(new \ReflectionClass($class), true); - } - - - public static function fromCode(string $code): self - { - return (new Factory) - ->fromClassCode($code); - } - - - public function __construct(string $name = null, PhpNamespace $namespace = null) - { - $this->setName($name); - $this->namespace = $namespace; - } - - - public function __toString(): string - { - try { - return (new Printer)->printClass($this, $this->namespace); - } catch (\Throwable $e) { - if (PHP_VERSION_ID >= 70400) { - throw $e; - } - trigger_error('Exception in ' . __METHOD__ . "(): {$e->getMessage()} in {$e->getFile()}:{$e->getLine()}", E_USER_ERROR); - return ''; - } - } - - - /** @deprecated an object can be in multiple namespaces */ - public function getNamespace(): ?PhpNamespace - { - return $this->namespace; - } - - - /** @return static */ - public function setName(?string $name): self - { - if ($name !== null && (!Helpers::isIdentifier($name) || isset(Helpers::KEYWORDS[strtolower($name)]))) { - throw new Nette\InvalidArgumentException("Value '$name' is not valid class name."); - } - $this->name = $name; - return $this; - } - - - public function getName(): ?string - { - return $this->name; - } - - - /** @deprecated */ - public function setClass(): self - { - $this->type = self::TYPE_CLASS; - return $this; - } - - - public function isClass(): bool - { - return $this->type === self::TYPE_CLASS; - } - - - /** @return static */ - public function setInterface(): self - { - $this->type = self::TYPE_INTERFACE; - return $this; - } - - - public function isInterface(): bool - { - return $this->type === self::TYPE_INTERFACE; - } - - - /** @return static */ - public function setTrait(): self - { - $this->type = self::TYPE_TRAIT; - return $this; - } - - - public function isTrait(): bool - { - return $this->type === self::TYPE_TRAIT; - } - - - public function isEnum(): bool - { - return $this->type === self::TYPE_ENUM; - } - - - /** @return static */ - public function setType(string $type): self - { - if (!in_array($type, [self::TYPE_CLASS, self::TYPE_INTERFACE, self::TYPE_TRAIT, self::TYPE_ENUM], true)) { - throw new Nette\InvalidArgumentException('Argument must be class|interface|trait|enum.'); - } - $this->type = $type; - return $this; - } - - - public function getType(): string - { - return $this->type; - } - - - /** @return static */ - public function setFinal(bool $state = true): self - { - $this->final = $state; - return $this; - } - - - public function isFinal(): bool - { - return $this->final; - } - - - /** @return static */ - public function setAbstract(bool $state = true): self - { - $this->abstract = $state; - return $this; - } - - - public function isAbstract(): bool - { - return $this->abstract; - } - - - /** - * @param string|string[] $names - * @return static - */ - public function setExtends($names): self - { - if (!is_string($names) && !is_array($names)) { - throw new Nette\InvalidArgumentException('Argument must be string or string[].'); - } - $this->validateNames((array) $names); - $this->extends = $names; - return $this; - } - - - /** @return string|string[] */ - public function getExtends() - { - return $this->extends; - } - - - /** @return static */ - public function addExtend(string $name): self - { - $this->validateNames([$name]); - $this->extends = (array) $this->extends; - $this->extends[] = $name; - return $this; - } - - - /** - * @param string[] $names - * @return static - */ - public function setImplements(array $names): self - { - $this->validateNames($names); - $this->implements = $names; - return $this; - } - - - /** @return string[] */ - public function getImplements(): array - { - return $this->implements; - } - - - /** @return static */ - public function addImplement(string $name): self - { - $this->validateNames([$name]); - $this->implements[] = $name; - return $this; - } - - - /** @return static */ - public function removeImplement(string $name): self - { - $this->implements = array_diff($this->implements, [$name]); - return $this; - } - - - /** - * @param string[]|TraitUse[] $traits - * @return static - */ - public function setTraits(array $traits): self - { - $this->traits = []; - foreach ($traits as $trait) { - if (!$trait instanceof TraitUse) { - $trait = new TraitUse($trait); - } - $this->traits[$trait->getName()] = $trait; - } - return $this; - } - - - /** @return string[] */ - public function getTraits(): array - { - return array_keys($this->traits); - } - - - /** @internal */ - public function getTraitResolutions(): array - { - return $this->traits; - } - - - /** - * @param array|bool $resolutions - * @return static|TraitUse - */ - public function addTrait(string $name, $resolutions = []) - { - $this->traits[$name] = $trait = new TraitUse($name); - if ($resolutions === true) { - return $trait; - } - array_map(function ($item) use ($trait) { - $trait->addResolution($item); - }, $resolutions); - return $this; - } - - - /** @return static */ - public function removeTrait(string $name): self - { - unset($this->traits[$name]); - return $this; - } - - - /** - * @param Method|Property|Constant|EnumCase|TraitUse $member - * @return static - */ - public function addMember($member): self - { - if ($member instanceof Method) { - if ($this->isInterface()) { - $member->setBody(null); - } - $this->methods[strtolower($member->getName())] = $member; - - } elseif ($member instanceof Property) { - $this->properties[$member->getName()] = $member; - - } elseif ($member instanceof Constant) { - $this->consts[$member->getName()] = $member; - - } elseif ($member instanceof EnumCase) { - $this->cases[$member->getName()] = $member; - - } elseif ($member instanceof TraitUse) { - $this->traits[$member->getName()] = $member; - - } else { - throw new Nette\InvalidArgumentException('Argument must be Method|Property|Constant|EnumCase|TraitUse.'); - } - - return $this; - } - - - /** - * @param Constant[]|mixed[] $consts - * @return static - */ - public function setConstants(array $consts): self - { - $this->consts = []; - foreach ($consts as $k => $const) { - if (!$const instanceof Constant) { - $const = (new Constant($k))->setValue($const)->setPublic(); - } - $this->consts[$const->getName()] = $const; - } - return $this; - } - - - /** @return Constant[] */ - public function getConstants(): array - { - return $this->consts; - } - - - public function addConstant(string $name, $value): Constant - { - return $this->consts[$name] = (new Constant($name)) - ->setValue($value) - ->setPublic(); - } - - - /** @return static */ - public function removeConstant(string $name): self - { - unset($this->consts[$name]); - return $this; - } - - - /** - * Sets cases to enum - * @param EnumCase[] $cases - * @return static - */ - public function setCases(array $cases): self - { - (function (EnumCase ...$cases) {})(...array_values($cases)); - $this->cases = []; - foreach ($cases as $case) { - $this->cases[$case->getName()] = $case; - } - return $this; - } - - - /** @return EnumCase[] */ - public function getCases(): array - { - return $this->cases; - } - - - /** Adds case to enum */ - public function addCase(string $name, $value = null): EnumCase - { - return $this->cases[$name] = (new EnumCase($name)) - ->setValue($value); - } - - - /** @return static */ - public function removeCase(string $name): self - { - unset($this->cases[$name]); - return $this; - } - - - /** - * @param Property[] $props - * @return static - */ - public function setProperties(array $props): self - { - (function (Property ...$props) {})(...array_values($props)); - $this->properties = []; - foreach ($props as $v) { - $this->properties[$v->getName()] = $v; - } - return $this; - } - - - /** @return Property[] */ - public function getProperties(): array - { - return $this->properties; - } - - - public function getProperty(string $name): Property - { - if (!isset($this->properties[$name])) { - throw new Nette\InvalidArgumentException("Property '$name' not found."); - } - return $this->properties[$name]; - } - - - /** - * @param string $name without $ - */ - public function addProperty(string $name, $value = null): Property - { - return $this->properties[$name] = func_num_args() > 1 - ? (new Property($name))->setValue($value) - : new Property($name); - } - - - /** - * @param string $name without $ - * @return static - */ - public function removeProperty(string $name): self - { - unset($this->properties[$name]); - return $this; - } - - - public function hasProperty(string $name): bool - { - return isset($this->properties[$name]); - } - - - /** - * @param Method[] $methods - * @return static - */ - public function setMethods(array $methods): self - { - (function (Method ...$methods) {})(...array_values($methods)); - $this->methods = []; - foreach ($methods as $m) { - $this->methods[strtolower($m->getName())] = $m; - } - return $this; - } - - - /** @return Method[] */ - public function getMethods(): array - { - $res = []; - foreach ($this->methods as $m) { - $res[$m->getName()] = $m; - } - return $res; - } - - - public function getMethod(string $name): Method - { - $m = $this->methods[strtolower($name)] ?? null; - if (!$m) { - throw new Nette\InvalidArgumentException("Method '$name' not found."); - } - return $m; - } - - - public function addMethod(string $name): Method - { - $method = new Method($name); - if ($this->isInterface()) { - $method->setBody(null); - } else { - $method->setPublic(); - } - return $this->methods[strtolower($name)] = $method; - } - - - /** @return static */ - public function removeMethod(string $name): self - { - unset($this->methods[strtolower($name)]); - return $this; - } - - - public function hasMethod(string $name): bool - { - return isset($this->methods[strtolower($name)]); - } - - - /** @throws Nette\InvalidStateException */ - public function validate(): void - { - if ($this->isEnum() && ($this->abstract || $this->final || $this->extends || $this->properties)) { - throw new Nette\InvalidStateException("Enum '$this->name' cannot be abstract or final or extends class or have properties."); - - } elseif (!$this->name && ($this->abstract || $this->final)) { - throw new Nette\InvalidStateException('Anonymous class cannot be abstract or final.'); - - } elseif ($this->abstract && $this->final) { - throw new Nette\InvalidStateException("Class '$this->name' cannot be abstract and final at the same time."); - } - } - - - private function validateNames(array $names): void - { - foreach ($names as $name) { - if (!Helpers::isNamespaceIdentifier($name, true)) { - throw new Nette\InvalidArgumentException("Value '$name' is not valid class name."); - } - } - } - - - public function __clone() - { - $clone = function ($item) { return clone $item; }; - $this->cases = array_map($clone, $this->cases); - $this->consts = array_map($clone, $this->consts); - $this->properties = array_map($clone, $this->properties); - $this->methods = array_map($clone, $this->methods); - } -} diff --git a/vendor/nette/php-generator/src/PhpGenerator/Closure.php b/vendor/nette/php-generator/src/PhpGenerator/Closure.php deleted file mode 100644 index f504a73..0000000 --- a/vendor/nette/php-generator/src/PhpGenerator/Closure.php +++ /dev/null @@ -1,72 +0,0 @@ -fromFunctionReflection(new \ReflectionFunction($closure)); - } - - - public function __toString(): string - { - try { - return (new Printer)->printClosure($this); - } catch (\Throwable $e) { - if (PHP_VERSION_ID >= 70400) { - throw $e; - } - trigger_error('Exception in ' . __METHOD__ . "(): {$e->getMessage()} in {$e->getFile()}:{$e->getLine()}", E_USER_ERROR); - return ''; - } - } - - - /** - * @param Parameter[] $uses - * @return static - */ - public function setUses(array $uses): self - { - (function (Parameter ...$uses) {})(...$uses); - $this->uses = $uses; - return $this; - } - - - public function getUses(): array - { - return $this->uses; - } - - - public function addUse(string $name): Parameter - { - return $this->uses[] = new Parameter($name); - } -} diff --git a/vendor/nette/php-generator/src/PhpGenerator/Constant.php b/vendor/nette/php-generator/src/PhpGenerator/Constant.php deleted file mode 100644 index 3c1de30..0000000 --- a/vendor/nette/php-generator/src/PhpGenerator/Constant.php +++ /dev/null @@ -1,59 +0,0 @@ -value = $val; - return $this; - } - - - public function getValue() - { - return $this->value; - } - - - /** @return static */ - public function setFinal(bool $state = true): self - { - $this->final = $state; - return $this; - } - - - public function isFinal(): bool - { - return $this->final; - } -} diff --git a/vendor/nette/php-generator/src/PhpGenerator/Dumper.php b/vendor/nette/php-generator/src/PhpGenerator/Dumper.php deleted file mode 100644 index 3597c1f..0000000 --- a/vendor/nette/php-generator/src/PhpGenerator/Dumper.php +++ /dev/null @@ -1,272 +0,0 @@ -dumpVar($var, [], 0, $column); - } - - - private function dumpVar(&$var, array $parents = [], int $level = 0, int $column = 0): string - { - if ($var === null) { - return 'null'; - - } elseif (is_string($var)) { - return $this->dumpString($var); - - } elseif (is_array($var)) { - return $this->dumpArray($var, $parents, $level, $column); - - } elseif ($var instanceof Literal) { - return $this->dumpLiteral($var, $level); - - } elseif (is_object($var)) { - return $this->dumpObject($var, $parents, $level); - - } elseif (is_resource($var)) { - throw new Nette\InvalidArgumentException('Cannot dump resource.'); - - } else { - return var_export($var, true); - } - } - - - private function dumpString(string $s): string - { - static $special = [ - "\r" => '\r', - "\n" => '\n', - "\t" => '\t', - "\e" => '\e', - '\\' => '\\\\', - ]; - - $utf8 = preg_match('##u', $s); - $escaped = preg_replace_callback( - $utf8 ? '#[\p{C}\\\\]#u' : '#[\x00-\x1F\x7F-\xFF\\\\]#', - function ($m) use ($special) { - return $special[$m[0]] ?? (strlen($m[0]) === 1 - ? '\x' . str_pad(strtoupper(dechex(ord($m[0]))), 2, '0', STR_PAD_LEFT) . '' - : '\u{' . strtoupper(ltrim(dechex(self::utf8Ord($m[0])), '0')) . '}'); - }, - $s - ); - return $s === str_replace('\\\\', '\\', $escaped) - ? "'" . preg_replace('#\'|\\\\(?=[\'\\\\]|$)#D', '\\\\$0', $s) . "'" - : '"' . addcslashes($escaped, '"$') . '"'; - } - - - private static function utf8Ord(string $c): int - { - $ord0 = ord($c[0]); - if ($ord0 < 0x80) { - return $ord0; - } elseif ($ord0 < 0xE0) { - return ($ord0 << 6) + ord($c[1]) - 0x3080; - } elseif ($ord0 < 0xF0) { - return ($ord0 << 12) + (ord($c[1]) << 6) + ord($c[2]) - 0xE2080; - } else { - return ($ord0 << 18) + (ord($c[1]) << 12) + (ord($c[2]) << 6) + ord($c[3]) - 0x3C82080; - } - } - - - private function dumpArray(array &$var, array $parents, int $level, int $column): string - { - if (empty($var)) { - return '[]'; - - } elseif ($level > $this->maxDepth || in_array($var, $parents ?? [], true)) { - throw new Nette\InvalidArgumentException('Nesting level too deep or recursive dependency.'); - } - - $space = str_repeat($this->indentation, $level); - $outInline = ''; - $outWrapped = "\n$space"; - $parents[] = $var; - $counter = 0; - $hideKeys = is_int(($tmp = array_keys($var))[0]) && $tmp === range($tmp[0], $tmp[0] + count($var) - 1); - - foreach ($var as $k => &$v) { - $keyPart = $hideKeys && $k === $counter - ? '' - : $this->dumpVar($k) . ' => '; - $counter = is_int($k) ? max($k + 1, $counter) : $counter; - $outInline .= ($outInline === '' ? '' : ', ') . $keyPart; - $outInline .= $this->dumpVar($v, $parents, 0, $column + strlen($outInline)); - $outWrapped .= $this->indentation - . $keyPart - . $this->dumpVar($v, $parents, $level + 1, strlen($keyPart)) - . ",\n$space"; - } - - array_pop($parents); - $wrap = strpos($outInline, "\n") !== false || $level * self::INDENT_LENGTH + $column + strlen($outInline) + 3 > $this->wrapLength; // 3 = [], - return '[' . ($wrap ? $outWrapped : $outInline) . ']'; - } - - - private function dumpObject($var, array $parents, int $level): string - { - if ($var instanceof \Serializable) { - return 'unserialize(' . $this->dumpString(serialize($var)) . ')'; - - } elseif ($var instanceof \UnitEnum) { - return '\\' . get_class($var) . '::' . $var->name; - - } elseif ($var instanceof \Closure) { - $inner = Nette\Utils\Callback::unwrap($var); - if (Nette\Utils\Callback::isStatic($inner)) { - return PHP_VERSION_ID < 80100 - ? '\Closure::fromCallable(' . $this->dump($inner) . ')' - : implode('::', (array) $inner) . '(...)'; - } - throw new Nette\InvalidArgumentException('Cannot dump closure.'); - } - - $class = get_class($var); - if ((new \ReflectionObject($var))->isAnonymous()) { - throw new Nette\InvalidArgumentException('Cannot dump anonymous class.'); - - } elseif (in_array($class, [\DateTime::class, \DateTimeImmutable::class], true)) { - return $this->format("new \\$class(?, new \\DateTimeZone(?))", $var->format('Y-m-d H:i:s.u'), $var->getTimeZone()->getName()); - } - - $arr = (array) $var; - $space = str_repeat($this->indentation, $level); - - if ($level > $this->maxDepth || in_array($var, $parents ?? [], true)) { - throw new Nette\InvalidArgumentException('Nesting level too deep or recursive dependency.'); - } - - $out = "\n"; - $parents[] = $var; - if (method_exists($var, '__sleep')) { - foreach ($var->__sleep() as $v) { - $props[$v] = $props["\x00*\x00$v"] = $props["\x00$class\x00$v"] = true; - } - } - - foreach ($arr as $k => &$v) { - if (!isset($props) || isset($props[$k])) { - $out .= $space . $this->indentation - . ($keyPart = $this->dumpVar($k) . ' => ') - . $this->dumpVar($v, $parents, $level + 1, strlen($keyPart)) - . ",\n"; - } - } - - array_pop($parents); - $out .= $space; - return $class === \stdClass::class - ? "(object) [$out]" - : '\\' . self::class . "::createObject('$class', [$out])"; - } - - - private function dumpLiteral(Literal $var, int $level): string - { - $s = $var->formatWith($this); - $s = Nette\Utils\Strings::indent(trim($s), $level, $this->indentation); - return ltrim($s, $this->indentation); - } - - - /** - * Generates PHP statement. Supports placeholders: ? \? $? ->? ::? ...? ...?: ?* - */ - public function format(string $statement, ...$args): string - { - $tokens = preg_split('#(\.\.\.\?:?|\$\?|->\?|::\?|\\\\\?|\?\*|\?(?!\w))#', $statement, -1, PREG_SPLIT_DELIM_CAPTURE); - $res = ''; - foreach ($tokens as $n => $token) { - if ($n % 2 === 0) { - $res .= $token; - } elseif ($token === '\?') { - $res .= '?'; - } elseif (!$args) { - throw new Nette\InvalidArgumentException('Insufficient number of arguments.'); - } elseif ($token === '?') { - $res .= $this->dump(array_shift($args), strlen($res) - strrpos($res, "\n")); - } elseif ($token === '...?' || $token === '...?:' || $token === '?*') { - $arg = array_shift($args); - if (!is_array($arg)) { - throw new Nette\InvalidArgumentException('Argument must be an array.'); - } - $res .= $this->dumpArguments($arg, strlen($res) - strrpos($res, "\n"), $token === '...?:'); - - } else { // $ -> :: - $arg = array_shift($args); - if ($arg instanceof Literal || !Helpers::isIdentifier($arg)) { - $arg = '{' . $this->dumpVar($arg) . '}'; - } - $res .= substr($token, 0, -1) . $arg; - } - } - if ($args) { - throw new Nette\InvalidArgumentException('Insufficient number of placeholders.'); - } - return $res; - } - - - private function dumpArguments(array &$var, int $column, bool $named): string - { - $outInline = $outWrapped = ''; - - foreach ($var as $k => &$v) { - $k = !$named || is_int($k) ? '' : $k . ': '; - $outInline .= $outInline === '' ? '' : ', '; - $outInline .= $k . $this->dumpVar($v, [$var], 0, $column + strlen($outInline)); - $outWrapped .= ($outWrapped === '' ? '' : ',') . "\n" - . $this->indentation . $k . $this->dumpVar($v, [$var], 1); - } - - return count($var) > 1 && (strpos($outInline, "\n") !== false || $column + strlen($outInline) > $this->wrapLength) - ? $outWrapped . "\n" - : $outInline; - } - - - /** - * @internal - */ - public static function createObject(string $class, array $props): object - { - return unserialize('O' . substr(serialize($class), 1, -1) . substr(serialize($props), 1)); - } -} diff --git a/vendor/nette/php-generator/src/PhpGenerator/EnumCase.php b/vendor/nette/php-generator/src/PhpGenerator/EnumCase.php deleted file mode 100644 index 3f25467..0000000 --- a/vendor/nette/php-generator/src/PhpGenerator/EnumCase.php +++ /dev/null @@ -1,41 +0,0 @@ -value = $val; - return $this; - } - - - public function getValue() - { - return $this->value; - } -} diff --git a/vendor/nette/php-generator/src/PhpGenerator/Extractor.php b/vendor/nette/php-generator/src/PhpGenerator/Extractor.php deleted file mode 100644 index e330b4d..0000000 --- a/vendor/nette/php-generator/src/PhpGenerator/Extractor.php +++ /dev/null @@ -1,410 +0,0 @@ -printer = new PhpParser\PrettyPrinter\Standard; - $this->parseCode($code); - } - - - private function parseCode(string $code): void - { - if (substr($code, 0, 5) !== 'code = str_replace("\r\n", "\n", $code); - $lexer = new PhpParser\Lexer\Emulative(['usedAttributes' => ['startFilePos', 'endFilePos', 'comments']]); - $parser = (new ParserFactory)->create(ParserFactory::ONLY_PHP7, $lexer); - $stmts = $parser->parse($this->code); - - $traverser = new PhpParser\NodeTraverser; - $traverser->addVisitor(new PhpParser\NodeVisitor\ParentConnectingVisitor); - $traverser->addVisitor(new PhpParser\NodeVisitor\NameResolver(null, ['preserveOriginalNames' => true])); - $this->statements = $traverser->traverse($stmts); - } - - - public function extractMethodBodies(string $className): array - { - $nodeFinder = new NodeFinder; - $classNode = $nodeFinder->findFirst($this->statements, function (Node $node) use ($className) { - return ($node instanceof Node\Stmt\Class_ || $node instanceof Node\Stmt\Trait_) - && $node->namespacedName->toString() === $className; - }); - - $res = []; - foreach ($nodeFinder->findInstanceOf($classNode, Node\Stmt\ClassMethod::class) as $methodNode) { - /** @var Node\Stmt\ClassMethod $methodNode */ - if ($methodNode->stmts) { - $res[$methodNode->name->toString()] = $this->getReformattedContents($methodNode->stmts, 2); - } - } - return $res; - } - - - public function extractFunctionBody(string $name): ?string - { - /** @var Node\Stmt\Function_ $functionNode */ - $functionNode = (new NodeFinder)->findFirst($this->statements, function (Node $node) use ($name) { - return $node instanceof Node\Stmt\Function_ && $node->namespacedName->toString() === $name; - }); - - return $this->getReformattedContents($functionNode->stmts, 1); - } - - - /** @param Node[] $statements */ - private function getReformattedContents(array $statements, int $level): string - { - $body = $this->getNodeContents(...$statements); - $body = $this->performReplacements($body, $this->prepareReplacements($statements)); - return Helpers::unindent($body, $level); - } - - - private function prepareReplacements(array $statements): array - { - $start = $statements[0]->getStartFilePos(); - $replacements = []; - (new NodeFinder)->find($statements, function (Node $node) use (&$replacements, $start) { - if ($node instanceof Node\Name\FullyQualified) { - if ($node->getAttribute('originalName') instanceof Node\Name) { - $of = $node->getAttribute('parent') instanceof Node\Expr\ConstFetch - ? PhpNamespace::NAME_CONSTANT - : ($node->getAttribute('parent') instanceof Node\Expr\FuncCall ? PhpNamespace::NAME_FUNCTION : PhpNamespace::NAME_NORMAL); - $replacements[] = [ - $node->getStartFilePos() - $start, - $node->getEndFilePos() - $start, - Helpers::tagName($node->toCodeString(), $of), - ]; - } - - } elseif ($node instanceof Node\Scalar\String_ || $node instanceof Node\Scalar\EncapsedStringPart) { - // multi-line strings => singleline - $token = $this->getNodeContents($node); - if (strpos($token, "\n") !== false) { - $quote = $node instanceof Node\Scalar\String_ ? '"' : ''; - $replacements[] = [ - $node->getStartFilePos() - $start, - $node->getEndFilePos() - $start, - $quote . addcslashes($node->value, "\x00..\x1F") . $quote, - ]; - } - - } elseif ($node instanceof Node\Scalar\Encapsed) { - // HEREDOC => "string" - if ($node->getAttribute('kind') === Node\Scalar\String_::KIND_HEREDOC) { - $replacements[] = [ - $node->getStartFilePos() - $start, - $node->parts[0]->getStartFilePos() - $start - 1, - '"', - ]; - $replacements[] = [ - end($node->parts)->getEndFilePos() - $start + 1, - $node->getEndFilePos() - $start, - '"', - ]; - } - } - }); - return $replacements; - } - - - private function performReplacements(string $s, array $replacements): string - { - usort($replacements, function ($a, $b) { // sort by position in file - return $b[0] <=> $a[0]; - }); - - foreach ($replacements as [$start, $end, $replacement]) { - $s = substr_replace($s, $replacement, $start, $end - $start + 1); - } - return $s; - } - - - public function extractAll(): PhpFile - { - $phpFile = new PhpFile; - $namespace = ''; - $visitor = new class extends PhpParser\NodeVisitorAbstract { - public function enterNode(Node $node) - { - return ($this->callback)($node); - } - }; - - $visitor->callback = function (Node $node) use (&$class, &$namespace, $phpFile) { - if ($node instanceof Node\Stmt\DeclareDeclare && $node->key->name === 'strict_types') { - $phpFile->setStrictTypes((bool) $node->value->value); - } elseif ($node instanceof Node\Stmt\Namespace_) { - $namespace = $node->name ? $node->name->toString() : ''; - } elseif ($node instanceof Node\Stmt\Use_) { - $this->addUseToNamespace($node, $phpFile->addNamespace($namespace)); - } elseif ($node instanceof Node\Stmt\Class_) { - if (!$node->name) { - return PhpParser\NodeTraverser::DONT_TRAVERSE_CHILDREN; - } - $class = $this->addClassToFile($phpFile, $node); - } elseif ($node instanceof Node\Stmt\Interface_) { - $class = $this->addInterfaceToFile($phpFile, $node); - } elseif ($node instanceof Node\Stmt\Trait_) { - $class = $this->addTraitToFile($phpFile, $node); - } elseif ($node instanceof Node\Stmt\Enum_) { - $class = $this->addEnumToFile($phpFile, $node); - } elseif ($node instanceof Node\Stmt\Function_) { - $this->addFunctionToFile($phpFile, $node); - } elseif ($node instanceof Node\Stmt\TraitUse) { - $this->addTraitToClass($class, $node); - } elseif ($node instanceof Node\Stmt\Property) { - $this->addPropertyToClass($class, $node); - } elseif ($node instanceof Node\Stmt\ClassMethod) { - $this->addMethodToClass($class, $node); - } elseif ($node instanceof Node\Stmt\ClassConst) { - $this->addConstantToClass($class, $node); - } elseif ($node instanceof Node\Stmt\EnumCase) { - $this->addEnumCaseToClass($class, $node); - } - if ($node instanceof Node\FunctionLike) { - return PhpParser\NodeTraverser::DONT_TRAVERSE_CHILDREN; - } - }; - - $traverser = new PhpParser\NodeTraverser; - $traverser->addVisitor($visitor); - $traverser->traverse($this->statements); - return $phpFile; - } - - - private function addUseToNamespace(Node\Stmt\Use_ $node, PhpNamespace $namespace): void - { - $of = [ - $node::TYPE_NORMAL => PhpNamespace::NAME_NORMAL, - $node::TYPE_FUNCTION => PhpNamespace::NAME_FUNCTION, - $node::TYPE_CONSTANT => PhpNamespace::NAME_CONSTANT, - ][$node->type]; - foreach ($node->uses as $use) { - $namespace->addUse($use->name->toString(), $use->alias ? $use->alias->toString() : null, $of); - } - } - - - private function addClassToFile(PhpFile $phpFile, Node\Stmt\Class_ $node): ClassType - { - $class = $phpFile->addClass($node->namespacedName->toString()); - if ($node->extends) { - $class->setExtends($node->extends->toString()); - } - foreach ($node->implements as $item) { - $class->addImplement($item->toString()); - } - $class->setFinal($node->isFinal()); - $class->setAbstract($node->isAbstract()); - $this->addCommentAndAttributes($class, $node); - return $class; - } - - - private function addInterfaceToFile(PhpFile $phpFile, Node\Stmt\Interface_ $node): ClassType - { - $class = $phpFile->addInterface($node->namespacedName->toString()); - foreach ($node->extends as $item) { - $class->addExtend($item->toString()); - } - $this->addCommentAndAttributes($class, $node); - return $class; - } - - - private function addTraitToFile(PhpFile $phpFile, Node\Stmt\Trait_ $node): ClassType - { - $class = $phpFile->addTrait($node->namespacedName->toString()); - $this->addCommentAndAttributes($class, $node); - return $class; - } - - - private function addEnumToFile(PhpFile $phpFile, Node\Stmt\Enum_ $node): ClassType - { - $class = $phpFile->addEnum($node->namespacedName->toString()); - foreach ($node->implements as $item) { - $class->addImplement($item->toString()); - } - $this->addCommentAndAttributes($class, $node); - return $class; - } - - - private function addFunctionToFile(PhpFile $phpFile, Node\Stmt\Function_ $node): void - { - $function = $phpFile->addFunction($node->namespacedName->toString()); - $this->setupFunction($function, $node); - } - - - private function addTraitToClass(ClassType $class, Node\Stmt\TraitUse $node): void - { - foreach ($node->traits as $item) { - $trait = $class->addTrait($item->toString(), true); - } - foreach ($node->adaptations as $item) { - $trait->addResolution(trim($this->toPhp($item), ';')); - } - $this->addCommentAndAttributes($trait, $node); - } - - - private function addPropertyToClass(ClassType $class, Node\Stmt\Property $node): void - { - foreach ($node->props as $item) { - $prop = $class->addProperty($item->name->toString()); - $prop->setStatic($node->isStatic()); - if ($node->isPrivate()) { - $prop->setPrivate(); - } elseif ($node->isProtected()) { - $prop->setProtected(); - } - $prop->setType($node->type ? $this->toPhp($node->type) : null); - if ($item->default) { - $prop->setValue(new Literal($this->getReformattedContents([$item->default], 1))); - } - $prop->setReadOnly(method_exists($node, 'isReadonly') && $node->isReadonly()); - $this->addCommentAndAttributes($prop, $node); - } - } - - - private function addMethodToClass(ClassType $class, Node\Stmt\ClassMethod $node): void - { - $method = $class->addMethod($node->name->toString()); - $method->setAbstract($node->isAbstract()); - $method->setFinal($node->isFinal()); - $method->setStatic($node->isStatic()); - if ($node->isPrivate()) { - $method->setPrivate(); - } elseif ($node->isProtected()) { - $method->setProtected(); - } - $this->setupFunction($method, $node); - } - - - private function addConstantToClass(ClassType $class, Node\Stmt\ClassConst $node): void - { - foreach ($node->consts as $item) { - $value = $this->getReformattedContents([$item->value], 1); - $const = $class->addConstant($item->name->toString(), new Literal($value)); - if ($node->isPrivate()) { - $const->setPrivate(); - } elseif ($node->isProtected()) { - $const->setProtected(); - } - $const->setFinal(method_exists($node, 'isFinal') && $node->isFinal()); - $this->addCommentAndAttributes($const, $node); - } - } - - - private function addEnumCaseToClass(ClassType $class, Node\Stmt\EnumCase $node) - { - $case = $class->addCase($node->name->toString(), $node->expr ? $node->expr->value : null); - $this->addCommentAndAttributes($case, $node); - } - - - private function addCommentAndAttributes($element, Node $node): void - { - if ($node->getDocComment()) { - $comment = $node->getDocComment()->getReformattedText(); - $comment = Helpers::unformatDocComment($comment); - $element->setComment($comment); - } - - foreach ($node->attrGroups ?? [] as $group) { - foreach ($group->attrs as $attribute) { - $args = []; - foreach ($attribute->args as $arg) { - $value = new Literal($this->getReformattedContents([$arg->value], 0)); - if ($arg->name) { - $args[$arg->name->toString()] = $value; - } else { - $args[] = $value; - } - } - $element->addAttribute($attribute->name->toString(), $args); - } - } - } - - - /** - * @param GlobalFunction|Method $function - */ - private function setupFunction($function, Node\FunctionLike $node): void - { - $function->setReturnReference($node->returnsByRef()); - $function->setReturnType($node->getReturnType() ? $this->toPhp($node->getReturnType()) : null); - foreach ($node->params as $item) { - $param = $function->addParameter($item->var->name); - $param->setType($item->type ? $this->toPhp($item->type) : null); - $param->setReference($item->byRef); - $function->setVariadic($item->variadic); - if ($item->default) { - $param->setDefaultValue(new Literal($this->getReformattedContents([$item->default], 2))); - } - $this->addCommentAndAttributes($param, $item); - } - $this->addCommentAndAttributes($function, $node); - if ($node->stmts) { - $function->setBody($this->getReformattedContents($node->stmts, 2)); - } - } - - - private function toPhp($value): string - { - return $this->printer->prettyPrint([$value]); - } - - - private function getNodeContents(Node ...$nodes): string - { - $start = $nodes[0]->getStartFilePos(); - return substr($this->code, $start, end($nodes)->getEndFilePos() - $start + 1); - } -} diff --git a/vendor/nette/php-generator/src/PhpGenerator/Factory.php b/vendor/nette/php-generator/src/PhpGenerator/Factory.php deleted file mode 100644 index bd1a0c5..0000000 --- a/vendor/nette/php-generator/src/PhpGenerator/Factory.php +++ /dev/null @@ -1,349 +0,0 @@ -isAnonymous()) { - throw new Nette\NotSupportedException('The $withBodies parameter cannot be used for anonymous functions.'); - } - - $class = $from->isAnonymous() - ? new ClassType - : new ClassType($from->getShortName(), new PhpNamespace($from->getNamespaceName())); - - if (PHP_VERSION_ID >= 80100 && $from->isEnum()) { - $class->setType($class::TYPE_ENUM); - $from = new \ReflectionEnum($from->getName()); - $enumIface = $from->isBacked() ? \BackedEnum::class : \UnitEnum::class; - } else { - $class->setType($from->isInterface() ? $class::TYPE_INTERFACE : ($from->isTrait() ? $class::TYPE_TRAIT : $class::TYPE_CLASS)); - $class->setFinal($from->isFinal() && $class->isClass()); - $class->setAbstract($from->isAbstract() && $class->isClass()); - $enumIface = null; - } - - $ifaces = $from->getInterfaceNames(); - foreach ($ifaces as $iface) { - $ifaces = array_filter($ifaces, function (string $item) use ($iface): bool { - return !is_subclass_of($iface, $item); - }); - } - if ($from->isInterface()) { - $class->setExtends($ifaces); - } else { - $ifaces = array_diff($ifaces, [$enumIface]); - $class->setImplements($ifaces); - } - - $class->setComment(Helpers::unformatDocComment((string) $from->getDocComment())); - $class->setAttributes(self::getAttributes($from)); - if ($from->getParentClass()) { - $class->setExtends($from->getParentClass()->name); - $class->setImplements(array_diff($class->getImplements(), $from->getParentClass()->getInterfaceNames())); - } - - $props = []; - foreach ($from->getProperties() as $prop) { - $declaringClass = $materializeTraits - ? $prop->getDeclaringClass() - : Reflection::getPropertyDeclaringClass($prop); - - if ($prop->isDefault() - && $declaringClass->name === $from->name - && (PHP_VERSION_ID < 80000 || !$prop->isPromoted()) - && !$class->isEnum() - ) { - $props[] = $this->fromPropertyReflection($prop); - } - } - $class->setProperties($props); - - $methods = $resolutions = []; - foreach ($from->getMethods() as $method) { - $realMethod = Reflection::getMethodDeclaringMethod($method); - $declaringClass = ($materializeTraits ? $method : $realMethod)->getDeclaringClass(); - - if ( - $declaringClass->name === $from->name - && (!$enumIface || !method_exists($enumIface, $method->name)) - ) { - $methods[] = $m = $this->fromMethodReflection($method); - if ($withBodies) { - $realMethodClass = $realMethod->getDeclaringClass(); - $bodies = &$this->bodyCache[$realMethodClass->name]; - $bodies = $bodies ?? $this->getExtractor($realMethodClass)->extractMethodBodies($realMethodClass->name); - if (isset($bodies[$realMethod->name])) { - $m->setBody($bodies[$realMethod->name]); - } - } - } - - $modifier = $realMethod->getModifiers() !== $method->getModifiers() - ? ' ' . $this->getVisibility($method) - : null; - $alias = $realMethod->name !== $method->name ? ' ' . $method->name : ''; - if ($modifier || $alias) { - $resolutions[] = $realMethod->name . ' as' . $modifier . $alias; - } - } - $class->setMethods($methods); - - if (!$materializeTraits) { - foreach ($from->getTraitNames() as $trait) { - $class->addTrait($trait, $resolutions); - $resolutions = []; - } - } - - $consts = $cases = []; - foreach ($from->getReflectionConstants() as $const) { - if ($class->isEnum() && $from->hasCase($const->name)) { - $cases[] = $this->fromCaseReflection($const); - } elseif ($const->getDeclaringClass()->name === $from->name) { - $consts[] = $this->fromConstantReflection($const); - } - } - $class->setConstants($consts); - $class->setCases($cases); - - return $class; - } - - - public function fromMethodReflection(\ReflectionMethod $from): Method - { - $method = new Method($from->name); - $method->setParameters(array_map([$this, 'fromParameterReflection'], $from->getParameters())); - $method->setStatic($from->isStatic()); - $isInterface = $from->getDeclaringClass()->isInterface(); - $method->setVisibility($isInterface ? null : $this->getVisibility($from)); - $method->setFinal($from->isFinal()); - $method->setAbstract($from->isAbstract() && !$isInterface); - $method->setBody($from->isAbstract() ? null : ''); - $method->setReturnReference($from->returnsReference()); - $method->setVariadic($from->isVariadic()); - $method->setComment(Helpers::unformatDocComment((string) $from->getDocComment())); - $method->setAttributes(self::getAttributes($from)); - if ($from->getReturnType() instanceof \ReflectionNamedType) { - $method->setReturnType($from->getReturnType()->getName()); - $method->setReturnNullable($from->getReturnType()->allowsNull()); - } elseif ( - $from->getReturnType() instanceof \ReflectionUnionType - || $from->getReturnType() instanceof \ReflectionIntersectionType - ) { - $method->setReturnType((string) $from->getReturnType()); - } - return $method; - } - - - /** @return GlobalFunction|Closure */ - public function fromFunctionReflection(\ReflectionFunction $from, bool $withBody = false) - { - $function = $from->isClosure() ? new Closure : new GlobalFunction($from->name); - $function->setParameters(array_map([$this, 'fromParameterReflection'], $from->getParameters())); - $function->setReturnReference($from->returnsReference()); - $function->setVariadic($from->isVariadic()); - if (!$from->isClosure()) { - $function->setComment(Helpers::unformatDocComment((string) $from->getDocComment())); - } - $function->setAttributes(self::getAttributes($from)); - if ($from->getReturnType() instanceof \ReflectionNamedType) { - $function->setReturnType($from->getReturnType()->getName()); - $function->setReturnNullable($from->getReturnType()->allowsNull()); - } elseif ( - $from->getReturnType() instanceof \ReflectionUnionType - || $from->getReturnType() instanceof \ReflectionIntersectionType - ) { - $function->setReturnType((string) $from->getReturnType()); - } - if ($withBody) { - if ($from->isClosure()) { - throw new Nette\NotSupportedException('The $withBody parameter cannot be used for closures.'); - } - $function->setBody($this->getExtractor($from)->extractFunctionBody($from->name)); - } - return $function; - } - - - /** @return Method|GlobalFunction|Closure */ - public function fromCallable(callable $from) - { - $ref = Nette\Utils\Callback::toReflection($from); - return $ref instanceof \ReflectionMethod - ? self::fromMethodReflection($ref) - : self::fromFunctionReflection($ref); - } - - - public function fromParameterReflection(\ReflectionParameter $from): Parameter - { - $param = PHP_VERSION_ID >= 80000 && $from->isPromoted() - ? new PromotedParameter($from->name) - : new Parameter($from->name); - $param->setReference($from->isPassedByReference()); - if ($from->getType() instanceof \ReflectionNamedType) { - $param->setType($from->getType()->getName()); - $param->setNullable($from->getType()->allowsNull()); - } elseif ( - $from->getType() instanceof \ReflectionUnionType - || $from->getType() instanceof \ReflectionIntersectionType - ) { - $param->setType((string) $from->getType()); - } - if ($from->isDefaultValueAvailable()) { - if ($from->isDefaultValueConstant()) { - $parts = explode('::', $from->getDefaultValueConstantName()); - if (count($parts) > 1) { - $parts[0] = Helpers::tagName($parts[0]); - } - $param->setDefaultValue(new Literal(implode('::', $parts))); - } elseif (is_object($from->getDefaultValue())) { - $param->setDefaultValue($this->fromObject($from->getDefaultValue())); - } else { - $param->setDefaultValue($from->getDefaultValue()); - } - $param->setNullable($param->isNullable() && $param->getDefaultValue() !== null); - } - $param->setAttributes(self::getAttributes($from)); - return $param; - } - - - public function fromConstantReflection(\ReflectionClassConstant $from): Constant - { - $const = new Constant($from->name); - $const->setValue($from->getValue()); - $const->setVisibility($this->getVisibility($from)); - $const->setFinal(PHP_VERSION_ID >= 80100 ? $from->isFinal() : false); - $const->setComment(Helpers::unformatDocComment((string) $from->getDocComment())); - $const->setAttributes(self::getAttributes($from)); - return $const; - } - - - public function fromCaseReflection(\ReflectionClassConstant $from): EnumCase - { - $const = new EnumCase($from->name); - $const->setValue($from->getValue()->value ?? null); - $const->setComment(Helpers::unformatDocComment((string) $from->getDocComment())); - $const->setAttributes(self::getAttributes($from)); - return $const; - } - - - public function fromPropertyReflection(\ReflectionProperty $from): Property - { - $defaults = $from->getDeclaringClass()->getDefaultProperties(); - $prop = new Property($from->name); - $prop->setValue($defaults[$prop->getName()] ?? null); - $prop->setStatic($from->isStatic()); - $prop->setVisibility($this->getVisibility($from)); - if (PHP_VERSION_ID >= 70400) { - if ($from->getType() instanceof \ReflectionNamedType) { - $prop->setType($from->getType()->getName()); - $prop->setNullable($from->getType()->allowsNull()); - } elseif ( - $from->getType() instanceof \ReflectionUnionType - || $from->getType() instanceof \ReflectionIntersectionType - ) { - $prop->setType((string) $from->getType()); - } - $prop->setInitialized($from->hasType() && array_key_exists($prop->getName(), $defaults)); - $prop->setReadOnly(PHP_VERSION_ID >= 80100 ? $from->isReadOnly() : false); - } else { - $prop->setInitialized(false); - } - $prop->setComment(Helpers::unformatDocComment((string) $from->getDocComment())); - $prop->setAttributes(self::getAttributes($from)); - return $prop; - } - - - public function fromObject(object $obj): Literal - { - return new Literal('new ' . get_class($obj) . '(/* unknown */)'); - } - - - public function fromClassCode(string $code): ClassType - { - $classes = $this->fromCode($code)->getClasses(); - if (!$classes) { - throw new Nette\InvalidStateException('The code does not contain any class.'); - } - return reset($classes); - } - - - public function fromCode(string $code): PhpFile - { - $reader = new Extractor($code); - return $reader->extractAll(); - } - - - private function getAttributes($from): array - { - if (PHP_VERSION_ID < 80000) { - return []; - } - return array_map(function ($attr) { - $args = $attr->getArguments(); - foreach ($args as &$arg) { - if (is_object($arg)) { - $arg = $this->fromObject($arg); - } - } - return new Attribute($attr->getName(), $args); - }, $from->getAttributes()); - } - - - private function getVisibility($from): string - { - return $from->isPrivate() - ? ClassType::VISIBILITY_PRIVATE - : ($from->isProtected() ? ClassType::VISIBILITY_PROTECTED : ClassType::VISIBILITY_PUBLIC); - } - - - private function getExtractor($from): Extractor - { - $file = $from->getFileName(); - $cache = &$this->extractorCache[$file]; - if ($cache !== null) { - return $cache; - } elseif (!$file) { - throw new Nette\InvalidStateException("Source code of $from->name not found."); - } - return new Extractor(file_get_contents($file)); - } -} diff --git a/vendor/nette/php-generator/src/PhpGenerator/GlobalFunction.php b/vendor/nette/php-generator/src/PhpGenerator/GlobalFunction.php deleted file mode 100644 index 08faaf4..0000000 --- a/vendor/nette/php-generator/src/PhpGenerator/GlobalFunction.php +++ /dev/null @@ -1,52 +0,0 @@ -fromFunctionReflection(new \ReflectionFunction($function), $withBody); - } - - - public static function withBodyFrom(string $function): self - { - return (new Factory)->fromFunctionReflection(new \ReflectionFunction($function), true); - } - - - public function __toString(): string - { - try { - return (new Printer)->printFunction($this); - } catch (\Throwable $e) { - if (PHP_VERSION_ID >= 70400) { - throw $e; - } - trigger_error('Exception in ' . __METHOD__ . "(): {$e->getMessage()} in {$e->getFile()}:{$e->getLine()}", E_USER_ERROR); - return ''; - } - } -} diff --git a/vendor/nette/php-generator/src/PhpGenerator/Helpers.php b/vendor/nette/php-generator/src/PhpGenerator/Helpers.php deleted file mode 100644 index c533e4f..0000000 --- a/vendor/nette/php-generator/src/PhpGenerator/Helpers.php +++ /dev/null @@ -1,176 +0,0 @@ - 1, 'int' => 1, 'float' => 1, 'bool' => 1, 'array' => 1, 'object' => 1, - 'callable' => 1, 'iterable' => 1, 'void' => 1, 'null' => 1, 'mixed' => 1, 'false' => 1, - 'never' => 1, - - // class keywords - 'self' => 1, 'parent' => 1, 'static' => 1, - - // PHP keywords - 'include' => 1, 'include_once' => 1, 'eval' => 1, 'require' => 1, 'require_once' => 1, 'or' => 1, 'xor' => 1, - 'and' => 1, 'instanceof' => 1, 'new' => 1, 'clone' => 1, 'exit' => 1, 'if' => 1, 'elseif' => 1, 'else' => 1, - 'endif' => 1, 'echo' => 1, 'do' => 1, 'while' => 1, 'endwhile' => 1, 'for' => 1, 'endfor' => 1, 'foreach' => 1, - 'endforeach' => 1, 'declare' => 1, 'enddeclare' => 1, 'as' => 1, 'try' => 1, 'catch' => 1, 'finally' => 1, - 'throw' => 1, 'use' => 1, 'insteadof' => 1, 'global' => 1, 'var' => 1, 'unset' => 1, 'isset' => 1, 'empty' => 1, - 'continue' => 1, 'goto' => 1, 'function' => 1, 'const' => 1, 'return' => 1, 'print' => 1, 'yield' => 1, 'list' => 1, - 'switch' => 1, 'endswitch' => 1, 'case' => 1, 'default' => 1, 'break' => 1, 'array' => 1, 'callable' => 1, - 'extends' => 1, 'implements' => 1, 'namespace' => 1, 'trait' => 1, 'interface' => 1, 'class' => 1, '__CLASS__' => 1, - '__TRAIT__' => 1, '__FUNCTION__' => 1, '__METHOD__' => 1, '__LINE__' => 1, '__FILE__' => 1, '__DIR__' => 1, - '__NAMESPACE__' => 1, 'fn' => 1, 'match' => 1, 'enum' => 1, 'static' => 1, 'abstract' => 1, 'final' => 1, - 'private' => 1, 'protected' => 1, 'public' => 1, 'readonly' => 1, - - // additional reserved class names - 'true' => 1, - ]; - - - /** @deprecated use (new Nette\PhpGenerator\Dumper)->dump() */ - public static function dump($var): string - { - return (new Dumper)->dump($var); - } - - - /** @deprecated use (new Nette\PhpGenerator\Dumper)->format() */ - public static function format(string $statement, ...$args): string - { - return (new Dumper)->format($statement, ...$args); - } - - - /** @deprecated use (new Nette\PhpGenerator\Dumper)->format() */ - public static function formatArgs(string $statement, array $args): string - { - return (new Dumper)->format($statement, ...$args); - } - - - public static function formatDocComment(string $content): string - { - $s = trim($content); - $s = str_replace('*/', '* /', $s); - if ($s === '') { - return ''; - } elseif (strpos($content, "\n") === false) { - return "/** $s */\n"; - } else { - return str_replace("\n", "\n * ", "/**\n$s") . "\n */\n"; - } - } - - - public static function tagName(string $name, string $of = PhpNamespace::NAME_NORMAL): string - { - return isset(self::KEYWORDS[strtolower($name)]) - ? $name - : "/*($of*/$name"; - } - - - public static function simplifyTaggedNames(string $code, ?PhpNamespace $namespace): string - { - return preg_replace_callback('~/\*\(([ncf])\*/([\w\x7f-\xff\\\\]++)~', function ($m) use ($namespace) { - [, $of, $name] = $m; - return $namespace - ? $namespace->simplifyType($name, $of) - : $name; - }, $code); - } - - - public static function unformatDocComment(string $comment): string - { - return preg_replace('#^\s*\* ?#m', '', trim(trim(trim($comment), '/*'))); - } - - - public static function unindent(string $s, int $level = 1): string - { - return $level - ? preg_replace('#^(\t| {4}){1,' . $level . '}#m', '', $s) - : $s; - } - - - public static function isIdentifier($value): bool - { - return is_string($value) && preg_match('#^' . self::PHP_IDENT . '$#D', $value); - } - - - public static function isNamespaceIdentifier($value, bool $allowLeadingSlash = false): bool - { - $re = '#^' . ($allowLeadingSlash ? '\\\\?' : '') . self::PHP_IDENT . '(\\\\' . self::PHP_IDENT . ')*$#D'; - return is_string($value) && preg_match($re, $value); - } - - - public static function extractNamespace(string $name): string - { - return ($pos = strrpos($name, '\\')) ? substr($name, 0, $pos) : ''; - } - - - public static function extractShortName(string $name): string - { - return ($pos = strrpos($name, '\\')) === false - ? $name - : substr($name, $pos + 1); - } - - - public static function tabsToSpaces(string $s, int $count = 4): string - { - return str_replace("\t", str_repeat(' ', $count), $s); - } - - - /** @internal */ - public static function createObject(string $class, array $props): object - { - return Dumper::createObject($class, $props); - } - - - public static function validateType(?string $type, bool &$nullable): ?string - { - if ($type === '' || $type === null) { - return null; - } - if (!preg_match('#(?: - \?[\w\\\\]+| - [\w\\\\]+ (?: (&[\w\\\\]+)* | (\|[\w\\\\]+)* ) - )()$#xAD', $type)) { - throw new Nette\InvalidArgumentException("Value '$type' is not valid type."); - } - if ($type[0] === '?') { - $nullable = true; - return substr($type, 1); - } - return $type; - } -} diff --git a/vendor/nette/php-generator/src/PhpGenerator/Literal.php b/vendor/nette/php-generator/src/PhpGenerator/Literal.php deleted file mode 100644 index fb180b4..0000000 --- a/vendor/nette/php-generator/src/PhpGenerator/Literal.php +++ /dev/null @@ -1,45 +0,0 @@ -value = $value; - $this->args = $args; - } - - - public function __toString(): string - { - return $this->formatWith(new Dumper); - } - - - /** @internal */ - public function formatWith(Dumper $dumper): string - { - return $this->args === null - ? $this->value - : $dumper->format($this->value, ...$this->args); - } -} diff --git a/vendor/nette/php-generator/src/PhpGenerator/Method.php b/vendor/nette/php-generator/src/PhpGenerator/Method.php deleted file mode 100644 index fd0a151..0000000 --- a/vendor/nette/php-generator/src/PhpGenerator/Method.php +++ /dev/null @@ -1,143 +0,0 @@ -fromMethodReflection(Nette\Utils\Callback::toReflection($method)); - } - - - public function __toString(): string - { - try { - return (new Printer)->printMethod($this); - } catch (\Throwable $e) { - if (PHP_VERSION_ID >= 70400) { - throw $e; - } - trigger_error('Exception in ' . __METHOD__ . "(): {$e->getMessage()} in {$e->getFile()}:{$e->getLine()}", E_USER_ERROR); - return ''; - } - } - - - /** @return static */ - public function setBody(?string $code, array $args = null): self - { - $this->body = $args === null || $code === null - ? $code - : (new Dumper)->format($code, ...$args); - return $this; - } - - - public function getBody(): ?string - { - return $this->body; - } - - - /** @return static */ - public function setStatic(bool $state = true): self - { - $this->static = $state; - return $this; - } - - - public function isStatic(): bool - { - return $this->static; - } - - - /** @return static */ - public function setFinal(bool $state = true): self - { - $this->final = $state; - return $this; - } - - - public function isFinal(): bool - { - return $this->final; - } - - - /** @return static */ - public function setAbstract(bool $state = true): self - { - $this->abstract = $state; - return $this; - } - - - public function isAbstract(): bool - { - return $this->abstract; - } - - - /** - * @param string $name without $ - */ - public function addPromotedParameter(string $name, $defaultValue = null): PromotedParameter - { - $param = new PromotedParameter($name); - if (func_num_args() > 1) { - $param->setDefaultValue($defaultValue); - } - return $this->parameters[$name] = $param; - } - - - /** @throws Nette\InvalidStateException */ - public function validate(): void - { - if ($this->abstract && ($this->final || $this->visibility === ClassType::VISIBILITY_PRIVATE)) { - throw new Nette\InvalidStateException("Method $this->name() cannot be abstract and final or private at the same time."); - } - } -} diff --git a/vendor/nette/php-generator/src/PhpGenerator/Parameter.php b/vendor/nette/php-generator/src/PhpGenerator/Parameter.php deleted file mode 100644 index 706c8d8..0000000 --- a/vendor/nette/php-generator/src/PhpGenerator/Parameter.php +++ /dev/null @@ -1,140 +0,0 @@ -reference = $state; - return $this; - } - - - public function isReference(): bool - { - return $this->reference; - } - - - /** @return static */ - public function setType(?string $type): self - { - $this->type = Helpers::validateType($type, $this->nullable); - return $this; - } - - - /** - * @return Type|string|null - */ - public function getType(bool $asObject = false) - { - return $asObject && $this->type - ? Type::fromString($this->type) - : $this->type; - } - - - /** @deprecated use setType() */ - public function setTypeHint(?string $type): self - { - return $this->setType($type); - } - - - /** @deprecated use getType() */ - public function getTypeHint(): ?string - { - return $this->getType(); - } - - - /** - * @deprecated just use setDefaultValue() - * @return static - */ - public function setOptional(bool $state = true): self - { - trigger_error(__METHOD__ . '() is deprecated, use setDefaultValue()', E_USER_DEPRECATED); - $this->hasDefaultValue = $state; - return $this; - } - - - /** @return static */ - public function setNullable(bool $state = true): self - { - $this->nullable = $state; - return $this; - } - - - public function isNullable(): bool - { - return $this->nullable; - } - - - /** @return static */ - public function setDefaultValue($val): self - { - $this->defaultValue = $val; - $this->hasDefaultValue = true; - return $this; - } - - - public function getDefaultValue() - { - return $this->defaultValue; - } - - - public function hasDefaultValue(): bool - { - return $this->hasDefaultValue; - } - - - public function validate(): void - { - } -} diff --git a/vendor/nette/php-generator/src/PhpGenerator/PhpFile.php b/vendor/nette/php-generator/src/PhpGenerator/PhpFile.php deleted file mode 100644 index 0496465..0000000 --- a/vendor/nette/php-generator/src/PhpGenerator/PhpFile.php +++ /dev/null @@ -1,180 +0,0 @@ -fromCode($code); - } - - - public function addClass(string $name): ClassType - { - return $this - ->addNamespace(Helpers::extractNamespace($name)) - ->addClass(Helpers::extractShortName($name)); - } - - - public function addInterface(string $name): ClassType - { - return $this - ->addNamespace(Helpers::extractNamespace($name)) - ->addInterface(Helpers::extractShortName($name)); - } - - - public function addTrait(string $name): ClassType - { - return $this - ->addNamespace(Helpers::extractNamespace($name)) - ->addTrait(Helpers::extractShortName($name)); - } - - - public function addEnum(string $name): ClassType - { - return $this - ->addNamespace(Helpers::extractNamespace($name)) - ->addEnum(Helpers::extractShortName($name)); - } - - - /** @param string|PhpNamespace $namespace */ - public function addNamespace($namespace): PhpNamespace - { - if ($namespace instanceof PhpNamespace) { - $res = $this->namespaces[$namespace->getName()] = $namespace; - - } elseif (is_string($namespace)) { - $res = $this->namespaces[$namespace] = $this->namespaces[$namespace] ?? new PhpNamespace($namespace); - - } else { - throw new Nette\InvalidArgumentException('Argument must be string|PhpNamespace.'); - } - - foreach ($this->namespaces as $namespace) { - $namespace->setBracketedSyntax(count($this->namespaces) > 1 && isset($this->namespaces[''])); - } - return $res; - } - - - public function addFunction(string $name): GlobalFunction - { - return $this - ->addNamespace(Helpers::extractNamespace($name)) - ->addFunction(Helpers::extractShortName($name)); - } - - - /** @return PhpNamespace[] */ - public function getNamespaces(): array - { - return $this->namespaces; - } - - - /** @return ClassType[] */ - public function getClasses(): array - { - $classes = []; - foreach ($this->namespaces as $n => $namespace) { - $n .= $n ? '\\' : ''; - foreach ($namespace->getClasses() as $c => $class) { - $classes[$n . $c] = $class; - } - } - return $classes; - } - - - /** @return GlobalFunction[] */ - public function getFunctions(): array - { - $functions = []; - foreach ($this->namespaces as $n => $namespace) { - $n .= $n ? '\\' : ''; - foreach ($namespace->getFunctions() as $c => $class) { - $functions[$n . $c] = $class; - } - } - return $functions; - } - - - /** @return static */ - public function addUse(string $name, string $alias = null, string $of = PhpNamespace::NAME_NORMAL): self - { - $this->addNamespace('')->addUse($name, $alias, $of); - return $this; - } - - - /** - * Adds declare(strict_types=1) to output. - * @return static - */ - public function setStrictTypes(bool $on = true): self - { - $this->strictTypes = $on; - return $this; - } - - - public function hasStrictTypes(): bool - { - return $this->strictTypes; - } - - - /** @deprecated use hasStrictTypes() */ - public function getStrictTypes(): bool - { - return $this->strictTypes; - } - - - public function __toString(): string - { - try { - return (new Printer)->printFile($this); - } catch (\Throwable $e) { - if (PHP_VERSION_ID >= 70400) { - throw $e; - } - trigger_error('Exception in ' . __METHOD__ . "(): {$e->getMessage()} in {$e->getFile()}:{$e->getLine()}", E_USER_ERROR); - return ''; - } - } -} diff --git a/vendor/nette/php-generator/src/PhpGenerator/PhpLiteral.php b/vendor/nette/php-generator/src/PhpGenerator/PhpLiteral.php deleted file mode 100644 index 10fd5a5..0000000 --- a/vendor/nette/php-generator/src/PhpGenerator/PhpLiteral.php +++ /dev/null @@ -1,15 +0,0 @@ - [], - self::NAME_FUNCTION => [], - self::NAME_CONSTANT => [], - ]; - - /** @var ClassType[] */ - private $classes = []; - - /** @var GlobalFunction[] */ - private $functions = []; - - - public function __construct(string $name) - { - if ($name !== '' && !Helpers::isNamespaceIdentifier($name)) { - throw new Nette\InvalidArgumentException("Value '$name' is not valid name."); - } - $this->name = $name; - } - - - public function getName(): string - { - return $this->name; - } - - - /** - * @return static - * @internal - */ - public function setBracketedSyntax(bool $state = true): self - { - $this->bracketedSyntax = $state; - return $this; - } - - - public function hasBracketedSyntax(): bool - { - return $this->bracketedSyntax; - } - - - /** @deprecated use hasBracketedSyntax() */ - public function getBracketedSyntax(): bool - { - return $this->bracketedSyntax; - } - - - /** - * @throws InvalidStateException - * @return static - */ - public function addUse(string $name, string $alias = null, string $of = self::NAME_NORMAL): self - { - if ( - !Helpers::isNamespaceIdentifier($name, true) - || (Helpers::isIdentifier($name) && isset(Helpers::KEYWORDS[strtolower($name)])) - ) { - throw new Nette\InvalidArgumentException("Value '$name' is not valid class/function/constant name."); - - } elseif ($alias && (!Helpers::isIdentifier($alias) || isset(Helpers::KEYWORDS[strtolower($alias)]))) { - throw new Nette\InvalidArgumentException("Value '$alias' is not valid alias."); - } - - $name = ltrim($name, '\\'); - $aliases = array_change_key_case($this->aliases[$of]); - $used = [self::NAME_NORMAL => $this->classes, self::NAME_FUNCTION => $this->functions, self::NAME_CONSTANT => []][$of]; - - if ($alias === null) { - $base = Helpers::extractShortName($name); - $counter = null; - do { - $alias = $base . $counter; - $lower = strtolower($alias); - $counter++; - } while ((isset($aliases[$lower]) && strcasecmp($aliases[$lower], $name) !== 0) || isset($used[$lower])); - - } else { - $lower = strtolower($alias); - if (isset($aliases[$lower]) && strcasecmp($aliases[$lower], $name) !== 0) { - throw new InvalidStateException( - "Alias '$alias' used already for '{$aliases[$lower]}', cannot use for '$name'." - ); - } elseif (isset($used[$lower])) { - throw new Nette\InvalidStateException("Name '$alias' used already for '$this->name\\{$used[$lower]->getName()}'."); - } - } - - $this->aliases[$of][$alias] = $name; - return $this; - } - - - /** @return static */ - public function addUseFunction(string $name, string $alias = null): self - { - return $this->addUse($name, $alias, self::NAME_FUNCTION); - } - - - /** @return static */ - public function addUseConstant(string $name, string $alias = null): self - { - return $this->addUse($name, $alias, self::NAME_CONSTANT); - } - - - /** @return string[] */ - public function getUses(string $of = self::NAME_NORMAL): array - { - asort($this->aliases[$of]); - return array_filter( - $this->aliases[$of], - function ($name, $alias) { return strcasecmp(($this->name ? $this->name . '\\' : '') . $alias, $name); }, - ARRAY_FILTER_USE_BOTH - ); - } - - - /** @deprecated use simplifyName() */ - public function unresolveName(string $name): string - { - return $this->simplifyName($name); - } - - - public function resolveName(string $name, string $of = self::NAME_NORMAL): string - { - if (isset(Helpers::KEYWORDS[strtolower($name)]) || $name === '') { - return $name; - } elseif ($name[0] === '\\') { - return substr($name, 1); - } - - $aliases = array_change_key_case($this->aliases[$of]); - if ($of !== self::NAME_NORMAL) { - return $aliases[strtolower($name)] - ?? $this->resolveName(Helpers::extractNamespace($name) . '\\') . Helpers::extractShortName($name); - } - - $parts = explode('\\', $name, 2); - return ($res = $aliases[strtolower($parts[0])] ?? null) - ? $res . (isset($parts[1]) ? '\\' . $parts[1] : '') - : $this->name . ($this->name ? '\\' : '') . $name; - } - - - public function simplifyType(string $type, string $of = self::NAME_NORMAL): string - { - return preg_replace_callback('~[\w\x7f-\xff\\\\]+~', function ($m) use ($of) { return $this->simplifyName($m[0], $of); }, $type); - } - - - public function simplifyName(string $name, string $of = self::NAME_NORMAL): string - { - if (isset(Helpers::KEYWORDS[strtolower($name)]) || $name === '') { - return $name; - } - $name = ltrim($name, '\\'); - - if ($of !== self::NAME_NORMAL) { - foreach ($this->aliases[$of] as $alias => $original) { - if (strcasecmp($original, $name) === 0) { - return $alias; - } - } - return $this->simplifyName(Helpers::extractNamespace($name) . '\\') . Helpers::extractShortName($name); - } - - $shortest = null; - $relative = self::startsWith($name, $this->name . '\\') - ? substr($name, strlen($this->name) + 1) - : null; - - foreach ($this->aliases[$of] as $alias => $original) { - if ($relative && self::startsWith($relative . '\\', $alias . '\\')) { - $relative = null; - } - if (self::startsWith($name . '\\', $original . '\\')) { - $short = $alias . substr($name, strlen($original)); - if (!isset($shortest) || strlen($shortest) > strlen($short)) { - $shortest = $short; - } - } - } - - if (isset($shortest, $relative) && strlen($shortest) < strlen($relative)) { - return $shortest; - } - - return $relative ?? $shortest ?? ($this->name ? '\\' : '') . $name; - } - - - /** @return static */ - public function add(ClassType $class): self - { - $name = $class->getName(); - if ($name === null) { - throw new Nette\InvalidArgumentException('Class does not have a name.'); - } - $lower = strtolower($name); - if ($orig = array_change_key_case($this->aliases[self::NAME_NORMAL])[$lower] ?? null) { - throw new Nette\InvalidStateException("Name '$name' used already as alias for $orig."); - } - $this->classes[$lower] = $class; - return $this; - } - - - public function addClass(string $name): ClassType - { - $this->add($class = new ClassType($name, $this)); - return $class; - } - - - public function addInterface(string $name): ClassType - { - return $this->addClass($name)->setType(ClassType::TYPE_INTERFACE); - } - - - public function addTrait(string $name): ClassType - { - return $this->addClass($name)->setType(ClassType::TYPE_TRAIT); - } - - - public function addEnum(string $name): ClassType - { - return $this->addClass($name)->setType(ClassType::TYPE_ENUM); - } - - - public function addFunction(string $name): GlobalFunction - { - $lower = strtolower($name); - if ($orig = array_change_key_case($this->aliases[self::NAME_FUNCTION])[$lower] ?? null) { - throw new Nette\InvalidStateException("Name '$name' used already as alias for $orig."); - } - return $this->functions[$lower] = new GlobalFunction($name); - } - - - /** @return ClassType[] */ - public function getClasses(): array - { - $res = []; - foreach ($this->classes as $class) { - $res[$class->getName()] = $class; - } - return $res; - } - - - /** @return GlobalFunction[] */ - public function getFunctions(): array - { - $res = []; - foreach ($this->functions as $fn) { - $res[$fn->getName()] = $fn; - } - return $res; - } - - - private static function startsWith(string $a, string $b): bool - { - return strncasecmp($a, $b, strlen($b)) === 0; - } - - - public function __toString(): string - { - try { - return (new Printer)->printNamespace($this); - } catch (\Throwable $e) { - if (PHP_VERSION_ID >= 70400) { - throw $e; - } - trigger_error('Exception in ' . __METHOD__ . "(): {$e->getMessage()} in {$e->getFile()}:{$e->getLine()}", E_USER_ERROR); - return ''; - } - } -} diff --git a/vendor/nette/php-generator/src/PhpGenerator/Printer.php b/vendor/nette/php-generator/src/PhpGenerator/Printer.php deleted file mode 100644 index 112f22a..0000000 --- a/vendor/nette/php-generator/src/PhpGenerator/Printer.php +++ /dev/null @@ -1,414 +0,0 @@ -dumper = new Dumper; - } - - - public function printFunction(GlobalFunction $function, PhpNamespace $namespace = null): string - { - $this->namespace = $this->resolveTypes ? $namespace : null; - $line = 'function ' - . ($function->getReturnReference() ? '&' : '') - . $function->getName(); - $returnType = $this->printReturnType($function); - $body = Helpers::simplifyTaggedNames($function->getBody(), $this->namespace); - - return Helpers::formatDocComment($function->getComment() . "\n") - . self::printAttributes($function->getAttributes()) - . $line - . $this->printParameters($function, strlen($line) + strlen($returnType) + 2) // 2 = parentheses - . $returnType - . "\n{\n" . $this->indent(ltrim(rtrim($body) . "\n")) . "}\n"; - } - - - public function printClosure(Closure $closure, PhpNamespace $namespace = null): string - { - $this->namespace = $this->resolveTypes ? $namespace : null; - $uses = []; - foreach ($closure->getUses() as $param) { - $uses[] = ($param->isReference() ? '&' : '') . '$' . $param->getName(); - } - $useStr = strlen($tmp = implode(', ', $uses)) > $this->wrapLength && count($uses) > 1 - ? "\n" . $this->indentation . implode(",\n" . $this->indentation, $uses) . "\n" - : $tmp; - $body = Helpers::simplifyTaggedNames($closure->getBody(), $this->namespace); - - return self::printAttributes($closure->getAttributes(), true) - . 'function ' - . ($closure->getReturnReference() ? '&' : '') - . $this->printParameters($closure) - . ($uses ? " use ($useStr)" : '') - . $this->printReturnType($closure) - . " {\n" . $this->indent(ltrim(rtrim($body) . "\n")) . '}'; - } - - - public function printArrowFunction(Closure $closure, PhpNamespace $namespace = null): string - { - $this->namespace = $this->resolveTypes ? $namespace : null; - foreach ($closure->getUses() as $use) { - if ($use->isReference()) { - throw new Nette\InvalidArgumentException('Arrow function cannot bind variables by-reference.'); - } - } - $body = Helpers::simplifyTaggedNames($closure->getBody(), $this->namespace); - - return self::printAttributes($closure->getAttributes()) - . 'fn' - . ($closure->getReturnReference() ? '&' : '') - . $this->printParameters($closure) - . $this->printReturnType($closure) - . ' => ' . trim($body) . ';'; - } - - - public function printMethod(Method $method, PhpNamespace $namespace = null): string - { - $this->namespace = $this->resolveTypes ? $namespace : null; - $method->validate(); - $line = ($method->isAbstract() ? 'abstract ' : '') - . ($method->isFinal() ? 'final ' : '') - . ($method->getVisibility() ? $method->getVisibility() . ' ' : '') - . ($method->isStatic() ? 'static ' : '') - . 'function ' - . ($method->getReturnReference() ? '&' : '') - . $method->getName(); - $returnType = $this->printReturnType($method); - $params = $this->printParameters($method, strlen($line) + strlen($returnType) + strlen($this->indentation) + 2); - $body = Helpers::simplifyTaggedNames((string) $method->getBody(), $this->namespace); - - return Helpers::formatDocComment($method->getComment() . "\n") - . self::printAttributes($method->getAttributes()) - . $line - . $params - . $returnType - . ($method->isAbstract() || $method->getBody() === null - ? ";\n" - : (strpos($params, "\n") === false ? "\n" : ' ') - . "{\n" - . $this->indent(ltrim(rtrim($body) . "\n")) - . "}\n"); - } - - - public function printClass(ClassType $class, PhpNamespace $namespace = null): string - { - $this->namespace = $this->resolveTypes ? $namespace : null; - $class->validate(); - $resolver = $this->namespace - ? [$namespace, 'simplifyType'] - : function ($s) { return $s; }; - - $traits = []; - foreach ($class->getTraitResolutions() as $trait) { - $resolutions = $trait->getResolutions(); - $traits[] = Helpers::formatDocComment((string) $trait->getComment()) - . 'use ' . $resolver($trait->getName()) - . ($resolutions - ? " {\n" . $this->indentation . implode(";\n" . $this->indentation, $resolutions) . ";\n}\n" - : ";\n"); - } - - $cases = []; - foreach ($class->getCases() as $case) { - $cases[] = Helpers::formatDocComment((string) $case->getComment()) - . self::printAttributes($case->getAttributes()) - . 'case ' . $case->getName() - . ($case->getValue() === null ? '' : ' = ' . $this->dump($case->getValue())) - . ";\n"; - } - $enumType = isset($case) && $case->getValue() !== null - ? $this->returnTypeColon . Type::getType($case->getValue()) - : ''; - - $consts = []; - foreach ($class->getConstants() as $const) { - $def = ($const->isFinal() ? 'final ' : '') - . ($const->getVisibility() ? $const->getVisibility() . ' ' : '') - . 'const ' . $const->getName() . ' = '; - - $consts[] = Helpers::formatDocComment((string) $const->getComment()) - . self::printAttributes($const->getAttributes()) - . $def - . $this->dump($const->getValue(), strlen($def)) . ";\n"; - } - - $properties = []; - foreach ($class->getProperties() as $property) { - $property->validate(); - $type = $property->getType(); - $def = (($property->getVisibility() ?: 'public') - . ($property->isStatic() ? ' static' : '') - . ($property->isReadOnly() && $type ? ' readonly' : '') - . ' ' - . ltrim($this->printType($type, $property->isNullable()) . ' ') - . '$' . $property->getName()); - - $properties[] = Helpers::formatDocComment((string) $property->getComment()) - . self::printAttributes($property->getAttributes()) - . $def - . ($property->getValue() === null && !$property->isInitialized() - ? '' - : ' = ' . $this->dump($property->getValue(), strlen($def) + 3)) // 3 = ' = ' - . ";\n"; - } - - $methods = []; - foreach ($class->getMethods() as $method) { - $methods[] = $this->printMethod($method, $namespace); - } - - $members = array_filter([ - implode('', $traits), - $this->joinProperties($cases), - $this->joinProperties($consts), - $this->joinProperties($properties), - ($methods && $properties ? str_repeat("\n", $this->linesBetweenMethods - 1) : '') - . implode(str_repeat("\n", $this->linesBetweenMethods), $methods), - ]); - - return Strings::normalize( - Helpers::formatDocComment($class->getComment() . "\n") - . self::printAttributes($class->getAttributes()) - . ($class->isAbstract() ? 'abstract ' : '') - . ($class->isFinal() ? 'final ' : '') - . ($class->getName() ? $class->getType() . ' ' . $class->getName() . $enumType . ' ' : '') - . ($class->getExtends() ? 'extends ' . implode(', ', array_map($resolver, (array) $class->getExtends())) . ' ' : '') - . ($class->getImplements() ? 'implements ' . implode(', ', array_map($resolver, $class->getImplements())) . ' ' : '') - . ($class->getName() ? "\n" : '') . "{\n" - . ($members ? $this->indent(implode("\n", $members)) : '') - . '}' - ) . ($class->getName() ? "\n" : ''); - } - - - public function printNamespace(PhpNamespace $namespace): string - { - $this->namespace = $this->resolveTypes ? $namespace : null; - $name = $namespace->getName(); - $uses = $this->printUses($namespace) - . $this->printUses($namespace, PhpNamespace::NAME_FUNCTION) - . $this->printUses($namespace, PhpNamespace::NAME_CONSTANT); - - $items = []; - foreach ($namespace->getClasses() as $class) { - $items[] = $this->printClass($class, $namespace); - } - foreach ($namespace->getFunctions() as $function) { - $items[] = $this->printFunction($function, $namespace); - } - - $body = ($uses ? $uses . "\n" : '') - . implode("\n", $items); - - if ($namespace->hasBracketedSyntax()) { - return 'namespace' . ($name ? " $name" : '') . "\n{\n" - . $this->indent($body) - . "}\n"; - - } else { - return ($name ? "namespace $name;\n\n" : '') - . $body; - } - } - - - public function printFile(PhpFile $file): string - { - $namespaces = []; - foreach ($file->getNamespaces() as $namespace) { - $namespaces[] = $this->printNamespace($namespace); - } - - return Strings::normalize( - "getComment() ? "\n" . Helpers::formatDocComment($file->getComment() . "\n") : '') - . "\n" - . ($file->hasStrictTypes() ? "declare(strict_types=1);\n\n" : '') - . implode("\n\n", $namespaces) - ) . "\n"; - } - - - protected function printUses(PhpNamespace $namespace, string $of = PhpNamespace::NAME_NORMAL): string - { - $prefix = [ - PhpNamespace::NAME_NORMAL => '', - PhpNamespace::NAME_FUNCTION => 'function ', - PhpNamespace::NAME_CONSTANT => 'const ', - ][$of]; - $name = $namespace->getName(); - $uses = []; - foreach ($namespace->getUses($of) as $alias => $original) { - $uses[] = Helpers::extractShortName($original) === $alias - ? "use $prefix$original;\n" - : "use $prefix$original as $alias;\n"; - } - return implode('', $uses); - } - - - /** - * @param Closure|GlobalFunction|Method $function - */ - protected function printParameters($function, int $column = 0): string - { - $params = []; - $list = $function->getParameters(); - $special = false; - - foreach ($list as $param) { - $param->validate(); - $variadic = $function->isVariadic() && $param === end($list); - $type = $param->getType(); - $promoted = $param instanceof PromotedParameter ? $param : null; - $params[] = - ($promoted ? Helpers::formatDocComment((string) $promoted->getComment()) : '') - . ($attrs = self::printAttributes($param->getAttributes(), true)) - . ($promoted ? - ($promoted->getVisibility() ?: 'public') - . ($promoted->isReadOnly() && $type ? ' readonly' : '') - . ' ' : '') - . ltrim($this->printType($type, $param->isNullable()) . ' ') - . ($param->isReference() ? '&' : '') - . ($variadic ? '...' : '') - . '$' . $param->getName() - . ($param->hasDefaultValue() && !$variadic ? ' = ' . $this->dump($param->getDefaultValue()) : ''); - - $special = $special || $promoted || $attrs; - } - - $line = implode(', ', $params); - - return count($params) > 1 && ($special || strlen($line) + $column > $this->wrapLength) - ? "(\n" . $this->indent(implode(",\n", $params)) . ($special ? ',' : '') . "\n)" - : "($line)"; - } - - - protected function printType(?string $type, bool $nullable): string - { - if ($type === null) { - return ''; - } - if ($this->namespace) { - $type = $this->namespace->simplifyType($type); - } - if ($nullable && strcasecmp($type, 'mixed')) { - $type = strpos($type, '|') === false - ? '?' . $type - : $type . '|null'; - } - return $type; - } - - - /** - * @param Closure|GlobalFunction|Method $function - */ - private function printReturnType($function): string - { - return ($tmp = $this->printType($function->getReturnType(), $function->isReturnNullable())) - ? $this->returnTypeColon . $tmp - : ''; - } - - - private function printAttributes(array $attrs, bool $inline = false): string - { - if (!$attrs) { - return ''; - } - $this->dumper->indentation = $this->indentation; - $items = []; - foreach ($attrs as $attr) { - $args = $this->dumper->format('...?:', $attr->getArguments()); - $args = Helpers::simplifyTaggedNames($args, $this->namespace); - $items[] = $this->printType($attr->getName(), false) . ($args ? "($args)" : ''); - } - return $inline - ? '#[' . implode(', ', $items) . '] ' - : '#[' . implode("]\n#[", $items) . "]\n"; - } - - - /** @return static */ - public function setTypeResolving(bool $state = true): self - { - $this->resolveTypes = $state; - return $this; - } - - - protected function indent(string $s): string - { - $s = str_replace("\t", $this->indentation, $s); - return Strings::indent($s, 1, $this->indentation); - } - - - protected function dump($var, int $column = 0): string - { - $this->dumper->indentation = $this->indentation; - $this->dumper->wrapLength = $this->wrapLength; - $s = $this->dumper->dump($var, $column); - $s = Helpers::simplifyTaggedNames($s, $this->namespace); - return $s; - } - - - private function joinProperties(array $props): string - { - return $this->linesBetweenProperties - ? implode(str_repeat("\n", $this->linesBetweenProperties), $props) - : preg_replace('#^(\w.*\n)\n(?=\w.*;)#m', '$1', implode("\n", $props)); - } -} diff --git a/vendor/nette/php-generator/src/PhpGenerator/PromotedParameter.php b/vendor/nette/php-generator/src/PhpGenerator/PromotedParameter.php deleted file mode 100644 index 00b8a81..0000000 --- a/vendor/nette/php-generator/src/PhpGenerator/PromotedParameter.php +++ /dev/null @@ -1,48 +0,0 @@ -readOnly = $state; - return $this; - } - - - public function isReadOnly(): bool - { - return $this->readOnly; - } - - - /** @throws Nette\InvalidStateException */ - public function validate(): void - { - if ($this->readOnly && !$this->getType()) { - throw new Nette\InvalidStateException("Property \${$this->getName()}: Read-only properties are only supported on typed property."); - } - } -} diff --git a/vendor/nette/php-generator/src/PhpGenerator/Property.php b/vendor/nette/php-generator/src/PhpGenerator/Property.php deleted file mode 100644 index 04c95e5..0000000 --- a/vendor/nette/php-generator/src/PhpGenerator/Property.php +++ /dev/null @@ -1,145 +0,0 @@ -value = $val; - $this->initialized = true; - return $this; - } - - - public function &getValue() - { - return $this->value; - } - - - /** @return static */ - public function setStatic(bool $state = true): self - { - $this->static = $state; - return $this; - } - - - public function isStatic(): bool - { - return $this->static; - } - - - /** @return static */ - public function setType(?string $type): self - { - $this->type = Helpers::validateType($type, $this->nullable); - return $this; - } - - - /** - * @return Type|string|null - */ - public function getType(bool $asObject = false) - { - return $asObject && $this->type - ? Type::fromString($this->type) - : $this->type; - } - - - /** @return static */ - public function setNullable(bool $state = true): self - { - $this->nullable = $state; - return $this; - } - - - public function isNullable(): bool - { - return $this->nullable; - } - - - /** @return static */ - public function setInitialized(bool $state = true): self - { - $this->initialized = $state; - return $this; - } - - - public function isInitialized(): bool - { - return $this->initialized || $this->value !== null; - } - - - /** @return static */ - public function setReadOnly(bool $state = true): self - { - $this->readOnly = $state; - return $this; - } - - - public function isReadOnly(): bool - { - return $this->readOnly; - } - - - /** @throws Nette\InvalidStateException */ - public function validate(): void - { - if ($this->readOnly && !$this->type) { - throw new Nette\InvalidStateException("Property \$$this->name: Read-only properties are only supported on typed property."); - } - } -} diff --git a/vendor/nette/php-generator/src/PhpGenerator/PsrPrinter.php b/vendor/nette/php-generator/src/PhpGenerator/PsrPrinter.php deleted file mode 100644 index aef0f7d..0000000 --- a/vendor/nette/php-generator/src/PhpGenerator/PsrPrinter.php +++ /dev/null @@ -1,23 +0,0 @@ -name = $name; - } - - - public function addResolution(string $resolution): self - { - $this->resolutions[] = $resolution; - return $this; - } - - - public function getResolutions(): array - { - return $this->resolutions; - } -} diff --git a/vendor/nette/php-generator/src/PhpGenerator/Traits/AttributeAware.php b/vendor/nette/php-generator/src/PhpGenerator/Traits/AttributeAware.php deleted file mode 100644 index d0195eb..0000000 --- a/vendor/nette/php-generator/src/PhpGenerator/Traits/AttributeAware.php +++ /dev/null @@ -1,49 +0,0 @@ -attributes[] = new Attribute($name, $args); - return $this; - } - - - /** - * @param Attribute[] $attrs - * @return static - */ - public function setAttributes(array $attrs): self - { - (function (Attribute ...$attrs) {})(...$attrs); - $this->attributes = $attrs; - return $this; - } - - - /** @return Attribute[] */ - public function getAttributes(): array - { - return $this->attributes; - } -} diff --git a/vendor/nette/php-generator/src/PhpGenerator/Traits/CommentAware.php b/vendor/nette/php-generator/src/PhpGenerator/Traits/CommentAware.php deleted file mode 100644 index b531405..0000000 --- a/vendor/nette/php-generator/src/PhpGenerator/Traits/CommentAware.php +++ /dev/null @@ -1,42 +0,0 @@ -comment = $val; - return $this; - } - - - public function getComment(): ?string - { - return $this->comment; - } - - - /** @return static */ - public function addComment(string $val): self - { - $this->comment .= $this->comment ? "\n$val" : $val; - return $this; - } -} diff --git a/vendor/nette/php-generator/src/PhpGenerator/Traits/FunctionLike.php b/vendor/nette/php-generator/src/PhpGenerator/Traits/FunctionLike.php deleted file mode 100644 index 151e73e..0000000 --- a/vendor/nette/php-generator/src/PhpGenerator/Traits/FunctionLike.php +++ /dev/null @@ -1,186 +0,0 @@ -body = $args === null - ? $code - : (new Dumper)->format($code, ...$args); - return $this; - } - - - public function getBody(): string - { - return $this->body; - } - - - /** @return static */ - public function addBody(string $code, array $args = null): self - { - $this->body .= ($args === null ? $code : (new Dumper)->format($code, ...$args)) . "\n"; - return $this; - } - - - /** - * @param Parameter[] $val - * @return static - */ - public function setParameters(array $val): self - { - (function (Parameter ...$val) {})(...array_values($val)); - $this->parameters = []; - foreach ($val as $v) { - $this->parameters[$v->getName()] = $v; - } - return $this; - } - - - /** @return Parameter[] */ - public function getParameters(): array - { - return $this->parameters; - } - - - /** - * @param string $name without $ - */ - public function addParameter(string $name, $defaultValue = null): Parameter - { - $param = new Parameter($name); - if (func_num_args() > 1) { - $param->setDefaultValue($defaultValue); - } - return $this->parameters[$name] = $param; - } - - - /** - * @param string $name without $ - * @return static - */ - public function removeParameter(string $name): self - { - unset($this->parameters[$name]); - return $this; - } - - - /** @return static */ - public function setVariadic(bool $state = true): self - { - $this->variadic = $state; - return $this; - } - - - public function isVariadic(): bool - { - return $this->variadic; - } - - - /** @return static */ - public function setReturnType(?string $type): self - { - $this->returnType = Nette\PhpGenerator\Helpers::validateType($type, $this->returnNullable); - return $this; - } - - - /** - * @return Type|string|null - */ - public function getReturnType(bool $asObject = false) - { - return $asObject && $this->returnType - ? Type::fromString($this->returnType) - : $this->returnType; - } - - - /** @return static */ - public function setReturnReference(bool $state = true): self - { - $this->returnReference = $state; - return $this; - } - - - public function getReturnReference(): bool - { - return $this->returnReference; - } - - - /** @return static */ - public function setReturnNullable(bool $state = true): self - { - $this->returnNullable = $state; - return $this; - } - - - public function isReturnNullable(): bool - { - return $this->returnNullable; - } - - - /** @deprecated use isReturnNullable() */ - public function getReturnNullable(): bool - { - return $this->returnNullable; - } - - - /** @deprecated */ - public function setNamespace(Nette\PhpGenerator\PhpNamespace $val = null): self - { - trigger_error(__METHOD__ . '() is deprecated', E_USER_DEPRECATED); - return $this; - } -} diff --git a/vendor/nette/php-generator/src/PhpGenerator/Traits/NameAware.php b/vendor/nette/php-generator/src/PhpGenerator/Traits/NameAware.php deleted file mode 100644 index 157aa0f..0000000 --- a/vendor/nette/php-generator/src/PhpGenerator/Traits/NameAware.php +++ /dev/null @@ -1,49 +0,0 @@ -name = $name; - } - - - public function getName(): string - { - return $this->name; - } - - - /** - * Returns clone with a different name. - * @return static - */ - public function cloneWithName(string $name): self - { - $dolly = clone $this; - $dolly->__construct($name); - return $dolly; - } -} diff --git a/vendor/nette/php-generator/src/PhpGenerator/Traits/VisibilityAware.php b/vendor/nette/php-generator/src/PhpGenerator/Traits/VisibilityAware.php deleted file mode 100644 index 3dd862c..0000000 --- a/vendor/nette/php-generator/src/PhpGenerator/Traits/VisibilityAware.php +++ /dev/null @@ -1,85 +0,0 @@ -visibility = $val; - return $this; - } - - - public function getVisibility(): ?string - { - return $this->visibility; - } - - - /** @return static */ - public function setPublic(): self - { - $this->visibility = ClassType::VISIBILITY_PUBLIC; - return $this; - } - - - public function isPublic(): bool - { - return $this->visibility === ClassType::VISIBILITY_PUBLIC || $this->visibility === null; - } - - - /** @return static */ - public function setProtected(): self - { - $this->visibility = ClassType::VISIBILITY_PROTECTED; - return $this; - } - - - public function isProtected(): bool - { - return $this->visibility === ClassType::VISIBILITY_PROTECTED; - } - - - /** @return static */ - public function setPrivate(): self - { - $this->visibility = ClassType::VISIBILITY_PRIVATE; - return $this; - } - - - public function isPrivate(): bool - { - return $this->visibility === ClassType::VISIBILITY_PRIVATE; - } -} diff --git a/vendor/nette/php-generator/src/PhpGenerator/Type.php b/vendor/nette/php-generator/src/PhpGenerator/Type.php deleted file mode 100644 index f756855..0000000 --- a/vendor/nette/php-generator/src/PhpGenerator/Type.php +++ /dev/null @@ -1,73 +0,0 @@ -=7.1", - "ext-tokenizer": "*", - "nette/finder": "^2.5 || ^3.0", - "nette/utils": "^3.0" - }, - "require-dev": { - "nette/tester": "^2.0", - "tracy/tracy": "^2.3", - "phpstan/phpstan": "^0.12" - }, - "autoload": { - "classmap": ["src/"] - }, - "minimum-stability": "dev", - "scripts": { - "phpstan": "phpstan analyse", - "tester": "tester tests -s" - }, - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - } -} diff --git a/vendor/nette/robot-loader/contributing.md b/vendor/nette/robot-loader/contributing.md deleted file mode 100644 index 184152c..0000000 --- a/vendor/nette/robot-loader/contributing.md +++ /dev/null @@ -1,33 +0,0 @@ -How to contribute & use the issue tracker -========================================= - -Nette welcomes your contributions. There are several ways to help out: - -* Create an issue on GitHub, if you have found a bug -* Write test cases for open bug issues -* Write fixes for open bug/feature issues, preferably with test cases included -* Contribute to the [documentation](https://nette.org/en/writing) - -Issues ------- - -Please **do not use the issue tracker to ask questions**. We will be happy to help you -on [Nette forum](https://forum.nette.org) or chat with us on [Gitter](https://gitter.im/nette/nette). - -A good bug report shouldn't leave others needing to chase you up for more -information. Please try to be as detailed as possible in your report. - -**Feature requests** are welcome. But take a moment to find out whether your idea -fits with the scope and aims of the project. It's up to *you* to make a strong -case to convince the project's developers of the merits of this feature. - -Contributing ------------- - -If you'd like to contribute, please take a moment to read [the contributing guide](https://nette.org/en/contributing). - -The best way to propose a feature is to discuss your ideas on [Nette forum](https://forum.nette.org) before implementing them. - -Please do not fix whitespace, format code, or make a purely cosmetic patch. - -Thanks! :heart: diff --git a/vendor/nette/robot-loader/license.md b/vendor/nette/robot-loader/license.md deleted file mode 100644 index cf741bd..0000000 --- a/vendor/nette/robot-loader/license.md +++ /dev/null @@ -1,60 +0,0 @@ -Licenses -======== - -Good news! You may use Nette Framework under the terms of either -the New BSD License or the GNU General Public License (GPL) version 2 or 3. - -The BSD License is recommended for most projects. It is easy to understand and it -places almost no restrictions on what you can do with the framework. If the GPL -fits better to your project, you can use the framework under this license. - -You don't have to notify anyone which license you are using. You can freely -use Nette Framework in commercial projects as long as the copyright header -remains intact. - -Please be advised that the name "Nette Framework" is a protected trademark and its -usage has some limitations. So please do not use word "Nette" in the name of your -project or top-level domain, and choose a name that stands on its own merits. -If your stuff is good, it will not take long to establish a reputation for yourselves. - - -New BSD License ---------------- - -Copyright (c) 2004, 2014 David Grudl (https://davidgrudl.com) -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - * Neither the name of "Nette Framework" nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -This software is provided by the copyright holders and contributors "as is" and -any express or implied warranties, including, but not limited to, the implied -warranties of merchantability and fitness for a particular purpose are -disclaimed. In no event shall the copyright owner or contributors be liable for -any direct, indirect, incidental, special, exemplary, or consequential damages -(including, but not limited to, procurement of substitute goods or services; -loss of use, data, or profits; or business interruption) however caused and on -any theory of liability, whether in contract, strict liability, or tort -(including negligence or otherwise) arising in any way out of the use of this -software, even if advised of the possibility of such damage. - - -GNU General Public License --------------------------- - -GPL licenses are very very long, so instead of including them here we offer -you URLs with full text: - -- [GPL version 2](http://www.gnu.org/licenses/gpl-2.0.html) -- [GPL version 3](http://www.gnu.org/licenses/gpl-3.0.html) diff --git a/vendor/nette/robot-loader/readme.md b/vendor/nette/robot-loader/readme.md deleted file mode 100644 index 6d782a2..0000000 --- a/vendor/nette/robot-loader/readme.md +++ /dev/null @@ -1,131 +0,0 @@ -RobotLoader: comfortable autoloading -==================================== - -[![Downloads this Month](https://img.shields.io/packagist/dm/nette/robot-loader.svg)](https://packagist.org/packages/nette/robot-loader) -[![Tests](https://github.com/nette/robot-loader/workflows/Tests/badge.svg?branch=master)](https://github.com/nette/robot-loader/actions) -[![Coverage Status](https://coveralls.io/repos/github/nette/robot-loader/badge.svg?branch=master)](https://coveralls.io/github/nette/robot-loader?branch=master) -[![Latest Stable Version](https://poser.pugx.org/nette/robot-loader/v/stable)](https://github.com/nette/robot-loader/releases) -[![License](https://img.shields.io/badge/license-New%20BSD-blue.svg)](https://github.com/nette/robot-loader/blob/master/license.md) - - -Introduction ------------- - -RobotLoader is a tool that gives you comfort of automated class loading for your entire application including third-party libraries. - -- get rid of all `require` -- does not require strict directory or file naming conventions -- extremely fast -- no manual cache updates, everything runs automatically -- highly mature, stable and widely used library - -So we can forget about those famous code blocks: - -```php -require_once 'Utils/Page.php'; -require_once 'Utils/Style.php'; -require_once 'Utils/Paginator.php'; -... -``` - -[Support Me](https://github.com/sponsors/dg) --------------------------------------------- - -Do you like RobotLoader? Are you looking forward to the new features? - -[![Buy me a coffee](https://files.nette.org/icons/donation-3.svg)](https://github.com/sponsors/dg) - -Thank you! - - -Installation ------------- - -The recommended way to install is via Composer: - -```shell -composer require nette/robot-loader -``` - -It requires PHP version 7.1 and supports PHP up to 8.1. - - -Usage ------ - -Like the Google robot crawls and indexes websites, [RobotLoader](https://api.nette.org/3.0/Nette/Loaders/RobotLoader.html) crawls all PHP scripts and records what classes and interfaces were found in them. These records are then saved in cache and used during all subsequent requests. You just need to specify what directories to index and where to save the cache: - -```php -$loader = new Nette\Loaders\RobotLoader; - -// directories to be indexed by RobotLoader (including subdirectories) -$loader->addDirectory(__DIR__ . '/app'); -$loader->addDirectory(__DIR__ . '/libs'); - -// use 'temp' directory for cache -$loader->setTempDirectory(__DIR__ . '/temp'); -$loader->register(); // Run the RobotLoader -``` - -And that's all. From now on, you don't need to use `require`. Great, isn't it? - -When RobotLoader encounters duplicate class name during indexing, it throws an exception and informs you about it. RobotLoader also automatically updates the cache when it has to load a class it doesn't know. We recommend disabling this on production servers, see [Caching](#Caching). - -If you want RobotLoader to skip some directories, use `$loader->excludeDirectory('temp')` (it can be called multiple times or you can pass multiple directories). - -By default, RobotLoader reports errors in PHP files by throwing exception `ParseError`. It can be disabled via `$loader->reportParseErrors(false)`. - - -PHP Files Analyzer ------------------- - -RobotLoader can also be used purely to find classes, interfaces, and trait in PHP files **without** using the autoloading feature: - -```php -$loader = new Nette\Loaders\RobotLoader; -$loader->addDirectory(__DIR__ . '/app'); - -// Scans directories for classes / intefaces / traits -$loader->rebuild(); - -// Returns array of class => filename pairs -$res = $loader->getIndexedClasses(); -``` - -Even with such use, you can use the cache. As a result, unmodified files will not be repeatedly analyzed when rescanning: - -```php -$loader = new Nette\Loaders\RobotLoader; -$loader->addDirectory(__DIR__ . '/app'); -$loader->setTempDirectory(__DIR__ . '/temp'); - -// Scans directories using a cache -$loader->refresh(); - -// Returns array of class => filename pairs -$res = $loader->getIndexedClasses(); -``` - -Caching -------- - -RobotLoader is very fast because it cleverly uses the cache. - -When developing with it, you have practically no idea that it runs on the background. It continuously updates the cache because it knows that classes and files can be created, deleted, renamed, etc. And it doesn't repeatedly scan unmodified files. - -When used on a production server, on the other hand, we recommend disabling the cache update using `$loader->setAutoRefresh(false)`, because the files are not changing. At the same time, it is necessary to **clear the cache** when uploading a new version on the hosting. - -Of course, the initial scanning of files, when the cache does not already exist, may take a few seconds for larger applications. RobotLoader has built-in prevention against [cache stampede](https://en.wikipedia.org/wiki/Cache_stampede). -This is a situation where production server receives a large number of concurrent requests and because RobotLoader's cache does not yet exist, they would all start scanning the files. Which spikes CPU and filesystem usage. -Fortunately, RobotLoader works in such a way that for multiple concurrent requests, only the first thread indexes the files, creates a cache, the others wait, and then use the cache. - - -PSR-4 ------ - -Today, Composer can be used for autoloading in compliance with PSR-4. Simply saying, it is a system where the namespaces and class names correspond to the directory structure and file names, ie `App\Router\RouterFactory` is located in the file `/path/to/App/Router/RouterFactory.php`. - -RobotLoader is not tied to any fixed structure, therefore, it is useful in situations where it does not suit you to have the directory structure designed as namespaces in PHP, or when you are developing an application that has historically not used such conventions. It is also possible to use both loaders together. - - -If you like RobotLoader, **[please make a donation now](https://nette.org/donate)**. Thank you! diff --git a/vendor/nette/robot-loader/src/RobotLoader/RobotLoader.php b/vendor/nette/robot-loader/src/RobotLoader/RobotLoader.php deleted file mode 100644 index 7207eb6..0000000 --- a/vendor/nette/robot-loader/src/RobotLoader/RobotLoader.php +++ /dev/null @@ -1,541 +0,0 @@ - - * $loader = new Nette\Loaders\RobotLoader; - * $loader->addDirectory('app'); - * $loader->excludeDirectory('app/exclude'); - * $loader->setTempDirectory('temp'); - * $loader->register(); - * - */ -class RobotLoader -{ - use Nette\SmartObject; - - private const RETRY_LIMIT = 3; - - /** @var string[] */ - public $ignoreDirs = ['.*', '*.old', '*.bak', '*.tmp', 'temp']; - - /** @var string[] */ - public $acceptFiles = ['*.php']; - - /** @var bool */ - private $autoRebuild = true; - - /** @var bool */ - private $reportParseErrors = true; - - /** @var string[] */ - private $scanPaths = []; - - /** @var string[] */ - private $excludeDirs = []; - - /** @var array class => [file, time] */ - private $classes = []; - - /** @var bool */ - private $cacheLoaded = false; - - /** @var bool */ - private $refreshed = false; - - /** @var array class => counter */ - private $missingClasses = []; - - /** @var array file => mtime */ - private $emptyFiles = []; - - /** @var string|null */ - private $tempDirectory; - - /** @var bool */ - private $needSave = false; - - - public function __construct() - { - if (!extension_loaded('tokenizer')) { - throw new Nette\NotSupportedException('PHP extension Tokenizer is not loaded.'); - } - } - - - public function __destruct() - { - if ($this->needSave) { - $this->saveCache(); - } - } - - - /** - * Register autoloader. - */ - public function register(bool $prepend = false): self - { - spl_autoload_register([$this, 'tryLoad'], true, $prepend); - return $this; - } - - - /** - * Handles autoloading of classes, interfaces or traits. - */ - public function tryLoad(string $type): void - { - $this->loadCache(); - - $missing = $this->missingClasses[$type] ?? null; - if ($missing >= self::RETRY_LIMIT) { - return; - } - - [$file, $mtime] = $this->classes[$type] ?? null; - - if ($this->autoRebuild) { - if (!$this->refreshed) { - if (!$file || !is_file($file)) { - $this->refreshClasses(); - [$file] = $this->classes[$type] ?? null; - $this->needSave = true; - - } elseif (filemtime($file) !== $mtime) { - $this->updateFile($file); - [$file] = $this->classes[$type] ?? null; - $this->needSave = true; - } - } - - if (!$file || !is_file($file)) { - $this->missingClasses[$type] = ++$missing; - $this->needSave = $this->needSave || $file || ($missing <= self::RETRY_LIMIT); - unset($this->classes[$type]); - $file = null; - } - } - - if ($file) { - (static function ($file) { require $file; })($file); - } - } - - - /** - * Add path or paths to list. - * @param string ...$paths absolute path - */ - public function addDirectory(...$paths): self - { - if (is_array($paths[0] ?? null)) { - trigger_error(__METHOD__ . '() use variadics ...$paths to add an array of paths.', E_USER_WARNING); - $paths = $paths[0]; - } - $this->scanPaths = array_merge($this->scanPaths, $paths); - return $this; - } - - - public function reportParseErrors(bool $on = true): self - { - $this->reportParseErrors = $on; - return $this; - } - - - /** - * Excludes path or paths from list. - * @param string ...$paths absolute path - */ - public function excludeDirectory(...$paths): self - { - if (is_array($paths[0] ?? null)) { - trigger_error(__METHOD__ . '() use variadics ...$paths to add an array of paths.', E_USER_WARNING); - $paths = $paths[0]; - } - $this->excludeDirs = array_merge($this->excludeDirs, $paths); - return $this; - } - - - /** - * @return array class => filename - */ - public function getIndexedClasses(): array - { - $this->loadCache(); - $res = []; - foreach ($this->classes as $class => [$file]) { - $res[$class] = $file; - } - return $res; - } - - - /** - * Rebuilds class list cache. - */ - public function rebuild(): void - { - $this->cacheLoaded = true; - $this->classes = $this->missingClasses = $this->emptyFiles = []; - $this->refreshClasses(); - if ($this->tempDirectory) { - $this->saveCache(); - } - } - - - /** - * Refreshes class list cache. - */ - public function refresh(): void - { - $this->loadCache(); - if (!$this->refreshed) { - $this->refreshClasses(); - $this->saveCache(); - } - } - - - /** - * Refreshes $this->classes & $this->emptyFiles. - */ - private function refreshClasses(): void - { - $this->refreshed = true; // prevents calling refreshClasses() or updateFile() in tryLoad() - $files = $this->emptyFiles; - $classes = []; - foreach ($this->classes as $class => [$file, $mtime]) { - $files[$file] = $mtime; - $classes[$file][] = $class; - } - $this->classes = $this->emptyFiles = []; - - foreach ($this->scanPaths as $path) { - $iterator = is_file($path) - ? [new SplFileInfo($path)] - : $this->createFileIterator($path); - - foreach ($iterator as $fileInfo) { - $mtime = $fileInfo->getMTime(); - $file = $fileInfo->getPathname(); - $foundClasses = isset($files[$file]) && $files[$file] === $mtime - ? ($classes[$file] ?? []) - : $this->scanPhp($file); - - if (!$foundClasses) { - $this->emptyFiles[$file] = $mtime; - } - - $files[$file] = $mtime; - $classes[$file] = []; // prevents the error when adding the same file twice - - foreach ($foundClasses as $class) { - if (isset($this->classes[$class])) { - throw new Nette\InvalidStateException("Ambiguous class $class resolution; defined in {$this->classes[$class][0]} and in $file."); - } - $this->classes[$class] = [$file, $mtime]; - unset($this->missingClasses[$class]); - } - } - } - } - - - /** - * Creates an iterator scaning directory for PHP files, subdirectories and 'netterobots.txt' files. - * @throws Nette\IOException if path is not found - */ - private function createFileIterator(string $dir): Nette\Utils\Finder - { - if (!is_dir($dir)) { - throw new Nette\IOException("File or directory '$dir' not found."); - } - $dir = realpath($dir) ?: $dir; // realpath does not work in phar - - if (is_string($ignoreDirs = $this->ignoreDirs)) { - trigger_error(self::class . ': $ignoreDirs must be an array.', E_USER_WARNING); - $ignoreDirs = preg_split('#[,\s]+#', $ignoreDirs); - } - $disallow = []; - foreach (array_merge($ignoreDirs, $this->excludeDirs) as $item) { - if ($item = realpath($item)) { - $disallow[str_replace('\\', '/', $item)] = true; - } - } - - if (is_string($acceptFiles = $this->acceptFiles)) { - trigger_error(self::class . ': $acceptFiles must be an array.', E_USER_WARNING); - $acceptFiles = preg_split('#[,\s]+#', $acceptFiles); - } - - $iterator = Nette\Utils\Finder::findFiles($acceptFiles) - ->filter(function (SplFileInfo $file) use (&$disallow) { - return $file->getRealPath() === false - ? true - : !isset($disallow[str_replace('\\', '/', $file->getRealPath())]); - }) - ->from($dir) - ->exclude($ignoreDirs) - ->filter($filter = function (SplFileInfo $dir) use (&$disallow) { - if ($dir->getRealPath() === false) { - return true; - } - $path = str_replace('\\', '/', $dir->getRealPath()); - if (is_file("$path/netterobots.txt")) { - foreach (file("$path/netterobots.txt") as $s) { - if (preg_match('#^(?:disallow\\s*:)?\\s*(\\S+)#i', $s, $matches)) { - $disallow[$path . rtrim('/' . ltrim($matches[1], '/'), '/')] = true; - } - } - } - return !isset($disallow[$path]); - }); - - $filter(new SplFileInfo($dir)); - return $iterator; - } - - - private function updateFile(string $file): void - { - foreach ($this->classes as $class => [$prevFile]) { - if ($file === $prevFile) { - unset($this->classes[$class]); - } - } - - $foundClasses = is_file($file) ? $this->scanPhp($file) : []; - - foreach ($foundClasses as $class) { - [$prevFile, $prevMtime] = $this->classes[$class] ?? null; - - if (isset($prevFile) && @filemtime($prevFile) !== $prevMtime) { // @ file may not exists - $this->updateFile($prevFile); - [$prevFile] = $this->classes[$class] ?? null; - } - if (isset($prevFile)) { - throw new Nette\InvalidStateException("Ambiguous class $class resolution; defined in $prevFile and in $file."); - } - $this->classes[$class] = [$file, filemtime($file)]; - } - } - - - /** - * Searches classes, interfaces and traits in PHP file. - * @return string[] - */ - private function scanPhp(string $file): array - { - $code = file_get_contents($file); - $expected = false; - $namespace = $name = ''; - $level = $minLevel = 0; - $classes = []; - - try { - $tokens = token_get_all($code, TOKEN_PARSE); - } catch (\ParseError $e) { - if ($this->reportParseErrors) { - $rp = new \ReflectionProperty($e, 'file'); - $rp->setAccessible(true); - $rp->setValue($e, $file); - throw $e; - } - $tokens = []; - } - - foreach ($tokens as $token) { - if (is_array($token)) { - switch ($token[0]) { - case T_COMMENT: - case T_DOC_COMMENT: - case T_WHITESPACE: - continue 2; - - case T_STRING: - case PHP_VERSION_ID < 80000 - ? T_NS_SEPARATOR - : T_NAME_QUALIFIED: - if ($expected) { - $name .= $token[1]; - } - continue 2; - - case T_NAMESPACE: - case T_CLASS: - case T_INTERFACE: - case T_TRAIT: - case PHP_VERSION_ID < 80100 - ? T_CLASS - : T_ENUM: - $expected = $token[0]; - $name = ''; - continue 2; - case T_CURLY_OPEN: - case T_DOLLAR_OPEN_CURLY_BRACES: - $level++; - } - } - - if ($expected) { - if ($expected === T_NAMESPACE) { - $namespace = $name ? $name . '\\' : ''; - $minLevel = $token === '{' ? 1 : 0; - - } elseif ($name && $level === $minLevel) { - $classes[] = $namespace . $name; - } - $expected = null; - } - - if ($token === '{') { - $level++; - } elseif ($token === '}') { - $level--; - } - } - return $classes; - } - - - /********************* caching ****************d*g**/ - - - /** - * Sets auto-refresh mode. - */ - public function setAutoRefresh(bool $on = true): self - { - $this->autoRebuild = $on; - return $this; - } - - - /** - * Sets path to temporary directory. - */ - public function setTempDirectory(string $dir): self - { - Nette\Utils\FileSystem::createDir($dir); - $this->tempDirectory = $dir; - return $this; - } - - - /** - * Loads class list from cache. - */ - private function loadCache(): void - { - if ($this->cacheLoaded) { - return; - } - $this->cacheLoaded = true; - - $file = $this->getCacheFile(); - - // Solving atomicity to work everywhere is really pain in the ass. - // 1) We want to do as little as possible IO calls on production and also directory and file can be not writable (#19) - // so on Linux we include the file directly without shared lock, therefore, the file must be created atomically by renaming. - // 2) On Windows file cannot be renamed-to while is open (ie by include() #11), so we have to acquire a lock. - $lock = defined('PHP_WINDOWS_VERSION_BUILD') - ? $this->acquireLock("$file.lock", LOCK_SH) - : null; - - $data = @include $file; // @ file may not exist - if (is_array($data)) { - [$this->classes, $this->missingClasses, $this->emptyFiles] = $data; - return; - } - - if ($lock) { - flock($lock, LOCK_UN); // release shared lock so we can get exclusive - } - $lock = $this->acquireLock("$file.lock", LOCK_EX); - - // while waiting for exclusive lock, someone might have already created the cache - $data = @include $file; // @ file may not exist - if (is_array($data)) { - [$this->classes, $this->missingClasses, $this->emptyFiles] = $data; - return; - } - - $this->classes = $this->missingClasses = $this->emptyFiles = []; - $this->refreshClasses(); - $this->saveCache($lock); - // On Windows concurrent creation and deletion of a file can cause a 'permission denied' error, - // therefore, we will not delete the lock file. Windows is a piece of shit. - } - - - /** - * Writes class list to cache. - * @param resource $lock - */ - private function saveCache($lock = null): void - { - // we have to acquire a lock to be able safely rename file - // on Linux: that another thread does not rename the same named file earlier - // on Windows: that the file is not read by another thread - $file = $this->getCacheFile(); - $lock = $lock ?: $this->acquireLock("$file.lock", LOCK_EX); - $code = "classes, $this->missingClasses, $this->emptyFiles], true) . ";\n"; - - if (file_put_contents("$file.tmp", $code) !== strlen($code) || !rename("$file.tmp", $file)) { - @unlink("$file.tmp"); // @ file may not exist - throw new \RuntimeException("Unable to create '$file'."); - } - if (function_exists('opcache_invalidate')) { - @opcache_invalidate($file, true); // @ can be restricted - } - } - - - /** @return resource */ - private function acquireLock(string $file, int $mode) - { - $handle = @fopen($file, 'w'); // @ is escalated to exception - if (!$handle) { - throw new \RuntimeException("Unable to create file '$file'. " . error_get_last()['message']); - } elseif (!@flock($handle, $mode)) { // @ is escalated to exception - throw new \RuntimeException('Unable to acquire ' . ($mode & LOCK_EX ? 'exclusive' : 'shared') . " lock on file '$file'. " . error_get_last()['message']); - } - return $handle; - } - - - private function getCacheFile(): string - { - if (!$this->tempDirectory) { - throw new \LogicException('Set path to temporary directory using setTempDirectory().'); - } - return $this->tempDirectory . '/' . md5(serialize($this->getCacheKey())) . '.php'; - } - - - protected function getCacheKey(): array - { - return [$this->ignoreDirs, $this->acceptFiles, $this->scanPaths, $this->excludeDirs, 'v2']; - } -} diff --git a/vendor/nette/schema/composer.json b/vendor/nette/schema/composer.json deleted file mode 100644 index b8e23e4..0000000 --- a/vendor/nette/schema/composer.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "nette/schema", - "description": "📐 Nette Schema: validating data structures against a given Schema.", - "keywords": ["nette", "config"], - "homepage": "https://nette.org", - "license": ["BSD-3-Clause", "GPL-2.0-only", "GPL-3.0-only"], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "require": { - "php": ">=7.1 <8.2", - "nette/utils": "^2.5.7 || ^3.1.5 || ^4.0" - }, - "require-dev": { - "nette/tester": "^2.3 || ^2.4", - "tracy/tracy": "^2.7", - "phpstan/phpstan-nette": "^0.12" - }, - "autoload": { - "classmap": ["src/"] - }, - "minimum-stability": "dev", - "scripts": { - "phpstan": "phpstan analyse", - "tester": "tester tests -s" - }, - "extra": { - "branch-alias": { - "dev-master": "1.2-dev" - } - } -} diff --git a/vendor/nette/schema/contributing.md b/vendor/nette/schema/contributing.md deleted file mode 100644 index 184152c..0000000 --- a/vendor/nette/schema/contributing.md +++ /dev/null @@ -1,33 +0,0 @@ -How to contribute & use the issue tracker -========================================= - -Nette welcomes your contributions. There are several ways to help out: - -* Create an issue on GitHub, if you have found a bug -* Write test cases for open bug issues -* Write fixes for open bug/feature issues, preferably with test cases included -* Contribute to the [documentation](https://nette.org/en/writing) - -Issues ------- - -Please **do not use the issue tracker to ask questions**. We will be happy to help you -on [Nette forum](https://forum.nette.org) or chat with us on [Gitter](https://gitter.im/nette/nette). - -A good bug report shouldn't leave others needing to chase you up for more -information. Please try to be as detailed as possible in your report. - -**Feature requests** are welcome. But take a moment to find out whether your idea -fits with the scope and aims of the project. It's up to *you* to make a strong -case to convince the project's developers of the merits of this feature. - -Contributing ------------- - -If you'd like to contribute, please take a moment to read [the contributing guide](https://nette.org/en/contributing). - -The best way to propose a feature is to discuss your ideas on [Nette forum](https://forum.nette.org) before implementing them. - -Please do not fix whitespace, format code, or make a purely cosmetic patch. - -Thanks! :heart: diff --git a/vendor/nette/schema/license.md b/vendor/nette/schema/license.md deleted file mode 100644 index cf741bd..0000000 --- a/vendor/nette/schema/license.md +++ /dev/null @@ -1,60 +0,0 @@ -Licenses -======== - -Good news! You may use Nette Framework under the terms of either -the New BSD License or the GNU General Public License (GPL) version 2 or 3. - -The BSD License is recommended for most projects. It is easy to understand and it -places almost no restrictions on what you can do with the framework. If the GPL -fits better to your project, you can use the framework under this license. - -You don't have to notify anyone which license you are using. You can freely -use Nette Framework in commercial projects as long as the copyright header -remains intact. - -Please be advised that the name "Nette Framework" is a protected trademark and its -usage has some limitations. So please do not use word "Nette" in the name of your -project or top-level domain, and choose a name that stands on its own merits. -If your stuff is good, it will not take long to establish a reputation for yourselves. - - -New BSD License ---------------- - -Copyright (c) 2004, 2014 David Grudl (https://davidgrudl.com) -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - * Neither the name of "Nette Framework" nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -This software is provided by the copyright holders and contributors "as is" and -any express or implied warranties, including, but not limited to, the implied -warranties of merchantability and fitness for a particular purpose are -disclaimed. In no event shall the copyright owner or contributors be liable for -any direct, indirect, incidental, special, exemplary, or consequential damages -(including, but not limited to, procurement of substitute goods or services; -loss of use, data, or profits; or business interruption) however caused and on -any theory of liability, whether in contract, strict liability, or tort -(including negligence or otherwise) arising in any way out of the use of this -software, even if advised of the possibility of such damage. - - -GNU General Public License --------------------------- - -GPL licenses are very very long, so instead of including them here we offer -you URLs with full text: - -- [GPL version 2](http://www.gnu.org/licenses/gpl-2.0.html) -- [GPL version 3](http://www.gnu.org/licenses/gpl-3.0.html) diff --git a/vendor/nette/schema/readme.md b/vendor/nette/schema/readme.md deleted file mode 100644 index 330f291..0000000 --- a/vendor/nette/schema/readme.md +++ /dev/null @@ -1,441 +0,0 @@ -Nette Schema -************ - -[![Downloads this Month](https://img.shields.io/packagist/dm/nette/schema.svg)](https://packagist.org/packages/nette/schema) -[![Tests](https://github.com/nette/schema/workflows/Tests/badge.svg?branch=master)](https://github.com/nette/schema/actions) -[![Coverage Status](https://coveralls.io/repos/github/nette/schema/badge.svg?branch=master)](https://coveralls.io/github/nette/schema?branch=master) -[![Latest Stable Version](https://poser.pugx.org/nette/schema/v/stable)](https://github.com/nette/schema/releases) -[![License](https://img.shields.io/badge/license-New%20BSD-blue.svg)](https://github.com/nette/schema/blob/master/license.md) - - -Introduction -============ - -A practical library for validation and normalization of data structures against a given schema with a smart & easy-to-understand API. - -Documentation can be found on the [website](https://doc.nette.org/schema). - -Installation: - -```shell -composer require nette/schema -``` - -It requires PHP version 7.1 and supports PHP up to 8.1. - - -[Support Me](https://github.com/sponsors/dg) --------------------------------------------- - -Do you like Nette Schema? Are you looking forward to the new features? - -[![Buy me a coffee](https://files.nette.org/icons/donation-3.svg)](https://github.com/sponsors/dg) - -Thank you! - - -Basic Usage ------------ - -In variable `$schema` we have a validation schema (what exactly this means and how to create it we will say later) and in variable `$data` we have a data structure that we want to validate and normalize. This can be, for example, data sent by the user through an API, configuration file, etc. - -The task is handled by the [Nette\Schema\Processor](https://api.nette.org/3.0/Nette/Schema/Processor.html) class, which processes the input and either returns normalized data or throws an [Nette\Schema\ValidationException](https://api.nette.org/3.0/Nette/Schema/ValidationException.html) exception on error. - -```php -$processor = new Nette\Schema\Processor; - -try { - $normalized = $processor->process($schema, $data); -} catch (Nette\Schema\ValidationException $e) { - echo 'Data is invalid: ' . $e->getMessage(); -} -``` - -Method `$e->getMessages()` returns array of all message strings and `$e->getMessageObjects()` return all messages as [Nette\Schema\Message](https://api.nette.org/3.1/Nette/Schema/Message.html) objects. - - -Defining Schema ---------------- - -And now let's create a schema. The class [Nette\Schema\Expect](https://api.nette.org/3.0/Nette/Schema/Expect.html) is used to define it, we actually define expectations of what the data should look like. Let's say that the input data must be a structure (e.g. an array) containing elements `processRefund` of type bool and `refundAmount` of type int. - -```php -use Nette\Schema\Expect; - -$schema = Expect::structure([ - 'processRefund' => Expect::bool(), - 'refundAmount' => Expect::int(), -]); -``` - -We believe that the schema definition looks clear, even if you see it for the very first time. - -Lets send the following data for validation: - -```php -$data = [ - 'processRefund' => true, - 'refundAmount' => 17, -]; - -$normalized = $processor->process($schema, $data); // OK, it passes -``` - -The output, i.e. the value `$normalized`, is the object `stdClass`. If we want the output to be an array, we add a cast to schema `Expect::structure([...])->castTo('array')`. - -All elements of the structure are optional and have a default value `null`. Example: - -```php -$data = [ - 'refundAmount' => 17, -]; - -$normalized = $processor->process($schema, $data); // OK, it passes -// $normalized = {'processRefund' => null, 'refundAmount' => 17} -``` - -The fact that the default value is `null` does not mean that it would be accepted in the input data `'processRefund' => null`. No, the input must be boolean, i.e. only `true` or `false`. We would have to explicitly allow `null` via `Expect::bool()->nullable()`. - -An item can be made mandatory using `Expect::bool()->required()`. We change the default value to `false` using `Expect::bool()->default(false)` or shortly using `Expect::bool(false)`. - -And what if we wanted to accept `1` and `0` besides booleans? Then we list the allowed values, which we will also normalize to boolean: - -```php -$schema = Expect::structure([ - 'processRefund' => Expect::anyOf(true, false, 1, 0)->castTo('bool'), - 'refundAmount' => Expect::int(), -]); - -$normalized = $processor->process($schema, $data); -is_bool($normalized->processRefund); // true -``` - -Now you know the basics of how the schema is defined and how the individual elements of the structure behave. We will now show what all the other elements can be used in defining a schema. - - - -Data Types: type() ------------------- - -All standard PHP data types can be listed in the schema: - -```php -Expect::string($default = null) -Expect::int($default = null) -Expect::float($default = null) -Expect::bool($default = null) -Expect::null() -Expect::array($default = []) -``` - -And then all types [supported by the Validators](https://doc.nette.org/validators#toc-validation-rules) via `Expect::type('scalar')` or abbreviated `Expect::scalar()`. Also class or interface names are accepted, e.g. `Expect::type('AddressEntity')`. - -You can also use union notation: - -```php -Expect::type('bool|string|array') -``` - -The default value is always `null` except for `array` and `list`, where it is an empty array. (A list is an array indexed in ascending order of numeric keys from zero, that is, a non-associative array). - - -Array of Values: arrayOf() listOf() ------------------------------------ - -The array is too general structure, it is more useful to specify exactly what elements it can contain. For example, an array whose elements can only be strings: - -```php -$schema = Expect::arrayOf('string'); - -$processor->process($schema, ['hello', 'world']); // OK -$processor->process($schema, ['a' => 'hello', 'b' => 'world']); // OK -$processor->process($schema, ['key' => 123]); // ERROR: 123 is not a string -``` - -The list is an indexed array: - -```php -$schema = Expect::listOf('string'); - -$processor->process($schema, ['a', 'b']); // OK -$processor->process($schema, ['a', 123]); // ERROR: 123 is not a string -$processor->process($schema, ['key' => 'a']); // ERROR: is not a list -$processor->process($schema, [1 => 'a', 0 => 'b']); // ERROR: is not a list -``` - -The parameter can also be a schema, so we can write: - -```php -Expect::arrayOf(Expect::bool()) -``` - -The default value is an empty array. If you specify default value, it will be merged with the passed data. This can be disabled using `mergeDefaults(false)`. - - -Enumeration: anyOf() --------------------- - -`anyOf()` is a set of values ​​or schemas that a value can be. Here's how to write an array of elements that can be either `'a'`, `true`, or `null`: - -```php -$schema = Expect::listOf( - Expect::anyOf('a', true, null) -); - -$processor->process($schema, ['a', true, null, 'a']); // OK -$processor->process($schema, ['a', false]); // ERROR: false does not belong there -``` - -The enumeration elements can also be schemas: - -```php -$schema = Expect::listOf( - Expect::anyOf(Expect::string(), true, null) -); - -$processor->process($schema, ['foo', true, null, 'bar']); // OK -$processor->process($schema, [123]); // ERROR -``` - -The default value is `null`. - - -Structures ----------- - -Structures are objects with defined keys. Each of these key => value pairs is referred to as a "property": - -Structures accept arrays and objects and return objects `stdClass` (unless you change it with `castTo('array')`, etc.). - -By default, all properties are optional and have a default value of `null`. You can define mandatory properties using `required()`: - -```php -$schema = Expect::structure([ - 'required' => Expect::string()->required(), - 'optional' => Expect::string(), // the default value is null -]); - -$processor->process($schema, ['optional' => '']); -// ERROR: item 'required' is missing - -$processor->process($schema, ['required' => 'foo']); -// OK, returns {'required' => 'foo', 'optional' => null} -``` - -Although `null` is the default value of the `optional` property, it is not allowed in the input data (the value must be a string). Properties accepting `null` are defined using `nullable()`: - -```php -$schema = Expect::structure([ - 'optional' => Expect::string(), - 'nullable' => Expect::string()->nullable(), -]); - -$processor->process($schema, ['optional' => null]); -// ERROR: 'optional' expects to be string, null given. - -$processor->process($schema, ['nullable' => null]); -// OK, returns {'optional' => null, 'nullable' => null} -``` - -By default, there can be no extra items in the input data: - -```php -$schema = Expect::structure([ - 'key' => Expect::string(), -]); - -$processor->process($schema, ['additional' => 1]); -// ERROR: Unexpected item 'additional' -``` - -Which we can change with `otherItems()`. As a parameter, we will specify the schema for each extra element: - -```php -$schema = Expect::structure([ - 'key' => Expect::string(), -])->otherItems(Expect::int()); - -$processor->process($schema, ['additional' => 1]); // OK -$processor->process($schema, ['additional' => true]); // ERROR -``` - -Deprecations ------------- - -You can deprecate property using the `deprecated([string $message])` method. Deprecation notices are returned by `$processor->getWarnings()` (since v1.1): - -```php -$schema = Expect::structure([ - 'old' => Expect::int()->deprecated('The item %path% is deprecated'), -]); - -$processor->process($schema, ['old' => 1]); // OK -$processor->getWarnings(); // ["The item 'old' is deprecated"] -``` - -Ranges: min() max() -------------------- - -Use `min()` and `max()` to limit the number of elements for arrays: - -```php -// array, at least 10 items, maximum 20 items -Expect::array()->min(10)->max(20); -``` - -For strings, limit their length: - -```php -// string, at least 10 characters long, maximum 20 characters -Expect::string()->min(10)->max(20); -``` - -For numbers, limit their value: - -```php -// integer, between 10 and 20 inclusive -Expect::int()->min(10)->max(20); -``` - -Of course, it is possible to mention only `min()`, or only `max()`: - -```php -// string, maximum 20 characters -Expect::string()->max(20); -``` - - -Regular Expressions: pattern() ------------------------------- - -Using `pattern()`, you can specify a regular expression which the **whole** input string must match (i.e. as if it were wrapped in characters `^` a `$`): - -```php -// just 9 digits -Expect::string()->pattern('\d{9}'); -``` - - -Custom Assertions: assert() ---------------------------- - -You can add any other restrictions using `assert(callable $fn)`. - -```php -$countIsEven = function ($v) { return count($v) % 2 === 0; }; - -$schema = Expect::arrayOf('string') - ->assert($countIsEven); // the count must be even - -$processor->process($schema, ['a', 'b']); // OK -$processor->process($schema, ['a', 'b', 'c']); // ERROR: 3 is not even -``` - -Or - -```php -Expect::string()->assert('is_file'); // the file must exist -``` - -You can add your own description for each assertions. It will be part of the error message. - -```php -$schema = Expect::arrayOf('string') - ->assert($countIsEven, 'Even items in array'); - -$processor->process($schema, ['a', 'b', 'c']); -// Failed assertion "Even items in array" for item with value array. -``` - -The method can be called repeatedly to add more assertions. - - -Mapping to Objects: from() --------------------------- - -You can generate structure schema from the class. Example: - -```php -class Config -{ - /** @var string */ - public $name; - /** @var string|null */ - public $password; - /** @var bool */ - public $admin = false; -} - -$schema = Expect::from(new Config); - -$data = [ - 'name' => 'jeff', -]; - -$normalized = $processor->process($schema, $data); -// $normalized instanceof Config -// $normalized = {'name' => 'jeff', 'password' => null, 'admin' => false} -``` - -If you are using PHP 7.4 or higher, you can use native types: - -```php -class Config -{ - public string $name; - public ?string $password; - public bool $admin = false; -} - -$schema = Expect::from(new Config); -``` - -Anonymous classes are also supported: - -```php -$schema = Expect::from(new class { - public string $name; - public ?string $password; - public bool $admin = false; -}); -``` - -Because the information obtained from the class definition may not be sufficient, you can add a custom schema for the elements with the second parameter: - -```php -$schema = Expect::from(new Config, [ - 'name' => Expect::string()->pattern('\w:.*'), -]); -``` - - -Casting: castTo() ------------------ - -Successfully validated data can be cast: - -```php -Expect::scalar()->castTo('string'); -``` - -In addition to native PHP types, you can also cast to classes: - -```php -Expect::scalar()->castTo('AddressEntity'); -``` - - -Normalization: before() ------------------------ - -Prior to the validation itself, the data can be normalized using the method `before()`. As an example, let's have an element that must be an array of strings (eg `['a', 'b', 'c']`), but receives input in the form of a string `a b c`: - -```php -$explode = function ($v) { return explode(' ', $v); }; - -$schema = Expect::arrayOf('string') - ->before($explode); - -$normalized = $processor->process($schema, 'a b c'); -// OK, returns ['a', 'b', 'c'] -``` diff --git a/vendor/nette/schema/src/Schema/Context.php b/vendor/nette/schema/src/Schema/Context.php deleted file mode 100644 index e486d2e..0000000 --- a/vendor/nette/schema/src/Schema/Context.php +++ /dev/null @@ -1,49 +0,0 @@ -isKey; - return $this->errors[] = new Message($message, $code, $this->path, $variables); - } - - - public function addWarning(string $message, string $code, array $variables = []): Message - { - return $this->warnings[] = new Message($message, $code, $this->path, $variables); - } -} diff --git a/vendor/nette/schema/src/Schema/DynamicParameter.php b/vendor/nette/schema/src/Schema/DynamicParameter.php deleted file mode 100644 index 8dd6105..0000000 --- a/vendor/nette/schema/src/Schema/DynamicParameter.php +++ /dev/null @@ -1,15 +0,0 @@ -set = $set; - } - - - public function firstIsDefault(): self - { - $this->default = $this->set[0]; - return $this; - } - - - public function nullable(): self - { - $this->set[] = null; - return $this; - } - - - public function dynamic(): self - { - $this->set[] = new Type(Nette\Schema\DynamicParameter::class); - return $this; - } - - - /********************* processing ****************d*g**/ - - - public function normalize($value, Context $context) - { - return $this->doNormalize($value, $context); - } - - - public function merge($value, $base) - { - if (is_array($value) && isset($value[Helpers::PREVENT_MERGING])) { - unset($value[Helpers::PREVENT_MERGING]); - return $value; - } - return Helpers::merge($value, $base); - } - - - public function complete($value, Context $context) - { - $expecteds = $innerErrors = []; - foreach ($this->set as $item) { - if ($item instanceof Schema) { - $dolly = new Context; - $dolly->path = $context->path; - $res = $item->complete($item->normalize($value, $dolly), $dolly); - if (!$dolly->errors) { - $context->warnings = array_merge($context->warnings, $dolly->warnings); - return $this->doFinalize($res, $context); - } - foreach ($dolly->errors as $error) { - if ($error->path !== $context->path || empty($error->variables['expected'])) { - $innerErrors[] = $error; - } else { - $expecteds[] = $error->variables['expected']; - } - } - } else { - if ($item === $value) { - return $this->doFinalize($value, $context); - } - $expecteds[] = Nette\Schema\Helpers::formatValue($item); - } - } - - if ($innerErrors) { - $context->errors = array_merge($context->errors, $innerErrors); - } else { - $context->addError( - 'The %label% %path% expects to be %expected%, %value% given.', - Nette\Schema\Message::TYPE_MISMATCH, - [ - 'value' => $value, - 'expected' => implode('|', array_unique($expecteds)), - ] - ); - } - } - - - public function completeDefault(Context $context) - { - if ($this->required) { - $context->addError( - 'The mandatory item %path% is missing.', - Nette\Schema\Message::MISSING_ITEM - ); - return null; - } - if ($this->default instanceof Schema) { - return $this->default->completeDefault($context); - } - return $this->default; - } -} diff --git a/vendor/nette/schema/src/Schema/Elements/Base.php b/vendor/nette/schema/src/Schema/Elements/Base.php deleted file mode 100644 index 9dfc3d4..0000000 --- a/vendor/nette/schema/src/Schema/Elements/Base.php +++ /dev/null @@ -1,196 +0,0 @@ -default = $value; - return $this; - } - - - public function required(bool $state = true): self - { - $this->required = $state; - return $this; - } - - - public function before(callable $handler): self - { - $this->before = $handler; - return $this; - } - - - public function castTo(string $type): self - { - $this->castTo = $type; - return $this; - } - - - public function assert(callable $handler, string $description = null): self - { - $this->asserts[] = [$handler, $description]; - return $this; - } - - - /** Marks as deprecated */ - public function deprecated(string $message = 'The item %path% is deprecated.'): self - { - $this->deprecated = $message; - return $this; - } - - - public function completeDefault(Context $context) - { - if ($this->required) { - $context->addError( - 'The mandatory item %path% is missing.', - Nette\Schema\Message::MISSING_ITEM - ); - return null; - } - return $this->default; - } - - - public function doNormalize($value, Context $context) - { - if ($this->before) { - $value = ($this->before)($value); - } - return $value; - } - - - private function doDeprecation(Context $context): void - { - if ($this->deprecated !== null) { - $context->addWarning( - $this->deprecated, - Nette\Schema\Message::DEPRECATED - ); - } - } - - - private function doValidate($value, string $expected, Context $context): bool - { - if (!Nette\Utils\Validators::is($value, $expected)) { - $expected = str_replace(['|', ':'], [' or ', ' in range '], $expected); - $context->addError( - 'The %label% %path% expects to be %expected%, %value% given.', - Nette\Schema\Message::TYPE_MISMATCH, - ['value' => $value, 'expected' => $expected] - ); - return false; - } - return true; - } - - - private function doValidateRange($value, array $range, Context $context, string $types = ''): bool - { - if (is_array($value) || is_string($value)) { - [$length, $label] = is_array($value) - ? [count($value), 'items'] - : (in_array('unicode', explode('|', $types), true) - ? [Nette\Utils\Strings::length($value), 'characters'] - : [strlen($value), 'bytes']); - - if (!self::isInRange($length, $range)) { - $context->addError( - "The length of %label% %path% expects to be in range %expected%, %length% $label given.", - Nette\Schema\Message::LENGTH_OUT_OF_RANGE, - ['value' => $value, 'length' => $length, 'expected' => implode('..', $range)] - ); - return false; - } - - } elseif ((is_int($value) || is_float($value)) && !self::isInRange($value, $range)) { - $context->addError( - 'The %label% %path% expects to be in range %expected%, %value% given.', - Nette\Schema\Message::VALUE_OUT_OF_RANGE, - ['value' => $value, 'expected' => implode('..', $range)] - ); - return false; - } - return true; - } - - - private function isInRange($value, array $range): bool - { - return ($range[0] === null || $value >= $range[0]) - && ($range[1] === null || $value <= $range[1]); - } - - - private function doFinalize($value, Context $context) - { - if ($this->castTo) { - if (Nette\Utils\Reflection::isBuiltinType($this->castTo)) { - settype($value, $this->castTo); - } else { - $object = new $this->castTo; - foreach ($value as $k => $v) { - $object->$k = $v; - } - $value = $object; - } - } - - foreach ($this->asserts as $i => [$handler, $description]) { - if (!$handler($value)) { - $expected = $description ?: (is_string($handler) ? "$handler()" : "#$i"); - $context->addError( - 'Failed assertion ' . ($description ? "'%assertion%'" : '%assertion%') . ' for %label% %path% with value %value%.', - Nette\Schema\Message::FAILED_ASSERTION, - ['value' => $value, 'assertion' => $expected] - ); - return; - } - } - - return $value; - } -} diff --git a/vendor/nette/schema/src/Schema/Elements/Structure.php b/vendor/nette/schema/src/Schema/Elements/Structure.php deleted file mode 100644 index b4ed8bf..0000000 --- a/vendor/nette/schema/src/Schema/Elements/Structure.php +++ /dev/null @@ -1,204 +0,0 @@ -items = $items; - $this->castTo = 'object'; - $this->required = true; - } - - - public function default($value): self - { - throw new Nette\InvalidStateException('Structure cannot have default value.'); - } - - - public function min(?int $min): self - { - $this->range[0] = $min; - return $this; - } - - - public function max(?int $max): self - { - $this->range[1] = $max; - return $this; - } - - - /** - * @param string|Schema $type - */ - public function otherItems($type = 'mixed'): self - { - $this->otherItems = $type instanceof Schema ? $type : new Type($type); - return $this; - } - - - public function skipDefaults(bool $state = true): self - { - $this->skipDefaults = $state; - return $this; - } - - - /********************* processing ****************d*g**/ - - - public function normalize($value, Context $context) - { - if ($prevent = (is_array($value) && isset($value[Helpers::PREVENT_MERGING]))) { - unset($value[Helpers::PREVENT_MERGING]); - } - - $value = $this->doNormalize($value, $context); - if (is_object($value)) { - $value = (array) $value; - } - - if (is_array($value)) { - foreach ($value as $key => $val) { - $itemSchema = $this->items[$key] ?? $this->otherItems; - if ($itemSchema) { - $context->path[] = $key; - $value[$key] = $itemSchema->normalize($val, $context); - array_pop($context->path); - } - } - if ($prevent) { - $value[Helpers::PREVENT_MERGING] = true; - } - } - return $value; - } - - - public function merge($value, $base) - { - if (is_array($value) && isset($value[Helpers::PREVENT_MERGING])) { - unset($value[Helpers::PREVENT_MERGING]); - $base = null; - } - - if (is_array($value) && is_array($base)) { - $index = 0; - foreach ($value as $key => $val) { - if ($key === $index) { - $base[] = $val; - $index++; - } elseif (array_key_exists($key, $base)) { - $itemSchema = $this->items[$key] ?? $this->otherItems; - $base[$key] = $itemSchema - ? $itemSchema->merge($val, $base[$key]) - : Helpers::merge($val, $base[$key]); - } else { - $base[$key] = $val; - } - } - return $base; - } - - return Helpers::merge($value, $base); - } - - - public function complete($value, Context $context) - { - if ($value === null) { - $value = []; // is unable to distinguish null from array in NEON - } - - $this->doDeprecation($context); - - if (!$this->doValidate($value, 'array', $context) - || !$this->doValidateRange($value, $this->range, $context) - ) { - return; - } - - $errCount = count($context->errors); - $items = $this->items; - if ($extraKeys = array_keys(array_diff_key($value, $items))) { - if ($this->otherItems) { - $items += array_fill_keys($extraKeys, $this->otherItems); - } else { - $keys = array_map('strval', array_keys($items)); - foreach ($extraKeys as $key) { - $hint = Nette\Utils\ObjectHelpers::getSuggestion($keys, (string) $key); - $context->addError( - 'Unexpected item %path%' . ($hint ? ", did you mean '%hint%'?" : '.'), - Nette\Schema\Message::UNEXPECTED_ITEM, - ['hint' => $hint] - )->path[] = $key; - } - } - } - - foreach ($items as $itemKey => $itemVal) { - $context->path[] = $itemKey; - if (array_key_exists($itemKey, $value)) { - $value[$itemKey] = $itemVal->complete($value[$itemKey], $context); - } else { - $default = $itemVal->completeDefault($context); // checks required item - if (!$context->skipDefaults && !$this->skipDefaults) { - $value[$itemKey] = $default; - } - } - array_pop($context->path); - } - - if (count($context->errors) > $errCount) { - return; - } - - return $this->doFinalize($value, $context); - } - - - public function completeDefault(Context $context) - { - return $this->required - ? $this->complete([], $context) - : null; - } -} diff --git a/vendor/nette/schema/src/Schema/Elements/Type.php b/vendor/nette/schema/src/Schema/Elements/Type.php deleted file mode 100644 index 3059d17..0000000 --- a/vendor/nette/schema/src/Schema/Elements/Type.php +++ /dev/null @@ -1,222 +0,0 @@ - [], 'array' => []]; - $this->type = $type; - $this->default = strpos($type, '[]') ? [] : $defaults[$type] ?? null; - } - - - public function nullable(): self - { - $this->type = 'null|' . $this->type; - return $this; - } - - - public function mergeDefaults(bool $state = true): self - { - $this->merge = $state; - return $this; - } - - - public function dynamic(): self - { - $this->type = DynamicParameter::class . '|' . $this->type; - return $this; - } - - - public function min(?float $min): self - { - $this->range[0] = $min; - return $this; - } - - - public function max(?float $max): self - { - $this->range[1] = $max; - return $this; - } - - - /** - * @param string|Schema $valueType - * @param string|Schema|null $keyType - * @internal use arrayOf() or listOf() - */ - public function items($valueType = 'mixed', $keyType = null): self - { - $this->itemsValue = $valueType instanceof Schema - ? $valueType - : new self($valueType); - $this->itemsKey = $keyType instanceof Schema || $keyType === null - ? $keyType - : new self($keyType); - return $this; - } - - - public function pattern(?string $pattern): self - { - $this->pattern = $pattern; - return $this; - } - - - /********************* processing ****************d*g**/ - - - public function normalize($value, Context $context) - { - if ($prevent = (is_array($value) && isset($value[Helpers::PREVENT_MERGING]))) { - unset($value[Helpers::PREVENT_MERGING]); - } - - $value = $this->doNormalize($value, $context); - if (is_array($value) && $this->itemsValue) { - $res = []; - foreach ($value as $key => $val) { - $context->path[] = $key; - $context->isKey = true; - $key = $this->itemsKey - ? $this->itemsKey->normalize($key, $context) - : $key; - $context->isKey = false; - $res[$key] = $this->itemsValue->normalize($val, $context); - array_pop($context->path); - } - $value = $res; - } - if ($prevent && is_array($value)) { - $value[Helpers::PREVENT_MERGING] = true; - } - return $value; - } - - - public function merge($value, $base) - { - if (is_array($value) && isset($value[Helpers::PREVENT_MERGING])) { - unset($value[Helpers::PREVENT_MERGING]); - return $value; - } - if (is_array($value) && is_array($base) && $this->itemsValue) { - $index = 0; - foreach ($value as $key => $val) { - if ($key === $index) { - $base[] = $val; - $index++; - } else { - $base[$key] = array_key_exists($key, $base) - ? $this->itemsValue->merge($val, $base[$key]) - : $val; - } - } - return $base; - } - - return Helpers::merge($value, $base); - } - - - public function complete($value, Context $context) - { - $merge = $this->merge; - if (is_array($value) && isset($value[Helpers::PREVENT_MERGING])) { - unset($value[Helpers::PREVENT_MERGING]); - $merge = false; - } - - if ($value === null && is_array($this->default)) { - $value = []; // is unable to distinguish null from array in NEON - } - - $this->doDeprecation($context); - - if (!$this->doValidate($value, $this->type, $context) - || !$this->doValidateRange($value, $this->range, $context, $this->type) - ) { - return; - } - - if ($value !== null && $this->pattern !== null && !preg_match("\x01^(?:$this->pattern)$\x01Du", $value)) { - $context->addError( - "The %label% %path% expects to match pattern '%pattern%', %value% given.", - Nette\Schema\Message::PATTERN_MISMATCH, - ['value' => $value, 'pattern' => $this->pattern] - ); - return; - } - - if ($value instanceof DynamicParameter) { - $expected = $this->type . ($this->range === [null, null] ? '' : ':' . implode('..', $this->range)); - $context->dynamics[] = [$value, str_replace(DynamicParameter::class . '|', '', $expected)]; - } - - if ($this->itemsValue) { - $errCount = count($context->errors); - $res = []; - foreach ($value as $key => $val) { - $context->path[] = $key; - $context->isKey = true; - $key = $this->itemsKey ? $this->itemsKey->complete($key, $context) : $key; - $context->isKey = false; - $res[$key] = $this->itemsValue->complete($val, $context); - array_pop($context->path); - } - if (count($context->errors) > $errCount) { - return null; - } - $value = $res; - } - - if ($merge) { - $value = Helpers::merge($value, $this->default); - } - return $this->doFinalize($value, $context); - } -} diff --git a/vendor/nette/schema/src/Schema/Expect.php b/vendor/nette/schema/src/Schema/Expect.php deleted file mode 100644 index f8b1def..0000000 --- a/vendor/nette/schema/src/Schema/Expect.php +++ /dev/null @@ -1,117 +0,0 @@ -default($args[0]); - } - return $type; - } - - - public static function type(string $type): Type - { - return new Type($type); - } - - - /** - * @param mixed|Schema ...$set - */ - public static function anyOf(...$set): AnyOf - { - return new AnyOf(...$set); - } - - - /** - * @param Schema[] $items - */ - public static function structure(array $items): Structure - { - return new Structure($items); - } - - - /** - * @param object $object - */ - public static function from($object, array $items = []): Structure - { - $ro = new \ReflectionObject($object); - foreach ($ro->getProperties() as $prop) { - $type = Helpers::getPropertyType($prop) ?? 'mixed'; - $item = &$items[$prop->getName()]; - if (!$item) { - $item = new Type($type); - if (PHP_VERSION_ID >= 70400 && !$prop->isInitialized($object)) { - $item->required(); - } else { - $def = $prop->getValue($object); - if (is_object($def)) { - $item = static::from($def); - } elseif ($def === null && !Nette\Utils\Validators::is(null, $type)) { - $item->required(); - } else { - $item->default($def); - } - } - } - } - return (new Structure($items))->castTo($ro->getName()); - } - - - /** - * @param string|Schema $valueType - * @param string|Schema|null $keyType - */ - public static function arrayOf($valueType, $keyType = null): Type - { - return (new Type('array'))->items($valueType, $keyType); - } - - - /** - * @param string|Schema $type - */ - public static function listOf($type): Type - { - return (new Type('list'))->items($type); - } -} diff --git a/vendor/nette/schema/src/Schema/Helpers.php b/vendor/nette/schema/src/Schema/Helpers.php deleted file mode 100644 index 6f97d08..0000000 --- a/vendor/nette/schema/src/Schema/Helpers.php +++ /dev/null @@ -1,106 +0,0 @@ - $val) { - if ($key === $index) { - $base[] = $val; - $index++; - } else { - $base[$key] = static::merge($val, $base[$key] ?? null); - } - } - return $base; - - } elseif ($value === null && is_array($base)) { - return $base; - - } else { - return $value; - } - } - - - public static function getPropertyType(\ReflectionProperty $prop): ?string - { - if (!class_exists(Nette\Utils\Type::class)) { - throw new Nette\NotSupportedException('Expect::from() requires nette/utils 3.x'); - } elseif ($type = Nette\Utils\Type::fromReflection($prop)) { - return (string) $type; - } elseif ($type = preg_replace('#\s.*#', '', (string) self::parseAnnotation($prop, 'var'))) { - $class = Reflection::getPropertyDeclaringClass($prop); - return preg_replace_callback('#[\w\\\\]+#', function ($m) use ($class) { - return Reflection::expandClassName($m[0], $class); - }, $type); - } - return null; - } - - - /** - * Returns an annotation value. - * @param \ReflectionProperty $ref - */ - public static function parseAnnotation(\Reflector $ref, string $name): ?string - { - if (!Reflection::areCommentsAvailable()) { - throw new Nette\InvalidStateException('You have to enable phpDoc comments in opcode cache.'); - } - $re = '#[\s*]@' . preg_quote($name, '#') . '(?=\s|$)(?:[ \t]+([^@\s]\S*))?#'; - if ($ref->getDocComment() && preg_match($re, trim($ref->getDocComment(), '/*'), $m)) { - return $m[1] ?? ''; - } - return null; - } - - - /** - * @param mixed $value - */ - public static function formatValue($value): string - { - if (is_object($value)) { - return 'object ' . get_class($value); - } elseif (is_string($value)) { - return "'" . Nette\Utils\Strings::truncate($value, 15, '...') . "'"; - } elseif (is_scalar($value)) { - return var_export($value, true); - } else { - return strtolower(gettype($value)); - } - } -} diff --git a/vendor/nette/schema/src/Schema/Message.php b/vendor/nette/schema/src/Schema/Message.php deleted file mode 100644 index 145c7bc..0000000 --- a/vendor/nette/schema/src/Schema/Message.php +++ /dev/null @@ -1,77 +0,0 @@ -message = $message; - $this->code = $code; - $this->path = $path; - $this->variables = $variables; - } - - - public function toString(): string - { - $vars = $this->variables; - $vars['label'] = empty($vars['isKey']) ? 'item' : 'key of item'; - $vars['path'] = $this->path ? "'" . implode(' › ', $this->path) . "'" : null; - $vars['value'] = Helpers::formatValue($vars['value'] ?? null); - - return preg_replace_callback('~( ?)%(\w+)%~', function ($m) use ($vars) { - [, $space, $key] = $m; - return $vars[$key] === null ? '' : $space . $vars[$key]; - }, $this->message); - } -} diff --git a/vendor/nette/schema/src/Schema/Processor.php b/vendor/nette/schema/src/Schema/Processor.php deleted file mode 100644 index 392a3de..0000000 --- a/vendor/nette/schema/src/Schema/Processor.php +++ /dev/null @@ -1,103 +0,0 @@ -skipDefaults = $value; - } - - - /** - * Normalizes and validates data. Result is a clean completed data. - * @return mixed - * @throws ValidationException - */ - public function process(Schema $schema, $data) - { - $this->createContext(); - $data = $schema->normalize($data, $this->context); - $this->throwsErrors(); - $data = $schema->complete($data, $this->context); - $this->throwsErrors(); - return $data; - } - - - /** - * Normalizes and validates and merges multiple data. Result is a clean completed data. - * @return mixed - * @throws ValidationException - */ - public function processMultiple(Schema $schema, array $dataset) - { - $this->createContext(); - $flatten = null; - $first = true; - foreach ($dataset as $data) { - $data = $schema->normalize($data, $this->context); - $this->throwsErrors(); - $flatten = $first ? $data : $schema->merge($data, $flatten); - $first = false; - } - $data = $schema->complete($flatten, $this->context); - $this->throwsErrors(); - return $data; - } - - - /** - * @return string[] - */ - public function getWarnings(): array - { - $res = []; - foreach ($this->context->warnings as $message) { - $res[] = $message->toString(); - } - return $res; - } - - - private function throwsErrors(): void - { - if ($this->context->errors) { - throw new ValidationException(null, $this->context->errors); - } - } - - - private function createContext() - { - $this->context = new Context; - $this->context->skipDefaults = $this->skipDefaults; - $this->onNewContext($this->context); - } -} diff --git a/vendor/nette/schema/src/Schema/Schema.php b/vendor/nette/schema/src/Schema/Schema.php deleted file mode 100644 index bbd8bd0..0000000 --- a/vendor/nette/schema/src/Schema/Schema.php +++ /dev/null @@ -1,37 +0,0 @@ -toString()); - $this->messages = $messages; - } - - - /** - * @return string[] - */ - public function getMessages(): array - { - $res = []; - foreach ($this->messages as $message) { - $res[] = $message->toString(); - } - return $res; - } - - - /** - * @return Message[] - */ - public function getMessageObjects(): array - { - return $this->messages; - } -} diff --git a/vendor/nette/utils/.phpstorm.meta.php b/vendor/nette/utils/.phpstorm.meta.php deleted file mode 100644 index 7810b4c..0000000 --- a/vendor/nette/utils/.phpstorm.meta.php +++ /dev/null @@ -1,19 +0,0 @@ -=7.2 <8.2" - }, - "require-dev": { - "nette/tester": "~2.0", - "tracy/tracy": "^2.3", - "phpstan/phpstan": "^1.0" - }, - "conflict": { - "nette/di": "<3.0.6" - }, - "suggest": { - "ext-iconv": "to use Strings::webalize(), toAscii(), chr() and reverse()", - "ext-json": "to use Nette\\Utils\\Json", - "ext-intl": "to use Strings::webalize(), toAscii(), normalize() and compare()", - "ext-mbstring": "to use Strings::lower() etc...", - "ext-xml": "to use Strings::length() etc. when mbstring is not available", - "ext-gd": "to use Image", - "ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()" - }, - "autoload": { - "classmap": ["src/"] - }, - "minimum-stability": "dev", - "scripts": { - "phpstan": "phpstan analyse", - "tester": "tester tests -s" - }, - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - } -} diff --git a/vendor/nette/utils/contributing.md b/vendor/nette/utils/contributing.md deleted file mode 100644 index 184152c..0000000 --- a/vendor/nette/utils/contributing.md +++ /dev/null @@ -1,33 +0,0 @@ -How to contribute & use the issue tracker -========================================= - -Nette welcomes your contributions. There are several ways to help out: - -* Create an issue on GitHub, if you have found a bug -* Write test cases for open bug issues -* Write fixes for open bug/feature issues, preferably with test cases included -* Contribute to the [documentation](https://nette.org/en/writing) - -Issues ------- - -Please **do not use the issue tracker to ask questions**. We will be happy to help you -on [Nette forum](https://forum.nette.org) or chat with us on [Gitter](https://gitter.im/nette/nette). - -A good bug report shouldn't leave others needing to chase you up for more -information. Please try to be as detailed as possible in your report. - -**Feature requests** are welcome. But take a moment to find out whether your idea -fits with the scope and aims of the project. It's up to *you* to make a strong -case to convince the project's developers of the merits of this feature. - -Contributing ------------- - -If you'd like to contribute, please take a moment to read [the contributing guide](https://nette.org/en/contributing). - -The best way to propose a feature is to discuss your ideas on [Nette forum](https://forum.nette.org) before implementing them. - -Please do not fix whitespace, format code, or make a purely cosmetic patch. - -Thanks! :heart: diff --git a/vendor/nette/utils/license.md b/vendor/nette/utils/license.md deleted file mode 100644 index cf741bd..0000000 --- a/vendor/nette/utils/license.md +++ /dev/null @@ -1,60 +0,0 @@ -Licenses -======== - -Good news! You may use Nette Framework under the terms of either -the New BSD License or the GNU General Public License (GPL) version 2 or 3. - -The BSD License is recommended for most projects. It is easy to understand and it -places almost no restrictions on what you can do with the framework. If the GPL -fits better to your project, you can use the framework under this license. - -You don't have to notify anyone which license you are using. You can freely -use Nette Framework in commercial projects as long as the copyright header -remains intact. - -Please be advised that the name "Nette Framework" is a protected trademark and its -usage has some limitations. So please do not use word "Nette" in the name of your -project or top-level domain, and choose a name that stands on its own merits. -If your stuff is good, it will not take long to establish a reputation for yourselves. - - -New BSD License ---------------- - -Copyright (c) 2004, 2014 David Grudl (https://davidgrudl.com) -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - * Neither the name of "Nette Framework" nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -This software is provided by the copyright holders and contributors "as is" and -any express or implied warranties, including, but not limited to, the implied -warranties of merchantability and fitness for a particular purpose are -disclaimed. In no event shall the copyright owner or contributors be liable for -any direct, indirect, incidental, special, exemplary, or consequential damages -(including, but not limited to, procurement of substitute goods or services; -loss of use, data, or profits; or business interruption) however caused and on -any theory of liability, whether in contract, strict liability, or tort -(including negligence or otherwise) arising in any way out of the use of this -software, even if advised of the possibility of such damage. - - -GNU General Public License --------------------------- - -GPL licenses are very very long, so instead of including them here we offer -you URLs with full text: - -- [GPL version 2](http://www.gnu.org/licenses/gpl-2.0.html) -- [GPL version 3](http://www.gnu.org/licenses/gpl-3.0.html) diff --git a/vendor/nette/utils/readme.md b/vendor/nette/utils/readme.md deleted file mode 100644 index 81ed0e9..0000000 --- a/vendor/nette/utils/readme.md +++ /dev/null @@ -1,54 +0,0 @@ -Nette Utility Classes -===================== - -[![Downloads this Month](https://img.shields.io/packagist/dm/nette/utils.svg)](https://packagist.org/packages/nette/utils) -[![Tests](https://github.com/nette/utils/workflows/Tests/badge.svg?branch=master)](https://github.com/nette/utils/actions) -[![Coverage Status](https://coveralls.io/repos/github/nette/utils/badge.svg?branch=master)](https://coveralls.io/github/nette/utils?branch=master) -[![Latest Stable Version](https://poser.pugx.org/nette/utils/v/stable)](https://github.com/nette/utils/releases) -[![License](https://img.shields.io/badge/license-New%20BSD-blue.svg)](https://github.com/nette/utils/blob/master/license.md) - - -Introduction ------------- - -In package nette/utils you will find a set of [useful classes](https://doc.nette.org/utils) for everyday use: - -- [Arrays](https://doc.nette.org/arrays) - manipulate arrays -- [Callback](https://doc.nette.org/callback) - PHP callbacks -- [Date and Time](https://doc.nette.org/datetime) - modify times and dates -- [Filesystem](https://doc.nette.org/filesystem) - copying, renaming, … -- [Helper Functions](https://doc.nette.org/helpers) -- [HTML elements](https://doc.nette.org/html-elements) - generate HTML -- [Images](https://doc.nette.org/images) - crop, resize, rotate images -- [JSON](https://doc.nette.org/json) - encoding and decoding -- [Generating Random Strings](https://doc.nette.org/random) -- [Paginator](https://doc.nette.org/paginator) - pagination math -- [PHP Reflection](https://doc.nette.org/reflection) -- [Strings](https://doc.nette.org/strings) - useful text functions -- [SmartObject](https://doc.nette.org/smartobject) - PHP object enhancements -- [Validation](https://doc.nette.org/validators) - validate inputs -- [Type](https://doc.nette.org/type) - PHP data type - - -Installation ------------- - -The recommended way to install is via Composer: - -``` -composer require nette/utils -``` - -- Nette Utils 3.2 is compatible with PHP 7.2 to 8.1 -- Nette Utils 3.1 is compatible with PHP 7.1 to 8.0 -- Nette Utils 3.0 is compatible with PHP 7.1 to 8.0 -- Nette Utils 2.5 is compatible with PHP 5.6 to 8.0 - -[Support Me](https://github.com/sponsors/dg) --------------------------------------------- - -Do you like Nette Utils? Are you looking forward to the new features? - -[![Buy me a coffee](https://files.nette.org/icons/donation-3.svg)](https://github.com/sponsors/dg) - -Thank you! diff --git a/vendor/nette/utils/src/HtmlStringable.php b/vendor/nette/utils/src/HtmlStringable.php deleted file mode 100644 index d749d4e..0000000 --- a/vendor/nette/utils/src/HtmlStringable.php +++ /dev/null @@ -1,22 +0,0 @@ -getIterator(); - } while ($iterator instanceof \IteratorAggregate); - assert($iterator instanceof \Iterator); - - } elseif ($iterator instanceof \Iterator) { - } elseif ($iterator instanceof \Traversable) { - $iterator = new \IteratorIterator($iterator); - } else { - throw new Nette\InvalidArgumentException(sprintf('Invalid argument passed to %s; array or Traversable expected, %s given.', self::class, is_object($iterator) ? get_class($iterator) : gettype($iterator))); - } - - parent::__construct($iterator, 0); - } - - - /** - * Is the current element the first one? - */ - public function isFirst(int $gridWidth = null): bool - { - return $this->counter === 1 || ($gridWidth && $this->counter !== 0 && (($this->counter - 1) % $gridWidth) === 0); - } - - - /** - * Is the current element the last one? - */ - public function isLast(int $gridWidth = null): bool - { - return !$this->hasNext() || ($gridWidth && ($this->counter % $gridWidth) === 0); - } - - - /** - * Is the iterator empty? - */ - public function isEmpty(): bool - { - return $this->counter === 0; - } - - - /** - * Is the counter odd? - */ - public function isOdd(): bool - { - return $this->counter % 2 === 1; - } - - - /** - * Is the counter even? - */ - public function isEven(): bool - { - return $this->counter % 2 === 0; - } - - - /** - * Returns the counter. - */ - public function getCounter(): int - { - return $this->counter; - } - - - /** - * Returns the count of elements. - */ - public function count(): int - { - $inner = $this->getInnerIterator(); - if ($inner instanceof \Countable) { - return $inner->count(); - - } else { - throw new Nette\NotSupportedException('Iterator is not countable.'); - } - } - - - /** - * Forwards to the next element. - */ - public function next(): void - { - parent::next(); - if (parent::valid()) { - $this->counter++; - } - } - - - /** - * Rewinds the Iterator. - */ - public function rewind(): void - { - parent::rewind(); - $this->counter = parent::valid() ? 1 : 0; - } - - - /** - * Returns the next key. - * @return mixed - */ - public function getNextKey() - { - return $this->getInnerIterator()->key(); - } - - - /** - * Returns the next element. - * @return mixed - */ - public function getNextValue() - { - return $this->getInnerIterator()->current(); - } -} diff --git a/vendor/nette/utils/src/Iterators/Mapper.php b/vendor/nette/utils/src/Iterators/Mapper.php deleted file mode 100644 index 1a8647c..0000000 --- a/vendor/nette/utils/src/Iterators/Mapper.php +++ /dev/null @@ -1,35 +0,0 @@ -callback = $callback; - } - - - #[\ReturnTypeWillChange] - public function current() - { - return ($this->callback)(parent::current(), parent::key()); - } -} diff --git a/vendor/nette/utils/src/SmartObject.php b/vendor/nette/utils/src/SmartObject.php deleted file mode 100644 index 2128fdf..0000000 --- a/vendor/nette/utils/src/SmartObject.php +++ /dev/null @@ -1,122 +0,0 @@ -$name ?? null; - if (is_iterable($handlers)) { - foreach ($handlers as $handler) { - $handler(...$args); - } - } elseif ($handlers !== null) { - throw new UnexpectedValueException("Property $class::$$name must be iterable or null, " . gettype($handlers) . ' given.'); - } - - } else { - ObjectHelpers::strictCall($class, $name); - } - } - - - /** - * @throws MemberAccessException - */ - public static function __callStatic(string $name, array $args) - { - ObjectHelpers::strictStaticCall(static::class, $name); - } - - - /** - * @return mixed - * @throws MemberAccessException if the property is not defined. - */ - public function &__get(string $name) - { - $class = static::class; - - if ($prop = ObjectHelpers::getMagicProperties($class)[$name] ?? null) { // property getter - if (!($prop & 0b0001)) { - throw new MemberAccessException("Cannot read a write-only property $class::\$$name."); - } - $m = ($prop & 0b0010 ? 'get' : 'is') . $name; - if ($prop & 0b0100) { // return by reference - return $this->$m(); - } else { - $val = $this->$m(); - return $val; - } - } else { - ObjectHelpers::strictGet($class, $name); - } - } - - - /** - * @param mixed $value - * @return void - * @throws MemberAccessException if the property is not defined or is read-only - */ - public function __set(string $name, $value) - { - $class = static::class; - - if (ObjectHelpers::hasProperty($class, $name)) { // unsetted property - $this->$name = $value; - - } elseif ($prop = ObjectHelpers::getMagicProperties($class)[$name] ?? null) { // property setter - if (!($prop & 0b1000)) { - throw new MemberAccessException("Cannot write to a read-only property $class::\$$name."); - } - $this->{'set' . $name}($value); - - } else { - ObjectHelpers::strictSet($class, $name); - } - } - - - /** - * @return void - * @throws MemberAccessException - */ - public function __unset(string $name) - { - $class = static::class; - if (!ObjectHelpers::hasProperty($class, $name)) { - throw new MemberAccessException("Cannot unset the property $class::\$$name."); - } - } - - - public function __isset(string $name): bool - { - return isset(ObjectHelpers::getMagicProperties(static::class)[$name]); - } -} diff --git a/vendor/nette/utils/src/StaticClass.php b/vendor/nette/utils/src/StaticClass.php deleted file mode 100644 index 8fed0ef..0000000 --- a/vendor/nette/utils/src/StaticClass.php +++ /dev/null @@ -1,37 +0,0 @@ - $array - * @return static - */ - public static function from(array $array, bool $recursive = true) - { - $obj = new static; - foreach ($array as $key => $value) { - $obj->$key = $recursive && is_array($value) - ? static::from($value, true) - : $value; - } - return $obj; - } - - - /** - * Returns an iterator over all items. - * @return \RecursiveArrayIterator - */ - public function getIterator(): \RecursiveArrayIterator - { - return new \RecursiveArrayIterator((array) $this); - } - - - /** - * Returns items count. - */ - public function count(): int - { - return count((array) $this); - } - - - /** - * Replaces or appends a item. - * @param string|int $key - * @param T $value - */ - public function offsetSet($key, $value): void - { - if (!is_scalar($key)) { // prevents null - throw new Nette\InvalidArgumentException(sprintf('Key must be either a string or an integer, %s given.', gettype($key))); - } - $this->$key = $value; - } - - - /** - * Returns a item. - * @param string|int $key - * @return T - */ - #[\ReturnTypeWillChange] - public function offsetGet($key) - { - return $this->$key; - } - - - /** - * Determines whether a item exists. - * @param string|int $key - */ - public function offsetExists($key): bool - { - return isset($this->$key); - } - - - /** - * Removes the element from this list. - * @param string|int $key - */ - public function offsetUnset($key): void - { - unset($this->$key); - } -} diff --git a/vendor/nette/utils/src/Utils/ArrayList.php b/vendor/nette/utils/src/Utils/ArrayList.php deleted file mode 100644 index 0a69465..0000000 --- a/vendor/nette/utils/src/Utils/ArrayList.php +++ /dev/null @@ -1,132 +0,0 @@ - $array - * @return static - */ - public static function from(array $array) - { - if (!Arrays::isList($array)) { - throw new Nette\InvalidArgumentException('Array is not valid list.'); - } - $obj = new static; - $obj->list = $array; - return $obj; - } - - - /** - * Returns an iterator over all items. - * @return \ArrayIterator - */ - public function getIterator(): \ArrayIterator - { - return new \ArrayIterator($this->list); - } - - - /** - * Returns items count. - */ - public function count(): int - { - return count($this->list); - } - - - /** - * Replaces or appends a item. - * @param int|null $index - * @param T $value - * @throws Nette\OutOfRangeException - */ - public function offsetSet($index, $value): void - { - if ($index === null) { - $this->list[] = $value; - - } elseif (!is_int($index) || $index < 0 || $index >= count($this->list)) { - throw new Nette\OutOfRangeException('Offset invalid or out of range'); - - } else { - $this->list[$index] = $value; - } - } - - - /** - * Returns a item. - * @param int $index - * @return T - * @throws Nette\OutOfRangeException - */ - #[\ReturnTypeWillChange] - public function offsetGet($index) - { - if (!is_int($index) || $index < 0 || $index >= count($this->list)) { - throw new Nette\OutOfRangeException('Offset invalid or out of range'); - } - return $this->list[$index]; - } - - - /** - * Determines whether a item exists. - * @param int $index - */ - public function offsetExists($index): bool - { - return is_int($index) && $index >= 0 && $index < count($this->list); - } - - - /** - * Removes the element at the specified position in this list. - * @param int $index - * @throws Nette\OutOfRangeException - */ - public function offsetUnset($index): void - { - if (!is_int($index) || $index < 0 || $index >= count($this->list)) { - throw new Nette\OutOfRangeException('Offset invalid or out of range'); - } - array_splice($this->list, $index, 1); - } - - - /** - * Prepends a item. - * @param T $value - */ - public function prepend($value): void - { - $first = array_slice($this->list, 0, 1); - $this->offsetSet(0, $value); - array_splice($this->list, 1, 0, $first); - } -} diff --git a/vendor/nette/utils/src/Utils/Arrays.php b/vendor/nette/utils/src/Utils/Arrays.php deleted file mode 100644 index 775b651..0000000 --- a/vendor/nette/utils/src/Utils/Arrays.php +++ /dev/null @@ -1,438 +0,0 @@ - $array - * @param array-key|array-key[] $key - * @param ?T $default - * @return ?T - * @throws Nette\InvalidArgumentException if item does not exist and default value is not provided - */ - public static function get(array $array, $key, $default = null) - { - foreach (is_array($key) ? $key : [$key] as $k) { - if (is_array($array) && array_key_exists($k, $array)) { - $array = $array[$k]; - } else { - if (func_num_args() < 3) { - throw new Nette\InvalidArgumentException("Missing item '$k'."); - } - return $default; - } - } - return $array; - } - - - /** - * Returns reference to array item. If the index does not exist, new one is created with value null. - * @template T - * @param array $array - * @param array-key|array-key[] $key - * @return ?T - * @throws Nette\InvalidArgumentException if traversed item is not an array - */ - public static function &getRef(array &$array, $key) - { - foreach (is_array($key) ? $key : [$key] as $k) { - if (is_array($array) || $array === null) { - $array = &$array[$k]; - } else { - throw new Nette\InvalidArgumentException('Traversed item is not an array.'); - } - } - return $array; - } - - - /** - * Recursively merges two fields. It is useful, for example, for merging tree structures. It behaves as - * the + operator for array, ie. it adds a key/value pair from the second array to the first one and retains - * the value from the first array in the case of a key collision. - * @template T1 - * @template T2 - * @param array $array1 - * @param array $array2 - * @return array - */ - public static function mergeTree(array $array1, array $array2): array - { - $res = $array1 + $array2; - foreach (array_intersect_key($array1, $array2) as $k => $v) { - if (is_array($v) && is_array($array2[$k])) { - $res[$k] = self::mergeTree($v, $array2[$k]); - } - } - return $res; - } - - - /** - * Returns zero-indexed position of given array key. Returns null if key is not found. - * @param array-key $key - * @return int|null offset if it is found, null otherwise - */ - public static function getKeyOffset(array $array, $key): ?int - { - return Helpers::falseToNull(array_search(self::toKey($key), array_keys($array), true)); - } - - - /** - * @deprecated use getKeyOffset() - */ - public static function searchKey(array $array, $key): ?int - { - return self::getKeyOffset($array, $key); - } - - - /** - * Tests an array for the presence of value. - * @param mixed $value - */ - public static function contains(array $array, $value): bool - { - return in_array($value, $array, true); - } - - - /** - * Returns the first item from the array or null if array is empty. - * @template T - * @param array $array - * @return ?T - */ - public static function first(array $array) - { - return count($array) ? reset($array) : null; - } - - - /** - * Returns the last item from the array or null if array is empty. - * @template T - * @param array $array - * @return ?T - */ - public static function last(array $array) - { - return count($array) ? end($array) : null; - } - - - /** - * Inserts the contents of the $inserted array into the $array immediately after the $key. - * If $key is null (or does not exist), it is inserted at the beginning. - * @param array-key|null $key - */ - public static function insertBefore(array &$array, $key, array $inserted): void - { - $offset = $key === null ? 0 : (int) self::getKeyOffset($array, $key); - $array = array_slice($array, 0, $offset, true) - + $inserted - + array_slice($array, $offset, count($array), true); - } - - - /** - * Inserts the contents of the $inserted array into the $array before the $key. - * If $key is null (or does not exist), it is inserted at the end. - * @param array-key|null $key - */ - public static function insertAfter(array &$array, $key, array $inserted): void - { - if ($key === null || ($offset = self::getKeyOffset($array, $key)) === null) { - $offset = count($array) - 1; - } - $array = array_slice($array, 0, $offset + 1, true) - + $inserted - + array_slice($array, $offset + 1, count($array), true); - } - - - /** - * Renames key in array. - * @param array-key $oldKey - * @param array-key $newKey - */ - public static function renameKey(array &$array, $oldKey, $newKey): bool - { - $offset = self::getKeyOffset($array, $oldKey); - if ($offset === null) { - return false; - } - $val = &$array[$oldKey]; - $keys = array_keys($array); - $keys[$offset] = $newKey; - $array = array_combine($keys, $array); - $array[$newKey] = &$val; - return true; - } - - - /** - * Returns only those array items, which matches a regular expression $pattern. - * @param string[] $array - * @return string[] - */ - public static function grep(array $array, string $pattern, int $flags = 0): array - { - return Strings::pcre('preg_grep', [$pattern, $array, $flags]); - } - - - /** - * Transforms multidimensional array to flat array. - */ - public static function flatten(array $array, bool $preserveKeys = false): array - { - $res = []; - $cb = $preserveKeys - ? function ($v, $k) use (&$res): void { $res[$k] = $v; } - : function ($v) use (&$res): void { $res[] = $v; }; - array_walk_recursive($array, $cb); - return $res; - } - - - /** - * Checks if the array is indexed in ascending order of numeric keys from zero, a.k.a list. - * @param mixed $value - */ - public static function isList($value): bool - { - return is_array($value) && (!$value || array_keys($value) === range(0, count($value) - 1)); - } - - - /** - * Reformats table to associative tree. Path looks like 'field|field[]field->field=field'. - * @param string|string[] $path - * @return array|\stdClass - */ - public static function associate(array $array, $path) - { - $parts = is_array($path) - ? $path - : preg_split('#(\[\]|->|=|\|)#', $path, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); - - if (!$parts || $parts === ['->'] || $parts[0] === '=' || $parts[0] === '|') { - throw new Nette\InvalidArgumentException("Invalid path '$path'."); - } - - $res = $parts[0] === '->' ? new \stdClass : []; - - foreach ($array as $rowOrig) { - $row = (array) $rowOrig; - $x = &$res; - - for ($i = 0; $i < count($parts); $i++) { - $part = $parts[$i]; - if ($part === '[]') { - $x = &$x[]; - - } elseif ($part === '=') { - if (isset($parts[++$i])) { - $x = $row[$parts[$i]]; - $row = null; - } - - } elseif ($part === '->') { - if (isset($parts[++$i])) { - if ($x === null) { - $x = new \stdClass; - } - $x = &$x->{$row[$parts[$i]]}; - } else { - $row = is_object($rowOrig) ? $rowOrig : (object) $row; - } - - } elseif ($part !== '|') { - $x = &$x[(string) $row[$part]]; - } - } - - if ($x === null) { - $x = $row; - } - } - - return $res; - } - - - /** - * Normalizes array to associative array. Replace numeric keys with their values, the new value will be $filling. - * @param mixed $filling - */ - public static function normalize(array $array, $filling = null): array - { - $res = []; - foreach ($array as $k => $v) { - $res[is_int($k) ? $v : $k] = is_int($k) ? $filling : $v; - } - return $res; - } - - - /** - * Returns and removes the value of an item from an array. If it does not exist, it throws an exception, - * or returns $default, if provided. - * @template T - * @param array $array - * @param array-key $key - * @param ?T $default - * @return ?T - * @throws Nette\InvalidArgumentException if item does not exist and default value is not provided - */ - public static function pick(array &$array, $key, $default = null) - { - if (array_key_exists($key, $array)) { - $value = $array[$key]; - unset($array[$key]); - return $value; - - } elseif (func_num_args() < 3) { - throw new Nette\InvalidArgumentException("Missing item '$key'."); - - } else { - return $default; - } - } - - - /** - * Tests whether at least one element in the array passes the test implemented by the - * provided callback with signature `function ($value, $key, array $array): bool`. - */ - public static function some(iterable $array, callable $callback): bool - { - foreach ($array as $k => $v) { - if ($callback($v, $k, $array)) { - return true; - } - } - return false; - } - - - /** - * Tests whether all elements in the array pass the test implemented by the provided function, - * which has the signature `function ($value, $key, array $array): bool`. - */ - public static function every(iterable $array, callable $callback): bool - { - foreach ($array as $k => $v) { - if (!$callback($v, $k, $array)) { - return false; - } - } - return true; - } - - - /** - * Calls $callback on all elements in the array and returns the array of return values. - * The callback has the signature `function ($value, $key, array $array): bool`. - */ - public static function map(iterable $array, callable $callback): array - { - $res = []; - foreach ($array as $k => $v) { - $res[$k] = $callback($v, $k, $array); - } - return $res; - } - - - /** - * Invokes all callbacks and returns array of results. - * @param callable[] $callbacks - */ - public static function invoke(iterable $callbacks, ...$args): array - { - $res = []; - foreach ($callbacks as $k => $cb) { - $res[$k] = $cb(...$args); - } - return $res; - } - - - /** - * Invokes method on every object in an array and returns array of results. - * @param object[] $objects - */ - public static function invokeMethod(iterable $objects, string $method, ...$args): array - { - $res = []; - foreach ($objects as $k => $obj) { - $res[$k] = $obj->$method(...$args); - } - return $res; - } - - - /** - * Copies the elements of the $array array to the $object object and then returns it. - * @template T of object - * @param T $object - * @return T - */ - public static function toObject(iterable $array, $object) - { - foreach ($array as $k => $v) { - $object->$k = $v; - } - return $object; - } - - - /** - * Converts value to array key. - * @param mixed $value - * @return array-key - */ - public static function toKey($value) - { - return key([$value => null]); - } - - - /** - * Returns copy of the $array where every item is converted to string - * and prefixed by $prefix and suffixed by $suffix. - * @param string[] $array - * @return string[] - */ - public static function wrap(array $array, string $prefix = '', string $suffix = ''): array - { - $res = []; - foreach ($array as $k => $v) { - $res[$k] = $prefix . $v . $suffix; - } - return $res; - } -} diff --git a/vendor/nette/utils/src/Utils/Callback.php b/vendor/nette/utils/src/Utils/Callback.php deleted file mode 100644 index f11a4db..0000000 --- a/vendor/nette/utils/src/Utils/Callback.php +++ /dev/null @@ -1,182 +0,0 @@ -getMessage()); - } - } - - - /** - * Invokes callback. - * @return mixed - * @deprecated - */ - public static function invoke($callable, ...$args) - { - trigger_error(__METHOD__ . '() is deprecated, use native invoking.', E_USER_DEPRECATED); - self::check($callable); - return $callable(...$args); - } - - - /** - * Invokes callback with an array of parameters. - * @return mixed - * @deprecated - */ - public static function invokeArgs($callable, array $args = []) - { - trigger_error(__METHOD__ . '() is deprecated, use native invoking.', E_USER_DEPRECATED); - self::check($callable); - return $callable(...$args); - } - - - /** - * Invokes internal PHP function with own error handler. - * @return mixed - */ - public static function invokeSafe(string $function, array $args, callable $onError) - { - $prev = set_error_handler(function ($severity, $message, $file) use ($onError, &$prev, $function): ?bool { - if ($file === __FILE__) { - $msg = ini_get('html_errors') - ? Html::htmlToText($message) - : $message; - $msg = preg_replace("#^$function\\(.*?\\): #", '', $msg); - if ($onError($msg, $severity) !== false) { - return null; - } - } - return $prev ? $prev(...func_get_args()) : false; - }); - - try { - return $function(...$args); - } finally { - restore_error_handler(); - } - } - - - /** - * Checks that $callable is valid PHP callback. Otherwise throws exception. If the $syntax is set to true, only verifies - * that $callable has a valid structure to be used as a callback, but does not verify if the class or method actually exists. - * @param mixed $callable - * @return callable - * @throws Nette\InvalidArgumentException - */ - public static function check($callable, bool $syntax = false) - { - if (!is_callable($callable, $syntax)) { - throw new Nette\InvalidArgumentException( - $syntax - ? 'Given value is not a callable type.' - : sprintf("Callback '%s' is not callable.", self::toString($callable)) - ); - } - return $callable; - } - - - /** - * Converts PHP callback to textual form. Class or method may not exists. - * @param mixed $callable - */ - public static function toString($callable): string - { - if ($callable instanceof \Closure) { - $inner = self::unwrap($callable); - return '{closure' . ($inner instanceof \Closure ? '}' : ' ' . self::toString($inner) . '}'); - } elseif (is_string($callable) && $callable[0] === "\0") { - return '{lambda}'; - } else { - is_callable(is_object($callable) ? [$callable, '__invoke'] : $callable, true, $textual); - return $textual; - } - } - - - /** - * Returns reflection for method or function used in PHP callback. - * @param callable $callable type check is escalated to ReflectionException - * @return \ReflectionMethod|\ReflectionFunction - * @throws \ReflectionException if callback is not valid - */ - public static function toReflection($callable): \ReflectionFunctionAbstract - { - if ($callable instanceof \Closure) { - $callable = self::unwrap($callable); - } - - if (is_string($callable) && strpos($callable, '::')) { - return new \ReflectionMethod($callable); - } elseif (is_array($callable)) { - return new \ReflectionMethod($callable[0], $callable[1]); - } elseif (is_object($callable) && !$callable instanceof \Closure) { - return new \ReflectionMethod($callable, '__invoke'); - } else { - return new \ReflectionFunction($callable); - } - } - - - /** - * Checks whether PHP callback is function or static method. - */ - public static function isStatic(callable $callable): bool - { - return is_array($callable) ? is_string($callable[0]) : is_string($callable); - } - - - /** - * Unwraps closure created by Closure::fromCallable(). - * @return callable|array - */ - public static function unwrap(\Closure $closure) - { - $r = new \ReflectionFunction($closure); - if (substr($r->name, -1) === '}') { - return $closure; - - } elseif ($obj = $r->getClosureThis()) { - return [$obj, $r->name]; - - } elseif ($class = $r->getClosureScopeClass()) { - return [$class->name, $r->name]; - - } else { - return $r->name; - } - } -} diff --git a/vendor/nette/utils/src/Utils/DateTime.php b/vendor/nette/utils/src/Utils/DateTime.php deleted file mode 100644 index 320ccc7..0000000 --- a/vendor/nette/utils/src/Utils/DateTime.php +++ /dev/null @@ -1,145 +0,0 @@ -format('Y-m-d H:i:s.u'), $time->getTimezone()); - - } elseif (is_numeric($time)) { - if ($time <= self::YEAR) { - $time += time(); - } - return (new static('@' . $time))->setTimezone(new \DateTimeZone(date_default_timezone_get())); - - } else { // textual or null - return new static((string) $time); - } - } - - - /** - * Creates DateTime object. - * @return static - * @throws Nette\InvalidArgumentException if the date and time are not valid. - */ - public static function fromParts( - int $year, - int $month, - int $day, - int $hour = 0, - int $minute = 0, - float $second = 0.0 - ) { - $s = sprintf('%04d-%02d-%02d %02d:%02d:%02.5F', $year, $month, $day, $hour, $minute, $second); - if ( - !checkdate($month, $day, $year) - || $hour < 0 - || $hour > 23 - || $minute < 0 - || $minute > 59 - || $second < 0 - || $second >= 60 - ) { - throw new Nette\InvalidArgumentException("Invalid date '$s'"); - } - return new static($s); - } - - - /** - * Returns new DateTime object formatted according to the specified format. - * @param string $format The format the $time parameter should be in - * @param string $time - * @param string|\DateTimeZone $timezone (default timezone is used if null is passed) - * @return static|false - */ - #[\ReturnTypeWillChange] - public static function createFromFormat($format, $time, $timezone = null) - { - if ($timezone === null) { - $timezone = new \DateTimeZone(date_default_timezone_get()); - - } elseif (is_string($timezone)) { - $timezone = new \DateTimeZone($timezone); - - } elseif (!$timezone instanceof \DateTimeZone) { - throw new Nette\InvalidArgumentException('Invalid timezone given'); - } - - $date = parent::createFromFormat($format, $time, $timezone); - return $date ? static::from($date) : false; - } - - - /** - * Returns JSON representation in ISO 8601 (used by JavaScript). - */ - public function jsonSerialize(): string - { - return $this->format('c'); - } - - - /** - * Returns the date and time in the format 'Y-m-d H:i:s'. - */ - public function __toString(): string - { - return $this->format('Y-m-d H:i:s'); - } - - - /** - * Creates a copy with a modified time. - * @return static - */ - public function modifyClone(string $modify = '') - { - $dolly = clone $this; - return $modify ? $dolly->modify($modify) : $dolly; - } -} diff --git a/vendor/nette/utils/src/Utils/FileSystem.php b/vendor/nette/utils/src/Utils/FileSystem.php deleted file mode 100644 index 9abb9f6..0000000 --- a/vendor/nette/utils/src/Utils/FileSystem.php +++ /dev/null @@ -1,256 +0,0 @@ -getPathname()); - } - foreach ($iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($origin, \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::SELF_FIRST) as $item) { - if ($item->isDir()) { - static::createDir($target . '/' . $iterator->getSubPathName()); - } else { - static::copy($item->getPathname(), $target . '/' . $iterator->getSubPathName()); - } - } - - } else { - static::createDir(dirname($target)); - if ( - ($s = @fopen($origin, 'rb')) - && ($d = @fopen($target, 'wb')) - && @stream_copy_to_stream($s, $d) === false - ) { // @ is escalated to exception - throw new Nette\IOException(sprintf( - "Unable to copy file '%s' to '%s'. %s", - self::normalizePath($origin), - self::normalizePath($target), - Helpers::getLastError() - )); - } - } - } - - - /** - * Deletes a file or directory if exists. - * @throws Nette\IOException on error occurred - */ - public static function delete(string $path): void - { - if (is_file($path) || is_link($path)) { - $func = DIRECTORY_SEPARATOR === '\\' && is_dir($path) ? 'rmdir' : 'unlink'; - if (!@$func($path)) { // @ is escalated to exception - throw new Nette\IOException(sprintf( - "Unable to delete '%s'. %s", - self::normalizePath($path), - Helpers::getLastError() - )); - } - - } elseif (is_dir($path)) { - foreach (new \FilesystemIterator($path) as $item) { - static::delete($item->getPathname()); - } - if (!@rmdir($path)) { // @ is escalated to exception - throw new Nette\IOException(sprintf( - "Unable to delete directory '%s'. %s", - self::normalizePath($path), - Helpers::getLastError() - )); - } - } - } - - - /** - * Renames or moves a file or a directory. Overwrites existing files and directories by default. - * @throws Nette\IOException on error occurred - * @throws Nette\InvalidStateException if $overwrite is set to false and destination already exists - */ - public static function rename(string $origin, string $target, bool $overwrite = true): void - { - if (!$overwrite && file_exists($target)) { - throw new Nette\InvalidStateException(sprintf("File or directory '%s' already exists.", self::normalizePath($target))); - - } elseif (!file_exists($origin)) { - throw new Nette\IOException(sprintf("File or directory '%s' not found.", self::normalizePath($origin))); - - } else { - static::createDir(dirname($target)); - if (realpath($origin) !== realpath($target)) { - static::delete($target); - } - if (!@rename($origin, $target)) { // @ is escalated to exception - throw new Nette\IOException(sprintf( - "Unable to rename file or directory '%s' to '%s'. %s", - self::normalizePath($origin), - self::normalizePath($target), - Helpers::getLastError() - )); - } - } - } - - - /** - * Reads the content of a file. - * @throws Nette\IOException on error occurred - */ - public static function read(string $file): string - { - $content = @file_get_contents($file); // @ is escalated to exception - if ($content === false) { - throw new Nette\IOException(sprintf( - "Unable to read file '%s'. %s", - self::normalizePath($file), - Helpers::getLastError() - )); - } - return $content; - } - - - /** - * Writes the string to a file. - * @throws Nette\IOException on error occurred - */ - public static function write(string $file, string $content, ?int $mode = 0666): void - { - static::createDir(dirname($file)); - if (@file_put_contents($file, $content) === false) { // @ is escalated to exception - throw new Nette\IOException(sprintf( - "Unable to write file '%s'. %s", - self::normalizePath($file), - Helpers::getLastError() - )); - } - if ($mode !== null && !@chmod($file, $mode)) { // @ is escalated to exception - throw new Nette\IOException(sprintf( - "Unable to chmod file '%s' to mode %s. %s", - self::normalizePath($file), - decoct($mode), - Helpers::getLastError() - )); - } - } - - - /** - * Fixes permissions to a specific file or directory. Directories can be fixed recursively. - * @throws Nette\IOException on error occurred - */ - public static function makeWritable(string $path, int $dirMode = 0777, int $fileMode = 0666): void - { - if (is_file($path)) { - if (!@chmod($path, $fileMode)) { // @ is escalated to exception - throw new Nette\IOException(sprintf( - "Unable to chmod file '%s' to mode %s. %s", - self::normalizePath($path), - decoct($fileMode), - Helpers::getLastError() - )); - } - } elseif (is_dir($path)) { - foreach (new \FilesystemIterator($path) as $item) { - static::makeWritable($item->getPathname(), $dirMode, $fileMode); - } - if (!@chmod($path, $dirMode)) { // @ is escalated to exception - throw new Nette\IOException(sprintf( - "Unable to chmod directory '%s' to mode %s. %s", - self::normalizePath($path), - decoct($dirMode), - Helpers::getLastError() - )); - } - } else { - throw new Nette\IOException(sprintf("File or directory '%s' not found.", self::normalizePath($path))); - } - } - - - /** - * Determines if the path is absolute. - */ - public static function isAbsolute(string $path): bool - { - return (bool) preg_match('#([a-z]:)?[/\\\\]|[a-z][a-z0-9+.-]*://#Ai', $path); - } - - - /** - * Normalizes `..` and `.` and directory separators in path. - */ - public static function normalizePath(string $path): string - { - $parts = $path === '' ? [] : preg_split('~[/\\\\]+~', $path); - $res = []; - foreach ($parts as $part) { - if ($part === '..' && $res && end($res) !== '..' && end($res) !== '') { - array_pop($res); - } elseif ($part !== '.') { - $res[] = $part; - } - } - return $res === [''] - ? DIRECTORY_SEPARATOR - : implode(DIRECTORY_SEPARATOR, $res); - } - - - /** - * Joins all segments of the path and normalizes the result. - */ - public static function joinPaths(string ...$paths): string - { - return self::normalizePath(implode('/', $paths)); - } -} diff --git a/vendor/nette/utils/src/Utils/Floats.php b/vendor/nette/utils/src/Utils/Floats.php deleted file mode 100644 index b14be4d..0000000 --- a/vendor/nette/utils/src/Utils/Floats.php +++ /dev/null @@ -1,107 +0,0 @@ - $b it returns 1 - * @throws \LogicException if one of parameters is NAN - */ - public static function compare(float $a, float $b): int - { - if (is_nan($a) || is_nan($b)) { - throw new \LogicException('Trying to compare NAN'); - - } elseif (!is_finite($a) && !is_finite($b) && $a === $b) { - return 0; - } - - $diff = abs($a - $b); - if (($diff < self::EPSILON || ($diff / max(abs($a), abs($b)) < self::EPSILON))) { - return 0; - } - - return $a < $b ? -1 : 1; - } - - - /** - * Returns true if $a = $b - * @throws \LogicException if one of parameters is NAN - */ - public static function areEqual(float $a, float $b): bool - { - return self::compare($a, $b) === 0; - } - - - /** - * Returns true if $a < $b - * @throws \LogicException if one of parameters is NAN - */ - public static function isLessThan(float $a, float $b): bool - { - return self::compare($a, $b) < 0; - } - - - /** - * Returns true if $a <= $b - * @throws \LogicException if one of parameters is NAN - */ - public static function isLessThanOrEqualTo(float $a, float $b): bool - { - return self::compare($a, $b) <= 0; - } - - - /** - * Returns true if $a > $b - * @throws \LogicException if one of parameters is NAN - */ - public static function isGreaterThan(float $a, float $b): bool - { - return self::compare($a, $b) > 0; - } - - - /** - * Returns true if $a >= $b - * @throws \LogicException if one of parameters is NAN - */ - public static function isGreaterThanOrEqualTo(float $a, float $b): bool - { - return self::compare($a, $b) >= 0; - } -} diff --git a/vendor/nette/utils/src/Utils/Helpers.php b/vendor/nette/utils/src/Utils/Helpers.php deleted file mode 100644 index 5e033fe..0000000 --- a/vendor/nette/utils/src/Utils/Helpers.php +++ /dev/null @@ -1,87 +0,0 @@ - $max) { - throw new \InvalidArgumentException("Minimum ($min) is not less than maximum ($max)."); - } - return min(max($value, $min), $max); - } - - - /** - * Looks for a string from possibilities that is most similar to value, but not the same (for 8-bit encoding). - * @param string[] $possibilities - */ - public static function getSuggestion(array $possibilities, string $value): ?string - { - $best = null; - $min = (strlen($value) / 4 + 1) * 10 + .1; - foreach (array_unique($possibilities) as $item) { - if ($item !== $value && ($len = levenshtein($item, $value, 10, 11, 10)) < $min) { - $min = $len; - $best = $item; - } - } - return $best; - } -} diff --git a/vendor/nette/utils/src/Utils/Html.php b/vendor/nette/utils/src/Utils/Html.php deleted file mode 100644 index cf62893..0000000 --- a/vendor/nette/utils/src/Utils/Html.php +++ /dev/null @@ -1,877 +0,0 @@ - element's attributes */ - public $attrs = []; - - /** @var bool use XHTML syntax? */ - public static $xhtml = false; - - /** @var array void elements */ - public static $emptyElements = [ - 'img' => 1, 'hr' => 1, 'br' => 1, 'input' => 1, 'meta' => 1, 'area' => 1, 'embed' => 1, 'keygen' => 1, - 'source' => 1, 'base' => 1, 'col' => 1, 'link' => 1, 'param' => 1, 'basefont' => 1, 'frame' => 1, - 'isindex' => 1, 'wbr' => 1, 'command' => 1, 'track' => 1, - ]; - - /** @var array nodes */ - protected $children = []; - - /** @var string element's name */ - private $name; - - /** @var bool is element empty? */ - private $isEmpty; - - - /** - * Constructs new HTML element. - * @param array|string $attrs element's attributes or plain text content - * @return static - */ - public static function el(string $name = null, $attrs = null) - { - $el = new static; - $parts = explode(' ', (string) $name, 2); - $el->setName($parts[0]); - - if (is_array($attrs)) { - $el->attrs = $attrs; - - } elseif ($attrs !== null) { - $el->setText($attrs); - } - - if (isset($parts[1])) { - foreach (Strings::matchAll($parts[1] . ' ', '#([a-z0-9:-]+)(?:=(["\'])?(.*?)(?(2)\2|\s))?#i') as $m) { - $el->attrs[$m[1]] = $m[3] ?? true; - } - } - - return $el; - } - - - /** - * Returns an object representing HTML text. - */ - public static function fromHtml(string $html): self - { - return (new static)->setHtml($html); - } - - - /** - * Returns an object representing plain text. - */ - public static function fromText(string $text): self - { - return (new static)->setText($text); - } - - - /** - * Converts to HTML. - */ - final public function toHtml(): string - { - return $this->render(); - } - - - /** - * Converts to plain text. - */ - final public function toText(): string - { - return $this->getText(); - } - - - /** - * Converts given HTML code to plain text. - */ - public static function htmlToText(string $html): string - { - return html_entity_decode(strip_tags($html), ENT_QUOTES | ENT_HTML5, 'UTF-8'); - } - - - /** - * Changes element's name. - * @return static - */ - final public function setName(string $name, bool $isEmpty = null) - { - $this->name = $name; - $this->isEmpty = $isEmpty ?? isset(static::$emptyElements[$name]); - return $this; - } - - - /** - * Returns element's name. - */ - final public function getName(): string - { - return $this->name; - } - - - /** - * Is element empty? - */ - final public function isEmpty(): bool - { - return $this->isEmpty; - } - - - /** - * Sets multiple attributes. - * @return static - */ - public function addAttributes(array $attrs) - { - $this->attrs = array_merge($this->attrs, $attrs); - return $this; - } - - - /** - * Appends value to element's attribute. - * @param mixed $value - * @param mixed $option - * @return static - */ - public function appendAttribute(string $name, $value, $option = true) - { - if (is_array($value)) { - $prev = isset($this->attrs[$name]) ? (array) $this->attrs[$name] : []; - $this->attrs[$name] = $value + $prev; - - } elseif ((string) $value === '') { - $tmp = &$this->attrs[$name]; // appending empty value? -> ignore, but ensure it exists - - } elseif (!isset($this->attrs[$name]) || is_array($this->attrs[$name])) { // needs array - $this->attrs[$name][$value] = $option; - - } else { - $this->attrs[$name] = [$this->attrs[$name] => true, $value => $option]; - } - return $this; - } - - - /** - * Sets element's attribute. - * @param mixed $value - * @return static - */ - public function setAttribute(string $name, $value) - { - $this->attrs[$name] = $value; - return $this; - } - - - /** - * Returns element's attribute. - * @return mixed - */ - public function getAttribute(string $name) - { - return $this->attrs[$name] ?? null; - } - - - /** - * Unsets element's attribute. - * @return static - */ - public function removeAttribute(string $name) - { - unset($this->attrs[$name]); - return $this; - } - - - /** - * Unsets element's attributes. - * @return static - */ - public function removeAttributes(array $attributes) - { - foreach ($attributes as $name) { - unset($this->attrs[$name]); - } - return $this; - } - - - /** - * Overloaded setter for element's attribute. - * @param mixed $value - */ - final public function __set(string $name, $value): void - { - $this->attrs[$name] = $value; - } - - - /** - * Overloaded getter for element's attribute. - * @return mixed - */ - final public function &__get(string $name) - { - return $this->attrs[$name]; - } - - - /** - * Overloaded tester for element's attribute. - */ - final public function __isset(string $name): bool - { - return isset($this->attrs[$name]); - } - - - /** - * Overloaded unsetter for element's attribute. - */ - final public function __unset(string $name): void - { - unset($this->attrs[$name]); - } - - - /** - * Overloaded setter for element's attribute. - * @return mixed - */ - final public function __call(string $m, array $args) - { - $p = substr($m, 0, 3); - if ($p === 'get' || $p === 'set' || $p === 'add') { - $m = substr($m, 3); - $m[0] = $m[0] | "\x20"; - if ($p === 'get') { - return $this->attrs[$m] ?? null; - - } elseif ($p === 'add') { - $args[] = true; - } - } - - if (count($args) === 0) { // invalid - - } elseif (count($args) === 1) { // set - $this->attrs[$m] = $args[0]; - - } else { // add - $this->appendAttribute($m, $args[0], $args[1]); - } - - return $this; - } - - - /** - * Special setter for element's attribute. - * @return static - */ - final public function href(string $path, array $query = null) - { - if ($query) { - $query = http_build_query($query, '', '&'); - if ($query !== '') { - $path .= '?' . $query; - } - } - $this->attrs['href'] = $path; - return $this; - } - - - /** - * Setter for data-* attributes. Booleans are converted to 'true' resp. 'false'. - * @param mixed $value - * @return static - */ - public function data(string $name, $value = null) - { - if (func_num_args() === 1) { - $this->attrs['data'] = $name; - } else { - $this->attrs["data-$name"] = is_bool($value) - ? json_encode($value) - : $value; - } - return $this; - } - - - /** - * Sets element's HTML content. - * @param HtmlStringable|string $html - * @return static - */ - final public function setHtml($html) - { - $this->children = [(string) $html]; - return $this; - } - - - /** - * Returns element's HTML content. - */ - final public function getHtml(): string - { - return implode('', $this->children); - } - - - /** - * Sets element's textual content. - * @param HtmlStringable|string|int|float $text - * @return static - */ - final public function setText($text) - { - if (!$text instanceof HtmlStringable) { - $text = htmlspecialchars((string) $text, ENT_NOQUOTES, 'UTF-8'); - } - $this->children = [(string) $text]; - return $this; - } - - - /** - * Returns element's textual content. - */ - final public function getText(): string - { - return self::htmlToText($this->getHtml()); - } - - - /** - * Adds new element's child. - * @param HtmlStringable|string $child Html node or raw HTML string - * @return static - */ - final public function addHtml($child) - { - return $this->insert(null, $child); - } - - - /** - * Appends plain-text string to element content. - * @param HtmlStringable|string|int|float $text - * @return static - */ - public function addText($text) - { - if (!$text instanceof HtmlStringable) { - $text = htmlspecialchars((string) $text, ENT_NOQUOTES, 'UTF-8'); - } - return $this->insert(null, $text); - } - - - /** - * Creates and adds a new Html child. - * @param array|string $attrs element's attributes or raw HTML string - * @return static created element - */ - final public function create(string $name, $attrs = null) - { - $this->insert(null, $child = static::el($name, $attrs)); - return $child; - } - - - /** - * Inserts child node. - * @param HtmlStringable|string $child Html node or raw HTML string - * @return static - */ - public function insert(?int $index, $child, bool $replace = false) - { - $child = $child instanceof self ? $child : (string) $child; - if ($index === null) { // append - $this->children[] = $child; - - } else { // insert or replace - array_splice($this->children, $index, $replace ? 1 : 0, [$child]); - } - - return $this; - } - - - /** - * Inserts (replaces) child node (\ArrayAccess implementation). - * @param int|null $index position or null for appending - * @param Html|string $child Html node or raw HTML string - */ - final public function offsetSet($index, $child): void - { - $this->insert($index, $child, true); - } - - - /** - * Returns child node (\ArrayAccess implementation). - * @param int $index - * @return HtmlStringable|string - */ - #[\ReturnTypeWillChange] - final public function offsetGet($index) - { - return $this->children[$index]; - } - - - /** - * Exists child node? (\ArrayAccess implementation). - * @param int $index - */ - final public function offsetExists($index): bool - { - return isset($this->children[$index]); - } - - - /** - * Removes child node (\ArrayAccess implementation). - * @param int $index - */ - public function offsetUnset($index): void - { - if (isset($this->children[$index])) { - array_splice($this->children, $index, 1); - } - } - - - /** - * Returns children count. - */ - final public function count(): int - { - return count($this->children); - } - - - /** - * Removes all children. - */ - public function removeChildren(): void - { - $this->children = []; - } - - - /** - * Iterates over elements. - * @return \ArrayIterator - */ - final public function getIterator(): \ArrayIterator - { - return new \ArrayIterator($this->children); - } - - - /** - * Returns all children. - */ - final public function getChildren(): array - { - return $this->children; - } - - - /** - * Renders element's start tag, content and end tag. - */ - final public function render(int $indent = null): string - { - $s = $this->startTag(); - - if (!$this->isEmpty) { - // add content - if ($indent !== null) { - $indent++; - } - foreach ($this->children as $child) { - if ($child instanceof self) { - $s .= $child->render($indent); - } else { - $s .= $child; - } - } - - // add end tag - $s .= $this->endTag(); - } - - if ($indent !== null) { - return "\n" . str_repeat("\t", $indent - 1) . $s . "\n" . str_repeat("\t", max(0, $indent - 2)); - } - return $s; - } - - - final public function __toString(): string - { - try { - return $this->render(); - } catch (\Throwable $e) { - if (PHP_VERSION_ID >= 70400) { - throw $e; - } - trigger_error('Exception in ' . __METHOD__ . "(): {$e->getMessage()} in {$e->getFile()}:{$e->getLine()}", E_USER_ERROR); - return ''; - } - } - - - /** - * Returns element's start tag. - */ - final public function startTag(): string - { - return $this->name - ? '<' . $this->name . $this->attributes() . (static::$xhtml && $this->isEmpty ? ' />' : '>') - : ''; - } - - - /** - * Returns element's end tag. - */ - final public function endTag(): string - { - return $this->name && !$this->isEmpty ? 'name . '>' : ''; - } - - - /** - * Returns element's attributes. - * @internal - */ - final public function attributes(): string - { - if (!is_array($this->attrs)) { - return ''; - } - - $s = ''; - $attrs = $this->attrs; - foreach ($attrs as $key => $value) { - if ($value === null || $value === false) { - continue; - - } elseif ($value === true) { - if (static::$xhtml) { - $s .= ' ' . $key . '="' . $key . '"'; - } else { - $s .= ' ' . $key; - } - continue; - - } elseif (is_array($value)) { - if (strncmp($key, 'data-', 5) === 0) { - $value = Json::encode($value); - - } else { - $tmp = null; - foreach ($value as $k => $v) { - if ($v != null) { // intentionally ==, skip nulls & empty string - // composite 'style' vs. 'others' - $tmp[] = $v === true - ? $k - : (is_string($k) ? $k . ':' . $v : $v); - } - } - if ($tmp === null) { - continue; - } - - $value = implode($key === 'style' || !strncmp($key, 'on', 2) ? ';' : ' ', $tmp); - } - - } elseif (is_float($value)) { - $value = rtrim(rtrim(number_format($value, 10, '.', ''), '0'), '.'); - - } else { - $value = (string) $value; - } - - $q = strpos($value, '"') === false ? '"' : "'"; - $s .= ' ' . $key . '=' . $q - . str_replace( - ['&', $q, '<'], - ['&', $q === '"' ? '"' : ''', self::$xhtml ? '<' : '<'], - $value - ) - . (strpos($value, '`') !== false && strpbrk($value, ' <>"\'') === false ? ' ' : '') - . $q; - } - - $s = str_replace('@', '@', $s); - return $s; - } - - - /** - * Clones all children too. - */ - public function __clone() - { - foreach ($this->children as $key => $value) { - if (is_object($value)) { - $this->children[$key] = clone $value; - } - } - } -} diff --git a/vendor/nette/utils/src/Utils/Image.php b/vendor/nette/utils/src/Utils/Image.php deleted file mode 100644 index 1c30571..0000000 --- a/vendor/nette/utils/src/Utils/Image.php +++ /dev/null @@ -1,726 +0,0 @@ - - * $image = Image::fromFile('nette.jpg'); - * $image->resize(150, 100); - * $image->sharpen(); - * $image->send(); - * - * - * @method Image affine(array $affine, array $clip = null) - * @method array affineMatrixConcat(array $m1, array $m2) - * @method array affineMatrixGet(int $type, mixed $options = null) - * @method void alphaBlending(bool $on) - * @method void antialias(bool $on) - * @method void arc($x, $y, $w, $h, $start, $end, $color) - * @method void char(int $font, $x, $y, string $char, $color) - * @method void charUp(int $font, $x, $y, string $char, $color) - * @method int colorAllocate($red, $green, $blue) - * @method int colorAllocateAlpha($red, $green, $blue, $alpha) - * @method int colorAt($x, $y) - * @method int colorClosest($red, $green, $blue) - * @method int colorClosestAlpha($red, $green, $blue, $alpha) - * @method int colorClosestHWB($red, $green, $blue) - * @method void colorDeallocate($color) - * @method int colorExact($red, $green, $blue) - * @method int colorExactAlpha($red, $green, $blue, $alpha) - * @method void colorMatch(Image $image2) - * @method int colorResolve($red, $green, $blue) - * @method int colorResolveAlpha($red, $green, $blue, $alpha) - * @method void colorSet($index, $red, $green, $blue) - * @method array colorsForIndex($index) - * @method int colorsTotal() - * @method int colorTransparent($color = null) - * @method void convolution(array $matrix, float $div, float $offset) - * @method void copy(Image $src, $dstX, $dstY, $srcX, $srcY, $srcW, $srcH) - * @method void copyMerge(Image $src, $dstX, $dstY, $srcX, $srcY, $srcW, $srcH, $opacity) - * @method void copyMergeGray(Image $src, $dstX, $dstY, $srcX, $srcY, $srcW, $srcH, $opacity) - * @method void copyResampled(Image $src, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH) - * @method void copyResized(Image $src, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH) - * @method Image cropAuto(int $mode = -1, float $threshold = .5, int $color = -1) - * @method void ellipse($cx, $cy, $w, $h, $color) - * @method void fill($x, $y, $color) - * @method void filledArc($cx, $cy, $w, $h, $s, $e, $color, $style) - * @method void filledEllipse($cx, $cy, $w, $h, $color) - * @method void filledPolygon(array $points, $numPoints, $color) - * @method void filledRectangle($x1, $y1, $x2, $y2, $color) - * @method void fillToBorder($x, $y, $border, $color) - * @method void filter($filtertype) - * @method void flip(int $mode) - * @method array ftText($size, $angle, $x, $y, $col, string $fontFile, string $text, array $extrainfo = null) - * @method void gammaCorrect(float $inputgamma, float $outputgamma) - * @method array getClip() - * @method int interlace($interlace = null) - * @method bool isTrueColor() - * @method void layerEffect($effect) - * @method void line($x1, $y1, $x2, $y2, $color) - * @method void openPolygon(array $points, int $num_points, int $color) - * @method void paletteCopy(Image $source) - * @method void paletteToTrueColor() - * @method void polygon(array $points, $numPoints, $color) - * @method array psText(string $text, $font, $size, $color, $backgroundColor, $x, $y, $space = null, $tightness = null, float $angle = null, $antialiasSteps = null) - * @method void rectangle($x1, $y1, $x2, $y2, $col) - * @method mixed resolution(int $res_x = null, int $res_y = null) - * @method Image rotate(float $angle, $backgroundColor) - * @method void saveAlpha(bool $saveflag) - * @method Image scale(int $newWidth, int $newHeight = -1, int $mode = IMG_BILINEAR_FIXED) - * @method void setBrush(Image $brush) - * @method void setClip(int $x1, int $y1, int $x2, int $y2) - * @method void setInterpolation(int $method = IMG_BILINEAR_FIXED) - * @method void setPixel($x, $y, $color) - * @method void setStyle(array $style) - * @method void setThickness($thickness) - * @method void setTile(Image $tile) - * @method void string($font, $x, $y, string $s, $col) - * @method void stringUp($font, $x, $y, string $s, $col) - * @method void trueColorToPalette(bool $dither, $ncolors) - * @method array ttfText($size, $angle, $x, $y, $color, string $fontfile, string $text) - * @property-read int $width - * @property-read int $height - * @property-read resource|\GdImage $imageResource - */ -class Image -{ - use Nette\SmartObject; - - /** {@link resize()} only shrinks images */ - public const SHRINK_ONLY = 0b0001; - - /** {@link resize()} will ignore aspect ratio */ - public const STRETCH = 0b0010; - - /** {@link resize()} fits in given area so its dimensions are less than or equal to the required dimensions */ - public const FIT = 0b0000; - - /** {@link resize()} fills given area so its dimensions are greater than or equal to the required dimensions */ - public const FILL = 0b0100; - - /** {@link resize()} fills given area exactly */ - public const EXACT = 0b1000; - - /** image types */ - public const - JPEG = IMAGETYPE_JPEG, - PNG = IMAGETYPE_PNG, - GIF = IMAGETYPE_GIF, - WEBP = IMAGETYPE_WEBP, - BMP = IMAGETYPE_BMP; - - public const EMPTY_GIF = "GIF89a\x01\x00\x01\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00!\xf9\x04\x01\x00\x00\x00\x00,\x00\x00\x00\x00\x01\x00\x01\x00\x00\x02\x02D\x01\x00;"; - - private const FORMATS = [self::JPEG => 'jpeg', self::PNG => 'png', self::GIF => 'gif', self::WEBP => 'webp', self::BMP => 'bmp']; - - /** @var resource|\GdImage */ - private $image; - - - /** - * Returns RGB color (0..255) and transparency (0..127). - */ - public static function rgb(int $red, int $green, int $blue, int $transparency = 0): array - { - return [ - 'red' => max(0, min(255, $red)), - 'green' => max(0, min(255, $green)), - 'blue' => max(0, min(255, $blue)), - 'alpha' => max(0, min(127, $transparency)), - ]; - } - - - /** - * Reads an image from a file and returns its type in $type. - * @throws Nette\NotSupportedException if gd extension is not loaded - * @throws UnknownImageFileException if file not found or file type is not known - * @return static - */ - public static function fromFile(string $file, int &$type = null) - { - if (!extension_loaded('gd')) { - throw new Nette\NotSupportedException('PHP extension GD is not loaded.'); - } - - $type = self::detectTypeFromFile($file); - if (!$type) { - throw new UnknownImageFileException(is_file($file) ? "Unknown type of file '$file'." : "File '$file' not found."); - } - - $method = 'imagecreatefrom' . self::FORMATS[$type]; - return new static(Callback::invokeSafe($method, [$file], function (string $message): void { - throw new ImageException($message); - })); - } - - - /** - * Reads an image from a string and returns its type in $type. - * @return static - * @throws Nette\NotSupportedException if gd extension is not loaded - * @throws ImageException - */ - public static function fromString(string $s, int &$type = null) - { - if (!extension_loaded('gd')) { - throw new Nette\NotSupportedException('PHP extension GD is not loaded.'); - } - - $type = self::detectTypeFromString($s); - if (!$type) { - throw new UnknownImageFileException('Unknown type of image.'); - } - - return new static(Callback::invokeSafe('imagecreatefromstring', [$s], function (string $message): void { - throw new ImageException($message); - })); - } - - - /** - * Creates a new true color image of the given dimensions. The default color is black. - * @return static - * @throws Nette\NotSupportedException if gd extension is not loaded - */ - public static function fromBlank(int $width, int $height, array $color = null) - { - if (!extension_loaded('gd')) { - throw new Nette\NotSupportedException('PHP extension GD is not loaded.'); - } - - if ($width < 1 || $height < 1) { - throw new Nette\InvalidArgumentException('Image width and height must be greater than zero.'); - } - - $image = imagecreatetruecolor($width, $height); - if ($color) { - $color += ['alpha' => 0]; - $color = imagecolorresolvealpha($image, $color['red'], $color['green'], $color['blue'], $color['alpha']); - imagealphablending($image, false); - imagefilledrectangle($image, 0, 0, $width - 1, $height - 1, $color); - imagealphablending($image, true); - } - return new static($image); - } - - - /** - * Returns the type of image from file. - */ - public static function detectTypeFromFile(string $file): ?int - { - $type = @getimagesize($file)[2]; // @ - files smaller than 12 bytes causes read error - return isset(self::FORMATS[$type]) ? $type : null; - } - - - /** - * Returns the type of image from string. - */ - public static function detectTypeFromString(string $s): ?int - { - $type = @getimagesizefromstring($s)[2]; // @ - strings smaller than 12 bytes causes read error - return isset(self::FORMATS[$type]) ? $type : null; - } - - - /** - * Returns the file extension for the given `Image::XXX` constant. - */ - public static function typeToExtension(int $type): string - { - if (!isset(self::FORMATS[$type])) { - throw new Nette\InvalidArgumentException("Unsupported image type '$type'."); - } - return self::FORMATS[$type]; - } - - - /** - * Returns the mime type for the given `Image::XXX` constant. - */ - public static function typeToMimeType(int $type): string - { - return 'image/' . self::typeToExtension($type); - } - - - /** - * Wraps GD image. - * @param resource|\GdImage $image - */ - public function __construct($image) - { - $this->setImageResource($image); - imagesavealpha($image, true); - } - - - /** - * Returns image width. - */ - public function getWidth(): int - { - return imagesx($this->image); - } - - - /** - * Returns image height. - */ - public function getHeight(): int - { - return imagesy($this->image); - } - - - /** - * Sets image resource. - * @param resource|\GdImage $image - * @return static - */ - protected function setImageResource($image) - { - if (!$image instanceof \GdImage && !(is_resource($image) && get_resource_type($image) === 'gd')) { - throw new Nette\InvalidArgumentException('Image is not valid.'); - } - $this->image = $image; - return $this; - } - - - /** - * Returns image GD resource. - * @return resource|\GdImage - */ - public function getImageResource() - { - return $this->image; - } - - - /** - * Scales an image. - * @param int|string|null $width in pixels or percent - * @param int|string|null $height in pixels or percent - * @return static - */ - public function resize($width, $height, int $flags = self::FIT) - { - if ($flags & self::EXACT) { - return $this->resize($width, $height, self::FILL)->crop('50%', '50%', $width, $height); - } - - [$newWidth, $newHeight] = static::calculateSize($this->getWidth(), $this->getHeight(), $width, $height, $flags); - - if ($newWidth !== $this->getWidth() || $newHeight !== $this->getHeight()) { // resize - $newImage = static::fromBlank($newWidth, $newHeight, self::rgb(0, 0, 0, 127))->getImageResource(); - imagecopyresampled( - $newImage, - $this->image, - 0, - 0, - 0, - 0, - $newWidth, - $newHeight, - $this->getWidth(), - $this->getHeight() - ); - $this->image = $newImage; - } - - if ($width < 0 || $height < 0) { - imageflip($this->image, $width < 0 ? ($height < 0 ? IMG_FLIP_BOTH : IMG_FLIP_HORIZONTAL) : IMG_FLIP_VERTICAL); - } - return $this; - } - - - /** - * Calculates dimensions of resized image. - * @param int|string|null $newWidth in pixels or percent - * @param int|string|null $newHeight in pixels or percent - */ - public static function calculateSize( - int $srcWidth, - int $srcHeight, - $newWidth, - $newHeight, - int $flags = self::FIT - ): array { - if ($newWidth === null) { - } elseif (self::isPercent($newWidth)) { - $newWidth = (int) round($srcWidth / 100 * abs($newWidth)); - $percents = true; - } else { - $newWidth = abs($newWidth); - } - - if ($newHeight === null) { - } elseif (self::isPercent($newHeight)) { - $newHeight = (int) round($srcHeight / 100 * abs($newHeight)); - $flags |= empty($percents) ? 0 : self::STRETCH; - } else { - $newHeight = abs($newHeight); - } - - if ($flags & self::STRETCH) { // non-proportional - if (!$newWidth || !$newHeight) { - throw new Nette\InvalidArgumentException('For stretching must be both width and height specified.'); - } - - if ($flags & self::SHRINK_ONLY) { - $newWidth = (int) round($srcWidth * min(1, $newWidth / $srcWidth)); - $newHeight = (int) round($srcHeight * min(1, $newHeight / $srcHeight)); - } - - } else { // proportional - if (!$newWidth && !$newHeight) { - throw new Nette\InvalidArgumentException('At least width or height must be specified.'); - } - - $scale = []; - if ($newWidth > 0) { // fit width - $scale[] = $newWidth / $srcWidth; - } - - if ($newHeight > 0) { // fit height - $scale[] = $newHeight / $srcHeight; - } - - if ($flags & self::FILL) { - $scale = [max($scale)]; - } - - if ($flags & self::SHRINK_ONLY) { - $scale[] = 1; - } - - $scale = min($scale); - $newWidth = (int) round($srcWidth * $scale); - $newHeight = (int) round($srcHeight * $scale); - } - - return [max($newWidth, 1), max($newHeight, 1)]; - } - - - /** - * Crops image. - * @param int|string $left in pixels or percent - * @param int|string $top in pixels or percent - * @param int|string $width in pixels or percent - * @param int|string $height in pixels or percent - * @return static - */ - public function crop($left, $top, $width, $height) - { - [$r['x'], $r['y'], $r['width'], $r['height']] - = static::calculateCutout($this->getWidth(), $this->getHeight(), $left, $top, $width, $height); - if (gd_info()['GD Version'] === 'bundled (2.1.0 compatible)') { - $this->image = imagecrop($this->image, $r); - imagesavealpha($this->image, true); - } else { - $newImage = static::fromBlank($r['width'], $r['height'], self::RGB(0, 0, 0, 127))->getImageResource(); - imagecopy($newImage, $this->image, 0, 0, $r['x'], $r['y'], $r['width'], $r['height']); - $this->image = $newImage; - } - return $this; - } - - - /** - * Calculates dimensions of cutout in image. - * @param int|string $left in pixels or percent - * @param int|string $top in pixels or percent - * @param int|string $newWidth in pixels or percent - * @param int|string $newHeight in pixels or percent - */ - public static function calculateCutout(int $srcWidth, int $srcHeight, $left, $top, $newWidth, $newHeight): array - { - if (self::isPercent($newWidth)) { - $newWidth = (int) round($srcWidth / 100 * $newWidth); - } - if (self::isPercent($newHeight)) { - $newHeight = (int) round($srcHeight / 100 * $newHeight); - } - if (self::isPercent($left)) { - $left = (int) round(($srcWidth - $newWidth) / 100 * $left); - } - if (self::isPercent($top)) { - $top = (int) round(($srcHeight - $newHeight) / 100 * $top); - } - if ($left < 0) { - $newWidth += $left; - $left = 0; - } - if ($top < 0) { - $newHeight += $top; - $top = 0; - } - $newWidth = min($newWidth, $srcWidth - $left); - $newHeight = min($newHeight, $srcHeight - $top); - return [$left, $top, $newWidth, $newHeight]; - } - - - /** - * Sharpens image a little bit. - * @return static - */ - public function sharpen() - { - imageconvolution($this->image, [ // my magic numbers ;) - [-1, -1, -1], - [-1, 24, -1], - [-1, -1, -1], - ], 16, 0); - return $this; - } - - - /** - * Puts another image into this image. - * @param int|string $left in pixels or percent - * @param int|string $top in pixels or percent - * @param int $opacity 0..100 - * @return static - */ - public function place(self $image, $left = 0, $top = 0, int $opacity = 100) - { - $opacity = max(0, min(100, $opacity)); - if ($opacity === 0) { - return $this; - } - - $width = $image->getWidth(); - $height = $image->getHeight(); - - if (self::isPercent($left)) { - $left = (int) round(($this->getWidth() - $width) / 100 * $left); - } - - if (self::isPercent($top)) { - $top = (int) round(($this->getHeight() - $height) / 100 * $top); - } - - $output = $input = $image->image; - if ($opacity < 100) { - $tbl = []; - for ($i = 0; $i < 128; $i++) { - $tbl[$i] = round(127 - (127 - $i) * $opacity / 100); - } - - $output = imagecreatetruecolor($width, $height); - imagealphablending($output, false); - if (!$image->isTrueColor()) { - $input = $output; - imagefilledrectangle($output, 0, 0, $width, $height, imagecolorallocatealpha($output, 0, 0, 0, 127)); - imagecopy($output, $image->image, 0, 0, 0, 0, $width, $height); - } - for ($x = 0; $x < $width; $x++) { - for ($y = 0; $y < $height; $y++) { - $c = \imagecolorat($input, $x, $y); - $c = ($c & 0xFFFFFF) + ($tbl[$c >> 24] << 24); - \imagesetpixel($output, $x, $y, $c); - } - } - imagealphablending($output, true); - } - - imagecopy( - $this->image, - $output, - $left, - $top, - 0, - 0, - $width, - $height - ); - return $this; - } - - - /** - * Saves image to the file. Quality is in the range 0..100 for JPEG (default 85) and WEBP (default 80) and 0..9 for PNG (default 9). - * @throws ImageException - */ - public function save(string $file, int $quality = null, int $type = null): void - { - if ($type === null) { - $extensions = array_flip(self::FORMATS) + ['jpg' => self::JPEG]; - $ext = strtolower(pathinfo($file, PATHINFO_EXTENSION)); - if (!isset($extensions[$ext])) { - throw new Nette\InvalidArgumentException("Unsupported file extension '$ext'."); - } - $type = $extensions[$ext]; - } - - $this->output($type, $quality, $file); - } - - - /** - * Outputs image to string. Quality is in the range 0..100 for JPEG (default 85) and WEBP (default 80) and 0..9 for PNG (default 9). - */ - public function toString(int $type = self::JPEG, int $quality = null): string - { - return Helpers::capture(function () use ($type, $quality) { - $this->output($type, $quality); - }); - } - - - /** - * Outputs image to string. - */ - public function __toString(): string - { - try { - return $this->toString(); - } catch (\Throwable $e) { - if (func_num_args() || PHP_VERSION_ID >= 70400) { - throw $e; - } - trigger_error('Exception in ' . __METHOD__ . "(): {$e->getMessage()} in {$e->getFile()}:{$e->getLine()}", E_USER_ERROR); - return ''; - } - } - - - /** - * Outputs image to browser. Quality is in the range 0..100 for JPEG (default 85) and WEBP (default 80) and 0..9 for PNG (default 9). - * @throws ImageException - */ - public function send(int $type = self::JPEG, int $quality = null): void - { - header('Content-Type: ' . self::typeToMimeType($type)); - $this->output($type, $quality); - } - - - /** - * Outputs image to browser or file. - * @throws ImageException - */ - private function output(int $type, ?int $quality, string $file = null): void - { - switch ($type) { - case self::JPEG: - $quality = $quality === null ? 85 : max(0, min(100, $quality)); - $success = @imagejpeg($this->image, $file, $quality); // @ is escalated to exception - break; - - case self::PNG: - $quality = $quality === null ? 9 : max(0, min(9, $quality)); - $success = @imagepng($this->image, $file, $quality); // @ is escalated to exception - break; - - case self::GIF: - $success = @imagegif($this->image, $file); // @ is escalated to exception - break; - - case self::WEBP: - $quality = $quality === null ? 80 : max(0, min(100, $quality)); - $success = @imagewebp($this->image, $file, $quality); // @ is escalated to exception - break; - - case self::BMP: - $success = @imagebmp($this->image, $file); // @ is escalated to exception - break; - - default: - throw new Nette\InvalidArgumentException("Unsupported image type '$type'."); - } - if (!$success) { - throw new ImageException(Helpers::getLastError() ?: 'Unknown error'); - } - } - - - /** - * Call to undefined method. - * @return mixed - * @throws Nette\MemberAccessException - */ - public function __call(string $name, array $args) - { - $function = 'image' . $name; - if (!function_exists($function)) { - ObjectHelpers::strictCall(static::class, $name); - } - - foreach ($args as $key => $value) { - if ($value instanceof self) { - $args[$key] = $value->getImageResource(); - - } elseif (is_array($value) && isset($value['red'])) { // rgb - $args[$key] = imagecolorallocatealpha( - $this->image, - $value['red'], - $value['green'], - $value['blue'], - $value['alpha'] - ) ?: imagecolorresolvealpha( - $this->image, - $value['red'], - $value['green'], - $value['blue'], - $value['alpha'] - ); - } - } - $res = $function($this->image, ...$args); - return $res instanceof \GdImage || (is_resource($res) && get_resource_type($res) === 'gd') - ? $this->setImageResource($res) - : $res; - } - - - public function __clone() - { - ob_start(function () {}); - imagegd2($this->image); - $this->setImageResource(imagecreatefromstring(ob_get_clean())); - } - - - /** - * @param int|string $num in pixels or percent - */ - private static function isPercent(&$num): bool - { - if (is_string($num) && substr($num, -1) === '%') { - $num = (float) substr($num, 0, -1); - return true; - } elseif (is_int($num) || $num === (string) (int) $num) { - $num = (int) $num; - return false; - } - throw new Nette\InvalidArgumentException("Expected dimension in int|string, '$num' given."); - } - - - /** - * Prevents serialization. - */ - public function __sleep(): array - { - throw new Nette\NotSupportedException('You cannot serialize or unserialize ' . self::class . ' instances.'); - } -} diff --git a/vendor/nette/utils/src/Utils/Json.php b/vendor/nette/utils/src/Utils/Json.php deleted file mode 100644 index 782c1ff..0000000 --- a/vendor/nette/utils/src/Utils/Json.php +++ /dev/null @@ -1,64 +0,0 @@ -getProperties(\ReflectionProperty::IS_PUBLIC), function ($p) { return !$p->isStatic(); }), - self::parseFullDoc($rc, '~^[ \t*]*@property(?:-read)?[ \t]+(?:\S+[ \t]+)??\$(\w+)~m') - ), $name); - throw new MemberAccessException("Cannot read an undeclared property $class::\$$name" . ($hint ? ", did you mean \$$hint?" : '.')); - } - - - /** - * @return never - * @throws MemberAccessException - */ - public static function strictSet(string $class, string $name): void - { - $rc = new \ReflectionClass($class); - $hint = self::getSuggestion(array_merge( - array_filter($rc->getProperties(\ReflectionProperty::IS_PUBLIC), function ($p) { return !$p->isStatic(); }), - self::parseFullDoc($rc, '~^[ \t*]*@property(?:-write)?[ \t]+(?:\S+[ \t]+)??\$(\w+)~m') - ), $name); - throw new MemberAccessException("Cannot write to an undeclared property $class::\$$name" . ($hint ? ", did you mean \$$hint?" : '.')); - } - - - /** - * @return never - * @throws MemberAccessException - */ - public static function strictCall(string $class, string $method, array $additionalMethods = []): void - { - $trace = debug_backtrace(0, 3); // suppose this method is called from __call() - $context = ($trace[1]['function'] ?? null) === '__call' - ? ($trace[2]['class'] ?? null) - : null; - - if ($context && is_a($class, $context, true) && method_exists($context, $method)) { // called parent::$method() - $class = get_parent_class($context); - } - - if (method_exists($class, $method)) { // insufficient visibility - $rm = new \ReflectionMethod($class, $method); - $visibility = $rm->isPrivate() - ? 'private ' - : ($rm->isProtected() ? 'protected ' : ''); - throw new MemberAccessException("Call to {$visibility}method $class::$method() from " . ($context ? "scope $context." : 'global scope.')); - - } else { - $hint = self::getSuggestion(array_merge( - get_class_methods($class), - self::parseFullDoc(new \ReflectionClass($class), '~^[ \t*]*@method[ \t]+(?:\S+[ \t]+)??(\w+)\(~m'), - $additionalMethods - ), $method); - throw new MemberAccessException("Call to undefined method $class::$method()" . ($hint ? ", did you mean $hint()?" : '.')); - } - } - - - /** - * @return never - * @throws MemberAccessException - */ - public static function strictStaticCall(string $class, string $method): void - { - $trace = debug_backtrace(0, 3); // suppose this method is called from __callStatic() - $context = ($trace[1]['function'] ?? null) === '__callStatic' - ? ($trace[2]['class'] ?? null) - : null; - - if ($context && is_a($class, $context, true) && method_exists($context, $method)) { // called parent::$method() - $class = get_parent_class($context); - } - - if (method_exists($class, $method)) { // insufficient visibility - $rm = new \ReflectionMethod($class, $method); - $visibility = $rm->isPrivate() - ? 'private ' - : ($rm->isProtected() ? 'protected ' : ''); - throw new MemberAccessException("Call to {$visibility}method $class::$method() from " . ($context ? "scope $context." : 'global scope.')); - - } else { - $hint = self::getSuggestion( - array_filter((new \ReflectionClass($class))->getMethods(\ReflectionMethod::IS_PUBLIC), function ($m) { return $m->isStatic(); }), - $method - ); - throw new MemberAccessException("Call to undefined static method $class::$method()" . ($hint ? ", did you mean $hint()?" : '.')); - } - } - - - /** - * Returns array of magic properties defined by annotation @property. - * @return array of [name => bit mask] - * @internal - */ - public static function getMagicProperties(string $class): array - { - static $cache; - $props = &$cache[$class]; - if ($props !== null) { - return $props; - } - - $rc = new \ReflectionClass($class); - preg_match_all( - '~^ [ \t*]* @property(|-read|-write) [ \t]+ [^\s$]+ [ \t]+ \$ (\w+) ()~mx', - (string) $rc->getDocComment(), - $matches, - PREG_SET_ORDER - ); - - $props = []; - foreach ($matches as [, $type, $name]) { - $uname = ucfirst($name); - $write = $type !== '-read' - && $rc->hasMethod($nm = 'set' . $uname) - && ($rm = $rc->getMethod($nm))->name === $nm && !$rm->isPrivate() && !$rm->isStatic(); - $read = $type !== '-write' - && ($rc->hasMethod($nm = 'get' . $uname) || $rc->hasMethod($nm = 'is' . $uname)) - && ($rm = $rc->getMethod($nm))->name === $nm && !$rm->isPrivate() && !$rm->isStatic(); - - if ($read || $write) { - $props[$name] = $read << 0 | ($nm[0] === 'g') << 1 | $rm->returnsReference() << 2 | $write << 3; - } - } - - foreach ($rc->getTraits() as $trait) { - $props += self::getMagicProperties($trait->name); - } - - if ($parent = get_parent_class($class)) { - $props += self::getMagicProperties($parent); - } - return $props; - } - - - /** - * Finds the best suggestion (for 8-bit encoding). - * @param (\ReflectionFunctionAbstract|\ReflectionParameter|\ReflectionClass|\ReflectionProperty|string)[] $possibilities - * @internal - */ - public static function getSuggestion(array $possibilities, string $value): ?string - { - $norm = preg_replace($re = '#^(get|set|has|is|add)(?=[A-Z])#', '+', $value); - $best = null; - $min = (strlen($value) / 4 + 1) * 10 + .1; - foreach (array_unique($possibilities, SORT_REGULAR) as $item) { - $item = $item instanceof \Reflector ? $item->name : $item; - if ($item !== $value && ( - ($len = levenshtein($item, $value, 10, 11, 10)) < $min - || ($len = levenshtein(preg_replace($re, '*', $item), $norm, 10, 11, 10)) < $min - )) { - $min = $len; - $best = $item; - } - } - return $best; - } - - - private static function parseFullDoc(\ReflectionClass $rc, string $pattern): array - { - do { - $doc[] = $rc->getDocComment(); - $traits = $rc->getTraits(); - while ($trait = array_pop($traits)) { - $doc[] = $trait->getDocComment(); - $traits += $trait->getTraits(); - } - } while ($rc = $rc->getParentClass()); - return preg_match_all($pattern, implode($doc), $m) ? $m[1] : []; - } - - - /** - * Checks if the public non-static property exists. - * @return bool|string returns 'event' if the property exists and has event like name - * @internal - */ - public static function hasProperty(string $class, string $name) - { - static $cache; - $prop = &$cache[$class][$name]; - if ($prop === null) { - $prop = false; - try { - $rp = new \ReflectionProperty($class, $name); - if ($rp->isPublic() && !$rp->isStatic()) { - $prop = $name >= 'onA' && $name < 'on_' ? 'event' : true; - } - } catch (\ReflectionException $e) { - } - } - return $prop; - } -} diff --git a/vendor/nette/utils/src/Utils/ObjectMixin.php b/vendor/nette/utils/src/Utils/ObjectMixin.php deleted file mode 100644 index 3324950..0000000 --- a/vendor/nette/utils/src/Utils/ObjectMixin.php +++ /dev/null @@ -1,41 +0,0 @@ -page = $page; - return $this; - } - - - /** - * Returns current page number. - */ - public function getPage(): int - { - return $this->base + $this->getPageIndex(); - } - - - /** - * Returns first page number. - */ - public function getFirstPage(): int - { - return $this->base; - } - - - /** - * Returns last page number. - */ - public function getLastPage(): ?int - { - return $this->itemCount === null - ? null - : $this->base + max(0, $this->getPageCount() - 1); - } - - - /** - * Returns the sequence number of the first element on the page - */ - public function getFirstItemOnPage(): int - { - return $this->itemCount !== 0 - ? $this->offset + 1 - : 0; - } - - - /** - * Returns the sequence number of the last element on the page - */ - public function getLastItemOnPage(): int - { - return $this->offset + $this->length; - } - - - /** - * Sets first page (base) number. - * @return static - */ - public function setBase(int $base) - { - $this->base = $base; - return $this; - } - - - /** - * Returns first page (base) number. - */ - public function getBase(): int - { - return $this->base; - } - - - /** - * Returns zero-based page number. - */ - protected function getPageIndex(): int - { - $index = max(0, $this->page - $this->base); - return $this->itemCount === null - ? $index - : min($index, max(0, $this->getPageCount() - 1)); - } - - - /** - * Is the current page the first one? - */ - public function isFirst(): bool - { - return $this->getPageIndex() === 0; - } - - - /** - * Is the current page the last one? - */ - public function isLast(): bool - { - return $this->itemCount === null - ? false - : $this->getPageIndex() >= $this->getPageCount() - 1; - } - - - /** - * Returns the total number of pages. - */ - public function getPageCount(): ?int - { - return $this->itemCount === null - ? null - : (int) ceil($this->itemCount / $this->itemsPerPage); - } - - - /** - * Sets the number of items to display on a single page. - * @return static - */ - public function setItemsPerPage(int $itemsPerPage) - { - $this->itemsPerPage = max(1, $itemsPerPage); - return $this; - } - - - /** - * Returns the number of items to display on a single page. - */ - public function getItemsPerPage(): int - { - return $this->itemsPerPage; - } - - - /** - * Sets the total number of items. - * @return static - */ - public function setItemCount(int $itemCount = null) - { - $this->itemCount = $itemCount === null ? null : max(0, $itemCount); - return $this; - } - - - /** - * Returns the total number of items. - */ - public function getItemCount(): ?int - { - return $this->itemCount; - } - - - /** - * Returns the absolute index of the first item on current page. - */ - public function getOffset(): int - { - return $this->getPageIndex() * $this->itemsPerPage; - } - - - /** - * Returns the absolute index of the first item on current page in countdown paging. - */ - public function getCountdownOffset(): ?int - { - return $this->itemCount === null - ? null - : max(0, $this->itemCount - ($this->getPageIndex() + 1) * $this->itemsPerPage); - } - - - /** - * Returns the number of items on current page. - */ - public function getLength(): int - { - return $this->itemCount === null - ? $this->itemsPerPage - : min($this->itemsPerPage, $this->itemCount - $this->getPageIndex() * $this->itemsPerPage); - } -} diff --git a/vendor/nette/utils/src/Utils/Random.php b/vendor/nette/utils/src/Utils/Random.php deleted file mode 100644 index 2403b4d..0000000 --- a/vendor/nette/utils/src/Utils/Random.php +++ /dev/null @@ -1,45 +0,0 @@ - 1, 'int' => 1, 'float' => 1, 'bool' => 1, 'array' => 1, 'object' => 1, - 'callable' => 1, 'iterable' => 1, 'void' => 1, 'null' => 1, 'mixed' => 1, 'false' => 1, - 'never' => 1, - ]; - - private const CLASS_KEYWORDS = [ - 'self' => 1, 'parent' => 1, 'static' => 1, - ]; - - - /** - * Determines if type is PHP built-in type. Otherwise, it is the class name. - */ - public static function isBuiltinType(string $type): bool - { - return isset(self::BUILTIN_TYPES[strtolower($type)]); - } - - - /** - * Determines if type is special class name self/parent/static. - */ - public static function isClassKeyword(string $name): bool - { - return isset(self::CLASS_KEYWORDS[strtolower($name)]); - } - - - /** - * Returns the type of return value of given function or method and normalizes `self`, `static`, and `parent` to actual class names. - * If the function does not have a return type, it returns null. - * If the function has union or intersection type, it throws Nette\InvalidStateException. - */ - public static function getReturnType(\ReflectionFunctionAbstract $func): ?string - { - $type = $func->getReturnType() ?? (PHP_VERSION_ID >= 80100 && $func instanceof \ReflectionMethod ? $func->getTentativeReturnType() : null); - return self::getType($func, $type); - } - - - /** - * @deprecated - */ - public static function getReturnTypes(\ReflectionFunctionAbstract $func): array - { - $type = Type::fromReflection($func); - return $type ? $type->getNames() : []; - } - - - /** - * Returns the type of given parameter and normalizes `self` and `parent` to the actual class names. - * If the parameter does not have a type, it returns null. - * If the parameter has union or intersection type, it throws Nette\InvalidStateException. - */ - public static function getParameterType(\ReflectionParameter $param): ?string - { - return self::getType($param, $param->getType()); - } - - - /** - * @deprecated - */ - public static function getParameterTypes(\ReflectionParameter $param): array - { - $type = Type::fromReflection($param); - return $type ? $type->getNames() : []; - } - - - /** - * Returns the type of given property and normalizes `self` and `parent` to the actual class names. - * If the property does not have a type, it returns null. - * If the property has union or intersection type, it throws Nette\InvalidStateException. - */ - public static function getPropertyType(\ReflectionProperty $prop): ?string - { - return self::getType($prop, PHP_VERSION_ID >= 70400 ? $prop->getType() : null); - } - - - /** - * @deprecated - */ - public static function getPropertyTypes(\ReflectionProperty $prop): array - { - $type = Type::fromReflection($prop); - return $type ? $type->getNames() : []; - } - - - /** - * @param \ReflectionFunction|\ReflectionMethod|\ReflectionParameter|\ReflectionProperty $reflection - */ - private static function getType($reflection, ?\ReflectionType $type): ?string - { - if ($type === null) { - return null; - - } elseif ($type instanceof \ReflectionNamedType) { - return Type::resolve($type->getName(), $reflection); - - } elseif ($type instanceof \ReflectionUnionType || $type instanceof \ReflectionIntersectionType) { - throw new Nette\InvalidStateException('The ' . self::toString($reflection) . ' is not expected to have a union or intersection type.'); - - } else { - throw new Nette\InvalidStateException('Unexpected type of ' . self::toString($reflection)); - } - } - - - /** - * Returns the default value of parameter. If it is a constant, it returns its value. - * @return mixed - * @throws \ReflectionException If the parameter does not have a default value or the constant cannot be resolved - */ - public static function getParameterDefaultValue(\ReflectionParameter $param) - { - if ($param->isDefaultValueConstant()) { - $const = $orig = $param->getDefaultValueConstantName(); - $pair = explode('::', $const); - if (isset($pair[1])) { - $pair[0] = Type::resolve($pair[0], $param); - try { - $rcc = new \ReflectionClassConstant($pair[0], $pair[1]); - } catch (\ReflectionException $e) { - $name = self::toString($param); - throw new \ReflectionException("Unable to resolve constant $orig used as default value of $name.", 0, $e); - } - return $rcc->getValue(); - - } elseif (!defined($const)) { - $const = substr((string) strrchr($const, '\\'), 1); - if (!defined($const)) { - $name = self::toString($param); - throw new \ReflectionException("Unable to resolve constant $orig used as default value of $name."); - } - } - return constant($const); - } - return $param->getDefaultValue(); - } - - - /** - * Returns a reflection of a class or trait that contains a declaration of given property. Property can also be declared in the trait. - */ - public static function getPropertyDeclaringClass(\ReflectionProperty $prop): \ReflectionClass - { - foreach ($prop->getDeclaringClass()->getTraits() as $trait) { - if ($trait->hasProperty($prop->name) - // doc-comment guessing as workaround for insufficient PHP reflection - && $trait->getProperty($prop->name)->getDocComment() === $prop->getDocComment() - ) { - return self::getPropertyDeclaringClass($trait->getProperty($prop->name)); - } - } - return $prop->getDeclaringClass(); - } - - - /** - * Returns a reflection of a method that contains a declaration of $method. - * Usually, each method is its own declaration, but the body of the method can also be in the trait and under a different name. - */ - public static function getMethodDeclaringMethod(\ReflectionMethod $method): \ReflectionMethod - { - // file & line guessing as workaround for insufficient PHP reflection - $decl = $method->getDeclaringClass(); - if ($decl->getFileName() === $method->getFileName() - && $decl->getStartLine() <= $method->getStartLine() - && $decl->getEndLine() >= $method->getEndLine() - ) { - return $method; - } - - $hash = [$method->getFileName(), $method->getStartLine(), $method->getEndLine()]; - if (($alias = $decl->getTraitAliases()[$method->name] ?? null) - && ($m = new \ReflectionMethod($alias)) - && $hash === [$m->getFileName(), $m->getStartLine(), $m->getEndLine()] - ) { - return self::getMethodDeclaringMethod($m); - } - - foreach ($decl->getTraits() as $trait) { - if ($trait->hasMethod($method->name) - && ($m = $trait->getMethod($method->name)) - && $hash === [$m->getFileName(), $m->getStartLine(), $m->getEndLine()] - ) { - return self::getMethodDeclaringMethod($m); - } - } - return $method; - } - - - /** - * Finds out if reflection has access to PHPdoc comments. Comments may not be available due to the opcode cache. - */ - public static function areCommentsAvailable(): bool - { - static $res; - return $res ?? $res = (bool) (new \ReflectionMethod(__METHOD__))->getDocComment(); - } - - - public static function toString(\Reflector $ref): string - { - if ($ref instanceof \ReflectionClass) { - return $ref->name; - } elseif ($ref instanceof \ReflectionMethod) { - return $ref->getDeclaringClass()->name . '::' . $ref->name . '()'; - } elseif ($ref instanceof \ReflectionFunction) { - return $ref->name . '()'; - } elseif ($ref instanceof \ReflectionProperty) { - return self::getPropertyDeclaringClass($ref)->name . '::$' . $ref->name; - } elseif ($ref instanceof \ReflectionParameter) { - return '$' . $ref->name . ' in ' . self::toString($ref->getDeclaringFunction()); - } else { - throw new Nette\InvalidArgumentException; - } - } - - - /** - * Expands the name of the class to full name in the given context of given class. - * Thus, it returns how the PHP parser would understand $name if it were written in the body of the class $context. - * @throws Nette\InvalidArgumentException - */ - public static function expandClassName(string $name, \ReflectionClass $context): string - { - $lower = strtolower($name); - if (empty($name)) { - throw new Nette\InvalidArgumentException('Class name must not be empty.'); - - } elseif (isset(self::BUILTIN_TYPES[$lower])) { - return $lower; - - } elseif ($lower === 'self' || $lower === 'static') { - return $context->name; - - } elseif ($lower === 'parent') { - return $context->getParentClass() - ? $context->getParentClass()->name - : 'parent'; - - } elseif ($name[0] === '\\') { // fully qualified name - return ltrim($name, '\\'); - } - - $uses = self::getUseStatements($context); - $parts = explode('\\', $name, 2); - if (isset($uses[$parts[0]])) { - $parts[0] = $uses[$parts[0]]; - return implode('\\', $parts); - - } elseif ($context->inNamespace()) { - return $context->getNamespaceName() . '\\' . $name; - - } else { - return $name; - } - } - - - /** @return array of [alias => class] */ - public static function getUseStatements(\ReflectionClass $class): array - { - if ($class->isAnonymous()) { - throw new Nette\NotImplementedException('Anonymous classes are not supported.'); - } - static $cache = []; - if (!isset($cache[$name = $class->name])) { - if ($class->isInternal()) { - $cache[$name] = []; - } else { - $code = file_get_contents($class->getFileName()); - $cache = self::parseUseStatements($code, $name) + $cache; - } - } - return $cache[$name]; - } - - - /** - * Parses PHP code to [class => [alias => class, ...]] - */ - private static function parseUseStatements(string $code, string $forClass = null): array - { - try { - $tokens = token_get_all($code, TOKEN_PARSE); - } catch (\ParseError $e) { - trigger_error($e->getMessage(), E_USER_NOTICE); - $tokens = []; - } - $namespace = $class = $classLevel = $level = null; - $res = $uses = []; - - $nameTokens = PHP_VERSION_ID < 80000 - ? [T_STRING, T_NS_SEPARATOR] - : [T_STRING, T_NS_SEPARATOR, T_NAME_QUALIFIED, T_NAME_FULLY_QUALIFIED]; - - while ($token = current($tokens)) { - next($tokens); - switch (is_array($token) ? $token[0] : $token) { - case T_NAMESPACE: - $namespace = ltrim(self::fetch($tokens, $nameTokens) . '\\', '\\'); - $uses = []; - break; - - case T_CLASS: - case T_INTERFACE: - case T_TRAIT: - case PHP_VERSION_ID < 80100 - ? T_CLASS - : T_ENUM: - if ($name = self::fetch($tokens, T_STRING)) { - $class = $namespace . $name; - $classLevel = $level + 1; - $res[$class] = $uses; - if ($class === $forClass) { - return $res; - } - } - break; - - case T_USE: - while (!$class && ($name = self::fetch($tokens, $nameTokens))) { - $name = ltrim($name, '\\'); - if (self::fetch($tokens, '{')) { - while ($suffix = self::fetch($tokens, $nameTokens)) { - if (self::fetch($tokens, T_AS)) { - $uses[self::fetch($tokens, T_STRING)] = $name . $suffix; - } else { - $tmp = explode('\\', $suffix); - $uses[end($tmp)] = $name . $suffix; - } - if (!self::fetch($tokens, ',')) { - break; - } - } - - } elseif (self::fetch($tokens, T_AS)) { - $uses[self::fetch($tokens, T_STRING)] = $name; - - } else { - $tmp = explode('\\', $name); - $uses[end($tmp)] = $name; - } - if (!self::fetch($tokens, ',')) { - break; - } - } - break; - - case T_CURLY_OPEN: - case T_DOLLAR_OPEN_CURLY_BRACES: - case '{': - $level++; - break; - - case '}': - if ($level === $classLevel) { - $class = $classLevel = null; - } - $level--; - } - } - - return $res; - } - - - private static function fetch(array &$tokens, $take): ?string - { - $res = null; - while ($token = current($tokens)) { - [$token, $s] = is_array($token) ? $token : [$token, $token]; - if (in_array($token, (array) $take, true)) { - $res .= $s; - } elseif (!in_array($token, [T_DOC_COMMENT, T_WHITESPACE, T_COMMENT], true)) { - break; - } - next($tokens); - } - return $res; - } -} diff --git a/vendor/nette/utils/src/Utils/Strings.php b/vendor/nette/utils/src/Utils/Strings.php deleted file mode 100644 index 958823d..0000000 --- a/vendor/nette/utils/src/Utils/Strings.php +++ /dev/null @@ -1,552 +0,0 @@ -= 0xD800 && $code <= 0xDFFF) || $code > 0x10FFFF) { - throw new Nette\InvalidArgumentException('Code point must be in range 0x0 to 0xD7FF or 0xE000 to 0x10FFFF.'); - } elseif (!extension_loaded('iconv')) { - throw new Nette\NotSupportedException(__METHOD__ . '() requires ICONV extension that is not loaded.'); - } - return iconv('UTF-32BE', 'UTF-8//IGNORE', pack('N', $code)); - } - - - /** - * Starts the $haystack string with the prefix $needle? - */ - public static function startsWith(string $haystack, string $needle): bool - { - return strncmp($haystack, $needle, strlen($needle)) === 0; - } - - - /** - * Ends the $haystack string with the suffix $needle? - */ - public static function endsWith(string $haystack, string $needle): bool - { - return $needle === '' || substr($haystack, -strlen($needle)) === $needle; - } - - - /** - * Does $haystack contain $needle? - */ - public static function contains(string $haystack, string $needle): bool - { - return strpos($haystack, $needle) !== false; - } - - - /** - * Returns a part of UTF-8 string specified by starting position and length. If start is negative, - * the returned string will start at the start'th character from the end of string. - */ - public static function substring(string $s, int $start, int $length = null): string - { - if (function_exists('mb_substr')) { - return mb_substr($s, $start, $length, 'UTF-8'); // MB is much faster - } elseif (!extension_loaded('iconv')) { - throw new Nette\NotSupportedException(__METHOD__ . '() requires extension ICONV or MBSTRING, neither is loaded.'); - } elseif ($length === null) { - $length = self::length($s); - } elseif ($start < 0 && $length < 0) { - $start += self::length($s); // unifies iconv_substr behavior with mb_substr - } - return iconv_substr($s, $start, $length, 'UTF-8'); - } - - - /** - * Removes control characters, normalizes line breaks to `\n`, removes leading and trailing blank lines, - * trims end spaces on lines, normalizes UTF-8 to the normal form of NFC. - */ - public static function normalize(string $s): string - { - // convert to compressed normal form (NFC) - if (class_exists('Normalizer', false) && ($n = \Normalizer::normalize($s, \Normalizer::FORM_C)) !== false) { - $s = $n; - } - - $s = self::normalizeNewLines($s); - - // remove control characters; leave \t + \n - $s = self::pcre('preg_replace', ['#[\x00-\x08\x0B-\x1F\x7F-\x9F]+#u', '', $s]); - - // right trim - $s = self::pcre('preg_replace', ['#[\t ]+$#m', '', $s]); - - // leading and trailing blank lines - $s = trim($s, "\n"); - - return $s; - } - - - /** - * Standardize line endings to unix-like. - */ - public static function normalizeNewLines(string $s): string - { - return str_replace(["\r\n", "\r"], "\n", $s); - } - - - /** - * Converts UTF-8 string to ASCII, ie removes diacritics etc. - */ - public static function toAscii(string $s): string - { - $iconv = defined('ICONV_IMPL') ? trim(ICONV_IMPL, '"\'') : null; - static $transliterator = null; - if ($transliterator === null) { - if (class_exists('Transliterator', false)) { - $transliterator = \Transliterator::create('Any-Latin; Latin-ASCII'); - } else { - trigger_error(__METHOD__ . "(): it is recommended to enable PHP extensions 'intl'.", E_USER_NOTICE); - $transliterator = false; - } - } - - // remove control characters and check UTF-8 validity - $s = self::pcre('preg_replace', ['#[^\x09\x0A\x0D\x20-\x7E\xA0-\x{2FF}\x{370}-\x{10FFFF}]#u', '', $s]); - - // transliteration (by Transliterator and iconv) is not optimal, replace some characters directly - $s = strtr($s, ["\u{201E}" => '"', "\u{201C}" => '"', "\u{201D}" => '"', "\u{201A}" => "'", "\u{2018}" => "'", "\u{2019}" => "'", "\u{B0}" => '^', "\u{42F}" => 'Ya', "\u{44F}" => 'ya', "\u{42E}" => 'Yu', "\u{44E}" => 'yu', "\u{c4}" => 'Ae', "\u{d6}" => 'Oe', "\u{dc}" => 'Ue', "\u{1e9e}" => 'Ss', "\u{e4}" => 'ae', "\u{f6}" => 'oe', "\u{fc}" => 'ue', "\u{df}" => 'ss']); // „ “ ” ‚ ‘ ’ ° Я я Ю ю Ä Ö Ü ẞ ä ö ü ß - if ($iconv !== 'libiconv') { - $s = strtr($s, ["\u{AE}" => '(R)', "\u{A9}" => '(c)', "\u{2026}" => '...', "\u{AB}" => '<<', "\u{BB}" => '>>', "\u{A3}" => 'lb', "\u{A5}" => 'yen', "\u{B2}" => '^2', "\u{B3}" => '^3', "\u{B5}" => 'u', "\u{B9}" => '^1', "\u{BA}" => 'o', "\u{BF}" => '?', "\u{2CA}" => "'", "\u{2CD}" => '_', "\u{2DD}" => '"', "\u{1FEF}" => '', "\u{20AC}" => 'EUR', "\u{2122}" => 'TM', "\u{212E}" => 'e', "\u{2190}" => '<-', "\u{2191}" => '^', "\u{2192}" => '->', "\u{2193}" => 'V', "\u{2194}" => '<->']); // ® © … « » £ ¥ ² ³ µ ¹ º ¿ ˊ ˍ ˝ ` € ™ ℮ ← ↑ → ↓ ↔ - } - - if ($transliterator) { - $s = $transliterator->transliterate($s); - // use iconv because The transliterator leaves some characters out of ASCII, eg → ʾ - if ($iconv === 'glibc') { - $s = strtr($s, '?', "\x01"); // temporarily hide ? to distinguish them from the garbage that iconv creates - $s = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $s); - $s = str_replace(['?', "\x01"], ['', '?'], $s); // remove garbage and restore ? characters - } elseif ($iconv === 'libiconv') { - $s = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $s); - } else { // null or 'unknown' (#216) - $s = self::pcre('preg_replace', ['#[^\x00-\x7F]++#', '', $s]); // remove non-ascii chars - } - } elseif ($iconv === 'glibc' || $iconv === 'libiconv') { - // temporarily hide these characters to distinguish them from the garbage that iconv creates - $s = strtr($s, '`\'"^~?', "\x01\x02\x03\x04\x05\x06"); - if ($iconv === 'glibc') { - // glibc implementation is very limited. transliterate into Windows-1250 and then into ASCII, so most Eastern European characters are preserved - $s = iconv('UTF-8', 'WINDOWS-1250//TRANSLIT//IGNORE', $s); - $s = strtr( - $s, - "\xa5\xa3\xbc\x8c\xa7\x8a\xaa\x8d\x8f\x8e\xaf\xb9\xb3\xbe\x9c\x9a\xba\x9d\x9f\x9e\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf8\xf9\xfa\xfb\xfc\xfd\xfe\x96\xa0\x8b\x97\x9b\xa6\xad\xb7", - 'ALLSSSSTZZZallssstzzzRAAAALCCCEEEEIIDDNNOOOOxRUUUUYTsraaaalccceeeeiiddnnooooruuuuyt- <->|-.' - ); - $s = self::pcre('preg_replace', ['#[^\x00-\x7F]++#', '', $s]); - } else { - $s = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $s); - } - // remove garbage that iconv creates during transliteration (eg Ý -> Y') - $s = str_replace(['`', "'", '"', '^', '~', '?'], '', $s); - // restore temporarily hidden characters - $s = strtr($s, "\x01\x02\x03\x04\x05\x06", '`\'"^~?'); - } else { - $s = self::pcre('preg_replace', ['#[^\x00-\x7F]++#', '', $s]); // remove non-ascii chars - } - - return $s; - } - - - /** - * Modifies the UTF-8 string to the form used in the URL, ie removes diacritics and replaces all characters - * except letters of the English alphabet and numbers with a hyphens. - */ - public static function webalize(string $s, string $charlist = null, bool $lower = true): string - { - $s = self::toAscii($s); - if ($lower) { - $s = strtolower($s); - } - $s = self::pcre('preg_replace', ['#[^a-z0-9' . ($charlist !== null ? preg_quote($charlist, '#') : '') . ']+#i', '-', $s]); - $s = trim($s, '-'); - return $s; - } - - - /** - * Truncates a UTF-8 string to given maximal length, while trying not to split whole words. Only if the string is truncated, - * an ellipsis (or something else set with third argument) is appended to the string. - */ - public static function truncate(string $s, int $maxLen, string $append = "\u{2026}"): string - { - if (self::length($s) > $maxLen) { - $maxLen -= self::length($append); - if ($maxLen < 1) { - return $append; - - } elseif ($matches = self::match($s, '#^.{1,' . $maxLen . '}(?=[\s\x00-/:-@\[-`{-~])#us')) { - return $matches[0] . $append; - - } else { - return self::substring($s, 0, $maxLen) . $append; - } - } - return $s; - } - - - /** - * Indents a multiline text from the left. Second argument sets how many indentation chars should be used, - * while the indent itself is the third argument (*tab* by default). - */ - public static function indent(string $s, int $level = 1, string $chars = "\t"): string - { - if ($level > 0) { - $s = self::replace($s, '#(?:^|[\r\n]+)(?=[^\r\n])#', '$0' . str_repeat($chars, $level)); - } - return $s; - } - - - /** - * Converts all characters of UTF-8 string to lower case. - */ - public static function lower(string $s): string - { - return mb_strtolower($s, 'UTF-8'); - } - - - /** - * Converts the first character of a UTF-8 string to lower case and leaves the other characters unchanged. - */ - public static function firstLower(string $s): string - { - return self::lower(self::substring($s, 0, 1)) . self::substring($s, 1); - } - - - /** - * Converts all characters of a UTF-8 string to upper case. - */ - public static function upper(string $s): string - { - return mb_strtoupper($s, 'UTF-8'); - } - - - /** - * Converts the first character of a UTF-8 string to upper case and leaves the other characters unchanged. - */ - public static function firstUpper(string $s): string - { - return self::upper(self::substring($s, 0, 1)) . self::substring($s, 1); - } - - - /** - * Converts the first character of every word of a UTF-8 string to upper case and the others to lower case. - */ - public static function capitalize(string $s): string - { - return mb_convert_case($s, MB_CASE_TITLE, 'UTF-8'); - } - - - /** - * Compares two UTF-8 strings or their parts, without taking character case into account. If length is null, whole strings are compared, - * if it is negative, the corresponding number of characters from the end of the strings is compared, - * otherwise the appropriate number of characters from the beginning is compared. - */ - public static function compare(string $left, string $right, int $length = null): bool - { - if (class_exists('Normalizer', false)) { - $left = \Normalizer::normalize($left, \Normalizer::FORM_D); // form NFD is faster - $right = \Normalizer::normalize($right, \Normalizer::FORM_D); // form NFD is faster - } - - if ($length < 0) { - $left = self::substring($left, $length, -$length); - $right = self::substring($right, $length, -$length); - } elseif ($length !== null) { - $left = self::substring($left, 0, $length); - $right = self::substring($right, 0, $length); - } - return self::lower($left) === self::lower($right); - } - - - /** - * Finds the common prefix of strings or returns empty string if the prefix was not found. - * @param string[] $strings - */ - public static function findPrefix(array $strings): string - { - $first = array_shift($strings); - for ($i = 0; $i < strlen($first); $i++) { - foreach ($strings as $s) { - if (!isset($s[$i]) || $first[$i] !== $s[$i]) { - while ($i && $first[$i - 1] >= "\x80" && $first[$i] >= "\x80" && $first[$i] < "\xC0") { - $i--; - } - return substr($first, 0, $i); - } - } - } - return $first; - } - - - /** - * Returns number of characters (not bytes) in UTF-8 string. - * That is the number of Unicode code points which may differ from the number of graphemes. - */ - public static function length(string $s): int - { - return function_exists('mb_strlen') - ? mb_strlen($s, 'UTF-8') - : strlen(utf8_decode($s)); - } - - - /** - * Removes all left and right side spaces (or the characters passed as second argument) from a UTF-8 encoded string. - */ - public static function trim(string $s, string $charlist = self::TRIM_CHARACTERS): string - { - $charlist = preg_quote($charlist, '#'); - return self::replace($s, '#^[' . $charlist . ']+|[' . $charlist . ']+$#Du', ''); - } - - - /** - * Pads a UTF-8 string to given length by prepending the $pad string to the beginning. - */ - public static function padLeft(string $s, int $length, string $pad = ' '): string - { - $length = max(0, $length - self::length($s)); - $padLen = self::length($pad); - return str_repeat($pad, (int) ($length / $padLen)) . self::substring($pad, 0, $length % $padLen) . $s; - } - - - /** - * Pads UTF-8 string to given length by appending the $pad string to the end. - */ - public static function padRight(string $s, int $length, string $pad = ' '): string - { - $length = max(0, $length - self::length($s)); - $padLen = self::length($pad); - return $s . str_repeat($pad, (int) ($length / $padLen)) . self::substring($pad, 0, $length % $padLen); - } - - - /** - * Reverses UTF-8 string. - */ - public static function reverse(string $s): string - { - if (!extension_loaded('iconv')) { - throw new Nette\NotSupportedException(__METHOD__ . '() requires ICONV extension that is not loaded.'); - } - return iconv('UTF-32LE', 'UTF-8', strrev(iconv('UTF-8', 'UTF-32BE', $s))); - } - - - /** - * Returns part of $haystack before $nth occurence of $needle or returns null if the needle was not found. - * Negative value means searching from the end. - */ - public static function before(string $haystack, string $needle, int $nth = 1): ?string - { - $pos = self::pos($haystack, $needle, $nth); - return $pos === null - ? null - : substr($haystack, 0, $pos); - } - - - /** - * Returns part of $haystack after $nth occurence of $needle or returns null if the needle was not found. - * Negative value means searching from the end. - */ - public static function after(string $haystack, string $needle, int $nth = 1): ?string - { - $pos = self::pos($haystack, $needle, $nth); - return $pos === null - ? null - : substr($haystack, $pos + strlen($needle)); - } - - - /** - * Returns position in characters of $nth occurence of $needle in $haystack or null if the $needle was not found. - * Negative value of `$nth` means searching from the end. - */ - public static function indexOf(string $haystack, string $needle, int $nth = 1): ?int - { - $pos = self::pos($haystack, $needle, $nth); - return $pos === null - ? null - : self::length(substr($haystack, 0, $pos)); - } - - - /** - * Returns position in characters of $nth occurence of $needle in $haystack or null if the needle was not found. - */ - private static function pos(string $haystack, string $needle, int $nth = 1): ?int - { - if (!$nth) { - return null; - } elseif ($nth > 0) { - if ($needle === '') { - return 0; - } - $pos = 0; - while (($pos = strpos($haystack, $needle, $pos)) !== false && --$nth) { - $pos++; - } - } else { - $len = strlen($haystack); - if ($needle === '') { - return $len; - } elseif ($len === 0) { - return null; - } - $pos = $len - 1; - while (($pos = strrpos($haystack, $needle, $pos - $len)) !== false && ++$nth) { - $pos--; - } - } - return Helpers::falseToNull($pos); - } - - - /** - * Splits a string into array by the regular expression. Parenthesized expression in the delimiter are captured. - * Parameter $flags can be any combination of PREG_SPLIT_NO_EMPTY and PREG_OFFSET_CAPTURE flags. - */ - public static function split(string $subject, string $pattern, int $flags = 0): array - { - return self::pcre('preg_split', [$pattern, $subject, -1, $flags | PREG_SPLIT_DELIM_CAPTURE]); - } - - - /** - * Checks if given string matches a regular expression pattern and returns an array with first found match and each subpattern. - * Parameter $flags can be any combination of PREG_OFFSET_CAPTURE and PREG_UNMATCHED_AS_NULL flags. - */ - public static function match(string $subject, string $pattern, int $flags = 0, int $offset = 0): ?array - { - if ($offset > strlen($subject)) { - return null; - } - return self::pcre('preg_match', [$pattern, $subject, &$m, $flags, $offset]) - ? $m - : null; - } - - - /** - * Finds all occurrences matching regular expression pattern and returns a two-dimensional array. Result is array of matches (ie uses by default PREG_SET_ORDER). - * Parameter $flags can be any combination of PREG_OFFSET_CAPTURE, PREG_UNMATCHED_AS_NULL and PREG_PATTERN_ORDER flags. - */ - public static function matchAll(string $subject, string $pattern, int $flags = 0, int $offset = 0): array - { - if ($offset > strlen($subject)) { - return []; - } - self::pcre('preg_match_all', [ - $pattern, $subject, &$m, - ($flags & PREG_PATTERN_ORDER) ? $flags : ($flags | PREG_SET_ORDER), - $offset, - ]); - return $m; - } - - - /** - * Replaces all occurrences matching regular expression $pattern which can be string or array in the form `pattern => replacement`. - * @param string|array $pattern - * @param string|callable $replacement - */ - public static function replace(string $subject, $pattern, $replacement = '', int $limit = -1): string - { - if (is_object($replacement) || is_array($replacement)) { - if (!is_callable($replacement, false, $textual)) { - throw new Nette\InvalidStateException("Callback '$textual' is not callable."); - } - return self::pcre('preg_replace_callback', [$pattern, $replacement, $subject, $limit]); - - } elseif (is_array($pattern) && is_string(key($pattern))) { - $replacement = array_values($pattern); - $pattern = array_keys($pattern); - } - - return self::pcre('preg_replace', [$pattern, $replacement, $subject, $limit]); - } - - - /** @internal */ - public static function pcre(string $func, array $args) - { - $res = Callback::invokeSafe($func, $args, function (string $message) use ($args): void { - // compile-time error, not detectable by preg_last_error - throw new RegexpException($message . ' in pattern: ' . implode(' or ', (array) $args[0])); - }); - - if (($code = preg_last_error()) // run-time error, but preg_last_error & return code are liars - && ($res === null || !in_array($func, ['preg_filter', 'preg_replace_callback', 'preg_replace'], true)) - ) { - throw new RegexpException((RegexpException::MESSAGES[$code] ?? 'Unknown error') - . ' (pattern: ' . implode(' or ', (array) $args[0]) . ')', $code); - } - return $res; - } -} diff --git a/vendor/nette/utils/src/Utils/Type.php b/vendor/nette/utils/src/Utils/Type.php deleted file mode 100644 index 257cc29..0000000 --- a/vendor/nette/utils/src/Utils/Type.php +++ /dev/null @@ -1,249 +0,0 @@ -getReturnType() ?? (PHP_VERSION_ID >= 80100 ? $reflection->getTentativeReturnType() : null); - } else { - $type = $reflection instanceof \ReflectionFunctionAbstract - ? $reflection->getReturnType() - : $reflection->getType(); - } - - if ($type === null) { - return null; - - } elseif ($type instanceof \ReflectionNamedType) { - $name = self::resolve($type->getName(), $reflection); - return new self($type->allowsNull() && $type->getName() !== 'mixed' ? [$name, 'null'] : [$name]); - - } elseif ($type instanceof \ReflectionUnionType || $type instanceof \ReflectionIntersectionType) { - return new self( - array_map( - function ($t) use ($reflection) { return self::resolve($t->getName(), $reflection); }, - $type->getTypes() - ), - $type instanceof \ReflectionUnionType ? '|' : '&' - ); - - } else { - throw new Nette\InvalidStateException('Unexpected type of ' . Reflection::toString($reflection)); - } - } - - - /** - * Creates the Type object according to the text notation. - */ - public static function fromString(string $type): self - { - if (!preg_match('#(?: - \?([\w\\\\]+)| - [\w\\\\]+ (?: (&[\w\\\\]+)* | (\|[\w\\\\]+)* ) - )()$#xAD', $type, $m)) { - throw new Nette\InvalidArgumentException("Invalid type '$type'."); - } - [, $nType, $iType] = $m; - if ($nType) { - return new self([$nType, 'null']); - } elseif ($iType) { - return new self(explode('&', $type), '&'); - } else { - return new self(explode('|', $type)); - } - } - - - /** - * Resolves 'self', 'static' and 'parent' to the actual class name. - * @param \ReflectionFunctionAbstract|\ReflectionParameter|\ReflectionProperty $reflection - */ - public static function resolve(string $type, $reflection): string - { - $lower = strtolower($type); - if ($reflection instanceof \ReflectionFunction) { - return $type; - } elseif ($lower === 'self' || $lower === 'static') { - return $reflection->getDeclaringClass()->name; - } elseif ($lower === 'parent' && $reflection->getDeclaringClass()->getParentClass()) { - return $reflection->getDeclaringClass()->getParentClass()->name; - } else { - return $type; - } - } - - - private function __construct(array $types, string $kind = '|') - { - if ($types[0] === 'null') { // null as last - array_push($types, array_shift($types)); - } - $this->types = $types; - $this->single = ($types[1] ?? 'null') === 'null'; - $this->kind = count($types) > 1 ? $kind : ''; - } - - - public function __toString(): string - { - return $this->single - ? (count($this->types) > 1 ? '?' : '') . $this->types[0] - : implode($this->kind, $this->types); - } - - - /** - * Returns the array of subtypes that make up the compound type as strings. - * @return string[] - */ - public function getNames(): array - { - return $this->types; - } - - - /** - * Returns the array of subtypes that make up the compound type as Type objects: - * @return self[] - */ - public function getTypes(): array - { - return array_map(function ($name) { return self::fromString($name); }, $this->types); - } - - - /** - * Returns the type name for single types, otherwise null. - */ - public function getSingleName(): ?string - { - return $this->single - ? $this->types[0] - : null; - } - - - /** - * Returns true whether it is a union type. - */ - public function isUnion(): bool - { - return $this->kind === '|'; - } - - - /** - * Returns true whether it is an intersection type. - */ - public function isIntersection(): bool - { - return $this->kind === '&'; - } - - - /** - * Returns true whether it is a single type. Simple nullable types are also considered to be single types. - */ - public function isSingle(): bool - { - return $this->single; - } - - - /** - * Returns true whether the type is both a single and a PHP built-in type. - */ - public function isBuiltin(): bool - { - return $this->single && Reflection::isBuiltinType($this->types[0]); - } - - - /** - * Returns true whether the type is both a single and a class name. - */ - public function isClass(): bool - { - return $this->single && !Reflection::isBuiltinType($this->types[0]); - } - - - /** - * Determines if type is special class name self/parent/static. - */ - public function isClassKeyword(): bool - { - return $this->single && Reflection::isClassKeyword($this->types[0]); - } - - - /** - * Verifies type compatibility. For example, it checks if a value of a certain type could be passed as a parameter. - */ - public function allows(string $type): bool - { - if ($this->types === ['mixed']) { - return true; - } - - $type = self::fromString($type); - - if ($this->isIntersection()) { - if (!$type->isIntersection()) { - return false; - } - return Arrays::every($this->types, function ($currentType) use ($type) { - $builtin = Reflection::isBuiltinType($currentType); - return Arrays::some($type->types, function ($testedType) use ($currentType, $builtin) { - return $builtin - ? strcasecmp($currentType, $testedType) === 0 - : is_a($testedType, $currentType, true); - }); - }); - } - - $method = $type->isIntersection() ? 'some' : 'every'; - return Arrays::$method($type->types, function ($testedType) { - $builtin = Reflection::isBuiltinType($testedType); - return Arrays::some($this->types, function ($currentType) use ($testedType, $builtin) { - return $builtin - ? strcasecmp($currentType, $testedType) === 0 - : is_a($testedType, $currentType, true); - }); - }); - } -} diff --git a/vendor/nette/utils/src/Utils/Validators.php b/vendor/nette/utils/src/Utils/Validators.php deleted file mode 100644 index 60e0eaa..0000000 --- a/vendor/nette/utils/src/Utils/Validators.php +++ /dev/null @@ -1,373 +0,0 @@ - */ - protected static $validators = [ - // PHP types - 'array' => 'is_array', - 'bool' => 'is_bool', - 'boolean' => 'is_bool', - 'float' => 'is_float', - 'int' => 'is_int', - 'integer' => 'is_int', - 'null' => 'is_null', - 'object' => 'is_object', - 'resource' => 'is_resource', - 'scalar' => 'is_scalar', - 'string' => 'is_string', - - // pseudo-types - 'callable' => [self::class, 'isCallable'], - 'iterable' => 'is_iterable', - 'list' => [Arrays::class, 'isList'], - 'mixed' => [self::class, 'isMixed'], - 'none' => [self::class, 'isNone'], - 'number' => [self::class, 'isNumber'], - 'numeric' => [self::class, 'isNumeric'], - 'numericint' => [self::class, 'isNumericInt'], - - // string patterns - 'alnum' => 'ctype_alnum', - 'alpha' => 'ctype_alpha', - 'digit' => 'ctype_digit', - 'lower' => 'ctype_lower', - 'pattern' => null, - 'space' => 'ctype_space', - 'unicode' => [self::class, 'isUnicode'], - 'upper' => 'ctype_upper', - 'xdigit' => 'ctype_xdigit', - - // syntax validation - 'email' => [self::class, 'isEmail'], - 'identifier' => [self::class, 'isPhpIdentifier'], - 'uri' => [self::class, 'isUri'], - 'url' => [self::class, 'isUrl'], - - // environment validation - 'class' => 'class_exists', - 'interface' => 'interface_exists', - 'directory' => 'is_dir', - 'file' => 'is_file', - 'type' => [self::class, 'isType'], - ]; - - /** @var array */ - protected static $counters = [ - 'string' => 'strlen', - 'unicode' => [Strings::class, 'length'], - 'array' => 'count', - 'list' => 'count', - 'alnum' => 'strlen', - 'alpha' => 'strlen', - 'digit' => 'strlen', - 'lower' => 'strlen', - 'space' => 'strlen', - 'upper' => 'strlen', - 'xdigit' => 'strlen', - ]; - - - /** - * Verifies that the value is of expected types separated by pipe. - * @param mixed $value - * @throws AssertionException - */ - public static function assert($value, string $expected, string $label = 'variable'): void - { - if (!static::is($value, $expected)) { - $expected = str_replace(['|', ':'], [' or ', ' in range '], $expected); - static $translate = ['boolean' => 'bool', 'integer' => 'int', 'double' => 'float', 'NULL' => 'null']; - $type = $translate[gettype($value)] ?? gettype($value); - if (is_int($value) || is_float($value) || (is_string($value) && strlen($value) < 40)) { - $type .= ' ' . var_export($value, true); - } elseif (is_object($value)) { - $type .= ' ' . get_class($value); - } - throw new AssertionException("The $label expects to be $expected, $type given."); - } - } - - - /** - * Verifies that element $key in array is of expected types separated by pipe. - * @param mixed[] $array - * @param int|string $key - * @throws AssertionException - */ - public static function assertField( - array $array, - $key, - string $expected = null, - string $label = "item '%' in array" - ): void { - if (!array_key_exists($key, $array)) { - throw new AssertionException('Missing ' . str_replace('%', $key, $label) . '.'); - - } elseif ($expected) { - static::assert($array[$key], $expected, str_replace('%', $key, $label)); - } - } - - - /** - * Verifies that the value is of expected types separated by pipe. - * @param mixed $value - */ - public static function is($value, string $expected): bool - { - foreach (explode('|', $expected) as $item) { - if (substr($item, -2) === '[]') { - if (is_iterable($value) && self::everyIs($value, substr($item, 0, -2))) { - return true; - } - continue; - } elseif (substr($item, 0, 1) === '?') { - $item = substr($item, 1); - if ($value === null) { - return true; - } - } - - [$type] = $item = explode(':', $item, 2); - if (isset(static::$validators[$type])) { - try { - if (!static::$validators[$type]($value)) { - continue; - } - } catch (\TypeError $e) { - continue; - } - } elseif ($type === 'pattern') { - if (Strings::match($value, '|^' . ($item[1] ?? '') . '$|D')) { - return true; - } - continue; - } elseif (!$value instanceof $type) { - continue; - } - - if (isset($item[1])) { - $length = $value; - if (isset(static::$counters[$type])) { - $length = static::$counters[$type]($value); - } - $range = explode('..', $item[1]); - if (!isset($range[1])) { - $range[1] = $range[0]; - } - if (($range[0] !== '' && $length < $range[0]) || ($range[1] !== '' && $length > $range[1])) { - continue; - } - } - return true; - } - return false; - } - - - /** - * Finds whether all values are of expected types separated by pipe. - * @param mixed[] $values - */ - public static function everyIs(iterable $values, string $expected): bool - { - foreach ($values as $value) { - if (!static::is($value, $expected)) { - return false; - } - } - return true; - } - - - /** - * Checks if the value is an integer or a float. - * @param mixed $value - */ - public static function isNumber($value): bool - { - return is_int($value) || is_float($value); - } - - - /** - * Checks if the value is an integer or a integer written in a string. - * @param mixed $value - */ - public static function isNumericInt($value): bool - { - return is_int($value) || (is_string($value) && preg_match('#^[+-]?[0-9]+$#D', $value)); - } - - - /** - * Checks if the value is a number or a number written in a string. - * @param mixed $value - */ - public static function isNumeric($value): bool - { - return is_float($value) || is_int($value) || (is_string($value) && preg_match('#^[+-]?[0-9]*[.]?[0-9]+$#D', $value)); - } - - - /** - * Checks if the value is a syntactically correct callback. - * @param mixed $value - */ - public static function isCallable($value): bool - { - return $value && is_callable($value, true); - } - - - /** - * Checks if the value is a valid UTF-8 string. - * @param mixed $value - */ - public static function isUnicode($value): bool - { - return is_string($value) && preg_match('##u', $value); - } - - - /** - * Checks if the value is 0, '', false or null. - * @param mixed $value - */ - public static function isNone($value): bool - { - return $value == null; // intentionally == - } - - - /** @internal */ - public static function isMixed(): bool - { - return true; - } - - - /** - * Checks if a variable is a zero-based integer indexed array. - * @param mixed $value - * @deprecated use Nette\Utils\Arrays::isList - */ - public static function isList($value): bool - { - return Arrays::isList($value); - } - - - /** - * Checks if the value is in the given range [min, max], where the upper or lower limit can be omitted (null). - * Numbers, strings and DateTime objects can be compared. - * @param mixed $value - */ - public static function isInRange($value, array $range): bool - { - if ($value === null || !(isset($range[0]) || isset($range[1]))) { - return false; - } - $limit = $range[0] ?? $range[1]; - if (is_string($limit)) { - $value = (string) $value; - } elseif ($limit instanceof \DateTimeInterface) { - if (!$value instanceof \DateTimeInterface) { - return false; - } - } elseif (is_numeric($value)) { - $value *= 1; - } else { - return false; - } - return (!isset($range[0]) || ($value >= $range[0])) && (!isset($range[1]) || ($value <= $range[1])); - } - - - /** - * Checks if the value is a valid email address. It does not verify that the domain actually exists, only the syntax is verified. - */ - public static function isEmail(string $value): bool - { - $atom = "[-a-z0-9!#$%&'*+/=?^_`{|}~]"; // RFC 5322 unquoted characters in local-part - $alpha = "a-z\x80-\xFF"; // superset of IDN - return (bool) preg_match(<< 'Internal error', - PREG_BACKTRACK_LIMIT_ERROR => 'Backtrack limit was exhausted', - PREG_RECURSION_LIMIT_ERROR => 'Recursion limit was exhausted', - PREG_BAD_UTF8_ERROR => 'Malformed UTF-8 data', - PREG_BAD_UTF8_OFFSET_ERROR => 'Offset didn\'t correspond to the begin of a valid UTF-8 code point', - 6 => 'Failed due to limited JIT stack space', // PREG_JIT_STACKLIMIT_ERROR - ]; -} - - -/** - * The exception that indicates assertion error. - */ -class AssertionException extends \Exception -{ -} diff --git a/vendor/nette/utils/src/compatibility.php b/vendor/nette/utils/src/compatibility.php deleted file mode 100644 index 9df5480..0000000 --- a/vendor/nette/utils/src/compatibility.php +++ /dev/null @@ -1,32 +0,0 @@ -= 7.0; for parsing PHP 5.2 to PHP 8.0). - -[Documentation for version 3.x][doc_3_x] (unsupported; for running on PHP >= 5.5; for parsing PHP 5.2 to PHP 7.2). - -Features --------- - -The main features provided by this library are: - - * Parsing PHP 5, PHP 7, and PHP 8 code into an abstract syntax tree (AST). - * Invalid code can be parsed into a partial AST. - * The AST contains accurate location information. - * Dumping the AST in human-readable form. - * Converting an AST back to PHP code. - * Experimental: Formatting can be preserved for partially changed ASTs. - * Infrastructure to traverse and modify ASTs. - * Resolution of namespaced names. - * Evaluation of constant expressions. - * Builders to simplify AST construction for code generation. - * Converting an AST into JSON and back. - -Quick Start ------------ - -Install the library using [composer](https://getcomposer.org): - - php composer.phar require nikic/php-parser - -Parse some PHP code into an AST and dump the result in human-readable form: - -```php -create(ParserFactory::PREFER_PHP7); -try { - $ast = $parser->parse($code); -} catch (Error $error) { - echo "Parse error: {$error->getMessage()}\n"; - return; -} - -$dumper = new NodeDumper; -echo $dumper->dump($ast) . "\n"; -``` - -This dumps an AST looking something like this: - -``` -array( - 0: Stmt_Function( - byRef: false - name: Identifier( - name: test - ) - params: array( - 0: Param( - type: null - byRef: false - variadic: false - var: Expr_Variable( - name: foo - ) - default: null - ) - ) - returnType: null - stmts: array( - 0: Stmt_Expression( - expr: Expr_FuncCall( - name: Name( - parts: array( - 0: var_dump - ) - ) - args: array( - 0: Arg( - value: Expr_Variable( - name: foo - ) - byRef: false - unpack: false - ) - ) - ) - ) - ) - ) -) -``` - -Let's traverse the AST and perform some kind of modification. For example, drop all function bodies: - -```php -use PhpParser\Node; -use PhpParser\Node\Stmt\Function_; -use PhpParser\NodeTraverser; -use PhpParser\NodeVisitorAbstract; - -$traverser = new NodeTraverser(); -$traverser->addVisitor(new class extends NodeVisitorAbstract { - public function enterNode(Node $node) { - if ($node instanceof Function_) { - // Clean out the function body - $node->stmts = []; - } - } -}); - -$ast = $traverser->traverse($ast); -echo $dumper->dump($ast) . "\n"; -``` - -This gives us an AST where the `Function_::$stmts` are empty: - -``` -array( - 0: Stmt_Function( - byRef: false - name: Identifier( - name: test - ) - params: array( - 0: Param( - type: null - byRef: false - variadic: false - var: Expr_Variable( - name: foo - ) - default: null - ) - ) - returnType: null - stmts: array( - ) - ) -) -``` - -Finally, we can convert the new AST back to PHP code: - -```php -use PhpParser\PrettyPrinter; - -$prettyPrinter = new PrettyPrinter\Standard; -echo $prettyPrinter->prettyPrintFile($ast); -``` - -This gives us our original code, minus the `var_dump()` call inside the function: - -```php - [ - 'startLine', 'endLine', 'startFilePos', 'endFilePos', 'comments' -]]); -$parser = (new PhpParser\ParserFactory)->create( - PhpParser\ParserFactory::PREFER_PHP7, - $lexer -); -$dumper = new PhpParser\NodeDumper([ - 'dumpComments' => true, - 'dumpPositions' => $attributes['with-positions'], -]); -$prettyPrinter = new PhpParser\PrettyPrinter\Standard; - -$traverser = new PhpParser\NodeTraverser(); -$traverser->addVisitor(new PhpParser\NodeVisitor\NameResolver); - -foreach ($files as $file) { - if (strpos($file, ' Code $code\n"); - } else { - if (!file_exists($file)) { - fwrite(STDERR, "File $file does not exist.\n"); - exit(1); - } - - $code = file_get_contents($file); - fwrite(STDERR, "====> File $file:\n"); - } - - if ($attributes['with-recovery']) { - $errorHandler = new PhpParser\ErrorHandler\Collecting; - $stmts = $parser->parse($code, $errorHandler); - foreach ($errorHandler->getErrors() as $error) { - $message = formatErrorMessage($error, $code, $attributes['with-column-info']); - fwrite(STDERR, $message . "\n"); - } - if (null === $stmts) { - continue; - } - } else { - try { - $stmts = $parser->parse($code); - } catch (PhpParser\Error $error) { - $message = formatErrorMessage($error, $code, $attributes['with-column-info']); - fwrite(STDERR, $message . "\n"); - exit(1); - } - } - - foreach ($operations as $operation) { - if ('dump' === $operation) { - fwrite(STDERR, "==> Node dump:\n"); - echo $dumper->dump($stmts, $code), "\n"; - } elseif ('pretty-print' === $operation) { - fwrite(STDERR, "==> Pretty print:\n"); - echo $prettyPrinter->prettyPrintFile($stmts), "\n"; - } elseif ('json-dump' === $operation) { - fwrite(STDERR, "==> JSON dump:\n"); - echo json_encode($stmts, JSON_PRETTY_PRINT), "\n"; - } elseif ('var-dump' === $operation) { - fwrite(STDERR, "==> var_dump():\n"); - var_dump($stmts); - } elseif ('resolve-names' === $operation) { - fwrite(STDERR, "==> Resolved names.\n"); - $stmts = $traverser->traverse($stmts); - } - } -} - -function formatErrorMessage(PhpParser\Error $e, $code, $withColumnInfo) { - if ($withColumnInfo && $e->hasColumnInfo()) { - return $e->getMessageWithColumnInfo($code); - } else { - return $e->getMessage(); - } -} - -function showHelp($error = '') { - if ($error) { - fwrite(STDERR, $error . "\n\n"); - } - fwrite($error ? STDERR : STDOUT, << false, - 'with-positions' => false, - 'with-recovery' => false, - ]; - - array_shift($args); - $parseOptions = true; - foreach ($args as $arg) { - if (!$parseOptions) { - $files[] = $arg; - continue; - } - - switch ($arg) { - case '--dump': - case '-d': - $operations[] = 'dump'; - break; - case '--pretty-print': - case '-p': - $operations[] = 'pretty-print'; - break; - case '--json-dump': - case '-j': - $operations[] = 'json-dump'; - break; - case '--var-dump': - $operations[] = 'var-dump'; - break; - case '--resolve-names': - case '-N'; - $operations[] = 'resolve-names'; - break; - case '--with-column-info': - case '-c'; - $attributes['with-column-info'] = true; - break; - case '--with-positions': - case '-P': - $attributes['with-positions'] = true; - break; - case '--with-recovery': - case '-r': - $attributes['with-recovery'] = true; - break; - case '--help': - case '-h'; - showHelp(); - break; - case '--': - $parseOptions = false; - break; - default: - if ($arg[0] === '-') { - showHelp("Invalid operation $arg."); - } else { - $files[] = $arg; - } - } - } - - return [$operations, $files, $attributes]; -} diff --git a/vendor/nikic/php-parser/composer.json b/vendor/nikic/php-parser/composer.json deleted file mode 100644 index 2fd064a..0000000 --- a/vendor/nikic/php-parser/composer.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "nikic/php-parser", - "type": "library", - "description": "A PHP parser written in PHP", - "keywords": [ - "php", - "parser" - ], - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Nikita Popov" - } - ], - "require": { - "php": ">=7.0", - "ext-tokenizer": "*" - }, - "require-dev": { - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0", - "ircmaxell/php-yacc": "^0.0.7" - }, - "extra": { - "branch-alias": { - "dev-master": "4.9-dev" - } - }, - "autoload": { - "psr-4": { - "PhpParser\\": "lib/PhpParser" - } - }, - "autoload-dev": { - "psr-4": { - "PhpParser\\": "test/PhpParser/" - } - }, - "bin": [ - "bin/php-parse" - ] -} diff --git a/vendor/nikic/php-parser/grammar/README.md b/vendor/nikic/php-parser/grammar/README.md deleted file mode 100644 index 4bae11d..0000000 --- a/vendor/nikic/php-parser/grammar/README.md +++ /dev/null @@ -1,30 +0,0 @@ -What do all those files mean? -============================= - - * `php5.y`: PHP 5 grammar written in a pseudo language - * `php7.y`: PHP 7 grammar written in a pseudo language - * `tokens.y`: Tokens definition shared between PHP 5 and PHP 7 grammars - * `parser.template`: A `kmyacc` parser prototype file for PHP - * `tokens.template`: A `kmyacc` prototype file for the `Tokens` class - * `rebuildParsers.php`: Preprocesses the grammar and builds the parser using `kmyacc` - -.phpy pseudo language -===================== - -The `.y` file is a normal grammar in `kmyacc` (`yacc`) style, with some transformations -applied to it: - - * Nodes are created using the syntax `Name[..., ...]`. This is transformed into - `new Name(..., ..., attributes())` - * Some function-like constructs are resolved (see `rebuildParsers.php` for a list) - -Building the parser -=================== - -Run `php grammar/rebuildParsers.php` to rebuild the parsers. Additional options: - - * The `KMYACC` environment variable can be used to specify an alternative `kmyacc` binary. - By default the `phpyacc` dev dependency will be used. To use the original `kmyacc`, you - need to compile [moriyoshi's fork](https://github.com/moriyoshi/kmyacc-forked). - * The `--debug` option enables emission of debug symbols and creates the `y.output` file. - * The `--keep-tmp-grammar` option preserves the preprocessed grammar file. diff --git a/vendor/nikic/php-parser/grammar/parser.template b/vendor/nikic/php-parser/grammar/parser.template deleted file mode 100644 index 6166607..0000000 --- a/vendor/nikic/php-parser/grammar/parser.template +++ /dev/null @@ -1,106 +0,0 @@ -semValue -#semval($,%t) $this->semValue -#semval(%n) $stackPos-(%l-%n) -#semval(%n,%t) $stackPos-(%l-%n) - -namespace PhpParser\Parser; - -use PhpParser\Error; -use PhpParser\Node; -use PhpParser\Node\Expr; -use PhpParser\Node\Name; -use PhpParser\Node\Scalar; -use PhpParser\Node\Stmt; -#include; - -/* This is an automatically GENERATED file, which should not be manually edited. - * Instead edit one of the following: - * * the grammar files grammar/php5.y or grammar/php7.y - * * the skeleton file grammar/parser.template - * * the preprocessing script grammar/rebuildParsers.php - */ -class #(-p) extends \PhpParser\ParserAbstract -{ - protected $tokenToSymbolMapSize = #(YYMAXLEX); - protected $actionTableSize = #(YYLAST); - protected $gotoTableSize = #(YYGLAST); - - protected $invalidSymbol = #(YYBADCH); - protected $errorSymbol = #(YYINTERRTOK); - protected $defaultAction = #(YYDEFAULT); - protected $unexpectedTokenRule = #(YYUNEXPECTED); - - protected $YY2TBLSTATE = #(YY2TBLSTATE); - protected $numNonLeafStates = #(YYNLSTATES); - - protected $symbolToName = array( - #listvar terminals - ); - - protected $tokenToSymbol = array( - #listvar yytranslate - ); - - protected $action = array( - #listvar yyaction - ); - - protected $actionCheck = array( - #listvar yycheck - ); - - protected $actionBase = array( - #listvar yybase - ); - - protected $actionDefault = array( - #listvar yydefault - ); - - protected $goto = array( - #listvar yygoto - ); - - protected $gotoCheck = array( - #listvar yygcheck - ); - - protected $gotoBase = array( - #listvar yygbase - ); - - protected $gotoDefault = array( - #listvar yygdefault - ); - - protected $ruleToNonTerminal = array( - #listvar yylhs - ); - - protected $ruleToLength = array( - #listvar yylen - ); -#if -t - - protected $productions = array( - #production-strings; - ); -#endif - - protected function initReduceCallbacks() { - $this->reduceCallbacks = [ -#reduce - %n => function ($stackPos) { - %b - }, -#noact - %n => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, -#endreduce - ]; - } -} -#tailcode; diff --git a/vendor/nikic/php-parser/grammar/php5.y b/vendor/nikic/php-parser/grammar/php5.y deleted file mode 100644 index f9e7e7d..0000000 --- a/vendor/nikic/php-parser/grammar/php5.y +++ /dev/null @@ -1,1040 +0,0 @@ -%pure_parser -%expect 6 - -%tokens - -%% - -start: - top_statement_list { $$ = $this->handleNamespaces($1); } -; - -top_statement_list_ex: - top_statement_list_ex top_statement { pushNormalizing($1, $2); } - | /* empty */ { init(); } -; - -top_statement_list: - top_statement_list_ex - { makeZeroLengthNop($nop, $this->lookaheadStartAttributes); - if ($nop !== null) { $1[] = $nop; } $$ = $1; } -; - -ampersand: - T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG - | T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG -; - -reserved_non_modifiers: - T_INCLUDE | T_INCLUDE_ONCE | T_EVAL | T_REQUIRE | T_REQUIRE_ONCE | T_LOGICAL_OR | T_LOGICAL_XOR | T_LOGICAL_AND - | T_INSTANCEOF | T_NEW | T_CLONE | T_EXIT | T_IF | T_ELSEIF | T_ELSE | T_ENDIF | T_ECHO | T_DO | T_WHILE - | T_ENDWHILE | T_FOR | T_ENDFOR | T_FOREACH | T_ENDFOREACH | T_DECLARE | T_ENDDECLARE | T_AS | T_TRY | T_CATCH - | T_FINALLY | T_THROW | T_USE | T_INSTEADOF | T_GLOBAL | T_VAR | T_UNSET | T_ISSET | T_EMPTY | T_CONTINUE | T_GOTO - | T_FUNCTION | T_CONST | T_RETURN | T_PRINT | T_YIELD | T_LIST | T_SWITCH | T_ENDSWITCH | T_CASE | T_DEFAULT - | T_BREAK | T_ARRAY | T_CALLABLE | T_EXTENDS | T_IMPLEMENTS | T_NAMESPACE | T_TRAIT | T_INTERFACE | T_CLASS - | T_CLASS_C | T_TRAIT_C | T_FUNC_C | T_METHOD_C | T_LINE | T_FILE | T_DIR | T_NS_C | T_HALT_COMPILER | T_FN - | T_MATCH -; - -semi_reserved: - reserved_non_modifiers - | T_STATIC | T_ABSTRACT | T_FINAL | T_PRIVATE | T_PROTECTED | T_PUBLIC -; - -identifier_ex: - T_STRING { $$ = Node\Identifier[$1]; } - | semi_reserved { $$ = Node\Identifier[$1]; } -; - -identifier: - T_STRING { $$ = Node\Identifier[$1]; } -; - -reserved_non_modifiers_identifier: - reserved_non_modifiers { $$ = Node\Identifier[$1]; } -; - -namespace_name: - T_STRING { $$ = Name[$1]; } - | T_NAME_QUALIFIED { $$ = Name[$1]; } -; - -legacy_namespace_name: - namespace_name { $$ = $1; } - | T_NAME_FULLY_QUALIFIED { $$ = Name[substr($1, 1)]; } -; - -plain_variable: - T_VARIABLE { $$ = Expr\Variable[parseVar($1)]; } -; - -top_statement: - statement { $$ = $1; } - | function_declaration_statement { $$ = $1; } - | class_declaration_statement { $$ = $1; } - | T_HALT_COMPILER - { $$ = Stmt\HaltCompiler[$this->lexer->handleHaltCompiler()]; } - | T_NAMESPACE namespace_name ';' - { $$ = Stmt\Namespace_[$2, null]; - $$->setAttribute('kind', Stmt\Namespace_::KIND_SEMICOLON); - $this->checkNamespace($$); } - | T_NAMESPACE namespace_name '{' top_statement_list '}' - { $$ = Stmt\Namespace_[$2, $4]; - $$->setAttribute('kind', Stmt\Namespace_::KIND_BRACED); - $this->checkNamespace($$); } - | T_NAMESPACE '{' top_statement_list '}' - { $$ = Stmt\Namespace_[null, $3]; - $$->setAttribute('kind', Stmt\Namespace_::KIND_BRACED); - $this->checkNamespace($$); } - | T_USE use_declarations ';' { $$ = Stmt\Use_[$2, Stmt\Use_::TYPE_NORMAL]; } - | T_USE use_type use_declarations ';' { $$ = Stmt\Use_[$3, $2]; } - | group_use_declaration ';' { $$ = $1; } - | T_CONST constant_declaration_list ';' { $$ = Stmt\Const_[$2]; } -; - -use_type: - T_FUNCTION { $$ = Stmt\Use_::TYPE_FUNCTION; } - | T_CONST { $$ = Stmt\Use_::TYPE_CONSTANT; } -; - -group_use_declaration: - T_USE use_type legacy_namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations '}' - { $$ = Stmt\GroupUse[$3, $6, $2]; } - | T_USE legacy_namespace_name T_NS_SEPARATOR '{' inline_use_declarations '}' - { $$ = Stmt\GroupUse[$2, $5, Stmt\Use_::TYPE_UNKNOWN]; } -; - -unprefixed_use_declarations: - unprefixed_use_declarations ',' unprefixed_use_declaration - { push($1, $3); } - | unprefixed_use_declaration { init($1); } -; - -use_declarations: - use_declarations ',' use_declaration { push($1, $3); } - | use_declaration { init($1); } -; - -inline_use_declarations: - inline_use_declarations ',' inline_use_declaration { push($1, $3); } - | inline_use_declaration { init($1); } -; - -unprefixed_use_declaration: - namespace_name - { $$ = Stmt\UseUse[$1, null, Stmt\Use_::TYPE_UNKNOWN]; $this->checkUseUse($$, #1); } - | namespace_name T_AS identifier - { $$ = Stmt\UseUse[$1, $3, Stmt\Use_::TYPE_UNKNOWN]; $this->checkUseUse($$, #3); } -; - -use_declaration: - legacy_namespace_name - { $$ = Stmt\UseUse[$1, null, Stmt\Use_::TYPE_UNKNOWN]; $this->checkUseUse($$, #1); } - | legacy_namespace_name T_AS identifier - { $$ = Stmt\UseUse[$1, $3, Stmt\Use_::TYPE_UNKNOWN]; $this->checkUseUse($$, #3); } -; - -inline_use_declaration: - unprefixed_use_declaration { $$ = $1; $$->type = Stmt\Use_::TYPE_NORMAL; } - | use_type unprefixed_use_declaration { $$ = $2; $$->type = $1; } -; - -constant_declaration_list: - constant_declaration_list ',' constant_declaration { push($1, $3); } - | constant_declaration { init($1); } -; - -constant_declaration: - identifier '=' static_scalar { $$ = Node\Const_[$1, $3]; } -; - -class_const_list: - class_const_list ',' class_const { push($1, $3); } - | class_const { init($1); } -; - -class_const: - identifier_ex '=' static_scalar { $$ = Node\Const_[$1, $3]; } -; - -inner_statement_list_ex: - inner_statement_list_ex inner_statement { pushNormalizing($1, $2); } - | /* empty */ { init(); } -; - -inner_statement_list: - inner_statement_list_ex - { makeZeroLengthNop($nop, $this->lookaheadStartAttributes); - if ($nop !== null) { $1[] = $nop; } $$ = $1; } -; - -inner_statement: - statement { $$ = $1; } - | function_declaration_statement { $$ = $1; } - | class_declaration_statement { $$ = $1; } - | T_HALT_COMPILER - { throw new Error('__HALT_COMPILER() can only be used from the outermost scope', attributes()); } -; - -non_empty_statement: - '{' inner_statement_list '}' - { - if ($2) { - $$ = $2; prependLeadingComments($$); - } else { - makeNop($$, $this->startAttributeStack[#1], $this->endAttributes); - if (null === $$) { $$ = array(); } - } - } - | T_IF parentheses_expr statement elseif_list else_single - { $$ = Stmt\If_[$2, ['stmts' => toArray($3), 'elseifs' => $4, 'else' => $5]]; } - | T_IF parentheses_expr ':' inner_statement_list new_elseif_list new_else_single T_ENDIF ';' - { $$ = Stmt\If_[$2, ['stmts' => $4, 'elseifs' => $5, 'else' => $6]]; } - | T_WHILE parentheses_expr while_statement { $$ = Stmt\While_[$2, $3]; } - | T_DO statement T_WHILE parentheses_expr ';' { $$ = Stmt\Do_ [$4, toArray($2)]; } - | T_FOR '(' for_expr ';' for_expr ';' for_expr ')' for_statement - { $$ = Stmt\For_[['init' => $3, 'cond' => $5, 'loop' => $7, 'stmts' => $9]]; } - | T_SWITCH parentheses_expr switch_case_list { $$ = Stmt\Switch_[$2, $3]; } - | T_BREAK ';' { $$ = Stmt\Break_[null]; } - | T_BREAK expr ';' { $$ = Stmt\Break_[$2]; } - | T_CONTINUE ';' { $$ = Stmt\Continue_[null]; } - | T_CONTINUE expr ';' { $$ = Stmt\Continue_[$2]; } - | T_RETURN ';' { $$ = Stmt\Return_[null]; } - | T_RETURN expr ';' { $$ = Stmt\Return_[$2]; } - | T_GLOBAL global_var_list ';' { $$ = Stmt\Global_[$2]; } - | T_STATIC static_var_list ';' { $$ = Stmt\Static_[$2]; } - | T_ECHO expr_list ';' { $$ = Stmt\Echo_[$2]; } - | T_INLINE_HTML { $$ = Stmt\InlineHTML[$1]; } - | yield_expr ';' { $$ = Stmt\Expression[$1]; } - | expr ';' { $$ = Stmt\Expression[$1]; } - | T_UNSET '(' variables_list ')' ';' { $$ = Stmt\Unset_[$3]; } - | T_FOREACH '(' expr T_AS foreach_variable ')' foreach_statement - { $$ = Stmt\Foreach_[$3, $5[0], ['keyVar' => null, 'byRef' => $5[1], 'stmts' => $7]]; } - | T_FOREACH '(' expr T_AS variable T_DOUBLE_ARROW foreach_variable ')' foreach_statement - { $$ = Stmt\Foreach_[$3, $7[0], ['keyVar' => $5, 'byRef' => $7[1], 'stmts' => $9]]; } - | T_DECLARE '(' declare_list ')' declare_statement { $$ = Stmt\Declare_[$3, $5]; } - | T_TRY '{' inner_statement_list '}' catches optional_finally - { $$ = Stmt\TryCatch[$3, $5, $6]; $this->checkTryCatch($$); } - | T_THROW expr ';' { $$ = Stmt\Throw_[$2]; } - | T_GOTO identifier ';' { $$ = Stmt\Goto_[$2]; } - | identifier ':' { $$ = Stmt\Label[$1]; } - | expr error { $$ = Stmt\Expression[$1]; } - | error { $$ = array(); /* means: no statement */ } -; - -statement: - non_empty_statement { $$ = $1; } - | ';' - { makeNop($$, $this->startAttributeStack[#1], $this->endAttributes); - if ($$ === null) $$ = array(); /* means: no statement */ } -; - -catches: - /* empty */ { init(); } - | catches catch { push($1, $2); } -; - -catch: - T_CATCH '(' name plain_variable ')' '{' inner_statement_list '}' - { $$ = Stmt\Catch_[array($3), $4, $7]; } -; - -optional_finally: - /* empty */ { $$ = null; } - | T_FINALLY '{' inner_statement_list '}' { $$ = Stmt\Finally_[$3]; } -; - -variables_list: - variable { init($1); } - | variables_list ',' variable { push($1, $3); } -; - -optional_ref: - /* empty */ { $$ = false; } - | ampersand { $$ = true; } -; - -optional_arg_ref: - /* empty */ { $$ = false; } - | T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG { $$ = true; } -; - -optional_ellipsis: - /* empty */ { $$ = false; } - | T_ELLIPSIS { $$ = true; } -; - -function_declaration_statement: - T_FUNCTION optional_ref identifier '(' parameter_list ')' optional_return_type '{' inner_statement_list '}' - { $$ = Stmt\Function_[$3, ['byRef' => $2, 'params' => $5, 'returnType' => $7, 'stmts' => $9]]; } -; - -class_declaration_statement: - class_entry_type identifier extends_from implements_list '{' class_statement_list '}' - { $$ = Stmt\Class_[$2, ['type' => $1, 'extends' => $3, 'implements' => $4, 'stmts' => $6]]; - $this->checkClass($$, #2); } - | T_INTERFACE identifier interface_extends_list '{' class_statement_list '}' - { $$ = Stmt\Interface_[$2, ['extends' => $3, 'stmts' => $5]]; - $this->checkInterface($$, #2); } - | T_TRAIT identifier '{' class_statement_list '}' - { $$ = Stmt\Trait_[$2, ['stmts' => $4]]; } -; - -class_entry_type: - T_CLASS { $$ = 0; } - | T_ABSTRACT T_CLASS { $$ = Stmt\Class_::MODIFIER_ABSTRACT; } - | T_FINAL T_CLASS { $$ = Stmt\Class_::MODIFIER_FINAL; } -; - -extends_from: - /* empty */ { $$ = null; } - | T_EXTENDS class_name { $$ = $2; } -; - -interface_extends_list: - /* empty */ { $$ = array(); } - | T_EXTENDS class_name_list { $$ = $2; } -; - -implements_list: - /* empty */ { $$ = array(); } - | T_IMPLEMENTS class_name_list { $$ = $2; } -; - -class_name_list: - class_name { init($1); } - | class_name_list ',' class_name { push($1, $3); } -; - -for_statement: - statement { $$ = toArray($1); } - | ':' inner_statement_list T_ENDFOR ';' { $$ = $2; } -; - -foreach_statement: - statement { $$ = toArray($1); } - | ':' inner_statement_list T_ENDFOREACH ';' { $$ = $2; } -; - -declare_statement: - non_empty_statement { $$ = toArray($1); } - | ';' { $$ = null; } - | ':' inner_statement_list T_ENDDECLARE ';' { $$ = $2; } -; - -declare_list: - declare_list_element { init($1); } - | declare_list ',' declare_list_element { push($1, $3); } -; - -declare_list_element: - identifier '=' static_scalar { $$ = Stmt\DeclareDeclare[$1, $3]; } -; - -switch_case_list: - '{' case_list '}' { $$ = $2; } - | '{' ';' case_list '}' { $$ = $3; } - | ':' case_list T_ENDSWITCH ';' { $$ = $2; } - | ':' ';' case_list T_ENDSWITCH ';' { $$ = $3; } -; - -case_list: - /* empty */ { init(); } - | case_list case { push($1, $2); } -; - -case: - T_CASE expr case_separator inner_statement_list_ex { $$ = Stmt\Case_[$2, $4]; } - | T_DEFAULT case_separator inner_statement_list_ex { $$ = Stmt\Case_[null, $3]; } -; - -case_separator: - ':' - | ';' -; - -while_statement: - statement { $$ = toArray($1); } - | ':' inner_statement_list T_ENDWHILE ';' { $$ = $2; } -; - -elseif_list: - /* empty */ { init(); } - | elseif_list elseif { push($1, $2); } -; - -elseif: - T_ELSEIF parentheses_expr statement { $$ = Stmt\ElseIf_[$2, toArray($3)]; } -; - -new_elseif_list: - /* empty */ { init(); } - | new_elseif_list new_elseif { push($1, $2); } -; - -new_elseif: - T_ELSEIF parentheses_expr ':' inner_statement_list { $$ = Stmt\ElseIf_[$2, $4]; } -; - -else_single: - /* empty */ { $$ = null; } - | T_ELSE statement { $$ = Stmt\Else_[toArray($2)]; } -; - -new_else_single: - /* empty */ { $$ = null; } - | T_ELSE ':' inner_statement_list { $$ = Stmt\Else_[$3]; } -; - -foreach_variable: - variable { $$ = array($1, false); } - | ampersand variable { $$ = array($2, true); } - | list_expr { $$ = array($1, false); } -; - -parameter_list: - non_empty_parameter_list { $$ = $1; } - | /* empty */ { $$ = array(); } -; - -non_empty_parameter_list: - parameter { init($1); } - | non_empty_parameter_list ',' parameter { push($1, $3); } -; - -parameter: - optional_param_type optional_arg_ref optional_ellipsis plain_variable - { $$ = Node\Param[$4, null, $1, $2, $3]; $this->checkParam($$); } - | optional_param_type optional_arg_ref optional_ellipsis plain_variable '=' static_scalar - { $$ = Node\Param[$4, $6, $1, $2, $3]; $this->checkParam($$); } -; - -type: - name { $$ = $1; } - | T_ARRAY { $$ = Node\Identifier['array']; } - | T_CALLABLE { $$ = Node\Identifier['callable']; } -; - -optional_param_type: - /* empty */ { $$ = null; } - | type { $$ = $1; } -; - -optional_return_type: - /* empty */ { $$ = null; } - | ':' type { $$ = $2; } -; - -argument_list: - '(' ')' { $$ = array(); } - | '(' non_empty_argument_list ')' { $$ = $2; } - | '(' yield_expr ')' { $$ = array(Node\Arg[$2, false, false]); } -; - -non_empty_argument_list: - argument { init($1); } - | non_empty_argument_list ',' argument { push($1, $3); } -; - -argument: - expr { $$ = Node\Arg[$1, false, false]; } - | ampersand variable { $$ = Node\Arg[$2, true, false]; } - | T_ELLIPSIS expr { $$ = Node\Arg[$2, false, true]; } -; - -global_var_list: - global_var_list ',' global_var { push($1, $3); } - | global_var { init($1); } -; - -global_var: - plain_variable { $$ = $1; } - | '$' variable { $$ = Expr\Variable[$2]; } - | '$' '{' expr '}' { $$ = Expr\Variable[$3]; } -; - -static_var_list: - static_var_list ',' static_var { push($1, $3); } - | static_var { init($1); } -; - -static_var: - plain_variable { $$ = Stmt\StaticVar[$1, null]; } - | plain_variable '=' static_scalar { $$ = Stmt\StaticVar[$1, $3]; } -; - -class_statement_list_ex: - class_statement_list_ex class_statement { if ($2 !== null) { push($1, $2); } } - | /* empty */ { init(); } -; - -class_statement_list: - class_statement_list_ex - { makeZeroLengthNop($nop, $this->lookaheadStartAttributes); - if ($nop !== null) { $1[] = $nop; } $$ = $1; } -; - -class_statement: - variable_modifiers property_declaration_list ';' - { $$ = Stmt\Property[$1, $2]; $this->checkProperty($$, #1); } - | T_CONST class_const_list ';' { $$ = Stmt\ClassConst[$2, 0]; } - | method_modifiers T_FUNCTION optional_ref identifier_ex '(' parameter_list ')' optional_return_type method_body - { $$ = Stmt\ClassMethod[$4, ['type' => $1, 'byRef' => $3, 'params' => $6, 'returnType' => $8, 'stmts' => $9]]; - $this->checkClassMethod($$, #1); } - | T_USE class_name_list trait_adaptations { $$ = Stmt\TraitUse[$2, $3]; } -; - -trait_adaptations: - ';' { $$ = array(); } - | '{' trait_adaptation_list '}' { $$ = $2; } -; - -trait_adaptation_list: - /* empty */ { init(); } - | trait_adaptation_list trait_adaptation { push($1, $2); } -; - -trait_adaptation: - trait_method_reference_fully_qualified T_INSTEADOF class_name_list ';' - { $$ = Stmt\TraitUseAdaptation\Precedence[$1[0], $1[1], $3]; } - | trait_method_reference T_AS member_modifier identifier_ex ';' - { $$ = Stmt\TraitUseAdaptation\Alias[$1[0], $1[1], $3, $4]; } - | trait_method_reference T_AS member_modifier ';' - { $$ = Stmt\TraitUseAdaptation\Alias[$1[0], $1[1], $3, null]; } - | trait_method_reference T_AS identifier ';' - { $$ = Stmt\TraitUseAdaptation\Alias[$1[0], $1[1], null, $3]; } - | trait_method_reference T_AS reserved_non_modifiers_identifier ';' - { $$ = Stmt\TraitUseAdaptation\Alias[$1[0], $1[1], null, $3]; } -; - -trait_method_reference_fully_qualified: - name T_PAAMAYIM_NEKUDOTAYIM identifier_ex { $$ = array($1, $3); } -; -trait_method_reference: - trait_method_reference_fully_qualified { $$ = $1; } - | identifier_ex { $$ = array(null, $1); } -; - -method_body: - ';' /* abstract method */ { $$ = null; } - | '{' inner_statement_list '}' { $$ = $2; } -; - -variable_modifiers: - non_empty_member_modifiers { $$ = $1; } - | T_VAR { $$ = 0; } -; - -method_modifiers: - /* empty */ { $$ = 0; } - | non_empty_member_modifiers { $$ = $1; } -; - -non_empty_member_modifiers: - member_modifier { $$ = $1; } - | non_empty_member_modifiers member_modifier { $this->checkModifier($1, $2, #2); $$ = $1 | $2; } -; - -member_modifier: - T_PUBLIC { $$ = Stmt\Class_::MODIFIER_PUBLIC; } - | T_PROTECTED { $$ = Stmt\Class_::MODIFIER_PROTECTED; } - | T_PRIVATE { $$ = Stmt\Class_::MODIFIER_PRIVATE; } - | T_STATIC { $$ = Stmt\Class_::MODIFIER_STATIC; } - | T_ABSTRACT { $$ = Stmt\Class_::MODIFIER_ABSTRACT; } - | T_FINAL { $$ = Stmt\Class_::MODIFIER_FINAL; } -; - -property_declaration_list: - property_declaration { init($1); } - | property_declaration_list ',' property_declaration { push($1, $3); } -; - -property_decl_name: - T_VARIABLE { $$ = Node\VarLikeIdentifier[parseVar($1)]; } -; - -property_declaration: - property_decl_name { $$ = Stmt\PropertyProperty[$1, null]; } - | property_decl_name '=' static_scalar { $$ = Stmt\PropertyProperty[$1, $3]; } -; - -expr_list: - expr_list ',' expr { push($1, $3); } - | expr { init($1); } -; - -for_expr: - /* empty */ { $$ = array(); } - | expr_list { $$ = $1; } -; - -expr: - variable { $$ = $1; } - | list_expr '=' expr { $$ = Expr\Assign[$1, $3]; } - | variable '=' expr { $$ = Expr\Assign[$1, $3]; } - | variable '=' ampersand variable { $$ = Expr\AssignRef[$1, $4]; } - | variable '=' ampersand new_expr { $$ = Expr\AssignRef[$1, $4]; } - | new_expr { $$ = $1; } - | T_CLONE expr { $$ = Expr\Clone_[$2]; } - | variable T_PLUS_EQUAL expr { $$ = Expr\AssignOp\Plus [$1, $3]; } - | variable T_MINUS_EQUAL expr { $$ = Expr\AssignOp\Minus [$1, $3]; } - | variable T_MUL_EQUAL expr { $$ = Expr\AssignOp\Mul [$1, $3]; } - | variable T_DIV_EQUAL expr { $$ = Expr\AssignOp\Div [$1, $3]; } - | variable T_CONCAT_EQUAL expr { $$ = Expr\AssignOp\Concat [$1, $3]; } - | variable T_MOD_EQUAL expr { $$ = Expr\AssignOp\Mod [$1, $3]; } - | variable T_AND_EQUAL expr { $$ = Expr\AssignOp\BitwiseAnd[$1, $3]; } - | variable T_OR_EQUAL expr { $$ = Expr\AssignOp\BitwiseOr [$1, $3]; } - | variable T_XOR_EQUAL expr { $$ = Expr\AssignOp\BitwiseXor[$1, $3]; } - | variable T_SL_EQUAL expr { $$ = Expr\AssignOp\ShiftLeft [$1, $3]; } - | variable T_SR_EQUAL expr { $$ = Expr\AssignOp\ShiftRight[$1, $3]; } - | variable T_POW_EQUAL expr { $$ = Expr\AssignOp\Pow [$1, $3]; } - | variable T_COALESCE_EQUAL expr { $$ = Expr\AssignOp\Coalesce [$1, $3]; } - | variable T_INC { $$ = Expr\PostInc[$1]; } - | T_INC variable { $$ = Expr\PreInc [$2]; } - | variable T_DEC { $$ = Expr\PostDec[$1]; } - | T_DEC variable { $$ = Expr\PreDec [$2]; } - | expr T_BOOLEAN_OR expr { $$ = Expr\BinaryOp\BooleanOr [$1, $3]; } - | expr T_BOOLEAN_AND expr { $$ = Expr\BinaryOp\BooleanAnd[$1, $3]; } - | expr T_LOGICAL_OR expr { $$ = Expr\BinaryOp\LogicalOr [$1, $3]; } - | expr T_LOGICAL_AND expr { $$ = Expr\BinaryOp\LogicalAnd[$1, $3]; } - | expr T_LOGICAL_XOR expr { $$ = Expr\BinaryOp\LogicalXor[$1, $3]; } - | expr '|' expr { $$ = Expr\BinaryOp\BitwiseOr [$1, $3]; } - | expr T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG expr { $$ = Expr\BinaryOp\BitwiseAnd[$1, $3]; } - | expr T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG expr { $$ = Expr\BinaryOp\BitwiseAnd[$1, $3]; } - | expr '^' expr { $$ = Expr\BinaryOp\BitwiseXor[$1, $3]; } - | expr '.' expr { $$ = Expr\BinaryOp\Concat [$1, $3]; } - | expr '+' expr { $$ = Expr\BinaryOp\Plus [$1, $3]; } - | expr '-' expr { $$ = Expr\BinaryOp\Minus [$1, $3]; } - | expr '*' expr { $$ = Expr\BinaryOp\Mul [$1, $3]; } - | expr '/' expr { $$ = Expr\BinaryOp\Div [$1, $3]; } - | expr '%' expr { $$ = Expr\BinaryOp\Mod [$1, $3]; } - | expr T_SL expr { $$ = Expr\BinaryOp\ShiftLeft [$1, $3]; } - | expr T_SR expr { $$ = Expr\BinaryOp\ShiftRight[$1, $3]; } - | expr T_POW expr { $$ = Expr\BinaryOp\Pow [$1, $3]; } - | '+' expr %prec T_INC { $$ = Expr\UnaryPlus [$2]; } - | '-' expr %prec T_INC { $$ = Expr\UnaryMinus[$2]; } - | '!' expr { $$ = Expr\BooleanNot[$2]; } - | '~' expr { $$ = Expr\BitwiseNot[$2]; } - | expr T_IS_IDENTICAL expr { $$ = Expr\BinaryOp\Identical [$1, $3]; } - | expr T_IS_NOT_IDENTICAL expr { $$ = Expr\BinaryOp\NotIdentical [$1, $3]; } - | expr T_IS_EQUAL expr { $$ = Expr\BinaryOp\Equal [$1, $3]; } - | expr T_IS_NOT_EQUAL expr { $$ = Expr\BinaryOp\NotEqual [$1, $3]; } - | expr T_SPACESHIP expr { $$ = Expr\BinaryOp\Spaceship [$1, $3]; } - | expr '<' expr { $$ = Expr\BinaryOp\Smaller [$1, $3]; } - | expr T_IS_SMALLER_OR_EQUAL expr { $$ = Expr\BinaryOp\SmallerOrEqual[$1, $3]; } - | expr '>' expr { $$ = Expr\BinaryOp\Greater [$1, $3]; } - | expr T_IS_GREATER_OR_EQUAL expr { $$ = Expr\BinaryOp\GreaterOrEqual[$1, $3]; } - | expr T_INSTANCEOF class_name_reference { $$ = Expr\Instanceof_[$1, $3]; } - | parentheses_expr { $$ = $1; } - /* we need a separate '(' new_expr ')' rule to avoid problems caused by a s/r conflict */ - | '(' new_expr ')' { $$ = $2; } - | expr '?' expr ':' expr { $$ = Expr\Ternary[$1, $3, $5]; } - | expr '?' ':' expr { $$ = Expr\Ternary[$1, null, $4]; } - | expr T_COALESCE expr { $$ = Expr\BinaryOp\Coalesce[$1, $3]; } - | T_ISSET '(' variables_list ')' { $$ = Expr\Isset_[$3]; } - | T_EMPTY '(' expr ')' { $$ = Expr\Empty_[$3]; } - | T_INCLUDE expr { $$ = Expr\Include_[$2, Expr\Include_::TYPE_INCLUDE]; } - | T_INCLUDE_ONCE expr { $$ = Expr\Include_[$2, Expr\Include_::TYPE_INCLUDE_ONCE]; } - | T_EVAL parentheses_expr { $$ = Expr\Eval_[$2]; } - | T_REQUIRE expr { $$ = Expr\Include_[$2, Expr\Include_::TYPE_REQUIRE]; } - | T_REQUIRE_ONCE expr { $$ = Expr\Include_[$2, Expr\Include_::TYPE_REQUIRE_ONCE]; } - | T_INT_CAST expr { $$ = Expr\Cast\Int_ [$2]; } - | T_DOUBLE_CAST expr - { $attrs = attributes(); - $attrs['kind'] = $this->getFloatCastKind($1); - $$ = new Expr\Cast\Double($2, $attrs); } - | T_STRING_CAST expr { $$ = Expr\Cast\String_ [$2]; } - | T_ARRAY_CAST expr { $$ = Expr\Cast\Array_ [$2]; } - | T_OBJECT_CAST expr { $$ = Expr\Cast\Object_ [$2]; } - | T_BOOL_CAST expr { $$ = Expr\Cast\Bool_ [$2]; } - | T_UNSET_CAST expr { $$ = Expr\Cast\Unset_ [$2]; } - | T_EXIT exit_expr - { $attrs = attributes(); - $attrs['kind'] = strtolower($1) === 'exit' ? Expr\Exit_::KIND_EXIT : Expr\Exit_::KIND_DIE; - $$ = new Expr\Exit_($2, $attrs); } - | '@' expr { $$ = Expr\ErrorSuppress[$2]; } - | scalar { $$ = $1; } - | array_expr { $$ = $1; } - | scalar_dereference { $$ = $1; } - | '`' backticks_expr '`' { $$ = Expr\ShellExec[$2]; } - | T_PRINT expr { $$ = Expr\Print_[$2]; } - | T_YIELD { $$ = Expr\Yield_[null, null]; } - | T_YIELD_FROM expr { $$ = Expr\YieldFrom[$2]; } - | T_FUNCTION optional_ref '(' parameter_list ')' lexical_vars optional_return_type - '{' inner_statement_list '}' - { $$ = Expr\Closure[['static' => false, 'byRef' => $2, 'params' => $4, 'uses' => $6, 'returnType' => $7, 'stmts' => $9]]; } - | T_STATIC T_FUNCTION optional_ref '(' parameter_list ')' lexical_vars optional_return_type - '{' inner_statement_list '}' - { $$ = Expr\Closure[['static' => true, 'byRef' => $3, 'params' => $5, 'uses' => $7, 'returnType' => $8, 'stmts' => $10]]; } -; - -parentheses_expr: - '(' expr ')' { $$ = $2; } - | '(' yield_expr ')' { $$ = $2; } -; - -yield_expr: - T_YIELD expr { $$ = Expr\Yield_[$2, null]; } - | T_YIELD expr T_DOUBLE_ARROW expr { $$ = Expr\Yield_[$4, $2]; } -; - -array_expr: - T_ARRAY '(' array_pair_list ')' - { $attrs = attributes(); $attrs['kind'] = Expr\Array_::KIND_LONG; - $$ = new Expr\Array_($3, $attrs); } - | '[' array_pair_list ']' - { $attrs = attributes(); $attrs['kind'] = Expr\Array_::KIND_SHORT; - $$ = new Expr\Array_($2, $attrs); } -; - -scalar_dereference: - array_expr '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | T_CONSTANT_ENCAPSED_STRING '[' dim_offset ']' - { $attrs = attributes(); $attrs['kind'] = strKind($1); - $$ = Expr\ArrayDimFetch[new Scalar\String_(Scalar\String_::parse($1), $attrs), $3]; } - | constant '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | scalar_dereference '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - /* alternative array syntax missing intentionally */ -; - -anonymous_class: - T_CLASS ctor_arguments extends_from implements_list '{' class_statement_list '}' - { $$ = array(Stmt\Class_[null, ['type' => 0, 'extends' => $3, 'implements' => $4, 'stmts' => $6]], $2); - $this->checkClass($$[0], -1); } -; - -new_expr: - T_NEW class_name_reference ctor_arguments { $$ = Expr\New_[$2, $3]; } - | T_NEW anonymous_class - { list($class, $ctorArgs) = $2; $$ = Expr\New_[$class, $ctorArgs]; } -; - -lexical_vars: - /* empty */ { $$ = array(); } - | T_USE '(' lexical_var_list ')' { $$ = $3; } -; - -lexical_var_list: - lexical_var { init($1); } - | lexical_var_list ',' lexical_var { push($1, $3); } -; - -lexical_var: - optional_ref plain_variable { $$ = Expr\ClosureUse[$2, $1]; } -; - -function_call: - name argument_list { $$ = Expr\FuncCall[$1, $2]; } - | class_name_or_var T_PAAMAYIM_NEKUDOTAYIM identifier_ex argument_list - { $$ = Expr\StaticCall[$1, $3, $4]; } - | class_name_or_var T_PAAMAYIM_NEKUDOTAYIM '{' expr '}' argument_list - { $$ = Expr\StaticCall[$1, $4, $6]; } - | static_property argument_list - { $$ = $this->fixupPhp5StaticPropCall($1, $2, attributes()); } - | variable_without_objects argument_list - { $$ = Expr\FuncCall[$1, $2]; } - | function_call '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - /* alternative array syntax missing intentionally */ -; - -class_name: - T_STATIC { $$ = Name[$1]; } - | name { $$ = $1; } -; - -name: - T_STRING { $$ = Name[$1]; } - | T_NAME_QUALIFIED { $$ = Name[$1]; } - | T_NAME_FULLY_QUALIFIED { $$ = Name\FullyQualified[substr($1, 1)]; } - | T_NAME_RELATIVE { $$ = Name\Relative[substr($1, 10)]; } -; - -class_name_reference: - class_name { $$ = $1; } - | dynamic_class_name_reference { $$ = $1; } -; - -dynamic_class_name_reference: - object_access_for_dcnr { $$ = $1; } - | base_variable { $$ = $1; } -; - -class_name_or_var: - class_name { $$ = $1; } - | reference_variable { $$ = $1; } -; - -object_access_for_dcnr: - base_variable T_OBJECT_OPERATOR object_property - { $$ = Expr\PropertyFetch[$1, $3]; } - | object_access_for_dcnr T_OBJECT_OPERATOR object_property - { $$ = Expr\PropertyFetch[$1, $3]; } - | object_access_for_dcnr '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | object_access_for_dcnr '{' expr '}' { $$ = Expr\ArrayDimFetch[$1, $3]; } -; - -exit_expr: - /* empty */ { $$ = null; } - | '(' ')' { $$ = null; } - | parentheses_expr { $$ = $1; } -; - -backticks_expr: - /* empty */ { $$ = array(); } - | T_ENCAPSED_AND_WHITESPACE - { $$ = array(Scalar\EncapsedStringPart[Scalar\String_::parseEscapeSequences($1, '`', false)]); } - | encaps_list { parseEncapsed($1, '`', false); $$ = $1; } -; - -ctor_arguments: - /* empty */ { $$ = array(); } - | argument_list { $$ = $1; } -; - -common_scalar: - T_LNUMBER { $$ = $this->parseLNumber($1, attributes(), true); } - | T_DNUMBER { $$ = Scalar\DNumber[Scalar\DNumber::parse($1)]; } - | T_CONSTANT_ENCAPSED_STRING - { $attrs = attributes(); $attrs['kind'] = strKind($1); - $$ = new Scalar\String_(Scalar\String_::parse($1, false), $attrs); } - | T_LINE { $$ = Scalar\MagicConst\Line[]; } - | T_FILE { $$ = Scalar\MagicConst\File[]; } - | T_DIR { $$ = Scalar\MagicConst\Dir[]; } - | T_CLASS_C { $$ = Scalar\MagicConst\Class_[]; } - | T_TRAIT_C { $$ = Scalar\MagicConst\Trait_[]; } - | T_METHOD_C { $$ = Scalar\MagicConst\Method[]; } - | T_FUNC_C { $$ = Scalar\MagicConst\Function_[]; } - | T_NS_C { $$ = Scalar\MagicConst\Namespace_[]; } - | T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE T_END_HEREDOC - { $$ = $this->parseDocString($1, $2, $3, attributes(), stackAttributes(#3), false); } - | T_START_HEREDOC T_END_HEREDOC - { $$ = $this->parseDocString($1, '', $2, attributes(), stackAttributes(#2), false); } -; - -static_scalar: - common_scalar { $$ = $1; } - | class_name T_PAAMAYIM_NEKUDOTAYIM identifier_ex { $$ = Expr\ClassConstFetch[$1, $3]; } - | name { $$ = Expr\ConstFetch[$1]; } - | T_ARRAY '(' static_array_pair_list ')' { $$ = Expr\Array_[$3]; } - | '[' static_array_pair_list ']' { $$ = Expr\Array_[$2]; } - | static_operation { $$ = $1; } -; - -static_operation: - static_scalar T_BOOLEAN_OR static_scalar { $$ = Expr\BinaryOp\BooleanOr [$1, $3]; } - | static_scalar T_BOOLEAN_AND static_scalar { $$ = Expr\BinaryOp\BooleanAnd[$1, $3]; } - | static_scalar T_LOGICAL_OR static_scalar { $$ = Expr\BinaryOp\LogicalOr [$1, $3]; } - | static_scalar T_LOGICAL_AND static_scalar { $$ = Expr\BinaryOp\LogicalAnd[$1, $3]; } - | static_scalar T_LOGICAL_XOR static_scalar { $$ = Expr\BinaryOp\LogicalXor[$1, $3]; } - | static_scalar '|' static_scalar { $$ = Expr\BinaryOp\BitwiseOr [$1, $3]; } - | static_scalar T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG static_scalar - { $$ = Expr\BinaryOp\BitwiseAnd[$1, $3]; } - | static_scalar T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG static_scalar - { $$ = Expr\BinaryOp\BitwiseAnd[$1, $3]; } - | static_scalar '^' static_scalar { $$ = Expr\BinaryOp\BitwiseXor[$1, $3]; } - | static_scalar '.' static_scalar { $$ = Expr\BinaryOp\Concat [$1, $3]; } - | static_scalar '+' static_scalar { $$ = Expr\BinaryOp\Plus [$1, $3]; } - | static_scalar '-' static_scalar { $$ = Expr\BinaryOp\Minus [$1, $3]; } - | static_scalar '*' static_scalar { $$ = Expr\BinaryOp\Mul [$1, $3]; } - | static_scalar '/' static_scalar { $$ = Expr\BinaryOp\Div [$1, $3]; } - | static_scalar '%' static_scalar { $$ = Expr\BinaryOp\Mod [$1, $3]; } - | static_scalar T_SL static_scalar { $$ = Expr\BinaryOp\ShiftLeft [$1, $3]; } - | static_scalar T_SR static_scalar { $$ = Expr\BinaryOp\ShiftRight[$1, $3]; } - | static_scalar T_POW static_scalar { $$ = Expr\BinaryOp\Pow [$1, $3]; } - | '+' static_scalar %prec T_INC { $$ = Expr\UnaryPlus [$2]; } - | '-' static_scalar %prec T_INC { $$ = Expr\UnaryMinus[$2]; } - | '!' static_scalar { $$ = Expr\BooleanNot[$2]; } - | '~' static_scalar { $$ = Expr\BitwiseNot[$2]; } - | static_scalar T_IS_IDENTICAL static_scalar { $$ = Expr\BinaryOp\Identical [$1, $3]; } - | static_scalar T_IS_NOT_IDENTICAL static_scalar { $$ = Expr\BinaryOp\NotIdentical [$1, $3]; } - | static_scalar T_IS_EQUAL static_scalar { $$ = Expr\BinaryOp\Equal [$1, $3]; } - | static_scalar T_IS_NOT_EQUAL static_scalar { $$ = Expr\BinaryOp\NotEqual [$1, $3]; } - | static_scalar '<' static_scalar { $$ = Expr\BinaryOp\Smaller [$1, $3]; } - | static_scalar T_IS_SMALLER_OR_EQUAL static_scalar { $$ = Expr\BinaryOp\SmallerOrEqual[$1, $3]; } - | static_scalar '>' static_scalar { $$ = Expr\BinaryOp\Greater [$1, $3]; } - | static_scalar T_IS_GREATER_OR_EQUAL static_scalar { $$ = Expr\BinaryOp\GreaterOrEqual[$1, $3]; } - | static_scalar '?' static_scalar ':' static_scalar { $$ = Expr\Ternary[$1, $3, $5]; } - | static_scalar '?' ':' static_scalar { $$ = Expr\Ternary[$1, null, $4]; } - | static_scalar '[' static_scalar ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | '(' static_scalar ')' { $$ = $2; } -; - -constant: - name { $$ = Expr\ConstFetch[$1]; } - | class_name_or_var T_PAAMAYIM_NEKUDOTAYIM identifier_ex - { $$ = Expr\ClassConstFetch[$1, $3]; } -; - -scalar: - common_scalar { $$ = $1; } - | constant { $$ = $1; } - | '"' encaps_list '"' - { $attrs = attributes(); $attrs['kind'] = Scalar\String_::KIND_DOUBLE_QUOTED; - parseEncapsed($2, '"', true); $$ = new Scalar\Encapsed($2, $attrs); } - | T_START_HEREDOC encaps_list T_END_HEREDOC - { $$ = $this->parseDocString($1, $2, $3, attributes(), stackAttributes(#3), true); } -; - -static_array_pair_list: - /* empty */ { $$ = array(); } - | non_empty_static_array_pair_list optional_comma { $$ = $1; } -; - -optional_comma: - /* empty */ - | ',' -; - -non_empty_static_array_pair_list: - non_empty_static_array_pair_list ',' static_array_pair { push($1, $3); } - | static_array_pair { init($1); } -; - -static_array_pair: - static_scalar T_DOUBLE_ARROW static_scalar { $$ = Expr\ArrayItem[$3, $1, false]; } - | static_scalar { $$ = Expr\ArrayItem[$1, null, false]; } -; - -variable: - object_access { $$ = $1; } - | base_variable { $$ = $1; } - | function_call { $$ = $1; } - | new_expr_array_deref { $$ = $1; } -; - -new_expr_array_deref: - '(' new_expr ')' '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$2, $5]; } - | new_expr_array_deref '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - /* alternative array syntax missing intentionally */ -; - -object_access: - variable_or_new_expr T_OBJECT_OPERATOR object_property - { $$ = Expr\PropertyFetch[$1, $3]; } - | variable_or_new_expr T_OBJECT_OPERATOR object_property argument_list - { $$ = Expr\MethodCall[$1, $3, $4]; } - | object_access argument_list { $$ = Expr\FuncCall[$1, $2]; } - | object_access '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | object_access '{' expr '}' { $$ = Expr\ArrayDimFetch[$1, $3]; } -; - -variable_or_new_expr: - variable { $$ = $1; } - | '(' new_expr ')' { $$ = $2; } -; - -variable_without_objects: - reference_variable { $$ = $1; } - | '$' variable_without_objects { $$ = Expr\Variable[$2]; } -; - -base_variable: - variable_without_objects { $$ = $1; } - | static_property { $$ = $1; } -; - -static_property: - class_name_or_var T_PAAMAYIM_NEKUDOTAYIM '$' reference_variable - { $$ = Expr\StaticPropertyFetch[$1, $4]; } - | static_property_with_arrays { $$ = $1; } -; - -static_property_simple_name: - T_VARIABLE - { $var = parseVar($1); $$ = \is_string($var) ? Node\VarLikeIdentifier[$var] : $var; } -; - -static_property_with_arrays: - class_name_or_var T_PAAMAYIM_NEKUDOTAYIM static_property_simple_name - { $$ = Expr\StaticPropertyFetch[$1, $3]; } - | class_name_or_var T_PAAMAYIM_NEKUDOTAYIM '$' '{' expr '}' - { $$ = Expr\StaticPropertyFetch[$1, $5]; } - | static_property_with_arrays '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | static_property_with_arrays '{' expr '}' { $$ = Expr\ArrayDimFetch[$1, $3]; } -; - -reference_variable: - reference_variable '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | reference_variable '{' expr '}' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | plain_variable { $$ = $1; } - | '$' '{' expr '}' { $$ = Expr\Variable[$3]; } -; - -dim_offset: - /* empty */ { $$ = null; } - | expr { $$ = $1; } -; - -object_property: - identifier { $$ = $1; } - | '{' expr '}' { $$ = $2; } - | variable_without_objects { $$ = $1; } - | error { $$ = Expr\Error[]; $this->errorState = 2; } -; - -list_expr: - T_LIST '(' list_expr_elements ')' { $$ = Expr\List_[$3]; } -; - -list_expr_elements: - list_expr_elements ',' list_expr_element { push($1, $3); } - | list_expr_element { init($1); } -; - -list_expr_element: - variable { $$ = Expr\ArrayItem[$1, null, false]; } - | list_expr { $$ = Expr\ArrayItem[$1, null, false]; } - | /* empty */ { $$ = null; } -; - -array_pair_list: - /* empty */ { $$ = array(); } - | non_empty_array_pair_list optional_comma { $$ = $1; } -; - -non_empty_array_pair_list: - non_empty_array_pair_list ',' array_pair { push($1, $3); } - | array_pair { init($1); } -; - -array_pair: - expr T_DOUBLE_ARROW expr { $$ = Expr\ArrayItem[$3, $1, false]; } - | expr { $$ = Expr\ArrayItem[$1, null, false]; } - | expr T_DOUBLE_ARROW ampersand variable { $$ = Expr\ArrayItem[$4, $1, true]; } - | ampersand variable { $$ = Expr\ArrayItem[$2, null, true]; } - | T_ELLIPSIS expr { $$ = Expr\ArrayItem[$2, null, false, attributes(), true]; } -; - -encaps_list: - encaps_list encaps_var { push($1, $2); } - | encaps_list encaps_string_part { push($1, $2); } - | encaps_var { init($1); } - | encaps_string_part encaps_var { init($1, $2); } -; - -encaps_string_part: - T_ENCAPSED_AND_WHITESPACE { $$ = Scalar\EncapsedStringPart[$1]; } -; - -encaps_str_varname: - T_STRING_VARNAME { $$ = Expr\Variable[$1]; } -; - -encaps_var: - plain_variable { $$ = $1; } - | plain_variable '[' encaps_var_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | plain_variable T_OBJECT_OPERATOR identifier { $$ = Expr\PropertyFetch[$1, $3]; } - | T_DOLLAR_OPEN_CURLY_BRACES expr '}' { $$ = Expr\Variable[$2]; } - | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '}' { $$ = Expr\Variable[$2]; } - | T_DOLLAR_OPEN_CURLY_BRACES encaps_str_varname '[' expr ']' '}' - { $$ = Expr\ArrayDimFetch[$2, $4]; } - | T_CURLY_OPEN variable '}' { $$ = $2; } -; - -encaps_var_offset: - T_STRING { $$ = Scalar\String_[$1]; } - | T_NUM_STRING { $$ = $this->parseNumString($1, attributes()); } - | plain_variable { $$ = $1; } -; - -%% diff --git a/vendor/nikic/php-parser/grammar/php7.y b/vendor/nikic/php-parser/grammar/php7.y deleted file mode 100644 index eac68d0..0000000 --- a/vendor/nikic/php-parser/grammar/php7.y +++ /dev/null @@ -1,1196 +0,0 @@ -%pure_parser -%expect 2 - -%tokens - -%% - -start: - top_statement_list { $$ = $this->handleNamespaces($1); } -; - -top_statement_list_ex: - top_statement_list_ex top_statement { pushNormalizing($1, $2); } - | /* empty */ { init(); } -; - -top_statement_list: - top_statement_list_ex - { makeZeroLengthNop($nop, $this->lookaheadStartAttributes); - if ($nop !== null) { $1[] = $nop; } $$ = $1; } -; - -ampersand: - T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG - | T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG -; - -reserved_non_modifiers: - T_INCLUDE | T_INCLUDE_ONCE | T_EVAL | T_REQUIRE | T_REQUIRE_ONCE | T_LOGICAL_OR | T_LOGICAL_XOR | T_LOGICAL_AND - | T_INSTANCEOF | T_NEW | T_CLONE | T_EXIT | T_IF | T_ELSEIF | T_ELSE | T_ENDIF | T_ECHO | T_DO | T_WHILE - | T_ENDWHILE | T_FOR | T_ENDFOR | T_FOREACH | T_ENDFOREACH | T_DECLARE | T_ENDDECLARE | T_AS | T_TRY | T_CATCH - | T_FINALLY | T_THROW | T_USE | T_INSTEADOF | T_GLOBAL | T_VAR | T_UNSET | T_ISSET | T_EMPTY | T_CONTINUE | T_GOTO - | T_FUNCTION | T_CONST | T_RETURN | T_PRINT | T_YIELD | T_LIST | T_SWITCH | T_ENDSWITCH | T_CASE | T_DEFAULT - | T_BREAK | T_ARRAY | T_CALLABLE | T_EXTENDS | T_IMPLEMENTS | T_NAMESPACE | T_TRAIT | T_INTERFACE | T_CLASS - | T_CLASS_C | T_TRAIT_C | T_FUNC_C | T_METHOD_C | T_LINE | T_FILE | T_DIR | T_NS_C | T_HALT_COMPILER | T_FN - | T_MATCH | T_ENUM -; - -semi_reserved: - reserved_non_modifiers - | T_STATIC | T_ABSTRACT | T_FINAL | T_PRIVATE | T_PROTECTED | T_PUBLIC | T_READONLY -; - -identifier_maybe_reserved: - T_STRING { $$ = Node\Identifier[$1]; } - | semi_reserved { $$ = Node\Identifier[$1]; } -; - -identifier_not_reserved: - T_STRING { $$ = Node\Identifier[$1]; } -; - -reserved_non_modifiers_identifier: - reserved_non_modifiers { $$ = Node\Identifier[$1]; } -; - -namespace_declaration_name: - T_STRING { $$ = Name[$1]; } - | semi_reserved { $$ = Name[$1]; } - | T_NAME_QUALIFIED { $$ = Name[$1]; } -; - -namespace_name: - T_STRING { $$ = Name[$1]; } - | T_NAME_QUALIFIED { $$ = Name[$1]; } -; - -legacy_namespace_name: - namespace_name { $$ = $1; } - | T_NAME_FULLY_QUALIFIED { $$ = Name[substr($1, 1)]; } -; - -plain_variable: - T_VARIABLE { $$ = Expr\Variable[parseVar($1)]; } -; - -semi: - ';' { /* nothing */ } - | error { /* nothing */ } -; - -no_comma: - /* empty */ { /* nothing */ } - | ',' { $this->emitError(new Error('A trailing comma is not allowed here', attributes())); } -; - -optional_comma: - /* empty */ - | ',' -; - -attribute_decl: - class_name { $$ = Node\Attribute[$1, []]; } - | class_name argument_list { $$ = Node\Attribute[$1, $2]; } -; - -attribute_group: - attribute_decl { init($1); } - | attribute_group ',' attribute_decl { push($1, $3); } -; - -attribute: - T_ATTRIBUTE attribute_group optional_comma ']' { $$ = Node\AttributeGroup[$2]; } -; - -attributes: - attribute { init($1); } - | attributes attribute { push($1, $2); } -; - -optional_attributes: - /* empty */ { $$ = []; } - | attributes { $$ = $1; } -; - -top_statement: - statement { $$ = $1; } - | function_declaration_statement { $$ = $1; } - | class_declaration_statement { $$ = $1; } - | T_HALT_COMPILER - { $$ = Stmt\HaltCompiler[$this->lexer->handleHaltCompiler()]; } - | T_NAMESPACE namespace_declaration_name semi - { $$ = Stmt\Namespace_[$2, null]; - $$->setAttribute('kind', Stmt\Namespace_::KIND_SEMICOLON); - $this->checkNamespace($$); } - | T_NAMESPACE namespace_declaration_name '{' top_statement_list '}' - { $$ = Stmt\Namespace_[$2, $4]; - $$->setAttribute('kind', Stmt\Namespace_::KIND_BRACED); - $this->checkNamespace($$); } - | T_NAMESPACE '{' top_statement_list '}' - { $$ = Stmt\Namespace_[null, $3]; - $$->setAttribute('kind', Stmt\Namespace_::KIND_BRACED); - $this->checkNamespace($$); } - | T_USE use_declarations semi { $$ = Stmt\Use_[$2, Stmt\Use_::TYPE_NORMAL]; } - | T_USE use_type use_declarations semi { $$ = Stmt\Use_[$3, $2]; } - | group_use_declaration semi { $$ = $1; } - | T_CONST constant_declaration_list semi { $$ = Stmt\Const_[$2]; } -; - -use_type: - T_FUNCTION { $$ = Stmt\Use_::TYPE_FUNCTION; } - | T_CONST { $$ = Stmt\Use_::TYPE_CONSTANT; } -; - -group_use_declaration: - T_USE use_type legacy_namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations '}' - { $$ = Stmt\GroupUse[$3, $6, $2]; } - | T_USE legacy_namespace_name T_NS_SEPARATOR '{' inline_use_declarations '}' - { $$ = Stmt\GroupUse[$2, $5, Stmt\Use_::TYPE_UNKNOWN]; } -; - -unprefixed_use_declarations: - non_empty_unprefixed_use_declarations optional_comma { $$ = $1; } -; - -non_empty_unprefixed_use_declarations: - non_empty_unprefixed_use_declarations ',' unprefixed_use_declaration - { push($1, $3); } - | unprefixed_use_declaration { init($1); } -; - -use_declarations: - non_empty_use_declarations no_comma { $$ = $1; } -; - -non_empty_use_declarations: - non_empty_use_declarations ',' use_declaration { push($1, $3); } - | use_declaration { init($1); } -; - -inline_use_declarations: - non_empty_inline_use_declarations optional_comma { $$ = $1; } -; - -non_empty_inline_use_declarations: - non_empty_inline_use_declarations ',' inline_use_declaration - { push($1, $3); } - | inline_use_declaration { init($1); } -; - -unprefixed_use_declaration: - namespace_name - { $$ = Stmt\UseUse[$1, null, Stmt\Use_::TYPE_UNKNOWN]; $this->checkUseUse($$, #1); } - | namespace_name T_AS identifier_not_reserved - { $$ = Stmt\UseUse[$1, $3, Stmt\Use_::TYPE_UNKNOWN]; $this->checkUseUse($$, #3); } -; - -use_declaration: - legacy_namespace_name - { $$ = Stmt\UseUse[$1, null, Stmt\Use_::TYPE_UNKNOWN]; $this->checkUseUse($$, #1); } - | legacy_namespace_name T_AS identifier_not_reserved - { $$ = Stmt\UseUse[$1, $3, Stmt\Use_::TYPE_UNKNOWN]; $this->checkUseUse($$, #3); } -; - -inline_use_declaration: - unprefixed_use_declaration { $$ = $1; $$->type = Stmt\Use_::TYPE_NORMAL; } - | use_type unprefixed_use_declaration { $$ = $2; $$->type = $1; } -; - -constant_declaration_list: - non_empty_constant_declaration_list no_comma { $$ = $1; } -; - -non_empty_constant_declaration_list: - non_empty_constant_declaration_list ',' constant_declaration - { push($1, $3); } - | constant_declaration { init($1); } -; - -constant_declaration: - identifier_not_reserved '=' expr { $$ = Node\Const_[$1, $3]; } -; - -class_const_list: - non_empty_class_const_list no_comma { $$ = $1; } -; - -non_empty_class_const_list: - non_empty_class_const_list ',' class_const { push($1, $3); } - | class_const { init($1); } -; - -class_const: - identifier_maybe_reserved '=' expr { $$ = Node\Const_[$1, $3]; } -; - -inner_statement_list_ex: - inner_statement_list_ex inner_statement { pushNormalizing($1, $2); } - | /* empty */ { init(); } -; - -inner_statement_list: - inner_statement_list_ex - { makeZeroLengthNop($nop, $this->lookaheadStartAttributes); - if ($nop !== null) { $1[] = $nop; } $$ = $1; } -; - -inner_statement: - statement { $$ = $1; } - | function_declaration_statement { $$ = $1; } - | class_declaration_statement { $$ = $1; } - | T_HALT_COMPILER - { throw new Error('__HALT_COMPILER() can only be used from the outermost scope', attributes()); } -; - -non_empty_statement: - '{' inner_statement_list '}' - { - if ($2) { - $$ = $2; prependLeadingComments($$); - } else { - makeNop($$, $this->startAttributeStack[#1], $this->endAttributes); - if (null === $$) { $$ = array(); } - } - } - | T_IF '(' expr ')' statement elseif_list else_single - { $$ = Stmt\If_[$3, ['stmts' => toArray($5), 'elseifs' => $6, 'else' => $7]]; } - | T_IF '(' expr ')' ':' inner_statement_list new_elseif_list new_else_single T_ENDIF ';' - { $$ = Stmt\If_[$3, ['stmts' => $6, 'elseifs' => $7, 'else' => $8]]; } - | T_WHILE '(' expr ')' while_statement { $$ = Stmt\While_[$3, $5]; } - | T_DO statement T_WHILE '(' expr ')' ';' { $$ = Stmt\Do_ [$5, toArray($2)]; } - | T_FOR '(' for_expr ';' for_expr ';' for_expr ')' for_statement - { $$ = Stmt\For_[['init' => $3, 'cond' => $5, 'loop' => $7, 'stmts' => $9]]; } - | T_SWITCH '(' expr ')' switch_case_list { $$ = Stmt\Switch_[$3, $5]; } - | T_BREAK optional_expr semi { $$ = Stmt\Break_[$2]; } - | T_CONTINUE optional_expr semi { $$ = Stmt\Continue_[$2]; } - | T_RETURN optional_expr semi { $$ = Stmt\Return_[$2]; } - | T_GLOBAL global_var_list semi { $$ = Stmt\Global_[$2]; } - | T_STATIC static_var_list semi { $$ = Stmt\Static_[$2]; } - | T_ECHO expr_list_forbid_comma semi { $$ = Stmt\Echo_[$2]; } - | T_INLINE_HTML { $$ = Stmt\InlineHTML[$1]; } - | expr semi { - $e = $1; - if ($e instanceof Expr\Throw_) { - // For backwards-compatibility reasons, convert throw in statement position into - // Stmt\Throw_ rather than Stmt\Expression(Expr\Throw_). - $$ = Stmt\Throw_[$e->expr]; - } else { - $$ = Stmt\Expression[$e]; - } - } - | T_UNSET '(' variables_list ')' semi { $$ = Stmt\Unset_[$3]; } - | T_FOREACH '(' expr T_AS foreach_variable ')' foreach_statement - { $$ = Stmt\Foreach_[$3, $5[0], ['keyVar' => null, 'byRef' => $5[1], 'stmts' => $7]]; } - | T_FOREACH '(' expr T_AS variable T_DOUBLE_ARROW foreach_variable ')' foreach_statement - { $$ = Stmt\Foreach_[$3, $7[0], ['keyVar' => $5, 'byRef' => $7[1], 'stmts' => $9]]; } - | T_FOREACH '(' expr error ')' foreach_statement - { $$ = Stmt\Foreach_[$3, new Expr\Error(stackAttributes(#4)), ['stmts' => $6]]; } - | T_DECLARE '(' declare_list ')' declare_statement { $$ = Stmt\Declare_[$3, $5]; } - | T_TRY '{' inner_statement_list '}' catches optional_finally - { $$ = Stmt\TryCatch[$3, $5, $6]; $this->checkTryCatch($$); } - | T_GOTO identifier_not_reserved semi { $$ = Stmt\Goto_[$2]; } - | identifier_not_reserved ':' { $$ = Stmt\Label[$1]; } - | error { $$ = array(); /* means: no statement */ } -; - -statement: - non_empty_statement { $$ = $1; } - | ';' - { makeNop($$, $this->startAttributeStack[#1], $this->endAttributes); - if ($$ === null) $$ = array(); /* means: no statement */ } -; - -catches: - /* empty */ { init(); } - | catches catch { push($1, $2); } -; - -name_union: - name { init($1); } - | name_union '|' name { push($1, $3); } -; - -catch: - T_CATCH '(' name_union optional_plain_variable ')' '{' inner_statement_list '}' - { $$ = Stmt\Catch_[$3, $4, $7]; } -; - -optional_finally: - /* empty */ { $$ = null; } - | T_FINALLY '{' inner_statement_list '}' { $$ = Stmt\Finally_[$3]; } -; - -variables_list: - non_empty_variables_list optional_comma { $$ = $1; } -; - -non_empty_variables_list: - variable { init($1); } - | non_empty_variables_list ',' variable { push($1, $3); } -; - -optional_ref: - /* empty */ { $$ = false; } - | ampersand { $$ = true; } -; - -optional_arg_ref: - /* empty */ { $$ = false; } - | T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG { $$ = true; } -; - -optional_ellipsis: - /* empty */ { $$ = false; } - | T_ELLIPSIS { $$ = true; } -; - -block_or_error: - '{' inner_statement_list '}' { $$ = $2; } - | error { $$ = []; } -; - -function_declaration_statement: - T_FUNCTION optional_ref identifier_not_reserved '(' parameter_list ')' optional_return_type block_or_error - { $$ = Stmt\Function_[$3, ['byRef' => $2, 'params' => $5, 'returnType' => $7, 'stmts' => $8, 'attrGroups' => []]]; } - | attributes T_FUNCTION optional_ref identifier_not_reserved '(' parameter_list ')' optional_return_type block_or_error - { $$ = Stmt\Function_[$4, ['byRef' => $3, 'params' => $6, 'returnType' => $8, 'stmts' => $9, 'attrGroups' => $1]]; } -; - -class_declaration_statement: - optional_attributes class_entry_type identifier_not_reserved extends_from implements_list '{' class_statement_list '}' - { $$ = Stmt\Class_[$3, ['type' => $2, 'extends' => $4, 'implements' => $5, 'stmts' => $7, 'attrGroups' => $1]]; - $this->checkClass($$, #3); } - | optional_attributes T_INTERFACE identifier_not_reserved interface_extends_list '{' class_statement_list '}' - { $$ = Stmt\Interface_[$3, ['extends' => $4, 'stmts' => $6, 'attrGroups' => $1]]; - $this->checkInterface($$, #3); } - | optional_attributes T_TRAIT identifier_not_reserved '{' class_statement_list '}' - { $$ = Stmt\Trait_[$3, ['stmts' => $5, 'attrGroups' => $1]]; } - | optional_attributes T_ENUM identifier_not_reserved enum_scalar_type implements_list '{' class_statement_list '}' - { $$ = Stmt\Enum_[$3, ['scalarType' => $4, 'implements' => $5, 'stmts' => $7, 'attrGroups' => $1]]; - $this->checkEnum($$, #3); } -; - -enum_scalar_type: - /* empty */ { $$ = null; } - | ':' type { $$ = $2; } - -enum_case_expr: - /* empty */ { $$ = null; } - | '=' expr { $$ = $2; } -; - -class_entry_type: - T_CLASS { $$ = 0; } - | T_ABSTRACT T_CLASS { $$ = Stmt\Class_::MODIFIER_ABSTRACT; } - | T_FINAL T_CLASS { $$ = Stmt\Class_::MODIFIER_FINAL; } -; - -extends_from: - /* empty */ { $$ = null; } - | T_EXTENDS class_name { $$ = $2; } -; - -interface_extends_list: - /* empty */ { $$ = array(); } - | T_EXTENDS class_name_list { $$ = $2; } -; - -implements_list: - /* empty */ { $$ = array(); } - | T_IMPLEMENTS class_name_list { $$ = $2; } -; - -class_name_list: - non_empty_class_name_list no_comma { $$ = $1; } -; - -non_empty_class_name_list: - class_name { init($1); } - | non_empty_class_name_list ',' class_name { push($1, $3); } -; - -for_statement: - statement { $$ = toArray($1); } - | ':' inner_statement_list T_ENDFOR ';' { $$ = $2; } -; - -foreach_statement: - statement { $$ = toArray($1); } - | ':' inner_statement_list T_ENDFOREACH ';' { $$ = $2; } -; - -declare_statement: - non_empty_statement { $$ = toArray($1); } - | ';' { $$ = null; } - | ':' inner_statement_list T_ENDDECLARE ';' { $$ = $2; } -; - -declare_list: - non_empty_declare_list no_comma { $$ = $1; } -; - -non_empty_declare_list: - declare_list_element { init($1); } - | non_empty_declare_list ',' declare_list_element { push($1, $3); } -; - -declare_list_element: - identifier_not_reserved '=' expr { $$ = Stmt\DeclareDeclare[$1, $3]; } -; - -switch_case_list: - '{' case_list '}' { $$ = $2; } - | '{' ';' case_list '}' { $$ = $3; } - | ':' case_list T_ENDSWITCH ';' { $$ = $2; } - | ':' ';' case_list T_ENDSWITCH ';' { $$ = $3; } -; - -case_list: - /* empty */ { init(); } - | case_list case { push($1, $2); } -; - -case: - T_CASE expr case_separator inner_statement_list_ex { $$ = Stmt\Case_[$2, $4]; } - | T_DEFAULT case_separator inner_statement_list_ex { $$ = Stmt\Case_[null, $3]; } -; - -case_separator: - ':' - | ';' -; - -match: - T_MATCH '(' expr ')' '{' match_arm_list '}' { $$ = Expr\Match_[$3, $6]; } -; - -match_arm_list: - /* empty */ { $$ = []; } - | non_empty_match_arm_list optional_comma { $$ = $1; } -; - -non_empty_match_arm_list: - match_arm { init($1); } - | non_empty_match_arm_list ',' match_arm { push($1, $3); } -; - -match_arm: - expr_list_allow_comma T_DOUBLE_ARROW expr { $$ = Node\MatchArm[$1, $3]; } - | T_DEFAULT optional_comma T_DOUBLE_ARROW expr { $$ = Node\MatchArm[null, $4]; } -; - -while_statement: - statement { $$ = toArray($1); } - | ':' inner_statement_list T_ENDWHILE ';' { $$ = $2; } -; - -elseif_list: - /* empty */ { init(); } - | elseif_list elseif { push($1, $2); } -; - -elseif: - T_ELSEIF '(' expr ')' statement { $$ = Stmt\ElseIf_[$3, toArray($5)]; } -; - -new_elseif_list: - /* empty */ { init(); } - | new_elseif_list new_elseif { push($1, $2); } -; - -new_elseif: - T_ELSEIF '(' expr ')' ':' inner_statement_list { $$ = Stmt\ElseIf_[$3, $6]; } -; - -else_single: - /* empty */ { $$ = null; } - | T_ELSE statement { $$ = Stmt\Else_[toArray($2)]; } -; - -new_else_single: - /* empty */ { $$ = null; } - | T_ELSE ':' inner_statement_list { $$ = Stmt\Else_[$3]; } -; - -foreach_variable: - variable { $$ = array($1, false); } - | ampersand variable { $$ = array($2, true); } - | list_expr { $$ = array($1, false); } - | array_short_syntax { $$ = array($1, false); } -; - -parameter_list: - non_empty_parameter_list optional_comma { $$ = $1; } - | /* empty */ { $$ = array(); } -; - -non_empty_parameter_list: - parameter { init($1); } - | non_empty_parameter_list ',' parameter { push($1, $3); } -; - -optional_property_modifiers: - /* empty */ { $$ = 0; } - | optional_property_modifiers property_modifier - { $this->checkModifier($1, $2, #2); $$ = $1 | $2; } -; - -property_modifier: - T_PUBLIC { $$ = Stmt\Class_::MODIFIER_PUBLIC; } - | T_PROTECTED { $$ = Stmt\Class_::MODIFIER_PROTECTED; } - | T_PRIVATE { $$ = Stmt\Class_::MODIFIER_PRIVATE; } - | T_READONLY { $$ = Stmt\Class_::MODIFIER_READONLY; } -; - -parameter: - optional_attributes optional_property_modifiers optional_type_without_static - optional_arg_ref optional_ellipsis plain_variable - { $$ = new Node\Param($6, null, $3, $4, $5, attributes(), $2, $1); - $this->checkParam($$); } - | optional_attributes optional_property_modifiers optional_type_without_static - optional_arg_ref optional_ellipsis plain_variable '=' expr - { $$ = new Node\Param($6, $8, $3, $4, $5, attributes(), $2, $1); - $this->checkParam($$); } - | optional_attributes optional_property_modifiers optional_type_without_static - optional_arg_ref optional_ellipsis error - { $$ = new Node\Param(Expr\Error[], null, $3, $4, $5, attributes(), $2, $1); } -; - -type_expr: - type { $$ = $1; } - | '?' type { $$ = Node\NullableType[$2]; } - | union_type { $$ = Node\UnionType[$1]; } - | intersection_type { $$ = Node\IntersectionType[$1]; } -; - -type: - type_without_static { $$ = $1; } - | T_STATIC { $$ = Node\Name['static']; } -; - -type_without_static: - name { $$ = $this->handleBuiltinTypes($1); } - | T_ARRAY { $$ = Node\Identifier['array']; } - | T_CALLABLE { $$ = Node\Identifier['callable']; } -; - -union_type: - type '|' type { init($1, $3); } - | union_type '|' type { push($1, $3); } -; - -union_type_without_static: - type_without_static '|' type_without_static { init($1, $3); } - | union_type_without_static '|' type_without_static { push($1, $3); } -; - -intersection_type: - type T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG type { init($1, $3); } - | intersection_type T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG type - { push($1, $3); } -; - -intersection_type_without_static: - type_without_static T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG type_without_static - { init($1, $3); } - | intersection_type_without_static T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG type_without_static - { push($1, $3); } -; - -type_expr_without_static: - type_without_static { $$ = $1; } - | '?' type_without_static { $$ = Node\NullableType[$2]; } - | union_type_without_static { $$ = Node\UnionType[$1]; } - | intersection_type_without_static { $$ = Node\IntersectionType[$1]; } -; - -optional_type_without_static: - /* empty */ { $$ = null; } - | type_expr_without_static { $$ = $1; } -; - -optional_return_type: - /* empty */ { $$ = null; } - | ':' type_expr { $$ = $2; } - | ':' error { $$ = null; } -; - -argument_list: - '(' ')' { $$ = array(); } - | '(' non_empty_argument_list optional_comma ')' { $$ = $2; } - | '(' variadic_placeholder ')' { init($2); } -; - -variadic_placeholder: - T_ELLIPSIS { $$ = Node\VariadicPlaceholder[]; } -; - -non_empty_argument_list: - argument { init($1); } - | non_empty_argument_list ',' argument { push($1, $3); } -; - -argument: - expr { $$ = Node\Arg[$1, false, false]; } - | ampersand variable { $$ = Node\Arg[$2, true, false]; } - | T_ELLIPSIS expr { $$ = Node\Arg[$2, false, true]; } - | identifier_maybe_reserved ':' expr - { $$ = new Node\Arg($3, false, false, attributes(), $1); } -; - -global_var_list: - non_empty_global_var_list no_comma { $$ = $1; } -; - -non_empty_global_var_list: - non_empty_global_var_list ',' global_var { push($1, $3); } - | global_var { init($1); } -; - -global_var: - simple_variable { $$ = $1; } -; - -static_var_list: - non_empty_static_var_list no_comma { $$ = $1; } -; - -non_empty_static_var_list: - non_empty_static_var_list ',' static_var { push($1, $3); } - | static_var { init($1); } -; - -static_var: - plain_variable { $$ = Stmt\StaticVar[$1, null]; } - | plain_variable '=' expr { $$ = Stmt\StaticVar[$1, $3]; } -; - -class_statement_list_ex: - class_statement_list_ex class_statement { if ($2 !== null) { push($1, $2); } } - | /* empty */ { init(); } -; - -class_statement_list: - class_statement_list_ex - { makeZeroLengthNop($nop, $this->lookaheadStartAttributes); - if ($nop !== null) { $1[] = $nop; } $$ = $1; } -; - -class_statement: - optional_attributes variable_modifiers optional_type_without_static property_declaration_list semi - { $$ = new Stmt\Property($2, $4, attributes(), $3, $1); - $this->checkProperty($$, #2); } - | optional_attributes method_modifiers T_CONST class_const_list semi - { $$ = new Stmt\ClassConst($4, $2, attributes(), $1); - $this->checkClassConst($$, #2); } - | optional_attributes method_modifiers T_FUNCTION optional_ref identifier_maybe_reserved '(' parameter_list ')' - optional_return_type method_body - { $$ = Stmt\ClassMethod[$5, ['type' => $2, 'byRef' => $4, 'params' => $7, 'returnType' => $9, 'stmts' => $10, 'attrGroups' => $1]]; - $this->checkClassMethod($$, #2); } - | T_USE class_name_list trait_adaptations { $$ = Stmt\TraitUse[$2, $3]; } - | optional_attributes T_CASE identifier_maybe_reserved enum_case_expr semi - { $$ = Stmt\EnumCase[$3, $4, $1]; } - | error { $$ = null; /* will be skipped */ } -; - -trait_adaptations: - ';' { $$ = array(); } - | '{' trait_adaptation_list '}' { $$ = $2; } -; - -trait_adaptation_list: - /* empty */ { init(); } - | trait_adaptation_list trait_adaptation { push($1, $2); } -; - -trait_adaptation: - trait_method_reference_fully_qualified T_INSTEADOF class_name_list ';' - { $$ = Stmt\TraitUseAdaptation\Precedence[$1[0], $1[1], $3]; } - | trait_method_reference T_AS member_modifier identifier_maybe_reserved ';' - { $$ = Stmt\TraitUseAdaptation\Alias[$1[0], $1[1], $3, $4]; } - | trait_method_reference T_AS member_modifier ';' - { $$ = Stmt\TraitUseAdaptation\Alias[$1[0], $1[1], $3, null]; } - | trait_method_reference T_AS identifier_not_reserved ';' - { $$ = Stmt\TraitUseAdaptation\Alias[$1[0], $1[1], null, $3]; } - | trait_method_reference T_AS reserved_non_modifiers_identifier ';' - { $$ = Stmt\TraitUseAdaptation\Alias[$1[0], $1[1], null, $3]; } -; - -trait_method_reference_fully_qualified: - name T_PAAMAYIM_NEKUDOTAYIM identifier_maybe_reserved { $$ = array($1, $3); } -; -trait_method_reference: - trait_method_reference_fully_qualified { $$ = $1; } - | identifier_maybe_reserved { $$ = array(null, $1); } -; - -method_body: - ';' /* abstract method */ { $$ = null; } - | block_or_error { $$ = $1; } -; - -variable_modifiers: - non_empty_member_modifiers { $$ = $1; } - | T_VAR { $$ = 0; } -; - -method_modifiers: - /* empty */ { $$ = 0; } - | non_empty_member_modifiers { $$ = $1; } -; - -non_empty_member_modifiers: - member_modifier { $$ = $1; } - | non_empty_member_modifiers member_modifier { $this->checkModifier($1, $2, #2); $$ = $1 | $2; } -; - -member_modifier: - T_PUBLIC { $$ = Stmt\Class_::MODIFIER_PUBLIC; } - | T_PROTECTED { $$ = Stmt\Class_::MODIFIER_PROTECTED; } - | T_PRIVATE { $$ = Stmt\Class_::MODIFIER_PRIVATE; } - | T_STATIC { $$ = Stmt\Class_::MODIFIER_STATIC; } - | T_ABSTRACT { $$ = Stmt\Class_::MODIFIER_ABSTRACT; } - | T_FINAL { $$ = Stmt\Class_::MODIFIER_FINAL; } - | T_READONLY { $$ = Stmt\Class_::MODIFIER_READONLY; } -; - -property_declaration_list: - non_empty_property_declaration_list no_comma { $$ = $1; } -; - -non_empty_property_declaration_list: - property_declaration { init($1); } - | non_empty_property_declaration_list ',' property_declaration - { push($1, $3); } -; - -property_decl_name: - T_VARIABLE { $$ = Node\VarLikeIdentifier[parseVar($1)]; } -; - -property_declaration: - property_decl_name { $$ = Stmt\PropertyProperty[$1, null]; } - | property_decl_name '=' expr { $$ = Stmt\PropertyProperty[$1, $3]; } -; - -expr_list_forbid_comma: - non_empty_expr_list no_comma { $$ = $1; } -; - -expr_list_allow_comma: - non_empty_expr_list optional_comma { $$ = $1; } -; - -non_empty_expr_list: - non_empty_expr_list ',' expr { push($1, $3); } - | expr { init($1); } -; - -for_expr: - /* empty */ { $$ = array(); } - | expr_list_forbid_comma { $$ = $1; } -; - -expr: - variable { $$ = $1; } - | list_expr '=' expr { $$ = Expr\Assign[$1, $3]; } - | array_short_syntax '=' expr { $$ = Expr\Assign[$1, $3]; } - | variable '=' expr { $$ = Expr\Assign[$1, $3]; } - | variable '=' ampersand variable { $$ = Expr\AssignRef[$1, $4]; } - | new_expr { $$ = $1; } - | match { $$ = $1; } - | T_CLONE expr { $$ = Expr\Clone_[$2]; } - | variable T_PLUS_EQUAL expr { $$ = Expr\AssignOp\Plus [$1, $3]; } - | variable T_MINUS_EQUAL expr { $$ = Expr\AssignOp\Minus [$1, $3]; } - | variable T_MUL_EQUAL expr { $$ = Expr\AssignOp\Mul [$1, $3]; } - | variable T_DIV_EQUAL expr { $$ = Expr\AssignOp\Div [$1, $3]; } - | variable T_CONCAT_EQUAL expr { $$ = Expr\AssignOp\Concat [$1, $3]; } - | variable T_MOD_EQUAL expr { $$ = Expr\AssignOp\Mod [$1, $3]; } - | variable T_AND_EQUAL expr { $$ = Expr\AssignOp\BitwiseAnd[$1, $3]; } - | variable T_OR_EQUAL expr { $$ = Expr\AssignOp\BitwiseOr [$1, $3]; } - | variable T_XOR_EQUAL expr { $$ = Expr\AssignOp\BitwiseXor[$1, $3]; } - | variable T_SL_EQUAL expr { $$ = Expr\AssignOp\ShiftLeft [$1, $3]; } - | variable T_SR_EQUAL expr { $$ = Expr\AssignOp\ShiftRight[$1, $3]; } - | variable T_POW_EQUAL expr { $$ = Expr\AssignOp\Pow [$1, $3]; } - | variable T_COALESCE_EQUAL expr { $$ = Expr\AssignOp\Coalesce [$1, $3]; } - | variable T_INC { $$ = Expr\PostInc[$1]; } - | T_INC variable { $$ = Expr\PreInc [$2]; } - | variable T_DEC { $$ = Expr\PostDec[$1]; } - | T_DEC variable { $$ = Expr\PreDec [$2]; } - | expr T_BOOLEAN_OR expr { $$ = Expr\BinaryOp\BooleanOr [$1, $3]; } - | expr T_BOOLEAN_AND expr { $$ = Expr\BinaryOp\BooleanAnd[$1, $3]; } - | expr T_LOGICAL_OR expr { $$ = Expr\BinaryOp\LogicalOr [$1, $3]; } - | expr T_LOGICAL_AND expr { $$ = Expr\BinaryOp\LogicalAnd[$1, $3]; } - | expr T_LOGICAL_XOR expr { $$ = Expr\BinaryOp\LogicalXor[$1, $3]; } - | expr '|' expr { $$ = Expr\BinaryOp\BitwiseOr [$1, $3]; } - | expr T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG expr { $$ = Expr\BinaryOp\BitwiseAnd[$1, $3]; } - | expr T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG expr { $$ = Expr\BinaryOp\BitwiseAnd[$1, $3]; } - | expr '^' expr { $$ = Expr\BinaryOp\BitwiseXor[$1, $3]; } - | expr '.' expr { $$ = Expr\BinaryOp\Concat [$1, $3]; } - | expr '+' expr { $$ = Expr\BinaryOp\Plus [$1, $3]; } - | expr '-' expr { $$ = Expr\BinaryOp\Minus [$1, $3]; } - | expr '*' expr { $$ = Expr\BinaryOp\Mul [$1, $3]; } - | expr '/' expr { $$ = Expr\BinaryOp\Div [$1, $3]; } - | expr '%' expr { $$ = Expr\BinaryOp\Mod [$1, $3]; } - | expr T_SL expr { $$ = Expr\BinaryOp\ShiftLeft [$1, $3]; } - | expr T_SR expr { $$ = Expr\BinaryOp\ShiftRight[$1, $3]; } - | expr T_POW expr { $$ = Expr\BinaryOp\Pow [$1, $3]; } - | '+' expr %prec T_INC { $$ = Expr\UnaryPlus [$2]; } - | '-' expr %prec T_INC { $$ = Expr\UnaryMinus[$2]; } - | '!' expr { $$ = Expr\BooleanNot[$2]; } - | '~' expr { $$ = Expr\BitwiseNot[$2]; } - | expr T_IS_IDENTICAL expr { $$ = Expr\BinaryOp\Identical [$1, $3]; } - | expr T_IS_NOT_IDENTICAL expr { $$ = Expr\BinaryOp\NotIdentical [$1, $3]; } - | expr T_IS_EQUAL expr { $$ = Expr\BinaryOp\Equal [$1, $3]; } - | expr T_IS_NOT_EQUAL expr { $$ = Expr\BinaryOp\NotEqual [$1, $3]; } - | expr T_SPACESHIP expr { $$ = Expr\BinaryOp\Spaceship [$1, $3]; } - | expr '<' expr { $$ = Expr\BinaryOp\Smaller [$1, $3]; } - | expr T_IS_SMALLER_OR_EQUAL expr { $$ = Expr\BinaryOp\SmallerOrEqual[$1, $3]; } - | expr '>' expr { $$ = Expr\BinaryOp\Greater [$1, $3]; } - | expr T_IS_GREATER_OR_EQUAL expr { $$ = Expr\BinaryOp\GreaterOrEqual[$1, $3]; } - | expr T_INSTANCEOF class_name_reference { $$ = Expr\Instanceof_[$1, $3]; } - | '(' expr ')' { $$ = $2; } - | expr '?' expr ':' expr { $$ = Expr\Ternary[$1, $3, $5]; } - | expr '?' ':' expr { $$ = Expr\Ternary[$1, null, $4]; } - | expr T_COALESCE expr { $$ = Expr\BinaryOp\Coalesce[$1, $3]; } - | T_ISSET '(' expr_list_allow_comma ')' { $$ = Expr\Isset_[$3]; } - | T_EMPTY '(' expr ')' { $$ = Expr\Empty_[$3]; } - | T_INCLUDE expr { $$ = Expr\Include_[$2, Expr\Include_::TYPE_INCLUDE]; } - | T_INCLUDE_ONCE expr { $$ = Expr\Include_[$2, Expr\Include_::TYPE_INCLUDE_ONCE]; } - | T_EVAL '(' expr ')' { $$ = Expr\Eval_[$3]; } - | T_REQUIRE expr { $$ = Expr\Include_[$2, Expr\Include_::TYPE_REQUIRE]; } - | T_REQUIRE_ONCE expr { $$ = Expr\Include_[$2, Expr\Include_::TYPE_REQUIRE_ONCE]; } - | T_INT_CAST expr { $$ = Expr\Cast\Int_ [$2]; } - | T_DOUBLE_CAST expr - { $attrs = attributes(); - $attrs['kind'] = $this->getFloatCastKind($1); - $$ = new Expr\Cast\Double($2, $attrs); } - | T_STRING_CAST expr { $$ = Expr\Cast\String_ [$2]; } - | T_ARRAY_CAST expr { $$ = Expr\Cast\Array_ [$2]; } - | T_OBJECT_CAST expr { $$ = Expr\Cast\Object_ [$2]; } - | T_BOOL_CAST expr { $$ = Expr\Cast\Bool_ [$2]; } - | T_UNSET_CAST expr { $$ = Expr\Cast\Unset_ [$2]; } - | T_EXIT exit_expr - { $attrs = attributes(); - $attrs['kind'] = strtolower($1) === 'exit' ? Expr\Exit_::KIND_EXIT : Expr\Exit_::KIND_DIE; - $$ = new Expr\Exit_($2, $attrs); } - | '@' expr { $$ = Expr\ErrorSuppress[$2]; } - | scalar { $$ = $1; } - | '`' backticks_expr '`' { $$ = Expr\ShellExec[$2]; } - | T_PRINT expr { $$ = Expr\Print_[$2]; } - | T_YIELD { $$ = Expr\Yield_[null, null]; } - | T_YIELD expr { $$ = Expr\Yield_[$2, null]; } - | T_YIELD expr T_DOUBLE_ARROW expr { $$ = Expr\Yield_[$4, $2]; } - | T_YIELD_FROM expr { $$ = Expr\YieldFrom[$2]; } - | T_THROW expr { $$ = Expr\Throw_[$2]; } - - | T_FN optional_ref '(' parameter_list ')' optional_return_type T_DOUBLE_ARROW expr %prec T_THROW - { $$ = Expr\ArrowFunction[['static' => false, 'byRef' => $2, 'params' => $4, 'returnType' => $6, 'expr' => $8, 'attrGroups' => []]]; } - | T_STATIC T_FN optional_ref '(' parameter_list ')' optional_return_type T_DOUBLE_ARROW expr %prec T_THROW - { $$ = Expr\ArrowFunction[['static' => true, 'byRef' => $3, 'params' => $5, 'returnType' => $7, 'expr' => $9, 'attrGroups' => []]]; } - | T_FUNCTION optional_ref '(' parameter_list ')' lexical_vars optional_return_type block_or_error - { $$ = Expr\Closure[['static' => false, 'byRef' => $2, 'params' => $4, 'uses' => $6, 'returnType' => $7, 'stmts' => $8, 'attrGroups' => []]]; } - | T_STATIC T_FUNCTION optional_ref '(' parameter_list ')' lexical_vars optional_return_type block_or_error - { $$ = Expr\Closure[['static' => true, 'byRef' => $3, 'params' => $5, 'uses' => $7, 'returnType' => $8, 'stmts' => $9, 'attrGroups' => []]]; } - - | attributes T_FN optional_ref '(' parameter_list ')' optional_return_type T_DOUBLE_ARROW expr %prec T_THROW - { $$ = Expr\ArrowFunction[['static' => false, 'byRef' => $3, 'params' => $5, 'returnType' => $7, 'expr' => $9, 'attrGroups' => $1]]; } - | attributes T_STATIC T_FN optional_ref '(' parameter_list ')' optional_return_type T_DOUBLE_ARROW expr %prec T_THROW - { $$ = Expr\ArrowFunction[['static' => true, 'byRef' => $4, 'params' => $6, 'returnType' => $8, 'expr' => $10, 'attrGroups' => $1]]; } - | attributes T_FUNCTION optional_ref '(' parameter_list ')' lexical_vars optional_return_type block_or_error - { $$ = Expr\Closure[['static' => false, 'byRef' => $3, 'params' => $5, 'uses' => $7, 'returnType' => $8, 'stmts' => $9, 'attrGroups' => $1]]; } - | attributes T_STATIC T_FUNCTION optional_ref '(' parameter_list ')' lexical_vars optional_return_type block_or_error - { $$ = Expr\Closure[['static' => true, 'byRef' => $4, 'params' => $6, 'uses' => $8, 'returnType' => $9, 'stmts' => $10, 'attrGroups' => $1]]; } -; - -anonymous_class: - optional_attributes T_CLASS ctor_arguments extends_from implements_list '{' class_statement_list '}' - { $$ = array(Stmt\Class_[null, ['type' => 0, 'extends' => $4, 'implements' => $5, 'stmts' => $7, 'attrGroups' => $1]], $3); - $this->checkClass($$[0], -1); } -; - -new_expr: - T_NEW class_name_reference ctor_arguments { $$ = Expr\New_[$2, $3]; } - | T_NEW anonymous_class - { list($class, $ctorArgs) = $2; $$ = Expr\New_[$class, $ctorArgs]; } -; - -lexical_vars: - /* empty */ { $$ = array(); } - | T_USE '(' lexical_var_list ')' { $$ = $3; } -; - -lexical_var_list: - non_empty_lexical_var_list optional_comma { $$ = $1; } -; - -non_empty_lexical_var_list: - lexical_var { init($1); } - | non_empty_lexical_var_list ',' lexical_var { push($1, $3); } -; - -lexical_var: - optional_ref plain_variable { $$ = Expr\ClosureUse[$2, $1]; } -; - -function_call: - name argument_list { $$ = Expr\FuncCall[$1, $2]; } - | callable_expr argument_list { $$ = Expr\FuncCall[$1, $2]; } - | class_name_or_var T_PAAMAYIM_NEKUDOTAYIM member_name argument_list - { $$ = Expr\StaticCall[$1, $3, $4]; } -; - -class_name: - T_STATIC { $$ = Name[$1]; } - | name { $$ = $1; } -; - -name: - T_STRING { $$ = Name[$1]; } - | T_NAME_QUALIFIED { $$ = Name[$1]; } - | T_NAME_FULLY_QUALIFIED { $$ = Name\FullyQualified[substr($1, 1)]; } - | T_NAME_RELATIVE { $$ = Name\Relative[substr($1, 10)]; } -; - -class_name_reference: - class_name { $$ = $1; } - | new_variable { $$ = $1; } - | '(' expr ')' { $$ = $2; } - | error { $$ = Expr\Error[]; $this->errorState = 2; } -; - -class_name_or_var: - class_name { $$ = $1; } - | fully_dereferencable { $$ = $1; } -; - -exit_expr: - /* empty */ { $$ = null; } - | '(' optional_expr ')' { $$ = $2; } -; - -backticks_expr: - /* empty */ { $$ = array(); } - | T_ENCAPSED_AND_WHITESPACE - { $$ = array(Scalar\EncapsedStringPart[Scalar\String_::parseEscapeSequences($1, '`')]); } - | encaps_list { parseEncapsed($1, '`', true); $$ = $1; } -; - -ctor_arguments: - /* empty */ { $$ = array(); } - | argument_list { $$ = $1; } -; - -constant: - name { $$ = Expr\ConstFetch[$1]; } - | T_LINE { $$ = Scalar\MagicConst\Line[]; } - | T_FILE { $$ = Scalar\MagicConst\File[]; } - | T_DIR { $$ = Scalar\MagicConst\Dir[]; } - | T_CLASS_C { $$ = Scalar\MagicConst\Class_[]; } - | T_TRAIT_C { $$ = Scalar\MagicConst\Trait_[]; } - | T_METHOD_C { $$ = Scalar\MagicConst\Method[]; } - | T_FUNC_C { $$ = Scalar\MagicConst\Function_[]; } - | T_NS_C { $$ = Scalar\MagicConst\Namespace_[]; } -; - -class_constant: - class_name_or_var T_PAAMAYIM_NEKUDOTAYIM identifier_maybe_reserved - { $$ = Expr\ClassConstFetch[$1, $3]; } - /* We interpret an isolated FOO:: as an unfinished class constant fetch. It could also be - an unfinished static property fetch or unfinished scoped call. */ - | class_name_or_var T_PAAMAYIM_NEKUDOTAYIM error - { $$ = Expr\ClassConstFetch[$1, new Expr\Error(stackAttributes(#3))]; $this->errorState = 2; } -; - -array_short_syntax: - '[' array_pair_list ']' - { $attrs = attributes(); $attrs['kind'] = Expr\Array_::KIND_SHORT; - $$ = new Expr\Array_($2, $attrs); } -; - -dereferencable_scalar: - T_ARRAY '(' array_pair_list ')' - { $attrs = attributes(); $attrs['kind'] = Expr\Array_::KIND_LONG; - $$ = new Expr\Array_($3, $attrs); } - | array_short_syntax { $$ = $1; } - | T_CONSTANT_ENCAPSED_STRING - { $attrs = attributes(); $attrs['kind'] = strKind($1); - $$ = new Scalar\String_(Scalar\String_::parse($1), $attrs); } - | '"' encaps_list '"' - { $attrs = attributes(); $attrs['kind'] = Scalar\String_::KIND_DOUBLE_QUOTED; - parseEncapsed($2, '"', true); $$ = new Scalar\Encapsed($2, $attrs); } -; - -scalar: - T_LNUMBER { $$ = $this->parseLNumber($1, attributes()); } - | T_DNUMBER { $$ = Scalar\DNumber[Scalar\DNumber::parse($1)]; } - | dereferencable_scalar { $$ = $1; } - | constant { $$ = $1; } - | class_constant { $$ = $1; } - | T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE T_END_HEREDOC - { $$ = $this->parseDocString($1, $2, $3, attributes(), stackAttributes(#3), true); } - | T_START_HEREDOC T_END_HEREDOC - { $$ = $this->parseDocString($1, '', $2, attributes(), stackAttributes(#2), true); } - | T_START_HEREDOC encaps_list T_END_HEREDOC - { $$ = $this->parseDocString($1, $2, $3, attributes(), stackAttributes(#3), true); } -; - -optional_expr: - /* empty */ { $$ = null; } - | expr { $$ = $1; } -; - -fully_dereferencable: - variable { $$ = $1; } - | '(' expr ')' { $$ = $2; } - | dereferencable_scalar { $$ = $1; } - | class_constant { $$ = $1; } -; - -array_object_dereferencable: - fully_dereferencable { $$ = $1; } - | constant { $$ = $1; } -; - -callable_expr: - callable_variable { $$ = $1; } - | '(' expr ')' { $$ = $2; } - | dereferencable_scalar { $$ = $1; } -; - -callable_variable: - simple_variable { $$ = $1; } - | array_object_dereferencable '[' optional_expr ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | array_object_dereferencable '{' expr '}' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | function_call { $$ = $1; } - | array_object_dereferencable T_OBJECT_OPERATOR property_name argument_list - { $$ = Expr\MethodCall[$1, $3, $4]; } - | array_object_dereferencable T_NULLSAFE_OBJECT_OPERATOR property_name argument_list - { $$ = Expr\NullsafeMethodCall[$1, $3, $4]; } -; - -optional_plain_variable: - /* empty */ { $$ = null; } - | plain_variable { $$ = $1; } -; - -variable: - callable_variable { $$ = $1; } - | static_member { $$ = $1; } - | array_object_dereferencable T_OBJECT_OPERATOR property_name - { $$ = Expr\PropertyFetch[$1, $3]; } - | array_object_dereferencable T_NULLSAFE_OBJECT_OPERATOR property_name - { $$ = Expr\NullsafePropertyFetch[$1, $3]; } -; - -simple_variable: - plain_variable { $$ = $1; } - | '$' '{' expr '}' { $$ = Expr\Variable[$3]; } - | '$' simple_variable { $$ = Expr\Variable[$2]; } - | '$' error { $$ = Expr\Variable[Expr\Error[]]; $this->errorState = 2; } -; - -static_member_prop_name: - simple_variable - { $var = $1->name; $$ = \is_string($var) ? Node\VarLikeIdentifier[$var] : $var; } -; - -static_member: - class_name_or_var T_PAAMAYIM_NEKUDOTAYIM static_member_prop_name - { $$ = Expr\StaticPropertyFetch[$1, $3]; } -; - -new_variable: - simple_variable { $$ = $1; } - | new_variable '[' optional_expr ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | new_variable '{' expr '}' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | new_variable T_OBJECT_OPERATOR property_name { $$ = Expr\PropertyFetch[$1, $3]; } - | new_variable T_NULLSAFE_OBJECT_OPERATOR property_name { $$ = Expr\NullsafePropertyFetch[$1, $3]; } - | class_name T_PAAMAYIM_NEKUDOTAYIM static_member_prop_name - { $$ = Expr\StaticPropertyFetch[$1, $3]; } - | new_variable T_PAAMAYIM_NEKUDOTAYIM static_member_prop_name - { $$ = Expr\StaticPropertyFetch[$1, $3]; } -; - -member_name: - identifier_maybe_reserved { $$ = $1; } - | '{' expr '}' { $$ = $2; } - | simple_variable { $$ = $1; } -; - -property_name: - identifier_not_reserved { $$ = $1; } - | '{' expr '}' { $$ = $2; } - | simple_variable { $$ = $1; } - | error { $$ = Expr\Error[]; $this->errorState = 2; } -; - -list_expr: - T_LIST '(' inner_array_pair_list ')' { $$ = Expr\List_[$3]; } -; - -array_pair_list: - inner_array_pair_list - { $$ = $1; $end = count($$)-1; if ($$[$end] === null) array_pop($$); } -; - -comma_or_error: - ',' - | error - { /* do nothing -- prevent default action of $$=$1. See #551. */ } -; - -inner_array_pair_list: - inner_array_pair_list comma_or_error array_pair { push($1, $3); } - | array_pair { init($1); } -; - -array_pair: - expr { $$ = Expr\ArrayItem[$1, null, false]; } - | ampersand variable { $$ = Expr\ArrayItem[$2, null, true]; } - | list_expr { $$ = Expr\ArrayItem[$1, null, false]; } - | expr T_DOUBLE_ARROW expr { $$ = Expr\ArrayItem[$3, $1, false]; } - | expr T_DOUBLE_ARROW ampersand variable { $$ = Expr\ArrayItem[$4, $1, true]; } - | expr T_DOUBLE_ARROW list_expr { $$ = Expr\ArrayItem[$3, $1, false]; } - | T_ELLIPSIS expr { $$ = Expr\ArrayItem[$2, null, false, attributes(), true]; } - | /* empty */ { $$ = null; } -; - -encaps_list: - encaps_list encaps_var { push($1, $2); } - | encaps_list encaps_string_part { push($1, $2); } - | encaps_var { init($1); } - | encaps_string_part encaps_var { init($1, $2); } -; - -encaps_string_part: - T_ENCAPSED_AND_WHITESPACE { $$ = Scalar\EncapsedStringPart[$1]; } -; - -encaps_str_varname: - T_STRING_VARNAME { $$ = Expr\Variable[$1]; } -; - -encaps_var: - plain_variable { $$ = $1; } - | plain_variable '[' encaps_var_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | plain_variable T_OBJECT_OPERATOR identifier_not_reserved - { $$ = Expr\PropertyFetch[$1, $3]; } - | plain_variable T_NULLSAFE_OBJECT_OPERATOR identifier_not_reserved - { $$ = Expr\NullsafePropertyFetch[$1, $3]; } - | T_DOLLAR_OPEN_CURLY_BRACES expr '}' { $$ = Expr\Variable[$2]; } - | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '}' { $$ = Expr\Variable[$2]; } - | T_DOLLAR_OPEN_CURLY_BRACES encaps_str_varname '[' expr ']' '}' - { $$ = Expr\ArrayDimFetch[$2, $4]; } - | T_CURLY_OPEN variable '}' { $$ = $2; } -; - -encaps_var_offset: - T_STRING { $$ = Scalar\String_[$1]; } - | T_NUM_STRING { $$ = $this->parseNumString($1, attributes()); } - | '-' T_NUM_STRING { $$ = $this->parseNumString('-' . $2, attributes()); } - | plain_variable { $$ = $1; } -; - -%% diff --git a/vendor/nikic/php-parser/grammar/phpyLang.php b/vendor/nikic/php-parser/grammar/phpyLang.php deleted file mode 100644 index 1a9808d..0000000 --- a/vendor/nikic/php-parser/grammar/phpyLang.php +++ /dev/null @@ -1,192 +0,0 @@ -\'[^\\\\\']*+(?:\\\\.[^\\\\\']*+)*+\') - (?"[^\\\\"]*+(?:\\\\.[^\\\\"]*+)*+") - (?(?&singleQuotedString)|(?&doubleQuotedString)) - (?/\*[^*]*+(?:\*(?!/)[^*]*+)*+\*/) - (?\{[^\'"/{}]*+(?:(?:(?&string)|(?&comment)|(?&code)|/)[^\'"/{}]*+)*+}) -)'; - -const PARAMS = '\[(?[^[\]]*+(?:\[(?¶ms)\][^[\]]*+)*+)\]'; -const ARGS = '\((?[^()]*+(?:\((?&args)\)[^()]*+)*+)\)'; - -/////////////////////////////// -/// Preprocessing functions /// -/////////////////////////////// - -function preprocessGrammar($code) { - $code = resolveNodes($code); - $code = resolveMacros($code); - $code = resolveStackAccess($code); - - return $code; -} - -function resolveNodes($code) { - return preg_replace_callback( - '~\b(?[A-Z][a-zA-Z_\\\\]++)\s*' . PARAMS . '~', - function($matches) { - // recurse - $matches['params'] = resolveNodes($matches['params']); - - $params = magicSplit( - '(?:' . PARAMS . '|' . ARGS . ')(*SKIP)(*FAIL)|,', - $matches['params'] - ); - - $paramCode = ''; - foreach ($params as $param) { - $paramCode .= $param . ', '; - } - - return 'new ' . $matches['name'] . '(' . $paramCode . 'attributes())'; - }, - $code - ); -} - -function resolveMacros($code) { - return preg_replace_callback( - '~\b(?)(?!array\()(?[a-z][A-Za-z]++)' . ARGS . '~', - function($matches) { - // recurse - $matches['args'] = resolveMacros($matches['args']); - - $name = $matches['name']; - $args = magicSplit( - '(?:' . PARAMS . '|' . ARGS . ')(*SKIP)(*FAIL)|,', - $matches['args'] - ); - - if ('attributes' === $name) { - assertArgs(0, $args, $name); - return '$this->startAttributeStack[#1] + $this->endAttributes'; - } - - if ('stackAttributes' === $name) { - assertArgs(1, $args, $name); - return '$this->startAttributeStack[' . $args[0] . ']' - . ' + $this->endAttributeStack[' . $args[0] . ']'; - } - - if ('init' === $name) { - return '$$ = array(' . implode(', ', $args) . ')'; - } - - if ('push' === $name) { - assertArgs(2, $args, $name); - - return $args[0] . '[] = ' . $args[1] . '; $$ = ' . $args[0]; - } - - if ('pushNormalizing' === $name) { - assertArgs(2, $args, $name); - - return 'if (is_array(' . $args[1] . ')) { $$ = array_merge(' . $args[0] . ', ' . $args[1] . '); }' - . ' else { ' . $args[0] . '[] = ' . $args[1] . '; $$ = ' . $args[0] . '; }'; - } - - if ('toArray' == $name) { - assertArgs(1, $args, $name); - - return 'is_array(' . $args[0] . ') ? ' . $args[0] . ' : array(' . $args[0] . ')'; - } - - if ('parseVar' === $name) { - assertArgs(1, $args, $name); - - return 'substr(' . $args[0] . ', 1)'; - } - - if ('parseEncapsed' === $name) { - assertArgs(3, $args, $name); - - return 'foreach (' . $args[0] . ' as $s) { if ($s instanceof Node\Scalar\EncapsedStringPart) {' - . ' $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, ' . $args[1] . ', ' . $args[2] . '); } }'; - } - - if ('makeNop' === $name) { - assertArgs(3, $args, $name); - - return '$startAttributes = ' . $args[1] . ';' - . ' if (isset($startAttributes[\'comments\']))' - . ' { ' . $args[0] . ' = new Stmt\Nop($startAttributes + ' . $args[2] . '); }' - . ' else { ' . $args[0] . ' = null; }'; - } - - if ('makeZeroLengthNop' == $name) { - assertArgs(2, $args, $name); - - return '$startAttributes = ' . $args[1] . ';' - . ' if (isset($startAttributes[\'comments\']))' - . ' { ' . $args[0] . ' = new Stmt\Nop($this->createCommentNopAttributes($startAttributes[\'comments\'])); }' - . ' else { ' . $args[0] . ' = null; }'; - } - - if ('strKind' === $name) { - assertArgs(1, $args, $name); - - return '(' . $args[0] . '[0] === "\'" || (' . $args[0] . '[1] === "\'" && ' - . '(' . $args[0] . '[0] === \'b\' || ' . $args[0] . '[0] === \'B\')) ' - . '? Scalar\String_::KIND_SINGLE_QUOTED : Scalar\String_::KIND_DOUBLE_QUOTED)'; - } - - if ('prependLeadingComments' === $name) { - assertArgs(1, $args, $name); - - return '$attrs = $this->startAttributeStack[#1]; $stmts = ' . $args[0] . '; ' - . 'if (!empty($attrs[\'comments\'])) {' - . '$stmts[0]->setAttribute(\'comments\', ' - . 'array_merge($attrs[\'comments\'], $stmts[0]->getAttribute(\'comments\', []))); }'; - } - - return $matches[0]; - }, - $code - ); -} - -function assertArgs($num, $args, $name) { - if ($num != count($args)) { - die('Wrong argument count for ' . $name . '().'); - } -} - -function resolveStackAccess($code) { - $code = preg_replace('/\$\d+/', '$this->semStack[$0]', $code); - $code = preg_replace('/#(\d+)/', '$$1', $code); - return $code; -} - -function removeTrailingWhitespace($code) { - $lines = explode("\n", $code); - $lines = array_map('rtrim', $lines); - return implode("\n", $lines); -} - -////////////////////////////// -/// Regex helper functions /// -////////////////////////////// - -function regex($regex) { - return '~' . LIB . '(?:' . str_replace('~', '\~', $regex) . ')~'; -} - -function magicSplit($regex, $string) { - $pieces = preg_split(regex('(?:(?&string)|(?&comment)|(?&code))(*SKIP)(*FAIL)|' . $regex), $string); - - foreach ($pieces as &$piece) { - $piece = trim($piece); - } - - if ($pieces === ['']) { - return []; - } - - return $pieces; -} diff --git a/vendor/nikic/php-parser/grammar/rebuildParsers.php b/vendor/nikic/php-parser/grammar/rebuildParsers.php deleted file mode 100644 index 2d0c6b1..0000000 --- a/vendor/nikic/php-parser/grammar/rebuildParsers.php +++ /dev/null @@ -1,81 +0,0 @@ - 'Php5', - __DIR__ . '/php7.y' => 'Php7', -]; - -$tokensFile = __DIR__ . '/tokens.y'; -$tokensTemplate = __DIR__ . '/tokens.template'; -$skeletonFile = __DIR__ . '/parser.template'; -$tmpGrammarFile = __DIR__ . '/tmp_parser.phpy'; -$tmpResultFile = __DIR__ . '/tmp_parser.php'; -$resultDir = __DIR__ . '/../lib/PhpParser/Parser'; -$tokensResultsFile = $resultDir . '/Tokens.php'; - -$kmyacc = getenv('KMYACC'); -if (!$kmyacc) { - // Use phpyacc from dev dependencies by default. - $kmyacc = __DIR__ . '/../vendor/bin/phpyacc'; -} - -$options = array_flip($argv); -$optionDebug = isset($options['--debug']); -$optionKeepTmpGrammar = isset($options['--keep-tmp-grammar']); - -/////////////////// -/// Main script /// -/////////////////// - -$tokens = file_get_contents($tokensFile); - -foreach ($grammarFileToName as $grammarFile => $name) { - echo "Building temporary $name grammar file.\n"; - - $grammarCode = file_get_contents($grammarFile); - $grammarCode = str_replace('%tokens', $tokens, $grammarCode); - $grammarCode = preprocessGrammar($grammarCode); - - file_put_contents($tmpGrammarFile, $grammarCode); - - $additionalArgs = $optionDebug ? '-t -v' : ''; - - echo "Building $name parser.\n"; - $output = execCmd("$kmyacc $additionalArgs -m $skeletonFile -p $name $tmpGrammarFile"); - - $resultCode = file_get_contents($tmpResultFile); - $resultCode = removeTrailingWhitespace($resultCode); - - ensureDirExists($resultDir); - file_put_contents("$resultDir/$name.php", $resultCode); - unlink($tmpResultFile); - - echo "Building token definition.\n"; - $output = execCmd("$kmyacc -m $tokensTemplate $tmpGrammarFile"); - rename($tmpResultFile, $tokensResultsFile); - - if (!$optionKeepTmpGrammar) { - unlink($tmpGrammarFile); - } -} - -//////////////////////////////// -/// Utility helper functions /// -//////////////////////////////// - -function ensureDirExists($dir) { - if (!is_dir($dir)) { - mkdir($dir, 0777, true); - } -} - -function execCmd($cmd) { - $output = trim(shell_exec("$cmd 2>&1")); - if ($output !== "") { - echo "> " . $cmd . "\n"; - echo $output; - } - return $output; -} diff --git a/vendor/nikic/php-parser/grammar/tokens.template b/vendor/nikic/php-parser/grammar/tokens.template deleted file mode 100644 index ba4e490..0000000 --- a/vendor/nikic/php-parser/grammar/tokens.template +++ /dev/null @@ -1,17 +0,0 @@ -semValue -#semval($,%t) $this->semValue -#semval(%n) $this->stackPos-(%l-%n) -#semval(%n,%t) $this->stackPos-(%l-%n) - -namespace PhpParser\Parser; -#include; - -/* GENERATED file based on grammar/tokens.y */ -final class Tokens -{ -#tokenval - const %s = %n; -#endtokenval -} diff --git a/vendor/nikic/php-parser/grammar/tokens.y b/vendor/nikic/php-parser/grammar/tokens.y deleted file mode 100644 index 8f0b217..0000000 --- a/vendor/nikic/php-parser/grammar/tokens.y +++ /dev/null @@ -1,115 +0,0 @@ -/* We currently rely on the token ID mapping to be the same between PHP 5 and PHP 7 - so the same lexer can be used for - * both. This is enforced by sharing this token file. */ - -%right T_THROW -%left T_INCLUDE T_INCLUDE_ONCE T_EVAL T_REQUIRE T_REQUIRE_ONCE -%left ',' -%left T_LOGICAL_OR -%left T_LOGICAL_XOR -%left T_LOGICAL_AND -%right T_PRINT -%right T_YIELD -%right T_DOUBLE_ARROW -%right T_YIELD_FROM -%left '=' T_PLUS_EQUAL T_MINUS_EQUAL T_MUL_EQUAL T_DIV_EQUAL T_CONCAT_EQUAL T_MOD_EQUAL T_AND_EQUAL T_OR_EQUAL T_XOR_EQUAL T_SL_EQUAL T_SR_EQUAL T_POW_EQUAL T_COALESCE_EQUAL -%left '?' ':' -%right T_COALESCE -%left T_BOOLEAN_OR -%left T_BOOLEAN_AND -%left '|' -%left '^' -%left T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG -%nonassoc T_IS_EQUAL T_IS_NOT_EQUAL T_IS_IDENTICAL T_IS_NOT_IDENTICAL T_SPACESHIP -%nonassoc '<' T_IS_SMALLER_OR_EQUAL '>' T_IS_GREATER_OR_EQUAL -%left T_SL T_SR -%left '+' '-' '.' -%left '*' '/' '%' -%right '!' -%nonassoc T_INSTANCEOF -%right '~' T_INC T_DEC T_INT_CAST T_DOUBLE_CAST T_STRING_CAST T_ARRAY_CAST T_OBJECT_CAST T_BOOL_CAST T_UNSET_CAST '@' -%right T_POW -%right '[' -%nonassoc T_NEW T_CLONE -%token T_EXIT -%token T_IF -%left T_ELSEIF -%left T_ELSE -%left T_ENDIF -%token T_LNUMBER -%token T_DNUMBER -%token T_STRING -%token T_STRING_VARNAME -%token T_VARIABLE -%token T_NUM_STRING -%token T_INLINE_HTML -%token T_ENCAPSED_AND_WHITESPACE -%token T_CONSTANT_ENCAPSED_STRING -%token T_ECHO -%token T_DO -%token T_WHILE -%token T_ENDWHILE -%token T_FOR -%token T_ENDFOR -%token T_FOREACH -%token T_ENDFOREACH -%token T_DECLARE -%token T_ENDDECLARE -%token T_AS -%token T_SWITCH -%token T_MATCH -%token T_ENDSWITCH -%token T_CASE -%token T_DEFAULT -%token T_BREAK -%token T_CONTINUE -%token T_GOTO -%token T_FUNCTION -%token T_FN -%token T_CONST -%token T_RETURN -%token T_TRY -%token T_CATCH -%token T_FINALLY -%token T_THROW -%token T_USE -%token T_INSTEADOF -%token T_GLOBAL -%right T_STATIC T_ABSTRACT T_FINAL T_PRIVATE T_PROTECTED T_PUBLIC T_READONLY -%token T_VAR -%token T_UNSET -%token T_ISSET -%token T_EMPTY -%token T_HALT_COMPILER -%token T_CLASS -%token T_TRAIT -%token T_INTERFACE -%token T_ENUM -%token T_EXTENDS -%token T_IMPLEMENTS -%token T_OBJECT_OPERATOR -%token T_NULLSAFE_OBJECT_OPERATOR -%token T_DOUBLE_ARROW -%token T_LIST -%token T_ARRAY -%token T_CALLABLE -%token T_CLASS_C -%token T_TRAIT_C -%token T_METHOD_C -%token T_FUNC_C -%token T_LINE -%token T_FILE -%token T_START_HEREDOC -%token T_END_HEREDOC -%token T_DOLLAR_OPEN_CURLY_BRACES -%token T_CURLY_OPEN -%token T_PAAMAYIM_NEKUDOTAYIM -%token T_NAMESPACE -%token T_NS_C -%token T_DIR -%token T_NS_SEPARATOR -%token T_ELLIPSIS -%token T_NAME_FULLY_QUALIFIED -%token T_NAME_QUALIFIED -%token T_NAME_RELATIVE -%token T_ATTRIBUTE -%token T_ENUM diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder.php b/vendor/nikic/php-parser/lib/PhpParser/Builder.php deleted file mode 100644 index 26d8921..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder.php +++ /dev/null @@ -1,13 +0,0 @@ -constants = [new Const_($name, BuilderHelpers::normalizeValue($value))]; - } - - /** - * Add another constant to const group - * - * @param string|Identifier $name Name - * @param Node\Expr|bool|null|int|float|string|array $value Value - * - * @return $this The builder instance (for fluid interface) - */ - public function addConst($name, $value) { - $this->constants[] = new Const_($name, BuilderHelpers::normalizeValue($value)); - - return $this; - } - - /** - * Makes the constant public. - * - * @return $this The builder instance (for fluid interface) - */ - public function makePublic() { - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PUBLIC); - - return $this; - } - - /** - * Makes the constant protected. - * - * @return $this The builder instance (for fluid interface) - */ - public function makeProtected() { - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PROTECTED); - - return $this; - } - - /** - * Makes the constant private. - * - * @return $this The builder instance (for fluid interface) - */ - public function makePrivate() { - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PRIVATE); - - return $this; - } - - /** - * Makes the constant final. - * - * @return $this The builder instance (for fluid interface) - */ - public function makeFinal() { - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_FINAL); - - return $this; - } - - /** - * Sets doc comment for the constant. - * - * @param PhpParser\Comment\Doc|string $docComment Doc comment to set - * - * @return $this The builder instance (for fluid interface) - */ - public function setDocComment($docComment) { - $this->attributes = [ - 'comments' => [BuilderHelpers::normalizeDocComment($docComment)] - ]; - - return $this; - } - - /** - * Adds an attribute group. - * - * @param Node\Attribute|Node\AttributeGroup $attribute - * - * @return $this The builder instance (for fluid interface) - */ - public function addAttribute($attribute) { - $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute); - - return $this; - } - - /** - * Returns the built class node. - * - * @return Stmt\ClassConst The built constant node - */ - public function getNode(): PhpParser\Node { - return new Stmt\ClassConst( - $this->constants, - $this->flags, - $this->attributes, - $this->attributeGroups - ); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/Class_.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/Class_.php deleted file mode 100644 index 87e2901..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/Class_.php +++ /dev/null @@ -1,140 +0,0 @@ -name = $name; - } - - /** - * Extends a class. - * - * @param Name|string $class Name of class to extend - * - * @return $this The builder instance (for fluid interface) - */ - public function extend($class) { - $this->extends = BuilderHelpers::normalizeName($class); - - return $this; - } - - /** - * Implements one or more interfaces. - * - * @param Name|string ...$interfaces Names of interfaces to implement - * - * @return $this The builder instance (for fluid interface) - */ - public function implement(...$interfaces) { - foreach ($interfaces as $interface) { - $this->implements[] = BuilderHelpers::normalizeName($interface); - } - - return $this; - } - - /** - * Makes the class abstract. - * - * @return $this The builder instance (for fluid interface) - */ - public function makeAbstract() { - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_ABSTRACT); - - return $this; - } - - /** - * Makes the class final. - * - * @return $this The builder instance (for fluid interface) - */ - public function makeFinal() { - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_FINAL); - - return $this; - } - - /** - * Adds a statement. - * - * @param Stmt|PhpParser\Builder $stmt The statement to add - * - * @return $this The builder instance (for fluid interface) - */ - public function addStmt($stmt) { - $stmt = BuilderHelpers::normalizeNode($stmt); - - $targets = [ - Stmt\TraitUse::class => &$this->uses, - Stmt\ClassConst::class => &$this->constants, - Stmt\Property::class => &$this->properties, - Stmt\ClassMethod::class => &$this->methods, - ]; - - $class = \get_class($stmt); - if (!isset($targets[$class])) { - throw new \LogicException(sprintf('Unexpected node of type "%s"', $stmt->getType())); - } - - $targets[$class][] = $stmt; - - return $this; - } - - /** - * Adds an attribute group. - * - * @param Node\Attribute|Node\AttributeGroup $attribute - * - * @return $this The builder instance (for fluid interface) - */ - public function addAttribute($attribute) { - $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute); - - return $this; - } - - /** - * Returns the built class node. - * - * @return Stmt\Class_ The built class node - */ - public function getNode() : PhpParser\Node { - return new Stmt\Class_($this->name, [ - 'flags' => $this->flags, - 'extends' => $this->extends, - 'implements' => $this->implements, - 'stmts' => array_merge($this->uses, $this->constants, $this->properties, $this->methods), - 'attrGroups' => $this->attributeGroups, - ], $this->attributes); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/Declaration.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/Declaration.php deleted file mode 100644 index 8309499..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/Declaration.php +++ /dev/null @@ -1,43 +0,0 @@ -addStmt($stmt); - } - - return $this; - } - - /** - * Sets doc comment for the declaration. - * - * @param PhpParser\Comment\Doc|string $docComment Doc comment to set - * - * @return $this The builder instance (for fluid interface) - */ - public function setDocComment($docComment) { - $this->attributes['comments'] = [ - BuilderHelpers::normalizeDocComment($docComment) - ]; - - return $this; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/EnumCase.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/EnumCase.php deleted file mode 100644 index 02fa83e..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/EnumCase.php +++ /dev/null @@ -1,85 +0,0 @@ -name = $name; - } - - /** - * Sets the value. - * - * @param Node\Expr|string|int $value - * - * @return $this - */ - public function setValue($value) { - $this->value = BuilderHelpers::normalizeValue($value); - - return $this; - } - - /** - * Sets doc comment for the constant. - * - * @param PhpParser\Comment\Doc|string $docComment Doc comment to set - * - * @return $this The builder instance (for fluid interface) - */ - public function setDocComment($docComment) { - $this->attributes = [ - 'comments' => [BuilderHelpers::normalizeDocComment($docComment)] - ]; - - return $this; - } - - /** - * Adds an attribute group. - * - * @param Node\Attribute|Node\AttributeGroup $attribute - * - * @return $this The builder instance (for fluid interface) - */ - public function addAttribute($attribute) { - $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute); - - return $this; - } - - /** - * Returns the built enum case node. - * - * @return Stmt\EnumCase The built constant node - */ - public function getNode(): PhpParser\Node { - return new Stmt\EnumCase( - $this->name, - $this->value, - $this->attributes, - $this->attributeGroups - ); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/Enum_.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/Enum_.php deleted file mode 100644 index be7eef9..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/Enum_.php +++ /dev/null @@ -1,117 +0,0 @@ -name = $name; - } - - /** - * Sets the scalar type. - * - * @param string|Identifier $type - * - * @return $this - */ - public function setScalarType($scalarType) { - $this->scalarType = BuilderHelpers::normalizeType($scalarType); - - return $this; - } - - /** - * Implements one or more interfaces. - * - * @param Name|string ...$interfaces Names of interfaces to implement - * - * @return $this The builder instance (for fluid interface) - */ - public function implement(...$interfaces) { - foreach ($interfaces as $interface) { - $this->implements[] = BuilderHelpers::normalizeName($interface); - } - - return $this; - } - - /** - * Adds a statement. - * - * @param Stmt|PhpParser\Builder $stmt The statement to add - * - * @return $this The builder instance (for fluid interface) - */ - public function addStmt($stmt) { - $stmt = BuilderHelpers::normalizeNode($stmt); - - $targets = [ - Stmt\TraitUse::class => &$this->uses, - Stmt\EnumCase::class => &$this->enumCases, - Stmt\ClassConst::class => &$this->constants, - Stmt\ClassMethod::class => &$this->methods, - ]; - - $class = \get_class($stmt); - if (!isset($targets[$class])) { - throw new \LogicException(sprintf('Unexpected node of type "%s"', $stmt->getType())); - } - - $targets[$class][] = $stmt; - - return $this; - } - - /** - * Adds an attribute group. - * - * @param Node\Attribute|Node\AttributeGroup $attribute - * - * @return $this The builder instance (for fluid interface) - */ - public function addAttribute($attribute) { - $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute); - - return $this; - } - - /** - * Returns the built class node. - * - * @return Stmt\Enum_ The built enum node - */ - public function getNode() : PhpParser\Node { - return new Stmt\Enum_($this->name, [ - 'scalarType' => $this->scalarType, - 'implements' => $this->implements, - 'stmts' => array_merge($this->uses, $this->enumCases, $this->constants, $this->methods), - 'attrGroups' => $this->attributeGroups, - ], $this->attributes); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/FunctionLike.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/FunctionLike.php deleted file mode 100644 index 98ea9d3..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/FunctionLike.php +++ /dev/null @@ -1,73 +0,0 @@ -returnByRef = true; - - return $this; - } - - /** - * Adds a parameter. - * - * @param Node\Param|Param $param The parameter to add - * - * @return $this The builder instance (for fluid interface) - */ - public function addParam($param) { - $param = BuilderHelpers::normalizeNode($param); - - if (!$param instanceof Node\Param) { - throw new \LogicException(sprintf('Expected parameter node, got "%s"', $param->getType())); - } - - $this->params[] = $param; - - return $this; - } - - /** - * Adds multiple parameters. - * - * @param array $params The parameters to add - * - * @return $this The builder instance (for fluid interface) - */ - public function addParams(array $params) { - foreach ($params as $param) { - $this->addParam($param); - } - - return $this; - } - - /** - * Sets the return type for PHP 7. - * - * @param string|Node\Name|Node\Identifier|Node\ComplexType $type - * - * @return $this The builder instance (for fluid interface) - */ - public function setReturnType($type) { - $this->returnType = BuilderHelpers::normalizeType($type); - - return $this; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/Function_.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/Function_.php deleted file mode 100644 index 1cd73c0..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/Function_.php +++ /dev/null @@ -1,67 +0,0 @@ -name = $name; - } - - /** - * Adds a statement. - * - * @param Node|PhpParser\Builder $stmt The statement to add - * - * @return $this The builder instance (for fluid interface) - */ - public function addStmt($stmt) { - $this->stmts[] = BuilderHelpers::normalizeStmt($stmt); - - return $this; - } - - /** - * Adds an attribute group. - * - * @param Node\Attribute|Node\AttributeGroup $attribute - * - * @return $this The builder instance (for fluid interface) - */ - public function addAttribute($attribute) { - $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute); - - return $this; - } - - /** - * Returns the built function node. - * - * @return Stmt\Function_ The built function node - */ - public function getNode() : Node { - return new Stmt\Function_($this->name, [ - 'byRef' => $this->returnByRef, - 'params' => $this->params, - 'returnType' => $this->returnType, - 'stmts' => $this->stmts, - 'attrGroups' => $this->attributeGroups, - ], $this->attributes); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/Interface_.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/Interface_.php deleted file mode 100644 index 7806e85..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/Interface_.php +++ /dev/null @@ -1,93 +0,0 @@ -name = $name; - } - - /** - * Extends one or more interfaces. - * - * @param Name|string ...$interfaces Names of interfaces to extend - * - * @return $this The builder instance (for fluid interface) - */ - public function extend(...$interfaces) { - foreach ($interfaces as $interface) { - $this->extends[] = BuilderHelpers::normalizeName($interface); - } - - return $this; - } - - /** - * Adds a statement. - * - * @param Stmt|PhpParser\Builder $stmt The statement to add - * - * @return $this The builder instance (for fluid interface) - */ - public function addStmt($stmt) { - $stmt = BuilderHelpers::normalizeNode($stmt); - - if ($stmt instanceof Stmt\ClassConst) { - $this->constants[] = $stmt; - } elseif ($stmt instanceof Stmt\ClassMethod) { - // we erase all statements in the body of an interface method - $stmt->stmts = null; - $this->methods[] = $stmt; - } else { - throw new \LogicException(sprintf('Unexpected node of type "%s"', $stmt->getType())); - } - - return $this; - } - - /** - * Adds an attribute group. - * - * @param Node\Attribute|Node\AttributeGroup $attribute - * - * @return $this The builder instance (for fluid interface) - */ - public function addAttribute($attribute) { - $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute); - - return $this; - } - - /** - * Returns the built interface node. - * - * @return Stmt\Interface_ The built interface node - */ - public function getNode() : PhpParser\Node { - return new Stmt\Interface_($this->name, [ - 'extends' => $this->extends, - 'stmts' => array_merge($this->constants, $this->methods), - 'attrGroups' => $this->attributeGroups, - ], $this->attributes); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/Method.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/Method.php deleted file mode 100644 index 232d7cb..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/Method.php +++ /dev/null @@ -1,146 +0,0 @@ -name = $name; - } - - /** - * Makes the method public. - * - * @return $this The builder instance (for fluid interface) - */ - public function makePublic() { - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PUBLIC); - - return $this; - } - - /** - * Makes the method protected. - * - * @return $this The builder instance (for fluid interface) - */ - public function makeProtected() { - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PROTECTED); - - return $this; - } - - /** - * Makes the method private. - * - * @return $this The builder instance (for fluid interface) - */ - public function makePrivate() { - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PRIVATE); - - return $this; - } - - /** - * Makes the method static. - * - * @return $this The builder instance (for fluid interface) - */ - public function makeStatic() { - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_STATIC); - - return $this; - } - - /** - * Makes the method abstract. - * - * @return $this The builder instance (for fluid interface) - */ - public function makeAbstract() { - if (!empty($this->stmts)) { - throw new \LogicException('Cannot make method with statements abstract'); - } - - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_ABSTRACT); - $this->stmts = null; // abstract methods don't have statements - - return $this; - } - - /** - * Makes the method final. - * - * @return $this The builder instance (for fluid interface) - */ - public function makeFinal() { - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_FINAL); - - return $this; - } - - /** - * Adds a statement. - * - * @param Node|PhpParser\Builder $stmt The statement to add - * - * @return $this The builder instance (for fluid interface) - */ - public function addStmt($stmt) { - if (null === $this->stmts) { - throw new \LogicException('Cannot add statements to an abstract method'); - } - - $this->stmts[] = BuilderHelpers::normalizeStmt($stmt); - - return $this; - } - - /** - * Adds an attribute group. - * - * @param Node\Attribute|Node\AttributeGroup $attribute - * - * @return $this The builder instance (for fluid interface) - */ - public function addAttribute($attribute) { - $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute); - - return $this; - } - - /** - * Returns the built method node. - * - * @return Stmt\ClassMethod The built method node - */ - public function getNode() : Node { - return new Stmt\ClassMethod($this->name, [ - 'flags' => $this->flags, - 'byRef' => $this->returnByRef, - 'params' => $this->params, - 'returnType' => $this->returnType, - 'stmts' => $this->stmts, - 'attrGroups' => $this->attributeGroups, - ], $this->attributes); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/Namespace_.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/Namespace_.php deleted file mode 100644 index 1c751e1..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/Namespace_.php +++ /dev/null @@ -1,45 +0,0 @@ -name = null !== $name ? BuilderHelpers::normalizeName($name) : null; - } - - /** - * Adds a statement. - * - * @param Node|PhpParser\Builder $stmt The statement to add - * - * @return $this The builder instance (for fluid interface) - */ - public function addStmt($stmt) { - $this->stmts[] = BuilderHelpers::normalizeStmt($stmt); - - return $this; - } - - /** - * Returns the built node. - * - * @return Stmt\Namespace_ The built node - */ - public function getNode() : Node { - return new Stmt\Namespace_($this->name, $this->stmts, $this->attributes); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/Param.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/Param.php deleted file mode 100644 index de9aae7..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/Param.php +++ /dev/null @@ -1,122 +0,0 @@ -name = $name; - } - - /** - * Sets default value for the parameter. - * - * @param mixed $value Default value to use - * - * @return $this The builder instance (for fluid interface) - */ - public function setDefault($value) { - $this->default = BuilderHelpers::normalizeValue($value); - - return $this; - } - - /** - * Sets type for the parameter. - * - * @param string|Node\Name|Node\Identifier|Node\ComplexType $type Parameter type - * - * @return $this The builder instance (for fluid interface) - */ - public function setType($type) { - $this->type = BuilderHelpers::normalizeType($type); - if ($this->type == 'void') { - throw new \LogicException('Parameter type cannot be void'); - } - - return $this; - } - - /** - * Sets type for the parameter. - * - * @param string|Node\Name|Node\Identifier|Node\ComplexType $type Parameter type - * - * @return $this The builder instance (for fluid interface) - * - * @deprecated Use setType() instead - */ - public function setTypeHint($type) { - return $this->setType($type); - } - - /** - * Make the parameter accept the value by reference. - * - * @return $this The builder instance (for fluid interface) - */ - public function makeByRef() { - $this->byRef = true; - - return $this; - } - - /** - * Make the parameter variadic - * - * @return $this The builder instance (for fluid interface) - */ - public function makeVariadic() { - $this->variadic = true; - - return $this; - } - - /** - * Adds an attribute group. - * - * @param Node\Attribute|Node\AttributeGroup $attribute - * - * @return $this The builder instance (for fluid interface) - */ - public function addAttribute($attribute) { - $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute); - - return $this; - } - - /** - * Returns the built parameter node. - * - * @return Node\Param The built parameter node - */ - public function getNode() : Node { - return new Node\Param( - new Node\Expr\Variable($this->name), - $this->default, $this->type, $this->byRef, $this->variadic, [], 0, $this->attributeGroups - ); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/Property.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/Property.php deleted file mode 100644 index 68e3185..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/Property.php +++ /dev/null @@ -1,161 +0,0 @@ -name = $name; - } - - /** - * Makes the property public. - * - * @return $this The builder instance (for fluid interface) - */ - public function makePublic() { - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PUBLIC); - - return $this; - } - - /** - * Makes the property protected. - * - * @return $this The builder instance (for fluid interface) - */ - public function makeProtected() { - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PROTECTED); - - return $this; - } - - /** - * Makes the property private. - * - * @return $this The builder instance (for fluid interface) - */ - public function makePrivate() { - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PRIVATE); - - return $this; - } - - /** - * Makes the property static. - * - * @return $this The builder instance (for fluid interface) - */ - public function makeStatic() { - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_STATIC); - - return $this; - } - - /** - * Makes the property readonly. - * - * @return $this The builder instance (for fluid interface) - */ - public function makeReadonly() { - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_READONLY); - - return $this; - } - - /** - * Sets default value for the property. - * - * @param mixed $value Default value to use - * - * @return $this The builder instance (for fluid interface) - */ - public function setDefault($value) { - $this->default = BuilderHelpers::normalizeValue($value); - - return $this; - } - - /** - * Sets doc comment for the property. - * - * @param PhpParser\Comment\Doc|string $docComment Doc comment to set - * - * @return $this The builder instance (for fluid interface) - */ - public function setDocComment($docComment) { - $this->attributes = [ - 'comments' => [BuilderHelpers::normalizeDocComment($docComment)] - ]; - - return $this; - } - - /** - * Sets the property type for PHP 7.4+. - * - * @param string|Name|Identifier|ComplexType $type - * - * @return $this - */ - public function setType($type) { - $this->type = BuilderHelpers::normalizeType($type); - - return $this; - } - - /** - * Adds an attribute group. - * - * @param Node\Attribute|Node\AttributeGroup $attribute - * - * @return $this The builder instance (for fluid interface) - */ - public function addAttribute($attribute) { - $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute); - - return $this; - } - - /** - * Returns the built class node. - * - * @return Stmt\Property The built property node - */ - public function getNode() : PhpParser\Node { - return new Stmt\Property( - $this->flags !== 0 ? $this->flags : Stmt\Class_::MODIFIER_PUBLIC, - [ - new Stmt\PropertyProperty($this->name, $this->default) - ], - $this->attributes, - $this->type, - $this->attributeGroups - ); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/TraitUse.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/TraitUse.php deleted file mode 100644 index 311e8cd..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/TraitUse.php +++ /dev/null @@ -1,64 +0,0 @@ -and($trait); - } - } - - /** - * Adds used trait. - * - * @param Node\Name|string $trait Trait name - * - * @return $this The builder instance (for fluid interface) - */ - public function and($trait) { - $this->traits[] = BuilderHelpers::normalizeName($trait); - return $this; - } - - /** - * Adds trait adaptation. - * - * @param Stmt\TraitUseAdaptation|Builder\TraitUseAdaptation $adaptation Trait adaptation - * - * @return $this The builder instance (for fluid interface) - */ - public function with($adaptation) { - $adaptation = BuilderHelpers::normalizeNode($adaptation); - - if (!$adaptation instanceof Stmt\TraitUseAdaptation) { - throw new \LogicException('Adaptation must have type TraitUseAdaptation'); - } - - $this->adaptations[] = $adaptation; - return $this; - } - - /** - * Returns the built node. - * - * @return Node The built node - */ - public function getNode() : Node { - return new Stmt\TraitUse($this->traits, $this->adaptations); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/TraitUseAdaptation.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/TraitUseAdaptation.php deleted file mode 100644 index eb6c0b6..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/TraitUseAdaptation.php +++ /dev/null @@ -1,148 +0,0 @@ -type = self::TYPE_UNDEFINED; - - $this->trait = is_null($trait)? null: BuilderHelpers::normalizeName($trait); - $this->method = BuilderHelpers::normalizeIdentifier($method); - } - - /** - * Sets alias of method. - * - * @param Node\Identifier|string $alias Alias for adaptated method - * - * @return $this The builder instance (for fluid interface) - */ - public function as($alias) { - if ($this->type === self::TYPE_UNDEFINED) { - $this->type = self::TYPE_ALIAS; - } - - if ($this->type !== self::TYPE_ALIAS) { - throw new \LogicException('Cannot set alias for not alias adaptation buider'); - } - - $this->alias = $alias; - return $this; - } - - /** - * Sets adaptated method public. - * - * @return $this The builder instance (for fluid interface) - */ - public function makePublic() { - $this->setModifier(Stmt\Class_::MODIFIER_PUBLIC); - return $this; - } - - /** - * Sets adaptated method protected. - * - * @return $this The builder instance (for fluid interface) - */ - public function makeProtected() { - $this->setModifier(Stmt\Class_::MODIFIER_PROTECTED); - return $this; - } - - /** - * Sets adaptated method private. - * - * @return $this The builder instance (for fluid interface) - */ - public function makePrivate() { - $this->setModifier(Stmt\Class_::MODIFIER_PRIVATE); - return $this; - } - - /** - * Adds overwritten traits. - * - * @param Node\Name|string ...$traits Traits for overwrite - * - * @return $this The builder instance (for fluid interface) - */ - public function insteadof(...$traits) { - if ($this->type === self::TYPE_UNDEFINED) { - if (is_null($this->trait)) { - throw new \LogicException('Precedence adaptation must have trait'); - } - - $this->type = self::TYPE_PRECEDENCE; - } - - if ($this->type !== self::TYPE_PRECEDENCE) { - throw new \LogicException('Cannot add overwritten traits for not precedence adaptation buider'); - } - - foreach ($traits as $trait) { - $this->insteadof[] = BuilderHelpers::normalizeName($trait); - } - - return $this; - } - - protected function setModifier(int $modifier) { - if ($this->type === self::TYPE_UNDEFINED) { - $this->type = self::TYPE_ALIAS; - } - - if ($this->type !== self::TYPE_ALIAS) { - throw new \LogicException('Cannot set access modifier for not alias adaptation buider'); - } - - if (is_null($this->modifier)) { - $this->modifier = $modifier; - } else { - throw new \LogicException('Multiple access type modifiers are not allowed'); - } - } - - /** - * Returns the built node. - * - * @return Node The built node - */ - public function getNode() : Node { - switch ($this->type) { - case self::TYPE_ALIAS: - return new Stmt\TraitUseAdaptation\Alias($this->trait, $this->method, $this->modifier, $this->alias); - case self::TYPE_PRECEDENCE: - return new Stmt\TraitUseAdaptation\Precedence($this->trait, $this->method, $this->insteadof); - default: - throw new \LogicException('Type of adaptation is not defined'); - } - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/Trait_.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/Trait_.php deleted file mode 100644 index 97f32f9..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/Trait_.php +++ /dev/null @@ -1,78 +0,0 @@ -name = $name; - } - - /** - * Adds a statement. - * - * @param Stmt|PhpParser\Builder $stmt The statement to add - * - * @return $this The builder instance (for fluid interface) - */ - public function addStmt($stmt) { - $stmt = BuilderHelpers::normalizeNode($stmt); - - if ($stmt instanceof Stmt\Property) { - $this->properties[] = $stmt; - } elseif ($stmt instanceof Stmt\ClassMethod) { - $this->methods[] = $stmt; - } elseif ($stmt instanceof Stmt\TraitUse) { - $this->uses[] = $stmt; - } else { - throw new \LogicException(sprintf('Unexpected node of type "%s"', $stmt->getType())); - } - - return $this; - } - - /** - * Adds an attribute group. - * - * @param Node\Attribute|Node\AttributeGroup $attribute - * - * @return $this The builder instance (for fluid interface) - */ - public function addAttribute($attribute) { - $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute); - - return $this; - } - - /** - * Returns the built trait node. - * - * @return Stmt\Trait_ The built interface node - */ - public function getNode() : PhpParser\Node { - return new Stmt\Trait_( - $this->name, [ - 'stmts' => array_merge($this->uses, $this->properties, $this->methods), - 'attrGroups' => $this->attributeGroups, - ], $this->attributes - ); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/Use_.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/Use_.php deleted file mode 100644 index 4bd3d12..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/Use_.php +++ /dev/null @@ -1,49 +0,0 @@ -name = BuilderHelpers::normalizeName($name); - $this->type = $type; - } - - /** - * Sets alias for used name. - * - * @param string $alias Alias to use (last component of full name by default) - * - * @return $this The builder instance (for fluid interface) - */ - public function as(string $alias) { - $this->alias = $alias; - return $this; - } - - /** - * Returns the built node. - * - * @return Stmt\Use_ The built node - */ - public function getNode() : Node { - return new Stmt\Use_([ - new Stmt\UseUse($this->name, $this->alias) - ], $this->type); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/BuilderFactory.php b/vendor/nikic/php-parser/lib/PhpParser/BuilderFactory.php deleted file mode 100644 index fef2579..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/BuilderFactory.php +++ /dev/null @@ -1,399 +0,0 @@ -args($args) - ); - } - - /** - * Creates a namespace builder. - * - * @param null|string|Node\Name $name Name of the namespace - * - * @return Builder\Namespace_ The created namespace builder - */ - public function namespace($name) : Builder\Namespace_ { - return new Builder\Namespace_($name); - } - - /** - * Creates a class builder. - * - * @param string $name Name of the class - * - * @return Builder\Class_ The created class builder - */ - public function class(string $name) : Builder\Class_ { - return new Builder\Class_($name); - } - - /** - * Creates an interface builder. - * - * @param string $name Name of the interface - * - * @return Builder\Interface_ The created interface builder - */ - public function interface(string $name) : Builder\Interface_ { - return new Builder\Interface_($name); - } - - /** - * Creates a trait builder. - * - * @param string $name Name of the trait - * - * @return Builder\Trait_ The created trait builder - */ - public function trait(string $name) : Builder\Trait_ { - return new Builder\Trait_($name); - } - - /** - * Creates an enum builder. - * - * @param string $name Name of the enum - * - * @return Builder\Enum_ The created enum builder - */ - public function enum(string $name) : Builder\Enum_ { - return new Builder\Enum_($name); - } - - /** - * Creates a trait use builder. - * - * @param Node\Name|string ...$traits Trait names - * - * @return Builder\TraitUse The create trait use builder - */ - public function useTrait(...$traits) : Builder\TraitUse { - return new Builder\TraitUse(...$traits); - } - - /** - * Creates a trait use adaptation builder. - * - * @param Node\Name|string|null $trait Trait name - * @param Node\Identifier|string $method Method name - * - * @return Builder\TraitUseAdaptation The create trait use adaptation builder - */ - public function traitUseAdaptation($trait, $method = null) : Builder\TraitUseAdaptation { - if ($method === null) { - $method = $trait; - $trait = null; - } - - return new Builder\TraitUseAdaptation($trait, $method); - } - - /** - * Creates a method builder. - * - * @param string $name Name of the method - * - * @return Builder\Method The created method builder - */ - public function method(string $name) : Builder\Method { - return new Builder\Method($name); - } - - /** - * Creates a parameter builder. - * - * @param string $name Name of the parameter - * - * @return Builder\Param The created parameter builder - */ - public function param(string $name) : Builder\Param { - return new Builder\Param($name); - } - - /** - * Creates a property builder. - * - * @param string $name Name of the property - * - * @return Builder\Property The created property builder - */ - public function property(string $name) : Builder\Property { - return new Builder\Property($name); - } - - /** - * Creates a function builder. - * - * @param string $name Name of the function - * - * @return Builder\Function_ The created function builder - */ - public function function(string $name) : Builder\Function_ { - return new Builder\Function_($name); - } - - /** - * Creates a namespace/class use builder. - * - * @param Node\Name|string $name Name of the entity (namespace or class) to alias - * - * @return Builder\Use_ The created use builder - */ - public function use($name) : Builder\Use_ { - return new Builder\Use_($name, Use_::TYPE_NORMAL); - } - - /** - * Creates a function use builder. - * - * @param Node\Name|string $name Name of the function to alias - * - * @return Builder\Use_ The created use function builder - */ - public function useFunction($name) : Builder\Use_ { - return new Builder\Use_($name, Use_::TYPE_FUNCTION); - } - - /** - * Creates a constant use builder. - * - * @param Node\Name|string $name Name of the const to alias - * - * @return Builder\Use_ The created use const builder - */ - public function useConst($name) : Builder\Use_ { - return new Builder\Use_($name, Use_::TYPE_CONSTANT); - } - - /** - * Creates a class constant builder. - * - * @param string|Identifier $name Name - * @param Node\Expr|bool|null|int|float|string|array $value Value - * - * @return Builder\ClassConst The created use const builder - */ - public function classConst($name, $value) : Builder\ClassConst { - return new Builder\ClassConst($name, $value); - } - - /** - * Creates an enum case builder. - * - * @param string|Identifier $name Name - * - * @return Builder\EnumCase The created use const builder - */ - public function enumCase($name) : Builder\EnumCase { - return new Builder\EnumCase($name); - } - - /** - * Creates node a for a literal value. - * - * @param Expr|bool|null|int|float|string|array $value $value - * - * @return Expr - */ - public function val($value) : Expr { - return BuilderHelpers::normalizeValue($value); - } - - /** - * Creates variable node. - * - * @param string|Expr $name Name - * - * @return Expr\Variable - */ - public function var($name) : Expr\Variable { - if (!\is_string($name) && !$name instanceof Expr) { - throw new \LogicException('Variable name must be string or Expr'); - } - - return new Expr\Variable($name); - } - - /** - * Normalizes an argument list. - * - * Creates Arg nodes for all arguments and converts literal values to expressions. - * - * @param array $args List of arguments to normalize - * - * @return Arg[] - */ - public function args(array $args) : array { - $normalizedArgs = []; - foreach ($args as $key => $arg) { - if (!($arg instanceof Arg)) { - $arg = new Arg(BuilderHelpers::normalizeValue($arg)); - } - if (\is_string($key)) { - $arg->name = BuilderHelpers::normalizeIdentifier($key); - } - $normalizedArgs[] = $arg; - } - return $normalizedArgs; - } - - /** - * Creates a function call node. - * - * @param string|Name|Expr $name Function name - * @param array $args Function arguments - * - * @return Expr\FuncCall - */ - public function funcCall($name, array $args = []) : Expr\FuncCall { - return new Expr\FuncCall( - BuilderHelpers::normalizeNameOrExpr($name), - $this->args($args) - ); - } - - /** - * Creates a method call node. - * - * @param Expr $var Variable the method is called on - * @param string|Identifier|Expr $name Method name - * @param array $args Method arguments - * - * @return Expr\MethodCall - */ - public function methodCall(Expr $var, $name, array $args = []) : Expr\MethodCall { - return new Expr\MethodCall( - $var, - BuilderHelpers::normalizeIdentifierOrExpr($name), - $this->args($args) - ); - } - - /** - * Creates a static method call node. - * - * @param string|Name|Expr $class Class name - * @param string|Identifier|Expr $name Method name - * @param array $args Method arguments - * - * @return Expr\StaticCall - */ - public function staticCall($class, $name, array $args = []) : Expr\StaticCall { - return new Expr\StaticCall( - BuilderHelpers::normalizeNameOrExpr($class), - BuilderHelpers::normalizeIdentifierOrExpr($name), - $this->args($args) - ); - } - - /** - * Creates an object creation node. - * - * @param string|Name|Expr $class Class name - * @param array $args Constructor arguments - * - * @return Expr\New_ - */ - public function new($class, array $args = []) : Expr\New_ { - return new Expr\New_( - BuilderHelpers::normalizeNameOrExpr($class), - $this->args($args) - ); - } - - /** - * Creates a constant fetch node. - * - * @param string|Name $name Constant name - * - * @return Expr\ConstFetch - */ - public function constFetch($name) : Expr\ConstFetch { - return new Expr\ConstFetch(BuilderHelpers::normalizeName($name)); - } - - /** - * Creates a property fetch node. - * - * @param Expr $var Variable holding object - * @param string|Identifier|Expr $name Property name - * - * @return Expr\PropertyFetch - */ - public function propertyFetch(Expr $var, $name) : Expr\PropertyFetch { - return new Expr\PropertyFetch($var, BuilderHelpers::normalizeIdentifierOrExpr($name)); - } - - /** - * Creates a class constant fetch node. - * - * @param string|Name|Expr $class Class name - * @param string|Identifier $name Constant name - * - * @return Expr\ClassConstFetch - */ - public function classConstFetch($class, $name): Expr\ClassConstFetch { - return new Expr\ClassConstFetch( - BuilderHelpers::normalizeNameOrExpr($class), - BuilderHelpers::normalizeIdentifier($name) - ); - } - - /** - * Creates nested Concat nodes from a list of expressions. - * - * @param Expr|string ...$exprs Expressions or literal strings - * - * @return Concat - */ - public function concat(...$exprs) : Concat { - $numExprs = count($exprs); - if ($numExprs < 2) { - throw new \LogicException('Expected at least two expressions'); - } - - $lastConcat = $this->normalizeStringExpr($exprs[0]); - for ($i = 1; $i < $numExprs; $i++) { - $lastConcat = new Concat($lastConcat, $this->normalizeStringExpr($exprs[$i])); - } - return $lastConcat; - } - - /** - * @param string|Expr $expr - * @return Expr - */ - private function normalizeStringExpr($expr) : Expr { - if ($expr instanceof Expr) { - return $expr; - } - - if (\is_string($expr)) { - return new String_($expr); - } - - throw new \LogicException('Expected string or Expr'); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/BuilderHelpers.php b/vendor/nikic/php-parser/lib/PhpParser/BuilderHelpers.php deleted file mode 100644 index 2f0e912..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/BuilderHelpers.php +++ /dev/null @@ -1,313 +0,0 @@ -getNode(); - } - - if ($node instanceof Node) { - return $node; - } - - throw new \LogicException('Expected node or builder object'); - } - - /** - * Normalizes a node to a statement. - * - * Expressions are wrapped in a Stmt\Expression node. - * - * @param Node|Builder $node The node to normalize - * - * @return Stmt The normalized statement node - */ - public static function normalizeStmt($node) : Stmt { - $node = self::normalizeNode($node); - if ($node instanceof Stmt) { - return $node; - } - - if ($node instanceof Expr) { - return new Stmt\Expression($node); - } - - throw new \LogicException('Expected statement or expression node'); - } - - /** - * Normalizes strings to Identifier. - * - * @param string|Identifier $name The identifier to normalize - * - * @return Identifier The normalized identifier - */ - public static function normalizeIdentifier($name) : Identifier { - if ($name instanceof Identifier) { - return $name; - } - - if (\is_string($name)) { - return new Identifier($name); - } - - throw new \LogicException('Expected string or instance of Node\Identifier'); - } - - /** - * Normalizes strings to Identifier, also allowing expressions. - * - * @param string|Identifier|Expr $name The identifier to normalize - * - * @return Identifier|Expr The normalized identifier or expression - */ - public static function normalizeIdentifierOrExpr($name) { - if ($name instanceof Identifier || $name instanceof Expr) { - return $name; - } - - if (\is_string($name)) { - return new Identifier($name); - } - - throw new \LogicException('Expected string or instance of Node\Identifier or Node\Expr'); - } - - /** - * Normalizes a name: Converts string names to Name nodes. - * - * @param Name|string $name The name to normalize - * - * @return Name The normalized name - */ - public static function normalizeName($name) : Name { - if ($name instanceof Name) { - return $name; - } - - if (is_string($name)) { - if (!$name) { - throw new \LogicException('Name cannot be empty'); - } - - if ($name[0] === '\\') { - return new Name\FullyQualified(substr($name, 1)); - } - - if (0 === strpos($name, 'namespace\\')) { - return new Name\Relative(substr($name, strlen('namespace\\'))); - } - - return new Name($name); - } - - throw new \LogicException('Name must be a string or an instance of Node\Name'); - } - - /** - * Normalizes a name: Converts string names to Name nodes, while also allowing expressions. - * - * @param Expr|Name|string $name The name to normalize - * - * @return Name|Expr The normalized name or expression - */ - public static function normalizeNameOrExpr($name) { - if ($name instanceof Expr) { - return $name; - } - - if (!is_string($name) && !($name instanceof Name)) { - throw new \LogicException( - 'Name must be a string or an instance of Node\Name or Node\Expr' - ); - } - - return self::normalizeName($name); - } - - /** - * Normalizes a type: Converts plain-text type names into proper AST representation. - * - * In particular, builtin types become Identifiers, custom types become Names and nullables - * are wrapped in NullableType nodes. - * - * @param string|Name|Identifier|ComplexType $type The type to normalize - * - * @return Name|Identifier|ComplexType The normalized type - */ - public static function normalizeType($type) { - if (!is_string($type)) { - if ( - !$type instanceof Name && !$type instanceof Identifier && - !$type instanceof ComplexType - ) { - throw new \LogicException( - 'Type must be a string, or an instance of Name, Identifier or ComplexType' - ); - } - return $type; - } - - $nullable = false; - if (strlen($type) > 0 && $type[0] === '?') { - $nullable = true; - $type = substr($type, 1); - } - - $builtinTypes = [ - 'array', 'callable', 'string', 'int', 'float', 'bool', 'iterable', 'void', 'object', 'mixed', 'never', - ]; - - $lowerType = strtolower($type); - if (in_array($lowerType, $builtinTypes)) { - $type = new Identifier($lowerType); - } else { - $type = self::normalizeName($type); - } - - $notNullableTypes = [ - 'void', 'mixed', 'never', - ]; - if ($nullable && in_array((string) $type, $notNullableTypes)) { - throw new \LogicException(sprintf('%s type cannot be nullable', $type)); - } - - return $nullable ? new NullableType($type) : $type; - } - - /** - * Normalizes a value: Converts nulls, booleans, integers, - * floats, strings and arrays into their respective nodes - * - * @param Node\Expr|bool|null|int|float|string|array $value The value to normalize - * - * @return Expr The normalized value - */ - public static function normalizeValue($value) : Expr { - if ($value instanceof Node\Expr) { - return $value; - } - - if (is_null($value)) { - return new Expr\ConstFetch( - new Name('null') - ); - } - - if (is_bool($value)) { - return new Expr\ConstFetch( - new Name($value ? 'true' : 'false') - ); - } - - if (is_int($value)) { - return new Scalar\LNumber($value); - } - - if (is_float($value)) { - return new Scalar\DNumber($value); - } - - if (is_string($value)) { - return new Scalar\String_($value); - } - - if (is_array($value)) { - $items = []; - $lastKey = -1; - foreach ($value as $itemKey => $itemValue) { - // for consecutive, numeric keys don't generate keys - if (null !== $lastKey && ++$lastKey === $itemKey) { - $items[] = new Expr\ArrayItem( - self::normalizeValue($itemValue) - ); - } else { - $lastKey = null; - $items[] = new Expr\ArrayItem( - self::normalizeValue($itemValue), - self::normalizeValue($itemKey) - ); - } - } - - return new Expr\Array_($items); - } - - throw new \LogicException('Invalid value'); - } - - /** - * Normalizes a doc comment: Converts plain strings to PhpParser\Comment\Doc. - * - * @param Comment\Doc|string $docComment The doc comment to normalize - * - * @return Comment\Doc The normalized doc comment - */ - public static function normalizeDocComment($docComment) : Comment\Doc { - if ($docComment instanceof Comment\Doc) { - return $docComment; - } - - if (is_string($docComment)) { - return new Comment\Doc($docComment); - } - - throw new \LogicException('Doc comment must be a string or an instance of PhpParser\Comment\Doc'); - } - - /** - * Normalizes a attribute: Converts attribute to the Attribute Group if needed. - * - * @param Node\Attribute|Node\AttributeGroup $attribute - * - * @return Node\AttributeGroup The Attribute Group - */ - public static function normalizeAttribute($attribute) : Node\AttributeGroup - { - if ($attribute instanceof Node\AttributeGroup) { - return $attribute; - } - - if (!($attribute instanceof Node\Attribute)) { - throw new \LogicException('Attribute must be an instance of PhpParser\Node\Attribute or PhpParser\Node\AttributeGroup'); - } - - return new Node\AttributeGroup([$attribute]); - } - - /** - * Adds a modifier and returns new modifier bitmask. - * - * @param int $modifiers Existing modifiers - * @param int $modifier Modifier to set - * - * @return int New modifiers - */ - public static function addModifier(int $modifiers, int $modifier) : int { - Stmt\Class_::verifyModifier($modifiers, $modifier); - return $modifiers | $modifier; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Comment.php b/vendor/nikic/php-parser/lib/PhpParser/Comment.php deleted file mode 100644 index 61e98d3..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Comment.php +++ /dev/null @@ -1,239 +0,0 @@ -text = $text; - $this->startLine = $startLine; - $this->startFilePos = $startFilePos; - $this->startTokenPos = $startTokenPos; - $this->endLine = $endLine; - $this->endFilePos = $endFilePos; - $this->endTokenPos = $endTokenPos; - } - - /** - * Gets the comment text. - * - * @return string The comment text (including comment delimiters like /*) - */ - public function getText() : string { - return $this->text; - } - - /** - * Gets the line number the comment started on. - * - * @return int Line number (or -1 if not available) - */ - public function getStartLine() : int { - return $this->startLine; - } - - /** - * Gets the file offset the comment started on. - * - * @return int File offset (or -1 if not available) - */ - public function getStartFilePos() : int { - return $this->startFilePos; - } - - /** - * Gets the token offset the comment started on. - * - * @return int Token offset (or -1 if not available) - */ - public function getStartTokenPos() : int { - return $this->startTokenPos; - } - - /** - * Gets the line number the comment ends on. - * - * @return int Line number (or -1 if not available) - */ - public function getEndLine() : int { - return $this->endLine; - } - - /** - * Gets the file offset the comment ends on. - * - * @return int File offset (or -1 if not available) - */ - public function getEndFilePos() : int { - return $this->endFilePos; - } - - /** - * Gets the token offset the comment ends on. - * - * @return int Token offset (or -1 if not available) - */ - public function getEndTokenPos() : int { - return $this->endTokenPos; - } - - /** - * Gets the line number the comment started on. - * - * @deprecated Use getStartLine() instead - * - * @return int Line number - */ - public function getLine() : int { - return $this->startLine; - } - - /** - * Gets the file offset the comment started on. - * - * @deprecated Use getStartFilePos() instead - * - * @return int File offset - */ - public function getFilePos() : int { - return $this->startFilePos; - } - - /** - * Gets the token offset the comment started on. - * - * @deprecated Use getStartTokenPos() instead - * - * @return int Token offset - */ - public function getTokenPos() : int { - return $this->startTokenPos; - } - - /** - * Gets the comment text. - * - * @return string The comment text (including comment delimiters like /*) - */ - public function __toString() : string { - return $this->text; - } - - /** - * Gets the reformatted comment text. - * - * "Reformatted" here means that we try to clean up the whitespace at the - * starts of the lines. This is necessary because we receive the comments - * without trailing whitespace on the first line, but with trailing whitespace - * on all subsequent lines. - * - * @return mixed|string - */ - public function getReformattedText() { - $text = trim($this->text); - $newlinePos = strpos($text, "\n"); - if (false === $newlinePos) { - // Single line comments don't need further processing - return $text; - } elseif (preg_match('((*BSR_ANYCRLF)(*ANYCRLF)^.*(?:\R\s+\*.*)+$)', $text)) { - // Multi line comment of the type - // - // /* - // * Some text. - // * Some more text. - // */ - // - // is handled by replacing the whitespace sequences before the * by a single space - return preg_replace('(^\s+\*)m', ' *', $this->text); - } elseif (preg_match('(^/\*\*?\s*[\r\n])', $text) && preg_match('(\n(\s*)\*/$)', $text, $matches)) { - // Multi line comment of the type - // - // /* - // Some text. - // Some more text. - // */ - // - // is handled by removing the whitespace sequence on the line before the closing - // */ on all lines. So if the last line is " */", then " " is removed at the - // start of all lines. - return preg_replace('(^' . preg_quote($matches[1]) . ')m', '', $text); - } elseif (preg_match('(^/\*\*?\s*(?!\s))', $text, $matches)) { - // Multi line comment of the type - // - // /* Some text. - // Some more text. - // Indented text. - // Even more text. */ - // - // is handled by removing the difference between the shortest whitespace prefix on all - // lines and the length of the "/* " opening sequence. - $prefixLen = $this->getShortestWhitespacePrefixLen(substr($text, $newlinePos + 1)); - $removeLen = $prefixLen - strlen($matches[0]); - return preg_replace('(^\s{' . $removeLen . '})m', '', $text); - } - - // No idea how to format this comment, so simply return as is - return $text; - } - - /** - * Get length of shortest whitespace prefix (at the start of a line). - * - * If there is a line with no prefix whitespace, 0 is a valid return value. - * - * @param string $str String to check - * @return int Length in characters. Tabs count as single characters. - */ - private function getShortestWhitespacePrefixLen(string $str) : int { - $lines = explode("\n", $str); - $shortestPrefixLen = \INF; - foreach ($lines as $line) { - preg_match('(^\s*)', $line, $matches); - $prefixLen = strlen($matches[0]); - if ($prefixLen < $shortestPrefixLen) { - $shortestPrefixLen = $prefixLen; - } - } - return $shortestPrefixLen; - } - - /** - * @return array - * @psalm-return array{nodeType:string, text:mixed, line:mixed, filePos:mixed} - */ - public function jsonSerialize() : array { - // Technically not a node, but we make it look like one anyway - $type = $this instanceof Comment\Doc ? 'Comment_Doc' : 'Comment'; - return [ - 'nodeType' => $type, - 'text' => $this->text, - // TODO: Rename these to include "start". - 'line' => $this->startLine, - 'filePos' => $this->startFilePos, - 'tokenPos' => $this->startTokenPos, - 'endLine' => $this->endLine, - 'endFilePos' => $this->endFilePos, - 'endTokenPos' => $this->endTokenPos, - ]; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Comment/Doc.php b/vendor/nikic/php-parser/lib/PhpParser/Comment/Doc.php deleted file mode 100644 index a9db612..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Comment/Doc.php +++ /dev/null @@ -1,7 +0,0 @@ -fallbackEvaluator = $fallbackEvaluator ?? function(Expr $expr) { - throw new ConstExprEvaluationException( - "Expression of type {$expr->getType()} cannot be evaluated" - ); - }; - } - - /** - * Silently evaluates a constant expression into a PHP value. - * - * Thrown Errors, warnings or notices will be converted into a ConstExprEvaluationException. - * The original source of the exception is available through getPrevious(). - * - * If some part of the expression cannot be evaluated, the fallback evaluator passed to the - * constructor will be invoked. By default, if no fallback is provided, an exception of type - * ConstExprEvaluationException is thrown. - * - * See class doc comment for caveats and limitations. - * - * @param Expr $expr Constant expression to evaluate - * @return mixed Result of evaluation - * - * @throws ConstExprEvaluationException if the expression cannot be evaluated or an error occurred - */ - public function evaluateSilently(Expr $expr) { - set_error_handler(function($num, $str, $file, $line) { - throw new \ErrorException($str, 0, $num, $file, $line); - }); - - try { - return $this->evaluate($expr); - } catch (\Throwable $e) { - if (!$e instanceof ConstExprEvaluationException) { - $e = new ConstExprEvaluationException( - "An error occurred during constant expression evaluation", 0, $e); - } - throw $e; - } finally { - restore_error_handler(); - } - } - - /** - * Directly evaluates a constant expression into a PHP value. - * - * May generate Error exceptions, warnings or notices. Use evaluateSilently() to convert these - * into a ConstExprEvaluationException. - * - * If some part of the expression cannot be evaluated, the fallback evaluator passed to the - * constructor will be invoked. By default, if no fallback is provided, an exception of type - * ConstExprEvaluationException is thrown. - * - * See class doc comment for caveats and limitations. - * - * @param Expr $expr Constant expression to evaluate - * @return mixed Result of evaluation - * - * @throws ConstExprEvaluationException if the expression cannot be evaluated - */ - public function evaluateDirectly(Expr $expr) { - return $this->evaluate($expr); - } - - private function evaluate(Expr $expr) { - if ($expr instanceof Scalar\LNumber - || $expr instanceof Scalar\DNumber - || $expr instanceof Scalar\String_ - ) { - return $expr->value; - } - - if ($expr instanceof Expr\Array_) { - return $this->evaluateArray($expr); - } - - // Unary operators - if ($expr instanceof Expr\UnaryPlus) { - return +$this->evaluate($expr->expr); - } - if ($expr instanceof Expr\UnaryMinus) { - return -$this->evaluate($expr->expr); - } - if ($expr instanceof Expr\BooleanNot) { - return !$this->evaluate($expr->expr); - } - if ($expr instanceof Expr\BitwiseNot) { - return ~$this->evaluate($expr->expr); - } - - if ($expr instanceof Expr\BinaryOp) { - return $this->evaluateBinaryOp($expr); - } - - if ($expr instanceof Expr\Ternary) { - return $this->evaluateTernary($expr); - } - - if ($expr instanceof Expr\ArrayDimFetch && null !== $expr->dim) { - return $this->evaluate($expr->var)[$this->evaluate($expr->dim)]; - } - - if ($expr instanceof Expr\ConstFetch) { - return $this->evaluateConstFetch($expr); - } - - return ($this->fallbackEvaluator)($expr); - } - - private function evaluateArray(Expr\Array_ $expr) { - $array = []; - foreach ($expr->items as $item) { - if (null !== $item->key) { - $array[$this->evaluate($item->key)] = $this->evaluate($item->value); - } elseif ($item->unpack) { - $array = array_merge($array, $this->evaluate($item->value)); - } else { - $array[] = $this->evaluate($item->value); - } - } - return $array; - } - - private function evaluateTernary(Expr\Ternary $expr) { - if (null === $expr->if) { - return $this->evaluate($expr->cond) ?: $this->evaluate($expr->else); - } - - return $this->evaluate($expr->cond) - ? $this->evaluate($expr->if) - : $this->evaluate($expr->else); - } - - private function evaluateBinaryOp(Expr\BinaryOp $expr) { - if ($expr instanceof Expr\BinaryOp\Coalesce - && $expr->left instanceof Expr\ArrayDimFetch - ) { - // This needs to be special cased to respect BP_VAR_IS fetch semantics - return $this->evaluate($expr->left->var)[$this->evaluate($expr->left->dim)] - ?? $this->evaluate($expr->right); - } - - // The evaluate() calls are repeated in each branch, because some of the operators are - // short-circuiting and evaluating the RHS in advance may be illegal in that case - $l = $expr->left; - $r = $expr->right; - switch ($expr->getOperatorSigil()) { - case '&': return $this->evaluate($l) & $this->evaluate($r); - case '|': return $this->evaluate($l) | $this->evaluate($r); - case '^': return $this->evaluate($l) ^ $this->evaluate($r); - case '&&': return $this->evaluate($l) && $this->evaluate($r); - case '||': return $this->evaluate($l) || $this->evaluate($r); - case '??': return $this->evaluate($l) ?? $this->evaluate($r); - case '.': return $this->evaluate($l) . $this->evaluate($r); - case '/': return $this->evaluate($l) / $this->evaluate($r); - case '==': return $this->evaluate($l) == $this->evaluate($r); - case '>': return $this->evaluate($l) > $this->evaluate($r); - case '>=': return $this->evaluate($l) >= $this->evaluate($r); - case '===': return $this->evaluate($l) === $this->evaluate($r); - case 'and': return $this->evaluate($l) and $this->evaluate($r); - case 'or': return $this->evaluate($l) or $this->evaluate($r); - case 'xor': return $this->evaluate($l) xor $this->evaluate($r); - case '-': return $this->evaluate($l) - $this->evaluate($r); - case '%': return $this->evaluate($l) % $this->evaluate($r); - case '*': return $this->evaluate($l) * $this->evaluate($r); - case '!=': return $this->evaluate($l) != $this->evaluate($r); - case '!==': return $this->evaluate($l) !== $this->evaluate($r); - case '+': return $this->evaluate($l) + $this->evaluate($r); - case '**': return $this->evaluate($l) ** $this->evaluate($r); - case '<<': return $this->evaluate($l) << $this->evaluate($r); - case '>>': return $this->evaluate($l) >> $this->evaluate($r); - case '<': return $this->evaluate($l) < $this->evaluate($r); - case '<=': return $this->evaluate($l) <= $this->evaluate($r); - case '<=>': return $this->evaluate($l) <=> $this->evaluate($r); - } - - throw new \Exception('Should not happen'); - } - - private function evaluateConstFetch(Expr\ConstFetch $expr) { - $name = $expr->name->toLowerString(); - switch ($name) { - case 'null': return null; - case 'false': return false; - case 'true': return true; - } - - return ($this->fallbackEvaluator)($expr); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Error.php b/vendor/nikic/php-parser/lib/PhpParser/Error.php deleted file mode 100644 index d1fb959..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Error.php +++ /dev/null @@ -1,180 +0,0 @@ -rawMessage = $message; - if (is_array($attributes)) { - $this->attributes = $attributes; - } else { - $this->attributes = ['startLine' => $attributes]; - } - $this->updateMessage(); - } - - /** - * Gets the error message - * - * @return string Error message - */ - public function getRawMessage() : string { - return $this->rawMessage; - } - - /** - * Gets the line the error starts in. - * - * @return int Error start line - */ - public function getStartLine() : int { - return $this->attributes['startLine'] ?? -1; - } - - /** - * Gets the line the error ends in. - * - * @return int Error end line - */ - public function getEndLine() : int { - return $this->attributes['endLine'] ?? -1; - } - - /** - * Gets the attributes of the node/token the error occurred at. - * - * @return array - */ - public function getAttributes() : array { - return $this->attributes; - } - - /** - * Sets the attributes of the node/token the error occurred at. - * - * @param array $attributes - */ - public function setAttributes(array $attributes) { - $this->attributes = $attributes; - $this->updateMessage(); - } - - /** - * Sets the line of the PHP file the error occurred in. - * - * @param string $message Error message - */ - public function setRawMessage(string $message) { - $this->rawMessage = $message; - $this->updateMessage(); - } - - /** - * Sets the line the error starts in. - * - * @param int $line Error start line - */ - public function setStartLine(int $line) { - $this->attributes['startLine'] = $line; - $this->updateMessage(); - } - - /** - * Returns whether the error has start and end column information. - * - * For column information enable the startFilePos and endFilePos in the lexer options. - * - * @return bool - */ - public function hasColumnInfo() : bool { - return isset($this->attributes['startFilePos'], $this->attributes['endFilePos']); - } - - /** - * Gets the start column (1-based) into the line where the error started. - * - * @param string $code Source code of the file - * @return int - */ - public function getStartColumn(string $code) : int { - if (!$this->hasColumnInfo()) { - throw new \RuntimeException('Error does not have column information'); - } - - return $this->toColumn($code, $this->attributes['startFilePos']); - } - - /** - * Gets the end column (1-based) into the line where the error ended. - * - * @param string $code Source code of the file - * @return int - */ - public function getEndColumn(string $code) : int { - if (!$this->hasColumnInfo()) { - throw new \RuntimeException('Error does not have column information'); - } - - return $this->toColumn($code, $this->attributes['endFilePos']); - } - - /** - * Formats message including line and column information. - * - * @param string $code Source code associated with the error, for calculation of the columns - * - * @return string Formatted message - */ - public function getMessageWithColumnInfo(string $code) : string { - return sprintf( - '%s from %d:%d to %d:%d', $this->getRawMessage(), - $this->getStartLine(), $this->getStartColumn($code), - $this->getEndLine(), $this->getEndColumn($code) - ); - } - - /** - * Converts a file offset into a column. - * - * @param string $code Source code that $pos indexes into - * @param int $pos 0-based position in $code - * - * @return int 1-based column (relative to start of line) - */ - private function toColumn(string $code, int $pos) : int { - if ($pos > strlen($code)) { - throw new \RuntimeException('Invalid position information'); - } - - $lineStartPos = strrpos($code, "\n", $pos - strlen($code)); - if (false === $lineStartPos) { - $lineStartPos = -1; - } - - return $pos - $lineStartPos; - } - - /** - * Updates the exception message after a change to rawMessage or rawLine. - */ - protected function updateMessage() { - $this->message = $this->rawMessage; - - if (-1 === $this->getStartLine()) { - $this->message .= ' on unknown line'; - } else { - $this->message .= ' on line ' . $this->getStartLine(); - } - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler.php b/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler.php deleted file mode 100644 index d620e74..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler.php +++ /dev/null @@ -1,13 +0,0 @@ -errors[] = $error; - } - - /** - * Get collected errors. - * - * @return Error[] - */ - public function getErrors() : array { - return $this->errors; - } - - /** - * Check whether there are any errors. - * - * @return bool - */ - public function hasErrors() : bool { - return !empty($this->errors); - } - - /** - * Reset/clear collected errors. - */ - public function clearErrors() { - $this->errors = []; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler/Throwing.php b/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler/Throwing.php deleted file mode 100644 index aeee989..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler/Throwing.php +++ /dev/null @@ -1,18 +0,0 @@ -type = $type; - $this->old = $old; - $this->new = $new; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Internal/Differ.php b/vendor/nikic/php-parser/lib/PhpParser/Internal/Differ.php deleted file mode 100644 index 7f218c7..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Internal/Differ.php +++ /dev/null @@ -1,164 +0,0 @@ -isEqual = $isEqual; - } - - /** - * Calculate diff (edit script) from $old to $new. - * - * @param array $old Original array - * @param array $new New array - * - * @return DiffElem[] Diff (edit script) - */ - public function diff(array $old, array $new) { - list($trace, $x, $y) = $this->calculateTrace($old, $new); - return $this->extractDiff($trace, $x, $y, $old, $new); - } - - /** - * Calculate diff, including "replace" operations. - * - * If a sequence of remove operations is followed by the same number of add operations, these - * will be coalesced into replace operations. - * - * @param array $old Original array - * @param array $new New array - * - * @return DiffElem[] Diff (edit script), including replace operations - */ - public function diffWithReplacements(array $old, array $new) { - return $this->coalesceReplacements($this->diff($old, $new)); - } - - private function calculateTrace(array $a, array $b) { - $n = \count($a); - $m = \count($b); - $max = $n + $m; - $v = [1 => 0]; - $trace = []; - for ($d = 0; $d <= $max; $d++) { - $trace[] = $v; - for ($k = -$d; $k <= $d; $k += 2) { - if ($k === -$d || ($k !== $d && $v[$k-1] < $v[$k+1])) { - $x = $v[$k+1]; - } else { - $x = $v[$k-1] + 1; - } - - $y = $x - $k; - while ($x < $n && $y < $m && ($this->isEqual)($a[$x], $b[$y])) { - $x++; - $y++; - } - - $v[$k] = $x; - if ($x >= $n && $y >= $m) { - return [$trace, $x, $y]; - } - } - } - throw new \Exception('Should not happen'); - } - - private function extractDiff(array $trace, int $x, int $y, array $a, array $b) { - $result = []; - for ($d = \count($trace) - 1; $d >= 0; $d--) { - $v = $trace[$d]; - $k = $x - $y; - - if ($k === -$d || ($k !== $d && $v[$k-1] < $v[$k+1])) { - $prevK = $k + 1; - } else { - $prevK = $k - 1; - } - - $prevX = $v[$prevK]; - $prevY = $prevX - $prevK; - - while ($x > $prevX && $y > $prevY) { - $result[] = new DiffElem(DiffElem::TYPE_KEEP, $a[$x-1], $b[$y-1]); - $x--; - $y--; - } - - if ($d === 0) { - break; - } - - while ($x > $prevX) { - $result[] = new DiffElem(DiffElem::TYPE_REMOVE, $a[$x-1], null); - $x--; - } - - while ($y > $prevY) { - $result[] = new DiffElem(DiffElem::TYPE_ADD, null, $b[$y-1]); - $y--; - } - } - return array_reverse($result); - } - - /** - * Coalesce equal-length sequences of remove+add into a replace operation. - * - * @param DiffElem[] $diff - * @return DiffElem[] - */ - private function coalesceReplacements(array $diff) { - $newDiff = []; - $c = \count($diff); - for ($i = 0; $i < $c; $i++) { - $diffType = $diff[$i]->type; - if ($diffType !== DiffElem::TYPE_REMOVE) { - $newDiff[] = $diff[$i]; - continue; - } - - $j = $i; - while ($j < $c && $diff[$j]->type === DiffElem::TYPE_REMOVE) { - $j++; - } - - $k = $j; - while ($k < $c && $diff[$k]->type === DiffElem::TYPE_ADD) { - $k++; - } - - if ($j - $i === $k - $j) { - $len = $j - $i; - for ($n = 0; $n < $len; $n++) { - $newDiff[] = new DiffElem( - DiffElem::TYPE_REPLACE, $diff[$i + $n]->old, $diff[$j + $n]->new - ); - } - } else { - for (; $i < $k; $i++) { - $newDiff[] = $diff[$i]; - } - } - $i = $k - 1; - } - return $newDiff; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php b/vendor/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php deleted file mode 100644 index 3eeac04..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php +++ /dev/null @@ -1,61 +0,0 @@ -attrGroups = $attrGroups; - $this->args = $args; - $this->extends = $extends; - $this->implements = $implements; - $this->stmts = $stmts; - } - - public static function fromNewNode(Expr\New_ $newNode) { - $class = $newNode->class; - assert($class instanceof Node\Stmt\Class_); - // We don't assert that $class->name is null here, to allow consumers to assign unique names - // to anonymous classes for their own purposes. We simplify ignore the name here. - return new self( - $class->attrGroups, $newNode->args, $class->extends, $class->implements, - $class->stmts, $newNode->getAttributes() - ); - } - - public function getType() : string { - return 'Expr_PrintableNewAnonClass'; - } - - public function getSubNodeNames() : array { - return ['attrGroups', 'args', 'extends', 'implements', 'stmts']; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Internal/TokenStream.php b/vendor/nikic/php-parser/lib/PhpParser/Internal/TokenStream.php deleted file mode 100644 index 84c0175..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Internal/TokenStream.php +++ /dev/null @@ -1,281 +0,0 @@ -tokens = $tokens; - $this->indentMap = $this->calcIndentMap(); - } - - /** - * Whether the given position is immediately surrounded by parenthesis. - * - * @param int $startPos Start position - * @param int $endPos End position - * - * @return bool - */ - public function haveParens(int $startPos, int $endPos) : bool { - return $this->haveTokenImmediatelyBefore($startPos, '(') - && $this->haveTokenImmediatelyAfter($endPos, ')'); - } - - /** - * Whether the given position is immediately surrounded by braces. - * - * @param int $startPos Start position - * @param int $endPos End position - * - * @return bool - */ - public function haveBraces(int $startPos, int $endPos) : bool { - return ($this->haveTokenImmediatelyBefore($startPos, '{') - || $this->haveTokenImmediatelyBefore($startPos, T_CURLY_OPEN)) - && $this->haveTokenImmediatelyAfter($endPos, '}'); - } - - /** - * Check whether the position is directly preceded by a certain token type. - * - * During this check whitespace and comments are skipped. - * - * @param int $pos Position before which the token should occur - * @param int|string $expectedTokenType Token to check for - * - * @return bool Whether the expected token was found - */ - public function haveTokenImmediatelyBefore(int $pos, $expectedTokenType) : bool { - $tokens = $this->tokens; - $pos--; - for (; $pos >= 0; $pos--) { - $tokenType = $tokens[$pos][0]; - if ($tokenType === $expectedTokenType) { - return true; - } - if ($tokenType !== \T_WHITESPACE - && $tokenType !== \T_COMMENT && $tokenType !== \T_DOC_COMMENT) { - break; - } - } - return false; - } - - /** - * Check whether the position is directly followed by a certain token type. - * - * During this check whitespace and comments are skipped. - * - * @param int $pos Position after which the token should occur - * @param int|string $expectedTokenType Token to check for - * - * @return bool Whether the expected token was found - */ - public function haveTokenImmediatelyAfter(int $pos, $expectedTokenType) : bool { - $tokens = $this->tokens; - $pos++; - for (; $pos < \count($tokens); $pos++) { - $tokenType = $tokens[$pos][0]; - if ($tokenType === $expectedTokenType) { - return true; - } - if ($tokenType !== \T_WHITESPACE - && $tokenType !== \T_COMMENT && $tokenType !== \T_DOC_COMMENT) { - break; - } - } - return false; - } - - public function skipLeft(int $pos, $skipTokenType) { - $tokens = $this->tokens; - - $pos = $this->skipLeftWhitespace($pos); - if ($skipTokenType === \T_WHITESPACE) { - return $pos; - } - - if ($tokens[$pos][0] !== $skipTokenType) { - // Shouldn't happen. The skip token MUST be there - throw new \Exception('Encountered unexpected token'); - } - $pos--; - - return $this->skipLeftWhitespace($pos); - } - - public function skipRight(int $pos, $skipTokenType) { - $tokens = $this->tokens; - - $pos = $this->skipRightWhitespace($pos); - if ($skipTokenType === \T_WHITESPACE) { - return $pos; - } - - if ($tokens[$pos][0] !== $skipTokenType) { - // Shouldn't happen. The skip token MUST be there - throw new \Exception('Encountered unexpected token'); - } - $pos++; - - return $this->skipRightWhitespace($pos); - } - - /** - * Return first non-whitespace token position smaller or equal to passed position. - * - * @param int $pos Token position - * @return int Non-whitespace token position - */ - public function skipLeftWhitespace(int $pos) { - $tokens = $this->tokens; - for (; $pos >= 0; $pos--) { - $type = $tokens[$pos][0]; - if ($type !== \T_WHITESPACE && $type !== \T_COMMENT && $type !== \T_DOC_COMMENT) { - break; - } - } - return $pos; - } - - /** - * Return first non-whitespace position greater or equal to passed position. - * - * @param int $pos Token position - * @return int Non-whitespace token position - */ - public function skipRightWhitespace(int $pos) { - $tokens = $this->tokens; - for ($count = \count($tokens); $pos < $count; $pos++) { - $type = $tokens[$pos][0]; - if ($type !== \T_WHITESPACE && $type !== \T_COMMENT && $type !== \T_DOC_COMMENT) { - break; - } - } - return $pos; - } - - public function findRight(int $pos, $findTokenType) { - $tokens = $this->tokens; - for ($count = \count($tokens); $pos < $count; $pos++) { - $type = $tokens[$pos][0]; - if ($type === $findTokenType) { - return $pos; - } - } - return -1; - } - - /** - * Whether the given position range contains a certain token type. - * - * @param int $startPos Starting position (inclusive) - * @param int $endPos Ending position (exclusive) - * @param int|string $tokenType Token type to look for - * @return bool Whether the token occurs in the given range - */ - public function haveTokenInRange(int $startPos, int $endPos, $tokenType) { - $tokens = $this->tokens; - for ($pos = $startPos; $pos < $endPos; $pos++) { - if ($tokens[$pos][0] === $tokenType) { - return true; - } - } - return false; - } - - public function haveBracesInRange(int $startPos, int $endPos) { - return $this->haveTokenInRange($startPos, $endPos, '{') - || $this->haveTokenInRange($startPos, $endPos, T_CURLY_OPEN) - || $this->haveTokenInRange($startPos, $endPos, '}'); - } - - /** - * Get indentation before token position. - * - * @param int $pos Token position - * - * @return int Indentation depth (in spaces) - */ - public function getIndentationBefore(int $pos) : int { - return $this->indentMap[$pos]; - } - - /** - * Get the code corresponding to a token offset range, optionally adjusted for indentation. - * - * @param int $from Token start position (inclusive) - * @param int $to Token end position (exclusive) - * @param int $indent By how much the code should be indented (can be negative as well) - * - * @return string Code corresponding to token range, adjusted for indentation - */ - public function getTokenCode(int $from, int $to, int $indent) : string { - $tokens = $this->tokens; - $result = ''; - for ($pos = $from; $pos < $to; $pos++) { - $token = $tokens[$pos]; - if (\is_array($token)) { - $type = $token[0]; - $content = $token[1]; - if ($type === \T_CONSTANT_ENCAPSED_STRING || $type === \T_ENCAPSED_AND_WHITESPACE) { - $result .= $content; - } else { - // TODO Handle non-space indentation - if ($indent < 0) { - $result .= str_replace("\n" . str_repeat(" ", -$indent), "\n", $content); - } elseif ($indent > 0) { - $result .= str_replace("\n", "\n" . str_repeat(" ", $indent), $content); - } else { - $result .= $content; - } - } - } else { - $result .= $token; - } - } - return $result; - } - - /** - * Precalculate the indentation at every token position. - * - * @return int[] Token position to indentation map - */ - private function calcIndentMap() { - $indentMap = []; - $indent = 0; - foreach ($this->tokens as $token) { - $indentMap[] = $indent; - - if ($token[0] === \T_WHITESPACE) { - $content = $token[1]; - $newlinePos = \strrpos($content, "\n"); - if (false !== $newlinePos) { - $indent = \strlen($content) - $newlinePos - 1; - } - } - } - - // Add a sentinel for one past end of the file - $indentMap[] = $indent; - - return $indentMap; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/JsonDecoder.php b/vendor/nikic/php-parser/lib/PhpParser/JsonDecoder.php deleted file mode 100644 index 47d2003..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/JsonDecoder.php +++ /dev/null @@ -1,103 +0,0 @@ -decodeRecursive($value); - } - - private function decodeRecursive($value) { - if (\is_array($value)) { - if (isset($value['nodeType'])) { - if ($value['nodeType'] === 'Comment' || $value['nodeType'] === 'Comment_Doc') { - return $this->decodeComment($value); - } - return $this->decodeNode($value); - } - return $this->decodeArray($value); - } - return $value; - } - - private function decodeArray(array $array) : array { - $decodedArray = []; - foreach ($array as $key => $value) { - $decodedArray[$key] = $this->decodeRecursive($value); - } - return $decodedArray; - } - - private function decodeNode(array $value) : Node { - $nodeType = $value['nodeType']; - if (!\is_string($nodeType)) { - throw new \RuntimeException('Node type must be a string'); - } - - $reflectionClass = $this->reflectionClassFromNodeType($nodeType); - /** @var Node $node */ - $node = $reflectionClass->newInstanceWithoutConstructor(); - - if (isset($value['attributes'])) { - if (!\is_array($value['attributes'])) { - throw new \RuntimeException('Attributes must be an array'); - } - - $node->setAttributes($this->decodeArray($value['attributes'])); - } - - foreach ($value as $name => $subNode) { - if ($name === 'nodeType' || $name === 'attributes') { - continue; - } - - $node->$name = $this->decodeRecursive($subNode); - } - - return $node; - } - - private function decodeComment(array $value) : Comment { - $className = $value['nodeType'] === 'Comment' ? Comment::class : Comment\Doc::class; - if (!isset($value['text'])) { - throw new \RuntimeException('Comment must have text'); - } - - return new $className( - $value['text'], - $value['line'] ?? -1, $value['filePos'] ?? -1, $value['tokenPos'] ?? -1, - $value['endLine'] ?? -1, $value['endFilePos'] ?? -1, $value['endTokenPos'] ?? -1 - ); - } - - private function reflectionClassFromNodeType(string $nodeType) : \ReflectionClass { - if (!isset($this->reflectionClassCache[$nodeType])) { - $className = $this->classNameFromNodeType($nodeType); - $this->reflectionClassCache[$nodeType] = new \ReflectionClass($className); - } - return $this->reflectionClassCache[$nodeType]; - } - - private function classNameFromNodeType(string $nodeType) : string { - $className = 'PhpParser\\Node\\' . strtr($nodeType, '_', '\\'); - if (class_exists($className)) { - return $className; - } - - $className .= '_'; - if (class_exists($className)) { - return $className; - } - - throw new \RuntimeException("Unknown node type \"$nodeType\""); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer.php deleted file mode 100644 index e15dd0a..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Lexer.php +++ /dev/null @@ -1,560 +0,0 @@ -defineCompatibilityTokens(); - $this->tokenMap = $this->createTokenMap(); - $this->identifierTokens = $this->createIdentifierTokenMap(); - - // map of tokens to drop while lexing (the map is only used for isset lookup, - // that's why the value is simply set to 1; the value is never actually used.) - $this->dropTokens = array_fill_keys( - [\T_WHITESPACE, \T_OPEN_TAG, \T_COMMENT, \T_DOC_COMMENT, \T_BAD_CHARACTER], 1 - ); - - $defaultAttributes = ['comments', 'startLine', 'endLine']; - $usedAttributes = array_fill_keys($options['usedAttributes'] ?? $defaultAttributes, true); - - // Create individual boolean properties to make these checks faster. - $this->attributeStartLineUsed = isset($usedAttributes['startLine']); - $this->attributeEndLineUsed = isset($usedAttributes['endLine']); - $this->attributeStartTokenPosUsed = isset($usedAttributes['startTokenPos']); - $this->attributeEndTokenPosUsed = isset($usedAttributes['endTokenPos']); - $this->attributeStartFilePosUsed = isset($usedAttributes['startFilePos']); - $this->attributeEndFilePosUsed = isset($usedAttributes['endFilePos']); - $this->attributeCommentsUsed = isset($usedAttributes['comments']); - } - - /** - * Initializes the lexer for lexing the provided source code. - * - * This function does not throw if lexing errors occur. Instead, errors may be retrieved using - * the getErrors() method. - * - * @param string $code The source code to lex - * @param ErrorHandler|null $errorHandler Error handler to use for lexing errors. Defaults to - * ErrorHandler\Throwing - */ - public function startLexing(string $code, ErrorHandler $errorHandler = null) { - if (null === $errorHandler) { - $errorHandler = new ErrorHandler\Throwing(); - } - - $this->code = $code; // keep the code around for __halt_compiler() handling - $this->pos = -1; - $this->line = 1; - $this->filePos = 0; - - // If inline HTML occurs without preceding code, treat it as if it had a leading newline. - // This ensures proper composability, because having a newline is the "safe" assumption. - $this->prevCloseTagHasNewline = true; - - $scream = ini_set('xdebug.scream', '0'); - - $this->tokens = @token_get_all($code); - $this->postprocessTokens($errorHandler); - - if (false !== $scream) { - ini_set('xdebug.scream', $scream); - } - } - - private function handleInvalidCharacterRange($start, $end, $line, ErrorHandler $errorHandler) { - $tokens = []; - for ($i = $start; $i < $end; $i++) { - $chr = $this->code[$i]; - if ($chr === "\0") { - // PHP cuts error message after null byte, so need special case - $errorMsg = 'Unexpected null byte'; - } else { - $errorMsg = sprintf( - 'Unexpected character "%s" (ASCII %d)', $chr, ord($chr) - ); - } - - $tokens[] = [\T_BAD_CHARACTER, $chr, $line]; - $errorHandler->handleError(new Error($errorMsg, [ - 'startLine' => $line, - 'endLine' => $line, - 'startFilePos' => $i, - 'endFilePos' => $i, - ])); - } - return $tokens; - } - - /** - * Check whether comment token is unterminated. - * - * @return bool - */ - private function isUnterminatedComment($token) : bool { - return ($token[0] === \T_COMMENT || $token[0] === \T_DOC_COMMENT) - && substr($token[1], 0, 2) === '/*' - && substr($token[1], -2) !== '*/'; - } - - protected function postprocessTokens(ErrorHandler $errorHandler) { - // PHP's error handling for token_get_all() is rather bad, so if we want detailed - // error information we need to compute it ourselves. Invalid character errors are - // detected by finding "gaps" in the token array. Unterminated comments are detected - // by checking if a trailing comment has a "*/" at the end. - // - // Additionally, we perform a number of canonicalizations here: - // * Use the PHP 8.0 comment format, which does not include trailing whitespace anymore. - // * Use PHP 8.0 T_NAME_* tokens. - // * Use PHP 8.1 T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG and - // T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG tokens used to disambiguate intersection types. - - $filePos = 0; - $line = 1; - $numTokens = \count($this->tokens); - for ($i = 0; $i < $numTokens; $i++) { - $token = $this->tokens[$i]; - - // Since PHP 7.4 invalid characters are represented by a T_BAD_CHARACTER token. - // In this case we only need to emit an error. - if ($token[0] === \T_BAD_CHARACTER) { - $this->handleInvalidCharacterRange($filePos, $filePos + 1, $line, $errorHandler); - } - - if ($token[0] === \T_COMMENT && substr($token[1], 0, 2) !== '/*' - && preg_match('/(\r\n|\n|\r)$/D', $token[1], $matches)) { - $trailingNewline = $matches[0]; - $token[1] = substr($token[1], 0, -strlen($trailingNewline)); - $this->tokens[$i] = $token; - if (isset($this->tokens[$i + 1]) && $this->tokens[$i + 1][0] === \T_WHITESPACE) { - // Move trailing newline into following T_WHITESPACE token, if it already exists. - $this->tokens[$i + 1][1] = $trailingNewline . $this->tokens[$i + 1][1]; - $this->tokens[$i + 1][2]--; - } else { - // Otherwise, we need to create a new T_WHITESPACE token. - array_splice($this->tokens, $i + 1, 0, [ - [\T_WHITESPACE, $trailingNewline, $line], - ]); - $numTokens++; - } - } - - // Emulate PHP 8 T_NAME_* tokens, by combining sequences of T_NS_SEPARATOR and T_STRING - // into a single token. - if (\is_array($token) - && ($token[0] === \T_NS_SEPARATOR || isset($this->identifierTokens[$token[0]]))) { - $lastWasSeparator = $token[0] === \T_NS_SEPARATOR; - $text = $token[1]; - for ($j = $i + 1; isset($this->tokens[$j]); $j++) { - if ($lastWasSeparator) { - if (!isset($this->identifierTokens[$this->tokens[$j][0]])) { - break; - } - $lastWasSeparator = false; - } else { - if ($this->tokens[$j][0] !== \T_NS_SEPARATOR) { - break; - } - $lastWasSeparator = true; - } - $text .= $this->tokens[$j][1]; - } - if ($lastWasSeparator) { - // Trailing separator is not part of the name. - $j--; - $text = substr($text, 0, -1); - } - if ($j > $i + 1) { - if ($token[0] === \T_NS_SEPARATOR) { - $type = \T_NAME_FULLY_QUALIFIED; - } else if ($token[0] === \T_NAMESPACE) { - $type = \T_NAME_RELATIVE; - } else { - $type = \T_NAME_QUALIFIED; - } - $token = [$type, $text, $line]; - array_splice($this->tokens, $i, $j - $i, [$token]); - $numTokens -= $j - $i - 1; - } - } - - if ($token === '&') { - $next = $i + 1; - while (isset($this->tokens[$next]) && $this->tokens[$next][0] === \T_WHITESPACE) { - $next++; - } - $followedByVarOrVarArg = isset($this->tokens[$next]) && - ($this->tokens[$next][0] === \T_VARIABLE || $this->tokens[$next][0] === \T_ELLIPSIS); - $this->tokens[$i] = $token = [ - $followedByVarOrVarArg - ? \T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG - : \T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG, - '&', - $line, - ]; - } - - $tokenValue = \is_string($token) ? $token : $token[1]; - $tokenLen = \strlen($tokenValue); - - if (substr($this->code, $filePos, $tokenLen) !== $tokenValue) { - // Something is missing, must be an invalid character - $nextFilePos = strpos($this->code, $tokenValue, $filePos); - $badCharTokens = $this->handleInvalidCharacterRange( - $filePos, $nextFilePos, $line, $errorHandler); - $filePos = (int) $nextFilePos; - - array_splice($this->tokens, $i, 0, $badCharTokens); - $numTokens += \count($badCharTokens); - $i += \count($badCharTokens); - } - - $filePos += $tokenLen; - $line += substr_count($tokenValue, "\n"); - } - - if ($filePos !== \strlen($this->code)) { - if (substr($this->code, $filePos, 2) === '/*') { - // Unlike PHP, HHVM will drop unterminated comments entirely - $comment = substr($this->code, $filePos); - $errorHandler->handleError(new Error('Unterminated comment', [ - 'startLine' => $line, - 'endLine' => $line + substr_count($comment, "\n"), - 'startFilePos' => $filePos, - 'endFilePos' => $filePos + \strlen($comment), - ])); - - // Emulate the PHP behavior - $isDocComment = isset($comment[3]) && $comment[3] === '*'; - $this->tokens[] = [$isDocComment ? \T_DOC_COMMENT : \T_COMMENT, $comment, $line]; - } else { - // Invalid characters at the end of the input - $badCharTokens = $this->handleInvalidCharacterRange( - $filePos, \strlen($this->code), $line, $errorHandler); - $this->tokens = array_merge($this->tokens, $badCharTokens); - } - return; - } - - if (count($this->tokens) > 0) { - // Check for unterminated comment - $lastToken = $this->tokens[count($this->tokens) - 1]; - if ($this->isUnterminatedComment($lastToken)) { - $errorHandler->handleError(new Error('Unterminated comment', [ - 'startLine' => $line - substr_count($lastToken[1], "\n"), - 'endLine' => $line, - 'startFilePos' => $filePos - \strlen($lastToken[1]), - 'endFilePos' => $filePos, - ])); - } - } - } - - /** - * Fetches the next token. - * - * The available attributes are determined by the 'usedAttributes' option, which can - * be specified in the constructor. The following attributes are supported: - * - * * 'comments' => Array of PhpParser\Comment or PhpParser\Comment\Doc instances, - * representing all comments that occurred between the previous - * non-discarded token and the current one. - * * 'startLine' => Line in which the node starts. - * * 'endLine' => Line in which the node ends. - * * 'startTokenPos' => Offset into the token array of the first token in the node. - * * 'endTokenPos' => Offset into the token array of the last token in the node. - * * 'startFilePos' => Offset into the code string of the first character that is part of the node. - * * 'endFilePos' => Offset into the code string of the last character that is part of the node. - * - * @param mixed $value Variable to store token content in - * @param mixed $startAttributes Variable to store start attributes in - * @param mixed $endAttributes Variable to store end attributes in - * - * @return int Token id - */ - public function getNextToken(&$value = null, &$startAttributes = null, &$endAttributes = null) : int { - $startAttributes = []; - $endAttributes = []; - - while (1) { - if (isset($this->tokens[++$this->pos])) { - $token = $this->tokens[$this->pos]; - } else { - // EOF token with ID 0 - $token = "\0"; - } - - if ($this->attributeStartLineUsed) { - $startAttributes['startLine'] = $this->line; - } - if ($this->attributeStartTokenPosUsed) { - $startAttributes['startTokenPos'] = $this->pos; - } - if ($this->attributeStartFilePosUsed) { - $startAttributes['startFilePos'] = $this->filePos; - } - - if (\is_string($token)) { - $value = $token; - if (isset($token[1])) { - // bug in token_get_all - $this->filePos += 2; - $id = ord('"'); - } else { - $this->filePos += 1; - $id = ord($token); - } - } elseif (!isset($this->dropTokens[$token[0]])) { - $value = $token[1]; - $id = $this->tokenMap[$token[0]]; - if (\T_CLOSE_TAG === $token[0]) { - $this->prevCloseTagHasNewline = false !== strpos($token[1], "\n") - || false !== strpos($token[1], "\r"); - } elseif (\T_INLINE_HTML === $token[0]) { - $startAttributes['hasLeadingNewline'] = $this->prevCloseTagHasNewline; - } - - $this->line += substr_count($value, "\n"); - $this->filePos += \strlen($value); - } else { - $origLine = $this->line; - $origFilePos = $this->filePos; - $this->line += substr_count($token[1], "\n"); - $this->filePos += \strlen($token[1]); - - if (\T_COMMENT === $token[0] || \T_DOC_COMMENT === $token[0]) { - if ($this->attributeCommentsUsed) { - $comment = \T_DOC_COMMENT === $token[0] - ? new Comment\Doc($token[1], - $origLine, $origFilePos, $this->pos, - $this->line, $this->filePos - 1, $this->pos) - : new Comment($token[1], - $origLine, $origFilePos, $this->pos, - $this->line, $this->filePos - 1, $this->pos); - $startAttributes['comments'][] = $comment; - } - } - continue; - } - - if ($this->attributeEndLineUsed) { - $endAttributes['endLine'] = $this->line; - } - if ($this->attributeEndTokenPosUsed) { - $endAttributes['endTokenPos'] = $this->pos; - } - if ($this->attributeEndFilePosUsed) { - $endAttributes['endFilePos'] = $this->filePos - 1; - } - - return $id; - } - - throw new \RuntimeException('Reached end of lexer loop'); - } - - /** - * Returns the token array for current code. - * - * The token array is in the same format as provided by the - * token_get_all() function and does not discard tokens (i.e. - * whitespace and comments are included). The token position - * attributes are against this token array. - * - * @return array Array of tokens in token_get_all() format - */ - public function getTokens() : array { - return $this->tokens; - } - - /** - * Handles __halt_compiler() by returning the text after it. - * - * @return string Remaining text - */ - public function handleHaltCompiler() : string { - // text after T_HALT_COMPILER, still including (); - $textAfter = substr($this->code, $this->filePos); - - // ensure that it is followed by (); - // this simplifies the situation, by not allowing any comments - // in between of the tokens. - if (!preg_match('~^\s*\(\s*\)\s*(?:;|\?>\r?\n?)~', $textAfter, $matches)) { - throw new Error('__HALT_COMPILER must be followed by "();"'); - } - - // prevent the lexer from returning any further tokens - $this->pos = count($this->tokens); - - // return with (); removed - return substr($textAfter, strlen($matches[0])); - } - - private function defineCompatibilityTokens() { - static $compatTokensDefined = false; - if ($compatTokensDefined) { - return; - } - - $compatTokens = [ - // PHP 7.4 - 'T_BAD_CHARACTER', - 'T_FN', - 'T_COALESCE_EQUAL', - // PHP 8.0 - 'T_NAME_QUALIFIED', - 'T_NAME_FULLY_QUALIFIED', - 'T_NAME_RELATIVE', - 'T_MATCH', - 'T_NULLSAFE_OBJECT_OPERATOR', - 'T_ATTRIBUTE', - // PHP 8.1 - 'T_ENUM', - 'T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG', - 'T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG', - 'T_READONLY', - ]; - - // PHP-Parser might be used together with another library that also emulates some or all - // of these tokens. Perform a sanity-check that all already defined tokens have been - // assigned a unique ID. - $usedTokenIds = []; - foreach ($compatTokens as $token) { - if (\defined($token)) { - $tokenId = \constant($token); - $clashingToken = $usedTokenIds[$tokenId] ?? null; - if ($clashingToken !== null) { - throw new \Error(sprintf( - 'Token %s has same ID as token %s, ' . - 'you may be using a library with broken token emulation', - $token, $clashingToken - )); - } - $usedTokenIds[$tokenId] = $token; - } - } - - // Now define any tokens that have not yet been emulated. Try to assign IDs from -1 - // downwards, but skip any IDs that may already be in use. - $newTokenId = -1; - foreach ($compatTokens as $token) { - if (!\defined($token)) { - while (isset($usedTokenIds[$newTokenId])) { - $newTokenId--; - } - \define($token, $newTokenId); - $newTokenId--; - } - } - - $compatTokensDefined = true; - } - - /** - * Creates the token map. - * - * The token map maps the PHP internal token identifiers - * to the identifiers used by the Parser. Additionally it - * maps T_OPEN_TAG_WITH_ECHO to T_ECHO and T_CLOSE_TAG to ';'. - * - * @return array The token map - */ - protected function createTokenMap() : array { - $tokenMap = []; - - // 256 is the minimum possible token number, as everything below - // it is an ASCII value - for ($i = 256; $i < 1000; ++$i) { - if (\T_DOUBLE_COLON === $i) { - // T_DOUBLE_COLON is equivalent to T_PAAMAYIM_NEKUDOTAYIM - $tokenMap[$i] = Tokens::T_PAAMAYIM_NEKUDOTAYIM; - } elseif(\T_OPEN_TAG_WITH_ECHO === $i) { - // T_OPEN_TAG_WITH_ECHO with dropped T_OPEN_TAG results in T_ECHO - $tokenMap[$i] = Tokens::T_ECHO; - } elseif(\T_CLOSE_TAG === $i) { - // T_CLOSE_TAG is equivalent to ';' - $tokenMap[$i] = ord(';'); - } elseif ('UNKNOWN' !== $name = token_name($i)) { - if ('T_HASHBANG' === $name) { - // HHVM uses a special token for #! hashbang lines - $tokenMap[$i] = Tokens::T_INLINE_HTML; - } elseif (defined($name = Tokens::class . '::' . $name)) { - // Other tokens can be mapped directly - $tokenMap[$i] = constant($name); - } - } - } - - // HHVM uses a special token for numbers that overflow to double - if (defined('T_ONUMBER')) { - $tokenMap[\T_ONUMBER] = Tokens::T_DNUMBER; - } - // HHVM also has a separate token for the __COMPILER_HALT_OFFSET__ constant - if (defined('T_COMPILER_HALT_OFFSET')) { - $tokenMap[\T_COMPILER_HALT_OFFSET] = Tokens::T_STRING; - } - - // Assign tokens for which we define compatibility constants, as token_name() does not know them. - $tokenMap[\T_FN] = Tokens::T_FN; - $tokenMap[\T_COALESCE_EQUAL] = Tokens::T_COALESCE_EQUAL; - $tokenMap[\T_NAME_QUALIFIED] = Tokens::T_NAME_QUALIFIED; - $tokenMap[\T_NAME_FULLY_QUALIFIED] = Tokens::T_NAME_FULLY_QUALIFIED; - $tokenMap[\T_NAME_RELATIVE] = Tokens::T_NAME_RELATIVE; - $tokenMap[\T_MATCH] = Tokens::T_MATCH; - $tokenMap[\T_NULLSAFE_OBJECT_OPERATOR] = Tokens::T_NULLSAFE_OBJECT_OPERATOR; - $tokenMap[\T_ATTRIBUTE] = Tokens::T_ATTRIBUTE; - $tokenMap[\T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG] = Tokens::T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG; - $tokenMap[\T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG] = Tokens::T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG; - $tokenMap[\T_ENUM] = Tokens::T_ENUM; - $tokenMap[\T_READONLY] = Tokens::T_READONLY; - - return $tokenMap; - } - - private function createIdentifierTokenMap(): array { - // Based on semi_reserved production. - return array_fill_keys([ - \T_STRING, - \T_STATIC, \T_ABSTRACT, \T_FINAL, \T_PRIVATE, \T_PROTECTED, \T_PUBLIC, \T_READONLY, - \T_INCLUDE, \T_INCLUDE_ONCE, \T_EVAL, \T_REQUIRE, \T_REQUIRE_ONCE, \T_LOGICAL_OR, \T_LOGICAL_XOR, \T_LOGICAL_AND, - \T_INSTANCEOF, \T_NEW, \T_CLONE, \T_EXIT, \T_IF, \T_ELSEIF, \T_ELSE, \T_ENDIF, \T_ECHO, \T_DO, \T_WHILE, - \T_ENDWHILE, \T_FOR, \T_ENDFOR, \T_FOREACH, \T_ENDFOREACH, \T_DECLARE, \T_ENDDECLARE, \T_AS, \T_TRY, \T_CATCH, - \T_FINALLY, \T_THROW, \T_USE, \T_INSTEADOF, \T_GLOBAL, \T_VAR, \T_UNSET, \T_ISSET, \T_EMPTY, \T_CONTINUE, \T_GOTO, - \T_FUNCTION, \T_CONST, \T_RETURN, \T_PRINT, \T_YIELD, \T_LIST, \T_SWITCH, \T_ENDSWITCH, \T_CASE, \T_DEFAULT, - \T_BREAK, \T_ARRAY, \T_CALLABLE, \T_EXTENDS, \T_IMPLEMENTS, \T_NAMESPACE, \T_TRAIT, \T_INTERFACE, \T_CLASS, - \T_CLASS_C, \T_TRAIT_C, \T_FUNC_C, \T_METHOD_C, \T_LINE, \T_FILE, \T_DIR, \T_NS_C, \T_HALT_COMPILER, \T_FN, - \T_MATCH, - ], true); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer/Emulative.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer/Emulative.php deleted file mode 100644 index 5c56e02..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Lexer/Emulative.php +++ /dev/null @@ -1,248 +0,0 @@ -targetPhpVersion = $options['phpVersion'] ?? Emulative::PHP_8_1; - unset($options['phpVersion']); - - parent::__construct($options); - - $emulators = [ - new FlexibleDocStringEmulator(), - new FnTokenEmulator(), - new MatchTokenEmulator(), - new CoaleseEqualTokenEmulator(), - new NumericLiteralSeparatorEmulator(), - new NullsafeTokenEmulator(), - new AttributeEmulator(), - new EnumTokenEmulator(), - new ReadonlyTokenEmulator(), - new ExplicitOctalEmulator(), - ]; - - // Collect emulators that are relevant for the PHP version we're running - // and the PHP version we're targeting for emulation. - foreach ($emulators as $emulator) { - $emulatorPhpVersion = $emulator->getPhpVersion(); - if ($this->isForwardEmulationNeeded($emulatorPhpVersion)) { - $this->emulators[] = $emulator; - } else if ($this->isReverseEmulationNeeded($emulatorPhpVersion)) { - $this->emulators[] = new ReverseEmulator($emulator); - } - } - } - - public function startLexing(string $code, ErrorHandler $errorHandler = null) { - $emulators = array_filter($this->emulators, function($emulator) use($code) { - return $emulator->isEmulationNeeded($code); - }); - - if (empty($emulators)) { - // Nothing to emulate, yay - parent::startLexing($code, $errorHandler); - return; - } - - $this->patches = []; - foreach ($emulators as $emulator) { - $code = $emulator->preprocessCode($code, $this->patches); - } - - $collector = new ErrorHandler\Collecting(); - parent::startLexing($code, $collector); - $this->sortPatches(); - $this->fixupTokens(); - - $errors = $collector->getErrors(); - if (!empty($errors)) { - $this->fixupErrors($errors); - foreach ($errors as $error) { - $errorHandler->handleError($error); - } - } - - foreach ($emulators as $emulator) { - $this->tokens = $emulator->emulate($code, $this->tokens); - } - } - - private function isForwardEmulationNeeded(string $emulatorPhpVersion): bool { - return version_compare(\PHP_VERSION, $emulatorPhpVersion, '<') - && version_compare($this->targetPhpVersion, $emulatorPhpVersion, '>='); - } - - private function isReverseEmulationNeeded(string $emulatorPhpVersion): bool { - return version_compare(\PHP_VERSION, $emulatorPhpVersion, '>=') - && version_compare($this->targetPhpVersion, $emulatorPhpVersion, '<'); - } - - private function sortPatches() - { - // Patches may be contributed by different emulators. - // Make sure they are sorted by increasing patch position. - usort($this->patches, function($p1, $p2) { - return $p1[0] <=> $p2[0]; - }); - } - - private function fixupTokens() - { - if (\count($this->patches) === 0) { - return; - } - - // Load first patch - $patchIdx = 0; - - list($patchPos, $patchType, $patchText) = $this->patches[$patchIdx]; - - // We use a manual loop over the tokens, because we modify the array on the fly - $pos = 0; - for ($i = 0, $c = \count($this->tokens); $i < $c; $i++) { - $token = $this->tokens[$i]; - if (\is_string($token)) { - if ($patchPos === $pos) { - // Only support replacement for string tokens. - assert($patchType === 'replace'); - $this->tokens[$i] = $patchText; - - // Fetch the next patch - $patchIdx++; - if ($patchIdx >= \count($this->patches)) { - // No more patches, we're done - return; - } - list($patchPos, $patchType, $patchText) = $this->patches[$patchIdx]; - } - - $pos += \strlen($token); - continue; - } - - $len = \strlen($token[1]); - $posDelta = 0; - while ($patchPos >= $pos && $patchPos < $pos + $len) { - $patchTextLen = \strlen($patchText); - if ($patchType === 'remove') { - if ($patchPos === $pos && $patchTextLen === $len) { - // Remove token entirely - array_splice($this->tokens, $i, 1, []); - $i--; - $c--; - } else { - // Remove from token string - $this->tokens[$i][1] = substr_replace( - $token[1], '', $patchPos - $pos + $posDelta, $patchTextLen - ); - $posDelta -= $patchTextLen; - } - } elseif ($patchType === 'add') { - // Insert into the token string - $this->tokens[$i][1] = substr_replace( - $token[1], $patchText, $patchPos - $pos + $posDelta, 0 - ); - $posDelta += $patchTextLen; - } else if ($patchType === 'replace') { - // Replace inside the token string - $this->tokens[$i][1] = substr_replace( - $token[1], $patchText, $patchPos - $pos + $posDelta, $patchTextLen - ); - } else { - assert(false); - } - - // Fetch the next patch - $patchIdx++; - if ($patchIdx >= \count($this->patches)) { - // No more patches, we're done - return; - } - - list($patchPos, $patchType, $patchText) = $this->patches[$patchIdx]; - - // Multiple patches may apply to the same token. Reload the current one to check - // If the new patch applies - $token = $this->tokens[$i]; - } - - $pos += $len; - } - - // A patch did not apply - assert(false); - } - - /** - * Fixup line and position information in errors. - * - * @param Error[] $errors - */ - private function fixupErrors(array $errors) { - foreach ($errors as $error) { - $attrs = $error->getAttributes(); - - $posDelta = 0; - $lineDelta = 0; - foreach ($this->patches as $patch) { - list($patchPos, $patchType, $patchText) = $patch; - if ($patchPos >= $attrs['startFilePos']) { - // No longer relevant - break; - } - - if ($patchType === 'add') { - $posDelta += strlen($patchText); - $lineDelta += substr_count($patchText, "\n"); - } else if ($patchType === 'remove') { - $posDelta -= strlen($patchText); - $lineDelta -= substr_count($patchText, "\n"); - } - } - - $attrs['startFilePos'] += $posDelta; - $attrs['endFilePos'] += $posDelta; - $attrs['startLine'] += $lineDelta; - $attrs['endLine'] += $lineDelta; - $error->setAttributes($attrs); - } - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/AttributeEmulator.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/AttributeEmulator.php deleted file mode 100644 index 6776a51..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/AttributeEmulator.php +++ /dev/null @@ -1,56 +0,0 @@ -resolveIntegerOrFloatToken($tokens[$i + 1][1]); - array_splice($tokens, $i, 2, [ - [$tokenKind, '0' . $tokens[$i + 1][1], $tokens[$i][2]], - ]); - $c--; - } - } - return $tokens; - } - - private function resolveIntegerOrFloatToken(string $str): int - { - $str = substr($str, 1); - $str = str_replace('_', '', $str); - $num = octdec($str); - return is_float($num) ? \T_DNUMBER : \T_LNUMBER; - } - - public function reverseEmulate(string $code, array $tokens): array { - // Explicit octals were not legal code previously, don't bother. - return $tokens; - } -} \ No newline at end of file diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FlexibleDocStringEmulator.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FlexibleDocStringEmulator.php deleted file mode 100644 index c15d627..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FlexibleDocStringEmulator.php +++ /dev/null @@ -1,76 +0,0 @@ -\h*)\2(?![a-zA-Z0-9_\x80-\xff])(?(?:;?[\r\n])?)/x -REGEX; - - public function getPhpVersion(): string - { - return Emulative::PHP_7_3; - } - - public function isEmulationNeeded(string $code) : bool - { - return strpos($code, '<<<') !== false; - } - - public function emulate(string $code, array $tokens): array - { - // Handled by preprocessing + fixup. - return $tokens; - } - - public function reverseEmulate(string $code, array $tokens): array - { - // Not supported. - return $tokens; - } - - public function preprocessCode(string $code, array &$patches): string { - if (!preg_match_all(self::FLEXIBLE_DOC_STRING_REGEX, $code, $matches, PREG_SET_ORDER|PREG_OFFSET_CAPTURE)) { - // No heredoc/nowdoc found - return $code; - } - - // Keep track of how much we need to adjust string offsets due to the modifications we - // already made - $posDelta = 0; - foreach ($matches as $match) { - $indentation = $match['indentation'][0]; - $indentationStart = $match['indentation'][1]; - - $separator = $match['separator'][0]; - $separatorStart = $match['separator'][1]; - - if ($indentation === '' && $separator !== '') { - // Ordinary heredoc/nowdoc - continue; - } - - if ($indentation !== '') { - // Remove indentation - $indentationLen = strlen($indentation); - $code = substr_replace($code, '', $indentationStart + $posDelta, $indentationLen); - $patches[] = [$indentationStart + $posDelta, 'add', $indentation]; - $posDelta -= $indentationLen; - } - - if ($separator === '') { - // Insert newline as separator - $code = substr_replace($code, "\n", $separatorStart + $posDelta, 0); - $patches[] = [$separatorStart + $posDelta, 'remove', "\n"]; - $posDelta += 1; - } - } - - return $code; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FnTokenEmulator.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FnTokenEmulator.php deleted file mode 100644 index eb7e496..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FnTokenEmulator.php +++ /dev/null @@ -1,23 +0,0 @@ -getKeywordString()) !== false; - } - - protected function isKeywordContext(array $tokens, int $pos): bool - { - $previousNonSpaceToken = $this->getPreviousNonSpaceToken($tokens, $pos); - return $previousNonSpaceToken === null || $previousNonSpaceToken[0] !== \T_OBJECT_OPERATOR; - } - - public function emulate(string $code, array $tokens): array - { - $keywordString = $this->getKeywordString(); - foreach ($tokens as $i => $token) { - if ($token[0] === T_STRING && strtolower($token[1]) === $keywordString - && $this->isKeywordContext($tokens, $i)) { - $tokens[$i][0] = $this->getKeywordToken(); - } - } - - return $tokens; - } - - /** - * @param mixed[] $tokens - * @return mixed[]|null - */ - private function getPreviousNonSpaceToken(array $tokens, int $start) - { - for ($i = $start - 1; $i >= 0; --$i) { - if ($tokens[$i][0] === T_WHITESPACE) { - continue; - } - - return $tokens[$i]; - } - - return null; - } - - public function reverseEmulate(string $code, array $tokens): array - { - $keywordToken = $this->getKeywordToken(); - foreach ($tokens as $i => $token) { - if ($token[0] === $keywordToken) { - $tokens[$i][0] = \T_STRING; - } - } - - return $tokens; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/MatchTokenEmulator.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/MatchTokenEmulator.php deleted file mode 100644 index 902a46d..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/MatchTokenEmulator.php +++ /dev/null @@ -1,23 +0,0 @@ -') !== false; - } - - public function emulate(string $code, array $tokens): array - { - // We need to manually iterate and manage a count because we'll change - // the tokens array on the way - $line = 1; - for ($i = 0, $c = count($tokens); $i < $c; ++$i) { - if ($tokens[$i] === '?' && isset($tokens[$i + 1]) && $tokens[$i + 1][0] === \T_OBJECT_OPERATOR) { - array_splice($tokens, $i, 2, [ - [\T_NULLSAFE_OBJECT_OPERATOR, '?->', $line] - ]); - $c--; - continue; - } - - // Handle ?-> inside encapsed string. - if ($tokens[$i][0] === \T_ENCAPSED_AND_WHITESPACE && isset($tokens[$i - 1]) - && $tokens[$i - 1][0] === \T_VARIABLE - && preg_match('/^\?->([a-zA-Z_\x80-\xff][a-zA-Z0-9_\x80-\xff]*)/', $tokens[$i][1], $matches) - ) { - $replacement = [ - [\T_NULLSAFE_OBJECT_OPERATOR, '?->', $line], - [\T_STRING, $matches[1], $line], - ]; - if (\strlen($matches[0]) !== \strlen($tokens[$i][1])) { - $replacement[] = [ - \T_ENCAPSED_AND_WHITESPACE, - \substr($tokens[$i][1], \strlen($matches[0])), - $line - ]; - } - array_splice($tokens, $i, 1, $replacement); - $c += \count($replacement) - 1; - continue; - } - - if (\is_array($tokens[$i])) { - $line += substr_count($tokens[$i][1], "\n"); - } - } - - return $tokens; - } - - public function reverseEmulate(string $code, array $tokens): array - { - // ?-> was not valid code previously, don't bother. - return $tokens; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NumericLiteralSeparatorEmulator.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NumericLiteralSeparatorEmulator.php deleted file mode 100644 index cdf793e..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NumericLiteralSeparatorEmulator.php +++ /dev/null @@ -1,105 +0,0 @@ -resolveIntegerOrFloatToken($match); - $newTokens = [[$tokenKind, $match, $token[2]]]; - - $numTokens = 1; - $len = $tokenLen; - while ($matchLen > $len) { - $nextToken = $tokens[$i + $numTokens]; - $nextTokenText = \is_array($nextToken) ? $nextToken[1] : $nextToken; - $nextTokenLen = \strlen($nextTokenText); - - $numTokens++; - if ($matchLen < $len + $nextTokenLen) { - // Split trailing characters into a partial token. - assert(is_array($nextToken), "Partial token should be an array token"); - $partialText = substr($nextTokenText, $matchLen - $len); - $newTokens[] = [$nextToken[0], $partialText, $nextToken[2]]; - break; - } - - $len += $nextTokenLen; - } - - array_splice($tokens, $i, $numTokens, $newTokens); - $c -= $numTokens - \count($newTokens); - $codeOffset += $matchLen; - } - - return $tokens; - } - - private function resolveIntegerOrFloatToken(string $str): int - { - $str = str_replace('_', '', $str); - - if (stripos($str, '0b') === 0) { - $num = bindec($str); - } elseif (stripos($str, '0x') === 0) { - $num = hexdec($str); - } elseif (stripos($str, '0') === 0 && ctype_digit($str)) { - $num = octdec($str); - } else { - $num = +$str; - } - - return is_float($num) ? T_DNUMBER : T_LNUMBER; - } - - public function reverseEmulate(string $code, array $tokens): array - { - // Numeric separators were not legal code previously, don't bother. - return $tokens; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyTokenEmulator.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyTokenEmulator.php deleted file mode 100644 index b97f8d1..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyTokenEmulator.php +++ /dev/null @@ -1,23 +0,0 @@ -emulator = $emulator; - } - - public function getPhpVersion(): string { - return $this->emulator->getPhpVersion(); - } - - public function isEmulationNeeded(string $code): bool { - return $this->emulator->isEmulationNeeded($code); - } - - public function emulate(string $code, array $tokens): array { - return $this->emulator->reverseEmulate($code, $tokens); - } - - public function reverseEmulate(string $code, array $tokens): array { - return $this->emulator->emulate($code, $tokens); - } - - public function preprocessCode(string $code, array &$patches): string { - return $code; - } -} \ No newline at end of file diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/TokenEmulator.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/TokenEmulator.php deleted file mode 100644 index a020bc0..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/TokenEmulator.php +++ /dev/null @@ -1,25 +0,0 @@ - [aliasName => originalName]] */ - protected $aliases = []; - - /** @var Name[][] Same as $aliases but preserving original case */ - protected $origAliases = []; - - /** @var ErrorHandler Error handler */ - protected $errorHandler; - - /** - * Create a name context. - * - * @param ErrorHandler $errorHandler Error handling used to report errors - */ - public function __construct(ErrorHandler $errorHandler) { - $this->errorHandler = $errorHandler; - } - - /** - * Start a new namespace. - * - * This also resets the alias table. - * - * @param Name|null $namespace Null is the global namespace - */ - public function startNamespace(Name $namespace = null) { - $this->namespace = $namespace; - $this->origAliases = $this->aliases = [ - Stmt\Use_::TYPE_NORMAL => [], - Stmt\Use_::TYPE_FUNCTION => [], - Stmt\Use_::TYPE_CONSTANT => [], - ]; - } - - /** - * Add an alias / import. - * - * @param Name $name Original name - * @param string $aliasName Aliased name - * @param int $type One of Stmt\Use_::TYPE_* - * @param array $errorAttrs Attributes to use to report an error - */ - public function addAlias(Name $name, string $aliasName, int $type, array $errorAttrs = []) { - // Constant names are case sensitive, everything else case insensitive - if ($type === Stmt\Use_::TYPE_CONSTANT) { - $aliasLookupName = $aliasName; - } else { - $aliasLookupName = strtolower($aliasName); - } - - if (isset($this->aliases[$type][$aliasLookupName])) { - $typeStringMap = [ - Stmt\Use_::TYPE_NORMAL => '', - Stmt\Use_::TYPE_FUNCTION => 'function ', - Stmt\Use_::TYPE_CONSTANT => 'const ', - ]; - - $this->errorHandler->handleError(new Error( - sprintf( - 'Cannot use %s%s as %s because the name is already in use', - $typeStringMap[$type], $name, $aliasName - ), - $errorAttrs - )); - return; - } - - $this->aliases[$type][$aliasLookupName] = $name; - $this->origAliases[$type][$aliasName] = $name; - } - - /** - * Get current namespace. - * - * @return null|Name Namespace (or null if global namespace) - */ - public function getNamespace() { - return $this->namespace; - } - - /** - * Get resolved name. - * - * @param Name $name Name to resolve - * @param int $type One of Stmt\Use_::TYPE_{FUNCTION|CONSTANT} - * - * @return null|Name Resolved name, or null if static resolution is not possible - */ - public function getResolvedName(Name $name, int $type) { - // don't resolve special class names - if ($type === Stmt\Use_::TYPE_NORMAL && $name->isSpecialClassName()) { - if (!$name->isUnqualified()) { - $this->errorHandler->handleError(new Error( - sprintf("'\\%s' is an invalid class name", $name->toString()), - $name->getAttributes() - )); - } - return $name; - } - - // fully qualified names are already resolved - if ($name->isFullyQualified()) { - return $name; - } - - // Try to resolve aliases - if (null !== $resolvedName = $this->resolveAlias($name, $type)) { - return $resolvedName; - } - - if ($type !== Stmt\Use_::TYPE_NORMAL && $name->isUnqualified()) { - if (null === $this->namespace) { - // outside of a namespace unaliased unqualified is same as fully qualified - return new FullyQualified($name, $name->getAttributes()); - } - - // Cannot resolve statically - return null; - } - - // if no alias exists prepend current namespace - return FullyQualified::concat($this->namespace, $name, $name->getAttributes()); - } - - /** - * Get resolved class name. - * - * @param Name $name Class ame to resolve - * - * @return Name Resolved name - */ - public function getResolvedClassName(Name $name) : Name { - return $this->getResolvedName($name, Stmt\Use_::TYPE_NORMAL); - } - - /** - * Get possible ways of writing a fully qualified name (e.g., by making use of aliases). - * - * @param string $name Fully-qualified name (without leading namespace separator) - * @param int $type One of Stmt\Use_::TYPE_* - * - * @return Name[] Possible representations of the name - */ - public function getPossibleNames(string $name, int $type) : array { - $lcName = strtolower($name); - - if ($type === Stmt\Use_::TYPE_NORMAL) { - // self, parent and static must always be unqualified - if ($lcName === "self" || $lcName === "parent" || $lcName === "static") { - return [new Name($name)]; - } - } - - // Collect possible ways to write this name, starting with the fully-qualified name - $possibleNames = [new FullyQualified($name)]; - - if (null !== $nsRelativeName = $this->getNamespaceRelativeName($name, $lcName, $type)) { - // Make sure there is no alias that makes the normally namespace-relative name - // into something else - if (null === $this->resolveAlias($nsRelativeName, $type)) { - $possibleNames[] = $nsRelativeName; - } - } - - // Check for relevant namespace use statements - foreach ($this->origAliases[Stmt\Use_::TYPE_NORMAL] as $alias => $orig) { - $lcOrig = $orig->toLowerString(); - if (0 === strpos($lcName, $lcOrig . '\\')) { - $possibleNames[] = new Name($alias . substr($name, strlen($lcOrig))); - } - } - - // Check for relevant type-specific use statements - foreach ($this->origAliases[$type] as $alias => $orig) { - if ($type === Stmt\Use_::TYPE_CONSTANT) { - // Constants are are complicated-sensitive - $normalizedOrig = $this->normalizeConstName($orig->toString()); - if ($normalizedOrig === $this->normalizeConstName($name)) { - $possibleNames[] = new Name($alias); - } - } else { - // Everything else is case-insensitive - if ($orig->toLowerString() === $lcName) { - $possibleNames[] = new Name($alias); - } - } - } - - return $possibleNames; - } - - /** - * Get shortest representation of this fully-qualified name. - * - * @param string $name Fully-qualified name (without leading namespace separator) - * @param int $type One of Stmt\Use_::TYPE_* - * - * @return Name Shortest representation - */ - public function getShortName(string $name, int $type) : Name { - $possibleNames = $this->getPossibleNames($name, $type); - - // Find shortest name - $shortestName = null; - $shortestLength = \INF; - foreach ($possibleNames as $possibleName) { - $length = strlen($possibleName->toCodeString()); - if ($length < $shortestLength) { - $shortestName = $possibleName; - $shortestLength = $length; - } - } - - return $shortestName; - } - - private function resolveAlias(Name $name, $type) { - $firstPart = $name->getFirst(); - - if ($name->isQualified()) { - // resolve aliases for qualified names, always against class alias table - $checkName = strtolower($firstPart); - if (isset($this->aliases[Stmt\Use_::TYPE_NORMAL][$checkName])) { - $alias = $this->aliases[Stmt\Use_::TYPE_NORMAL][$checkName]; - return FullyQualified::concat($alias, $name->slice(1), $name->getAttributes()); - } - } elseif ($name->isUnqualified()) { - // constant aliases are case-sensitive, function aliases case-insensitive - $checkName = $type === Stmt\Use_::TYPE_CONSTANT ? $firstPart : strtolower($firstPart); - if (isset($this->aliases[$type][$checkName])) { - // resolve unqualified aliases - return new FullyQualified($this->aliases[$type][$checkName], $name->getAttributes()); - } - } - - // No applicable aliases - return null; - } - - private function getNamespaceRelativeName(string $name, string $lcName, int $type) { - if (null === $this->namespace) { - return new Name($name); - } - - if ($type === Stmt\Use_::TYPE_CONSTANT) { - // The constants true/false/null always resolve to the global symbols, even inside a - // namespace, so they may be used without qualification - if ($lcName === "true" || $lcName === "false" || $lcName === "null") { - return new Name($name); - } - } - - $namespacePrefix = strtolower($this->namespace . '\\'); - if (0 === strpos($lcName, $namespacePrefix)) { - return new Name(substr($name, strlen($namespacePrefix))); - } - - return null; - } - - private function normalizeConstName(string $name) { - $nsSep = strrpos($name, '\\'); - if (false === $nsSep) { - return $name; - } - - // Constants have case-insensitive namespace and case-sensitive short-name - $ns = substr($name, 0, $nsSep); - $shortName = substr($name, $nsSep + 1); - return strtolower($ns) . '\\' . $shortName; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node.php b/vendor/nikic/php-parser/lib/PhpParser/Node.php deleted file mode 100644 index befb256..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node.php +++ /dev/null @@ -1,151 +0,0 @@ -attributes = $attributes; - $this->name = $name; - $this->value = $value; - $this->byRef = $byRef; - $this->unpack = $unpack; - } - - public function getSubNodeNames() : array { - return ['name', 'value', 'byRef', 'unpack']; - } - - public function getType() : string { - return 'Arg'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Attribute.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Attribute.php deleted file mode 100644 index c96f66e..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Attribute.php +++ /dev/null @@ -1,34 +0,0 @@ -attributes = $attributes; - $this->name = $name; - $this->args = $args; - } - - public function getSubNodeNames() : array { - return ['name', 'args']; - } - - public function getType() : string { - return 'Attribute'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/AttributeGroup.php b/vendor/nikic/php-parser/lib/PhpParser/Node/AttributeGroup.php deleted file mode 100644 index 613bfc4..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/AttributeGroup.php +++ /dev/null @@ -1,29 +0,0 @@ -attributes = $attributes; - $this->attrs = $attrs; - } - - public function getSubNodeNames() : array { - return ['attrs']; - } - - public function getType() : string { - return 'AttributeGroup'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/ComplexType.php b/vendor/nikic/php-parser/lib/PhpParser/Node/ComplexType.php deleted file mode 100644 index 9505532..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/ComplexType.php +++ /dev/null @@ -1,14 +0,0 @@ -attributes = $attributes; - $this->name = \is_string($name) ? new Identifier($name) : $name; - $this->value = $value; - } - - public function getSubNodeNames() : array { - return ['name', 'value']; - } - - public function getType() : string { - return 'Const'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr.php deleted file mode 100644 index 6cf4df2..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr.php +++ /dev/null @@ -1,9 +0,0 @@ -attributes = $attributes; - $this->var = $var; - $this->dim = $dim; - } - - public function getSubNodeNames() : array { - return ['var', 'dim']; - } - - public function getType() : string { - return 'Expr_ArrayDimFetch'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayItem.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayItem.php deleted file mode 100644 index 1b078f8..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayItem.php +++ /dev/null @@ -1,41 +0,0 @@ -attributes = $attributes; - $this->key = $key; - $this->value = $value; - $this->byRef = $byRef; - $this->unpack = $unpack; - } - - public function getSubNodeNames() : array { - return ['key', 'value', 'byRef', 'unpack']; - } - - public function getType() : string { - return 'Expr_ArrayItem'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Array_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Array_.php deleted file mode 100644 index e6eaa28..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Array_.php +++ /dev/null @@ -1,34 +0,0 @@ -attributes = $attributes; - $this->items = $items; - } - - public function getSubNodeNames() : array { - return ['items']; - } - - public function getType() : string { - return 'Expr_Array'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrowFunction.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrowFunction.php deleted file mode 100644 index c273fb7..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrowFunction.php +++ /dev/null @@ -1,79 +0,0 @@ - false : Whether the closure is static - * 'byRef' => false : Whether to return by reference - * 'params' => array() : Parameters - * 'returnType' => null : Return type - * 'expr' => Expr : Expression body - * 'attrGroups' => array() : PHP attribute groups - * @param array $attributes Additional attributes - */ - public function __construct(array $subNodes = [], array $attributes = []) { - $this->attributes = $attributes; - $this->static = $subNodes['static'] ?? false; - $this->byRef = $subNodes['byRef'] ?? false; - $this->params = $subNodes['params'] ?? []; - $returnType = $subNodes['returnType'] ?? null; - $this->returnType = \is_string($returnType) ? new Node\Identifier($returnType) : $returnType; - $this->expr = $subNodes['expr']; - $this->attrGroups = $subNodes['attrGroups'] ?? []; - } - - public function getSubNodeNames() : array { - return ['attrGroups', 'static', 'byRef', 'params', 'returnType', 'expr']; - } - - public function returnsByRef() : bool { - return $this->byRef; - } - - public function getParams() : array { - return $this->params; - } - - public function getReturnType() { - return $this->returnType; - } - - public function getAttrGroups() : array { - return $this->attrGroups; - } - - /** - * @return Node\Stmt\Return_[] - */ - public function getStmts() : array { - return [new Node\Stmt\Return_($this->expr)]; - } - - public function getType() : string { - return 'Expr_ArrowFunction'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Assign.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Assign.php deleted file mode 100644 index cf9e6e8..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Assign.php +++ /dev/null @@ -1,34 +0,0 @@ -attributes = $attributes; - $this->var = $var; - $this->expr = $expr; - } - - public function getSubNodeNames() : array { - return ['var', 'expr']; - } - - public function getType() : string { - return 'Expr_Assign'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp.php deleted file mode 100644 index bce8604..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp.php +++ /dev/null @@ -1,30 +0,0 @@ -attributes = $attributes; - $this->var = $var; - $this->expr = $expr; - } - - public function getSubNodeNames() : array { - return ['var', 'expr']; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseAnd.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseAnd.php deleted file mode 100644 index 420284c..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseAnd.php +++ /dev/null @@ -1,12 +0,0 @@ -attributes = $attributes; - $this->var = $var; - $this->expr = $expr; - } - - public function getSubNodeNames() : array { - return ['var', 'expr']; - } - - public function getType() : string { - return 'Expr_AssignRef'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp.php deleted file mode 100644 index d9c582b..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp.php +++ /dev/null @@ -1,40 +0,0 @@ -attributes = $attributes; - $this->left = $left; - $this->right = $right; - } - - public function getSubNodeNames() : array { - return ['left', 'right']; - } - - /** - * Get the operator sigil for this binary operation. - * - * In the case there are multiple possible sigils for an operator, this method does not - * necessarily return the one used in the parsed code. - * - * @return string - */ - abstract public function getOperatorSigil() : string; -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseAnd.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseAnd.php deleted file mode 100644 index d907393..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseAnd.php +++ /dev/null @@ -1,16 +0,0 @@ -'; - } - - public function getType() : string { - return 'Expr_BinaryOp_Greater'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/GreaterOrEqual.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/GreaterOrEqual.php deleted file mode 100644 index d677502..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/GreaterOrEqual.php +++ /dev/null @@ -1,16 +0,0 @@ -='; - } - - public function getType() : string { - return 'Expr_BinaryOp_GreaterOrEqual'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Identical.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Identical.php deleted file mode 100644 index 3d96285..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Identical.php +++ /dev/null @@ -1,16 +0,0 @@ ->'; - } - - public function getType() : string { - return 'Expr_BinaryOp_ShiftRight'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Smaller.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Smaller.php deleted file mode 100644 index 3cb8e7e..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Smaller.php +++ /dev/null @@ -1,16 +0,0 @@ -'; - } - - public function getType() : string { - return 'Expr_BinaryOp_Spaceship'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BitwiseNot.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BitwiseNot.php deleted file mode 100644 index ed44984..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BitwiseNot.php +++ /dev/null @@ -1,30 +0,0 @@ -attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames() : array { - return ['expr']; - } - - public function getType() : string { - return 'Expr_BitwiseNot'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BooleanNot.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BooleanNot.php deleted file mode 100644 index bf27e9f..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BooleanNot.php +++ /dev/null @@ -1,30 +0,0 @@ -attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames() : array { - return ['expr']; - } - - public function getType() : string { - return 'Expr_BooleanNot'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/CallLike.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/CallLike.php deleted file mode 100644 index 78e1cf3..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/CallLike.php +++ /dev/null @@ -1,39 +0,0 @@ - - */ - abstract public function getRawArgs(): array; - - /** - * Returns whether this call expression is actually a first class callable. - */ - public function isFirstClassCallable(): bool { - foreach ($this->getRawArgs() as $arg) { - if ($arg instanceof VariadicPlaceholder) { - return true; - } - } - return false; - } - - /** - * Assert that this is not a first-class callable and return only ordinary Args. - * - * @return Arg[] - */ - public function getArgs(): array { - assert(!$this->isFirstClassCallable()); - return $this->getRawArgs(); - } -} \ No newline at end of file diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast.php deleted file mode 100644 index 36769d4..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast.php +++ /dev/null @@ -1,26 +0,0 @@ -attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames() : array { - return ['expr']; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Array_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Array_.php deleted file mode 100644 index 57cc473..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Array_.php +++ /dev/null @@ -1,12 +0,0 @@ -attributes = $attributes; - $this->class = $class; - $this->name = \is_string($name) ? new Identifier($name) : $name; - } - - public function getSubNodeNames() : array { - return ['class', 'name']; - } - - public function getType() : string { - return 'Expr_ClassConstFetch'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Clone_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Clone_.php deleted file mode 100644 index db216b8..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Clone_.php +++ /dev/null @@ -1,30 +0,0 @@ -attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames() : array { - return ['expr']; - } - - public function getType() : string { - return 'Expr_Clone'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Closure.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Closure.php deleted file mode 100644 index 56ddea6..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Closure.php +++ /dev/null @@ -1,79 +0,0 @@ - false : Whether the closure is static - * 'byRef' => false : Whether to return by reference - * 'params' => array(): Parameters - * 'uses' => array(): use()s - * 'returnType' => null : Return type - * 'stmts' => array(): Statements - * 'attrGroups' => array(): PHP attributes groups - * @param array $attributes Additional attributes - */ - public function __construct(array $subNodes = [], array $attributes = []) { - $this->attributes = $attributes; - $this->static = $subNodes['static'] ?? false; - $this->byRef = $subNodes['byRef'] ?? false; - $this->params = $subNodes['params'] ?? []; - $this->uses = $subNodes['uses'] ?? []; - $returnType = $subNodes['returnType'] ?? null; - $this->returnType = \is_string($returnType) ? new Node\Identifier($returnType) : $returnType; - $this->stmts = $subNodes['stmts'] ?? []; - $this->attrGroups = $subNodes['attrGroups'] ?? []; - } - - public function getSubNodeNames() : array { - return ['attrGroups', 'static', 'byRef', 'params', 'uses', 'returnType', 'stmts']; - } - - public function returnsByRef() : bool { - return $this->byRef; - } - - public function getParams() : array { - return $this->params; - } - - public function getReturnType() { - return $this->returnType; - } - - /** @return Node\Stmt[] */ - public function getStmts() : array { - return $this->stmts; - } - - public function getAttrGroups() : array { - return $this->attrGroups; - } - - public function getType() : string { - return 'Expr_Closure'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClosureUse.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClosureUse.php deleted file mode 100644 index 2b8a096..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClosureUse.php +++ /dev/null @@ -1,34 +0,0 @@ -attributes = $attributes; - $this->var = $var; - $this->byRef = $byRef; - } - - public function getSubNodeNames() : array { - return ['var', 'byRef']; - } - - public function getType() : string { - return 'Expr_ClosureUse'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ConstFetch.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ConstFetch.php deleted file mode 100644 index 14ebd16..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ConstFetch.php +++ /dev/null @@ -1,31 +0,0 @@ -attributes = $attributes; - $this->name = $name; - } - - public function getSubNodeNames() : array { - return ['name']; - } - - public function getType() : string { - return 'Expr_ConstFetch'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Empty_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Empty_.php deleted file mode 100644 index 4042ec9..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Empty_.php +++ /dev/null @@ -1,30 +0,0 @@ -attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames() : array { - return ['expr']; - } - - public function getType() : string { - return 'Expr_Empty'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Error.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Error.php deleted file mode 100644 index 1637f3a..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Error.php +++ /dev/null @@ -1,31 +0,0 @@ -attributes = $attributes; - } - - public function getSubNodeNames() : array { - return []; - } - - public function getType() : string { - return 'Expr_Error'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ErrorSuppress.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ErrorSuppress.php deleted file mode 100644 index c44ff6f..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ErrorSuppress.php +++ /dev/null @@ -1,30 +0,0 @@ -attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames() : array { - return ['expr']; - } - - public function getType() : string { - return 'Expr_ErrorSuppress'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Eval_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Eval_.php deleted file mode 100644 index 8568547..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Eval_.php +++ /dev/null @@ -1,30 +0,0 @@ -attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames() : array { - return ['expr']; - } - - public function getType() : string { - return 'Expr_Eval'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Exit_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Exit_.php deleted file mode 100644 index b88a8f7..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Exit_.php +++ /dev/null @@ -1,34 +0,0 @@ -attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames() : array { - return ['expr']; - } - - public function getType() : string { - return 'Expr_Exit'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/FuncCall.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/FuncCall.php deleted file mode 100644 index 2de4d0d..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/FuncCall.php +++ /dev/null @@ -1,39 +0,0 @@ - Arguments */ - public $args; - - /** - * Constructs a function call node. - * - * @param Node\Name|Expr $name Function name - * @param array $args Arguments - * @param array $attributes Additional attributes - */ - public function __construct($name, array $args = [], array $attributes = []) { - $this->attributes = $attributes; - $this->name = $name; - $this->args = $args; - } - - public function getSubNodeNames() : array { - return ['name', 'args']; - } - - public function getType() : string { - return 'Expr_FuncCall'; - } - - public function getRawArgs(): array { - return $this->args; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Include_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Include_.php deleted file mode 100644 index 07ce596..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Include_.php +++ /dev/null @@ -1,39 +0,0 @@ -attributes = $attributes; - $this->expr = $expr; - $this->type = $type; - } - - public function getSubNodeNames() : array { - return ['expr', 'type']; - } - - public function getType() : string { - return 'Expr_Include'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Instanceof_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Instanceof_.php deleted file mode 100644 index 9000d47..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Instanceof_.php +++ /dev/null @@ -1,35 +0,0 @@ -attributes = $attributes; - $this->expr = $expr; - $this->class = $class; - } - - public function getSubNodeNames() : array { - return ['expr', 'class']; - } - - public function getType() : string { - return 'Expr_Instanceof'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Isset_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Isset_.php deleted file mode 100644 index 76b7387..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Isset_.php +++ /dev/null @@ -1,30 +0,0 @@ -attributes = $attributes; - $this->vars = $vars; - } - - public function getSubNodeNames() : array { - return ['vars']; - } - - public function getType() : string { - return 'Expr_Isset'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/List_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/List_.php deleted file mode 100644 index c27a27b..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/List_.php +++ /dev/null @@ -1,30 +0,0 @@ -attributes = $attributes; - $this->items = $items; - } - - public function getSubNodeNames() : array { - return ['items']; - } - - public function getType() : string { - return 'Expr_List'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Match_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Match_.php deleted file mode 100644 index 2455a30..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Match_.php +++ /dev/null @@ -1,31 +0,0 @@ -attributes = $attributes; - $this->cond = $cond; - $this->arms = $arms; - } - - public function getSubNodeNames() : array { - return ['cond', 'arms']; - } - - public function getType() : string { - return 'Expr_Match'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/MethodCall.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/MethodCall.php deleted file mode 100644 index 49ca483..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/MethodCall.php +++ /dev/null @@ -1,45 +0,0 @@ - Arguments */ - public $args; - - /** - * Constructs a function call node. - * - * @param Expr $var Variable holding object - * @param string|Identifier|Expr $name Method name - * @param array $args Arguments - * @param array $attributes Additional attributes - */ - public function __construct(Expr $var, $name, array $args = [], array $attributes = []) { - $this->attributes = $attributes; - $this->var = $var; - $this->name = \is_string($name) ? new Identifier($name) : $name; - $this->args = $args; - } - - public function getSubNodeNames() : array { - return ['var', 'name', 'args']; - } - - public function getType() : string { - return 'Expr_MethodCall'; - } - - public function getRawArgs(): array { - return $this->args; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/New_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/New_.php deleted file mode 100644 index e2bb649..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/New_.php +++ /dev/null @@ -1,41 +0,0 @@ - Arguments */ - public $args; - - /** - * Constructs a function call node. - * - * @param Node\Name|Expr|Node\Stmt\Class_ $class Class name (or class node for anonymous classes) - * @param array $args Arguments - * @param array $attributes Additional attributes - */ - public function __construct($class, array $args = [], array $attributes = []) { - $this->attributes = $attributes; - $this->class = $class; - $this->args = $args; - } - - public function getSubNodeNames() : array { - return ['class', 'args']; - } - - public function getType() : string { - return 'Expr_New'; - } - - public function getRawArgs(): array { - return $this->args; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafeMethodCall.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafeMethodCall.php deleted file mode 100644 index 07a571f..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafeMethodCall.php +++ /dev/null @@ -1,45 +0,0 @@ - Arguments */ - public $args; - - /** - * Constructs a nullsafe method call node. - * - * @param Expr $var Variable holding object - * @param string|Identifier|Expr $name Method name - * @param array $args Arguments - * @param array $attributes Additional attributes - */ - public function __construct(Expr $var, $name, array $args = [], array $attributes = []) { - $this->attributes = $attributes; - $this->var = $var; - $this->name = \is_string($name) ? new Identifier($name) : $name; - $this->args = $args; - } - - public function getSubNodeNames() : array { - return ['var', 'name', 'args']; - } - - public function getType() : string { - return 'Expr_NullsafeMethodCall'; - } - - public function getRawArgs(): array { - return $this->args; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafePropertyFetch.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafePropertyFetch.php deleted file mode 100644 index 9317eb3..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafePropertyFetch.php +++ /dev/null @@ -1,35 +0,0 @@ -attributes = $attributes; - $this->var = $var; - $this->name = \is_string($name) ? new Identifier($name) : $name; - } - - public function getSubNodeNames() : array { - return ['var', 'name']; - } - - public function getType() : string { - return 'Expr_NullsafePropertyFetch'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostDec.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostDec.php deleted file mode 100644 index 94d6c29..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostDec.php +++ /dev/null @@ -1,30 +0,0 @@ -attributes = $attributes; - $this->var = $var; - } - - public function getSubNodeNames() : array { - return ['var']; - } - - public function getType() : string { - return 'Expr_PostDec'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostInc.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostInc.php deleted file mode 100644 index 005c443..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostInc.php +++ /dev/null @@ -1,30 +0,0 @@ -attributes = $attributes; - $this->var = $var; - } - - public function getSubNodeNames() : array { - return ['var']; - } - - public function getType() : string { - return 'Expr_PostInc'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreDec.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreDec.php deleted file mode 100644 index a5ca685..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreDec.php +++ /dev/null @@ -1,30 +0,0 @@ -attributes = $attributes; - $this->var = $var; - } - - public function getSubNodeNames() : array { - return ['var']; - } - - public function getType() : string { - return 'Expr_PreDec'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreInc.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreInc.php deleted file mode 100644 index 0986c44..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreInc.php +++ /dev/null @@ -1,30 +0,0 @@ -attributes = $attributes; - $this->var = $var; - } - - public function getSubNodeNames() : array { - return ['var']; - } - - public function getType() : string { - return 'Expr_PreInc'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Print_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Print_.php deleted file mode 100644 index 2d43c2a..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Print_.php +++ /dev/null @@ -1,30 +0,0 @@ -attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames() : array { - return ['expr']; - } - - public function getType() : string { - return 'Expr_Print'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PropertyFetch.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PropertyFetch.php deleted file mode 100644 index 4281f31..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PropertyFetch.php +++ /dev/null @@ -1,35 +0,0 @@ -attributes = $attributes; - $this->var = $var; - $this->name = \is_string($name) ? new Identifier($name) : $name; - } - - public function getSubNodeNames() : array { - return ['var', 'name']; - } - - public function getType() : string { - return 'Expr_PropertyFetch'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ShellExec.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ShellExec.php deleted file mode 100644 index 537a7cc..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ShellExec.php +++ /dev/null @@ -1,30 +0,0 @@ -attributes = $attributes; - $this->parts = $parts; - } - - public function getSubNodeNames() : array { - return ['parts']; - } - - public function getType() : string { - return 'Expr_ShellExec'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticCall.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticCall.php deleted file mode 100644 index d0d099c..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticCall.php +++ /dev/null @@ -1,46 +0,0 @@ - Arguments */ - public $args; - - /** - * Constructs a static method call node. - * - * @param Node\Name|Expr $class Class name - * @param string|Identifier|Expr $name Method name - * @param array $args Arguments - * @param array $attributes Additional attributes - */ - public function __construct($class, $name, array $args = [], array $attributes = []) { - $this->attributes = $attributes; - $this->class = $class; - $this->name = \is_string($name) ? new Identifier($name) : $name; - $this->args = $args; - } - - public function getSubNodeNames() : array { - return ['class', 'name', 'args']; - } - - public function getType() : string { - return 'Expr_StaticCall'; - } - - public function getRawArgs(): array { - return $this->args; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticPropertyFetch.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticPropertyFetch.php deleted file mode 100644 index 1ee1a25..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticPropertyFetch.php +++ /dev/null @@ -1,36 +0,0 @@ -attributes = $attributes; - $this->class = $class; - $this->name = \is_string($name) ? new VarLikeIdentifier($name) : $name; - } - - public function getSubNodeNames() : array { - return ['class', 'name']; - } - - public function getType() : string { - return 'Expr_StaticPropertyFetch'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Ternary.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Ternary.php deleted file mode 100644 index 9316f47..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Ternary.php +++ /dev/null @@ -1,38 +0,0 @@ -attributes = $attributes; - $this->cond = $cond; - $this->if = $if; - $this->else = $else; - } - - public function getSubNodeNames() : array { - return ['cond', 'if', 'else']; - } - - public function getType() : string { - return 'Expr_Ternary'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Throw_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Throw_.php deleted file mode 100644 index 5c97f0e..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Throw_.php +++ /dev/null @@ -1,30 +0,0 @@ -attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames() : array { - return ['expr']; - } - - public function getType() : string { - return 'Expr_Throw'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryMinus.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryMinus.php deleted file mode 100644 index ce8808b..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryMinus.php +++ /dev/null @@ -1,30 +0,0 @@ -attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames() : array { - return ['expr']; - } - - public function getType() : string { - return 'Expr_UnaryMinus'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryPlus.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryPlus.php deleted file mode 100644 index d23047e..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryPlus.php +++ /dev/null @@ -1,30 +0,0 @@ -attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames() : array { - return ['expr']; - } - - public function getType() : string { - return 'Expr_UnaryPlus'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Variable.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Variable.php deleted file mode 100644 index b47d38e..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Variable.php +++ /dev/null @@ -1,30 +0,0 @@ -attributes = $attributes; - $this->name = $name; - } - - public function getSubNodeNames() : array { - return ['name']; - } - - public function getType() : string { - return 'Expr_Variable'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/YieldFrom.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/YieldFrom.php deleted file mode 100644 index a3efce6..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/YieldFrom.php +++ /dev/null @@ -1,30 +0,0 @@ -attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames() : array { - return ['expr']; - } - - public function getType() : string { - return 'Expr_YieldFrom'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Yield_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Yield_.php deleted file mode 100644 index aef8fc3..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Yield_.php +++ /dev/null @@ -1,34 +0,0 @@ -attributes = $attributes; - $this->key = $key; - $this->value = $value; - } - - public function getSubNodeNames() : array { - return ['key', 'value']; - } - - public function getType() : string { - return 'Expr_Yield'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/FunctionLike.php b/vendor/nikic/php-parser/lib/PhpParser/Node/FunctionLike.php deleted file mode 100644 index 5a825e7..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/FunctionLike.php +++ /dev/null @@ -1,43 +0,0 @@ - true, - 'parent' => true, - 'static' => true, - ]; - - /** - * Constructs an identifier node. - * - * @param string $name Identifier as string - * @param array $attributes Additional attributes - */ - public function __construct(string $name, array $attributes = []) { - $this->attributes = $attributes; - $this->name = $name; - } - - public function getSubNodeNames() : array { - return ['name']; - } - - /** - * Get identifier as string. - * - * @return string Identifier as string. - */ - public function toString() : string { - return $this->name; - } - - /** - * Get lowercased identifier as string. - * - * @return string Lowercased identifier as string - */ - public function toLowerString() : string { - return strtolower($this->name); - } - - /** - * Checks whether the identifier is a special class name (self, parent or static). - * - * @return bool Whether identifier is a special class name - */ - public function isSpecialClassName() : bool { - return isset(self::$specialClassNames[strtolower($this->name)]); - } - - /** - * Get identifier as string. - * - * @return string Identifier as string - */ - public function __toString() : string { - return $this->name; - } - - public function getType() : string { - return 'Identifier'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/IntersectionType.php b/vendor/nikic/php-parser/lib/PhpParser/Node/IntersectionType.php deleted file mode 100644 index 9208e13..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/IntersectionType.php +++ /dev/null @@ -1,30 +0,0 @@ -attributes = $attributes; - $this->types = $types; - } - - public function getSubNodeNames() : array { - return ['types']; - } - - public function getType() : string { - return 'IntersectionType'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/MatchArm.php b/vendor/nikic/php-parser/lib/PhpParser/Node/MatchArm.php deleted file mode 100644 index 2ae1c86..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/MatchArm.php +++ /dev/null @@ -1,31 +0,0 @@ -conds = $conds; - $this->body = $body; - $this->attributes = $attributes; - } - - public function getSubNodeNames() : array { - return ['conds', 'body']; - } - - public function getType() : string { - return 'MatchArm'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Name.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Name.php deleted file mode 100644 index 6b1cc9f..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Name.php +++ /dev/null @@ -1,242 +0,0 @@ - true, - 'parent' => true, - 'static' => true, - ]; - - /** - * Constructs a name node. - * - * @param string|string[]|self $name Name as string, part array or Name instance (copy ctor) - * @param array $attributes Additional attributes - */ - public function __construct($name, array $attributes = []) { - $this->attributes = $attributes; - $this->parts = self::prepareName($name); - } - - public function getSubNodeNames() : array { - return ['parts']; - } - - /** - * Gets the first part of the name, i.e. everything before the first namespace separator. - * - * @return string First part of the name - */ - public function getFirst() : string { - return $this->parts[0]; - } - - /** - * Gets the last part of the name, i.e. everything after the last namespace separator. - * - * @return string Last part of the name - */ - public function getLast() : string { - return $this->parts[count($this->parts) - 1]; - } - - /** - * Checks whether the name is unqualified. (E.g. Name) - * - * @return bool Whether the name is unqualified - */ - public function isUnqualified() : bool { - return 1 === count($this->parts); - } - - /** - * Checks whether the name is qualified. (E.g. Name\Name) - * - * @return bool Whether the name is qualified - */ - public function isQualified() : bool { - return 1 < count($this->parts); - } - - /** - * Checks whether the name is fully qualified. (E.g. \Name) - * - * @return bool Whether the name is fully qualified - */ - public function isFullyQualified() : bool { - return false; - } - - /** - * Checks whether the name is explicitly relative to the current namespace. (E.g. namespace\Name) - * - * @return bool Whether the name is relative - */ - public function isRelative() : bool { - return false; - } - - /** - * Returns a string representation of the name itself, without taking the name type into - * account (e.g., not including a leading backslash for fully qualified names). - * - * @return string String representation - */ - public function toString() : string { - return implode('\\', $this->parts); - } - - /** - * Returns a string representation of the name as it would occur in code (e.g., including - * leading backslash for fully qualified names. - * - * @return string String representation - */ - public function toCodeString() : string { - return $this->toString(); - } - - /** - * Returns lowercased string representation of the name, without taking the name type into - * account (e.g., no leading backslash for fully qualified names). - * - * @return string Lowercased string representation - */ - public function toLowerString() : string { - return strtolower(implode('\\', $this->parts)); - } - - /** - * Checks whether the identifier is a special class name (self, parent or static). - * - * @return bool Whether identifier is a special class name - */ - public function isSpecialClassName() : bool { - return count($this->parts) === 1 - && isset(self::$specialClassNames[strtolower($this->parts[0])]); - } - - /** - * Returns a string representation of the name by imploding the namespace parts with the - * namespace separator. - * - * @return string String representation - */ - public function __toString() : string { - return implode('\\', $this->parts); - } - - /** - * Gets a slice of a name (similar to array_slice). - * - * This method returns a new instance of the same type as the original and with the same - * attributes. - * - * If the slice is empty, null is returned. The null value will be correctly handled in - * concatenations using concat(). - * - * Offset and length have the same meaning as in array_slice(). - * - * @param int $offset Offset to start the slice at (may be negative) - * @param int|null $length Length of the slice (may be negative) - * - * @return static|null Sliced name - */ - public function slice(int $offset, int $length = null) { - $numParts = count($this->parts); - - $realOffset = $offset < 0 ? $offset + $numParts : $offset; - if ($realOffset < 0 || $realOffset > $numParts) { - throw new \OutOfBoundsException(sprintf('Offset %d is out of bounds', $offset)); - } - - if (null === $length) { - $realLength = $numParts - $realOffset; - } else { - $realLength = $length < 0 ? $length + $numParts - $realOffset : $length; - if ($realLength < 0 || $realLength > $numParts) { - throw new \OutOfBoundsException(sprintf('Length %d is out of bounds', $length)); - } - } - - if ($realLength === 0) { - // Empty slice is represented as null - return null; - } - - return new static(array_slice($this->parts, $realOffset, $realLength), $this->attributes); - } - - /** - * Concatenate two names, yielding a new Name instance. - * - * The type of the generated instance depends on which class this method is called on, for - * example Name\FullyQualified::concat() will yield a Name\FullyQualified instance. - * - * If one of the arguments is null, a new instance of the other name will be returned. If both - * arguments are null, null will be returned. As such, writing - * Name::concat($namespace, $shortName) - * where $namespace is a Name node or null will work as expected. - * - * @param string|string[]|self|null $name1 The first name - * @param string|string[]|self|null $name2 The second name - * @param array $attributes Attributes to assign to concatenated name - * - * @return static|null Concatenated name - */ - public static function concat($name1, $name2, array $attributes = []) { - if (null === $name1 && null === $name2) { - return null; - } elseif (null === $name1) { - return new static(self::prepareName($name2), $attributes); - } elseif (null === $name2) { - return new static(self::prepareName($name1), $attributes); - } else { - return new static( - array_merge(self::prepareName($name1), self::prepareName($name2)), $attributes - ); - } - } - - /** - * Prepares a (string, array or Name node) name for use in name changing methods by converting - * it to an array. - * - * @param string|string[]|self $name Name to prepare - * - * @return string[] Prepared name - */ - private static function prepareName($name) : array { - if (\is_string($name)) { - if ('' === $name) { - throw new \InvalidArgumentException('Name cannot be empty'); - } - - return explode('\\', $name); - } elseif (\is_array($name)) { - if (empty($name)) { - throw new \InvalidArgumentException('Name cannot be empty'); - } - - return $name; - } elseif ($name instanceof self) { - return $name->parts; - } - - throw new \InvalidArgumentException( - 'Expected string, array of parts or Name instance' - ); - } - - public function getType() : string { - return 'Name'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Name/FullyQualified.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Name/FullyQualified.php deleted file mode 100644 index 1df93a5..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Name/FullyQualified.php +++ /dev/null @@ -1,50 +0,0 @@ -toString(); - } - - public function getType() : string { - return 'Name_FullyQualified'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Name/Relative.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Name/Relative.php deleted file mode 100644 index 57bf7af..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Name/Relative.php +++ /dev/null @@ -1,50 +0,0 @@ -toString(); - } - - public function getType() : string { - return 'Name_Relative'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/NullableType.php b/vendor/nikic/php-parser/lib/PhpParser/Node/NullableType.php deleted file mode 100644 index d68e26a..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/NullableType.php +++ /dev/null @@ -1,28 +0,0 @@ -attributes = $attributes; - $this->type = \is_string($type) ? new Identifier($type) : $type; - } - - public function getSubNodeNames() : array { - return ['type']; - } - - public function getType() : string { - return 'NullableType'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Param.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Param.php deleted file mode 100644 index 1e90b79..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Param.php +++ /dev/null @@ -1,60 +0,0 @@ -attributes = $attributes; - $this->type = \is_string($type) ? new Identifier($type) : $type; - $this->byRef = $byRef; - $this->variadic = $variadic; - $this->var = $var; - $this->default = $default; - $this->flags = $flags; - $this->attrGroups = $attrGroups; - } - - public function getSubNodeNames() : array { - return ['attrGroups', 'flags', 'type', 'byRef', 'variadic', 'var', 'default']; - } - - public function getType() : string { - return 'Param'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar.php deleted file mode 100644 index 8117909..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar.php +++ /dev/null @@ -1,7 +0,0 @@ -attributes = $attributes; - $this->value = $value; - } - - public function getSubNodeNames() : array { - return ['value']; - } - - /** - * @internal - * - * Parses a DNUMBER token like PHP would. - * - * @param string $str A string number - * - * @return float The parsed number - */ - public static function parse(string $str) : float { - $str = str_replace('_', '', $str); - - // if string contains any of .eE just cast it to float - if (false !== strpbrk($str, '.eE')) { - return (float) $str; - } - - // otherwise it's an integer notation that overflowed into a float - // if it starts with 0 it's one of the special integer notations - if ('0' === $str[0]) { - // hex - if ('x' === $str[1] || 'X' === $str[1]) { - return hexdec($str); - } - - // bin - if ('b' === $str[1] || 'B' === $str[1]) { - return bindec($str); - } - - // oct - // substr($str, 0, strcspn($str, '89')) cuts the string at the first invalid digit (8 or 9) - // so that only the digits before that are used - return octdec(substr($str, 0, strcspn($str, '89'))); - } - - // dec - return (float) $str; - } - - public function getType() : string { - return 'Scalar_DNumber'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Encapsed.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Encapsed.php deleted file mode 100644 index fa5d2e2..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Encapsed.php +++ /dev/null @@ -1,31 +0,0 @@ -attributes = $attributes; - $this->parts = $parts; - } - - public function getSubNodeNames() : array { - return ['parts']; - } - - public function getType() : string { - return 'Scalar_Encapsed'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/EncapsedStringPart.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/EncapsedStringPart.php deleted file mode 100644 index bb3194c..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/EncapsedStringPart.php +++ /dev/null @@ -1,30 +0,0 @@ -attributes = $attributes; - $this->value = $value; - } - - public function getSubNodeNames() : array { - return ['value']; - } - - public function getType() : string { - return 'Scalar_EncapsedStringPart'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/LNumber.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/LNumber.php deleted file mode 100644 index f17dd1f..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/LNumber.php +++ /dev/null @@ -1,78 +0,0 @@ -attributes = $attributes; - $this->value = $value; - } - - public function getSubNodeNames() : array { - return ['value']; - } - - /** - * Constructs an LNumber node from a string number literal. - * - * @param string $str String number literal (decimal, octal, hex or binary) - * @param array $attributes Additional attributes - * @param bool $allowInvalidOctal Whether to allow invalid octal numbers (PHP 5) - * - * @return LNumber The constructed LNumber, including kind attribute - */ - public static function fromString(string $str, array $attributes = [], bool $allowInvalidOctal = false) : LNumber { - $str = str_replace('_', '', $str); - - if ('0' !== $str[0] || '0' === $str) { - $attributes['kind'] = LNumber::KIND_DEC; - return new LNumber((int) $str, $attributes); - } - - if ('x' === $str[1] || 'X' === $str[1]) { - $attributes['kind'] = LNumber::KIND_HEX; - return new LNumber(hexdec($str), $attributes); - } - - if ('b' === $str[1] || 'B' === $str[1]) { - $attributes['kind'] = LNumber::KIND_BIN; - return new LNumber(bindec($str), $attributes); - } - - if (!$allowInvalidOctal && strpbrk($str, '89')) { - throw new Error('Invalid numeric literal', $attributes); - } - - // Strip optional explicit octal prefix. - if ('o' === $str[1] || 'O' === $str[1]) { - $str = substr($str, 2); - } - - // use intval instead of octdec to get proper cutting behavior with malformed numbers - $attributes['kind'] = LNumber::KIND_OCT; - return new LNumber(intval($str, 8), $attributes); - } - - public function getType() : string { - return 'Scalar_LNumber'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst.php deleted file mode 100644 index 941f0c7..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst.php +++ /dev/null @@ -1,28 +0,0 @@ -attributes = $attributes; - } - - public function getSubNodeNames() : array { - return []; - } - - /** - * Get name of magic constant. - * - * @return string Name of magic constant - */ - abstract public function getName() : string; -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Class_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Class_.php deleted file mode 100644 index 2443284..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Class_.php +++ /dev/null @@ -1,16 +0,0 @@ - '\\', - '$' => '$', - 'n' => "\n", - 'r' => "\r", - 't' => "\t", - 'f' => "\f", - 'v' => "\v", - 'e' => "\x1B", - ]; - - /** - * Constructs a string scalar node. - * - * @param string $value Value of the string - * @param array $attributes Additional attributes - */ - public function __construct(string $value, array $attributes = []) { - $this->attributes = $attributes; - $this->value = $value; - } - - public function getSubNodeNames() : array { - return ['value']; - } - - /** - * @internal - * - * Parses a string token. - * - * @param string $str String token content - * @param bool $parseUnicodeEscape Whether to parse PHP 7 \u escapes - * - * @return string The parsed string - */ - public static function parse(string $str, bool $parseUnicodeEscape = true) : string { - $bLength = 0; - if ('b' === $str[0] || 'B' === $str[0]) { - $bLength = 1; - } - - if ('\'' === $str[$bLength]) { - return str_replace( - ['\\\\', '\\\''], - ['\\', '\''], - substr($str, $bLength + 1, -1) - ); - } else { - return self::parseEscapeSequences( - substr($str, $bLength + 1, -1), '"', $parseUnicodeEscape - ); - } - } - - /** - * @internal - * - * Parses escape sequences in strings (all string types apart from single quoted). - * - * @param string $str String without quotes - * @param null|string $quote Quote type - * @param bool $parseUnicodeEscape Whether to parse PHP 7 \u escapes - * - * @return string String with escape sequences parsed - */ - public static function parseEscapeSequences(string $str, $quote, bool $parseUnicodeEscape = true) : string { - if (null !== $quote) { - $str = str_replace('\\' . $quote, $quote, $str); - } - - $extra = ''; - if ($parseUnicodeEscape) { - $extra = '|u\{([0-9a-fA-F]+)\}'; - } - - return preg_replace_callback( - '~\\\\([\\\\$nrtfve]|[xX][0-9a-fA-F]{1,2}|[0-7]{1,3}' . $extra . ')~', - function($matches) { - $str = $matches[1]; - - if (isset(self::$replacements[$str])) { - return self::$replacements[$str]; - } elseif ('x' === $str[0] || 'X' === $str[0]) { - return chr(hexdec(substr($str, 1))); - } elseif ('u' === $str[0]) { - return self::codePointToUtf8(hexdec($matches[2])); - } else { - return chr(octdec($str)); - } - }, - $str - ); - } - - /** - * Converts a Unicode code point to its UTF-8 encoded representation. - * - * @param int $num Code point - * - * @return string UTF-8 representation of code point - */ - private static function codePointToUtf8(int $num) : string { - if ($num <= 0x7F) { - return chr($num); - } - if ($num <= 0x7FF) { - return chr(($num>>6) + 0xC0) . chr(($num&0x3F) + 0x80); - } - if ($num <= 0xFFFF) { - return chr(($num>>12) + 0xE0) . chr((($num>>6)&0x3F) + 0x80) . chr(($num&0x3F) + 0x80); - } - if ($num <= 0x1FFFFF) { - return chr(($num>>18) + 0xF0) . chr((($num>>12)&0x3F) + 0x80) - . chr((($num>>6)&0x3F) + 0x80) . chr(($num&0x3F) + 0x80); - } - throw new Error('Invalid UTF-8 codepoint escape sequence: Codepoint too large'); - } - - public function getType() : string { - return 'Scalar_String'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt.php deleted file mode 100644 index 69d33e5..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt.php +++ /dev/null @@ -1,9 +0,0 @@ -attributes = $attributes; - $this->num = $num; - } - - public function getSubNodeNames() : array { - return ['num']; - } - - public function getType() : string { - return 'Stmt_Break'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Case_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Case_.php deleted file mode 100644 index 2bf044c..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Case_.php +++ /dev/null @@ -1,34 +0,0 @@ -attributes = $attributes; - $this->cond = $cond; - $this->stmts = $stmts; - } - - public function getSubNodeNames() : array { - return ['cond', 'stmts']; - } - - public function getType() : string { - return 'Stmt_Case'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Catch_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Catch_.php deleted file mode 100644 index 9b9c094..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Catch_.php +++ /dev/null @@ -1,41 +0,0 @@ -attributes = $attributes; - $this->types = $types; - $this->var = $var; - $this->stmts = $stmts; - } - - public function getSubNodeNames() : array { - return ['types', 'var', 'stmts']; - } - - public function getType() : string { - return 'Stmt_Catch'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php deleted file mode 100644 index 1fc7f33..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php +++ /dev/null @@ -1,80 +0,0 @@ -attributes = $attributes; - $this->flags = $flags; - $this->consts = $consts; - $this->attrGroups = $attrGroups; - } - - public function getSubNodeNames() : array { - return ['attrGroups', 'flags', 'consts']; - } - - /** - * Whether constant is explicitly or implicitly public. - * - * @return bool - */ - public function isPublic() : bool { - return ($this->flags & Class_::MODIFIER_PUBLIC) !== 0 - || ($this->flags & Class_::VISIBILITY_MODIFIER_MASK) === 0; - } - - /** - * Whether constant is protected. - * - * @return bool - */ - public function isProtected() : bool { - return (bool) ($this->flags & Class_::MODIFIER_PROTECTED); - } - - /** - * Whether constant is private. - * - * @return bool - */ - public function isPrivate() : bool { - return (bool) ($this->flags & Class_::MODIFIER_PRIVATE); - } - - /** - * Whether constant is final. - * - * @return bool - */ - public function isFinal() : bool { - return (bool) ($this->flags & Class_::MODIFIER_FINAL); - } - - public function getType() : string { - return 'Stmt_ClassConst'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassLike.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassLike.php deleted file mode 100644 index 6c33691..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassLike.php +++ /dev/null @@ -1,109 +0,0 @@ -stmts as $stmt) { - if ($stmt instanceof TraitUse) { - $traitUses[] = $stmt; - } - } - return $traitUses; - } - - /** - * @return ClassConst[] - */ - public function getConstants() : array { - $constants = []; - foreach ($this->stmts as $stmt) { - if ($stmt instanceof ClassConst) { - $constants[] = $stmt; - } - } - return $constants; - } - - /** - * @return Property[] - */ - public function getProperties() : array { - $properties = []; - foreach ($this->stmts as $stmt) { - if ($stmt instanceof Property) { - $properties[] = $stmt; - } - } - return $properties; - } - - /** - * Gets property with the given name defined directly in this class/interface/trait. - * - * @param string $name Name of the property - * - * @return Property|null Property node or null if the property does not exist - */ - public function getProperty(string $name) { - foreach ($this->stmts as $stmt) { - if ($stmt instanceof Property) { - foreach ($stmt->props as $prop) { - if ($prop instanceof PropertyProperty && $name === $prop->name->toString()) { - return $stmt; - } - } - } - } - return null; - } - - /** - * Gets all methods defined directly in this class/interface/trait - * - * @return ClassMethod[] - */ - public function getMethods() : array { - $methods = []; - foreach ($this->stmts as $stmt) { - if ($stmt instanceof ClassMethod) { - $methods[] = $stmt; - } - } - return $methods; - } - - /** - * Gets method with the given name defined directly in this class/interface/trait. - * - * @param string $name Name of the method (compared case-insensitively) - * - * @return ClassMethod|null Method node or null if the method does not exist - */ - public function getMethod(string $name) { - $lowerName = strtolower($name); - foreach ($this->stmts as $stmt) { - if ($stmt instanceof ClassMethod && $lowerName === $stmt->name->toLowerString()) { - return $stmt; - } - } - return null; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassMethod.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassMethod.php deleted file mode 100644 index 09b877a..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassMethod.php +++ /dev/null @@ -1,159 +0,0 @@ - true, - '__destruct' => true, - '__call' => true, - '__callstatic' => true, - '__get' => true, - '__set' => true, - '__isset' => true, - '__unset' => true, - '__sleep' => true, - '__wakeup' => true, - '__tostring' => true, - '__set_state' => true, - '__clone' => true, - '__invoke' => true, - '__debuginfo' => true, - ]; - - /** - * Constructs a class method node. - * - * @param string|Node\Identifier $name Name - * @param array $subNodes Array of the following optional subnodes: - * 'flags => MODIFIER_PUBLIC: Flags - * 'byRef' => false : Whether to return by reference - * 'params' => array() : Parameters - * 'returnType' => null : Return type - * 'stmts' => array() : Statements - * 'attrGroups' => array() : PHP attribute groups - * @param array $attributes Additional attributes - */ - public function __construct($name, array $subNodes = [], array $attributes = []) { - $this->attributes = $attributes; - $this->flags = $subNodes['flags'] ?? $subNodes['type'] ?? 0; - $this->byRef = $subNodes['byRef'] ?? false; - $this->name = \is_string($name) ? new Node\Identifier($name) : $name; - $this->params = $subNodes['params'] ?? []; - $returnType = $subNodes['returnType'] ?? null; - $this->returnType = \is_string($returnType) ? new Node\Identifier($returnType) : $returnType; - $this->stmts = array_key_exists('stmts', $subNodes) ? $subNodes['stmts'] : []; - $this->attrGroups = $subNodes['attrGroups'] ?? []; - } - - public function getSubNodeNames() : array { - return ['attrGroups', 'flags', 'byRef', 'name', 'params', 'returnType', 'stmts']; - } - - public function returnsByRef() : bool { - return $this->byRef; - } - - public function getParams() : array { - return $this->params; - } - - public function getReturnType() { - return $this->returnType; - } - - public function getStmts() { - return $this->stmts; - } - - public function getAttrGroups() : array { - return $this->attrGroups; - } - - /** - * Whether the method is explicitly or implicitly public. - * - * @return bool - */ - public function isPublic() : bool { - return ($this->flags & Class_::MODIFIER_PUBLIC) !== 0 - || ($this->flags & Class_::VISIBILITY_MODIFIER_MASK) === 0; - } - - /** - * Whether the method is protected. - * - * @return bool - */ - public function isProtected() : bool { - return (bool) ($this->flags & Class_::MODIFIER_PROTECTED); - } - - /** - * Whether the method is private. - * - * @return bool - */ - public function isPrivate() : bool { - return (bool) ($this->flags & Class_::MODIFIER_PRIVATE); - } - - /** - * Whether the method is abstract. - * - * @return bool - */ - public function isAbstract() : bool { - return (bool) ($this->flags & Class_::MODIFIER_ABSTRACT); - } - - /** - * Whether the method is final. - * - * @return bool - */ - public function isFinal() : bool { - return (bool) ($this->flags & Class_::MODIFIER_FINAL); - } - - /** - * Whether the method is static. - * - * @return bool - */ - public function isStatic() : bool { - return (bool) ($this->flags & Class_::MODIFIER_STATIC); - } - - /** - * Whether the method is magic. - * - * @return bool - */ - public function isMagic() : bool { - return isset(self::$magicNames[$this->name->toLowerString()]); - } - - public function getType() : string { - return 'Stmt_ClassMethod'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php deleted file mode 100644 index b290aaf..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php +++ /dev/null @@ -1,112 +0,0 @@ - 0 : Flags - * 'extends' => null : Name of extended class - * 'implements' => array(): Names of implemented interfaces - * 'stmts' => array(): Statements - * 'attrGroups' => array(): PHP attribute groups - * @param array $attributes Additional attributes - */ - public function __construct($name, array $subNodes = [], array $attributes = []) { - $this->attributes = $attributes; - $this->flags = $subNodes['flags'] ?? $subNodes['type'] ?? 0; - $this->name = \is_string($name) ? new Node\Identifier($name) : $name; - $this->extends = $subNodes['extends'] ?? null; - $this->implements = $subNodes['implements'] ?? []; - $this->stmts = $subNodes['stmts'] ?? []; - $this->attrGroups = $subNodes['attrGroups'] ?? []; - } - - public function getSubNodeNames() : array { - return ['attrGroups', 'flags', 'name', 'extends', 'implements', 'stmts']; - } - - /** - * Whether the class is explicitly abstract. - * - * @return bool - */ - public function isAbstract() : bool { - return (bool) ($this->flags & self::MODIFIER_ABSTRACT); - } - - /** - * Whether the class is final. - * - * @return bool - */ - public function isFinal() : bool { - return (bool) ($this->flags & self::MODIFIER_FINAL); - } - - /** - * Whether the class is anonymous. - * - * @return bool - */ - public function isAnonymous() : bool { - return null === $this->name; - } - - /** - * @internal - */ - public static function verifyModifier($a, $b) { - if ($a & self::VISIBILITY_MODIFIER_MASK && $b & self::VISIBILITY_MODIFIER_MASK) { - throw new Error('Multiple access type modifiers are not allowed'); - } - - if ($a & self::MODIFIER_ABSTRACT && $b & self::MODIFIER_ABSTRACT) { - throw new Error('Multiple abstract modifiers are not allowed'); - } - - if ($a & self::MODIFIER_STATIC && $b & self::MODIFIER_STATIC) { - throw new Error('Multiple static modifiers are not allowed'); - } - - if ($a & self::MODIFIER_FINAL && $b & self::MODIFIER_FINAL) { - throw new Error('Multiple final modifiers are not allowed'); - } - - if ($a & self::MODIFIER_READONLY && $b & self::MODIFIER_READONLY) { - throw new Error('Multiple readonly modifiers are not allowed'); - } - - if ($a & 48 && $b & 48) { - throw new Error('Cannot use the final modifier on an abstract class member'); - } - } - - public function getType() : string { - return 'Stmt_Class'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Const_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Const_.php deleted file mode 100644 index e631634..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Const_.php +++ /dev/null @@ -1,30 +0,0 @@ -attributes = $attributes; - $this->consts = $consts; - } - - public function getSubNodeNames() : array { - return ['consts']; - } - - public function getType() : string { - return 'Stmt_Const'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Continue_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Continue_.php deleted file mode 100644 index 2488268..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Continue_.php +++ /dev/null @@ -1,30 +0,0 @@ -attributes = $attributes; - $this->num = $num; - } - - public function getSubNodeNames() : array { - return ['num']; - } - - public function getType() : string { - return 'Stmt_Continue'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/DeclareDeclare.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/DeclareDeclare.php deleted file mode 100644 index ac07f30..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/DeclareDeclare.php +++ /dev/null @@ -1,34 +0,0 @@ -value pair node. - * - * @param string|Node\Identifier $key Key - * @param Node\Expr $value Value - * @param array $attributes Additional attributes - */ - public function __construct($key, Node\Expr $value, array $attributes = []) { - $this->attributes = $attributes; - $this->key = \is_string($key) ? new Node\Identifier($key) : $key; - $this->value = $value; - } - - public function getSubNodeNames() : array { - return ['key', 'value']; - } - - public function getType() : string { - return 'Stmt_DeclareDeclare'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Declare_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Declare_.php deleted file mode 100644 index f46ff0b..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Declare_.php +++ /dev/null @@ -1,34 +0,0 @@ -attributes = $attributes; - $this->declares = $declares; - $this->stmts = $stmts; - } - - public function getSubNodeNames() : array { - return ['declares', 'stmts']; - } - - public function getType() : string { - return 'Stmt_Declare'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Do_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Do_.php deleted file mode 100644 index 78e90da..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Do_.php +++ /dev/null @@ -1,34 +0,0 @@ -attributes = $attributes; - $this->cond = $cond; - $this->stmts = $stmts; - } - - public function getSubNodeNames() : array { - return ['stmts', 'cond']; - } - - public function getType() : string { - return 'Stmt_Do'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Echo_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Echo_.php deleted file mode 100644 index 7cc50d5..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Echo_.php +++ /dev/null @@ -1,30 +0,0 @@ -attributes = $attributes; - $this->exprs = $exprs; - } - - public function getSubNodeNames() : array { - return ['exprs']; - } - - public function getType() : string { - return 'Stmt_Echo'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ElseIf_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ElseIf_.php deleted file mode 100644 index eef1ece..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ElseIf_.php +++ /dev/null @@ -1,34 +0,0 @@ -attributes = $attributes; - $this->cond = $cond; - $this->stmts = $stmts; - } - - public function getSubNodeNames() : array { - return ['cond', 'stmts']; - } - - public function getType() : string { - return 'Stmt_ElseIf'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Else_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Else_.php deleted file mode 100644 index 0e61778..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Else_.php +++ /dev/null @@ -1,30 +0,0 @@ -attributes = $attributes; - $this->stmts = $stmts; - } - - public function getSubNodeNames() : array { - return ['stmts']; - } - - public function getType() : string { - return 'Stmt_Else'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/EnumCase.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/EnumCase.php deleted file mode 100644 index 5beff8b..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/EnumCase.php +++ /dev/null @@ -1,37 +0,0 @@ -name = \is_string($name) ? new Node\Identifier($name) : $name; - $this->expr = $expr; - $this->attrGroups = $attrGroups; - } - - public function getSubNodeNames() : array { - return ['attrGroups', 'name', 'expr']; - } - - public function getType() : string { - return 'Stmt_EnumCase'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Enum_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Enum_.php deleted file mode 100644 index 3a50c22..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Enum_.php +++ /dev/null @@ -1,40 +0,0 @@ - null : Scalar type - * 'implements' => array() : Names of implemented interfaces - * 'stmts' => array() : Statements - * 'attrGroups' => array() : PHP attribute groups - * @param array $attributes Additional attributes - */ - public function __construct($name, array $subNodes = [], array $attributes = []) { - $this->name = \is_string($name) ? new Node\Identifier($name) : $name; - $this->scalarType = $subNodes['scalarType'] ?? null; - $this->implements = $subNodes['implements'] ?? []; - $this->stmts = $subNodes['stmts'] ?? []; - $this->attrGroups = $subNodes['attrGroups'] ?? []; - - parent::__construct($attributes); - } - - public function getSubNodeNames() : array { - return ['attrGroups', 'name', 'scalarType', 'implements', 'stmts']; - } - - public function getType() : string { - return 'Stmt_Enum'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Expression.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Expression.php deleted file mode 100644 index 99d1687..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Expression.php +++ /dev/null @@ -1,33 +0,0 @@ -attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames() : array { - return ['expr']; - } - - public function getType() : string { - return 'Stmt_Expression'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Finally_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Finally_.php deleted file mode 100644 index d55b8b6..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Finally_.php +++ /dev/null @@ -1,30 +0,0 @@ -attributes = $attributes; - $this->stmts = $stmts; - } - - public function getSubNodeNames() : array { - return ['stmts']; - } - - public function getType() : string { - return 'Stmt_Finally'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/For_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/For_.php deleted file mode 100644 index 1323d37..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/For_.php +++ /dev/null @@ -1,43 +0,0 @@ - array(): Init expressions - * 'cond' => array(): Loop conditions - * 'loop' => array(): Loop expressions - * 'stmts' => array(): Statements - * @param array $attributes Additional attributes - */ - public function __construct(array $subNodes = [], array $attributes = []) { - $this->attributes = $attributes; - $this->init = $subNodes['init'] ?? []; - $this->cond = $subNodes['cond'] ?? []; - $this->loop = $subNodes['loop'] ?? []; - $this->stmts = $subNodes['stmts'] ?? []; - } - - public function getSubNodeNames() : array { - return ['init', 'cond', 'loop', 'stmts']; - } - - public function getType() : string { - return 'Stmt_For'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Foreach_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Foreach_.php deleted file mode 100644 index 0556a7c..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Foreach_.php +++ /dev/null @@ -1,47 +0,0 @@ - null : Variable to assign key to - * 'byRef' => false : Whether to assign value by reference - * 'stmts' => array(): Statements - * @param array $attributes Additional attributes - */ - public function __construct(Node\Expr $expr, Node\Expr $valueVar, array $subNodes = [], array $attributes = []) { - $this->attributes = $attributes; - $this->expr = $expr; - $this->keyVar = $subNodes['keyVar'] ?? null; - $this->byRef = $subNodes['byRef'] ?? false; - $this->valueVar = $valueVar; - $this->stmts = $subNodes['stmts'] ?? []; - } - - public function getSubNodeNames() : array { - return ['expr', 'keyVar', 'byRef', 'valueVar', 'stmts']; - } - - public function getType() : string { - return 'Stmt_Foreach'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Function_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Function_.php deleted file mode 100644 index abb7ee5..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Function_.php +++ /dev/null @@ -1,77 +0,0 @@ - false : Whether to return by reference - * 'params' => array(): Parameters - * 'returnType' => null : Return type - * 'stmts' => array(): Statements - * 'attrGroups' => array(): PHP attribute groups - * @param array $attributes Additional attributes - */ - public function __construct($name, array $subNodes = [], array $attributes = []) { - $this->attributes = $attributes; - $this->byRef = $subNodes['byRef'] ?? false; - $this->name = \is_string($name) ? new Node\Identifier($name) : $name; - $this->params = $subNodes['params'] ?? []; - $returnType = $subNodes['returnType'] ?? null; - $this->returnType = \is_string($returnType) ? new Node\Identifier($returnType) : $returnType; - $this->stmts = $subNodes['stmts'] ?? []; - $this->attrGroups = $subNodes['attrGroups'] ?? []; - } - - public function getSubNodeNames() : array { - return ['attrGroups', 'byRef', 'name', 'params', 'returnType', 'stmts']; - } - - public function returnsByRef() : bool { - return $this->byRef; - } - - public function getParams() : array { - return $this->params; - } - - public function getReturnType() { - return $this->returnType; - } - - public function getAttrGroups() : array { - return $this->attrGroups; - } - - /** @return Node\Stmt[] */ - public function getStmts() : array { - return $this->stmts; - } - - public function getType() : string { - return 'Stmt_Function'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Global_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Global_.php deleted file mode 100644 index a0022ad..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Global_.php +++ /dev/null @@ -1,30 +0,0 @@ -attributes = $attributes; - $this->vars = $vars; - } - - public function getSubNodeNames() : array { - return ['vars']; - } - - public function getType() : string { - return 'Stmt_Global'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Goto_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Goto_.php deleted file mode 100644 index 24a57f7..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Goto_.php +++ /dev/null @@ -1,31 +0,0 @@ -attributes = $attributes; - $this->name = \is_string($name) ? new Identifier($name) : $name; - } - - public function getSubNodeNames() : array { - return ['name']; - } - - public function getType() : string { - return 'Stmt_Goto'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/GroupUse.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/GroupUse.php deleted file mode 100644 index 24520d2..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/GroupUse.php +++ /dev/null @@ -1,39 +0,0 @@ -attributes = $attributes; - $this->type = $type; - $this->prefix = $prefix; - $this->uses = $uses; - } - - public function getSubNodeNames() : array { - return ['type', 'prefix', 'uses']; - } - - public function getType() : string { - return 'Stmt_GroupUse'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/HaltCompiler.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/HaltCompiler.php deleted file mode 100644 index 8e624e0..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/HaltCompiler.php +++ /dev/null @@ -1,30 +0,0 @@ -attributes = $attributes; - $this->remaining = $remaining; - } - - public function getSubNodeNames() : array { - return ['remaining']; - } - - public function getType() : string { - return 'Stmt_HaltCompiler'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/If_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/If_.php deleted file mode 100644 index a1bae4b..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/If_.php +++ /dev/null @@ -1,43 +0,0 @@ - array(): Statements - * 'elseifs' => array(): Elseif clauses - * 'else' => null : Else clause - * @param array $attributes Additional attributes - */ - public function __construct(Node\Expr $cond, array $subNodes = [], array $attributes = []) { - $this->attributes = $attributes; - $this->cond = $cond; - $this->stmts = $subNodes['stmts'] ?? []; - $this->elseifs = $subNodes['elseifs'] ?? []; - $this->else = $subNodes['else'] ?? null; - } - - public function getSubNodeNames() : array { - return ['cond', 'stmts', 'elseifs', 'else']; - } - - public function getType() : string { - return 'Stmt_If'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/InlineHTML.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/InlineHTML.php deleted file mode 100644 index 0711d28..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/InlineHTML.php +++ /dev/null @@ -1,30 +0,0 @@ -attributes = $attributes; - $this->value = $value; - } - - public function getSubNodeNames() : array { - return ['value']; - } - - public function getType() : string { - return 'Stmt_InlineHTML'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Interface_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Interface_.php deleted file mode 100644 index 4d587dd..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Interface_.php +++ /dev/null @@ -1,37 +0,0 @@ - array(): Name of extended interfaces - * 'stmts' => array(): Statements - * 'attrGroups' => array(): PHP attribute groups - * @param array $attributes Additional attributes - */ - public function __construct($name, array $subNodes = [], array $attributes = []) { - $this->attributes = $attributes; - $this->name = \is_string($name) ? new Node\Identifier($name) : $name; - $this->extends = $subNodes['extends'] ?? []; - $this->stmts = $subNodes['stmts'] ?? []; - $this->attrGroups = $subNodes['attrGroups'] ?? []; - } - - public function getSubNodeNames() : array { - return ['attrGroups', 'name', 'extends', 'stmts']; - } - - public function getType() : string { - return 'Stmt_Interface'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Label.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Label.php deleted file mode 100644 index 3edcb3b..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Label.php +++ /dev/null @@ -1,31 +0,0 @@ -attributes = $attributes; - $this->name = \is_string($name) ? new Identifier($name) : $name; - } - - public function getSubNodeNames() : array { - return ['name']; - } - - public function getType() : string { - return 'Stmt_Label'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Namespace_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Namespace_.php deleted file mode 100644 index c632045..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Namespace_.php +++ /dev/null @@ -1,38 +0,0 @@ -attributes = $attributes; - $this->name = $name; - $this->stmts = $stmts; - } - - public function getSubNodeNames() : array { - return ['name', 'stmts']; - } - - public function getType() : string { - return 'Stmt_Namespace'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Nop.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Nop.php deleted file mode 100644 index f86f8df..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Nop.php +++ /dev/null @@ -1,17 +0,0 @@ -attributes = $attributes; - $this->flags = $flags; - $this->props = $props; - $this->type = \is_string($type) ? new Identifier($type) : $type; - $this->attrGroups = $attrGroups; - } - - public function getSubNodeNames() : array { - return ['attrGroups', 'flags', 'type', 'props']; - } - - /** - * Whether the property is explicitly or implicitly public. - * - * @return bool - */ - public function isPublic() : bool { - return ($this->flags & Class_::MODIFIER_PUBLIC) !== 0 - || ($this->flags & Class_::VISIBILITY_MODIFIER_MASK) === 0; - } - - /** - * Whether the property is protected. - * - * @return bool - */ - public function isProtected() : bool { - return (bool) ($this->flags & Class_::MODIFIER_PROTECTED); - } - - /** - * Whether the property is private. - * - * @return bool - */ - public function isPrivate() : bool { - return (bool) ($this->flags & Class_::MODIFIER_PRIVATE); - } - - /** - * Whether the property is static. - * - * @return bool - */ - public function isStatic() : bool { - return (bool) ($this->flags & Class_::MODIFIER_STATIC); - } - - /** - * Whether the property is readonly. - * - * @return bool - */ - public function isReadonly() : bool { - return (bool) ($this->flags & Class_::MODIFIER_READONLY); - } - - public function getType() : string { - return 'Stmt_Property'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/PropertyProperty.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/PropertyProperty.php deleted file mode 100644 index 205731e..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/PropertyProperty.php +++ /dev/null @@ -1,34 +0,0 @@ -attributes = $attributes; - $this->name = \is_string($name) ? new Node\VarLikeIdentifier($name) : $name; - $this->default = $default; - } - - public function getSubNodeNames() : array { - return ['name', 'default']; - } - - public function getType() : string { - return 'Stmt_PropertyProperty'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Return_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Return_.php deleted file mode 100644 index efc578c..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Return_.php +++ /dev/null @@ -1,30 +0,0 @@ -attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames() : array { - return ['expr']; - } - - public function getType() : string { - return 'Stmt_Return'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/StaticVar.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/StaticVar.php deleted file mode 100644 index 2958456..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/StaticVar.php +++ /dev/null @@ -1,37 +0,0 @@ -attributes = $attributes; - $this->var = $var; - $this->default = $default; - } - - public function getSubNodeNames() : array { - return ['var', 'default']; - } - - public function getType() : string { - return 'Stmt_StaticVar'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Static_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Static_.php deleted file mode 100644 index 464898f..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Static_.php +++ /dev/null @@ -1,30 +0,0 @@ -attributes = $attributes; - $this->vars = $vars; - } - - public function getSubNodeNames() : array { - return ['vars']; - } - - public function getType() : string { - return 'Stmt_Static'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Switch_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Switch_.php deleted file mode 100644 index 2c8dae0..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Switch_.php +++ /dev/null @@ -1,34 +0,0 @@ -attributes = $attributes; - $this->cond = $cond; - $this->cases = $cases; - } - - public function getSubNodeNames() : array { - return ['cond', 'cases']; - } - - public function getType() : string { - return 'Stmt_Switch'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Throw_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Throw_.php deleted file mode 100644 index a34e2b3..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Throw_.php +++ /dev/null @@ -1,30 +0,0 @@ -attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames() : array { - return ['expr']; - } - - public function getType() : string { - return 'Stmt_Throw'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUse.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUse.php deleted file mode 100644 index 9e97053..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUse.php +++ /dev/null @@ -1,34 +0,0 @@ -attributes = $attributes; - $this->traits = $traits; - $this->adaptations = $adaptations; - } - - public function getSubNodeNames() : array { - return ['traits', 'adaptations']; - } - - public function getType() : string { - return 'Stmt_TraitUse'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation.php deleted file mode 100644 index 8bdd2c0..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation.php +++ /dev/null @@ -1,13 +0,0 @@ -attributes = $attributes; - $this->trait = $trait; - $this->method = \is_string($method) ? new Node\Identifier($method) : $method; - $this->newModifier = $newModifier; - $this->newName = \is_string($newName) ? new Node\Identifier($newName) : $newName; - } - - public function getSubNodeNames() : array { - return ['trait', 'method', 'newModifier', 'newName']; - } - - public function getType() : string { - return 'Stmt_TraitUseAdaptation_Alias'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Precedence.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Precedence.php deleted file mode 100644 index 80385f6..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Precedence.php +++ /dev/null @@ -1,34 +0,0 @@ -attributes = $attributes; - $this->trait = $trait; - $this->method = \is_string($method) ? new Node\Identifier($method) : $method; - $this->insteadof = $insteadof; - } - - public function getSubNodeNames() : array { - return ['trait', 'method', 'insteadof']; - } - - public function getType() : string { - return 'Stmt_TraitUseAdaptation_Precedence'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Trait_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Trait_.php deleted file mode 100644 index 0cec203..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Trait_.php +++ /dev/null @@ -1,32 +0,0 @@ - array(): Statements - * 'attrGroups' => array(): PHP attribute groups - * @param array $attributes Additional attributes - */ - public function __construct($name, array $subNodes = [], array $attributes = []) { - $this->attributes = $attributes; - $this->name = \is_string($name) ? new Node\Identifier($name) : $name; - $this->stmts = $subNodes['stmts'] ?? []; - $this->attrGroups = $subNodes['attrGroups'] ?? []; - } - - public function getSubNodeNames() : array { - return ['attrGroups', 'name', 'stmts']; - } - - public function getType() : string { - return 'Stmt_Trait'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php deleted file mode 100644 index 7fc158c..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php +++ /dev/null @@ -1,38 +0,0 @@ -attributes = $attributes; - $this->stmts = $stmts; - $this->catches = $catches; - $this->finally = $finally; - } - - public function getSubNodeNames() : array { - return ['stmts', 'catches', 'finally']; - } - - public function getType() : string { - return 'Stmt_TryCatch'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Unset_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Unset_.php deleted file mode 100644 index 310e427..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Unset_.php +++ /dev/null @@ -1,30 +0,0 @@ -attributes = $attributes; - $this->vars = $vars; - } - - public function getSubNodeNames() : array { - return ['vars']; - } - - public function getType() : string { - return 'Stmt_Unset'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/UseUse.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/UseUse.php deleted file mode 100644 index 32bd784..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/UseUse.php +++ /dev/null @@ -1,52 +0,0 @@ -attributes = $attributes; - $this->type = $type; - $this->name = $name; - $this->alias = \is_string($alias) ? new Identifier($alias) : $alias; - } - - public function getSubNodeNames() : array { - return ['type', 'name', 'alias']; - } - - /** - * Get alias. If not explicitly given this is the last component of the used name. - * - * @return Identifier - */ - public function getAlias() : Identifier { - if (null !== $this->alias) { - return $this->alias; - } - - return new Identifier($this->name->getLast()); - } - - public function getType() : string { - return 'Stmt_UseUse'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Use_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Use_.php deleted file mode 100644 index 8753da3..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Use_.php +++ /dev/null @@ -1,47 +0,0 @@ -attributes = $attributes; - $this->type = $type; - $this->uses = $uses; - } - - public function getSubNodeNames() : array { - return ['type', 'uses']; - } - - public function getType() : string { - return 'Stmt_Use'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/While_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/While_.php deleted file mode 100644 index f41034f..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/While_.php +++ /dev/null @@ -1,34 +0,0 @@ -attributes = $attributes; - $this->cond = $cond; - $this->stmts = $stmts; - } - - public function getSubNodeNames() : array { - return ['cond', 'stmts']; - } - - public function getType() : string { - return 'Stmt_While'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/UnionType.php b/vendor/nikic/php-parser/lib/PhpParser/Node/UnionType.php deleted file mode 100644 index 61c2d81..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/UnionType.php +++ /dev/null @@ -1,28 +0,0 @@ -attributes = $attributes; - $this->types = $types; - } - - public function getSubNodeNames() : array { - return ['types']; - } - - public function getType() : string { - return 'UnionType'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/VarLikeIdentifier.php b/vendor/nikic/php-parser/lib/PhpParser/Node/VarLikeIdentifier.php deleted file mode 100644 index a30807a..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/VarLikeIdentifier.php +++ /dev/null @@ -1,17 +0,0 @@ -attributes = $attributes; - } - - public function getType(): string { - return 'VariadicPlaceholder'; - } - - public function getSubNodeNames(): array { - return []; - } -} \ No newline at end of file diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php b/vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php deleted file mode 100644 index 04514da..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php +++ /dev/null @@ -1,178 +0,0 @@ -attributes = $attributes; - } - - /** - * Gets line the node started in (alias of getStartLine). - * - * @return int Start line (or -1 if not available) - */ - public function getLine() : int { - return $this->attributes['startLine'] ?? -1; - } - - /** - * Gets line the node started in. - * - * Requires the 'startLine' attribute to be enabled in the lexer (enabled by default). - * - * @return int Start line (or -1 if not available) - */ - public function getStartLine() : int { - return $this->attributes['startLine'] ?? -1; - } - - /** - * Gets the line the node ended in. - * - * Requires the 'endLine' attribute to be enabled in the lexer (enabled by default). - * - * @return int End line (or -1 if not available) - */ - public function getEndLine() : int { - return $this->attributes['endLine'] ?? -1; - } - - /** - * Gets the token offset of the first token that is part of this node. - * - * The offset is an index into the array returned by Lexer::getTokens(). - * - * Requires the 'startTokenPos' attribute to be enabled in the lexer (DISABLED by default). - * - * @return int Token start position (or -1 if not available) - */ - public function getStartTokenPos() : int { - return $this->attributes['startTokenPos'] ?? -1; - } - - /** - * Gets the token offset of the last token that is part of this node. - * - * The offset is an index into the array returned by Lexer::getTokens(). - * - * Requires the 'endTokenPos' attribute to be enabled in the lexer (DISABLED by default). - * - * @return int Token end position (or -1 if not available) - */ - public function getEndTokenPos() : int { - return $this->attributes['endTokenPos'] ?? -1; - } - - /** - * Gets the file offset of the first character that is part of this node. - * - * Requires the 'startFilePos' attribute to be enabled in the lexer (DISABLED by default). - * - * @return int File start position (or -1 if not available) - */ - public function getStartFilePos() : int { - return $this->attributes['startFilePos'] ?? -1; - } - - /** - * Gets the file offset of the last character that is part of this node. - * - * Requires the 'endFilePos' attribute to be enabled in the lexer (DISABLED by default). - * - * @return int File end position (or -1 if not available) - */ - public function getEndFilePos() : int { - return $this->attributes['endFilePos'] ?? -1; - } - - /** - * Gets all comments directly preceding this node. - * - * The comments are also available through the "comments" attribute. - * - * @return Comment[] - */ - public function getComments() : array { - return $this->attributes['comments'] ?? []; - } - - /** - * Gets the doc comment of the node. - * - * @return null|Comment\Doc Doc comment object or null - */ - public function getDocComment() { - $comments = $this->getComments(); - for ($i = count($comments) - 1; $i >= 0; $i--) { - $comment = $comments[$i]; - if ($comment instanceof Comment\Doc) { - return $comment; - } - } - - return null; - } - - /** - * Sets the doc comment of the node. - * - * This will either replace an existing doc comment or add it to the comments array. - * - * @param Comment\Doc $docComment Doc comment to set - */ - public function setDocComment(Comment\Doc $docComment) { - $comments = $this->getComments(); - for ($i = count($comments) - 1; $i >= 0; $i--) { - if ($comments[$i] instanceof Comment\Doc) { - // Replace existing doc comment. - $comments[$i] = $docComment; - $this->setAttribute('comments', $comments); - return; - } - } - - // Append new doc comment. - $comments[] = $docComment; - $this->setAttribute('comments', $comments); - } - - public function setAttribute(string $key, $value) { - $this->attributes[$key] = $value; - } - - public function hasAttribute(string $key) : bool { - return array_key_exists($key, $this->attributes); - } - - public function getAttribute(string $key, $default = null) { - if (array_key_exists($key, $this->attributes)) { - return $this->attributes[$key]; - } - - return $default; - } - - public function getAttributes() : array { - return $this->attributes; - } - - public function setAttributes(array $attributes) { - $this->attributes = $attributes; - } - - /** - * @return array - */ - public function jsonSerialize() : array { - return ['nodeType' => $this->getType()] + get_object_vars($this); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeDumper.php b/vendor/nikic/php-parser/lib/PhpParser/NodeDumper.php deleted file mode 100644 index ba622ef..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/NodeDumper.php +++ /dev/null @@ -1,206 +0,0 @@ -dumpComments = !empty($options['dumpComments']); - $this->dumpPositions = !empty($options['dumpPositions']); - } - - /** - * Dumps a node or array. - * - * @param array|Node $node Node or array to dump - * @param string|null $code Code corresponding to dumped AST. This only needs to be passed if - * the dumpPositions option is enabled and the dumping of node offsets - * is desired. - * - * @return string Dumped value - */ - public function dump($node, string $code = null) : string { - $this->code = $code; - return $this->dumpRecursive($node); - } - - protected function dumpRecursive($node) { - if ($node instanceof Node) { - $r = $node->getType(); - if ($this->dumpPositions && null !== $p = $this->dumpPosition($node)) { - $r .= $p; - } - $r .= '('; - - foreach ($node->getSubNodeNames() as $key) { - $r .= "\n " . $key . ': '; - - $value = $node->$key; - if (null === $value) { - $r .= 'null'; - } elseif (false === $value) { - $r .= 'false'; - } elseif (true === $value) { - $r .= 'true'; - } elseif (is_scalar($value)) { - if ('flags' === $key || 'newModifier' === $key) { - $r .= $this->dumpFlags($value); - } elseif ('type' === $key && $node instanceof Include_) { - $r .= $this->dumpIncludeType($value); - } elseif ('type' === $key - && ($node instanceof Use_ || $node instanceof UseUse || $node instanceof GroupUse)) { - $r .= $this->dumpUseType($value); - } else { - $r .= $value; - } - } else { - $r .= str_replace("\n", "\n ", $this->dumpRecursive($value)); - } - } - - if ($this->dumpComments && $comments = $node->getComments()) { - $r .= "\n comments: " . str_replace("\n", "\n ", $this->dumpRecursive($comments)); - } - } elseif (is_array($node)) { - $r = 'array('; - - foreach ($node as $key => $value) { - $r .= "\n " . $key . ': '; - - if (null === $value) { - $r .= 'null'; - } elseif (false === $value) { - $r .= 'false'; - } elseif (true === $value) { - $r .= 'true'; - } elseif (is_scalar($value)) { - $r .= $value; - } else { - $r .= str_replace("\n", "\n ", $this->dumpRecursive($value)); - } - } - } elseif ($node instanceof Comment) { - return $node->getReformattedText(); - } else { - throw new \InvalidArgumentException('Can only dump nodes and arrays.'); - } - - return $r . "\n)"; - } - - protected function dumpFlags($flags) { - $strs = []; - if ($flags & Class_::MODIFIER_PUBLIC) { - $strs[] = 'MODIFIER_PUBLIC'; - } - if ($flags & Class_::MODIFIER_PROTECTED) { - $strs[] = 'MODIFIER_PROTECTED'; - } - if ($flags & Class_::MODIFIER_PRIVATE) { - $strs[] = 'MODIFIER_PRIVATE'; - } - if ($flags & Class_::MODIFIER_ABSTRACT) { - $strs[] = 'MODIFIER_ABSTRACT'; - } - if ($flags & Class_::MODIFIER_STATIC) { - $strs[] = 'MODIFIER_STATIC'; - } - if ($flags & Class_::MODIFIER_FINAL) { - $strs[] = 'MODIFIER_FINAL'; - } - if ($flags & Class_::MODIFIER_READONLY) { - $strs[] = 'MODIFIER_READONLY'; - } - - if ($strs) { - return implode(' | ', $strs) . ' (' . $flags . ')'; - } else { - return $flags; - } - } - - protected function dumpIncludeType($type) { - $map = [ - Include_::TYPE_INCLUDE => 'TYPE_INCLUDE', - Include_::TYPE_INCLUDE_ONCE => 'TYPE_INCLUDE_ONCE', - Include_::TYPE_REQUIRE => 'TYPE_REQUIRE', - Include_::TYPE_REQUIRE_ONCE => 'TYPE_REQUIRE_ONCE', - ]; - - if (!isset($map[$type])) { - return $type; - } - return $map[$type] . ' (' . $type . ')'; - } - - protected function dumpUseType($type) { - $map = [ - Use_::TYPE_UNKNOWN => 'TYPE_UNKNOWN', - Use_::TYPE_NORMAL => 'TYPE_NORMAL', - Use_::TYPE_FUNCTION => 'TYPE_FUNCTION', - Use_::TYPE_CONSTANT => 'TYPE_CONSTANT', - ]; - - if (!isset($map[$type])) { - return $type; - } - return $map[$type] . ' (' . $type . ')'; - } - - /** - * Dump node position, if possible. - * - * @param Node $node Node for which to dump position - * - * @return string|null Dump of position, or null if position information not available - */ - protected function dumpPosition(Node $node) { - if (!$node->hasAttribute('startLine') || !$node->hasAttribute('endLine')) { - return null; - } - - $start = $node->getStartLine(); - $end = $node->getEndLine(); - if ($node->hasAttribute('startFilePos') && $node->hasAttribute('endFilePos') - && null !== $this->code - ) { - $start .= ':' . $this->toColumn($this->code, $node->getStartFilePos()); - $end .= ':' . $this->toColumn($this->code, $node->getEndFilePos()); - } - return "[$start - $end]"; - } - - // Copied from Error class - private function toColumn($code, $pos) { - if ($pos > strlen($code)) { - throw new \RuntimeException('Invalid position information'); - } - - $lineStartPos = strrpos($code, "\n", $pos - strlen($code)); - if (false === $lineStartPos) { - $lineStartPos = -1; - } - - return $pos - $lineStartPos; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeFinder.php b/vendor/nikic/php-parser/lib/PhpParser/NodeFinder.php deleted file mode 100644 index 2e7cfda..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/NodeFinder.php +++ /dev/null @@ -1,81 +0,0 @@ -addVisitor($visitor); - $traverser->traverse($nodes); - - return $visitor->getFoundNodes(); - } - - /** - * Find all nodes that are instances of a certain class. - * - * @param Node|Node[] $nodes Single node or array of nodes to search in - * @param string $class Class name - * - * @return Node[] Found nodes (all instances of $class) - */ - public function findInstanceOf($nodes, string $class) : array { - return $this->find($nodes, function ($node) use ($class) { - return $node instanceof $class; - }); - } - - /** - * Find first node satisfying a filter callback. - * - * @param Node|Node[] $nodes Single node or array of nodes to search in - * @param callable $filter Filter callback: function(Node $node) : bool - * - * @return null|Node Found node (or null if none found) - */ - public function findFirst($nodes, callable $filter) { - if (!is_array($nodes)) { - $nodes = [$nodes]; - } - - $visitor = new FirstFindingVisitor($filter); - - $traverser = new NodeTraverser; - $traverser->addVisitor($visitor); - $traverser->traverse($nodes); - - return $visitor->getFoundNode(); - } - - /** - * Find first node that is an instance of a certain class. - * - * @param Node|Node[] $nodes Single node or array of nodes to search in - * @param string $class Class name - * - * @return null|Node Found node, which is an instance of $class (or null if none found) - */ - public function findFirstInstanceOf($nodes, string $class) { - return $this->findFirst($nodes, function ($node) use ($class) { - return $node instanceof $class; - }); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php b/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php deleted file mode 100644 index 97d45bd..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php +++ /dev/null @@ -1,291 +0,0 @@ -visitors[] = $visitor; - } - - /** - * Removes an added visitor. - * - * @param NodeVisitor $visitor - */ - public function removeVisitor(NodeVisitor $visitor) { - foreach ($this->visitors as $index => $storedVisitor) { - if ($storedVisitor === $visitor) { - unset($this->visitors[$index]); - break; - } - } - } - - /** - * Traverses an array of nodes using the registered visitors. - * - * @param Node[] $nodes Array of nodes - * - * @return Node[] Traversed array of nodes - */ - public function traverse(array $nodes) : array { - $this->stopTraversal = false; - - foreach ($this->visitors as $visitor) { - if (null !== $return = $visitor->beforeTraverse($nodes)) { - $nodes = $return; - } - } - - $nodes = $this->traverseArray($nodes); - - foreach ($this->visitors as $visitor) { - if (null !== $return = $visitor->afterTraverse($nodes)) { - $nodes = $return; - } - } - - return $nodes; - } - - /** - * Recursively traverse a node. - * - * @param Node $node Node to traverse. - * - * @return Node Result of traversal (may be original node or new one) - */ - protected function traverseNode(Node $node) : Node { - foreach ($node->getSubNodeNames() as $name) { - $subNode =& $node->$name; - - if (\is_array($subNode)) { - $subNode = $this->traverseArray($subNode); - if ($this->stopTraversal) { - break; - } - } elseif ($subNode instanceof Node) { - $traverseChildren = true; - $breakVisitorIndex = null; - - foreach ($this->visitors as $visitorIndex => $visitor) { - $return = $visitor->enterNode($subNode); - if (null !== $return) { - if ($return instanceof Node) { - $this->ensureReplacementReasonable($subNode, $return); - $subNode = $return; - } elseif (self::DONT_TRAVERSE_CHILDREN === $return) { - $traverseChildren = false; - } elseif (self::DONT_TRAVERSE_CURRENT_AND_CHILDREN === $return) { - $traverseChildren = false; - $breakVisitorIndex = $visitorIndex; - break; - } elseif (self::STOP_TRAVERSAL === $return) { - $this->stopTraversal = true; - break 2; - } else { - throw new \LogicException( - 'enterNode() returned invalid value of type ' . gettype($return) - ); - } - } - } - - if ($traverseChildren) { - $subNode = $this->traverseNode($subNode); - if ($this->stopTraversal) { - break; - } - } - - foreach ($this->visitors as $visitorIndex => $visitor) { - $return = $visitor->leaveNode($subNode); - - if (null !== $return) { - if ($return instanceof Node) { - $this->ensureReplacementReasonable($subNode, $return); - $subNode = $return; - } elseif (self::STOP_TRAVERSAL === $return) { - $this->stopTraversal = true; - break 2; - } elseif (\is_array($return)) { - throw new \LogicException( - 'leaveNode() may only return an array ' . - 'if the parent structure is an array' - ); - } else { - throw new \LogicException( - 'leaveNode() returned invalid value of type ' . gettype($return) - ); - } - } - - if ($breakVisitorIndex === $visitorIndex) { - break; - } - } - } - } - - return $node; - } - - /** - * Recursively traverse array (usually of nodes). - * - * @param array $nodes Array to traverse - * - * @return array Result of traversal (may be original array or changed one) - */ - protected function traverseArray(array $nodes) : array { - $doNodes = []; - - foreach ($nodes as $i => &$node) { - if ($node instanceof Node) { - $traverseChildren = true; - $breakVisitorIndex = null; - - foreach ($this->visitors as $visitorIndex => $visitor) { - $return = $visitor->enterNode($node); - if (null !== $return) { - if ($return instanceof Node) { - $this->ensureReplacementReasonable($node, $return); - $node = $return; - } elseif (self::DONT_TRAVERSE_CHILDREN === $return) { - $traverseChildren = false; - } elseif (self::DONT_TRAVERSE_CURRENT_AND_CHILDREN === $return) { - $traverseChildren = false; - $breakVisitorIndex = $visitorIndex; - break; - } elseif (self::STOP_TRAVERSAL === $return) { - $this->stopTraversal = true; - break 2; - } else { - throw new \LogicException( - 'enterNode() returned invalid value of type ' . gettype($return) - ); - } - } - } - - if ($traverseChildren) { - $node = $this->traverseNode($node); - if ($this->stopTraversal) { - break; - } - } - - foreach ($this->visitors as $visitorIndex => $visitor) { - $return = $visitor->leaveNode($node); - - if (null !== $return) { - if ($return instanceof Node) { - $this->ensureReplacementReasonable($node, $return); - $node = $return; - } elseif (\is_array($return)) { - $doNodes[] = [$i, $return]; - break; - } elseif (self::REMOVE_NODE === $return) { - $doNodes[] = [$i, []]; - break; - } elseif (self::STOP_TRAVERSAL === $return) { - $this->stopTraversal = true; - break 2; - } elseif (false === $return) { - throw new \LogicException( - 'bool(false) return from leaveNode() no longer supported. ' . - 'Return NodeTraverser::REMOVE_NODE instead' - ); - } else { - throw new \LogicException( - 'leaveNode() returned invalid value of type ' . gettype($return) - ); - } - } - - if ($breakVisitorIndex === $visitorIndex) { - break; - } - } - } elseif (\is_array($node)) { - throw new \LogicException('Invalid node structure: Contains nested arrays'); - } - } - - if (!empty($doNodes)) { - while (list($i, $replace) = array_pop($doNodes)) { - array_splice($nodes, $i, 1, $replace); - } - } - - return $nodes; - } - - private function ensureReplacementReasonable($old, $new) { - if ($old instanceof Node\Stmt && $new instanceof Node\Expr) { - throw new \LogicException( - "Trying to replace statement ({$old->getType()}) " . - "with expression ({$new->getType()}). Are you missing a " . - "Stmt_Expression wrapper?" - ); - } - - if ($old instanceof Node\Expr && $new instanceof Node\Stmt) { - throw new \LogicException( - "Trying to replace expression ({$old->getType()}) " . - "with statement ({$new->getType()})" - ); - } - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeTraverserInterface.php b/vendor/nikic/php-parser/lib/PhpParser/NodeTraverserInterface.php deleted file mode 100644 index 77ff3d2..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/NodeTraverserInterface.php +++ /dev/null @@ -1,29 +0,0 @@ - $node stays as-is - * * NodeTraverser::DONT_TRAVERSE_CHILDREN - * => Children of $node are not traversed. $node stays as-is - * * NodeTraverser::STOP_TRAVERSAL - * => Traversal is aborted. $node stays as-is - * * otherwise - * => $node is set to the return value - * - * @param Node $node Node - * - * @return null|int|Node Replacement node (or special return value) - */ - public function enterNode(Node $node); - - /** - * Called when leaving a node. - * - * Return value semantics: - * * null - * => $node stays as-is - * * NodeTraverser::REMOVE_NODE - * => $node is removed from the parent array - * * NodeTraverser::STOP_TRAVERSAL - * => Traversal is aborted. $node stays as-is - * * array (of Nodes) - * => The return value is merged into the parent array (at the position of the $node) - * * otherwise - * => $node is set to the return value - * - * @param Node $node Node - * - * @return null|int|Node|Node[] Replacement node (or special return value) - */ - public function leaveNode(Node $node); - - /** - * Called once after traversal. - * - * Return value semantics: - * * null: $nodes stays as-is - * * otherwise: $nodes is set to the return value - * - * @param Node[] $nodes Array of nodes - * - * @return null|Node[] Array of nodes - */ - public function afterTraverse(array $nodes); -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/CloningVisitor.php b/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/CloningVisitor.php deleted file mode 100644 index a85fa49..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/CloningVisitor.php +++ /dev/null @@ -1,20 +0,0 @@ -setAttribute('origNode', $origNode); - return $node; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FindingVisitor.php b/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FindingVisitor.php deleted file mode 100644 index 9531edb..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FindingVisitor.php +++ /dev/null @@ -1,48 +0,0 @@ -filterCallback = $filterCallback; - } - - /** - * Get found nodes satisfying the filter callback. - * - * Nodes are returned in pre-order. - * - * @return Node[] Found nodes - */ - public function getFoundNodes() : array { - return $this->foundNodes; - } - - public function beforeTraverse(array $nodes) { - $this->foundNodes = []; - - return null; - } - - public function enterNode(Node $node) { - $filterCallback = $this->filterCallback; - if ($filterCallback($node)) { - $this->foundNodes[] = $node; - } - - return null; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FirstFindingVisitor.php b/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FirstFindingVisitor.php deleted file mode 100644 index 596a7d7..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FirstFindingVisitor.php +++ /dev/null @@ -1,50 +0,0 @@ -filterCallback = $filterCallback; - } - - /** - * Get found node satisfying the filter callback. - * - * Returns null if no node satisfies the filter callback. - * - * @return null|Node Found node (or null if not found) - */ - public function getFoundNode() { - return $this->foundNode; - } - - public function beforeTraverse(array $nodes) { - $this->foundNode = null; - - return null; - } - - public function enterNode(Node $node) { - $filterCallback = $this->filterCallback; - if ($filterCallback($node)) { - $this->foundNode = $node; - return NodeTraverser::STOP_TRAVERSAL; - } - - return null; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php b/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php deleted file mode 100644 index 8e259c5..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php +++ /dev/null @@ -1,257 +0,0 @@ -nameContext = new NameContext($errorHandler ?? new ErrorHandler\Throwing); - $this->preserveOriginalNames = $options['preserveOriginalNames'] ?? false; - $this->replaceNodes = $options['replaceNodes'] ?? true; - } - - /** - * Get name resolution context. - * - * @return NameContext - */ - public function getNameContext() : NameContext { - return $this->nameContext; - } - - public function beforeTraverse(array $nodes) { - $this->nameContext->startNamespace(); - return null; - } - - public function enterNode(Node $node) { - if ($node instanceof Stmt\Namespace_) { - $this->nameContext->startNamespace($node->name); - } elseif ($node instanceof Stmt\Use_) { - foreach ($node->uses as $use) { - $this->addAlias($use, $node->type, null); - } - } elseif ($node instanceof Stmt\GroupUse) { - foreach ($node->uses as $use) { - $this->addAlias($use, $node->type, $node->prefix); - } - } elseif ($node instanceof Stmt\Class_) { - if (null !== $node->extends) { - $node->extends = $this->resolveClassName($node->extends); - } - - foreach ($node->implements as &$interface) { - $interface = $this->resolveClassName($interface); - } - - $this->resolveAttrGroups($node); - if (null !== $node->name) { - $this->addNamespacedName($node); - } - } elseif ($node instanceof Stmt\Interface_) { - foreach ($node->extends as &$interface) { - $interface = $this->resolveClassName($interface); - } - - $this->resolveAttrGroups($node); - $this->addNamespacedName($node); - } elseif ($node instanceof Stmt\Enum_) { - foreach ($node->implements as &$interface) { - $interface = $this->resolveClassName($interface); - } - - $this->resolveAttrGroups($node); - if (null !== $node->name) { - $this->addNamespacedName($node); - } - } elseif ($node instanceof Stmt\Trait_) { - $this->resolveAttrGroups($node); - $this->addNamespacedName($node); - } elseif ($node instanceof Stmt\Function_) { - $this->resolveSignature($node); - $this->resolveAttrGroups($node); - $this->addNamespacedName($node); - } elseif ($node instanceof Stmt\ClassMethod - || $node instanceof Expr\Closure - || $node instanceof Expr\ArrowFunction - ) { - $this->resolveSignature($node); - $this->resolveAttrGroups($node); - } elseif ($node instanceof Stmt\Property) { - if (null !== $node->type) { - $node->type = $this->resolveType($node->type); - } - $this->resolveAttrGroups($node); - } elseif ($node instanceof Stmt\Const_) { - foreach ($node->consts as $const) { - $this->addNamespacedName($const); - } - } else if ($node instanceof Stmt\ClassConst) { - $this->resolveAttrGroups($node); - } else if ($node instanceof Stmt\EnumCase) { - $this->resolveAttrGroups($node); - } elseif ($node instanceof Expr\StaticCall - || $node instanceof Expr\StaticPropertyFetch - || $node instanceof Expr\ClassConstFetch - || $node instanceof Expr\New_ - || $node instanceof Expr\Instanceof_ - ) { - if ($node->class instanceof Name) { - $node->class = $this->resolveClassName($node->class); - } - } elseif ($node instanceof Stmt\Catch_) { - foreach ($node->types as &$type) { - $type = $this->resolveClassName($type); - } - } elseif ($node instanceof Expr\FuncCall) { - if ($node->name instanceof Name) { - $node->name = $this->resolveName($node->name, Stmt\Use_::TYPE_FUNCTION); - } - } elseif ($node instanceof Expr\ConstFetch) { - $node->name = $this->resolveName($node->name, Stmt\Use_::TYPE_CONSTANT); - } elseif ($node instanceof Stmt\TraitUse) { - foreach ($node->traits as &$trait) { - $trait = $this->resolveClassName($trait); - } - - foreach ($node->adaptations as $adaptation) { - if (null !== $adaptation->trait) { - $adaptation->trait = $this->resolveClassName($adaptation->trait); - } - - if ($adaptation instanceof Stmt\TraitUseAdaptation\Precedence) { - foreach ($adaptation->insteadof as &$insteadof) { - $insteadof = $this->resolveClassName($insteadof); - } - } - } - } - - return null; - } - - private function addAlias(Stmt\UseUse $use, $type, Name $prefix = null) { - // Add prefix for group uses - $name = $prefix ? Name::concat($prefix, $use->name) : $use->name; - // Type is determined either by individual element or whole use declaration - $type |= $use->type; - - $this->nameContext->addAlias( - $name, (string) $use->getAlias(), $type, $use->getAttributes() - ); - } - - /** @param Stmt\Function_|Stmt\ClassMethod|Expr\Closure $node */ - private function resolveSignature($node) { - foreach ($node->params as $param) { - $param->type = $this->resolveType($param->type); - $this->resolveAttrGroups($param); - } - $node->returnType = $this->resolveType($node->returnType); - } - - private function resolveType($node) { - if ($node instanceof Name) { - return $this->resolveClassName($node); - } - if ($node instanceof Node\NullableType) { - $node->type = $this->resolveType($node->type); - return $node; - } - if ($node instanceof Node\UnionType || $node instanceof Node\IntersectionType) { - foreach ($node->types as &$type) { - $type = $this->resolveType($type); - } - return $node; - } - return $node; - } - - /** - * Resolve name, according to name resolver options. - * - * @param Name $name Function or constant name to resolve - * @param int $type One of Stmt\Use_::TYPE_* - * - * @return Name Resolved name, or original name with attribute - */ - protected function resolveName(Name $name, int $type) : Name { - if (!$this->replaceNodes) { - $resolvedName = $this->nameContext->getResolvedName($name, $type); - if (null !== $resolvedName) { - $name->setAttribute('resolvedName', $resolvedName); - } else { - $name->setAttribute('namespacedName', FullyQualified::concat( - $this->nameContext->getNamespace(), $name, $name->getAttributes())); - } - return $name; - } - - if ($this->preserveOriginalNames) { - // Save the original name - $originalName = $name; - $name = clone $originalName; - $name->setAttribute('originalName', $originalName); - } - - $resolvedName = $this->nameContext->getResolvedName($name, $type); - if (null !== $resolvedName) { - return $resolvedName; - } - - // unqualified names inside a namespace cannot be resolved at compile-time - // add the namespaced version of the name as an attribute - $name->setAttribute('namespacedName', FullyQualified::concat( - $this->nameContext->getNamespace(), $name, $name->getAttributes())); - return $name; - } - - protected function resolveClassName(Name $name) { - return $this->resolveName($name, Stmt\Use_::TYPE_NORMAL); - } - - protected function addNamespacedName(Node $node) { - $node->namespacedName = Name::concat( - $this->nameContext->getNamespace(), (string) $node->name); - } - - protected function resolveAttrGroups(Node $node) - { - foreach ($node->attrGroups as $attrGroup) { - foreach ($attrGroup->attrs as $attr) { - $attr->name = $this->resolveClassName($attr->name); - } - } - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NodeConnectingVisitor.php b/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NodeConnectingVisitor.php deleted file mode 100644 index ea372e5..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NodeConnectingVisitor.php +++ /dev/null @@ -1,52 +0,0 @@ -$node->getAttribute('parent'), the previous - * node can be accessed through $node->getAttribute('previous'), - * and the next node can be accessed through $node->getAttribute('next'). - */ -final class NodeConnectingVisitor extends NodeVisitorAbstract -{ - /** - * @var Node[] - */ - private $stack = []; - - /** - * @var ?Node - */ - private $previous; - - public function beforeTraverse(array $nodes) { - $this->stack = []; - $this->previous = null; - } - - public function enterNode(Node $node) { - if (!empty($this->stack)) { - $node->setAttribute('parent', $this->stack[count($this->stack) - 1]); - } - - if ($this->previous !== null && $this->previous->getAttribute('parent') === $node->getAttribute('parent')) { - $node->setAttribute('previous', $this->previous); - $this->previous->setAttribute('next', $node); - } - - $this->stack[] = $node; - } - - public function leaveNode(Node $node) { - $this->previous = $node; - - array_pop($this->stack); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/ParentConnectingVisitor.php b/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/ParentConnectingVisitor.php deleted file mode 100644 index b98d2bf..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/ParentConnectingVisitor.php +++ /dev/null @@ -1,41 +0,0 @@ -$node->getAttribute('parent'). - */ -final class ParentConnectingVisitor extends NodeVisitorAbstract -{ - /** - * @var Node[] - */ - private $stack = []; - - public function beforeTraverse(array $nodes) - { - $this->stack = []; - } - - public function enterNode(Node $node) - { - if (!empty($this->stack)) { - $node->setAttribute('parent', $this->stack[count($this->stack) - 1]); - } - - $this->stack[] = $node; - } - - public function leaveNode(Node $node) - { - array_pop($this->stack); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitorAbstract.php b/vendor/nikic/php-parser/lib/PhpParser/NodeVisitorAbstract.php deleted file mode 100644 index d378d67..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitorAbstract.php +++ /dev/null @@ -1,25 +0,0 @@ -parsers = $parsers; - } - - public function parse(string $code, ErrorHandler $errorHandler = null) { - if (null === $errorHandler) { - $errorHandler = new ErrorHandler\Throwing; - } - - list($firstStmts, $firstError) = $this->tryParse($this->parsers[0], $errorHandler, $code); - if ($firstError === null) { - return $firstStmts; - } - - for ($i = 1, $c = count($this->parsers); $i < $c; ++$i) { - list($stmts, $error) = $this->tryParse($this->parsers[$i], $errorHandler, $code); - if ($error === null) { - return $stmts; - } - } - - throw $firstError; - } - - private function tryParse(Parser $parser, ErrorHandler $errorHandler, $code) { - $stmts = null; - $error = null; - try { - $stmts = $parser->parse($code, $errorHandler); - } catch (Error $error) {} - return [$stmts, $error]; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Parser/Php5.php b/vendor/nikic/php-parser/lib/PhpParser/Parser/Php5.php deleted file mode 100644 index c62adfd..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Parser/Php5.php +++ /dev/null @@ -1,2674 +0,0 @@ -'", - "T_IS_GREATER_OR_EQUAL", - "T_SL", - "T_SR", - "'+'", - "'-'", - "'.'", - "'*'", - "'/'", - "'%'", - "'!'", - "T_INSTANCEOF", - "'~'", - "T_INC", - "T_DEC", - "T_INT_CAST", - "T_DOUBLE_CAST", - "T_STRING_CAST", - "T_ARRAY_CAST", - "T_OBJECT_CAST", - "T_BOOL_CAST", - "T_UNSET_CAST", - "'@'", - "T_POW", - "'['", - "T_NEW", - "T_CLONE", - "T_EXIT", - "T_IF", - "T_ELSEIF", - "T_ELSE", - "T_ENDIF", - "T_LNUMBER", - "T_DNUMBER", - "T_STRING", - "T_STRING_VARNAME", - "T_VARIABLE", - "T_NUM_STRING", - "T_INLINE_HTML", - "T_ENCAPSED_AND_WHITESPACE", - "T_CONSTANT_ENCAPSED_STRING", - "T_ECHO", - "T_DO", - "T_WHILE", - "T_ENDWHILE", - "T_FOR", - "T_ENDFOR", - "T_FOREACH", - "T_ENDFOREACH", - "T_DECLARE", - "T_ENDDECLARE", - "T_AS", - "T_SWITCH", - "T_MATCH", - "T_ENDSWITCH", - "T_CASE", - "T_DEFAULT", - "T_BREAK", - "T_CONTINUE", - "T_GOTO", - "T_FUNCTION", - "T_FN", - "T_CONST", - "T_RETURN", - "T_TRY", - "T_CATCH", - "T_FINALLY", - "T_USE", - "T_INSTEADOF", - "T_GLOBAL", - "T_STATIC", - "T_ABSTRACT", - "T_FINAL", - "T_PRIVATE", - "T_PROTECTED", - "T_PUBLIC", - "T_VAR", - "T_UNSET", - "T_ISSET", - "T_EMPTY", - "T_HALT_COMPILER", - "T_CLASS", - "T_TRAIT", - "T_INTERFACE", - "T_EXTENDS", - "T_IMPLEMENTS", - "T_OBJECT_OPERATOR", - "T_LIST", - "T_ARRAY", - "T_CALLABLE", - "T_CLASS_C", - "T_TRAIT_C", - "T_METHOD_C", - "T_FUNC_C", - "T_LINE", - "T_FILE", - "T_START_HEREDOC", - "T_END_HEREDOC", - "T_DOLLAR_OPEN_CURLY_BRACES", - "T_CURLY_OPEN", - "T_PAAMAYIM_NEKUDOTAYIM", - "T_NAMESPACE", - "T_NS_C", - "T_DIR", - "T_NS_SEPARATOR", - "T_ELLIPSIS", - "T_NAME_FULLY_QUALIFIED", - "T_NAME_QUALIFIED", - "T_NAME_RELATIVE", - "';'", - "'{'", - "'}'", - "'('", - "')'", - "'$'", - "'`'", - "']'", - "'\"'", - "T_READONLY", - "T_ENUM", - "T_NULLSAFE_OBJECT_OPERATOR", - "T_ATTRIBUTE" - ); - - protected $tokenToSymbol = array( - 0, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 56, 163, 168, 160, 55, 168, 168, - 158, 159, 53, 50, 8, 51, 52, 54, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 31, 155, - 44, 16, 46, 30, 68, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 70, 168, 162, 36, 168, 161, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 156, 35, 157, 58, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 1, 2, 3, 4, - 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 32, 33, 34, 37, 38, 39, 40, - 41, 42, 43, 45, 47, 48, 49, 57, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 69, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 164, - 122, 123, 124, 125, 126, 127, 128, 129, 165, 130, - 131, 132, 166, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 167 - ); - - protected $action = array( - 699, 669, 670, 671, 672, 673, 286, 674, 675, 676, - 712, 713, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 0, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244,-32766,-32766,-32766,-32766,-32766, - -32766,-32766,-32766,-32766,-32767,-32767,-32767,-32767, 245, 246, - 242, 243, 244,-32766,-32766, 677,-32766, 750,-32766,-32766, - -32766,-32766,-32766,-32766,-32766, 1224, 245, 246, 1225, 678, - 679, 680, 681, 682, 683, 684,-32766, 48, 746,-32766, - -32766,-32766,-32766,-32766,-32766, 685, 686, 687, 688, 689, - 690, 691, 692, 693, 694, 695, 715, 738, 716, 717, - 718, 719, 707, 708, 709, 737, 710, 711, 696, 697, - 698, 700, 701, 702, 740, 741, 742, 743, 744, 745, - 703, 704, 705, 706, 736, 727, 725, 726, 722, 723, - 751, 714, 720, 721, 728, 729, 731, 730, 732, 733, - 55, 56, 425, 57, 58, 724, 735, 734, 1073, 59, - 60, -224, 61,-32766,-32766,-32766,-32766,-32766,-32766,-32766, - -32766,-32766,-32766, 121,-32767,-32767,-32767,-32767, 29, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 1043, 766, 1071, 767, 580, 62, 63,-32766, - -32766,-32766,-32766, 64, 516, 65, 294, 295, 66, 67, - 68, 69, 70, 71, 72, 73, 822, 25, 302, 74, - 418, 981, 983, 1043, 1181, 1095, 1096, 1073, 748, 754, - 1075, 1074, 1076, 469,-32766,-32766,-32766, 337, 823, 54, - -32767,-32767,-32767,-32767, 98, 99, 100, 101, 102, 220, - 221, 222, 78, 361, 1107,-32766, 341,-32766,-32766,-32766, - -32766,-32766, 1107, 492, 949, 950, 951, 948, 947, 946, - 207, 477, 478, 949, 950, 951, 948, 947, 946, 1043, - 479, 480, 52, 1101, 1102, 1103, 1104, 1098, 1099, 319, - 872, 668, 667, 27, -511, 1105, 1100,-32766, 130, 1075, - 1074, 1076, 345, 668, 667, 41, 126, 341, 334, 369, - 336, 426, -128, -128, -128, 896, 897, 468, 220, 221, - 222, 811, 1195, 619, 40, 21, 427, -128, 470, -128, - 471, -128, 472, -128, 802, 428, -4, 823, 54, 207, - 33, 34, 429, 360, 317, 28, 35, 473,-32766,-32766, - -32766, 211, 356, 357, 474, 475,-32766,-32766,-32766, 754, - 476, 49, 313, 794, 843, 430, 431, 289, 125,-32766, - 813,-32766,-32766,-32766,-32766,-32766,-32766,-32766,-32767,-32767, - -32767,-32767,-32767,-32766,-32766,-32766, 769, 103, 104, 105, - 327, 307, 825, 633, -128, 1075, 1074, 1076, 221, 222, - 927, 748, 1146, 106,-32766, 129,-32766,-32766,-32766,-32766, - 426, 823, 54, 902, 873, 302, 468, 75, 207, 359, - 811, 668, 667, 40, 21, 427, 754, 470, 754, 471, - 423, 472, 1043, 127, 428, 435, 1043, 341, 1043, 33, - 34, 429, 360, 1181, 415, 35, 473, 122, 10, 315, - 128, 356, 357, 474, 475,-32766,-32766,-32766, 768, 476, - 668, 667, 758, 843, 430, 431, 754, 1043, 1147,-32766, - -32766,-32766, 754, 419, 342, 1215,-32766, 131,-32766,-32766, - -32766, 341, 363, 346, 426, 823, 54, 100, 101, 102, - 468, 825, 633, -4, 811, 442, 903, 40, 21, 427, - 754, 470, 435, 471, 341, 472, 341, 766, 428, 767, - -209, -209, -209, 33, 34, 429, 360, 479, 1196, 35, - 473, 345,-32766,-32766,-32766, 356, 357, 474, 475, 220, - 221, 222, 421, 476, 32, 297, 794, 843, 430, 431, - 754, 754, 435,-32766, 341,-32766,-32766, 9, 300, 51, - 207, 249, 324, 753, 120, 220, 221, 222, 426, 30, - 247, 941, 422, 424, 468, 825, 633, -209, 811, 1043, - 1061, 40, 21, 427, 129, 470, 207, 471, 341, 472, - 804, 20, 428, 124, -208, -208, -208, 33, 34, 429, - 360, 479, 212, 35, 473, 923, -259, 823, 54, 356, - 357, 474, 475,-32766,-32766,-32766, 1043, 476, 213, 806, - 794, 843, 430, 431,-32766,-32766, 435, 435, 341, 341, - 443, 79, 80, 81,-32766, 668, 667, 636, 344, 808, - 668, 667, 239, 240, 241, 123, 214, 538, 250, 825, - 633, -208, 36, 251, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 252, 307, - 426, 220, 221, 222, 823, 54, 468,-32766, 222, 765, - 811, 106, 134, 40, 21, 427, 571, 470, 207, 471, - 445, 472, 207,-32766, 428, 896, 897, 207, 307, 33, - 34, 429, 245, 246, 637, 35, 473, 452, 22, 809, - 922, 356, 357, 457, 588, 135, 374, 595, 596, 476, - -228, 759, 639, 938, 653, 926, 661, -86, 823, 54, - 314, 644, 647, 821, 133, 836, 43, 106, 603, 44, - 45, 46, 47, 748, 50, 53, 132, 426, 302,-32766, - 520, 825, 633, 468, -84, 607, 577, 811, 641, 362, - 40, 21, 427, -278, 470, 754, 471, 954, 472, 441, - 627, 428, 823, 54, 574, 844, 33, 34, 429, 11, - 615, 845, 35, 473, 444, 461, 285, -511, 356, 357, - 592, -419, 593, 1106, 1153, -410, 476, 368, 838, 38, - 658, 426, 645, 795, 1052, 0, 325, 468, 0,-32766, - 0, 811, 0, 0, 40, 21, 427, 0, 470, 0, - 471, 0, 472, 0, 322, 428, 823, 54, 825, 633, - 33, 34, 429, 0, 326, 0, 35, 473, 323, 0, - 316, 318, 356, 357, -512, 426, 0, 753, 531, 0, - 476, 468, 6, 0, 0, 811, 650, 7, 40, 21, - 427, 12, 470, 14, 471, 373, 472, -420, 562, 428, - 823, 54, 78, -225, 33, 34, 429, 39, 656, 657, - 35, 473, 859, 633, 764, 812, 356, 357, 820, 799, - 814, 875, 866, 867, 476, 797, 860, 857, 855, 426, - 933, 934, 931, 819, 803, 468, 805, 807, 810, 811, - 930, 762, 40, 21, 427, 763, 470, 932, 471, 335, - 472, 358, 634, 428, 638, 640, 825, 633, 33, 34, - 429, 642, 643, 646, 35, 473, 648, 649, 651, 652, - 356, 357, 635, 426, 1221, 1223, 761, 842, 476, 468, - 248, 760, 841, 811, 1222, 840, 40, 21, 427, 1057, - 470, 830, 471, 1045, 472, 839, 1046, 428, 828, 215, - 216, 939, 33, 34, 429, 217, 864, 218, 35, 473, - 825, 633, 24, 865, 356, 357, 456, 1220, 1189, 209, - 1187, 1172, 476, 1185, 215, 216, 1086, 1095, 1096, 914, - 217, 1193, 218, 1183, -224, 1097, 26, 31, 37, 42, - 76, 77, 210, 288, 209, 292, 293, 308, 309, 310, - 311, 339, 1095, 1096, 825, 633, 355, 291, 416, 1152, - 1097, 16, 17, 18, 393, 453, 460, 462, 466, 552, - 624, 1048, 1051, 904, 1111, 1047, 1023, 563, 1022, 1088, - 0, 0, -429, 558, 1041, 1101, 1102, 1103, 1104, 1098, - 1099, 398, 1054, 1053, 1056, 1055, 1070, 1105, 1100, 1186, - 1171, 1167, 1184, 1085, 1218, 1112, 1166, 219, 558, 599, - 1101, 1102, 1103, 1104, 1098, 1099, 398, 0, 0, 0, - 0, 0, 1105, 1100, 0, 0, 0, 0, 0, 0, - 0, 0, 219 - ); - - protected $actionCheck = array( - 2, 3, 4, 5, 6, 7, 14, 9, 10, 11, - 12, 13, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 0, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 9, 10, 11, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 69, 70, - 53, 54, 55, 9, 10, 57, 30, 80, 32, 33, - 34, 35, 36, 37, 38, 80, 69, 70, 83, 71, - 72, 73, 74, 75, 76, 77, 9, 70, 80, 33, - 34, 35, 36, 37, 38, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 153, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 3, 4, 5, 6, 7, 147, 148, 149, 80, 12, - 13, 159, 15, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 156, 44, 45, 46, 47, 16, 17, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 13, 106, 116, 108, 85, 50, 51, 33, - 34, 35, 36, 56, 85, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 1, 70, 71, 72, - 73, 59, 60, 13, 82, 78, 79, 80, 80, 82, - 152, 153, 154, 86, 9, 10, 11, 8, 1, 2, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 9, - 10, 11, 156, 106, 143, 30, 160, 32, 33, 34, - 35, 36, 143, 116, 116, 117, 118, 119, 120, 121, - 30, 124, 125, 116, 117, 118, 119, 120, 121, 13, - 133, 134, 70, 136, 137, 138, 139, 140, 141, 142, - 31, 37, 38, 8, 132, 148, 149, 116, 156, 152, - 153, 154, 160, 37, 38, 158, 8, 160, 161, 8, - 163, 74, 75, 76, 77, 134, 135, 80, 9, 10, - 11, 84, 1, 80, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 155, 98, 0, 1, 2, 30, - 103, 104, 105, 106, 132, 8, 109, 110, 9, 10, - 11, 8, 115, 116, 117, 118, 9, 10, 11, 82, - 123, 70, 8, 126, 127, 128, 129, 8, 156, 30, - 155, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 9, 10, 11, 157, 53, 54, 55, - 8, 57, 155, 156, 157, 152, 153, 154, 10, 11, - 157, 80, 162, 69, 30, 151, 32, 33, 34, 35, - 74, 1, 2, 159, 155, 71, 80, 151, 30, 8, - 84, 37, 38, 87, 88, 89, 82, 91, 82, 93, - 8, 95, 13, 156, 98, 158, 13, 160, 13, 103, - 104, 105, 106, 82, 108, 109, 110, 156, 8, 113, - 31, 115, 116, 117, 118, 9, 10, 11, 157, 123, - 37, 38, 126, 127, 128, 129, 82, 13, 159, 33, - 34, 35, 82, 127, 8, 85, 30, 156, 32, 33, - 34, 160, 8, 147, 74, 1, 2, 50, 51, 52, - 80, 155, 156, 157, 84, 31, 159, 87, 88, 89, - 82, 91, 158, 93, 160, 95, 160, 106, 98, 108, - 100, 101, 102, 103, 104, 105, 106, 133, 159, 109, - 110, 160, 9, 10, 11, 115, 116, 117, 118, 9, - 10, 11, 8, 123, 144, 145, 126, 127, 128, 129, - 82, 82, 158, 30, 160, 32, 33, 108, 8, 70, - 30, 31, 113, 152, 16, 9, 10, 11, 74, 14, - 14, 122, 8, 8, 80, 155, 156, 157, 84, 13, - 159, 87, 88, 89, 151, 91, 30, 93, 160, 95, - 155, 159, 98, 14, 100, 101, 102, 103, 104, 105, - 106, 133, 16, 109, 110, 155, 157, 1, 2, 115, - 116, 117, 118, 9, 10, 11, 13, 123, 16, 155, - 126, 127, 128, 129, 33, 34, 158, 158, 160, 160, - 156, 9, 10, 11, 30, 37, 38, 31, 70, 155, - 37, 38, 50, 51, 52, 156, 16, 81, 16, 155, - 156, 157, 30, 16, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 16, 57, - 74, 9, 10, 11, 1, 2, 80, 116, 11, 155, - 84, 69, 156, 87, 88, 89, 160, 91, 30, 93, - 132, 95, 30, 33, 98, 134, 135, 30, 57, 103, - 104, 105, 69, 70, 31, 109, 110, 75, 76, 155, - 155, 115, 116, 75, 76, 101, 102, 111, 112, 123, - 159, 155, 156, 155, 156, 155, 156, 31, 1, 2, - 31, 31, 31, 31, 31, 38, 70, 69, 77, 70, - 70, 70, 70, 80, 70, 70, 70, 74, 71, 85, - 85, 155, 156, 80, 97, 96, 100, 84, 31, 106, - 87, 88, 89, 82, 91, 82, 93, 82, 95, 89, - 92, 98, 1, 2, 90, 127, 103, 104, 105, 97, - 94, 127, 109, 110, 97, 97, 97, 132, 115, 116, - 100, 146, 113, 143, 143, 146, 123, 106, 151, 155, - 157, 74, 31, 157, 162, -1, 114, 80, -1, 116, - -1, 84, -1, -1, 87, 88, 89, -1, 91, -1, - 93, -1, 95, -1, 130, 98, 1, 2, 155, 156, - 103, 104, 105, -1, 130, -1, 109, 110, 131, -1, - 132, 132, 115, 116, 132, 74, -1, 152, 150, -1, - 123, 80, 146, -1, -1, 84, 31, 146, 87, 88, - 89, 146, 91, 146, 93, 146, 95, 146, 150, 98, - 1, 2, 156, 159, 103, 104, 105, 155, 155, 155, - 109, 110, 155, 156, 155, 155, 115, 116, 155, 155, - 155, 155, 155, 155, 123, 155, 155, 155, 155, 74, - 155, 155, 155, 155, 155, 80, 155, 155, 155, 84, - 155, 155, 87, 88, 89, 155, 91, 155, 93, 156, - 95, 156, 156, 98, 156, 156, 155, 156, 103, 104, - 105, 156, 156, 156, 109, 110, 156, 156, 156, 156, - 115, 116, 156, 74, 157, 157, 157, 157, 123, 80, - 31, 157, 157, 84, 157, 157, 87, 88, 89, 157, - 91, 157, 93, 157, 95, 157, 157, 98, 157, 50, - 51, 157, 103, 104, 105, 56, 157, 58, 109, 110, - 155, 156, 158, 157, 115, 116, 157, 157, 157, 70, - 157, 157, 123, 157, 50, 51, 157, 78, 79, 157, - 56, 157, 58, 157, 159, 86, 158, 158, 158, 158, - 158, 158, 158, 158, 70, 158, 158, 158, 158, 158, - 158, 158, 78, 79, 155, 156, 158, 160, 158, 163, - 86, 159, 159, 159, 159, 159, 159, 159, 159, 159, - 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, - -1, -1, 161, 134, 161, 136, 137, 138, 139, 140, - 141, 142, 162, 162, 162, 162, 162, 148, 149, 162, - 162, 162, 162, 162, 162, 162, 162, 158, 134, 162, - 136, 137, 138, 139, 140, 141, 142, -1, -1, -1, - -1, -1, 148, 149, -1, -1, -1, -1, -1, -1, - -1, -1, 158 - ); - - protected $actionBase = array( - 0, 227, 326, 400, 474, 233, 132, 132, 752, -2, - -2, 138, -2, -2, -2, 663, 761, 815, 761, 586, - 717, 859, 859, 859, 244, 256, 256, 256, 413, 583, - 583, 880, 546, 169, 415, 444, 409, 200, 200, 200, - 200, 137, 137, 200, 200, 200, 200, 200, 200, 200, - 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, - 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, - 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, - 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, - 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, - 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, - 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, - 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, - 200, 200, 200, 200, 200, 200, 249, 205, 738, 559, - 535, 739, 741, 742, 876, 679, 877, 820, 821, 693, - 823, 824, 826, 829, 832, 819, 834, 907, 836, 602, - 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, - 602, 67, 536, 299, 510, 230, 44, 652, 652, 652, - 652, 652, 652, 652, 337, 337, 337, 337, 337, 337, - 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, - 337, 337, 378, 584, 584, 584, 657, 909, 648, 934, - 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, - 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, - 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, - 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, - 934, 934, 934, 503, -21, -21, 436, 650, 364, 571, - 215, 426, 156, 26, 26, 329, 329, 329, 329, 329, - 46, 46, 5, 5, 5, 5, 152, 186, 186, 186, - 186, 120, 120, 120, 120, 374, 374, 429, 448, 448, - 334, 267, 449, 449, 449, 449, 449, 449, 449, 449, - 449, 449, 336, 427, 427, 572, 572, 408, 551, 551, - 551, 551, 671, 171, 171, 391, 311, 311, 311, 109, - 641, 856, 68, 68, 68, 68, 68, 68, 324, 324, - 324, -3, -3, -3, 655, 77, 380, 77, 380, 683, - 685, 86, 685, 654, -15, 516, 776, 281, 646, 809, - 680, 816, 560, 711, 202, 578, 857, 643, -23, 578, - 578, 578, 578, 857, 622, 628, 596, -23, 578, -23, - 639, 454, 849, 351, 249, 558, 469, 631, 743, 514, - 688, 746, 464, 544, 548, 556, 7, 412, 708, 750, - 878, 879, 349, 702, 631, 631, 631, 327, 101, 7, - -8, 623, 623, 623, 623, 219, 623, 623, 623, 623, - 291, 430, 545, 401, 745, 653, 653, 675, 839, 814, - 814, 653, 673, 653, 675, 841, 841, 841, 841, 653, - 653, 653, 653, 814, 814, 667, 814, 275, 684, 694, - 694, 841, 713, 714, 653, 653, 697, 814, 814, 814, - 697, 687, 841, 669, 637, 333, 814, 841, 689, 673, - 689, 653, 669, 689, 673, 673, 689, 22, 686, 656, - 840, 842, 860, 756, 638, 644, 847, 848, 843, 845, - 838, 692, 719, 720, 528, 659, 660, 661, 662, 696, - 664, 698, 643, 658, 658, 658, 645, 701, 645, 658, - 658, 658, 658, 658, 658, 658, 658, 632, 635, 709, - 699, 670, 723, 566, 582, 758, 640, 636, 872, 865, - 881, 883, 849, 870, 645, 890, 634, 288, 610, 850, - 633, 753, 645, 851, 645, 759, 645, 873, 777, 666, - 778, 779, 658, 874, 891, 892, 893, 894, 897, 898, - 899, 900, 665, 901, 724, 674, 866, 344, 844, 639, - 705, 677, 755, 725, 780, 372, 902, 784, 645, 645, - 765, 706, 645, 766, 726, 712, 862, 727, 867, 903, - 640, 678, 868, 645, 681, 785, 904, 372, 690, 651, - 704, 649, 728, 858, 875, 853, 767, 612, 617, 787, - 788, 792, 691, 730, 863, 864, 835, 731, 770, 642, - 771, 676, 794, 772, 852, 732, 796, 798, 871, 647, - 707, 682, 672, 668, 773, 799, 869, 733, 735, 736, - 801, 737, 804, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 137, 137, 137, 137, -2, -2, -2, - -2, 0, 0, -2, 0, 0, 0, 137, 137, 137, - 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, - 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, - 137, 137, 137, 0, 0, 137, 137, 137, 137, 137, - 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, - 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, - 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, - 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, - 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, - 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, - 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, - 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, - 137, 137, 137, 137, 137, 137, 137, 137, 602, 602, - 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, - 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, - 602, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 602, -21, -21, -21, -21, 602, -21, - -21, -21, -21, -21, -21, -21, 602, 602, 602, 602, - 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, - 602, 602, 602, 602, -21, 602, 602, 602, -21, 68, - -21, 68, 68, 68, 68, 68, 68, 68, 68, 68, - 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, - 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, - 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, - 68, 68, 68, 68, 68, 602, 0, 0, 602, -21, - 602, -21, 602, -21, -21, 602, 602, 602, 602, 602, - 602, 602, -21, -21, -21, -21, -21, -21, 0, 324, - 324, 324, 324, -21, -21, -21, -21, 68, 68, 147, - 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, - 68, 68, 68, 68, 68, 324, 324, -3, -3, 68, - 68, 68, 68, 68, 147, 68, 68, -23, 673, 673, - 673, 380, 380, 380, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 380, -23, 0, -23, - 0, 68, -23, 673, -23, 380, 673, 673, -23, 814, - 604, 604, 604, 604, 372, 7, 0, 0, 673, 673, - 0, 0, 0, 0, 0, 673, 0, 0, 0, 0, - 0, 0, 814, 0, 653, 0, 0, 0, 0, 658, - 288, 0, 677, 456, 0, 0, 0, 0, 0, 0, - 677, 456, 530, 530, 0, 665, 658, 658, 658, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 372 - ); - - protected $actionDefault = array( - 3,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767, 540, 540, 495,32767,32767, - 32767,32767,32767,32767,32767,32767,32767, 297, 297, 297, - 32767,32767,32767, 528, 528, 528, 528, 528, 528, 528, - 528, 528, 528, 528,32767,32767,32767,32767,32767,32767, - 381,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767, 387, - 545,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767, 362, - 363, 365, 366, 296, 548, 529, 245, 388, 544, 295, - 247, 325, 499,32767,32767,32767, 327, 122, 256, 201, - 498, 125, 294, 232, 380, 382, 326, 301, 306, 307, - 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, - 318, 300, 454, 359, 358, 357, 456,32767, 455, 492, - 492, 495,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767, 323, 483, 482, 324, 452, 328, 453, - 331, 457, 460, 329, 330, 347, 348, 345, 346, 349, - 458, 459, 476, 477, 474, 475, 299, 350, 351, 352, - 353, 478, 479, 480, 481,32767,32767, 280, 539, 539, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767, 338, 339, 467, 468,32767, 236, 236, - 236, 236, 281, 236,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767, 333, 334, - 332, 462, 463, 461, 428,32767,32767,32767, 430,32767, - 32767,32767,32767,32767,32767,32767,32767, 500,32767,32767, - 32767,32767,32767, 513, 417, 171,32767, 409,32767, 171, - 171, 171, 171,32767, 220, 222, 167,32767, 171,32767, - 486,32767,32767,32767,32767,32767, 518, 343,32767,32767, - 116,32767,32767,32767, 555,32767, 513,32767, 116,32767, - 32767,32767,32767, 356, 335, 336, 337,32767,32767, 517, - 511, 470, 471, 472, 473,32767, 464, 465, 466, 469, - 32767,32767,32767,32767,32767,32767,32767,32767, 425, 431, - 431,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767, 516, 515,32767, 410, 494, 186, 184, - 184,32767, 206, 206,32767,32767, 188, 487, 506,32767, - 188, 173,32767, 398, 175, 494,32767,32767, 238,32767, - 238,32767, 398, 238,32767,32767, 238,32767, 411, 435, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767, 377, 378, 489, 502,32767, - 503,32767, 409, 341, 342, 344, 320,32767, 322, 367, - 368, 369, 370, 371, 372, 373, 375,32767, 415,32767, - 418,32767,32767,32767, 255,32767, 553,32767,32767, 304, - 553,32767,32767,32767, 547,32767,32767, 298,32767,32767, - 32767,32767, 251,32767, 169,32767, 537,32767, 554,32767, - 511,32767, 340,32767,32767,32767,32767,32767,32767,32767, - 32767,32767, 512,32767,32767,32767,32767, 227,32767, 448, - 32767, 116,32767,32767,32767, 187,32767,32767, 302, 246, - 32767,32767, 546,32767,32767,32767,32767,32767,32767,32767, - 32767, 114,32767, 170,32767,32767,32767, 189,32767,32767, - 511,32767,32767,32767,32767,32767,32767,32767, 293,32767, - 32767,32767,32767,32767,32767,32767, 511,32767,32767, 231, - 32767,32767,32767,32767,32767,32767,32767,32767,32767, 411, - 32767, 274,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767, 127, 127, 3, 127, 127, 258, 3, - 258, 127, 258, 258, 127, 127, 127, 127, 127, 127, - 127, 127, 127, 127, 214, 217, 206, 206, 164, 127, - 127, 266 - ); - - protected $goto = array( - 166, 140, 140, 140, 166, 187, 168, 144, 147, 141, - 142, 143, 149, 163, 163, 163, 163, 144, 144, 165, - 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, - 138, 159, 160, 161, 162, 184, 139, 185, 493, 494, - 377, 495, 499, 500, 501, 502, 503, 504, 505, 506, - 967, 164, 145, 146, 148, 171, 176, 186, 203, 253, - 256, 258, 260, 263, 264, 265, 266, 267, 268, 269, - 277, 278, 279, 280, 303, 304, 328, 329, 330, 394, - 395, 396, 542, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 150, 151, 152, - 167, 153, 169, 154, 204, 170, 155, 156, 157, 205, - 158, 136, 620, 560, 756, 560, 560, 560, 560, 560, - 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, - 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, - 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, - 560, 560, 560, 560, 560, 560, 560, 560, 560, 1108, - 628, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, - 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, - 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, - 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, - 1108, 1108, 1108, 1108, 1108, 757, 888, 888, 508, 1200, - 1200, 400, 606, 508, 536, 536, 568, 532, 534, 534, - 496, 498, 524, 540, 569, 572, 583, 590, 852, 852, - 852, 852, 847, 853, 174, 585, 519, 600, 601, 177, - 178, 179, 401, 402, 403, 404, 173, 202, 206, 208, - 257, 259, 261, 262, 270, 271, 272, 273, 274, 275, - 281, 282, 283, 284, 305, 306, 331, 332, 333, 406, - 407, 408, 409, 175, 180, 254, 255, 181, 182, 183, - 497, 497, 785, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 509, 578, 582, - 626, 749, 509, 544, 545, 546, 547, 548, 549, 550, - 551, 553, 586, 338, 559, 321, 559, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 530, 349, 655, 555, 587, 352, 414, 591, 575, 604, - 885, 611, 612, 881, 616, 617, 623, 625, 630, 632, - 298, 296, 296, 296, 298, 290, 299, 944, 610, 816, - 1170, 613, 436, 436, 375, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 1072, - 1084, 1083, 945, 1065, 1072, 895, 895, 895, 895, 1178, - 895, 895, 1212, 1212, 1178, 388, 858, 561, 755, 1072, - 1072, 1072, 1072, 1072, 1072, 3, 4, 384, 384, 384, - 1212, 874, 856, 854, 856, 654, 465, 511, 883, 878, - 1089, 541, 384, 537, 384, 567, 384, 1026, 19, 15, - 371, 384, 1226, 510, 1204, 1192, 1192, 1192, 510, 906, - 372, 522, 533, 554, 912, 514, 1068, 1069, 13, 1065, - 378, 912, 1158, 594, 23, 965, 386, 386, 386, 602, - 1066, 1169, 1066, 937, 447, 449, 631, 752, 1177, 1067, - 1109, 614, 935, 1177, 605, 1197, 391, 1211, 1211, 543, - 892, 386, 1194, 1194, 1194, 399, 518, 1016, 901, 389, - 771, 529, 752, 340, 752, 1211, 518, 518, 385, 781, - 1214, 770, 772, 1063, 910, 774, 1058, 1176, 659, 953, - 514, 782, 862, 915, 450, 573, 1155, 0, 463, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 513, 528, 0, 0, 0, 0, - 513, 0, 528, 0, 350, 351, 0, 609, 512, 515, - 438, 439, 1064, 618, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 779, 1219, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 777, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 523, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 301, 301 - ); - - protected $gotoCheck = array( - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 57, 68, 15, 68, 68, 68, 68, 68, - 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, - 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, - 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, - 68, 68, 68, 68, 68, 68, 68, 68, 68, 126, - 9, 126, 126, 126, 126, 126, 126, 126, 126, 126, - 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, - 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, - 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, - 126, 126, 126, 126, 126, 16, 76, 76, 68, 76, - 76, 51, 51, 68, 51, 51, 51, 51, 51, 51, - 51, 51, 51, 51, 51, 51, 51, 51, 68, 68, - 68, 68, 68, 68, 27, 66, 101, 66, 66, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 117, 117, 29, 117, 117, 117, 117, 117, 117, 117, - 117, 117, 117, 117, 117, 117, 117, 117, 61, 61, - 61, 6, 117, 110, 110, 110, 110, 110, 110, 110, - 110, 110, 110, 125, 57, 125, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 32, 71, 32, 32, 69, 69, 69, 32, 40, 40, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 5, 5, 5, 5, 5, 5, 5, 97, 62, 50, - 81, 62, 57, 57, 62, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 124, 124, 97, 81, 57, 57, 57, 57, 57, 118, - 57, 57, 142, 142, 118, 12, 33, 12, 14, 57, - 57, 57, 57, 57, 57, 30, 30, 13, 13, 13, - 142, 14, 14, 14, 14, 14, 57, 14, 14, 14, - 34, 2, 13, 109, 13, 2, 13, 34, 34, 34, - 34, 13, 13, 122, 140, 9, 9, 9, 122, 83, - 58, 58, 58, 34, 13, 13, 81, 81, 58, 81, - 46, 13, 131, 127, 34, 101, 123, 123, 123, 34, - 81, 81, 81, 8, 8, 8, 8, 11, 119, 81, - 8, 8, 8, 119, 49, 138, 48, 141, 141, 47, - 78, 123, 119, 119, 119, 123, 47, 102, 80, 17, - 23, 9, 11, 18, 11, 141, 47, 47, 11, 23, - 141, 23, 24, 115, 84, 25, 113, 119, 73, 99, - 13, 26, 70, 85, 64, 65, 130, -1, 108, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 9, 9, -1, -1, -1, -1, - 9, -1, 9, -1, 71, 71, -1, 13, 9, 9, - 9, 9, 13, 13, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 9, 9, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 101, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 5, 5 - ); - - protected $gotoBase = array( - 0, 0, -184, 0, 0, 356, 290, 0, 488, 149, - 0, 182, 85, 118, 426, 112, 203, 179, 208, 0, - 0, 0, 0, 162, 190, 198, 120, 27, 0, 272, - -224, 0, -274, 406, 32, 0, 0, 0, 0, 0, - 330, 0, 0, -24, 0, 0, 440, 485, 213, 218, - 371, -74, 0, 0, 0, 0, 0, 107, 110, 0, - 0, -11, -72, 0, 104, 95, -405, 0, -94, 41, - 119, -82, 0, 164, 0, 0, -79, 0, 197, 0, - 204, 43, 0, 441, 171, 121, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 100, 0, 115, - 0, 195, 210, 0, 0, 0, 0, 0, 86, 427, - 259, 0, 0, 116, 0, 174, 0, -5, 117, 196, - 0, 0, 161, 170, 93, -21, -48, 273, 0, 0, - 91, 271, 0, 0, 0, 0, 0, 0, 216, 0, - 437, 187, 102, 0, 0 - ); - - protected $gotoDefault = array( - -32768, 467, 663, 2, 664, 834, 739, 747, 597, 481, - 629, 581, 380, 1188, 791, 792, 793, 381, 367, 482, - 379, 410, 405, 780, 773, 775, 783, 172, 411, 786, - 1, 788, 517, 824, 1017, 364, 796, 365, 589, 798, - 526, 800, 801, 137, 382, 383, 527, 483, 390, 576, - 815, 276, 387, 817, 366, 818, 827, 370, 464, 454, - 459, 556, 608, 432, 446, 570, 564, 535, 1081, 565, - 861, 348, 869, 660, 877, 880, 484, 557, 891, 451, - 899, 1094, 397, 905, 911, 916, 287, 919, 417, 412, - 584, 924, 925, 5, 929, 621, 622, 8, 312, 952, - 598, 966, 420, 1036, 1038, 485, 486, 521, 458, 507, - 525, 487, 1059, 440, 413, 1062, 488, 489, 433, 434, - 1078, 354, 1163, 353, 448, 320, 1150, 579, 1113, 455, - 1203, 1159, 347, 490, 491, 376, 1182, 392, 1198, 437, - 1205, 1213, 343, 539, 566 - ); - - protected $ruleToNonTerminal = array( - 0, 1, 3, 3, 2, 5, 5, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, - 7, 7, 7, 7, 8, 8, 9, 10, 11, 11, - 12, 12, 13, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 18, 18, 19, 19, 21, 21, - 17, 17, 22, 22, 23, 23, 24, 24, 25, 25, - 20, 20, 26, 28, 28, 29, 30, 30, 32, 31, - 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 14, 14, 54, 54, 56, 55, 55, 48, - 48, 58, 58, 59, 59, 60, 60, 15, 16, 16, - 16, 63, 63, 63, 64, 64, 67, 67, 65, 65, - 69, 69, 41, 41, 50, 50, 53, 53, 53, 52, - 52, 70, 42, 42, 42, 42, 71, 71, 72, 72, - 73, 73, 39, 39, 35, 35, 74, 37, 37, 75, - 36, 36, 38, 38, 49, 49, 49, 61, 61, 77, - 77, 78, 78, 80, 80, 80, 79, 79, 62, 62, - 81, 81, 81, 82, 82, 83, 83, 83, 44, 44, - 84, 84, 84, 45, 45, 85, 85, 86, 86, 66, - 87, 87, 87, 87, 92, 92, 93, 93, 94, 94, - 94, 94, 94, 95, 96, 96, 91, 91, 88, 88, - 90, 90, 98, 98, 97, 97, 97, 97, 97, 97, - 89, 89, 100, 99, 99, 46, 46, 40, 40, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 34, 34, 47, 47, 105, - 105, 106, 106, 106, 106, 112, 101, 101, 108, 108, - 114, 114, 115, 116, 116, 116, 116, 116, 116, 68, - 68, 57, 57, 57, 57, 102, 102, 120, 120, 117, - 117, 121, 121, 121, 121, 103, 103, 103, 107, 107, - 107, 113, 113, 126, 126, 126, 126, 126, 126, 126, - 126, 126, 126, 126, 126, 126, 27, 27, 27, 27, - 27, 27, 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 111, 111, 104, 104, - 104, 104, 127, 127, 130, 130, 129, 129, 131, 131, - 51, 51, 51, 51, 133, 133, 132, 132, 132, 132, - 132, 134, 134, 119, 119, 122, 122, 118, 118, 136, - 135, 135, 135, 135, 123, 123, 123, 123, 110, 110, - 124, 124, 124, 124, 76, 137, 137, 138, 138, 138, - 109, 109, 139, 139, 140, 140, 140, 140, 140, 125, - 125, 125, 125, 142, 143, 141, 141, 141, 141, 141, - 141, 141, 144, 144, 144 - ); - - protected $ruleToLength = array( - 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 3, 5, 4, - 3, 4, 2, 3, 1, 1, 7, 6, 3, 1, - 3, 1, 3, 1, 1, 3, 1, 3, 1, 2, - 3, 1, 3, 3, 1, 3, 2, 0, 1, 1, - 1, 1, 1, 3, 5, 8, 3, 5, 9, 3, - 2, 3, 2, 3, 2, 3, 3, 3, 3, 1, - 2, 2, 5, 7, 9, 5, 6, 3, 3, 2, - 2, 1, 1, 1, 0, 2, 8, 0, 4, 1, - 3, 0, 1, 0, 1, 0, 1, 10, 7, 6, - 5, 1, 2, 2, 0, 2, 0, 2, 0, 2, - 1, 3, 1, 4, 1, 4, 1, 1, 4, 1, - 3, 3, 3, 4, 4, 5, 0, 2, 4, 3, - 1, 1, 1, 4, 0, 2, 3, 0, 2, 4, - 0, 2, 0, 3, 1, 2, 1, 1, 0, 1, - 3, 4, 6, 1, 1, 1, 0, 1, 0, 2, - 2, 3, 3, 1, 3, 1, 2, 2, 3, 1, - 1, 2, 4, 3, 1, 1, 3, 2, 0, 1, - 3, 3, 9, 3, 1, 3, 0, 2, 4, 5, - 4, 4, 4, 3, 1, 1, 1, 3, 1, 1, - 0, 1, 1, 2, 1, 1, 1, 1, 1, 1, - 1, 3, 1, 1, 3, 3, 1, 0, 1, 1, - 3, 3, 4, 4, 1, 2, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, - 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 2, 2, 2, 2, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 1, 3, 5, 4, 3, - 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 1, 1, 3, - 2, 1, 2, 10, 11, 3, 3, 2, 4, 4, - 3, 4, 4, 4, 4, 7, 3, 2, 0, 4, - 1, 3, 2, 2, 4, 6, 2, 2, 4, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 3, 3, 4, 4, 0, 2, 1, 0, 1, - 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 3, 2, 1, 3, 1, 4, - 3, 1, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, - 3, 3, 5, 4, 4, 3, 1, 3, 1, 1, - 3, 3, 0, 2, 0, 1, 3, 1, 3, 1, - 1, 1, 1, 1, 6, 4, 3, 4, 2, 4, - 4, 1, 3, 1, 2, 1, 1, 4, 1, 1, - 3, 6, 4, 4, 4, 4, 1, 4, 0, 1, - 1, 3, 1, 1, 4, 3, 1, 1, 1, 0, - 0, 2, 3, 1, 3, 1, 4, 2, 2, 2, - 2, 1, 2, 1, 1, 1, 4, 3, 3, 3, - 6, 3, 1, 1, 1 - ); - - protected function initReduceCallbacks() { - $this->reduceCallbacks = [ - 0 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 1 => function ($stackPos) { - $this->semValue = $this->handleNamespaces($this->semStack[$stackPos-(1-1)]); - }, - 2 => function ($stackPos) { - if (is_array($this->semStack[$stackPos-(2-2)])) { $this->semValue = array_merge($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)]); } else { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }; - }, - 3 => function ($stackPos) { - $this->semValue = array(); - }, - 4 => function ($stackPos) { - $startAttributes = $this->lookaheadStartAttributes; if (isset($startAttributes['comments'])) { $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments'])); } else { $nop = null; }; - if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 5 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 6 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 7 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 8 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 9 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 10 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 11 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 12 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 13 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 14 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 15 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 16 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 17 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 18 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 19 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 20 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 21 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 22 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 23 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 24 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 25 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 26 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 27 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 28 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 29 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 30 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 31 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 32 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 33 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 34 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 35 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 36 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 37 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 38 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 39 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 40 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 41 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 42 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 43 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 44 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 45 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 46 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 47 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 48 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 49 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 50 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 51 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 52 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 53 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 54 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 55 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 56 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 57 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 58 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 59 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 60 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 61 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 62 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 63 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 64 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 65 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 66 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 67 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 68 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 69 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 70 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 71 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 72 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 73 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 74 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 75 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 76 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 77 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 78 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 79 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 80 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 81 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 82 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 83 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 84 => function ($stackPos) { - $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 85 => function ($stackPos) { - $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 86 => function ($stackPos) { - $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 87 => function ($stackPos) { - $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 88 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 89 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 90 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 91 => function ($stackPos) { - $this->semValue = new Name(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 92 => function ($stackPos) { - $this->semValue = new Expr\Variable(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 93 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 94 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 95 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 96 => function ($stackPos) { - $this->semValue = new Stmt\HaltCompiler($this->lexer->handleHaltCompiler(), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 97 => function ($stackPos) { - $this->semValue = new Stmt\Namespace_($this->semStack[$stackPos-(3-2)], null, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_SEMICOLON); - $this->checkNamespace($this->semValue); - }, - 98 => function ($stackPos) { - $this->semValue = new Stmt\Namespace_($this->semStack[$stackPos-(5-2)], $this->semStack[$stackPos-(5-4)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_BRACED); - $this->checkNamespace($this->semValue); - }, - 99 => function ($stackPos) { - $this->semValue = new Stmt\Namespace_(null, $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_BRACED); - $this->checkNamespace($this->semValue); - }, - 100 => function ($stackPos) { - $this->semValue = new Stmt\Use_($this->semStack[$stackPos-(3-2)], Stmt\Use_::TYPE_NORMAL, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 101 => function ($stackPos) { - $this->semValue = new Stmt\Use_($this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-2)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 102 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 103 => function ($stackPos) { - $this->semValue = new Stmt\Const_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 104 => function ($stackPos) { - $this->semValue = Stmt\Use_::TYPE_FUNCTION; - }, - 105 => function ($stackPos) { - $this->semValue = Stmt\Use_::TYPE_CONSTANT; - }, - 106 => function ($stackPos) { - $this->semValue = new Stmt\GroupUse($this->semStack[$stackPos-(7-3)], $this->semStack[$stackPos-(7-6)], $this->semStack[$stackPos-(7-2)], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); - }, - 107 => function ($stackPos) { - $this->semValue = new Stmt\GroupUse($this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-5)], Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); - }, - 108 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 109 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 110 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 111 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 112 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 113 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 114 => function ($stackPos) { - $this->semValue = new Stmt\UseUse($this->semStack[$stackPos-(1-1)], null, Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->checkUseUse($this->semValue, $stackPos-(1-1)); - }, - 115 => function ($stackPos) { - $this->semValue = new Stmt\UseUse($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); $this->checkUseUse($this->semValue, $stackPos-(3-3)); - }, - 116 => function ($stackPos) { - $this->semValue = new Stmt\UseUse($this->semStack[$stackPos-(1-1)], null, Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->checkUseUse($this->semValue, $stackPos-(1-1)); - }, - 117 => function ($stackPos) { - $this->semValue = new Stmt\UseUse($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); $this->checkUseUse($this->semValue, $stackPos-(3-3)); - }, - 118 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; $this->semValue->type = Stmt\Use_::TYPE_NORMAL; - }, - 119 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; $this->semValue->type = $this->semStack[$stackPos-(2-1)]; - }, - 120 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 121 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 122 => function ($stackPos) { - $this->semValue = new Node\Const_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 123 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 124 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 125 => function ($stackPos) { - $this->semValue = new Node\Const_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 126 => function ($stackPos) { - if (is_array($this->semStack[$stackPos-(2-2)])) { $this->semValue = array_merge($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)]); } else { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }; - }, - 127 => function ($stackPos) { - $this->semValue = array(); - }, - 128 => function ($stackPos) { - $startAttributes = $this->lookaheadStartAttributes; if (isset($startAttributes['comments'])) { $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments'])); } else { $nop = null; }; - if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 129 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 130 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 131 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 132 => function ($stackPos) { - throw new Error('__HALT_COMPILER() can only be used from the outermost scope', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 133 => function ($stackPos) { - - if ($this->semStack[$stackPos-(3-2)]) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; $attrs = $this->startAttributeStack[$stackPos-(3-1)]; $stmts = $this->semValue; if (!empty($attrs['comments'])) {$stmts[0]->setAttribute('comments', array_merge($attrs['comments'], $stmts[0]->getAttribute('comments', []))); }; - } else { - $startAttributes = $this->startAttributeStack[$stackPos-(3-1)]; if (isset($startAttributes['comments'])) { $this->semValue = new Stmt\Nop($startAttributes + $this->endAttributes); } else { $this->semValue = null; }; - if (null === $this->semValue) { $this->semValue = array(); } - } - - }, - 134 => function ($stackPos) { - $this->semValue = new Stmt\If_($this->semStack[$stackPos-(5-2)], ['stmts' => is_array($this->semStack[$stackPos-(5-3)]) ? $this->semStack[$stackPos-(5-3)] : array($this->semStack[$stackPos-(5-3)]), 'elseifs' => $this->semStack[$stackPos-(5-4)], 'else' => $this->semStack[$stackPos-(5-5)]], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - }, - 135 => function ($stackPos) { - $this->semValue = new Stmt\If_($this->semStack[$stackPos-(8-2)], ['stmts' => $this->semStack[$stackPos-(8-4)], 'elseifs' => $this->semStack[$stackPos-(8-5)], 'else' => $this->semStack[$stackPos-(8-6)]], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); - }, - 136 => function ($stackPos) { - $this->semValue = new Stmt\While_($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 137 => function ($stackPos) { - $this->semValue = new Stmt\Do_($this->semStack[$stackPos-(5-4)], is_array($this->semStack[$stackPos-(5-2)]) ? $this->semStack[$stackPos-(5-2)] : array($this->semStack[$stackPos-(5-2)]), $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - }, - 138 => function ($stackPos) { - $this->semValue = new Stmt\For_(['init' => $this->semStack[$stackPos-(9-3)], 'cond' => $this->semStack[$stackPos-(9-5)], 'loop' => $this->semStack[$stackPos-(9-7)], 'stmts' => $this->semStack[$stackPos-(9-9)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); - }, - 139 => function ($stackPos) { - $this->semValue = new Stmt\Switch_($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 140 => function ($stackPos) { - $this->semValue = new Stmt\Break_(null, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 141 => function ($stackPos) { - $this->semValue = new Stmt\Break_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 142 => function ($stackPos) { - $this->semValue = new Stmt\Continue_(null, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 143 => function ($stackPos) { - $this->semValue = new Stmt\Continue_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 144 => function ($stackPos) { - $this->semValue = new Stmt\Return_(null, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 145 => function ($stackPos) { - $this->semValue = new Stmt\Return_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 146 => function ($stackPos) { - $this->semValue = new Stmt\Global_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 147 => function ($stackPos) { - $this->semValue = new Stmt\Static_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 148 => function ($stackPos) { - $this->semValue = new Stmt\Echo_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 149 => function ($stackPos) { - $this->semValue = new Stmt\InlineHTML($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 150 => function ($stackPos) { - $this->semValue = new Stmt\Expression($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 151 => function ($stackPos) { - $this->semValue = new Stmt\Expression($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 152 => function ($stackPos) { - $this->semValue = new Stmt\Unset_($this->semStack[$stackPos-(5-3)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - }, - 153 => function ($stackPos) { - $this->semValue = new Stmt\Foreach_($this->semStack[$stackPos-(7-3)], $this->semStack[$stackPos-(7-5)][0], ['keyVar' => null, 'byRef' => $this->semStack[$stackPos-(7-5)][1], 'stmts' => $this->semStack[$stackPos-(7-7)]], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); - }, - 154 => function ($stackPos) { - $this->semValue = new Stmt\Foreach_($this->semStack[$stackPos-(9-3)], $this->semStack[$stackPos-(9-7)][0], ['keyVar' => $this->semStack[$stackPos-(9-5)], 'byRef' => $this->semStack[$stackPos-(9-7)][1], 'stmts' => $this->semStack[$stackPos-(9-9)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); - }, - 155 => function ($stackPos) { - $this->semValue = new Stmt\Declare_($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - }, - 156 => function ($stackPos) { - $this->semValue = new Stmt\TryCatch($this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-5)], $this->semStack[$stackPos-(6-6)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); $this->checkTryCatch($this->semValue); - }, - 157 => function ($stackPos) { - $this->semValue = new Stmt\Throw_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 158 => function ($stackPos) { - $this->semValue = new Stmt\Goto_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 159 => function ($stackPos) { - $this->semValue = new Stmt\Label($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 160 => function ($stackPos) { - $this->semValue = new Stmt\Expression($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 161 => function ($stackPos) { - $this->semValue = array(); /* means: no statement */ - }, - 162 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 163 => function ($stackPos) { - $startAttributes = $this->startAttributeStack[$stackPos-(1-1)]; if (isset($startAttributes['comments'])) { $this->semValue = new Stmt\Nop($startAttributes + $this->endAttributes); } else { $this->semValue = null; }; - if ($this->semValue === null) $this->semValue = array(); /* means: no statement */ - }, - 164 => function ($stackPos) { - $this->semValue = array(); - }, - 165 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 166 => function ($stackPos) { - $this->semValue = new Stmt\Catch_(array($this->semStack[$stackPos-(8-3)]), $this->semStack[$stackPos-(8-4)], $this->semStack[$stackPos-(8-7)], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); - }, - 167 => function ($stackPos) { - $this->semValue = null; - }, - 168 => function ($stackPos) { - $this->semValue = new Stmt\Finally_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 169 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 170 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 171 => function ($stackPos) { - $this->semValue = false; - }, - 172 => function ($stackPos) { - $this->semValue = true; - }, - 173 => function ($stackPos) { - $this->semValue = false; - }, - 174 => function ($stackPos) { - $this->semValue = true; - }, - 175 => function ($stackPos) { - $this->semValue = false; - }, - 176 => function ($stackPos) { - $this->semValue = true; - }, - 177 => function ($stackPos) { - $this->semValue = new Stmt\Function_($this->semStack[$stackPos-(10-3)], ['byRef' => $this->semStack[$stackPos-(10-2)], 'params' => $this->semStack[$stackPos-(10-5)], 'returnType' => $this->semStack[$stackPos-(10-7)], 'stmts' => $this->semStack[$stackPos-(10-9)]], $this->startAttributeStack[$stackPos-(10-1)] + $this->endAttributes); - }, - 178 => function ($stackPos) { - $this->semValue = new Stmt\Class_($this->semStack[$stackPos-(7-2)], ['type' => $this->semStack[$stackPos-(7-1)], 'extends' => $this->semStack[$stackPos-(7-3)], 'implements' => $this->semStack[$stackPos-(7-4)], 'stmts' => $this->semStack[$stackPos-(7-6)]], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); - $this->checkClass($this->semValue, $stackPos-(7-2)); - }, - 179 => function ($stackPos) { - $this->semValue = new Stmt\Interface_($this->semStack[$stackPos-(6-2)], ['extends' => $this->semStack[$stackPos-(6-3)], 'stmts' => $this->semStack[$stackPos-(6-5)]], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); - $this->checkInterface($this->semValue, $stackPos-(6-2)); - }, - 180 => function ($stackPos) { - $this->semValue = new Stmt\Trait_($this->semStack[$stackPos-(5-2)], ['stmts' => $this->semStack[$stackPos-(5-4)]], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - }, - 181 => function ($stackPos) { - $this->semValue = 0; - }, - 182 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_ABSTRACT; - }, - 183 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_FINAL; - }, - 184 => function ($stackPos) { - $this->semValue = null; - }, - 185 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; - }, - 186 => function ($stackPos) { - $this->semValue = array(); - }, - 187 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; - }, - 188 => function ($stackPos) { - $this->semValue = array(); - }, - 189 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; - }, - 190 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 191 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 192 => function ($stackPos) { - $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); - }, - 193 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; - }, - 194 => function ($stackPos) { - $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); - }, - 195 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; - }, - 196 => function ($stackPos) { - $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); - }, - 197 => function ($stackPos) { - $this->semValue = null; - }, - 198 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; - }, - 199 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 200 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 201 => function ($stackPos) { - $this->semValue = new Stmt\DeclareDeclare($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 202 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 203 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-3)]; - }, - 204 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; - }, - 205 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(5-3)]; - }, - 206 => function ($stackPos) { - $this->semValue = array(); - }, - 207 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 208 => function ($stackPos) { - $this->semValue = new Stmt\Case_($this->semStack[$stackPos-(4-2)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 209 => function ($stackPos) { - $this->semValue = new Stmt\Case_(null, $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 210 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 211 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 212 => function ($stackPos) { - $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); - }, - 213 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; - }, - 214 => function ($stackPos) { - $this->semValue = array(); - }, - 215 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 216 => function ($stackPos) { - $this->semValue = new Stmt\ElseIf_($this->semStack[$stackPos-(3-2)], is_array($this->semStack[$stackPos-(3-3)]) ? $this->semStack[$stackPos-(3-3)] : array($this->semStack[$stackPos-(3-3)]), $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 217 => function ($stackPos) { - $this->semValue = array(); - }, - 218 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 219 => function ($stackPos) { - $this->semValue = new Stmt\ElseIf_($this->semStack[$stackPos-(4-2)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 220 => function ($stackPos) { - $this->semValue = null; - }, - 221 => function ($stackPos) { - $this->semValue = new Stmt\Else_(is_array($this->semStack[$stackPos-(2-2)]) ? $this->semStack[$stackPos-(2-2)] : array($this->semStack[$stackPos-(2-2)]), $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 222 => function ($stackPos) { - $this->semValue = null; - }, - 223 => function ($stackPos) { - $this->semValue = new Stmt\Else_($this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 224 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)], false); - }, - 225 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(2-2)], true); - }, - 226 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)], false); - }, - 227 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 228 => function ($stackPos) { - $this->semValue = array(); - }, - 229 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 230 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 231 => function ($stackPos) { - $this->semValue = new Node\Param($this->semStack[$stackPos-(4-4)], null, $this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-2)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); $this->checkParam($this->semValue); - }, - 232 => function ($stackPos) { - $this->semValue = new Node\Param($this->semStack[$stackPos-(6-4)], $this->semStack[$stackPos-(6-6)], $this->semStack[$stackPos-(6-1)], $this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-3)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); $this->checkParam($this->semValue); - }, - 233 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 234 => function ($stackPos) { - $this->semValue = new Node\Identifier('array', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 235 => function ($stackPos) { - $this->semValue = new Node\Identifier('callable', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 236 => function ($stackPos) { - $this->semValue = null; - }, - 237 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 238 => function ($stackPos) { - $this->semValue = null; - }, - 239 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; - }, - 240 => function ($stackPos) { - $this->semValue = array(); - }, - 241 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 242 => function ($stackPos) { - $this->semValue = array(new Node\Arg($this->semStack[$stackPos-(3-2)], false, false, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes)); - }, - 243 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 244 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 245 => function ($stackPos) { - $this->semValue = new Node\Arg($this->semStack[$stackPos-(1-1)], false, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 246 => function ($stackPos) { - $this->semValue = new Node\Arg($this->semStack[$stackPos-(2-2)], true, false, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 247 => function ($stackPos) { - $this->semValue = new Node\Arg($this->semStack[$stackPos-(2-2)], false, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 248 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 249 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 250 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 251 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 252 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 253 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 254 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 255 => function ($stackPos) { - $this->semValue = new Stmt\StaticVar($this->semStack[$stackPos-(1-1)], null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 256 => function ($stackPos) { - $this->semValue = new Stmt\StaticVar($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 257 => function ($stackPos) { - if ($this->semStack[$stackPos-(2-2)] !== null) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; } - }, - 258 => function ($stackPos) { - $this->semValue = array(); - }, - 259 => function ($stackPos) { - $startAttributes = $this->lookaheadStartAttributes; if (isset($startAttributes['comments'])) { $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments'])); } else { $nop = null; }; - if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 260 => function ($stackPos) { - $this->semValue = new Stmt\Property($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); $this->checkProperty($this->semValue, $stackPos-(3-1)); - }, - 261 => function ($stackPos) { - $this->semValue = new Stmt\ClassConst($this->semStack[$stackPos-(3-2)], 0, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 262 => function ($stackPos) { - $this->semValue = new Stmt\ClassMethod($this->semStack[$stackPos-(9-4)], ['type' => $this->semStack[$stackPos-(9-1)], 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-6)], 'returnType' => $this->semStack[$stackPos-(9-8)], 'stmts' => $this->semStack[$stackPos-(9-9)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); - $this->checkClassMethod($this->semValue, $stackPos-(9-1)); - }, - 263 => function ($stackPos) { - $this->semValue = new Stmt\TraitUse($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 264 => function ($stackPos) { - $this->semValue = array(); - }, - 265 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 266 => function ($stackPos) { - $this->semValue = array(); - }, - 267 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 268 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Precedence($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 269 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(5-1)][0], $this->semStack[$stackPos-(5-1)][1], $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-4)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - }, - 270 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], $this->semStack[$stackPos-(4-3)], null, $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 271 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], null, $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 272 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], null, $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 273 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); - }, - 274 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 275 => function ($stackPos) { - $this->semValue = array(null, $this->semStack[$stackPos-(1-1)]); - }, - 276 => function ($stackPos) { - $this->semValue = null; - }, - 277 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 278 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 279 => function ($stackPos) { - $this->semValue = 0; - }, - 280 => function ($stackPos) { - $this->semValue = 0; - }, - 281 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 282 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 283 => function ($stackPos) { - $this->checkModifier($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $this->semValue = $this->semStack[$stackPos-(2-1)] | $this->semStack[$stackPos-(2-2)]; - }, - 284 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_PUBLIC; - }, - 285 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_PROTECTED; - }, - 286 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_PRIVATE; - }, - 287 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_STATIC; - }, - 288 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_ABSTRACT; - }, - 289 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_FINAL; - }, - 290 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 291 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 292 => function ($stackPos) { - $this->semValue = new Node\VarLikeIdentifier(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 293 => function ($stackPos) { - $this->semValue = new Stmt\PropertyProperty($this->semStack[$stackPos-(1-1)], null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 294 => function ($stackPos) { - $this->semValue = new Stmt\PropertyProperty($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 295 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 296 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 297 => function ($stackPos) { - $this->semValue = array(); - }, - 298 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 299 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 300 => function ($stackPos) { - $this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 301 => function ($stackPos) { - $this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 302 => function ($stackPos) { - $this->semValue = new Expr\AssignRef($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 303 => function ($stackPos) { - $this->semValue = new Expr\AssignRef($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 304 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 305 => function ($stackPos) { - $this->semValue = new Expr\Clone_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 306 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Plus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 307 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Minus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 308 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Mul($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 309 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Div($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 310 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Concat($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 311 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Mod($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 312 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 313 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\BitwiseOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 314 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\BitwiseXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 315 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\ShiftLeft($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 316 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\ShiftRight($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 317 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Pow($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 318 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Coalesce($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 319 => function ($stackPos) { - $this->semValue = new Expr\PostInc($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 320 => function ($stackPos) { - $this->semValue = new Expr\PreInc($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 321 => function ($stackPos) { - $this->semValue = new Expr\PostDec($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 322 => function ($stackPos) { - $this->semValue = new Expr\PreDec($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 323 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BooleanOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 324 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BooleanAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 325 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\LogicalOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 326 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\LogicalAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 327 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\LogicalXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 328 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 329 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 330 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 331 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 332 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Concat($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 333 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Plus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 334 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Minus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 335 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Mul($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 336 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Div($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 337 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Mod($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 338 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\ShiftLeft($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 339 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\ShiftRight($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 340 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Pow($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 341 => function ($stackPos) { - $this->semValue = new Expr\UnaryPlus($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 342 => function ($stackPos) { - $this->semValue = new Expr\UnaryMinus($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 343 => function ($stackPos) { - $this->semValue = new Expr\BooleanNot($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 344 => function ($stackPos) { - $this->semValue = new Expr\BitwiseNot($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 345 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Identical($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 346 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\NotIdentical($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 347 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Equal($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 348 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\NotEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 349 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Spaceship($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 350 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Smaller($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 351 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\SmallerOrEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 352 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Greater($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 353 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\GreaterOrEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 354 => function ($stackPos) { - $this->semValue = new Expr\Instanceof_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 355 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 356 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 357 => function ($stackPos) { - $this->semValue = new Expr\Ternary($this->semStack[$stackPos-(5-1)], $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - }, - 358 => function ($stackPos) { - $this->semValue = new Expr\Ternary($this->semStack[$stackPos-(4-1)], null, $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 359 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Coalesce($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 360 => function ($stackPos) { - $this->semValue = new Expr\Isset_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 361 => function ($stackPos) { - $this->semValue = new Expr\Empty_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 362 => function ($stackPos) { - $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_INCLUDE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 363 => function ($stackPos) { - $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_INCLUDE_ONCE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 364 => function ($stackPos) { - $this->semValue = new Expr\Eval_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 365 => function ($stackPos) { - $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_REQUIRE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 366 => function ($stackPos) { - $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_REQUIRE_ONCE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 367 => function ($stackPos) { - $this->semValue = new Expr\Cast\Int_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 368 => function ($stackPos) { - $attrs = $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes; - $attrs['kind'] = $this->getFloatCastKind($this->semStack[$stackPos-(2-1)]); - $this->semValue = new Expr\Cast\Double($this->semStack[$stackPos-(2-2)], $attrs); - }, - 369 => function ($stackPos) { - $this->semValue = new Expr\Cast\String_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 370 => function ($stackPos) { - $this->semValue = new Expr\Cast\Array_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 371 => function ($stackPos) { - $this->semValue = new Expr\Cast\Object_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 372 => function ($stackPos) { - $this->semValue = new Expr\Cast\Bool_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 373 => function ($stackPos) { - $this->semValue = new Expr\Cast\Unset_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 374 => function ($stackPos) { - $attrs = $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes; - $attrs['kind'] = strtolower($this->semStack[$stackPos-(2-1)]) === 'exit' ? Expr\Exit_::KIND_EXIT : Expr\Exit_::KIND_DIE; - $this->semValue = new Expr\Exit_($this->semStack[$stackPos-(2-2)], $attrs); - }, - 375 => function ($stackPos) { - $this->semValue = new Expr\ErrorSuppress($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 376 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 377 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 378 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 379 => function ($stackPos) { - $this->semValue = new Expr\ShellExec($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 380 => function ($stackPos) { - $this->semValue = new Expr\Print_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 381 => function ($stackPos) { - $this->semValue = new Expr\Yield_(null, null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 382 => function ($stackPos) { - $this->semValue = new Expr\YieldFrom($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 383 => function ($stackPos) { - $this->semValue = new Expr\Closure(['static' => false, 'byRef' => $this->semStack[$stackPos-(10-2)], 'params' => $this->semStack[$stackPos-(10-4)], 'uses' => $this->semStack[$stackPos-(10-6)], 'returnType' => $this->semStack[$stackPos-(10-7)], 'stmts' => $this->semStack[$stackPos-(10-9)]], $this->startAttributeStack[$stackPos-(10-1)] + $this->endAttributes); - }, - 384 => function ($stackPos) { - $this->semValue = new Expr\Closure(['static' => true, 'byRef' => $this->semStack[$stackPos-(11-3)], 'params' => $this->semStack[$stackPos-(11-5)], 'uses' => $this->semStack[$stackPos-(11-7)], 'returnType' => $this->semStack[$stackPos-(11-8)], 'stmts' => $this->semStack[$stackPos-(11-10)]], $this->startAttributeStack[$stackPos-(11-1)] + $this->endAttributes); - }, - 385 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 386 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 387 => function ($stackPos) { - $this->semValue = new Expr\Yield_($this->semStack[$stackPos-(2-2)], null, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 388 => function ($stackPos) { - $this->semValue = new Expr\Yield_($this->semStack[$stackPos-(4-4)], $this->semStack[$stackPos-(4-2)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 389 => function ($stackPos) { - $attrs = $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes; $attrs['kind'] = Expr\Array_::KIND_LONG; - $this->semValue = new Expr\Array_($this->semStack[$stackPos-(4-3)], $attrs); - }, - 390 => function ($stackPos) { - $attrs = $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes; $attrs['kind'] = Expr\Array_::KIND_SHORT; - $this->semValue = new Expr\Array_($this->semStack[$stackPos-(3-2)], $attrs); - }, - 391 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 392 => function ($stackPos) { - $attrs = $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes; $attrs['kind'] = ($this->semStack[$stackPos-(4-1)][0] === "'" || ($this->semStack[$stackPos-(4-1)][1] === "'" && ($this->semStack[$stackPos-(4-1)][0] === 'b' || $this->semStack[$stackPos-(4-1)][0] === 'B')) ? Scalar\String_::KIND_SINGLE_QUOTED : Scalar\String_::KIND_DOUBLE_QUOTED); - $this->semValue = new Expr\ArrayDimFetch(new Scalar\String_(Scalar\String_::parse($this->semStack[$stackPos-(4-1)]), $attrs), $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 393 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 394 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 395 => function ($stackPos) { - $this->semValue = array(new Stmt\Class_(null, ['type' => 0, 'extends' => $this->semStack[$stackPos-(7-3)], 'implements' => $this->semStack[$stackPos-(7-4)], 'stmts' => $this->semStack[$stackPos-(7-6)]], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes), $this->semStack[$stackPos-(7-2)]); - $this->checkClass($this->semValue[0], -1); - }, - 396 => function ($stackPos) { - $this->semValue = new Expr\New_($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 397 => function ($stackPos) { - list($class, $ctorArgs) = $this->semStack[$stackPos-(2-2)]; $this->semValue = new Expr\New_($class, $ctorArgs, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 398 => function ($stackPos) { - $this->semValue = array(); - }, - 399 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-3)]; - }, - 400 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 401 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 402 => function ($stackPos) { - $this->semValue = new Expr\ClosureUse($this->semStack[$stackPos-(2-2)], $this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 403 => function ($stackPos) { - $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 404 => function ($stackPos) { - $this->semValue = new Expr\StaticCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 405 => function ($stackPos) { - $this->semValue = new Expr\StaticCall($this->semStack[$stackPos-(6-1)], $this->semStack[$stackPos-(6-4)], $this->semStack[$stackPos-(6-6)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); - }, - 406 => function ($stackPos) { - $this->semValue = $this->fixupPhp5StaticPropCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 407 => function ($stackPos) { - $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 408 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 409 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 410 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 411 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 412 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 413 => function ($stackPos) { - $this->semValue = new Name\FullyQualified(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 414 => function ($stackPos) { - $this->semValue = new Name\Relative(substr($this->semStack[$stackPos-(1-1)], 10), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 415 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 416 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 417 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 418 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 419 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 420 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 421 => function ($stackPos) { - $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 422 => function ($stackPos) { - $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 423 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 424 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 425 => function ($stackPos) { - $this->semValue = null; - }, - 426 => function ($stackPos) { - $this->semValue = null; - }, - 427 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 428 => function ($stackPos) { - $this->semValue = array(); - }, - 429 => function ($stackPos) { - $this->semValue = array(new Scalar\EncapsedStringPart(Scalar\String_::parseEscapeSequences($this->semStack[$stackPos-(1-1)], '`', false), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes)); - }, - 430 => function ($stackPos) { - foreach ($this->semStack[$stackPos-(1-1)] as $s) { if ($s instanceof Node\Scalar\EncapsedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '`', false); } }; $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 431 => function ($stackPos) { - $this->semValue = array(); - }, - 432 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 433 => function ($stackPos) { - $this->semValue = $this->parseLNumber($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes, true); - }, - 434 => function ($stackPos) { - $this->semValue = new Scalar\DNumber(Scalar\DNumber::parse($this->semStack[$stackPos-(1-1)]), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 435 => function ($stackPos) { - $attrs = $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes; $attrs['kind'] = ($this->semStack[$stackPos-(1-1)][0] === "'" || ($this->semStack[$stackPos-(1-1)][1] === "'" && ($this->semStack[$stackPos-(1-1)][0] === 'b' || $this->semStack[$stackPos-(1-1)][0] === 'B')) ? Scalar\String_::KIND_SINGLE_QUOTED : Scalar\String_::KIND_DOUBLE_QUOTED); - $this->semValue = new Scalar\String_(Scalar\String_::parse($this->semStack[$stackPos-(1-1)], false), $attrs); - }, - 436 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Line($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 437 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\File($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 438 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Dir($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 439 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Class_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 440 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Trait_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 441 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Method($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 442 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Function_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 443 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Namespace_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 444 => function ($stackPos) { - $this->semValue = $this->parseDocString($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes, $this->startAttributeStack[$stackPos-(3-3)] + $this->endAttributeStack[$stackPos-(3-3)], false); - }, - 445 => function ($stackPos) { - $this->semValue = $this->parseDocString($this->semStack[$stackPos-(2-1)], '', $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes, $this->startAttributeStack[$stackPos-(2-2)] + $this->endAttributeStack[$stackPos-(2-2)], false); - }, - 446 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 447 => function ($stackPos) { - $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 448 => function ($stackPos) { - $this->semValue = new Expr\ConstFetch($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 449 => function ($stackPos) { - $this->semValue = new Expr\Array_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 450 => function ($stackPos) { - $this->semValue = new Expr\Array_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 451 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 452 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BooleanOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 453 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BooleanAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 454 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\LogicalOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 455 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\LogicalAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 456 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\LogicalXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 457 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 458 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 459 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 460 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 461 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Concat($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 462 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Plus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 463 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Minus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 464 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Mul($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 465 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Div($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 466 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Mod($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 467 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\ShiftLeft($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 468 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\ShiftRight($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 469 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Pow($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 470 => function ($stackPos) { - $this->semValue = new Expr\UnaryPlus($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 471 => function ($stackPos) { - $this->semValue = new Expr\UnaryMinus($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 472 => function ($stackPos) { - $this->semValue = new Expr\BooleanNot($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 473 => function ($stackPos) { - $this->semValue = new Expr\BitwiseNot($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 474 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Identical($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 475 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\NotIdentical($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 476 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Equal($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 477 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\NotEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 478 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Smaller($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 479 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\SmallerOrEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 480 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Greater($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 481 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\GreaterOrEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 482 => function ($stackPos) { - $this->semValue = new Expr\Ternary($this->semStack[$stackPos-(5-1)], $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - }, - 483 => function ($stackPos) { - $this->semValue = new Expr\Ternary($this->semStack[$stackPos-(4-1)], null, $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 484 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 485 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 486 => function ($stackPos) { - $this->semValue = new Expr\ConstFetch($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 487 => function ($stackPos) { - $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 488 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 489 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 490 => function ($stackPos) { - $attrs = $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes; $attrs['kind'] = Scalar\String_::KIND_DOUBLE_QUOTED; - foreach ($this->semStack[$stackPos-(3-2)] as $s) { if ($s instanceof Node\Scalar\EncapsedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '"', true); } }; $this->semValue = new Scalar\Encapsed($this->semStack[$stackPos-(3-2)], $attrs); - }, - 491 => function ($stackPos) { - $this->semValue = $this->parseDocString($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes, $this->startAttributeStack[$stackPos-(3-3)] + $this->endAttributeStack[$stackPos-(3-3)], true); - }, - 492 => function ($stackPos) { - $this->semValue = array(); - }, - 493 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 494 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 495 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 496 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 497 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 498 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(3-3)], $this->semStack[$stackPos-(3-1)], false, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 499 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 500 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 501 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 502 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 503 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 504 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-5)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); - }, - 505 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 506 => function ($stackPos) { - $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 507 => function ($stackPos) { - $this->semValue = new Expr\MethodCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 508 => function ($stackPos) { - $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 509 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 510 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 511 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 512 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 513 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 514 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 515 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 516 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 517 => function ($stackPos) { - $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 518 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 519 => function ($stackPos) { - $var = substr($this->semStack[$stackPos-(1-1)], 1); $this->semValue = \is_string($var) ? new Node\VarLikeIdentifier($var, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes) : $var; - }, - 520 => function ($stackPos) { - $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 521 => function ($stackPos) { - $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(6-1)], $this->semStack[$stackPos-(6-5)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); - }, - 522 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 523 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 524 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 525 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 526 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 527 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 528 => function ($stackPos) { - $this->semValue = null; - }, - 529 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 530 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 531 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 532 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 533 => function ($stackPos) { - $this->semValue = new Expr\Error($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->errorState = 2; - }, - 534 => function ($stackPos) { - $this->semValue = new Expr\List_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 535 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 536 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 537 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 538 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 539 => function ($stackPos) { - $this->semValue = null; - }, - 540 => function ($stackPos) { - $this->semValue = array(); - }, - 541 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 542 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 543 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 544 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(3-3)], $this->semStack[$stackPos-(3-1)], false, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 545 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 546 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(4-4)], $this->semStack[$stackPos-(4-1)], true, $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 547 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(2-2)], null, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 548 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(2-2)], null, false, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 549 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 550 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 551 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 552 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)]); - }, - 553 => function ($stackPos) { - $this->semValue = new Scalar\EncapsedStringPart($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 554 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 555 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 556 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 557 => function ($stackPos) { - $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 558 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 559 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 560 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-4)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); - }, - 561 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 562 => function ($stackPos) { - $this->semValue = new Scalar\String_($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 563 => function ($stackPos) { - $this->semValue = $this->parseNumString($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 564 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - ]; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php b/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php deleted file mode 100644 index 7a0854b..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php +++ /dev/null @@ -1,2804 +0,0 @@ -'", - "T_IS_GREATER_OR_EQUAL", - "T_SL", - "T_SR", - "'+'", - "'-'", - "'.'", - "'*'", - "'/'", - "'%'", - "'!'", - "T_INSTANCEOF", - "'~'", - "T_INC", - "T_DEC", - "T_INT_CAST", - "T_DOUBLE_CAST", - "T_STRING_CAST", - "T_ARRAY_CAST", - "T_OBJECT_CAST", - "T_BOOL_CAST", - "T_UNSET_CAST", - "'@'", - "T_POW", - "'['", - "T_NEW", - "T_CLONE", - "T_EXIT", - "T_IF", - "T_ELSEIF", - "T_ELSE", - "T_ENDIF", - "T_LNUMBER", - "T_DNUMBER", - "T_STRING", - "T_STRING_VARNAME", - "T_VARIABLE", - "T_NUM_STRING", - "T_INLINE_HTML", - "T_ENCAPSED_AND_WHITESPACE", - "T_CONSTANT_ENCAPSED_STRING", - "T_ECHO", - "T_DO", - "T_WHILE", - "T_ENDWHILE", - "T_FOR", - "T_ENDFOR", - "T_FOREACH", - "T_ENDFOREACH", - "T_DECLARE", - "T_ENDDECLARE", - "T_AS", - "T_SWITCH", - "T_MATCH", - "T_ENDSWITCH", - "T_CASE", - "T_DEFAULT", - "T_BREAK", - "T_CONTINUE", - "T_GOTO", - "T_FUNCTION", - "T_FN", - "T_CONST", - "T_RETURN", - "T_TRY", - "T_CATCH", - "T_FINALLY", - "T_USE", - "T_INSTEADOF", - "T_GLOBAL", - "T_STATIC", - "T_ABSTRACT", - "T_FINAL", - "T_PRIVATE", - "T_PROTECTED", - "T_PUBLIC", - "T_READONLY", - "T_VAR", - "T_UNSET", - "T_ISSET", - "T_EMPTY", - "T_HALT_COMPILER", - "T_CLASS", - "T_TRAIT", - "T_INTERFACE", - "T_ENUM", - "T_EXTENDS", - "T_IMPLEMENTS", - "T_OBJECT_OPERATOR", - "T_NULLSAFE_OBJECT_OPERATOR", - "T_LIST", - "T_ARRAY", - "T_CALLABLE", - "T_CLASS_C", - "T_TRAIT_C", - "T_METHOD_C", - "T_FUNC_C", - "T_LINE", - "T_FILE", - "T_START_HEREDOC", - "T_END_HEREDOC", - "T_DOLLAR_OPEN_CURLY_BRACES", - "T_CURLY_OPEN", - "T_PAAMAYIM_NEKUDOTAYIM", - "T_NAMESPACE", - "T_NS_C", - "T_DIR", - "T_NS_SEPARATOR", - "T_ELLIPSIS", - "T_NAME_FULLY_QUALIFIED", - "T_NAME_QUALIFIED", - "T_NAME_RELATIVE", - "T_ATTRIBUTE", - "';'", - "']'", - "'{'", - "'}'", - "'('", - "')'", - "'`'", - "'\"'", - "'$'" - ); - - protected $tokenToSymbol = array( - 0, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 56, 166, 168, 167, 55, 168, 168, - 163, 164, 53, 50, 8, 51, 52, 54, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 31, 159, - 44, 16, 46, 30, 68, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 70, 168, 160, 36, 168, 165, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 161, 35, 162, 58, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 1, 2, 3, 4, - 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 32, 33, 34, 37, 38, 39, 40, - 41, 42, 43, 45, 47, 48, 49, 57, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 69, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158 - ); - - protected $action = array( - 132, 133, 134, 569, 135, 136, 0, 722, 723, 724, - 137, 37, 834, 911, 835, 469,-32766,-32766,-32766,-32767, - -32767,-32767,-32767, 101, 102, 103, 104, 105, 1068, 1069, - 1070, 1067, 1066, 1065, 1071, 716, 715,-32766,-32766,-32766, - -32766,-32766,-32766,-32766,-32766,-32766,-32767,-32767,-32767,-32767, - -32767, 545, 546,-32766,-32766, 725,-32766,-32766,-32766, 998, - 999, 806, 922, 447, 448, 449, 370, 371, 2, 267, - 138, 396, 729, 730, 731, 732, 414,-32766, 420,-32766, - -32766,-32766,-32766,-32766, 990, 733, 734, 735, 736, 737, - 738, 739, 740, 741, 742, 743, 763, 570, 764, 765, - 766, 767, 755, 756, 336, 337, 758, 759, 744, 745, - 746, 748, 749, 750, 346, 790, 791, 792, 793, 794, - 795, 751, 752, 571, 572, 784, 775, 773, 774, 787, - 770, 771, 283, 420, 573, 574, 769, 575, 576, 577, - 578, 579, 580, 598, -575, 470, 14, 798, 772, 581, - 582, -575, 139,-32766,-32766,-32766, 132, 133, 134, 569, - 135, 136, 1017, 722, 723, 724, 137, 37, 1060,-32766, - -32766,-32766, 1303, 696,-32766, 1304,-32766,-32766,-32766,-32766, - -32766,-32766,-32766, 1068, 1069, 1070, 1067, 1066, 1065, 1071, - -32766, 716, 715, 372, 371, 1258,-32766,-32766,-32766, -572, - 106, 107, 108, 414, 270, 891, -572, 240, 1193, 1192, - 1194, 725,-32766,-32766,-32766, 1046, 109,-32766,-32766,-32766, - -32766, 986, 985, 984, 987, 267, 138, 396, 729, 730, - 731, 732, 12,-32766, 420,-32766,-32766,-32766,-32766, 998, - 999, 733, 734, 735, 736, 737, 738, 739, 740, 741, - 742, 743, 763, 570, 764, 765, 766, 767, 755, 756, - 336, 337, 758, 759, 744, 745, 746, 748, 749, 750, - 346, 790, 791, 792, 793, 794, 795, 751, 752, 571, - 572, 784, 775, 773, 774, 787, 770, 771, 881, 321, - 573, 574, 769, 575, 576, 577, 578, 579, 580,-32766, - 82, 83, 84, -575, 772, 581, 582, -575, 148, 747, - 717, 718, 719, 720, 721, 1278, 722, 723, 724, 760, - 761, 36, 1277, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 996, 270, 150, - -32766,-32766,-32766, 455, 456, 81, 34, -264, -572, 1016, - 109, 320, -572, 893, 725, 682, 803, 128, 998, 999, - 592,-32766, 1044,-32766,-32766,-32766, 809, 151, 726, 727, - 728, 729, 730, 731, 732, -88, 1198, 796, 278, -526, - 283,-32766,-32766,-32766, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 763, 786, 764, 765, 766, - 767, 755, 756, 757, 785, 758, 759, 744, 745, 746, - 748, 749, 750, 789, 790, 791, 792, 793, 794, 795, - 751, 752, 753, 754, 784, 775, 773, 774, 787, 770, - 771, 144, 804, 762, 768, 769, 776, 777, 779, 778, - 780, 781, -314, -526, -526, -193, -192, 772, 783, 782, - 49, 50, 51, 500, 52, 53, 239, 807, -526, -86, - 54, 55, -111, 56, 996, 253,-32766, -111, 800, -111, - -526, 541, -532, -352, 300, -352, 304, -111, -111, -111, - -111, -111, -111, -111, -111, 998, 999, 998, 999, 153, - -32766,-32766,-32766, 1191, 807, 126, 306, 1293, 57, 58, - 103, 104, 105, -111, 59, 1218, 60, 246, 247, 61, - 62, 63, 64, 65, 66, 67, 68, -525, 27, 268, - 69, 436, 501, -328, 808, -86, 1224, 1225, 502, 1189, - 807, 1198, 1230, 293, 1222, 41, 24, 503, 74, 504, - 953, 505, 320, 506, 802, 154, 507, 508, 279, 684, - 280, 43, 44, 437, 367, 366, 891, 45, 509, 35, - 249, -16, -566, 358, 332, 318, -566, 1198, 1193, 1192, - 1194, -527, 510, 511, 512, 333, -524, 1274, 48, 716, - 715, -525, -525, 334, 513, 514, 807, 1212, 1213, 1214, - 1215, 1209, 1210, 292, 360, 284, -525, 285, -314, 1216, - 1211, -193, -192, 1193, 1192, 1194, 293, 891, -525, 364, - -531, 70, 807, 316, 317, 320, 31, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - -153, -153, -153, 638, 25, -527, -527, 687, 379, 881, - -524, -524, 296, 297, 891, -153, 432, -153, 807, -153, - -527, -153, 716, 715, 433, -524, 798, 363, -111, 1105, - 1107, 365, -527, 434, 891, 140, 435, -524, 954, 127, - -524, 320, -111, -111, 688, 813, 381, -529, 11, 834, - 155, 835, 867, -111, -111, -111, -111, 47, 293,-32766, - 881, 654, 655, 74, 689, 1191, 1045, 320, 708, 149, - 399, 157,-32766,-32766,-32766, 32,-32766, -79,-32766, 123, - -32766, 716, 715,-32766, 893, 891, 682, -153,-32766,-32766, - -32766, 716, 715, 891,-32766,-32766, 124, 881, 129, 74, - -32766, 411, 130, 320, -524, -524, 143, 141, -75,-32766, - 158, -529, -529, 320, 27, 691, 159, 881, 160, -524, - 161, 294, 295, 698, 368, 369, 807, -73,-32766, -72, - 1222, -524, 373, 374, 1191, 893, -71, 682, -529, 73, - -70,-32766,-32766,-32766, -69,-32766, -68,-32766, 125,-32766, - 630, 631,-32766, -67, -66, -47, -51,-32766,-32766,-32766, - -18, 147, 271,-32766,-32766, 277, 697, 700, 881,-32766, - 411, 890, 893, 146, 682, 282, 881, 907,-32766, 281, - 513, 514, 286, 1212, 1213, 1214, 1215, 1209, 1210, 326, - 131, 145, 939, 287, 682, 1216, 1211, 109, 270,-32766, - 798, 807,-32766, 662, 639, 1191, 657, 72, 675, 1075, - 317, 320,-32766,-32766,-32766, 1305,-32766, 301,-32766, 628, - -32766, 431, 543,-32766,-32766, 923, 555, 924,-32766,-32766, - -32766, 1229, 549,-32766,-32766,-32766, -4, 891, -490, 1191, - -32766, 411, 644, 893, 299, 682,-32766,-32766,-32766,-32766, - -32766, 893,-32766, 682,-32766, 13, 1231,-32766, 452, 480, - 645, 909,-32766,-32766,-32766,-32766, 658, -480,-32766,-32766, - 0, 1191, 0, 0,-32766, 411, 0, 298,-32766,-32766, - -32766, 305,-32766,-32766,-32766, 0,-32766, 0, 806,-32766, - 0, 0, 0, 475,-32766,-32766,-32766,-32766, 0, 7, - -32766,-32766, 16, 1191, 561, 596,-32766, 411, 1219, 891, - -32766,-32766,-32766, 362,-32766,-32766,-32766, 818,-32766, -267, - 881,-32766, 39, 293, 0, 0,-32766,-32766,-32766, 40, - 705, 706,-32766,-32766, 872, 963, 940, 947,-32766, 411, - 937, 948, 365, 870, 427, 891, 935,-32766, 1049, 291, - 1244, 1052, 1053, -111, -111, 1050, 1051, 1057, -560, 1262, - 1296, 633, 0, 826, -111, -111, -111, -111, 33, 315, - -32766, 361, 683, 686, 690, 692, 1191, 693, 694, 695, - 699, 685, 320,-32766,-32766,-32766, 9,-32766, 702,-32766, - 868,-32766, 881, 1300,-32766, 893, 1302, 682, -4,-32766, - -32766,-32766, 829, 828, 837,-32766,-32766, 916, -242, -242, - -242,-32766, 411, 955, 365, 27, 836, 1301, 915, 917, - -32766, 914, 1177, 900, 910, -111, -111, 807, 881, 898, - 945, 1222, 946, 1299, 1256, 867, -111, -111, -111, -111, - 1245, 1263, 1269, 1272, -241, -241, -241, -558, -532, -531, - 365, -530, 1, 28, 29, 38, 42, 46, 71, 0, - 75, -111, -111, 76, 77, 78, 79, 893, 80, 682, - -242, 867, -111, -111, -111, -111, 142, 152, 156, 245, - 322, 347, 514, 348, 1212, 1213, 1214, 1215, 1209, 1210, - 349, 350, 351, 352, 353, 354, 1216, 1211, 355, 356, - 357, 359, 428, 893, -265, 682, -241, -264, 72, 0, - 18, 317, 320, 19, 20, 21, 23, 398, 471, 472, - 479, 482, 483, 484, 485, 489, 490, 491, 498, 669, - 1202, 1145, 1220, 1019, 1018, 1181, -269, -103, 17, 22, - 26, 290, 397, 589, 593, 620, 674, 1149, 1197, 1146, - 1275, 0, -494, 1162, 0, 1223 - ); - - protected $actionCheck = array( - 2, 3, 4, 5, 6, 7, 0, 9, 10, 11, - 12, 13, 106, 1, 108, 31, 9, 10, 11, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 116, 117, - 118, 119, 120, 121, 122, 37, 38, 30, 116, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 117, 118, 9, 10, 57, 9, 10, 11, 137, - 138, 155, 128, 129, 130, 131, 106, 107, 8, 71, - 72, 73, 74, 75, 76, 77, 116, 30, 80, 32, - 33, 34, 35, 36, 1, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 30, 80, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 51, 1, 161, 101, 80, 150, 151, - 152, 8, 154, 9, 10, 11, 2, 3, 4, 5, - 6, 7, 164, 9, 10, 11, 12, 13, 123, 9, - 10, 11, 80, 161, 30, 83, 32, 33, 34, 35, - 36, 37, 38, 116, 117, 118, 119, 120, 121, 122, - 30, 37, 38, 106, 107, 1, 9, 10, 11, 1, - 53, 54, 55, 116, 57, 1, 8, 14, 155, 156, - 157, 57, 9, 10, 11, 162, 69, 30, 116, 32, - 33, 119, 120, 121, 122, 71, 72, 73, 74, 75, - 76, 77, 8, 30, 80, 32, 33, 34, 35, 137, - 138, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 84, 70, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 9, - 9, 10, 11, 160, 150, 151, 152, 164, 154, 2, - 3, 4, 5, 6, 7, 1, 9, 10, 11, 12, - 13, 30, 8, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 116, 57, 14, - 9, 10, 11, 134, 135, 161, 8, 164, 160, 1, - 69, 167, 164, 159, 57, 161, 80, 8, 137, 138, - 1, 30, 1, 32, 33, 34, 1, 14, 71, 72, - 73, 74, 75, 76, 77, 31, 1, 80, 30, 70, - 30, 9, 10, 11, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 8, 156, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 8, 134, 135, 8, 8, 150, 151, 152, - 2, 3, 4, 5, 6, 7, 97, 82, 149, 31, - 12, 13, 101, 15, 116, 8, 116, 106, 80, 108, - 161, 85, 163, 106, 113, 108, 8, 116, 117, 118, - 119, 120, 121, 122, 123, 137, 138, 137, 138, 14, - 9, 10, 11, 80, 82, 14, 8, 85, 50, 51, - 50, 51, 52, 128, 56, 1, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 70, 70, 71, - 72, 73, 74, 162, 159, 97, 78, 79, 80, 116, - 82, 1, 146, 158, 86, 87, 88, 89, 163, 91, - 31, 93, 167, 95, 156, 14, 98, 99, 35, 161, - 37, 103, 104, 105, 106, 107, 1, 109, 110, 147, - 148, 31, 160, 115, 116, 8, 164, 1, 155, 156, - 157, 70, 124, 125, 126, 8, 70, 1, 70, 37, - 38, 134, 135, 8, 136, 137, 82, 139, 140, 141, - 142, 143, 144, 145, 8, 35, 149, 37, 164, 151, - 152, 164, 164, 155, 156, 157, 158, 1, 161, 8, - 163, 163, 82, 165, 166, 167, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 75, 76, 77, 75, 76, 134, 135, 31, 8, 84, - 134, 135, 134, 135, 1, 90, 8, 92, 82, 94, - 149, 96, 37, 38, 8, 149, 80, 149, 128, 59, - 60, 106, 161, 8, 1, 161, 8, 161, 159, 161, - 70, 167, 117, 118, 31, 8, 106, 70, 108, 106, - 14, 108, 127, 128, 129, 130, 131, 70, 158, 74, - 84, 75, 76, 163, 31, 80, 159, 167, 161, 101, - 102, 14, 87, 88, 89, 14, 91, 31, 93, 16, - 95, 37, 38, 98, 159, 1, 161, 162, 103, 104, - 105, 37, 38, 1, 109, 110, 16, 84, 16, 163, - 115, 116, 16, 167, 134, 135, 16, 161, 31, 124, - 16, 134, 135, 167, 70, 31, 16, 84, 16, 149, - 16, 134, 135, 31, 106, 107, 82, 31, 74, 31, - 86, 161, 106, 107, 80, 159, 31, 161, 161, 154, - 31, 87, 88, 89, 31, 91, 31, 93, 161, 95, - 111, 112, 98, 31, 31, 31, 31, 103, 104, 105, - 31, 31, 31, 109, 110, 31, 31, 31, 84, 115, - 116, 31, 159, 31, 161, 37, 84, 38, 124, 35, - 136, 137, 35, 139, 140, 141, 142, 143, 144, 35, - 31, 70, 159, 37, 161, 151, 152, 69, 57, 74, - 80, 82, 85, 77, 90, 80, 94, 163, 92, 82, - 166, 167, 87, 88, 89, 83, 91, 114, 93, 113, - 95, 128, 85, 98, 116, 128, 153, 128, 103, 104, - 105, 146, 89, 74, 109, 110, 0, 1, 149, 80, - 115, 116, 96, 159, 133, 161, 87, 88, 89, 124, - 91, 159, 93, 161, 95, 97, 146, 98, 97, 97, - 100, 154, 103, 104, 105, 74, 100, 149, 109, 110, - -1, 80, -1, -1, 115, 116, -1, 132, 87, 88, - 89, 132, 91, 124, 93, -1, 95, -1, 155, 98, - -1, -1, -1, 102, 103, 104, 105, 74, -1, 149, - 109, 110, 149, 80, 81, 153, 115, 116, 160, 1, - 87, 88, 89, 149, 91, 124, 93, 160, 95, 164, - 84, 98, 159, 158, -1, -1, 103, 104, 105, 159, - 159, 159, 109, 110, 159, 159, 159, 159, 115, 116, - 159, 159, 106, 159, 108, 1, 159, 124, 159, 113, - 160, 159, 159, 117, 118, 159, 159, 159, 163, 160, - 160, 160, -1, 127, 128, 129, 130, 131, 161, 161, - 74, 161, 161, 161, 161, 161, 80, 161, 161, 161, - 161, 161, 167, 87, 88, 89, 150, 91, 162, 93, - 162, 95, 84, 162, 98, 159, 162, 161, 162, 103, - 104, 105, 162, 162, 162, 109, 110, 162, 100, 101, - 102, 115, 116, 162, 106, 70, 162, 162, 162, 162, - 124, 162, 162, 162, 162, 117, 118, 82, 84, 162, - 162, 86, 162, 162, 162, 127, 128, 129, 130, 131, - 162, 162, 162, 162, 100, 101, 102, 163, 163, 163, - 106, 163, 163, 163, 163, 163, 163, 163, 163, -1, - 163, 117, 118, 163, 163, 163, 163, 159, 163, 161, - 162, 127, 128, 129, 130, 131, 163, 163, 163, 163, - 163, 163, 137, 163, 139, 140, 141, 142, 143, 144, - 163, 163, 163, 163, 163, 163, 151, 152, 163, 163, - 163, 163, 163, 159, 164, 161, 162, 164, 163, -1, - 164, 166, 167, 164, 164, 164, 164, 164, 164, 164, - 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, - 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, - 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, - 164, -1, 165, 165, -1, 166 - ); - - protected $actionBase = array( - 0, -2, 154, 565, 876, 948, 984, 514, 53, 398, - 837, 307, 307, 67, 307, 307, 307, 653, 724, 724, - 732, 724, 616, 673, 204, 204, 204, 625, 625, 625, - 625, 694, 694, 831, 831, 863, 799, 765, 936, 936, - 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, - 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, - 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, - 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, - 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, - 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, - 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, - 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, - 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, - 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, - 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, - 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, - 936, 936, 375, 519, 369, 701, 1017, 1023, 1019, 1024, - 1015, 1014, 1018, 1020, 1025, 911, 912, 782, 918, 919, - 920, 921, 1021, 841, 1016, 1022, 291, 291, 291, 291, - 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, - 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, - 291, 291, 290, 491, 44, 382, 382, 382, 382, 382, - 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, - 382, 382, 382, 382, 382, 160, 160, 160, 187, 684, - 684, 341, 203, 610, 47, 985, 985, 985, 985, 985, - 985, 985, 985, 985, 985, 144, 144, 7, 7, 7, - 7, 7, 371, -25, -25, -25, -25, 540, 385, 102, - 576, 358, 45, 377, 460, 460, 360, 231, 231, 231, - 231, 231, 231, -78, -78, -78, -78, -78, -66, 319, - 457, -94, 396, 423, 586, 586, 586, 586, 423, 423, - 423, 423, 750, 1029, 423, 423, 423, 511, 516, 516, - 518, 147, 147, 147, 516, 583, 777, 422, 583, 422, - 194, 92, 748, -40, 87, 412, 748, 617, 627, 198, - 143, 773, 658, 773, 1013, 757, 764, 717, 838, 860, - 1026, 800, 908, 806, 910, 219, 686, 1012, 1012, 1012, - 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 855, 552, - 1013, 286, 855, 855, 855, 552, 552, 552, 552, 552, - 552, 552, 552, 552, 552, 679, 286, 568, 626, 286, - 794, 552, 375, 758, 375, 375, 375, 375, 958, 375, - 375, 375, 375, 375, 375, 970, 769, -16, 375, 519, - 12, 12, 547, 83, 12, 12, 12, 12, 375, 375, - 375, 658, 781, 713, 666, 792, 448, 781, 781, 781, - 438, 444, 193, 447, 570, 523, 580, 760, 760, 767, - 929, 929, 760, 759, 760, 767, 934, 760, 929, 805, - 359, 648, 577, 611, 656, 929, 478, 760, 760, 760, - 760, 665, 760, 467, 433, 760, 760, 785, 774, 789, - 60, 929, 929, 929, 789, 596, 751, 751, 751, 811, - 812, 746, 771, 567, 498, 677, 348, 779, 771, 771, - 760, 640, 746, 771, 746, 771, 747, 771, 771, 771, - 746, 771, 759, 585, 771, 734, 668, 224, 771, 6, - 935, 937, 354, 940, 932, 941, 979, 942, 943, 851, - 956, 933, 945, 931, 930, 780, 703, 720, 790, 729, - 928, 768, 768, 768, 925, 768, 768, 768, 768, 768, - 768, 768, 768, 703, 788, 804, 733, 783, 960, 722, - 726, 725, 868, 1027, 1028, 737, 739, 958, 1006, 953, - 803, 730, 992, 967, 866, 848, 968, 969, 993, 1007, - 1008, 871, 761, 874, 880, 797, 971, 852, 768, 935, - 943, 933, 945, 931, 930, 763, 762, 753, 755, 749, - 745, 736, 738, 770, 1009, 924, 835, 830, 970, 926, - 703, 839, 986, 847, 994, 995, 850, 801, 772, 840, - 881, 972, 975, 976, 853, 1010, 810, 989, 795, 996, - 802, 882, 997, 998, 999, 1000, 885, 854, 856, 857, - 815, 754, 980, 786, 891, 335, 787, 796, 978, 363, - 957, 858, 894, 895, 1001, 1002, 1003, 896, 954, 816, - 990, 752, 991, 983, 817, 818, 485, 784, 778, 541, - 676, 897, 899, 900, 955, 775, 766, 821, 822, 1011, - 901, 697, 824, 740, 902, 1005, 742, 744, 756, 859, - 793, 743, 798, 977, 776, 827, 907, 829, 832, 833, - 1004, 836, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 458, 458, 458, 458, 458, 458, 307, 307, 307, - 307, 0, 0, 307, 0, 0, 0, 458, 458, 458, - 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, - 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, - 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, - 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, - 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, - 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, - 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, - 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, - 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, - 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, - 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, - 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, - 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, - 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, - 458, 458, 291, 291, 291, 291, 291, 291, 291, 291, - 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, - 291, 291, 291, 291, 291, 291, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 291, 291, 291, 291, 291, 291, 291, 291, - 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, - 291, 291, 291, 291, 291, 291, 291, 291, 291, 423, - 423, 291, 291, 0, 291, 423, 423, 423, 423, 423, - 423, 423, 423, 423, 423, 291, 291, 291, 291, 291, - 291, 291, 805, 147, 147, 147, 147, 423, 423, 423, - 423, 423, -88, -88, 147, 147, 423, 423, 423, 423, - 423, 423, 423, 423, 423, 423, 423, 423, 0, 0, - 0, 286, 422, 0, 759, 759, 759, 759, 0, 0, - 0, 0, 422, 422, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 286, 422, 0, 286, 0, - 759, 759, 423, 805, 805, 314, 423, 0, 0, 0, - 0, 286, 759, 286, 552, 422, 552, 552, 12, 375, - 314, 608, 608, 608, 608, 0, 658, 805, 805, 805, - 805, 805, 805, 805, 805, 805, 805, 805, 759, 0, - 805, 0, 759, 759, 759, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 759, 0, 0, 929, 0, 0, 0, 0, 760, 0, - 0, 0, 0, 0, 0, 760, 934, 0, 0, 0, - 0, 0, 0, 759, 0, 0, 0, 0, 0, 0, - 0, 0, 768, 801, 0, 801, 0, 768, 768, 768 - ); - - protected $actionDefault = array( - 3,32767, 103,32767,32767,32767,32767,32767,32767,32767, - 32767,32767, 101,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767, 578, 578, 578, - 578,32767,32767, 246, 103,32767,32767, 454, 372, 372, - 372,32767,32767, 522, 522, 522, 522, 522, 522,32767, - 32767,32767,32767,32767,32767, 454,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767, 101,32767, - 32767,32767, 37, 7, 8, 10, 11, 50, 17, 310, - 32767,32767,32767,32767, 103,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767, 571,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767, 458, 437, 438, 440, - 441, 371, 523, 577, 313, 574, 370, 146, 325, 315, - 234, 316, 250, 459, 251, 460, 463, 464, 211, 279, - 367, 150, 401, 455, 403, 453, 457, 402, 377, 382, - 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 375, 376, 456, 434, 433, 432, 399,32767, - 32767, 400, 404, 374, 407,32767,32767,32767,32767,32767, - 32767,32767,32767, 103,32767, 405, 406, 423, 424, 421, - 422, 425,32767, 426, 427, 428, 429,32767,32767, 302, - 32767,32767, 351, 349, 414, 415, 302,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767, 516, - 431,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767, 103,32767, 101, 518, 396, 398, - 486, 409, 410, 408, 378,32767, 493,32767, 103, 495, - 32767,32767,32767, 112,32767,32767,32767, 517,32767, 524, - 524,32767, 479, 101, 194,32767, 194, 194,32767,32767, - 32767,32767,32767,32767,32767, 585, 479, 111, 111, 111, - 111, 111, 111, 111, 111, 111, 111, 111,32767, 194, - 111,32767,32767,32767, 101, 194, 194, 194, 194, 194, - 194, 194, 194, 194, 194, 189,32767, 260, 262, 103, - 539, 194,32767, 498,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767, 491,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767, 479, 419, 139,32767, 139, 524, 411, 412, 413, - 481, 524, 524, 524, 298, 281,32767,32767,32767,32767, - 496, 496, 101, 101, 101, 101, 491,32767,32767, 112, - 100, 100, 100, 100, 100, 104, 102,32767,32767,32767, - 32767, 100,32767, 102, 102,32767,32767, 217, 208, 215, - 102,32767, 543, 544, 215, 102, 219, 219, 219, 239, - 239, 470, 304, 102, 100, 102, 102, 196, 304, 304, - 32767, 102, 470, 304, 470, 304, 198, 304, 304, 304, - 470, 304,32767, 102, 304, 210, 100, 100, 304,32767, - 32767,32767, 481,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767, 511,32767, 528, - 541, 417, 418, 420, 526, 442, 443, 444, 445, 446, - 447, 448, 450, 573,32767, 485,32767,32767,32767,32767, - 324, 583,32767, 583,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767, 584,32767, 524,32767,32767,32767,32767, 416, 9, - 76, 43, 44, 52, 58, 502, 503, 504, 505, 499, - 500, 506, 501,32767,32767, 507, 549,32767,32767, 525, - 576,32767,32767,32767,32767,32767,32767, 139,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767, 511,32767, - 137,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767, 524,32767,32767,32767, 300, 301,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767, 524,32767,32767,32767, 283, 284,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767, 278,32767,32767, 366,32767,32767,32767, - 32767, 345,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767, 152, 152, 3, 3, 327, 152, 152, 152, - 327, 152, 327, 327, 327, 152, 152, 152, 152, 152, - 152, 272, 184, 254, 257, 239, 239, 152, 337, 152 - ); - - protected $goto = array( - 194, 194, 670, 422, 643, 463, 1264, 1265, 1022, 416, - 308, 309, 329, 563, 314, 421, 330, 423, 622, 801, - 678, 637, 586, 651, 652, 653, 165, 165, 165, 165, - 218, 195, 191, 191, 175, 177, 213, 191, 191, 191, - 191, 191, 192, 192, 192, 192, 192, 192, 186, 187, - 188, 189, 190, 215, 213, 216, 521, 522, 412, 523, - 525, 526, 527, 528, 529, 530, 531, 532, 1091, 166, - 167, 168, 193, 169, 170, 171, 164, 172, 173, 174, - 176, 212, 214, 217, 235, 238, 241, 242, 244, 255, - 256, 257, 258, 259, 260, 261, 263, 264, 265, 266, - 274, 275, 311, 312, 313, 417, 418, 419, 568, 219, - 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 178, 234, 179, 196, 197, 198, - 236, 186, 187, 188, 189, 190, 215, 1091, 199, 180, - 181, 182, 200, 196, 183, 237, 201, 199, 163, 202, - 203, 184, 204, 205, 206, 185, 207, 208, 209, 210, - 211, 323, 323, 323, 323, 827, 608, 608, 824, 547, - 538, 342, 1221, 1221, 1221, 1221, 1221, 1221, 1221, 1221, - 1221, 1221, 1239, 1239, 288, 288, 288, 288, 1239, 1239, - 1239, 1239, 1239, 1239, 1239, 1239, 1239, 1239, 388, 538, - 547, 556, 557, 395, 566, 588, 602, 603, 832, 825, - 880, 875, 876, 889, 15, 833, 877, 830, 878, 879, - 831, 799, 251, 251, 883, 919, 992, 1000, 1004, 1001, - 1005, 1237, 1237, 938, 1043, 1039, 1040, 1237, 1237, 1237, - 1237, 1237, 1237, 1237, 1237, 1237, 1237, 858, 248, 248, - 248, 248, 250, 252, 533, 533, 533, 533, 487, 590, - 488, 1190, 1190, 997, 1190, 997, 494, 1290, 1290, 560, - 997, 997, 997, 997, 997, 997, 997, 997, 997, 997, - 997, 997, 1261, 1261, 1290, 1261, 340, 1190, 930, 402, - 677, 1279, 1190, 1190, 1190, 1190, 959, 345, 1190, 1190, - 1190, 1271, 1271, 1271, 1271, 606, 640, 345, 345, 1273, - 1273, 1273, 1273, 820, 820, 805, 896, 884, 840, 885, - 897, 345, 345, 5, 345, 6, 1306, 384, 535, 535, - 559, 535, 415, 852, 597, 1257, 839, 540, 524, 524, - 345, 1289, 1289, 642, 524, 524, 524, 524, 524, 524, - 524, 524, 524, 524, 445, 805, 1140, 805, 1289, 932, - 932, 932, 932, 1063, 1064, 445, 926, 933, 386, 390, - 548, 587, 591, 1030, 1292, 331, 554, 1259, 1259, 1030, - 704, 621, 623, 823, 641, 1250, 319, 303, 660, 664, - 973, 668, 676, 969, 429, 553, 962, 936, 936, 934, - 936, 703, 601, 537, 971, 966, 343, 344, 663, 817, - 595, 609, 612, 613, 614, 615, 634, 635, 636, 680, - 439, 1186, 845, 454, 454, 439, 439, 1266, 1267, 820, - 901, 1079, 454, 394, 539, 551, 1183, 605, 540, 539, - 842, 551, 978, 272, 387, 618, 619, 981, 536, 536, - 844, 707, 646, 957, 567, 457, 458, 459, 838, 850, - 254, 254, 1297, 1298, 400, 401, 976, 976, 464, 649, - 1182, 650, 1028, 404, 405, 406, 1187, 661, 424, 1032, - 407, 564, 600, 815, 338, 424, 854, 848, 853, 841, - 1027, 1031, 1009, 1002, 1006, 1003, 1007, 1185, 941, 1188, - 1247, 1248, 943, 0, 1074, 439, 439, 439, 439, 439, - 439, 439, 439, 439, 439, 439, 0, 468, 439, 585, - 1056, 931, 681, 667, 667, 0, 495, 673, 1054, 1171, - 912, 0, 0, 1172, 1175, 913, 1176, 0, 0, 0, - 0, 0, 0, 1072, 857 - ); - - protected $gotoCheck = array( - 42, 42, 72, 65, 65, 166, 166, 166, 119, 65, - 65, 65, 65, 65, 65, 65, 65, 65, 65, 7, - 9, 84, 122, 84, 84, 84, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 23, 23, 23, 23, 15, 104, 104, 26, 75, - 75, 93, 104, 104, 104, 104, 104, 104, 104, 104, - 104, 104, 160, 160, 24, 24, 24, 24, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 75, 75, - 75, 75, 75, 75, 75, 75, 75, 75, 15, 27, - 15, 15, 15, 15, 75, 15, 15, 15, 15, 15, - 15, 6, 5, 5, 15, 87, 87, 87, 87, 87, - 87, 161, 161, 49, 15, 15, 15, 161, 161, 161, - 161, 161, 161, 161, 161, 161, 161, 45, 5, 5, - 5, 5, 5, 5, 103, 103, 103, 103, 147, 103, - 147, 72, 72, 72, 72, 72, 147, 173, 173, 162, - 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, - 72, 72, 122, 122, 173, 122, 169, 72, 89, 89, - 89, 171, 72, 72, 72, 72, 99, 14, 72, 72, - 72, 9, 9, 9, 9, 55, 55, 14, 14, 122, - 122, 122, 122, 22, 22, 12, 72, 64, 35, 64, - 72, 14, 14, 46, 14, 46, 14, 61, 19, 19, - 100, 19, 13, 35, 13, 122, 35, 14, 163, 163, - 14, 172, 172, 63, 163, 163, 163, 163, 163, 163, - 163, 163, 163, 163, 19, 12, 143, 12, 172, 19, - 19, 19, 19, 136, 136, 19, 19, 19, 58, 58, - 58, 58, 58, 122, 172, 29, 48, 122, 122, 122, - 48, 48, 48, 25, 48, 14, 159, 159, 48, 48, - 48, 48, 48, 48, 109, 9, 25, 25, 25, 25, - 25, 25, 9, 25, 25, 25, 93, 93, 14, 18, - 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, - 23, 20, 39, 141, 141, 23, 23, 168, 168, 22, - 17, 17, 141, 28, 9, 9, 152, 17, 14, 9, - 37, 9, 17, 24, 9, 83, 83, 106, 24, 24, - 17, 95, 17, 17, 9, 9, 9, 9, 17, 9, - 5, 5, 9, 9, 80, 80, 103, 103, 149, 80, - 17, 80, 121, 80, 80, 80, 20, 80, 113, 124, - 80, 2, 2, 20, 80, 113, 41, 9, 16, 16, - 16, 16, 113, 113, 113, 113, 113, 14, 16, 20, - 20, 20, 92, -1, 139, 23, 23, 23, 23, 23, - 23, 23, 23, 23, 23, 23, -1, 82, 23, 8, - 8, 16, 8, 8, 8, -1, 8, 8, 8, 78, - 78, -1, -1, 78, 78, 78, 78, -1, -1, -1, - -1, -1, -1, 16, 16 - ); - - protected $gotoBase = array( - 0, 0, -203, 0, 0, 221, 208, 10, 512, 7, - 0, 0, 24, 1, 5, -174, 47, -23, 105, 61, - 38, 0, -10, 158, 181, 379, 164, 205, 102, 84, - 0, 0, 0, 0, 0, -43, 0, 107, 0, 104, - 0, 54, -1, 0, 0, 235, -384, 0, -307, 210, - 0, 0, 0, 0, 0, 266, 0, 0, 324, 0, - 0, 286, 0, 103, 298, -236, 0, 0, 0, 0, - 0, 0, -6, 0, 0, -167, 0, 0, 129, 62, - -14, 0, 53, -22, -669, 0, 0, -52, 0, -11, - 0, 0, 68, -299, 0, 52, 0, 0, 0, 262, - 288, 0, 0, 227, -73, 0, 87, 0, 0, 118, - 0, 0, 0, 209, 0, 0, 0, 0, 0, 6, - 0, 108, 15, 0, 46, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 91, 0, 0, 69, - 0, 390, 0, 86, 0, 0, 0, -224, 0, 37, - 0, 0, 77, 0, 0, 0, 0, 0, 0, 70, - -57, -8, 241, 99, 0, 0, -290, 0, 65, 257, - 0, 261, 39, -35, 0, 0 - ); - - protected $gotoDefault = array( - -32768, 499, 711, 4, 712, 905, 788, 797, 583, 515, - 679, 339, 610, 413, 1255, 882, 1078, 565, 816, 1199, - 1207, 446, 819, 324, 701, 864, 865, 866, 391, 376, - 382, 389, 632, 611, 481, 851, 442, 843, 473, 846, - 441, 855, 162, 410, 497, 859, 3, 861, 542, 892, - 377, 869, 378, 656, 871, 550, 873, 874, 385, 392, - 393, 1083, 558, 607, 886, 243, 552, 887, 375, 888, - 895, 380, 383, 665, 453, 492, 486, 403, 1058, 594, - 629, 450, 467, 617, 616, 604, 466, 425, 408, 928, - 474, 451, 942, 341, 950, 709, 1090, 624, 476, 958, - 625, 965, 968, 516, 517, 465, 980, 269, 983, 477, - 1015, 647, 648, 995, 626, 627, 1013, 460, 584, 1021, - 443, 1029, 1243, 444, 1033, 262, 1036, 276, 409, 426, - 1041, 1042, 8, 1048, 671, 672, 10, 273, 496, 1073, - 666, 440, 1089, 430, 1159, 1161, 544, 478, 1179, 1178, - 659, 493, 1184, 1246, 438, 518, 461, 310, 519, 302, - 327, 307, 534, 289, 328, 520, 462, 1252, 1260, 325, - 30, 1280, 1291, 335, 562, 599 - ); - - protected $ruleToNonTerminal = array( - 0, 1, 3, 3, 2, 5, 5, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, - 7, 7, 7, 7, 7, 7, 8, 8, 9, 10, - 11, 11, 11, 12, 12, 13, 13, 14, 15, 15, - 16, 16, 17, 17, 18, 18, 21, 21, 22, 23, - 23, 24, 24, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 29, 29, 30, 30, 32, 34, - 34, 28, 36, 36, 33, 38, 38, 35, 35, 37, - 37, 39, 39, 31, 40, 40, 41, 43, 44, 44, - 45, 46, 46, 48, 47, 47, 47, 47, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 25, 25, 68, 68, 71, 71, 70, 69, - 69, 62, 74, 74, 75, 75, 76, 76, 77, 77, - 78, 78, 26, 26, 27, 27, 27, 27, 86, 86, - 88, 88, 81, 81, 81, 82, 82, 85, 85, 83, - 83, 89, 90, 90, 56, 56, 64, 64, 67, 67, - 67, 66, 91, 91, 92, 57, 57, 57, 57, 93, - 93, 94, 94, 95, 95, 96, 97, 97, 98, 98, - 99, 99, 54, 54, 50, 50, 101, 52, 52, 102, - 51, 51, 53, 53, 63, 63, 63, 63, 79, 79, - 105, 105, 107, 107, 108, 108, 108, 108, 106, 106, - 106, 110, 110, 110, 110, 87, 87, 113, 113, 113, - 111, 111, 114, 114, 112, 112, 115, 115, 116, 116, - 116, 116, 109, 109, 80, 80, 80, 20, 20, 20, - 118, 117, 117, 119, 119, 119, 119, 59, 120, 120, - 121, 60, 123, 123, 124, 124, 125, 125, 84, 126, - 126, 126, 126, 126, 126, 131, 131, 132, 132, 133, - 133, 133, 133, 133, 134, 135, 135, 130, 130, 127, - 127, 129, 129, 137, 137, 136, 136, 136, 136, 136, - 136, 136, 128, 138, 138, 140, 139, 139, 61, 100, - 141, 141, 55, 55, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 148, 142, 142, - 147, 147, 150, 151, 151, 152, 153, 153, 153, 19, - 19, 72, 72, 72, 72, 143, 143, 143, 143, 155, - 155, 144, 144, 146, 146, 146, 149, 149, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 161, 161, 104, - 163, 163, 163, 163, 145, 145, 145, 145, 145, 145, - 145, 145, 58, 58, 158, 158, 158, 158, 164, 164, - 154, 154, 154, 165, 165, 165, 165, 165, 165, 73, - 73, 65, 65, 65, 65, 122, 122, 122, 122, 168, - 167, 157, 157, 157, 157, 157, 157, 157, 156, 156, - 156, 166, 166, 166, 166, 103, 162, 170, 170, 169, - 169, 171, 171, 171, 171, 171, 171, 171, 171, 159, - 159, 159, 159, 173, 174, 172, 172, 172, 172, 172, - 172, 172, 172, 175, 175, 175, 175 - ); - - protected $ruleToLength = array( - 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 0, 1, 0, 1, 1, 2, 1, 3, 4, 1, - 2, 0, 1, 1, 1, 1, 1, 3, 5, 4, - 3, 4, 2, 3, 1, 1, 7, 6, 2, 3, - 1, 2, 3, 1, 2, 3, 1, 1, 3, 1, - 3, 1, 2, 2, 3, 1, 3, 2, 3, 1, - 3, 2, 0, 1, 1, 1, 1, 1, 3, 7, - 10, 5, 7, 9, 5, 3, 3, 3, 3, 3, - 3, 1, 2, 5, 7, 9, 6, 5, 6, 3, - 2, 1, 1, 1, 0, 2, 1, 3, 8, 0, - 4, 2, 1, 3, 0, 1, 0, 1, 0, 1, - 3, 1, 8, 9, 8, 7, 6, 8, 0, 2, - 0, 2, 1, 2, 2, 0, 2, 0, 2, 0, - 2, 2, 1, 3, 1, 4, 1, 4, 1, 1, - 4, 2, 1, 3, 3, 3, 4, 4, 5, 0, - 2, 4, 3, 1, 1, 7, 0, 2, 1, 3, - 3, 4, 1, 4, 0, 2, 5, 0, 2, 6, - 0, 2, 0, 3, 1, 2, 1, 1, 2, 0, - 1, 3, 0, 2, 1, 1, 1, 1, 6, 8, - 6, 1, 2, 1, 1, 1, 1, 1, 1, 1, - 3, 3, 3, 3, 3, 3, 3, 3, 1, 2, - 1, 1, 0, 1, 0, 2, 2, 2, 4, 3, - 1, 1, 3, 1, 2, 2, 3, 2, 3, 1, - 1, 2, 3, 1, 1, 3, 2, 0, 1, 5, - 5, 10, 3, 5, 1, 1, 3, 0, 2, 4, - 5, 4, 4, 4, 3, 1, 1, 1, 1, 1, - 1, 0, 1, 1, 2, 1, 1, 1, 1, 1, - 1, 1, 2, 1, 3, 1, 1, 3, 2, 2, - 3, 1, 0, 1, 1, 3, 3, 3, 4, 1, - 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 2, 2, 2, 2, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, - 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 5, 4, 3, 4, 4, 2, 2, 4, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 1, 3, 2, 1, 2, 4, 2, 2, 8, - 9, 8, 9, 9, 10, 9, 10, 8, 3, 2, - 0, 4, 2, 1, 3, 2, 2, 2, 4, 1, - 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, - 1, 0, 3, 0, 1, 1, 0, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, - 4, 1, 1, 3, 1, 1, 1, 1, 1, 3, - 2, 3, 0, 1, 1, 3, 1, 1, 1, 1, - 1, 3, 1, 1, 4, 4, 1, 4, 4, 0, - 1, 1, 1, 3, 3, 1, 4, 2, 2, 1, - 3, 1, 4, 4, 3, 3, 3, 3, 1, 3, - 1, 1, 3, 1, 1, 4, 1, 1, 1, 3, - 1, 1, 2, 1, 3, 4, 3, 2, 0, 2, - 2, 1, 2, 1, 1, 1, 4, 3, 3, 3, - 3, 6, 3, 1, 1, 2, 1 - ); - - protected function initReduceCallbacks() { - $this->reduceCallbacks = [ - 0 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 1 => function ($stackPos) { - $this->semValue = $this->handleNamespaces($this->semStack[$stackPos-(1-1)]); - }, - 2 => function ($stackPos) { - if (is_array($this->semStack[$stackPos-(2-2)])) { $this->semValue = array_merge($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)]); } else { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }; - }, - 3 => function ($stackPos) { - $this->semValue = array(); - }, - 4 => function ($stackPos) { - $startAttributes = $this->lookaheadStartAttributes; if (isset($startAttributes['comments'])) { $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments'])); } else { $nop = null; }; - if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 5 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 6 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 7 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 8 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 9 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 10 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 11 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 12 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 13 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 14 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 15 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 16 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 17 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 18 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 19 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 20 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 21 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 22 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 23 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 24 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 25 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 26 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 27 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 28 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 29 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 30 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 31 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 32 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 33 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 34 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 35 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 36 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 37 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 38 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 39 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 40 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 41 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 42 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 43 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 44 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 45 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 46 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 47 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 48 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 49 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 50 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 51 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 52 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 53 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 54 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 55 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 56 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 57 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 58 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 59 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 60 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 61 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 62 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 63 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 64 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 65 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 66 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 67 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 68 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 69 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 70 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 71 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 72 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 73 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 74 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 75 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 76 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 77 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 78 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 79 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 80 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 81 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 82 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 83 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 84 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 85 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 86 => function ($stackPos) { - $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 87 => function ($stackPos) { - $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 88 => function ($stackPos) { - $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 89 => function ($stackPos) { - $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 90 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 91 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 92 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 93 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 94 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 95 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 96 => function ($stackPos) { - $this->semValue = new Name(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 97 => function ($stackPos) { - $this->semValue = new Expr\Variable(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 98 => function ($stackPos) { - /* nothing */ - }, - 99 => function ($stackPos) { - /* nothing */ - }, - 100 => function ($stackPos) { - /* nothing */ - }, - 101 => function ($stackPos) { - $this->emitError(new Error('A trailing comma is not allowed here', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes)); - }, - 102 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 103 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 104 => function ($stackPos) { - $this->semValue = new Node\Attribute($this->semStack[$stackPos-(1-1)], [], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 105 => function ($stackPos) { - $this->semValue = new Node\Attribute($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 106 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 107 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 108 => function ($stackPos) { - $this->semValue = new Node\AttributeGroup($this->semStack[$stackPos-(4-2)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 109 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 110 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 111 => function ($stackPos) { - $this->semValue = []; - }, - 112 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 113 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 114 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 115 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 116 => function ($stackPos) { - $this->semValue = new Stmt\HaltCompiler($this->lexer->handleHaltCompiler(), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 117 => function ($stackPos) { - $this->semValue = new Stmt\Namespace_($this->semStack[$stackPos-(3-2)], null, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_SEMICOLON); - $this->checkNamespace($this->semValue); - }, - 118 => function ($stackPos) { - $this->semValue = new Stmt\Namespace_($this->semStack[$stackPos-(5-2)], $this->semStack[$stackPos-(5-4)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_BRACED); - $this->checkNamespace($this->semValue); - }, - 119 => function ($stackPos) { - $this->semValue = new Stmt\Namespace_(null, $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_BRACED); - $this->checkNamespace($this->semValue); - }, - 120 => function ($stackPos) { - $this->semValue = new Stmt\Use_($this->semStack[$stackPos-(3-2)], Stmt\Use_::TYPE_NORMAL, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 121 => function ($stackPos) { - $this->semValue = new Stmt\Use_($this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-2)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 122 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 123 => function ($stackPos) { - $this->semValue = new Stmt\Const_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 124 => function ($stackPos) { - $this->semValue = Stmt\Use_::TYPE_FUNCTION; - }, - 125 => function ($stackPos) { - $this->semValue = Stmt\Use_::TYPE_CONSTANT; - }, - 126 => function ($stackPos) { - $this->semValue = new Stmt\GroupUse($this->semStack[$stackPos-(7-3)], $this->semStack[$stackPos-(7-6)], $this->semStack[$stackPos-(7-2)], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); - }, - 127 => function ($stackPos) { - $this->semValue = new Stmt\GroupUse($this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-5)], Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); - }, - 128 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 129 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 130 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 131 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 132 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 133 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 134 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 135 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 136 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 137 => function ($stackPos) { - $this->semValue = new Stmt\UseUse($this->semStack[$stackPos-(1-1)], null, Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->checkUseUse($this->semValue, $stackPos-(1-1)); - }, - 138 => function ($stackPos) { - $this->semValue = new Stmt\UseUse($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); $this->checkUseUse($this->semValue, $stackPos-(3-3)); - }, - 139 => function ($stackPos) { - $this->semValue = new Stmt\UseUse($this->semStack[$stackPos-(1-1)], null, Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->checkUseUse($this->semValue, $stackPos-(1-1)); - }, - 140 => function ($stackPos) { - $this->semValue = new Stmt\UseUse($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); $this->checkUseUse($this->semValue, $stackPos-(3-3)); - }, - 141 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; $this->semValue->type = Stmt\Use_::TYPE_NORMAL; - }, - 142 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; $this->semValue->type = $this->semStack[$stackPos-(2-1)]; - }, - 143 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 144 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 145 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 146 => function ($stackPos) { - $this->semValue = new Node\Const_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 147 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 148 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 149 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 150 => function ($stackPos) { - $this->semValue = new Node\Const_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 151 => function ($stackPos) { - if (is_array($this->semStack[$stackPos-(2-2)])) { $this->semValue = array_merge($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)]); } else { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }; - }, - 152 => function ($stackPos) { - $this->semValue = array(); - }, - 153 => function ($stackPos) { - $startAttributes = $this->lookaheadStartAttributes; if (isset($startAttributes['comments'])) { $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments'])); } else { $nop = null; }; - if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 154 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 155 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 156 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 157 => function ($stackPos) { - throw new Error('__HALT_COMPILER() can only be used from the outermost scope', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 158 => function ($stackPos) { - - if ($this->semStack[$stackPos-(3-2)]) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; $attrs = $this->startAttributeStack[$stackPos-(3-1)]; $stmts = $this->semValue; if (!empty($attrs['comments'])) {$stmts[0]->setAttribute('comments', array_merge($attrs['comments'], $stmts[0]->getAttribute('comments', []))); }; - } else { - $startAttributes = $this->startAttributeStack[$stackPos-(3-1)]; if (isset($startAttributes['comments'])) { $this->semValue = new Stmt\Nop($startAttributes + $this->endAttributes); } else { $this->semValue = null; }; - if (null === $this->semValue) { $this->semValue = array(); } - } - - }, - 159 => function ($stackPos) { - $this->semValue = new Stmt\If_($this->semStack[$stackPos-(7-3)], ['stmts' => is_array($this->semStack[$stackPos-(7-5)]) ? $this->semStack[$stackPos-(7-5)] : array($this->semStack[$stackPos-(7-5)]), 'elseifs' => $this->semStack[$stackPos-(7-6)], 'else' => $this->semStack[$stackPos-(7-7)]], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); - }, - 160 => function ($stackPos) { - $this->semValue = new Stmt\If_($this->semStack[$stackPos-(10-3)], ['stmts' => $this->semStack[$stackPos-(10-6)], 'elseifs' => $this->semStack[$stackPos-(10-7)], 'else' => $this->semStack[$stackPos-(10-8)]], $this->startAttributeStack[$stackPos-(10-1)] + $this->endAttributes); - }, - 161 => function ($stackPos) { - $this->semValue = new Stmt\While_($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - }, - 162 => function ($stackPos) { - $this->semValue = new Stmt\Do_($this->semStack[$stackPos-(7-5)], is_array($this->semStack[$stackPos-(7-2)]) ? $this->semStack[$stackPos-(7-2)] : array($this->semStack[$stackPos-(7-2)]), $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); - }, - 163 => function ($stackPos) { - $this->semValue = new Stmt\For_(['init' => $this->semStack[$stackPos-(9-3)], 'cond' => $this->semStack[$stackPos-(9-5)], 'loop' => $this->semStack[$stackPos-(9-7)], 'stmts' => $this->semStack[$stackPos-(9-9)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); - }, - 164 => function ($stackPos) { - $this->semValue = new Stmt\Switch_($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - }, - 165 => function ($stackPos) { - $this->semValue = new Stmt\Break_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 166 => function ($stackPos) { - $this->semValue = new Stmt\Continue_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 167 => function ($stackPos) { - $this->semValue = new Stmt\Return_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 168 => function ($stackPos) { - $this->semValue = new Stmt\Global_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 169 => function ($stackPos) { - $this->semValue = new Stmt\Static_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 170 => function ($stackPos) { - $this->semValue = new Stmt\Echo_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 171 => function ($stackPos) { - $this->semValue = new Stmt\InlineHTML($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 172 => function ($stackPos) { - - $e = $this->semStack[$stackPos-(2-1)]; - if ($e instanceof Expr\Throw_) { - // For backwards-compatibility reasons, convert throw in statement position into - // Stmt\Throw_ rather than Stmt\Expression(Expr\Throw_). - $this->semValue = new Stmt\Throw_($e->expr, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - } else { - $this->semValue = new Stmt\Expression($e, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - } - - }, - 173 => function ($stackPos) { - $this->semValue = new Stmt\Unset_($this->semStack[$stackPos-(5-3)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - }, - 174 => function ($stackPos) { - $this->semValue = new Stmt\Foreach_($this->semStack[$stackPos-(7-3)], $this->semStack[$stackPos-(7-5)][0], ['keyVar' => null, 'byRef' => $this->semStack[$stackPos-(7-5)][1], 'stmts' => $this->semStack[$stackPos-(7-7)]], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); - }, - 175 => function ($stackPos) { - $this->semValue = new Stmt\Foreach_($this->semStack[$stackPos-(9-3)], $this->semStack[$stackPos-(9-7)][0], ['keyVar' => $this->semStack[$stackPos-(9-5)], 'byRef' => $this->semStack[$stackPos-(9-7)][1], 'stmts' => $this->semStack[$stackPos-(9-9)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); - }, - 176 => function ($stackPos) { - $this->semValue = new Stmt\Foreach_($this->semStack[$stackPos-(6-3)], new Expr\Error($this->startAttributeStack[$stackPos-(6-4)] + $this->endAttributeStack[$stackPos-(6-4)]), ['stmts' => $this->semStack[$stackPos-(6-6)]], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); - }, - 177 => function ($stackPos) { - $this->semValue = new Stmt\Declare_($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - }, - 178 => function ($stackPos) { - $this->semValue = new Stmt\TryCatch($this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-5)], $this->semStack[$stackPos-(6-6)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); $this->checkTryCatch($this->semValue); - }, - 179 => function ($stackPos) { - $this->semValue = new Stmt\Goto_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 180 => function ($stackPos) { - $this->semValue = new Stmt\Label($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 181 => function ($stackPos) { - $this->semValue = array(); /* means: no statement */ - }, - 182 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 183 => function ($stackPos) { - $startAttributes = $this->startAttributeStack[$stackPos-(1-1)]; if (isset($startAttributes['comments'])) { $this->semValue = new Stmt\Nop($startAttributes + $this->endAttributes); } else { $this->semValue = null; }; - if ($this->semValue === null) $this->semValue = array(); /* means: no statement */ - }, - 184 => function ($stackPos) { - $this->semValue = array(); - }, - 185 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 186 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 187 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 188 => function ($stackPos) { - $this->semValue = new Stmt\Catch_($this->semStack[$stackPos-(8-3)], $this->semStack[$stackPos-(8-4)], $this->semStack[$stackPos-(8-7)], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); - }, - 189 => function ($stackPos) { - $this->semValue = null; - }, - 190 => function ($stackPos) { - $this->semValue = new Stmt\Finally_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 191 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 192 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 193 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 194 => function ($stackPos) { - $this->semValue = false; - }, - 195 => function ($stackPos) { - $this->semValue = true; - }, - 196 => function ($stackPos) { - $this->semValue = false; - }, - 197 => function ($stackPos) { - $this->semValue = true; - }, - 198 => function ($stackPos) { - $this->semValue = false; - }, - 199 => function ($stackPos) { - $this->semValue = true; - }, - 200 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 201 => function ($stackPos) { - $this->semValue = []; - }, - 202 => function ($stackPos) { - $this->semValue = new Stmt\Function_($this->semStack[$stackPos-(8-3)], ['byRef' => $this->semStack[$stackPos-(8-2)], 'params' => $this->semStack[$stackPos-(8-5)], 'returnType' => $this->semStack[$stackPos-(8-7)], 'stmts' => $this->semStack[$stackPos-(8-8)], 'attrGroups' => []], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); - }, - 203 => function ($stackPos) { - $this->semValue = new Stmt\Function_($this->semStack[$stackPos-(9-4)], ['byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-6)], 'returnType' => $this->semStack[$stackPos-(9-8)], 'stmts' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => $this->semStack[$stackPos-(9-1)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); - }, - 204 => function ($stackPos) { - $this->semValue = new Stmt\Class_($this->semStack[$stackPos-(8-3)], ['type' => $this->semStack[$stackPos-(8-2)], 'extends' => $this->semStack[$stackPos-(8-4)], 'implements' => $this->semStack[$stackPos-(8-5)], 'stmts' => $this->semStack[$stackPos-(8-7)], 'attrGroups' => $this->semStack[$stackPos-(8-1)]], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); - $this->checkClass($this->semValue, $stackPos-(8-3)); - }, - 205 => function ($stackPos) { - $this->semValue = new Stmt\Interface_($this->semStack[$stackPos-(7-3)], ['extends' => $this->semStack[$stackPos-(7-4)], 'stmts' => $this->semStack[$stackPos-(7-6)], 'attrGroups' => $this->semStack[$stackPos-(7-1)]], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); - $this->checkInterface($this->semValue, $stackPos-(7-3)); - }, - 206 => function ($stackPos) { - $this->semValue = new Stmt\Trait_($this->semStack[$stackPos-(6-3)], ['stmts' => $this->semStack[$stackPos-(6-5)], 'attrGroups' => $this->semStack[$stackPos-(6-1)]], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); - }, - 207 => function ($stackPos) { - $this->semValue = new Stmt\Enum_($this->semStack[$stackPos-(8-3)], ['scalarType' => $this->semStack[$stackPos-(8-4)], 'implements' => $this->semStack[$stackPos-(8-5)], 'stmts' => $this->semStack[$stackPos-(8-7)], 'attrGroups' => $this->semStack[$stackPos-(8-1)]], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); - $this->checkEnum($this->semValue, $stackPos-(8-3)); - }, - 208 => function ($stackPos) { - $this->semValue = null; - }, - 209 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; - }, - 210 => function ($stackPos) { - $this->semValue = null; - }, - 211 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; - }, - 212 => function ($stackPos) { - $this->semValue = 0; - }, - 213 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_ABSTRACT; - }, - 214 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_FINAL; - }, - 215 => function ($stackPos) { - $this->semValue = null; - }, - 216 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; - }, - 217 => function ($stackPos) { - $this->semValue = array(); - }, - 218 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; - }, - 219 => function ($stackPos) { - $this->semValue = array(); - }, - 220 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; - }, - 221 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 222 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 223 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 224 => function ($stackPos) { - $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); - }, - 225 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; - }, - 226 => function ($stackPos) { - $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); - }, - 227 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; - }, - 228 => function ($stackPos) { - $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); - }, - 229 => function ($stackPos) { - $this->semValue = null; - }, - 230 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; - }, - 231 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 232 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 233 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 234 => function ($stackPos) { - $this->semValue = new Stmt\DeclareDeclare($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 235 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 236 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-3)]; - }, - 237 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; - }, - 238 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(5-3)]; - }, - 239 => function ($stackPos) { - $this->semValue = array(); - }, - 240 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 241 => function ($stackPos) { - $this->semValue = new Stmt\Case_($this->semStack[$stackPos-(4-2)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 242 => function ($stackPos) { - $this->semValue = new Stmt\Case_(null, $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 243 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 244 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 245 => function ($stackPos) { - $this->semValue = new Expr\Match_($this->semStack[$stackPos-(7-3)], $this->semStack[$stackPos-(7-6)], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); - }, - 246 => function ($stackPos) { - $this->semValue = []; - }, - 247 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 248 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 249 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 250 => function ($stackPos) { - $this->semValue = new Node\MatchArm($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 251 => function ($stackPos) { - $this->semValue = new Node\MatchArm(null, $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 252 => function ($stackPos) { - $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); - }, - 253 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; - }, - 254 => function ($stackPos) { - $this->semValue = array(); - }, - 255 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 256 => function ($stackPos) { - $this->semValue = new Stmt\ElseIf_($this->semStack[$stackPos-(5-3)], is_array($this->semStack[$stackPos-(5-5)]) ? $this->semStack[$stackPos-(5-5)] : array($this->semStack[$stackPos-(5-5)]), $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - }, - 257 => function ($stackPos) { - $this->semValue = array(); - }, - 258 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 259 => function ($stackPos) { - $this->semValue = new Stmt\ElseIf_($this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-6)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); - }, - 260 => function ($stackPos) { - $this->semValue = null; - }, - 261 => function ($stackPos) { - $this->semValue = new Stmt\Else_(is_array($this->semStack[$stackPos-(2-2)]) ? $this->semStack[$stackPos-(2-2)] : array($this->semStack[$stackPos-(2-2)]), $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 262 => function ($stackPos) { - $this->semValue = null; - }, - 263 => function ($stackPos) { - $this->semValue = new Stmt\Else_($this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 264 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)], false); - }, - 265 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(2-2)], true); - }, - 266 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)], false); - }, - 267 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)], false); - }, - 268 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 269 => function ($stackPos) { - $this->semValue = array(); - }, - 270 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 271 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 272 => function ($stackPos) { - $this->semValue = 0; - }, - 273 => function ($stackPos) { - $this->checkModifier($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $this->semValue = $this->semStack[$stackPos-(2-1)] | $this->semStack[$stackPos-(2-2)]; - }, - 274 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_PUBLIC; - }, - 275 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_PROTECTED; - }, - 276 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_PRIVATE; - }, - 277 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_READONLY; - }, - 278 => function ($stackPos) { - $this->semValue = new Node\Param($this->semStack[$stackPos-(6-6)], null, $this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-4)], $this->semStack[$stackPos-(6-5)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes, $this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-1)]); - $this->checkParam($this->semValue); - }, - 279 => function ($stackPos) { - $this->semValue = new Node\Param($this->semStack[$stackPos-(8-6)], $this->semStack[$stackPos-(8-8)], $this->semStack[$stackPos-(8-3)], $this->semStack[$stackPos-(8-4)], $this->semStack[$stackPos-(8-5)], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes, $this->semStack[$stackPos-(8-2)], $this->semStack[$stackPos-(8-1)]); - $this->checkParam($this->semValue); - }, - 280 => function ($stackPos) { - $this->semValue = new Node\Param(new Expr\Error($this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes), null, $this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-4)], $this->semStack[$stackPos-(6-5)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes, $this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-1)]); - }, - 281 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 282 => function ($stackPos) { - $this->semValue = new Node\NullableType($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 283 => function ($stackPos) { - $this->semValue = new Node\UnionType($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 284 => function ($stackPos) { - $this->semValue = new Node\IntersectionType($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 285 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 286 => function ($stackPos) { - $this->semValue = new Node\Name('static', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 287 => function ($stackPos) { - $this->semValue = $this->handleBuiltinTypes($this->semStack[$stackPos-(1-1)]); - }, - 288 => function ($stackPos) { - $this->semValue = new Node\Identifier('array', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 289 => function ($stackPos) { - $this->semValue = new Node\Identifier('callable', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 290 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); - }, - 291 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 292 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); - }, - 293 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 294 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); - }, - 295 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 296 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); - }, - 297 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 298 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 299 => function ($stackPos) { - $this->semValue = new Node\NullableType($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 300 => function ($stackPos) { - $this->semValue = new Node\UnionType($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 301 => function ($stackPos) { - $this->semValue = new Node\IntersectionType($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 302 => function ($stackPos) { - $this->semValue = null; - }, - 303 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 304 => function ($stackPos) { - $this->semValue = null; - }, - 305 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; - }, - 306 => function ($stackPos) { - $this->semValue = null; - }, - 307 => function ($stackPos) { - $this->semValue = array(); - }, - 308 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; - }, - 309 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(3-2)]); - }, - 310 => function ($stackPos) { - $this->semValue = new Node\VariadicPlaceholder($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 311 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 312 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 313 => function ($stackPos) { - $this->semValue = new Node\Arg($this->semStack[$stackPos-(1-1)], false, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 314 => function ($stackPos) { - $this->semValue = new Node\Arg($this->semStack[$stackPos-(2-2)], true, false, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 315 => function ($stackPos) { - $this->semValue = new Node\Arg($this->semStack[$stackPos-(2-2)], false, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 316 => function ($stackPos) { - $this->semValue = new Node\Arg($this->semStack[$stackPos-(3-3)], false, false, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes, $this->semStack[$stackPos-(3-1)]); - }, - 317 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 318 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 319 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 320 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 321 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 322 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 323 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 324 => function ($stackPos) { - $this->semValue = new Stmt\StaticVar($this->semStack[$stackPos-(1-1)], null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 325 => function ($stackPos) { - $this->semValue = new Stmt\StaticVar($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 326 => function ($stackPos) { - if ($this->semStack[$stackPos-(2-2)] !== null) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; } - }, - 327 => function ($stackPos) { - $this->semValue = array(); - }, - 328 => function ($stackPos) { - $startAttributes = $this->lookaheadStartAttributes; if (isset($startAttributes['comments'])) { $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments'])); } else { $nop = null; }; - if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 329 => function ($stackPos) { - $this->semValue = new Stmt\Property($this->semStack[$stackPos-(5-2)], $this->semStack[$stackPos-(5-4)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes, $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-1)]); - $this->checkProperty($this->semValue, $stackPos-(5-2)); - }, - 330 => function ($stackPos) { - $this->semValue = new Stmt\ClassConst($this->semStack[$stackPos-(5-4)], $this->semStack[$stackPos-(5-2)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes, $this->semStack[$stackPos-(5-1)]); - $this->checkClassConst($this->semValue, $stackPos-(5-2)); - }, - 331 => function ($stackPos) { - $this->semValue = new Stmt\ClassMethod($this->semStack[$stackPos-(10-5)], ['type' => $this->semStack[$stackPos-(10-2)], 'byRef' => $this->semStack[$stackPos-(10-4)], 'params' => $this->semStack[$stackPos-(10-7)], 'returnType' => $this->semStack[$stackPos-(10-9)], 'stmts' => $this->semStack[$stackPos-(10-10)], 'attrGroups' => $this->semStack[$stackPos-(10-1)]], $this->startAttributeStack[$stackPos-(10-1)] + $this->endAttributes); - $this->checkClassMethod($this->semValue, $stackPos-(10-2)); - }, - 332 => function ($stackPos) { - $this->semValue = new Stmt\TraitUse($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 333 => function ($stackPos) { - $this->semValue = new Stmt\EnumCase($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-4)], $this->semStack[$stackPos-(5-1)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - }, - 334 => function ($stackPos) { - $this->semValue = null; /* will be skipped */ - }, - 335 => function ($stackPos) { - $this->semValue = array(); - }, - 336 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 337 => function ($stackPos) { - $this->semValue = array(); - }, - 338 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 339 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Precedence($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 340 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(5-1)][0], $this->semStack[$stackPos-(5-1)][1], $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-4)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - }, - 341 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], $this->semStack[$stackPos-(4-3)], null, $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 342 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], null, $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 343 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], null, $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 344 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); - }, - 345 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 346 => function ($stackPos) { - $this->semValue = array(null, $this->semStack[$stackPos-(1-1)]); - }, - 347 => function ($stackPos) { - $this->semValue = null; - }, - 348 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 349 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 350 => function ($stackPos) { - $this->semValue = 0; - }, - 351 => function ($stackPos) { - $this->semValue = 0; - }, - 352 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 353 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 354 => function ($stackPos) { - $this->checkModifier($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $this->semValue = $this->semStack[$stackPos-(2-1)] | $this->semStack[$stackPos-(2-2)]; - }, - 355 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_PUBLIC; - }, - 356 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_PROTECTED; - }, - 357 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_PRIVATE; - }, - 358 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_STATIC; - }, - 359 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_ABSTRACT; - }, - 360 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_FINAL; - }, - 361 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_READONLY; - }, - 362 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 363 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 364 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 365 => function ($stackPos) { - $this->semValue = new Node\VarLikeIdentifier(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 366 => function ($stackPos) { - $this->semValue = new Stmt\PropertyProperty($this->semStack[$stackPos-(1-1)], null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 367 => function ($stackPos) { - $this->semValue = new Stmt\PropertyProperty($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 368 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 369 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 370 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 371 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 372 => function ($stackPos) { - $this->semValue = array(); - }, - 373 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 374 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 375 => function ($stackPos) { - $this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 376 => function ($stackPos) { - $this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 377 => function ($stackPos) { - $this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 378 => function ($stackPos) { - $this->semValue = new Expr\AssignRef($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 379 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 380 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 381 => function ($stackPos) { - $this->semValue = new Expr\Clone_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 382 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Plus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 383 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Minus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 384 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Mul($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 385 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Div($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 386 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Concat($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 387 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Mod($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 388 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 389 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\BitwiseOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 390 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\BitwiseXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 391 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\ShiftLeft($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 392 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\ShiftRight($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 393 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Pow($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 394 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Coalesce($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 395 => function ($stackPos) { - $this->semValue = new Expr\PostInc($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 396 => function ($stackPos) { - $this->semValue = new Expr\PreInc($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 397 => function ($stackPos) { - $this->semValue = new Expr\PostDec($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 398 => function ($stackPos) { - $this->semValue = new Expr\PreDec($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 399 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BooleanOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 400 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BooleanAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 401 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\LogicalOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 402 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\LogicalAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 403 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\LogicalXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 404 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 405 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 406 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 407 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 408 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Concat($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 409 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Plus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 410 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Minus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 411 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Mul($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 412 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Div($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 413 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Mod($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 414 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\ShiftLeft($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 415 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\ShiftRight($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 416 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Pow($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 417 => function ($stackPos) { - $this->semValue = new Expr\UnaryPlus($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 418 => function ($stackPos) { - $this->semValue = new Expr\UnaryMinus($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 419 => function ($stackPos) { - $this->semValue = new Expr\BooleanNot($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 420 => function ($stackPos) { - $this->semValue = new Expr\BitwiseNot($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 421 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Identical($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 422 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\NotIdentical($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 423 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Equal($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 424 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\NotEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 425 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Spaceship($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 426 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Smaller($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 427 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\SmallerOrEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 428 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Greater($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 429 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\GreaterOrEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 430 => function ($stackPos) { - $this->semValue = new Expr\Instanceof_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 431 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 432 => function ($stackPos) { - $this->semValue = new Expr\Ternary($this->semStack[$stackPos-(5-1)], $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - }, - 433 => function ($stackPos) { - $this->semValue = new Expr\Ternary($this->semStack[$stackPos-(4-1)], null, $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 434 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Coalesce($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 435 => function ($stackPos) { - $this->semValue = new Expr\Isset_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 436 => function ($stackPos) { - $this->semValue = new Expr\Empty_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 437 => function ($stackPos) { - $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_INCLUDE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 438 => function ($stackPos) { - $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_INCLUDE_ONCE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 439 => function ($stackPos) { - $this->semValue = new Expr\Eval_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 440 => function ($stackPos) { - $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_REQUIRE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 441 => function ($stackPos) { - $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_REQUIRE_ONCE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 442 => function ($stackPos) { - $this->semValue = new Expr\Cast\Int_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 443 => function ($stackPos) { - $attrs = $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes; - $attrs['kind'] = $this->getFloatCastKind($this->semStack[$stackPos-(2-1)]); - $this->semValue = new Expr\Cast\Double($this->semStack[$stackPos-(2-2)], $attrs); - }, - 444 => function ($stackPos) { - $this->semValue = new Expr\Cast\String_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 445 => function ($stackPos) { - $this->semValue = new Expr\Cast\Array_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 446 => function ($stackPos) { - $this->semValue = new Expr\Cast\Object_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 447 => function ($stackPos) { - $this->semValue = new Expr\Cast\Bool_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 448 => function ($stackPos) { - $this->semValue = new Expr\Cast\Unset_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 449 => function ($stackPos) { - $attrs = $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes; - $attrs['kind'] = strtolower($this->semStack[$stackPos-(2-1)]) === 'exit' ? Expr\Exit_::KIND_EXIT : Expr\Exit_::KIND_DIE; - $this->semValue = new Expr\Exit_($this->semStack[$stackPos-(2-2)], $attrs); - }, - 450 => function ($stackPos) { - $this->semValue = new Expr\ErrorSuppress($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 451 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 452 => function ($stackPos) { - $this->semValue = new Expr\ShellExec($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 453 => function ($stackPos) { - $this->semValue = new Expr\Print_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 454 => function ($stackPos) { - $this->semValue = new Expr\Yield_(null, null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 455 => function ($stackPos) { - $this->semValue = new Expr\Yield_($this->semStack[$stackPos-(2-2)], null, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 456 => function ($stackPos) { - $this->semValue = new Expr\Yield_($this->semStack[$stackPos-(4-4)], $this->semStack[$stackPos-(4-2)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 457 => function ($stackPos) { - $this->semValue = new Expr\YieldFrom($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 458 => function ($stackPos) { - $this->semValue = new Expr\Throw_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 459 => function ($stackPos) { - $this->semValue = new Expr\ArrowFunction(['static' => false, 'byRef' => $this->semStack[$stackPos-(8-2)], 'params' => $this->semStack[$stackPos-(8-4)], 'returnType' => $this->semStack[$stackPos-(8-6)], 'expr' => $this->semStack[$stackPos-(8-8)], 'attrGroups' => []], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); - }, - 460 => function ($stackPos) { - $this->semValue = new Expr\ArrowFunction(['static' => true, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'returnType' => $this->semStack[$stackPos-(9-7)], 'expr' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => []], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); - }, - 461 => function ($stackPos) { - $this->semValue = new Expr\Closure(['static' => false, 'byRef' => $this->semStack[$stackPos-(8-2)], 'params' => $this->semStack[$stackPos-(8-4)], 'uses' => $this->semStack[$stackPos-(8-6)], 'returnType' => $this->semStack[$stackPos-(8-7)], 'stmts' => $this->semStack[$stackPos-(8-8)], 'attrGroups' => []], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); - }, - 462 => function ($stackPos) { - $this->semValue = new Expr\Closure(['static' => true, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'uses' => $this->semStack[$stackPos-(9-7)], 'returnType' => $this->semStack[$stackPos-(9-8)], 'stmts' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => []], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); - }, - 463 => function ($stackPos) { - $this->semValue = new Expr\ArrowFunction(['static' => false, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'returnType' => $this->semStack[$stackPos-(9-7)], 'expr' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => $this->semStack[$stackPos-(9-1)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); - }, - 464 => function ($stackPos) { - $this->semValue = new Expr\ArrowFunction(['static' => true, 'byRef' => $this->semStack[$stackPos-(10-4)], 'params' => $this->semStack[$stackPos-(10-6)], 'returnType' => $this->semStack[$stackPos-(10-8)], 'expr' => $this->semStack[$stackPos-(10-10)], 'attrGroups' => $this->semStack[$stackPos-(10-1)]], $this->startAttributeStack[$stackPos-(10-1)] + $this->endAttributes); - }, - 465 => function ($stackPos) { - $this->semValue = new Expr\Closure(['static' => false, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'uses' => $this->semStack[$stackPos-(9-7)], 'returnType' => $this->semStack[$stackPos-(9-8)], 'stmts' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => $this->semStack[$stackPos-(9-1)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); - }, - 466 => function ($stackPos) { - $this->semValue = new Expr\Closure(['static' => true, 'byRef' => $this->semStack[$stackPos-(10-4)], 'params' => $this->semStack[$stackPos-(10-6)], 'uses' => $this->semStack[$stackPos-(10-8)], 'returnType' => $this->semStack[$stackPos-(10-9)], 'stmts' => $this->semStack[$stackPos-(10-10)], 'attrGroups' => $this->semStack[$stackPos-(10-1)]], $this->startAttributeStack[$stackPos-(10-1)] + $this->endAttributes); - }, - 467 => function ($stackPos) { - $this->semValue = array(new Stmt\Class_(null, ['type' => 0, 'extends' => $this->semStack[$stackPos-(8-4)], 'implements' => $this->semStack[$stackPos-(8-5)], 'stmts' => $this->semStack[$stackPos-(8-7)], 'attrGroups' => $this->semStack[$stackPos-(8-1)]], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes), $this->semStack[$stackPos-(8-3)]); - $this->checkClass($this->semValue[0], -1); - }, - 468 => function ($stackPos) { - $this->semValue = new Expr\New_($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 469 => function ($stackPos) { - list($class, $ctorArgs) = $this->semStack[$stackPos-(2-2)]; $this->semValue = new Expr\New_($class, $ctorArgs, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 470 => function ($stackPos) { - $this->semValue = array(); - }, - 471 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-3)]; - }, - 472 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 473 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 474 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 475 => function ($stackPos) { - $this->semValue = new Expr\ClosureUse($this->semStack[$stackPos-(2-2)], $this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 476 => function ($stackPos) { - $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 477 => function ($stackPos) { - $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 478 => function ($stackPos) { - $this->semValue = new Expr\StaticCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 479 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 480 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 481 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 482 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 483 => function ($stackPos) { - $this->semValue = new Name\FullyQualified(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 484 => function ($stackPos) { - $this->semValue = new Name\Relative(substr($this->semStack[$stackPos-(1-1)], 10), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 485 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 486 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 487 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 488 => function ($stackPos) { - $this->semValue = new Expr\Error($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->errorState = 2; - }, - 489 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 490 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 491 => function ($stackPos) { - $this->semValue = null; - }, - 492 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 493 => function ($stackPos) { - $this->semValue = array(); - }, - 494 => function ($stackPos) { - $this->semValue = array(new Scalar\EncapsedStringPart(Scalar\String_::parseEscapeSequences($this->semStack[$stackPos-(1-1)], '`'), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes)); - }, - 495 => function ($stackPos) { - foreach ($this->semStack[$stackPos-(1-1)] as $s) { if ($s instanceof Node\Scalar\EncapsedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '`', true); } }; $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 496 => function ($stackPos) { - $this->semValue = array(); - }, - 497 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 498 => function ($stackPos) { - $this->semValue = new Expr\ConstFetch($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 499 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Line($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 500 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\File($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 501 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Dir($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 502 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Class_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 503 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Trait_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 504 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Method($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 505 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Function_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 506 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Namespace_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 507 => function ($stackPos) { - $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 508 => function ($stackPos) { - $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(3-1)], new Expr\Error($this->startAttributeStack[$stackPos-(3-3)] + $this->endAttributeStack[$stackPos-(3-3)]), $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); $this->errorState = 2; - }, - 509 => function ($stackPos) { - $attrs = $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes; $attrs['kind'] = Expr\Array_::KIND_SHORT; - $this->semValue = new Expr\Array_($this->semStack[$stackPos-(3-2)], $attrs); - }, - 510 => function ($stackPos) { - $attrs = $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes; $attrs['kind'] = Expr\Array_::KIND_LONG; - $this->semValue = new Expr\Array_($this->semStack[$stackPos-(4-3)], $attrs); - }, - 511 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 512 => function ($stackPos) { - $attrs = $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes; $attrs['kind'] = ($this->semStack[$stackPos-(1-1)][0] === "'" || ($this->semStack[$stackPos-(1-1)][1] === "'" && ($this->semStack[$stackPos-(1-1)][0] === 'b' || $this->semStack[$stackPos-(1-1)][0] === 'B')) ? Scalar\String_::KIND_SINGLE_QUOTED : Scalar\String_::KIND_DOUBLE_QUOTED); - $this->semValue = new Scalar\String_(Scalar\String_::parse($this->semStack[$stackPos-(1-1)]), $attrs); - }, - 513 => function ($stackPos) { - $attrs = $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes; $attrs['kind'] = Scalar\String_::KIND_DOUBLE_QUOTED; - foreach ($this->semStack[$stackPos-(3-2)] as $s) { if ($s instanceof Node\Scalar\EncapsedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '"', true); } }; $this->semValue = new Scalar\Encapsed($this->semStack[$stackPos-(3-2)], $attrs); - }, - 514 => function ($stackPos) { - $this->semValue = $this->parseLNumber($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 515 => function ($stackPos) { - $this->semValue = new Scalar\DNumber(Scalar\DNumber::parse($this->semStack[$stackPos-(1-1)]), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 516 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 517 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 518 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 519 => function ($stackPos) { - $this->semValue = $this->parseDocString($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes, $this->startAttributeStack[$stackPos-(3-3)] + $this->endAttributeStack[$stackPos-(3-3)], true); - }, - 520 => function ($stackPos) { - $this->semValue = $this->parseDocString($this->semStack[$stackPos-(2-1)], '', $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes, $this->startAttributeStack[$stackPos-(2-2)] + $this->endAttributeStack[$stackPos-(2-2)], true); - }, - 521 => function ($stackPos) { - $this->semValue = $this->parseDocString($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes, $this->startAttributeStack[$stackPos-(3-3)] + $this->endAttributeStack[$stackPos-(3-3)], true); - }, - 522 => function ($stackPos) { - $this->semValue = null; - }, - 523 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 524 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 525 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 526 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 527 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 528 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 529 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 530 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 531 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 532 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 533 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 534 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 535 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 536 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 537 => function ($stackPos) { - $this->semValue = new Expr\MethodCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 538 => function ($stackPos) { - $this->semValue = new Expr\NullsafeMethodCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 539 => function ($stackPos) { - $this->semValue = null; - }, - 540 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 541 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 542 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 543 => function ($stackPos) { - $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 544 => function ($stackPos) { - $this->semValue = new Expr\NullsafePropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 545 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 546 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 547 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 548 => function ($stackPos) { - $this->semValue = new Expr\Variable(new Expr\Error($this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes), $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); $this->errorState = 2; - }, - 549 => function ($stackPos) { - $var = $this->semStack[$stackPos-(1-1)]->name; $this->semValue = \is_string($var) ? new Node\VarLikeIdentifier($var, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes) : $var; - }, - 550 => function ($stackPos) { - $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 551 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 552 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 553 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 554 => function ($stackPos) { - $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 555 => function ($stackPos) { - $this->semValue = new Expr\NullsafePropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 556 => function ($stackPos) { - $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 557 => function ($stackPos) { - $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 558 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 559 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 560 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 561 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 562 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 563 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 564 => function ($stackPos) { - $this->semValue = new Expr\Error($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->errorState = 2; - }, - 565 => function ($stackPos) { - $this->semValue = new Expr\List_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 566 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; $end = count($this->semValue)-1; if ($this->semValue[$end] === null) array_pop($this->semValue); - }, - 567 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 568 => function ($stackPos) { - /* do nothing -- prevent default action of $$=$this->semStack[$1]. See $551. */ - }, - 569 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 570 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 571 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 572 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(2-2)], null, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 573 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 574 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(3-3)], $this->semStack[$stackPos-(3-1)], false, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 575 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(4-4)], $this->semStack[$stackPos-(4-1)], true, $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 576 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(3-3)], $this->semStack[$stackPos-(3-1)], false, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 577 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(2-2)], null, false, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 578 => function ($stackPos) { - $this->semValue = null; - }, - 579 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 580 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 581 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 582 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)]); - }, - 583 => function ($stackPos) { - $this->semValue = new Scalar\EncapsedStringPart($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 584 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 585 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 586 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 587 => function ($stackPos) { - $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 588 => function ($stackPos) { - $this->semValue = new Expr\NullsafePropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 589 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 590 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 591 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-4)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); - }, - 592 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 593 => function ($stackPos) { - $this->semValue = new Scalar\String_($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 594 => function ($stackPos) { - $this->semValue = $this->parseNumString($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 595 => function ($stackPos) { - $this->semValue = $this->parseNumString('-' . $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 596 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - ]; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Parser/Tokens.php b/vendor/nikic/php-parser/lib/PhpParser/Parser/Tokens.php deleted file mode 100644 index b76a5d9..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Parser/Tokens.php +++ /dev/null @@ -1,148 +0,0 @@ -lexer = $lexer; - - if (isset($options['throwOnError'])) { - throw new \LogicException( - '"throwOnError" is no longer supported, use "errorHandler" instead'); - } - - $this->initReduceCallbacks(); - } - - /** - * Parses PHP code into a node tree. - * - * If a non-throwing error handler is used, the parser will continue parsing after an error - * occurred and attempt to build a partial AST. - * - * @param string $code The source code to parse - * @param ErrorHandler|null $errorHandler Error handler to use for lexer/parser errors, defaults - * to ErrorHandler\Throwing. - * - * @return Node\Stmt[]|null Array of statements (or null non-throwing error handler is used and - * the parser was unable to recover from an error). - */ - public function parse(string $code, ErrorHandler $errorHandler = null) { - $this->errorHandler = $errorHandler ?: new ErrorHandler\Throwing; - - $this->lexer->startLexing($code, $this->errorHandler); - $result = $this->doParse(); - - // Clear out some of the interior state, so we don't hold onto unnecessary - // memory between uses of the parser - $this->startAttributeStack = []; - $this->endAttributeStack = []; - $this->semStack = []; - $this->semValue = null; - - return $result; - } - - protected function doParse() { - // We start off with no lookahead-token - $symbol = self::SYMBOL_NONE; - - // The attributes for a node are taken from the first and last token of the node. - // From the first token only the startAttributes are taken and from the last only - // the endAttributes. Both are merged using the array union operator (+). - $startAttributes = []; - $endAttributes = []; - $this->endAttributes = $endAttributes; - - // Keep stack of start and end attributes - $this->startAttributeStack = []; - $this->endAttributeStack = [$endAttributes]; - - // Start off in the initial state and keep a stack of previous states - $state = 0; - $stateStack = [$state]; - - // Semantic value stack (contains values of tokens and semantic action results) - $this->semStack = []; - - // Current position in the stack(s) - $stackPos = 0; - - $this->errorState = 0; - - for (;;) { - //$this->traceNewState($state, $symbol); - - if ($this->actionBase[$state] === 0) { - $rule = $this->actionDefault[$state]; - } else { - if ($symbol === self::SYMBOL_NONE) { - // Fetch the next token id from the lexer and fetch additional info by-ref. - // The end attributes are fetched into a temporary variable and only set once the token is really - // shifted (not during read). Otherwise you would sometimes get off-by-one errors, when a rule is - // reduced after a token was read but not yet shifted. - $tokenId = $this->lexer->getNextToken($tokenValue, $startAttributes, $endAttributes); - - // map the lexer token id to the internally used symbols - $symbol = $tokenId >= 0 && $tokenId < $this->tokenToSymbolMapSize - ? $this->tokenToSymbol[$tokenId] - : $this->invalidSymbol; - - if ($symbol === $this->invalidSymbol) { - throw new \RangeException(sprintf( - 'The lexer returned an invalid token (id=%d, value=%s)', - $tokenId, $tokenValue - )); - } - - // Allow productions to access the start attributes of the lookahead token. - $this->lookaheadStartAttributes = $startAttributes; - - //$this->traceRead($symbol); - } - - $idx = $this->actionBase[$state] + $symbol; - if ((($idx >= 0 && $idx < $this->actionTableSize && $this->actionCheck[$idx] === $symbol) - || ($state < $this->YY2TBLSTATE - && ($idx = $this->actionBase[$state + $this->numNonLeafStates] + $symbol) >= 0 - && $idx < $this->actionTableSize && $this->actionCheck[$idx] === $symbol)) - && ($action = $this->action[$idx]) !== $this->defaultAction) { - /* - * >= numNonLeafStates: shift and reduce - * > 0: shift - * = 0: accept - * < 0: reduce - * = -YYUNEXPECTED: error - */ - if ($action > 0) { - /* shift */ - //$this->traceShift($symbol); - - ++$stackPos; - $stateStack[$stackPos] = $state = $action; - $this->semStack[$stackPos] = $tokenValue; - $this->startAttributeStack[$stackPos] = $startAttributes; - $this->endAttributeStack[$stackPos] = $endAttributes; - $this->endAttributes = $endAttributes; - $symbol = self::SYMBOL_NONE; - - if ($this->errorState) { - --$this->errorState; - } - - if ($action < $this->numNonLeafStates) { - continue; - } - - /* $yyn >= numNonLeafStates means shift-and-reduce */ - $rule = $action - $this->numNonLeafStates; - } else { - $rule = -$action; - } - } else { - $rule = $this->actionDefault[$state]; - } - } - - for (;;) { - if ($rule === 0) { - /* accept */ - //$this->traceAccept(); - return $this->semValue; - } elseif ($rule !== $this->unexpectedTokenRule) { - /* reduce */ - //$this->traceReduce($rule); - - try { - $this->reduceCallbacks[$rule]($stackPos); - } catch (Error $e) { - if (-1 === $e->getStartLine() && isset($startAttributes['startLine'])) { - $e->setStartLine($startAttributes['startLine']); - } - - $this->emitError($e); - // Can't recover from this type of error - return null; - } - - /* Goto - shift nonterminal */ - $lastEndAttributes = $this->endAttributeStack[$stackPos]; - $ruleLength = $this->ruleToLength[$rule]; - $stackPos -= $ruleLength; - $nonTerminal = $this->ruleToNonTerminal[$rule]; - $idx = $this->gotoBase[$nonTerminal] + $stateStack[$stackPos]; - if ($idx >= 0 && $idx < $this->gotoTableSize && $this->gotoCheck[$idx] === $nonTerminal) { - $state = $this->goto[$idx]; - } else { - $state = $this->gotoDefault[$nonTerminal]; - } - - ++$stackPos; - $stateStack[$stackPos] = $state; - $this->semStack[$stackPos] = $this->semValue; - $this->endAttributeStack[$stackPos] = $lastEndAttributes; - if ($ruleLength === 0) { - // Empty productions use the start attributes of the lookahead token. - $this->startAttributeStack[$stackPos] = $this->lookaheadStartAttributes; - } - } else { - /* error */ - switch ($this->errorState) { - case 0: - $msg = $this->getErrorMessage($symbol, $state); - $this->emitError(new Error($msg, $startAttributes + $endAttributes)); - // Break missing intentionally - case 1: - case 2: - $this->errorState = 3; - - // Pop until error-expecting state uncovered - while (!( - (($idx = $this->actionBase[$state] + $this->errorSymbol) >= 0 - && $idx < $this->actionTableSize && $this->actionCheck[$idx] === $this->errorSymbol) - || ($state < $this->YY2TBLSTATE - && ($idx = $this->actionBase[$state + $this->numNonLeafStates] + $this->errorSymbol) >= 0 - && $idx < $this->actionTableSize && $this->actionCheck[$idx] === $this->errorSymbol) - ) || ($action = $this->action[$idx]) === $this->defaultAction) { // Not totally sure about this - if ($stackPos <= 0) { - // Could not recover from error - return null; - } - $state = $stateStack[--$stackPos]; - //$this->tracePop($state); - } - - //$this->traceShift($this->errorSymbol); - ++$stackPos; - $stateStack[$stackPos] = $state = $action; - - // We treat the error symbol as being empty, so we reset the end attributes - // to the end attributes of the last non-error symbol - $this->startAttributeStack[$stackPos] = $this->lookaheadStartAttributes; - $this->endAttributeStack[$stackPos] = $this->endAttributeStack[$stackPos - 1]; - $this->endAttributes = $this->endAttributeStack[$stackPos - 1]; - break; - - case 3: - if ($symbol === 0) { - // Reached EOF without recovering from error - return null; - } - - //$this->traceDiscard($symbol); - $symbol = self::SYMBOL_NONE; - break 2; - } - } - - if ($state < $this->numNonLeafStates) { - break; - } - - /* >= numNonLeafStates means shift-and-reduce */ - $rule = $state - $this->numNonLeafStates; - } - } - - throw new \RuntimeException('Reached end of parser loop'); - } - - protected function emitError(Error $error) { - $this->errorHandler->handleError($error); - } - - /** - * Format error message including expected tokens. - * - * @param int $symbol Unexpected symbol - * @param int $state State at time of error - * - * @return string Formatted error message - */ - protected function getErrorMessage(int $symbol, int $state) : string { - $expectedString = ''; - if ($expected = $this->getExpectedTokens($state)) { - $expectedString = ', expecting ' . implode(' or ', $expected); - } - - return 'Syntax error, unexpected ' . $this->symbolToName[$symbol] . $expectedString; - } - - /** - * Get limited number of expected tokens in given state. - * - * @param int $state State - * - * @return string[] Expected tokens. If too many, an empty array is returned. - */ - protected function getExpectedTokens(int $state) : array { - $expected = []; - - $base = $this->actionBase[$state]; - foreach ($this->symbolToName as $symbol => $name) { - $idx = $base + $symbol; - if ($idx >= 0 && $idx < $this->actionTableSize && $this->actionCheck[$idx] === $symbol - || $state < $this->YY2TBLSTATE - && ($idx = $this->actionBase[$state + $this->numNonLeafStates] + $symbol) >= 0 - && $idx < $this->actionTableSize && $this->actionCheck[$idx] === $symbol - ) { - if ($this->action[$idx] !== $this->unexpectedTokenRule - && $this->action[$idx] !== $this->defaultAction - && $symbol !== $this->errorSymbol - ) { - if (count($expected) === 4) { - /* Too many expected tokens */ - return []; - } - - $expected[] = $name; - } - } - } - - return $expected; - } - - /* - * Tracing functions used for debugging the parser. - */ - - /* - protected function traceNewState($state, $symbol) { - echo '% State ' . $state - . ', Lookahead ' . ($symbol == self::SYMBOL_NONE ? '--none--' : $this->symbolToName[$symbol]) . "\n"; - } - - protected function traceRead($symbol) { - echo '% Reading ' . $this->symbolToName[$symbol] . "\n"; - } - - protected function traceShift($symbol) { - echo '% Shift ' . $this->symbolToName[$symbol] . "\n"; - } - - protected function traceAccept() { - echo "% Accepted.\n"; - } - - protected function traceReduce($n) { - echo '% Reduce by (' . $n . ') ' . $this->productions[$n] . "\n"; - } - - protected function tracePop($state) { - echo '% Recovering, uncovered state ' . $state . "\n"; - } - - protected function traceDiscard($symbol) { - echo '% Discard ' . $this->symbolToName[$symbol] . "\n"; - } - */ - - /* - * Helper functions invoked by semantic actions - */ - - /** - * Moves statements of semicolon-style namespaces into $ns->stmts and checks various error conditions. - * - * @param Node\Stmt[] $stmts - * @return Node\Stmt[] - */ - protected function handleNamespaces(array $stmts) : array { - $hasErrored = false; - $style = $this->getNamespacingStyle($stmts); - if (null === $style) { - // not namespaced, nothing to do - return $stmts; - } elseif ('brace' === $style) { - // For braced namespaces we only have to check that there are no invalid statements between the namespaces - $afterFirstNamespace = false; - foreach ($stmts as $stmt) { - if ($stmt instanceof Node\Stmt\Namespace_) { - $afterFirstNamespace = true; - } elseif (!$stmt instanceof Node\Stmt\HaltCompiler - && !$stmt instanceof Node\Stmt\Nop - && $afterFirstNamespace && !$hasErrored) { - $this->emitError(new Error( - 'No code may exist outside of namespace {}', $stmt->getAttributes())); - $hasErrored = true; // Avoid one error for every statement - } - } - return $stmts; - } else { - // For semicolon namespaces we have to move the statements after a namespace declaration into ->stmts - $resultStmts = []; - $targetStmts =& $resultStmts; - $lastNs = null; - foreach ($stmts as $stmt) { - if ($stmt instanceof Node\Stmt\Namespace_) { - if ($lastNs !== null) { - $this->fixupNamespaceAttributes($lastNs); - } - if ($stmt->stmts === null) { - $stmt->stmts = []; - $targetStmts =& $stmt->stmts; - $resultStmts[] = $stmt; - } else { - // This handles the invalid case of mixed style namespaces - $resultStmts[] = $stmt; - $targetStmts =& $resultStmts; - } - $lastNs = $stmt; - } elseif ($stmt instanceof Node\Stmt\HaltCompiler) { - // __halt_compiler() is not moved into the namespace - $resultStmts[] = $stmt; - } else { - $targetStmts[] = $stmt; - } - } - if ($lastNs !== null) { - $this->fixupNamespaceAttributes($lastNs); - } - return $resultStmts; - } - } - - private function fixupNamespaceAttributes(Node\Stmt\Namespace_ $stmt) { - // We moved the statements into the namespace node, as such the end of the namespace node - // needs to be extended to the end of the statements. - if (empty($stmt->stmts)) { - return; - } - - // We only move the builtin end attributes here. This is the best we can do with the - // knowledge we have. - $endAttributes = ['endLine', 'endFilePos', 'endTokenPos']; - $lastStmt = $stmt->stmts[count($stmt->stmts) - 1]; - foreach ($endAttributes as $endAttribute) { - if ($lastStmt->hasAttribute($endAttribute)) { - $stmt->setAttribute($endAttribute, $lastStmt->getAttribute($endAttribute)); - } - } - } - - /** - * Determine namespacing style (semicolon or brace) - * - * @param Node[] $stmts Top-level statements. - * - * @return null|string One of "semicolon", "brace" or null (no namespaces) - */ - private function getNamespacingStyle(array $stmts) { - $style = null; - $hasNotAllowedStmts = false; - foreach ($stmts as $i => $stmt) { - if ($stmt instanceof Node\Stmt\Namespace_) { - $currentStyle = null === $stmt->stmts ? 'semicolon' : 'brace'; - if (null === $style) { - $style = $currentStyle; - if ($hasNotAllowedStmts) { - $this->emitError(new Error( - 'Namespace declaration statement has to be the very first statement in the script', - $stmt->getLine() // Avoid marking the entire namespace as an error - )); - } - } elseif ($style !== $currentStyle) { - $this->emitError(new Error( - 'Cannot mix bracketed namespace declarations with unbracketed namespace declarations', - $stmt->getLine() // Avoid marking the entire namespace as an error - )); - // Treat like semicolon style for namespace normalization - return 'semicolon'; - } - continue; - } - - /* declare(), __halt_compiler() and nops can be used before a namespace declaration */ - if ($stmt instanceof Node\Stmt\Declare_ - || $stmt instanceof Node\Stmt\HaltCompiler - || $stmt instanceof Node\Stmt\Nop) { - continue; - } - - /* There may be a hashbang line at the very start of the file */ - if ($i === 0 && $stmt instanceof Node\Stmt\InlineHTML && preg_match('/\A#!.*\r?\n\z/', $stmt->value)) { - continue; - } - - /* Everything else if forbidden before namespace declarations */ - $hasNotAllowedStmts = true; - } - return $style; - } - - /** - * Fix up parsing of static property calls in PHP 5. - * - * In PHP 5 A::$b[c][d] and A::$b[c][d]() have very different interpretation. The former is - * interpreted as (A::$b)[c][d], while the latter is the same as A::{$b[c][d]}(). We parse the - * latter as the former initially and this method fixes the AST into the correct form when we - * encounter the "()". - * - * @param Node\Expr\StaticPropertyFetch|Node\Expr\ArrayDimFetch $prop - * @param Node\Arg[] $args - * @param array $attributes - * - * @return Expr\StaticCall - */ - protected function fixupPhp5StaticPropCall($prop, array $args, array $attributes) : Expr\StaticCall { - if ($prop instanceof Node\Expr\StaticPropertyFetch) { - $name = $prop->name instanceof VarLikeIdentifier - ? $prop->name->toString() : $prop->name; - $var = new Expr\Variable($name, $prop->name->getAttributes()); - return new Expr\StaticCall($prop->class, $var, $args, $attributes); - } elseif ($prop instanceof Node\Expr\ArrayDimFetch) { - $tmp = $prop; - while ($tmp->var instanceof Node\Expr\ArrayDimFetch) { - $tmp = $tmp->var; - } - - /** @var Expr\StaticPropertyFetch $staticProp */ - $staticProp = $tmp->var; - - // Set start attributes to attributes of innermost node - $tmp = $prop; - $this->fixupStartAttributes($tmp, $staticProp->name); - while ($tmp->var instanceof Node\Expr\ArrayDimFetch) { - $tmp = $tmp->var; - $this->fixupStartAttributes($tmp, $staticProp->name); - } - - $name = $staticProp->name instanceof VarLikeIdentifier - ? $staticProp->name->toString() : $staticProp->name; - $tmp->var = new Expr\Variable($name, $staticProp->name->getAttributes()); - return new Expr\StaticCall($staticProp->class, $prop, $args, $attributes); - } else { - throw new \Exception; - } - } - - protected function fixupStartAttributes(Node $to, Node $from) { - $startAttributes = ['startLine', 'startFilePos', 'startTokenPos']; - foreach ($startAttributes as $startAttribute) { - if ($from->hasAttribute($startAttribute)) { - $to->setAttribute($startAttribute, $from->getAttribute($startAttribute)); - } - } - } - - protected function handleBuiltinTypes(Name $name) { - $builtinTypes = [ - 'bool' => true, - 'int' => true, - 'float' => true, - 'string' => true, - 'iterable' => true, - 'void' => true, - 'object' => true, - 'null' => true, - 'false' => true, - 'mixed' => true, - 'never' => true, - ]; - - if (!$name->isUnqualified()) { - return $name; - } - - $lowerName = $name->toLowerString(); - if (!isset($builtinTypes[$lowerName])) { - return $name; - } - - return new Node\Identifier($lowerName, $name->getAttributes()); - } - - /** - * Get combined start and end attributes at a stack location - * - * @param int $pos Stack location - * - * @return array Combined start and end attributes - */ - protected function getAttributesAt(int $pos) : array { - return $this->startAttributeStack[$pos] + $this->endAttributeStack[$pos]; - } - - protected function getFloatCastKind(string $cast): int - { - $cast = strtolower($cast); - if (strpos($cast, 'float') !== false) { - return Double::KIND_FLOAT; - } - - if (strpos($cast, 'real') !== false) { - return Double::KIND_REAL; - } - - return Double::KIND_DOUBLE; - } - - protected function parseLNumber($str, $attributes, $allowInvalidOctal = false) { - try { - return LNumber::fromString($str, $attributes, $allowInvalidOctal); - } catch (Error $error) { - $this->emitError($error); - // Use dummy value - return new LNumber(0, $attributes); - } - } - - /** - * Parse a T_NUM_STRING token into either an integer or string node. - * - * @param string $str Number string - * @param array $attributes Attributes - * - * @return LNumber|String_ Integer or string node. - */ - protected function parseNumString(string $str, array $attributes) { - if (!preg_match('/^(?:0|-?[1-9][0-9]*)$/', $str)) { - return new String_($str, $attributes); - } - - $num = +$str; - if (!is_int($num)) { - return new String_($str, $attributes); - } - - return new LNumber($num, $attributes); - } - - protected function stripIndentation( - string $string, int $indentLen, string $indentChar, - bool $newlineAtStart, bool $newlineAtEnd, array $attributes - ) { - if ($indentLen === 0) { - return $string; - } - - $start = $newlineAtStart ? '(?:(?<=\n)|\A)' : '(?<=\n)'; - $end = $newlineAtEnd ? '(?:(?=[\r\n])|\z)' : '(?=[\r\n])'; - $regex = '/' . $start . '([ \t]*)(' . $end . ')?/'; - return preg_replace_callback( - $regex, - function ($matches) use ($indentLen, $indentChar, $attributes) { - $prefix = substr($matches[1], 0, $indentLen); - if (false !== strpos($prefix, $indentChar === " " ? "\t" : " ")) { - $this->emitError(new Error( - 'Invalid indentation - tabs and spaces cannot be mixed', $attributes - )); - } elseif (strlen($prefix) < $indentLen && !isset($matches[2])) { - $this->emitError(new Error( - 'Invalid body indentation level ' . - '(expecting an indentation level of at least ' . $indentLen . ')', - $attributes - )); - } - return substr($matches[0], strlen($prefix)); - }, - $string - ); - } - - protected function parseDocString( - string $startToken, $contents, string $endToken, - array $attributes, array $endTokenAttributes, bool $parseUnicodeEscape - ) { - $kind = strpos($startToken, "'") === false - ? String_::KIND_HEREDOC : String_::KIND_NOWDOC; - - $regex = '/\A[bB]?<<<[ \t]*[\'"]?([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)[\'"]?(?:\r\n|\n|\r)\z/'; - $result = preg_match($regex, $startToken, $matches); - assert($result === 1); - $label = $matches[1]; - - $result = preg_match('/\A[ \t]*/', $endToken, $matches); - assert($result === 1); - $indentation = $matches[0]; - - $attributes['kind'] = $kind; - $attributes['docLabel'] = $label; - $attributes['docIndentation'] = $indentation; - - $indentHasSpaces = false !== strpos($indentation, " "); - $indentHasTabs = false !== strpos($indentation, "\t"); - if ($indentHasSpaces && $indentHasTabs) { - $this->emitError(new Error( - 'Invalid indentation - tabs and spaces cannot be mixed', - $endTokenAttributes - )); - - // Proceed processing as if this doc string is not indented - $indentation = ''; - } - - $indentLen = \strlen($indentation); - $indentChar = $indentHasSpaces ? " " : "\t"; - - if (\is_string($contents)) { - if ($contents === '') { - return new String_('', $attributes); - } - - $contents = $this->stripIndentation( - $contents, $indentLen, $indentChar, true, true, $attributes - ); - $contents = preg_replace('~(\r\n|\n|\r)\z~', '', $contents); - - if ($kind === String_::KIND_HEREDOC) { - $contents = String_::parseEscapeSequences($contents, null, $parseUnicodeEscape); - } - - return new String_($contents, $attributes); - } else { - assert(count($contents) > 0); - if (!$contents[0] instanceof Node\Scalar\EncapsedStringPart) { - // If there is no leading encapsed string part, pretend there is an empty one - $this->stripIndentation( - '', $indentLen, $indentChar, true, false, $contents[0]->getAttributes() - ); - } - - $newContents = []; - foreach ($contents as $i => $part) { - if ($part instanceof Node\Scalar\EncapsedStringPart) { - $isLast = $i === \count($contents) - 1; - $part->value = $this->stripIndentation( - $part->value, $indentLen, $indentChar, - $i === 0, $isLast, $part->getAttributes() - ); - $part->value = String_::parseEscapeSequences($part->value, null, $parseUnicodeEscape); - if ($isLast) { - $part->value = preg_replace('~(\r\n|\n|\r)\z~', '', $part->value); - } - if ('' === $part->value) { - continue; - } - } - $newContents[] = $part; - } - return new Encapsed($newContents, $attributes); - } - } - - /** - * Create attributes for a zero-length common-capturing nop. - * - * @param Comment[] $comments - * @return array - */ - protected function createCommentNopAttributes(array $comments) { - $comment = $comments[count($comments) - 1]; - $commentEndLine = $comment->getEndLine(); - $commentEndFilePos = $comment->getEndFilePos(); - $commentEndTokenPos = $comment->getEndTokenPos(); - - $attributes = ['comments' => $comments]; - if (-1 !== $commentEndLine) { - $attributes['startLine'] = $commentEndLine; - $attributes['endLine'] = $commentEndLine; - } - if (-1 !== $commentEndFilePos) { - $attributes['startFilePos'] = $commentEndFilePos + 1; - $attributes['endFilePos'] = $commentEndFilePos; - } - if (-1 !== $commentEndTokenPos) { - $attributes['startTokenPos'] = $commentEndTokenPos + 1; - $attributes['endTokenPos'] = $commentEndTokenPos; - } - return $attributes; - } - - protected function checkModifier($a, $b, $modifierPos) { - // Jumping through some hoops here because verifyModifier() is also used elsewhere - try { - Class_::verifyModifier($a, $b); - } catch (Error $error) { - $error->setAttributes($this->getAttributesAt($modifierPos)); - $this->emitError($error); - } - } - - protected function checkParam(Param $node) { - if ($node->variadic && null !== $node->default) { - $this->emitError(new Error( - 'Variadic parameter cannot have a default value', - $node->default->getAttributes() - )); - } - } - - protected function checkTryCatch(TryCatch $node) { - if (empty($node->catches) && null === $node->finally) { - $this->emitError(new Error( - 'Cannot use try without catch or finally', $node->getAttributes() - )); - } - } - - protected function checkNamespace(Namespace_ $node) { - if (null !== $node->stmts) { - foreach ($node->stmts as $stmt) { - if ($stmt instanceof Namespace_) { - $this->emitError(new Error( - 'Namespace declarations cannot be nested', $stmt->getAttributes() - )); - } - } - } - } - - private function checkClassName($name, $namePos) { - if (null !== $name && $name->isSpecialClassName()) { - $this->emitError(new Error( - sprintf('Cannot use \'%s\' as class name as it is reserved', $name), - $this->getAttributesAt($namePos) - )); - } - } - - private function checkImplementedInterfaces(array $interfaces) { - foreach ($interfaces as $interface) { - if ($interface->isSpecialClassName()) { - $this->emitError(new Error( - sprintf('Cannot use \'%s\' as interface name as it is reserved', $interface), - $interface->getAttributes() - )); - } - } - } - - protected function checkClass(Class_ $node, $namePos) { - $this->checkClassName($node->name, $namePos); - - if ($node->extends && $node->extends->isSpecialClassName()) { - $this->emitError(new Error( - sprintf('Cannot use \'%s\' as class name as it is reserved', $node->extends), - $node->extends->getAttributes() - )); - } - - $this->checkImplementedInterfaces($node->implements); - } - - protected function checkInterface(Interface_ $node, $namePos) { - $this->checkClassName($node->name, $namePos); - $this->checkImplementedInterfaces($node->extends); - } - - protected function checkEnum(Enum_ $node, $namePos) { - $this->checkClassName($node->name, $namePos); - $this->checkImplementedInterfaces($node->implements); - } - - protected function checkClassMethod(ClassMethod $node, $modifierPos) { - if ($node->flags & Class_::MODIFIER_STATIC) { - switch ($node->name->toLowerString()) { - case '__construct': - $this->emitError(new Error( - sprintf('Constructor %s() cannot be static', $node->name), - $this->getAttributesAt($modifierPos))); - break; - case '__destruct': - $this->emitError(new Error( - sprintf('Destructor %s() cannot be static', $node->name), - $this->getAttributesAt($modifierPos))); - break; - case '__clone': - $this->emitError(new Error( - sprintf('Clone method %s() cannot be static', $node->name), - $this->getAttributesAt($modifierPos))); - break; - } - } - - if ($node->flags & Class_::MODIFIER_READONLY) { - $this->emitError(new Error( - sprintf('Method %s() cannot be readonly', $node->name), - $this->getAttributesAt($modifierPos))); - } - } - - protected function checkClassConst(ClassConst $node, $modifierPos) { - if ($node->flags & Class_::MODIFIER_STATIC) { - $this->emitError(new Error( - "Cannot use 'static' as constant modifier", - $this->getAttributesAt($modifierPos))); - } - if ($node->flags & Class_::MODIFIER_ABSTRACT) { - $this->emitError(new Error( - "Cannot use 'abstract' as constant modifier", - $this->getAttributesAt($modifierPos))); - } - if ($node->flags & Class_::MODIFIER_READONLY) { - $this->emitError(new Error( - "Cannot use 'readonly' as constant modifier", - $this->getAttributesAt($modifierPos))); - } - } - - protected function checkProperty(Property $node, $modifierPos) { - if ($node->flags & Class_::MODIFIER_ABSTRACT) { - $this->emitError(new Error('Properties cannot be declared abstract', - $this->getAttributesAt($modifierPos))); - } - - if ($node->flags & Class_::MODIFIER_FINAL) { - $this->emitError(new Error('Properties cannot be declared final', - $this->getAttributesAt($modifierPos))); - } - } - - protected function checkUseUse(UseUse $node, $namePos) { - if ($node->alias && $node->alias->isSpecialClassName()) { - $this->emitError(new Error( - sprintf( - 'Cannot use %s as %s because \'%2$s\' is a special class name', - $node->name, $node->alias - ), - $this->getAttributesAt($namePos) - )); - } - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/ParserFactory.php b/vendor/nikic/php-parser/lib/PhpParser/ParserFactory.php deleted file mode 100644 index f041e7f..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/ParserFactory.php +++ /dev/null @@ -1,44 +0,0 @@ -pAttrGroups($node->attrGroups, true) - . $this->pModifiers($node->flags) - . ($node->type ? $this->p($node->type) . ' ' : '') - . ($node->byRef ? '&' : '') - . ($node->variadic ? '...' : '') - . $this->p($node->var) - . ($node->default ? ' = ' . $this->p($node->default) : ''); - } - - protected function pArg(Node\Arg $node) { - return ($node->name ? $node->name->toString() . ': ' : '') - . ($node->byRef ? '&' : '') . ($node->unpack ? '...' : '') - . $this->p($node->value); - } - - protected function pVariadicPlaceholder(Node\VariadicPlaceholder $node) { - return '...'; - } - - protected function pConst(Node\Const_ $node) { - return $node->name . ' = ' . $this->p($node->value); - } - - protected function pNullableType(Node\NullableType $node) { - return '?' . $this->p($node->type); - } - - protected function pUnionType(Node\UnionType $node) { - return $this->pImplode($node->types, '|'); - } - - protected function pIntersectionType(Node\IntersectionType $node) { - return $this->pImplode($node->types, '&'); - } - - protected function pIdentifier(Node\Identifier $node) { - return $node->name; - } - - protected function pVarLikeIdentifier(Node\VarLikeIdentifier $node) { - return '$' . $node->name; - } - - protected function pAttribute(Node\Attribute $node) { - return $this->p($node->name) - . ($node->args ? '(' . $this->pCommaSeparated($node->args) . ')' : ''); - } - - protected function pAttributeGroup(Node\AttributeGroup $node) { - return '#[' . $this->pCommaSeparated($node->attrs) . ']'; - } - - // Names - - protected function pName(Name $node) { - return implode('\\', $node->parts); - } - - protected function pName_FullyQualified(Name\FullyQualified $node) { - return '\\' . implode('\\', $node->parts); - } - - protected function pName_Relative(Name\Relative $node) { - return 'namespace\\' . implode('\\', $node->parts); - } - - // Magic Constants - - protected function pScalar_MagicConst_Class(MagicConst\Class_ $node) { - return '__CLASS__'; - } - - protected function pScalar_MagicConst_Dir(MagicConst\Dir $node) { - return '__DIR__'; - } - - protected function pScalar_MagicConst_File(MagicConst\File $node) { - return '__FILE__'; - } - - protected function pScalar_MagicConst_Function(MagicConst\Function_ $node) { - return '__FUNCTION__'; - } - - protected function pScalar_MagicConst_Line(MagicConst\Line $node) { - return '__LINE__'; - } - - protected function pScalar_MagicConst_Method(MagicConst\Method $node) { - return '__METHOD__'; - } - - protected function pScalar_MagicConst_Namespace(MagicConst\Namespace_ $node) { - return '__NAMESPACE__'; - } - - protected function pScalar_MagicConst_Trait(MagicConst\Trait_ $node) { - return '__TRAIT__'; - } - - // Scalars - - protected function pScalar_String(Scalar\String_ $node) { - $kind = $node->getAttribute('kind', Scalar\String_::KIND_SINGLE_QUOTED); - switch ($kind) { - case Scalar\String_::KIND_NOWDOC: - $label = $node->getAttribute('docLabel'); - if ($label && !$this->containsEndLabel($node->value, $label)) { - if ($node->value === '') { - return "<<<'$label'\n$label" . $this->docStringEndToken; - } - - return "<<<'$label'\n$node->value\n$label" - . $this->docStringEndToken; - } - /* break missing intentionally */ - case Scalar\String_::KIND_SINGLE_QUOTED: - return $this->pSingleQuotedString($node->value); - case Scalar\String_::KIND_HEREDOC: - $label = $node->getAttribute('docLabel'); - if ($label && !$this->containsEndLabel($node->value, $label)) { - if ($node->value === '') { - return "<<<$label\n$label" . $this->docStringEndToken; - } - - $escaped = $this->escapeString($node->value, null); - return "<<<$label\n" . $escaped . "\n$label" - . $this->docStringEndToken; - } - /* break missing intentionally */ - case Scalar\String_::KIND_DOUBLE_QUOTED: - return '"' . $this->escapeString($node->value, '"') . '"'; - } - throw new \Exception('Invalid string kind'); - } - - protected function pScalar_Encapsed(Scalar\Encapsed $node) { - if ($node->getAttribute('kind') === Scalar\String_::KIND_HEREDOC) { - $label = $node->getAttribute('docLabel'); - if ($label && !$this->encapsedContainsEndLabel($node->parts, $label)) { - if (count($node->parts) === 1 - && $node->parts[0] instanceof Scalar\EncapsedStringPart - && $node->parts[0]->value === '' - ) { - return "<<<$label\n$label" . $this->docStringEndToken; - } - - return "<<<$label\n" . $this->pEncapsList($node->parts, null) . "\n$label" - . $this->docStringEndToken; - } - } - return '"' . $this->pEncapsList($node->parts, '"') . '"'; - } - - protected function pScalar_LNumber(Scalar\LNumber $node) { - if ($node->value === -\PHP_INT_MAX-1) { - // PHP_INT_MIN cannot be represented as a literal, - // because the sign is not part of the literal - return '(-' . \PHP_INT_MAX . '-1)'; - } - - $kind = $node->getAttribute('kind', Scalar\LNumber::KIND_DEC); - if (Scalar\LNumber::KIND_DEC === $kind) { - return (string) $node->value; - } - - if ($node->value < 0) { - $sign = '-'; - $str = (string) -$node->value; - } else { - $sign = ''; - $str = (string) $node->value; - } - switch ($kind) { - case Scalar\LNumber::KIND_BIN: - return $sign . '0b' . base_convert($str, 10, 2); - case Scalar\LNumber::KIND_OCT: - return $sign . '0' . base_convert($str, 10, 8); - case Scalar\LNumber::KIND_HEX: - return $sign . '0x' . base_convert($str, 10, 16); - } - throw new \Exception('Invalid number kind'); - } - - protected function pScalar_DNumber(Scalar\DNumber $node) { - if (!is_finite($node->value)) { - if ($node->value === \INF) { - return '\INF'; - } elseif ($node->value === -\INF) { - return '-\INF'; - } else { - return '\NAN'; - } - } - - // Try to find a short full-precision representation - $stringValue = sprintf('%.16G', $node->value); - if ($node->value !== (double) $stringValue) { - $stringValue = sprintf('%.17G', $node->value); - } - - // %G is locale dependent and there exists no locale-independent alternative. We don't want - // mess with switching locales here, so let's assume that a comma is the only non-standard - // decimal separator we may encounter... - $stringValue = str_replace(',', '.', $stringValue); - - // ensure that number is really printed as float - return preg_match('/^-?[0-9]+$/', $stringValue) ? $stringValue . '.0' : $stringValue; - } - - protected function pScalar_EncapsedStringPart(Scalar\EncapsedStringPart $node) { - throw new \LogicException('Cannot directly print EncapsedStringPart'); - } - - // Assignments - - protected function pExpr_Assign(Expr\Assign $node) { - return $this->pInfixOp(Expr\Assign::class, $node->var, ' = ', $node->expr); - } - - protected function pExpr_AssignRef(Expr\AssignRef $node) { - return $this->pInfixOp(Expr\AssignRef::class, $node->var, ' =& ', $node->expr); - } - - protected function pExpr_AssignOp_Plus(AssignOp\Plus $node) { - return $this->pInfixOp(AssignOp\Plus::class, $node->var, ' += ', $node->expr); - } - - protected function pExpr_AssignOp_Minus(AssignOp\Minus $node) { - return $this->pInfixOp(AssignOp\Minus::class, $node->var, ' -= ', $node->expr); - } - - protected function pExpr_AssignOp_Mul(AssignOp\Mul $node) { - return $this->pInfixOp(AssignOp\Mul::class, $node->var, ' *= ', $node->expr); - } - - protected function pExpr_AssignOp_Div(AssignOp\Div $node) { - return $this->pInfixOp(AssignOp\Div::class, $node->var, ' /= ', $node->expr); - } - - protected function pExpr_AssignOp_Concat(AssignOp\Concat $node) { - return $this->pInfixOp(AssignOp\Concat::class, $node->var, ' .= ', $node->expr); - } - - protected function pExpr_AssignOp_Mod(AssignOp\Mod $node) { - return $this->pInfixOp(AssignOp\Mod::class, $node->var, ' %= ', $node->expr); - } - - protected function pExpr_AssignOp_BitwiseAnd(AssignOp\BitwiseAnd $node) { - return $this->pInfixOp(AssignOp\BitwiseAnd::class, $node->var, ' &= ', $node->expr); - } - - protected function pExpr_AssignOp_BitwiseOr(AssignOp\BitwiseOr $node) { - return $this->pInfixOp(AssignOp\BitwiseOr::class, $node->var, ' |= ', $node->expr); - } - - protected function pExpr_AssignOp_BitwiseXor(AssignOp\BitwiseXor $node) { - return $this->pInfixOp(AssignOp\BitwiseXor::class, $node->var, ' ^= ', $node->expr); - } - - protected function pExpr_AssignOp_ShiftLeft(AssignOp\ShiftLeft $node) { - return $this->pInfixOp(AssignOp\ShiftLeft::class, $node->var, ' <<= ', $node->expr); - } - - protected function pExpr_AssignOp_ShiftRight(AssignOp\ShiftRight $node) { - return $this->pInfixOp(AssignOp\ShiftRight::class, $node->var, ' >>= ', $node->expr); - } - - protected function pExpr_AssignOp_Pow(AssignOp\Pow $node) { - return $this->pInfixOp(AssignOp\Pow::class, $node->var, ' **= ', $node->expr); - } - - protected function pExpr_AssignOp_Coalesce(AssignOp\Coalesce $node) { - return $this->pInfixOp(AssignOp\Coalesce::class, $node->var, ' ??= ', $node->expr); - } - - // Binary expressions - - protected function pExpr_BinaryOp_Plus(BinaryOp\Plus $node) { - return $this->pInfixOp(BinaryOp\Plus::class, $node->left, ' + ', $node->right); - } - - protected function pExpr_BinaryOp_Minus(BinaryOp\Minus $node) { - return $this->pInfixOp(BinaryOp\Minus::class, $node->left, ' - ', $node->right); - } - - protected function pExpr_BinaryOp_Mul(BinaryOp\Mul $node) { - return $this->pInfixOp(BinaryOp\Mul::class, $node->left, ' * ', $node->right); - } - - protected function pExpr_BinaryOp_Div(BinaryOp\Div $node) { - return $this->pInfixOp(BinaryOp\Div::class, $node->left, ' / ', $node->right); - } - - protected function pExpr_BinaryOp_Concat(BinaryOp\Concat $node) { - return $this->pInfixOp(BinaryOp\Concat::class, $node->left, ' . ', $node->right); - } - - protected function pExpr_BinaryOp_Mod(BinaryOp\Mod $node) { - return $this->pInfixOp(BinaryOp\Mod::class, $node->left, ' % ', $node->right); - } - - protected function pExpr_BinaryOp_BooleanAnd(BinaryOp\BooleanAnd $node) { - return $this->pInfixOp(BinaryOp\BooleanAnd::class, $node->left, ' && ', $node->right); - } - - protected function pExpr_BinaryOp_BooleanOr(BinaryOp\BooleanOr $node) { - return $this->pInfixOp(BinaryOp\BooleanOr::class, $node->left, ' || ', $node->right); - } - - protected function pExpr_BinaryOp_BitwiseAnd(BinaryOp\BitwiseAnd $node) { - return $this->pInfixOp(BinaryOp\BitwiseAnd::class, $node->left, ' & ', $node->right); - } - - protected function pExpr_BinaryOp_BitwiseOr(BinaryOp\BitwiseOr $node) { - return $this->pInfixOp(BinaryOp\BitwiseOr::class, $node->left, ' | ', $node->right); - } - - protected function pExpr_BinaryOp_BitwiseXor(BinaryOp\BitwiseXor $node) { - return $this->pInfixOp(BinaryOp\BitwiseXor::class, $node->left, ' ^ ', $node->right); - } - - protected function pExpr_BinaryOp_ShiftLeft(BinaryOp\ShiftLeft $node) { - return $this->pInfixOp(BinaryOp\ShiftLeft::class, $node->left, ' << ', $node->right); - } - - protected function pExpr_BinaryOp_ShiftRight(BinaryOp\ShiftRight $node) { - return $this->pInfixOp(BinaryOp\ShiftRight::class, $node->left, ' >> ', $node->right); - } - - protected function pExpr_BinaryOp_Pow(BinaryOp\Pow $node) { - return $this->pInfixOp(BinaryOp\Pow::class, $node->left, ' ** ', $node->right); - } - - protected function pExpr_BinaryOp_LogicalAnd(BinaryOp\LogicalAnd $node) { - return $this->pInfixOp(BinaryOp\LogicalAnd::class, $node->left, ' and ', $node->right); - } - - protected function pExpr_BinaryOp_LogicalOr(BinaryOp\LogicalOr $node) { - return $this->pInfixOp(BinaryOp\LogicalOr::class, $node->left, ' or ', $node->right); - } - - protected function pExpr_BinaryOp_LogicalXor(BinaryOp\LogicalXor $node) { - return $this->pInfixOp(BinaryOp\LogicalXor::class, $node->left, ' xor ', $node->right); - } - - protected function pExpr_BinaryOp_Equal(BinaryOp\Equal $node) { - return $this->pInfixOp(BinaryOp\Equal::class, $node->left, ' == ', $node->right); - } - - protected function pExpr_BinaryOp_NotEqual(BinaryOp\NotEqual $node) { - return $this->pInfixOp(BinaryOp\NotEqual::class, $node->left, ' != ', $node->right); - } - - protected function pExpr_BinaryOp_Identical(BinaryOp\Identical $node) { - return $this->pInfixOp(BinaryOp\Identical::class, $node->left, ' === ', $node->right); - } - - protected function pExpr_BinaryOp_NotIdentical(BinaryOp\NotIdentical $node) { - return $this->pInfixOp(BinaryOp\NotIdentical::class, $node->left, ' !== ', $node->right); - } - - protected function pExpr_BinaryOp_Spaceship(BinaryOp\Spaceship $node) { - return $this->pInfixOp(BinaryOp\Spaceship::class, $node->left, ' <=> ', $node->right); - } - - protected function pExpr_BinaryOp_Greater(BinaryOp\Greater $node) { - return $this->pInfixOp(BinaryOp\Greater::class, $node->left, ' > ', $node->right); - } - - protected function pExpr_BinaryOp_GreaterOrEqual(BinaryOp\GreaterOrEqual $node) { - return $this->pInfixOp(BinaryOp\GreaterOrEqual::class, $node->left, ' >= ', $node->right); - } - - protected function pExpr_BinaryOp_Smaller(BinaryOp\Smaller $node) { - return $this->pInfixOp(BinaryOp\Smaller::class, $node->left, ' < ', $node->right); - } - - protected function pExpr_BinaryOp_SmallerOrEqual(BinaryOp\SmallerOrEqual $node) { - return $this->pInfixOp(BinaryOp\SmallerOrEqual::class, $node->left, ' <= ', $node->right); - } - - protected function pExpr_BinaryOp_Coalesce(BinaryOp\Coalesce $node) { - return $this->pInfixOp(BinaryOp\Coalesce::class, $node->left, ' ?? ', $node->right); - } - - protected function pExpr_Instanceof(Expr\Instanceof_ $node) { - list($precedence, $associativity) = $this->precedenceMap[Expr\Instanceof_::class]; - return $this->pPrec($node->expr, $precedence, $associativity, -1) - . ' instanceof ' - . $this->pNewVariable($node->class); - } - - // Unary expressions - - protected function pExpr_BooleanNot(Expr\BooleanNot $node) { - return $this->pPrefixOp(Expr\BooleanNot::class, '!', $node->expr); - } - - protected function pExpr_BitwiseNot(Expr\BitwiseNot $node) { - return $this->pPrefixOp(Expr\BitwiseNot::class, '~', $node->expr); - } - - protected function pExpr_UnaryMinus(Expr\UnaryMinus $node) { - if ($node->expr instanceof Expr\UnaryMinus || $node->expr instanceof Expr\PreDec) { - // Enforce -(-$expr) instead of --$expr - return '-(' . $this->p($node->expr) . ')'; - } - return $this->pPrefixOp(Expr\UnaryMinus::class, '-', $node->expr); - } - - protected function pExpr_UnaryPlus(Expr\UnaryPlus $node) { - if ($node->expr instanceof Expr\UnaryPlus || $node->expr instanceof Expr\PreInc) { - // Enforce +(+$expr) instead of ++$expr - return '+(' . $this->p($node->expr) . ')'; - } - return $this->pPrefixOp(Expr\UnaryPlus::class, '+', $node->expr); - } - - protected function pExpr_PreInc(Expr\PreInc $node) { - return $this->pPrefixOp(Expr\PreInc::class, '++', $node->var); - } - - protected function pExpr_PreDec(Expr\PreDec $node) { - return $this->pPrefixOp(Expr\PreDec::class, '--', $node->var); - } - - protected function pExpr_PostInc(Expr\PostInc $node) { - return $this->pPostfixOp(Expr\PostInc::class, $node->var, '++'); - } - - protected function pExpr_PostDec(Expr\PostDec $node) { - return $this->pPostfixOp(Expr\PostDec::class, $node->var, '--'); - } - - protected function pExpr_ErrorSuppress(Expr\ErrorSuppress $node) { - return $this->pPrefixOp(Expr\ErrorSuppress::class, '@', $node->expr); - } - - protected function pExpr_YieldFrom(Expr\YieldFrom $node) { - return $this->pPrefixOp(Expr\YieldFrom::class, 'yield from ', $node->expr); - } - - protected function pExpr_Print(Expr\Print_ $node) { - return $this->pPrefixOp(Expr\Print_::class, 'print ', $node->expr); - } - - // Casts - - protected function pExpr_Cast_Int(Cast\Int_ $node) { - return $this->pPrefixOp(Cast\Int_::class, '(int) ', $node->expr); - } - - protected function pExpr_Cast_Double(Cast\Double $node) { - $kind = $node->getAttribute('kind', Cast\Double::KIND_DOUBLE); - if ($kind === Cast\Double::KIND_DOUBLE) { - $cast = '(double)'; - } elseif ($kind === Cast\Double::KIND_FLOAT) { - $cast = '(float)'; - } elseif ($kind === Cast\Double::KIND_REAL) { - $cast = '(real)'; - } - return $this->pPrefixOp(Cast\Double::class, $cast . ' ', $node->expr); - } - - protected function pExpr_Cast_String(Cast\String_ $node) { - return $this->pPrefixOp(Cast\String_::class, '(string) ', $node->expr); - } - - protected function pExpr_Cast_Array(Cast\Array_ $node) { - return $this->pPrefixOp(Cast\Array_::class, '(array) ', $node->expr); - } - - protected function pExpr_Cast_Object(Cast\Object_ $node) { - return $this->pPrefixOp(Cast\Object_::class, '(object) ', $node->expr); - } - - protected function pExpr_Cast_Bool(Cast\Bool_ $node) { - return $this->pPrefixOp(Cast\Bool_::class, '(bool) ', $node->expr); - } - - protected function pExpr_Cast_Unset(Cast\Unset_ $node) { - return $this->pPrefixOp(Cast\Unset_::class, '(unset) ', $node->expr); - } - - // Function calls and similar constructs - - protected function pExpr_FuncCall(Expr\FuncCall $node) { - return $this->pCallLhs($node->name) - . '(' . $this->pMaybeMultiline($node->args) . ')'; - } - - protected function pExpr_MethodCall(Expr\MethodCall $node) { - return $this->pDereferenceLhs($node->var) . '->' . $this->pObjectProperty($node->name) - . '(' . $this->pMaybeMultiline($node->args) . ')'; - } - - protected function pExpr_NullsafeMethodCall(Expr\NullsafeMethodCall $node) { - return $this->pDereferenceLhs($node->var) . '?->' . $this->pObjectProperty($node->name) - . '(' . $this->pMaybeMultiline($node->args) . ')'; - } - - protected function pExpr_StaticCall(Expr\StaticCall $node) { - return $this->pDereferenceLhs($node->class) . '::' - . ($node->name instanceof Expr - ? ($node->name instanceof Expr\Variable - ? $this->p($node->name) - : '{' . $this->p($node->name) . '}') - : $node->name) - . '(' . $this->pMaybeMultiline($node->args) . ')'; - } - - protected function pExpr_Empty(Expr\Empty_ $node) { - return 'empty(' . $this->p($node->expr) . ')'; - } - - protected function pExpr_Isset(Expr\Isset_ $node) { - return 'isset(' . $this->pCommaSeparated($node->vars) . ')'; - } - - protected function pExpr_Eval(Expr\Eval_ $node) { - return 'eval(' . $this->p($node->expr) . ')'; - } - - protected function pExpr_Include(Expr\Include_ $node) { - static $map = [ - Expr\Include_::TYPE_INCLUDE => 'include', - Expr\Include_::TYPE_INCLUDE_ONCE => 'include_once', - Expr\Include_::TYPE_REQUIRE => 'require', - Expr\Include_::TYPE_REQUIRE_ONCE => 'require_once', - ]; - - return $map[$node->type] . ' ' . $this->p($node->expr); - } - - protected function pExpr_List(Expr\List_ $node) { - return 'list(' . $this->pCommaSeparated($node->items) . ')'; - } - - // Other - - protected function pExpr_Error(Expr\Error $node) { - throw new \LogicException('Cannot pretty-print AST with Error nodes'); - } - - protected function pExpr_Variable(Expr\Variable $node) { - if ($node->name instanceof Expr) { - return '${' . $this->p($node->name) . '}'; - } else { - return '$' . $node->name; - } - } - - protected function pExpr_Array(Expr\Array_ $node) { - $syntax = $node->getAttribute('kind', - $this->options['shortArraySyntax'] ? Expr\Array_::KIND_SHORT : Expr\Array_::KIND_LONG); - if ($syntax === Expr\Array_::KIND_SHORT) { - return '[' . $this->pMaybeMultiline($node->items, true) . ']'; - } else { - return 'array(' . $this->pMaybeMultiline($node->items, true) . ')'; - } - } - - protected function pExpr_ArrayItem(Expr\ArrayItem $node) { - return (null !== $node->key ? $this->p($node->key) . ' => ' : '') - . ($node->byRef ? '&' : '') - . ($node->unpack ? '...' : '') - . $this->p($node->value); - } - - protected function pExpr_ArrayDimFetch(Expr\ArrayDimFetch $node) { - return $this->pDereferenceLhs($node->var) - . '[' . (null !== $node->dim ? $this->p($node->dim) : '') . ']'; - } - - protected function pExpr_ConstFetch(Expr\ConstFetch $node) { - return $this->p($node->name); - } - - protected function pExpr_ClassConstFetch(Expr\ClassConstFetch $node) { - return $this->pDereferenceLhs($node->class) . '::' . $this->p($node->name); - } - - protected function pExpr_PropertyFetch(Expr\PropertyFetch $node) { - return $this->pDereferenceLhs($node->var) . '->' . $this->pObjectProperty($node->name); - } - - protected function pExpr_NullsafePropertyFetch(Expr\NullsafePropertyFetch $node) { - return $this->pDereferenceLhs($node->var) . '?->' . $this->pObjectProperty($node->name); - } - - protected function pExpr_StaticPropertyFetch(Expr\StaticPropertyFetch $node) { - return $this->pDereferenceLhs($node->class) . '::$' . $this->pObjectProperty($node->name); - } - - protected function pExpr_ShellExec(Expr\ShellExec $node) { - return '`' . $this->pEncapsList($node->parts, '`') . '`'; - } - - protected function pExpr_Closure(Expr\Closure $node) { - return $this->pAttrGroups($node->attrGroups, true) - . ($node->static ? 'static ' : '') - . 'function ' . ($node->byRef ? '&' : '') - . '(' . $this->pCommaSeparated($node->params) . ')' - . (!empty($node->uses) ? ' use(' . $this->pCommaSeparated($node->uses) . ')' : '') - . (null !== $node->returnType ? ' : ' . $this->p($node->returnType) : '') - . ' {' . $this->pStmts($node->stmts) . $this->nl . '}'; - } - - protected function pExpr_Match(Expr\Match_ $node) { - return 'match (' . $this->p($node->cond) . ') {' - . $this->pCommaSeparatedMultiline($node->arms, true) - . $this->nl - . '}'; - } - - protected function pMatchArm(Node\MatchArm $node) { - return ($node->conds ? $this->pCommaSeparated($node->conds) : 'default') - . ' => ' . $this->p($node->body); - } - - protected function pExpr_ArrowFunction(Expr\ArrowFunction $node) { - return $this->pAttrGroups($node->attrGroups, true) - . ($node->static ? 'static ' : '') - . 'fn' . ($node->byRef ? '&' : '') - . '(' . $this->pCommaSeparated($node->params) . ')' - . (null !== $node->returnType ? ': ' . $this->p($node->returnType) : '') - . ' => ' - . $this->p($node->expr); - } - - protected function pExpr_ClosureUse(Expr\ClosureUse $node) { - return ($node->byRef ? '&' : '') . $this->p($node->var); - } - - protected function pExpr_New(Expr\New_ $node) { - if ($node->class instanceof Stmt\Class_) { - $args = $node->args ? '(' . $this->pMaybeMultiline($node->args) . ')' : ''; - return 'new ' . $this->pClassCommon($node->class, $args); - } - return 'new ' . $this->pNewVariable($node->class) - . '(' . $this->pMaybeMultiline($node->args) . ')'; - } - - protected function pExpr_Clone(Expr\Clone_ $node) { - return 'clone ' . $this->p($node->expr); - } - - protected function pExpr_Ternary(Expr\Ternary $node) { - // a bit of cheating: we treat the ternary as a binary op where the ?...: part is the operator. - // this is okay because the part between ? and : never needs parentheses. - return $this->pInfixOp(Expr\Ternary::class, - $node->cond, ' ?' . (null !== $node->if ? ' ' . $this->p($node->if) . ' ' : '') . ': ', $node->else - ); - } - - protected function pExpr_Exit(Expr\Exit_ $node) { - $kind = $node->getAttribute('kind', Expr\Exit_::KIND_DIE); - return ($kind === Expr\Exit_::KIND_EXIT ? 'exit' : 'die') - . (null !== $node->expr ? '(' . $this->p($node->expr) . ')' : ''); - } - - protected function pExpr_Throw(Expr\Throw_ $node) { - return 'throw ' . $this->p($node->expr); - } - - protected function pExpr_Yield(Expr\Yield_ $node) { - if ($node->value === null) { - return 'yield'; - } else { - // this is a bit ugly, but currently there is no way to detect whether the parentheses are necessary - return '(yield ' - . ($node->key !== null ? $this->p($node->key) . ' => ' : '') - . $this->p($node->value) - . ')'; - } - } - - // Declarations - - protected function pStmt_Namespace(Stmt\Namespace_ $node) { - if ($this->canUseSemicolonNamespaces) { - return 'namespace ' . $this->p($node->name) . ';' - . $this->nl . $this->pStmts($node->stmts, false); - } else { - return 'namespace' . (null !== $node->name ? ' ' . $this->p($node->name) : '') - . ' {' . $this->pStmts($node->stmts) . $this->nl . '}'; - } - } - - protected function pStmt_Use(Stmt\Use_ $node) { - return 'use ' . $this->pUseType($node->type) - . $this->pCommaSeparated($node->uses) . ';'; - } - - protected function pStmt_GroupUse(Stmt\GroupUse $node) { - return 'use ' . $this->pUseType($node->type) . $this->pName($node->prefix) - . '\{' . $this->pCommaSeparated($node->uses) . '};'; - } - - protected function pStmt_UseUse(Stmt\UseUse $node) { - return $this->pUseType($node->type) . $this->p($node->name) - . (null !== $node->alias ? ' as ' . $node->alias : ''); - } - - protected function pUseType($type) { - return $type === Stmt\Use_::TYPE_FUNCTION ? 'function ' - : ($type === Stmt\Use_::TYPE_CONSTANT ? 'const ' : ''); - } - - protected function pStmt_Interface(Stmt\Interface_ $node) { - return $this->pAttrGroups($node->attrGroups) - . 'interface ' . $node->name - . (!empty($node->extends) ? ' extends ' . $this->pCommaSeparated($node->extends) : '') - . $this->nl . '{' . $this->pStmts($node->stmts) . $this->nl . '}'; - } - - protected function pStmt_Enum(Stmt\Enum_ $node) { - return $this->pAttrGroups($node->attrGroups) - . 'enum ' . $node->name - . ($node->scalarType ? " : $node->scalarType" : '') - . (!empty($node->implements) ? ' implements ' . $this->pCommaSeparated($node->implements) : '') - . $this->nl . '{' . $this->pStmts($node->stmts) . $this->nl . '}'; - } - - protected function pStmt_Class(Stmt\Class_ $node) { - return $this->pClassCommon($node, ' ' . $node->name); - } - - protected function pStmt_Trait(Stmt\Trait_ $node) { - return $this->pAttrGroups($node->attrGroups) - . 'trait ' . $node->name - . $this->nl . '{' . $this->pStmts($node->stmts) . $this->nl . '}'; - } - - protected function pStmt_EnumCase(Stmt\EnumCase $node) { - return $this->pAttrGroups($node->attrGroups) - . 'case ' . $node->name - . ($node->expr ? ' = ' . $this->p($node->expr) : '') - . ';'; - } - - protected function pStmt_TraitUse(Stmt\TraitUse $node) { - return 'use ' . $this->pCommaSeparated($node->traits) - . (empty($node->adaptations) - ? ';' - : ' {' . $this->pStmts($node->adaptations) . $this->nl . '}'); - } - - protected function pStmt_TraitUseAdaptation_Precedence(Stmt\TraitUseAdaptation\Precedence $node) { - return $this->p($node->trait) . '::' . $node->method - . ' insteadof ' . $this->pCommaSeparated($node->insteadof) . ';'; - } - - protected function pStmt_TraitUseAdaptation_Alias(Stmt\TraitUseAdaptation\Alias $node) { - return (null !== $node->trait ? $this->p($node->trait) . '::' : '') - . $node->method . ' as' - . (null !== $node->newModifier ? ' ' . rtrim($this->pModifiers($node->newModifier), ' ') : '') - . (null !== $node->newName ? ' ' . $node->newName : '') - . ';'; - } - - protected function pStmt_Property(Stmt\Property $node) { - return $this->pAttrGroups($node->attrGroups) - . (0 === $node->flags ? 'var ' : $this->pModifiers($node->flags)) - . ($node->type ? $this->p($node->type) . ' ' : '') - . $this->pCommaSeparated($node->props) . ';'; - } - - protected function pStmt_PropertyProperty(Stmt\PropertyProperty $node) { - return '$' . $node->name - . (null !== $node->default ? ' = ' . $this->p($node->default) : ''); - } - - protected function pStmt_ClassMethod(Stmt\ClassMethod $node) { - return $this->pAttrGroups($node->attrGroups) - . $this->pModifiers($node->flags) - . 'function ' . ($node->byRef ? '&' : '') . $node->name - . '(' . $this->pMaybeMultiline($node->params) . ')' - . (null !== $node->returnType ? ' : ' . $this->p($node->returnType) : '') - . (null !== $node->stmts - ? $this->nl . '{' . $this->pStmts($node->stmts) . $this->nl . '}' - : ';'); - } - - protected function pStmt_ClassConst(Stmt\ClassConst $node) { - return $this->pAttrGroups($node->attrGroups) - . $this->pModifiers($node->flags) - . 'const ' . $this->pCommaSeparated($node->consts) . ';'; - } - - protected function pStmt_Function(Stmt\Function_ $node) { - return $this->pAttrGroups($node->attrGroups) - . 'function ' . ($node->byRef ? '&' : '') . $node->name - . '(' . $this->pCommaSeparated($node->params) . ')' - . (null !== $node->returnType ? ' : ' . $this->p($node->returnType) : '') - . $this->nl . '{' . $this->pStmts($node->stmts) . $this->nl . '}'; - } - - protected function pStmt_Const(Stmt\Const_ $node) { - return 'const ' . $this->pCommaSeparated($node->consts) . ';'; - } - - protected function pStmt_Declare(Stmt\Declare_ $node) { - return 'declare (' . $this->pCommaSeparated($node->declares) . ')' - . (null !== $node->stmts ? ' {' . $this->pStmts($node->stmts) . $this->nl . '}' : ';'); - } - - protected function pStmt_DeclareDeclare(Stmt\DeclareDeclare $node) { - return $node->key . '=' . $this->p($node->value); - } - - // Control flow - - protected function pStmt_If(Stmt\If_ $node) { - return 'if (' . $this->p($node->cond) . ') {' - . $this->pStmts($node->stmts) . $this->nl . '}' - . ($node->elseifs ? ' ' . $this->pImplode($node->elseifs, ' ') : '') - . (null !== $node->else ? ' ' . $this->p($node->else) : ''); - } - - protected function pStmt_ElseIf(Stmt\ElseIf_ $node) { - return 'elseif (' . $this->p($node->cond) . ') {' - . $this->pStmts($node->stmts) . $this->nl . '}'; - } - - protected function pStmt_Else(Stmt\Else_ $node) { - return 'else {' . $this->pStmts($node->stmts) . $this->nl . '}'; - } - - protected function pStmt_For(Stmt\For_ $node) { - return 'for (' - . $this->pCommaSeparated($node->init) . ';' . (!empty($node->cond) ? ' ' : '') - . $this->pCommaSeparated($node->cond) . ';' . (!empty($node->loop) ? ' ' : '') - . $this->pCommaSeparated($node->loop) - . ') {' . $this->pStmts($node->stmts) . $this->nl . '}'; - } - - protected function pStmt_Foreach(Stmt\Foreach_ $node) { - return 'foreach (' . $this->p($node->expr) . ' as ' - . (null !== $node->keyVar ? $this->p($node->keyVar) . ' => ' : '') - . ($node->byRef ? '&' : '') . $this->p($node->valueVar) . ') {' - . $this->pStmts($node->stmts) . $this->nl . '}'; - } - - protected function pStmt_While(Stmt\While_ $node) { - return 'while (' . $this->p($node->cond) . ') {' - . $this->pStmts($node->stmts) . $this->nl . '}'; - } - - protected function pStmt_Do(Stmt\Do_ $node) { - return 'do {' . $this->pStmts($node->stmts) . $this->nl - . '} while (' . $this->p($node->cond) . ');'; - } - - protected function pStmt_Switch(Stmt\Switch_ $node) { - return 'switch (' . $this->p($node->cond) . ') {' - . $this->pStmts($node->cases) . $this->nl . '}'; - } - - protected function pStmt_Case(Stmt\Case_ $node) { - return (null !== $node->cond ? 'case ' . $this->p($node->cond) : 'default') . ':' - . $this->pStmts($node->stmts); - } - - protected function pStmt_TryCatch(Stmt\TryCatch $node) { - return 'try {' . $this->pStmts($node->stmts) . $this->nl . '}' - . ($node->catches ? ' ' . $this->pImplode($node->catches, ' ') : '') - . ($node->finally !== null ? ' ' . $this->p($node->finally) : ''); - } - - protected function pStmt_Catch(Stmt\Catch_ $node) { - return 'catch (' . $this->pImplode($node->types, '|') - . ($node->var !== null ? ' ' . $this->p($node->var) : '') - . ') {' . $this->pStmts($node->stmts) . $this->nl . '}'; - } - - protected function pStmt_Finally(Stmt\Finally_ $node) { - return 'finally {' . $this->pStmts($node->stmts) . $this->nl . '}'; - } - - protected function pStmt_Break(Stmt\Break_ $node) { - return 'break' . ($node->num !== null ? ' ' . $this->p($node->num) : '') . ';'; - } - - protected function pStmt_Continue(Stmt\Continue_ $node) { - return 'continue' . ($node->num !== null ? ' ' . $this->p($node->num) : '') . ';'; - } - - protected function pStmt_Return(Stmt\Return_ $node) { - return 'return' . (null !== $node->expr ? ' ' . $this->p($node->expr) : '') . ';'; - } - - protected function pStmt_Throw(Stmt\Throw_ $node) { - return 'throw ' . $this->p($node->expr) . ';'; - } - - protected function pStmt_Label(Stmt\Label $node) { - return $node->name . ':'; - } - - protected function pStmt_Goto(Stmt\Goto_ $node) { - return 'goto ' . $node->name . ';'; - } - - // Other - - protected function pStmt_Expression(Stmt\Expression $node) { - return $this->p($node->expr) . ';'; - } - - protected function pStmt_Echo(Stmt\Echo_ $node) { - return 'echo ' . $this->pCommaSeparated($node->exprs) . ';'; - } - - protected function pStmt_Static(Stmt\Static_ $node) { - return 'static ' . $this->pCommaSeparated($node->vars) . ';'; - } - - protected function pStmt_Global(Stmt\Global_ $node) { - return 'global ' . $this->pCommaSeparated($node->vars) . ';'; - } - - protected function pStmt_StaticVar(Stmt\StaticVar $node) { - return $this->p($node->var) - . (null !== $node->default ? ' = ' . $this->p($node->default) : ''); - } - - protected function pStmt_Unset(Stmt\Unset_ $node) { - return 'unset(' . $this->pCommaSeparated($node->vars) . ');'; - } - - protected function pStmt_InlineHTML(Stmt\InlineHTML $node) { - $newline = $node->getAttribute('hasLeadingNewline', true) ? "\n" : ''; - return '?>' . $newline . $node->value . 'remaining; - } - - protected function pStmt_Nop(Stmt\Nop $node) { - return ''; - } - - // Helpers - - protected function pClassCommon(Stmt\Class_ $node, $afterClassToken) { - return $this->pAttrGroups($node->attrGroups, $node->name === null) - . $this->pModifiers($node->flags) - . 'class' . $afterClassToken - . (null !== $node->extends ? ' extends ' . $this->p($node->extends) : '') - . (!empty($node->implements) ? ' implements ' . $this->pCommaSeparated($node->implements) : '') - . $this->nl . '{' . $this->pStmts($node->stmts) . $this->nl . '}'; - } - - protected function pObjectProperty($node) { - if ($node instanceof Expr) { - return '{' . $this->p($node) . '}'; - } else { - return $node; - } - } - - protected function pEncapsList(array $encapsList, $quote) { - $return = ''; - foreach ($encapsList as $element) { - if ($element instanceof Scalar\EncapsedStringPart) { - $return .= $this->escapeString($element->value, $quote); - } else { - $return .= '{' . $this->p($element) . '}'; - } - } - - return $return; - } - - protected function pSingleQuotedString(string $string) { - return '\'' . addcslashes($string, '\'\\') . '\''; - } - - protected function escapeString($string, $quote) { - if (null === $quote) { - // For doc strings, don't escape newlines - $escaped = addcslashes($string, "\t\f\v$\\"); - } else { - $escaped = addcslashes($string, "\n\r\t\f\v$" . $quote . "\\"); - } - - // Escape control characters and non-UTF-8 characters. - // Regex based on https://stackoverflow.com/a/11709412/385378. - $regex = '/( - [\x00-\x08\x0E-\x1F] # Control characters - | [\xC0-\xC1] # Invalid UTF-8 Bytes - | [\xF5-\xFF] # Invalid UTF-8 Bytes - | \xE0(?=[\x80-\x9F]) # Overlong encoding of prior code point - | \xF0(?=[\x80-\x8F]) # Overlong encoding of prior code point - | [\xC2-\xDF](?![\x80-\xBF]) # Invalid UTF-8 Sequence Start - | [\xE0-\xEF](?![\x80-\xBF]{2}) # Invalid UTF-8 Sequence Start - | [\xF0-\xF4](?![\x80-\xBF]{3}) # Invalid UTF-8 Sequence Start - | (?<=[\x00-\x7F\xF5-\xFF])[\x80-\xBF] # Invalid UTF-8 Sequence Middle - | (? $part) { - $atStart = $i === 0; - $atEnd = $i === count($parts) - 1; - if ($part instanceof Scalar\EncapsedStringPart - && $this->containsEndLabel($part->value, $label, $atStart, $atEnd) - ) { - return true; - } - } - return false; - } - - protected function pDereferenceLhs(Node $node) { - if (!$this->dereferenceLhsRequiresParens($node)) { - return $this->p($node); - } else { - return '(' . $this->p($node) . ')'; - } - } - - protected function pCallLhs(Node $node) { - if (!$this->callLhsRequiresParens($node)) { - return $this->p($node); - } else { - return '(' . $this->p($node) . ')'; - } - } - - protected function pNewVariable(Node $node) { - // TODO: This is not fully accurate. - return $this->pDereferenceLhs($node); - } - - /** - * @param Node[] $nodes - * @return bool - */ - protected function hasNodeWithComments(array $nodes) { - foreach ($nodes as $node) { - if ($node && $node->getComments()) { - return true; - } - } - return false; - } - - protected function pMaybeMultiline(array $nodes, bool $trailingComma = false) { - if (!$this->hasNodeWithComments($nodes)) { - return $this->pCommaSeparated($nodes); - } else { - return $this->pCommaSeparatedMultiline($nodes, $trailingComma) . $this->nl; - } - } - - protected function pAttrGroups(array $nodes, bool $inline = false): string { - $result = ''; - $sep = $inline ? ' ' : $this->nl; - foreach ($nodes as $node) { - $result .= $this->p($node) . $sep; - } - - return $result; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php b/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php deleted file mode 100644 index 2c7fc30..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php +++ /dev/null @@ -1,1506 +0,0 @@ - [ 0, 1], - Expr\BitwiseNot::class => [ 10, 1], - Expr\PreInc::class => [ 10, 1], - Expr\PreDec::class => [ 10, 1], - Expr\PostInc::class => [ 10, -1], - Expr\PostDec::class => [ 10, -1], - Expr\UnaryPlus::class => [ 10, 1], - Expr\UnaryMinus::class => [ 10, 1], - Cast\Int_::class => [ 10, 1], - Cast\Double::class => [ 10, 1], - Cast\String_::class => [ 10, 1], - Cast\Array_::class => [ 10, 1], - Cast\Object_::class => [ 10, 1], - Cast\Bool_::class => [ 10, 1], - Cast\Unset_::class => [ 10, 1], - Expr\ErrorSuppress::class => [ 10, 1], - Expr\Instanceof_::class => [ 20, 0], - Expr\BooleanNot::class => [ 30, 1], - BinaryOp\Mul::class => [ 40, -1], - BinaryOp\Div::class => [ 40, -1], - BinaryOp\Mod::class => [ 40, -1], - BinaryOp\Plus::class => [ 50, -1], - BinaryOp\Minus::class => [ 50, -1], - BinaryOp\Concat::class => [ 50, -1], - BinaryOp\ShiftLeft::class => [ 60, -1], - BinaryOp\ShiftRight::class => [ 60, -1], - BinaryOp\Smaller::class => [ 70, 0], - BinaryOp\SmallerOrEqual::class => [ 70, 0], - BinaryOp\Greater::class => [ 70, 0], - BinaryOp\GreaterOrEqual::class => [ 70, 0], - BinaryOp\Equal::class => [ 80, 0], - BinaryOp\NotEqual::class => [ 80, 0], - BinaryOp\Identical::class => [ 80, 0], - BinaryOp\NotIdentical::class => [ 80, 0], - BinaryOp\Spaceship::class => [ 80, 0], - BinaryOp\BitwiseAnd::class => [ 90, -1], - BinaryOp\BitwiseXor::class => [100, -1], - BinaryOp\BitwiseOr::class => [110, -1], - BinaryOp\BooleanAnd::class => [120, -1], - BinaryOp\BooleanOr::class => [130, -1], - BinaryOp\Coalesce::class => [140, 1], - Expr\Ternary::class => [150, 0], - // parser uses %left for assignments, but they really behave as %right - Expr\Assign::class => [160, 1], - Expr\AssignRef::class => [160, 1], - AssignOp\Plus::class => [160, 1], - AssignOp\Minus::class => [160, 1], - AssignOp\Mul::class => [160, 1], - AssignOp\Div::class => [160, 1], - AssignOp\Concat::class => [160, 1], - AssignOp\Mod::class => [160, 1], - AssignOp\BitwiseAnd::class => [160, 1], - AssignOp\BitwiseOr::class => [160, 1], - AssignOp\BitwiseXor::class => [160, 1], - AssignOp\ShiftLeft::class => [160, 1], - AssignOp\ShiftRight::class => [160, 1], - AssignOp\Pow::class => [160, 1], - AssignOp\Coalesce::class => [160, 1], - Expr\YieldFrom::class => [165, 1], - Expr\Print_::class => [168, 1], - BinaryOp\LogicalAnd::class => [170, -1], - BinaryOp\LogicalXor::class => [180, -1], - BinaryOp\LogicalOr::class => [190, -1], - Expr\Include_::class => [200, -1], - ]; - - /** @var int Current indentation level. */ - protected $indentLevel; - /** @var string Newline including current indentation. */ - protected $nl; - /** @var string Token placed at end of doc string to ensure it is followed by a newline. */ - protected $docStringEndToken; - /** @var bool Whether semicolon namespaces can be used (i.e. no global namespace is used) */ - protected $canUseSemicolonNamespaces; - /** @var array Pretty printer options */ - protected $options; - - /** @var TokenStream Original tokens for use in format-preserving pretty print */ - protected $origTokens; - /** @var Internal\Differ Differ for node lists */ - protected $nodeListDiffer; - /** @var bool[] Map determining whether a certain character is a label character */ - protected $labelCharMap; - /** - * @var int[][] Map from token classes and subnode names to FIXUP_* constants. This is used - * during format-preserving prints to place additional parens/braces if necessary. - */ - protected $fixupMap; - /** - * @var int[][] Map from "{$node->getType()}->{$subNode}" to ['left' => $l, 'right' => $r], - * where $l and $r specify the token type that needs to be stripped when removing - * this node. - */ - protected $removalMap; - /** - * @var mixed[] Map from "{$node->getType()}->{$subNode}" to [$find, $beforeToken, $extraLeft, $extraRight]. - * $find is an optional token after which the insertion occurs. $extraLeft/Right - * are optionally added before/after the main insertions. - */ - protected $insertionMap; - /** - * @var string[] Map From "{$node->getType()}->{$subNode}" to string that should be inserted - * between elements of this list subnode. - */ - protected $listInsertionMap; - protected $emptyListInsertionMap; - /** @var int[] Map from "{$node->getType()}->{$subNode}" to token before which the modifiers - * should be reprinted. */ - protected $modifierChangeMap; - - /** - * Creates a pretty printer instance using the given options. - * - * Supported options: - * * bool $shortArraySyntax = false: Whether to use [] instead of array() as the default array - * syntax, if the node does not specify a format. - * - * @param array $options Dictionary of formatting options - */ - public function __construct(array $options = []) { - $this->docStringEndToken = '_DOC_STRING_END_' . mt_rand(); - - $defaultOptions = ['shortArraySyntax' => false]; - $this->options = $options + $defaultOptions; - } - - /** - * Reset pretty printing state. - */ - protected function resetState() { - $this->indentLevel = 0; - $this->nl = "\n"; - $this->origTokens = null; - } - - /** - * Set indentation level - * - * @param int $level Level in number of spaces - */ - protected function setIndentLevel(int $level) { - $this->indentLevel = $level; - $this->nl = "\n" . \str_repeat(' ', $level); - } - - /** - * Increase indentation level. - */ - protected function indent() { - $this->indentLevel += 4; - $this->nl .= ' '; - } - - /** - * Decrease indentation level. - */ - protected function outdent() { - assert($this->indentLevel >= 4); - $this->indentLevel -= 4; - $this->nl = "\n" . str_repeat(' ', $this->indentLevel); - } - - /** - * Pretty prints an array of statements. - * - * @param Node[] $stmts Array of statements - * - * @return string Pretty printed statements - */ - public function prettyPrint(array $stmts) : string { - $this->resetState(); - $this->preprocessNodes($stmts); - - return ltrim($this->handleMagicTokens($this->pStmts($stmts, false))); - } - - /** - * Pretty prints an expression. - * - * @param Expr $node Expression node - * - * @return string Pretty printed node - */ - public function prettyPrintExpr(Expr $node) : string { - $this->resetState(); - return $this->handleMagicTokens($this->p($node)); - } - - /** - * Pretty prints a file of statements (includes the opening prettyPrint($stmts); - - if ($stmts[0] instanceof Stmt\InlineHTML) { - $p = preg_replace('/^<\?php\s+\?>\n?/', '', $p); - } - if ($stmts[count($stmts) - 1] instanceof Stmt\InlineHTML) { - $p = preg_replace('/<\?php$/', '', rtrim($p)); - } - - return $p; - } - - /** - * Preprocesses the top-level nodes to initialize pretty printer state. - * - * @param Node[] $nodes Array of nodes - */ - protected function preprocessNodes(array $nodes) { - /* We can use semicolon-namespaces unless there is a global namespace declaration */ - $this->canUseSemicolonNamespaces = true; - foreach ($nodes as $node) { - if ($node instanceof Stmt\Namespace_ && null === $node->name) { - $this->canUseSemicolonNamespaces = false; - break; - } - } - } - - /** - * Handles (and removes) no-indent and doc-string-end tokens. - * - * @param string $str - * @return string - */ - protected function handleMagicTokens(string $str) : string { - // Replace doc-string-end tokens with nothing or a newline - $str = str_replace($this->docStringEndToken . ";\n", ";\n", $str); - $str = str_replace($this->docStringEndToken, "\n", $str); - - return $str; - } - - /** - * Pretty prints an array of nodes (statements) and indents them optionally. - * - * @param Node[] $nodes Array of nodes - * @param bool $indent Whether to indent the printed nodes - * - * @return string Pretty printed statements - */ - protected function pStmts(array $nodes, bool $indent = true) : string { - if ($indent) { - $this->indent(); - } - - $result = ''; - foreach ($nodes as $node) { - $comments = $node->getComments(); - if ($comments) { - $result .= $this->nl . $this->pComments($comments); - if ($node instanceof Stmt\Nop) { - continue; - } - } - - $result .= $this->nl . $this->p($node); - } - - if ($indent) { - $this->outdent(); - } - - return $result; - } - - /** - * Pretty-print an infix operation while taking precedence into account. - * - * @param string $class Node class of operator - * @param Node $leftNode Left-hand side node - * @param string $operatorString String representation of the operator - * @param Node $rightNode Right-hand side node - * - * @return string Pretty printed infix operation - */ - protected function pInfixOp(string $class, Node $leftNode, string $operatorString, Node $rightNode) : string { - list($precedence, $associativity) = $this->precedenceMap[$class]; - - return $this->pPrec($leftNode, $precedence, $associativity, -1) - . $operatorString - . $this->pPrec($rightNode, $precedence, $associativity, 1); - } - - /** - * Pretty-print a prefix operation while taking precedence into account. - * - * @param string $class Node class of operator - * @param string $operatorString String representation of the operator - * @param Node $node Node - * - * @return string Pretty printed prefix operation - */ - protected function pPrefixOp(string $class, string $operatorString, Node $node) : string { - list($precedence, $associativity) = $this->precedenceMap[$class]; - return $operatorString . $this->pPrec($node, $precedence, $associativity, 1); - } - - /** - * Pretty-print a postfix operation while taking precedence into account. - * - * @param string $class Node class of operator - * @param string $operatorString String representation of the operator - * @param Node $node Node - * - * @return string Pretty printed postfix operation - */ - protected function pPostfixOp(string $class, Node $node, string $operatorString) : string { - list($precedence, $associativity) = $this->precedenceMap[$class]; - return $this->pPrec($node, $precedence, $associativity, -1) . $operatorString; - } - - /** - * Prints an expression node with the least amount of parentheses necessary to preserve the meaning. - * - * @param Node $node Node to pretty print - * @param int $parentPrecedence Precedence of the parent operator - * @param int $parentAssociativity Associativity of parent operator - * (-1 is left, 0 is nonassoc, 1 is right) - * @param int $childPosition Position of the node relative to the operator - * (-1 is left, 1 is right) - * - * @return string The pretty printed node - */ - protected function pPrec(Node $node, int $parentPrecedence, int $parentAssociativity, int $childPosition) : string { - $class = \get_class($node); - if (isset($this->precedenceMap[$class])) { - $childPrecedence = $this->precedenceMap[$class][0]; - if ($childPrecedence > $parentPrecedence - || ($parentPrecedence === $childPrecedence && $parentAssociativity !== $childPosition) - ) { - return '(' . $this->p($node) . ')'; - } - } - - return $this->p($node); - } - - /** - * Pretty prints an array of nodes and implodes the printed values. - * - * @param Node[] $nodes Array of Nodes to be printed - * @param string $glue Character to implode with - * - * @return string Imploded pretty printed nodes - */ - protected function pImplode(array $nodes, string $glue = '') : string { - $pNodes = []; - foreach ($nodes as $node) { - if (null === $node) { - $pNodes[] = ''; - } else { - $pNodes[] = $this->p($node); - } - } - - return implode($glue, $pNodes); - } - - /** - * Pretty prints an array of nodes and implodes the printed values with commas. - * - * @param Node[] $nodes Array of Nodes to be printed - * - * @return string Comma separated pretty printed nodes - */ - protected function pCommaSeparated(array $nodes) : string { - return $this->pImplode($nodes, ', '); - } - - /** - * Pretty prints a comma-separated list of nodes in multiline style, including comments. - * - * The result includes a leading newline and one level of indentation (same as pStmts). - * - * @param Node[] $nodes Array of Nodes to be printed - * @param bool $trailingComma Whether to use a trailing comma - * - * @return string Comma separated pretty printed nodes in multiline style - */ - protected function pCommaSeparatedMultiline(array $nodes, bool $trailingComma) : string { - $this->indent(); - - $result = ''; - $lastIdx = count($nodes) - 1; - foreach ($nodes as $idx => $node) { - if ($node !== null) { - $comments = $node->getComments(); - if ($comments) { - $result .= $this->nl . $this->pComments($comments); - } - - $result .= $this->nl . $this->p($node); - } else { - $result .= $this->nl; - } - if ($trailingComma || $idx !== $lastIdx) { - $result .= ','; - } - } - - $this->outdent(); - return $result; - } - - /** - * Prints reformatted text of the passed comments. - * - * @param Comment[] $comments List of comments - * - * @return string Reformatted text of comments - */ - protected function pComments(array $comments) : string { - $formattedComments = []; - - foreach ($comments as $comment) { - $formattedComments[] = str_replace("\n", $this->nl, $comment->getReformattedText()); - } - - return implode($this->nl, $formattedComments); - } - - /** - * Perform a format-preserving pretty print of an AST. - * - * The format preservation is best effort. For some changes to the AST the formatting will not - * be preserved (at least not locally). - * - * In order to use this method a number of prerequisites must be satisfied: - * * The startTokenPos and endTokenPos attributes in the lexer must be enabled. - * * The CloningVisitor must be run on the AST prior to modification. - * * The original tokens must be provided, using the getTokens() method on the lexer. - * - * @param Node[] $stmts Modified AST with links to original AST - * @param Node[] $origStmts Original AST with token offset information - * @param array $origTokens Tokens of the original code - * - * @return string - */ - public function printFormatPreserving(array $stmts, array $origStmts, array $origTokens) : string { - $this->initializeNodeListDiffer(); - $this->initializeLabelCharMap(); - $this->initializeFixupMap(); - $this->initializeRemovalMap(); - $this->initializeInsertionMap(); - $this->initializeListInsertionMap(); - $this->initializeEmptyListInsertionMap(); - $this->initializeModifierChangeMap(); - - $this->resetState(); - $this->origTokens = new TokenStream($origTokens); - - $this->preprocessNodes($stmts); - - $pos = 0; - $result = $this->pArray($stmts, $origStmts, $pos, 0, 'File', 'stmts', null); - if (null !== $result) { - $result .= $this->origTokens->getTokenCode($pos, count($origTokens), 0); - } else { - // Fallback - // TODO Add pStmts($stmts, false); - } - - return ltrim($this->handleMagicTokens($result)); - } - - protected function pFallback(Node $node) { - return $this->{'p' . $node->getType()}($node); - } - - /** - * Pretty prints a node. - * - * This method also handles formatting preservation for nodes. - * - * @param Node $node Node to be pretty printed - * @param bool $parentFormatPreserved Whether parent node has preserved formatting - * - * @return string Pretty printed node - */ - protected function p(Node $node, $parentFormatPreserved = false) : string { - // No orig tokens means this is a normal pretty print without preservation of formatting - if (!$this->origTokens) { - return $this->{'p' . $node->getType()}($node); - } - - /** @var Node $origNode */ - $origNode = $node->getAttribute('origNode'); - if (null === $origNode) { - return $this->pFallback($node); - } - - $class = \get_class($node); - \assert($class === \get_class($origNode)); - - $startPos = $origNode->getStartTokenPos(); - $endPos = $origNode->getEndTokenPos(); - \assert($startPos >= 0 && $endPos >= 0); - - $fallbackNode = $node; - if ($node instanceof Expr\New_ && $node->class instanceof Stmt\Class_) { - // Normalize node structure of anonymous classes - $node = PrintableNewAnonClassNode::fromNewNode($node); - $origNode = PrintableNewAnonClassNode::fromNewNode($origNode); - } - - // InlineHTML node does not contain closing and opening PHP tags. If the parent formatting - // is not preserved, then we need to use the fallback code to make sure the tags are - // printed. - if ($node instanceof Stmt\InlineHTML && !$parentFormatPreserved) { - return $this->pFallback($fallbackNode); - } - - $indentAdjustment = $this->indentLevel - $this->origTokens->getIndentationBefore($startPos); - - $type = $node->getType(); - $fixupInfo = $this->fixupMap[$class] ?? null; - - $result = ''; - $pos = $startPos; - foreach ($node->getSubNodeNames() as $subNodeName) { - $subNode = $node->$subNodeName; - $origSubNode = $origNode->$subNodeName; - - if ((!$subNode instanceof Node && $subNode !== null) - || (!$origSubNode instanceof Node && $origSubNode !== null) - ) { - if ($subNode === $origSubNode) { - // Unchanged, can reuse old code - continue; - } - - if (is_array($subNode) && is_array($origSubNode)) { - // Array subnode changed, we might be able to reconstruct it - $listResult = $this->pArray( - $subNode, $origSubNode, $pos, $indentAdjustment, $type, $subNodeName, - $fixupInfo[$subNodeName] ?? null - ); - if (null === $listResult) { - return $this->pFallback($fallbackNode); - } - - $result .= $listResult; - continue; - } - - if (is_int($subNode) && is_int($origSubNode)) { - // Check if this is a modifier change - $key = $type . '->' . $subNodeName; - if (!isset($this->modifierChangeMap[$key])) { - return $this->pFallback($fallbackNode); - } - - $findToken = $this->modifierChangeMap[$key]; - $result .= $this->pModifiers($subNode); - $pos = $this->origTokens->findRight($pos, $findToken); - continue; - } - - // If a non-node, non-array subnode changed, we don't be able to do a partial - // reconstructions, as we don't have enough offset information. Pretty print the - // whole node instead. - return $this->pFallback($fallbackNode); - } - - $extraLeft = ''; - $extraRight = ''; - if ($origSubNode !== null) { - $subStartPos = $origSubNode->getStartTokenPos(); - $subEndPos = $origSubNode->getEndTokenPos(); - \assert($subStartPos >= 0 && $subEndPos >= 0); - } else { - if ($subNode === null) { - // Both null, nothing to do - continue; - } - - // A node has been inserted, check if we have insertion information for it - $key = $type . '->' . $subNodeName; - if (!isset($this->insertionMap[$key])) { - return $this->pFallback($fallbackNode); - } - - list($findToken, $beforeToken, $extraLeft, $extraRight) = $this->insertionMap[$key]; - if (null !== $findToken) { - $subStartPos = $this->origTokens->findRight($pos, $findToken) - + (int) !$beforeToken; - } else { - $subStartPos = $pos; - } - - if (null === $extraLeft && null !== $extraRight) { - // If inserting on the right only, skipping whitespace looks better - $subStartPos = $this->origTokens->skipRightWhitespace($subStartPos); - } - $subEndPos = $subStartPos - 1; - } - - if (null === $subNode) { - // A node has been removed, check if we have removal information for it - $key = $type . '->' . $subNodeName; - if (!isset($this->removalMap[$key])) { - return $this->pFallback($fallbackNode); - } - - // Adjust positions to account for additional tokens that must be skipped - $removalInfo = $this->removalMap[$key]; - if (isset($removalInfo['left'])) { - $subStartPos = $this->origTokens->skipLeft($subStartPos - 1, $removalInfo['left']) + 1; - } - if (isset($removalInfo['right'])) { - $subEndPos = $this->origTokens->skipRight($subEndPos + 1, $removalInfo['right']) - 1; - } - } - - $result .= $this->origTokens->getTokenCode($pos, $subStartPos, $indentAdjustment); - - if (null !== $subNode) { - $result .= $extraLeft; - - $origIndentLevel = $this->indentLevel; - $this->setIndentLevel($this->origTokens->getIndentationBefore($subStartPos) + $indentAdjustment); - - // If it's the same node that was previously in this position, it certainly doesn't - // need fixup. It's important to check this here, because our fixup checks are more - // conservative than strictly necessary. - if (isset($fixupInfo[$subNodeName]) - && $subNode->getAttribute('origNode') !== $origSubNode - ) { - $fixup = $fixupInfo[$subNodeName]; - $res = $this->pFixup($fixup, $subNode, $class, $subStartPos, $subEndPos); - } else { - $res = $this->p($subNode, true); - } - - $this->safeAppend($result, $res); - $this->setIndentLevel($origIndentLevel); - - $result .= $extraRight; - } - - $pos = $subEndPos + 1; - } - - $result .= $this->origTokens->getTokenCode($pos, $endPos + 1, $indentAdjustment); - return $result; - } - - /** - * Perform a format-preserving pretty print of an array. - * - * @param array $nodes New nodes - * @param array $origNodes Original nodes - * @param int $pos Current token position (updated by reference) - * @param int $indentAdjustment Adjustment for indentation - * @param string $parentNodeType Type of the containing node. - * @param string $subNodeName Name of array subnode. - * @param null|int $fixup Fixup information for array item nodes - * - * @return null|string Result of pretty print or null if cannot preserve formatting - */ - protected function pArray( - array $nodes, array $origNodes, int &$pos, int $indentAdjustment, - string $parentNodeType, string $subNodeName, $fixup - ) { - $diff = $this->nodeListDiffer->diffWithReplacements($origNodes, $nodes); - - $mapKey = $parentNodeType . '->' . $subNodeName; - $insertStr = $this->listInsertionMap[$mapKey] ?? null; - $isStmtList = $subNodeName === 'stmts'; - - $beforeFirstKeepOrReplace = true; - $skipRemovedNode = false; - $delayedAdd = []; - $lastElemIndentLevel = $this->indentLevel; - - $insertNewline = false; - if ($insertStr === "\n") { - $insertStr = ''; - $insertNewline = true; - } - - if ($isStmtList && \count($origNodes) === 1 && \count($nodes) !== 1) { - $startPos = $origNodes[0]->getStartTokenPos(); - $endPos = $origNodes[0]->getEndTokenPos(); - \assert($startPos >= 0 && $endPos >= 0); - if (!$this->origTokens->haveBraces($startPos, $endPos)) { - // This was a single statement without braces, but either additional statements - // have been added, or the single statement has been removed. This requires the - // addition of braces. For now fall back. - // TODO: Try to preserve formatting - return null; - } - } - - $result = ''; - foreach ($diff as $i => $diffElem) { - $diffType = $diffElem->type; - /** @var Node|null $arrItem */ - $arrItem = $diffElem->new; - /** @var Node|null $origArrItem */ - $origArrItem = $diffElem->old; - - if ($diffType === DiffElem::TYPE_KEEP || $diffType === DiffElem::TYPE_REPLACE) { - $beforeFirstKeepOrReplace = false; - - if ($origArrItem === null || $arrItem === null) { - // We can only handle the case where both are null - if ($origArrItem === $arrItem) { - continue; - } - return null; - } - - if (!$arrItem instanceof Node || !$origArrItem instanceof Node) { - // We can only deal with nodes. This can occur for Names, which use string arrays. - return null; - } - - $itemStartPos = $origArrItem->getStartTokenPos(); - $itemEndPos = $origArrItem->getEndTokenPos(); - \assert($itemStartPos >= 0 && $itemEndPos >= 0 && $itemStartPos >= $pos); - - $origIndentLevel = $this->indentLevel; - $lastElemIndentLevel = $this->origTokens->getIndentationBefore($itemStartPos) + $indentAdjustment; - $this->setIndentLevel($lastElemIndentLevel); - - $comments = $arrItem->getComments(); - $origComments = $origArrItem->getComments(); - $commentStartPos = $origComments ? $origComments[0]->getStartTokenPos() : $itemStartPos; - \assert($commentStartPos >= 0); - - if ($commentStartPos < $pos) { - // Comments may be assigned to multiple nodes if they start at the same position. - // Make sure we don't try to print them multiple times. - $commentStartPos = $itemStartPos; - } - - if ($skipRemovedNode) { - if ($isStmtList && $this->origTokens->haveBracesInRange($pos, $itemStartPos)) { - // We'd remove the brace of a code block. - // TODO: Preserve formatting. - $this->setIndentLevel($origIndentLevel); - return null; - } - } else { - $result .= $this->origTokens->getTokenCode( - $pos, $commentStartPos, $indentAdjustment); - } - - if (!empty($delayedAdd)) { - /** @var Node $delayedAddNode */ - foreach ($delayedAdd as $delayedAddNode) { - if ($insertNewline) { - $delayedAddComments = $delayedAddNode->getComments(); - if ($delayedAddComments) { - $result .= $this->pComments($delayedAddComments) . $this->nl; - } - } - - $this->safeAppend($result, $this->p($delayedAddNode, true)); - - if ($insertNewline) { - $result .= $insertStr . $this->nl; - } else { - $result .= $insertStr; - } - } - - $delayedAdd = []; - } - - if ($comments !== $origComments) { - if ($comments) { - $result .= $this->pComments($comments) . $this->nl; - } - } else { - $result .= $this->origTokens->getTokenCode( - $commentStartPos, $itemStartPos, $indentAdjustment); - } - - // If we had to remove anything, we have done so now. - $skipRemovedNode = false; - } elseif ($diffType === DiffElem::TYPE_ADD) { - if (null === $insertStr) { - // We don't have insertion information for this list type - return null; - } - - // We go multiline if the original code was multiline, - // or if it's an array item with a comment above it. - if ($insertStr === ', ' && - ($this->isMultiline($origNodes) || $arrItem->getComments()) - ) { - $insertStr = ','; - $insertNewline = true; - } - - if ($beforeFirstKeepOrReplace) { - // Will be inserted at the next "replace" or "keep" element - $delayedAdd[] = $arrItem; - continue; - } - - $itemStartPos = $pos; - $itemEndPos = $pos - 1; - - $origIndentLevel = $this->indentLevel; - $this->setIndentLevel($lastElemIndentLevel); - - if ($insertNewline) { - $result .= $insertStr . $this->nl; - $comments = $arrItem->getComments(); - if ($comments) { - $result .= $this->pComments($comments) . $this->nl; - } - } else { - $result .= $insertStr; - } - } elseif ($diffType === DiffElem::TYPE_REMOVE) { - if (!$origArrItem instanceof Node) { - // We only support removal for nodes - return null; - } - - $itemStartPos = $origArrItem->getStartTokenPos(); - $itemEndPos = $origArrItem->getEndTokenPos(); - \assert($itemStartPos >= 0 && $itemEndPos >= 0); - - // Consider comments part of the node. - $origComments = $origArrItem->getComments(); - if ($origComments) { - $itemStartPos = $origComments[0]->getStartTokenPos(); - } - - if ($i === 0) { - // If we're removing from the start, keep the tokens before the node and drop those after it, - // instead of the other way around. - $result .= $this->origTokens->getTokenCode( - $pos, $itemStartPos, $indentAdjustment); - $skipRemovedNode = true; - } else { - if ($isStmtList && $this->origTokens->haveBracesInRange($pos, $itemStartPos)) { - // We'd remove the brace of a code block. - // TODO: Preserve formatting. - return null; - } - } - - $pos = $itemEndPos + 1; - continue; - } else { - throw new \Exception("Shouldn't happen"); - } - - if (null !== $fixup && $arrItem->getAttribute('origNode') !== $origArrItem) { - $res = $this->pFixup($fixup, $arrItem, null, $itemStartPos, $itemEndPos); - } else { - $res = $this->p($arrItem, true); - } - $this->safeAppend($result, $res); - - $this->setIndentLevel($origIndentLevel); - $pos = $itemEndPos + 1; - } - - if ($skipRemovedNode) { - // TODO: Support removing single node. - return null; - } - - if (!empty($delayedAdd)) { - if (!isset($this->emptyListInsertionMap[$mapKey])) { - return null; - } - - list($findToken, $extraLeft, $extraRight) = $this->emptyListInsertionMap[$mapKey]; - if (null !== $findToken) { - $insertPos = $this->origTokens->findRight($pos, $findToken) + 1; - $result .= $this->origTokens->getTokenCode($pos, $insertPos, $indentAdjustment); - $pos = $insertPos; - } - - $first = true; - $result .= $extraLeft; - foreach ($delayedAdd as $delayedAddNode) { - if (!$first) { - $result .= $insertStr; - } - $result .= $this->p($delayedAddNode, true); - $first = false; - } - $result .= $extraRight; - } - - return $result; - } - - /** - * Print node with fixups. - * - * Fixups here refer to the addition of extra parentheses, braces or other characters, that - * are required to preserve program semantics in a certain context (e.g. to maintain precedence - * or because only certain expressions are allowed in certain places). - * - * @param int $fixup Fixup type - * @param Node $subNode Subnode to print - * @param string|null $parentClass Class of parent node - * @param int $subStartPos Original start pos of subnode - * @param int $subEndPos Original end pos of subnode - * - * @return string Result of fixed-up print of subnode - */ - protected function pFixup(int $fixup, Node $subNode, $parentClass, int $subStartPos, int $subEndPos) : string { - switch ($fixup) { - case self::FIXUP_PREC_LEFT: - case self::FIXUP_PREC_RIGHT: - if (!$this->origTokens->haveParens($subStartPos, $subEndPos)) { - list($precedence, $associativity) = $this->precedenceMap[$parentClass]; - return $this->pPrec($subNode, $precedence, $associativity, - $fixup === self::FIXUP_PREC_LEFT ? -1 : 1); - } - break; - case self::FIXUP_CALL_LHS: - if ($this->callLhsRequiresParens($subNode) - && !$this->origTokens->haveParens($subStartPos, $subEndPos) - ) { - return '(' . $this->p($subNode) . ')'; - } - break; - case self::FIXUP_DEREF_LHS: - if ($this->dereferenceLhsRequiresParens($subNode) - && !$this->origTokens->haveParens($subStartPos, $subEndPos) - ) { - return '(' . $this->p($subNode) . ')'; - } - break; - case self::FIXUP_BRACED_NAME: - case self::FIXUP_VAR_BRACED_NAME: - if ($subNode instanceof Expr - && !$this->origTokens->haveBraces($subStartPos, $subEndPos) - ) { - return ($fixup === self::FIXUP_VAR_BRACED_NAME ? '$' : '') - . '{' . $this->p($subNode) . '}'; - } - break; - case self::FIXUP_ENCAPSED: - if (!$subNode instanceof Scalar\EncapsedStringPart - && !$this->origTokens->haveBraces($subStartPos, $subEndPos) - ) { - return '{' . $this->p($subNode) . '}'; - } - break; - default: - throw new \Exception('Cannot happen'); - } - - // Nothing special to do - return $this->p($subNode); - } - - /** - * Appends to a string, ensuring whitespace between label characters. - * - * Example: "echo" and "$x" result in "echo$x", but "echo" and "x" result in "echo x". - * Without safeAppend the result would be "echox", which does not preserve semantics. - * - * @param string $str - * @param string $append - */ - protected function safeAppend(string &$str, string $append) { - if ($str === "") { - $str = $append; - return; - } - - if ($append === "") { - return; - } - - if (!$this->labelCharMap[$append[0]] - || !$this->labelCharMap[$str[\strlen($str) - 1]]) { - $str .= $append; - } else { - $str .= " " . $append; - } - } - - /** - * Determines whether the LHS of a call must be wrapped in parenthesis. - * - * @param Node $node LHS of a call - * - * @return bool Whether parentheses are required - */ - protected function callLhsRequiresParens(Node $node) : bool { - return !($node instanceof Node\Name - || $node instanceof Expr\Variable - || $node instanceof Expr\ArrayDimFetch - || $node instanceof Expr\FuncCall - || $node instanceof Expr\MethodCall - || $node instanceof Expr\NullsafeMethodCall - || $node instanceof Expr\StaticCall - || $node instanceof Expr\Array_); - } - - /** - * Determines whether the LHS of a dereferencing operation must be wrapped in parenthesis. - * - * @param Node $node LHS of dereferencing operation - * - * @return bool Whether parentheses are required - */ - protected function dereferenceLhsRequiresParens(Node $node) : bool { - return !($node instanceof Expr\Variable - || $node instanceof Node\Name - || $node instanceof Expr\ArrayDimFetch - || $node instanceof Expr\PropertyFetch - || $node instanceof Expr\NullsafePropertyFetch - || $node instanceof Expr\StaticPropertyFetch - || $node instanceof Expr\FuncCall - || $node instanceof Expr\MethodCall - || $node instanceof Expr\NullsafeMethodCall - || $node instanceof Expr\StaticCall - || $node instanceof Expr\Array_ - || $node instanceof Scalar\String_ - || $node instanceof Expr\ConstFetch - || $node instanceof Expr\ClassConstFetch); - } - - /** - * Print modifiers, including trailing whitespace. - * - * @param int $modifiers Modifier mask to print - * - * @return string Printed modifiers - */ - protected function pModifiers(int $modifiers) { - return ($modifiers & Stmt\Class_::MODIFIER_PUBLIC ? 'public ' : '') - . ($modifiers & Stmt\Class_::MODIFIER_PROTECTED ? 'protected ' : '') - . ($modifiers & Stmt\Class_::MODIFIER_PRIVATE ? 'private ' : '') - . ($modifiers & Stmt\Class_::MODIFIER_STATIC ? 'static ' : '') - . ($modifiers & Stmt\Class_::MODIFIER_ABSTRACT ? 'abstract ' : '') - . ($modifiers & Stmt\Class_::MODIFIER_FINAL ? 'final ' : '') - . ($modifiers & Stmt\Class_::MODIFIER_READONLY ? 'readonly ' : ''); - } - - /** - * Determine whether a list of nodes uses multiline formatting. - * - * @param (Node|null)[] $nodes Node list - * - * @return bool Whether multiline formatting is used - */ - protected function isMultiline(array $nodes) : bool { - if (\count($nodes) < 2) { - return false; - } - - $pos = -1; - foreach ($nodes as $node) { - if (null === $node) { - continue; - } - - $endPos = $node->getEndTokenPos() + 1; - if ($pos >= 0) { - $text = $this->origTokens->getTokenCode($pos, $endPos, 0); - if (false === strpos($text, "\n")) { - // We require that a newline is present between *every* item. If the formatting - // is inconsistent, with only some items having newlines, we don't consider it - // as multiline - return false; - } - } - $pos = $endPos; - } - - return true; - } - - /** - * Lazily initializes label char map. - * - * The label char map determines whether a certain character may occur in a label. - */ - protected function initializeLabelCharMap() { - if ($this->labelCharMap) return; - - $this->labelCharMap = []; - for ($i = 0; $i < 256; $i++) { - // Since PHP 7.1 The lower range is 0x80. However, we also want to support code for - // older versions. - $chr = chr($i); - $this->labelCharMap[$chr] = $i >= 0x7f || ctype_alnum($chr); - } - } - - /** - * Lazily initializes node list differ. - * - * The node list differ is used to determine differences between two array subnodes. - */ - protected function initializeNodeListDiffer() { - if ($this->nodeListDiffer) return; - - $this->nodeListDiffer = new Internal\Differ(function ($a, $b) { - if ($a instanceof Node && $b instanceof Node) { - return $a === $b->getAttribute('origNode'); - } - // Can happen for array destructuring - return $a === null && $b === null; - }); - } - - /** - * Lazily initializes fixup map. - * - * The fixup map is used to determine whether a certain subnode of a certain node may require - * some kind of "fixup" operation, e.g. the addition of parenthesis or braces. - */ - protected function initializeFixupMap() { - if ($this->fixupMap) return; - - $this->fixupMap = [ - Expr\PreInc::class => ['var' => self::FIXUP_PREC_RIGHT], - Expr\PreDec::class => ['var' => self::FIXUP_PREC_RIGHT], - Expr\PostInc::class => ['var' => self::FIXUP_PREC_LEFT], - Expr\PostDec::class => ['var' => self::FIXUP_PREC_LEFT], - Expr\Instanceof_::class => [ - 'expr' => self::FIXUP_PREC_LEFT, - 'class' => self::FIXUP_PREC_RIGHT, // TODO: FIXUP_NEW_VARIABLE - ], - Expr\Ternary::class => [ - 'cond' => self::FIXUP_PREC_LEFT, - 'else' => self::FIXUP_PREC_RIGHT, - ], - - Expr\FuncCall::class => ['name' => self::FIXUP_CALL_LHS], - Expr\StaticCall::class => ['class' => self::FIXUP_DEREF_LHS], - Expr\ArrayDimFetch::class => ['var' => self::FIXUP_DEREF_LHS], - Expr\ClassConstFetch::class => ['var' => self::FIXUP_DEREF_LHS], - Expr\New_::class => ['class' => self::FIXUP_DEREF_LHS], // TODO: FIXUP_NEW_VARIABLE - Expr\MethodCall::class => [ - 'var' => self::FIXUP_DEREF_LHS, - 'name' => self::FIXUP_BRACED_NAME, - ], - Expr\NullsafeMethodCall::class => [ - 'var' => self::FIXUP_DEREF_LHS, - 'name' => self::FIXUP_BRACED_NAME, - ], - Expr\StaticPropertyFetch::class => [ - 'class' => self::FIXUP_DEREF_LHS, - 'name' => self::FIXUP_VAR_BRACED_NAME, - ], - Expr\PropertyFetch::class => [ - 'var' => self::FIXUP_DEREF_LHS, - 'name' => self::FIXUP_BRACED_NAME, - ], - Expr\NullsafePropertyFetch::class => [ - 'var' => self::FIXUP_DEREF_LHS, - 'name' => self::FIXUP_BRACED_NAME, - ], - Scalar\Encapsed::class => [ - 'parts' => self::FIXUP_ENCAPSED, - ], - ]; - - $binaryOps = [ - BinaryOp\Pow::class, BinaryOp\Mul::class, BinaryOp\Div::class, BinaryOp\Mod::class, - BinaryOp\Plus::class, BinaryOp\Minus::class, BinaryOp\Concat::class, - BinaryOp\ShiftLeft::class, BinaryOp\ShiftRight::class, BinaryOp\Smaller::class, - BinaryOp\SmallerOrEqual::class, BinaryOp\Greater::class, BinaryOp\GreaterOrEqual::class, - BinaryOp\Equal::class, BinaryOp\NotEqual::class, BinaryOp\Identical::class, - BinaryOp\NotIdentical::class, BinaryOp\Spaceship::class, BinaryOp\BitwiseAnd::class, - BinaryOp\BitwiseXor::class, BinaryOp\BitwiseOr::class, BinaryOp\BooleanAnd::class, - BinaryOp\BooleanOr::class, BinaryOp\Coalesce::class, BinaryOp\LogicalAnd::class, - BinaryOp\LogicalXor::class, BinaryOp\LogicalOr::class, - ]; - foreach ($binaryOps as $binaryOp) { - $this->fixupMap[$binaryOp] = [ - 'left' => self::FIXUP_PREC_LEFT, - 'right' => self::FIXUP_PREC_RIGHT - ]; - } - - $assignOps = [ - Expr\Assign::class, Expr\AssignRef::class, AssignOp\Plus::class, AssignOp\Minus::class, - AssignOp\Mul::class, AssignOp\Div::class, AssignOp\Concat::class, AssignOp\Mod::class, - AssignOp\BitwiseAnd::class, AssignOp\BitwiseOr::class, AssignOp\BitwiseXor::class, - AssignOp\ShiftLeft::class, AssignOp\ShiftRight::class, AssignOp\Pow::class, AssignOp\Coalesce::class - ]; - foreach ($assignOps as $assignOp) { - $this->fixupMap[$assignOp] = [ - 'var' => self::FIXUP_PREC_LEFT, - 'expr' => self::FIXUP_PREC_RIGHT, - ]; - } - - $prefixOps = [ - Expr\BitwiseNot::class, Expr\BooleanNot::class, Expr\UnaryPlus::class, Expr\UnaryMinus::class, - Cast\Int_::class, Cast\Double::class, Cast\String_::class, Cast\Array_::class, - Cast\Object_::class, Cast\Bool_::class, Cast\Unset_::class, Expr\ErrorSuppress::class, - Expr\YieldFrom::class, Expr\Print_::class, Expr\Include_::class, - ]; - foreach ($prefixOps as $prefixOp) { - $this->fixupMap[$prefixOp] = ['expr' => self::FIXUP_PREC_RIGHT]; - } - } - - /** - * Lazily initializes the removal map. - * - * The removal map is used to determine which additional tokens should be removed when a - * certain node is replaced by null. - */ - protected function initializeRemovalMap() { - if ($this->removalMap) return; - - $stripBoth = ['left' => \T_WHITESPACE, 'right' => \T_WHITESPACE]; - $stripLeft = ['left' => \T_WHITESPACE]; - $stripRight = ['right' => \T_WHITESPACE]; - $stripDoubleArrow = ['right' => \T_DOUBLE_ARROW]; - $stripColon = ['left' => ':']; - $stripEquals = ['left' => '=']; - $this->removalMap = [ - 'Expr_ArrayDimFetch->dim' => $stripBoth, - 'Expr_ArrayItem->key' => $stripDoubleArrow, - 'Expr_ArrowFunction->returnType' => $stripColon, - 'Expr_Closure->returnType' => $stripColon, - 'Expr_Exit->expr' => $stripBoth, - 'Expr_Ternary->if' => $stripBoth, - 'Expr_Yield->key' => $stripDoubleArrow, - 'Expr_Yield->value' => $stripBoth, - 'Param->type' => $stripRight, - 'Param->default' => $stripEquals, - 'Stmt_Break->num' => $stripBoth, - 'Stmt_Catch->var' => $stripLeft, - 'Stmt_ClassMethod->returnType' => $stripColon, - 'Stmt_Class->extends' => ['left' => \T_EXTENDS], - 'Stmt_Enum->scalarType' => $stripColon, - 'Stmt_EnumCase->expr' => $stripEquals, - 'Expr_PrintableNewAnonClass->extends' => ['left' => \T_EXTENDS], - 'Stmt_Continue->num' => $stripBoth, - 'Stmt_Foreach->keyVar' => $stripDoubleArrow, - 'Stmt_Function->returnType' => $stripColon, - 'Stmt_If->else' => $stripLeft, - 'Stmt_Namespace->name' => $stripLeft, - 'Stmt_Property->type' => $stripRight, - 'Stmt_PropertyProperty->default' => $stripEquals, - 'Stmt_Return->expr' => $stripBoth, - 'Stmt_StaticVar->default' => $stripEquals, - 'Stmt_TraitUseAdaptation_Alias->newName' => $stripLeft, - 'Stmt_TryCatch->finally' => $stripLeft, - // 'Stmt_Case->cond': Replace with "default" - // 'Stmt_Class->name': Unclear what to do - // 'Stmt_Declare->stmts': Not a plain node - // 'Stmt_TraitUseAdaptation_Alias->newModifier': Not a plain node - ]; - } - - protected function initializeInsertionMap() { - if ($this->insertionMap) return; - - // TODO: "yield" where both key and value are inserted doesn't work - // [$find, $beforeToken, $extraLeft, $extraRight] - $this->insertionMap = [ - 'Expr_ArrayDimFetch->dim' => ['[', false, null, null], - 'Expr_ArrayItem->key' => [null, false, null, ' => '], - 'Expr_ArrowFunction->returnType' => [')', false, ' : ', null], - 'Expr_Closure->returnType' => [')', false, ' : ', null], - 'Expr_Ternary->if' => ['?', false, ' ', ' '], - 'Expr_Yield->key' => [\T_YIELD, false, null, ' => '], - 'Expr_Yield->value' => [\T_YIELD, false, ' ', null], - 'Param->type' => [null, false, null, ' '], - 'Param->default' => [null, false, ' = ', null], - 'Stmt_Break->num' => [\T_BREAK, false, ' ', null], - 'Stmt_Catch->var' => [null, false, ' ', null], - 'Stmt_ClassMethod->returnType' => [')', false, ' : ', null], - 'Stmt_Class->extends' => [null, false, ' extends ', null], - 'Stmt_Enum->scalarType' => [null, false, ' : ', null], - 'Stmt_EnumCase->expr' => [null, false, ' = ', null], - 'Expr_PrintableNewAnonClass->extends' => [null, ' extends ', null], - 'Stmt_Continue->num' => [\T_CONTINUE, false, ' ', null], - 'Stmt_Foreach->keyVar' => [\T_AS, false, null, ' => '], - 'Stmt_Function->returnType' => [')', false, ' : ', null], - 'Stmt_If->else' => [null, false, ' ', null], - 'Stmt_Namespace->name' => [\T_NAMESPACE, false, ' ', null], - 'Stmt_Property->type' => [\T_VARIABLE, true, null, ' '], - 'Stmt_PropertyProperty->default' => [null, false, ' = ', null], - 'Stmt_Return->expr' => [\T_RETURN, false, ' ', null], - 'Stmt_StaticVar->default' => [null, false, ' = ', null], - //'Stmt_TraitUseAdaptation_Alias->newName' => [T_AS, false, ' ', null], // TODO - 'Stmt_TryCatch->finally' => [null, false, ' ', null], - - // 'Expr_Exit->expr': Complicated due to optional () - // 'Stmt_Case->cond': Conversion from default to case - // 'Stmt_Class->name': Unclear - // 'Stmt_Declare->stmts': Not a proper node - // 'Stmt_TraitUseAdaptation_Alias->newModifier': Not a proper node - ]; - } - - protected function initializeListInsertionMap() { - if ($this->listInsertionMap) return; - - $this->listInsertionMap = [ - // special - //'Expr_ShellExec->parts' => '', // TODO These need to be treated more carefully - //'Scalar_Encapsed->parts' => '', - 'Stmt_Catch->types' => '|', - 'UnionType->types' => '|', - 'IntersectionType->types' => '&', - 'Stmt_If->elseifs' => ' ', - 'Stmt_TryCatch->catches' => ' ', - - // comma-separated lists - 'Expr_Array->items' => ', ', - 'Expr_ArrowFunction->params' => ', ', - 'Expr_Closure->params' => ', ', - 'Expr_Closure->uses' => ', ', - 'Expr_FuncCall->args' => ', ', - 'Expr_Isset->vars' => ', ', - 'Expr_List->items' => ', ', - 'Expr_MethodCall->args' => ', ', - 'Expr_NullsafeMethodCall->args' => ', ', - 'Expr_New->args' => ', ', - 'Expr_PrintableNewAnonClass->args' => ', ', - 'Expr_StaticCall->args' => ', ', - 'Stmt_ClassConst->consts' => ', ', - 'Stmt_ClassMethod->params' => ', ', - 'Stmt_Class->implements' => ', ', - 'Stmt_Enum->implements' => ', ', - 'Expr_PrintableNewAnonClass->implements' => ', ', - 'Stmt_Const->consts' => ', ', - 'Stmt_Declare->declares' => ', ', - 'Stmt_Echo->exprs' => ', ', - 'Stmt_For->init' => ', ', - 'Stmt_For->cond' => ', ', - 'Stmt_For->loop' => ', ', - 'Stmt_Function->params' => ', ', - 'Stmt_Global->vars' => ', ', - 'Stmt_GroupUse->uses' => ', ', - 'Stmt_Interface->extends' => ', ', - 'Stmt_Match->arms' => ', ', - 'Stmt_Property->props' => ', ', - 'Stmt_StaticVar->vars' => ', ', - 'Stmt_TraitUse->traits' => ', ', - 'Stmt_TraitUseAdaptation_Precedence->insteadof' => ', ', - 'Stmt_Unset->vars' => ', ', - 'Stmt_Use->uses' => ', ', - 'MatchArm->conds' => ', ', - 'AttributeGroup->attrs' => ', ', - - // statement lists - 'Expr_Closure->stmts' => "\n", - 'Stmt_Case->stmts' => "\n", - 'Stmt_Catch->stmts' => "\n", - 'Stmt_Class->stmts' => "\n", - 'Stmt_Enum->stmts' => "\n", - 'Expr_PrintableNewAnonClass->stmts' => "\n", - 'Stmt_Interface->stmts' => "\n", - 'Stmt_Trait->stmts' => "\n", - 'Stmt_ClassMethod->stmts' => "\n", - 'Stmt_Declare->stmts' => "\n", - 'Stmt_Do->stmts' => "\n", - 'Stmt_ElseIf->stmts' => "\n", - 'Stmt_Else->stmts' => "\n", - 'Stmt_Finally->stmts' => "\n", - 'Stmt_Foreach->stmts' => "\n", - 'Stmt_For->stmts' => "\n", - 'Stmt_Function->stmts' => "\n", - 'Stmt_If->stmts' => "\n", - 'Stmt_Namespace->stmts' => "\n", - 'Stmt_Class->attrGroups' => "\n", - 'Stmt_Enum->attrGroups' => "\n", - 'Stmt_EnumCase->attrGroups' => "\n", - 'Stmt_Interface->attrGroups' => "\n", - 'Stmt_Trait->attrGroups' => "\n", - 'Stmt_Function->attrGroups' => "\n", - 'Stmt_ClassMethod->attrGroups' => "\n", - 'Stmt_ClassConst->attrGroups' => "\n", - 'Stmt_Property->attrGroups' => "\n", - 'Expr_PrintableNewAnonClass->attrGroups' => ' ', - 'Expr_Closure->attrGroups' => ' ', - 'Expr_ArrowFunction->attrGroups' => ' ', - 'Param->attrGroups' => ' ', - 'Stmt_Switch->cases' => "\n", - 'Stmt_TraitUse->adaptations' => "\n", - 'Stmt_TryCatch->stmts' => "\n", - 'Stmt_While->stmts' => "\n", - - // dummy for top-level context - 'File->stmts' => "\n", - ]; - } - - protected function initializeEmptyListInsertionMap() { - if ($this->emptyListInsertionMap) return; - - // TODO Insertion into empty statement lists. - - // [$find, $extraLeft, $extraRight] - $this->emptyListInsertionMap = [ - 'Expr_ArrowFunction->params' => ['(', '', ''], - 'Expr_Closure->uses' => [')', ' use(', ')'], - 'Expr_Closure->params' => ['(', '', ''], - 'Expr_FuncCall->args' => ['(', '', ''], - 'Expr_MethodCall->args' => ['(', '', ''], - 'Expr_NullsafeMethodCall->args' => ['(', '', ''], - 'Expr_New->args' => ['(', '', ''], - 'Expr_PrintableNewAnonClass->args' => ['(', '', ''], - 'Expr_PrintableNewAnonClass->implements' => [null, ' implements ', ''], - 'Expr_StaticCall->args' => ['(', '', ''], - 'Stmt_Class->implements' => [null, ' implements ', ''], - 'Stmt_Enum->implements' => [null, ' implements ', ''], - 'Stmt_ClassMethod->params' => ['(', '', ''], - 'Stmt_Interface->extends' => [null, ' extends ', ''], - 'Stmt_Function->params' => ['(', '', ''], - - /* These cannot be empty to start with: - * Expr_Isset->vars - * Stmt_Catch->types - * Stmt_Const->consts - * Stmt_ClassConst->consts - * Stmt_Declare->declares - * Stmt_Echo->exprs - * Stmt_Global->vars - * Stmt_GroupUse->uses - * Stmt_Property->props - * Stmt_StaticVar->vars - * Stmt_TraitUse->traits - * Stmt_TraitUseAdaptation_Precedence->insteadof - * Stmt_Unset->vars - * Stmt_Use->uses - * UnionType->types - */ - - /* TODO - * Stmt_If->elseifs - * Stmt_TryCatch->catches - * Expr_Array->items - * Expr_List->items - * Stmt_For->init - * Stmt_For->cond - * Stmt_For->loop - */ - ]; - } - - protected function initializeModifierChangeMap() { - if ($this->modifierChangeMap) return; - - $this->modifierChangeMap = [ - 'Stmt_ClassConst->flags' => \T_CONST, - 'Stmt_ClassMethod->flags' => \T_FUNCTION, - 'Stmt_Class->flags' => \T_CLASS, - 'Stmt_Property->flags' => \T_VARIABLE, - 'Param->flags' => \T_VARIABLE, - //'Stmt_TraitUseAdaptation_Alias->newModifier' => 0, // TODO - ]; - - // List of integer subnodes that are not modifiers: - // Expr_Include->type - // Stmt_GroupUse->type - // Stmt_Use->type - // Stmt_UseUse->type - } -} diff --git a/vendor/phar-io/manifest/CHANGELOG.md b/vendor/phar-io/manifest/CHANGELOG.md deleted file mode 100644 index a403e09..0000000 --- a/vendor/phar-io/manifest/CHANGELOG.md +++ /dev/null @@ -1,36 +0,0 @@ -# Changelog - -All notable changes to phar-io/manifest are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. - -## [2.0.3] - 20.07.2021 - -- Fixed PHP 7.2 / PHP 7.3 incompatibility introduced in previous release - -## [2.0.2] - 20.07.2021 - -- Fixed PHP 8.1 deprecation notice - -## [2.0.1] - 27.06.2020 - -This release now supports the use of PHP 7.2+ and ^8.0 - -## [2.0.0] - 10.05.2020 - -This release now requires PHP 7.2+ - -### Changed - -- Upgraded to phar-io/version 3.0 - - Version strings `v1.2.3` will now be converted to valid semantic version strings `1.2.3` - - Abreviated strings like `1.0` will get expaneded to `1.0.0` - -### Unreleased - -[Unreleased]: https://github.com/phar-io/manifest/compare/2.0.3...HEAD -[2.0.3]: https://github.com/phar-io/manifest/compare/2.0.2...2.0.3 -[2.0.2]: https://github.com/phar-io/manifest/compare/2.0.1...2.0.2 -[2.0.1]: https://github.com/phar-io/manifest/compare/2.0.0...2.0.1 -[2.0.0]: https://github.com/phar-io/manifest/compare/1.0.1...2.0.0 -[1.0.3]: https://github.com/phar-io/manifest/compare/1.0.2...1.0.3 -[1.0.2]: https://github.com/phar-io/manifest/compare/1.0.1...1.0.2 -[1.0.1]: https://github.com/phar-io/manifest/compare/1.0.0...1.0.1 diff --git a/vendor/phar-io/manifest/LICENSE b/vendor/phar-io/manifest/LICENSE deleted file mode 100644 index 64690cf..0000000 --- a/vendor/phar-io/manifest/LICENSE +++ /dev/null @@ -1,31 +0,0 @@ -Phar.io - Manifest - -Copyright (c) 2016-2019 Arne Blankerts , Sebastian Heuer , Sebastian Bergmann , and contributors -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the name of Arne Blankerts nor the names of contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, -OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - diff --git a/vendor/phar-io/manifest/README.md b/vendor/phar-io/manifest/README.md deleted file mode 100644 index e6d0b05..0000000 --- a/vendor/phar-io/manifest/README.md +++ /dev/null @@ -1,30 +0,0 @@ -# Manifest - -Component for reading [phar.io](https://phar.io/) manifest information from a [PHP Archive (PHAR)](http://php.net/phar). - -[![Build Status](https://travis-ci.org/phar-io/manifest.svg?branch=master)](https://travis-ci.org/phar-io/manifest) -[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/phar-io/manifest/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/phar-io/manifest/?branch=master) -[![SensioLabsInsight](https://insight.sensiolabs.com/projects/d8cc6035-69ad-477d-bd1a-ccc605480fd7/mini.png)](https://insight.sensiolabs.com/projects/d8cc6035-69ad-477d-bd1a-ccc605480fd7) - -## Installation - -You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): - - composer require phar-io/manifest - -If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: - - composer require --dev phar-io/manifest - -## Usage - -```php -use PharIo\Manifest\ManifestLoader; -use PharIo\Manifest\ManifestSerializer; - -$manifest = ManifestLoader::fromFile('manifest.xml'); - -var_dump($manifest); - -echo (new ManifestSerializer)->serializeToString($manifest); -``` diff --git a/vendor/phar-io/manifest/composer.json b/vendor/phar-io/manifest/composer.json deleted file mode 100644 index a252119..0000000 --- a/vendor/phar-io/manifest/composer.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "phar-io/manifest", - "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "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" - } - ], - "support": { - "issues": "https://github.com/phar-io/manifest/issues" - }, - "require": { - "php": "^7.2 || ^8.0", - "ext-dom": "*", - "ext-phar": "*", - "ext-xmlwriter": "*", - "phar-io/version": "^3.0.1" - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - } -} diff --git a/vendor/phar-io/manifest/composer.lock b/vendor/phar-io/manifest/composer.lock deleted file mode 100644 index e0e6db7..0000000 --- a/vendor/phar-io/manifest/composer.lock +++ /dev/null @@ -1,70 +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": "f2ac4614ce4f7273fd54a64b65fd047a", - "packages": [ - { - "name": "phar-io/version", - "version": "3.0.1", - "source": { - "type": "git", - "url": "https://github.com/phar-io/version.git", - "reference": "d06a5000ac1a258a7d035295f0bd4ae7c859bc4f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/d06a5000ac1a258a7d035295f0bd4ae7c859bc4f", - "reference": "d06a5000ac1a258a7d035295f0bd4ae7c859bc4f", - "shasum": "" - }, - "require": { - "php": "^7.2" - }, - "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", - "time": "2020-05-09T21:27:55+00:00" - } - ], - "packages-dev": [], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": "^7.2", - "ext-dom": "*", - "ext-phar": "*", - "ext-xmlwriter": "*" - }, - "platform-dev": [] -} diff --git a/vendor/phar-io/manifest/src/ManifestDocumentMapper.php b/vendor/phar-io/manifest/src/ManifestDocumentMapper.php deleted file mode 100644 index 8e539d5..0000000 --- a/vendor/phar-io/manifest/src/ManifestDocumentMapper.php +++ /dev/null @@ -1,150 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -use PharIo\Version\Exception as VersionException; -use PharIo\Version\Version; -use PharIo\Version\VersionConstraintParser; - -class ManifestDocumentMapper { - public function map(ManifestDocument $document): Manifest { - try { - $contains = $document->getContainsElement(); - $type = $this->mapType($contains); - $copyright = $this->mapCopyright($document->getCopyrightElement()); - $requirements = $this->mapRequirements($document->getRequiresElement()); - $bundledComponents = $this->mapBundledComponents($document); - - return new Manifest( - new ApplicationName($contains->getName()), - new Version($contains->getVersion()), - $type, - $copyright, - $requirements, - $bundledComponents - ); - } catch (VersionException $e) { - throw new ManifestDocumentMapperException($e->getMessage(), (int)$e->getCode(), $e); - } catch (Exception $e) { - throw new ManifestDocumentMapperException($e->getMessage(), (int)$e->getCode(), $e); - } - } - - private function mapType(ContainsElement $contains): Type { - switch ($contains->getType()) { - case 'application': - return Type::application(); - case 'library': - return Type::library(); - case 'extension': - return $this->mapExtension($contains->getExtensionElement()); - } - - throw new ManifestDocumentMapperException( - \sprintf('Unsupported type %s', $contains->getType()) - ); - } - - private function mapCopyright(CopyrightElement $copyright): CopyrightInformation { - $authors = new AuthorCollection(); - - foreach ($copyright->getAuthorElements() as $authorElement) { - $authors->add( - new Author( - $authorElement->getName(), - new Email($authorElement->getEmail()) - ) - ); - } - - $licenseElement = $copyright->getLicenseElement(); - $license = new License( - $licenseElement->getType(), - new Url($licenseElement->getUrl()) - ); - - return new CopyrightInformation( - $authors, - $license - ); - } - - private function mapRequirements(RequiresElement $requires): RequirementCollection { - $collection = new RequirementCollection(); - $phpElement = $requires->getPHPElement(); - $parser = new VersionConstraintParser; - - try { - $versionConstraint = $parser->parse($phpElement->getVersion()); - } catch (VersionException $e) { - throw new ManifestDocumentMapperException( - \sprintf('Unsupported version constraint - %s', $e->getMessage()), - (int)$e->getCode(), - $e - ); - } - - $collection->add( - new PhpVersionRequirement( - $versionConstraint - ) - ); - - if (!$phpElement->hasExtElements()) { - return $collection; - } - - foreach ($phpElement->getExtElements() as $extElement) { - $collection->add( - new PhpExtensionRequirement($extElement->getName()) - ); - } - - return $collection; - } - - private function mapBundledComponents(ManifestDocument $document): BundledComponentCollection { - $collection = new BundledComponentCollection(); - - if (!$document->hasBundlesElement()) { - return $collection; - } - - foreach ($document->getBundlesElement()->getComponentElements() as $componentElement) { - $collection->add( - new BundledComponent( - $componentElement->getName(), - new Version( - $componentElement->getVersion() - ) - ) - ); - } - - return $collection; - } - - private function mapExtension(ExtensionElement $extension): Extension { - try { - $versionConstraint = (new VersionConstraintParser)->parse($extension->getCompatible()); - - return Type::extension( - new ApplicationName($extension->getFor()), - $versionConstraint - ); - } catch (VersionException $e) { - throw new ManifestDocumentMapperException( - \sprintf('Unsupported version constraint - %s', $e->getMessage()), - (int)$e->getCode(), - $e - ); - } - } -} diff --git a/vendor/phar-io/manifest/src/ManifestLoader.php b/vendor/phar-io/manifest/src/ManifestLoader.php deleted file mode 100644 index ae884e4..0000000 --- a/vendor/phar-io/manifest/src/ManifestLoader.php +++ /dev/null @@ -1,44 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class ManifestLoader { - public static function fromFile(string $filename): Manifest { - try { - return (new ManifestDocumentMapper())->map( - ManifestDocument::fromFile($filename) - ); - } catch (Exception $e) { - throw new ManifestLoaderException( - \sprintf('Loading %s failed.', $filename), - (int)$e->getCode(), - $e - ); - } - } - - public static function fromPhar(string $filename): Manifest { - return self::fromFile('phar://' . $filename . '/manifest.xml'); - } - - public static function fromString(string $manifest): Manifest { - try { - return (new ManifestDocumentMapper())->map( - ManifestDocument::fromString($manifest) - ); - } catch (Exception $e) { - throw new ManifestLoaderException( - 'Processing string failed', - (int)$e->getCode(), - $e - ); - } - } -} diff --git a/vendor/phar-io/manifest/src/ManifestSerializer.php b/vendor/phar-io/manifest/src/ManifestSerializer.php deleted file mode 100644 index e236b59..0000000 --- a/vendor/phar-io/manifest/src/ManifestSerializer.php +++ /dev/null @@ -1,168 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -use PharIo\Version\AnyVersionConstraint; -use PharIo\Version\Version; -use PharIo\Version\VersionConstraint; -use XMLWriter; - -/** @psalm-suppress MissingConstructor */ -class ManifestSerializer { - /** @var XMLWriter */ - private $xmlWriter; - - public function serializeToFile(Manifest $manifest, string $filename): void { - \file_put_contents( - $filename, - $this->serializeToString($manifest) - ); - } - - public function serializeToString(Manifest $manifest): string { - $this->startDocument(); - - $this->addContains($manifest->getName(), $manifest->getVersion(), $manifest->getType()); - $this->addCopyright($manifest->getCopyrightInformation()); - $this->addRequirements($manifest->getRequirements()); - $this->addBundles($manifest->getBundledComponents()); - - return $this->finishDocument(); - } - - private function startDocument(): void { - $xmlWriter = new XMLWriter(); - $xmlWriter->openMemory(); - $xmlWriter->setIndent(true); - $xmlWriter->setIndentString(\str_repeat(' ', 4)); - $xmlWriter->startDocument('1.0', 'UTF-8'); - $xmlWriter->startElement('phar'); - $xmlWriter->writeAttribute('xmlns', 'https://phar.io/xml/manifest/1.0'); - - $this->xmlWriter = $xmlWriter; - } - - private function finishDocument(): string { - $this->xmlWriter->endElement(); - $this->xmlWriter->endDocument(); - - return $this->xmlWriter->outputMemory(); - } - - private function addContains(ApplicationName $name, Version $version, Type $type): void { - $this->xmlWriter->startElement('contains'); - $this->xmlWriter->writeAttribute('name', $name->asString()); - $this->xmlWriter->writeAttribute('version', $version->getVersionString()); - - switch (true) { - case $type->isApplication(): { - $this->xmlWriter->writeAttribute('type', 'application'); - - break; - } - - case $type->isLibrary(): { - $this->xmlWriter->writeAttribute('type', 'library'); - - break; - } - - case $type->isExtension(): { - $this->xmlWriter->writeAttribute('type', 'extension'); - /* @var $type Extension */ - $this->addExtension( - $type->getApplicationName(), - $type->getVersionConstraint() - ); - - break; - } - - default: { - $this->xmlWriter->writeAttribute('type', 'custom'); - } - } - - $this->xmlWriter->endElement(); - } - - private function addCopyright(CopyrightInformation $copyrightInformation): void { - $this->xmlWriter->startElement('copyright'); - - foreach ($copyrightInformation->getAuthors() as $author) { - $this->xmlWriter->startElement('author'); - $this->xmlWriter->writeAttribute('name', $author->getName()); - $this->xmlWriter->writeAttribute('email', $author->getEmail()->asString()); - $this->xmlWriter->endElement(); - } - - $license = $copyrightInformation->getLicense(); - - $this->xmlWriter->startElement('license'); - $this->xmlWriter->writeAttribute('type', $license->getName()); - $this->xmlWriter->writeAttribute('url', $license->getUrl()->asString()); - $this->xmlWriter->endElement(); - - $this->xmlWriter->endElement(); - } - - private function addRequirements(RequirementCollection $requirementCollection): void { - $phpRequirement = new AnyVersionConstraint(); - $extensions = []; - - foreach ($requirementCollection as $requirement) { - if ($requirement instanceof PhpVersionRequirement) { - $phpRequirement = $requirement->getVersionConstraint(); - - continue; - } - - if ($requirement instanceof PhpExtensionRequirement) { - $extensions[] = $requirement->asString(); - } - } - - $this->xmlWriter->startElement('requires'); - $this->xmlWriter->startElement('php'); - $this->xmlWriter->writeAttribute('version', $phpRequirement->asString()); - - foreach ($extensions as $extension) { - $this->xmlWriter->startElement('ext'); - $this->xmlWriter->writeAttribute('name', $extension); - $this->xmlWriter->endElement(); - } - - $this->xmlWriter->endElement(); - $this->xmlWriter->endElement(); - } - - private function addBundles(BundledComponentCollection $bundledComponentCollection): void { - if (\count($bundledComponentCollection) === 0) { - return; - } - $this->xmlWriter->startElement('bundles'); - - foreach ($bundledComponentCollection as $bundledComponent) { - $this->xmlWriter->startElement('component'); - $this->xmlWriter->writeAttribute('name', $bundledComponent->getName()); - $this->xmlWriter->writeAttribute('version', $bundledComponent->getVersion()->getVersionString()); - $this->xmlWriter->endElement(); - } - - $this->xmlWriter->endElement(); - } - - private function addExtension(ApplicationName $applicationName, VersionConstraint $versionConstraint): void { - $this->xmlWriter->startElement('extension'); - $this->xmlWriter->writeAttribute('for', $applicationName->asString()); - $this->xmlWriter->writeAttribute('compatible', $versionConstraint->asString()); - $this->xmlWriter->endElement(); - } -} diff --git a/vendor/phar-io/manifest/src/exceptions/ElementCollectionException.php b/vendor/phar-io/manifest/src/exceptions/ElementCollectionException.php deleted file mode 100644 index 766fc0e..0000000 --- a/vendor/phar-io/manifest/src/exceptions/ElementCollectionException.php +++ /dev/null @@ -1,13 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class ElementCollectionException extends \InvalidArgumentException implements Exception { -} diff --git a/vendor/phar-io/manifest/src/exceptions/Exception.php b/vendor/phar-io/manifest/src/exceptions/Exception.php deleted file mode 100644 index e7f1220..0000000 --- a/vendor/phar-io/manifest/src/exceptions/Exception.php +++ /dev/null @@ -1,13 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -interface Exception extends \Throwable { -} diff --git a/vendor/phar-io/manifest/src/exceptions/InvalidApplicationNameException.php b/vendor/phar-io/manifest/src/exceptions/InvalidApplicationNameException.php deleted file mode 100644 index 952901e..0000000 --- a/vendor/phar-io/manifest/src/exceptions/InvalidApplicationNameException.php +++ /dev/null @@ -1,14 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class InvalidApplicationNameException extends \InvalidArgumentException implements Exception { - public const InvalidFormat = 2; -} diff --git a/vendor/phar-io/manifest/src/exceptions/InvalidEmailException.php b/vendor/phar-io/manifest/src/exceptions/InvalidEmailException.php deleted file mode 100644 index 3cbe082..0000000 --- a/vendor/phar-io/manifest/src/exceptions/InvalidEmailException.php +++ /dev/null @@ -1,13 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class InvalidEmailException extends \InvalidArgumentException implements Exception { -} diff --git a/vendor/phar-io/manifest/src/exceptions/InvalidUrlException.php b/vendor/phar-io/manifest/src/exceptions/InvalidUrlException.php deleted file mode 100644 index 8f77e29..0000000 --- a/vendor/phar-io/manifest/src/exceptions/InvalidUrlException.php +++ /dev/null @@ -1,13 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class InvalidUrlException extends \InvalidArgumentException implements Exception { -} diff --git a/vendor/phar-io/manifest/src/exceptions/ManifestDocumentException.php b/vendor/phar-io/manifest/src/exceptions/ManifestDocumentException.php deleted file mode 100644 index cf1c314..0000000 --- a/vendor/phar-io/manifest/src/exceptions/ManifestDocumentException.php +++ /dev/null @@ -1,5 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -use LibXMLError; - -class ManifestDocumentLoadingException extends \Exception implements Exception { - /** @var LibXMLError[] */ - private $libxmlErrors; - - /** - * ManifestDocumentLoadingException constructor. - * - * @param LibXMLError[] $libxmlErrors - */ - public function __construct(array $libxmlErrors) { - $this->libxmlErrors = $libxmlErrors; - $first = $this->libxmlErrors[0]; - - parent::__construct( - \sprintf( - '%s (Line: %d / Column: %d / File: %s)', - $first->message, - $first->line, - $first->column, - $first->file - ), - $first->code - ); - } - - /** - * @return LibXMLError[] - */ - public function getLibxmlErrors(): array { - return $this->libxmlErrors; - } -} diff --git a/vendor/phar-io/manifest/src/exceptions/ManifestDocumentMapperException.php b/vendor/phar-io/manifest/src/exceptions/ManifestDocumentMapperException.php deleted file mode 100644 index 43373bd..0000000 --- a/vendor/phar-io/manifest/src/exceptions/ManifestDocumentMapperException.php +++ /dev/null @@ -1,5 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class Application extends Type { - public function isApplication(): bool { - return true; - } -} diff --git a/vendor/phar-io/manifest/src/values/ApplicationName.php b/vendor/phar-io/manifest/src/values/ApplicationName.php deleted file mode 100644 index d71744a..0000000 --- a/vendor/phar-io/manifest/src/values/ApplicationName.php +++ /dev/null @@ -1,37 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class ApplicationName { - /** @var string */ - private $name; - - public function __construct(string $name) { - $this->ensureValidFormat($name); - $this->name = $name; - } - - public function asString(): string { - return $this->name; - } - - public function isEqual(ApplicationName $name): bool { - return $this->name === $name->name; - } - - private function ensureValidFormat(string $name): void { - if (!\preg_match('#\w/\w#', $name)) { - throw new InvalidApplicationNameException( - \sprintf('Format of name "%s" is not valid - expected: vendor/packagename', $name), - InvalidApplicationNameException::InvalidFormat - ); - } - } -} diff --git a/vendor/phar-io/manifest/src/values/Author.php b/vendor/phar-io/manifest/src/values/Author.php deleted file mode 100644 index 82b666e..0000000 --- a/vendor/phar-io/manifest/src/values/Author.php +++ /dev/null @@ -1,39 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class Author { - /** @var string */ - private $name; - - /** @var Email */ - private $email; - - public function __construct(string $name, Email $email) { - $this->name = $name; - $this->email = $email; - } - - public function asString(): string { - return \sprintf( - '%s <%s>', - $this->name, - $this->email->asString() - ); - } - - public function getName(): string { - return $this->name; - } - - public function getEmail(): Email { - return $this->email; - } -} diff --git a/vendor/phar-io/manifest/src/values/AuthorCollection.php b/vendor/phar-io/manifest/src/values/AuthorCollection.php deleted file mode 100644 index 27e50ad..0000000 --- a/vendor/phar-io/manifest/src/values/AuthorCollection.php +++ /dev/null @@ -1,34 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class AuthorCollection implements \Countable, \IteratorAggregate { - /** @var Author[] */ - private $authors = []; - - public function add(Author $author): void { - $this->authors[] = $author; - } - - /** - * @return Author[] - */ - public function getAuthors(): array { - return $this->authors; - } - - public function count(): int { - return \count($this->authors); - } - - public function getIterator(): AuthorCollectionIterator { - return new AuthorCollectionIterator($this); - } -} diff --git a/vendor/phar-io/manifest/src/values/AuthorCollectionIterator.php b/vendor/phar-io/manifest/src/values/AuthorCollectionIterator.php deleted file mode 100644 index 4ff3c39..0000000 --- a/vendor/phar-io/manifest/src/values/AuthorCollectionIterator.php +++ /dev/null @@ -1,42 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class AuthorCollectionIterator implements \Iterator { - /** @var Author[] */ - private $authors; - - /** @var int */ - private $position = 0; - - public function __construct(AuthorCollection $authors) { - $this->authors = $authors->getAuthors(); - } - - public function rewind(): void { - $this->position = 0; - } - - public function valid(): bool { - return $this->position < \count($this->authors); - } - - public function key(): int { - return $this->position; - } - - public function current(): Author { - return $this->authors[$this->position]; - } - - public function next(): void { - $this->position++; - } -} diff --git a/vendor/phar-io/manifest/src/values/BundledComponent.php b/vendor/phar-io/manifest/src/values/BundledComponent.php deleted file mode 100644 index ea77b44..0000000 --- a/vendor/phar-io/manifest/src/values/BundledComponent.php +++ /dev/null @@ -1,33 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -use PharIo\Version\Version; - -class BundledComponent { - /** @var string */ - private $name; - - /** @var Version */ - private $version; - - public function __construct(string $name, Version $version) { - $this->name = $name; - $this->version = $version; - } - - public function getName(): string { - return $this->name; - } - - public function getVersion(): Version { - return $this->version; - } -} diff --git a/vendor/phar-io/manifest/src/values/BundledComponentCollection.php b/vendor/phar-io/manifest/src/values/BundledComponentCollection.php deleted file mode 100644 index b628eaa..0000000 --- a/vendor/phar-io/manifest/src/values/BundledComponentCollection.php +++ /dev/null @@ -1,34 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class BundledComponentCollection implements \Countable, \IteratorAggregate { - /** @var BundledComponent[] */ - private $bundledComponents = []; - - public function add(BundledComponent $bundledComponent): void { - $this->bundledComponents[] = $bundledComponent; - } - - /** - * @return BundledComponent[] - */ - public function getBundledComponents(): array { - return $this->bundledComponents; - } - - public function count(): int { - return \count($this->bundledComponents); - } - - public function getIterator(): BundledComponentCollectionIterator { - return new BundledComponentCollectionIterator($this); - } -} diff --git a/vendor/phar-io/manifest/src/values/BundledComponentCollectionIterator.php b/vendor/phar-io/manifest/src/values/BundledComponentCollectionIterator.php deleted file mode 100644 index 462db45..0000000 --- a/vendor/phar-io/manifest/src/values/BundledComponentCollectionIterator.php +++ /dev/null @@ -1,42 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class BundledComponentCollectionIterator implements \Iterator { - /** @var BundledComponent[] */ - private $bundledComponents; - - /** @var int */ - private $position = 0; - - public function __construct(BundledComponentCollection $bundledComponents) { - $this->bundledComponents = $bundledComponents->getBundledComponents(); - } - - public function rewind(): void { - $this->position = 0; - } - - public function valid(): bool { - return $this->position < \count($this->bundledComponents); - } - - public function key(): int { - return $this->position; - } - - public function current(): BundledComponent { - return $this->bundledComponents[$this->position]; - } - - public function next(): void { - $this->position++; - } -} diff --git a/vendor/phar-io/manifest/src/values/CopyrightInformation.php b/vendor/phar-io/manifest/src/values/CopyrightInformation.php deleted file mode 100644 index d26f947..0000000 --- a/vendor/phar-io/manifest/src/values/CopyrightInformation.php +++ /dev/null @@ -1,31 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class CopyrightInformation { - /** @var AuthorCollection */ - private $authors; - - /** @var License */ - private $license; - - public function __construct(AuthorCollection $authors, License $license) { - $this->authors = $authors; - $this->license = $license; - } - - public function getAuthors(): AuthorCollection { - return $this->authors; - } - - public function getLicense(): License { - return $this->license; - } -} diff --git a/vendor/phar-io/manifest/src/values/Email.php b/vendor/phar-io/manifest/src/values/Email.php deleted file mode 100644 index 588348d..0000000 --- a/vendor/phar-io/manifest/src/values/Email.php +++ /dev/null @@ -1,31 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class Email { - /** @var string */ - private $email; - - public function __construct(string $email) { - $this->ensureEmailIsValid($email); - - $this->email = $email; - } - - public function asString(): string { - return $this->email; - } - - private function ensureEmailIsValid(string $url): void { - if (\filter_var($url, \FILTER_VALIDATE_EMAIL) === false) { - throw new InvalidEmailException; - } - } -} diff --git a/vendor/phar-io/manifest/src/values/Extension.php b/vendor/phar-io/manifest/src/values/Extension.php deleted file mode 100644 index 4c5726f..0000000 --- a/vendor/phar-io/manifest/src/values/Extension.php +++ /dev/null @@ -1,46 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -use PharIo\Version\Version; -use PharIo\Version\VersionConstraint; - -class Extension extends Type { - /** @var ApplicationName */ - private $application; - - /** @var VersionConstraint */ - private $versionConstraint; - - public function __construct(ApplicationName $application, VersionConstraint $versionConstraint) { - $this->application = $application; - $this->versionConstraint = $versionConstraint; - } - - public function getApplicationName(): ApplicationName { - return $this->application; - } - - public function getVersionConstraint(): VersionConstraint { - return $this->versionConstraint; - } - - public function isExtension(): bool { - return true; - } - - public function isExtensionFor(ApplicationName $name): bool { - return $this->application->isEqual($name); - } - - public function isCompatibleWith(ApplicationName $name, Version $version): bool { - return $this->isExtensionFor($name) && $this->versionConstraint->complies($version); - } -} diff --git a/vendor/phar-io/manifest/src/values/Library.php b/vendor/phar-io/manifest/src/values/Library.php deleted file mode 100644 index 21849e1..0000000 --- a/vendor/phar-io/manifest/src/values/Library.php +++ /dev/null @@ -1,16 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class Library extends Type { - public function isLibrary(): bool { - return true; - } -} diff --git a/vendor/phar-io/manifest/src/values/License.php b/vendor/phar-io/manifest/src/values/License.php deleted file mode 100644 index 39542fe..0000000 --- a/vendor/phar-io/manifest/src/values/License.php +++ /dev/null @@ -1,31 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class License { - /** @var string */ - private $name; - - /** @var Url */ - private $url; - - public function __construct(string $name, Url $url) { - $this->name = $name; - $this->url = $url; - } - - public function getName(): string { - return $this->name; - } - - public function getUrl(): Url { - return $this->url; - } -} diff --git a/vendor/phar-io/manifest/src/values/Manifest.php b/vendor/phar-io/manifest/src/values/Manifest.php deleted file mode 100644 index 0140b84..0000000 --- a/vendor/phar-io/manifest/src/values/Manifest.php +++ /dev/null @@ -1,92 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -use PharIo\Version\Version; - -class Manifest { - /** @var ApplicationName */ - private $name; - - /** @var Version */ - private $version; - - /** @var Type */ - private $type; - - /** @var CopyrightInformation */ - private $copyrightInformation; - - /** @var RequirementCollection */ - private $requirements; - - /** @var BundledComponentCollection */ - private $bundledComponents; - - public function __construct(ApplicationName $name, Version $version, Type $type, CopyrightInformation $copyrightInformation, RequirementCollection $requirements, BundledComponentCollection $bundledComponents) { - $this->name = $name; - $this->version = $version; - $this->type = $type; - $this->copyrightInformation = $copyrightInformation; - $this->requirements = $requirements; - $this->bundledComponents = $bundledComponents; - } - - public function getName(): ApplicationName { - return $this->name; - } - - public function getVersion(): Version { - return $this->version; - } - - public function getType(): Type { - return $this->type; - } - - public function getCopyrightInformation(): CopyrightInformation { - return $this->copyrightInformation; - } - - public function getRequirements(): RequirementCollection { - return $this->requirements; - } - - public function getBundledComponents(): BundledComponentCollection { - return $this->bundledComponents; - } - - public function isApplication(): bool { - return $this->type->isApplication(); - } - - public function isLibrary(): bool { - return $this->type->isLibrary(); - } - - public function isExtension(): bool { - return $this->type->isExtension(); - } - - public function isExtensionFor(ApplicationName $application, Version $version = null): bool { - if (!$this->isExtension()) { - return false; - } - - /** @var Extension $type */ - $type = $this->type; - - if ($version !== null) { - return $type->isCompatibleWith($application, $version); - } - - return $type->isExtensionFor($application); - } -} diff --git a/vendor/phar-io/manifest/src/values/PhpExtensionRequirement.php b/vendor/phar-io/manifest/src/values/PhpExtensionRequirement.php deleted file mode 100644 index 088f385..0000000 --- a/vendor/phar-io/manifest/src/values/PhpExtensionRequirement.php +++ /dev/null @@ -1,23 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class PhpExtensionRequirement implements Requirement { - /** @var string */ - private $extension; - - public function __construct(string $extension) { - $this->extension = $extension; - } - - public function asString(): string { - return $this->extension; - } -} diff --git a/vendor/phar-io/manifest/src/values/PhpVersionRequirement.php b/vendor/phar-io/manifest/src/values/PhpVersionRequirement.php deleted file mode 100644 index f8d6f6d..0000000 --- a/vendor/phar-io/manifest/src/values/PhpVersionRequirement.php +++ /dev/null @@ -1,25 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -use PharIo\Version\VersionConstraint; - -class PhpVersionRequirement implements Requirement { - /** @var VersionConstraint */ - private $versionConstraint; - - public function __construct(VersionConstraint $versionConstraint) { - $this->versionConstraint = $versionConstraint; - } - - public function getVersionConstraint(): VersionConstraint { - return $this->versionConstraint; - } -} diff --git a/vendor/phar-io/manifest/src/values/Requirement.php b/vendor/phar-io/manifest/src/values/Requirement.php deleted file mode 100644 index 8b845d6..0000000 --- a/vendor/phar-io/manifest/src/values/Requirement.php +++ /dev/null @@ -1,13 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -interface Requirement { -} diff --git a/vendor/phar-io/manifest/src/values/RequirementCollection.php b/vendor/phar-io/manifest/src/values/RequirementCollection.php deleted file mode 100644 index b82cd95..0000000 --- a/vendor/phar-io/manifest/src/values/RequirementCollection.php +++ /dev/null @@ -1,34 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class RequirementCollection implements \Countable, \IteratorAggregate { - /** @var Requirement[] */ - private $requirements = []; - - public function add(Requirement $requirement): void { - $this->requirements[] = $requirement; - } - - /** - * @return Requirement[] - */ - public function getRequirements(): array { - return $this->requirements; - } - - public function count(): int { - return \count($this->requirements); - } - - public function getIterator(): RequirementCollectionIterator { - return new RequirementCollectionIterator($this); - } -} diff --git a/vendor/phar-io/manifest/src/values/RequirementCollectionIterator.php b/vendor/phar-io/manifest/src/values/RequirementCollectionIterator.php deleted file mode 100644 index 5614eaf..0000000 --- a/vendor/phar-io/manifest/src/values/RequirementCollectionIterator.php +++ /dev/null @@ -1,42 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class RequirementCollectionIterator implements \Iterator { - /** @var Requirement[] */ - private $requirements; - - /** @var int */ - private $position = 0; - - public function __construct(RequirementCollection $requirements) { - $this->requirements = $requirements->getRequirements(); - } - - public function rewind(): void { - $this->position = 0; - } - - public function valid(): bool { - return $this->position < \count($this->requirements); - } - - public function key(): int { - return $this->position; - } - - public function current(): Requirement { - return $this->requirements[$this->position]; - } - - public function next(): void { - $this->position++; - } -} diff --git a/vendor/phar-io/manifest/src/values/Type.php b/vendor/phar-io/manifest/src/values/Type.php deleted file mode 100644 index 23b2898..0000000 --- a/vendor/phar-io/manifest/src/values/Type.php +++ /dev/null @@ -1,41 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -use PharIo\Version\VersionConstraint; - -abstract class Type { - public static function application(): Application { - return new Application; - } - - public static function library(): Library { - return new Library; - } - - public static function extension(ApplicationName $application, VersionConstraint $versionConstraint): Extension { - return new Extension($application, $versionConstraint); - } - - /** @psalm-assert-if-true Application $this */ - public function isApplication(): bool { - return false; - } - - /** @psalm-assert-if-true Library $this */ - public function isLibrary(): bool { - return false; - } - - /** @psalm-assert-if-true Extension $this */ - public function isExtension(): bool { - return false; - } -} diff --git a/vendor/phar-io/manifest/src/values/Url.php b/vendor/phar-io/manifest/src/values/Url.php deleted file mode 100644 index 6395253..0000000 --- a/vendor/phar-io/manifest/src/values/Url.php +++ /dev/null @@ -1,36 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class Url { - /** @var string */ - private $url; - - public function __construct(string $url) { - $this->ensureUrlIsValid($url); - - $this->url = $url; - } - - public function asString(): string { - return $this->url; - } - - /** - * @param string $url - * - * @throws InvalidUrlException - */ - private function ensureUrlIsValid($url): void { - if (\filter_var($url, \FILTER_VALIDATE_URL) === false) { - throw new InvalidUrlException; - } - } -} diff --git a/vendor/phar-io/manifest/src/xml/AuthorElement.php b/vendor/phar-io/manifest/src/xml/AuthorElement.php deleted file mode 100644 index c454b27..0000000 --- a/vendor/phar-io/manifest/src/xml/AuthorElement.php +++ /dev/null @@ -1,20 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class AuthorElement extends ManifestElement { - public function getName(): string { - return $this->getAttributeValue('name'); - } - - public function getEmail(): string { - return $this->getAttributeValue('email'); - } -} diff --git a/vendor/phar-io/manifest/src/xml/AuthorElementCollection.php b/vendor/phar-io/manifest/src/xml/AuthorElementCollection.php deleted file mode 100644 index a54147e..0000000 --- a/vendor/phar-io/manifest/src/xml/AuthorElementCollection.php +++ /dev/null @@ -1,18 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class AuthorElementCollection extends ElementCollection { - public function current(): AuthorElement { - return new AuthorElement( - $this->getCurrentElement() - ); - } -} diff --git a/vendor/phar-io/manifest/src/xml/BundlesElement.php b/vendor/phar-io/manifest/src/xml/BundlesElement.php deleted file mode 100644 index eb2105a..0000000 --- a/vendor/phar-io/manifest/src/xml/BundlesElement.php +++ /dev/null @@ -1,18 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class BundlesElement extends ManifestElement { - public function getComponentElements(): ComponentElementCollection { - return new ComponentElementCollection( - $this->getChildrenByName('component') - ); - } -} diff --git a/vendor/phar-io/manifest/src/xml/ComponentElement.php b/vendor/phar-io/manifest/src/xml/ComponentElement.php deleted file mode 100644 index 7f6a5ec..0000000 --- a/vendor/phar-io/manifest/src/xml/ComponentElement.php +++ /dev/null @@ -1,20 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class ComponentElement extends ManifestElement { - public function getName(): string { - return $this->getAttributeValue('name'); - } - - public function getVersion(): string { - return $this->getAttributeValue('version'); - } -} diff --git a/vendor/phar-io/manifest/src/xml/ComponentElementCollection.php b/vendor/phar-io/manifest/src/xml/ComponentElementCollection.php deleted file mode 100644 index 23bcbd2..0000000 --- a/vendor/phar-io/manifest/src/xml/ComponentElementCollection.php +++ /dev/null @@ -1,18 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class ComponentElementCollection extends ElementCollection { - public function current(): ComponentElement { - return new ComponentElement( - $this->getCurrentElement() - ); - } -} diff --git a/vendor/phar-io/manifest/src/xml/ContainsElement.php b/vendor/phar-io/manifest/src/xml/ContainsElement.php deleted file mode 100644 index ebef49d..0000000 --- a/vendor/phar-io/manifest/src/xml/ContainsElement.php +++ /dev/null @@ -1,30 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class ContainsElement extends ManifestElement { - public function getName(): string { - return $this->getAttributeValue('name'); - } - - public function getVersion(): string { - return $this->getAttributeValue('version'); - } - - public function getType(): string { - return $this->getAttributeValue('type'); - } - - public function getExtensionElement(): ExtensionElement { - return new ExtensionElement( - $this->getChildByName('extension') - ); - } -} diff --git a/vendor/phar-io/manifest/src/xml/CopyrightElement.php b/vendor/phar-io/manifest/src/xml/CopyrightElement.php deleted file mode 100644 index 3debe7d..0000000 --- a/vendor/phar-io/manifest/src/xml/CopyrightElement.php +++ /dev/null @@ -1,24 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class CopyrightElement extends ManifestElement { - public function getAuthorElements(): AuthorElementCollection { - return new AuthorElementCollection( - $this->getChildrenByName('author') - ); - } - - public function getLicenseElement(): LicenseElement { - return new LicenseElement( - $this->getChildByName('license') - ); - } -} diff --git a/vendor/phar-io/manifest/src/xml/ElementCollection.php b/vendor/phar-io/manifest/src/xml/ElementCollection.php deleted file mode 100644 index 26d9250..0000000 --- a/vendor/phar-io/manifest/src/xml/ElementCollection.php +++ /dev/null @@ -1,61 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -use DOMElement; -use DOMNodeList; - -abstract class ElementCollection implements \Iterator { - /** @var DOMElement[] */ - private $nodes = []; - - /** @var int */ - private $position; - - public function __construct(DOMNodeList $nodeList) { - $this->position = 0; - $this->importNodes($nodeList); - } - - #[\ReturnTypeWillChange] - abstract public function current(); - - public function next(): void { - $this->position++; - } - - public function key(): int { - return $this->position; - } - - public function valid(): bool { - return $this->position < \count($this->nodes); - } - - public function rewind(): void { - $this->position = 0; - } - - protected function getCurrentElement(): DOMElement { - return $this->nodes[$this->position]; - } - - private function importNodes(DOMNodeList $nodeList): void { - foreach ($nodeList as $node) { - if (!$node instanceof DOMElement) { - throw new ElementCollectionException( - \sprintf('\DOMElement expected, got \%s', \get_class($node)) - ); - } - - $this->nodes[] = $node; - } - } -} diff --git a/vendor/phar-io/manifest/src/xml/ExtElement.php b/vendor/phar-io/manifest/src/xml/ExtElement.php deleted file mode 100644 index 257853c..0000000 --- a/vendor/phar-io/manifest/src/xml/ExtElement.php +++ /dev/null @@ -1,16 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class ExtElement extends ManifestElement { - public function getName(): string { - return $this->getAttributeValue('name'); - } -} diff --git a/vendor/phar-io/manifest/src/xml/ExtElementCollection.php b/vendor/phar-io/manifest/src/xml/ExtElementCollection.php deleted file mode 100644 index 0597734..0000000 --- a/vendor/phar-io/manifest/src/xml/ExtElementCollection.php +++ /dev/null @@ -1,18 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class ExtElementCollection extends ElementCollection { - public function current(): ExtElement { - return new ExtElement( - $this->getCurrentElement() - ); - } -} diff --git a/vendor/phar-io/manifest/src/xml/ExtensionElement.php b/vendor/phar-io/manifest/src/xml/ExtensionElement.php deleted file mode 100644 index db067f9..0000000 --- a/vendor/phar-io/manifest/src/xml/ExtensionElement.php +++ /dev/null @@ -1,20 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class ExtensionElement extends ManifestElement { - public function getFor(): string { - return $this->getAttributeValue('for'); - } - - public function getCompatible(): string { - return $this->getAttributeValue('compatible'); - } -} diff --git a/vendor/phar-io/manifest/src/xml/LicenseElement.php b/vendor/phar-io/manifest/src/xml/LicenseElement.php deleted file mode 100644 index 658c3d1..0000000 --- a/vendor/phar-io/manifest/src/xml/LicenseElement.php +++ /dev/null @@ -1,20 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class LicenseElement extends ManifestElement { - public function getType(): string { - return $this->getAttributeValue('type'); - } - - public function getUrl(): string { - return $this->getAttributeValue('url'); - } -} diff --git a/vendor/phar-io/manifest/src/xml/ManifestDocument.php b/vendor/phar-io/manifest/src/xml/ManifestDocument.php deleted file mode 100644 index f88b282..0000000 --- a/vendor/phar-io/manifest/src/xml/ManifestDocument.php +++ /dev/null @@ -1,103 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -use DOMDocument; -use DOMElement; - -class ManifestDocument { - public const XMLNS = 'https://phar.io/xml/manifest/1.0'; - - /** @var DOMDocument */ - private $dom; - - public static function fromFile(string $filename): ManifestDocument { - if (!\file_exists($filename)) { - throw new ManifestDocumentException( - \sprintf('File "%s" not found', $filename) - ); - } - - return self::fromString( - \file_get_contents($filename) - ); - } - - public static function fromString(string $xmlString): ManifestDocument { - $prev = \libxml_use_internal_errors(true); - \libxml_clear_errors(); - - $dom = new DOMDocument(); - $dom->loadXML($xmlString); - - $errors = \libxml_get_errors(); - \libxml_use_internal_errors($prev); - - if (\count($errors) !== 0) { - throw new ManifestDocumentLoadingException($errors); - } - - return new self($dom); - } - - private function __construct(DOMDocument $dom) { - $this->ensureCorrectDocumentType($dom); - - $this->dom = $dom; - } - - public function getContainsElement(): ContainsElement { - return new ContainsElement( - $this->fetchElementByName('contains') - ); - } - - public function getCopyrightElement(): CopyrightElement { - return new CopyrightElement( - $this->fetchElementByName('copyright') - ); - } - - public function getRequiresElement(): RequiresElement { - return new RequiresElement( - $this->fetchElementByName('requires') - ); - } - - public function hasBundlesElement(): bool { - return $this->dom->getElementsByTagNameNS(self::XMLNS, 'bundles')->length === 1; - } - - public function getBundlesElement(): BundlesElement { - return new BundlesElement( - $this->fetchElementByName('bundles') - ); - } - - private function ensureCorrectDocumentType(DOMDocument $dom): void { - $root = $dom->documentElement; - - if ($root->localName !== 'phar' || $root->namespaceURI !== self::XMLNS) { - throw new ManifestDocumentException('Not a phar.io manifest document'); - } - } - - private function fetchElementByName(string $elementName): DOMElement { - $element = $this->dom->getElementsByTagNameNS(self::XMLNS, $elementName)->item(0); - - if (!$element instanceof DOMElement) { - throw new ManifestDocumentException( - \sprintf('Element %s missing', $elementName) - ); - } - - return $element; - } -} diff --git a/vendor/phar-io/manifest/src/xml/ManifestElement.php b/vendor/phar-io/manifest/src/xml/ManifestElement.php deleted file mode 100644 index 1f57f54..0000000 --- a/vendor/phar-io/manifest/src/xml/ManifestElement.php +++ /dev/null @@ -1,66 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -use DOMElement; -use DOMNodeList; - -class ManifestElement { - public const XMLNS = 'https://phar.io/xml/manifest/1.0'; - - /** @var DOMElement */ - private $element; - - public function __construct(DOMElement $element) { - $this->element = $element; - } - - protected function getAttributeValue(string $name): string { - if (!$this->element->hasAttribute($name)) { - throw new ManifestElementException( - \sprintf( - 'Attribute %s not set on element %s', - $name, - $this->element->localName - ) - ); - } - - return $this->element->getAttribute($name); - } - - protected function getChildByName(string $elementName): DOMElement { - $element = $this->element->getElementsByTagNameNS(self::XMLNS, $elementName)->item(0); - - if (!$element instanceof DOMElement) { - throw new ManifestElementException( - \sprintf('Element %s missing', $elementName) - ); - } - - return $element; - } - - protected function getChildrenByName(string $elementName): DOMNodeList { - $elementList = $this->element->getElementsByTagNameNS(self::XMLNS, $elementName); - - if ($elementList->length === 0) { - throw new ManifestElementException( - \sprintf('Element(s) %s missing', $elementName) - ); - } - - return $elementList; - } - - protected function hasChild(string $elementName): bool { - return $this->element->getElementsByTagNameNS(self::XMLNS, $elementName)->length !== 0; - } -} diff --git a/vendor/phar-io/manifest/src/xml/PhpElement.php b/vendor/phar-io/manifest/src/xml/PhpElement.php deleted file mode 100644 index c5c906c..0000000 --- a/vendor/phar-io/manifest/src/xml/PhpElement.php +++ /dev/null @@ -1,26 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class PhpElement extends ManifestElement { - public function getVersion(): string { - return $this->getAttributeValue('version'); - } - - public function hasExtElements(): bool { - return $this->hasChild('ext'); - } - - public function getExtElements(): ExtElementCollection { - return new ExtElementCollection( - $this->getChildrenByName('ext') - ); - } -} diff --git a/vendor/phar-io/manifest/src/xml/RequiresElement.php b/vendor/phar-io/manifest/src/xml/RequiresElement.php deleted file mode 100644 index b7cd41e..0000000 --- a/vendor/phar-io/manifest/src/xml/RequiresElement.php +++ /dev/null @@ -1,18 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class RequiresElement extends ManifestElement { - public function getPHPElement(): PhpElement { - return new PhpElement( - $this->getChildByName('php') - ); - } -} diff --git a/vendor/phar-io/version/CHANGELOG.md b/vendor/phar-io/version/CHANGELOG.md deleted file mode 100644 index dc8e357..0000000 --- a/vendor/phar-io/version/CHANGELOG.md +++ /dev/null @@ -1,121 +0,0 @@ -# Changelog - -All notable changes to phar-io/version are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. - -## [3.1.0] - 2021-02-23 - ->### Changed - -- Internal Refactoring -- More scalar types - -### Added - -- [#24](https://github.com/phar-io/version/issues/24): `Version::getOriginalString()` added (Thanks @addshore) -- Version constraints using the caret operator (`^`) now honor pre-1.0 releases, e.g. `^0.3` translates to `0.3.*`) -- Various integration tests for version constraint processing - -### Fixed - -- [#23](https://github.com/phar-io/version/pull/23): Tilde operator without patch level - - - -## [3.0.4] - 14.12.2020 - -### Fixed - -- [#22](https://github.com/phar-io/version/pull/22): make dev suffix rank works for uppercase too - -## [3.0.3] - 30.11.2020 - -### Added - -- Comparator method `Version::equals()` added - - -## [3.0.2] - 27.06.2020 - -This release now supports PHP 7.2+ and PHP ^8.0. No other changes included. - - -## [3.0.1] - 09.05.2020 - -__Potential BC Break Notice:__ -`Version::getVersionString()` no longer returns `v` prefixes in case the "input" -string contained one. These are not part of the semver specs -(see https://semver.org/#is-v123-a-semantic-version) and get stripped out. -As of Version 3.1.0 `Version::getOriginalString()` can be used to still -retrieve it as given. - -### Changed - -- Internal Refactoring -- More scalar types - -### Fixed - -- Fixed Constraint processing Regression for ^1.2 and ~1.2 - - -## [3.0.0] - 05.05.2020 - -### Changed - -- Require PHP 7.2+ -- All code now uses strict mode -- Scalar types have been added as needed - -### Added - -- The technically invalid format using 'v' prefix ("v1.2.3") is now properly supported - - -## [2.0.1] - 08.07.2018 - -### Fixed - -- Versions without a pre-release suffix are now always considered greater -than versions with a pre-release suffix. Example: `3.0.0 > 3.0.0-alpha.1` - - -## [2.0.0] - 23.06.2018 - -Changes to public API: - -- `PreReleaseSuffix::construct()`: optional parameter `$number` removed -- `PreReleaseSuffix::isGreaterThan()`: introduced -- `Version::hasPreReleaseSuffix()`: introduced - -### Added - -- [#11](https://github.com/phar-io/version/issues/11): Added support for pre-release version suffixes. Supported values are: - - `dev` - - `beta` (also abbreviated form `b`) - - `rc` - - `alpha` (also abbreviated form `a`) - - `patch` (also abbreviated form `p`) - - All values can be followed by a number, e.g. `beta3`. - - When comparing versions, the pre-release suffix is taken into account. Example: -`1.5.0 > 1.5.0-beta1 > 1.5.0-alpha3 > 1.5.0-alpha2 > 1.5.0-dev11` - -### Changed - -- reorganized the source directories - -### Fixed - -- [#10](https://github.com/phar-io/version/issues/10): Version numbers containing -a numeric suffix as seen in Debian packages are now supported. - - -[3.1.0]: https://github.com/phar-io/version/compare/3.0.4...3.1.0 -[3.0.4]: https://github.com/phar-io/version/compare/3.0.3...3.0.4 -[3.0.3]: https://github.com/phar-io/version/compare/3.0.2...3.0.3 -[3.0.2]: https://github.com/phar-io/version/compare/3.0.1...3.0.2 -[3.0.1]: https://github.com/phar-io/version/compare/3.0.0...3.0.1 -[3.0.0]: https://github.com/phar-io/version/compare/2.0.1...3.0.0 -[2.0.1]: https://github.com/phar-io/version/compare/2.0.0...2.0.1 -[2.0.0]: https://github.com/phar-io/version/compare/1.0.1...2.0.0 diff --git a/vendor/phar-io/version/LICENSE b/vendor/phar-io/version/LICENSE deleted file mode 100644 index 359dbc5..0000000 --- a/vendor/phar-io/version/LICENSE +++ /dev/null @@ -1,31 +0,0 @@ -phar-io/version - -Copyright (c) 2016-2017 Arne Blankerts , Sebastian Heuer and contributors -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the name of Arne Blankerts nor the names of contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, -OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - diff --git a/vendor/phar-io/version/README.md b/vendor/phar-io/version/README.md deleted file mode 100644 index 76e6e98..0000000 --- a/vendor/phar-io/version/README.md +++ /dev/null @@ -1,61 +0,0 @@ -# Version - -Library for handling version information and constraints - -[![Build Status](https://travis-ci.org/phar-io/version.svg?branch=master)](https://travis-ci.org/phar-io/version) - -## Installation - -You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): - - composer require phar-io/version - -If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: - - composer require --dev phar-io/version - -## Version constraints - -A Version constraint describes a range of versions or a discrete version number. The format of version numbers follows the schema of [semantic versioning](http://semver.org): `..`. A constraint might contain an operator that describes the range. - -Beside the typical mathematical operators like `<=`, `>=`, there are two special operators: - -*Caret operator*: `^1.0` -can be written as `>=1.0.0 <2.0.0` and read as »every Version within major version `1`«. - -*Tilde operator*: `~1.0.0` -can be written as `>=1.0.0 <1.1.0` and read as »every version within minor version `1.1`. The behavior of tilde operator depends on whether a patch level version is provided or not. If no patch level is provided, tilde operator behaves like the caret operator: `~1.0` is identical to `^1.0`. - -## Usage examples - -Parsing version constraints and check discrete versions for compliance: - -```php - -use PharIo\Version\Version; -use PharIo\Version\VersionConstraintParser; - -$parser = new VersionConstraintParser(); -$caret_constraint = $parser->parse( '^7.0' ); - -$caret_constraint->complies( new Version( '7.0.17' ) ); // true -$caret_constraint->complies( new Version( '7.1.0' ) ); // true -$caret_constraint->complies( new Version( '6.4.34' ) ); // false - -$tilde_constraint = $parser->parse( '~1.1.0' ); - -$tilde_constraint->complies( new Version( '1.1.4' ) ); // true -$tilde_constraint->complies( new Version( '1.2.0' ) ); // false -``` - -As of version 2.0.0, pre-release labels are supported and taken into account when comparing versions: - -```php - -$leftVersion = new PharIo\Version\Version('3.0.0-alpha.1'); -$rightVersion = new PharIo\Version\Version('3.0.0-alpha.2'); - -$leftVersion->isGreaterThan($rightVersion); // false -$rightVersion->isGreaterThan($leftVersion); // true - -``` diff --git a/vendor/phar-io/version/composer.json b/vendor/phar-io/version/composer.json deleted file mode 100644 index 22687dc..0000000 --- a/vendor/phar-io/version/composer.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "phar-io/version", - "description": "Library for handling version information and constraints", - "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" - } - ], - "support": { - "issues": "https://github.com/phar-io/version/issues" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "autoload": { - "classmap": [ - "src/" - ] - } -} - diff --git a/vendor/phar-io/version/src/PreReleaseSuffix.php b/vendor/phar-io/version/src/PreReleaseSuffix.php deleted file mode 100644 index 50aa525..0000000 --- a/vendor/phar-io/version/src/PreReleaseSuffix.php +++ /dev/null @@ -1,85 +0,0 @@ - 0, - 'a' => 1, - 'alpha' => 1, - 'b' => 2, - 'beta' => 2, - 'rc' => 3, - 'p' => 4, - 'patch' => 4, - ]; - - /** @var string */ - private $value; - - /** @var int */ - private $valueScore; - - /** @var int */ - private $number = 0; - - /** @var string */ - private $full; - - /** - * @throws InvalidPreReleaseSuffixException - */ - public function __construct(string $value) { - $this->parseValue($value); - } - - public function asString(): string { - return $this->full; - } - - public function getValue(): string { - return $this->value; - } - - public function getNumber(): ?int { - return $this->number; - } - - public function isGreaterThan(PreReleaseSuffix $suffix): bool { - if ($this->valueScore > $suffix->valueScore) { - return true; - } - - if ($this->valueScore < $suffix->valueScore) { - return false; - } - - return $this->getNumber() > $suffix->getNumber(); - } - - private function mapValueToScore(string $value): int { - $value = \strtolower($value); - - if (\array_key_exists($value, self::valueScoreMap)) { - return self::valueScoreMap[$value]; - } - - return 0; - } - - private function parseValue(string $value): void { - $regex = '/-?((dev|beta|b|rc|alpha|a|patch|p)\.?(\d*)).*$/i'; - - if (\preg_match($regex, $value, $matches) !== 1) { - throw new InvalidPreReleaseSuffixException(\sprintf('Invalid label %s', $value)); - } - - $this->full = $matches[1]; - $this->value = $matches[2]; - - if ($matches[3] !== '') { - $this->number = (int)$matches[3]; - } - - $this->valueScore = $this->mapValueToScore($matches[2]); - } -} diff --git a/vendor/phar-io/version/src/Version.php b/vendor/phar-io/version/src/Version.php deleted file mode 100644 index b72ef5e..0000000 --- a/vendor/phar-io/version/src/Version.php +++ /dev/null @@ -1,162 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Version; - -class Version { - /** @var string */ - private $originalVersionString; - - /** @var VersionNumber */ - private $major; - - /** @var VersionNumber */ - private $minor; - - /** @var VersionNumber */ - private $patch; - - /** @var null|PreReleaseSuffix */ - private $preReleaseSuffix; - - public function __construct(string $versionString) { - $this->ensureVersionStringIsValid($versionString); - $this->originalVersionString = $versionString; - } - - public function getPreReleaseSuffix(): PreReleaseSuffix { - if ($this->preReleaseSuffix === null) { - throw new NoPreReleaseSuffixException('No pre-release suffix set'); - } - - return $this->preReleaseSuffix; - } - - public function getOriginalString(): string { - return $this->originalVersionString; - } - - public function getVersionString(): string { - $str = \sprintf( - '%d.%d.%d', - $this->getMajor()->getValue() ?? 0, - $this->getMinor()->getValue() ?? 0, - $this->getPatch()->getValue() ?? 0 - ); - - if (!$this->hasPreReleaseSuffix()) { - return $str; - } - - return $str . '-' . $this->getPreReleaseSuffix()->asString(); - } - - public function hasPreReleaseSuffix(): bool { - return $this->preReleaseSuffix !== null; - } - - public function equals(Version $other): bool { - return $this->getVersionString() === $other->getVersionString(); - } - - public function isGreaterThan(Version $version): bool { - if ($version->getMajor()->getValue() > $this->getMajor()->getValue()) { - return false; - } - - if ($version->getMajor()->getValue() < $this->getMajor()->getValue()) { - return true; - } - - if ($version->getMinor()->getValue() > $this->getMinor()->getValue()) { - return false; - } - - if ($version->getMinor()->getValue() < $this->getMinor()->getValue()) { - return true; - } - - if ($version->getPatch()->getValue() > $this->getPatch()->getValue()) { - return false; - } - - if ($version->getPatch()->getValue() < $this->getPatch()->getValue()) { - return true; - } - - if (!$version->hasPreReleaseSuffix() && !$this->hasPreReleaseSuffix()) { - return false; - } - - if ($version->hasPreReleaseSuffix() && !$this->hasPreReleaseSuffix()) { - return true; - } - - if (!$version->hasPreReleaseSuffix() && $this->hasPreReleaseSuffix()) { - return false; - } - - return $this->getPreReleaseSuffix()->isGreaterThan($version->getPreReleaseSuffix()); - } - - public function getMajor(): VersionNumber { - return $this->major; - } - - public function getMinor(): VersionNumber { - return $this->minor; - } - - public function getPatch(): VersionNumber { - return $this->patch; - } - - /** - * @param string[] $matches - * - * @throws InvalidPreReleaseSuffixException - */ - private function parseVersion(array $matches): void { - $this->major = new VersionNumber((int)$matches['Major']); - $this->minor = new VersionNumber((int)$matches['Minor']); - $this->patch = isset($matches['Patch']) ? new VersionNumber((int)$matches['Patch']) : new VersionNumber(0); - - if (isset($matches['PreReleaseSuffix'])) { - $this->preReleaseSuffix = new PreReleaseSuffix($matches['PreReleaseSuffix']); - } - } - - /** - * @param string $version - * - * @throws InvalidVersionException - */ - private function ensureVersionStringIsValid($version): void { - $regex = '/^v? - (?(0|(?:[1-9]\d*))) - \\. - (?(0|(?:[1-9]\d*))) - (\\. - (?(0|(?:[1-9]\d*))) - )? - (?: - - - (?(?:(dev|beta|b|rc|alpha|a|patch|p)\.?\d*)) - )? - $/xi'; - - if (\preg_match($regex, $version, $matches) !== 1) { - throw new InvalidVersionException( - \sprintf("Version string '%s' does not follow SemVer semantics", $version) - ); - } - - $this->parseVersion($matches); - } -} diff --git a/vendor/phar-io/version/src/VersionConstraintParser.php b/vendor/phar-io/version/src/VersionConstraintParser.php deleted file mode 100644 index 644a86f..0000000 --- a/vendor/phar-io/version/src/VersionConstraintParser.php +++ /dev/null @@ -1,115 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Version; - -class VersionConstraintParser { - /** - * @throws UnsupportedVersionConstraintException - */ - public function parse(string $value): VersionConstraint { - if (\strpos($value, '||') !== false) { - return $this->handleOrGroup($value); - } - - if (!\preg_match('/^[\^~*]?v?[\d.*]+(?:-.*)?$/i', $value)) { - throw new UnsupportedVersionConstraintException( - \sprintf('Version constraint %s is not supported.', $value) - ); - } - - switch ($value[0]) { - case '~': - return $this->handleTildeOperator($value); - case '^': - return $this->handleCaretOperator($value); - } - - $constraint = new VersionConstraintValue($value); - - if ($constraint->getMajor()->isAny()) { - return new AnyVersionConstraint(); - } - - if ($constraint->getMinor()->isAny()) { - return new SpecificMajorVersionConstraint( - $constraint->getVersionString(), - $constraint->getMajor()->getValue() ?? 0 - ); - } - - if ($constraint->getPatch()->isAny()) { - return new SpecificMajorAndMinorVersionConstraint( - $constraint->getVersionString(), - $constraint->getMajor()->getValue() ?? 0, - $constraint->getMinor()->getValue() ?? 0 - ); - } - - return new ExactVersionConstraint($constraint->getVersionString()); - } - - private function handleOrGroup(string $value): OrVersionConstraintGroup { - $constraints = []; - - foreach (\explode('||', $value) as $groupSegment) { - $constraints[] = $this->parse(\trim($groupSegment)); - } - - return new OrVersionConstraintGroup($value, $constraints); - } - - private function handleTildeOperator(string $value): AndVersionConstraintGroup { - $constraintValue = new VersionConstraintValue(\substr($value, 1)); - - if ($constraintValue->getPatch()->isAny()) { - return $this->handleCaretOperator($value); - } - - $constraints = [ - new GreaterThanOrEqualToVersionConstraint( - $value, - new Version(\substr($value, 1)) - ), - new SpecificMajorAndMinorVersionConstraint( - $value, - $constraintValue->getMajor()->getValue() ?? 0, - $constraintValue->getMinor()->getValue() ?? 0 - ) - ]; - - return new AndVersionConstraintGroup($value, $constraints); - } - - private function handleCaretOperator(string $value): AndVersionConstraintGroup { - $constraintValue = new VersionConstraintValue(\substr($value, 1)); - - $constraints = [ - new GreaterThanOrEqualToVersionConstraint($value, new Version(\substr($value, 1))) - ]; - - if ($constraintValue->getMajor()->getValue() === 0) { - $constraints[] = new SpecificMajorAndMinorVersionConstraint( - $value, - $constraintValue->getMajor()->getValue() ?? 0, - $constraintValue->getMinor()->getValue() ?? 0 - ); - } else { - $constraints[] = new SpecificMajorVersionConstraint( - $value, - $constraintValue->getMajor()->getValue() ?? 0 - ); - } - - return new AndVersionConstraintGroup( - $value, - $constraints - ); - } -} diff --git a/vendor/phar-io/version/src/VersionConstraintValue.php b/vendor/phar-io/version/src/VersionConstraintValue.php deleted file mode 100644 index 0762e7c..0000000 --- a/vendor/phar-io/version/src/VersionConstraintValue.php +++ /dev/null @@ -1,88 +0,0 @@ -versionString = $versionString; - - $this->parseVersion($versionString); - } - - public function getLabel(): string { - return $this->label; - } - - public function getBuildMetaData(): string { - return $this->buildMetaData; - } - - public function getVersionString(): string { - return $this->versionString; - } - - public function getMajor(): VersionNumber { - return $this->major; - } - - public function getMinor(): VersionNumber { - return $this->minor; - } - - public function getPatch(): VersionNumber { - return $this->patch; - } - - private function parseVersion(string $versionString): void { - $this->extractBuildMetaData($versionString); - $this->extractLabel($versionString); - $this->stripPotentialVPrefix($versionString); - - $versionSegments = \explode('.', $versionString); - $this->major = new VersionNumber(\is_numeric($versionSegments[0]) ? (int)$versionSegments[0] : null); - - $minorValue = isset($versionSegments[1]) && \is_numeric($versionSegments[1]) ? (int)$versionSegments[1] : null; - $patchValue = isset($versionSegments[2]) && \is_numeric($versionSegments[2]) ? (int)$versionSegments[2] : null; - - $this->minor = new VersionNumber($minorValue); - $this->patch = new VersionNumber($patchValue); - } - - private function extractBuildMetaData(string &$versionString): void { - if (\preg_match('/\+(.*)/', $versionString, $matches) === 1) { - $this->buildMetaData = $matches[1]; - $versionString = \str_replace($matches[0], '', $versionString); - } - } - - private function extractLabel(string &$versionString): void { - if (\preg_match('/-(.*)/', $versionString, $matches) === 1) { - $this->label = $matches[1]; - $versionString = \str_replace($matches[0], '', $versionString); - } - } - - private function stripPotentialVPrefix(string &$versionString): void { - if ($versionString[0] !== 'v') { - return; - } - $versionString = \substr($versionString, 1); - } -} diff --git a/vendor/phar-io/version/src/VersionNumber.php b/vendor/phar-io/version/src/VersionNumber.php deleted file mode 100644 index 4833a9b..0000000 --- a/vendor/phar-io/version/src/VersionNumber.php +++ /dev/null @@ -1,28 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Version; - -class VersionNumber { - - /** @var ?int */ - private $value; - - public function __construct(?int $value) { - $this->value = $value; - } - - public function isAny(): bool { - return $this->value === null; - } - - public function getValue(): ?int { - return $this->value; - } -} diff --git a/vendor/phar-io/version/src/constraints/AbstractVersionConstraint.php b/vendor/phar-io/version/src/constraints/AbstractVersionConstraint.php deleted file mode 100644 index 66201a1..0000000 --- a/vendor/phar-io/version/src/constraints/AbstractVersionConstraint.php +++ /dev/null @@ -1,23 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Version; - -abstract class AbstractVersionConstraint implements VersionConstraint { - /** @var string */ - private $originalValue; - - public function __construct(string $originalValue) { - $this->originalValue = $originalValue; - } - - public function asString(): string { - return $this->originalValue; - } -} diff --git a/vendor/phar-io/version/src/constraints/AndVersionConstraintGroup.php b/vendor/phar-io/version/src/constraints/AndVersionConstraintGroup.php deleted file mode 100644 index 5096f2f..0000000 --- a/vendor/phar-io/version/src/constraints/AndVersionConstraintGroup.php +++ /dev/null @@ -1,34 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Version; - -class AndVersionConstraintGroup extends AbstractVersionConstraint { - /** @var VersionConstraint[] */ - private $constraints = []; - - /** - * @param VersionConstraint[] $constraints - */ - public function __construct(string $originalValue, array $constraints) { - parent::__construct($originalValue); - - $this->constraints = $constraints; - } - - public function complies(Version $version): bool { - foreach ($this->constraints as $constraint) { - if (!$constraint->complies($version)) { - return false; - } - } - - return true; - } -} diff --git a/vendor/phar-io/version/src/constraints/AnyVersionConstraint.php b/vendor/phar-io/version/src/constraints/AnyVersionConstraint.php deleted file mode 100644 index 1499f07..0000000 --- a/vendor/phar-io/version/src/constraints/AnyVersionConstraint.php +++ /dev/null @@ -1,20 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Version; - -class AnyVersionConstraint implements VersionConstraint { - public function complies(Version $version): bool { - return true; - } - - public function asString(): string { - return '*'; - } -} diff --git a/vendor/phar-io/version/src/constraints/ExactVersionConstraint.php b/vendor/phar-io/version/src/constraints/ExactVersionConstraint.php deleted file mode 100644 index 2dd75f9..0000000 --- a/vendor/phar-io/version/src/constraints/ExactVersionConstraint.php +++ /dev/null @@ -1,16 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Version; - -class ExactVersionConstraint extends AbstractVersionConstraint { - public function complies(Version $version): bool { - return $this->asString() === $version->getVersionString(); - } -} diff --git a/vendor/phar-io/version/src/constraints/GreaterThanOrEqualToVersionConstraint.php b/vendor/phar-io/version/src/constraints/GreaterThanOrEqualToVersionConstraint.php deleted file mode 100644 index ec37172..0000000 --- a/vendor/phar-io/version/src/constraints/GreaterThanOrEqualToVersionConstraint.php +++ /dev/null @@ -1,26 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Version; - -class GreaterThanOrEqualToVersionConstraint extends AbstractVersionConstraint { - /** @var Version */ - private $minimalVersion; - - public function __construct(string $originalValue, Version $minimalVersion) { - parent::__construct($originalValue); - - $this->minimalVersion = $minimalVersion; - } - - public function complies(Version $version): bool { - return $version->getVersionString() === $this->minimalVersion->getVersionString() - || $version->isGreaterThan($this->minimalVersion); - } -} diff --git a/vendor/phar-io/version/src/constraints/OrVersionConstraintGroup.php b/vendor/phar-io/version/src/constraints/OrVersionConstraintGroup.php deleted file mode 100644 index 59fd382..0000000 --- a/vendor/phar-io/version/src/constraints/OrVersionConstraintGroup.php +++ /dev/null @@ -1,35 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Version; - -class OrVersionConstraintGroup extends AbstractVersionConstraint { - /** @var VersionConstraint[] */ - private $constraints = []; - - /** - * @param string $originalValue - * @param VersionConstraint[] $constraints - */ - public function __construct($originalValue, array $constraints) { - parent::__construct($originalValue); - - $this->constraints = $constraints; - } - - public function complies(Version $version): bool { - foreach ($this->constraints as $constraint) { - if ($constraint->complies($version)) { - return true; - } - } - - return false; - } -} diff --git a/vendor/phar-io/version/src/constraints/SpecificMajorAndMinorVersionConstraint.php b/vendor/phar-io/version/src/constraints/SpecificMajorAndMinorVersionConstraint.php deleted file mode 100644 index 302aa31..0000000 --- a/vendor/phar-io/version/src/constraints/SpecificMajorAndMinorVersionConstraint.php +++ /dev/null @@ -1,33 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Version; - -class SpecificMajorAndMinorVersionConstraint extends AbstractVersionConstraint { - /** @var int */ - private $major; - - /** @var int */ - private $minor; - - public function __construct(string $originalValue, int $major, int $minor) { - parent::__construct($originalValue); - - $this->major = $major; - $this->minor = $minor; - } - - public function complies(Version $version): bool { - if ($version->getMajor()->getValue() !== $this->major) { - return false; - } - - return $version->getMinor()->getValue() === $this->minor; - } -} diff --git a/vendor/phar-io/version/src/constraints/SpecificMajorVersionConstraint.php b/vendor/phar-io/version/src/constraints/SpecificMajorVersionConstraint.php deleted file mode 100644 index 968b809..0000000 --- a/vendor/phar-io/version/src/constraints/SpecificMajorVersionConstraint.php +++ /dev/null @@ -1,25 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Version; - -class SpecificMajorVersionConstraint extends AbstractVersionConstraint { - /** @var int */ - private $major; - - public function __construct(string $originalValue, int $major) { - parent::__construct($originalValue); - - $this->major = $major; - } - - public function complies(Version $version): bool { - return $version->getMajor()->getValue() === $this->major; - } -} diff --git a/vendor/phar-io/version/src/constraints/VersionConstraint.php b/vendor/phar-io/version/src/constraints/VersionConstraint.php deleted file mode 100644 index e94f9e0..0000000 --- a/vendor/phar-io/version/src/constraints/VersionConstraint.php +++ /dev/null @@ -1,16 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Version; - -interface VersionConstraint { - public function complies(Version $version): bool; - - public function asString(): string; -} diff --git a/vendor/phar-io/version/src/exceptions/Exception.php b/vendor/phar-io/version/src/exceptions/Exception.php deleted file mode 100644 index 3ea458f..0000000 --- a/vendor/phar-io/version/src/exceptions/Exception.php +++ /dev/null @@ -1,15 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Version; - -use Throwable; - -interface Exception extends Throwable { -} diff --git a/vendor/phar-io/version/src/exceptions/InvalidPreReleaseSuffixException.php b/vendor/phar-io/version/src/exceptions/InvalidPreReleaseSuffixException.php deleted file mode 100644 index bc0b0c3..0000000 --- a/vendor/phar-io/version/src/exceptions/InvalidPreReleaseSuffixException.php +++ /dev/null @@ -1,5 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Version; - -final class UnsupportedVersionConstraintException extends \RuntimeException implements Exception { -} diff --git a/vendor/phpdocumentor/reflection-common/.github/dependabot.yml b/vendor/phpdocumentor/reflection-common/.github/dependabot.yml deleted file mode 100644 index c630ffa..0000000 --- a/vendor/phpdocumentor/reflection-common/.github/dependabot.yml +++ /dev/null @@ -1,7 +0,0 @@ -version: 2 -updates: -- package-ecosystem: composer - directory: "/" - schedule: - interval: daily - open-pull-requests-limit: 10 diff --git a/vendor/phpdocumentor/reflection-common/.github/workflows/push.yml b/vendor/phpdocumentor/reflection-common/.github/workflows/push.yml deleted file mode 100644 index 484410e..0000000 --- a/vendor/phpdocumentor/reflection-common/.github/workflows/push.yml +++ /dev/null @@ -1,223 +0,0 @@ -on: - push: - branches: - - 2.x - pull_request: -name: Qa workflow -jobs: - setup: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Restore/cache vendor folder - uses: actions/cache@v1 - with: - path: vendor - key: all-build-${{ hashFiles('**/composer.lock') }} - restore-keys: | - all-build-${{ hashFiles('**/composer.lock') }} - all-build- - - - name: Restore/cache tools folder - uses: actions/cache@v1 - with: - path: tools - key: all-tools-${{ github.sha }} - restore-keys: | - all-tools-${{ github.sha }}- - all-tools- - - - name: composer - uses: docker://composer - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - args: install --no-interaction --prefer-dist --optimize-autoloader - - - name: Install phive - run: make install-phive - - - name: Install PHAR dependencies - run: tools/phive.phar --no-progress install --copy --trust-gpg-keys 4AA394086372C20A,8A03EA3B385DBAA1 --force-accept-unsigned - - phpunit-with-coverage: - runs-on: ubuntu-latest - name: Unit tests - needs: setup - steps: - - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: 7.2 - ini-values: memory_limit=2G, display_errors=On, error_reporting=-1 - coverage: pcov - - - name: Restore/cache tools folder - uses: actions/cache@v1 - with: - path: tools - key: all-tools-${{ github.sha }} - restore-keys: | - all-tools-${{ github.sha }}- - all-tools- - - - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: Cache composer dependencies - uses: actions/cache@v1 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ubuntu-latest-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ubuntu-latest-composer- - - - name: Install Composer dependencies - run: | - composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader - - - name: Run PHPUnit - run: php tools/phpunit - - phpunit: - runs-on: ${{ matrix.operating-system }} - strategy: - matrix: - operating-system: - - ubuntu-latest - - windows-latest - - macOS-latest - php-versions: ['7.2', '7.3', '7.4', '8.0'] - name: Unit tests for PHP version ${{ matrix.php-versions }} on ${{ matrix.operating-system }} - needs: - - setup - - phpunit-with-coverage - steps: - - uses: actions/checkout@v2 - - - name: Restore/cache tools folder - uses: actions/cache@v1 - with: - path: tools - key: all-tools-${{ github.sha }} - restore-keys: | - all-tools-${{ github.sha }}- - all-tools- - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-versions }} - ini-values: memory_limit=2G, display_errors=On, error_reporting=-1 - coverage: none - - - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: Cache composer dependencies - uses: actions/cache@v1 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- - - - name: Install Composer dependencies - run: | - composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader - - - name: Run PHPUnit - continue-on-error: true - run: php tools/phpunit - - codestyle: - runs-on: ubuntu-latest - needs: [setup, phpunit] - steps: - - uses: actions/checkout@v2 - - name: Restore/cache vendor folder - uses: actions/cache@v1 - with: - path: vendor - key: all-build-${{ hashFiles('**/composer.lock') }} - restore-keys: | - all-build-${{ hashFiles('**/composer.lock') }} - all-build- - - name: Code style check - uses: phpDocumentor/coding-standard@latest - with: - args: -s - - phpstan: - runs-on: ubuntu-latest - needs: [setup, phpunit] - steps: - - uses: actions/checkout@v2 - - name: Restore/cache vendor folder - uses: actions/cache@v1 - with: - path: vendor - key: all-build-${{ hashFiles('**/composer.lock') }} - restore-keys: | - all-build-${{ hashFiles('**/composer.lock') }} - all-build- - - name: PHPStan - uses: phpDocumentor/phpstan-ga@latest - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - args: analyse src --configuration phpstan.neon - - psalm: - runs-on: ubuntu-latest - needs: [setup, phpunit] - steps: - - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: 7.2 - ini-values: memory_limit=2G, display_errors=On, error_reporting=-1 - tools: psalm - coverage: none - - - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: Cache composer dependencies - uses: actions/cache@v1 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- - - - name: Install Composer dependencies - run: | - composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader - - - name: Psalm - run: psalm --output-format=github - - bc_check: - name: BC Check - runs-on: ubuntu-latest - needs: [setup, phpunit] - steps: - - uses: actions/checkout@v2 - - name: fetch tags - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* - - name: Restore/cache vendor folder - uses: actions/cache@v1 - with: - path: vendor - key: all-build-${{ hashFiles('**/composer.lock') }} - restore-keys: | - all-build-${{ hashFiles('**/composer.lock') }} - all-build- - - name: Roave BC Check - uses: docker://nyholm/roave-bc-check-ga diff --git a/vendor/phpdocumentor/reflection-common/LICENSE b/vendor/phpdocumentor/reflection-common/LICENSE deleted file mode 100644 index ed6926c..0000000 --- a/vendor/phpdocumentor/reflection-common/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 phpDocumentor - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/vendor/phpdocumentor/reflection-common/README.md b/vendor/phpdocumentor/reflection-common/README.md deleted file mode 100644 index 70f830d..0000000 --- a/vendor/phpdocumentor/reflection-common/README.md +++ /dev/null @@ -1,11 +0,0 @@ -[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) -![Qa workflow](https://github.com/phpDocumentor/ReflectionCommon/workflows/Qa%20workflow/badge.svg) -[![Coveralls Coverage](https://img.shields.io/coveralls/github/phpDocumentor/ReflectionCommon.svg)](https://coveralls.io/github/phpDocumentor/ReflectionCommon?branch=master) -[![Scrutinizer Code Coverage](https://img.shields.io/scrutinizer/coverage/g/phpDocumentor/ReflectionCommon.svg)](https://scrutinizer-ci.com/g/phpDocumentor/ReflectionCommon/?branch=master) -[![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/phpDocumentor/ReflectionCommon.svg)](https://scrutinizer-ci.com/g/phpDocumentor/ReflectionCommon/?branch=master) -[![Stable Version](https://img.shields.io/packagist/v/phpDocumentor/Reflection-Common.svg)](https://packagist.org/packages/phpDocumentor/Reflection-Common) -[![Unstable Version](https://img.shields.io/packagist/vpre/phpDocumentor/Reflection-Common.svg)](https://packagist.org/packages/phpDocumentor/Reflection-Common) - - -ReflectionCommon -================ diff --git a/vendor/phpdocumentor/reflection-common/composer.json b/vendor/phpdocumentor/reflection-common/composer.json deleted file mode 100644 index 4d128b4..0000000 --- a/vendor/phpdocumentor/reflection-common/composer.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "phpdocumentor/reflection-common", - "keywords": ["phpdoc", "phpDocumentor", "reflection", "static analysis", "FQSEN"], - "homepage": "http://www.phpdoc.org", - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "license": "MIT", - "authors": [ - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "require": { - "php": "^7.2 || ^8.0" - }, - "autoload" : { - "psr-4" : { - "phpDocumentor\\Reflection\\": "src/" - } - }, - "require-dev": { - }, - "extra": { - "branch-alias": { - "dev-2.x": "2.x-dev" - } - } -} diff --git a/vendor/phpdocumentor/reflection-common/src/Element.php b/vendor/phpdocumentor/reflection-common/src/Element.php deleted file mode 100644 index 8923e4f..0000000 --- a/vendor/phpdocumentor/reflection-common/src/Element.php +++ /dev/null @@ -1,30 +0,0 @@ -fqsen = $fqsen; - - if (isset($matches[2])) { - $this->name = $matches[2]; - } else { - $matches = explode('\\', $fqsen); - $name = end($matches); - assert(is_string($name)); - $this->name = trim($name, '()'); - } - } - - /** - * converts this class to string. - */ - public function __toString() : string - { - return $this->fqsen; - } - - /** - * Returns the name of the element without path. - */ - public function getName() : string - { - return $this->name; - } -} diff --git a/vendor/phpdocumentor/reflection-common/src/Location.php b/vendor/phpdocumentor/reflection-common/src/Location.php deleted file mode 100644 index 177deed..0000000 --- a/vendor/phpdocumentor/reflection-common/src/Location.php +++ /dev/null @@ -1,53 +0,0 @@ -lineNumber = $lineNumber; - $this->columnNumber = $columnNumber; - } - - /** - * Returns the line number that is covered by this location. - */ - public function getLineNumber() : int - { - return $this->lineNumber; - } - - /** - * Returns the column number (character position on a line) for this location object. - */ - public function getColumnNumber() : int - { - return $this->columnNumber; - } -} diff --git a/vendor/phpdocumentor/reflection-common/src/Project.php b/vendor/phpdocumentor/reflection-common/src/Project.php deleted file mode 100644 index 57839fd..0000000 --- a/vendor/phpdocumentor/reflection-common/src/Project.php +++ /dev/null @@ -1,25 +0,0 @@ -create($docComment); -``` - -The `create` method will yield an object of type `\phpDocumentor\Reflection\DocBlock` -whose methods can be queried: - -```php -// Contains the summary for this DocBlock -$summary = $docblock->getSummary(); - -// Contains \phpDocumentor\Reflection\DocBlock\Description object -$description = $docblock->getDescription(); - -// You can either cast it to string -$description = (string) $docblock->getDescription(); - -// Or use the render method to get a string representation of the Description. -$description = $docblock->getDescription()->render(); -``` - -> For more examples it would be best to review the scripts in the [`/examples` folder](/examples). diff --git a/vendor/phpdocumentor/reflection-docblock/composer-require-config.json b/vendor/phpdocumentor/reflection-docblock/composer-require-config.json deleted file mode 100644 index 19eee4f..0000000 --- a/vendor/phpdocumentor/reflection-docblock/composer-require-config.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "symbol-whitelist" : [ - "null", "true", "false", - "static", "self", "parent", - "array", "string", "int", "float", "bool", "iterable", "callable", "void", "object", "XSLTProcessor" - ], - "php-core-extensions" : [ - "Core", - "pcre", - "Reflection", - "tokenizer", - "SPL", - "standard" - ] -} diff --git a/vendor/phpdocumentor/reflection-docblock/composer.json b/vendor/phpdocumentor/reflection-docblock/composer.json deleted file mode 100644 index 008f1d8..0000000 --- a/vendor/phpdocumentor/reflection-docblock/composer.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "phpdocumentor/reflection-docblock", - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "type": "library", - "license": "MIT", - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - }, - { - "name": "Jaap van Otterdijk", - "email": "account@ijaap.nl" - } - ], - "require": { - "php": "^7.2", - "phpdocumentor/type-resolver": "^1.0", - "webmozart/assert": "^1", - "phpdocumentor/reflection-common": "^2.0", - "ext-filter": "^7.1" - }, - "require-dev": { - "mockery/mockery": "^1", - "doctrine/instantiator": "^1" - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "autoload-dev": { - "psr-4": { - "phpDocumentor\\Reflection\\": "tests/unit" - } - }, - "extra": { - "branch-alias": { - "dev-master": "5.x-dev" - } - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/phive.xml b/vendor/phpdocumentor/reflection-docblock/phive.xml deleted file mode 100644 index 76a2c6a..0000000 --- a/vendor/phpdocumentor/reflection-docblock/phive.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/vendor/phpdocumentor/reflection-docblock/phpcs.xml.dist b/vendor/phpdocumentor/reflection-docblock/phpcs.xml.dist deleted file mode 100644 index b20596d..0000000 --- a/vendor/phpdocumentor/reflection-docblock/phpcs.xml.dist +++ /dev/null @@ -1,17 +0,0 @@ - - - The coding standard for phpDocumentor. - - src - tests/unit - */tests/unit/Types/ContextFactoryTest.php - - - - - - - - */src/*/Abstract*.php - - diff --git a/vendor/phpdocumentor/reflection-docblock/phpstan.neon b/vendor/phpdocumentor/reflection-docblock/phpstan.neon deleted file mode 100644 index b215c6a..0000000 --- a/vendor/phpdocumentor/reflection-docblock/phpstan.neon +++ /dev/null @@ -1,8 +0,0 @@ -includes: - - /composer/vendor/phpstan/phpstan-mockery/extension.neon - - /composer/vendor/phpstan/phpstan-webmozart-assert/extension.neon - -parameters: - level: max - ignoreErrors: - - '#Call to static method Webmozart\\Assert\\Assert::implementsInterface\(\) with class-string#' \ No newline at end of file diff --git a/vendor/phpdocumentor/reflection-docblock/psalm.xml b/vendor/phpdocumentor/reflection-docblock/psalm.xml deleted file mode 100644 index 7324a2c..0000000 --- a/vendor/phpdocumentor/reflection-docblock/psalm.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock.php deleted file mode 100644 index f3403d6..0000000 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock.php +++ /dev/null @@ -1,204 +0,0 @@ -summary = $summary; - $this->description = $description ?: new DocBlock\Description(''); - foreach ($tags as $tag) { - $this->addTag($tag); - } - - $this->context = $context; - $this->location = $location; - - $this->isTemplateEnd = $isTemplateEnd; - $this->isTemplateStart = $isTemplateStart; - } - - public function getSummary() : string - { - return $this->summary; - } - - public function getDescription() : DocBlock\Description - { - return $this->description; - } - - /** - * Returns the current context. - */ - public function getContext() : ?Types\Context - { - return $this->context; - } - - /** - * Returns the current location. - */ - public function getLocation() : ?Location - { - return $this->location; - } - - /** - * Returns whether this DocBlock is the start of a Template section. - * - * A Docblock may serve as template for a series of subsequent DocBlocks. This is indicated by a special marker - * (`#@+`) that is appended directly after the opening `/**` of a DocBlock. - * - * An example of such an opening is: - * - * ``` - * /**#@+ - * * My DocBlock - * * / - * ``` - * - * The description and tags (not the summary!) are copied onto all subsequent DocBlocks and also applied to all - * elements that follow until another DocBlock is found that contains the closing marker (`#@-`). - * - * @see self::isTemplateEnd() for the check whether a closing marker was provided. - */ - public function isTemplateStart() : bool - { - return $this->isTemplateStart; - } - - /** - * Returns whether this DocBlock is the end of a Template section. - * - * @see self::isTemplateStart() for a more complete description of the Docblock Template functionality. - */ - public function isTemplateEnd() : bool - { - return $this->isTemplateEnd; - } - - /** - * Returns the tags for this DocBlock. - * - * @return Tag[] - */ - public function getTags() : array - { - return $this->tags; - } - - /** - * Returns an array of tags matching the given name. If no tags are found - * an empty array is returned. - * - * @param string $name String to search by. - * - * @return Tag[] - */ - public function getTagsByName(string $name) : array - { - $result = []; - - foreach ($this->getTags() as $tag) { - if ($tag->getName() !== $name) { - continue; - } - - $result[] = $tag; - } - - return $result; - } - - /** - * Checks if a tag of a certain type is present in this DocBlock. - * - * @param string $name Tag name to check for. - */ - public function hasTag(string $name) : bool - { - foreach ($this->getTags() as $tag) { - if ($tag->getName() === $name) { - return true; - } - } - - return false; - } - - /** - * Remove a tag from this DocBlock. - * - * @param Tag $tagToRemove The tag to remove. - */ - public function removeTag(Tag $tagToRemove) : void - { - foreach ($this->tags as $key => $tag) { - if ($tag === $tagToRemove) { - unset($this->tags[$key]); - break; - } - } - } - - /** - * Adds a tag to this DocBlock. - * - * @param Tag $tag The tag to add. - */ - private function addTag(Tag $tag) : void - { - $this->tags[] = $tag; - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Description.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Description.php deleted file mode 100644 index 7b11b80..0000000 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Description.php +++ /dev/null @@ -1,114 +0,0 @@ -create('This is a {@see Description}', $context); - * - * The description factory will interpret the given body and create a body template and list of tags from them, and pass - * that onto the constructor if this class. - * - * > The $context variable is a class of type {@see \phpDocumentor\Reflection\Types\Context} and contains the namespace - * > and the namespace aliases that apply to this DocBlock. These are used by the Factory to resolve and expand partial - * > type names and FQSENs. - * - * If you do not want to use the DescriptionFactory you can pass a body template and tag listing like this: - * - * $description = new Description( - * 'This is a %1$s', - * [ new See(new Fqsen('\phpDocumentor\Reflection\DocBlock\Description')) ] - * ); - * - * It is generally recommended to use the Factory as that will also apply escaping rules, while the Description object - * is mainly responsible for rendering. - * - * @see DescriptionFactory to create a new Description. - * @see Description\Formatter for the formatting of the body and tags. - */ -class Description -{ - /** @var string */ - private $bodyTemplate; - - /** @var Tag[] */ - private $tags; - - /** - * Initializes a Description with its body (template) and a listing of the tags used in the body template. - * - * @param Tag[] $tags - */ - public function __construct(string $bodyTemplate, array $tags = []) - { - $this->bodyTemplate = $bodyTemplate; - $this->tags = $tags; - } - - /** - * Returns the body template. - */ - public function getBodyTemplate() : string - { - return $this->bodyTemplate; - } - - /** - * Returns the tags for this DocBlock. - * - * @return Tag[] - */ - public function getTags() : array - { - return $this->tags; - } - - /** - * Renders this description as a string where the provided formatter will format the tags in the expected string - * format. - */ - public function render(?Formatter $formatter = null) : string - { - if ($formatter === null) { - $formatter = new PassthroughFormatter(); - } - - $tags = []; - foreach ($this->tags as $tag) { - $tags[] = '{' . $formatter->format($tag) . '}'; - } - - return vsprintf($this->bodyTemplate, $tags); - } - - /** - * Returns a plain string representation of this description. - */ - public function __toString() : string - { - return $this->render(); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/DescriptionFactory.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/DescriptionFactory.php deleted file mode 100644 index 0501c3c..0000000 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/DescriptionFactory.php +++ /dev/null @@ -1,181 +0,0 @@ -tagFactory = $tagFactory; - } - - /** - * Returns the parsed text of this description. - */ - public function create(string $contents, ?TypeContext $context = null) : Description - { - $tokens = $this->lex($contents); - $count = count($tokens); - $tagCount = 0; - $tags = []; - - for ($i = 1; $i < $count; $i += 2) { - $tags[] = $this->tagFactory->create($tokens[$i], $context); - $tokens[$i] = '%' . ++$tagCount . '$s'; - } - - //In order to allow "literal" inline tags, the otherwise invalid - //sequence "{@}" is changed to "@", and "{}" is changed to "}". - //"%" is escaped to "%%" because of vsprintf. - //See unit tests for examples. - for ($i = 0; $i < $count; $i += 2) { - $tokens[$i] = str_replace(['{@}', '{}', '%'], ['@', '}', '%%'], $tokens[$i]); - } - - return new Description(implode('', $tokens), $tags); - } - - /** - * Strips the contents from superfluous whitespace and splits the description into a series of tokens. - * - * @return string[] A series of tokens of which the description text is composed. - */ - private function lex(string $contents) : array - { - $contents = $this->removeSuperfluousStartingWhitespace($contents); - - // performance optimalization; if there is no inline tag, don't bother splitting it up. - if (strpos($contents, '{@') === false) { - return [$contents]; - } - - $parts = preg_split( - '/\{ - # "{@}" is not a valid inline tag. This ensures that we do not treat it as one, but treat it literally. - (?!@\}) - # We want to capture the whole tag line, but without the inline tag delimiters. - (\@ - # Match everything up to the next delimiter. - [^{}]* - # Nested inline tag content should not be captured, or it will appear in the result separately. - (?: - # Match nested inline tags. - (?: - # Because we did not catch the tag delimiters earlier, we must be explicit with them here. - # Notice that this also matches "{}", as a way to later introduce it as an escape sequence. - \{(?1)?\} - | - # Make sure we match hanging "{". - \{ - ) - # Match content after the nested inline tag. - [^{}]* - )* # If there are more inline tags, match them as well. We use "*" since there may not be any - # nested inline tags. - ) - \}/Sux', - $contents, - 0, - PREG_SPLIT_DELIM_CAPTURE - ); - Assert::isArray($parts); - - return $parts; - } - - /** - * Removes the superfluous from a multi-line description. - * - * When a description has more than one line then it can happen that the second and subsequent lines have an - * additional indentation. This is commonly in use with tags like this: - * - * {@}since 1.1.0 This is an example - * description where we have an - * indentation in the second and - * subsequent lines. - * - * If we do not normalize the indentation then we have superfluous whitespace on the second and subsequent - * lines and this may cause rendering issues when, for example, using a Markdown converter. - */ - private function removeSuperfluousStartingWhitespace(string $contents) : string - { - $lines = explode("\n", $contents); - - // if there is only one line then we don't have lines with superfluous whitespace and - // can use the contents as-is - if (count($lines) <= 1) { - return $contents; - } - - // determine how many whitespace characters need to be stripped - $startingSpaceCount = 9999999; - for ($i = 1, $iMax = count($lines); $i < $iMax; ++$i) { - // lines with a no length do not count as they are not indented at all - if (trim($lines[$i]) === '') { - continue; - } - - // determine the number of prefixing spaces by checking the difference in line length before and after - // an ltrim - $startingSpaceCount = min($startingSpaceCount, strlen($lines[$i]) - strlen(ltrim($lines[$i]))); - } - - // strip the number of spaces from each line - if ($startingSpaceCount > 0) { - for ($i = 1, $iMax = count($lines); $i < $iMax; ++$i) { - $lines[$i] = substr($lines[$i], $startingSpaceCount); - } - } - - return implode("\n", $lines); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/ExampleFinder.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/ExampleFinder.php deleted file mode 100644 index 7249efb..0000000 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/ExampleFinder.php +++ /dev/null @@ -1,157 +0,0 @@ -getFilePath(); - - $file = $this->getExampleFileContents($filename); - if (!$file) { - return sprintf('** File not found : %s **', $filename); - } - - return implode('', array_slice($file, $example->getStartingLine() - 1, $example->getLineCount())); - } - - /** - * Registers the project's root directory where an 'examples' folder can be expected. - */ - public function setSourceDirectory(string $directory = '') : void - { - $this->sourceDirectory = $directory; - } - - /** - * Returns the project's root directory where an 'examples' folder can be expected. - */ - public function getSourceDirectory() : string - { - return $this->sourceDirectory; - } - - /** - * Registers a series of directories that may contain examples. - * - * @param string[] $directories - */ - public function setExampleDirectories(array $directories) : void - { - $this->exampleDirectories = $directories; - } - - /** - * Returns a series of directories that may contain examples. - * - * @return string[] - */ - public function getExampleDirectories() : array - { - return $this->exampleDirectories; - } - - /** - * Attempts to find the requested example file and returns its contents or null if no file was found. - * - * This method will try several methods in search of the given example file, the first one it encounters is - * returned: - * - * 1. Iterates through all examples folders for the given filename - * 2. Checks the source folder for the given filename - * 3. Checks the 'examples' folder in the current working directory for examples - * 4. Checks the path relative to the current working directory for the given filename - * - * @return string[] all lines of the example file - */ - private function getExampleFileContents(string $filename) : ?array - { - $normalizedPath = null; - - foreach ($this->exampleDirectories as $directory) { - $exampleFileFromConfig = $this->constructExamplePath($directory, $filename); - if (is_readable($exampleFileFromConfig)) { - $normalizedPath = $exampleFileFromConfig; - break; - } - } - - if (!$normalizedPath) { - if (is_readable($this->getExamplePathFromSource($filename))) { - $normalizedPath = $this->getExamplePathFromSource($filename); - } elseif (is_readable($this->getExamplePathFromExampleDirectory($filename))) { - $normalizedPath = $this->getExamplePathFromExampleDirectory($filename); - } elseif (is_readable($filename)) { - $normalizedPath = $filename; - } - } - - $lines = $normalizedPath && is_readable($normalizedPath) ? file($normalizedPath) : false; - - return $lines !== false ? $lines : null; - } - - /** - * Get example filepath based on the example directory inside your project. - */ - private function getExamplePathFromExampleDirectory(string $file) : string - { - return getcwd() . DIRECTORY_SEPARATOR . 'examples' . DIRECTORY_SEPARATOR . $file; - } - - /** - * Returns a path to the example file in the given directory.. - */ - private function constructExamplePath(string $directory, string $file) : string - { - return rtrim($directory, '\\/') . DIRECTORY_SEPARATOR . $file; - } - - /** - * Get example filepath based on sourcecode. - */ - private function getExamplePathFromSource(string $file) : string - { - return sprintf( - '%s%s%s', - trim($this->getSourceDirectory(), '\\/'), - DIRECTORY_SEPARATOR, - trim($file, '"') - ); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Serializer.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Serializer.php deleted file mode 100644 index 531970b..0000000 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Serializer.php +++ /dev/null @@ -1,151 +0,0 @@ -indent = $indent; - $this->indentString = $indentString; - $this->isFirstLineIndented = $indentFirstLine; - $this->lineLength = $lineLength; - $this->tagFormatter = $tagFormatter ?: new PassthroughFormatter(); - } - - /** - * Generate a DocBlock comment. - * - * @param DocBlock $docblock The DocBlock to serialize. - * - * @return string The serialized doc block. - */ - public function getDocComment(DocBlock $docblock) : string - { - $indent = str_repeat($this->indentString, $this->indent); - $firstIndent = $this->isFirstLineIndented ? $indent : ''; - // 3 === strlen(' * ') - $wrapLength = $this->lineLength ? $this->lineLength - strlen($indent) - 3 : null; - - $text = $this->removeTrailingSpaces( - $indent, - $this->addAsterisksForEachLine( - $indent, - $this->getSummaryAndDescriptionTextBlock($docblock, $wrapLength) - ) - ); - - $comment = $firstIndent . "/**\n"; - if ($text) { - $comment .= $indent . ' * ' . $text . "\n"; - $comment .= $indent . " *\n"; - } - - $comment = $this->addTagBlock($docblock, $wrapLength, $indent, $comment); - - return $comment . $indent . ' */'; - } - - private function removeTrailingSpaces(string $indent, string $text) : string - { - return str_replace( - sprintf("\n%s * \n", $indent), - sprintf("\n%s *\n", $indent), - $text - ); - } - - private function addAsterisksForEachLine(string $indent, string $text) : string - { - return str_replace( - "\n", - sprintf("\n%s * ", $indent), - $text - ); - } - - private function getSummaryAndDescriptionTextBlock(DocBlock $docblock, ?int $wrapLength) : string - { - $text = $docblock->getSummary() . ((string) $docblock->getDescription() ? "\n\n" . $docblock->getDescription() - : ''); - if ($wrapLength !== null) { - $text = wordwrap($text, $wrapLength); - - return $text; - } - - return $text; - } - - private function addTagBlock(DocBlock $docblock, ?int $wrapLength, string $indent, string $comment) : string - { - foreach ($docblock->getTags() as $tag) { - $tagText = $this->tagFormatter->format($tag); - if ($wrapLength !== null) { - $tagText = wordwrap($tagText, $wrapLength); - } - - $tagText = str_replace( - "\n", - sprintf("\n%s * ", $indent), - $tagText - ); - - $comment .= sprintf("%s * %s\n", $indent, $tagText); - } - - return $comment; - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/StandardTagFactory.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/StandardTagFactory.php deleted file mode 100644 index 9a58c29..0000000 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/StandardTagFactory.php +++ /dev/null @@ -1,339 +0,0 @@ - Important: each parameter in addition to the body variable for the `create` method must default to null, otherwise - * > it violates the constraint with the interface; it is recommended to use the {@see Assert::notNull()} method to - * > verify that a dependency is actually passed. - * - * This Factory also features a Service Locator component that is used to pass the right dependencies to the - * `create` method of a tag; each dependency should be registered as a service or as a parameter. - * - * When you want to use a Tag of your own with custom handling you need to call the `registerTagHandler` method, pass - * the name of the tag and a Fully Qualified Class Name pointing to a class that implements the Tag interface. - */ -final class StandardTagFactory implements TagFactory -{ - /** PCRE regular expression matching a tag name. */ - public const REGEX_TAGNAME = '[\w\-\_\\\\:]+'; - - /** - * @var array> An array with a tag as a key, and an - * FQCN to a class that handles it as an array value. - */ - private $tagHandlerMappings = [ - 'author' => Author::class, - 'covers' => Covers::class, - 'deprecated' => Deprecated::class, - // 'example' => '\phpDocumentor\Reflection\DocBlock\Tags\Example', - 'link' => LinkTag::class, - 'method' => Method::class, - 'param' => Param::class, - 'property-read' => PropertyRead::class, - 'property' => Property::class, - 'property-write' => PropertyWrite::class, - 'return' => Return_::class, - 'see' => SeeTag::class, - 'since' => Since::class, - 'source' => Source::class, - 'throw' => Throws::class, - 'throws' => Throws::class, - 'uses' => Uses::class, - 'var' => Var_::class, - 'version' => Version::class, - ]; - - /** - * @var array> An array with a anotation s a key, and an - * FQCN to a class that handles it as an array value. - */ - private $annotationMappings = []; - - /** - * @var ReflectionParameter[][] a lazy-loading cache containing parameters - * for each tagHandler that has been used. - */ - private $tagHandlerParameterCache = []; - - /** @var FqsenResolver */ - private $fqsenResolver; - - /** - * @var mixed[] an array representing a simple Service Locator where we can store parameters and - * services that can be inserted into the Factory Methods of Tag Handlers. - */ - private $serviceLocator = []; - - /** - * Initialize this tag factory with the means to resolve an FQSEN and optionally a list of tag handlers. - * - * If no tag handlers are provided than the default list in the {@see self::$tagHandlerMappings} property - * is used. - * - * @see self::registerTagHandler() to add a new tag handler to the existing default list. - * - * @param array> $tagHandlers - */ - public function __construct(FqsenResolver $fqsenResolver, ?array $tagHandlers = null) - { - $this->fqsenResolver = $fqsenResolver; - if ($tagHandlers !== null) { - $this->tagHandlerMappings = $tagHandlers; - } - - $this->addService($fqsenResolver, FqsenResolver::class); - } - - public function create(string $tagLine, ?TypeContext $context = null) : Tag - { - if (!$context) { - $context = new TypeContext(''); - } - - [$tagName, $tagBody] = $this->extractTagParts($tagLine); - - return $this->createTag(trim($tagBody), $tagName, $context); - } - - /** - * @param mixed $value - */ - public function addParameter(string $name, $value) : void - { - $this->serviceLocator[$name] = $value; - } - - public function addService(object $service, ?string $alias = null) : void - { - $this->serviceLocator[$alias ?: get_class($service)] = $service; - } - - public function registerTagHandler(string $tagName, string $handler) : void - { - Assert::stringNotEmpty($tagName); - Assert::classExists($handler); - Assert::implementsInterface($handler, StaticMethod::class); - - if (strpos($tagName, '\\') && $tagName[0] !== '\\') { - throw new InvalidArgumentException( - 'A namespaced tag must have a leading backslash as it must be fully qualified' - ); - } - - $this->tagHandlerMappings[$tagName] = $handler; - } - - /** - * Extracts all components for a tag. - * - * @return string[] - */ - private function extractTagParts(string $tagLine) : array - { - $matches = []; - if (!preg_match('/^@(' . self::REGEX_TAGNAME . ')((?:[\s\(\{])\s*([^\s].*)|$)/us', $tagLine, $matches)) { - throw new InvalidArgumentException( - 'The tag "' . $tagLine . '" does not seem to be wellformed, please check it for errors' - ); - } - - if (count($matches) < 3) { - $matches[] = ''; - } - - return array_slice($matches, 1); - } - - /** - * Creates a new tag object with the given name and body or returns null if the tag name was recognized but the - * body was invalid. - */ - private function createTag(string $body, string $name, TypeContext $context) : Tag - { - $handlerClassName = $this->findHandlerClassName($name, $context); - $arguments = $this->getArgumentsForParametersFromWiring( - $this->fetchParametersForHandlerFactoryMethod($handlerClassName), - $this->getServiceLocatorWithDynamicParameters($context, $name, $body) - ); - - try { - $callable = [$handlerClassName, 'create']; - Assert::isCallable($callable); - /** @phpstan-var callable(string): ?Tag $callable */ - $tag = call_user_func_array($callable, $arguments); - - return $tag ?? InvalidTag::create($body, $name); - } catch (InvalidArgumentException $e) { - return InvalidTag::create($body, $name)->withError($e); - } - } - - /** - * Determines the Fully Qualified Class Name of the Factory or Tag (containing a Factory Method `create`). - * - * @return class-string - */ - private function findHandlerClassName(string $tagName, TypeContext $context) : string - { - $handlerClassName = Generic::class; - if (isset($this->tagHandlerMappings[$tagName])) { - $handlerClassName = $this->tagHandlerMappings[$tagName]; - } elseif ($this->isAnnotation($tagName)) { - // TODO: Annotation support is planned for a later stage and as such is disabled for now - $tagName = (string) $this->fqsenResolver->resolve($tagName, $context); - if (isset($this->annotationMappings[$tagName])) { - $handlerClassName = $this->annotationMappings[$tagName]; - } - } - - return $handlerClassName; - } - - /** - * Retrieves the arguments that need to be passed to the Factory Method with the given Parameters. - * - * @param ReflectionParameter[] $parameters - * @param mixed[] $locator - * - * @return mixed[] A series of values that can be passed to the Factory Method of the tag whose parameters - * is provided with this method. - */ - private function getArgumentsForParametersFromWiring(array $parameters, array $locator) : array - { - $arguments = []; - foreach ($parameters as $parameter) { - $class = $parameter->getClass(); - $typeHint = null; - if ($class !== null) { - $typeHint = $class->getName(); - } - - if (isset($locator[$typeHint])) { - $arguments[] = $locator[$typeHint]; - continue; - } - - $parameterName = $parameter->getName(); - if (isset($locator[$parameterName])) { - $arguments[] = $locator[$parameterName]; - continue; - } - - $arguments[] = null; - } - - return $arguments; - } - - /** - * Retrieves a series of ReflectionParameter objects for the static 'create' method of the given - * tag handler class name. - * - * @return ReflectionParameter[] - */ - private function fetchParametersForHandlerFactoryMethod(string $handlerClassName) : array - { - if (!isset($this->tagHandlerParameterCache[$handlerClassName])) { - $methodReflection = new ReflectionMethod($handlerClassName, 'create'); - $this->tagHandlerParameterCache[$handlerClassName] = $methodReflection->getParameters(); - } - - return $this->tagHandlerParameterCache[$handlerClassName]; - } - - /** - * Returns a copy of this class' Service Locator with added dynamic parameters, - * such as the tag's name, body and Context. - * - * @param TypeContext $context The Context (namespace and aliasses) that may be - * passed and is used to resolve FQSENs. - * @param string $tagName The name of the tag that may be - * passed onto the factory method of the Tag class. - * @param string $tagBody The body of the tag that may be - * passed onto the factory method of the Tag class. - * - * @return mixed[] - */ - private function getServiceLocatorWithDynamicParameters( - TypeContext $context, - string $tagName, - string $tagBody - ) : array { - return array_merge( - $this->serviceLocator, - [ - 'name' => $tagName, - 'body' => $tagBody, - TypeContext::class => $context, - ] - ); - } - - /** - * Returns whether the given tag belongs to an annotation. - * - * @todo this method should be populated once we implement Annotation notation support. - */ - private function isAnnotation(string $tagContent) : bool - { - // 1. Contains a namespace separator - // 2. Contains parenthesis - // 3. Is present in a list of known annotations (make the algorithm smart by first checking is the last part - // of the annotation class name matches the found tag name - - return false; - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tag.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tag.php deleted file mode 100644 index f55de91..0000000 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tag.php +++ /dev/null @@ -1,32 +0,0 @@ - $handler FQCN of handler. - * - * @throws InvalidArgumentException If the tag name is not a string. - * @throws InvalidArgumentException If the tag name is namespaced (contains backslashes) but - * does not start with a backslash. - * @throws InvalidArgumentException If the handler is not a string. - * @throws InvalidArgumentException If the handler is not an existing class. - * @throws InvalidArgumentException If the handler does not implement the {@see Tag} interface. - */ - public function registerTagHandler(string $tagName, string $handler) : void; -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Author.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Author.php deleted file mode 100644 index f3c49ad..0000000 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Author.php +++ /dev/null @@ -1,92 +0,0 @@ -authorName = $authorName; - $this->authorEmail = $authorEmail; - } - - /** - * Gets the author's name. - * - * @return string The author's name. - */ - public function getAuthorName() : string - { - return $this->authorName; - } - - /** - * Returns the author's email. - * - * @return string The author's email. - */ - public function getEmail() : string - { - return $this->authorEmail; - } - - /** - * Returns this tag in string form. - */ - public function __toString() : string - { - return $this->authorName . ($this->authorEmail !== '' ? ' <' . $this->authorEmail . '>' : ''); - } - - /** - * Attempts to create a new Author object based on †he tag body. - */ - public static function create(string $body) : ?self - { - $splitTagContent = preg_match('/^([^\<]*)(?:\<([^\>]*)\>)?$/u', $body, $matches); - if (!$splitTagContent) { - return null; - } - - $authorName = trim($matches[1]); - $email = isset($matches[2]) ? trim($matches[2]) : ''; - - return new static($authorName, $email); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/BaseTag.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/BaseTag.php deleted file mode 100644 index fbcd402..0000000 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/BaseTag.php +++ /dev/null @@ -1,53 +0,0 @@ -name; - } - - public function getDescription() : ?Description - { - return $this->description; - } - - public function render(?Formatter $formatter = null) : string - { - if ($formatter === null) { - $formatter = new Formatter\PassthroughFormatter(); - } - - return $formatter->format($this); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Covers.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Covers.php deleted file mode 100644 index 77edf4a..0000000 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Covers.php +++ /dev/null @@ -1,78 +0,0 @@ -refers = $refers; - $this->description = $description; - } - - public static function create( - string $body, - ?DescriptionFactory $descriptionFactory = null, - ?FqsenResolver $resolver = null, - ?TypeContext $context = null - ) : self { - Assert::notEmpty($body); - Assert::notNull($descriptionFactory); - Assert::notNull($resolver); - - $parts = preg_split('/\s+/Su', $body, 2); - Assert::isArray($parts); - - return new static( - $resolver->resolve($parts[0], $context), - $descriptionFactory->create($parts[1] ?? '', $context) - ); - } - - /** - * Returns the structural element this tag refers to. - */ - public function getReference() : Fqsen - { - return $this->refers; - } - - /** - * Returns a string representation of this tag. - */ - public function __toString() : string - { - return $this->refers . ($this->description ? ' ' . $this->description->render() : ''); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Deprecated.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Deprecated.php deleted file mode 100644 index 2a9f1bf..0000000 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Deprecated.php +++ /dev/null @@ -1,100 +0,0 @@ -version = $version; - $this->description = $description; - } - - /** - * @return static - */ - public static function create( - ?string $body, - ?DescriptionFactory $descriptionFactory = null, - ?TypeContext $context = null - ) : self { - if (empty($body)) { - return new static(); - } - - $matches = []; - if (!preg_match('/^(' . self::REGEX_VECTOR . ')\s*(.+)?$/sux', $body, $matches)) { - return new static( - null, - $descriptionFactory !== null ? $descriptionFactory->create($body, $context) : null - ); - } - - Assert::notNull($descriptionFactory); - - return new static( - $matches[1], - $descriptionFactory->create($matches[2] ?? '', $context) - ); - } - - /** - * Gets the version section of the tag. - */ - public function getVersion() : ?string - { - return $this->version; - } - - /** - * Returns a string representation for this tag. - */ - public function __toString() : string - { - return ($this->version ?? '') . ($this->description ? ' ' . $this->description->render() : ''); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Example.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Example.php deleted file mode 100644 index 8ccb4fd..0000000 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Example.php +++ /dev/null @@ -1,179 +0,0 @@ -filePath = $filePath; - $this->startingLine = $startingLine; - $this->lineCount = $lineCount; - if ($content !== null) { - $this->content = trim($content); - } - - $this->isURI = $isURI; - } - - public function getContent() : string - { - if ($this->content === null) { - $filePath = '"' . $this->filePath . '"'; - if ($this->isURI) { - $filePath = $this->isUriRelative($this->filePath) - ? str_replace('%2F', '/', rawurlencode($this->filePath)) - : $this->filePath; - } - - return trim($filePath); - } - - return $this->content; - } - - public function getDescription() : ?string - { - return $this->content; - } - - public static function create(string $body) : ?Tag - { - // File component: File path in quotes or File URI / Source information - if (!preg_match('/^(?:\"([^\"]+)\"|(\S+))(?:\s+(.*))?$/sux', $body, $matches)) { - return null; - } - - $filePath = null; - $fileUri = null; - if ($matches[1] !== '') { - $filePath = $matches[1]; - } else { - $fileUri = $matches[2]; - } - - $startingLine = 1; - $lineCount = 0; - $description = null; - - if (array_key_exists(3, $matches)) { - $description = $matches[3]; - - // Starting line / Number of lines / Description - if (preg_match('/^([1-9]\d*)(?:\s+((?1))\s*)?(.*)$/sux', $matches[3], $contentMatches)) { - $startingLine = (int) $contentMatches[1]; - if (isset($contentMatches[2]) && $contentMatches[2] !== '') { - $lineCount = (int) $contentMatches[2]; - } - - if (array_key_exists(3, $contentMatches)) { - $description = $contentMatches[3]; - } - } - } - - return new static( - $filePath ?? ($fileUri ?? ''), - $fileUri !== null, - $startingLine, - $lineCount, - $description - ); - } - - /** - * Returns the file path. - * - * @return string Path to a file to use as an example. - * May also be an absolute URI. - */ - public function getFilePath() : string - { - return $this->filePath; - } - - /** - * Returns a string representation for this tag. - */ - public function __toString() : string - { - return $this->filePath . ($this->content ? ' ' . $this->content : ''); - } - - /** - * Returns true if the provided URI is relative or contains a complete scheme (and thus is absolute). - */ - private function isUriRelative(string $uri) : bool - { - return strpos($uri, ':') === false; - } - - public function getStartingLine() : int - { - return $this->startingLine; - } - - public function getLineCount() : int - { - return $this->lineCount; - } - - public function getName() : string - { - return 'example'; - } - - public function render(?Formatter $formatter = null) : string - { - if ($formatter === null) { - $formatter = new Formatter\PassthroughFormatter(); - } - - return $formatter->format($this); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Factory/StaticMethod.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Factory/StaticMethod.php deleted file mode 100644 index f6f0bb5..0000000 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Factory/StaticMethod.php +++ /dev/null @@ -1,25 +0,0 @@ -maxLen = max($this->maxLen, strlen($tag->getName())); - } - } - - /** - * Formats the given tag to return a simple plain text version. - */ - public function format(Tag $tag) : string - { - return '@' . $tag->getName() . - str_repeat( - ' ', - $this->maxLen - strlen($tag->getName()) + 1 - ) . - $tag; - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Formatter/PassthroughFormatter.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Formatter/PassthroughFormatter.php deleted file mode 100644 index f26d22f..0000000 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Formatter/PassthroughFormatter.php +++ /dev/null @@ -1,29 +0,0 @@ -getName() . ' ' . $tag); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Generic.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Generic.php deleted file mode 100644 index 7509ff1..0000000 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Generic.php +++ /dev/null @@ -1,82 +0,0 @@ -validateTagName($name); - - $this->name = $name; - $this->description = $description; - } - - /** - * Creates a new tag that represents any unknown tag type. - * - * @return static - */ - public static function create( - string $body, - string $name = '', - ?DescriptionFactory $descriptionFactory = null, - ?TypeContext $context = null - ) : self { - Assert::stringNotEmpty($name); - Assert::notNull($descriptionFactory); - - $description = $body !== '' ? $descriptionFactory->create($body, $context) : null; - - return new static($name, $description); - } - - /** - * Returns the tag as a serialized string - */ - public function __toString() : string - { - return $this->description ? $this->description->render() : ''; - } - - /** - * Validates if the tag name matches the expected format, otherwise throws an exception. - */ - private function validateTagName(string $name) : void - { - if (!preg_match('/^' . StandardTagFactory::REGEX_TAGNAME . '$/u', $name)) { - throw new InvalidArgumentException( - 'The tag name "' . $name . '" is not wellformed. Tags may only consist of letters, underscores, ' - . 'hyphens and backslashes.' - ); - } - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/InvalidTag.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/InvalidTag.php deleted file mode 100644 index 9f632cb..0000000 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/InvalidTag.php +++ /dev/null @@ -1,133 +0,0 @@ -name = $name; - $this->body = $body; - } - - public function getException() : ?Throwable - { - return $this->throwable; - } - - public function getName() : string - { - return $this->name; - } - - public static function create(string $body, string $name = '') : self - { - return new self($name, $body); - } - - public function withError(Throwable $exception) : self - { - $this->flattenExceptionBacktrace($exception); - $tag = new self($this->name, $this->body); - $tag->throwable = $exception; - - return $tag; - } - - /** - * Removes all complex types from backtrace - * - * Not all objects are serializable. So we need to remove them from the - * stored exception to be sure that we do not break existing library usage. - */ - private function flattenExceptionBacktrace(Throwable $exception) : void - { - $traceProperty = (new ReflectionClass(Exception::class))->getProperty('trace'); - $traceProperty->setAccessible(true); - - $flatten = - /** @param mixed $value */ - static function (&$value) : void { - if ($value instanceof Closure) { - $closureReflection = new ReflectionFunction($value); - $value = sprintf( - '(Closure at %s:%s)', - $closureReflection->getFileName(), - $closureReflection->getStartLine() - ); - } elseif (is_object($value)) { - $value = sprintf('object(%s)', get_class($value)); - } elseif (is_resource($value)) { - $value = sprintf('resource(%s)', get_resource_type($value)); - } - }; - - do { - $trace = $exception->getTrace(); - if (isset($trace[0]['args'])) { - $trace = array_map( - static function (array $call) use ($flatten) : array { - array_walk_recursive($call['args'], $flatten); - - return $call; - }, - $trace - ); - } - - $traceProperty->setValue($exception, $trace); - $exception = $exception->getPrevious(); - } while ($exception !== null); - - $traceProperty->setAccessible(false); - } - - public function render(?Formatter $formatter = null) : string - { - if ($formatter === null) { - $formatter = new Formatter\PassthroughFormatter(); - } - - return $formatter->format($this); - } - - public function __toString() : string - { - return $this->body; - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Link.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Link.php deleted file mode 100644 index 0588f72..0000000 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Link.php +++ /dev/null @@ -1,71 +0,0 @@ -link = $link; - $this->description = $description; - } - - public static function create( - string $body, - ?DescriptionFactory $descriptionFactory = null, - ?TypeContext $context = null - ) : self { - Assert::notNull($descriptionFactory); - - $parts = preg_split('/\s+/Su', $body, 2); - Assert::isArray($parts); - $description = isset($parts[1]) ? $descriptionFactory->create($parts[1], $context) : null; - - return new static($parts[0], $description); - } - - /** - * Gets the link - */ - public function getLink() : string - { - return $this->link; - } - - /** - * Returns a string representation for this tag. - */ - public function __toString() : string - { - return $this->link . ($this->description ? ' ' . $this->description->render() : ''); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Method.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Method.php deleted file mode 100644 index 834f1bd..0000000 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Method.php +++ /dev/null @@ -1,265 +0,0 @@ - - * @var array> - */ - private $arguments; - - /** @var bool */ - private $isStatic; - - /** @var Type */ - private $returnType; - - /** - * @param array> $arguments - * - * @phpstan-param array $arguments - */ - public function __construct( - string $methodName, - array $arguments = [], - ?Type $returnType = null, - bool $static = false, - ?Description $description = null - ) { - Assert::stringNotEmpty($methodName); - - if ($returnType === null) { - $returnType = new Void_(); - } - - $this->methodName = $methodName; - $this->arguments = $this->filterArguments($arguments); - $this->returnType = $returnType; - $this->isStatic = $static; - $this->description = $description; - } - - public static function create( - string $body, - ?TypeResolver $typeResolver = null, - ?DescriptionFactory $descriptionFactory = null, - ?TypeContext $context = null - ) : ?self { - Assert::stringNotEmpty($body); - Assert::notNull($typeResolver); - Assert::notNull($descriptionFactory); - - // 1. none or more whitespace - // 2. optionally the keyword "static" followed by whitespace - // 3. optionally a word with underscores followed by whitespace : as - // type for the return value - // 4. then optionally a word with underscores followed by () and - // whitespace : as method name as used by phpDocumentor - // 5. then a word with underscores, followed by ( and any character - // until a ) and whitespace : as method name with signature - // 6. any remaining text : as description - if (!preg_match( - '/^ - # Static keyword - # Declares a static method ONLY if type is also present - (?: - (static) - \s+ - )? - # Return type - (?: - ( - (?:[\w\|_\\\\]*\$this[\w\|_\\\\]*) - | - (?: - (?:[\w\|_\\\\]+) - # array notation - (?:\[\])* - )*+ - ) - \s+ - )? - # Method name - ([\w_]+) - # Arguments - (?: - \(([^\)]*)\) - )? - \s* - # Description - (.*) - $/sux', - $body, - $matches - )) { - return null; - } - - [, $static, $returnType, $methodName, $argumentLines, $description] = $matches; - - $static = $static === 'static'; - - if ($returnType === '') { - $returnType = 'void'; - } - - $returnType = $typeResolver->resolve($returnType, $context); - $description = $descriptionFactory->create($description, $context); - - /** @phpstan-var array $arguments */ - $arguments = []; - if ($argumentLines !== '') { - $argumentsExploded = explode(',', $argumentLines); - foreach ($argumentsExploded as $argument) { - $argument = explode(' ', self::stripRestArg(trim($argument)), 2); - if (strpos($argument[0], '$') === 0) { - $argumentName = substr($argument[0], 1); - $argumentType = new Mixed_(); - } else { - $argumentType = $typeResolver->resolve($argument[0], $context); - $argumentName = ''; - if (isset($argument[1])) { - $argument[1] = self::stripRestArg($argument[1]); - $argumentName = substr($argument[1], 1); - } - } - - $arguments[] = ['name' => $argumentName, 'type' => $argumentType]; - } - } - - return new static($methodName, $arguments, $returnType, $static, $description); - } - - /** - * Retrieves the method name. - */ - public function getMethodName() : string - { - return $this->methodName; - } - - /** - * @return array> - * - * @phpstan-return array - */ - public function getArguments() : array - { - return $this->arguments; - } - - /** - * Checks whether the method tag describes a static method or not. - * - * @return bool TRUE if the method declaration is for a static method, FALSE otherwise. - */ - public function isStatic() : bool - { - return $this->isStatic; - } - - public function getReturnType() : Type - { - return $this->returnType; - } - - public function __toString() : string - { - $arguments = []; - foreach ($this->arguments as $argument) { - $arguments[] = $argument['type'] . ' $' . $argument['name']; - } - - return trim(($this->isStatic() ? 'static ' : '') - . (string) $this->returnType . ' ' - . $this->methodName - . '(' . implode(', ', $arguments) . ')' - . ($this->description ? ' ' . $this->description->render() : '')); - } - - /** - * @param mixed[][]|string[] $arguments - * - * @return mixed[][] - * - * @phpstan-param array $arguments - * @phpstan-return array - */ - private function filterArguments(array $arguments = []) : array - { - $result = []; - foreach ($arguments as $argument) { - if (is_string($argument)) { - $argument = ['name' => $argument]; - } - - if (!isset($argument['type'])) { - $argument['type'] = new Mixed_(); - } - - $keys = array_keys($argument); - sort($keys); - if ($keys !== ['name', 'type']) { - throw new InvalidArgumentException( - 'Arguments can only have the "name" and "type" fields, found: ' . var_export($keys, true) - ); - } - - $result[] = $argument; - } - - return $result; - } - - private static function stripRestArg(string $argument) : string - { - if (strpos($argument, '...') === 0) { - $argument = trim(substr($argument, 3)); - } - - return $argument; - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Param.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Param.php deleted file mode 100644 index 7f94361..0000000 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Param.php +++ /dev/null @@ -1,128 +0,0 @@ -name = 'param'; - $this->variableName = $variableName; - $this->type = $type; - $this->isVariadic = $isVariadic; - $this->description = $description; - } - - public static function create( - string $body, - ?TypeResolver $typeResolver = null, - ?DescriptionFactory $descriptionFactory = null, - ?TypeContext $context = null - ) : self { - Assert::stringNotEmpty($body); - Assert::notNull($typeResolver); - Assert::notNull($descriptionFactory); - - [$firstPart, $body] = self::extractTypeFromBody($body); - - $type = null; - $parts = preg_split('/(\s+)/Su', $body, 2, PREG_SPLIT_DELIM_CAPTURE); - Assert::isArray($parts); - $variableName = ''; - $isVariadic = false; - - // if the first item that is encountered is not a variable; it is a type - if ($firstPart && $firstPart[0] !== '$') { - $type = $typeResolver->resolve($firstPart, $context); - } else { - // first part is not a type; we should prepend it to the parts array for further processing - array_unshift($parts, $firstPart); - } - - // if the next item starts with a $ or ...$ it must be the variable name - if (isset($parts[0]) && (strpos($parts[0], '$') === 0 || strpos($parts[0], '...$') === 0)) { - $variableName = array_shift($parts); - array_shift($parts); - - Assert::notNull($variableName); - - if (strpos($variableName, '...') === 0) { - $isVariadic = true; - $variableName = substr($variableName, 3); - } - - if (strpos($variableName, '$') === 0) { - $variableName = substr($variableName, 1); - } - } - - $description = $descriptionFactory->create(implode('', $parts), $context); - - return new static($variableName, $type, $isVariadic, $description); - } - - /** - * Returns the variable's name. - */ - public function getVariableName() : ?string - { - return $this->variableName; - } - - /** - * Returns whether this tag is variadic. - */ - public function isVariadic() : bool - { - return $this->isVariadic; - } - - /** - * Returns a string representation for this tag. - */ - public function __toString() : string - { - return ($this->type ? $this->type . ' ' : '') - . ($this->isVariadic() ? '...' : '') - . ($this->variableName !== null ? '$' . $this->variableName : '') - . ($this->description ? ' ' . $this->description : ''); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Property.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Property.php deleted file mode 100644 index 0da0233..0000000 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Property.php +++ /dev/null @@ -1,104 +0,0 @@ -name = 'property'; - $this->variableName = $variableName; - $this->type = $type; - $this->description = $description; - } - - public static function create( - string $body, - ?TypeResolver $typeResolver = null, - ?DescriptionFactory $descriptionFactory = null, - ?TypeContext $context = null - ) : self { - Assert::stringNotEmpty($body); - Assert::notNull($typeResolver); - Assert::notNull($descriptionFactory); - - [$firstPart, $body] = self::extractTypeFromBody($body); - $type = null; - $parts = preg_split('/(\s+)/Su', $body, 2, PREG_SPLIT_DELIM_CAPTURE); - Assert::isArray($parts); - $variableName = ''; - - // if the first item that is encountered is not a variable; it is a type - if ($firstPart && $firstPart[0] !== '$') { - $type = $typeResolver->resolve($firstPart, $context); - } else { - // first part is not a type; we should prepend it to the parts array for further processing - array_unshift($parts, $firstPart); - } - - // if the next item starts with a $ or ...$ it must be the variable name - if (isset($parts[0]) && strpos($parts[0], '$') === 0) { - $variableName = array_shift($parts); - array_shift($parts); - - Assert::notNull($variableName); - - $variableName = substr($variableName, 1); - } - - $description = $descriptionFactory->create(implode('', $parts), $context); - - return new static($variableName, $type, $description); - } - - /** - * Returns the variable's name. - */ - public function getVariableName() : ?string - { - return $this->variableName; - } - - /** - * Returns a string representation for this tag. - */ - public function __toString() : string - { - return ($this->type ? $this->type . ' ' : '') - . ($this->variableName ? '$' . $this->variableName : '') - . ($this->description ? ' ' . $this->description : ''); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/PropertyRead.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/PropertyRead.php deleted file mode 100644 index af768fb..0000000 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/PropertyRead.php +++ /dev/null @@ -1,104 +0,0 @@ -name = 'property-read'; - $this->variableName = $variableName; - $this->type = $type; - $this->description = $description; - } - - public static function create( - string $body, - ?TypeResolver $typeResolver = null, - ?DescriptionFactory $descriptionFactory = null, - ?TypeContext $context = null - ) : self { - Assert::stringNotEmpty($body); - Assert::notNull($typeResolver); - Assert::notNull($descriptionFactory); - - [$firstPart, $body] = self::extractTypeFromBody($body); - $type = null; - $parts = preg_split('/(\s+)/Su', $body, 2, PREG_SPLIT_DELIM_CAPTURE); - Assert::isArray($parts); - $variableName = ''; - - // if the first item that is encountered is not a variable; it is a type - if ($firstPart && $firstPart[0] !== '$') { - $type = $typeResolver->resolve($firstPart, $context); - } else { - // first part is not a type; we should prepend it to the parts array for further processing - array_unshift($parts, $firstPart); - } - - // if the next item starts with a $ or ...$ it must be the variable name - if (isset($parts[0]) && strpos($parts[0], '$') === 0) { - $variableName = array_shift($parts); - array_shift($parts); - - Assert::notNull($variableName); - - $variableName = substr($variableName, 1); - } - - $description = $descriptionFactory->create(implode('', $parts), $context); - - return new static($variableName, $type, $description); - } - - /** - * Returns the variable's name. - */ - public function getVariableName() : ?string - { - return $this->variableName; - } - - /** - * Returns a string representation for this tag. - */ - public function __toString() : string - { - return ($this->type ? $this->type . ' ' : '') - . ($this->variableName ? '$' . $this->variableName : '') - . ($this->description ? ' ' . $this->description : ''); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/PropertyWrite.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/PropertyWrite.php deleted file mode 100644 index 34cd75f..0000000 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/PropertyWrite.php +++ /dev/null @@ -1,104 +0,0 @@ -name = 'property-write'; - $this->variableName = $variableName; - $this->type = $type; - $this->description = $description; - } - - public static function create( - string $body, - ?TypeResolver $typeResolver = null, - ?DescriptionFactory $descriptionFactory = null, - ?TypeContext $context = null - ) : self { - Assert::stringNotEmpty($body); - Assert::notNull($typeResolver); - Assert::notNull($descriptionFactory); - - [$firstPart, $body] = self::extractTypeFromBody($body); - $type = null; - $parts = preg_split('/(\s+)/Su', $body, 2, PREG_SPLIT_DELIM_CAPTURE); - Assert::isArray($parts); - $variableName = ''; - - // if the first item that is encountered is not a variable; it is a type - if ($firstPart && $firstPart[0] !== '$') { - $type = $typeResolver->resolve($firstPart, $context); - } else { - // first part is not a type; we should prepend it to the parts array for further processing - array_unshift($parts, $firstPart); - } - - // if the next item starts with a $ or ...$ it must be the variable name - if (isset($parts[0]) && strpos($parts[0], '$') === 0) { - $variableName = array_shift($parts); - array_shift($parts); - - Assert::notNull($variableName); - - $variableName = substr($variableName, 1); - } - - $description = $descriptionFactory->create(implode('', $parts), $context); - - return new static($variableName, $type, $description); - } - - /** - * Returns the variable's name. - */ - public function getVariableName() : ?string - { - return $this->variableName; - } - - /** - * Returns a string representation for this tag. - */ - public function __toString() : string - { - return ($this->type ? $this->type . ' ' : '') - . ($this->variableName ? '$' . $this->variableName : '') - . ($this->description ? ' ' . $this->description : ''); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Reference/Fqsen.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Reference/Fqsen.php deleted file mode 100644 index cede74c..0000000 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Reference/Fqsen.php +++ /dev/null @@ -1,38 +0,0 @@ -fqsen = $fqsen; - } - - /** - * @return string string representation of the referenced fqsen - */ - public function __toString() : string - { - return (string) $this->fqsen; - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Reference/Reference.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Reference/Reference.php deleted file mode 100644 index 5eedcbc..0000000 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Reference/Reference.php +++ /dev/null @@ -1,22 +0,0 @@ -uri = $uri; - } - - public function __toString() : string - { - return $this->uri; - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Return_.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Return_.php deleted file mode 100644 index 60ba860..0000000 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Return_.php +++ /dev/null @@ -1,56 +0,0 @@ -name = 'return'; - $this->type = $type; - $this->description = $description; - } - - public static function create( - string $body, - ?TypeResolver $typeResolver = null, - ?DescriptionFactory $descriptionFactory = null, - ?TypeContext $context = null - ) : self { - Assert::notNull($typeResolver); - Assert::notNull($descriptionFactory); - - [$type, $description] = self::extractTypeFromBody($body); - - $type = $typeResolver->resolve($type, $context); - $description = $descriptionFactory->create($description, $context); - - return new static($type, $description); - } - - public function __toString() : string - { - return ($this->type ?: 'mixed') . ' ' . (string) $this->description; - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/See.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/See.php deleted file mode 100644 index 190973d..0000000 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/See.php +++ /dev/null @@ -1,83 +0,0 @@ -refers = $refers; - $this->description = $description; - } - - public static function create( - string $body, - ?FqsenResolver $typeResolver = null, - ?DescriptionFactory $descriptionFactory = null, - ?TypeContext $context = null - ) : self { - Assert::notNull($typeResolver); - Assert::notNull($descriptionFactory); - - $parts = preg_split('/\s+/Su', $body, 2); - Assert::isArray($parts); - $description = isset($parts[1]) ? $descriptionFactory->create($parts[1], $context) : null; - - // https://tools.ietf.org/html/rfc2396#section-3 - if (preg_match('/\w:\/\/\w/i', $parts[0])) { - return new static(new Url($parts[0]), $description); - } - - return new static(new FqsenRef($typeResolver->resolve($parts[0], $context)), $description); - } - - /** - * Returns the ref of this tag. - */ - public function getReference() : Reference - { - return $this->refers; - } - - /** - * Returns a string representation of this tag. - */ - public function __toString() : string - { - return $this->refers . ($this->description ? ' ' . $this->description->render() : ''); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Since.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Since.php deleted file mode 100644 index d00ca38..0000000 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Since.php +++ /dev/null @@ -1,94 +0,0 @@ -version = $version; - $this->description = $description; - } - - public static function create( - ?string $body, - ?DescriptionFactory $descriptionFactory = null, - ?TypeContext $context = null - ) : ?self { - if (empty($body)) { - return new static(); - } - - $matches = []; - if (!preg_match('/^(' . self::REGEX_VECTOR . ')\s*(.+)?$/sux', $body, $matches)) { - return null; - } - - Assert::notNull($descriptionFactory); - - return new static( - $matches[1], - $descriptionFactory->create($matches[2] ?? '', $context) - ); - } - - /** - * Gets the version section of the tag. - */ - public function getVersion() : ?string - { - return $this->version; - } - - /** - * Returns a string representation for this tag. - */ - public function __toString() : string - { - return (string) $this->version . ($this->description ? ' ' . (string) $this->description : ''); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Source.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Source.php deleted file mode 100644 index 6d3c6cb..0000000 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Source.php +++ /dev/null @@ -1,103 +0,0 @@ -startingLine = (int) $startingLine; - $this->lineCount = $lineCount !== null ? (int) $lineCount : null; - $this->description = $description; - } - - public static function create( - string $body, - ?DescriptionFactory $descriptionFactory = null, - ?TypeContext $context = null - ) : self { - Assert::stringNotEmpty($body); - Assert::notNull($descriptionFactory); - - $startingLine = 1; - $lineCount = null; - $description = null; - - // Starting line / Number of lines / Description - if (preg_match('/^([1-9]\d*)\s*(?:((?1))\s+)?(.*)$/sux', $body, $matches)) { - $startingLine = (int) $matches[1]; - if (isset($matches[2]) && $matches[2] !== '') { - $lineCount = (int) $matches[2]; - } - - $description = $matches[3]; - } - - return new static($startingLine, $lineCount, $descriptionFactory->create($description??'', $context)); - } - - /** - * Gets the starting line. - * - * @return int The starting line, relative to the structural element's - * location. - */ - public function getStartingLine() : int - { - return $this->startingLine; - } - - /** - * Returns the number of lines. - * - * @return int|null The number of lines, relative to the starting line. NULL - * means "to the end". - */ - public function getLineCount() : ?int - { - return $this->lineCount; - } - - public function __toString() : string - { - return $this->startingLine - . ($this->lineCount !== null ? ' ' . $this->lineCount : '') - . ($this->description ? ' ' . (string) $this->description : ''); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/TagWithType.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/TagWithType.php deleted file mode 100644 index 0083d34..0000000 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/TagWithType.php +++ /dev/null @@ -1,65 +0,0 @@ -type; - } - - /** - * @return string[] - */ - protected static function extractTypeFromBody(string $body) : array - { - $type = ''; - $nestingLevel = 0; - for ($i = 0, $iMax = strlen($body); $i < $iMax; $i++) { - $character = $body[$i]; - - if ($nestingLevel === 0 && trim($character) === '') { - break; - } - - $type .= $character; - if (in_array($character, ['<', '(', '[', '{'])) { - $nestingLevel++; - continue; - } - - if (in_array($character, ['>', ')', ']', '}'])) { - $nestingLevel--; - continue; - } - } - - $description = trim(substr($body, strlen($type))); - - return [$type, $description]; - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Throws.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Throws.php deleted file mode 100644 index 13f07ce..0000000 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Throws.php +++ /dev/null @@ -1,56 +0,0 @@ -name = 'throws'; - $this->type = $type; - $this->description = $description; - } - - public static function create( - string $body, - ?TypeResolver $typeResolver = null, - ?DescriptionFactory $descriptionFactory = null, - ?TypeContext $context = null - ) : self { - Assert::notNull($typeResolver); - Assert::notNull($descriptionFactory); - - [$type, $description] = self::extractTypeFromBody($body); - - $type = $typeResolver->resolve($type, $context); - $description = $descriptionFactory->create($description, $context); - - return new static($type, $description); - } - - public function __toString() : string - { - return (string) $this->type . ' ' . (string) $this->description; - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Uses.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Uses.php deleted file mode 100644 index 1be71f6..0000000 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Uses.php +++ /dev/null @@ -1,78 +0,0 @@ -refers = $refers; - $this->description = $description; - } - - public static function create( - string $body, - ?FqsenResolver $resolver = null, - ?DescriptionFactory $descriptionFactory = null, - ?TypeContext $context = null - ) : self { - Assert::notNull($resolver); - Assert::notNull($descriptionFactory); - - $parts = preg_split('/\s+/Su', $body, 2); - Assert::isArray($parts); - Assert::allString($parts); - - return new static( - $resolver->resolve($parts[0], $context), - $descriptionFactory->create($parts[1] ?? '', $context) - ); - } - - /** - * Returns the structural element this tag refers to. - */ - public function getReference() : Fqsen - { - return $this->refers; - } - - /** - * Returns a string representation of this tag. - */ - public function __toString() : string - { - return $this->refers . ' ' . (string) $this->description; - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Var_.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Var_.php deleted file mode 100644 index e03f994..0000000 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Var_.php +++ /dev/null @@ -1,105 +0,0 @@ -name = 'var'; - $this->variableName = $variableName; - $this->type = $type; - $this->description = $description; - } - - public static function create( - string $body, - ?TypeResolver $typeResolver = null, - ?DescriptionFactory $descriptionFactory = null, - ?TypeContext $context = null - ) : self { - Assert::stringNotEmpty($body); - Assert::notNull($typeResolver); - Assert::notNull($descriptionFactory); - - [$firstPart, $body] = self::extractTypeFromBody($body); - - $parts = preg_split('/(\s+)/Su', $body, 2, PREG_SPLIT_DELIM_CAPTURE); - Assert::isArray($parts); - $type = null; - $variableName = ''; - - // if the first item that is encountered is not a variable; it is a type - if ($firstPart && $firstPart[0] !== '$') { - $type = $typeResolver->resolve($firstPart, $context); - } else { - // first part is not a type; we should prepend it to the parts array for further processing - array_unshift($parts, $firstPart); - } - - // if the next item starts with a $ or ...$ it must be the variable name - if (isset($parts[0]) && strpos($parts[0], '$') === 0) { - $variableName = array_shift($parts); - array_shift($parts); - - Assert::notNull($variableName); - - $variableName = substr($variableName, 1); - } - - $description = $descriptionFactory->create(implode('', $parts), $context); - - return new static($variableName, $type, $description); - } - - /** - * Returns the variable's name. - */ - public function getVariableName() : ?string - { - return $this->variableName; - } - - /** - * Returns a string representation for this tag. - */ - public function __toString() : string - { - return ($this->type ? $this->type . ' ' : '') - . (empty($this->variableName) ? '' : '$' . $this->variableName) - . ($this->description ? ' ' . $this->description : ''); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Version.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Version.php deleted file mode 100644 index eaadf4d..0000000 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Version.php +++ /dev/null @@ -1,98 +0,0 @@ -version = $version; - $this->description = $description; - } - - public static function create( - ?string $body, - ?DescriptionFactory $descriptionFactory = null, - ?TypeContext $context = null - ) : ?self { - if (empty($body)) { - return new static(); - } - - $matches = []; - if (!preg_match('/^(' . self::REGEX_VECTOR . ')\s*(.+)?$/sux', $body, $matches)) { - return null; - } - - $description = null; - if ($descriptionFactory !== null) { - $description = $descriptionFactory->create($matches[2] ?? '', $context); - } - - return new static( - $matches[1], - $description - ); - } - - /** - * Gets the version section of the tag. - */ - public function getVersion() : ?string - { - return $this->version; - } - - /** - * Returns a string representation for this tag. - */ - public function __toString() : string - { - return ((string) $this->version) . - ($this->description instanceof Description ? ' ' . $this->description->render() : ''); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlockFactory.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlockFactory.php deleted file mode 100644 index cf04e5a..0000000 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlockFactory.php +++ /dev/null @@ -1,286 +0,0 @@ -descriptionFactory = $descriptionFactory; - $this->tagFactory = $tagFactory; - } - - /** - * Factory method for easy instantiation. - * - * @param array> $additionalTags - */ - public static function createInstance(array $additionalTags = []) : self - { - $fqsenResolver = new FqsenResolver(); - $tagFactory = new StandardTagFactory($fqsenResolver); - $descriptionFactory = new DescriptionFactory($tagFactory); - - $tagFactory->addService($descriptionFactory); - $tagFactory->addService(new TypeResolver($fqsenResolver)); - - $docBlockFactory = new self($descriptionFactory, $tagFactory); - foreach ($additionalTags as $tagName => $tagHandler) { - $docBlockFactory->registerTagHandler($tagName, $tagHandler); - } - - return $docBlockFactory; - } - - /** - * @param object|string $docblock A string containing the DocBlock to parse or an object supporting the - * getDocComment method (such as a ReflectionClass object). - */ - public function create($docblock, ?Types\Context $context = null, ?Location $location = null) : DocBlock - { - if (is_object($docblock)) { - if (!method_exists($docblock, 'getDocComment')) { - $exceptionMessage = 'Invalid object passed; the given object must support the getDocComment method'; - - throw new InvalidArgumentException($exceptionMessage); - } - - $docblock = $docblock->getDocComment(); - Assert::string($docblock); - } - - Assert::stringNotEmpty($docblock); - - if ($context === null) { - $context = new Types\Context(''); - } - - $parts = $this->splitDocBlock($this->stripDocComment($docblock)); - - [$templateMarker, $summary, $description, $tags] = $parts; - - return new DocBlock( - $summary, - $description ? $this->descriptionFactory->create($description, $context) : null, - $this->parseTagBlock($tags, $context), - $context, - $location, - $templateMarker === '#@+', - $templateMarker === '#@-' - ); - } - - /** - * @param class-string $handler - */ - public function registerTagHandler(string $tagName, string $handler) : void - { - $this->tagFactory->registerTagHandler($tagName, $handler); - } - - /** - * Strips the asterisks from the DocBlock comment. - * - * @param string $comment String containing the comment text. - */ - private function stripDocComment(string $comment) : string - { - $comment = preg_replace('#[ \t]*(?:\/\*\*|\*\/|\*)?[ \t]?(.*)?#u', '$1', $comment); - Assert::string($comment); - $comment = trim($comment); - - // reg ex above is not able to remove */ from a single line docblock - if (substr($comment, -2) === '*/') { - $comment = trim(substr($comment, 0, -2)); - } - - return str_replace(["\r\n", "\r"], "\n", $comment); - } - - // phpcs:disable - /** - * Splits the DocBlock into a template marker, summary, description and block of tags. - * - * @param string $comment Comment to split into the sub-parts. - * - * @return string[] containing the template marker (if any), summary, description and a string containing the tags. - * - * @author Mike van Riel for extending the regex with template marker support. - * - * @author Richard van Velzen (@_richardJ) Special thanks to Richard for the regex responsible for the split. - */ - private function splitDocBlock(string $comment) : array - { - // phpcs:enable - // Performance improvement cheat: if the first character is an @ then only tags are in this DocBlock. This - // method does not split tags so we return this verbatim as the fourth result (tags). This saves us the - // performance impact of running a regular expression - if (strpos($comment, '@') === 0) { - return ['', '', '', $comment]; - } - - // clears all extra horizontal whitespace from the line endings to prevent parsing issues - $comment = preg_replace('/\h*$/Sum', '', $comment); - Assert::string($comment); - /* - * Splits the docblock into a template marker, summary, description and tags section. - * - * - The template marker is empty, #@+ or #@- if the DocBlock starts with either of those (a newline may - * occur after it and will be stripped). - * - The short description is started from the first character until a dot is encountered followed by a - * newline OR two consecutive newlines (horizontal whitespace is taken into account to consider spacing - * errors). This is optional. - * - The long description, any character until a new line is encountered followed by an @ and word - * characters (a tag). This is optional. - * - Tags; the remaining characters - * - * Big thanks to RichardJ for contributing this Regular Expression - */ - preg_match( - '/ - \A - # 1. Extract the template marker - (?:(\#\@\+|\#\@\-)\n?)? - - # 2. Extract the summary - (?: - (?! @\pL ) # The summary may not start with an @ - ( - [^\n.]+ - (?: - (?! \. \n | \n{2} ) # End summary upon a dot followed by newline or two newlines - [\n.]* (?! [ \t]* @\pL ) # End summary when an @ is found as first character on a new line - [^\n.]+ # Include anything else - )* - \.? - )? - ) - - # 3. Extract the description - (?: - \s* # Some form of whitespace _must_ precede a description because a summary must be there - (?! @\pL ) # The description may not start with an @ - ( - [^\n]+ - (?: \n+ - (?! [ \t]* @\pL ) # End description when an @ is found as first character on a new line - [^\n]+ # Include anything else - )* - ) - )? - - # 4. Extract the tags (anything that follows) - (\s+ [\s\S]*)? # everything that follows - /ux', - $comment, - $matches - ); - array_shift($matches); - - while (count($matches) < 4) { - $matches[] = ''; - } - - return $matches; - } - - /** - * Creates the tag objects. - * - * @param string $tags Tag block to parse. - * @param Types\Context $context Context of the parsed Tag - * - * @return DocBlock\Tag[] - */ - private function parseTagBlock(string $tags, Types\Context $context) : array - { - $tags = $this->filterTagBlock($tags); - if ($tags === null) { - return []; - } - - $result = []; - $lines = $this->splitTagBlockIntoTagLines($tags); - foreach ($lines as $key => $tagLine) { - $result[$key] = $this->tagFactory->create(trim($tagLine), $context); - } - - return $result; - } - - /** - * @return string[] - */ - private function splitTagBlockIntoTagLines(string $tags) : array - { - $result = []; - foreach (explode("\n", $tags) as $tagLine) { - if ($tagLine !== '' && strpos($tagLine, '@') === 0) { - $result[] = $tagLine; - } else { - $result[count($result) - 1] .= "\n" . $tagLine; - } - } - - return $result; - } - - private function filterTagBlock(string $tags) : ?string - { - $tags = trim($tags); - if (!$tags) { - return null; - } - - if ($tags[0] !== '@') { - // @codeCoverageIgnoreStart - // Can't simulate this; this only happens if there is an error with the parsing of the DocBlock that - // we didn't foresee. - - throw new LogicException('A tag block started with text instead of an at-sign(@): ' . $tags); - - // @codeCoverageIgnoreEnd - } - - return $tags; - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlockFactoryInterface.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlockFactoryInterface.php deleted file mode 100644 index ef039a4..0000000 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlockFactoryInterface.php +++ /dev/null @@ -1,23 +0,0 @@ -> $additionalTags - */ - public static function createInstance(array $additionalTags = []) : DocBlockFactory; - - /** - * @param string|object $docblock - */ - public function create($docblock, ?Types\Context $context = null, ?Location $location = null) : DocBlock; -} diff --git a/vendor/phpdocumentor/type-resolver/LICENSE b/vendor/phpdocumentor/type-resolver/LICENSE deleted file mode 100644 index 792e404..0000000 --- a/vendor/phpdocumentor/type-resolver/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2010 Mike van Riel - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/phpdocumentor/type-resolver/README.md b/vendor/phpdocumentor/type-resolver/README.md deleted file mode 100644 index f30d3a2..0000000 --- a/vendor/phpdocumentor/type-resolver/README.md +++ /dev/null @@ -1,177 +0,0 @@ -[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) -![](https://github.com/phpdocumentor/typeresolver/workflows/Qa%20workflow/badge.svg?branch=1.x) -[![Coveralls Coverage](https://img.shields.io/coveralls/github/phpDocumentor/TypeResolver.svg)](https://coveralls.io/github/phpDocumentor/TypeResolver?branch=1.x) -[![Scrutinizer Code Coverage](https://img.shields.io/scrutinizer/coverage/g/phpDocumentor/TypeResolver.svg)](https://scrutinizer-ci.com/g/phpDocumentor/TypeResolver/?branch=1.x) -[![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/phpDocumentor/TypeResolver.svg)](https://scrutinizer-ci.com/g/phpDocumentor/TypeResolver/?branch=1.x) -![Packagist Version](https://img.shields.io/packagist/v/phpdocumentor/type-resolver?label=Packagist%20stable) -![Packagist Version](https://img.shields.io/packagist/vpre/phpdocumentor/type-resolver?label=Packagist%20unstable) - -TypeResolver and FqsenResolver -============================== - -The specification on types in DocBlocks (PSR-5) describes various keywords and special constructs -but also how to statically resolve the partial name of a Class into a Fully Qualified Class Name (FQCN). - -PSR-5 also introduces an additional way to describe deeper elements than Classes, Interfaces and Traits -called the Fully Qualified Structural Element Name (FQSEN). Using this it is possible to refer to methods, -properties and class constants but also functions and global constants. - -This package provides two Resolvers that are capable of - -1. Returning a series of Value Object for given expression while resolving any partial class names, and -2. Returning an FQSEN object after resolving any partial Structural Element Names into Fully Qualified Structural - Element names. - -## Installing - -The easiest way to install this library is with [Composer](https://getcomposer.org) using the following command: - - $ composer require phpdocumentor/type-resolver - -## Examples - -Ready to dive in and don't want to read through all that text below? Just consult the [examples](examples) folder and check which type of action that your want to accomplish. - -## On Types and Element Names - -This component can be used in one of two ways - -1. To resolve a Type or -2. To resolve a Fully Qualified Structural Element Name - -The big difference between these two is in the number of things it can resolve. - -The TypeResolver can resolve: - -- a php primitive or pseudo-primitive such as a string or void (`@var string` or `@return void`). -- a composite such as an array of string (`@var string[]`). -- a compound such as a string or integer (`@var string|integer`). -- an array expression (`@var (string|TypeResolver)[]`) -- an object or interface such as the TypeResolver class (`@var TypeResolver` - or `@var \phpDocumentor\Reflection\TypeResolver`) - - > please note that if you want to pass partial class names that additional steps are necessary, see the - > chapter `Resolving partial classes and FQSENs` for more information. - -Where the FqsenResolver can resolve: - -- Constant expressions (i.e. `@see \MyNamespace\MY_CONSTANT`) -- Function expressions (i.e. `@see \MyNamespace\myFunction()`) -- Class expressions (i.e. `@see \MyNamespace\MyClass`) -- Interface expressions (i.e. `@see \MyNamespace\MyInterface`) -- Trait expressions (i.e. `@see \MyNamespace\MyTrait`) -- Class constant expressions (i.e. `@see \MyNamespace\MyClass::MY_CONSTANT`) -- Property expressions (i.e. `@see \MyNamespace\MyClass::$myProperty`) -- Method expressions (i.e. `@see \MyNamespace\MyClass::myMethod()`) - -## Resolving a type - -In order to resolve a type you will have to instantiate the class `\phpDocumentor\Reflection\TypeResolver` and call its `resolve` method like this: - -```php -$typeResolver = new \phpDocumentor\Reflection\TypeResolver(); -$type = $typeResolver->resolve('string|integer'); -``` - -In this example you will receive a Value Object of class `\phpDocumentor\Reflection\Types\Compound` that has two -elements, one of type `\phpDocumentor\Reflection\Types\String_` and one of type -`\phpDocumentor\Reflection\Types\Integer`. - -The real power of this resolver is in its capability to expand partial class names into fully qualified class names; but in order to do that we need an additional `\phpDocumentor\Reflection\Types\Context` class that will inform the resolver in which namespace the given expression occurs and which namespace aliases (or imports) apply. - -### Resolving nullable types - -Php 7.1 introduced nullable types e.g. `?string`. Type resolver will resolve the original type without the nullable notation `?` -just like it would do without the `?`. After that the type is wrapped in a `\phpDocumentor\Reflection\Types\Nullable` object. -The `Nullable` type has a method to fetch the actual type. - -## Resolving an FQSEN - -A Fully Qualified Structural Element Name is a reference to another element in your code bases and can be resolved using the `\phpDocumentor\Reflection\FqsenResolver` class' `resolve` method, like this: - -```php -$fqsenResolver = new \phpDocumentor\Reflection\FqsenResolver(); -$fqsen = $fqsenResolver->resolve('\phpDocumentor\Reflection\FqsenResolver::resolve()'); -``` - -In this example we resolve a Fully Qualified Structural Element Name (meaning that it includes the full namespace, class name and element name) and receive a Value Object of type `\phpDocumentor\Reflection\Fqsen`. - -The real power of this resolver is in its capability to expand partial element names into Fully Qualified Structural Element Names; but in order to do that we need an additional `\phpDocumentor\Reflection\Types\Context` class that will inform the resolver in which namespace the given expression occurs and which namespace aliases (or imports) apply. - -## Resolving partial Classes and Structural Element Names - -Perhaps the best feature of this library is that it knows how to resolve partial class names into fully qualified class names. - -For example, you have this file: - -```php -namespace My\Example; - -use phpDocumentor\Reflection\Types; - -class Classy -{ - /** - * @var Types\Context - * @see Classy::otherFunction() - */ - public function __construct($context) {} - - public function otherFunction(){} -} -``` - -Suppose that you would want to resolve (and expand) the type in the `@var` tag and the element name in the `@see` tag. - -For the resolvers to know how to expand partial names you have to provide a bit of _Context_ for them by instantiating a new class named `\phpDocumentor\Reflection\Types\Context` with the name of the namespace and the aliases that are in play. - -### Creating a Context - -You can do this by manually creating a Context like this: - -```php -$context = new \phpDocumentor\Reflection\Types\Context( - '\My\Example', - [ 'Types' => '\phpDocumentor\Reflection\Types'] -); -``` - -Or by using the `\phpDocumentor\Reflection\Types\ContextFactory` to instantiate a new context based on a Reflector object or by providing the namespace that you'd like to extract and the source code of the file in which the given type expression occurs. - -```php -$contextFactory = new \phpDocumentor\Reflection\Types\ContextFactory(); -$context = $contextFactory->createFromReflector(new ReflectionMethod('\My\Example\Classy', '__construct')); -``` - -or - -```php -$contextFactory = new \phpDocumentor\Reflection\Types\ContextFactory(); -$context = $contextFactory->createForNamespace('\My\Example', file_get_contents('My/Example/Classy.php')); -``` - -### Using the Context - -After you have obtained a Context it is just a matter of passing it along with the `resolve` method of either Resolver class as second argument and the Resolvers will take this into account when resolving partial names. - -To obtain the resolved class name for the `@var` tag in the example above you can do: - -```php -$typeResolver = new \phpDocumentor\Reflection\TypeResolver(); -$type = $typeResolver->resolve('Types\Context', $context); -``` - -When you do this you will receive an object of class `\phpDocumentor\Reflection\Types\Object_` for which you can call the `getFqsen` method to receive a Value Object that represents the complete FQSEN. So that would be `phpDocumentor\Reflection\Types\Context`. - -> Why is the FQSEN wrapped in another object `Object_`? -> -> The resolve method of the TypeResolver only returns object with the interface `Type` and the FQSEN is a common type that does not represent a Type. Also: in some cases a type can represent an "Untyped Object", meaning that it is an object (signified by the `object` keyword) but does not refer to a specific element using an FQSEN. - -Another example is on how to resolve the FQSEN of a method as can be seen with the `@see` tag in the example above. To resolve that you can do the following: - -```php -$fqsenResolver = new \phpDocumentor\Reflection\FqsenResolver(); -$type = $fqsenResolver->resolve('Classy::otherFunction()', $context); -``` - -Because Classy is a Class in the current namespace its FQSEN will have the `My\Example` namespace and by calling the `resolve` method of the FQSEN Resolver you will receive an `Fqsen` object that refers to `\My\Example\Classy::otherFunction()`. diff --git a/vendor/phpdocumentor/type-resolver/composer.json b/vendor/phpdocumentor/type-resolver/composer.json deleted file mode 100644 index 4dbf623..0000000 --- a/vendor/phpdocumentor/type-resolver/composer.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "phpdocumentor/type-resolver", - "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "type": "library", - "license": "MIT", - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "require": { - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.0" - }, - "require-dev": { - "ext-tokenizer": "*", - "psalm/phar": "^4.8" - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "autoload-dev": { - "psr-4": { - "phpDocumentor\\Reflection\\": ["tests/unit", "tests/benchmark"] - } - }, - "extra": { - "branch-alias": { - "dev-1.x": "1.x-dev" - } - } -} diff --git a/vendor/phpdocumentor/type-resolver/src/FqsenResolver.php b/vendor/phpdocumentor/type-resolver/src/FqsenResolver.php deleted file mode 100644 index 068fa20..0000000 --- a/vendor/phpdocumentor/type-resolver/src/FqsenResolver.php +++ /dev/null @@ -1,80 +0,0 @@ -isFqsen($fqsen)) { - return new Fqsen($fqsen); - } - - return $this->resolvePartialStructuralElementName($fqsen, $context); - } - - /** - * Tests whether the given type is a Fully Qualified Structural Element Name. - */ - private function isFqsen(string $type): bool - { - return strpos($type, self::OPERATOR_NAMESPACE) === 0; - } - - /** - * Resolves a partial Structural Element Name (i.e. `Reflection\DocBlock`) to its FQSEN representation - * (i.e. `\phpDocumentor\Reflection\DocBlock`) based on the Namespace and aliases mentioned in the Context. - * - * @throws InvalidArgumentException When type is not a valid FQSEN. - */ - private function resolvePartialStructuralElementName(string $type, Context $context): Fqsen - { - $typeParts = explode(self::OPERATOR_NAMESPACE, $type, 2); - - $namespaceAliases = $context->getNamespaceAliases(); - - // if the first segment is not an alias; prepend namespace name and return - if (!isset($namespaceAliases[$typeParts[0]])) { - $namespace = $context->getNamespace(); - if ($namespace !== '') { - $namespace .= self::OPERATOR_NAMESPACE; - } - - return new Fqsen(self::OPERATOR_NAMESPACE . $namespace . $type); - } - - $typeParts[0] = $namespaceAliases[$typeParts[0]]; - - return new Fqsen(self::OPERATOR_NAMESPACE . implode(self::OPERATOR_NAMESPACE, $typeParts)); - } -} diff --git a/vendor/phpdocumentor/type-resolver/src/PseudoType.php b/vendor/phpdocumentor/type-resolver/src/PseudoType.php deleted file mode 100644 index dd91ed7..0000000 --- a/vendor/phpdocumentor/type-resolver/src/PseudoType.php +++ /dev/null @@ -1,19 +0,0 @@ - List of recognized keywords and unto which Value Object they map - * @psalm-var array> - */ - private $keywords = [ - 'string' => Types\String_::class, - 'class-string' => Types\ClassString::class, - 'interface-string' => Types\InterfaceString::class, - 'html-escaped-string' => PseudoTypes\HtmlEscapedString::class, - 'lowercase-string' => PseudoTypes\LowercaseString::class, - 'non-empty-lowercase-string' => PseudoTypes\NonEmptyLowercaseString::class, - 'non-empty-string' => PseudoTypes\NonEmptyString::class, - 'numeric-string' => PseudoTypes\NumericString::class, - 'trait-string' => PseudoTypes\TraitString::class, - 'int' => Types\Integer::class, - 'integer' => Types\Integer::class, - 'positive-int' => PseudoTypes\PositiveInteger::class, - 'bool' => Types\Boolean::class, - 'boolean' => Types\Boolean::class, - 'real' => Types\Float_::class, - 'float' => Types\Float_::class, - 'double' => Types\Float_::class, - 'object' => Types\Object_::class, - 'mixed' => Types\Mixed_::class, - 'array' => Types\Array_::class, - 'array-key' => Types\ArrayKey::class, - 'resource' => Types\Resource_::class, - 'void' => Types\Void_::class, - 'null' => Types\Null_::class, - 'scalar' => Types\Scalar::class, - 'callback' => Types\Callable_::class, - 'callable' => Types\Callable_::class, - 'callable-string' => PseudoTypes\CallableString::class, - 'false' => PseudoTypes\False_::class, - 'true' => PseudoTypes\True_::class, - 'literal-string' => PseudoTypes\LiteralString::class, - 'self' => Types\Self_::class, - '$this' => Types\This::class, - 'static' => Types\Static_::class, - 'parent' => Types\Parent_::class, - 'iterable' => Types\Iterable_::class, - 'never' => Types\Never_::class, - ]; - - /** - * @var FqsenResolver - * @psalm-readonly - */ - private $fqsenResolver; - - /** - * Initializes this TypeResolver with the means to create and resolve Fqsen objects. - */ - public function __construct(?FqsenResolver $fqsenResolver = null) - { - $this->fqsenResolver = $fqsenResolver ?: new FqsenResolver(); - } - - /** - * Analyzes the given type and returns the FQCN variant. - * - * When a type is provided this method checks whether it is not a keyword or - * Fully Qualified Class Name. If so it will use the given namespace and - * aliases to expand the type to a FQCN representation. - * - * This method only works as expected if the namespace and aliases are set; - * no dynamic reflection is being performed here. - * - * @uses Context::getNamespaceAliases() to check whether the first part of the relative type name should not be - * replaced with another namespace. - * @uses Context::getNamespace() to determine with what to prefix the type name. - * - * @param string $type The relative or absolute type. - */ - public function resolve(string $type, ?Context $context = null): Type - { - $type = trim($type); - if (!$type) { - throw new InvalidArgumentException('Attempted to resolve "' . $type . '" but it appears to be empty'); - } - - if ($context === null) { - $context = new Context(''); - } - - // split the type string into tokens `|`, `?`, `<`, `>`, `,`, `(`, `)`, `[]`, '<', '>' and type names - $tokens = preg_split( - '/(\\||\\?|<|>|&|, ?|\\(|\\)|\\[\\]+)/', - $type, - -1, - PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE - ); - - if ($tokens === false) { - throw new InvalidArgumentException('Unable to split the type string "' . $type . '" into tokens'); - } - - /** @var ArrayIterator $tokenIterator */ - $tokenIterator = new ArrayIterator($tokens); - - return $this->parseTypes($tokenIterator, $context, self::PARSER_IN_COMPOUND); - } - - /** - * Analyse each tokens and creates types - * - * @param ArrayIterator $tokens the iterator on tokens - * @param int $parserContext on of self::PARSER_* constants, indicating - * the context where we are in the parsing - */ - private function parseTypes(ArrayIterator $tokens, Context $context, int $parserContext): Type - { - $types = []; - $token = ''; - $compoundToken = '|'; - while ($tokens->valid()) { - $token = $tokens->current(); - if ($token === null) { - throw new RuntimeException( - 'Unexpected nullable character' - ); - } - - if ($token === '|' || $token === '&') { - if (count($types) === 0) { - throw new RuntimeException( - 'A type is missing before a type separator' - ); - } - - if ( - !in_array($parserContext, [ - self::PARSER_IN_COMPOUND, - self::PARSER_IN_ARRAY_EXPRESSION, - self::PARSER_IN_COLLECTION_EXPRESSION, - ], true) - ) { - throw new RuntimeException( - 'Unexpected type separator' - ); - } - - $compoundToken = $token; - $tokens->next(); - } elseif ($token === '?') { - if ( - !in_array($parserContext, [ - self::PARSER_IN_COMPOUND, - self::PARSER_IN_ARRAY_EXPRESSION, - self::PARSER_IN_COLLECTION_EXPRESSION, - ], true) - ) { - throw new RuntimeException( - 'Unexpected nullable character' - ); - } - - $tokens->next(); - $type = $this->parseTypes($tokens, $context, self::PARSER_IN_NULLABLE); - $types[] = new Nullable($type); - } elseif ($token === '(') { - $tokens->next(); - $type = $this->parseTypes($tokens, $context, self::PARSER_IN_ARRAY_EXPRESSION); - - $token = $tokens->current(); - if ($token === null) { // Someone did not properly close their array expression .. - break; - } - - $tokens->next(); - - $resolvedType = new Expression($type); - - $types[] = $resolvedType; - } elseif ($parserContext === self::PARSER_IN_ARRAY_EXPRESSION && isset($token[0]) && $token[0] === ')') { - break; - } elseif ($token === '<') { - if (count($types) === 0) { - throw new RuntimeException( - 'Unexpected collection operator "<", class name is missing' - ); - } - - $classType = array_pop($types); - if ($classType !== null) { - if ((string) $classType === 'class-string') { - $types[] = $this->resolveClassString($tokens, $context); - } elseif ((string) $classType === 'interface-string') { - $types[] = $this->resolveInterfaceString($tokens, $context); - } else { - $types[] = $this->resolveCollection($tokens, $classType, $context); - } - } - - $tokens->next(); - } elseif ( - $parserContext === self::PARSER_IN_COLLECTION_EXPRESSION - && ($token === '>' || trim($token) === ',') - ) { - break; - } elseif ($token === self::OPERATOR_ARRAY) { - end($types); - $last = key($types); - $lastItem = $types[$last]; - if ($lastItem instanceof Expression) { - $lastItem = $lastItem->getValueType(); - } - - $types[$last] = new Array_($lastItem); - - $tokens->next(); - } else { - $type = $this->resolveSingleType($token, $context); - $tokens->next(); - if ($parserContext === self::PARSER_IN_NULLABLE) { - return $type; - } - - $types[] = $type; - } - } - - if ($token === '|' || $token === '&') { - throw new RuntimeException( - 'A type is missing after a type separator' - ); - } - - if (count($types) === 0) { - if ($parserContext === self::PARSER_IN_NULLABLE) { - throw new RuntimeException( - 'A type is missing after a nullable character' - ); - } - - if ($parserContext === self::PARSER_IN_ARRAY_EXPRESSION) { - throw new RuntimeException( - 'A type is missing in an array expression' - ); - } - - if ($parserContext === self::PARSER_IN_COLLECTION_EXPRESSION) { - throw new RuntimeException( - 'A type is missing in a collection expression' - ); - } - } elseif (count($types) === 1) { - return $types[0]; - } - - if ($compoundToken === '|') { - return new Compound(array_values($types)); - } - - return new Intersection(array_values($types)); - } - - /** - * resolve the given type into a type object - * - * @param string $type the type string, representing a single type - * - * @return Type|Array_|Object_ - * - * @psalm-mutation-free - */ - private function resolveSingleType(string $type, Context $context): object - { - switch (true) { - case $this->isKeyword($type): - return $this->resolveKeyword($type); - - case $this->isFqsen($type): - return $this->resolveTypedObject($type); - - case $this->isPartialStructuralElementName($type): - return $this->resolveTypedObject($type, $context); - - // @codeCoverageIgnoreStart - default: - // I haven't got the foggiest how the logic would come here but added this as a defense. - throw new RuntimeException( - 'Unable to resolve type "' . $type . '", there is no known method to resolve it' - ); - } - - // @codeCoverageIgnoreEnd - } - - /** - * Adds a keyword to the list of Keywords and associates it with a specific Value Object. - * - * @psalm-param class-string $typeClassName - */ - public function addKeyword(string $keyword, string $typeClassName): void - { - if (!class_exists($typeClassName)) { - throw new InvalidArgumentException( - 'The Value Object that needs to be created with a keyword "' . $keyword . '" must be an existing class' - . ' but we could not find the class ' . $typeClassName - ); - } - - $interfaces = class_implements($typeClassName); - if ($interfaces === false) { - throw new InvalidArgumentException( - 'The Value Object that needs to be created with a keyword "' . $keyword . '" must be an existing class' - . ' but we could not find the class ' . $typeClassName - ); - } - - if (!in_array(Type::class, $interfaces, true)) { - throw new InvalidArgumentException( - 'The class "' . $typeClassName . '" must implement the interface "phpDocumentor\Reflection\Type"' - ); - } - - $this->keywords[$keyword] = $typeClassName; - } - - /** - * Detects whether the given type represents a PHPDoc keyword. - * - * @param string $type A relative or absolute type as defined in the phpDocumentor documentation. - * - * @psalm-mutation-free - */ - private function isKeyword(string $type): bool - { - return array_key_exists(strtolower($type), $this->keywords); - } - - /** - * Detects whether the given type represents a relative structural element name. - * - * @param string $type A relative or absolute type as defined in the phpDocumentor documentation. - * - * @psalm-mutation-free - */ - private function isPartialStructuralElementName(string $type): bool - { - return (isset($type[0]) && $type[0] !== self::OPERATOR_NAMESPACE) && !$this->isKeyword($type); - } - - /** - * Tests whether the given type is a Fully Qualified Structural Element Name. - * - * @psalm-mutation-free - */ - private function isFqsen(string $type): bool - { - return strpos($type, self::OPERATOR_NAMESPACE) === 0; - } - - /** - * Resolves the given keyword (such as `string`) into a Type object representing that keyword. - * - * @psalm-mutation-free - */ - private function resolveKeyword(string $type): Type - { - $className = $this->keywords[strtolower($type)]; - - return new $className(); - } - - /** - * Resolves the given FQSEN string into an FQSEN object. - * - * @psalm-mutation-free - */ - private function resolveTypedObject(string $type, ?Context $context = null): Object_ - { - return new Object_($this->fqsenResolver->resolve($type, $context)); - } - - /** - * Resolves class string - * - * @param ArrayIterator $tokens - */ - private function resolveClassString(ArrayIterator $tokens, Context $context): Type - { - $tokens->next(); - - $classType = $this->parseTypes($tokens, $context, self::PARSER_IN_COLLECTION_EXPRESSION); - - if (!$classType instanceof Object_ || $classType->getFqsen() === null) { - throw new RuntimeException( - $classType . ' is not a class string' - ); - } - - $token = $tokens->current(); - if ($token !== '>') { - if (empty($token)) { - throw new RuntimeException( - 'class-string: ">" is missing' - ); - } - - throw new RuntimeException( - 'Unexpected character "' . $token . '", ">" is missing' - ); - } - - return new ClassString($classType->getFqsen()); - } - - /** - * Resolves class string - * - * @param ArrayIterator $tokens - */ - private function resolveInterfaceString(ArrayIterator $tokens, Context $context): Type - { - $tokens->next(); - - $classType = $this->parseTypes($tokens, $context, self::PARSER_IN_COLLECTION_EXPRESSION); - - if (!$classType instanceof Object_ || $classType->getFqsen() === null) { - throw new RuntimeException( - $classType . ' is not a interface string' - ); - } - - $token = $tokens->current(); - if ($token !== '>') { - if (empty($token)) { - throw new RuntimeException( - 'interface-string: ">" is missing' - ); - } - - throw new RuntimeException( - 'Unexpected character "' . $token . '", ">" is missing' - ); - } - - return new InterfaceString($classType->getFqsen()); - } - - /** - * Resolves the collection values and keys - * - * @param ArrayIterator $tokens - * - * @return Array_|Iterable_|Collection - */ - private function resolveCollection(ArrayIterator $tokens, Type $classType, Context $context): Type - { - $isArray = ((string) $classType === 'array'); - $isIterable = ((string) $classType === 'iterable'); - - // allow only "array", "iterable" or class name before "<" - if ( - !$isArray && !$isIterable - && (!$classType instanceof Object_ || $classType->getFqsen() === null) - ) { - throw new RuntimeException( - $classType . ' is not a collection' - ); - } - - $tokens->next(); - - $valueType = $this->parseTypes($tokens, $context, self::PARSER_IN_COLLECTION_EXPRESSION); - $keyType = null; - - $token = $tokens->current(); - if ($token !== null && trim($token) === ',') { - // if we have a comma, then we just parsed the key type, not the value type - $keyType = $valueType; - if ($isArray) { - // check the key type for an "array" collection. We allow only - // strings or integers. - if ( - !$keyType instanceof ArrayKey && - !$keyType instanceof String_ && - !$keyType instanceof Integer && - !$keyType instanceof Compound - ) { - throw new RuntimeException( - 'An array can have only integers or strings as keys' - ); - } - - if ($keyType instanceof Compound) { - foreach ($keyType->getIterator() as $item) { - if ( - !$item instanceof ArrayKey && - !$item instanceof String_ && - !$item instanceof Integer - ) { - throw new RuntimeException( - 'An array can have only integers or strings as keys' - ); - } - } - } - } - - $tokens->next(); - // now let's parse the value type - $valueType = $this->parseTypes($tokens, $context, self::PARSER_IN_COLLECTION_EXPRESSION); - } - - $token = $tokens->current(); - if ($token !== '>') { - if (empty($token)) { - throw new RuntimeException( - 'Collection: ">" is missing' - ); - } - - throw new RuntimeException( - 'Unexpected character "' . $token . '", ">" is missing' - ); - } - - if ($isArray) { - return new Array_($valueType, $keyType); - } - - if ($isIterable) { - return new Iterable_($valueType, $keyType); - } - - if ($classType instanceof Object_) { - return $this->makeCollectionFromObject($classType, $valueType, $keyType); - } - - throw new RuntimeException('Invalid $classType provided'); - } - - /** - * @psalm-pure - */ - private function makeCollectionFromObject(Object_ $object, Type $valueType, ?Type $keyType = null): Collection - { - return new Collection($object->getFqsen(), $valueType, $keyType); - } -} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/AbstractList.php b/vendor/phpdocumentor/type-resolver/src/Types/AbstractList.php deleted file mode 100644 index b674862..0000000 --- a/vendor/phpdocumentor/type-resolver/src/Types/AbstractList.php +++ /dev/null @@ -1,83 +0,0 @@ -valueType = $valueType; - $this->defaultKeyType = new Compound([new String_(), new Integer()]); - $this->keyType = $keyType; - } - - /** - * Returns the type for the keys of this array. - */ - public function getKeyType(): Type - { - return $this->keyType ?? $this->defaultKeyType; - } - - /** - * Returns the value for the keys of this array. - */ - public function getValueType(): Type - { - return $this->valueType; - } - - /** - * Returns a rendered output of the Type as it would be used in a DocBlock. - */ - public function __toString(): string - { - if ($this->keyType) { - return 'array<' . $this->keyType . ',' . $this->valueType . '>'; - } - - if ($this->valueType instanceof Mixed_) { - return 'array'; - } - - if ($this->valueType instanceof Compound) { - return '(' . $this->valueType . ')[]'; - } - - return $this->valueType . '[]'; - } -} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/AggregatedType.php b/vendor/phpdocumentor/type-resolver/src/Types/AggregatedType.php deleted file mode 100644 index 472a1cd..0000000 --- a/vendor/phpdocumentor/type-resolver/src/Types/AggregatedType.php +++ /dev/null @@ -1,125 +0,0 @@ - - */ -abstract class AggregatedType implements Type, IteratorAggregate -{ - /** - * @psalm-allow-private-mutation - * @var array - */ - private $types = []; - - /** @var string */ - private $token; - - /** - * @param array $types - */ - public function __construct(array $types, string $token) - { - foreach ($types as $type) { - $this->add($type); - } - - $this->token = $token; - } - - /** - * Returns the type at the given index. - */ - public function get(int $index): ?Type - { - if (!$this->has($index)) { - return null; - } - - return $this->types[$index]; - } - - /** - * Tests if this compound type has a type with the given index. - */ - public function has(int $index): bool - { - return array_key_exists($index, $this->types); - } - - /** - * Tests if this compound type contains the given type. - */ - public function contains(Type $type): bool - { - foreach ($this->types as $typePart) { - // if the type is duplicate; do not add it - if ((string) $typePart === (string) $type) { - return true; - } - } - - return false; - } - - /** - * Returns a rendered output of the Type as it would be used in a DocBlock. - */ - public function __toString(): string - { - return implode($this->token, $this->types); - } - - /** - * @return ArrayIterator - */ - public function getIterator(): ArrayIterator - { - return new ArrayIterator($this->types); - } - - /** - * @psalm-suppress ImpureMethodCall - */ - private function add(Type $type): void - { - if ($type instanceof self) { - foreach ($type->getIterator() as $subType) { - $this->add($subType); - } - - return; - } - - // if the type is duplicate; do not add it - if ($this->contains($type)) { - return; - } - - $this->types[] = $type; - } -} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/ArrayKey.php b/vendor/phpdocumentor/type-resolver/src/Types/ArrayKey.php deleted file mode 100644 index cf86df0..0000000 --- a/vendor/phpdocumentor/type-resolver/src/Types/ArrayKey.php +++ /dev/null @@ -1,42 +0,0 @@ -fqsen = $fqsen; - } - - public function underlyingType(): Type - { - return new String_(); - } - - /** - * Returns the FQSEN associated with this object. - */ - public function getFqsen(): ?Fqsen - { - return $this->fqsen; - } - - /** - * Returns a rendered output of the Type as it would be used in a DocBlock. - */ - public function __toString(): string - { - if ($this->fqsen === null) { - return 'class-string'; - } - - return 'class-string<' . (string) $this->fqsen . '>'; - } -} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Collection.php b/vendor/phpdocumentor/type-resolver/src/Types/Collection.php deleted file mode 100644 index 943cc22..0000000 --- a/vendor/phpdocumentor/type-resolver/src/Types/Collection.php +++ /dev/null @@ -1,68 +0,0 @@ -` - * 2. `ACollectionObject` - * - * - ACollectionObject can be 'array' or an object that can act as an array - * - aValueType and aKeyType can be any type expression - * - * @psalm-immutable - */ -final class Collection extends AbstractList -{ - /** @var Fqsen|null */ - private $fqsen; - - /** - * Initializes this representation of an array with the given Type or Fqsen. - */ - public function __construct(?Fqsen $fqsen, Type $valueType, ?Type $keyType = null) - { - parent::__construct($valueType, $keyType); - - $this->fqsen = $fqsen; - } - - /** - * Returns the FQSEN associated with this object. - */ - public function getFqsen(): ?Fqsen - { - return $this->fqsen; - } - - /** - * Returns a rendered output of the Type as it would be used in a DocBlock. - */ - public function __toString(): string - { - $objectType = (string) ($this->fqsen ?? 'object'); - - if ($this->keyType === null) { - return $objectType . '<' . $this->valueType . '>'; - } - - return $objectType . '<' . $this->keyType . ',' . $this->valueType . '>'; - } -} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Compound.php b/vendor/phpdocumentor/type-resolver/src/Types/Compound.php deleted file mode 100644 index ad426cc..0000000 --- a/vendor/phpdocumentor/type-resolver/src/Types/Compound.php +++ /dev/null @@ -1,38 +0,0 @@ - $types - */ - public function __construct(array $types) - { - parent::__construct($types, '|'); - } -} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Context.php b/vendor/phpdocumentor/type-resolver/src/Types/Context.php deleted file mode 100644 index 79aadaf..0000000 --- a/vendor/phpdocumentor/type-resolver/src/Types/Context.php +++ /dev/null @@ -1,95 +0,0 @@ - Fully Qualified Namespace. - * @psalm-var array - */ - private $namespaceAliases; - - /** - * Initializes the new context and normalizes all passed namespaces to be in Qualified Namespace Name (QNN) - * format (without a preceding `\`). - * - * @param string $namespace The namespace where this DocBlock resides in. - * @param string[] $namespaceAliases List of namespace aliases => Fully Qualified Namespace. - * @psalm-param array $namespaceAliases - */ - public function __construct(string $namespace, array $namespaceAliases = []) - { - $this->namespace = $namespace !== 'global' && $namespace !== 'default' - ? trim($namespace, '\\') - : ''; - - foreach ($namespaceAliases as $alias => $fqnn) { - if ($fqnn[0] === '\\') { - $fqnn = substr($fqnn, 1); - } - - if ($fqnn[strlen($fqnn) - 1] === '\\') { - $fqnn = substr($fqnn, 0, -1); - } - - $namespaceAliases[$alias] = $fqnn; - } - - $this->namespaceAliases = $namespaceAliases; - } - - /** - * Returns the Qualified Namespace Name (thus without `\` in front) where the associated element is in. - */ - public function getNamespace(): string - { - return $this->namespace; - } - - /** - * Returns a list of Qualified Namespace Names (thus without `\` in front) that are imported, the keys represent - * the alias for the imported Namespace. - * - * @return string[] - * @psalm-return array - */ - public function getNamespaceAliases(): array - { - return $this->namespaceAliases; - } -} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/ContextFactory.php b/vendor/phpdocumentor/type-resolver/src/Types/ContextFactory.php deleted file mode 100644 index 892ee0f..0000000 --- a/vendor/phpdocumentor/type-resolver/src/Types/ContextFactory.php +++ /dev/null @@ -1,420 +0,0 @@ - $reflector */ - - return $this->createFromReflectionClass($reflector); - } - - if ($reflector instanceof ReflectionParameter) { - return $this->createFromReflectionParameter($reflector); - } - - if ($reflector instanceof ReflectionMethod) { - return $this->createFromReflectionMethod($reflector); - } - - if ($reflector instanceof ReflectionProperty) { - return $this->createFromReflectionProperty($reflector); - } - - if ($reflector instanceof ReflectionClassConstant) { - return $this->createFromReflectionClassConstant($reflector); - } - - throw new UnexpectedValueException('Unhandled \Reflector instance given: ' . get_class($reflector)); - } - - private function createFromReflectionParameter(ReflectionParameter $parameter): Context - { - $class = $parameter->getDeclaringClass(); - if (!$class) { - throw new InvalidArgumentException('Unable to get class of ' . $parameter->getName()); - } - - return $this->createFromReflectionClass($class); - } - - private function createFromReflectionMethod(ReflectionMethod $method): Context - { - $class = $method->getDeclaringClass(); - - return $this->createFromReflectionClass($class); - } - - private function createFromReflectionProperty(ReflectionProperty $property): Context - { - $class = $property->getDeclaringClass(); - - return $this->createFromReflectionClass($class); - } - - private function createFromReflectionClassConstant(ReflectionClassConstant $constant): Context - { - //phpcs:ignore SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration.MissingVariable - /** @phpstan-var ReflectionClass $class */ - $class = $constant->getDeclaringClass(); - - return $this->createFromReflectionClass($class); - } - - /** - * @phpstan-param ReflectionClass $class - */ - private function createFromReflectionClass(ReflectionClass $class): Context - { - $fileName = $class->getFileName(); - $namespace = $class->getNamespaceName(); - - if (is_string($fileName) && file_exists($fileName)) { - $contents = file_get_contents($fileName); - if ($contents === false) { - throw new RuntimeException('Unable to read file "' . $fileName . '"'); - } - - return $this->createForNamespace($namespace, $contents); - } - - return new Context($namespace, []); - } - - /** - * Build a Context for a namespace in the provided file contents. - * - * @see Context for more information on Contexts. - * - * @param string $namespace It does not matter if a `\` precedes the namespace name, - * this method first normalizes. - * @param string $fileContents The file's contents to retrieve the aliases from with the given namespace. - */ - public function createForNamespace(string $namespace, string $fileContents): Context - { - $namespace = trim($namespace, '\\'); - $useStatements = []; - $currentNamespace = ''; - $tokens = new ArrayIterator(token_get_all($fileContents)); - - while ($tokens->valid()) { - $currentToken = $tokens->current(); - switch ($currentToken[0]) { - case T_NAMESPACE: - $currentNamespace = $this->parseNamespace($tokens); - break; - case T_CLASS: - // Fast-forward the iterator through the class so that any - // T_USE tokens found within are skipped - these are not - // valid namespace use statements so should be ignored. - $braceLevel = 0; - $firstBraceFound = false; - while ($tokens->valid() && ($braceLevel > 0 || !$firstBraceFound)) { - $currentToken = $tokens->current(); - if ( - $currentToken === '{' - || in_array($currentToken[0], [T_CURLY_OPEN, T_DOLLAR_OPEN_CURLY_BRACES], true) - ) { - if (!$firstBraceFound) { - $firstBraceFound = true; - } - - ++$braceLevel; - } - - if ($currentToken === '}') { - --$braceLevel; - } - - $tokens->next(); - } - - break; - case T_USE: - if ($currentNamespace === $namespace) { - $useStatements += $this->parseUseStatement($tokens); - } - - break; - } - - $tokens->next(); - } - - return new Context($namespace, $useStatements); - } - - /** - * Deduce the name from tokens when we are at the T_NAMESPACE token. - * - * @param ArrayIterator $tokens - */ - private function parseNamespace(ArrayIterator $tokens): string - { - // skip to the first string or namespace separator - $this->skipToNextStringOrNamespaceSeparator($tokens); - - $name = ''; - $acceptedTokens = [T_STRING, T_NS_SEPARATOR, T_NAME_QUALIFIED]; - while ($tokens->valid() && in_array($tokens->current()[0], $acceptedTokens, true)) { - $name .= $tokens->current()[1]; - $tokens->next(); - } - - return $name; - } - - /** - * Deduce the names of all imports when we are at the T_USE token. - * - * @param ArrayIterator $tokens - * - * @return string[] - * @psalm-return array - */ - private function parseUseStatement(ArrayIterator $tokens): array - { - $uses = []; - - while ($tokens->valid()) { - $this->skipToNextStringOrNamespaceSeparator($tokens); - - $uses += $this->extractUseStatements($tokens); - $currentToken = $tokens->current(); - if ($currentToken[0] === self::T_LITERAL_END_OF_USE) { - return $uses; - } - } - - return $uses; - } - - /** - * Fast-forwards the iterator as longs as we don't encounter a T_STRING or T_NS_SEPARATOR token. - * - * @param ArrayIterator $tokens - */ - private function skipToNextStringOrNamespaceSeparator(ArrayIterator $tokens): void - { - while ($tokens->valid()) { - $currentToken = $tokens->current(); - if (in_array($currentToken[0], [T_STRING, T_NS_SEPARATOR], true)) { - break; - } - - if ($currentToken[0] === T_NAME_QUALIFIED) { - break; - } - - if (defined('T_NAME_FULLY_QUALIFIED') && $currentToken[0] === T_NAME_FULLY_QUALIFIED) { - break; - } - - $tokens->next(); - } - } - - /** - * Deduce the namespace name and alias of an import when we are at the T_USE token or have not reached the end of - * a USE statement yet. This will return a key/value array of the alias => namespace. - * - * @param ArrayIterator $tokens - * - * @return string[] - * @psalm-return array - * - * @psalm-suppress TypeDoesNotContainType - */ - private function extractUseStatements(ArrayIterator $tokens): array - { - $extractedUseStatements = []; - $groupedNs = ''; - $currentNs = ''; - $currentAlias = ''; - $state = 'start'; - - while ($tokens->valid()) { - $currentToken = $tokens->current(); - $tokenId = is_string($currentToken) ? $currentToken : $currentToken[0]; - $tokenValue = is_string($currentToken) ? null : $currentToken[1]; - switch ($state) { - case 'start': - switch ($tokenId) { - case T_STRING: - case T_NS_SEPARATOR: - $currentNs .= (string) $tokenValue; - $currentAlias = $tokenValue; - break; - case T_NAME_QUALIFIED: - case T_NAME_FULLY_QUALIFIED: - $currentNs .= (string) $tokenValue; - $currentAlias = substr( - (string) $tokenValue, - (int) (strrpos((string) $tokenValue, '\\')) + 1 - ); - break; - case T_CURLY_OPEN: - case '{': - $state = 'grouped'; - $groupedNs = $currentNs; - break; - case T_AS: - $state = 'start-alias'; - break; - case self::T_LITERAL_USE_SEPARATOR: - case self::T_LITERAL_END_OF_USE: - $state = 'end'; - break; - default: - break; - } - - break; - case 'start-alias': - switch ($tokenId) { - case T_STRING: - $currentAlias = $tokenValue; - break; - case self::T_LITERAL_USE_SEPARATOR: - case self::T_LITERAL_END_OF_USE: - $state = 'end'; - break; - default: - break; - } - - break; - case 'grouped': - switch ($tokenId) { - case T_STRING: - case T_NS_SEPARATOR: - $currentNs .= (string) $tokenValue; - $currentAlias = $tokenValue; - break; - case T_AS: - $state = 'grouped-alias'; - break; - case self::T_LITERAL_USE_SEPARATOR: - $state = 'grouped'; - $extractedUseStatements[(string) $currentAlias] = $currentNs; - $currentNs = $groupedNs; - $currentAlias = ''; - break; - case self::T_LITERAL_END_OF_USE: - $state = 'end'; - break; - default: - break; - } - - break; - case 'grouped-alias': - switch ($tokenId) { - case T_STRING: - $currentAlias = $tokenValue; - break; - case self::T_LITERAL_USE_SEPARATOR: - $state = 'grouped'; - $extractedUseStatements[(string) $currentAlias] = $currentNs; - $currentNs = $groupedNs; - $currentAlias = ''; - break; - case self::T_LITERAL_END_OF_USE: - $state = 'end'; - break; - default: - break; - } - } - - if ($state === 'end') { - break; - } - - $tokens->next(); - } - - if ($groupedNs !== $currentNs) { - $extractedUseStatements[(string) $currentAlias] = $currentNs; - } - - return $extractedUseStatements; - } -} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Expression.php b/vendor/phpdocumentor/type-resolver/src/Types/Expression.php deleted file mode 100644 index da5f65d..0000000 --- a/vendor/phpdocumentor/type-resolver/src/Types/Expression.php +++ /dev/null @@ -1,51 +0,0 @@ -valueType = $valueType; - } - - /** - * Returns the value for the keys of this array. - */ - public function getValueType(): Type - { - return $this->valueType; - } - - /** - * Returns a rendered output of the Type as it would be used in a DocBlock. - */ - public function __toString(): string - { - return '(' . $this->valueType . ')'; - } -} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Float_.php b/vendor/phpdocumentor/type-resolver/src/Types/Float_.php deleted file mode 100644 index 86138c0..0000000 --- a/vendor/phpdocumentor/type-resolver/src/Types/Float_.php +++ /dev/null @@ -1,32 +0,0 @@ -fqsen = $fqsen; - } - - /** - * Returns the FQSEN associated with this object. - */ - public function getFqsen(): ?Fqsen - { - return $this->fqsen; - } - - /** - * Returns a rendered output of the Type as it would be used in a DocBlock. - */ - public function __toString(): string - { - if ($this->fqsen === null) { - return 'interface-string'; - } - - return 'interface-string<' . (string) $this->fqsen . '>'; - } -} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Intersection.php b/vendor/phpdocumentor/type-resolver/src/Types/Intersection.php deleted file mode 100644 index ced37b6..0000000 --- a/vendor/phpdocumentor/type-resolver/src/Types/Intersection.php +++ /dev/null @@ -1,37 +0,0 @@ - $types - */ - public function __construct(array $types) - { - parent::__construct($types, '&'); - } -} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Iterable_.php b/vendor/phpdocumentor/type-resolver/src/Types/Iterable_.php deleted file mode 100644 index 1ca069f..0000000 --- a/vendor/phpdocumentor/type-resolver/src/Types/Iterable_.php +++ /dev/null @@ -1,38 +0,0 @@ -keyType) { - return 'iterable<' . $this->keyType . ',' . $this->valueType . '>'; - } - - if ($this->valueType instanceof Mixed_) { - return 'iterable'; - } - - return 'iterable<' . $this->valueType . '>'; - } -} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Mixed_.php b/vendor/phpdocumentor/type-resolver/src/Types/Mixed_.php deleted file mode 100644 index 56d1b6d..0000000 --- a/vendor/phpdocumentor/type-resolver/src/Types/Mixed_.php +++ /dev/null @@ -1,32 +0,0 @@ -realType = $realType; - } - - /** - * Provide access to the actual type directly, if needed. - */ - public function getActualType(): Type - { - return $this->realType; - } - - /** - * Returns a rendered output of the Type as it would be used in a DocBlock. - */ - public function __toString(): string - { - return '?' . $this->realType->__toString(); - } -} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Object_.php b/vendor/phpdocumentor/type-resolver/src/Types/Object_.php deleted file mode 100644 index 90dee57..0000000 --- a/vendor/phpdocumentor/type-resolver/src/Types/Object_.php +++ /dev/null @@ -1,69 +0,0 @@ -fqsen = $fqsen; - } - - /** - * Returns the FQSEN associated with this object. - */ - public function getFqsen(): ?Fqsen - { - return $this->fqsen; - } - - public function __toString(): string - { - if ($this->fqsen) { - return (string) $this->fqsen; - } - - return 'object'; - } -} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Parent_.php b/vendor/phpdocumentor/type-resolver/src/Types/Parent_.php deleted file mode 100644 index 3483859..0000000 --- a/vendor/phpdocumentor/type-resolver/src/Types/Parent_.php +++ /dev/null @@ -1,34 +0,0 @@ - - Marcello Duarte - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/phpspec/prophecy/README.md b/vendor/phpspec/prophecy/README.md deleted file mode 100644 index fab9589..0000000 --- a/vendor/phpspec/prophecy/README.md +++ /dev/null @@ -1,402 +0,0 @@ -# Prophecy - -[![Stable release](https://poser.pugx.org/phpspec/prophecy/version.svg)](https://packagist.org/packages/phpspec/prophecy) -[![Build Status](https://travis-ci.org/phpspec/prophecy.svg?branch=master)](https://travis-ci.org/phpspec/prophecy) - -Prophecy is a highly opinionated yet very powerful and flexible PHP object mocking -framework. Though initially it was created to fulfil phpspec2 needs, it is flexible -enough to be used inside any testing framework out there with minimal effort. - -## A simple example - -```php -prophet->prophesize('App\Security\Hasher'); - $user = new App\Entity\User($hasher->reveal()); - - $hasher->generateHash($user, 'qwerty')->willReturn('hashed_pass'); - - $user->setPassword('qwerty'); - - $this->assertEquals('hashed_pass', $user->getPassword()); - } - - protected function setUp() - { - $this->prophet = new \Prophecy\Prophet; - } - - protected function tearDown() - { - $this->prophet->checkPredictions(); - } -} -``` - -## Installation - -### Prerequisites - -Prophecy requires PHP 7.2.0 or greater. - -### Setup through composer - -First, add Prophecy to the list of dependencies inside your `composer.json`: - -```json -{ - "require-dev": { - "phpspec/prophecy": "~1.0" - } -} -``` - -Then simply install it with composer: - -```bash -$> composer install --prefer-dist -``` - -You can read more about Composer on its [official webpage](http://getcomposer.org). - -## How to use it - -First of all, in Prophecy every word has a logical meaning, even the name of the library -itself (Prophecy). When you start feeling that, you'll become very fluid with this -tool. - -For example, Prophecy has been named that way because it concentrates on describing the future -behavior of objects with very limited knowledge about them. But as with any other prophecy, -those object prophecies can't create themselves - there should be a Prophet: - -```php -$prophet = new Prophecy\Prophet; -``` - -The Prophet creates prophecies by *prophesizing* them: - -```php -$prophecy = $prophet->prophesize(); -``` - -The result of the `prophesize()` method call is a new object of class `ObjectProphecy`. Yes, -that's your specific object prophecy, which describes how your object would behave -in the near future. But first, you need to specify which object you're talking about, -right? - -```php -$prophecy->willExtend('stdClass'); -$prophecy->willImplement('SessionHandlerInterface'); -``` - -There are 2 interesting calls - `willExtend` and `willImplement`. The first one tells -object prophecy that our object should extend specific class, the second one says that -it should implement some interface. Obviously, objects in PHP can implement multiple -interfaces, but extend only one parent class. - -### Dummies - -Ok, now we have our object prophecy. What can we do with it? First of all, we can get -our object *dummy* by revealing its prophecy: - -```php -$dummy = $prophecy->reveal(); -``` - -The `$dummy` variable now holds a special dummy object. Dummy objects are objects that extend -and/or implement preset classes/interfaces by overriding all their public methods. The key -point about dummies is that they do not hold any logic - they just do nothing. Any method -of the dummy will always return `null` and the dummy will never throw any exceptions. -Dummy is your friend if you don't care about the actual behavior of this double and just need -a token object to satisfy a method typehint. - -You need to understand one thing - a dummy is not a prophecy. Your object prophecy is still -assigned to `$prophecy` variable and in order to manipulate with your expectations, you -should work with it. `$dummy` is a dummy - a simple php object that tries to fulfil your -prophecy. - -### Stubs - -Ok, now we know how to create basic prophecies and reveal dummies from them. That's -awesome if we don't care about our _doubles_ (objects that reflect originals) -interactions. If we do, we need to use *stubs* or *mocks*. - -A stub is an object double, which doesn't have any expectations about the object behavior, -but when put in specific environment, behaves in specific way. Ok, I know, it's cryptic, -but bear with me for a minute. Simply put, a stub is a dummy, which depending on the called -method signature does different things (has logic). To create stubs in Prophecy: - -```php -$prophecy->read('123')->willReturn('value'); -``` - -Oh wow. We've just made an arbitrary call on the object prophecy? Yes, we did. And this -call returned us a new object instance of class `MethodProphecy`. Yep, that's a specific -method with arguments prophecy. Method prophecies give you the ability to create method -promises or predictions. We'll talk about method predictions later in the _Mocks_ section. - -#### Promises - -Promises are logical blocks, that represent your fictional methods in prophecy terms -and they are handled by the `MethodProphecy::will(PromiseInterface $promise)` method. -As a matter of fact, the call that we made earlier (`willReturn('value')`) is a simple -shortcut to: - -```php -$prophecy->read('123')->will(new Prophecy\Promise\ReturnPromise(array('value'))); -``` - -This promise will cause any call to our double's `read()` method with exactly one -argument - `'123'` to always return `'value'`. But that's only for this -promise, there's plenty others you can use: - -- `ReturnPromise` or `->willReturn(1)` - returns a value from a method call -- `ReturnArgumentPromise` or `->willReturnArgument($index)` - returns the nth method argument from call -- `ThrowPromise` or `->willThrow($exception)` - causes the method to throw specific exception -- `CallbackPromise` or `->will($callback)` - gives you a quick way to define your own custom logic - -Keep in mind, that you can always add even more promises by implementing -`Prophecy\Promise\PromiseInterface`. - -#### Method prophecies idempotency - -Prophecy enforces same method prophecies and, as a consequence, same promises and -predictions for the same method calls with the same arguments. This means: - -```php -$methodProphecy1 = $prophecy->read('123'); -$methodProphecy2 = $prophecy->read('123'); -$methodProphecy3 = $prophecy->read('321'); - -$methodProphecy1 === $methodProphecy2; -$methodProphecy1 !== $methodProphecy3; -``` - -That's interesting, right? Now you might ask me how would you define more complex -behaviors where some method call changes behavior of others. In PHPUnit or Mockery -you do that by predicting how many times your method will be called. In Prophecy, -you'll use promises for that: - -```php -$user->getName()->willReturn(null); - -// For PHP 5.4 -$user->setName('everzet')->will(function () { - $this->getName()->willReturn('everzet'); -}); - -// For PHP 5.3 -$user->setName('everzet')->will(function ($args, $user) { - $user->getName()->willReturn('everzet'); -}); - -// Or -$user->setName('everzet')->will(function ($args) use ($user) { - $user->getName()->willReturn('everzet'); -}); -``` - -And now it doesn't matter how many times or in which order your methods are called. -What matters is their behaviors and how well you faked it. - -Note: If the method is called several times, you can use the following syntax to return different -values for each call: - -```php -$prophecy->read('123')->willReturn(1, 2, 3); -``` - -This feature is actually not recommended for most cases. Relying on the order of -calls for the same arguments tends to make test fragile, as adding one more call -can break everything. - -#### Arguments wildcarding - -The previous example is awesome (at least I hope it is for you), but that's not -optimal enough. We hardcoded `'everzet'` in our expectation. Isn't there a better -way? In fact there is, but it involves understanding what this `'everzet'` -actually is. - -You see, even if method arguments used during method prophecy creation look -like simple method arguments, in reality they are not. They are argument token -wildcards. As a matter of fact, `->setName('everzet')` looks like a simple call just -because Prophecy automatically transforms it under the hood into: - -```php -$user->setName(new Prophecy\Argument\Token\ExactValueToken('everzet')); -``` - -Those argument tokens are simple PHP classes, that implement -`Prophecy\Argument\Token\TokenInterface` and tell Prophecy how to compare real arguments -with your expectations. And yes, those classnames are damn big. That's why there's a -shortcut class `Prophecy\Argument`, which you can use to create tokens like that: - -```php -use Prophecy\Argument; - -$user->setName(Argument::exact('everzet')); -``` - -`ExactValueToken` is not very useful in our case as it forced us to hardcode the username. -That's why Prophecy comes bundled with a bunch of other tokens: - -- `IdenticalValueToken` or `Argument::is($value)` - checks that the argument is identical to a specific value -- `ExactValueToken` or `Argument::exact($value)` - checks that the argument matches a specific value -- `TypeToken` or `Argument::type($typeOrClass)` - checks that the argument matches a specific type or - classname -- `ObjectStateToken` or `Argument::which($method, $value)` - checks that the argument method returns - a specific value -- `CallbackToken` or `Argument::that(callback)` - checks that the argument matches a custom callback -- `AnyValueToken` or `Argument::any()` - matches any argument -- `AnyValuesToken` or `Argument::cetera()` - matches any arguments to the rest of the signature -- `StringContainsToken` or `Argument::containingString($value)` - checks that the argument contains a specific string value - -And you can add even more by implementing `TokenInterface` with your own custom classes. - -So, let's refactor our initial `{set,get}Name()` logic with argument tokens: - -```php -use Prophecy\Argument; - -$user->getName()->willReturn(null); - -// For PHP 5.4 -$user->setName(Argument::type('string'))->will(function ($args) { - $this->getName()->willReturn($args[0]); -}); - -// For PHP 5.3 -$user->setName(Argument::type('string'))->will(function ($args, $user) { - $user->getName()->willReturn($args[0]); -}); - -// Or -$user->setName(Argument::type('string'))->will(function ($args) use ($user) { - $user->getName()->willReturn($args[0]); -}); -``` - -That's it. Now our `{set,get}Name()` prophecy will work with any string argument provided to it. -We've just described how our stub object should behave, even though the original object could have -no behavior whatsoever. - -One last bit about arguments now. You might ask, what happens in case of: - -```php -use Prophecy\Argument; - -$user->getName()->willReturn(null); - -// For PHP 5.4 -$user->setName(Argument::type('string'))->will(function ($args) { - $this->getName()->willReturn($args[0]); -}); - -// For PHP 5.3 -$user->setName(Argument::type('string'))->will(function ($args, $user) { - $user->getName()->willReturn($args[0]); -}); - -// Or -$user->setName(Argument::type('string'))->will(function ($args) use ($user) { - $user->getName()->willReturn($args[0]); -}); - -$user->setName(Argument::any())->will(function () { -}); -``` - -Nothing. Your stub will continue behaving the way it did before. That's because of how -arguments wildcarding works. Every argument token type has a different score level, which -wildcard then uses to calculate the final arguments match score and use the method prophecy -promise that has the highest score. In this case, `Argument::type()` in case of success -scores `5` and `Argument::any()` scores `3`. So the type token wins, as does the first -`setName()` method prophecy and its promise. The simple rule of thumb - more precise token -always wins. - -#### Getting stub objects - -Ok, now we know how to define our prophecy method promises, let's get our stub from -it: - -```php -$stub = $prophecy->reveal(); -``` - -As you might see, the only difference between how we get dummies and stubs is that with -stubs we describe every object conversation instead of just agreeing with `null` returns -(object being *dummy*). As a matter of fact, after you define your first promise -(method call), Prophecy will force you to define all the communications - it throws -the `UnexpectedCallException` for any call you didn't describe with object prophecy before -calling it on a stub. - -### Mocks - -Now we know how to define doubles without behavior (dummies) and doubles with behavior, but -no expectations (stubs). What's left is doubles for which we have some expectations. These -are called mocks and in Prophecy they look almost exactly the same as stubs, except that -they define *predictions* instead of *promises* on method prophecies: - -```php -$entityManager->flush()->shouldBeCalled(); -``` - -#### Predictions - -The `shouldBeCalled()` method here assigns `CallPrediction` to our method prophecy. -Predictions are a delayed behavior check for your prophecies. You see, during the entire lifetime -of your doubles, Prophecy records every single call you're making against it inside your -code. After that, Prophecy can use this collected information to check if it matches defined -predictions. You can assign predictions to method prophecies using the -`MethodProphecy::should(PredictionInterface $prediction)` method. As a matter of fact, -the `shouldBeCalled()` method we used earlier is just a shortcut to: - -```php -$entityManager->flush()->should(new Prophecy\Prediction\CallPrediction()); -``` - -It checks if your method of interest (that matches both the method name and the arguments wildcard) -was called 1 or more times. If the prediction failed then it throws an exception. When does this -check happen? Whenever you call `checkPredictions()` on the main Prophet object: - -```php -$prophet->checkPredictions(); -``` - -In PHPUnit, you would want to put this call into the `tearDown()` method. If no predictions -are defined, it would do nothing. So it won't harm to call it after every test. - -There are plenty more predictions you can play with: - -- `CallPrediction` or `shouldBeCalled()` - checks that the method has been called 1 or more times -- `NoCallsPrediction` or `shouldNotBeCalled()` - checks that the method has not been called -- `CallTimesPrediction` or `shouldBeCalledTimes($count)` - checks that the method has been called - `$count` times -- `CallbackPrediction` or `should($callback)` - checks the method against your own custom callback - -Of course, you can always create your own custom prediction any time by implementing -`PredictionInterface`. - -### Spies - -The last bit of awesomeness in Prophecy is out-of-the-box spies support. As I said in the previous -section, Prophecy records every call made during the double's entire lifetime. This means -you don't need to record predictions in order to check them. You can also do it -manually by using the `MethodProphecy::shouldHave(PredictionInterface $prediction)` method: - -```php -$em = $prophet->prophesize('Doctrine\ORM\EntityManager'); - -$controller->createUser($em->reveal()); - -$em->flush()->shouldHaveBeenCalled(); -``` - -Such manipulation with doubles is called spying. And with Prophecy it just works. diff --git a/vendor/phpspec/prophecy/composer.json b/vendor/phpspec/prophecy/composer.json deleted file mode 100644 index dbb2e55..0000000 --- a/vendor/phpspec/prophecy/composer.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "phpspec/prophecy", - "description": "Highly opinionated mocking framework for PHP 5.3+", - "keywords": ["Mock", "Stub", "Dummy", "Double", "Fake", "Spy"], - "homepage": "https://github.com/phpspec/prophecy", - "type": "library", - "license": "MIT", - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - - "require": { - "php": "^7.2", - "phpdocumentor/reflection-docblock": "^5.0", - "sebastian/comparator": "^3.0 || ^4.0", - "doctrine/instantiator": "^1.2", - "sebastian/recursion-context": "^3.0 || ^4.0" - }, - - "require-dev": { - "phpspec/phpspec": "^6.0", - "phpunit/phpunit": "^8.0" - }, - - "autoload": { - "psr-4": { - "Prophecy\\": "src/Prophecy" - } - }, - - "autoload-dev": { - "psr-4": { - "Fixtures\\Prophecy\\": "fixtures" - } - }, - - "extra": { - "branch-alias": { - "dev-master": "1.11.x-dev" - } - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Argument.php b/vendor/phpspec/prophecy/src/Prophecy/Argument.php deleted file mode 100644 index fde6aa9..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Argument.php +++ /dev/null @@ -1,212 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy; - -use Prophecy\Argument\Token; - -/** - * Argument tokens shortcuts. - * - * @author Konstantin Kudryashov - */ -class Argument -{ - /** - * Checks that argument is exact value or object. - * - * @param mixed $value - * - * @return Token\ExactValueToken - */ - public static function exact($value) - { - return new Token\ExactValueToken($value); - } - - /** - * Checks that argument is of specific type or instance of specific class. - * - * @param string $type Type name (`integer`, `string`) or full class name - * - * @return Token\TypeToken - */ - public static function type($type) - { - return new Token\TypeToken($type); - } - - /** - * Checks that argument object has specific state. - * - * @param string $methodName - * @param mixed $value - * - * @return Token\ObjectStateToken - */ - public static function which($methodName, $value) - { - return new Token\ObjectStateToken($methodName, $value); - } - - /** - * Checks that argument matches provided callback. - * - * @param callable $callback - * - * @return Token\CallbackToken - */ - public static function that($callback) - { - return new Token\CallbackToken($callback); - } - - /** - * Matches any single value. - * - * @return Token\AnyValueToken - */ - public static function any() - { - return new Token\AnyValueToken; - } - - /** - * Matches all values to the rest of the signature. - * - * @return Token\AnyValuesToken - */ - public static function cetera() - { - return new Token\AnyValuesToken; - } - - /** - * Checks that argument matches all tokens - * - * @param mixed ... a list of tokens - * - * @return Token\LogicalAndToken - */ - public static function allOf() - { - return new Token\LogicalAndToken(func_get_args()); - } - - /** - * Checks that argument array or countable object has exact number of elements. - * - * @param integer $value array elements count - * - * @return Token\ArrayCountToken - */ - public static function size($value) - { - return new Token\ArrayCountToken($value); - } - - /** - * Checks that argument array contains (key, value) pair - * - * @param mixed $key exact value or token - * @param mixed $value exact value or token - * - * @return Token\ArrayEntryToken - */ - public static function withEntry($key, $value) - { - return new Token\ArrayEntryToken($key, $value); - } - - /** - * Checks that arguments array entries all match value - * - * @param mixed $value - * - * @return Token\ArrayEveryEntryToken - */ - public static function withEveryEntry($value) - { - return new Token\ArrayEveryEntryToken($value); - } - - /** - * Checks that argument array contains value - * - * @param mixed $value - * - * @return Token\ArrayEntryToken - */ - public static function containing($value) - { - return new Token\ArrayEntryToken(self::any(), $value); - } - - /** - * Checks that argument array has key - * - * @param mixed $key exact value or token - * - * @return Token\ArrayEntryToken - */ - public static function withKey($key) - { - return new Token\ArrayEntryToken($key, self::any()); - } - - /** - * Checks that argument does not match the value|token. - * - * @param mixed $value either exact value or argument token - * - * @return Token\LogicalNotToken - */ - public static function not($value) - { - return new Token\LogicalNotToken($value); - } - - /** - * @param string $value - * - * @return Token\StringContainsToken - */ - public static function containingString($value) - { - return new Token\StringContainsToken($value); - } - - /** - * Checks that argument is identical value. - * - * @param mixed $value - * - * @return Token\IdenticalValueToken - */ - public static function is($value) - { - return new Token\IdenticalValueToken($value); - } - - /** - * Check that argument is same value when rounding to the - * given precision. - * - * @param float $value - * @param float $precision - * - * @return Token\ApproximateValueToken - */ - public static function approximate($value, $precision = 0) - { - return new Token\ApproximateValueToken($value, $precision); - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Argument/ArgumentsWildcard.php b/vendor/phpspec/prophecy/src/Prophecy/Argument/ArgumentsWildcard.php deleted file mode 100644 index a088f21..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Argument/ArgumentsWildcard.php +++ /dev/null @@ -1,101 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Argument; - -/** - * Arguments wildcarding. - * - * @author Konstantin Kudryashov - */ -class ArgumentsWildcard -{ - /** - * @var Token\TokenInterface[] - */ - private $tokens = array(); - private $string; - - /** - * Initializes wildcard. - * - * @param array $arguments Array of argument tokens or values - */ - public function __construct(array $arguments) - { - foreach ($arguments as $argument) { - if (!$argument instanceof Token\TokenInterface) { - $argument = new Token\ExactValueToken($argument); - } - - $this->tokens[] = $argument; - } - } - - /** - * Calculates wildcard match score for provided arguments. - * - * @param array $arguments - * - * @return false|int False OR integer score (higher - better) - */ - public function scoreArguments(array $arguments) - { - if (0 == count($arguments) && 0 == count($this->tokens)) { - return 1; - } - - $arguments = array_values($arguments); - $totalScore = 0; - foreach ($this->tokens as $i => $token) { - $argument = isset($arguments[$i]) ? $arguments[$i] : null; - if (1 >= $score = $token->scoreArgument($argument)) { - return false; - } - - $totalScore += $score; - - if (true === $token->isLast()) { - return $totalScore; - } - } - - if (count($arguments) > count($this->tokens)) { - return false; - } - - return $totalScore; - } - - /** - * Returns string representation for wildcard. - * - * @return string - */ - public function __toString() - { - if (null === $this->string) { - $this->string = implode(', ', array_map(function ($token) { - return (string) $token; - }, $this->tokens)); - } - - return $this->string; - } - - /** - * @return array - */ - public function getTokens() - { - return $this->tokens; - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/AnyValueToken.php b/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/AnyValueToken.php deleted file mode 100644 index 5098811..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/AnyValueToken.php +++ /dev/null @@ -1,52 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Argument\Token; - -/** - * Any single value token. - * - * @author Konstantin Kudryashov - */ -class AnyValueToken implements TokenInterface -{ - /** - * Always scores 3 for any argument. - * - * @param $argument - * - * @return int - */ - public function scoreArgument($argument) - { - return 3; - } - - /** - * Returns false. - * - * @return bool - */ - public function isLast() - { - return false; - } - - /** - * Returns string representation for token. - * - * @return string - */ - public function __toString() - { - return '*'; - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/AnyValuesToken.php b/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/AnyValuesToken.php deleted file mode 100644 index f76b17b..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/AnyValuesToken.php +++ /dev/null @@ -1,52 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Argument\Token; - -/** - * Any values token. - * - * @author Konstantin Kudryashov - */ -class AnyValuesToken implements TokenInterface -{ - /** - * Always scores 2 for any argument. - * - * @param $argument - * - * @return int - */ - public function scoreArgument($argument) - { - return 2; - } - - /** - * Returns true to stop wildcard from processing other tokens. - * - * @return bool - */ - public function isLast() - { - return true; - } - - /** - * Returns string representation for token. - * - * @return string - */ - public function __toString() - { - return '* [, ...]'; - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ApproximateValueToken.php b/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ApproximateValueToken.php deleted file mode 100644 index d4918b1..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ApproximateValueToken.php +++ /dev/null @@ -1,55 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Argument\Token; - -/** - * Approximate value token - * - * @author Daniel Leech - */ -class ApproximateValueToken implements TokenInterface -{ - private $value; - private $precision; - - public function __construct($value, $precision = 0) - { - $this->value = $value; - $this->precision = $precision; - } - - /** - * {@inheritdoc} - */ - public function scoreArgument($argument) - { - return round($argument, $this->precision) === round($this->value, $this->precision) ? 10 : false; - } - - /** - * {@inheritdoc} - */ - public function isLast() - { - return false; - } - - /** - * Returns string representation for token. - * - * @return string - */ - public function __toString() - { - return sprintf('≅%s', round($this->value, $this->precision)); - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ArrayCountToken.php b/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ArrayCountToken.php deleted file mode 100644 index 96b4bef..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ArrayCountToken.php +++ /dev/null @@ -1,86 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Argument\Token; - -/** - * Array elements count token. - * - * @author Boris Mikhaylov - */ - -class ArrayCountToken implements TokenInterface -{ - private $count; - - /** - * @param integer $value - */ - public function __construct($value) - { - $this->count = $value; - } - - /** - * Scores 6 when argument has preset number of elements. - * - * @param $argument - * - * @return bool|int - */ - public function scoreArgument($argument) - { - return $this->isCountable($argument) && $this->hasProperCount($argument) ? 6 : false; - } - - /** - * Returns false. - * - * @return boolean - */ - public function isLast() - { - return false; - } - - /** - * Returns string representation for token. - * - * @return string - */ - public function __toString() - { - return sprintf('count(%s)', $this->count); - } - - /** - * Returns true if object is either array or instance of \Countable - * - * @param $argument - * @return bool - */ - private function isCountable($argument) - { - return (is_array($argument) || $argument instanceof \Countable); - } - - /** - * Returns true if $argument has expected number of elements - * - * @param array|\Countable $argument - * - * @return bool - */ - private function hasProperCount($argument) - { - return $this->count === count($argument); - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ArrayEntryToken.php b/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ArrayEntryToken.php deleted file mode 100644 index 0305fc7..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ArrayEntryToken.php +++ /dev/null @@ -1,143 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Argument\Token; - -use Prophecy\Exception\InvalidArgumentException; - -/** - * Array entry token. - * - * @author Boris Mikhaylov - */ -class ArrayEntryToken implements TokenInterface -{ - /** @var \Prophecy\Argument\Token\TokenInterface */ - private $key; - /** @var \Prophecy\Argument\Token\TokenInterface */ - private $value; - - /** - * @param mixed $key exact value or token - * @param mixed $value exact value or token - */ - public function __construct($key, $value) - { - $this->key = $this->wrapIntoExactValueToken($key); - $this->value = $this->wrapIntoExactValueToken($value); - } - - /** - * Scores half of combined scores from key and value tokens for same entry. Capped at 8. - * If argument implements \ArrayAccess without \Traversable, then key token is restricted to ExactValueToken. - * - * @param array|\ArrayAccess|\Traversable $argument - * - * @throws \Prophecy\Exception\InvalidArgumentException - * @return bool|int - */ - public function scoreArgument($argument) - { - if ($argument instanceof \Traversable) { - $argument = iterator_to_array($argument); - } - - if ($argument instanceof \ArrayAccess) { - $argument = $this->convertArrayAccessToEntry($argument); - } - - if (!is_array($argument) || empty($argument)) { - return false; - } - - $keyScores = array_map(array($this->key,'scoreArgument'), array_keys($argument)); - $valueScores = array_map(array($this->value,'scoreArgument'), $argument); - $scoreEntry = function ($value, $key) { - return $value && $key ? min(8, ($key + $value) / 2) : false; - }; - - return max(array_map($scoreEntry, $valueScores, $keyScores)); - } - - /** - * Returns false. - * - * @return boolean - */ - public function isLast() - { - return false; - } - - /** - * Returns string representation for token. - * - * @return string - */ - public function __toString() - { - return sprintf('[..., %s => %s, ...]', $this->key, $this->value); - } - - /** - * Returns key - * - * @return TokenInterface - */ - public function getKey() - { - return $this->key; - } - - /** - * Returns value - * - * @return TokenInterface - */ - public function getValue() - { - return $this->value; - } - - /** - * Wraps non token $value into ExactValueToken - * - * @param $value - * @return TokenInterface - */ - private function wrapIntoExactValueToken($value) - { - return $value instanceof TokenInterface ? $value : new ExactValueToken($value); - } - - /** - * Converts instance of \ArrayAccess to key => value array entry - * - * @param \ArrayAccess $object - * - * @return array|null - * @throws \Prophecy\Exception\InvalidArgumentException - */ - private function convertArrayAccessToEntry(\ArrayAccess $object) - { - if (!$this->key instanceof ExactValueToken) { - throw new InvalidArgumentException(sprintf( - 'You can only use exact value tokens to match key of ArrayAccess object'.PHP_EOL. - 'But you used `%s`.', - $this->key - )); - } - - $key = $this->key->getValue(); - - return $object->offsetExists($key) ? array($key => $object[$key]) : array(); - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ArrayEveryEntryToken.php b/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ArrayEveryEntryToken.php deleted file mode 100644 index 5d41fa4..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ArrayEveryEntryToken.php +++ /dev/null @@ -1,82 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Argument\Token; - -/** - * Array every entry token. - * - * @author Adrien Brault - */ -class ArrayEveryEntryToken implements TokenInterface -{ - /** - * @var TokenInterface - */ - private $value; - - /** - * @param mixed $value exact value or token - */ - public function __construct($value) - { - if (!$value instanceof TokenInterface) { - $value = new ExactValueToken($value); - } - - $this->value = $value; - } - - /** - * {@inheritdoc} - */ - public function scoreArgument($argument) - { - if (!$argument instanceof \Traversable && !is_array($argument)) { - return false; - } - - $scores = array(); - foreach ($argument as $key => $argumentEntry) { - $scores[] = $this->value->scoreArgument($argumentEntry); - } - - if (empty($scores) || in_array(false, $scores, true)) { - return false; - } - - return array_sum($scores) / count($scores); - } - - /** - * {@inheritdoc} - */ - public function isLast() - { - return false; - } - - /** - * {@inheritdoc} - */ - public function __toString() - { - return sprintf('[%s, ..., %s]', $this->value, $this->value); - } - - /** - * @return TokenInterface - */ - public function getValue() - { - return $this->value; - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/CallbackToken.php b/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/CallbackToken.php deleted file mode 100644 index f45ba20..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/CallbackToken.php +++ /dev/null @@ -1,75 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Argument\Token; - -use Prophecy\Exception\InvalidArgumentException; - -/** - * Callback-verified token. - * - * @author Konstantin Kudryashov - */ -class CallbackToken implements TokenInterface -{ - private $callback; - - /** - * Initializes token. - * - * @param callable $callback - * - * @throws \Prophecy\Exception\InvalidArgumentException - */ - public function __construct($callback) - { - if (!is_callable($callback)) { - throw new InvalidArgumentException(sprintf( - 'Callable expected as an argument to CallbackToken, but got %s.', - gettype($callback) - )); - } - - $this->callback = $callback; - } - - /** - * Scores 7 if callback returns true, false otherwise. - * - * @param $argument - * - * @return bool|int - */ - public function scoreArgument($argument) - { - return call_user_func($this->callback, $argument) ? 7 : false; - } - - /** - * Returns false. - * - * @return bool - */ - public function isLast() - { - return false; - } - - /** - * Returns string representation for token. - * - * @return string - */ - public function __toString() - { - return 'callback()'; - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ExactValueToken.php b/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ExactValueToken.php deleted file mode 100644 index 045a1b9..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ExactValueToken.php +++ /dev/null @@ -1,118 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Argument\Token; - -use SebastianBergmann\Comparator\ComparisonFailure; -use Prophecy\Comparator\Factory as ComparatorFactory; -use Prophecy\Util\StringUtil; - -/** - * Exact value token. - * - * @author Konstantin Kudryashov - */ -class ExactValueToken implements TokenInterface -{ - private $value; - private $string; - private $util; - private $comparatorFactory; - - /** - * Initializes token. - * - * @param mixed $value - * @param StringUtil $util - * @param ComparatorFactory $comparatorFactory - */ - public function __construct($value, StringUtil $util = null, ComparatorFactory $comparatorFactory = null) - { - $this->value = $value; - $this->util = $util ?: new StringUtil(); - - $this->comparatorFactory = $comparatorFactory ?: ComparatorFactory::getInstance(); - } - - /** - * Scores 10 if argument matches preset value. - * - * @param $argument - * - * @return bool|int - */ - public function scoreArgument($argument) - { - if (is_object($argument) && is_object($this->value)) { - $comparator = $this->comparatorFactory->getComparatorFor( - $argument, $this->value - ); - - try { - $comparator->assertEquals($argument, $this->value); - return 10; - } catch (ComparisonFailure $failure) { - return false; - } - } - - // If either one is an object it should be castable to a string - if (is_object($argument) xor is_object($this->value)) { - if (is_object($argument) && !method_exists($argument, '__toString')) { - return false; - } - - if (is_object($this->value) && !method_exists($this->value, '__toString')) { - return false; - } - } elseif (is_numeric($argument) && is_numeric($this->value)) { - // noop - } elseif (gettype($argument) !== gettype($this->value)) { - return false; - } - - return $argument == $this->value ? 10 : false; - } - - /** - * Returns preset value against which token checks arguments. - * - * @return mixed - */ - public function getValue() - { - return $this->value; - } - - /** - * Returns false. - * - * @return bool - */ - public function isLast() - { - return false; - } - - /** - * Returns string representation for token. - * - * @return string - */ - public function __toString() - { - if (null === $this->string) { - $this->string = sprintf('exact(%s)', $this->util->stringify($this->value)); - } - - return $this->string; - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/IdenticalValueToken.php b/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/IdenticalValueToken.php deleted file mode 100644 index 0b6d23a..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/IdenticalValueToken.php +++ /dev/null @@ -1,74 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Argument\Token; - -use Prophecy\Util\StringUtil; - -/** - * Identical value token. - * - * @author Florian Voutzinos - */ -class IdenticalValueToken implements TokenInterface -{ - private $value; - private $string; - private $util; - - /** - * Initializes token. - * - * @param mixed $value - * @param StringUtil $util - */ - public function __construct($value, StringUtil $util = null) - { - $this->value = $value; - $this->util = $util ?: new StringUtil(); - } - - /** - * Scores 11 if argument matches preset value. - * - * @param $argument - * - * @return bool|int - */ - public function scoreArgument($argument) - { - return $argument === $this->value ? 11 : false; - } - - /** - * Returns false. - * - * @return bool - */ - public function isLast() - { - return false; - } - - /** - * Returns string representation for token. - * - * @return string - */ - public function __toString() - { - if (null === $this->string) { - $this->string = sprintf('identical(%s)', $this->util->stringify($this->value)); - } - - return $this->string; - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/LogicalAndToken.php b/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/LogicalAndToken.php deleted file mode 100644 index 4ee1b25..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/LogicalAndToken.php +++ /dev/null @@ -1,80 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Argument\Token; - -/** - * Logical AND token. - * - * @author Boris Mikhaylov - */ -class LogicalAndToken implements TokenInterface -{ - private $tokens = array(); - - /** - * @param array $arguments exact values or tokens - */ - public function __construct(array $arguments) - { - foreach ($arguments as $argument) { - if (!$argument instanceof TokenInterface) { - $argument = new ExactValueToken($argument); - } - $this->tokens[] = $argument; - } - } - - /** - * Scores maximum score from scores returned by tokens for this argument if all of them score. - * - * @param $argument - * - * @return bool|int - */ - public function scoreArgument($argument) - { - if (0 === count($this->tokens)) { - return false; - } - - $maxScore = 0; - foreach ($this->tokens as $token) { - $score = $token->scoreArgument($argument); - if (false === $score) { - return false; - } - $maxScore = max($score, $maxScore); - } - - return $maxScore; - } - - /** - * Returns false. - * - * @return boolean - */ - public function isLast() - { - return false; - } - - /** - * Returns string representation for token. - * - * @return string - */ - public function __toString() - { - return sprintf('bool(%s)', implode(' AND ', $this->tokens)); - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/LogicalNotToken.php b/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/LogicalNotToken.php deleted file mode 100644 index 623efa5..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/LogicalNotToken.php +++ /dev/null @@ -1,73 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Argument\Token; - -/** - * Logical NOT token. - * - * @author Boris Mikhaylov - */ -class LogicalNotToken implements TokenInterface -{ - /** @var \Prophecy\Argument\Token\TokenInterface */ - private $token; - - /** - * @param mixed $value exact value or token - */ - public function __construct($value) - { - $this->token = $value instanceof TokenInterface? $value : new ExactValueToken($value); - } - - /** - * Scores 4 when preset token does not match the argument. - * - * @param $argument - * - * @return bool|int - */ - public function scoreArgument($argument) - { - return false === $this->token->scoreArgument($argument) ? 4 : false; - } - - /** - * Returns true if preset token is last. - * - * @return bool|int - */ - public function isLast() - { - return $this->token->isLast(); - } - - /** - * Returns originating token. - * - * @return TokenInterface - */ - public function getOriginatingToken() - { - return $this->token; - } - - /** - * Returns string representation for token. - * - * @return string - */ - public function __toString() - { - return sprintf('not(%s)', $this->token); - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ObjectStateToken.php b/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ObjectStateToken.php deleted file mode 100644 index d771077..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ObjectStateToken.php +++ /dev/null @@ -1,104 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Argument\Token; - -use SebastianBergmann\Comparator\ComparisonFailure; -use Prophecy\Comparator\Factory as ComparatorFactory; -use Prophecy\Util\StringUtil; - -/** - * Object state-checker token. - * - * @author Konstantin Kudryashov - */ -class ObjectStateToken implements TokenInterface -{ - private $name; - private $value; - private $util; - private $comparatorFactory; - - /** - * Initializes token. - * - * @param string $methodName - * @param mixed $value Expected return value - * @param null|StringUtil $util - * @param ComparatorFactory $comparatorFactory - */ - public function __construct( - $methodName, - $value, - StringUtil $util = null, - ComparatorFactory $comparatorFactory = null - ) { - $this->name = $methodName; - $this->value = $value; - $this->util = $util ?: new StringUtil; - - $this->comparatorFactory = $comparatorFactory ?: ComparatorFactory::getInstance(); - } - - /** - * Scores 8 if argument is an object, which method returns expected value. - * - * @param mixed $argument - * - * @return bool|int - */ - public function scoreArgument($argument) - { - if (is_object($argument) && method_exists($argument, $this->name)) { - $actual = call_user_func(array($argument, $this->name)); - - $comparator = $this->comparatorFactory->getComparatorFor( - $this->value, $actual - ); - - try { - $comparator->assertEquals($this->value, $actual); - return 8; - } catch (ComparisonFailure $failure) { - return false; - } - } - - if (is_object($argument) && property_exists($argument, $this->name)) { - return $argument->{$this->name} === $this->value ? 8 : false; - } - - return false; - } - - /** - * Returns false. - * - * @return bool - */ - public function isLast() - { - return false; - } - - /** - * Returns string representation for token. - * - * @return string - */ - public function __toString() - { - return sprintf('state(%s(), %s)', - $this->name, - $this->util->stringify($this->value) - ); - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/StringContainsToken.php b/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/StringContainsToken.php deleted file mode 100644 index bd8d423..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/StringContainsToken.php +++ /dev/null @@ -1,67 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Argument\Token; - -/** - * String contains token. - * - * @author Peter Mitchell - */ -class StringContainsToken implements TokenInterface -{ - private $value; - - /** - * Initializes token. - * - * @param string $value - */ - public function __construct($value) - { - $this->value = $value; - } - - public function scoreArgument($argument) - { - return is_string($argument) && strpos($argument, $this->value) !== false ? 6 : false; - } - - /** - * Returns preset value against which token checks arguments. - * - * @return mixed - */ - public function getValue() - { - return $this->value; - } - - /** - * Returns false. - * - * @return bool - */ - public function isLast() - { - return false; - } - - /** - * Returns string representation for token. - * - * @return string - */ - public function __toString() - { - return sprintf('contains("%s")', $this->value); - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/TokenInterface.php b/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/TokenInterface.php deleted file mode 100644 index 625d3ba..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/TokenInterface.php +++ /dev/null @@ -1,43 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Argument\Token; - -/** - * Argument token interface. - * - * @author Konstantin Kudryashov - */ -interface TokenInterface -{ - /** - * Calculates token match score for provided argument. - * - * @param $argument - * - * @return bool|int - */ - public function scoreArgument($argument); - - /** - * Returns true if this token prevents check of other tokens (is last one). - * - * @return bool|int - */ - public function isLast(); - - /** - * Returns string representation for token. - * - * @return string - */ - public function __toString(); -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/TypeToken.php b/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/TypeToken.php deleted file mode 100644 index cb65132..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/TypeToken.php +++ /dev/null @@ -1,76 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Argument\Token; - -use Prophecy\Exception\InvalidArgumentException; - -/** - * Value type token. - * - * @author Konstantin Kudryashov - */ -class TypeToken implements TokenInterface -{ - private $type; - - /** - * @param string $type - */ - public function __construct($type) - { - $checker = "is_{$type}"; - if (!function_exists($checker) && !interface_exists($type) && !class_exists($type)) { - throw new InvalidArgumentException(sprintf( - 'Type or class name expected as an argument to TypeToken, but got %s.', $type - )); - } - - $this->type = $type; - } - - /** - * Scores 5 if argument has the same type this token was constructed with. - * - * @param $argument - * - * @return bool|int - */ - public function scoreArgument($argument) - { - $checker = "is_{$this->type}"; - if (function_exists($checker)) { - return call_user_func($checker, $argument) ? 5 : false; - } - - return $argument instanceof $this->type ? 5 : false; - } - - /** - * Returns false. - * - * @return bool - */ - public function isLast() - { - return false; - } - - /** - * Returns string representation for token. - * - * @return string - */ - public function __toString() - { - return sprintf('type(%s)', $this->type); - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Call/Call.php b/vendor/phpspec/prophecy/src/Prophecy/Call/Call.php deleted file mode 100644 index 2652235..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Call/Call.php +++ /dev/null @@ -1,162 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Call; - -use Exception; -use Prophecy\Argument\ArgumentsWildcard; - -/** - * Call object. - * - * @author Konstantin Kudryashov - */ -class Call -{ - private $methodName; - private $arguments; - private $returnValue; - private $exception; - private $file; - private $line; - private $scores; - - /** - * Initializes call. - * - * @param string $methodName - * @param array $arguments - * @param mixed $returnValue - * @param Exception $exception - * @param null|string $file - * @param null|int $line - */ - public function __construct($methodName, array $arguments, $returnValue, - Exception $exception = null, $file, $line) - { - $this->methodName = $methodName; - $this->arguments = $arguments; - $this->returnValue = $returnValue; - $this->exception = $exception; - $this->scores = new \SplObjectStorage(); - - if ($file) { - $this->file = $file; - $this->line = intval($line); - } - } - - /** - * Returns called method name. - * - * @return string - */ - public function getMethodName() - { - return $this->methodName; - } - - /** - * Returns called method arguments. - * - * @return array - */ - public function getArguments() - { - return $this->arguments; - } - - /** - * Returns called method return value. - * - * @return null|mixed - */ - public function getReturnValue() - { - return $this->returnValue; - } - - /** - * Returns exception that call thrown. - * - * @return null|Exception - */ - public function getException() - { - return $this->exception; - } - - /** - * Returns callee filename. - * - * @return string - */ - public function getFile() - { - return $this->file; - } - - /** - * Returns callee line number. - * - * @return int - */ - public function getLine() - { - return $this->line; - } - - /** - * Returns short notation for callee place. - * - * @return string - */ - public function getCallPlace() - { - if (null === $this->file) { - return 'unknown'; - } - - return sprintf('%s:%d', $this->file, $this->line); - } - - /** - * Adds the wildcard match score for the provided wildcard. - * - * @param ArgumentsWildcard $wildcard - * @param false|int $score - * - * @return $this - */ - public function addScore(ArgumentsWildcard $wildcard, $score) - { - $this->scores[$wildcard] = $score; - - return $this; - } - - /** - * Returns wildcard match score for the provided wildcard. The score is - * calculated if not already done. - * - * @param ArgumentsWildcard $wildcard - * - * @return false|int False OR integer score (higher - better) - */ - public function getScore(ArgumentsWildcard $wildcard) - { - if (isset($this->scores[$wildcard])) { - return $this->scores[$wildcard]; - } - - return $this->scores[$wildcard] = $wildcard->scoreArguments($this->getArguments()); - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Call/CallCenter.php b/vendor/phpspec/prophecy/src/Prophecy/Call/CallCenter.php deleted file mode 100644 index debc9a7..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Call/CallCenter.php +++ /dev/null @@ -1,240 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Call; - -use Prophecy\Exception\Prophecy\MethodProphecyException; -use Prophecy\Prophecy\ObjectProphecy; -use Prophecy\Argument\ArgumentsWildcard; -use Prophecy\Util\StringUtil; -use Prophecy\Exception\Call\UnexpectedCallException; -use SplObjectStorage; - -/** - * Calls receiver & manager. - * - * @author Konstantin Kudryashov - */ -class CallCenter -{ - private $util; - - /** - * @var Call[] - */ - private $recordedCalls = array(); - - /** - * @var SplObjectStorage - */ - private $unexpectedCalls; - - /** - * Initializes call center. - * - * @param StringUtil $util - */ - public function __construct(StringUtil $util = null) - { - $this->util = $util ?: new StringUtil; - $this->unexpectedCalls = new SplObjectStorage(); - } - - /** - * Makes and records specific method call for object prophecy. - * - * @param ObjectProphecy $prophecy - * @param string $methodName - * @param array $arguments - * - * @return mixed Returns null if no promise for prophecy found or promise return value. - * - * @throws \Prophecy\Exception\Call\UnexpectedCallException If no appropriate method prophecy found - */ - public function makeCall(ObjectProphecy $prophecy, $methodName, array $arguments) - { - // For efficiency exclude 'args' from the generated backtrace - // Limit backtrace to last 3 calls as we don't use the rest - $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3); - - $file = $line = null; - if (isset($backtrace[2]) && isset($backtrace[2]['file'])) { - $file = $backtrace[2]['file']; - $line = $backtrace[2]['line']; - } - - // If no method prophecies defined, then it's a dummy, so we'll just return null - if ('__destruct' === strtolower($methodName) || 0 == count($prophecy->getMethodProphecies())) { - $this->recordedCalls[] = new Call($methodName, $arguments, null, null, $file, $line); - - return null; - } - - // There are method prophecies, so it's a fake/stub. Searching prophecy for this call - $matches = $this->findMethodProphecies($prophecy, $methodName, $arguments); - - // If fake/stub doesn't have method prophecy for this call - throw exception - if (!count($matches)) { - $this->unexpectedCalls->attach(new Call($methodName, $arguments, null, null, $file, $line), $prophecy); - $this->recordedCalls[] = new Call($methodName, $arguments, null, null, $file, $line); - - return null; - } - - // Sort matches by their score value - @usort($matches, function ($match1, $match2) { return $match2[0] - $match1[0]; }); - - $score = $matches[0][0]; - // If Highest rated method prophecy has a promise - execute it or return null instead - $methodProphecy = $matches[0][1]; - $returnValue = null; - $exception = null; - if ($promise = $methodProphecy->getPromise()) { - try { - $returnValue = $promise->execute($arguments, $prophecy, $methodProphecy); - } catch (\Exception $e) { - $exception = $e; - } - } - - if ($methodProphecy->hasReturnVoid() && $returnValue !== null) { - throw new MethodProphecyException( - "The method \"$methodName\" has a void return type, but the promise returned a value", - $methodProphecy - ); - } - - $this->recordedCalls[] = $call = new Call( - $methodName, $arguments, $returnValue, $exception, $file, $line - ); - $call->addScore($methodProphecy->getArgumentsWildcard(), $score); - - if (null !== $exception) { - throw $exception; - } - - return $returnValue; - } - - /** - * Searches for calls by method name & arguments wildcard. - * - * @param string $methodName - * @param ArgumentsWildcard $wildcard - * - * @return Call[] - */ - public function findCalls($methodName, ArgumentsWildcard $wildcard) - { - $methodName = strtolower($methodName); - - return array_values( - array_filter($this->recordedCalls, function (Call $call) use ($methodName, $wildcard) { - return $methodName === strtolower($call->getMethodName()) - && 0 < $call->getScore($wildcard) - ; - }) - ); - } - - /** - * @throws UnexpectedCallException - */ - public function checkUnexpectedCalls() - { - /** @var Call $call */ - foreach ($this->unexpectedCalls as $call) { - $prophecy = $this->unexpectedCalls[$call]; - - // If fake/stub doesn't have method prophecy for this call - throw exception - if (!count($this->findMethodProphecies($prophecy, $call->getMethodName(), $call->getArguments()))) { - throw $this->createUnexpectedCallException($prophecy, $call->getMethodName(), $call->getArguments()); - } - } - } - - private function createUnexpectedCallException(ObjectProphecy $prophecy, $methodName, - array $arguments) - { - $classname = get_class($prophecy->reveal()); - $indentationLength = 8; // looks good - $argstring = implode( - ",\n", - $this->indentArguments( - array_map(array($this->util, 'stringify'), $arguments), - $indentationLength - ) - ); - - $expected = array(); - - foreach (call_user_func_array('array_merge', $prophecy->getMethodProphecies()) as $methodProphecy) { - $expected[] = sprintf( - " - %s(\n" . - "%s\n" . - " )", - $methodProphecy->getMethodName(), - implode( - ",\n", - $this->indentArguments( - array_map('strval', $methodProphecy->getArgumentsWildcard()->getTokens()), - $indentationLength - ) - ) - ); - } - - return new UnexpectedCallException( - sprintf( - "Unexpected method call on %s:\n". - " - %s(\n". - "%s\n". - " )\n". - "expected calls were:\n". - "%s", - - $classname, $methodName, $argstring, implode("\n", $expected) - ), - $prophecy, $methodName, $arguments - - ); - } - - private function indentArguments(array $arguments, $indentationLength) - { - return preg_replace_callback( - '/^/m', - function () use ($indentationLength) { - return str_repeat(' ', $indentationLength); - }, - $arguments - ); - } - - /** - * @param ObjectProphecy $prophecy - * @param string $methodName - * @param array $arguments - * - * @return array - */ - private function findMethodProphecies(ObjectProphecy $prophecy, $methodName, array $arguments) - { - $matches = array(); - foreach ($prophecy->getMethodProphecies($methodName) as $methodProphecy) { - if (0 < $score = $methodProphecy->getArgumentsWildcard()->scoreArguments($arguments)) { - $matches[] = array($score, $methodProphecy); - } - } - - return $matches; - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Comparator/ClosureComparator.php b/vendor/phpspec/prophecy/src/Prophecy/Comparator/ClosureComparator.php deleted file mode 100644 index fa4f578..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Comparator/ClosureComparator.php +++ /dev/null @@ -1,44 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Comparator; - -use SebastianBergmann\Comparator\Comparator; -use SebastianBergmann\Comparator\ComparisonFailure; - -/** - * Closure comparator. - * - * @author Konstantin Kudryashov - */ -final class ClosureComparator extends Comparator -{ - public function accepts($expected, $actual) - { - return is_object($expected) && $expected instanceof \Closure - && is_object($actual) && $actual instanceof \Closure; - } - - public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false, array &$processed = array()) - { - if ($expected !== $actual) { - throw new ComparisonFailure( - $expected, - $actual, - // we don't need a diff - '', - '', - false, - 'all closures are different if not identical' - ); - } - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Comparator/Factory.php b/vendor/phpspec/prophecy/src/Prophecy/Comparator/Factory.php deleted file mode 100644 index 2070db1..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Comparator/Factory.php +++ /dev/null @@ -1,47 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Comparator; - -use SebastianBergmann\Comparator\Factory as BaseFactory; - -/** - * Prophecy comparator factory. - * - * @author Konstantin Kudryashov - */ -final class Factory extends BaseFactory -{ - /** - * @var Factory - */ - private static $instance; - - public function __construct() - { - parent::__construct(); - - $this->register(new ClosureComparator()); - $this->register(new ProphecyComparator()); - } - - /** - * @return Factory - */ - public static function getInstance() - { - if (self::$instance === null) { - self::$instance = new Factory; - } - - return self::$instance; - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Comparator/ProphecyComparator.php b/vendor/phpspec/prophecy/src/Prophecy/Comparator/ProphecyComparator.php deleted file mode 100644 index 298a8e3..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Comparator/ProphecyComparator.php +++ /dev/null @@ -1,28 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Comparator; - -use Prophecy\Prophecy\ProphecyInterface; -use SebastianBergmann\Comparator\ObjectComparator; - -class ProphecyComparator extends ObjectComparator -{ - public function accepts($expected, $actual) - { - return is_object($expected) && is_object($actual) && $actual instanceof ProphecyInterface; - } - - public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false, array &$processed = array()) - { - parent::assertEquals($expected, $actual->reveal(), $delta, $canonicalize, $ignoreCase, $processed); - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Doubler/CachedDoubler.php b/vendor/phpspec/prophecy/src/Prophecy/Doubler/CachedDoubler.php deleted file mode 100644 index 2b87521..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Doubler/CachedDoubler.php +++ /dev/null @@ -1,66 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Doubler; - -use ReflectionClass; - -/** - * Cached class doubler. - * Prevents mirroring/creation of the same structure twice. - * - * @author Konstantin Kudryashov - */ -class CachedDoubler extends Doubler -{ - private static $classes = array(); - - /** - * {@inheritdoc} - */ - protected function createDoubleClass(ReflectionClass $class = null, array $interfaces) - { - $classId = $this->generateClassId($class, $interfaces); - if (isset(self::$classes[$classId])) { - return self::$classes[$classId]; - } - - return self::$classes[$classId] = parent::createDoubleClass($class, $interfaces); - } - - /** - * @param ReflectionClass $class - * @param ReflectionClass[] $interfaces - * - * @return string - */ - private function generateClassId(ReflectionClass $class = null, array $interfaces) - { - $parts = array(); - if (null !== $class) { - $parts[] = $class->getName(); - } - foreach ($interfaces as $interface) { - $parts[] = $interface->getName(); - } - foreach ($this->getClassPatches() as $patch) { - $parts[] = get_class($patch); - } - sort($parts); - - return md5(implode('', $parts)); - } - - public function resetCache() - { - self::$classes = array(); - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/ClassPatchInterface.php b/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/ClassPatchInterface.php deleted file mode 100644 index d6d1968..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/ClassPatchInterface.php +++ /dev/null @@ -1,48 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Doubler\ClassPatch; - -use Prophecy\Doubler\Generator\Node\ClassNode; - -/** - * Class patch interface. - * Class patches extend doubles functionality or help - * Prophecy to avoid some internal PHP bugs. - * - * @author Konstantin Kudryashov - */ -interface ClassPatchInterface -{ - /** - * Checks if patch supports specific class node. - * - * @param ClassNode $node - * - * @return bool - */ - public function supports(ClassNode $node); - - /** - * Applies patch to the specific class node. - * - * @param ClassNode $node - * @return void - */ - public function apply(ClassNode $node); - - /** - * Returns patch priority, which determines when patch will be applied. - * - * @return int Priority number (higher - earlier) - */ - public function getPriority(); -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/DisableConstructorPatch.php b/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/DisableConstructorPatch.php deleted file mode 100644 index 9d84309..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/DisableConstructorPatch.php +++ /dev/null @@ -1,76 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Doubler\ClassPatch; - -use Prophecy\Doubler\Generator\Node\ClassNode; -use Prophecy\Doubler\Generator\Node\MethodNode; - -/** - * Disable constructor. - * Makes all constructor arguments optional. - * - * @author Konstantin Kudryashov - */ -class DisableConstructorPatch implements ClassPatchInterface -{ - /** - * Checks if class has `__construct` method. - * - * @param ClassNode $node - * - * @return bool - */ - public function supports(ClassNode $node) - { - return true; - } - - /** - * Makes all class constructor arguments optional. - * - * @param ClassNode $node - */ - public function apply(ClassNode $node) - { - if (!$node->isExtendable('__construct')) { - return; - } - - if (!$node->hasMethod('__construct')) { - $node->addMethod(new MethodNode('__construct', '')); - - return; - } - - $constructor = $node->getMethod('__construct'); - foreach ($constructor->getArguments() as $argument) { - $argument->setDefault(null); - } - - $constructor->setCode(<< - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Doubler\ClassPatch; - -use Prophecy\Doubler\Generator\Node\ClassNode; - -/** - * Exception patch for HHVM to remove the stubs from special methods - * - * @author Christophe Coevoet - */ -class HhvmExceptionPatch implements ClassPatchInterface -{ - /** - * Supports exceptions on HHVM. - * - * @param ClassNode $node - * - * @return bool - */ - public function supports(ClassNode $node) - { - if (!defined('HHVM_VERSION')) { - return false; - } - - return 'Exception' === $node->getParentClass() || is_subclass_of($node->getParentClass(), 'Exception'); - } - - /** - * Removes special exception static methods from the doubled methods. - * - * @param ClassNode $node - * - * @return void - */ - public function apply(ClassNode $node) - { - if ($node->hasMethod('setTraceOptions')) { - $node->getMethod('setTraceOptions')->useParentCode(); - } - if ($node->hasMethod('getTraceOptions')) { - $node->getMethod('getTraceOptions')->useParentCode(); - } - } - - /** - * {@inheritdoc} - */ - public function getPriority() - { - return -50; - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/KeywordPatch.php b/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/KeywordPatch.php deleted file mode 100644 index ab99f74..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/KeywordPatch.php +++ /dev/null @@ -1,68 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Doubler\ClassPatch; - -use Prophecy\Doubler\Generator\Node\ClassNode; - -/** - * Remove method functionality from the double which will clash with php keywords. - * - * @author Milan Magudia - */ -class KeywordPatch implements ClassPatchInterface -{ - /** - * Support any class - * - * @param ClassNode $node - * - * @return boolean - */ - public function supports(ClassNode $node) - { - return true; - } - - /** - * Remove methods that clash with php keywords - * - * @param ClassNode $node - */ - public function apply(ClassNode $node) - { - $methodNames = array_keys($node->getMethods()); - $methodsToRemove = array_intersect($methodNames, $this->getKeywords()); - foreach ($methodsToRemove as $methodName) { - $node->removeMethod($methodName); - } - } - - /** - * Returns patch priority, which determines when patch will be applied. - * - * @return int Priority number (higher - earlier) - */ - public function getPriority() - { - return 49; - } - - /** - * Returns array of php keywords. - * - * @return array - */ - private function getKeywords() - { - return ['__halt_compiler']; - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/MagicCallPatch.php b/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/MagicCallPatch.php deleted file mode 100644 index 9ff49cd..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/MagicCallPatch.php +++ /dev/null @@ -1,94 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Doubler\ClassPatch; - -use Prophecy\Doubler\Generator\Node\ClassNode; -use Prophecy\Doubler\Generator\Node\MethodNode; -use Prophecy\PhpDocumentor\ClassAndInterfaceTagRetriever; -use Prophecy\PhpDocumentor\MethodTagRetrieverInterface; - -/** - * Discover Magical API using "@method" PHPDoc format. - * - * @author Thomas Tourlourat - * @author Kévin Dunglas - * @author Théo FIDRY - */ -class MagicCallPatch implements ClassPatchInterface -{ - private $tagRetriever; - - public function __construct(MethodTagRetrieverInterface $tagRetriever = null) - { - $this->tagRetriever = null === $tagRetriever ? new ClassAndInterfaceTagRetriever() : $tagRetriever; - } - - /** - * Support any class - * - * @param ClassNode $node - * - * @return boolean - */ - public function supports(ClassNode $node) - { - return true; - } - - /** - * Discover Magical API - * - * @param ClassNode $node - */ - public function apply(ClassNode $node) - { - $types = array_filter($node->getInterfaces(), function ($interface) { - return 0 !== strpos($interface, 'Prophecy\\'); - }); - $types[] = $node->getParentClass(); - - foreach ($types as $type) { - $reflectionClass = new \ReflectionClass($type); - - while ($reflectionClass) { - $tagList = $this->tagRetriever->getTagList($reflectionClass); - - foreach ($tagList as $tag) { - $methodName = $tag->getMethodName(); - - if (empty($methodName)) { - continue; - } - - if (!$reflectionClass->hasMethod($methodName)) { - $methodNode = new MethodNode($methodName); - $methodNode->setStatic($tag->isStatic()); - $node->addMethod($methodNode); - } - } - - $reflectionClass = $reflectionClass->getParentClass(); - } - } - } - - /** - * Returns patch priority, which determines when patch will be applied. - * - * @return integer Priority number (higher - earlier) - */ - public function getPriority() - { - return 50; - } -} - diff --git a/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/ProphecySubjectPatch.php b/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/ProphecySubjectPatch.php deleted file mode 100644 index bf5eb5c..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/ProphecySubjectPatch.php +++ /dev/null @@ -1,111 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Doubler\ClassPatch; - -use Prophecy\Doubler\Generator\Node\ClassNode; -use Prophecy\Doubler\Generator\Node\MethodNode; -use Prophecy\Doubler\Generator\Node\ArgumentNode; - -/** - * Add Prophecy functionality to the double. - * This is a core class patch for Prophecy. - * - * @author Konstantin Kudryashov - */ -class ProphecySubjectPatch implements ClassPatchInterface -{ - /** - * Always returns true. - * - * @param ClassNode $node - * - * @return bool - */ - public function supports(ClassNode $node) - { - return true; - } - - /** - * Apply Prophecy functionality to class node. - * - * @param ClassNode $node - */ - public function apply(ClassNode $node) - { - $node->addInterface('Prophecy\Prophecy\ProphecySubjectInterface'); - $node->addProperty('objectProphecyClosure', 'private'); - - foreach ($node->getMethods() as $name => $method) { - if ('__construct' === strtolower($name)) { - continue; - } - - if ($method->getReturnType() === 'void') { - $method->setCode( - '$this->getProphecy()->makeProphecyMethodCall(__FUNCTION__, func_get_args());' - ); - } else { - $method->setCode( - 'return $this->getProphecy()->makeProphecyMethodCall(__FUNCTION__, func_get_args());' - ); - } - } - - $prophecySetter = new MethodNode('setProphecy'); - $prophecyArgument = new ArgumentNode('prophecy'); - $prophecyArgument->setTypeHint('Prophecy\Prophecy\ProphecyInterface'); - $prophecySetter->addArgument($prophecyArgument); - $prophecySetter->setCode(<<objectProphecyClosure) { - \$this->objectProphecyClosure = static function () use (\$prophecy) { - return \$prophecy; - }; -} -PHP - ); - - $prophecyGetter = new MethodNode('getProphecy'); - $prophecyGetter->setCode('return \call_user_func($this->objectProphecyClosure);'); - - if ($node->hasMethod('__call')) { - $__call = $node->getMethod('__call'); - } else { - $__call = new MethodNode('__call'); - $__call->addArgument(new ArgumentNode('name')); - $__call->addArgument(new ArgumentNode('arguments')); - - $node->addMethod($__call, true); - } - - $__call->setCode(<<getProphecy(), func_get_arg(0) -); -PHP - ); - - $node->addMethod($prophecySetter, true); - $node->addMethod($prophecyGetter, true); - } - - /** - * Returns patch priority, which determines when patch will be applied. - * - * @return int Priority number (higher - earlier) - */ - public function getPriority() - { - return 0; - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/ReflectionClassNewInstancePatch.php b/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/ReflectionClassNewInstancePatch.php deleted file mode 100644 index 9166aee..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/ReflectionClassNewInstancePatch.php +++ /dev/null @@ -1,57 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Doubler\ClassPatch; - -use Prophecy\Doubler\Generator\Node\ClassNode; - -/** - * ReflectionClass::newInstance patch. - * Makes first argument of newInstance optional, since it works but signature is misleading - * - * @author Florian Klein - */ -class ReflectionClassNewInstancePatch implements ClassPatchInterface -{ - /** - * Supports ReflectionClass - * - * @param ClassNode $node - * - * @return bool - */ - public function supports(ClassNode $node) - { - return 'ReflectionClass' === $node->getParentClass(); - } - - /** - * Updates newInstance's first argument to make it optional - * - * @param ClassNode $node - */ - public function apply(ClassNode $node) - { - foreach ($node->getMethod('newInstance')->getArguments() as $argument) { - $argument->setDefault(null); - } - } - - /** - * Returns patch priority, which determines when patch will be applied. - * - * @return int Priority number (higher = earlier) - */ - public function getPriority() - { - return 50; - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/SplFileInfoPatch.php b/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/SplFileInfoPatch.php deleted file mode 100644 index ceee94a..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/SplFileInfoPatch.php +++ /dev/null @@ -1,123 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Doubler\ClassPatch; - -use Prophecy\Doubler\Generator\Node\ClassNode; -use Prophecy\Doubler\Generator\Node\MethodNode; - -/** - * SplFileInfo patch. - * Makes SplFileInfo and derivative classes usable with Prophecy. - * - * @author Konstantin Kudryashov - */ -class SplFileInfoPatch implements ClassPatchInterface -{ - /** - * Supports everything that extends SplFileInfo. - * - * @param ClassNode $node - * - * @return bool - */ - public function supports(ClassNode $node) - { - if (null === $node->getParentClass()) { - return false; - } - return 'SplFileInfo' === $node->getParentClass() - || is_subclass_of($node->getParentClass(), 'SplFileInfo') - ; - } - - /** - * Updated constructor code to call parent one with dummy file argument. - * - * @param ClassNode $node - */ - public function apply(ClassNode $node) - { - if ($node->hasMethod('__construct')) { - $constructor = $node->getMethod('__construct'); - } else { - $constructor = new MethodNode('__construct'); - $node->addMethod($constructor); - } - - if ($this->nodeIsDirectoryIterator($node)) { - $constructor->setCode('return parent::__construct("' . __DIR__ . '");'); - - return; - } - - if ($this->nodeIsSplFileObject($node)) { - $filePath = str_replace('\\','\\\\',__FILE__); - $constructor->setCode('return parent::__construct("' . $filePath .'");'); - - return; - } - - if ($this->nodeIsSymfonySplFileInfo($node)) { - $filePath = str_replace('\\','\\\\',__FILE__); - $constructor->setCode('return parent::__construct("' . $filePath .'", "", "");'); - - return; - } - - $constructor->useParentCode(); - } - - /** - * Returns patch priority, which determines when patch will be applied. - * - * @return int Priority number (higher - earlier) - */ - public function getPriority() - { - return 50; - } - - /** - * @param ClassNode $node - * @return boolean - */ - private function nodeIsDirectoryIterator(ClassNode $node) - { - $parent = $node->getParentClass(); - - return 'DirectoryIterator' === $parent - || is_subclass_of($parent, 'DirectoryIterator'); - } - - /** - * @param ClassNode $node - * @return boolean - */ - private function nodeIsSplFileObject(ClassNode $node) - { - $parent = $node->getParentClass(); - - return 'SplFileObject' === $parent - || is_subclass_of($parent, 'SplFileObject'); - } - - /** - * @param ClassNode $node - * @return boolean - */ - private function nodeIsSymfonySplFileInfo(ClassNode $node) - { - $parent = $node->getParentClass(); - - return 'Symfony\\Component\\Finder\\SplFileInfo' === $parent; - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/ThrowablePatch.php b/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/ThrowablePatch.php deleted file mode 100644 index b98e943..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/ThrowablePatch.php +++ /dev/null @@ -1,95 +0,0 @@ -implementsAThrowableInterface($node) && $this->doesNotExtendAThrowableClass($node); - } - - /** - * @param ClassNode $node - * @return bool - */ - private function implementsAThrowableInterface(ClassNode $node) - { - foreach ($node->getInterfaces() as $type) { - if (is_a($type, 'Throwable', true)) { - return true; - } - } - - return false; - } - - /** - * @param ClassNode $node - * @return bool - */ - private function doesNotExtendAThrowableClass(ClassNode $node) - { - return !is_a($node->getParentClass(), 'Throwable', true); - } - - /** - * Applies patch to the specific class node. - * - * @param ClassNode $node - * - * @return void - */ - public function apply(ClassNode $node) - { - $this->checkItCanBeDoubled($node); - $this->setParentClassToException($node); - } - - private function checkItCanBeDoubled(ClassNode $node) - { - $className = $node->getParentClass(); - if ($className !== 'stdClass') { - throw new ClassCreatorException( - sprintf( - 'Cannot double concrete class %s as well as implement Traversable', - $className - ), - $node - ); - } - } - - private function setParentClassToException(ClassNode $node) - { - $node->setParentClass('Exception'); - - $node->removeMethod('getMessage'); - $node->removeMethod('getCode'); - $node->removeMethod('getFile'); - $node->removeMethod('getLine'); - $node->removeMethod('getTrace'); - $node->removeMethod('getPrevious'); - $node->removeMethod('getNext'); - $node->removeMethod('getTraceAsString'); - } - - /** - * Returns patch priority, which determines when patch will be applied. - * - * @return int Priority number (higher - earlier) - */ - public function getPriority() - { - return 100; - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/TraversablePatch.php b/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/TraversablePatch.php deleted file mode 100644 index eea0202..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/TraversablePatch.php +++ /dev/null @@ -1,83 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Doubler\ClassPatch; - -use Prophecy\Doubler\Generator\Node\ClassNode; -use Prophecy\Doubler\Generator\Node\MethodNode; - -/** - * Traversable interface patch. - * Forces classes that implement interfaces, that extend Traversable to also implement Iterator. - * - * @author Konstantin Kudryashov - */ -class TraversablePatch implements ClassPatchInterface -{ - /** - * Supports nodetree, that implement Traversable, but not Iterator or IteratorAggregate. - * - * @param ClassNode $node - * - * @return bool - */ - public function supports(ClassNode $node) - { - if (in_array('Iterator', $node->getInterfaces())) { - return false; - } - if (in_array('IteratorAggregate', $node->getInterfaces())) { - return false; - } - - foreach ($node->getInterfaces() as $interface) { - if ('Traversable' !== $interface && !is_subclass_of($interface, 'Traversable')) { - continue; - } - if ('Iterator' === $interface || is_subclass_of($interface, 'Iterator')) { - continue; - } - if ('IteratorAggregate' === $interface || is_subclass_of($interface, 'IteratorAggregate')) { - continue; - } - - return true; - } - - return false; - } - - /** - * Forces class to implement Iterator interface. - * - * @param ClassNode $node - */ - public function apply(ClassNode $node) - { - $node->addInterface('Iterator'); - - $node->addMethod(new MethodNode('current')); - $node->addMethod(new MethodNode('key')); - $node->addMethod(new MethodNode('next')); - $node->addMethod(new MethodNode('rewind')); - $node->addMethod(new MethodNode('valid')); - } - - /** - * Returns patch priority, which determines when patch will be applied. - * - * @return int Priority number (higher - earlier) - */ - public function getPriority() - { - return 100; - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Doubler/DoubleInterface.php b/vendor/phpspec/prophecy/src/Prophecy/Doubler/DoubleInterface.php deleted file mode 100644 index 699be3a..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Doubler/DoubleInterface.php +++ /dev/null @@ -1,22 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Doubler; - -/** - * Core double interface. - * All doubled classes will implement this one. - * - * @author Konstantin Kudryashov - */ -interface DoubleInterface -{ -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Doubler/Doubler.php b/vendor/phpspec/prophecy/src/Prophecy/Doubler/Doubler.php deleted file mode 100644 index a378ae2..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Doubler/Doubler.php +++ /dev/null @@ -1,146 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Doubler; - -use Doctrine\Instantiator\Instantiator; -use Prophecy\Doubler\ClassPatch\ClassPatchInterface; -use Prophecy\Doubler\Generator\ClassMirror; -use Prophecy\Doubler\Generator\ClassCreator; -use Prophecy\Exception\InvalidArgumentException; -use ReflectionClass; - -/** - * Cached class doubler. - * Prevents mirroring/creation of the same structure twice. - * - * @author Konstantin Kudryashov - */ -class Doubler -{ - private $mirror; - private $creator; - private $namer; - - /** - * @var ClassPatchInterface[] - */ - private $patches = array(); - - /** - * @var \Doctrine\Instantiator\Instantiator - */ - private $instantiator; - - /** - * Initializes doubler. - * - * @param ClassMirror $mirror - * @param ClassCreator $creator - * @param NameGenerator $namer - */ - public function __construct(ClassMirror $mirror = null, ClassCreator $creator = null, - NameGenerator $namer = null) - { - $this->mirror = $mirror ?: new ClassMirror; - $this->creator = $creator ?: new ClassCreator; - $this->namer = $namer ?: new NameGenerator; - } - - /** - * Returns list of registered class patches. - * - * @return ClassPatchInterface[] - */ - public function getClassPatches() - { - return $this->patches; - } - - /** - * Registers new class patch. - * - * @param ClassPatchInterface $patch - */ - public function registerClassPatch(ClassPatchInterface $patch) - { - $this->patches[] = $patch; - - @usort($this->patches, function (ClassPatchInterface $patch1, ClassPatchInterface $patch2) { - return $patch2->getPriority() - $patch1->getPriority(); - }); - } - - /** - * Creates double from specific class or/and list of interfaces. - * - * @param ReflectionClass $class - * @param ReflectionClass[] $interfaces Array of ReflectionClass instances - * @param array $args Constructor arguments - * - * @return DoubleInterface - * - * @throws \Prophecy\Exception\InvalidArgumentException - */ - public function double(ReflectionClass $class = null, array $interfaces, array $args = null) - { - foreach ($interfaces as $interface) { - if (!$interface instanceof ReflectionClass) { - throw new InvalidArgumentException(sprintf( - "[ReflectionClass \$interface1 [, ReflectionClass \$interface2]] array expected as\n". - "a second argument to `Doubler::double(...)`, but got %s.", - is_object($interface) ? get_class($interface).' class' : gettype($interface) - )); - } - } - - $classname = $this->createDoubleClass($class, $interfaces); - $reflection = new ReflectionClass($classname); - - if (null !== $args) { - return $reflection->newInstanceArgs($args); - } - if ((null === $constructor = $reflection->getConstructor()) - || ($constructor->isPublic() && !$constructor->isFinal())) { - return $reflection->newInstance(); - } - - if (!$this->instantiator) { - $this->instantiator = new Instantiator(); - } - - return $this->instantiator->instantiate($classname); - } - - /** - * Creates double class and returns its FQN. - * - * @param ReflectionClass $class - * @param ReflectionClass[] $interfaces - * - * @return string - */ - protected function createDoubleClass(ReflectionClass $class = null, array $interfaces) - { - $name = $this->namer->name($class, $interfaces); - $node = $this->mirror->reflect($class, $interfaces); - - foreach ($this->patches as $patch) { - if ($patch->supports($node)) { - $patch->apply($node); - } - } - - $this->creator->create($name, $node); - - return $name; - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassCodeGenerator.php b/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassCodeGenerator.php deleted file mode 100644 index b213ee2..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassCodeGenerator.php +++ /dev/null @@ -1,117 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Doubler\Generator; - -/** - * Class code creator. - * Generates PHP code for specific class node tree. - * - * @author Konstantin Kudryashov - */ -class ClassCodeGenerator -{ - /** - * @var TypeHintReference - */ - private $typeHintReference; - - public function __construct(TypeHintReference $typeHintReference = null) - { - $this->typeHintReference = $typeHintReference ?: new TypeHintReference(); - } - - /** - * Generates PHP code for class node. - * - * @param string $classname - * @param Node\ClassNode $class - * - * @return string - */ - public function generate($classname, Node\ClassNode $class) - { - $parts = explode('\\', $classname); - $classname = array_pop($parts); - $namespace = implode('\\', $parts); - - $code = sprintf("class %s extends \%s implements %s {\n", - $classname, $class->getParentClass(), implode(', ', - array_map(function ($interface) {return '\\'.$interface;}, $class->getInterfaces()) - ) - ); - - foreach ($class->getProperties() as $name => $visibility) { - $code .= sprintf("%s \$%s;\n", $visibility, $name); - } - $code .= "\n"; - - foreach ($class->getMethods() as $method) { - $code .= $this->generateMethod($method)."\n"; - } - $code .= "\n}"; - - return sprintf("namespace %s {\n%s\n}", $namespace, $code); - } - - private function generateMethod(Node\MethodNode $method) - { - $php = sprintf("%s %s function %s%s(%s)%s {\n", - $method->getVisibility(), - $method->isStatic() ? 'static' : '', - $method->returnsReference() ? '&':'', - $method->getName(), - implode(', ', $this->generateArguments($method->getArguments())), - $this->getReturnType($method) - ); - $php .= $method->getCode()."\n"; - - return $php.'}'; - } - - /** - * @return string - */ - private function getReturnType(Node\MethodNode $method) - { - if ($method->hasReturnType()) { - return $method->hasNullableReturnType() - ? sprintf(': ?%s', $method->getReturnType()) - : sprintf(': %s', $method->getReturnType()); - } - - return ''; - } - - private function generateArguments(array $arguments) - { - $typeHintReference = $this->typeHintReference; - return array_map(function (Node\ArgumentNode $argument) use ($typeHintReference) { - $php = $argument->isNullable() ? '?' : ''; - - if ($hint = $argument->getTypeHint()) { - $php .= $typeHintReference->isBuiltInParamTypeHint($hint) ? $hint : '\\'.$hint; - } - - $php .= ' '.($argument->isPassedByReference() ? '&' : ''); - - $php .= $argument->isVariadic() ? '...' : ''; - - $php .= '$'.$argument->getName(); - - if ($argument->isOptional() && !$argument->isVariadic()) { - $php .= ' = '.var_export($argument->getDefault(), true); - } - - return $php; - }, $arguments); - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassCreator.php b/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassCreator.php deleted file mode 100644 index 882a4a4..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassCreator.php +++ /dev/null @@ -1,67 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Doubler\Generator; - -use Prophecy\Exception\Doubler\ClassCreatorException; - -/** - * Class creator. - * Creates specific class in current environment. - * - * @author Konstantin Kudryashov - */ -class ClassCreator -{ - private $generator; - - /** - * Initializes creator. - * - * @param ClassCodeGenerator $generator - */ - public function __construct(ClassCodeGenerator $generator = null) - { - $this->generator = $generator ?: new ClassCodeGenerator; - } - - /** - * Creates class. - * - * @param string $classname - * @param Node\ClassNode $class - * - * @return mixed - * - * @throws \Prophecy\Exception\Doubler\ClassCreatorException - */ - public function create($classname, Node\ClassNode $class) - { - $code = $this->generator->generate($classname, $class); - $return = eval($code); - - if (!class_exists($classname, false)) { - if (count($class->getInterfaces())) { - throw new ClassCreatorException(sprintf( - 'Could not double `%s` and implement interfaces: [%s].', - $class->getParentClass(), implode(', ', $class->getInterfaces()) - ), $class); - } - - throw new ClassCreatorException( - sprintf('Could not double `%s`.', $class->getParentClass()), - $class - ); - } - - return $return; - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassMirror.php b/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassMirror.php deleted file mode 100644 index 593b69b..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassMirror.php +++ /dev/null @@ -1,253 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Doubler\Generator; - -use Prophecy\Exception\InvalidArgumentException; -use Prophecy\Exception\Doubler\ClassMirrorException; -use ReflectionClass; -use ReflectionMethod; -use ReflectionNamedType; -use ReflectionParameter; - -/** - * Class mirror. - * Core doubler class. Mirrors specific class and/or interfaces into class node tree. - * - * @author Konstantin Kudryashov - */ -class ClassMirror -{ - private static $reflectableMethods = array( - '__construct', - '__destruct', - '__sleep', - '__wakeup', - '__toString', - '__call', - '__invoke' - ); - - /** - * Reflects provided arguments into class node. - * - * @param ReflectionClass|null $class - * @param ReflectionClass[] $interfaces - * - * @return Node\ClassNode - * - */ - public function reflect(?ReflectionClass $class, array $interfaces) - { - $node = new Node\ClassNode; - - if (null !== $class) { - if (true === $class->isInterface()) { - throw new InvalidArgumentException(sprintf( - "Could not reflect %s as a class, because it\n". - "is interface - use the second argument instead.", - $class->getName() - )); - } - - $this->reflectClassToNode($class, $node); - } - - foreach ($interfaces as $interface) { - if (!$interface instanceof ReflectionClass) { - throw new InvalidArgumentException(sprintf( - "[ReflectionClass \$interface1 [, ReflectionClass \$interface2]] array expected as\n". - "a second argument to `ClassMirror::reflect(...)`, but got %s.", - is_object($interface) ? get_class($interface).' class' : gettype($interface) - )); - } - if (false === $interface->isInterface()) { - throw new InvalidArgumentException(sprintf( - "Could not reflect %s as an interface, because it\n". - "is class - use the first argument instead.", - $interface->getName() - )); - } - - $this->reflectInterfaceToNode($interface, $node); - } - - $node->addInterface('Prophecy\Doubler\Generator\ReflectionInterface'); - - return $node; - } - - private function reflectClassToNode(ReflectionClass $class, Node\ClassNode $node) - { - if (true === $class->isFinal()) { - throw new ClassMirrorException(sprintf( - 'Could not reflect class %s as it is marked final.', $class->getName() - ), $class); - } - - $node->setParentClass($class->getName()); - - foreach ($class->getMethods(ReflectionMethod::IS_ABSTRACT) as $method) { - if (false === $method->isProtected()) { - continue; - } - - $this->reflectMethodToNode($method, $node); - } - - foreach ($class->getMethods(ReflectionMethod::IS_PUBLIC) as $method) { - if (0 === strpos($method->getName(), '_') - && !in_array($method->getName(), self::$reflectableMethods)) { - continue; - } - - if (true === $method->isFinal()) { - $node->addUnextendableMethod($method->getName()); - continue; - } - - $this->reflectMethodToNode($method, $node); - } - } - - private function reflectInterfaceToNode(ReflectionClass $interface, Node\ClassNode $node) - { - $node->addInterface($interface->getName()); - - foreach ($interface->getMethods() as $method) { - $this->reflectMethodToNode($method, $node); - } - } - - private function reflectMethodToNode(ReflectionMethod $method, Node\ClassNode $classNode) - { - $node = new Node\MethodNode($method->getName()); - - if (true === $method->isProtected()) { - $node->setVisibility('protected'); - } - - if (true === $method->isStatic()) { - $node->setStatic(); - } - - if (true === $method->returnsReference()) { - $node->setReturnsReference(); - } - - if ($method->hasReturnType()) { - $returnType = $method->getReturnType()->getName(); - $returnTypeLower = strtolower($returnType); - - if ('self' === $returnTypeLower) { - $returnType = $method->getDeclaringClass()->getName(); - } - if ('parent' === $returnTypeLower) { - $returnType = $method->getDeclaringClass()->getParentClass()->getName(); - } - - $node->setReturnType($returnType); - - if ($method->getReturnType()->allowsNull()) { - $node->setNullableReturnType(true); - } - } - - if (is_array($params = $method->getParameters()) && count($params)) { - foreach ($params as $param) { - $this->reflectArgumentToNode($param, $node); - } - } - - $classNode->addMethod($node); - } - - private function reflectArgumentToNode(ReflectionParameter $parameter, Node\MethodNode $methodNode) - { - $name = $parameter->getName() == '...' ? '__dot_dot_dot__' : $parameter->getName(); - $node = new Node\ArgumentNode($name); - - $node->setTypeHint($this->getTypeHint($parameter)); - - if ($parameter->isVariadic()) { - $node->setAsVariadic(); - } - - if ($this->hasDefaultValue($parameter)) { - $node->setDefault($this->getDefaultValue($parameter)); - } - - if ($parameter->isPassedByReference()) { - $node->setAsPassedByReference(); - } - - $node->setAsNullable($this->isNullable($parameter)); - - $methodNode->addArgument($node); - } - - private function hasDefaultValue(ReflectionParameter $parameter) - { - if ($parameter->isVariadic()) { - return false; - } - - if ($parameter->isDefaultValueAvailable()) { - return true; - } - - return $parameter->isOptional() || $this->isNullable($parameter); - } - - private function getDefaultValue(ReflectionParameter $parameter) - { - if (!$parameter->isDefaultValueAvailable()) { - return null; - } - - return $parameter->getDefaultValue(); - } - - private function getTypeHint(ReflectionParameter $parameter) - { - if (null !== $className = $this->getParameterClassName($parameter)) { - return $className; - } - - if (true === $parameter->hasType()) { - return $parameter->getType()->getName(); - } - - return null; - } - - private function isNullable(ReflectionParameter $parameter) - { - return $parameter->allowsNull() && null !== $this->getTypeHint($parameter); - } - - private function getParameterClassName(ReflectionParameter $parameter) - { - $type = $parameter->getType(); - if (!$type) { - return null; - } - if ($type instanceof ReflectionNamedType && !$type->isBuiltin()) { - if ($type->getName() === 'self') { - return $parameter->getDeclaringClass()->getName(); - } - - return $type->getName(); - } - - return null; - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/Node/ArgumentNode.php b/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/Node/ArgumentNode.php deleted file mode 100644 index 0175972..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/Node/ArgumentNode.php +++ /dev/null @@ -1,102 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Doubler\Generator\Node; - -/** - * Argument node. - * - * @author Konstantin Kudryashov - */ -class ArgumentNode -{ - private $name; - private $typeHint; - private $default; - private $optional = false; - private $byReference = false; - private $isVariadic = false; - private $isNullable = false; - - /** - * @param string $name - */ - public function __construct($name) - { - $this->name = $name; - } - - public function getName() - { - return $this->name; - } - - public function getTypeHint() - { - return $this->typeHint; - } - - public function setTypeHint($typeHint = null) - { - $this->typeHint = $typeHint; - } - - public function hasDefault() - { - return $this->isOptional() && !$this->isVariadic(); - } - - public function getDefault() - { - return $this->default; - } - - public function setDefault($default = null) - { - $this->optional = true; - $this->default = $default; - } - - public function isOptional() - { - return $this->optional; - } - - public function setAsPassedByReference($byReference = true) - { - $this->byReference = $byReference; - } - - public function isPassedByReference() - { - return $this->byReference; - } - - public function setAsVariadic($isVariadic = true) - { - $this->isVariadic = $isVariadic; - } - - public function isVariadic() - { - return $this->isVariadic; - } - - public function isNullable() - { - return $this->isNullable && $this->typeHint !== 'mixed'; - } - - public function setAsNullable($isNullable = true) - { - $this->isNullable = $isNullable; - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/Node/ClassNode.php b/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/Node/ClassNode.php deleted file mode 100644 index f7bd285..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/Node/ClassNode.php +++ /dev/null @@ -1,169 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Doubler\Generator\Node; - -use Prophecy\Exception\Doubler\MethodNotExtendableException; -use Prophecy\Exception\InvalidArgumentException; - -/** - * Class node. - * - * @author Konstantin Kudryashov - */ -class ClassNode -{ - private $parentClass = 'stdClass'; - private $interfaces = array(); - private $properties = array(); - private $unextendableMethods = array(); - - /** - * @var MethodNode[] - */ - private $methods = array(); - - public function getParentClass() - { - return $this->parentClass; - } - - /** - * @param string $class - */ - public function setParentClass($class) - { - $this->parentClass = $class ?: 'stdClass'; - } - - /** - * @return string[] - */ - public function getInterfaces() - { - return $this->interfaces; - } - - /** - * @param string $interface - */ - public function addInterface($interface) - { - if ($this->hasInterface($interface)) { - return; - } - - array_unshift($this->interfaces, $interface); - } - - /** - * @param string $interface - * - * @return bool - */ - public function hasInterface($interface) - { - return in_array($interface, $this->interfaces); - } - - public function getProperties() - { - return $this->properties; - } - - public function addProperty($name, $visibility = 'public') - { - $visibility = strtolower($visibility); - - if (!in_array($visibility, array('public', 'private', 'protected'))) { - throw new InvalidArgumentException(sprintf( - '`%s` property visibility is not supported.', $visibility - )); - } - - $this->properties[$name] = $visibility; - } - - /** - * @return MethodNode[] - */ - public function getMethods() - { - return $this->methods; - } - - public function addMethod(MethodNode $method, $force = false) - { - if (!$this->isExtendable($method->getName())){ - $message = sprintf( - 'Method `%s` is not extendable, so can not be added.', $method->getName() - ); - throw new MethodNotExtendableException($message, $this->getParentClass(), $method->getName()); - } - - if ($force || !isset($this->methods[$method->getName()])) { - $this->methods[$method->getName()] = $method; - } - } - - public function removeMethod($name) - { - unset($this->methods[$name]); - } - - /** - * @param string $name - * - * @return MethodNode|null - */ - public function getMethod($name) - { - return $this->hasMethod($name) ? $this->methods[$name] : null; - } - - /** - * @param string $name - * - * @return bool - */ - public function hasMethod($name) - { - return isset($this->methods[$name]); - } - - /** - * @return string[] - */ - public function getUnextendableMethods() - { - return $this->unextendableMethods; - } - - /** - * @param string $unextendableMethod - */ - public function addUnextendableMethod($unextendableMethod) - { - if (!$this->isExtendable($unextendableMethod)){ - return; - } - $this->unextendableMethods[] = $unextendableMethod; - } - - /** - * @param string $method - * @return bool - */ - public function isExtendable($method) - { - return !in_array($method, $this->unextendableMethods); - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/Node/MethodNode.php b/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/Node/MethodNode.php deleted file mode 100644 index c74b483..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/Node/MethodNode.php +++ /dev/null @@ -1,198 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Doubler\Generator\Node; - -use Prophecy\Doubler\Generator\TypeHintReference; -use Prophecy\Exception\InvalidArgumentException; - -/** - * Method node. - * - * @author Konstantin Kudryashov - */ -class MethodNode -{ - private $name; - private $code; - private $visibility = 'public'; - private $static = false; - private $returnsReference = false; - private $returnType; - private $nullableReturnType = false; - - /** - * @var ArgumentNode[] - */ - private $arguments = array(); - - /** - * @var TypeHintReference - */ - private $typeHintReference; - - /** - * @param string $name - * @param string $code - */ - public function __construct($name, $code = null, TypeHintReference $typeHintReference = null) - { - $this->name = $name; - $this->code = $code; - $this->typeHintReference = $typeHintReference ?: new TypeHintReference(); - } - - public function getVisibility() - { - return $this->visibility; - } - - /** - * @param string $visibility - */ - public function setVisibility($visibility) - { - $visibility = strtolower($visibility); - - if (!in_array($visibility, array('public', 'private', 'protected'))) { - throw new InvalidArgumentException(sprintf( - '`%s` method visibility is not supported.', $visibility - )); - } - - $this->visibility = $visibility; - } - - public function isStatic() - { - return $this->static; - } - - public function setStatic($static = true) - { - $this->static = (bool) $static; - } - - public function returnsReference() - { - return $this->returnsReference; - } - - public function setReturnsReference() - { - $this->returnsReference = true; - } - - public function getName() - { - return $this->name; - } - - public function addArgument(ArgumentNode $argument) - { - $this->arguments[] = $argument; - } - - /** - * @return ArgumentNode[] - */ - public function getArguments() - { - return $this->arguments; - } - - public function hasReturnType() - { - return null !== $this->returnType; - } - - /** - * @param string $type - */ - public function setReturnType($type = null) - { - if ($type === '' || $type === null) { - $this->returnType = null; - return; - } - $typeMap = array( - 'double' => 'float', - 'real' => 'float', - 'boolean' => 'bool', - 'integer' => 'int', - ); - if (isset($typeMap[$type])) { - $type = $typeMap[$type]; - } - $this->returnType = $this->typeHintReference->isBuiltInReturnTypeHint($type) ? - $type : - '\\' . ltrim($type, '\\'); - } - - public function getReturnType() - { - return $this->returnType; - } - - /** - * @param bool $bool - */ - public function setNullableReturnType($bool = true) - { - $this->nullableReturnType = (bool) $bool; - } - - /** - * @return bool - */ - public function hasNullableReturnType() - { - return $this->nullableReturnType; - } - - /** - * @param string $code - */ - public function setCode($code) - { - $this->code = $code; - } - - public function getCode() - { - if ($this->returnsReference) - { - return "throw new \Prophecy\Exception\Doubler\ReturnByReferenceException('Returning by reference not supported', get_class(\$this), '{$this->name}');"; - } - - return (string) $this->code; - } - - public function useParentCode() - { - $this->code = sprintf( - 'return parent::%s(%s);', $this->getName(), implode(', ', - array_map(array($this, 'generateArgument'), $this->arguments) - ) - ); - } - - private function generateArgument(ArgumentNode $arg) - { - $argument = '$'.$arg->getName(); - - if ($arg->isVariadic()) { - $argument = '...'.$argument; - } - - return $argument; - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ReflectionInterface.php b/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ReflectionInterface.php deleted file mode 100644 index d720b15..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ReflectionInterface.php +++ /dev/null @@ -1,22 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Doubler\Generator; - -/** - * Reflection interface. - * All reflected classes implement this interface. - * - * @author Konstantin Kudryashov - */ -interface ReflectionInterface -{ -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/TypeHintReference.php b/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/TypeHintReference.php deleted file mode 100644 index af7d41d..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/TypeHintReference.php +++ /dev/null @@ -1,41 +0,0 @@ -= 80000; - - default: - return false; - } - } - - public function isBuiltInReturnTypeHint($type) - { - if ($type === 'void') { - return true; - } - - return $this->isBuiltInParamTypeHint($type); - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Doubler/LazyDouble.php b/vendor/phpspec/prophecy/src/Prophecy/Doubler/LazyDouble.php deleted file mode 100644 index 8a99c4c..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Doubler/LazyDouble.php +++ /dev/null @@ -1,127 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Doubler; - -use Prophecy\Exception\Doubler\DoubleException; -use Prophecy\Exception\Doubler\ClassNotFoundException; -use Prophecy\Exception\Doubler\InterfaceNotFoundException; -use ReflectionClass; - -/** - * Lazy double. - * Gives simple interface to describe double before creating it. - * - * @author Konstantin Kudryashov - */ -class LazyDouble -{ - private $doubler; - private $class; - private $interfaces = array(); - private $arguments = null; - private $double; - - /** - * Initializes lazy double. - * - * @param Doubler $doubler - */ - public function __construct(Doubler $doubler) - { - $this->doubler = $doubler; - } - - /** - * Tells doubler to use specific class as parent one for double. - * - * @param string|ReflectionClass $class - * - * @throws \Prophecy\Exception\Doubler\ClassNotFoundException - * @throws \Prophecy\Exception\Doubler\DoubleException - */ - public function setParentClass($class) - { - if (null !== $this->double) { - throw new DoubleException('Can not extend class with already instantiated double.'); - } - - if (!$class instanceof ReflectionClass) { - if (!class_exists($class)) { - throw new ClassNotFoundException(sprintf('Class %s not found.', $class), $class); - } - - $class = new ReflectionClass($class); - } - - $this->class = $class; - } - - /** - * Tells doubler to implement specific interface with double. - * - * @param string|ReflectionClass $interface - * - * @throws \Prophecy\Exception\Doubler\InterfaceNotFoundException - * @throws \Prophecy\Exception\Doubler\DoubleException - */ - public function addInterface($interface) - { - if (null !== $this->double) { - throw new DoubleException( - 'Can not implement interface with already instantiated double.' - ); - } - - if (!$interface instanceof ReflectionClass) { - if (!interface_exists($interface)) { - throw new InterfaceNotFoundException( - sprintf('Interface %s not found.', $interface), - $interface - ); - } - - $interface = new ReflectionClass($interface); - } - - $this->interfaces[] = $interface; - } - - /** - * Sets constructor arguments. - * - * @param array $arguments - */ - public function setArguments(array $arguments = null) - { - $this->arguments = $arguments; - } - - /** - * Creates double instance or returns already created one. - * - * @return DoubleInterface - */ - public function getInstance() - { - if (null === $this->double) { - if (null !== $this->arguments) { - return $this->double = $this->doubler->double( - $this->class, $this->interfaces, $this->arguments - ); - } - - $this->double = $this->doubler->double($this->class, $this->interfaces); - } - - return $this->double; - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Doubler/NameGenerator.php b/vendor/phpspec/prophecy/src/Prophecy/Doubler/NameGenerator.php deleted file mode 100644 index d67ec6a..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Doubler/NameGenerator.php +++ /dev/null @@ -1,52 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Doubler; - -use ReflectionClass; - -/** - * Name generator. - * Generates classname for double. - * - * @author Konstantin Kudryashov - */ -class NameGenerator -{ - private static $counter = 1; - - /** - * Generates name. - * - * @param ReflectionClass $class - * @param ReflectionClass[] $interfaces - * - * @return string - */ - public function name(ReflectionClass $class = null, array $interfaces) - { - $parts = array(); - - if (null !== $class) { - $parts[] = $class->getName(); - } else { - foreach ($interfaces as $interface) { - $parts[] = $interface->getShortName(); - } - } - - if (!count($parts)) { - $parts[] = 'stdClass'; - } - - return sprintf('Double\%s\P%d', implode('\\', $parts), self::$counter++); - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Exception/Call/UnexpectedCallException.php b/vendor/phpspec/prophecy/src/Prophecy/Exception/Call/UnexpectedCallException.php deleted file mode 100644 index 48ed225..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Exception/Call/UnexpectedCallException.php +++ /dev/null @@ -1,40 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Exception\Call; - -use Prophecy\Exception\Prophecy\ObjectProphecyException; -use Prophecy\Prophecy\ObjectProphecy; - -class UnexpectedCallException extends ObjectProphecyException -{ - private $methodName; - private $arguments; - - public function __construct($message, ObjectProphecy $objectProphecy, - $methodName, array $arguments) - { - parent::__construct($message, $objectProphecy); - - $this->methodName = $methodName; - $this->arguments = $arguments; - } - - public function getMethodName() - { - return $this->methodName; - } - - public function getArguments() - { - return $this->arguments; - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/ClassCreatorException.php b/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/ClassCreatorException.php deleted file mode 100644 index 822918a..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/ClassCreatorException.php +++ /dev/null @@ -1,31 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Exception\Doubler; - -use Prophecy\Doubler\Generator\Node\ClassNode; - -class ClassCreatorException extends \RuntimeException implements DoublerException -{ - private $node; - - public function __construct($message, ClassNode $node) - { - parent::__construct($message); - - $this->node = $node; - } - - public function getClassNode() - { - return $this->node; - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/ClassMirrorException.php b/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/ClassMirrorException.php deleted file mode 100644 index 8fc53b8..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/ClassMirrorException.php +++ /dev/null @@ -1,31 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Exception\Doubler; - -use ReflectionClass; - -class ClassMirrorException extends \RuntimeException implements DoublerException -{ - private $class; - - public function __construct($message, ReflectionClass $class) - { - parent::__construct($message); - - $this->class = $class; - } - - public function getReflectedClass() - { - return $this->class; - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/ClassNotFoundException.php b/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/ClassNotFoundException.php deleted file mode 100644 index 5bc826d..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/ClassNotFoundException.php +++ /dev/null @@ -1,33 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Exception\Doubler; - -class ClassNotFoundException extends DoubleException -{ - private $classname; - - /** - * @param string $message - * @param string $classname - */ - public function __construct($message, $classname) - { - parent::__construct($message); - - $this->classname = $classname; - } - - public function getClassname() - { - return $this->classname; - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/DoubleException.php b/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/DoubleException.php deleted file mode 100644 index 6642a58..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/DoubleException.php +++ /dev/null @@ -1,18 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Exception\Doubler; - -use RuntimeException; - -class DoubleException extends RuntimeException implements DoublerException -{ -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/DoublerException.php b/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/DoublerException.php deleted file mode 100644 index 9d6be17..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/DoublerException.php +++ /dev/null @@ -1,18 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Exception\Doubler; - -use Prophecy\Exception\Exception; - -interface DoublerException extends Exception -{ -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/InterfaceNotFoundException.php b/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/InterfaceNotFoundException.php deleted file mode 100644 index e344dea..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/InterfaceNotFoundException.php +++ /dev/null @@ -1,20 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Exception\Doubler; - -class InterfaceNotFoundException extends ClassNotFoundException -{ - public function getInterfaceName() - { - return $this->getClassname(); - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/MethodNotExtendableException.php b/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/MethodNotExtendableException.php deleted file mode 100644 index 56f47b1..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/MethodNotExtendableException.php +++ /dev/null @@ -1,41 +0,0 @@ -methodName = $methodName; - $this->className = $className; - } - - - /** - * @return string - */ - public function getMethodName() - { - return $this->methodName; - } - - /** - * @return string - */ - public function getClassName() - { - return $this->className; - } - - } diff --git a/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/MethodNotFoundException.php b/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/MethodNotFoundException.php deleted file mode 100644 index a538349..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/MethodNotFoundException.php +++ /dev/null @@ -1,60 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Exception\Doubler; - -class MethodNotFoundException extends DoubleException -{ - /** - * @var string|object - */ - private $classname; - - /** - * @var string - */ - private $methodName; - - /** - * @var array - */ - private $arguments; - - /** - * @param string $message - * @param string|object $classname - * @param string $methodName - * @param null|Argument\ArgumentsWildcard|array $arguments - */ - public function __construct($message, $classname, $methodName, $arguments = null) - { - parent::__construct($message); - - $this->classname = $classname; - $this->methodName = $methodName; - $this->arguments = $arguments; - } - - public function getClassname() - { - return $this->classname; - } - - public function getMethodName() - { - return $this->methodName; - } - - public function getArguments() - { - return $this->arguments; - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/ReturnByReferenceException.php b/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/ReturnByReferenceException.php deleted file mode 100644 index 6303049..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/ReturnByReferenceException.php +++ /dev/null @@ -1,41 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Exception\Doubler; - -class ReturnByReferenceException extends DoubleException -{ - private $classname; - private $methodName; - - /** - * @param string $message - * @param string $classname - * @param string $methodName - */ - public function __construct($message, $classname, $methodName) - { - parent::__construct($message); - - $this->classname = $classname; - $this->methodName = $methodName; - } - - public function getClassname() - { - return $this->classname; - } - - public function getMethodName() - { - return $this->methodName; - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Exception/Exception.php b/vendor/phpspec/prophecy/src/Prophecy/Exception/Exception.php deleted file mode 100644 index ac9fe4d..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Exception/Exception.php +++ /dev/null @@ -1,26 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Exception; - -/** - * Core Prophecy exception interface. - * All Prophecy exceptions implement it. - * - * @author Konstantin Kudryashov - */ -interface Exception -{ - /** - * @return string - */ - public function getMessage(); -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Exception/InvalidArgumentException.php b/vendor/phpspec/prophecy/src/Prophecy/Exception/InvalidArgumentException.php deleted file mode 100644 index bc91c69..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,16 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Exception; - -class InvalidArgumentException extends \InvalidArgumentException implements Exception -{ -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/AggregateException.php b/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/AggregateException.php deleted file mode 100644 index a00dfb0..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/AggregateException.php +++ /dev/null @@ -1,51 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Exception\Prediction; - -use Prophecy\Prophecy\ObjectProphecy; - -class AggregateException extends \RuntimeException implements PredictionException -{ - private $exceptions = array(); - private $objectProphecy; - - public function append(PredictionException $exception) - { - $message = $exception->getMessage(); - $message = strtr($message, array("\n" => "\n "))."\n"; - $message = empty($this->exceptions) ? $message : "\n" . $message; - - $this->message = rtrim($this->message.$message); - $this->exceptions[] = $exception; - } - - /** - * @return PredictionException[] - */ - public function getExceptions() - { - return $this->exceptions; - } - - public function setObjectProphecy(ObjectProphecy $objectProphecy) - { - $this->objectProphecy = $objectProphecy; - } - - /** - * @return ObjectProphecy - */ - public function getObjectProphecy() - { - return $this->objectProphecy; - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/FailedPredictionException.php b/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/FailedPredictionException.php deleted file mode 100644 index bbbbc3d..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/FailedPredictionException.php +++ /dev/null @@ -1,24 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Exception\Prediction; - -use RuntimeException; - -/** - * Basic failed prediction exception. - * Use it for custom prediction failures. - * - * @author Konstantin Kudryashov - */ -class FailedPredictionException extends RuntimeException implements PredictionException -{ -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/NoCallsException.php b/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/NoCallsException.php deleted file mode 100644 index 05ea4aa..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/NoCallsException.php +++ /dev/null @@ -1,18 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Exception\Prediction; - -use Prophecy\Exception\Prophecy\MethodProphecyException; - -class NoCallsException extends MethodProphecyException implements PredictionException -{ -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/PredictionException.php b/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/PredictionException.php deleted file mode 100644 index 2596b1e..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/PredictionException.php +++ /dev/null @@ -1,18 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Exception\Prediction; - -use Prophecy\Exception\Exception; - -interface PredictionException extends Exception -{ -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/UnexpectedCallsCountException.php b/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/UnexpectedCallsCountException.php deleted file mode 100644 index 9d90543..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/UnexpectedCallsCountException.php +++ /dev/null @@ -1,31 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Exception\Prediction; - -use Prophecy\Prophecy\MethodProphecy; - -class UnexpectedCallsCountException extends UnexpectedCallsException -{ - private $expectedCount; - - public function __construct($message, MethodProphecy $methodProphecy, $count, array $calls) - { - parent::__construct($message, $methodProphecy, $calls); - - $this->expectedCount = intval($count); - } - - public function getExpectedCount() - { - return $this->expectedCount; - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/UnexpectedCallsException.php b/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/UnexpectedCallsException.php deleted file mode 100644 index 7a99c2d..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/UnexpectedCallsException.php +++ /dev/null @@ -1,32 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Exception\Prediction; - -use Prophecy\Prophecy\MethodProphecy; -use Prophecy\Exception\Prophecy\MethodProphecyException; - -class UnexpectedCallsException extends MethodProphecyException implements PredictionException -{ - private $calls = array(); - - public function __construct($message, MethodProphecy $methodProphecy, array $calls) - { - parent::__construct($message, $methodProphecy); - - $this->calls = $calls; - } - - public function getCalls() - { - return $this->calls; - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Exception/Prophecy/MethodProphecyException.php b/vendor/phpspec/prophecy/src/Prophecy/Exception/Prophecy/MethodProphecyException.php deleted file mode 100644 index 1b03eaf..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Exception/Prophecy/MethodProphecyException.php +++ /dev/null @@ -1,34 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Exception\Prophecy; - -use Prophecy\Prophecy\MethodProphecy; - -class MethodProphecyException extends ObjectProphecyException -{ - private $methodProphecy; - - public function __construct($message, MethodProphecy $methodProphecy) - { - parent::__construct($message, $methodProphecy->getObjectProphecy()); - - $this->methodProphecy = $methodProphecy; - } - - /** - * @return MethodProphecy - */ - public function getMethodProphecy() - { - return $this->methodProphecy; - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Exception/Prophecy/ObjectProphecyException.php b/vendor/phpspec/prophecy/src/Prophecy/Exception/Prophecy/ObjectProphecyException.php deleted file mode 100644 index e345402..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Exception/Prophecy/ObjectProphecyException.php +++ /dev/null @@ -1,34 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Exception\Prophecy; - -use Prophecy\Prophecy\ObjectProphecy; - -class ObjectProphecyException extends \RuntimeException implements ProphecyException -{ - private $objectProphecy; - - public function __construct($message, ObjectProphecy $objectProphecy) - { - parent::__construct($message); - - $this->objectProphecy = $objectProphecy; - } - - /** - * @return ObjectProphecy - */ - public function getObjectProphecy() - { - return $this->objectProphecy; - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Exception/Prophecy/ProphecyException.php b/vendor/phpspec/prophecy/src/Prophecy/Exception/Prophecy/ProphecyException.php deleted file mode 100644 index 9157332..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Exception/Prophecy/ProphecyException.php +++ /dev/null @@ -1,18 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Exception\Prophecy; - -use Prophecy\Exception\Exception; - -interface ProphecyException extends Exception -{ -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/PhpDocumentor/ClassAndInterfaceTagRetriever.php b/vendor/phpspec/prophecy/src/Prophecy/PhpDocumentor/ClassAndInterfaceTagRetriever.php deleted file mode 100644 index 209821c..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/PhpDocumentor/ClassAndInterfaceTagRetriever.php +++ /dev/null @@ -1,69 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\PhpDocumentor; - -use phpDocumentor\Reflection\DocBlock\Tag\MethodTag as LegacyMethodTag; -use phpDocumentor\Reflection\DocBlock\Tags\Method; - -/** - * @author Théo FIDRY - * - * @internal - */ -final class ClassAndInterfaceTagRetriever implements MethodTagRetrieverInterface -{ - private $classRetriever; - - public function __construct(MethodTagRetrieverInterface $classRetriever = null) - { - if (null !== $classRetriever) { - $this->classRetriever = $classRetriever; - - return; - } - - $this->classRetriever = class_exists('phpDocumentor\Reflection\DocBlockFactory') && class_exists('phpDocumentor\Reflection\Types\ContextFactory') - ? new ClassTagRetriever() - : new LegacyClassTagRetriever() - ; - } - - /** - * @param \ReflectionClass $reflectionClass - * - * @return LegacyMethodTag[]|Method[] - */ - public function getTagList(\ReflectionClass $reflectionClass) - { - return array_merge( - $this->classRetriever->getTagList($reflectionClass), - $this->getInterfacesTagList($reflectionClass) - ); - } - - /** - * @param \ReflectionClass $reflectionClass - * - * @return LegacyMethodTag[]|Method[] - */ - private function getInterfacesTagList(\ReflectionClass $reflectionClass) - { - $interfaces = $reflectionClass->getInterfaces(); - $tagList = array(); - - foreach($interfaces as $interface) { - $tagList = array_merge($tagList, $this->classRetriever->getTagList($interface)); - } - - return $tagList; - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/PhpDocumentor/ClassTagRetriever.php b/vendor/phpspec/prophecy/src/Prophecy/PhpDocumentor/ClassTagRetriever.php deleted file mode 100644 index 9817a44..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/PhpDocumentor/ClassTagRetriever.php +++ /dev/null @@ -1,60 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\PhpDocumentor; - -use phpDocumentor\Reflection\DocBlock\Tags\Method; -use phpDocumentor\Reflection\DocBlockFactory; -use phpDocumentor\Reflection\Types\ContextFactory; - -/** - * @author Théo FIDRY - * - * @internal - */ -final class ClassTagRetriever implements MethodTagRetrieverInterface -{ - private $docBlockFactory; - private $contextFactory; - - public function __construct() - { - $this->docBlockFactory = DocBlockFactory::createInstance(); - $this->contextFactory = new ContextFactory(); - } - - /** - * @param \ReflectionClass $reflectionClass - * - * @return Method[] - */ - public function getTagList(\ReflectionClass $reflectionClass) - { - try { - $phpdoc = $this->docBlockFactory->create( - $reflectionClass, - $this->contextFactory->createFromReflector($reflectionClass) - ); - - $methods = array(); - - foreach ($phpdoc->getTagsByName('method') as $tag) { - if ($tag instanceof Method) { - $methods[] = $tag; - } - } - - return $methods; - } catch (\InvalidArgumentException $e) { - return array(); - } - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/PhpDocumentor/LegacyClassTagRetriever.php b/vendor/phpspec/prophecy/src/Prophecy/PhpDocumentor/LegacyClassTagRetriever.php deleted file mode 100644 index c0dec3d..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/PhpDocumentor/LegacyClassTagRetriever.php +++ /dev/null @@ -1,35 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\PhpDocumentor; - -use phpDocumentor\Reflection\DocBlock; -use phpDocumentor\Reflection\DocBlock\Tag\MethodTag as LegacyMethodTag; - -/** - * @author Théo FIDRY - * - * @internal - */ -final class LegacyClassTagRetriever implements MethodTagRetrieverInterface -{ - /** - * @param \ReflectionClass $reflectionClass - * - * @return LegacyMethodTag[] - */ - public function getTagList(\ReflectionClass $reflectionClass) - { - $phpdoc = new DocBlock($reflectionClass->getDocComment()); - - return $phpdoc->getTagsByName('method'); - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/PhpDocumentor/MethodTagRetrieverInterface.php b/vendor/phpspec/prophecy/src/Prophecy/PhpDocumentor/MethodTagRetrieverInterface.php deleted file mode 100644 index d3989da..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/PhpDocumentor/MethodTagRetrieverInterface.php +++ /dev/null @@ -1,30 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\PhpDocumentor; - -use phpDocumentor\Reflection\DocBlock\Tag\MethodTag as LegacyMethodTag; -use phpDocumentor\Reflection\DocBlock\Tags\Method; - -/** - * @author Théo FIDRY - * - * @internal - */ -interface MethodTagRetrieverInterface -{ - /** - * @param \ReflectionClass $reflectionClass - * - * @return LegacyMethodTag[]|Method[] - */ - public function getTagList(\ReflectionClass $reflectionClass); -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Prediction/CallPrediction.php b/vendor/phpspec/prophecy/src/Prophecy/Prediction/CallPrediction.php deleted file mode 100644 index b478736..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Prediction/CallPrediction.php +++ /dev/null @@ -1,86 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Prediction; - -use Prophecy\Call\Call; -use Prophecy\Prophecy\ObjectProphecy; -use Prophecy\Prophecy\MethodProphecy; -use Prophecy\Argument\ArgumentsWildcard; -use Prophecy\Argument\Token\AnyValuesToken; -use Prophecy\Util\StringUtil; -use Prophecy\Exception\Prediction\NoCallsException; - -/** - * Call prediction. - * - * @author Konstantin Kudryashov - */ -class CallPrediction implements PredictionInterface -{ - private $util; - - /** - * Initializes prediction. - * - * @param StringUtil $util - */ - public function __construct(StringUtil $util = null) - { - $this->util = $util ?: new StringUtil; - } - - /** - * Tests that there was at least one call. - * - * @param Call[] $calls - * @param ObjectProphecy $object - * @param MethodProphecy $method - * - * @throws \Prophecy\Exception\Prediction\NoCallsException - */ - public function check(array $calls, ObjectProphecy $object, MethodProphecy $method) - { - if (count($calls)) { - return; - } - - $methodCalls = $object->findProphecyMethodCalls( - $method->getMethodName(), - new ArgumentsWildcard(array(new AnyValuesToken)) - ); - - if (count($methodCalls)) { - throw new NoCallsException(sprintf( - "No calls have been made that match:\n". - " %s->%s(%s)\n". - "but expected at least one.\n". - "Recorded `%s(...)` calls:\n%s", - - get_class($object->reveal()), - $method->getMethodName(), - $method->getArgumentsWildcard(), - $method->getMethodName(), - $this->util->stringifyCalls($methodCalls) - ), $method); - } - - throw new NoCallsException(sprintf( - "No calls have been made that match:\n". - " %s->%s(%s)\n". - "but expected at least one.", - - get_class($object->reveal()), - $method->getMethodName(), - $method->getArgumentsWildcard() - ), $method); - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Prediction/CallTimesPrediction.php b/vendor/phpspec/prophecy/src/Prophecy/Prediction/CallTimesPrediction.php deleted file mode 100644 index 31c6c57..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Prediction/CallTimesPrediction.php +++ /dev/null @@ -1,107 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Prediction; - -use Prophecy\Call\Call; -use Prophecy\Prophecy\ObjectProphecy; -use Prophecy\Prophecy\MethodProphecy; -use Prophecy\Argument\ArgumentsWildcard; -use Prophecy\Argument\Token\AnyValuesToken; -use Prophecy\Util\StringUtil; -use Prophecy\Exception\Prediction\UnexpectedCallsCountException; - -/** - * Prediction interface. - * Predictions are logical test blocks, tied to `should...` keyword. - * - * @author Konstantin Kudryashov - */ -class CallTimesPrediction implements PredictionInterface -{ - private $times; - private $util; - - /** - * Initializes prediction. - * - * @param int $times - * @param StringUtil $util - */ - public function __construct($times, StringUtil $util = null) - { - $this->times = intval($times); - $this->util = $util ?: new StringUtil; - } - - /** - * Tests that there was exact amount of calls made. - * - * @param Call[] $calls - * @param ObjectProphecy $object - * @param MethodProphecy $method - * - * @throws \Prophecy\Exception\Prediction\UnexpectedCallsCountException - */ - public function check(array $calls, ObjectProphecy $object, MethodProphecy $method) - { - if ($this->times == count($calls)) { - return; - } - - $methodCalls = $object->findProphecyMethodCalls( - $method->getMethodName(), - new ArgumentsWildcard(array(new AnyValuesToken)) - ); - - if (count($calls)) { - $message = sprintf( - "Expected exactly %d calls that match:\n". - " %s->%s(%s)\n". - "but %d were made:\n%s", - - $this->times, - get_class($object->reveal()), - $method->getMethodName(), - $method->getArgumentsWildcard(), - count($calls), - $this->util->stringifyCalls($calls) - ); - } elseif (count($methodCalls)) { - $message = sprintf( - "Expected exactly %d calls that match:\n". - " %s->%s(%s)\n". - "but none were made.\n". - "Recorded `%s(...)` calls:\n%s", - - $this->times, - get_class($object->reveal()), - $method->getMethodName(), - $method->getArgumentsWildcard(), - $method->getMethodName(), - $this->util->stringifyCalls($methodCalls) - ); - } else { - $message = sprintf( - "Expected exactly %d calls that match:\n". - " %s->%s(%s)\n". - "but none were made.", - - $this->times, - get_class($object->reveal()), - $method->getMethodName(), - $method->getArgumentsWildcard() - ); - } - - throw new UnexpectedCallsCountException($message, $method, $this->times, $calls); - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Prediction/CallbackPrediction.php b/vendor/phpspec/prophecy/src/Prophecy/Prediction/CallbackPrediction.php deleted file mode 100644 index 44bc782..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Prediction/CallbackPrediction.php +++ /dev/null @@ -1,65 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Prediction; - -use Prophecy\Call\Call; -use Prophecy\Prophecy\ObjectProphecy; -use Prophecy\Prophecy\MethodProphecy; -use Prophecy\Exception\InvalidArgumentException; -use Closure; - -/** - * Callback prediction. - * - * @author Konstantin Kudryashov - */ -class CallbackPrediction implements PredictionInterface -{ - private $callback; - - /** - * Initializes callback prediction. - * - * @param callable $callback Custom callback - * - * @throws \Prophecy\Exception\InvalidArgumentException - */ - public function __construct($callback) - { - if (!is_callable($callback)) { - throw new InvalidArgumentException(sprintf( - 'Callable expected as an argument to CallbackPrediction, but got %s.', - gettype($callback) - )); - } - - $this->callback = $callback; - } - - /** - * Executes preset callback. - * - * @param Call[] $calls - * @param ObjectProphecy $object - * @param MethodProphecy $method - */ - public function check(array $calls, ObjectProphecy $object, MethodProphecy $method) - { - $callback = $this->callback; - - if ($callback instanceof Closure && method_exists('Closure', 'bind')) { - $callback = Closure::bind($callback, $object); - } - - call_user_func($callback, $calls, $object, $method); - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Prediction/NoCallsPrediction.php b/vendor/phpspec/prophecy/src/Prophecy/Prediction/NoCallsPrediction.php deleted file mode 100644 index 46ac5bf..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Prediction/NoCallsPrediction.php +++ /dev/null @@ -1,68 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Prediction; - -use Prophecy\Call\Call; -use Prophecy\Prophecy\ObjectProphecy; -use Prophecy\Prophecy\MethodProphecy; -use Prophecy\Util\StringUtil; -use Prophecy\Exception\Prediction\UnexpectedCallsException; - -/** - * No calls prediction. - * - * @author Konstantin Kudryashov - */ -class NoCallsPrediction implements PredictionInterface -{ - private $util; - - /** - * Initializes prediction. - * - * @param null|StringUtil $util - */ - public function __construct(StringUtil $util = null) - { - $this->util = $util ?: new StringUtil; - } - - /** - * Tests that there were no calls made. - * - * @param Call[] $calls - * @param ObjectProphecy $object - * @param MethodProphecy $method - * - * @throws \Prophecy\Exception\Prediction\UnexpectedCallsException - */ - public function check(array $calls, ObjectProphecy $object, MethodProphecy $method) - { - if (!count($calls)) { - return; - } - - $verb = count($calls) === 1 ? 'was' : 'were'; - - throw new UnexpectedCallsException(sprintf( - "No calls expected that match:\n". - " %s->%s(%s)\n". - "but %d %s made:\n%s", - get_class($object->reveal()), - $method->getMethodName(), - $method->getArgumentsWildcard(), - count($calls), - $verb, - $this->util->stringifyCalls($calls) - ), $method, $calls); - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Prediction/PredictionInterface.php b/vendor/phpspec/prophecy/src/Prophecy/Prediction/PredictionInterface.php deleted file mode 100644 index f7fb06a..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Prediction/PredictionInterface.php +++ /dev/null @@ -1,37 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Prediction; - -use Prophecy\Call\Call; -use Prophecy\Prophecy\ObjectProphecy; -use Prophecy\Prophecy\MethodProphecy; - -/** - * Prediction interface. - * Predictions are logical test blocks, tied to `should...` keyword. - * - * @author Konstantin Kudryashov - */ -interface PredictionInterface -{ - /** - * Tests that double fulfilled prediction. - * - * @param Call[] $calls - * @param ObjectProphecy $object - * @param MethodProphecy $method - * - * @throws object - * @return void - */ - public function check(array $calls, ObjectProphecy $object, MethodProphecy $method); -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Promise/CallbackPromise.php b/vendor/phpspec/prophecy/src/Prophecy/Promise/CallbackPromise.php deleted file mode 100644 index 5f406bf..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Promise/CallbackPromise.php +++ /dev/null @@ -1,66 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Promise; - -use Prophecy\Prophecy\ObjectProphecy; -use Prophecy\Prophecy\MethodProphecy; -use Prophecy\Exception\InvalidArgumentException; -use Closure; - -/** - * Callback promise. - * - * @author Konstantin Kudryashov - */ -class CallbackPromise implements PromiseInterface -{ - private $callback; - - /** - * Initializes callback promise. - * - * @param callable $callback Custom callback - * - * @throws \Prophecy\Exception\InvalidArgumentException - */ - public function __construct($callback) - { - if (!is_callable($callback)) { - throw new InvalidArgumentException(sprintf( - 'Callable expected as an argument to CallbackPromise, but got %s.', - gettype($callback) - )); - } - - $this->callback = $callback; - } - - /** - * Evaluates promise callback. - * - * @param array $args - * @param ObjectProphecy $object - * @param MethodProphecy $method - * - * @return mixed - */ - public function execute(array $args, ObjectProphecy $object, MethodProphecy $method) - { - $callback = $this->callback; - - if ($callback instanceof Closure && method_exists('Closure', 'bind')) { - $callback = Closure::bind($callback, $object); - } - - return call_user_func($callback, $args, $object, $method); - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Promise/PromiseInterface.php b/vendor/phpspec/prophecy/src/Prophecy/Promise/PromiseInterface.php deleted file mode 100644 index 382537b..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Promise/PromiseInterface.php +++ /dev/null @@ -1,35 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Promise; - -use Prophecy\Prophecy\ObjectProphecy; -use Prophecy\Prophecy\MethodProphecy; - -/** - * Promise interface. - * Promises are logical blocks, tied to `will...` keyword. - * - * @author Konstantin Kudryashov - */ -interface PromiseInterface -{ - /** - * Evaluates promise. - * - * @param array $args - * @param ObjectProphecy $object - * @param MethodProphecy $method - * - * @return mixed - */ - public function execute(array $args, ObjectProphecy $object, MethodProphecy $method); -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Promise/ReturnArgumentPromise.php b/vendor/phpspec/prophecy/src/Prophecy/Promise/ReturnArgumentPromise.php deleted file mode 100644 index 39bfeea..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Promise/ReturnArgumentPromise.php +++ /dev/null @@ -1,61 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Promise; - -use Prophecy\Exception\InvalidArgumentException; -use Prophecy\Prophecy\ObjectProphecy; -use Prophecy\Prophecy\MethodProphecy; - -/** - * Return argument promise. - * - * @author Konstantin Kudryashov - */ -class ReturnArgumentPromise implements PromiseInterface -{ - /** - * @var int - */ - private $index; - - /** - * Initializes callback promise. - * - * @param int $index The zero-indexed number of the argument to return - * - * @throws \Prophecy\Exception\InvalidArgumentException - */ - public function __construct($index = 0) - { - if (!is_int($index) || $index < 0) { - throw new InvalidArgumentException(sprintf( - 'Zero-based index expected as argument to ReturnArgumentPromise, but got %s.', - $index - )); - } - $this->index = $index; - } - - /** - * Returns nth argument if has one, null otherwise. - * - * @param array $args - * @param ObjectProphecy $object - * @param MethodProphecy $method - * - * @return null|mixed - */ - public function execute(array $args, ObjectProphecy $object, MethodProphecy $method) - { - return count($args) > $this->index ? $args[$this->index] : null; - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Promise/ReturnPromise.php b/vendor/phpspec/prophecy/src/Prophecy/Promise/ReturnPromise.php deleted file mode 100644 index c7d5ac5..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Promise/ReturnPromise.php +++ /dev/null @@ -1,55 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Promise; - -use Prophecy\Prophecy\ObjectProphecy; -use Prophecy\Prophecy\MethodProphecy; - -/** - * Return promise. - * - * @author Konstantin Kudryashov - */ -class ReturnPromise implements PromiseInterface -{ - private $returnValues = array(); - - /** - * Initializes promise. - * - * @param array $returnValues Array of values - */ - public function __construct(array $returnValues) - { - $this->returnValues = $returnValues; - } - - /** - * Returns saved values one by one until last one, then continuously returns last value. - * - * @param array $args - * @param ObjectProphecy $object - * @param MethodProphecy $method - * - * @return mixed - */ - public function execute(array $args, ObjectProphecy $object, MethodProphecy $method) - { - $value = array_shift($this->returnValues); - - if (!count($this->returnValues)) { - $this->returnValues[] = $value; - } - - return $value; - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Promise/ThrowPromise.php b/vendor/phpspec/prophecy/src/Prophecy/Promise/ThrowPromise.php deleted file mode 100644 index 26ec19e..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Promise/ThrowPromise.php +++ /dev/null @@ -1,100 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Promise; - -use Doctrine\Instantiator\Instantiator; -use Prophecy\Prophecy\ObjectProphecy; -use Prophecy\Prophecy\MethodProphecy; -use Prophecy\Exception\InvalidArgumentException; -use ReflectionClass; - -/** - * Throw promise. - * - * @author Konstantin Kudryashov - */ -class ThrowPromise implements PromiseInterface -{ - private $exception; - - /** - * @var \Doctrine\Instantiator\Instantiator - */ - private $instantiator; - - /** - * Initializes promise. - * - * @param string|\Exception|\Throwable $exception Exception class name or instance - * - * @throws \Prophecy\Exception\InvalidArgumentException - */ - public function __construct($exception) - { - if (is_string($exception)) { - if ((!class_exists($exception) && !interface_exists($exception)) || !$this->isAValidThrowable($exception)) { - throw new InvalidArgumentException(sprintf( - 'Exception / Throwable class or instance expected as argument to ThrowPromise, but got %s.', - $exception - )); - } - } elseif (!$exception instanceof \Exception && !$exception instanceof \Throwable) { - throw new InvalidArgumentException(sprintf( - 'Exception / Throwable class or instance expected as argument to ThrowPromise, but got %s.', - is_object($exception) ? get_class($exception) : gettype($exception) - )); - } - - $this->exception = $exception; - } - - /** - * Throws predefined exception. - * - * @param array $args - * @param ObjectProphecy $object - * @param MethodProphecy $method - * - * @throws object - */ - public function execute(array $args, ObjectProphecy $object, MethodProphecy $method) - { - if (is_string($this->exception)) { - $classname = $this->exception; - $reflection = new ReflectionClass($classname); - $constructor = $reflection->getConstructor(); - - if ($constructor->isPublic() && 0 == $constructor->getNumberOfRequiredParameters()) { - throw $reflection->newInstance(); - } - - if (!$this->instantiator) { - $this->instantiator = new Instantiator(); - } - - throw $this->instantiator->instantiate($classname); - } - - throw $this->exception; - } - - /** - * @param string $exception - * - * @return bool - */ - private function isAValidThrowable($exception) - { - return is_a($exception, 'Exception', true) - || is_a($exception, 'Throwable', true); - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Prophecy/MethodProphecy.php b/vendor/phpspec/prophecy/src/Prophecy/Prophecy/MethodProphecy.php deleted file mode 100644 index 50040fb..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Prophecy/MethodProphecy.php +++ /dev/null @@ -1,517 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Prophecy; - -use Prophecy\Argument; -use Prophecy\Prophet; -use Prophecy\Promise; -use Prophecy\Prediction; -use Prophecy\Exception\Doubler\MethodNotFoundException; -use Prophecy\Exception\InvalidArgumentException; -use Prophecy\Exception\Prophecy\MethodProphecyException; - -/** - * Method prophecy. - * - * @author Konstantin Kudryashov - */ -class MethodProphecy -{ - private $objectProphecy; - private $methodName; - private $argumentsWildcard; - private $promise; - private $prediction; - private $checkedPredictions = array(); - private $bound = false; - private $voidReturnType = false; - - /** - * Initializes method prophecy. - * - * @param ObjectProphecy $objectProphecy - * @param string $methodName - * @param null|Argument\ArgumentsWildcard|array $arguments - * - * @throws \Prophecy\Exception\Doubler\MethodNotFoundException If method not found - */ - public function __construct(ObjectProphecy $objectProphecy, $methodName, $arguments = null) - { - $double = $objectProphecy->reveal(); - if (!method_exists($double, $methodName)) { - throw new MethodNotFoundException(sprintf( - 'Method `%s::%s()` is not defined.', get_class($double), $methodName - ), get_class($double), $methodName, $arguments); - } - - $this->objectProphecy = $objectProphecy; - $this->methodName = $methodName; - - $reflectedMethod = new \ReflectionMethod($double, $methodName); - if ($reflectedMethod->isFinal()) { - throw new MethodProphecyException(sprintf( - "Can not add prophecy for a method `%s::%s()`\n". - "as it is a final method.", - get_class($double), - $methodName - ), $this); - } - - if (null !== $arguments) { - $this->withArguments($arguments); - } - - if (true === $reflectedMethod->hasReturnType()) { - $type = $reflectedMethod->getReturnType()->getName(); - - if ('void' === $type) { - $this->voidReturnType = true; - } - - $this->will(function () use ($type) { - switch ($type) { - case 'void': return; - case 'string': return ''; - case 'float': return 0.0; - case 'int': return 0; - case 'bool': return false; - case 'array': return array(); - - case 'callable': - case 'Closure': - return function () {}; - - case 'Traversable': - case 'Generator': - return (function () { yield; })(); - - default: - $prophet = new Prophet; - return $prophet->prophesize($type)->reveal(); - } - }); - } - } - - /** - * Sets argument wildcard. - * - * @param array|Argument\ArgumentsWildcard $arguments - * - * @return $this - * - * @throws \Prophecy\Exception\InvalidArgumentException - */ - public function withArguments($arguments) - { - if (is_array($arguments)) { - $arguments = new Argument\ArgumentsWildcard($arguments); - } - - if (!$arguments instanceof Argument\ArgumentsWildcard) { - throw new InvalidArgumentException(sprintf( - "Either an array or an instance of ArgumentsWildcard expected as\n". - 'a `MethodProphecy::withArguments()` argument, but got %s.', - gettype($arguments) - )); - } - - $this->argumentsWildcard = $arguments; - - return $this; - } - - /** - * Sets custom promise to the prophecy. - * - * @param callable|Promise\PromiseInterface $promise - * - * @return $this - * - * @throws \Prophecy\Exception\InvalidArgumentException - */ - public function will($promise) - { - if (is_callable($promise)) { - $promise = new Promise\CallbackPromise($promise); - } - - if (!$promise instanceof Promise\PromiseInterface) { - throw new InvalidArgumentException(sprintf( - 'Expected callable or instance of PromiseInterface, but got %s.', - gettype($promise) - )); - } - - $this->bindToObjectProphecy(); - $this->promise = $promise; - - return $this; - } - - /** - * Sets return promise to the prophecy. - * - * @see \Prophecy\Promise\ReturnPromise - * - * @return $this - */ - public function willReturn() - { - if ($this->voidReturnType) { - throw new MethodProphecyException( - "The method \"$this->methodName\" has a void return type, and so cannot return anything", - $this - ); - } - - return $this->will(new Promise\ReturnPromise(func_get_args())); - } - - /** - * @param array $items - * - * @return $this - * - * @throws \Prophecy\Exception\InvalidArgumentException - */ - public function willYield($items) - { - if ($this->voidReturnType) { - throw new MethodProphecyException( - "The method \"$this->methodName\" has a void return type, and so cannot yield anything", - $this - ); - } - - if (!is_array($items)) { - throw new InvalidArgumentException(sprintf( - 'Expected array, but got %s.', - gettype($items) - )); - } - - $generator = function() use ($items) { - foreach ($items as $key => $value) { - yield $key => $value; - } - }; - - return $this->will($generator); - } - - /** - * Sets return argument promise to the prophecy. - * - * @param int $index The zero-indexed number of the argument to return - * - * @see \Prophecy\Promise\ReturnArgumentPromise - * - * @return $this - */ - public function willReturnArgument($index = 0) - { - if ($this->voidReturnType) { - throw new MethodProphecyException("The method \"$this->methodName\" has a void return type", $this); - } - - return $this->will(new Promise\ReturnArgumentPromise($index)); - } - - /** - * Sets throw promise to the prophecy. - * - * @see \Prophecy\Promise\ThrowPromise - * - * @param string|\Exception $exception Exception class or instance - * - * @return $this - */ - public function willThrow($exception) - { - return $this->will(new Promise\ThrowPromise($exception)); - } - - /** - * Sets custom prediction to the prophecy. - * - * @param callable|Prediction\PredictionInterface $prediction - * - * @return $this - * - * @throws \Prophecy\Exception\InvalidArgumentException - */ - public function should($prediction) - { - if (is_callable($prediction)) { - $prediction = new Prediction\CallbackPrediction($prediction); - } - - if (!$prediction instanceof Prediction\PredictionInterface) { - throw new InvalidArgumentException(sprintf( - 'Expected callable or instance of PredictionInterface, but got %s.', - gettype($prediction) - )); - } - - $this->bindToObjectProphecy(); - $this->prediction = $prediction; - - return $this; - } - - /** - * Sets call prediction to the prophecy. - * - * @see \Prophecy\Prediction\CallPrediction - * - * @return $this - */ - public function shouldBeCalled() - { - return $this->should(new Prediction\CallPrediction); - } - - /** - * Sets no calls prediction to the prophecy. - * - * @see \Prophecy\Prediction\NoCallsPrediction - * - * @return $this - */ - public function shouldNotBeCalled() - { - return $this->should(new Prediction\NoCallsPrediction); - } - - /** - * Sets call times prediction to the prophecy. - * - * @see \Prophecy\Prediction\CallTimesPrediction - * - * @param $count - * - * @return $this - */ - public function shouldBeCalledTimes($count) - { - return $this->should(new Prediction\CallTimesPrediction($count)); - } - - /** - * Sets call times prediction to the prophecy. - * - * @see \Prophecy\Prediction\CallTimesPrediction - * - * @return $this - */ - public function shouldBeCalledOnce() - { - return $this->shouldBeCalledTimes(1); - } - - /** - * Checks provided prediction immediately. - * - * @param callable|Prediction\PredictionInterface $prediction - * - * @return $this - * - * @throws \Prophecy\Exception\InvalidArgumentException - */ - public function shouldHave($prediction) - { - if (is_callable($prediction)) { - $prediction = new Prediction\CallbackPrediction($prediction); - } - - if (!$prediction instanceof Prediction\PredictionInterface) { - throw new InvalidArgumentException(sprintf( - 'Expected callable or instance of PredictionInterface, but got %s.', - gettype($prediction) - )); - } - - if (null === $this->promise && !$this->voidReturnType) { - $this->willReturn(); - } - - $calls = $this->getObjectProphecy()->findProphecyMethodCalls( - $this->getMethodName(), - $this->getArgumentsWildcard() - ); - - try { - $prediction->check($calls, $this->getObjectProphecy(), $this); - $this->checkedPredictions[] = $prediction; - } catch (\Exception $e) { - $this->checkedPredictions[] = $prediction; - - throw $e; - } - - return $this; - } - - /** - * Checks call prediction. - * - * @see \Prophecy\Prediction\CallPrediction - * - * @return $this - */ - public function shouldHaveBeenCalled() - { - return $this->shouldHave(new Prediction\CallPrediction); - } - - /** - * Checks no calls prediction. - * - * @see \Prophecy\Prediction\NoCallsPrediction - * - * @return $this - */ - public function shouldNotHaveBeenCalled() - { - return $this->shouldHave(new Prediction\NoCallsPrediction); - } - - /** - * Checks no calls prediction. - * - * @see \Prophecy\Prediction\NoCallsPrediction - * @deprecated - * - * @return $this - */ - public function shouldNotBeenCalled() - { - return $this->shouldNotHaveBeenCalled(); - } - - /** - * Checks call times prediction. - * - * @see \Prophecy\Prediction\CallTimesPrediction - * - * @param int $count - * - * @return $this - */ - public function shouldHaveBeenCalledTimes($count) - { - return $this->shouldHave(new Prediction\CallTimesPrediction($count)); - } - - /** - * Checks call times prediction. - * - * @see \Prophecy\Prediction\CallTimesPrediction - * - * @return $this - */ - public function shouldHaveBeenCalledOnce() - { - return $this->shouldHaveBeenCalledTimes(1); - } - - /** - * Checks currently registered [with should(...)] prediction. - */ - public function checkPrediction() - { - if (null === $this->prediction) { - return; - } - - $this->shouldHave($this->prediction); - } - - /** - * Returns currently registered promise. - * - * @return null|Promise\PromiseInterface - */ - public function getPromise() - { - return $this->promise; - } - - /** - * Returns currently registered prediction. - * - * @return null|Prediction\PredictionInterface - */ - public function getPrediction() - { - return $this->prediction; - } - - /** - * Returns predictions that were checked on this object. - * - * @return Prediction\PredictionInterface[] - */ - public function getCheckedPredictions() - { - return $this->checkedPredictions; - } - - /** - * Returns object prophecy this method prophecy is tied to. - * - * @return ObjectProphecy - */ - public function getObjectProphecy() - { - return $this->objectProphecy; - } - - /** - * Returns method name. - * - * @return string - */ - public function getMethodName() - { - return $this->methodName; - } - - /** - * Returns arguments wildcard. - * - * @return Argument\ArgumentsWildcard - */ - public function getArgumentsWildcard() - { - return $this->argumentsWildcard; - } - - /** - * @return bool - */ - public function hasReturnVoid() - { - return $this->voidReturnType; - } - - private function bindToObjectProphecy() - { - if ($this->bound) { - return; - } - - $this->getObjectProphecy()->addMethodProphecy($this); - $this->bound = true; - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Prophecy/ObjectProphecy.php b/vendor/phpspec/prophecy/src/Prophecy/Prophecy/ObjectProphecy.php deleted file mode 100644 index 11b87cf..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Prophecy/ObjectProphecy.php +++ /dev/null @@ -1,286 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Prophecy; - -use SebastianBergmann\Comparator\ComparisonFailure; -use Prophecy\Comparator\Factory as ComparatorFactory; -use Prophecy\Call\Call; -use Prophecy\Doubler\LazyDouble; -use Prophecy\Argument\ArgumentsWildcard; -use Prophecy\Call\CallCenter; -use Prophecy\Exception\Prophecy\ObjectProphecyException; -use Prophecy\Exception\Prophecy\MethodProphecyException; -use Prophecy\Exception\Prediction\AggregateException; -use Prophecy\Exception\Prediction\PredictionException; - -/** - * Object prophecy. - * - * @author Konstantin Kudryashov - */ -class ObjectProphecy implements ProphecyInterface -{ - private $lazyDouble; - private $callCenter; - private $revealer; - private $comparatorFactory; - - /** - * @var MethodProphecy[][] - */ - private $methodProphecies = array(); - - /** - * Initializes object prophecy. - * - * @param LazyDouble $lazyDouble - * @param CallCenter $callCenter - * @param RevealerInterface $revealer - * @param ComparatorFactory $comparatorFactory - */ - public function __construct( - LazyDouble $lazyDouble, - CallCenter $callCenter = null, - RevealerInterface $revealer = null, - ComparatorFactory $comparatorFactory = null - ) { - $this->lazyDouble = $lazyDouble; - $this->callCenter = $callCenter ?: new CallCenter; - $this->revealer = $revealer ?: new Revealer; - - $this->comparatorFactory = $comparatorFactory ?: ComparatorFactory::getInstance(); - } - - /** - * Forces double to extend specific class. - * - * @param string $class - * - * @return $this - */ - public function willExtend($class) - { - $this->lazyDouble->setParentClass($class); - - return $this; - } - - /** - * Forces double to implement specific interface. - * - * @param string $interface - * - * @return $this - */ - public function willImplement($interface) - { - $this->lazyDouble->addInterface($interface); - - return $this; - } - - /** - * Sets constructor arguments. - * - * @param array $arguments - * - * @return $this - */ - public function willBeConstructedWith(array $arguments = null) - { - $this->lazyDouble->setArguments($arguments); - - return $this; - } - - /** - * Reveals double. - * - * @return object - * - * @throws \Prophecy\Exception\Prophecy\ObjectProphecyException If double doesn't implement needed interface - */ - public function reveal() - { - $double = $this->lazyDouble->getInstance(); - - if (null === $double || !$double instanceof ProphecySubjectInterface) { - throw new ObjectProphecyException( - "Generated double must implement ProphecySubjectInterface, but it does not.\n". - 'It seems you have wrongly configured doubler without required ClassPatch.', - $this - ); - } - - $double->setProphecy($this); - - return $double; - } - - /** - * Adds method prophecy to object prophecy. - * - * @param MethodProphecy $methodProphecy - * - * @throws \Prophecy\Exception\Prophecy\MethodProphecyException If method prophecy doesn't - * have arguments wildcard - */ - public function addMethodProphecy(MethodProphecy $methodProphecy) - { - $argumentsWildcard = $methodProphecy->getArgumentsWildcard(); - if (null === $argumentsWildcard) { - throw new MethodProphecyException(sprintf( - "Can not add prophecy for a method `%s::%s()`\n". - "as you did not specify arguments wildcard for it.", - get_class($this->reveal()), - $methodProphecy->getMethodName() - ), $methodProphecy); - } - - $methodName = strtolower($methodProphecy->getMethodName()); - - if (!isset($this->methodProphecies[$methodName])) { - $this->methodProphecies[$methodName] = array(); - } - - $this->methodProphecies[$methodName][] = $methodProphecy; - } - - /** - * Returns either all or related to single method prophecies. - * - * @param null|string $methodName - * - * @return MethodProphecy[] - */ - public function getMethodProphecies($methodName = null) - { - if (null === $methodName) { - return $this->methodProphecies; - } - - $methodName = strtolower($methodName); - - if (!isset($this->methodProphecies[$methodName])) { - return array(); - } - - return $this->methodProphecies[$methodName]; - } - - /** - * Makes specific method call. - * - * @param string $methodName - * @param array $arguments - * - * @return mixed - */ - public function makeProphecyMethodCall($methodName, array $arguments) - { - $arguments = $this->revealer->reveal($arguments); - $return = $this->callCenter->makeCall($this, $methodName, $arguments); - - return $this->revealer->reveal($return); - } - - /** - * Finds calls by method name & arguments wildcard. - * - * @param string $methodName - * @param ArgumentsWildcard $wildcard - * - * @return Call[] - */ - public function findProphecyMethodCalls($methodName, ArgumentsWildcard $wildcard) - { - return $this->callCenter->findCalls($methodName, $wildcard); - } - - /** - * Checks that registered method predictions do not fail. - * - * @throws \Prophecy\Exception\Prediction\AggregateException If any of registered predictions fail - * @throws \Prophecy\Exception\Call\UnexpectedCallException - */ - public function checkProphecyMethodsPredictions() - { - $exception = new AggregateException(sprintf("%s:\n", get_class($this->reveal()))); - $exception->setObjectProphecy($this); - - $this->callCenter->checkUnexpectedCalls(); - - foreach ($this->methodProphecies as $prophecies) { - foreach ($prophecies as $prophecy) { - try { - $prophecy->checkPrediction(); - } catch (PredictionException $e) { - $exception->append($e); - } - } - } - - if (count($exception->getExceptions())) { - throw $exception; - } - } - - /** - * Creates new method prophecy using specified method name and arguments. - * - * @param string $methodName - * @param array $arguments - * - * @return MethodProphecy - */ - public function __call($methodName, array $arguments) - { - $arguments = new ArgumentsWildcard($this->revealer->reveal($arguments)); - - foreach ($this->getMethodProphecies($methodName) as $prophecy) { - $argumentsWildcard = $prophecy->getArgumentsWildcard(); - $comparator = $this->comparatorFactory->getComparatorFor( - $argumentsWildcard, $arguments - ); - - try { - $comparator->assertEquals($argumentsWildcard, $arguments); - return $prophecy; - } catch (ComparisonFailure $failure) {} - } - - return new MethodProphecy($this, $methodName, $arguments); - } - - /** - * Tries to get property value from double. - * - * @param string $name - * - * @return mixed - */ - public function __get($name) - { - return $this->reveal()->$name; - } - - /** - * Tries to set property value to double. - * - * @param string $name - * @param mixed $value - */ - public function __set($name, $value) - { - $this->reveal()->$name = $this->revealer->reveal($value); - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Prophecy/ProphecyInterface.php b/vendor/phpspec/prophecy/src/Prophecy/Prophecy/ProphecyInterface.php deleted file mode 100644 index 462f15a..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Prophecy/ProphecyInterface.php +++ /dev/null @@ -1,27 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Prophecy; - -/** - * Core Prophecy interface. - * - * @author Konstantin Kudryashov - */ -interface ProphecyInterface -{ - /** - * Reveals prophecy object (double) . - * - * @return object - */ - public function reveal(); -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Prophecy/ProphecySubjectInterface.php b/vendor/phpspec/prophecy/src/Prophecy/Prophecy/ProphecySubjectInterface.php deleted file mode 100644 index 2d83958..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Prophecy/ProphecySubjectInterface.php +++ /dev/null @@ -1,34 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Prophecy; - -/** - * Controllable doubles interface. - * - * @author Konstantin Kudryashov - */ -interface ProphecySubjectInterface -{ - /** - * Sets subject prophecy. - * - * @param ProphecyInterface $prophecy - */ - public function setProphecy(ProphecyInterface $prophecy); - - /** - * Returns subject prophecy. - * - * @return ProphecyInterface - */ - public function getProphecy(); -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Prophecy/Revealer.php b/vendor/phpspec/prophecy/src/Prophecy/Prophecy/Revealer.php deleted file mode 100644 index 60ecdac..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Prophecy/Revealer.php +++ /dev/null @@ -1,44 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Prophecy; - -/** - * Basic prophecies revealer. - * - * @author Konstantin Kudryashov - */ -class Revealer implements RevealerInterface -{ - /** - * Unwraps value(s). - * - * @param mixed $value - * - * @return mixed - */ - public function reveal($value) - { - if (is_array($value)) { - return array_map(array($this, __FUNCTION__), $value); - } - - if (!is_object($value)) { - return $value; - } - - if ($value instanceof ProphecyInterface) { - $value = $value->reveal(); - } - - return $value; - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Prophecy/RevealerInterface.php b/vendor/phpspec/prophecy/src/Prophecy/Prophecy/RevealerInterface.php deleted file mode 100644 index ffc82bb..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Prophecy/RevealerInterface.php +++ /dev/null @@ -1,29 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Prophecy; - -/** - * Prophecies revealer interface. - * - * @author Konstantin Kudryashov - */ -interface RevealerInterface -{ - /** - * Unwraps value(s). - * - * @param mixed $value - * - * @return mixed - */ - public function reveal($value); -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Prophet.php b/vendor/phpspec/prophecy/src/Prophecy/Prophet.php deleted file mode 100644 index d37c92a..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Prophet.php +++ /dev/null @@ -1,138 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy; - -use Prophecy\Doubler\CachedDoubler; -use Prophecy\Doubler\Doubler; -use Prophecy\Doubler\LazyDouble; -use Prophecy\Doubler\ClassPatch; -use Prophecy\Prophecy\ObjectProphecy; -use Prophecy\Prophecy\RevealerInterface; -use Prophecy\Prophecy\Revealer; -use Prophecy\Call\CallCenter; -use Prophecy\Util\StringUtil; -use Prophecy\Exception\Prediction\PredictionException; -use Prophecy\Exception\Prediction\AggregateException; - -/** - * Prophet creates prophecies. - * - * @author Konstantin Kudryashov - */ -class Prophet -{ - private $doubler; - private $revealer; - private $util; - - /** - * @var ObjectProphecy[] - */ - private $prophecies = array(); - - /** - * Initializes Prophet. - * - * @param null|Doubler $doubler - * @param null|RevealerInterface $revealer - * @param null|StringUtil $util - */ - public function __construct( - Doubler $doubler = null, - RevealerInterface $revealer = null, - StringUtil $util = null - ) { - if (null === $doubler) { - $doubler = new CachedDoubler(); - $doubler->registerClassPatch(new ClassPatch\SplFileInfoPatch); - $doubler->registerClassPatch(new ClassPatch\TraversablePatch); - $doubler->registerClassPatch(new ClassPatch\ThrowablePatch); - $doubler->registerClassPatch(new ClassPatch\DisableConstructorPatch); - $doubler->registerClassPatch(new ClassPatch\ProphecySubjectPatch); - $doubler->registerClassPatch(new ClassPatch\ReflectionClassNewInstancePatch); - $doubler->registerClassPatch(new ClassPatch\HhvmExceptionPatch()); - $doubler->registerClassPatch(new ClassPatch\MagicCallPatch); - $doubler->registerClassPatch(new ClassPatch\KeywordPatch); - } - - $this->doubler = $doubler; - $this->revealer = $revealer ?: new Revealer; - $this->util = $util ?: new StringUtil; - } - - /** - * Creates new object prophecy. - * - * @param null|string $classOrInterface Class or interface name - * - * @return ObjectProphecy - */ - public function prophesize($classOrInterface = null) - { - $this->prophecies[] = $prophecy = new ObjectProphecy( - new LazyDouble($this->doubler), - new CallCenter($this->util), - $this->revealer - ); - - if ($classOrInterface && class_exists($classOrInterface)) { - return $prophecy->willExtend($classOrInterface); - } - - if ($classOrInterface && interface_exists($classOrInterface)) { - return $prophecy->willImplement($classOrInterface); - } - - return $prophecy; - } - - /** - * Returns all created object prophecies. - * - * @return ObjectProphecy[] - */ - public function getProphecies() - { - return $this->prophecies; - } - - /** - * Returns Doubler instance assigned to this Prophet. - * - * @return Doubler - */ - public function getDoubler() - { - return $this->doubler; - } - - /** - * Checks all predictions defined by prophecies of this Prophet. - * - * @throws Exception\Prediction\AggregateException If any prediction fails - */ - public function checkPredictions() - { - $exception = new AggregateException("Some predictions failed:\n"); - foreach ($this->prophecies as $prophecy) { - try { - $prophecy->checkProphecyMethodsPredictions(); - } catch (PredictionException $e) { - $exception->append($e); - } - } - - if (count($exception->getExceptions())) { - throw $exception; - } - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Util/ExportUtil.php b/vendor/phpspec/prophecy/src/Prophecy/Util/ExportUtil.php deleted file mode 100644 index 1090a80..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Util/ExportUtil.php +++ /dev/null @@ -1,210 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * This class is a modification from sebastianbergmann/exporter - * @see https://github.com/sebastianbergmann/exporter - */ -class ExportUtil -{ - /** - * Exports a value as a string - * - * The output of this method is similar to the output of print_r(), but - * improved in various aspects: - * - * - NULL is rendered as "null" (instead of "") - * - TRUE is rendered as "true" (instead of "1") - * - FALSE is rendered as "false" (instead of "") - * - Strings are always quoted with single quotes - * - Carriage returns and newlines are normalized to \n - * - Recursion and repeated rendering is treated properly - * - * @param mixed $value - * @param int $indentation The indentation level of the 2nd+ line - * @return string - */ - public static function export($value, $indentation = 0) - { - return self::recursiveExport($value, $indentation); - } - - /** - * Converts an object to an array containing all of its private, protected - * and public properties. - * - * @param mixed $value - * @return array - */ - public static function toArray($value) - { - if (!is_object($value)) { - return (array) $value; - } - - $array = array(); - - foreach ((array) $value as $key => $val) { - // properties are transformed to keys in the following way: - // private $property => "\0Classname\0property" - // protected $property => "\0*\0property" - // public $property => "property" - if (preg_match('/^\0.+\0(.+)$/', $key, $matches)) { - $key = $matches[1]; - } - - // See https://github.com/php/php-src/commit/5721132 - if ($key === "\0gcdata") { - continue; - } - - $array[$key] = $val; - } - - // Some internal classes like SplObjectStorage don't work with the - // above (fast) mechanism nor with reflection in Zend. - // Format the output similarly to print_r() in this case - if ($value instanceof \SplObjectStorage) { - // However, the fast method does work in HHVM, and exposes the - // internal implementation. Hide it again. - if (property_exists('\SplObjectStorage', '__storage')) { - unset($array['__storage']); - } elseif (property_exists('\SplObjectStorage', 'storage')) { - unset($array['storage']); - } - - if (property_exists('\SplObjectStorage', '__key')) { - unset($array['__key']); - } - - foreach ($value as $key => $val) { - $array[spl_object_hash($val)] = array( - 'obj' => $val, - 'inf' => $value->getInfo(), - ); - } - } - - return $array; - } - - /** - * Recursive implementation of export - * - * @param mixed $value The value to export - * @param int $indentation The indentation level of the 2nd+ line - * @param \SebastianBergmann\RecursionContext\Context $processed Previously processed objects - * @return string - * @see SebastianBergmann\Exporter\Exporter::export - */ - protected static function recursiveExport(&$value, $indentation, $processed = null) - { - if ($value === null) { - return 'null'; - } - - if ($value === true) { - return 'true'; - } - - if ($value === false) { - return 'false'; - } - - if (is_float($value) && floatval(intval($value)) === $value) { - return "$value.0"; - } - - if (is_resource($value)) { - return sprintf( - 'resource(%d) of type (%s)', - $value, - get_resource_type($value) - ); - } - - if (is_string($value)) { - // Match for most non printable chars somewhat taking multibyte chars into account - if (preg_match('/[^\x09-\x0d\x20-\xff]/', $value)) { - return 'Binary String: 0x' . bin2hex($value); - } - - return "'" . - str_replace(array("\r\n", "\n\r", "\r"), array("\n", "\n", "\n"), $value) . - "'"; - } - - $whitespace = str_repeat(' ', 4 * $indentation); - - if (!$processed) { - $processed = new Context; - } - - if (is_array($value)) { - if (($key = $processed->contains($value)) !== false) { - return 'Array &' . $key; - } - - $array = $value; - $key = $processed->add($value); - $values = ''; - - if (count($array) > 0) { - foreach ($array as $k => $v) { - $values .= sprintf( - '%s %s => %s' . "\n", - $whitespace, - self::recursiveExport($k, $indentation), - self::recursiveExport($value[$k], $indentation + 1, $processed) - ); - } - - $values = "\n" . $values . $whitespace; - } - - return sprintf('Array &%s (%s)', $key, $values); - } - - if (is_object($value)) { - $class = get_class($value); - - if ($hash = $processed->contains($value)) { - return sprintf('%s:%s Object', $class, $hash); - } - - $hash = $processed->add($value); - $values = ''; - $array = self::toArray($value); - - if (count($array) > 0) { - foreach ($array as $k => $v) { - $values .= sprintf( - '%s %s => %s' . "\n", - $whitespace, - self::recursiveExport($k, $indentation), - self::recursiveExport($v, $indentation + 1, $processed) - ); - } - - $values = "\n" . $values . $whitespace; - } - - return sprintf('%s:%s Object (%s)', $class, $hash, $values); - } - - return var_export($value, true); - } -} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Util/StringUtil.php b/vendor/phpspec/prophecy/src/Prophecy/Util/StringUtil.php deleted file mode 100644 index ba4faff..0000000 --- a/vendor/phpspec/prophecy/src/Prophecy/Util/StringUtil.php +++ /dev/null @@ -1,99 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Util; - -use Prophecy\Call\Call; - -/** - * String utility. - * - * @author Konstantin Kudryashov - */ -class StringUtil -{ - private $verbose; - - /** - * @param bool $verbose - */ - public function __construct($verbose = true) - { - $this->verbose = $verbose; - } - - /** - * Stringifies any provided value. - * - * @param mixed $value - * @param boolean $exportObject - * - * @return string - */ - public function stringify($value, $exportObject = true) - { - if (is_array($value)) { - if (range(0, count($value) - 1) === array_keys($value)) { - return '['.implode(', ', array_map(array($this, __FUNCTION__), $value)).']'; - } - - $stringify = array($this, __FUNCTION__); - - return '['.implode(', ', array_map(function ($item, $key) use ($stringify) { - return (is_integer($key) ? $key : '"'.$key.'"'). - ' => '.call_user_func($stringify, $item); - }, $value, array_keys($value))).']'; - } - if (is_resource($value)) { - return get_resource_type($value).':'.$value; - } - if (is_object($value)) { - return $exportObject ? ExportUtil::export($value) : sprintf('%s:%s', get_class($value), spl_object_hash($value)); - } - if (true === $value || false === $value) { - return $value ? 'true' : 'false'; - } - if (is_string($value)) { - $str = sprintf('"%s"', str_replace("\n", '\\n', $value)); - - if (!$this->verbose && 50 <= strlen($str)) { - return substr($str, 0, 50).'"...'; - } - - return $str; - } - if (null === $value) { - return 'null'; - } - - return (string) $value; - } - - /** - * Stringifies provided array of calls. - * - * @param Call[] $calls Array of Call instances - * - * @return string - */ - public function stringifyCalls(array $calls) - { - $self = $this; - - return implode(PHP_EOL, array_map(function (Call $call) use ($self) { - return sprintf(' - %s(%s) @ %s', - $call->getMethodName(), - implode(', ', array_map(array($self, 'stringify'), $call->getArguments())), - str_replace(GETCWD().DIRECTORY_SEPARATOR, '', $call->getCallPlace()) - ); - }, $calls)); - } -} diff --git a/vendor/phpstan/phpdoc-parser/build-abnfgen.sh b/vendor/phpstan/phpdoc-parser/build-abnfgen.sh deleted file mode 100755 index a2911aa..0000000 --- a/vendor/phpstan/phpdoc-parser/build-abnfgen.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -IFS=$'\n\t' -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -ROOT_DIR="$DIR" - -if [[ ! -d "$ROOT_DIR/tools/abnfgen" ]]; then - rm -rf "$ROOT_DIR/temp/abnfgen" - mkdir -p "$ROOT_DIR/temp/abnfgen" - - wget http://www.quut.com/abnfgen/abnfgen-0.20.tar.gz \ - --output-document "$ROOT_DIR/temp/abnfgen.tar.gz" - - tar xf "$ROOT_DIR/temp/abnfgen.tar.gz" \ - --directory "$ROOT_DIR/temp/abnfgen" \ - --strip-components 1 - - cd "$ROOT_DIR/temp/abnfgen" - ./configure - make - - mkdir -p "$ROOT_DIR/tools/abnfgen" - mv abnfgen "$ROOT_DIR/tools/abnfgen" - rm -rf "$ROOT_DIR/temp/abnfgen" "$ROOT_DIR/temp/abnfgen.tar.gz" -fi diff --git a/vendor/phpstan/phpdoc-parser/composer.json b/vendor/phpstan/phpdoc-parser/composer.json deleted file mode 100644 index 332c8be..0000000 --- a/vendor/phpstan/phpdoc-parser/composer.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "phpstan/phpdoc-parser", - "description": "PHPDoc parser with support for nullable, intersection and generic types", - "license": "MIT", - "require": { - "php": "~7.1" - }, - "require-dev": { - "consistence/coding-standard": "^3.5", - "jakub-onderka/php-parallel-lint": "^0.9.2", - "phing/phing": "^2.16.0", - "phpstan/phpstan": "^0.10", - "phpunit/phpunit": "^6.3", - "slevomat/coding-standard": "^4.7.2", - "squizlabs/php_codesniffer": "^3.3.2", - "symfony/process": "^3.4 || ^4.0" - }, - "autoload": { - "psr-4": {"PHPStan\\PhpDocParser\\": ["src/"]} - }, - "autoload-dev": { - "psr-4": {"PHPStan\\PhpDocParser\\": ["tests/PHPStan"]} - }, - "extra": { - "branch-alias": { - "dev-master": "0.3-dev" - } - } -} diff --git a/vendor/phpstan/phpdoc-parser/doc/grammars/phpdoc-method.peg b/vendor/phpstan/phpdoc-parser/doc/grammars/phpdoc-method.peg deleted file mode 100644 index f022779..0000000 --- a/vendor/phpstan/phpdoc-parser/doc/grammars/phpdoc-method.peg +++ /dev/null @@ -1,41 +0,0 @@ -PhpDocMethod - = AnnotationName IsStatic? MethodReturnType? MethodName MethodParameters? Description? - -AnnotationName - = '@method' - -IsStatic - = 'static' - -MethodReturnType - = Type - -MethodName - = [a-zA-Z_\127-\255][a-zA-Z0-9_\127-\255]* - -MethodParameters - = '(' MethodParametersInner? ')' - -MethodParametersInner - = MethodParameter (',' MethodParameter)* - -MethodParameter - = MethodParameterType? IsReference? IsVariaric? MethodParameterName MethodParameterDefaultValue? - -MethodParameterType - = Type - -IsReference - = '&' - -IsVariaric - = '...' - -MethodParameterName - = '$' [a-zA-Z_\127-\255][a-zA-Z0-9_\127-\255]* - -MethodParameterDefaultValue - = '=' PhpConstantExpr - -Description - = .+ # TODO: exclude EOL or another PhpDocTag start diff --git a/vendor/phpstan/phpdoc-parser/doc/grammars/phpdoc-param.peg b/vendor/phpstan/phpdoc-parser/doc/grammars/phpdoc-param.peg deleted file mode 100644 index 5a5c1b3..0000000 --- a/vendor/phpstan/phpdoc-parser/doc/grammars/phpdoc-param.peg +++ /dev/null @@ -1,14 +0,0 @@ -PhpDocParam - = AnnotationName Type IsVariadic? ParameterName Description? - -AnnotationName - = '@param' - -IsVariaric - = '...' - -ParameterName - = '$' [a-zA-Z_\127-\255][a-zA-Z0-9_\127-\255]* - -Description - = .+ # TODO: exclude EOL or another PhpDocTag start diff --git a/vendor/phpstan/phpdoc-parser/doc/grammars/type.abnf b/vendor/phpstan/phpdoc-parser/doc/grammars/type.abnf deleted file mode 100644 index dd38d05..0000000 --- a/vendor/phpstan/phpdoc-parser/doc/grammars/type.abnf +++ /dev/null @@ -1,243 +0,0 @@ -; ---------------------------------------------------------------------------- ; -; Type ; -; ---------------------------------------------------------------------------- ; - -Type - = Atomic [Union / Intersection] - / Nullable - -Union - = 1*(TokenUnion Atomic) - -Intersection - = 1*(TokenIntersection Atomic) - -Nullable - = TokenNullable TokenIdentifier [Generic] - -Atomic - = TokenIdentifier [Generic / Callable / Array] - / TokenThisVariable - / TokenParenthesesOpen Type TokenParenthesesClose [Array] - -Generic - = TokenAngleBracketOpen Type *(TokenComma Type) TokenAngleBracketClose - -Callable - = TokenParenthesesOpen [CallableParameters] TokenParenthesesClose TokenColon CallableReturnType - -CallableParameters - = CallableParameter *(TokenComma CallableParameter) - -CallableParameter - = Type [CallableParameterIsReference] [CallableParameterIsVariadic] [CallableParameterName] [CallableParameterIsOptional] - -CallableParameterIsReference - = TokenIntersection - -CallableParameterIsVariadic - = TokenVariadic - -CallableParameterName - = TokenVariable - -CallableParameterIsOptional - = TokenEqualSign - -CallableReturnType - = TokenIdentifier [Generic] - / Nullable - / TokenParenthesesOpen Type TokenParenthesesClose - -Array - = 1*(TokenSquareBracketOpen TokenSquareBracketClose) - -ArrayShape - = TokenCurlyBracketOpen ArrayShapeItem *(TokenComma ArrayShapeItem) TokenCurlyBracketClose - -ArrayShapeItem - = (ConstantString / ConstantInt / TokenIdentifier) TokenNullable TokenColon Type - / Type - -; ---------------------------------------------------------------------------- ; -; ConstantExpr ; -; ---------------------------------------------------------------------------- ; - -ConstantExpr - = ConstantFloat *ByteHorizontalWs - / ConstantInt *ByteHorizontalWs - / ConstantTrue *ByteHorizontalWs - / ConstantFalse *ByteHorizontalWs - / ConstantNull *ByteHorizontalWs - / ConstantString *ByteHorizontalWs - / ConstantArray *ByteHorizontalWs - / ConstantFetch *ByteHorizontalWs - -ConstantFloat - = ["-"] 1*ByteDecDigit "." *ByteDecDigit [ConstantFloatExp] - / ["-"] 1*ByteDecDigit ConstantFloatExp - / ["-"] "." 1*ByteDecDigit [ConstantFloatExp] - -ConstantFloatExp - = "e" ["-"] 1*ByteDecDigit - -ConstantInt - = ["-"] "0b" 1*ByteBinDigit - / ["-"] "0o" 1*ByteOctDigit - / ["-"] "0x" 1*ByteHexDigit - / ["-"] 1*ByteDecDigit - -ConstantTrue - = "true" - -ConstantFalse - = "false" - -ConstantNull - = "null" - -ConstantString - = ByteSingleQuote *(ByteBackslash ByteNotEol / ByteNotEolAndNotBackslashAndNotSingleQuote) ByteSingleQuote - / ByteDoubleQuote *(ByteBackslash ByteNotEol / ByteNotEolAndNotBackslashAndNotDoubleQuote) ByteDoubleQuote - -ConstantArray - = TokenSquareBracketOpen [ConstantArrayItems] TokenSquareBracketClose - / "array" TokenParenthesesOpen [ConstantArrayItems] TokenParenthesesClose - -ConstantArrayItems - = ConstantArrayItem *(TokenComma ConstantArrayItem) [TokenComma] - -ConstantArrayItem - = ConstantExpr [TokenDoubleArrow ConstantExpr] - -ConstantFetch - = TokenIdentifier [TokenDoubleColon ByteIdentifierFirst *ByteIdentifierSecond *ByteHorizontalWs] - - -; ---------------------------------------------------------------------------- ; -; Tokens ; -; ---------------------------------------------------------------------------- ; - -TokenUnion - = "|" *ByteHorizontalWs - -TokenIntersection - = "&" *ByteHorizontalWs - -TokenNullable - = "?" *ByteHorizontalWs - -TokenParenthesesOpen - = "(" *ByteHorizontalWs - -TokenParenthesesClose - = ")" *ByteHorizontalWs - -TokenAngleBracketOpen - = "<" *ByteHorizontalWs - -TokenAngleBracketClose - = ">" *ByteHorizontalWs - -TokenSquareBracketOpen - = "[" *ByteHorizontalWs - -TokenSquareBracketClose - = "]" *ByteHorizontalWs - -TokenCurlyBracketOpen - = "{" *ByteHorizontalWs - -TokenCurlyBracketClose - = "}" *ByteHorizontalWs - -TokenComma - = "," *ByteHorizontalWs - -TokenColon - = ":" *ByteHorizontalWs - -TokenVariadic - = "..." *ByteHorizontalWs - -TokenEqualSign - = "=" *ByteHorizontalWs - -TokenVariable - = "$" ByteIdentifierFirst *ByteIdentifierSecond *ByteHorizontalWs - -TokenDoubleArrow - = "=>" *ByteHorizontalWs - -TokenDoubleColon - = "::" *ByteHorizontalWs - -TokenThisVariable - = %x24.74.68.69.73 *ByteHorizontalWs - -TokenIdentifier - = [ByteBackslash] ByteIdentifierFirst *ByteIdentifierSecond *(ByteBackslash ByteIdentifierFirst *ByteIdentifierSecond) *ByteHorizontalWs - - -; ---------------------------------------------------------------------------- ; -; Bytes ; -; ---------------------------------------------------------------------------- ; - -ByteHorizontalWs - = %x09 ; horizontal tab - / %x20 ; space - -ByteBinDigit - = %x30-31 ; 0-1 - -ByteOctDigit - = %x30-37 ; 0-7 - -ByteDecDigit - = %x30-39 ; 0-9 - -ByteHexDigit - = %x30-39 ; 0-9 - / %x41-46 ; A-F - / %x61-66 ; a-f - -ByteIdentifierFirst - = %x41-5A ; A-Z - / %x5F ; _ - / %x61-7A ; a-z - / %x80-FF - -ByteIdentifierSecond - = %x30-39 ; 0-9 - / %x41-5A ; A-Z - / %x5F ; _ - / %x61-7A ; a-z - / %x80-FF - -ByteSingleQuote - = %x27 ; ' - -ByteDoubleQuote - = %x22 ; " - -ByteBackslash - = %x5C ; \ - -ByteNotEol - = %x00-09 ; skip LF - / %x0B-0C ; skip CR - / %x0E-FF - -ByteNotEolAndNotBackslashAndNotSingleQuote - = %x00-09 ; skip LF - / %x0B-0C ; skip CR - / %x0E-26 ; skip single quote - / %x28-5B ; skip backslash - / %x5D-FF - -ByteNotEolAndNotBackslashAndNotDoubleQuote - = %x00-09 ; skip LF - / %x0B-0C ; skip CR - / %x0E-21 ; skip double quote - / %x23-5B ; skip backslash - / %x5D-FF diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprArrayItemNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprArrayItemNode.php deleted file mode 100644 index 9456e95..0000000 --- a/vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprArrayItemNode.php +++ /dev/null @@ -1,31 +0,0 @@ -key = $key; - $this->value = $value; - } - - - public function __toString(): string - { - if ($this->key !== null) { - return "{$this->key} => {$this->value}"; - - } - - return "{$this->value}"; - } - -} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprArrayNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprArrayNode.php deleted file mode 100644 index 215c5a3..0000000 --- a/vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprArrayNode.php +++ /dev/null @@ -1,25 +0,0 @@ -items = $items; - } - - - public function __toString(): string - { - return '[' . implode(', ', $this->items) . ']'; - } - -} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprFalseNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprFalseNode.php deleted file mode 100644 index fae8af1..0000000 --- a/vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprFalseNode.php +++ /dev/null @@ -1,13 +0,0 @@ -value = $value; - } - - - public function __toString(): string - { - return $this->value; - } - -} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprIntegerNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprIntegerNode.php deleted file mode 100644 index 949ba5c..0000000 --- a/vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprIntegerNode.php +++ /dev/null @@ -1,22 +0,0 @@ -value = $value; - } - - - public function __toString(): string - { - return $this->value; - } - -} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprNode.php deleted file mode 100644 index 1859f03..0000000 --- a/vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprNode.php +++ /dev/null @@ -1,10 +0,0 @@ -value = $value; - } - - - public function __toString(): string - { - return $this->value; - } - -} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprTrueNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprTrueNode.php deleted file mode 100644 index b0e3c00..0000000 --- a/vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprTrueNode.php +++ /dev/null @@ -1,13 +0,0 @@ -className = $className; - $this->name = $name; - } - - - public function __toString(): string - { - if ($this->className === '') { - return $this->name; - - } - - return "{$this->className}::{$this->name}"; - } - -} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/Node.php b/vendor/phpstan/phpdoc-parser/src/Ast/Node.php deleted file mode 100644 index 8c4ccb5..0000000 --- a/vendor/phpstan/phpdoc-parser/src/Ast/Node.php +++ /dev/null @@ -1,10 +0,0 @@ -description = $description; - } - - - public function __toString(): string - { - return trim($this->description); - } - -} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/GenericTagValueNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/GenericTagValueNode.php deleted file mode 100644 index 97518ab..0000000 --- a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/GenericTagValueNode.php +++ /dev/null @@ -1,22 +0,0 @@ -value = $value; - } - - - public function __toString(): string - { - return $this->value; - } - -} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/InvalidTagValueNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/InvalidTagValueNode.php deleted file mode 100644 index 150acae..0000000 --- a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/InvalidTagValueNode.php +++ /dev/null @@ -1,26 +0,0 @@ -value = $value; - $this->exception = $exception; - } - - - public function __toString(): string - { - return $this->value; - } - -} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/MethodTagValueNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/MethodTagValueNode.php deleted file mode 100644 index d7b4590..0000000 --- a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/MethodTagValueNode.php +++ /dev/null @@ -1,44 +0,0 @@ -isStatic = $isStatic; - $this->returnType = $returnType; - $this->methodName = $methodName; - $this->parameters = $parameters; - $this->description = $description; - } - - - public function __toString(): string - { - $static = $this->isStatic ? 'static ' : ''; - $returnType = $this->returnType ? "{$this->returnType} " : ''; - $parameters = implode(', ', $this->parameters); - $description = $this->description !== '' ? " {$this->description}" : ''; - return "{$static}{$returnType}{$this->methodName}({$parameters}){$description}"; - } - -} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/MethodTagValueParameterNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/MethodTagValueParameterNode.php deleted file mode 100644 index 87c7679..0000000 --- a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/MethodTagValueParameterNode.php +++ /dev/null @@ -1,46 +0,0 @@ -type = $type; - $this->isReference = $isReference; - $this->isVariadic = $isVariadic; - $this->parameterName = $parameterName; - $this->defaultValue = $defaultValue; - } - - - public function __toString(): string - { - $type = $this->type ? "{$this->type} " : ''; - $isReference = $this->isReference ? '&' : ''; - $isVariadic = $this->isVariadic ? '...' : ''; - $default = $this->defaultValue ? " = {$this->defaultValue}" : ''; - return "{$type}{$isReference}{$isVariadic}{$this->parameterName}{$default}"; - } - -} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ParamTagValueNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ParamTagValueNode.php deleted file mode 100644 index 04710a7..0000000 --- a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ParamTagValueNode.php +++ /dev/null @@ -1,37 +0,0 @@ -type = $type; - $this->isVariadic = $isVariadic; - $this->parameterName = $parameterName; - $this->description = $description; - } - - - public function __toString(): string - { - $variadic = $this->isVariadic ? '...' : ''; - return trim("{$this->type} {$variadic}{$this->parameterName} {$this->description}"); - } - -} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PhpDocChildNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PhpDocChildNode.php deleted file mode 100644 index 6162f92..0000000 --- a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PhpDocChildNode.php +++ /dev/null @@ -1,10 +0,0 @@ -children = $children; - } - - - /** - * @return PhpDocTagNode[] - */ - public function getTags(): array - { - return array_filter($this->children, static function (PhpDocChildNode $child): bool { - return $child instanceof PhpDocTagNode; - }); - } - - - /** - * @param string $tagName - * @return PhpDocTagNode[] - */ - public function getTagsByName(string $tagName): array - { - return array_filter($this->getTags(), static function (PhpDocTagNode $tag) use ($tagName): bool { - return $tag->name === $tagName; - }); - } - - - /** - * @return VarTagValueNode[] - */ - public function getVarTagValues(): array - { - return array_column( - array_filter($this->getTagsByName('@var'), static function (PhpDocTagNode $tag): bool { - return $tag->value instanceof VarTagValueNode; - }), - 'value' - ); - } - - - /** - * @return ParamTagValueNode[] - */ - public function getParamTagValues(): array - { - return array_column( - array_filter($this->getTagsByName('@param'), static function (PhpDocTagNode $tag): bool { - return $tag->value instanceof ParamTagValueNode; - }), - 'value' - ); - } - - - /** - * @return TemplateTagValueNode[] - */ - public function getTemplateTagValues(): array - { - return array_column( - array_filter($this->getTagsByName('@template'), static function (PhpDocTagNode $tag): bool { - return $tag->value instanceof TemplateTagValueNode; - }), - 'value' - ); - } - - - /** - * @return ReturnTagValueNode[] - */ - public function getReturnTagValues(): array - { - return array_column( - array_filter($this->getTagsByName('@return'), static function (PhpDocTagNode $tag): bool { - return $tag->value instanceof ReturnTagValueNode; - }), - 'value' - ); - } - - - /** - * @return ThrowsTagValueNode[] - */ - public function getThrowsTagValues(): array - { - return array_column( - array_filter($this->getTagsByName('@throws'), static function (PhpDocTagNode $tag): bool { - return $tag->value instanceof ThrowsTagValueNode; - }), - 'value' - ); - } - - - /** - * @return \PHPStan\PhpDocParser\Ast\PhpDoc\DeprecatedTagValueNode[] - */ - public function getDeprecatedTagValues(): array - { - return array_column( - array_filter($this->getTagsByName('@deprecated'), static function (PhpDocTagNode $tag): bool { - return $tag->value instanceof DeprecatedTagValueNode; - }), - 'value' - ); - } - - - /** - * @return PropertyTagValueNode[] - */ - public function getPropertyTagValues(): array - { - return array_column( - array_filter($this->getTagsByName('@property'), static function (PhpDocTagNode $tag): bool { - return $tag->value instanceof PropertyTagValueNode; - }), - 'value' - ); - } - - - /** - * @return PropertyTagValueNode[] - */ - public function getPropertyReadTagValues(): array - { - return array_column( - array_filter($this->getTagsByName('@property-read'), static function (PhpDocTagNode $tag): bool { - return $tag->value instanceof PropertyTagValueNode; - }), - 'value' - ); - } - - - /** - * @return PropertyTagValueNode[] - */ - public function getPropertyWriteTagValues(): array - { - return array_column( - array_filter($this->getTagsByName('@property-write'), static function (PhpDocTagNode $tag): bool { - return $tag->value instanceof PropertyTagValueNode; - }), - 'value' - ); - } - - - /** - * @return MethodTagValueNode[] - */ - public function getMethodTagValues(): array - { - return array_column( - array_filter($this->getTagsByName('@method'), static function (PhpDocTagNode $tag): bool { - return $tag->value instanceof MethodTagValueNode; - }), - 'value' - ); - } - - - public function __toString(): string - { - return "/**\n * " . implode("\n * ", $this->children) . '*/'; - } - -} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PhpDocTagNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PhpDocTagNode.php deleted file mode 100644 index be3043b..0000000 --- a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PhpDocTagNode.php +++ /dev/null @@ -1,26 +0,0 @@ -name = $name; - $this->value = $value; - } - - - public function __toString(): string - { - return trim("{$this->name} {$this->value}"); - } - -} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PhpDocTagValueNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PhpDocTagValueNode.php deleted file mode 100644 index 7723fa0..0000000 --- a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PhpDocTagValueNode.php +++ /dev/null @@ -1,10 +0,0 @@ -text = $text; - } - - - public function __toString(): string - { - return $this->text; - } - -} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PropertyTagValueNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PropertyTagValueNode.php deleted file mode 100644 index bca55a7..0000000 --- a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PropertyTagValueNode.php +++ /dev/null @@ -1,32 +0,0 @@ -type = $type; - $this->propertyName = $propertyName; - $this->description = $description; - } - - - public function __toString(): string - { - return trim("{$this->type} {$this->propertyName} {$this->description}"); - } - -} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ReturnTagValueNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ReturnTagValueNode.php deleted file mode 100644 index 254d3f8..0000000 --- a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ReturnTagValueNode.php +++ /dev/null @@ -1,28 +0,0 @@ -type = $type; - $this->description = $description; - } - - - public function __toString(): string - { - return trim("{$this->type} {$this->description}"); - } - -} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/TemplateTagValueNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/TemplateTagValueNode.php deleted file mode 100644 index 4030e88..0000000 --- a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/TemplateTagValueNode.php +++ /dev/null @@ -1,32 +0,0 @@ -name = $name; - $this->bound = $bound; - $this->description = $description; - } - - - public function __toString(): string - { - return trim("{$this->name} of {$this->bound} {$this->description}"); - } - -} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ThrowsTagValueNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ThrowsTagValueNode.php deleted file mode 100644 index 32ae12d..0000000 --- a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ThrowsTagValueNode.php +++ /dev/null @@ -1,28 +0,0 @@ -type = $type; - $this->description = $description; - } - - - public function __toString(): string - { - return trim("{$this->type} {$this->description}"); - } - -} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/VarTagValueNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/VarTagValueNode.php deleted file mode 100644 index 2965ce7..0000000 --- a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/VarTagValueNode.php +++ /dev/null @@ -1,32 +0,0 @@ -type = $type; - $this->variableName = $variableName; - $this->description = $description; - } - - - public function __toString(): string - { - return trim("$this->type " . trim("{$this->variableName} {$this->description}")); - } - -} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/Type/ArrayShapeItemNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/Type/ArrayShapeItemNode.php deleted file mode 100644 index ccbab37..0000000 --- a/vendor/phpstan/phpdoc-parser/src/Ast/Type/ArrayShapeItemNode.php +++ /dev/null @@ -1,44 +0,0 @@ -keyName = $keyName; - $this->optional = $optional; - $this->valueType = $valueType; - } - - - public function __toString(): string - { - if ($this->keyName !== null) { - return sprintf( - '%s%s: %s', - (string) $this->keyName, - $this->optional ? '?' : '', - (string) $this->valueType - ); - } - - return (string) $this->valueType; - } - -} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/Type/ArrayShapeNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/Type/ArrayShapeNode.php deleted file mode 100644 index 74df4ab..0000000 --- a/vendor/phpstan/phpdoc-parser/src/Ast/Type/ArrayShapeNode.php +++ /dev/null @@ -1,22 +0,0 @@ -items = $items; - } - - - public function __toString(): string - { - return 'array{' . implode(', ', $this->items) . '}'; - } - -} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/Type/ArrayTypeNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/Type/ArrayTypeNode.php deleted file mode 100644 index b01d083..0000000 --- a/vendor/phpstan/phpdoc-parser/src/Ast/Type/ArrayTypeNode.php +++ /dev/null @@ -1,22 +0,0 @@ -type = $type; - } - - - public function __toString(): string - { - return $this->type . '[]'; - } - -} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/Type/CallableTypeNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/Type/CallableTypeNode.php deleted file mode 100644 index 2f4bf7c..0000000 --- a/vendor/phpstan/phpdoc-parser/src/Ast/Type/CallableTypeNode.php +++ /dev/null @@ -1,31 +0,0 @@ -identifier = $identifier; - $this->parameters = $parameters; - $this->returnType = $returnType; - } - - - public function __toString(): string - { - $parameters = implode(', ', $this->parameters); - return "{$this->identifier}({$parameters}): {$this->returnType}"; - } - -} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/Type/CallableTypeParameterNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/Type/CallableTypeParameterNode.php deleted file mode 100644 index 3503318..0000000 --- a/vendor/phpstan/phpdoc-parser/src/Ast/Type/CallableTypeParameterNode.php +++ /dev/null @@ -1,44 +0,0 @@ -type = $type; - $this->isReference = $isReference; - $this->isVariadic = $isVariadic; - $this->parameterName = $parameterName; - $this->isOptional = $isOptional; - } - - - public function __toString(): string - { - $type = "{$this->type} "; - $isReference = $this->isReference ? '&' : ''; - $isVariadic = $this->isVariadic ? '...' : ''; - $default = $this->isOptional ? ' = default' : ''; - return "{$type}{$isReference}{$isVariadic}{$this->parameterName}{$default}"; - } - -} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/Type/GenericTypeNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/Type/GenericTypeNode.php deleted file mode 100644 index 4dcc9c8..0000000 --- a/vendor/phpstan/phpdoc-parser/src/Ast/Type/GenericTypeNode.php +++ /dev/null @@ -1,26 +0,0 @@ -type = $type; - $this->genericTypes = $genericTypes; - } - - - public function __toString(): string - { - return $this->type . '<' . implode(', ', $this->genericTypes) . '>'; - } - -} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/Type/IdentifierTypeNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/Type/IdentifierTypeNode.php deleted file mode 100644 index 9ca389c..0000000 --- a/vendor/phpstan/phpdoc-parser/src/Ast/Type/IdentifierTypeNode.php +++ /dev/null @@ -1,22 +0,0 @@ -name = $name; - } - - - public function __toString(): string - { - return $this->name; - } - -} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/Type/IntersectionTypeNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/Type/IntersectionTypeNode.php deleted file mode 100644 index 6034118..0000000 --- a/vendor/phpstan/phpdoc-parser/src/Ast/Type/IntersectionTypeNode.php +++ /dev/null @@ -1,22 +0,0 @@ -types = $types; - } - - - public function __toString(): string - { - return '(' . implode(' & ', $this->types) . ')'; - } - -} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/Type/NullableTypeNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/Type/NullableTypeNode.php deleted file mode 100644 index 98c7364..0000000 --- a/vendor/phpstan/phpdoc-parser/src/Ast/Type/NullableTypeNode.php +++ /dev/null @@ -1,22 +0,0 @@ -type = $type; - } - - - public function __toString(): string - { - return '?' . $this->type; - } - -} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/Type/ThisTypeNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/Type/ThisTypeNode.php deleted file mode 100644 index 06a3537..0000000 --- a/vendor/phpstan/phpdoc-parser/src/Ast/Type/ThisTypeNode.php +++ /dev/null @@ -1,13 +0,0 @@ -types = $types; - } - - - public function __toString(): string - { - return '(' . implode(' | ', $this->types) . ')'; - } - -} diff --git a/vendor/phpstan/phpdoc-parser/src/Lexer/Lexer.php b/vendor/phpstan/phpdoc-parser/src/Lexer/Lexer.php deleted file mode 100644 index a8fe3d8..0000000 --- a/vendor/phpstan/phpdoc-parser/src/Lexer/Lexer.php +++ /dev/null @@ -1,164 +0,0 @@ - '\'&\'', - self::TOKEN_UNION => '\'|\'', - self::TOKEN_INTERSECTION => '\'&\'', - self::TOKEN_NULLABLE => '\'?\'', - self::TOKEN_OPEN_PARENTHESES => '\'(\'', - self::TOKEN_CLOSE_PARENTHESES => '\')\'', - self::TOKEN_OPEN_ANGLE_BRACKET => '\'<\'', - self::TOKEN_CLOSE_ANGLE_BRACKET => '\'>\'', - self::TOKEN_OPEN_SQUARE_BRACKET => '\'[\'', - self::TOKEN_CLOSE_SQUARE_BRACKET => '\']\'', - self::TOKEN_OPEN_CURLY_BRACKET => '\'{\'', - self::TOKEN_CLOSE_CURLY_BRACKET => '\'}\'', - self::TOKEN_COMMA => '\',\'', - self::TOKEN_COLON => '\':\'', - self::TOKEN_VARIADIC => '\'...\'', - self::TOKEN_DOUBLE_COLON => '\'::\'', - self::TOKEN_DOUBLE_ARROW => '\'=>\'', - self::TOKEN_EQUAL => '\'=\'', - self::TOKEN_OPEN_PHPDOC => '\'/**\'', - self::TOKEN_CLOSE_PHPDOC => '\'*/\'', - self::TOKEN_PHPDOC_TAG => 'TOKEN_PHPDOC_TAG', - self::TOKEN_PHPDOC_EOL => 'TOKEN_PHPDOC_EOL', - self::TOKEN_FLOAT => 'TOKEN_FLOAT', - self::TOKEN_INTEGER => 'TOKEN_INTEGER', - self::TOKEN_SINGLE_QUOTED_STRING => 'TOKEN_SINGLE_QUOTED_STRING', - self::TOKEN_DOUBLE_QUOTED_STRING => 'TOKEN_DOUBLE_QUOTED_STRING', - self::TOKEN_IDENTIFIER => 'TOKEN_IDENTIFIER', - self::TOKEN_THIS_VARIABLE => '\'$this\'', - self::TOKEN_VARIABLE => 'TOKEN_VARIABLE', - self::TOKEN_HORIZONTAL_WS => 'TOKEN_HORIZONTAL_WS', - self::TOKEN_OTHER => 'TOKEN_OTHER', - self::TOKEN_END => 'TOKEN_END', - ]; - - public const VALUE_OFFSET = 0; - public const TYPE_OFFSET = 1; - - /** @var string|null */ - private $regexp; - - /** @var int[]|null */ - private $types; - - public function tokenize(string $s): array - { - if ($this->regexp === null || $this->types === null) { - $this->initialize(); - } - - assert($this->regexp !== null); - assert($this->types !== null); - - preg_match_all($this->regexp, $s, $tokens, PREG_SET_ORDER); - - $count = count($this->types); - foreach ($tokens as &$match) { - for ($i = 1; $i <= $count; $i++) { - if ($match[$i] !== null && $match[$i] !== '') { - $match = [$match[0], $this->types[$i - 1]]; - break; - } - } - } - - $tokens[] = ['', self::TOKEN_END]; - - return $tokens; - } - - - private function initialize(): void - { - $patterns = [ - // '&' followed by TOKEN_VARIADIC, TOKEN_VARIABLE, TOKEN_EQUAL, TOKEN_EQUAL or TOKEN_CLOSE_PARENTHESES - self::TOKEN_REFERENCE => '&(?=\\s*+(?:[.,=)]|(?:\\$(?!this(?![0-9a-z_\\x80-\\xFF])))))', - self::TOKEN_UNION => '\\|', - self::TOKEN_INTERSECTION => '&', - self::TOKEN_NULLABLE => '\\?', - - self::TOKEN_OPEN_PARENTHESES => '\\(', - self::TOKEN_CLOSE_PARENTHESES => '\\)', - self::TOKEN_OPEN_ANGLE_BRACKET => '<', - self::TOKEN_CLOSE_ANGLE_BRACKET => '>', - self::TOKEN_OPEN_SQUARE_BRACKET => '\\[', - self::TOKEN_CLOSE_SQUARE_BRACKET => '\\]', - self::TOKEN_OPEN_CURLY_BRACKET => '\\{', - self::TOKEN_CLOSE_CURLY_BRACKET => '\\}', - - self::TOKEN_COMMA => ',', - self::TOKEN_VARIADIC => '\\.\\.\\.', - self::TOKEN_DOUBLE_COLON => '::', - self::TOKEN_DOUBLE_ARROW => '=>', - self::TOKEN_EQUAL => '=', - self::TOKEN_COLON => ':', - - self::TOKEN_OPEN_PHPDOC => '/\\*\\*(?=\\s)', - self::TOKEN_CLOSE_PHPDOC => '\\*/', - self::TOKEN_PHPDOC_TAG => '@[a-z-]++', - self::TOKEN_PHPDOC_EOL => '\\r?+\\n[\\x09\\x20]*+(?:\\*(?!/))?', - - self::TOKEN_FLOAT => '(?:-?[0-9]++\\.[0-9]*+(?:e-?[0-9]++)?)|(?:-?[0-9]*+\\.[0-9]++(?:e-?[0-9]++)?)|(?:-?[0-9]++e-?[0-9]++)', - self::TOKEN_INTEGER => '-?(?:(?:0b[0-1]++)|(?:0o[0-7]++)|(?:0x[0-9a-f]++)|(?:[0-9]++))', - self::TOKEN_SINGLE_QUOTED_STRING => '\'(?:\\\\[^\\r\\n]|[^\'\\r\\n\\\\])*+\'', - self::TOKEN_DOUBLE_QUOTED_STRING => '"(?:\\\\[^\\r\\n]|[^"\\r\\n\\\\])*+"', - - self::TOKEN_IDENTIFIER => '(?:[\\\\]?+[a-z_\\x80-\\xFF][0-9a-z_\\x80-\\xFF]*+)++', - self::TOKEN_THIS_VARIABLE => '\\$this(?![0-9a-z_\\x80-\\xFF])', - self::TOKEN_VARIABLE => '\\$[a-z_\\x80-\\xFF][0-9a-z_\\x80-\\xFF]*+', - - self::TOKEN_HORIZONTAL_WS => '[\\x09\\x20]++', - - // anything but TOKEN_CLOSE_PHPDOC or TOKEN_HORIZONTAL_WS or TOKEN_EOL - self::TOKEN_OTHER => '(?:(?!\\*/)[^\\s])++', - ]; - - $this->regexp = '~(' . implode(')|(', $patterns) . ')~Asi'; - $this->types = array_keys($patterns); - } - -} diff --git a/vendor/phpstan/phpdoc-parser/src/Parser/ConstExprParser.php b/vendor/phpstan/phpdoc-parser/src/Parser/ConstExprParser.php deleted file mode 100644 index 3cb92ba..0000000 --- a/vendor/phpstan/phpdoc-parser/src/Parser/ConstExprParser.php +++ /dev/null @@ -1,97 +0,0 @@ -isCurrentTokenType(Lexer::TOKEN_FLOAT)) { - $value = $tokens->currentTokenValue(); - $tokens->next(); - return new Ast\ConstExpr\ConstExprFloatNode($value); - - } elseif ($tokens->isCurrentTokenType(Lexer::TOKEN_INTEGER)) { - $value = $tokens->currentTokenValue(); - $tokens->next(); - return new Ast\ConstExpr\ConstExprIntegerNode($value); - - } elseif ($tokens->isCurrentTokenType(Lexer::TOKEN_SINGLE_QUOTED_STRING)) { - $value = $tokens->currentTokenValue(); - $tokens->next(); - return new Ast\ConstExpr\ConstExprStringNode($value); - - } elseif ($tokens->isCurrentTokenType(Lexer::TOKEN_DOUBLE_QUOTED_STRING)) { - $value = $tokens->currentTokenValue(); - $tokens->next(); - return new Ast\ConstExpr\ConstExprStringNode($value); - - } elseif ($tokens->isCurrentTokenType(Lexer::TOKEN_IDENTIFIER)) { - $identifier = $tokens->currentTokenValue(); - $tokens->next(); - - switch (strtolower($identifier)) { - case 'true': - return new Ast\ConstExpr\ConstExprTrueNode(); - case 'false': - return new Ast\ConstExpr\ConstExprFalseNode(); - case 'null': - return new Ast\ConstExpr\ConstExprNullNode(); - case 'array': - $tokens->consumeTokenType(Lexer::TOKEN_OPEN_PARENTHESES); - return $this->parseArray($tokens, Lexer::TOKEN_CLOSE_PARENTHESES); - } - - if ($tokens->tryConsumeTokenType(Lexer::TOKEN_DOUBLE_COLON)) { - $classConstantName = $tokens->currentTokenValue(); - $tokens->consumeTokenType(Lexer::TOKEN_IDENTIFIER); - return new Ast\ConstExpr\ConstFetchNode($identifier, $classConstantName); - - } - - return new Ast\ConstExpr\ConstFetchNode('', $identifier); - - } elseif ($tokens->tryConsumeTokenType(Lexer::TOKEN_OPEN_SQUARE_BRACKET)) { - return $this->parseArray($tokens, Lexer::TOKEN_CLOSE_SQUARE_BRACKET); - } - - throw new \LogicException($tokens->currentTokenValue()); - } - - - private function parseArray(TokenIterator $tokens, int $endToken): Ast\ConstExpr\ConstExprArrayNode - { - $items = []; - - if (!$tokens->tryConsumeTokenType($endToken)) { - do { - $items[] = $this->parseArrayItem($tokens); - } while ($tokens->tryConsumeTokenType(Lexer::TOKEN_COMMA) && !$tokens->isCurrentTokenType($endToken)); - $tokens->consumeTokenType($endToken); - } - - return new Ast\ConstExpr\ConstExprArrayNode($items); - } - - - private function parseArrayItem(TokenIterator $tokens): Ast\ConstExpr\ConstExprArrayItemNode - { - $expr = $this->parse($tokens); - - if ($tokens->tryConsumeTokenType(Lexer::TOKEN_DOUBLE_ARROW)) { - $key = $expr; - $value = $this->parse($tokens); - - } else { - $key = null; - $value = $expr; - } - - return new Ast\ConstExpr\ConstExprArrayItemNode($key, $value); - } - -} diff --git a/vendor/phpstan/phpdoc-parser/src/Parser/ParserException.php b/vendor/phpstan/phpdoc-parser/src/Parser/ParserException.php deleted file mode 100644 index d6fd6fe..0000000 --- a/vendor/phpstan/phpdoc-parser/src/Parser/ParserException.php +++ /dev/null @@ -1,69 +0,0 @@ -currentTokenValue = $currentTokenValue; - $this->currentTokenType = $currentTokenType; - $this->currentOffset = $currentOffset; - $this->expectedTokenType = $expectedTokenType; - - $json = json_encode($currentTokenValue, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); - assert($json !== false); - - parent::__construct(sprintf( - 'Unexpected token %s, expected %s at offset %d', - $json, - Lexer::TOKEN_LABELS[$expectedTokenType], - $currentOffset - )); - } - - - public function getCurrentTokenValue(): string - { - return $this->currentTokenValue; - } - - - public function getCurrentTokenType(): int - { - return $this->currentTokenType; - } - - - public function getCurrentOffset(): int - { - return $this->currentOffset; - } - - - public function getExpectedTokenType(): int - { - return $this->expectedTokenType; - } - -} diff --git a/vendor/phpstan/phpdoc-parser/src/Parser/PhpDocParser.php b/vendor/phpstan/phpdoc-parser/src/Parser/PhpDocParser.php deleted file mode 100644 index ae93095..0000000 --- a/vendor/phpstan/phpdoc-parser/src/Parser/PhpDocParser.php +++ /dev/null @@ -1,333 +0,0 @@ -typeParser = $typeParser; - $this->constantExprParser = $constantExprParser; - } - - - public function parse(TokenIterator $tokens): Ast\PhpDoc\PhpDocNode - { - $tokens->consumeTokenType(Lexer::TOKEN_OPEN_PHPDOC); - $tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL); - - $children = []; - - if (!$tokens->isCurrentTokenType(Lexer::TOKEN_CLOSE_PHPDOC)) { - $children[] = $this->parseChild($tokens); - while ($tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL) && !$tokens->isCurrentTokenType(Lexer::TOKEN_CLOSE_PHPDOC)) { - $children[] = $this->parseChild($tokens); - } - } - - $tokens->consumeTokenType(Lexer::TOKEN_CLOSE_PHPDOC); - - return new Ast\PhpDoc\PhpDocNode(array_values($children)); - } - - - private function parseChild(TokenIterator $tokens): Ast\PhpDoc\PhpDocChildNode - { - if ($tokens->isCurrentTokenType(Lexer::TOKEN_PHPDOC_TAG)) { - return $this->parseTag($tokens); - - } - - return $this->parseText($tokens); - } - - - private function parseText(TokenIterator $tokens): Ast\PhpDoc\PhpDocTextNode - { - $text = ''; - while (true) { - // If we received a Lexer::TOKEN_PHPDOC_EOL, exit early to prevent - // them from being processed. - if ($tokens->currentTokenType() === Lexer::TOKEN_PHPDOC_EOL) { - break; - } - $text .= $tokens->joinUntil(Lexer::TOKEN_PHPDOC_EOL, Lexer::TOKEN_CLOSE_PHPDOC, Lexer::TOKEN_END); - $text = rtrim($text, " \t"); - - // If we joined until TOKEN_PHPDOC_EOL, peak at the next tokens to see - // if we have a multiline string to join. - if ($tokens->currentTokenType() !== Lexer::TOKEN_PHPDOC_EOL) { - break; - } - - // Peek at the next token to determine if it is more text that needs - // to be combined. - $tokens->pushSavePoint(); - $tokens->next(); - if ($tokens->currentTokenType() !== Lexer::TOKEN_IDENTIFIER) { - $tokens->rollback(); - break; - } - - // There's more text on a new line, ensure spacing. - $text .= "\n"; - } - $text = trim($text, " \t"); - - return new Ast\PhpDoc\PhpDocTextNode($text); - } - - - public function parseTag(TokenIterator $tokens): Ast\PhpDoc\PhpDocTagNode - { - $tag = $tokens->currentTokenValue(); - $tokens->next(); - $value = $this->parseTagValue($tokens, $tag); - - return new Ast\PhpDoc\PhpDocTagNode($tag, $value); - } - - - public function parseTagValue(TokenIterator $tokens, string $tag): Ast\PhpDoc\PhpDocTagValueNode - { - try { - $tokens->pushSavePoint(); - - switch ($tag) { - case '@param': - $tagValue = $this->parseParamTagValue($tokens); - break; - - case '@var': - $tagValue = $this->parseVarTagValue($tokens); - break; - - case '@return': - $tagValue = $this->parseReturnTagValue($tokens); - break; - - case '@throws': - $tagValue = $this->parseThrowsTagValue($tokens); - break; - - case '@deprecated': - $tagValue = $this->parseDeprecatedTagValue($tokens); - break; - - case '@property': - case '@property-read': - case '@property-write': - $tagValue = $this->parsePropertyTagValue($tokens); - break; - - case '@method': - $tagValue = $this->parseMethodTagValue($tokens); - break; - - case '@template': - $tagValue = $this->parseTemplateTagValue($tokens); - break; - - default: - $tagValue = new Ast\PhpDoc\GenericTagValueNode($this->parseOptionalDescription($tokens)); - break; - } - - $tokens->dropSavePoint(); - - } catch (\PHPStan\PhpDocParser\Parser\ParserException $e) { - $tokens->rollback(); - $tagValue = new Ast\PhpDoc\InvalidTagValueNode($this->parseOptionalDescription($tokens), $e); - } - - return $tagValue; - } - - - private function parseParamTagValue(TokenIterator $tokens): Ast\PhpDoc\ParamTagValueNode - { - $type = $this->typeParser->parse($tokens); - $isVariadic = $tokens->tryConsumeTokenType(Lexer::TOKEN_VARIADIC); - $parameterName = $this->parseRequiredVariableName($tokens); - $description = $this->parseOptionalDescription($tokens); - return new Ast\PhpDoc\ParamTagValueNode($type, $isVariadic, $parameterName, $description); - } - - - private function parseVarTagValue(TokenIterator $tokens): Ast\PhpDoc\VarTagValueNode - { - $type = $this->typeParser->parse($tokens); - $variableName = $this->parseOptionalVariableName($tokens); - $description = $this->parseOptionalDescription($tokens, $variableName === ''); - return new Ast\PhpDoc\VarTagValueNode($type, $variableName, $description); - } - - - private function parseReturnTagValue(TokenIterator $tokens): Ast\PhpDoc\ReturnTagValueNode - { - $type = $this->typeParser->parse($tokens); - $description = $this->parseOptionalDescription($tokens, true); - return new Ast\PhpDoc\ReturnTagValueNode($type, $description); - } - - - private function parseThrowsTagValue(TokenIterator $tokens): Ast\PhpDoc\ThrowsTagValueNode - { - $type = $this->typeParser->parse($tokens); - $description = $this->parseOptionalDescription($tokens, true); - return new Ast\PhpDoc\ThrowsTagValueNode($type, $description); - } - - private function parseDeprecatedTagValue(TokenIterator $tokens): Ast\PhpDoc\DeprecatedTagValueNode - { - $description = $this->parseOptionalDescription($tokens); - return new Ast\PhpDoc\DeprecatedTagValueNode($description); - } - - - private function parsePropertyTagValue(TokenIterator $tokens): Ast\PhpDoc\PropertyTagValueNode - { - $type = $this->typeParser->parse($tokens); - $parameterName = $this->parseRequiredVariableName($tokens); - $description = $this->parseOptionalDescription($tokens); - return new Ast\PhpDoc\PropertyTagValueNode($type, $parameterName, $description); - } - - - private function parseMethodTagValue(TokenIterator $tokens): Ast\PhpDoc\MethodTagValueNode - { - $isStatic = $tokens->tryConsumeTokenValue('static'); - $returnTypeOrMethodName = $this->typeParser->parse($tokens); - - if ($tokens->isCurrentTokenType(Lexer::TOKEN_IDENTIFIER)) { - $returnType = $returnTypeOrMethodName; - $methodName = $tokens->currentTokenValue(); - $tokens->next(); - - } elseif ($returnTypeOrMethodName instanceof Ast\Type\IdentifierTypeNode) { - $returnType = $isStatic ? new Ast\Type\IdentifierTypeNode('static') : null; - $methodName = $returnTypeOrMethodName->name; - $isStatic = false; - - } else { - $tokens->consumeTokenType(Lexer::TOKEN_IDENTIFIER); // will throw exception - exit; - } - - $parameters = []; - $tokens->consumeTokenType(Lexer::TOKEN_OPEN_PARENTHESES); - if (!$tokens->isCurrentTokenType(Lexer::TOKEN_CLOSE_PARENTHESES)) { - $parameters[] = $this->parseMethodTagValueParameter($tokens); - while ($tokens->tryConsumeTokenType(Lexer::TOKEN_COMMA)) { - $parameters[] = $this->parseMethodTagValueParameter($tokens); - } - } - $tokens->consumeTokenType(Lexer::TOKEN_CLOSE_PARENTHESES); - - $description = $this->parseOptionalDescription($tokens); - return new Ast\PhpDoc\MethodTagValueNode($isStatic, $returnType, $methodName, $parameters, $description); - } - - - private function parseMethodTagValueParameter(TokenIterator $tokens): Ast\PhpDoc\MethodTagValueParameterNode - { - switch ($tokens->currentTokenType()) { - case Lexer::TOKEN_IDENTIFIER: - case Lexer::TOKEN_OPEN_PARENTHESES: - case Lexer::TOKEN_NULLABLE: - $parameterType = $this->typeParser->parse($tokens); - break; - - default: - $parameterType = null; - } - - $isReference = $tokens->tryConsumeTokenType(Lexer::TOKEN_REFERENCE); - $isVariadic = $tokens->tryConsumeTokenType(Lexer::TOKEN_VARIADIC); - - $parameterName = $tokens->currentTokenValue(); - $tokens->consumeTokenType(Lexer::TOKEN_VARIABLE); - - if ($tokens->tryConsumeTokenType(Lexer::TOKEN_EQUAL)) { - $defaultValue = $this->constantExprParser->parse($tokens); - - } else { - $defaultValue = null; - } - - return new Ast\PhpDoc\MethodTagValueParameterNode($parameterType, $isReference, $isVariadic, $parameterName, $defaultValue); - } - - private function parseTemplateTagValue(TokenIterator $tokens): Ast\PhpDoc\TemplateTagValueNode - { - $name = $tokens->currentTokenValue(); - $tokens->consumeTokenType(Lexer::TOKEN_IDENTIFIER); - - if ($tokens->tryConsumeTokenValue('of')) { - $bound = $this->typeParser->parse($tokens); - - } else { - $bound = new IdentifierTypeNode('mixed'); - } - - $description = $this->parseOptionalDescription($tokens); - - return new Ast\PhpDoc\TemplateTagValueNode($name, $bound, $description); - } - - private function parseOptionalVariableName(TokenIterator $tokens): string - { - if ($tokens->isCurrentTokenType(Lexer::TOKEN_VARIABLE)) { - $parameterName = $tokens->currentTokenValue(); - $tokens->next(); - - } else { - $parameterName = ''; - } - - return $parameterName; - } - - - private function parseRequiredVariableName(TokenIterator $tokens): string - { - $parameterName = $tokens->currentTokenValue(); - $tokens->consumeTokenType(Lexer::TOKEN_VARIABLE); - - return $parameterName; - } - - - private function parseOptionalDescription(TokenIterator $tokens, bool $limitStartToken = false): string - { - if ($limitStartToken) { - foreach (self::DISALLOWED_DESCRIPTION_START_TOKENS as $disallowedStartToken) { - if (!$tokens->isCurrentTokenType($disallowedStartToken)) { - continue; - } - - $tokens->consumeTokenType(Lexer::TOKEN_OTHER); // will throw exception - } - } - - return $this->parseText($tokens)->text; - } - -} diff --git a/vendor/phpstan/phpdoc-parser/src/Parser/TokenIterator.php b/vendor/phpstan/phpdoc-parser/src/Parser/TokenIterator.php deleted file mode 100644 index 05fe5d7..0000000 --- a/vendor/phpstan/phpdoc-parser/src/Parser/TokenIterator.php +++ /dev/null @@ -1,191 +0,0 @@ -tokens = $tokens; - $this->index = $index; - - if ($this->tokens[$this->index][Lexer::TYPE_OFFSET] !== Lexer::TOKEN_HORIZONTAL_WS) { - return; - } - - $this->index++; - } - - - public function currentTokenValue(): string - { - return $this->tokens[$this->index][Lexer::VALUE_OFFSET]; - } - - - public function currentTokenType(): int - { - return $this->tokens[$this->index][Lexer::TYPE_OFFSET]; - } - - - public function currentTokenOffset(): int - { - $offset = 0; - for ($i = 0; $i < $this->index; $i++) { - $offset += strlen($this->tokens[$i][Lexer::VALUE_OFFSET]); - } - - return $offset; - } - - - public function isCurrentTokenValue(string $tokenValue): bool - { - return $this->tokens[$this->index][Lexer::VALUE_OFFSET] === $tokenValue; - } - - - public function isCurrentTokenType(int $tokenType): bool - { - return $this->tokens[$this->index][Lexer::TYPE_OFFSET] === $tokenType; - } - - - public function isPrecededByHorizontalWhitespace(): bool - { - return ($this->tokens[$this->index - 1][Lexer::TYPE_OFFSET] ?? -1) === Lexer::TOKEN_HORIZONTAL_WS; - } - - - /** - * @param int $tokenType - * @throws \PHPStan\PhpDocParser\Parser\ParserException - */ - public function consumeTokenType(int $tokenType): void - { - if ($this->tokens[$this->index][Lexer::TYPE_OFFSET] !== $tokenType) { - $this->throwError($tokenType); - } - - $this->index++; - - if (($this->tokens[$this->index][Lexer::TYPE_OFFSET] ?? -1) !== Lexer::TOKEN_HORIZONTAL_WS) { - return; - } - - $this->index++; - } - - - public function tryConsumeTokenValue(string $tokenValue): bool - { - if ($this->tokens[$this->index][Lexer::VALUE_OFFSET] !== $tokenValue) { - return false; - } - - $this->index++; - - if ($this->tokens[$this->index][Lexer::TYPE_OFFSET] === Lexer::TOKEN_HORIZONTAL_WS) { - $this->index++; - } - - return true; - } - - - public function tryConsumeTokenType(int $tokenType): bool - { - if ($this->tokens[$this->index][Lexer::TYPE_OFFSET] !== $tokenType) { - return false; - } - - $this->index++; - - if ($this->tokens[$this->index][Lexer::TYPE_OFFSET] === Lexer::TOKEN_HORIZONTAL_WS) { - $this->index++; - } - - return true; - } - - - public function getSkippedHorizontalWhiteSpaceIfAny(): string - { - if ($this->tokens[$this->index - 1][Lexer::TYPE_OFFSET] === Lexer::TOKEN_HORIZONTAL_WS) { - return $this->tokens[$this->index - 1][Lexer::VALUE_OFFSET]; - } - - return ''; - } - - - public function joinUntil(int ...$tokenType): string - { - $s = ''; - while (!in_array($this->tokens[$this->index][Lexer::TYPE_OFFSET], $tokenType, true)) { - $s .= $this->tokens[$this->index++][Lexer::VALUE_OFFSET]; - } - return $s; - } - - - public function next(): void - { - $this->index++; - - if ($this->tokens[$this->index][Lexer::TYPE_OFFSET] !== Lexer::TOKEN_HORIZONTAL_WS) { - return; - } - - $this->index++; - } - - - public function pushSavePoint(): void - { - $this->savePoints[] = $this->index; - } - - - public function dropSavePoint(): void - { - array_pop($this->savePoints); - } - - - public function rollback(): void - { - $index = array_pop($this->savePoints); - assert($index !== null); - $this->index = $index; - } - - - /** - * @param int $expectedTokenType - * @throws \PHPStan\PhpDocParser\Parser\ParserException - */ - private function throwError(int $expectedTokenType): void - { - throw new \PHPStan\PhpDocParser\Parser\ParserException( - $this->currentTokenValue(), - $this->currentTokenType(), - $this->currentTokenOffset(), - $expectedTokenType - ); - } - -} diff --git a/vendor/phpstan/phpdoc-parser/src/Parser/TypeParser.php b/vendor/phpstan/phpdoc-parser/src/Parser/TypeParser.php deleted file mode 100644 index 5834517..0000000 --- a/vendor/phpstan/phpdoc-parser/src/Parser/TypeParser.php +++ /dev/null @@ -1,272 +0,0 @@ -isCurrentTokenType(Lexer::TOKEN_NULLABLE)) { - $type = $this->parseNullable($tokens); - - } else { - $type = $this->parseAtomic($tokens); - - if ($tokens->isCurrentTokenType(Lexer::TOKEN_UNION)) { - $type = $this->parseUnion($tokens, $type); - - } elseif ($tokens->isCurrentTokenType(Lexer::TOKEN_INTERSECTION)) { - $type = $this->parseIntersection($tokens, $type); - } - } - - return $type; - } - - - private function parseAtomic(TokenIterator $tokens): Ast\Type\TypeNode - { - if ($tokens->tryConsumeTokenType(Lexer::TOKEN_OPEN_PARENTHESES)) { - $type = $this->parse($tokens); - $tokens->consumeTokenType(Lexer::TOKEN_CLOSE_PARENTHESES); - - if ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_SQUARE_BRACKET)) { - $type = $this->tryParseArray($tokens, $type); - } - - } elseif ($tokens->tryConsumeTokenType(Lexer::TOKEN_THIS_VARIABLE)) { - return new Ast\Type\ThisTypeNode(); - - } else { - $type = new Ast\Type\IdentifierTypeNode($tokens->currentTokenValue()); - $tokens->consumeTokenType(Lexer::TOKEN_IDENTIFIER); - - if ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_ANGLE_BRACKET)) { - $type = $this->parseGeneric($tokens, $type); - - } elseif ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_PARENTHESES)) { - $type = $this->tryParseCallable($tokens, $type); - - } elseif ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_SQUARE_BRACKET)) { - $type = $this->tryParseArray($tokens, $type); - - } elseif ($type->name === 'array' && $tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_CURLY_BRACKET) && !$tokens->isPrecededByHorizontalWhitespace()) { - $type = $this->parseArrayShape($tokens, $type); - } - } - - return $type; - } - - - private function parseUnion(TokenIterator $tokens, Ast\Type\TypeNode $type): Ast\Type\TypeNode - { - $types = [$type]; - - while ($tokens->tryConsumeTokenType(Lexer::TOKEN_UNION)) { - $types[] = $this->parseAtomic($tokens); - } - - return new Ast\Type\UnionTypeNode($types); - } - - - private function parseIntersection(TokenIterator $tokens, Ast\Type\TypeNode $type): Ast\Type\TypeNode - { - $types = [$type]; - - while ($tokens->tryConsumeTokenType(Lexer::TOKEN_INTERSECTION)) { - $types[] = $this->parseAtomic($tokens); - } - - return new Ast\Type\IntersectionTypeNode($types); - } - - - private function parseNullable(TokenIterator $tokens): Ast\Type\TypeNode - { - $tokens->consumeTokenType(Lexer::TOKEN_NULLABLE); - - $type = new Ast\Type\IdentifierTypeNode($tokens->currentTokenValue()); - $tokens->consumeTokenType(Lexer::TOKEN_IDENTIFIER); - - if ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_ANGLE_BRACKET)) { - $type = $this->parseGeneric($tokens, $type); - - } elseif ($type->name === 'array' && $tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_CURLY_BRACKET) && !$tokens->isPrecededByHorizontalWhitespace()) { - $type = $this->parseArrayShape($tokens, $type); - } - - return new Ast\Type\NullableTypeNode($type); - } - - - private function parseGeneric(TokenIterator $tokens, Ast\Type\IdentifierTypeNode $baseType): Ast\Type\TypeNode - { - $tokens->consumeTokenType(Lexer::TOKEN_OPEN_ANGLE_BRACKET); - $genericTypes[] = $this->parse($tokens); - - while ($tokens->tryConsumeTokenType(Lexer::TOKEN_COMMA)) { - $genericTypes[] = $this->parse($tokens); - } - - $tokens->consumeTokenType(Lexer::TOKEN_CLOSE_ANGLE_BRACKET); - return new Ast\Type\GenericTypeNode($baseType, $genericTypes); - } - - - private function parseCallable(TokenIterator $tokens, Ast\Type\IdentifierTypeNode $identifier): Ast\Type\TypeNode - { - $tokens->consumeTokenType(Lexer::TOKEN_OPEN_PARENTHESES); - - $parameters = []; - if (!$tokens->isCurrentTokenType(Lexer::TOKEN_CLOSE_PARENTHESES)) { - $parameters[] = $this->parseCallableParameter($tokens); - while ($tokens->tryConsumeTokenType(Lexer::TOKEN_COMMA)) { - $parameters[] = $this->parseCallableParameter($tokens); - } - } - - $tokens->consumeTokenType(Lexer::TOKEN_CLOSE_PARENTHESES); - $tokens->consumeTokenType(Lexer::TOKEN_COLON); - $returnType = $this->parseCallableReturnType($tokens); - - return new Ast\Type\CallableTypeNode($identifier, $parameters, $returnType); - } - - - private function parseCallableParameter(TokenIterator $tokens): Ast\Type\CallableTypeParameterNode - { - $type = $this->parse($tokens); - $isReference = $tokens->tryConsumeTokenType(Lexer::TOKEN_REFERENCE); - $isVariadic = $tokens->tryConsumeTokenType(Lexer::TOKEN_VARIADIC); - - if ($tokens->isCurrentTokenType(Lexer::TOKEN_VARIABLE)) { - $parameterName = $tokens->currentTokenValue(); - $tokens->consumeTokenType(Lexer::TOKEN_VARIABLE); - - } else { - $parameterName = ''; - } - - $isOptional = $tokens->tryConsumeTokenType(Lexer::TOKEN_EQUAL); - return new Ast\Type\CallableTypeParameterNode($type, $isReference, $isVariadic, $parameterName, $isOptional); - } - - - private function parseCallableReturnType(TokenIterator $tokens): Ast\Type\TypeNode - { - if ($tokens->isCurrentTokenType(Lexer::TOKEN_NULLABLE)) { - $type = $this->parseNullable($tokens); - - } elseif ($tokens->tryConsumeTokenType(Lexer::TOKEN_OPEN_PARENTHESES)) { - $type = $this->parse($tokens); - $tokens->consumeTokenType(Lexer::TOKEN_CLOSE_PARENTHESES); - - } else { - $type = new Ast\Type\IdentifierTypeNode($tokens->currentTokenValue()); - $tokens->consumeTokenType(Lexer::TOKEN_IDENTIFIER); - - if ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_ANGLE_BRACKET)) { - $type = $this->parseGeneric($tokens, $type); - - } elseif ($type->name === 'array' && $tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_CURLY_BRACKET) && !$tokens->isPrecededByHorizontalWhitespace()) { - $type = $this->parseArrayShape($tokens, $type); - } - } - - return $type; - } - - - private function tryParseCallable(TokenIterator $tokens, Ast\Type\IdentifierTypeNode $identifier): Ast\Type\TypeNode - { - try { - $tokens->pushSavePoint(); - $type = $this->parseCallable($tokens, $identifier); - $tokens->dropSavePoint(); - - } catch (\PHPStan\PhpDocParser\Parser\ParserException $e) { - $tokens->rollback(); - $type = $identifier; - } - - return $type; - } - - - private function tryParseArray(TokenIterator $tokens, Ast\Type\TypeNode $type): Ast\Type\TypeNode - { - try { - while ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_SQUARE_BRACKET)) { - $tokens->pushSavePoint(); - $tokens->consumeTokenType(Lexer::TOKEN_OPEN_SQUARE_BRACKET); - $tokens->consumeTokenType(Lexer::TOKEN_CLOSE_SQUARE_BRACKET); - $tokens->dropSavePoint(); - $type = new Ast\Type\ArrayTypeNode($type); - } - - } catch (\PHPStan\PhpDocParser\Parser\ParserException $e) { - $tokens->rollback(); - } - - return $type; - } - - - private function parseArrayShape(TokenIterator $tokens, Ast\Type\TypeNode $type): Ast\Type\TypeNode - { - $tokens->consumeTokenType(Lexer::TOKEN_OPEN_CURLY_BRACKET); - $items = [$this->parseArrayShapeItem($tokens)]; - - while ($tokens->tryConsumeTokenType(Lexer::TOKEN_COMMA)) { - $items[] = $this->parseArrayShapeItem($tokens); - } - - $tokens->consumeTokenType(Lexer::TOKEN_CLOSE_CURLY_BRACKET); - - return new Ast\Type\ArrayShapeNode($items); - } - - - private function parseArrayShapeItem(TokenIterator $tokens): Ast\Type\ArrayShapeItemNode - { - try { - $tokens->pushSavePoint(); - $key = $this->parseArrayShapeKey($tokens); - $optional = $tokens->tryConsumeTokenType(Lexer::TOKEN_NULLABLE); - $tokens->consumeTokenType(Lexer::TOKEN_COLON); - $value = $this->parse($tokens); - $tokens->dropSavePoint(); - - return new Ast\Type\ArrayShapeItemNode($key, $optional, $value); - } catch (\PHPStan\PhpDocParser\Parser\ParserException $e) { - $tokens->rollback(); - $value = $this->parse($tokens); - - return new Ast\Type\ArrayShapeItemNode(null, false, $value); - } - } - - /** - * @return Ast\ConstExpr\ConstExprIntegerNode|Ast\Type\IdentifierTypeNode - */ - private function parseArrayShapeKey(TokenIterator $tokens) - { - if ($tokens->isCurrentTokenType(Lexer::TOKEN_INTEGER)) { - $key = new Ast\ConstExpr\ConstExprIntegerNode($tokens->currentTokenValue()); - $tokens->next(); - - } else { - $key = new Ast\Type\IdentifierTypeNode($tokens->currentTokenValue()); - $tokens->consumeTokenType(Lexer::TOKEN_IDENTIFIER); - } - - return $key; - } - -} diff --git a/vendor/phpstan/phpstan-mockery/.editorconfig b/vendor/phpstan/phpstan-mockery/.editorconfig deleted file mode 100644 index 5d66bc4..0000000 --- a/vendor/phpstan/phpstan-mockery/.editorconfig +++ /dev/null @@ -1,27 +0,0 @@ -root = true - -[*] -end_of_line = lf -insert_final_newline = true -charset = utf-8 -trim_trailing_whitespace = true - -[*.{php,phpt}] -indent_style = tab -indent_size = 4 - -[*.xml] -indent_style = tab -indent_size = 4 - -[*.neon] -indent_style = tab -indent_size = 4 - -[*.{yaml,yml}] -indent_style = space -indent_size = 2 - -[composer.json] -indent_style = tab -indent_size = 4 diff --git a/vendor/phpstan/phpstan-mockery/.gitattributes b/vendor/phpstan/phpstan-mockery/.gitattributes deleted file mode 100644 index 18e14aa..0000000 --- a/vendor/phpstan/phpstan-mockery/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -/tests export-ignore diff --git a/vendor/phpstan/phpstan-mockery/.gitignore b/vendor/phpstan/phpstan-mockery/.gitignore deleted file mode 100644 index ff72e2d..0000000 --- a/vendor/phpstan/phpstan-mockery/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/composer.lock -/vendor diff --git a/vendor/phpstan/phpstan-mockery/.travis.yml b/vendor/phpstan/phpstan-mockery/.travis.yml deleted file mode 100644 index 5dc4927..0000000 --- a/vendor/phpstan/phpstan-mockery/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -language: php -php: - - 7.1 - - 7.2 -env: - - dependencies=lowest - - dependencies=highest -before_script: - - composer self-update - - if [ "$dependencies" = "lowest" ]; then composer update --prefer-lowest --no-interaction; fi; - - if [ "$dependencies" = "highest" ]; then composer update --no-interaction; fi; -script: - - vendor/bin/phing - - > - wget https://github.com/maglnet/ComposerRequireChecker/releases/download/0.2.1/composer-require-checker.phar - && php composer-require-checker.phar check composer.json diff --git a/vendor/phpstan/phpstan-mockery/README.md b/vendor/phpstan/phpstan-mockery/README.md deleted file mode 100644 index 2523b0c..0000000 --- a/vendor/phpstan/phpstan-mockery/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# PHPStan Mockery extension - -[![Build Status](https://travis-ci.org/phpstan/phpstan-mockery.svg)](https://travis-ci.org/phpstan/phpstan-mockery) -[![Latest Stable Version](https://poser.pugx.org/phpstan/phpstan-mockery/v/stable)](https://packagist.org/packages/phpstan/phpstan-mockery) -[![License](https://poser.pugx.org/phpstan/phpstan-mockery/license)](https://packagist.org/packages/phpstan/phpstan-mockery) - -* [PHPStan](https://github.com/phpstan/phpstan) -* [Mockery](https://github.com/mockery/mockery) - -This extension provides the following features: - -* Interprets `Foo|\Mockery\MockInterface` in phpDoc so that it results in an intersection type instead of a union type. -* `Mockery::mock()` and `Mockery::spy()` return an intersection type (see the [detailed explanation of intersection types](https://medium.com/@ondrejmirtes/union-types-vs-intersection-types-fd44a8eacbb)) so that the returned object can be used as both the mock object and the mocked class object. -* `shouldReceive()`, `allows()` and `expects()` methods can be called on the mock object and they work as expected. - - -## Installation - -To use this extension, require it in [Composer](https://getcomposer.org/): - -``` -composer require --dev phpstan/phpstan-mockery -``` - -If you also install [phpstan/extension-installer](https://github.com/phpstan/extension-installer) then you're all set! - -
- Manual installation - -If you don't want to use `phpstan/extension-installer`, include extension.neon in your project's PHPStan config: - -``` -includes: - - vendor/phpstan/phpstan-mockery/extension.neon -``` -
diff --git a/vendor/phpstan/phpstan-mockery/build.xml b/vendor/phpstan/phpstan-mockery/build.xml deleted file mode 100644 index 9836241..0000000 --- a/vendor/phpstan/phpstan-mockery/build.xml +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/phpstan/phpstan-mockery/composer.json b/vendor/phpstan/phpstan-mockery/composer.json deleted file mode 100644 index d996163..0000000 --- a/vendor/phpstan/phpstan-mockery/composer.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "phpstan/phpstan-mockery", - "description": "PHPStan Mockery extension", - "type": "phpstan-extension", - "license": ["MIT"], - "minimum-stability": "dev", - "prefer-stable": true, - "extra": { - "branch-alias": { - "dev-master": "0.11-dev" - }, - "phpstan": { - "includes": [ - "extension.neon" - ] - } - }, - "require": { - "php": "~7.1", - "phpstan/phpstan": "^0.11.4", - "phpstan/phpdoc-parser": "^0.3", - "nikic/php-parser": "^4.0" - }, - "require-dev": { - "consistence/coding-standard": "^3.0.1", - "dealerdirect/phpcodesniffer-composer-installer": "^0.4.4", - "jakub-onderka/php-parallel-lint": "^1.0", - "mockery/mockery": "^1.1", - "phing/phing": "^2.16.0", - "phpstan/phpstan-strict-rules": "^0.11", - "phpstan/phpstan-phpunit": "^0.11", - "phpunit/phpunit": "^7.2", - "slevomat/coding-standard": "^4.6.3" - }, - "autoload": { - "psr-4": { - "PHPStan\\": "src/" - } - }, - "autoload-dev": { - "classmap": ["tests/"] - } -} diff --git a/vendor/phpstan/phpstan-mockery/extension.neon b/vendor/phpstan/phpstan-mockery/extension.neon deleted file mode 100644 index 63e91b9..0000000 --- a/vendor/phpstan/phpstan-mockery/extension.neon +++ /dev/null @@ -1,64 +0,0 @@ -services: - - - class: PHPStan\Mockery\Reflection\StubMethodsClassReflectionExtension - tags: - - phpstan.broker.methodsClassReflectionExtension - arguments: - stubInterfaceName: PHPStan\Mockery\Type\Allows - - - - class: PHPStan\Mockery\Reflection\StubMethodsClassReflectionExtension - tags: - - phpstan.broker.methodsClassReflectionExtension - arguments: - stubInterfaceName: PHPStan\Mockery\Type\Expects - - - - class: PHPStan\Mockery\Type\MakePartialDynamicReturnTypeExtension - tags: - - phpstan.broker.dynamicMethodReturnTypeExtension - - - - class: PHPStan\Mockery\Type\StubDynamicReturnTypeExtension - tags: - - phpstan.broker.dynamicMethodReturnTypeExtension - arguments: - stubInterfaceName: PHPStan\Mockery\Type\Allows - stubMethodName: allows - - - - class: PHPStan\Mockery\Type\StubDynamicReturnTypeExtension - tags: - - phpstan.broker.dynamicMethodReturnTypeExtension - arguments: - stubInterfaceName: PHPStan\Mockery\Type\Expects - stubMethodName: expects - - - - class: PHPStan\Mockery\Type\ExpectationAfterStubDynamicReturnTypeExtension - tags: - - phpstan.broker.dynamicMethodReturnTypeExtension - arguments: - stubInterfaceName: PHPStan\Mockery\Type\Allows - - - - class: PHPStan\Mockery\Type\ExpectationAfterStubDynamicReturnTypeExtension - tags: - - phpstan.broker.dynamicMethodReturnTypeExtension - arguments: - stubInterfaceName: PHPStan\Mockery\Type\Expects - - - - class: PHPStan\Mockery\Type\MockDynamicReturnTypeExtension - tags: - - phpstan.broker.dynamicStaticMethodReturnTypeExtension - - - - class: PHPStan\Mockery\Type\ShouldReceiveDynamicReturnTypeExtension - tags: - - phpstan.broker.dynamicMethodReturnTypeExtension - - - - class: PHPStan\Mockery\PhpDoc\TypeNodeResolverExtension - tags: - - phpstan.phpDoc.typeNodeResolverExtension diff --git a/vendor/phpstan/phpstan-mockery/phpcs.xml b/vendor/phpstan/phpstan-mockery/phpcs.xml deleted file mode 100644 index 0ba9e81..0000000 --- a/vendor/phpstan/phpstan-mockery/phpcs.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/phpstan/phpstan-mockery/phpstan.neon b/vendor/phpstan/phpstan-mockery/phpstan.neon deleted file mode 100644 index d53799b..0000000 --- a/vendor/phpstan/phpstan-mockery/phpstan.neon +++ /dev/null @@ -1,6 +0,0 @@ -includes: - - extension.neon - - vendor/phpstan/phpstan-phpunit/extension.neon - - vendor/phpstan/phpstan-phpunit/rules.neon - - vendor/phpstan/phpstan-strict-rules/rules.neon - - vendor/phpstan/phpstan/conf/bleedingEdge.neon diff --git a/vendor/phpstan/phpstan-mockery/src/Mockery/PhpDoc/TypeNodeResolverExtension.php b/vendor/phpstan/phpstan-mockery/src/Mockery/PhpDoc/TypeNodeResolverExtension.php deleted file mode 100644 index 47e7803..0000000 --- a/vendor/phpstan/phpstan-mockery/src/Mockery/PhpDoc/TypeNodeResolverExtension.php +++ /dev/null @@ -1,51 +0,0 @@ -typeNodeResolver = $typeNodeResolver; - } - - public function getCacheKey(): string - { - return 'mockery-v1'; - } - - public function resolve(TypeNode $typeNode, NameScope $nameScope): ?Type - { - if (!$typeNode instanceof UnionTypeNode) { - return null; - } - - $types = $this->typeNodeResolver->resolveMultiple($typeNode->types, $nameScope); - foreach ($types as $type) { - if (!$type instanceof TypeWithClassName) { - continue; - } - - if ( - count($types) === 2 - && $type->getClassName() === 'Mockery\\MockInterface' - ) { - return \PHPStan\Type\TypeCombinator::intersect(...$types); - } - } - - return null; - } - -} diff --git a/vendor/phpstan/phpstan-mockery/src/Mockery/Reflection/StubMethodReflection.php b/vendor/phpstan/phpstan-mockery/src/Mockery/Reflection/StubMethodReflection.php deleted file mode 100644 index 2859804..0000000 --- a/vendor/phpstan/phpstan-mockery/src/Mockery/Reflection/StubMethodReflection.php +++ /dev/null @@ -1,65 +0,0 @@ -declaringClass = $declaringClass; - $this->name = $name; - } - - public function getDeclaringClass(): ClassReflection - { - return $this->declaringClass; - } - - public function isStatic(): bool - { - return false; - } - - public function isPrivate(): bool - { - return false; - } - - public function isPublic(): bool - { - return true; - } - - public function getName(): string - { - return $this->name; - } - - public function getPrototype(): ClassMemberReflection - { - return $this; - } - - /** - * @return \PHPStan\Reflection\ParametersAcceptor[] - */ - public function getVariants(): array - { - return [ - new TrivialParametersAcceptor(), - ]; - } - -} diff --git a/vendor/phpstan/phpstan-mockery/src/Mockery/Reflection/StubMethodsClassReflectionExtension.php b/vendor/phpstan/phpstan-mockery/src/Mockery/Reflection/StubMethodsClassReflectionExtension.php deleted file mode 100644 index 0589cf9..0000000 --- a/vendor/phpstan/phpstan-mockery/src/Mockery/Reflection/StubMethodsClassReflectionExtension.php +++ /dev/null @@ -1,30 +0,0 @@ -stubInterfaceName = $stubInterfaceName; - } - - public function hasMethod(ClassReflection $classReflection, string $methodName): bool - { - return $classReflection->getName() === $this->stubInterfaceName; - } - - public function getMethod(ClassReflection $classReflection, string $methodName): MethodReflection - { - return new StubMethodReflection($classReflection, $methodName); - } - -} diff --git a/vendor/phpstan/phpstan-mockery/src/Mockery/Type/Allows.php b/vendor/phpstan/phpstan-mockery/src/Mockery/Type/Allows.php deleted file mode 100644 index bcf53cc..0000000 --- a/vendor/phpstan/phpstan-mockery/src/Mockery/Type/Allows.php +++ /dev/null @@ -1,8 +0,0 @@ -stubInterfaceName = $stubInterfaceName; - } - - public function getClass(): string - { - return $this->stubInterfaceName; - } - - public function isMethodSupported(MethodReflection $methodReflection): bool - { - return true; - } - - public function getTypeFromMethodCall(MethodReflection $methodReflection, MethodCall $methodCall, Scope $scope): Type - { - return new ObjectType('Mockery\\Expectation'); - } - -} diff --git a/vendor/phpstan/phpstan-mockery/src/Mockery/Type/Expects.php b/vendor/phpstan/phpstan-mockery/src/Mockery/Type/Expects.php deleted file mode 100644 index 041479f..0000000 --- a/vendor/phpstan/phpstan-mockery/src/Mockery/Type/Expects.php +++ /dev/null @@ -1,8 +0,0 @@ -getName() === 'makePartial'; - } - - public function getTypeFromMethodCall(MethodReflection $methodReflection, MethodCall $methodCall, Scope $scope): Type - { - return $scope->getType($methodCall->var); - } - -} diff --git a/vendor/phpstan/phpstan-mockery/src/Mockery/Type/MockDynamicReturnTypeExtension.php b/vendor/phpstan/phpstan-mockery/src/Mockery/Type/MockDynamicReturnTypeExtension.php deleted file mode 100644 index 5ee1a36..0000000 --- a/vendor/phpstan/phpstan-mockery/src/Mockery/Type/MockDynamicReturnTypeExtension.php +++ /dev/null @@ -1,73 +0,0 @@ -getName(), [ - 'mock', - 'spy', - ], true); - } - - public function getTypeFromStaticMethodCall( - MethodReflection $methodReflection, - StaticCall $methodCall, - Scope $scope - ): Type - { - $defaultReturnType = new ObjectType('Mockery\\MockInterface'); - if (count($methodCall->args) === 0) { - return $defaultReturnType; - } - - $types = [$defaultReturnType]; - foreach ($methodCall->args as $arg) { - $classType = $scope->getType($arg->value); - if (!$classType instanceof ConstantStringType) { - continue; - } - - $value = $classType->getValue(); - if (substr($value, 0, 6) === 'alias:') { - $value = substr($value, 6); - } - if (substr($value, 0, 9) === 'overload:') { - $value = substr($value, 9); - } - if (substr($value, -1) === ']' && strpos($value, '[') !== false) { - $value = substr($value, 0, strpos($value, '[')); - } - - if (strpos($value, ',') !== false) { - $interfaceNames = explode(',', str_replace(' ', '', $value)); - } else { - $interfaceNames = [$value]; - } - - foreach ($interfaceNames as $name) { - $types[] = new ObjectType($name); - } - } - - return TypeCombinator::intersect(...$types); - } - -} diff --git a/vendor/phpstan/phpstan-mockery/src/Mockery/Type/ShouldReceiveDynamicReturnTypeExtension.php b/vendor/phpstan/phpstan-mockery/src/Mockery/Type/ShouldReceiveDynamicReturnTypeExtension.php deleted file mode 100644 index 984a494..0000000 --- a/vendor/phpstan/phpstan-mockery/src/Mockery/Type/ShouldReceiveDynamicReturnTypeExtension.php +++ /dev/null @@ -1,30 +0,0 @@ -getName() === 'shouldReceive'; - } - - public function getTypeFromMethodCall(MethodReflection $methodReflection, MethodCall $methodCall, Scope $scope): Type - { - return new ObjectType('Mockery\\Expectation'); - } - -} diff --git a/vendor/phpstan/phpstan-mockery/src/Mockery/Type/StubDynamicReturnTypeExtension.php b/vendor/phpstan/phpstan-mockery/src/Mockery/Type/StubDynamicReturnTypeExtension.php deleted file mode 100644 index e6c9926..0000000 --- a/vendor/phpstan/phpstan-mockery/src/Mockery/Type/StubDynamicReturnTypeExtension.php +++ /dev/null @@ -1,55 +0,0 @@ -stubInterfaceName = $stubInterfaceName; - $this->stubMethodName = $stubMethodName; - } - - public function getClass(): string - { - return 'Mockery\\MockInterface'; - } - - public function isMethodSupported(MethodReflection $methodReflection): bool - { - return $methodReflection->getName() === $this->stubMethodName; - } - - public function getTypeFromMethodCall(MethodReflection $methodReflection, MethodCall $methodCall, Scope $scope): Type - { - $calledOnType = $scope->getType($methodCall->var); - $defaultType = ParametersAcceptorSelector::selectSingle($methodReflection->getVariants())->getReturnType(); - if (!$calledOnType instanceof IntersectionType || count($calledOnType->getTypes()) !== 2) { - return $defaultType; - } - $mockedType = $calledOnType->getTypes()[1]; - if (!$mockedType instanceof TypeWithClassName) { - return $defaultType; - } - - return new ObjectType($this->stubInterfaceName); - } - -} diff --git a/vendor/phpstan/phpstan/.editorconfig b/vendor/phpstan/phpstan/.editorconfig deleted file mode 100644 index 5d66bc4..0000000 --- a/vendor/phpstan/phpstan/.editorconfig +++ /dev/null @@ -1,27 +0,0 @@ -root = true - -[*] -end_of_line = lf -insert_final_newline = true -charset = utf-8 -trim_trailing_whitespace = true - -[*.{php,phpt}] -indent_style = tab -indent_size = 4 - -[*.xml] -indent_style = tab -indent_size = 4 - -[*.neon] -indent_style = tab -indent_size = 4 - -[*.{yaml,yml}] -indent_style = space -indent_size = 2 - -[composer.json] -indent_style = tab -indent_size = 4 diff --git a/vendor/phpstan/phpstan/.gitattributes b/vendor/phpstan/phpstan/.gitattributes deleted file mode 100644 index 0c772b6..0000000 --- a/vendor/phpstan/phpstan/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -/build export-ignore -/tests export-ignore diff --git a/vendor/phpstan/phpstan/.github/FUNDING.yml b/vendor/phpstan/phpstan/.github/FUNDING.yml deleted file mode 100644 index c1c9d13..0000000 --- a/vendor/phpstan/phpstan/.github/FUNDING.yml +++ /dev/null @@ -1,4 +0,0 @@ -# These are supported funding model platforms - -patreon: phpstan -tidelift: packagist/phpstan%2Fphpstan diff --git a/vendor/phpstan/phpstan/.github/ISSUE_TEMPLATE/Bug_report.md b/vendor/phpstan/phpstan/.github/ISSUE_TEMPLATE/Bug_report.md deleted file mode 100644 index ab2c4c6..0000000 --- a/vendor/phpstan/phpstan/.github/ISSUE_TEMPLATE/Bug_report.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -name: Bug report 🐛 -about: If something isn't working as expected 🤔. ---- - -# Bug report - - - - - -### Code snippet that reproduces the problem - - - -### Expected output - - diff --git a/vendor/phpstan/phpstan/.github/ISSUE_TEMPLATE/Feature_request.md b/vendor/phpstan/phpstan/.github/ISSUE_TEMPLATE/Feature_request.md deleted file mode 100644 index 937fbd3..0000000 --- a/vendor/phpstan/phpstan/.github/ISSUE_TEMPLATE/Feature_request.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: Feature request 🚀 -about: I have a suggestion (and may want to implement it 🙂)! ---- - -# Feature request - - diff --git a/vendor/phpstan/phpstan/.github/ISSUE_TEMPLATE/Function_signature_mismatch.md b/vendor/phpstan/phpstan/.github/ISSUE_TEMPLATE/Function_signature_mismatch.md deleted file mode 100644 index 2b9ec89..0000000 --- a/vendor/phpstan/phpstan/.github/ISSUE_TEMPLATE/Function_signature_mismatch.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -name: Function signature mismatch 🤖 -about: Some built-in PHP function expects or returns a different type than is reported? ---- - - diff --git a/vendor/phpstan/phpstan/.github/ISSUE_TEMPLATE/Support_question.md b/vendor/phpstan/phpstan/.github/ISSUE_TEMPLATE/Support_question.md deleted file mode 100644 index 9833a97..0000000 --- a/vendor/phpstan/phpstan/.github/ISSUE_TEMPLATE/Support_question.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: Support question ❓ -about: This is a great place to ask support questions. The community is eager to answer them! ---- - -# Support question - - diff --git a/vendor/phpstan/phpstan/.github/mergeable.yml b/vendor/phpstan/phpstan/.github/mergeable.yml deleted file mode 100644 index ad924cd..0000000 --- a/vendor/phpstan/phpstan/.github/mergeable.yml +++ /dev/null @@ -1,20 +0,0 @@ -version: 2 -mergeable: - - when: issues.opened - validate: - - do: description - or: - - and: - - must_include: - regex: '^# Bug report' - - must_include: - regex: 'https:\/\/phpstan\.org\/r\/' - - must_exclude: - regex: '^# Bug report' - fail: - - do: comment - payload: - body: > - This bug report is missing a link to reproduction on [phpstan.org](https://phpstan.org/). - - It will most likely be closed after manual review. diff --git a/vendor/phpstan/phpstan/.gitignore b/vendor/phpstan/phpstan/.gitignore deleted file mode 100644 index d0b8044..0000000 --- a/vendor/phpstan/phpstan/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/build/phpstan-generated.neon -/composer.lock -/conf/config.local.yml -/vendor -/.idea -/tests/tmp diff --git a/vendor/phpstan/phpstan/.travis.yml b/vendor/phpstan/phpstan/.travis.yml deleted file mode 100644 index abc1e5e..0000000 --- a/vendor/phpstan/phpstan/.travis.yml +++ /dev/null @@ -1,64 +0,0 @@ -dist: xenial -language: php - -stages: - - test - - name: phar-test - if: branch = master && type = push - - name: phar-push - if: branch = master && type = push - -php: - - 7.1 - - 7.2 - - 7.3 - - 7.4snapshot - - master - -env: - matrix: - - dependencies=lowest - - dependencies=highest - global: - secure: Wxs9IuFkyacKk/Cu4qxFkkSldob6AhJtx3MDS6Nehz/VF4M88awmI/GcVzfcXjFIA2+EJlkA+X0ymxP9xY5sp+vvmF4mkBIOvSvQdIOLsy73Ixpji3nqc8+epuvtBUGA4Y2xlLmBxSPYZlpVc/DRR2mIlzqDfOQc+gUmJ1aOZPUvs533cl4k0V23hU7L3LxgAnNY7j5vfNgYUhLqBHnqZ0yHt+m0x56wTOBHIBXH+LVNdgsl07fZnuC9HBb3lZKhtCtJiMyC0SsFQLljESaedTHRzptcOuvO+3dmt9R+AP/WxbdmleBaozCrwpdCK3Lqwrt9DXkxtn9ERjtVg0uT2KV5Mm5y4W0w9EXzX/8iUexlJaYOP7OYBtaV0R65w+oiC9dupKiFFvQtJkWcMg+4FCqEjNVM/smXin7+4dLgXiioLtqbjyQQqVwy/U+UmkQ5KIcWjJZGWkL79j1z1e29esNudieXqrX/yvGUW7Ng+4U3G2IHdWH3nMmjwx5/oBuOlc+6vu5aXdDRZVE12CJZ2X/uyJW2Ls5YLJsThAJ9roxsZ29MNZRihUOGk2lLDy/Q5TS6VcsaUmRaZHngM7Xt7v7pJLLbPIomgqGshPKxEXFO3vowZ7nXT1gJX0/FaBBqOahW0scGnxfZlJRZPWbvTg8gxhIGRxhNNYaX5Bb2hw8= -matrix: - allow_failures: - - php: 7.4snapshot - env: dependencies=lowest - - php: master - -before_script: - - if php --ri xdebug >/dev/null; then phpenv config-rm xdebug.ini; fi - -install: - - if [ "$dependencies" = "lowest" ]; then composer update --prefer-lowest --no-interaction; fi - - if [ "$dependencies" = "highest" ]; then composer update --no-interaction; fi - -script: - - vendor/bin/phing - -jobs: - include: - - stage: phar-test - script: - - git clone https://github.com/phpstan/phpstan-compiler && cd phpstan-compiler && ./run-e2e-tests.sh $TRAVIS_COMMIT - - stage: phar-push - script: - - | - git clone https://github.com/phpstan/phpstan-compiler && \ - composer install --working-dir=phpstan-compiler && \ - php phpstan-compiler/bin/compile $TRAVIS_COMMIT && \ - git clone https://${GITHUB_TOKEN}@github.com/phpstan/phpstan-shim.git > /dev/null 2>&1 && \ - cp phpstan-compiler/tmp/phpstan.phar phpstan-shim/phpstan.phar && \ - cp phpstan-compiler/tmp/phpstan.phar phpstan-shim/phpstan && \ - cd phpstan-shim && \ - git config user.email "travis@travis-ci.org" && \ - git config user.name "Travis CI" && \ - git add phpstan phpstan.phar && \ - git commit -m "Updated PHPStan to commit ${TRAVIS_COMMIT}" && \ - git push --quiet origin master - -cache: - directories: - - $HOME/.composer/cache - - tmp diff --git a/vendor/phpstan/phpstan/BACKERS.md b/vendor/phpstan/phpstan/BACKERS.md deleted file mode 100644 index af769e2..0000000 --- a/vendor/phpstan/phpstan/BACKERS.md +++ /dev/null @@ -1,65 +0,0 @@ -# Backers - -Development of PHPStan is made possible thanks to these awesome backers! -You can become one of them by [pledging on Patreon](https://www.patreon.com/phpstan). - -Check out all the tiers - higher ones include additional goodies like placing -the logo of your company in PHPStan's README. - -# $50+ - -* MessageBird - -# $10+ - -* Adam Lundrigan -* Scott Arciszewski - -# $5+ - -* Adam Žurek -* Bart Reunes -* Carlos C Soto -* Craig Mayhew -* David Šolc -* Dennis Haarbrink -* Haralan Dobrev -* Ilija Tovilo -* Jake B -* Jakub Chábek -* Jakub Červený -* Jan Endel -* Jan Kuchař -* Lars Roettig -* Lukas Unger -* Masaru Yamagishi -* Michael Moll -* Pavel Vondrášek -* René Kliment -* Rudolph Gottesheim -* seagoj -* Stefan Zielke -* Thomas Daugaard -* Tomasz -* Tommy Muehle -* Vašek Brychta -* Woda Digital - -# $1+ - -* Andrew Barlow -* Broken Bialek -* Christian Sjöström -* Craig Duncan -* Honza Cerny -* Ian Den Hartog -* Ivan Kvasnica -* korchasa -* Lucas Dos Santos Abreu -* Martin Lukeš -* Matej Drame -* Michal Mleczko -* Michał Włodarczyk -* Oliver Klee -* Ondrej Vodacek -* Wouter Admiraal diff --git a/vendor/phpstan/phpstan/CODE_OF_CONDUCT.md b/vendor/phpstan/phpstan/CODE_OF_CONDUCT.md deleted file mode 100644 index 162e250..0000000 --- a/vendor/phpstan/phpstan/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,74 +0,0 @@ -# Contributor Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of experience, -nationality, personal appearance, race, religion, or sexual identity and -orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or -advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project maintainer at . All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at [http://contributor-covenant.org/version/1/4][version] - -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ diff --git a/vendor/phpstan/phpstan/LICENSE b/vendor/phpstan/phpstan/LICENSE deleted file mode 100644 index 7c0f2b7..0000000 --- a/vendor/phpstan/phpstan/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2016 Ondřej Mirtes - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/phpstan/phpstan/README.md b/vendor/phpstan/phpstan/README.md deleted file mode 100644 index 6c1b9a2..0000000 --- a/vendor/phpstan/phpstan/README.md +++ /dev/null @@ -1,740 +0,0 @@ -

PHPStan - PHP Static Analysis Tool

- -

- PHPStan -

- -

- Build Status - Latest Stable Version - Total Downloads - License - PHPStan Enabled -

- ------- - -PHPStan focuses on finding errors in your code without actually running it. It catches whole classes of bugs -even before you write tests for the code. It moves PHP closer to compiled languages in the sense that the correctness of each line of the code -can be checked before you run the actual line. - -**[Read more about PHPStan on Medium.com »](https://medium.com/@ondrejmirtes/phpstan-2939cd0ad0e3)** - -**[Try out PHPStan on the on-line playground! »](https://phpstan.org/)** - -## Sponsors - -Mike Pretzlaw -    -TheCodingMachine -    -Private Packagist -    -Musement -    -Blackfire.io -    -Intracto - -Check out [PHPStan's Patreon](https://www.patreon.com/phpstan) for sponsoring options. One-time donations [through PayPal](https://paypal.me/phpstan) are also accepted. To request an invoice, [contact me](mailto:ondrej@mirtes.cz) through e-mail. - -BTC: bc1qd5s06wjtf8rzag08mk3s264aekn52jze9zeapt -
LTC: LSU5xLsWEfrVx1P9yJwmhziHAXikiE8xtC - -## Prerequisites - -PHPStan requires PHP >= 7.1. You have to run it in environment with PHP 7.x but the actual code does not have to use -PHP 7.x features. (Code written for PHP 5.6 and earlier can run on 7.x mostly unmodified.) - -PHPStan works best with modern object-oriented code. The more strongly-typed your code is, the more information -you give PHPStan to work with. - -Properly annotated and typehinted code (class properties, function and method arguments, return types) helps -not only static analysis tools but also other people that work with the code to understand it. - -## Installation - -To start performing analysis on your code, require PHPStan in [Composer](https://getcomposer.org/): - -``` -composer require --dev phpstan/phpstan -``` - -Composer will install PHPStan's executable in its `bin-dir` which defaults to `vendor/bin`. - -If you have conflicting dependencies or you want to install PHPStan globally, the best way is via a PHAR archive. You will always find the latest stable PHAR archive below the [release notes](https://github.com/phpstan/phpstan/releases). You can also use the [phpstan/phpstan-shim](https://packagist.org/packages/phpstan/phpstan-shim) package to install PHPStan via Composer without the risk of conflicting dependencies. - -You can also use [PHPStan via Docker](https://github.com/phpstan/docker-image). - -## First run - -To let PHPStan analyse your codebase, you have to use the `analyse` command and point it to the right directories. - -So, for example if you have your classes in directories `src` and `tests`, you can run PHPStan like this: - -```bash -vendor/bin/phpstan analyse src tests -``` - -PHPStan will probably find some errors, but don't worry, your code might be just fine. Errors found -on the first run tend to be: - -* Extra arguments passed to functions (e. g. function requires two arguments, the code passes three) -* Extra arguments passed to print/sprintf functions (e. g. format string contains one placeholder, the code passes two values to replace) -* Obvious errors in dead code -* Magic behaviour that needs to be defined. See [Extensibility](#extensibility). - -After fixing the obvious mistakes in the code, look to the following section -for all the configuration options that will bring the number of reported errors to zero -making PHPStan suitable to run as part of your continuous integration script. - -## Rule levels - -If you want to use PHPStan but your codebase isn't up to speed with strong typing -and PHPStan's strict checks, you can choose from currently 8 levels -(0 is the loosest and 7 is the strictest) by passing `--level` to `analyse` command. Default level is `0`. - -This feature enables incremental adoption of PHPStan checks. You can start using PHPStan -with a lower rule level and increase it when you feel like it. - -You can also use `--level max` as an alias for the highest level. This will ensure that you will always use the highest level when upgrading to new versions of PHPStan. Please note that this can create a significant obstacle when upgrading to a newer version because you might have to fix a lot of code to bring the number of errors down to zero. - -## Extensibility - -Unique feature of PHPStan is the ability to define and statically check "magic" behaviour of classes - -accessing properties that are not defined in the class but are created in `__get` and `__set` -and invoking methods using `__call`. - -See [Class reflection extensions](#class-reflection-extensions), [Dynamic return type extensions](#dynamic-return-type-extensions) and [Type-specifying extensions](#type-specifying-extensions). - -You can also install official framework-specific extensions: - -* [Doctrine](https://github.com/phpstan/phpstan-doctrine) -* [PHPUnit](https://github.com/phpstan/phpstan-phpunit) -* [Nette Framework](https://github.com/phpstan/phpstan-nette) -* [Dibi - Database Abstraction Library](https://github.com/phpstan/phpstan-dibi) -* [PHP-Parser](https://github.com/phpstan/phpstan-php-parser) -* [beberlei/assert](https://github.com/phpstan/phpstan-beberlei-assert) -* [webmozart/assert](https://github.com/phpstan/phpstan-webmozart-assert) -* [Symfony Framework](https://github.com/phpstan/phpstan-symfony) -* [Mockery](https://github.com/phpstan/phpstan-mockery) - -Unofficial extensions for other frameworks and libraries are also available: - -* [Phony](https://github.com/eloquent/phpstan-phony) -* [Prophecy](https://github.com/Jan0707/phpstan-prophecy) -* [Laravel](https://github.com/nunomaduro/larastan) -* [myclabs/php-enum](https://github.com/timeweb/phpstan-enum) -* [Yii2](https://github.com/proget-hq/phpstan-yii2) -* [PhpSpec](https://github.com/proget-hq/phpstan-phpspec) -* [TYPO3](https://github.com/sascha-egerer/phpstan-typo3) -* [moneyphp/money](https://github.com/JohnstonCode/phpstan-moneyphp) -* [Drupal](https://github.com/mglaman/phpstan-drupal) -* [WordPress](https://github.com/szepeviktor/phpstan-wordpress) -* [Zend Framework](https://github.com/Slamdunk/phpstan-zend-framework) - -Unofficial extensions with third-party rules: - -* [thecodingmachine / phpstan-strict-rules](https://github.com/thecodingmachine/phpstan-strict-rules) -* [localheinz / phpstan-rules](https://github.com/localheinz/phpstan-rules) -* [pepakriz / phpstan-exception-rules](https://github.com/pepakriz/phpstan-exception-rules) -* [Slamdunk / phpstan-extensions](https://github.com/Slamdunk/phpstan-extensions) - -New extensions are becoming available on a regular basis! - -## Configuration - -Config file is passed to the `phpstan` executable with `-c` option: - -```bash -vendor/bin/phpstan analyse -l 4 -c phpstan.neon src tests -``` - -When using a custom project config file, you have to pass the `--level` (`-l`) -option to `analyse` command (default value does not apply here). - -If you do not provide config file explicitly, PHPStan will look for -files named `phpstan.neon` or `phpstan.neon.dist` in current directory. - -The resolution priority is as such: -1. If config file is provided on command line, it is used. -2. If config file `phpstan.neon` exists in current directory, it will be used. -3. If config file `phpstan.neon.dist` exists in current directory, it will be used. -4. If none of the above is true, no config will be used. - -[NEON file format](https://ne-on.org/) is very similar to YAML. -All the following options are part of the `parameters` section. - -#### Configuration variables - - `%rootDir%` - root directory where PHPStan resides (i.e. `vendor/phpstan/phpstan` in Composer installation) - - `%currentWorkingDirectory%` - current working directory where PHPStan was executed - -#### Configuration options - - - `tmpDir` - specifies the temporary directory used by PHPStan cache (defaults to `sys_get_temp_dir() . '/phpstan'`) - - `level` - specifies analysis level - if specified, `-l` option is not required - - `paths` - specifies analysed paths - if specified, paths are not required to be passed as arguments - -### Autoloading - -PHPStan uses Composer autoloader so the easiest way how to autoload classes -is through the `autoload`/`autoload-dev` sections in composer.json. - -#### Specify paths to scan - -If PHPStan complains about some non-existent classes and you're sure the classes -exist in the codebase AND you don't want to use Composer autoloader for some reason, -you can specify directories to scan and concrete files to include using -`autoload_directories` and `autoload_files` array parameters: - -``` -parameters: - autoload_directories: - - %rootDir%/../../../build - autoload_files: - - %rootDir%/../../../generated/routes/GeneratedRouteList.php -``` - -`%rootDir%` is expanded to the root directory where PHPStan resides. - -#### Autoloading for global installation - -PHPStan supports global installation using [`composer global`](https://getcomposer.org/doc/03-cli.md#global) or via a [PHAR archive](#installation). -In this case, it's not part of the project autoloader, but it supports autodiscovery of the Composer autoloader -from current working directory residing in `vendor/`: - -```bash -cd /path/to/project -phpstan analyse src tests # looks for autoloader at /path/to/project/vendor/autoload.php -``` - -If you have your dependencies installed at a different path -or you're running PHPStan from a different directory, -you can specify the path to the autoloader with the `--autoload-file|-a` option: - -```bash -phpstan analyse --autoload-file=/path/to/autoload.php src tests -``` - -### Exclude files from analysis - -If your codebase contains some files that are broken on purpose -(e. g. to test behaviour of your application on files with invalid PHP code), -you can exclude them using the `excludes_analyse` array parameter. String at each line -is used as a pattern for the [`fnmatch`](https://secure.php.net/manual/en/function.fnmatch.php) function. - -``` -parameters: - excludes_analyse: - - %rootDir%/../../../tests/*/data/* -``` - -### Include custom extensions - -If your codebase contains php files with extensions other than the standard .php extension then you can add them -to the `fileExtensions` array parameter: - -``` -parameters: - fileExtensions: - - php - - module - - inc -``` - -### Universal object crates - -Classes without predefined structure are common in PHP applications. -They are used as universal holders of data - any property can be set and read on them. Notable examples -include `stdClass`, `SimpleXMLElement` (these are enabled by default), objects with results of database queries etc. -Use `universalObjectCratesClasses` array parameter to let PHPStan know which classes -with these characteristics are used in your codebase: - -``` -parameters: - universalObjectCratesClasses: - - Dibi\Row - - Ratchet\ConnectionInterface -``` - -### Add non-obviously assigned variables to scope - -If you use some variables from a try block in your catch blocks, set `polluteCatchScopeWithTryAssignments` boolean parameter to `true`. - -```php -try { - $author = $this->getLoggedInUser(); - $post = $this->postRepository->getById($id); -} catch (PostNotFoundException $e) { - // $author is probably defined here - throw new ArticleByAuthorCannotBePublished($author); -} -``` - -If you are enumerating over all possible situations in if-elseif branches -and PHPStan complains about undefined variables after the conditions, you can write -an else branch with throwing an exception: - -```php -if (somethingIsTrue()) { - $foo = true; -} elseif (orSomethingElseIsTrue()) { - $foo = false; -} else { - throw new ShouldNotHappenException(); -} - -doFoo($foo); -``` - -I recommend leaving `polluteCatchScopeWithTryAssignments` set to `false` because it leads to a clearer and more maintainable code. - -### Custom early terminating method calls - -Previous example showed that if a condition branches end with throwing an exception, that branch does not have -to define a variable used after the condition branches end. - -But exceptions are not the only way how to terminate execution of a method early. Some specific method calls -can be perceived by project developers also as early terminating - like a `redirect()` that stops execution -by throwing an internal exception. - -```php -if (somethingIsTrue()) { - $foo = true; -} elseif (orSomethingElseIsTrue()) { - $foo = false; -} else { - $this->redirect('homepage'); -} - -doFoo($foo); -``` - -These methods can be configured by specifying a class on whose instance they are called like this: - -``` -parameters: - earlyTerminatingMethodCalls: - Nette\Application\UI\Presenter: - - redirect - - redirectUrl - - sendJson - - sendResponse -``` - -### Ignore error messages with regular expressions - -If some issue in your code base is not easy to fix or just simply want to deal with it later, -you can exclude error messages from the analysis result with regular expressions: - -``` -parameters: - ignoreErrors: - - '#Call to an undefined method [a-zA-Z0-9\\_]+::method\(\)#' - - '#Call to an undefined method [a-zA-Z0-9\\_]+::expects\(\)#' - - '#Access to an undefined property PHPUnit_Framework_MockObject_MockObject::\$[a-zA-Z0-9_]+#' - - '#Call to an undefined method PHPUnit_Framework_MockObject_MockObject::[a-zA-Z0-9_]+\(\)#' -``` - -To exclude an error in a specific directory or file, specify a `path` or `paths` along with the `message`: - -``` -parameters: - ignoreErrors: - - - message: '#Call to an undefined method [a-zA-Z0-9\\_]+::method\(\)#' - path: %currentWorkingDirectory%/some/dir/SomeFile.php - - - message: '#Call to an undefined method [a-zA-Z0-9\\_]+::method\(\)#' - paths: - - %currentWorkingDirectory%/some/dir/* - - %currentWorkingDirectory%/other/dir/* - - '#Other error to catch anywhere#' -``` - -If some of the patterns do not occur in the result anymore, PHPStan will let you know -and you will have to remove the pattern from the configuration. You can turn off -this behaviour by setting `reportUnmatchedIgnoredErrors` to `false` in PHPStan configuration. - -### Bootstrap file - -If you need to initialize something in PHP runtime before PHPStan runs (like your own autoloader), -you can provide your own bootstrap file: - -``` -parameters: - bootstrap: %rootDir%/../../../phpstan-bootstrap.php -``` - -### Custom rules - -PHPStan allows writing custom rules to check for specific situations in your own codebase. Your rule class -needs to implement the `PHPStan\Rules\Rule` interface and registered as a service in the configuration file: - -``` -services: - - - class: MyApp\PHPStan\Rules\DefaultValueTypesAssignedToPropertiesRule - tags: - - phpstan.rules.rule -``` - -For inspiration on how to implement a rule turn to [src/Rules](https://github.com/phpstan/phpstan/tree/master/src/Rules) -to see a lot of built-in rules. - -Check out also [phpstan-strict-rules](https://github.com/phpstan/phpstan-strict-rules) repository for extra strict and opinionated rules for PHPStan! - -### Custom error formatters - -PHPStan outputs errors via formatters. You can customize the output by implementing the `ErrorFormatter` interface in a new class and add it to the configuration. For existing formatters, see next chapter. - -```php -interface ErrorFormatter -{ - - /** - * Formats the errors and outputs them to the console. - * - * @param \PHPStan\Command\AnalysisResult $analysisResult - * @param \Symfony\Component\Console\Style\OutputStyle $style - * @return int Error code. - */ - public function formatErrors( - AnalysisResult $analysisResult, - \Symfony\Component\Console\Style\OutputStyle $style - ): int; - -} -``` - -Register the formatter in your `phpstan.neon`: - -``` -services: - errorFormatter.awesome: - class: App\PHPStan\AwesomeErrorFormatter -``` - -Use the name part after `errorFormatter.` as the CLI option value: - -```bash -vendor/bin/phpstan analyse -c phpstan.neon -l 4 --error-format awesome src tests -``` - -### Existing error formatters to be used - -You can pass the following keywords to the `--error-format=X` parameter in order to affect the output: - -- `table`: Default. Grouped errors by file, colorized. For human consumption. -- `raw`: Contains one error per line, with path to file, line number, and error description -- `checkstyle`: Creates a checkstyle.xml compatible output. Note that you'd have to redirect output into a file in order to capture the results for later processing. -- `json`: Creates minified .json output without whitespaces. Note that you'd have to redirect output into a file in order to capture the results for later processing. -- `prettyJson`: Creates human readable .json output with whitespaces and indentations. Note that you'd have to redirect output into a file in order to capture the results for later processing. -- `gitlab`: Creates format for use Code Quality widget on GitLab Merge Request. -- `baselineNeon`: Creates a .neon output for including in your config. This allows a baseline for existing errors. Note that you'd have to redirect output into a file in order to capture the results for later processing. - -## Class reflection extensions - -Classes in PHP can expose "magical" properties and methods decided in run-time using -class methods like `__get`, `__set` and `__call`. Because PHPStan is all about static analysis -(testing code for errors without running it), it has to know about those properties and methods beforehand. - -When PHPStan stumbles upon a property or a method that is unknown to built-in class reflection, it iterates -over all registered class reflection extensions until it finds one that defines the property or method. - -Class reflection extension cannot have `PHPStan\Broker\Broker` (service for obtaining class reflections) injected in the constructor due to circular reference issue, but the extensions can implement `PHPStan\Reflection\BrokerAwareExtension` interface to obtain Broker via a setter. - -### Properties class reflection extensions - -This extension type must implement the following interface: - -```php -namespace PHPStan\Reflection; - -interface PropertiesClassReflectionExtension -{ - - public function hasProperty(ClassReflection $classReflection, string $propertyName): bool; - - public function getProperty(ClassReflection $classReflection, string $propertyName): PropertyReflection; - -} -``` - -Most likely you will also have to implement a new `PropertyReflection` class: - -```php -namespace PHPStan\Reflection; - -interface PropertyReflection -{ - - public function getType(): Type; - - public function getDeclaringClass(): ClassReflection; - - public function isStatic(): bool; - - public function isPrivate(): bool; - - public function isPublic(): bool; - -} -``` - -This is how you register the extension in project's PHPStan config file: - -``` -services: - - - class: App\PHPStan\PropertiesFromAnnotationsClassReflectionExtension - tags: - - phpstan.broker.propertiesClassReflectionExtension -``` - -### Methods class reflection extensions - -This extension type must implement the following interface: - -```php -namespace PHPStan\Reflection; - -interface MethodsClassReflectionExtension -{ - - public function hasMethod(ClassReflection $classReflection, string $methodName): bool; - - public function getMethod(ClassReflection $classReflection, string $methodName): MethodReflection; - -} -``` - -Most likely you will also have to implement a new `MethodReflection` class: - -```php -namespace PHPStan\Reflection; - -interface MethodReflection -{ - - public function getDeclaringClass(): ClassReflection; - - public function getPrototype(): self; - - public function isStatic(): bool; - - public function isPrivate(): bool; - - public function isPublic(): bool; - - public function getName(): string; - - /** - * @return \PHPStan\Reflection\ParameterReflection[] - */ - public function getParameters(): array; - - public function isVariadic(): bool; - - public function getReturnType(): Type; - -} -``` - -This is how you register the extension in project's PHPStan config file: - -``` -services: - - - class: App\PHPStan\EnumMethodsClassReflectionExtension - tags: - - phpstan.broker.methodsClassReflectionExtension -``` - -## Dynamic return type extensions - -If the return type of a method is not always the same, but depends on an argument passed to the method, -you can specify the return type by writing and registering an extension. - -Because you have to write the code with the type-resolving logic, it can be as complex as you want. - -After writing the sample extension, the variable `$mergedArticle` will have the correct type: - -```php -$mergedArticle = $this->entityManager->merge($article); -// $mergedArticle will have the same type as $article -``` - -This is the interface for dynamic return type extension: - -```php -namespace PHPStan\Type; - -use PhpParser\Node\Expr\MethodCall; -use PHPStan\Analyser\Scope; -use PHPStan\Reflection\MethodReflection; - -interface DynamicMethodReturnTypeExtension -{ - - public function getClass(): string; - - public function isMethodSupported(MethodReflection $methodReflection): bool; - - public function getTypeFromMethodCall(MethodReflection $methodReflection, MethodCall $methodCall, Scope $scope): Type; - -} -``` - -And this is how you'd write the extension that correctly resolves the EntityManager::merge() return type: - -```php -public function getClass(): string -{ - return \Doctrine\ORM\EntityManager::class; -} - -public function isMethodSupported(MethodReflection $methodReflection): bool -{ - return $methodReflection->getName() === 'merge'; -} - -public function getTypeFromMethodCall(MethodReflection $methodReflection, MethodCall $methodCall, Scope $scope): Type -{ - if (count($methodCall->args) === 0) { - return \PHPStan\Reflection\ParametersAcceptorSelector::selectFromArgs( - $scope, - $methodCall->args, - $methodReflection->getVariants() - )->getReturnType(); - } - $arg = $methodCall->args[0]->value; - - return $scope->getType($arg); -} -``` - -And finally, register the extension to PHPStan in the project's config file: - -``` -services: - - - class: App\PHPStan\EntityManagerDynamicReturnTypeExtension - tags: - - phpstan.broker.dynamicMethodReturnTypeExtension -``` - -There's also an analogous functionality for: - -* **static methods** using `DynamicStaticMethodReturnTypeExtension` interface -and `phpstan.broker.dynamicStaticMethodReturnTypeExtension` service tag. -* **functions** using `DynamicFunctionReturnTypeExtension` interface and `phpstan.broker.dynamicFunctionReturnTypeExtension` service tag. - -## Type-specifying extensions - -These extensions allow you to specify types of expressions based on certain pre-existing conditions. This is best illustrated with couple examples: - -```php -if (is_int($variable)) { - // here we can be sure that $variable is integer -} -``` - -```php -// using PHPUnit's asserts - -self::assertNotNull($variable); -// here we can be sure that $variable is not null -``` - -Type-specifying extension cannot have `PHPStan\Analyser\TypeSpecifier` injected in the constructor due to circular reference issue, but the extensions can implement `PHPStan\Analyser\TypeSpecifierAwareExtension` interface to obtain TypeSpecifier via a setter. - -This is the interface for type-specifying extension: - -```php -namespace PHPStan\Type; - -use PhpParser\Node\Expr\StaticCall; -use PHPStan\Analyser\Scope; -use PHPStan\Analyser\SpecifiedTypes; -use PHPStan\Analyser\TypeSpecifierContext; -use PHPStan\Reflection\MethodReflection; - -interface StaticMethodTypeSpecifyingExtension -{ - - public function getClass(): string; - - public function isStaticMethodSupported(MethodReflection $staticMethodReflection, StaticCall $node, TypeSpecifierContext $context): bool; - - public function specifyTypes(MethodReflection $staticMethodReflection, StaticCall $node, Scope $scope, TypeSpecifierContext $context): SpecifiedTypes; - -} -``` - -And this is how you'd write the extension for the second example above: - -```php -public function getClass(): string -{ - return \PHPUnit\Framework\Assert::class; -} - -public function isStaticMethodSupported(MethodReflection $staticMethodReflection, StaticCall $node, TypeSpecifierContext $context): bool; -{ - // The $context argument tells us if we're in an if condition or not (as in this case). - return $staticMethodReflection->getName() === 'assertNotNull' && $context->null(); -} - -public function specifyTypes(MethodReflection $staticMethodReflection, StaticCall $node, Scope $scope, TypeSpecifierContext $context): SpecifiedTypes -{ - // Assuming extension implements \PHPStan\Analyser\TypeSpecifierAwareExtension. - return $this->typeSpecifier->create($node->var, \PHPStan\Type\TypeCombinator::removeNull($scope->getType($node->var)), $context); -} -``` - -And finally, register the extension to PHPStan in the project's config file: - -``` -services: - - - class: App\PHPStan\AssertNotNullTypeSpecifyingExtension - tags: - - phpstan.typeSpecifier.staticMethodTypeSpecifyingExtension -``` - -There's also an analogous functionality for: - -* **dynamic methods** using `MethodTypeSpecifyingExtension` interface -and `phpstan.typeSpecifier.methodTypeSpecifyingExtension` service tag. -* **functions** using `FunctionTypeSpecifyingExtension` interface and `phpstan.typeSpecifier.functionTypeSpecifyingExtension` service tag. - -## Known issues - -* If `include` or `require` are used in the analysed code (instead of `include_once` or `require_once`), -PHPStan will throw `Cannot redeclare class` error. Use the `_once` variants to avoid this error. -* If PHPStan crashes without outputting any error, it's quite possible that it's -because of a low memory limit set on your system. **Run PHPStan again** to read a couple of hints -what you can do to prevent the crashes. - -## Code of Conduct - -This project adheres to a [Contributor Code of Conduct](https://github.com/phpstan/phpstan/blob/master/CODE_OF_CONDUCT.md). By participating in this project and its community, you are expected to uphold this code. - -## Contributing - -Any contributions are welcome. - -### Building - -You can either run the whole build including linting and coding standards using - -```bash -vendor/bin/phing -``` - -or run only tests using - -```bash -vendor/bin/phing tests -``` diff --git a/vendor/phpstan/phpstan/appveyor.yml b/vendor/phpstan/phpstan/appveyor.yml deleted file mode 100644 index 8ed4375..0000000 --- a/vendor/phpstan/phpstan/appveyor.yml +++ /dev/null @@ -1,70 +0,0 @@ -build: false -clone_folder: c:\projects\phpstan -clone_depth: 1 -platform: - - x64 -environment: - matrix: - - dependencies: lowest - php_version: 7.1 - - dependencies: highest - php_version: 7.1 - - dependencies: lowest - php_version: 7.2 - - dependencies: highest - php_version: 7.2 - - dependencies: lowest - php_version: 7.3 - - dependencies: highest - php_version: 7.3 - - project_directory: c:\projects\phpstan - composer_directory: c:\tools\composer - composer_executable: c:\tools\composer\composer.phar - composer_installer: c:\tools\composer\installer.php - php_root_directory: c:\tools\php -cache: - - c:\ProgramData\chocolatey\bin -> appveyor.yml - - c:\ProgramData\chocolatey\lib -> appveyor.yml - - c:\tools\composer -> appveyor.yml - - '%LOCALAPPDATA%\Composer -> appveyor.yml' - - c:\tools\php -> appveyor.yml -init: - - ps: $Env:php_directory = $Env:php_root_directory + '\' + $Env:php_version - - ps: $Env:exact_php_version = (((choco search php --exact --all-versions --limit-output | Select-String -pattern $Env:php_version) -replace '[php|]', '') | %{ New-Object System.Version $_ } | Sort-Object | Select-Object -Last 1).ToString() - - ps: $Env:PATH = $Env:php_directory + ';' + $Env:composer_directory + ';' + $Env:PATH - - ps: $Env:COMPOSER_NO_INTERACTION = 1 - - ps: $Env:ANSICON = '121x90 (121x90)' -install: - # Install PHP - - ps: If ((Test-Path $Env:php_directory) -eq $False) { New-Item -Path $Env:php_directory -ItemType 'directory' } - - ps: $php_install_parameters = '"/DontAddToPath /InstallDir:' + $Env:php_directory + '"' - - ps: appveyor-retry choco upgrade php --yes --version=$Env:exact_php_version --params=$php_install_parameters - - # Prepare PHP - - ps: cd $Env:php_directory - - ps: Copy-Item php.ini-production -Destination php.ini - - ps: Add-Content -Path php.ini -Value 'memory_limit=1G' - - ps: Add-Content -Path php.ini -Value 'date.timezone="UTC"' - - ps: Add-Content -Path php.ini -Value 'extension_dir=ext' - - ps: Add-Content -Path php.ini -Value 'extension=php_curl.dll' - - ps: Add-Content -Path php.ini -Value 'extension=php_mbstring.dll' - - ps: Add-Content -Path php.ini -Value 'extension=php_openssl.dll' - - ps: Add-Content -Path php.ini -Value 'extension=php_soap.dll' - - ps: Add-Content -Path php.ini -Value 'extension=php_mysqli.dll' - - ps: Add-Content -Path php.ini -Value 'extension=php_intl.dll' - - ps: php --version - - # Prepare composer - - ps: If ((Test-Path $Env:composer_directory) -eq $False) { New-Item -Path $Env:composer_directory -ItemType 'directory' } - - ps: If ((Test-Path $Env:composer_installer) -eq $False) { appveyor-retry appveyor DownloadFile https://getcomposer.org/installer -FileName $Env:composer_installer } - - ps: If ((Test-Path $Env:composer_executable) -eq $False) { php $Env:composer_installer --install-dir=$Env:composer_directory } - - ps: Set-Content -Path ($Env:composer_directory + '\composer.bat') -Value ('@php ' + $Env:composer_executable + ' %*') - - # Install dependencies - - ps: cd $Env:project_directory - - IF %dependencies%==lowest composer update --prefer-dist --prefer-lowest --prefer-stable --no-progress - - IF %dependencies%==highest composer update --prefer-dist --no-progress -test_script: - - ps: cd $Env:project_directory - - vendor\bin\phing diff --git a/vendor/phpstan/phpstan/bin/phpstan b/vendor/phpstan/phpstan/bin/phpstan deleted file mode 100755 index fd61c2d..0000000 --- a/vendor/phpstan/phpstan/bin/phpstan +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env php -getPrettyVersion(); -} catch (\OutOfBoundsException $e) { - -} - -$application = new \Symfony\Component\Console\Application( - 'PHPStan - PHP Static Analysis Tool', - $version -); -$application->add(new AnalyseCommand()); -$application->add(new DumpDependenciesCommand()); -$application->run(); diff --git a/vendor/phpstan/phpstan/build.xml b/vendor/phpstan/phpstan/build.xml deleted file mode 100644 index a3b1513..0000000 --- a/vendor/phpstan/phpstan/build.xml +++ /dev/null @@ -1,250 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/phpstan/phpstan/composer.json b/vendor/phpstan/phpstan/composer.json deleted file mode 100644 index 88a1a64..0000000 --- a/vendor/phpstan/phpstan/composer.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "name": "phpstan/phpstan", - "description": "PHPStan - PHP Static Analysis Tool", - "license": [ - "MIT" - ], - "require": { - "php": "~7.1", - "composer/xdebug-handler": "^1.3.0", - "jean85/pretty-package-versions": "^1.0.3", - "nette/bootstrap": "^2.4 || ^3.0", - "nette/di": "^2.4.7 || ^3.0", - "nette/neon": "^2.4.3 || ^3.0", - "nette/robot-loader": "^3.0.1", - "nette/schema": "^1.0", - "nette/utils": "^2.4.5 || ^3.0", - "nikic/php-parser": "^4.2.3", - "phpstan/phpdoc-parser": "^0.3.5", - "symfony/console": "~3.2 || ~4.0", - "symfony/finder": "~3.2 || ~4.0" - }, - "conflict": { - "symfony/console": "3.4.16 || 4.1.5" - }, - "require-dev": { - "ext-intl": "*", - "ext-mysqli": "*", - "ext-simplexml": "*", - "ext-soap": "*", - "ext-zip": "*", - "brianium/paratest": "^2.0 || ^3.0", - "consistence/coding-standard": "^3.5", - "dealerdirect/phpcodesniffer-composer-installer": "^0.4.4", - "jakub-onderka/php-parallel-lint": "^1.0", - "localheinz/composer-normalize": "^1.1.0", - "phing/phing": "^2.16.0", - "phpstan/phpstan-deprecation-rules": "^0.11", - "phpstan/phpstan-php-parser": "^0.11", - "phpstan/phpstan-phpunit": "^0.11", - "phpstan/phpstan-strict-rules": "^0.11", - "phpunit/phpunit": "^7.5.14 || ^8.0", - "slevomat/coding-standard": "^4.7.2", - "squizlabs/php_codesniffer": "^3.3.2" - }, - "config": { - "sort-packages": true - }, - "extra": { - "branch-alias": { - "dev-master": "0.11-dev" - } - }, - "autoload": { - "psr-4": { - "PHPStan\\": [ - "src/" - ] - } - }, - "autoload-dev": { - "psr-4": { - "PHPStan\\": [ - "build/PHPStan" - ] - }, - "classmap": [ - "tests/PHPStan" - ] - }, - "minimum-stability": "dev", - "prefer-stable": true, - "bin": [ - "bin/phpstan" - ] -} diff --git a/vendor/phpstan/phpstan/conf/bleedingEdge.neon b/vendor/phpstan/phpstan/conf/bleedingEdge.neon deleted file mode 100644 index 5242564..0000000 --- a/vendor/phpstan/phpstan/conf/bleedingEdge.neon +++ /dev/null @@ -1,13 +0,0 @@ -parameters: - featureToggles: - deadCatchesRule: true - invalidVarTag: true - missingReturnRule: true - noopRule: true - subtractableTypes: true - tooWideTypehints: true - unreachableStatement: true - yieldRules: true - validateParameters: true - allowVarTagAboveStatements: true - newStatic: true diff --git a/vendor/phpstan/phpstan/conf/config.level0.neon b/vendor/phpstan/phpstan/conf/config.level0.neon deleted file mode 100644 index 13629f2..0000000 --- a/vendor/phpstan/phpstan/conf/config.level0.neon +++ /dev/null @@ -1,170 +0,0 @@ -parameters: - customRulesetUsed: false - featureToggles: - missingReturnRule: false - missingClosureNativeReturnTypehintRule: false - newStatic: false - missingClosureNativeReturnCheckObjectTypehint: false - -conditionalTags: - PHPStan\Rules\Classes\NewStaticRule: - phpstan.rules.rule: %featureToggles.newStatic% - PHPStan\Rules\Missing\MissingClosureNativeReturnTypehintRule: - phpstan.rules.rule: %featureToggles.missingClosureNativeReturnTypehintRule% - PHPStan\Rules\Missing\MissingReturnRule: - phpstan.rules.rule: %featureToggles.missingReturnRule% - -parametersSchema: - missingClosureNativeReturnCheckObjectTypehint: bool() - -rules: - - PHPStan\Rules\Arrays\DuplicateKeysInLiteralArraysRule - - PHPStan\Rules\Arrays\OffsetAccessWithoutDimForReadingRule - - PHPStan\Rules\Classes\ClassConstantDeclarationRule - - PHPStan\Rules\Classes\ClassConstantRule - - PHPStan\Rules\Classes\ExistingClassesInClassImplementsRule - - PHPStan\Rules\Classes\ExistingClassesInInterfaceExtendsRule - - PHPStan\Rules\Classes\ExistingClassInClassExtendsRule - - PHPStan\Rules\Classes\ExistingClassInTraitUseRule - - PHPStan\Rules\Classes\InstantiationRule - - PHPStan\Rules\Classes\RequireParentConstructCallRule - - PHPStan\Rules\Classes\UnusedConstructorParametersRule - - PHPStan\Rules\Functions\CallToFunctionParametersRule - - PHPStan\Rules\Functions\ExistingClassesInArrowFunctionTypehintsRule - - PHPStan\Rules\Functions\ExistingClassesInClosureTypehintsRule - - PHPStan\Rules\Functions\ExistingClassesInTypehintsRule - - PHPStan\Rules\Functions\InnerFunctionRule - - PHPStan\Rules\Functions\NonExistentDefinedFunctionRule - - PHPStan\Rules\Functions\PrintfParametersRule - - PHPStan\Rules\Functions\UnusedClosureUsesRule - - PHPStan\Rules\Methods\ExistingClassesInTypehintsRule - - PHPStan\Rules\Properties\AccessPropertiesInAssignRule - - PHPStan\Rules\Properties\AccessStaticPropertiesInAssignRule - - PHPStan\Rules\Variables\ThisVariableRule - -services: - - - class: PHPStan\Rules\Classes\ExistingClassInInstanceOfRule - tags: - - phpstan.rules.rule - arguments: - checkClassCaseSensitivity: %checkClassCaseSensitivity% - - - - class: PHPStan\Rules\Classes\NewStaticRule - - - - class: PHPStan\Rules\Exceptions\CaughtExceptionExistenceRule - tags: - - phpstan.rules.rule - arguments: - checkClassCaseSensitivity: %checkClassCaseSensitivity% - - - - class: PHPStan\Rules\Functions\CallToNonExistentFunctionRule - tags: - - phpstan.rules.rule - arguments: - checkFunctionNameCase: %checkFunctionNameCase% - - - - class: PHPStan\Rules\Methods\CallMethodsRule - tags: - - phpstan.rules.rule - arguments: - checkFunctionNameCase: %checkFunctionNameCase% - reportMagicMethods: %reportMagicMethods% - - - - class: PHPStan\Rules\Methods\CallStaticMethodsRule - tags: - - phpstan.rules.rule - arguments: - checkFunctionNameCase: %checkFunctionNameCase% - reportMagicMethods: %reportMagicMethods% - - - - class: PHPStan\Rules\Missing\MissingClosureNativeReturnTypehintRule - arguments: - checkObjectTypehint: %missingClosureNativeReturnCheckObjectTypehint% - - - - class: PHPStan\Rules\Missing\MissingReturnRule - arguments: - checkExplicitMixedMissingReturn: %checkExplicitMixedMissingReturn% - checkPhpDocMissingReturn: %checkPhpDocMissingReturn% - - - - class: PHPStan\Rules\Namespaces\ExistingNamesInGroupUseRule - tags: - - phpstan.rules.rule - arguments: - checkFunctionNameCase: %checkFunctionNameCase% - - - - class: PHPStan\Rules\Namespaces\ExistingNamesInUseRule - tags: - - phpstan.rules.rule - arguments: - checkFunctionNameCase: %checkFunctionNameCase% - - - - class: PHPStan\Rules\Operators\InvalidIncDecOperationRule - tags: - - phpstan.rules.rule - arguments: - checkThisOnly: %checkThisOnly% - - - - class: PHPStan\Rules\Properties\AccessPropertiesRule - tags: - - phpstan.rules.rule - arguments: - reportMagicProperties: %reportMagicProperties% - - - - class: PHPStan\Rules\Properties\AccessStaticPropertiesRule - tags: - - phpstan.rules.rule - - - - class: PHPStan\Rules\Properties\ExistingClassesInPropertiesRule - tags: - - phpstan.rules.rule - arguments: - checkClassCaseSensitivity: %checkClassCaseSensitivity% - checkThisOnly: %checkThisOnly% - - - - class: PHPStan\Rules\Properties\WritingToReadOnlyPropertiesRule - arguments: - checkThisOnly: %checkThisOnly% - tags: - - phpstan.rules.rule - - - - class: PHPStan\Rules\Properties\ReadingWriteOnlyPropertiesRule - arguments: - checkThisOnly: %checkThisOnly% - tags: - - phpstan.rules.rule - - - - class: PHPStan\Rules\Variables\DefinedVariableRule - arguments: - cliArgumentsVariablesRegistered: %cliArgumentsVariablesRegistered% - checkMaybeUndefinedVariables: %checkMaybeUndefinedVariables% - tags: - - phpstan.rules.rule - - - - class: PHPStan\Rules\Variables\DefinedVariableInAnonymousFunctionUseRule - arguments: - checkMaybeUndefinedVariables: %checkMaybeUndefinedVariables% - tags: - - phpstan.rules.rule - - - - class: PHPStan\Rules\Regexp\RegularExpressionPatternRule - tags: - - phpstan.rules.rule diff --git a/vendor/phpstan/phpstan/conf/config.level1.neon b/vendor/phpstan/phpstan/conf/config.level1.neon deleted file mode 100644 index df5b4d3..0000000 --- a/vendor/phpstan/phpstan/conf/config.level1.neon +++ /dev/null @@ -1,11 +0,0 @@ -includes: - - config.level0.neon - -parameters: - checkMaybeUndefinedVariables: true - reportMagicMethods: true - reportMagicProperties: true - -rules: - - PHPStan\Rules\Constants\ConstantRule - - PHPStan\Rules\Variables\VariableCertaintyInIssetRule diff --git a/vendor/phpstan/phpstan/conf/config.level2.neon b/vendor/phpstan/phpstan/conf/config.level2.neon deleted file mode 100644 index 7082299..0000000 --- a/vendor/phpstan/phpstan/conf/config.level2.neon +++ /dev/null @@ -1,45 +0,0 @@ -includes: - - config.level1.neon - -parameters: - featureToggles: - invalidVarTag: false - checkClassCaseSensitivity: true - checkThisOnly: false - checkPhpDocMissingReturn: true - -rules: - - PHPStan\Rules\Cast\EchoRule - - PHPStan\Rules\Cast\InvalidCastRule - - PHPStan\Rules\Cast\InvalidPartOfEncapsedStringRule - - PHPStan\Rules\Cast\PrintRule - - PHPStan\Rules\Functions\IncompatibleDefaultParameterTypeRule - - PHPStan\Rules\Methods\IncompatibleDefaultParameterTypeRule - - PHPStan\Rules\Operators\InvalidBinaryOperationRule - - PHPStan\Rules\Operators\InvalidUnaryOperationRule - - PHPStan\Rules\Operators\InvalidComparisonOperationRule - - PHPStan\Rules\PhpDoc\IncompatiblePhpDocTypeRule - - PHPStan\Rules\PhpDoc\IncompatiblePropertyPhpDocTypeRule - - PHPStan\Rules\PhpDoc\InvalidPhpDocTagValueRule - - PHPStan\Rules\PhpDoc\InvalidThrowsPhpDocValueRule - -conditionalTags: - PHPStan\Rules\PhpDoc\InvalidPhpDocVarTagTypeRule: - phpstan.rules.rule: %featureToggles.invalidVarTag% - PHPStan\Rules\PhpDoc\WrongVariableNameInVarTagRule: - phpstan.rules.rule: %featureToggles.invalidVarTag% - -services: - - - class: PHPStan\Rules\Functions\CallCallablesRule - arguments: - reportMaybes: %reportMaybes% - tags: - - phpstan.rules.rule - - - class: PHPStan\Rules\PhpDoc\InvalidPhpDocVarTagTypeRule - arguments: - checkClassCaseSensitivity: %checkClassCaseSensitivity% - - - - class: PHPStan\Rules\PhpDoc\WrongVariableNameInVarTagRule diff --git a/vendor/phpstan/phpstan/conf/config.level3.neon b/vendor/phpstan/phpstan/conf/config.level3.neon deleted file mode 100644 index 74f1efb..0000000 --- a/vendor/phpstan/phpstan/conf/config.level3.neon +++ /dev/null @@ -1,78 +0,0 @@ -includes: - - config.level2.neon - -rules: - - PHPStan\Rules\Arrays\AppendedArrayItemTypeRule - - PHPStan\Rules\Arrays\IterableInForeachRule - - PHPStan\Rules\Arrays\OffsetAccessAssignmentRule - - PHPStan\Rules\Arrays\OffsetAccessAssignOpRule - - PHPStan\Rules\Functions\ArrowFunctionReturnTypeRule - - PHPStan\Rules\Functions\ClosureReturnTypeRule - - PHPStan\Rules\Functions\ReturnTypeRule - - PHPStan\Rules\Methods\ReturnTypeRule - - PHPStan\Rules\Properties\DefaultValueTypesAssignedToPropertiesRule - - PHPStan\Rules\Properties\TypesAssignedToPropertiesRule - - PHPStan\Rules\Variables\ThrowTypeRule - - PHPStan\Rules\Variables\VariableCloningRule - -parameters: - featureToggles: - yieldRules: false - -conditionalTags: - PHPStan\Rules\Generators\YieldFromTypeRule: - phpstan.rules.rule: %featureToggles.yieldRules% - PHPStan\Rules\Generators\YieldInGeneratorRule: - phpstan.rules.rule: %featureToggles.yieldRules% - PHPStan\Rules\Generators\YieldTypeRule: - phpstan.rules.rule: %featureToggles.yieldRules% - -services: - - - class: PHPStan\Rules\Arrays\AppendedArrayKeyTypeRule - arguments: - checkUnionTypes: %checkUnionTypes% - tags: - - phpstan.rules.rule - - - - class: PHPStan\Rules\Arrays\InvalidKeyInArrayDimFetchRule - arguments: - reportMaybes: %reportMaybes% - tags: - - phpstan.rules.rule - - - - class: PHPStan\Rules\Arrays\InvalidKeyInArrayItemRule - arguments: - reportMaybes: %reportMaybes% - tags: - - phpstan.rules.rule - - - - class: PHPStan\Rules\Arrays\NonexistentOffsetInArrayDimFetchRule - arguments: - reportMaybes: %reportMaybes% - tags: - - phpstan.rules.rule - - - - class: PHPStan\Rules\Generators\YieldFromTypeRule - arguments: - reportMaybes: %reportMaybes% - - - - class: PHPStan\Rules\Generators\YieldInGeneratorRule - arguments: - reportMaybes: %reportMaybes% - - - - class: PHPStan\Rules\Generators\YieldTypeRule - - - - class: PHPStan\Rules\Methods\MethodSignatureRule - arguments: - reportMaybes: %reportMaybesInMethodSignatures% - reportStatic: %reportStaticMethodSignatures% - tags: - - phpstan.rules.rule diff --git a/vendor/phpstan/phpstan/conf/config.level4.neon b/vendor/phpstan/phpstan/conf/config.level4.neon deleted file mode 100644 index 5a7a8c2..0000000 --- a/vendor/phpstan/phpstan/conf/config.level4.neon +++ /dev/null @@ -1,88 +0,0 @@ -includes: - - config.level3.neon - -rules: - - PHPStan\Rules\Arrays\DeadForeachRule - - PHPStan\Rules\Comparison\BooleanAndConstantConditionRule - - PHPStan\Rules\Comparison\BooleanNotConstantConditionRule - - PHPStan\Rules\Comparison\BooleanOrConstantConditionRule - - PHPStan\Rules\Comparison\ElseIfConstantConditionRule - - PHPStan\Rules\Comparison\IfConstantConditionRule - - PHPStan\Rules\Comparison\TernaryOperatorConstantConditionRule - - PHPStan\Rules\Comparison\UnreachableIfBranchesRule - - PHPStan\Rules\Comparison\UnreachableTernaryElseBranchRule - -parameters: - featureToggles: - deadCatchesRule: false - noopRule: false - tooWideTypehints: false - unreachableStatement: false - -conditionalTags: - PHPStan\Rules\Exceptions\DeadCatchRule: - phpstan.rules.rule: %featureToggles.deadCatchesRule% - PHPStan\Rules\DeadCode\NoopRule: - phpstan.rules.rule: %featureToggles.noopRule% - PHPStan\Rules\DeadCode\UnreachableStatementRule: - phpstan.rules.rule: %featureToggles.unreachableStatement% - PHPStan\Rules\TooWideTypehints\TooWideClosureReturnTypehintRule: - phpstan.rules.rule: %featureToggles.tooWideTypehints% - PHPStan\Rules\TooWideTypehints\TooWideFunctionReturnTypehintRule: - phpstan.rules.rule: %featureToggles.tooWideTypehints% - PHPStan\Rules\TooWideTypehints\TooWidePrivateMethodReturnTypehintRule: - phpstan.rules.rule: %featureToggles.tooWideTypehints% - -services: - - - class: PHPStan\Rules\Classes\ImpossibleInstanceOfRule - arguments: - checkAlwaysTrueInstanceof: %checkAlwaysTrueInstanceof% - tags: - - phpstan.rules.rule - - - - class: PHPStan\Rules\Comparison\ImpossibleCheckTypeFunctionCallRule - arguments: - checkAlwaysTrueCheckTypeFunctionCall: %checkAlwaysTrueCheckTypeFunctionCall% - tags: - - phpstan.rules.rule - - - - class: PHPStan\Rules\Comparison\ImpossibleCheckTypeMethodCallRule - arguments: - checkAlwaysTrueCheckTypeFunctionCall: %checkAlwaysTrueCheckTypeFunctionCall% - tags: - - phpstan.rules.rule - - - - class: PHPStan\Rules\Comparison\ImpossibleCheckTypeStaticMethodCallRule - arguments: - checkAlwaysTrueCheckTypeFunctionCall: %checkAlwaysTrueCheckTypeFunctionCall% - tags: - - phpstan.rules.rule - - - - class: PHPStan\Rules\Comparison\StrictComparisonOfDifferentTypesRule - arguments: - checkAlwaysTrueStrictComparison: %checkAlwaysTrueStrictComparison% - tags: - - phpstan.rules.rule - - - - class: PHPStan\Rules\Exceptions\DeadCatchRule - - - - class: PHPStan\Rules\DeadCode\NoopRule - - - - class: PHPStan\Rules\DeadCode\UnreachableStatementRule - - - - class: PHPStan\Rules\TooWideTypehints\TooWideClosureReturnTypehintRule - - - - class: PHPStan\Rules\TooWideTypehints\TooWideFunctionReturnTypehintRule - - - - class: PHPStan\Rules\TooWideTypehints\TooWidePrivateMethodReturnTypehintRule diff --git a/vendor/phpstan/phpstan/conf/config.level5.neon b/vendor/phpstan/phpstan/conf/config.level5.neon deleted file mode 100644 index 8ebba4d..0000000 --- a/vendor/phpstan/phpstan/conf/config.level5.neon +++ /dev/null @@ -1,6 +0,0 @@ -includes: - - config.level4.neon - -parameters: - checkFunctionArgumentTypes: true - checkArgumentsPassedByReference: true diff --git a/vendor/phpstan/phpstan/conf/config.level6.neon b/vendor/phpstan/phpstan/conf/config.level6.neon deleted file mode 100644 index aee6ed3..0000000 --- a/vendor/phpstan/phpstan/conf/config.level6.neon +++ /dev/null @@ -1,6 +0,0 @@ -includes: - - config.level5.neon - -parameters: - checkUnionTypes: true - reportMaybes: true diff --git a/vendor/phpstan/phpstan/conf/config.level7.neon b/vendor/phpstan/phpstan/conf/config.level7.neon deleted file mode 100644 index a124f8e..0000000 --- a/vendor/phpstan/phpstan/conf/config.level7.neon +++ /dev/null @@ -1,5 +0,0 @@ -includes: - - config.level6.neon - -parameters: - checkNullables: true diff --git a/vendor/phpstan/phpstan/conf/config.levelmax.neon b/vendor/phpstan/phpstan/conf/config.levelmax.neon deleted file mode 100644 index e506402..0000000 --- a/vendor/phpstan/phpstan/conf/config.levelmax.neon +++ /dev/null @@ -1,2 +0,0 @@ -includes: - - config.level7.neon diff --git a/vendor/phpstan/phpstan/conf/config.neon b/vendor/phpstan/phpstan/conf/config.neon deleted file mode 100644 index 2cfb9e4..0000000 --- a/vendor/phpstan/phpstan/conf/config.neon +++ /dev/null @@ -1,759 +0,0 @@ -parameters: - bootstrap: null - excludes_analyse: [] - autoload_directories: [] - autoload_files: [] - level: null - paths: [] - featureToggles: - subtractableTypes: false - validateParameters: false - allowVarTagAboveStatements: false - fileExtensions: - - php - checkAlwaysTrueCheckTypeFunctionCall: false - checkAlwaysTrueInstanceof: false - checkAlwaysTrueStrictComparison: false - checkClassCaseSensitivity: false - checkFunctionArgumentTypes: false - checkFunctionNameCase: false - checkArgumentsPassedByReference: false - checkMaybeUndefinedVariables: false - checkNullables: false - checkThisOnly: true - checkUnionTypes: false - checkExplicitMixedMissingReturn: false - checkPhpDocMissingReturn: false - inferPrivatePropertyTypeFromConstructor: false - reportMaybes: false - reportMaybesInMethodSignatures: false - reportStaticMethodSignatures: false - polluteScopeWithLoopInitialAssignments: true - polluteScopeWithAlwaysIterableForeach: true - polluteCatchScopeWithTryAssignments: false - tipsOfTheDay: true - reportMagicMethods: false - reportMagicProperties: false - ignoreErrors: [] - internalErrorsCountLimit: 50 - cache: - nodesByFileCountMax: 512 - nodesByStringCountMax: 512 - reportUnmatchedIgnoredErrors: true - scopeClass: PHPStan\Analyser\Scope - universalObjectCratesClasses: - - stdClass - earlyTerminatingMethodCalls: [] - memoryLimitFile: %tmpDir%/.memory_limit - benchmarkFile: null - dynamicConstantNames: - - ICONV_IMPL - - PHP_VERSION - - PHP_MAJOR_VERSION - - PHP_MINOR_VERSION - - PHP_RELEASE_VERSION - - PHP_VERSION_ID - - PHP_EXTRA_VERSION - - PHP_ZTS - - PHP_DEBUG - - PHP_MAXPATHLEN - - PHP_OS - - PHP_OS_FAMILY - - PHP_SAPI - - PHP_EOL - - PHP_INT_MAX - - PHP_INT_MIN - - PHP_INT_SIZE - - PHP_FLOAT_DIG - - PHP_FLOAT_EPSILON - - PHP_FLOAT_MIN - - PHP_FLOAT_MAX - - DEFAULT_INCLUDE_PATH - - PEAR_INSTALL_DIR - - PEAR_EXTENSION_DIR - - PHP_EXTENSION_DIR - - PHP_PREFIX - - PHP_BINDIR - - PHP_BINARY - - PHP_MANDIR - - PHP_LIBDIR - - PHP_DATADIR - - PHP_SYSCONFDIR - - PHP_LOCALSTATEDIR - - PHP_CONFIG_FILE_PATH - - PHP_CONFIG_FILE_SCAN_DIR - - PHP_SHLIB_SUFFIX - - PHP_FD_SETSIZE - -extensions: - rules: PHPStan\DependencyInjection\RulesExtension - conditionalTags: PHPStan\DependencyInjection\ConditionalTagsExtension - parametersSchema: PHPStan\DependencyInjection\ParametersSchemaExtension - -parametersSchema: - bootstrap: schema(string(), nullable()) - excludes_analyse: listOf(string()) - autoload_directories: listOf(string()) - autoload_files: listOf(string()) - level: schema(anyOf(int(), string()), nullable()) - paths: listOf(string()) - featureToggles: arrayOf(bool()) - fileExtensions: listOf(string()) - checkAlwaysTrueCheckTypeFunctionCall: bool() - checkAlwaysTrueInstanceof: bool() - checkAlwaysTrueStrictComparison: bool() - checkClassCaseSensitivity: bool() - checkFunctionArgumentTypes: bool() - checkFunctionNameCase: bool() - checkArgumentsPassedByReference: bool() - checkMaybeUndefinedVariables: bool() - checkNullables: bool() - checkThisOnly: bool() - checkUnionTypes: bool() - checkExplicitMixedMissingReturn: bool() - checkPhpDocMissingReturn: bool() - inferPrivatePropertyTypeFromConstructor: bool() - tipsOfTheDay: bool() - reportMaybes: bool() - reportMaybesInMethodSignatures: bool() - reportStaticMethodSignatures: bool() - polluteScopeWithLoopInitialAssignments: bool() - polluteScopeWithAlwaysIterableForeach: bool() - polluteCatchScopeWithTryAssignments: bool() - reportMagicMethods: bool() - reportMagicProperties: bool() - ignoreErrors: listOf( - anyOf( - string(), - structure([ - message: string() - path: string() - ]), - structure([ - message: string() - count: int() - path: string() - ]), - structure([ - message: string() - paths: listOf(string()) - ]) - ) - ) - internalErrorsCountLimit: int() - cache: structure([ - nodesByFileCountMax: int() - nodesByStringCountMax: int() - ]) - reportUnmatchedIgnoredErrors: bool() - scopeClass: string() - universalObjectCratesClasses: listOf(string()) - earlyTerminatingMethodCalls: arrayOf(listOf(string())) - memoryLimitFile: string() - benchmarkFile: schema(string(), nullable()) - dynamicConstantNames: listOf(string()) - customRulesetUsed: bool() - rootDir: string() - tmpDir: string() - currentWorkingDirectory: string() - cliArgumentsVariablesRegistered: bool() - - # irrelevant Nette parameters - debugMode: bool() - productionMode: bool() - tempDir: string() - -services: - - - class: PhpParser\BuilderFactory - - - - class: PhpParser\Lexer - - - - class: PhpParser\NodeTraverser - setup: - - addVisitor(@PhpParser\NodeVisitor\NameResolver) - - - - class: PhpParser\NodeVisitor\NameResolver - - - - class: PhpParser\Parser\Php7 - - - - class: PhpParser\PrettyPrinter\Standard - - - - class: PHPStan\Broker\AnonymousClassNameHelper - arguments: - relativePathHelper: @simpleRelativePathHelper - - - - class: PHPStan\PhpDocParser\Lexer\Lexer - - - - class: PHPStan\PhpDocParser\Parser\TypeParser - - - - class: PHPStan\PhpDocParser\Parser\ConstExprParser - - - - class: PHPStan\PhpDocParser\Parser\PhpDocParser - - - - class: PHPStan\PhpDoc\PhpDocNodeResolver - - - - class: PHPStan\PhpDoc\PhpDocStringResolver - - - - class: PHPStan\PhpDoc\TypeNodeResolver - factory: @typeNodeResolverFactory::create - - - - class: PHPStan\PhpDoc\TypeStringResolver - - - - class: PHPStan\Analyser\Analyser - arguments: - ignoreErrors: %ignoreErrors% - reportUnmatchedIgnoredErrors: %reportUnmatchedIgnoredErrors% - internalErrorsCountLimit: %internalErrorsCountLimit% - benchmarkFile: %benchmarkFile% - - - - class: PHPStan\Analyser\ScopeFactory - arguments: - scopeClass: %scopeClass% - - - - class: PHPStan\Analyser\NodeScopeResolver - arguments: - polluteScopeWithLoopInitialAssignments: %polluteScopeWithLoopInitialAssignments% - polluteCatchScopeWithTryAssignments: %polluteCatchScopeWithTryAssignments% - polluteScopeWithAlwaysIterableForeach: %polluteScopeWithAlwaysIterableForeach% - earlyTerminatingMethodCalls: %earlyTerminatingMethodCalls% - allowVarTagAboveStatements: %featureToggles.allowVarTagAboveStatements% - - - - class: PHPStan\Cache\Cache - arguments: - storage: @cacheStorage - - - - class: PHPStan\Command\AnalyseApplication - arguments: - memoryLimitFile: %memoryLimitFile% - currentWorkingDirectory: %currentWorkingDirectory% - - - - class: PHPStan\Dependency\DependencyDumper - - - - class: PHPStan\Dependency\DependencyResolver - - - - class: PHPStan\DependencyInjection\Container - factory: PHPStan\DependencyInjection\Nette\NetteContainer - - - - class: PHPStan\File\FileHelper - arguments: - workingDirectory: %currentWorkingDirectory% - - - - class: PHPStan\File\FileExcluder - arguments: - analyseExcludes: %excludes_analyse% - - - - class: PHPStan\File\FileFinder - arguments: - fileExtensions: %fileExtensions% - - - - class: PHPStan\Parser\CachedParser - arguments: - originalParser: @directParser - cachedNodesByFileCountMax: %cache.nodesByFileCountMax% - cachedNodesByStringCountMax: %cache.nodesByStringCountMax% - - - - class: PHPStan\Parser\FunctionCallStatementFinder - - - - implement: PHPStan\Reflection\FunctionReflectionFactory - - - - class: PHPStan\Reflection\Annotations\AnnotationsMethodsClassReflectionExtension - - - - class: PHPStan\Reflection\Annotations\AnnotationsPropertiesClassReflectionExtension - - - - class: PHPStan\Reflection\Php\PhpClassReflectionExtension - arguments: - inferPrivatePropertyTypeFromConstructor: %inferPrivatePropertyTypeFromConstructor% - - - - class: PHPStan\Reflection\PhpDefect\PhpDefectClassReflectionExtension - - - - implement: PHPStan\Reflection\Php\PhpMethodReflectionFactory - - - - class: PHPStan\Reflection\Php\UniversalObjectCratesClassReflectionExtension - tags: - - phpstan.broker.propertiesClassReflectionExtension - arguments: - classes: %universalObjectCratesClasses% - - - - class: PHPStan\Reflection\SignatureMap\SignatureMapParser - - - - class: PHPStan\Reflection\SignatureMap\SignatureMapProvider - - - - class: PHPStan\Rules\ClassCaseSensitivityCheck - - - - class: PHPStan\Rules\Comparison\ConstantConditionRuleHelper - - - - class: PHPStan\Rules\Comparison\ImpossibleCheckTypeHelper - - - - class: PHPStan\Rules\FunctionCallParametersCheck - arguments: - checkArgumentTypes: %checkFunctionArgumentTypes% - checkArgumentsPassedByReference: %checkArgumentsPassedByReference% - - - - class: PHPStan\Rules\FunctionDefinitionCheck - arguments: - checkClassCaseSensitivity: %checkClassCaseSensitivity% - checkThisOnly: %checkThisOnly% - - - - class: PHPStan\Rules\FunctionReturnTypeCheck - - - - class: PHPStan\Rules\Properties\PropertyDescriptor - - - - class: PHPStan\Rules\Properties\PropertyReflectionFinder - - - - class: PHPStan\Rules\RegistryFactory - - - - class: PHPStan\Rules\RuleLevelHelper - arguments: - checkNullables: %checkNullables% - checkThisOnly: %checkThisOnly% - checkUnionTypes: %checkUnionTypes% - - - - class: PHPStan\Rules\UnusedFunctionParametersCheck - - - - class: PHPStan\Type\FileTypeMapper - - - - class: PHPStan\Type\Php\ArgumentBasedFunctionReturnTypeExtension - tags: - - phpstan.broker.dynamicFunctionReturnTypeExtension - - - - class: PHPStan\Type\Php\ArrayFillFunctionReturnTypeExtension - tags: - - phpstan.broker.dynamicFunctionReturnTypeExtension - - - - class: PHPStan\Type\Php\ArrayFillKeysFunctionReturnTypeExtension - tags: - - phpstan.broker.dynamicFunctionReturnTypeExtension - - - - class: PHPStan\Type\Php\ArrayFilterFunctionReturnTypeReturnTypeExtension - tags: - - phpstan.broker.dynamicFunctionReturnTypeExtension - - - - class: PHPStan\Type\Php\ArrayKeyDynamicReturnTypeExtension - tags: - - phpstan.broker.dynamicFunctionReturnTypeExtension - - - - class: PHPStan\Type\Php\ArrayKeyExistsFunctionTypeSpecifyingExtension - tags: - - phpstan.typeSpecifier.functionTypeSpecifyingExtension - - - - class: PHPStan\Type\Php\ArrayKeyFirstDynamicReturnTypeExtension - tags: - - phpstan.broker.dynamicFunctionReturnTypeExtension - - - - class: PHPStan\Type\Php\ArrayKeyLastDynamicReturnTypeExtension - tags: - - phpstan.broker.dynamicFunctionReturnTypeExtension - - - - class: PHPStan\Type\Php\ArrayKeysFunctionDynamicReturnTypeExtension - tags: - - phpstan.broker.dynamicFunctionReturnTypeExtension - - - - class: PHPStan\Type\Php\ArrayMapFunctionReturnTypeExtension - tags: - - phpstan.broker.dynamicFunctionReturnTypeExtension - - - - class: PHPStan\Type\Php\ArrayMergeFunctionDynamicReturnTypeExtension - tags: - - phpstan.broker.dynamicFunctionReturnTypeExtension - - - - class: PHPStan\Type\Php\ArrayPopFunctionReturnTypeExtension - tags: - - phpstan.broker.dynamicFunctionReturnTypeExtension - - - - class: PHPStan\Type\Php\ArrayReduceFunctionReturnTypeExtension - tags: - - phpstan.broker.dynamicFunctionReturnTypeExtension - - - - class: PHPStan\Type\Php\ArrayShiftFunctionReturnTypeExtension - tags: - - phpstan.broker.dynamicFunctionReturnTypeExtension - - - - class: PHPStan\Type\Php\ArraySliceFunctionReturnTypeExtension - tags: - - phpstan.broker.dynamicFunctionReturnTypeExtension - - - - class: PHPStan\Type\Php\ArraySearchFunctionDynamicReturnTypeExtension - tags: - - phpstan.broker.dynamicFunctionReturnTypeExtension - - - - class: PHPStan\Type\Php\ArrayValuesFunctionDynamicReturnTypeExtension - tags: - - phpstan.broker.dynamicFunctionReturnTypeExtension - - - - class: PHPStan\Type\Php\CountFunctionReturnTypeExtension - tags: - - phpstan.broker.dynamicFunctionReturnTypeExtension - - - - class: PHPStan\Type\Php\CountFunctionTypeSpecifyingExtension - tags: - - phpstan.typeSpecifier.functionTypeSpecifyingExtension - - - - class: PHPStan\Type\Php\CurlInitReturnTypeExtension - tags: - - phpstan.broker.dynamicFunctionReturnTypeExtension - - - - class: PHPStan\Type\Php\DioStatDynamicFunctionReturnTypeExtension - tags: - - phpstan.broker.dynamicFunctionReturnTypeExtension - - - - class: PHPStan\Type\Php\ExplodeFunctionDynamicReturnTypeExtension - tags: - - phpstan.broker.dynamicFunctionReturnTypeExtension - - - - class: PHPStan\Type\Php\FilterVarDynamicReturnTypeExtension - tags: - - phpstan.broker.dynamicFunctionReturnTypeExtension - - - - class: PHPStan\Type\Php\GetParentClassDynamicFunctionReturnTypeExtension - tags: - - phpstan.broker.dynamicFunctionReturnTypeExtension - - - - class: PHPStan\Type\Php\GettimeofdayDynamicFunctionReturnTypeExtension - tags: - - phpstan.broker.dynamicFunctionReturnTypeExtension - - - - class: PHPStan\Type\Php\SimpleXMLElementClassPropertyReflectionExtension - tags: - - phpstan.broker.propertiesClassReflectionExtension - - - - class: PHPStan\Type\Php\StatDynamicReturnTypeExtension - tags: - - phpstan.broker.dynamicFunctionReturnTypeExtension - - phpstan.broker.dynamicMethodReturnTypeExtension - - - - class: PHPStan\Type\Php\MethodExistsTypeSpecifyingExtension - tags: - - phpstan.typeSpecifier.functionTypeSpecifyingExtension - - - - class: PHPStan\Type\Php\PropertyExistsTypeSpecifyingExtension - tags: - - phpstan.typeSpecifier.functionTypeSpecifyingExtension - - - - class: PHPStan\Type\Php\MinMaxFunctionReturnTypeExtension - tags: - - phpstan.broker.dynamicFunctionReturnTypeExtension - - - - class: PHPStan\Type\Php\PathinfoFunctionDynamicReturnTypeExtension - tags: - - phpstan.broker.dynamicFunctionReturnTypeExtension - - - - class: PHPStan\Type\Php\ReplaceFunctionsDynamicReturnTypeExtension - tags: - - phpstan.broker.dynamicFunctionReturnTypeExtension - - - - class: PHPStan\Type\Php\ArrayPointerFunctionsDynamicReturnTypeExtension - tags: - - phpstan.broker.dynamicFunctionReturnTypeExtension - - - - class: PHPStan\Type\Php\VarExportFunctionDynamicReturnTypeExtension - tags: - - phpstan.broker.dynamicFunctionReturnTypeExtension - - - - class: PHPStan\Type\Php\MbFunctionsReturnTypeExtension - tags: - - phpstan.broker.dynamicFunctionReturnTypeExtension - - - - class: PHPStan\Type\Php\MicrotimeFunctionReturnTypeExtension - tags: - - phpstan.broker.dynamicFunctionReturnTypeExtension - - - - class: PHPStan\Type\Php\HrtimeFunctionReturnTypeExtension - tags: - - phpstan.broker.dynamicFunctionReturnTypeExtension - - - - class: PHPStan\Type\Php\ParseUrlFunctionDynamicReturnTypeExtension - tags: - - phpstan.broker.dynamicFunctionReturnTypeExtension - - - - class: PHPStan\Type\Php\VersionCompareFunctionDynamicReturnTypeExtension - tags: - - phpstan.broker.dynamicFunctionReturnTypeExtension - - - - class: PHPStan\Type\Php\StrtotimeFunctionReturnTypeExtension - tags: - - phpstan.broker.dynamicFunctionReturnTypeExtension - - - - class: PHPStan\Type\Php\RangeFunctionReturnTypeExtension - tags: - - phpstan.broker.dynamicFunctionReturnTypeExtension - - - - class: PHPStan\Type\Php\AssertFunctionTypeSpecifyingExtension - tags: - - phpstan.typeSpecifier.functionTypeSpecifyingExtension - - - - class: PHPStan\Type\Php\DefineConstantTypeSpecifyingExtension - tags: - - phpstan.typeSpecifier.functionTypeSpecifyingExtension - - - - class: PHPStan\Type\Php\DefinedConstantTypeSpecifyingExtension - tags: - - phpstan.typeSpecifier.functionTypeSpecifyingExtension - - - - class: PHPStan\Type\Php\InArrayFunctionTypeSpecifyingExtension - tags: - - phpstan.typeSpecifier.functionTypeSpecifyingExtension - - - - class: PHPStan\Type\Php\IsIntFunctionTypeSpecifyingExtension - tags: - - phpstan.typeSpecifier.functionTypeSpecifyingExtension - - - - class: PHPStan\Type\Php\IsFloatFunctionTypeSpecifyingExtension - tags: - - phpstan.typeSpecifier.functionTypeSpecifyingExtension - - - - class: PHPStan\Type\Php\IsNullFunctionTypeSpecifyingExtension - tags: - - phpstan.typeSpecifier.functionTypeSpecifyingExtension - - - - class: PHPStan\Type\Php\IsArrayFunctionTypeSpecifyingExtension - tags: - - phpstan.typeSpecifier.functionTypeSpecifyingExtension - - - - class: PHPStan\Type\Php\IsBoolFunctionTypeSpecifyingExtension - tags: - - phpstan.typeSpecifier.functionTypeSpecifyingExtension - - - - class: PHPStan\Type\Php\IsCallableFunctionTypeSpecifyingExtension - tags: - - phpstan.typeSpecifier.functionTypeSpecifyingExtension - - - - class: PHPStan\Type\Php\IsCountableFunctionTypeSpecifyingExtension - tags: - - phpstan.typeSpecifier.functionTypeSpecifyingExtension - - - - class: PHPStan\Type\Php\IsResourceFunctionTypeSpecifyingExtension - tags: - - phpstan.typeSpecifier.functionTypeSpecifyingExtension - - - - class: PHPStan\Type\Php\IsIterableFunctionTypeSpecifyingExtension - tags: - - phpstan.typeSpecifier.functionTypeSpecifyingExtension - - - - class: PHPStan\Type\Php\IsStringFunctionTypeSpecifyingExtension - tags: - - phpstan.typeSpecifier.functionTypeSpecifyingExtension - - - - class: PHPStan\Type\Php\IsSubclassOfFunctionTypeSpecifyingExtension - tags: - - phpstan.typeSpecifier.functionTypeSpecifyingExtension - - - - class: PHPStan\Type\Php\IsObjectFunctionTypeSpecifyingExtension - tags: - - phpstan.typeSpecifier.functionTypeSpecifyingExtension - - - - class: PHPStan\Type\Php\IsNumericFunctionTypeSpecifyingExtension - tags: - - phpstan.typeSpecifier.functionTypeSpecifyingExtension - - - - class: PHPStan\Type\Php\IsScalarFunctionTypeSpecifyingExtension - tags: - - phpstan.typeSpecifier.functionTypeSpecifyingExtension - - - - class: PHPStan\Type\Php\IsAFunctionTypeSpecifyingExtension - tags: - - phpstan.typeSpecifier.functionTypeSpecifyingExtension - - - - class: PHPStan\Type\Php\JsonThrowOnErrorDynamicReturnTypeExtension - tags: - - phpstan.broker.dynamicFunctionReturnTypeExtension - - - - class: PHPStan\Type\Php\TypeSpecifyingFunctionsDynamicReturnTypeExtension - tags: - - phpstan.broker.dynamicFunctionReturnTypeExtension - - - - class: PHPStan\Type\Php\StrSplitFunctionReturnTypeExtension - tags: - - phpstan.broker.dynamicFunctionReturnTypeExtension - - - - class: PHPStan\Type\Php\SprintfFunctionDynamicReturnTypeExtension - tags: - - phpstan.broker.dynamicFunctionReturnTypeExtension - - typeSpecifier: - class: PHPStan\Analyser\TypeSpecifier - factory: @typeSpecifierFactory::create - - typeSpecifierFactory: - class: PHPStan\Analyser\TypeSpecifierFactory - - relativePathHelper: - class: PHPStan\File\RelativePathHelper - dynamic: true - autowired: true - - simpleRelativePathHelper: - class: PHPStan\File\RelativePathHelper - factory: PHPStan\File\SimpleRelativePathHelper - arguments: - currentWorkingDirectory: %currentWorkingDirectory% - autowired: false - - broker: - class: PHPStan\Broker\Broker - factory: @brokerFactory::create - - brokerFactory: - class: PHPStan\Broker\BrokerFactory - - cacheStorage: - class: PHPStan\Cache\FileCacheStorage - arguments: - directory: %tmpDir%/cache/PHPStan - autowired: no - - directParser: - class: PHPStan\Parser\DirectParser - autowired: no - - registry: - class: PHPStan\Rules\Registry - factory: @PHPStan\Rules\RegistryFactory::create - - typeNodeResolverFactory: - class: PHPStan\PhpDoc\TypeNodeResolverFactory - - errorFormatter.raw: - class: PHPStan\Command\ErrorFormatter\RawErrorFormatter - - errorFormatter.baselineNeon: - class: PHPStan\Command\ErrorFormatter\BaselineNeonErrorFormatter - arguments: - relativePathHelper: @simpleRelativePathHelper - - errorFormatter.table: - class: PHPStan\Command\ErrorFormatter\TableErrorFormatter - arguments: - showTipsOfTheDay: %tipsOfTheDay% - checkThisOnly: %checkThisOnly% - inferPrivatePropertyTypeFromConstructor: %inferPrivatePropertyTypeFromConstructor% - - errorFormatter.checkstyle: - class: PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter - arguments: - relativePathHelper: @simpleRelativePathHelper - - errorFormatter.json: - class: PHPStan\Command\ErrorFormatter\JsonErrorFormatter - arguments: - pretty: false - - errorFormatter.prettyJson: - class: PHPStan\Command\ErrorFormatter\JsonErrorFormatter - arguments: - pretty: true - - errorFormatter.gitlab: - class: PHPStan\Command\ErrorFormatter\GitlabErrorFormatter diff --git a/vendor/phpstan/phpstan/phpcs.xml b/vendor/phpstan/phpstan/phpcs.xml deleted file mode 100644 index 9af8bb7..0000000 --- a/vendor/phpstan/phpstan/phpcs.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - src/Command/CommandHelper.php - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - tests/*/data - tests/*/traits - tests/notAutoloaded - src/Reflection/SignatureMap/functionMap.php - diff --git a/vendor/phpstan/phpstan/phpstan-baseline.neon b/vendor/phpstan/phpstan/phpstan-baseline.neon deleted file mode 100644 index a8dc4f8..0000000 --- a/vendor/phpstan/phpstan/phpstan-baseline.neon +++ /dev/null @@ -1,85 +0,0 @@ - - -parameters: - ignoreErrors: - - - message: "#^Strict comparison using \\=\\=\\= between PhpParser\\\\Node\\\\Expr\\\\ArrayItem and null will always evaluate to false\\.$#" - count: 1 - path: src/Analyser/Scope.php - - - - message: "#^Only numeric types are allowed in pre\\-increment, bool\\|float\\|int\\|string\\|null given\\.$#" - count: 1 - path: src/Analyser/Scope.php - - - - message: "#^Only numeric types are allowed in pre\\-decrement, bool\\|float\\|int\\|string\\|null given\\.$#" - count: 1 - path: src/Analyser/Scope.php - - - - message: "#^Access to constant EXTENSIONS on an unknown class PHPStan\\\\ExtensionInstaller\\\\GeneratedConfig\\.$#" - count: 1 - path: src/Command/CommandHelper.php - - - - message: "#^Anonymous function has an unused use \\$container\\.$#" - count: 2 - path: src/Command/CommandHelper.php - - - - message: "#^Parameter \\#1 \\$headers \\(array\\\\) of method PHPStan\\\\Command\\\\ErrorsConsoleStyle\\:\\:table\\(\\) should be contravariant with parameter \\$headers \\(array\\) of method Symfony\\\\Component\\\\Console\\\\Style\\\\StyleInterface\\:\\:table\\(\\)$#" - count: 1 - path: src/Command/ErrorsConsoleStyle.php - - - - message: "#^Parameter \\#1 \\$headers \\(array\\\\) of method PHPStan\\\\Command\\\\ErrorsConsoleStyle\\:\\:table\\(\\) should be contravariant with parameter \\$headers \\(array\\) of method Symfony\\\\Component\\\\Console\\\\Style\\\\SymfonyStyle\\:\\:table\\(\\)$#" - count: 1 - path: src/Command/ErrorsConsoleStyle.php - - - - message: "#^Parameter \\#2 \\$rows \\(array\\\\>\\) of method PHPStan\\\\Command\\\\ErrorsConsoleStyle\\:\\:table\\(\\) should be contravariant with parameter \\$rows \\(array\\) of method Symfony\\\\Component\\\\Console\\\\Style\\\\StyleInterface\\:\\:table\\(\\)$#" - count: 1 - path: src/Command/ErrorsConsoleStyle.php - - - - message: "#^Parameter \\#2 \\$rows \\(array\\\\>\\) of method PHPStan\\\\Command\\\\ErrorsConsoleStyle\\:\\:table\\(\\) should be contravariant with parameter \\$rows \\(array\\) of method Symfony\\\\Component\\\\Console\\\\Style\\\\SymfonyStyle\\:\\:table\\(\\)$#" - count: 1 - path: src/Command/ErrorsConsoleStyle.php - - - - message: "#^Variable static method call on Nette\\\\Schema\\\\Expect\\.$#" - count: 1 - path: src/DependencyInjection/ParametersSchemaExtension.php - - - - message: "#^Variable method call on Nette\\\\Schema\\\\Elements\\\\AnyOf\\|Nette\\\\Schema\\\\Elements\\\\Structure\\|Nette\\\\Schema\\\\Elements\\\\Type\\.$#" - count: 1 - path: src/DependencyInjection/ParametersSchemaExtension.php - - - - message: "#^Variable method call on PHPStan\\\\Reflection\\\\ClassReflection\\.$#" - count: 2 - path: src/PhpDoc/PhpDocBlock.php - - - - message: "#^Variable static method call on PHPStan\\\\PhpDoc\\\\PhpDocBlock\\.$#" - count: 1 - path: src/PhpDoc/PhpDocBlock.php - - - - message: "#^Call to an undefined method PHPStan\\\\Reflection\\\\DeprecatableReflection&PHPStan\\\\Reflection\\\\MethodReflection\\:\\:getDeprecatedDescription\\(\\)\\.$#" - count: 1 - path: tests/PHPStan/Reflection/Annotations/DeprecatedAnnotationsTest.php - - - - message: "#^Call to an undefined method PHPStan\\\\Reflection\\\\DeprecatableReflection&PHPStan\\\\Reflection\\\\PropertyReflection\\:\\:getDeprecatedDescription\\(\\)\\.$#" - count: 1 - path: tests/PHPStan/Reflection/Annotations/DeprecatedAnnotationsTest.php - - - - message: "#^Call to an undefined method PHPStan\\\\Reflection\\\\ConstantReflection&PHPStan\\\\Reflection\\\\DeprecatableReflection\\:\\:getDeprecatedDescription\\(\\)\\.$#" - count: 1 - path: tests/PHPStan/Reflection/Annotations/DeprecatedAnnotationsTest.php - - diff --git a/vendor/phpstan/phpstan/src/AnalysedCodeException.php b/vendor/phpstan/phpstan/src/AnalysedCodeException.php deleted file mode 100644 index 4aa4fb5..0000000 --- a/vendor/phpstan/phpstan/src/AnalysedCodeException.php +++ /dev/null @@ -1,8 +0,0 @@ -)[] $ignoreErrors - * @param bool $reportUnmatchedIgnoredErrors - * @param int $internalErrorsCountLimit - * @param string|null $benchmarkFile - */ - public function __construct( - ScopeFactory $scopeFactory, - Parser $parser, - Registry $registry, - NodeScopeResolver $nodeScopeResolver, - FileHelper $fileHelper, - array $ignoreErrors, - bool $reportUnmatchedIgnoredErrors, - int $internalErrorsCountLimit, - ?string $benchmarkFile = null - ) - { - $this->scopeFactory = $scopeFactory; - $this->parser = $parser; - $this->registry = $registry; - $this->nodeScopeResolver = $nodeScopeResolver; - $this->fileHelper = $fileHelper; - $this->ignoreErrors = $ignoreErrors; - $this->reportUnmatchedIgnoredErrors = $reportUnmatchedIgnoredErrors; - $this->internalErrorsCountLimit = $internalErrorsCountLimit; - $this->benchmarkFile = $benchmarkFile; - } - - /** - * @param string[] $files - * @param bool $onlyFiles - * @param \Closure(string $file): void|null $preFileCallback - * @param \Closure(string $file): void|null $postFileCallback - * @param bool $debug - * @param \Closure(\PhpParser\Node $node, Scope $scope): void|null $outerNodeCallback - * @return string[]|\PHPStan\Analyser\Error[] errors - */ - public function analyse( - array $files, - bool $onlyFiles, - ?\Closure $preFileCallback = null, - ?\Closure $postFileCallback = null, - bool $debug = false, - ?\Closure $outerNodeCallback = null - ): array - { - $errors = []; - - foreach ($this->ignoreErrors as $ignoreError) { - try { - if (is_array($ignoreError)) { - if (!isset($ignoreError['message'])) { - $errors[] = sprintf( - 'Ignored error %s is missing a message.', - Json::encode($ignoreError) - ); - continue; - } - if (!isset($ignoreError['path']) && !isset($ignoreError['paths'])) { - $errors[] = sprintf( - 'Ignored error %s is missing a path.', - Json::encode($ignoreError) - ); - } - - $ignoreMessage = $ignoreError['message']; - } else { - $ignoreMessage = $ignoreError; - } - - \Nette\Utils\Strings::match('', $ignoreMessage); - } catch (\Nette\Utils\RegexpException $e) { - $errors[] = $e->getMessage(); - } - } - - if (count($errors) > 0) { - return $errors; - } - - $this->nodeScopeResolver->setAnalysedFiles($files); - $internalErrorsCount = 0; - $reachedInternalErrorsCountLimit = false; - foreach ($files as $file) { - try { - $fileErrors = []; - if ($preFileCallback !== null) { - $preFileCallback($file); - } - - if (is_file($file)) { - $parserBenchmarkTime = $this->benchmarkStart(); - $parserNodes = $this->parser->parseFile($file); - $this->benchmarkEnd($parserBenchmarkTime, 'parser'); - $nodeCallback = function (\PhpParser\Node $node, Scope $scope) use (&$fileErrors, $file, &$scopeBenchmarkTime, $outerNodeCallback): void { - $this->benchmarkEnd($scopeBenchmarkTime, 'scope'); - if ($outerNodeCallback !== null) { - $outerNodeCallback($node, $scope); - } - $uniquedAnalysedCodeExceptionMessages = []; - foreach ($this->registry->getRules(get_class($node)) as $rule) { - try { - $ruleBenchmarkTime = $this->benchmarkStart(); - $ruleErrors = $rule->processNode($node, $scope); - $this->benchmarkEnd($ruleBenchmarkTime, sprintf('rule-%s', get_class($rule))); - } catch (\PHPStan\AnalysedCodeException $e) { - if (isset($uniquedAnalysedCodeExceptionMessages[$e->getMessage()])) { - continue; - } - - $uniquedAnalysedCodeExceptionMessages[$e->getMessage()] = true; - $fileErrors[] = new Error($e->getMessage(), $file, $node->getLine(), false); - continue; - } - - foreach ($ruleErrors as $ruleError) { - $line = $node->getLine(); - $fileName = $scope->getFileDescription(); - $filePath = $scope->getFile(); - $traitFilePath = null; - if ($scope->isInTrait()) { - $traitReflection = $scope->getTraitReflection(); - if ($traitReflection->getFileName() !== false) { - $traitFilePath = $traitReflection->getFileName(); - } - } - if (is_string($ruleError)) { - $message = $ruleError; - } else { - $message = $ruleError->getMessage(); - if ( - $ruleError instanceof LineRuleError - && $ruleError->getLine() !== -1 - ) { - $line = $ruleError->getLine(); - } - if ( - $ruleError instanceof FileRuleError - && $ruleError->getFile() !== '' - ) { - $fileName = $ruleError->getFile(); - $filePath = $ruleError->getFile(); - $traitFilePath = null; - } - } - $fileErrors[] = new Error( - $message, - $fileName, - $line, - true, - $filePath, - $traitFilePath - ); - } - } - - $scopeBenchmarkTime = $this->benchmarkStart(); - }; - - $scopeBenchmarkTime = $this->benchmarkStart(); - $scope = $this->scopeFactory->create(ScopeContext::create($file)); - $nodeCallback(new FileNode($parserNodes), $scope); - $this->nodeScopeResolver->processNodes( - $parserNodes, - $scope, - $nodeCallback - ); - } elseif (is_dir($file)) { - $fileErrors[] = new Error(sprintf('File %s is a directory.', $file), $file, null, false); - } else { - $fileErrors[] = new Error(sprintf('File %s does not exist.', $file), $file, null, false); - } - if ($postFileCallback !== null) { - $postFileCallback($file); - } - - $errors = array_merge($errors, $fileErrors); - } catch (\PhpParser\Error $e) { - $errors[] = new Error($e->getMessage(), $file, $e->getStartLine() !== -1 ? $e->getStartLine() : null, false); - } catch (\PHPStan\Parser\ParserErrorsException $e) { - foreach ($e->getErrors() as $error) { - $errors[] = new Error($error->getMessage(), $file, $error->getStartLine() !== -1 ? $error->getStartLine() : null, false); - } - } catch (\PHPStan\AnalysedCodeException $e) { - $errors[] = new Error($e->getMessage(), $file, null, false); - } catch (\Throwable $t) { - if ($debug) { - throw $t; - } - $internalErrorsCount++; - $internalErrorMessage = sprintf('Internal error: %s', $t->getMessage()); - $internalErrorMessage .= sprintf( - '%sRun PHPStan with --debug option and post the stack trace to:%s%s', - "\n", - "\n", - 'https://github.com/phpstan/phpstan/issues/new' - ); - $errors[] = new Error($internalErrorMessage, $file); - if ($internalErrorsCount >= $this->internalErrorsCountLimit) { - $reachedInternalErrorsCountLimit = true; - break; - } - } - } - - if ($this->benchmarkFile !== null) { - uasort($this->benchmarkData, static function (float $a, float $b): int { - return $b <=> $a; - }); - file_put_contents($this->benchmarkFile, Json::encode($this->benchmarkData, Json::PRETTY)); - } - - $unmatchedIgnoredErrors = $this->ignoreErrors; - $addErrors = []; - $errors = array_values(array_filter($errors, function (Error $error) use (&$unmatchedIgnoredErrors, &$addErrors): bool { - foreach ($this->ignoreErrors as $i => $ignore) { - $shouldBeIgnored = false; - if (is_string($ignore)) { - $shouldBeIgnored = IgnoredError::shouldIgnore($this->fileHelper, $error, $ignore, null); - if ($shouldBeIgnored) { - unset($unmatchedIgnoredErrors[$i]); - } - } else { - if (isset($ignore['path'])) { - $shouldBeIgnored = IgnoredError::shouldIgnore($this->fileHelper, $error, $ignore['message'], $ignore['path']); - if ($shouldBeIgnored) { - if (isset($ignore['count'])) { - $realCount = $unmatchedIgnoredErrors[$i]['realCount'] ?? 0; - $realCount++; - $unmatchedIgnoredErrors[$i]['realCount'] = $realCount; - - if ($realCount > $ignore['count']) { - $shouldBeIgnored = false; - if (!isset($unmatchedIgnoredErrors[$i]['file'])) { - $unmatchedIgnoredErrors[$i]['file'] = $error->getFile(); - $unmatchedIgnoredErrors[$i]['line'] = $error->getLine(); - } - } - } else { - unset($unmatchedIgnoredErrors[$i]); - } - } - } elseif (isset($ignore['paths'])) { - foreach ($ignore['paths'] as $j => $ignorePath) { - $shouldBeIgnored = IgnoredError::shouldIgnore($this->fileHelper, $error, $ignore['message'], $ignorePath); - if ($shouldBeIgnored) { - if (isset($unmatchedIgnoredErrors[$i])) { - if (!is_array($unmatchedIgnoredErrors[$i])) { - throw new \PHPStan\ShouldNotHappenException(); - } - unset($unmatchedIgnoredErrors[$i]['paths'][$j]); - if (isset($unmatchedIgnoredErrors[$i]['paths']) && count($unmatchedIgnoredErrors[$i]['paths']) === 0) { - unset($unmatchedIgnoredErrors[$i]); - } - } - break; - } - } - } else { - throw new \PHPStan\ShouldNotHappenException(); - } - } - - if ($shouldBeIgnored) { - if (!$error->canBeIgnored()) { - $addErrors[] = sprintf( - 'Error message "%s" cannot be ignored, use excludes_analyse instead.', - $error->getMessage() - ); - return true; - } - return false; - } - } - - return true; - })); - - foreach ($unmatchedIgnoredErrors as $unmatchedIgnoredError) { - if (!isset($unmatchedIgnoredError['count']) || !isset($unmatchedIgnoredError['realCount'])) { - continue; - } - - if ($unmatchedIgnoredError['realCount'] <= $unmatchedIgnoredError['count']) { - continue; - } - - $addErrors[] = new Error(sprintf( - 'Ignored error pattern %s is expected to occur %d %s, but occured %d %s.', - IgnoredError::stringifyPattern($unmatchedIgnoredError), - $unmatchedIgnoredError['count'], - $unmatchedIgnoredError['count'] === 1 ? 'time' : 'times', - $unmatchedIgnoredError['realCount'], - $unmatchedIgnoredError['realCount'] === 1 ? 'time' : 'times' - ), $unmatchedIgnoredError['file'], $unmatchedIgnoredError['line']); - } - - $errors = array_merge($errors, $addErrors); - - if (!$onlyFiles && $this->reportUnmatchedIgnoredErrors && !$reachedInternalErrorsCountLimit) { - foreach ($unmatchedIgnoredErrors as $unmatchedIgnoredError) { - if ( - isset($unmatchedIgnoredError['count']) - && isset($unmatchedIgnoredError['realCount']) - ) { - if ($unmatchedIgnoredError['realCount'] < $unmatchedIgnoredError['count']) { - $errors[] = sprintf( - 'Ignored error pattern %s is expected to occur %d %s, but occured only %d %s.', - IgnoredError::stringifyPattern($unmatchedIgnoredError), - $unmatchedIgnoredError['count'], - $unmatchedIgnoredError['count'] === 1 ? 'time' : 'times', - $unmatchedIgnoredError['realCount'], - $unmatchedIgnoredError['realCount'] === 1 ? 'time' : 'times' - ); - } - } else { - $errors[] = sprintf( - 'Ignored error pattern %s was not matched in reported errors.', - IgnoredError::stringifyPattern($unmatchedIgnoredError) - ); - } - } - } - - if ($reachedInternalErrorsCountLimit) { - $errors[] = sprintf('Reached internal errors count limit of %d, exiting...', $this->internalErrorsCountLimit); - } - - return $errors; - } - - private function benchmarkStart(): ?float - { - if ($this->benchmarkFile === null) { - return null; - } - - return microtime(true); - } - - private function benchmarkEnd(?float $startTime, string $description): void - { - if ($this->benchmarkFile === null) { - return; - } - if ($startTime === null) { - return; - } - $elapsedTime = microtime(true) - $startTime; - if (!isset($this->benchmarkData[$description])) { - $this->benchmarkData[$description] = $elapsedTime; - return; - } - - $this->benchmarkData[$description] += $elapsedTime; - } - -} diff --git a/vendor/phpstan/phpstan/src/Analyser/EnsuredNonNullabilityResult.php b/vendor/phpstan/phpstan/src/Analyser/EnsuredNonNullabilityResult.php deleted file mode 100644 index 7235e40..0000000 --- a/vendor/phpstan/phpstan/src/Analyser/EnsuredNonNullabilityResult.php +++ /dev/null @@ -1,37 +0,0 @@ -scope = $scope; - $this->specifiedExpressions = $specifiedExpressions; - } - - public function getScope(): Scope - { - return $this->scope; - } - - /** - * @return EnsuredNonNullabilityResultExpression[] - */ - public function getSpecifiedExpressions(): array - { - return $this->specifiedExpressions; - } - -} diff --git a/vendor/phpstan/phpstan/src/Analyser/EnsuredNonNullabilityResultExpression.php b/vendor/phpstan/phpstan/src/Analyser/EnsuredNonNullabilityResultExpression.php deleted file mode 100644 index e182d54..0000000 --- a/vendor/phpstan/phpstan/src/Analyser/EnsuredNonNullabilityResultExpression.php +++ /dev/null @@ -1,33 +0,0 @@ -expression = $expression; - $this->originalType = $originalType; - } - - public function getExpression(): Expr - { - return $this->expression; - } - - public function getOriginalType(): Type - { - return $this->originalType; - } - -} diff --git a/vendor/phpstan/phpstan/src/Analyser/Error.php b/vendor/phpstan/phpstan/src/Analyser/Error.php deleted file mode 100644 index c4a05ef..0000000 --- a/vendor/phpstan/phpstan/src/Analyser/Error.php +++ /dev/null @@ -1,77 +0,0 @@ -message = $message; - $this->file = $file; - $this->line = $line; - $this->canBeIgnored = $canBeIgnored; - $this->filePath = $filePath; - $this->traitFilePath = $traitFilePath; - } - - public function getMessage(): string - { - return $this->message; - } - - public function getFile(): string - { - return $this->file; - } - - public function getFilePath(): string - { - if ($this->filePath === null) { - return $this->file; - } - - return $this->filePath; - } - - public function getTraitFilePath(): ?string - { - return $this->traitFilePath; - } - - public function getLine(): ?int - { - return $this->line; - } - - public function canBeIgnored(): bool - { - return $this->canBeIgnored; - } - -} diff --git a/vendor/phpstan/phpstan/src/Analyser/ExpressionContext.php b/vendor/phpstan/phpstan/src/Analyser/ExpressionContext.php deleted file mode 100644 index e71da9f..0000000 --- a/vendor/phpstan/phpstan/src/Analyser/ExpressionContext.php +++ /dev/null @@ -1,69 +0,0 @@ -isDeep = $isDeep; - $this->inAssignRightSideVariableName = $inAssignRightSideVariableName; - $this->inAssignRightSideType = $inAssignRightSideType; - } - - public static function createTopLevel(): self - { - return new self(false, null, null); - } - - public static function createDeep(): self - { - return new self(true, null, null); - } - - public function enterDeep(): self - { - if ($this->isDeep) { - return $this; - } - - return new self(true, $this->inAssignRightSideVariableName, $this->inAssignRightSideType); - } - - public function isDeep(): bool - { - return $this->isDeep; - } - - public function enterRightSideAssign(string $variableName, Type $type): self - { - return new self($this->isDeep, $variableName, $type); - } - - public function getInAssignRightSideVariableName(): ?string - { - return $this->inAssignRightSideVariableName; - } - - public function getInAssignRightSideType(): ?Type - { - return $this->inAssignRightSideType; - } - -} diff --git a/vendor/phpstan/phpstan/src/Analyser/ExpressionResult.php b/vendor/phpstan/phpstan/src/Analyser/ExpressionResult.php deleted file mode 100644 index 0949488..0000000 --- a/vendor/phpstan/phpstan/src/Analyser/ExpressionResult.php +++ /dev/null @@ -1,85 +0,0 @@ -scope = $scope; - $this->hasYield = $hasYield; - $this->truthyScopeCallback = $truthyScopeCallback; - $this->falseyScopeCallback = $falseyScopeCallback; - } - - public function getScope(): Scope - { - return $this->scope; - } - - public function hasYield(): bool - { - return $this->hasYield; - } - - public function getTruthyScope(): Scope - { - if ($this->truthyScopeCallback === null) { - return $this->scope; - } - - if ($this->truthyScope !== null) { - return $this->truthyScope; - } - - $callback = $this->truthyScopeCallback; - $this->truthyScope = $callback(); - return $this->truthyScope; - } - - public function getFalseyScope(): Scope - { - if ($this->falseyScopeCallback === null) { - return $this->scope; - } - - if ($this->falseyScope !== null) { - return $this->falseyScope; - } - - $callback = $this->falseyScopeCallback; - $this->falseyScope = $callback(); - return $this->falseyScope; - } - -} diff --git a/vendor/phpstan/phpstan/src/Analyser/IgnoredError.php b/vendor/phpstan/phpstan/src/Analyser/IgnoredError.php deleted file mode 100644 index 347c753..0000000 --- a/vendor/phpstan/phpstan/src/Analyser/IgnoredError.php +++ /dev/null @@ -1,69 +0,0 @@ -getMessage(), $ignoredErrorPattern) === null) { - return false; - } - - $isExcluded = $fileExcluder->isExcludedFromAnalysing($error->getFilePath()); - if (!$isExcluded && $error->getTraitFilePath() !== null) { - return $fileExcluder->isExcludedFromAnalysing($error->getTraitFilePath()); - } - - return $isExcluded; - } - - return \Nette\Utils\Strings::match($error->getMessage(), $ignoredErrorPattern) !== null; - } - -} diff --git a/vendor/phpstan/phpstan/src/Analyser/NameScope.php b/vendor/phpstan/phpstan/src/Analyser/NameScope.php deleted file mode 100644 index ec23a06..0000000 --- a/vendor/phpstan/phpstan/src/Analyser/NameScope.php +++ /dev/null @@ -1,57 +0,0 @@ - fullName(string) */ - private $uses; - - /** @var string|null */ - private $className; - - /** - * @param string|null $namespace - * @param string[] $uses alias(string) => fullName(string) - * @param string|null $className - */ - public function __construct(?string $namespace, array $uses, ?string $className = null) - { - $this->namespace = $namespace; - $this->uses = $uses; - $this->className = $className; - } - - public function getClassName(): ?string - { - return $this->className; - } - - public function resolveStringName(string $name): string - { - if (strpos($name, '\\') === 0) { - return ltrim($name, '\\'); - } - - $nameParts = explode('\\', $name); - $firstNamePart = strtolower($nameParts[0]); - if (isset($this->uses[$firstNamePart])) { - if (count($nameParts) === 1) { - return $this->uses[$firstNamePart]; - } - array_shift($nameParts); - return sprintf('%s\\%s', $this->uses[$firstNamePart], implode('\\', $nameParts)); - } - - if ($this->namespace !== null) { - return sprintf('%s\\%s', $this->namespace, $name); - } - - return $name; - } - -} diff --git a/vendor/phpstan/phpstan/src/Analyser/NodeScopeResolver.php b/vendor/phpstan/phpstan/src/Analyser/NodeScopeResolver.php deleted file mode 100644 index 49d4752..0000000 --- a/vendor/phpstan/phpstan/src/Analyser/NodeScopeResolver.php +++ /dev/null @@ -1,2533 +0,0 @@ - methods(string[]) */ - private $earlyTerminatingMethodCalls; - - /** @var bool */ - private $allowVarTagAboveStatements; - - /** @var bool[] filePath(string) => bool(true) */ - private $analysedFiles; - - /** - * @param Broker $broker - * @param Parser $parser - * @param FileTypeMapper $fileTypeMapper - * @param FileHelper $fileHelper - * @param TypeSpecifier $typeSpecifier - * @param bool $polluteScopeWithLoopInitialAssignments - * @param bool $polluteCatchScopeWithTryAssignments - * @param bool $polluteScopeWithAlwaysIterableForeach - * @param string[][] $earlyTerminatingMethodCalls className(string) => methods(string[]) - * @param bool $allowVarTagAboveStatements - */ - public function __construct( - Broker $broker, - Parser $parser, - FileTypeMapper $fileTypeMapper, - FileHelper $fileHelper, - TypeSpecifier $typeSpecifier, - bool $polluteScopeWithLoopInitialAssignments, - bool $polluteCatchScopeWithTryAssignments, - bool $polluteScopeWithAlwaysIterableForeach, - array $earlyTerminatingMethodCalls, - bool $allowVarTagAboveStatements - ) - { - $this->broker = $broker; - $this->parser = $parser; - $this->fileTypeMapper = $fileTypeMapper; - $this->fileHelper = $fileHelper; - $this->typeSpecifier = $typeSpecifier; - $this->polluteScopeWithLoopInitialAssignments = $polluteScopeWithLoopInitialAssignments; - $this->polluteCatchScopeWithTryAssignments = $polluteCatchScopeWithTryAssignments; - $this->polluteScopeWithAlwaysIterableForeach = $polluteScopeWithAlwaysIterableForeach; - $this->earlyTerminatingMethodCalls = $earlyTerminatingMethodCalls; - $this->allowVarTagAboveStatements = $allowVarTagAboveStatements; - } - - /** - * @param string[] $files - */ - public function setAnalysedFiles(array $files): void - { - $this->analysedFiles = array_fill_keys($files, true); - } - - /** - * @param \PhpParser\Node[] $nodes - * @param \PHPStan\Analyser\Scope $scope - * @param \Closure(\PhpParser\Node $node, Scope $scope): void $nodeCallback - */ - public function processNodes( - array $nodes, - Scope $scope, - \Closure $nodeCallback - ): void - { - $nodesCount = count($nodes); - $alreadyTerminated = false; - foreach ($nodes as $i => $node) { - if (!$node instanceof Node\Stmt) { - continue; - } - - $statementResult = $this->processStmtNode($node, $scope, $nodeCallback); - $scope = $statementResult->getScope(); - if ($alreadyTerminated) { - continue; - } - if (!$statementResult->isAlwaysTerminating()) { - continue; - } - - $alreadyTerminated = true; - if ($i < $nodesCount - 1) { - $nextStmt = $nodes[$i + 1]; - if (!$nextStmt instanceof Node\Stmt) { - continue; - } - - $nodeCallback(new UnreachableStatementNode($nextStmt), $scope); - } - // todo break; - } - } - - /** - * @param \PhpParser\Node $parentNode - * @param \PhpParser\Node\Stmt[] $stmts - * @param \PHPStan\Analyser\Scope $scope - * @param \Closure(\PhpParser\Node $node, Scope $scope): void $nodeCallback - * @return StatementResult - */ - public function processStmtNodes( - Node $parentNode, - array $stmts, - Scope $scope, - \Closure $nodeCallback - ): StatementResult - { - $exitPoints = []; - $alreadyTerminated = false; - $hasYield = false; - $stmtCount = count($stmts); - $shouldCheckLastStatement = $parentNode instanceof Node\Stmt\Function_ - || $parentNode instanceof Node\Stmt\ClassMethod - || $parentNode instanceof Expr\Closure; - foreach ($stmts as $i => $stmt) { - $isLast = $i === $stmtCount - 1; - $statementResult = $this->processStmtNode( - $stmt, - $scope, - $nodeCallback - ); - $scope = $statementResult->getScope(); - $hasYield = $hasYield || $statementResult->hasYield(); - - if ($alreadyTerminated) { - continue; - } - - if ($shouldCheckLastStatement && $isLast) { - /** @var Node\Stmt\Function_|Node\Stmt\ClassMethod|Expr\Closure $parentNode */ - $parentNode = $parentNode; - $nodeCallback(new ExecutionEndNode( - $stmt, - new StatementResult( - $scope, - $hasYield, - $statementResult->isAlwaysTerminating(), - $statementResult->getExitPoints() - ), - $parentNode->returnType !== null - ), $scope); - } - - $exitPoints = array_merge($exitPoints, $statementResult->getExitPoints()); - - if (!$statementResult->isAlwaysTerminating()) { - continue; - } - - $alreadyTerminated = true; - if ($i < $stmtCount - 1) { - $nextStmt = $stmts[$i + 1]; - $nodeCallback(new UnreachableStatementNode($nextStmt), $scope); - } - - // todo break - } - - $statementResult = new StatementResult($scope, $hasYield, $alreadyTerminated, $exitPoints); - if ($stmtCount === 0 && $shouldCheckLastStatement) { - /** @var Node\Stmt\Function_|Node\Stmt\ClassMethod|Expr\Closure $parentNode */ - $parentNode = $parentNode; - $nodeCallback(new ExecutionEndNode( - $parentNode, - $statementResult, - $parentNode->returnType !== null - ), $scope); - } - - return $statementResult; - } - - /** - * @param \PhpParser\Node\Stmt $stmt - * @param \PHPStan\Analyser\Scope $scope - * @param \Closure(\PhpParser\Node $node, Scope $scope): void $nodeCallback - * @return StatementResult - */ - private function processStmtNode( - Node\Stmt $stmt, - Scope $scope, - \Closure $nodeCallback - ): StatementResult - { - $nodeCallback($stmt, $scope); - - if ($stmt instanceof Node\Stmt\Declare_) { - $hasYield = false; - foreach ($stmt->declares as $declare) { - $nodeCallback($declare, $scope); - $nodeCallback($declare->value, $scope); - if ( - $declare->key->name !== 'strict_types' - || !($declare->value instanceof Node\Scalar\LNumber) - || $declare->value->value !== 1 - ) { - continue; - } - - $scope = $scope->enterDeclareStrictTypes(); - } - } elseif ($stmt instanceof Node\Stmt\Function_) { - $hasYield = false; - [$phpDocParameterTypes, $phpDocReturnType, $phpDocThrowType, $deprecatedDescription, $isDeprecated, $isInternal, $isFinal] = $this->getPhpDocs($scope, $stmt); - - foreach ($stmt->params as $param) { - $this->processParamNode($param, $scope, $nodeCallback); - } - - if ($stmt->returnType !== null) { - $nodeCallback($stmt->returnType, $scope); - } - - $functionScope = $scope->enterFunction( - $stmt, - $phpDocParameterTypes, - $phpDocReturnType, - $phpDocThrowType, - $deprecatedDescription, - $isDeprecated, - $isInternal, - $isFinal - ); - - $gatheredReturnStatements = []; - $statementResult = $this->processStmtNodes($stmt, $stmt->stmts, $functionScope, static function (\PhpParser\Node $node, Scope $scope) use ($nodeCallback, &$gatheredReturnStatements): void { - $nodeCallback($node, $scope); - if (!$node instanceof Return_) { - return; - } - - $gatheredReturnStatements[] = new ReturnStatement($scope, $node); - }); - - $nodeCallback(new FunctionReturnStatementsNode( - $stmt, - $gatheredReturnStatements, - $statementResult - ), $functionScope); - } elseif ($stmt instanceof Node\Stmt\ClassMethod) { - $hasYield = false; - [$phpDocParameterTypes, $phpDocReturnType, $phpDocThrowType, $deprecatedDescription, $isDeprecated, $isInternal, $isFinal] = $this->getPhpDocs($scope, $stmt); - - foreach ($stmt->params as $param) { - $this->processParamNode($param, $scope, $nodeCallback); - } - - if ($stmt->returnType !== null) { - $nodeCallback($stmt->returnType, $scope); - } - - if ($phpDocReturnType !== null) { - if (!$scope->isInClass()) { - throw new \PHPStan\ShouldNotHappenException(); - } - - $className = $scope->getClassReflection()->getName(); - $phpDocReturnType = TypeTraverser::map($phpDocReturnType, static function (Type $type, callable $traverse) use ($className): Type { - if ($type instanceof StaticType) { - return $traverse($type->changeBaseClass($className)); - } - - return $traverse($type); - }); - } - - $methodScope = $scope->enterClassMethod( - $stmt, - $phpDocParameterTypes, - $phpDocReturnType, - $phpDocThrowType, - $deprecatedDescription, - $isDeprecated, - $isInternal, - $isFinal - ); - $nodeCallback(new InClassMethodNode($stmt), $methodScope); - - if ($stmt->stmts !== null) { - $gatheredReturnStatements = []; - $statementResult = $this->processStmtNodes($stmt, $stmt->stmts, $methodScope, static function (\PhpParser\Node $node, Scope $scope) use ($nodeCallback, &$gatheredReturnStatements): void { - $nodeCallback($node, $scope); - if (!$node instanceof Return_) { - return; - } - - $gatheredReturnStatements[] = new ReturnStatement($scope, $node); - }); - $nodeCallback(new MethodReturnStatementsNode( - $stmt, - $gatheredReturnStatements, - $statementResult - ), $methodScope); - } - } elseif ($stmt instanceof Echo_) { - $scope = $this->processStmtVarAnnotation($scope, $stmt); - $hasYield = false; - foreach ($stmt->exprs as $echoExpr) { - $result = $this->processExprNode($echoExpr, $scope, $nodeCallback, ExpressionContext::createDeep()); - $scope = $result->getScope(); - $hasYield = $hasYield || $result->hasYield(); - } - } elseif ($stmt instanceof Return_) { - $scope = $this->processStmtVarAnnotation($scope, $stmt); - if ($stmt->expr !== null) { - $result = $this->processExprNode($stmt->expr, $scope, $nodeCallback, ExpressionContext::createDeep()); - $scope = $result->getScope(); - $hasYield = $result->hasYield(); - } else { - $hasYield = false; - } - - return new StatementResult($scope, $hasYield, true, [ - new StatementExitPoint($stmt, $scope), - ]); - } elseif ($stmt instanceof Continue_ || $stmt instanceof Break_) { - if ($stmt->num !== null) { - $result = $this->processExprNode($stmt->num, $scope, $nodeCallback, ExpressionContext::createDeep()); - $scope = $result->getScope(); - $hasYield = $result->hasYield(); - } else { - $hasYield = false; - } - - return new StatementResult($scope, $hasYield, true, [ - new StatementExitPoint($stmt, $scope), - ]); - } elseif ($stmt instanceof Node\Stmt\Expression) { - if (!$stmt->expr instanceof Assign && !$stmt->expr instanceof AssignRef) { - $scope = $this->processStmtVarAnnotation($scope, $stmt); - } - $earlyTerminationExpr = $this->findEarlyTerminatingExpr($stmt->expr, $scope); - $result = $this->processExprNode($stmt->expr, $scope, $nodeCallback, ExpressionContext::createTopLevel()); - $scope = $result->getScope(); - $scope = $scope->filterBySpecifiedTypes($this->typeSpecifier->specifyTypesInCondition( - $scope, - $stmt->expr, - TypeSpecifierContext::createNull() - )); - $hasYield = $result->hasYield(); - if ($earlyTerminationExpr !== null) { - return new StatementResult($scope, $hasYield, true, [ - new StatementExitPoint($stmt, $scope), - ]); - } - } elseif ($stmt instanceof Node\Stmt\Namespace_) { - if ($stmt->name !== null) { - $scope = $scope->enterNamespace($stmt->name->toString()); - } - - $scope = $this->processStmtNodes($stmt, $stmt->stmts, $scope, $nodeCallback)->getScope(); - $hasYield = false; - } elseif ($stmt instanceof Node\Stmt\Trait_) { - return new StatementResult($scope, false, false, []); - } elseif ($stmt instanceof Node\Stmt\ClassLike) { - $hasYield = false; - if (isset($stmt->namespacedName)) { - $classScope = $scope->enterClass($this->broker->getClass((string) $stmt->namespacedName)); - } elseif ($stmt instanceof Class_) { - if ($stmt->name === null) { - throw new \PHPStan\ShouldNotHappenException(); - } - $classScope = $scope->enterClass($this->broker->getClass($stmt->name->toString())); - } else { - throw new \PHPStan\ShouldNotHappenException(); - } - - $this->processStmtNodes($stmt, $stmt->stmts, $classScope, $nodeCallback); - } elseif ($stmt instanceof Node\Stmt\Property) { - $hasYield = false; - foreach ($stmt->props as $prop) { - $this->processStmtNode($prop, $scope, $nodeCallback); - } - - if ($stmt->type !== null) { - $nodeCallback($stmt->type, $scope); - } - } elseif ($stmt instanceof Node\Stmt\PropertyProperty) { - $hasYield = false; - if ($stmt->default !== null) { - $this->processExprNode($stmt->default, $scope, $nodeCallback, ExpressionContext::createDeep()); - } - } elseif ($stmt instanceof Throw_) { - $scope = $this->processStmtVarAnnotation($scope, $stmt); - $result = $this->processExprNode($stmt->expr, $scope, $nodeCallback, ExpressionContext::createDeep()); - return new StatementResult($result->getScope(), $result->hasYield(), true, [ - new StatementExitPoint($stmt, $scope), - ]); - } elseif ($stmt instanceof If_) { - $scope = $this->processStmtVarAnnotation($scope, $stmt); - $conditionType = $scope->getType($stmt->cond)->toBoolean(); - $ifAlwaysTrue = $conditionType instanceof ConstantBooleanType && $conditionType->getValue(); - $condResult = $this->processExprNode($stmt->cond, $scope, $nodeCallback, ExpressionContext::createDeep()); - $exitPoints = []; - $finalScope = null; - $alwaysTerminating = true; - $hasYield = false; - - $branchScopeStatementResult = $this->processStmtNodes($stmt, $stmt->stmts, $condResult->getTruthyScope(), $nodeCallback); - - if (!$conditionType instanceof ConstantBooleanType || $conditionType->getValue()) { - $exitPoints = $branchScopeStatementResult->getExitPoints(); - $branchScope = $branchScopeStatementResult->getScope(); - $finalScope = $branchScopeStatementResult->isAlwaysTerminating() ? null : $branchScope; - $alwaysTerminating = $branchScopeStatementResult->isAlwaysTerminating(); - $hasYield = $branchScopeStatementResult->hasYield(); - } - - $scope = $condResult->getFalseyScope(); - $lastElseIfConditionIsTrue = false; - - $condScope = $scope; - foreach ($stmt->elseifs as $elseif) { - $nodeCallback($elseif, $scope); - $elseIfConditionType = $condScope->getType($elseif->cond)->toBoolean(); - $condResult = $this->processExprNode($elseif->cond, $condScope, $nodeCallback, ExpressionContext::createDeep()); - $condScope = $condResult->getScope(); - $branchScopeStatementResult = $this->processStmtNodes($elseif, $elseif->stmts, $condResult->getTruthyScope(), $nodeCallback); - - if ( - !$ifAlwaysTrue - && ( - !$lastElseIfConditionIsTrue - && ( - !$elseIfConditionType instanceof ConstantBooleanType - || $elseIfConditionType->getValue() - ) - ) - ) { - $exitPoints = array_merge($exitPoints, $branchScopeStatementResult->getExitPoints()); - $branchScope = $branchScopeStatementResult->getScope(); - $finalScope = $branchScopeStatementResult->isAlwaysTerminating() ? $finalScope : $branchScope->mergeWith($finalScope); - $alwaysTerminating = $alwaysTerminating && $branchScopeStatementResult->isAlwaysTerminating(); - $hasYield = $hasYield || $branchScopeStatementResult->hasYield(); - } - - if ( - $elseIfConditionType instanceof ConstantBooleanType - && $elseIfConditionType->getValue() - ) { - $lastElseIfConditionIsTrue = true; - } - - $condScope = $condScope->filterByFalseyValue($elseif->cond); - $scope = $condScope; - } - - if ($stmt->else === null) { - if (!$ifAlwaysTrue) { - $finalScope = $scope->mergeWith($finalScope); - $alwaysTerminating = false; - } - } else { - $nodeCallback($stmt->else, $scope); - $branchScopeStatementResult = $this->processStmtNodes($stmt->else, $stmt->else->stmts, $scope, $nodeCallback); - - if (!$ifAlwaysTrue && !$lastElseIfConditionIsTrue) { - $exitPoints = array_merge($exitPoints, $branchScopeStatementResult->getExitPoints()); - $branchScope = $branchScopeStatementResult->getScope(); - $finalScope = $branchScopeStatementResult->isAlwaysTerminating() ? $finalScope : $branchScope->mergeWith($finalScope); - $alwaysTerminating = $alwaysTerminating && $branchScopeStatementResult->isAlwaysTerminating(); - $hasYield = $hasYield || $branchScopeStatementResult->hasYield(); - } - } - - if ($finalScope === null) { - $finalScope = $scope; - } - - return new StatementResult($finalScope, $hasYield, $alwaysTerminating, $exitPoints); - } elseif ($stmt instanceof Node\Stmt\TraitUse) { - $hasYield = false; - $this->processTraitUse($stmt, $scope, $nodeCallback); - } elseif ($stmt instanceof Foreach_) { - $scope = $this->processExprNode($stmt->expr, $scope, $nodeCallback, ExpressionContext::createDeep())->getScope(); - $bodyScope = $this->enterForeach($scope, $stmt); - $count = 0; - do { - $prevScope = $bodyScope; - $bodyScope = $bodyScope->mergeWith($scope); - $bodyScope = $this->enterForeach($bodyScope, $stmt); - $bodyScopeResult = $this->processStmtNodes($stmt, $stmt->stmts, $bodyScope, static function (): void { - })->filterOutLoopExitPoints(); - $alwaysTerminating = $bodyScopeResult->isAlwaysTerminating(); - $bodyScope = $bodyScopeResult->getScope(); - foreach ($bodyScopeResult->getExitPointsByType(Continue_::class) as $continueExitPoint) { - $bodyScope = $bodyScope->mergeWith($continueExitPoint->getScope()); - } - if ($bodyScope->equals($prevScope)) { - break; - } - - if ($count >= self::GENERALIZE_AFTER_ITERATION) { - $bodyScope = $bodyScope->generalizeWith($prevScope); - } - $count++; - } while (!$alwaysTerminating && $count < self::LOOP_SCOPE_ITERATIONS); - - $bodyScope = $bodyScope->mergeWith($scope); - $bodyScope = $this->enterForeach($bodyScope, $stmt); - $finalScopeResult = $this->processStmtNodes($stmt, $stmt->stmts, $bodyScope, $nodeCallback)->filterOutLoopExitPoints(); - $finalScope = $finalScopeResult->getScope(); - foreach ($finalScopeResult->getExitPointsByType(Continue_::class) as $continueExitPoint) { - $finalScope = $continueExitPoint->getScope()->mergeWith($finalScope); - } - foreach ($finalScopeResult->getExitPointsByType(Break_::class) as $breakExitPoint) { - $finalScope = $breakExitPoint->getScope()->mergeWith($finalScope); - } - - $isIterableAtLeastOnce = $scope->getType($stmt->expr)->isIterableAtLeastOnce(); - if ($isIterableAtLeastOnce->no() || $finalScopeResult->isAlwaysTerminating()) { - $finalScope = $scope; - } elseif ($isIterableAtLeastOnce->maybe()) { - $finalScope = $finalScope->mergeWith($scope); - } elseif (!$this->polluteScopeWithAlwaysIterableForeach) { - $finalScope = $scope->processAlwaysIterableForeachScopeWithoutPollute($finalScope); - // get types from finalScope, but don't create new variables - } - - return new StatementResult( - $finalScope, - $finalScopeResult->hasYield(), - $isIterableAtLeastOnce->yes() && $finalScopeResult->isAlwaysTerminating(), - [] - ); - } elseif ($stmt instanceof While_) { - $scope = $this->processStmtVarAnnotation($scope, $stmt); - $condResult = $this->processExprNode($stmt->cond, $scope, static function (): void { - }, ExpressionContext::createDeep()); - $bodyScope = $condResult->getTruthyScope(); - $count = 0; - do { - $prevScope = $bodyScope; - $bodyScope = $bodyScope->mergeWith($scope); - $bodyScope = $this->processExprNode($stmt->cond, $bodyScope, static function (): void { - }, ExpressionContext::createDeep())->getTruthyScope(); - $bodyScopeResult = $this->processStmtNodes($stmt, $stmt->stmts, $bodyScope, static function (): void { - })->filterOutLoopExitPoints(); - $alwaysTerminating = $bodyScopeResult->isAlwaysTerminating(); - $bodyScope = $bodyScopeResult->getScope(); - foreach ($bodyScopeResult->getExitPointsByType(Continue_::class) as $continueExitPoint) { - $bodyScope = $bodyScope->mergeWith($continueExitPoint->getScope()); - } - if ($bodyScope->equals($prevScope)) { - break; - } - - if ($count >= self::GENERALIZE_AFTER_ITERATION) { - $bodyScope = $bodyScope->generalizeWith($prevScope); - } - $count++; - } while (!$alwaysTerminating && $count < self::LOOP_SCOPE_ITERATIONS); - - $bodyScope = $bodyScope->mergeWith($scope); - $bodyScopeMaybeRan = $bodyScope; - $bodyScope = $this->processExprNode($stmt->cond, $bodyScope, $nodeCallback, ExpressionContext::createDeep())->getTruthyScope(); - $finalScopeResult = $this->processStmtNodes($stmt, $stmt->stmts, $bodyScope, $nodeCallback)->filterOutLoopExitPoints(); - $finalScope = $finalScopeResult->getScope(); - foreach ($finalScopeResult->getExitPointsByType(Continue_::class) as $continueExitPoint) { - $finalScope = $finalScope->mergeWith($continueExitPoint->getScope()); - } - $breakExitPoints = $finalScopeResult->getExitPointsByType(Break_::class); - foreach ($breakExitPoints as $breakExitPoint) { - $finalScope = $finalScope->mergeWith($breakExitPoint->getScope()); - } - - $beforeCondBooleanType = $scope->getType($stmt->cond)->toBoolean(); - $condBooleanType = $bodyScopeMaybeRan->getType($stmt->cond)->toBoolean(); - $isIterableAtLeastOnce = $beforeCondBooleanType instanceof ConstantBooleanType && $beforeCondBooleanType->getValue(); - $alwaysIterates = $condBooleanType instanceof ConstantBooleanType && $condBooleanType->getValue(); - - if ($alwaysIterates) { - $isAlwaysTerminating = count($finalScopeResult->getExitPointsByType(Break_::class)) === 0; - } elseif ($isIterableAtLeastOnce) { - $isAlwaysTerminating = $finalScopeResult->isAlwaysTerminating(); - } else { - $isAlwaysTerminating = false; - } - // todo for all loops - is not falsey when the loop is exited via break - $condScope = $condResult->getFalseyScope(); - if (!$isIterableAtLeastOnce) { - if (!$this->polluteScopeWithLoopInitialAssignments) { - $condScope = $condScope->mergeWith($scope); - } - $finalScope = $finalScope->mergeWith($condScope); - } - - return new StatementResult( - $finalScope, - $finalScopeResult->hasYield(), - $isAlwaysTerminating, - [] - ); - } elseif ($stmt instanceof Do_) { - $finalScope = null; - $bodyScope = $scope; - $count = 0; - do { - $prevScope = $bodyScope; - $bodyScopeResult = $this->processStmtNodes($stmt, $stmt->stmts, $bodyScope, static function (): void { - })->filterOutLoopExitPoints(); - $alwaysTerminating = $bodyScopeResult->isAlwaysTerminating(); - $bodyScope = $bodyScopeResult->getScope(); - foreach ($bodyScopeResult->getExitPointsByType(Continue_::class) as $continueExitPoint) { - $bodyScope = $bodyScope->mergeWith($continueExitPoint->getScope()); - } - $finalScope = $alwaysTerminating ? $finalScope : $bodyScope->mergeWith($finalScope); - foreach ($bodyScopeResult->getExitPointsByType(Break_::class) as $breakExitPoint) { - $finalScope = $breakExitPoint->getScope()->mergeWith($finalScope); - } - $bodyScope = $this->processExprNode($stmt->cond, $bodyScope, static function (): void { - }, ExpressionContext::createDeep())->getTruthyScope(); - if ($bodyScope->equals($prevScope)) { - break; - } - - if ($count >= self::GENERALIZE_AFTER_ITERATION) { - $bodyScope = $bodyScope->generalizeWith($prevScope); - } - $count++; - } while (!$alwaysTerminating && $count < self::LOOP_SCOPE_ITERATIONS); - - $bodyScope = $bodyScope->mergeWith($scope); - - $bodyScopeResult = $this->processStmtNodes($stmt, $stmt->stmts, $bodyScope, $nodeCallback)->filterOutLoopExitPoints(); - $bodyScope = $bodyScopeResult->getScope(); - $condBooleanType = $bodyScope->getType($stmt->cond)->toBoolean(); - $alwaysIterates = $condBooleanType instanceof ConstantBooleanType && $condBooleanType->getValue(); - - if ($alwaysIterates) { - $alwaysTerminating = count($bodyScopeResult->getExitPointsByType(Break_::class)) === 0; - } else { - $alwaysTerminating = $bodyScopeResult->isAlwaysTerminating(); - } - foreach ($bodyScopeResult->getExitPointsByType(Continue_::class) as $continueExitPoint) { - $bodyScope = $bodyScope->mergeWith($continueExitPoint->getScope()); - } - $finalScope = $alwaysTerminating ? $finalScope : $bodyScope->mergeWith($finalScope); - if ($finalScope === null) { - $finalScope = $scope; - } - if (!$alwaysTerminating) { - $finalScope = $this->processExprNode($stmt->cond, $bodyScope, $nodeCallback, ExpressionContext::createDeep())->getFalseyScope(); - // todo not falsey if it breaks out of the loop using break; - } - foreach ($bodyScopeResult->getExitPointsByType(Break_::class) as $breakExitPoint) { - $finalScope = $breakExitPoint->getScope()->mergeWith($finalScope); - } - - return new StatementResult($finalScope, $bodyScopeResult->hasYield(), $alwaysTerminating, []); - } elseif ($stmt instanceof For_) { - $initScope = $scope; - foreach ($stmt->init as $initExpr) { - $initScope = $this->processExprNode($initExpr, $initScope, $nodeCallback, ExpressionContext::createTopLevel())->getScope(); - } - - $bodyScope = $initScope; - foreach ($stmt->cond as $condExpr) { - $bodyScope = $this->processExprNode($condExpr, $bodyScope, static function (): void { - }, ExpressionContext::createDeep())->getTruthyScope(); - } - - $count = 0; - do { - $prevScope = $bodyScope; - $bodyScope = $bodyScope->mergeWith($initScope); - foreach ($stmt->cond as $condExpr) { - $bodyScope = $this->processExprNode($condExpr, $bodyScope, static function (): void { - }, ExpressionContext::createDeep())->getTruthyScope(); - } - $bodyScopeResult = $this->processStmtNodes($stmt, $stmt->stmts, $bodyScope, static function (): void { - })->filterOutLoopExitPoints(); - $alwaysTerminating = $bodyScopeResult->isAlwaysTerminating(); - $bodyScope = $bodyScopeResult->getScope(); - foreach ($bodyScopeResult->getExitPointsByType(Continue_::class) as $continueExitPoint) { - $bodyScope = $bodyScope->mergeWith($continueExitPoint->getScope()); - } - foreach ($stmt->loop as $loopExpr) { - $bodyScope = $this->processExprNode($loopExpr, $bodyScope, static function (): void { - }, ExpressionContext::createTopLevel())->getScope(); - } - - if ($bodyScope->equals($prevScope)) { - break; - } - - if ($count >= self::GENERALIZE_AFTER_ITERATION) { - $bodyScope = $bodyScope->generalizeWith($prevScope); - } - $count++; - } while (!$alwaysTerminating && $count < self::LOOP_SCOPE_ITERATIONS); - - $bodyScope = $bodyScope->mergeWith($initScope); - foreach ($stmt->cond as $condExpr) { - $bodyScope = $this->processExprNode($condExpr, $bodyScope, $nodeCallback, ExpressionContext::createDeep())->getTruthyScope(); - } - - $finalScopeResult = $this->processStmtNodes($stmt, $stmt->stmts, $bodyScope, $nodeCallback)->filterOutLoopExitPoints(); - $finalScope = $finalScopeResult->getScope(); - foreach ($finalScopeResult->getExitPointsByType(Continue_::class) as $continueExitPoint) { - $finalScope = $continueExitPoint->getScope()->mergeWith($finalScope); - } - foreach ($stmt->loop as $loopExpr) { - $finalScope = $this->processExprNode($loopExpr, $finalScope, $nodeCallback, ExpressionContext::createTopLevel())->getScope(); - } - foreach ($finalScopeResult->getExitPointsByType(Break_::class) as $breakExitPoint) { - $finalScope = $breakExitPoint->getScope()->mergeWith($finalScope); - } - - if ($this->polluteScopeWithLoopInitialAssignments) { - $scope = $initScope; - } - - $finalScope = $finalScope->mergeWith($scope); - - /*foreach ($stmt->cond as $condExpr) { - // todo not if breaks out of the loop using break; - //$finalScope = $finalScope->filterByFalseyValue($condExpr); - }*/ - - return new StatementResult($finalScope, $finalScopeResult->hasYield(), false/* $finalScopeResult->isAlwaysTerminating() && $isAlwaysIterable*/, []); - } elseif ($stmt instanceof Switch_) { - $scope = $this->processStmtVarAnnotation($scope, $stmt); - $scope = $this->processExprNode($stmt->cond, $scope, $nodeCallback, ExpressionContext::createDeep())->getScope(); - $scopeForBranches = $scope; - $finalScope = null; - $prevScope = null; - $hasDefaultCase = false; - $alwaysTerminating = true; - $hasYield = false; - foreach ($stmt->cases as $caseNode) { - if ($caseNode->cond !== null) { - $condExpr = new BinaryOp\Equal($stmt->cond, $caseNode->cond); - $scopeForBranches = $this->processExprNode($caseNode->cond, $scopeForBranches, $nodeCallback, ExpressionContext::createDeep())->getScope(); - $branchScope = $scopeForBranches->filterByTruthyValue($condExpr); - } else { - $hasDefaultCase = true; - $branchScope = $scopeForBranches; - } - - $branchScope = $branchScope->mergeWith($prevScope); - $branchScopeResult = $this->processStmtNodes($caseNode, $caseNode->stmts, $branchScope, $nodeCallback); - $branchScope = $branchScopeResult->getScope(); - $branchFinalScopeResult = $branchScopeResult->filterOutLoopExitPoints(); - $hasYield = $hasYield || $branchFinalScopeResult->hasYield(); - foreach ($branchScopeResult->getExitPointsByType(Break_::class) as $breakExitPoint) { - $finalScope = $breakExitPoint->getScope()->mergeWith($finalScope); - } - foreach ($branchScopeResult->getExitPointsByType(Continue_::class) as $continueExitPoint) { - $finalScope = $continueExitPoint->getScope()->mergeWith($finalScope); - } - if ($branchScopeResult->isAlwaysTerminating()) { - $alwaysTerminating = $alwaysTerminating && $branchFinalScopeResult->isAlwaysTerminating(); - $prevScope = null; - if (isset($condExpr)) { - $scopeForBranches = $scopeForBranches->filterByFalseyValue($condExpr); - } - if (!$branchFinalScopeResult->isAlwaysTerminating()) { - $finalScope = $branchScope->mergeWith($finalScope); - } - } else { - $prevScope = $branchScope; - } - } - - if (!$hasDefaultCase) { - $alwaysTerminating = false; - } - - if ($prevScope !== null && isset($branchFinalScopeResult)) { - $finalScope = $prevScope->mergeWith($finalScope); - $alwaysTerminating = $alwaysTerminating && $branchFinalScopeResult->isAlwaysTerminating(); - } - - if (!$hasDefaultCase || $finalScope === null) { - $finalScope = $scope->mergeWith($finalScope); - } - - return new StatementResult($finalScope, $hasYield, $alwaysTerminating, []); - } elseif ($stmt instanceof TryCatch) { - $branchScopeResult = $this->processStmtNodes($stmt, $stmt->stmts, $scope, $nodeCallback); - $branchScope = $branchScopeResult->getScope(); - $tryScope = $branchScope; - $exitPoints = []; - $finalScope = $branchScopeResult->isAlwaysTerminating() ? null : $branchScope; - $alwaysTerminating = $branchScopeResult->isAlwaysTerminating(); - $hasYield = $branchScopeResult->hasYield(); - - if ($stmt->finally !== null) { - $finallyScope = $branchScope; - } else { - $finallyScope = null; - } - foreach ($branchScopeResult->getExitPoints() as $exitPoint) { - if ($finallyScope !== null) { - $finallyScope = $finallyScope->mergeWith($exitPoint->getScope()); - } - $exitPoints[] = $exitPoint; - } - - foreach ($stmt->catches as $catchNode) { - $nodeCallback($catchNode, $scope); - if (!is_string($catchNode->var->name)) { - throw new \PHPStan\ShouldNotHappenException(); - } - - if (!$this->polluteCatchScopeWithTryAssignments) { - $catchScopeResult = $this->processCatchNode($catchNode, $scope->mergeWith($tryScope), $nodeCallback); - $catchScopeForFinally = $catchScopeResult->getScope(); - } else { - $catchScopeForFinally = $this->processCatchNode($catchNode, $tryScope, $nodeCallback)->getScope(); - $catchScopeResult = $this->processCatchNode($catchNode, $scope->mergeWith($tryScope), static function (): void { - }); - } - - $finalScope = $catchScopeResult->isAlwaysTerminating() ? $finalScope : $catchScopeResult->getScope()->mergeWith($finalScope); - $alwaysTerminating = $alwaysTerminating && $catchScopeResult->isAlwaysTerminating(); - $hasYield = $hasYield || $catchScopeResult->hasYield(); - - if ($finallyScope !== null) { - $finallyScope = $finallyScope->mergeWith($catchScopeForFinally); - } - foreach ($catchScopeResult->getExitPoints() as $exitPoint) { - if ($finallyScope !== null) { - $finallyScope = $finallyScope->mergeWith($exitPoint->getScope()); - } - $exitPoints[] = $exitPoint; - } - } - - if ($finalScope === null) { - $finalScope = $scope; - } - - if ($finallyScope !== null && $stmt->finally !== null) { - $originalFinallyScope = $finallyScope; - $finallyResult = $this->processStmtNodes($stmt->finally, $stmt->finally->stmts, $finallyScope, $nodeCallback); - $alwaysTerminating = $alwaysTerminating || $finallyResult->isAlwaysTerminating(); - $hasYield = $hasYield || $finallyResult->hasYield(); - $finallyScope = $finallyResult->getScope(); - $finalScope = $finallyResult->isAlwaysTerminating() ? $finalScope : $finalScope->processFinallyScope($finallyScope, $originalFinallyScope); - $exitPoints = array_merge($exitPoints, $finallyResult->getExitPoints()); - } - - return new StatementResult($finalScope, $hasYield, $alwaysTerminating, $exitPoints); - } elseif ($stmt instanceof Unset_) { - $hasYield = false; - foreach ($stmt->vars as $var) { - $scope = $this->lookForEnterVariableAssign($scope, $var); - $scope = $this->processExprNode($var, $scope, $nodeCallback, ExpressionContext::createDeep())->getScope(); - $scope = $this->lookForExitVariableAssign($scope, $var); - $scope = $scope->unsetExpression($var); - } - } elseif ($stmt instanceof Node\Stmt\Use_) { - $hasYield = false; - foreach ($stmt->uses as $use) { - $this->processStmtNode($use, $scope, $nodeCallback); - } - } elseif ($stmt instanceof Node\Stmt\Global_) { - $hasYield = false; - foreach ($stmt->vars as $var) { - if (!$var instanceof Variable) { - throw new \PHPStan\ShouldNotHappenException(); - } - $scope = $this->lookForEnterVariableAssign($scope, $var); - $this->processExprNode($var, $scope, $nodeCallback, ExpressionContext::createDeep()); - $scope = $this->lookForExitVariableAssign($scope, $var); - - if (!is_string($var->name)) { - continue; - } - - $scope = $scope->assignVariable($var->name, new MixedType()); - } - } elseif ($stmt instanceof Static_) { - $hasYield = false; - $comment = CommentHelper::getDocComment($stmt); - foreach ($stmt->vars as $var) { - $scope = $this->processStmtNode($var, $scope, $nodeCallback)->getScope(); - if ($comment === null || !is_string($var->var->name)) { - continue; - } - $scope = $this->processVarAnnotation($scope, $var->var->name, $comment, false); - } - } elseif ($stmt instanceof StaticVar) { - $hasYield = false; - if (!is_string($stmt->var->name)) { - throw new \PHPStan\ShouldNotHappenException(); - } - if ($stmt->default !== null) { - $this->processExprNode($stmt->default, $scope, $nodeCallback, ExpressionContext::createDeep()); - } - $scope = $scope->enterExpressionAssign($stmt->var); - $this->processExprNode($stmt->var, $scope, $nodeCallback, ExpressionContext::createDeep()); - $scope = $scope->exitExpressionAssign($stmt->var); - $scope = $scope->assignVariable($stmt->var->name, new MixedType()); - } elseif ($stmt instanceof Node\Stmt\Const_ || $stmt instanceof Node\Stmt\ClassConst) { - $hasYield = false; - foreach ($stmt->consts as $const) { - $nodeCallback($const, $scope); - $this->processExprNode($const->value, $scope, $nodeCallback, ExpressionContext::createDeep()); - $scope = $scope->specifyExpressionType(new ConstFetch(new Name\FullyQualified($const->name->toString())), $scope->getType($const->value)); - } - } elseif ($stmt instanceof Node\Stmt\Nop) { - $scope = $this->processStmtVarAnnotation($scope, $stmt); - $hasYield = false; - } else { - $hasYield = false; - } - - return new StatementResult($scope, $hasYield, false, []); - } - - /** - * @param Node\Stmt\Catch_ $catchNode - * @param Scope $catchScope - * @param \Closure(\PhpParser\Node $node, Scope $scope): void $nodeCallback - * @return StatementResult - */ - private function processCatchNode( - Node\Stmt\Catch_ $catchNode, - Scope $catchScope, - \Closure $nodeCallback - ): StatementResult - { - if (!is_string($catchNode->var->name)) { - throw new \PHPStan\ShouldNotHappenException(); - } - - $catchScope = $catchScope->enterCatch($catchNode->types, $catchNode->var->name); - return $this->processStmtNodes($catchNode, $catchNode->stmts, $catchScope, $nodeCallback); - } - - private function lookForEnterVariableAssign(Scope $scope, Expr $expr): Scope - { - if (!$expr instanceof ArrayDimFetch || $expr->dim !== null) { - $scope = $scope->enterExpressionAssign($expr); - } - if (!$expr instanceof Variable) { - return $this->lookForVariableAssignCallback($scope, $expr, static function (Scope $scope, Expr $expr): Scope { - return $scope->enterExpressionAssign($expr); - }); - } - - return $scope; - } - - private function lookForExitVariableAssign(Scope $scope, Expr $expr): Scope - { - $scope = $scope->exitExpressionAssign($expr); - if (!$expr instanceof Variable) { - return $this->lookForVariableAssignCallback($scope, $expr, static function (Scope $scope, Expr $expr): Scope { - return $scope->exitExpressionAssign($expr); - }); - } - - return $scope; - } - - /** - * @param Scope $scope - * @param Expr $expr - * @param \Closure(Scope $scope, Expr $expr): Scope $callback - * @return Scope - */ - private function lookForVariableAssignCallback(Scope $scope, Expr $expr, \Closure $callback): Scope - { - if ($expr instanceof Variable) { - $scope = $callback($scope, $expr); - } elseif ($expr instanceof ArrayDimFetch) { - while ($expr instanceof ArrayDimFetch) { - $expr = $expr->var; - } - - $scope = $this->lookForVariableAssignCallback($scope, $expr, $callback); - } elseif ($expr instanceof PropertyFetch) { - $scope = $this->lookForVariableAssignCallback($scope, $expr->var, $callback); - } elseif ($expr instanceof StaticPropertyFetch) { - if ($expr->class instanceof Expr) { - $scope = $this->lookForVariableAssignCallback($scope, $expr->class, $callback); - } - } elseif ($expr instanceof Array_ || $expr instanceof List_) { - foreach ($expr->items as $item) { - if ($item === null) { - continue; - } - - $scope = $this->lookForVariableAssignCallback($scope, $item->value, $callback); - } - } - - return $scope; - } - - private function ensureNonNullability(Scope $scope, Expr $expr, bool $findMethods): EnsuredNonNullabilityResult - { - $exprToSpecify = $expr; - $specifiedExpressions = []; - while ( - $exprToSpecify instanceof PropertyFetch - || $exprToSpecify instanceof StaticPropertyFetch - || ( - $findMethods && ( - $exprToSpecify instanceof MethodCall - || $exprToSpecify instanceof StaticCall - ) - ) - ) { - if ( - $exprToSpecify instanceof PropertyFetch - || $exprToSpecify instanceof MethodCall - ) { - $exprToSpecify = $exprToSpecify->var; - } elseif ($exprToSpecify->class instanceof Expr) { - $exprToSpecify = $exprToSpecify->class; - } else { - break; - } - - $exprType = $scope->getType($exprToSpecify); - $exprTypeWithoutNull = TypeCombinator::removeNull($exprType); - if ($exprType->equals($exprTypeWithoutNull)) { - continue; - } - - $specifiedExpressions[] = new EnsuredNonNullabilityResultExpression($exprToSpecify, $exprType); - - $scope = $scope->specifyExpressionType($exprToSpecify, $exprTypeWithoutNull); - } - - return new EnsuredNonNullabilityResult($scope, $specifiedExpressions); - } - - /** - * @param Scope $scope - * @param EnsuredNonNullabilityResultExpression[] $specifiedExpressions - * @return Scope - */ - private function revertNonNullability(Scope $scope, array $specifiedExpressions): Scope - { - foreach ($specifiedExpressions as $specifiedExpressionResult) { - $scope = $scope->specifyExpressionType($specifiedExpressionResult->getExpression(), $specifiedExpressionResult->getOriginalType()); - } - - return $scope; - } - - private function findEarlyTerminatingExpr(Expr $expr, Scope $scope): ?Expr - { - if (($expr instanceof MethodCall || $expr instanceof Expr\StaticCall) && count($this->earlyTerminatingMethodCalls) > 0) { - if ($expr->name instanceof Expr) { - return null; - } - - if ($expr instanceof MethodCall) { - $methodCalledOnType = $scope->getType($expr->var); - } else { - if ($expr->class instanceof Name) { - $methodCalledOnType = $scope->getFunctionType($expr->class, false, false); - } else { - $methodCalledOnType = $scope->getType($expr->class); - } - } - - $directClassNames = TypeUtils::getDirectClassNames($methodCalledOnType); - foreach ($directClassNames as $referencedClass) { - if (!$this->broker->hasClass($referencedClass)) { - continue; - } - - $classReflection = $this->broker->getClass($referencedClass); - foreach (array_merge([$referencedClass], $classReflection->getParentClassesNames(), $classReflection->getNativeReflection()->getInterfaceNames()) as $className) { - if (!isset($this->earlyTerminatingMethodCalls[$className])) { - continue; - } - - if (in_array((string) $expr->name, $this->earlyTerminatingMethodCalls[$className], true)) { - return $expr; - } - } - } - } - - if ($expr instanceof Exit_) { - return $expr; - } - - return null; - } - - /** - * @param \PhpParser\Node\Expr $expr - * @param \PHPStan\Analyser\Scope $scope - * @param \Closure(\PhpParser\Node $node, Scope $scope): void $nodeCallback - * @param \PHPStan\Analyser\ExpressionContext $context - * @return \PHPStan\Analyser\ExpressionResult - */ - private function processExprNode(Expr $expr, Scope $scope, \Closure $nodeCallback, ExpressionContext $context): ExpressionResult - { - $this->callNodeCallbackWithExpression($nodeCallback, $expr, $scope, $context); - - if ($expr instanceof Variable) { - $hasYield = false; - if ($expr->name instanceof Expr) { - return $this->processExprNode($expr->name, $scope, $nodeCallback, $context->enterDeep()); - } - } elseif ($expr instanceof Assign || $expr instanceof AssignRef) { - if (!$expr->var instanceof Array_ && !$expr->var instanceof List_) { - $result = $this->processAssignVar( - $scope, - $expr->var, - $expr->expr, - $nodeCallback, - $context, - function (Scope $scope) use ($expr, $nodeCallback, $context): ExpressionResult { - $hasYield = false; - if ($expr instanceof AssignRef) { - $scope = $scope->enterExpressionAssign($expr->expr); - } - - if ($expr->var instanceof Variable && is_string($expr->var->name)) { - $context = $context->enterRightSideAssign( - $expr->var->name, - $scope->getType($expr->expr) - ); - } - - $result = $this->processExprNode($expr->expr, $scope, $nodeCallback, $context->enterDeep()); - $hasYield = $result->hasYield(); - $scope = $result->getScope(); - - if ($expr instanceof AssignRef) { - $scope = $scope->exitExpressionAssign($expr->expr); - } - - return new ExpressionResult($scope, $hasYield); - }, - true - ); - $scope = $result->getScope(); - $hasYield = $result->hasYield(); - $varChangedScope = false; - if ($expr->var instanceof Variable && is_string($expr->var->name)) { - $comment = CommentHelper::getDocComment($expr); - if ($comment !== null) { - $scope = $this->processVarAnnotation($scope, $expr->var->name, $comment, false, $varChangedScope); - } - } - - if (!$varChangedScope) { - $scope = $this->processStmtVarAnnotation($scope, new Node\Stmt\Expression($expr, [ - 'comments' => $expr->getAttribute('comments'), - ])); - } - } else { - $result = $this->processExprNode($expr->expr, $scope, $nodeCallback, $context->enterDeep()); - $hasYield = $result->hasYield(); - $scope = $result->getScope(); - foreach ($expr->var->items as $arrayItem) { - if ($arrayItem === null) { - continue; - } - - $itemScope = $scope; - if ($arrayItem->value instanceof ArrayDimFetch && $arrayItem->value->dim === null) { - $itemScope = $itemScope->enterExpressionAssign($arrayItem->value); - } - $itemScope = $this->lookForEnterVariableAssign($itemScope, $arrayItem->value); - - $this->processExprNode($arrayItem, $itemScope, $nodeCallback, $context->enterDeep()); - } - $scope = $this->lookForArrayDestructuringArray($scope, $expr->var, $scope->getType($expr->expr)); - $comment = CommentHelper::getDocComment($expr); - if ($comment !== null) { - foreach ($expr->var->items as $arrayItem) { - if ($arrayItem === null) { - continue; - } - if (!$arrayItem->value instanceof Variable || !is_string($arrayItem->value->name)) { - continue; - } - - $varChangedScope = false; - $scope = $this->processVarAnnotation($scope, $arrayItem->value->name, $comment, true, $varChangedScope); - if ($varChangedScope) { - continue; - } - - $scope = $this->processStmtVarAnnotation($scope, new Node\Stmt\Expression($expr, [ - 'comments' => $expr->getAttribute('comments'), - ])); - } - } - } - } elseif ($expr instanceof Expr\AssignOp) { - $result = $this->processAssignVar( - $scope, - $expr->var, - $expr, - $nodeCallback, - $context, - function (Scope $scope) use ($expr, $nodeCallback, $context): ExpressionResult { - return $this->processExprNode($expr->expr, $scope, $nodeCallback, $context->enterDeep()); - }, - $expr instanceof Expr\AssignOp\Coalesce - ); - $scope = $result->getScope(); - $hasYield = $result->hasYield(); - } elseif ($expr instanceof FuncCall) { - $parametersAcceptor = null; - if ($expr->name instanceof Expr) { - $scope = $this->processExprNode($expr->name, $scope, $nodeCallback, $context->enterDeep())->getScope(); - } elseif ($this->broker->hasFunction($expr->name, $scope)) { - $function = $this->broker->getFunction($expr->name, $scope); - $parametersAcceptor = ParametersAcceptorSelector::selectFromArgs( - $scope, - $expr->args, - $function->getVariants() - ); - } - $result = $this->processArgs($parametersAcceptor, $expr->args, $scope, $nodeCallback, $context); - $scope = $result->getScope(); - $hasYield = $result->hasYield(); - if ( - isset($function) - && in_array($function->getName(), ['array_pop', 'array_shift'], true) - && count($expr->args) >= 1 - ) { - $arrayArg = $expr->args[0]->value; - $constantArrays = TypeUtils::getConstantArrays($scope->getType($arrayArg)); - if (count($constantArrays) > 0) { - $resultArrayTypes = []; - - foreach ($constantArrays as $constantArray) { - if ($function->getName() === 'array_pop') { - $resultArrayTypes[] = $constantArray->removeLast(); - } else { - $resultArrayTypes[] = $constantArray->removeFirst(); - } - } - - $scope = $scope->specifyExpressionType( - $arrayArg, - TypeCombinator::union(...$resultArrayTypes) - ); - } else { - $arrays = TypeUtils::getAnyArrays($scope->getType($arrayArg)); - if (count($arrays) > 0) { - $scope = $scope->specifyExpressionType($arrayArg, TypeCombinator::union(...$arrays)); - } - } - } - - if ( - isset($function) - && in_array($function->getName(), ['array_push', 'array_unshift'], true) - && count($expr->args) >= 2 - ) { - $argumentTypes = []; - foreach (array_slice($expr->args, 1) as $callArg) { - $callArgType = $scope->getType($callArg->value); - if ($callArg->unpack) { - $iterableValueType = $callArgType->getIterableValueType(); - if ($iterableValueType instanceof UnionType) { - foreach ($iterableValueType->getTypes() as $innerType) { - $argumentTypes[] = $innerType; - } - } else { - $argumentTypes[] = $iterableValueType; - } - continue; - } - - $argumentTypes[] = $callArgType; - } - - $arrayArg = $expr->args[0]->value; - $originalArrayType = $scope->getType($arrayArg); - $constantArrays = TypeUtils::getConstantArrays($originalArrayType); - if ( - $function->getName() === 'array_push' - || ($originalArrayType->isArray()->yes() && count($constantArrays) === 0) - ) { - $arrayType = $originalArrayType; - foreach ($argumentTypes as $argType) { - $arrayType = $arrayType->setOffsetValueType(null, $argType); - } - - $scope = $scope->specifyExpressionType($arrayArg, TypeCombinator::intersect($arrayType, new NonEmptyArrayType())); - } elseif (count($constantArrays) > 0) { - $defaultArrayBuilder = ConstantArrayTypeBuilder::createEmpty(); - foreach ($argumentTypes as $argType) { - $defaultArrayBuilder->setOffsetValueType(null, $argType); - } - - $defaultArrayType = $defaultArrayBuilder->getArray(); - - $arrayTypes = []; - foreach ($constantArrays as $constantArray) { - $arrayType = $defaultArrayType; - foreach ($constantArray->getKeyTypes() as $i => $keyType) { - $valueType = $constantArray->getValueTypes()[$i]; - if ($keyType instanceof ConstantIntegerType) { - $keyType = null; - } - $arrayType = $arrayType->setOffsetValueType($keyType, $valueType); - } - $arrayTypes[] = $arrayType; - } - - $scope = $scope->specifyExpressionType( - $arrayArg, - TypeCombinator::union(...$arrayTypes) - ); - } - } - - if ( - isset($function) - && in_array($function->getName(), ['fopen', 'file_get_contents'], true) - ) { - $scope = $scope->assignVariable('http_response_header', new ArrayType(new IntegerType(), new StringType())); - } - } elseif ($expr instanceof MethodCall) { - $originalScope = $scope; - if ( - ($expr->var instanceof Expr\Closure || $expr->var instanceof Expr\ArrowFunction) - && $expr->name instanceof Node\Identifier - && strtolower($expr->name->name) === 'call' - && isset($expr->args[0]) - ) { - $closureCallScope = $scope->enterClosureCall($scope->getType($expr->args[0]->value)); - } - - $result = $this->processExprNode($expr->var, $closureCallScope ?? $scope, $nodeCallback, $context->enterDeep()); - $hasYield = $result->hasYield(); - $scope = $result->getScope(); - if (isset($closureCallScope)) { - $scope = $scope->restoreOriginalScopeAfterClosureBind($originalScope); - } - $parametersAcceptor = null; - if ($expr->name instanceof Expr) { - $scope = $this->processExprNode($expr->name, $scope, $nodeCallback, $context->enterDeep())->getScope(); - } else { - $calledOnType = $scope->getType($expr->var); - $methodName = $expr->name->name; - if ($calledOnType->hasMethod($methodName)->yes()) { - $parametersAcceptor = ParametersAcceptorSelector::selectFromArgs( - $scope, - $expr->args, - $calledOnType->getMethod($methodName, $scope)->getVariants() - ); - } - } - $result = $this->processArgs($parametersAcceptor, $expr->args, $scope, $nodeCallback, $context); - $scope = $result->getScope(); - $hasYield = $hasYield || $result->hasYield(); - } elseif ($expr instanceof StaticCall) { - if ($expr->class instanceof Expr) { - $scope = $this->processExprNode($expr->class, $scope, $nodeCallback, $context->enterDeep())->getScope(); - } - - $parametersAcceptor = null; - $hasYield = false; - if ($expr->name instanceof Expr) { - $result = $this->processExprNode($expr->name, $scope, $nodeCallback, $context->enterDeep()); - $hasYield = $result->hasYield(); - $scope = $result->getScope(); - } elseif ($expr->class instanceof Name) { - $className = $scope->resolveName($expr->class); - if ($this->broker->hasClass($className)) { - $classReflection = $this->broker->getClass($className); - if (is_string($expr->name)) { - $methodName = $expr->name; - } else { - $methodName = $expr->name->name; - } - if ($classReflection->hasMethod($methodName)) { - $parametersAcceptor = ParametersAcceptorSelector::selectFromArgs( - $scope, - $expr->args, - $classReflection->getMethod($methodName, $scope)->getVariants() - ); - if ( - $classReflection->getName() === 'Closure' - && strtolower($methodName) === 'bind' - ) { - $thisType = null; - if (isset($expr->args[1])) { - $argType = $scope->getType($expr->args[1]->value); - if ($argType instanceof NullType) { - $thisType = null; - } else { - $thisType = $argType; - } - } - $scopeClass = 'static'; - if (isset($expr->args[2])) { - $argValue = $expr->args[2]->value; - $argValueType = $scope->getType($argValue); - - $directClassNames = TypeUtils::getDirectClassNames($argValueType); - if (count($directClassNames) === 1) { - $scopeClass = $directClassNames[0]; - } elseif ( - $argValue instanceof Expr\ClassConstFetch - && $argValue->name instanceof Node\Identifier - && strtolower($argValue->name->name) === 'class' - && $argValue->class instanceof Name - ) { - $scopeClass = $scope->resolveName($argValue->class); - } elseif ($argValueType instanceof ConstantStringType) { - $scopeClass = $argValueType->getValue(); - } - } - $closureBindScope = $scope->enterClosureBind($thisType, $scopeClass); - } - } - } - } - $result = $this->processArgs($parametersAcceptor, $expr->args, $scope, $nodeCallback, $context, $closureBindScope ?? null); - $scope = $result->getScope(); - $hasYield = $hasYield || $result->hasYield(); - } elseif ($expr instanceof PropertyFetch) { - $result = $this->processExprNode($expr->var, $scope, $nodeCallback, $context->enterDeep()); - $hasYield = $result->hasYield(); - $scope = $result->getScope(); - if ($expr->name instanceof Expr) { - $result = $this->processExprNode($expr->name, $scope, $nodeCallback, $context->enterDeep()); - $hasYield = $hasYield || $result->hasYield(); - $scope = $result->getScope(); - } - } elseif ($expr instanceof StaticPropertyFetch) { - $hasYield = false; - if ($expr->class instanceof Expr) { - $result = $this->processExprNode($expr->class, $scope, $nodeCallback, $context->enterDeep()); - $hasYield = $result->hasYield(); - $scope = $result->getScope(); - } - if ($expr->name instanceof Expr) { - $result = $this->processExprNode($expr->name, $scope, $nodeCallback, $context->enterDeep()); - $hasYield = $hasYield || $result->hasYield(); - $scope = $result->getScope(); - } - } elseif ($expr instanceof Expr\Closure) { - return $this->processClosureNode($expr, $scope, $nodeCallback, $context, null); - } elseif ($expr instanceof Expr\ClosureUse) { - $this->processExprNode($expr->var, $scope, $nodeCallback, $context); - $hasYield = false; - } elseif ($expr instanceof Expr\ArrowFunction) { - foreach ($expr->params as $param) { - $this->processParamNode($param, $scope, $nodeCallback); - } - if ($expr->returnType !== null) { - $nodeCallback($expr->returnType, $scope); - } - - $arrowFunctionScope = $scope->enterArrowFunction($expr); - $nodeCallback(new InArrowFunctionNode($expr), $arrowFunctionScope); - $this->processExprNode($expr->expr, $arrowFunctionScope, $nodeCallback, $context); - $hasYield = false; - - } elseif ($expr instanceof ErrorSuppress) { - $result = $this->processExprNode($expr->expr, $scope, $nodeCallback, $context); - $hasYield = $result->hasYield(); - $scope = $result->getScope(); - } elseif ($expr instanceof Exit_) { - $hasYield = false; - if ($expr->expr !== null) { - $result = $this->processExprNode($expr->expr, $scope, $nodeCallback, $context->enterDeep()); - $hasYield = $result->hasYield(); - $scope = $result->getScope(); - } - } elseif ($expr instanceof Node\Scalar\Encapsed) { - $hasYield = false; - foreach ($expr->parts as $part) { - $result = $this->processExprNode($part, $scope, $nodeCallback, $context->enterDeep()); - $hasYield = $hasYield || $result->hasYield(); - $scope = $result->getScope(); - } - } elseif ($expr instanceof ArrayDimFetch) { - $hasYield = false; - if ($expr->dim !== null) { - $result = $this->processExprNode($expr->dim, $scope, $nodeCallback, $context->enterDeep()); - $hasYield = $result->hasYield(); - $scope = $result->getScope(); - } - - $result = $this->processExprNode($expr->var, $scope, $nodeCallback, $context->enterDeep()); - $hasYield = $hasYield || $result->hasYield(); - $scope = $result->getScope(); - } elseif ($expr instanceof Array_) { - $itemNodes = []; - $hasYield = false; - foreach ($expr->items as $arrayItem) { - $itemNodes[] = new LiteralArrayItem($scope, $arrayItem); - $result = $this->processExprNode($arrayItem, $scope, $nodeCallback, $context->enterDeep()); - $hasYield = $hasYield || $result->hasYield(); - $scope = $result->getScope(); - } - $nodeCallback(new LiteralArrayNode($expr, $itemNodes), $scope); - } elseif ($expr instanceof ArrayItem) { - $hasYield = false; - if ($expr->key !== null) { - $result = $this->processExprNode($expr->key, $scope, $nodeCallback, $context->enterDeep()); - $hasYield = $result->hasYield(); - $scope = $result->getScope(); - } - $result = $this->processExprNode($expr->value, $scope, $nodeCallback, $context->enterDeep()); - $hasYield = $hasYield || $result->hasYield(); - $scope = $result->getScope(); - } elseif ($expr instanceof BooleanAnd || $expr instanceof BinaryOp\LogicalAnd) { - $leftResult = $this->processExprNode($expr->left, $scope, $nodeCallback, $context->enterDeep()); - $rightResult = $this->processExprNode($expr->right, $leftResult->getTruthyScope(), $nodeCallback, $context); - $leftMergedWithRightScope = $leftResult->getScope()->mergeWith($rightResult->getScope()); - - return new ExpressionResult( - $leftMergedWithRightScope, - $leftResult->hasYield() || $rightResult->hasYield(), - static function () use ($expr, $rightResult): Scope { - return $rightResult->getScope()->filterByTruthyValue($expr); - }, - static function () use ($leftMergedWithRightScope, $expr): Scope { - return $leftMergedWithRightScope->filterByFalseyValue($expr); - } - ); - // todo do not execute right side if the left is false - } elseif ($expr instanceof BooleanOr || $expr instanceof BinaryOp\LogicalOr) { - $leftResult = $this->processExprNode($expr->left, $scope, $nodeCallback, $context->enterDeep()); - $rightResult = $this->processExprNode($expr->right, $leftResult->getFalseyScope(), $nodeCallback, $context); - $leftMergedWithRightScope = $leftResult->getScope()->mergeWith($rightResult->getScope()); - - return new ExpressionResult( - $leftMergedWithRightScope, - $leftResult->hasYield() || $rightResult->hasYield(), - static function () use ($leftMergedWithRightScope, $expr): Scope { - return $leftMergedWithRightScope->filterByTruthyValue($expr); - }, - static function () use ($expr, $rightResult): Scope { - return $rightResult->getScope()->filterByFalseyValue($expr); - } - ); - // todo do not execute right side if the left is true - } elseif ($expr instanceof Coalesce) { - $nonNullabilityResult = $this->ensureNonNullability($scope, $expr->left, false); - - if ($expr->left instanceof PropertyFetch) { - $scope = $nonNullabilityResult->getScope(); - } else { - $scope = $this->lookForEnterVariableAssign($nonNullabilityResult->getScope(), $expr->left); - } - $result = $this->processExprNode($expr->left, $scope, $nodeCallback, $context->enterDeep()); - $hasYield = $result->hasYield(); - $scope = $result->getScope(); - $scope = $this->revertNonNullability($scope, $nonNullabilityResult->getSpecifiedExpressions()); - - if (!$expr->left instanceof PropertyFetch) { - $scope = $this->lookForExitVariableAssign($scope, $expr->left); - } - $result = $this->processExprNode($expr->right, $scope, $nodeCallback, $context->enterDeep()); - $scope = $result->getScope()->mergeWith($scope); - $hasYield = $hasYield || $result->hasYield(); - } elseif ($expr instanceof BinaryOp) { - $result = $this->processExprNode($expr->left, $scope, $nodeCallback, $context->enterDeep()); - $scope = $result->getScope(); - $hasYield = $result->hasYield(); - $result = $this->processExprNode($expr->right, $scope, $nodeCallback, $context->enterDeep()); - $scope = $result->getScope(); - $hasYield = $hasYield || $result->hasYield(); - } elseif ( - $expr instanceof Expr\BitwiseNot - || $expr instanceof Cast - || $expr instanceof Expr\Clone_ - || $expr instanceof Expr\Eval_ - || $expr instanceof Expr\Include_ - || $expr instanceof Expr\Print_ - || $expr instanceof Expr\UnaryMinus - || $expr instanceof Expr\UnaryPlus - || $expr instanceof Expr\YieldFrom - ) { - $result = $this->processExprNode($expr->expr, $scope, $nodeCallback, $context->enterDeep()); - if ($expr instanceof Expr\YieldFrom) { - $hasYield = true; - } else { - $hasYield = $result->hasYield(); - } - - $scope = $result->getScope(); - } elseif ($expr instanceof BooleanNot) { - $scope = $scope->enterNegation(); - $result = $this->processExprNode($expr->expr, $scope, $nodeCallback, $context->enterDeep()); - $scope = $result->getScope()->enterNegation(); - $hasYield = $result->hasYield(); - } elseif ($expr instanceof Expr\ClassConstFetch) { - $hasYield = false; - if ($expr->class instanceof Expr) { - $result = $this->processExprNode($expr->class, $scope, $nodeCallback, $context->enterDeep()); - $scope = $result->getScope(); - $hasYield = $result->hasYield(); - } - } elseif ($expr instanceof Expr\Empty_) { - $nonNullabilityResult = $this->ensureNonNullability($scope, $expr->expr, true); - $scope = $this->lookForEnterVariableAssign($nonNullabilityResult->getScope(), $expr->expr); - $result = $this->processExprNode($expr->expr, $scope, $nodeCallback, $context->enterDeep()); - $scope = $result->getScope(); - $hasYield = $result->hasYield(); - $scope = $this->revertNonNullability($scope, $nonNullabilityResult->getSpecifiedExpressions()); - $scope = $this->lookForExitVariableAssign($scope, $expr->expr); - } elseif ($expr instanceof Expr\Isset_) { - $hasYield = false; - foreach ($expr->vars as $var) { - $nonNullabilityResult = $this->ensureNonNullability($scope, $var, true); - $scope = $this->lookForEnterVariableAssign($nonNullabilityResult->getScope(), $var); - $result = $this->processExprNode($var, $scope, $nodeCallback, $context->enterDeep()); - $scope = $result->getScope(); - $hasYield = $hasYield || $result->hasYield(); - $scope = $this->revertNonNullability($scope, $nonNullabilityResult->getSpecifiedExpressions()); - $scope = $this->lookForExitVariableAssign($scope, $var); - } - } elseif ($expr instanceof Instanceof_) { - $result = $this->processExprNode($expr->expr, $scope, $nodeCallback, $context->enterDeep()); - $scope = $result->getScope(); - $hasYield = $result->hasYield(); - if ($expr->class instanceof Expr) { - $result = $this->processExprNode($expr->class, $scope, $nodeCallback, $context->enterDeep()); - $scope = $result->getScope(); - $hasYield = $hasYield || $result->hasYield(); - } - } elseif ($expr instanceof List_) { - // only in assign and foreach, processed elsewhere - return new ExpressionResult($scope, false); - } elseif ($expr instanceof New_) { - $parametersAcceptor = null; - $hasYield = false; - if ($expr->class instanceof Expr) { - $result = $this->processExprNode($expr->class, $scope, $nodeCallback, $context->enterDeep()); - $scope = $result->getScope(); - $hasYield = $result->hasYield(); - } elseif ($expr->class instanceof Class_) { - $this->broker->getAnonymousClassReflection($expr->class, $scope); // populates $expr->class->name - $this->processStmtNode($expr->class, $scope, $nodeCallback); - } elseif ($this->broker->hasClass($expr->class->toString())) { - $classReflection = $this->broker->getClass($expr->class->toString()); - if ($classReflection->hasConstructor()) { - $parametersAcceptor = ParametersAcceptorSelector::selectFromArgs( - $scope, - $expr->args, - $classReflection->getConstructor()->getVariants() - ); - } - } - $result = $this->processArgs($parametersAcceptor, $expr->args, $scope, $nodeCallback, $context); - $scope = $result->getScope(); - $hasYield = $hasYield || $result->hasYield(); - } elseif ( - $expr instanceof Expr\PreInc - || $expr instanceof Expr\PostInc - || $expr instanceof Expr\PreDec - || $expr instanceof Expr\PostDec - ) { - $result = $this->processExprNode($expr->var, $scope, $nodeCallback, $context->enterDeep()); - $scope = $result->getScope(); - $hasYield = $result->hasYield(); - if ( - $expr->var instanceof Variable - || $expr->var instanceof ArrayDimFetch - || $expr->var instanceof PropertyFetch - || $expr->var instanceof StaticPropertyFetch - ) { - $expressionType = $scope->getType($expr); - if (count(TypeUtils::getConstantScalars($expressionType)) > 0) { - $newExpr = $expr; - if ($expr instanceof Expr\PostInc) { - $newExpr = new Expr\PreInc($expr->var); - } elseif ($expr instanceof Expr\PostDec) { - $newExpr = new Expr\PreDec($expr->var); - } - - $scope = $this->processAssignVar( - $scope, - $expr->var, - $newExpr, - static function (): void { - }, - $context, - static function (Scope $scope): ExpressionResult { - return new ExpressionResult($scope, false); - }, - false - )->getScope(); - } - } - } elseif ($expr instanceof Ternary) { - $ternaryCondResult = $this->processExprNode($expr->cond, $scope, $nodeCallback, $context->enterDeep()); - $ifTrueScope = $ternaryCondResult->getTruthyScope(); - $ifFalseScope = $ternaryCondResult->getFalseyScope(); - - if ($expr->if !== null) { - $ifTrueScope = $this->processExprNode($expr->if, $ifTrueScope, $nodeCallback, $context)->getScope(); - $ifFalseScope = $this->processExprNode($expr->else, $ifFalseScope, $nodeCallback, $context)->getScope(); - } else { - $ifFalseScope = $this->processExprNode($expr->else, $ifFalseScope, $nodeCallback, $context)->getScope(); - } - - $finalScope = $ifTrueScope->mergeWith($ifFalseScope); - - return new ExpressionResult( - $finalScope, - $ternaryCondResult->hasYield(), - static function () use ($finalScope, $expr): Scope { - return $finalScope->filterByTruthyValue($expr); - }, - static function () use ($finalScope, $expr): Scope { - return $finalScope->filterByFalseyValue($expr); - } - ); - - // todo do not run else if cond is always true - // todo do not run if branch if cond is always false - } elseif ($expr instanceof Expr\Yield_) { - if ($expr->key !== null) { - $scope = $this->processExprNode($expr->key, $scope, $nodeCallback, $context->enterDeep())->getScope(); - } - if ($expr->value !== null) { - $scope = $this->processExprNode($expr->value, $scope, $nodeCallback, $context->enterDeep())->getScope(); - } - $hasYield = true; - } else { - $hasYield = false; - } - - return new ExpressionResult( - $scope, - $hasYield, - static function () use ($scope, $expr): Scope { - return $scope->filterByTruthyValue($expr); - }, - static function () use ($scope, $expr): Scope { - return $scope->filterByFalseyValue($expr); - } - ); - } - - /** - * @param \Closure(\PhpParser\Node $node, Scope $scope): void $nodeCallback - * @param Expr $expr - * @param Scope $scope - * @param ExpressionContext $context - */ - private function callNodeCallbackWithExpression( - \Closure $nodeCallback, - Expr $expr, - Scope $scope, - ExpressionContext $context - ): void - { - if ($context->isDeep()) { - $scope = $scope->exitFirstLevelStatements(); - } - $nodeCallback($expr, $scope); - } - - /** - * @param \PhpParser\Node\Expr\Closure $expr - * @param \PHPStan\Analyser\Scope $scope - * @param \Closure(\PhpParser\Node $node, Scope $scope): void $nodeCallback - * @param ExpressionContext $context - * @param Type|null $passedToType - * @return \PHPStan\Analyser\ExpressionResult - */ - private function processClosureNode( - Expr\Closure $expr, - Scope $scope, - \Closure $nodeCallback, - ExpressionContext $context, - ?Type $passedToType - ): ExpressionResult - { - foreach ($expr->params as $param) { - $this->processParamNode($param, $scope, $nodeCallback); - } - - $byRefUses = []; - - if ($passedToType !== null && !$passedToType->isCallable()->no()) { - $callableParameters = null; - $acceptors = $passedToType->getCallableParametersAcceptors($scope); - if (count($acceptors) === 1) { - $callableParameters = $acceptors[0]->getParameters(); - } - } else { - $callableParameters = null; - } - - $useScope = $scope; - foreach ($expr->uses as $use) { - if ($use->byRef) { - $byRefUses[] = $use; - $useScope = $useScope->enterExpressionAssign($use->var); - - $inAssignRightSideVariableName = $context->getInAssignRightSideVariableName(); - $inAssignRightSideType = $context->getInAssignRightSideType(); - if ( - $inAssignRightSideVariableName === $use->var->name - && $inAssignRightSideType !== null - ) { - if ($inAssignRightSideType instanceof ClosureType) { - $variableType = $inAssignRightSideType; - } else { - $alreadyHasVariableType = $scope->hasVariableType($inAssignRightSideVariableName); - if ($alreadyHasVariableType->no()) { - $variableType = TypeCombinator::union(new NullType(), $inAssignRightSideType); - } else { - $variableType = TypeCombinator::union($scope->getVariableType($inAssignRightSideVariableName), $inAssignRightSideType); - } - } - $scope = $scope->assignVariable($inAssignRightSideVariableName, $variableType); - } - } - $this->processExprNode($use, $useScope, $nodeCallback, $context); - if (!$use->byRef) { - continue; - } - - $useScope = $useScope->exitExpressionAssign($use->var); - } - - if ($expr->returnType !== null) { - $nodeCallback($expr->returnType, $scope); - } - - $closureScope = $scope->enterAnonymousFunction($expr, $callableParameters); - $closureScope = $closureScope->processClosureScope($scope, null, $byRefUses); - - $gatheredReturnStatements = []; - $closureStmtsCallback = static function (\PhpParser\Node $node, Scope $scope) use ($nodeCallback, &$gatheredReturnStatements): void { - $nodeCallback($node, $scope); - if (!$node instanceof Return_) { - return; - } - - $gatheredReturnStatements[] = new ReturnStatement($scope, $node); - }; - if (count($byRefUses) === 0) { - $statementResult = $this->processStmtNodes($expr, $expr->stmts, $closureScope, $closureStmtsCallback); - $nodeCallback(new ClosureReturnStatementsNode( - $expr, - $gatheredReturnStatements, - $statementResult - ), $closureScope); - - return new ExpressionResult($scope, false); - } - - $count = 0; - do { - $prevScope = $closureScope; - - $intermediaryClosureScopeResult = $this->processStmtNodes($expr, $expr->stmts, $closureScope, static function (): void { - }); - $intermediaryClosureScope = $intermediaryClosureScopeResult->getScope(); - foreach ($intermediaryClosureScopeResult->getExitPoints() as $exitPoint) { - $intermediaryClosureScope = $intermediaryClosureScope->mergeWith($exitPoint->getScope()); - } - $closureScope = $scope->enterAnonymousFunction($expr, $callableParameters); - $closureScope = $closureScope->processClosureScope($intermediaryClosureScope, $prevScope, $byRefUses); - if ($closureScope->equals($prevScope)) { - break; - } - $count++; - } while ($count < self::LOOP_SCOPE_ITERATIONS); - - $statementResult = $this->processStmtNodes($expr, $expr->stmts, $closureScope, $closureStmtsCallback); - $nodeCallback(new ClosureReturnStatementsNode( - $expr, - $gatheredReturnStatements, - $statementResult - ), $closureScope); - - return new ExpressionResult($scope->processClosureScope($closureScope, null, $byRefUses), false); - } - - private function lookForArrayDestructuringArray(Scope $scope, Expr $expr, Type $valueType): Scope - { - if ($expr instanceof Array_ || $expr instanceof List_) { - foreach ($expr->items as $key => $item) { - /** @var \PhpParser\Node\Expr\ArrayItem|null $itemValue */ - $itemValue = $item; - if ($itemValue === null) { - continue; - } - - $keyType = $itemValue->key === null ? new ConstantIntegerType($key) : $scope->getType($itemValue->key); - $scope = $this->specifyItemFromArrayDestructuring($scope, $itemValue, $valueType, $keyType); - } - } elseif ($expr instanceof Variable && is_string($expr->name)) { - $scope = $scope->assignVariable($expr->name, new MixedType()); - } elseif ($expr instanceof ArrayDimFetch && $expr->var instanceof Variable && is_string($expr->var->name)) { - $scope = $scope->assignVariable($expr->var->name, new MixedType()); - } - - return $scope; - } - - private function specifyItemFromArrayDestructuring(Scope $scope, ArrayItem $arrayItem, Type $valueType, Type $keyType): Scope - { - $type = $valueType->getOffsetValueType($keyType); - - $itemNode = $arrayItem->value; - if ($itemNode instanceof Variable && is_string($itemNode->name)) { - $scope = $scope->assignVariable($itemNode->name, $type); - } elseif ($itemNode instanceof ArrayDimFetch && $itemNode->var instanceof Variable && is_string($itemNode->var->name)) { - $currentType = $scope->hasVariableType($itemNode->var->name)->no() - ? new ConstantArrayType([], []) - : $scope->getVariableType($itemNode->var->name); - $dimType = null; - if ($itemNode->dim !== null) { - $dimType = $scope->getType($itemNode->dim); - } - $scope = $scope->assignVariable($itemNode->var->name, $currentType->setOffsetValueType($dimType, $type)); - } else { - $scope = $this->lookForArrayDestructuringArray($scope, $itemNode, $type); - } - - return $scope; - } - - /** - * @param \PhpParser\Node\Param $param - * @param \PHPStan\Analyser\Scope $scope - * @param \Closure(\PhpParser\Node $node, Scope $scope): void $nodeCallback - */ - private function processParamNode( - Node\Param $param, - Scope $scope, - \Closure $nodeCallback - ): void - { - if ($param->type !== null) { - $nodeCallback($param->type, $scope); - } - if ($param->default === null) { - return; - } - - $this->processExprNode($param->default, $scope, $nodeCallback, ExpressionContext::createDeep()); - } - - /** - * @param ParametersAcceptor|null $parametersAcceptor - * @param \PhpParser\Node\Arg[] $args - * @param \PHPStan\Analyser\Scope $scope - * @param \Closure(\PhpParser\Node $node, Scope $scope): void $nodeCallback - * @param ExpressionContext $context - * @param \PHPStan\Analyser\Scope|null $closureBindScope - * @return \PHPStan\Analyser\ExpressionResult - */ - private function processArgs( - ?ParametersAcceptor $parametersAcceptor, - array $args, - Scope $scope, - \Closure $nodeCallback, - ExpressionContext $context, - ?Scope $closureBindScope = null - ): ExpressionResult - { - // todo $scope = $scope->enterFunctionCall(); - if ($parametersAcceptor !== null) { - $parameters = $parametersAcceptor->getParameters(); - } - - $hasYield = false; - foreach ($args as $i => $arg) { - $nodeCallback($arg, $scope); - if (isset($parameters) && $parametersAcceptor !== null) { - $assignByReference = false; - if (isset($parameters[$i])) { - $assignByReference = $parameters[$i]->passedByReference()->createsNewVariable(); - $parameterType = $parameters[$i]->getType(); - } elseif (count($parameters) > 0 && $parametersAcceptor->isVariadic()) { - $lastParameter = $parameters[count($parameters) - 1]; - $assignByReference = $lastParameter->passedByReference()->createsNewVariable(); - $parameterType = $lastParameter->getType(); - } - - if ($assignByReference) { - $argValue = $arg->value; - if ($argValue instanceof Variable && is_string($argValue->name)) { - $scope = $scope->assignVariable($argValue->name, new MixedType()); - } - } - } - - $originalScope = $scope; - $scopeToPass = $scope; - if ($i === 0 && $closureBindScope !== null) { - $scopeToPass = $closureBindScope; - } - - if ($arg->value instanceof Expr\Closure) { - $this->callNodeCallbackWithExpression($nodeCallback, $arg->value, $scopeToPass, $context); - $result = $this->processClosureNode($arg->value, $scopeToPass, $nodeCallback, $context, $parameterType ?? null); - } else { - $result = $this->processExprNode($arg->value, $scopeToPass, $nodeCallback, $context->enterDeep()); - } - $scope = $result->getScope(); - $hasYield = $hasYield || $result->hasYield(); - if ($i !== 0 || $closureBindScope === null) { - continue; - } - - $scope = $scope->restoreOriginalScopeAfterClosureBind($originalScope); - } - - // todo $scope = $scope->exitFunctionCall(); - - return new ExpressionResult($scope, $hasYield); - } - - /** - * @param \PHPStan\Analyser\Scope $scope - * @param \PhpParser\Node\Expr $var - * @param \PhpParser\Node\Expr $assignedExpr - * @param \Closure(\PhpParser\Node $node, Scope $scope): void $nodeCallback - * @param ExpressionContext $context - * @param \Closure(Scope $scope): ExpressionResult $processExprCallback - * @param bool $enterExpressionAssign - * @return ExpressionResult - */ - private function processAssignVar( - Scope $scope, - Expr $var, - Expr $assignedExpr, - \Closure $nodeCallback, - ExpressionContext $context, - \Closure $processExprCallback, - bool $enterExpressionAssign - ): ExpressionResult - { - $nodeCallback($var, $enterExpressionAssign ? $scope->enterExpressionAssign($var) : $scope); - $hasYield = false; - if ($var instanceof Variable && is_string($var->name)) { - $result = $processExprCallback($scope); - $hasYield = $result->hasYield(); - $scope = $result->getScope(); - $scope = $scope->assignVariable($var->name, $scope->getType($assignedExpr)); - } elseif ($var instanceof ArrayDimFetch) { - $dimExprStack = []; - while ($var instanceof ArrayDimFetch) { - $dimExprStack[] = $var->dim; - $var = $var->var; - } - - // 1. eval root expr - if ($enterExpressionAssign && $var instanceof Variable) { - $scope = $scope->enterExpressionAssign($var); - } - $result = $this->processExprNode($var, $scope, $nodeCallback, $context->enterDeep()); - $hasYield = $result->hasYield(); - $scope = $result->getScope(); - if ($enterExpressionAssign && $var instanceof Variable) { - $scope = $scope->exitExpressionAssign($var); - } - - // 2. eval dimensions - $offsetTypes = []; - foreach (array_reverse($dimExprStack) as $dimExpr) { - if ($dimExpr === null) { - $offsetTypes[] = null; - - } else { - $offsetTypes[] = $scope->getType($dimExpr); - - if ($enterExpressionAssign) { - $scope->enterExpressionAssign($dimExpr); - } - $result = $this->processExprNode($dimExpr, $scope, $nodeCallback, $context->enterDeep()); - $hasYield = $hasYield || $result->hasYield(); - $scope = $result->getScope(); - - if ($enterExpressionAssign) { - $scope = $scope->exitExpressionAssign($dimExpr); - } - } - } - - $valueToWrite = $scope->getType($assignedExpr); - - // 3. eval assigned expr - $result = $processExprCallback($scope); - $hasYield = $hasYield || $result->hasYield(); - $scope = $result->getScope(); - - // 4. compose types - $varType = $scope->getType($var); - if ($varType instanceof ErrorType) { - $varType = new ConstantArrayType([], []); - } - $offsetValueType = $varType; - $offsetValueTypeStack = [$offsetValueType]; - foreach (array_slice($offsetTypes, 0, -1) as $offsetType) { - if ($offsetType === null) { - $offsetValueType = new ConstantArrayType([], []); - - } else { - $offsetValueType = $offsetValueType->getOffsetValueType($offsetType); - if ($offsetValueType instanceof ErrorType) { - $offsetValueType = new ConstantArrayType([], []); - } - } - - $offsetValueTypeStack[] = $offsetValueType; - } - - foreach (array_reverse($offsetTypes) as $offsetType) { - /** @var Type $offsetValueType */ - $offsetValueType = array_pop($offsetValueTypeStack); - $valueToWrite = $offsetValueType->setOffsetValueType($offsetType, $valueToWrite); - } - - if ($var instanceof Variable && is_string($var->name)) { - $scope = $scope->assignVariable($var->name, $valueToWrite); - } else { - $scope = $scope->specifyExpressionType( - $var, - $valueToWrite - ); - } - } elseif ($var instanceof PropertyFetch) { - $result = $processExprCallback($scope); - $hasYield = $result->hasYield(); - $scope = $result->getScope(); - - $propertyHolderType = $scope->getType($var->var); - $propertyName = null; - if ($var->name instanceof Node\Identifier) { - $propertyName = $var->name->name; - } - if ($propertyName !== null && $propertyHolderType->hasProperty($propertyName)->yes()) { - $propertyReflection = $propertyHolderType->getProperty($propertyName, $scope); - if (!$propertyReflection instanceof ExtendedPropertyReflection || $propertyReflection->canChangeTypeAfterAssignment()) { - $scope = $scope->specifyExpressionType($var, $scope->getType($assignedExpr)); - } - } else { - // fallback - $scope = $scope->specifyExpressionType($var, $scope->getType($assignedExpr)); - } - - } elseif ($var instanceof Expr\StaticPropertyFetch) { - $result = $processExprCallback($scope); - $hasYield = $result->hasYield(); - $scope = $result->getScope(); - - if ($var->class instanceof \PhpParser\Node\Name) { - $propertyHolderType = new ObjectType($scope->resolveName($var->class)); - } else { - $propertyHolderType = $scope->getType($var->class); - } - $propertyName = null; - if ($var->name instanceof Node\Identifier) { - $propertyName = $var->name->name; - } - if ($propertyName !== null && $propertyHolderType->hasProperty($propertyName)->yes()) { - $propertyReflection = $propertyHolderType->getProperty($propertyName, $scope); - if (!$propertyReflection instanceof ExtendedPropertyReflection || $propertyReflection->canChangeTypeAfterAssignment()) { - $scope = $scope->specifyExpressionType($var, $scope->getType($assignedExpr)); - } - } else { - // fallback - $scope = $scope->specifyExpressionType($var, $scope->getType($assignedExpr)); - } - } - - return new ExpressionResult($scope, $hasYield); - } - - private function processStmtVarAnnotation(Scope $scope, Node\Stmt $stmt): Scope - { - if (!$this->allowVarTagAboveStatements) { - return $scope; - } - $comment = CommentHelper::getDocComment($stmt); - if ($comment === null) { - return $scope; - } - - $resolvedPhpDoc = $this->fileTypeMapper->getResolvedPhpDoc( - $scope->getFile(), - $scope->isInClass() ? $scope->getClassReflection()->getName() : null, - $scope->isInTrait() ? $scope->getTraitReflection()->getName() : null, - $comment - ); - foreach ($resolvedPhpDoc->getVarTags() as $name => $varTag) { - if (is_int($name)) { - continue; - } - - $certainty = $scope->hasVariableType($name); - if ($certainty->no()) { - continue; - } - - $scope = $scope->assignVariable($name, $varTag->getType(), $certainty); - } - - return $scope; - } - - private function processVarAnnotation(Scope $scope, string $variableName, string $comment, bool $strict, bool &$changed = false): Scope - { - $resolvedPhpDoc = $this->fileTypeMapper->getResolvedPhpDoc( - $scope->getFile(), - $scope->isInClass() ? $scope->getClassReflection()->getName() : null, - $scope->isInTrait() ? $scope->getTraitReflection()->getName() : null, - $comment - ); - $varTags = $resolvedPhpDoc->getVarTags(); - - if (isset($varTags[$variableName])) { - $variableType = $varTags[$variableName]->getType(); - $changed = true; - return $scope->assignVariable($variableName, $variableType); - - } - - if (!$strict && count($varTags) === 1 && isset($varTags[0])) { - $variableType = $varTags[0]->getType(); - $changed = true; - return $scope->assignVariable($variableName, $variableType); - - } - - return $scope; - } - - private function enterForeach(Scope $scope, Foreach_ $stmt): Scope - { - if ($stmt->keyVar !== null && $stmt->keyVar instanceof Variable && is_string($stmt->keyVar->name)) { - $scope = $scope->assignVariable($stmt->keyVar->name, new MixedType()); - } - - $comment = CommentHelper::getDocComment($stmt); - if ($stmt->valueVar instanceof Variable && is_string($stmt->valueVar->name)) { - $scope = $scope->enterForeach( - $stmt->expr, - $stmt->valueVar->name, - $stmt->keyVar !== null - && $stmt->keyVar instanceof Variable - && is_string($stmt->keyVar->name) - ? $stmt->keyVar->name - : null - ); - if ($comment !== null) { - $scope = $this->processVarAnnotation($scope, $stmt->valueVar->name, $comment, true); - } - } - - if ( - $stmt->keyVar instanceof Variable && is_string($stmt->keyVar->name) - && $comment !== null - ) { - $scope = $this->processVarAnnotation($scope, $stmt->keyVar->name, $comment, true); - } - - if ($stmt->valueVar instanceof List_ || $stmt->valueVar instanceof Array_) { - $exprType = $scope->getType($stmt->expr); - $itemType = $exprType->getIterableValueType(); - $scope = $this->lookForArrayDestructuringArray($scope, $stmt->valueVar, $itemType); - $comment = CommentHelper::getDocComment($stmt); - if ($comment !== null) { - foreach ($stmt->valueVar->items as $arrayItem) { - if ($arrayItem === null) { - continue; - } - if (!$arrayItem->value instanceof Variable || !is_string($arrayItem->value->name)) { - continue; - } - - $scope = $this->processVarAnnotation($scope, $arrayItem->value->name, $comment, true); - } - } - } - - return $scope; - } - - private function processTraitUse(Node\Stmt\TraitUse $node, Scope $classScope, \Closure $nodeCallback): void - { - foreach ($node->traits as $trait) { - $traitName = (string) $trait; - if (!$this->broker->hasClass($traitName)) { - continue; - } - $traitReflection = $this->broker->getClass($traitName); - $traitFileName = $traitReflection->getFileName(); - if ($traitFileName === false) { - continue; // trait from eval or from PHP itself - } - $fileName = $this->fileHelper->normalizePath($traitFileName); - if (!isset($this->analysedFiles[$fileName])) { - continue; - } - $parserNodes = $this->parser->parseFile($fileName); - $this->processNodesForTraitUse($parserNodes, $traitReflection, $classScope, $nodeCallback); - } - } - - /** - * @param \PhpParser\Node[]|\PhpParser\Node|scalar $node - * @param ClassReflection $traitReflection - * @param \PHPStan\Analyser\Scope $scope - * @param \Closure(\PhpParser\Node $node): void $nodeCallback - */ - private function processNodesForTraitUse($node, ClassReflection $traitReflection, Scope $scope, \Closure $nodeCallback): void - { - if ($node instanceof Node) { - if ($node instanceof Node\Stmt\Trait_ && $traitReflection->getName() === (string) $node->namespacedName) { - $this->processStmtNodes($node, $node->stmts, $scope->enterTrait($traitReflection), $nodeCallback); - return; - } - if ($node instanceof Node\Stmt\ClassLike) { - return; - } - if ($node instanceof Node\FunctionLike) { - return; - } - foreach ($node->getSubNodeNames() as $subNodeName) { - $subNode = $node->{$subNodeName}; - $this->processNodesForTraitUse($subNode, $traitReflection, $scope, $nodeCallback); - } - } elseif (is_array($node)) { - foreach ($node as $subNode) { - $this->processNodesForTraitUse($subNode, $traitReflection, $scope, $nodeCallback); - } - } - } - - /** - * @param Scope $scope - * @param Node\FunctionLike $functionLike - * @return array{Type[], ?Type, ?Type, ?string, bool, bool, bool} - */ - public function getPhpDocs(Scope $scope, Node\FunctionLike $functionLike): array - { - $phpDocParameterTypes = []; - $phpDocReturnType = null; - $phpDocThrowType = null; - $deprecatedDescription = null; - $isDeprecated = false; - $isInternal = false; - $isFinal = false; - $docComment = $functionLike->getDocComment() !== null - ? $functionLike->getDocComment()->getText() - : null; - - $file = $scope->getFile(); - $class = $scope->isInClass() ? $scope->getClassReflection()->getName() : null; - $trait = $scope->isInTrait() ? $scope->getTraitReflection()->getName() : null; - $isExplicitPhpDoc = true; - if ($functionLike instanceof Node\Stmt\ClassMethod) { - if (!$scope->isInClass()) { - throw new \PHPStan\ShouldNotHappenException(); - } - $phpDocBlock = PhpDocBlock::resolvePhpDocBlockForMethod( - $this->broker, - $docComment, - $scope->getClassReflection()->getName(), - $trait, - $functionLike->name->name, - $file - ); - - if ($phpDocBlock !== null) { - $docComment = $phpDocBlock->getDocComment(); - $file = $phpDocBlock->getFile(); - $class = $phpDocBlock->getClass(); - $trait = $phpDocBlock->getTrait(); - $isExplicitPhpDoc = $phpDocBlock->isExplicit(); - } - } - - if ($docComment !== null) { - $resolvedPhpDoc = $this->fileTypeMapper->getResolvedPhpDoc( - $file, - $class, - $trait, - $docComment - ); - $phpDocParameterTypes = array_map(static function (ParamTag $tag): Type { - return $tag->getType(); - }, $resolvedPhpDoc->getParamTags()); - $nativeReturnType = $scope->getFunctionType($functionLike->getReturnType(), false, false); - $phpDocReturnType = null; - if ( - $resolvedPhpDoc->getReturnTag() !== null - && ( - $isExplicitPhpDoc - || $nativeReturnType->isSuperTypeOf($resolvedPhpDoc->getReturnTag()->getType())->yes() - ) - ) { - $phpDocReturnType = $resolvedPhpDoc->getReturnTag()->getType(); - } - $phpDocThrowType = $resolvedPhpDoc->getThrowsTag() !== null ? $resolvedPhpDoc->getThrowsTag()->getType() : null; - $deprecatedDescription = $resolvedPhpDoc->getDeprecatedTag() !== null ? $resolvedPhpDoc->getDeprecatedTag()->getMessage() : null; - $isDeprecated = $resolvedPhpDoc->isDeprecated(); - $isInternal = $resolvedPhpDoc->isInternal(); - $isFinal = $resolvedPhpDoc->isFinal(); - } - - return [$phpDocParameterTypes, $phpDocReturnType, $phpDocThrowType, $deprecatedDescription, $isDeprecated, $isInternal, $isFinal]; - } - -} diff --git a/vendor/phpstan/phpstan/src/Analyser/OutOfClassScope.php b/vendor/phpstan/phpstan/src/Analyser/OutOfClassScope.php deleted file mode 100644 index 538c9ba..0000000 --- a/vendor/phpstan/phpstan/src/Analyser/OutOfClassScope.php +++ /dev/null @@ -1,39 +0,0 @@ -isPublic(); - } - - public function canCallMethod(MethodReflection $methodReflection): bool - { - return $methodReflection->isPublic(); - } - - public function canAccessConstant(ConstantReflection $constantReflection): bool - { - return $constantReflection->isPublic(); - } - -} diff --git a/vendor/phpstan/phpstan/src/Analyser/Scope.php b/vendor/phpstan/phpstan/src/Analyser/Scope.php deleted file mode 100644 index a64f462..0000000 --- a/vendor/phpstan/phpstan/src/Analyser/Scope.php +++ /dev/null @@ -1,3210 +0,0 @@ - '+', - Node\Expr\AssignOp\Minus::class => '-', - Node\Expr\AssignOp\Mul::class => '*', - Node\Expr\AssignOp\Pow::class => '^', - Node\Expr\AssignOp\Div::class => '/', - ]; - - /** @var \PHPStan\Analyser\ScopeFactory */ - private $scopeFactory; - - /** @var \PHPStan\Broker\Broker */ - private $broker; - - /** @var \PhpParser\PrettyPrinter\Standard */ - private $printer; - - /** @var \PHPStan\Analyser\TypeSpecifier */ - private $typeSpecifier; - - /** @var \PHPStan\Rules\Properties\PropertyReflectionFinder */ - private $propertyReflectionFinder; - - /** @var \PHPStan\Analyser\ScopeContext */ - private $context; - - /** @var \PHPStan\Type\Type[] */ - private $resolvedTypes = []; - - /** @var bool */ - private $declareStrictTypes; - - /** @var \PHPStan\Reflection\FunctionReflection|MethodReflection|null */ - private $function; - - /** @var string|null */ - private $namespace; - - /** @var \PHPStan\Analyser\VariableTypeHolder[] */ - private $variableTypes; - - /** @var \PHPStan\Analyser\VariableTypeHolder[] */ - private $moreSpecificTypes; - - /** @var string|null */ - private $inClosureBindScopeClass; - - /** @var \PHPStan\Type\Type|null */ - private $inAnonymousFunctionReturnType; - - /** @var \PhpParser\Node\Expr\FuncCall|\PhpParser\Node\Expr\MethodCall|\PhpParser\Node\Expr\StaticCall|null */ - private $inFunctionCall; - - /** @var bool */ - private $negated; - - /** @var bool */ - private $inFirstLevelStatement; - - /** @var array */ - private $currentlyAssignedExpressions = []; - - /** @var string[] */ - private $dynamicConstantNames; - - /** - * @param \PHPStan\Analyser\ScopeFactory $scopeFactory - * @param \PHPStan\Broker\Broker $broker - * @param \PhpParser\PrettyPrinter\Standard $printer - * @param \PHPStan\Analyser\TypeSpecifier $typeSpecifier - * @param \PHPStan\Rules\Properties\PropertyReflectionFinder $propertyReflectionFinder - * @param \PHPStan\Analyser\ScopeContext $context - * @param bool $declareStrictTypes - * @param \PHPStan\Reflection\FunctionReflection|MethodReflection|null $function - * @param string|null $namespace - * @param \PHPStan\Analyser\VariableTypeHolder[] $variablesTypes - * @param \PHPStan\Analyser\VariableTypeHolder[] $moreSpecificTypes - * @param string|null $inClosureBindScopeClass - * @param \PHPStan\Type\Type|null $inAnonymousFunctionReturnType - * @param \PhpParser\Node\Expr\FuncCall|\PhpParser\Node\Expr\MethodCall|\PhpParser\Node\Expr\StaticCall|null $inFunctionCall - * @param bool $negated - * @param bool $inFirstLevelStatement - * @param array $currentlyAssignedExpressions - * @param string[] $dynamicConstantNames - */ - public function __construct( - ScopeFactory $scopeFactory, - Broker $broker, - \PhpParser\PrettyPrinter\Standard $printer, - TypeSpecifier $typeSpecifier, - PropertyReflectionFinder $propertyReflectionFinder, - ScopeContext $context, - bool $declareStrictTypes = false, - $function = null, - ?string $namespace = null, - array $variablesTypes = [], - array $moreSpecificTypes = [], - ?string $inClosureBindScopeClass = null, - ?Type $inAnonymousFunctionReturnType = null, - ?Expr $inFunctionCall = null, - bool $negated = false, - bool $inFirstLevelStatement = true, - array $currentlyAssignedExpressions = [], - array $dynamicConstantNames = [] - ) - { - if ($namespace === '') { - $namespace = null; - } - - $this->scopeFactory = $scopeFactory; - $this->broker = $broker; - $this->printer = $printer; - $this->typeSpecifier = $typeSpecifier; - $this->propertyReflectionFinder = $propertyReflectionFinder; - $this->context = $context; - $this->declareStrictTypes = $declareStrictTypes; - $this->function = $function; - $this->namespace = $namespace; - $this->variableTypes = $variablesTypes; - $this->moreSpecificTypes = $moreSpecificTypes; - $this->inClosureBindScopeClass = $inClosureBindScopeClass; - $this->inAnonymousFunctionReturnType = $inAnonymousFunctionReturnType; - $this->inFunctionCall = $inFunctionCall; - $this->negated = $negated; - $this->inFirstLevelStatement = $inFirstLevelStatement; - $this->currentlyAssignedExpressions = $currentlyAssignedExpressions; - $this->dynamicConstantNames = $dynamicConstantNames; - } - - public function getFile(): string - { - return $this->context->getFile(); - } - - public function getFileDescription(): string - { - if ($this->context->getTraitReflection() === null) { - return $this->getFile(); - } - - /** @var ClassReflection $classReflection */ - $classReflection = $this->context->getClassReflection(); - - $className = sprintf('class %s', $classReflection->getDisplayName()); - if ($classReflection->isAnonymous()) { - $className = 'anonymous class'; - } - - $traitReflection = $this->context->getTraitReflection(); - if ($traitReflection->getFileName() === false) { - throw new \PHPStan\ShouldNotHappenException(); - } - - return sprintf( - '%s (in context of %s)', - $traitReflection->getFileName(), - $className - ); - } - - public function isDeclareStrictTypes(): bool - { - return $this->declareStrictTypes; - } - - public function enterDeclareStrictTypes(): self - { - return $this->scopeFactory->create( - $this->context, - true - ); - } - - public function isInClass(): bool - { - return $this->context->getClassReflection() !== null; - } - - public function isInTrait(): bool - { - return $this->context->getTraitReflection() !== null; - } - - public function getClassReflection(): ?ClassReflection - { - return $this->context->getClassReflection(); - } - - public function getTraitReflection(): ?ClassReflection - { - return $this->context->getTraitReflection(); - } - - /** - * @return \PHPStan\Reflection\FunctionReflection|\PHPStan\Reflection\MethodReflection|null - */ - public function getFunction() - { - return $this->function; - } - - public function getFunctionName(): ?string - { - return $this->function !== null ? $this->function->getName() : null; - } - - public function getNamespace(): ?string - { - return $this->namespace; - } - - /** - * @return array - */ - private function getVariableTypes(): array - { - return $this->variableTypes; - } - - public function hasVariableType(string $variableName): TrinaryLogic - { - if ($this->isGlobalVariable($variableName)) { - return TrinaryLogic::createYes(); - } - - if (!isset($this->variableTypes[$variableName])) { - return TrinaryLogic::createNo(); - } - - return $this->variableTypes[$variableName]->getCertainty(); - } - - public function getVariableType(string $variableName): Type - { - if ($this->isGlobalVariable($variableName)) { - return new ArrayType(new StringType(), new MixedType()); - } - - if ($this->hasVariableType($variableName)->no()) { - throw new \PHPStan\Analyser\UndefinedVariableException($this, $variableName); - } - - return $this->variableTypes[$variableName]->getType(); - } - - private function isGlobalVariable(string $variableName): bool - { - return in_array($variableName, [ - 'GLOBALS', - '_SERVER', - '_GET', - '_POST', - '_FILES', - '_COOKIE', - '_SESSION', - '_REQUEST', - '_ENV', - ], true); - } - - public function hasConstant(Name $name): bool - { - $node = new ConstFetch(new Name\FullyQualified($name->toString())); - if ($this->isSpecified($node)) { - return true; - } - return $this->broker->hasConstant($name, $this); - } - - public function isInAnonymousFunction(): bool - { - return $this->inAnonymousFunctionReturnType !== null; - } - - public function getAnonymousFunctionReturnType(): ?\PHPStan\Type\Type - { - return $this->inAnonymousFunctionReturnType; - } - - /** - * @return \PhpParser\Node\Expr\FuncCall|\PhpParser\Node\Expr\MethodCall|\PhpParser\Node\Expr\StaticCall|null - */ - public function getInFunctionCall() - { - return $this->inFunctionCall; - } - - public function getType(Expr $node): Type - { - $key = $this->printer->prettyPrintExpr($node); - if (!array_key_exists($key, $this->resolvedTypes)) { - $this->resolvedTypes[$key] = $this->resolveType($node); - } - return $this->resolvedTypes[$key]; - } - - private function resolveType(Expr $node): Type - { - if ($node instanceof Expr\Exit_) { - return new NeverType(); - } - - if ( - $node instanceof Expr\BinaryOp\Greater - || $node instanceof Expr\BinaryOp\GreaterOrEqual - || $node instanceof Expr\BinaryOp\Smaller - || $node instanceof Expr\BinaryOp\SmallerOrEqual - || $node instanceof Expr\BinaryOp\Equal - || $node instanceof Expr\BinaryOp\NotEqual - || $node instanceof Expr\Empty_ - ) { - return new BooleanType(); - } - - if ($node instanceof Expr\Isset_) { - $result = new ConstantBooleanType(true); - foreach ($node->vars as $var) { - if ($var instanceof Expr\ArrayDimFetch && $var->dim !== null) { - $hasOffset = $this->getType($var->var)->hasOffsetValueType( - $this->getType($var->dim) - )->toBooleanType(); - if ($hasOffset instanceof ConstantBooleanType) { - if (!$hasOffset->getValue()) { - return $hasOffset; - } - - continue; - } - - $result = $hasOffset; - continue; - } - - if ($var instanceof Expr\Variable && is_string($var->name)) { - $variableType = $this->resolveType($var); - $isNullSuperType = (new NullType())->isSuperTypeOf($variableType); - $has = $this->hasVariableType($var->name); - if ($has->no() || $isNullSuperType->yes()) { - return new ConstantBooleanType(false); - } - - if ($has->maybe() || !$isNullSuperType->no()) { - $result = new BooleanType(); - } - continue; - } - - return new BooleanType(); - } - - return $result; - } - - if ($node instanceof \PhpParser\Node\Expr\BooleanNot) { - $exprBooleanType = $this->getType($node->expr)->toBoolean(); - if ($exprBooleanType instanceof ConstantBooleanType) { - return new ConstantBooleanType(!$exprBooleanType->getValue()); - } - - return new BooleanType(); - } - - if ( - $node instanceof \PhpParser\Node\Expr\BinaryOp\BooleanAnd - || $node instanceof \PhpParser\Node\Expr\BinaryOp\LogicalAnd - ) { - $leftBooleanType = $this->getType($node->left)->toBoolean(); - if ( - $leftBooleanType instanceof ConstantBooleanType - && !$leftBooleanType->getValue() - ) { - return new ConstantBooleanType(false); - } - - $rightBooleanType = $this->filterByTruthyValue($node->left)->getType($node->right)->toBoolean(); - if ( - $rightBooleanType instanceof ConstantBooleanType - && !$rightBooleanType->getValue() - ) { - return new ConstantBooleanType(false); - } - - if ( - $leftBooleanType instanceof ConstantBooleanType - && $leftBooleanType->getValue() - && $rightBooleanType instanceof ConstantBooleanType - && $rightBooleanType->getValue() - ) { - return new ConstantBooleanType(true); - } - - return new BooleanType(); - } - - if ( - $node instanceof \PhpParser\Node\Expr\BinaryOp\BooleanOr - || $node instanceof \PhpParser\Node\Expr\BinaryOp\LogicalOr - ) { - $leftBooleanType = $this->getType($node->left)->toBoolean(); - if ( - $leftBooleanType instanceof ConstantBooleanType - && $leftBooleanType->getValue() - ) { - return new ConstantBooleanType(true); - } - - $rightBooleanType = $this->filterByFalseyValue($node->left)->getType($node->right)->toBoolean(); - if ( - $rightBooleanType instanceof ConstantBooleanType - && $rightBooleanType->getValue() - ) { - return new ConstantBooleanType(true); - } - - if ( - $leftBooleanType instanceof ConstantBooleanType - && !$leftBooleanType->getValue() - && $rightBooleanType instanceof ConstantBooleanType - && !$rightBooleanType->getValue() - ) { - return new ConstantBooleanType(false); - } - - return new BooleanType(); - } - - if ($node instanceof \PhpParser\Node\Expr\BinaryOp\LogicalXor) { - $leftBooleanType = $this->getType($node->left)->toBoolean(); - $rightBooleanType = $this->filterByFalseyValue($node->left)->getType($node->right)->toBoolean(); - if ( - $leftBooleanType instanceof ConstantBooleanType - && $rightBooleanType instanceof ConstantBooleanType - ) { - return new ConstantBooleanType( - $leftBooleanType->getValue() xor $rightBooleanType->getValue() - ); - } - - return new BooleanType(); - } - - if ($node instanceof Expr\BinaryOp\Identical) { - $leftType = $this->getType($node->left); - $rightType = $this->getType($node->right); - - if ( - ( - $node->left instanceof Node\Expr\PropertyFetch - || $node->left instanceof Node\Expr\StaticPropertyFetch - ) - && $rightType instanceof NullType - && !$this->hasPropertyNativeType($node->left) - ) { - return new BooleanType(); - } - - if ( - ( - $node->right instanceof Node\Expr\PropertyFetch - || $node->right instanceof Node\Expr\StaticPropertyFetch - ) - && $leftType instanceof NullType - && !$this->hasPropertyNativeType($node->right) - ) { - return new BooleanType(); - } - - $isSuperset = $leftType->isSuperTypeOf($rightType); - if ($isSuperset->no()) { - return new ConstantBooleanType(false); - } elseif ( - $isSuperset->yes() - && $leftType instanceof ConstantScalarType - && $rightType instanceof ConstantScalarType - && $leftType->getValue() === $rightType->getValue() - ) { - return new ConstantBooleanType(true); - } - - return new BooleanType(); - } - - if ($node instanceof Expr\BinaryOp\NotIdentical) { - $leftType = $this->getType($node->left); - $rightType = $this->getType($node->right); - - if ( - ( - $node->left instanceof Node\Expr\PropertyFetch - || $node->left instanceof Node\Expr\StaticPropertyFetch - ) - && $rightType instanceof NullType - && !$this->hasPropertyNativeType($node->left) - ) { - return new BooleanType(); - } - - if ( - ( - $node->right instanceof Node\Expr\PropertyFetch - || $node->right instanceof Node\Expr\StaticPropertyFetch - ) - && $leftType instanceof NullType - && !$this->hasPropertyNativeType($node->right) - ) { - return new BooleanType(); - } - - $isSuperset = $leftType->isSuperTypeOf($rightType); - if ($isSuperset->no()) { - return new ConstantBooleanType(true); - } elseif ( - $isSuperset->yes() - && $leftType instanceof ConstantScalarType - && $rightType instanceof ConstantScalarType - && $leftType->getValue() === $rightType->getValue() - ) { - return new ConstantBooleanType(false); - } - - return new BooleanType(); - } - - if ($node instanceof Expr\Instanceof_) { - if ($node->class instanceof Node\Name) { - $className = $this->resolveName($node->class); - $type = new ObjectType($className); - } else { - $type = $this->getType($node->class); - } - - $expressionType = $this->getType($node->expr); - if ( - $this->isInTrait() - && TypeUtils::findThisType($expressionType) !== null - ) { - return new BooleanType(); - } - if ($expressionType instanceof NeverType) { - return new ConstantBooleanType(false); - } - $isExpressionObject = (new ObjectWithoutClassType())->isSuperTypeOf($expressionType); - if (!$isExpressionObject->no() && !(new StringType())->isSuperTypeOf($type)->no()) { - return new BooleanType(); - } - - $isSuperType = $type->isSuperTypeOf($expressionType) - ->and($isExpressionObject); - if ($isSuperType->no()) { - return new ConstantBooleanType(false); - } elseif ($isSuperType->yes()) { - return new ConstantBooleanType(true); - } - - return new BooleanType(); - } - - if ($node instanceof Node\Expr\UnaryPlus) { - return $this->getType($node->expr)->toNumber(); - } - - if ($node instanceof Expr\ErrorSuppress - || $node instanceof Expr\Assign - ) { - return $this->getType($node->expr); - } - - if ($node instanceof Node\Expr\UnaryMinus) { - $type = $this->getType($node->expr)->toNumber(); - $scalarValues = TypeUtils::getConstantScalars($type); - if (count($scalarValues) > 0) { - $newTypes = []; - foreach ($scalarValues as $scalarValue) { - if ($scalarValue instanceof ConstantIntegerType) { - $newTypes[] = new ConstantIntegerType(-$scalarValue->getValue()); - } elseif ($scalarValue instanceof ConstantFloatType) { - $newTypes[] = new ConstantFloatType(-$scalarValue->getValue()); - } - } - - return TypeCombinator::union(...$newTypes); - } - - return $type; - } - - if ($node instanceof Expr\BinaryOp\Concat || $node instanceof Expr\AssignOp\Concat) { - if ($node instanceof Node\Expr\AssignOp) { - $left = $node->var; - $right = $node->expr; - } else { - $left = $node->left; - $right = $node->right; - } - - $leftStringType = $this->getType($left)->toString(); - $rightStringType = $this->getType($right)->toString(); - if (TypeCombinator::union( - $leftStringType, - $rightStringType - ) instanceof ErrorType) { - return new ErrorType(); - } - - if ($leftStringType instanceof ConstantStringType && $rightStringType instanceof ConstantStringType) { - return $leftStringType->append($rightStringType); - } - - return new StringType(); - } - - if ( - $node instanceof Node\Expr\BinaryOp\Div - || $node instanceof Node\Expr\AssignOp\Div - || $node instanceof Node\Expr\BinaryOp\Mod - || $node instanceof Node\Expr\AssignOp\Mod - ) { - if ($node instanceof Node\Expr\AssignOp) { - $right = $node->expr; - } else { - $right = $node->right; - } - - $rightTypes = TypeUtils::getConstantScalars($this->getType($right)->toNumber()); - foreach ($rightTypes as $rightType) { - if ( - $rightType->getValue() === 0 - || $rightType->getValue() === 0.0 - ) { - return new ErrorType(); - } - } - } - - if ( - ( - $node instanceof Node\Expr\BinaryOp - || $node instanceof Node\Expr\AssignOp - ) && !$node instanceof Expr\BinaryOp\Coalesce && !$node instanceof Expr\AssignOp\Coalesce - ) { - if ($node instanceof Node\Expr\AssignOp) { - $left = $node->var; - $right = $node->expr; - } else { - $left = $node->left; - $right = $node->right; - } - - $leftTypes = TypeUtils::getConstantScalars($this->getType($left)); - $rightTypes = TypeUtils::getConstantScalars($this->getType($right)); - - if (count($leftTypes) > 0 && count($rightTypes) > 0) { - $resultTypes = []; - foreach ($leftTypes as $leftType) { - foreach ($rightTypes as $rightType) { - $resultTypes[] = $this->calculateFromScalars($node, $leftType, $rightType); - } - } - return TypeCombinator::union(...$resultTypes); - } - } - - if ($node instanceof Node\Expr\BinaryOp\Mod || $node instanceof Expr\AssignOp\Mod) { - return new IntegerType(); - } - - if ($node instanceof Expr\BinaryOp\Spaceship) { - return new IntegerType(); - } - - if ($node instanceof Expr\AssignOp\Coalesce) { - return $this->getType(new BinaryOp\Coalesce($node->var, $node->expr, $node->getAttributes())); - } - - if ($node instanceof Expr\BinaryOp\Coalesce) { - if ($node->left instanceof Expr\ArrayDimFetch && $node->left->dim !== null) { - $dimType = $this->getType($node->left->dim); - $varType = $this->getType($node->left->var); - $hasOffset = $varType->hasOffsetValueType($dimType); - $leftType = $this->getType($node->left); - $rightType = $this->getType($node->right); - if ($hasOffset->no()) { - return $rightType; - } elseif ($hasOffset->yes()) { - $offsetValueType = $varType->getOffsetValueType($dimType); - if ($offsetValueType->isSuperTypeOf(new NullType())->no()) { - return TypeCombinator::removeNull($leftType); - } - } - - return TypeCombinator::union( - TypeCombinator::removeNull($leftType), - $rightType - ); - } - - $leftType = $this->getType($node->left); - $rightType = $this->getType($node->right); - if ($leftType instanceof ErrorType || $leftType instanceof NullType) { - return $rightType; - } - - if ( - TypeCombinator::containsNull($leftType) - || $node->left instanceof PropertyFetch - || ( - $node->left instanceof Variable - && is_string($node->left->name) - && !$this->hasVariableType($node->left->name)->yes() - ) - ) { - return TypeCombinator::union( - TypeCombinator::removeNull($leftType), - $rightType - ); - } - - return TypeCombinator::removeNull($leftType); - } - - if ($node instanceof Expr\Clone_) { - return $this->getType($node->expr); - } - - if ( - $node instanceof Expr\AssignOp\ShiftLeft - || $node instanceof Expr\BinaryOp\ShiftLeft - || $node instanceof Expr\AssignOp\ShiftRight - || $node instanceof Expr\BinaryOp\ShiftRight - ) { - if ($node instanceof Node\Expr\AssignOp) { - $left = $node->var; - $right = $node->expr; - } else { - $left = $node->left; - $right = $node->right; - } - - if (TypeCombinator::union( - $this->getType($left)->toNumber(), - $this->getType($right)->toNumber() - ) instanceof ErrorType) { - return new ErrorType(); - } - - return new IntegerType(); - } - - if ( - $node instanceof Expr\AssignOp\BitwiseAnd - || $node instanceof Expr\BinaryOp\BitwiseAnd - || $node instanceof Expr\AssignOp\BitwiseOr - || $node instanceof Expr\BinaryOp\BitwiseOr - || $node instanceof Expr\AssignOp\BitwiseXor - || $node instanceof Expr\BinaryOp\BitwiseXor - ) { - if ($node instanceof Node\Expr\AssignOp) { - $left = $node->var; - $right = $node->expr; - } else { - $left = $node->left; - $right = $node->right; - } - - $leftType = $this->getType($left); - $rightType = $this->getType($right); - $stringType = new StringType(); - - if ($stringType->isSuperTypeOf($leftType)->yes() && $stringType->isSuperTypeOf($rightType)->yes()) { - return $stringType; - } - - if (TypeCombinator::union($leftType->toNumber(), $rightType->toNumber()) instanceof ErrorType) { - return new ErrorType(); - } - - return new IntegerType(); - } - - if ( - $node instanceof Node\Expr\BinaryOp\Plus - || $node instanceof Node\Expr\BinaryOp\Minus - || $node instanceof Node\Expr\BinaryOp\Mul - || $node instanceof Node\Expr\BinaryOp\Pow - || $node instanceof Node\Expr\BinaryOp\Div - || $node instanceof Node\Expr\AssignOp\Plus - || $node instanceof Node\Expr\AssignOp\Minus - || $node instanceof Node\Expr\AssignOp\Mul - || $node instanceof Node\Expr\AssignOp\Pow - || $node instanceof Node\Expr\AssignOp\Div - ) { - if ($node instanceof Node\Expr\AssignOp) { - $left = $node->var; - $right = $node->expr; - } else { - $left = $node->left; - $right = $node->right; - } - - $leftType = $this->getType($left); - $rightType = $this->getType($right); - - $operatorSigil = null; - - if ($node instanceof BinaryOp) { - $operatorSigil = $node->getOperatorSigil(); - } - - if ($operatorSigil === null) { - $operatorSigil = self::OPERATOR_SIGIL_MAP[get_class($node)] ?? null; - } - - if ($operatorSigil !== null) { - $operatorTypeSpecifyingExtensions = $this->broker->getOperatorTypeSpecifyingExtensions($operatorSigil, $leftType, $rightType); - - /** @var Type[] $extensionTypes */ - $extensionTypes = []; - - foreach ($operatorTypeSpecifyingExtensions as $extension) { - $extensionTypes[] = $extension->specifyType($operatorSigil, $leftType, $rightType); - } - - if (count($extensionTypes) > 0) { - return TypeCombinator::union(...$extensionTypes); - } - } - - if ($node instanceof Expr\AssignOp\Plus || $node instanceof Expr\BinaryOp\Plus) { - $leftConstantArrays = TypeUtils::getConstantArrays($leftType); - $rightConstantArrays = TypeUtils::getConstantArrays($rightType); - - if (count($leftConstantArrays) > 0 && count($rightConstantArrays) > 0) { - $resultTypes = []; - foreach ($rightConstantArrays as $rightConstantArray) { - foreach ($leftConstantArrays as $leftConstantArray) { - $newArrayBuilder = ConstantArrayTypeBuilder::createFromConstantArray($rightConstantArray); - foreach ($leftConstantArray->getKeyTypes() as $leftKeyType) { - $newArrayBuilder->setOffsetValueType( - $leftKeyType, - $leftConstantArray->getOffsetValueType($leftKeyType) - ); - } - $resultTypes[] = $newArrayBuilder->getArray(); - } - } - - return TypeCombinator::union(...$resultTypes); - } - $arrayType = new ArrayType(new MixedType(), new MixedType()); - - if ($arrayType->isSuperTypeOf($leftType)->yes() && $arrayType->isSuperTypeOf($rightType)->yes()) { - if ($leftType->getIterableKeyType()->equals($rightType->getIterableKeyType())) { - // to preserve BenevolentUnionType - $keyType = $leftType->getIterableKeyType(); - } else { - $keyTypes = []; - foreach ([ - $leftType->getIterableKeyType(), - $rightType->getIterableKeyType(), - ] as $keyType) { - $keyTypes[] = $keyType; - } - $keyType = TypeCombinator::union(...$keyTypes); - } - return new ArrayType( - $keyType, - TypeCombinator::union($leftType->getIterableValueType(), $rightType->getIterableValueType()) - ); - } - - if ($leftType instanceof MixedType && $rightType instanceof MixedType) { - return new BenevolentUnionType([ - new FloatType(), - new IntegerType(), - new ArrayType(new MixedType(), new MixedType()), - ]); - } - } - - $types = TypeCombinator::union($leftType, $rightType); - if ( - $leftType instanceof ArrayType - || $rightType instanceof ArrayType - || $types instanceof ArrayType - ) { - return new ErrorType(); - } - - $leftNumberType = $leftType->toNumber(); - $rightNumberType = $rightType->toNumber(); - - if ( - (new FloatType())->isSuperTypeOf($leftNumberType)->yes() - || (new FloatType())->isSuperTypeOf($rightNumberType)->yes() - ) { - return new FloatType(); - } - - if ($node instanceof Expr\AssignOp\Pow || $node instanceof Expr\BinaryOp\Pow) { - return new BenevolentUnionType([ - new FloatType(), - new IntegerType(), - ]); - } - - $resultType = TypeCombinator::union($leftNumberType, $rightNumberType); - if ($node instanceof Expr\AssignOp\Div || $node instanceof Expr\BinaryOp\Div) { - if ($types instanceof MixedType || $resultType instanceof IntegerType) { - return new BenevolentUnionType([new IntegerType(), new FloatType()]); - } - - return new UnionType([new IntegerType(), new FloatType()]); - } - - if ($types instanceof MixedType) { - return TypeUtils::toBenevolentUnion($resultType); - } - - return $resultType; - } - - if ($node instanceof LNumber) { - return new ConstantIntegerType($node->value); - } elseif ($node instanceof String_) { - return new ConstantStringType($node->value); - } elseif ($node instanceof Node\Scalar\Encapsed) { - $constantString = new ConstantStringType(''); - foreach ($node->parts as $part) { - if ($part instanceof EncapsedStringPart) { - $partStringType = new ConstantStringType($part->value); - } else { - $partStringType = $this->getType($part)->toString(); - if ($partStringType instanceof ErrorType) { - return new ErrorType(); - } - if (!$partStringType instanceof ConstantStringType) { - return new StringType(); - } - } - - $constantString = $constantString->append($partStringType); - } - return $constantString; - } elseif ($node instanceof DNumber) { - return new ConstantFloatType($node->value); - } elseif ($node instanceof Expr\Closure || $node instanceof Expr\ArrowFunction) { - $parameters = []; - $isVariadic = false; - $firstOptionalParameterIndex = null; - foreach ($node->params as $i => $param) { - $isOptionalCandidate = $param->default !== null || $param->variadic; - - if ($isOptionalCandidate) { - if ($firstOptionalParameterIndex === null) { - $firstOptionalParameterIndex = $i; - } - } else { - $firstOptionalParameterIndex = null; - } - } - - foreach ($node->params as $i => $param) { - if ($param->variadic) { - $isVariadic = true; - } - if (!$param->var instanceof Variable || !is_string($param->var->name)) { - throw new \PHPStan\ShouldNotHappenException(); - } - $parameters[] = new NativeParameterReflection( - $param->var->name, - $firstOptionalParameterIndex !== null && $i >= $firstOptionalParameterIndex, - $this->getFunctionType($param->type, $param->type === null, false), - $param->byRef - ? PassedByReference::createCreatesNewVariable() - : PassedByReference::createNo(), - $param->variadic - ); - } - - return new ClosureType( - $parameters, - $this->getFunctionType($node->returnType, $node->returnType === null, false), - $isVariadic - ); - } elseif ($node instanceof New_) { - if ($node->class instanceof Name) { - $className = $node->class->toString(); - $lowercasedClassName = strtolower($className); - $resolvedClassName = $this->resolveName($node->class); - if ($this->broker->hasClass($resolvedClassName)) { - $classReflection = $this->broker->getClass($resolvedClassName); - if ($classReflection->hasConstructor()) { - $constructorMethod = $classReflection->getConstructor(); - } else { - $constructorMethod = new DummyConstructorReflection($classReflection); - } - - $resolvedTypes = []; - $methodCall = new Expr\StaticCall( - $node->class, - new Node\Identifier($constructorMethod->getName()), - $node->args - ); - foreach ($this->broker->getDynamicStaticMethodReturnTypeExtensionsForClass($classReflection->getName()) as $dynamicStaticMethodReturnTypeExtension) { - if (!$dynamicStaticMethodReturnTypeExtension->isStaticMethodSupported($constructorMethod)) { - continue; - } - - $resolvedTypes[] = $dynamicStaticMethodReturnTypeExtension->getTypeFromStaticMethodCall($constructorMethod, $methodCall, $this); - } - - if (count($resolvedTypes) > 0) { - return TypeCombinator::union(...$resolvedTypes); - } - } - if (in_array($lowercasedClassName, [ - 'static', - 'parent', - ], true)) { - if (!$this->isInClass()) { - throw new \PHPStan\ShouldNotHappenException(); - } - if ($lowercasedClassName === 'static') { - return new StaticType($this->getClassReflection()->getName()); - } - - if ($this->getClassReflection()->getParentClass() !== false) { - return new ObjectType($this->getClassReflection()->getParentClass()->getName()); - } - - return new NonexistentParentClassType(); - } - - return new ObjectType($resolvedClassName); - } - if ($node->class instanceof Node\Stmt\Class_) { - $anonymousClassReflection = $this->broker->getAnonymousClassReflection($node->class, $this); - - return new ObjectType($anonymousClassReflection->getName()); - } - } elseif ($node instanceof Array_) { - $arrayBuilder = ConstantArrayTypeBuilder::createEmpty(); - foreach ($node->items as $arrayItem) { - if ($arrayItem === null) { - continue; - } - - $valueType = $this->getType($arrayItem->value); - if ($arrayItem->unpack) { - if ($valueType instanceof ConstantArrayType) { - foreach ($valueType->getValueTypes() as $innerValueType) { - $arrayBuilder->setOffsetValueType(null, $innerValueType); - } - } else { - $arrayBuilder->degradeToGeneralArray(); - $arrayBuilder->setOffsetValueType(new IntegerType(), $valueType->getIterableValueType()); - } - } else { - $arrayBuilder->setOffsetValueType( - $arrayItem->key !== null ? $this->getType($arrayItem->key) : null, - $valueType - ); - } - } - return $arrayBuilder->getArray(); - - } elseif ($node instanceof Int_) { - return $this->getType($node->expr)->toInteger(); - } elseif ($node instanceof Bool_) { - return $this->getType($node->expr)->toBoolean(); - } elseif ($node instanceof Double) { - return $this->getType($node->expr)->toFloat(); - } elseif ($node instanceof \PhpParser\Node\Expr\Cast\String_) { - return $this->getType($node->expr)->toString(); - } elseif ($node instanceof \PhpParser\Node\Expr\Cast\Array_) { - return $this->getType($node->expr)->toArray(); - } elseif ($node instanceof Node\Scalar\MagicConst\Line) { - return new ConstantIntegerType($node->getLine()); - } elseif ($node instanceof Node\Scalar\MagicConst\Class_) { - if (!$this->isInClass()) { - return new ConstantStringType(''); - } - - return new ConstantStringType($this->getClassReflection()->getName()); - } elseif ($node instanceof Node\Scalar\MagicConst\Dir) { - return new ConstantStringType(dirname($this->getFile())); - } elseif ($node instanceof Node\Scalar\MagicConst\File) { - return new ConstantStringType($this->getFile()); - } elseif ($node instanceof Node\Scalar\MagicConst\Namespace_) { - return new ConstantStringType($this->namespace ?? ''); - } elseif ($node instanceof Node\Scalar\MagicConst\Method) { - if ($this->isInAnonymousFunction()) { - return new ConstantStringType('{closure}'); - } - - $function = $this->getFunction(); - if ($function === null) { - return new ConstantStringType(''); - } - if ($function instanceof MethodReflection) { - return new ConstantStringType( - sprintf('%s::%s', $function->getDeclaringClass()->getName(), $function->getName()) - ); - } - - return new ConstantStringType($function->getName()); - } elseif ($node instanceof Node\Scalar\MagicConst\Function_) { - if ($this->isInAnonymousFunction()) { - return new ConstantStringType('{closure}'); - } - $function = $this->getFunction(); - if ($function === null) { - return new ConstantStringType(''); - } - - return new ConstantStringType($function->getName()); - } elseif ($node instanceof Node\Scalar\MagicConst\Trait_) { - if (!$this->isInTrait()) { - return new ConstantStringType(''); - } - return new ConstantStringType($this->getTraitReflection()->getName()); - } elseif ($node instanceof Object_) { - $castToObject = static function (Type $type): Type { - if ((new ObjectWithoutClassType())->isSuperTypeOf($type)->yes()) { - return $type; - } - - return new ObjectType('stdClass'); - }; - - $exprType = $this->getType($node->expr); - if ($exprType instanceof UnionType) { - return TypeCombinator::union(...array_map($castToObject, $exprType->getTypes())); - } - - return $castToObject($exprType); - } elseif ($node instanceof Unset_) { - return new NullType(); - } elseif ($node instanceof Expr\PostInc || $node instanceof Expr\PostDec) { - return $this->getType($node->var); - } elseif ($node instanceof Expr\PreInc || $node instanceof Expr\PreDec) { - $varType = $this->getType($node->var); - $varScalars = TypeUtils::getConstantScalars($varType); - if (count($varScalars) > 0) { - $newTypes = []; - - foreach ($varScalars as $scalar) { - $varValue = $scalar->getValue(); - if ($node instanceof Expr\PreInc) { - ++$varValue; - } else { - --$varValue; - } - - $newTypes[] = $this->getTypeFromValue($varValue); - } - return TypeCombinator::union(...$newTypes); - } - - $stringType = new StringType(); - if ($stringType->isSuperTypeOf($varType)->yes()) { - return $stringType; - } - - return $varType->toNumber(); - } - - $exprString = $this->printer->prettyPrintExpr($node); - if (isset($this->moreSpecificTypes[$exprString]) && $this->moreSpecificTypes[$exprString]->getCertainty()->yes()) { - return $this->moreSpecificTypes[$exprString]->getType(); - } - - if ($node instanceof ConstFetch) { - $constName = strtolower((string) $node->name); - if ($constName === 'true') { - return new \PHPStan\Type\Constant\ConstantBooleanType(true); - } elseif ($constName === 'false') { - return new \PHPStan\Type\Constant\ConstantBooleanType(false); - } elseif ($constName === 'null') { - return new NullType(); - } - - if ($this->broker->hasConstant($node->name, $this)) { - /** @var string $resolvedConstantName */ - $resolvedConstantName = $this->broker->resolveConstantName($node->name, $this); - if ($resolvedConstantName === 'DIRECTORY_SEPARATOR') { - return new UnionType([ - new ConstantStringType('/'), - new ConstantStringType('\\'), - ]); - } - if ($resolvedConstantName === 'PATH_SEPARATOR') { - return new UnionType([ - new ConstantStringType(':'), - new ConstantStringType(';'), - ]); - } - if ($resolvedConstantName === 'PHP_EOL') { - return new UnionType([ - new ConstantStringType("\n"), - new ConstantStringType("\r\n"), - ]); - } - if ($resolvedConstantName === '__COMPILER_HALT_OFFSET__') { - return new IntegerType(); - } - - $constantType = $this->getTypeFromValue(constant($resolvedConstantName)); - if ($constantType instanceof ConstantType && in_array($resolvedConstantName, $this->dynamicConstantNames, true)) { - return $constantType->generalize(); - } - return $constantType; - } - - return new ErrorType(); - } elseif ($node instanceof Node\Expr\ClassConstFetch && $node->name instanceof Node\Identifier) { - $constantName = $node->name->name; - if ($node->class instanceof Name) { - $constantClass = (string) $node->class; - $constantClassType = new ObjectType($constantClass); - $namesToResolve = [ - 'self', - 'parent', - ]; - if ($this->isInClass()) { - if ($this->getClassReflection()->isFinal()) { - $namesToResolve[] = 'static'; - } elseif (strtolower($constantClass) === 'static') { - if (strtolower($constantName) === 'class') { - return new StringType(); - } - return new MixedType(); - } - } - if (in_array(strtolower($constantClass), $namesToResolve, true)) { - $resolvedName = $this->resolveName($node->class); - if ($resolvedName === 'parent' && strtolower($constantName) === 'class') { - return new StringType(); - } - $constantClassType = new ObjectType($resolvedName); - } - } else { - $constantClassType = $this->getType($node->class); - } - - if (strtolower($constantName) === 'class' && $constantClassType instanceof TypeWithClassName) { - return new ConstantStringType($constantClassType->getClassName()); - } - - $referencedClasses = TypeUtils::getDirectClassNames($constantClassType); - $types = []; - foreach ($referencedClasses as $referencedClass) { - if (!$this->broker->hasClass($referencedClass)) { - continue; - } - - $propertyClassReflection = $this->broker->getClass($referencedClass); - if (!$propertyClassReflection->hasConstant($constantName)) { - continue; - } - - $constantType = $this->getTypeFromValue($propertyClassReflection->getConstant($constantName)->getValue()); - if ( - $constantType instanceof ConstantType - && in_array(sprintf('%s::%s', $propertyClassReflection->getName(), $constantName), $this->dynamicConstantNames, true) - ) { - $constantType = $constantType->generalize(); - } - $types[] = $constantType; - } - - if (count($types) > 0) { - return TypeCombinator::union(...$types); - } - - if (!$constantClassType->hasConstant($constantName)->yes()) { - return new ErrorType(); - } - - return $this->getTypeFromValue($constantClassType->getConstant($constantName)->getValue()); - } - - if ($node instanceof Expr\Ternary) { - if ($node->if === null) { - $conditionType = $this->getType($node->cond); - $booleanConditionType = $conditionType->toBoolean(); - if ($booleanConditionType instanceof ConstantBooleanType) { - if ($booleanConditionType->getValue()) { - return $this->filterByTruthyValue($node->cond, true)->getType($node->cond); - } - - return $this->filterByFalseyValue($node->cond, true)->getType($node->else); - } - return TypeCombinator::union( - $this->filterByTruthyValue($node->cond, true)->getType($node->cond), - $this->filterByFalseyValue($node->cond, true)->getType($node->else) - ); - } - - $booleanConditionType = $this->getType($node->cond)->toBoolean(); - if ($booleanConditionType instanceof ConstantBooleanType) { - if ($booleanConditionType->getValue()) { - return $this->filterByTruthyValue($node->cond)->getType($node->if); - } - - return $this->filterByFalseyValue($node->cond)->getType($node->else); - } - - return TypeCombinator::union( - $this->filterByTruthyValue($node->cond)->getType($node->if), - $this->filterByFalseyValue($node->cond)->getType($node->else) - ); - } - - if ($node instanceof Variable && is_string($node->name)) { - if ($this->hasVariableType($node->name)->no()) { - return new ErrorType(); - } - - return $this->getVariableType($node->name); - } - - if ($node instanceof Expr\ArrayDimFetch && $node->dim !== null) { - return $this->getTypeFromArrayDimFetch( - $node, - $this->getType($node->dim), - $this->getType($node->var) - ); - } - - if ($node instanceof MethodCall && $node->name instanceof Node\Identifier) { - $methodCalledOnType = $this->getType($node->var); - $referencedClasses = TypeUtils::getDirectClassNames($methodCalledOnType); - $resolvedTypes = []; - foreach ($referencedClasses as $referencedClass) { - if (!$this->broker->hasClass($referencedClass)) { - continue; - } - - $methodClassReflection = $this->broker->getClass($referencedClass); - if (!$methodClassReflection->hasMethod($node->name->name)) { - continue; - } - - $methodReflection = $methodClassReflection->getMethod($node->name->name, $this); - $foundDynamicReturnTypeExtension = false; - foreach ($this->broker->getDynamicMethodReturnTypeExtensionsForClass($methodClassReflection->getName()) as $dynamicMethodReturnTypeExtension) { - if (!$dynamicMethodReturnTypeExtension->isMethodSupported($methodReflection)) { - continue; - } - - $resolvedTypes[] = $dynamicMethodReturnTypeExtension->getTypeFromMethodCall($methodReflection, $node, $this); - $foundDynamicReturnTypeExtension = true; - } - - if ($foundDynamicReturnTypeExtension) { - continue; - } - - $methodReturnType = ParametersAcceptorSelector::selectFromArgs( - $this, - $node->args, - $methodReflection->getVariants() - )->getReturnType(); - if ($methodReturnType instanceof StaticResolvableType) { - $calledOnThis = $this->getType($node->var) instanceof ThisType; - if ($calledOnThis && $this->isInClass()) { - $resolvedTypes[] = $methodReturnType->changeBaseClass($this->getClassReflection()->getName()); - } else { - $resolvedTypes[] = $methodReturnType->resolveStatic($referencedClass); - } - } else { - $resolvedTypes[] = $methodReturnType; - } - } - if (count($resolvedTypes) > 0) { - return TypeCombinator::union(...$resolvedTypes); - } - - if ($methodCalledOnType->hasMethod($node->name->name)->yes()) { - $methodReflection = $methodCalledOnType->getMethod($node->name->name, $this); - return ParametersAcceptorSelector::selectFromArgs( - $this, - $node->args, - $methodReflection->getVariants() - )->getReturnType(); - } - - return new ErrorType(); - } - - if ($node instanceof Expr\StaticCall && $node->name instanceof Node\Identifier) { - if ($node->class instanceof Name) { - $calleeType = new ObjectType($this->resolveName($node->class)); - } else { - $calleeType = $this->getType($node->class); - } - - $referencedClasses = TypeUtils::getDirectClassNames($calleeType); - $resolvedTypes = []; - foreach ($referencedClasses as $referencedClass) { - if (!$this->broker->hasClass($referencedClass)) { - continue; - } - - $staticMethodClassReflection = $this->broker->getClass($referencedClass); - if (!$staticMethodClassReflection->hasMethod($node->name->name)) { - continue; - } - - $staticMethodReflection = $staticMethodClassReflection->getMethod($node->name->name, $this); - $foundDynamicReturnTypeExtension = false; - foreach ($this->broker->getDynamicStaticMethodReturnTypeExtensionsForClass($staticMethodClassReflection->getName()) as $dynamicStaticMethodReturnTypeExtension) { - if (!$dynamicStaticMethodReturnTypeExtension->isStaticMethodSupported($staticMethodReflection)) { - continue; - } - - $resolvedTypes[] = $dynamicStaticMethodReturnTypeExtension->getTypeFromStaticMethodCall($staticMethodReflection, $node, $this); - $foundDynamicReturnTypeExtension = true; - } - - if ($foundDynamicReturnTypeExtension) { - continue; - } - - $staticMethodReturnType = ParametersAcceptorSelector::selectFromArgs( - $this, - $node->args, - $staticMethodReflection->getVariants() - )->getReturnType(); - if ($staticMethodReturnType instanceof StaticResolvableType) { - if ($node->class instanceof Name) { - $nameNodeClassName = (string) $node->class; - $lowercasedNameNodeClassName = strtolower($nameNodeClassName); - if (in_array($lowercasedNameNodeClassName, [ - 'self', - 'static', - 'parent', - ], true) && $this->isInClass()) { - $resolvedTypes[] = $staticMethodReturnType->changeBaseClass($this->getClassReflection()->getName()); - } elseif ($this->broker->hasClass($nameNodeClassName)) { - $classReflection = $this->broker->getClass($nameNodeClassName); - $resolvedTypes[] = $staticMethodReturnType->resolveStatic($classReflection->getName()); - } else { - $resolvedTypes[] = $staticMethodReturnType; - } - } else { - $resolvedTypes[] = $staticMethodReturnType->resolveStatic($referencedClass); - } - } else { - $resolvedTypes[] = $staticMethodReturnType; - } - } - if (count($resolvedTypes) > 0) { - return TypeCombinator::union(...$resolvedTypes); - } - - if ($calleeType->hasMethod($node->name->name)->yes()) { - $staticMethodReflection = $calleeType->getMethod($node->name->name, $this); - return ParametersAcceptorSelector::selectFromArgs( - $this, - $node->args, - $staticMethodReflection->getVariants() - )->getReturnType(); - } - - return new ErrorType(); - } - - if ($node instanceof PropertyFetch && $node->name instanceof Node\Identifier) { - $propertyFetchedOnType = $this->getType($node->var); - $referencedClasses = TypeUtils::getDirectClassNames($propertyFetchedOnType); - $propertyName = $node->name->toString(); - $types = []; - foreach ($referencedClasses as $referencedClass) { - if (!$this->broker->hasClass($referencedClass)) { - continue; - } - - $propertyClassReflection = $this->broker->getClass($referencedClass); - if (!$propertyClassReflection->hasProperty($propertyName)) { - continue; - } - - $property = $propertyClassReflection->getProperty($propertyName, $this); - if ($this->isInExpressionAssign($node)) { - if ($property instanceof ExtendedPropertyReflection) { - $types[] = $property->getWritableType(); - } else { - $types[] = $property->getType(); - } - } else { - $types[] = $property->getType(); - } - } - - if (count($types) > 0) { - return TypeCombinator::union(...$types); - } - - if (!$propertyFetchedOnType->hasProperty($node->name->name)->yes()) { - return new ErrorType(); - } - - $property = $propertyFetchedOnType->getProperty($node->name->name, $this); - if ( - $this->isInExpressionAssign($node) - && $property instanceof ExtendedPropertyReflection - ) { - return $property->getWritableType(); - } - return $property->getType(); - } - - if ( - $node instanceof Expr\StaticPropertyFetch - && $node->name instanceof Node\VarLikeIdentifier - ) { - if ($node->class instanceof Name) { - $calleeType = new ObjectType($this->resolveName($node->class)); - } else { - $calleeType = $this->getType($node->class); - } - - $referencedClasses = TypeUtils::getDirectClassNames($calleeType); - $propertyName = $node->name->toString(); - $types = []; - foreach ($referencedClasses as $referencedClass) { - if (!$this->broker->hasClass($referencedClass)) { - continue; - } - - $propertyClassReflection = $this->broker->getClass($referencedClass); - if (!$propertyClassReflection->hasProperty($propertyName)) { - continue; - } - - $property = $propertyClassReflection->getProperty($propertyName, $this); - if ($this->isInExpressionAssign($node)) { - if ($property instanceof ExtendedPropertyReflection) { - $types[] = $property->getWritableType(); - } else { - $types[] = $property->getType(); - } - } else { - $types[] = $propertyClassReflection->getProperty($propertyName, $this)->getType(); - } - } - - if (count($types) > 0) { - return TypeCombinator::union(...$types); - } - - if (!$calleeType->hasProperty($node->name->name)->yes()) { - return new ErrorType(); - } - - $property = $calleeType->getProperty($node->name->name, $this); - if ( - $this->isInExpressionAssign($node) - && $property instanceof ExtendedPropertyReflection - ) { - return $property->getWritableType(); - } - return $property->getType(); - } - - if ($node instanceof FuncCall) { - if ($node->name instanceof Expr) { - $calledOnType = $this->getType($node->name); - if ($calledOnType->isCallable()->no()) { - return new ErrorType(); - } - - return ParametersAcceptorSelector::selectFromArgs( - $this, - $node->args, - $calledOnType->getCallableParametersAcceptors($this) - )->getReturnType(); - } - - if (!$this->broker->hasFunction($node->name, $this)) { - return new ErrorType(); - } - - $functionReflection = $this->broker->getFunction($node->name, $this); - foreach ($this->broker->getDynamicFunctionReturnTypeExtensions() as $dynamicFunctionReturnTypeExtension) { - if (!$dynamicFunctionReturnTypeExtension->isFunctionSupported($functionReflection)) { - continue; - } - - return $dynamicFunctionReturnTypeExtension->getTypeFromFunctionCall($functionReflection, $node, $this); - } - - return ParametersAcceptorSelector::selectFromArgs( - $this, - $node->args, - $functionReflection->getVariants() - )->getReturnType(); - } - - return new MixedType(); - } - - /** - * @param \PhpParser\Node\Expr\PropertyFetch|\PhpParser\Node\Expr\StaticPropertyFetch $propertyFetch - * @return bool - */ - private function hasPropertyNativeType($propertyFetch): bool - { - $propertyReflection = $this->propertyReflectionFinder->findPropertyReflectionFromNode($propertyFetch, $this); - if ($propertyReflection === null) { - return false; - } - - if (!$propertyReflection instanceof PhpPropertyReflection) { - return false; - } - - return !$propertyReflection->getNativeType() instanceof MixedType; - } - - protected function getTypeFromArrayDimFetch( - Expr\ArrayDimFetch $arrayDimFetch, - Type $offsetType, - Type $offsetAccessibleType - ): Type - { - if ($arrayDimFetch->dim === null) { - throw new \PHPStan\ShouldNotHappenException(); - } - - if ((new ObjectType(\ArrayAccess::class))->isSuperTypeOf($offsetAccessibleType)->yes()) { - return $this->getType( - new MethodCall( - $arrayDimFetch->var, - new Node\Identifier('offsetGet'), - [ - new Node\Arg($arrayDimFetch->dim), - ] - ) - ); - } - - return $offsetAccessibleType->getOffsetValueType($offsetType); - } - - private function calculateFromScalars(Expr $node, ConstantScalarType $leftType, ConstantScalarType $rightType): Type - { - if ($leftType instanceof StringType && $rightType instanceof StringType) { - /** @var string $leftValue */ - $leftValue = $leftType->getValue(); - /** @var string $rightValue */ - $rightValue = $rightType->getValue(); - - if ($node instanceof Expr\BinaryOp\BitwiseAnd || $node instanceof Expr\AssignOp\BitwiseAnd) { - return $this->getTypeFromValue($leftValue & $rightValue); - } - - if ($node instanceof Expr\BinaryOp\BitwiseOr || $node instanceof Expr\AssignOp\BitwiseOr) { - return $this->getTypeFromValue($leftValue | $rightValue); - } - - if ($node instanceof Expr\BinaryOp\BitwiseXor || $node instanceof Expr\AssignOp\BitwiseXor) { - return $this->getTypeFromValue($leftValue ^ $rightValue); - } - } - - $leftValue = $leftType->getValue(); - $rightValue = $rightType->getValue(); - - if ($node instanceof Node\Expr\BinaryOp\Spaceship) { - return $this->getTypeFromValue($leftValue <=> $rightValue); - } - - $leftNumberType = $leftType->toNumber(); - $rightNumberType = $rightType->toNumber(); - if (TypeCombinator::union($leftNumberType, $rightNumberType) instanceof ErrorType) { - return new ErrorType(); - } - - if (!$leftNumberType instanceof ConstantScalarType || !$rightNumberType instanceof ConstantScalarType) { - throw new \PHPStan\ShouldNotHappenException(); - } - - /** @var float|int $leftNumberValue */ - $leftNumberValue = $leftNumberType->getValue(); - - /** @var float|int $rightNumberValue */ - $rightNumberValue = $rightNumberType->getValue(); - - if ($node instanceof Node\Expr\BinaryOp\Plus || $node instanceof Node\Expr\AssignOp\Plus) { - return $this->getTypeFromValue($leftNumberValue + $rightNumberValue); - } - - if ($node instanceof Node\Expr\BinaryOp\Minus || $node instanceof Node\Expr\AssignOp\Minus) { - return $this->getTypeFromValue($leftNumberValue - $rightNumberValue); - } - - if ($node instanceof Node\Expr\BinaryOp\Mul || $node instanceof Node\Expr\AssignOp\Mul) { - return $this->getTypeFromValue($leftNumberValue * $rightNumberValue); - } - - if ($node instanceof Node\Expr\BinaryOp\Pow || $node instanceof Node\Expr\AssignOp\Pow) { - return $this->getTypeFromValue($leftNumberValue ** $rightNumberValue); - } - - if ($node instanceof Node\Expr\BinaryOp\Div || $node instanceof Node\Expr\AssignOp\Div) { - return $this->getTypeFromValue($leftNumberValue / $rightNumberValue); - } - - if ($node instanceof Node\Expr\BinaryOp\Mod || $node instanceof Node\Expr\AssignOp\Mod) { - return $this->getTypeFromValue($leftNumberValue % $rightNumberValue); - } - - if ($node instanceof Expr\BinaryOp\ShiftLeft || $node instanceof Expr\AssignOp\ShiftLeft) { - return $this->getTypeFromValue($leftNumberValue << $rightNumberValue); - } - - if ($node instanceof Expr\BinaryOp\ShiftRight || $node instanceof Expr\AssignOp\ShiftRight) { - return $this->getTypeFromValue($leftNumberValue >> $rightNumberValue); - } - - if ($node instanceof Expr\BinaryOp\BitwiseAnd || $node instanceof Expr\AssignOp\BitwiseAnd) { - return $this->getTypeFromValue($leftNumberValue & $rightNumberValue); - } - - if ($node instanceof Expr\BinaryOp\BitwiseOr || $node instanceof Expr\AssignOp\BitwiseOr) { - return $this->getTypeFromValue($leftNumberValue | $rightNumberValue); - } - - if ($node instanceof Expr\BinaryOp\BitwiseXor || $node instanceof Expr\AssignOp\BitwiseXor) { - return $this->getTypeFromValue($leftNumberValue ^ $rightNumberValue); - } - - return new MixedType(); - } - - public function resolveName(Name $name): string - { - $originalClass = (string) $name; - if ($this->isInClass()) { - if (in_array(strtolower($originalClass), [ - 'self', - 'static', - ], true)) { - return $this->getClassReflection()->getName(); - } elseif ($originalClass === 'parent') { - $currentClassReflection = $this->getClassReflection(); - if ($currentClassReflection->getParentClass() !== false) { - return $currentClassReflection->getParentClass()->getName(); - } - } - } - - return $originalClass; - } - - /** - * @param mixed $value - */ - public function getTypeFromValue($value): Type - { - if (is_int($value)) { - return new ConstantIntegerType($value); - } elseif (is_float($value)) { - return new ConstantFloatType($value); - } elseif (is_bool($value)) { - return new ConstantBooleanType($value); - } elseif ($value === null) { - return new NullType(); - } elseif (is_string($value)) { - return new ConstantStringType($value); - } elseif (is_array($value)) { - $arrayBuilder = ConstantArrayTypeBuilder::createEmpty(); - foreach ($value as $k => $v) { - $arrayBuilder->setOffsetValueType($this->getTypeFromValue($k), $this->getTypeFromValue($v)); - } - return $arrayBuilder->getArray(); - } - - return new MixedType(); - } - - public function isSpecified(Expr $node): bool - { - $exprString = $this->printer->prettyPrintExpr($node); - - return isset($this->moreSpecificTypes[$exprString]) - && $this->moreSpecificTypes[$exprString]->getCertainty()->yes(); - } - - public function enterClass(ClassReflection $classReflection): self - { - return $this->scopeFactory->create( - $this->context->enterClass($classReflection), - $this->isDeclareStrictTypes(), - null, - $this->getNamespace(), - [ - 'this' => VariableTypeHolder::createYes(new ThisType($classReflection->getName())), - ] - ); - } - - public function enterTrait(ClassReflection $traitReflection): self - { - return $this->scopeFactory->create( - $this->context->enterTrait($traitReflection), - $this->isDeclareStrictTypes(), - $this->getFunction(), - $this->getNamespace(), - $this->getVariableTypes(), - $this->moreSpecificTypes, - $this->inClosureBindScopeClass, - $this->getAnonymousFunctionReturnType(), - $this->getInFunctionCall(), - $this->isNegated() - ); - } - - /** - * @param Node\Stmt\ClassMethod $classMethod - * @param Type[] $phpDocParameterTypes - * @param Type|null $phpDocReturnType - * @param Type|null $throwType - * @param string|null $deprecatedDescription - * @param bool $isDeprecated - * @param bool $isInternal - * @param bool $isFinal - * @return self - */ - public function enterClassMethod( - Node\Stmt\ClassMethod $classMethod, - array $phpDocParameterTypes, - ?Type $phpDocReturnType, - ?Type $throwType, - ?string $deprecatedDescription, - bool $isDeprecated, - bool $isInternal, - bool $isFinal - ): self - { - if (!$this->isInClass()) { - throw new \PHPStan\ShouldNotHappenException(); - } - - return $this->enterFunctionLike( - new PhpMethodFromParserNodeReflection( - $this->getClassReflection(), - $classMethod, - $this->getRealParameterTypes($classMethod), - $phpDocParameterTypes, - $classMethod->returnType !== null, - $this->getFunctionType($classMethod->returnType, $classMethod->returnType === null, false), - $phpDocReturnType, - $throwType, - $deprecatedDescription, - $isDeprecated, - $isInternal, - $isFinal - ) - ); - } - - /** - * @param Node\FunctionLike $functionLike - * @return Type[] - */ - private function getRealParameterTypes(Node\FunctionLike $functionLike): array - { - $realParameterTypes = []; - foreach ($functionLike->getParams() as $parameter) { - if (!$parameter->var instanceof Variable || !is_string($parameter->var->name)) { - throw new \PHPStan\ShouldNotHappenException(); - } - $realParameterTypes[$parameter->var->name] = $this->getFunctionType( - $parameter->type, - $this->isParameterValueNullable($parameter), - $parameter->variadic - ); - } - - return $realParameterTypes; - } - - /** - * @param Node\Stmt\Function_ $function - * @param Type[] $phpDocParameterTypes - * @param Type|null $phpDocReturnType - * @param Type|null $throwType - * @param string|null $deprecatedDescription - * @param bool $isDeprecated - * @param bool $isInternal - * @param bool $isFinal - * @return self - */ - public function enterFunction( - Node\Stmt\Function_ $function, - array $phpDocParameterTypes, - ?Type $phpDocReturnType, - ?Type $throwType, - ?string $deprecatedDescription, - bool $isDeprecated, - bool $isInternal, - bool $isFinal - ): self - { - return $this->enterFunctionLike( - new PhpFunctionFromParserNodeReflection( - $function, - $this->getRealParameterTypes($function), - $phpDocParameterTypes, - $function->returnType !== null, - $this->getFunctionType($function->returnType, $function->returnType === null, false), - $phpDocReturnType, - $throwType, - $deprecatedDescription, - $isDeprecated, - $isInternal, - $isFinal - ) - ); - } - - private function enterFunctionLike( - PhpFunctionFromParserNodeReflection $functionReflection - ): self - { - $variableTypes = $this->getVariableTypes(); - foreach (ParametersAcceptorSelector::selectSingle($functionReflection->getVariants())->getParameters() as $parameter) { - $variableTypes[$parameter->getName()] = VariableTypeHolder::createYes($parameter->getType()); - } - - return $this->scopeFactory->create( - $this->context, - $this->isDeclareStrictTypes(), - $functionReflection, - $this->getNamespace(), - $variableTypes, - [], - null, - null - ); - } - - public function enterNamespace(string $namespaceName): self - { - return $this->scopeFactory->create( - $this->context->beginFile(), - $this->isDeclareStrictTypes(), - null, - $namespaceName - ); - } - - public function enterClosureBind(?Type $thisType, string $scopeClass): self - { - $variableTypes = $this->getVariableTypes(); - - if ($thisType !== null) { - $variableTypes['this'] = VariableTypeHolder::createYes($thisType); - } else { - unset($variableTypes['this']); - } - - if ($scopeClass === 'static' && $this->isInClass()) { - $scopeClass = $this->getClassReflection()->getName(); - } - - return $this->scopeFactory->create( - $this->context, - $this->isDeclareStrictTypes(), - $this->getFunction(), - $this->getNamespace(), - $variableTypes, - $this->moreSpecificTypes, - $scopeClass, - $this->getAnonymousFunctionReturnType(), - $this->getInFunctionCall(), - $this->isNegated() - ); - } - - public function restoreOriginalScopeAfterClosureBind(self $originalScope): self - { - $variableTypes = $this->getVariableTypes(); - if (isset($originalScope->variableTypes['this'])) { - $variableTypes['this'] = $originalScope->variableTypes['this']; - } else { - unset($variableTypes['this']); - } - - return $this->scopeFactory->create( - $this->context, - $this->isDeclareStrictTypes(), - $this->getFunction(), - $this->getNamespace(), - $variableTypes, - $this->moreSpecificTypes, - $originalScope->inClosureBindScopeClass, - $this->getAnonymousFunctionReturnType(), - $this->getInFunctionCall(), - $this->isNegated() - ); - } - - public function enterClosureCall(Type $thisType): self - { - $variableTypes = $this->getVariableTypes(); - $variableTypes['this'] = VariableTypeHolder::createYes($thisType); - - return $this->scopeFactory->create( - $this->context, - $this->isDeclareStrictTypes(), - $this->getFunction(), - $this->getNamespace(), - $variableTypes, - $this->moreSpecificTypes, - $thisType instanceof TypeWithClassName ? $thisType->getClassName() : null, - $this->getAnonymousFunctionReturnType(), - $this->getInFunctionCall(), - $this->isNegated() - ); - } - - public function isInClosureBind(): bool - { - return $this->inClosureBindScopeClass !== null; - } - - /** - * @param \PhpParser\Node\Expr\Closure $closure - * @param \PHPStan\Reflection\ParameterReflection[]|null $callableParameters - * @return \PHPStan\Analyser\Scope - */ - public function enterAnonymousFunction( - Expr\Closure $closure, - ?array $callableParameters = null - ): self - { - $variableTypes = []; - foreach ($closure->params as $i => $parameter) { - if ($parameter->type === null) { - if ($callableParameters === null) { - $parameterType = new MixedType(); - } elseif (isset($callableParameters[$i])) { - $parameterType = $callableParameters[$i]->getType(); - } elseif (count($callableParameters) > 0) { - $lastParameter = $callableParameters[count($callableParameters) - 1]; - if ($lastParameter->isVariadic()) { - $parameterType = $lastParameter->getType(); - } else { - $parameterType = new MixedType(); - } - } else { - $parameterType = new MixedType(); - } - } else { - $isNullable = $this->isParameterValueNullable($parameter); - $parameterType = $this->getFunctionType($parameter->type, $isNullable, $parameter->variadic); - } - - if (!$parameter->var instanceof Variable || !is_string($parameter->var->name)) { - throw new \PHPStan\ShouldNotHappenException(); - } - $variableTypes[$parameter->var->name] = VariableTypeHolder::createYes( - $parameterType - ); - } - - foreach ($closure->uses as $use) { - if (!is_string($use->var->name)) { - throw new \PHPStan\ShouldNotHappenException(); - } - if ($use->byRef) { - continue; - } - if ($this->hasVariableType($use->var->name)->no()) { - $variableType = new ErrorType(); - } else { - $variableType = $this->getVariableType($use->var->name); - } - $variableTypes[$use->var->name] = VariableTypeHolder::createYes($variableType); - } - - if ($this->hasVariableType('this')->yes() && !$closure->static) { - $variableTypes['this'] = VariableTypeHolder::createYes($this->getVariableType('this')); - } - - $returnType = $this->getFunctionType($closure->returnType, $closure->returnType === null, false); - - return $this->scopeFactory->create( - $this->context, - $this->isDeclareStrictTypes(), - $this->getFunction(), - $this->getNamespace(), - $variableTypes, - [], - $this->inClosureBindScopeClass, - $returnType, - $this->getInFunctionCall() - ); - } - - public function enterArrowFunction(Expr\ArrowFunction $arrowFunction): self - { - $variableTypes = $this->variableTypes; - $mixed = new MixedType(); - foreach ($arrowFunction->params as $parameter) { - if ($parameter->type === null) { - $parameterType = $mixed; - } else { - $isNullable = $this->isParameterValueNullable($parameter); - $parameterType = $this->getFunctionType($parameter->type, $isNullable, $parameter->variadic); - } - - if (!$parameter->var instanceof Variable || !is_string($parameter->var->name)) { - throw new \PHPStan\ShouldNotHappenException(); - } - - $variableTypes[$parameter->var->name] = VariableTypeHolder::createYes($parameterType); - } - - if ($arrowFunction->static) { - unset($variableTypes['this']); - } - - $returnType = $this->getFunctionType($arrowFunction->returnType, $arrowFunction->returnType === null, false); - - return $this->scopeFactory->create( - $this->context, - $this->isDeclareStrictTypes(), - $this->getFunction(), - $this->getNamespace(), - $variableTypes, - [], - $this->inClosureBindScopeClass, - $returnType, - $this->getInFunctionCall() - ); - } - - public function isParameterValueNullable(Node\Param $parameter): bool - { - if ($parameter->default instanceof ConstFetch) { - return strtolower((string) $parameter->default->name) === 'null'; - } - - return false; - } - - /** - * @param \PhpParser\Node\Name|\PhpParser\Node\Identifier|\PhpParser\Node\NullableType|null $type - * @param bool $isNullable - * @param bool $isVariadic - * @return Type - */ - public function getFunctionType($type, bool $isNullable, bool $isVariadic): Type - { - if ($isNullable) { - return TypeCombinator::addNull( - $this->getFunctionType($type, false, $isVariadic) - ); - } - if ($isVariadic) { - return new ArrayType(new IntegerType(), $this->getFunctionType( - $type, - false, - false - )); - } - if ($type === null) { - return new MixedType(); - } elseif ($type instanceof Name) { - $className = (string) $type; - $lowercasedClassName = strtolower($className); - if ($this->isInClass() && in_array($lowercasedClassName, ['self', 'static'], true)) { - $className = $this->getClassReflection()->getName(); - } elseif ( - $lowercasedClassName === 'parent' - ) { - if ($this->isInClass() && $this->getClassReflection()->getParentClass() !== false) { - return new ObjectType($this->getClassReflection()->getParentClass()->getName()); - } - - return new NonexistentParentClassType(); - } - return new ObjectType($className); - } elseif ($type instanceof Node\NullableType) { - return $this->getFunctionType($type->type, true, $isVariadic); - } - - $type = $type->name; - if ($type === 'string') { - return new StringType(); - } elseif ($type === 'int') { - return new IntegerType(); - } elseif ($type === 'bool') { - return new BooleanType(); - } elseif ($type === 'float') { - return new FloatType(); - } elseif ($type === 'callable') { - return new CallableType(); - } elseif ($type === 'array') { - return new ArrayType(new MixedType(), new MixedType()); - } elseif ($type === 'iterable') { - return new IterableType(new MixedType(), new MixedType()); - } elseif ($type === 'void') { - return new VoidType(); - } elseif ($type === 'object') { - return new ObjectWithoutClassType(); - } - - return new MixedType(); - } - - public function enterForeach(Expr $iteratee, string $valueName, ?string $keyName): self - { - $iterateeType = $this->getType($iteratee); - $scope = $this->assignVariable($valueName, $iterateeType->getIterableValueType()); - - if ($keyName !== null) { - $scope = $scope->assignVariable($keyName, $iterateeType->getIterableKeyType()); - } - - return $scope; - } - - /** - * @param \PhpParser\Node\Name[] $classes - * @param string $variableName - * @return Scope - */ - public function enterCatch(array $classes, string $variableName): self - { - $type = TypeCombinator::union(...array_map(static function (string $class): ObjectType { - return new ObjectType($class); - }, $classes)); - - return $this->assignVariable( - $variableName, - TypeCombinator::intersect($type, new ObjectType(\Throwable::class)) - ); - } - - /** - * @param \PhpParser\Node\Expr\FuncCall|\PhpParser\Node\Expr\MethodCall|\PhpParser\Node\Expr\StaticCall $functionCall - * @return self - */ - public function enterFunctionCall($functionCall): self - { - return $this->scopeFactory->create( - $this->context, - $this->isDeclareStrictTypes(), - $this->getFunction(), - $this->getNamespace(), - $this->getVariableTypes(), - $this->moreSpecificTypes, - $this->inClosureBindScopeClass, - $this->getAnonymousFunctionReturnType(), - $functionCall, - $this->isNegated(), - $this->inFirstLevelStatement - ); - } - - public function enterExpressionAssign(Expr $expr): self - { - $exprString = $this->printer->prettyPrintExpr($expr); - $currentlyAssignedExpressions = $this->currentlyAssignedExpressions; - $currentlyAssignedExpressions[$exprString] = true; - - return $this->scopeFactory->create( - $this->context, - $this->isDeclareStrictTypes(), - $this->getFunction(), - $this->getNamespace(), - $this->getVariableTypes(), - $this->moreSpecificTypes, - $this->inClosureBindScopeClass, - $this->getAnonymousFunctionReturnType(), - $this->getInFunctionCall(), - $this->isNegated(), - $this->isInFirstLevelStatement(), - $currentlyAssignedExpressions - ); - } - - public function exitExpressionAssign(Expr $expr): self - { - $exprString = $this->printer->prettyPrintExpr($expr); - $currentlyAssignedExpressions = $this->currentlyAssignedExpressions; - unset($currentlyAssignedExpressions[$exprString]); - - return $this->scopeFactory->create( - $this->context, - $this->isDeclareStrictTypes(), - $this->getFunction(), - $this->getNamespace(), - $this->getVariableTypes(), - $this->moreSpecificTypes, - $this->inClosureBindScopeClass, - $this->getAnonymousFunctionReturnType(), - $this->getInFunctionCall(), - $this->isNegated(), - $this->isInFirstLevelStatement(), - $currentlyAssignedExpressions - ); - } - - public function isInExpressionAssign(Expr $expr): bool - { - $exprString = $this->printer->prettyPrintExpr($expr); - return array_key_exists($exprString, $this->currentlyAssignedExpressions); - } - - public function assignVariable(string $variableName, Type $type, ?TrinaryLogic $certainty = null): self - { - if ($certainty === null) { - $certainty = TrinaryLogic::createYes(); - } elseif ($certainty->no()) { - throw new \PHPStan\ShouldNotHappenException(); - } - $variableTypes = $this->getVariableTypes(); - $variableTypes[$variableName] = new VariableTypeHolder($type, $certainty); - - $variableString = $this->printer->prettyPrintExpr(new Variable($variableName)); - $moreSpecificTypeHolders = $this->moreSpecificTypes; - foreach (array_keys($moreSpecificTypeHolders) as $key) { - $matches = \Nette\Utils\Strings::match((string) $key, '#(\$[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*)#'); - if ($matches === null) { - continue; - } - - if ($matches[1] !== $variableString) { - continue; - } - - unset($moreSpecificTypeHolders[$key]); - } - - return $this->scopeFactory->create( - $this->context, - $this->isDeclareStrictTypes(), - $this->getFunction(), - $this->getNamespace(), - $variableTypes, - $moreSpecificTypeHolders, - $this->inClosureBindScopeClass, - $this->getAnonymousFunctionReturnType(), - $this->getInFunctionCall(), - $this->isNegated(), - $this->inFirstLevelStatement, - $this->currentlyAssignedExpressions - ); - } - - public function unsetExpression(Expr $expr): self - { - if ($expr instanceof Variable && is_string($expr->name)) { - if ($this->hasVariableType($expr->name)->no()) { - return $this; - } - $variableTypes = $this->getVariableTypes(); - unset($variableTypes[$expr->name]); - - return $this->scopeFactory->create( - $this->context, - $this->isDeclareStrictTypes(), - $this->getFunction(), - $this->getNamespace(), - $variableTypes, - $this->moreSpecificTypes, - $this->inClosureBindScopeClass, - $this->getAnonymousFunctionReturnType(), - $this->getInFunctionCall(), - $this->isNegated(), - $this->inFirstLevelStatement - ); - } elseif ($expr instanceof Expr\ArrayDimFetch && $expr->dim !== null) { - $constantArrays = TypeUtils::getConstantArrays($this->getType($expr->var)); - if (count($constantArrays) > 0) { - $unsetArrays = []; - $dimType = $this->getType($expr->dim); - foreach ($constantArrays as $constantArray) { - $unsetArrays[] = $constantArray->unsetOffset($dimType); - } - return $this->specifyExpressionType( - $expr->var, - TypeCombinator::union(...$unsetArrays) - ); - } - } - - return $this; - } - - public function specifyExpressionType(Expr $expr, Type $type): self - { - if ($expr instanceof Node\Scalar || $expr instanceof Array_) { - return $this; - } - - $exprString = $this->printer->prettyPrintExpr($expr); - - $scope = $this; - - if ($expr instanceof Variable && is_string($expr->name)) { - $variableName = $expr->name; - - $variableTypes = $this->getVariableTypes(); - $variableTypes[$variableName] = VariableTypeHolder::createYes($type); - - return $this->scopeFactory->create( - $this->context, - $this->isDeclareStrictTypes(), - $this->getFunction(), - $this->getNamespace(), - $variableTypes, - $this->moreSpecificTypes, - $this->inClosureBindScopeClass, - $this->getAnonymousFunctionReturnType(), - $this->getInFunctionCall(), - $this->isNegated(), - $this->inFirstLevelStatement, - $this->currentlyAssignedExpressions - ); - } elseif ($expr instanceof Expr\ArrayDimFetch && $expr->dim !== null) { - $constantArrays = TypeUtils::getConstantArrays($this->getType($expr->var)); - if (count($constantArrays) > 0) { - $setArrays = []; - $dimType = $this->getType($expr->dim); - foreach ($constantArrays as $constantArray) { - $setArrays[] = $constantArray->setOffsetValueType($dimType, $type); - } - $scope = $this->specifyExpressionType( - $expr->var, - TypeCombinator::union(...$setArrays) - ); - } - } - - return $scope->addMoreSpecificTypes([ - $exprString => $type, - ]); - } - - public function unspecifyExpressionType(Expr $expr): self - { - $exprString = $this->printer->prettyPrintExpr($expr); - $moreSpecificTypeHolders = $this->moreSpecificTypes; - if (isset($moreSpecificTypeHolders[$exprString])) { - unset($moreSpecificTypeHolders[$exprString]); - return $this->scopeFactory->create( - $this->context, - $this->isDeclareStrictTypes(), - $this->getFunction(), - $this->getNamespace(), - $this->getVariableTypes(), - $moreSpecificTypeHolders, - $this->inClosureBindScopeClass, - $this->getAnonymousFunctionReturnType(), - $this->getInFunctionCall(), - $this->isNegated(), - $this->inFirstLevelStatement - ); - } - - return $this; - } - - public function removeTypeFromExpression(Expr $expr, Type $type): self - { - return $this->specifyExpressionType( - $expr, - TypeCombinator::remove($this->getType($expr), $type) - ); - } - - public function filterByTruthyValue(Expr $expr, bool $defaultHandleFunctions = false): self - { - $specifiedTypes = $this->typeSpecifier->specifyTypesInCondition($this, $expr, TypeSpecifierContext::createTruthy(), $defaultHandleFunctions); - return $this->filterBySpecifiedTypes($specifiedTypes); - } - - public function filterByFalseyValue(Expr $expr, bool $defaultHandleFunctions = false): self - { - $specifiedTypes = $this->typeSpecifier->specifyTypesInCondition($this, $expr, TypeSpecifierContext::createFalsey(), $defaultHandleFunctions); - return $this->filterBySpecifiedTypes($specifiedTypes); - } - - public function filterBySpecifiedTypes(SpecifiedTypes $specifiedTypes): self - { - $typeSpecifications = []; - foreach ($specifiedTypes->getSureTypes() as $exprString => [$expr, $type]) { - $typeSpecifications[] = [ - 'sure' => true, - 'exprString' => $exprString, - 'expr' => $expr, - 'type' => $type, - ]; - } - foreach ($specifiedTypes->getSureNotTypes() as $exprString => [$expr, $type]) { - $typeSpecifications[] = [ - 'sure' => false, - 'exprString' => $exprString, - 'expr' => $expr, - 'type' => $type, - ]; - } - - usort($typeSpecifications, static function (array $a, array $b): int { - $length = strlen((string) $a['exprString']) - strlen((string) $b['exprString']); - if ($length !== 0) { - return $length; - } - - return $b['sure'] - $a['sure']; - }); - - $scope = $this; - foreach ($typeSpecifications as $typeSpecification) { - $expr = $typeSpecification['expr']; - $type = $typeSpecification['type']; - if ($typeSpecification['sure']) { - if (!$specifiedTypes->shouldOverwrite()) { - $type = TypeCombinator::intersect($type, $this->getType($expr)); - } - $scope = $scope->specifyExpressionType($expr, $type); - } else { - $scope = $scope->removeTypeFromExpression($expr, $type); - } - } - - return $scope; - } - - public function enterNegation(): self - { - return $this->scopeFactory->create( - $this->context, - $this->isDeclareStrictTypes(), - $this->getFunction(), - $this->getNamespace(), - $this->getVariableTypes(), - $this->moreSpecificTypes, - $this->inClosureBindScopeClass, - $this->getAnonymousFunctionReturnType(), - $this->getInFunctionCall(), - !$this->isNegated(), - $this->inFirstLevelStatement - ); - } - - public function exitFirstLevelStatements(): self - { - return $this->scopeFactory->create( - $this->context, - $this->isDeclareStrictTypes(), - $this->getFunction(), - $this->getNamespace(), - $this->getVariableTypes(), - $this->moreSpecificTypes, - $this->inClosureBindScopeClass, - $this->getAnonymousFunctionReturnType(), - $this->getInFunctionCall(), - $this->isNegated(), - false, - $this->currentlyAssignedExpressions - ); - } - - public function isInFirstLevelStatement(): bool - { - return $this->inFirstLevelStatement; - } - - public function isNegated(): bool - { - return $this->negated; - } - - /** - * @phpcsSuppress SlevomatCodingStandard.Classes.UnusedPrivateElements.UnusedMethod - * @param Type[] $types - * @return self - */ - private function addMoreSpecificTypes(array $types): self - { - $moreSpecificTypeHolders = $this->moreSpecificTypes; - foreach ($types as $exprString => $type) { - $moreSpecificTypeHolders[$exprString] = VariableTypeHolder::createYes($type); - } - - return $this->scopeFactory->create( - $this->context, - $this->isDeclareStrictTypes(), - $this->getFunction(), - $this->getNamespace(), - $this->getVariableTypes(), - $moreSpecificTypeHolders, - $this->inClosureBindScopeClass, - $this->getAnonymousFunctionReturnType(), - $this->getInFunctionCall(), - $this->isNegated(), - $this->inFirstLevelStatement, - $this->currentlyAssignedExpressions - ); - } - - public function mergeWith(?self $otherScope): self - { - if ($otherScope === null) { - return $this; - } - - return $this->scopeFactory->create( - $this->context, - $this->isDeclareStrictTypes(), - $this->getFunction(), - $this->getNamespace(), - $this->mergeVariableHolders($this->getVariableTypes(), $otherScope->getVariableTypes()), - $this->mergeVariableHolders($this->moreSpecificTypes, $otherScope->moreSpecificTypes), - $this->inClosureBindScopeClass, - $this->getAnonymousFunctionReturnType(), - $this->getInFunctionCall(), - $this->isNegated(), - $this->inFirstLevelStatement - ); - } - - /** - * @param VariableTypeHolder[] $ourVariableTypeHolders - * @param VariableTypeHolder[] $theirVariableTypeHolders - * @return VariableTypeHolder[] - */ - private function mergeVariableHolders(array $ourVariableTypeHolders, array $theirVariableTypeHolders): array - { - $intersectedVariableTypeHolders = []; - foreach ($ourVariableTypeHolders as $name => $variableTypeHolder) { - if (isset($theirVariableTypeHolders[$name])) { - $intersectedVariableTypeHolders[$name] = $variableTypeHolder->and($theirVariableTypeHolders[$name]); - } else { - $intersectedVariableTypeHolders[$name] = VariableTypeHolder::createMaybe($variableTypeHolder->getType()); - } - } - - foreach ($theirVariableTypeHolders as $name => $variableTypeHolder) { - if (isset($intersectedVariableTypeHolders[$name])) { - continue; - } - - $intersectedVariableTypeHolders[$name] = VariableTypeHolder::createMaybe($variableTypeHolder->getType()); - } - - return $intersectedVariableTypeHolders; - } - - public function processFinallyScope(self $finallyScope, self $originalFinallyScope): self - { - return $this->scopeFactory->create( - $this->context, - $this->isDeclareStrictTypes(), - $this->getFunction(), - $this->getNamespace(), - $this->processFinallyScopeVariableTypeHolders( - $this->getVariableTypes(), - $finallyScope->getVariableTypes(), - $originalFinallyScope->getVariableTypes() - ), - $this->processFinallyScopeVariableTypeHolders( - $this->moreSpecificTypes, - $finallyScope->moreSpecificTypes, - $originalFinallyScope->moreSpecificTypes - ), - $this->inClosureBindScopeClass, - $this->getAnonymousFunctionReturnType(), - $this->getInFunctionCall(), - $this->isNegated(), - $this->inFirstLevelStatement - ); - } - - /** - * @param VariableTypeHolder[] $ourVariableTypeHolders - * @param VariableTypeHolder[] $finallyVariableTypeHolders - * @param VariableTypeHolder[] $originalVariableTypeHolders - * @return VariableTypeHolder[] - */ - private function processFinallyScopeVariableTypeHolders( - array $ourVariableTypeHolders, - array $finallyVariableTypeHolders, - array $originalVariableTypeHolders - ): array - { - foreach ($finallyVariableTypeHolders as $name => $variableTypeHolder) { - if ( - isset($originalVariableTypeHolders[$name]) - && !$originalVariableTypeHolders[$name]->getType()->equals($variableTypeHolder->getType()) - ) { - $ourVariableTypeHolders[$name] = $variableTypeHolder; - continue; - } - - if (isset($originalVariableTypeHolders[$name])) { - continue; - } - - $ourVariableTypeHolders[$name] = $variableTypeHolder; - } - - return $ourVariableTypeHolders; - } - - /** - * @param self $closureScope - * @param self|null $prevScope - * @param Expr\ClosureUse[] $byRefUses - * @return self - */ - public function processClosureScope( - self $closureScope, - ?self $prevScope, - array $byRefUses - ): self - { - $variableTypes = $this->variableTypes; - foreach ($byRefUses as $use) { - if (!is_string($use->var->name)) { - throw new \PHPStan\ShouldNotHappenException(); - } - - $variableName = $use->var->name; - - if (!$closureScope->hasVariableType($variableName)->yes()) { - $variableTypes[$variableName] = VariableTypeHolder::createYes(new NullType()); - continue; - } - - $variableType = $closureScope->getVariableType($variableName); - - if ($prevScope !== null) { - $prevVariableType = $prevScope->getVariableType($variableName); - if (!$variableType->equals($prevVariableType)) { - $variableType = TypeCombinator::union($variableType, $prevVariableType); - $variableType = self::generalizeType($variableType, $prevVariableType); - } - } - - $variableTypes[$variableName] = VariableTypeHolder::createYes($variableType); - } - - return $this->scopeFactory->create( - $this->context, - $this->isDeclareStrictTypes(), - $this->getFunction(), - $this->getNamespace(), - $variableTypes, - [], - $this->inClosureBindScopeClass, - $this->getAnonymousFunctionReturnType(), - $this->getInFunctionCall(), - $this->isNegated(), - $this->inFirstLevelStatement - ); - } - - public function processAlwaysIterableForeachScopeWithoutPollute(self $finalScope): self - { - $variableTypeHolders = $this->variableTypes; - foreach ($finalScope->variableTypes as $name => $variableTypeHolder) { - if (!isset($variableTypeHolders[$name])) { - $variableTypeHolders[$name] = VariableTypeHolder::createMaybe($variableTypeHolder->getType()); - continue; - } - - $variableTypeHolders[$name] = new VariableTypeHolder( - $variableTypeHolder->getType(), - $variableTypeHolder->getCertainty()->and($variableTypeHolders[$name]->getCertainty()) - ); - } - - $moreSpecificTypes = $this->moreSpecificTypes; - foreach ($finalScope->moreSpecificTypes as $exprString => $variableTypeHolder) { - if (!isset($moreSpecificTypes[$exprString])) { - $moreSpecificTypes[$exprString] = VariableTypeHolder::createMaybe($variableTypeHolder->getType()); - continue; - } - - $moreSpecificTypes[$exprString] = new VariableTypeHolder( - $variableTypeHolder->getType(), - $variableTypeHolder->getCertainty()->and($moreSpecificTypes[$exprString]->getCertainty()) - ); - } - - return $this->scopeFactory->create( - $this->context, - $this->isDeclareStrictTypes(), - $this->getFunction(), - $this->getNamespace(), - $variableTypeHolders, - $moreSpecificTypes, - $this->inClosureBindScopeClass, - $this->getAnonymousFunctionReturnType(), - $this->getInFunctionCall(), - $this->isNegated(), - $this->inFirstLevelStatement - ); - } - - public function generalizeWith(self $otherScope): self - { - $variableTypeHolders = $this->generalizeVariableTypeHolders( - $this->getVariableTypes(), - $otherScope->getVariableTypes() - ); - - $moreSpecificTypes = $this->generalizeVariableTypeHolders( - $this->moreSpecificTypes, - $otherScope->moreSpecificTypes - ); - - return $this->scopeFactory->create( - $this->context, - $this->isDeclareStrictTypes(), - $this->getFunction(), - $this->getNamespace(), - $variableTypeHolders, - $moreSpecificTypes, - $this->inClosureBindScopeClass, - $this->getAnonymousFunctionReturnType(), - $this->getInFunctionCall(), - $this->isNegated(), - $this->inFirstLevelStatement - ); - } - - /** - * @param VariableTypeHolder[] $variableTypeHolders - * @param VariableTypeHolder[] $otherVariableTypeHolders - * @return VariableTypeHolder[] - */ - private function generalizeVariableTypeHolders( - array $variableTypeHolders, - array $otherVariableTypeHolders - ): array - { - foreach ($variableTypeHolders as $name => $variableTypeHolder) { - if (!isset($otherVariableTypeHolders[$name])) { - continue; - } - - $variableTypeHolders[$name] = new VariableTypeHolder( - self::generalizeType($variableTypeHolder->getType(), $otherVariableTypeHolders[$name]->getType()), - $variableTypeHolder->getCertainty() - ); - } - - return $variableTypeHolders; - } - - private function generalizeType(Type $a, Type $b): Type - { - if ($a->equals($b)) { - return $a; - } - - $constantIntegers = ['a' => [], 'b' => []]; - $constantFloats = ['a' => [], 'b' => []]; - $constantBooleans = ['a' => [], 'b' => []]; - $constantStrings = ['a' => [], 'b' => []]; - $constantArrays = ['a' => [], 'b' => []]; - $generalArrays = ['a' => [], 'b' => []]; - $otherTypes = []; - - foreach ([ - 'a' => TypeUtils::flattenTypes($a), - 'b' => TypeUtils::flattenTypes($b), - ] as $key => $types) { - foreach ($types as $type) { - if ($type instanceof ConstantIntegerType) { - $constantIntegers[$key][] = $type; - continue; - } - if ($type instanceof ConstantFloatType) { - $constantFloats[$key][] = $type; - continue; - } - if ($type instanceof ConstantBooleanType) { - $constantBooleans[$key][] = $type; - continue; - } - if ($type instanceof ConstantStringType) { - $constantStrings[$key][] = $type; - continue; - } - if ($type instanceof ConstantArrayType) { - $constantArrays[$key][] = $type; - continue; - } - if ($type instanceof ArrayType) { - $generalArrays[$key][] = $type; - continue; - } - - $otherTypes[] = $type; - } - } - - $resultTypes = []; - foreach ([ - $constantIntegers, - $constantFloats, - $constantBooleans, - $constantStrings, - ] as $constantTypes) { - if (count($constantTypes['a']) === 0) { - continue; - } - if (count($constantTypes['b']) === 0) { - $resultTypes[] = TypeCombinator::union(...$constantTypes['a']); - continue; - } - - $aTypes = TypeCombinator::union(...$constantTypes['a']); - $bTypes = TypeCombinator::union(...$constantTypes['b']); - if ($aTypes->equals($bTypes)) { - $resultTypes[] = $aTypes; - continue; - } - - $resultTypes[] = TypeUtils::generalizeType($constantTypes['a'][0]); - } - - if (count($constantArrays['a']) > 0) { - if (count($constantArrays['b']) === 0) { - $resultTypes[] = TypeCombinator::union(...$constantArrays['a']); - } else { - $constantArraysA = TypeCombinator::union(...$constantArrays['a']); - $constantArraysB = TypeCombinator::union(...$constantArrays['b']); - if ($constantArraysA->getIterableKeyType()->equals($constantArraysB->getIterableKeyType())) { - $resultArrayBuilder = ConstantArrayTypeBuilder::createEmpty(); - foreach (TypeUtils::flattenTypes($constantArraysA->getIterableKeyType()) as $keyType) { - $resultArrayBuilder->setOffsetValueType( - $keyType, - self::generalizeType( - $constantArraysA->getOffsetValueType($keyType), - $constantArraysB->getOffsetValueType($keyType) - ) - ); - } - - $resultTypes[] = $resultArrayBuilder->getArray(); - } else { - $resultTypes[] = new ArrayType( - TypeCombinator::union(self::generalizeType($constantArraysA->getIterableKeyType(), $constantArraysB->getIterableKeyType())), - TypeCombinator::union(self::generalizeType($constantArraysA->getIterableValueType(), $constantArraysB->getIterableValueType())) - ); - } - } - } - - if (count($generalArrays['a']) > 0) { - if (count($generalArrays['b']) === 0) { - $resultTypes[] = TypeCombinator::union(...$generalArrays['a']); - } else { - $generalArraysA = TypeCombinator::union(...$generalArrays['a']); - $generalArraysB = TypeCombinator::union(...$generalArrays['b']); - - $aValueType = $generalArraysA->getIterableValueType(); - $bValueType = $generalArraysB->getIterableValueType(); - $aArrays = TypeUtils::getAnyArrays($aValueType); - $bArrays = TypeUtils::getAnyArrays($bValueType); - if ( - count($aArrays) === 1 - && !$aArrays[0] instanceof ConstantArrayType - && count($bArrays) === 1 - && !$bArrays[0] instanceof ConstantArrayType - ) { - $aDepth = $this->getArrayDepth($aArrays[0]); - $bDepth = $this->getArrayDepth($bArrays[0]); - if ( - ($aDepth > 2 || $bDepth > 2) - && abs($aDepth - $bDepth) > 0 - ) { - $aValueType = new MixedType(); - $bValueType = new MixedType(); - } - } - - $resultTypes[] = new ArrayType( - TypeCombinator::union(self::generalizeType($generalArraysA->getIterableKeyType(), $generalArraysB->getIterableKeyType())), - TypeCombinator::union(self::generalizeType($aValueType, $bValueType)) - ); - } - } - - return TypeCombinator::union(...$resultTypes, ...$otherTypes); - } - - private function getArrayDepth(ArrayType $type): int - { - $depth = 0; - while ($type instanceof ArrayType) { - $temp = $type->getIterableValueType(); - $arrays = TypeUtils::getAnyArrays($temp); - if (count($arrays) === 1) { - $type = $arrays[0]; - } else { - $type = $temp; - } - $depth++; - } - - return $depth; - } - - public function equals(self $otherScope): bool - { - if (!$this->context->equals($otherScope->context)) { - return false; - } - - if (!$this->compareVariableTypeHolders($this->variableTypes, $otherScope->variableTypes)) { - return false; - } - - return $this->compareVariableTypeHolders($this->moreSpecificTypes, $otherScope->moreSpecificTypes); - } - - /** - * @param VariableTypeHolder[] $variableTypeHolders - * @param VariableTypeHolder[] $otherVariableTypeHolders - * @return bool - */ - private function compareVariableTypeHolders(array $variableTypeHolders, array $otherVariableTypeHolders): bool - { - foreach ($variableTypeHolders as $name => $variableTypeHolder) { - if (!isset($otherVariableTypeHolders[$name])) { - return false; - } - - if (!$variableTypeHolder->getCertainty()->equals($otherVariableTypeHolders[$name]->getCertainty())) { - return false; - } - - if (!$variableTypeHolder->getType()->equals($otherVariableTypeHolders[$name]->getType())) { - return false; - } - - unset($otherVariableTypeHolders[$name]); - } - - return count($otherVariableTypeHolders) === 0; - } - - public function canAccessProperty(PropertyReflection $propertyReflection): bool - { - return $this->canAccessClassMember($propertyReflection); - } - - public function canCallMethod(MethodReflection $methodReflection): bool - { - if ($this->canAccessClassMember($methodReflection)) { - return true; - } - - return $this->canAccessClassMember($methodReflection->getPrototype()); - } - - public function canAccessConstant(ConstantReflection $constantReflection): bool - { - return $this->canAccessClassMember($constantReflection); - } - - private function canAccessClassMember(ClassMemberReflection $classMemberReflection): bool - { - if ($classMemberReflection->isPublic()) { - return true; - } - - if ($this->inClosureBindScopeClass !== null && $this->broker->hasClass($this->inClosureBindScopeClass)) { - $currentClassReflection = $this->broker->getClass($this->inClosureBindScopeClass); - } elseif ($this->isInClass()) { - $currentClassReflection = $this->getClassReflection(); - } else { - return false; - } - - $classReflectionName = $classMemberReflection->getDeclaringClass()->getName(); - if ($classMemberReflection->isPrivate()) { - return $currentClassReflection->getName() === $classReflectionName; - } - - // protected - - if ( - $currentClassReflection->getName() === $classReflectionName - || $currentClassReflection->isSubclassOf($classReflectionName) - ) { - return true; - } - - return $classMemberReflection->getDeclaringClass()->isSubclassOf($currentClassReflection->getName()); - } - - /** - * @return string[] - */ - public function debug(): array - { - $descriptions = []; - foreach ($this->getVariableTypes() as $name => $variableTypeHolder) { - $key = sprintf('$%s (%s)', $name, $variableTypeHolder->getCertainty()->describe()); - $descriptions[$key] = $variableTypeHolder->getType()->describe(VerbosityLevel::precise()); - } - foreach ($this->moreSpecificTypes as $exprString => $typeHolder) { - $key = sprintf( - '%s-specified (%s)', - $exprString, - $typeHolder->getCertainty()->describe() - ); - $descriptions[$key] = $typeHolder->getType()->describe(VerbosityLevel::precise()); - } - - return $descriptions; - } - -} diff --git a/vendor/phpstan/phpstan/src/Analyser/ScopeContext.php b/vendor/phpstan/phpstan/src/Analyser/ScopeContext.php deleted file mode 100644 index a157e1a..0000000 --- a/vendor/phpstan/phpstan/src/Analyser/ScopeContext.php +++ /dev/null @@ -1,103 +0,0 @@ -file = $file; - $this->classReflection = $classReflection; - $this->traitReflection = $traitReflection; - } - - public static function create(string $file): self - { - return new self($file, null, null); - } - - public function beginFile(): self - { - return new self($this->file, null, null); - } - - public function enterClass(ClassReflection $classReflection): self - { - if ($this->classReflection !== null && !$classReflection->isAnonymous()) { - throw new \PHPStan\ShouldNotHappenException(); - } - if ($classReflection->isTrait()) { - throw new \PHPStan\ShouldNotHappenException(); - } - return new self($this->file, $classReflection, null); - } - - public function enterTrait(ClassReflection $traitReflection): self - { - if ($this->classReflection === null) { - throw new \PHPStan\ShouldNotHappenException(); - } - if (!$traitReflection->isTrait()) { - throw new \PHPStan\ShouldNotHappenException(); - } - - return new self($this->file, $this->classReflection, $traitReflection); - } - - public function equals(self $otherContext): bool - { - if ($this->file !== $otherContext->file) { - return false; - } - - if ($this->getClassReflection() === null) { - return $otherContext->getClassReflection() === null; - } elseif ($otherContext->getClassReflection() === null) { - return false; - } - - $isSameClass = $this->getClassReflection()->getName() === $otherContext->getClassReflection()->getName(); - - if ($this->getTraitReflection() === null) { - return $otherContext->getTraitReflection() === null && $isSameClass; - } elseif ($otherContext->getTraitReflection() === null) { - return false; - } - - $isSameTrait = $this->getTraitReflection()->getName() === $otherContext->getTraitReflection()->getName(); - - return $isSameClass && $isSameTrait; - } - - public function getFile(): string - { - return $this->file; - } - - public function getClassReflection(): ?ClassReflection - { - return $this->classReflection; - } - - public function getTraitReflection(): ?ClassReflection - { - return $this->traitReflection; - } - -} diff --git a/vendor/phpstan/phpstan/src/Analyser/ScopeFactory.php b/vendor/phpstan/phpstan/src/Analyser/ScopeFactory.php deleted file mode 100644 index ac5b336..0000000 --- a/vendor/phpstan/phpstan/src/Analyser/ScopeFactory.php +++ /dev/null @@ -1,107 +0,0 @@ -scopeClass = $scopeClass; - $this->broker = $broker; - $this->printer = $printer; - $this->typeSpecifier = $typeSpecifier; - $this->propertyReflectionFinder = $propertyReflectionFinder; - $this->dynamicConstantNames = $container->getParameter('dynamicConstantNames'); - } - - /** - * @param \PHPStan\Analyser\ScopeContext $context - * @param bool $declareStrictTypes - * @param \PHPStan\Reflection\FunctionReflection|\PHPStan\Reflection\MethodReflection|null $function - * @param string|null $namespace - * @param \PHPStan\Analyser\VariableTypeHolder[] $variablesTypes - * @param \PHPStan\Analyser\VariableTypeHolder[] $moreSpecificTypes - * @param string|null $inClosureBindScopeClass - * @param \PHPStan\Type\Type|null $inAnonymousFunctionReturnType - * @param \PhpParser\Node\Expr\FuncCall|\PhpParser\Node\Expr\MethodCall|\PhpParser\Node\Expr\StaticCall|null $inFunctionCall - * @param bool $negated - * @param bool $inFirstLevelStatement - * @param array $currentlyAssignedExpressions - * - * @return Scope - */ - public function create( - ScopeContext $context, - bool $declareStrictTypes = false, - $function = null, - ?string $namespace = null, - array $variablesTypes = [], - array $moreSpecificTypes = [], - ?string $inClosureBindScopeClass = null, - ?Type $inAnonymousFunctionReturnType = null, - ?Expr $inFunctionCall = null, - bool $negated = false, - bool $inFirstLevelStatement = true, - array $currentlyAssignedExpressions = [] - ): Scope - { - $scopeClass = $this->scopeClass; - if (!is_a($scopeClass, Scope::class, true)) { - throw new \PHPStan\ShouldNotHappenException(); - } - - return new $scopeClass( - $this, - $this->broker, - $this->printer, - $this->typeSpecifier, - $this->propertyReflectionFinder, - $context, - $declareStrictTypes, - $function, - $namespace, - $variablesTypes, - $moreSpecificTypes, - $inClosureBindScopeClass, - $inAnonymousFunctionReturnType, - $inFunctionCall, - $negated, - $inFirstLevelStatement, - $currentlyAssignedExpressions, - $this->dynamicConstantNames - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/Analyser/SpecifiedTypes.php b/vendor/phpstan/phpstan/src/Analyser/SpecifiedTypes.php deleted file mode 100644 index a82d4cf..0000000 --- a/vendor/phpstan/phpstan/src/Analyser/SpecifiedTypes.php +++ /dev/null @@ -1,116 +0,0 @@ -sureTypes = $sureTypes; - $this->sureNotTypes = $sureNotTypes; - $this->overwrite = $overwrite; - } - - /** - * @return mixed[] - */ - public function getSureTypes(): array - { - return $this->sureTypes; - } - - /** - * @return mixed[] - */ - public function getSureNotTypes(): array - { - return $this->sureNotTypes; - } - - public function shouldOverwrite(): bool - { - return $this->overwrite; - } - - public function intersectWith(SpecifiedTypes $other): self - { - $sureTypeUnion = []; - $sureNotTypeUnion = []; - - foreach ($this->sureTypes as $exprString => [$exprNode, $type]) { - if (!isset($other->sureTypes[$exprString])) { - continue; - } - - $sureTypeUnion[$exprString] = [ - $exprNode, - TypeCombinator::union($type, $other->sureTypes[$exprString][1]), - ]; - } - - foreach ($this->sureNotTypes as $exprString => [$exprNode, $type]) { - if (!isset($other->sureNotTypes[$exprString])) { - continue; - } - - $sureNotTypeUnion[$exprString] = [ - $exprNode, - TypeCombinator::intersect($type, $other->sureNotTypes[$exprString][1]), - ]; - } - - return new self($sureTypeUnion, $sureNotTypeUnion); - } - - public function unionWith(SpecifiedTypes $other): self - { - $sureTypeUnion = $this->sureTypes + $other->sureTypes; - $sureNotTypeUnion = $this->sureNotTypes + $other->sureNotTypes; - - foreach ($this->sureTypes as $exprString => [$exprNode, $type]) { - if (!isset($other->sureTypes[$exprString])) { - continue; - } - - $sureTypeUnion[$exprString] = [ - $exprNode, - TypeCombinator::intersect($type, $other->sureTypes[$exprString][1]), - ]; - } - - foreach ($this->sureNotTypes as $exprString => [$exprNode, $type]) { - if (!isset($other->sureNotTypes[$exprString])) { - continue; - } - - $sureNotTypeUnion[$exprString] = [ - $exprNode, - TypeCombinator::union($type, $other->sureNotTypes[$exprString][1]), - ]; - } - - return new self($sureTypeUnion, $sureNotTypeUnion); - } - -} diff --git a/vendor/phpstan/phpstan/src/Analyser/StatementExitPoint.php b/vendor/phpstan/phpstan/src/Analyser/StatementExitPoint.php deleted file mode 100644 index 9c982d6..0000000 --- a/vendor/phpstan/phpstan/src/Analyser/StatementExitPoint.php +++ /dev/null @@ -1,32 +0,0 @@ -statement = $statement; - $this->scope = $scope; - } - - public function getStatement(): Stmt - { - return $this->statement; - } - - public function getScope(): Scope - { - return $this->scope; - } - -} diff --git a/vendor/phpstan/phpstan/src/Analyser/StatementResult.php b/vendor/phpstan/phpstan/src/Analyser/StatementResult.php deleted file mode 100644 index 2152e84..0000000 --- a/vendor/phpstan/phpstan/src/Analyser/StatementResult.php +++ /dev/null @@ -1,101 +0,0 @@ -scope = $scope; - $this->hasYield = $hasYield; - $this->isAlwaysTerminating = $isAlwaysTerminating; - $this->exitPoints = $exitPoints; - } - - public function getScope(): Scope - { - return $this->scope; - } - - public function hasYield(): bool - { - return $this->hasYield; - } - - public function isAlwaysTerminating(): bool - { - return $this->isAlwaysTerminating; - } - - public function filterOutLoopExitPoints(): self - { - if (!$this->isAlwaysTerminating) { - return $this; - } - - foreach ($this->exitPoints as $exitPoint) { - $statement = $exitPoint->getStatement(); - if ( - $statement instanceof Stmt\Break_ - || $statement instanceof Stmt\Continue_ - ) { - return new self($this->scope, $this->hasYield, false, $this->exitPoints); - } - } - - return $this; - } - - /** - * @return StatementExitPoint[] - */ - public function getExitPoints(): array - { - return $this->exitPoints; - } - - /** - * @param string $stmtClass - * @return StatementExitPoint[] - */ - public function getExitPointsByType(string $stmtClass): array - { - $exitPoints = []; - foreach ($this->exitPoints as $exitPoint) { - if (!$exitPoint->getStatement() instanceof $stmtClass) { - continue; - } - - $exitPoints[] = $exitPoint; - } - - return $exitPoints; - } - -} diff --git a/vendor/phpstan/phpstan/src/Analyser/TypeSpecifier.php b/vendor/phpstan/phpstan/src/Analyser/TypeSpecifier.php deleted file mode 100644 index 850ce7b..0000000 --- a/vendor/phpstan/phpstan/src/Analyser/TypeSpecifier.php +++ /dev/null @@ -1,660 +0,0 @@ -printer = $printer; - $this->broker = $broker; - - foreach (array_merge($functionTypeSpecifyingExtensions, $methodTypeSpecifyingExtensions, $staticMethodTypeSpecifyingExtensions) as $extension) { - if (!($extension instanceof TypeSpecifierAwareExtension)) { - continue; - } - - $extension->setTypeSpecifier($this); - } - - $this->functionTypeSpecifyingExtensions = $functionTypeSpecifyingExtensions; - $this->methodTypeSpecifyingExtensions = $methodTypeSpecifyingExtensions; - $this->staticMethodTypeSpecifyingExtensions = $staticMethodTypeSpecifyingExtensions; - } - - public function specifyTypesInCondition( - Scope $scope, - Expr $expr, - TypeSpecifierContext $context, - bool $defaultHandleFunctions = false - ): SpecifiedTypes - { - if ($expr instanceof Instanceof_) { - $exprNode = $expr->expr; - if ($exprNode instanceof Expr\Assign) { - $exprNode = $exprNode->var; - } - if ($expr->class instanceof Name) { - $className = (string) $expr->class; - $lowercasedClassName = strtolower($className); - if ($lowercasedClassName === 'self' && $scope->isInClass()) { - $type = new ObjectType($scope->getClassReflection()->getName()); - } elseif ($lowercasedClassName === 'static' && $scope->isInClass()) { - $type = new StaticType($scope->getClassReflection()->getName()); - } elseif ($lowercasedClassName === 'parent') { - if ( - $scope->isInClass() - && $scope->getClassReflection()->getParentClass() !== false - ) { - $type = new ObjectType($scope->getClassReflection()->getParentClass()->getName()); - } else { - $type = new NonexistentParentClassType(); - } - } else { - $type = new ObjectType($className); - } - return $this->create($exprNode, $type, $context); - } - - if ($context->true()) { - return $this->create($exprNode, new ObjectWithoutClassType(), $context); - } - } elseif ($expr instanceof Node\Expr\BinaryOp\Identical) { - $expressions = $this->findTypeExpressionsFromBinaryOperation($scope, $expr); - if ($expressions !== null) { - /** @var Expr $exprNode */ - $exprNode = $expressions[0]; - if ($exprNode instanceof Expr\Assign) { - $exprNode = $exprNode->var; - } - /** @var \PHPStan\Type\ConstantScalarType $constantType */ - $constantType = $expressions[1]; - if ($constantType->getValue() === false) { - $types = $this->create($exprNode, $constantType, $context); - return $types->unionWith($this->specifyTypesInCondition( - $scope, - $exprNode, - $context->true() ? TypeSpecifierContext::createFalse() : TypeSpecifierContext::createFalse()->negate() - )); - } - - if ($constantType->getValue() === true) { - $types = $this->create($exprNode, $constantType, $context); - return $types->unionWith($this->specifyTypesInCondition( - $scope, - $exprNode, - $context->true() ? TypeSpecifierContext::createTrue() : TypeSpecifierContext::createTrue()->negate() - )); - } - - if ($constantType->getValue() === null) { - return $this->create($exprNode, $constantType, $context); - } - - if ( - !$context->null() - && $exprNode instanceof FuncCall - && count($exprNode->args) === 1 - && $exprNode->name instanceof Name - && strtolower((string) $exprNode->name) === 'count' - && $constantType instanceof ConstantIntegerType - ) { - if ($context->truthy() || $constantType->getValue() === 0) { - $newContext = $context; - if ($constantType->getValue() === 0) { - $newContext = $newContext->negate(); - } - $argType = $scope->getType($exprNode->args[0]->value); - if ((new ArrayType(new MixedType(), new MixedType()))->isSuperTypeOf($argType)->yes()) { - return $this->create($exprNode->args[0]->value, new NonEmptyArrayType(), $newContext); - } - } - } - } - - if ($context->true()) { - $type = TypeCombinator::intersect($scope->getType($expr->right), $scope->getType($expr->left)); - $leftTypes = $this->create($expr->left, $type, $context); - $rightTypes = $this->create($expr->right, $type, $context); - return $leftTypes->unionWith($rightTypes); - - } elseif ($context->false()) { - $identicalType = $scope->getType($expr); - if ($identicalType instanceof ConstantBooleanType) { - $never = new NeverType(); - $contextForTypes = $identicalType->getValue() ? $context->negate() : $context; - $leftTypes = $this->create($expr->left, $never, $contextForTypes); - $rightTypes = $this->create($expr->right, $never, $contextForTypes); - return $leftTypes->unionWith($rightTypes); - } - - if ( - ( - $expr->left instanceof Node\Scalar - || $expr->left instanceof Expr\Array_ - ) - && !$expr->right instanceof Node\Scalar - ) { - return $this->create( - $expr->right, - $scope->getType($expr->left), - $context - ); - } - if ( - ( - $expr->right instanceof Node\Scalar - || $expr->right instanceof Expr\Array_ - ) - && !$expr->left instanceof Node\Scalar - ) { - return $this->create( - $expr->left, - $scope->getType($expr->right), - $context - ); - } - } - - } elseif ($expr instanceof Node\Expr\BinaryOp\NotIdentical) { - return $this->specifyTypesInCondition( - $scope, - new Node\Expr\BooleanNot(new Node\Expr\BinaryOp\Identical($expr->left, $expr->right)), - $context - ); - } elseif ($expr instanceof Node\Expr\BinaryOp\Equal) { - $expressions = $this->findTypeExpressionsFromBinaryOperation($scope, $expr); - if ($expressions !== null) { - /** @var Expr $exprNode */ - $exprNode = $expressions[0]; - /** @var \PHPStan\Type\ConstantScalarType $constantType */ - $constantType = $expressions[1]; - if ($constantType->getValue() === false || $constantType->getValue() === null) { - return $this->specifyTypesInCondition( - $scope, - $exprNode, - $context->true() ? TypeSpecifierContext::createFalsey() : TypeSpecifierContext::createFalsey()->negate() - ); - } - - if ($constantType->getValue() === true) { - return $this->specifyTypesInCondition( - $scope, - $exprNode, - $context->true() ? TypeSpecifierContext::createTruthy() : TypeSpecifierContext::createTruthy()->negate() - ); - } - } - - $leftType = $scope->getType($expr->left); - $leftBooleanType = $leftType->toBoolean(); - $rightType = $scope->getType($expr->right); - if ($leftBooleanType instanceof ConstantBooleanType && $rightType instanceof BooleanType) { - return $this->specifyTypesInCondition( - $scope, - new Expr\BinaryOp\Identical( - new ConstFetch(new Name($leftBooleanType->getValue() ? 'true' : 'false')), - $expr->right - ), - $context - ); - } - - $rightBooleanType = $rightType->toBoolean(); - if ($rightBooleanType instanceof ConstantBooleanType && $leftType instanceof BooleanType) { - return $this->specifyTypesInCondition( - $scope, - new Expr\BinaryOp\Identical( - $expr->left, - new ConstFetch(new Name($rightBooleanType->getValue() ? 'true' : 'false')) - ), - $context - ); - } - - if ( - $expr->left instanceof FuncCall - && $expr->left->name instanceof Name - && strtolower($expr->left->name->toString()) === 'get_class' - && isset($expr->left->args[0]) - && $rightType instanceof ConstantStringType - ) { - return $this->specifyTypesInCondition( - $scope, - new Instanceof_( - $expr->left->args[0]->value, - new Name($rightType->getValue()) - ), - $context - ); - } - - if ( - $expr->right instanceof FuncCall - && $expr->right->name instanceof Name - && strtolower($expr->right->name->toString()) === 'get_class' - && isset($expr->right->args[0]) - && $leftType instanceof ConstantStringType - ) { - return $this->specifyTypesInCondition( - $scope, - new Instanceof_( - $expr->right->args[0]->value, - new Name($leftType->getValue()) - ), - $context - ); - } - } elseif ($expr instanceof Node\Expr\BinaryOp\NotEqual) { - return $this->specifyTypesInCondition( - $scope, - new Node\Expr\BooleanNot(new Node\Expr\BinaryOp\Equal($expr->left, $expr->right)), - $context - ); - } elseif ($expr instanceof FuncCall && $expr->name instanceof Name) { - if ($this->broker->hasFunction($expr->name, $scope)) { - $functionReflection = $this->broker->getFunction($expr->name, $scope); - foreach ($this->getFunctionTypeSpecifyingExtensions() as $extension) { - if (!$extension->isFunctionSupported($functionReflection, $expr, $context)) { - continue; - } - - return $extension->specifyTypes($functionReflection, $expr, $scope, $context); - } - } - - if ($defaultHandleFunctions) { - return $this->handleDefaultTruthyOrFalseyContext($context, $expr); - } - } elseif ($expr instanceof MethodCall && $expr->name instanceof Node\Identifier) { - $methodCalledOnType = $scope->getType($expr->var); - $referencedClasses = TypeUtils::getDirectClassNames($methodCalledOnType); - if ( - count($referencedClasses) === 1 - && $this->broker->hasClass($referencedClasses[0]) - ) { - $methodClassReflection = $this->broker->getClass($referencedClasses[0]); - if ($methodClassReflection->hasMethod($expr->name->name)) { - $methodReflection = $methodClassReflection->getMethod($expr->name->name, $scope); - foreach ($this->getMethodTypeSpecifyingExtensionsForClass($methodClassReflection->getName()) as $extension) { - if (!$extension->isMethodSupported($methodReflection, $expr, $context)) { - continue; - } - - return $extension->specifyTypes($methodReflection, $expr, $scope, $context); - } - } - } - - if ($defaultHandleFunctions) { - return $this->handleDefaultTruthyOrFalseyContext($context, $expr); - } - } elseif ($expr instanceof StaticCall && $expr->name instanceof Node\Identifier) { - if ($expr->class instanceof Name) { - $calleeType = new ObjectType($scope->resolveName($expr->class)); - } else { - $calleeType = $scope->getType($expr->class); - } - - if ($calleeType->hasMethod($expr->name->name)->yes()) { - $staticMethodReflection = $calleeType->getMethod($expr->name->name, $scope); - $referencedClasses = TypeUtils::getDirectClassNames($calleeType); - if ( - count($referencedClasses) === 1 - && $this->broker->hasClass($referencedClasses[0]) - ) { - $staticMethodClassReflection = $this->broker->getClass($referencedClasses[0]); - foreach ($this->getStaticMethodTypeSpecifyingExtensionsForClass($staticMethodClassReflection->getName()) as $extension) { - if (!$extension->isStaticMethodSupported($staticMethodReflection, $expr, $context)) { - continue; - } - - return $extension->specifyTypes($staticMethodReflection, $expr, $scope, $context); - } - } - } - - if ($defaultHandleFunctions) { - return $this->handleDefaultTruthyOrFalseyContext($context, $expr); - } - } elseif ($expr instanceof BooleanAnd || $expr instanceof LogicalAnd) { - $leftTypes = $this->specifyTypesInCondition($scope, $expr->left, $context); - $rightTypes = $this->specifyTypesInCondition($scope, $expr->right, $context); - return $context->true() ? $leftTypes->unionWith($rightTypes) : $leftTypes->intersectWith($rightTypes); - } elseif ($expr instanceof BooleanOr || $expr instanceof LogicalOr) { - $leftTypes = $this->specifyTypesInCondition($scope, $expr->left, $context); - $rightTypes = $this->specifyTypesInCondition($scope, $expr->right, $context); - return $context->true() ? $leftTypes->intersectWith($rightTypes) : $leftTypes->unionWith($rightTypes); - } elseif ($expr instanceof Node\Expr\BooleanNot && !$context->null()) { - return $this->specifyTypesInCondition($scope, $expr->expr, $context->negate()); - } elseif ($expr instanceof Node\Expr\Assign) { - if ($context->null()) { - return $this->specifyTypesInCondition($scope->exitFirstLevelStatements(), $expr->expr, $context); - } - - return $this->specifyTypesInCondition($scope->exitFirstLevelStatements(), $expr->var, $context); - } elseif ( - ( - $expr instanceof Expr\Isset_ - && count($expr->vars) > 0 - && $context->truthy() - ) - || ($expr instanceof Expr\Empty_ && $context->falsey()) - ) { - $vars = []; - if ($expr instanceof Expr\Isset_) { - $varsToIterate = $expr->vars; - } else { - $varsToIterate = [$expr->expr]; - } - foreach ($varsToIterate as $var) { - $vars[] = $var; - - while ( - $var instanceof ArrayDimFetch - || $var instanceof PropertyFetch - || ( - $var instanceof StaticPropertyFetch - && $var->class instanceof Expr - ) - ) { - if ($var instanceof StaticPropertyFetch) { - /** @var Expr $var */ - $var = $var->class; - } else { - $var = $var->var; - } - $vars[] = $var; - } - } - - if (count($vars) === 0) { - throw new \PHPStan\ShouldNotHappenException(); - } - - $types = null; - foreach ($vars as $var) { - if ($expr instanceof Expr\Isset_) { - if ( - $var instanceof ArrayDimFetch - && $var->dim !== null - && !$scope->getType($var->var) instanceof MixedType - ) { - $type = $this->create( - $var->var, - new HasOffsetType($scope->getType($var->dim)), - $context - )->unionWith( - $this->create($var, new NullType(), TypeSpecifierContext::createFalse()) - ); - } else { - $type = $this->create($var, new NullType(), TypeSpecifierContext::createFalse()); - } - } else { - $type = $this->create( - $var, - new UnionType([ - new NullType(), - new ConstantBooleanType(false), - ]), - TypeSpecifierContext::createFalse() - ); - } - - if ( - $var instanceof PropertyFetch - && $var->name instanceof Node\Identifier - ) { - $type = $type->unionWith($this->create($var->var, new IntersectionType([ - new ObjectWithoutClassType(), - new HasPropertyType($var->name->toString()), - ]), TypeSpecifierContext::createTruthy())); - } elseif ( - $var instanceof StaticPropertyFetch - && $var->class instanceof Expr - && $var->name instanceof Node\VarLikeIdentifier - ) { - $type = $type->unionWith($this->create($var->class, new IntersectionType([ - new ObjectWithoutClassType(), - new HasPropertyType($var->name->toString()), - ]), TypeSpecifierContext::createTruthy())); - } - - if ($types === null) { - $types = $type; - } else { - $types = $types->unionWith($type); - } - } - - if ( - $expr instanceof Expr\Empty_ - && (new ArrayType(new MixedType(), new MixedType()))->isSuperTypeOf($scope->getType($expr->expr))->yes()) { - $types = $types->unionWith( - $this->create($expr->expr, new NonEmptyArrayType(), $context->negate()) - ); - } - - return $types; - } elseif ( - $expr instanceof Expr\Empty_ && $context->truthy() - && (new ArrayType(new MixedType(), new MixedType()))->isSuperTypeOf($scope->getType($expr->expr))->yes() - ) { - return $this->create($expr->expr, new NonEmptyArrayType(), $context->negate()); - } elseif ($expr instanceof Expr\ErrorSuppress) { - return $this->specifyTypesInCondition($scope, $expr->expr, $context, $defaultHandleFunctions); - } elseif (!$context->null()) { - return $this->handleDefaultTruthyOrFalseyContext($context, $expr); - } - - return new SpecifiedTypes(); - } - - private function handleDefaultTruthyOrFalseyContext(TypeSpecifierContext $context, Expr $expr): SpecifiedTypes - { - if (!$context->truthy()) { - $type = new UnionType([new ObjectWithoutClassType(), new NonEmptyArrayType()]); - return $this->create($expr, $type, TypeSpecifierContext::createFalse()); - } elseif (!$context->falsey()) { - $type = new UnionType([ - new NullType(), - new ConstantBooleanType(false), - new ConstantIntegerType(0), - new ConstantFloatType(0.0), - new ConstantStringType(''), - new ConstantArrayType([], []), - ]); - return $this->create($expr, $type, TypeSpecifierContext::createFalse()); - } - - return new SpecifiedTypes(); - } - - /** - * @param \PHPStan\Analyser\Scope $scope - * @param \PhpParser\Node\Expr\BinaryOp $binaryOperation - * @return (Expr|\PHPStan\Type\ConstantScalarType)[]|null - */ - private function findTypeExpressionsFromBinaryOperation(Scope $scope, Node\Expr\BinaryOp $binaryOperation): ?array - { - $leftType = $scope->getType($binaryOperation->left); - $rightType = $scope->getType($binaryOperation->right); - if ( - $leftType instanceof \PHPStan\Type\ConstantScalarType - && !$binaryOperation->right instanceof ConstFetch - && !$binaryOperation->right instanceof Expr\ClassConstFetch - ) { - return [$binaryOperation->right, $leftType]; - } elseif ( - $rightType instanceof \PHPStan\Type\ConstantScalarType - && !$binaryOperation->left instanceof ConstFetch - && !$binaryOperation->left instanceof Expr\ClassConstFetch - ) { - return [$binaryOperation->left, $rightType]; - } - - return null; - } - - public function create( - Expr $expr, - Type $type, - TypeSpecifierContext $context, - bool $overwrite = false - ): SpecifiedTypes - { - if ($expr instanceof New_ || $expr instanceof Instanceof_) { - return new SpecifiedTypes(); - } - - $sureTypes = []; - $sureNotTypes = []; - - $exprString = $this->printer->prettyPrintExpr($expr); - if ($context->false()) { - $sureNotTypes[$exprString] = [$expr, $type]; - } elseif ($context->true()) { - $sureTypes[$exprString] = [$expr, $type]; - } - - return new SpecifiedTypes($sureTypes, $sureNotTypes, $overwrite); - } - - /** - * @return \PHPStan\Type\FunctionTypeSpecifyingExtension[] - */ - private function getFunctionTypeSpecifyingExtensions(): array - { - return $this->functionTypeSpecifyingExtensions; - } - - /** - * @param string $className - * @return \PHPStan\Type\MethodTypeSpecifyingExtension[] - */ - private function getMethodTypeSpecifyingExtensionsForClass(string $className): array - { - if ($this->methodTypeSpecifyingExtensionsByClass === null) { - $byClass = []; - foreach ($this->methodTypeSpecifyingExtensions as $extension) { - $byClass[$extension->getClass()][] = $extension; - } - - $this->methodTypeSpecifyingExtensionsByClass = $byClass; - } - return $this->getTypeSpecifyingExtensionsForType($this->methodTypeSpecifyingExtensionsByClass, $className); - } - - /** - * @param string $className - * @return \PHPStan\Type\StaticMethodTypeSpecifyingExtension[] - */ - private function getStaticMethodTypeSpecifyingExtensionsForClass(string $className): array - { - if ($this->staticMethodTypeSpecifyingExtensionsByClass === null) { - $byClass = []; - foreach ($this->staticMethodTypeSpecifyingExtensions as $extension) { - $byClass[$extension->getClass()][] = $extension; - } - - $this->staticMethodTypeSpecifyingExtensionsByClass = $byClass; - } - return $this->getTypeSpecifyingExtensionsForType($this->staticMethodTypeSpecifyingExtensionsByClass, $className); - } - - /** - * @param \PHPStan\Type\MethodTypeSpecifyingExtension[][]|\PHPStan\Type\StaticMethodTypeSpecifyingExtension[][] $extensions - * @param string $className - * @return mixed[] - */ - private function getTypeSpecifyingExtensionsForType(array $extensions, string $className): array - { - $extensionsForClass = [[]]; - $class = $this->broker->getClass($className); - foreach (array_merge([$className], $class->getParentClassesNames(), $class->getNativeReflection()->getInterfaceNames()) as $extensionClassName) { - if (!isset($extensions[$extensionClassName])) { - continue; - } - - $extensionsForClass[] = $extensions[$extensionClassName]; - } - - return array_merge(...$extensionsForClass); - } - -} diff --git a/vendor/phpstan/phpstan/src/Analyser/TypeSpecifierAwareExtension.php b/vendor/phpstan/phpstan/src/Analyser/TypeSpecifierAwareExtension.php deleted file mode 100644 index 88fc2e4..0000000 --- a/vendor/phpstan/phpstan/src/Analyser/TypeSpecifierAwareExtension.php +++ /dev/null @@ -1,10 +0,0 @@ -value = $value; - } - - private static function create(?int $value): self - { - self::$registry[$value] = self::$registry[$value] ?? new self($value); - return self::$registry[$value]; - } - - public static function createTrue(): self - { - return self::create(self::CONTEXT_TRUE); - } - - public static function createTruthy(): self - { - return self::create(self::CONTEXT_TRUTHY); - } - - public static function createFalse(): self - { - return self::create(self::CONTEXT_FALSE); - } - - public static function createFalsey(): self - { - return self::create(self::CONTEXT_FALSEY); - } - - public static function createNull(): self - { - return self::create(null); - } - - public function negate(): self - { - if ($this->value === null) { - throw new \PHPStan\ShouldNotHappenException(); - } - return self::create(~$this->value); - } - - public function true(): bool - { - return $this->value !== null && (bool) ($this->value & self::CONTEXT_TRUE); - } - - public function truthy(): bool - { - return $this->value !== null && (bool) ($this->value & self::CONTEXT_TRUTHY); - } - - public function false(): bool - { - return $this->value !== null && (bool) ($this->value & self::CONTEXT_FALSE); - } - - public function falsey(): bool - { - return $this->value !== null && (bool) ($this->value & self::CONTEXT_FALSEY); - } - - public function null(): bool - { - return $this->value === null; - } - -} diff --git a/vendor/phpstan/phpstan/src/Analyser/TypeSpecifierFactory.php b/vendor/phpstan/phpstan/src/Analyser/TypeSpecifierFactory.php deleted file mode 100644 index 7046abf..0000000 --- a/vendor/phpstan/phpstan/src/Analyser/TypeSpecifierFactory.php +++ /dev/null @@ -1,52 +0,0 @@ -container = $container; - } - - public function create(): TypeSpecifier - { - $typeSpecifier = new TypeSpecifier( - $this->container->getByType(Standard::class), - $this->container->getByType(Broker::class), - $this->container->getServicesByTag(self::FUNCTION_TYPE_SPECIFYING_EXTENSION_TAG), - $this->container->getServicesByTag(self::METHOD_TYPE_SPECIFYING_EXTENSION_TAG), - $this->container->getServicesByTag(self::STATIC_METHOD_TYPE_SPECIFYING_EXTENSION_TAG) - ); - - foreach (array_merge( - $this->container->getServicesByTag(BrokerFactory::PROPERTIES_CLASS_REFLECTION_EXTENSION_TAG), - $this->container->getServicesByTag(BrokerFactory::METHODS_CLASS_REFLECTION_EXTENSION_TAG), - $this->container->getServicesByTag(BrokerFactory::DYNAMIC_METHOD_RETURN_TYPE_EXTENSION_TAG), - $this->container->getServicesByTag(BrokerFactory::DYNAMIC_STATIC_METHOD_RETURN_TYPE_EXTENSION_TAG), - $this->container->getServicesByTag(BrokerFactory::DYNAMIC_FUNCTION_RETURN_TYPE_EXTENSION_TAG) - ) as $extension) { - if (!($extension instanceof TypeSpecifierAwareExtension)) { - continue; - } - - $extension->setTypeSpecifier($typeSpecifier); - } - - return $typeSpecifier; - } - -} diff --git a/vendor/phpstan/phpstan/src/Analyser/UndefinedVariableException.php b/vendor/phpstan/phpstan/src/Analyser/UndefinedVariableException.php deleted file mode 100644 index c9c8a51..0000000 --- a/vendor/phpstan/phpstan/src/Analyser/UndefinedVariableException.php +++ /dev/null @@ -1,31 +0,0 @@ -scope = $scope; - $this->variableName = $variableName; - } - - public function getScope(): Scope - { - return $this->scope; - } - - public function getVariableName(): string - { - return $this->variableName; - } - -} diff --git a/vendor/phpstan/phpstan/src/Analyser/VariableTypeHolder.php b/vendor/phpstan/phpstan/src/Analyser/VariableTypeHolder.php deleted file mode 100644 index 2229a5a..0000000 --- a/vendor/phpstan/phpstan/src/Analyser/VariableTypeHolder.php +++ /dev/null @@ -1,60 +0,0 @@ -no()) { - throw new \PHPStan\ShouldNotHappenException(); - } - $this->type = $type; - $this->certainty = $certainty; - } - - public static function createYes(Type $type): self - { - return new self($type, TrinaryLogic::createYes()); - } - - public static function createMaybe(Type $type): self - { - return new self($type, TrinaryLogic::createMaybe()); - } - - public function and(self $other): self - { - if ($this->getType()->equals($other->getType())) { - $type = $this->getType(); - } else { - $type = TypeCombinator::union($this->getType(), $other->getType()); - } - return new self( - $type, - $this->getCertainty()->and($other->getCertainty()) - ); - } - - public function getType(): Type - { - return $this->type; - } - - public function getCertainty(): TrinaryLogic - { - return $this->certainty; - } - -} diff --git a/vendor/phpstan/phpstan/src/Broker/AnonymousClassNameHelper.php b/vendor/phpstan/phpstan/src/Broker/AnonymousClassNameHelper.php deleted file mode 100644 index 57fc17f..0000000 --- a/vendor/phpstan/phpstan/src/Broker/AnonymousClassNameHelper.php +++ /dev/null @@ -1,45 +0,0 @@ -fileHelper = $fileHelper; - $this->relativePathHelper = $relativePathHelper; - } - - public function getAnonymousClassName( - \PhpParser\Node\Stmt\Class_ $classNode, - string $filename - ): string - { - if (isset($classNode->namespacedName)) { - throw new \PHPStan\ShouldNotHappenException(); - } - - $filename = $this->relativePathHelper->getRelativePath( - $this->fileHelper->normalizePath($filename) - ); - - return sprintf( - 'AnonymousClass%s', - md5(sprintf('%s:%s', $filename, $classNode->getLine())) - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/Broker/Broker.php b/vendor/phpstan/phpstan/src/Broker/Broker.php deleted file mode 100644 index ad6eca8..0000000 --- a/vendor/phpstan/phpstan/src/Broker/Broker.php +++ /dev/null @@ -1,613 +0,0 @@ -propertiesClassReflectionExtensions = $propertiesClassReflectionExtensions; - $this->methodsClassReflectionExtensions = $methodsClassReflectionExtensions; - foreach (array_merge($propertiesClassReflectionExtensions, $methodsClassReflectionExtensions, $dynamicMethodReturnTypeExtensions, $dynamicStaticMethodReturnTypeExtensions, $dynamicFunctionReturnTypeExtensions, $operatorTypeSpecifyingExtensions) as $extension) { - if (!($extension instanceof BrokerAwareExtension)) { - continue; - } - - $extension->setBroker($this); - } - - $this->dynamicMethodReturnTypeExtensions = $dynamicMethodReturnTypeExtensions; - $this->dynamicStaticMethodReturnTypeExtensions = $dynamicStaticMethodReturnTypeExtensions; - $this->operatorTypeSpecifyingExtensions = $operatorTypeSpecifyingExtensions; - - foreach ($dynamicFunctionReturnTypeExtensions as $functionReturnTypeExtension) { - $this->dynamicFunctionReturnTypeExtensions[] = $functionReturnTypeExtension; - } - - $this->functionReflectionFactory = $functionReflectionFactory; - $this->fileTypeMapper = $fileTypeMapper; - $this->signatureMapProvider = $signatureMapProvider; - $this->printer = $printer; - $this->anonymousClassNameHelper = $anonymousClassNameHelper; - $this->parser = $parser; - $this->relativePathHelper = $relativePathHelper; - $this->universalObjectCratesClasses = $universalObjectCratesClasses; - } - - public static function registerInstance(Broker $broker): void - { - self::$instance = $broker; - } - - public static function getInstance(): self - { - if (self::$instance === null) { - throw new \PHPStan\ShouldNotHappenException(); - } - return self::$instance; - } - - /** - * @return string[] - */ - public function getUniversalObjectCratesClasses(): array - { - return $this->universalObjectCratesClasses; - } - - /** - * @param string $className - * @return \PHPStan\Type\DynamicMethodReturnTypeExtension[] - */ - public function getDynamicMethodReturnTypeExtensionsForClass(string $className): array - { - if ($this->dynamicMethodReturnTypeExtensionsByClass === null) { - $byClass = []; - foreach ($this->dynamicMethodReturnTypeExtensions as $extension) { - $byClass[$extension->getClass()][] = $extension; - } - - $this->dynamicMethodReturnTypeExtensionsByClass = $byClass; - } - return $this->getDynamicExtensionsForType($this->dynamicMethodReturnTypeExtensionsByClass, $className); - } - - /** - * @param string $className - * @return \PHPStan\Type\DynamicStaticMethodReturnTypeExtension[] - */ - public function getDynamicStaticMethodReturnTypeExtensionsForClass(string $className): array - { - if ($this->dynamicStaticMethodReturnTypeExtensionsByClass === null) { - $byClass = []; - foreach ($this->dynamicStaticMethodReturnTypeExtensions as $extension) { - $byClass[$extension->getClass()][] = $extension; - } - - $this->dynamicStaticMethodReturnTypeExtensionsByClass = $byClass; - } - return $this->getDynamicExtensionsForType($this->dynamicStaticMethodReturnTypeExtensionsByClass, $className); - } - - /** - * @return OperatorTypeSpecifyingExtension[] - */ - public function getOperatorTypeSpecifyingExtensions(string $operator, Type $leftType, Type $rightType): array - { - return array_filter($this->operatorTypeSpecifyingExtensions, static function (OperatorTypeSpecifyingExtension $extension) use ($operator, $leftType, $rightType): bool { - return $extension->isOperatorSupported($operator, $leftType, $rightType); - }); - } - - /** - * @return \PHPStan\Type\DynamicFunctionReturnTypeExtension[] - */ - public function getDynamicFunctionReturnTypeExtensions(): array - { - return $this->dynamicFunctionReturnTypeExtensions; - } - - /** - * @param \PHPStan\Type\DynamicMethodReturnTypeExtension[][]|\PHPStan\Type\DynamicStaticMethodReturnTypeExtension[][] $extensions - * @param string $className - * @return mixed[] - */ - private function getDynamicExtensionsForType(array $extensions, string $className): array - { - $extensionsForClass = [[]]; - $class = $this->getClass($className); - foreach (array_merge([$className], $class->getParentClassesNames(), $class->getNativeReflection()->getInterfaceNames()) as $extensionClassName) { - if (!isset($extensions[$extensionClassName])) { - continue; - } - - $extensionsForClass[] = $extensions[$extensionClassName]; - } - - return array_merge(...$extensionsForClass); - } - - public function getClass(string $className): \PHPStan\Reflection\ClassReflection - { - if (!$this->hasClass($className)) { - throw new \PHPStan\Broker\ClassNotFoundException($className); - } - - if (isset(self::$anonymousClasses[$className])) { - return self::$anonymousClasses[$className]; - } - - if (!isset($this->classReflections[$className])) { - $reflectionClass = new ReflectionClass($className); - $filename = null; - if ($reflectionClass->getFileName() !== false) { - $filename = $reflectionClass->getFileName(); - } - - $classReflection = $this->getClassFromReflection( - $reflectionClass, - $reflectionClass->getName(), - $reflectionClass->isAnonymous() ? $filename : null - ); - $this->classReflections[$className] = $classReflection; - if ($className !== $reflectionClass->getName()) { - // class alias optimization - $this->classReflections[$reflectionClass->getName()] = $classReflection; - } - } - - return $this->classReflections[$className]; - } - - public function getAnonymousClassReflection( - \PhpParser\Node\Stmt\Class_ $classNode, - Scope $scope - ): ClassReflection - { - if (isset($classNode->namespacedName)) { - throw new \PHPStan\ShouldNotHappenException(); - } - - if (!$scope->isInTrait()) { - $scopeFile = $scope->getFile(); - } else { - $scopeFile = $scope->getTraitReflection()->getFileName(); - if ($scopeFile === false) { - $scopeFile = $scope->getFile(); - } - } - - $filename = $this->relativePathHelper->getRelativePath($scopeFile); - - $className = $this->anonymousClassNameHelper->getAnonymousClassName( - $classNode, - $scopeFile - ); - $classNode->name = new \PhpParser\Node\Identifier($className); - $classNode->setAttribute('anonymousClass', true); - - if (isset(self::$anonymousClasses[$className])) { - return self::$anonymousClasses[$className]; - } - - eval($this->printer->prettyPrint([$classNode])); - - self::$anonymousClasses[$className] = $this->getClassFromReflection( - new \ReflectionClass('\\' . $className), - sprintf('class@anonymous/%s:%s', $filename, $classNode->getLine()), - $scopeFile - ); - $this->classReflections[$className] = self::$anonymousClasses[$className]; - - return self::$anonymousClasses[$className]; - } - - public function getClassFromReflection(\ReflectionClass $reflectionClass, string $displayName, ?string $anonymousFilename): ClassReflection - { - $className = $reflectionClass->getName(); - if (!isset($this->classReflections[$className])) { - $classReflection = new ClassReflection( - $this, - $this->fileTypeMapper, - $this->propertiesClassReflectionExtensions, - $this->methodsClassReflectionExtensions, - $displayName, - $reflectionClass, - $anonymousFilename - ); - $this->classReflections[$className] = $classReflection; - } - - return $this->classReflections[$className]; - } - - public function hasClass(string $className): bool - { - $className = trim($className, '\\'); - if (isset($this->hasClassCache[$className])) { - return $this->hasClassCache[$className]; - } - - spl_autoload_register($autoloader = function (string $autoloadedClassName) use ($className): void { - $autoloadedClassName = trim($autoloadedClassName, '\\'); - if ($autoloadedClassName !== $className && !$this->isExistsCheckCall()) { - throw new \PHPStan\Broker\ClassAutoloadingException($autoloadedClassName); - } - }); - - try { - return $this->hasClassCache[$className] = class_exists($className) || interface_exists($className) || trait_exists($className); - } catch (\PHPStan\Broker\ClassAutoloadingException $e) { - throw $e; - } catch (\Throwable $t) { - throw new \PHPStan\Broker\ClassAutoloadingException( - $className, - $t - ); - } finally { - spl_autoload_unregister($autoloader); - } - } - - public function getFunction(\PhpParser\Node\Name $nameNode, ?Scope $scope): \PHPStan\Reflection\FunctionReflection - { - $functionName = $this->resolveFunctionName($nameNode, $scope); - if ($functionName === null) { - throw new \PHPStan\Broker\FunctionNotFoundException((string) $nameNode); - } - - $lowerCasedFunctionName = strtolower($functionName); - if (!isset($this->functionReflections[$lowerCasedFunctionName])) { - if (isset(self::$functionMap[$lowerCasedFunctionName])) { - return $this->functionReflections[$lowerCasedFunctionName] = self::$functionMap[$lowerCasedFunctionName]; - } - - if ($this->signatureMapProvider->hasFunctionSignature($lowerCasedFunctionName)) { - $variantName = $lowerCasedFunctionName; - $variants = []; - $i = 0; - while ($this->signatureMapProvider->hasFunctionSignature($variantName)) { - $functionSignature = $this->signatureMapProvider->getFunctionSignature($variantName, null); - $returnType = $functionSignature->getReturnType(); - if ($lowerCasedFunctionName === 'pow') { - $returnType = TypeUtils::toBenevolentUnion($returnType); - } - $variants[] = new FunctionVariant( - array_map(static function (ParameterSignature $parameterSignature) use ($lowerCasedFunctionName): NativeParameterReflection { - $type = $parameterSignature->getType(); - if ( - $parameterSignature->getName() === 'args' - && ( - $lowerCasedFunctionName === 'printf' - || $lowerCasedFunctionName === 'sprintf' - ) - ) { - $type = new UnionType([ - new StringAlwaysAcceptingObjectWithToStringType(), - new IntegerType(), - new FloatType(), - new NullType(), - new BooleanType(), - ]); - } - return new NativeParameterReflection( - $parameterSignature->getName(), - $parameterSignature->isOptional(), - $type, - $parameterSignature->passedByReference(), - $parameterSignature->isVariadic() - ); - }, $functionSignature->getParameters()), - $functionSignature->isVariadic(), - $returnType - ); - - $i++; - $variantName = sprintf($lowerCasedFunctionName . '\'' . $i); - } - $functionReflection = new NativeFunctionReflection( - $lowerCasedFunctionName, - $variants, - null - ); - self::$functionMap[$lowerCasedFunctionName] = $functionReflection; - $this->functionReflections[$lowerCasedFunctionName] = $functionReflection; - } else { - $this->functionReflections[$lowerCasedFunctionName] = $this->getCustomFunction($nameNode, $scope); - } - } - - return $this->functionReflections[$lowerCasedFunctionName]; - } - - public function hasFunction(\PhpParser\Node\Name $nameNode, ?Scope $scope): bool - { - return $this->resolveFunctionName($nameNode, $scope) !== null; - } - - public function hasCustomFunction(\PhpParser\Node\Name $nameNode, ?Scope $scope): bool - { - $functionName = $this->resolveFunctionName($nameNode, $scope); - if ($functionName === null) { - return false; - } - - $lowerCasedFunctionName = strtolower($functionName); - - return !$this->signatureMapProvider->hasFunctionSignature($lowerCasedFunctionName); - } - - public function getCustomFunction(\PhpParser\Node\Name $nameNode, ?Scope $scope): \PHPStan\Reflection\Php\PhpFunctionReflection - { - if (!$this->hasCustomFunction($nameNode, $scope)) { - throw new \PHPStan\Broker\FunctionNotFoundException((string) $nameNode); - } - - /** @var string $functionName */ - $functionName = $this->resolveFunctionName($nameNode, $scope); - if (!function_exists($functionName)) { - throw new \PHPStan\Broker\FunctionNotFoundException($functionName); - } - $lowerCasedFunctionName = strtolower($functionName); - if (isset($this->customFunctionReflections[$lowerCasedFunctionName])) { - return $this->customFunctionReflections[$lowerCasedFunctionName]; - } - - $reflectionFunction = new \ReflectionFunction($functionName); - $phpDocParameterTags = []; - $phpDocReturnTag = null; - $phpDocThrowsTag = null; - $deprecatedTag = null; - $isDeprecated = false; - $isInternal = false; - $isFinal = false; - if ($reflectionFunction->getFileName() !== false && $reflectionFunction->getDocComment() !== false) { - $fileName = $reflectionFunction->getFileName(); - $docComment = $reflectionFunction->getDocComment(); - $resolvedPhpDoc = $this->fileTypeMapper->getResolvedPhpDoc($fileName, null, null, $docComment); - $phpDocParameterTags = $resolvedPhpDoc->getParamTags(); - $phpDocReturnTag = $resolvedPhpDoc->getReturnTag(); - $phpDocThrowsTag = $resolvedPhpDoc->getThrowsTag(); - $deprecatedTag = $resolvedPhpDoc->getDeprecatedTag(); - $isDeprecated = $resolvedPhpDoc->isDeprecated(); - $isInternal = $resolvedPhpDoc->isInternal(); - $isFinal = $resolvedPhpDoc->isFinal(); - } - - $functionReflection = $this->functionReflectionFactory->create( - $reflectionFunction, - array_map(static function (ParamTag $paramTag): Type { - return $paramTag->getType(); - }, $phpDocParameterTags), - $phpDocReturnTag !== null ? $phpDocReturnTag->getType() : null, - $phpDocThrowsTag !== null ? $phpDocThrowsTag->getType() : null, - $deprecatedTag !== null ? $deprecatedTag->getMessage() : null, - $isDeprecated, - $isInternal, - $isFinal, - $reflectionFunction->getFileName() - ); - $this->customFunctionReflections[$lowerCasedFunctionName] = $functionReflection; - - return $functionReflection; - } - - public function resolveFunctionName(\PhpParser\Node\Name $nameNode, ?Scope $scope): ?string - { - return $this->resolveName($nameNode, function (string $name): bool { - $exists = function_exists($name); - if ($exists) { - return true; - } - - $lowercased = strtolower($name); - - return $this->signatureMapProvider->hasFunctionSignature($lowercased); - }, $scope); - } - - public function hasConstant(\PhpParser\Node\Name $nameNode, ?Scope $scope): bool - { - return $this->resolveConstantName($nameNode, $scope) !== null; - } - - public function resolveConstantName(\PhpParser\Node\Name $nameNode, ?Scope $scope): ?string - { - return $this->resolveName($nameNode, function (string $name) use ($scope): bool { - $isCompilerHaltOffset = $name === '__COMPILER_HALT_OFFSET__'; - if ($isCompilerHaltOffset && $scope !== null && $this->fileHasCompilerHaltStatementCalls($scope->getFile())) { - return true; - } - return defined($name); - }, $scope); - } - - private function fileHasCompilerHaltStatementCalls(string $pathToFile): bool - { - $nodes = $this->parser->parseFile($pathToFile); - foreach ($nodes as $node) { - if ($node instanceof Node\Stmt\HaltCompiler) { - return true; - } - } - - return false; - } - - /** - * @param Node\Name $nameNode - * @param \Closure(string $name): bool $existsCallback - * @param Scope|null $scope - * @return string|null - */ - private function resolveName( - \PhpParser\Node\Name $nameNode, - \Closure $existsCallback, - ?Scope $scope - ): ?string - { - $name = (string) $nameNode; - if ($scope !== null && $scope->getNamespace() !== null && !$nameNode->isFullyQualified()) { - $namespacedName = sprintf('%s\\%s', $scope->getNamespace(), $name); - if ($existsCallback($namespacedName)) { - return $namespacedName; - } - } - - if ($existsCallback($name)) { - return $name; - } - - return null; - } - - private function isExistsCheckCall(): bool - { - $debugBacktrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); - $existsCallTypes = [ - 'class_exists' => true, - 'interface_exists' => true, - 'trait_exists' => true, - ]; - - foreach ($debugBacktrace as $traceStep) { - if ( - isset($traceStep['function']) - && isset($existsCallTypes[$traceStep['function']]) - // We must ignore the self::hasClass calls - && (!isset($traceStep['file']) || $traceStep['file'] !== __FILE__) - ) { - return true; - } - } - - return false; - } - -} diff --git a/vendor/phpstan/phpstan/src/Broker/BrokerFactory.php b/vendor/phpstan/phpstan/src/Broker/BrokerFactory.php deleted file mode 100644 index 770091c..0000000 --- a/vendor/phpstan/phpstan/src/Broker/BrokerFactory.php +++ /dev/null @@ -1,62 +0,0 @@ -container = $container; - } - - public function create(): Broker - { - $phpClassReflectionExtension = $this->container->getByType(PhpClassReflectionExtension::class); - $annotationsMethodsClassReflectionExtension = $this->container->getByType(AnnotationsMethodsClassReflectionExtension::class); - $annotationsPropertiesClassReflectionExtension = $this->container->getByType(AnnotationsPropertiesClassReflectionExtension::class); - $phpDefectClassReflectionExtension = $this->container->getByType(PhpDefectClassReflectionExtension::class); - - /** @var RelativePathHelper $relativePathHelper */ - $relativePathHelper = $this->container->getService('simpleRelativePathHelper'); - - return new Broker( - array_merge([$phpClassReflectionExtension, $phpDefectClassReflectionExtension], $this->container->getServicesByTag(self::PROPERTIES_CLASS_REFLECTION_EXTENSION_TAG), [$annotationsPropertiesClassReflectionExtension]), - array_merge([$phpClassReflectionExtension], $this->container->getServicesByTag(self::METHODS_CLASS_REFLECTION_EXTENSION_TAG), [$annotationsMethodsClassReflectionExtension]), - $this->container->getServicesByTag(self::DYNAMIC_METHOD_RETURN_TYPE_EXTENSION_TAG), - $this->container->getServicesByTag(self::DYNAMIC_STATIC_METHOD_RETURN_TYPE_EXTENSION_TAG), - $this->container->getServicesByTag(self::DYNAMIC_FUNCTION_RETURN_TYPE_EXTENSION_TAG), - $this->container->getServicesByTag(self::OPERATOR_TYPE_SPECIFYING_EXTENSION_TAG), - $this->container->getByType(FunctionReflectionFactory::class), - $this->container->getByType(FileTypeMapper::class), - $this->container->getByType(SignatureMapProvider::class), - $this->container->getByType(\PhpParser\PrettyPrinter\Standard::class), - $this->container->getByType(AnonymousClassNameHelper::class), - $this->container->getByType(Parser::class), - $relativePathHelper, - $this->container->getParameter('universalObjectCratesClasses') - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/Broker/ClassAutoloadingException.php b/vendor/phpstan/phpstan/src/Broker/ClassAutoloadingException.php deleted file mode 100644 index 47b2f82..0000000 --- a/vendor/phpstan/phpstan/src/Broker/ClassAutoloadingException.php +++ /dev/null @@ -1,38 +0,0 @@ -getMessage(), - $functionName - ), 0, $previous); - } else { - parent::__construct(sprintf( - 'Class %s not found and could not be autoloaded.', - $functionName - ), 0); - } - - $this->className = $functionName; - } - - public function getClassName(): string - { - return $this->className; - } - -} diff --git a/vendor/phpstan/phpstan/src/Broker/ClassNotFoundException.php b/vendor/phpstan/phpstan/src/Broker/ClassNotFoundException.php deleted file mode 100644 index 3e767a6..0000000 --- a/vendor/phpstan/phpstan/src/Broker/ClassNotFoundException.php +++ /dev/null @@ -1,22 +0,0 @@ -className = $functionName; - } - - public function getClassName(): string - { - return $this->className; - } - -} diff --git a/vendor/phpstan/phpstan/src/Broker/FunctionNotFoundException.php b/vendor/phpstan/phpstan/src/Broker/FunctionNotFoundException.php deleted file mode 100644 index bb7b4c2..0000000 --- a/vendor/phpstan/phpstan/src/Broker/FunctionNotFoundException.php +++ /dev/null @@ -1,22 +0,0 @@ -functionName = $functionName; - } - - public function getFunctionName(): string - { - return $this->functionName; - } - -} diff --git a/vendor/phpstan/phpstan/src/Cache/Cache.php b/vendor/phpstan/phpstan/src/Cache/Cache.php deleted file mode 100644 index 09d0166..0000000 --- a/vendor/phpstan/phpstan/src/Cache/Cache.php +++ /dev/null @@ -1,35 +0,0 @@ -storage = $storage; - } - - /** - * @param string $key - * @return mixed|null - */ - public function load(string $key) - { - return $this->storage->load($key); - } - - /** - * @param string $key - * @param mixed $data - * @return bool - */ - public function save(string $key, $data): bool - { - return $this->storage->save($key, $data); - } - -} diff --git a/vendor/phpstan/phpstan/src/Cache/CacheStorage.php b/vendor/phpstan/phpstan/src/Cache/CacheStorage.php deleted file mode 100644 index db4b722..0000000 --- a/vendor/phpstan/phpstan/src/Cache/CacheStorage.php +++ /dev/null @@ -1,21 +0,0 @@ -directory = $directory; - - if (@mkdir($this->directory) && !is_dir($this->directory)) { - throw new \InvalidArgumentException(sprintf('Directory "%s" doesn\'t exist.', $this->directory)); - } - } - - /** - * @param string $key - * @return mixed|null - */ - public function load(string $key) - { - return (function (string $key) { - $filePath = $this->getFilePath($key); - return is_file($filePath) ? require $this->getFilePath($key) : null; - })($key); - } - - /** - * @param string $key - * @param mixed $data - * @return bool - */ - public function save(string $key, $data): bool - { - $writtenBytes = @file_put_contents( - $this->getFilePath($key), - sprintf("directory, preg_replace('~[^-\\w]~', '_', $key)); - } - -} diff --git a/vendor/phpstan/phpstan/src/Cache/MemoryCacheStorage.php b/vendor/phpstan/phpstan/src/Cache/MemoryCacheStorage.php deleted file mode 100644 index 8c72543..0000000 --- a/vendor/phpstan/phpstan/src/Cache/MemoryCacheStorage.php +++ /dev/null @@ -1,31 +0,0 @@ -storage[$key] ?? null; - } - - /** - * @param string $key - * @param mixed $data - * @return bool - */ - public function save(string $key, $data): bool - { - $this->storage[$key] = $data; - return true; - } - -} diff --git a/vendor/phpstan/phpstan/src/Command/AnalyseApplication.php b/vendor/phpstan/phpstan/src/Command/AnalyseApplication.php deleted file mode 100644 index 7153290..0000000 --- a/vendor/phpstan/phpstan/src/Command/AnalyseApplication.php +++ /dev/null @@ -1,161 +0,0 @@ -analyser = $analyser; - $this->memoryLimitFile = $memoryLimitFile; - $this->fileHelper = $fileHelper; - $this->currentWorkingDirectory = $currentWorkingDirectory; - } - - /** - * @param string[] $files - * @param bool $onlyFiles - * @param \Symfony\Component\Console\Style\OutputStyle $style - * @param \PHPStan\Command\ErrorFormatter\ErrorFormatter $errorFormatter - * @param bool $defaultLevelUsed - * @param bool $debug - * @param string|null $projectConfigFile - * @return int Error code. - */ - public function analyse( - array $files, - bool $onlyFiles, - OutputStyle $style, - ErrorFormatter $errorFormatter, - bool $defaultLevelUsed, - bool $debug, - ?string $projectConfigFile - ): int - { - $this->updateMemoryLimitFile(); - $errors = []; - - if (!$debug) { - $progressStarted = false; - $fileOrder = 0; - $preFileCallback = null; - $postFileCallback = function () use ($style, &$progressStarted, $files, &$fileOrder): void { - if (!$progressStarted) { - $style->progressStart(count($files)); - $progressStarted = true; - } - $style->progressAdvance(); - if ($fileOrder % 100 === 0) { - $this->updateMemoryLimitFile(); - } - $fileOrder++; - }; - } else { - $preFileCallback = static function (string $file) use ($style): void { - $style->writeln($file); - }; - $postFileCallback = null; - } - - $hasInferrablePropertyTypesFromConstructor = false; - $errors = array_merge($errors, $this->analyser->analyse( - $files, - $onlyFiles, - $preFileCallback, - $postFileCallback, - $debug, - static function (Node $node, Scope $scope) use (&$hasInferrablePropertyTypesFromConstructor): void { - if ($hasInferrablePropertyTypesFromConstructor) { - return; - } - - if (!$node instanceof Node\Stmt\PropertyProperty) { - return; - } - - if (!$scope->isInClass()) { - return; - } - - $classReflection = $scope->getClassReflection(); - if (!$classReflection->hasConstructor() || $classReflection->getConstructor()->getDeclaringClass()->getName() !== $classReflection->getName()) { - return; - } - $propertyName = $node->name->toString(); - if (!$classReflection->hasNativeProperty($propertyName)) { - return; - } - $propertyReflection = $classReflection->getNativeProperty($propertyName); - if (!$propertyReflection->isPrivate()) { - return; - } - $propertyType = $propertyReflection->getType(); - if (!$propertyType instanceof MixedType || $propertyType->isExplicitMixed()) { - return; - } - - $hasInferrablePropertyTypesFromConstructor = true; - } - )); - - if (isset($progressStarted) && $progressStarted) { - $style->progressFinish(); - } - - $fileSpecificErrors = []; - $notFileSpecificErrors = []; - foreach ($errors as $error) { - if (is_string($error)) { - $notFileSpecificErrors[] = $error; - } else { - $fileSpecificErrors[] = $error; - } - } - - return $errorFormatter->formatErrors( - new AnalysisResult( - $fileSpecificErrors, - $notFileSpecificErrors, - $defaultLevelUsed, - $this->fileHelper->normalizePath($this->currentWorkingDirectory), - $hasInferrablePropertyTypesFromConstructor, - $projectConfigFile - ), - $style - ); - } - - private function updateMemoryLimitFile(): void - { - $bytes = memory_get_peak_usage(true); - $megabytes = ceil($bytes / 1024 / 1024); - file_put_contents($this->memoryLimitFile, sprintf('%d MB', $megabytes)); - } - -} diff --git a/vendor/phpstan/phpstan/src/Command/AnalyseCommand.php b/vendor/phpstan/phpstan/src/Command/AnalyseCommand.php deleted file mode 100644 index 98bda5e..0000000 --- a/vendor/phpstan/phpstan/src/Command/AnalyseCommand.php +++ /dev/null @@ -1,187 +0,0 @@ -setName(self::NAME) - ->setDescription('Analyses source code') - ->setDefinition([ - new InputArgument('paths', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, 'Paths with source code to run analysis on'), - new InputOption('paths-file', null, InputOption::VALUE_REQUIRED, 'Path to a file with a list of paths to run analysis on'), - new InputOption('configuration', 'c', InputOption::VALUE_REQUIRED, 'Path to project configuration file'), - new InputOption(self::OPTION_LEVEL, 'l', InputOption::VALUE_REQUIRED, 'Level of rule options - the higher the stricter'), - new InputOption(ErrorsConsoleStyle::OPTION_NO_PROGRESS, null, InputOption::VALUE_NONE, 'Do not show progress bar, only results'), - new InputOption('debug', null, InputOption::VALUE_NONE, 'Show debug information - which file is analysed, do not catch internal errors'), - new InputOption('autoload-file', 'a', InputOption::VALUE_REQUIRED, 'Project\'s additional autoload file path'), - new InputOption('error-format', null, InputOption::VALUE_REQUIRED, 'Format in which to print the result of the analysis', 'table'), - new InputOption('memory-limit', null, InputOption::VALUE_REQUIRED, 'Memory limit for analysis'), - new InputOption('xdebug', null, InputOption::VALUE_NONE, 'Allow running with XDebug for debugging purposes'), - ]); - } - - /** - * @return string[] - */ - public function getAliases(): array - { - return ['analyze']; - } - - protected function initialize(InputInterface $input, OutputInterface $output): void - { - if ((bool) $input->getOption('debug')) { - /** @var \Symfony\Component\Console\Application|null $application */ - $application = $this->getApplication(); - if ($application === null) { - throw new \PHPStan\ShouldNotHappenException(); - } - $application->setCatchExceptions(false); - return; - } - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - if ($output instanceof ConsoleOutputInterface) { - $errorOutput = $output->getErrorOutput(); - $errorOutput->writeln(''); - $errorOutput->writeln("⚠️ You're running a really old version of PHPStan.️"); - $errorOutput->writeln(''); - $errorOutput->writeln('The last release in the 0.11.x series with new features'); - - $lastRelease = new \DateTimeImmutable('2019-10-22 00:00:00'); - $daysSince = (time() - $lastRelease->getTimestamp()) / 60 / 60 / 24; - if ($daysSince > 360) { - $errorOutput->writeln('and bugfixes was released on October 22nd 2019,'); - $errorOutput->writeln(sprintf('that\'s %d days ago.', floor($daysSince))); - } else { - $errorOutput->writeln('and bugfixes was released on October 22nd 2019.'); - } - $errorOutput->writeln(''); - - $errorOutput->writeln('Since then more than 50 new PHPStan versions were released'); - $errorOutput->writeln('with hundreds of new features, bugfixes, and other'); - $errorOutput->writeln('quality of life improvements.'); - $errorOutput->writeln(''); - - $errorOutput->writeln("To learn about what you're missing out on, check out"); - $errorOutput->writeln('this blog with articles about the latest major releases:'); - $errorOutput->writeln('https://phpstan.org/blog'); - $errorOutput->writeln(''); - - $errorOutput->writeln('Historically, the main two blockers preventing'); - $errorOutput->writeln('people from upgrading were:'); - $errorOutput->writeln('1) Composer conflicts with other dependencies.'); - $errorOutput->writeln('2) Errors discovered by the new PHPStan version and no time'); - $errorOutput->writeln(' to fix them to get to a green build again.'); - $errorOutput->writeln(''); - - $errorOutput->writeln('Today, neither of them is a problem anymore thanks to:'); - $errorOutput->writeln('1) phpstan/phpstan package having zero external dependencies.'); - $errorOutput->writeln('2) Baseline feature letting you use the latest release'); - $errorOutput->writeln(' right away even with pre-existing errors.'); - $errorOutput->writeln(' Read more about it here: https://phpstan.org/user-guide/baseline'); - $errorOutput->writeln(''); - - $errorOutput->writeln('Upgrade today to PHPStan 0.12 by using'); - $errorOutput->writeln('"phpstan/phpstan": "^0.12" in your composer.json.'); - $errorOutput->writeln(''); - } - $paths = $input->getArgument('paths'); - $memoryLimit = $input->getOption('memory-limit'); - $autoloadFile = $input->getOption('autoload-file'); - $configuration = $input->getOption('configuration'); - $level = $input->getOption(self::OPTION_LEVEL); - $pathsFile = $input->getOption('paths-file'); - $allowXdebug = $input->getOption('xdebug'); - - if ( - !is_array($paths) - || (!is_string($memoryLimit) && $memoryLimit !== null) - || (!is_string($autoloadFile) && $autoloadFile !== null) - || (!is_string($configuration) && $configuration !== null) - || (!is_string($level) && $level !== null) - || (!is_string($pathsFile) && $pathsFile !== null) - || (!is_bool($allowXdebug)) - ) { - throw new \PHPStan\ShouldNotHappenException(); - } - - try { - $inceptionResult = CommandHelper::begin( - $input, - $output, - $paths, - $pathsFile, - $memoryLimit, - $autoloadFile, - $configuration, - $level, - $allowXdebug - ); - } catch (\PHPStan\Command\InceptionNotSuccessfulException $e) { - return 1; - } - - $errorOutput = $inceptionResult->getErrorOutput(); - $errorFormat = $input->getOption('error-format'); - - if (!is_string($errorFormat) && $errorFormat !== null) { - throw new \PHPStan\ShouldNotHappenException(); - } - - $container = $inceptionResult->getContainer(); - $errorFormatterServiceName = sprintf('errorFormatter.%s', $errorFormat); - if (!$container->hasService($errorFormatterServiceName)) { - $errorOutput->writeln(sprintf( - 'Error formatter "%s" not found. Available error formatters are: %s', - $errorFormat, - implode(', ', array_map(static function (string $name): string { - return substr($name, strlen('errorFormatter.')); - }, $container->findByType(ErrorFormatter::class))) - )); - return 1; - } - - /** @var ErrorFormatter $errorFormatter */ - $errorFormatter = $container->getService($errorFormatterServiceName); - - /** @var AnalyseApplication $application */ - $application = $container->getByType(AnalyseApplication::class); - - $debug = $input->getOption('debug'); - if (!is_bool($debug)) { - throw new \PHPStan\ShouldNotHappenException(); - } - - return $inceptionResult->handleReturn( - $application->analyse( - $inceptionResult->getFiles(), - $inceptionResult->isOnlyFiles(), - $inceptionResult->getConsoleStyle(), - $errorFormatter, - $inceptionResult->isDefaultLevelUsed(), - $debug, - $inceptionResult->getProjectConfigFile() - ) - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/Command/AnalysisResult.php b/vendor/phpstan/phpstan/src/Command/AnalysisResult.php deleted file mode 100644 index f7a7573..0000000 --- a/vendor/phpstan/phpstan/src/Command/AnalysisResult.php +++ /dev/null @@ -1,118 +0,0 @@ -getFile(), - $a->getLine(), - $a->getMessage(), - ] <=> [ - $b->getFile(), - $b->getLine(), - $b->getMessage(), - ]; - } - ); - - $this->fileSpecificErrors = $fileSpecificErrors; - $this->notFileSpecificErrors = $notFileSpecificErrors; - $this->defaultLevelUsed = $defaultLevelUsed; - $this->currentDirectory = $currentDirectory; - $this->hasInferrablePropertyTypesFromConstructor = $hasInferrablePropertyTypesFromConstructor; - $this->projectConfigFile = $projectConfigFile; - } - - public function hasErrors(): bool - { - return $this->getTotalErrorsCount() > 0; - } - - public function getTotalErrorsCount(): int - { - return count($this->fileSpecificErrors) + count($this->notFileSpecificErrors); - } - - /** - * @return \PHPStan\Analyser\Error[] sorted by their file name, line number and message - */ - public function getFileSpecificErrors(): array - { - return $this->fileSpecificErrors; - } - - /** - * @return string[] - */ - public function getNotFileSpecificErrors(): array - { - return $this->notFileSpecificErrors; - } - - public function isDefaultLevelUsed(): bool - { - return $this->defaultLevelUsed; - } - - /** - * @deprecated Use \PHPStan\File\RelativePathHelper instead - * @return string - */ - public function getCurrentDirectory(): string - { - return $this->currentDirectory; - } - - public function hasInferrablePropertyTypesFromConstructor(): bool - { - return $this->hasInferrablePropertyTypesFromConstructor; - } - - public function getProjectConfigFile(): ?string - { - return $this->projectConfigFile; - } - -} diff --git a/vendor/phpstan/phpstan/src/Command/CommandHelper.php b/vendor/phpstan/phpstan/src/Command/CommandHelper.php deleted file mode 100644 index 67d2642..0000000 --- a/vendor/phpstan/phpstan/src/Command/CommandHelper.php +++ /dev/null @@ -1,407 +0,0 @@ -check(); - unset($xdebug); - } - $errorOutput = $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output; - $consoleStyle = new ErrorsConsoleStyle($input, $output); - if ($memoryLimit !== null) { - if (\Nette\Utils\Strings::match($memoryLimit, '#^-?\d+[kMG]?$#i') === null) { - $errorOutput->writeln(sprintf('Invalid memory limit format "%s".', $memoryLimit)); - throw new \PHPStan\Command\InceptionNotSuccessfulException(); - } - if (ini_set('memory_limit', $memoryLimit) === false) { - $errorOutput->writeln(sprintf('Memory limit "%s" cannot be set.', $memoryLimit)); - throw new \PHPStan\Command\InceptionNotSuccessfulException(); - } - } - - $currentWorkingDirectory = getcwd(); - if ($currentWorkingDirectory === false) { - throw new \PHPStan\ShouldNotHappenException(); - } - $fileHelper = new FileHelper($currentWorkingDirectory); - if ($autoloadFile !== null && is_file($autoloadFile)) { - $autoloadFile = $fileHelper->absolutizePath($autoloadFile); - if (is_file($autoloadFile)) { - (static function (string $file): void { - require_once $file; - })($autoloadFile); - } - } - if ($projectConfigFile === null) { - foreach (['phpstan.neon', 'phpstan.neon.dist'] as $discoverableConfigName) { - $discoverableConfigFile = $currentWorkingDirectory . DIRECTORY_SEPARATOR . $discoverableConfigName; - if (is_file($discoverableConfigFile)) { - $projectConfigFile = $discoverableConfigFile; - $errorOutput->writeln(sprintf('Note: Using configuration file %s.', $projectConfigFile)); - break; - } - } - } - $defaultLevelUsed = false; - if ($projectConfigFile === null && $level === null) { - $level = self::DEFAULT_LEVEL; - $defaultLevelUsed = true; - } - - if (count($paths) === 0 && $pathsFile !== null) { - if (!file_exists($pathsFile)) { - $errorOutput->writeln(sprintf('Paths file %s does not exist.', $pathsFile)); - throw new \PHPStan\Command\InceptionNotSuccessfulException(); - } - - $pathsString = file_get_contents($pathsFile); - if ($pathsString === false) { - throw new \PHPStan\ShouldNotHappenException(); - } - - $paths = array_values(array_filter(explode("\n", $pathsString), static function (string $path): bool { - return trim($path) !== ''; - })); - } - - $containerFactory = new ContainerFactory($currentWorkingDirectory); - if ($projectConfigFile !== null) { - if (!is_file($projectConfigFile)) { - $errorOutput->writeln(sprintf('Project config file at path %s does not exist.', $projectConfigFile)); - throw new \PHPStan\Command\InceptionNotSuccessfulException(); - } - - $loader = (new LoaderFactory( - $containerFactory->getRootDirectory(), - $containerFactory->getCurrentWorkingDirectory() - ))->createLoader(); - - try { - $projectConfig = $loader->load($projectConfigFile, null); - } catch (\Nette\InvalidStateException | \Nette\FileNotFoundException $e) { - $errorOutput->writeln($e->getMessage()); - throw new \PHPStan\Command\InceptionNotSuccessfulException(); - } - $defaultParameters = [ - 'rootDir' => $containerFactory->getRootDirectory(), - 'currentWorkingDirectory' => $containerFactory->getCurrentWorkingDirectory(), - ]; - - if (isset($projectConfig['parameters']['tmpDir'])) { - $tmpDir = Helpers::expand($projectConfig['parameters']['tmpDir'], $defaultParameters); - } - if ($level === null && isset($projectConfig['parameters']['level'])) { - $level = $projectConfig['parameters']['level']; - } - if (count($paths) === 0 && isset($projectConfig['parameters']['paths'])) { - $paths = Helpers::expand($projectConfig['parameters']['paths'], $defaultParameters); - } - } - - if (count($paths) === 0) { - $errorOutput->writeln('At least one path must be specified to analyse.'); - throw new \PHPStan\Command\InceptionNotSuccessfulException(); - } - - $additionalConfigFiles = []; - if ($level !== null) { - $levelConfigFile = sprintf('%s/config.level%s.neon', $containerFactory->getConfigDirectory(), $level); - if (!is_file($levelConfigFile)) { - $errorOutput->writeln(sprintf('Level config file %s was not found.', $levelConfigFile)); - throw new \PHPStan\Command\InceptionNotSuccessfulException(); - } - - $additionalConfigFiles[] = $levelConfigFile; - } - - if (class_exists('PHPStan\ExtensionInstaller\GeneratedConfig')) { - foreach (\PHPStan\ExtensionInstaller\GeneratedConfig::EXTENSIONS as $name => $extensionConfig) { - foreach ($extensionConfig['extra']['includes'] ?? [] as $includedFile) { - if (!is_string($includedFile)) { - $errorOutput->writeln(sprintf('Cannot include config from package %s, expecting string file path but got %s', $name, gettype($includedFile))); - throw new \PHPStan\Command\InceptionNotSuccessfulException(); - } - $includedFilePath = sprintf('%s/%s', $extensionConfig['install_path'], $includedFile); - if (!file_exists($includedFilePath) || !is_readable($includedFilePath)) { - $errorOutput->writeln(sprintf('Config file %s does not exists or isn\'t readable', $includedFilePath)); - throw new \PHPStan\Command\InceptionNotSuccessfulException(); - } - $additionalConfigFiles[] = $includedFilePath; - } - } - } - - if ($projectConfigFile !== null) { - $additionalConfigFiles[] = $fileHelper->absolutizePath($projectConfigFile); - } - - self::detectDuplicateIncludedFiles( - $errorOutput, - $fileHelper, - $additionalConfigFiles, - [ - 'rootDir' => $containerFactory->getRootDirectory(), - 'currentWorkingDirectory' => $containerFactory->getCurrentWorkingDirectory(), - ] - ); - - if (!isset($tmpDir)) { - $tmpDir = sys_get_temp_dir() . '/phpstan'; - if (!@mkdir($tmpDir, 0777, true) && !is_dir($tmpDir)) { - $errorOutput->writeln(sprintf('Cannot create a temp directory %s', $tmpDir)); - throw new \PHPStan\Command\InceptionNotSuccessfulException(); - } - } - $paths = array_map(static function (string $path) use ($fileHelper): string { - return $fileHelper->absolutizePath($path); - }, $paths); - - try { - $netteContainer = $containerFactory->create($tmpDir, $additionalConfigFiles, $paths); - } catch (\Nette\DI\InvalidConfigurationException | \Nette\Utils\AssertionException $e) { - $errorOutput->writeln('Invalid configuration:'); - $errorOutput->writeln($e->getMessage()); - throw new \PHPStan\Command\InceptionNotSuccessfulException(); - } - - TypeCombinator::$enableSubtractableTypes = (bool) $netteContainer->parameters['featureToggles']['subtractableTypes']; - $memoryLimitFile = $netteContainer->parameters['memoryLimitFile']; - if (file_exists($memoryLimitFile)) { - $memoryLimitFileContents = file_get_contents($memoryLimitFile); - if ($memoryLimitFileContents === false) { - throw new \PHPStan\ShouldNotHappenException(); - } - $errorOutput->writeln('PHPStan crashed in the previous run probably because of excessive memory consumption.'); - $errorOutput->writeln(sprintf('It consumed around %s of memory.', $memoryLimitFileContents)); - $errorOutput->writeln(''); - $errorOutput->writeln(''); - $errorOutput->writeln('To avoid this issue, allow to use more memory with the --memory-limit option.'); - @unlink($memoryLimitFile); - } - - self::setUpSignalHandler($consoleStyle, $memoryLimitFile); - if (!isset($netteContainer->parameters['customRulesetUsed'])) { - $errorOutput->writeln(''); - $errorOutput->writeln('No rules detected'); - $errorOutput->writeln(''); - $errorOutput->writeln('You have the following choices:'); - $errorOutput->writeln(''); - $errorOutput->writeln('* while running the analyse option, use the --level option to adjust your rule level - the higher the stricter'); - $errorOutput->writeln(''); - $errorOutput->writeln(sprintf('* create your own custom ruleset by selecting which rules you want to check by copying the service definitions from the built-in config level files in %s.', $fileHelper->normalizePath(__DIR__ . '/../../conf'))); - $errorOutput->writeln(' * in this case, don\'t forget to define parameter customRulesetUsed in your config file.'); - $errorOutput->writeln(''); - throw new \PHPStan\Command\InceptionNotSuccessfulException(); - } elseif ((bool) $netteContainer->parameters['customRulesetUsed']) { - $defaultLevelUsed = false; - } - - if ($netteContainer->parameters['featureToggles']['validateParameters']) { - $schema = $netteContainer->parameters['__parametersSchema']; - $processor = new Processor(); - $processor->onNewContext[] = static function (SchemaContext $context): void { - $context->path = ['parameters']; - }; - - try { - $processor->process($schema, $netteContainer->parameters); - } catch (\Nette\Schema\ValidationException $e) { - foreach ($e->getMessages() as $message) { - $errorOutput->writeln('Invalid configuration:'); - $errorOutput->writeln($message); - } - throw new \PHPStan\Command\InceptionNotSuccessfulException(); - } - } - - $container = $netteContainer->getByType(Container::class); - foreach ($netteContainer->parameters['autoload_files'] as $parameterAutoloadFile) { - (static function (string $file) use ($container): void { - require_once $file; - })($fileHelper->normalizePath($parameterAutoloadFile)); - } - - if (count($netteContainer->parameters['autoload_directories']) > 0) { - $robotLoader = new \Nette\Loaders\RobotLoader(); - $robotLoader->acceptFiles = array_map(static function (string $extension): string { - return sprintf('*.%s', $extension); - }, $netteContainer->parameters['fileExtensions']); - - $robotLoader->setTempDirectory($tmpDir); - foreach ($netteContainer->parameters['autoload_directories'] as $directory) { - $robotLoader->addDirectory($fileHelper->normalizePath($directory)); - } - - foreach ($netteContainer->parameters['excludes_analyse'] as $directory) { - $robotLoader->excludeDirectory($fileHelper->normalizePath($directory)); - } - - $robotLoader->register(); - } - - $bootstrapFile = $netteContainer->parameters['bootstrap']; - if ($bootstrapFile !== null) { - $bootstrapFile = $fileHelper->normalizePath($bootstrapFile); - if (!is_file($bootstrapFile)) { - $errorOutput->writeln(sprintf('Bootstrap file %s does not exist.', $bootstrapFile)); - throw new \PHPStan\Command\InceptionNotSuccessfulException(); - } - try { - (static function (string $file) use ($container): void { - require_once $file; - })($bootstrapFile); - } catch (\Throwable $e) { - $errorOutput->writeln($e->getMessage()); - throw new \PHPStan\Command\InceptionNotSuccessfulException(); - } - } - - /** @var FileFinder $fileFinder */ - $fileFinder = $netteContainer->getByType(FileFinder::class); - - try { - $fileFinderResult = $fileFinder->findFiles($paths); - } catch (\PHPStan\File\PathNotFoundException $e) { - $errorOutput->writeln(sprintf('%s', $e->getMessage())); - throw new \PHPStan\Command\InceptionNotSuccessfulException($e->getMessage(), 0, $e); - } - - return new InceptionResult( - $fileFinderResult->getFiles(), - $fileFinderResult->isOnlyFiles(), - $consoleStyle, - $errorOutput, - $netteContainer, - $defaultLevelUsed, - $memoryLimitFile, - $projectConfigFile - ); - } - - private static function setUpSignalHandler(OutputStyle $consoleStyle, string $memoryLimitFile): void - { - if (!function_exists('pcntl_signal')) { - return; - } - - pcntl_async_signals(true); - pcntl_signal(SIGINT, static function () use ($consoleStyle, $memoryLimitFile): void { - if (file_exists($memoryLimitFile)) { - @unlink($memoryLimitFile); - } - $consoleStyle->newLine(); - exit(1); - }); - } - - private static function detectDuplicateIncludedFiles( - OutputInterface $output, - FileHelper $fileHelper, - array $configFiles, - array $loaderParameters - ): void - { - $neonAdapter = new NeonAdapter(); - $phpAdapter = new PhpAdapter(); - $allConfigFiles = $configFiles; - foreach ($configFiles as $configFile) { - $allConfigFiles = array_merge($allConfigFiles, self::getConfigFiles($neonAdapter, $phpAdapter, $configFile, $loaderParameters)); - } - - $normalized = array_map(static function (string $file) use ($fileHelper): string { - return $fileHelper->absolutizePath($fileHelper->normalizePath($file)); - }, $allConfigFiles); - - $deduplicated = array_unique($normalized); - if (count($normalized) > count($deduplicated)) { - $duplicateFiles = array_unique(array_diff_key($normalized, $deduplicated)); - - $format = "These files are included multiple times:\n- %s"; - if (count($duplicateFiles) === 1) { - $format = "This file is included multiple times:\n- %s"; - } - $output->writeln(sprintf($format, implode("\n- ", $duplicateFiles))); - - if (class_exists('PHPStan\ExtensionInstaller\GeneratedConfig')) { - $output->writeln(''); - $output->writeln('It can lead to unexpected results. If you\'re using phpstan/extension-installer, make sure you have removed corresponding neon files from your project config file.'); - } - throw new \PHPStan\Command\InceptionNotSuccessfulException(); - } - } - - private static function getConfigFiles( - NeonAdapter $neonAdapter, - PhpAdapter $phpAdapter, - string $configFile, - array $loaderParameters - ): array - { - if (!is_file($configFile) || !is_readable($configFile)) { - return []; - } - - if (Strings::endsWith($configFile, '.php')) { - $data = $phpAdapter->load($configFile); - } else { - $data = $neonAdapter->load($configFile); - } - $allConfigFiles = []; - if (isset($data['includes'])) { - Validators::assert($data['includes'], 'list', sprintf("section 'includes' in file '%s'", $configFile)); - $includes = Helpers::expand($data['includes'], $loaderParameters); - foreach ($includes as $include) { - $include = self::expandIncludedFile($include, $configFile); - $allConfigFiles[] = $include; - $allConfigFiles = array_merge($allConfigFiles, self::getConfigFiles($neonAdapter, $phpAdapter, $include, $loaderParameters)); - } - } - - return $allConfigFiles; - } - - private static function expandIncludedFile(string $includedFile, string $mainFile): string - { - return Strings::match($includedFile, '#([a-z]+:)?[/\\\\]#Ai') !== null // is absolute - ? $includedFile - : dirname($mainFile) . '/' . $includedFile; - } - -} diff --git a/vendor/phpstan/phpstan/src/Command/DumpDependenciesCommand.php b/vendor/phpstan/phpstan/src/Command/DumpDependenciesCommand.php deleted file mode 100644 index ef9ce11..0000000 --- a/vendor/phpstan/phpstan/src/Command/DumpDependenciesCommand.php +++ /dev/null @@ -1,99 +0,0 @@ -setName(self::NAME) - ->setDescription('Dumps files dependency tree') - ->setDefinition([ - new InputArgument('paths', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, 'Paths with source code to run dump on'), - new InputOption('paths-file', null, InputOption::VALUE_REQUIRED, 'Path to a file with a list of paths to run analysis on'), - new InputOption('configuration', 'c', InputOption::VALUE_REQUIRED, 'Path to project configuration file'), - new InputOption(ErrorsConsoleStyle::OPTION_NO_PROGRESS, null, InputOption::VALUE_NONE, 'Do not show progress bar, only results'), - new InputOption('autoload-file', 'a', InputOption::VALUE_REQUIRED, 'Project\'s additional autoload file path'), - new InputOption('memory-limit', null, InputOption::VALUE_REQUIRED, 'Memory limit for the run'), - new InputOption('analysed-paths', null, InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED, 'Project-scope paths'), - new InputOption('xdebug', null, InputOption::VALUE_NONE, 'Allow running with XDebug for debugging purposes'), - ]); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - try { - /** @var string[] $paths */ - $paths = $input->getArgument('paths'); - - /** @var string|null $memoryLimit */ - $memoryLimit = $input->getOption('memory-limit'); - - /** @var string|null $autoloadFile */ - $autoloadFile = $input->getOption('autoload-file'); - - /** @var string|null $configurationFile */ - $configurationFile = $input->getOption('configuration'); - - /** @var string|null $pathsFile */ - $pathsFile = $input->getOption('paths-file'); - - /** @var bool $allowXdebug */ - $allowXdebug = $input->getOption('xdebug'); - - $inceptionResult = CommandHelper::begin( - $input, - $output, - $paths, - $pathsFile, - $memoryLimit, - $autoloadFile, - $configurationFile, - '0', // irrelevant but prevents an error when a config file is passed - $allowXdebug - ); - } catch (\PHPStan\Command\InceptionNotSuccessfulException $e) { - return 1; - } - - $consoleStyle = $inceptionResult->getConsoleStyle(); - - /** @var DependencyDumper $dependencyDumper */ - $dependencyDumper = $inceptionResult->getContainer()->getByType(DependencyDumper::class); - - /** @var FileHelper $fileHelper */ - $fileHelper = $inceptionResult->getContainer()->getByType(FileHelper::class); - - /** @var string[] $analysedPaths */ - $analysedPaths = $input->getOption('analysed-paths'); - $analysedPaths = array_map(static function (string $path) use ($fileHelper): string { - return $fileHelper->absolutizePath($path); - }, $analysedPaths); - $dependencies = $dependencyDumper->dumpDependencies( - $inceptionResult->getFiles(), - static function (int $count) use ($consoleStyle): void { - $consoleStyle->progressStart($count); - }, - static function () use ($consoleStyle): void { - $consoleStyle->progressAdvance(); - }, - count($analysedPaths) > 0 ? $analysedPaths : null - ); - $consoleStyle->progressFinish(); - $consoleStyle->writeln(Json::encode($dependencies, Json::PRETTY)); - - return $inceptionResult->handleReturn(0); - } - -} diff --git a/vendor/phpstan/phpstan/src/Command/ErrorFormatter/BaselineNeonErrorFormatter.php b/vendor/phpstan/phpstan/src/Command/ErrorFormatter/BaselineNeonErrorFormatter.php deleted file mode 100644 index 11caca3..0000000 --- a/vendor/phpstan/phpstan/src/Command/ErrorFormatter/BaselineNeonErrorFormatter.php +++ /dev/null @@ -1,75 +0,0 @@ -relativePathHelper = $relativePathHelper; - } - - public function formatErrors( - AnalysisResult $analysisResult, - OutputStyle $style - ): int - { - if (!$analysisResult->hasErrors()) { - $style->writeln(Neon::encode([ - 'parameters' => [ - 'ignoreErrors' => [], - ], - ], Neon::BLOCK), OutputInterface::OUTPUT_RAW); - return 0; - } - - $fileErrors = []; - foreach ($analysisResult->getFileSpecificErrors() as $fileSpecificError) { - if (!$fileSpecificError->canBeIgnored()) { - continue; - } - $fileErrors[$fileSpecificError->getFilePath()][] = $fileSpecificError->getMessage(); - } - - $errorsToOutput = []; - foreach ($fileErrors as $file => $errorMessages) { - $fileErrorsCounts = []; - foreach ($errorMessages as $errorMessage) { - if (!isset($fileErrorsCounts[$errorMessage])) { - $fileErrorsCounts[$errorMessage] = 1; - continue; - } - - $fileErrorsCounts[$errorMessage]++; - } - - foreach ($fileErrorsCounts as $message => $count) { - $errorsToOutput[] = [ - 'message' => '#^' . preg_quote($message, '#') . '$#', - 'count' => $count, - 'path' => $this->relativePathHelper->getRelativePath($file), - ]; - } - } - - $style->writeln(Neon::encode([ - 'parameters' => [ - 'ignoreErrors' => $errorsToOutput, - ], - ], Neon::BLOCK), OutputInterface::OUTPUT_RAW); - - return 1; - } - -} diff --git a/vendor/phpstan/phpstan/src/Command/ErrorFormatter/CheckstyleErrorFormatter.php b/vendor/phpstan/phpstan/src/Command/ErrorFormatter/CheckstyleErrorFormatter.php deleted file mode 100644 index ae25609..0000000 --- a/vendor/phpstan/phpstan/src/Command/ErrorFormatter/CheckstyleErrorFormatter.php +++ /dev/null @@ -1,102 +0,0 @@ -relativePathHelper = $relativePathHelper; - } - - /** - * Formats the errors and outputs them to the console. - * - * @param \PHPStan\Command\AnalysisResult $analysisResult - * @param \Symfony\Component\Console\Style\OutputStyle $style - * @return int Error code. - */ - public function formatErrors( - AnalysisResult $analysisResult, - OutputStyle $style - ): int - { - $style->writeln(''); - $style->writeln(''); - - foreach ($this->groupByFile($analysisResult) as $relativeFilePath => $errors) { - $style->writeln(sprintf( - '', - $this->escape($relativeFilePath) - )); - - foreach ($errors as $error) { - $style->writeln(sprintf( - ' ', - $this->escape((string) $error->getLine()), - $this->escape((string) $error->getMessage()) - )); - } - $style->writeln(''); - } - - $notFileSpecificErrors = $analysisResult->getNotFileSpecificErrors(); - - if (count($notFileSpecificErrors) > 0) { - $style->writeln(''); - - foreach ($notFileSpecificErrors as $error) { - $style->writeln(sprintf(' ', $this->escape($error))); - } - - $style->writeln(''); - } - - $style->writeln(''); - - return $analysisResult->hasErrors() ? 1 : 0; - } - - /** - * Escapes values for using in XML - * - * @param string $string - * @return string - */ - protected function escape(string $string): string - { - return htmlspecialchars($string, ENT_XML1 | ENT_COMPAT, 'UTF-8'); - } - - /** - * Group errors by file - * - * @param AnalysisResult $analysisResult - * @return array Array that have as key the relative path of file - * and as value an array with occured errors. - */ - private function groupByFile(AnalysisResult $analysisResult): array - { - $files = []; - - /** @var \PHPStan\Analyser\Error $fileSpecificError */ - foreach ($analysisResult->getFileSpecificErrors() as $fileSpecificError) { - $relativeFilePath = $this->relativePathHelper->getRelativePath( - $fileSpecificError->getFile() - ); - - $files[$relativeFilePath][] = $fileSpecificError; - } - - return $files; - } - -} diff --git a/vendor/phpstan/phpstan/src/Command/ErrorFormatter/ErrorFormatter.php b/vendor/phpstan/phpstan/src/Command/ErrorFormatter/ErrorFormatter.php deleted file mode 100644 index 6a675db..0000000 --- a/vendor/phpstan/phpstan/src/Command/ErrorFormatter/ErrorFormatter.php +++ /dev/null @@ -1,22 +0,0 @@ -getFileSpecificErrors() as $fileSpecificError) { - $error = [ - 'description' => $fileSpecificError->getMessage(), - 'fingerprint' => hash( - 'sha256', - implode( - [ - $fileSpecificError->getFile(), - $fileSpecificError->getLine(), - $fileSpecificError->getMessage(), - ] - ) - ), - 'location' => [ - 'path' => $fileSpecificError->getFile(), - 'lines' => [ - 'begin' => $fileSpecificError->getLine(), - ], - ], - ]; - - if (!$fileSpecificError->canBeIgnored()) { - $error['severity'] = 'blocker'; - } - - $errorsArray[] = $error; - } - - foreach ($analysisResult->getNotFileSpecificErrors() as $notFileSpecificError) { - $errorsArray[] = [ - 'description' => $notFileSpecificError, - 'fingerprint' => hash('sha256', $notFileSpecificError), - 'location' => [ - 'path' => '', - 'lines' => [ - 'begin' => 0, - ], - ], - ]; - } - - $json = Json::encode($errorsArray, Json::PRETTY); - - $style->write($json); - - return $analysisResult->hasErrors() ? 1 : 0; - } - -} diff --git a/vendor/phpstan/phpstan/src/Command/ErrorFormatter/JsonErrorFormatter.php b/vendor/phpstan/phpstan/src/Command/ErrorFormatter/JsonErrorFormatter.php deleted file mode 100644 index 38d9e05..0000000 --- a/vendor/phpstan/phpstan/src/Command/ErrorFormatter/JsonErrorFormatter.php +++ /dev/null @@ -1,59 +0,0 @@ -pretty = $pretty; - } - - public function formatErrors(AnalysisResult $analysisResult, OutputStyle $style): int - { - $errorsArray = [ - 'totals' => [ - 'errors' => count($analysisResult->getNotFileSpecificErrors()), - 'file_errors' => count($analysisResult->getFileSpecificErrors()), - ], - 'files' => [], - 'errors' => [], - ]; - - foreach ($analysisResult->getFileSpecificErrors() as $fileSpecificError) { - $file = $fileSpecificError->getFile(); - if (!array_key_exists($file, $errorsArray['files'])) { - $errorsArray['files'][$file] = [ - 'errors' => 0, - 'messages' => [], - ]; - } - $errorsArray['files'][$file]['errors']++; - - $errorsArray['files'][$file]['messages'][] = [ - 'message' => $fileSpecificError->getMessage(), - 'line' => $fileSpecificError->getLine(), - 'ignorable' => $fileSpecificError->canBeIgnored(), - ]; - } - - foreach ($analysisResult->getNotFileSpecificErrors() as $notFileSpecificError) { - $errorsArray['errors'][] = $notFileSpecificError; - } - - $json = Json::encode($errorsArray, $this->pretty ? Json::PRETTY : 0); - - $style->write($json); - - return $analysisResult->hasErrors() ? 1 : 0; - } - -} diff --git a/vendor/phpstan/phpstan/src/Command/ErrorFormatter/RawErrorFormatter.php b/vendor/phpstan/phpstan/src/Command/ErrorFormatter/RawErrorFormatter.php deleted file mode 100644 index b5d6913..0000000 --- a/vendor/phpstan/phpstan/src/Command/ErrorFormatter/RawErrorFormatter.php +++ /dev/null @@ -1,38 +0,0 @@ -hasErrors()) { - return 0; - } - - foreach ($analysisResult->getNotFileSpecificErrors() as $notFileSpecificError) { - $style->writeln(sprintf('?:?:%s', $notFileSpecificError)); - } - - foreach ($analysisResult->getFileSpecificErrors() as $fileSpecificError) { - $style->writeln( - sprintf( - '%s:%d:%s', - $fileSpecificError->getFile(), - $fileSpecificError->getLine() ?? '?', - $fileSpecificError->getMessage() - ) - ); - } - - return 1; - } - -} diff --git a/vendor/phpstan/phpstan/src/Command/ErrorFormatter/TableErrorFormatter.php b/vendor/phpstan/phpstan/src/Command/ErrorFormatter/TableErrorFormatter.php deleted file mode 100644 index e72af64..0000000 --- a/vendor/phpstan/phpstan/src/Command/ErrorFormatter/TableErrorFormatter.php +++ /dev/null @@ -1,107 +0,0 @@ -relativePathHelper = $relativePathHelper; - $this->showTipsOfTheDay = $showTipsOfTheDay; - $this->checkThisOnly = $checkThisOnly; - $this->inferPrivatePropertyTypeFromConstructor = $inferPrivatePropertyTypeFromConstructor; - } - - public function formatErrors( - AnalysisResult $analysisResult, - OutputStyle $style - ): int - { - if (!$analysisResult->hasErrors()) { - $style->success('No errors'); - if ($this->showTipsOfTheDay) { - if ($analysisResult->isDefaultLevelUsed()) { - $style->writeln('💡 Tip of the Day:'); - $style->writeln(sprintf( - "PHPStan is performing only the most basic checks.\nYou can pass a higher rule level through the --%s option\n(the default and current level is %d) to analyse code more thoroughly.", - AnalyseCommand::OPTION_LEVEL, - AnalyseCommand::DEFAULT_LEVEL - )); - $style->writeln(''); - } elseif ( - !$this->checkThisOnly - && $analysisResult->hasInferrablePropertyTypesFromConstructor() - && !$this->inferPrivatePropertyTypeFromConstructor - ) { - $projectConfigFile = 'phpstan.neon'; - if ($analysisResult->getProjectConfigFile() !== null) { - $projectConfigFile = $this->relativePathHelper->getRelativePath($analysisResult->getProjectConfigFile()); - } - $style->writeln('💡 Tip of the Day:'); - $style->writeln("One or more properties in your code do not have a phpDoc with a type\nbut it could be inferred from the constructor to find more bugs."); - $style->writeln(sprintf('Use inferPrivatePropertyTypeFromConstructor: true in your %s to try it out!', $projectConfigFile)); - $style->writeln(''); - } - } - - return 0; - } - - /** @var array $fileErrors */ - $fileErrors = []; - foreach ($analysisResult->getFileSpecificErrors() as $fileSpecificError) { - if (!isset($fileErrors[$fileSpecificError->getFile()])) { - $fileErrors[$fileSpecificError->getFile()] = []; - } - - $fileErrors[$fileSpecificError->getFile()][] = $fileSpecificError; - } - - foreach ($fileErrors as $file => $errors) { - $rows = []; - foreach ($errors as $error) { - $rows[] = [ - (string) $error->getLine(), - $error->getMessage(), - ]; - } - - $relativeFilePath = $this->relativePathHelper->getRelativePath($file); - - $style->table(['Line', $relativeFilePath], $rows); - } - - if (count($analysisResult->getNotFileSpecificErrors()) > 0) { - $style->table(['Error'], array_map(static function (string $error): array { - return [$error]; - }, $analysisResult->getNotFileSpecificErrors())); - } - - $style->error(sprintf($analysisResult->getTotalErrorsCount() === 1 ? 'Found %d error' : 'Found %d errors', $analysisResult->getTotalErrorsCount())); - return 1; - } - -} diff --git a/vendor/phpstan/phpstan/src/Command/ErrorsConsoleStyle.php b/vendor/phpstan/phpstan/src/Command/ErrorsConsoleStyle.php deleted file mode 100644 index be38746..0000000 --- a/vendor/phpstan/phpstan/src/Command/ErrorsConsoleStyle.php +++ /dev/null @@ -1,116 +0,0 @@ -showProgress = $input->hasOption(self::OPTION_NO_PROGRESS) && !(bool) $input->getOption(self::OPTION_NO_PROGRESS); - } - - /** - * @param string[] $headers - * @param string[][] $rows - */ - public function table(array $headers, array $rows): void - { - /** @var int $terminalWidth */ - $terminalWidth = (new \Symfony\Component\Console\Terminal())->getWidth(); - $maxHeaderWidth = strlen($headers[0]); - foreach ($rows as $row) { - $length = strlen($row[0]); - if ($maxHeaderWidth !== 0 && $length <= $maxHeaderWidth) { - continue; - } - - $maxHeaderWidth = $length; - } - - $wrap = static function ($rows) use ($terminalWidth, $maxHeaderWidth) { - return array_map(static function ($row) use ($terminalWidth, $maxHeaderWidth) { - return array_map(static function ($s) use ($terminalWidth, $maxHeaderWidth) { - if ($terminalWidth > $maxHeaderWidth + 5) { - return wordwrap( - $s, - $terminalWidth - $maxHeaderWidth - 5, - "\n", - true - ); - } - - return $s; - }, $row); - }, $rows); - }; - - parent::table($headers, $wrap($rows)); - } - - /** - * @phpcsSuppress SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingParameterTypeHint - * @param int $max - */ - public function createProgressBar($max = 0): ProgressBar - { - $this->progressBar = parent::createProgressBar($max); - $this->progressBar->setOverwrite(true); - return $this->progressBar; - } - - /** - * @phpcsSuppress SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingParameterTypeHint - * @param int $max - */ - public function progressStart($max = 0): void - { - if (!$this->showProgress) { - return; - } - parent::progressStart($max); - } - - /** - * @phpcsSuppress SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingParameterTypeHint - * @param int $step - */ - public function progressAdvance($step = 1): void - { - if (!$this->showProgress) { - return; - } - if ($step > 0) { - $stepTime = (time() - $this->progressBar->getStartTime()) / $step; - if ($stepTime > 0 && $stepTime < 1) { - $this->progressBar->setRedrawFrequency((int) (1 / $stepTime)); - } else { - $this->progressBar->setRedrawFrequency(1); - } - } - - $this->progressBar->setProgress($this->progressBar->getProgress() + $step); - } - - public function progressFinish(): void - { - if (!$this->showProgress) { - return; - } - parent::progressFinish(); - } - -} diff --git a/vendor/phpstan/phpstan/src/Command/InceptionNotSuccessfulException.php b/vendor/phpstan/phpstan/src/Command/InceptionNotSuccessfulException.php deleted file mode 100644 index 872b71c..0000000 --- a/vendor/phpstan/phpstan/src/Command/InceptionNotSuccessfulException.php +++ /dev/null @@ -1,8 +0,0 @@ -files = $files; - $this->onlyFiles = $onlyFiles; - $this->consoleStyle = $consoleStyle; - $this->errorOutput = $errorOutput; - $this->container = $container; - $this->isDefaultLevelUsed = $isDefaultLevelUsed; - $this->memoryLimitFile = $memoryLimitFile; - $this->projectConfigFile = $projectConfigFile; - } - - /** - * @return string[] - */ - public function getFiles(): array - { - return $this->files; - } - - public function isOnlyFiles(): bool - { - return $this->onlyFiles; - } - - public function getConsoleStyle(): OutputStyle - { - return $this->consoleStyle; - } - - public function getErrorOutput(): OutputInterface - { - return $this->errorOutput; - } - - public function getContainer(): Container - { - return $this->container; - } - - public function isDefaultLevelUsed(): bool - { - return $this->isDefaultLevelUsed; - } - - public function getProjectConfigFile(): ?string - { - return $this->projectConfigFile; - } - - public function handleReturn(int $exitCode): int - { - @unlink($this->memoryLimitFile); - return $exitCode; - } - -} diff --git a/vendor/phpstan/phpstan/src/Dependency/DependencyDumper.php b/vendor/phpstan/phpstan/src/Dependency/DependencyDumper.php deleted file mode 100644 index 710df8a..0000000 --- a/vendor/phpstan/phpstan/src/Dependency/DependencyDumper.php +++ /dev/null @@ -1,143 +0,0 @@ -dependencyResolver = $dependencyResolver; - $this->nodeScopeResolver = $nodeScopeResolver; - $this->fileHelper = $fileHelper; - $this->parser = $parser; - $this->scopeFactory = $scopeFactory; - $this->fileFinder = $fileFinder; - } - - /** - * @param string[] $files - * @param callable(int $count): void $countCallback - * @param callable(): void $progressCallback - * @param string[]|null $analysedPaths - * @return string[][] - */ - public function dumpDependencies( - array $files, - callable $countCallback, - callable $progressCallback, - ?array $analysedPaths - ): array - { - $analysedFiles = $files; - if ($analysedPaths !== null) { - $analysedFiles = $this->fileFinder->findFiles($analysedPaths)->getFiles(); - } - $this->nodeScopeResolver->setAnalysedFiles($analysedFiles); - $analysedFiles = array_fill_keys($analysedFiles, true); - - $dependencies = []; - $countCallback(count($files)); - foreach ($files as $file) { - try { - $parserNodes = $this->parser->parseFile($file); - } catch (\PHPStan\Parser\ParserErrorsException $e) { - continue; - } - - $fileDependencies = []; - try { - $this->nodeScopeResolver->processNodes( - $parserNodes, - $this->scopeFactory->create(ScopeContext::create($file)), - function (\PhpParser\Node $node, Scope $scope) use ($analysedFiles, &$fileDependencies): void { - $fileDependencies = array_merge( - $fileDependencies, - $this->resolveDependencies($node, $scope, $analysedFiles) - ); - } - ); - } catch (\PHPStan\AnalysedCodeException $e) { - // pass - } - - foreach (array_unique($fileDependencies) as $fileDependency) { - $relativeDependencyFile = $fileDependency; - $dependencies[$relativeDependencyFile][] = $file; - } - - $progressCallback(); - } - - return $dependencies; - } - - /** - * @param \PhpParser\Node $node - * @param Scope $scope - * @param array $analysedFiles - * @return string[] - */ - private function resolveDependencies( - \PhpParser\Node $node, - Scope $scope, - array $analysedFiles - ): array - { - $dependencies = []; - - foreach ($this->dependencyResolver->resolveDependencies($node, $scope) as $dependencyReflection) { - $dependencyFile = $dependencyReflection->getFileName(); - if ($dependencyFile === false) { - continue; - } - $dependencyFile = $this->fileHelper->normalizePath($dependencyFile); - - if ($scope->getFile() === $dependencyFile) { - continue; - } - - if (!isset($analysedFiles[$dependencyFile])) { - continue; - } - - $dependencies[$dependencyFile] = $dependencyFile; - } - - return array_values($dependencies); - } - -} diff --git a/vendor/phpstan/phpstan/src/Dependency/DependencyResolver.php b/vendor/phpstan/phpstan/src/Dependency/DependencyResolver.php deleted file mode 100644 index 8258dd8..0000000 --- a/vendor/phpstan/phpstan/src/Dependency/DependencyResolver.php +++ /dev/null @@ -1,256 +0,0 @@ -broker = $broker; - } - - /** - * @param \PhpParser\Node $node - * @param Scope $scope - * @return ReflectionWithFilename[] - */ - public function resolveDependencies(\PhpParser\Node $node, Scope $scope): array - { - $dependenciesReflections = []; - - if ($node instanceof \PhpParser\Node\Stmt\Class_) { - if ($node->extends !== null) { - $this->addClassToDependencies($node->extends->toString(), $dependenciesReflections); - } - foreach ($node->implements as $className) { - $this->addClassToDependencies($className->toString(), $dependenciesReflections); - } - } elseif ($node instanceof \PhpParser\Node\Stmt\Interface_) { - if ($node->extends !== null) { - foreach ($node->extends as $className) { - $this->addClassToDependencies($className->toString(), $dependenciesReflections); - } - } - } elseif ($node instanceof ClassMethod) { - if (!$scope->isInClass()) { - throw new \PHPStan\ShouldNotHappenException(); - } - $nativeMethod = $scope->getClassReflection()->getNativeMethod($node->name->name); - if ($nativeMethod instanceof PhpMethodReflection) { - /** @var \PHPStan\Reflection\ParametersAcceptorWithPhpDocs $parametersAcceptor */ - $parametersAcceptor = ParametersAcceptorSelector::selectSingle($nativeMethod->getVariants()); - - $this->extractFromParametersAcceptor($parametersAcceptor, $dependenciesReflections); - } - } elseif ($node instanceof Function_) { - $functionName = $node->name->name; - if (isset($node->namespacedName)) { - $functionName = (string) $node->namespacedName; - } - $functionNameName = new Name($functionName); - if ($this->broker->hasCustomFunction($functionNameName, null)) { - $functionReflection = $this->broker->getCustomFunction($functionNameName, null); - - /** @var \PHPStan\Reflection\ParametersAcceptorWithPhpDocs $parametersAcceptor */ - $parametersAcceptor = ParametersAcceptorSelector::selectSingle($functionReflection->getVariants()); - $this->extractFromParametersAcceptor($parametersAcceptor, $dependenciesReflections); - } - } elseif ($node instanceof Closure) { - /** @var ClosureType $closureType */ - $closureType = $scope->getType($node); - foreach ($closureType->getParameters() as $parameter) { - $referencedClasses = $parameter->getType()->getReferencedClasses(); - foreach ($referencedClasses as $referencedClass) { - $this->addClassToDependencies($referencedClass, $dependenciesReflections); - } - } - - $returnTypeReferencedClasses = $closureType->getReturnType()->getReferencedClasses(); - foreach ($returnTypeReferencedClasses as $referencedClass) { - $this->addClassToDependencies($referencedClass, $dependenciesReflections); - } - } elseif ($node instanceof \PhpParser\Node\Expr\FuncCall) { - $functionName = $node->name; - if ($functionName instanceof \PhpParser\Node\Name) { - try { - $dependenciesReflections[] = $this->getFunctionReflection($functionName, $scope); - } catch (\PHPStan\Broker\FunctionNotFoundException $e) { - // pass - } - } else { - $variants = $scope->getType($functionName)->getCallableParametersAcceptors($scope); - foreach ($variants as $variant) { - $referencedClasses = $variant->getReturnType()->getReferencedClasses(); - foreach ($referencedClasses as $referencedClass) { - $this->addClassToDependencies($referencedClass, $dependenciesReflections); - } - } - } - - $returnType = $scope->getType($node); - foreach ($returnType->getReferencedClasses() as $referencedClass) { - $this->addClassToDependencies($referencedClass, $dependenciesReflections); - } - } elseif ($node instanceof \PhpParser\Node\Expr\MethodCall || $node instanceof \PhpParser\Node\Expr\PropertyFetch) { - $classNames = $scope->getType($node->var)->getReferencedClasses(); - foreach ($classNames as $className) { - $this->addClassToDependencies($className, $dependenciesReflections); - } - - $returnType = $scope->getType($node); - foreach ($returnType->getReferencedClasses() as $referencedClass) { - $this->addClassToDependencies($referencedClass, $dependenciesReflections); - } - } elseif ( - $node instanceof \PhpParser\Node\Expr\StaticCall - || $node instanceof \PhpParser\Node\Expr\ClassConstFetch - || $node instanceof \PhpParser\Node\Expr\StaticPropertyFetch - ) { - if ($node->class instanceof \PhpParser\Node\Name) { - $this->addClassToDependencies($scope->resolveName($node->class), $dependenciesReflections); - } else { - foreach ($scope->getType($node->class)->getReferencedClasses() as $referencedClass) { - $this->addClassToDependencies($referencedClass, $dependenciesReflections); - } - } - - $returnType = $scope->getType($node); - foreach ($returnType->getReferencedClasses() as $referencedClass) { - $this->addClassToDependencies($referencedClass, $dependenciesReflections); - } - } elseif ( - $node instanceof \PhpParser\Node\Expr\New_ - && $node->class instanceof \PhpParser\Node\Name - ) { - $this->addClassToDependencies($scope->resolveName($node->class), $dependenciesReflections); - } elseif ($node instanceof \PhpParser\Node\Stmt\TraitUse) { - foreach ($node->traits as $traitName) { - $this->addClassToDependencies($traitName->toString(), $dependenciesReflections); - } - } elseif ($node instanceof \PhpParser\Node\Expr\Instanceof_) { - if ($node->class instanceof Name) { - $this->addClassToDependencies($scope->resolveName($node->class), $dependenciesReflections); - } - } elseif ($node instanceof \PhpParser\Node\Stmt\Catch_) { - foreach ($node->types as $type) { - $this->addClassToDependencies($scope->resolveName($type), $dependenciesReflections); - } - } elseif ($node instanceof ArrayDimFetch && $node->dim !== null) { - $varType = $scope->getType($node->var); - $dimType = $scope->getType($node->dim); - - foreach ($varType->getOffsetValueType($dimType)->getReferencedClasses() as $referencedClass) { - $this->addClassToDependencies($referencedClass, $dependenciesReflections); - } - } elseif ($node instanceof Foreach_) { - $exprType = $scope->getType($node->expr); - if ($node->keyVar !== null) { - foreach ($exprType->getIterableKeyType()->getReferencedClasses() as $referencedClass) { - $this->addClassToDependencies($referencedClass, $dependenciesReflections); - } - } - - foreach ($exprType->getIterableValueType()->getReferencedClasses() as $referencedClass) { - $this->addClassToDependencies($referencedClass, $dependenciesReflections); - } - } elseif ($node instanceof Array_) { - $arrayType = $scope->getType($node); - if (!$arrayType->isCallable()->no()) { - foreach ($arrayType->getCallableParametersAcceptors($scope) as $variant) { - $referencedClasses = $variant->getReturnType()->getReferencedClasses(); - foreach ($referencedClasses as $referencedClass) { - $this->addClassToDependencies($referencedClass, $dependenciesReflections); - } - } - } - } - - return $dependenciesReflections; - } - - /** - * @param string $className - * @param ReflectionWithFilename[] $dependenciesReflections - */ - private function addClassToDependencies(string $className, array &$dependenciesReflections): void - { - try { - $classReflection = $this->broker->getClass($className); - } catch (\PHPStan\Broker\ClassNotFoundException $e) { - return; - } - - do { - $dependenciesReflections[] = $classReflection; - - foreach ($classReflection->getInterfaces() as $interface) { - $dependenciesReflections[] = $interface; - } - - foreach ($classReflection->getTraits() as $trait) { - $dependenciesReflections[] = $trait; - } - - $classReflection = $classReflection->getParentClass(); - } while ($classReflection !== false); - } - - private function getFunctionReflection(\PhpParser\Node\Name $nameNode, ?Scope $scope): ReflectionWithFilename - { - $reflection = $this->broker->getFunction($nameNode, $scope); - if (!$reflection instanceof ReflectionWithFilename) { - throw new \PHPStan\Broker\FunctionNotFoundException((string) $nameNode); - } - - return $reflection; - } - - /** - * @param ParametersAcceptorWithPhpDocs $parametersAcceptor - * @param ReflectionWithFilename[] $dependenciesReflections - */ - private function extractFromParametersAcceptor( - ParametersAcceptorWithPhpDocs $parametersAcceptor, - array &$dependenciesReflections - ): void - { - foreach ($parametersAcceptor->getParameters() as $parameter) { - $referencedClasses = array_merge( - $parameter->getNativeType()->getReferencedClasses(), - $parameter->getPhpDocType()->getReferencedClasses() - ); - - foreach ($referencedClasses as $referencedClass) { - $this->addClassToDependencies($referencedClass, $dependenciesReflections); - } - } - - $returnTypeReferencedClasses = array_merge( - $parametersAcceptor->getNativeReturnType()->getReferencedClasses(), - $parametersAcceptor->getPhpDocReturnType()->getReferencedClasses() - ); - foreach ($returnTypeReferencedClasses as $referencedClass) { - $this->addClassToDependencies($referencedClass, $dependenciesReflections); - } - } - -} diff --git a/vendor/phpstan/phpstan/src/DependencyInjection/ConditionalTagsExtension.php b/vendor/phpstan/phpstan/src/DependencyInjection/ConditionalTagsExtension.php deleted file mode 100644 index 664dc01..0000000 --- a/vendor/phpstan/phpstan/src/DependencyInjection/ConditionalTagsExtension.php +++ /dev/null @@ -1,55 +0,0 @@ - $bool, - BrokerFactory::METHODS_CLASS_REFLECTION_EXTENSION_TAG => $bool, - BrokerFactory::DYNAMIC_METHOD_RETURN_TYPE_EXTENSION_TAG => $bool, - BrokerFactory::DYNAMIC_STATIC_METHOD_RETURN_TYPE_EXTENSION_TAG => $bool, - BrokerFactory::DYNAMIC_FUNCTION_RETURN_TYPE_EXTENSION_TAG => $bool, - BrokerFactory::OPERATOR_TYPE_SPECIFYING_EXTENSION_TAG => $bool, - RegistryFactory::RULE_TAG => $bool, - TypeNodeResolverFactory::EXTENSION_TAG => $bool, - TypeSpecifierFactory::FUNCTION_TYPE_SPECIFYING_EXTENSION_TAG => $bool, - TypeSpecifierFactory::METHOD_TYPE_SPECIFYING_EXTENSION_TAG => $bool, - TypeSpecifierFactory::STATIC_METHOD_TYPE_SPECIFYING_EXTENSION_TAG => $bool, - ])->min(1)); - } - - public function beforeCompile(): void - { - /** @var mixed[] $config */ - $config = $this->config; - $builder = $this->getContainerBuilder(); - - foreach ($config as $type => $tags) { - $services = $builder->findByType($type); - if (count($services) === 0) { - throw new \PHPStan\ShouldNotHappenException(sprintf('No services of type "%s" found.', $type)); - } - foreach ($services as $service) { - foreach ($tags as $tag => $parameter) { - if ((bool) $parameter) { - $service->addTag($tag); - continue; - } - } - } - } - } - -} diff --git a/vendor/phpstan/phpstan/src/DependencyInjection/Configurator.php b/vendor/phpstan/phpstan/src/DependencyInjection/Configurator.php deleted file mode 100644 index 942f38e..0000000 --- a/vendor/phpstan/phpstan/src/DependencyInjection/Configurator.php +++ /dev/null @@ -1,33 +0,0 @@ -loaderFactory = $loaderFactory; - - parent::__construct(); - } - - protected function createLoader(): Loader - { - return $this->loaderFactory->createLoader(); - } - - /** - * @return mixed[] - */ - protected function getDefaultParameters(): array - { - return []; - } - -} diff --git a/vendor/phpstan/phpstan/src/DependencyInjection/Container.php b/vendor/phpstan/phpstan/src/DependencyInjection/Container.php deleted file mode 100644 index 41d6205..0000000 --- a/vendor/phpstan/phpstan/src/DependencyInjection/Container.php +++ /dev/null @@ -1,32 +0,0 @@ -currentWorkingDirectory = $currentWorkingDirectory; - $fileHelper = new FileHelper($currentWorkingDirectory); - - $rootDir = __DIR__ . '/../..'; - $originalRootDir = $fileHelper->normalizePath($rootDir); - if (extension_loaded('phar')) { - $pharPath = Phar::running(false); - if ($pharPath !== '') { - $rootDir = dirname($pharPath); - } - } - $this->rootDirectory = $fileHelper->normalizePath($rootDir); - $this->configDirectory = $originalRootDir . '/conf'; - } - - /** - * @param string $tempDirectory - * @param string[] $additionalConfigFiles - * @param string[] $analysedPaths - * @return \Nette\DI\Container - */ - public function create( - string $tempDirectory, - array $additionalConfigFiles, - array $analysedPaths - ): \Nette\DI\Container - { - $configurator = new Configurator(new LoaderFactory( - $this->rootDirectory, - $this->currentWorkingDirectory - )); - $configurator->defaultExtensions = [ - 'php' => PhpExtension::class, - 'extensions' => \Nette\DI\Extensions\ExtensionsExtension::class, - ]; - $configurator->setDebugMode(true); - $configurator->setTempDirectory($tempDirectory); - $configurator->addParameters([ - 'rootDir' => $this->rootDirectory, - 'currentWorkingDirectory' => $this->currentWorkingDirectory, - 'cliArgumentsVariablesRegistered' => ini_get('register_argc_argv') === '1', - 'tmpDir' => $tempDirectory, - ]); - $configurator->addConfig($this->configDirectory . '/config.neon'); - foreach ($additionalConfigFiles as $additionalConfigFile) { - $configurator->addConfig($additionalConfigFile); - } - - $configurator->addServices([ - 'relativePathHelper' => new FuzzyRelativePathHelper($this->currentWorkingDirectory, DIRECTORY_SEPARATOR, $analysedPaths), - ]); - - $container = $configurator->createContainer(); - - /** @var Broker $broker */ - $broker = $container->getService('broker'); - Broker::registerInstance($broker); - $container->getService('typeSpecifier'); - - return $container; - } - - public function getCurrentWorkingDirectory(): string - { - return $this->currentWorkingDirectory; - } - - public function getRootDirectory(): string - { - return $this->rootDirectory; - } - - public function getConfigDirectory(): string - { - return $this->configDirectory; - } - -} diff --git a/vendor/phpstan/phpstan/src/DependencyInjection/LoaderFactory.php b/vendor/phpstan/phpstan/src/DependencyInjection/LoaderFactory.php deleted file mode 100644 index 190de4f..0000000 --- a/vendor/phpstan/phpstan/src/DependencyInjection/LoaderFactory.php +++ /dev/null @@ -1,38 +0,0 @@ -rootDir = $rootDir; - $this->currentWorkingDirectory = $currentWorkingDirectory; - } - - public function createLoader(): Loader - { - $loader = new Loader(); - $loader->addAdapter('dist', NeonAdapter::class); - $loader->setParameters([ - 'rootDir' => $this->rootDir, - 'currentWorkingDirectory' => $this->currentWorkingDirectory, - ]); - - return $loader; - } - -} diff --git a/vendor/phpstan/phpstan/src/DependencyInjection/Nette/NetteContainer.php b/vendor/phpstan/phpstan/src/DependencyInjection/Nette/NetteContainer.php deleted file mode 100644 index 8e628ae..0000000 --- a/vendor/phpstan/phpstan/src/DependencyInjection/Nette/NetteContainer.php +++ /dev/null @@ -1,65 +0,0 @@ -container = $container; - } - - /** - * @param string $serviceName - * @return mixed - */ - public function getService(string $serviceName) - { - return $this->container->getService($serviceName); - } - - /** - * @param string $className - * @return mixed - */ - public function getByType(string $className) - { - return $this->container->getByType($className); - } - - /** - * @param string $tagName - * @return mixed[] - */ - public function getServicesByTag(string $tagName): array - { - return $this->tagsToServices($this->container->findByTag($tagName)); - } - - /** - * @param string $parameterName - * @return mixed - */ - public function getParameter(string $parameterName) - { - return $this->container->parameters[$parameterName] ?? null; - } - - /** - * @param mixed[] $tags - * @return mixed[] - */ - private function tagsToServices(array $tags): array - { - return array_map(function (string $serviceName) { - return $this->getService($serviceName); - }, array_keys($tags)); - } - -} diff --git a/vendor/phpstan/phpstan/src/DependencyInjection/ParametersSchemaExtension.php b/vendor/phpstan/phpstan/src/DependencyInjection/ParametersSchemaExtension.php deleted file mode 100644 index 9dd81c3..0000000 --- a/vendor/phpstan/phpstan/src/DependencyInjection/ParametersSchemaExtension.php +++ /dev/null @@ -1,94 +0,0 @@ -min(1); - } - - public function loadConfiguration(): void - { - $config = $this->config; - $config['__parametersSchema'] = new Statement(Schema::class); - $builder = $this->getContainerBuilder(); - $builder->parameters['__parametersSchema'] = $this->processArgument( - new Statement('schema', [ - new Statement('structure', [$config]), - ]) - ); - } - - /** - * @param Statement[] $statements - * @return \Nette\Schema\Schema - */ - private function processSchema(array $statements): Schema - { - if (count($statements) === 0) { - throw new \PHPStan\ShouldNotHappenException(); - } - - $parameterSchema = null; - foreach ($statements as $statement) { - $processedArguments = array_map(function ($argument) { - return $this->processArgument($argument); - }, $statement->arguments); - if ($parameterSchema === null) { - /** @var \Nette\Schema\Elements\Type|\Nette\Schema\Elements\AnyOf|\Nette\Schema\Elements\Structure $parameterSchema */ - $parameterSchema = Expect::{$statement->getEntity()}(...$processedArguments); - } else { - $parameterSchema->{$statement->getEntity()}(...$processedArguments); - } - } - - $parameterSchema->required(); - - return $parameterSchema; - } - - /** - * @param mixed $argument - * @return mixed - */ - private function processArgument($argument) - { - if ($argument instanceof Statement) { - if ($argument->entity === 'schema') { - $arguments = []; - foreach ($argument->arguments as $schemaArgument) { - if (!$schemaArgument instanceof Statement) { - throw new \PHPStan\ShouldNotHappenException('schema() should contain another statement().'); - } - - $arguments[] = $schemaArgument; - } - - if (count($arguments) === 0) { - throw new \PHPStan\ShouldNotHappenException('schema() should have at least one argument.'); - } - - return $this->processSchema($arguments); - } - - return $this->processSchema([$argument]); - } elseif (is_array($argument)) { - $processedArray = []; - foreach ($argument as $key => $val) { - $processedArray[$key] = $this->processArgument($val); - } - - return $processedArray; - } - - return $argument; - } - -} diff --git a/vendor/phpstan/phpstan/src/DependencyInjection/RulesExtension.php b/vendor/phpstan/phpstan/src/DependencyInjection/RulesExtension.php deleted file mode 100644 index b72f286..0000000 --- a/vendor/phpstan/phpstan/src/DependencyInjection/RulesExtension.php +++ /dev/null @@ -1,30 +0,0 @@ -config; - $builder = $this->getContainerBuilder(); - - foreach ($config as $key => $rule) { - $builder->addDefinition($this->prefix((string) $key)) - ->setFactory($rule) - ->setAutowired(false) - ->addTag(RegistryFactory::RULE_TAG); - } - } - -} diff --git a/vendor/phpstan/phpstan/src/File/FileExcluder.php b/vendor/phpstan/phpstan/src/File/FileExcluder.php deleted file mode 100644 index 507e22e..0000000 --- a/vendor/phpstan/phpstan/src/File/FileExcluder.php +++ /dev/null @@ -1,69 +0,0 @@ -analyseExcludes = array_map(function (string $exclude) use ($fileHelper): string { - $len = strlen($exclude); - $trailingDirSeparator = ($len > 0 && in_array($exclude[$len - 1], ['\\', '/'], true)); - - $normalized = $fileHelper->normalizePath($exclude); - - if ($trailingDirSeparator) { - $normalized .= DIRECTORY_SEPARATOR; - } - - if ($this->isFnmatchPattern($normalized)) { - return $normalized; - } - - return $fileHelper->absolutizePath($normalized); - }, $analyseExcludes); - } - - public function isExcludedFromAnalysing(string $file): bool - { - foreach ($this->analyseExcludes as $exclude) { - if (strpos($file, $exclude) === 0) { - return true; - } - - $isWindows = DIRECTORY_SEPARATOR === '\\'; - if ($isWindows) { - $fnmatchFlags = FNM_NOESCAPE | FNM_CASEFOLD; - } else { - $fnmatchFlags = 0; - } - - if ($this->isFnmatchPattern($exclude) && fnmatch($exclude, $file, $fnmatchFlags)) { - return true; - } - } - - return false; - } - - private function isFnmatchPattern(string $path): bool - { - return preg_match('~[*?[\]]~', $path) > 0; - } - -} diff --git a/vendor/phpstan/phpstan/src/File/FileFinder.php b/vendor/phpstan/phpstan/src/File/FileFinder.php deleted file mode 100644 index 85c9b3f..0000000 --- a/vendor/phpstan/phpstan/src/File/FileFinder.php +++ /dev/null @@ -1,65 +0,0 @@ -fileExcluder = $fileExcluder; - $this->fileHelper = $fileHelper; - $this->fileExtensions = $fileExtensions; - } - - /** - * @param string[] $paths - * @return FileFinderResult - */ - public function findFiles(array $paths): FileFinderResult - { - $onlyFiles = true; - $files = []; - foreach ($paths as $path) { - if (!file_exists($path)) { - throw new \PHPStan\File\PathNotFoundException($path); - } elseif (is_file($path)) { - $files[] = $this->fileHelper->normalizePath($path); - } else { - $finder = new Finder(); - $finder->followLinks(); - foreach ($finder->files()->name('*.{' . implode(',', $this->fileExtensions) . '}')->in($path) as $fileInfo) { - $files[] = $this->fileHelper->normalizePath($fileInfo->getPathname()); - $onlyFiles = false; - } - } - } - - $files = array_values(array_filter($files, function (string $file): bool { - return !$this->fileExcluder->isExcludedFromAnalysing($file); - })); - - return new FileFinderResult($files, $onlyFiles); - } - -} diff --git a/vendor/phpstan/phpstan/src/File/FileFinderResult.php b/vendor/phpstan/phpstan/src/File/FileFinderResult.php deleted file mode 100644 index 37d8818..0000000 --- a/vendor/phpstan/phpstan/src/File/FileFinderResult.php +++ /dev/null @@ -1,37 +0,0 @@ -files = $files; - $this->onlyFiles = $onlyFiles; - } - - /** - * @return string[] - */ - public function getFiles(): array - { - return $this->files; - } - - public function isOnlyFiles(): bool - { - return $this->onlyFiles; - } - -} diff --git a/vendor/phpstan/phpstan/src/File/FileHelper.php b/vendor/phpstan/phpstan/src/File/FileHelper.php deleted file mode 100644 index 88c25df..0000000 --- a/vendor/phpstan/phpstan/src/File/FileHelper.php +++ /dev/null @@ -1,77 +0,0 @@ -workingDirectory = $this->normalizePath($workingDirectory); - } - - public function getWorkingDirectory(): string - { - return $this->workingDirectory; - } - - public function absolutizePath(string $path): string - { - if (DIRECTORY_SEPARATOR === '/') { - if (substr($path, 0, 1) === '/') { - return $path; - } - } else { - if (substr($path, 1, 1) === ':') { - return $path; - } - } - if (\Nette\Utils\Strings::startsWith($path, 'phar://')) { - return $path; - } - - return rtrim($this->getWorkingDirectory(), '/\\') . DIRECTORY_SEPARATOR . ltrim($path, '/\\'); - } - - public function normalizePath(string $originalPath): string - { - $matches = \Nette\Utils\Strings::match($originalPath, '~^([a-z]+)\\:\\/\\/(.+)~'); - if ($matches !== null) { - [, $scheme, $path] = $matches; - } else { - $scheme = null; - $path = $originalPath; - } - - $path = str_replace('\\', '/', $path); - $path = Strings::replace($path, '~/{2,}~', '/'); - - $pathRoot = strpos($path, '/') === 0 ? DIRECTORY_SEPARATOR : ''; - $pathParts = explode('/', trim($path, '/')); - - $normalizedPathParts = []; - foreach ($pathParts as $pathPart) { - if ($pathPart === '.') { - continue; - } - if ($pathPart === '..') { - /** @var string $removedPart */ - $removedPart = array_pop($normalizedPathParts); - if ($scheme === 'phar' && substr($removedPart, -5) === '.phar') { - $scheme = null; - } - - } else { - $normalizedPathParts[] = $pathPart; - } - } - - return ($scheme !== null ? $scheme . '://' : '') . $pathRoot . implode(DIRECTORY_SEPARATOR, $normalizedPathParts); - } - -} diff --git a/vendor/phpstan/phpstan/src/File/FuzzyRelativePathHelper.php b/vendor/phpstan/phpstan/src/File/FuzzyRelativePathHelper.php deleted file mode 100644 index 20796fa..0000000 --- a/vendor/phpstan/phpstan/src/File/FuzzyRelativePathHelper.php +++ /dev/null @@ -1,105 +0,0 @@ -directorySeparator = $directorySeparator; - $pathBeginning = null; - $pathToTrimArray = null; - $trimBeginning = static function (string $path): array { - if (substr($path, 0, 1) === '/') { - return [ - '/', - substr($path, 1), - ]; - } elseif (substr($path, 1, 1) === ':') { - return [ - substr($path, 0, 3), - substr($path, 3), - ]; - } - - return ['', $path]; - }; - - if ( - !in_array($currentWorkingDirectory, ['', '/'], true) - && !(strlen($currentWorkingDirectory) === 3 && substr($currentWorkingDirectory, 1, 1) === ':') - ) { - [$pathBeginning, $currentWorkingDirectory] = $trimBeginning($currentWorkingDirectory); - - /** @var string[] $pathToTrimArray */ - $pathToTrimArray = explode($directorySeparator, $currentWorkingDirectory); - } - foreach ($analysedPaths as $pathNumber => $path) { - [$tempPathBeginning, $path] = $trimBeginning($path); - - /** @var string[] $pathArray */ - $pathArray = explode($directorySeparator, $path); - $pathTempParts = []; - foreach ($pathArray as $i => $pathPart) { - if (\Nette\Utils\Strings::endsWith($pathPart, '.php')) { - continue; - } - if (!isset($pathToTrimArray[$i])) { - if ($pathNumber !== 0) { - $pathToTrimArray = $pathTempParts; - continue 2; - } - } elseif ($pathToTrimArray[$i] !== $pathPart) { - $pathToTrimArray = $pathTempParts; - continue 2; - } - - $pathTempParts[] = $pathPart; - } - - $pathBeginning = $tempPathBeginning; - $pathToTrimArray = $pathTempParts; - } - - if ($pathToTrimArray === null || count($pathToTrimArray) === 0) { - return; - } - - $pathToTrim = $pathBeginning . implode($directorySeparator, $pathToTrimArray); - $realPathToTrim = realpath($pathToTrim); - if ($realPathToTrim !== false) { - $pathToTrim = $realPathToTrim; - } - - $this->pathToTrim = $pathToTrim; - } - - public function getRelativePath(string $filename): string - { - if ( - $this->pathToTrim !== null - && strpos($filename, $this->pathToTrim) === 0 - ) { - return ltrim(substr($filename, strlen($this->pathToTrim)), $this->directorySeparator); - } - - return $filename; - } - -} diff --git a/vendor/phpstan/phpstan/src/File/PathNotFoundException.php b/vendor/phpstan/phpstan/src/File/PathNotFoundException.php deleted file mode 100644 index c03ae5f..0000000 --- a/vendor/phpstan/phpstan/src/File/PathNotFoundException.php +++ /dev/null @@ -1,22 +0,0 @@ -path = $path; - } - - public function getPath(): string - { - return $this->path; - } - -} diff --git a/vendor/phpstan/phpstan/src/File/RelativePathHelper.php b/vendor/phpstan/phpstan/src/File/RelativePathHelper.php deleted file mode 100644 index d0dff0a..0000000 --- a/vendor/phpstan/phpstan/src/File/RelativePathHelper.php +++ /dev/null @@ -1,10 +0,0 @@ -currentWorkingDirectory = $currentWorkingDirectory; - } - - public function getRelativePath(string $filename): string - { - if ($this->currentWorkingDirectory !== '' && strpos($filename, $this->currentWorkingDirectory) === 0) { - return substr($filename, strlen($this->currentWorkingDirectory) + 1); - } - - return $filename; - } - -} diff --git a/vendor/phpstan/phpstan/src/Internal/ContainerDynamicReturnTypeExtension.php b/vendor/phpstan/phpstan/src/Internal/ContainerDynamicReturnTypeExtension.php deleted file mode 100644 index 58703f7..0000000 --- a/vendor/phpstan/phpstan/src/Internal/ContainerDynamicReturnTypeExtension.php +++ /dev/null @@ -1,52 +0,0 @@ -getName(), [ - 'getByType', - ], true); - } - - public function getTypeFromMethodCall(MethodReflection $methodReflection, MethodCall $methodCall, Scope $scope): Type - { - if (count($methodCall->args) === 0) { - return ParametersAcceptorSelector::selectSingle($methodReflection->getVariants())->getReturnType(); - } - $argType = $scope->getType($methodCall->args[0]->value); - if (!$argType instanceof ConstantStringType) { - return ParametersAcceptorSelector::selectSingle($methodReflection->getVariants())->getReturnType(); - } - - $type = new ObjectType($argType->getValue()); - if ($methodReflection->getName() === 'getByType' && count($methodCall->args) >= 2) { - $argType = $scope->getType($methodCall->args[1]->value); - if ($argType instanceof ConstantBooleanType && $argType->getValue()) { - $type = TypeCombinator::addNull($type); - } - } - - return $type; - } - -} diff --git a/vendor/phpstan/phpstan/src/Internal/ScopeIsInClassTypeSpecifyingExtension.php b/vendor/phpstan/phpstan/src/Internal/ScopeIsInClassTypeSpecifyingExtension.php deleted file mode 100644 index 6edb867..0000000 --- a/vendor/phpstan/phpstan/src/Internal/ScopeIsInClassTypeSpecifyingExtension.php +++ /dev/null @@ -1,85 +0,0 @@ -isInMethodName = $isInMethodName; - $this->removeNullMethodName = $removeNullMethodName; - $this->broker = $broker; - } - - public function setTypeSpecifier(TypeSpecifier $typeSpecifier): void - { - $this->typeSpecifier = $typeSpecifier; - } - - public function getClass(): string - { - return ClassMemberAccessAnswerer::class; - } - - public function isMethodSupported( - MethodReflection $methodReflection, - MethodCall $node, - TypeSpecifierContext $context - ): bool - { - return $methodReflection->getName() === $this->isInMethodName - && !$context->null(); - } - - public function specifyTypes( - MethodReflection $methodReflection, - MethodCall $node, - Scope $scope, - TypeSpecifierContext $context - ): SpecifiedTypes - { - $scopeClass = $this->broker->getClass(Scope::class); - $methodVariants = $scopeClass - ->getMethod($this->removeNullMethodName, $scope) - ->getVariants(); - - return $this->typeSpecifier->create( - new MethodCall($node->var, $this->removeNullMethodName), - TypeCombinator::removeNull( - ParametersAcceptorSelector::selectSingle($methodVariants)->getReturnType() - ), - $context - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/Internal/UnionTypeGetInternalDynamicReturnTypeExtension.php b/vendor/phpstan/phpstan/src/Internal/UnionTypeGetInternalDynamicReturnTypeExtension.php deleted file mode 100644 index fa06f30..0000000 --- a/vendor/phpstan/phpstan/src/Internal/UnionTypeGetInternalDynamicReturnTypeExtension.php +++ /dev/null @@ -1,40 +0,0 @@ -getName() === 'getInternal'; - } - - public function getTypeFromMethodCall( - MethodReflection $methodReflection, - MethodCall $methodCall, - Scope $scope - ): Type - { - if (count($methodCall->args) < 2) { - return ParametersAcceptorSelector::selectSingle($methodReflection->getVariants())->getReturnType(); - } - - $getterClosureType = $scope->getType($methodCall->args[1]->value); - return ParametersAcceptorSelector::selectSingle($getterClosureType->getCallableParametersAcceptors($scope))->getReturnType(); - } - -} diff --git a/vendor/phpstan/phpstan/src/Node/ClosureReturnStatementsNode.php b/vendor/phpstan/phpstan/src/Node/ClosureReturnStatementsNode.php deleted file mode 100644 index b17d2b1..0000000 --- a/vendor/phpstan/phpstan/src/Node/ClosureReturnStatementsNode.php +++ /dev/null @@ -1,66 +0,0 @@ -getAttributes()); - $this->closureExpr = $closureExpr; - $this->returnStatements = $returnStatements; - $this->statementResult = $statementResult; - } - - public function getClosureExpr(): Closure - { - return $this->closureExpr; - } - - /** - * @return \PHPStan\Node\ReturnStatement[] - */ - public function getReturnStatements(): array - { - return $this->returnStatements; - } - - public function getStatementResult(): StatementResult - { - return $this->statementResult; - } - - public function getType(): string - { - return 'PHPStan_Node_ClosureReturnStatementsNode'; - } - - public function getSubNodeNames(): array - { - return []; - } - -} diff --git a/vendor/phpstan/phpstan/src/Node/ExecutionEndNode.php b/vendor/phpstan/phpstan/src/Node/ExecutionEndNode.php deleted file mode 100644 index 853ed78..0000000 --- a/vendor/phpstan/phpstan/src/Node/ExecutionEndNode.php +++ /dev/null @@ -1,58 +0,0 @@ -getAttributes()); - $this->node = $node; - $this->statementResult = $statementResult; - $this->hasNativeReturnTypehint = $hasNativeReturnTypehint; - } - - public function getNode(): Node - { - return $this->node; - } - - public function getStatementResult(): StatementResult - { - return $this->statementResult; - } - - public function hasNativeReturnTypehint(): bool - { - return $this->hasNativeReturnTypehint; - } - - public function getType(): string - { - return 'PHPStan_Node_ExecutionEndNode'; - } - - public function getSubNodeNames(): array - { - return []; - } - -} diff --git a/vendor/phpstan/phpstan/src/Node/FileNode.php b/vendor/phpstan/phpstan/src/Node/FileNode.php deleted file mode 100644 index c711716..0000000 --- a/vendor/phpstan/phpstan/src/Node/FileNode.php +++ /dev/null @@ -1,41 +0,0 @@ -getAttributes() : []); - $this->nodes = $nodes; - } - - /** - * @return \PhpParser\Node[] - */ - public function getNodes(): array - { - return $this->nodes; - } - - public function getType(): string - { - return 'PHPStan_Node_FileNode'; - } - - public function getSubNodeNames(): array - { - return []; - } - -} diff --git a/vendor/phpstan/phpstan/src/Node/FunctionReturnStatementsNode.php b/vendor/phpstan/phpstan/src/Node/FunctionReturnStatementsNode.php deleted file mode 100644 index 0090359..0000000 --- a/vendor/phpstan/phpstan/src/Node/FunctionReturnStatementsNode.php +++ /dev/null @@ -1,57 +0,0 @@ -getAttributes()); - $this->returnStatements = $returnStatements; - $this->statementResult = $statementResult; - } - - /** - * @return \PHPStan\Node\ReturnStatement[] - */ - public function getReturnStatements(): array - { - return $this->returnStatements; - } - - public function getStatementResult(): StatementResult - { - return $this->statementResult; - } - - public function getType(): string - { - return 'PHPStan_Node_FunctionReturnStatementsNode'; - } - - public function getSubNodeNames(): array - { - return []; - } - -} diff --git a/vendor/phpstan/phpstan/src/Node/InArrowFunctionNode.php b/vendor/phpstan/phpstan/src/Node/InArrowFunctionNode.php deleted file mode 100644 index 9c93cc5..0000000 --- a/vendor/phpstan/phpstan/src/Node/InArrowFunctionNode.php +++ /dev/null @@ -1,35 +0,0 @@ -getAttributes()); - $this->originalNode = $originalNode; - } - - public function getOriginalNode(): \PhpParser\Node\Expr\ArrowFunction - { - return $this->originalNode; - } - - public function getType(): string - { - return 'PHPStan_Node_InArrowFunctionNode'; - } - - public function getSubNodeNames(): array - { - return []; - } - -} diff --git a/vendor/phpstan/phpstan/src/Node/InClassMethodNode.php b/vendor/phpstan/phpstan/src/Node/InClassMethodNode.php deleted file mode 100644 index 654532e..0000000 --- a/vendor/phpstan/phpstan/src/Node/InClassMethodNode.php +++ /dev/null @@ -1,32 +0,0 @@ -getAttributes()); - $this->originalNode = $originalNode; - } - - public function getOriginalNode(): \PhpParser\Node\Stmt\ClassMethod - { - return $this->originalNode; - } - - public function getType(): string - { - return 'PHPStan_Stmt_InClassMethodNode'; - } - - public function getSubNodeNames(): array - { - return []; - } - -} diff --git a/vendor/phpstan/phpstan/src/Node/LiteralArrayItem.php b/vendor/phpstan/phpstan/src/Node/LiteralArrayItem.php deleted file mode 100644 index 699517a..0000000 --- a/vendor/phpstan/phpstan/src/Node/LiteralArrayItem.php +++ /dev/null @@ -1,33 +0,0 @@ -scope = $scope; - $this->arrayItem = $arrayItem; - } - - public function getScope(): Scope - { - return $this->scope; - } - - public function getArrayItem(): ArrayItem - { - return $this->arrayItem; - } - -} diff --git a/vendor/phpstan/phpstan/src/Node/LiteralArrayNode.php b/vendor/phpstan/phpstan/src/Node/LiteralArrayNode.php deleted file mode 100644 index e5cf9f2..0000000 --- a/vendor/phpstan/phpstan/src/Node/LiteralArrayNode.php +++ /dev/null @@ -1,42 +0,0 @@ -getAttributes()); - $this->itemNodes = $itemNodes; - } - - /** - * @return LiteralArrayItem[] - */ - public function getItemNodes(): array - { - return $this->itemNodes; - } - - public function getType(): string - { - return 'PHPStan_Node_LiteralArray'; - } - - public function getSubNodeNames(): array - { - return []; - } - -} diff --git a/vendor/phpstan/phpstan/src/Node/MethodReturnStatementsNode.php b/vendor/phpstan/phpstan/src/Node/MethodReturnStatementsNode.php deleted file mode 100644 index 3d6ec32..0000000 --- a/vendor/phpstan/phpstan/src/Node/MethodReturnStatementsNode.php +++ /dev/null @@ -1,57 +0,0 @@ -getAttributes()); - $this->returnStatements = $returnStatements; - $this->statementResult = $statementResult; - } - - /** - * @return \PHPStan\Node\ReturnStatement[] - */ - public function getReturnStatements(): array - { - return $this->returnStatements; - } - - public function getStatementResult(): StatementResult - { - return $this->statementResult; - } - - public function getType(): string - { - return 'PHPStan_Node_FunctionReturnStatementsNode'; - } - - public function getSubNodeNames(): array - { - return []; - } - -} diff --git a/vendor/phpstan/phpstan/src/Node/ReturnStatement.php b/vendor/phpstan/phpstan/src/Node/ReturnStatement.php deleted file mode 100644 index 43c4fe9..0000000 --- a/vendor/phpstan/phpstan/src/Node/ReturnStatement.php +++ /dev/null @@ -1,33 +0,0 @@ -scope = $scope; - $this->returnNode = $returnNode; - } - - public function getScope(): Scope - { - return $this->scope; - } - - public function getReturnNode(): Return_ - { - return $this->returnNode; - } - -} diff --git a/vendor/phpstan/phpstan/src/Node/UnreachableStatementNode.php b/vendor/phpstan/phpstan/src/Node/UnreachableStatementNode.php deleted file mode 100644 index ec605a9..0000000 --- a/vendor/phpstan/phpstan/src/Node/UnreachableStatementNode.php +++ /dev/null @@ -1,34 +0,0 @@ -getAttributes()); - $this->originalStatement = $originalStatement; - } - - public function getOriginalStatement(): Stmt - { - return $this->originalStatement; - } - - public function getType(): string - { - return 'PHPStan_Stmt_UnreachableStatementNode'; - } - - public function getSubNodeNames(): array - { - return []; - } - -} diff --git a/vendor/phpstan/phpstan/src/Node/VirtualNode.php b/vendor/phpstan/phpstan/src/Node/VirtualNode.php deleted file mode 100644 index fcb0772..0000000 --- a/vendor/phpstan/phpstan/src/Node/VirtualNode.php +++ /dev/null @@ -1,10 +0,0 @@ -originalParser = $originalParser; - $this->cachedNodesByFileCountMax = $cachedNodesByFileCountMax; - $this->cachedNodesByStringCountMax = $cachedNodesByStringCountMax; - } - - /** - * @param string $file path to a file to parse - * @return \PhpParser\Node[] - */ - public function parseFile(string $file): array - { - if ($this->cachedNodesByFileCountMax !== 0 && $this->cachedNodesByFileCount >= $this->cachedNodesByFileCountMax) { - $this->cachedNodesByFile = array_slice( - $this->cachedNodesByFile, - 1, - null, - true - ); - - --$this->cachedNodesByFileCount; - } - - if (!isset($this->cachedNodesByFile[$file])) { - $this->cachedNodesByFile[$file] = $this->originalParser->parseFile($file); - $this->cachedNodesByFileCount++; - } - - return $this->cachedNodesByFile[$file]; - } - - /** - * @param string $sourceCode - * @return \PhpParser\Node[] - */ - public function parseString(string $sourceCode): array - { - if ($this->cachedNodesByStringCountMax !== 0 && $this->cachedNodesByStringCount >= $this->cachedNodesByStringCountMax) { - $this->cachedNodesByString = array_slice( - $this->cachedNodesByString, - 1, - null, - true - ); - - --$this->cachedNodesByStringCount; - } - - if (!isset($this->cachedNodesByString[$sourceCode])) { - $this->cachedNodesByString[$sourceCode] = $this->originalParser->parseString($sourceCode); - $this->cachedNodesByStringCount++; - } - - return $this->cachedNodesByString[$sourceCode]; - } - - public function getCachedNodesByFileCount(): int - { - return $this->cachedNodesByFileCount; - } - - public function getCachedNodesByFileCountMax(): int - { - return $this->cachedNodesByFileCountMax; - } - - public function getCachedNodesByStringCount(): int - { - return $this->cachedNodesByStringCount; - } - - public function getCachedNodesByStingCountMax(): int - { - return $this->cachedNodesByStringCountMax; - } - - public function getCachedNodesByFile(): array - { - return $this->cachedNodesByFile; - } - - public function getCachedNodesByString(): array - { - return $this->cachedNodesByString; - } - -} diff --git a/vendor/phpstan/phpstan/src/Parser/DirectParser.php b/vendor/phpstan/phpstan/src/Parser/DirectParser.php deleted file mode 100644 index a884d36..0000000 --- a/vendor/phpstan/phpstan/src/Parser/DirectParser.php +++ /dev/null @@ -1,53 +0,0 @@ -parser = $parser; - $this->traverser = $traverser; - } - - /** - * @param string $file path to a file to parse - * @return \PhpParser\Node[] - */ - public function parseFile(string $file): array - { - $contents = file_get_contents($file); - if ($contents === false) { - throw new \PHPStan\ShouldNotHappenException(); - } - return $this->parseString($contents); - } - - /** - * @param string $sourceCode - * @return \PhpParser\Node[] - */ - public function parseString(string $sourceCode): array - { - $errorHandler = new Collecting(); - $nodes = $this->parser->parse($sourceCode, $errorHandler); - if ($errorHandler->hasErrors()) { - throw new \PHPStan\Parser\ParserErrorsException($errorHandler->getErrors()); - } - if ($nodes === null) { - throw new \PHPStan\ShouldNotHappenException(); - } - return $this->traverser->traverse($nodes); - } - -} diff --git a/vendor/phpstan/phpstan/src/Parser/FunctionCallStatementFinder.php b/vendor/phpstan/phpstan/src/Parser/FunctionCallStatementFinder.php deleted file mode 100644 index 7336d98..0000000 --- a/vendor/phpstan/phpstan/src/Parser/FunctionCallStatementFinder.php +++ /dev/null @@ -1,45 +0,0 @@ -findFunctionCallInStatements($functionNames, $statement); - if ($result !== null) { - return $result; - } - } - - if (!($statement instanceof \PhpParser\Node)) { - continue; - } - - if ($statement instanceof FuncCall && $statement->name instanceof Name) { - if (in_array((string) $statement->name, $functionNames, true)) { - return $statement; - } - } - - $result = $this->findFunctionCallInStatements($functionNames, $statement); - if ($result !== null) { - return $result; - } - } - - return null; - } - -} diff --git a/vendor/phpstan/phpstan/src/Parser/Parser.php b/vendor/phpstan/phpstan/src/Parser/Parser.php deleted file mode 100644 index cce0686..0000000 --- a/vendor/phpstan/phpstan/src/Parser/Parser.php +++ /dev/null @@ -1,20 +0,0 @@ -getMessage(); - }, $errors))); - $this->errors = $errors; - } - - /** - * @return \PhpParser\Error[] - */ - public function getErrors(): array - { - return $this->errors; - } - -} diff --git a/vendor/phpstan/phpstan/src/PhpDoc/PhpDocBlock.php b/vendor/phpstan/phpstan/src/PhpDoc/PhpDocBlock.php deleted file mode 100644 index fb8fd2a..0000000 --- a/vendor/phpstan/phpstan/src/PhpDoc/PhpDocBlock.php +++ /dev/null @@ -1,270 +0,0 @@ -docComment = $docComment; - $this->file = $file; - $this->class = $class; - $this->trait = $trait; - $this->explicit = $explicit; - } - - public function getDocComment(): string - { - return $this->docComment; - } - - public function getFile(): string - { - return $this->file; - } - - public function getClass(): string - { - return $this->class; - } - - public function getTrait(): ?string - { - return $this->trait; - } - - public function isExplicit(): bool - { - return $this->explicit; - } - - public static function resolvePhpDocBlockForProperty( - Broker $broker, - ?string $docComment, - string $class, - ?string $trait, - string $propertyName, - string $file, - ?bool $explicit = null - ): ?self - { - return self::resolvePhpDocBlock( - $broker, - $docComment, - $class, - $trait, - $propertyName, - $file, - 'hasNativeProperty', - 'getNativeProperty', - __FUNCTION__, - $explicit - ); - } - - public static function resolvePhpDocBlockForMethod( - Broker $broker, - ?string $docComment, - string $class, - ?string $trait, - string $methodName, - string $file, - ?bool $explicit = null - ): ?self - { - return self::resolvePhpDocBlock( - $broker, - $docComment, - $class, - $trait, - $methodName, - $file, - 'hasNativeMethod', - 'getNativeMethod', - __FUNCTION__, - $explicit - ); - } - - private static function resolvePhpDocBlock( - Broker $broker, - ?string $docComment, - string $class, - ?string $trait, - string $name, - string $file, - string $hasMethodName, - string $getMethodName, - string $resolveMethodName, - ?bool $explicit - ): ?self - { - if ( - ( - $docComment === null - || preg_match('#@inheritdoc|\{@inheritdoc\}#i', $docComment) > 0 - ) - && $broker->hasClass($class) - ) { - $classReflection = $broker->getClass($class); - if ($classReflection->getParentClass() !== false) { - $parentClassReflection = $classReflection->getParentClass(); - $phpDocBlockFromClass = self::resolvePhpDocBlockRecursive( - $broker, - $parentClassReflection, - $trait, - $name, - $hasMethodName, - $getMethodName, - $resolveMethodName, - $explicit ?? $docComment !== null - ); - if ($phpDocBlockFromClass !== null) { - return $phpDocBlockFromClass; - } - } - - foreach ($classReflection->getInterfaces() as $interface) { - $phpDocBlockFromClass = self::resolvePhpDocBlockFromClass( - $broker, - $interface, - $name, - $hasMethodName, - $getMethodName, - $resolveMethodName, - $explicit ?? $docComment !== null - ); - if ($phpDocBlockFromClass !== null) { - return $phpDocBlockFromClass; - } - } - } - - return $docComment !== null - ? new self($docComment, $file, $class, $trait, $explicit ?? true) - : null; - } - - private static function resolvePhpDocBlockRecursive( - Broker $broker, - ClassReflection $classReflection, - ?string $trait, - string $name, - string $hasMethodName, - string $getMethodName, - string $resolveMethodName, - bool $explicit - ): ?self - { - $phpDocBlockFromClass = self::resolvePhpDocBlockFromClass( - $broker, - $classReflection, - $name, - $hasMethodName, - $getMethodName, - $resolveMethodName, - $explicit - ); - - if ($phpDocBlockFromClass !== null) { - return $phpDocBlockFromClass; - } - - $parentClassReflection = $classReflection->getParentClass(); - if ($parentClassReflection !== false) { - return self::resolvePhpDocBlockRecursive( - $broker, - $parentClassReflection, - $trait, - $name, - $hasMethodName, - $getMethodName, - $resolveMethodName, - $explicit - ); - } - - return null; - } - - private static function resolvePhpDocBlockFromClass( - Broker $broker, - ClassReflection $classReflection, - string $name, - string $hasMethodName, - string $getMethodName, - string $resolveMethodName, - bool $explicit - ): ?self - { - if ($classReflection->getFileName() !== false && $classReflection->$hasMethodName($name)) { - /** @var \PHPStan\Reflection\PropertyReflection|\PHPStan\Reflection\MethodReflection $parentReflection */ - $parentReflection = $classReflection->$getMethodName($name); - if ( - !$parentReflection instanceof PhpPropertyReflection - && !$parentReflection instanceof PhpMethodReflection - ) { - return null; - } - if ($parentReflection->isPrivate()) { - return null; - } - if ( - !$parentReflection->getDeclaringClass()->isTrait() - && $parentReflection->getDeclaringClass()->getName() !== $classReflection->getName() - ) { - return null; - } - - $traitReflection = $parentReflection instanceof PhpMethodReflection - ? $parentReflection->getDeclaringTrait() - : null; - - $trait = $traitReflection !== null - ? $traitReflection->getName() - : null; - - if ($parentReflection->getDocComment() !== false) { - return self::$resolveMethodName( - $broker, - $parentReflection->getDocComment(), - $classReflection->getName(), - $trait, - $name, - $classReflection->getFileName(), - $explicit - ); - } - } - - return null; - } - -} diff --git a/vendor/phpstan/phpstan/src/PhpDoc/PhpDocNodeResolver.php b/vendor/phpstan/phpstan/src/PhpDoc/PhpDocNodeResolver.php deleted file mode 100644 index 7110cfc..0000000 --- a/vendor/phpstan/phpstan/src/PhpDoc/PhpDocNodeResolver.php +++ /dev/null @@ -1,248 +0,0 @@ -typeNodeResolver = $typeNodeResolver; - } - - public function resolve(PhpDocNode $phpDocNode, NameScope $nameScope): ResolvedPhpDocBlock - { - return ResolvedPhpDocBlock::create( - $this->resolveVarTags($phpDocNode, $nameScope), - $this->resolveMethodTags($phpDocNode, $nameScope), - $this->resolvePropertyTags($phpDocNode, $nameScope), - $this->resolveParamTags($phpDocNode, $nameScope), - $this->resolveReturnTag($phpDocNode, $nameScope), - $this->resolveThrowsTags($phpDocNode, $nameScope), - $this->resolveDeprecatedTag($phpDocNode, $nameScope), - $this->resolveIsDeprecated($phpDocNode), - $this->resolveIsInternal($phpDocNode), - $this->resolveIsFinal($phpDocNode) - ); - } - - /** - * @param PhpDocNode $phpDocNode - * @param NameScope $nameScope - * @return array - */ - private function resolveVarTags(PhpDocNode $phpDocNode, NameScope $nameScope): array - { - $resolved = []; - foreach ($phpDocNode->getVarTagValues() as $tagValue) { - if ($tagValue->variableName !== '') { - $variableName = substr($tagValue->variableName, 1); - $type = !isset($resolved[$variableName]) - ? $this->typeNodeResolver->resolve($tagValue->type, $nameScope) - : new MixedType(); - $resolved[$variableName] = new VarTag($type); - - } else { - $resolved[] = new VarTag($this->typeNodeResolver->resolve($tagValue->type, $nameScope)); - } - } - - return $resolved; - } - - /** - * @param PhpDocNode $phpDocNode - * @param NameScope $nameScope - * @return array - */ - private function resolvePropertyTags(PhpDocNode $phpDocNode, NameScope $nameScope): array - { - $resolved = []; - - foreach ($phpDocNode->getPropertyTagValues() as $tagValue) { - $propertyName = substr($tagValue->propertyName, 1); - $propertyType = !isset($resolved[$propertyName]) - ? $this->typeNodeResolver->resolve($tagValue->type, $nameScope) - : new MixedType(); - - $resolved[$propertyName] = new PropertyTag( - $propertyType, - true, - true - ); - } - - foreach ($phpDocNode->getPropertyReadTagValues() as $tagValue) { - $propertyName = substr($tagValue->propertyName, 1); - $propertyType = !isset($resolved[$propertyName]) - ? $this->typeNodeResolver->resolve($tagValue->type, $nameScope) - : new MixedType(); - - $resolved[$propertyName] = new PropertyTag( - $propertyType, - true, - false - ); - } - - foreach ($phpDocNode->getPropertyWriteTagValues() as $tagValue) { - $propertyName = substr($tagValue->propertyName, 1); - $propertyType = !isset($resolved[$propertyName]) - ? $this->typeNodeResolver->resolve($tagValue->type, $nameScope) - : new MixedType(); - - $resolved[$propertyName] = new PropertyTag( - $propertyType, - false, - true - ); - } - - return $resolved; - } - - /** - * @param PhpDocNode $phpDocNode - * @param NameScope $nameScope - * @return array - */ - private function resolveMethodTags(PhpDocNode $phpDocNode, NameScope $nameScope): array - { - $resolved = []; - - foreach ($phpDocNode->getMethodTagValues() as $tagValue) { - $parameters = []; - foreach ($tagValue->parameters as $parameterNode) { - $parameterName = substr($parameterNode->parameterName, 1); - $type = $parameterNode->type !== null ? $this->typeNodeResolver->resolve($parameterNode->type, $nameScope) : new MixedType(); - if ($parameterNode->defaultValue instanceof ConstExprNullNode) { - $type = TypeCombinator::addNull($type); - } - $parameters[$parameterName] = new MethodTagParameter( - $type, - $parameterNode->isReference - ? PassedByReference::createCreatesNewVariable() - : PassedByReference::createNo(), - $parameterNode->isVariadic || $parameterNode->defaultValue !== null, - $parameterNode->isVariadic - ); - } - - $resolved[$tagValue->methodName] = new MethodTag( - $tagValue->returnType !== null ? $this->typeNodeResolver->resolve($tagValue->returnType, $nameScope) : new MixedType(), - $tagValue->isStatic, - $parameters - ); - } - - return $resolved; - } - - /** - * @param PhpDocNode $phpDocNode - * @param NameScope $nameScope - * @return array - */ - private function resolveParamTags(PhpDocNode $phpDocNode, NameScope $nameScope): array - { - $resolved = []; - foreach ($phpDocNode->getParamTagValues() as $tagValue) { - $parameterName = substr($tagValue->parameterName, 1); - $parameterType = !isset($resolved[$parameterName]) - ? $this->typeNodeResolver->resolve($tagValue->type, $nameScope) - : new MixedType(); - - if ($tagValue->isVariadic) { - if (!$parameterType instanceof ArrayType) { - $parameterType = new ArrayType(new IntegerType(), $parameterType); - - } elseif ($parameterType->getKeyType() instanceof MixedType) { - $parameterType = new ArrayType(new IntegerType(), $parameterType->getItemType()); - } - } - - $resolved[$parameterName] = new ParamTag( - $parameterType, - $tagValue->isVariadic - ); - } - - return $resolved; - } - - private function resolveReturnTag(PhpDocNode $phpDocNode, NameScope $nameScope): ?\PHPStan\PhpDoc\Tag\ReturnTag - { - foreach ($phpDocNode->getReturnTagValues() as $tagValue) { - return new ReturnTag($this->typeNodeResolver->resolve($tagValue->type, $nameScope)); - } - - return null; - } - - private function resolveThrowsTags(PhpDocNode $phpDocNode, NameScope $nameScope): ?\PHPStan\PhpDoc\Tag\ThrowsTag - { - $types = array_map(function (ThrowsTagValueNode $throwsTagValue) use ($nameScope): Type { - return $this->typeNodeResolver->resolve($throwsTagValue->type, $nameScope); - }, $phpDocNode->getThrowsTagValues()); - - if (count($types) === 0) { - return null; - } - - return new ThrowsTag(TypeCombinator::union(...$types)); - } - - private function resolveDeprecatedTag(PhpDocNode $phpDocNode, NameScope $nameScope): ?\PHPStan\PhpDoc\Tag\DeprecatedTag - { - foreach ($phpDocNode->getDeprecatedTagValues() as $deprecatedTagValue) { - $description = (string) $deprecatedTagValue; - return new DeprecatedTag($description === '' ? null : $description); - } - - return null; - } - - private function resolveIsDeprecated(PhpDocNode $phpDocNode): bool - { - $deprecatedTags = $phpDocNode->getTagsByName('@deprecated'); - - return count($deprecatedTags) > 0; - } - - private function resolveIsInternal(PhpDocNode $phpDocNode): bool - { - $internalTags = $phpDocNode->getTagsByName('@internal'); - - return count($internalTags) > 0; - } - - private function resolveIsFinal(PhpDocNode $phpDocNode): bool - { - $finalTags = $phpDocNode->getTagsByName('@final'); - - return count($finalTags) > 0; - } - -} diff --git a/vendor/phpstan/phpstan/src/PhpDoc/PhpDocStringResolver.php b/vendor/phpstan/phpstan/src/PhpDoc/PhpDocStringResolver.php deleted file mode 100644 index e688982..0000000 --- a/vendor/phpstan/phpstan/src/PhpDoc/PhpDocStringResolver.php +++ /dev/null @@ -1,38 +0,0 @@ -phpDocNodeResolver = $phpDocNodeResolver; - $this->phpDocLexer = $phpDocLexer; - $this->phpDocParser = $phpDocParser; - } - - public function resolve(string $phpDocString, NameScope $nameScope): ResolvedPhpDocBlock - { - $tokens = new TokenIterator($this->phpDocLexer->tokenize($phpDocString)); - $phpDocNode = $this->phpDocParser->parse($tokens); - $tokens->consumeTokenType(Lexer::TOKEN_END); - - return $this->phpDocNodeResolver->resolve($phpDocNode, $nameScope); - } - -} diff --git a/vendor/phpstan/phpstan/src/PhpDoc/ResolvedPhpDocBlock.php b/vendor/phpstan/phpstan/src/PhpDoc/ResolvedPhpDocBlock.php deleted file mode 100644 index 9d27c18..0000000 --- a/vendor/phpstan/phpstan/src/PhpDoc/ResolvedPhpDocBlock.php +++ /dev/null @@ -1,206 +0,0 @@ - */ - private $varTags; - - /** @var array */ - private $methodTags; - - /** @var array */ - private $propertyTags; - - /** @var array */ - private $paramTags; - - /** @var \PHPStan\PhpDoc\Tag\ReturnTag|null */ - private $returnTag; - - /** @var \PHPStan\PhpDoc\Tag\ThrowsTag|null */ - private $throwsTag; - - /** @var \PHPStan\PhpDoc\Tag\DeprecatedTag|null */ - private $deprecatedTag; - - /** @var bool */ - private $isDeprecated; - - /** @var bool */ - private $isInternal; - - /** @var bool */ - private $isFinal; - - /** - * @param array $varTags - * @param array $methodTags - * @param array $propertyTags - * @param array $paramTags - * @param \PHPStan\PhpDoc\Tag\ReturnTag|null $returnTag - * @param \PHPStan\PhpDoc\Tag\ThrowsTag|null $throwsTags - * @param \PHPStan\PhpDoc\Tag\DeprecatedTag|null $deprecatedTag - * @param bool $isDeprecated - * @param bool $isInternal - * @param bool $isFinal - */ - private function __construct( - array $varTags, - array $methodTags, - array $propertyTags, - array $paramTags, - ?ReturnTag $returnTag, - ?ThrowsTag $throwsTags, - ?DeprecatedTag $deprecatedTag, - bool $isDeprecated, - bool $isInternal, - bool $isFinal - ) - { - $this->varTags = $varTags; - $this->methodTags = $methodTags; - $this->propertyTags = $propertyTags; - $this->paramTags = $paramTags; - $this->returnTag = $returnTag; - $this->throwsTag = $throwsTags; - $this->deprecatedTag = $deprecatedTag; - $this->isDeprecated = $isDeprecated; - $this->isInternal = $isInternal; - $this->isFinal = $isFinal; - } - - /** - * @param array $varTags - * @param array $methodTags - * @param array $propertyTags - * @param array $paramTags - * @param \PHPStan\PhpDoc\Tag\ReturnTag|null $returnTag - * @param \PHPStan\PhpDoc\Tag\ThrowsTag|null $throwsTag - * @param \PHPStan\PhpDoc\Tag\DeprecatedTag|null $deprecatedTag - * @param bool $isDeprecated - * @param bool $isInternal - * @param bool $isFinal - * @return self - */ - public static function create( - array $varTags, - array $methodTags, - array $propertyTags, - array $paramTags, - ?ReturnTag $returnTag, - ?ThrowsTag $throwsTag, - ?DeprecatedTag $deprecatedTag, - bool $isDeprecated, - bool $isInternal, - bool $isFinal - ): self - { - return new self( - $varTags, - $methodTags, - $propertyTags, - $paramTags, - $returnTag, - $throwsTag, - $deprecatedTag, - $isDeprecated, - $isInternal, - $isFinal - ); - } - - public static function createEmpty(): self - { - return new self([], [], [], [], null, null, null, false, false, false); - } - - /** - * @return array - */ - public function getVarTags(): array - { - return $this->varTags; - } - - /** - * @return array - */ - public function getMethodTags(): array - { - return $this->methodTags; - } - - /** - * @return array - */ - public function getPropertyTags(): array - { - return $this->propertyTags; - } - - /** - * @return array - */ - public function getParamTags(): array - { - return $this->paramTags; - } - - public function getReturnTag(): ?\PHPStan\PhpDoc\Tag\ReturnTag - { - return $this->returnTag; - } - - public function getThrowsTag(): ?\PHPStan\PhpDoc\Tag\ThrowsTag - { - return $this->throwsTag; - } - - public function getDeprecatedTag(): ?\PHPStan\PhpDoc\Tag\DeprecatedTag - { - return $this->deprecatedTag; - } - - public function isDeprecated(): bool - { - return $this->isDeprecated; - } - - public function isInternal(): bool - { - return $this->isInternal; - } - - public function isFinal(): bool - { - return $this->isFinal; - } - - /** - * @param mixed[] $properties - * @return self - */ - public static function __set_state(array $properties): self - { - return new self( - $properties['varTags'], - $properties['methodTags'], - $properties['propertyTags'], - $properties['paramTags'], - $properties['returnTag'], - $properties['throwsTag'], - $properties['deprecatedTag'], - $properties['isDeprecated'], - $properties['isInternal'], - $properties['isFinal'] - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/PhpDoc/Tag/DeprecatedTag.php b/vendor/phpstan/phpstan/src/PhpDoc/Tag/DeprecatedTag.php deleted file mode 100644 index 0fa9452..0000000 --- a/vendor/phpstan/phpstan/src/PhpDoc/Tag/DeprecatedTag.php +++ /dev/null @@ -1,32 +0,0 @@ -message = $message; - } - - public function getMessage(): ?string - { - return $this->message; - } - - /** - * @param mixed[] $properties - * @return DeprecatedTag - */ - public static function __set_state(array $properties): self - { - return new self( - $properties['message'] - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/PhpDoc/Tag/MethodTag.php b/vendor/phpstan/phpstan/src/PhpDoc/Tag/MethodTag.php deleted file mode 100644 index 97e096d..0000000 --- a/vendor/phpstan/phpstan/src/PhpDoc/Tag/MethodTag.php +++ /dev/null @@ -1,66 +0,0 @@ - */ - private $parameters; - - /** - * @param \PHPStan\Type\Type $returnType - * @param bool $isStatic - * @param array $parameters - */ - public function __construct( - Type $returnType, - bool $isStatic, - array $parameters - ) - { - $this->returnType = $returnType; - $this->isStatic = $isStatic; - $this->parameters = $parameters; - } - - public function getReturnType(): Type - { - return $this->returnType; - } - - public function isStatic(): bool - { - return $this->isStatic; - } - - /** - * @return array - */ - public function getParameters(): array - { - return $this->parameters; - } - - /** - * @param mixed[] $properties - * @return self - */ - public static function __set_state(array $properties): self - { - return new self( - $properties['returnType'], - $properties['isStatic'], - $properties['parameters'] - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/PhpDoc/Tag/MethodTagParameter.php b/vendor/phpstan/phpstan/src/PhpDoc/Tag/MethodTagParameter.php deleted file mode 100644 index 4f26c8c..0000000 --- a/vendor/phpstan/phpstan/src/PhpDoc/Tag/MethodTagParameter.php +++ /dev/null @@ -1,70 +0,0 @@ -type = $type; - $this->passedByReference = $passedByReference; - $this->isOptional = $isOptional; - $this->isVariadic = $isVariadic; - } - - public function getType(): Type - { - return $this->type; - } - - public function passedByReference(): PassedByReference - { - return $this->passedByReference; - } - - public function isOptional(): bool - { - return $this->isOptional; - } - - public function isVariadic(): bool - { - return $this->isVariadic; - } - - /** - * @param mixed[] $properties - * @return self - */ - public static function __set_state(array $properties): self - { - return new self( - $properties['type'], - $properties['passedByReference'], - $properties['isOptional'], - $properties['isVariadic'] - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/PhpDoc/Tag/ParamTag.php b/vendor/phpstan/phpstan/src/PhpDoc/Tag/ParamTag.php deleted file mode 100644 index a4b9ce0..0000000 --- a/vendor/phpstan/phpstan/src/PhpDoc/Tag/ParamTag.php +++ /dev/null @@ -1,44 +0,0 @@ -type = $type; - $this->isVariadic = $isVariadic; - } - - public function getType(): Type - { - return $this->type; - } - - public function isVariadic(): bool - { - return $this->isVariadic; - } - - /** - * @param mixed[] $properties - * @return self - */ - public static function __set_state(array $properties): self - { - return new self( - $properties['type'], - $properties['isVariadic'] - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/PhpDoc/Tag/PropertyTag.php b/vendor/phpstan/phpstan/src/PhpDoc/Tag/PropertyTag.php deleted file mode 100644 index 0bbd76e..0000000 --- a/vendor/phpstan/phpstan/src/PhpDoc/Tag/PropertyTag.php +++ /dev/null @@ -1,58 +0,0 @@ -type = $type; - $this->readable = $readable; - $this->writable = $writable; - } - - public function getType(): Type - { - return $this->type; - } - - public function isReadable(): bool - { - return $this->readable; - } - - public function isWritable(): bool - { - return $this->writable; - } - - /** - * @param mixed[] $properties - * @return PropertyTag - */ - public static function __set_state(array $properties): self - { - return new self( - $properties['type'], - $properties['readable'], - $properties['writable'] - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/PhpDoc/Tag/ReturnTag.php b/vendor/phpstan/phpstan/src/PhpDoc/Tag/ReturnTag.php deleted file mode 100644 index 99a1eea..0000000 --- a/vendor/phpstan/phpstan/src/PhpDoc/Tag/ReturnTag.php +++ /dev/null @@ -1,34 +0,0 @@ -type = $type; - } - - public function getType(): Type - { - return $this->type; - } - - /** - * @param mixed[] $properties - * @return ReturnTag - */ - public static function __set_state(array $properties): self - { - return new self( - $properties['type'] - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/PhpDoc/Tag/ThrowsTag.php b/vendor/phpstan/phpstan/src/PhpDoc/Tag/ThrowsTag.php deleted file mode 100644 index 0ce1dbb..0000000 --- a/vendor/phpstan/phpstan/src/PhpDoc/Tag/ThrowsTag.php +++ /dev/null @@ -1,34 +0,0 @@ -type = $type; - } - - public function getType(): Type - { - return $this->type; - } - - /** - * @param mixed[] $properties - * @return ThrowsTag - */ - public static function __set_state(array $properties): self - { - return new self( - $properties['type'] - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/PhpDoc/Tag/VarTag.php b/vendor/phpstan/phpstan/src/PhpDoc/Tag/VarTag.php deleted file mode 100644 index 4be77f0..0000000 --- a/vendor/phpstan/phpstan/src/PhpDoc/Tag/VarTag.php +++ /dev/null @@ -1,34 +0,0 @@ -type = $type; - } - - public function getType(): Type - { - return $this->type; - } - - /** - * @param mixed[] $properties - * @return self - */ - public static function __set_state(array $properties): self - { - return new self( - $properties['type'] - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/PhpDoc/TypeNodeResolver.php b/vendor/phpstan/phpstan/src/PhpDoc/TypeNodeResolver.php deleted file mode 100644 index df361bf..0000000 --- a/vendor/phpstan/phpstan/src/PhpDoc/TypeNodeResolver.php +++ /dev/null @@ -1,415 +0,0 @@ -setTypeNodeResolver($this); - } - - $this->extensions = $extensions; - } - - public function getCacheKey(): string - { - $key = 'v59-explicit-never'; - foreach ($this->extensions as $extension) { - $key .= sprintf('-%s', $extension->getCacheKey()); - } - - return $key; - } - - public function resolve(TypeNode $typeNode, NameScope $nameScope): Type - { - foreach ($this->extensions as $extension) { - $type = $extension->resolve($typeNode, $nameScope); - if ($type !== null) { - return $type; - } - } - - if ($typeNode instanceof IdentifierTypeNode) { - return $this->resolveIdentifierTypeNode($typeNode, $nameScope); - - } elseif ($typeNode instanceof ThisTypeNode) { - return $this->resolveThisTypeNode($typeNode, $nameScope); - - } elseif ($typeNode instanceof NullableTypeNode) { - return $this->resolveNullableTypeNode($typeNode, $nameScope); - - } elseif ($typeNode instanceof UnionTypeNode) { - return $this->resolveUnionTypeNode($typeNode, $nameScope); - - } elseif ($typeNode instanceof IntersectionTypeNode) { - return $this->resolveIntersectionTypeNode($typeNode, $nameScope); - - } elseif ($typeNode instanceof ArrayTypeNode) { - return $this->resolveArrayTypeNode($typeNode, $nameScope); - - } elseif ($typeNode instanceof GenericTypeNode) { - return $this->resolveGenericTypeNode($typeNode, $nameScope); - - } elseif ($typeNode instanceof CallableTypeNode) { - return $this->resolveCallableTypeNode($typeNode, $nameScope); - } elseif ($typeNode instanceof ArrayShapeNode) { - return $this->resolveArrayShapeNode($typeNode, $nameScope); - } - - return new ErrorType(); - } - - private function resolveIdentifierTypeNode(IdentifierTypeNode $typeNode, NameScope $nameScope): Type - { - switch (strtolower($typeNode->name)) { - case 'int': - case 'integer': - return new IntegerType(); - - case 'string': - return new StringType(); - - case 'bool': - case 'boolean': - return new BooleanType(); - - case 'true': - return new ConstantBooleanType(true); - - case 'false': - return new ConstantBooleanType(false); - - case 'null': - return new NullType(); - - case 'float': - case 'double': - return new FloatType(); - - case 'array': - return new ArrayType(new MixedType(true), new MixedType(true)); - - case 'scalar': - return new UnionType([ - new IntegerType(), - new FloatType(), - new StringType(), - new BooleanType(), - ]); - - case 'number': - return new UnionType([ - new IntegerType(), - new FloatType(), - ]); - - case 'iterable': - return new IterableType(new MixedType(true), new MixedType(true)); - - case 'callable': - return new CallableType(); - - case 'resource': - return new ResourceType(); - - case 'mixed': - return new MixedType(true); - - case 'void': - return new VoidType(); - - case 'object': - return new ObjectWithoutClassType(); - - case 'never': - return new NeverType(true); - } - - if ($nameScope->getClassName() !== null) { - switch (strtolower($typeNode->name)) { - case 'self': - return new ObjectType($nameScope->getClassName()); - - case 'static': - return new StaticType($nameScope->getClassName()); - - case 'parent': - $broker = Broker::getInstance(); - if ($broker->hasClass($nameScope->getClassName())) { - $classReflection = $broker->getClass($nameScope->getClassName()); - if ($classReflection->getParentClass() !== false) { - return new ObjectType($classReflection->getParentClass()->getName()); - } - } - - return new NonexistentParentClassType(); - } - } - - return new ObjectType($nameScope->resolveStringName($typeNode->name)); - } - - private function resolveThisTypeNode(ThisTypeNode $typeNode, NameScope $nameScope): Type - { - if ($nameScope->getClassName() !== null) { - return new ThisType($nameScope->getClassName()); - } - - return new ErrorType(); - } - - private function resolveNullableTypeNode(NullableTypeNode $typeNode, NameScope $nameScope): Type - { - return TypeCombinator::addNull($this->resolve($typeNode->type, $nameScope)); - } - - private function resolveUnionTypeNode(UnionTypeNode $typeNode, NameScope $nameScope): Type - { - $iterableTypeNodes = []; - $otherTypeNodes = []; - - foreach ($typeNode->types as $innerTypeNode) { - if ($innerTypeNode instanceof ArrayTypeNode) { - $iterableTypeNodes[] = $innerTypeNode->type; - } else { - $otherTypeNodes[] = $innerTypeNode; - } - } - - $otherTypeTypes = $this->resolveMultiple($otherTypeNodes, $nameScope); - if (count($iterableTypeNodes) > 0) { - $arrayTypeTypes = $this->resolveMultiple($iterableTypeNodes, $nameScope); - $arrayTypeType = TypeCombinator::union(...$arrayTypeTypes); - $addArray = true; - - foreach ($otherTypeTypes as &$type) { - if (!$type->isIterable()->yes() || !$type->getIterableValueType()->isSuperTypeOf($arrayTypeType)->yes()) { - continue; - } - - if ($type instanceof ObjectType) { - $type = new IntersectionType([$type, new IterableType(new MixedType(), $arrayTypeType)]); - } elseif ($type instanceof ArrayType) { - $type = new ArrayType(new MixedType(), $arrayTypeType); - } elseif ($type instanceof IterableType) { - $type = new IterableType(new MixedType(), $arrayTypeType); - } else { - continue; - } - - $addArray = false; - } - - if ($addArray) { - $otherTypeTypes[] = new ArrayType(new MixedType(), $arrayTypeType); - } - } - - return TypeCombinator::union(...$otherTypeTypes); - } - - private function resolveIntersectionTypeNode(IntersectionTypeNode $typeNode, NameScope $nameScope): Type - { - $types = $this->resolveMultiple($typeNode->types, $nameScope); - return TypeCombinator::intersect(...$types); - } - - private function resolveArrayTypeNode(ArrayTypeNode $typeNode, NameScope $nameScope): Type - { - $itemType = $this->resolve($typeNode->type, $nameScope); - return new ArrayType(new MixedType(), $itemType); - } - - private function resolveGenericTypeNode(GenericTypeNode $typeNode, NameScope $nameScope): Type - { - $mainTypeName = strtolower($typeNode->type->name); - $genericTypes = $this->resolveMultiple($typeNode->genericTypes, $nameScope); - - if ($mainTypeName === 'array') { - if (count($genericTypes) === 1) { // array - return new ArrayType(new MixedType(true), $genericTypes[0]); - - } - - if (count($genericTypes) === 2) { // array - return new ArrayType($genericTypes[0], $genericTypes[1]); - } - - } elseif ($mainTypeName === 'iterable') { - if (count($genericTypes) === 1) { // iterable - return new IterableType(new MixedType(true), $genericTypes[0]); - - } - - if (count($genericTypes) === 2) { // iterable - return new IterableType($genericTypes[0], $genericTypes[1]); - } - } - - $mainType = $this->resolveIdentifierTypeNode($typeNode->type, $nameScope); - if ($mainType->isIterable()->yes()) { - if (count($genericTypes) === 1) { // Foo - return TypeCombinator::intersect( - $mainType, - new IterableType(new MixedType(true), $genericTypes[0]) - ); - } - - if (count($genericTypes) === 2) { // Foo - return TypeCombinator::intersect( - $mainType, - new IterableType($genericTypes[0], $genericTypes[1]) - ); - } - } - - return new ErrorType(); - } - - private function resolveCallableTypeNode(CallableTypeNode $typeNode, NameScope $nameScope): Type - { - $mainType = $this->resolve($typeNode->identifier, $nameScope); - $isVariadic = false; - $parameters = array_map( - function (CallableTypeParameterNode $parameterNode) use ($nameScope, &$isVariadic): NativeParameterReflection { - $isVariadic = $isVariadic || $parameterNode->isVariadic; - return new NativeParameterReflection( - $parameterNode->parameterName, - $parameterNode->isOptional, - $this->resolve($parameterNode->type, $nameScope), - $parameterNode->isReference ? PassedByReference::createCreatesNewVariable() : PassedByReference::createNo(), - $parameterNode->isVariadic - ); - }, - $typeNode->parameters - ); - $returnType = $this->resolve($typeNode->returnType, $nameScope); - - if ($mainType instanceof CallableType) { - return new CallableType($parameters, $returnType, $isVariadic); - - } elseif ( - $mainType instanceof ObjectType - && $mainType->getClassName() === \Closure::class - ) { - return new ClosureType($parameters, $returnType, $isVariadic); - } - - return new ErrorType(); - } - - private function resolveArrayShapeNode(ArrayShapeNode $typeNode, NameScope $nameScope): Type - { - $requiredItems = []; - $optionalItems = []; - foreach ($typeNode->items as $itemNode) { - if ($itemNode->optional) { - $optionalItems[] = $itemNode; - continue; - } - - $requiredItems[] = $itemNode; - } - - $builder = ConstantArrayTypeBuilder::createEmpty(); - - $addToBuilder = function (ConstantArrayTypeBuilder $builder, array $items) use ($nameScope): void { - foreach ($items as $itemNode) { - $offsetType = null; - if ($itemNode->keyName instanceof ConstExprIntegerNode) { - $offsetType = new ConstantIntegerType((int) $itemNode->keyName->value); - } elseif ($itemNode->keyName instanceof IdentifierTypeNode) { - $offsetType = new ConstantStringType($itemNode->keyName->name); - } - $builder->setOffsetValueType($offsetType, $this->resolve($itemNode->valueType, $nameScope)); - } - }; - - $arrays = []; - $addToBuilder($builder, $requiredItems); - $arrays[] = $builder->getArray(); - - if (count($optionalItems) === 0) { - return $arrays[0]; - } - - $addToBuilder($builder, $optionalItems); - $arrays[] = $builder->getArray(); - - return TypeCombinator::union(...$arrays); - } - - /** - * @param TypeNode[] $typeNodes - * @param NameScope $nameScope - * @return Type[] - */ - public function resolveMultiple(array $typeNodes, NameScope $nameScope): array - { - $types = []; - foreach ($typeNodes as $typeNode) { - $types[] = $this->resolve($typeNode, $nameScope); - } - - return $types; - } - -} diff --git a/vendor/phpstan/phpstan/src/PhpDoc/TypeNodeResolverAwareExtension.php b/vendor/phpstan/phpstan/src/PhpDoc/TypeNodeResolverAwareExtension.php deleted file mode 100644 index 38a65f1..0000000 --- a/vendor/phpstan/phpstan/src/PhpDoc/TypeNodeResolverAwareExtension.php +++ /dev/null @@ -1,10 +0,0 @@ -container = $container; - } - - public function create(): TypeNodeResolver - { - return new TypeNodeResolver( - $this->container->getServicesByTag(self::EXTENSION_TAG) - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/PhpDoc/TypeStringResolver.php b/vendor/phpstan/phpstan/src/PhpDoc/TypeStringResolver.php deleted file mode 100644 index 1d73049..0000000 --- a/vendor/phpstan/phpstan/src/PhpDoc/TypeStringResolver.php +++ /dev/null @@ -1,39 +0,0 @@ -typeLexer = $typeLexer; - $this->typeParser = $typeParser; - $this->typeNodeResolver = $typeNodeResolver; - } - - public function resolve(string $typeString, ?NameScope $nameScope = null): Type - { - $tokens = new TokenIterator($this->typeLexer->tokenize($typeString)); - $typeNode = $this->typeParser->parse($tokens); - $tokens->consumeTokenType(Lexer::TOKEN_END); - - return $this->typeNodeResolver->resolve($typeNode, $nameScope ?? new NameScope(null, [])); - } - -} diff --git a/vendor/phpstan/phpstan/src/Reflection/Annotations/AnnotationMethodReflection.php b/vendor/phpstan/phpstan/src/Reflection/Annotations/AnnotationMethodReflection.php deleted file mode 100644 index aa3b624..0000000 --- a/vendor/phpstan/phpstan/src/Reflection/Annotations/AnnotationMethodReflection.php +++ /dev/null @@ -1,107 +0,0 @@ -name = $name; - $this->declaringClass = $declaringClass; - $this->returnType = $returnType; - $this->parameters = $parameters; - $this->isStatic = $isStatic; - $this->isVariadic = $isVariadic; - } - - public function getDeclaringClass(): ClassReflection - { - return $this->declaringClass; - } - - public function getPrototype(): ClassMemberReflection - { - return $this; - } - - public function isStatic(): bool - { - return $this->isStatic; - } - - public function isPrivate(): bool - { - return false; - } - - public function isPublic(): bool - { - return true; - } - - public function getName(): string - { - return $this->name; - } - - /** - * @return \PHPStan\Reflection\ParametersAcceptor[] - */ - public function getVariants(): array - { - if ($this->variants === null) { - $this->variants = [ - new FunctionVariant( - $this->parameters, - $this->isVariadic, - $this->returnType - ), - ]; - } - return $this->variants; - } - -} diff --git a/vendor/phpstan/phpstan/src/Reflection/Annotations/AnnotationPropertyReflection.php b/vendor/phpstan/phpstan/src/Reflection/Annotations/AnnotationPropertyReflection.php deleted file mode 100644 index 71109fe..0000000 --- a/vendor/phpstan/phpstan/src/Reflection/Annotations/AnnotationPropertyReflection.php +++ /dev/null @@ -1,72 +0,0 @@ -declaringClass = $declaringClass; - $this->type = $type; - $this->readable = $readable; - $this->writable = $writable; - } - - public function getDeclaringClass(): ClassReflection - { - return $this->declaringClass; - } - - public function isStatic(): bool - { - return false; - } - - public function isPrivate(): bool - { - return false; - } - - public function isPublic(): bool - { - return true; - } - - public function getType(): Type - { - return $this->type; - } - - public function isReadable(): bool - { - return $this->readable; - } - - public function isWritable(): bool - { - return $this->writable; - } - -} diff --git a/vendor/phpstan/phpstan/src/Reflection/Annotations/AnnotationsMethodParameterReflection.php b/vendor/phpstan/phpstan/src/Reflection/Annotations/AnnotationsMethodParameterReflection.php deleted file mode 100644 index af10614..0000000 --- a/vendor/phpstan/phpstan/src/Reflection/Annotations/AnnotationsMethodParameterReflection.php +++ /dev/null @@ -1,61 +0,0 @@ -name = $name; - $this->type = $type; - $this->passedByReference = $passedByReference; - $this->isOptional = $isOptional; - $this->isVariadic = $isVariadic; - } - - public function getName(): string - { - return $this->name; - } - - public function isOptional(): bool - { - return $this->isOptional; - } - - public function getType(): Type - { - return $this->type; - } - - public function passedByReference(): PassedByReference - { - return $this->passedByReference; - } - - public function isVariadic(): bool - { - return $this->isVariadic; - } - -} diff --git a/vendor/phpstan/phpstan/src/Reflection/Annotations/AnnotationsMethodsClassReflectionExtension.php b/vendor/phpstan/phpstan/src/Reflection/Annotations/AnnotationsMethodsClassReflectionExtension.php deleted file mode 100644 index ad38f2e..0000000 --- a/vendor/phpstan/phpstan/src/Reflection/Annotations/AnnotationsMethodsClassReflectionExtension.php +++ /dev/null @@ -1,113 +0,0 @@ -fileTypeMapper = $fileTypeMapper; - } - - public function hasMethod(ClassReflection $classReflection, string $methodName): bool - { - if (!isset($this->methods[$classReflection->getName()])) { - $this->methods[$classReflection->getName()] = $this->createMethods($classReflection, $classReflection); - } - - return isset($this->methods[$classReflection->getName()][$methodName]); - } - - public function getMethod(ClassReflection $classReflection, string $methodName): MethodReflection - { - return $this->methods[$classReflection->getName()][$methodName]; - } - - /** - * @param ClassReflection $classReflection - * @param ClassReflection $declaringClass - * @return MethodReflection[] - */ - private function createMethods( - ClassReflection $classReflection, - ClassReflection $declaringClass - ): array - { - $methods = []; - foreach ($classReflection->getTraits() as $traitClass) { - $methods += $this->createMethods($traitClass, $classReflection); - } - foreach ($classReflection->getParents() as $parentClass) { - $methods += $this->createMethods($parentClass, $parentClass); - foreach ($parentClass->getTraits() as $traitClass) { - $methods += $this->createMethods($traitClass, $parentClass); - } - } - foreach ($classReflection->getInterfaces() as $interfaceClass) { - $methods += $this->createMethods($interfaceClass, $interfaceClass); - } - - $fileName = $classReflection->getFileName(); - if ($fileName === false) { - return $methods; - } - - $docComment = $classReflection->getNativeReflection()->getDocComment(); - if ($docComment === false) { - return $methods; - } - - $resolvedPhpDoc = $this->fileTypeMapper->getResolvedPhpDoc($fileName, $classReflection->getName(), null, $docComment); - foreach ($resolvedPhpDoc->getMethodTags() as $methodName => $methodTag) { - $parameters = []; - foreach ($methodTag->getParameters() as $parameterName => $parameterTag) { - $parameters[] = new AnnotationsMethodParameterReflection( - $parameterName, - $parameterTag->getType(), - $parameterTag->passedByReference(), - $parameterTag->isOptional(), - $parameterTag->isVariadic() - ); - } - - $methods[$methodName] = new AnnotationMethodReflection( - $methodName, - $declaringClass, - $methodTag->getReturnType(), - $parameters, - $methodTag->isStatic(), - $this->detectMethodVariadic($parameters) - ); - } - return $methods; - } - - /** - * @param AnnotationsMethodParameterReflection[] $parameters - * @return bool - */ - private function detectMethodVariadic(array $parameters): bool - { - if ($parameters === []) { - return false; - } - - $possibleVariadicParameterIndex = count($parameters) - 1; - $possibleVariadicParameter = $parameters[$possibleVariadicParameterIndex]; - - return $possibleVariadicParameter->isVariadic(); - } - -} diff --git a/vendor/phpstan/phpstan/src/Reflection/Annotations/AnnotationsPropertiesClassReflectionExtension.php b/vendor/phpstan/phpstan/src/Reflection/Annotations/AnnotationsPropertiesClassReflectionExtension.php deleted file mode 100644 index 0b457da..0000000 --- a/vendor/phpstan/phpstan/src/Reflection/Annotations/AnnotationsPropertiesClassReflectionExtension.php +++ /dev/null @@ -1,86 +0,0 @@ -fileTypeMapper = $fileTypeMapper; - } - - public function hasProperty(ClassReflection $classReflection, string $propertyName): bool - { - if (!isset($this->properties[$classReflection->getName()])) { - $this->properties[$classReflection->getName()] = $this->createProperties($classReflection, $classReflection); - } - - return isset($this->properties[$classReflection->getName()][$propertyName]); - } - - public function getProperty(ClassReflection $classReflection, string $propertyName): PropertyReflection - { - return $this->properties[$classReflection->getName()][$propertyName]; - } - - /** - * @param \PHPStan\Reflection\ClassReflection $classReflection - * @param \PHPStan\Reflection\ClassReflection $declaringClass - * @return \PHPStan\Reflection\PropertyReflection[] - */ - private function createProperties( - ClassReflection $classReflection, - ClassReflection $declaringClass - ): array - { - $properties = []; - foreach ($classReflection->getTraits() as $traitClass) { - $properties += $this->createProperties($traitClass, $classReflection); - } - foreach ($classReflection->getParents() as $parentClass) { - $properties += $this->createProperties($parentClass, $parentClass); - foreach ($parentClass->getTraits() as $traitClass) { - $properties += $this->createProperties($traitClass, $parentClass); - } - } - - foreach ($classReflection->getInterfaces() as $interfaceClass) { - $properties += $this->createProperties($interfaceClass, $interfaceClass); - } - - $fileName = $classReflection->getFileName(); - if ($fileName === false) { - return $properties; - } - - $docComment = $classReflection->getNativeReflection()->getDocComment(); - if ($docComment === false) { - return $properties; - } - - $resolvedPhpDoc = $this->fileTypeMapper->getResolvedPhpDoc($fileName, $classReflection->getName(), null, $docComment); - foreach ($resolvedPhpDoc->getPropertyTags() as $propertyName => $propertyTag) { - $properties[$propertyName] = new AnnotationPropertyReflection( - $declaringClass, - $propertyTag->getType(), - $propertyTag->isReadable(), - $propertyTag->isWritable() - ); - } - - return $properties; - } - -} diff --git a/vendor/phpstan/phpstan/src/Reflection/BrokerAwareClassReflectionExtension.php b/vendor/phpstan/phpstan/src/Reflection/BrokerAwareClassReflectionExtension.php deleted file mode 100644 index 9f6d69f..0000000 --- a/vendor/phpstan/phpstan/src/Reflection/BrokerAwareClassReflectionExtension.php +++ /dev/null @@ -1,11 +0,0 @@ -declaringClass = $declaringClass; - $this->reflection = $reflection; - $this->deprecatedDescription = $deprecatedDescription; - $this->isDeprecated = $isDeprecated; - $this->isInternal = $isInternal; - } - - public function getName(): string - { - return $this->reflection->getName(); - } - - /** - * @return mixed - */ - public function getValue() - { - return $this->reflection->getValue(); - } - - public function getDeclaringClass(): ClassReflection - { - return $this->declaringClass; - } - - public function isStatic(): bool - { - return true; - } - - public function isPrivate(): bool - { - return $this->reflection->isPrivate(); - } - - public function isPublic(): bool - { - return $this->reflection->isPublic(); - } - - public function isDeprecated(): bool - { - return $this->isDeprecated; - } - - public function getDeprecatedDescription(): ?string - { - if ($this->isDeprecated) { - return $this->deprecatedDescription; - } - - return null; - } - - public function isInternal(): bool - { - return $this->isInternal; - } - -} diff --git a/vendor/phpstan/phpstan/src/Reflection/ClassMemberAccessAnswerer.php b/vendor/phpstan/phpstan/src/Reflection/ClassMemberAccessAnswerer.php deleted file mode 100644 index b19f802..0000000 --- a/vendor/phpstan/phpstan/src/Reflection/ClassMemberAccessAnswerer.php +++ /dev/null @@ -1,18 +0,0 @@ -broker = $broker; - $this->fileTypeMapper = $fileTypeMapper; - $this->propertiesClassReflectionExtensions = $propertiesClassReflectionExtensions; - $this->methodsClassReflectionExtensions = $methodsClassReflectionExtensions; - $this->displayName = $displayName; - $this->reflection = $reflection; - $this->anonymousFilename = $anonymousFilename; - } - - public function getNativeReflection(): \ReflectionClass - { - return $this->reflection; - } - - /** - * @return string|false - */ - public function getFileName() - { - if ($this->anonymousFilename !== null) { - return $this->anonymousFilename; - } - $fileName = $this->reflection->getFileName(); - if ($fileName === false) { - return false; - } - - if (!file_exists($fileName)) { - return false; - } - - return $fileName; - } - - /** - * @return false|\PHPStan\Reflection\ClassReflection - */ - public function getParentClass() - { - if ($this->reflection->getParentClass() === false) { - return false; - } - - return $this->broker->getClass($this->reflection->getParentClass()->getName()); - } - - public function getName(): string - { - return $this->reflection->getName(); - } - - public function getDisplayName(): string - { - return $this->displayName; - } - - /** - * @return int[] - */ - public function getClassHierarchyDistances(): array - { - if ($this->classHierarchyDistances === null) { - $distance = 0; - $distances = [ - $this->getName() => $distance, - ]; - $currentClassReflection = $this->getNativeReflection(); - foreach ($this->getNativeReflection()->getTraits() as $trait) { - $distance++; - if (array_key_exists($trait->getName(), $distances)) { - continue; - } - - $distances[$trait->getName()] = $distance; - } - - while ($currentClassReflection->getParentClass() !== false) { - $distance++; - $parentClassName = $currentClassReflection->getParentClass()->getName(); - if (!array_key_exists($parentClassName, $distances)) { - $distances[$parentClassName] = $distance; - } - $currentClassReflection = $currentClassReflection->getParentClass(); - foreach ($currentClassReflection->getTraits() as $trait) { - $distance++; - if (array_key_exists($trait->getName(), $distances)) { - continue; - } - - $distances[$trait->getName()] = $distance; - } - } - foreach ($this->getNativeReflection()->getInterfaces() as $interface) { - $distance++; - if (array_key_exists($interface->getName(), $distances)) { - continue; - } - - $distances[$interface->getName()] = $distance; - } - - $this->classHierarchyDistances = $distances; - } - - return $this->classHierarchyDistances; - } - - public function hasProperty(string $propertyName): bool - { - foreach ($this->propertiesClassReflectionExtensions as $extension) { - if ($extension->hasProperty($this, $propertyName)) { - return true; - } - } - - return false; - } - - public function hasMethod(string $methodName): bool - { - foreach ($this->methodsClassReflectionExtensions as $extension) { - if ($extension->hasMethod($this, $methodName)) { - return true; - } - } - - return false; - } - - public function getMethod(string $methodName, ClassMemberAccessAnswerer $scope): MethodReflection - { - $key = $methodName; - if ($scope->isInClass()) { - $key = sprintf('%s-%s', $key, $scope->getClassReflection()->getName()); - } - if (!isset($this->methods[$key])) { - foreach ($this->methodsClassReflectionExtensions as $extension) { - if (!$extension->hasMethod($this, $methodName)) { - continue; - } - - $method = $extension->getMethod($this, $methodName); - if ($scope->canCallMethod($method)) { - return $this->methods[$key] = $method; - } - $this->methods[$key] = $method; - } - } - - if (!isset($this->methods[$key])) { - $filename = $this->getFileName(); - throw new \PHPStan\Reflection\MissingMethodFromReflectionException($this->getName(), $methodName, $filename !== false ? $filename : null); - } - - return $this->methods[$key]; - } - - public function hasNativeMethod(string $methodName): bool - { - return $this->getPhpExtension()->hasNativeMethod($this, $methodName); - } - - public function getNativeMethod(string $methodName): MethodReflection - { - if (!$this->hasNativeMethod($methodName)) { - $filename = $this->getFileName(); - throw new \PHPStan\Reflection\MissingMethodFromReflectionException($this->getName(), $methodName, $filename !== false ? $filename : null); - } - return $this->getPhpExtension()->getNativeMethod($this, $methodName); - } - - public function hasConstructor(): bool - { - return $this->reflection->getConstructor() !== null; - } - - public function getConstructor(): MethodReflection - { - $constructor = $this->reflection->getConstructor(); - if ($constructor === null) { - throw new \PHPStan\ShouldNotHappenException(); - } - return $this->getNativeMethod($constructor->getName()); - } - - private function getPhpExtension(): PhpClassReflectionExtension - { - $extension = $this->methodsClassReflectionExtensions[0]; - if (!$extension instanceof PhpClassReflectionExtension) { - throw new \PHPStan\ShouldNotHappenException(); - } - - return $extension; - } - - public function getProperty(string $propertyName, ClassMemberAccessAnswerer $scope): PropertyReflection - { - $key = $propertyName; - if ($scope->isInClass()) { - $key = sprintf('%s-%s', $key, $scope->getClassReflection()->getName()); - } - if (!isset($this->properties[$key])) { - foreach ($this->propertiesClassReflectionExtensions as $extension) { - if (!$extension->hasProperty($this, $propertyName)) { - continue; - } - - $property = $extension->getProperty($this, $propertyName); - if ($scope->canAccessProperty($property)) { - return $this->properties[$key] = $property; - } - $this->properties[$key] = $property; - } - } - - if (!isset($this->properties[$key])) { - $filename = $this->getFileName(); - throw new \PHPStan\Reflection\MissingPropertyFromReflectionException($this->getName(), $propertyName, $filename !== false ? $filename : null); - } - - return $this->properties[$key]; - } - - public function hasNativeProperty(string $propertyName): bool - { - return $this->getPhpExtension()->hasProperty($this, $propertyName); - } - - public function getNativeProperty(string $propertyName): PhpPropertyReflection - { - if (!$this->hasNativeProperty($propertyName)) { - $filename = $this->getFileName(); - throw new \PHPStan\Reflection\MissingPropertyFromReflectionException($this->getName(), $propertyName, $filename !== false ? $filename : null); - } - return $this->getPhpExtension()->getNativeProperty($this, $propertyName); - } - - public function isAbstract(): bool - { - return $this->reflection->isAbstract(); - } - - public function isInterface(): bool - { - return $this->reflection->isInterface(); - } - - public function isTrait(): bool - { - return $this->reflection->isTrait(); - } - - public function isAnonymous(): bool - { - return $this->anonymousFilename !== null; - } - - public function isSubclassOf(string $className): bool - { - return $this->reflection->isSubclassOf($className); - } - - /** - * @return \PHPStan\Reflection\ClassReflection[] - */ - public function getParents(): array - { - $parents = []; - $parent = $this->getParentClass(); - while ($parent !== false) { - $parents[] = $parent; - $parent = $parent->getParentClass(); - } - - return $parents; - } - - /** - * @return \PHPStan\Reflection\ClassReflection[] - */ - public function getInterfaces(): array - { - return array_map(function (\ReflectionClass $interface): ClassReflection { - return $this->broker->getClass($interface->getName()); - }, $this->getNativeReflection()->getInterfaces()); - } - - /** - * @return \PHPStan\Reflection\ClassReflection[] - */ - public function getTraits(): array - { - return array_map(function (\ReflectionClass $trait): ClassReflection { - return $this->broker->getClass($trait->getName()); - }, $this->getNativeReflection()->getTraits()); - } - - /** - * @return string[] - */ - public function getParentClassesNames(): array - { - $parentNames = []; - $currentClassReflection = $this; - while ($currentClassReflection->getParentClass() !== false) { - $parentNames[] = $currentClassReflection->getParentClass()->getName(); - $currentClassReflection = $currentClassReflection->getParentClass(); - } - - return $parentNames; - } - - public function hasConstant(string $name): bool - { - return $this->getNativeReflection()->hasConstant($name); - } - - public function getConstant(string $name): ConstantReflection - { - if (!isset($this->constants[$name])) { - $reflectionConstant = $this->getNativeReflection()->getReflectionConstant($name); - if ($reflectionConstant === false) { - $fileName = $this->getFileName(); - throw new \PHPStan\Reflection\MissingConstantFromReflectionException($this->getName(), $name, $fileName !== false ? $fileName : null); - } - - $deprecatedDescription = null; - $isDeprecated = false; - $isInternal = false; - if ($reflectionConstant->getDocComment() !== false && $this->getFileName() !== false) { - $docComment = $reflectionConstant->getDocComment(); - $fileName = $this->getFileName(); - $className = $reflectionConstant->getDeclaringClass()->getName(); - $resolvedPhpDoc = $this->fileTypeMapper->getResolvedPhpDoc($fileName, $className, null, $docComment); - - $deprecatedDescription = $resolvedPhpDoc->getDeprecatedTag() !== null ? $resolvedPhpDoc->getDeprecatedTag()->getMessage() : null; - $isDeprecated = $resolvedPhpDoc->isDeprecated(); - $isInternal = $resolvedPhpDoc->isInternal(); - } - - $this->constants[$name] = new ClassConstantReflection( - $this->broker->getClass($reflectionConstant->getDeclaringClass()->getName()), - $reflectionConstant, - $deprecatedDescription, - $isDeprecated, - $isInternal - ); - } - return $this->constants[$name]; - } - - public function hasTraitUse(string $traitName): bool - { - return in_array($traitName, $this->getTraitNames(), true); - } - - /** - * @return string[] - */ - private function getTraitNames(): array - { - $class = $this->reflection; - $traitNames = $class->getTraitNames(); - while ($class->getParentClass() !== false) { - $traitNames = array_values(array_unique(array_merge($traitNames, $class->getParentClass()->getTraitNames()))); - $class = $class->getParentClass(); - } - - return $traitNames; - } - - public function getDeprecatedDescription(): ?string - { - if ($this->deprecatedDescription === null && $this->isDeprecated()) { - $resolvedPhpDoc = $this->getResolvedPhpDoc(); - if ($resolvedPhpDoc !== null && $resolvedPhpDoc->getDeprecatedTag() !== null) { - $this->deprecatedDescription = $resolvedPhpDoc->getDeprecatedTag()->getMessage(); - } - } - - return $this->deprecatedDescription; - } - - public function isDeprecated(): bool - { - if ($this->isDeprecated === null) { - $resolvedPhpDoc = $this->getResolvedPhpDoc(); - $this->isDeprecated = $resolvedPhpDoc !== null && $resolvedPhpDoc->isDeprecated(); - } - - return $this->isDeprecated; - } - - public function isInternal(): bool - { - if ($this->isInternal === null) { - $resolvedPhpDoc = $this->getResolvedPhpDoc(); - $this->isInternal = $resolvedPhpDoc !== null && $resolvedPhpDoc->isInternal(); - } - - return $this->isInternal; - } - - public function isFinal(): bool - { - if ($this->isFinal === null) { - $resolvedPhpDoc = $this->getResolvedPhpDoc(); - $this->isFinal = $this->reflection->isFinal() - || ($resolvedPhpDoc !== null && $resolvedPhpDoc->isFinal()); - } - - return $this->isFinal; - } - - private function getResolvedPhpDoc(): ?ResolvedPhpDocBlock - { - $fileName = $this->reflection->getFileName(); - if ($fileName === false) { - return null; - } - - $docComment = $this->reflection->getDocComment(); - if ($docComment === false) { - return null; - } - - return $this->fileTypeMapper->getResolvedPhpDoc($fileName, $this->getName(), null, $docComment); - } - -} diff --git a/vendor/phpstan/phpstan/src/Reflection/ConstantReflection.php b/vendor/phpstan/phpstan/src/Reflection/ConstantReflection.php deleted file mode 100644 index f3e6638..0000000 --- a/vendor/phpstan/phpstan/src/Reflection/ConstantReflection.php +++ /dev/null @@ -1,15 +0,0 @@ -name = $name; - } - - public function getDeclaringClass(): ClassReflection - { - $broker = Broker::getInstance(); - - return $broker->getClass(\stdClass::class); - } - - public function isStatic(): bool - { - return true; - } - - public function isPrivate(): bool - { - return false; - } - - public function isPublic(): bool - { - return true; - } - - public function getName(): string - { - return $this->name; - } - - /** - * @return mixed - */ - public function getValue() - { - // so that Scope::getTypeFromValue() returns mixed - return new \stdClass(); - } - -} diff --git a/vendor/phpstan/phpstan/src/Reflection/Dummy/DummyConstructorReflection.php b/vendor/phpstan/phpstan/src/Reflection/Dummy/DummyConstructorReflection.php deleted file mode 100644 index f7156f6..0000000 --- a/vendor/phpstan/phpstan/src/Reflection/Dummy/DummyConstructorReflection.php +++ /dev/null @@ -1,63 +0,0 @@ -declaringClass = $declaringClass; - } - - public function getDeclaringClass(): ClassReflection - { - return $this->declaringClass; - } - - public function isStatic(): bool - { - return false; - } - - public function isPrivate(): bool - { - return false; - } - - public function isPublic(): bool - { - return true; - } - - public function getName(): string - { - return '__construct'; - } - - public function getPrototype(): ClassMemberReflection - { - return $this; - } - - public function getVariants(): array - { - return [ - new FunctionVariant( - [], - false, - new VoidType() - ), - ]; - } - -} diff --git a/vendor/phpstan/phpstan/src/Reflection/Dummy/DummyMethodReflection.php b/vendor/phpstan/phpstan/src/Reflection/Dummy/DummyMethodReflection.php deleted file mode 100644 index e386db1..0000000 --- a/vendor/phpstan/phpstan/src/Reflection/Dummy/DummyMethodReflection.php +++ /dev/null @@ -1,64 +0,0 @@ -name = $name; - } - - public function getDeclaringClass(): ClassReflection - { - $broker = Broker::getInstance(); - - return $broker->getClass(\stdClass::class); - } - - public function isStatic(): bool - { - return false; - } - - public function isPrivate(): bool - { - return false; - } - - public function isPublic(): bool - { - return true; - } - - public function getName(): string - { - return $this->name; - } - - public function getPrototype(): ClassMemberReflection - { - return $this; - } - - /** - * @return \PHPStan\Reflection\ParametersAcceptor[] - */ - public function getVariants(): array - { - return [ - new TrivialParametersAcceptor(), - ]; - } - -} diff --git a/vendor/phpstan/phpstan/src/Reflection/Dummy/DummyPropertyReflection.php b/vendor/phpstan/phpstan/src/Reflection/Dummy/DummyPropertyReflection.php deleted file mode 100644 index 74e50e1..0000000 --- a/vendor/phpstan/phpstan/src/Reflection/Dummy/DummyPropertyReflection.php +++ /dev/null @@ -1,51 +0,0 @@ -getClass(\stdClass::class); - } - - public function isStatic(): bool - { - return false; - } - - public function isPrivate(): bool - { - return false; - } - - public function isPublic(): bool - { - return true; - } - - public function getType(): Type - { - return new MixedType(); - } - - public function isReadable(): bool - { - return true; - } - - public function isWritable(): bool - { - return true; - } - -} diff --git a/vendor/phpstan/phpstan/src/Reflection/ExtendedPropertyReflection.php b/vendor/phpstan/phpstan/src/Reflection/ExtendedPropertyReflection.php deleted file mode 100644 index e8e3b16..0000000 --- a/vendor/phpstan/phpstan/src/Reflection/ExtendedPropertyReflection.php +++ /dev/null @@ -1,14 +0,0 @@ - */ - private $parameters; - - /** @var bool */ - private $isVariadic; - - /** @var Type */ - private $returnType; - - /** - * @param array $parameters - * @param bool $isVariadic - * @param Type $returnType - */ - public function __construct( - array $parameters, - bool $isVariadic, - Type $returnType - ) - { - $this->parameters = $parameters; - $this->isVariadic = $isVariadic; - $this->returnType = $returnType; - } - - /** - * @return array - */ - public function getParameters(): array - { - return $this->parameters; - } - - public function isVariadic(): bool - { - return $this->isVariadic; - } - - public function getReturnType(): Type - { - return $this->returnType; - } - -} diff --git a/vendor/phpstan/phpstan/src/Reflection/FunctionVariantWithPhpDocs.php b/vendor/phpstan/phpstan/src/Reflection/FunctionVariantWithPhpDocs.php deleted file mode 100644 index 5b89b1a..0000000 --- a/vendor/phpstan/phpstan/src/Reflection/FunctionVariantWithPhpDocs.php +++ /dev/null @@ -1,61 +0,0 @@ - $parameters - * @param bool $isVariadic - * @param Type $returnType - * @param Type $phpDocReturnType - * @param Type $nativeReturnType - */ - public function __construct( - array $parameters, - bool $isVariadic, - Type $returnType, - Type $phpDocReturnType, - Type $nativeReturnType - ) - { - parent::__construct( - $parameters, - $isVariadic, - $returnType - ); - $this->phpDocReturnType = $phpDocReturnType; - $this->nativeReturnType = $nativeReturnType; - } - - /** - * @return array - */ - public function getParameters(): array - { - /** @var \PHPStan\Reflection\ParameterReflectionWithPhpDocs[] $parameters */ - $parameters = parent::getParameters(); - - return $parameters; - } - - public function getPhpDocReturnType(): Type - { - return $this->phpDocReturnType; - } - - public function getNativeReturnType(): Type - { - return $this->nativeReturnType; - } - -} diff --git a/vendor/phpstan/phpstan/src/Reflection/InaccessibleMethod.php b/vendor/phpstan/phpstan/src/Reflection/InaccessibleMethod.php deleted file mode 100644 index 86f2f46..0000000 --- a/vendor/phpstan/phpstan/src/Reflection/InaccessibleMethod.php +++ /dev/null @@ -1,42 +0,0 @@ -methodReflection = $methodReflection; - } - - public function getMethod(): MethodReflection - { - return $this->methodReflection; - } - - /** - * @return array - */ - public function getParameters(): array - { - return []; - } - - public function isVariadic(): bool - { - return true; - } - - public function getReturnType(): Type - { - return new MixedType(); - } - -} diff --git a/vendor/phpstan/phpstan/src/Reflection/InternableReflection.php b/vendor/phpstan/phpstan/src/Reflection/InternableReflection.php deleted file mode 100644 index 58d1f94..0000000 --- a/vendor/phpstan/phpstan/src/Reflection/InternableReflection.php +++ /dev/null @@ -1,10 +0,0 @@ -declaringClass = $declaringClass; - $this->isStatic = $isStatic; - $this->isPrivate = $isPrivate; - $this->isPublic = $isPublic; - $this->isAbstract = $isAbstract; - } - - public function getDeclaringClass(): ClassReflection - { - return $this->declaringClass; - } - - public function isStatic(): bool - { - return $this->isStatic; - } - - public function isPrivate(): bool - { - return $this->isPrivate; - } - - public function isPublic(): bool - { - return $this->isPublic; - } - - public function isAbstract(): bool - { - return $this->isAbstract; - } - -} diff --git a/vendor/phpstan/phpstan/src/Reflection/MethodReflection.php b/vendor/phpstan/phpstan/src/Reflection/MethodReflection.php deleted file mode 100644 index 19fa307..0000000 --- a/vendor/phpstan/phpstan/src/Reflection/MethodReflection.php +++ /dev/null @@ -1,17 +0,0 @@ -name = $name; - $this->variants = $variants; - $this->throwType = $throwType; - } - - public function getName(): string - { - return $this->name; - } - - /** - * @return \PHPStan\Reflection\ParametersAcceptor[] - */ - public function getVariants(): array - { - return $this->variants; - } - - public function getThrowType(): ?Type - { - return $this->throwType; - } - - public function getDeprecatedDescription(): ?string - { - return null; - } - - public function isDeprecated(): bool - { - return false; - } - - public function isInternal(): bool - { - return false; - } - - public function isFinal(): bool - { - return false; - } - -} diff --git a/vendor/phpstan/phpstan/src/Reflection/Native/NativeMethodReflection.php b/vendor/phpstan/phpstan/src/Reflection/Native/NativeMethodReflection.php deleted file mode 100644 index ddd1851..0000000 --- a/vendor/phpstan/phpstan/src/Reflection/Native/NativeMethodReflection.php +++ /dev/null @@ -1,120 +0,0 @@ -broker = $broker; - $this->declaringClass = $declaringClass; - $this->reflection = $reflection; - $this->variants = $variants; - } - - public function getDeclaringClass(): ClassReflection - { - return $this->declaringClass; - } - - public function isStatic(): bool - { - return $this->reflection->isStatic(); - } - - public function isPrivate(): bool - { - return $this->reflection->isPrivate(); - } - - public function isPublic(): bool - { - return $this->reflection->isPublic(); - } - - public function getPrototype(): ClassMemberReflection - { - try { - $prototypeMethod = $this->reflection->getPrototype(); - $prototypeDeclaringClass = $this->broker->getClass($prototypeMethod->getDeclaringClass()->getName()); - - return new MethodPrototypeReflection( - $prototypeDeclaringClass, - $prototypeMethod->isStatic(), - $prototypeMethod->isPrivate(), - $prototypeMethod->isPublic(), - $prototypeMethod->isAbstract() - ); - } catch (\ReflectionException $e) { - return $this; - } - } - - public function getName(): string - { - return $this->reflection->getName(); - } - - /** - * @return \PHPStan\Reflection\ParametersAcceptor[] - */ - public function getVariants(): array - { - return $this->variants; - } - - public function getDeprecatedDescription(): ?string - { - return null; - } - - public function isDeprecated(): bool - { - return $this->reflection->isDeprecated(); - } - - public function isInternal(): bool - { - return false; - } - - public function isFinal(): bool - { - return false; - } - -} diff --git a/vendor/phpstan/phpstan/src/Reflection/Native/NativeParameterReflection.php b/vendor/phpstan/phpstan/src/Reflection/Native/NativeParameterReflection.php deleted file mode 100644 index d5cb4d3..0000000 --- a/vendor/phpstan/phpstan/src/Reflection/Native/NativeParameterReflection.php +++ /dev/null @@ -1,89 +0,0 @@ -name = $name; - $this->optional = $optional; - $this->type = $type; - $this->passedByReference = $passedByReference; - $this->variadic = $variadic; - } - - public function getName(): string - { - return $this->name; - } - - public function isOptional(): bool - { - return $this->optional; - } - - public function getType(): Type - { - $type = $this->type; - if ($this->variadic) { - $type = new ArrayType(new IntegerType(), $type); - } - - return $type; - } - - public function passedByReference(): PassedByReference - { - return $this->passedByReference; - } - - public function isVariadic(): bool - { - return $this->variadic; - } - - /** - * @param mixed[] $properties - * @return self - */ - public static function __set_state(array $properties): self - { - return new self( - $properties['name'], - $properties['optional'], - $properties['type'], - $properties['passedByReference'], - $properties['variadic'] - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/Reflection/ParameterReflection.php b/vendor/phpstan/phpstan/src/Reflection/ParameterReflection.php deleted file mode 100644 index 9e6158e..0000000 --- a/vendor/phpstan/phpstan/src/Reflection/ParameterReflection.php +++ /dev/null @@ -1,20 +0,0 @@ - - */ - public function getParameters(): array; - - public function isVariadic(): bool; - - public function getReturnType(): Type; - -} diff --git a/vendor/phpstan/phpstan/src/Reflection/ParametersAcceptorSelector.php b/vendor/phpstan/phpstan/src/Reflection/ParametersAcceptorSelector.php deleted file mode 100644 index 4ba5f15..0000000 --- a/vendor/phpstan/phpstan/src/Reflection/ParametersAcceptorSelector.php +++ /dev/null @@ -1,247 +0,0 @@ -getType($arg->value); - if ($arg->unpack) { - $unpack = true; - $types[] = $type->getIterableValueType(); - } else { - $types[] = $type; - } - } - - return self::selectFromTypes($types, $parametersAcceptors, $unpack); - } - - /** - * @param \PHPStan\Type\Type[] $types - * @param ParametersAcceptor[] $parametersAcceptors - * @param bool $unpack - * @return ParametersAcceptor - */ - public static function selectFromTypes( - array $types, - array $parametersAcceptors, - bool $unpack - ): ParametersAcceptor - { - if (count($parametersAcceptors) === 1) { - return $parametersAcceptors[0]; - } - - if (count($parametersAcceptors) === 0) { - throw new \PHPStan\ShouldNotHappenException( - 'getVariants() must return at least one variant.' - ); - } - - $typesCount = count($types); - $acceptableAcceptors = []; - - foreach ($parametersAcceptors as $parametersAcceptor) { - if ($unpack) { - $acceptableAcceptors[] = $parametersAcceptor; - continue; - } - - $functionParametersMinCount = 0; - $functionParametersMaxCount = 0; - foreach ($parametersAcceptor->getParameters() as $parameter) { - if (!$parameter->isOptional()) { - $functionParametersMinCount++; - } - - $functionParametersMaxCount++; - } - - if ($typesCount < $functionParametersMinCount) { - continue; - } - - if ( - !$parametersAcceptor->isVariadic() - && $typesCount > $functionParametersMaxCount - ) { - continue; - } - - $acceptableAcceptors[] = $parametersAcceptor; - } - - if (count($acceptableAcceptors) === 0) { - return self::combineAcceptors($parametersAcceptors); - } - - if (count($acceptableAcceptors) === 1) { - return $acceptableAcceptors[0]; - } - - $winningAcceptors = []; - $winningCertainty = null; - foreach ($acceptableAcceptors as $acceptableAcceptor) { - $isSuperType = TrinaryLogic::createYes(); - foreach ($acceptableAcceptor->getParameters() as $i => $parameter) { - if (!isset($types[$i])) { - if (!$unpack || count($types) <= 0) { - break; - } - - $type = $types[count($types) - 1]; - } else { - $type = $types[$i]; - } - - if ($parameter->getType() instanceof MixedType) { - $isSuperType = $isSuperType->and(TrinaryLogic::createMaybe()); - } else { - $isSuperType = $isSuperType->and($parameter->getType()->isSuperTypeOf($type)); - } - } - - if ($isSuperType->no()) { - continue; - } - - if ($winningCertainty === null) { - $winningAcceptors[] = $acceptableAcceptor; - $winningCertainty = $isSuperType; - } else { - $comparison = $winningCertainty->compareTo($isSuperType); - if ($comparison === $isSuperType) { - $winningAcceptors = [$acceptableAcceptor]; - $winningCertainty = $isSuperType; - } elseif ($comparison === null) { - $winningAcceptors[] = $acceptableAcceptor; - } - } - } - - if (count($winningAcceptors) === 0) { - return self::combineAcceptors($acceptableAcceptors); - } - - return self::combineAcceptors($winningAcceptors); - } - - /** - * @param ParametersAcceptor[] $acceptors - * @return ParametersAcceptor - */ - public static function combineAcceptors(array $acceptors): ParametersAcceptor - { - if (count($acceptors) === 0) { - throw new \PHPStan\ShouldNotHappenException( - 'getVariants() must return at least one variant.' - ); - } - if (count($acceptors) === 1) { - return $acceptors[0]; - } - - $minimumNumberOfParameters = null; - foreach ($acceptors as $acceptor) { - $acceptorParametersMinCount = 0; - foreach ($acceptor->getParameters() as $parameter) { - if ($parameter->isOptional()) { - continue; - } - - $acceptorParametersMinCount++; - } - - if ($minimumNumberOfParameters !== null && $minimumNumberOfParameters <= $acceptorParametersMinCount) { - continue; - } - - $minimumNumberOfParameters = $acceptorParametersMinCount; - } - - $parameters = []; - $isVariadic = false; - $returnType = null; - - foreach ($acceptors as $acceptor) { - if ($returnType === null) { - $returnType = $acceptor->getReturnType(); - } else { - $returnType = TypeCombinator::union($returnType, $acceptor->getReturnType()); - } - $isVariadic = $isVariadic || $acceptor->isVariadic(); - - foreach ($acceptor->getParameters() as $i => $parameter) { - if (!isset($parameters[$i])) { - $parameters[$i] = new NativeParameterReflection( - $parameter->getName(), - $i + 1 > $minimumNumberOfParameters, - $parameter->getType(), - $parameter->passedByReference(), - $parameter->isVariadic() - ); - continue; - } - - $isVariadic = $parameters[$i]->isVariadic() || $parameter->isVariadic(); - - $parameters[$i] = new NativeParameterReflection( - $parameters[$i]->getName() !== $parameter->getName() ? sprintf('%s|%s', $parameters[$i]->getName(), $parameter->getName()) : $parameter->getName(), - $i + 1 > $minimumNumberOfParameters, - TypeCombinator::union($parameters[$i]->getType(), $parameter->getType()), - $parameters[$i]->passedByReference()->combine($parameter->passedByReference()), - $isVariadic - ); - - if ($isVariadic) { - $parameters = array_slice($parameters, 0, $i + 1); - break; - } - } - } - - return new FunctionVariant($parameters, $isVariadic, $returnType); - } - -} diff --git a/vendor/phpstan/phpstan/src/Reflection/ParametersAcceptorWithPhpDocs.php b/vendor/phpstan/phpstan/src/Reflection/ParametersAcceptorWithPhpDocs.php deleted file mode 100644 index fbc22be..0000000 --- a/vendor/phpstan/phpstan/src/Reflection/ParametersAcceptorWithPhpDocs.php +++ /dev/null @@ -1,19 +0,0 @@ - - */ - public function getParameters(): array; - - public function getPhpDocReturnType(): Type; - - public function getNativeReturnType(): Type; - -} diff --git a/vendor/phpstan/phpstan/src/Reflection/PassedByReference.php b/vendor/phpstan/phpstan/src/Reflection/PassedByReference.php deleted file mode 100644 index 41b4124..0000000 --- a/vendor/phpstan/phpstan/src/Reflection/PassedByReference.php +++ /dev/null @@ -1,87 +0,0 @@ -value = $value; - } - - private static function create(int $value): self - { - if (!array_key_exists($value, self::$registry)) { - self::$registry[$value] = new self($value); - } - - return self::$registry[$value]; - } - - public static function createNo(): self - { - return self::create(self::NO); - } - - public static function createCreatesNewVariable(): self - { - return self::create(self::CREATES_NEW_VARIABLE); - } - - public static function createReadsArgument(): self - { - return self::create(self::READS_ARGUMENT); - } - - public function no(): bool - { - return $this->value === self::NO; - } - - public function yes(): bool - { - return !$this->no(); - } - - public function equals(self $other): bool - { - return $this->value === $other->value; - } - - public function createsNewVariable(): bool - { - return $this->value === self::CREATES_NEW_VARIABLE; - } - - public function combine(self $other): self - { - if ($this->value > $other->value) { - return $this; - } elseif ($this->value < $other->value) { - return $other; - } - - return $this; - } - - /** - * @param mixed[] $properties - * @return self - */ - public static function __set_state(array $properties): self - { - return new self($properties['value']); - } - -} diff --git a/vendor/phpstan/phpstan/src/Reflection/Php/BuiltinMethodReflection.php b/vendor/phpstan/phpstan/src/Reflection/Php/BuiltinMethodReflection.php deleted file mode 100644 index 02b0da8..0000000 --- a/vendor/phpstan/phpstan/src/Reflection/Php/BuiltinMethodReflection.php +++ /dev/null @@ -1,57 +0,0 @@ -name = $name; - $this->type = $type; - $this->optional = $optional; - $this->passedByReference = $passedByReference !== null - ? PassedByReference::createCreatesNewVariable() - : PassedByReference::createNo(); - $this->variadic = $variadic; - } - - public function getName(): string - { - return $this->name; - } - - public function isOptional(): bool - { - return $this->optional; - } - - public function getType(): Type - { - return $this->type; - } - - public function passedByReference(): PassedByReference - { - return $this->passedByReference; - } - - public function isVariadic(): bool - { - return $this->variadic; - } - -} diff --git a/vendor/phpstan/phpstan/src/Reflection/Php/FakeBuiltinMethodReflection.php b/vendor/phpstan/phpstan/src/Reflection/Php/FakeBuiltinMethodReflection.php deleted file mode 100644 index f186791..0000000 --- a/vendor/phpstan/phpstan/src/Reflection/Php/FakeBuiltinMethodReflection.php +++ /dev/null @@ -1,123 +0,0 @@ -methodName = $methodName; - $this->declaringClass = $declaringClass; - } - - public function getName(): string - { - return $this->methodName; - } - - /** - * @return string|false - */ - public function getFileName() - { - return false; - } - - public function getDeclaringClass(): \ReflectionClass - { - return $this->declaringClass; - } - - /** - * @return int|false - */ - public function getStartLine() - { - return false; - } - - /** - * @return int|false - */ - public function getEndLine() - { - return false; - } - - /** - * @return string|false - */ - public function getDocComment() - { - return false; - } - - public function isStatic(): bool - { - return false; - } - - public function isPrivate(): bool - { - return false; - } - - public function isPublic(): bool - { - return true; - } - - public function getPrototype(): BuiltinMethodReflection - { - throw new \ReflectionException(); - } - - public function isDeprecated(): bool - { - return false; - } - - public function isVariadic(): bool - { - return false; - } - - public function isFinal(): bool - { - return false; - } - - public function isInternal(): bool - { - return false; - } - - public function isAbstract(): bool - { - return false; - } - - public function getReturnType(): ?\ReflectionType - { - return null; - } - - /** - * @return \ReflectionParameter[] - */ - public function getParameters(): array - { - return []; - } - -} diff --git a/vendor/phpstan/phpstan/src/Reflection/Php/NativeBuiltinMethodReflection.php b/vendor/phpstan/phpstan/src/Reflection/Php/NativeBuiltinMethodReflection.php deleted file mode 100644 index 0dc66aa..0000000 --- a/vendor/phpstan/phpstan/src/Reflection/Php/NativeBuiltinMethodReflection.php +++ /dev/null @@ -1,116 +0,0 @@ -reflection = $reflection; - } - - public function getName(): string - { - return $this->reflection->getName(); - } - - /** - * @return string|false - */ - public function getFileName() - { - return $this->reflection->getFileName(); - } - - public function getDeclaringClass(): \ReflectionClass - { - return $this->reflection->getDeclaringClass(); - } - - /** - * @return int|false - */ - public function getStartLine() - { - return $this->reflection->getStartLine(); - } - - /** - * @return int|false - */ - public function getEndLine() - { - return $this->reflection->getEndLine(); - } - - /** - * @return string|false - */ - public function getDocComment() - { - return $this->reflection->getDocComment(); - } - - public function isStatic(): bool - { - return $this->reflection->isStatic(); - } - - public function isPrivate(): bool - { - return $this->reflection->isPrivate(); - } - - public function isPublic(): bool - { - return $this->reflection->isPublic(); - } - - public function getPrototype(): BuiltinMethodReflection - { - return new self($this->reflection->getPrototype()); - } - - public function isDeprecated(): bool - { - return $this->reflection->isDeprecated(); - } - - public function isFinal(): bool - { - return $this->reflection->isFinal(); - } - - public function isInternal(): bool - { - return $this->reflection->isInternal(); - } - - public function isAbstract(): bool - { - return $this->reflection->isAbstract(); - } - - public function isVariadic(): bool - { - return $this->reflection->isVariadic(); - } - - public function getReturnType(): ?\ReflectionType - { - return $this->reflection->getReturnType(); - } - - /** - * @return \ReflectionParameter[] - */ - public function getParameters(): array - { - return $this->reflection->getParameters(); - } - -} diff --git a/vendor/phpstan/phpstan/src/Reflection/Php/PhpClassReflectionExtension.php b/vendor/phpstan/phpstan/src/Reflection/Php/PhpClassReflectionExtension.php deleted file mode 100644 index 0947bf6..0000000 --- a/vendor/phpstan/phpstan/src/Reflection/Php/PhpClassReflectionExtension.php +++ /dev/null @@ -1,714 +0,0 @@ -> */ - private $propertyTypesCache = []; - - /** @var array */ - private $inferClassConstructorPropertyTypesInProcess = []; - - public function __construct( - Container $container, - PhpMethodReflectionFactory $methodReflectionFactory, - FileTypeMapper $fileTypeMapper, - AnnotationsMethodsClassReflectionExtension $annotationsMethodsClassReflectionExtension, - AnnotationsPropertiesClassReflectionExtension $annotationsPropertiesClassReflectionExtension, - SignatureMapProvider $signatureMapProvider, - Parser $parser, - bool $inferPrivatePropertyTypeFromConstructor - ) - { - $this->container = $container; - $this->methodReflectionFactory = $methodReflectionFactory; - $this->fileTypeMapper = $fileTypeMapper; - $this->annotationsMethodsClassReflectionExtension = $annotationsMethodsClassReflectionExtension; - $this->annotationsPropertiesClassReflectionExtension = $annotationsPropertiesClassReflectionExtension; - $this->signatureMapProvider = $signatureMapProvider; - $this->parser = $parser; - $this->inferPrivatePropertyTypeFromConstructor = $inferPrivatePropertyTypeFromConstructor; - } - - public function setBroker(Broker $broker): void - { - $this->broker = $broker; - } - - public function hasProperty(ClassReflection $classReflection, string $propertyName): bool - { - return $classReflection->getNativeReflection()->hasProperty($propertyName); - } - - public function getProperty(ClassReflection $classReflection, string $propertyName): PropertyReflection - { - if (!isset($this->propertiesIncludingAnnotations[$classReflection->getName()][$propertyName])) { - $this->propertiesIncludingAnnotations[$classReflection->getName()][$propertyName] = $this->createProperty($classReflection, $propertyName, true); - } - - return $this->propertiesIncludingAnnotations[$classReflection->getName()][$propertyName]; - } - - public function getNativeProperty(ClassReflection $classReflection, string $propertyName): PhpPropertyReflection - { - if (!isset($this->nativeProperties[$classReflection->getName()][$propertyName])) { - /** @var \PHPStan\Reflection\Php\PhpPropertyReflection $property */ - $property = $this->createProperty($classReflection, $propertyName, false); - $this->nativeProperties[$classReflection->getName()][$propertyName] = $property; - } - - return $this->nativeProperties[$classReflection->getName()][$propertyName]; - } - - private function createProperty( - ClassReflection $classReflection, - string $propertyName, - bool $includingAnnotations - ): PropertyReflection - { - $propertyReflection = $classReflection->getNativeReflection()->getProperty($propertyName); - $propertyName = $propertyReflection->getName(); - $declaringClassReflection = $this->broker->getClass($propertyReflection->getDeclaringClass()->getName()); - $deprecatedDescription = null; - $isDeprecated = false; - $isInternal = false; - - if ($includingAnnotations && $this->annotationsPropertiesClassReflectionExtension->hasProperty($classReflection, $propertyName)) { - $hierarchyDistances = $classReflection->getClassHierarchyDistances(); - $annotationProperty = $this->annotationsPropertiesClassReflectionExtension->getProperty($classReflection, $propertyName); - if (!isset($hierarchyDistances[$annotationProperty->getDeclaringClass()->getName()])) { - throw new \PHPStan\ShouldNotHappenException(); - } - if (!isset($hierarchyDistances[$propertyReflection->getDeclaringClass()->getName()])) { - throw new \PHPStan\ShouldNotHappenException(); - } - - if ($hierarchyDistances[$annotationProperty->getDeclaringClass()->getName()] < $hierarchyDistances[$propertyReflection->getDeclaringClass()->getName()]) { - return $annotationProperty; - } - } - - $docComment = $propertyReflection->getDocComment() !== false - ? $propertyReflection->getDocComment() - : null; - - $phpDocType = null; - if ($declaringClassReflection->getFileName() !== false) { - $phpDocBlock = PhpDocBlock::resolvePhpDocBlockForProperty( - $this->broker, - $docComment, - $declaringClassReflection->getName(), - null, - $propertyName, - $declaringClassReflection->getFileName() - ); - - if ($phpDocBlock !== null) { - $resolvedPhpDoc = $this->fileTypeMapper->getResolvedPhpDoc( - $phpDocBlock->getFile(), - $phpDocBlock->getClass(), - $this->findPropertyTrait($phpDocBlock, $propertyReflection), - $phpDocBlock->getDocComment() - ); - $varTags = $resolvedPhpDoc->getVarTags(); - if (isset($varTags[0]) && count($varTags) === 1) { - $phpDocType = $varTags[0]->getType(); - } elseif (isset($varTags[$propertyName])) { - $phpDocType = $varTags[$propertyName]->getType(); - } - $deprecatedDescription = $resolvedPhpDoc->getDeprecatedTag() !== null ? $resolvedPhpDoc->getDeprecatedTag()->getMessage() : null; - $isDeprecated = $resolvedPhpDoc->isDeprecated(); - $isInternal = $resolvedPhpDoc->isInternal(); - } elseif ( - $this->inferPrivatePropertyTypeFromConstructor - && $propertyReflection->isPrivate() - && (!method_exists($propertyReflection, 'hasType') || !$propertyReflection->hasType()) - && $declaringClassReflection->hasConstructor() - && $declaringClassReflection->getConstructor()->getDeclaringClass()->getName() === $declaringClassReflection->getName() - ) { - $phpDocType = $this->inferPrivatePropertyType( - $propertyReflection->getName(), - $declaringClassReflection->getConstructor() - ); - } - } - - $nativeType = null; - if (method_exists($propertyReflection, 'getType') && $propertyReflection->getType() !== null) { - $nativeType = $propertyReflection->getType(); - } - - return new PhpPropertyReflection( - $declaringClassReflection, - $nativeType, - $phpDocType, - $propertyReflection, - $deprecatedDescription, - $isDeprecated, - $isInternal - ); - } - - public function hasMethod(ClassReflection $classReflection, string $methodName): bool - { - if ( - $classReflection->getName() === \ReflectionType::class - ) { - $classReflection = $this->broker->getClass(\ReflectionNamedType::class); - } - - return $classReflection->getNativeReflection()->hasMethod($methodName); - } - - public function getMethod(ClassReflection $classReflection, string $methodName): MethodReflection - { - if ( - $classReflection->getName() === \ReflectionType::class - ) { - $classReflection = $this->broker->getClass(\ReflectionNamedType::class); - } - - if (isset($this->methodsIncludingAnnotations[$classReflection->getName()][$methodName])) { - return $this->methodsIncludingAnnotations[$classReflection->getName()][$methodName]; - } - - $nativeMethodReflection = new NativeBuiltinMethodReflection($classReflection->getNativeReflection()->getMethod($methodName)); - if (!isset($this->methodsIncludingAnnotations[$classReflection->getName()][$nativeMethodReflection->getName()])) { - $method = $this->createMethod($classReflection, $nativeMethodReflection, true); - $this->methodsIncludingAnnotations[$classReflection->getName()][$nativeMethodReflection->getName()] = $method; - if ($nativeMethodReflection->getName() !== $methodName) { - $this->methodsIncludingAnnotations[$classReflection->getName()][$methodName] = $method; - } - } - - return $this->methodsIncludingAnnotations[$classReflection->getName()][$nativeMethodReflection->getName()]; - } - - public function hasNativeMethod(ClassReflection $classReflection, string $methodName): bool - { - $hasMethod = $this->hasMethod($classReflection, $methodName); - if ($hasMethod) { - return true; - } - - if ($methodName === '__get' && UniversalObjectCratesClassReflectionExtension::isUniversalObjectCrate( - $this->broker, - $this->broker->getUniversalObjectCratesClasses(), - $classReflection - )) { - return true; - } - - return false; - } - - public function getNativeMethod(ClassReflection $classReflection, string $methodName): MethodReflection - { - if (isset($this->nativeMethods[$classReflection->getName()][$methodName])) { - return $this->nativeMethods[$classReflection->getName()][$methodName]; - } - - if ($classReflection->getNativeReflection()->hasMethod($methodName)) { - $nativeMethodReflection = new NativeBuiltinMethodReflection( - $classReflection->getNativeReflection()->getMethod($methodName) - ); - } else { - if ( - $methodName !== '__get' - || !UniversalObjectCratesClassReflectionExtension::isUniversalObjectCrate( - $this->broker, - $this->broker->getUniversalObjectCratesClasses(), - $classReflection - )) { - throw new \PHPStan\ShouldNotHappenException(); - } - - $nativeMethodReflection = new FakeBuiltinMethodReflection( - $methodName, - $classReflection->getNativeReflection() - ); - } - - if (!isset($this->nativeMethods[$classReflection->getName()][$nativeMethodReflection->getName()])) { - $method = $this->createMethod($classReflection, $nativeMethodReflection, false); - $this->nativeMethods[$classReflection->getName()][$nativeMethodReflection->getName()] = $method; - } - - return $this->nativeMethods[$classReflection->getName()][$nativeMethodReflection->getName()]; - } - - private function createMethod( - ClassReflection $classReflection, - BuiltinMethodReflection $methodReflection, - bool $includingAnnotations - ): MethodReflection - { - if ($includingAnnotations && $this->annotationsMethodsClassReflectionExtension->hasMethod($classReflection, $methodReflection->getName())) { - $hierarchyDistances = $classReflection->getClassHierarchyDistances(); - $annotationMethod = $this->annotationsMethodsClassReflectionExtension->getMethod($classReflection, $methodReflection->getName()); - if (!isset($hierarchyDistances[$annotationMethod->getDeclaringClass()->getName()])) { - throw new \PHPStan\ShouldNotHappenException(); - } - if (!isset($hierarchyDistances[$methodReflection->getDeclaringClass()->getName()])) { - throw new \PHPStan\ShouldNotHappenException(); - } - - if ($hierarchyDistances[$annotationMethod->getDeclaringClass()->getName()] < $hierarchyDistances[$methodReflection->getDeclaringClass()->getName()]) { - return $annotationMethod; - } - } - $declaringClassName = $methodReflection->getDeclaringClass()->getName(); - $signatureMapMethodName = sprintf('%s::%s', $declaringClassName, $methodReflection->getName()); - $declaringClass = $this->broker->getClass($declaringClassName); - if ($this->signatureMapProvider->hasFunctionSignature($signatureMapMethodName)) { - $variantName = $signatureMapMethodName; - $variants = []; - $i = 0; - while ($this->signatureMapProvider->hasFunctionSignature($variantName)) { - $methodSignature = $this->signatureMapProvider->getFunctionSignature($variantName, $declaringClassName); - $variants[] = new FunctionVariant( - array_map(static function (ParameterSignature $parameterSignature): NativeParameterReflection { - return new NativeParameterReflection( - $parameterSignature->getName(), - $parameterSignature->isOptional(), - $parameterSignature->getType(), - $parameterSignature->passedByReference(), - $parameterSignature->isVariadic() - ); - }, $methodSignature->getParameters()), - $methodSignature->isVariadic(), - $methodSignature->getReturnType() - ); - $i++; - $variantName = sprintf($signatureMapMethodName . '\'' . $i); - } - return new NativeMethodReflection( - $this->broker, - $declaringClass, - $methodReflection, - $variants - ); - } - - $phpDocParameterTypes = []; - $phpDocReturnType = null; - $phpDocThrowType = null; - $deprecatedDescription = null; - $isDeprecated = false; - $isInternal = false; - $isFinal = false; - $declaringTraitName = $this->findMethodTrait($methodReflection); - if ($declaringClass->getFileName() !== false) { - $docComment = $methodReflection->getDocComment() !== false - ? $methodReflection->getDocComment() - : null; - - $phpDocBlock = PhpDocBlock::resolvePhpDocBlockForMethod( - $this->broker, - $docComment, - $declaringClass->getName(), - $declaringTraitName, - $methodReflection->getName(), - $declaringClass->getFileName() - ); - - if ($phpDocBlock !== null) { - $resolvedPhpDoc = $this->fileTypeMapper->getResolvedPhpDoc( - $phpDocBlock->getFile(), - $phpDocBlock->getClass(), - $phpDocBlock->getTrait(), - $phpDocBlock->getDocComment() - ); - $phpDocParameterTypes = array_map(static function (ParamTag $tag): Type { - return $tag->getType(); - }, $resolvedPhpDoc->getParamTags()); - $nativeReturnType = TypehintHelper::decideTypeFromReflection( - $methodReflection->getReturnType(), - null, - $declaringClass->getName() - ); - $phpDocReturnType = null; - if ( - $resolvedPhpDoc->getReturnTag() !== null - && ( - $phpDocBlock->isExplicit() - || $nativeReturnType->isSuperTypeOf($resolvedPhpDoc->getReturnTag()->getType())->yes() - ) - ) { - $phpDocReturnType = $resolvedPhpDoc->getReturnTag()->getType(); - } - $phpDocThrowType = $resolvedPhpDoc->getThrowsTag() !== null ? $resolvedPhpDoc->getThrowsTag()->getType() : null; - $deprecatedDescription = $resolvedPhpDoc->getDeprecatedTag() !== null ? $resolvedPhpDoc->getDeprecatedTag()->getMessage() : null; - $isDeprecated = $resolvedPhpDoc->isDeprecated(); - $isInternal = $resolvedPhpDoc->isInternal(); - $isFinal = $resolvedPhpDoc->isFinal(); - } - } - - $declaringTrait = null; - if ( - $declaringTraitName !== null && $this->broker->hasClass($declaringTraitName) - ) { - $declaringTrait = $this->broker->getClass($declaringTraitName); - } - - return $this->methodReflectionFactory->create( - $declaringClass, - $declaringTrait, - $methodReflection, - $phpDocParameterTypes, - $phpDocReturnType, - $phpDocThrowType, - $deprecatedDescription, - $isDeprecated, - $isInternal, - $isFinal - ); - } - - private function findPropertyTrait( - PhpDocBlock $phpDocBlock, - \ReflectionProperty $propertyReflection - ): ?string - { - $resolvedPhpDoc = $this->fileTypeMapper->getResolvedPhpDoc( - $phpDocBlock->getFile(), - $phpDocBlock->getClass(), - null, - $phpDocBlock->getDocComment() - ); - if (count($resolvedPhpDoc->getVarTags()) > 0) { - return null; - } - - $declaringClass = $propertyReflection->getDeclaringClass(); - $traits = $declaringClass->getTraits(); - while (count($traits) > 0) { - /** @var \ReflectionClass $traitReflection */ - $traitReflection = array_pop($traits); - $traits = array_merge($traits, $traitReflection->getTraits()); - if (!$traitReflection->hasProperty($propertyReflection->getName())) { - continue; - } - - $traitResolvedPhpDoc = $this->fileTypeMapper->getResolvedPhpDoc( - $phpDocBlock->getFile(), - $phpDocBlock->getClass(), - $traitReflection->getName(), - $phpDocBlock->getDocComment() - ); - if ( - count($traitResolvedPhpDoc->getVarTags()) > 0 - ) { - return $traitReflection->getName(); - } - } - - return null; - } - - private function findMethodTrait( - BuiltinMethodReflection $methodReflection - ): ?string - { - $declaringClass = $methodReflection->getDeclaringClass(); - if ( - $methodReflection->getFileName() === $declaringClass->getFileName() - && $methodReflection->getStartLine() >= $declaringClass->getStartLine() - && $methodReflection->getEndLine() <= $declaringClass->getEndLine() - ) { - return null; - } - - $declaringClass = $methodReflection->getDeclaringClass(); - $traitAliases = $declaringClass->getTraitAliases(); - if (array_key_exists($methodReflection->getName(), $traitAliases)) { - return explode('::', $traitAliases[$methodReflection->getName()])[0]; - } - - foreach ($this->collectTraits($declaringClass) as $traitReflection) { - if (!$traitReflection->hasMethod($methodReflection->getName())) { - continue; - } - - if ( - $methodReflection->getFileName() === $traitReflection->getFileName() - && $methodReflection->getStartLine() >= $traitReflection->getStartLine() - && $methodReflection->getEndLine() <= $traitReflection->getEndLine() - ) { - return $traitReflection->getName(); - } - } - - return null; - } - - /** - * @param \ReflectionClass $class - * @return \ReflectionClass[] - */ - private function collectTraits(\ReflectionClass $class): array - { - $traits = []; - $traitsLeftToAnalyze = $class->getTraits(); - - while (count($traitsLeftToAnalyze) !== 0) { - $trait = reset($traitsLeftToAnalyze); - $traits[] = $trait; - - foreach ($trait->getTraits() as $subTrait) { - if (in_array($subTrait, $traits, true)) { - continue; - } - - $traitsLeftToAnalyze[] = $subTrait; - } - - array_shift($traitsLeftToAnalyze); - } - - return $traits; - } - - private function inferPrivatePropertyType( - string $propertyName, - MethodReflection $constructor - ): Type - { - $declaringClassName = $constructor->getDeclaringClass()->getName(); - if (isset($this->inferClassConstructorPropertyTypesInProcess[$declaringClassName])) { - return new MixedType(); - } - $this->inferClassConstructorPropertyTypesInProcess[$declaringClassName] = true; - $propertyTypes = $this->inferAndCachePropertyTypes($constructor); - unset($this->inferClassConstructorPropertyTypesInProcess[$declaringClassName]); - if (array_key_exists($propertyName, $propertyTypes)) { - return $propertyTypes[$propertyName]; - } - - return new MixedType(); - } - - /** - * @param \PHPStan\Reflection\MethodReflection $constructor - * @return array - */ - private function inferAndCachePropertyTypes( - MethodReflection $constructor - ): array - { - $declaringClass = $constructor->getDeclaringClass(); - if (isset($this->propertyTypesCache[$declaringClass->getName()])) { - return $this->propertyTypesCache[$declaringClass->getName()]; - } - if ($declaringClass->getFileName() === false) { - return $this->propertyTypesCache[$declaringClass->getName()] = []; - } - - $fileName = $declaringClass->getFileName(); - $nodes = $this->parser->parseFile($fileName); - $classNode = $this->findClassNode($declaringClass->getName(), $nodes); - if ($classNode === null) { - return $this->propertyTypesCache[$declaringClass->getName()] = []; - } - - $methodNode = $this->findConstructorNode($constructor->getName(), $classNode->stmts); - if ($methodNode === null || $methodNode->stmts === null) { - return $this->propertyTypesCache[$declaringClass->getName()] = []; - } - - /** @var NodeScopeResolver $nodeScopeResolver */ - $nodeScopeResolver = $this->container->getByType(NodeScopeResolver::class); - - /** @var \PHPStan\Analyser\ScopeFactory $scopeFactory */ - $scopeFactory = $this->container->getByType(ScopeFactory::class); - - $classNameParts = explode('\\', $declaringClass->getName()); - $namespace = null; - if (count($classNameParts) > 0) { - $namespace = implode('\\', array_slice($classNameParts, 0, -1)); - } - - $classScope = $scopeFactory->create( - ScopeContext::create($fileName), - false, - $constructor, - $namespace - )->enterClass($declaringClass); - [$phpDocParameterTypes, $phpDocReturnType, $phpDocThrowType, $deprecatedDescription, $isDeprecated, $isInternal, $isFinal] = $nodeScopeResolver->getPhpDocs($classScope, $methodNode); - $methodScope = $classScope->enterClassMethod( - $methodNode, - $phpDocParameterTypes, - $phpDocReturnType, - $phpDocThrowType, - $deprecatedDescription, - $isDeprecated, - $isInternal, - $isFinal - ); - - $propertyTypes = []; - foreach ($methodNode->stmts as $statement) { - if (!$statement instanceof Node\Stmt\Expression) { - continue; - } - - $expr = $statement->expr; - if (!$expr instanceof Node\Expr\Assign) { - continue; - } - - if (!$expr->var instanceof Node\Expr\PropertyFetch) { - continue; - } - - $propertyFetch = $expr->var; - if ( - !$propertyFetch->var instanceof Node\Expr\Variable - || $propertyFetch->var->name !== 'this' - || !$propertyFetch->name instanceof Node\Identifier - ) { - continue; - } - - $propertyType = $methodScope->getType($expr->expr); - if ($propertyType instanceof ErrorType || $propertyType instanceof NeverType) { - continue; - } - - $propertyTypes[$propertyFetch->name->toString()] = $propertyType; - } - - return $this->propertyTypesCache[$declaringClass->getName()] = $propertyTypes; - } - - /** - * @param string $className - * @param \PhpParser\Node[] $nodes - * @return \PhpParser\Node\Stmt\Class_|null - */ - private function findClassNode(string $className, array $nodes): ?Class_ - { - foreach ($nodes as $node) { - if ( - $node instanceof Class_ - && $node->namespacedName->toString() === $className - ) { - return $node; - } - if ( - !$node instanceof Namespace_ - && !$node instanceof Declare_ - ) { - continue; - } - $subNodeNames = $node->getSubNodeNames(); - foreach ($subNodeNames as $subNodeName) { - $subNode = $node->{$subNodeName}; - if (!is_array($subNode)) { - $subNode = [$subNode]; - } - $result = $this->findClassNode($className, $subNode); - if ($result === null) { - continue; - } - return $result; - } - } - return null; - } - - /** - * @param string $methodName - * @param \PhpParser\Node\Stmt[] $classStatements - * @return \PhpParser\Node\Stmt\ClassMethod|null - */ - private function findConstructorNode(string $methodName, array $classStatements): ?ClassMethod - { - foreach ($classStatements as $statement) { - if ( - $statement instanceof ClassMethod - && $statement->name->toString() === $methodName - ) { - return $statement; - } - } - return null; - } - -} diff --git a/vendor/phpstan/phpstan/src/Reflection/Php/PhpFunctionFromParserNodeReflection.php b/vendor/phpstan/phpstan/src/Reflection/Php/PhpFunctionFromParserNodeReflection.php deleted file mode 100644 index 49f825e..0000000 --- a/vendor/phpstan/phpstan/src/Reflection/Php/PhpFunctionFromParserNodeReflection.php +++ /dev/null @@ -1,214 +0,0 @@ -functionLike = $functionLike; - $this->realParameterTypes = $realParameterTypes; - $this->phpDocParameterTypes = $phpDocParameterTypes; - $this->realReturnTypePresent = $realReturnTypePresent; - $this->realReturnType = $realReturnType; - $this->phpDocReturnType = $phpDocReturnType; - $this->throwType = $throwType; - $this->deprecatedDescription = $deprecatedDescription; - $this->isDeprecated = $isDeprecated; - $this->isInternal = $isInternal; - $this->isFinal = $isFinal; - } - - protected function getFunctionLike(): FunctionLike - { - return $this->functionLike; - } - - public function getName(): string - { - if ($this->functionLike instanceof ClassMethod) { - return $this->functionLike->name->name; - } - - return (string) $this->functionLike->namespacedName; - } - - /** - * @return \PHPStan\Reflection\ParametersAcceptorWithPhpDocs[] - */ - public function getVariants(): array - { - if ($this->variants === null) { - $this->variants = [ - new FunctionVariantWithPhpDocs( - $this->getParameters(), - $this->isVariadic(), - $this->getReturnType(), - $this->phpDocReturnType ?? new MixedType(), - $this->realReturnType ?? new MixedType() - ), - ]; - } - - return $this->variants; - } - - /** - * @return \PHPStan\Reflection\ParameterReflectionWithPhpDocs[] - */ - private function getParameters(): array - { - $parameters = []; - $isOptional = true; - - /** @var \PhpParser\Node\Param $parameter */ - foreach (array_reverse($this->functionLike->getParams()) as $parameter) { - if (!$isOptional || $parameter->default === null) { - $isOptional = false; - } - - if (!$parameter->var instanceof Variable || !is_string($parameter->var->name)) { - throw new \PHPStan\ShouldNotHappenException(); - } - $parameters[] = new PhpParameterFromParserNodeReflection( - $parameter->var->name, - $isOptional, - $this->realParameterTypes[$parameter->var->name], - $this->phpDocParameterTypes[$parameter->var->name] ?? null, - $parameter->byRef - ? PassedByReference::createCreatesNewVariable() - : PassedByReference::createNo(), - $parameter->default, - $parameter->variadic - ); - } - - return array_reverse($parameters); - } - - private function isVariadic(): bool - { - foreach ($this->functionLike->getParams() as $parameter) { - if ($parameter->variadic) { - return true; - } - } - - return false; - } - - protected function getReturnType(): Type - { - $phpDocReturnType = $this->phpDocReturnType; - if ( - $this->realReturnTypePresent - && $phpDocReturnType !== null - && TypeCombinator::containsNull($this->realReturnType) !== TypeCombinator::containsNull($phpDocReturnType) - ) { - $phpDocReturnType = null; - } - return TypehintHelper::decideType($this->realReturnType, $phpDocReturnType); - } - - public function getDeprecatedDescription(): ?string - { - if ($this->isDeprecated) { - return $this->deprecatedDescription; - } - - return null; - } - - public function isDeprecated(): bool - { - return $this->isDeprecated; - } - - public function isInternal(): bool - { - return $this->isInternal; - } - - public function isFinal(): bool - { - return $this->isFinal; - } - - public function getThrowType(): ?Type - { - return $this->throwType; - } - -} diff --git a/vendor/phpstan/phpstan/src/Reflection/Php/PhpFunctionReflection.php b/vendor/phpstan/phpstan/src/Reflection/Php/PhpFunctionReflection.php deleted file mode 100644 index 9f29d7c..0000000 --- a/vendor/phpstan/phpstan/src/Reflection/Php/PhpFunctionReflection.php +++ /dev/null @@ -1,268 +0,0 @@ -reflection = $reflection; - $this->parser = $parser; - $this->functionCallStatementFinder = $functionCallStatementFinder; - $this->cache = $cache; - $this->phpDocParameterTypes = $phpDocParameterTypes; - $this->phpDocReturnType = $phpDocReturnType; - $this->phpDocThrowType = $phpDocThrowType; - $this->isDeprecated = $isDeprecated; - $this->deprecatedDescription = $deprecatedDescription; - $this->isInternal = $isInternal; - $this->isFinal = $isFinal; - $this->filename = $filename; - } - - public function getName(): string - { - return $this->reflection->getName(); - } - - /** - * @return string|false - */ - public function getFileName() - { - return $this->filename; - } - - /** - * @return ParametersAcceptorWithPhpDocs[] - */ - public function getVariants(): array - { - if ($this->variants === null) { - $this->variants = [ - new FunctionVariantWithPhpDocs( - $this->getParameters(), - $this->isVariadic(), - $this->getReturnType(), - $this->getPhpDocReturnType(), - $this->getNativeReturnType() - ), - ]; - } - - return $this->variants; - } - - /** - * @return \PHPStan\Reflection\ParameterReflectionWithPhpDocs[] - */ - private function getParameters(): array - { - return array_map(function (\ReflectionParameter $reflection): PhpParameterReflection { - return new PhpParameterReflection( - $reflection, - $this->phpDocParameterTypes[$reflection->getName()] ?? null - ); - }, $this->reflection->getParameters()); - } - - private function isVariadic(): bool - { - $isNativelyVariadic = $this->reflection->isVariadic(); - if (!$isNativelyVariadic && $this->reflection->getFileName() !== false) { - $key = sprintf('variadic-function-%s-v0', $this->reflection->getName()); - $cachedResult = $this->cache->load($key); - if ($cachedResult === null) { - $nodes = $this->parser->parseFile($this->reflection->getFileName()); - $result = $this->callsFuncGetArgs($nodes); - $this->cache->save($key, $result); - return $result; - } - - return $cachedResult; - } - - return $isNativelyVariadic; - } - - /** - * @param mixed $nodes - * @return bool - */ - private function callsFuncGetArgs($nodes): bool - { - foreach ($nodes as $node) { - if (is_array($node)) { - if ($this->callsFuncGetArgs($node)) { - return true; - } - } - - if (!($node instanceof \PhpParser\Node)) { - continue; - } - - if ($node instanceof Function_) { - $functionName = (string) $node->namespacedName; - - if ($functionName === $this->reflection->getName()) { - return $this->functionCallStatementFinder->findFunctionCallInStatements(ParametersAcceptor::VARIADIC_FUNCTIONS, $node->getStmts()) !== null; - } - - continue; - } - - if ($this->callsFuncGetArgs($node)) { - return true; - } - } - - return false; - } - - private function getReturnType(): Type - { - if ($this->reflection->getName() === 'count') { - return new IntegerType(); - } - $returnType = $this->reflection->getReturnType(); - $phpDocReturnType = $this->phpDocReturnType; - if ( - $returnType !== null - && $phpDocReturnType !== null - && $returnType->allowsNull() !== TypeCombinator::containsNull($phpDocReturnType) - ) { - $phpDocReturnType = null; - } - return TypehintHelper::decideTypeFromReflection( - $returnType, - $phpDocReturnType - ); - } - - private function getPhpDocReturnType(): Type - { - if ($this->phpDocReturnType !== null) { - return $this->phpDocReturnType; - } - - return new MixedType(); - } - - private function getNativeReturnType(): Type - { - return TypehintHelper::decideTypeFromReflection($this->reflection->getReturnType()); - } - - public function getDeprecatedDescription(): ?string - { - if ($this->isDeprecated) { - return $this->deprecatedDescription; - } - - return null; - } - - public function isDeprecated(): bool - { - return $this->isDeprecated || $this->reflection->isDeprecated(); - } - - public function isInternal(): bool - { - return $this->isInternal; - } - - public function isFinal(): bool - { - return $this->isFinal; - } - - public function getThrowType(): ?Type - { - return $this->phpDocThrowType; - } - -} diff --git a/vendor/phpstan/phpstan/src/Reflection/Php/PhpMethodFromParserNodeReflection.php b/vendor/phpstan/phpstan/src/Reflection/Php/PhpMethodFromParserNodeReflection.php deleted file mode 100644 index 0675558..0000000 --- a/vendor/phpstan/phpstan/src/Reflection/Php/PhpMethodFromParserNodeReflection.php +++ /dev/null @@ -1,128 +0,0 @@ -declaringClass = $declaringClass; - } - - public function getDeclaringClass(): ClassReflection - { - return $this->declaringClass; - } - - public function getPrototype(): ClassMemberReflection - { - return $this->declaringClass->getNativeMethod($this->getClassMethod()->name->name)->getPrototype(); - } - - private function getClassMethod(): ClassMethod - { - /** @var \PhpParser\Node\Stmt\ClassMethod $functionLike */ - $functionLike = $this->getFunctionLike(); - return $functionLike; - } - - public function isStatic(): bool - { - return $this->getClassMethod()->isStatic(); - } - - public function isPrivate(): bool - { - return $this->getClassMethod()->isPrivate(); - } - - public function isPublic(): bool - { - return $this->getClassMethod()->isPublic(); - } - - protected function getReturnType(): Type - { - $name = strtolower($this->getName()); - if ( - $name === '__construct' - || $name === '__destruct' - || $name === '__unset' - || $name === '__wakeup' - || $name === '__clone' - ) { - return new VoidType(); - } - if ($name === '__tostring') { - return new StringType(); - } - if ($name === '__isset') { - return new BooleanType(); - } - if ($name === '__sleep') { - return new ArrayType(new IntegerType(), new StringType()); - } - if ($name === '__set_state') { - return new ObjectWithoutClassType(); - } - - return parent::getReturnType(); - } - -} diff --git a/vendor/phpstan/phpstan/src/Reflection/Php/PhpMethodReflection.php b/vendor/phpstan/phpstan/src/Reflection/Php/PhpMethodReflection.php deleted file mode 100644 index 86dbc84..0000000 --- a/vendor/phpstan/phpstan/src/Reflection/Php/PhpMethodReflection.php +++ /dev/null @@ -1,439 +0,0 @@ -declaringClass = $declaringClass; - $this->declaringTrait = $declaringTrait; - $this->reflection = $reflection; - $this->broker = $broker; - $this->parser = $parser; - $this->functionCallStatementFinder = $functionCallStatementFinder; - $this->cache = $cache; - $this->phpDocParameterTypes = $phpDocParameterTypes; - $this->phpDocReturnType = $phpDocReturnType; - $this->phpDocThrowType = $phpDocThrowType; - $this->deprecatedDescription = $deprecatedDescription; - $this->isDeprecated = $isDeprecated; - $this->isInternal = $isInternal; - $this->isFinal = $isFinal; - } - - public function getDeclaringClass(): ClassReflection - { - return $this->declaringClass; - } - - public function getDeclaringTrait(): ?ClassReflection - { - return $this->declaringTrait; - } - - /** - * @return string|false - */ - public function getDocComment() - { - return $this->reflection->getDocComment(); - } - - /** - * @return self|\PHPStan\Reflection\MethodPrototypeReflection - */ - public function getPrototype(): ClassMemberReflection - { - try { - $prototypeMethod = $this->reflection->getPrototype(); - $prototypeDeclaringClass = $this->broker->getClass($prototypeMethod->getDeclaringClass()->getName()); - - return new MethodPrototypeReflection( - $prototypeDeclaringClass, - $prototypeMethod->isStatic(), - $prototypeMethod->isPrivate(), - $prototypeMethod->isPublic(), - $prototypeMethod->isAbstract() - ); - } catch (\ReflectionException $e) { - return $this; - } - } - - public function isStatic(): bool - { - return $this->reflection->isStatic(); - } - - public function getName(): string - { - $name = $this->reflection->getName(); - $lowercaseName = strtolower($name); - if ($lowercaseName === $name) { - // fix for https://bugs.php.net/bug.php?id=74939 - foreach ($this->getDeclaringClass()->getNativeReflection()->getTraitAliases() as $traitTarget) { - $correctName = $this->getMethodNameWithCorrectCase($name, $traitTarget); - if ($correctName !== null) { - $name = $correctName; - break; - } - } - } - - return $name; - } - - private function getMethodNameWithCorrectCase(string $lowercaseMethodName, string $traitTarget): ?string - { - $trait = explode('::', $traitTarget)[0]; - $traitReflection = $this->broker->getClass($trait)->getNativeReflection(); - foreach ($traitReflection->getTraitAliases() as $methodAlias => $aliasTraitTarget) { - if ($lowercaseMethodName === strtolower($methodAlias)) { - return $methodAlias; - } - - $correctName = $this->getMethodNameWithCorrectCase($lowercaseMethodName, $aliasTraitTarget); - if ($correctName !== null) { - return $correctName; - } - } - - return null; - } - - /** - * @return ParametersAcceptorWithPhpDocs[] - */ - public function getVariants(): array - { - if ($this->variants === null) { - $this->variants = [ - new FunctionVariantWithPhpDocs( - $this->getParameters(), - $this->isVariadic(), - $this->getReturnType(), - $this->getPhpDocReturnType(), - $this->getNativeReturnType() - ), - ]; - } - - return $this->variants; - } - - /** - * @return \PHPStan\Reflection\ParameterReflectionWithPhpDocs[] - */ - private function getParameters(): array - { - if ($this->parameters === null) { - $this->parameters = array_map(function (\ReflectionParameter $reflection): PhpParameterReflection { - return new PhpParameterReflection( - $reflection, - $this->phpDocParameterTypes[$reflection->getName()] ?? null - ); - }, $this->reflection->getParameters()); - } - - return $this->parameters; - } - - private function isVariadic(): bool - { - $isNativelyVariadic = $this->reflection->isVariadic(); - $declaringClass = $this->declaringClass; - $filename = $this->declaringClass->getFileName(); - if ($this->declaringTrait !== null) { - $declaringClass = $this->declaringTrait; - $filename = $this->declaringTrait->getFileName(); - } - - if (!$isNativelyVariadic && $filename !== false) { - $key = sprintf('variadic-method-%s-%s-v1', $declaringClass->getName(), $this->reflection->getName()); - $cachedResult = $this->cache->load($key); - if ($cachedResult === null || !is_bool($cachedResult)) { - $nodes = $this->parser->parseFile($filename); - $result = $this->callsFuncGetArgs($declaringClass, $nodes); - $this->cache->save($key, $result); - return $result; - } - - return $cachedResult; - } - - return $isNativelyVariadic; - } - - /** - * @param ClassReflection $declaringClass - * @param mixed $nodes - * @return bool - */ - private function callsFuncGetArgs(ClassReflection $declaringClass, $nodes): bool - { - foreach ($nodes as $node) { - if (is_array($node)) { - if ($this->callsFuncGetArgs($declaringClass, $node)) { - return true; - } - } - - if (!($node instanceof \PhpParser\Node)) { - continue; - } - - if ( - $node instanceof \PhpParser\Node\Stmt\ClassLike - && isset($node->namespacedName) - && $declaringClass->getName() !== (string) $node->namespacedName - ) { - continue; - } - - if ($node instanceof ClassMethod) { - if ($node->getStmts() === null) { - continue; // interface - } - - $methodName = $node->name->name; - if ($methodName === $this->reflection->getName()) { - return $this->functionCallStatementFinder->findFunctionCallInStatements(ParametersAcceptor::VARIADIC_FUNCTIONS, $node->getStmts()) !== null; - } - - continue; - } - - if ($this->callsFuncGetArgs($declaringClass, $node)) { - return true; - } - } - - return false; - } - - public function isPrivate(): bool - { - return $this->reflection->isPrivate(); - } - - public function isPublic(): bool - { - return $this->reflection->isPublic(); - } - - private function getReturnType(): Type - { - if ($this->returnType === null) { - $name = strtolower($this->getName()); - if ( - $name === '__construct' - || $name === '__destruct' - || $name === '__unset' - || $name === '__wakeup' - || $name === '__clone' - ) { - return $this->returnType = new VoidType(); - } - if ($name === '__tostring') { - return $this->returnType = new StringType(); - } - if ($name === '__isset') { - return $this->returnType = new BooleanType(); - } - if ($name === '__sleep') { - return $this->returnType = new ArrayType(new IntegerType(), new StringType()); - } - if ($name === '__set_state') { - return $this->returnType = new ObjectWithoutClassType(); - } - - $returnType = $this->reflection->getReturnType(); - $phpDocReturnType = $this->phpDocReturnType; - if ( - $returnType !== null - && $phpDocReturnType !== null - && $returnType->allowsNull() !== TypeCombinator::containsNull($phpDocReturnType) - ) { - $phpDocReturnType = null; - } - $this->returnType = TypehintHelper::decideTypeFromReflection( - $returnType, - $phpDocReturnType, - $this->declaringClass->getName() - ); - } - - return $this->returnType; - } - - private function getPhpDocReturnType(): Type - { - if ($this->phpDocReturnType !== null) { - return $this->phpDocReturnType; - } - - return new MixedType(); - } - - private function getNativeReturnType(): Type - { - if ($this->nativeReturnType === null) { - $this->nativeReturnType = TypehintHelper::decideTypeFromReflection( - $this->reflection->getReturnType(), - null, - $this->declaringClass->getName() - ); - } - - return $this->nativeReturnType; - } - - public function getDeprecatedDescription(): ?string - { - if ($this->isDeprecated) { - return $this->deprecatedDescription; - } - - return null; - } - - public function isDeprecated(): bool - { - return $this->reflection->isDeprecated() || $this->isDeprecated; - } - - public function isInternal(): bool - { - return $this->reflection->isInternal() || $this->isInternal; - } - - public function isAbstract(): bool - { - return $this->reflection->isAbstract(); - } - - public function isFinal(): bool - { - return $this->reflection->isFinal() || $this->isFinal; - } - - public function getThrowType(): ?Type - { - return $this->phpDocThrowType; - } - -} diff --git a/vendor/phpstan/phpstan/src/Reflection/Php/PhpMethodReflectionFactory.php b/vendor/phpstan/phpstan/src/Reflection/Php/PhpMethodReflectionFactory.php deleted file mode 100644 index c507ee0..0000000 --- a/vendor/phpstan/phpstan/src/Reflection/Php/PhpMethodReflectionFactory.php +++ /dev/null @@ -1,38 +0,0 @@ -name = $name; - $this->optional = $optional; - $this->realType = $realType; - $this->phpDocType = $phpDocType; - $this->passedByReference = $passedByReference; - $this->defaultValue = $defaultValue; - $this->variadic = $variadic; - } - - public function getName(): string - { - return $this->name; - } - - public function isOptional(): bool - { - return $this->optional; - } - - public function getType(): Type - { - if ($this->type === null) { - $phpDocType = $this->phpDocType; - if ($phpDocType !== null && $this->defaultValue !== null) { - if ( - $this->defaultValue instanceof ConstFetch - && strtolower((string) $this->defaultValue->name) === 'null' - ) { - $phpDocType = \PHPStan\Type\TypeCombinator::addNull($phpDocType); - } - } - $this->type = TypehintHelper::decideType($this->realType, $phpDocType); - } - - return $this->type; - } - - public function getPhpDocType(): Type - { - return $this->phpDocType ?? new MixedType(); - } - - public function getNativeType(): Type - { - return $this->realType ?? new MixedType(); - } - - public function passedByReference(): PassedByReference - { - return $this->passedByReference; - } - - public function isVariadic(): bool - { - return $this->variadic; - } - -} diff --git a/vendor/phpstan/phpstan/src/Reflection/Php/PhpParameterReflection.php b/vendor/phpstan/phpstan/src/Reflection/Php/PhpParameterReflection.php deleted file mode 100644 index 0d8cb76..0000000 --- a/vendor/phpstan/phpstan/src/Reflection/Php/PhpParameterReflection.php +++ /dev/null @@ -1,95 +0,0 @@ -reflection = $reflection; - $this->phpDocType = $phpDocType; - } - - public function isOptional(): bool - { - return $this->reflection->isOptional(); - } - - public function getName(): string - { - return $this->reflection->getName(); - } - - public function getType(): Type - { - if ($this->type === null) { - $phpDocType = $this->phpDocType; - if ($phpDocType !== null && $this->reflection->isDefaultValueAvailable() && $this->reflection->getDefaultValue() === null) { - $phpDocType = \PHPStan\Type\TypeCombinator::addNull($phpDocType); - } - $this->type = TypehintHelper::decideTypeFromReflection( - $this->reflection->getType(), - $phpDocType, - $this->reflection->getDeclaringClass() !== null ? $this->reflection->getDeclaringClass()->getName() : null, - $this->isVariadic() - ); - } - - return $this->type; - } - - public function passedByReference(): PassedByReference - { - return $this->reflection->isPassedByReference() - ? PassedByReference::createCreatesNewVariable() - : PassedByReference::createNo(); - } - - public function isVariadic(): bool - { - return $this->reflection->isVariadic(); - } - - public function getPhpDocType(): Type - { - if ($this->phpDocType !== null) { - return $this->phpDocType; - } - - return new MixedType(); - } - - public function getNativeType(): Type - { - if ($this->nativeType === null) { - $this->nativeType = TypehintHelper::decideTypeFromReflection( - $this->reflection->getType(), - null, - $this->reflection->getDeclaringClass() !== null ? $this->reflection->getDeclaringClass()->getName() : null, - $this->isVariadic() - ); - } - - return $this->nativeType; - } - -} diff --git a/vendor/phpstan/phpstan/src/Reflection/Php/PhpPropertyReflection.php b/vendor/phpstan/phpstan/src/Reflection/Php/PhpPropertyReflection.php deleted file mode 100644 index c81e479..0000000 --- a/vendor/phpstan/phpstan/src/Reflection/Php/PhpPropertyReflection.php +++ /dev/null @@ -1,168 +0,0 @@ -declaringClass = $declaringClass; - $this->nativeType = $nativeType; - $this->phpDocType = $phpDocType; - $this->reflection = $reflection; - $this->deprecatedDescription = $deprecatedDescription; - $this->isDeprecated = $isDeprecated; - $this->isInternal = $isInternal; - } - - public function getDeclaringClass(): ClassReflection - { - return $this->declaringClass; - } - - /** - * @return string|false - */ - public function getDocComment() - { - return $this->reflection->getDocComment(); - } - - public function isStatic(): bool - { - return $this->reflection->isStatic(); - } - - public function isPrivate(): bool - { - return $this->reflection->isPrivate(); - } - - public function isPublic(): bool - { - return $this->reflection->isPublic(); - } - - public function getType(): Type - { - if ($this->type === null) { - $phpDocType = $this->phpDocType; - if ( - $this->nativeType !== null - && $this->phpDocType !== null - && $this->nativeType->allowsNull() !== TypeCombinator::containsNull($this->phpDocType) - ) { - $phpDocType = null; - } - $this->type = TypehintHelper::decideTypeFromReflection( - $this->nativeType, - $phpDocType, - $this->declaringClass->getName() - ); - } - - return $this->type; - } - - public function hasPhpDoc(): bool - { - return $this->phpDocType !== null; - } - - public function getPhpDocType(): Type - { - if ($this->phpDocType !== null) { - return $this->phpDocType; - } - - return new MixedType(); - } - - public function getNativeType(): Type - { - if ($this->finalNativeType === null) { - $this->finalNativeType = TypehintHelper::decideTypeFromReflection( - $this->nativeType, - null, - $this->declaringClass->getName() - ); - } - - return $this->finalNativeType; - } - - public function isReadable(): bool - { - return true; - } - - public function isWritable(): bool - { - return true; - } - - public function getDeprecatedDescription(): ?string - { - if ($this->isDeprecated) { - return $this->deprecatedDescription; - } - - return null; - } - - public function isDeprecated(): bool - { - return $this->isDeprecated; - } - - public function isInternal(): bool - { - return $this->isInternal; - } - -} diff --git a/vendor/phpstan/phpstan/src/Reflection/Php/SimpleXMLElementProperty.php b/vendor/phpstan/phpstan/src/Reflection/Php/SimpleXMLElementProperty.php deleted file mode 100644 index a6966f5..0000000 --- a/vendor/phpstan/phpstan/src/Reflection/Php/SimpleXMLElementProperty.php +++ /dev/null @@ -1,83 +0,0 @@ -declaringClass = $declaringClass; - $this->type = $type; - } - - public function getDeclaringClass(): ClassReflection - { - return $this->declaringClass; - } - - public function isStatic(): bool - { - return false; - } - - public function isPrivate(): bool - { - return false; - } - - public function isPublic(): bool - { - return true; - } - - public function getType(): Type - { - return $this->type; - } - - public function getWritableType(): Type - { - return TypeCombinator::union( - $this->type, - new IntegerType(), - new FloatType(), - new StringType(), - new BooleanType() - ); - } - - public function isReadable(): bool - { - return true; - } - - public function isWritable(): bool - { - return true; - } - - public function canChangeTypeAfterAssignment(): bool - { - return false; - } - -} diff --git a/vendor/phpstan/phpstan/src/Reflection/Php/UniversalObjectCrateProperty.php b/vendor/phpstan/phpstan/src/Reflection/Php/UniversalObjectCrateProperty.php deleted file mode 100644 index 70c8911..0000000 --- a/vendor/phpstan/phpstan/src/Reflection/Php/UniversalObjectCrateProperty.php +++ /dev/null @@ -1,61 +0,0 @@ -declaringClass = $declaringClass; - $this->type = $type; - } - - public function getDeclaringClass(): ClassReflection - { - return $this->declaringClass; - } - - public function isStatic(): bool - { - return false; - } - - public function isPrivate(): bool - { - return false; - } - - public function isPublic(): bool - { - return true; - } - - public function getType(): Type - { - return $this->type; - } - - public function isReadable(): bool - { - return true; - } - - public function isWritable(): bool - { - return true; - } - -} diff --git a/vendor/phpstan/phpstan/src/Reflection/Php/UniversalObjectCratesClassReflectionExtension.php b/vendor/phpstan/phpstan/src/Reflection/Php/UniversalObjectCratesClassReflectionExtension.php deleted file mode 100644 index 09bb7c9..0000000 --- a/vendor/phpstan/phpstan/src/Reflection/Php/UniversalObjectCratesClassReflectionExtension.php +++ /dev/null @@ -1,81 +0,0 @@ -classes = $classes; - } - - public function setBroker(Broker $broker): void - { - $this->broker = $broker; - } - - public function hasProperty(ClassReflection $classReflection, string $propertyName): bool - { - return self::isUniversalObjectCrate( - $this->broker, - $this->classes, - $classReflection - ); - } - - /** - * @param \PHPStan\Broker\Broker $broker - * @param string[] $classes - * @param \PHPStan\Reflection\ClassReflection $classReflection - * @return bool - */ - public static function isUniversalObjectCrate( - Broker $broker, - array $classes, - ClassReflection $classReflection - ): bool - { - foreach ($classes as $className) { - if (!$broker->hasClass($className)) { - continue; - } - - if ( - $classReflection->getName() === $className - || $classReflection->isSubclassOf($className) - ) { - return true; - } - } - - return false; - } - - public function getProperty(ClassReflection $classReflection, string $propertyName): PropertyReflection - { - if ($classReflection->hasNativeMethod('__get')) { - $type = ParametersAcceptorSelector::selectSingle($classReflection->getNativeMethod('__get')->getVariants())->getReturnType(); - } else { - $type = new MixedType(); - } - return new UniversalObjectCrateProperty($classReflection, $type); - } - -} diff --git a/vendor/phpstan/phpstan/src/Reflection/PhpDefect/PhpDefectClassReflectionExtension.php b/vendor/phpstan/phpstan/src/Reflection/PhpDefect/PhpDefectClassReflectionExtension.php deleted file mode 100644 index 3feebd6..0000000 --- a/vendor/phpstan/phpstan/src/Reflection/PhpDefect/PhpDefectClassReflectionExtension.php +++ /dev/null @@ -1,241 +0,0 @@ -> */ - private static $defaultProperties = [ - \DateInterval::class => [ - 'y' => 'int', - 'm' => 'int', - 'd' => 'int', - 'h' => 'int', - 'i' => 'int', - 's' => 'int', - 'invert' => 'int', - 'days' => 'mixed', - 'f' => 'float', - ], - \DatePeriod::class => [ - 'recurrences' => 'int', - 'include_start_date' => 'bool', - 'start' => \DateTimeInterface::class, - 'current' => \DateTimeInterface::class, - 'end' => \DateTimeInterface::class, - 'interval' => \DateInterval::class, - ], - 'Directory' => [ - 'handle' => 'resource', - 'path' => 'string', - ], - 'DOMAttr' => [ // extends DOMNode - 'name' => 'string', - 'ownerDocument' => 'DOMDocument', - 'ownerElement' => 'DOMElement', - 'schemaTypeInfo' => 'bool', - 'specified' => 'bool', - 'value' => 'string', - ], - 'DOMCharacterData' => [ // extends DOMNode - 'data' => 'string', - 'length' => 'int', - 'ownerDocument' => 'DOMDocument', - ], - 'DOMDocument' => [ - 'actualEncoding' => 'string', - 'config' => 'DOMConfiguration', - 'doctype' => 'DOMDocumentType', - 'documentElement' => 'DOMElement|null', - 'documentURI' => 'string', - 'encoding' => 'string', - 'formatOutput' => 'bool', - 'implementation' => 'DOMImplementation', - 'ownerDocument' => 'null', - 'preserveWhiteSpace' => 'bool', - 'recover' => 'bool', - 'resolveExternals' => 'bool', - 'standalone' => 'bool', - 'strictErrorChecking' => 'bool', - 'substituteEntities' => 'bool', - 'validateOnParse' => 'bool', - 'version' => 'string', - 'xmlEncoding' => 'string', - 'xmlStandalone' => 'bool', - 'xmlVersion' => 'string', - ], - 'DOMDocumentType' => [ // extends DOMNode - 'publicId' => 'string', - 'systemId' => 'string', - 'name' => 'string', - 'entities' => 'DOMNamedNodeMap', - 'notations' => 'DOMNamedNodeMap', - 'ownerDocument' => 'DOMDocument', - 'internalSubset' => 'string', - ], - 'DOMElement' => [ // extends DOMNode - 'ownerDocument' => 'DOMDocument', - 'schemaTypeInfo' => 'bool', - 'tagName' => 'string', - ], - 'DOMEntity' => [ // extends DOMNode - 'publicId' => 'string', - 'systemId' => 'string', - 'notationName' => 'string', - 'actualEncoding' => 'string', - 'encoding' => 'string', - 'ownerDocument' => 'DOMDocument', - 'version' => 'string', - ], - 'DOMNamedNodeMap' => [ - 'length' => 'int', - ], - 'DOMNode' => [ - 'nodeName' => 'string', - 'nodeValue' => 'string', - 'nodeType' => 'int', - 'parentNode' => 'DOMNode', - 'childNodes' => 'DOMNodeList', - 'firstChild' => 'DOMNode', - 'lastChild' => 'DOMNode', - 'previousSibling' => 'DOMNode', - 'nextSibling' => 'DOMNode', - 'attributes' => 'DOMNamedNodeMap', - 'ownerDocument' => 'DOMDocument|null', - 'namespaceURI' => 'string', - 'prefix' => 'string', - 'localName' => 'string', - 'baseURI' => 'string', - 'textContent' => 'string', - ], - 'DOMNodeList' => [ - 'length' => 'int', - ], - 'DOMNotation' => [ // extends DOMNode - 'ownerDocument' => 'DOMDocument', - 'publicId' => 'string', - 'systemId' => 'string', - ], - 'DOMProcessingInstruction' => [ // extends DOMNode - 'ownerDocument' => 'DOMDocument', - 'target' => 'string', - 'data' => 'string', - ], - 'DOMText' => [ // extends DOMCharacterData - 'wholeText' => 'string', - ], - 'DOMXPath' => [ // extends DOMCharacterData - 'document' => 'DOMDocument', - ], - 'Ds\\Pair' => [ - 'key' => 'mixed', - 'value' => 'mixed', - ], - 'XMLReader' => [ - 'attributeCount' => 'int', - 'baseURI' => 'string', - 'depth' => 'int', - 'hasAttributes' => 'bool', - 'hasValue' => 'bool', - 'isDefault' => 'bool', - 'isEmptyElement' => 'bool', - 'localName' => 'string', - 'name' => 'string', - 'namespaceURI' => 'string', - 'nodeType' => 'int', - 'prefix' => 'string', - 'value' => 'string', - 'xmlLang' => 'string', - ], - 'ZipArchive' => [ - 'status' => 'int', - 'statusSys' => 'int', - 'numFiles' => 'int', - 'filename' => 'string', - 'comment' => 'string', - ], - 'LibXMLError' => [ - 'level' => 'int', - 'code' => 'int', - 'column' => 'int', - 'message' => 'string', - 'file' => 'string', - 'line' => 'int', - ], - ]; - - /** @var \PHPStan\Reflection\Annotations\AnnotationsPropertiesClassReflectionExtension */ - private $annotationsPropertiesClassReflectionExtension; - - /** @var TypeStringResolver */ - private $typeStringResolver; - - /** @var string[][] */ - private $properties = []; - - public function __construct( - TypeStringResolver $typeStringResolver, - AnnotationsPropertiesClassReflectionExtension $annotationsPropertiesClassReflectionExtension - ) - { - $this->typeStringResolver = $typeStringResolver; - $this->properties = self::$defaultProperties; - $this->annotationsPropertiesClassReflectionExtension = $annotationsPropertiesClassReflectionExtension; - } - - public function hasProperty(ClassReflection $classReflection, string $propertyName): bool - { - $classWithProperties = $this->getClassWithProperties($classReflection, $propertyName); - return $classWithProperties !== null; - } - - public function getProperty(ClassReflection $classReflection, string $propertyName): PropertyReflection - { - /** @var \PHPStan\Reflection\ClassReflection $classWithProperties */ - $classWithProperties = $this->getClassWithProperties($classReflection, $propertyName); - - if ($this->annotationsPropertiesClassReflectionExtension->hasProperty($classReflection, $propertyName)) { - $hierarchyDistances = $classReflection->getClassHierarchyDistances(); - $annotationProperty = $this->annotationsPropertiesClassReflectionExtension->getProperty($classReflection, $propertyName); - if (!isset($hierarchyDistances[$annotationProperty->getDeclaringClass()->getName()])) { - throw new \PHPStan\ShouldNotHappenException(); - } - if (!isset($hierarchyDistances[$classWithProperties->getName()])) { - throw new \PHPStan\ShouldNotHappenException(); - } - - if ($hierarchyDistances[$annotationProperty->getDeclaringClass()->getName()] < $hierarchyDistances[$classWithProperties->getName()]) { - return $annotationProperty; - } - } - - $typeString = $this->properties[$classWithProperties->getName()][$propertyName]; - return new PhpDefectPropertyReflection( - $classWithProperties, - $this->typeStringResolver->resolve($typeString) - ); - } - - private function getClassWithProperties(ClassReflection $classReflection, string $propertyName): ?\PHPStan\Reflection\ClassReflection - { - if (isset($this->properties[$classReflection->getName()][$propertyName])) { - return $classReflection; - } - - foreach ($classReflection->getParents() as $parentClass) { - if (isset($this->properties[$parentClass->getName()][$propertyName])) { - return $parentClass; - } - } - - return null; - } - -} diff --git a/vendor/phpstan/phpstan/src/Reflection/PhpDefect/PhpDefectPropertyReflection.php b/vendor/phpstan/phpstan/src/Reflection/PhpDefect/PhpDefectPropertyReflection.php deleted file mode 100644 index b1bff7d..0000000 --- a/vendor/phpstan/phpstan/src/Reflection/PhpDefect/PhpDefectPropertyReflection.php +++ /dev/null @@ -1,62 +0,0 @@ -declaringClass = $declaringClass; - $this->type = $type; - } - - public function getDeclaringClass(): ClassReflection - { - return $this->declaringClass; - } - - public function isStatic(): bool - { - return false; - } - - public function isPrivate(): bool - { - return false; - } - - public function isPublic(): bool - { - return true; - } - - public function getType(): Type - { - return $this->type; - } - - public function isReadable(): bool - { - return true; - } - - public function isWritable(): bool - { - return true; - } - -} diff --git a/vendor/phpstan/phpstan/src/Reflection/PropertiesClassReflectionExtension.php b/vendor/phpstan/phpstan/src/Reflection/PropertiesClassReflectionExtension.php deleted file mode 100644 index 7b8b6fc..0000000 --- a/vendor/phpstan/phpstan/src/Reflection/PropertiesClassReflectionExtension.php +++ /dev/null @@ -1,12 +0,0 @@ - $parameters - * @param \PHPStan\Type\Type $returnType - * @param bool $variadic - */ - public function __construct( - array $parameters, - Type $returnType, - bool $variadic - ) - { - $this->parameters = $parameters; - $this->returnType = $returnType; - $this->variadic = $variadic; - } - - /** - * @return array - */ - public function getParameters(): array - { - return $this->parameters; - } - - public function getReturnType(): Type - { - return $this->returnType; - } - - public function isVariadic(): bool - { - return $this->variadic; - } - -} diff --git a/vendor/phpstan/phpstan/src/Reflection/SignatureMap/ParameterSignature.php b/vendor/phpstan/phpstan/src/Reflection/SignatureMap/ParameterSignature.php deleted file mode 100644 index 323fed6..0000000 --- a/vendor/phpstan/phpstan/src/Reflection/SignatureMap/ParameterSignature.php +++ /dev/null @@ -1,66 +0,0 @@ -name = $name; - $this->optional = $optional; - $this->type = $type; - $this->passedByReference = $passedByReference; - $this->variadic = $variadic; - } - - public function getName(): string - { - return $this->name; - } - - public function isOptional(): bool - { - return $this->optional; - } - - public function getType(): Type - { - return $this->type; - } - - public function passedByReference(): PassedByReference - { - return $this->passedByReference; - } - - public function isVariadic(): bool - { - return $this->variadic; - } - -} diff --git a/vendor/phpstan/phpstan/src/Reflection/SignatureMap/SignatureMapParser.php b/vendor/phpstan/phpstan/src/Reflection/SignatureMap/SignatureMapParser.php deleted file mode 100644 index 64db9cd..0000000 --- a/vendor/phpstan/phpstan/src/Reflection/SignatureMap/SignatureMapParser.php +++ /dev/null @@ -1,127 +0,0 @@ -typeStringResolver = $typeNodeResolver; - } - - /** - * @param mixed[] $map - * @param string|null $className - * @return \PHPStan\Reflection\SignatureMap\FunctionSignature - */ - public function getFunctionSignature(array $map, ?string $className): FunctionSignature - { - $parameterSignatures = $this->getParameters(array_slice($map, 1)); - $hasVariadic = false; - foreach ($parameterSignatures as $parameterSignature) { - if ($parameterSignature->isVariadic()) { - $hasVariadic = true; - break; - } - } - return new FunctionSignature( - $parameterSignatures, - $this->getTypeFromString($map[0], $className), - $hasVariadic - ); - } - - private function getTypeFromString(string $typeString, ?string $className): Type - { - if ($typeString === '') { - return new MixedType(true); - } - - if ($typeString === 'OCI-Lob' || $typeString === 'OCI-Collection') { - return new ObjectType($typeString); - } - - if ($typeString === 'OCI-Collection|false') { - return new UnionType([new ObjectType('OCI-Collection'), new ConstantBooleanType(false)]); - } - - if ($typeString === 'OCI-Lob|false') { - return new UnionType([new ObjectType('OCI-Lob'), new ConstantBooleanType(false)]); - } - - return $this->typeStringResolver->resolve($typeString, new NameScope(null, [], $className)); - } - - /** - * @param array $parameterMap - * @return array - */ - private function getParameters(array $parameterMap): array - { - $parameterSignatures = []; - foreach ($parameterMap as $parameterName => $typeString) { - [$name, $isOptional, $passedByReference, $isVariadic] = $this->getParameterInfoFromName($parameterName); - $parameterSignatures[] = new ParameterSignature( - $name, - $isOptional, - $this->getTypeFromString($typeString, null), - $passedByReference, - $isVariadic - ); - } - - return $parameterSignatures; - } - - /** - * @param string $parameterNameString - * @return mixed[] - */ - private function getParameterInfoFromName(string $parameterNameString): array - { - $matches = \Nette\Utils\Strings::match( - $parameterNameString, - '#^(?P&(?:\.\.\.)?r?w?_?)?(?P\.\.\.)?(?P[^=]+)?(?P=)?($)#' - ); - if ($matches === null || !isset($matches['optional'])) { - throw new \PHPStan\ShouldNotHappenException(); - } - - $isVariadic = $matches['variadic'] !== ''; - - $reference = $matches['reference']; - if (strpos($reference, '&...') === 0) { - $reference = '&' . substr($reference, 4); - $isVariadic = true; - } - if (strpos($reference, '&rw') === 0) { - $passedByReference = PassedByReference::createReadsArgument(); - } elseif (strpos($reference, '&w') === 0) { - $passedByReference = PassedByReference::createCreatesNewVariable(); - } else { - $passedByReference = PassedByReference::createNo(); - } - - $isOptional = $isVariadic || $matches['optional'] !== ''; - - $name = $matches['name'] !== '' ? $matches['name'] : '...'; - - return [$name, $isOptional, $passedByReference, $isVariadic]; - } - -} diff --git a/vendor/phpstan/phpstan/src/Reflection/SignatureMap/SignatureMapProvider.php b/vendor/phpstan/phpstan/src/Reflection/SignatureMap/SignatureMapProvider.php deleted file mode 100644 index de86c09..0000000 --- a/vendor/phpstan/phpstan/src/Reflection/SignatureMap/SignatureMapProvider.php +++ /dev/null @@ -1,82 +0,0 @@ -parser = $parser; - } - - public function hasFunctionSignature(string $name): bool - { - $signatureMap = self::getSignatureMap(); - return array_key_exists($name, $signatureMap); - } - - public function getFunctionSignature(string $functionName, ?string $className): FunctionSignature - { - if (!$this->hasFunctionSignature($functionName)) { - throw new \PHPStan\ShouldNotHappenException(); - } - - $signatureMap = self::getSignatureMap(); - - return $this->parser->getFunctionSignature( - $signatureMap[$functionName], - $className - ); - } - - /** - * @return mixed[] - */ - private static function getSignatureMap(): array - { - if (self::$signatureMap === null) { - $signatureMap = require __DIR__ . '/functionMap.php'; - if (!is_array($signatureMap)) { - throw new \PHPStan\ShouldNotHappenException('Signature map could not be loaded.'); - } - - if (PHP_VERSION_ID >= 70400) { - $php74MapDelta = require __DIR__ . '/functionMap_php74delta.php'; - if (!is_array($php74MapDelta)) { - throw new \PHPStan\ShouldNotHappenException('Signature map could not be loaded.'); - } - - $signatureMap = self::computeSignatureMap($signatureMap, $php74MapDelta); - } - - self::$signatureMap = $signatureMap; - } - - return self::$signatureMap; - } - - /** - * @param array $signatureMap - * @param array> $delta - * @return array - */ - private static function computeSignatureMap(array $signatureMap, array $delta): array - { - foreach (array_keys($delta['old']) as $key) { - unset($signatureMap[strtolower($key)]); - } - foreach ($delta['new'] as $key => $signature) { - $signatureMap[strtolower($key)] = $signature; - } - - return $signatureMap; - } - -} diff --git a/vendor/phpstan/phpstan/src/Reflection/SignatureMap/functionMap.php b/vendor/phpstan/phpstan/src/Reflection/SignatureMap/functionMap.php deleted file mode 100644 index ff72ffa..0000000 --- a/vendor/phpstan/phpstan/src/Reflection/SignatureMap/functionMap.php +++ /dev/null @@ -1,13797 +0,0 @@ -' => [', ''=>''] - * alternative signature for the same function - * '' => [', ''=>''] - * - * A '&' in front of the means the arg is always passed by reference. - * (i.e. ReflectionParameter->isPassedByReference()) - * This was previously only used in cases where the function actually created the - * variable in the local scope. - * Some reference arguments will have prefixes in to indicate the way the argument is used. - * Currently, the only prefixes with meaning are 'rw_' (read-write) and 'w_' (write). - * Those prefixes don't mean anything for non-references. - * Code using these signatures should remove those prefixes from messages rendered to the user. - * 1. '&rw_' indicates that a parameter with a value is expected to be passed in, and may be modified. - * Phan will warn if the variable has an incompatible type, or is undefined. - * 2. '&w_' indicates that a parameter is expected to be passed in, and the value will be ignored, and may be overwritten. - * 3. The absence of a prefix is treated by Phan the same way as having the prefix 'w_' (Some may be changed to 'rw_name'). These will have prefixes added later. - * - * So, for functions like sort() where technically the arg is by-ref, - * indicate the reference param's signature by-ref and read-write, - * as `'&rw_array'=>'array'` - * so that Phan won't create it in the local scope - * - * However, for a function like preg_match() where the 3rd arg is an array of sub-pattern matches (and optional), - * this arg needs to be marked as by-ref and write-only, as `'&w_matches='=>'array'`. - * - * A '=' following the indicates this arg is optional. - * - * The can begin with '...' to indicate the arg is variadic. - * '...args=' indicates it is both variadic and optional. - * - * Some reference arguments will have prefixes in to indicate the way the argument is used. - * Currently, the only prefixes with meaning are 'rw_' and 'w_'. - * Code using these signatures should remove those prefixes from messages rendered to the user. - * 1. '&rw_name' indicates that a parameter with a value is expected to be passed in, and may be modified. - * 2. '&w_name' indicates that a parameter is expected to be passed in, and the value will be ignored, and may be overwritten. - * - * Sources of stub info: - * - * 1. Reflection - * 2. docs.php.net's SVN repo or website, and examples (See internal/internalsignatures.php) - * 3. Various websites documenting individual extensions - * 4. PHPStorm stubs (For anything missing from the above sources) - * See internal/internalsignatures.php - */ - -return [ -'_' => ['string', 'message'=>'string'], -'__halt_compiler' => ['void'], -'abs' => ['int', 'number'=>'int'], -'abs\'1' => ['float', 'number'=>'float'], -'accelerator_get_configuration' => ['array'], -'accelerator_get_scripts' => ['array'], -'accelerator_get_status' => ['array', 'fetch_scripts'=>'bool'], -'accelerator_reset' => [''], -'accelerator_set_status' => ['void', 'status'=>''], -'acos' => ['float', 'number'=>'float'], -'acosh' => ['float', 'number'=>'float'], -'addcslashes' => ['string', 'str'=>'string', 'charlist'=>'string'], -'addslashes' => ['string', 'str'=>'string'], -'AMQPChannel::__construct' => ['void', 'amqp_connection'=>'AMQPConnection'], -'AMQPChannel::basicRecover' => ['', 'requeue='=>'bool|true'], -'AMQPChannel::commitTransaction' => ['bool'], -'AMQPChannel::getChannelId' => ['int'], -'AMQPChannel::getConnection' => ['AMQPConnection'], -'AMQPChannel::getPrefetchCount' => ['int'], -'AMQPChannel::getPrefetchSize' => ['int'], -'AMQPChannel::isConnected' => ['bool'], -'AMQPChannel::qos' => ['bool', 'size'=>'int', 'count'=>'int'], -'AMQPChannel::rollbackTransaction' => ['bool'], -'AMQPChannel::setPrefetchCount' => ['bool', 'count'=>'int'], -'AMQPChannel::setPrefetchSize' => ['bool', 'size'=>'int'], -'AMQPChannel::startTransaction' => ['bool'], -'AMQPConnection::__construct' => ['void', 'credentials='=>'array'], -'AMQPConnection::connect' => ['bool'], -'AMQPConnection::disconnect' => ['bool'], -'AMQPConnection::getHost' => ['string'], -'AMQPConnection::getLogin' => ['string'], -'AMQPConnection::getMaxChannels' => ['int|null'], -'AMQPConnection::getPassword' => ['string'], -'AMQPConnection::getPort' => ['int'], -'AMQPConnection::getReadTimeout' => ['float'], -'AMQPConnection::getTimeout' => ['float'], -'AMQPConnection::getUsedChannels' => ['int'], -'AMQPConnection::getVhost' => ['string'], -'AMQPConnection::getWriteTimeout' => ['float'], -'AMQPConnection::isConnected' => ['bool'], -'AMQPConnection::isPersistent' => ['bool|null'], -'AMQPConnection::pconnect' => ['bool'], -'AMQPConnection::pdisconnect' => ['bool'], -'AMQPConnection::preconnect' => ['bool'], -'AMQPConnection::reconnect' => ['bool'], -'AMQPConnection::setHost' => ['bool', 'host'=>'string'], -'AMQPConnection::setLogin' => ['bool', 'login'=>'string'], -'AMQPConnection::setPassword' => ['bool', 'password'=>'string'], -'AMQPConnection::setPort' => ['bool', 'port'=>'int'], -'AMQPConnection::setReadTimeout' => ['bool', 'timeout'=>'int'], -'AMQPConnection::setTimeout' => ['bool', 'timeout'=>'int'], -'AMQPConnection::setVhost' => ['bool', 'vhost'=>'string'], -'AMQPConnection::setWriteTimeout' => ['bool', 'timeout'=>'int'], -'AMQPEnvelope::getAppId' => ['string'], -'AMQPEnvelope::getBody' => ['string'], -'AMQPEnvelope::getContentEncoding' => ['string'], -'AMQPEnvelope::getContentType' => ['string'], -'AMQPEnvelope::getCorrelationId' => ['string'], -'AMQPEnvelope::getDeliveryMode' => ['int'], -'AMQPEnvelope::getDeliveryTag' => ['string'], -'AMQPEnvelope::getExchangeName' => ['string'], -'AMQPEnvelope::getExpiration' => ['string'], -'AMQPEnvelope::getHeader' => ['bool|string', 'header_key'=>'string'], -'AMQPEnvelope::getHeaders' => ['array'], -'AMQPEnvelope::getMessageId' => ['string'], -'AMQPEnvelope::getPriority' => ['int'], -'AMQPEnvelope::getReplyTo' => ['string'], -'AMQPEnvelope::getRoutingKey' => ['string'], -'AMQPEnvelope::getTimeStamp' => ['string'], -'AMQPEnvelope::getType' => ['string'], -'AMQPEnvelope::getUserId' => ['string'], -'AMQPEnvelope::isRedelivery' => ['bool'], -'AMQPExchange::__construct' => ['void', 'amqp_channel'=>'AMQPChannel'], -'AMQPExchange::bind' => ['bool', 'exchange_name'=>'string', 'routing_key='=>'string', 'arguments='=>'array'], -'AMQPExchange::declareExchange' => ['bool'], -'AMQPExchange::delete' => ['bool', 'exchangeName='=>'string', 'flags='=>'int'], -'AMQPExchange::getArgument' => ['bool|int|string', 'key'=>'string'], -'AMQPExchange::getArguments' => ['array'], -'AMQPExchange::getChannel' => ['AMQPChannel'], -'AMQPExchange::getConnection' => ['AMQPConnection'], -'AMQPExchange::getFlags' => ['int'], -'AMQPExchange::getName' => ['string'], -'AMQPExchange::getType' => ['string'], -'AMQPExchange::publish' => ['bool', 'message'=>'string', 'routing_key='=>'string', 'flags='=>'int', 'attributes='=>'array'], -'AMQPExchange::setArgument' => ['bool', 'key'=>'string', 'value'=>'int|string'], -'AMQPExchange::setArguments' => ['bool', 'arguments'=>'array'], -'AMQPExchange::setFlags' => ['bool', 'flags'=>'int'], -'AMQPExchange::setName' => ['bool', 'exchange_name'=>'string'], -'AMQPExchange::setType' => ['bool', 'exchange_type'=>'string'], -'AMQPExchange::unbind' => ['bool', 'exchange_name'=>'string', 'routing_key='=>'string', 'arguments='=>'array'], -'AMQPQueue::__construct' => ['void', 'amqp_channel'=>'AMQPChannel'], -'AMQPQueue::ack' => ['bool', 'delivery_tag'=>'string', 'flags='=>'int'], -'AMQPQueue::bind' => ['bool', 'exchange_name'=>'string', 'routing_key='=>'string', 'arguments='=>'array'], -'AMQPQueue::cancel' => ['bool', 'consumer_tag='=>'string'], -'AMQPQueue::consume' => ['void', 'callback='=>'?callable', 'flags='=>'int', 'consumerTag='=>'string'], -'AMQPQueue::declareQueue' => ['int'], -'AMQPQueue::delete' => ['int', 'flags='=>'int'], -'AMQPQueue::get' => ['AMQPEnvelope|bool', 'flags='=>'int'], -'AMQPQueue::getArgument' => ['bool|int|string', 'key'=>'string'], -'AMQPQueue::getArguments' => ['array'], -'AMQPQueue::getChannel' => ['AMQPChannel'], -'AMQPQueue::getConnection' => ['AMQPConnection'], -'AMQPQueue::getFlags' => ['int'], -'AMQPQueue::getName' => ['string'], -'AMQPQueue::nack' => ['bool', 'delivery_tag'=>'string', 'flags='=>'int'], -'AMQPQueue::purge' => ['bool'], -'AMQPQueue::reject' => ['bool', 'delivery_tag'=>'string', 'flags='=>'int'], -'AMQPQueue::setArgument' => ['bool', 'key'=>'string', 'value'=>'mixed'], -'AMQPQueue::setArguments' => ['bool', 'arguments'=>'array'], -'AMQPQueue::setFlags' => ['bool', 'flags'=>'int'], -'AMQPQueue::setName' => ['bool', 'queue_name'=>'string'], -'AMQPQueue::unbind' => ['bool', 'exchange_name'=>'string', 'routing_key='=>'string', 'arguments='=>'array'], -'apache_child_terminate' => ['bool'], -'apache_get_modules' => ['array'], -'apache_get_version' => ['string|false'], -'apache_getenv' => ['string|false', 'variable'=>'string', 'walk_to_top='=>'bool'], -'apache_lookup_uri' => ['object', 'filename'=>'string'], -'apache_note' => ['string|false', 'note_name'=>'string', 'note_value='=>'string'], -'apache_request_headers' => ['array|false'], -'apache_reset_timeout' => ['bool'], -'apache_response_headers' => ['array|false'], -'apache_setenv' => ['bool', 'variable'=>'string', 'value'=>'string', 'walk_to_top='=>'bool'], -'apc_add' => ['bool', 'key'=>'string', 'var'=>'mixed', 'ttl='=>'int'], -'apc_add\'1' => ['array', 'values'=>'array', 'unused='=>'', 'ttl='=>'int'], -'apc_bin_dump' => ['string', 'files='=>'array', 'user_vars='=>'array'], -'apc_bin_dumpfile' => ['int', 'files'=>'array', 'user_vars'=>'array', 'filename'=>'string', 'flags='=>'int', 'context='=>'resource'], -'apc_bin_load' => ['bool', 'data'=>'string', 'flags='=>'int'], -'apc_bin_loadfile' => ['bool', 'filename'=>'string', 'context='=>'resource', 'flags='=>'int'], -'apc_cache_info' => ['array', 'cache_type='=>'string', 'limited='=>'bool'], -'apc_cas' => ['bool', 'key'=>'string', 'old'=>'int', 'new'=>'int'], -'apc_clear_cache' => ['bool', 'cache_type='=>'string'], -'apc_compile_file' => ['mixed', 'filename'=>'string', 'atomic='=>'bool'], -'apc_dec' => ['int', 'key'=>'string', 'step='=>'int', '&w_success='=>'bool'], -'apc_define_constants' => ['bool', 'key'=>'string', 'constants'=>'array', 'case_sensitive='=>'bool'], -'apc_delete' => ['bool', 'key'=>'string|string[]|APCIterator'], -'apc_delete_file' => ['mixed', 'keys'=>'mixed'], -'apc_exists' => ['bool', 'keys'=>'string'], -'apc_exists\'1' => ['array', 'keys'=>'string[]'], -'apc_fetch' => ['mixed', 'key'=>'mixed', '&w_success='=>'bool'], -'apc_inc' => ['int', 'key'=>'string', 'step='=>'int', '&w_success='=>'bool'], -'apc_load_constants' => ['bool', 'key'=>'string', 'case_sensitive='=>'bool'], -'apc_sma_info' => ['array', 'limited='=>'bool'], -'apc_store' => ['bool', 'key'=>'string', 'var'=>'', 'ttl='=>'int'], -'apc_store\'1' => ['array', 'values'=>'array', 'unused='=>'', 'ttl='=>'int'], -'APCIterator::__construct' => ['void', 'cache'=>'string', 'search='=>'', 'format='=>'int', 'chunk_size='=>'int', 'list='=>'int'], -'APCIterator::current' => ['mixed'], -'APCIterator::getTotalCount' => ['int'], -'APCIterator::getTotalHits' => ['int'], -'APCIterator::getTotalSize' => ['int'], -'APCIterator::key' => ['string'], -'APCIterator::next' => ['void'], -'APCIterator::rewind' => ['void'], -'APCIterator::valid' => ['bool'], -'apcu_add' => ['bool', 'key'=>'string', 'var'=>'', 'ttl='=>'int'], -'apcu_add\'1' => ['array', 'values'=>'array', 'unused='=>'', 'ttl='=>'int'], -'apcu_cache_info' => ['array', 'limited='=>'bool'], -'apcu_cas' => ['bool', 'key'=>'string', 'old'=>'int', 'new'=>'int'], -'apcu_clear_cache' => ['bool'], -'apcu_dec' => ['int', 'key'=>'string', 'step='=>'int', '&w_success='=>'bool'], -'apcu_delete' => ['bool|array', 'key'=>'string|string[]|APCUIterator'], -'apcu_entry' => ['mixed', 'key'=>'string', 'generator'=>'callable', 'ttl='=>'int'], -'apcu_exists' => ['bool', 'keys'=>'string'], -'apcu_exists\'1' => ['array', 'keys'=>'string[]'], -'apcu_fetch' => ['mixed', 'key'=>'string|string[]', '&w_success='=>'bool'], -'apcu_inc' => ['int', 'key'=>'string', 'step='=>'int', '&w_success='=>'bool'], -'apcu_sma_info' => ['array', 'limited='=>'bool'], -'apcu_store' => ['bool', 'key'=>'string', 'var='=>'', 'ttl='=>'int'], -'apcu_store\'1' => ['array', 'values'=>'array', 'unused='=>'', 'ttl='=>'int'], -'APCUIterator::__construct' => ['void', 'search='=>'string|string[]|null', 'format='=>'int', 'chunk_size='=>'int', 'list='=>'int'], -'APCUIterator::current' => ['mixed'], -'APCUIterator::getTotalCount' => ['int'], -'APCUIterator::getTotalHits' => ['int'], -'APCUIterator::getTotalSize' => ['int'], -'APCUIterator::key' => ['string'], -'APCUIterator::next' => ['void'], -'APCUIterator::rewind' => ['void'], -'APCUIterator::valid' => ['bool'], -'apd_breakpoint' => ['bool', 'debug_level'=>'int'], -'apd_callstack' => ['array'], -'apd_clunk' => ['void', 'warning'=>'string', 'delimiter='=>'string'], -'apd_continue' => ['bool', 'debug_level'=>'int'], -'apd_croak' => ['void', 'warning'=>'string', 'delimiter='=>'string'], -'apd_dump_function_table' => ['void'], -'apd_dump_persistent_resources' => ['array'], -'apd_dump_regular_resources' => ['array'], -'apd_echo' => ['bool', 'output'=>'string'], -'apd_get_active_symbols' => ['array'], -'apd_set_pprof_trace' => ['string', 'dump_directory='=>'string', 'fragment='=>'string'], -'apd_set_session' => ['void', 'debug_level'=>'int'], -'apd_set_session_trace' => ['void', 'debug_level'=>'int', 'dump_directory='=>'string'], -'apd_set_session_trace_socket' => ['bool', 'tcp_server'=>'string', 'socket_type'=>'int', 'port'=>'int', 'debug_level'=>'int'], -'AppendIterator::__construct' => ['void'], -'AppendIterator::append' => ['void', 'it'=>'iterator'], -'AppendIterator::current' => ['mixed'], -'AppendIterator::getArrayIterator' => ['ArrayIterator'], -'AppendIterator::getInnerIterator' => ['iterator'], -'AppendIterator::getIteratorIndex' => ['int'], -'AppendIterator::key' => ['mixed'], -'AppendIterator::next' => ['void'], -'AppendIterator::rewind' => ['void'], -'AppendIterator::valid' => ['bool'], -'array_change_key_case' => ['array', 'input'=>'array', 'case='=>'int'], -'array_chunk' => ['array[]', 'input'=>'array', 'size'=>'int', 'preserve_keys='=>'bool'], -'array_column' => ['array', 'array'=>'array', 'column_key'=>'mixed', 'index_key='=>'mixed'], -'array_combine' => ['array|false', 'keys'=>'array', 'values'=>'array'], -'array_count_values' => ['int[]', 'input'=>'array'], -'array_diff' => ['array', 'arr1'=>'array', 'arr2'=>'array', '...args='=>'array'], -'array_diff_assoc' => ['array', 'arr1'=>'array', 'arr2'=>'array', '...args='=>'array'], -'array_diff_key' => ['array', 'arr1'=>'array', 'arr2'=>'array', '...args='=>'array'], -'array_diff_uassoc' => ['array', 'arr1'=>'array', 'arr2'=>'array', 'data_comp_func'=>'callable(mixed,mixed):int'], -'array_diff_uassoc\'1' => ['array', 'arr1'=>'array', 'arr2'=>'array', 'arr3'=>'array', 'arg4'=>'array|callable(mixed,mixed):int', '...rest='=>'array|callable'], -'array_diff_ukey' => ['array', 'arr1'=>'array', 'arr2'=>'array', 'key_comp_func'=>'callable(mixed,mixed):int'], -'array_diff_ukey\'1' => ['array', 'arr1'=>'array', 'arr2'=>'array', 'arr3'=>'array', 'arg4'=>'array|callable(mixed,mixed):int', '...rest='=>'array|callable(mixed,mixed):int'], -'array_fill' => ['array', 'start_key'=>'int', 'num'=>'int', 'val'=>'mixed'], -'array_fill_keys' => ['array', 'keys'=>'array', 'val'=>'mixed'], -'array_filter' => ['array', 'input'=>'array', 'callback='=>'callable(mixed,mixed):bool|callable(mixed):bool', 'flag='=>'int'], -'array_flip' => ['array', 'input'=>'array'], -'array_intersect' => ['array', 'arr1'=>'array', 'arr2'=>'array', '...args='=>'array'], -'array_intersect_assoc' => ['array', 'arr1'=>'array', 'arr2'=>'array', '...args='=>'array'], -'array_intersect_key' => ['array', 'arr1'=>'array', 'arr2'=>'array', '...args='=>'array'], -'array_intersect_uassoc' => ['array', 'arr1'=>'array', 'arr2'=>'array', 'key_compare_func'=>'callable(mixed,mixed):int'], -'array_intersect_uassoc\'1' => ['array', 'arr1'=>'array', 'arr2'=>'array', 'arr3'=>'array', 'arg4'=>'array|callable(mixed,mixed):int', '...rest'=>'array|callable'], -'array_intersect_ukey' => ['array', 'arr1'=>'array', 'arr2'=>'array', 'key_compare_func'=>'callable(mixed,mixed):int'], -'array_intersect_ukey\'1' => ['array', 'arr1'=>'array', 'arr2'=>'array', 'arr3'=>'array', 'arg4'=>'array|callable(mixed,mixed):int', '...rest'=>'array|callable(mixed,mixed):int'], -'array_key_first' => ['int|string|null', 'array' => 'array'], -'array_key_last' => ['int|string|null', 'array' => 'array'], -'array_key_exists' => ['bool', 'key'=>'string|int', 'search'=>'array'], -'array_keys' => ['array', 'input'=>'array', 'search_value='=>'mixed', 'strict='=>'bool'], -'array_map' => ['array', 'callback'=>'?callable', 'input1'=>'array', '...args='=>'array'], -'array_merge' => ['array', 'arr1'=>'array', '...args='=>'array'], -'array_merge_recursive' => ['array', 'arr1'=>'array', '...args='=>'array'], -'array_multisort' => ['bool', '&rw_array1'=>'array', 'array1_sort_order='=>'array|int', 'array1_sort_flags='=>'array|int', '...args='=>'array|int'], -'array_pad' => ['array', 'input'=>'array', 'pad_size'=>'int', 'pad_value'=>'mixed'], -'array_pop' => ['mixed', '&rw_stack'=>'array'], -'array_product' => ['int|float', 'input'=>'array'], -'array_push' => ['int', '&rw_stack'=>'array', 'var'=>'mixed', '...vars='=>'mixed'], -'array_rand' => ['int|string|array|array', 'input'=>'array', 'num_req'=>'int'], -'array_rand\'1' => ['int|string', 'input'=>'array'], -'array_reduce' => ['mixed', 'input'=>'array', 'callback'=>'callable(mixed,mixed):mixed', 'initial='=>'mixed'], -'array_replace' => ['array|null', 'arr1'=>'array', 'arr2'=>'array', '...args='=>'array'], -'array_replace_recursive' => ['array|null', 'arr1'=>'array', 'arr2'=>'array', '...args='=>'array'], -'array_reverse' => ['array', 'input'=>'array', 'preserve='=>'bool'], -'array_search' => ['int|string|false', 'needle'=>'mixed', 'haystack'=>'array', 'strict='=>'bool'], -'array_shift' => ['mixed', '&rw_stack'=>'array'], -'array_slice' => ['array', 'input'=>'array', 'offset'=>'int', 'length='=>'?int', 'preserve_keys='=>'bool'], -'array_splice' => ['array', '&rw_input'=>'array', 'offset'=>'int', 'length='=>'int', 'replacement='=>'array|string'], -'array_sum' => ['int|float', 'input'=>'array'], -'array_udiff' => ['array', 'arr1'=>'array', 'arr2'=>'array', 'data_comp_func'=>'callable(mixed,mixed):int'], -'array_udiff\'1' => ['array', 'arr1'=>'array', 'arr2'=>'array', 'arr3'=>'array', 'arg4'=>'array|callable(mixed,mixed):int', '...rest='=>'array|callable(mixed,mixed):int'], -'array_udiff_assoc' => ['array', 'arr1'=>'array', 'arr2'=>'array', 'key_comp_func'=>'callable(mixed,mixed):int'], -'array_udiff_assoc\'1' => ['array', 'arr1'=>'array', 'arr2'=>'array', 'arr3'=>'array', 'arg4'=>'array|callable(mixed,mixed):int', '...rest='=>'array|callable(mixed,mixed):int'], -'array_udiff_uassoc' => ['array', 'arr1'=>'array', 'arr2'=>'array', 'data_comp_func'=>'callable', 'key_comp_func'=>'callable(mixed,mixed):int'], -'array_udiff_uassoc\'1' => ['array', 'arr1'=>'array', 'arr2'=>'array', 'arr3'=>'array', 'arg4'=>'array|callable(mixed,mixed):int', 'arg5'=>'array|callable(mixed,mixed):int', '...rest='=>'array|callable(mixed,mixed):int'], -'array_uintersect' => ['array', 'arr1'=>'array', 'arr2'=>'array', 'data_compare_func'=>'callable(mixed,mixed):int'], -'array_uintersect\'1' => ['array', 'arr1'=>'array', 'arr2'=>'array', 'arr3'=>'array', 'arg4'=>'array|callable(mixed,mixed):int', '...rest='=>'array|callable(mixed,mixed):int'], -'array_uintersect_assoc' => ['array', 'arr1'=>'array', 'arr2'=>'array', 'data_compare_func'=>'callable(mixed,mixed):int'], -'array_uintersect_assoc\'1' => ['array', 'arr1'=>'array', 'arr2'=>'array', 'arr3'=>'array', 'arg4'=>'array|callable(mixed,mixed):int', '...rest='=>'array|callable(mixed,mixed):int'], -'array_uintersect_uassoc' => ['array', 'arr1'=>'array', 'arr2'=>'array', 'data_compare_func'=>'callable(mixed,mixed):int', 'key_compare_func'=>'callable(mixed,mixed):int'], -'array_uintersect_uassoc\'1' => ['array', 'arr1'=>'array', 'arr2'=>'array', 'arr3'=>'array', 'arg4'=>'array|callable(mixed,mixed):int', 'arg5'=>'array|callable(mixed,mixed):int', '...rest='=>'array|callable(mixed,mixed):int'], -'array_unique' => ['array', 'input'=>'array', 'sort_flags='=>'int'], -'array_unshift' => ['int', '&rw_stack'=>'array', 'var'=>'mixed', '...vars='=>'mixed'], -'array_values' => ['array', 'input'=>'array'], -'array_walk' => ['bool', '&rw_input'=>'array', 'callback'=>'callable', 'userdata='=>'mixed'], -'array_walk_recursive' => ['bool', '&rw_input'=>'array', 'callback'=>'callable', 'userdata='=>'mixed'], -'ArrayAccess::offsetExists' => ['bool', 'offset'=>'mixed'], -'ArrayAccess::offsetGet' => ['mixed', 'offset'=>'mixed'], -'ArrayAccess::offsetSet' => ['void', 'offset'=>'mixed', 'value'=>'mixed'], -'ArrayAccess::offsetUnset' => ['void', 'offset'=>'mixed'], -'ArrayIterator::__construct' => ['void', 'array='=>'array|object', 'flags='=>'int'], -'ArrayIterator::append' => ['void', 'value'=>'mixed'], -'ArrayIterator::asort' => ['void'], -'ArrayIterator::count' => ['int'], -'ArrayIterator::current' => ['mixed'], -'ArrayIterator::getArrayCopy' => ['array'], -'ArrayIterator::getFlags' => ['void'], -'ArrayIterator::key' => ['int|string|false'], -'ArrayIterator::ksort' => ['void'], -'ArrayIterator::natcasesort' => ['void'], -'ArrayIterator::natsort' => ['void'], -'ArrayIterator::next' => ['void'], -'ArrayIterator::offsetExists' => ['bool', 'index'=>'string|int|bool|null'], -'ArrayIterator::offsetGet' => ['mixed', 'index'=>'string|int|bool|null'], -'ArrayIterator::offsetSet' => ['void', 'index'=>'string|int|bool|null', 'newval'=>'mixed'], -'ArrayIterator::offsetUnset' => ['void', 'index'=>'string|int|bool|null'], -'ArrayIterator::rewind' => ['void'], -'ArrayIterator::seek' => ['void', 'position'=>'int'], -'ArrayIterator::serialize' => ['string'], -'ArrayIterator::setFlags' => ['void', 'flags'=>'string'], -'ArrayIterator::uasort' => ['void', 'cmp_function'=>'callable(mixed,mixed):int'], -'ArrayIterator::uksort' => ['void', 'cmp_function'=>'callable(mixed,mixed):int'], -'ArrayIterator::unserialize' => ['string', 'serialized'=>'string'], -'ArrayIterator::valid' => ['bool'], -'ArrayObject::__construct' => ['void', 'input='=>'array|object', 'flags='=>'int', 'iterator_class='=>'string'], -'ArrayObject::append' => ['void', 'value'=>'mixed'], -'ArrayObject::asort' => ['void'], -'ArrayObject::count' => ['int'], -'ArrayObject::exchangeArray' => ['array', 'ar'=>'mixed'], -'ArrayObject::getArrayCopy' => ['array'], -'ArrayObject::getFlags' => ['int'], -'ArrayObject::getIterator' => ['ArrayIterator'], -'ArrayObject::getIteratorClass' => ['string'], -'ArrayObject::ksort' => ['void'], -'ArrayObject::natcasesort' => ['void'], -'ArrayObject::natsort' => ['void'], -'ArrayObject::offsetExists' => ['bool', 'index'=>'mixed'], -'ArrayObject::offsetGet' => ['mixed', 'index'=>'mixed'], -'ArrayObject::offsetSet' => ['void', 'index'=>'mixed', 'newval'=>'mixed'], -'ArrayObject::offsetUnset' => ['void', 'index'=>'mixed'], -'ArrayObject::serialize' => ['string'], -'ArrayObject::setFlags' => ['void', 'flags'=>'int'], -'ArrayObject::setIteratorClass' => ['void', 'iterator_class'=>'string'], -'ArrayObject::uasort' => ['void', 'cmp_function'=>'callable'], -'ArrayObject::uksort' => ['void', 'cmp_function'=>'callable'], -'ArrayObject::unserialize' => ['void', 'serialized'=>'string'], -'arsort' => ['bool', '&rw_array_arg'=>'array', 'sort_flags='=>'int'], -'asin' => ['float', 'number'=>'float'], -'asinh' => ['float', 'number'=>'float'], -'asort' => ['bool', '&rw_array_arg'=>'array', 'sort_flags='=>'int'], -'assert' => ['bool', 'assertion'=>'string|bool', 'description='=>'string|Throwable|null'], -'assert_options' => ['mixed', 'what'=>'int', 'value='=>'mixed'], -'ast\get_kind_name' => ['string', 'kind'=>'int'], -'ast\get_metadata' => ['array'], -'ast\get_supported_versions' => ['array', 'exclude_deprecated='=>'bool'], -'ast\kind_uses_flags' => ['bool', 'kind'=>'int'], -'ast\Node::__construct' => ['void', 'kind='=>'int', 'flags='=>'int', 'children='=>'ast\Node\Decl[]|ast\Node[]|array[]|int[]|string[]|float[]|bool[]|null[]', 'start_line='=>'int'], -'ast\parse_code' => ['ast\Node', 'code'=>'string', 'version'=>'int', 'filename='=>'string'], -'ast\parse_file' => ['ast\Node', 'filename'=>'string', 'version'=>'int'], -'atan' => ['float', 'number'=>'float'], -'atan2' => ['float', 'y'=>'float', 'x'=>'float'], -'atanh' => ['float', 'number'=>'float'], -'BadFunctionCallException::__clone' => ['void'], -'BadFunctionCallException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'(?Throwable)|(?BadFunctionCallException)'], -'BadFunctionCallException::__toString' => ['string'], -'BadFunctionCallException::getCode' => ['int'], -'BadFunctionCallException::getFile' => ['string'], -'BadFunctionCallException::getLine' => ['int'], -'BadFunctionCallException::getMessage' => ['string'], -'BadFunctionCallException::getPrevious' => ['(?Throwable)|(?BadFunctionCallException)'], -'BadFunctionCallException::getTrace' => ['array'], -'BadFunctionCallException::getTraceAsString' => ['string'], -'BadMethodCallException::__clone' => ['void'], -'BadMethodCallException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'(?Throwable)|(?BadMethodCallException)'], -'BadMethodCallException::__toString' => ['string'], -'BadMethodCallException::getCode' => ['int'], -'BadMethodCallException::getFile' => ['string'], -'BadMethodCallException::getLine' => ['int'], -'BadMethodCallException::getMessage' => ['string'], -'BadMethodCallException::getPrevious' => ['(?Throwable)|(?BadMethodCallException)'], -'BadMethodCallException::getTrace' => ['array'], -'BadMethodCallException::getTraceAsString' => ['string'], -'base64_decode' => ['string|false', 'str'=>'string', 'strict='=>'bool'], -'base64_encode' => ['string', 'str'=>'string'], -'base_convert' => ['string', 'number'=>'string', 'frombase'=>'int', 'tobase'=>'int'], -'basename' => ['string', 'path'=>'string', 'suffix='=>'string'], -'bbcode_add_element' => ['bool', 'bbcode_container'=>'resource', 'tag_name'=>'string', 'tag_rules'=>'array'], -'bbcode_add_smiley' => ['bool', 'bbcode_container'=>'resource', 'smiley'=>'string', 'replace_by'=>'string'], -'bbcode_create' => ['resource', 'bbcode_initial_tags='=>'array'], -'bbcode_destroy' => ['bool', 'bbcode_container'=>'resource'], -'bbcode_parse' => ['string', 'bbcode_container'=>'resource', 'to_parse'=>'string'], -'bbcode_set_arg_parser' => ['bool', 'bbcode_container'=>'resource', 'bbcode_arg_parser'=>'resource'], -'bbcode_set_flags' => ['bool', 'bbcode_container'=>'resource', 'flags'=>'int', 'mode='=>'int'], -'bcadd' => ['string', 'left_operand'=>'string', 'right_operand'=>'string', 'scale='=>'int'], -'bccomp' => ['int', 'left_operand'=>'string', 'right_operand'=>'string', 'scale='=>'int'], -'bcdiv' => ['string', 'left_operand'=>'string', 'right_operand'=>'string', 'scale='=>'int'], -'bcmod' => ['string', 'left_operand'=>'string', 'right_operand'=>'string', 'scale='=>'int'], -'bcmul' => ['string', 'left_operand'=>'string', 'right_operand'=>'string', 'scale='=>'int'], -'bcompiler_load' => ['bool', 'filename'=>'string'], -'bcompiler_load_exe' => ['bool', 'filename'=>'string'], -'bcompiler_parse_class' => ['bool', 'class'=>'string', 'callback'=>'string'], -'bcompiler_read' => ['bool', 'filehandle'=>'resource'], -'bcompiler_write_class' => ['bool', 'filehandle'=>'resource', 'classname'=>'string', 'extends='=>'string'], -'bcompiler_write_constant' => ['bool', 'filehandle'=>'resource', 'constantname'=>'string'], -'bcompiler_write_exe_footer' => ['bool', 'filehandle'=>'resource', 'startpos'=>'int'], -'bcompiler_write_file' => ['bool', 'filehandle'=>'resource', 'filename'=>'string'], -'bcompiler_write_footer' => ['bool', 'filehandle'=>'resource'], -'bcompiler_write_function' => ['bool', 'filehandle'=>'resource', 'functionname'=>'string'], -'bcompiler_write_functions_from_file' => ['bool', 'filehandle'=>'resource', 'filename'=>'string'], -'bcompiler_write_header' => ['bool', 'filehandle'=>'resource', 'write_ver='=>'string'], -'bcompiler_write_included_filename' => ['bool', 'filehandle'=>'resource', 'filename'=>'string'], -'bcpow' => ['string', 'base'=>'string', 'exponent'=>'string', 'scale='=>'int'], -'bcpowmod' => ['string', 'base'=>'string', 'exponent'=>'string', 'modulus'=>'string', 'scale='=>'int'], -'bcscale' => ['int', 'scale='=>'int'], -'bcsqrt' => ['string', 'operand'=>'string', 'scale='=>'int'], -'bcsub' => ['string', 'left_operand'=>'string', 'right_operand'=>'string', 'scale='=>'int'], -'bin2hex' => ['string', 'data'=>'string'], -'bind_textdomain_codeset' => ['string', 'domain'=>'string', 'codeset'=>'string'], -'bindec' => ['int', 'binary_number'=>'string'], -'bindtextdomain' => ['string', 'domain_name'=>'string', 'dir'=>'string'], -'birdstep_autocommit' => ['bool', 'index'=>'int'], -'birdstep_close' => ['bool', 'id'=>'int'], -'birdstep_commit' => ['bool', 'index'=>'int'], -'birdstep_connect' => ['int', 'server'=>'string', 'user'=>'string', 'pass'=>'string'], -'birdstep_exec' => ['int', 'index'=>'int', 'exec_str'=>'string'], -'birdstep_fetch' => ['bool', 'index'=>'int'], -'birdstep_fieldname' => ['string', 'index'=>'int', 'col'=>'int'], -'birdstep_fieldnum' => ['int', 'index'=>'int'], -'birdstep_freeresult' => ['bool', 'index'=>'int'], -'birdstep_off_autocommit' => ['bool', 'index'=>'int'], -'birdstep_result' => ['', 'index'=>'int', 'col'=>''], -'birdstep_rollback' => ['bool', 'index'=>'int'], -'blenc_encrypt' => ['string', 'plaintext'=>'string', 'encodedfile'=>'string', 'encryption_key='=>'string'], -'boolval' => ['bool', 'var'=>'mixed'], -'BSON\Binary::__construct' => ['void', 'data'=>'string', 'subtype'=>'string'], -'BSON\Binary::getSubType' => [''], -'BSON\fromArray' => ['string', 'array'=>'string'], -'BSON\fromJSON' => ['string', 'json'=>'string'], -'BSON\Javascript::__construct' => ['void', 'javascript'=>'string', 'scope='=>'string'], -'BSON\ObjectID::__construct' => ['void', 'id='=>'string'], -'BSON\ObjectID::__toString' => ['string'], -'BSON\Regex::__construct' => ['void', 'pattern'=>'string', 'flags'=>'string'], -'BSON\Regex::__toString' => ['string'], -'BSON\Regex::getFlags' => [''], -'BSON\Regex::getPattern' => [''], -'BSON\Serializable::bsonSerialize' => ['string'], -'BSON\Timestamp::__construct' => ['void', 'increment'=>'string', 'timestamp'=>'string'], -'BSON\Timestamp::__toString' => ['string'], -'BSON\toArray' => ['array', 'bson'=>'string'], -'BSON\toJSON' => ['string', 'bson'=>'string'], -'BSON\Unserializable::bsonUnserialize' => ['', 'data'=>'array'], -'BSON\UTCDatetime::__construct' => ['void', 'milliseconds'=>'string'], -'BSON\UTCDatetime::__toString' => ['string'], -'BSON\UTCDatetime::toDateTime' => [''], -'bson_decode' => ['array', 'bson'=>'string'], -'bson_encode' => ['string', 'anything'=>'mixed'], -'bzclose' => ['bool', 'bz'=>'resource'], -'bzcompress' => ['string', 'source'=>'string', 'blocksize100k='=>'int', 'workfactor='=>'int'], -'bzdecompress' => ['string', 'source'=>'string', 'small='=>'int'], -'bzerrno' => ['int', 'bz'=>'resource'], -'bzerror' => ['array', 'bz'=>'resource'], -'bzerrstr' => ['string', 'bz'=>'resource'], -'bzflush' => ['bool', 'bz'=>'resource'], -'bzopen' => ['resource', 'file'=>'string|resource', 'mode'=>'string'], -'bzread' => ['string', 'bz'=>'resource', 'length='=>'int'], -'bzwrite' => ['int', 'bz'=>'resource', 'data'=>'string', 'length='=>'int'], -'CachingIterator::__construct' => ['void', 'it'=>'iterator', 'flags='=>''], -'CachingIterator::__toString' => ['string'], -'CachingIterator::count' => ['int'], -'CachingIterator::current' => ['mixed'], -'CachingIterator::getCache' => ['array'], -'CachingIterator::getFlags' => ['int'], -'CachingIterator::getInnerIterator' => ['Iterator'], -'CachingIterator::hasNext' => ['bool'], -'CachingIterator::key' => ['mixed'], -'CachingIterator::next' => ['void'], -'CachingIterator::offsetExists' => ['bool', 'index'=>'string'], -'CachingIterator::offsetGet' => ['mixed', 'index'=>'string'], -'CachingIterator::offsetSet' => ['void', 'index'=>'string', 'newval'=>'mixed'], -'CachingIterator::offsetUnset' => ['void', 'index'=>'string'], -'CachingIterator::rewind' => ['void'], -'CachingIterator::setFlags' => ['void', 'flags'=>'int'], -'CachingIterator::valid' => ['bool'], -'Cairo::availableFonts' => ['array'], -'Cairo::availableSurfaces' => ['array'], -'Cairo::statusToString' => ['string', 'status'=>'int'], -'Cairo::version' => ['int'], -'Cairo::versionString' => ['string'], -'cairo_append_path' => ['', 'path'=>'cairopath', 'context'=>'cairocontext'], -'cairo_arc' => ['', 'x'=>'float', 'y'=>'float', 'radius'=>'float', 'angle1'=>'float', 'angle2'=>'float', 'context'=>'cairocontext'], -'cairo_arc_negative' => ['', 'x'=>'float', 'y'=>'float', 'radius'=>'float', 'angle1'=>'float', 'angle2'=>'float', 'context'=>'cairocontext'], -'cairo_available_fonts' => ['array'], -'cairo_available_surfaces' => ['array'], -'cairo_clip' => ['', 'context'=>'cairocontext'], -'cairo_clip_extents' => ['array', 'context'=>'cairocontext'], -'cairo_clip_preserve' => ['', 'context'=>'cairocontext'], -'cairo_clip_rectangle_list' => ['array', 'context'=>'cairocontext'], -'cairo_close_path' => ['', 'context'=>'cairocontext'], -'cairo_copy_page' => ['', 'context'=>'cairocontext'], -'cairo_copy_path' => ['CairoPath', 'context'=>'cairocontext'], -'cairo_copy_path_flat' => ['CairoPath', 'context'=>'cairocontext'], -'cairo_create' => ['CairoContext', 'surface'=>'cairosurface'], -'cairo_curve_to' => ['', 'x1'=>'float', 'y1'=>'float', 'x2'=>'float', 'y2'=>'float', 'x3'=>'float', 'y3'=>'float', 'context'=>'cairocontext'], -'cairo_device_to_user' => ['array', 'x'=>'float', 'y'=>'float', 'context'=>'cairocontext'], -'cairo_device_to_user_distance' => ['array', 'x'=>'float', 'y'=>'float', 'context'=>'cairocontext'], -'cairo_fill' => ['', 'context'=>'cairocontext'], -'cairo_fill_extents' => ['array', 'context'=>'cairocontext'], -'cairo_fill_preserve' => ['', 'context'=>'cairocontext'], -'cairo_font_extents' => ['array', 'context'=>'cairocontext'], -'cairo_font_face_get_type' => ['int', 'fontface'=>'cairofontface'], -'cairo_font_face_status' => ['int', 'fontface'=>'cairofontface'], -'cairo_font_options_create' => ['CairoFontOptions'], -'cairo_font_options_equal' => ['bool', 'options'=>'cairofontoptions', 'other'=>'cairofontoptions'], -'cairo_font_options_get_antialias' => ['int', 'options'=>'cairofontoptions'], -'cairo_font_options_get_hint_metrics' => ['int', 'options'=>'cairofontoptions'], -'cairo_font_options_get_hint_style' => ['int', 'options'=>'cairofontoptions'], -'cairo_font_options_get_subpixel_order' => ['int', 'options'=>'cairofontoptions'], -'cairo_font_options_hash' => ['int', 'options'=>'cairofontoptions'], -'cairo_font_options_merge' => ['void', 'options'=>'cairofontoptions', 'other'=>'cairofontoptions'], -'cairo_font_options_set_antialias' => ['void', 'options'=>'cairofontoptions', 'antialias'=>'int'], -'cairo_font_options_set_hint_metrics' => ['void', 'options'=>'cairofontoptions', 'hint_metrics'=>'int'], -'cairo_font_options_set_hint_style' => ['void', 'options'=>'cairofontoptions', 'hint_style'=>'int'], -'cairo_font_options_set_subpixel_order' => ['void', 'options'=>'cairofontoptions', 'subpixel_order'=>'int'], -'cairo_font_options_status' => ['int', 'options'=>'cairofontoptions'], -'cairo_format_stride_for_width' => ['int', 'format'=>'int', 'width'=>'int'], -'cairo_get_antialias' => ['int', 'context'=>'cairocontext'], -'cairo_get_current_point' => ['array', 'context'=>'cairocontext'], -'cairo_get_dash' => ['array', 'context'=>'cairocontext'], -'cairo_get_dash_count' => ['int', 'context'=>'cairocontext'], -'cairo_get_fill_rule' => ['int', 'context'=>'cairocontext'], -'cairo_get_font_face' => ['', 'context'=>'cairocontext'], -'cairo_get_font_matrix' => ['', 'context'=>'cairocontext'], -'cairo_get_font_options' => ['', 'context'=>'cairocontext'], -'cairo_get_group_target' => ['', 'context'=>'cairocontext'], -'cairo_get_line_cap' => ['int', 'context'=>'cairocontext'], -'cairo_get_line_join' => ['int', 'context'=>'cairocontext'], -'cairo_get_line_width' => ['float', 'context'=>'cairocontext'], -'cairo_get_matrix' => ['', 'context'=>'cairocontext'], -'cairo_get_miter_limit' => ['float', 'context'=>'cairocontext'], -'cairo_get_operator' => ['int', 'context'=>'cairocontext'], -'cairo_get_scaled_font' => ['', 'context'=>'cairocontext'], -'cairo_get_source' => ['', 'context'=>'cairocontext'], -'cairo_get_target' => ['', 'context'=>'cairocontext'], -'cairo_get_tolerance' => ['float', 'context'=>'cairocontext'], -'cairo_glyph_path' => ['', 'glyphs'=>'array', 'context'=>'cairocontext'], -'cairo_has_current_point' => ['bool', 'context'=>'cairocontext'], -'cairo_identity_matrix' => ['', 'context'=>'cairocontext'], -'cairo_image_surface_create' => ['CairoImageSurface', 'format'=>'int', 'width'=>'int', 'height'=>'int'], -'cairo_image_surface_create_for_data' => ['CairoImageSurface', 'data'=>'string', 'format'=>'int', 'width'=>'int', 'height'=>'int', 'stride='=>'int'], -'cairo_image_surface_create_from_png' => ['CairoImageSurface', 'file'=>'string'], -'cairo_image_surface_get_data' => ['string', 'surface'=>'cairoimagesurface'], -'cairo_image_surface_get_format' => ['int', 'surface'=>'cairoimagesurface'], -'cairo_image_surface_get_height' => ['int', 'surface'=>'cairoimagesurface'], -'cairo_image_surface_get_stride' => ['int', 'surface'=>'cairoimagesurface'], -'cairo_image_surface_get_width' => ['int', 'surface'=>'cairoimagesurface'], -'cairo_in_fill' => ['bool', 'x'=>'string', 'y'=>'string', 'context'=>'cairocontext'], -'cairo_in_stroke' => ['bool', 'x'=>'string', 'y'=>'string', 'context'=>'cairocontext'], -'cairo_line_to' => ['', 'x'=>'string', 'y'=>'string', 'context'=>'cairocontext'], -'cairo_mask' => ['', 'pattern'=>'cairopattern', 'context'=>'cairocontext'], -'cairo_mask_surface' => ['', 'surface'=>'cairosurface', 'x='=>'string', 'y='=>'string', 'context='=>'cairocontext'], -'cairo_matrix_create_scale' => ['object', 'sx'=>'float', 'sy'=>'float'], -'cairo_matrix_init' => ['object', 'xx='=>'float', 'yx='=>'float', 'xy='=>'float', 'yy='=>'float', 'x0='=>'float', 'y0='=>'float'], -'cairo_matrix_init_identity' => ['object'], -'cairo_matrix_init_rotate' => ['object', 'radians'=>'float'], -'cairo_matrix_init_scale' => ['object', 'sx'=>'float', 'sy'=>'float'], -'cairo_matrix_init_translate' => ['object', 'tx'=>'float', 'ty'=>'float'], -'cairo_matrix_invert' => ['void', 'matrix'=>'cairomatrix'], -'cairo_matrix_multiply' => ['CairoMatrix', 'matrix1'=>'cairomatrix', 'matrix2'=>'cairomatrix'], -'cairo_matrix_rotate' => ['', 'matrix'=>'cairomatrix', 'radians'=>'float'], -'cairo_matrix_scale' => ['', 'sx'=>'float', 'sy'=>'float', 'context'=>'cairocontext'], -'cairo_matrix_transform_distance' => ['array', 'matrix'=>'cairomatrix', 'dx'=>'float', 'dy'=>'float'], -'cairo_matrix_transform_point' => ['array', 'matrix'=>'cairomatrix', 'dx'=>'float', 'dy'=>'float'], -'cairo_matrix_translate' => ['void', 'matrix'=>'cairomatrix', 'tx'=>'float', 'ty'=>'float'], -'cairo_move_to' => ['', 'x'=>'string', 'y'=>'string', 'context'=>'cairocontext'], -'cairo_new_path' => ['', 'context'=>'cairocontext'], -'cairo_new_sub_path' => ['', 'context'=>'cairocontext'], -'cairo_paint' => ['', 'context'=>'cairocontext'], -'cairo_paint_with_alpha' => ['', 'alpha'=>'string', 'context'=>'cairocontext'], -'cairo_path_extents' => ['array', 'context'=>'cairocontext'], -'cairo_pattern_add_color_stop_rgb' => ['void', 'pattern'=>'cairogradientpattern', 'offset'=>'float', 'red'=>'float', 'green'=>'float', 'blue'=>'float'], -'cairo_pattern_add_color_stop_rgba' => ['void', 'pattern'=>'cairogradientpattern', 'offset'=>'float', 'red'=>'float', 'green'=>'float', 'blue'=>'float', 'alpha'=>'float'], -'cairo_pattern_create_for_surface' => ['CairoPattern', 'surface'=>'cairosurface'], -'cairo_pattern_create_linear' => ['CairoPattern', 'x0'=>'float', 'y0'=>'float', 'x1'=>'float', 'y1'=>'float'], -'cairo_pattern_create_radial' => ['CairoPattern', 'x0'=>'float', 'y0'=>'float', 'r0'=>'float', 'x1'=>'float', 'y1'=>'float', 'r1'=>'float'], -'cairo_pattern_create_rgb' => ['CairoPattern', 'red'=>'float', 'green'=>'float', 'blue'=>'float'], -'cairo_pattern_create_rgba' => ['CairoPattern', 'red'=>'float', 'green'=>'float', 'blue'=>'float', 'alpha'=>'float'], -'cairo_pattern_get_color_stop_count' => ['int', 'pattern'=>'cairogradientpattern'], -'cairo_pattern_get_color_stop_rgba' => ['array', 'pattern'=>'cairogradientpattern', 'index'=>'int'], -'cairo_pattern_get_extend' => ['int', 'pattern'=>'string'], -'cairo_pattern_get_filter' => ['int', 'pattern'=>'cairosurfacepattern'], -'cairo_pattern_get_linear_points' => ['array', 'pattern'=>'cairolineargradient'], -'cairo_pattern_get_matrix' => ['CairoMatrix', 'pattern'=>'cairopattern'], -'cairo_pattern_get_radial_circles' => ['array', 'pattern'=>'cairoradialgradient'], -'cairo_pattern_get_rgba' => ['array', 'pattern'=>'cairosolidpattern'], -'cairo_pattern_get_surface' => ['CairoSurface', 'pattern'=>'cairosurfacepattern'], -'cairo_pattern_get_type' => ['int', 'pattern'=>'cairopattern'], -'cairo_pattern_set_extend' => ['void', 'pattern'=>'string', 'extend'=>'string'], -'cairo_pattern_set_filter' => ['void', 'pattern'=>'cairosurfacepattern', 'filter'=>'int'], -'cairo_pattern_set_matrix' => ['void', 'pattern'=>'cairopattern', 'matrix'=>'cairomatrix'], -'cairo_pattern_status' => ['int', 'pattern'=>'cairopattern'], -'cairo_pdf_surface_create' => ['CairoPdfSurface', 'file'=>'string', 'width'=>'float', 'height'=>'float'], -'cairo_pdf_surface_set_size' => ['void', 'surface'=>'cairopdfsurface', 'width'=>'float', 'height'=>'float'], -'cairo_pop_group' => ['', 'context'=>'cairocontext'], -'cairo_pop_group_to_source' => ['', 'context'=>'cairocontext'], -'cairo_ps_get_levels' => ['array'], -'cairo_ps_level_to_string' => ['string', 'level'=>'int'], -'cairo_ps_surface_create' => ['CairoPsSurface', 'file'=>'string', 'width'=>'float', 'height'=>'float'], -'cairo_ps_surface_dsc_begin_page_setup' => ['void', 'surface'=>'cairopssurface'], -'cairo_ps_surface_dsc_begin_setup' => ['void', 'surface'=>'cairopssurface'], -'cairo_ps_surface_dsc_comment' => ['void', 'surface'=>'cairopssurface', 'comment'=>'string'], -'cairo_ps_surface_get_eps' => ['bool', 'surface'=>'cairopssurface'], -'cairo_ps_surface_restrict_to_level' => ['void', 'surface'=>'cairopssurface', 'level'=>'int'], -'cairo_ps_surface_set_eps' => ['void', 'surface'=>'cairopssurface', 'level'=>'bool'], -'cairo_ps_surface_set_size' => ['void', 'surface'=>'cairopssurface', 'width'=>'float', 'height'=>'float'], -'cairo_push_group' => ['', 'context'=>'cairocontext'], -'cairo_push_group_with_content' => ['', 'content'=>'string', 'context'=>'cairocontext'], -'cairo_rectangle' => ['', 'x'=>'string', 'y'=>'string', 'width'=>'string', 'height'=>'string', 'context'=>'cairocontext'], -'cairo_rel_curve_to' => ['', 'x1'=>'string', 'y1'=>'string', 'x2'=>'string', 'y2'=>'string', 'x3'=>'string', 'y3'=>'string', 'context'=>'cairocontext'], -'cairo_rel_line_to' => ['', 'x'=>'string', 'y'=>'string', 'context'=>'cairocontext'], -'cairo_rel_move_to' => ['', 'x'=>'string', 'y'=>'string', 'context'=>'cairocontext'], -'cairo_reset_clip' => ['', 'context'=>'cairocontext'], -'cairo_restore' => ['', 'context'=>'cairocontext'], -'cairo_rotate' => ['', 'sx'=>'string', 'sy'=>'string', 'context'=>'cairocontext', 'angle'=>'string'], -'cairo_save' => ['', 'context'=>'cairocontext'], -'cairo_scale' => ['', 'x'=>'string', 'y'=>'string', 'context'=>'cairocontext'], -'cairo_scaled_font_create' => ['CairoScaledFont', 'fontface'=>'cairofontface', 'matrix'=>'cairomatrix', 'ctm'=>'cairomatrix', 'fontoptions'=>'cairofontoptions'], -'cairo_scaled_font_extents' => ['array', 'scaledfont'=>'cairoscaledfont'], -'cairo_scaled_font_get_ctm' => ['CairoMatrix', 'scaledfont'=>'cairoscaledfont'], -'cairo_scaled_font_get_font_face' => ['CairoFontFace', 'scaledfont'=>'cairoscaledfont'], -'cairo_scaled_font_get_font_matrix' => ['CairoFontOptions', 'scaledfont'=>'cairoscaledfont'], -'cairo_scaled_font_get_font_options' => ['CairoFontOptions', 'scaledfont'=>'cairoscaledfont'], -'cairo_scaled_font_get_scale_matrix' => ['CairoMatrix', 'scaledfont'=>'cairoscaledfont'], -'cairo_scaled_font_get_type' => ['int', 'scaledfont'=>'cairoscaledfont'], -'cairo_scaled_font_glyph_extents' => ['array', 'scaledfont'=>'cairoscaledfont', 'glyphs'=>'array'], -'cairo_scaled_font_status' => ['int', 'scaledfont'=>'cairoscaledfont'], -'cairo_scaled_font_text_extents' => ['array', 'scaledfont'=>'cairoscaledfont', 'text'=>'string'], -'cairo_select_font_face' => ['', 'family'=>'string', 'slant='=>'string', 'weight='=>'string', 'context='=>'cairocontext'], -'cairo_set_antialias' => ['', 'antialias='=>'string', 'context='=>'cairocontext'], -'cairo_set_dash' => ['', 'dashes'=>'array', 'offset='=>'string', 'context='=>'cairocontext'], -'cairo_set_fill_rule' => ['', 'setting'=>'string', 'context'=>'cairocontext'], -'cairo_set_font_face' => ['', 'fontface'=>'cairofontface', 'context'=>'cairocontext'], -'cairo_set_font_matrix' => ['', 'matrix'=>'cairomatrix', 'context'=>'cairocontext'], -'cairo_set_font_options' => ['', 'fontoptions'=>'cairofontoptions', 'context'=>'cairocontext'], -'cairo_set_font_size' => ['', 'size'=>'string', 'context'=>'cairocontext'], -'cairo_set_line_cap' => ['', 'setting'=>'string', 'context'=>'cairocontext'], -'cairo_set_line_join' => ['', 'setting'=>'string', 'context'=>'cairocontext'], -'cairo_set_line_width' => ['', 'width'=>'string', 'context'=>'cairocontext'], -'cairo_set_matrix' => ['', 'matrix'=>'cairomatrix', 'context'=>'cairocontext'], -'cairo_set_miter_limit' => ['', 'limit'=>'string', 'context'=>'cairocontext'], -'cairo_set_operator' => ['', 'setting'=>'string', 'context'=>'cairocontext'], -'cairo_set_scaled_font' => ['', 'scaledfont'=>'cairoscaledfont', 'context'=>'cairocontext'], -'cairo_set_source' => ['', 'red'=>'string', 'green'=>'string', 'blue'=>'string', 'alpha'=>'string', 'context'=>'cairocontext', 'pattern'=>'cairopattern'], -'cairo_set_source_surface' => ['', 'surface'=>'cairosurface', 'x='=>'string', 'y='=>'string', 'context='=>'cairocontext'], -'cairo_set_tolerance' => ['', 'tolerance'=>'string', 'context'=>'cairocontext'], -'cairo_show_page' => ['', 'context'=>'cairocontext'], -'cairo_show_text' => ['', 'text'=>'string', 'context'=>'cairocontext'], -'cairo_status' => ['int', 'context'=>'cairocontext'], -'cairo_status_to_string' => ['string', 'status'=>'int'], -'cairo_stroke' => ['', 'context'=>'cairocontext'], -'cairo_stroke_extents' => ['array', 'context'=>'cairocontext'], -'cairo_stroke_preserve' => ['', 'context'=>'cairocontext'], -'cairo_surface_copy_page' => ['void', 'surface'=>'cairosurface'], -'cairo_surface_create_similar' => ['CairoSurface', 'surface'=>'cairosurface', 'content'=>'int', 'width'=>'float', 'height'=>'float'], -'cairo_surface_finish' => ['void', 'surface'=>'cairosurface'], -'cairo_surface_flush' => ['void', 'surface'=>'cairosurface'], -'cairo_surface_get_content' => ['int', 'surface'=>'cairosurface'], -'cairo_surface_get_device_offset' => ['array', 'surface'=>'cairosurface'], -'cairo_surface_get_font_options' => ['CairoFontOptions', 'surface'=>'cairosurface'], -'cairo_surface_get_type' => ['int', 'surface'=>'cairosurface'], -'cairo_surface_mark_dirty' => ['void', 'surface'=>'cairosurface'], -'cairo_surface_mark_dirty_rectangle' => ['void', 'surface'=>'cairosurface', 'x'=>'float', 'y'=>'float', 'width'=>'float', 'height'=>'float'], -'cairo_surface_set_device_offset' => ['void', 'surface'=>'cairosurface', 'x'=>'float', 'y'=>'float'], -'cairo_surface_set_fallback_resolution' => ['void', 'surface'=>'cairosurface', 'x'=>'float', 'y'=>'float'], -'cairo_surface_show_page' => ['void', 'surface'=>'cairosurface'], -'cairo_surface_status' => ['int', 'surface'=>'cairosurface'], -'cairo_surface_write_to_png' => ['void', 'surface'=>'cairosurface', 'stream'=>'resource'], -'cairo_svg_get_versions' => ['array'], -'cairo_svg_surface_create' => ['CairoSvgSurface', 'file'=>'string', 'width'=>'float', 'height'=>'float'], -'cairo_svg_surface_get_versions' => ['array'], -'cairo_svg_surface_restrict_to_version' => ['void', 'surface'=>'cairosvgsurface', 'version'=>'int'], -'cairo_svg_version_to_string' => ['string', 'version'=>'int'], -'cairo_text_extents' => ['array', 'text'=>'string', 'context'=>'cairocontext'], -'cairo_text_path' => ['', 'string'=>'string', 'context'=>'cairocontext', 'text'=>'string'], -'cairo_transform' => ['', 'matrix'=>'cairomatrix', 'context'=>'cairocontext'], -'cairo_translate' => ['', 'tx'=>'string', 'ty'=>'string', 'context'=>'cairocontext', 'x'=>'string', 'y'=>'string'], -'cairo_user_to_device' => ['array', 'x'=>'string', 'y'=>'string', 'context'=>'cairocontext'], -'cairo_user_to_device_distance' => ['array', 'x'=>'string', 'y'=>'string', 'context'=>'cairocontext'], -'cairo_version' => ['int'], -'cairo_version_string' => ['string'], -'CairoContext::__construct' => ['void', 'surface'=>'CairoSurface'], -'CairoContext::appendPath' => ['', 'path'=>'cairopath', 'context'=>'cairocontext'], -'CairoContext::arc' => ['', 'x'=>'float', 'y'=>'float', 'radius'=>'float', 'angle1'=>'float', 'angle2'=>'float', 'context'=>'cairocontext'], -'CairoContext::arcNegative' => ['', 'x'=>'float', 'y'=>'float', 'radius'=>'float', 'angle1'=>'float', 'angle2'=>'float', 'context'=>'cairocontext'], -'CairoContext::clip' => ['', 'context'=>'cairocontext'], -'CairoContext::clipExtents' => ['array', 'context'=>'cairocontext'], -'CairoContext::clipPreserve' => ['', 'context'=>'cairocontext'], -'CairoContext::clipRectangleList' => ['array', 'context'=>'cairocontext'], -'CairoContext::closePath' => ['', 'context'=>'cairocontext'], -'CairoContext::copyPage' => ['', 'context'=>'cairocontext'], -'CairoContext::copyPath' => ['CairoPath', 'context'=>'cairocontext'], -'CairoContext::copyPathFlat' => ['CairoPath', 'context'=>'cairocontext'], -'CairoContext::curveTo' => ['', 'x1'=>'float', 'y1'=>'float', 'x2'=>'float', 'y2'=>'float', 'x3'=>'float', 'y3'=>'float', 'context'=>'cairocontext'], -'CairoContext::deviceToUser' => ['array', 'x'=>'float', 'y'=>'float', 'context'=>'cairocontext'], -'CairoContext::deviceToUserDistance' => ['array', 'x'=>'float', 'y'=>'float', 'context'=>'cairocontext'], -'CairoContext::fill' => ['', 'context'=>'cairocontext'], -'CairoContext::fillExtents' => ['array', 'context'=>'cairocontext'], -'CairoContext::fillPreserve' => ['', 'context'=>'cairocontext'], -'CairoContext::fontExtents' => ['array', 'context'=>'cairocontext'], -'CairoContext::getAntialias' => ['int', 'context'=>'cairocontext'], -'CairoContext::getCurrentPoint' => ['array', 'context'=>'cairocontext'], -'CairoContext::getDash' => ['array', 'context'=>'cairocontext'], -'CairoContext::getDashCount' => ['int', 'context'=>'cairocontext'], -'CairoContext::getFillRule' => ['int', 'context'=>'cairocontext'], -'CairoContext::getFontFace' => ['', 'context'=>'cairocontext'], -'CairoContext::getFontMatrix' => ['', 'context'=>'cairocontext'], -'CairoContext::getFontOptions' => ['', 'context'=>'cairocontext'], -'CairoContext::getGroupTarget' => ['', 'context'=>'cairocontext'], -'CairoContext::getLineCap' => ['int', 'context'=>'cairocontext'], -'CairoContext::getLineJoin' => ['int', 'context'=>'cairocontext'], -'CairoContext::getLineWidth' => ['float', 'context'=>'cairocontext'], -'CairoContext::getMatrix' => ['', 'context'=>'cairocontext'], -'CairoContext::getMiterLimit' => ['float', 'context'=>'cairocontext'], -'CairoContext::getOperator' => ['int', 'context'=>'cairocontext'], -'CairoContext::getScaledFont' => ['', 'context'=>'cairocontext'], -'CairoContext::getSource' => ['', 'context'=>'cairocontext'], -'CairoContext::getTarget' => ['', 'context'=>'cairocontext'], -'CairoContext::getTolerance' => ['float', 'context'=>'cairocontext'], -'CairoContext::glyphPath' => ['', 'glyphs'=>'array', 'context'=>'cairocontext'], -'CairoContext::hasCurrentPoint' => ['bool', 'context'=>'cairocontext'], -'CairoContext::identityMatrix' => ['', 'context'=>'cairocontext'], -'CairoContext::inFill' => ['bool', 'x'=>'string', 'y'=>'string', 'context'=>'cairocontext'], -'CairoContext::inStroke' => ['bool', 'x'=>'string', 'y'=>'string', 'context'=>'cairocontext'], -'CairoContext::lineTo' => ['', 'x'=>'string', 'y'=>'string', 'context'=>'cairocontext'], -'CairoContext::mask' => ['', 'pattern'=>'cairopattern', 'context'=>'cairocontext'], -'CairoContext::maskSurface' => ['', 'surface'=>'cairosurface', 'x='=>'string', 'y='=>'string', 'context='=>'cairocontext'], -'CairoContext::moveTo' => ['', 'x'=>'string', 'y'=>'string', 'context'=>'cairocontext'], -'CairoContext::newPath' => ['', 'context'=>'cairocontext'], -'CairoContext::newSubPath' => ['', 'context'=>'cairocontext'], -'CairoContext::paint' => ['', 'context'=>'cairocontext'], -'CairoContext::paintWithAlpha' => ['', 'alpha'=>'string', 'context'=>'cairocontext'], -'CairoContext::pathExtents' => ['array', 'context'=>'cairocontext'], -'CairoContext::popGroup' => ['', 'context'=>'cairocontext'], -'CairoContext::popGroupToSource' => ['', 'context'=>'cairocontext'], -'CairoContext::pushGroup' => ['', 'context'=>'cairocontext'], -'CairoContext::pushGroupWithContent' => ['', 'content'=>'string', 'context'=>'cairocontext'], -'CairoContext::rectangle' => ['', 'x'=>'string', 'y'=>'string', 'width'=>'string', 'height'=>'string', 'context'=>'cairocontext'], -'CairoContext::relCurveTo' => ['', 'x1'=>'string', 'y1'=>'string', 'x2'=>'string', 'y2'=>'string', 'x3'=>'string', 'y3'=>'string', 'context'=>'cairocontext'], -'CairoContext::relLineTo' => ['', 'x'=>'string', 'y'=>'string', 'context'=>'cairocontext'], -'CairoContext::relMoveTo' => ['', 'x'=>'string', 'y'=>'string', 'context'=>'cairocontext'], -'CairoContext::resetClip' => ['', 'context'=>'cairocontext'], -'CairoContext::restore' => ['', 'context'=>'cairocontext'], -'CairoContext::rotate' => ['', 'angle'=>'string', 'context'=>'cairocontext'], -'CairoContext::save' => ['', 'context'=>'cairocontext'], -'CairoContext::scale' => ['', 'x'=>'string', 'y'=>'string', 'context'=>'cairocontext'], -'CairoContext::selectFontFace' => ['', 'family'=>'string', 'slant='=>'string', 'weight='=>'string', 'context='=>'cairocontext'], -'CairoContext::setAntialias' => ['', 'antialias='=>'string', 'context='=>'cairocontext'], -'CairoContext::setDash' => ['', 'dashes'=>'array', 'offset='=>'string', 'context='=>'cairocontext'], -'CairoContext::setFillRule' => ['', 'setting'=>'string', 'context'=>'cairocontext'], -'CairoContext::setFontFace' => ['', 'fontface'=>'cairofontface', 'context'=>'cairocontext'], -'CairoContext::setFontMatrix' => ['', 'matrix'=>'cairomatrix', 'context'=>'cairocontext'], -'CairoContext::setFontOptions' => ['', 'fontoptions'=>'cairofontoptions', 'context'=>'cairocontext'], -'CairoContext::setFontSize' => ['', 'size'=>'string', 'context'=>'cairocontext'], -'CairoContext::setLineCap' => ['', 'setting'=>'string', 'context'=>'cairocontext'], -'CairoContext::setLineJoin' => ['', 'setting'=>'string', 'context'=>'cairocontext'], -'CairoContext::setLineWidth' => ['', 'width'=>'string', 'context'=>'cairocontext'], -'CairoContext::setMatrix' => ['', 'matrix'=>'cairomatrix', 'context'=>'cairocontext'], -'CairoContext::setMiterLimit' => ['', 'limit'=>'string', 'context'=>'cairocontext'], -'CairoContext::setOperator' => ['', 'setting'=>'string', 'context'=>'cairocontext'], -'CairoContext::setScaledFont' => ['', 'scaledfont'=>'cairoscaledfont', 'context'=>'cairocontext'], -'CairoContext::setSource' => ['', 'pattern'=>'cairopattern', 'context'=>'cairocontext'], -'CairoContext::setSourceRGB' => ['', 'red'=>'string', 'green'=>'string', 'blue'=>'string', 'context'=>'cairocontext', 'pattern'=>'cairopattern'], -'CairoContext::setSourceRGBA' => ['', 'red'=>'string', 'green'=>'string', 'blue'=>'string', 'alpha'=>'string', 'context'=>'cairocontext', 'pattern'=>'cairopattern'], -'CairoContext::setSourceSurface' => ['', 'surface'=>'cairosurface', 'x='=>'string', 'y='=>'string', 'context='=>'cairocontext'], -'CairoContext::setTolerance' => ['', 'tolerance'=>'string', 'context'=>'cairocontext'], -'CairoContext::showPage' => ['', 'context'=>'cairocontext'], -'CairoContext::showText' => ['', 'text'=>'string', 'context'=>'cairocontext'], -'CairoContext::status' => ['int', 'context'=>'cairocontext'], -'CairoContext::stroke' => ['', 'context'=>'cairocontext'], -'CairoContext::strokeExtents' => ['array', 'context'=>'cairocontext'], -'CairoContext::strokePreserve' => ['', 'context'=>'cairocontext'], -'CairoContext::textExtents' => ['array', 'text'=>'string', 'context'=>'cairocontext'], -'CairoContext::textPath' => ['', 'string'=>'string', 'context'=>'cairocontext', 'text'=>'string'], -'CairoContext::transform' => ['', 'matrix'=>'cairomatrix', 'context'=>'cairocontext'], -'CairoContext::translate' => ['', 'x'=>'string', 'y'=>'string', 'context'=>'cairocontext'], -'CairoContext::userToDevice' => ['array', 'x'=>'string', 'y'=>'string', 'context'=>'cairocontext'], -'CairoContext::userToDeviceDistance' => ['array', 'x'=>'string', 'y'=>'string', 'context'=>'cairocontext'], -'CairoFontFace::__construct' => ['void'], -'CairoFontFace::getType' => ['int'], -'CairoFontFace::status' => ['int', 'fontface'=>'cairofontface'], -'CairoFontOptions::__construct' => ['void'], -'CairoFontOptions::equal' => ['bool', 'other'=>'string'], -'CairoFontOptions::getAntialias' => ['int', 'context'=>'cairocontext'], -'CairoFontOptions::getHintMetrics' => ['int'], -'CairoFontOptions::getHintStyle' => ['int'], -'CairoFontOptions::getSubpixelOrder' => ['int'], -'CairoFontOptions::hash' => ['int'], -'CairoFontOptions::merge' => ['void', 'other'=>'string'], -'CairoFontOptions::setAntialias' => ['', 'antialias='=>'string', 'context='=>'cairocontext'], -'CairoFontOptions::setHintMetrics' => ['void', 'hint_metrics'=>'string'], -'CairoFontOptions::setHintStyle' => ['void', 'hint_style'=>'string'], -'CairoFontOptions::setSubpixelOrder' => ['void', 'subpixel_order'=>'string'], -'CairoFontOptions::status' => ['int', 'context'=>'cairocontext'], -'CairoFormat::strideForWidth' => ['int', 'format'=>'int', 'width'=>'int'], -'CairoGradientPattern::addColorStopRgb' => ['void', 'offset'=>'string', 'red'=>'string', 'green'=>'string', 'blue'=>'string'], -'CairoGradientPattern::addColorStopRgba' => ['void', 'offset'=>'string', 'red'=>'string', 'green'=>'string', 'blue'=>'string', 'alpha'=>'string'], -'CairoGradientPattern::getColorStopCount' => ['int'], -'CairoGradientPattern::getColorStopRgba' => ['array', 'index'=>'string'], -'CairoGradientPattern::getExtend' => ['int'], -'CairoGradientPattern::setExtend' => ['void', 'extend'=>'int'], -'CairoImageSurface::__construct' => ['void', 'format'=>'int', 'width'=>'int', 'height'=>'int'], -'CairoImageSurface::createForData' => ['void', 'data'=>'string', 'format'=>'int', 'width'=>'int', 'height'=>'int', 'stride='=>'int'], -'CairoImageSurface::createFromPng' => ['CairoImageSurface', 'file'=>'string'], -'CairoImageSurface::getData' => ['string'], -'CairoImageSurface::getFormat' => ['int'], -'CairoImageSurface::getHeight' => ['int'], -'CairoImageSurface::getStride' => ['int'], -'CairoImageSurface::getWidth' => ['int'], -'CairoLinearGradient::__construct' => ['void', 'x0'=>'float', 'y0'=>'float', 'x1'=>'float', 'y1'=>'float'], -'CairoLinearGradient::getPoints' => ['array'], -'CairoMatrix::__construct' => ['void', 'xx='=>'float', 'yx='=>'float', 'xy='=>'float', 'yy='=>'float', 'x0='=>'float', 'y0='=>'float'], -'CairoMatrix::initIdentity' => ['object'], -'CairoMatrix::initRotate' => ['object', 'radians'=>'float'], -'CairoMatrix::initScale' => ['object', 'sx'=>'float', 'sy'=>'float'], -'CairoMatrix::initTranslate' => ['object', 'tx'=>'float', 'ty'=>'float'], -'CairoMatrix::invert' => ['void'], -'CairoMatrix::multiply' => ['CairoMatrix', 'matrix1'=>'cairomatrix', 'matrix2'=>'cairomatrix'], -'CairoMatrix::rotate' => ['', 'sx'=>'string', 'sy'=>'string', 'context'=>'cairocontext', 'angle'=>'string'], -'CairoMatrix::scale' => ['', 'sx'=>'float', 'sy'=>'float', 'context'=>'cairocontext'], -'CairoMatrix::transformDistance' => ['array', 'dx'=>'string', 'dy'=>'string'], -'CairoMatrix::transformPoint' => ['array', 'dx'=>'string', 'dy'=>'string'], -'CairoMatrix::translate' => ['', 'tx'=>'string', 'ty'=>'string', 'context'=>'cairocontext', 'x'=>'string', 'y'=>'string'], -'CairoPattern::__construct' => ['void'], -'CairoPattern::getMatrix' => ['', 'context'=>'cairocontext'], -'CairoPattern::getType' => ['int'], -'CairoPattern::setMatrix' => ['', 'matrix'=>'cairomatrix', 'context'=>'cairocontext'], -'CairoPattern::status' => ['int', 'context'=>'cairocontext'], -'CairoPdfSurface::__construct' => ['void', 'file'=>'string', 'width'=>'float', 'height'=>'float'], -'CairoPdfSurface::setSize' => ['void', 'width'=>'string', 'height'=>'string'], -'CairoPsSurface::__construct' => ['void', 'file'=>'string', 'width'=>'float', 'height'=>'float'], -'CairoPsSurface::dscBeginPageSetup' => ['void'], -'CairoPsSurface::dscBeginSetup' => ['void'], -'CairoPsSurface::dscComment' => ['void', 'comment'=>'string'], -'CairoPsSurface::getEps' => ['bool'], -'CairoPsSurface::getLevels' => ['array'], -'CairoPsSurface::levelToString' => ['string', 'level'=>'int'], -'CairoPsSurface::restrictToLevel' => ['void', 'level'=>'string'], -'CairoPsSurface::setEps' => ['void', 'level'=>'string'], -'CairoPsSurface::setSize' => ['void', 'width'=>'string', 'height'=>'string'], -'CairoRadialGradient::__construct' => ['void', 'x0'=>'float', 'y0'=>'float', 'r0'=>'float', 'x1'=>'float', 'y1'=>'float', 'r1'=>'float'], -'CairoRadialGradient::getCircles' => ['array'], -'CairoScaledFont::__construct' => ['void', 'font_face'=>'CairoFontFace', 'matrix'=>'CairoMatrix', 'ctm'=>'CairoMatrix', 'options'=>'CairoFontOptions'], -'CairoScaledFont::extents' => ['array'], -'CairoScaledFont::getCtm' => ['CairoMatrix'], -'CairoScaledFont::getFontFace' => ['', 'context'=>'cairocontext'], -'CairoScaledFont::getFontMatrix' => ['', 'context'=>'cairocontext'], -'CairoScaledFont::getFontOptions' => ['', 'context'=>'cairocontext'], -'CairoScaledFont::getScaleMatrix' => ['void'], -'CairoScaledFont::getType' => ['int'], -'CairoScaledFont::glyphExtents' => ['array', 'glyphs'=>'string'], -'CairoScaledFont::status' => ['int', 'context'=>'cairocontext'], -'CairoScaledFont::textExtents' => ['array', 'text'=>'string', 'context'=>'cairocontext'], -'CairoSolidPattern::__construct' => ['void', 'red'=>'float', 'green'=>'float', 'blue'=>'float', 'alpha='=>'float'], -'CairoSolidPattern::getRgba' => ['array'], -'CairoSurface::__construct' => ['void'], -'CairoSurface::copyPage' => ['', 'context'=>'cairocontext'], -'CairoSurface::createSimilar' => ['void', 'other'=>'cairosurface', 'content'=>'int', 'width'=>'string', 'height'=>'string'], -'CairoSurface::finish' => ['void'], -'CairoSurface::flush' => ['void'], -'CairoSurface::getContent' => ['int'], -'CairoSurface::getDeviceOffset' => ['array'], -'CairoSurface::getFontOptions' => ['', 'context'=>'cairocontext'], -'CairoSurface::getType' => ['int'], -'CairoSurface::markDirty' => ['void'], -'CairoSurface::markDirtyRectangle' => ['void', 'x'=>'string', 'y'=>'string', 'width'=>'string', 'height'=>'string'], -'CairoSurface::setDeviceOffset' => ['void', 'x'=>'string', 'y'=>'string'], -'CairoSurface::setFallbackResolution' => ['void', 'x'=>'string', 'y'=>'string'], -'CairoSurface::showPage' => ['', 'context'=>'cairocontext'], -'CairoSurface::status' => ['int', 'context'=>'cairocontext'], -'CairoSurface::writeToPng' => ['void', 'file'=>'string'], -'CairoSurfacePattern::__construct' => ['void', 'surface'=>'CairoSurface'], -'CairoSurfacePattern::getExtend' => ['int'], -'CairoSurfacePattern::getFilter' => ['int'], -'CairoSurfacePattern::getSurface' => ['void'], -'CairoSurfacePattern::setExtend' => ['void', 'extend'=>'int'], -'CairoSurfacePattern::setFilter' => ['void', 'filter'=>'string'], -'CairoSvgSurface::__construct' => ['void', 'file'=>'string', 'width'=>'float', 'height'=>'float'], -'CairoSvgSurface::getVersions' => ['array'], -'CairoSvgSurface::restrictToVersion' => ['void', 'version'=>'string'], -'CairoSvgSurface::versionToString' => ['string', 'version'=>'int'], -'cal_days_in_month' => ['int', 'calendar'=>'int', 'month'=>'int', 'year'=>'int'], -'cal_from_jd' => ['array', 'jd'=>'int', 'calendar'=>'int'], -'cal_info' => ['array', 'calendar='=>'int'], -'cal_to_jd' => ['int', 'calendar'=>'int', 'month'=>'int', 'day'=>'int', 'year'=>'int'], -'calcul_hmac' => ['string', 'clent'=>'string', 'siretcode'=>'string', 'price'=>'string', 'reference'=>'string', 'validity'=>'string', 'taxation'=>'string', 'devise'=>'string', 'language'=>'string'], -'calculhmac' => ['string', 'clent'=>'string', 'data'=>'string'], -'call_user_func' => ['mixed', 'function'=>'callable', '...parameters='=>'mixed'], -'call_user_func_array' => ['mixed', 'function'=>'callable', 'parameters'=>'array'], -'call_user_method' => ['mixed', 'method_name'=>'string', 'obj'=>'object', 'parameter='=>'mixed', '...args='=>'mixed'], -'call_user_method_array' => ['mixed', 'method_name'=>'string', 'obj'=>'object', 'params'=>'array'], -'CallbackFilterIterator::__construct' => ['void', 'it'=>'iterator', 'func'=>'callable'], -'CallbackFilterIterator::accept' => ['bool'], -'CallbackFilterIterator::current' => ['mixed'], -'CallbackFilterIterator::getInnerIterator' => ['iterator'], -'CallbackFilterIterator::key' => ['mixed'], -'CallbackFilterIterator::next' => ['void'], -'CallbackFilterIterator::rewind' => ['void'], -'CallbackFilterIterator::valid' => ['bool'], -'ceil' => ['float|int', 'number'=>'float'], -'chdb::__construct' => ['void', 'pathname'=>'string'], -'chdb::get' => ['string', 'key'=>'string'], -'chdb_create' => ['bool', 'pathname'=>'string', 'data'=>'array'], -'chdir' => ['bool', 'directory'=>'string'], -'checkdate' => ['bool', 'month'=>'int', 'day'=>'int', 'year'=>'int'], -'checkdnsrr' => ['bool', 'host'=>'string', 'type='=>'string'], -'chgrp' => ['bool', 'filename'=>'string', 'group'=>'string|int'], -'chmod' => ['bool', 'filename'=>'string', 'mode'=>'int'], -'chop' => ['string', 'str'=>'string', 'character_mask='=>'string'], -'chown' => ['bool', 'filename'=>'string', 'user'=>'string|int'], -'chr' => ['string', 'ascii'=>'int'], -'chroot' => ['bool', 'directory'=>'string'], -'chunk_split' => ['string', 'str'=>'string', 'chunklen='=>'int', 'ending='=>'string'], -'class_alias' => ['bool', 'user_class_name'=>'string', 'alias_name'=>'string', 'autoload='=>'bool'], -'class_exists' => ['bool', 'classname'=>'string', 'autoload='=>'bool'], -'class_implements' => ['array', 'what'=>'object|string', 'autoload='=>'bool'], -'class_parents' => ['array', 'instance'=>'object|string', 'autoload='=>'bool'], -'class_uses' => ['array', 'what'=>'object|string', 'autoload='=>'bool'], -'classkit_import' => ['array', 'filename'=>'string'], -'classkit_method_add' => ['bool', 'classname'=>'string', 'methodname'=>'string', 'args'=>'string', 'code'=>'string', 'flags='=>'int'], -'classkit_method_copy' => ['bool', 'dclass'=>'string', 'dmethod'=>'string', 'sclass'=>'string', 'smethod='=>'string'], -'classkit_method_redefine' => ['bool', 'classname'=>'string', 'methodname'=>'string', 'args'=>'string', 'code'=>'string', 'flags='=>'int'], -'classkit_method_remove' => ['bool', 'classname'=>'string', 'methodname'=>'string'], -'classkit_method_rename' => ['bool', 'classname'=>'string', 'methodname'=>'string', 'newname'=>'string'], -'classObj::__construct' => ['void', 'layer'=>'layerObj', 'class'=>'classObj'], -'classObj::addLabel' => ['int', 'label'=>'labelObj'], -'classObj::convertToString' => ['string'], -'classObj::createLegendIcon' => ['imageObj', 'width'=>'int', 'height'=>'int'], -'classObj::deletestyle' => ['int', 'index'=>'int'], -'classObj::drawLegendIcon' => ['int', 'width'=>'int', 'height'=>'int', 'im'=>'imageObj', 'dstX'=>'int', 'dstY'=>'int'], -'classObj::free' => ['void'], -'classObj::getExpressionString' => ['string'], -'classObj::getLabel' => ['labelObj', 'index'=>'int'], -'classObj::getMetaData' => ['int', 'name'=>'string'], -'classObj::getStyle' => ['styleObj', 'index'=>'int'], -'classObj::getTextString' => ['string'], -'classObj::movestyledown' => ['int', 'index'=>'int'], -'classObj::movestyleup' => ['int', 'index'=>'int'], -'classObj::ms_newClassObj' => ['classObj', 'layer'=>'layerObj', 'class'=>'classObj'], -'classObj::removeLabel' => ['labelObj', 'index'=>'int'], -'classObj::removeMetaData' => ['int', 'name'=>'string'], -'classObj::set' => ['int', 'property_name'=>'string', 'new_value'=>''], -'classObj::setExpression' => ['int', 'expression'=>'string'], -'classObj::setMetaData' => ['int', 'name'=>'string', 'value'=>'string'], -'classObj::settext' => ['int', 'text'=>'string'], -'classObj::updateFromString' => ['int', 'snippet'=>'string'], -'clearstatcache' => ['void', 'clear_realpath_cache='=>'bool', 'filename='=>'string'], -'cli_get_process_title' => ['string'], -'cli_set_process_title' => ['bool', 'arg'=>'string'], -'ClosedGeneratorException::__clone' => ['void'], -'ClosedGeneratorException::__toString' => ['string'], -'ClosedGeneratorException::getCode' => ['int'], -'ClosedGeneratorException::getFile' => ['string'], -'ClosedGeneratorException::getLine' => ['int'], -'ClosedGeneratorException::getMessage' => ['string'], -'ClosedGeneratorException::getPrevious' => ['Throwable|ClosedGeneratorException|null'], -'ClosedGeneratorException::getTrace' => ['array'], -'ClosedGeneratorException::getTraceAsString' => ['string'], -'closedir' => ['void', 'dir_handle='=>'resource'], -'closelog' => ['bool'], -'Closure::__construct' => ['void'], -'Closure::__invoke' => ['', '...args='=>''], -'Closure::bind' => ['Closure', 'old'=>'Closure', 'to'=>'?object', 'scope='=>'object|string'], -'Closure::bindTo' => ['Closure', 'new'=>'?object', 'newscope='=>'object|string'], -'Closure::call' => ['', 'to'=>'object', '...parameters='=>''], -'Closure::fromCallable' => ['Closure', 'callable'=>'callable'], -'clusterObj::convertToString' => ['string'], -'clusterObj::getFilterString' => ['string'], -'clusterObj::getGroupString' => ['string'], -'clusterObj::setFilter' => ['int', 'expression'=>'string'], -'clusterObj::setGroup' => ['int', 'expression'=>'string'], -'Collator::__construct' => ['void', 'locale'=>'string'], -'Collator::asort' => ['bool', '&rw_arr'=>'array', 'sort_flag='=>'int'], -'Collator::compare' => ['int', 'str1'=>'string', 'str2'=>'string'], -'Collator::create' => ['Collator', 'locale'=>'string'], -'Collator::getAttribute' => ['int', 'attr'=>'int'], -'Collator::getErrorCode' => ['int'], -'Collator::getErrorMessage' => ['string'], -'Collator::getLocale' => ['string', 'type'=>'int'], -'Collator::getSortKey' => ['string', 'str'=>'string'], -'Collator::getStrength' => ['int'], -'Collator::setAttribute' => ['bool', 'attr'=>'int', 'val'=>'int'], -'Collator::setStrength' => ['bool', 'strength'=>'int'], -'Collator::sort' => ['bool', '&rw_arr'=>'array', 'sort_flags='=>'int'], -'Collator::sortWithSortKeys' => ['bool', '&rw_arr'=>'array'], -'collator_asort' => ['bool', 'coll'=>'collator', '&rw_arr'=>'array', 'sort_flag='=>'int'], -'collator_compare' => ['int', 'coll'=>'collator', 'str1'=>'string', 'str2'=>'string'], -'collator_create' => ['Collator', 'locale'=>'string'], -'collator_get_attribute' => ['int', 'coll'=>'collator', 'attr'=>'int'], -'collator_get_error_code' => ['int', 'coll'=>'collator'], -'collator_get_error_message' => ['string', 'coll'=>'collator'], -'collator_get_locale' => ['string', 'coll'=>'collator', 'type'=>'int'], -'collator_get_sort_key' => ['string', 'coll'=>'collator', 'str'=>'string'], -'collator_get_strength' => ['int', 'coll'=>'collator'], -'collator_set_attribute' => ['bool', 'coll'=>'collator', 'attr'=>'int', 'val'=>'int'], -'collator_set_strength' => ['bool', 'coll'=>'collator', 'strength'=>'int'], -'collator_sort' => ['bool', 'coll'=>'collator', '&rw_arr'=>'array', 'sort_flag='=>'int'], -'collator_sort_with_sort_keys' => ['bool', 'coll'=>'collator', '&rw_arr'=>'array'], -'Collectable::isGarbage' => ['bool'], -'Collectable::setGarbage' => ['void'], -'colorObj::setHex' => ['int', 'hex'=>'string'], -'colorObj::toHex' => ['string'], -'COM::__call' => ['', 'name'=>'', 'args'=>''], -'COM::__construct' => ['void', 'module_name'=>'string', 'server_name='=>'mixed', 'codepage='=>'int', 'typelib='=>'string'], -'COM::__get' => ['', 'name'=>''], -'COM::__set' => ['', 'name'=>'', 'value'=>''], -'com_addref' => [''], -'com_create_guid' => ['string'], -'com_event_sink' => ['bool', 'comobject'=>'object', 'sinkobject'=>'object', 'sinkinterface='=>'mixed'], -'com_get_active_object' => ['object', 'progid'=>'string', 'code_page='=>'int'], -'com_isenum' => ['bool', 'com_module'=>'variant'], -'com_load_typelib' => ['bool', 'typelib_name'=>'string', 'case_insensitive='=>'int'], -'com_message_pump' => ['bool', 'timeoutms='=>'int'], -'com_print_typeinfo' => ['bool', 'comobject_or_typelib'=>'object', 'dispinterface='=>'string', 'wantsink='=>'bool'], -'com_release' => [''], -'compact' => ['array', '...var_names='=>'string|array'], -'COMPersistHelper::__construct' => ['void', 'com_object'=>'object'], -'COMPersistHelper::GetCurFile' => ['string'], -'COMPersistHelper::GetMaxStreamSize' => ['int'], -'COMPersistHelper::InitNew' => ['int'], -'COMPersistHelper::LoadFromFile' => ['bool', 'filename'=>'string', 'flags'=>'int'], -'COMPersistHelper::LoadFromStream' => ['', 'stream'=>''], -'COMPersistHelper::SaveToFile' => ['bool', 'filename'=>'string', 'remember'=>'bool'], -'COMPersistHelper::SaveToStream' => ['int', 'stream'=>''], -'componere\cast' => ['Type', 'arg1'=>'', 'object'=>''], -'componere\cast_by_ref' => ['Type', 'arg1'=>'', 'object'=>''], -'Cond::broadcast' => ['bool', 'condition'=>'long'], -'Cond::create' => ['long'], -'Cond::destroy' => ['bool', 'condition'=>'long'], -'Cond::signal' => ['bool', 'condition'=>'long'], -'Cond::wait' => ['bool', 'condition'=>'long', 'mutex'=>'long', 'timeout='=>'long'], -'confirm_pdo_ibm_compiled' => [''], -'connection_aborted' => ['int'], -'connection_status' => ['int'], -'connection_timeout' => ['int'], -'constant' => ['mixed', 'const_name'=>'string'], -'convert_cyr_string' => ['string', 'str'=>'string', 'from'=>'string', 'to'=>'string'], -'convert_uudecode' => ['string', 'data'=>'string'], -'convert_uuencode' => ['string', 'data'=>'string'], -'copy' => ['bool', 'source_file'=>'string', 'destination_file'=>'string', 'context='=>'resource'], -'cos' => ['float', 'number'=>'float'], -'cosh' => ['float', 'number'=>'float'], -'Couchbase\AnalyticsQuery::__construct' => ['void'], -'Couchbase\AnalyticsQuery::fromString' => ['Couchbase\AnalyticsQuery', 'statement'=>'string'], -'Couchbase\basicDecoderV1' => ['mixed', 'bytes'=>'string', 'flags'=>'int', 'datatype'=>'int', 'options'=>'array'], -'Couchbase\basicEncoderV1' => ['array', 'value'=>'mixed', 'options'=>'array'], -'Couchbase\BooleanFieldSearchQuery::__construct' => ['void'], -'Couchbase\BooleanFieldSearchQuery::boost' => ['Couchbase\BooleanFieldSearchQuery', 'boost'=>'float'], -'Couchbase\BooleanFieldSearchQuery::field' => ['Couchbase\BooleanFieldSearchQuery', 'field'=>'string'], -'Couchbase\BooleanFieldSearchQuery::jsonSerialize' => ['array'], -'Couchbase\BooleanSearchQuery::__construct' => ['void'], -'Couchbase\BooleanSearchQuery::boost' => ['Couchbase\BooleanSearchQuery', 'boost'=>'float'], -'Couchbase\BooleanSearchQuery::jsonSerialize' => ['array'], -'Couchbase\BooleanSearchQuery::must' => ['Couchbase\BooleanSearchQuery', '...queries='=>'array'], -'Couchbase\BooleanSearchQuery::mustNot' => ['Couchbase\BooleanSearchQuery', '...queries='=>'array'], -'Couchbase\BooleanSearchQuery::should' => ['Couchbase\BooleanSearchQuery', '...queries='=>'array'], -'Couchbase\Bucket::__construct' => ['void'], -'Couchbase\Bucket::__get' => ['int', 'name'=>'string'], -'Couchbase\Bucket::__set' => ['int', 'name'=>'string', 'value'=>'int'], -'Couchbase\Bucket::append' => ['Couchbase\Document|array', 'ids'=>'array|string', 'value'=>'mixed', 'options='=>'array'], -'Couchbase\Bucket::counter' => ['Couchbase\Document|array', 'ids'=>'array|string', 'delta='=>'int', 'options='=>'array'], -'Couchbase\Bucket::diag' => ['array', 'reportId='=>'string'], -'Couchbase\Bucket::get' => ['Couchbase\Document|array', 'ids'=>'array|string', 'options='=>'array'], -'Couchbase\Bucket::getAndLock' => ['Couchbase\Document|array', 'ids'=>'array|string', 'lockTime'=>'int', 'options='=>'array'], -'Couchbase\Bucket::getAndTouch' => ['Couchbase\Document|array', 'ids'=>'array|string', 'expiry'=>'int', 'options='=>'array'], -'Couchbase\Bucket::getFromReplica' => ['Couchbase\Document|array', 'ids'=>'array|string', 'options='=>'array'], -'Couchbase\Bucket::insert' => ['Couchbase\Document|array', 'ids'=>'array|string', 'value'=>'mixed', 'options='=>'array'], -'Couchbase\Bucket::listExists' => ['bool', 'id'=>'string', 'value'=>'mixed'], -'Couchbase\Bucket::listGet' => ['mixed', 'id'=>'string', 'index'=>'int'], -'Couchbase\Bucket::listPush' => ['', 'id'=>'string', 'value'=>'mixed'], -'Couchbase\Bucket::listRemove' => ['', 'id'=>'string', 'index'=>'int'], -'Couchbase\Bucket::listSet' => ['', 'id'=>'string', 'index'=>'int', 'value'=>'mixed'], -'Couchbase\Bucket::listShift' => ['', 'id'=>'string', 'value'=>'mixed'], -'Couchbase\Bucket::listSize' => ['int', 'id'=>'string'], -'Couchbase\Bucket::lookupIn' => ['Couchbase\LookupInBuilder', 'id'=>'string'], -'Couchbase\Bucket::manager' => ['Couchbase\BucketManager'], -'Couchbase\Bucket::mapAdd' => ['', 'id'=>'string', 'key'=>'string', 'value'=>'mixed'], -'Couchbase\Bucket::mapGet' => ['mixed', 'id'=>'string', 'key'=>'string'], -'Couchbase\Bucket::mapRemove' => ['', 'id'=>'string', 'key'=>'string'], -'Couchbase\Bucket::mapSize' => ['int', 'id'=>'string'], -'Couchbase\Bucket::mutateIn' => ['Couchbase\MutateInBuilder', 'id'=>'string', 'cas'=>'string'], -'Couchbase\Bucket::ping' => ['array', 'services='=>'int', 'reportId='=>'string'], -'Couchbase\Bucket::prepend' => ['Couchbase\Document|array', 'ids'=>'array|string', 'value'=>'mixed', 'options='=>'array'], -'Couchbase\Bucket::query' => ['object', 'query'=>'Couchbase\AnalyticsQuery|Couchbase\N1qlQuery|Couchbase\SearchQuery|Couchbase\SpatialViewQuery|Couchbase\ViewQuery', 'jsonAsArray='=>'bool|false'], -'Couchbase\Bucket::queueAdd' => ['', 'id'=>'string', 'value'=>'mixed'], -'Couchbase\Bucket::queueExists' => ['bool', 'id'=>'string', 'value'=>'mixed'], -'Couchbase\Bucket::queueRemove' => ['mixed', 'id'=>'string'], -'Couchbase\Bucket::queueSize' => ['int', 'id'=>'string'], -'Couchbase\Bucket::remove' => ['Couchbase\Document|array', 'ids'=>'array|string', 'options='=>'array'], -'Couchbase\Bucket::replace' => ['Couchbase\Document|array', 'ids'=>'array|string', 'value'=>'mixed', 'options='=>'array'], -'Couchbase\Bucket::retrieveIn' => ['Couchbase\DocumentFragment', 'id'=>'string', '...paths='=>'array'], -'Couchbase\Bucket::setAdd' => ['', 'id'=>'string', 'value'=>'bool|float|int|string'], -'Couchbase\Bucket::setExists' => ['bool', 'id'=>'string', 'value'=>'bool|float|int|string'], -'Couchbase\Bucket::setRemove' => ['', 'id'=>'string', 'value'=>'bool|float|int|string'], -'Couchbase\Bucket::setSize' => ['int', 'id'=>'string'], -'Couchbase\Bucket::setTranscoder' => ['', 'encoder'=>'callable', 'decoder'=>'callable'], -'Couchbase\Bucket::touch' => ['Couchbase\Document|array', 'ids'=>'array|string', 'expiry'=>'int', 'options='=>'array'], -'Couchbase\Bucket::unlock' => ['Couchbase\Document|array', 'ids'=>'array|string', 'options='=>'array'], -'Couchbase\Bucket::upsert' => ['Couchbase\Document|array', 'ids'=>'array|string', 'value'=>'mixed', 'options='=>'array'], -'Couchbase\BucketManager::__construct' => ['void'], -'Couchbase\BucketManager::createN1qlIndex' => ['', 'name'=>'string', 'fields'=>'array', 'whereClause='=>'string', 'ignoreIfExist='=>'bool|false', 'defer='=>'bool|false'], -'Couchbase\BucketManager::createN1qlPrimaryIndex' => ['', 'customName='=>'string', 'ignoreIfExist='=>'bool|false', 'defer='=>'bool|false'], -'Couchbase\BucketManager::dropN1qlIndex' => ['', 'name'=>'string', 'ignoreIfNotExist='=>'bool|false'], -'Couchbase\BucketManager::dropN1qlPrimaryIndex' => ['', 'customName='=>'string', 'ignoreIfNotExist='=>'bool|false'], -'Couchbase\BucketManager::flush' => [''], -'Couchbase\BucketManager::getDesignDocument' => ['array', 'name'=>'string'], -'Couchbase\BucketManager::info' => ['array'], -'Couchbase\BucketManager::insertDesignDocument' => ['', 'name'=>'string', 'document'=>'array'], -'Couchbase\BucketManager::listDesignDocuments' => ['array'], -'Couchbase\BucketManager::listN1qlIndexes' => ['array'], -'Couchbase\BucketManager::removeDesignDocument' => ['', 'name'=>'string'], -'Couchbase\BucketManager::upsertDesignDocument' => ['', 'name'=>'string', 'document'=>'array'], -'Couchbase\ClassicAuthenticator::bucket' => ['', 'name'=>'string', 'password'=>'string'], -'Couchbase\ClassicAuthenticator::cluster' => ['', 'username'=>'string', 'password'=>'string'], -'Couchbase\Cluster::__construct' => ['void', 'connstr'=>'string'], -'Couchbase\Cluster::authenticate' => ['null', 'authenticator'=>'Couchbase\Authenticator'], -'Couchbase\Cluster::authenticateAs' => ['null', 'username'=>'string', 'password'=>'string'], -'Couchbase\Cluster::manager' => ['Couchbase\ClusterManager', 'username='=>'string', 'password='=>'string'], -'Couchbase\Cluster::openBucket' => ['Couchbase\Bucket', 'name='=>'string', 'password='=>'string'], -'Couchbase\ClusterManager::__construct' => ['void'], -'Couchbase\ClusterManager::createBucket' => ['', 'name'=>'string', 'options='=>'array'], -'Couchbase\ClusterManager::getUser' => ['array', 'username'=>'string', 'domain='=>'int'], -'Couchbase\ClusterManager::info' => ['array'], -'Couchbase\ClusterManager::listBuckets' => ['array'], -'Couchbase\ClusterManager::listUsers' => ['array', 'domain='=>'int'], -'Couchbase\ClusterManager::removeBucket' => ['', 'name'=>'string'], -'Couchbase\ClusterManager::removeUser' => ['', 'name'=>'string', 'domain='=>'int'], -'Couchbase\ClusterManager::upsertUser' => ['', 'name'=>'string', 'settings'=>'Couchbase\UserSettings', 'domain='=>'int'], -'Couchbase\ConjunctionSearchQuery::__construct' => ['void'], -'Couchbase\ConjunctionSearchQuery::boost' => ['Couchbase\ConjunctionSearchQuery', 'boost'=>'float'], -'Couchbase\ConjunctionSearchQuery::every' => ['Couchbase\ConjunctionSearchQuery', '...queries='=>'array'], -'Couchbase\ConjunctionSearchQuery::jsonSerialize' => ['array'], -'Couchbase\DateRangeSearchFacet::__construct' => ['void'], -'Couchbase\DateRangeSearchFacet::addRange' => ['Couchbase\DateSearchFacet', 'name'=>'string', 'start'=>'int|string', 'end'=>'int|string'], -'Couchbase\DateRangeSearchFacet::jsonSerialize' => ['array'], -'Couchbase\DateRangeSearchQuery::__construct' => ['void'], -'Couchbase\DateRangeSearchQuery::boost' => ['Couchbase\DateRangeSearchQuery', 'boost'=>'float'], -'Couchbase\DateRangeSearchQuery::dateTimeParser' => ['Couchbase\DateRangeSearchQuery', 'dateTimeParser'=>'string'], -'Couchbase\DateRangeSearchQuery::end' => ['Couchbase\DateRangeSearchQuery', 'end'=>'int|string', 'inclusive='=>'bool|false'], -'Couchbase\DateRangeSearchQuery::field' => ['Couchbase\DateRangeSearchQuery', 'field'=>'string'], -'Couchbase\DateRangeSearchQuery::jsonSerialize' => ['array'], -'Couchbase\DateRangeSearchQuery::start' => ['Couchbase\DateRangeSearchQuery', 'start'=>'int|string', 'inclusive='=>'bool|true'], -'Couchbase\defaultDecoder' => ['mixed', 'bytes'=>'string', 'flags'=>'int', 'datatype'=>'int'], -'Couchbase\defaultEncoder' => ['array', 'value'=>'mixed'], -'Couchbase\DisjunctionSearchQuery::__construct' => ['void'], -'Couchbase\DisjunctionSearchQuery::boost' => ['Couchbase\DisjunctionSearchQuery', 'boost'=>'float'], -'Couchbase\DisjunctionSearchQuery::either' => ['Couchbase\DisjunctionSearchQuery', '...queries='=>'array'], -'Couchbase\DisjunctionSearchQuery::jsonSerialize' => ['array'], -'Couchbase\DisjunctionSearchQuery::min' => ['Couchbase\DisjunctionSearchQuery', 'min'=>'int'], -'Couchbase\DocIdSearchQuery::__construct' => ['void'], -'Couchbase\DocIdSearchQuery::boost' => ['Couchbase\DocIdSearchQuery', 'boost'=>'float'], -'Couchbase\DocIdSearchQuery::docIds' => ['Couchbase\DocIdSearchQuery', '...documentIds='=>'array'], -'Couchbase\DocIdSearchQuery::field' => ['Couchbase\DocIdSearchQuery', 'field'=>'string'], -'Couchbase\DocIdSearchQuery::jsonSerialize' => ['array'], -'Couchbase\fastlzCompress' => ['string', 'data'=>'string'], -'Couchbase\fastlzDecompress' => ['string', 'data'=>'string'], -'Couchbase\GeoBoundingBoxSearchQuery::__construct' => ['void'], -'Couchbase\GeoBoundingBoxSearchQuery::boost' => ['Couchbase\GeoBoundingBoxSearchQuery', 'boost'=>'float'], -'Couchbase\GeoBoundingBoxSearchQuery::field' => ['Couchbase\GeoBoundingBoxSearchQuery', 'field'=>'string'], -'Couchbase\GeoBoundingBoxSearchQuery::jsonSerialize' => ['array'], -'Couchbase\GeoDistanceSearchQuery::__construct' => ['void'], -'Couchbase\GeoDistanceSearchQuery::boost' => ['Couchbase\GeoDistanceSearchQuery', 'boost'=>'float'], -'Couchbase\GeoDistanceSearchQuery::field' => ['Couchbase\GeoDistanceSearchQuery', 'field'=>'string'], -'Couchbase\GeoDistanceSearchQuery::jsonSerialize' => ['array'], -'Couchbase\LookupInBuilder::__construct' => ['void'], -'Couchbase\LookupInBuilder::execute' => ['Couchbase\DocumentFragment'], -'Couchbase\LookupInBuilder::exists' => ['Couchbase\LookupInBuilder', 'path'=>'string', 'options='=>'array'], -'Couchbase\LookupInBuilder::get' => ['Couchbase\LookupInBuilder', 'path'=>'string', 'options='=>'array'], -'Couchbase\LookupInBuilder::getCount' => ['Couchbase\LookupInBuilder', 'path'=>'string', 'options='=>'array'], -'Couchbase\MatchAllSearchQuery::__construct' => ['void'], -'Couchbase\MatchAllSearchQuery::boost' => ['Couchbase\MatchAllSearchQuery', 'boost'=>'float'], -'Couchbase\MatchAllSearchQuery::jsonSerialize' => ['array'], -'Couchbase\MatchNoneSearchQuery::__construct' => ['void'], -'Couchbase\MatchNoneSearchQuery::boost' => ['Couchbase\MatchNoneSearchQuery', 'boost'=>'float'], -'Couchbase\MatchNoneSearchQuery::jsonSerialize' => ['array'], -'Couchbase\MatchPhraseSearchQuery::__construct' => ['void'], -'Couchbase\MatchPhraseSearchQuery::analyzer' => ['Couchbase\MatchPhraseSearchQuery', 'analyzer'=>'string'], -'Couchbase\MatchPhraseSearchQuery::boost' => ['Couchbase\MatchPhraseSearchQuery', 'boost'=>'float'], -'Couchbase\MatchPhraseSearchQuery::field' => ['Couchbase\MatchPhraseSearchQuery', 'field'=>'string'], -'Couchbase\MatchPhraseSearchQuery::jsonSerialize' => ['array'], -'Couchbase\MatchSearchQuery::__construct' => ['void'], -'Couchbase\MatchSearchQuery::analyzer' => ['Couchbase\MatchSearchQuery', 'analyzer'=>'string'], -'Couchbase\MatchSearchQuery::boost' => ['Couchbase\MatchSearchQuery', 'boost'=>'float'], -'Couchbase\MatchSearchQuery::field' => ['Couchbase\MatchSearchQuery', 'field'=>'string'], -'Couchbase\MatchSearchQuery::fuzziness' => ['Couchbase\MatchSearchQuery', 'fuzziness'=>'int'], -'Couchbase\MatchSearchQuery::jsonSerialize' => ['array'], -'Couchbase\MatchSearchQuery::prefixLength' => ['Couchbase\MatchSearchQuery', 'prefixLength'=>'int'], -'Couchbase\MutateInBuilder::__construct' => ['void'], -'Couchbase\MutateInBuilder::arrayAddUnique' => ['Couchbase\MutateInBuilder', 'path'=>'string', 'value'=>'mixed', 'options='=>'array|bool'], -'Couchbase\MutateInBuilder::arrayAppend' => ['Couchbase\MutateInBuilder', 'path'=>'string', 'value'=>'mixed', 'options='=>'array|bool'], -'Couchbase\MutateInBuilder::arrayAppendAll' => ['Couchbase\MutateInBuilder', 'path'=>'string', 'values'=>'array', 'options='=>'array|bool'], -'Couchbase\MutateInBuilder::arrayInsert' => ['Couchbase\MutateInBuilder', 'path'=>'string', 'value'=>'mixed', 'options='=>'array'], -'Couchbase\MutateInBuilder::arrayInsertAll' => ['Couchbase\MutateInBuilder', 'path'=>'string', 'values'=>'array', 'options='=>'array'], -'Couchbase\MutateInBuilder::arrayPrepend' => ['Couchbase\MutateInBuilder', 'path'=>'string', 'value'=>'mixed', 'options='=>'array|bool'], -'Couchbase\MutateInBuilder::arrayPrependAll' => ['Couchbase\MutateInBuilder', 'path'=>'string', 'values'=>'array', 'options='=>'array|bool'], -'Couchbase\MutateInBuilder::counter' => ['Couchbase\MutateInBuilder', 'path'=>'string', 'delta'=>'int', 'options='=>'array|bool'], -'Couchbase\MutateInBuilder::execute' => ['Couchbase\DocumentFragment'], -'Couchbase\MutateInBuilder::insert' => ['Couchbase\MutateInBuilder', 'path'=>'string', 'value'=>'mixed', 'options='=>'array|bool'], -'Couchbase\MutateInBuilder::modeDocument' => ['', 'mode'=>'int'], -'Couchbase\MutateInBuilder::remove' => ['Couchbase\MutateInBuilder', 'path'=>'string', 'options='=>'array'], -'Couchbase\MutateInBuilder::replace' => ['Couchbase\MutateInBuilder', 'path'=>'string', 'value'=>'mixed', 'options='=>'array'], -'Couchbase\MutateInBuilder::upsert' => ['Couchbase\MutateInBuilder', 'path'=>'string', 'value'=>'mixed', 'options='=>'array|bool'], -'Couchbase\MutateInBuilder::withExpiry' => ['Couchbase\MutateInBuilder', 'expiry'=>'Couchbase\expiry'], -'Couchbase\MutationState::__construct' => ['void'], -'Couchbase\MutationState::add' => ['', 'source'=>'Couchbase\Document|Couchbase\DocumentFragment|array'], -'Couchbase\MutationState::from' => ['Couchbase\MutationState', 'source'=>'Couchbase\Document|Couchbase\DocumentFragment|array'], -'Couchbase\MutationToken::__construct' => ['void'], -'Couchbase\MutationToken::bucketName' => ['string'], -'Couchbase\MutationToken::from' => ['', 'bucketName'=>'string', 'vbucketId'=>'int', 'vbucketUuid'=>'string', 'sequenceNumber'=>'string'], -'Couchbase\MutationToken::sequenceNumber' => ['string'], -'Couchbase\MutationToken::vbucketId' => ['int'], -'Couchbase\MutationToken::vbucketUuid' => ['string'], -'Couchbase\N1qlIndex::__construct' => ['void'], -'Couchbase\N1qlQuery::__construct' => ['void'], -'Couchbase\N1qlQuery::adhoc' => ['Couchbase\N1qlQuery', 'adhoc'=>'bool'], -'Couchbase\N1qlQuery::consistency' => ['Couchbase\N1qlQuery', 'consistency'=>'int'], -'Couchbase\N1qlQuery::consistentWith' => ['Couchbase\N1qlQuery', 'state'=>'Couchbase\MutationState'], -'Couchbase\N1qlQuery::crossBucket' => ['Couchbase\N1qlQuery', 'crossBucket'=>'bool'], -'Couchbase\N1qlQuery::fromString' => ['Couchbase\N1qlQuery', 'statement'=>'string'], -'Couchbase\N1qlQuery::maxParallelism' => ['Couchbase\N1qlQuery', 'maxParallelism'=>'int'], -'Couchbase\N1qlQuery::namedParams' => ['Couchbase\N1qlQuery', 'params'=>'array'], -'Couchbase\N1qlQuery::pipelineBatch' => ['Couchbase\N1qlQuery', 'pipelineBatch'=>'int'], -'Couchbase\N1qlQuery::pipelineCap' => ['Couchbase\N1qlQuery', 'pipelineCap'=>'int'], -'Couchbase\N1qlQuery::positionalParams' => ['Couchbase\N1qlQuery', 'params'=>'array'], -'Couchbase\N1qlQuery::readonly' => ['Couchbase\N1qlQuery', 'readonly'=>'bool'], -'Couchbase\N1qlQuery::scanCap' => ['Couchbase\N1qlQuery', 'scanCap'=>'int'], -'Couchbase\NumericRangeSearchFacet::__construct' => ['void'], -'Couchbase\NumericRangeSearchFacet::addRange' => ['Couchbase\NumericSearchFacet', 'name'=>'string', 'min'=>'float', 'max'=>'float'], -'Couchbase\NumericRangeSearchFacet::jsonSerialize' => ['array'], -'Couchbase\NumericRangeSearchQuery::__construct' => ['void'], -'Couchbase\NumericRangeSearchQuery::boost' => ['Couchbase\NumericRangeSearchQuery', 'boost'=>'float'], -'Couchbase\NumericRangeSearchQuery::field' => ['Couchbase\NumericRangeSearchQuery', 'field'=>'string'], -'Couchbase\NumericRangeSearchQuery::jsonSerialize' => ['array'], -'Couchbase\NumericRangeSearchQuery::max' => ['Couchbase\NumericRangeSearchQuery', 'max'=>'float', 'inclusive='=>'bool|false'], -'Couchbase\NumericRangeSearchQuery::min' => ['Couchbase\NumericRangeSearchQuery', 'min'=>'float', 'inclusive='=>'bool|true'], -'Couchbase\passthruDecoder' => ['string', 'bytes'=>'string', 'flags'=>'int', 'datatype'=>'int'], -'Couchbase\passthruEncoder' => ['array', 'value'=>'string'], -'Couchbase\PasswordAuthenticator::password' => ['Couchbase\PasswordAuthenticator', 'password'=>'string'], -'Couchbase\PasswordAuthenticator::username' => ['Couchbase\PasswordAuthenticator', 'username'=>'string'], -'Couchbase\PhraseSearchQuery::__construct' => ['void'], -'Couchbase\PhraseSearchQuery::boost' => ['Couchbase\PhraseSearchQuery', 'boost'=>'float'], -'Couchbase\PhraseSearchQuery::field' => ['Couchbase\PhraseSearchQuery', 'field'=>'string'], -'Couchbase\PhraseSearchQuery::jsonSerialize' => ['array'], -'Couchbase\PrefixSearchQuery::__construct' => ['void'], -'Couchbase\PrefixSearchQuery::boost' => ['Couchbase\PrefixSearchQuery', 'boost'=>'float'], -'Couchbase\PrefixSearchQuery::field' => ['Couchbase\PrefixSearchQuery', 'field'=>'string'], -'Couchbase\PrefixSearchQuery::jsonSerialize' => ['array'], -'Couchbase\QueryStringSearchQuery::__construct' => ['void'], -'Couchbase\QueryStringSearchQuery::boost' => ['Couchbase\QueryStringSearchQuery', 'boost'=>'float'], -'Couchbase\QueryStringSearchQuery::jsonSerialize' => ['array'], -'Couchbase\RegexpSearchQuery::__construct' => ['void'], -'Couchbase\RegexpSearchQuery::boost' => ['Couchbase\RegexpSearchQuery', 'boost'=>'float'], -'Couchbase\RegexpSearchQuery::field' => ['Couchbase\RegexpSearchQuery', 'field'=>'string'], -'Couchbase\RegexpSearchQuery::jsonSerialize' => ['array'], -'Couchbase\SearchQuery::__construct' => ['void', 'indexName'=>'string', 'queryPart'=>'Couchbase\SearchQueryPart'], -'Couchbase\SearchQuery::addFacet' => ['Couchbase\SearchQuery', 'name'=>'string', 'facet'=>'Couchbase\SearchFacet'], -'Couchbase\SearchQuery::boolean' => ['Couchbase\BooleanSearchQuery'], -'Couchbase\SearchQuery::booleanField' => ['Couchbase\BooleanFieldSearchQuery', 'value'=>'bool'], -'Couchbase\SearchQuery::conjuncts' => ['Couchbase\ConjunctionSearchQuery', '...queries='=>'array'], -'Couchbase\SearchQuery::consistentWith' => ['Couchbase\SearchQuery', 'state'=>'Couchbase\MutationState'], -'Couchbase\SearchQuery::dateRange' => ['Couchbase\DateRangeSearchQuery'], -'Couchbase\SearchQuery::dateRangeFacet' => ['Couchbase\DateRangeSearchFacet', 'field'=>'string', 'limit'=>'int'], -'Couchbase\SearchQuery::disjuncts' => ['Couchbase\DisjunctionSearchQuery', '...queries='=>'array'], -'Couchbase\SearchQuery::docId' => ['Couchbase\DocIdSearchQuery', '...documentIds='=>'array'], -'Couchbase\SearchQuery::explain' => ['Couchbase\SearchQuery', 'explain'=>'bool'], -'Couchbase\SearchQuery::fields' => ['Couchbase\SearchQuery', '...fields='=>'array'], -'Couchbase\SearchQuery::geoBoundingBox' => ['Couchbase\GeoBoundingBoxSearchQuery', 'topLeftLongitude'=>'float', 'topLeftLatitude'=>'float', 'bottomRightLongitude'=>'float', 'bottomRightLatitude'=>'float'], -'Couchbase\SearchQuery::geoDistance' => ['Couchbase\GeoDistanceSearchQuery', 'longitude'=>'float', 'latitude'=>'float', 'distance'=>'string'], -'Couchbase\SearchQuery::highlight' => ['Couchbase\SearchQuery', 'style'=>'string', '...fields='=>'array'], -'Couchbase\SearchQuery::jsonSerialize' => ['array'], -'Couchbase\SearchQuery::limit' => ['Couchbase\SearchQuery', 'limit'=>'int'], -'Couchbase\SearchQuery::match' => ['Couchbase\MatchSearchQuery', 'match'=>'string'], -'Couchbase\SearchQuery::matchAll' => ['Couchbase\MatchAllSearchQuery'], -'Couchbase\SearchQuery::matchNone' => ['Couchbase\MatchNoneSearchQuery'], -'Couchbase\SearchQuery::matchPhrase' => ['Couchbase\MatchPhraseSearchQuery', '...terms='=>'array'], -'Couchbase\SearchQuery::numericRange' => ['Couchbase\NumericRangeSearchQuery'], -'Couchbase\SearchQuery::numericRangeFacet' => ['Couchbase\NumericRangeSearchFacet', 'field'=>'string', 'limit'=>'int'], -'Couchbase\SearchQuery::prefix' => ['Couchbase\PrefixSearchQuery', 'prefix'=>'string'], -'Couchbase\SearchQuery::queryString' => ['Couchbase\QueryStringSearchQuery', 'queryString'=>'string'], -'Couchbase\SearchQuery::regexp' => ['Couchbase\RegexpSearchQuery', 'regexp'=>'string'], -'Couchbase\SearchQuery::serverSideTimeout' => ['Couchbase\SearchQuery', 'serverSideTimeout'=>'int'], -'Couchbase\SearchQuery::skip' => ['Couchbase\SearchQuery', 'skip'=>'int'], -'Couchbase\SearchQuery::sort' => ['Couchbase\SearchQuery', '...sort='=>'array'], -'Couchbase\SearchQuery::term' => ['Couchbase\TermSearchQuery', 'term'=>'string'], -'Couchbase\SearchQuery::termFacet' => ['Couchbase\TermSearchFacet', 'field'=>'string', 'limit'=>'int'], -'Couchbase\SearchQuery::termRange' => ['Couchbase\TermRangeSearchQuery'], -'Couchbase\SearchQuery::wildcard' => ['Couchbase\WildcardSearchQuery', 'wildcard'=>'string'], -'Couchbase\SpatialViewQuery::__construct' => ['void'], -'Couchbase\SpatialViewQuery::bbox' => ['Couchbase\SpatialViewQuery', 'bbox'=>'array'], -'Couchbase\SpatialViewQuery::consistency' => ['Couchbase\SpatialViewQuery', 'consistency'=>'int'], -'Couchbase\SpatialViewQuery::custom' => ['', 'customParameters'=>'array'], -'Couchbase\SpatialViewQuery::encode' => ['array'], -'Couchbase\SpatialViewQuery::endRange' => ['Couchbase\SpatialViewQuery', 'range'=>'array'], -'Couchbase\SpatialViewQuery::limit' => ['Couchbase\SpatialViewQuery', 'limit'=>'int'], -'Couchbase\SpatialViewQuery::order' => ['Couchbase\SpatialViewQuery', 'order'=>'int'], -'Couchbase\SpatialViewQuery::skip' => ['Couchbase\SpatialViewQuery', 'skip'=>'int'], -'Couchbase\SpatialViewQuery::startRange' => ['Couchbase\SpatialViewQuery', 'range'=>'array'], -'Couchbase\TermRangeSearchQuery::__construct' => ['void'], -'Couchbase\TermRangeSearchQuery::boost' => ['Couchbase\TermRangeSearchQuery', 'boost'=>'float'], -'Couchbase\TermRangeSearchQuery::field' => ['Couchbase\TermRangeSearchQuery', 'field'=>'string'], -'Couchbase\TermRangeSearchQuery::jsonSerialize' => ['array'], -'Couchbase\TermRangeSearchQuery::max' => ['Couchbase\TermRangeSearchQuery', 'max'=>'string', 'inclusive='=>'bool|false'], -'Couchbase\TermRangeSearchQuery::min' => ['Couchbase\TermRangeSearchQuery', 'min'=>'string', 'inclusive='=>'bool|true'], -'Couchbase\TermSearchFacet::__construct' => ['void'], -'Couchbase\TermSearchFacet::jsonSerialize' => ['array'], -'Couchbase\TermSearchQuery::__construct' => ['void'], -'Couchbase\TermSearchQuery::boost' => ['Couchbase\TermSearchQuery', 'boost'=>'float'], -'Couchbase\TermSearchQuery::field' => ['Couchbase\TermSearchQuery', 'field'=>'string'], -'Couchbase\TermSearchQuery::fuzziness' => ['Couchbase\TermSearchQuery', 'fuzziness'=>'int'], -'Couchbase\TermSearchQuery::jsonSerialize' => ['array'], -'Couchbase\TermSearchQuery::prefixLength' => ['Couchbase\TermSearchQuery', 'prefixLength'=>'int'], -'Couchbase\UserSettings::fullName' => ['Couchbase\UserSettings', 'fullName'=>'string'], -'Couchbase\UserSettings::password' => ['Couchbase\UserSettings', 'password'=>'string'], -'Couchbase\UserSettings::role' => ['Couchbase\UserSettings', 'role'=>'string', 'bucket='=>'string'], -'Couchbase\ViewQuery::__construct' => ['void'], -'Couchbase\ViewQuery::consistency' => ['Couchbase\ViewQuery', 'consistency'=>'int'], -'Couchbase\ViewQuery::custom' => ['Couchbase\ViewQuery', 'customParameters'=>'array'], -'Couchbase\ViewQuery::encode' => ['array'], -'Couchbase\ViewQuery::from' => ['Couchbase\ViewQuery', 'designDocumentName'=>'string', 'viewName'=>'string'], -'Couchbase\ViewQuery::fromSpatial' => ['Couchbase\SpatialViewQuery', 'designDocumentName'=>'string', 'viewName'=>'string'], -'Couchbase\ViewQuery::group' => ['Couchbase\ViewQuery', 'group'=>'bool'], -'Couchbase\ViewQuery::groupLevel' => ['Couchbase\ViewQuery', 'groupLevel'=>'int'], -'Couchbase\ViewQuery::idRange' => ['Couchbase\ViewQuery', 'startKeyDocumentId'=>'string', 'endKeyDocumentId'=>'string'], -'Couchbase\ViewQuery::key' => ['Couchbase\ViewQuery', 'key'=>'mixed'], -'Couchbase\ViewQuery::keys' => ['Couchbase\ViewQuery', 'keys'=>'array'], -'Couchbase\ViewQuery::limit' => ['Couchbase\ViewQuery', 'limit'=>'int'], -'Couchbase\ViewQuery::order' => ['Couchbase\ViewQuery', 'order'=>'int'], -'Couchbase\ViewQuery::range' => ['Couchbase\ViewQuery', 'startKey'=>'mixed', 'endKey'=>'mixed', 'inclusiveEnd='=>'bool|false'], -'Couchbase\ViewQuery::reduce' => ['Couchbase\ViewQuery', 'reduce'=>'bool'], -'Couchbase\ViewQuery::skip' => ['Couchbase\ViewQuery', 'skip'=>'int'], -'Couchbase\ViewQueryEncodable::encode' => ['array'], -'Couchbase\WildcardSearchQuery::__construct' => ['void'], -'Couchbase\WildcardSearchQuery::boost' => ['Couchbase\WildcardSearchQuery', 'boost'=>'float'], -'Couchbase\WildcardSearchQuery::field' => ['Couchbase\WildcardSearchQuery', 'field'=>'string'], -'Couchbase\WildcardSearchQuery::jsonSerialize' => ['array'], -'Couchbase\zlibCompress' => ['string', 'data'=>'string'], -'Couchbase\zlibDecompress' => ['string', 'data'=>'string'], -'count' => ['int', 'var'=>'Countable|array', 'mode='=>'int'], -'count_chars' => ['mixed', 'input'=>'string', 'mode='=>'int'], -'Countable::count' => ['int'], -'crack_check' => ['bool', 'dictionary'=>'', 'password'=>'string'], -'crack_closedict' => ['bool', 'dictionary='=>'resource'], -'crack_getlastmessage' => ['string'], -'crack_opendict' => ['resource', 'dictionary'=>'string'], -'crash' => [''], -'crc32' => ['int', 'str'=>'string'], -'create_function' => ['string', 'args'=>'string', 'code'=>'string'], -'crypt' => ['string', 'str'=>'string', 'salt='=>'string'], -'ctype_alnum' => ['bool', 'c'=>'string|int'], -'ctype_alpha' => ['bool', 'c'=>'string|int'], -'ctype_cntrl' => ['bool', 'c'=>'string|int'], -'ctype_digit' => ['bool', 'c'=>'string|int'], -'ctype_graph' => ['bool', 'c'=>'string|int'], -'ctype_lower' => ['bool', 'c'=>'string|int'], -'ctype_print' => ['bool', 'c'=>'string|int'], -'ctype_punct' => ['bool', 'c'=>'string|int'], -'ctype_space' => ['bool', 'c'=>'string|int'], -'ctype_upper' => ['bool', 'c'=>'string|int'], -'ctype_xdigit' => ['bool', 'c'=>'string|int'], -'cubrid_affected_rows' => ['int', 'req_identifier='=>''], -'cubrid_bind' => ['bool', 'req_identifier'=>'resource', 'bind_param'=>'int', 'bind_value'=>'mixed', 'bind_value_type='=>'string'], -'cubrid_client_encoding' => ['string', 'conn_identifier='=>''], -'cubrid_close' => ['bool', 'conn_identifier='=>''], -'cubrid_close_prepare' => ['int', 'req_identifier'=>'resource'], -'cubrid_close_request' => ['bool', 'req_identifier'=>'resource'], -'cubrid_col_get' => ['array', 'conn_identifier'=>'resource', 'oid'=>'string', 'attr_name'=>'string'], -'cubrid_col_size' => ['int', 'conn_identifier'=>'resource', 'oid'=>'string', 'attr_name'=>'string'], -'cubrid_column_names' => ['array', 'req_identifier'=>'resource'], -'cubrid_column_types' => ['array', 'req_identifier'=>'resource'], -'cubrid_commit' => ['bool', 'conn_identifier'=>'resource'], -'cubrid_connect' => ['resource', 'host'=>'string', 'port'=>'int', 'dbname'=>'string', 'userid='=>'string', 'passwd='=>'string'], -'cubrid_connect_with_url' => ['resource', 'conn_url'=>'string', 'userid='=>'string', 'passwd='=>'string'], -'cubrid_current_oid' => ['string', 'req_identifier'=>'resource'], -'cubrid_data_seek' => ['bool', 'req_identifier'=>'', 'row_number'=>'int'], -'cubrid_db_name' => ['string', 'result'=>'array', 'index'=>'int'], -'cubrid_db_parameter' => ['array', 'conn_identifier'=>'resource'], -'cubrid_disconnect' => ['bool', 'conn_identifier'=>'resource'], -'cubrid_drop' => ['bool', 'conn_identifier'=>'resource', 'oid'=>'string'], -'cubrid_errno' => ['int', 'conn_identifier='=>''], -'cubrid_error' => ['string', 'connection='=>''], -'cubrid_error_code' => ['int'], -'cubrid_error_code_facility' => ['int'], -'cubrid_error_msg' => ['string'], -'cubrid_execute' => ['bool', 'conn_identifier'=>'', 'sql'=>'string', 'option='=>'int', 'request_identifier='=>''], -'cubrid_fetch' => ['mixed', 'result'=>'resource', 'type='=>'int'], -'cubrid_fetch_array' => ['array', 'result'=>'', 'type='=>'int'], -'cubrid_fetch_assoc' => ['array', 'result'=>''], -'cubrid_fetch_field' => ['object', 'result'=>'', 'field_offset='=>'int'], -'cubrid_fetch_lengths' => ['array', 'result'=>''], -'cubrid_fetch_object' => ['object', 'result'=>'', 'class_name='=>'string', 'params='=>'array'], -'cubrid_fetch_row' => ['array', 'result'=>''], -'cubrid_field_flags' => ['string', 'result'=>'', 'field_offset'=>'int'], -'cubrid_field_len' => ['int', 'result'=>'', 'field_offset'=>'int'], -'cubrid_field_name' => ['string', 'result'=>'', 'field_offset'=>'int'], -'cubrid_field_seek' => ['bool', 'result'=>'', 'field_offset='=>'int'], -'cubrid_field_table' => ['string', 'result'=>'', 'field_offset'=>'int'], -'cubrid_field_type' => ['string', 'result'=>'', 'field_offset'=>'int'], -'cubrid_free_result' => ['bool', 'req_identifier'=>'resource'], -'cubrid_get' => ['mixed', 'conn_identifier'=>'resource', 'oid'=>'string', 'attr='=>'mixed'], -'cubrid_get_autocommit' => ['bool', 'conn_identifier'=>'resource'], -'cubrid_get_charset' => ['string', 'conn_identifier'=>'resource'], -'cubrid_get_class_name' => ['string', 'conn_identifier'=>'resource', 'oid'=>'string'], -'cubrid_get_client_info' => ['string'], -'cubrid_get_db_parameter' => ['array', 'conn_identifier'=>'resource'], -'cubrid_get_query_timeout' => ['int', 'req_identifier'=>'resource'], -'cubrid_get_server_info' => ['string', 'conn_identifier'=>'resource'], -'cubrid_insert_id' => ['string', 'conn_identifier='=>'resource'], -'cubrid_is_instance' => ['int', 'conn_identifier'=>'resource', 'oid'=>'string'], -'cubrid_list_dbs' => ['array', 'conn_identifier'=>''], -'cubrid_load_from_glo' => ['int', 'conn_identifier'=>'', 'oid'=>'string', 'file_name'=>'string'], -'cubrid_lob2_bind' => ['bool', 'req_identifier'=>'resource', 'bind_index'=>'int', 'bind_value'=>'mixed', 'bind_value_type='=>'string'], -'cubrid_lob2_close' => ['bool', 'lob_identifier'=>'resource'], -'cubrid_lob2_export' => ['bool', 'lob_identifier'=>'resource', 'file_name'=>'string'], -'cubrid_lob2_import' => ['bool', 'lob_identifier'=>'resource', 'file_name'=>'string'], -'cubrid_lob2_new' => ['resource', 'conn_identifier='=>'resource', 'type='=>'string'], -'cubrid_lob2_read' => ['string', 'lob_identifier'=>'resource', 'len'=>'int'], -'cubrid_lob2_seek' => ['bool', 'lob_identifier'=>'resource', 'offset'=>'int', 'origin='=>'int'], -'cubrid_lob2_seek64' => ['bool', 'lob_identifier'=>'resource', 'offset'=>'string', 'origin='=>'int'], -'cubrid_lob2_size' => ['int', 'lob_identifier'=>'resource'], -'cubrid_lob2_size64' => ['string', 'lob_identifier'=>'resource'], -'cubrid_lob2_tell' => ['int', 'lob_identifier'=>'resource'], -'cubrid_lob2_tell64' => ['string', 'lob_identifier'=>'resource'], -'cubrid_lob2_write' => ['bool', 'lob_identifier'=>'resource', 'buf'=>'string'], -'cubrid_lob_close' => ['bool', 'lob_identifier_array'=>'array'], -'cubrid_lob_export' => ['bool', 'conn_identifier'=>'resource', 'lob_identifier'=>'resource', 'path_name'=>'string'], -'cubrid_lob_get' => ['array', 'conn_identifier'=>'resource', 'sql'=>'string'], -'cubrid_lob_send' => ['bool', 'conn_identifier'=>'resource', 'lob_identifier'=>'resource'], -'cubrid_lob_size' => ['string', 'lob_identifier'=>'resource'], -'cubrid_lock_read' => ['bool', 'conn_identifier'=>'resource', 'oid'=>'string'], -'cubrid_lock_write' => ['bool', 'conn_identifier'=>'resource', 'oid'=>'string'], -'cubrid_move_cursor' => ['int', 'req_identifier'=>'resource', 'offset'=>'int', 'origin='=>'int'], -'cubrid_new_glo' => ['string', 'conn_identifier'=>'', 'class_name'=>'string', 'file_name'=>'string'], -'cubrid_next_result' => ['bool', 'result'=>'resource'], -'cubrid_num_cols' => ['int', 'req_identifier'=>'resource'], -'cubrid_num_fields' => ['int', 'result'=>''], -'cubrid_num_rows' => ['int', 'req_identifier'=>'resource'], -'cubrid_pconnect' => ['resource', 'host'=>'string', 'port'=>'int', 'dbname'=>'string', 'userid='=>'string', 'passwd='=>'string'], -'cubrid_pconnect_with_url' => ['resource', 'conn_url'=>'string', 'userid='=>'string', 'passwd='=>'string'], -'cubrid_ping' => ['bool', 'conn_identifier='=>''], -'cubrid_prepare' => ['resource', 'conn_identifier'=>'resource', 'prepare_stmt'=>'string', 'option='=>'int'], -'cubrid_put' => ['int', 'conn_identifier'=>'resource', 'oid'=>'string', 'attr='=>'string', 'value='=>'mixed'], -'cubrid_query' => ['resource', 'query'=>'string', 'conn_identifier='=>''], -'cubrid_real_escape_string' => ['string', 'unescaped_string'=>'string', 'conn_identifier='=>''], -'cubrid_result' => ['string', 'result'=>'', 'row'=>'int', 'field='=>''], -'cubrid_rollback' => ['bool', 'conn_identifier'=>'resource'], -'cubrid_save_to_glo' => ['int', 'conn_identifier'=>'', 'oid'=>'string', 'file_name'=>'string'], -'cubrid_schema' => ['array', 'conn_identifier'=>'resource', 'schema_type'=>'int', 'class_name='=>'string', 'attr_name='=>'string'], -'cubrid_send_glo' => ['int', 'conn_identifier'=>'', 'oid'=>'string'], -'cubrid_seq_drop' => ['bool', 'conn_identifier'=>'resource', 'oid'=>'string', 'attr_name'=>'string', 'index'=>'int'], -'cubrid_seq_insert' => ['bool', 'conn_identifier'=>'resource', 'oid'=>'string', 'attr_name'=>'string', 'index'=>'int', 'seq_element'=>'string'], -'cubrid_seq_put' => ['bool', 'conn_identifier'=>'resource', 'oid'=>'string', 'attr_name'=>'string', 'index'=>'int', 'seq_element'=>'string'], -'cubrid_set_add' => ['bool', 'conn_identifier'=>'resource', 'oid'=>'string', 'attr_name'=>'string', 'set_element'=>'string'], -'cubrid_set_autocommit' => ['bool', 'conn_identifier'=>'resource', 'mode'=>'bool'], -'cubrid_set_db_parameter' => ['bool', 'conn_identifier'=>'resource', 'param_type'=>'int', 'param_value'=>'int'], -'cubrid_set_drop' => ['bool', 'conn_identifier'=>'resource', 'oid'=>'string', 'attr_name'=>'string', 'set_element'=>'string'], -'cubrid_set_query_timeout' => ['bool', 'req_identifier'=>'resource', 'timeout'=>'int'], -'cubrid_unbuffered_query' => ['resource', 'query'=>'string', 'conn_identifier='=>''], -'cubrid_version' => ['string'], -'curl_close' => ['void', 'ch'=>'resource'], -'curl_copy_handle' => ['resource', 'ch'=>'resource'], -'curl_errno' => ['int', 'ch'=>'resource'], -'curl_error' => ['string', 'ch'=>'resource'], -'curl_escape' => ['string', 'ch'=>'resource', 'str'=>'string'], -'curl_exec' => ['bool|string', 'ch'=>'resource'], -'curl_file_create' => ['CURLFile', 'filename'=>'string', 'mimetype='=>'string', 'postfilename='=>'string'], -'curl_getinfo' => ['mixed', 'ch'=>'resource', 'option='=>'int'], -'curl_init' => ['resource|false', 'url='=>'string'], -'curl_multi_add_handle' => ['int', 'mh'=>'resource', 'ch'=>'resource'], -'curl_multi_close' => ['void', 'mh'=>'resource'], -'curl_multi_errno' => ['int', 'mh'=>'resource'], -'curl_multi_exec' => ['int', 'mh'=>'resource', '&w_still_running'=>'int'], -'curl_multi_getcontent' => ['string', 'ch'=>'resource'], -'curl_multi_info_read' => ['array|false', 'mh'=>'resource', '&w_msgs_in_queue='=>'int'], -'curl_multi_init' => ['resource|false'], -'curl_multi_remove_handle' => ['int', 'mh'=>'resource', 'ch'=>'resource'], -'curl_multi_select' => ['int', 'mh'=>'resource', 'timeout='=>'float'], -'curl_multi_setopt' => ['bool', 'mh'=>'resource', 'option'=>'int', 'value'=>'mixed'], -'curl_multi_strerror' => ['string', 'code'=>'int'], -'curl_pause' => ['int', 'ch'=>'resource', 'bitmask'=>'int'], -'curl_reset' => ['void', 'ch'=>'resource'], -'curl_setopt' => ['bool', 'ch'=>'resource', 'option'=>'int', 'value'=>'mixed'], -'curl_setopt_array' => ['bool', 'ch'=>'resource', 'options'=>'array'], -'curl_share_close' => ['void', 'sh'=>'resource'], -'curl_share_errno' => ['int', 'sh'=>'resource'], -'curl_share_init' => ['resource'], -'curl_share_setopt' => ['bool', 'sh'=>'resource', 'option'=>'int', 'value'=>'string'], -'curl_share_strerror' => ['string', 'code'=>'int'], -'curl_strerror' => ['string', 'code'=>'int'], -'curl_unescape' => ['string', 'ch'=>'resource', 'str'=>'string'], -'curl_version' => ['array', 'version='=>'int'], -'CURLFile::__construct' => ['void', 'filename'=>'string', 'mimetype='=>'string', 'postfilename='=>'string'], -'CURLFile::__wakeup' => ['void'], -'CURLFile::getFilename' => ['string'], -'CURLFile::getMimeType' => ['string'], -'CURLFile::getPostFilename' => ['string'], -'CURLFile::setMimeType' => ['void', 'mime'=>'string'], -'CURLFile::setPostFilename' => ['void', 'name'=>'string'], -'current' => ['mixed', 'array_arg'=>'array|object'], -'cyrus_authenticate' => ['void', 'connection'=>'resource', 'mechlist='=>'string', 'service='=>'string', 'user='=>'string', 'minssf='=>'int', 'maxssf='=>'int', 'authname='=>'string', 'password='=>'string'], -'cyrus_bind' => ['bool', 'connection'=>'resource', 'callbacks'=>'array'], -'cyrus_close' => ['bool', 'connection'=>'resource'], -'cyrus_connect' => ['resource', 'host='=>'string', 'port='=>'string', 'flags='=>'int'], -'cyrus_query' => ['array', 'connection'=>'resource', 'query'=>'string'], -'cyrus_unbind' => ['bool', 'connection'=>'resource', 'trigger_name'=>'string'], -'date' => ['string', 'format'=>'string', 'timestamp='=>'int'], -'date_add' => ['DateTime|false', 'object'=>'', 'interval'=>''], -'date_create' => ['DateTime|false', 'time='=>'string|null', 'timezone='=>'?\DateTimeZone'], -'date_create_from_format' => ['DateTime|false', 'format'=>'string', 'time'=>'string', 'timezone='=>'DateTimeZone'], -'date_create_immutable' => ['DateTimeImmutable|false', 'time='=>'string', 'timezone='=>'?\DateTimeZone'], -'date_create_immutable_from_format' => ['DateTimeImmutable', 'format'=>'string', 'time'=>'string', 'timezone='=>'?\DateTimeZone'], -'date_date_set' => ['DateTime|false', 'object'=>'', 'year'=>'', 'month'=>'', 'day'=>''], -'date_default_timezone_get' => ['string'], -'date_default_timezone_set' => ['bool', 'timezone_identifier'=>'string'], -'date_diff' => ['DateInterval', 'obj1'=>'DateTimeInterface', 'obj2'=>'DateTimeInterface', 'absolute='=>'bool'], -'date_format' => ['string', 'obj'=>'DateTimeInterface', 'format'=>'string'], -'date_get_last_errors' => ['array'], -'date_interval_create_from_date_string' => ['DateInterval', 'time'=>''], -'date_interval_format' => ['DateInterval', 'object'=>'', 'format'=>''], -'date_isodate_set' => ['DateTime|false', 'object'=>'DateTime', 'year'=>'int', 'week'=>'int', 'day='=>'int|mixed'], -'date_modify' => ['DateTime|false', 'object'=>'DateTime', 'modify'=>'string'], -'date_offset_get' => ['int', 'obj'=>'DateTimeInterface'], -'date_parse' => ['array', 'date'=>'string'], -'date_parse_from_format' => ['array', 'format'=>'string', 'date'=>'string'], -'date_sub' => ['DateTime|false', 'object'=>'DateTime', 'interval'=>'DateInterval'], -'date_sun_info' => ['array', 'time'=>'int', 'latitude'=>'float', 'longitude'=>'float'], -'date_sunrise' => ['mixed', 'time'=>'int', 'format='=>'int', 'latitude='=>'float', 'longitude='=>'float', 'zenith='=>'float', 'gmt_offset='=>'float'], -'date_sunset' => ['mixed', 'time'=>'int', 'format='=>'int', 'latitude='=>'float', 'longitude='=>'float', 'zenith='=>'float', 'gmt_offset='=>'float'], -'date_time_set' => ['DateTime|false', 'object'=>'', 'hour'=>'', 'minute'=>'', 'second'=>'', 'microseconds'=>''], -'date_timestamp_get' => ['int', 'obj'=>'DateTimeInterface'], -'date_timestamp_set' => ['DateTime|false', 'object'=>'DateTime', 'unixtimestamp'=>'int'], -'date_timezone_get' => ['DateTimeZone', 'obj'=>'DateTimeInterface'], -'date_timezone_set' => ['DateTime|false', 'object'=>'DateTime', 'timezone'=>'DateTimeZone'], -'datefmt_create' => ['IntlDateFormatter|false', 'locale'=>'string', 'datetype'=>'int', 'timetype'=>'int', 'timezone='=>'int', 'calendar='=>'int|IntlCalendar', 'pattern='=>'string'], -'datefmt_format' => ['string', 'fmt'=>'IntlDateFormatter', 'value'=>'DateTime|IntlCalendar|array|int'], -'datefmt_format_object' => ['string', 'object'=>'object', 'format='=>'mixed', 'locale='=>'string'], -'datefmt_get_calendar' => ['int', 'fmt'=>'IntlDateFormatter'], -'datefmt_get_calendar_object' => ['IntlCalendar', 'fmt'=>'IntlDateFormatter'], -'datefmt_get_datetype' => ['int', 'fmt'=>'IntlDateFormatter'], -'datefmt_get_error_code' => ['int', 'fmt'=>'IntlDateFormatter'], -'datefmt_get_error_message' => ['string', 'fmt'=>'IntlDateFormatter'], -'datefmt_get_locale' => ['string', 'fmt'=>'IntlDateFormatter', 'which='=>'int'], -'datefmt_get_pattern' => ['string', 'fmt'=>'IntlDateFormatter'], -'datefmt_get_timetype' => ['int', 'fmt'=>'IntlDateFormatter'], -'datefmt_get_timezone' => ['IntlTimeZone'], -'datefmt_get_timezone_id' => ['string', 'fmt'=>'IntlDateFormatter'], -'datefmt_is_lenient' => ['bool', 'fmt'=>'IntlDateFormatter'], -'datefmt_localtime' => ['array|bool', 'fmt'=>'IntlDateFormatter', 'text_to_parse='=>'string', '&rw_parse_pos='=>'int'], -'datefmt_parse' => ['int|false', 'fmt'=>'IntlDateFormatter', 'text_to_parse='=>'string', '&rw_parse_pos='=>'int'], -'datefmt_set_calendar' => ['bool', 'fmt'=>'IntlDateFormatter', 'which'=>'int'], -'datefmt_set_lenient' => ['?bool', 'fmt'=>'IntlDateFormatter', 'lenient'=>'bool'], -'datefmt_set_pattern' => ['bool', 'fmt'=>'IntlDateFormatter', 'pattern'=>'string'], -'datefmt_set_timezone' => ['bool', 'zone'=>'mixed'], -'datefmt_set_timezone_id' => ['bool', 'fmt'=>'IntlDateFormatter', 'zone'=>'string'], -'DateInterval::__construct' => ['void', 'spec'=>'string'], -'DateInterval::__set_state' => ['DateInterval', 'array'=>'array'], -'DateInterval::__wakeup' => ['void'], -'DateInterval::createFromDateString' => ['DateInterval', 'time'=>'string'], -'DateInterval::format' => ['string', 'format'=>'string'], -'DatePeriod::__construct' => ['void', 'start'=>'DateTimeInterface', 'interval'=>'DateInterval', 'recur'=>'int', 'options='=>'int'], -'DatePeriod::__construct\'1' => ['void', 'start'=>'DateTimeInterface', 'interval'=>'DateInterval', 'end'=>'DateTimeInterface', 'options='=>'int'], -'DatePeriod::__construct\'2' => ['void', 'iso'=>'string', 'options='=>'int'], -'DatePeriod::__wakeup' => ['void'], -'DatePeriod::getDateInterval' => ['DateInterval'], -'DatePeriod::getEndDate' => ['DateTimeInterface'], -'DatePeriod::getStartDate' => ['DateTimeInterface'], -'DateTime::__construct' => ['void', 'time='=>'string|null', 'timezone='=>'?DateTimeZone'], -'DateTime::__set_state' => ['static', 'array'=>'array'], -'DateTime::__wakeup' => ['void'], -'DateTime::add' => ['static', 'interval'=>'DateInterval'], -'DateTime::createFromFormat' => ['static|false', 'format'=>'string', 'time'=>'string', 'timezone='=>'DateTimeZone|null'], -'DateTime::createFromImmutable' => ['static', 'object'=>'DateTimeImmutable'], -'DateTime::diff' => ['DateInterval', 'datetime2'=>'DateTimeInterface', 'absolute='=>'bool'], -'DateTime::format' => ['string', 'format'=>'string'], -'DateTime::getLastErrors' => ['array'], -'DateTime::getOffset' => ['int'], -'DateTime::getTimestamp' => ['int'], -'DateTime::getTimezone' => ['DateTimeZone'], -'DateTime::modify' => ['static', 'modify'=>'string'], -'DateTime::setDate' => ['static', 'year'=>'int', 'month'=>'int', 'day'=>'int'], -'DateTime::setISODate' => ['static', 'year'=>'int', 'week'=>'int', 'day='=>'int'], -'DateTime::setTime' => ['static', 'hour'=>'int', 'minute'=>'int', 'second='=>'int', 'microseconds='=>'int'], -'DateTime::setTimestamp' => ['static', 'unixtimestamp'=>'int'], -'DateTime::setTimezone' => ['static', 'timezone'=>'DateTimeZone'], -'DateTime::sub' => ['static', 'interval'=>'DateInterval'], -'DateTimeImmutable::__construct' => ['void', 'time='=>'string|null', 'timezone='=>'?DateTimeZone'], -'DateTimeImmutable::__set_state' => ['static', 'array'=>'array'], -'DateTimeImmutable::__wakeup' => ['void'], -'DateTimeImmutable::add' => ['static', 'interval'=>'DateInterval'], -'DateTimeImmutable::createFromFormat' => ['static|false', 'format'=>'string', 'time'=>'string', 'timezone='=>'DateTimeZone|null'], -'DateTimeImmutable::createFromMutable' => ['static', 'datetime'=>'DateTime'], -'DateTimeImmutable::diff' => ['DateInterval', 'datetime2'=>'DateTimeInterface', 'absolute='=>'bool'], -'DateTimeImmutable::format' => ['string', 'format'=>'string'], -'DateTimeImmutable::getLastErrors' => ['array'], -'DateTimeImmutable::getOffset' => ['int'], -'DateTimeImmutable::getTimestamp' => ['int'], -'DateTimeImmutable::getTimezone' => ['DateTimeZone'], -'DateTimeImmutable::modify' => ['static', 'modify'=>'string'], -'DateTimeImmutable::setDate' => ['static', 'year'=>'int', 'month'=>'int', 'day'=>'int'], -'DateTimeImmutable::setISODate' => ['static', 'year'=>'int', 'week'=>'int', 'day='=>'int'], -'DateTimeImmutable::setTime' => ['static', 'hour'=>'int', 'minute'=>'int', 'second='=>'int', 'microseconds='=>'int'], -'DateTimeImmutable::setTimestamp' => ['static', 'unixtimestamp'=>'int'], -'DateTimeImmutable::setTimezone' => ['static', 'timezone'=>'DateTimeZone'], -'DateTimeImmutable::sub' => ['static', 'interval'=>'DateInterval'], -'DateTimeInterface::diff' => ['DateInterval', 'datetime2'=>'DateTimeInterface', 'absolute='=>'bool'], -'DateTimeInterface::format' => ['string', 'format'=>'string'], -'DateTimeInterface::getOffset' => ['int'], -'DateTimeInterface::getTimestamp' => ['int'], -'DateTimeInterface::getTimezone' => ['DateTimeZone'], -'DateTimeZone::__construct' => ['void', 'timezone'=>'string'], -'DateTimeZone::__set_state' => ['DateTimeZone', 'array'=>'array'], -'DateTimeZone::__wakeup' => ['void'], -'DateTimeZone::getLocation' => ['array'], -'DateTimeZone::getName' => ['string'], -'DateTimeZone::getOffset' => ['int', 'datetime'=>'DateTimeInterface'], -'DateTimeZone::getTransitions' => ['array', 'timestamp_begin='=>'int', 'timestamp_end='=>'int'], -'DateTimeZone::listAbbreviations' => ['array'], -'DateTimeZone::listIdentifiers' => ['array', 'what='=>'int', 'country='=>'string'], -'db2_autocommit' => ['mixed', 'connection'=>'resource', 'value='=>'int'], -'db2_bind_param' => ['bool', 'stmt'=>'resource', 'parameter_number'=>'int', 'variable_name'=>'string', 'parameter_type='=>'int', 'data_type='=>'int', 'precision='=>'int', 'scale='=>'int'], -'db2_client_info' => ['object|false', 'connection'=>'resource'], -'db2_close' => ['bool', 'connection'=>'resource'], -'db2_column_privileges' => ['resource|false', 'connection'=>'resource', 'qualifier='=>'string', 'schema='=>'string', 'table_name='=>'string', 'column_name='=>'string'], -'db2_columns' => ['resource|false', 'connection'=>'resource', 'qualifier='=>'string', 'schema='=>'string', 'table_name='=>'string', 'column_name='=>'string'], -'db2_commit' => ['bool', 'connection'=>'resource'], -'db2_conn_error' => ['string', 'connection='=>'resource'], -'db2_conn_errormsg' => ['string', 'connection='=>'resource'], -'db2_connect' => ['resource|false', 'database'=>'string', 'username'=>'string', 'password'=>'string', 'options='=>'array'], -'db2_cursor_type' => ['int', 'stmt'=>'resource'], -'db2_escape_string' => ['string', 'string_literal'=>'string'], -'db2_exec' => ['resource|false', 'connection'=>'resource', 'statement'=>'string', 'options='=>'array'], -'db2_execute' => ['bool', 'stmt'=>'resource', 'parameters='=>'array'], -'db2_fetch_array' => ['array|false', 'stmt'=>'resource', 'row_number='=>'int'], -'db2_fetch_assoc' => ['array|false', 'stmt'=>'resource', 'row_number='=>'int'], -'db2_fetch_both' => ['array|false', 'stmt'=>'resource', 'row_number='=>'int'], -'db2_fetch_object' => ['object|false', 'stmt'=>'resource', 'row_number='=>'int'], -'db2_fetch_row' => ['bool', 'stmt'=>'resource', 'row_number='=>'int'], -'db2_field_display_size' => ['int|false', 'stmt'=>'resource', 'column'=>'mixed'], -'db2_field_name' => ['string|false', 'stmt'=>'resource', 'column'=>'mixed'], -'db2_field_num' => ['int|false', 'stmt'=>'resource', 'column'=>'mixed'], -'db2_field_precision' => ['int|false', 'stmt'=>'resource', 'column'=>'mixed'], -'db2_field_scale' => ['int|false', 'stmt'=>'resource', 'column'=>'mixed'], -'db2_field_type' => ['string|false', 'stmt'=>'resource', 'column'=>'mixed'], -'db2_field_width' => ['int|false', 'stmt'=>'resource', 'column'=>'mixed'], -'db2_foreign_keys' => ['resource|false', 'connection'=>'resource', 'qualifier'=>'string', 'schema'=>'string', 'table_name'=>'string'], -'db2_free_result' => ['bool', 'stmt'=>'resource'], -'db2_free_stmt' => ['bool', 'stmt'=>'resource'], -'db2_get_option' => ['string|false', 'resource'=>'resource', 'option'=>'string'], -'db2_last_insert_id' => ['string', 'resource'=>'resource'], -'db2_lob_read' => ['string|false', 'stmt'=>'resource', 'colnum'=>'int', 'length'=>'int'], -'db2_next_result' => ['resource|false', 'stmt'=>'resource'], -'db2_num_fields' => ['int|false', 'stmt'=>'resource'], -'db2_num_rows' => ['int', 'stmt'=>'resource'], -'db2_pclose' => ['bool', 'resource'=>'resource'], -'db2_pconnect' => ['resource|false', 'database'=>'string', 'username'=>'string', 'password'=>'string', 'options='=>'array'], -'db2_prepare' => ['resource|false', 'connection'=>'resource', 'statement'=>'string', 'options='=>'array'], -'db2_primary_keys' => ['resource|false', 'connection'=>'resource', 'qualifier'=>'string', 'schema'=>'string', 'table_name'=>'string'], -'db2_primarykeys' => [''], -'db2_procedure_columns' => ['resource|false', 'connection'=>'resource', 'qualifier'=>'string', 'schema'=>'string', 'procedure'=>'string', 'parameter'=>'string'], -'db2_procedurecolumns' => [''], -'db2_procedures' => ['resource|false', 'connection'=>'resource', 'qualifier'=>'string', 'schema'=>'string', 'procedure'=>'string'], -'db2_result' => ['mixed', 'stmt'=>'resource', 'column'=>'mixed'], -'db2_rollback' => ['bool', 'connection'=>'resource'], -'db2_server_info' => ['object|false', 'connection'=>'resource'], -'db2_set_option' => ['bool', 'resource'=>'resource', 'options'=>'array', 'type'=>'int'], -'db2_setoption' => [''], -'db2_special_columns' => ['resource|false', 'connection'=>'resource', 'qualifier'=>'string', 'schema'=>'string', 'table_name'=>'string', 'scope'=>'int'], -'db2_specialcolumns' => [''], -'db2_statistics' => ['resource|false', 'connection'=>'resource', 'qualifier'=>'string', 'schema'=>'string', 'table_name'=>'string', 'unique'=>'bool'], -'db2_stmt_error' => ['string', 'stmt='=>'resource'], -'db2_stmt_errormsg' => ['string', 'stmt='=>'resource'], -'db2_table_privileges' => ['resource|false', 'connection'=>'resource', 'qualifier='=>'string', 'schema='=>'string', 'table_name='=>'string'], -'db2_tableprivileges' => [''], -'db2_tables' => ['resource|false', 'connection'=>'resource', 'qualifier='=>'string', 'schema='=>'string', 'table_name='=>'string', 'table_type='=>'string'], -'dba_close' => ['void', 'handle'=>'resource'], -'dba_delete' => ['bool', 'key'=>'string', 'handle'=>'resource'], -'dba_exists' => ['bool', 'key'=>'string', 'handle'=>'resource'], -'dba_fetch' => ['string', 'key'=>'string', 'skip'=>'int', 'handle'=>'resource'], -'dba_fetch\'1' => ['string', 'key'=>'string', 'handle'=>'resource'], -'dba_firstkey' => ['string', 'handle'=>'resource'], -'dba_handlers' => ['array', 'full_info='=>'bool'], -'dba_insert' => ['bool', 'key'=>'string', 'value'=>'string', 'handle'=>'resource'], -'dba_key_split' => ['array|false', 'key'=>'string'], -'dba_list' => ['array'], -'dba_nextkey' => ['string', 'handle'=>'resource'], -'dba_open' => ['resource', 'path'=>'string', 'mode'=>'string', 'handlername='=>'string', '...args='=>'string'], -'dba_optimize' => ['bool', 'handle'=>'resource'], -'dba_popen' => ['resource', 'path'=>'string', 'mode'=>'string', 'handlername='=>'string', '...args='=>'string'], -'dba_replace' => ['bool', 'key'=>'string', 'value'=>'string', 'handle'=>'resource'], -'dba_sync' => ['bool', 'handle'=>'resource'], -'dbase_add_record' => ['bool', 'dbase_identifier'=>'int', 'record'=>'array'], -'dbase_close' => ['bool', 'dbase_identifier'=>'int'], -'dbase_create' => ['int', 'filename'=>'string', 'fields'=>'array'], -'dbase_delete_record' => ['bool', 'dbase_identifier'=>'int', 'record_number'=>'int'], -'dbase_get_header_info' => ['array', 'dbase_identifier'=>'int'], -'dbase_get_record' => ['array', 'dbase_identifier'=>'int', 'record_number'=>'int'], -'dbase_get_record_with_names' => ['array', 'dbase_identifier'=>'int', 'record_number'=>'int'], -'dbase_numfields' => ['int', 'dbase_identifier'=>'int'], -'dbase_numrecords' => ['int', 'dbase_identifier'=>'int'], -'dbase_open' => ['int', 'filename'=>'string', 'mode'=>'int'], -'dbase_pack' => ['bool', 'dbase_identifier'=>'int'], -'dbase_replace_record' => ['bool', 'dbase_identifier'=>'int', 'record'=>'array', 'record_number'=>'int'], -'dbplus_add' => ['int', 'relation'=>'resource', 'tuple'=>'array'], -'dbplus_aql' => ['resource', 'query'=>'string', 'server='=>'string', 'dbpath='=>'string'], -'dbplus_chdir' => ['string', 'newdir='=>'string'], -'dbplus_close' => ['mixed', 'relation'=>'resource'], -'dbplus_curr' => ['int', 'relation'=>'resource', 'tuple'=>'array'], -'dbplus_errcode' => ['string', 'errno='=>'int'], -'dbplus_errno' => ['int'], -'dbplus_find' => ['int', 'relation'=>'resource', 'constraints'=>'array', 'tuple'=>'mixed'], -'dbplus_first' => ['int', 'relation'=>'resource', 'tuple'=>'array'], -'dbplus_flush' => ['int', 'relation'=>'resource'], -'dbplus_freealllocks' => ['int'], -'dbplus_freelock' => ['int', 'relation'=>'resource', 'tuple'=>'string'], -'dbplus_freerlocks' => ['int', 'relation'=>'resource'], -'dbplus_getlock' => ['int', 'relation'=>'resource', 'tuple'=>'string'], -'dbplus_getunique' => ['int', 'relation'=>'resource', 'uniqueid'=>'int'], -'dbplus_info' => ['int', 'relation'=>'resource', 'key'=>'string', 'result'=>'array'], -'dbplus_last' => ['int', 'relation'=>'resource', 'tuple'=>'array'], -'dbplus_lockrel' => ['int', 'relation'=>'resource'], -'dbplus_next' => ['int', 'relation'=>'resource', 'tuple'=>'array'], -'dbplus_open' => ['resource', 'name'=>'string'], -'dbplus_prev' => ['int', 'relation'=>'resource', 'tuple'=>'array'], -'dbplus_rchperm' => ['int', 'relation'=>'resource', 'mask'=>'int', 'user'=>'string', 'group'=>'string'], -'dbplus_rcreate' => ['resource', 'name'=>'string', 'domlist'=>'mixed', 'overwrite='=>'bool'], -'dbplus_rcrtexact' => ['mixed', 'name'=>'string', 'relation'=>'resource', 'overwrite='=>'bool'], -'dbplus_rcrtlike' => ['mixed', 'name'=>'string', 'relation'=>'resource', 'overwrite='=>'int'], -'dbplus_resolve' => ['array', 'relation_name'=>'string'], -'dbplus_restorepos' => ['int', 'relation'=>'resource', 'tuple'=>'array'], -'dbplus_rkeys' => ['mixed', 'relation'=>'resource', 'domlist'=>'mixed'], -'dbplus_ropen' => ['resource', 'name'=>'string'], -'dbplus_rquery' => ['resource', 'query'=>'string', 'dbpath='=>'string'], -'dbplus_rrename' => ['int', 'relation'=>'resource', 'name'=>'string'], -'dbplus_rsecindex' => ['mixed', 'relation'=>'resource', 'domlist'=>'mixed', 'type'=>'int'], -'dbplus_runlink' => ['int', 'relation'=>'resource'], -'dbplus_rzap' => ['int', 'relation'=>'resource'], -'dbplus_savepos' => ['int', 'relation'=>'resource'], -'dbplus_setindex' => ['int', 'relation'=>'resource', 'idx_name'=>'string'], -'dbplus_setindexbynumber' => ['int', 'relation'=>'resource', 'idx_number'=>'int'], -'dbplus_sql' => ['resource', 'query'=>'string', 'server='=>'string', 'dbpath='=>'string'], -'dbplus_tcl' => ['string', 'sid'=>'int', 'script'=>'string'], -'dbplus_tremove' => ['int', 'relation'=>'resource', 'tuple'=>'array', 'current='=>'array'], -'dbplus_undo' => ['int', 'relation'=>'resource'], -'dbplus_undoprepare' => ['int', 'relation'=>'resource'], -'dbplus_unlockrel' => ['int', 'relation'=>'resource'], -'dbplus_unselect' => ['int', 'relation'=>'resource'], -'dbplus_update' => ['int', 'relation'=>'resource', 'old'=>'array', 'new'=>'array'], -'dbplus_xlockrel' => ['int', 'relation'=>'resource'], -'dbplus_xunlockrel' => ['int', 'relation'=>'resource'], -'dbx_close' => ['int', 'link_identifier'=>'object'], -'dbx_compare' => ['int', 'row_a'=>'array', 'row_b'=>'array', 'column_key'=>'string', 'flags='=>'int'], -'dbx_connect' => ['object', 'module'=>'mixed', 'host'=>'string', 'database'=>'string', 'username'=>'string', 'password'=>'string', 'persistent='=>'int'], -'dbx_error' => ['string', 'link_identifier'=>'object'], -'dbx_escape_string' => ['string', 'link_identifier'=>'object', 'text'=>'string'], -'dbx_fetch_row' => ['mixed', 'result_identifier'=>'object'], -'dbx_query' => ['mixed', 'link_identifier'=>'object', 'sql_statement'=>'string', 'flags='=>'int'], -'dbx_sort' => ['bool', 'result'=>'object', 'user_compare_function'=>'string'], -'dcgettext' => ['string', 'domain_name'=>'string', 'msgid'=>'string', 'category'=>'int'], -'dcngettext' => ['string', 'domain'=>'string', 'msgid1'=>'string', 'msgid2'=>'string', 'n'=>'int', 'category'=>'int'], -'deaggregate' => ['', 'object'=>'object', 'class_name='=>'string'], -'debug_backtrace' => ['array', 'options='=>'int|bool', 'limit='=>'int'], -'debug_print_backtrace' => ['void', 'options='=>'int|bool', 'limit='=>'int'], -'debug_zval_dump' => ['void', '...var'=>'mixed'], -'debugger_connect' => [''], -'debugger_connector_pid' => [''], -'debugger_get_server_start_time' => [''], -'debugger_print' => [''], -'debugger_start_debug' => [''], -'decbin' => ['string', 'decimal_number'=>'int'], -'dechex' => ['string', 'decimal_number'=>'int'], -'decoct' => ['string', 'decimal_number'=>'int'], -'define' => ['bool', 'constant_name'=>'string', 'value'=>'mixed', 'case_insensitive='=>'bool'], -'define_syslog_variables' => ['void'], -'defined' => ['bool', 'name'=>'string'], -'deflate_add' => ['string|false', 'context'=>'resource', 'data'=>'string', 'flush_mode='=>'int'], -'deflate_init' => ['resource|false', 'encoding'=>'int', 'options='=>'array'], -'deg2rad' => ['float', 'number'=>'float'], -'dgettext' => ['string', 'domain_name'=>'string', 'msgid'=>'string'], -'dio_close' => ['void', 'fd'=>'resource'], -'dio_fcntl' => ['mixed', 'fd'=>'resource', 'cmd'=>'int', 'args='=>'mixed'], -'dio_open' => ['resource', 'filename'=>'string', 'flags'=>'int', 'mode='=>'int'], -'dio_read' => ['string', 'fd'=>'resource', 'len='=>'int'], -'dio_seek' => ['int', 'fd'=>'resource', 'pos'=>'int', 'whence='=>'int'], -'dio_stat' => ['array|null', 'fd'=>'resource'], -'dio_tcsetattr' => ['bool', 'fd'=>'resource', 'options'=>'array'], -'dio_truncate' => ['bool', 'fd'=>'resource', 'offset'=>'int'], -'dio_write' => ['int', 'fd'=>'resource', 'data'=>'string', 'len='=>'int'], -'dir' => ['Directory|false', 'directory'=>'string', 'context='=>'resource'], -'Directory::close' => ['void', 'dir_handle='=>'resource'], -'Directory::read' => ['string|false', 'dir_handle='=>'resource'], -'Directory::rewind' => ['void', 'dir_handle='=>'resource'], -'DirectoryIterator::__construct' => ['void', 'path'=>'string'], -'DirectoryIterator::__toString' => ['string'], -'DirectoryIterator::current' => ['DirectoryIterator'], -'DirectoryIterator::getATime' => ['int'], -'DirectoryIterator::getBasename' => ['string', 'suffix='=>'string'], -'DirectoryIterator::getChildren' => ['RecursiveDirectoryIterator'], -'DirectoryIterator::getCTime' => ['int'], -'DirectoryIterator::getExtension' => ['string'], -'DirectoryIterator::getFileInfo' => ['SplFileInfo', 'class_name='=>'string'], -'DirectoryIterator::getFilename' => ['string'], -'DirectoryIterator::getGroup' => ['int'], -'DirectoryIterator::getInode' => ['int'], -'DirectoryIterator::getLinkTarget' => ['string'], -'DirectoryIterator::getMTime' => ['int'], -'DirectoryIterator::getOwner' => ['int'], -'DirectoryIterator::getPath' => ['string'], -'DirectoryIterator::getPathInfo' => ['SplFileInfo', 'class_name='=>'string'], -'DirectoryIterator::getPathname' => ['string'], -'DirectoryIterator::getPerms' => ['int'], -'DirectoryIterator::getRealPath' => ['string'], -'DirectoryIterator::getSize' => ['int'], -'DirectoryIterator::getType' => ['string'], -'DirectoryIterator::isDir' => ['bool'], -'DirectoryIterator::isDot' => ['bool'], -'DirectoryIterator::isExecutable' => ['bool'], -'DirectoryIterator::isFile' => ['bool'], -'DirectoryIterator::isLink' => ['bool'], -'DirectoryIterator::isReadable' => ['bool'], -'DirectoryIterator::isWritable' => ['bool'], -'DirectoryIterator::key' => ['string'], -'DirectoryIterator::next' => ['void'], -'DirectoryIterator::openFile' => ['SplFileObject', 'mode='=>'string', 'use_include_path='=>'bool', 'context='=>'resource'], -'DirectoryIterator::rewind' => ['void'], -'DirectoryIterator::seek' => ['void', 'position'=>'int'], -'DirectoryIterator::setFileClass' => ['void', 'class_name='=>'string'], -'DirectoryIterator::setInfoClass' => ['void', 'class_name='=>'string'], -'DirectoryIterator::valid' => ['bool'], -'dirname' => ['string', 'path'=>'string', 'levels='=>'int'], -'disk_free_space' => ['float|false', 'path'=>'string'], -'disk_total_space' => ['float', 'path'=>'string'], -'diskfreespace' => ['float|false', 'path'=>'string'], -'display_disabled_function' => [''], -'dl' => ['bool', 'extension_filename'=>'string'], -'dngettext' => ['string', 'domain'=>'string', 'msgid1'=>'string', 'msgid2'=>'string', 'count'=>'int'], -'dns_check_record' => ['bool', 'host'=>'string', 'type='=>'string'], -'dns_get_mx' => ['bool', 'hostname'=>'string', '&w_mxhosts'=>'array', '&w_weight'=>'array'], -'dns_get_record' => ['array|false', 'hostname'=>'string', 'type='=>'int', '&w_authns='=>'array', '&w_addtl='=>'array', 'raw='=>'bool'], -'dom_document_relaxNG_validate_file' => ['bool', 'filename'=>'string'], -'dom_document_relaxNG_validate_xml' => ['bool', 'source'=>'string'], -'dom_document_schema_validate' => ['bool', 'source'=>'string', 'flags'=>'int'], -'dom_document_schema_validate_file' => ['bool', 'filename'=>'string', 'flags'=>'int'], -'dom_document_xinclude' => ['int', 'options'=>'int'], -'dom_import_simplexml' => ['DOMElement|false', 'node'=>'SimpleXMLElement'], -'dom_xpath_evaluate' => ['', 'expr'=>'string', 'context'=>'DOMNode', 'registernodens'=>'bool'], -'dom_xpath_query' => ['DOMNodeList', 'expr'=>'string', 'context'=>'DOMNode', 'registernodens'=>'bool'], -'dom_xpath_register_ns' => ['bool', 'prefix'=>'string', 'uri'=>'string'], -'dom_xpath_register_php_functions' => [''], -'DomainException::__clone' => ['void'], -'DomainException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'(?Throwable)|(?DomainException)'], -'DomainException::__toString' => ['string'], -'DomainException::__wakeup' => ['void'], -'DomainException::getCode' => ['int'], -'DomainException::getFile' => ['string'], -'DomainException::getLine' => ['int'], -'DomainException::getMessage' => ['string'], -'DomainException::getPrevious' => ['Throwable|DomainException|null'], -'DomainException::getTrace' => ['array'], -'DomainException::getTraceAsString' => ['string'], -'DOMAttr::__construct' => ['void', 'name'=>'string', 'value='=>'string'], -'DOMAttr::isId' => ['bool'], -'DomAttribute::name' => ['string'], -'DomAttribute::set_value' => ['bool', 'content'=>'string'], -'DomAttribute::specified' => ['bool'], -'DomAttribute::value' => ['string'], -'DOMCdataSection::__construct' => ['void', 'value'=>'string'], -'DOMCharacterData::appendData' => ['void', 'data'=>'string'], -'DOMCharacterData::deleteData' => ['void', 'offset'=>'int', 'count'=>'int'], -'DOMCharacterData::insertData' => ['void', 'offset'=>'int', 'data'=>'string'], -'DOMCharacterData::replaceData' => ['void', 'offset'=>'int', 'count'=>'int', 'data'=>'string'], -'DOMCharacterData::substringData' => ['string', 'offset'=>'int', 'count'=>'int'], -'DOMComment::__construct' => ['void', 'value='=>'string'], -'DOMDocument::__construct' => ['void', 'version='=>'string', 'encoding='=>'string'], -'DOMDocument::createAttribute' => ['DOMAttr', 'name'=>'string'], -'DOMDocument::createAttributeNS' => ['DOMAttr', 'namespaceuri'=>'string', 'qualifiedname'=>'string'], -'DOMDocument::createCDATASection' => ['DOMCDATASection', 'data'=>'string'], -'DOMDocument::createComment' => ['DOMComment', 'data'=>'string'], -'DOMDocument::createDocumentFragment' => ['DOMDocumentFragment'], -'DOMDocument::createElement' => ['DOMElement', 'name'=>'string', 'value='=>'string'], -'DOMDocument::createElementNS' => ['DOMElement', 'namespaceuri'=>'string', 'qualifiedname'=>'string', 'value='=>'string'], -'DOMDocument::createEntityReference' => ['DOMEntityReference', 'name'=>'string'], -'DOMDocument::createProcessingInstruction' => ['DOMProcessingInstruction', 'target'=>'string', 'data='=>'string'], -'DOMDocument::createTextNode' => ['DOMText', 'content'=>'string'], -'DOMDocument::getElementById' => ['DOMElement|null', 'elementid'=>'string'], -'DOMDocument::getElementsByTagName' => ['DOMNodeList', 'name'=>'string'], -'DOMDocument::getElementsByTagNameNS' => ['DOMNodeList', 'namespaceuri'=>'string', 'localname'=>'string'], -'DOMDocument::importNode' => ['DOMNode', 'importednode'=>'DOMNode', 'deep='=>'bool'], -'DOMDocument::load' => ['mixed', 'filename'=>'string', 'options='=>'int'], -'DOMDocument::loadHTML' => ['bool', 'source'=>'string', 'options='=>'int'], -'DOMDocument::loadHTMLFile' => ['bool', 'filename'=>'string', 'options='=>'int'], -'DOMDocument::loadXML' => ['mixed', 'source'=>'string', 'options='=>'int'], -'DOMDocument::normalizeDocument' => ['void'], -'DOMDocument::registerNodeClass' => ['bool', 'baseclass'=>'string', 'extendedclass'=>'string'], -'DOMDocument::relaxNGValidate' => ['bool', 'filename'=>'string'], -'DOMDocument::relaxNGValidateSource' => ['bool', 'source'=>'string'], -'DOMDocument::save' => ['int', 'filename'=>'string', 'options='=>'int'], -'DOMDocument::saveHTML' => ['string|false', 'node='=>'?DOMNode'], -'DOMDocument::saveHTMLFile' => ['int', 'filename'=>'string'], -'DOMDocument::saveXML' => ['string', 'node='=>'?DOMNode', 'options='=>'int'], -'DOMDocument::schemaValidate' => ['bool', 'filename'=>'string', 'flags='=>'int'], -'DOMDocument::schemaValidateSource' => ['bool', 'source'=>'string', 'flags='=>'int'], -'DOMDocument::validate' => ['bool'], -'DOMDocument::xinclude' => ['int', 'options='=>'int'], -'DOMDocumentFragment::__construct' => ['void'], -'DOMDocumentFragment::appendXML' => ['bool', 'data'=>'string'], -'DomDocumentType::entities' => ['array'], -'DomDocumentType::internal_subset' => ['bool'], -'DomDocumentType::name' => ['string'], -'DomDocumentType::notations' => ['array'], -'DomDocumentType::public_id' => ['string'], -'DomDocumentType::system_id' => ['string'], -'DOMElement::__construct' => ['void', 'name'=>'string', 'value='=>'string', 'uri='=>'string'], -'DOMElement::get_attribute' => ['string', 'name'=>'string'], -'DOMElement::get_attribute_node' => ['DomAttribute', 'name'=>'string'], -'DOMElement::get_elements_by_tagname' => ['array', 'name'=>'string'], -'DOMElement::getAttribute' => ['string', 'name'=>'string'], -'DOMElement::getAttributeNode' => ['DOMAttr', 'name'=>'string'], -'DOMElement::getAttributeNodeNS' => ['DOMAttr', 'namespaceuri'=>'string', 'localname'=>'string'], -'DOMElement::getAttributeNS' => ['string', 'namespaceuri'=>'string', 'localname'=>'string'], -'DOMElement::getElementsByTagName' => ['DOMNodeList', 'name'=>'string'], -'DOMElement::getElementsByTagNameNS' => ['DOMNodeList', 'namespaceuri'=>'string', 'localname'=>'string'], -'DOMElement::has_attribute' => ['bool', 'name'=>'string'], -'DOMElement::hasAttribute' => ['bool', 'name'=>'string'], -'DOMElement::hasAttributeNS' => ['bool', 'namespaceuri'=>'string', 'localname'=>'string'], -'DOMElement::remove_attribute' => ['bool', 'name'=>'string'], -'DOMElement::removeAttribute' => ['bool', 'name'=>'string'], -'DOMElement::removeAttributeNode' => ['bool', 'oldnode'=>'DOMAttr'], -'DOMElement::removeAttributeNS' => ['bool', 'namespaceuri'=>'string', 'localname'=>'string'], -'DOMElement::set_attribute' => ['DomAttribute', 'name'=>'string', 'value'=>'string'], -'DOMElement::set_attribute_node' => ['DomNode', 'attr'=>'DOMNode'], -'DOMElement::setAttribute' => ['DOMAttr', 'name'=>'string', 'value'=>'string'], -'DOMElement::setAttributeNode' => ['DOMAttr', 'attr'=>'DOMAttr'], -'DOMElement::setAttributeNodeNS' => ['DOMAttr', 'attr'=>'DOMAttr'], -'DOMElement::setAttributeNS' => ['void', 'namespaceuri'=>'string', 'qualifiedname'=>'string', 'value'=>'string'], -'DOMElement::setIdAttribute' => ['void', 'name'=>'string', 'isid'=>'bool'], -'DOMElement::setIdAttributeNode' => ['void', 'attr'=>'DOMAttr', 'isid'=>'bool'], -'DOMElement::setIdAttributeNS' => ['void', 'namespaceuri'=>'string', 'localname'=>'string', 'isid'=>'bool'], -'DOMElement::tagname' => ['string'], -'DOMEntityReference::__construct' => ['void', 'name'=>'string'], -'DOMImplementation::__construct' => ['void'], -'DOMImplementation::createDocument' => ['DOMDocument', 'namespaceuri='=>'string', 'qualifiedname='=>'string', 'doctype='=>'DOMDocumentType'], -'DOMImplementation::createDocumentType' => ['DOMDocumentType', 'qualifiedname='=>'string', 'publicid='=>'string', 'systemid='=>'string'], -'DOMImplementation::hasFeature' => ['bool', 'feature'=>'string', 'version'=>'string'], -'DOMNamedNodeMap::count' => ['int'], -'DOMNamedNodeMap::getNamedItem' => ['?DOMNode', 'name'=>'string'], -'DOMNamedNodeMap::getNamedItemNS' => ['?DOMNode', 'namespaceuri'=>'string', 'localname'=>'string'], -'DOMNamedNodeMap::item' => ['?DOMNode', 'index'=>'int'], -'DomNode::add_namespace' => ['bool', 'uri'=>'string', 'prefix'=>'string'], -'DomNode::append_child' => ['DOMNode', 'newnode'=>'DOMNode'], -'DOMNode::appendChild' => ['DOMNode', 'newnode'=>'DOMNode'], -'DOMNode::C14N' => ['string', 'exclusive='=>'bool', 'with_comments='=>'bool', 'xpath='=>'array', 'ns_prefixes='=>'array'], -'DOMNode::C14NFile' => ['int', 'uri='=>'string', 'exclusive='=>'bool', 'with_comments='=>'bool', 'xpath='=>'array', 'ns_prefixes='=>'array'], -'DOMNode::cloneNode' => ['DOMNode', 'deep='=>'bool'], -'DOMNode::getLineNo' => ['int'], -'DOMNode::getNodePath' => ['?string'], -'DOMNode::hasAttributes' => ['bool'], -'DOMNode::hasChildNodes' => ['bool'], -'DOMNode::insertBefore' => ['DOMNode', 'newnode'=>'DOMNode', 'refnode='=>'DOMNode'], -'DOMNode::isDefaultNamespace' => ['bool', 'namespaceuri'=>'string'], -'DOMNode::isSameNode' => ['bool', 'node'=>'DOMNode'], -'DOMNode::isSupported' => ['bool', 'feature'=>'string', 'version'=>'string'], -'DOMNode::lookupNamespaceURI' => ['string', 'prefix'=>'string'], -'DOMNode::lookupPrefix' => ['string', 'namespaceuri'=>'string'], -'DOMNode::normalize' => ['void'], -'DOMNode::removeChild' => ['DOMNode', 'oldnode'=>'DOMNode'], -'DOMNode::replaceChild' => ['DOMNode', 'newnode'=>'DOMNode', 'oldnode'=>'DOMNode'], -'DOMNodeList::count' => ['int'], -'DOMNodeList::item' => ['?DOMNode', 'index'=>'int'], -'DOMProcessingInstruction::__construct' => ['void', 'name'=>'string', 'value'=>'string'], -'DomProcessingInstruction::data' => ['string'], -'DomProcessingInstruction::target' => ['string'], -'DOMText::__construct' => ['void', 'value='=>'string'], -'DOMText::isElementContentWhitespace' => ['bool'], -'DOMText::isWhitespaceInElementContent' => ['bool'], -'DOMText::splitText' => ['DOMText', 'offset'=>'int'], -'domxml_new_doc' => ['DomDocument', 'version'=>'string'], -'domxml_open_file' => ['DomDocument', 'filename'=>'string', 'mode='=>'int', 'error='=>'array'], -'domxml_open_mem' => ['DomDocument', 'str'=>'string', 'mode='=>'int', 'error='=>'array'], -'domxml_version' => ['string'], -'domxml_xmltree' => ['DomDocument', 'str'=>'string'], -'domxml_xslt_stylesheet' => ['DomXsltStylesheet', 'xsl_buf'=>'string'], -'domxml_xslt_stylesheet_doc' => ['DomXsltStylesheet', 'xsl_doc'=>'DOMDocument'], -'domxml_xslt_stylesheet_file' => ['DomXsltStylesheet', 'xsl_file'=>'string'], -'domxml_xslt_version' => ['int'], -'DOMXPath::__construct' => ['void', 'doc'=>'DOMDocument'], -'DOMXPath::evaluate' => ['mixed', 'expression'=>'string', 'contextnode='=>'DOMNode', 'registernodens='=>'bool'], -'DOMXPath::query' => ['DOMNodeList', 'expression'=>'string', 'contextnode='=>'DOMNode', 'registernodens='=>'bool'], -'DOMXPath::registerNamespace' => ['bool', 'prefix'=>'string', 'namespaceuri'=>'string'], -'DOMXPath::registerPhpFunctions' => ['void', 'restrict='=>'mixed'], -'DomXsltStylesheet::process' => ['DomDocument', 'xml_doc'=>'DOMDocument', 'xslt_params='=>'array', 'is_xpath_param='=>'bool', 'profile_filename='=>'string'], -'DomXsltStylesheet::result_dump_file' => ['string', 'xmldoc'=>'DOMDocument', 'filename'=>'string'], -'DomXsltStylesheet::result_dump_mem' => ['string', 'xmldoc'=>'DOMDocument'], -'DOTNET::__construct' => ['void', 'assembly_name'=>'string', 'class_name'=>'string', 'codepage='=>'int'], -'dotnet_load' => ['int', 'assembly_name'=>'string', 'datatype_name='=>'string', 'codepage='=>'int'], -'doubleval' => ['float', 'var'=>'mixed'], -'Ds\Collection::clear' => ['void'], -'Ds\Collection::copy' => ['Ds\Collection'], -'Ds\Collection::isEmpty' => ['bool'], -'Ds\Collection::toArray' => ['array'], -'Ds\Hashable::hash' => ['void'], -'Ds\Hashable::equals' => ['bool', 'obj'=>'mixed'], -'Ds\Sequence::allocate' => ['void', 'capacity'=>'int'], -'Ds\Sequence::apply' => ['void', 'callback'=>'callable'], -'Ds\Sequence::capacity' => ['int'], -'Ds\Sequence::contains' => ['bool', '...values='=>'mixed'], -'Ds\Sequence::filter' => ['Ds\Sequence', 'callback='=>'callable'], -'Ds\Sequence::find' => ['mixed', 'value'=>'mixed'], -'Ds\Sequence::first' => ['mixed'], -'Ds\Sequence::get' => ['mixed', 'index'=>'int'], -'Ds\Sequence::insert' => ['void', 'index'=>'int', '...values='=>'mixed'], -'Ds\Sequence::join' => ['string', 'glue='=>'string'], -'Ds\Sequence::last' => ['void'], -'Ds\Sequence::map' => ['Ds\Sequence', 'callback'=>'callable'], -'Ds\Sequence::merge' => ['Ds\Sequence', 'values'=>'mixed'], -'Ds\Sequence::pop' => ['mixed'], -'Ds\Sequence::push' => ['void', '...values='=>'mixed'], -'Ds\Sequence::reduce' => ['mixed', 'callback'=>'callable', 'initial='=>'mixed'], -'Ds\Sequence::remove' => ['mixed', 'index'=>'int'], -'Ds\Sequence::reverse' => ['void'], -'Ds\Sequence::reversed' => ['Ds\Sequence'], -'Ds\Sequence::rotate' => ['void', 'rotations'=>'int'], -'Ds\Sequence::set' => ['void', 'index'=>'int', 'value'=>'mixed'], -'Ds\Sequence::shift' => ['mixed'], -'Ds\Sequence::slice' => ['Ds\Sequence', 'index'=>'int', 'length='=>'?int'], -'Ds\Sequence::sort' => ['void', 'comparator='=>'callable'], -'Ds\Sequence::sorted' => ['Ds\Sequence', 'comparator='=>'callable'], -'Ds\Sequence::sum' => ['int|float'], -'Ds\Sequence::unshift' => ['void', '...values='=>'mixed'], -'Ds\Vector::__construct' => ['void', 'values='=>'mixed'], -'Ds\Vector::allocate' => ['void', 'capacity'=>'int'], -'Ds\Vector::apply' => ['void', 'callback'=>'callable'], -'Ds\Vector::capacity' => ['int'], -'Ds\Vector::contains' => ['bool', '...values='=>'mixed'], -'Ds\Vector::filter' => ['Ds\Vector', 'callback='=>'callable'], -'Ds\Vector::find' => ['mixed', 'value'=>'mixed'], -'Ds\Vector::first' => ['mixed'], -'Ds\Vector::get' => ['mixed', 'index'=>'int'], -'Ds\Vector::insert' => ['void', 'index'=>'int', '...values='=>'mixed'], -'Ds\Vector::join' => ['string', 'glue='=>'string'], -'Ds\Vector::last' => ['mixed'], -'Ds\Vector::map' => ['Ds\Vector', 'callback'=>'callable'], -'Ds\Vector::merge' => ['Ds\Vector', 'values'=>'mixed'], -'Ds\Vector::pop' => ['mixed'], -'Ds\Vector::push' => ['void', '...values='=>'mixed'], -'Ds\Vector::reduce' => ['mixed', 'callback'=>'callable', 'initial='=>'mixed'], -'Ds\Vector::remove' => ['mixed', 'index'=>'int'], -'Ds\Vector::reverse' => ['void'], -'Ds\Vector::reversed' => ['Ds\Vector'], -'Ds\Vector::rotate' => ['void', 'rotations'=>'int'], -'Ds\Vector::set' => ['void', 'index'=>'int', 'value'=>'mixed'], -'Ds\Vector::shift' => ['mixed'], -'Ds\Vector::slice' => ['Ds\Vector', 'index'=>'int', 'length='=>'?int'], -'Ds\Vector::sort' => ['void', 'comparator='=>'callable'], -'Ds\Vector::sorted' => ['Ds\Vector', 'comparator='=>'callable'], -'Ds\Vector::sum' => ['int|float'], -'Ds\Vector::unshift' => ['void', '...values='=>'mixed'], -'Ds\Vector::clear' => ['void'], -'Ds\Vector::copy' => ['Ds\Vector'], -'Ds\Vector::count' => ['int'], -'Ds\Vector::isEmpty' => ['bool'], -'Ds\Vector::jsonSerialize' => ['array'], -'Ds\Vector::toArray' => ['array'], -'Ds\Deque::__construct' => ['void', 'values='=>'mixed'], -'Ds\Deque::clear' => ['void'], -'Ds\Deque::copy' => ['Ds\Deque'], -'Ds\Deque::count' => ['int'], -'Ds\Deque::isEmpty' => ['bool'], -'Ds\Deque::jsonSerialize' => ['array'], -'Ds\Deque::toArray' => ['array'], -'Ds\Deque::allocate' => ['void', 'capacity'=>'int'], -'Ds\Deque::apply' => ['void', 'callback'=>'callable'], -'Ds\Deque::capacity' => ['int'], -'Ds\Deque::contains' => ['bool', '...values='=>'mixed'], -'Ds\Deque::filter' => ['Ds\Deque', 'callback='=>'callable'], -'Ds\Deque::find' => ['mixed', 'value'=>'mixed'], -'Ds\Deque::first' => ['mixed'], -'Ds\Deque::get' => ['void', 'index'=>'int'], -'Ds\Deque::insert' => ['void', 'index'=>'int', '...values='=>'mixed'], -'Ds\Deque::join' => ['string', 'glue='=>'string'], -'Ds\Deque::last' => ['mixed'], -'Ds\Deque::map' => ['Ds\Deque', 'callback'=>'callable'], -'Ds\Deque::merge' => ['Ds\Deque', 'values'=>'mixed'], -'Ds\Deque::pop' => ['mixed'], -'Ds\Deque::push' => ['void', '...values='=>'mixed'], -'Ds\Deque::reduce' => ['mixed', 'callback'=>'callable', 'initial='=>'mixed'], -'Ds\Deque::remove' => ['mixed', 'index'=>'int'], -'Ds\Deque::reverse' => ['void'], -'Ds\Deque::reversed' => ['Ds\Deque'], -'Ds\Deque::rotate' => ['void', 'rotations'=>'int'], -'Ds\Deque::set' => ['void', 'index'=>'int', 'value'=>'mixed'], -'Ds\Deque::shift' => ['mixed'], -'Ds\Deque::slice' => ['Ds\Deque', 'index'=>'int', 'length='=>'?int'], -'Ds\Deque::sort' => ['void', 'comparator='=>'callable'], -'Ds\Deque::sorted' => ['Ds\Deque', 'comparator='=>'callable'], -'Ds\Deque::sum' => ['int|float'], -'Ds\Deque::unshift' => ['void', '...values='=>'mixed'], -'Ds\Map::__construct' => ['void', 'values='=>'mixed'], -'Ds\Map::allocate' => ['void', 'capacity'=>'int'], -'Ds\Map::apply' => ['void', 'callback'=>'callable'], -'Ds\Map::capacity' => ['int'], -'Ds\Map::diff' => ['Ds\Map', 'map'=>'Ds\Map'], -'Ds\Map::filter' => ['Ds\Map', 'callback='=>'callable'], -'Ds\Map::first' => ['Ds\Pair'], -'Ds\Map::get' => ['mixed', 'key'=>'mixed', 'default='=>'mixed'], -'Ds\Map::hasKey' => ['bool', 'key'=>'mixed'], -'Ds\Map::hasValue' => ['bool', 'value'=>'mixed'], -'Ds\Map::intersect' => ['Ds\Map', 'map'=>'Ds\Map'], -'Ds\Map::keys' => ['Ds\Set'], -'Ds\Map::ksort' => ['void', 'comparator='=>'callable'], -'Ds\Map::ksorted' => ['Ds\Map', 'comparator='=>'callable'], -'Ds\Map::last' => ['Ds\Pair'], -'Ds\Map::map' => ['Ds\Map', 'callback'=>'callable'], -'Ds\Map::merge' => ['Ds\Map', 'values'=>'mixed'], -'Ds\Map::pairs' => ['Ds\Sequence'], -'Ds\Map::put' => ['void', 'key'=>'mixed', 'value'=>'mixed'], -'Ds\Map::putAll' => ['void', 'values'=>'mixed'], -'Ds\Map::reduce' => ['mixed', 'callback'=>'callable', 'initial='=>'mixed'], -'Ds\Map::remove' => ['mixed', 'key'=>'mixed', 'default='=>'mixed'], -'Ds\Map::reverse' => ['void'], -'Ds\Map::reversed' => ['Ds\Map'], -'Ds\Map::skip' => ['Ds\Pair', 'position'=>'int'], -'Ds\Map::slice' => ['Ds\Map', 'index'=>'int', 'length='=>'?int'], -'Ds\Map::sort' => ['void', 'comparator='=>'callable'], -'Ds\Map::sorted' => ['Ds\Map', 'comparator='=>'callable'], -'Ds\Map::sum' => ['int|float'], -'Ds\Map::union' => ['Ds\Map', 'map'=>'mixed'], -'Ds\Map::values' => ['Ds\Sequence'], -'Ds\Map::xor' => ['Ds\Map', 'map'=>'Ds\Map'], -'Ds\Map::clear' => ['void'], -'Ds\Map::copy' => ['Ds\Map'], -'Ds\Map::count' => ['int'], -'Ds\Map::isEmpty' => ['bool'], -'Ds\Map::jsonSerialize' => ['array'], -'Ds\Map::toArray' => ['array'], -'Ds\Pair::__construct' => ['void', 'key='=>'mixed', 'value='=>'mixed'], -'Ds\Pair::copy' => ['Ds\Pair'], -'Ds\Pair::jsonSerialize' => ['array'], -'Ds\Pair::toArray' => ['array'], -'Ds\Set::__construct' => ['void', 'values='=>'mixed'], -'Ds\Set::add' => ['void', '...values='=>'mixed'], -'Ds\Set::allocate' => ['void', 'capacity'=>'int'], -'Ds\Set::capacity' => ['int'], -'Ds\Set::contains' => ['bool', '...values='=>'mixed'], -'Ds\Set::diff' => ['Ds\Set', 'set'=>'Ds\Set'], -'Ds\Set::filter' => ['Ds\Set', 'callback='=>'callable'], -'Ds\Set::first' => ['mixed'], -'Ds\Set::get' => ['mixed', 'index'=>'int'], -'Ds\Set::intersect' => ['Ds\Set', 'set'=>'Ds\Set'], -'Ds\Set::join' => ['string', 'glue='=>'string'], -'Ds\Set::last' => ['mixed'], -'Ds\Set::merge' => ['Ds\Set', 'values'=>'mixed'], -'Ds\Set::reduce' => ['mixed', 'callback'=>'callable', 'initial='=>'mixed'], -'Ds\Set::remove' => ['void', '...values='=>'mixed'], -'Ds\Set::reverse' => ['void'], -'Ds\Set::reversed' => ['Ds\Set'], -'Ds\Set::slice' => ['Ds\Set', 'index'=>'int', 'length='=>'?int'], -'Ds\Set::sort' => ['void', 'comparator='=>'callable'], -'Ds\Set::sorted' => ['Ds\Set', 'comparator='=>'callable'], -'Ds\Set::sum' => ['int|float'], -'Ds\Set::union' => ['?Ds\Set', 'set'=>'Ds\Set'], -'Ds\Set::xor' => ['Ds\Set', 'set'=>'Ds\Set'], -'Ds\Set::clear' => ['void'], -'Ds\Set::copy' => ['Ds\Set'], -'Ds\Set::count' => ['int'], -'Ds\Set::isEmpty' => ['bool'], -'Ds\Set::jsonSerialize' => ['array'], -'Ds\Set::toArray' => ['array'], -'Ds\Stack::__construct' => ['void', 'values='=>'mixed'], -'Ds\Stack::allocate' => ['void', 'capacity'=>'int'], -'Ds\Stack::capacity' => ['int'], -'Ds\Stack::peek' => ['mixed'], -'Ds\Stack::pop' => ['mixed'], -'Ds\Stack::push' => ['void', '...values='=>'mixed'], -'Ds\Stack::clear' => ['void'], -'Ds\Stack::copy' => ['Ds\Stack'], -'Ds\Stack::count' => ['int'], -'Ds\Stack::isEmpty' => ['bool'], -'Ds\Stack::jsonSerialize' => ['array'], -'Ds\Stack::toArray' => ['array'], -'Ds\Queue::__construct' => ['void', 'values='=>'mixed'], -'Ds\Queue::allocate' => ['void', 'capacity'=>'int'], -'Ds\Queue::capacity' => ['int'], -'Ds\Queue::peek' => ['mixed'], -'Ds\Queue::pop' => ['mixed'], -'Ds\Queue::push' => ['void', '...values='=>'mixed'], -'Ds\Queue::clear' => ['void'], -'Ds\Queue::copy' => ['Ds\Queue'], -'Ds\Queue::count' => ['int'], -'Ds\Queue::isEmpty' => ['bool'], -'Ds\Queue::jsonSerialize' => ['array'], -'Ds\Queue::toArray' => ['array'], -'Ds\PriorityQueue::__construct' => ['void'], -'Ds\PriorityQueue::allocate' => ['void', 'capacity'=>'int'], -'Ds\PriorityQueue::capacity' => ['int'], -'Ds\PriorityQueue::peek' => ['mixed'], -'Ds\PriorityQueue::pop' => ['mixed'], -'Ds\PriorityQueue::push' => ['void', 'value'=>'mixed', 'priority'=>'int'], -'Ds\PriorityQueue::clear' => ['void'], -'Ds\PriorityQueue::copy' => ['Ds\PriorityQueue'], -'Ds\PriorityQueue::count' => ['int'], -'Ds\PriorityQueue::isEmpty' => ['bool'], -'Ds\PriorityQueue::jsonSerialize' => ['array'], -'Ds\PriorityQueue::toArray' => ['array'], -'each' => ['array', '&rw_arr'=>'array'], -'easter_date' => ['int', 'year='=>'int'], -'easter_days' => ['int', 'year='=>'int', 'method='=>'int'], -'echo' => ['void', 'arg1'=>'string', '...args='=>'string'], -'eio_busy' => ['resource', 'delay'=>'int', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'], -'eio_cancel' => ['void', 'req'=>'resource'], -'eio_chmod' => ['resource', 'path'=>'string', 'mode'=>'int', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'], -'eio_chown' => ['resource', 'path'=>'string', 'uid'=>'int', 'gid='=>'int', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'], -'eio_close' => ['resource', 'fd'=>'mixed', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'], -'eio_custom' => ['resource', 'execute'=>'callable', 'pri'=>'int', 'callback'=>'callable', 'data='=>'mixed'], -'eio_dup2' => ['resource', 'fd'=>'mixed', 'fd2'=>'mixed', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'], -'eio_event_loop' => ['bool'], -'eio_fallocate' => ['resource', 'fd'=>'mixed', 'mode'=>'int', 'offset'=>'int', 'length'=>'int', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'], -'eio_fchmod' => ['resource', 'fd'=>'mixed', 'mode'=>'int', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'], -'eio_fchown' => ['resource', 'fd'=>'mixed', 'uid'=>'int', 'gid='=>'int', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'], -'eio_fdatasync' => ['resource', 'fd'=>'mixed', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'], -'eio_fstat' => ['resource', 'fd'=>'mixed', 'pri'=>'int', 'callback'=>'callable', 'data='=>'mixed'], -'eio_fstatvfs' => ['resource', 'fd'=>'mixed', 'pri'=>'int', 'callback'=>'callable', 'data='=>'mixed'], -'eio_fsync' => ['resource', 'fd'=>'mixed', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'], -'eio_ftruncate' => ['resource', 'fd'=>'mixed', 'offset='=>'int', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'], -'eio_futime' => ['resource', 'fd'=>'mixed', 'atime'=>'float', 'mtime'=>'float', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'], -'eio_get_event_stream' => ['mixed'], -'eio_get_last_error' => ['string', 'req'=>'resource'], -'eio_grp' => ['resource', 'callback'=>'callable', 'data='=>'string'], -'eio_grp_add' => ['void', 'grp'=>'resource', 'req'=>'resource'], -'eio_grp_cancel' => ['void', 'grp'=>'resource'], -'eio_grp_limit' => ['void', 'grp'=>'resource', 'limit'=>'int'], -'eio_init' => ['void'], -'eio_link' => ['resource', 'path'=>'string', 'new_path'=>'string', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'], -'eio_lstat' => ['resource', 'path'=>'string', 'pri'=>'int', 'callback'=>'callable', 'data='=>'mixed'], -'eio_mkdir' => ['resource', 'path'=>'string', 'mode'=>'int', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'], -'eio_mknod' => ['resource', 'path'=>'string', 'mode'=>'int', 'dev'=>'int', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'], -'eio_nop' => ['resource', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'], -'eio_npending' => ['int'], -'eio_nready' => ['int'], -'eio_nreqs' => ['int'], -'eio_nthreads' => ['int'], -'eio_open' => ['resource', 'path'=>'string', 'flags'=>'int', 'mode'=>'int', 'pri'=>'int', 'callback'=>'callable', 'data='=>'mixed'], -'eio_poll' => ['int'], -'eio_read' => ['resource', 'fd'=>'mixed', 'length'=>'int', 'offset'=>'int', 'pri'=>'int', 'callback'=>'callable', 'data='=>'mixed'], -'eio_readahead' => ['resource', 'fd'=>'mixed', 'offset'=>'int', 'length'=>'int', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'], -'eio_readdir' => ['resource', 'path'=>'string', 'flags'=>'int', 'pri'=>'int', 'callback'=>'callable', 'data='=>'string'], -'eio_readlink' => ['resource', 'path'=>'string', 'pri'=>'int', 'callback'=>'callable', 'data='=>'string'], -'eio_realpath' => ['resource', 'path'=>'string', 'pri'=>'int', 'callback'=>'callable', 'data='=>'string'], -'eio_rename' => ['resource', 'path'=>'string', 'new_path'=>'string', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'], -'eio_rmdir' => ['resource', 'path'=>'string', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'], -'eio_seek' => ['resource', 'fd'=>'mixed', 'offset'=>'int', 'whence'=>'int', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'], -'eio_sendfile' => ['resource', 'out_fd'=>'mixed', 'in_fd'=>'mixed', 'offset'=>'int', 'length'=>'int', 'pri='=>'int', 'callback='=>'callable', 'data='=>'string'], -'eio_set_max_idle' => ['void', 'nthreads'=>'int'], -'eio_set_max_parallel' => ['void', 'nthreads'=>'int'], -'eio_set_max_poll_reqs' => ['void', 'nreqs'=>'int'], -'eio_set_max_poll_time' => ['void', 'nseconds'=>'float'], -'eio_set_min_parallel' => ['void', 'nthreads'=>'string'], -'eio_stat' => ['resource', 'path'=>'string', 'pri'=>'int', 'callback'=>'callable', 'data='=>'mixed'], -'eio_statvfs' => ['resource', 'path'=>'string', 'pri'=>'int', 'callback'=>'callable', 'data='=>'mixed'], -'eio_symlink' => ['resource', 'path'=>'string', 'new_path'=>'string', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'], -'eio_sync' => ['resource', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'], -'eio_sync_file_range' => ['resource', 'fd'=>'mixed', 'offset'=>'int', 'nbytes'=>'int', 'flags'=>'int', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'], -'eio_syncfs' => ['resource', 'fd'=>'mixed', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'], -'eio_truncate' => ['resource', 'path'=>'string', 'offset='=>'int', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'], -'eio_unlink' => ['resource', 'path'=>'string', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'], -'eio_utime' => ['resource', 'path'=>'string', 'atime'=>'float', 'mtime'=>'float', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'], -'eio_write' => ['resource', 'fd'=>'mixed', 'str'=>'string', 'length='=>'int', 'offset='=>'int', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'], -'empty' => ['bool', 'var'=>'mixed'], -'EmptyIterator::current' => ['mixed'], -'EmptyIterator::key' => ['mixed'], -'EmptyIterator::next' => ['void'], -'EmptyIterator::rewind' => ['void'], -'EmptyIterator::valid' => ['bool'], -'enchant_broker_describe' => ['array', 'broker'=>'resource'], -'enchant_broker_dict_exists' => ['bool', 'broker'=>'resource', 'tag'=>'string'], -'enchant_broker_free' => ['bool', 'broker'=>'resource'], -'enchant_broker_free_dict' => ['bool', 'dict'=>'resource'], -'enchant_broker_get_dict_path' => ['string', 'broker'=>'resource', 'dict_type'=>'int'], -'enchant_broker_get_error' => ['string', 'broker'=>'resource'], -'enchant_broker_init' => ['resource'], -'enchant_broker_list_dicts' => ['string', 'broker'=>'resource'], -'enchant_broker_request_dict' => ['resource', 'broker'=>'resource', 'tag'=>'string'], -'enchant_broker_request_pwl_dict' => ['resource', 'broker'=>'resource', 'filename'=>'string'], -'enchant_broker_set_dict_path' => ['bool', 'broker'=>'resource', 'dict_type'=>'int', 'value'=>'string'], -'enchant_broker_set_ordering' => ['bool', 'broker'=>'resource', 'tag'=>'string', 'ordering'=>'string'], -'enchant_dict_add_to_personal' => ['void', 'dict'=>'resource', 'word'=>'string'], -'enchant_dict_add_to_session' => ['void', 'dict'=>'resource', 'word'=>'string'], -'enchant_dict_check' => ['bool', 'dict'=>'resource', 'word'=>'string'], -'enchant_dict_describe' => ['array', 'dict'=>'resource'], -'enchant_dict_get_error' => ['string', 'dict'=>'resource'], -'enchant_dict_is_in_session' => ['bool', 'dict'=>'resource', 'word'=>'string'], -'enchant_dict_quick_check' => ['bool', 'dict'=>'resource', 'word'=>'string', 'suggestions='=>'array'], -'enchant_dict_store_replacement' => ['void', 'dict'=>'resource', 'mis'=>'string', 'cor'=>'string'], -'enchant_dict_suggest' => ['array', 'dict'=>'resource', 'word'=>'string'], -'end' => ['mixed', '&rw_array_arg'=>'array|object'], -'ereg' => ['int', 'pattern'=>'string', 'string'=>'string', 'regs='=>'array'], -'ereg_replace' => ['string', 'pattern'=>'string', 'replacement'=>'string', 'string'=>'string'], -'eregi' => ['int', 'pattern'=>'string', 'string'=>'string', 'regs='=>'array'], -'eregi_replace' => ['string', 'pattern'=>'string', 'replacement'=>'string', 'string'=>'string'], -'Error::__clone' => ['void'], -'Error::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'(?Throwable)|(?Error)'], -'Error::__toString' => ['string'], -'Error::getCode' => ['int'], -'Error::getFile' => ['string'], -'Error::getLine' => ['int'], -'Error::getMessage' => ['string'], -'Error::getPrevious' => ['Throwable|Error|null'], -'Error::getTrace' => ['array'], -'Error::getTraceAsString' => ['string'], -'error_clear_last' => ['void'], -'error_get_last' => ['?array{type:int,message:string,file:string,line:int}'], -'error_log' => ['bool', 'message'=>'string', 'message_type='=>'int', 'destination='=>'string', 'extra_headers='=>'string'], -'error_reporting' => ['int', 'new_error_level='=>'int'], -'ErrorException::__clone' => ['void'], -'ErrorException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'severity='=>'int', 'filename='=>'string', 'lineno='=>'int', 'previous='=>'(?Throwable)|(?ErrorException)'], -'ErrorException::__toString' => ['string'], -'ErrorException::getCode' => ['int'], -'ErrorException::getFile' => ['string'], -'ErrorException::getLine' => ['int'], -'ErrorException::getMessage' => ['string'], -'ErrorException::getPrevious' => ['Throwable|ErrorException|null'], -'ErrorException::getSeverity' => ['int'], -'ErrorException::getTrace' => ['array'], -'ErrorException::getTraceAsString' => ['string'], -'escapeshellarg' => ['string', 'arg'=>'string'], -'escapeshellcmd' => ['string', 'command'=>'string'], -'Ev::backend' => ['int'], -'Ev::depth' => ['int'], -'Ev::embeddableBackends' => ['void'], -'Ev::feedSignal' => ['void', 'signum'=>'int'], -'Ev::feedSignalEvent' => ['void', 'signum'=>'int'], -'Ev::iteration' => ['int'], -'Ev::now' => ['float'], -'Ev::nowUpdate' => ['void'], -'Ev::recommendedBackends' => ['void'], -'Ev::resume' => ['void'], -'Ev::run' => ['void', 'flags='=>'int'], -'Ev::sleep' => ['void', 'seconds'=>'float'], -'Ev::stop' => ['void', 'how='=>'int'], -'Ev::supportedBackends' => ['void'], -'Ev::suspend' => ['void'], -'Ev::time' => ['float'], -'Ev::verify' => ['void'], -'eval' => ['mixed', 'code_str'=>'string'], -'EvCheck::__construct' => ['void', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'], -'EvCheck::createStopped' => ['object', 'callback'=>'string', 'data='=>'string', 'priority='=>'string'], -'EvChild::__construct' => ['void', 'pid'=>'int', 'trace'=>'bool', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'], -'EvChild::createStopped' => ['object', 'pid'=>'int', 'trace'=>'bool', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'], -'EvChild::set' => ['void', 'pid'=>'int', 'trace'=>'bool'], -'EvEmbed::__construct' => ['void', 'other'=>'object', 'callback='=>'callable', 'data='=>'mixed', 'priority='=>'int'], -'EvEmbed::createStopped' => ['void', 'other'=>'object', 'callback='=>'callable', 'data='=>'mixed', 'priority='=>'int'], -'EvEmbed::set' => ['void', 'other'=>'object'], -'EvEmbed::sweep' => ['void'], -'Event::__construct' => ['void', 'base'=>'EventBase', 'fd'=>'mixed', 'what'=>'int', 'cb'=>'callable', 'arg='=>'mixed'], -'Event::add' => ['bool', 'timeout='=>'float'], -'Event::addSignal' => ['bool', 'timeout='=>'float'], -'Event::addTimer' => ['bool', 'timeout='=>'float'], -'Event::del' => ['bool'], -'Event::delSignal' => ['bool'], -'Event::delTimer' => ['bool'], -'Event::free' => ['void'], -'Event::getSupportedMethods' => ['array'], -'Event::pending' => ['bool', 'flags'=>'int'], -'Event::set' => ['bool', 'base'=>'EventBase', 'fd'=>'mixed', 'what='=>'int', 'cb='=>'callable', 'arg='=>'mixed'], -'Event::setPriority' => ['bool', 'priority'=>'int'], -'Event::setTimer' => ['bool', 'base'=>'EventBase', 'cb'=>'callable', 'arg='=>'mixed'], -'Event::signal' => ['Event', 'base'=>'EventBase', 'signum'=>'int', 'cb'=>'callable', 'arg='=>'mixed'], -'Event::timer' => ['Event', 'base'=>'EventBase', 'cb'=>'callable', 'arg='=>'mixed'], -'event_add' => ['bool', 'event'=>'resource', 'timeout='=>'int'], -'event_base_free' => ['void', 'event_base'=>'resource'], -'event_base_loop' => ['int', 'event_base'=>'resource', 'flags='=>'int'], -'event_base_loopbreak' => ['bool', 'event_base'=>'resource'], -'event_base_loopexit' => ['bool', 'event_base'=>'resource', 'timeout='=>'int'], -'event_base_new' => ['resource'], -'event_base_priority_init' => ['bool', 'event_base'=>'resource', 'npriorities'=>'int'], -'event_base_reinit' => ['bool', 'event_base'=>'resource'], -'event_base_set' => ['bool', 'event'=>'resource', 'event_base'=>'resource'], -'event_buffer_base_set' => ['bool', 'bevent'=>'resource', 'event_base'=>'resource'], -'event_buffer_disable' => ['bool', 'bevent'=>'resource', 'events'=>'int'], -'event_buffer_enable' => ['bool', 'bevent'=>'resource', 'events'=>'int'], -'event_buffer_fd_set' => ['void', 'bevent'=>'resource', 'fd'=>'resource'], -'event_buffer_free' => ['void', 'bevent'=>'resource'], -'event_buffer_new' => ['resource', 'stream'=>'resource', 'readcb'=>'mixed', 'writecb'=>'mixed', 'errorcb'=>'mixed', 'arg='=>'mixed'], -'event_buffer_priority_set' => ['bool', 'bevent'=>'resource', 'priority'=>'int'], -'event_buffer_read' => ['string', 'bevent'=>'resource', 'data_size'=>'int'], -'event_buffer_set_callback' => ['bool', 'event'=>'resource', 'readcb'=>'mixed', 'writecb'=>'mixed', 'errorcb'=>'mixed', 'arg='=>'mixed'], -'event_buffer_timeout_set' => ['void', 'bevent'=>'resource', 'read_timeout'=>'int', 'write_timeout'=>'int'], -'event_buffer_watermark_set' => ['void', 'bevent'=>'resource', 'events'=>'int', 'lowmark'=>'int', 'highmark'=>'int'], -'event_buffer_write' => ['bool', 'bevent'=>'resource', 'data'=>'string', 'data_size='=>'int'], -'event_del' => ['bool', 'event'=>'resource'], -'event_free' => ['void', 'event'=>'resource'], -'event_new' => ['resource'], -'event_priority_set' => ['bool', 'event'=>'resource', 'priority'=>'int'], -'event_set' => ['bool', 'event'=>'resource', 'fd'=>'mixed', 'events'=>'int', 'callback'=>'mixed', 'arg='=>'mixed'], -'event_timer_add' => ['bool', 'event'=>'resource', 'timeout='=>'int'], -'event_timer_del' => ['bool', 'event'=>'resource'], -'event_timer_new' => ['bool|resource'], -'event_timer_pending' => ['bool', 'event'=>'resource', 'timeout='=>'int'], -'event_timer_set' => ['bool', 'event'=>'resource', 'callback'=>'callable', 'arg='=>'mixed'], -'EventBase::__construct' => ['void', 'cfg='=>'EventConfig'], -'EventBase::dispatch' => ['void'], -'EventBase::exit' => ['bool', 'timeout='=>'float'], -'EventBase::free' => ['void'], -'EventBase::getFeatures' => ['int'], -'EventBase::getMethod' => ['string', 'cfg='=>'EventConfig'], -'EventBase::getTimeOfDayCached' => ['float'], -'EventBase::gotExit' => ['bool'], -'EventBase::gotStop' => ['bool'], -'EventBase::loop' => ['bool', 'flags='=>'int'], -'EventBase::priorityInit' => ['bool', 'n_priorities'=>'int'], -'EventBase::reInit' => ['bool'], -'EventBase::stop' => ['bool'], -'EventBuffer::__construct' => ['void'], -'EventBuffer::add' => ['bool', 'data'=>'string'], -'EventBuffer::addBuffer' => ['bool', 'buf'=>'EventBuffer'], -'EventBuffer::appendFrom' => ['int', 'buf'=>'EventBuffer', 'len'=>'int'], -'EventBuffer::copyout' => ['int', '&w_data'=>'string', 'max_bytes'=>'int'], -'EventBuffer::drain' => ['bool', 'len'=>'int'], -'EventBuffer::enableLocking' => ['void'], -'EventBuffer::expand' => ['bool', 'len'=>'int'], -'EventBuffer::freeze' => ['bool', 'at_front'=>'bool'], -'EventBuffer::lock' => ['void'], -'EventBuffer::prepend' => ['bool', 'data'=>'string'], -'EventBuffer::prependBuffer' => ['bool', 'buf'=>'EventBuffer'], -'EventBuffer::pullup' => ['string', 'size'=>'int'], -'EventBuffer::read' => ['string', 'max_bytes'=>'int'], -'EventBuffer::readFrom' => ['int', 'fd'=>'mixed', 'howmuch'=>'int'], -'EventBuffer::readLine' => ['string', 'eol_style'=>'int'], -'EventBuffer::search' => ['mixed', 'what'=>'string', 'start='=>'int', 'end='=>'int'], -'EventBuffer::searchEol' => ['mixed', 'start='=>'int', 'eol_style='=>'int'], -'EventBuffer::substr' => ['string', 'start'=>'int', 'length='=>'int'], -'EventBuffer::unfreeze' => ['bool', 'at_front'=>'bool'], -'EventBuffer::unlock' => ['bool'], -'EventBuffer::write' => ['int', 'fd'=>'mixed', 'howmuch='=>'int'], -'EventBufferEvent::__construct' => ['void', 'base'=>'EventBase', 'socket='=>'mixed', 'options='=>'int', 'readcb='=>'callable', 'writecb='=>'callable', 'eventcb='=>'callable'], -'EventBufferEvent::close' => ['void'], -'EventBufferEvent::connect' => ['bool', 'addr'=>'string'], -'EventBufferEvent::connectHost' => ['bool', 'dns_base'=>'EventDnsBase', 'hostname'=>'string', 'port'=>'int', 'family='=>'int'], -'EventBufferEvent::createPair' => ['array', 'base'=>'EventBase', 'options='=>'int'], -'EventBufferEvent::disable' => ['bool', 'events'=>'int'], -'EventBufferEvent::enable' => ['bool', 'events'=>'int'], -'EventBufferEvent::free' => ['void'], -'EventBufferEvent::getDnsErrorString' => ['string'], -'EventBufferEvent::getEnabled' => ['int'], -'EventBufferEvent::getInput' => ['EventBuffer'], -'EventBufferEvent::getOutput' => ['EventBuffer'], -'EventBufferEvent::read' => ['string', 'size'=>'int'], -'EventBufferEvent::readBuffer' => ['bool', 'buf'=>'EventBuffer'], -'EventBufferEvent::setCallbacks' => ['void', 'readcb'=>'callable', 'writecb'=>'callable', 'eventcb'=>'callable', 'arg='=>'string'], -'EventBufferEvent::setPriority' => ['bool', 'priority'=>'int'], -'EventBufferEvent::setTimeouts' => ['bool', 'timeout_read'=>'float', 'timeout_write'=>'float'], -'EventBufferEvent::setWatermark' => ['void', 'events'=>'int', 'lowmark'=>'int', 'highmark'=>'int'], -'EventBufferEvent::sslError' => ['string'], -'EventBufferEvent::sslFilter' => ['EventBufferEvent', 'base'=>'EventBase', 'underlying'=>'EventBufferEvent', 'ctx'=>'EventSslContext', 'state'=>'int', 'options='=>'int'], -'EventBufferEvent::sslGetCipherInfo' => ['string'], -'EventBufferEvent::sslGetCipherName' => ['string'], -'EventBufferEvent::sslGetCipherVersion' => ['string'], -'EventBufferEvent::sslGetProtocol' => ['string'], -'EventBufferEvent::sslRenegotiate' => ['void'], -'EventBufferEvent::sslSocket' => ['EventBufferEvent', 'base'=>'EventBase', 'socket'=>'mixed', 'ctx'=>'EventSslContext', 'state'=>'int', 'options='=>'int'], -'EventBufferEvent::write' => ['bool', 'data'=>'string'], -'EventBufferEvent::writeBuffer' => ['bool', 'buf'=>'EventBuffer'], -'EventConfig::__construct' => ['void'], -'EventConfig::avoidMethod' => ['bool', 'method'=>'string'], -'EventConfig::requireFeatures' => ['bool', 'feature'=>'int'], -'EventConfig::setMaxDispatchInterval' => ['void', 'max_interval'=>'int', 'max_callbacks'=>'int', 'min_priority'=>'int'], -'EventDnsBase::__construct' => ['void', 'base'=>'EventBase', 'initialize'=>'bool'], -'EventDnsBase::addNameserverIp' => ['bool', 'ip'=>'string'], -'EventDnsBase::addSearch' => ['void', 'domain'=>'string'], -'EventDnsBase::clearSearch' => ['void'], -'EventDnsBase::countNameservers' => ['int'], -'EventDnsBase::loadHosts' => ['bool', 'hosts'=>'string'], -'EventDnsBase::parseResolvConf' => ['bool', 'flags'=>'int', 'filename'=>'string'], -'EventDnsBase::setOption' => ['bool', 'option'=>'string', 'value'=>'string'], -'EventDnsBase::setSearchNdots' => ['bool', 'ndots'=>'int'], -'EventHttp::__construct' => ['void', 'base'=>'EventBase', 'ctx='=>'EventSslContext'], -'EventHttp::accept' => ['bool', 'socket'=>'mixed'], -'EventHttp::addServerAlias' => ['bool', 'alias'=>'string'], -'EventHttp::bind' => ['void', 'address'=>'string', 'port'=>'int'], -'EventHttp::removeServerAlias' => ['bool', 'alias'=>'string'], -'EventHttp::setAllowedMethods' => ['void', 'methods'=>'int'], -'EventHttp::setCallback' => ['void', 'path'=>'string', 'cb'=>'string', 'arg='=>'string'], -'EventHttp::setDefaultCallback' => ['void', 'cb'=>'string', 'arg='=>'string'], -'EventHttp::setMaxBodySize' => ['void', 'value'=>'int'], -'EventHttp::setMaxHeadersSize' => ['void', 'value'=>'int'], -'EventHttp::setTimeout' => ['void', 'value'=>'int'], -'EventHttpConnection::__construct' => ['void', 'base'=>'EventBase', 'dns_base'=>'EventDnsBase', 'address'=>'string', 'port'=>'int', 'ctx='=>'EventSslContext'], -'EventHttpConnection::getBase' => ['EventBase'], -'EventHttpConnection::getPeer' => ['void', '&w_address'=>'string', '&w_port'=>'int'], -'EventHttpConnection::makeRequest' => ['bool', 'req'=>'EventHttpRequest', 'type'=>'int', 'uri'=>'string'], -'EventHttpConnection::setCloseCallback' => ['void', 'callback'=>'callable', 'data='=>'mixed'], -'EventHttpConnection::setLocalAddress' => ['void', 'address'=>'string'], -'EventHttpConnection::setLocalPort' => ['void', 'port'=>'int'], -'EventHttpConnection::setMaxBodySize' => ['void', 'max_size'=>'string'], -'EventHttpConnection::setMaxHeadersSize' => ['void', 'max_size'=>'string'], -'EventHttpConnection::setRetries' => ['void', 'retries'=>'int'], -'EventHttpConnection::setTimeout' => ['void', 'timeout'=>'int'], -'EventHttpRequest::__construct' => ['void', 'callback'=>'callable', 'data='=>'mixed'], -'EventHttpRequest::addHeader' => ['bool', 'key'=>'string', 'value'=>'string', 'type'=>'int'], -'EventHttpRequest::cancel' => ['void'], -'EventHttpRequest::clearHeaders' => ['void'], -'EventHttpRequest::closeConnection' => ['void'], -'EventHttpRequest::findHeader' => ['void', 'key'=>'string', 'type'=>'string'], -'EventHttpRequest::free' => ['void'], -'EventHttpRequest::getBufferEvent' => ['EventBufferEvent'], -'EventHttpRequest::getCommand' => ['void'], -'EventHttpRequest::getConnection' => ['EventHttpConnection'], -'EventHttpRequest::getHost' => ['string'], -'EventHttpRequest::getInputBuffer' => ['EventBuffer'], -'EventHttpRequest::getInputHeaders' => ['array'], -'EventHttpRequest::getOutputBuffer' => ['EventBuffer'], -'EventHttpRequest::getOutputHeaders' => ['void'], -'EventHttpRequest::getResponseCode' => ['int'], -'EventHttpRequest::getUri' => ['string'], -'EventHttpRequest::removeHeader' => ['void', 'key'=>'string', 'type'=>'string'], -'EventHttpRequest::sendError' => ['void', 'error'=>'int', 'reason='=>'string'], -'EventHttpRequest::sendReply' => ['void', 'code'=>'int', 'reason'=>'string', 'buf='=>'EventBuffer'], -'EventHttpRequest::sendReplyChunk' => ['void', 'buf'=>'EventBuffer'], -'EventHttpRequest::sendReplyEnd' => ['void'], -'EventHttpRequest::sendReplyStart' => ['void', 'code'=>'int', 'reason'=>'string'], -'EventListener::__construct' => ['void', 'base'=>'EventBase', 'cb'=>'callable', 'data'=>'mixed', 'flags'=>'int', 'backlog'=>'int', 'target'=>'mixed'], -'EventListener::disable' => ['bool'], -'EventListener::enable' => ['bool'], -'EventListener::getBase' => ['void'], -'EventListener::getSocketName' => ['bool', '&w_address'=>'string', '&w_port='=>'mixed'], -'EventListener::setCallback' => ['void', 'cb'=>'callable', 'arg='=>'mixed'], -'EventListener::setErrorCallback' => ['void', 'cb'=>'string'], -'EventSslContext::__construct' => ['void', 'method'=>'string', 'options'=>'string'], -'EventUtil::__construct' => ['void'], -'EventUtil::getLastSocketErrno' => ['int', 'socket='=>'mixed'], -'EventUtil::getLastSocketError' => ['string', 'socket='=>'mixed'], -'EventUtil::getSocketFd' => ['int', 'socket'=>'mixed'], -'EventUtil::getSocketName' => ['bool', 'socket'=>'mixed', '&w_address'=>'string', '&w_port='=>'mixed'], -'EventUtil::setSocketOption' => ['bool', 'socket'=>'mixed', 'level'=>'int', 'optname'=>'int', 'optval'=>'mixed'], -'EventUtil::sslRandPoll' => ['void'], -'EvFork::__construct' => ['void', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'], -'EvFork::createStopped' => ['object', 'callback'=>'string', 'data='=>'string', 'priority='=>'string'], -'EvIdle::__construct' => ['void', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'], -'EvIdle::createStopped' => ['object', 'callback'=>'string', 'data='=>'mixed', 'priority='=>'int'], -'EvIo::__construct' => ['void', 'fd'=>'mixed', 'events'=>'int', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'], -'EvIo::createStopped' => ['EvIo', 'fd'=>'mixed', 'events'=>'int', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'], -'EvIo::set' => ['void', 'fd'=>'mixed', 'events'=>'int'], -'EvLoop::__construct' => ['void', 'flags='=>'int', 'data='=>'mixed', 'io_interval='=>'float', 'timeout_interval='=>'float'], -'EvLoop::backend' => ['int'], -'EvLoop::check' => ['EvCheck', 'callback'=>'string', 'data='=>'string', 'priority='=>'string'], -'EvLoop::child' => ['EvChild', 'pid'=>'string', 'trace'=>'string', 'callback'=>'string', 'data='=>'string', 'priority='=>'string'], -'EvLoop::defaultLoop' => ['EvLoop', 'flags='=>'int', 'data='=>'mixed', 'io_interval='=>'float', 'timeout_interval='=>'float'], -'EvLoop::embed' => ['EvEmbed', 'other'=>'string', 'callback='=>'string', 'data='=>'string', 'priority='=>'string'], -'EvLoop::fork' => ['EvFork', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'], -'EvLoop::idle' => ['EvIdle', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'], -'EvLoop::invokePending' => ['void'], -'EvLoop::io' => ['EvIo', 'fd'=>'mixed', 'events'=>'int', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'], -'EvLoop::loopFork' => ['void'], -'EvLoop::now' => ['float'], -'EvLoop::nowUpdate' => ['void'], -'EvLoop::periodic' => ['EvPeriodic', 'offset'=>'float', 'interval'=>'float', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'], -'EvLoop::prepare' => ['EvPrepare', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'], -'EvLoop::resume' => ['void'], -'EvLoop::run' => ['void', 'flags='=>'int'], -'EvLoop::signal' => ['EvSignal', 'signum'=>'int', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'], -'EvLoop::stat' => ['EvStat', 'path'=>'string', 'interval'=>'float', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'], -'EvLoop::stop' => ['void', 'how='=>'int'], -'EvLoop::suspend' => ['void'], -'EvLoop::timer' => ['EvTimer', 'after'=>'float', 'repeat'=>'float', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'], -'EvLoop::verify' => ['void'], -'EvPeriodic::__construct' => ['void', 'offset'=>'float', 'interval'=>'string', 'reschedule_cb'=>'callable', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'], -'EvPeriodic::again' => ['void'], -'EvPeriodic::at' => ['float'], -'EvPeriodic::createStopped' => ['EvPeriodic', 'offset'=>'float', 'interval'=>'float', 'reschedule_cb'=>'callable', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'], -'EvPeriodic::set' => ['void', 'offset'=>'float', 'interval'=>'float'], -'EvPrepare::__construct' => ['void', 'callback'=>'string', 'data='=>'string', 'priority='=>'string'], -'EvPrepare::createStopped' => ['EvPrepare', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'], -'EvSignal::__construct' => ['void', 'signum'=>'int', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'], -'EvSignal::createStopped' => ['EvSignal', 'signum'=>'int', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'], -'EvSignal::set' => ['void', 'signum'=>'int'], -'EvStat::__construct' => ['void', 'path'=>'string', 'interval'=>'float', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'], -'EvStat::attr' => ['array'], -'EvStat::createStopped' => ['void', 'path'=>'string', 'interval'=>'float', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'], -'EvStat::prev' => ['void'], -'EvStat::set' => ['void', 'path'=>'string', 'interval'=>'float'], -'EvStat::stat' => ['bool'], -'EvTimer::__construct' => ['void', 'after'=>'float', 'repeat'=>'float', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'], -'EvTimer::again' => ['void'], -'EvTimer::createStopped' => ['EvTimer', 'after'=>'float', 'repeat'=>'float', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'], -'EvTimer::set' => ['void', 'after'=>'float', 'repeat'=>'float'], -'EvWatcher::__construct' => ['void'], -'EvWatcher::clear' => ['int'], -'EvWatcher::feed' => ['void', 'revents'=>'int'], -'EvWatcher::getLoop' => ['EvLoop'], -'EvWatcher::invoke' => ['void', 'revents'=>'int'], -'EvWatcher::keepalive' => ['bool', 'value='=>'bool'], -'EvWatcher::setCallback' => ['void', 'callback'=>'callable'], -'EvWatcher::start' => ['void'], -'EvWatcher::stop' => ['void'], -'Exception::__clone' => ['void'], -'Exception::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'(?Throwable)|(?Exception)'], -'Exception::__toString' => ['string'], -'Exception::getCode' => ['mixed'], -'Exception::getFile' => ['string'], -'Exception::getLine' => ['int'], -'Exception::getMessage' => ['string'], -'Exception::getPrevious' => ['(?Throwable)|(?Exception)'], -'Exception::getTrace' => ['array'], -'Exception::getTraceAsString' => ['string'], -'exec' => ['string', 'command'=>'string', '&w_output='=>'array', '&w_return_value='=>'int'], -'exif_imagetype' => ['int|false', 'imagefile'=>'string'], -'exif_read_data' => ['array|false', 'filename'=>'string', 'sections_needed='=>'string', 'sub_arrays='=>'bool', 'read_thumbnail='=>'bool'], -'exif_tagname' => ['string', 'index'=>'int'], -'exif_thumbnail' => ['string', 'filename'=>'string', '&w_width='=>'int', '&w_height='=>'int', '&w_imagetype='=>'int'], -'exit' => ['', 'status'=>'string|int'], -'exp' => ['float', 'number'=>'float'], -'expect_expectl' => ['int', 'expect'=>'resource', 'cases'=>'array', 'match='=>'array'], -'expect_popen' => ['resource', 'command'=>'string'], -'explode' => ['array|false', 'separator'=>'string', 'str'=>'string', 'limit='=>'int'], -'expm1' => ['float', 'number'=>'float'], -'extension_loaded' => ['bool', 'extension_name'=>'string'], -'extract' => ['int', '&rw_var_array'=>'array', 'extract_type='=>'int', 'prefix='=>'string|null'], -'ezmlm_hash' => ['int', 'addr'=>'string'], -'fam_cancel_monitor' => ['bool', 'fam'=>'resource', 'fam_monitor'=>'resource'], -'fam_close' => ['void', 'fam'=>'resource'], -'fam_monitor_collection' => ['resource', 'fam'=>'resource', 'dirname'=>'string', 'depth'=>'int', 'mask'=>'string'], -'fam_monitor_directory' => ['resource', 'fam'=>'resource', 'dirname'=>'string'], -'fam_monitor_file' => ['resource', 'fam'=>'resource', 'filename'=>'string'], -'fam_next_event' => ['array', 'fam'=>'resource'], -'fam_open' => ['resource', 'appname='=>'string'], -'fam_pending' => ['int', 'fam'=>'resource'], -'fam_resume_monitor' => ['bool', 'fam'=>'resource', 'fam_monitor'=>'resource'], -'fam_suspend_monitor' => ['bool', 'fam'=>'resource', 'fam_monitor'=>'resource'], -'fann_cascadetrain_on_data' => ['bool', 'ann'=>'resource', 'data'=>'resource', 'max_neurons'=>'int', 'neurons_between_reports'=>'int', 'desired_error'=>'float'], -'fann_cascadetrain_on_file' => ['bool', 'ann'=>'resource', 'filename'=>'string', 'max_neurons'=>'int', 'neurons_between_reports'=>'int', 'desired_error'=>'float'], -'fann_clear_scaling_params' => ['bool', 'ann'=>'resource'], -'fann_copy' => ['resource', 'ann'=>'resource'], -'fann_create_from_file' => ['resource', 'configuration_file'=>'string'], -'fann_create_shortcut' => ['reference', 'num_layers'=>'int', 'num_neurons1'=>'int', 'num_neurons2'=>'int', '...args='=>'int'], -'fann_create_shortcut_array' => ['resource', 'num_layers'=>'int', 'layers'=>'array'], -'fann_create_sparse' => ['resource|false', 'connection_rate'=>'float', 'num_layers'=>'int', 'num_neurons1'=>'int', 'num_neurons2'=>'int', '...args='=>'int'], -'fann_create_sparse_array' => ['resource|false', 'connection_rate'=>'float', 'num_layers'=>'int', 'layers'=>'array'], -'fann_create_standard' => ['resource', 'num_layers'=>'int', 'num_neurons1'=>'int', 'num_neurons2'=>'int', '...args='=>'int'], -'fann_create_standard_array' => ['resource', 'num_layers'=>'int', 'layers'=>'array'], -'fann_create_train' => ['resource', 'num_data'=>'int', 'num_input'=>'int', 'num_output'=>'int'], -'fann_create_train_from_callback' => ['resource', 'num_data'=>'int', 'num_input'=>'int', 'num_output'=>'int', 'user_function'=>'callable'], -'fann_descale_input' => ['bool', 'ann'=>'resource', 'input_vector'=>'array'], -'fann_descale_output' => ['bool', 'ann'=>'resource', 'output_vector'=>'array'], -'fann_descale_train' => ['bool', 'ann'=>'resource', 'train_data'=>'resource'], -'fann_destroy' => ['bool', 'ann'=>'resource'], -'fann_destroy_train' => ['bool', 'train_data'=>'resource'], -'fann_duplicate_train_data' => ['resource', 'data'=>'resource'], -'fann_get_activation_function' => ['int', 'ann'=>'resource', 'layer'=>'int', 'neuron'=>'int'], -'fann_get_activation_steepness' => ['float', 'ann'=>'resource', 'layer'=>'int', 'neuron'=>'int'], -'fann_get_bias_array' => ['array', 'ann'=>'resource'], -'fann_get_bit_fail' => ['int', 'ann'=>'resource'], -'fann_get_bit_fail_limit' => ['float', 'ann'=>'resource'], -'fann_get_cascade_activation_functions' => ['array', 'ann'=>'resource'], -'fann_get_cascade_activation_functions_count' => ['int', 'ann'=>'resource'], -'fann_get_cascade_activation_steepnesses' => ['array', 'ann'=>'resource'], -'fann_get_cascade_activation_steepnesses_count' => ['int', 'ann'=>'resource'], -'fann_get_cascade_candidate_change_fraction' => ['float', 'ann'=>'resource'], -'fann_get_cascade_candidate_limit' => ['float', 'ann'=>'resource'], -'fann_get_cascade_candidate_stagnation_epochs' => ['float', 'ann'=>'resource'], -'fann_get_cascade_max_cand_epochs' => ['int', 'ann'=>'resource'], -'fann_get_cascade_max_out_epochs' => ['int', 'ann'=>'resource'], -'fann_get_cascade_min_cand_epochs' => ['int', 'ann'=>'resource'], -'fann_get_cascade_min_out_epochs' => ['int', 'ann'=>'resource'], -'fann_get_cascade_num_candidate_groups' => ['int', 'ann'=>'resource'], -'fann_get_cascade_num_candidates' => ['int', 'ann'=>'resource'], -'fann_get_cascade_output_change_fraction' => ['float', 'ann'=>'resource'], -'fann_get_cascade_output_stagnation_epochs' => ['int', 'ann'=>'resource'], -'fann_get_cascade_weight_multiplier' => ['float', 'ann'=>'resource'], -'fann_get_connection_array' => ['array', 'ann'=>'resource'], -'fann_get_connection_rate' => ['float', 'ann'=>'resource'], -'fann_get_errno' => ['int', 'errdat'=>'resource'], -'fann_get_errstr' => ['string', 'errdat'=>'resource'], -'fann_get_layer_array' => ['array', 'ann'=>'resource'], -'fann_get_learning_momentum' => ['float', 'ann'=>'resource'], -'fann_get_learning_rate' => ['float', 'ann'=>'resource'], -'fann_get_MSE' => ['float', 'ann'=>'resource'], -'fann_get_network_type' => ['int', 'ann'=>'resource'], -'fann_get_num_input' => ['int', 'ann'=>'resource'], -'fann_get_num_layers' => ['int', 'ann'=>'resource'], -'fann_get_num_output' => ['int', 'ann'=>'resource'], -'fann_get_quickprop_decay' => ['float', 'ann'=>'resource'], -'fann_get_quickprop_mu' => ['float', 'ann'=>'resource'], -'fann_get_rprop_decrease_factor' => ['float', 'ann'=>'resource'], -'fann_get_rprop_delta_max' => ['float', 'ann'=>'resource'], -'fann_get_rprop_delta_min' => ['float', 'ann'=>'resource'], -'fann_get_rprop_delta_zero' => ['float|false', 'ann'=>'resource'], -'fann_get_rprop_increase_factor' => ['float', 'ann'=>'resource'], -'fann_get_sarprop_step_error_shift' => ['float', 'ann'=>'resource'], -'fann_get_sarprop_step_error_threshold_factor' => ['float', 'ann'=>'resource'], -'fann_get_sarprop_temperature' => ['float', 'ann'=>'resource'], -'fann_get_sarprop_weight_decay_shift' => ['float', 'ann'=>'resource'], -'fann_get_total_connections' => ['int', 'ann'=>'resource'], -'fann_get_total_neurons' => ['int', 'ann'=>'resource'], -'fann_get_train_error_function' => ['int', 'ann'=>'resource'], -'fann_get_train_stop_function' => ['int', 'ann'=>'resource'], -'fann_get_training_algorithm' => ['int', 'ann'=>'resource'], -'fann_init_weights' => ['bool', 'ann'=>'resource', 'train_data'=>'resource'], -'fann_length_train_data' => ['int', 'data'=>'resource'], -'fann_merge_train_data' => ['resource', 'data1'=>'resource', 'data2'=>'resource'], -'fann_num_input_train_data' => ['int', 'data'=>'resource'], -'fann_num_output_train_data' => ['int', 'data'=>'resource'], -'fann_print_error' => ['void', 'errdat'=>'string'], -'fann_randomize_weights' => ['bool', 'ann'=>'resource', 'min_weight'=>'float', 'max_weight'=>'float'], -'fann_read_train_from_file' => ['resource', 'filename'=>'string'], -'fann_reset_errno' => ['void', 'errdat'=>'resource'], -'fann_reset_errstr' => ['void', 'errdat'=>'resource'], -'fann_reset_MSE' => ['bool', 'ann'=>'string'], -'fann_run' => ['array', 'ann'=>'resource', 'input'=>'array'], -'fann_save' => ['bool', 'ann'=>'resource', 'configuration_file'=>'string'], -'fann_save_train' => ['bool', 'data'=>'resource', 'file_name'=>'string'], -'fann_scale_input' => ['bool', 'ann'=>'resource', 'input_vector'=>'array'], -'fann_scale_input_train_data' => ['bool', 'train_data'=>'resource', 'new_min'=>'float', 'new_max'=>'float'], -'fann_scale_output' => ['bool', 'ann'=>'resource', 'output_vector'=>'array'], -'fann_scale_output_train_data' => ['bool', 'train_data'=>'resource', 'new_min'=>'float', 'new_max'=>'float'], -'fann_scale_train' => ['bool', 'ann'=>'resource', 'train_data'=>'resource'], -'fann_scale_train_data' => ['bool', 'train_data'=>'resource', 'new_min'=>'float', 'new_max'=>'float'], -'fann_set_activation_function' => ['bool', 'ann'=>'resource', 'activation_function'=>'int', 'layer'=>'int', 'neuron'=>'int'], -'fann_set_activation_function_hidden' => ['bool', 'ann'=>'resource', 'activation_function'=>'int'], -'fann_set_activation_function_layer' => ['bool', 'ann'=>'resource', 'activation_function'=>'int', 'layer'=>'int'], -'fann_set_activation_function_output' => ['bool', 'ann'=>'resource', 'activation_function'=>'int'], -'fann_set_activation_steepness' => ['bool', 'ann'=>'resource', 'activation_steepness'=>'float', 'layer'=>'int', 'neuron'=>'int'], -'fann_set_activation_steepness_hidden' => ['bool', 'ann'=>'resource', 'activation_steepness'=>'float'], -'fann_set_activation_steepness_layer' => ['bool', 'ann'=>'resource', 'activation_steepness'=>'float', 'layer'=>'int'], -'fann_set_activation_steepness_output' => ['bool', 'ann'=>'resource', 'activation_steepness'=>'float'], -'fann_set_bit_fail_limit' => ['bool', 'ann'=>'resource', 'bit_fail_limit'=>'float'], -'fann_set_callback' => ['bool', 'ann'=>'resource', 'callback'=>'callable'], -'fann_set_cascade_activation_functions' => ['bool', 'ann'=>'resource', 'cascade_activation_functions'=>'array'], -'fann_set_cascade_activation_steepnesses' => ['bool', 'ann'=>'resource', 'cascade_activation_steepnesses_count'=>'array'], -'fann_set_cascade_candidate_change_fraction' => ['bool', 'ann'=>'resource', 'cascade_candidate_change_fraction'=>'float'], -'fann_set_cascade_candidate_limit' => ['bool', 'ann'=>'resource', 'cascade_candidate_limit'=>'float'], -'fann_set_cascade_candidate_stagnation_epochs' => ['bool', 'ann'=>'resource', 'cascade_candidate_stagnation_epochs'=>'int'], -'fann_set_cascade_max_cand_epochs' => ['bool', 'ann'=>'resource', 'cascade_max_cand_epochs'=>'int'], -'fann_set_cascade_max_out_epochs' => ['bool', 'ann'=>'resource', 'cascade_max_out_epochs'=>'int'], -'fann_set_cascade_min_cand_epochs' => ['bool', 'ann'=>'resource', 'cascade_min_cand_epochs'=>'int'], -'fann_set_cascade_min_out_epochs' => ['bool', 'ann'=>'resource', 'cascade_min_out_epochs'=>'int'], -'fann_set_cascade_num_candidate_groups' => ['bool', 'ann'=>'resource', 'cascade_num_candidate_groups'=>'int'], -'fann_set_cascade_output_change_fraction' => ['bool', 'ann'=>'resource', 'cascade_output_change_fraction'=>'float'], -'fann_set_cascade_output_stagnation_epochs' => ['bool', 'ann'=>'resource', 'cascade_output_stagnation_epochs'=>'int'], -'fann_set_cascade_weight_multiplier' => ['bool', 'ann'=>'resource', 'cascade_weight_multiplier'=>'float'], -'fann_set_error_log' => ['void', 'errdat'=>'resource', 'log_file'=>'string'], -'fann_set_input_scaling_params' => ['bool', 'ann'=>'resource', 'train_data'=>'resource', 'new_input_min'=>'float', 'new_input_max'=>'float'], -'fann_set_learning_momentum' => ['bool', 'ann'=>'resource', 'learning_momentum'=>'float'], -'fann_set_learning_rate' => ['bool', 'ann'=>'resource', 'learning_rate'=>'float'], -'fann_set_output_scaling_params' => ['bool', 'ann'=>'resource', 'train_data'=>'resource', 'new_output_min'=>'float', 'new_output_max'=>'float'], -'fann_set_quickprop_decay' => ['bool', 'ann'=>'resource', 'quickprop_decay'=>'float'], -'fann_set_quickprop_mu' => ['bool', 'ann'=>'resource', 'quickprop_mu'=>'float'], -'fann_set_rprop_decrease_factor' => ['bool', 'ann'=>'resource', 'rprop_decrease_factor'=>'float'], -'fann_set_rprop_delta_max' => ['bool', 'ann'=>'resource', 'rprop_delta_max'=>'float'], -'fann_set_rprop_delta_min' => ['bool', 'ann'=>'resource', 'rprop_delta_min'=>'float'], -'fann_set_rprop_delta_zero' => ['bool', 'ann'=>'resource', 'rprop_delta_zero'=>'float'], -'fann_set_rprop_increase_factor' => ['bool', 'ann'=>'resource', 'rprop_increase_factor'=>'float'], -'fann_set_sarprop_step_error_shift' => ['bool', 'ann'=>'resource', 'sarprop_step_error_shift'=>'float'], -'fann_set_sarprop_step_error_threshold_factor' => ['bool', 'ann'=>'resource', 'sarprop_step_error_threshold_factor'=>'float'], -'fann_set_sarprop_temperature' => ['bool', 'ann'=>'resource', 'sarprop_temperature'=>'float'], -'fann_set_sarprop_weight_decay_shift' => ['bool', 'ann'=>'resource', 'sarprop_weight_decay_shift'=>'float'], -'fann_set_scaling_params' => ['bool', 'ann'=>'resource', 'train_data'=>'resource', 'new_input_min'=>'float', 'new_input_max'=>'float', 'new_output_min'=>'float', 'new_output_max'=>'float'], -'fann_set_train_error_function' => ['bool', 'ann'=>'resource', 'error_function'=>'int'], -'fann_set_train_stop_function' => ['bool', 'ann'=>'resource', 'stop_function'=>'int'], -'fann_set_training_algorithm' => ['bool', 'ann'=>'resource', 'training_algorithm'=>'int'], -'fann_set_weight' => ['bool', 'ann'=>'resource', 'from_neuron'=>'int', 'to_neuron'=>'int', 'weight'=>'float'], -'fann_set_weight_array' => ['bool', 'ann'=>'resource', 'connections'=>'array'], -'fann_shuffle_train_data' => ['bool', 'train_data'=>'resource'], -'fann_subset_train_data' => ['resource', 'data'=>'resource', 'pos'=>'int', 'length'=>'int'], -'fann_test' => ['bool', 'ann'=>'resource', 'input'=>'array', 'desired_output'=>'array'], -'fann_test_data' => ['float', 'ann'=>'resource', 'data'=>'resource'], -'fann_train' => ['bool', 'ann'=>'resource', 'input'=>'array', 'desired_output'=>'array'], -'fann_train_epoch' => ['float', 'ann'=>'resource', 'data'=>'resource'], -'fann_train_on_data' => ['bool', 'ann'=>'resource', 'data'=>'resource', 'max_epochs'=>'int', 'epochs_between_reports'=>'int', 'desired_error'=>'float'], -'fann_train_on_file' => ['bool', 'ann'=>'resource', 'filename'=>'string', 'max_epochs'=>'int', 'epochs_between_reports'=>'int', 'desired_error'=>'float'], -'FANNConnection::__construct' => ['void', 'from_neuron'=>'int', 'to_neuron'=>'int', 'weight'=>'float'], -'FANNConnection::getFromNeuron' => ['int'], -'FANNConnection::getToNeuron' => ['int'], -'FANNConnection::getWeight' => ['void'], -'FANNConnection::setWeight' => ['bool', 'weight'=>'float'], -'fastcgi_finish_request' => ['bool'], -'fbsql_affected_rows' => ['int', 'link_identifier='=>'?resource'], -'fbsql_autocommit' => ['bool', 'link_identifier'=>'resource', 'onoff='=>'bool'], -'fbsql_blob_size' => ['int', 'blob_handle'=>'string', 'link_identifier='=>'?resource'], -'fbsql_change_user' => ['bool', 'user'=>'string', 'password'=>'string', 'database='=>'string', 'link_identifier='=>'?resource'], -'fbsql_clob_size' => ['int', 'clob_handle'=>'string', 'link_identifier='=>'?resource'], -'fbsql_close' => ['bool', 'link_identifier='=>'?resource'], -'fbsql_commit' => ['bool', 'link_identifier='=>'?resource'], -'fbsql_connect' => ['resource', 'hostname='=>'string', 'username='=>'string', 'password='=>'string'], -'fbsql_create_blob' => ['string', 'blob_data'=>'string', 'link_identifier='=>'?resource'], -'fbsql_create_clob' => ['string', 'clob_data'=>'string', 'link_identifier='=>'?resource'], -'fbsql_create_db' => ['bool', 'database_name'=>'string', 'link_identifier='=>'?resource', 'database_options='=>'string'], -'fbsql_data_seek' => ['bool', 'result'=>'resource', 'row_number'=>'int'], -'fbsql_database' => ['string', 'link_identifier'=>'resource', 'database='=>'string'], -'fbsql_database_password' => ['string', 'link_identifier'=>'resource', 'database_password='=>'string'], -'fbsql_db_query' => ['resource', 'database'=>'string', 'query'=>'string', 'link_identifier='=>'?resource'], -'fbsql_db_status' => ['int', 'database_name'=>'string', 'link_identifier='=>'?resource'], -'fbsql_drop_db' => ['bool', 'database_name'=>'string', 'link_identifier='=>'?resource'], -'fbsql_errno' => ['int', 'link_identifier='=>'?resource'], -'fbsql_error' => ['string', 'link_identifier='=>'?resource'], -'fbsql_fetch_array' => ['array', 'result'=>'resource', 'result_type='=>'int'], -'fbsql_fetch_assoc' => ['array', 'result'=>'resource'], -'fbsql_fetch_field' => ['object', 'result'=>'resource', 'field_offset='=>'int'], -'fbsql_fetch_lengths' => ['array', 'result'=>'resource'], -'fbsql_fetch_object' => ['object', 'result'=>'resource'], -'fbsql_fetch_row' => ['array', 'result'=>'resource'], -'fbsql_field_flags' => ['string', 'result'=>'resource', 'field_offset='=>'int'], -'fbsql_field_len' => ['int', 'result'=>'resource', 'field_offset='=>'int'], -'fbsql_field_name' => ['string', 'result'=>'resource', 'field_index='=>'int'], -'fbsql_field_seek' => ['bool', 'result'=>'resource', 'field_offset='=>'int'], -'fbsql_field_table' => ['string', 'result'=>'resource', 'field_offset='=>'int'], -'fbsql_field_type' => ['string', 'result'=>'resource', 'field_offset='=>'int'], -'fbsql_free_result' => ['bool', 'result'=>'resource'], -'fbsql_get_autostart_info' => ['array', 'link_identifier='=>'?resource'], -'fbsql_hostname' => ['string', 'link_identifier'=>'resource', 'host_name='=>'string'], -'fbsql_insert_id' => ['int', 'link_identifier='=>'?resource'], -'fbsql_list_dbs' => ['resource', 'link_identifier='=>'?resource'], -'fbsql_list_fields' => ['resource', 'database_name'=>'string', 'table_name'=>'string', 'link_identifier='=>'?resource'], -'fbsql_list_tables' => ['resource', 'database'=>'string', 'link_identifier='=>'?resource'], -'fbsql_next_result' => ['bool', 'result'=>'resource'], -'fbsql_num_fields' => ['int', 'result'=>'resource'], -'fbsql_num_rows' => ['int', 'result'=>'resource'], -'fbsql_password' => ['string', 'link_identifier'=>'resource', 'password='=>'string'], -'fbsql_pconnect' => ['resource', 'hostname='=>'string', 'username='=>'string', 'password='=>'string'], -'fbsql_query' => ['resource', 'query'=>'string', 'link_identifier='=>'?resource', 'batch_size='=>'int'], -'fbsql_read_blob' => ['string', 'blob_handle'=>'string', 'link_identifier='=>'?resource'], -'fbsql_read_clob' => ['string', 'clob_handle'=>'string', 'link_identifier='=>'?resource'], -'fbsql_result' => ['mixed', 'result'=>'resource', 'row='=>'int', 'field='=>'mixed'], -'fbsql_rollback' => ['bool', 'link_identifier='=>'?resource'], -'fbsql_rows_fetched' => ['int', 'result'=>'resource'], -'fbsql_select_db' => ['bool', 'database_name='=>'string', 'link_identifier='=>'?resource'], -'fbsql_set_characterset' => ['void', 'link_identifier'=>'resource', 'characterset'=>'int', 'in_out_both='=>'int'], -'fbsql_set_lob_mode' => ['bool', 'result'=>'resource', 'lob_mode'=>'int'], -'fbsql_set_password' => ['bool', 'link_identifier'=>'resource', 'user'=>'string', 'password'=>'string', 'old_password'=>'string'], -'fbsql_set_transaction' => ['void', 'link_identifier'=>'resource', 'locking'=>'int', 'isolation'=>'int'], -'fbsql_start_db' => ['bool', 'database_name'=>'string', 'link_identifier='=>'?resource', 'database_options='=>'string'], -'fbsql_stop_db' => ['bool', 'database_name'=>'string', 'link_identifier='=>'?resource'], -'fbsql_table_name' => ['string', 'result'=>'resource', 'index'=>'int'], -'fbsql_username' => ['string', 'link_identifier'=>'resource', 'username='=>'string'], -'fbsql_warnings' => ['bool', 'onoff='=>'bool'], -'fclose' => ['bool', 'fp'=>'resource'], -'fdf_add_doc_javascript' => ['bool', 'fdf_document'=>'resource', 'script_name'=>'string', 'script_code'=>'string'], -'fdf_add_template' => ['bool', 'fdf_document'=>'resource', 'newpage'=>'int', 'filename'=>'string', 'template'=>'string', 'rename'=>'int'], -'fdf_close' => ['void', 'fdf_document'=>'resource'], -'fdf_create' => ['resource'], -'fdf_enum_values' => ['bool', 'fdf_document'=>'resource', 'function'=>'callable', 'userdata='=>'mixed'], -'fdf_errno' => ['int'], -'fdf_error' => ['string', 'error_code='=>'int'], -'fdf_get_ap' => ['bool', 'fdf_document'=>'resource', 'field'=>'string', 'face'=>'int', 'filename'=>'string'], -'fdf_get_attachment' => ['array', 'fdf_document'=>'resource', 'fieldname'=>'string', 'savepath'=>'string'], -'fdf_get_encoding' => ['string', 'fdf_document'=>'resource'], -'fdf_get_file' => ['string', 'fdf_document'=>'resource'], -'fdf_get_flags' => ['int', 'fdf_document'=>'resource', 'fieldname'=>'string', 'whichflags'=>'int'], -'fdf_get_opt' => ['mixed', 'fdf_document'=>'resource', 'fieldname'=>'string', 'element='=>'int'], -'fdf_get_status' => ['string', 'fdf_document'=>'resource'], -'fdf_get_value' => ['mixed', 'fdf_document'=>'resource', 'fieldname'=>'string', 'which='=>'int'], -'fdf_get_version' => ['string', 'fdf_document='=>'resource'], -'fdf_header' => ['void'], -'fdf_next_field_name' => ['string', 'fdf_document'=>'resource', 'fieldname='=>'string'], -'fdf_open' => ['resource', 'filename'=>'string'], -'fdf_open_string' => ['resource', 'fdf_data'=>'string'], -'fdf_remove_item' => ['bool', 'fdf_document'=>'resource', 'fieldname'=>'string', 'item'=>'int'], -'fdf_save' => ['bool', 'fdf_document'=>'resource', 'filename='=>'string'], -'fdf_save_string' => ['string', 'fdf_document'=>'resource'], -'fdf_set_ap' => ['bool', 'fdf_document'=>'resource', 'field_name'=>'string', 'face'=>'int', 'filename'=>'string', 'page_number'=>'int'], -'fdf_set_encoding' => ['bool', 'fdf_document'=>'resource', 'encoding'=>'string'], -'fdf_set_file' => ['bool', 'fdf_document'=>'resource', 'url'=>'string', 'target_frame='=>'string'], -'fdf_set_flags' => ['bool', 'fdf_document'=>'resource', 'fieldname'=>'string', 'whichflags'=>'int', 'newflags'=>'int'], -'fdf_set_javascript_action' => ['bool', 'fdf_document'=>'resource', 'fieldname'=>'string', 'trigger'=>'int', 'script'=>'string'], -'fdf_set_on_import_javascript' => ['bool', 'fdf_document'=>'resource', 'script'=>'string', 'before_data_import'=>'bool'], -'fdf_set_opt' => ['bool', 'fdf_document'=>'resource', 'fieldname'=>'string', 'element'=>'int', 'str1'=>'string', 'str2'=>'string'], -'fdf_set_status' => ['bool', 'fdf_document'=>'resource', 'status'=>'string'], -'fdf_set_submit_form_action' => ['bool', 'fdf_document'=>'resource', 'fieldname'=>'string', 'trigger'=>'int', 'script'=>'string', 'flags'=>'int'], -'fdf_set_target_frame' => ['bool', 'fdf_document'=>'resource', 'frame_name'=>'string'], -'fdf_set_value' => ['bool', 'fdf_document'=>'resource', 'fieldname'=>'string', 'value'=>'mixed', 'isname='=>'int'], -'fdf_set_version' => ['bool', 'fdf_document'=>'resource', 'version'=>'string'], -'feof' => ['bool', 'fp'=>'resource'], -'fflush' => ['bool', 'fp'=>'resource'], -'ffmpeg_animated_gif::__construct' => ['void', 'output_file_path'=>'string', 'width'=>'int', 'height'=>'int', 'frame_rate'=>'int', 'loop_count='=>'int'], -'ffmpeg_animated_gif::addFrame' => ['', 'frame_to_add'=>'ffmpeg_frame'], -'ffmpeg_frame::__construct' => ['void', 'gd_image'=>'resource'], -'ffmpeg_frame::crop' => ['', 'crop_top'=>'int', 'crop_bottom='=>'int', 'crop_left='=>'int', 'crop_right='=>'int'], -'ffmpeg_frame::getHeight' => ['int'], -'ffmpeg_frame::getPresentationTimestamp' => ['int'], -'ffmpeg_frame::getPTS' => ['int'], -'ffmpeg_frame::getWidth' => ['int'], -'ffmpeg_frame::resize' => ['', 'width'=>'int', 'height'=>'int', 'crop_top='=>'int', 'crop_bottom='=>'int', 'crop_left='=>'int', 'crop_right='=>'int'], -'ffmpeg_frame::toGDImage' => ['resource'], -'ffmpeg_movie::__construct' => ['void', 'path_to_media'=>'string', 'persistent'=>'bool'], -'ffmpeg_movie::getArtist' => ['string'], -'ffmpeg_movie::getAudioBitRate' => ['int'], -'ffmpeg_movie::getAudioChannels' => ['int'], -'ffmpeg_movie::getAudioCodec' => ['string'], -'ffmpeg_movie::getAudioSampleRate' => ['int'], -'ffmpeg_movie::getAuthor' => ['string'], -'ffmpeg_movie::getBitRate' => ['int'], -'ffmpeg_movie::getComment' => ['string'], -'ffmpeg_movie::getCopyright' => ['string'], -'ffmpeg_movie::getDuration' => ['int'], -'ffmpeg_movie::getFilename' => ['string'], -'ffmpeg_movie::getFrame' => ['ffmpeg_frame', 'framenumber'=>'int'], -'ffmpeg_movie::getFrameCount' => ['int'], -'ffmpeg_movie::getFrameHeight' => ['int'], -'ffmpeg_movie::getFrameNumber' => ['int'], -'ffmpeg_movie::getFrameRate' => ['int'], -'ffmpeg_movie::getFrameWidth' => ['int'], -'ffmpeg_movie::getGenre' => ['string'], -'ffmpeg_movie::getNextKeyFrame' => ['ffmpeg_frame'], -'ffmpeg_movie::getPixelFormat' => [''], -'ffmpeg_movie::getTitle' => ['string'], -'ffmpeg_movie::getTrackNumber' => ['int|string'], -'ffmpeg_movie::getVideoBitRate' => ['int'], -'ffmpeg_movie::getVideoCodec' => ['string'], -'ffmpeg_movie::getYear' => ['int|string'], -'ffmpeg_movie::hasAudio' => ['bool'], -'ffmpeg_movie::hasVideo' => ['bool'], -'fgetc' => ['string|false', 'fp'=>'resource'], -'fgetcsv' => ['(?array)|(?false)', 'fp'=>'resource', 'length='=>'int', 'delimiter='=>'string', 'enclosure='=>'string', 'escape='=>'string'], -'fgets' => ['string|false', 'fp'=>'resource', 'length='=>'int'], -'fgetss' => ['string|false', 'fp'=>'resource', 'length='=>'int', 'allowable_tags='=>'string'], -'file' => ['array|false', 'filename'=>'string', 'flags='=>'int', 'context='=>'resource'], -'file_exists' => ['bool', 'filename'=>'string'], -'file_get_contents' => ['string|false', 'filename'=>'string', 'use_include_path='=>'bool', 'context='=>'?resource', 'offset='=>'int', 'maxlen='=>'int'], -'file_put_contents' => ['int|false', 'file'=>'string', 'data'=>'mixed', 'flags='=>'int', 'context='=>'resource'], -'fileatime' => ['int|false', 'filename'=>'string'], -'filectime' => ['int|false', 'filename'=>'string'], -'filegroup' => ['int|false', 'filename'=>'string'], -'fileinode' => ['int|false', 'filename'=>'string'], -'filemtime' => ['int|false', 'filename'=>'string'], -'fileowner' => ['int|false', 'filename'=>'string'], -'fileperms' => ['int|false', 'filename'=>'string'], -'filepro' => ['bool', 'directory'=>'string'], -'filepro_fieldcount' => ['int'], -'filepro_fieldname' => ['string', 'field_number'=>'int'], -'filepro_fieldtype' => ['string', 'field_number'=>'int'], -'filepro_fieldwidth' => ['int', 'field_number'=>'int'], -'filepro_retrieve' => ['string', 'row_number'=>'int', 'field_number'=>'int'], -'filepro_rowcount' => ['int'], -'filesize' => ['int|false', 'filename'=>'string'], -'FilesystemIterator::__construct' => ['void', 'path'=>'string', 'flags='=>'int'], -'FilesystemIterator::current' => ['string|SplFileInfo'], -'FilesystemIterator::getFlags' => ['int'], -'FilesystemIterator::key' => ['string'], -'FilesystemIterator::next' => ['void'], -'FilesystemIterator::rewind' => ['void'], -'FilesystemIterator::setFlags' => ['void', 'flags='=>'int'], -'filetype' => ['string|false', 'filename'=>'string'], -'filter_has_var' => ['bool', 'type'=>'int', 'variable_name'=>'string'], -'filter_id' => ['int|false', 'filtername'=>'string'], -'filter_input' => ['mixed', 'type'=>'int', 'variable_name'=>'string', 'filter='=>'int', 'options='=>'array|int'], -'filter_input_array' => ['mixed', 'type'=>'int', 'definition='=>'int|array', 'add_empty='=>'bool'], -'filter_list' => ['array'], -'filter_var' => ['mixed', 'variable'=>'mixed', 'filter='=>'int', 'options='=>'mixed'], -'filter_var_array' => ['mixed', 'data'=>'array', 'definition='=>'mixed', 'add_empty='=>'bool'], -'FilterIterator::__construct' => ['void', 'it'=>'iterator'], -'FilterIterator::accept' => ['bool'], -'FilterIterator::current' => ['mixed'], -'FilterIterator::getInnerIterator' => ['Iterator'], -'FilterIterator::key' => ['mixed'], -'FilterIterator::next' => ['void'], -'FilterIterator::rewind' => ['void'], -'FilterIterator::valid' => ['bool'], -'finfo::__construct' => ['void', 'options='=>'int', 'magic_file='=>'string'], -'finfo::buffer' => ['string|false', 'string'=>'string', 'options='=>'int', 'context='=>'resource'], -'finfo::file' => ['string|false', 'file_name'=>'string', 'options='=>'int', 'context='=>'resource'], -'finfo::set_flags' => ['bool', 'options'=>'int'], -'finfo_buffer' => ['string|false', 'finfo'=>'resource', 'string'=>'string', 'options='=>'int', 'context='=>'resource'], -'finfo_close' => ['bool', 'finfo'=>'resource'], -'finfo_file' => ['string|false', 'finfo'=>'resource', 'file_name'=>'string', 'options='=>'int', 'context='=>'resource'], -'finfo_open' => ['resource|false', 'options='=>'int', 'arg='=>'string'], -'finfo_set_flags' => ['bool', 'finfo'=>'resource', 'options'=>'int'], -'floatval' => ['float', 'var'=>'mixed'], -'flock' => ['bool', 'fp'=>'resource', 'operation'=>'int', '&w_wouldblock='=>'int'], -'floor' => ['float', 'number'=>'float'], -'flush' => ['void'], -'fmod' => ['float', 'x'=>'float', 'y'=>'float'], -'fnmatch' => ['bool', 'pattern'=>'string', 'filename'=>'string', 'flags='=>'int'], -'fopen' => ['resource|false', 'filename'=>'string', 'mode'=>'string', 'use_include_path='=>'bool', 'context='=>'resource'], -'forward_static_call' => ['mixed', 'function'=>'callable', '...parameters='=>'mixed'], -'forward_static_call_array' => ['mixed', 'function'=>'callable', 'parameters'=>'array'], -'fpassthru' => ['int', 'fp'=>'resource'], -'fpm_get_status' => ['array|false'], -'fprintf' => ['int', 'stream'=>'resource', 'format'=>'string', '...args='=>'string|int|float'], -'fputcsv' => ['int|false', 'fp'=>'resource', 'fields'=>'array', 'delimiter='=>'string', 'enclosure='=>'string', 'escape_char='=>'string'], -'fputs' => ['int|false', 'fp'=>'resource', 'str'=>'string', 'length='=>'int'], -'fread' => ['string|false', 'fp'=>'resource', 'length'=>'int'], -'frenchtojd' => ['int', 'month'=>'int', 'day'=>'int', 'year'=>'int'], -'fribidi_log2vis' => ['string', 'str'=>'string', 'direction'=>'string', 'charset'=>'int'], -'fscanf' => ['array|int', 'stream'=>'resource', 'format'=>'string', '&...w_vars='=>'string|int|float|null'], -'fseek' => ['int', 'fp'=>'resource', 'offset'=>'int', 'whence='=>'int'], -'fsockopen' => ['resource|false', 'hostname'=>'string', 'port='=>'int', '&w_errno='=>'int', '&w_errstr='=>'string', 'timeout='=>'float'], -'fstat' => ['array|false', 'fp'=>'resource'], -'ftell' => ['int|false', 'fp'=>'resource'], -'ftok' => ['int', 'pathname'=>'string', 'proj'=>'string'], -'ftp_alloc' => ['bool', 'stream'=>'resource', 'size'=>'int', '&w_response='=>'string'], -'ftp_append' => ['bool', 'ftp'=>'resource', 'remote_file'=>'string', 'local_file'=>'string', 'mode='=>'int'], -'ftp_cdup' => ['bool', 'stream'=>'resource'], -'ftp_chdir' => ['bool', 'stream'=>'resource', 'directory'=>'string'], -'ftp_chmod' => ['int|false', 'stream'=>'resource', 'mode'=>'int', 'filename'=>'string'], -'ftp_close' => ['bool', 'stream'=>'resource'], -'ftp_connect' => ['resource|false', 'host'=>'string', 'port='=>'int', 'timeout='=>'int'], -'ftp_delete' => ['bool', 'stream'=>'resource', 'file'=>'string'], -'ftp_exec' => ['bool', 'stream'=>'resource', 'command'=>'string'], -'ftp_fget' => ['bool', 'stream'=>'resource', 'fp'=>'resource', 'remote_file'=>'string', 'mode='=>'int', 'resumepos='=>'int'], -'ftp_fput' => ['bool', 'stream'=>'resource', 'remote_file'=>'string', 'fp'=>'resource', 'mode='=>'int', 'startpos='=>'int'], -'ftp_get' => ['bool', 'stream'=>'resource', 'local_file'=>'string', 'remote_file'=>'string', 'mode='=>'int', 'resume_pos='=>'int'], -'ftp_get_option' => ['mixed', 'stream'=>'resource', 'option'=>'int'], -'ftp_login' => ['bool', 'stream'=>'resource', 'username'=>'string', 'password'=>'string'], -'ftp_mdtm' => ['int', 'stream'=>'resource', 'filename'=>'string'], -'ftp_mkdir' => ['string|false', 'stream'=>'resource', 'directory'=>'string'], -'ftp_mlsd' => ['array', 'ftp_stream'=>'resource', 'directory'=>'string'], -'ftp_nb_continue' => ['int', 'stream'=>'resource'], -'ftp_nb_fget' => ['int', 'stream'=>'resource', 'fp'=>'resource', 'remote_file'=>'string', 'mode'=>'int', 'resumepos='=>'int'], -'ftp_nb_fput' => ['int', 'stream'=>'resource', 'remote_file'=>'string', 'fp'=>'resource', 'mode'=>'int', 'startpos='=>'int'], -'ftp_nb_get' => ['int', 'stream'=>'resource', 'local_file'=>'string', 'remote_file'=>'string', 'mode'=>'int', 'resume_pos='=>'int'], -'ftp_nb_put' => ['int', 'stream'=>'resource', 'remote_file'=>'string', 'local_file'=>'string', 'mode'=>'int', 'startpos='=>'int'], -'ftp_nlist' => ['array|false', 'stream'=>'resource', 'directory'=>'string'], -'ftp_pasv' => ['bool', 'stream'=>'resource', 'pasv'=>'bool'], -'ftp_put' => ['bool', 'stream'=>'resource', 'remote_file'=>'string', 'local_file'=>'string', 'mode'=>'int', 'startpos='=>'int'], -'ftp_pwd' => ['string|false', 'stream'=>'resource'], -'ftp_raw' => ['array', 'stream'=>'resource', 'command'=>'string'], -'ftp_rawlist' => ['array|false', 'stream'=>'resource', 'directory'=>'string', 'recursive='=>'bool'], -'ftp_rename' => ['bool', 'stream'=>'resource', 'src'=>'string', 'dest'=>'string'], -'ftp_rmdir' => ['bool', 'stream'=>'resource', 'directory'=>'string'], -'ftp_set_option' => ['bool', 'stream'=>'resource', 'option'=>'int', 'value'=>'mixed'], -'ftp_site' => ['bool', 'stream'=>'resource', 'cmd'=>'string'], -'ftp_size' => ['int', 'stream'=>'resource', 'filename'=>'string'], -'ftp_ssl_connect' => ['resource|false', 'host'=>'string', 'port='=>'int', 'timeout='=>'int'], -'ftp_systype' => ['string|false', 'stream'=>'resource'], -'ftruncate' => ['bool', 'fp'=>'resource', 'size'=>'int'], -'func_get_arg' => ['mixed', 'arg_num'=>'int'], -'func_get_args' => ['array'], -'func_num_args' => ['int'], -'function_exists' => ['bool', 'function_name'=>'string'], -'fwrite' => ['int|false', 'fp'=>'resource', 'str'=>'string', 'length='=>'int'], -'gc_collect_cycles' => ['int'], -'gc_disable' => ['void'], -'gc_enable' => ['void'], -'gc_enabled' => ['bool'], -'gc_mem_caches' => ['int'], -'gc_status' => ['array{runs:int,collected:int,threshold:int,roots:int}'], -'gd_info' => ['array'], -'gearman_bugreport' => [''], -'gearman_client_add_options' => ['', 'client_object'=>'', 'option'=>''], -'gearman_client_add_server' => ['', 'client_object'=>'', 'host'=>'', 'port'=>''], -'gearman_client_add_servers' => ['', 'client_object'=>'', 'servers'=>''], -'gearman_client_add_task' => ['', 'client_object'=>'', 'function_name'=>'', 'workload'=>'', 'context'=>'', 'unique'=>''], -'gearman_client_add_task_background' => ['', 'client_object'=>'', 'function_name'=>'', 'workload'=>'', 'context'=>'', 'unique'=>''], -'gearman_client_add_task_high' => ['', 'client_object'=>'', 'function_name'=>'', 'workload'=>'', 'context'=>'', 'unique'=>''], -'gearman_client_add_task_high_background' => ['', 'client_object'=>'', 'function_name'=>'', 'workload'=>'', 'context'=>'', 'unique'=>''], -'gearman_client_add_task_low' => ['', 'client_object'=>'', 'function_name'=>'', 'workload'=>'', 'context'=>'', 'unique'=>''], -'gearman_client_add_task_low_background' => ['', 'client_object'=>'', 'function_name'=>'', 'workload'=>'', 'context'=>'', 'unique'=>''], -'gearman_client_add_task_status' => ['', 'client_object'=>'', 'job_handle'=>'', 'context'=>''], -'gearman_client_clear_fn' => ['', 'client_object'=>''], -'gearman_client_clone' => ['', 'client_object'=>''], -'gearman_client_context' => ['', 'client_object'=>''], -'gearman_client_create' => ['', 'client_object'=>''], -'gearman_client_do' => ['', 'client_object'=>'', 'function_name'=>'', 'workload'=>'', 'unique'=>''], -'gearman_client_do_background' => ['', 'client_object'=>'', 'function_name'=>'', 'workload'=>'', 'unique'=>''], -'gearman_client_do_high' => ['', 'client_object'=>'', 'function_name'=>'', 'workload'=>'', 'unique'=>''], -'gearman_client_do_high_background' => ['', 'client_object'=>'', 'function_name'=>'', 'workload'=>'', 'unique'=>''], -'gearman_client_do_job_handle' => ['', 'client_object'=>''], -'gearman_client_do_low' => ['', 'client_object'=>'', 'function_name'=>'', 'workload'=>'', 'unique'=>''], -'gearman_client_do_low_background' => ['', 'client_object'=>'', 'function_name'=>'', 'workload'=>'', 'unique'=>''], -'gearman_client_do_normal' => ['', 'client_object'=>'', 'function_name'=>'string', 'workload'=>'string', 'unique'=>'string'], -'gearman_client_do_status' => ['', 'client_object'=>''], -'gearman_client_echo' => ['', 'client_object'=>'', 'workload'=>''], -'gearman_client_errno' => ['', 'client_object'=>''], -'gearman_client_error' => ['', 'client_object'=>''], -'gearman_client_job_status' => ['', 'client_object'=>'', 'job_handle'=>''], -'gearman_client_options' => ['', 'client_object'=>''], -'gearman_client_remove_options' => ['', 'client_object'=>'', 'option'=>''], -'gearman_client_return_code' => ['', 'client_object'=>''], -'gearman_client_run_tasks' => ['', 'data'=>''], -'gearman_client_set_complete_fn' => ['', 'client_object'=>'', 'callback'=>''], -'gearman_client_set_context' => ['', 'client_object'=>'', 'context'=>''], -'gearman_client_set_created_fn' => ['', 'client_object'=>'', 'callback'=>''], -'gearman_client_set_data_fn' => ['', 'client_object'=>'', 'callback'=>''], -'gearman_client_set_exception_fn' => ['', 'client_object'=>'', 'callback'=>''], -'gearman_client_set_fail_fn' => ['', 'client_object'=>'', 'callback'=>''], -'gearman_client_set_options' => ['', 'client_object'=>'', 'option'=>''], -'gearman_client_set_status_fn' => ['', 'client_object'=>'', 'callback'=>''], -'gearman_client_set_timeout' => ['', 'client_object'=>'', 'timeout'=>''], -'gearman_client_set_warning_fn' => ['', 'client_object'=>'', 'callback'=>''], -'gearman_client_set_workload_fn' => ['', 'client_object'=>'', 'callback'=>''], -'gearman_client_timeout' => ['', 'client_object'=>''], -'gearman_client_wait' => ['', 'client_object'=>''], -'gearman_job_function_name' => ['', 'job_object'=>''], -'gearman_job_handle' => ['string'], -'gearman_job_return_code' => ['', 'job_object'=>''], -'gearman_job_send_complete' => ['', 'job_object'=>'', 'result'=>''], -'gearman_job_send_data' => ['', 'job_object'=>'', 'data'=>''], -'gearman_job_send_exception' => ['', 'job_object'=>'', 'exception'=>''], -'gearman_job_send_fail' => ['', 'job_object'=>''], -'gearman_job_send_status' => ['', 'job_object'=>'', 'numerator'=>'', 'denominator'=>''], -'gearman_job_send_warning' => ['', 'job_object'=>'', 'warning'=>''], -'gearman_job_status' => ['array', 'job_handle'=>'string'], -'gearman_job_unique' => ['', 'job_object'=>''], -'gearman_job_workload' => ['', 'job_object'=>''], -'gearman_job_workload_size' => ['', 'job_object'=>''], -'gearman_task_data' => ['', 'task_object'=>''], -'gearman_task_data_size' => ['', 'task_object'=>''], -'gearman_task_denominator' => ['', 'task_object'=>''], -'gearman_task_function_name' => ['', 'task_object'=>''], -'gearman_task_is_known' => ['', 'task_object'=>''], -'gearman_task_is_running' => ['', 'task_object'=>''], -'gearman_task_job_handle' => ['', 'task_object'=>''], -'gearman_task_numerator' => ['', 'task_object'=>''], -'gearman_task_recv_data' => ['', 'task_object'=>'', 'data_len'=>''], -'gearman_task_return_code' => ['', 'task_object'=>''], -'gearman_task_send_workload' => ['', 'task_object'=>'', 'data'=>''], -'gearman_task_unique' => ['', 'task_object'=>''], -'gearman_verbose_name' => ['', 'verbose'=>''], -'gearman_version' => [''], -'gearman_worker_add_function' => ['', 'worker_object'=>'', 'function_name'=>'', 'function'=>'', 'data'=>'', 'timeout'=>''], -'gearman_worker_add_options' => ['', 'worker_object'=>'', 'option'=>''], -'gearman_worker_add_server' => ['', 'worker_object'=>'', 'host'=>'', 'port'=>''], -'gearman_worker_add_servers' => ['', 'worker_object'=>'', 'servers'=>''], -'gearman_worker_clone' => ['', 'worker_object'=>''], -'gearman_worker_create' => [''], -'gearman_worker_echo' => ['', 'worker_object'=>'', 'workload'=>''], -'gearman_worker_errno' => ['', 'worker_object'=>''], -'gearman_worker_error' => ['', 'worker_object'=>''], -'gearman_worker_grab_job' => ['', 'worker_object'=>''], -'gearman_worker_options' => ['', 'worker_object'=>''], -'gearman_worker_register' => ['', 'worker_object'=>'', 'function_name'=>'', 'timeout'=>''], -'gearman_worker_remove_options' => ['', 'worker_object'=>'', 'option'=>''], -'gearman_worker_return_code' => ['', 'worker_object'=>''], -'gearman_worker_set_options' => ['', 'worker_object'=>'', 'option'=>''], -'gearman_worker_set_timeout' => ['', 'worker_object'=>'', 'timeout'=>''], -'gearman_worker_timeout' => ['', 'worker_object'=>''], -'gearman_worker_unregister' => ['', 'worker_object'=>'', 'function_name'=>''], -'gearman_worker_unregister_all' => ['', 'worker_object'=>''], -'gearman_worker_wait' => ['', 'worker_object'=>''], -'gearman_worker_work' => ['', 'worker_object'=>''], -'GearmanClient::__construct' => ['void'], -'GearmanClient::addOptions' => ['bool', 'options'=>'int'], -'GearmanClient::addServer' => ['bool', 'host='=>'string', 'port='=>'int'], -'GearmanClient::addServers' => ['bool', 'servers='=>'string'], -'GearmanClient::addTask' => ['GearmanTask', 'function_name'=>'string', 'workload'=>'string', 'context='=>'mixed', 'unique='=>'string'], -'GearmanClient::addTaskBackground' => ['GearmanTask', 'function_name'=>'string', 'workload'=>'string', 'context='=>'mixed', 'unique='=>'string'], -'GearmanClient::addTaskHigh' => ['GearmanTask', 'function_name'=>'string', 'workload'=>'string', 'context='=>'mixed', 'unique='=>'string'], -'GearmanClient::addTaskHighBackground' => ['GearmanTask', 'function_name'=>'string', 'workload'=>'string', 'context='=>'mixed', 'unique='=>'string'], -'GearmanClient::addTaskLow' => ['GearmanTask', 'function_name'=>'string', 'workload'=>'string', 'context='=>'mixed', 'unique='=>'string'], -'GearmanClient::addTaskLowBackground' => ['GearmanTask', 'function_name'=>'string', 'workload'=>'string', 'context='=>'mixed', 'unique='=>'string'], -'GearmanClient::addTaskStatus' => ['GearmanTask', 'job_handle'=>'string', 'context='=>'string'], -'GearmanClient::clearCallbacks' => ['bool'], -'GearmanClient::clone' => ['GearmanClient'], -'GearmanClient::context' => ['string'], -'GearmanClient::data' => ['string'], -'GearmanClient::do' => ['string', 'function_name'=>'string', 'workload'=>'string', 'unique='=>'string'], -'GearmanClient::doBackground' => ['string', 'function_name'=>'string', 'workload'=>'string', 'unique='=>'string'], -'GearmanClient::doHigh' => ['string', 'function_name'=>'string', 'workload'=>'string', 'unique='=>'string'], -'GearmanClient::doHighBackground' => ['string', 'function_name'=>'string', 'workload'=>'string', 'unique='=>'string'], -'GearmanClient::doJobHandle' => ['string'], -'GearmanClient::doLow' => ['string', 'function_name'=>'string', 'workload'=>'string', 'unique='=>'string'], -'GearmanClient::doLowBackground' => ['string', 'function_name'=>'string', 'workload'=>'string', 'unique='=>'string'], -'GearmanClient::doNormal' => ['string', 'function_name'=>'string', 'workload'=>'string', 'unique='=>'string'], -'GearmanClient::doStatus' => ['array'], -'GearmanClient::echo' => ['bool', 'workload'=>'string'], -'GearmanClient::error' => ['string'], -'GearmanClient::getErrno' => ['int'], -'GearmanClient::jobStatus' => ['array', 'job_handle'=>'string'], -'GearmanClient::options' => [''], -'GearmanClient::ping' => ['bool', 'workload'=>'string'], -'GearmanClient::removeOptions' => ['bool', 'options'=>'int'], -'GearmanClient::returnCode' => ['int'], -'GearmanClient::runTasks' => ['bool'], -'GearmanClient::setClientCallback' => ['void', 'callback'=>'callable'], -'GearmanClient::setCompleteCallback' => ['bool', 'callback'=>'callable'], -'GearmanClient::setContext' => ['bool', 'context'=>'string'], -'GearmanClient::setCreatedCallback' => ['bool', 'callback'=>'string'], -'GearmanClient::setData' => ['bool', 'data'=>'string'], -'GearmanClient::setDataCallback' => ['bool', 'callback'=>'callable'], -'GearmanClient::setExceptionCallback' => ['bool', 'callback'=>'callable'], -'GearmanClient::setFailCallback' => ['bool', 'callback'=>'callable'], -'GearmanClient::setOptions' => ['bool', 'options'=>'int'], -'GearmanClient::setStatusCallback' => ['bool', 'callback'=>'callable'], -'GearmanClient::setTimeout' => ['bool', 'timeout'=>'int'], -'GearmanClient::setWarningCallback' => ['bool', 'callback'=>'callable'], -'GearmanClient::setWorkloadCallback' => ['bool', 'callback'=>'callable'], -'GearmanClient::timeout' => ['int'], -'GearmanClient::wait' => [''], -'GearmanJob::__construct' => ['void'], -'GearmanJob::complete' => ['bool', 'result'=>'string'], -'GearmanJob::data' => ['bool', 'data'=>'string'], -'GearmanJob::exception' => ['bool', 'exception'=>'string'], -'GearmanJob::fail' => ['bool'], -'GearmanJob::functionName' => ['string'], -'GearmanJob::handle' => ['string'], -'GearmanJob::returnCode' => ['int'], -'GearmanJob::sendComplete' => ['bool', 'result'=>'string'], -'GearmanJob::sendData' => ['bool', 'data'=>'string'], -'GearmanJob::sendException' => ['bool', 'exception'=>'string'], -'GearmanJob::sendFail' => ['bool'], -'GearmanJob::sendStatus' => ['bool', 'numerator'=>'int', 'denominator'=>'int'], -'GearmanJob::sendWarning' => ['bool', 'warning'=>'string'], -'GearmanJob::setReturn' => ['bool', 'gearman_return_t'=>'string'], -'GearmanJob::status' => ['bool', 'numerator'=>'int', 'denominator'=>'int'], -'GearmanJob::unique' => ['string'], -'GearmanJob::warning' => ['bool', 'warning'=>'string'], -'GearmanJob::workload' => ['string'], -'GearmanJob::workloadSize' => ['int'], -'GearmanTask::__construct' => ['void'], -'GearmanTask::create' => ['GearmanTask'], -'GearmanTask::data' => ['string'], -'GearmanTask::dataSize' => ['int'], -'GearmanTask::function' => ['string'], -'GearmanTask::functionName' => ['string'], -'GearmanTask::isKnown' => ['bool'], -'GearmanTask::isRunning' => ['bool'], -'GearmanTask::jobHandle' => ['string'], -'GearmanTask::recvData' => ['array', 'data_len'=>'int'], -'GearmanTask::returnCode' => ['int'], -'GearmanTask::sendData' => ['int', 'data'=>'string'], -'GearmanTask::sendWorkload' => ['int', 'data'=>'string'], -'GearmanTask::taskDenominator' => ['int'], -'GearmanTask::taskNumerator' => ['int'], -'GearmanTask::unique' => ['string'], -'GearmanTask::uuid' => ['string'], -'GearmanWorker::__construct' => ['void'], -'GearmanWorker::addFunction' => ['bool', 'function_name'=>'string', 'function'=>'callable', 'context='=>'mixed', 'timeout='=>'int'], -'GearmanWorker::addOptions' => ['bool', 'option'=>'int'], -'GearmanWorker::addServer' => ['bool', 'host='=>'string', 'port='=>'int'], -'GearmanWorker::addServers' => ['bool', 'servers'=>'string'], -'GearmanWorker::clone' => ['void'], -'GearmanWorker::echo' => ['bool', 'workload'=>'string'], -'GearmanWorker::error' => ['string'], -'GearmanWorker::getErrno' => ['int'], -'GearmanWorker::grabJob' => [''], -'GearmanWorker::options' => ['int'], -'GearmanWorker::register' => ['bool', 'function_name'=>'string', 'timeout='=>'int'], -'GearmanWorker::removeOptions' => ['bool', 'option'=>'int'], -'GearmanWorker::returnCode' => ['int'], -'GearmanWorker::setId' => ['bool', 'id'=>'string'], -'GearmanWorker::setOptions' => ['bool', 'option'=>'int'], -'GearmanWorker::setTimeout' => ['bool', 'timeout'=>'int'], -'GearmanWorker::timeout' => ['int'], -'GearmanWorker::unregister' => ['bool', 'function_name'=>'string'], -'GearmanWorker::unregisterAll' => ['bool'], -'GearmanWorker::wait' => ['bool'], -'GearmanWorker::work' => ['bool'], -'Gender\Gender::__construct' => ['void', 'dsn='=>'string'], -'Gender\Gender::connect' => ['bool', 'dsn'=>'string'], -'Gender\Gender::country' => ['array', 'country'=>'int'], -'Gender\Gender::get' => ['int', 'name'=>'string', 'country='=>'int'], -'Gender\Gender::isNick' => ['array', 'name0'=>'string', 'name1'=>'string', 'country='=>'int'], -'Gender\Gender::similarNames' => ['array', 'name'=>'string', 'country='=>'int'], -'Generator::__wakeup' => ['void'], -'Generator::current' => ['mixed'], -'Generator::getReturn' => ['mixed'], -'Generator::key' => ['mixed'], -'Generator::next' => ['void'], -'Generator::rewind' => ['void'], -'Generator::send' => ['mixed', 'value'=>'mixed'], -'Generator::throw' => ['mixed', 'exception'=>'Exception|Throwable'], -'Generator::valid' => ['bool'], -'geoip_asnum_by_name' => ['string', 'hostname'=>'string'], -'geoip_continent_code_by_name' => ['string', 'hostname'=>'string'], -'geoip_country_code3_by_name' => ['string', 'hostname'=>'string'], -'geoip_country_code_by_name' => ['string', 'hostname'=>'string'], -'geoip_country_name_by_name' => ['string', 'hostname'=>'string'], -'geoip_database_info' => ['string', 'database='=>'int'], -'geoip_db_avail' => ['bool', 'database'=>'int'], -'geoip_db_filename' => ['string', 'database'=>'int'], -'geoip_db_get_all_info' => ['array'], -'geoip_domain_by_name' => ['string', 'hostname'=>'string'], -'geoip_id_by_name' => ['int', 'hostname'=>'string'], -'geoip_isp_by_name' => ['string', 'hostname'=>'string'], -'geoip_netspeedcell_by_name' => ['string', 'hostname'=>'string'], -'geoip_org_by_name' => ['string', 'hostname'=>'string'], -'geoip_record_by_name' => ['array', 'hostname'=>'string'], -'geoip_region_by_name' => ['array', 'hostname'=>'string'], -'geoip_region_name_by_code' => ['string', 'country_code'=>'string', 'region_code'=>'string'], -'geoip_setup_custom_directory' => ['void', 'path'=>'string'], -'geoip_time_zone_by_country_and_region' => ['string|false', 'country_code'=>'string', 'region_code='=>'string'], -'get_browser' => ['mixed', 'browser_name='=>'string', 'return_array='=>'bool'], -'get_call_stack' => [''], -'get_called_class' => ['string'], -'get_cfg_var' => ['mixed', 'option_name'=>'string'], -'get_class' => ['string', 'object='=>'object'], -'get_class_methods' => ['array', 'class'=>'mixed'], -'get_class_vars' => ['array', 'class_name'=>'string'], -'get_current_user' => ['string'], -'get_declared_classes' => ['array'], -'get_declared_interfaces' => ['array'], -'get_declared_traits' => ['array'], -'get_defined_constants' => ['array', 'categorize='=>'bool'], -'get_defined_functions' => ['array>', 'exclude_disabled='=>'bool'], -'get_defined_vars' => ['array'], -'get_extension_funcs' => ['array', 'extension_name'=>'string'], -'get_headers' => ['array|false', 'url'=>'string', 'format='=>'int', 'context='=>'resource'], -'get_html_translation_table' => ['array', 'table='=>'int', 'flags='=>'int', 'encoding='=>'string'], -'get_include_path' => ['string'], -'get_included_files' => ['array'], -'get_loaded_extensions' => ['array', 'zend_extensions='=>'bool'], -'get_magic_quotes_gpc' => ['bool'], -'get_magic_quotes_runtime' => ['bool'], -'get_meta_tags' => ['array', 'filename'=>'string', 'use_include_path='=>'bool'], -'get_object_vars' => ['array', 'obj'=>'object'], -'get_parent_class' => ['string|false', 'object='=>'mixed'], -'get_required_files' => ['string[]'], -'get_resource_type' => ['string', 'res'=>'resource'], -'get_resources' => ['resource[]', 'resource_type'=>'string'], -'getallheaders' => ['array'], -'getcwd' => ['string|false'], -'getdate' => ['array', 'timestamp='=>'int'], -'getenv' => ['string|false', 'varname'=>'string', 'local_only='=>'bool'], -'getenv\'1' => ['string[]'], -'gethostbyaddr' => ['string|false', 'ip_address'=>'string'], -'gethostbyname' => ['string', 'hostname'=>'string'], -'gethostbynamel' => ['array|false', 'hostname'=>'string'], -'gethostname' => ['string|false'], -'getimagesize' => ['array|false', 'imagefile'=>'string', '&w_info='=>'array'], -'getimagesizefromstring' => ['array|false', 'data'=>'string', '&w_info='=>'array'], -'getlastmod' => ['int'], -'getmxrr' => ['bool', 'hostname'=>'string', '&w_mxhosts'=>'array', '&w_weight='=>'array'], -'getmygid' => ['int'], -'getmyinode' => ['int'], -'getmypid' => ['int'], -'getmyuid' => ['int'], -'getopt' => ['array|array|array>', 'options'=>'string', 'longopts='=>'array', '&w_optind='=>'int'], -'getprotobyname' => ['int|false', 'name'=>'string'], -'getprotobynumber' => ['string', 'proto'=>'int'], -'getrandmax' => ['int'], -'getrusage' => ['array', 'who='=>'int'], -'getservbyname' => ['int|false', 'service'=>'string', 'protocol'=>'string'], -'getservbyport' => ['string|false', 'port'=>'int', 'protocol'=>'string'], -'gettext' => ['string', 'msgid'=>'string'], -'gettimeofday' => ['array|float', 'get_as_float='=>'bool'], -'gettype' => ['string', 'var'=>'mixed'], -'glob' => ['array|false', 'pattern'=>'string', 'flags='=>'int'], -'GlobIterator::__construct' => ['void', 'path'=>'string', 'flags='=>'int'], -'GlobIterator::cont' => ['int'], -'GlobIterator::count' => ['int'], -'Gmagick::__construct' => ['void', 'filename='=>'string'], -'Gmagick::addimage' => ['Gmagick', 'gmagick'=>'gmagick'], -'Gmagick::addnoiseimage' => ['Gmagick', 'noise'=>'int'], -'Gmagick::annotateimage' => ['Gmagick', 'gmagickdraw'=>'gmagickdraw', 'x'=>'float', 'y'=>'float', 'angle'=>'float', 'text'=>'string'], -'Gmagick::blurimage' => ['Gmagick', 'radius'=>'float', 'sigma'=>'float', 'channel='=>'int'], -'Gmagick::borderimage' => ['Gmagick', 'color'=>'gmagickpixel', 'width'=>'int', 'height'=>'int'], -'Gmagick::charcoalimage' => ['Gmagick', 'radius'=>'float', 'sigma'=>'float'], -'Gmagick::chopimage' => ['Gmagick', 'width'=>'int', 'height'=>'int', 'x'=>'int', 'y'=>'int'], -'Gmagick::clear' => ['Gmagick'], -'Gmagick::commentimage' => ['Gmagick', 'comment'=>'string'], -'Gmagick::compositeimage' => ['Gmagick', 'source'=>'gmagick', 'compose'=>'int', 'x'=>'int', 'y'=>'int'], -'Gmagick::cropimage' => ['Gmagick', 'width'=>'int', 'height'=>'int', 'x'=>'int', 'y'=>'int'], -'Gmagick::cropthumbnailimage' => ['Gmagick', 'width'=>'int', 'height'=>'int'], -'Gmagick::current' => ['Gmagick'], -'Gmagick::cyclecolormapimage' => ['Gmagick', 'displace'=>'int'], -'Gmagick::deconstructimages' => ['Gmagick'], -'Gmagick::despeckleimage' => ['Gmagick'], -'Gmagick::destroy' => ['bool'], -'Gmagick::drawimage' => ['Gmagick', 'gmagickdraw'=>'gmagickdraw'], -'Gmagick::edgeimage' => ['Gmagick', 'radius'=>'float'], -'Gmagick::embossimage' => ['Gmagick', 'radius'=>'float', 'sigma'=>'float'], -'Gmagick::enhanceimage' => ['Gmagick'], -'Gmagick::equalizeimage' => ['Gmagick'], -'Gmagick::flipimage' => ['Gmagick'], -'Gmagick::flopimage' => ['Gmagick'], -'Gmagick::frameimage' => ['Gmagick', 'color'=>'gmagickpixel', 'width'=>'int', 'height'=>'int', 'inner_bevel'=>'int', 'outer_bevel'=>'int'], -'Gmagick::gammaimage' => ['Gmagick', 'gamma'=>'float'], -'Gmagick::getcopyright' => ['string'], -'Gmagick::getfilename' => ['string'], -'Gmagick::getimagebackgroundcolor' => ['GmagickPixel'], -'Gmagick::getimageblueprimary' => ['array'], -'Gmagick::getimagebordercolor' => ['GmagickPixel'], -'Gmagick::getimagechanneldepth' => ['int', 'channel_type'=>'int'], -'Gmagick::getimagecolors' => ['int'], -'Gmagick::getimagecolorspace' => ['int'], -'Gmagick::getimagecompose' => ['int'], -'Gmagick::getimagedelay' => ['int'], -'Gmagick::getimagedepth' => ['int'], -'Gmagick::getimagedispose' => ['int'], -'Gmagick::getimageextrema' => ['array'], -'Gmagick::getimagefilename' => ['string'], -'Gmagick::getimageformat' => ['string'], -'Gmagick::getimagegamma' => ['float'], -'Gmagick::getimagegreenprimary' => ['array'], -'Gmagick::getimageheight' => ['int'], -'Gmagick::getimagehistogram' => ['array'], -'Gmagick::getimageindex' => ['int'], -'Gmagick::getimageinterlacescheme' => ['int'], -'Gmagick::getimageiterations' => ['int'], -'Gmagick::getimagematte' => ['int'], -'Gmagick::getimagemattecolor' => ['GmagickPixel'], -'Gmagick::getimageprofile' => ['string', 'name'=>'string'], -'Gmagick::getimageredprimary' => ['array'], -'Gmagick::getimagerenderingintent' => ['int'], -'Gmagick::getimageresolution' => ['array'], -'Gmagick::getimagescene' => ['int'], -'Gmagick::getimagesignature' => ['string'], -'Gmagick::getimagetype' => ['int'], -'Gmagick::getimageunits' => ['int'], -'Gmagick::getimagewhitepoint' => ['array'], -'Gmagick::getimagewidth' => ['int'], -'Gmagick::getpackagename' => ['string'], -'Gmagick::getquantumdepth' => ['array'], -'Gmagick::getreleasedate' => ['string'], -'Gmagick::getsamplingfactors' => ['array'], -'Gmagick::getsize' => ['array'], -'Gmagick::getversion' => ['array'], -'Gmagick::hasnextimage' => ['bool'], -'Gmagick::haspreviousimage' => ['bool'], -'Gmagick::implodeimage' => ['mixed', 'radius'=>'float'], -'Gmagick::labelimage' => ['mixed', 'label'=>'string'], -'Gmagick::levelimage' => ['mixed', 'blackpoint'=>'float', 'gamma'=>'float', 'whitepoint'=>'float', 'channel='=>'int'], -'Gmagick::magnifyimage' => ['mixed'], -'Gmagick::mapimage' => ['Gmagick', 'gmagick'=>'gmagick', 'dither'=>'bool'], -'Gmagick::medianfilterimage' => ['void', 'radius'=>'float'], -'Gmagick::minifyimage' => ['Gmagick'], -'Gmagick::modulateimage' => ['Gmagick', 'brightness'=>'float', 'saturation'=>'float', 'hue'=>'float'], -'Gmagick::motionblurimage' => ['Gmagick', 'radius'=>'float', 'sigma'=>'float', 'angle'=>'float'], -'Gmagick::newimage' => ['Gmagick', 'width'=>'int', 'height'=>'int', 'background'=>'string', 'format='=>'string'], -'Gmagick::nextimage' => ['bool'], -'Gmagick::normalizeimage' => ['Gmagick', 'channel='=>'int'], -'Gmagick::oilpaintimage' => ['Gmagick', 'radius'=>'float'], -'Gmagick::previousimage' => ['bool'], -'Gmagick::profileimage' => ['Gmagick', 'name'=>'string', 'profile'=>'string'], -'Gmagick::quantizeimage' => ['Gmagick', 'numcolors'=>'int', 'colorspace'=>'int', 'treedepth'=>'int', 'dither'=>'bool', 'measureerror'=>'bool'], -'Gmagick::quantizeimages' => ['Gmagick', 'numcolors'=>'int', 'colorspace'=>'int', 'treedepth'=>'int', 'dither'=>'bool', 'measureerror'=>'bool'], -'Gmagick::queryfontmetrics' => ['array', 'draw'=>'gmagickdraw', 'text'=>'string'], -'Gmagick::queryfonts' => ['array', 'pattern='=>'string'], -'Gmagick::queryformats' => ['array', 'pattern='=>'string'], -'Gmagick::radialblurimage' => ['Gmagick', 'angle'=>'float', 'channel='=>'int'], -'Gmagick::raiseimage' => ['Gmagick', 'width'=>'int', 'height'=>'int', 'x'=>'int', 'y'=>'int', 'raise'=>'bool'], -'Gmagick::read' => ['Gmagick', 'filename'=>'string'], -'Gmagick::readimage' => ['Gmagick', 'filename'=>'string'], -'Gmagick::readimageblob' => ['Gmagick', 'imagecontents'=>'string', 'filename='=>'string'], -'Gmagick::readimagefile' => ['Gmagick', 'fp'=>'resource', 'filename='=>'string'], -'Gmagick::reducenoiseimage' => ['Gmagick', 'radius'=>'float'], -'Gmagick::removeimage' => ['Gmagick'], -'Gmagick::removeimageprofile' => ['string', 'name'=>'string'], -'Gmagick::resampleimage' => ['Gmagick', 'xresolution'=>'float', 'yresolution'=>'float', 'filter'=>'int', 'blur'=>'float'], -'Gmagick::resizeimage' => ['Gmagick', 'width'=>'int', 'height'=>'int', 'filter'=>'int', 'blur'=>'float', 'fit='=>'bool'], -'Gmagick::rollimage' => ['Gmagick', 'x'=>'int', 'y'=>'int'], -'Gmagick::rotateimage' => ['Gmagick', 'color'=>'mixed', 'degrees'=>'float'], -'Gmagick::scaleimage' => ['Gmagick', 'width'=>'int', 'height'=>'int', 'fit='=>'bool'], -'Gmagick::separateimagechannel' => ['Gmagick', 'channel'=>'int'], -'Gmagick::setCompressionQuality' => ['Gmagick', 'quality'=>'int'], -'Gmagick::setfilename' => ['Gmagick', 'filename'=>'string'], -'Gmagick::setimagebackgroundcolor' => ['Gmagick', 'color'=>'gmagickpixel'], -'Gmagick::setimageblueprimary' => ['Gmagick', 'x'=>'float', 'y'=>'float'], -'Gmagick::setimagebordercolor' => ['Gmagick', 'color'=>'gmagickpixel'], -'Gmagick::setimagechanneldepth' => ['Gmagick', 'channel'=>'int', 'depth'=>'int'], -'Gmagick::setimagecolorspace' => ['Gmagick', 'colorspace'=>'int'], -'Gmagick::setimagecompose' => ['Gmagick', 'composite'=>'int'], -'Gmagick::setimagedelay' => ['Gmagick', 'delay'=>'int'], -'Gmagick::setimagedepth' => ['Gmagick', 'depth'=>'int'], -'Gmagick::setimagedispose' => ['Gmagick', 'disposetype'=>'int'], -'Gmagick::setimagefilename' => ['Gmagick', 'filename'=>'string'], -'Gmagick::setimageformat' => ['Gmagick', 'imageformat'=>'string'], -'Gmagick::setimagegamma' => ['Gmagick', 'gamma'=>'float'], -'Gmagick::setimagegreenprimary' => ['Gmagick', 'x'=>'float', 'y'=>'float'], -'Gmagick::setimageindex' => ['Gmagick', 'index'=>'int'], -'Gmagick::setimageinterlacescheme' => ['Gmagick', 'interlace'=>'int'], -'Gmagick::setimageiterations' => ['Gmagick', 'iterations'=>'int'], -'Gmagick::setimageprofile' => ['Gmagick', 'name'=>'string', 'profile'=>'string'], -'Gmagick::setimageredprimary' => ['Gmagick', 'x'=>'float', 'y'=>'float'], -'Gmagick::setimagerenderingintent' => ['Gmagick', 'rendering_intent'=>'int'], -'Gmagick::setimageresolution' => ['Gmagick', 'xresolution'=>'float', 'yresolution'=>'float'], -'Gmagick::setimagescene' => ['Gmagick', 'scene'=>'int'], -'Gmagick::setimagetype' => ['Gmagick', 'imgtype'=>'int'], -'Gmagick::setimageunits' => ['Gmagick', 'resolution'=>'int'], -'Gmagick::setimagewhitepoint' => ['Gmagick', 'x'=>'float', 'y'=>'float'], -'Gmagick::setsamplingfactors' => ['Gmagick', 'factors'=>'array'], -'Gmagick::setsize' => ['Gmagick', 'columns'=>'int', 'rows'=>'int'], -'Gmagick::shearimage' => ['Gmagick', 'color'=>'mixed', 'xshear'=>'float', 'yshear'=>'float'], -'Gmagick::solarizeimage' => ['Gmagick', 'threshold'=>'int'], -'Gmagick::spreadimage' => ['Gmagick', 'radius'=>'float'], -'Gmagick::stripimage' => ['Gmagick'], -'Gmagick::swirlimage' => ['Gmagick', 'degrees'=>'float'], -'Gmagick::thumbnailimage' => ['Gmagick', 'width'=>'int', 'height'=>'int', 'fit='=>'bool'], -'Gmagick::trimimage' => ['Gmagick', 'fuzz'=>'float'], -'Gmagick::write' => ['', 'filename'=>'string'], -'Gmagick::writeimage' => ['Gmagick', 'filename'=>'string', 'all_frames='=>'bool'], -'GmagickDraw::annotate' => ['GmagickDraw', 'x'=>'float', 'y'=>'float', 'text'=>'string'], -'GmagickDraw::arc' => ['GmagickDraw', 'sx'=>'float', 'sy'=>'float', 'ex'=>'float', 'ey'=>'float', 'sd'=>'float', 'ed'=>'float'], -'GmagickDraw::bezier' => ['GmagickDraw', 'coordinate_array'=>'array'], -'GmagickDraw::ellipse' => ['GmagickDraw', 'ox'=>'float', 'oy'=>'float', 'rx'=>'float', 'ry'=>'float', 'start'=>'float', 'end'=>'float'], -'GmagickDraw::getfillcolor' => ['GmagickPixel'], -'GmagickDraw::getfillopacity' => ['float'], -'GmagickDraw::getfont' => ['string'], -'GmagickDraw::getfontsize' => ['float'], -'GmagickDraw::getfontstyle' => ['int'], -'GmagickDraw::getfontweight' => ['int'], -'GmagickDraw::getstrokecolor' => ['GmagickPixel'], -'GmagickDraw::getstrokeopacity' => ['float'], -'GmagickDraw::getstrokewidth' => ['float'], -'GmagickDraw::gettextdecoration' => ['int'], -'GmagickDraw::gettextencoding' => ['string'], -'GmagickDraw::line' => ['GmagickDraw', 'sx'=>'float', 'sy'=>'float', 'ex'=>'float', 'ey'=>'float'], -'GmagickDraw::point' => ['GmagickDraw', 'x'=>'float', 'y'=>'float'], -'GmagickDraw::polygon' => ['GmagickDraw', 'coordinates'=>'array'], -'GmagickDraw::polyline' => ['GmagickDraw', 'coordinate_array'=>'array'], -'GmagickDraw::rectangle' => ['GmagickDraw', 'x1'=>'float', 'y1'=>'float', 'x2'=>'float', 'y2'=>'float'], -'GmagickDraw::rotate' => ['GmagickDraw', 'degrees'=>'float'], -'GmagickDraw::roundrectangle' => ['GmagickDraw', 'x1'=>'float', 'y1'=>'float', 'x2'=>'float', 'y2'=>'float', 'rx'=>'float', 'ry'=>'float'], -'GmagickDraw::scale' => ['GmagickDraw', 'x'=>'float', 'y'=>'float'], -'GmagickDraw::setfillcolor' => ['GmagickDraw', 'color'=>'string'], -'GmagickDraw::setfillopacity' => ['GmagickDraw', 'fill_opacity'=>'float'], -'GmagickDraw::setfont' => ['GmagickDraw', 'font'=>'string'], -'GmagickDraw::setfontsize' => ['GmagickDraw', 'pointsize'=>'float'], -'GmagickDraw::setfontstyle' => ['GmagickDraw', 'style'=>'int'], -'GmagickDraw::setfontweight' => ['GmagickDraw', 'weight'=>'int'], -'GmagickDraw::setstrokecolor' => ['GmagickDraw', 'color'=>'gmagickpixel'], -'GmagickDraw::setstrokeopacity' => ['GmagickDraw', 'stroke_opacity'=>'float'], -'GmagickDraw::setstrokewidth' => ['GmagickDraw', 'width'=>'float'], -'GmagickDraw::settextdecoration' => ['GmagickDraw', 'decoration'=>'int'], -'GmagickDraw::settextencoding' => ['GmagickDraw', 'encoding'=>'string'], -'GmagickPixel::__construct' => ['void', 'color='=>'string'], -'GmagickPixel::getcolor' => ['mixed', 'as_array='=>'bool', 'normalize_array='=>'bool'], -'GmagickPixel::getcolorcount' => ['int'], -'GmagickPixel::getcolorvalue' => ['float', 'color'=>'int'], -'GmagickPixel::setcolor' => ['GmagickPixel', 'color'=>'string'], -'GmagickPixel::setcolorvalue' => ['GmagickPixel', 'color'=>'int', 'value'=>'float'], -'gmdate' => ['string', 'format'=>'string', 'timestamp='=>'int'], -'gmmktime' => ['int', 'hour='=>'int', 'min='=>'int', 'sec='=>'int', 'mon='=>'int', 'day='=>'int', 'year='=>'int'], -'GMP::__construct' => ['void'], -'GMP::serialize' => ['string'], -'GMP::__toString' => ['string'], -'GMP::unserialize' => ['void', 'serialized'=>'string'], -'gmp_abs' => ['GMP', 'a'=>'GMP|string|int'], -'gmp_add' => ['GMP', 'a'=>'GMP|string|int', 'b'=>'GMP|string|int'], -'gmp_and' => ['GMP', 'a'=>'GMP|string|int', 'b'=>'GMP|string|int'], -'gmp_binomial' => ['GMP|false', 'n'=>'GMP|string|int', 'k'=>'int'], -'gmp_clrbit' => ['void', 'a'=>'GMP|string|int', 'index'=>'int'], -'gmp_cmp' => ['int', 'a'=>'GMP|string|int', 'b'=>'GMP|string|int'], -'gmp_com' => ['GMP', 'a'=>'GMP|string|int'], -'gmp_div' => ['resource', 'a'=>'GMP|resource|string', 'b'=>'GMP|resource|string', 'round='=>'int'], -'gmp_div_q' => ['GMP', 'a'=>'GMP|string|int', 'b'=>'GMP|string|int', 'round='=>'int'], -'gmp_div_qr' => ['array', 'a'=>'GMP|string|int', 'b'=>'GMP|string|int', 'round='=>'int'], -'gmp_div_r' => ['GMP', 'a'=>'GMP|string|int', 'b'=>'GMP|string|int', 'round='=>'int'], -'gmp_divexact' => ['GMP', 'a'=>'GMP|string|int', 'b'=>'GMP|string|int'], -'gmp_export' => ['string', 'gmpnumber'=>'GMP|string|int', 'word_size='=>'int', 'options='=>'int'], -'gmp_fact' => ['GMP', 'a'=>'int'], -'gmp_gcd' => ['GMP', 'a'=>'GMP|string|int', 'b'=>'GMP|string|int'], -'gmp_gcdext' => ['array', 'a'=>'GMP|string|int', 'b'=>'GMP|string|int'], -'gmp_hamdist' => ['int', 'a'=>'GMP|string|int', 'b'=>'GMP|string|int'], -'gmp_import' => ['GMP', 'data'=>'string', 'word_size='=>'int', 'options='=>'int'], -'gmp_init' => ['GMP', 'number'=>'int|string', 'base='=>'int'], -'gmp_intval' => ['int', 'gmpnumber'=>'GMP|string|int'], -'gmp_invert' => ['GMP', 'a'=>'GMP|string|int', 'b'=>'GMP|string|int'], -'gmp_jacobi' => ['int', 'a'=>'GMP|string|int', 'b'=>'GMP|string|int'], -'gmp_kronecker' => ['int', 'a'=>'GMP|string|int', 'b'=>'GMP|string|int'], -'gmp_lcm' => ['GMP', 'a'=>'GMP|string|int', 'b'=>'GMP|string|int'], -'gmp_legendre' => ['int', 'a'=>'GMP|string|int', 'b'=>'GMP|string|int'], -'gmp_mod' => ['GMP', 'a'=>'GMP|string|int', 'b'=>'GMP|string|int'], -'gmp_mul' => ['GMP', 'a'=>'GMP|string|int', 'b'=>'GMP|string|int'], -'gmp_neg' => ['GMP', 'a'=>'GMP|string|int'], -'gmp_nextprime' => ['GMP', 'a'=>'GMP|string|int'], -'gmp_or' => ['GMP', 'a'=>'GMP|string|int', 'b'=>'GMP|string|int'], -'gmp_perfect_power' => ['bool', 'a'=>'GMP|string|int'], -'gmp_perfect_square' => ['bool', 'a'=>'GMP|string|int'], -'gmp_popcount' => ['int', 'a'=>'GMP|string|int'], -'gmp_pow' => ['GMP', 'base'=>'GMP|string|int', 'exp'=>'int'], -'gmp_powm' => ['GMP', 'base'=>'GMP|string|int', 'exp'=>'GMP|string|int', 'mod'=>'GMP|string|int'], -'gmp_prob_prime' => ['int', 'a'=>'GMP|string|int', 'reps='=>'int'], -'gmp_random' => ['GMP', 'limiter='=>'int'], -'gmp_random_bits' => ['GMP', 'bits'=>'int'], -'gmp_random_range' => ['GMP', 'min'=>'GMP|string|int', 'max'=>'GMP|string|int'], -'gmp_random_seed' => ['GMP', 'seed'=>'GMP|string|int'], -'gmp_root' => ['GMP', 'a'=>'GMP|string|int', 'nth'=>'int'], -'gmp_rootrem' => ['array', 'a'=>'GMP|string|int', 'nth'=>'int'], -'gmp_scan0' => ['int', 'a'=>'GMP|string|int', 'start'=>'int'], -'gmp_scan1' => ['int', 'a'=>'GMP|string|int', 'start'=>'int'], -'gmp_setbit' => ['void', 'a'=>'GMP|string|int', 'index'=>'int', 'set_clear='=>'bool'], -'gmp_sign' => ['int', 'a'=>'GMP|string|int'], -'gmp_sqrt' => ['GMP', 'a'=>'GMP|string|int'], -'gmp_sqrtrem' => ['array', 'a'=>'GMP|string|int'], -'gmp_strval' => ['string', 'gmpnumber'=>'GMP|string|int', 'base='=>'int'], -'gmp_sub' => ['GMP', 'a'=>'GMP|string|int', 'b'=>'GMP|string|int'], -'gmp_testbit' => ['bool', 'a'=>'GMP|string|int', 'index'=>'int'], -'gmp_xor' => ['GMP', 'a'=>'GMP|string|int', 'b'=>'GMP|string|int'], -'gmstrftime' => ['string', 'format'=>'string', 'timestamp='=>'int'], -'gnupg::adddecryptkey' => ['bool', 'fingerprint'=>'string', 'passphrase'=>'string'], -'gnupg::addencryptkey' => ['bool', 'fingerprint'=>'string'], -'gnupg::addsignkey' => ['bool', 'fingerprint'=>'string', 'passphrase='=>'string'], -'gnupg::cleardecryptkeys' => ['bool'], -'gnupg::clearencryptkeys' => ['bool'], -'gnupg::clearsignkeys' => ['bool'], -'gnupg::decrypt' => ['string', 'text'=>'string'], -'gnupg::decryptverify' => ['array', 'text'=>'string', '&plaintext'=>'string'], -'gnupg::encrypt' => ['string', 'plaintext'=>'string'], -'gnupg::encryptsign' => ['string', 'plaintext'=>'string'], -'gnupg::export' => ['string', 'fingerprint'=>'string'], -'gnupg::geterror' => ['string'], -'gnupg::getprotocol' => ['int'], -'gnupg::import' => ['array', 'keydata'=>'string'], -'gnupg::init' => ['resource'], -'gnupg::keyinfo' => ['array', 'pattern'=>'string'], -'gnupg::setarmor' => ['bool', 'armor'=>'int'], -'gnupg::seterrormode' => ['void', 'errormode'=>'int'], -'gnupg::setsignmode' => ['bool', 'signmode'=>'int'], -'gnupg::sign' => ['string', 'plaintext'=>'string'], -'gnupg::verify' => ['array', 'signed_text'=>'string', 'signature'=>'string', '&plaintext='=>'string'], -'gnupg_adddecryptkey' => ['bool', 'identifier'=>'resource', 'fingerprint'=>'string', 'passphrase'=>'string'], -'gnupg_addencryptkey' => ['bool', 'identifier'=>'resource', 'fingerprint'=>'string'], -'gnupg_addsignkey' => ['bool', 'identifier'=>'resource', 'fingerprint'=>'string', 'passphrase='=>'string'], -'gnupg_cleardecryptkeys' => ['bool', 'identifier'=>'resource'], -'gnupg_clearencryptkeys' => ['bool', 'identifier'=>'resource'], -'gnupg_clearsignkeys' => ['bool', 'identifier'=>'resource'], -'gnupg_decrypt' => ['string', 'identifier'=>'resource', 'text'=>'string'], -'gnupg_decryptverify' => ['array', 'identifier'=>'resource', 'text'=>'string', 'plaintext'=>'string'], -'gnupg_encrypt' => ['string', 'identifier'=>'resource', 'plaintext'=>'string'], -'gnupg_encryptsign' => ['string', 'identifier'=>'resource', 'plaintext'=>'string'], -'gnupg_export' => ['string', 'identifier'=>'resource', 'fingerprint'=>'string'], -'gnupg_geterror' => ['string', 'identifier'=>'resource'], -'gnupg_getprotocol' => ['int', 'identifier'=>'resource'], -'gnupg_import' => ['array', 'identifier'=>'resource', 'keydata'=>'string'], -'gnupg_init' => ['resource'], -'gnupg_keyinfo' => ['array', 'identifier'=>'resource', 'pattern'=>'string'], -'gnupg_setarmor' => ['bool', 'identifier'=>'resource', 'armor'=>'int'], -'gnupg_seterrormode' => ['void', 'identifier'=>'resource', 'errormode'=>'int'], -'gnupg_setsignmode' => ['bool', 'identifier'=>'resource', 'signmode'=>'int'], -'gnupg_sign' => ['string', 'identifier'=>'resource', 'plaintext'=>'string'], -'gnupg_verify' => ['array', 'identifier'=>'resource', 'signed_text'=>'string', 'signature'=>'string', 'plaintext='=>'string'], -'gopher_parsedir' => ['array', 'dirent'=>'string'], -'grapheme_extract' => ['string|false', 'str'=>'string', 'size'=>'int', 'extract_type='=>'int', 'start='=>'int', '&w_next='=>'int'], -'grapheme_stripos' => ['int|false', 'haystack'=>'string', 'needle'=>'string', 'offset='=>'int'], -'grapheme_stristr' => ['string|false', 'haystack'=>'string', 'needle'=>'string', 'part='=>'bool'], -'grapheme_strlen' => ['int|false', 'str'=>'string'], -'grapheme_strpos' => ['int|false', 'haystack'=>'string', 'needle'=>'string', 'offset='=>'int'], -'grapheme_strripos' => ['int|false', 'haystack'=>'string', 'needle'=>'string', 'offset='=>'int'], -'grapheme_strrpos' => ['int|false', 'haystack'=>'string', 'needle'=>'string', 'offset='=>'int'], -'grapheme_strstr' => ['string|false', 'haystack'=>'string', 'needle'=>'string', 'part='=>'bool'], -'grapheme_substr' => ['string|false', 'str'=>'string', 'start'=>'int', 'length='=>'int'], -'gregoriantojd' => ['int', 'month'=>'int', 'day'=>'int', 'year'=>'int'], -'gridObj::set' => ['int', 'property_name'=>'string', 'new_value'=>''], -'Grpc\Call::__construct' => ['void', 'channel'=>'Grpc\Channel', 'method'=>'string', 'absolute_deadline'=>'Grpc\Timeval', 'host_override='=>'mixed'], -'Grpc\Call::cancel' => [''], -'Grpc\Call::getPeer' => ['string'], -'Grpc\Call::setCredentials' => ['int', 'creds_obj'=>'Grpc\CallCredentials'], -'Grpc\Call::startBatch' => ['object', 'batch'=>'array'], -'Grpc\CallCredentials::createComposite' => ['Grpc\CallCredentials', 'cred1'=>'Grpc\CallCredentials', 'cred2'=>'Grpc\CallCredentials'], -'Grpc\CallCredentials::createFromPlugin' => ['Grpc\CallCredentials', 'callback'=>'Closure'], -'Grpc\Channel::__construct' => ['void', 'target'=>'string', 'args='=>'array'], -'Grpc\Channel::close' => [''], -'Grpc\Channel::getConnectivityState' => ['int', 'try_to_connect='=>'bool|false'], -'Grpc\Channel::getTarget' => ['string'], -'Grpc\Channel::watchConnectivityState' => ['bool', 'last_state'=>'int', 'deadline_obj'=>'Grpc\Timeval'], -'Grpc\ChannelCredentials::createComposite' => ['Grpc\ChannelCredentials', 'cred1'=>'Grpc\ChannelCredentials', 'cred2'=>'Grpc\CallCredentials'], -'Grpc\ChannelCredentials::createDefault' => ['Grpc\ChannelCredentials'], -'Grpc\ChannelCredentials::createInsecure' => ['null'], -'Grpc\ChannelCredentials::createSsl' => ['Grpc\ChannelCredentials', 'pem_root_certs'=>'string', 'pem_private_key='=>'string', 'pem_cert_chain='=>'string'], -'Grpc\ChannelCredentials::setDefaultRootsPem' => ['', 'pem_roots'=>'string'], -'Grpc\Server::__construct' => ['void', 'args'=>'array'], -'Grpc\Server::addHttp2Port' => ['bool', 'addr'=>'string'], -'Grpc\Server::addSecureHttp2Port' => ['bool', 'addr'=>'string', 'creds_obj'=>'Grpc\ServerCredentials'], -'Grpc\Server::requestCall' => ['', 'tag_new'=>'int', 'tag_cancel'=>'int'], -'Grpc\Server::start' => [''], -'Grpc\ServerCredentials::createSsl' => ['object', 'pem_root_certs'=>'string', 'pem_private_key'=>'string', 'pem_cert_chain'=>'string'], -'Grpc\Timeval::__construct' => ['void', 'usec'=>'int'], -'Grpc\Timeval::add' => ['Grpc\Timeval', 'other'=>'Grpc\Timeval'], -'Grpc\Timeval::compare' => ['int', 'a'=>'Grpc\Timeval', 'b'=>'Grpc\Timeval'], -'Grpc\Timeval::infFuture' => ['Grpc\Timeval'], -'Grpc\Timeval::infPast' => ['Grpc\Timeval'], -'Grpc\Timeval::now' => ['Grpc\Timeval'], -'Grpc\Timeval::similar' => ['bool', 'a'=>'Grpc\Timeval', 'b'=>'Grpc\Timeval', 'threshold'=>'Grpc\Timeval'], -'Grpc\Timeval::sleepUntil' => [''], -'Grpc\Timeval::subtract' => ['Grpc\Timeval', 'other'=>'Grpc\Timeval'], -'Grpc\Timeval::zero' => ['Grpc\Timeval'], -'gupnp_context_get_host_ip' => ['string', 'context'=>'resource'], -'gupnp_context_get_port' => ['int', 'context'=>'resource'], -'gupnp_context_get_subscription_timeout' => ['int', 'context'=>'resource'], -'gupnp_context_host_path' => ['bool', 'context'=>'resource', 'local_path'=>'string', 'server_path'=>'string'], -'gupnp_context_new' => ['resource', 'host_ip='=>'string', 'port='=>'int'], -'gupnp_context_set_subscription_timeout' => ['void', 'context'=>'resource', 'timeout'=>'int'], -'gupnp_context_timeout_add' => ['bool', 'context'=>'resource', 'timeout'=>'int', 'callback'=>'mixed', 'arg='=>'mixed'], -'gupnp_context_unhost_path' => ['bool', 'context'=>'resource', 'server_path'=>'string'], -'gupnp_control_point_browse_start' => ['bool', 'cpoint'=>'resource'], -'gupnp_control_point_browse_stop' => ['bool', 'cpoint'=>'resource'], -'gupnp_control_point_callback_set' => ['bool', 'cpoint'=>'resource', 'signal'=>'int', 'callback'=>'mixed', 'arg='=>'mixed'], -'gupnp_control_point_new' => ['resource', 'context'=>'resource', 'target'=>'string'], -'gupnp_device_action_callback_set' => ['bool', 'root_device'=>'resource', 'signal'=>'int', 'action_name'=>'string', 'callback'=>'mixed', 'arg='=>'mixed'], -'gupnp_device_info_get' => ['array', 'root_device'=>'resource'], -'gupnp_device_info_get_service' => ['resource', 'root_device'=>'resource', 'type'=>'string'], -'gupnp_root_device_get_available' => ['bool', 'root_device'=>'resource'], -'gupnp_root_device_get_relative_location' => ['string', 'root_device'=>'resource'], -'gupnp_root_device_new' => ['resource', 'context'=>'resource', 'location'=>'string', 'description_dir'=>'string'], -'gupnp_root_device_set_available' => ['bool', 'root_device'=>'resource', 'available'=>'bool'], -'gupnp_root_device_start' => ['bool', 'root_device'=>'resource'], -'gupnp_root_device_stop' => ['bool', 'root_device'=>'resource'], -'gupnp_service_action_get' => ['mixed', 'action'=>'resource', 'name'=>'string', 'type'=>'int'], -'gupnp_service_action_return' => ['bool', 'action'=>'resource'], -'gupnp_service_action_return_error' => ['bool', 'action'=>'resource', 'error_code'=>'int', 'error_description='=>'string'], -'gupnp_service_action_set' => ['bool', 'action'=>'resource', 'name'=>'string', 'type'=>'int', 'value'=>'mixed'], -'gupnp_service_freeze_notify' => ['bool', 'service'=>'resource'], -'gupnp_service_info_get' => ['array', 'proxy'=>'resource'], -'gupnp_service_info_get_introspection' => ['mixed', 'proxy'=>'resource', 'callback='=>'mixed', 'arg='=>'mixed'], -'gupnp_service_introspection_get_state_variable' => ['array', 'introspection'=>'resource', 'variable_name'=>'string'], -'gupnp_service_notify' => ['bool', 'service'=>'resource', 'name'=>'string', 'type'=>'int', 'value'=>'mixed'], -'gupnp_service_proxy_action_get' => ['mixed', 'proxy'=>'resource', 'action'=>'string', 'name'=>'string', 'type'=>'int'], -'gupnp_service_proxy_action_set' => ['bool', 'proxy'=>'resource', 'action'=>'string', 'name'=>'string', 'value'=>'mixed', 'type'=>'int'], -'gupnp_service_proxy_add_notify' => ['bool', 'proxy'=>'resource', 'value'=>'string', 'type'=>'int', 'callback'=>'mixed', 'arg='=>'mixed'], -'gupnp_service_proxy_callback_set' => ['bool', 'proxy'=>'resource', 'signal'=>'int', 'callback'=>'mixed', 'arg='=>'mixed'], -'gupnp_service_proxy_get_subscribed' => ['bool', 'proxy'=>'resource'], -'gupnp_service_proxy_remove_notify' => ['bool', 'proxy'=>'resource', 'value'=>'string'], -'gupnp_service_proxy_send_action' => ['array', 'proxy'=>'resource', 'action'=>'string', 'in_params'=>'array', 'out_params'=>'array'], -'gupnp_service_proxy_set_subscribed' => ['bool', 'proxy'=>'resource', 'subscribed'=>'bool'], -'gupnp_service_thaw_notify' => ['bool', 'service'=>'resource'], -'gzclose' => ['bool', 'zp'=>'resource'], -'gzcompress' => ['string|false', 'data'=>'string', 'level='=>'int', 'encoding='=>'int'], -'gzdecode' => ['string|false', 'data'=>'string', 'length='=>'int'], -'gzdeflate' => ['string|false', 'data'=>'string', 'level='=>'int', 'encoding='=>'int'], -'gzencode' => ['string|false', 'data'=>'string', 'level='=>'int', 'encoding_mode='=>'int'], -'gzeof' => ['int', 'zp'=>'resource'], -'gzfile' => ['array', 'filename'=>'string', 'use_include_path='=>'int'], -'gzgetc' => ['string|false', 'zp'=>'resource'], -'gzgets' => ['string|false', 'zp'=>'resource', 'length='=>'int'], -'gzgetss' => ['string|false', 'zp'=>'resource', 'length'=>'int', 'allowable_tags='=>'string'], -'gzinflate' => ['string|false', 'data'=>'string', 'length='=>'int'], -'gzopen' => ['resource|false', 'filename'=>'string', 'mode'=>'string', 'use_include_path='=>'int'], -'gzpassthru' => ['int|false', 'zp'=>'resource'], -'gzputs' => ['int', 'zp'=>'resource', 'string'=>'string', 'length='=>'int'], -'gzread' => ['string', 'zp'=>'resource', 'length'=>'int'], -'gzrewind' => ['bool', 'zp'=>'resource'], -'gzseek' => ['int', 'zp'=>'resource', 'offset'=>'int', 'whence='=>'int'], -'gztell' => ['int|false', 'zp'=>'resource'], -'gzuncompress' => ['string|false', 'data'=>'string', 'length='=>'int'], -'gzwrite' => ['int', 'zp'=>'resource', 'string'=>'string', 'length='=>'int'], -'HaruAnnotation::setBorderStyle' => ['bool', 'width'=>'float', 'dash_on'=>'int', 'dash_off'=>'int'], -'HaruAnnotation::setHighlightMode' => ['bool', 'mode'=>'int'], -'HaruAnnotation::setIcon' => ['bool', 'icon'=>'int'], -'HaruAnnotation::setOpened' => ['bool', 'opened'=>'bool'], -'HaruDestination::setFit' => ['bool'], -'HaruDestination::setFitB' => ['bool'], -'HaruDestination::setFitBH' => ['bool', 'top'=>'float'], -'HaruDestination::setFitBV' => ['bool', 'left'=>'float'], -'HaruDestination::setFitH' => ['bool', 'top'=>'float'], -'HaruDestination::setFitR' => ['bool', 'left'=>'float', 'bottom'=>'float', 'right'=>'float', 'top'=>'float'], -'HaruDestination::setFitV' => ['bool', 'left'=>'float'], -'HaruDestination::setXYZ' => ['bool', 'left'=>'float', 'top'=>'float', 'zoom'=>'float'], -'HaruDoc::__construct' => ['void'], -'HaruDoc::addPage' => ['object'], -'HaruDoc::addPageLabel' => ['bool', 'first_page'=>'int', 'style'=>'int', 'first_num'=>'int', 'prefix='=>'string'], -'HaruDoc::createOutline' => ['object', 'title'=>'string', 'parent_outline='=>'object', 'encoder='=>'object'], -'HaruDoc::getCurrentEncoder' => ['object'], -'HaruDoc::getCurrentPage' => ['object'], -'HaruDoc::getEncoder' => ['object', 'encoding'=>'string'], -'HaruDoc::getFont' => ['object', 'fontname'=>'string', 'encoding='=>'string'], -'HaruDoc::getInfoAttr' => ['string', 'type'=>'int'], -'HaruDoc::getPageLayout' => ['int'], -'HaruDoc::getPageMode' => ['int'], -'HaruDoc::getStreamSize' => ['int'], -'HaruDoc::insertPage' => ['object', 'page'=>'object'], -'HaruDoc::loadJPEG' => ['object', 'filename'=>'string'], -'HaruDoc::loadPNG' => ['object', 'filename'=>'string', 'deferred='=>'bool'], -'HaruDoc::loadRaw' => ['object', 'filename'=>'string', 'width'=>'int', 'height'=>'int', 'color_space'=>'int'], -'HaruDoc::loadTTC' => ['string', 'fontfile'=>'string', 'index'=>'int', 'embed='=>'bool'], -'HaruDoc::loadTTF' => ['string', 'fontfile'=>'string', 'embed='=>'bool'], -'HaruDoc::loadType1' => ['string', 'afmfile'=>'string', 'pfmfile='=>'string'], -'HaruDoc::output' => ['bool'], -'HaruDoc::readFromStream' => ['string', 'bytes'=>'int'], -'HaruDoc::resetError' => ['bool'], -'HaruDoc::resetStream' => ['bool'], -'HaruDoc::save' => ['bool', 'file'=>'string'], -'HaruDoc::saveToStream' => ['bool'], -'HaruDoc::setCompressionMode' => ['bool', 'mode'=>'int'], -'HaruDoc::setCurrentEncoder' => ['bool', 'encoding'=>'string'], -'HaruDoc::setEncryptionMode' => ['bool', 'mode'=>'int', 'key_len='=>'int'], -'HaruDoc::setInfoAttr' => ['bool', 'type'=>'int', 'info'=>'string'], -'HaruDoc::setInfoDateAttr' => ['bool', 'type'=>'int', 'year'=>'int', 'month'=>'int', 'day'=>'int', 'hour'=>'int', 'min'=>'int', 'sec'=>'int', 'ind'=>'string', 'off_hour'=>'int', 'off_min'=>'int'], -'HaruDoc::setOpenAction' => ['bool', 'destination'=>'object'], -'HaruDoc::setPageLayout' => ['bool', 'layout'=>'int'], -'HaruDoc::setPageMode' => ['bool', 'mode'=>'int'], -'HaruDoc::setPagesConfiguration' => ['bool', 'page_per_pages'=>'int'], -'HaruDoc::setPassword' => ['bool', 'owner_password'=>'string', 'user_password'=>'string'], -'HaruDoc::setPermission' => ['bool', 'permission'=>'int'], -'HaruDoc::useCNSEncodings' => ['bool'], -'HaruDoc::useCNSFonts' => ['bool'], -'HaruDoc::useCNTEncodings' => ['bool'], -'HaruDoc::useCNTFonts' => ['bool'], -'HaruDoc::useJPEncodings' => ['bool'], -'HaruDoc::useJPFonts' => ['bool'], -'HaruDoc::useKREncodings' => ['bool'], -'HaruDoc::useKRFonts' => ['bool'], -'HaruEncoder::getByteType' => ['int', 'text'=>'string', 'index'=>'int'], -'HaruEncoder::getType' => ['int'], -'HaruEncoder::getUnicode' => ['int', 'character'=>'int'], -'HaruEncoder::getWritingMode' => ['int'], -'HaruFont::getAscent' => ['int'], -'HaruFont::getCapHeight' => ['int'], -'HaruFont::getDescent' => ['int'], -'HaruFont::getEncodingName' => ['string'], -'HaruFont::getFontName' => ['string'], -'HaruFont::getTextWidth' => ['array', 'text'=>'string'], -'HaruFont::getUnicodeWidth' => ['int', 'character'=>'int'], -'HaruFont::getXHeight' => ['int'], -'HaruFont::measureText' => ['int', 'text'=>'string', 'width'=>'float', 'font_size'=>'float', 'char_space'=>'float', 'word_space'=>'float', 'word_wrap='=>'bool'], -'HaruImage::getBitsPerComponent' => ['int'], -'HaruImage::getColorSpace' => ['string'], -'HaruImage::getHeight' => ['int'], -'HaruImage::getSize' => ['array'], -'HaruImage::getWidth' => ['int'], -'HaruImage::setColorMask' => ['bool', 'rmin'=>'int', 'rmax'=>'int', 'gmin'=>'int', 'gmax'=>'int', 'bmin'=>'int', 'bmax'=>'int'], -'HaruImage::setMaskImage' => ['bool', 'mask_image'=>'object'], -'HaruOutline::setDestination' => ['bool', 'destination'=>'object'], -'HaruOutline::setOpened' => ['bool', 'opened'=>'bool'], -'HaruPage::arc' => ['bool', 'x'=>'float', 'y'=>'float', 'ray'=>'float', 'ang1'=>'float', 'ang2'=>'float'], -'HaruPage::beginText' => ['bool'], -'HaruPage::circle' => ['bool', 'x'=>'float', 'y'=>'float', 'ray'=>'float'], -'HaruPage::closePath' => ['bool'], -'HaruPage::concat' => ['bool', 'a'=>'float', 'b'=>'float', 'c'=>'float', 'd'=>'float', 'x'=>'float', 'y'=>'float'], -'HaruPage::createDestination' => ['object'], -'HaruPage::createLinkAnnotation' => ['object', 'rectangle'=>'array', 'destination'=>'object'], -'HaruPage::createTextAnnotation' => ['object', 'rectangle'=>'array', 'text'=>'string', 'encoder='=>'object'], -'HaruPage::createURLAnnotation' => ['object', 'rectangle'=>'array', 'url'=>'string'], -'HaruPage::curveTo' => ['bool', 'x1'=>'float', 'y1'=>'float', 'x2'=>'float', 'y2'=>'float', 'x3'=>'float', 'y3'=>'float'], -'HaruPage::curveTo2' => ['bool', 'x2'=>'float', 'y2'=>'float', 'x3'=>'float', 'y3'=>'float'], -'HaruPage::curveTo3' => ['bool', 'x1'=>'float', 'y1'=>'float', 'x3'=>'float', 'y3'=>'float'], -'HaruPage::drawImage' => ['bool', 'image'=>'object', 'x'=>'float', 'y'=>'float', 'width'=>'float', 'height'=>'float'], -'HaruPage::ellipse' => ['bool', 'x'=>'float', 'y'=>'float', 'xray'=>'float', 'yray'=>'float'], -'HaruPage::endPath' => ['bool'], -'HaruPage::endText' => ['bool'], -'HaruPage::eofill' => ['bool'], -'HaruPage::eoFillStroke' => ['bool', 'close_path='=>'bool'], -'HaruPage::fill' => ['bool'], -'HaruPage::fillStroke' => ['bool', 'close_path='=>'bool'], -'HaruPage::getCharSpace' => ['float'], -'HaruPage::getCMYKFill' => ['array'], -'HaruPage::getCMYKStroke' => ['array'], -'HaruPage::getCurrentFont' => ['object'], -'HaruPage::getCurrentFontSize' => ['float'], -'HaruPage::getCurrentPos' => ['array'], -'HaruPage::getCurrentTextPos' => ['array'], -'HaruPage::getDash' => ['array'], -'HaruPage::getFillingColorSpace' => ['int'], -'HaruPage::getFlatness' => ['float'], -'HaruPage::getGMode' => ['int'], -'HaruPage::getGrayFill' => ['float'], -'HaruPage::getGrayStroke' => ['float'], -'HaruPage::getHeight' => ['float'], -'HaruPage::getHorizontalScaling' => ['float'], -'HaruPage::getLineCap' => ['int'], -'HaruPage::getLineJoin' => ['int'], -'HaruPage::getLineWidth' => ['float'], -'HaruPage::getMiterLimit' => ['float'], -'HaruPage::getRGBFill' => ['array'], -'HaruPage::getRGBStroke' => ['array'], -'HaruPage::getStrokingColorSpace' => ['int'], -'HaruPage::getTextLeading' => ['float'], -'HaruPage::getTextMatrix' => ['array'], -'HaruPage::getTextRenderingMode' => ['int'], -'HaruPage::getTextRise' => ['float'], -'HaruPage::getTextWidth' => ['float', 'text'=>'string'], -'HaruPage::getTransMatrix' => ['array'], -'HaruPage::getWidth' => ['float'], -'HaruPage::getWordSpace' => ['float'], -'HaruPage::lineTo' => ['bool', 'x'=>'float', 'y'=>'float'], -'HaruPage::measureText' => ['int', 'text'=>'string', 'width'=>'float', 'wordwrap='=>'bool'], -'HaruPage::moveTextPos' => ['bool', 'x'=>'float', 'y'=>'float', 'set_leading='=>'bool'], -'HaruPage::moveTo' => ['bool', 'x'=>'float', 'y'=>'float'], -'HaruPage::moveToNextLine' => ['bool'], -'HaruPage::rectangle' => ['bool', 'x'=>'float', 'y'=>'float', 'width'=>'float', 'height'=>'float'], -'HaruPage::setCharSpace' => ['bool', 'char_space'=>'float'], -'HaruPage::setCMYKFill' => ['bool', 'c'=>'float', 'm'=>'float', 'y'=>'float', 'k'=>'float'], -'HaruPage::setCMYKStroke' => ['bool', 'c'=>'float', 'm'=>'float', 'y'=>'float', 'k'=>'float'], -'HaruPage::setDash' => ['bool', 'pattern'=>'array', 'phase'=>'int'], -'HaruPage::setFlatness' => ['bool', 'flatness'=>'float'], -'HaruPage::setFontAndSize' => ['bool', 'font'=>'object', 'size'=>'float'], -'HaruPage::setGrayFill' => ['bool', 'value'=>'float'], -'HaruPage::setGrayStroke' => ['bool', 'value'=>'float'], -'HaruPage::setHeight' => ['bool', 'height'=>'float'], -'HaruPage::setHorizontalScaling' => ['bool', 'scaling'=>'float'], -'HaruPage::setLineCap' => ['bool', 'cap'=>'int'], -'HaruPage::setLineJoin' => ['bool', 'join'=>'int'], -'HaruPage::setLineWidth' => ['bool', 'width'=>'float'], -'HaruPage::setMiterLimit' => ['bool', 'limit'=>'float'], -'HaruPage::setRGBFill' => ['bool', 'r'=>'float', 'g'=>'float', 'b'=>'float'], -'HaruPage::setRGBStroke' => ['bool', 'r'=>'float', 'g'=>'float', 'b'=>'float'], -'HaruPage::setRotate' => ['bool', 'angle'=>'int'], -'HaruPage::setSize' => ['bool', 'size'=>'int', 'direction'=>'int'], -'HaruPage::setSlideShow' => ['bool', 'type'=>'int', 'disp_time'=>'float', 'trans_time'=>'float'], -'HaruPage::setTextLeading' => ['bool', 'text_leading'=>'float'], -'HaruPage::setTextMatrix' => ['bool', 'a'=>'float', 'b'=>'float', 'c'=>'float', 'd'=>'float', 'x'=>'float', 'y'=>'float'], -'HaruPage::setTextRenderingMode' => ['bool', 'mode'=>'int'], -'HaruPage::setTextRise' => ['bool', 'rise'=>'float'], -'HaruPage::setWidth' => ['bool', 'width'=>'float'], -'HaruPage::setWordSpace' => ['bool', 'word_space'=>'float'], -'HaruPage::showText' => ['bool', 'text'=>'string'], -'HaruPage::showTextNextLine' => ['bool', 'text'=>'string', 'word_space='=>'float', 'char_space='=>'float'], -'HaruPage::stroke' => ['bool', 'close_path='=>'bool'], -'HaruPage::textOut' => ['bool', 'x'=>'float', 'y'=>'float', 'text'=>'string'], -'HaruPage::textRect' => ['bool', 'left'=>'float', 'top'=>'float', 'right'=>'float', 'bottom'=>'float', 'text'=>'string', 'align='=>'int'], -'hash' => ['string', 'algo'=>'string', 'data'=>'string', 'raw_output='=>'bool'], -'hash_algos' => ['array'], -'hash_copy' => ['HashContext', 'context'=>'HashContext'], -'hash_equals' => ['bool', 'known_string'=>'string', 'user_string'=>'string'], -'hash_file' => ['string', 'algo'=>'string', 'filename'=>'string', 'raw_output='=>'bool'], -'hash_final' => ['string', 'context'=>'HashContext', 'raw_output='=>'bool'], -'hash_hkdf' => ['string', 'algo'=>'string', 'ikm'=>'string', 'length='=>'int', 'info='=>'string', 'salt='=>'string'], -'hash_hmac' => ['string', 'algo'=>'string', 'data'=>'string', 'key'=>'string', 'raw_output='=>'bool'], -'hash_hmac_algos' => ['array'], -'hash_hmac_file' => ['string', 'algo'=>'string', 'filename'=>'string', 'key'=>'string', 'raw_output='=>'bool'], -'hash_init' => ['HashContext', 'algo'=>'string', 'options='=>'int', 'key='=>'string'], -'hash_pbkdf2' => ['string', 'algo'=>'string', 'password'=>'string', 'salt'=>'string', 'iterations'=>'int', 'length='=>'int', 'raw_output='=>'bool'], -'hash_update' => ['bool', 'context'=>'HashContext', 'data'=>'string'], -'hash_update_file' => ['bool', 'context='=>'HashContext', 'filename'=>'string', 'scontext='=>'?HashContext'], -'hash_update_stream' => ['int', 'context'=>'HashContext', 'handle'=>'resource', 'length='=>'int'], -'hashTableObj::clear' => ['void'], -'hashTableObj::get' => ['string', 'key'=>'string'], -'hashTableObj::nextkey' => ['string', 'previousKey'=>'string'], -'hashTableObj::remove' => ['int', 'key'=>'string'], -'hashTableObj::set' => ['int', 'key'=>'string', 'value'=>'string'], -'header' => ['void', 'header'=>'string', 'replace='=>'bool', 'http_response_code='=>'int'], -'header_register_callback' => ['bool', 'callback'=>'callable'], -'header_remove' => ['void', 'name='=>'string'], -'headers_list' => ['array'], -'headers_sent' => ['bool', '&w_file='=>'string', '&w_line='=>'int'], -'hebrev' => ['string', 'str'=>'string', 'max_chars_per_line='=>'int'], -'hebrevc' => ['string', 'str'=>'string', 'max_chars_per_line='=>'int'], -'hex2bin' => ['string|false', 'data'=>'string'], -'hexdec' => ['int|float', 'hexadecimal_number'=>'string'], -'highlight_file' => ['string|bool', 'file_name'=>'string', 'return='=>'bool'], -'highlight_string' => ['string|bool', 'string'=>'string', 'return='=>'bool'], -'hrtime' => ['array{0:int,1:int}|int|float|false', 'get_as_number='=>'bool'], -'HRTime\PerformanceCounter::getElapsedTicks' => ['int'], -'HRTime\PerformanceCounter::getFrequency' => ['int'], -'HRTime\PerformanceCounter::getLastElapsedTicks' => ['int'], -'HRTime\PerformanceCounter::getTicks' => ['int'], -'HRTime\PerformanceCounter::getTicksSince' => ['int', 'start'=>'int'], -'HRTime\PerformanceCounter::isRunning' => ['bool'], -'HRTime\PerformanceCounter::start' => ['void'], -'HRTime\PerformanceCounter::stop' => ['void'], -'HRTime\StopWatch::getElapsedTicks' => ['int'], -'HRTime\StopWatch::getElapsedTime' => ['float', 'unit='=>'int'], -'HRTime\StopWatch::getLastElapsedTicks' => ['int'], -'HRTime\StopWatch::getLastElapsedTime' => ['float', 'unit='=>'int'], -'HRTime\StopWatch::isRunning' => ['bool'], -'HRTime\StopWatch::start' => ['void'], -'HRTime\StopWatch::stop' => ['void'], -'html_entity_decode' => ['string', 'string'=>'string', 'quote_style='=>'int', 'encoding='=>'string'], -'htmlentities' => ['string', 'string'=>'string', 'quote_style='=>'int', 'encoding='=>'string', 'double_encode='=>'bool'], -'htmlspecialchars' => ['string', 'string'=>'string', 'quote_style='=>'int', 'encoding='=>'string', 'double_encode='=>'bool'], -'htmlspecialchars_decode' => ['string', 'string'=>'string', 'quote_style='=>'int'], -'http\Env\Request::__construct' => ['void'], -'http\Env\Request::getCookie' => ['mixed', 'name='=>'string', 'type='=>'mixed', 'defval='=>'mixed', 'delete='=>'bool|false'], -'http\Env\Request::getFiles' => ['array'], -'http\Env\Request::getForm' => ['mixed', 'name='=>'string', 'type='=>'mixed', 'defval='=>'mixed', 'delete='=>'bool|false'], -'http\Env\Request::getQuery' => ['mixed', 'name='=>'string', 'type='=>'mixed', 'defval='=>'mixed', 'delete='=>'bool|false'], -'http\Env\Response::__construct' => ['void'], -'http\Env\Response::__invoke' => ['bool', 'data'=>'string', 'ob_flags='=>'int'], -'http\Env\Response::isCachedByETag' => ['int', 'header_name='=>'string'], -'http\Env\Response::isCachedByLastModified' => ['int', 'header_name='=>'string'], -'http\Env\Response::send' => ['bool', 'stream='=>'resource'], -'http\Env\Response::setCacheControl' => ['http\Env\Response', 'cache_control'=>'string'], -'http\Env\Response::setContentDisposition' => ['http\Env\Response', 'disposition_params'=>'array'], -'http\Env\Response::setContentEncoding' => ['http\Env\Response', 'content_encoding'=>'int'], -'http\Env\Response::setContentType' => ['http\Env\Response', 'content_type'=>'string'], -'http\Env\Response::setCookie' => ['http\Env\Response', 'cookie'=>'mixed'], -'http\Env\Response::setEnvRequest' => ['http\Env\Response', 'env_request'=>'http\Message'], -'http\Env\Response::setEtag' => ['http\Env\Response', 'etag'=>'string'], -'http\Env\Response::setLastModified' => ['http\Env\Response', 'last_modified'=>'int'], -'http\Env\Response::setThrottleRate' => ['http\Env\Response', 'chunk_size'=>'int', 'delay='=>'float|int'], -'http\QueryString::__construct' => ['void', 'querystring'=>'string'], -'http\QueryString::__toString' => ['string'], -'http\QueryString::get' => ['', 'name='=>'string', 'type='=>'mixed', 'defval='=>'mixed', 'delete='=>'bool|false'], -'http\QueryString::getArray' => ['array', 'name'=>'string', 'defval='=>'mixed', 'delete='=>'bool|false'], -'http\QueryString::getBool' => ['bool', 'name'=>'string', 'defval='=>'mixed', 'delete='=>'bool|false'], -'http\QueryString::getFloat' => ['float', 'name'=>'string', 'defval='=>'mixed', 'delete='=>'bool|false'], -'http\QueryString::getGlobalInstance' => ['http\QueryString'], -'http\QueryString::getInt' => ['int', 'name'=>'string', 'defval='=>'mixed', 'delete='=>'bool|false'], -'http\QueryString::getIterator' => ['IteratorAggregate'], -'http\QueryString::getObject' => ['', 'name'=>'string', 'defval='=>'mixed', 'delete='=>'bool|false'], -'http\QueryString::getString' => ['string', 'name'=>'string', 'defval='=>'mixed', 'delete='=>'bool|false'], -'http\QueryString::mod' => ['http\QueryString', 'params='=>'mixed'], -'http\QueryString::offsetExists' => ['bool', 'offset'=>'mixed'], -'http\QueryString::offsetGet' => ['mixed', 'offset'=>'mixed'], -'http\QueryString::offsetSet' => ['void', 'offset'=>'mixed', 'value'=>'mixed'], -'http\QueryString::offsetUnset' => ['void', 'offset'=>'mixed'], -'http\QueryString::serialize' => ['string'], -'http\QueryString::set' => ['http\QueryString', 'params'=>'mixed'], -'http\QueryString::toArray' => ['mixed[]'], -'http\QueryString::toString' => ['string'], -'http\QueryString::unserialize' => ['void', 'serialized'=>''], -'http\QueryString::xlate' => ['http\QueryString'], -'http\Url::__construct' => ['void', 'old_url='=>'mixed', 'new_url='=>'mixed', 'flags='=>'int'], -'http\Url::__toString' => [''], -'http\Url::mod' => ['http\Url', 'parts'=>'mixed', 'flags='=>'float|int|mixed'], -'http\Url::toArray' => ['string[]'], -'http\Url::toString' => ['string'], -'http_build_cookie' => ['string', 'cookie'=>'array'], -'http_build_query' => ['string', 'querydata'=>'array|object', 'prefix='=>'string', 'arg_separator='=>'string', 'enc_type='=>'int'], -'http_build_str' => ['string', 'query'=>'array', 'prefix='=>'?string', 'arg_separator='=>'string'], -'http_build_url' => ['string', 'url='=>'string|array', 'parts='=>'string|array', 'flags='=>'int', 'new_url='=>'array'], -'http_cache_etag' => ['bool', 'etag='=>'string'], -'http_cache_last_modified' => ['bool', 'timestamp_or_expires='=>'int'], -'http_chunked_decode' => ['string', 'encoded'=>'string'], -'http_date' => ['string', 'timestamp='=>'int'], -'http_deflate' => ['string', 'data'=>'string', 'flags='=>'int'], -'http_get' => ['string', 'url'=>'string', 'options='=>'array', 'info='=>'array'], -'http_get_request_body' => ['string'], -'http_get_request_body_stream' => ['resource'], -'http_get_request_headers' => ['array'], -'http_head' => ['string', 'url'=>'string', 'options='=>'array', 'info='=>'array'], -'http_inflate' => ['string', 'data'=>'string'], -'http_match_etag' => ['bool', 'etag'=>'string', 'for_range='=>'bool'], -'http_match_modified' => ['bool', 'timestamp='=>'int', 'for_range='=>'bool'], -'http_match_request_header' => ['bool', 'header'=>'string', 'value'=>'string', 'match_case='=>'bool'], -'http_negotiate_charset' => ['string', 'supported'=>'array', 'result='=>'array'], -'http_negotiate_content_type' => ['string', 'supported'=>'array', 'result='=>'array'], -'http_negotiate_language' => ['string', 'supported'=>'array', 'result='=>'array'], -'http_parse_cookie' => ['object', 'cookie'=>'string', 'flags='=>'int', 'allowed_extras='=>'array'], -'http_parse_headers' => ['array', 'header'=>'string'], -'http_parse_message' => ['object', 'message'=>'string'], -'http_parse_params' => ['object', 'param'=>'string', 'flags='=>'int'], -'http_persistent_handles_clean' => ['string', 'ident='=>'string'], -'http_persistent_handles_count' => ['object'], -'http_persistent_handles_ident' => ['string', 'ident='=>'string'], -'http_post_data' => ['string', 'url'=>'string', 'data'=>'string', 'options='=>'array', 'info='=>'array'], -'http_post_fields' => ['string', 'url'=>'string', 'data'=>'array', 'files='=>'array', 'options='=>'array', 'info='=>'array'], -'http_put_data' => ['string', 'url'=>'string', 'data'=>'string', 'options='=>'array', 'info='=>'array'], -'http_put_file' => ['string', 'url'=>'string', 'file'=>'string', 'options='=>'array', 'info='=>'array'], -'http_put_stream' => ['string', 'url'=>'string', 'stream'=>'', 'options='=>'array', 'info='=>'array'], -'http_redirect' => ['bool', 'url='=>'string', 'params='=>'array', 'session='=>'bool', 'status='=>'int'], -'http_request' => ['string', 'method'=>'int', 'url'=>'string', 'body='=>'string', 'options='=>'array', 'info='=>'array'], -'http_request_body_encode' => ['string', 'fields'=>'array', 'files'=>'array'], -'http_request_method_exists' => ['int', 'method'=>''], -'http_request_method_name' => ['string', 'method'=>'int'], -'http_request_method_register' => ['int', 'method'=>'string'], -'http_request_method_unregister' => ['bool', 'method'=>''], -'http_response_code' => ['int|bool', 'response_code='=>'int'], -'http_send_content_disposition' => ['bool', 'filename'=>'string', 'inline='=>'bool'], -'http_send_content_type' => ['bool', 'content_type='=>'string'], -'http_send_data' => ['bool', 'data'=>'string'], -'http_send_file' => ['bool', 'file'=>'string'], -'http_send_last_modified' => ['bool', 'timestamp='=>'int'], -'http_send_status' => ['bool', 'status'=>'int'], -'http_send_stream' => ['bool', 'stream'=>''], -'http_support' => ['int', 'feature='=>'int'], -'http_throttle' => ['', 'sec'=>'float', 'bytes='=>'int'], -'HttpDeflateStream::__construct' => ['void', 'flags='=>'int'], -'HttpDeflateStream::factory' => ['HttpDeflateStream', 'flags='=>'int', 'class_name='=>'string'], -'HttpDeflateStream::finish' => ['string', 'data='=>'string'], -'HttpDeflateStream::flush' => ['string', 'data='=>'string'], -'HttpDeflateStream::update' => ['string', 'data'=>'string'], -'HttpInflateStream::__construct' => ['void', 'flags='=>'int'], -'HttpInflateStream::factory' => ['HttpInflateStream', 'flags='=>'int', 'class_name='=>'string'], -'HttpInflateStream::finish' => ['string', 'data='=>'string'], -'HttpInflateStream::flush' => ['string', 'data='=>'string'], -'HttpInflateStream::update' => ['string', 'data'=>'string'], -'HttpMessage::__construct' => ['void', 'message='=>'string'], -'HttpMessage::__toString' => ['string'], -'HttpMessage::addHeaders' => ['', 'headers'=>'array', 'append='=>'bool'], -'HttpMessage::count' => ['int'], -'HttpMessage::current' => ['mixed'], -'HttpMessage::detach' => ['HttpMessage'], -'HttpMessage::factory' => ['HttpMessage', 'raw_message='=>'string', 'class_name='=>'string'], -'HttpMessage::fromEnv' => ['HttpMessage', 'message_type'=>'int', 'class_name='=>'string'], -'HttpMessage::fromString' => ['HttpMessage', 'raw_message='=>'string', 'class_name='=>'string'], -'HttpMessage::getBody' => ['string'], -'HttpMessage::getHeader' => ['string', 'header'=>'string'], -'HttpMessage::getHeaders' => ['array'], -'HttpMessage::getHttpVersion' => ['string'], -'HttpMessage::getInfo' => [''], -'HttpMessage::getParentMessage' => ['HttpMessage'], -'HttpMessage::getRequestMethod' => ['string'], -'HttpMessage::getRequestUrl' => ['string'], -'HttpMessage::getResponseCode' => ['int'], -'HttpMessage::getResponseStatus' => ['string'], -'HttpMessage::getType' => ['int'], -'HttpMessage::guessContentType' => ['string', 'magic_file'=>'string', 'magic_mode='=>'int'], -'HttpMessage::key' => ['int|string'], -'HttpMessage::next' => ['void'], -'HttpMessage::prepend' => ['', 'message'=>'httpmessage', 'top='=>'bool'], -'HttpMessage::reverse' => ['HttpMessage'], -'HttpMessage::rewind' => ['void'], -'HttpMessage::send' => ['bool'], -'HttpMessage::serialize' => ['string'], -'HttpMessage::setBody' => ['', 'body'=>'string'], -'HttpMessage::setHeaders' => ['', 'headers'=>'array'], -'HttpMessage::setHttpVersion' => ['bool', 'version'=>'string'], -'HttpMessage::setInfo' => ['', 'http_info'=>''], -'HttpMessage::setRequestMethod' => ['bool', 'method'=>'string'], -'HttpMessage::setRequestUrl' => ['bool', 'url'=>'string'], -'HttpMessage::setResponseCode' => ['bool', 'code'=>'int'], -'HttpMessage::setResponseStatus' => ['bool', 'status'=>'string'], -'HttpMessage::setType' => ['', 'type'=>'int'], -'HttpMessage::toMessageTypeObject' => ['HttpRequest|HttpResponse'], -'HttpMessage::toString' => ['string', 'include_parent='=>'bool'], -'HttpMessage::unserialize' => ['void', 'serialized'=>''], -'HttpMessage::valid' => ['bool'], -'HttpQueryString::__construct' => ['void', 'global='=>'bool', 'add='=>''], -'HttpQueryString::__toString' => ['string'], -'HttpQueryString::factory' => ['', 'global'=>'', 'params'=>'', 'class_name'=>''], -'HttpQueryString::get' => ['', 'key='=>'string', 'type='=>'', 'defval='=>'', 'delete='=>'bool'], -'HttpQueryString::getArray' => ['', 'name'=>'', 'defval'=>'', 'delete'=>''], -'HttpQueryString::getBool' => ['', 'name'=>'', 'defval'=>'', 'delete'=>''], -'HttpQueryString::getFloat' => ['', 'name'=>'', 'defval'=>'', 'delete'=>''], -'HttpQueryString::getInt' => ['', 'name'=>'', 'defval'=>'', 'delete'=>''], -'HttpQueryString::getObject' => ['', 'name'=>'', 'defval'=>'', 'delete'=>''], -'HttpQueryString::getString' => ['', 'name'=>'', 'defval'=>'', 'delete'=>''], -'HttpQueryString::mod' => ['HttpQueryString', 'params'=>''], -'HttpQueryString::offsetExists' => ['bool', 'offset'=>'mixed'], -'HttpQueryString::offsetGet' => ['mixed', 'offset'=>'mixed'], -'HttpQueryString::offsetSet' => ['void', 'offset'=>'mixed', 'value'=>'mixed'], -'HttpQueryString::offsetUnset' => ['void', 'offset'=>'mixed'], -'HttpQueryString::serialize' => ['string'], -'HttpQueryString::set' => ['string', 'params'=>''], -'HttpQueryString::singleton' => ['HttpQueryString', 'global='=>'bool'], -'HttpQueryString::toArray' => ['array'], -'HttpQueryString::toString' => ['string'], -'HttpQueryString::unserialize' => ['void', 'serialized'=>'string'], -'HttpQueryString::xlate' => ['bool', 'ie'=>'string', 'oe'=>'string'], -'HttpRequest::__construct' => ['void', 'url='=>'string', 'request_method='=>'int', 'options='=>'array'], -'HttpRequest::addBody' => ['', 'request_body_data'=>''], -'HttpRequest::addCookies' => ['bool', 'cookies'=>'array'], -'HttpRequest::addHeaders' => ['bool', 'headers'=>'array'], -'HttpRequest::addPostFields' => ['bool', 'post_data'=>'array'], -'HttpRequest::addPostFile' => ['bool', 'name'=>'string', 'file'=>'string', 'content_type='=>'string'], -'HttpRequest::addPutData' => ['bool', 'put_data'=>'string'], -'HttpRequest::addQueryData' => ['bool', 'query_params'=>'array'], -'HttpRequest::addRawPostData' => ['bool', 'raw_post_data'=>'string'], -'HttpRequest::addSslOptions' => ['bool', 'options'=>'array'], -'HttpRequest::clearHistory' => [''], -'HttpRequest::enableCookies' => ['bool'], -'HttpRequest::encodeBody' => ['', 'fields'=>'', 'files'=>''], -'HttpRequest::factory' => ['', 'url'=>'', 'method'=>'', 'options'=>'', 'class_name'=>''], -'HttpRequest::flushCookies' => [''], -'HttpRequest::get' => ['', 'url'=>'', 'options'=>'', '&info'=>''], -'HttpRequest::getBody' => [''], -'HttpRequest::getContentType' => ['string'], -'HttpRequest::getCookies' => ['array'], -'HttpRequest::getHeaders' => ['array'], -'HttpRequest::getHistory' => ['HttpMessage'], -'HttpRequest::getMethod' => ['int'], -'HttpRequest::getOptions' => ['array'], -'HttpRequest::getPostFields' => ['array'], -'HttpRequest::getPostFiles' => ['array'], -'HttpRequest::getPutData' => ['string'], -'HttpRequest::getPutFile' => ['string'], -'HttpRequest::getQueryData' => ['string'], -'HttpRequest::getRawPostData' => ['string'], -'HttpRequest::getRawRequestMessage' => ['string'], -'HttpRequest::getRawResponseMessage' => ['string'], -'HttpRequest::getRequestMessage' => ['HttpMessage'], -'HttpRequest::getResponseBody' => ['string'], -'HttpRequest::getResponseCode' => ['int'], -'HttpRequest::getResponseCookies' => ['array', 'flags='=>'int', 'allowed_extras='=>'array'], -'HttpRequest::getResponseData' => ['array'], -'HttpRequest::getResponseHeader' => ['', 'name='=>'string'], -'HttpRequest::getResponseInfo' => ['', 'name='=>'string'], -'HttpRequest::getResponseMessage' => ['HttpMessage'], -'HttpRequest::getResponseStatus' => ['string'], -'HttpRequest::getSslOptions' => ['array'], -'HttpRequest::getUrl' => ['string'], -'HttpRequest::head' => ['', 'url'=>'', 'options'=>'', '&info'=>''], -'HttpRequest::methodExists' => ['', 'method'=>''], -'HttpRequest::methodName' => ['', 'method_id'=>''], -'HttpRequest::methodRegister' => ['', 'method_name'=>''], -'HttpRequest::methodUnregister' => ['', 'method'=>''], -'HttpRequest::postData' => ['', 'url'=>'', 'data'=>'', 'options'=>'', '&info'=>''], -'HttpRequest::postFields' => ['', 'url'=>'', 'data'=>'', 'options'=>'', '&info'=>''], -'HttpRequest::putData' => ['', 'url'=>'', 'data'=>'', 'options'=>'', '&info'=>''], -'HttpRequest::putFile' => ['', 'url'=>'', 'file'=>'', 'options'=>'', '&info'=>''], -'HttpRequest::putStream' => ['', 'url'=>'', 'stream'=>'', 'options'=>'', '&info'=>''], -'HttpRequest::resetCookies' => ['bool', 'session_only='=>'bool'], -'HttpRequest::send' => ['HttpMessage'], -'HttpRequest::setBody' => ['bool', 'request_body_data='=>'string'], -'HttpRequest::setContentType' => ['bool', 'content_type'=>'string'], -'HttpRequest::setCookies' => ['bool', 'cookies='=>'array'], -'HttpRequest::setHeaders' => ['bool', 'headers='=>'array'], -'HttpRequest::setMethod' => ['bool', 'request_method'=>'int'], -'HttpRequest::setOptions' => ['bool', 'options='=>'array'], -'HttpRequest::setPostFields' => ['bool', 'post_data'=>'array'], -'HttpRequest::setPostFiles' => ['bool', 'post_files'=>'array'], -'HttpRequest::setPutData' => ['bool', 'put_data='=>'string'], -'HttpRequest::setPutFile' => ['bool', 'file='=>'string'], -'HttpRequest::setQueryData' => ['bool', 'query_data'=>''], -'HttpRequest::setRawPostData' => ['bool', 'raw_post_data='=>'string'], -'HttpRequest::setSslOptions' => ['bool', 'options='=>'array'], -'HttpRequest::setUrl' => ['bool', 'url'=>'string'], -'HttpRequestDataShare::__construct' => ['void'], -'HttpRequestDataShare::__destruct' => [''], -'HttpRequestDataShare::attach' => ['', 'request'=>'HttpRequest'], -'HttpRequestDataShare::count' => ['int'], -'HttpRequestDataShare::detach' => ['', 'request'=>'HttpRequest'], -'HttpRequestDataShare::factory' => ['', 'global'=>'', 'class_name'=>''], -'HttpRequestDataShare::reset' => [''], -'HttpRequestDataShare::singleton' => ['', 'global'=>''], -'HttpRequestPool::__construct' => ['void', 'request='=>'httprequest'], -'HttpRequestPool::__destruct' => [''], -'HttpRequestPool::attach' => ['bool', 'request'=>'httprequest'], -'HttpRequestPool::count' => ['int'], -'HttpRequestPool::current' => ['mixed'], -'HttpRequestPool::detach' => ['bool', 'request'=>'httprequest'], -'HttpRequestPool::enableEvents' => ['', 'enable'=>''], -'HttpRequestPool::enablePipelining' => ['', 'enable'=>''], -'HttpRequestPool::getAttachedRequests' => ['array'], -'HttpRequestPool::getFinishedRequests' => ['array'], -'HttpRequestPool::key' => ['int|string'], -'HttpRequestPool::next' => ['void'], -'HttpRequestPool::reset' => [''], -'HttpRequestPool::rewind' => ['void'], -'HttpRequestPool::send' => ['bool'], -'HttpRequestPool::socketPerform' => ['bool'], -'HttpRequestPool::socketSelect' => ['bool', 'timeout='=>'float'], -'HttpRequestPool::valid' => ['bool'], -'HttpResponse::capture' => [''], -'HttpResponse::getBufferSize' => ['int'], -'HttpResponse::getCache' => ['bool'], -'HttpResponse::getCacheControl' => ['string'], -'HttpResponse::getContentDisposition' => ['string'], -'HttpResponse::getContentType' => ['string'], -'HttpResponse::getData' => ['string'], -'HttpResponse::getETag' => ['string'], -'HttpResponse::getFile' => ['string'], -'HttpResponse::getGzip' => ['bool'], -'HttpResponse::getHeader' => ['', 'name='=>'string'], -'HttpResponse::getLastModified' => ['int'], -'HttpResponse::getRequestBody' => ['string'], -'HttpResponse::getRequestBodyStream' => ['resource'], -'HttpResponse::getRequestHeaders' => ['array'], -'HttpResponse::getStream' => ['resource'], -'HttpResponse::getThrottleDelay' => ['float'], -'HttpResponse::guessContentType' => ['string', 'magic_file'=>'string', 'magic_mode='=>'int'], -'HttpResponse::redirect' => ['', 'url='=>'string', 'params='=>'array', 'session='=>'bool', 'status='=>'int'], -'HttpResponse::send' => ['bool', 'clean_ob='=>'bool'], -'HttpResponse::setBufferSize' => ['bool', 'bytes'=>'int'], -'HttpResponse::setCache' => ['bool', 'cache'=>'bool'], -'HttpResponse::setCacheControl' => ['bool', 'control'=>'string', 'max_age='=>'int', 'must_revalidate='=>'bool'], -'HttpResponse::setContentDisposition' => ['bool', 'filename'=>'string', 'inline='=>'bool'], -'HttpResponse::setContentType' => ['bool', 'content_type'=>'string'], -'HttpResponse::setData' => ['bool', 'data'=>''], -'HttpResponse::setETag' => ['bool', 'etag'=>'string'], -'HttpResponse::setFile' => ['bool', 'file'=>'string'], -'HttpResponse::setGzip' => ['bool', 'gzip'=>'bool'], -'HttpResponse::setHeader' => ['bool', 'name'=>'string', 'value='=>'', 'replace='=>'bool'], -'HttpResponse::setLastModified' => ['bool', 'timestamp'=>'int'], -'HttpResponse::setStream' => ['bool', 'stream'=>''], -'HttpResponse::setThrottleDelay' => ['bool', 'seconds'=>'float'], -'HttpResponse::status' => ['bool', 'status'=>'int'], -'HttpUtil::buildCookie' => ['', 'cookie_array'=>''], -'HttpUtil::buildStr' => ['', 'query'=>'', 'prefix'=>'', 'arg_sep'=>''], -'HttpUtil::buildUrl' => ['', 'url'=>'', 'parts'=>'', 'flags'=>'', '&composed'=>''], -'HttpUtil::chunkedDecode' => ['', 'encoded_string'=>''], -'HttpUtil::date' => ['', 'timestamp'=>''], -'HttpUtil::deflate' => ['', 'plain'=>'', 'flags'=>''], -'HttpUtil::inflate' => ['', 'encoded'=>''], -'HttpUtil::matchEtag' => ['', 'plain_etag'=>'', 'for_range'=>''], -'HttpUtil::matchModified' => ['', 'last_modified'=>'', 'for_range'=>''], -'HttpUtil::matchRequestHeader' => ['', 'header_name'=>'', 'header_value'=>'', 'case_sensitive'=>''], -'HttpUtil::negotiateCharset' => ['', 'supported'=>'', '&result'=>''], -'HttpUtil::negotiateContentType' => ['', 'supported'=>'', '&result'=>''], -'HttpUtil::negotiateLanguage' => ['', 'supported'=>'', '&result'=>''], -'HttpUtil::parseCookie' => ['', 'cookie_string'=>''], -'HttpUtil::parseHeaders' => ['', 'headers_string'=>''], -'HttpUtil::parseMessage' => ['', 'message_string'=>''], -'HttpUtil::parseParams' => ['', 'param_string'=>'', 'flags'=>''], -'HttpUtil::support' => ['', 'feature'=>''], -'hw_api::checkin' => ['bool', 'parameter'=>'array'], -'hw_api::checkout' => ['bool', 'parameter'=>'array'], -'hw_api::children' => ['array', 'parameter'=>'array'], -'hw_api::content' => ['HW_API_Content', 'parameter'=>'array'], -'hw_api::copy' => ['hw_api_content', 'parameter'=>'array'], -'hw_api::dbstat' => ['hw_api_object', 'parameter'=>'array'], -'hw_api::dcstat' => ['hw_api_object', 'parameter'=>'array'], -'hw_api::dstanchors' => ['array', 'parameter'=>'array'], -'hw_api::dstofsrcanchor' => ['hw_api_object', 'parameter'=>'array'], -'hw_api::find' => ['array', 'parameter'=>'array'], -'hw_api::ftstat' => ['hw_api_object', 'parameter'=>'array'], -'hw_api::hwstat' => ['hw_api_object', 'parameter'=>'array'], -'hw_api::identify' => ['bool', 'parameter'=>'array'], -'hw_api::info' => ['array', 'parameter'=>'array'], -'hw_api::insert' => ['hw_api_object', 'parameter'=>'array'], -'hw_api::insertanchor' => ['hw_api_object', 'parameter'=>'array'], -'hw_api::insertcollection' => ['hw_api_object', 'parameter'=>'array'], -'hw_api::insertdocument' => ['hw_api_object', 'parameter'=>'array'], -'hw_api::link' => ['bool', 'parameter'=>'array'], -'hw_api::lock' => ['bool', 'parameter'=>'array'], -'hw_api::move' => ['bool', 'parameter'=>'array'], -'hw_api::object' => ['hw_api_object', 'parameter'=>'array'], -'hw_api::objectbyanchor' => ['hw_api_object', 'parameter'=>'array'], -'hw_api::parents' => ['array', 'parameter'=>'array'], -'hw_api::remove' => ['bool', 'parameter'=>'array'], -'hw_api::replace' => ['hw_api_object', 'parameter'=>'array'], -'hw_api::setcommittedversion' => ['hw_api_object', 'parameter'=>'array'], -'hw_api::srcanchors' => ['array', 'parameter'=>'array'], -'hw_api::srcsofdst' => ['array', 'parameter'=>'array'], -'hw_api::unlock' => ['bool', 'parameter'=>'array'], -'hw_api::user' => ['hw_api_object', 'parameter'=>'array'], -'hw_api::userlist' => ['array', 'parameter'=>'array'], -'hw_api_attribute' => ['HW_API_Attribute', 'name='=>'string', 'value='=>'string'], -'hw_api_attribute::key' => ['string'], -'hw_api_attribute::langdepvalue' => ['string', 'language'=>'string'], -'hw_api_attribute::value' => ['string'], -'hw_api_attribute::values' => ['array'], -'hw_api_content' => ['HW_API_Content', 'content'=>'string', 'mimetype'=>'string'], -'hw_api_content::mimetype' => ['string'], -'hw_api_content::read' => ['string', 'buffer'=>'string', 'len'=>'int'], -'hw_api_error::count' => ['int'], -'hw_api_error::reason' => ['HW_API_Reason'], -'hw_api_object' => ['hw_api_object', 'parameter'=>'array'], -'hw_api_object::assign' => ['bool', 'parameter'=>'array'], -'hw_api_object::attreditable' => ['bool', 'parameter'=>'array'], -'hw_api_object::count' => ['int', 'parameter'=>'array'], -'hw_api_object::insert' => ['bool', 'attribute'=>'hw_api_attribute'], -'hw_api_object::remove' => ['bool', 'name'=>'string'], -'hw_api_object::title' => ['string', 'parameter'=>'array'], -'hw_api_object::value' => ['string', 'name'=>'string'], -'hw_api_reason::description' => ['string'], -'hw_api_reason::type' => ['HW_API_Reason'], -'hw_Array2Objrec' => ['string', 'object_array'=>'array'], -'hw_changeobject' => ['bool', 'link'=>'int', 'objid'=>'int', 'attributes'=>'array'], -'hw_Children' => ['array', 'connection'=>'int', 'objectid'=>'int'], -'hw_ChildrenObj' => ['array', 'connection'=>'int', 'objectid'=>'int'], -'hw_Close' => ['bool', 'connection'=>'int'], -'hw_Connect' => ['int', 'host'=>'string', 'port'=>'int', 'username='=>'string', 'password='=>'string'], -'hw_connection_info' => ['', 'link'=>'int'], -'hw_cp' => ['int', 'connection'=>'int', 'object_id_array'=>'array', 'destination_id'=>'int'], -'hw_Deleteobject' => ['bool', 'connection'=>'int', 'object_to_delete'=>'int'], -'hw_DocByAnchor' => ['int', 'connection'=>'int', 'anchorid'=>'int'], -'hw_DocByAnchorObj' => ['string', 'connection'=>'int', 'anchorid'=>'int'], -'hw_Document_Attributes' => ['string', 'hw_document'=>'int'], -'hw_Document_BodyTag' => ['string', 'hw_document'=>'int', 'prefix='=>'string'], -'hw_Document_Content' => ['string', 'hw_document'=>'int'], -'hw_Document_SetContent' => ['bool', 'hw_document'=>'int', 'content'=>'string'], -'hw_Document_Size' => ['int', 'hw_document'=>'int'], -'hw_dummy' => ['string', 'link'=>'int', 'id'=>'int', 'msgid'=>'int'], -'hw_EditText' => ['bool', 'connection'=>'int', 'hw_document'=>'int'], -'hw_Error' => ['int', 'connection'=>'int'], -'hw_ErrorMsg' => ['string', 'connection'=>'int'], -'hw_Free_Document' => ['bool', 'hw_document'=>'int'], -'hw_GetAnchors' => ['array', 'connection'=>'int', 'objectid'=>'int'], -'hw_GetAnchorsObj' => ['array', 'connection'=>'int', 'objectid'=>'int'], -'hw_GetAndLock' => ['string', 'connection'=>'int', 'objectid'=>'int'], -'hw_GetChildColl' => ['array', 'connection'=>'int', 'objectid'=>'int'], -'hw_GetChildCollObj' => ['array', 'connection'=>'int', 'objectid'=>'int'], -'hw_GetChildDocColl' => ['array', 'connection'=>'int', 'objectid'=>'int'], -'hw_GetChildDocCollObj' => ['array', 'connection'=>'int', 'objectid'=>'int'], -'hw_GetObject' => ['', 'connection'=>'int', 'objectid'=>'', 'query='=>'string'], -'hw_GetObjectByQuery' => ['array', 'connection'=>'int', 'query'=>'string', 'max_hits'=>'int'], -'hw_GetObjectByQueryColl' => ['array', 'connection'=>'int', 'objectid'=>'int', 'query'=>'string', 'max_hits'=>'int'], -'hw_GetObjectByQueryCollObj' => ['array', 'connection'=>'int', 'objectid'=>'int', 'query'=>'string', 'max_hits'=>'int'], -'hw_GetObjectByQueryObj' => ['array', 'connection'=>'int', 'query'=>'string', 'max_hits'=>'int'], -'hw_GetParents' => ['array', 'connection'=>'int', 'objectid'=>'int'], -'hw_GetParentsObj' => ['array', 'connection'=>'int', 'objectid'=>'int'], -'hw_getrellink' => ['string', 'link'=>'int', 'rootid'=>'int', 'sourceid'=>'int', 'destid'=>'int'], -'hw_GetRemote' => ['int', 'connection'=>'int', 'objectid'=>'int'], -'hw_getremotechildren' => ['', 'connection'=>'int', 'object_record'=>'string'], -'hw_GetSrcByDestObj' => ['array', 'connection'=>'int', 'objectid'=>'int'], -'hw_GetText' => ['int', 'connection'=>'int', 'objectid'=>'int', 'prefix='=>''], -'hw_getusername' => ['string', 'connection'=>'int'], -'hw_Identify' => ['string', 'link'=>'int', 'username'=>'string', 'password'=>'string'], -'hw_InCollections' => ['array', 'connection'=>'int', 'object_id_array'=>'array', 'collection_id_array'=>'array', 'return_collections'=>'int'], -'hw_Info' => ['string', 'connection'=>'int'], -'hw_InsColl' => ['int', 'connection'=>'int', 'objectid'=>'int', 'object_array'=>'array'], -'hw_InsDoc' => ['int', 'connection'=>'', 'parentid'=>'int', 'object_record'=>'string', 'text='=>'string'], -'hw_insertanchors' => ['bool', 'hwdoc'=>'int', 'anchorecs'=>'array', 'dest'=>'array', 'urlprefixes='=>'array'], -'hw_InsertDocument' => ['int', 'connection'=>'int', 'parent_id'=>'int', 'hw_document'=>'int'], -'hw_InsertObject' => ['int', 'connection'=>'int', 'object_rec'=>'string', 'parameter'=>'string'], -'hw_mapid' => ['int', 'connection'=>'int', 'server_id'=>'int', 'object_id'=>'int'], -'hw_Modifyobject' => ['bool', 'connection'=>'int', 'object_to_change'=>'int', 'remove'=>'array', 'add'=>'array', 'mode='=>'int'], -'hw_mv' => ['int', 'connection'=>'int', 'object_id_array'=>'array', 'source_id'=>'int', 'destination_id'=>'int'], -'hw_New_Document' => ['int', 'object_record'=>'string', 'document_data'=>'string', 'document_size'=>'int'], -'hw_objrec2array' => ['array', 'object_record'=>'string', 'format='=>'array'], -'hw_Output_Document' => ['bool', 'hw_document'=>'int'], -'hw_pConnect' => ['int', 'host'=>'string', 'port'=>'int', 'username='=>'string', 'password='=>'string'], -'hw_PipeDocument' => ['int', 'connection'=>'int', 'objectid'=>'int', 'url_prefixes='=>'array'], -'hw_Root' => ['int'], -'hw_setlinkroot' => ['int', 'link'=>'int', 'rootid'=>'int'], -'hw_stat' => ['string', 'link'=>'int'], -'hw_Unlock' => ['bool', 'connection'=>'int', 'objectid'=>'int'], -'hw_Who' => ['array', 'connection'=>'int'], -'hwapi_attribute_new' => ['HW_API_Attribute', 'name='=>'string', 'value='=>'string'], -'hwapi_content_new' => ['HW_API_Content', 'content'=>'string', 'mimetype'=>'string'], -'hwapi_hgcsp' => ['HW_API', 'hostname'=>'string', 'port='=>'int'], -'hwapi_object_new' => ['hw_api_object', 'parameter'=>'array'], -'hypot' => ['float', 'num1'=>'float', 'num2'=>'float'], -'ibase_add_user' => ['bool', 'service_handle'=>'resource', 'user_name'=>'string', 'password'=>'string', 'first_name='=>'string', 'middle_name='=>'string', 'last_name='=>'string'], -'ibase_affected_rows' => ['int', 'link_identifier='=>'resource'], -'ibase_backup' => ['mixed', 'service_handle'=>'resource', 'source_db'=>'string', 'dest_file'=>'string', 'options='=>'int', 'verbose='=>'bool'], -'ibase_blob_add' => ['void', 'blob_handle'=>'resource', 'data'=>'string'], -'ibase_blob_cancel' => ['bool', 'blob_handle'=>'resource'], -'ibase_blob_close' => ['string', 'blob_handle'=>'resource'], -'ibase_blob_create' => ['resource', 'link_identifier='=>'resource'], -'ibase_blob_echo' => ['bool', 'link_identifier'=>'', 'blob_id'=>'string'], -'ibase_blob_echo\'1' => ['bool', 'blob_id'=>'string'], -'ibase_blob_get' => ['string', 'blob_handle'=>'resource', 'len'=>'int'], -'ibase_blob_import' => ['string', 'link_identifier'=>'', 'file_handle'=>''], -'ibase_blob_info' => ['array', 'link_identifier'=>'', 'blob_id'=>'string'], -'ibase_blob_info\'1' => ['array', 'blob_id'=>'string'], -'ibase_blob_open' => ['resource', 'link_identifier'=>'', 'blob_id'=>'string'], -'ibase_blob_open\'1' => ['resource', 'blob_id'=>'string'], -'ibase_close' => ['bool', 'link_identifier='=>'resource'], -'ibase_commit' => ['bool', 'link_identifier='=>'resource'], -'ibase_commit_ret' => ['bool', 'link_identifier='=>'resource'], -'ibase_connect' => ['resource', 'database='=>'string', 'username='=>'string', 'password='=>'string', 'charset='=>'string', 'buffers='=>'int', 'dialect='=>'int', 'role='=>'string'], -'ibase_db_info' => ['string', 'service_handle'=>'resource', 'db'=>'string', 'action'=>'int', 'argument='=>'int'], -'ibase_delete_user' => ['bool', 'service_handle'=>'resource', 'user_name'=>'string', 'password='=>'string', 'first_name='=>'string', 'middle_name='=>'string', 'last_name='=>'string'], -'ibase_drop_db' => ['bool', 'link_identifier='=>'resource'], -'ibase_errcode' => ['int'], -'ibase_errmsg' => ['string'], -'ibase_execute' => ['resource', 'query'=>'resource', 'bind_arg='=>'mixed', '...args='=>'mixed'], -'ibase_fetch_assoc' => ['array', 'result'=>'resource', 'fetch_flags='=>'int'], -'ibase_fetch_object' => ['object', 'result'=>'resource', 'fetch_flags='=>'int'], -'ibase_fetch_row' => ['array', 'result'=>'resource', 'fetch_flags='=>'int'], -'ibase_field_info' => ['array', 'query_result'=>'resource', 'field_number'=>'int'], -'ibase_free_event_handler' => ['bool', 'event'=>'resource'], -'ibase_free_query' => ['bool', 'query'=>'resource'], -'ibase_free_result' => ['bool', 'result'=>'resource'], -'ibase_gen_id' => ['int', 'generator'=>'string', 'increment='=>'int', 'link_identifier='=>'resource'], -'ibase_maintain_db' => ['bool', 'service_handle'=>'resource', 'db'=>'string', 'action'=>'int', 'argument='=>'int'], -'ibase_modify_user' => ['bool', 'service_handle'=>'resource', 'user_name'=>'string', 'password'=>'string', 'first_name='=>'string', 'middle_name='=>'string', 'last_name='=>'string'], -'ibase_name_result' => ['bool', 'result'=>'resource', 'name'=>'string'], -'ibase_num_fields' => ['int', 'query_result'=>'resource'], -'ibase_num_params' => ['int', 'query'=>'resource'], -'ibase_num_rows' => ['int', 'result_identifier'=>''], -'ibase_param_info' => ['array', 'query'=>'resource', 'field_number'=>'int'], -'ibase_pconnect' => ['resource', 'database='=>'string', 'username='=>'string', 'password='=>'string', 'charset='=>'string', 'buffers='=>'int', 'dialect='=>'int', 'role='=>'string'], -'ibase_prepare' => ['resource', 'link_identifier'=>'', 'query'=>'string', 'trans_identifier'=>''], -'ibase_query' => ['resource', 'link_identifier='=>'resource', 'string='=>'string', 'bind_arg='=>'int', '...args='=>''], -'ibase_restore' => ['mixed', 'service_handle'=>'resource', 'source_file'=>'string', 'dest_db'=>'string', 'options='=>'int', 'verbose='=>'bool'], -'ibase_rollback' => ['bool', 'link_identifier='=>'resource'], -'ibase_rollback_ret' => ['bool', 'link_identifier='=>'resource'], -'ibase_server_info' => ['string', 'service_handle'=>'resource', 'action'=>'int'], -'ibase_service_attach' => ['resource', 'host'=>'string', 'dba_username'=>'string', 'dba_password'=>'string'], -'ibase_service_detach' => ['bool', 'service_handle'=>'resource'], -'ibase_set_event_handler' => ['resource', 'link_identifier'=>'', 'callback'=>'callable', 'event='=>'string', '...args='=>''], -'ibase_set_event_handler\'1' => ['resource', 'callback'=>'callable', 'event'=>'string', '...args'=>''], -'ibase_timefmt' => ['bool', 'format'=>'string', 'columntype='=>'int'], -'ibase_trans' => ['resource', 'trans_args='=>'int', 'link_identifier='=>'', '...args='=>''], -'ibase_wait_event' => ['string', 'link_identifier'=>'', 'event='=>'string', '...args='=>''], -'ibase_wait_event\'1' => ['string', 'event'=>'string', '...args'=>''], -'iconv' => ['string|false', 'in_charset'=>'string', 'out_charset'=>'string', 'str'=>'string'], -'iconv_get_encoding' => ['mixed', 'type='=>'string'], -'iconv_mime_decode' => ['string|false', 'encoded_string'=>'string', 'mode='=>'int', 'charset='=>'string'], -'iconv_mime_decode_headers' => ['array|false', 'headers'=>'string', 'mode='=>'int', 'charset='=>'string'], -'iconv_mime_encode' => ['string|false', 'field_name'=>'string', 'field_value'=>'string', 'preference='=>'array'], -'iconv_set_encoding' => ['bool', 'type'=>'string', 'charset'=>'string'], -'iconv_strlen' => ['int', 'str'=>'string', 'charset='=>'string'], -'iconv_strpos' => ['int|false', 'haystack'=>'string', 'needle'=>'string', 'offset='=>'int', 'charset='=>'string'], -'iconv_strrpos' => ['int|false', 'haystack'=>'string', 'needle'=>'string', 'charset='=>'string'], -'iconv_substr' => ['string|false', 'str'=>'string', 'offset'=>'int', 'length='=>'int', 'charset='=>'string'], -'id3_get_frame_long_name' => ['string', 'frameid'=>'string'], -'id3_get_frame_short_name' => ['string', 'frameid'=>'string'], -'id3_get_genre_id' => ['int', 'genre'=>'string'], -'id3_get_genre_list' => ['array'], -'id3_get_genre_name' => ['string', 'genre_id'=>'int'], -'id3_get_tag' => ['array', 'filename'=>'string', 'version='=>'int'], -'id3_get_version' => ['int', 'filename'=>'string'], -'id3_remove_tag' => ['bool', 'filename'=>'string', 'version='=>'int'], -'id3_set_tag' => ['bool', 'filename'=>'string', 'tag'=>'array', 'version='=>'int'], -'idate' => ['int', 'format'=>'string', 'timestamp='=>'int'], -'idn_strerror' => ['string', 'errorcode'=>'int'], -'idn_to_ascii' => ['string|false', 'domain'=>'string', 'options='=>'int', 'variant='=>'int', '&w_idna_info='=>'array'], -'idn_to_utf8' => ['string|false', 'domain'=>'string', 'options='=>'int', 'variant='=>'int', '&w_idna_info='=>'array'], -'ifx_affected_rows' => ['int', 'result_id'=>'resource'], -'ifx_blobinfile_mode' => ['bool', 'mode'=>'int'], -'ifx_byteasvarchar' => ['bool', 'mode'=>'int'], -'ifx_close' => ['bool', 'link_identifier='=>'resource'], -'ifx_connect' => ['resource', 'database='=>'string', 'userid='=>'string', 'password='=>'string'], -'ifx_copy_blob' => ['int', 'bid'=>'int'], -'ifx_create_blob' => ['int', 'type'=>'int', 'mode'=>'int', 'param'=>'string'], -'ifx_create_char' => ['int', 'param'=>'string'], -'ifx_do' => ['bool', 'result_id'=>'resource'], -'ifx_error' => ['string', 'link_identifier='=>'resource'], -'ifx_errormsg' => ['string', 'errorcode='=>'int'], -'ifx_fetch_row' => ['array', 'result_id'=>'resource', 'position='=>'mixed'], -'ifx_fieldproperties' => ['array', 'result_id'=>'resource'], -'ifx_fieldtypes' => ['array', 'result_id'=>'resource'], -'ifx_free_blob' => ['bool', 'bid'=>'int'], -'ifx_free_char' => ['bool', 'bid'=>'int'], -'ifx_free_result' => ['bool', 'result_id'=>'resource'], -'ifx_get_blob' => ['string', 'bid'=>'int'], -'ifx_get_char' => ['string', 'bid'=>'int'], -'ifx_getsqlca' => ['array', 'result_id'=>'resource'], -'ifx_htmltbl_result' => ['int', 'result_id'=>'resource', 'html_table_options='=>'string'], -'ifx_nullformat' => ['bool', 'mode'=>'int'], -'ifx_num_fields' => ['int', 'result_id'=>'resource'], -'ifx_num_rows' => ['int', 'result_id'=>'resource'], -'ifx_pconnect' => ['resource', 'database='=>'string', 'userid='=>'string', 'password='=>'string'], -'ifx_prepare' => ['resource', 'query'=>'string', 'link_identifier'=>'resource', 'cursor_def='=>'int', 'blobidarray='=>'mixed'], -'ifx_query' => ['resource', 'query'=>'string', 'link_identifier'=>'resource', 'cursor_type='=>'int', 'blobidarray='=>'mixed'], -'ifx_textasvarchar' => ['bool', 'mode'=>'int'], -'ifx_update_blob' => ['bool', 'bid'=>'int', 'content'=>'string'], -'ifx_update_char' => ['bool', 'bid'=>'int', 'content'=>'string'], -'ifxus_close_slob' => ['bool', 'bid'=>'int'], -'ifxus_create_slob' => ['int', 'mode'=>'int'], -'ifxus_free_slob' => ['bool', 'bid'=>'int'], -'ifxus_open_slob' => ['int', 'bid'=>'int', 'mode'=>'int'], -'ifxus_read_slob' => ['string', 'bid'=>'int', 'nbytes'=>'int'], -'ifxus_seek_slob' => ['int', 'bid'=>'int', 'mode'=>'int', 'offset'=>'int'], -'ifxus_tell_slob' => ['int', 'bid'=>'int'], -'ifxus_write_slob' => ['int', 'bid'=>'int', 'content'=>'string'], -'igbinary_serialize' => ['string|false', 'value'=>''], -'igbinary_unserialize' => ['', 'str'=>'string'], -'ignore_user_abort' => ['int', 'value='=>'bool'], -'iis_add_server' => ['int', 'path'=>'string', 'comment'=>'string', 'server_ip'=>'string', 'port'=>'int', 'host_name'=>'string', 'rights'=>'int', 'start_server'=>'int'], -'iis_get_dir_security' => ['int', 'server_instance'=>'int', 'virtual_path'=>'string'], -'iis_get_script_map' => ['string', 'server_instance'=>'int', 'virtual_path'=>'string', 'script_extension'=>'string'], -'iis_get_server_by_comment' => ['int', 'comment'=>'string'], -'iis_get_server_by_path' => ['int', 'path'=>'string'], -'iis_get_server_rights' => ['int', 'server_instance'=>'int', 'virtual_path'=>'string'], -'iis_get_service_state' => ['int', 'service_id'=>'string'], -'iis_remove_server' => ['int', 'server_instance'=>'int'], -'iis_set_app_settings' => ['int', 'server_instance'=>'int', 'virtual_path'=>'string', 'application_scope'=>'string'], -'iis_set_dir_security' => ['int', 'server_instance'=>'int', 'virtual_path'=>'string', 'directory_flags'=>'int'], -'iis_set_script_map' => ['int', 'server_instance'=>'int', 'virtual_path'=>'string', 'script_extension'=>'string', 'engine_path'=>'string', 'allow_scripting'=>'int'], -'iis_set_server_rights' => ['int', 'server_instance'=>'int', 'virtual_path'=>'string', 'directory_flags'=>'int'], -'iis_start_server' => ['int', 'server_instance'=>'int'], -'iis_start_service' => ['int', 'service_id'=>'string'], -'iis_stop_server' => ['int', 'server_instance'=>'int'], -'iis_stop_service' => ['int', 'service_id'=>'string'], -'image2wbmp' => ['bool', 'im'=>'resource', 'filename='=>'?string', 'threshold='=>'int'], -'image_type_to_extension' => ['string', 'imagetype'=>'int', 'include_dot='=>'bool'], -'image_type_to_mime_type' => ['string', 'imagetype'=>'int'], -'imageaffine' => ['resource', 'src'=>'resource', 'affine'=>'array', 'clip='=>'array'], -'imageaffineconcat' => ['array', 'm1'=>'array', 'm2'=>'array'], -'imageaffinematrixconcat' => ['array{0:float,1:float,2:float,3:float,4:float,5:float}|false', 'm1'=>'array', 'm2'=>'array'], -'imageaffinematrixget' => ['array{0:float,1:float,2:float,3:float,4:float,5:float}|false', 'type'=>'int', 'options'=>'array|float'], -'imagealphablending' => ['bool', 'im'=>'resource', 'on'=>'bool'], -'imageantialias' => ['bool', 'im'=>'resource', 'on'=>'bool'], -'imagearc' => ['bool', 'im'=>'resource', 'cx'=>'int', 'cy'=>'int', 'w'=>'int', 'h'=>'int', 's'=>'int', 'e'=>'int', 'col'=>'int'], -'imagebmp' => ['bool', 'image'=>'resource', 'to='=>'mixed', 'compressed='=>'bool'], -'imagechar' => ['bool', 'im'=>'resource', 'font'=>'int', 'x'=>'int', 'y'=>'int', 'c'=>'string', 'col'=>'int'], -'imagecharup' => ['bool', 'im'=>'resource', 'font'=>'int', 'x'=>'int', 'y'=>'int', 'c'=>'string', 'col'=>'int'], -'imagecolorallocate' => ['int', 'im'=>'resource', 'red'=>'int', 'green'=>'int', 'blue'=>'int'], -'imagecolorallocatealpha' => ['int', 'im'=>'resource', 'red'=>'int', 'green'=>'int', 'blue'=>'int', 'alpha'=>'int'], -'imagecolorat' => ['int', 'im'=>'resource', 'x'=>'int', 'y'=>'int'], -'imagecolorclosest' => ['int', 'im'=>'resource', 'red'=>'int', 'green'=>'int', 'blue'=>'int'], -'imagecolorclosestalpha' => ['int', 'im'=>'resource', 'red'=>'int', 'green'=>'int', 'blue'=>'int', 'alpha'=>'int'], -'imagecolorclosesthwb' => ['int', 'im'=>'resource', 'red'=>'int', 'green'=>'int', 'blue'=>'int'], -'imagecolordeallocate' => ['bool', 'im'=>'resource', 'index'=>'int'], -'imagecolorexact' => ['int', 'im'=>'resource', 'red'=>'int', 'green'=>'int', 'blue'=>'int'], -'imagecolorexactalpha' => ['int', 'im'=>'resource', 'red'=>'int', 'green'=>'int', 'blue'=>'int', 'alpha'=>'int'], -'imagecolormatch' => ['bool', 'im1'=>'resource', 'im2'=>'resource'], -'imagecolorresolve' => ['int', 'im'=>'resource', 'red'=>'int', 'green'=>'int', 'blue'=>'int'], -'imagecolorresolvealpha' => ['int', 'im'=>'resource', 'red'=>'int', 'green'=>'int', 'blue'=>'int', 'alpha'=>'int'], -'imagecolorset' => ['void', 'im'=>'resource', 'col'=>'int', 'red'=>'int', 'green'=>'int', 'blue'=>'int', 'alpha='=>'int'], -'imagecolorsforindex' => ['array', 'im'=>'resource', 'col'=>'int'], -'imagecolorstotal' => ['int', 'im'=>'resource'], -'imagecolortransparent' => ['int', 'im'=>'resource', 'col='=>'int'], -'imageconvolution' => ['resource', 'src_im'=>'resource', 'matrix3x3'=>'array', 'div'=>'float', 'offset'=>'float'], -'imagecopy' => ['bool', 'dst_im'=>'resource', 'src_im'=>'resource', 'dst_x'=>'int', 'dst_y'=>'int', 'src_x'=>'int', 'src_y'=>'int', 'src_w'=>'int', 'src_h'=>'int'], -'imagecopymerge' => ['bool', 'src_im'=>'resource', 'dst_im'=>'resource', 'dst_x'=>'int', 'dst_y'=>'int', 'src_x'=>'int', 'src_y'=>'int', 'src_w'=>'int', 'src_h'=>'int', 'pct'=>'int'], -'imagecopymergegray' => ['bool', 'src_im'=>'resource', 'dst_im'=>'resource', 'dst_x'=>'int', 'dst_y'=>'int', 'src_x'=>'int', 'src_y'=>'int', 'src_w'=>'int', 'src_h'=>'int', 'pct'=>'int'], -'imagecopyresampled' => ['bool', 'dst_im'=>'resource', 'src_im'=>'resource', 'dst_x'=>'int', 'dst_y'=>'int', 'src_x'=>'int', 'src_y'=>'int', 'dst_w'=>'int', 'dst_h'=>'int', 'src_w'=>'int', 'src_h'=>'int'], -'imagecopyresized' => ['bool', 'dst_im'=>'resource', 'src_im'=>'resource', 'dst_x'=>'int', 'dst_y'=>'int', 'src_x'=>'int', 'src_y'=>'int', 'dst_w'=>'int', 'dst_h'=>'int', 'src_w'=>'int', 'src_h'=>'int'], -'imagecreate' => ['resource|false', 'x_size'=>'int', 'y_size'=>'int'], -'imagecreatefrombmp' => ['resource|false', 'filename'=>'string'], -'imagecreatefromgd' => ['resource|false', 'filename'=>'string'], -'imagecreatefromgd2' => ['resource|false', 'filename'=>'string'], -'imagecreatefromgd2part' => ['resource|false', 'filename'=>'string', 'srcx'=>'int', 'srcy'=>'int', 'width'=>'int', 'height'=>'int'], -'imagecreatefromgif' => ['resource|false', 'filename'=>'string'], -'imagecreatefromjpeg' => ['resource|false', 'filename'=>'string'], -'imagecreatefrompng' => ['resource|false', 'filename'=>'string'], -'imagecreatefromstring' => ['resource|false', 'image'=>'string'], -'imagecreatefromwbmp' => ['resource|false', 'filename'=>'string'], -'imagecreatefromwebp' => ['resource|false', 'filename'=>'string'], -'imagecreatefromxbm' => ['resource|false', 'filename'=>'string'], -'imagecreatefromxpm' => ['resource|false', 'filename'=>'string'], -'imagecreatetruecolor' => ['resource|false', 'x_size'=>'int', 'y_size'=>'int'], -'imagecrop' => ['resource', 'im'=>'resource', 'rect'=>'array'], -'imagecropauto' => ['resource', 'im'=>'resource', 'mode'=>'int', 'threshold'=>'float', 'color'=>'int'], -'imagedashedline' => ['bool', 'im'=>'resource', 'x1'=>'int', 'y1'=>'int', 'x2'=>'int', 'y2'=>'int', 'col'=>'int'], -'imagedestroy' => ['bool', 'im'=>'resource'], -'imageellipse' => ['bool', 'im'=>'resource', 'cx'=>'int', 'cy'=>'int', 'w'=>'int', 'h'=>'int', 'color'=>'int'], -'imagefill' => ['bool', 'im'=>'resource', 'x'=>'int', 'y'=>'int', 'col'=>'int'], -'imagefilledarc' => ['bool', 'im'=>'resource', 'cx'=>'int', 'cy'=>'int', 'w'=>'int', 'h'=>'int', 's'=>'int', 'e'=>'int', 'col'=>'int', 'style'=>'int'], -'imagefilledellipse' => ['bool', 'im'=>'resource', 'cx'=>'int', 'cy'=>'int', 'w'=>'int', 'h'=>'int', 'color'=>'int'], -'imagefilledpolygon' => ['bool', 'im'=>'resource', 'point'=>'array', 'num_points'=>'int', 'col'=>'int'], -'imagefilledrectangle' => ['bool', 'im'=>'resource', 'x1'=>'int', 'y1'=>'int', 'x2'=>'int', 'y2'=>'int', 'col'=>'int'], -'imagefilltoborder' => ['bool', 'im'=>'resource', 'x'=>'int', 'y'=>'int', 'border'=>'int', 'col'=>'int'], -'imagefilter' => ['bool', 'src_im'=>'resource', 'filtertype'=>'int', 'arg1='=>'int', 'arg2='=>'int', 'arg3='=>'int', 'arg4='=>'int'], -'imageflip' => ['bool', 'im'=>'resource', 'mode'=>'int'], -'imagefontheight' => ['int', 'font'=>'int'], -'imagefontwidth' => ['int', 'font'=>'int'], -'imageftbbox' => ['array', 'size'=>'float', 'angle'=>'float', 'font_file'=>'string', 'text'=>'string', 'extrainfo='=>'array'], -'imagefttext' => ['array', 'im'=>'resource', 'size'=>'float', 'angle'=>'float', 'x'=>'int', 'y'=>'int', 'col'=>'int', 'font_file'=>'string', 'text'=>'string', 'extrainfo='=>'array'], -'imagegammacorrect' => ['bool', 'im'=>'resource', 'inputgamma'=>'float', 'outputgamma'=>'float'], -'imagegd' => ['bool', 'im'=>'resource', 'filename='=>'?string'], -'imagegd2' => ['bool', 'im'=>'resource', 'filename='=>'?string', 'chunk_size='=>'int', 'type='=>'int'], -'imagegetclip' => ['array', 'im'=>'resource'], -'imagegif' => ['bool', 'im'=>'resource', 'filename='=>'?string'], -'imagegrabscreen' => ['resource'], -'imagegrabwindow' => ['resource', 'window_handle'=>'int', 'client_area='=>'int'], -'imageinterlace' => ['int', 'im'=>'resource', 'interlace='=>'int'], -'imageistruecolor' => ['bool', 'im'=>'resource'], -'imagejpeg' => ['bool', 'im'=>'resource', 'filename='=>'?string', 'quality='=>'int'], -'imagelayereffect' => ['bool', 'im'=>'resource', 'effect'=>'int'], -'imageline' => ['bool', 'im'=>'resource', 'x1'=>'int', 'y1'=>'int', 'x2'=>'int', 'y2'=>'int', 'col'=>'int'], -'imageloadfont' => ['int', 'filename'=>'string'], -'imageObj::pasteImage' => ['void', 'srcImg'=>'imageObj', 'transparentColorHex'=>'int', 'dstX'=>'int', 'dstY'=>'int', 'angle'=>'int'], -'imageObj::saveImage' => ['int', 'filename'=>'string', 'oMap'=>'MapObj'], -'imageObj::saveWebImage' => ['string'], -'imageopenpolygon' => ['bool', 'image'=>'resource', 'points'=>'array', 'num_points'=>'int', 'color'=>'int'], -'imagepalettecopy' => ['void', 'dst'=>'resource', 'src'=>'resource'], -'imagepalettetotruecolor' => ['bool', 'src'=>'resource'], -'imagepng' => ['bool', 'im'=>'resource', 'filename='=>'?string', 'quality='=>'int', 'filters='=>'int'], -'imagepolygon' => ['bool', 'im'=>'resource', 'point'=>'array', 'num_points'=>'int', 'col'=>'int'], -'imagepsbbox' => ['array', 'text'=>'string', 'font'=>'', 'size'=>'int', 'space'=>'int', 'tightness'=>'int', 'angle'=>'float'], -'imagepsencodefont' => ['bool', 'font_index'=>'resource', 'encodingfile'=>'string'], -'imagepsextendfont' => ['bool', 'font_index'=>'resource', 'extend'=>'float'], -'imagepsfreefont' => ['bool', 'font_index'=>'resource'], -'imagepsloadfont' => ['resource', 'filename'=>'string'], -'imagepsslantfont' => ['bool', 'font_index'=>'resource', 'slant'=>'float'], -'imagepstext' => ['array', 'image'=>'resource', 'text'=>'string', 'font_index'=>'resource', 'size'=>'int', 'foreground'=>'int', 'background'=>'int', 'x'=>'int', 'y'=>'int', 'space='=>'int', 'tightness='=>'int', 'angle='=>'float', 'antialias_steps='=>'int'], -'imagerectangle' => ['bool', 'im'=>'resource', 'x1'=>'int', 'y1'=>'int', 'x2'=>'int', 'y2'=>'int', 'col'=>'int'], -'imageresolution' => ['mixed', 'image'=>'resource', 'res_x='=>'int', 'res_y='=>'int'], -'imagerotate' => ['resource', 'src_im'=>'resource', 'angle'=>'float', 'bgdcolor'=>'int', 'ignoretransparent='=>'int'], -'imagesavealpha' => ['bool', 'im'=>'resource', 'on'=>'bool'], -'imagescale' => ['resource', 'im'=>'resource', 'new_width'=>'int', 'new_height='=>'int', 'method='=>'int'], -'imagesetbrush' => ['bool', 'image'=>'resource', 'brush'=>'resource'], -'imagesetclip' => ['bool', 'im'=>'resource', 'x1'=>'int', 'y1'=>'int', 'x2'=>'int', 'y2'=>'int'], -'imagesetinterpolation' => ['bool', 'im'=>'resource', 'method'=>'int'], -'imagesetpixel' => ['bool', 'im'=>'resource', 'x'=>'int', 'y'=>'int', 'col'=>'int'], -'imagesetstyle' => ['bool', 'im'=>'resource', 'styles'=>'array'], -'imagesetthickness' => ['bool', 'im'=>'resource', 'thickness'=>'int'], -'imagesettile' => ['bool', 'image'=>'resource', 'tile'=>'resource'], -'imagestring' => ['bool', 'im'=>'resource', 'font'=>'int', 'x'=>'int', 'y'=>'int', 'str'=>'string', 'col'=>'int'], -'imagestringup' => ['bool', 'im'=>'resource', 'font'=>'int', 'x'=>'int', 'y'=>'int', 'str'=>'string', 'col'=>'int'], -'imagesx' => ['int', 'im'=>'resource'], -'imagesy' => ['int', 'im'=>'resource'], -'imagetruecolortopalette' => ['bool', 'im'=>'resource', 'ditherflag'=>'bool', 'colorswanted'=>'int'], -'imagettfbbox' => ['array', 'size'=>'float', 'angle'=>'float', 'font_file'=>'string', 'text'=>'string'], -'imagettftext' => ['array', 'im'=>'resource', 'size'=>'float', 'angle'=>'float', 'x'=>'int', 'y'=>'int', 'col'=>'int', 'font_file'=>'string', 'text'=>'string'], -'imagetypes' => ['int'], -'imagewbmp' => ['bool', 'im'=>'resource', 'filename='=>'?string', 'foreground='=>'int'], -'imagewebp' => ['bool', 'im'=>'resource', 'filename='=>'?string', 'quality='=>'int'], -'imagexbm' => ['bool', 'im'=>'resource', 'filename'=>'?string', 'foreground='=>'int'], -'Imagick::__construct' => ['void', 'files='=>''], -'Imagick::__toString' => ['string'], -'Imagick::adaptiveBlurImage' => ['bool', 'radius'=>'float', 'sigma'=>'float', 'channel='=>'int'], -'Imagick::adaptiveResizeImage' => ['bool', 'columns'=>'int', 'rows'=>'int', 'bestfit='=>'bool'], -'Imagick::adaptiveSharpenImage' => ['bool', 'radius'=>'float', 'sigma'=>'float', 'channel='=>'int'], -'Imagick::adaptiveThresholdImage' => ['bool', 'width'=>'int', 'height'=>'int', 'offset'=>'int'], -'Imagick::addImage' => ['bool', 'source'=>'imagick'], -'Imagick::addNoiseImage' => ['bool', 'noise_type'=>'int', 'channel='=>'int'], -'Imagick::affineTransformImage' => ['bool', 'matrix'=>'imagickdraw'], -'Imagick::animateImages' => ['bool', 'x_server'=>'string'], -'Imagick::annotateImage' => ['bool', 'draw_settings'=>'imagickdraw', 'x'=>'float', 'y'=>'float', 'angle'=>'float', 'text'=>'string'], -'Imagick::appendImages' => ['Imagick', 'stack'=>'bool'], -'Imagick::autoGammaImage' => ['bool', 'channel='=>'int'], -'Imagick::autoLevelImage' => ['void', 'CHANNEL='=>'string'], -'Imagick::autoOrient' => ['bool'], -'Imagick::averageImages' => ['Imagick'], -'Imagick::blackThresholdImage' => ['bool', 'threshold'=>'mixed'], -'Imagick::blueShiftImage' => ['void', 'factor='=>'float'], -'Imagick::blurImage' => ['bool', 'radius'=>'float', 'sigma'=>'float', 'channel='=>'int'], -'Imagick::borderImage' => ['bool', 'bordercolor'=>'mixed', 'width'=>'int', 'height'=>'int'], -'Imagick::brightnessContrastImage' => ['void', 'brightness'=>'string', 'contrast'=>'string', 'CHANNEL='=>'string'], -'Imagick::charcoalImage' => ['bool', 'radius'=>'float', 'sigma'=>'float'], -'Imagick::chopImage' => ['bool', 'width'=>'int', 'height'=>'int', 'x'=>'int', 'y'=>'int'], -'Imagick::clampImage' => ['void', 'CHANNEL='=>'string'], -'Imagick::clear' => ['bool'], -'Imagick::clipImage' => ['bool'], -'Imagick::clipImagePath' => ['void', 'pathname'=>'string', 'inside'=>'string'], -'Imagick::clipPathImage' => ['bool', 'pathname'=>'string', 'inside'=>'bool'], -'Imagick::clone' => ['Imagick'], -'Imagick::clutImage' => ['bool', 'lookup_table'=>'imagick', 'channel='=>'float'], -'Imagick::coalesceImages' => ['Imagick'], -'Imagick::colorFloodfillImage' => ['bool', 'fill'=>'mixed', 'fuzz'=>'float', 'bordercolor'=>'mixed', 'x'=>'int', 'y'=>'int'], -'Imagick::colorizeImage' => ['bool', 'colorize'=>'mixed', 'opacity'=>'mixed'], -'Imagick::colorMatrixImage' => ['void', 'color_matrix'=>'string'], -'Imagick::combineImages' => ['Imagick', 'channeltype'=>'int'], -'Imagick::commentImage' => ['bool', 'comment'=>'string'], -'Imagick::compareImageChannels' => ['array', 'image'=>'imagick', 'channeltype'=>'int', 'metrictype'=>'int'], -'Imagick::compareImageLayers' => ['Imagick', 'method'=>'int'], -'Imagick::compareImages' => ['array', 'compare'=>'imagick', 'metric'=>'int'], -'Imagick::compositeImage' => ['bool', 'composite_object'=>'imagick', 'composite'=>'int', 'x'=>'int', 'y'=>'int', 'channel='=>'int'], -'Imagick::compositeImageGravity' => ['bool', 'imagick'=>'Imagick', 'COMPOSITE_CONSTANT'=>'int', 'GRAVITY_CONSTANT'=>'int'], -'Imagick::contrastImage' => ['bool', 'sharpen'=>'bool'], -'Imagick::contrastStretchImage' => ['bool', 'black_point'=>'float', 'white_point'=>'float', 'channel='=>'int'], -'Imagick::convolveImage' => ['bool', 'kernel'=>'array', 'channel='=>'int'], -'Imagick::count' => ['void', 'mode='=>'string'], -'Imagick::cropImage' => ['bool', 'width'=>'int', 'height'=>'int', 'x'=>'int', 'y'=>'int'], -'Imagick::cropThumbnailImage' => ['bool', 'width'=>'int', 'height'=>'int'], -'Imagick::current' => ['Imagick'], -'Imagick::cycleColormapImage' => ['bool', 'displace'=>'int'], -'Imagick::decipherImage' => ['bool', 'passphrase'=>'string'], -'Imagick::deconstructImages' => ['Imagick'], -'Imagick::deleteImageArtifact' => ['bool', 'artifact'=>'string'], -'Imagick::deleteImageProperty' => ['void', 'name'=>'string'], -'Imagick::deskewImage' => ['bool', 'threshold'=>'float'], -'Imagick::despeckleImage' => ['bool'], -'Imagick::destroy' => ['bool'], -'Imagick::displayImage' => ['bool', 'servername'=>'string'], -'Imagick::displayImages' => ['bool', 'servername'=>'string'], -'Imagick::distortImage' => ['bool', 'method'=>'int', 'arguments'=>'array', 'bestfit'=>'bool'], -'Imagick::drawImage' => ['bool', 'draw'=>'imagickdraw'], -'Imagick::edgeImage' => ['bool', 'radius'=>'float'], -'Imagick::embossImage' => ['bool', 'radius'=>'float', 'sigma'=>'float'], -'Imagick::encipherImage' => ['bool', 'passphrase'=>'string'], -'Imagick::enhanceImage' => ['bool'], -'Imagick::equalizeImage' => ['bool'], -'Imagick::evaluateImage' => ['bool', 'op'=>'int', 'constant'=>'float', 'channel='=>'int'], -'Imagick::evaluateImages' => ['bool', 'EVALUATE_CONSTANT'=>'int'], -'Imagick::exportImagePixels' => ['array', 'x'=>'int', 'y'=>'int', 'width'=>'int', 'height'=>'int', 'map'=>'string', 'storage'=>'int'], -'Imagick::extentImage' => ['bool', 'width'=>'int', 'height'=>'int', 'x'=>'int', 'y'=>'int'], -'Imagick::filter' => ['void', 'ImagickKernel'=>'ImagickKernel', 'CHANNEL='=>'int'], -'Imagick::flattenImages' => ['Imagick'], -'Imagick::flipImage' => ['bool'], -'Imagick::floodFillPaintImage' => ['bool', 'fill'=>'mixed', 'fuzz'=>'float', 'target'=>'mixed', 'x'=>'int', 'y'=>'int', 'invert'=>'bool', 'channel='=>'int'], -'Imagick::flopImage' => ['bool'], -'Imagick::forwardFourierTransformimage' => ['void', 'magnitude'=>'bool'], -'Imagick::frameImage' => ['bool', 'matte_color'=>'mixed', 'width'=>'int', 'height'=>'int', 'inner_bevel'=>'int', 'outer_bevel'=>'int'], -'Imagick::functionImage' => ['bool', 'function'=>'int', 'arguments'=>'array', 'channel='=>'int'], -'Imagick::fxImage' => ['Imagick', 'expression'=>'string', 'channel='=>'int'], -'Imagick::gammaImage' => ['bool', 'gamma'=>'float', 'channel='=>'int'], -'Imagick::gaussianBlurImage' => ['bool', 'radius'=>'float', 'sigma'=>'float', 'channel='=>'int'], -'Imagick::getColorspace' => ['int'], -'Imagick::getCompression' => ['int'], -'Imagick::getCompressionQuality' => ['int'], -'Imagick::getConfigureOptions' => ['string'], -'Imagick::getCopyright' => ['string'], -'Imagick::getFeatures' => ['string'], -'Imagick::getFilename' => ['string'], -'Imagick::getFont' => ['string'], -'Imagick::getFormat' => ['string'], -'Imagick::getGravity' => ['int'], -'Imagick::getHDRIEnabled' => ['int'], -'Imagick::getHomeURL' => ['string'], -'Imagick::getImage' => ['Imagick'], -'Imagick::getImageAlphaChannel' => ['int'], -'Imagick::getImageArtifact' => ['string', 'artifact'=>'string'], -'Imagick::getImageAttribute' => ['string', 'key'=>'string'], -'Imagick::getImageBackgroundColor' => ['ImagickPixel'], -'Imagick::getImageBlob' => ['string'], -'Imagick::getImageBluePrimary' => ['array'], -'Imagick::getImageBorderColor' => ['ImagickPixel'], -'Imagick::getImageChannelDepth' => ['int', 'channel'=>'int'], -'Imagick::getImageChannelDistortion' => ['float', 'reference'=>'imagick', 'channel'=>'int', 'metric'=>'int'], -'Imagick::getImageChannelDistortions' => ['float', 'reference'=>'imagick', 'metric'=>'int', 'channel='=>'int'], -'Imagick::getImageChannelExtrema' => ['array', 'channel'=>'int'], -'Imagick::getImageChannelKurtosis' => ['array', 'channel='=>'int'], -'Imagick::getImageChannelMean' => ['array', 'channel'=>'int'], -'Imagick::getImageChannelRange' => ['array', 'channel'=>'int'], -'Imagick::getImageChannelStatistics' => ['array'], -'Imagick::getImageClipMask' => ['Imagick'], -'Imagick::getImageColormapColor' => ['ImagickPixel', 'index'=>'int'], -'Imagick::getImageColors' => ['int'], -'Imagick::getImageColorspace' => ['int'], -'Imagick::getImageCompose' => ['int'], -'Imagick::getImageCompression' => ['int'], -'Imagick::getImageCompressionQuality' => ['int'], -'Imagick::getImageDelay' => ['int'], -'Imagick::getImageDepth' => ['int'], -'Imagick::getImageDispose' => ['int'], -'Imagick::getImageDistortion' => ['float', 'reference'=>'magickwand', 'metric'=>'int'], -'Imagick::getImageExtrema' => ['array'], -'Imagick::getImageFilename' => ['string'], -'Imagick::getImageFormat' => ['string'], -'Imagick::getImageGamma' => ['float'], -'Imagick::getImageGeometry' => ['array'], -'Imagick::getImageGravity' => ['int'], -'Imagick::getImageGreenPrimary' => ['array'], -'Imagick::getImageHeight' => ['int'], -'Imagick::getImageHistogram' => ['array'], -'Imagick::getImageIndex' => ['int'], -'Imagick::getImageInterlaceScheme' => ['int'], -'Imagick::getImageInterpolateMethod' => ['int'], -'Imagick::getImageIterations' => ['int'], -'Imagick::getImageLength' => ['int'], -'Imagick::getImageMagickLicense' => ['string'], -'Imagick::getImageMatte' => ['bool'], -'Imagick::getImageMatteColor' => ['ImagickPixel'], -'Imagick::getImageMimeType' => ['string'], -'Imagick::getImageOrientation' => ['int'], -'Imagick::getImagePage' => ['array'], -'Imagick::getImagePixelColor' => ['ImagickPixel', 'x'=>'int', 'y'=>'int'], -'Imagick::getImageProfile' => ['string', 'name'=>'string'], -'Imagick::getImageProfiles' => ['array', 'pattern='=>'string', 'only_names='=>'bool'], -'Imagick::getImageProperties' => ['array', 'pattern='=>'string', 'only_names='=>'bool'], -'Imagick::getImageProperty' => ['string', 'name'=>'string'], -'Imagick::getImageRedPrimary' => ['array'], -'Imagick::getImageRegion' => ['Imagick', 'width'=>'int', 'height'=>'int', 'x'=>'int', 'y'=>'int'], -'Imagick::getImageRenderingIntent' => ['int'], -'Imagick::getImageResolution' => ['array'], -'Imagick::getImagesBlob' => ['string'], -'Imagick::getImageScene' => ['int'], -'Imagick::getImageSignature' => ['string'], -'Imagick::getImageSize' => ['int'], -'Imagick::getImageTicksPerSecond' => ['int'], -'Imagick::getImageTotalInkDensity' => ['float'], -'Imagick::getImageType' => ['int'], -'Imagick::getImageUnits' => ['int'], -'Imagick::getImageVirtualPixelMethod' => ['int'], -'Imagick::getImageWhitePoint' => ['array'], -'Imagick::getImageWidth' => ['int'], -'Imagick::getInterlaceScheme' => ['int'], -'Imagick::getIteratorIndex' => ['int'], -'Imagick::getNumberImages' => ['int'], -'Imagick::getOption' => ['string', 'key'=>'string'], -'Imagick::getPackageName' => ['string'], -'Imagick::getPage' => ['array'], -'Imagick::getPixelIterator' => ['ImagickPixelIterator'], -'Imagick::getPixelRegionIterator' => ['ImagickPixelIterator', 'x'=>'int', 'y'=>'int', 'columns'=>'int', 'rows'=>'int'], -'Imagick::getPointSize' => ['float'], -'Imagick::getQuantum' => ['int'], -'Imagick::getQuantumDepth' => ['array'], -'Imagick::getQuantumRange' => ['array'], -'Imagick::getRegistry' => ['string', 'key'=>'string'], -'Imagick::getReleaseDate' => ['string'], -'Imagick::getResource' => ['int', 'type'=>'int'], -'Imagick::getResourceLimit' => ['int', 'type'=>'int'], -'Imagick::getSamplingFactors' => ['array'], -'Imagick::getSize' => ['array'], -'Imagick::getSizeOffset' => ['int'], -'Imagick::getVersion' => ['array'], -'Imagick::haldClutImage' => ['bool', 'clut'=>'imagick', 'channel='=>'int'], -'Imagick::hasNextImage' => ['bool'], -'Imagick::hasPreviousImage' => ['bool'], -'Imagick::identifyFormat' => ['string|false', 'embedText'=>'string'], -'Imagick::identifyImage' => ['array', 'appendrawoutput='=>'bool'], -'Imagick::identifyImageType' => ['int'], -'Imagick::implodeImage' => ['bool', 'radius'=>'float'], -'Imagick::importImagePixels' => ['bool', 'x'=>'int', 'y'=>'int', 'width'=>'int', 'height'=>'int', 'map'=>'string', 'storage'=>'int', 'pixels'=>'array'], -'Imagick::inverseFourierTransformImage' => ['void', 'complement'=>'string', 'magnitude'=>'string'], -'Imagick::key' => ['int|string'], -'Imagick::labelImage' => ['bool', 'label'=>'string'], -'Imagick::levelImage' => ['bool', 'blackpoint'=>'float', 'gamma'=>'float', 'whitepoint'=>'float', 'channel='=>'int'], -'Imagick::linearStretchImage' => ['bool', 'blackpoint'=>'float', 'whitepoint'=>'float'], -'Imagick::liquidRescaleImage' => ['bool', 'width'=>'int', 'height'=>'int', 'delta_x'=>'float', 'rigidity'=>'float'], -'Imagick::listRegistry' => ['array'], -'Imagick::localContrastImage' => ['bool', 'radius'=>'float', 'strength'=>'float'], -'Imagick::magnifyImage' => ['bool'], -'Imagick::mapImage' => ['bool', 'map'=>'imagick', 'dither'=>'bool'], -'Imagick::matteFloodfillImage' => ['bool', 'alpha'=>'float', 'fuzz'=>'float', 'bordercolor'=>'mixed', 'x'=>'int', 'y'=>'int'], -'Imagick::medianFilterImage' => ['bool', 'radius'=>'float'], -'Imagick::mergeImageLayers' => ['bool', 'layer_method'=>'int'], -'Imagick::minifyImage' => ['bool'], -'Imagick::modulateImage' => ['bool', 'brightness'=>'float', 'saturation'=>'float', 'hue'=>'float'], -'Imagick::montageImage' => ['Imagick', 'draw'=>'imagickdraw', 'tile_geometry'=>'string', 'thumbnail_geometry'=>'string', 'mode'=>'int', 'frame'=>'string'], -'Imagick::morphImages' => ['Imagick', 'number_frames'=>'int'], -'Imagick::morphology' => ['void', 'morphologyMethod'=>'int', 'iterations'=>'int', 'ImagickKernel'=>'ImagickKernel', 'CHANNEL='=>'string'], -'Imagick::mosaicImages' => ['Imagick'], -'Imagick::motionBlurImage' => ['bool', 'radius'=>'float', 'sigma'=>'float', 'angle'=>'float', 'channel='=>'int'], -'Imagick::negateImage' => ['bool', 'gray'=>'bool', 'channel='=>'int'], -'Imagick::newImage' => ['bool', 'cols'=>'int', 'rows'=>'int', 'background'=>'mixed', 'format='=>'string'], -'Imagick::newPseudoImage' => ['bool', 'columns'=>'int', 'rows'=>'int', 'pseudostring'=>'string'], -'Imagick::next' => ['void'], -'Imagick::nextImage' => ['bool'], -'Imagick::normalizeImage' => ['bool', 'channel='=>'int'], -'Imagick::oilPaintImage' => ['bool', 'radius'=>'float'], -'Imagick::opaquePaintImage' => ['bool', 'target'=>'mixed', 'fill'=>'mixed', 'fuzz'=>'float', 'invert'=>'bool', 'channel='=>'int'], -'Imagick::optimizeImageLayers' => ['bool'], -'Imagick::orderedPosterizeImage' => ['bool', 'threshold_map'=>'string', 'channel='=>'int'], -'Imagick::paintFloodfillImage' => ['bool', 'fill'=>'mixed', 'fuzz'=>'float', 'bordercolor'=>'mixed', 'x'=>'int', 'y'=>'int', 'channel='=>'int'], -'Imagick::paintOpaqueImage' => ['bool', 'target'=>'mixed', 'fill'=>'mixed', 'fuzz'=>'float', 'channel='=>'int'], -'Imagick::paintTransparentImage' => ['bool', 'target'=>'mixed', 'alpha'=>'float', 'fuzz'=>'float'], -'Imagick::pingImage' => ['bool', 'filename'=>'string'], -'Imagick::pingImageBlob' => ['bool', 'image'=>'string'], -'Imagick::pingImageFile' => ['bool', 'filehandle'=>'resource', 'filename='=>'string'], -'Imagick::polaroidImage' => ['bool', 'properties'=>'imagickdraw', 'angle'=>'float'], -'Imagick::posterizeImage' => ['bool', 'levels'=>'int', 'dither'=>'bool'], -'Imagick::previewImages' => ['bool', 'preview'=>'int'], -'Imagick::previousImage' => ['bool'], -'Imagick::profileImage' => ['bool', 'name'=>'string', 'profile'=>'string'], -'Imagick::quantizeImage' => ['bool', 'numbercolors'=>'int', 'colorspace'=>'int', 'treedepth'=>'int', 'dither'=>'bool', 'measureerror'=>'bool'], -'Imagick::quantizeImages' => ['bool', 'numbercolors'=>'int', 'colorspace'=>'int', 'treedepth'=>'int', 'dither'=>'bool', 'measureerror'=>'bool'], -'Imagick::queryFontMetrics' => ['array', 'properties'=>'imagickdraw', 'text'=>'string', 'multiline='=>'bool'], -'Imagick::queryFonts' => ['array', 'pattern='=>'string'], -'Imagick::queryFormats' => ['array', 'pattern='=>'string'], -'Imagick::radialBlurImage' => ['bool', 'angle'=>'float', 'channel='=>'int'], -'Imagick::raiseImage' => ['bool', 'width'=>'int', 'height'=>'int', 'x'=>'int', 'y'=>'int', 'raise'=>'bool'], -'Imagick::randomThresholdImage' => ['bool', 'low'=>'float', 'high'=>'float', 'channel='=>'int'], -'Imagick::readImage' => ['bool', 'filename'=>'string'], -'Imagick::readImageBlob' => ['bool', 'image'=>'string', 'filename='=>'string'], -'Imagick::readImageFile' => ['bool', 'filehandle'=>'resource', 'filename='=>'string'], -'Imagick::readImages' => ['Imagick', 'filenames'=>'string'], -'Imagick::recolorImage' => ['bool', 'matrix'=>'array'], -'Imagick::reduceNoiseImage' => ['bool', 'radius'=>'float'], -'Imagick::remapImage' => ['bool', 'replacement'=>'imagick', 'dither'=>'int'], -'Imagick::removeImage' => ['bool'], -'Imagick::removeImageProfile' => ['string', 'name'=>'string'], -'Imagick::render' => ['bool'], -'Imagick::resampleImage' => ['bool', 'x_resolution'=>'float', 'y_resolution'=>'float', 'filter'=>'int', 'blur'=>'float'], -'Imagick::resetImagePage' => ['bool', 'page'=>'string'], -'Imagick::resetIterator' => [''], -'Imagick::resizeImage' => ['bool', 'columns'=>'int', 'rows'=>'int', 'filter'=>'int', 'blur'=>'float', 'bestfit='=>'bool'], -'Imagick::rewind' => ['void'], -'Imagick::rollImage' => ['bool', 'x'=>'int', 'y'=>'int'], -'Imagick::rotateImage' => ['bool', 'background'=>'mixed', 'degrees'=>'float'], -'Imagick::rotationalBlurImage' => ['void', 'angle'=>'string', 'CHANNEL='=>'string'], -'Imagick::roundCorners' => ['bool', 'x_rounding'=>'float', 'y_rounding'=>'float', 'stroke_width='=>'float', 'displace='=>'float', 'size_correction='=>'float'], -'Imagick::roundCornersImage' => ['', 'xRounding'=>'', 'yRounding'=>'', 'strokeWidth'=>'', 'displace'=>'', 'sizeCorrection'=>''], -'Imagick::sampleImage' => ['bool', 'columns'=>'int', 'rows'=>'int'], -'Imagick::scaleImage' => ['bool', 'cols'=>'int', 'rows'=>'int', 'bestfit='=>'bool'], -'Imagick::segmentImage' => ['bool', 'colorspace'=>'int', 'cluster_threshold'=>'float', 'smooth_threshold'=>'float', 'verbose='=>'bool'], -'Imagick::selectiveBlurImage' => ['void', 'radius'=>'float', 'sigma'=>'float', 'threshold'=>'float', 'CHANNEL'=>'int'], -'Imagick::separateImageChannel' => ['bool', 'channel'=>'int'], -'Imagick::sepiaToneImage' => ['bool', 'threshold'=>'float'], -'Imagick::setAntiAlias' => ['int', 'antialias'=>'bool'], -'Imagick::setBackgroundColor' => ['bool', 'background'=>'mixed'], -'Imagick::setColorspace' => ['bool', 'colorspace'=>'int'], -'Imagick::setCompression' => ['bool', 'compression'=>'int'], -'Imagick::setCompressionQuality' => ['bool', 'quality'=>'int'], -'Imagick::setFilename' => ['bool', 'filename'=>'string'], -'Imagick::setFirstIterator' => ['bool'], -'Imagick::setFont' => ['bool', 'font'=>'string'], -'Imagick::setFormat' => ['bool', 'format'=>'string'], -'Imagick::setGravity' => ['bool', 'gravity'=>'int'], -'Imagick::setImage' => ['bool', 'replace'=>'imagick'], -'Imagick::setImageAlpha' => ['bool', 'alpha'=>'float'], -'Imagick::setImageAlphaChannel' => ['bool', 'mode'=>'int'], -'Imagick::setImageArtifact' => ['bool', 'artifact'=>'string', 'value'=>'string'], -'Imagick::setImageAttribute' => ['void', 'key'=>'string', 'value'=>'string'], -'Imagick::setImageBackgroundColor' => ['bool', 'background'=>'mixed'], -'Imagick::setImageBias' => ['bool', 'bias'=>'float'], -'Imagick::setImageBiasQuantum' => ['void', 'bias'=>'string'], -'Imagick::setImageBluePrimary' => ['bool', 'x'=>'float', 'y'=>'float'], -'Imagick::setImageBorderColor' => ['bool', 'border'=>'mixed'], -'Imagick::setImageChannelDepth' => ['bool', 'channel'=>'int', 'depth'=>'int'], -'Imagick::setImageChannelMask' => ['', 'channel'=>'int'], -'Imagick::setImageClipMask' => ['bool', 'clip_mask'=>'imagick'], -'Imagick::setImageColormapColor' => ['bool', 'index'=>'int', 'color'=>'imagickpixel'], -'Imagick::setImageColorspace' => ['bool', 'colorspace'=>'int'], -'Imagick::setImageCompose' => ['bool', 'compose'=>'int'], -'Imagick::setImageCompression' => ['bool', 'compression'=>'int'], -'Imagick::setImageCompressionQuality' => ['bool', 'quality'=>'int'], -'Imagick::setImageDelay' => ['bool', 'delay'=>'int'], -'Imagick::setImageDepth' => ['bool', 'depth'=>'int'], -'Imagick::setImageDispose' => ['bool', 'dispose'=>'int'], -'Imagick::setImageExtent' => ['bool', 'columns'=>'int', 'rows'=>'int'], -'Imagick::setImageFilename' => ['bool', 'filename'=>'string'], -'Imagick::setImageFormat' => ['bool', 'format'=>'string'], -'Imagick::setImageGamma' => ['bool', 'gamma'=>'float'], -'Imagick::setImageGravity' => ['bool', 'gravity'=>'int'], -'Imagick::setImageGreenPrimary' => ['bool', 'x'=>'float', 'y'=>'float'], -'Imagick::setImageIndex' => ['bool', 'index'=>'int'], -'Imagick::setImageInterlaceScheme' => ['bool', 'interlace_scheme'=>'int'], -'Imagick::setImageInterpolateMethod' => ['bool', 'method'=>'int'], -'Imagick::setImageIterations' => ['bool', 'iterations'=>'int'], -'Imagick::setImageMatte' => ['bool', 'matte'=>'bool'], -'Imagick::setImageMatteColor' => ['bool', 'matte'=>'mixed'], -'Imagick::setImageOpacity' => ['bool', 'opacity'=>'float'], -'Imagick::setImageOrientation' => ['bool', 'orientation'=>'int'], -'Imagick::setImagePage' => ['bool', 'width'=>'int', 'height'=>'int', 'x'=>'int', 'y'=>'int'], -'Imagick::setImageProfile' => ['bool', 'name'=>'string', 'profile'=>'string'], -'Imagick::setImageProgressMonitor' => ['', 'filename'=>''], -'Imagick::setImageProperty' => ['bool', 'name'=>'string', 'value'=>'string'], -'Imagick::setImageRedPrimary' => ['bool', 'x'=>'float', 'y'=>'float'], -'Imagick::setImageRenderingIntent' => ['bool', 'rendering_intent'=>'int'], -'Imagick::setImageResolution' => ['bool', 'x_resolution'=>'float', 'y_resolution'=>'float'], -'Imagick::setImageScene' => ['bool', 'scene'=>'int'], -'Imagick::setImageTicksPerSecond' => ['bool', 'ticks_per_second'=>'int'], -'Imagick::setImageType' => ['bool', 'image_type'=>'int'], -'Imagick::setImageUnits' => ['bool', 'units'=>'int'], -'Imagick::setImageVirtualPixelMethod' => ['bool', 'method'=>'int'], -'Imagick::setImageWhitePoint' => ['bool', 'x'=>'float', 'y'=>'float'], -'Imagick::setInterlaceScheme' => ['bool', 'interlace_scheme'=>'int'], -'Imagick::setIteratorIndex' => ['bool', 'index'=>'int'], -'Imagick::setLastIterator' => ['bool'], -'Imagick::setOption' => ['bool', 'key'=>'string', 'value'=>'string'], -'Imagick::setPage' => ['bool', 'width'=>'int', 'height'=>'int', 'x'=>'int', 'y'=>'int'], -'Imagick::setPointSize' => ['bool', 'point_size'=>'float'], -'Imagick::setProgressMonitor' => ['void', 'callback'=>'callable'], -'Imagick::setRegistry' => ['void', 'key'=>'string', 'value'=>'string'], -'Imagick::setResolution' => ['bool', 'x_resolution'=>'float', 'y_resolution'=>'float'], -'Imagick::setResourceLimit' => ['bool', 'type'=>'int', 'limit'=>'int'], -'Imagick::setSamplingFactors' => ['bool', 'factors'=>'array'], -'Imagick::setSize' => ['bool', 'columns'=>'int', 'rows'=>'int'], -'Imagick::setSizeOffset' => ['bool', 'columns'=>'int', 'rows'=>'int', 'offset'=>'int'], -'Imagick::setType' => ['bool', 'image_type'=>'int'], -'Imagick::shadeImage' => ['bool', 'gray'=>'bool', 'azimuth'=>'float', 'elevation'=>'float'], -'Imagick::shadowImage' => ['bool', 'opacity'=>'float', 'sigma'=>'float', 'x'=>'int', 'y'=>'int'], -'Imagick::sharpenImage' => ['bool', 'radius'=>'float', 'sigma'=>'float', 'channel='=>'int'], -'Imagick::shaveImage' => ['bool', 'columns'=>'int', 'rows'=>'int'], -'Imagick::shearImage' => ['bool', 'background'=>'mixed', 'x_shear'=>'float', 'y_shear'=>'float'], -'Imagick::sigmoidalContrastImage' => ['bool', 'sharpen'=>'bool', 'alpha'=>'float', 'beta'=>'float', 'channel='=>'int'], -'Imagick::similarityImage' => ['Imagick', 'imagick'=>'Imagick', '&bestMatch'=>'array', '&similarity'=>'float', 'similarity_threshold'=>'float', 'metric'=>'int'], -'Imagick::sketchImage' => ['bool', 'radius'=>'float', 'sigma'=>'float', 'angle'=>'float'], -'Imagick::smushImages' => ['Imagick', 'stack'=>'string', 'offset'=>'string'], -'Imagick::solarizeImage' => ['bool', 'threshold'=>'int'], -'Imagick::sparseColorImage' => ['bool', 'sparse_method'=>'int', 'arguments'=>'array', 'channel='=>'int'], -'Imagick::spliceImage' => ['bool', 'width'=>'int', 'height'=>'int', 'x'=>'int', 'y'=>'int'], -'Imagick::spreadImage' => ['bool', 'radius'=>'float'], -'Imagick::statisticImage' => ['void', 'type'=>'int', 'width'=>'int', 'height'=>'int', 'CHANNEL='=>'string'], -'Imagick::steganoImage' => ['Imagick', 'watermark_wand'=>'imagick', 'offset'=>'int'], -'Imagick::stereoImage' => ['bool', 'offset_wand'=>'imagick'], -'Imagick::stripImage' => ['bool'], -'Imagick::subImageMatch' => ['Imagick', 'Imagick'=>'Imagick', '&w_offset='=>'array', '&w_similarity='=>'float'], -'Imagick::swirlImage' => ['bool', 'degrees'=>'float'], -'Imagick::textureImage' => ['bool', 'texture_wand'=>'imagick'], -'Imagick::thresholdImage' => ['bool', 'threshold'=>'float', 'channel='=>'int'], -'Imagick::thumbnailImage' => ['bool', 'columns'=>'int', 'rows'=>'int', 'bestfit='=>'bool', 'fill='=>'bool'], -'Imagick::tintImage' => ['bool', 'tint'=>'mixed', 'opacity'=>'mixed'], -'Imagick::transformImage' => ['Imagick', 'crop'=>'string', 'geometry'=>'string'], -'Imagick::transformImageColorspace' => ['bool', 'colorspace'=>'int'], -'Imagick::transparentPaintImage' => ['bool', 'target'=>'mixed', 'alpha'=>'float', 'fuzz'=>'float', 'invert'=>'bool'], -'Imagick::transposeImage' => ['bool'], -'Imagick::transverseImage' => ['bool'], -'Imagick::trimImage' => ['bool', 'fuzz'=>'float'], -'Imagick::uniqueImageColors' => ['bool'], -'Imagick::unsharpMaskImage' => ['bool', 'radius'=>'float', 'sigma'=>'float', 'amount'=>'float', 'threshold'=>'float', 'channel='=>'int'], -'Imagick::valid' => ['bool'], -'Imagick::vignetteImage' => ['bool', 'blackpoint'=>'float', 'whitepoint'=>'float', 'x'=>'int', 'y'=>'int'], -'Imagick::waveImage' => ['bool', 'amplitude'=>'float', 'length'=>'float'], -'Imagick::whiteThresholdImage' => ['bool', 'threshold'=>'mixed'], -'Imagick::writeImage' => ['bool', 'filename='=>'string'], -'Imagick::writeImageFile' => ['bool', 'filehandle'=>'resource'], -'Imagick::writeImages' => ['bool', 'filename'=>'string', 'adjoin'=>'bool'], -'Imagick::writeImagesFile' => ['bool', 'filehandle'=>'resource'], -'ImagickDraw::__construct' => ['void'], -'ImagickDraw::affine' => ['bool', 'affine'=>'array'], -'ImagickDraw::annotation' => ['bool', 'x'=>'float', 'y'=>'float', 'text'=>'string'], -'ImagickDraw::arc' => ['bool', 'sx'=>'float', 'sy'=>'float', 'ex'=>'float', 'ey'=>'float', 'sd'=>'float', 'ed'=>'float'], -'ImagickDraw::bezier' => ['bool', 'coordinates'=>'array'], -'ImagickDraw::circle' => ['bool', 'ox'=>'float', 'oy'=>'float', 'px'=>'float', 'py'=>'float'], -'ImagickDraw::clear' => ['bool'], -'ImagickDraw::clone' => ['ImagickDraw'], -'ImagickDraw::color' => ['bool', 'x'=>'float', 'y'=>'float', 'paintmethod'=>'int'], -'ImagickDraw::comment' => ['bool', 'comment'=>'string'], -'ImagickDraw::composite' => ['bool', 'compose'=>'int', 'x'=>'float', 'y'=>'float', 'width'=>'float', 'height'=>'float', 'compositewand'=>'imagick'], -'ImagickDraw::destroy' => ['bool'], -'ImagickDraw::ellipse' => ['bool', 'ox'=>'float', 'oy'=>'float', 'rx'=>'float', 'ry'=>'float', 'start'=>'float', 'end'=>'float'], -'ImagickDraw::getBorderColor' => ['ImagickPixel'], -'ImagickDraw::getClipPath' => ['string'], -'ImagickDraw::getClipRule' => ['int'], -'ImagickDraw::getClipUnits' => ['int'], -'ImagickDraw::getDensity' => ['null|string'], -'ImagickDraw::getFillColor' => ['ImagickPixel'], -'ImagickDraw::getFillOpacity' => ['float'], -'ImagickDraw::getFillRule' => ['int'], -'ImagickDraw::getFont' => ['string'], -'ImagickDraw::getFontFamily' => ['string'], -'ImagickDraw::getFontResolution' => ['array'], -'ImagickDraw::getFontSize' => ['float'], -'ImagickDraw::getFontStretch' => ['int'], -'ImagickDraw::getFontStyle' => ['int'], -'ImagickDraw::getFontWeight' => ['int'], -'ImagickDraw::getGravity' => ['int'], -'ImagickDraw::getOpacity' => ['float'], -'ImagickDraw::getStrokeAntialias' => ['bool'], -'ImagickDraw::getStrokeColor' => ['ImagickPixel'], -'ImagickDraw::getStrokeDashArray' => ['array'], -'ImagickDraw::getStrokeDashOffset' => ['float'], -'ImagickDraw::getStrokeLineCap' => ['int'], -'ImagickDraw::getStrokeLineJoin' => ['int'], -'ImagickDraw::getStrokeMiterLimit' => ['int'], -'ImagickDraw::getStrokeOpacity' => ['float'], -'ImagickDraw::getStrokeWidth' => ['float'], -'ImagickDraw::getTextAlignment' => ['int'], -'ImagickDraw::getTextAntialias' => ['bool'], -'ImagickDraw::getTextDecoration' => ['int'], -'ImagickDraw::getTextDirection' => ['bool'], -'ImagickDraw::getTextEncoding' => ['string'], -'ImagickDraw::getTextInterlineSpacing' => ['float'], -'ImagickDraw::getTextInterwordSpacing' => ['float'], -'ImagickDraw::getTextKerning' => ['float'], -'ImagickDraw::getTextUnderColor' => ['ImagickPixel'], -'ImagickDraw::getVectorGraphics' => ['string'], -'ImagickDraw::line' => ['bool', 'sx'=>'float', 'sy'=>'float', 'ex'=>'float', 'ey'=>'float'], -'ImagickDraw::matte' => ['bool', 'x'=>'float', 'y'=>'float', 'paintmethod'=>'int'], -'ImagickDraw::pathClose' => ['bool'], -'ImagickDraw::pathCurveToAbsolute' => ['bool', 'x1'=>'float', 'y1'=>'float', 'x2'=>'float', 'y2'=>'float', 'x'=>'float', 'y'=>'float'], -'ImagickDraw::pathCurveToQuadraticBezierAbsolute' => ['bool', 'x1'=>'float', 'y1'=>'float', 'x'=>'float', 'y'=>'float'], -'ImagickDraw::pathCurveToQuadraticBezierRelative' => ['bool', 'x1'=>'float', 'y1'=>'float', 'x'=>'float', 'y'=>'float'], -'ImagickDraw::pathCurveToQuadraticBezierSmoothAbsolute' => ['bool', 'x'=>'float', 'y'=>'float'], -'ImagickDraw::pathCurveToQuadraticBezierSmoothRelative' => ['bool', 'x'=>'float', 'y'=>'float'], -'ImagickDraw::pathCurveToRelative' => ['bool', 'x1'=>'float', 'y1'=>'float', 'x2'=>'float', 'y2'=>'float', 'x'=>'float', 'y'=>'float'], -'ImagickDraw::pathCurveToSmoothAbsolute' => ['bool', 'x2'=>'float', 'y2'=>'float', 'x'=>'float', 'y'=>'float'], -'ImagickDraw::pathCurveToSmoothRelative' => ['bool', 'x2'=>'float', 'y2'=>'float', 'x'=>'float', 'y'=>'float'], -'ImagickDraw::pathEllipticArcAbsolute' => ['bool', 'rx'=>'float', 'ry'=>'float', 'x_axis_rotation'=>'float', 'large_arc_flag'=>'bool', 'sweep_flag'=>'bool', 'x'=>'float', 'y'=>'float'], -'ImagickDraw::pathEllipticArcRelative' => ['bool', 'rx'=>'float', 'ry'=>'float', 'x_axis_rotation'=>'float', 'large_arc_flag'=>'bool', 'sweep_flag'=>'bool', 'x'=>'float', 'y'=>'float'], -'ImagickDraw::pathFinish' => ['bool'], -'ImagickDraw::pathLineToAbsolute' => ['bool', 'x'=>'float', 'y'=>'float'], -'ImagickDraw::pathLineToHorizontalAbsolute' => ['bool', 'x'=>'float'], -'ImagickDraw::pathLineToHorizontalRelative' => ['bool', 'x'=>'float'], -'ImagickDraw::pathLineToRelative' => ['bool', 'x'=>'float', 'y'=>'float'], -'ImagickDraw::pathLineToVerticalAbsolute' => ['bool', 'y'=>'float'], -'ImagickDraw::pathLineToVerticalRelative' => ['bool', 'y'=>'float'], -'ImagickDraw::pathMoveToAbsolute' => ['bool', 'x'=>'float', 'y'=>'float'], -'ImagickDraw::pathMoveToRelative' => ['bool', 'x'=>'float', 'y'=>'float'], -'ImagickDraw::pathStart' => ['bool'], -'ImagickDraw::point' => ['bool', 'x'=>'float', 'y'=>'float'], -'ImagickDraw::polygon' => ['bool', 'coordinates'=>'array'], -'ImagickDraw::polyline' => ['bool', 'coordinates'=>'array'], -'ImagickDraw::pop' => ['bool'], -'ImagickDraw::popClipPath' => ['bool'], -'ImagickDraw::popDefs' => ['bool'], -'ImagickDraw::popPattern' => ['bool'], -'ImagickDraw::push' => ['bool'], -'ImagickDraw::pushClipPath' => ['bool', 'clip_mask_id'=>'string'], -'ImagickDraw::pushDefs' => ['bool'], -'ImagickDraw::pushPattern' => ['bool', 'pattern_id'=>'string', 'x'=>'float', 'y'=>'float', 'width'=>'float', 'height'=>'float'], -'ImagickDraw::rectangle' => ['bool', 'x1'=>'float', 'y1'=>'float', 'x2'=>'float', 'y2'=>'float'], -'ImagickDraw::render' => ['bool'], -'ImagickDraw::resetVectorGraphics' => ['void'], -'ImagickDraw::rotate' => ['bool', 'degrees'=>'float'], -'ImagickDraw::roundRectangle' => ['bool', 'x1'=>'float', 'y1'=>'float', 'x2'=>'float', 'y2'=>'float', 'rx'=>'float', 'ry'=>'float'], -'ImagickDraw::scale' => ['bool', 'x'=>'float', 'y'=>'float'], -'ImagickDraw::setBorderColor' => ['bool', 'color'=>'ImagickPixel'], -'ImagickDraw::setClipPath' => ['bool', 'clip_mask'=>'string'], -'ImagickDraw::setClipRule' => ['bool', 'fill_rule'=>'int'], -'ImagickDraw::setClipUnits' => ['bool', 'clip_units'=>'int'], -'ImagickDraw::setDensity' => ['bool', 'density_string'=>'string'], -'ImagickDraw::setFillAlpha' => ['bool', 'opacity'=>'float'], -'ImagickDraw::setFillColor' => ['bool', 'fill_pixel'=>'imagickpixel'], -'ImagickDraw::setFillOpacity' => ['bool', 'fillopacity'=>'float'], -'ImagickDraw::setFillPatternURL' => ['bool', 'fill_url'=>'string'], -'ImagickDraw::setFillRule' => ['bool', 'fill_rule'=>'int'], -'ImagickDraw::setFont' => ['bool', 'font_name'=>'string'], -'ImagickDraw::setFontFamily' => ['bool', 'font_family'=>'string'], -'ImagickDraw::setFontResolution' => ['bool', 'x'=>'float', 'y'=>'float'], -'ImagickDraw::setFontSize' => ['bool', 'pointsize'=>'float'], -'ImagickDraw::setFontStretch' => ['bool', 'fontstretch'=>'int'], -'ImagickDraw::setFontStyle' => ['bool', 'style'=>'int'], -'ImagickDraw::setFontWeight' => ['bool', 'font_weight'=>'int'], -'ImagickDraw::setGravity' => ['bool', 'gravity'=>'int'], -'ImagickDraw::setOpacity' => ['void', 'opacity'=>'float'], -'ImagickDraw::setResolution' => ['void', 'x_resolution'=>'string', 'y_resolution'=>'string'], -'ImagickDraw::setStrokeAlpha' => ['bool', 'opacity'=>'float'], -'ImagickDraw::setStrokeAntialias' => ['bool', 'stroke_antialias'=>'bool'], -'ImagickDraw::setStrokeColor' => ['bool', 'stroke_pixel'=>'imagickpixel'], -'ImagickDraw::setStrokeDashArray' => ['bool', 'dasharray'=>'array'], -'ImagickDraw::setStrokeDashOffset' => ['bool', 'dash_offset'=>'float'], -'ImagickDraw::setStrokeLineCap' => ['bool', 'linecap'=>'int'], -'ImagickDraw::setStrokeLineJoin' => ['bool', 'linejoin'=>'int'], -'ImagickDraw::setStrokeMiterLimit' => ['bool', 'miterlimit'=>'int'], -'ImagickDraw::setStrokeOpacity' => ['bool', 'stroke_opacity'=>'float'], -'ImagickDraw::setStrokePatternURL' => ['bool', 'stroke_url'=>'string'], -'ImagickDraw::setStrokeWidth' => ['bool', 'stroke_width'=>'float'], -'ImagickDraw::setTextAlignment' => ['bool', 'alignment'=>'int'], -'ImagickDraw::setTextAntialias' => ['bool', 'antialias'=>'bool'], -'ImagickDraw::setTextDecoration' => ['bool', 'decoration'=>'int'], -'ImagickDraw::setTextDirection' => ['bool', 'direction'=>'int'], -'ImagickDraw::setTextEncoding' => ['bool', 'encoding'=>'string'], -'ImagickDraw::setTextInterlineSpacing' => ['void', 'spacing'=>'float'], -'ImagickDraw::setTextInterwordSpacing' => ['void', 'spacing'=>'float'], -'ImagickDraw::setTextKerning' => ['void', 'kerning'=>'float'], -'ImagickDraw::setTextUnderColor' => ['bool', 'under_color'=>'imagickpixel'], -'ImagickDraw::setVectorGraphics' => ['bool', 'xml'=>'string'], -'ImagickDraw::setViewbox' => ['bool', 'x1'=>'int', 'y1'=>'int', 'x2'=>'int', 'y2'=>'int'], -'ImagickDraw::skewX' => ['bool', 'degrees'=>'float'], -'ImagickDraw::skewY' => ['bool', 'degrees'=>'float'], -'ImagickDraw::translate' => ['bool', 'x'=>'float', 'y'=>'float'], -'ImagickKernel::addKernel' => ['void', 'ImagickKernel'=>'ImagickKernel'], -'ImagickKernel::addUnityKernel' => ['void'], -'ImagickKernel::fromBuiltin' => ['ImagickKernel', 'kernelType'=>'string', 'kernelString'=>'string'], -'ImagickKernel::fromMatrix' => ['ImagickKernel', 'matrix'=>'array', 'origin='=>'array'], -'ImagickKernel::getMatrix' => ['array'], -'ImagickKernel::scale' => ['void'], -'ImagickKernel::separate' => ['array'], -'ImagickKernel::seperate' => ['void'], -'ImagickPixel::__construct' => ['void', 'color='=>'string'], -'ImagickPixel::clear' => ['bool'], -'ImagickPixel::clone' => ['void'], -'ImagickPixel::destroy' => ['bool'], -'ImagickPixel::getColor' => ['array', 'normalized='=>'bool'], -'ImagickPixel::getColorAsString' => ['string'], -'ImagickPixel::getColorCount' => ['int'], -'ImagickPixel::getColorQuantum' => ['mixed'], -'ImagickPixel::getColorValue' => ['float', 'color'=>'int'], -'ImagickPixel::getColorValueQuantum' => ['mixed'], -'ImagickPixel::getHSL' => ['array'], -'ImagickPixel::getIndex' => ['int'], -'ImagickPixel::isPixelSimilar' => ['bool', 'color'=>'ImagickPixel', 'fuzz'=>'float'], -'ImagickPixel::isPixelSimilarQuantum' => ['bool', 'color'=>'string', 'fuzz='=>'string'], -'ImagickPixel::isSimilar' => ['bool', 'color'=>'imagickpixel', 'fuzz'=>'float'], -'ImagickPixel::setColor' => ['bool', 'color'=>'string'], -'ImagickPixel::setcolorcount' => ['void', 'colorCount'=>'string'], -'ImagickPixel::setColorFromPixel' => ['bool', 'srcPixel'=>'ImagickPixel'], -'ImagickPixel::setColorValue' => ['bool', 'color'=>'int', 'value'=>'float'], -'ImagickPixel::setColorValueQuantum' => ['void', 'color'=>'int', 'value'=>'mixed'], -'ImagickPixel::setHSL' => ['bool', 'hue'=>'float', 'saturation'=>'float', 'luminosity'=>'float'], -'ImagickPixel::setIndex' => ['void', 'index'=>'int'], -'ImagickPixelIterator::__construct' => ['void', 'wand'=>'imagick'], -'ImagickPixelIterator::clear' => ['bool'], -'ImagickPixelIterator::current' => ['mixed'], -'ImagickPixelIterator::destroy' => ['bool'], -'ImagickPixelIterator::getCurrentIteratorRow' => ['array'], -'ImagickPixelIterator::getIteratorRow' => ['int'], -'ImagickPixelIterator::getNextIteratorRow' => ['array'], -'ImagickPixelIterator::getpixeliterator' => ['', 'Imagick'=>'Imagick'], -'ImagickPixelIterator::getpixelregioniterator' => ['', 'Imagick'=>'Imagick', 'x'=>'', 'y'=>'', 'columns'=>'', 'rows'=>''], -'ImagickPixelIterator::getPreviousIteratorRow' => ['array'], -'ImagickPixelIterator::key' => ['int|string'], -'ImagickPixelIterator::newPixelIterator' => ['bool', 'wand'=>'imagick'], -'ImagickPixelIterator::newPixelRegionIterator' => ['bool', 'wand'=>'imagick', 'x'=>'int', 'y'=>'int', 'columns'=>'int', 'rows'=>'int'], -'ImagickPixelIterator::next' => ['void'], -'ImagickPixelIterator::resetIterator' => ['bool'], -'ImagickPixelIterator::rewind' => ['void'], -'ImagickPixelIterator::setIteratorFirstRow' => ['bool'], -'ImagickPixelIterator::setIteratorLastRow' => ['bool'], -'ImagickPixelIterator::setIteratorRow' => ['bool', 'row'=>'int'], -'ImagickPixelIterator::syncIterator' => ['bool'], -'ImagickPixelIterator::valid' => ['bool'], -'imap_8bit' => ['string|false', 'text'=>'string'], -'imap_alerts' => ['array|false'], -'imap_append' => ['bool', 'stream_id'=>'resource', 'folder'=>'string', 'message'=>'string', 'options='=>'string', 'internal_date='=>'string'], -'imap_base64' => ['string|false', 'text'=>'string'], -'imap_binary' => ['string|false', 'text'=>'string'], -'imap_body' => ['string|false', 'stream_id'=>'resource', 'msg_no'=>'int', 'options='=>'int'], -'imap_bodystruct' => ['stdClass|false', 'stream_id'=>'resource', 'msg_no'=>'int', 'section'=>'string'], -'imap_check' => ['stdClass|false', 'stream_id'=>'resource'], -'imap_clearflag_full' => ['bool', 'stream_id'=>'resource', 'sequence'=>'string', 'flag'=>'string', 'options='=>'int'], -'imap_close' => ['bool', 'stream_id'=>'resource', 'options='=>'int'], -'imap_create' => ['bool', 'stream_id'=>'resource', 'mailbox'=>'string'], -'imap_createmailbox' => ['bool', 'stream_id'=>'resource', 'mailbox'=>'string'], -'imap_delete' => ['bool', 'stream_id'=>'resource', 'msg_no'=>'int', 'options='=>'int'], -'imap_deletemailbox' => ['bool', 'stream_id'=>'resource', 'mailbox'=>'string'], -'imap_errors' => ['array|false'], -'imap_expunge' => ['bool', 'stream_id'=>'resource'], -'imap_fetch_overview' => ['array|false', 'stream_id'=>'resource', 'sequence'=>'string', 'options='=>'int'], -'imap_fetchbody' => ['string|false', 'stream_id'=>'resource', 'msg_no'=>'int', 'section'=>'string', 'options='=>'int'], -'imap_fetchheader' => ['string|false', 'stream_id'=>'resource', 'msg_no'=>'int', 'options='=>'int'], -'imap_fetchmime' => ['string|false', 'stream_id'=>'resource', 'msg_no'=>'int', 'section'=>'string', 'options='=>'int'], -'imap_fetchstructure' => ['stdClass|false', 'stream_id'=>'resource', 'msg_no'=>'int', 'options='=>'int'], -'imap_fetchtext' => ['string|false', 'stream_id'=>'resource', 'msg_no'=>'int', 'options='=>'int'], -'imap_gc' => ['bool', 'stream_id'=>'resource', 'flags'=>'int'], -'imap_get_quota' => ['array|false', 'stream_id'=>'resource', 'qroot'=>'string'], -'imap_get_quotaroot' => ['array|false', 'stream_id'=>'resource', 'mbox'=>'string'], -'imap_getacl' => ['array|false', 'stream_id'=>'resource', 'mailbox'=>'string'], -'imap_getmailboxes' => ['array|false', 'stream_id'=>'resource', 'ref'=>'string', 'pattern'=>'string'], -'imap_getsubscribed' => ['array|false', 'stream_id'=>'resource', 'ref'=>'string', 'pattern'=>'string'], -'imap_header' => ['stdClass|false', 'stream_id'=>'resource', 'msg_no'=>'int', 'from_length='=>'int', 'subject_length='=>'int', 'default_host='=>'string'], -'imap_headerinfo' => ['stdClass|false', 'stream_id'=>'resource', 'msg_no'=>'int', 'from_length='=>'int', 'subject_length='=>'int', 'default_host='=>'string'], -'imap_headers' => ['array|false', 'stream_id'=>'resource'], -'imap_last_error' => ['string|false'], -'imap_list' => ['array|false', 'stream_id'=>'resource', 'ref'=>'string', 'pattern'=>'string'], -'imap_listmailbox' => ['array|false', 'stream_id'=>'resource', 'ref'=>'string', 'pattern'=>'string'], -'imap_listscan' => ['array|false', 'stream_id'=>'resource', 'ref'=>'string', 'pattern'=>'string', 'content'=>'string'], -'imap_listsubscribed' => ['array|false', 'stream_id'=>'resource', 'ref'=>'string', 'pattern'=>'string'], -'imap_lsub' => ['array|false', 'stream_id'=>'resource', 'ref'=>'string', 'pattern'=>'string'], -'imap_mail' => ['bool', 'to'=>'string', 'subject'=>'string', 'message'=>'string', 'additional_headers='=>'string', 'cc='=>'string', 'bcc='=>'string', 'rpath='=>'string'], -'imap_mail_compose' => ['string|false', 'envelope'=>'array', 'body'=>'array'], -'imap_mail_copy' => ['bool', 'stream_id'=>'resource', 'msglist'=>'string', 'mailbox'=>'string', 'options='=>'int'], -'imap_mail_move' => ['bool', 'stream_id'=>'resource', 'sequence'=>'string', 'mailbox'=>'string', 'options='=>'int'], -'imap_mailboxmsginfo' => ['stdClass|false', 'stream_id'=>'resource'], -'imap_mime_header_decode' => ['array|false', 'str'=>'string'], -'imap_msgno' => ['int|false', 'stream_id'=>'resource', 'unique_msg_id'=>'int'], -'imap_mutf7_to_utf8' => ['string|false', 'in'=>'string'], -'imap_num_msg' => ['int|false', 'stream_id'=>'resource'], -'imap_num_recent' => ['int|false', 'stream_id'=>'resource'], -'imap_open' => ['resource|false', 'mailbox'=>'string', 'user'=>'string', 'password'=>'string', 'options='=>'int', 'n_retries='=>'int', 'params=' => 'array|null'], -'imap_ping' => ['bool', 'stream_id'=>'resource'], -'imap_qprint' => ['string|false', 'text'=>'string'], -'imap_rename' => ['bool', 'stream_id'=>'resource', 'old_name'=>'string', 'new_name'=>'string'], -'imap_renamemailbox' => ['bool', 'stream_id'=>'resource', 'old_name'=>'string', 'new_name'=>'string'], -'imap_reopen' => ['bool', 'stream_id'=>'resource', 'mailbox'=>'string', 'options='=>'int', 'n_retries='=>'int'], -'imap_rfc822_parse_adrlist' => ['array', 'address_string'=>'string', 'default_host'=>'string'], -'imap_rfc822_parse_headers' => ['stdClass', 'headers'=>'string', 'default_host='=>'string'], -'imap_rfc822_write_address' => ['string|false', 'mailbox'=>'?string', 'host'=>'?string', 'personal'=>'?string'], -'imap_savebody' => ['bool', 'stream_id'=>'resource', 'file'=>'string|resource', 'msg_no'=>'int', 'section='=>'string', 'options='=>'int'], -'imap_scan' => ['array|false', 'stream_id'=>'resource', 'ref'=>'string', 'pattern'=>'string', 'content'=>'string'], -'imap_scanmailbox' => ['array|false', 'stream_id'=>'resource', 'ref'=>'string', 'pattern'=>'string', 'content'=>'string'], -'imap_search' => ['array|false', 'stream_id'=>'resource', 'criteria'=>'string', 'options='=>'int', 'charset='=>'string'], -'imap_set_quota' => ['bool', 'stream_id'=>'resource', 'qroot'=>'string', 'mailbox_size'=>'int'], -'imap_setacl' => ['bool', 'stream_id'=>'resource', 'mailbox'=>'string', 'id'=>'string', 'rights'=>'string'], -'imap_setflag_full' => ['bool', 'stream_id'=>'resource', 'sequence'=>'string', 'flag'=>'string', 'options='=>'int'], -'imap_sort' => ['array|false', 'stream_id'=>'resource', 'criteria'=>'int', 'reverse'=>'int', 'options='=>'int', 'search_criteria='=>'string', 'charset='=>'string'], -'imap_status' => ['stdClass|false', 'stream_id'=>'resource', 'mailbox'=>'string', 'options'=>'int'], -'imap_subscribe' => ['bool', 'stream_id'=>'resource', 'mailbox'=>'string'], -'imap_thread' => ['array|false', 'stream_id'=>'resource', 'options='=>'int'], -'imap_timeout' => ['mixed', 'timeout_type'=>'int', 'timeout='=>'int'], -'imap_uid' => ['int|false', 'stream_id'=>'resource', 'msg_no'=>'int'], -'imap_undelete' => ['bool', 'stream_id'=>'resource', 'msg_no'=>'int', 'flags='=>'int'], -'imap_unsubscribe' => ['bool', 'stream_id'=>'resource', 'mailbox'=>'string'], -'imap_utf7_decode' => ['string|false', 'buf'=>'string'], -'imap_utf7_encode' => ['string', 'buf'=>'string'], -'imap_utf8' => ['string', 'mime_encoded_text'=>'string'], -'imap_utf8_to_mutf7' => ['string|false', 'in'=>'string'], -'implode' => ['string', 'glue'=>'string', 'pieces'=>'array'], -'implode\'1' => ['string', 'pieces'=>'array', 'glue='=>'string'], -'import_request_variables' => ['bool', 'types'=>'string', 'prefix='=>'string'], -'in_array' => ['bool', 'needle'=>'mixed', 'haystack'=>'array', 'strict='=>'bool'], -'inclued_get_data' => ['array'], -'inet_ntop' => ['string|false', 'in_addr'=>'string'], -'inet_pton' => ['string|false', 'ip_address'=>'string'], -'InfiniteIterator::__construct' => ['void', 'it'=>'iterator'], -'InfiniteIterator::next' => ['void'], -'inflate_add' => ['string|false', 'context'=>'resource', 'encoded_data'=>'string', 'flush_mode='=>'int'], -'inflate_get_read_len' => ['int|false', 'resource'=>'resource'], -'inflate_get_status' => ['int|false', 'resource'=>'resource'], -'inflate_init' => ['resource|false', 'encoding'=>'int', 'options='=>'array'], -'ingres_autocommit' => ['bool', 'link'=>'resource'], -'ingres_autocommit_state' => ['bool', 'link'=>'resource'], -'ingres_charset' => ['string', 'link'=>'resource'], -'ingres_close' => ['bool', 'link'=>'resource'], -'ingres_commit' => ['bool', 'link'=>'resource'], -'ingres_connect' => ['resource', 'database='=>'string', 'username='=>'string', 'password='=>'string', 'options='=>'array'], -'ingres_cursor' => ['string', 'result'=>'resource'], -'ingres_errno' => ['int', 'link='=>'resource'], -'ingres_error' => ['string', 'link='=>'resource'], -'ingres_errsqlstate' => ['string', 'link='=>'resource'], -'ingres_escape_string' => ['string', 'link'=>'resource', 'source_string'=>'string'], -'ingres_execute' => ['bool', 'result'=>'resource', 'params='=>'array', 'types='=>'string'], -'ingres_fetch_array' => ['array', 'result'=>'resource', 'result_type='=>'int'], -'ingres_fetch_assoc' => ['array', 'result'=>'resource'], -'ingres_fetch_object' => ['object', 'result'=>'resource', 'result_type='=>'int'], -'ingres_fetch_proc_return' => ['int', 'result'=>'resource'], -'ingres_fetch_row' => ['array', 'result'=>'resource'], -'ingres_field_length' => ['int', 'result'=>'resource', 'index'=>'int'], -'ingres_field_name' => ['string', 'result'=>'resource', 'index'=>'int'], -'ingres_field_nullable' => ['bool', 'result'=>'resource', 'index'=>'int'], -'ingres_field_precision' => ['int', 'result'=>'resource', 'index'=>'int'], -'ingres_field_scale' => ['int', 'result'=>'resource', 'index'=>'int'], -'ingres_field_type' => ['string', 'result'=>'resource', 'index'=>'int'], -'ingres_free_result' => ['bool', 'result'=>'resource'], -'ingres_next_error' => ['bool', 'link='=>'resource'], -'ingres_num_fields' => ['int', 'result'=>'resource'], -'ingres_num_rows' => ['int', 'result'=>'resource'], -'ingres_pconnect' => ['resource', 'database='=>'string', 'username='=>'string', 'password='=>'string', 'options='=>'array'], -'ingres_prepare' => ['mixed', 'link'=>'resource', 'query'=>'string'], -'ingres_query' => ['mixed', 'link'=>'resource', 'query'=>'string', 'params='=>'array', 'types='=>'string'], -'ingres_result_seek' => ['bool', 'result'=>'resource', 'position'=>'int'], -'ingres_rollback' => ['bool', 'link'=>'resource'], -'ingres_set_environment' => ['bool', 'link'=>'resource', 'options'=>'array'], -'ingres_unbuffered_query' => ['mixed', 'link'=>'resource', 'query'=>'string', 'params='=>'array', 'types='=>'string'], -'ini_alter' => ['string|false', 'varname'=>'string', 'newvalue'=>'string|int|float|bool'], -'ini_get' => ['string|false', 'varname'=>'string'], -'ini_get_all' => ['array', 'extension='=>'?string', 'details='=>'bool'], -'ini_restore' => ['void', 'varname'=>'string'], -'ini_set' => ['string|false', 'varname'=>'string', 'newvalue'=>'string|int|float|bool'], -'inotify_add_watch' => ['int', 'inotify_instance'=>'resource', 'pathname'=>'string', 'mask'=>'int'], -'inotify_init' => ['resource'], -'inotify_queue_len' => ['int', 'inotify_instance'=>'resource'], -'inotify_read' => ['array', 'inotify_instance'=>'resource'], -'inotify_rm_watch' => ['bool', 'inotify_instance'=>'resource', 'watch_descriptor'=>'int'], -'intdiv' => ['int', 'numerator'=>'int', 'divisor'=>'int'], -'interface_exists' => ['bool', 'classname'=>'string', 'autoload='=>'bool'], -'intl_error_name' => ['string', 'error_code'=>'int'], -'intl_get_error_code' => ['int'], -'intl_get_error_message' => ['string'], -'intl_is_failure' => ['bool', 'error_code'=>'int'], -'IntlBreakIterator::__construct' => ['void'], -'IntlBreakIterator::createCharacterInstance' => ['IntlRuleBasedBreakIterator', 'locale='=>'string'], -'IntlBreakIterator::createCodePointInstance' => ['IntlCodePointBreakIterator'], -'IntlBreakIterator::createLineInstance' => ['IntlRuleBasedBreakIterator', 'locale='=>'string'], -'IntlBreakIterator::createSentenceInstance' => ['IntlRuleBasedBreakIterator', 'locale='=>'string'], -'IntlBreakIterator::createTitleInstance' => ['IntlRuleBasedBreakIterator', 'locale='=>'string'], -'IntlBreakIterator::createWordInstance' => ['IntlRuleBasedBreakIterator', 'locale='=>'string'], -'IntlBreakIterator::current' => ['int'], -'IntlBreakIterator::first' => ['int'], -'IntlBreakIterator::following' => ['int', 'offset'=>'string'], -'IntlBreakIterator::getErrorCode' => ['int'], -'IntlBreakIterator::getErrorMessage' => ['string'], -'IntlBreakIterator::getLocale' => ['string', 'locale_type'=>'string'], -'IntlBreakIterator::getPartsIterator' => ['IntlPartsIterator', 'key_type='=>'string'], -'IntlBreakIterator::getText' => ['string'], -'IntlBreakIterator::isBoundary' => ['bool', 'offset'=>'string'], -'IntlBreakIterator::last' => ['int'], -'IntlBreakIterator::next' => ['int', 'offset='=>'int'], -'IntlBreakIterator::preceding' => ['int', 'offset'=>'int'], -'IntlBreakIterator::previous' => ['int'], -'IntlBreakIterator::setText' => ['bool', 'text'=>'string'], -'intlcal_add' => ['bool', 'cal'=>'IntlCalendar', 'field'=>'int', 'amount'=>'int'], -'intlcal_after' => ['bool', 'cal'=>'IntlCalendar', 'other'=>'IntlCalendar'], -'intlcal_before' => ['bool', 'cal'=>'IntlCalendar', 'other'=>'IntlCalendar'], -'intlcal_clear' => ['bool', 'cal'=>'IntlCalendar', 'field='=>'int'], -'intlcal_create_instance' => ['IntlCalendar', 'timeZone='=>'mixed', 'locale='=>'string'], -'intlcal_equals' => ['bool', 'cal'=>'IntlCalendar', 'other'=>'IntlCalendar'], -'intlcal_field_difference' => ['int', 'cal'=>'IntlCalendar', 'when'=>'float', 'field'=>'int'], -'intlcal_from_date_time' => ['IntlCalendar', 'dateTime'=>'DateTime|string'], -'intlcal_get' => ['int', 'cal'=>'IntlCalendar', 'field'=>'int'], -'intlcal_get_actual_maximum' => ['int', 'cal'=>'IntlCalendar', 'field'=>'int'], -'intlcal_get_actual_minimum' => ['int', 'cal'=>'IntlCalendar', 'field'=>'int'], -'intlcal_get_available_locales' => ['array'], -'intlcal_get_day_of_week_type' => ['int', 'cal'=>'IntlCalendar', 'dayOfWeek'=>'int'], -'intlcal_get_first_day_of_week' => ['int', 'cal'=>'IntlCalendar'], -'intlcal_get_greatest_minimum' => ['int', 'cal'=>'IntlCalendar', 'field'=>'int'], -'intlcal_get_keyword_values_for_locale' => ['Iterator', 'key'=>'string', 'locale'=>'string', 'commonlyUsed'=>'bool'], -'intlcal_get_least_maximum' => ['int', 'cal'=>'IntlCalendar', 'field'=>'int'], -'intlcal_get_locale' => ['string', 'cal'=>'IntlCalendar', 'localeType'=>'int'], -'intlcal_get_maximum' => ['int', 'cal'=>'IntlCalendar', 'field'=>'int'], -'intlcal_get_minimal_days_in_first_week' => ['int', 'cal'=>'IntlCalendar'], -'intlcal_get_minimum' => ['int', 'cal'=>'IntlCalendar', 'field'=>'int'], -'intlcal_get_now' => ['float'], -'intlcal_get_repeated_wall_time_option' => ['int', 'cal'=>'IntlCalendar'], -'intlcal_get_skipped_wall_time_option' => ['int', 'cal'=>'IntlCalendar'], -'intlcal_get_time' => ['float', 'cal'=>'IntlCalendar'], -'intlcal_get_time_zone' => ['IntlTimeZone', 'cal'=>'IntlCalendar'], -'intlcal_get_type' => ['string', 'cal'=>'IntlCalendar'], -'intlcal_get_weekend_transition' => ['int', 'cal'=>'IntlCalendar', 'dayOfWeek'=>'string'], -'intlcal_in_daylight_time' => ['bool', 'cal'=>'IntlCalendar'], -'intlcal_is_equivalent_to' => ['bool', 'cal'=>'IntlCalendar', 'other'=>'IntlCalendar'], -'intlcal_is_lenient' => ['bool', 'cal'=>'IntlCalendar'], -'intlcal_is_set' => ['bool', 'cal'=>'IntlCalendar', 'field'=>'int'], -'intlcal_is_weekend' => ['bool', 'cal'=>'IntlCalendar', 'date='=>'float'], -'intlcal_roll' => ['bool', 'cal'=>'IntlCalendar', 'field'=>'int', 'amountOrUpOrDown'=>'mixed'], -'intlcal_set' => ['bool', 'cal'=>'IntlCalendar', 'field'=>'int', 'value'=>'int'], -'intlcal_set\'1' => ['bool', 'cal'=>'IntlCalendar', 'year'=>'int', 'month'=>'int', 'dayOfMonth='=>'int', 'hour='=>'int', 'minute='=>'int', 'second='=>'int'], -'intlcal_set_first_day_of_week' => ['bool', 'cal'=>'IntlCalendar', 'dayOfWeek'=>'int'], -'intlcal_set_lenient' => ['bool', 'cal'=>'IntlCalendar', 'isLenient'=>'bool'], -'intlcal_set_repeated_wall_time_option' => ['bool', 'cal'=>'IntlCalendar', 'wallTimeOption'=>'int'], -'intlcal_set_skipped_wall_time_option' => ['bool', 'cal'=>'IntlCalendar', 'wallTimeOption'=>'int'], -'intlcal_set_time' => ['bool', 'cal'=>'IntlCalendar', 'date'=>'float'], -'intlcal_set_time_zone' => ['bool', 'cal'=>'IntlCalendar', 'timeZone'=>'mixed'], -'intlcal_to_date_time' => ['DateTime', 'cal'=>'IntlCalendar'], -'IntlCalendar::__construct' => ['void'], -'IntlCalendar::add' => ['bool', 'field'=>'int', 'amount'=>'int'], -'IntlCalendar::after' => ['bool', 'other'=>'IntlCalendar'], -'IntlCalendar::before' => ['bool', 'other'=>'IntlCalendar'], -'IntlCalendar::clear' => ['bool', 'field='=>'int'], -'IntlCalendar::createInstance' => ['IntlCalendar', 'timeZone='=>'mixed', 'locale='=>'string'], -'IntlCalendar::equals' => ['bool', 'other'=>'IntlCalendar'], -'IntlCalendar::fieldDifference' => ['int', 'when'=>'float', 'field'=>'int'], -'IntlCalendar::fromDateTime' => ['IntlCalendar', 'dateTime'=>'DateTime|string'], -'IntlCalendar::get' => ['int', 'field'=>'int'], -'IntlCalendar::getActualMaximum' => ['int', 'field'=>'int'], -'IntlCalendar::getActualMinimum' => ['int', 'field'=>'int'], -'IntlCalendar::getAvailableLocales' => ['array'], -'IntlCalendar::getDayOfWeekType' => ['int', 'dayOfWeek'=>'int'], -'IntlCalendar::getErrorCode' => ['int'], -'IntlCalendar::getErrorMessage' => ['string'], -'IntlCalendar::getFirstDayOfWeek' => ['int'], -'IntlCalendar::getGreatestMinimum' => ['int', 'field'=>'int'], -'IntlCalendar::getKeywordValuesForLocale' => ['Iterator', 'key'=>'string', 'locale'=>'string', 'commonlyUsed'=>'bool'], -'IntlCalendar::getLeastMaximum' => ['int', 'field'=>'int'], -'IntlCalendar::getLocale' => ['string', 'localeType'=>'int'], -'IntlCalendar::getMaximum' => ['int', 'field'=>'int'], -'IntlCalendar::getMinimalDaysInFirstWeek' => ['int'], -'IntlCalendar::getMinimum' => ['int', 'field'=>'int'], -'IntlCalendar::getNow' => ['float'], -'IntlCalendar::getRepeatedWallTimeOption' => ['int'], -'IntlCalendar::getSkippedWallTimeOption' => ['int'], -'IntlCalendar::getTime' => ['float'], -'IntlCalendar::getTimeZone' => ['IntlTimeZone'], -'IntlCalendar::getType' => ['string'], -'IntlCalendar::getWeekendTransition' => ['int', 'dayOfWeek'=>'string'], -'IntlCalendar::inDaylightTime' => ['bool'], -'IntlCalendar::isEquivalentTo' => ['bool', 'other'=>'IntlCalendar'], -'IntlCalendar::isLenient' => ['bool'], -'IntlCalendar::isSet' => ['bool', 'field'=>'int'], -'IntlCalendar::isWeekend' => ['bool', 'date='=>'float'], -'IntlCalendar::roll' => ['bool', 'field'=>'int', 'amountOrUpOrDown'=>'mixed'], -'IntlCalendar::set' => ['bool', 'field'=>'int', 'value'=>'int'], -'IntlCalendar::set\'1' => ['bool', 'year'=>'int', 'month'=>'int', 'dayOfMonth='=>'int', 'hour='=>'int', 'minute='=>'int', 'second='=>'int'], -'IntlCalendar::setFirstDayOfWeek' => ['bool', 'dayOfWeek'=>'int'], -'IntlCalendar::setLenient' => ['bool', 'isLenient'=>'string'], -'IntlCalendar::setMinimalDaysInFirstWeek' => ['bool', 'minimalDays'=>'int'], -'IntlCalendar::setRepeatedWallTimeOption' => ['bool', 'wallTimeOption'=>'int'], -'IntlCalendar::setSkippedWallTimeOption' => ['bool', 'wallTimeOption'=>'int'], -'IntlCalendar::setTime' => ['bool', 'date'=>'float'], -'IntlCalendar::setTimeZone' => ['bool', 'timeZone'=>'mixed'], -'IntlCalendar::toDateTime' => ['DateTime'], -'IntlChar::charAge' => ['array', 'char'=>'int|string'], -'IntlChar::charDigitValue' => ['int', 'codepoint'=>'mixed'], -'IntlChar::charDirection' => ['int', 'codepoint'=>'mixed'], -'IntlChar::charFromName' => ['int', 'name'=>'string', 'namechoice='=>'int'], -'IntlChar::charMirror' => ['mixed', 'codepoint'=>'mixed'], -'IntlChar::charName' => ['string', 'char'=>'int|string', 'namechoice='=>'int'], -'IntlChar::charType' => ['int', 'codepoint'=>'mixed'], -'IntlChar::chr' => ['string', 'codepoint'=>'mixed'], -'IntlChar::digit' => ['int', 'char'=>'int|string', 'radix='=>'int'], -'IntlChar::enumCharNames' => ['void', 'start'=>'mixed', 'limit'=>'mixed', 'callback'=>'callable', 'nameChoice='=>'int'], -'IntlChar::enumCharTypes' => ['void', 'cb='=>'callable'], -'IntlChar::foldCase' => ['int|string', 'char'=>'int|string', 'options='=>'int'], -'IntlChar::forDigit' => ['int', 'digit'=>'int', 'radix'=>'int'], -'IntlChar::getBidiPairedBracket' => ['mixed', 'codepoint'=>'mixed'], -'IntlChar::getBlockCode' => ['int', 'char'=>'int|string'], -'IntlChar::getCombiningClass' => ['int', 'codepoint'=>'mixed'], -'IntlChar::getFC_NFKC_Closure' => ['string', 'char'=>'int|string'], -'IntlChar::getIntPropertyMaxValue' => ['int', 'property'=>'int'], -'IntlChar::getIntPropertyMinValue' => ['int', 'property'=>'int'], -'IntlChar::getIntPropertyMxValue' => ['int', 'property'=>'int'], -'IntlChar::getIntPropertyValue' => ['int', 'char'=>'int|string', 'property'=>'int'], -'IntlChar::getNumericValue' => ['float', 'char'=>'int|string'], -'IntlChar::getPropertyEnum' => ['int', 'alias'=>'string'], -'IntlChar::getPropertyName' => ['string', 'property'=>'int', 'namechoice='=>'int'], -'IntlChar::getPropertyValueEnum' => ['int', 'property'=>'int', 'name'=>'string'], -'IntlChar::getPropertyValueName' => ['string', 'prop'=>'int', 'val'=>'int', 'namechoice='=>'int'], -'IntlChar::getUnicodeVersion' => ['array'], -'IntlChar::hasBinaryProperty' => ['bool', 'char'=>'int|string', 'property'=>'int'], -'IntlChar::isalnum' => ['bool', 'codepoint'=>'mixed'], -'IntlChar::isalpha' => ['bool', 'codepoint'=>'mixed'], -'IntlChar::isbase' => ['bool', 'codepoint'=>'mixed'], -'IntlChar::isblank' => ['bool', 'codepoint'=>'mixed'], -'IntlChar::iscntrl' => ['bool', 'codepoint'=>'mixed'], -'IntlChar::isdefined' => ['bool', 'codepoint'=>'mixed'], -'IntlChar::isdigit' => ['bool', 'codepoint'=>'mixed'], -'IntlChar::isgraph' => ['bool', 'codepoint'=>'mixed'], -'IntlChar::isIDIgnorable' => ['bool', 'codepoint'=>'mixed'], -'IntlChar::isIDPart' => ['bool', 'codepoint'=>'mixed'], -'IntlChar::isIDStart' => ['bool', 'codepoint'=>'mixed'], -'IntlChar::isISOControl' => ['bool', 'codepoint'=>'mixed'], -'IntlChar::isJavaIDPart' => ['bool', 'codepoint'=>'mixed'], -'IntlChar::isJavaIDStart' => ['bool', 'codepoint'=>'mixed'], -'IntlChar::isJavaSpaceChar' => ['bool', 'codepoint'=>'mixed'], -'IntlChar::islower' => ['bool', 'codepoint'=>'mixed'], -'IntlChar::isMirrored' => ['bool', 'codepoint'=>'mixed'], -'IntlChar::isprint' => ['bool', 'codepoint'=>'mixed'], -'IntlChar::ispunct' => ['bool', 'codepoint'=>'mixed'], -'IntlChar::isspace' => ['bool', 'codepoint'=>'mixed'], -'IntlChar::istitle' => ['bool', 'codepoint'=>'mixed'], -'IntlChar::isUAlphabetic' => ['bool', 'codepoint'=>'mixed'], -'IntlChar::isULowercase' => ['bool', 'codepoint'=>'mixed'], -'IntlChar::isupper' => ['bool', 'codepoint'=>'mixed'], -'IntlChar::isUUppercase' => ['bool', 'codepoint'=>'mixed'], -'IntlChar::isUWhiteSpace' => ['bool', 'codepoint'=>'mixed'], -'IntlChar::isWhitespace' => ['bool', 'codepoint'=>'mixed'], -'IntlChar::isxdigit' => ['bool', 'codepoint'=>'mixed'], -'IntlChar::ord' => ['int', 'character'=>'mixed'], -'IntlChar::tolower' => ['mixed', 'codepoint'=>'mixed'], -'IntlChar::totitle' => ['mixed', 'codepoint'=>'mixed'], -'IntlChar::toupper' => ['mixed', 'codepoint'=>'mixed'], -'IntlCodePointBreakIterator::getLastCodePoint' => ['int'], -'IntlDateFormatter::__construct' => ['void', 'locale'=>'string', 'datetype'=>'?int', 'timetype'=>'?int', 'timezone='=>'null|string|IntlTimeZone|DateTimeZone', 'calendar='=>'null|int|IntlCalendar', 'pattern='=>'string'], -'IntlDateFormatter::create' => ['IntlDateFormatter|false', 'locale'=>'string', 'datetype'=>'int', 'timetype'=>'int', 'timezone='=>'null|string|IntlTimeZone|DateTimeZone', 'calendar='=>'int|IntlCalendar', 'pattern='=>'string'], -'IntlDateFormatter::format' => ['string', 'args'=>''], -'IntlDateFormatter::formatObject' => ['string', 'object'=>'object', 'format='=>'mixed', 'locale='=>'string'], -'IntlDateFormatter::getCalendar' => ['int'], -'IntlDateFormatter::getCalendarObject' => ['IntlCalendar'], -'IntlDateFormatter::getDateType' => ['int'], -'IntlDateFormatter::getErrorCode' => ['int'], -'IntlDateFormatter::getErrorMessage' => ['string'], -'IntlDateFormatter::getLocale' => ['string'], -'IntlDateFormatter::getPattern' => ['string'], -'IntlDateFormatter::getTimeType' => ['int'], -'IntlDateFormatter::getTimeZone' => ['IntlTimeZone'], -'IntlDateFormatter::getTimeZoneId' => ['string'], -'IntlDateFormatter::isLenient' => ['bool'], -'IntlDateFormatter::localtime' => ['array', 'text_to_parse'=>'string', '&w_parse_pos='=>'int'], -'IntlDateFormatter::parse' => ['int', 'text_to_parse'=>'string', '&rw_parse_pos='=>'int'], -'IntlDateFormatter::setCalendar' => ['bool', 'calendar'=>''], -'IntlDateFormatter::setLenient' => ['bool', 'lenient'=>'bool'], -'IntlDateFormatter::setPattern' => ['bool', 'pattern'=>'string'], -'IntlDateFormatter::setTimeZone' => ['bool', 'timezone'=>''], -'IntlDateFormatter::setTimeZoneId' => ['bool', 'zone'=>'string', 'fmt='=>'IntlDateFormatter'], -'IntlGregorianCalendar::getGregorianChange' => ['float'], -'IntlGregorianCalendar::isLeapYear' => ['bool', 'year'=>'int'], -'IntlGregorianCalendar::setGregorianChange' => ['bool', 'date'=>'float'], -'IntlIterator::current' => ['mixed'], -'IntlIterator::key' => ['string'], -'IntlIterator::next' => ['void'], -'IntlIterator::rewind' => ['void'], -'IntlIterator::valid' => ['bool'], -'IntlPartsIterator::getBreakIterator' => ['IntlBreakIterator'], -'IntlRuleBasedBreakIterator::__construct' => ['void', 'rules'=>'string', 'areCompiled='=>'string'], -'IntlRuleBasedBreakIterator::createCharacterInstance' => ['IntlRuleBasedBreakIterator', 'locale'=>'string'], -'IntlRuleBasedBreakIterator::createCodePointInstance' => ['IntlCodePointBreakIterator'], -'IntlRuleBasedBreakIterator::createLineInstance' => ['IntlRuleBasedBreakIterator', 'locale'=>'string'], -'IntlRuleBasedBreakIterator::createSentenceInstance' => ['IntlRuleBasedBreakIterator', 'locale'=>'string'], -'IntlRuleBasedBreakIterator::createTitleInstance' => ['IntlRuleBasedBreakIterator', 'locale'=>'string'], -'IntlRuleBasedBreakIterator::createWordInstance' => ['IntlRuleBasedBreakIterator', 'locale'=>'string'], -'IntlRuleBasedBreakIterator::current' => ['int'], -'IntlRuleBasedBreakIterator::first' => ['int'], -'IntlRuleBasedBreakIterator::following' => ['int', 'offset'=>'string'], -'IntlRuleBasedBreakIterator::getBinaryRules' => ['string'], -'IntlRuleBasedBreakIterator::getErrorCode' => ['int'], -'IntlRuleBasedBreakIterator::getErrorMessage' => ['string'], -'IntlRuleBasedBreakIterator::getLocale' => ['string', 'locale_type'=>'string'], -'IntlRuleBasedBreakIterator::getPartsIterator' => ['IntlPartsIterator', 'key_type='=>'string'], -'IntlRuleBasedBreakIterator::getRules' => ['string'], -'IntlRuleBasedBreakIterator::getRuleStatus' => ['int'], -'IntlRuleBasedBreakIterator::getRuleStatusVec' => ['array'], -'IntlRuleBasedBreakIterator::getText' => ['string'], -'IntlRuleBasedBreakIterator::isBoundary' => ['bool', 'offset'=>'string'], -'IntlRuleBasedBreakIterator::last' => ['int'], -'IntlRuleBasedBreakIterator::next' => ['int', 'offset='=>'string'], -'IntlRuleBasedBreakIterator::preceding' => ['int', 'offset'=>'string'], -'IntlRuleBasedBreakIterator::previous' => ['int'], -'IntlRuleBasedBreakIterator::setText' => ['bool', 'text'=>'string'], -'IntlTimeZone::countEquivalentIDs' => ['int', 'zoneId'=>'string'], -'IntlTimeZone::createDefault' => ['IntlTimeZone'], -'IntlTimeZone::createEnumeration' => ['IntlIterator', 'countryOrRawOffset='=>'mixed'], -'IntlTimeZone::createTimeZone' => ['IntlTimeZone', 'zoneId'=>'string'], -'IntlTimeZone::createTimeZoneIDEnumeration' => ['IntlIterator', 'zoneType'=>'int', 'region='=>'string', 'rawOffset='=>'int'], -'IntlTimeZone::fromDateTimeZone' => ['IntlTimeZone', 'zoneId'=>'DateTimeZone'], -'IntlTimeZone::getCanonicalID' => ['string', 'zoneId'=>'string', '&w_isSystemID='=>'bool'], -'IntlTimeZone::getDisplayName' => ['string', 'isDaylight='=>'bool', 'style='=>'int', 'locale='=>'string'], -'IntlTimeZone::getDSTSavings' => ['int'], -'IntlTimeZone::getEquivalentID' => ['string', 'zoneId'=>'string', 'index'=>'int'], -'IntlTimeZone::getErrorCode' => ['int'], -'IntlTimeZone::getErrorMessage' => ['string'], -'IntlTimeZone::getGMT' => ['IntlTimeZone'], -'IntlTimeZone::getID' => ['string'], -'IntlTimeZone::getIDForWindowsID' => ['string', 'timezone'=>'string', 'region='=>'string'], -'IntlTimeZone::getOffset' => ['int', 'date'=>'float', 'local'=>'bool', '&w_rawOffset'=>'int', '&w_dstOffset'=>'int'], -'IntlTimeZone::getRawOffset' => ['int'], -'IntlTimeZone::getRegion' => ['string', 'zoneId'=>'string'], -'IntlTimeZone::getTZDataVersion' => ['string'], -'IntlTimeZone::getUnknown' => ['IntlTimeZone'], -'IntlTimeZone::getWindowsID' => ['string', 'timezone'=>'string'], -'IntlTimeZone::hasSameRules' => ['bool', 'otherTimeZone'=>'IntlTimeZone'], -'IntlTimeZone::toDateTimeZone' => ['DateTimeZone'], -'IntlTimeZone::useDaylightTime' => ['bool'], -'intltz_count_equivalent_ids' => ['int', 'zoneId'=>'string'], -'intltz_create_enumeration' => ['IntlIterator', 'countryOrRawOffset'=>'mixed'], -'intltz_create_time_zone' => ['IntlTimeZone', 'zoneId'=>'string'], -'intltz_from_date_time_zone' => ['IntlTimeZone', 'zoneId'=>'DateTimeZone'], -'intltz_get_canonical_id' => ['string', 'zoneId'=>'string', '&isSystemID'=>'bool'], -'intltz_get_display_name' => ['string', 'obj'=>'IntlTimeZone', 'isDaylight'=>'bool', 'style'=>'int', 'locale'=>'string'], -'intltz_get_dst_savings' => ['int', 'obj'=>'IntlTimeZone'], -'intltz_get_equivalent_id' => ['string', 'zoneId'=>'string', 'index'=>'int'], -'intltz_get_error_code' => ['int', 'obj'=>'IntlTimeZone'], -'intltz_get_error_message' => ['string', 'obj'=>'IntlTimeZone'], -'intltz_get_id' => ['string', 'obj'=>'IntlTimeZone'], -'intltz_get_offset' => ['int', 'obj'=>'IntlTimeZone', 'date'=>'float', 'local'=>'bool', '&rawOffset'=>'int', '&dstOffset'=>'int'], -'intltz_get_raw_offset' => ['int', 'obj'=>'IntlTimeZone'], -'intltz_get_tz_data_version' => ['string', 'obj'=>'IntlTimeZone'], -'intltz_getGMT' => ['IntlTimeZone'], -'intltz_has_same_rules' => ['bool', 'obj'=>'IntlTimeZone', 'otherTimeZone'=>'IntlTimeZone'], -'intltz_to_date_time_zone' => ['DateTimeZone', 'obj'=>''], -'intltz_use_daylight_time' => ['bool', 'obj'=>''], -'intlz_create_default' => ['IntlTimeZone'], -'intval' => ['int', 'var'=>'mixed', 'base='=>'int'], -'InvalidArgumentException::__clone' => ['void'], -'InvalidArgumentException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'(?Throwable)|(?InvalidArgumentException)'], -'InvalidArgumentException::__toString' => ['string'], -'InvalidArgumentException::getCode' => ['int'], -'InvalidArgumentException::getFile' => ['string'], -'InvalidArgumentException::getLine' => ['int'], -'InvalidArgumentException::getMessage' => ['string'], -'InvalidArgumentException::getPrevious' => ['Throwable|InvalidArgumentException|null'], -'InvalidArgumentException::getTrace' => ['array'], -'InvalidArgumentException::getTraceAsString' => ['string'], -'ip2long' => ['int|false', 'ip_address'=>'string'], -'iptcembed' => ['array', 'iptcdata'=>'string', 'jpeg_file_name'=>'string', 'spool='=>'int'], -'iptcparse' => ['array|false', 'iptcdata'=>'string'], -'is_a' => ['bool', 'object_or_string'=>'object|string', 'class_name'=>'string', 'allow_string='=>'bool'], -'is_array' => ['bool', 'var'=>'mixed'], -'is_bool' => ['bool', 'var'=>'mixed'], -'is_callable' => ['bool', 'var'=>'mixed', 'syntax_only='=>'bool', '&w_callable_name='=>'string'], -'is_countable' => ['bool', 'var'=>'mixed'], -'is_dir' => ['bool', 'filename'=>'string'], -'is_double' => ['bool', 'var'=>''], -'is_executable' => ['bool', 'filename'=>'string'], -'is_file' => ['bool', 'filename'=>'string'], -'is_finite' => ['bool', 'val'=>'float'], -'is_float' => ['bool', 'var'=>'mixed'], -'is_infinite' => ['bool', 'val'=>'float'], -'is_int' => ['bool', 'var'=>'mixed'], -'is_integer' => ['bool', 'var'=>''], -'is_iterable' => ['bool', 'var'=>'mixed'], -'is_link' => ['bool', 'filename'=>'string'], -'is_long' => ['bool', 'var'=>''], -'is_nan' => ['bool', 'val'=>'float'], -'is_null' => ['bool', 'var'=>'mixed'], -'is_numeric' => ['bool', 'value'=>'mixed'], -'is_object' => ['bool', 'var'=>'mixed'], -'is_readable' => ['bool', 'filename'=>'string'], -'is_real' => ['bool', 'var'=>''], -'is_resource' => ['bool', 'var'=>'mixed'], -'is_scalar' => ['bool', 'value'=>'mixed'], -'is_soap_fault' => ['bool', 'object'=>'mixed'], -'is_string' => ['bool', 'var'=>'mixed'], -'is_subclass_of' => ['bool', 'object_or_string'=>'object|string', 'class_name'=>'string', 'allow_string='=>'bool'], -'is_tainted' => ['bool', 'string'=>'string'], -'is_uploaded_file' => ['bool', 'path'=>'string'], -'is_writable' => ['bool', 'filename'=>'string'], -'is_writeable' => ['bool', 'filename'=>'string'], -'isset' => ['bool', 'var'=>'mixed', '...rest='=>'mixed'], -'Iterator::current' => ['mixed'], -'Iterator::key' => ['mixed'], -'Iterator::next' => ['void'], -'Iterator::rewind' => ['void'], -'Iterator::valid' => ['bool'], -'iterator_apply' => ['int', 'it'=>'Traversable', 'function'=>'callable', 'params='=>'array'], -'iterator_count' => ['int', 'it'=>'Traversable'], -'iterator_to_array' => ['array', 'it'=>'Traversable', 'use_keys='=>'bool'], -'IteratorAggregate::getIterator' => ['Traversable'], -'IteratorIterator::__construct' => ['void', 'it'=>'Traversable'], -'IteratorIterator::current' => ['mixed'], -'IteratorIterator::getInnerIterator' => ['Traversable'], -'IteratorIterator::key' => ['mixed'], -'IteratorIterator::next' => ['void'], -'IteratorIterator::rewind' => ['void'], -'IteratorIterator::valid' => ['bool'], -'java_last_exception_clear' => [''], -'java_last_exception_get' => ['object'], -'java_reload' => ['array', 'new_jarpath'=>'new_jarpath'], -'java_require' => ['array', 'new_classpath'=>'new_classpath'], -'java_set_encoding' => ['array', 'encoding'=>'encoding'], -'java_set_ignore_case' => ['void', 'ignore'=>'ignore'], -'java_throw_exceptions' => ['void', 'throw'=>'throw'], -'JavaException::getCause' => ['object'], -'jddayofweek' => ['mixed', 'juliandaycount'=>'int', 'mode='=>'int'], -'jdmonthname' => ['string', 'juliandaycount'=>'int', 'mode'=>'int'], -'jdtofrench' => ['string', 'juliandaycount'=>'int'], -'jdtogregorian' => ['string', 'juliandaycount'=>'int'], -'jdtojewish' => ['string', 'juliandaycount'=>'int', 'hebrew='=>'bool', 'fl='=>'int'], -'jdtojulian' => ['string', 'juliandaycount'=>'int'], -'jdtounix' => ['int|false', 'jday'=>'int'], -'jewishtojd' => ['int', 'month'=>'int', 'day'=>'int', 'year'=>'int'], -'jobqueue_license_info' => ['array'], -'join' => ['string', 'glue'=>'string', 'pieces'=>'array'], -'join\'1' => ['string', 'pieces'=>'array'], -'jpeg2wbmp' => ['bool', 'jpegname'=>'string', 'wbmpname'=>'string', 'dest_height'=>'int', 'dest_width'=>'int', 'threshold'=>'int'], -'json_decode' => ['mixed', 'json'=>'string', 'assoc='=>'bool', 'depth='=>'int', 'options='=>'int'], -'json_encode' => ['string|false', 'data'=>'mixed', 'options='=>'int', 'depth='=>'int'], -'json_last_error' => ['int'], -'json_last_error_msg' => ['string'], -'JsonIncrementalParser::__construct' => ['void', 'depth'=>'', 'options'=>''], -'JsonIncrementalParser::get' => ['', 'options'=>''], -'JsonIncrementalParser::getError' => [''], -'JsonIncrementalParser::parse' => ['', 'json'=>''], -'JsonIncrementalParser::parseFile' => ['', 'filename'=>''], -'JsonIncrementalParser::reset' => [''], -'JsonSerializable::jsonSerialize' => ['mixed'], -'Judy::__construct' => ['void', 'judy_type'=>'int'], -'Judy::__destruct' => [''], -'Judy::byCount' => ['int', 'nth_index'=>'int'], -'Judy::count' => ['int', 'index_start='=>'int', 'index_end='=>'int'], -'Judy::first' => ['mixed', 'index='=>'mixed'], -'Judy::firstEmpty' => ['int', 'index='=>'mixed'], -'Judy::free' => ['int'], -'Judy::getType' => ['int'], -'Judy::last' => ['void', 'index='=>'string'], -'Judy::lastEmpty' => ['int', 'index='=>'int'], -'Judy::memoryUsage' => ['int'], -'Judy::next' => ['mixed', 'index'=>'mixed'], -'Judy::nextEmpty' => ['int', 'index'=>'int'], -'Judy::offsetExists' => ['bool', 'offset'=>'mixed'], -'Judy::offsetGet' => ['mixed', 'offset'=>'mixed'], -'Judy::offsetSet' => ['bool', 'offset'=>'mixed', 'value'=>'mixed'], -'Judy::offsetUnset' => ['bool', 'offset'=>'mixed'], -'Judy::prev' => ['mixed', 'index'=>'mixed'], -'Judy::prevEmpty' => ['int', 'index'=>'mixed'], -'Judy::size' => ['void'], -'judy_type' => ['int', 'array'=>'judy'], -'judy_version' => ['string'], -'juliantojd' => ['int', 'month'=>'int', 'day'=>'int', 'year'=>'int'], -'kadm5_chpass_principal' => ['bool', 'handle'=>'resource', 'principal'=>'string', 'password'=>'string'], -'kadm5_create_principal' => ['bool', 'handle'=>'resource', 'principal'=>'string', 'password='=>'string', 'options='=>'array'], -'kadm5_delete_principal' => ['bool', 'handle'=>'resource', 'principal'=>'string'], -'kadm5_destroy' => ['bool', 'handle'=>'resource'], -'kadm5_flush' => ['bool', 'handle'=>'resource'], -'kadm5_get_policies' => ['array', 'handle'=>'resource'], -'kadm5_get_principal' => ['array', 'handle'=>'resource', 'principal'=>'string'], -'kadm5_get_principals' => ['array', 'handle'=>'resource'], -'kadm5_init_with_password' => ['resource', 'admin_server'=>'string', 'realm'=>'string', 'principal'=>'string', 'password'=>'string'], -'kadm5_modify_principal' => ['bool', 'handle'=>'resource', 'principal'=>'string', 'options'=>'array'], -'key' => ['int|string|null', 'array_arg'=>'array|object'], -'key_exists' => ['bool', 'key'=>'string|int', 'search'=>'array'], -'krsort' => ['bool', '&rw_array_arg'=>'array', 'sort_flags='=>'int'], -'ksort' => ['bool', '&rw_array_arg'=>'array', 'sort_flags='=>'int'], -'KTaglib_ID3v2_AttachedPictureFrame::getDescription' => ['string'], -'KTaglib_ID3v2_AttachedPictureFrame::getMimeType' => ['string'], -'KTaglib_ID3v2_AttachedPictureFrame::getType' => ['int'], -'KTaglib_ID3v2_AttachedPictureFrame::savePicture' => ['bool', 'filename'=>'string'], -'KTaglib_ID3v2_AttachedPictureFrame::setMimeType' => ['string', 'type'=>'string'], -'KTaglib_ID3v2_AttachedPictureFrame::setPicture' => ['', 'filename'=>'string'], -'KTaglib_ID3v2_AttachedPictureFrame::setType' => ['', 'type'=>'int'], -'KTaglib_ID3v2_Frame::__toString' => ['string'], -'KTaglib_ID3v2_Frame::getSize' => ['int'], -'KTaglib_ID3v2_Tag::addFrame' => ['bool', 'frame'=>'ktaglib_id3v2_frame'], -'KTaglib_ID3v2_Tag::getFrameList' => ['array'], -'KTaglib_MPEG_AudioProperties::getBitrate' => ['int'], -'KTaglib_MPEG_AudioProperties::getChannels' => ['int'], -'KTaglib_MPEG_AudioProperties::getLayer' => ['int'], -'KTaglib_MPEG_AudioProperties::getLength' => ['int'], -'KTaglib_MPEG_AudioProperties::getSampleBitrate' => ['int'], -'KTaglib_MPEG_AudioProperties::getVersion' => ['int'], -'KTaglib_MPEG_AudioProperties::isCopyrighted' => ['bool'], -'KTaglib_MPEG_AudioProperties::isOriginal' => ['bool'], -'KTaglib_MPEG_AudioProperties::isProtectionEnabled' => ['bool'], -'KTaglib_MPEG_File::getAudioProperties' => ['KTaglib_MPEG_File'], -'KTaglib_MPEG_File::getID3v1Tag' => ['KTaglib_ID3v1_Tag', 'create='=>'bool'], -'KTaglib_MPEG_File::getID3v2Tag' => ['KTaglib_ID3v2_Tag', 'create='=>'bool'], -'KTaglib_Tag::getAlbum' => ['string'], -'KTaglib_Tag::getArtist' => ['string'], -'KTaglib_Tag::getComment' => ['string'], -'KTaglib_Tag::getGenre' => ['string'], -'KTaglib_Tag::getTitle' => ['string'], -'KTaglib_Tag::getTrack' => ['int'], -'KTaglib_Tag::getYear' => ['int'], -'KTaglib_Tag::isEmpty' => ['bool'], -'labelcacheObj::freeCache' => ['bool'], -'labelObj::__construct' => ['void'], -'labelObj::convertToString' => ['string'], -'labelObj::deleteStyle' => ['int', 'index'=>'int'], -'labelObj::free' => ['void'], -'labelObj::getBinding' => ['string', 'labelbinding'=>'mixed'], -'labelObj::getExpressionString' => ['string'], -'labelObj::getStyle' => ['styleObj', 'index'=>'int'], -'labelObj::getTextString' => ['string'], -'labelObj::moveStyleDown' => ['int', 'index'=>'int'], -'labelObj::moveStyleUp' => ['int', 'index'=>'int'], -'labelObj::removeBinding' => ['int', 'labelbinding'=>'mixed'], -'labelObj::set' => ['int', 'property_name'=>'string', 'new_value'=>''], -'labelObj::setBinding' => ['int', 'labelbinding'=>'mixed', 'value'=>'string'], -'labelObj::setExpression' => ['int', 'expression'=>'string'], -'labelObj::setText' => ['int', 'text'=>'string'], -'labelObj::updateFromString' => ['int', 'snippet'=>'string'], -'Lapack::eigenValues' => ['array', 'a'=>'array', 'left='=>'array', 'right='=>'array'], -'Lapack::identity' => ['array', 'n'=>'int'], -'Lapack::leastSquaresByFactorisation' => ['array', 'a'=>'array', 'b'=>'array'], -'Lapack::leastSquaresBySVD' => ['array', 'a'=>'array', 'b'=>'array'], -'Lapack::pseudoInverse' => ['array', 'a'=>'array'], -'Lapack::singularValues' => ['array', 'a'=>'array'], -'Lapack::solveLinearEquation' => ['array', 'a'=>'array', 'b'=>'array'], -'layerObj::addFeature' => ['int', 'shape'=>'shapeObj'], -'layerObj::applySLD' => ['int', 'sldxml'=>'string', 'namedlayer'=>'string'], -'layerObj::applySLDURL' => ['int', 'sldurl'=>'string', 'namedlayer'=>'string'], -'layerObj::clearProcessing' => ['void'], -'layerObj::close' => ['void'], -'layerObj::convertToString' => ['string'], -'layerObj::draw' => ['int', 'image'=>'imageObj'], -'layerObj::drawQuery' => ['int', 'image'=>'imageObj'], -'layerObj::free' => ['void'], -'layerObj::generateSLD' => ['string'], -'layerObj::getClass' => ['classObj', 'classIndex'=>'int'], -'layerObj::getClassIndex' => ['int', 'shape'=>'', 'classgroup'=>'', 'numclasses'=>''], -'layerObj::getExtent' => ['rectObj'], -'layerObj::getFilterString' => ['string'], -'layerObj::getGridIntersectionCoordinates' => ['array'], -'layerObj::getItems' => ['array'], -'layerObj::getMetaData' => ['int', 'name'=>'string'], -'layerObj::getNumResults' => ['int'], -'layerObj::getProcessing' => ['array'], -'layerObj::getProjection' => ['string'], -'layerObj::getResult' => ['resultObj', 'index'=>'int'], -'layerObj::getResultsBounds' => ['rectObj'], -'layerObj::getShape' => ['shapeObj', 'result'=>'resultObj'], -'layerObj::getWMSFeatureInfoURL' => ['string', 'clickX'=>'int', 'clickY'=>'int', 'featureCount'=>'int', 'infoFormat'=>'string'], -'layerObj::isVisible' => ['bool'], -'layerObj::moveclassdown' => ['int', 'index'=>'int'], -'layerObj::moveclassup' => ['int', 'index'=>'int'], -'layerObj::ms_newLayerObj' => ['layerObj', 'map'=>'MapObj', 'layer'=>'layerObj'], -'layerObj::nextShape' => ['shapeObj'], -'layerObj::open' => ['int'], -'layerObj::queryByAttributes' => ['int', 'qitem'=>'string', 'qstring'=>'string', 'mode'=>'int'], -'layerObj::queryByFeatures' => ['int', 'slayer'=>'int'], -'layerObj::queryByPoint' => ['int', 'point'=>'pointObj', 'mode'=>'int', 'buffer'=>'float'], -'layerObj::queryByRect' => ['int', 'rect'=>'rectObj'], -'layerObj::queryByShape' => ['int', 'shape'=>'shapeObj'], -'layerObj::removeClass' => ['classObj', 'index'=>'int'], -'layerObj::removeMetaData' => ['int', 'name'=>'string'], -'layerObj::set' => ['int', 'property_name'=>'string', 'new_value'=>''], -'layerObj::setConnectionType' => ['int', 'connectiontype'=>'int', 'plugin_library'=>'string'], -'layerObj::setFilter' => ['int', 'expression'=>'string'], -'layerObj::setMetaData' => ['int', 'name'=>'string', 'value'=>'string'], -'layerObj::setProjection' => ['int', 'proj_params'=>'string'], -'layerObj::setWKTProjection' => ['int', 'proj_params'=>'string'], -'layerObj::updateFromString' => ['int', 'snippet'=>'string'], -'lcfirst' => ['string', 'str'=>'string'], -'lcg_value' => ['float'], -'lchgrp' => ['bool', 'filename'=>'string', 'group'=>'string|int'], -'lchown' => ['bool', 'filename'=>'string', 'user'=>'string|int'], -'ldap_8859_to_t61' => ['string', 'value'=>'string'], -'ldap_add' => ['bool', 'link_identifier'=>'resource', 'dn'=>'string', 'entry'=>'array', 'servercontrols='=>'array'], -'ldap_add_ext' => ['resource|false', 'link_identifier'=>'resource', 'dn'=>'string', 'entry'=>'array', 'servercontrols='=>'array'], -'ldap_bind' => ['bool', 'link_identifier'=>'resource', 'dn='=>'string', 'password='=>'string'], -'ldap_bind_ext' => ['resource|false', 'link_identifier'=>'resource', 'dn='=>'string', 'password='=>'string'], -'ldap_close' => ['bool', 'link_identifier'=>'resource'], -'ldap_compare' => ['bool', 'link_identifier'=>'resource', 'dn'=>'string', 'attr'=>'string', 'value'=>'string'], -'ldap_connect' => ['resource|false', 'host='=>'string', 'port='=>'int', 'wallet='=>'string', 'wallet_passwd='=>'string', 'authmode='=>'int'], -'ldap_control_paged_result' => ['bool', 'link_identifier'=>'resource', 'pagesize'=>'int', 'iscritical='=>'bool', 'cookie='=>'string'], -'ldap_control_paged_result_response' => ['bool', 'link_identifier'=>'resource', 'result_identifier'=>'resource', '&w_cookie='=>'string', '&w_estimated='=>'int'], -'ldap_count_entries' => ['int', 'link_identifier'=>'resource', 'result'=>'resource'], -'ldap_delete' => ['bool', 'link_identifier'=>'resource', 'dn'=>'string'], -'ldap_delete_ext' => ['resource|false', 'link_identifier'=>'resource', 'dn'=>'string', 'servercontrols='=>'array'], -'ldap_dn2ufn' => ['string', 'dn'=>'string'], -'ldap_err2str' => ['string', 'errno'=>'int'], -'ldap_errno' => ['int', 'link_identifier'=>'resource'], -'ldap_error' => ['string', 'link_identifier'=>'resource'], -'ldap_escape' => ['string', 'value'=>'string', 'ignore='=>'string', 'flags='=>'int'], -'ldap_exop' => ['mixed', 'link'=>'resource', 'reqoid'=>'string', 'reqdata='=>'string', 'servercontrols='=>'array', '&w_retdata='=>'string', '&w_retoid='=>'string'], -'ldap_exop_passwd' => ['mixed', 'link'=>'resource', 'user='=>'string', 'oldpw='=>'string', 'newpw='=>'string', 'serverctrls='=>'array'], -'ldap_exop_refresh' => ['int|false', 'link'=>'resource', 'dn'=>'string', 'ttl'=>'int'], -'ldap_exop_whoami' => ['string', 'link'=>'resource'], -'ldap_explode_dn' => ['array', 'dn'=>'string', 'with_attrib'=>'int'], -'ldap_first_attribute' => ['string', 'link_identifier'=>'resource', 'result_entry_identifier'=>'resource'], -'ldap_first_entry' => ['resource|false', 'link_identifier'=>'resource', 'result_identifier'=>'resource'], -'ldap_first_reference' => ['resource|false', 'link_identifier'=>'resource', 'result_identifier'=>'resource'], -'ldap_free_result' => ['bool', 'result_identifier'=>'resource'], -'ldap_get_attributes' => ['array', 'link_identifier'=>'resource', 'result_entry_identifier'=>'resource'], -'ldap_get_dn' => ['string', 'link_identifier'=>'resource', 'result_entry_identifier'=>'resource'], -'ldap_get_entries' => ['array|false', 'link_identifier'=>'resource', 'result_identifier'=>'resource'], -'ldap_get_option' => ['bool', 'link_identifier'=>'resource', 'option'=>'int', '&w_retval'=>'mixed'], -'ldap_get_values' => ['array', 'link_identifier'=>'resource', 'result_entry_identifier'=>'resource', 'attribute'=>'string'], -'ldap_get_values_len' => ['array', 'link_identifier'=>'resource', 'result_entry_identifier'=>'resource', 'attribute'=>'string'], -'ldap_list' => ['resource|false', 'link'=>'resource|array', 'base_dn'=>'string', 'filter'=>'string', 'attrs='=>'array', 'attrsonly='=>'int', 'sizelimit='=>'int', 'timelimit='=>'int', 'deref='=>'int'], -'ldap_mod_add' => ['bool', 'link_identifier'=>'resource', 'dn'=>'string', 'entry'=>'array'], -'ldap_mod_add_ext' => ['resource|false', 'link_identifier'=>'resource', 'dn'=>'string', 'entry'=>'array', 'servercontrols='=>'array'], -'ldap_mod_del' => ['bool', 'link_identifier'=>'resource', 'dn'=>'string', 'entry'=>'array'], -'ldap_mod_del_ext' => ['resource|false', 'link_identifier'=>'resource', 'dn'=>'string', 'entry'=>'array', 'servercontrols='=>'array'], -'ldap_mod_replace' => ['bool', 'link_identifier'=>'resource', 'dn'=>'string', 'entry'=>'array'], -'ldap_mod_replace_ext' => ['resource|false', 'link_identifier'=>'resource', 'dn'=>'string', 'entry'=>'array', 'servercontrols='=>'array'], -'ldap_modify' => ['bool', 'link_identifier'=>'resource', 'dn'=>'string', 'entry'=>'array'], -'ldap_modify_batch' => ['bool', 'link_identifier'=>'resource', 'dn'=>'string', 'modifs'=>'array'], -'ldap_next_attribute' => ['string', 'link_identifier'=>'resource', 'result_entry_identifier'=>'resource'], -'ldap_next_entry' => ['resource|false', 'link_identifier'=>'resource', 'result_entry_identifier'=>'resource'], -'ldap_next_reference' => ['resource|false', 'link_identifier'=>'resource', 'reference_entry_identifier'=>'resource'], -'ldap_parse_exop' => ['bool', 'link'=>'resource', 'result'=>'resource', '&w_retdata='=>'string', '&w_retoid='=>'string'], -'ldap_parse_reference' => ['bool', 'link_identifier'=>'resource', 'reference_entry_identifier'=>'resource', 'referrals'=>'array'], -'ldap_parse_result' => ['bool', 'link_identifier'=>'resource', 'result'=>'resource', '&w_errcode'=>'int', '&w_matcheddn='=>'string', '&w_errmsg='=>'string', '&w_referrals='=>'array', '&w_serverctrls='=>'array'], -'ldap_read' => ['resource|false', 'link'=>'resource|array', 'base_dn'=>'string', 'filter'=>'string', 'attrs='=>'array', 'attrsonly='=>'int', 'sizelimit='=>'int', 'timelimit='=>'int', 'deref='=>'int'], -'ldap_rename' => ['bool', 'link_identifier'=>'resource', 'dn'=>'string', 'newrdn'=>'string', 'newparent'=>'string', 'deleteoldrdn'=>'bool'], -'ldap_rename_ext' => ['resource|false', 'link_identifier'=>'resource', 'dn'=>'string', 'newrdn'=>'string', 'newparent'=>'string', 'deleteoldrdn'=>'bool', 'servercontrols='=>'array'], -'ldap_sasl_bind' => ['bool', 'link_identifier'=>'resource', 'binddn='=>'string', 'password='=>'string', 'sasl_mech='=>'string', 'sasl_realm='=>'string', 'sasl_authc_id='=>'string', 'sasl_authz_id='=>'string', 'props='=>'string'], -'ldap_search' => ['resource|false', 'link_identifier'=>'resource|array', 'base_dn'=>'string', 'filter'=>'string', 'attrs='=>'array', 'attrsonly='=>'int', 'sizelimit='=>'int', 'timelimit='=>'int', 'deref='=>'int'], -'ldap_set_option' => ['bool', 'link_identifier'=>'resource', 'option'=>'int', 'newval'=>'mixed'], -'ldap_set_rebind_proc' => ['bool', 'link_identifier'=>'resource', 'callback'=>'string'], -'ldap_sort' => ['bool', 'link_identifier'=>'resource', 'result_identifier'=>'resource', 'sortfilter'=>'string'], -'ldap_start_tls' => ['bool', 'link_identifier'=>'resource'], -'ldap_t61_to_8859' => ['string', 'value'=>'string'], -'ldap_unbind' => ['bool', 'link_identifier'=>'resource'], -'leak' => ['', 'num_bytes'=>'int'], -'leak_variable' => ['', 'variable'=>'', 'leak_data'=>'bool'], -'legendObj::convertToString' => ['string'], -'legendObj::free' => ['void'], -'legendObj::set' => ['int', 'property_name'=>'string', 'new_value'=>''], -'legendObj::updateFromString' => ['int', 'snippet'=>'string'], -'LengthException::__clone' => ['void'], -'LengthException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'(?Throwable)|(?LengthException)'], -'LengthException::__toString' => ['string'], -'LengthException::getCode' => ['int'], -'LengthException::getFile' => ['string'], -'LengthException::getLine' => ['int'], -'LengthException::getMessage' => ['string'], -'LengthException::getPrevious' => ['Throwable|LengthException|null'], -'LengthException::getTrace' => ['array'], -'LengthException::getTraceAsString' => ['string'], -'levenshtein' => ['int', 'str1'=>'string', 'str2'=>'string'], -'levenshtein\'1' => ['int', 'str1'=>'string', 'str2'=>'string', 'cost_ins'=>'int', 'cost_rep'=>'int', 'cost_del'=>'int'], -'libxml_clear_errors' => ['void'], -'libxml_disable_entity_loader' => ['bool', 'disable='=>'bool'], -'libxml_get_errors' => ['array'], -'libxml_get_last_error' => ['libXMLError|false'], -'libxml_set_external_entity_loader' => ['bool', 'resolver_function'=>'callable'], -'libxml_set_streams_context' => ['void', 'streams_context'=>'resource'], -'libxml_use_internal_errors' => ['bool', 'use_errors='=>'bool'], -'LimitIterator::__construct' => ['void', 'iterator'=>'Iterator', 'offset='=>'int', 'count='=>'int'], -'LimitIterator::current' => ['mixed'], -'LimitIterator::getInnerIterator' => ['Iterator'], -'LimitIterator::getPosition' => ['int'], -'LimitIterator::key' => ['mixed'], -'LimitIterator::next' => ['void'], -'LimitIterator::rewind' => ['void'], -'LimitIterator::seek' => ['int', 'position'=>'int'], -'LimitIterator::valid' => ['bool'], -'lineObj::__construct' => ['void'], -'lineObj::add' => ['int', 'point'=>'pointObj'], -'lineObj::addXY' => ['int', 'x'=>'float', 'y'=>'float', 'm'=>'float'], -'lineObj::addXYZ' => ['int', 'x'=>'float', 'y'=>'float', 'z'=>'float', 'm'=>'float'], -'lineObj::ms_newLineObj' => ['lineObj'], -'lineObj::point' => ['pointObj', 'i'=>'int'], -'lineObj::project' => ['int', 'in'=>'projectionObj', 'out'=>'projectionObj'], -'link' => ['bool', 'target'=>'string', 'link'=>'string'], -'linkinfo' => ['int', 'filename'=>'string'], -'litespeed_request_headers' => ['array'], -'litespeed_response_headers' => ['array'], -'Locale::acceptFromHttp' => ['string|false', 'header'=>'string'], -'Locale::canonicalize' => ['string', 'locale'=>'string'], -'Locale::composeLocale' => ['string', 'subtags'=>'array'], -'Locale::filterMatches' => ['bool', 'langtag'=>'string', 'locale'=>'string', 'canonicalize='=>'bool'], -'Locale::getAllVariants' => ['array', 'locale'=>'string'], -'Locale::getDefault' => ['string'], -'Locale::getDisplayLanguage' => ['string', 'locale'=>'string', 'in_locale='=>'string'], -'Locale::getDisplayName' => ['string', 'locale'=>'string', 'in_locale='=>'string'], -'Locale::getDisplayRegion' => ['string', 'locale'=>'string', 'in_locale='=>'string'], -'Locale::getDisplayScript' => ['string', 'locale'=>'string', 'in_locale='=>'string'], -'Locale::getDisplayVariant' => ['string', 'locale'=>'string', 'in_locale='=>'string'], -'Locale::getKeywords' => ['array|false', 'locale'=>'string'], -'Locale::getPrimaryLanguage' => ['string', 'locale'=>'string'], -'Locale::getRegion' => ['string', 'locale'=>'string'], -'Locale::getScript' => ['string', 'locale'=>'string'], -'Locale::lookup' => ['string', 'langtag'=>'array', 'locale'=>'string', 'canonicalize='=>'bool', 'default='=>'string'], -'Locale::parseLocale' => ['array', 'locale'=>'string'], -'Locale::setDefault' => ['bool', 'locale'=>'string'], -'locale_accept_from_http' => ['string|false', 'header'=>'string'], -'locale_canonicalize' => ['', 'arg1'=>''], -'locale_compose' => ['string|false', 'subtags'=>'array'], -'locale_filter_matches' => ['bool', 'langtag'=>'string', 'locale'=>'string', 'canonicalize='=>'bool'], -'locale_get_all_variants' => ['array', 'locale'=>'string'], -'locale_get_default' => ['string'], -'locale_get_display_language' => ['string', 'locale'=>'string', 'in_locale='=>'string'], -'locale_get_display_name' => ['string', 'locale'=>'string', 'in_locale='=>'string'], -'locale_get_display_region' => ['string', 'locale'=>'string', 'in_locale='=>'string'], -'locale_get_display_script' => ['string', 'locale'=>'string', 'in_locale='=>'string'], -'locale_get_display_variant' => ['string', 'locale'=>'string', 'in_locale='=>'string'], -'locale_get_keywords' => ['array|false', 'locale'=>'string'], -'locale_get_primary_language' => ['string', 'locale'=>'string'], -'locale_get_region' => ['string', 'locale'=>'string'], -'locale_get_script' => ['string', 'locale'=>'string'], -'locale_lookup' => ['string', 'langtag'=>'array', 'locale'=>'string', 'canonicalize='=>'bool', 'default='=>'string'], -'locale_parse' => ['array', 'locale'=>'string'], -'locale_set_default' => ['bool', 'locale'=>'string'], -'localeconv' => ['array'], -'localtime' => ['array', 'timestamp='=>'int', 'associative_array='=>'bool'], -'log' => ['float', 'number'=>'float', 'base='=>'float'], -'log10' => ['float', 'number'=>'float'], -'log1p' => ['float', 'number'=>'float'], -'LogicException::__clone' => ['void'], -'LogicException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'(?Throwable)|(?LogicException)'], -'LogicException::__toString' => ['string'], -'LogicException::getCode' => ['int'], -'LogicException::getFile' => ['string'], -'LogicException::getLine' => ['int'], -'LogicException::getMessage' => ['string'], -'LogicException::getPrevious' => ['Throwable|LogicException|null'], -'LogicException::getTrace' => ['array'], -'LogicException::getTraceAsString' => ['string'], -'long2ip' => ['string', 'proper_address'=>'int'], -'lstat' => ['array|false', 'filename'=>'string'], -'ltrim' => ['string', 'str'=>'string', 'character_mask='=>'string'], -'Lua::__call' => ['mixed', 'lua_func'=>'callable', 'args='=>'array', 'use_self='=>'int'], -'Lua::__construct' => ['void', 'lua_script_file'=>'string'], -'Lua::assign' => ['mixed', 'name'=>'string', 'value'=>'string'], -'Lua::call' => ['mixed', 'lua_func'=>'callable', 'args='=>'array', 'use_self='=>'int'], -'Lua::eval' => ['mixed', 'statements'=>'string'], -'Lua::getVersion' => ['string'], -'Lua::include' => ['mixed', 'file'=>'string'], -'Lua::registerCallback' => ['mixed', 'name'=>'string', 'function'=>'callable'], -'LuaClosure::__invoke' => ['void', 'arg'=>'mixed', '...args='=>'mixed'], -'lzf_compress' => ['string', 'data'=>'string'], -'lzf_decompress' => ['string', 'data'=>'string'], -'lzf_optimized_for' => ['int'], -'m_checkstatus' => ['int', 'conn'=>'resource', 'identifier'=>'int'], -'m_completeauthorizations' => ['int', 'conn'=>'resource', 'array'=>'int'], -'m_connect' => ['int', 'conn'=>'resource'], -'m_connectionerror' => ['string', 'conn'=>'resource'], -'m_deletetrans' => ['bool', 'conn'=>'resource', 'identifier'=>'int'], -'m_destroyconn' => ['bool', 'conn'=>'resource'], -'m_destroyengine' => ['void'], -'m_getcell' => ['string', 'conn'=>'resource', 'identifier'=>'int', 'column'=>'string', 'row'=>'int'], -'m_getcellbynum' => ['string', 'conn'=>'resource', 'identifier'=>'int', 'column'=>'int', 'row'=>'int'], -'m_getcommadelimited' => ['string', 'conn'=>'resource', 'identifier'=>'int'], -'m_getheader' => ['string', 'conn'=>'resource', 'identifier'=>'int', 'column_num'=>'int'], -'m_initconn' => ['resource'], -'m_initengine' => ['int', 'location'=>'string'], -'m_iscommadelimited' => ['int', 'conn'=>'resource', 'identifier'=>'int'], -'m_maxconntimeout' => ['bool', 'conn'=>'resource', 'secs'=>'int'], -'m_monitor' => ['int', 'conn'=>'resource'], -'m_numcolumns' => ['int', 'conn'=>'resource', 'identifier'=>'int'], -'m_numrows' => ['int', 'conn'=>'resource', 'identifier'=>'int'], -'m_parsecommadelimited' => ['int', 'conn'=>'resource', 'identifier'=>'int'], -'m_responsekeys' => ['array', 'conn'=>'resource', 'identifier'=>'int'], -'m_responseparam' => ['string', 'conn'=>'resource', 'identifier'=>'int', 'key'=>'string'], -'m_returnstatus' => ['int', 'conn'=>'resource', 'identifier'=>'int'], -'m_setblocking' => ['int', 'conn'=>'resource', 'tf'=>'int'], -'m_setdropfile' => ['int', 'conn'=>'resource', 'directory'=>'string'], -'m_setip' => ['int', 'conn'=>'resource', 'host'=>'string', 'port'=>'int'], -'m_setssl' => ['int', 'conn'=>'resource', 'host'=>'string', 'port'=>'int'], -'m_setssl_cafile' => ['int', 'conn'=>'resource', 'cafile'=>'string'], -'m_setssl_files' => ['int', 'conn'=>'resource', 'sslkeyfile'=>'string', 'sslcertfile'=>'string'], -'m_settimeout' => ['int', 'conn'=>'resource', 'seconds'=>'int'], -'m_sslcert_gen_hash' => ['string', 'filename'=>'string'], -'m_transactionssent' => ['int', 'conn'=>'resource'], -'m_transinqueue' => ['int', 'conn'=>'resource'], -'m_transkeyval' => ['int', 'conn'=>'resource', 'identifier'=>'int', 'key'=>'string', 'value'=>'string'], -'m_transnew' => ['int', 'conn'=>'resource'], -'m_transsend' => ['int', 'conn'=>'resource', 'identifier'=>'int'], -'m_uwait' => ['int', 'microsecs'=>'int'], -'m_validateidentifier' => ['int', 'conn'=>'resource', 'tf'=>'int'], -'m_verifyconnection' => ['bool', 'conn'=>'resource', 'tf'=>'int'], -'m_verifysslcert' => ['bool', 'conn'=>'resource', 'tf'=>'int'], -'magic_quotes_runtime' => ['', 'new_setting'=>''], -'mail' => ['bool', 'to'=>'string', 'subject'=>'string', 'message'=>'string', 'additional_headers='=>'string', 'additional_parameters='=>'string'], -'mailparse_determine_best_xfer_encoding' => ['string', 'fp'=>'resource'], -'mailparse_msg_create' => ['resource'], -'mailparse_msg_extract_part' => ['void', 'mimemail'=>'resource', 'msgbody'=>'string', 'callbackfunc='=>'callable'], -'mailparse_msg_extract_part_file' => ['string', 'mimemail'=>'resource', 'filename'=>'mixed', 'callbackfunc='=>'callable'], -'mailparse_msg_extract_whole_part_file' => ['string', 'mimemail'=>'resource', 'filename'=>'string', 'callbackfunc='=>'callable'], -'mailparse_msg_free' => ['bool', 'mimemail'=>'resource'], -'mailparse_msg_get_part' => ['resource', 'mimemail'=>'resource', 'mimesection'=>'string'], -'mailparse_msg_get_part_data' => ['array', 'mimemail'=>'resource'], -'mailparse_msg_get_structure' => ['array', 'mimemail'=>'resource'], -'mailparse_msg_parse' => ['bool', 'mimemail'=>'resource', 'data'=>'string'], -'mailparse_msg_parse_file' => ['resource', 'filename'=>'string'], -'mailparse_rfc822_parse_addresses' => ['array', 'addresses'=>'string'], -'mailparse_stream_encode' => ['bool', 'sourcefp'=>'resource', 'destfp'=>'resource', 'encoding'=>'string'], -'mailparse_uudecode_all' => ['array', 'fp'=>'resource'], -'mapObj::__construct' => ['void', 'map_file_name'=>'string', 'new_map_path'=>'string'], -'mapObj::appendOutputFormat' => ['int', 'outputFormat'=>'outputformatObj'], -'mapObj::applyconfigoptions' => ['int'], -'mapObj::applySLD' => ['int', 'sldxml'=>'string'], -'mapObj::applySLDURL' => ['int', 'sldurl'=>'string'], -'mapObj::convertToString' => ['string'], -'mapObj::draw' => ['imageObj'], -'mapObj::drawLabelCache' => ['int', 'image'=>'imageObj'], -'mapObj::drawLegend' => ['imageObj'], -'mapObj::drawQuery' => ['imageObj'], -'mapObj::drawReferenceMap' => ['imageObj'], -'mapObj::drawScaleBar' => ['imageObj'], -'mapObj::embedLegend' => ['int', 'image'=>'imageObj'], -'mapObj::embedScalebar' => ['int', 'image'=>'imageObj'], -'mapObj::free' => ['void'], -'mapObj::generateSLD' => ['string'], -'mapObj::getAllGroupNames' => ['array'], -'mapObj::getAllLayerNames' => ['array'], -'mapObj::getColorbyIndex' => ['colorObj', 'iCloIndex'=>'int'], -'mapObj::getConfigOption' => ['string', 'key'=>'string'], -'mapObj::getLabel' => ['labelcacheMemberObj', 'index'=>'int'], -'mapObj::getLayer' => ['layerObj', 'index'=>'int'], -'mapObj::getLayerByName' => ['layerObj', 'layer_name'=>'string'], -'mapObj::getLayersDrawingOrder' => ['array'], -'mapObj::getLayersIndexByGroup' => ['array', 'groupname'=>'string'], -'mapObj::getMetaData' => ['int', 'name'=>'string'], -'mapObj::getNumSymbols' => ['int'], -'mapObj::getOutputFormat' => ['outputformatObj', 'index'=>'int'], -'mapObj::getProjection' => ['string'], -'mapObj::getSymbolByName' => ['int', 'symbol_name'=>'string'], -'mapObj::getSymbolObjectById' => ['symbolObj', 'symbolid'=>'int'], -'mapObj::loadMapContext' => ['int', 'filename'=>'string', 'unique_layer_name'=>'bool'], -'mapObj::loadOWSParameters' => ['int', 'request'=>'OwsrequestObj', 'version'=>'string'], -'mapObj::moveLayerDown' => ['int', 'layerindex'=>'int'], -'mapObj::moveLayerUp' => ['int', 'layerindex'=>'int'], -'mapObj::ms_newMapObjFromString' => ['MapObj', 'map_file_string'=>'string', 'new_map_path'=>'string'], -'mapObj::offsetExtent' => ['int', 'x'=>'float', 'y'=>'float'], -'mapObj::owsDispatch' => ['int', 'request'=>'OwsrequestObj'], -'mapObj::prepareImage' => ['imageObj'], -'mapObj::prepareQuery' => ['void'], -'mapObj::processLegendTemplate' => ['string', 'params'=>'array'], -'mapObj::processQueryTemplate' => ['string', 'params'=>'array', 'generateimages'=>'bool'], -'mapObj::processTemplate' => ['string', 'params'=>'array', 'generateimages'=>'bool'], -'mapObj::queryByFeatures' => ['int', 'slayer'=>'int'], -'mapObj::queryByIndex' => ['int', 'layerindex'=>'', 'tileindex'=>'', 'shapeindex'=>'', 'addtoquery'=>''], -'mapObj::queryByPoint' => ['int', 'point'=>'pointObj', 'mode'=>'int', 'buffer'=>'float'], -'mapObj::queryByRect' => ['int', 'rect'=>'rectObj'], -'mapObj::queryByShape' => ['int', 'shape'=>'shapeObj'], -'mapObj::removeLayer' => ['layerObj', 'nIndex'=>'int'], -'mapObj::removeMetaData' => ['int', 'name'=>'string'], -'mapObj::removeOutputFormat' => ['int', 'name'=>'string'], -'mapObj::save' => ['int', 'filename'=>'string'], -'mapObj::saveMapContext' => ['int', 'filename'=>'string'], -'mapObj::saveQuery' => ['int', 'filename'=>'string', 'results'=>'int'], -'mapObj::scaleExtent' => ['int', 'zoomfactor'=>'float', 'minscaledenom'=>'float', 'maxscaledenom'=>'float'], -'mapObj::selectOutputFormat' => ['int', 'type'=>'string'], -'mapObj::set' => ['int', 'property_name'=>'string', 'new_value'=>''], -'mapObj::setCenter' => ['int', 'center'=>'pointObj'], -'mapObj::setConfigOption' => ['int', 'key'=>'string', 'value'=>'string'], -'mapObj::setExtent' => ['void', 'minx'=>'float', 'miny'=>'float', 'maxx'=>'float', 'maxy'=>'float'], -'mapObj::setFontSet' => ['int', 'fileName'=>'string'], -'mapObj::setMetaData' => ['int', 'name'=>'string', 'value'=>'string'], -'mapObj::setProjection' => ['int', 'proj_params'=>'string', 'bSetUnitsAndExtents'=>'bool'], -'mapObj::setRotation' => ['int', 'rotation_angle'=>'float'], -'mapObj::setSize' => ['int', 'width'=>'int', 'height'=>'int'], -'mapObj::setSymbolSet' => ['int', 'fileName'=>'string'], -'mapObj::setWKTProjection' => ['int', 'proj_params'=>'string', 'bSetUnitsAndExtents'=>'bool'], -'mapObj::zoomPoint' => ['int', 'nZoomFactor'=>'int', 'oPixelPos'=>'pointObj', 'nImageWidth'=>'int', 'nImageHeight'=>'int', 'oGeorefExt'=>'rectObj'], -'mapObj::zoomRectangle' => ['int', 'oPixelExt'=>'rectObj', 'nImageWidth'=>'int', 'nImageHeight'=>'int', 'oGeorefExt'=>'rectObj'], -'mapObj::zoomScale' => ['int', 'nScaleDenom'=>'float', 'oPixelPos'=>'pointObj', 'nImageWidth'=>'int', 'nImageHeight'=>'int', 'oGeorefExt'=>'rectObj', 'oMaxGeorefExt'=>'rectObj'], -'max' => ['', '...arg1'=>'array'], -'max\'1' => ['', 'arg1'=>'', 'arg2'=>'', '...args='=>''], -'maxdb::__construct' => ['void', 'host='=>'string', 'username='=>'string', 'passwd='=>'string', 'dbname='=>'string', 'port='=>'int', 'socket='=>'string'], -'maxdb::affected_rows' => ['int', 'link'=>''], -'maxdb::auto_commit' => ['bool', 'link'=>'', 'mode'=>'bool'], -'maxdb::change_user' => ['bool', 'link'=>'', 'user'=>'string', 'password'=>'string', 'database'=>'string'], -'maxdb::character_set_name' => ['string', 'link'=>''], -'maxdb::close' => ['bool', 'link'=>''], -'maxdb::commit' => ['bool', 'link'=>''], -'maxdb::disable_reads_from_master' => ['', 'link'=>''], -'maxdb::errno' => ['int', 'link'=>''], -'maxdb::error' => ['string', 'link'=>''], -'maxdb::field_count' => ['int', 'link'=>''], -'maxdb::get_host_info' => ['string', 'link'=>''], -'maxdb::info' => ['string', 'link'=>''], -'maxdb::insert_id' => ['', 'link'=>''], -'maxdb::kill' => ['bool', 'link'=>'', 'processid'=>'int'], -'maxdb::more_results' => ['bool', 'link'=>''], -'maxdb::multi_query' => ['bool', 'link'=>'', 'query'=>'string'], -'maxdb::next_result' => ['bool', 'link'=>''], -'maxdb::num_rows' => ['int', 'result'=>''], -'maxdb::options' => ['bool', 'link'=>'', 'option'=>'int', 'value'=>''], -'maxdb::ping' => ['bool', 'link'=>''], -'maxdb::prepare' => ['maxdb_stmt', 'link'=>'', 'query'=>'string'], -'maxdb::protocol_version' => ['string', 'link'=>''], -'maxdb::query' => ['', 'link'=>'', 'query'=>'string', 'resultmode='=>'int'], -'maxdb::real_connect' => ['bool', 'link'=>'', 'hostname='=>'string', 'username='=>'string', 'passwd='=>'string', 'dbname='=>'string', 'port='=>'int', 'socket='=>'string'], -'maxdb::real_escape_string' => ['string', 'link'=>'', 'escapestr'=>'string'], -'maxdb::real_query' => ['bool', 'link'=>'', 'query'=>'string'], -'maxdb::rollback' => ['bool', 'link'=>''], -'maxdb::rpl_query_type' => ['int', 'link'=>''], -'maxdb::select_db' => ['bool', 'link'=>'', 'dbname'=>'string'], -'maxdb::send_query' => ['bool', 'link'=>'', 'query'=>'string'], -'maxdb::server_info' => ['string', 'link'=>''], -'maxdb::server_version' => ['int', 'link'=>''], -'maxdb::sqlstate' => ['string', 'link'=>''], -'maxdb::ssl_set' => ['bool', 'link'=>'', 'key'=>'string', 'cert'=>'string', 'ca'=>'string', 'capath'=>'string', 'cipher'=>'string'], -'maxdb::stat' => ['string', 'link'=>''], -'maxdb::stmt_init' => ['object', 'link'=>''], -'maxdb::store_result' => ['bool', 'link'=>''], -'maxdb::thread_id' => ['int', 'link'=>''], -'maxdb::use_result' => ['resource', 'link'=>''], -'maxdb::warning_count' => ['int', 'link'=>''], -'maxdb_affected_rows' => ['int', 'link'=>'resource'], -'maxdb_autocommit' => ['bool', 'link'=>'', 'mode'=>'bool'], -'maxdb_change_user' => ['bool', 'link'=>'', 'user'=>'string', 'password'=>'string', 'database'=>'string'], -'maxdb_character_set_name' => ['string', 'link'=>''], -'maxdb_close' => ['bool', 'link'=>''], -'maxdb_commit' => ['bool', 'link'=>''], -'maxdb_connect' => ['resource', 'host='=>'string', 'username='=>'string', 'passwd='=>'string', 'dbname='=>'string', 'port='=>'int', 'socket='=>'string'], -'maxdb_connect_errno' => ['int'], -'maxdb_connect_error' => ['string'], -'maxdb_data_seek' => ['bool', 'result'=>'', 'offset'=>'int'], -'maxdb_debug' => ['void', 'debug'=>'string'], -'maxdb_disable_reads_from_master' => ['', 'link'=>''], -'maxdb_disable_rpl_parse' => ['bool', 'link'=>'resource'], -'maxdb_dump_debug_info' => ['bool', 'link'=>'resource'], -'maxdb_embedded_connect' => ['resource', 'dbname='=>'string'], -'maxdb_enable_reads_from_master' => ['bool', 'link'=>'resource'], -'maxdb_enable_rpl_parse' => ['bool', 'link'=>'resource'], -'maxdb_errno' => ['int', 'link'=>'resource'], -'maxdb_error' => ['string', 'link'=>'resource'], -'maxdb_fetch_array' => ['', 'result'=>'', 'resulttype='=>'int'], -'maxdb_fetch_assoc' => ['array', 'result'=>''], -'maxdb_fetch_field' => ['', 'result'=>''], -'maxdb_fetch_field_direct' => ['', 'result'=>'', 'fieldnr'=>'int'], -'maxdb_fetch_fields' => ['', 'result'=>''], -'maxdb_fetch_lengths' => ['array', 'result'=>'resource'], -'maxdb_fetch_object' => ['object', 'result'=>'object'], -'maxdb_fetch_row' => ['', 'result'=>''], -'maxdb_field_count' => ['int', 'link'=>''], -'maxdb_field_seek' => ['bool', 'result'=>'', 'fieldnr'=>'int'], -'maxdb_field_tell' => ['int', 'result'=>'resource'], -'maxdb_free_result' => ['', 'result'=>''], -'maxdb_get_client_info' => ['string'], -'maxdb_get_client_version' => ['int'], -'maxdb_get_host_info' => ['string', 'link'=>'resource'], -'maxdb_get_proto_info' => ['string', 'link'=>'resource'], -'maxdb_get_server_info' => ['string', 'link'=>'resource'], -'maxdb_get_server_version' => ['int', 'link'=>'resource'], -'maxdb_info' => ['string', 'link'=>'resource'], -'maxdb_init' => ['resource'], -'maxdb_insert_id' => ['mixed', 'link'=>'resource'], -'maxdb_kill' => ['bool', 'link'=>'', 'processid'=>'int'], -'maxdb_master_query' => ['bool', 'link'=>'resource', 'query'=>'string'], -'maxdb_more_results' => ['bool', 'link'=>'resource'], -'maxdb_multi_query' => ['bool', 'link'=>'', 'query'=>'string'], -'maxdb_next_result' => ['bool', 'link'=>'resource'], -'maxdb_num_fields' => ['int', 'result'=>'resource'], -'maxdb_num_rows' => ['int', 'result'=>'resource'], -'maxdb_options' => ['bool', 'link'=>'', 'option'=>'int', 'value'=>''], -'maxdb_ping' => ['bool', 'link'=>''], -'maxdb_prepare' => ['maxdb_stmt', 'link'=>'', 'query'=>'string'], -'maxdb_query' => ['', 'link'=>'', 'query'=>'string', 'resultmode='=>'int'], -'maxdb_real_connect' => ['bool', 'link'=>'', 'hostname='=>'string', 'username='=>'string', 'passwd='=>'string', 'dbname='=>'string', 'port='=>'int', 'socket='=>'string'], -'maxdb_real_escape_string' => ['string', 'link'=>'', 'escapestr'=>'string'], -'maxdb_real_query' => ['bool', 'link'=>'', 'query'=>'string'], -'maxdb_report' => ['bool', 'flags'=>'int'], -'maxdb_result::current_field' => ['int', 'result'=>''], -'maxdb_result::data_seek' => ['bool', 'result'=>'', 'offset'=>'int'], -'maxdb_result::fetch_array' => ['', 'result'=>'', 'resulttype='=>'int'], -'maxdb_result::fetch_assoc' => ['array', 'result'=>''], -'maxdb_result::fetch_field' => ['', 'result'=>''], -'maxdb_result::fetch_field_direct' => ['', 'result'=>'', 'fieldnr'=>'int'], -'maxdb_result::fetch_fields' => ['', 'result'=>''], -'maxdb_result::fetch_object' => ['object', 'result'=>'object'], -'maxdb_result::fetch_row' => ['', 'result'=>''], -'maxdb_result::field_count' => ['int', 'result'=>''], -'maxdb_result::field_seek' => ['bool', 'result'=>'', 'fieldnr'=>'int'], -'maxdb_result::free' => ['', 'result'=>''], -'maxdb_result::lengths' => ['array', 'result'=>''], -'maxdb_rollback' => ['bool', 'link'=>''], -'maxdb_rpl_parse_enabled' => ['int', 'link'=>'resource'], -'maxdb_rpl_probe' => ['bool', 'link'=>'resource'], -'maxdb_rpl_query_type' => ['int', 'link'=>''], -'maxdb_select_db' => ['bool', 'link'=>'resource', 'dbname'=>'string'], -'maxdb_send_query' => ['bool', 'link'=>'', 'query'=>'string'], -'maxdb_server_end' => ['void'], -'maxdb_server_init' => ['bool', 'server='=>'array', 'groups='=>'array'], -'maxdb_sqlstate' => ['string', 'link'=>'resource'], -'maxdb_ssl_set' => ['bool', 'link'=>'', 'key'=>'string', 'cert'=>'string', 'ca'=>'string', 'capath'=>'string', 'cipher'=>'string'], -'maxdb_stat' => ['string', 'link'=>''], -'maxdb_stmt::affected_rows' => ['int', 'stmt'=>''], -'maxdb_stmt::bind_param' => ['bool', 'stmt'=>'', 'types'=>'string', '&...rw_var'=>''], -'maxdb_stmt::bind_param\'1' => ['bool', 'stmt'=>'', 'types'=>'string', '&rw_var'=>'array'], -'maxdb_stmt::bind_result' => ['bool', 'stmt'=>'', '&rw_var1'=>'', '&...rw_vars='=>''], -'maxdb_stmt::close' => ['bool', 'stmt'=>''], -'maxdb_stmt::close_long_data' => ['bool', 'stmt'=>'', 'param_nr'=>'int'], -'maxdb_stmt::data_seek' => ['bool', 'statement'=>'', 'offset'=>'int'], -'maxdb_stmt::errno' => ['int', 'stmt'=>''], -'maxdb_stmt::error' => ['string', 'stmt'=>''], -'maxdb_stmt::execute' => ['bool', 'stmt'=>''], -'maxdb_stmt::fetch' => ['bool', 'stmt'=>''], -'maxdb_stmt::free_result' => ['', 'stmt'=>''], -'maxdb_stmt::num_rows' => ['int', 'stmt'=>''], -'maxdb_stmt::param_count' => ['int', 'stmt'=>''], -'maxdb_stmt::prepare' => ['', 'stmt'=>'', 'query'=>'string'], -'maxdb_stmt::reset' => ['bool', 'stmt'=>''], -'maxdb_stmt::result_metadata' => ['resource', 'stmt'=>''], -'maxdb_stmt::send_long_data' => ['bool', 'stmt'=>'', 'param_nr'=>'int', 'data'=>'string'], -'maxdb_stmt::stmt_send_long_data' => ['bool', 'param_nr'=>'int', 'data'=>'string'], -'maxdb_stmt::store_result' => ['bool'], -'maxdb_stmt_affected_rows' => ['int', 'stmt'=>'resource'], -'maxdb_stmt_bind_param' => ['bool', 'stmt'=>'', 'types'=>'string', 'var1'=>'', '...args='=>'', 'var='=>'array'], -'maxdb_stmt_bind_result' => ['bool', 'stmt'=>'', '&rw_var1'=>'', '&...rw_vars='=>''], -'maxdb_stmt_close' => ['bool', 'stmt'=>''], -'maxdb_stmt_close_long_data' => ['bool', 'stmt'=>'', 'param_nr'=>'int'], -'maxdb_stmt_data_seek' => ['bool', 'statement'=>'', 'offset'=>'int'], -'maxdb_stmt_errno' => ['int', 'stmt'=>'resource'], -'maxdb_stmt_error' => ['string', 'stmt'=>'resource'], -'maxdb_stmt_execute' => ['bool', 'stmt'=>''], -'maxdb_stmt_fetch' => ['bool', 'stmt'=>''], -'maxdb_stmt_free_result' => ['', 'stmt'=>''], -'maxdb_stmt_init' => ['object', 'link'=>''], -'maxdb_stmt_num_rows' => ['int', 'stmt'=>'resource'], -'maxdb_stmt_param_count' => ['int', 'stmt'=>'resource'], -'maxdb_stmt_prepare' => ['', 'stmt'=>'', 'query'=>'string'], -'maxdb_stmt_reset' => ['bool', 'stmt'=>''], -'maxdb_stmt_result_metadata' => ['resource', 'stmt'=>''], -'maxdb_stmt_send_long_data' => ['bool', 'stmt'=>'', 'param_nr'=>'int', 'data'=>'string'], -'maxdb_stmt_sqlstate' => ['string', 'stmt'=>'resource'], -'maxdb_stmt_store_result' => ['bool', 'stmt'=>''], -'maxdb_store_result' => ['bool', 'link'=>''], -'maxdb_thread_id' => ['int', 'link'=>'resource'], -'maxdb_thread_safe' => ['bool'], -'maxdb_use_result' => ['resource', 'link'=>''], -'maxdb_warning_count' => ['int', 'link'=>'resource'], -'mb_check_encoding' => ['bool', 'var='=>'string', 'encoding='=>'string'], -'mb_chr' => ['string|false', 'cp'=>'int', 'encoding='=>'string'], -'mb_convert_case' => ['string', 'sourcestring'=>'string', 'mode'=>'int', 'encoding='=>'string'], -'mb_convert_encoding' => ['string', 'str'=>'string', 'to_encoding'=>'string', 'from_encoding='=>'mixed'], -'mb_convert_kana' => ['string', 'str'=>'string', 'option='=>'string', 'encoding='=>'string'], -'mb_convert_variables' => ['string|false', 'to_encoding'=>'string', 'from_encoding'=>'array|string', '&rw_vars'=>'string|array|object', '&...rw_vars='=>'string|array|object'], -'mb_decode_mimeheader' => ['string', 'string'=>'string'], -'mb_decode_numericentity' => ['string', 'string'=>'string', 'convmap'=>'array', 'encoding'=>'string'], -'mb_detect_encoding' => ['string|false', 'str'=>'string', 'encoding_list='=>'mixed', 'strict='=>'bool'], -'mb_detect_order' => ['bool|array', 'encoding_list='=>'mixed'], -'mb_encode_mimeheader' => ['string', 'str'=>'string', 'charset='=>'string', 'transfer_encoding='=>'string', 'linefeed='=>'string', 'indent='=>'int'], -'mb_encode_numericentity' => ['string', 'string'=>'string', 'convmap'=>'array', 'encoding'=>'string', 'is_hex='=>'bool'], -'mb_encoding_aliases' => ['array|false', 'encoding'=>'string'], -'mb_ereg' => ['int|false', 'pattern'=>'string', 'string'=>'string', '&w_registers='=>'array'], -'mb_ereg_match' => ['bool', 'pattern'=>'string', 'string'=>'string', 'option='=>'string'], -'mb_ereg_replace' => ['string|false', 'pattern'=>'string', 'replacement'=>'string', 'string'=>'string', 'option='=>'string'], -'mb_ereg_replace_callback' => ['string|false', 'pattern'=>'string', 'callback'=>'string', 'string'=>'string', 'option='=>'string'], -'mb_ereg_search' => ['bool', 'pattern='=>'string', 'option='=>'string'], -'mb_ereg_search_getpos' => ['int'], -'mb_ereg_search_getregs' => ['array|false'], -'mb_ereg_search_init' => ['bool', 'string'=>'string', 'pattern='=>'string', 'option='=>'string'], -'mb_ereg_search_pos' => ['array|false', 'pattern='=>'string', 'option='=>'string'], -'mb_ereg_search_regs' => ['array|false', 'pattern='=>'string', 'option='=>'string'], -'mb_ereg_search_setpos' => ['bool', 'position'=>'int'], -'mb_eregi' => ['int', 'pattern'=>'string', 'string'=>'string', '&w_registers='=>'array'], -'mb_eregi_replace' => ['string|false', 'pattern'=>'string', 'replacement'=>'string', 'string'=>'string', 'option='=>'string'], -'mb_get_info' => ['mixed', 'type='=>'string'], -'mb_http_input' => ['mixed', 'type='=>'string'], -'mb_http_output' => ['string|bool', 'encoding='=>'string'], -'mb_internal_encoding' => ['string|bool', 'encoding='=>'string'], -'mb_language' => ['string|bool', 'language='=>'string'], -'mb_list_encodings' => ['array'], -'mb_ord' => ['int|false', 'str'=>'string', 'enc='=>'string'], -'mb_output_handler' => ['string', 'contents'=>'string', 'status'=>'int'], -'mb_parse_str' => ['bool', 'encoded_string'=>'string', '&w_result='=>'array'], -'mb_preferred_mime_name' => ['string', 'encoding'=>'string'], -'mb_regex_encoding' => ['string|bool', 'encoding='=>'string'], -'mb_regex_set_options' => ['string', 'options='=>'string'], -'mb_scrub' => ['string', 'str'=>'string', 'enc='=>'string'], -'mb_send_mail' => ['bool', 'to'=>'string', 'subject'=>'string', 'message'=>'string', 'additional_headers='=>'string', 'additional_parameter='=>'string'], -'mb_split' => ['array', 'pattern'=>'string', 'string'=>'string', 'limit='=>'int'], -'mb_strcut' => ['string', 'str'=>'string', 'start'=>'int', 'length='=>'int', 'encoding='=>'string'], -'mb_strimwidth' => ['string', 'str'=>'string', 'start'=>'int', 'width'=>'int', 'trimmarker='=>'string', 'encoding='=>'string'], -'mb_stripos' => ['int|false', 'haystack'=>'string', 'needle'=>'string', 'offset='=>'int', 'encoding='=>'string'], -'mb_stristr' => ['string|false', 'haystack'=>'string', 'needle'=>'string', 'part='=>'bool', 'encoding='=>'string'], -'mb_strlen' => ['int|false', 'str'=>'string', 'encoding='=>'string'], -'mb_strpos' => ['int|false', 'haystack'=>'string', 'needle'=>'string', 'offset='=>'int', 'encoding='=>'string'], -'mb_strrchr' => ['string|false', 'haystack'=>'string', 'needle'=>'string', 'part='=>'bool', 'encoding='=>'string'], -'mb_strrichr' => ['string|false', 'haystack'=>'string', 'needle'=>'string', 'part='=>'bool', 'encoding='=>'string'], -'mb_strripos' => ['int|false', 'haystack'=>'string', 'needle'=>'string', 'offset='=>'int', 'encoding='=>'string'], -'mb_strrpos' => ['int|false', 'haystack'=>'string', 'needle'=>'string', 'offset='=>'int', 'encoding='=>'string'], -'mb_strstr' => ['string|false', 'haystack'=>'string', 'needle'=>'string', 'part='=>'bool', 'encoding='=>'string'], -'mb_strtolower' => ['string', 'str'=>'string', 'encoding='=>'string'], -'mb_strtoupper' => ['string', 'str'=>'string', 'encoding='=>'string'], -'mb_strwidth' => ['int', 'str'=>'string', 'encoding='=>'string'], -'mb_substitute_character' => ['mixed', 'substchar='=>'mixed'], -'mb_substr' => ['string', 'str'=>'string', 'start'=>'int', 'length='=>'?int', 'encoding='=>'string'], -'mb_substr_count' => ['int', 'haystack'=>'string', 'needle'=>'string', 'encoding='=>'string'], -'mcrypt_cbc' => ['string', 'cipher'=>'string', 'key'=>'string', 'data'=>'string', 'mode'=>'int', 'iv='=>'string'], -'mcrypt_cfb' => ['string', 'cipher'=>'string', 'key'=>'string', 'data'=>'string', 'mode'=>'int', 'iv='=>'string'], -'mcrypt_create_iv' => ['string', 'size'=>'int', 'source='=>'int'], -'mcrypt_decrypt' => ['string', 'cipher'=>'string', 'key'=>'string', 'data'=>'string', 'mode'=>'string', 'iv='=>'string'], -'mcrypt_ecb' => ['string', 'cipher'=>'string', 'key'=>'string', 'data'=>'string', 'mode'=>'int', 'iv='=>'string'], -'mcrypt_enc_get_algorithms_name' => ['string', 'td'=>'resource'], -'mcrypt_enc_get_block_size' => ['int', 'td'=>'resource'], -'mcrypt_enc_get_iv_size' => ['int', 'td'=>'resource'], -'mcrypt_enc_get_key_size' => ['int', 'td'=>'resource'], -'mcrypt_enc_get_modes_name' => ['string', 'td'=>'resource'], -'mcrypt_enc_get_supported_key_sizes' => ['array', 'td'=>'resource'], -'mcrypt_enc_is_block_algorithm' => ['bool', 'td'=>'resource'], -'mcrypt_enc_is_block_algorithm_mode' => ['bool', 'td'=>'resource'], -'mcrypt_enc_is_block_mode' => ['bool', 'td'=>'resource'], -'mcrypt_enc_self_test' => ['int', 'td'=>'resource'], -'mcrypt_encrypt' => ['string', 'cipher'=>'string', 'key'=>'string', 'data'=>'string', 'mode'=>'string', 'iv='=>'string'], -'mcrypt_generic' => ['string', 'td'=>'resource', 'data'=>'string'], -'mcrypt_generic_deinit' => ['bool', 'td'=>'resource'], -'mcrypt_generic_end' => ['bool', 'td'=>'resource'], -'mcrypt_generic_init' => ['int', 'td'=>'resource', 'key'=>'string', 'iv'=>'string'], -'mcrypt_get_block_size' => ['int', 'cipher'=>'string', 'module'=>'string'], -'mcrypt_get_cipher_name' => ['string', 'cipher'=>'string'], -'mcrypt_get_iv_size' => ['int', 'cipher'=>'string', 'module'=>'string'], -'mcrypt_get_key_size' => ['int', 'cipher'=>'string', 'module'=>'string'], -'mcrypt_list_algorithms' => ['array', 'lib_dir='=>'string'], -'mcrypt_list_modes' => ['array', 'lib_dir='=>'string'], -'mcrypt_module_close' => ['bool', 'td'=>'resource'], -'mcrypt_module_get_algo_block_size' => ['int', 'algorithm'=>'string', 'lib_dir='=>'string'], -'mcrypt_module_get_algo_key_size' => ['int', 'algorithm'=>'string', 'lib_dir='=>'string'], -'mcrypt_module_get_supported_key_sizes' => ['array', 'algorithm'=>'string', 'lib_dir='=>'string'], -'mcrypt_module_is_block_algorithm' => ['bool', 'algorithm'=>'string', 'lib_dir='=>'string'], -'mcrypt_module_is_block_algorithm_mode' => ['bool', 'mode'=>'string', 'lib_dir='=>'string'], -'mcrypt_module_is_block_mode' => ['bool', 'mode'=>'string', 'lib_dir='=>'string'], -'mcrypt_module_open' => ['resource', 'cipher'=>'string', 'cipher_directory'=>'string', 'mode'=>'string', 'mode_directory'=>'string'], -'mcrypt_module_self_test' => ['bool', 'algorithm'=>'string', 'lib_dir='=>'string'], -'mcrypt_ofb' => ['string', 'cipher'=>'string', 'key'=>'string', 'data'=>'string', 'mode'=>'int', 'iv='=>'string'], -'md5' => ['string', 'str'=>'string', 'raw_output='=>'bool'], -'md5_file' => ['string|false', 'filename'=>'string', 'raw_output='=>'bool'], -'mdecrypt_generic' => ['string', 'td'=>'resource', 'data'=>'string'], -'Memcache::add' => ['bool', 'key'=>'string', 'var'=>'mixed', 'flag='=>'int', 'expire='=>'int'], -'Memcache::addServer' => ['bool', 'host'=>'string', 'port='=>'int', 'persistent='=>'bool', 'weight='=>'int', 'timeout='=>'int', 'retry_interval='=>'int', 'status='=>'bool', 'failure_callback='=>'callable', 'timeoutms='=>'int'], -'Memcache::close' => ['bool'], -'Memcache::connect' => ['bool', 'host'=>'string', 'port='=>'int', 'timeout='=>'int'], -'Memcache::decrement' => ['int', 'key'=>'string', 'value='=>'int'], -'Memcache::delete' => ['bool', 'key'=>'string', 'timeout='=>'int'], -'Memcache::flush' => ['bool'], -'Memcache::get' => ['array', 'key'=>'string', 'flags='=>'array', 'keys='=>'array'], -'Memcache::getExtendedStats' => ['array', 'type='=>'string', 'slabid='=>'int', 'limit='=>'int'], -'Memcache::getServerStatus' => ['int', 'host'=>'string', 'port='=>'int'], -'Memcache::getStats' => ['array', 'type='=>'string', 'slabid='=>'int', 'limit='=>'int'], -'Memcache::getVersion' => ['string'], -'Memcache::increment' => ['int', 'key'=>'string', 'value='=>'int'], -'Memcache::pconnect' => ['bool', 'host'=>'string', 'port='=>'int', 'timeout='=>'int'], -'Memcache::replace' => ['bool', 'key'=>'string', 'var'=>'mixed', 'flag='=>'int', 'expire='=>'int'], -'Memcache::set' => ['bool', 'key'=>'string', 'var'=>'mixed', 'flag='=>'int', 'expire='=>'int'], -'Memcache::setCompressThreshold' => ['bool', 'threshold'=>'int', 'min_savings='=>'float'], -'Memcache::setServerParams' => ['bool', 'host'=>'string', 'port='=>'int', 'timeout='=>'int', 'retry_interval='=>'int', 'status='=>'bool', 'failure_callback='=>'callable'], -'memcache_debug' => ['bool', 'on_off'=>'bool'], -'Memcached::add' => ['bool', 'key'=>'string', 'value'=>'mixed', 'expiration='=>'int'], -'Memcached::addByKey' => ['bool', 'server_key'=>'string', 'key'=>'string', 'value'=>'mixed', 'expiration='=>'int'], -'Memcached::addServer' => ['bool', 'host'=>'string', 'port'=>'int', 'weight='=>'int'], -'Memcached::addServers' => ['bool', 'servers'=>'array'], -'Memcached::append' => ['bool', 'key'=>'string', 'value'=>'string'], -'Memcached::appendByKey' => ['bool', 'server_key'=>'string', 'key'=>'string', 'value'=>'string'], -'Memcached::cas' => ['bool', 'cas_token'=>'float', 'key'=>'string', 'value'=>'mixed', 'expiration='=>'int'], -'Memcached::casByKey' => ['bool', 'cas_token'=>'float', 'server_key'=>'string', 'key'=>'string', 'value'=>'mixed', 'expiration='=>'int'], -'Memcached::decrement' => ['int|false', 'key'=>'string', 'offset='=>'int', 'initial_value='=>'int', 'expiry='=>'int'], -'Memcached::decrementByKey' => ['int|false', 'server_key'=>'string', 'key'=>'string', 'offset='=>'int', 'initial_value='=>'int', 'expiry='=>'int'], -'Memcached::delete' => ['bool', 'key'=>'string', 'time='=>'int'], -'Memcached::deleteByKey' => ['bool', 'server_key'=>'string', 'key'=>'string', 'time='=>'int'], -'Memcached::deleteMulti' => ['bool', 'keys'=>'array', 'time='=>'int'], -'Memcached::deleteMultiByKey' => ['bool', 'server_key'=>'string', 'keys'=>'array', 'time='=>'int'], -'Memcached::fetch' => ['array'], -'Memcached::fetchAll' => ['array'], -'Memcached::flush' => ['bool', 'delay='=>'int'], -'Memcached::get' => ['mixed', 'key'=>'string', 'cache_cb='=>'?callable', 'flags='=>'int'], -'Memcached::getAllKeys' => ['array|false'], -'Memcached::getByKey' => ['mixed', 'server_key'=>'string', 'key'=>'string', 'value_cb='=>'?callable', 'flags='=>'int'], -'Memcached::getDelayed' => ['bool', 'keys'=>'array', 'with_cas='=>'bool', 'value_cb='=>'callable'], -'Memcached::getDelayedByKey' => ['bool', 'server_key'=>'string', 'keys'=>'array', 'with_cas='=>'bool', 'value_cb='=>'?callable'], -'Memcached::getMulti' => ['array|false', 'keys'=>'array', 'flags='=>'int'], -'Memcached::getMultiByKey' => ['array', 'server_key'=>'string', 'keys'=>'array', 'flags='=>'int'], -'Memcached::getOption' => ['mixed', 'option'=>'int'], -'Memcached::getResultCode' => ['int'], -'Memcached::getResultMessage' => ['string'], -'Memcached::getServerByKey' => ['array', 'server_key'=>'string'], -'Memcached::getServerList' => ['array'], -'Memcached::getStats' => ['array', 'type='=>'?string'], -'Memcached::getVersion' => ['array'], -'Memcached::increment' => ['int|false', 'key'=>'string', 'offset='=>'int', 'initial_value='=>'int', 'expiry='=>'int'], -'Memcached::incrementByKey' => ['int|false', 'server_key'=>'string', 'key'=>'string', 'offset='=>'int', 'initial_value='=>'int', 'expiry='=>'int'], -'Memcached::isPersistent' => ['bool'], -'Memcached::isPristine' => ['bool'], -'Memcached::prepend' => ['bool', 'key'=>'string', 'value'=>'string'], -'Memcached::prependByKey' => ['bool', 'server_key'=>'string', 'key'=>'string', 'value'=>'string'], -'Memcached::quit' => ['bool'], -'Memcached::replace' => ['bool', 'key'=>'string', 'value'=>'mixed', 'expiration='=>'int'], -'Memcached::replaceByKey' => ['bool', 'server_key'=>'string', 'key'=>'string', 'value'=>'mixed', 'expiration='=>'int'], -'Memcached::resetServerList' => ['bool'], -'Memcached::set' => ['bool', 'key'=>'string', 'value'=>'mixed', 'expiration='=>'int'], -'Memcached::setByKey' => ['bool', 'server_key'=>'string', 'key'=>'string', 'value'=>'mixed', 'expiration='=>'int'], -'Memcached::setMulti' => ['bool', 'items'=>'array', 'expiration='=>'int'], -'Memcached::setMultiByKey' => ['bool', 'server_key'=>'string', 'items'=>'array', 'expiration='=>'int'], -'Memcached::setOption' => ['bool', 'option'=>'int', 'value'=>'mixed'], -'Memcached::setOptions' => ['bool', 'options'=>'array'], -'Memcached::setSaslAuthData' => ['void', 'username'=>'string', 'password'=>'string'], -'Memcached::touch' => ['bool', 'key'=>'string', 'expiration'=>'int'], -'Memcached::touchByKey' => ['bool', 'server_key'=>'string', 'key'=>'string', 'expiration'=>'int'], -'memory_get_peak_usage' => ['int', 'real_usage='=>'bool'], -'memory_get_usage' => ['int', 'real_usage='=>'bool'], -'MessageFormatter::__construct' => ['void', 'locale'=>'string', 'pattern'=>'string'], -'MessageFormatter::create' => ['MessageFormatter', 'locale'=>'string', 'pattern'=>'string'], -'MessageFormatter::format' => ['false|string', 'args'=>'array'], -'MessageFormatter::formatMessage' => ['false|string', 'locale'=>'string', 'pattern'=>'string', 'args'=>'array'], -'MessageFormatter::getErrorCode' => ['int'], -'MessageFormatter::getErrorMessage' => ['string'], -'MessageFormatter::getLocale' => ['string'], -'MessageFormatter::getPattern' => ['string'], -'MessageFormatter::parse' => ['array', 'value'=>'string'], -'MessageFormatter::parseMessage' => ['array', 'locale'=>'string', 'pattern'=>'string', 'source'=>'string'], -'MessageFormatter::setPattern' => ['bool', 'pattern'=>'string'], -'metaphone' => ['string', 'text'=>'string', 'phones='=>'int'], -'method_exists' => ['bool', 'object'=>'object|string', 'method'=>'string'], -'mhash' => ['string', 'hash'=>'int', 'data'=>'string', 'key='=>'string'], -'mhash_count' => ['int'], -'mhash_get_block_size' => ['int', 'hash'=>'int'], -'mhash_get_hash_name' => ['string', 'hash'=>'int'], -'mhash_keygen_s2k' => ['string', 'hash'=>'int', 'input_password'=>'string', 'salt'=>'string', 'bytes'=>'int'], -'microtime' => ['mixed', 'get_as_float='=>'bool'], -'mime_content_type' => ['string|false', 'filename_or_stream'=>'string'], -'min' => ['', '...arg1'=>'array'], -'min\'1' => ['', 'arg1'=>'', 'arg2'=>'', '...args='=>''], -'ming_keypress' => ['int', 'char'=>'string'], -'ming_setcubicthreshold' => ['void', 'threshold'=>'int'], -'ming_setscale' => ['void', 'scale'=>'float'], -'ming_setswfcompression' => ['void', 'level'=>'int'], -'ming_useconstants' => ['void', 'use'=>'int'], -'ming_useswfversion' => ['void', 'version'=>'int'], -'mkdir' => ['bool', 'pathname'=>'string', 'mode='=>'int', 'recursive='=>'bool', 'context='=>'resource'], -'mktime' => ['int', 'hour='=>'int', 'min='=>'int', 'sec='=>'int', 'mon='=>'int', 'day='=>'int', 'year='=>'int'], -'money_format' => ['string', 'format'=>'string', 'value'=>'float'], -'Mongo::__get' => ['MongoDB', 'dbname'=>'string'], -'Mongo::__toString' => ['string'], -'Mongo::close' => ['bool'], -'Mongo::connect' => ['bool'], -'Mongo::connectUtil' => ['bool'], -'Mongo::dropDB' => ['array', 'db'=>''], -'Mongo::forceError' => ['bool'], -'Mongo::getConnections' => ['array'], -'Mongo::getHosts' => ['array'], -'Mongo::getPoolSize' => ['int'], -'Mongo::getReadPreference' => ['array'], -'Mongo::getSlave' => ['string'], -'Mongo::getSlaveOkay' => ['bool'], -'Mongo::getWriteConcern' => ['array'], -'Mongo::killCursor' => ['', 'server_hash'=>'string', 'id'=>'MongoInt64|int'], -'Mongo::lastError' => ['array|null'], -'Mongo::listDBs' => ['array'], -'Mongo::pairConnect' => ['bool'], -'Mongo::pairPersistConnect' => ['bool', 'username='=>'string', 'password='=>'string'], -'Mongo::persistConnect' => ['bool', 'username='=>'string', 'password='=>'string'], -'Mongo::poolDebug' => ['array'], -'Mongo::prevError' => ['array'], -'Mongo::resetError' => ['array'], -'Mongo::selectCollection' => ['MongoCollection', 'db'=>'string', 'collection'=>'string'], -'Mongo::selectDB' => ['MongoDB', 'name'=>'string'], -'Mongo::setPoolSize' => ['bool', 'size'=>'int'], -'Mongo::setReadPreference' => ['bool', 'readPreference'=>'string', 'tags='=>'array'], -'Mongo::setSlaveOkay' => ['bool', 'ok='=>'bool'], -'Mongo::switchSlave' => ['string'], -'MongoBinData::__construct' => ['void', 'data'=>'string', 'type='=>'int'], -'MongoBinData::__toString' => ['string'], -'MongoClient::__construct' => ['void', 'server='=>'string', 'options='=>'array', 'driver_options'=>'array'], -'MongoClient::__get' => ['MongoDB', 'dbname'=>'string'], -'MongoClient::__toString' => ['string'], -'MongoClient::close' => ['bool', 'connection='=>'bool|string'], -'MongoClient::connect' => ['bool'], -'MongoClient::dropDB' => ['array', 'db'=>'mixed'], -'MongoClient::getConnections' => ['array'], -'MongoClient::getHosts' => ['array'], -'MongoClient::getReadPreference' => ['array'], -'MongoClient::getWriteConcern' => ['array'], -'MongoClient::killCursor' => ['bool', 'server_hash'=>'string', 'id'=>'int|MongoInt64'], -'MongoClient::listDBs' => ['array'], -'MongoClient::selectCollection' => ['MongoCollection', 'db'=>'string', 'collection'=>'string'], -'MongoClient::selectDB' => ['MongoDB', 'name'=>'string'], -'MongoClient::setReadPreference' => ['bool', 'read_preference'=>'string', 'tags='=>'array'], -'MongoClient::setWriteConcern' => ['bool', 'w'=>'mixed', 'wtimeout='=>'int'], -'MongoClient::switchSlave' => ['string'], -'MongoCode::__construct' => ['void', 'code'=>'string', 'scope='=>'array'], -'MongoCode::__toString' => ['string'], -'MongoCollection::__construct' => ['void', 'db'=>'MongoDB', 'name'=>'string'], -'MongoCollection::__get' => ['MongoCollection', 'name'=>'string'], -'MongoCollection::__toString' => ['string'], -'MongoCollection::aggregate' => ['array', 'op'=>'array', 'op='=>'array', '...args='=>'array'], -'MongoCollection::aggregate\'1' => ['array', 'pipeline'=>'array', 'options='=>'array'], -'MongoCollection::aggregateCursor' => ['MongoCommandCursor', 'command'=>'array', 'options='=>'array'], -'MongoCollection::batchInsert' => ['mixed', 'a'=>'array', 'options='=>'array'], -'MongoCollection::count' => ['int', 'query='=>'array', 'limit='=>'int', 'skip='=>'int'], -'MongoCollection::createDBRef' => ['array', 'a'=>'array'], -'MongoCollection::createIndex' => ['bool', 'keys'=>'array', 'options='=>'array'], -'MongoCollection::deleteIndex' => ['array', 'keys'=>'string|array'], -'MongoCollection::deleteIndexes' => ['array'], -'MongoCollection::distinct' => ['array', 'key'=>'string', 'query='=>'array'], -'MongoCollection::drop' => ['array'], -'MongoCollection::ensureIndex' => ['bool', 'keys'=>'array', 'options='=>'array'], -'MongoCollection::find' => ['MongoCursor', 'query='=>'array', 'fields='=>'array'], -'MongoCollection::findAndModify' => ['array', 'query'=>'array', 'update='=>'array', 'fields='=>'array', 'options='=>'array'], -'MongoCollection::findOne' => ['array', 'query='=>'array', 'fields='=>'array'], -'MongoCollection::getDBRef' => ['array', 'ref'=>'array'], -'MongoCollection::getIndexInfo' => ['array'], -'MongoCollection::getName' => ['string'], -'MongoCollection::getReadPreference' => ['array'], -'MongoCollection::getSlaveOkay' => ['bool'], -'MongoCollection::getWriteConcern' => ['array'], -'MongoCollection::group' => ['array', 'keys'=>'mixed', 'initial'=>'array', 'reduce'=>'mongocode', 'options='=>'array'], -'MongoCollection::insert' => ['bool|array', 'a'=>'array', 'options='=>'array'], -'MongoCollection::parallelCollectionScan' => ['MongoCommandCursor[]', 'num_cursors'=>'int'], -'MongoCollection::remove' => ['bool|array', 'criteria='=>'array', 'options='=>'array'], -'MongoCollection::save' => ['mixed', 'a'=>'array', 'options='=>'array'], -'MongoCollection::setReadPreference' => ['bool', 'read_preference'=>'string', 'tags='=>'array'], -'MongoCollection::setSlaveOkay' => ['bool', 'ok='=>'bool'], -'MongoCollection::setWriteConcern' => ['bool', 'w'=>'mixed', 'wtimeout='=>'int'], -'MongoCollection::toIndexString' => ['string', 'keys'=>'mixed'], -'MongoCollection::update' => ['bool', 'criteria'=>'array', 'newobj'=>'array', 'options='=>'array'], -'MongoCollection::validate' => ['array', 'scan_data='=>'bool'], -'MongoCommandCursor::__construct' => ['void', 'connection'=>'MongoClient', 'ns'=>'string', 'command'=>'array'], -'MongoCommandCursor::batchSize' => ['MongoCommandCursor', 'batchSize'=>'int'], -'MongoCommandCursor::createFromDocument' => ['MongoCommandCursor', 'connection'=>'MongoClient', 'hash'=>'string', 'document'=>'array'], -'MongoCommandCursor::current' => ['array'], -'MongoCommandCursor::dead' => ['bool'], -'MongoCommandCursor::getReadPreference' => ['array'], -'MongoCommandCursor::info' => ['array'], -'MongoCommandCursor::key' => ['int'], -'MongoCommandCursor::next' => ['void'], -'MongoCommandCursor::rewind' => ['array'], -'MongoCommandCursor::setReadPreference' => ['MongoCommandCursor', 'read_preference'=>'string', 'tags='=>'array'], -'MongoCommandCursor::timeout' => ['MongoCommandCursor', 'ms'=>'int'], -'MongoCommandCursor::valid' => ['bool'], -'MongoCursor::__construct' => ['void', 'connection'=>'MongoClient', 'ns'=>'string', 'query='=>'array', 'fields='=>'array'], -'MongoCursor::addOption' => ['MongoCursor', 'key'=>'string', 'value'=>'mixed'], -'MongoCursor::awaitData' => ['MongoCursor', 'wait='=>'bool'], -'MongoCursor::batchSize' => ['MongoCursor', 'num'=>'int'], -'MongoCursor::count' => ['int', 'foundonly='=>'bool'], -'MongoCursor::current' => ['array'], -'MongoCursor::dead' => ['bool'], -'MongoCursor::doQuery' => ['void'], -'MongoCursor::explain' => ['array'], -'MongoCursor::fields' => ['MongoCursor', 'f'=>'array'], -'MongoCursor::getNext' => ['array'], -'MongoCursor::getReadPreference' => ['array'], -'MongoCursor::hasNext' => ['bool'], -'MongoCursor::hint' => ['MongoCursor', 'key_pattern'=>'array'], -'MongoCursor::immortal' => ['MongoCursor', 'liveforever='=>'bool'], -'MongoCursor::info' => ['array'], -'MongoCursor::key' => ['string'], -'MongoCursor::limit' => ['MongoCursor', 'num'=>'int'], -'MongoCursor::maxTimeMS' => ['MongoCursor', 'ms'=>'int'], -'MongoCursor::next' => ['array'], -'MongoCursor::partial' => ['MongoCursor', 'okay='=>'bool'], -'MongoCursor::reset' => ['void'], -'MongoCursor::rewind' => ['void'], -'MongoCursor::setFlag' => ['MongoCursor', 'flag'=>'int', 'set='=>'bool'], -'MongoCursor::setReadPreference' => ['MongoCursor', 'read_preference'=>'string', 'tags='=>'array'], -'MongoCursor::skip' => ['MongoCursor', 'num'=>'int'], -'MongoCursor::slaveOkay' => ['MongoCursor', 'okay='=>'bool'], -'MongoCursor::snapshot' => ['MongoCursor'], -'MongoCursor::sort' => ['MongoCursor', 'fields'=>'array'], -'MongoCursor::tailable' => ['MongoCursor', 'tail='=>'bool'], -'MongoCursor::timeout' => ['MongoCursor', 'ms'=>'int'], -'MongoCursor::valid' => ['bool'], -'MongoCursorException::__clone' => ['void'], -'MongoCursorException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'(?Exception)|(?Throwable)'], -'MongoCursorException::__toString' => ['string'], -'MongoCursorException::__wakeup' => ['void'], -'MongoCursorException::getCode' => ['int'], -'MongoCursorException::getFile' => ['string'], -'MongoCursorException::getHost' => ['string'], -'MongoCursorException::getLine' => ['int'], -'MongoCursorException::getMessage' => ['string'], -'MongoCursorException::getPrevious' => ['Exception|Throwable'], -'MongoCursorException::getTrace' => ['array'], -'MongoCursorException::getTraceAsString' => ['string'], -'MongoCursorInterface::__construct' => ['void'], -'MongoCursorInterface::batchSize' => ['MongoCursorInterface', 'batchSize'=>'int'], -'MongoCursorInterface::current' => ['mixed'], -'MongoCursorInterface::dead' => ['bool'], -'MongoCursorInterface::getReadPreference' => ['array'], -'MongoCursorInterface::info' => ['array'], -'MongoCursorInterface::key' => ['int|string'], -'MongoCursorInterface::next' => ['void'], -'MongoCursorInterface::rewind' => ['void'], -'MongoCursorInterface::setReadPreference' => ['MongoCursorInterface', 'read_preference'=>'string', 'tags='=>'array'], -'MongoCursorInterface::timeout' => ['MongoCursorInterface', 'ms'=>'int'], -'MongoCursorInterface::valid' => ['bool'], -'MongoDate::__construct' => ['void', 'sec='=>'int', 'usec='=>'int'], -'MongoDate::__toString' => ['string'], -'MongoDate::toDateTime' => ['DateTime'], -'MongoDB::__construct' => ['void', 'conn'=>'MongoClient', 'name'=>'string'], -'MongoDB::__get' => ['MongoCollection', 'name'=>'string'], -'MongoDB::__toString' => ['string'], -'MongoDB::authenticate' => ['array', 'username'=>'string', 'password'=>'string'], -'MongoDB::command' => ['array', 'command'=>'array'], -'MongoDB::createCollection' => ['MongoCollection', 'name'=>'string', 'capped='=>'bool', 'size='=>'int', 'max='=>'int'], -'MongoDB::createDBRef' => ['array', 'collection'=>'string', 'a'=>''], -'MongoDB::drop' => ['array'], -'MongoDB::dropCollection' => ['array', 'coll'=>''], -'MongoDB::execute' => ['array', 'code'=>'', 'args='=>'array'], -'MongoDB::forceError' => ['bool'], -'MongoDB::getCollectionInfo' => ['array', 'options='=>'array'], -'MongoDB::getCollectionNames' => ['array', 'options='=>'array'], -'MongoDB::getDBRef' => ['array', 'ref'=>'array'], -'MongoDB::getGridFS' => ['MongoGridFS', 'prefix='=>'string'], -'MongoDB::getProfilingLevel' => ['int'], -'MongoDB::getReadPreference' => ['array'], -'MongoDB::getSlaveOkay' => ['bool'], -'MongoDB::getWriteConcern' => ['array'], -'MongoDB::lastError' => ['array'], -'MongoDB::listCollections' => ['array'], -'MongoDB::prevError' => ['array'], -'MongoDB::repair' => ['array', 'preserve_cloned_files='=>'bool', 'backup_original_files='=>'bool'], -'MongoDB::resetError' => ['array'], -'MongoDB::selectCollection' => ['MongoCollection', 'name'=>'string'], -'MongoDB::setProfilingLevel' => ['int', 'level'=>'int'], -'MongoDB::setReadPreference' => ['bool', 'read_preference'=>'string', 'tags='=>'array'], -'MongoDB::setSlaveOkay' => ['bool', 'ok='=>'bool'], -'MongoDB::setWriteConcern' => ['bool', 'w'=>'mixed', 'wtimeout='=>'int'], -'MongoDB\BSON\Binary::__construct' => ['void', 'data'=>'string', 'type'=>'int'], -'MongoDB\BSON\Binary::getData' => ['string'], -'MongoDB\BSON\Binary::getType' => ['int'], -'MongoDB\BSON\Decimal128::__construct' => ['void', 'value='=>'string'], -'MongoDB\BSON\Decimal128::__toString' => ['string'], -'MongoDB\BSON\fromJSON' => ['string', 'json'=>'string'], -'MongoDB\BSON\fromPHP' => ['string', 'value'=>'array|object'], -'MongoDB\BSON\Javascript::__construct' => ['void', 'code'=>'string', 'scope='=>'array|object'], -'MongoDB\BSON\ObjectId::__construct' => ['void', 'id='=>'string'], -'MongoDB\BSON\ObjectId::__toString' => ['string'], -'MongoDB\BSON\Regex::__construct' => ['void', 'pattern'=>'string', 'flags='=>'string'], -'MongoDB\BSON\Regex::__toString' => ['string'], -'MongoDB\BSON\Regex::getFlags' => [''], -'MongoDB\BSON\Regex::getPattern' => ['string'], -'MongoDB\BSON\Serializable::bsonSerialize' => ['array|object'], -'MongoDB\BSON\Timestamp::__construct' => ['void', 'increment'=>'int', 'timestamp'=>'int'], -'MongoDB\BSON\Timestamp::__toString' => ['string'], -'MongoDB\BSON\toJSON' => ['string', 'bson'=>'string'], -'MongoDB\BSON\toPHP' => ['object', 'bson'=>'string', 'typeMap'=>'array'], -'MongoDB\BSON\Unserializable::bsonUnserialize' => ['', 'data'=>'array'], -'MongoDB\BSON\UTCDateTime::__construct' => ['void', 'milliseconds='=>'int|DateTimeInterface'], -'MongoDB\BSON\UTCDateTime::__toString' => ['string'], -'MongoDB\BSON\UTCDateTime::toDateTime' => ['DateTime'], -'MongoDB\Driver\BulkWrite::__construct' => ['void', 'ordered='=>'bool'], -'MongoDB\Driver\BulkWrite::count' => ['int'], -'MongoDB\Driver\BulkWrite::delete' => ['void', 'filter'=>'array|object', 'deleteOptions='=>'array'], -'MongoDB\Driver\BulkWrite::insert' => ['MongoDB\Driver\ObjectID', 'document'=>'array|object'], -'MongoDB\Driver\BulkWrite::update' => ['void', 'filter'=>'array|object', 'newObj'=>'array|object', 'updateOptions='=>'array'], -'MongoDB\Driver\Command::__construct' => ['void', 'document'=>'array|object'], -'MongoDB\Driver\Cursor::__construct' => ['void', 'server'=>'Server', 'responseDocument'=>'string'], -'MongoDB\Driver\Cursor::getId' => ['MongoDB\Driver\CursorId'], -'MongoDB\Driver\Cursor::getServer' => ['MongoDB\Driver\Server'], -'MongoDB\Driver\Cursor::isDead' => ['bool'], -'MongoDB\Driver\Cursor::setTypeMap' => ['void', 'typemap'=>'array'], -'MongoDB\Driver\Cursor::toArray' => ['array'], -'MongoDB\Driver\CursorId::__construct' => ['void', 'id'=>'string'], -'MongoDB\Driver\CursorId::__toString' => ['string'], -'MongoDB\Driver\Exception\RuntimeException::__clone' => ['void'], -'MongoDB\Driver\Exception\RuntimeException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'(?RuntimeException)|(?Throwable)'], -'MongoDB\Driver\Exception\RuntimeException::__toString' => ['string'], -'MongoDB\Driver\Exception\RuntimeException::__wakeup' => ['void'], -'MongoDB\Driver\Exception\RuntimeException::getCode' => ['int'], -'MongoDB\Driver\Exception\RuntimeException::getFile' => ['string'], -'MongoDB\Driver\Exception\RuntimeException::getLine' => ['int'], -'MongoDB\Driver\Exception\RuntimeException::getMessage' => ['string'], -'MongoDB\Driver\Exception\RuntimeException::getPrevious' => ['RuntimeException|Throwable'], -'MongoDB\Driver\Exception\RuntimeException::getTrace' => ['array'], -'MongoDB\Driver\Exception\RuntimeException::getTraceAsString' => ['string'], -'MongoDB\Driver\Exception\WriteException::__clone' => ['void'], -'MongoDB\Driver\Exception\WriteException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'(?RuntimeException)|(?Throwable)'], -'MongoDB\Driver\Exception\WriteException::__toString' => ['string'], -'MongoDB\Driver\Exception\WriteException::__wakeup' => ['void'], -'MongoDB\Driver\Exception\WriteException::getCode' => ['int'], -'MongoDB\Driver\Exception\WriteException::getFile' => ['string'], -'MongoDB\Driver\Exception\WriteException::getLine' => ['int'], -'MongoDB\Driver\Exception\WriteException::getMessage' => ['string'], -'MongoDB\Driver\Exception\WriteException::getPrevious' => ['RuntimeException|Throwable'], -'MongoDB\Driver\Exception\WriteException::getTrace' => ['array'], -'MongoDB\Driver\Exception\WriteException::getTraceAsString' => ['string'], -'MongoDB\Driver\Exception\WriteException::getWriteResult' => ['MongoDB\Driver\WriteResult'], -'MongoDB\Driver\Manager::__construct' => ['void', 'uri'=>'string', 'options='=>'array', 'driverOptions='=>'array'], -'MongoDB\Driver\Manager::executeBulkWrite' => ['MongoDB\Driver\WriteResult', 'namespace'=>'string', 'bulk'=>'MongoDB\Driver\BulkWrite', 'writeConcern='=>'MongoDB\Driver\WriteConcern'], -'MongoDB\Driver\Manager::executeCommand' => ['MongoDB\Driver\Cursor', 'db'=>'string', 'command'=>'MongoDB\Driver\Command', 'readPreference='=>'MongoDB\Driver\ReadPreference'], -'MongoDB\Driver\Manager::executeDelete' => ['MongoDB\Driver\WriteResult', 'namespace'=>'string', 'filter'=>'array|object', 'deleteOptions='=>'array', 'writeConcern='=>'MongoDB\Driver\WriteConcern'], -'MongoDB\Driver\Manager::executeInsert' => ['MongoDB\Driver\WriteResult', 'namespace'=>'string', 'document'=>'array|object', 'writeConcern='=>'MongoDB\Driver\WriteConcern'], -'MongoDB\Driver\Manager::executeQuery' => ['MongoDB\Driver\Cursor', 'namespace'=>'string', 'query'=>'MongoDB\Driver\Query', 'readPreference='=>'MongoDB\Driver\ReadPreference'], -'MongoDB\Driver\Manager::executeUpdate' => ['MongoDB\Driver\WriteResult', 'namespace'=>'string', 'filter'=>'array|object', 'newObj'=>'array|object', 'updateOptions='=>'array', 'writeConcern='=>'MongoDB\Driver\WriteConcern'], -'MongoDB\Driver\Manager::getReadConcern' => ['MongoDB\Driver\ReadConcern'], -'MongoDB\Driver\Manager::getReadPreference' => ['MongoDB\Driver\ReadPreference'], -'MongoDB\Driver\Manager::getServers' => ['array'], -'MongoDB\Driver\Manager::getWriteConcern' => ['MongoDB\Driver\WriteConcern'], -'MongoDB\Driver\Manager::selectServer' => ['MongoDB\Driver\Server', 'readPreference'=>'MongoDB\Driver\ReadPreference'], -'MongoDB\Driver\Query::__construct' => ['void', 'filter'=>'array|object', 'queryOptions='=>'array'], -'MongoDB\Driver\ReadConcern::__construct' => ['void', 'level='=>'string'], -'MongoDB\Driver\ReadConcern::bsonSerialize' => ['object'], -'MongoDB\Driver\ReadConcern::getLevel' => ['null|string'], -'MongoDB\Driver\ReadPreference::__construct' => ['void', 'readPreference'=>'string', 'tagSets='=>'array', 'options='=>'array'], -'MongoDB\Driver\ReadPreference::bsonSerialize' => ['object'], -'MongoDB\Driver\ReadPreference::getMode' => ['int'], -'MongoDB\Driver\ReadPreference::getTagSets' => ['array'], -'MongoDB\Driver\Server::__construct' => ['void', 'host'=>'string', 'port'=>'string', 'options='=>'array', 'driverOptions='=>'array'], -'MongoDB\Driver\Server::executeBulkWrite' => ['', 'namespace'=>'string', 'zwrite'=>'BulkWrite'], -'MongoDB\Driver\Server::executeCommand' => ['', 'db'=>'string', 'command'=>'Command'], -'MongoDB\Driver\Server::executeQuery' => ['', 'namespace'=>'string', 'zquery'=>'Query'], -'MongoDB\Driver\Server::getHost' => [''], -'MongoDB\Driver\Server::getInfo' => [''], -'MongoDB\Driver\Server::getLatency' => [''], -'MongoDB\Driver\Server::getPort' => [''], -'MongoDB\Driver\Server::getState' => [''], -'MongoDB\Driver\Server::getTags' => ['array'], -'MongoDB\Driver\Server::getType' => [''], -'MongoDB\Driver\Server::isArbiter' => ['bool'], -'MongoDB\Driver\Server::isDelayed' => [''], -'MongoDB\Driver\Server::isHidden' => ['bool'], -'MongoDB\Driver\Server::isPassive' => [''], -'MongoDB\Driver\Server::isPrimary' => ['bool'], -'MongoDB\Driver\Server::isSecondary' => ['bool'], -'MongoDB\Driver\WriteConcern::__construct' => ['void', 'w'=>'string|int', 'wtimeout='=>'int', 'journal='=>'bool', 'fsync='=>'bool'], -'MongoDB\Driver\WriteConcern::getJurnal' => ['bool|null'], -'MongoDB\Driver\WriteConcern::getW' => ['int|null|string'], -'MongoDB\Driver\WriteConcern::getWtimeout' => ['int'], -'MongoDB\Driver\WriteConcernError::getCode' => [''], -'MongoDB\Driver\WriteConcernError::getInfo' => [''], -'MongoDB\Driver\WriteConcernError::getMessage' => [''], -'MongoDB\Driver\WriteError::getCode' => [''], -'MongoDB\Driver\WriteError::getIndex' => [''], -'MongoDB\Driver\WriteError::getInfo' => ['mixed'], -'MongoDB\Driver\WriteError::getMessage' => [''], -'MongoDB\Driver\WriteException::getWriteResult' => [''], -'MongoDB\Driver\WriteResult::getDeletedCount' => ['int'], -'MongoDB\Driver\WriteResult::getInfo' => [''], -'MongoDB\Driver\WriteResult::getInsertedCount' => ['int'], -'MongoDB\Driver\WriteResult::getMatchedCount' => ['int'], -'MongoDB\Driver\WriteResult::getModifiedCount' => ['int'], -'MongoDB\Driver\WriteResult::getServer' => [''], -'MongoDB\Driver\WriteResult::getUpsertedCount' => ['int'], -'MongoDB\Driver\WriteResult::getUpsertedIds' => [''], -'MongoDB\Driver\WriteResult::getWriteConcernError' => [''], -'MongoDB\Driver\WriteResult::getWriteErrors' => [''], -'MongoDB\Driver\WriteResult::isAcknowledged' => ['bool'], -'MongoDBRef::create' => ['array', 'collection'=>'string', 'id'=>'mixed', 'database='=>'string'], -'MongoDBRef::get' => ['array', 'db'=>'mongodb', 'ref'=>'array'], -'MongoDBRef::isRef' => ['bool', 'ref'=>'mixed'], -'MongoDeleteBatch::__construct' => ['void', 'collection'=>'MongoCollection', 'write_options='=>'array'], -'MongoException::__clone' => ['void'], -'MongoException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'(?Exception)|(?Throwable)'], -'MongoException::__toString' => ['string'], -'MongoException::__wakeup' => ['void'], -'MongoException::getCode' => ['int'], -'MongoException::getFile' => ['string'], -'MongoException::getLine' => ['int'], -'MongoException::getMessage' => ['string'], -'MongoException::getPrevious' => ['Exception|Throwable'], -'MongoException::getTrace' => ['array'], -'MongoException::getTraceAsString' => ['string'], -'MongoGridFS::__construct' => ['void', 'db'=>'MongoDB', 'prefix='=>'string', 'chunks='=>'mixed'], -'MongoGridFS::__get' => ['MongoCollection', 'name'=>'string'], -'MongoGridFS::__toString' => ['string'], -'MongoGridFS::aggregate' => ['array', 'pipeline'=>'array', 'op'=>'array', 'pipelineOperators'=>'array'], -'MongoGridFS::aggregateCursor' => ['MongoCommandCursor', 'pipeline'=>'array', 'options'=>'array'], -'MongoGridFS::batchInsert' => ['mixed', 'a'=>'array', 'options='=>'array'], -'MongoGridFS::count' => ['int', 'query='=>'stdClass|array'], -'MongoGridFS::createDBRef' => ['array', 'a'=>'array'], -'MongoGridFS::createIndex' => ['array', 'keys'=>'array', 'options='=>'array'], -'MongoGridFS::delete' => ['bool', 'id'=>'mixed'], -'MongoGridFS::deleteIndex' => ['array', 'keys'=>'array|string'], -'MongoGridFS::deleteIndexes' => ['array'], -'MongoGridFS::distinct' => ['array|bool', 'key'=>'string', 'query='=>'?array'], -'MongoGridFS::drop' => ['array'], -'MongoGridFS::ensureIndex' => ['bool', 'keys'=>'array', 'options='=>'array'], -'MongoGridFS::find' => ['MongoGridFSCursor', 'query='=>'array', 'fields='=>'array'], -'MongoGridFS::findAndModify' => ['array', 'query'=>'array', 'update='=>'?array', 'fields='=>'?array', 'options='=>'?array'], -'MongoGridFS::findOne' => ['MongoGridFSFile', 'query='=>'mixed', 'fields='=>'mixed'], -'MongoGridFS::get' => ['MongoGridFSFile', 'id'=>'mixed'], -'MongoGridFS::getDBRef' => ['array', 'ref'=>'array'], -'MongoGridFS::getIndexInfo' => ['array'], -'MongoGridFS::getName' => ['string'], -'MongoGridFS::getReadPreference' => ['array'], -'MongoGridFS::getSlaveOkay' => ['bool'], -'MongoGridFS::group' => ['array', 'keys'=>'mixed', 'initial'=>'array', 'reduce'=>'MongoCode', 'condition='=>'array'], -'MongoGridFS::insert' => ['array|bool', 'a'=>'array|object', 'options='=>'array'], -'MongoGridFS::put' => ['mixed', 'filename'=>'string', 'extra='=>'array'], -'MongoGridFS::remove' => ['bool', 'criteria='=>'array', 'options='=>'array'], -'MongoGridFS::save' => ['array|bool', 'a'=>'array|object', 'options='=>'array'], -'MongoGridFS::setReadPreference' => ['bool', 'read_preference'=>'string', 'tags'=>'array'], -'MongoGridFS::setSlaveOkay' => ['bool', 'ok='=>'bool|true'], -'MongoGridFS::storeBytes' => ['mixed', 'bytes'=>'string', 'extra='=>'array', 'options='=>'array'], -'MongoGridFS::storeFile' => ['mixed', 'filename'=>'string', 'extra='=>'array', 'options='=>'array'], -'MongoGridFS::storeUpload' => ['mixed', 'name'=>'string', 'filename='=>'string'], -'MongoGridFS::toIndexString' => ['string', 'keys'=>'mixed'], -'MongoGridFS::update' => ['bool', 'criteria'=>'array', 'newobj'=>'array', 'options='=>'array'], -'MongoGridFS::validate' => ['array', 'scan_data='=>'bool|false'], -'MongoGridFSCursor::__construct' => ['void', 'gridfs'=>'MongoGridFS', 'connection'=>'resource', 'ns'=>'string', 'query'=>'array', 'fields'=>'array'], -'MongoGridFSCursor::addOption' => ['MongoCursor', 'key'=>'string', 'value'=>'mixed'], -'MongoGridFSCursor::awaitData' => ['MongoCursor', 'wait='=>'bool|true'], -'MongoGridFSCursor::batchSize' => ['MongoCursor', 'batchSize'=>'int'], -'MongoGridFSCursor::count' => ['int', 'all='=>'bool|false'], -'MongoGridFSCursor::current' => ['MongoGridFSFile'], -'MongoGridFSCursor::dead' => ['bool'], -'MongoGridFSCursor::doQuery' => ['void'], -'MongoGridFSCursor::explain' => ['array'], -'MongoGridFSCursor::fields' => ['MongoCursor', 'f'=>'array'], -'MongoGridFSCursor::getNext' => ['MongoGridFSFile'], -'MongoGridFSCursor::getReadPreference' => ['array'], -'MongoGridFSCursor::hasNext' => ['bool'], -'MongoGridFSCursor::hint' => ['MongoCursor', 'key_pattern'=>'mixed'], -'MongoGridFSCursor::immortal' => ['MongoCursor', 'liveForever='=>'bool|true'], -'MongoGridFSCursor::info' => ['array'], -'MongoGridFSCursor::key' => ['string'], -'MongoGridFSCursor::limit' => ['MongoCursor', 'num'=>'int'], -'MongoGridFSCursor::maxTimeMS' => ['MongoCursor', 'ms'=>'int'], -'MongoGridFSCursor::next' => ['void'], -'MongoGridFSCursor::partial' => ['MongoCursor', 'okay='=>'bool|true'], -'MongoGridFSCursor::reset' => ['void'], -'MongoGridFSCursor::rewind' => ['void'], -'MongoGridFSCursor::setFlag' => ['MongoCursor', 'flag'=>'int', 'set='=>'bool|true'], -'MongoGridFSCursor::setReadPreference' => ['MongoCursor', 'read_preference'=>'string', 'tags'=>'array'], -'MongoGridFSCursor::skip' => ['MongoCursor', 'num'=>'int'], -'MongoGridFSCursor::slaveOkay' => ['MongoCursor', 'okay='=>'bool|true'], -'MongoGridFSCursor::snapshot' => ['MongoCursor'], -'MongoGridFSCursor::sort' => ['MongoCursor', 'fields'=>'array'], -'MongoGridFSCursor::tailable' => ['MongoCursor', 'tail='=>'bool|true'], -'MongoGridFSCursor::timeout' => ['MongoCursor', 'ms'=>'int'], -'MongoGridFSCursor::valid' => ['bool'], -'MongoGridfsFile::__construct' => ['void', 'gridfs'=>'MongoGridFS', 'file'=>'array'], -'MongoGridFSFile::getBytes' => ['string'], -'MongoGridFSFile::getFilename' => ['string'], -'MongoGridFSFile::getResource' => ['resource'], -'MongoGridFSFile::getSize' => ['int'], -'MongoGridFSFile::write' => ['int', 'filename='=>'string'], -'MongoId::__construct' => ['void', 'id='=>'string|MongoId'], -'MongoId::__set_state' => ['MongoId', 'props'=>'array'], -'MongoId::__toString' => ['string'], -'MongoId::getHostname' => ['string'], -'MongoId::getInc' => ['int'], -'MongoId::getPID' => ['int'], -'MongoId::getTimestamp' => ['int'], -'MongoId::isValid' => ['bool', 'value'=>'mixed'], -'MongoInsertBatch::__construct' => ['void', 'collection'=>'MongoCollection', 'write_options='=>'array'], -'MongoInt32::__construct' => ['void', 'value'=>'string'], -'MongoInt32::__toString' => ['string'], -'MongoInt64::__construct' => ['void', 'value'=>'string'], -'MongoInt64::__toString' => ['string'], -'MongoLog::getCallback' => ['callable'], -'MongoLog::getLevel' => ['int'], -'MongoLog::getModule' => ['int'], -'MongoLog::setCallback' => ['void', 'log_function'=>'callable'], -'MongoLog::setLevel' => ['void', 'level'=>'int'], -'MongoLog::setModule' => ['void', 'module'=>'int'], -'MongoPool::getSize' => ['int'], -'MongoPool::info' => ['array'], -'MongoPool::setSize' => ['bool', 'size'=>'int'], -'MongoRegex::__construct' => ['void', 'regex'=>'string'], -'MongoRegex::__toString' => ['string'], -'MongoResultException::__clone' => ['void'], -'MongoResultException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'(?Exception)|(?Throwable)'], -'MongoResultException::__toString' => ['string'], -'MongoResultException::__wakeup' => ['void'], -'MongoResultException::getCode' => ['int'], -'MongoResultException::getDocument' => ['array'], -'MongoResultException::getFile' => ['string'], -'MongoResultException::getLine' => ['int'], -'MongoResultException::getMessage' => ['string'], -'MongoResultException::getPrevious' => ['Exception|Throwable'], -'MongoResultException::getTrace' => ['array'], -'MongoResultException::getTraceAsString' => ['string'], -'MongoTimestamp::__construct' => ['void', 'sec='=>'int', 'inc='=>'int'], -'MongoTimestamp::__toString' => ['string'], -'MongoUpdateBatch::__construct' => ['void', 'collection'=>'MongoCollection', 'write_options='=>'array'], -'MongoUpdateBatch::add' => ['bool', 'item'=>'array'], -'MongoUpdateBatch::execute' => ['array', 'write_options'=>'array'], -'MongoWriteBatch::__construct' => ['void', 'collection'=>'MongoCollection', 'batch_type'=>'string', 'write_options'=>'array'], -'MongoWriteBatch::add' => ['bool', 'item'=>'array'], -'MongoWriteBatch::execute' => ['array', 'write_options'=>'array'], -'MongoWriteConcernException::__clone' => ['void'], -'MongoWriteConcernException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'(?Exception)|(?Throwable)'], -'MongoWriteConcernException::__toString' => ['string'], -'MongoWriteConcernException::__wakeup' => ['void'], -'MongoWriteConcernException::getCode' => ['int'], -'MongoWriteConcernException::getDocument' => ['array'], -'MongoWriteConcernException::getFile' => ['string'], -'MongoWriteConcernException::getLine' => ['int'], -'MongoWriteConcernException::getMessage' => ['string'], -'MongoWriteConcernException::getPrevious' => ['Exception|Throwable'], -'MongoWriteConcernException::getTrace' => ['array'], -'MongoWriteConcernException::getTraceAsString' => ['string'], -'monitor_custom_event' => ['void', 'class'=>'class', 'text'=>'text', 'severe='=>'severe', 'user_data='=>'user_data'], -'monitor_httperror_event' => ['void', 'error_code'=>'error_code', 'url'=>'url', 'severe='=>'severe'], -'monitor_license_info' => ['array'], -'monitor_pass_error' => ['void', 'errno'=>'', 'errstr'=>'', 'errfile'=>'', 'errline'=>''], -'monitor_set_aggregation_hint' => ['void', 'hint'=>'hint'], -'move_uploaded_file' => ['bool', 'path'=>'string', 'new_path'=>'string'], -'mqseries_back' => ['void', 'hconn'=>'resource', 'compcode'=>'resource', 'reason'=>'resource'], -'mqseries_begin' => ['void', 'hconn'=>'resource', 'beginoptions'=>'array', 'compcode'=>'resource', 'reason'=>'resource'], -'mqseries_close' => ['void', 'hconn'=>'resource', 'hobj'=>'resource', 'options'=>'int', 'compcode'=>'resource', 'reason'=>'resource'], -'mqseries_cmit' => ['void', 'hconn'=>'resource', 'compcode'=>'resource', 'reason'=>'resource'], -'mqseries_conn' => ['void', 'qmanagername'=>'string', 'hconn'=>'resource', 'compcode'=>'resource', 'reason'=>'resource'], -'mqseries_connx' => ['void', 'qmanagername'=>'string', 'connoptions'=>'array', 'hconn'=>'resource', 'compcode'=>'resource', 'reason'=>'resource'], -'mqseries_disc' => ['void', 'hconn'=>'resource', 'compcode'=>'resource', 'reason'=>'resource'], -'mqseries_get' => ['void', 'hconn'=>'resource', 'hobj'=>'resource', 'md'=>'array', 'gmo'=>'array', 'bufferlength'=>'int', 'msg'=>'string', 'data_length'=>'int', 'compcode'=>'resource', 'reason'=>'resource'], -'mqseries_inq' => ['void', 'hconn'=>'resource', 'hobj'=>'resource', 'selectorcount'=>'int', 'selectors'=>'array', 'intattrcount'=>'int', 'intattr'=>'resource', 'charattrlength'=>'int', 'charattr'=>'resource', 'compcode'=>'resource', 'reason'=>'resource'], -'mqseries_open' => ['void', 'hconn'=>'resource', 'objdesc'=>'array', 'option'=>'int', 'hobj'=>'resource', 'compcode'=>'resource', 'reason'=>'resource'], -'mqseries_put' => ['void', 'hconn'=>'resource', 'hobj'=>'resource', 'md'=>'array', 'pmo'=>'array', 'message'=>'string', 'compcode'=>'resource', 'reason'=>'resource'], -'mqseries_put1' => ['void', 'hconn'=>'resource', 'objdesc'=>'resource', 'msgdesc'=>'resource', 'pmo'=>'resource', 'buffer'=>'string', 'compcode'=>'resource', 'reason'=>'resource'], -'mqseries_set' => ['void', 'hconn'=>'resource', 'hobj'=>'resource', 'selectorcount'=>'int', 'selectors'=>'array', 'intattrcount'=>'int', 'intattrs'=>'array', 'charattrlength'=>'int', 'charattrs'=>'array', 'compcode'=>'resource', 'reason'=>'resource'], -'mqseries_strerror' => ['string', 'reason'=>'int'], -'ms_GetErrorObj' => ['errorObj'], -'ms_GetVersion' => ['string'], -'ms_GetVersionInt' => ['int'], -'ms_iogetStdoutBufferBytes' => ['int'], -'ms_iogetstdoutbufferstring' => ['void'], -'ms_ioinstallstdinfrombuffer' => ['void'], -'ms_ioinstallstdouttobuffer' => ['void'], -'ms_ioresethandlers' => ['void'], -'ms_iostripstdoutbuffercontentheaders' => ['void'], -'ms_iostripstdoutbuffercontenttype' => ['string'], -'ms_ResetErrorList' => ['void'], -'ms_TokenizeMap' => ['array', 'map_file_name'=>'string'], -'msession_connect' => ['bool', 'host'=>'string', 'port'=>'string'], -'msession_count' => ['int'], -'msession_create' => ['bool', 'session'=>'string', 'classname='=>'string', 'data='=>'string'], -'msession_destroy' => ['bool', 'name'=>'string'], -'msession_disconnect' => ['void'], -'msession_find' => ['array', 'name'=>'string', 'value'=>'string'], -'msession_get' => ['string', 'session'=>'string', 'name'=>'string', 'value'=>'string'], -'msession_get_array' => ['array', 'session'=>'string'], -'msession_get_data' => ['string', 'session'=>'string'], -'msession_inc' => ['string', 'session'=>'string', 'name'=>'string'], -'msession_list' => ['array'], -'msession_listvar' => ['array', 'name'=>'string'], -'msession_lock' => ['int', 'name'=>'string'], -'msession_plugin' => ['string', 'session'=>'string', 'val'=>'string', 'param='=>'string'], -'msession_randstr' => ['string', 'param'=>'int'], -'msession_set' => ['bool', 'session'=>'string', 'name'=>'string', 'value'=>'string'], -'msession_set_array' => ['void', 'session'=>'string', 'tuples'=>'array'], -'msession_set_data' => ['bool', 'session'=>'string', 'value'=>'string'], -'msession_timeout' => ['int', 'session'=>'string', 'param='=>'int'], -'msession_uniq' => ['string', 'param'=>'int', 'classname='=>'string', 'data='=>'string'], -'msession_unlock' => ['int', 'session'=>'string', 'key'=>'int'], -'msg_get_queue' => ['resource', 'key'=>'int', 'perms='=>'int'], -'msg_queue_exists' => ['bool', 'key'=>'int'], -'msg_receive' => ['bool', 'queue'=>'resource', 'desiredmsgtype'=>'int', '&w_msgtype'=>'int', 'maxsize'=>'int', '&w_message'=>'mixed', 'unserialize='=>'bool', 'flags='=>'int', '&w_errorcode='=>'int'], -'msg_remove_queue' => ['bool', 'queue'=>'resource'], -'msg_send' => ['bool', 'queue'=>'resource', 'msgtype'=>'int', 'message'=>'mixed', 'serialize='=>'bool', 'blocking='=>'bool', '&w_errorcode='=>'int'], -'msg_set_queue' => ['bool', 'queue'=>'resource', 'data'=>'array'], -'msg_stat_queue' => ['array', 'queue'=>'resource'], -'msgfmt_create' => ['MessageFormatter', 'locale'=>'string', 'pattern'=>'string'], -'msgfmt_format' => ['string', 'fmt'=>'messageformatter', 'args'=>'array'], -'msgfmt_format_message' => ['string', 'locale'=>'string', 'pattern'=>'string', 'args'=>'array'], -'msgfmt_get_error_code' => ['int', 'fmt'=>'messageformatter'], -'msgfmt_get_error_message' => ['string', 'fmt'=>'messageformatter'], -'msgfmt_get_locale' => ['string', 'formatter'=>'messageformatter'], -'msgfmt_get_pattern' => ['string', 'fmt'=>'messageformatter'], -'msgfmt_parse' => ['array', 'fmt'=>'messageformatter', 'value'=>'string'], -'msgfmt_parse_message' => ['array', 'locale'=>'string', 'pattern'=>'string', 'source'=>'string'], -'msgfmt_set_pattern' => ['bool', 'fmt'=>'messageformatter', 'pattern'=>'string'], -'msql_affected_rows' => ['int', 'result'=>'resource'], -'msql_close' => ['bool', 'link_identifier='=>'?resource'], -'msql_connect' => ['resource', 'hostname='=>'string'], -'msql_create_db' => ['bool', 'database_name'=>'string', 'link_identifier='=>'?resource'], -'msql_data_seek' => ['bool', 'result'=>'resource', 'row_number'=>'int'], -'msql_db_query' => ['resource', 'database'=>'string', 'query'=>'string', 'link_identifier='=>'?resource'], -'msql_drop_db' => ['bool', 'database_name'=>'string', 'link_identifier='=>'?resource'], -'msql_error' => ['string'], -'msql_fetch_array' => ['array', 'result'=>'resource', 'result_type='=>'int'], -'msql_fetch_field' => ['object', 'result'=>'resource', 'field_offset='=>'int'], -'msql_fetch_object' => ['object', 'result'=>'resource'], -'msql_fetch_row' => ['array', 'result'=>'resource'], -'msql_field_flags' => ['string', 'result'=>'resource', 'field_offset'=>'int'], -'msql_field_len' => ['int', 'result'=>'resource', 'field_offset'=>'int'], -'msql_field_name' => ['string', 'result'=>'resource', 'field_offset'=>'int'], -'msql_field_seek' => ['bool', 'result'=>'resource', 'field_offset'=>'int'], -'msql_field_table' => ['int', 'result'=>'resource', 'field_offset'=>'int'], -'msql_field_type' => ['string', 'result'=>'resource', 'field_offset'=>'int'], -'msql_free_result' => ['bool', 'result'=>'resource'], -'msql_list_dbs' => ['resource', 'link_identifier='=>'?resource'], -'msql_list_fields' => ['resource', 'database'=>'string', 'tablename'=>'string', 'link_identifier='=>'?resource'], -'msql_list_tables' => ['resource', 'database'=>'string', 'link_identifier='=>'?resource'], -'msql_num_fields' => ['int', 'result'=>'resource'], -'msql_num_rows' => ['int', 'query_identifier'=>'resource'], -'msql_pconnect' => ['resource', 'hostname='=>'string'], -'msql_query' => ['resource', 'query'=>'string', 'link_identifier='=>'?resource'], -'msql_result' => ['string', 'result'=>'resource', 'row'=>'int', 'field='=>'mixed'], -'msql_select_db' => ['bool', 'database_name'=>'string', 'link_identifier='=>'?resource'], -'mssql_bind' => ['bool', 'stmt'=>'resource', 'param_name'=>'string', 'var'=>'mixed', 'type'=>'int', 'is_output='=>'bool', 'is_null='=>'bool', 'maxlen='=>'int'], -'mssql_close' => ['bool', 'link_identifier='=>'resource'], -'mssql_connect' => ['resource', 'servername='=>'string', 'username='=>'string', 'password='=>'string', 'new_link='=>'bool'], -'mssql_data_seek' => ['bool', 'result_identifier'=>'resource', 'row_number'=>'int'], -'mssql_execute' => ['mixed', 'stmt'=>'resource', 'skip_results='=>'bool'], -'mssql_fetch_array' => ['array', 'result'=>'resource', 'result_type='=>'int'], -'mssql_fetch_assoc' => ['array', 'result_id'=>'resource'], -'mssql_fetch_batch' => ['int', 'result'=>'resource'], -'mssql_fetch_field' => ['object', 'result'=>'resource', 'field_offset='=>'int'], -'mssql_fetch_object' => ['object', 'result'=>'resource'], -'mssql_fetch_row' => ['array', 'result'=>'resource'], -'mssql_field_length' => ['int', 'result'=>'resource', 'offset='=>'int'], -'mssql_field_name' => ['string', 'result'=>'resource', 'offset='=>'int'], -'mssql_field_seek' => ['bool', 'result'=>'resource', 'field_offset'=>'int'], -'mssql_field_type' => ['string', 'result'=>'resource', 'offset='=>'int'], -'mssql_free_result' => ['bool', 'result'=>'resource'], -'mssql_free_statement' => ['bool', 'stmt'=>'resource'], -'mssql_get_last_message' => ['string'], -'mssql_guid_string' => ['string', 'binary'=>'string', 'short_format='=>'bool'], -'mssql_init' => ['resource', 'sp_name'=>'string', 'link_identifier='=>'resource'], -'mssql_min_error_severity' => ['void', 'severity'=>'int'], -'mssql_min_message_severity' => ['void', 'severity'=>'int'], -'mssql_next_result' => ['bool', 'result_id'=>'resource'], -'mssql_num_fields' => ['int', 'result'=>'resource'], -'mssql_num_rows' => ['int', 'result'=>'resource'], -'mssql_pconnect' => ['resource', 'servername='=>'string', 'username='=>'string', 'password='=>'string', 'new_link='=>'bool'], -'mssql_query' => ['mixed', 'query'=>'string', 'link_identifier='=>'resource', 'batch_size='=>'int'], -'mssql_result' => ['string', 'result'=>'resource', 'row'=>'int', 'field'=>'mixed'], -'mssql_rows_affected' => ['int', 'link_identifier'=>'resource'], -'mssql_select_db' => ['bool', 'database_name'=>'string', 'link_identifier='=>'resource'], -'mt_getrandmax' => ['int'], -'mt_rand' => ['int', 'min'=>'int', 'max'=>'int'], -'mt_rand\'1' => ['int'], -'mt_srand' => ['void', 'seed='=>'int', 'mode='=>'int'], -'MultipleIterator::__construct' => ['void', 'flags='=>'int'], -'MultipleIterator::attachIterator' => ['void', 'iterator'=>'iterator', 'infos='=>'string'], -'MultipleIterator::containsIterator' => ['bool', 'iterator'=>'iterator'], -'MultipleIterator::countIterators' => ['int'], -'MultipleIterator::current' => ['array'], -'MultipleIterator::detachIterator' => ['void', 'iterator'=>'iterator'], -'MultipleIterator::getFlags' => ['int'], -'MultipleIterator::key' => ['array'], -'MultipleIterator::next' => ['void'], -'MultipleIterator::rewind' => ['void'], -'MultipleIterator::setFlags' => ['int', 'flags'=>'int'], -'MultipleIterator::valid' => ['bool'], -'Mutex::create' => ['long', 'lock='=>'bool'], -'Mutex::destroy' => ['bool', 'mutex'=>'long'], -'Mutex::lock' => ['bool', 'mutex'=>'long'], -'Mutex::trylock' => ['bool', 'mutex'=>'long'], -'Mutex::unlock' => ['bool', 'mutex'=>'long', 'destroy='=>'bool'], -'mysql_affected_rows' => ['int', 'link_identifier='=>'resource'], -'mysql_client_encoding' => ['string', 'link_identifier='=>'resource'], -'mysql_close' => ['bool', 'link_identifier='=>'resource'], -'mysql_connect' => ['resource', 'server='=>'string', 'username='=>'string', 'password='=>'string', 'new_link='=>'bool', 'client_flags='=>'int'], -'mysql_create_db' => ['bool', 'database_name'=>'string', 'link_identifier='=>'resource'], -'mysql_data_seek' => ['bool', 'result'=>'resource', 'row_number'=>'int'], -'mysql_db_name' => ['string', 'result'=>'resource', 'row'=>'int', 'field='=>'mixed'], -'mysql_db_query' => ['resource', 'database'=>'string', 'query'=>'string', 'link_identifier='=>'resource'], -'mysql_drop_db' => ['bool', 'database_name'=>'string', 'link_identifier='=>'resource'], -'mysql_errno' => ['int', 'link_identifier='=>'resource'], -'mysql_error' => ['string', 'link_identifier='=>'resource'], -'mysql_escape_string' => ['string', 'unescaped_string'=>'string'], -'mysql_fetch_array' => ['array', 'result'=>'resource', 'result_type='=>'int'], -'mysql_fetch_assoc' => ['array', 'result'=>'resource'], -'mysql_fetch_field' => ['object', 'result'=>'resource', 'field_offset='=>'int'], -'mysql_fetch_lengths' => ['array', 'result'=>'resource'], -'mysql_fetch_object' => ['object', 'result'=>'resource', 'class_name='=>'string', 'params='=>'array'], -'mysql_fetch_row' => ['array', 'result'=>'resource'], -'mysql_field_flags' => ['string', 'result'=>'resource', 'field_offset'=>'int'], -'mysql_field_len' => ['int', 'result'=>'resource', 'field_offset'=>'int'], -'mysql_field_name' => ['string', 'result'=>'resource', 'field_offset'=>'int'], -'mysql_field_seek' => ['bool', 'result'=>'resource', 'field_offset'=>'int'], -'mysql_field_table' => ['string', 'result'=>'resource', 'field_offset'=>'int'], -'mysql_field_type' => ['string', 'result'=>'resource', 'field_offset'=>'int'], -'mysql_free_result' => ['bool', 'result'=>'resource'], -'mysql_get_client_info' => ['string'], -'mysql_get_host_info' => ['string', 'link_identifier='=>'resource'], -'mysql_get_proto_info' => ['int', 'link_identifier='=>'resource'], -'mysql_get_server_info' => ['string', 'link_identifier='=>'resource'], -'mysql_info' => ['string', 'link_identifier='=>'resource'], -'mysql_insert_id' => ['int', 'link_identifier='=>'resource'], -'mysql_list_dbs' => ['resource', 'link_identifier='=>'resource'], -'mysql_list_fields' => ['resource', 'database_name'=>'string', 'table_name'=>'string', 'link_identifier='=>'resource'], -'mysql_list_processes' => ['resource', 'link_identifier='=>'resource'], -'mysql_list_tables' => ['resource', 'database'=>'string', 'link_identifier='=>'resource'], -'mysql_num_fields' => ['int', 'result'=>'resource'], -'mysql_num_rows' => ['int', 'result'=>'resource'], -'mysql_pconnect' => ['resource', 'server='=>'string', 'username='=>'string', 'password='=>'string', 'client_flags='=>'int'], -'mysql_ping' => ['bool', 'link_identifier='=>'resource'], -'mysql_query' => ['resource', 'query'=>'string', 'link_identifier='=>'resource'], -'mysql_real_escape_string' => ['string', 'unescaped_string'=>'string', 'link_identifier='=>'resource'], -'mysql_result' => ['string', 'result'=>'resource', 'row'=>'int', 'field='=>'mixed'], -'mysql_select_db' => ['bool', 'database_name'=>'string', 'link_identifier='=>'resource'], -'mysql_set_charset' => ['bool', 'charset'=>'string', 'link_identifier='=>'resource'], -'mysql_stat' => ['string', 'link_identifier='=>'resource'], -'mysql_tablename' => ['string', 'result'=>'resource', 'i'=>'int'], -'mysql_thread_id' => ['int', 'link_identifier='=>'resource'], -'mysql_unbuffered_query' => ['resource', 'query'=>'string', 'link_identifier='=>'resource'], -'mysqli::__construct' => ['void', 'host='=>'string', 'username='=>'string', 'passwd='=>'string', 'dbname='=>'string', 'port='=>'int', 'socket='=>'string'], -'mysqli::autocommit' => ['bool', 'mode'=>'bool'], -'mysqli::begin_transaction' => ['bool', 'flags='=>'int', 'name='=>'string'], -'mysqli::change_user' => ['bool', 'user'=>'string', 'password'=>'string', 'database'=>'string'], -'mysqli::character_set_name' => ['string'], -'mysqli::close' => ['bool'], -'mysqli::commit' => ['bool', 'flags='=>'int', 'name='=>'string'], -'mysqli::debug' => ['bool', 'message'=>'string'], -'mysqli::disable_reads_from_master' => ['bool'], -'mysqli::dump_debug_info' => ['bool'], -'mysqli::get_charset' => ['object'], -'mysqli::get_client_info' => ['string'], -'mysqli::get_connection_stats' => ['array|false'], -'mysqli::get_warnings' => ['mysqli_warning'], -'mysqli::init' => ['mysqli'], -'mysqli::kill' => ['bool', 'processid'=>'int'], -'mysqli::more_results' => ['bool'], -'mysqli::multi_query' => ['bool', 'query'=>'string'], -'mysqli::next_result' => ['bool'], -'mysqli::options' => ['bool', 'option'=>'int', 'value'=>'mixed'], -'mysqli::ping' => ['bool'], -'mysqli::poll' => ['int|false', '&w_read'=>'array', '&w_error'=>'array', '&w_reject'=>'array', 'sec'=>'int', 'usec='=>'int'], -'mysqli::prepare' => ['mysqli_stmt|false', 'query'=>'string'], -'mysqli::query' => ['bool|mysqli_result', 'query'=>'string', 'resultmode='=>'int'], -'mysqli::real_connect' => ['bool', 'host='=>'string', 'username='=>'string', 'passwd='=>'string', 'dbname='=>'string', 'port='=>'int', 'socket='=>'string', 'flags='=>'int'], -'mysqli::real_escape_string' => ['string', 'escapestr'=>'string'], -'mysqli::real_query' => ['bool', 'query'=>'string'], -'mysqli::reap_async_query' => ['mysqli_result|false'], -'mysqli::refresh' => ['bool', 'options'=>'int'], -'mysqli::release_savepoint' => ['bool', 'name'=>'string'], -'mysqli::rollback' => ['bool', 'flags='=>'int', 'name='=>'string'], -'mysqli::rpl_query_type' => ['int', 'query'=>'string'], -'mysqli::savepoint' => ['bool', 'name'=>'string'], -'mysqli::select_db' => ['bool', 'dbname'=>'string'], -'mysqli::send_query' => ['bool', 'query'=>'string'], -'mysqli::set_charset' => ['bool', 'charset'=>'string'], -'mysqli::set_local_infile_default' => ['void'], -'mysqli::set_local_infile_handler' => ['bool', 'read_func='=>'callable'], -'mysqli::ssl_set' => ['bool', 'key'=>'string', 'cert'=>'string', 'ca'=>'string', 'capath'=>'string', 'cipher'=>'string'], -'mysqli::stat' => ['string|false'], -'mysqli::stmt_init' => ['mysqli_stmt'], -'mysqli::store_result' => ['mysqli_result|false', 'option='=>'int'], -'mysqli::thread_safe' => ['bool'], -'mysqli::use_result' => ['mysqli_result|false'], -'mysqli_affected_rows' => ['int', 'link'=>'mysqli'], -'mysqli_autocommit' => ['bool', 'link'=>'mysqli', 'mode'=>'bool'], -'mysqli_begin_transaction' => ['bool', 'link'=>'mysqli', 'flags'=>'int', 'name'=>'string'], -'mysqli_change_user' => ['bool', 'link'=>'mysqli', 'user'=>'string', 'password'=>'string', 'database'=>'string'], -'mysqli_character_set_name' => ['string', 'link'=>'mysqli'], -'mysqli_close' => ['bool', 'link'=>'mysqli'], -'mysqli_commit' => ['bool', 'link'=>'mysqli', 'flags='=>'int', 'name='=>'string'], -'mysqli_connect' => ['mysqli|false', 'host='=>'string', 'username='=>'string', 'passwd='=>'string', 'dbname='=>'string', 'port='=>'int', 'socket='=>'string'], -'mysqli_connect_errno' => ['int'], -'mysqli_connect_error' => ['string'], -'mysqli_data_seek' => ['bool', 'result'=>'mysqli_result', 'offset'=>'int'], -'mysqli_debug' => ['bool', 'message'=>'string'], -'mysqli_disable_reads_from_master' => ['bool', 'link'=>'mysqli'], -'mysqli_disable_rpl_parse' => ['bool', 'link'=>'mysqli'], -'mysqli_driver::embedded_server_end' => ['void'], -'mysqli_driver::embedded_server_start' => ['bool', 'start'=>'int', 'arguments'=>'array', 'groups'=>'array'], -'mysqli_dump_debug_info' => ['bool', 'link'=>'mysqli'], -'mysqli_embedded_server_end' => ['void'], -'mysqli_embedded_server_start' => ['bool', 'start'=>'int', 'arguments'=>'array', 'groups'=>'array'], -'mysqli_enable_reads_from_master' => ['bool', 'link'=>'mysqli'], -'mysqli_enable_rpl_parse' => ['bool', 'link'=>'mysqli'], -'mysqli_errno' => ['int', 'link'=>'mysqli'], -'mysqli_error' => ['string', 'link'=>'mysqli'], -'mysqli_error_list' => ['array', 'connection'=>'mysqli'], -'mysqli_fetch_all' => ['array', 'result'=>'mysqli_result', 'resulttype='=>'int'], -'mysqli_fetch_array' => ['array|null', 'result'=>'mysqli_result', 'resulttype='=>'int'], -'mysqli_fetch_assoc' => ['array|null', 'result'=>'mysqli_result'], -'mysqli_fetch_field' => ['object|false', 'result'=>'mysqli_result'], -'mysqli_fetch_field_direct' => ['object|false', 'result'=>'mysqli_result', 'fieldnr'=>'int'], -'mysqli_fetch_fields' => ['array|false', 'result'=>'mysqli_result'], -'mysqli_fetch_lengths' => ['array|false', 'result'=>'mysqli_result'], -'mysqli_fetch_object' => ['object|null', 'result'=>'mysqli_result', 'class_name='=>'string', 'params='=>'?array'], -'mysqli_fetch_row' => ['array|null', 'result'=>'mysqli_result'], -'mysqli_field_count' => ['int', 'link'=>'mysqli'], -'mysqli_field_seek' => ['bool', 'result'=>'mysqli_result', 'fieldnr'=>'int'], -'mysqli_field_tell' => ['int', 'result'=>'mysqli_result'], -'mysqli_free_result' => ['void', 'link'=>'mysqli_result'], -'mysqli_get_cache_stats' => ['array'], -'mysqli_get_charset' => ['object', 'link'=>'mysqli'], -'mysqli_get_client_info' => ['string', 'link'=>'mysqli'], -'mysqli_get_client_stats' => ['array|false'], -'mysqli_get_client_version' => ['int', 'link'=>'mysqli'], -'mysqli_get_connection_stats' => ['array|false', 'link'=>'mysqli'], -'mysqli_get_host_info' => ['string', 'link'=>'mysqli'], -'mysqli_get_links_stats' => ['array'], -'mysqli_get_proto_info' => ['int', 'link'=>'mysqli'], -'mysqli_get_server_info' => ['string', 'link'=>'mysqli'], -'mysqli_get_server_version' => ['int', 'link'=>'mysqli'], -'mysqli_get_warnings' => ['mysqli_warning', 'link'=>'mysqli'], -'mysqli_info' => ['?string', 'link'=>'mysqli'], -'mysqli_init' => ['mysqli'], -'mysqli_insert_id' => ['int|string', 'link'=>'mysqli'], -'mysqli_kill' => ['bool', 'link'=>'mysqli', 'processid'=>'int'], -'mysqli_link_construct' => ['object'], -'mysqli_master_query' => ['bool', 'link'=>'mysqli', 'query'=>'string'], -'mysqli_more_results' => ['bool', 'link'=>'mysqli'], -'mysqli_multi_query' => ['bool', 'link'=>'mysqli', 'query'=>'string'], -'mysqli_next_result' => ['bool', 'link'=>'mysqli'], -'mysqli_num_fields' => ['int', 'link'=>'mysqli_result'], -'mysqli_num_rows' => ['int', 'link'=>'mysqli_result'], -'mysqli_options' => ['bool', 'link'=>'mysqli', 'option'=>'int', 'value'=>'mixed'], -'mysqli_ping' => ['bool', 'link'=>'mysqli'], -'mysqli_poll' => ['int|false', 'read'=>'array', 'error'=>'array', 'reject'=>'array', 'sec'=>'int', 'usec='=>'int'], -'mysqli_prepare' => ['mysqli_stmt|false', 'link'=>'mysqli', 'query'=>'string'], -'mysqli_query' => ['mysqli_result|bool', 'link'=>'mysqli', 'query'=>'string', 'resultmode='=>'int'], -'mysqli_real_connect' => ['bool', 'link='=>'mysqli', 'host='=>'string', 'username='=>'string', 'passwd='=>'string', 'dbname='=>'string', 'port='=>'int', 'socket='=>'string', 'flags='=>'int'], -'mysqli_real_escape_string' => ['string', 'link'=>'mysqli', 'escapestr'=>'string'], -'mysqli_real_query' => ['bool', 'link'=>'mysqli', 'query'=>'string'], -'mysqli_reap_async_query' => ['mysqli_result|false', 'link'=>'mysqli'], -'mysqli_refresh' => ['bool', 'link'=>'mysqli', 'options'=>'int'], -'mysqli_release_savepoint' => ['bool', 'link'=>'mysqli', 'name'=>'string'], -'mysqli_report' => ['bool', 'flags'=>'int'], -'mysqli_result::__construct' => ['void', 'link'=>'mysqli', 'resultmode='=>'int'], -'mysqli_result::close' => ['void'], -'mysqli_result::data_seek' => ['bool', 'offset'=>'int'], -'mysqli_result::fetch_all' => ['array', 'resulttype='=>'int'], -'mysqli_result::fetch_array' => ['array|null', 'resulttype='=>'int'], -'mysqli_result::fetch_assoc' => ['array|null'], -'mysqli_result::fetch_field' => ['object|false'], -'mysqli_result::fetch_field_direct' => ['object|false', 'fieldnr'=>'int'], -'mysqli_result::fetch_fields' => ['array|false'], -'mysqli_result::fetch_object' => ['object|null', 'class_name='=>'string', 'params='=>'array'], -'mysqli_result::fetch_row' => ['array|null'], -'mysqli_result::field_seek' => ['bool', 'fieldnr'=>'int'], -'mysqli_result::free' => ['void'], -'mysqli_result::free_result' => ['void'], -'mysqli_rollback' => ['bool', 'link'=>'mysqli', 'flags='=>'int', 'name='=>'string'], -'mysqli_rpl_parse_enabled' => ['int', 'link'=>'mysqli'], -'mysqli_rpl_probe' => ['bool', 'link'=>'mysqli'], -'mysqli_rpl_query_type' => ['int', 'link'=>'mysqli', 'query'=>'string'], -'mysqli_savepoint' => ['bool', 'link'=>'mysqli', 'name'=>'string'], -'mysqli_savepoint_libmysql' => ['bool'], -'mysqli_select_db' => ['bool', 'link'=>'mysqli', 'dbname'=>'string'], -'mysqli_send_query' => ['bool', 'link'=>'mysqli', 'query'=>'string'], -'mysqli_set_charset' => ['bool', 'link'=>'mysqli', 'charset'=>'string'], -'mysqli_set_local_infile_default' => ['void', 'link'=>'mysqli'], -'mysqli_set_local_infile_handler' => ['bool', 'link'=>'mysqli', 'read_func'=>'callable'], -'mysqli_slave_query' => ['bool', 'link'=>'mysqli', 'query'=>'string'], -'mysqli_sqlstate' => ['string', 'link'=>'mysqli'], -'mysqli_ssl_set' => ['bool', 'link'=>'mysqli', 'key'=>'string', 'cert'=>'string', 'ca'=>'string', 'capath'=>'string', 'cipher'=>'string'], -'mysqli_stat' => ['string|false', 'link'=>'mysqli'], -'mysqli_stmt::__construct' => ['void', 'query='=>'string'], -'mysqli_stmt::attr_get' => ['false|int', 'attr'=>'int'], -'mysqli_stmt::attr_set' => ['bool', 'attr'=>'int', 'mode'=>'int'], -'mysqli_stmt::bind_param' => ['bool', 'types'=>'string', 'var1'=>'mixed', '...args='=>'mixed'], -'mysqli_stmt::bind_result' => ['bool', 'var1'=>'mixed', '...args='=>'mixed'], -'mysqli_stmt::close' => ['bool'], -'mysqli_stmt::data_seek' => ['void', 'offset'=>'int'], -'mysqli_stmt::execute' => ['bool'], -'mysqli_stmt::fetch' => ['bool'], -'mysqli_stmt::free_result' => ['void'], -'mysqli_stmt::get_result' => ['mysqli_result|false'], -'mysqli_stmt::get_warnings' => ['object'], -'mysqli_stmt::more_results' => ['bool'], -'mysqli_stmt::next_result' => ['bool'], -'mysqli_stmt::num_rows' => ['int'], -'mysqli_stmt::prepare' => ['bool', 'query'=>'string'], -'mysqli_stmt::reset' => ['bool'], -'mysqli_stmt::result_metadata' => ['mysqli_result|false'], -'mysqli_stmt::send_long_data' => ['bool', 'param_nr'=>'int', 'data'=>'string'], -'mysqli_stmt::store_result' => ['bool'], -'mysqli_stmt_affected_rows' => ['int|string', 'stmt'=>'mysqli_stmt'], -'mysqli_stmt_attr_get' => ['int|false', 'stmt'=>'mysqli_stmt', 'attr'=>'int'], -'mysqli_stmt_attr_set' => ['bool', 'stmt'=>'mysqli_stmt', 'attr'=>'int', 'mode'=>'int'], -'mysqli_stmt_bind_param' => ['bool', 'stmt'=>'mysqli_stmt', 'types'=>'string', 'var1'=>'mixed', '...args='=>'mixed'], -'mysqli_stmt_bind_result' => ['bool', 'stmt'=>'mysqli_stmt', 'var1='=>'mixed', '...args='=>'mixed'], -'mysqli_stmt_close' => ['bool', 'stmt'=>'mysqli_stmt'], -'mysqli_stmt_data_seek' => ['void', 'stmt'=>'mysqli_stmt', 'offset'=>'int'], -'mysqli_stmt_errno' => ['int', 'stmt'=>'mysqli_stmt'], -'mysqli_stmt_error' => ['string', 'stmt'=>'mysqli_stmt'], -'mysqli_stmt_error_list' => ['array', 'stmt'=>'mysqli_stmt'], -'mysqli_stmt_execute' => ['bool', 'stmt'=>'mysqli_stmt'], -'mysqli_stmt_fetch' => ['bool', 'stmt'=>'mysqli_stmt'], -'mysqli_stmt_field_count' => ['int', 'stmt'=>'mysqli_stmt'], -'mysqli_stmt_free_result' => ['void', 'stmt'=>'mysqli_stmt'], -'mysqli_stmt_get_result' => ['mysqli_result|false', 'stmt'=>'mysqli_stmt'], -'mysqli_stmt_get_warnings' => ['object', 'stmt'=>'mysqli_stmt'], -'mysqli_stmt_init' => ['mysqli_stmt', 'link'=>'mysqli'], -'mysqli_stmt_insert_id' => ['', 'stmt'=>'mysqli_stmt'], -'mysqli_stmt_more_results' => ['bool', 'stmt'=>'mysqli_stmt'], -'mysqli_stmt_next_result' => ['bool', 'stmt'=>'mysqli_stmt'], -'mysqli_stmt_num_rows' => ['int', 'stmt'=>'mysqli_stmt'], -'mysqli_stmt_param_count' => ['int', 'stmt'=>'mysqli_stmt'], -'mysqli_stmt_prepare' => ['bool', 'stmt'=>'mysqli_stmt', 'query'=>'string'], -'mysqli_stmt_reset' => ['bool', 'stmt'=>'mysqli_stmt'], -'mysqli_stmt_result_metadata' => ['mysqli_result|false', 'stmt'=>'mysqli_stmt'], -'mysqli_stmt_send_long_data' => ['bool', 'stmt'=>'mysqli_stmt', 'param_nr'=>'int', 'data'=>'string'], -'mysqli_stmt_sqlstate' => ['string', 'stmt'=>'mysqli_stmt'], -'mysqli_stmt_store_result' => ['bool', 'stmt'=>'mysqli_stmt'], -'mysqli_store_result' => ['mysqli_result|false', 'link'=>'mysqli', 'option='=>'int'], -'mysqli_thread_id' => ['int', 'link'=>'mysqli'], -'mysqli_thread_safe' => ['bool'], -'mysqli_use_result' => ['mysqli_result|false', 'link'=>'mysqli'], -'mysqli_warning::__construct' => ['void'], -'mysqli_warning::next' => ['void'], -'mysqli_warning_count' => ['int', 'link'=>'mysqli'], -'mysqlnd_memcache_get_config' => ['array', 'connection'=>'mixed'], -'mysqlnd_memcache_set' => ['bool', 'mysql_connection'=>'mixed', 'memcache_connection='=>'Memcached', 'pattern='=>'string', 'callback='=>'callable'], -'mysqlnd_ms_dump_servers' => ['array', 'connection'=>'mixed'], -'mysqlnd_ms_fabric_select_global' => ['array', 'connection'=>'mixed', 'table_name'=>'mixed'], -'mysqlnd_ms_fabric_select_shard' => ['array', 'connection'=>'mixed', 'table_name'=>'mixed', 'shard_key'=>'mixed'], -'mysqlnd_ms_get_last_gtid' => ['string', 'connection'=>'mixed'], -'mysqlnd_ms_get_last_used_connection' => ['array', 'connection'=>'mixed'], -'mysqlnd_ms_get_stats' => ['array'], -'mysqlnd_ms_match_wild' => ['bool', 'table_name'=>'string', 'wildcard'=>'string'], -'mysqlnd_ms_query_is_select' => ['int', 'query'=>'string'], -'mysqlnd_ms_set_qos' => ['bool', 'connection'=>'mixed', 'service_level'=>'int', 'service_level_option='=>'int', 'option_value='=>'mixed'], -'mysqlnd_ms_set_user_pick_server' => ['bool', 'function'=>'string'], -'mysqlnd_ms_xa_begin' => ['int', 'connection'=>'mixed', 'gtrid'=>'string', 'timeout='=>'int'], -'mysqlnd_ms_xa_commit' => ['int', 'connection'=>'mixed', 'gtrid'=>'string'], -'mysqlnd_ms_xa_gc' => ['int', 'connection'=>'mixed', 'gtrid='=>'string', 'ignore_max_retries='=>'bool'], -'mysqlnd_ms_xa_rollback' => ['int', 'connection'=>'mixed', 'gtrid'=>'string'], -'mysqlnd_qc_change_handler' => ['bool', 'handler'=>''], -'mysqlnd_qc_clear_cache' => ['bool'], -'mysqlnd_qc_get_available_handlers' => ['array'], -'mysqlnd_qc_get_cache_info' => ['array'], -'mysqlnd_qc_get_core_stats' => ['array'], -'mysqlnd_qc_get_handler' => ['array'], -'mysqlnd_qc_get_normalized_query_trace_log' => ['array'], -'mysqlnd_qc_get_query_trace_log' => ['array'], -'mysqlnd_qc_set_cache_condition' => ['bool', 'condition_type'=>'int', 'condition'=>'mixed', 'condition_option'=>'mixed'], -'mysqlnd_qc_set_is_select' => ['mixed', 'callback'=>'string'], -'mysqlnd_qc_set_storage_handler' => ['bool', 'handler'=>'string'], -'mysqlnd_qc_set_user_handlers' => ['bool', 'get_hash'=>'string', 'find_query_in_cache'=>'string', 'return_to_cache'=>'string', 'add_query_to_cache_if_not_exists'=>'string', 'query_is_select'=>'string', 'update_query_run_time_stats'=>'string', 'get_stats'=>'string', 'clear_cache'=>'string'], -'mysqlnd_uh_convert_to_mysqlnd' => ['resource', '&rw_mysql_connection'=>'mysqli'], -'mysqlnd_uh_set_connection_proxy' => ['bool', '&rw_connection_proxy'=>'MysqlndUhConnection', '&rw_mysqli_connection='=>'mysqli'], -'mysqlnd_uh_set_statement_proxy' => ['bool', '&rw_statement_proxy'=>'MysqlndUhStatement'], -'MysqlndUhConnection::__construct' => ['void'], -'MysqlndUhConnection::changeUser' => ['bool', 'connection'=>'mysqlnd_connection', 'user'=>'string', 'password'=>'string', 'database'=>'string', 'silent'=>'bool', 'passwd_len'=>'int'], -'MysqlndUhConnection::charsetName' => ['string', 'connection'=>'mysqlnd_connection'], -'MysqlndUhConnection::close' => ['bool', 'connection'=>'mysqlnd_connection', 'close_type'=>'int'], -'MysqlndUhConnection::connect' => ['bool', 'connection'=>'mysqlnd_connection', 'host'=>'string', 'use'=>'string', 'password'=>'string', 'database'=>'string', 'port'=>'int', 'socket'=>'string', 'mysql_flags'=>'int'], -'MysqlndUhConnection::endPSession' => ['bool', 'connection'=>'mysqlnd_connection'], -'MysqlndUhConnection::escapeString' => ['string', 'connection'=>'mysqlnd_connection', 'escape_string'=>'string'], -'MysqlndUhConnection::getAffectedRows' => ['int', 'connection'=>'mysqlnd_connection'], -'MysqlndUhConnection::getErrorNumber' => ['int', 'connection'=>'mysqlnd_connection'], -'MysqlndUhConnection::getErrorString' => ['string', 'connection'=>'mysqlnd_connection'], -'MysqlndUhConnection::getFieldCount' => ['int', 'connection'=>'mysqlnd_connection'], -'MysqlndUhConnection::getHostInformation' => ['string', 'connection'=>'mysqlnd_connection'], -'MysqlndUhConnection::getLastInsertId' => ['int', 'connection'=>'mysqlnd_connection'], -'MysqlndUhConnection::getLastMessage' => ['void', 'connection'=>'mysqlnd_connection'], -'MysqlndUhConnection::getProtocolInformation' => ['string', 'connection'=>'mysqlnd_connection'], -'MysqlndUhConnection::getServerInformation' => ['string', 'connection'=>'mysqlnd_connection'], -'MysqlndUhConnection::getServerStatistics' => ['string', 'connection'=>'mysqlnd_connection'], -'MysqlndUhConnection::getServerVersion' => ['int', 'connection'=>'mysqlnd_connection'], -'MysqlndUhConnection::getSqlstate' => ['string', 'connection'=>'mysqlnd_connection'], -'MysqlndUhConnection::getStatistics' => ['array', 'connection'=>'mysqlnd_connection'], -'MysqlndUhConnection::getThreadId' => ['int', 'connection'=>'mysqlnd_connection'], -'MysqlndUhConnection::getWarningCount' => ['int', 'connection'=>'mysqlnd_connection'], -'MysqlndUhConnection::init' => ['bool', 'connection'=>'mysqlnd_connection'], -'MysqlndUhConnection::killConnection' => ['bool', 'connection'=>'mysqlnd_connection', 'pid'=>'int'], -'MysqlndUhConnection::listFields' => ['array', 'connection'=>'mysqlnd_connection', 'table'=>'string', 'achtung_wild'=>'string'], -'MysqlndUhConnection::listMethod' => ['void', 'connection'=>'mysqlnd_connection', 'query'=>'string', 'achtung_wild'=>'string', 'par1'=>'string'], -'MysqlndUhConnection::moreResults' => ['bool', 'connection'=>'mysqlnd_connection'], -'MysqlndUhConnection::nextResult' => ['bool', 'connection'=>'mysqlnd_connection'], -'MysqlndUhConnection::ping' => ['bool', 'connection'=>'mysqlnd_connection'], -'MysqlndUhConnection::query' => ['bool', 'connection'=>'mysqlnd_connection', 'query'=>'string'], -'MysqlndUhConnection::queryReadResultsetHeader' => ['bool', 'connection'=>'mysqlnd_connection', 'mysqlnd_stmt'=>'mysqlnd_statement'], -'MysqlndUhConnection::reapQuery' => ['bool', 'connection'=>'mysqlnd_connection'], -'MysqlndUhConnection::refreshServer' => ['bool', 'connection'=>'mysqlnd_connection', 'options'=>'int'], -'MysqlndUhConnection::restartPSession' => ['bool', 'connection'=>'mysqlnd_connection'], -'MysqlndUhConnection::selectDb' => ['bool', 'connection'=>'mysqlnd_connection', 'database'=>'string'], -'MysqlndUhConnection::sendClose' => ['bool', 'connection'=>'mysqlnd_connection'], -'MysqlndUhConnection::sendQuery' => ['bool', 'connection'=>'mysqlnd_connection', 'query'=>'string'], -'MysqlndUhConnection::serverDumpDebugInformation' => ['bool', 'connection'=>'mysqlnd_connection'], -'MysqlndUhConnection::setAutocommit' => ['bool', 'connection'=>'mysqlnd_connection', 'mode'=>'int'], -'MysqlndUhConnection::setCharset' => ['bool', 'connection'=>'mysqlnd_connection', 'charset'=>'string'], -'MysqlndUhConnection::setClientOption' => ['bool', 'connection'=>'mysqlnd_connection', 'option'=>'int', 'value'=>'int'], -'MysqlndUhConnection::setServerOption' => ['void', 'connection'=>'mysqlnd_connection', 'option'=>'int'], -'MysqlndUhConnection::shutdownServer' => ['void', 'MYSQLND_UH_RES_MYSQLND_NAME'=>'string', 'level'=>'string'], -'MysqlndUhConnection::simpleCommand' => ['bool', 'connection'=>'mysqlnd_connection', 'command'=>'int', 'arg'=>'string', 'ok_packet'=>'int', 'silent'=>'bool', 'ignore_upsert_status'=>'bool'], -'MysqlndUhConnection::simpleCommandHandleResponse' => ['bool', 'connection'=>'mysqlnd_connection', 'ok_packet'=>'int', 'silent'=>'bool', 'command'=>'int', 'ignore_upsert_status'=>'bool'], -'MysqlndUhConnection::sslSet' => ['bool', 'connection'=>'mysqlnd_connection', 'key'=>'string', 'cert'=>'string', 'ca'=>'string', 'capath'=>'string', 'cipher'=>'string'], -'MysqlndUhConnection::stmtInit' => ['resource', 'connection'=>'mysqlnd_connection'], -'MysqlndUhConnection::storeResult' => ['resource', 'connection'=>'mysqlnd_connection'], -'MysqlndUhConnection::txCommit' => ['bool', 'connection'=>'mysqlnd_connection'], -'MysqlndUhConnection::txRollback' => ['bool', 'connection'=>'mysqlnd_connection'], -'MysqlndUhConnection::useResult' => ['resource', 'connection'=>'mysqlnd_connection'], -'MysqlndUhPreparedStatement::__construct' => ['void'], -'MysqlndUhPreparedStatement::execute' => ['bool', 'statement'=>'mysqlnd_prepared_statement'], -'MysqlndUhPreparedStatement::prepare' => ['bool', 'statement'=>'mysqlnd_prepared_statement', 'query'=>'string'], -'natcasesort' => ['bool', '&rw_array_arg'=>'array'], -'natsort' => ['bool', '&rw_array_arg'=>'array'], -'ncurses_addch' => ['int', 'ch'=>'int'], -'ncurses_addchnstr' => ['int', 's'=>'string', 'n'=>'int'], -'ncurses_addchstr' => ['int', 's'=>'string'], -'ncurses_addnstr' => ['int', 's'=>'string', 'n'=>'int'], -'ncurses_addstr' => ['int', 'text'=>'string'], -'ncurses_assume_default_colors' => ['int', 'fg'=>'int', 'bg'=>'int'], -'ncurses_attroff' => ['int', 'attributes'=>'int'], -'ncurses_attron' => ['int', 'attributes'=>'int'], -'ncurses_attrset' => ['int', 'attributes'=>'int'], -'ncurses_baudrate' => ['int'], -'ncurses_beep' => ['int'], -'ncurses_bkgd' => ['int', 'attrchar'=>'int'], -'ncurses_bkgdset' => ['void', 'attrchar'=>'int'], -'ncurses_border' => ['int', 'left'=>'int', 'right'=>'int', 'top'=>'int', 'bottom'=>'int', 'tl_corner'=>'int', 'tr_corner'=>'int', 'bl_corner'=>'int', 'br_corner'=>'int'], -'ncurses_bottom_panel' => ['int', 'panel'=>'resource'], -'ncurses_can_change_color' => ['bool'], -'ncurses_cbreak' => ['bool'], -'ncurses_clear' => ['bool'], -'ncurses_clrtobot' => ['bool'], -'ncurses_clrtoeol' => ['bool'], -'ncurses_color_content' => ['int', 'color'=>'int', 'r'=>'int', 'g'=>'int', 'b'=>'int'], -'ncurses_color_set' => ['int', 'pair'=>'int'], -'ncurses_curs_set' => ['int', 'visibility'=>'int'], -'ncurses_def_prog_mode' => ['bool'], -'ncurses_def_shell_mode' => ['bool'], -'ncurses_define_key' => ['int', 'definition'=>'string', 'keycode'=>'int'], -'ncurses_del_panel' => ['bool', 'panel'=>'resource'], -'ncurses_delay_output' => ['int', 'milliseconds'=>'int'], -'ncurses_delch' => ['bool'], -'ncurses_deleteln' => ['bool'], -'ncurses_delwin' => ['bool', 'window'=>'resource'], -'ncurses_doupdate' => ['bool'], -'ncurses_echo' => ['bool'], -'ncurses_echochar' => ['int', 'character'=>'int'], -'ncurses_end' => ['int'], -'ncurses_erase' => ['bool'], -'ncurses_erasechar' => ['string'], -'ncurses_filter' => ['void'], -'ncurses_flash' => ['bool'], -'ncurses_flushinp' => ['bool'], -'ncurses_getch' => ['int'], -'ncurses_getmaxyx' => ['void', 'window'=>'resource', 'y'=>'int', 'x'=>'int'], -'ncurses_getmouse' => ['bool', 'mevent'=>'array'], -'ncurses_getyx' => ['void', 'window'=>'resource', 'y'=>'int', 'x'=>'int'], -'ncurses_halfdelay' => ['int', 'tenth'=>'int'], -'ncurses_has_colors' => ['bool'], -'ncurses_has_ic' => ['bool'], -'ncurses_has_il' => ['bool'], -'ncurses_has_key' => ['int', 'keycode'=>'int'], -'ncurses_hide_panel' => ['int', 'panel'=>'resource'], -'ncurses_hline' => ['int', 'charattr'=>'int', 'n'=>'int'], -'ncurses_inch' => ['string'], -'ncurses_init' => ['void'], -'ncurses_init_color' => ['int', 'color'=>'int', 'r'=>'int', 'g'=>'int', 'b'=>'int'], -'ncurses_init_pair' => ['int', 'pair'=>'int', 'fg'=>'int', 'bg'=>'int'], -'ncurses_insch' => ['int', 'character'=>'int'], -'ncurses_insdelln' => ['int', 'count'=>'int'], -'ncurses_insertln' => ['int'], -'ncurses_insstr' => ['int', 'text'=>'string'], -'ncurses_instr' => ['int', 'buffer'=>'string'], -'ncurses_isendwin' => ['bool'], -'ncurses_keyok' => ['int', 'keycode'=>'int', 'enable'=>'bool'], -'ncurses_keypad' => ['int', 'window'=>'resource', 'bf'=>'bool'], -'ncurses_killchar' => ['string'], -'ncurses_longname' => ['string'], -'ncurses_meta' => ['int', 'window'=>'resource', '_8bit'=>'bool'], -'ncurses_mouse_trafo' => ['bool', 'y'=>'int', 'x'=>'int', 'toscreen'=>'bool'], -'ncurses_mouseinterval' => ['int', 'milliseconds'=>'int'], -'ncurses_mousemask' => ['int', 'newmask'=>'int', 'oldmask'=>'int'], -'ncurses_move' => ['int', 'y'=>'int', 'x'=>'int'], -'ncurses_move_panel' => ['int', 'panel'=>'resource', 'startx'=>'int', 'starty'=>'int'], -'ncurses_mvaddch' => ['int', 'y'=>'int', 'x'=>'int', 'c'=>'int'], -'ncurses_mvaddchnstr' => ['int', 'y'=>'int', 'x'=>'int', 's'=>'string', 'n'=>'int'], -'ncurses_mvaddchstr' => ['int', 'y'=>'int', 'x'=>'int', 's'=>'string'], -'ncurses_mvaddnstr' => ['int', 'y'=>'int', 'x'=>'int', 's'=>'string', 'n'=>'int'], -'ncurses_mvaddstr' => ['int', 'y'=>'int', 'x'=>'int', 's'=>'string'], -'ncurses_mvcur' => ['int', 'old_y'=>'int', 'old_x'=>'int', 'new_y'=>'int', 'new_x'=>'int'], -'ncurses_mvdelch' => ['int', 'y'=>'int', 'x'=>'int'], -'ncurses_mvgetch' => ['int', 'y'=>'int', 'x'=>'int'], -'ncurses_mvhline' => ['int', 'y'=>'int', 'x'=>'int', 'attrchar'=>'int', 'n'=>'int'], -'ncurses_mvinch' => ['int', 'y'=>'int', 'x'=>'int'], -'ncurses_mvvline' => ['int', 'y'=>'int', 'x'=>'int', 'attrchar'=>'int', 'n'=>'int'], -'ncurses_mvwaddstr' => ['int', 'window'=>'resource', 'y'=>'int', 'x'=>'int', 'text'=>'string'], -'ncurses_napms' => ['int', 'milliseconds'=>'int'], -'ncurses_new_panel' => ['resource', 'window'=>'resource'], -'ncurses_newpad' => ['resource', 'rows'=>'int', 'cols'=>'int'], -'ncurses_newwin' => ['resource', 'rows'=>'int', 'cols'=>'int', 'y'=>'int', 'x'=>'int'], -'ncurses_nl' => ['bool'], -'ncurses_nocbreak' => ['bool'], -'ncurses_noecho' => ['bool'], -'ncurses_nonl' => ['bool'], -'ncurses_noqiflush' => ['void'], -'ncurses_noraw' => ['bool'], -'ncurses_pair_content' => ['int', 'pair'=>'int', 'f'=>'int', 'b'=>'int'], -'ncurses_panel_above' => ['resource', 'panel'=>'resource'], -'ncurses_panel_below' => ['resource', 'panel'=>'resource'], -'ncurses_panel_window' => ['resource', 'panel'=>'resource'], -'ncurses_pnoutrefresh' => ['int', 'pad'=>'resource', 'pminrow'=>'int', 'pmincol'=>'int', 'sminrow'=>'int', 'smincol'=>'int', 'smaxrow'=>'int', 'smaxcol'=>'int'], -'ncurses_prefresh' => ['int', 'pad'=>'resource', 'pminrow'=>'int', 'pmincol'=>'int', 'sminrow'=>'int', 'smincol'=>'int', 'smaxrow'=>'int', 'smaxcol'=>'int'], -'ncurses_putp' => ['int', 'text'=>'string'], -'ncurses_qiflush' => ['void'], -'ncurses_raw' => ['bool'], -'ncurses_refresh' => ['int', 'ch'=>'int'], -'ncurses_replace_panel' => ['int', 'panel'=>'resource', 'window'=>'resource'], -'ncurses_reset_prog_mode' => ['int'], -'ncurses_reset_shell_mode' => ['int'], -'ncurses_resetty' => ['bool'], -'ncurses_savetty' => ['bool'], -'ncurses_scr_dump' => ['int', 'filename'=>'string'], -'ncurses_scr_init' => ['int', 'filename'=>'string'], -'ncurses_scr_restore' => ['int', 'filename'=>'string'], -'ncurses_scr_set' => ['int', 'filename'=>'string'], -'ncurses_scrl' => ['int', 'count'=>'int'], -'ncurses_show_panel' => ['int', 'panel'=>'resource'], -'ncurses_slk_attr' => ['int'], -'ncurses_slk_attroff' => ['int', 'intarg'=>'int'], -'ncurses_slk_attron' => ['int', 'intarg'=>'int'], -'ncurses_slk_attrset' => ['int', 'intarg'=>'int'], -'ncurses_slk_clear' => ['bool'], -'ncurses_slk_color' => ['int', 'intarg'=>'int'], -'ncurses_slk_init' => ['bool', 'format'=>'int'], -'ncurses_slk_noutrefresh' => ['bool'], -'ncurses_slk_refresh' => ['int'], -'ncurses_slk_restore' => ['int'], -'ncurses_slk_set' => ['bool', 'labelnr'=>'int', 'label'=>'string', 'format'=>'int'], -'ncurses_slk_touch' => ['int'], -'ncurses_standend' => ['int'], -'ncurses_standout' => ['int'], -'ncurses_start_color' => ['int'], -'ncurses_termattrs' => ['bool'], -'ncurses_termname' => ['string'], -'ncurses_timeout' => ['void', 'millisec'=>'int'], -'ncurses_top_panel' => ['int', 'panel'=>'resource'], -'ncurses_typeahead' => ['int', 'fd'=>'int'], -'ncurses_ungetch' => ['int', 'keycode'=>'int'], -'ncurses_ungetmouse' => ['bool', 'mevent'=>'array'], -'ncurses_update_panels' => ['void'], -'ncurses_use_default_colors' => ['bool'], -'ncurses_use_env' => ['void', 'flag'=>'bool'], -'ncurses_use_extended_names' => ['int', 'flag'=>'bool'], -'ncurses_vidattr' => ['int', 'intarg'=>'int'], -'ncurses_vline' => ['int', 'charattr'=>'int', 'n'=>'int'], -'ncurses_waddch' => ['int', 'window'=>'resource', 'ch'=>'int'], -'ncurses_waddstr' => ['int', 'window'=>'resource', 'str'=>'string', 'n='=>'int'], -'ncurses_wattroff' => ['int', 'window'=>'resource', 'attrs'=>'int'], -'ncurses_wattron' => ['int', 'window'=>'resource', 'attrs'=>'int'], -'ncurses_wattrset' => ['int', 'window'=>'resource', 'attrs'=>'int'], -'ncurses_wborder' => ['int', 'window'=>'resource', 'left'=>'int', 'right'=>'int', 'top'=>'int', 'bottom'=>'int', 'tl_corner'=>'int', 'tr_corner'=>'int', 'bl_corner'=>'int', 'br_corner'=>'int'], -'ncurses_wclear' => ['int', 'window'=>'resource'], -'ncurses_wcolor_set' => ['int', 'window'=>'resource', 'color_pair'=>'int'], -'ncurses_werase' => ['int', 'window'=>'resource'], -'ncurses_wgetch' => ['int', 'window'=>'resource'], -'ncurses_whline' => ['int', 'window'=>'resource', 'charattr'=>'int', 'n'=>'int'], -'ncurses_wmouse_trafo' => ['bool', 'window'=>'resource', 'y'=>'int', 'x'=>'int', 'toscreen'=>'bool'], -'ncurses_wmove' => ['int', 'window'=>'resource', 'y'=>'int', 'x'=>'int'], -'ncurses_wnoutrefresh' => ['int', 'window'=>'resource'], -'ncurses_wrefresh' => ['int', 'window'=>'resource'], -'ncurses_wstandend' => ['int', 'window'=>'resource'], -'ncurses_wstandout' => ['int', 'window'=>'resource'], -'ncurses_wvline' => ['int', 'window'=>'resource', 'charattr'=>'int', 'n'=>'int'], -'net_get_interfaces' => ['array|false'], -'newrelic_add_custom_parameter' => ['bool', 'key'=>'string', 'value'=>''], -'newrelic_add_custom_tracer' => ['bool', 'function_name'=>'string'], -'newrelic_background_job' => ['void', 'flag='=>'bool'], -'newrelic_capture_params' => ['void', 'enable='=>'bool'], -'newrelic_custom_metric' => ['bool', 'metric_name'=>'string', 'value'=>'float'], -'newrelic_disable_autorum' => ['bool'], -'newrelic_end_of_transaction' => ['void'], -'newrelic_end_transaction' => ['bool', 'ignore='=>'bool'], -'newrelic_get_browser_timing_footer' => ['string', 'include_tags='=>'bool'], -'newrelic_get_browser_timing_header' => ['string', 'include_tags='=>'bool'], -'newrelic_ignore_apdex' => ['void'], -'newrelic_ignore_transaction' => ['void'], -'newrelic_name_transaction' => ['bool', 'name'=>'string'], -'newrelic_notice_error' => ['void', 'message'=>'string', 'exception='=>'Exception|Throwable'], -'newrelic_notice_error\'1' => ['void', 'unused_1'=>'string', 'message'=>'string', 'unused_2'=>'string', 'unused_3'=>'int', 'unused_4='=>''], -'newrelic_record_custom_event' => ['void', 'name'=>'string', 'attributes'=>'array'], -'newrelic_record_datastore_segment' => ['mixed', 'func'=>'callable', 'parameters'=>'array'], -'newrelic_set_appname' => ['bool', 'name'=>'string', 'license='=>'string', 'xmit='=>'bool'], -'newrelic_set_user_attributes' => ['bool', 'user'=>'string', 'account'=>'string', 'product'=>'string'], -'newrelic_start_transaction' => ['bool', 'appname'=>'string', 'license='=>'string'], -'newt_bell' => ['void'], -'newt_button' => ['resource', 'left'=>'int', 'top'=>'int', 'text'=>'string'], -'newt_button_bar' => ['resource', 'buttons'=>'array'], -'newt_centered_window' => ['int', 'width'=>'int', 'height'=>'int', 'title='=>'string'], -'newt_checkbox' => ['resource', 'left'=>'int', 'top'=>'int', 'text'=>'string', 'def_value'=>'string', 'seq='=>'string'], -'newt_checkbox_get_value' => ['string', 'checkbox'=>'resource'], -'newt_checkbox_set_flags' => ['void', 'checkbox'=>'resource', 'flags'=>'int', 'sense'=>'int'], -'newt_checkbox_set_value' => ['void', 'checkbox'=>'resource', 'value'=>'string'], -'newt_checkbox_tree' => ['resource', 'left'=>'int', 'top'=>'int', 'height'=>'int', 'flags='=>'int'], -'newt_checkbox_tree_add_item' => ['void', 'checkboxtree'=>'resource', 'text'=>'string', 'data'=>'mixed', 'flags'=>'int', 'index'=>'int', '...args='=>'int'], -'newt_checkbox_tree_find_item' => ['array', 'checkboxtree'=>'resource', 'data'=>'mixed'], -'newt_checkbox_tree_get_current' => ['mixed', 'checkboxtree'=>'resource'], -'newt_checkbox_tree_get_entry_value' => ['string', 'checkboxtree'=>'resource', 'data'=>'mixed'], -'newt_checkbox_tree_get_multi_selection' => ['array', 'checkboxtree'=>'resource', 'seqnum'=>'string'], -'newt_checkbox_tree_get_selection' => ['array', 'checkboxtree'=>'resource'], -'newt_checkbox_tree_multi' => ['resource', 'left'=>'int', 'top'=>'int', 'height'=>'int', 'seq'=>'string', 'flags='=>'int'], -'newt_checkbox_tree_set_current' => ['void', 'checkboxtree'=>'resource', 'data'=>'mixed'], -'newt_checkbox_tree_set_entry' => ['void', 'checkboxtree'=>'resource', 'data'=>'mixed', 'text'=>'string'], -'newt_checkbox_tree_set_entry_value' => ['void', 'checkboxtree'=>'resource', 'data'=>'mixed', 'value'=>'string'], -'newt_checkbox_tree_set_width' => ['void', 'checkbox_tree'=>'resource', 'width'=>'int'], -'newt_clear_key_buffer' => ['void'], -'newt_cls' => ['void'], -'newt_compact_button' => ['resource', 'left'=>'int', 'top'=>'int', 'text'=>'string'], -'newt_component_add_callback' => ['void', 'component'=>'resource', 'func_name'=>'mixed', 'data'=>'mixed'], -'newt_component_takes_focus' => ['void', 'component'=>'resource', 'takes_focus'=>'bool'], -'newt_create_grid' => ['resource', 'cols'=>'int', 'rows'=>'int'], -'newt_cursor_off' => ['void'], -'newt_cursor_on' => ['void'], -'newt_delay' => ['void', 'microseconds'=>'int'], -'newt_draw_form' => ['void', 'form'=>'resource'], -'newt_draw_root_text' => ['void', 'left'=>'int', 'top'=>'int', 'text'=>'string'], -'newt_entry' => ['resource', 'left'=>'int', 'top'=>'int', 'width'=>'int', 'init_value='=>'string', 'flags='=>'int'], -'newt_entry_get_value' => ['string', 'entry'=>'resource'], -'newt_entry_set' => ['void', 'entry'=>'resource', 'value'=>'string', 'cursor_at_end='=>'bool'], -'newt_entry_set_filter' => ['void', 'entry'=>'resource', 'filter'=>'callable', 'data'=>'mixed'], -'newt_entry_set_flags' => ['void', 'entry'=>'resource', 'flags'=>'int', 'sense'=>'int'], -'newt_finished' => ['int'], -'newt_form' => ['resource', 'vert_bar='=>'resource', 'help='=>'string', 'flags='=>'int'], -'newt_form_add_component' => ['void', 'form'=>'resource', 'component'=>'resource'], -'newt_form_add_components' => ['void', 'form'=>'resource', 'components'=>'array'], -'newt_form_add_hot_key' => ['void', 'form'=>'resource', 'key'=>'int'], -'newt_form_destroy' => ['void', 'form'=>'resource'], -'newt_form_get_current' => ['resource', 'form'=>'resource'], -'newt_form_run' => ['void', 'form'=>'resource', 'exit_struct'=>'array'], -'newt_form_set_background' => ['void', 'from'=>'resource', 'background'=>'int'], -'newt_form_set_height' => ['void', 'form'=>'resource', 'height'=>'int'], -'newt_form_set_size' => ['void', 'form'=>'resource'], -'newt_form_set_timer' => ['void', 'form'=>'resource', 'milliseconds'=>'int'], -'newt_form_set_width' => ['void', 'form'=>'resource', 'width'=>'int'], -'newt_form_watch_fd' => ['void', 'form'=>'resource', 'stream'=>'resource', 'flags='=>'int'], -'newt_get_screen_size' => ['void', 'cols'=>'int', 'rows'=>'int'], -'newt_grid_add_components_to_form' => ['void', 'grid'=>'resource', 'form'=>'resource', 'recurse'=>'bool'], -'newt_grid_basic_window' => ['resource', 'text'=>'resource', 'middle'=>'resource', 'buttons'=>'resource'], -'newt_grid_free' => ['void', 'grid'=>'resource', 'recurse'=>'bool'], -'newt_grid_get_size' => ['void', 'grid'=>'resource', 'width'=>'int', 'height'=>'int'], -'newt_grid_h_close_stacked' => ['resource', 'element1_type'=>'int', 'element1'=>'resource', '...args='=>'resource'], -'newt_grid_h_stacked' => ['resource', 'element1_type'=>'int', 'element1'=>'resource', '...args='=>'resource'], -'newt_grid_place' => ['void', 'grid'=>'resource', 'left'=>'int', 'top'=>'int'], -'newt_grid_set_field' => ['void', 'grid'=>'resource', 'col'=>'int', 'row'=>'int', 'type'=>'int', 'val'=>'resource', 'pad_left'=>'int', 'pad_top'=>'int', 'pad_right'=>'int', 'pad_bottom'=>'int', 'anchor'=>'int', 'flags='=>'int'], -'newt_grid_simple_window' => ['resource', 'text'=>'resource', 'middle'=>'resource', 'buttons'=>'resource'], -'newt_grid_v_close_stacked' => ['resource', 'element1_type'=>'int', 'element1'=>'resource', '...args='=>'resource'], -'newt_grid_v_stacked' => ['resource', 'element1_type'=>'int', 'element1'=>'resource', '...args='=>'resource'], -'newt_grid_wrapped_window' => ['void', 'grid'=>'resource', 'title'=>'string'], -'newt_grid_wrapped_window_at' => ['void', 'grid'=>'resource', 'title'=>'string', 'left'=>'int', 'top'=>'int'], -'newt_init' => ['int'], -'newt_label' => ['resource', 'left'=>'int', 'top'=>'int', 'text'=>'string'], -'newt_label_set_text' => ['void', 'label'=>'resource', 'text'=>'string'], -'newt_listbox' => ['resource', 'left'=>'int', 'top'=>'int', 'height'=>'int', 'flags='=>'int'], -'newt_listbox_append_entry' => ['void', 'listbox'=>'resource', 'text'=>'string', 'data'=>'mixed'], -'newt_listbox_clear' => ['void', 'listobx'=>'resource'], -'newt_listbox_clear_selection' => ['void', 'listbox'=>'resource'], -'newt_listbox_delete_entry' => ['void', 'listbox'=>'resource', 'key'=>'mixed'], -'newt_listbox_get_current' => ['string', 'listbox'=>'resource'], -'newt_listbox_get_selection' => ['array', 'listbox'=>'resource'], -'newt_listbox_insert_entry' => ['void', 'listbox'=>'resource', 'text'=>'string', 'data'=>'mixed', 'key'=>'mixed'], -'newt_listbox_item_count' => ['int', 'listbox'=>'resource'], -'newt_listbox_select_item' => ['void', 'listbox'=>'resource', 'key'=>'mixed', 'sense'=>'int'], -'newt_listbox_set_current' => ['void', 'listbox'=>'resource', 'num'=>'int'], -'newt_listbox_set_current_by_key' => ['void', 'listbox'=>'resource', 'key'=>'mixed'], -'newt_listbox_set_data' => ['void', 'listbox'=>'resource', 'num'=>'int', 'data'=>'mixed'], -'newt_listbox_set_entry' => ['void', 'listbox'=>'resource', 'num'=>'int', 'text'=>'string'], -'newt_listbox_set_width' => ['void', 'listbox'=>'resource', 'width'=>'int'], -'newt_listitem' => ['resource', 'left'=>'int', 'top'=>'int', 'text'=>'string', 'is_default'=>'bool', 'prev_item'=>'resource', 'data'=>'mixed', 'flags='=>'int'], -'newt_listitem_get_data' => ['mixed', 'item'=>'resource'], -'newt_listitem_set' => ['void', 'item'=>'resource', 'text'=>'string'], -'newt_open_window' => ['int', 'left'=>'int', 'top'=>'int', 'width'=>'int', 'height'=>'int', 'title='=>'string'], -'newt_pop_help_line' => ['void'], -'newt_pop_window' => ['void'], -'newt_push_help_line' => ['void', 'text='=>'string'], -'newt_radio_get_current' => ['resource', 'set_member'=>'resource'], -'newt_radiobutton' => ['resource', 'left'=>'int', 'top'=>'int', 'text'=>'string', 'is_default'=>'bool', 'prev_button='=>'resource'], -'newt_redraw_help_line' => ['void'], -'newt_reflow_text' => ['string', 'text'=>'string', 'width'=>'int', 'flex_down'=>'int', 'flex_up'=>'int', 'actual_width'=>'int', 'actual_height'=>'int'], -'newt_refresh' => ['void'], -'newt_resize_screen' => ['void', 'redraw='=>'bool'], -'newt_resume' => ['void'], -'newt_run_form' => ['resource', 'form'=>'resource'], -'newt_scale' => ['resource', 'left'=>'int', 'top'=>'int', 'width'=>'int', 'full_value'=>'int'], -'newt_scale_set' => ['void', 'scale'=>'resource', 'amount'=>'int'], -'newt_scrollbar_set' => ['void', 'scrollbar'=>'resource', 'where'=>'int', 'total'=>'int'], -'newt_set_help_callback' => ['void', 'function'=>'mixed'], -'newt_set_suspend_callback' => ['void', 'function'=>'callable', 'data'=>'mixed'], -'newt_suspend' => ['void'], -'newt_textbox' => ['resource', 'left'=>'int', 'top'=>'int', 'width'=>'int', 'height'=>'int', 'flags='=>'int'], -'newt_textbox_get_num_lines' => ['int', 'textbox'=>'resource'], -'newt_textbox_reflowed' => ['resource', 'left'=>'int', 'top'=>'int', 'text'=>'char', 'width'=>'int', 'flex_down'=>'int', 'flex_up'=>'int', 'flags='=>'int'], -'newt_textbox_set_height' => ['void', 'textbox'=>'resource', 'height'=>'int'], -'newt_textbox_set_text' => ['void', 'textbox'=>'resource', 'text'=>'string'], -'newt_vertical_scrollbar' => ['resource', 'left'=>'int', 'top'=>'int', 'height'=>'int', 'normal_colorset='=>'int', 'thumb_colorset='=>'int'], -'newt_wait_for_key' => ['void'], -'newt_win_choice' => ['int', 'title'=>'string', 'button1_text'=>'string', 'button2_text'=>'string', 'format'=>'string', 'args='=>'mixed', '...args='=>'mixed'], -'newt_win_entries' => ['int', 'title'=>'string', 'text'=>'string', 'suggested_width'=>'int', 'flex_down'=>'int', 'flex_up'=>'int', 'data_width'=>'int', 'items'=>'array', 'button1'=>'string', '...args='=>'string'], -'newt_win_menu' => ['int', 'title'=>'string', 'text'=>'string', 'suggestedwidth'=>'int', 'flexdown'=>'int', 'flexup'=>'int', 'maxlistheight'=>'int', 'items'=>'array', 'listitem'=>'int', 'button1='=>'string', '...args='=>'string'], -'newt_win_message' => ['void', 'title'=>'string', 'button_text'=>'string', 'format'=>'string', 'args='=>'mixed', '...args='=>'mixed'], -'newt_win_messagev' => ['void', 'title'=>'string', 'button_text'=>'string', 'format'=>'string', 'args'=>'array'], -'newt_win_ternary' => ['int', 'title'=>'string', 'button1_text'=>'string', 'button2_text'=>'string', 'button3_text'=>'string', 'format'=>'string', 'args='=>'mixed', '...args='=>'mixed'], -'next' => ['mixed', '&rw_array_arg'=>'array|object'], -'ngettext' => ['string', 'msgid1'=>'string', 'msgid2'=>'string', 'n'=>'int'], -'nl2br' => ['string', 'str'=>'string', 'is_xhtml='=>'bool'], -'nl_langinfo' => ['string', 'item'=>'int'], -'NoRewindIterator::__construct' => ['void', 'it'=>'iterator'], -'NoRewindIterator::current' => ['mixed'], -'NoRewindIterator::getInnerIterator' => ['iterator'], -'NoRewindIterator::key' => ['mixed'], -'NoRewindIterator::next' => ['void'], -'NoRewindIterator::rewind' => ['void'], -'NoRewindIterator::valid' => ['bool'], -'Normalizer::getRawDecomposition' => ['string|null', 'input'=>'string'], -'Normalizer::isNormalized' => ['bool', 'input'=>'string', 'form='=>'int'], -'Normalizer::normalize' => ['string', 'input'=>'string', 'form='=>'int'], -'normalizer_get_raw_decomposition' => ['string|null', 'input'=>'string'], -'normalizer_is_normalized' => ['bool', 'input'=>'string', 'form='=>'int'], -'normalizer_normalize' => ['string', 'input'=>'string', 'form='=>'int'], -'notes_body' => ['array', 'server'=>'string', 'mailbox'=>'string', 'msg_number'=>'int'], -'notes_copy_db' => ['bool', 'from_database_name'=>'string', 'to_database_name'=>'string'], -'notes_create_db' => ['bool', 'database_name'=>'string'], -'notes_create_note' => ['bool', 'database_name'=>'string', 'form_name'=>'string'], -'notes_drop_db' => ['bool', 'database_name'=>'string'], -'notes_find_note' => ['int', 'database_name'=>'string', 'name'=>'string', 'type='=>'string'], -'notes_header_info' => ['object', 'server'=>'string', 'mailbox'=>'string', 'msg_number'=>'int'], -'notes_list_msgs' => ['bool', 'db'=>'string'], -'notes_mark_read' => ['bool', 'database_name'=>'string', 'user_name'=>'string', 'note_id'=>'string'], -'notes_mark_unread' => ['bool', 'database_name'=>'string', 'user_name'=>'string', 'note_id'=>'string'], -'notes_nav_create' => ['bool', 'database_name'=>'string', 'name'=>'string'], -'notes_search' => ['array', 'database_name'=>'string', 'keywords'=>'string'], -'notes_unread' => ['array', 'database_name'=>'string', 'user_name'=>'string'], -'notes_version' => ['float', 'database_name'=>'string'], -'nsapi_request_headers' => ['array'], -'nsapi_response_headers' => ['array'], -'nsapi_virtual' => ['bool', 'uri'=>'string'], -'nthmac' => ['string', 'clent'=>'string', 'data'=>'string'], -'number_format' => ['string', 'number'=>'float', 'num_decimal_places='=>'int'], -'number_format\'1' => ['string', 'number'=>'float', 'num_decimal_places'=>'int', 'dec_separator'=>'string', 'thousands_separator'=>'string'], -'NumberFormatter::__construct' => ['void', 'locale'=>'string', 'style'=>'int', 'pattern='=>'string'], -'NumberFormatter::create' => ['NumberFormatter', 'locale'=>'string', 'style'=>'int', 'pattern='=>'string'], -'NumberFormatter::format' => ['string', 'num'=>'', 'type='=>'int'], -'NumberFormatter::formatCurrency' => ['string', 'num'=>'float', 'currency'=>'string'], -'NumberFormatter::getAttribute' => ['int', 'attr'=>'int'], -'NumberFormatter::getErrorCode' => ['int'], -'NumberFormatter::getErrorMessage' => ['string'], -'NumberFormatter::getLocale' => ['string', 'type='=>'int'], -'NumberFormatter::getPattern' => ['string'], -'NumberFormatter::getSymbol' => ['string', 'attr'=>'int'], -'NumberFormatter::getTextAttribute' => ['string', 'attr'=>'int'], -'NumberFormatter::parse' => ['float|false', 'str'=>'string', 'type='=>'int', '&rw_position='=>'int'], -'NumberFormatter::parseCurrency' => ['float', 'str'=>'string', '&w_currency'=>'string', '&rw_position='=>'int'], -'NumberFormatter::setAttribute' => ['bool', 'attr'=>'int', 'value'=>''], -'NumberFormatter::setPattern' => ['bool', 'pattern'=>'string'], -'NumberFormatter::setSymbol' => ['bool', 'attr'=>'int', 'symbol'=>'string'], -'NumberFormatter::setTextAttribute' => ['bool', 'attr'=>'int', 'value'=>'string'], -'numfmt_create' => ['NumberFormatter', 'locale'=>'string', 'style'=>'int', 'pattern='=>'string'], -'numfmt_format' => ['string', 'fmt'=>'numberformatter', 'value='=>'float', 'type='=>'int'], -'numfmt_format_currency' => ['string|false', 'fmt'=>'numberformatter', 'value'=>'float', 'currency'=>'string'], -'numfmt_get_attribute' => ['int', 'fmt'=>'numberformatter', 'attr'=>'int'], -'numfmt_get_error_code' => ['int', 'fmt'=>'numberformatter'], -'numfmt_get_error_message' => ['string', 'fmt'=>'numberformatter'], -'numfmt_get_locale' => ['string', 'fmt'=>'numberformatter', 'type='=>'int'], -'numfmt_get_pattern' => ['string', 'fmt'=>'numberformatter'], -'numfmt_get_symbol' => ['string', 'fmt'=>'numberformatter', 'attr'=>'int'], -'numfmt_get_text_attribute' => ['string', 'fmt'=>'numberformatter', 'attr'=>'int'], -'numfmt_parse' => ['float|false', 'fmt'=>'numberformatter', 'value'=>'string', 'type='=>'int', '&rw_position='=>'int'], -'numfmt_parse_currency' => ['float|false', 'fmt'=>'numberformatter', 'value'=>'string', '&w_currency'=>'string', '&rw_position='=>'int'], -'numfmt_set_attribute' => ['bool', 'fmt'=>'numberformatter', 'attr'=>'int', 'value'=>'int'], -'numfmt_set_pattern' => ['bool', 'fmt'=>'numberformatter', 'pattern'=>'string'], -'numfmt_set_symbol' => ['bool', 'fmt'=>'numberformatter', 'attr'=>'int', 'value'=>'string'], -'numfmt_set_text_attribute' => ['bool', 'fmt'=>'numberformatter', 'attr'=>'int', 'value'=>'string'], -'OAuth::__construct' => ['void', 'consumer_key'=>'string', 'consumer_secret'=>'string', 'signature_method='=>'string', 'auth_type='=>'int'], -'OAuth::__destruct' => [''], -'OAuth::disableDebug' => ['bool'], -'OAuth::disableRedirects' => ['bool'], -'OAuth::disableSSLChecks' => ['bool'], -'OAuth::enableDebug' => ['bool'], -'OAuth::enableRedirects' => ['bool'], -'OAuth::enableSSLChecks' => ['bool'], -'OAuth::fetch' => ['mixed', 'protected_resource_url'=>'string', 'extra_parameters='=>'array', 'http_method='=>'string', 'http_headers='=>'array'], -'OAuth::generateSignature' => ['string', 'http_method'=>'string', 'url'=>'string', 'extra_parameters='=>'mixed'], -'OAuth::getAccessToken' => ['array|false', 'access_token_url'=>'string', 'auth_session_handle='=>'string', 'verifier_token='=>'string'], -'OAuth::getCAPath' => ['array'], -'OAuth::getLastResponse' => ['string'], -'OAuth::getLastResponseHeaders' => ['string|false'], -'OAuth::getLastResponseInfo' => ['array'], -'OAuth::getRequestHeader' => ['string|false', 'http_method'=>'string', 'url'=>'string', 'extra_parameters='=>'mixed'], -'OAuth::getRequestToken' => ['array|false', 'request_token_url'=>'string', 'callback_url='=>'string'], -'OAuth::setAuthType' => ['bool', 'auth_type'=>'int'], -'OAuth::setCAPath' => ['mixed', 'ca_path='=>'string', 'ca_info='=>'string'], -'OAuth::setNonce' => ['mixed', 'nonce'=>'string'], -'OAuth::setRequestEngine' => ['void', 'reqengine'=>'int'], -'OAuth::setRSACertificate' => ['mixed', 'cert'=>'string'], -'OAuth::setSSLChecks' => ['bool', 'sslcheck'=>'int'], -'OAuth::setTimestamp' => ['mixed', 'timestamp'=>'string'], -'OAuth::setToken' => ['bool', 'token'=>'string', 'token_secret'=>'string'], -'OAuth::setVersion' => ['bool', 'version'=>'string'], -'oauth_get_sbs' => ['string', 'http_method'=>'string', 'uri'=>'string', 'request_parameters='=>'array'], -'oauth_urlencode' => ['string', 'uri'=>'string'], -'OAuthProvider::__construct' => ['void', 'params_array='=>'array'], -'OAuthProvider::addRequiredParameter' => ['bool', 'req_params'=>'string'], -'OAuthProvider::callconsumerHandler' => ['void'], -'OAuthProvider::callTimestampNonceHandler' => ['void'], -'OAuthProvider::calltokenHandler' => ['void'], -'OAuthProvider::checkOAuthRequest' => ['void', 'uri='=>'string', 'method='=>'string'], -'OAuthProvider::consumerHandler' => ['void', 'callback_function'=>'callable'], -'OAuthProvider::generateToken' => ['string', 'size'=>'int', 'strong='=>'bool'], -'OAuthProvider::is2LeggedEndpoint' => ['void', 'params_array'=>'mixed'], -'OAuthProvider::isRequestTokenEndpoint' => ['void', 'will_issue_request_token'=>'bool'], -'OAuthProvider::removeRequiredParameter' => ['bool', 'req_params'=>'string'], -'OAuthProvider::reportProblem' => ['string', 'oauthexception'=>'string', 'send_headers='=>'bool'], -'OAuthProvider::setParam' => ['bool', 'param_key'=>'string', 'param_val='=>'mixed'], -'OAuthProvider::setRequestTokenPath' => ['bool', 'path'=>'string'], -'OAuthProvider::timestampNonceHandler' => ['void', 'callback_function'=>'callable'], -'OAuthProvider::tokenHandler' => ['void', 'callback_function'=>'callable'], -'ob_clean' => ['bool'], -'ob_deflatehandler' => ['string', 'data'=>'string', 'mode'=>'int'], -'ob_end_clean' => ['bool'], -'ob_end_flush' => ['bool'], -'ob_etaghandler' => ['string', 'data'=>'string', 'mode'=>'int'], -'ob_flush' => ['bool'], -'ob_get_clean' => ['string|false'], -'ob_get_contents' => ['string|false'], -'ob_get_flush' => ['string|false'], -'ob_get_length' => ['int|false'], -'ob_get_level' => ['int'], -'ob_get_status' => ['array', 'full_status='=>'bool'], -'ob_gzhandler' => ['string|false', 'data'=>'string', 'flags'=>'int'], -'ob_iconv_handler' => ['string', 'contents'=>'string', 'status'=>'int'], -'ob_implicit_flush' => ['void', 'flag='=>'int'], -'ob_inflatehandler' => ['string', 'data'=>'string', 'mode'=>'int'], -'ob_list_handlers' => ['false|array'], -'ob_start' => ['bool', 'user_function='=>'string|array|callable|null', 'chunk_size='=>'int', 'flags='=>'int'], -'ob_tidyhandler' => ['string', 'input'=>'string', 'mode='=>'int'], -'OCI-Collection::assignElem' => ['bool', 'index'=>'int', 'value'=>''], -'OCI-Collection::getElem' => ['', 'index'=>'int'], -'OCI-Lob::append' => ['bool', 'lob_from'=>'OCI-Lob'], -'OCI-Lob::close' => ['bool'], -'OCI-Lob::eof' => ['bool'], -'OCI-Lob::erase' => ['int', 'offset='=>'int', 'length='=>'int'], -'OCI-Lob::export' => ['bool', 'filename'=>'string', 'start='=>'int', 'length='=>'int'], -'OCI-Lob::flush' => ['bool', 'flag='=>'int'], -'OCI-Lob::free' => ['bool'], -'OCI-Lob::getBuffering' => ['bool'], -'OCI-Lob::import' => ['bool', 'filename'=>'string'], -'OCI-Lob::load' => ['string'], -'OCI-Lob::read' => ['string', 'length'=>'int'], -'OCI-Lob::rewind' => ['bool'], -'OCI-Lob::save' => ['bool', 'data'=>'string', 'offset='=>'int'], -'OCI-Lob::seek' => ['bool', 'offset'=>'int', 'whence='=>'int'], -'OCI-Lob::setBuffering' => ['bool', 'on_off'=>'bool'], -'OCI-Lob::size' => ['int'], -'OCI-Lob::tell' => ['int'], -'OCI-Lob::truncate' => ['bool', 'length='=>'int'], -'OCI-Lob::write' => ['int', 'data'=>'string', 'length='=>'int'], -'OCI-Lob::writeTemporary' => ['bool', 'data'=>'string', 'lob_type='=>'int'], -'oci_bind_array_by_name' => ['bool', 'stmt'=>'resource', 'name'=>'string', '&rw_var'=>'array', 'max_table_length'=>'int', 'max_item_length='=>'int', 'type='=>'int'], -'oci_bind_by_name' => ['bool', 'stmt'=>'resource', 'name'=>'string', '&rw_var'=>'mixed', 'maxlength='=>'int', 'type='=>'int'], -'oci_cancel' => ['bool', 'stmt'=>'resource'], -'oci_client_version' => ['string'], -'oci_close' => ['bool', 'connection'=>'resource'], -'OCI-Collection::append' => ['bool', 'value'=>'mixed'], -'OCI-Collection::assign' => ['bool', 'from'=>'OCI-Collection'], -'OCI-Collection::assignelem' => ['bool', 'index'=>'int', 'value'=>'mixed'], -'OCI-Collection::free' => ['bool'], -'OCI-Collection::getelem' => ['mixed', 'index'=>'int'], -'OCI-Collection::max' => ['int'], -'OCI-Collection::size' => ['int'], -'OCI-Collection::trim' => ['bool', 'num'=>'int'], -'oci_collection_append' => ['bool', 'value'=>'string'], -'oci_collection_assign' => ['bool', 'from'=>'OCI-Collection'], -'oci_collection_element_assign' => ['bool', 'index'=>'int', 'val'=>'string'], -'oci_collection_element_get' => ['string', 'ndx'=>'int'], -'oci_collection_max' => ['int'], -'oci_collection_size' => ['int'], -'oci_collection_trim' => ['bool', 'num'=>'int'], -'oci_commit' => ['bool', 'connection'=>'resource'], -'oci_connect' => ['resource|false', 'user'=>'string', 'pass'=>'string', 'db='=>'string', 'charset='=>'string', 'session_mode='=>'int'], -'oci_define_by_name' => ['bool', 'stmt'=>'resource', 'name'=>'string', '&w_var'=>'mixed', 'type='=>'int'], -'oci_error' => ['array|false', 'resource='=>'resource'], -'oci_execute' => ['bool', 'stmt'=>'resource', 'mode='=>'int'], -'oci_fetch' => ['bool', 'stmt'=>'resource'], -'oci_fetch_all' => ['int|false', 'stmt'=>'resource', '&w_output'=>'array', 'skip='=>'int', 'maxrows='=>'int', 'flags='=>'int'], -'oci_fetch_array' => ['array|false', 'stmt'=>'resource', 'mode='=>'int'], -'oci_fetch_assoc' => ['array|false', 'stmt'=>'resource'], -'oci_fetch_object' => ['object|false', 'stmt'=>'resource'], -'oci_fetch_row' => ['array|false', 'stmt'=>'resource'], -'oci_field_is_null' => ['bool', 'stmt'=>'resource', 'col'=>'mixed'], -'oci_field_name' => ['string|false', 'stmt'=>'resource', 'col'=>'mixed'], -'oci_field_precision' => ['int|false', 'stmt'=>'resource', 'col'=>'mixed'], -'oci_field_scale' => ['int|false', 'stmt'=>'resource', 'col'=>'mixed'], -'oci_field_size' => ['int|false', 'stmt'=>'resource', 'col'=>'mixed'], -'oci_field_type' => ['mixed', 'stmt'=>'resource', 'col'=>'mixed'], -'oci_field_type_raw' => ['int|false', 'stmt'=>'resource', 'col'=>'mixed'], -'oci_free_collection' => ['bool'], -'oci_free_cursor' => ['bool', 'stmt'=>'resource'], -'oci_free_descriptor' => ['bool'], -'oci_free_statement' => ['bool', 'stmt'=>'resource'], -'oci_get_implicit' => ['bool', 'stmt'=>''], -'oci_get_implicit_resultset' => ['resource|false', 'statement'=>'resource'], -'oci_internal_debug' => ['void', 'onoff'=>'bool'], -'OCI-Lob::getbuffering' => ['bool'], -'OCI-Lob::savefile' => ['bool', 'filename'=>''], -'OCI-Lob::setbuffering' => ['bool', 'on_off'=>'bool'], -'OCI-Lob::writetofile' => ['bool', 'filename'=>'', 'start'=>'', 'length'=>''], -'oci_lob_append' => ['bool', 'lob'=>'OCI-Lob'], -'oci_lob_close' => ['bool'], -'oci_lob_copy' => ['bool', 'lob_to'=>'OCI-Lob', 'lob_from'=>'OCI-Lob', 'length='=>'int'], -'oci_lob_eof' => ['bool'], -'oci_lob_erase' => ['int', 'offset'=>'int', 'length'=>'int'], -'oci_lob_export' => ['bool', 'filename'=>'string', 'start'=>'int', 'length'=>'int'], -'oci_lob_flush' => ['bool', 'flag'=>'int'], -'oci_lob_import' => ['bool', 'filename'=>'string'], -'oci_lob_is_equal' => ['bool', 'lob1'=>'OCI-Lob', 'lob2'=>'OCI-Lob'], -'oci_lob_load' => ['string'], -'oci_lob_read' => ['string', 'length'=>'int'], -'oci_lob_rewind' => ['bool'], -'oci_lob_save' => ['bool', 'data'=>'string', 'offset'=>'int'], -'oci_lob_seek' => ['bool', 'offset'=>'int', 'whence'=>'int'], -'oci_lob_size' => ['int'], -'oci_lob_tell' => ['int'], -'oci_lob_truncate' => ['bool', 'length'=>'int'], -'oci_lob_write' => ['int', 'string'=>'string', 'length'=>'int'], -'oci_lob_write_temporary' => ['bool', 'var'=>'string', 'lob_type'=>'int'], -'oci_new_collection' => ['OCI-Collection|false', 'connection'=>'resource', 'tdo'=>'string', 'schema='=>'string'], -'oci_new_connect' => ['resource|false', 'user'=>'string', 'pass'=>'string', 'db='=>'string', 'charset='=>'string', 'session_mode='=>'int'], -'oci_new_cursor' => ['resource|false', 'connection'=>'resource'], -'oci_new_descriptor' => ['OCI-Lob|false', 'connection'=>'resource', 'type='=>'int'], -'oci_num_fields' => ['int|false', 'stmt'=>'resource'], -'oci_num_rows' => ['int|false', 'stmt'=>'resource'], -'oci_parse' => ['resource|false', 'connection'=>'resource', 'statement'=>'string'], -'oci_password_change' => ['bool', 'connection'=>'', 'username'=>'string', 'old_password'=>'string', 'new_password'=>'string'], -'oci_pconnect' => ['resource|false', 'user'=>'string', 'pass'=>'string', 'db='=>'string', 'charset='=>'string', 'session_mode='=>'int'], -'oci_register_taf_callback' => ['bool', 'connection'=>'resource', 'callback='=>'callable'], -'oci_result' => ['string|false', 'stmt'=>'resource', 'column'=>'mixed'], -'oci_rollback' => ['bool', 'connection'=>'resource'], -'oci_server_version' => ['string|false', 'connection'=>'resource'], -'oci_set_action' => ['bool', 'connection'=>'resource', 'value'=>'string'], -'oci_set_client_identifier' => ['bool', 'connection'=>'resource', 'value'=>'string'], -'oci_set_client_info' => ['bool', 'connection'=>'resource', 'value'=>'string'], -'oci_set_db_operation' => ['bool', 'connection'=>'resource', 'value'=>'string'], -'oci_set_edition' => ['bool', 'value'=>'string'], -'oci_set_module_name' => ['bool', 'connection'=>'resource', 'value'=>'string'], -'oci_set_prefetch' => ['bool', 'stmt'=>'resource', 'prefetch_rows'=>'int'], -'oci_statement_type' => ['string|false', 'stmt'=>'resource'], -'oci_unregister_taf_callback' => ['bool', 'connection'=>'resource'], -'ocifetchinto' => ['int', 'stmt'=>'', '&w_output'=>'array', 'mode='=>'int'], -'ocigetbufferinglob' => ['bool'], -'ocisetbufferinglob' => ['bool', 'flag'=>'bool'], -'octdec' => ['int', 'octal_number'=>'string'], -'odbc_autocommit' => ['mixed', 'connection_id'=>'resource', 'onoff='=>'bool'], -'odbc_binmode' => ['bool', 'result_id'=>'int', 'mode'=>'int'], -'odbc_close' => ['void', 'connection_id'=>'resource'], -'odbc_close_all' => ['void'], -'odbc_columnprivileges' => ['resource', 'connection_id'=>'resource', 'catalog'=>'string', 'schema'=>'string', 'table'=>'string', 'column'=>'string'], -'odbc_columns' => ['resource', 'connection_id'=>'resource', 'qualifier='=>'string', 'owner='=>'string', 'table_name='=>'string', 'column_name='=>'string'], -'odbc_commit' => ['bool', 'connection_id'=>'resource'], -'odbc_connect' => ['resource', 'dsn'=>'string', 'user'=>'string', 'password'=>'string', 'cursor_option='=>'int'], -'odbc_cursor' => ['string', 'result_id'=>'resource'], -'odbc_data_source' => ['array', 'connection_id'=>'resource', 'fetch_type'=>'int'], -'odbc_do' => ['resource', 'connection_id'=>'resource', 'query'=>'string', 'flags='=>'int'], -'odbc_error' => ['string', 'connection_id='=>'resource'], -'odbc_errormsg' => ['string', 'connection_id='=>'resource'], -'odbc_exec' => ['resource', 'connection_id'=>'resource', 'query'=>'string', 'flags='=>'int'], -'odbc_execute' => ['bool', 'result_id'=>'resource', 'parameters_array='=>'array'], -'odbc_fetch_array' => ['array', 'result'=>'resource', 'rownumber='=>'int'], -'odbc_fetch_into' => ['int', 'result_id'=>'resource', '&w_result_array'=>'array', 'rownumber='=>'int'], -'odbc_fetch_object' => ['object', 'result'=>'int', 'rownumber='=>'int'], -'odbc_fetch_row' => ['bool', 'result_id'=>'resource', 'row_number='=>'int'], -'odbc_field_len' => ['int', 'result_id'=>'resource', 'field_number'=>'int'], -'odbc_field_name' => ['string', 'result_id'=>'resource', 'field_number'=>'int'], -'odbc_field_num' => ['int', 'result_id'=>'resource', 'field_name'=>'string'], -'odbc_field_precision' => ['int', 'result_id'=>'resource', 'field_number'=>'int'], -'odbc_field_scale' => ['int', 'result_id'=>'resource', 'field_number'=>'int'], -'odbc_field_type' => ['string', 'result_id'=>'resource', 'field_number'=>'int'], -'odbc_foreignkeys' => ['resource', 'connection_id'=>'resource', 'pk_qualifier'=>'string', 'pk_owner'=>'string', 'pk_table'=>'string', 'fk_qualifier'=>'string', 'fk_owner'=>'string', 'fk_table'=>'string'], -'odbc_free_result' => ['bool', 'result_id'=>'resource'], -'odbc_gettypeinfo' => ['resource', 'connection_id'=>'resource', 'data_type='=>'int'], -'odbc_longreadlen' => ['bool', 'result_id'=>'resource', 'length'=>'int'], -'odbc_next_result' => ['bool', 'result_id'=>'resource'], -'odbc_num_fields' => ['int', 'result_id'=>'resource'], -'odbc_num_rows' => ['int', 'result_id'=>'resource'], -'odbc_pconnect' => ['resource', 'dsn'=>'string', 'user'=>'string', 'password'=>'string', 'cursor_option='=>'int'], -'odbc_prepare' => ['resource', 'connection_id'=>'resource', 'query'=>'string'], -'odbc_primarykeys' => ['resource', 'connection_id'=>'resource', 'qualifier'=>'string', 'owner'=>'string', 'table'=>'string'], -'odbc_procedurecolumns' => ['resource', 'connection_id'=>'', 'qualifier'=>'string', 'owner'=>'string', 'proc'=>'string', 'column'=>'string'], -'odbc_procedures' => ['resource', 'connection_id'=>'', 'qualifier'=>'string', 'owner'=>'string', 'name'=>'string'], -'odbc_result' => ['mixed', 'result_id'=>'resource', 'field'=>'mixed'], -'odbc_result_all' => ['int', 'result_id'=>'resource', 'format='=>'string'], -'odbc_rollback' => ['bool', 'connection_id'=>'resource'], -'odbc_setoption' => ['bool', 'result_id'=>'resource', 'which'=>'int', 'option'=>'int', 'value'=>'int'], -'odbc_specialcolumns' => ['resource', 'connection_id'=>'resource', 'type'=>'int', 'qualifier'=>'string', 'owner'=>'string', 'table'=>'string', 'scope'=>'int', 'nullable'=>'int'], -'odbc_statistics' => ['resource', 'connection_id'=>'resource', 'qualifier'=>'string', 'owner'=>'string', 'name'=>'string', 'unique'=>'int', 'accuracy'=>'int'], -'odbc_tableprivileges' => ['resource', 'connection_id'=>'resource', 'qualifier'=>'string', 'owner'=>'string', 'name'=>'string'], -'odbc_tables' => ['resource', 'connection_id'=>'resource', 'qualifier='=>'string', 'owner='=>'string', 'name='=>'string', 'table_types='=>'string'], -'opcache_compile_file' => ['bool', 'file'=>'string'], -'opcache_get_configuration' => ['array'], -'opcache_get_status' => ['array|false', 'get_scripts='=>'bool'], -'opcache_invalidate' => ['bool', 'script'=>'string', 'force='=>'bool'], -'opcache_is_script_cached' => ['bool', 'script'=>'string'], -'opcache_reset' => ['bool'], -'openal_buffer_create' => ['resource'], -'openal_buffer_data' => ['bool', 'buffer'=>'resource', 'format'=>'int', 'data'=>'string', 'freq'=>'int'], -'openal_buffer_destroy' => ['bool', 'buffer'=>'resource'], -'openal_buffer_get' => ['int', 'buffer'=>'resource', 'property'=>'int'], -'openal_buffer_loadwav' => ['bool', 'buffer'=>'resource', 'wavfile'=>'string'], -'openal_context_create' => ['resource', 'device'=>'resource'], -'openal_context_current' => ['bool', 'context'=>'resource'], -'openal_context_destroy' => ['bool', 'context'=>'resource'], -'openal_context_process' => ['bool', 'context'=>'resource'], -'openal_context_suspend' => ['bool', 'context'=>'resource'], -'openal_device_close' => ['bool', 'device'=>'resource'], -'openal_device_open' => ['resource', 'device_desc='=>'string'], -'openal_listener_get' => ['mixed', 'property'=>'int'], -'openal_listener_set' => ['bool', 'property'=>'int', 'setting'=>'mixed'], -'openal_source_create' => ['resource'], -'openal_source_destroy' => ['bool', 'source'=>'resource'], -'openal_source_get' => ['mixed', 'source'=>'resource', 'property'=>'int'], -'openal_source_pause' => ['bool', 'source'=>'resource'], -'openal_source_play' => ['bool', 'source'=>'resource'], -'openal_source_rewind' => ['bool', 'source'=>'resource'], -'openal_source_set' => ['bool', 'source'=>'resource', 'property'=>'int', 'setting'=>'mixed'], -'openal_source_stop' => ['bool', 'source'=>'resource'], -'openal_stream' => ['resource', 'source'=>'resource', 'format'=>'int', 'rate'=>'int'], -'opendir' => ['resource|false', 'path'=>'string', 'context='=>'resource'], -'openlog' => ['bool', 'ident'=>'string', 'option'=>'int', 'facility'=>'int'], -'openssl_cipher_iv_length' => ['int|false', 'method'=>'string'], -'openssl_csr_export' => ['bool', 'csr'=>'string|resource', '&w_out'=>'string', 'notext='=>'bool'], -'openssl_csr_export_to_file' => ['bool', 'csr'=>'string|resource', 'outfilename'=>'string', 'notext='=>'bool'], -'openssl_csr_get_public_key' => ['resource|false', 'csr'=>'string|resource', 'use_shortnames='=>'bool'], -'openssl_csr_get_subject' => ['array|false', 'csr'=>'string|resource', 'use_shortnames='=>'bool'], -'openssl_csr_new' => ['resource|false', 'dn'=>'array', '&w_privkey'=>'resource', 'configargs='=>'array', 'extraattribs='=>'array'], -'openssl_csr_sign' => ['resource|false', 'csr'=>'string|resource', 'x509'=>'string|resource|null', 'priv_key'=>'string|resource|array', 'days'=>'int', 'config_args='=>'array', 'serial='=>'int'], -'openssl_decrypt' => ['string|false', 'data'=>'string', 'method'=>'string', 'key'=>'string', 'options='=>'int', 'iv='=>'string', 'tag='=>'string', 'aad='=>'string'], -'openssl_dh_compute_key' => ['string|false', 'pub_key'=>'string', 'dh_key'=>'resource'], -'openssl_digest' => ['string|false', 'data'=>'string', 'method'=>'string', 'raw_output='=>'bool'], -'openssl_encrypt' => ['string|false', 'data'=>'string', 'method'=>'string', 'key'=>'string', 'options='=>'int', 'iv='=>'string', '&w_tag='=>'string', 'aad='=>'string', 'tag_length='=>'int'], -'openssl_error_string' => ['string|false'], -'openssl_free_key' => ['void', 'key_identifier'=>'resource'], -'openssl_get_cert_locations' => ['array'], -'openssl_get_cipher_methods' => ['array', 'aliases='=>'bool'], -'openssl_get_curve_names' => ['array'], -'openssl_get_md_methods' => ['array', 'aliases='=>'bool'], -'openssl_get_privatekey' => ['resource|false', 'key'=>'string', 'passphrase='=>'string'], -'openssl_get_publickey' => ['resource|false', 'cert'=>'resource|string'], -'openssl_open' => ['bool', 'sealed_data'=>'string', '&w_open_data'=>'string', 'env_key'=>'string', 'priv_key_id'=>'string|array|resource', 'method='=>'string', 'iv='=>'string'], -'openssl_pbkdf2' => ['string|false', 'password'=>'string', 'salt'=>'string', 'key_length'=>'int', 'iterations'=>'int', 'digest_algorithm'=>'string'], -'openssl_pkcs12_export' => ['bool', 'x509'=>'string|resource', '&w_out'=>'string', 'priv_key'=>'string|array|resource', 'pass'=>'string', 'args='=>'array'], -'openssl_pkcs12_export_to_file' => ['bool', 'x509'=>'string|resource', 'filename'=>'string', 'priv_key'=>'string|array|resource', 'pass'=>'string', 'args='=>'array'], -'openssl_pkcs12_read' => ['bool', 'pkcs12'=>'string', '&w_certs'=>'array', 'pass'=>'string'], -'openssl_pkcs7_decrypt' => ['bool', 'infilename'=>'string', 'outfilename'=>'string', 'recipcert'=>'string|resource', 'recipkey='=>'string|resource|array'], -'openssl_pkcs7_encrypt' => ['bool', 'infile'=>'string', 'outfile'=>'string', 'recipcerts'=>'string|resource|array', 'headers'=>'array', 'flags='=>'int', 'cipherid='=>'int'], -'openssl_pkcs7_read' => ['bool', 'infilename'=>'string', '&w_certs'=>'array'], -'openssl_pkcs7_sign' => ['bool', 'infile'=>'string', 'outfile'=>'string', 'signcert'=>'string|resource', 'privkey'=>'string|resource|array', 'headers'=>'array', 'flags='=>'int', 'extracerts='=>'string'], -'openssl_pkcs7_verify' => ['bool|int', 'filename'=>'string', 'flags'=>'int', 'outfilename='=>'string', 'cainfo='=>'array', 'extracerts='=>'string', 'content='=>'string', 'p7bfilename='=>'string'], -'openssl_pkey_derive' => ['string|false', 'pub_key'=>'resource', 'priv_key'=>'resource', 'keylen='=>'int'], -'openssl_pkey_export' => ['bool', 'key'=>'resource', '&w_out'=>'string', 'passphrase='=>'string', 'configargs='=>'array'], -'openssl_pkey_export_to_file' => ['bool', 'key'=>'resource|string|array', 'outfilename'=>'string', 'passphrase='=>'string', 'configargs='=>'array'], -'openssl_pkey_free' => ['void', 'key'=>'resource'], -'openssl_pkey_get_details' => ['array|false', 'key'=>'resource'], -'openssl_pkey_get_private' => ['resource|false', 'key'=>'string', 'passphrase='=>'string'], -'openssl_pkey_get_public' => ['resource|false', 'certificate'=>'resource|string'], -'openssl_pkey_new' => ['resource|false', 'configargs='=>'array'], -'openssl_private_decrypt' => ['bool', 'data'=>'string', '&w_decrypted'=>'string', 'key'=>'string|resource|array', 'padding='=>'int'], -'openssl_private_encrypt' => ['bool', 'data'=>'string', '&w_crypted'=>'string', 'key'=>'string|resource|array', 'padding='=>'int'], -'openssl_public_decrypt' => ['bool', 'data'=>'string', '&w_decrypted'=>'string', 'key'=>'string|resource', 'padding='=>'int'], -'openssl_public_encrypt' => ['bool', 'data'=>'string', '&w_crypted'=>'string', 'key'=>'string|resource', 'padding='=>'int'], -'openssl_random_pseudo_bytes' => ['string|false', 'length'=>'int', '&w_crypto_strong='=>'bool'], -'openssl_seal' => ['int|false', 'data'=>'string', '&w_sealed_data'=>'string', '&rw_env_keys'=>'array', 'pub_key_ids'=>'array', 'method='=>'string'], -'openssl_sign' => ['bool', 'data'=>'string', '&w_signature'=>'string', 'priv_key_id'=>'resource|string', 'signature_alg='=>'int|string'], -'openssl_spki_export' => ['string|null', 'spkac'=>'string'], -'openssl_spki_export_challenge' => ['string|null', 'spkac'=>'string'], -'openssl_spki_new' => ['string|null', 'privkey'=>'resource', 'challenge'=>'string', 'algorithm='=>'int'], -'openssl_spki_verify' => ['bool', 'spkac'=>'string'], -'openssl_verify' => ['int', 'data'=>'string', 'signature'=>'string', 'pub_key_id'=>'resource|string', 'signature_alg='=>'int|string'], -'openssl_x509_check_private_key' => ['bool', 'cert'=>'string|resource', 'key'=>'string|resource|array'], -'openssl_x509_checkpurpose' => ['bool|int', 'x509cert'=>'string|resource', 'purpose'=>'int', 'cainfo='=>'array', 'untrustedfile='=>'string'], -'openssl_x509_export' => ['bool', 'x509'=>'string|resource', '&w_output'=>'string', 'notext='=>'bool'], -'openssl_x509_export_to_file' => ['bool', 'x509'=>'string|resource', 'outfilename'=>'string', 'notext='=>'bool'], -'openssl_x509_fingerprint' => ['string|false', 'x509'=>'string|resource', 'hash_algorithm='=>'string', 'raw_output='=>'bool'], -'openssl_x509_free' => ['void', 'x509'=>'resource'], -'openssl_x509_parse' => ['array|false', 'x509cert'=>'string|resource', 'shortnames='=>'bool'], -'openssl_x509_read' => ['resource|false', 'x509certdata'=>'string|resource'], -'ord' => ['int', 'character'=>'string'], -'OuterIterator::getInnerIterator' => ['Iterator'], -'OutOfBoundsException::__clone' => ['void'], -'OutOfBoundsException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'(?Throwable)|(?OutOfBoundsException)'], -'OutOfBoundsException::__toString' => ['string'], -'OutOfBoundsException::getCode' => ['int'], -'OutOfBoundsException::getFile' => ['string'], -'OutOfBoundsException::getLine' => ['int'], -'OutOfBoundsException::getMessage' => ['string'], -'OutOfBoundsException::getPrevious' => ['Throwable|OutOfBoundsException|null'], -'OutOfBoundsException::getTrace' => ['array'], -'OutOfBoundsException::getTraceAsString' => ['string'], -'OutOfRangeException::__clone' => ['void'], -'OutOfRangeException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'(?Throwable)|(?OutOfRangeException)'], -'OutOfRangeException::__toString' => ['string'], -'OutOfRangeException::getCode' => ['int'], -'OutOfRangeException::getFile' => ['string'], -'OutOfRangeException::getLine' => ['int'], -'OutOfRangeException::getMessage' => ['string'], -'OutOfRangeException::getPrevious' => ['Throwable|OutOfRangeException|null'], -'OutOfRangeException::getTrace' => ['array'], -'OutOfRangeException::getTraceAsString' => ['string'], -'output_add_rewrite_var' => ['bool', 'name'=>'string', 'value'=>'string'], -'output_reset_rewrite_vars' => ['bool'], -'OverflowException::__clone' => ['void'], -'OverflowException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'(?Throwable)|(?OverflowException)'], -'OverflowException::__toString' => ['string'], -'OverflowException::getCode' => ['int'], -'OverflowException::getFile' => ['string'], -'OverflowException::getLine' => ['int'], -'OverflowException::getMessage' => ['string'], -'OverflowException::getPrevious' => ['Throwable|OverflowException|null'], -'OverflowException::getTrace' => ['array'], -'OverflowException::getTraceAsString' => ['string'], -'overload' => ['', 'class_name'=>'string'], -'override_function' => ['bool', 'function_name'=>'string', 'function_args'=>'string', 'function_code'=>'string'], -'pack' => ['string', 'format'=>'string', '...args='=>'mixed'], -'ParentIterator::__construct' => ['void', 'it'=>'recursiveiterator'], -'ParentIterator::accept' => ['bool'], -'ParentIterator::getChildren' => ['ParentIterator'], -'ParentIterator::hasChildren' => ['bool'], -'ParentIterator::next' => ['void'], -'ParentIterator::rewind' => ['void'], -'ParentIterator::valid' => [''], -'Parle\Lexer::advance' => ['void'], -'Parle\Lexer::build' => ['void'], -'Parle\Lexer::callout' => ['void', 'id'=>'int', 'callback'=>'callable'], -'Parle\Lexer::consume' => ['void', 'data'=>'string'], -'Parle\Lexer::dump' => ['void'], -'Parle\Lexer::getToken' => ['Parle\Token'], -'Parle\Lexer::insertMacro' => ['void', 'name'=>'string', 'regex'=>'string'], -'Parle\Lexer::push' => ['void', 'regex'=>'string', 'id'=>'int'], -'Parle\Lexer::reset' => ['void', 'pos'=>'int'], -'Parle\Parser::advance' => ['void'], -'Parle\Parser::build' => ['void'], -'Parle\Parser::consume' => ['void', 'data'=>'string', 'lexer'=>'Parle\Lexer'], -'Parle\Parser::dump' => ['void'], -'Parle\Parser::errorInfo' => ['Parle\ErrorInfo'], -'Parle\Parser::left' => ['void', 'token'=>'string'], -'Parle\Parser::nonassoc' => ['void', 'token'=>'string'], -'Parle\Parser::precedence' => ['void', 'token'=>'string'], -'Parle\Parser::push' => ['int', 'name'=>'string', 'rule'=>'string'], -'Parle\Parser::reset' => ['void', 'tokenId'=>'int'], -'Parle\Parser::right' => ['void', 'token'=>'string'], -'Parle\Parser::sigil' => ['string', 'idx'=>'array'], -'Parle\Parser::token' => ['void', 'token'=>'string'], -'Parle\Parser::tokenId' => ['int', 'token'=>'string'], -'Parle\Parser::trace' => ['string'], -'Parle\Parser::validate' => ['bool', 'data'=>'string', 'lexer'=>'Parle\Lexer'], -'Parle\RLexer::advance' => ['void'], -'Parle\RLexer::build' => ['void'], -'Parle\RLexer::callout' => ['void', 'id'=>'int', 'callback'=>'callable'], -'Parle\RLexer::consume' => ['void', 'data'=>'string'], -'Parle\RLexer::dump' => ['void'], -'Parle\RLexer::getToken' => ['Parle\Token'], -'Parle\RLexer::push' => ['void', 'state'=>'string', 'regex'=>'string', 'newState'=>'string'], -'Parle\RLexer::pushState' => ['int', 'state'=>'string'], -'Parle\RLexer::reset' => ['void', 'pos'=>'int'], -'Parle\RParser::advance' => ['void'], -'Parle\RParser::build' => ['void'], -'Parle\RParser::consume' => ['void', 'data'=>'string', 'lexer'=>'Parle\Lexer'], -'Parle\RParser::dump' => ['void'], -'Parle\RParser::errorInfo' => ['Parle\ErrorInfo'], -'Parle\RParser::left' => ['void', 'token'=>'string'], -'Parle\RParser::nonassoc' => ['void', 'token'=>'string'], -'Parle\RParser::precedence' => ['void', 'token'=>'string'], -'Parle\RParser::push' => ['int', 'name'=>'string', 'rule'=>'string'], -'Parle\RParser::reset' => ['void', 'tokenId'=>'int'], -'Parle\RParser::right' => ['void', 'token'=>'string'], -'Parle\RParser::sigil' => ['string', 'idx'=>'array'], -'Parle\RParser::token' => ['void', 'token'=>'string'], -'Parle\RParser::tokenId' => ['int', 'token'=>'string'], -'Parle\RParser::trace' => ['string'], -'Parle\RParser::validate' => ['bool', 'data'=>'string', 'lexer'=>'Parle\Lexer'], -'Parle\Stack::pop' => ['void'], -'Parle\Stack::push' => ['void', 'item'=>''], -'parse_ini_file' => ['array|false', 'filename'=>'string', 'process_sections='=>'bool', 'scanner_mode='=>'int'], -'parse_ini_string' => ['array|false', 'ini_string'=>'string', 'process_sections='=>'bool', 'scanner_mode='=>'int'], -'parse_str' => ['void', 'encoded_string'=>'string', '&w_result='=>'array'], -'parse_url' => ['mixed', 'url'=>'string', 'url_component='=>'int'], -'ParseError::__clone' => ['void'], -'ParseError::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'(?Throwable)|(?ParseError)'], -'ParseError::__toString' => ['string'], -'ParseError::getCode' => ['int'], -'ParseError::getFile' => ['string'], -'ParseError::getLine' => ['int'], -'ParseError::getMessage' => ['string'], -'ParseError::getPrevious' => ['Throwable|ParseError|null'], -'ParseError::getTrace' => ['array'], -'ParseError::getTraceAsString' => ['string'], -'parsekit_compile_file' => ['array', 'filename'=>'string', 'errors='=>'array', 'options='=>'int'], -'parsekit_compile_string' => ['array', 'phpcode'=>'string', 'errors='=>'array', 'options='=>'int'], -'parsekit_func_arginfo' => ['array', 'function'=>'mixed'], -'passthru' => ['void', 'command'=>'string', '&w_return_value='=>'int'], -'password_get_info' => ['array', 'hash'=>'string'], -'password_hash' => ['string|false', 'password'=>'string', 'algo'=>'int', 'options='=>'array'], -'password_make_salt' => ['bool', 'password'=>'string', 'hash'=>'string'], -'password_needs_rehash' => ['bool', 'hash'=>'string', 'algo'=>'int', 'options='=>'array'], -'password_verify' => ['bool', 'password'=>'string', 'hash'=>'string'], -'pathinfo' => ['array|string', 'path'=>'string', 'options='=>'int'], -'pclose' => ['int', 'fp'=>'resource'], -'pcnlt_sigwaitinfo' => ['int', 'set'=>'array', '&w_siginfo'=>'array'], -'pcntl_alarm' => ['int', 'seconds'=>'int'], -'pcntl_async_signals' => ['bool', 'on='=>'bool'], -'pcntl_errno' => ['int'], -'pcntl_exec' => ['bool', 'path'=>'string', 'args='=>'array', 'envs='=>'array'], -'pcntl_fork' => ['int'], -'pcntl_get_last_error' => ['int'], -'pcntl_getpriority' => ['int', 'pid='=>'int', 'process_identifier='=>'int'], -'pcntl_setpriority' => ['bool', 'priority'=>'int', 'pid='=>'int', 'process_identifier='=>'int'], -'pcntl_signal' => ['bool', 'signo'=>'int', 'handle'=>'callable|int', 'restart_syscalls='=>'bool'], -'pcntl_signal_dispatch' => ['bool'], -'pcntl_signal_get_handler' => ['int|string', 'signo'=>'int'], -'pcntl_sigprocmask' => ['bool', 'how'=>'int', 'set'=>'array', '&w_oldset='=>'array'], -'pcntl_sigtimedwait' => ['int', 'set'=>'array', '&w_siginfo='=>'array', 'seconds='=>'int', 'nanoseconds='=>'int'], -'pcntl_sigwaitinfo' => ['int', 'set'=>'array', '&w_siginfo='=>'array'], -'pcntl_strerror' => ['string', 'errno'=>'int'], -'pcntl_wait' => ['int', '&w_status'=>'int', 'options='=>'int', '&w_rusage='=>'array'], -'pcntl_waitpid' => ['int', 'pid'=>'int', '&w_status'=>'int', 'options='=>'int', '&w_rusage='=>'array'], -'pcntl_wexitstatus' => ['int', 'status'=>'int'], -'pcntl_wifcontinued' => ['bool', 'status'=>'int'], -'pcntl_wifexited' => ['bool', 'status'=>'int'], -'pcntl_wifsignaled' => ['bool', 'status'=>'int'], -'pcntl_wifstopped' => ['bool', 'status'=>'int'], -'pcntl_wstopsig' => ['int', 'status'=>'int'], -'pcntl_wtermsig' => ['int', 'status'=>'int'], -'PDF_activate_item' => ['bool', 'pdfdoc'=>'resource', 'id'=>'int'], -'PDF_add_launchlink' => ['bool', 'pdfdoc'=>'resource', 'llx'=>'float', 'lly'=>'float', 'urx'=>'float', 'ury'=>'float', 'filename'=>'string'], -'PDF_add_locallink' => ['bool', 'pdfdoc'=>'resource', 'lowerleftx'=>'float', 'lowerlefty'=>'float', 'upperrightx'=>'float', 'upperrighty'=>'float', 'page'=>'int', 'dest'=>'string'], -'PDF_add_nameddest' => ['bool', 'pdfdoc'=>'resource', 'name'=>'string', 'optlist'=>'string'], -'PDF_add_note' => ['bool', 'pdfdoc'=>'resource', 'llx'=>'float', 'lly'=>'float', 'urx'=>'float', 'ury'=>'float', 'contents'=>'string', 'title'=>'string', 'icon'=>'string', 'open'=>'int'], -'PDF_add_pdflink' => ['bool', 'pdfdoc'=>'resource', 'bottom_left_x'=>'float', 'bottom_left_y'=>'float', 'up_right_x'=>'float', 'up_right_y'=>'float', 'filename'=>'string', 'page'=>'int', 'dest'=>'string'], -'PDF_add_table_cell' => ['int', 'pdfdoc'=>'resource', 'table'=>'int', 'column'=>'int', 'row'=>'int', 'text'=>'string', 'optlist'=>'string'], -'PDF_add_textflow' => ['int', 'pdfdoc'=>'resource', 'textflow'=>'int', 'text'=>'string', 'optlist'=>'string'], -'PDF_add_thumbnail' => ['bool', 'pdfdoc'=>'resource', 'image'=>'int'], -'PDF_add_weblink' => ['bool', 'pdfdoc'=>'resource', 'lowerleftx'=>'float', 'lowerlefty'=>'float', 'upperrightx'=>'float', 'upperrighty'=>'float', 'url'=>'string'], -'PDF_arc' => ['bool', 'p'=>'resource', 'x'=>'float', 'y'=>'float', 'r'=>'float', 'alpha'=>'float', 'beta'=>'float'], -'PDF_arcn' => ['bool', 'p'=>'resource', 'x'=>'float', 'y'=>'float', 'r'=>'float', 'alpha'=>'float', 'beta'=>'float'], -'PDF_attach_file' => ['bool', 'pdfdoc'=>'resource', 'llx'=>'float', 'lly'=>'float', 'urx'=>'float', 'ury'=>'float', 'filename'=>'string', 'description'=>'string', 'author'=>'string', 'mimetype'=>'string', 'icon'=>'string'], -'PDF_begin_document' => ['int', 'pdfdoc'=>'resource', 'filename'=>'string', 'optlist'=>'string'], -'PDF_begin_font' => ['bool', 'pdfdoc'=>'resource', 'filename'=>'string', 'a'=>'float', 'b'=>'float', 'c'=>'float', 'd'=>'float', 'e'=>'float', 'f'=>'float', 'optlist'=>'string'], -'PDF_begin_glyph' => ['bool', 'pdfdoc'=>'resource', 'glyphname'=>'string', 'wx'=>'float', 'llx'=>'float', 'lly'=>'float', 'urx'=>'float', 'ury'=>'float'], -'PDF_begin_item' => ['int', 'pdfdoc'=>'resource', 'tag'=>'string', 'optlist'=>'string'], -'PDF_begin_layer' => ['bool', 'pdfdoc'=>'resource', 'layer'=>'int'], -'PDF_begin_page' => ['bool', 'pdfdoc'=>'resource', 'width'=>'float', 'height'=>'float'], -'PDF_begin_page_ext' => ['bool', 'pdfdoc'=>'resource', 'width'=>'float', 'height'=>'float', 'optlist'=>'string'], -'PDF_begin_pattern' => ['int', 'pdfdoc'=>'resource', 'width'=>'float', 'height'=>'float', 'xstep'=>'float', 'ystep'=>'float', 'painttype'=>'int'], -'PDF_begin_template' => ['int', 'pdfdoc'=>'resource', 'width'=>'float', 'height'=>'float'], -'PDF_begin_template_ext' => ['int', 'pdfdoc'=>'resource', 'width'=>'float', 'height'=>'float', 'optlist'=>'string'], -'PDF_circle' => ['bool', 'pdfdoc'=>'resource', 'x'=>'float', 'y'=>'float', 'r'=>'float'], -'PDF_clip' => ['bool', 'p'=>'resource'], -'PDF_close' => ['bool', 'p'=>'resource'], -'PDF_close_image' => ['bool', 'p'=>'resource', 'image'=>'int'], -'PDF_close_pdi' => ['bool', 'p'=>'resource', 'doc'=>'int'], -'PDF_close_pdi_page' => ['bool', 'p'=>'resource', 'page'=>'int'], -'PDF_closepath' => ['bool', 'p'=>'resource'], -'PDF_closepath_fill_stroke' => ['bool', 'p'=>'resource'], -'PDF_closepath_stroke' => ['bool', 'p'=>'resource'], -'PDF_concat' => ['bool', 'p'=>'resource', 'a'=>'float', 'b'=>'float', 'c'=>'float', 'd'=>'float', 'e'=>'float', 'f'=>'float'], -'PDF_continue_text' => ['bool', 'p'=>'resource', 'text'=>'string'], -'PDF_create_3dview' => ['int', 'pdfdoc'=>'resource', 'username'=>'string', 'optlist'=>'string'], -'PDF_create_action' => ['int', 'pdfdoc'=>'resource', 'type'=>'string', 'optlist'=>'string'], -'PDF_create_annotation' => ['bool', 'pdfdoc'=>'resource', 'llx'=>'float', 'lly'=>'float', 'urx'=>'float', 'ury'=>'float', 'type'=>'string', 'optlist'=>'string'], -'PDF_create_bookmark' => ['int', 'pdfdoc'=>'resource', 'text'=>'string', 'optlist'=>'string'], -'PDF_create_field' => ['bool', 'pdfdoc'=>'resource', 'llx'=>'float', 'lly'=>'float', 'urx'=>'float', 'ury'=>'float', 'name'=>'string', 'type'=>'string', 'optlist'=>'string'], -'PDF_create_fieldgroup' => ['bool', 'pdfdoc'=>'resource', 'name'=>'string', 'optlist'=>'string'], -'PDF_create_gstate' => ['int', 'pdfdoc'=>'resource', 'optlist'=>'string'], -'PDF_create_pvf' => ['bool', 'pdfdoc'=>'resource', 'filename'=>'string', 'data'=>'string', 'optlist'=>'string'], -'PDF_create_textflow' => ['int', 'pdfdoc'=>'resource', 'text'=>'string', 'optlist'=>'string'], -'PDF_curveto' => ['bool', 'p'=>'resource', 'x1'=>'float', 'y1'=>'float', 'x2'=>'float', 'y2'=>'float', 'x3'=>'float', 'y3'=>'float'], -'PDF_define_layer' => ['int', 'pdfdoc'=>'resource', 'name'=>'string', 'optlist'=>'string'], -'PDF_delete' => ['bool', 'pdfdoc'=>'resource'], -'PDF_delete_pvf' => ['int', 'pdfdoc'=>'resource', 'filename'=>'string'], -'PDF_delete_table' => ['bool', 'pdfdoc'=>'resource', 'table'=>'int', 'optlist'=>'string'], -'PDF_delete_textflow' => ['bool', 'pdfdoc'=>'resource', 'textflow'=>'int'], -'PDF_encoding_set_char' => ['bool', 'pdfdoc'=>'resource', 'encoding'=>'string', 'slot'=>'int', 'glyphname'=>'string', 'uv'=>'int'], -'PDF_end_document' => ['bool', 'pdfdoc'=>'resource', 'optlist'=>'string'], -'PDF_end_font' => ['bool', 'pdfdoc'=>'resource'], -'PDF_end_glyph' => ['bool', 'pdfdoc'=>'resource'], -'PDF_end_item' => ['bool', 'pdfdoc'=>'resource', 'id'=>'int'], -'PDF_end_layer' => ['bool', 'pdfdoc'=>'resource'], -'PDF_end_page' => ['bool', 'p'=>'resource'], -'PDF_end_page_ext' => ['bool', 'pdfdoc'=>'resource', 'optlist'=>'string'], -'PDF_end_pattern' => ['bool', 'p'=>'resource'], -'PDF_end_template' => ['bool', 'p'=>'resource'], -'PDF_endpath' => ['bool', 'p'=>'resource'], -'PDF_fill' => ['bool', 'p'=>'resource'], -'PDF_fill_imageblock' => ['int', 'pdfdoc'=>'resource', 'page'=>'int', 'blockname'=>'string', 'image'=>'int', 'optlist'=>'string'], -'PDF_fill_pdfblock' => ['int', 'pdfdoc'=>'resource', 'page'=>'int', 'blockname'=>'string', 'contents'=>'int', 'optlist'=>'string'], -'PDF_fill_stroke' => ['bool', 'p'=>'resource'], -'PDF_fill_textblock' => ['int', 'pdfdoc'=>'resource', 'page'=>'int', 'blockname'=>'string', 'text'=>'string', 'optlist'=>'string'], -'PDF_findfont' => ['int', 'p'=>'resource', 'fontname'=>'string', 'encoding'=>'string', 'embed'=>'int'], -'PDF_fit_image' => ['bool', 'pdfdoc'=>'resource', 'image'=>'int', 'x'=>'float', 'y'=>'float', 'optlist'=>'string'], -'PDF_fit_pdi_page' => ['bool', 'pdfdoc'=>'resource', 'page'=>'int', 'x'=>'float', 'y'=>'float', 'optlist'=>'string'], -'PDF_fit_table' => ['string', 'pdfdoc'=>'resource', 'table'=>'int', 'llx'=>'float', 'lly'=>'float', 'urx'=>'float', 'ury'=>'float', 'optlist'=>'string'], -'PDF_fit_textflow' => ['string', 'pdfdoc'=>'resource', 'textflow'=>'int', 'llx'=>'float', 'lly'=>'float', 'urx'=>'float', 'ury'=>'float', 'optlist'=>'string'], -'PDF_fit_textline' => ['bool', 'pdfdoc'=>'resource', 'text'=>'string', 'x'=>'float', 'y'=>'float', 'optlist'=>'string'], -'PDF_get_apiname' => ['string', 'pdfdoc'=>'resource'], -'PDF_get_buffer' => ['string', 'p'=>'resource'], -'PDF_get_errmsg' => ['string', 'pdfdoc'=>'resource'], -'PDF_get_errnum' => ['int', 'pdfdoc'=>'resource'], -'PDF_get_majorversion' => ['int'], -'PDF_get_minorversion' => ['int'], -'PDF_get_parameter' => ['string', 'p'=>'resource', 'key'=>'string', 'modifier'=>'float'], -'PDF_get_pdi_parameter' => ['string', 'p'=>'resource', 'key'=>'string', 'doc'=>'int', 'page'=>'int', 'reserved'=>'int'], -'PDF_get_pdi_value' => ['float', 'p'=>'resource', 'key'=>'string', 'doc'=>'int', 'page'=>'int', 'reserved'=>'int'], -'PDF_get_value' => ['float', 'p'=>'resource', 'key'=>'string', 'modifier'=>'float'], -'PDF_info_font' => ['float', 'pdfdoc'=>'resource', 'font'=>'int', 'keyword'=>'string', 'optlist'=>'string'], -'PDF_info_matchbox' => ['float', 'pdfdoc'=>'resource', 'boxname'=>'string', 'num'=>'int', 'keyword'=>'string'], -'PDF_info_table' => ['float', 'pdfdoc'=>'resource', 'table'=>'int', 'keyword'=>'string'], -'PDF_info_textflow' => ['float', 'pdfdoc'=>'resource', 'textflow'=>'int', 'keyword'=>'string'], -'PDF_info_textline' => ['float', 'pdfdoc'=>'resource', 'text'=>'string', 'keyword'=>'string', 'optlist'=>'string'], -'PDF_initgraphics' => ['bool', 'p'=>'resource'], -'PDF_lineto' => ['bool', 'p'=>'resource', 'x'=>'float', 'y'=>'float'], -'PDF_load_3ddata' => ['int', 'pdfdoc'=>'resource', 'filename'=>'string', 'optlist'=>'string'], -'PDF_load_font' => ['int', 'pdfdoc'=>'resource', 'fontname'=>'string', 'encoding'=>'string', 'optlist'=>'string'], -'PDF_load_iccprofile' => ['int', 'pdfdoc'=>'resource', 'profilename'=>'string', 'optlist'=>'string'], -'PDF_load_image' => ['int', 'pdfdoc'=>'resource', 'imagetype'=>'string', 'filename'=>'string', 'optlist'=>'string'], -'PDF_makespotcolor' => ['int', 'p'=>'resource', 'spotname'=>'string'], -'PDF_moveto' => ['bool', 'p'=>'resource', 'x'=>'float', 'y'=>'float'], -'PDF_new' => ['resource'], -'PDF_open_ccitt' => ['int', 'pdfdoc'=>'resource', 'filename'=>'string', 'width'=>'int', 'height'=>'int', 'bitreverse'=>'int', 'k'=>'int', 'blackls1'=>'int'], -'PDF_open_file' => ['bool', 'p'=>'resource', 'filename'=>'string'], -'PDF_open_image' => ['int', 'p'=>'resource', 'imagetype'=>'string', 'source'=>'string', 'data'=>'string', 'length'=>'int', 'width'=>'int', 'height'=>'int', 'components'=>'int', 'bpc'=>'int', 'params'=>'string'], -'PDF_open_image_file' => ['int', 'p'=>'resource', 'imagetype'=>'string', 'filename'=>'string', 'stringparam'=>'string', 'intparam'=>'int'], -'PDF_open_memory_image' => ['int', 'p'=>'resource', 'image'=>'resource'], -'PDF_open_pdi' => ['int', 'pdfdoc'=>'resource', 'filename'=>'string', 'optlist'=>'string', 'len'=>'int'], -'PDF_open_pdi_document' => ['int', 'p'=>'resource', 'filename'=>'string', 'optlist'=>'string'], -'PDF_open_pdi_page' => ['int', 'p'=>'resource', 'doc'=>'int', 'pagenumber'=>'int', 'optlist'=>'string'], -'PDF_pcos_get_number' => ['float', 'p'=>'resource', 'doc'=>'int', 'path'=>'string'], -'PDF_pcos_get_stream' => ['string', 'p'=>'resource', 'doc'=>'int', 'optlist'=>'string', 'path'=>'string'], -'PDF_pcos_get_string' => ['string', 'p'=>'resource', 'doc'=>'int', 'path'=>'string'], -'PDF_place_image' => ['bool', 'pdfdoc'=>'resource', 'image'=>'int', 'x'=>'float', 'y'=>'float', 'scale'=>'float'], -'PDF_place_pdi_page' => ['bool', 'pdfdoc'=>'resource', 'page'=>'int', 'x'=>'float', 'y'=>'float', 'sx'=>'float', 'sy'=>'float'], -'PDF_process_pdi' => ['int', 'pdfdoc'=>'resource', 'doc'=>'int', 'page'=>'int', 'optlist'=>'string'], -'PDF_rect' => ['bool', 'p'=>'resource', 'x'=>'float', 'y'=>'float', 'width'=>'float', 'height'=>'float'], -'PDF_restore' => ['bool', 'p'=>'resource'], -'PDF_resume_page' => ['bool', 'pdfdoc'=>'resource', 'optlist'=>'string'], -'PDF_rotate' => ['bool', 'p'=>'resource', 'phi'=>'float'], -'PDF_save' => ['bool', 'p'=>'resource'], -'PDF_scale' => ['bool', 'p'=>'resource', 'sx'=>'float', 'sy'=>'float'], -'PDF_set_border_color' => ['bool', 'p'=>'resource', 'red'=>'float', 'green'=>'float', 'blue'=>'float'], -'PDF_set_border_dash' => ['bool', 'pdfdoc'=>'resource', 'black'=>'float', 'white'=>'float'], -'PDF_set_border_style' => ['bool', 'pdfdoc'=>'resource', 'style'=>'string', 'width'=>'float'], -'PDF_set_gstate' => ['bool', 'pdfdoc'=>'resource', 'gstate'=>'int'], -'PDF_set_info' => ['bool', 'p'=>'resource', 'key'=>'string', 'value'=>'string'], -'PDF_set_layer_dependency' => ['bool', 'pdfdoc'=>'resource', 'type'=>'string', 'optlist'=>'string'], -'PDF_set_parameter' => ['bool', 'p'=>'resource', 'key'=>'string', 'value'=>'string'], -'PDF_set_text_pos' => ['bool', 'p'=>'resource', 'x'=>'float', 'y'=>'float'], -'PDF_set_value' => ['bool', 'p'=>'resource', 'key'=>'string', 'value'=>'float'], -'PDF_setcolor' => ['bool', 'p'=>'resource', 'fstype'=>'string', 'colorspace'=>'string', 'c1'=>'float', 'c2'=>'float', 'c3'=>'float', 'c4'=>'float'], -'PDF_setdash' => ['bool', 'pdfdoc'=>'resource', 'b'=>'float', 'w'=>'float'], -'PDF_setdashpattern' => ['bool', 'pdfdoc'=>'resource', 'optlist'=>'string'], -'PDF_setflat' => ['bool', 'pdfdoc'=>'resource', 'flatness'=>'float'], -'PDF_setfont' => ['bool', 'pdfdoc'=>'resource', 'font'=>'int', 'fontsize'=>'float'], -'PDF_setgray' => ['bool', 'p'=>'resource', 'g'=>'float'], -'PDF_setgray_fill' => ['bool', 'p'=>'resource', 'g'=>'float'], -'PDF_setgray_stroke' => ['bool', 'p'=>'resource', 'g'=>'float'], -'PDF_setlinecap' => ['bool', 'p'=>'resource', 'linecap'=>'int'], -'PDF_setlinejoin' => ['bool', 'p'=>'resource', 'value'=>'int'], -'PDF_setlinewidth' => ['bool', 'p'=>'resource', 'width'=>'float'], -'PDF_setmatrix' => ['bool', 'p'=>'resource', 'a'=>'float', 'b'=>'float', 'c'=>'float', 'd'=>'float', 'e'=>'float', 'f'=>'float'], -'PDF_setmiterlimit' => ['bool', 'pdfdoc'=>'resource', 'miter'=>'float'], -'PDF_setrgbcolor' => ['bool', 'p'=>'resource', 'red'=>'float', 'green'=>'float', 'blue'=>'float'], -'PDF_setrgbcolor_fill' => ['bool', 'p'=>'resource', 'red'=>'float', 'green'=>'float', 'blue'=>'float'], -'PDF_setrgbcolor_stroke' => ['bool', 'p'=>'resource', 'red'=>'float', 'green'=>'float', 'blue'=>'float'], -'PDF_shading' => ['int', 'pdfdoc'=>'resource', 'shtype'=>'string', 'x0'=>'float', 'y0'=>'float', 'x1'=>'float', 'y1'=>'float', 'c1'=>'float', 'c2'=>'float', 'c3'=>'float', 'c4'=>'float', 'optlist'=>'string'], -'PDF_shading_pattern' => ['int', 'pdfdoc'=>'resource', 'shading'=>'int', 'optlist'=>'string'], -'PDF_shfill' => ['bool', 'pdfdoc'=>'resource', 'shading'=>'int'], -'PDF_show' => ['bool', 'pdfdoc'=>'resource', 'text'=>'string'], -'PDF_show_boxed' => ['int', 'p'=>'resource', 'text'=>'string', 'left'=>'float', 'top'=>'float', 'width'=>'float', 'height'=>'float', 'mode'=>'string', 'feature'=>'string'], -'PDF_show_xy' => ['bool', 'p'=>'resource', 'text'=>'string', 'x'=>'float', 'y'=>'float'], -'PDF_skew' => ['bool', 'p'=>'resource', 'alpha'=>'float', 'beta'=>'float'], -'PDF_stringwidth' => ['float', 'p'=>'resource', 'text'=>'string', 'font'=>'int', 'fontsize'=>'float'], -'PDF_stroke' => ['bool', 'p'=>'resource'], -'PDF_suspend_page' => ['bool', 'pdfdoc'=>'resource', 'optlist'=>'string'], -'PDF_translate' => ['bool', 'p'=>'resource', 'tx'=>'float', 'ty'=>'float'], -'PDF_utf16_to_utf8' => ['string', 'pdfdoc'=>'resource', 'utf16string'=>'string'], -'PDF_utf32_to_utf16' => ['string', 'pdfdoc'=>'resource', 'utf32string'=>'string', 'ordering'=>'string'], -'PDF_utf8_to_utf16' => ['string', 'pdfdoc'=>'resource', 'utf8string'=>'string', 'ordering'=>'string'], -'PDO::__construct' => ['void', 'dsn'=>'string', 'username='=>'?string', 'passwd='=>'?string', 'options='=>'?array'], -'PDO::__sleep' => ['int'], -'PDO::__wakeup' => ['void'], -'PDO::beginTransaction' => ['bool'], -'PDO::commit' => ['bool'], -'PDO::cubrid_schema' => ['array', 'schema_type'=>'int', 'table_name='=>'string', 'col_name='=>'string'], -'PDO::errorCode' => ['string'], -'PDO::errorInfo' => ['array'], -'PDO::exec' => ['int', 'query'=>'string'], -'PDO::getAttribute' => ['', 'attribute'=>'int'], -'PDO::getAvailableDrivers' => ['array'], -'PDO::inTransaction' => ['bool'], -'PDO::lastInsertId' => ['string', 'seqname='=>'string'], -'PDO::pgsqlCopyFromArray' => ['bool', 'table_name'=>'string', 'rows'=>'array', 'delimiter'=>'string', 'null_as'=>'string', 'fields'=>'string'], -'PDO::pgsqlCopyFromFile' => ['bool', 'table_name'=>'string', 'filename'=>'string', 'delimiter'=>'string', 'null_as'=>'string', 'fields'=>'string'], -'PDO::pgsqlCopyToArray' => ['array', 'table_name'=>'string', 'delimiter'=>'string', 'null_as'=>'string', 'fields'=>'string'], -'PDO::pgsqlCopyToFile' => ['bool', 'table_name'=>'string', 'filename'=>'string', 'delimiter'=>'string', 'null_as'=>'string', 'fields'=>'string'], -'PDO::pgsqlGetNotify' => ['array', 'result_type'=>'int', 'ms_timeout'=>'int'], -'PDO::pgsqlGetPid' => ['int'], -'PDO::pgsqlLOBCreate' => ['string'], -'PDO::pgsqlLOBOpen' => ['resource', 'oid'=>'string', 'mode='=>'string'], -'PDO::pgsqlLOBUnlink' => ['bool', 'oid'=>'string'], -'PDO::prepare' => ['PDOStatement', 'statement'=>'string', 'options='=>'array'], -'PDO::query' => ['PDOStatement|false', 'sql'=>'string'], -'PDO::query\'1' => ['PDOStatement|false', 'sql'=>'string', 'fetch_column'=>'int', 'colno'=>'int'], -'PDO::query\'2' => ['PDOStatement|false', 'sql'=>'string', 'fetch_class'=>'int', 'classname'=>'string', 'ctorargs'=>'array'], -'PDO::query\'3' => ['PDOStatement|false', 'sql'=>'string', 'fetch_into'=>'int', 'object'=>'object'], -'PDO::quote' => ['string', 'string'=>'string', 'paramtype='=>'int'], -'PDO::rollBack' => ['bool'], -'PDO::setAttribute' => ['bool', 'attribute'=>'int', 'value'=>''], -'PDO::sqliteCreateAggregate' => ['bool', 'function_name'=>'string', 'step_func'=>'callable', 'finalize_func'=>'callable', 'num_args='=>'int'], -'PDO::sqliteCreateCollation' => ['bool', 'name'=>'string', 'callback'=>'callable'], -'PDO::sqliteCreateFunction' => ['bool', 'function_name'=>'string', 'callback'=>'callable', 'num_args='=>'int'], -'pdo_drivers' => ['array'], -'PDOException::getCode' => [''], -'PDOException::getFile' => [''], -'PDOException::getLine' => [''], -'PDOException::getMessage' => [''], -'PDOException::getPrevious' => [''], -'PDOException::getTrace' => [''], -'PDOException::getTraceAsString' => [''], -'PDOStatement::__sleep' => ['int'], -'PDOStatement::__wakeup' => ['void'], -'PDOStatement::bindColumn' => ['bool', 'column'=>'mixed', '&rw_param'=>'mixed', 'type='=>'int', 'maxlen='=>'int', 'driverdata='=>'mixed'], -'PDOStatement::bindParam' => ['bool', 'paramno'=>'mixed', '&rw_param'=>'mixed', 'type='=>'int', 'maxlen='=>'int', 'driverdata='=>'mixed'], -'PDOStatement::bindValue' => ['bool', 'paramno'=>'mixed', 'param'=>'mixed', 'type='=>'int'], -'PDOStatement::closeCursor' => ['bool'], -'PDOStatement::columnCount' => ['int'], -'PDOStatement::debugDumpParams' => ['void'], -'PDOStatement::errorCode' => ['string'], -'PDOStatement::errorInfo' => ['array'], -'PDOStatement::execute' => ['bool', 'bound_input_params='=>'?array'], -'PDOStatement::fetch' => ['mixed', 'how='=>'int', 'orientation='=>'int', 'offset='=>'int'], -'PDOStatement::fetchAll' => ['array|false', 'how='=>'int', 'fetch_argument='=>'int|string|callable', 'ctor_args='=>'?array'], -'PDOStatement::fetchColumn' => ['string|null|false', 'column_number='=>'int'], -'PDOStatement::fetchObject' => ['mixed', 'class_name='=>'string', 'ctor_args='=>'?array'], -'PDOStatement::getAttribute' => ['mixed', 'attribute'=>'int'], -'PDOStatement::getColumnMeta' => ['array', 'column'=>'int'], -'PDOStatement::nextRowset' => ['bool'], -'PDOStatement::rowCount' => ['int'], -'PDOStatement::setAttribute' => ['bool', 'attribute'=>'int', 'value'=>'mixed'], -'PDOStatement::setFetchMode' => ['bool', 'mode'=>'int'], -'PDOStatement::setFetchMode\'1' => ['bool', 'fetch_column'=>'int', 'colno'=>'int'], -'PDOStatement::setFetchMode\'2' => ['bool', 'fetch_class'=>'int', 'classname'=>'string', 'ctorargs'=>'array'], -'PDOStatement::setFetchMode\'3' => ['bool', 'fetch_into'=>'int', 'object'=>'object'], -'pfsockopen' => ['resource', 'hostname'=>'string', 'port='=>'int', '&w_errno='=>'int', '&w_errstr='=>'string', 'timeout='=>'float'], -'pg_affected_rows' => ['int', 'result'=>'resource'], -'pg_cancel_query' => ['bool', 'connection'=>'resource'], -'pg_client_encoding' => ['string', 'connection='=>'resource'], -'pg_close' => ['bool', 'connection='=>'resource'], -'pg_connect' => ['resource|false', 'connection_string'=>'string', 'connect_type='=>'int'], -'pg_connect_poll' => ['int', 'connection'=>'resource'], -'pg_connection_busy' => ['bool', 'connection'=>'resource'], -'pg_connection_reset' => ['bool', 'connection'=>'resource'], -'pg_connection_status' => ['int', 'connection'=>'resource'], -'pg_consume_input' => ['bool', 'connection'=>'resource'], -'pg_convert' => ['array', 'db'=>'resource', 'table'=>'string', 'values'=>'array', 'options='=>'int'], -'pg_copy_from' => ['bool', 'connection'=>'resource', 'table_name'=>'string', 'rows'=>'array', 'delimiter='=>'string', 'null_as='=>'string'], -'pg_copy_to' => ['array', 'connection'=>'resource', 'table_name'=>'string', 'delimiter='=>'string', 'null_as='=>'string'], -'pg_dbname' => ['string', 'connection='=>'resource'], -'pg_delete' => ['mixed', 'db'=>'resource', 'table'=>'string', 'ids'=>'array', 'options='=>'int'], -'pg_end_copy' => ['bool', 'connection='=>'resource'], -'pg_escape_bytea' => ['string', 'connection'=>'resource', 'data'=>'string'], -'pg_escape_bytea\'1' => ['string', 'data'=>'string'], -'pg_escape_identifier' => ['string', 'connection'=>'resource', 'data'=>'string'], -'pg_escape_identifier\'1' => ['string', 'data'=>'string'], -'pg_escape_literal' => ['string', 'connection'=>'resource', 'data'=>'string'], -'pg_escape_literal\'1' => ['string', 'data'=>'string'], -'pg_escape_string' => ['string', 'connection'=>'resource', 'data'=>'string'], -'pg_escape_string\'1' => ['string', 'data'=>'string'], -'pg_execute' => ['resource|false', 'connection'=>'resource', 'stmtname'=>'string', 'params'=>'array'], -'pg_execute\'1' => ['resource|false', 'stmtname'=>'string', 'params'=>'array'], -'pg_fetch_all' => ['array|false', 'result'=>'resource', 'result_type='=>'int'], -'pg_fetch_all_columns' => ['array|false', 'result'=>'resource', 'column_number='=>'int'], -'pg_fetch_array' => ['array|false', 'result'=>'resource', 'row='=>'?int', 'result_type='=>'int'], -'pg_fetch_assoc' => ['array|false', 'result'=>'resource', 'row='=>'?int'], -'pg_fetch_object' => ['object', 'result'=>'', 'row='=>'?int', 'result_type='=>'int'], -'pg_fetch_object\'1' => ['object', 'result'=>'', 'row='=>'?int', 'class_name='=>'string', 'ctor_params='=>'array'], -'pg_fetch_result' => ['', 'result'=>'', 'field_name'=>'string|int'], -'pg_fetch_result\'1' => ['', 'result'=>'', 'row_number'=>'int', 'field_name'=>'string|int'], -'pg_fetch_row' => ['array', 'result'=>'resource', 'row='=>'?int', 'result_type='=>'int'], -'pg_field_is_null' => ['int', 'result'=>'', 'field_name_or_number'=>'string|int'], -'pg_field_is_null\'1' => ['int', 'result'=>'', 'row'=>'int', 'field_name_or_number'=>'string|int'], -'pg_field_name' => ['string', 'result'=>'resource', 'field_number'=>'int'], -'pg_field_num' => ['int', 'result'=>'resource', 'field_name'=>'string'], -'pg_field_prtlen' => ['int', 'result'=>'', 'field_name_or_number'=>''], -'pg_field_prtlen\'1' => ['int', 'result'=>'', 'row'=>'int', 'field_name_or_number'=>'string|int'], -'pg_field_size' => ['int', 'result'=>'resource', 'field_number'=>'int'], -'pg_field_table' => ['mixed', 'result'=>'resource', 'field_number'=>'int', 'oid_only='=>'bool'], -'pg_field_type' => ['string', 'result'=>'resource', 'field_number'=>'int'], -'pg_field_type_oid' => ['int|false', 'result'=>'resource', 'field_number'=>'int'], -'pg_flush' => ['mixed', 'connection'=>'resource'], -'pg_free_result' => ['bool', 'result'=>'resource'], -'pg_get_notify' => ['array', 'connection'=>'resource', 'result_type='=>'int'], -'pg_get_pid' => ['int|false', 'connection'=>'resource'], -'pg_get_result' => ['resource|false', 'connection='=>'resource'], -'pg_host' => ['string', 'connection='=>'resource'], -'pg_insert' => ['mixed', 'db'=>'resource', 'table'=>'string', 'values'=>'array', 'options='=>'int'], -'pg_last_error' => ['string', 'connection='=>'resource', 'operation='=>'int'], -'pg_last_notice' => ['string', 'connection'=>'resource', 'option='=>'int'], -'pg_last_oid' => ['string', 'result'=>'resource'], -'pg_lo_close' => ['bool', 'large_object'=>'resource'], -'pg_lo_create' => ['int', 'connection='=>'resource', 'large_object_oid='=>''], -'pg_lo_export' => ['bool', 'connection'=>'resource', 'oid'=>'int', 'filename'=>'string'], -'pg_lo_export\'1' => ['bool', 'oid'=>'int', 'pathname'=>'string'], -'pg_lo_import' => ['int', 'connection'=>'resource', 'pathname'=>'string', 'oid'=>''], -'pg_lo_import\'1' => ['int', 'pathname'=>'string', 'oid'=>''], -'pg_lo_open' => ['resource|false', 'connection'=>'resource', 'oid'=>'int', 'mode'=>'string'], -'pg_lo_read' => ['string', 'large_object'=>'resource', 'len='=>'int'], -'pg_lo_read_all' => ['int', 'large_object'=>'resource'], -'pg_lo_seek' => ['bool', 'large_object'=>'resource', 'offset'=>'int', 'whence='=>'int'], -'pg_lo_tell' => ['int', 'large_object'=>'resource'], -'pg_lo_truncate' => ['bool', 'large_object'=>'resource', 'size'=>'int'], -'pg_lo_unlink' => ['bool', 'connection'=>'resource', 'oid'=>'int'], -'pg_lo_write' => ['int', 'large_object'=>'resource', 'data'=>'string', 'len='=>'int'], -'pg_meta_data' => ['array', 'db'=>'resource', 'table'=>'string', 'extended='=>'bool'], -'pg_num_fields' => ['int', 'result'=>'resource'], -'pg_num_rows' => ['int', 'result'=>'resource'], -'pg_options' => ['string', 'connection='=>'resource'], -'pg_parameter_status' => ['string|false', 'connection'=>'resource', 'param_name'=>'string'], -'pg_parameter_status\'1' => ['string|false', 'param_name'=>'string'], -'pg_pconnect' => ['resource|false', 'connection_string'=>'string', 'host='=>'string', 'port='=>'string|int', 'options='=>'string', 'tty='=>'string', 'database='=>'string'], -'pg_ping' => ['bool', 'connection='=>'resource'], -'pg_port' => ['int', 'connection='=>'resource'], -'pg_prepare' => ['resource|false', 'connection'=>'resource', 'stmtname'=>'string', 'query'=>'string'], -'pg_prepare\'1' => ['resource|false', 'stmtname'=>'string', 'query'=>'string'], -'pg_put_line' => ['bool', 'connection'=>'resource', 'data'=>'string'], -'pg_put_line\'1' => ['bool', 'data'=>'string'], -'pg_query' => ['resource|false', 'connection'=>'resource', 'query'=>'string'], -'pg_query\'1' => ['resource|false', 'query'=>'string'], -'pg_query_params' => ['resource|false', 'connection'=>'resource', 'query'=>'string', 'params'=>'array'], -'pg_query_params\'1' => ['resource|false', 'query'=>'string', 'params'=>'array'], -'pg_result_error' => ['string|false', 'result'=>'resource'], -'pg_result_error_field' => ['string|false|null', 'result'=>'resource', 'fieldcode'=>'int'], -'pg_result_seek' => ['bool', 'result'=>'resource', 'offset'=>'int'], -'pg_result_status' => ['mixed', 'result'=>'resource', 'result_type='=>'int'], -'pg_select' => ['mixed', 'db'=>'resource', 'table'=>'string', 'ids'=>'array', 'options='=>'int', 'result_type='=>'int'], -'pg_send_execute' => ['bool', 'connection'=>'resource', 'stmtname'=>'string', 'params'=>'array'], -'pg_send_prepare' => ['bool', 'connection'=>'resource', 'stmtname'=>'string', 'query'=>'string'], -'pg_send_query' => ['bool', 'connection'=>'resource', 'query'=>'string'], -'pg_send_query_params' => ['bool', 'connection'=>'resource', 'query'=>'string', 'params'=>'array'], -'pg_set_client_encoding' => ['int', 'connection'=>'resource', 'encoding'=>'string'], -'pg_set_client_encoding\'1' => ['int', 'encoding'=>'string'], -'pg_set_error_verbosity' => ['int', 'connection'=>'resource', 'verbosity'=>'int'], -'pg_set_error_verbosity\'1' => ['int', 'verbosity'=>'int'], -'pg_socket' => ['resource|false', 'connection'=>'resource'], -'pg_trace' => ['bool', 'filename'=>'string', 'mode='=>'string', 'connection='=>'resource'], -'pg_transaction_status' => ['int', 'connection'=>'resource'], -'pg_tty' => ['string', 'connection='=>'resource'], -'pg_tty\'1' => ['string'], -'pg_unescape_bytea' => ['string', 'data'=>'string'], -'pg_untrace' => ['bool', 'connection='=>'resource'], -'pg_untrace\'1' => ['bool'], -'pg_update' => ['mixed', 'db'=>'resource', 'table'=>'string', 'fields'=>'array', 'ids'=>'array', 'options='=>'int'], -'pg_version' => ['array', 'connection='=>'resource'], -'Phar::__construct' => ['void', 'fname'=>'string', 'flags='=>'int', 'alias='=>'string'], -'Phar::addEmptyDir' => ['', 'dirname'=>'string'], -'Phar::addFile' => ['', 'file'=>'string', 'localname='=>'string'], -'Phar::addFromString' => ['', 'localname'=>'string', 'contents'=>'string'], -'Phar::apiVersion' => ['string'], -'Phar::buildFromDirectory' => ['array', 'base_dir'=>'string', 'regex='=>'string'], -'Phar::buildFromIterator' => ['array', 'iter'=>'iterator', 'base_directory='=>'string'], -'Phar::canCompress' => ['bool', 'method='=>'int'], -'Phar::canWrite' => ['bool'], -'Phar::compress' => ['object', 'compression'=>'int', 'extension='=>'string'], -'Phar::compressAllFilesBZIP2' => ['bool'], -'Phar::compressAllFilesGZ' => ['bool'], -'Phar::compressFiles' => ['', 'compression'=>'int'], -'Phar::convertToData' => ['PharData', 'format='=>'int', 'compression='=>'int', 'extension='=>'string'], -'Phar::convertToExecutable' => ['Phar', 'format='=>'int', 'compression='=>'int', 'extension='=>'string'], -'Phar::copy' => ['bool', 'oldfile'=>'string', 'newfile'=>'string'], -'Phar::count' => ['int'], -'Phar::createDefaultStub' => ['string', 'indexfile='=>'string', 'webindexfile='=>'string'], -'Phar::decompress' => ['object', 'extension='=>'string'], -'Phar::decompressFiles' => ['bool'], -'Phar::delete' => ['bool', 'entry'=>'string'], -'Phar::delMetadata' => ['bool'], -'Phar::extractTo' => ['bool', 'pathto'=>'string', 'files='=>'string|array', 'overwrite='=>'bool'], -'Phar::getAlias' => ['string'], -'Phar::getMetadata' => ['mixed'], -'Phar::getModified' => ['bool'], -'Phar::getPath' => ['string'], -'Phar::getSignature' => ['array'], -'Phar::getStub' => ['string'], -'Phar::getSupportedCompression' => ['array'], -'Phar::getSupportedSignatures' => ['array'], -'Phar::getVersion' => ['string'], -'Phar::hasMetadata' => ['bool'], -'Phar::interceptFileFuncs' => [''], -'Phar::isBuffering' => ['bool'], -'Phar::isCompressed' => [''], -'Phar::isFileFormat' => ['bool', 'format'=>'int'], -'Phar::isValidPharFilename' => ['bool', 'filename'=>'string', 'executable='=>'bool'], -'Phar::isWritable' => ['bool'], -'Phar::loadPhar' => ['bool', 'filename'=>'string', 'alias='=>'string'], -'Phar::mapPhar' => ['bool', 'alias='=>'string', 'dataoffset='=>'int'], -'Phar::mount' => ['void', 'pharpath'=>'string', 'externalpath'=>'string'], -'Phar::mungServer' => ['', 'munglist'=>'array'], -'Phar::offsetExists' => ['bool', 'offset'=>'string'], -'Phar::offsetGet' => ['int', 'offset'=>'string'], -'Phar::offsetSet' => ['', 'offset'=>'string', 'value'=>'string'], -'Phar::offsetUnset' => ['bool', 'offset'=>'string'], -'Phar::running' => ['string', 'retphar='=>'bool'], -'Phar::setAlias' => ['bool', 'alias'=>'string'], -'Phar::setDefaultStub' => ['bool', 'index='=>'string', 'webindex='=>'string'], -'Phar::setMetadata' => ['', 'metadata'=>''], -'Phar::setSignatureAlgorithm' => ['', 'sigtype'=>'int', 'privatekey='=>'string'], -'Phar::setStub' => ['bool', 'stub'=>'string', 'len='=>'int'], -'Phar::startBuffering' => [''], -'Phar::stopBuffering' => [''], -'Phar::uncompressAllFiles' => ['bool'], -'Phar::unlinkArchive' => ['bool', 'archive'=>'string'], -'Phar::webPhar' => ['', 'alias='=>'string', 'index='=>'string', 'f404='=>'string', 'mimetypes='=>'array', 'rewrites='=>'array'], -'PharData::__construct' => ['void', 'fname'=>'string', 'flags='=>'int', 'alias='=>'string', 'format='=>'int'], -'PharData::addEmptyDir' => ['bool', 'dirname'=>'string'], -'PharData::addFile' => ['', 'file'=>'string', 'localname='=>'string'], -'PharData::addFromString' => ['bool', 'localname'=>'string', 'contents'=>'string'], -'PharData::buildFromDirectory' => ['array', 'base_dir'=>'string', 'regex='=>'string'], -'PharData::buildFromIterator' => ['array', 'iter'=>'iterator', 'base_directory='=>'string'], -'PharData::compress' => ['object', 'compression'=>'int', 'extension='=>'string'], -'PharData::compressFiles' => ['bool', 'compression'=>'int'], -'PharData::convertToData' => ['PharData', 'format='=>'int', 'compression='=>'int', 'extension='=>'string'], -'PharData::convertToExecutable' => ['Phar', 'format='=>'int', 'compression='=>'int', 'extension='=>'string'], -'PharData::copy' => ['bool', 'oldfile'=>'string', 'newfile'=>'string'], -'PharData::decompress' => ['object', 'extension='=>'string'], -'PharData::decompressFiles' => ['bool'], -'PharData::delete' => ['bool', 'entry'=>'string'], -'PharData::delMetadata' => ['bool'], -'PharData::extractTo' => ['bool', 'pathto'=>'string', 'files='=>'string|array', 'overwrite='=>'bool'], -'PharData::isWritable' => ['bool'], -'PharData::offsetSet' => ['', 'offset'=>'string', 'value'=>'string'], -'PharData::offsetUnset' => ['bool', 'offset'=>'string'], -'PharData::setAlias' => ['bool', 'alias'=>'string'], -'PharData::setDefaultStub' => ['bool', 'index='=>'string', 'webindex='=>'string'], -'PharData::setStub' => ['bool', 'stub'=>'string'], -'PharFileInfo::__construct' => ['void', 'entry'=>'string'], -'PharFileInfo::chmod' => ['void', 'permissions'=>'int'], -'PharFileInfo::compress' => ['bool', 'compression'=>'int'], -'PharFileInfo::decompress' => ['bool'], -'PharFileInfo::delMetadata' => ['bool'], -'PharFileInfo::getCompressedSize' => ['int'], -'PharFileInfo::getContent' => ['string'], -'PharFileInfo::getCRC32' => ['int'], -'PharFileInfo::getMetadata' => ['mixed'], -'PharFileInfo::getPharFlags' => ['int'], -'PharFileInfo::hasMetadata' => ['bool'], -'PharFileInfo::isCompressed' => ['bool', 'compression_type='=>'int'], -'PharFileInfo::isCompressedBZIP2' => ['bool'], -'PharFileInfo::isCompressedGZ' => ['bool'], -'PharFileInfo::isCRCChecked' => ['bool'], -'PharFileInfo::setCompressedBZIP2' => ['bool'], -'PharFileInfo::setCompressedGZ' => ['bool'], -'PharFileInfo::setMetadata' => ['void', 'metadata'=>'mixed'], -'PharFileInfo::setUncompressed' => ['bool'], -'phdfs::__construct' => ['void', 'ip'=>'string', 'port'=>'string'], -'phdfs::__destruct' => [''], -'phdfs::connect' => ['bool'], -'phdfs::copy' => ['bool', 'source_file'=>'string', 'destination_file'=>'string'], -'phdfs::create_directory' => ['bool', 'path'=>'string'], -'phdfs::delete' => ['bool', 'path'=>'string'], -'phdfs::disconnect' => ['bool'], -'phdfs::exists' => ['bool', 'path'=>'string'], -'phdfs::file_info' => ['array', 'path'=>'string'], -'phdfs::list_directory' => ['array', 'path'=>'string'], -'phdfs::read' => ['string', 'path'=>'string', 'length='=>'string'], -'phdfs::rename' => ['bool', 'old_path'=>'string', 'new_path'=>'string'], -'phdfs::tell' => ['int', 'path'=>'string'], -'phdfs::write' => ['bool', 'path'=>'string', 'buffer'=>'string', 'mode='=>'string'], -'php_check_syntax' => ['bool', 'filename'=>'string', 'error_message='=>'string'], -'php_ini_loaded_file' => ['string'], -'php_ini_scanned_files' => ['string'], -'php_logo_guid' => ['string'], -'php_sapi_name' => ['string'], -'php_strip_whitespace' => ['string', 'file_name'=>'string'], -'php_uname' => ['string', 'mode='=>'string'], -'php_user_filter::filter' => ['int', 'in'=>'resource', 'out'=>'resource', '&rw_consumed'=>'int', 'closing'=>'bool'], -'php_user_filter::onClose' => ['void'], -'php_user_filter::onCreate' => ['bool'], -'phpcredits' => ['bool', 'flag='=>'int'], -'phpdbg_break_file' => ['', 'file'=>'string', 'line'=>'int'], -'phpdbg_break_function' => ['', 'function'=>'string'], -'phpdbg_break_method' => ['', 'class'=>'string', 'method'=>'string'], -'phpdbg_break_next' => [''], -'phpdbg_clear' => [''], -'phpdbg_color' => ['', 'element'=>'int', 'color'=>'string'], -'phpdbg_end_oplog' => ['array', 'options='=>'array'], -'phpdbg_prompt' => ['', 'prompt'=>'string'], -'phpdbg_start_oplog' => [''], -'phpinfo' => ['bool', 'what='=>'int'], -'phpversion' => ['string|false', 'extension='=>'string'], -'pht\AtomicInteger::__construct' => ['void', 'value='=>'int'], -'pht\AtomicInteger::dec' => ['void'], -'pht\AtomicInteger::get' => ['int'], -'pht\AtomicInteger::inc' => ['void'], -'pht\AtomicInteger::lock' => ['void'], -'pht\AtomicInteger::set' => ['void', 'value'=>'int'], -'pht\AtomicInteger::unlock' => ['void'], -'pht\HashTable::lock' => ['void'], -'pht\HashTable::size' => ['int'], -'pht\HashTable::unlock' => ['void'], -'pht\Queue::front' => ['mixed'], -'pht\Queue::lock' => ['void'], -'pht\Queue::pop' => ['mixed'], -'pht\Queue::push' => ['void', 'value'=>'mixed'], -'pht\Queue::size' => ['int'], -'pht\Queue::unlock' => ['void'], -'pht\Runnable::run' => ['void'], -'pht\Vector::__construct' => ['void', 'size='=>'int', 'value='=>'mixed'], -'pht\Vector::deleteAt' => ['void', 'offset'=>'int'], -'pht\Vector::insertAt' => ['void', 'value'=>'mixed', 'offset'=>'int'], -'pht\Vector::lock' => ['void'], -'pht\Vector::pop' => ['mixed'], -'pht\Vector::push' => ['void', 'value'=>'mixed'], -'pht\Vector::resize' => ['void', 'size'=>'int', 'value='=>'mixed'], -'pht\Vector::shift' => ['mixed'], -'pht\Vector::size' => ['int'], -'pht\Vector::unlock' => ['void'], -'pht\Vector::unshift' => ['void', 'value'=>'mixed'], -'pht\Vector::updateAt' => ['void', 'value'=>'mixed', 'offset'=>'int'], -'pi' => ['float'], -'png2wbmp' => ['bool', 'pngname'=>'string', 'wbmpname'=>'string', 'dest_height'=>'int', 'dest_width'=>'int', 'threshold'=>'int'], -'pointObj::__construct' => ['void'], -'pointObj::distanceToLine' => ['float', 'p1'=>'pointObj', 'p2'=>'pointObj'], -'pointObj::distanceToPoint' => ['float', 'poPoint'=>'pointObj'], -'pointObj::distanceToShape' => ['float', 'shape'=>'shapeObj'], -'pointObj::draw' => ['int', 'map'=>'MapObj', 'layer'=>'layerObj', 'img'=>'imageObj', 'class_index'=>'int', 'text'=>'string'], -'pointObj::ms_newPointObj' => ['pointObj'], -'pointObj::project' => ['int', 'in'=>'projectionObj', 'out'=>'projectionObj'], -'pointObj::setXY' => ['int', 'x'=>'float', 'y'=>'float', 'm'=>'float'], -'pointObj::setXYZ' => ['int', 'x'=>'float', 'y'=>'float', 'z'=>'float', 'm'=>'float'], -'Pool::__construct' => ['void', 'size'=>'int', 'class'=>'string', 'ctor='=>'array'], -'Pool::collect' => ['int', 'collector'=>'Callable'], -'Pool::resize' => ['void', 'size'=>'int'], -'Pool::shutdown' => ['void'], -'Pool::submit' => ['int', 'task'=>'Threaded'], -'Pool::submitTo' => ['int', 'worker'=>'int', 'task'=>'Threaded'], -'popen' => ['resource|false', 'command'=>'string', 'mode'=>'string'], -'pos' => ['mixed', 'array_arg'=>'array'], -'posix_access' => ['bool', 'file'=>'string', 'mode='=>'int'], -'posix_ctermid' => ['string'], -'posix_errno' => ['int'], -'posix_get_last_error' => ['int'], -'posix_getcwd' => ['string'], -'posix_getegid' => ['int'], -'posix_geteuid' => ['int'], -'posix_getgid' => ['int'], -'posix_getgrgid' => ['array', 'gid'=>'int'], -'posix_getgrnam' => ['array|false', 'groupname'=>'string'], -'posix_getgroups' => ['array'], -'posix_getlogin' => ['string'], -'posix_getpgid' => ['int|false', 'pid'=>'int'], -'posix_getpgrp' => ['int'], -'posix_getpid' => ['int'], -'posix_getppid' => ['int'], -'posix_getpwnam' => ['array|false', 'groupname'=>'string'], -'posix_getpwuid' => ['array', 'uid'=>'int'], -'posix_getrlimit' => ['array'], -'posix_getsid' => ['int', 'pid'=>'int'], -'posix_getuid' => ['int'], -'posix_initgroups' => ['bool', 'name'=>'string', 'base_group_id'=>'int'], -'posix_isatty' => ['bool', 'fd'=>'resource|int'], -'posix_kill' => ['bool', 'pid'=>'int', 'sig'=>'int'], -'posix_mkfifo' => ['bool', 'pathname'=>'string', 'mode'=>'int'], -'posix_mknod' => ['bool', 'pathname'=>'string', 'mode'=>'int', 'major='=>'int', 'minor='=>'int'], -'posix_setegid' => ['bool', 'uid'=>'int'], -'posix_seteuid' => ['bool', 'uid'=>'int'], -'posix_setgid' => ['bool', 'uid'=>'int'], -'posix_setpgid' => ['bool', 'pid'=>'int', 'pgid'=>'int'], -'posix_setrlimit' => ['bool', 'resource'=>'int', 'softlimit'=>'int', 'hardlimit'=>'int'], -'posix_setsid' => ['int'], -'posix_setuid' => ['bool', 'uid'=>'int'], -'posix_strerror' => ['string', 'errno'=>'int'], -'posix_times' => ['array'], -'posix_ttyname' => ['string|false', 'fd'=>'resource|int'], -'posix_uname' => ['array'], -'Postal\Expand::expand_address' => ['string[]', 'address'=>'string', 'options='=>'array'], -'Postal\Parser::parse_address' => ['array', 'address'=>'string', 'options='=>'array'], -'pow' => ['float|int', 'base'=>'int|float', 'exponent'=>'int|float'], -'preg_filter' => ['mixed', 'regex'=>'mixed', 'replace'=>'mixed', 'subject'=>'mixed', 'limit='=>'int', '&w_count='=>'int'], -'preg_grep' => ['array', 'regex'=>'string', 'input'=>'array', 'flags='=>'int'], -'preg_last_error' => ['int'], -'preg_match' => ['int|false', 'pattern'=>'string', 'subject'=>'string', '&w_subpatterns='=>'string[]', 'flags='=>'int', 'offset='=>'int'], -'preg_match_all' => ['int|false', 'pattern'=>'string', 'subject'=>'string', '&w_subpatterns='=>'array', 'flags='=>'int', 'offset='=>'int'], -'preg_quote' => ['string', 'str'=>'string', 'delim_char='=>'string'], -'preg_replace' => ['string|array|null', 'regex'=>'string|array', 'replace'=>'string|array', 'subject'=>'string|array', 'limit='=>'int', '&w_count='=>'int'], -'preg_replace_callback' => ['string|array|null', 'regex'=>'string|array', 'callback'=>'callable', 'subject'=>'string|array', 'limit='=>'int', '&w_count='=>'int'], -'preg_replace_callback_array' => ['string|array|null', 'pattern'=>'array', 'subject'=>'string|array', 'limit='=>'int', '&w_count='=>'int'], -'preg_split' => ['array|false', 'pattern'=>'string', 'subject'=>'string', 'limit='=>'?int', 'flags='=>'int'], -'prev' => ['mixed', '&rw_array_arg'=>'array|object'], -'print' => ['int', 'arg'=>'string'], -'print_r' => ['string|true', 'var'=>'mixed', 'return='=>'bool'], -'printf' => ['int', 'format'=>'string', '...args='=>'string|int|float'], -'proc_close' => ['int', 'process'=>'resource'], -'proc_get_status' => ['array', 'process'=>'resource'], -'proc_nice' => ['bool', 'priority'=>'int'], -'proc_open' => ['resource|false', 'command'=>'string', 'descriptorspec'=>'array', '&w_pipes'=>'resource[]', 'cwd='=>'?string', 'env='=>'?array', 'other_options='=>'array'], -'proc_terminate' => ['bool', 'process'=>'resource', 'signal='=>'int'], -'projectionObj::__construct' => ['void', 'projectionString'=>'string'], -'projectionObj::getUnits' => ['int'], -'projectionObj::ms_newProjectionObj' => ['projectionObj', 'projectionString'=>'string'], -'property_exists' => ['bool', 'object_or_class'=>'object|string', 'property_name'=>'string'], -'ps_add_bookmark' => ['int', 'psdoc'=>'resource', 'text'=>'string', 'parent='=>'int', 'open='=>'int'], -'ps_add_launchlink' => ['bool', 'psdoc'=>'resource', 'llx'=>'float', 'lly'=>'float', 'urx'=>'float', 'ury'=>'float', 'filename'=>'string'], -'ps_add_locallink' => ['bool', 'psdoc'=>'resource', 'llx'=>'float', 'lly'=>'float', 'urx'=>'float', 'ury'=>'float', 'page'=>'int', 'dest'=>'string'], -'ps_add_note' => ['bool', 'psdoc'=>'resource', 'llx'=>'float', 'lly'=>'float', 'urx'=>'float', 'ury'=>'float', 'contents'=>'string', 'title'=>'string', 'icon'=>'string', 'open'=>'int'], -'ps_add_pdflink' => ['bool', 'psdoc'=>'resource', 'llx'=>'float', 'lly'=>'float', 'urx'=>'float', 'ury'=>'float', 'filename'=>'string', 'page'=>'int', 'dest'=>'string'], -'ps_add_weblink' => ['bool', 'psdoc'=>'resource', 'llx'=>'float', 'lly'=>'float', 'urx'=>'float', 'ury'=>'float', 'url'=>'string'], -'ps_arc' => ['bool', 'psdoc'=>'resource', 'x'=>'float', 'y'=>'float', 'radius'=>'float', 'alpha'=>'float', 'beta'=>'float'], -'ps_arcn' => ['bool', 'psdoc'=>'resource', 'x'=>'float', 'y'=>'float', 'radius'=>'float', 'alpha'=>'float', 'beta'=>'float'], -'ps_begin_page' => ['bool', 'psdoc'=>'resource', 'width'=>'float', 'height'=>'float'], -'ps_begin_pattern' => ['int', 'psdoc'=>'resource', 'width'=>'float', 'height'=>'float', 'xstep'=>'float', 'ystep'=>'float', 'painttype'=>'int'], -'ps_begin_template' => ['int', 'psdoc'=>'resource', 'width'=>'float', 'height'=>'float'], -'ps_circle' => ['bool', 'psdoc'=>'resource', 'x'=>'float', 'y'=>'float', 'radius'=>'float'], -'ps_clip' => ['bool', 'psdoc'=>'resource'], -'ps_close' => ['bool', 'psdoc'=>'resource'], -'ps_close_image' => ['void', 'psdoc'=>'resource', 'imageid'=>'int'], -'ps_closepath' => ['bool', 'psdoc'=>'resource'], -'ps_closepath_stroke' => ['bool', 'psdoc'=>'resource'], -'ps_continue_text' => ['bool', 'psdoc'=>'resource', 'text'=>'string'], -'ps_curveto' => ['bool', 'psdoc'=>'resource', 'x1'=>'float', 'y1'=>'float', 'x2'=>'float', 'y2'=>'float', 'x3'=>'float', 'y3'=>'float'], -'ps_delete' => ['bool', 'psdoc'=>'resource'], -'ps_end_page' => ['bool', 'psdoc'=>'resource'], -'ps_end_pattern' => ['bool', 'psdoc'=>'resource'], -'ps_end_template' => ['bool', 'psdoc'=>'resource'], -'ps_fill' => ['bool', 'psdoc'=>'resource'], -'ps_fill_stroke' => ['bool', 'psdoc'=>'resource'], -'ps_findfont' => ['int', 'psdoc'=>'resource', 'fontname'=>'string', 'encoding'=>'string', 'embed='=>'bool'], -'ps_get_buffer' => ['string', 'psdoc'=>'resource'], -'ps_get_parameter' => ['string', 'psdoc'=>'resource', 'name'=>'string', 'modifier='=>'float'], -'ps_get_value' => ['float', 'psdoc'=>'resource', 'name'=>'string', 'modifier='=>'float'], -'ps_hyphenate' => ['array', 'psdoc'=>'resource', 'text'=>'string'], -'ps_include_file' => ['bool', 'psdoc'=>'resource', 'file'=>'string'], -'ps_lineto' => ['bool', 'psdoc'=>'resource', 'x'=>'float', 'y'=>'float'], -'ps_makespotcolor' => ['int', 'psdoc'=>'resource', 'name'=>'string', 'reserved='=>'int'], -'ps_moveto' => ['bool', 'psdoc'=>'resource', 'x'=>'float', 'y'=>'float'], -'ps_new' => ['resource'], -'ps_open_file' => ['bool', 'psdoc'=>'resource', 'filename='=>'string'], -'ps_open_image' => ['int', 'psdoc'=>'resource', 'type'=>'string', 'source'=>'string', 'data'=>'string', 'length'=>'int', 'width'=>'int', 'height'=>'int', 'components'=>'int', 'bpc'=>'int', 'params'=>'string'], -'ps_open_image_file' => ['int', 'psdoc'=>'resource', 'type'=>'string', 'filename'=>'string', 'stringparam='=>'string', 'intparam='=>'int'], -'ps_open_memory_image' => ['int', 'psdoc'=>'resource', 'gd'=>'int'], -'ps_place_image' => ['bool', 'psdoc'=>'resource', 'imageid'=>'int', 'x'=>'float', 'y'=>'float', 'scale'=>'float'], -'ps_rect' => ['bool', 'psdoc'=>'resource', 'x'=>'float', 'y'=>'float', 'width'=>'float', 'height'=>'float'], -'ps_restore' => ['bool', 'psdoc'=>'resource'], -'ps_rotate' => ['bool', 'psdoc'=>'resource', 'rot'=>'float'], -'ps_save' => ['bool', 'psdoc'=>'resource'], -'ps_scale' => ['bool', 'psdoc'=>'resource', 'x'=>'float', 'y'=>'float'], -'ps_set_border_color' => ['bool', 'psdoc'=>'resource', 'red'=>'float', 'green'=>'float', 'blue'=>'float'], -'ps_set_border_dash' => ['bool', 'psdoc'=>'resource', 'black'=>'float', 'white'=>'float'], -'ps_set_border_style' => ['bool', 'psdoc'=>'resource', 'style'=>'string', 'width'=>'float'], -'ps_set_info' => ['bool', 'p'=>'resource', 'key'=>'string', 'val'=>'string'], -'ps_set_parameter' => ['bool', 'psdoc'=>'resource', 'name'=>'string', 'value'=>'string'], -'ps_set_text_pos' => ['bool', 'psdoc'=>'resource', 'x'=>'float', 'y'=>'float'], -'ps_set_value' => ['bool', 'psdoc'=>'resource', 'name'=>'string', 'value'=>'float'], -'ps_setcolor' => ['bool', 'psdoc'=>'resource', 'type'=>'string', 'colorspace'=>'string', 'c1'=>'float', 'c2'=>'float', 'c3'=>'float', 'c4'=>'float'], -'ps_setdash' => ['bool', 'psdoc'=>'resource', 'on'=>'float', 'off'=>'float'], -'ps_setflat' => ['bool', 'psdoc'=>'resource', 'value'=>'float'], -'ps_setfont' => ['bool', 'psdoc'=>'resource', 'fontid'=>'int', 'size'=>'float'], -'ps_setgray' => ['bool', 'psdoc'=>'resource', 'gray'=>'float'], -'ps_setlinecap' => ['bool', 'psdoc'=>'resource', 'type'=>'int'], -'ps_setlinejoin' => ['bool', 'psdoc'=>'resource', 'type'=>'int'], -'ps_setlinewidth' => ['bool', 'psdoc'=>'resource', 'width'=>'float'], -'ps_setmiterlimit' => ['bool', 'psdoc'=>'resource', 'value'=>'float'], -'ps_setoverprintmode' => ['bool', 'psdoc'=>'resource', 'mode'=>'int'], -'ps_setpolydash' => ['bool', 'psdoc'=>'resource', 'arr'=>'float'], -'ps_shading' => ['int', 'psdoc'=>'resource', 'type'=>'string', 'x0'=>'float', 'y0'=>'float', 'x1'=>'float', 'y1'=>'float', 'c1'=>'float', 'c2'=>'float', 'c3'=>'float', 'c4'=>'float', 'optlist'=>'string'], -'ps_shading_pattern' => ['int', 'psdoc'=>'resource', 'shadingid'=>'int', 'optlist'=>'string'], -'ps_shfill' => ['bool', 'psdoc'=>'resource', 'shadingid'=>'int'], -'ps_show' => ['bool', 'psdoc'=>'resource', 'text'=>'string'], -'ps_show2' => ['bool', 'psdoc'=>'resource', 'text'=>'string', 'len'=>'int'], -'ps_show_boxed' => ['int', 'psdoc'=>'resource', 'text'=>'string', 'left'=>'float', 'bottom'=>'float', 'width'=>'float', 'height'=>'float', 'hmode'=>'string', 'feature='=>'string'], -'ps_show_xy' => ['bool', 'psdoc'=>'resource', 'text'=>'string', 'x'=>'float', 'y'=>'float'], -'ps_show_xy2' => ['bool', 'psdoc'=>'resource', 'text'=>'string', 'len'=>'int', 'xcoor'=>'float', 'ycoor'=>'float'], -'ps_string_geometry' => ['array', 'psdoc'=>'resource', 'text'=>'string', 'fontid='=>'int', 'size='=>'float'], -'ps_stringwidth' => ['float', 'psdoc'=>'resource', 'text'=>'string', 'fontid='=>'int', 'size='=>'float'], -'ps_stroke' => ['bool', 'psdoc'=>'resource'], -'ps_symbol' => ['bool', 'psdoc'=>'resource', 'ord'=>'int'], -'ps_symbol_name' => ['string', 'psdoc'=>'resource', 'ord'=>'int', 'fontid='=>'int'], -'ps_symbol_width' => ['float', 'psdoc'=>'resource', 'ord'=>'int', 'fontid='=>'int', 'size='=>'float'], -'ps_translate' => ['bool', 'psdoc'=>'resource', 'x'=>'float', 'y'=>'float'], -'pspell_add_to_personal' => ['bool', 'pspell'=>'int', 'word'=>'string'], -'pspell_add_to_session' => ['bool', 'pspell'=>'int', 'word'=>'string'], -'pspell_check' => ['bool', 'pspell'=>'int', 'word'=>'string'], -'pspell_clear_session' => ['bool', 'pspell'=>'int'], -'pspell_config_create' => ['int|false', 'language'=>'string', 'spelling='=>'string', 'jargon='=>'string', 'encoding='=>'string'], -'pspell_config_data_dir' => ['bool', 'conf'=>'int', 'directory'=>'string'], -'pspell_config_dict_dir' => ['bool', 'conf'=>'int', 'directory'=>'string'], -'pspell_config_ignore' => ['bool', 'conf'=>'int', 'ignore'=>'int'], -'pspell_config_mode' => ['bool', 'conf'=>'int', 'mode'=>'int'], -'pspell_config_personal' => ['bool', 'conf'=>'int', 'personal'=>'string'], -'pspell_config_repl' => ['bool', 'conf'=>'int', 'repl'=>'string'], -'pspell_config_runtogether' => ['bool', 'conf'=>'int', 'runtogether'=>'bool'], -'pspell_config_save_repl' => ['bool', 'conf'=>'int', 'save'=>'bool'], -'pspell_new' => ['int|false', 'language'=>'string', 'spelling='=>'string', 'jargon='=>'string', 'encoding='=>'string', 'mode='=>'int'], -'pspell_new_config' => ['int|false', 'config'=>'int'], -'pspell_new_personal' => ['int|false', 'personal'=>'string', 'language'=>'string', 'spelling='=>'string', 'jargon='=>'string', 'encoding='=>'string', 'mode='=>'int'], -'pspell_save_wordlist' => ['bool', 'pspell'=>'int'], -'pspell_store_replacement' => ['bool', 'pspell'=>'int', 'misspell'=>'string', 'correct'=>'string'], -'pspell_suggest' => ['array', 'pspell'=>'int', 'word'=>'string'], -'putenv' => ['bool', 'setting'=>'string'], -'px_close' => ['bool', 'pxdoc'=>'resource'], -'px_create_fp' => ['bool', 'pxdoc'=>'resource', 'file'=>'resource', 'fielddesc'=>'array'], -'px_date2string' => ['string', 'pxdoc'=>'resource', 'value'=>'int', 'format'=>'string'], -'px_delete' => ['bool', 'pxdoc'=>'resource'], -'px_delete_record' => ['bool', 'pxdoc'=>'resource', 'num'=>'int'], -'px_get_field' => ['array', 'pxdoc'=>'resource', 'fieldno'=>'int'], -'px_get_info' => ['array', 'pxdoc'=>'resource'], -'px_get_parameter' => ['string', 'pxdoc'=>'resource', 'name'=>'string'], -'px_get_record' => ['array', 'pxdoc'=>'resource', 'num'=>'int', 'mode='=>'int'], -'px_get_schema' => ['array', 'pxdoc'=>'resource', 'mode='=>'int'], -'px_get_value' => ['float', 'pxdoc'=>'resource', 'name'=>'string'], -'px_insert_record' => ['int', 'pxdoc'=>'resource', 'data'=>'array'], -'px_new' => ['resource'], -'px_numfields' => ['int', 'pxdoc'=>'resource'], -'px_numrecords' => ['int', 'pxdoc'=>'resource'], -'px_open_fp' => ['bool', 'pxdoc'=>'resource', 'file'=>'resource'], -'px_put_record' => ['bool', 'pxdoc'=>'resource', 'record'=>'array', 'recpos='=>'int'], -'px_retrieve_record' => ['array', 'pxdoc'=>'resource', 'num'=>'int', 'mode='=>'int'], -'px_set_blob_file' => ['bool', 'pxdoc'=>'resource', 'filename'=>'string'], -'px_set_parameter' => ['bool', 'pxdoc'=>'resource', 'name'=>'string', 'value'=>'string'], -'px_set_tablename' => ['void', 'pxdoc'=>'resource', 'name'=>'string'], -'px_set_targetencoding' => ['bool', 'pxdoc'=>'resource', 'encoding'=>'string'], -'px_set_value' => ['bool', 'pxdoc'=>'resource', 'name'=>'string', 'value'=>'float'], -'px_timestamp2string' => ['string', 'pxdoc'=>'resource', 'value'=>'float', 'format'=>'string'], -'px_update_record' => ['bool', 'pxdoc'=>'resource', 'data'=>'array', 'num'=>'int'], -'qdom_error' => ['string'], -'qdom_tree' => ['QDomDocument', 'doc'=>'string'], -'querymapObj::convertToString' => ['string'], -'querymapObj::free' => ['void'], -'querymapObj::set' => ['int', 'property_name'=>'string', 'new_value'=>''], -'querymapObj::updateFromString' => ['int', 'snippet'=>'string'], -'QuickHashIntHash::__construct' => ['void', 'size'=>'int', 'options='=>'int'], -'QuickHashIntHash::add' => ['bool', 'key'=>'int', 'value='=>'int'], -'QuickHashIntHash::delete' => ['bool', 'key'=>'int'], -'QuickHashIntHash::exists' => ['bool', 'key'=>'int'], -'QuickHashIntHash::get' => ['int', 'key'=>'int'], -'QuickHashIntHash::getSize' => ['int'], -'QuickHashIntHash::loadFromFile' => ['QuickHashIntHash', 'filename'=>'string', 'options='=>'int'], -'QuickHashIntHash::loadFromString' => ['QuickHashIntHash', 'contents'=>'string', 'options='=>'int'], -'QuickHashIntHash::saveToFile' => ['void', 'filename'=>'string'], -'QuickHashIntHash::saveToString' => ['string'], -'QuickHashIntHash::set' => ['bool', 'key'=>'int', 'value'=>'int'], -'QuickHashIntHash::update' => ['bool', 'key'=>'int', 'value'=>'int'], -'QuickHashIntSet::__construct' => ['void', 'size'=>'int', 'options='=>'int'], -'QuickHashIntSet::add' => ['bool', 'key'=>'int'], -'QuickHashIntSet::delete' => ['bool', 'key'=>'int'], -'QuickHashIntSet::exists' => ['bool', 'key'=>'int'], -'QuickHashIntSet::getSize' => ['int'], -'QuickHashIntSet::loadFromFile' => ['QuickHashIntSet', 'filename'=>'string', 'size='=>'int', 'options='=>'int'], -'QuickHashIntSet::loadFromString' => ['QuickHashIntSet', 'contents'=>'string', 'size='=>'int', 'options='=>'int'], -'QuickHashIntSet::saveToFile' => ['void', 'filename'=>'string'], -'QuickHashIntSet::saveToString' => ['string'], -'QuickHashIntStringHash::__construct' => ['void', 'size'=>'int', 'options='=>'int'], -'QuickHashIntStringHash::add' => ['bool', 'key'=>'int', 'value'=>'string'], -'QuickHashIntStringHash::delete' => ['bool', 'key'=>'int'], -'QuickHashIntStringHash::exists' => ['bool', 'key'=>'int'], -'QuickHashIntStringHash::get' => ['mixed', 'key'=>'int'], -'QuickHashIntStringHash::getSize' => ['int'], -'QuickHashIntStringHash::loadFromFile' => ['QuickHashIntStringHash', 'filename'=>'string', 'size='=>'int', 'options='=>'int'], -'QuickHashIntStringHash::loadFromString' => ['QuickHashIntStringHash', 'contents'=>'string', 'size='=>'int', 'options='=>'int'], -'QuickHashIntStringHash::saveToFile' => ['void', 'filename'=>'string'], -'QuickHashIntStringHash::saveToString' => ['string'], -'QuickHashIntStringHash::set' => ['int', 'key'=>'int', 'value'=>'string'], -'QuickHashIntStringHash::update' => ['bool', 'key'=>'int', 'value'=>'string'], -'QuickHashStringIntHash::__construct' => ['void', 'size'=>'int', 'options='=>'int'], -'QuickHashStringIntHash::add' => ['bool', 'key'=>'string', 'value'=>'int'], -'QuickHashStringIntHash::delete' => ['bool', 'key'=>'string'], -'QuickHashStringIntHash::exists' => ['bool', 'key'=>'string'], -'QuickHashStringIntHash::get' => ['mixed', 'key'=>'string'], -'QuickHashStringIntHash::getSize' => ['int'], -'QuickHashStringIntHash::loadFromFile' => ['QuickHashStringIntHash', 'filename'=>'string', 'size='=>'int', 'options='=>'int'], -'QuickHashStringIntHash::loadFromString' => ['QuickHashStringIntHash', 'contents'=>'string', 'size='=>'int', 'options='=>'int'], -'QuickHashStringIntHash::saveToFile' => ['void', 'filename'=>'string'], -'QuickHashStringIntHash::saveToString' => ['string'], -'QuickHashStringIntHash::set' => ['int', 'key'=>'string', 'value'=>'int'], -'QuickHashStringIntHash::update' => ['bool', 'key'=>'string', 'value'=>'int'], -'quoted_printable_decode' => ['string', 'str'=>'string'], -'quoted_printable_encode' => ['string', 'str'=>'string'], -'quotemeta' => ['string', 'str'=>'string'], -'rad2deg' => ['float', 'number'=>'float'], -'radius_acct_open' => ['resource'], -'radius_add_server' => ['bool', 'radius_handle'=>'resource', 'hostname'=>'string', 'port'=>'int', 'secret'=>'string', 'timeout'=>'int', 'max_tries'=>'int'], -'radius_auth_open' => ['resource'], -'radius_close' => ['bool', 'radius_handle'=>'resource'], -'radius_config' => ['bool', 'radius_handle'=>'resource', 'file'=>'string'], -'radius_create_request' => ['bool', 'radius_handle'=>'resource', 'type'=>'int'], -'radius_cvt_addr' => ['string', 'data'=>'string'], -'radius_cvt_int' => ['int', 'data'=>'string'], -'radius_cvt_string' => ['string', 'data'=>'string'], -'radius_demangle' => ['string', 'radius_handle'=>'resource', 'mangled'=>'string'], -'radius_demangle_mppe_key' => ['string', 'radius_handle'=>'resource', 'mangled'=>'string'], -'radius_get_attr' => ['mixed', 'radius_handle'=>'resource'], -'radius_get_tagged_attr_data' => ['string', 'data'=>'string'], -'radius_get_tagged_attr_tag' => ['int', 'data'=>'string'], -'radius_get_vendor_attr' => ['array', 'data'=>'string'], -'radius_put_addr' => ['bool', 'radius_handle'=>'resource', 'type'=>'int', 'addr'=>'string'], -'radius_put_attr' => ['bool', 'radius_handle'=>'resource', 'type'=>'int', 'value'=>'string'], -'radius_put_int' => ['bool', 'radius_handle'=>'resource', 'type'=>'int', 'value'=>'int'], -'radius_put_string' => ['bool', 'radius_handle'=>'resource', 'type'=>'int', 'value'=>'string'], -'radius_put_vendor_addr' => ['bool', 'radius_handle'=>'resource', 'vendor'=>'int', 'type'=>'int', 'addr'=>'string'], -'radius_put_vendor_attr' => ['bool', 'radius_handle'=>'resource', 'vendor'=>'int', 'type'=>'int', 'value'=>'string'], -'radius_put_vendor_int' => ['bool', 'radius_handle'=>'resource', 'vendor'=>'int', 'type'=>'int', 'value'=>'int'], -'radius_put_vendor_string' => ['bool', 'radius_handle'=>'resource', 'vendor'=>'int', 'type'=>'int', 'value'=>'string'], -'radius_request_authenticator' => ['string', 'radius_handle'=>'resource'], -'radius_salt_encrypt_attr' => ['string', 'radius_handle'=>'resource', 'data'=>'string'], -'radius_send_request' => ['int', 'radius_handle'=>'resource'], -'radius_server_secret' => ['string', 'radius_handle'=>'resource'], -'radius_strerror' => ['string', 'radius_handle'=>'resource'], -'rand' => ['int', 'min'=>'int', 'max'=>'int'], -'rand\'1' => ['int'], -'random_bytes' => ['string', 'length'=>'int'], -'random_int' => ['int', 'min'=>'int', 'max'=>'int'], -'range' => ['array', 'low'=>'mixed', 'high'=>'mixed', 'step='=>'int|float'], -'RangeException::__clone' => ['void'], -'RangeException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'(?Throwable)|(?RangeException)'], -'RangeException::__toString' => ['string'], -'RangeException::getCode' => ['int'], -'RangeException::getFile' => ['string'], -'RangeException::getLine' => ['int'], -'RangeException::getMessage' => ['string'], -'RangeException::getPrevious' => ['Throwable|RangeException|null'], -'RangeException::getTrace' => ['array'], -'RangeException::getTraceAsString' => ['string'], -'rar_allow_broken_set' => ['bool', 'rarfile'=>'RarArchive', 'allow_broken'=>'bool'], -'rar_broken_is' => ['bool', 'rarfile'=>'rararchive'], -'rar_close' => ['bool', 'rarfile'=>'rararchive'], -'rar_comment_get' => ['string', 'rarfile'=>'rararchive'], -'rar_entry_get' => ['RarEntry', 'entryname'=>'string', 'rarfile'=>'rararchive'], -'rar_list' => ['RarArchive', 'rarfile'=>'rararchive'], -'rar_open' => ['RarArchive', 'filename'=>'string', 'password='=>'string', 'volume_callback='=>'callable'], -'rar_solid_is' => ['bool', 'rarfile'=>'rararchive'], -'rar_wrapper_cache_stats' => ['string'], -'RarArchive::__toString' => ['string'], -'RarArchive::close' => ['bool', 'rarfile'=>'rararchive'], -'RarArchive::getComment' => ['string', 'rarfile'=>'rararchive'], -'RarArchive::getEntries' => ['RarArchive', 'rarfile'=>'rararchive'], -'RarArchive::getEntry' => ['RarEntry', 'entryname'=>'string', 'rarfile'=>'rararchive'], -'RarArchive::isBroken' => ['bool', 'rarfile'=>'rararchive'], -'RarArchive::isSolid' => ['bool', 'rarfile'=>'rararchive'], -'RarArchive::open' => ['RarArchive', 'filename'=>'string', 'password='=>'string', 'volume_callback='=>'callable'], -'RarArchive::setAllowBroken' => ['bool', 'allow_broken'=>'bool', 'rarfile'=>'rararchive'], -'RarEntry::__toString' => ['string'], -'RarEntry::extract' => ['bool', 'dir'=>'string', 'filepath='=>'string', 'password='=>'string', 'extended_data='=>'bool'], -'RarEntry::getAttr' => ['int'], -'RarEntry::getCrc' => ['string'], -'RarEntry::getFileTime' => ['string'], -'RarEntry::getHostOs' => ['int'], -'RarEntry::getMethod' => ['int'], -'RarEntry::getName' => ['string'], -'RarEntry::getPackedSize' => ['int'], -'RarEntry::getStream' => ['resource', 'password='=>'string'], -'RarEntry::getUnpackedSize' => ['int'], -'RarEntry::getVersion' => ['int'], -'RarEntry::isDirectory' => ['bool'], -'RarEntry::isEncrypted' => ['bool'], -'RarException::getCode' => ['int'], -'RarException::getFile' => ['string'], -'RarException::getLine' => ['int'], -'RarException::getMessage' => ['string'], -'RarException::getPrevious' => ['Exception|Throwable'], -'RarException::getTrace' => ['array'], -'RarException::getTraceAsString' => ['string'], -'RarException::isUsingExceptions' => ['bool'], -'RarException::setUsingExceptions' => ['RarEntry', 'using_exceptions'=>'bool'], -'rawurldecode' => ['string', 'str'=>'string'], -'rawurlencode' => ['string', 'str'=>'string'], -'read_exif_data' => ['array', 'filename'=>'string', 'sections_needed='=>'string', 'sub_arrays='=>'bool', 'read_thumbnail='=>'bool'], -'readdir' => ['string|false', 'dir_handle='=>'resource'], -'readfile' => ['int|false', 'filename'=>'string', 'use_include_path='=>'bool', 'context='=>'resource'], -'readgzfile' => ['int|false', 'filename'=>'string', 'use_include_path='=>'int'], -'readline' => ['string', 'prompt='=>'?string'], -'readline_add_history' => ['bool', 'prompt'=>'string'], -'readline_callback_handler_install' => ['bool', 'prompt'=>'string', 'callback'=>'callable'], -'readline_callback_handler_remove' => ['bool'], -'readline_callback_read_char' => ['void'], -'readline_clear_history' => ['bool'], -'readline_completion_function' => ['bool', 'funcname'=>'callable'], -'readline_info' => ['mixed', 'varname='=>'string', 'newvalue='=>'string'], -'readline_list_history' => ['array'], -'readline_on_new_line' => ['void'], -'readline_read_history' => ['bool', 'filename='=>'string'], -'readline_redisplay' => ['void'], -'readline_write_history' => ['bool', 'filename='=>'string'], -'readlink' => ['string', 'filename'=>'string'], -'realpath' => ['string|false', 'path'=>'string'], -'realpath_cache_get' => ['array'], -'realpath_cache_size' => ['int'], -'recode' => ['string', 'request'=>'string', 'str'=>'string'], -'recode_file' => ['bool', 'request'=>'string', 'input'=>'resource', 'output'=>'resource'], -'recode_string' => ['string', 'request'=>'string', 'str'=>'string'], -'rectObj::__construct' => ['void'], -'rectObj::draw' => ['int', 'map'=>'MapObj', 'layer'=>'layerObj', 'img'=>'imageObj', 'class_index'=>'int', 'text'=>'string'], -'rectObj::fit' => ['float', 'width'=>'int', 'height'=>'int'], -'rectObj::ms_newRectObj' => ['rectObj'], -'rectObj::project' => ['int', 'in'=>'projectionObj', 'out'=>'projectionObj'], -'rectObj::set' => ['int', 'property_name'=>'string', 'new_value'=>''], -'rectObj::setextent' => ['void', 'minx'=>'float', 'miny'=>'float', 'maxx'=>'float', 'maxy'=>'float'], -'RecursiveArrayIterator::__construct' => ['void', 'array='=>'array|object', 'flags='=>'int'], -'RecursiveArrayIterator::append' => ['void', 'value'=>'mixed'], -'RecursiveArrayIterator::asort' => ['void'], -'RecursiveArrayIterator::count' => ['int'], -'RecursiveArrayIterator::current' => ['mixed'], -'RecursiveArrayIterator::getArrayCopy' => ['array'], -'RecursiveArrayIterator::getChildren' => ['RecursiveArrayIterator'], -'RecursiveArrayIterator::getFlags' => ['void'], -'RecursiveArrayIterator::hasChildren' => ['bool'], -'RecursiveArrayIterator::key' => ['false|int|string'], -'RecursiveArrayIterator::ksort' => ['void'], -'RecursiveArrayIterator::natcasesort' => ['void'], -'RecursiveArrayIterator::natsort' => ['void'], -'RecursiveArrayIterator::next' => ['void'], -'RecursiveArrayIterator::offsetExists' => ['void', 'index'=>'string'], -'RecursiveArrayIterator::offsetGet' => ['mixed', 'index'=>'string'], -'RecursiveArrayIterator::offsetSet' => ['void', 'index'=>'string', 'newval'=>'string'], -'RecursiveArrayIterator::offsetUnset' => ['void', 'index'=>'string'], -'RecursiveArrayIterator::rewind' => ['void'], -'RecursiveArrayIterator::seek' => ['void', 'position'=>'int'], -'RecursiveArrayIterator::serialize' => ['string'], -'RecursiveArrayIterator::setFlags' => ['void', 'flags'=>'string'], -'RecursiveArrayIterator::uasort' => ['void', 'cmp_function'=>'callable(mixed,mixed):int'], -'RecursiveArrayIterator::uksort' => ['void', 'cmp_function'=>'callable(mixed,mixed):int'], -'RecursiveArrayIterator::unserialize' => ['string', 'serialized'=>'string'], -'RecursiveArrayIterator::valid' => ['bool'], -'RecursiveCachingIterator::__construct' => ['void', 'it'=>'Iterator', 'flags'=>''], -'RecursiveCachingIterator::getChildren' => ['RecursiveCachingIterator'], -'RecursiveCachingIterator::hasChildren' => ['bool'], -'RecursiveCallbackFilterIterator::__construct' => ['void', 'it'=>'recursiveiterator', 'func'=>'callable'], -'RecursiveCallbackFilterIterator::getChildren' => ['RecursiveCallbackFilterIterator'], -'RecursiveCallbackFilterIterator::hasChildren' => ['void'], -'RecursiveDirectoryIterator::__construct' => ['void', 'path'=>'string', 'flags='=>'int'], -'RecursiveDirectoryIterator::getChildren' => ['object'], -'RecursiveDirectoryIterator::getSubPath' => ['string'], -'RecursiveDirectoryIterator::getSubPathname' => ['string'], -'RecursiveDirectoryIterator::hasChildren' => ['bool', 'allow_links='=>'bool'], -'RecursiveDirectoryIterator::key' => ['string'], -'RecursiveDirectoryIterator::next' => ['void'], -'RecursiveDirectoryIterator::rewind' => ['void'], -'RecursiveFilterIterator::__construct' => ['void', 'it'=>'recursiveiterator'], -'RecursiveFilterIterator::getChildren' => ['RecursiveFilterIterator'], -'RecursiveFilterIterator::hasChildren' => ['bool'], -'RecursiveIterator::getChildren' => ['RecursiveIterator'], -'RecursiveIterator::hasChildren' => ['bool'], -'RecursiveIteratorIterator::__construct' => ['void', 'it'=>'RecursiveIterator|IteratorAggregate', 'mode='=>'int', 'flags='=>'int'], -'RecursiveIteratorIterator::beginChildren' => ['void'], -'RecursiveIteratorIterator::beginIteration' => ['RecursiveIterator'], -'RecursiveIteratorIterator::callGetChildren' => ['RecursiveIterator'], -'RecursiveIteratorIterator::callHasChildren' => ['bool'], -'RecursiveIteratorIterator::current' => ['mixed'], -'RecursiveIteratorIterator::endChildren' => ['void'], -'RecursiveIteratorIterator::endIteration' => ['RecursiveIterator'], -'RecursiveIteratorIterator::getDepth' => ['int'], -'RecursiveIteratorIterator::getInnerIterator' => ['RecursiveIterator'], -'RecursiveIteratorIterator::getMaxDepth' => ['int|false'], -'RecursiveIteratorIterator::getSubIterator' => ['RecursiveIterator', 'level='=>'int'], -'RecursiveIteratorIterator::key' => ['mixed'], -'RecursiveIteratorIterator::next' => ['void'], -'RecursiveIteratorIterator::nextElement' => ['void'], -'RecursiveIteratorIterator::rewind' => ['void'], -'RecursiveIteratorIterator::setMaxDepth' => ['void', 'max_depth='=>'int'], -'RecursiveIteratorIterator::valid' => ['bool'], -'RecursiveRegexIterator::__construct' => ['void', 'it'=>'recursiveiterator', 'regex='=>'string', 'mode='=>'int', 'flags='=>'int', 'preg_flags='=>'int'], -'RecursiveRegexIterator::getChildren' => ['RecursiveRegexIterator'], -'RecursiveRegexIterator::hasChildren' => ['bool'], -'RecursiveTreeIterator::__construct' => ['void', 'it'=>'recursiveiterator|iteratoraggregate', 'flags'=>'int', 'cit_flags'=>'int', 'mode'=>'int'], -'RecursiveTreeIterator::beginChildren' => ['void'], -'RecursiveTreeIterator::beginIteration' => ['RecursiveIterator'], -'RecursiveTreeIterator::callGetChildren' => ['RecursiveIterator'], -'RecursiveTreeIterator::callHasChildren' => ['bool'], -'RecursiveTreeIterator::current' => ['string'], -'RecursiveTreeIterator::endChildren' => ['void'], -'RecursiveTreeIterator::endIteration' => ['void'], -'RecursiveTreeIterator::getEntry' => ['string'], -'RecursiveTreeIterator::getPostfix' => ['string'], -'RecursiveTreeIterator::getPrefix' => ['string'], -'RecursiveTreeIterator::key' => ['string'], -'RecursiveTreeIterator::next' => ['void'], -'RecursiveTreeIterator::nextElement' => ['void'], -'RecursiveTreeIterator::rewind' => ['void'], -'RecursiveTreeIterator::setPostfix' => ['void', 'prefix'=>'string'], -'RecursiveTreeIterator::setPrefixPart' => ['void', 'part'=>'int', 'prefix'=>'string'], -'RecursiveTreeIterator::valid' => ['bool'], -'Redis::__construct' => ['void'], -'Redis::_prefix' => ['string', 'value'=>'mixed'], -'Redis::_serialize' => ['mixed', 'value'=>'mixed'], -'Redis::_unserialize' => ['mixed', 'value'=>'string'], -'Redis::append' => ['int', 'key'=>'string', 'value'=>'string'], -'Redis::auth' => ['bool', 'password'=>'string'], -'Redis::bgRewriteAOF' => ['bool'], -'Redis::bgrewriteaof' => ['bool'], -'Redis::bgSave' => ['bool'], -'Redis::bitCount' => ['int', 'key'=>'string'], -'Redis::bitcount' => ['int', 'key'=>'string'], -'Redis::bitOp' => ['int', 'operation'=>'string', '...args'=>'string'], -'Redis::bitop' => ['int', 'operation'=>'string', '...args'=>'string'], -'Redis::bitpos' => ['int', 'key'=>'string', 'bit'=>'int', 'start='=>'int', 'end='=>'int'], -'Redis::blPop' => ['array', 'keys'=>'array', 'timeout'=>'int'], -'Redis::brPop' => ['array', 'keys'=>'array', 'timeout'=>'int'], -'Redis::brpoplpush' => ['string|false', 'srcKey'=>'string', 'dstKey'=>'string', 'timeout'=>'int'], -'Redis::clearLastError' => ['bool'], -'Redis::client' => ['mixed', 'command'=>'string', 'arg='=>'string'], -'Redis::close' => ['bool'], -'Redis::config' => ['string', 'key'=>'string', 'value='=>'string'], -'Redis::connect' => ['bool', 'host'=>'string', 'port='=>'int', 'timeout='=>'float', 'retry_interval='=>'?int'], -'Redis::dbSize' => ['int'], -'Redis::decr' => ['int', 'key'=>'string'], -'Redis::decrBy' => ['int', 'key'=>'string', 'value'=>'int'], -'Redis::decrByFloat' => ['float', 'key'=>'string', 'value'=>'float'], -'Redis::del' => ['int', 'key'=>'string', '...args'=>'string'], -'Redis::del\'1' => ['int', 'key'=>'string[]'], -'Redis::delete' => ['int', 'key'=>'string', '...args'=>'string'], -'Redis::delete\'1' => ['int', 'key'=>'string[]'], -'Redis::discard' => [''], -'Redis::dump' => ['string|false', 'key'=>'string'], -'Redis::echo' => ['string', 'message'=>'string'], -'Redis::eval' => ['mixed', 'script'=>'', 'args='=>'', 'numKeys='=>''], -'Redis::evalSha' => ['mixed', 'scriptSha'=>'string', 'args='=>'array', 'numKeys='=>'int'], -'Redis::evalsha' => ['mixed', 'scriptSha'=>'string', 'args='=>'array', 'numKeys='=>'int'], -'Redis::evaluate' => ['mixed', 'script'=>'string', 'args='=>'array', 'numKeys='=>'int'], -'Redis::evaluateSha' => ['', 'scriptSha'=>'string', 'args='=>'array', 'numKeys='=>'int'], -'Redis::exec' => ['array'], -'Redis::exists' => ['bool', 'key'=>'string'], -'Redis::expire' => ['bool', 'key'=>'string', 'ttl'=>'int'], -'Redis::expireAt' => ['bool', 'key'=>'string', 'expiry'=>'int'], -'Redis::flushAll' => ['bool'], -'Redis::flushDb' => ['bool'], -'Redis::flushDB' => ['bool'], -'Redis::geoAdd' => ['int', 'key'=>'string', 'longitude'=>'float', 'latitude'=>'float', 'member'=>'string', '...other_triples='=>'string|int|float'], -'Redis::geoDist' => ['float', 'key'=>'string', 'member1'=>'string', 'member2'=>'string', 'unit='=>'string'], -'Redis::geoHash' => ['array', 'key'=>'string', 'member'=>'string', '...other_members='=>'string'], -'Redis::geoPos' => ['array', 'key'=>'string', 'member'=>'string', '...members'=>'string'], -'Redis::geoRadius' => ['array|int', 'key'=>'string', 'longitude'=>'float', 'latitude'=>'float', 'radius'=>'float', 'unit'=>'float', 'options='=>'array'], -'Redis::geoRadiusByMember' => ['array|int', 'key'=>'string', 'member'=>'string', 'radius'=>'float', 'units'=>'string', 'options='=>'array'], -'Redis::get' => ['string|false', 'key'=>'string'], -'Redis::getBit' => ['int', 'key'=>'string', 'offset'=>'int'], -'Redis::getKeys' => ['array', 'pattern'=>'string'], -'Redis::getLastError' => ['null|string'], -'Redis::getMode' => ['int'], -'Redis::getMultiple' => ['array', 'keys'=>'string[]'], -'Redis::getOption' => ['int', 'name'=>'int'], -'Redis::getRange' => ['int', 'key'=>'string', 'start'=>'int', 'end'=>'int'], -'Redis::getSet' => ['string', 'key'=>'string', 'string'=>'string'], -'Redis::hDel' => ['int|false', 'key'=>'string', 'hashKey1'=>'string', 'hashKey2='=>'string', 'hashKeyN='=>'string'], -'Redis::hExists' => ['bool', 'key'=>'string', 'hashKey'=>'string'], -'Redis::hGet' => ['string|false', 'key'=>'string', 'hashKey'=>'string'], -'Redis::hGetAll' => ['array', 'key'=>'string'], -'Redis::hIncrBy' => ['int', 'key'=>'string', 'hashKey'=>'string', 'value'=>'int'], -'Redis::hIncrByFloat' => ['float', 'key'=>'string', 'field'=>'string', 'increment'=>'float'], -'Redis::hKeys' => ['array', 'key'=>'string'], -'Redis::hLen' => ['int|false', 'key'=>'string'], -'Redis::hMGet' => ['array', 'key'=>'string', 'hashKeys'=>'array'], -'Redis::hMget' => ['array', 'key'=>'string', 'hashKeys'=>'array'], -'Redis::hMSet' => ['bool', 'key'=>'string', 'hashKeys'=>'array'], -'Redis::hMset' => ['bool', 'key'=>'string', 'hashKeys'=>'array'], -'Redis::hScan' => ['array', 'key'=>'string', 'iterator'=>'int', 'pattern='=>'string', 'count='=>'int'], -'Redis::hscan' => ['array', 'key'=>'string', 'iterator'=>'int', 'pattern='=>'string', 'count='=>'int'], -'Redis::hSet' => ['int|false', 'key'=>'string', 'hashKey'=>'string', 'value'=>'string'], -'Redis::hSetNx' => ['bool', 'key'=>'string', 'hashKey'=>'string', 'value'=>'string'], -'Redis::hVals' => ['array', 'key'=>'string'], -'Redis::incr' => ['int', 'key'=>'string'], -'Redis::incrBy' => ['int', 'key'=>'string', 'value'=>'int'], -'Redis::incrByFloat' => ['float', 'key'=>'string'], -'Redis::info' => ['array', 'option='=>'string'], -'Redis::keys' => ['array', 'pattern'=>'string'], -'Redis::lastSave' => ['int'], -'Redis::lGet' => ['', 'key'=>'string', 'index'=>'int'], -'Redis::lGetRange' => ['', 'key'=>'string', 'start'=>'int', 'end'=>'int'], -'Redis::lIndex' => ['string|false', 'key'=>'string', 'index'=>'int'], -'Redis::lindex' => ['string|false', 'key'=>'string', 'index'=>'int'], -'Redis::lInsert' => ['int', 'key'=>'string', 'position'=>'int', 'pivot'=>'string', 'value'=>'string'], -'Redis::listTrim' => ['', 'key'=>'string', 'start'=>'int', 'stop'=>'int'], -'Redis::lLen' => ['int|false', 'key'=>'string'], -'Redis::lPop' => ['string', 'key'=>'string'], -'Redis::lPush' => ['bool|int', 'key'=>'string', 'value1'=>'string', 'value2='=>'string', 'valueN='=>'string'], -'Redis::lPushx' => ['int', 'key'=>'string', 'value'=>'string'], -'Redis::lRange' => ['array', 'key'=>'string', 'start'=>'int', 'end'=>'int'], -'Redis::lrange' => ['array', 'key'=>'string', 'start'=>'int', 'end'=>'int'], -'Redis::lRem' => ['int|false', 'key'=>'string', 'value'=>'string', 'count'=>'int'], -'Redis::lrem' => ['int|false', 'key'=>'string', 'value'=>'string', 'count'=>'int'], -'Redis::lRemove' => ['', 'key'=>'string', 'value'=>'string', 'count'=>'int'], -'Redis::lSet' => ['bool', 'key'=>'string', 'index'=>'int', 'value'=>'string'], -'Redis::lSize' => ['', 'key'=>'string'], -'Redis::lTrim' => ['array|false', 'key'=>'string', 'start'=>'int', 'stop'=>'int'], -'Redis::ltrim' => ['array|false', 'key'=>'string', 'start'=>'int', 'stop'=>'int'], -'Redis::mGet' => ['array', 'keys'=>'string[]'], -'Redis::mget' => ['array', 'keys'=>'string[]'], -'Redis::migrate' => ['bool', 'host'=>'string', 'port'=>'int', 'db'=>'int', 'timeout'=>'int', 'copy='=>'bool', 'replace='=>'bool'], -'Redis::move' => ['bool', 'key'=>'string', 'dbindex'=>'int'], -'Redis::mSet' => ['bool', 'pairs'=>'array'], -'Redis::mset' => ['bool', 'pairs'=>'array'], -'Redis::mSetNx' => ['bool', 'pairs'=>'array'], -'Redis::msetnx' => ['bool', 'pairs'=>'array'], -'Redis::multi' => ['Redis', 'mode='=>'int'], -'Redis::object' => ['string|long|false', 'info'=>'string', 'key'=>'string'], -'Redis::open' => ['bool', 'host'=>'string', 'port='=>'int', 'timeout='=>'float', 'retry_interval='=>'?int'], -'Redis::pconnect' => ['bool', 'host'=>'string', 'port='=>'int', 'timeout='=>'float', 'persistent_id='=>'string', 'retry_interval='=>'?int'], -'Redis::persist' => ['bool', 'key'=>'string'], -'Redis::pExpire' => ['bool', 'key'=>'string', 'ttl'=>'int'], -'Redis::pexpire' => ['bool', 'key'=>'string', 'ttl'=>'int'], -'Redis::pexpireAt' => ['bool', 'key'=>'string', 'expiry'=>'int'], -'Redis::pfAdd' => ['bool', 'key'=>'string', 'elements'=>'array'], -'Redis::pfadd' => ['bool', 'key'=>'string', 'elements'=>'array'], -'Redis::pfCount' => ['int', 'key'=>'array|string'], -'Redis::pfcount' => ['int', 'key'=>'array|string'], -'Redis::pfMerge' => ['bool', 'destkey'=>'string', 'sourcekeys'=>'array'], -'Redis::pfmerge' => ['bool', 'destkey'=>'string', 'sourcekeys'=>'array'], -'Redis::ping' => ['string'], -'Redis::popen' => ['bool', 'host'=>'string', 'port='=>'int', 'timeout='=>'float', 'persistent_id='=>'string', 'retry_interval='=>'?int'], -'Redis::psetex' => ['bool', 'key'=>'string', 'ttl'=>'int', 'value'=>'string'], -'Redis::psubscribe' => ['', 'patterns'=>'array', 'callback'=>'array|string'], -'Redis::pttl' => ['int|false', 'key'=>'string'], -'Redis::publish' => ['int', 'channel'=>'string', 'message'=>'string'], -'Redis::pubsub' => ['array|int', 'keyword'=>'string', 'argument'=>'array|string'], -'Redis::randomKey' => ['string'], -'Redis::rawCommand' => ['mixed', 'command'=>'string', 'arguments'=>'mixed'], -'Redis::rawcommand' => ['mixed', 'command'=>'string', 'arguments'=>'mixed'], -'Redis::rename' => ['bool', 'srckey'=>'string', 'dstkey'=>'string'], -'Redis::renameKey' => ['bool', 'srckey'=>'string', 'dstkey'=>'string'], -'Redis::renameNx' => ['bool', 'srckey'=>'string', 'dstkey'=>'string'], -'Redis::resetStat' => ['bool'], -'Redis::restore' => ['bool', 'key'=>'string', 'ttl'=>'int', 'value'=>'string'], -'Redis::rPop' => ['string', 'key'=>'string'], -'Redis::rpoplpush' => ['string', 'srcKey'=>'string', 'dstKey'=>'string'], -'Redis::rPush' => ['bool|int', 'key'=>'string', 'value1'=>'string', 'value2='=>'string', 'valueN='=>'string'], -'Redis::rPushx' => ['int', 'key'=>'string', 'value'=>'string'], -'Redis::sAdd' => ['int|false', 'key'=>'string', 'value1'=>'string', 'value2='=>'string', 'valueN='=>'string'], -'Redis::sAddArray' => ['bool', 'key'=>'string', 'values'=>'array'], -'Redis::save' => ['bool'], -'Redis::scan' => ['array|false', '&rw_iterator'=>'?int', 'pattern='=>'?string', 'count='=>'?int'], -'Redis::sCard' => ['int', 'key'=>'string'], -'Redis::scard' => ['int', 'key'=>'string'], -'Redis::sContains' => ['', 'key'=>'string', 'value'=>'string'], -'Redis::script' => ['mixed', 'command'=>'string', 'script'=>'string'], -'Redis::sDiff' => ['array', 'key1'=>'string', 'key2'=>'string', 'keyN='=>'string'], -'Redis::sDiffStore' => ['int|false', 'dstKey'=>'string', 'key1'=>'string', 'key2'=>'string', 'keyN='=>'string'], -'Redis::select' => ['bool', 'dbindex'=>'int'], -'Redis::set' => ['bool', 'key'=>'string', 'value'=>'string', 'options='=>'array'], -'Redis::set\'1' => ['bool', 'key'=>'string', 'value'=>'string', 'timeout='=>'int'], -'Redis::setBit' => ['int', 'key'=>'string', 'offset'=>'int', 'value'=>'int'], -'Redis::setEx' => ['bool', 'key'=>'string', 'ttl'=>'int', 'value'=>'string'], -'Redis::setex' => ['bool', 'key'=>'string', 'ttl'=>'int', 'value'=>'string'], -'Redis::setNx' => ['bool', 'key'=>'string', 'value'=>'string'], -'Redis::setnx' => ['bool', 'key'=>'string', 'value'=>'string'], -'Redis::setOption' => ['bool', 'name'=>'int', 'value'=>'string'], -'Redis::setRange' => ['int', 'key'=>'string', 'offset'=>'int', 'end'=>'int'], -'Redis::setTimeout' => ['', 'key'=>'string', 'ttl'=>'int'], -'Redis::sGetMembers' => ['', 'key'=>'string'], -'Redis::sInter' => ['array|false', 'key1'=>'string', 'key2'=>'string', 'keyN='=>'string'], -'Redis::sInterStore' => ['int|false', 'dstKey'=>'string', 'key1'=>'string', 'key2'=>'string', 'keyN='=>'string'], -'Redis::sIsMember' => ['bool', 'key'=>'string', 'value'=>'string'], -'Redis::sismember' => ['bool', 'key'=>'string', 'value'=>'string'], -'Redis::slave' => ['bool', 'host'=>'string', 'port'=>'int'], -'Redis::slave\'1' => ['bool', 'host'=>'string', 'port'=>'int'], -'Redis::slaveof' => ['bool', 'host='=>'string', 'port='=>'int'], -'Redis::slowLog' => ['mixed', 'operation'=>'string', 'length='=>'int'], -'Redis::slowlog' => ['mixed', 'operation'=>'string', 'length='=>'int'], -'Redis::sMembers' => ['array', 'key'=>'string'], -'Redis::sMove' => ['bool', 'srcKey'=>'string', 'dstKey'=>'string', 'member'=>'string'], -'Redis::sort' => ['array|int', 'options='=>'?array'], -'Redis::sPop' => ['string|false', 'key'=>'string'], -'Redis::sRandMember' => ['array|string|false', 'key'=>'string', 'count='=>'int'], -'Redis::sRem' => ['int', 'key'=>'string', 'member1'=>'string', 'member2='=>'string', 'memberN='=>'string'], -'Redis::srem' => ['int', 'key'=>'string', 'member1'=>'string', 'member2='=>'string', 'memberN='=>'string'], -'Redis::sRemove' => ['', 'key'=>'string', 'member1'=>'string', 'member2='=>'string', 'memberN='=>'string'], -'Redis::sScan' => ['array|bool', 'key'=>'string', 'iterator'=>'int', 'pattern='=>'string', 'count='=>'int'], -'Redis::sscan' => ['array|bool', 'key'=>'string', 'iterator'=>'int', 'pattern='=>'string', 'count='=>'int'], -'Redis::strLen' => ['int', 'key'=>'string'], -'Redis::strlen' => ['int', 'key'=>'string'], -'Redis::subscribe' => ['', 'channels'=>'array', 'callback'=>'string'], -'Redis::substr' => ['', 'key'=>'string', 'start'=>'int', 'end'=>'int'], -'Redis::sUnion' => ['array', 'key1'=>'string', 'key2'=>'string', 'keyN='=>'string'], -'Redis::sUnionStore' => ['int', 'dstKey'=>'string', 'key1'=>'string', 'key2'=>'string', 'keyN='=>'string'], -'Redis::time' => ['array'], -'Redis::ttl' => ['int|false', 'key'=>'string'], -'Redis::type' => ['int', 'key'=>'string'], -'Redis::unlink' => ['int', 'key'=>'string', '...args'=>'string'], -'Redis::unlink\'1' => ['int', 'key'=>'string[]'], -'Redis::unwatch' => [''], -'Redis::wait' => ['int', 'numSlaves'=>'int', 'timeout'=>'int'], -'Redis::watch' => ['void', 'key'=>'string'], -'Redis::zAdd' => ['int', 'key'=>'string', 'score1'=>'float', 'value1'=>'string', 'score2='=>'float', 'value2='=>'string', 'scoreN='=>'float', 'valueN='=>'string'], -'Redis::zCard' => ['int', 'key'=>'string'], -'Redis::zCount' => ['int', 'key'=>'string', 'start'=>'string', 'end'=>'string'], -'Redis::zDelete' => ['int', 'key'=>'string', 'member1'=>'string', 'member2='=>'string', 'memberN='=>'string'], -'Redis::zDeleteRangeByRank' => ['', 'key'=>'string', 'start'=>'int', 'end'=>'int'], -'Redis::zDeleteRangeByScore' => ['', 'key'=>'string', 'start'=>'float', 'end'=>'float'], -'Redis::zIncrBy' => ['float', 'key'=>'string', 'value'=>'float', 'member'=>'string'], -'Redis::zInter' => ['int', 'Output'=>'string', 'ZSetKeys'=>'array', 'Weights='=>'?array', 'aggregateFunction='=>'string'], -'Redis::zRange' => ['array', 'key'=>'string', 'start'=>'int', 'end'=>'int', 'withscores='=>'bool'], -'Redis::zRangeByLex' => ['array|false', 'key'=>'string', 'min'=>'int', 'max'=>'int', 'offset='=>'int', 'limit='=>'int'], -'Redis::zRangeByScore' => ['array', 'key'=>'string', 'start'=>'int', 'end'=>'int', 'options='=>'array'], -'Redis::zRank' => ['int', 'key'=>'string', 'member'=>'string'], -'Redis::zRem' => ['int', 'key'=>'string', 'member1'=>'string', 'member2='=>'string', 'memberN='=>'string'], -'Redis::zRemRangeByRank' => ['int', 'key'=>'string', 'start'=>'int', 'end'=>'int'], -'Redis::zRemRangeByScore' => ['int', 'key'=>'string', 'start'=>'float|string', 'end'=>'float|string'], -'Redis::zRevRange' => ['array', 'key'=>'string', 'start'=>'int', 'end'=>'int', 'withscore='=>'bool'], -'Redis::zRevRangeByLex' => ['array', 'key'=>'string', 'min'=>'int', 'max'=>'int', 'offset='=>'int', 'limit='=>'int'], -'Redis::zRevRangeByScore' => ['array', 'key'=>'string', 'start'=>'int', 'end'=>'int', 'options='=>'array'], -'Redis::zRevRank' => ['int', 'key'=>'string', 'member'=>'string'], -'Redis::zScan' => ['array|bool', 'key'=>'string', 'iterator'=>'int', 'pattern='=>'string', 'count='=>'int'], -'Redis::zscan' => ['array|bool', 'key'=>'string', 'iterator'=>'int', 'pattern='=>'string', 'count='=>'int'], -'Redis::zScore' => ['float', 'key'=>'string', 'member'=>'string'], -'Redis::zSize' => ['', 'key'=>'string'], -'Redis::zUnion' => ['int', 'Output'=>'string', 'ZSetKeys'=>'array', 'Weights='=>'?array', 'aggregateFunction='=>'string'], -'RedisArray::__construct' => ['void', 'name='=>'string', 'hosts='=>'?array', 'opts='=>'?array'], -'RedisArray::_function' => ['string'], -'RedisArray::_hosts' => ['array'], -'RedisArray::_rehash' => [''], -'RedisArray::_target' => ['string', 'key'=>'string'], -'RedisCluster::__construct' => ['void', 'name'=>'string', 'seeds'=>'array', 'timeout='=>'float', 'readTimeout='=>'float', 'persistent='=>'bool|false'], -'RedisCluster::_masters' => ['array'], -'RedisCluster::_prefix' => ['string', 'value'=>'mixed'], -'RedisCluster::_serialize' => ['mixed', 'value'=>'mixed'], -'RedisCluster::_unserialize' => ['mixed', 'value'=>'string'], -'RedisCluster::append' => ['int', 'key'=>'string', 'value'=>'string'], -'RedisCluster::bgrewriteaof' => ['bool', 'nodeParams'=>'string'], -'RedisCluster::bgsave' => ['bool', 'nodeParams'=>'string'], -'RedisCluster::bitCount' => ['int', 'key'=>'string'], -'RedisCluster::bitOp' => ['int', 'operation'=>'string', 'retKey'=>'string', 'key1'=>'string', 'key2'=>'string', 'key3='=>'string'], -'RedisCluster::bitpos' => ['int', 'key'=>'string', 'bit'=>'int', 'start='=>'int', 'end='=>'int'], -'RedisCluster::blPop' => ['array', 'keys'=>'array', 'timeout'=>'int'], -'RedisCluster::brPop' => ['array', 'keys'=>'array', 'timeout'=>'int'], -'RedisCluster::brpoplpush' => ['string', 'srcKey'=>'string', 'dstKey'=>'string', 'timeout'=>'int'], -'RedisCluster::clearLastError' => ['bool'], -'RedisCluster::client' => ['', 'nodeParams'=>'string', 'subCmd'=>'', 'args'=>''], -'RedisCluster::close' => [''], -'RedisCluster::cluster' => ['mixed', 'nodeParams'=>'string', 'command'=>'string', 'arguments'=>'mixed'], -'RedisCluster::command' => ['mixed'], -'RedisCluster::config' => ['array', 'nodeParams'=>'string', 'operation'=>'string', 'key'=>'string', 'value'=>'string'], -'RedisCluster::dbSize' => ['int', 'nodeParams'=>'string'], -'RedisCluster::decr' => ['int', 'key'=>'string'], -'RedisCluster::decrBy' => ['int', 'key'=>'string', 'value'=>'int'], -'RedisCluster::del' => ['int', 'key1'=>'int', 'key2='=>'string', 'key3='=>'string'], -'RedisCluster::discard' => [''], -'RedisCluster::dump' => ['string', 'key'=>'string'], -'RedisCluster::echo' => ['mixed', 'nodeParams'=>'string', 'msg'=>'string'], -'RedisCluster::eval' => ['mixed', 'script'=>'', 'args='=>'', 'numKeys='=>''], -'RedisCluster::evalSha' => ['mixed', 'scriptSha'=>'string', 'args='=>'array', 'numKeys='=>'int'], -'RedisCluster::exec' => ['array|void'], -'RedisCluster::exists' => ['bool', 'key'=>'string'], -'RedisCluster::expire' => ['bool', 'key'=>'string', 'ttl'=>'int'], -'RedisCluster::expireAt' => ['bool', 'key'=>'string', 'timestamp'=>'int'], -'RedisCluster::flushAll' => ['bool', 'nodeParams'=>'string'], -'RedisCluster::flushDB' => ['bool', 'nodeParams'=>'string'], -'RedisCluster::geoAdd' => ['', 'key'=>'string', 'longitude'=>'float', 'latitude'=>'float', 'member'=>'string'], -'RedisCluster::geoDist' => ['', 'key'=>'string', 'member1'=>'string', 'member2'=>'string', 'unit='=>'string'], -'RedisCluster::geohash' => ['', 'key'=>'', 'member1'=>'', 'member2='=>'mixed', 'memberN='=>'mixed'], -'RedisCluster::geopos' => ['', 'key'=>'', 'member1'=>'', 'member2='=>'mixed', 'memberN='=>'mixed'], -'RedisCluster::geoRadius' => ['', 'key'=>'string', 'longitude'=>'float', 'latitude'=>'float', 'radius'=>'float', 'radiusUnit'=>'string', 'options'=>'array'], -'RedisCluster::geoRadiusByMember' => ['', 'key'=>'string', 'member'=>'string', 'radius'=>'float', 'radiusUnit'=>'string', 'options'=>'array'], -'RedisCluster::get' => ['bool|string', 'key'=>'string'], -'RedisCluster::getBit' => ['int', 'key'=>'string', 'offset'=>'int'], -'RedisCluster::getLastError' => ['string'], -'RedisCluster::getMode' => ['int'], -'RedisCluster::getOption' => ['int', 'name'=>'string'], -'RedisCluster::getRange' => ['string', 'key'=>'string', 'start'=>'int', 'end'=>'int'], -'RedisCluster::getSet' => ['string', 'key'=>'string', 'value'=>'string'], -'RedisCluster::hDel' => ['int', 'key'=>'string', 'hashKey1'=>'string', 'hashKey2='=>'string', 'hashKeyN='=>'string'], -'RedisCluster::hExists' => ['bool', 'key'=>'string', 'hashKey'=>'string'], -'RedisCluster::hGet' => ['string', 'key'=>'string', 'hashKey'=>'string'], -'RedisCluster::hGetAll' => ['array', 'key'=>'string'], -'RedisCluster::hIncrBy' => ['int', 'key'=>'string', 'hashKey'=>'string', 'value'=>'int'], -'RedisCluster::hIncrByFloat' => ['float', 'key'=>'string', 'field'=>'string', 'increment'=>'float'], -'RedisCluster::hKeys' => ['array', 'key'=>'string'], -'RedisCluster::hLen' => ['int', 'key'=>'string'], -'RedisCluster::hMGet' => ['array', 'key'=>'string', 'hashKeys'=>'array'], -'RedisCluster::hMSet' => ['bool', 'key'=>'string', 'hashKeys'=>'array'], -'RedisCluster::hScan' => ['array', 'key'=>'string', '&iterator'=>'int', 'pattern='=>'string', 'count='=>'int'], -'RedisCluster::hSet' => ['int', 'key'=>'string', 'hashKey'=>'string', 'value'=>'string'], -'RedisCluster::hSetNx' => ['bool', 'key'=>'string', 'hashKey'=>'string', 'value'=>'string'], -'RedisCluster::hVals' => ['array', 'key'=>'string'], -'RedisCluster::incr' => ['int', 'key'=>'string'], -'RedisCluster::incrBy' => ['int', 'key'=>'string', 'value'=>'int'], -'RedisCluster::incrByFloat' => ['float', 'key'=>'string', 'increment'=>'float'], -'RedisCluster::info' => ['string', 'option='=>'string'], -'RedisCluster::keys' => ['array', 'pattern'=>'string'], -'RedisCluster::lastSave' => ['int', 'nodeParams'=>'string'], -'RedisCluster::lGet' => ['', 'key'=>'string', 'index'=>'int'], -'RedisCluster::lIndex' => ['string', 'key'=>'string', 'index'=>'int'], -'RedisCluster::lInsert' => ['int', 'key'=>'string', 'position'=>'int', 'pivot'=>'string', 'value'=>'string'], -'RedisCluster::lLen' => ['int', 'key'=>'string'], -'RedisCluster::lPop' => ['string', 'key'=>'string'], -'RedisCluster::lPush' => ['int', 'key'=>'string', 'value1'=>'string', 'value2='=>'string', 'valueN='=>'string'], -'RedisCluster::lPushx' => ['int', 'key'=>'string', 'value'=>'string'], -'RedisCluster::lRange' => ['array', 'key'=>'string', 'start'=>'int', 'end'=>'int'], -'RedisCluster::lRem' => ['int', 'key'=>'string', 'value'=>'string', 'count'=>'int'], -'RedisCluster::lSet' => ['bool', 'key'=>'string', 'index'=>'int', 'value'=>'string'], -'RedisCluster::lTrim' => ['array', 'key'=>'string', 'start'=>'int', 'stop'=>'int'], -'RedisCluster::mget' => ['array', 'array'=>'array'], -'RedisCluster::mset' => ['bool', 'array'=>'array'], -'RedisCluster::msetnx' => ['int', 'array'=>'array'], -'RedisCluster::multi' => ['Redis', 'mode='=>'int'], -'RedisCluster::object' => ['string', 'string='=>'string', 'key='=>'string'], -'RedisCluster::persist' => ['bool', 'key'=>'string'], -'RedisCluster::pExpire' => ['bool', 'key'=>'string', 'ttl'=>'int'], -'RedisCluster::pExpireAt' => ['bool', 'key'=>'string', 'timestamp'=>'int'], -'RedisCluster::pfAdd' => ['bool', 'key'=>'string', 'elements'=>'array'], -'RedisCluster::pfCount' => ['int', 'key'=>'string'], -'RedisCluster::pfMerge' => ['bool', 'destKey'=>'string', 'sourceKeys'=>'array'], -'RedisCluster::ping' => ['string', 'nodeParams'=>'string'], -'RedisCluster::psetex' => ['bool', 'key'=>'string', 'ttl'=>'int', 'value'=>'string'], -'RedisCluster::psubscribe' => ['mixed', 'patterns'=>'array', 'callback'=>'string'], -'RedisCluster::pttl' => ['int', 'key'=>'string'], -'RedisCluster::publish' => ['int', 'channel'=>'string', 'message'=>'string'], -'RedisCluster::pubsub' => ['array', 'nodeParams'=>'string', 'keyword'=>'string', 'argument'=>'string'], -'RedisCluster::punSubscribe' => ['', 'channels'=>'', 'callback'=>''], -'RedisCluster::randomKey' => ['string', 'nodeParams'=>'string'], -'RedisCluster::rawCommand' => ['mixed', 'nodeParams'=>'string', 'command'=>'string', 'arguments'=>'mixed'], -'RedisCluster::rename' => ['bool', 'srcKey'=>'string', 'dstKey'=>'string'], -'RedisCluster::renameNx' => ['bool', 'srcKey'=>'string', 'dstKey'=>'string'], -'RedisCluster::restore' => ['bool', 'key'=>'string', 'ttl'=>'int', 'value'=>'string'], -'RedisCluster::role' => ['array', 'nodeParams'=>'string'], -'RedisCluster::rPop' => ['string', 'key'=>'string'], -'RedisCluster::rpoplpush' => ['string', 'srcKey'=>'string', 'dstKey'=>'string'], -'RedisCluster::rPush' => ['int', 'key'=>'string', 'value1'=>'string', 'value2='=>'string', 'valueN='=>'string'], -'RedisCluster::rPushx' => ['int', 'key'=>'string', 'value'=>'string'], -'RedisCluster::sAdd' => ['int', 'key'=>'string', 'value1'=>'string', 'value2='=>'string', 'valueN='=>'string'], -'RedisCluster::sAddArray' => ['int', 'key'=>'string', 'valueArray'=>'array'], -'RedisCluster::save' => ['bool', 'nodeParams'=>'string'], -'RedisCluster::scan' => ['array', '&iterator'=>'int', 'pattern='=>'string', 'count='=>'int'], -'RedisCluster::sCard' => ['int', 'key'=>'string'], -'RedisCluster::script' => ['mixed', 'nodeParams'=>'string', 'command'=>'string', 'script'=>'string'], -'RedisCluster::sDiff' => ['array', 'key1'=>'string', 'key2'=>'string', 'keyN='=>'string'], -'RedisCluster::sDiffStore' => ['int', 'dstKey'=>'string', 'key1'=>'string', 'key2'=>'string', 'keyN='=>'string'], -'RedisCluster::set' => ['bool', 'key'=>'string', 'value'=>'string', 'timeout='=>'array|int'], -'RedisCluster::setBit' => ['int', 'key'=>'string', 'offset'=>'int', 'value'=>'bool|int'], -'RedisCluster::setex' => ['bool', 'key'=>'string', 'ttl'=>'int', 'value'=>'string'], -'RedisCluster::setnx' => ['bool', 'key'=>'string', 'value'=>'string'], -'RedisCluster::setOption' => ['bool', 'name'=>'string', 'value'=>'string'], -'RedisCluster::setRange' => ['string', 'key'=>'string', 'offset'=>'int', 'value'=>'string'], -'RedisCluster::sInter' => ['array', 'key1'=>'string', 'key2'=>'string', 'keyN='=>'string'], -'RedisCluster::sInterStore' => ['int', 'dstKey'=>'string', 'key1'=>'string', 'key2'=>'string', 'keyN='=>'string'], -'RedisCluster::sIsMember' => ['bool', 'key'=>'string', 'value'=>'string'], -'RedisCluster::slowLog' => ['', 'nodeParams'=>'string', 'command'=>'string', 'argument'=>'mixed'], -'RedisCluster::sMembers' => ['array', 'key'=>'string'], -'RedisCluster::sMove' => ['bool', 'srcKey'=>'string', 'dstKey'=>'string', 'member'=>'string'], -'RedisCluster::sort' => ['array', 'key'=>'string', 'option='=>'array'], -'RedisCluster::sPop' => ['string', 'key'=>'string'], -'RedisCluster::sRandMember' => ['array|string', 'key'=>'string', 'count='=>'int'], -'RedisCluster::sRem' => ['int', 'key'=>'string', 'member1'=>'string', 'member2='=>'string', 'memberN='=>'string'], -'RedisCluster::sScan' => ['array', 'key'=>'string', '&iterator'=>'int', 'pattern='=>'null', 'count='=>'int'], -'RedisCluster::strlen' => ['int', 'key'=>'string'], -'RedisCluster::subscribe' => ['mixed', 'channels'=>'array', 'callback'=>'string'], -'RedisCluster::sUnion' => ['array', 'key1'=>'string', 'key2'=>'string', 'keyN='=>'string'], -'RedisCluster::sUnionStore' => ['int', 'dstKey'=>'string', 'key1'=>'string', 'key2'=>'string', 'keyN='=>'string'], -'RedisCluster::time' => ['array', 'nodeParams'=>'string'], -'RedisCluster::ttl' => ['int', 'key'=>'string'], -'RedisCluster::type' => ['int', 'key'=>'string'], -'RedisCluster::unSubscribe' => ['', 'channels'=>'', 'callback'=>''], -'RedisCluster::unwatch' => [''], -'RedisCluster::watch' => ['void', 'key'=>'string'], -'RedisCluster::zAdd' => ['int', 'key'=>'string', 'score1'=>'float', 'value1'=>'string', 'score2='=>'float', 'value2='=>'string', 'scoreN='=>'float', 'valueN='=>'string'], -'RedisCluster::zCard' => ['int', 'key'=>'string'], -'RedisCluster::zCount' => ['int', 'key'=>'string', 'start'=>'string', 'end'=>'string'], -'RedisCluster::zIncrBy' => ['float', 'key'=>'string', 'value'=>'float', 'member'=>'string'], -'RedisCluster::zInterStore' => ['int', 'Output'=>'string', 'ZSetKeys'=>'array', 'Weights='=>'?array', 'aggregateFunction='=>'string'], -'RedisCluster::zLexCount' => ['int', 'key'=>'string', 'min'=>'int', 'max'=>'int'], -'RedisCluster::zRange' => ['array', 'key'=>'string', 'start'=>'int', 'end'=>'int', 'withscores='=>'bool'], -'RedisCluster::zRangeByLex' => ['array', 'key'=>'string', 'min'=>'int', 'max'=>'int', 'offset='=>'int', 'limit='=>'int'], -'RedisCluster::zRangeByScore' => ['array', 'key'=>'string', 'start'=>'int', 'end'=>'int', 'options='=>'array'], -'RedisCluster::zRank' => ['int', 'key'=>'string', 'member'=>'string'], -'RedisCluster::zRem' => ['int', 'key'=>'string', 'member1'=>'string', 'member2='=>'string', 'memberN='=>'string'], -'RedisCluster::zRemRangeByLex' => ['array', 'key'=>'string', 'min'=>'int', 'max'=>'int'], -'RedisCluster::zRemRangeByRank' => ['int', 'key'=>'string', 'start'=>'int', 'end'=>'int'], -'RedisCluster::zRemRangeByScore' => ['int', 'key'=>'string', 'start'=>'float|string', 'end'=>'float|string'], -'RedisCluster::zRevRange' => ['array', 'key'=>'string', 'start'=>'int', 'end'=>'int', 'withscore='=>'bool'], -'RedisCluster::zRevRangeByLex' => ['array', 'key'=>'string', 'min'=>'int', 'max'=>'int', 'offset='=>'int', 'limit='=>'int'], -'RedisCluster::zRevRangeByScore' => ['array', 'key'=>'string', 'start'=>'int', 'end'=>'int', 'options='=>'array'], -'RedisCluster::zRevRank' => ['int', 'key'=>'string', 'member'=>'string'], -'RedisCluster::zScan' => ['array', 'key'=>'string', '&iterator'=>'int', 'pattern='=>'string', 'count='=>'int'], -'RedisCluster::zScore' => ['float', 'key'=>'string', 'member'=>'string'], -'RedisCluster::zUnionStore' => ['int', 'Output'=>'string', 'ZSetKeys'=>'array', 'Weights='=>'?array', 'aggregateFunction='=>'string'], -'Reflection::export' => ['string|null', 'r'=>'reflector', 'return='=>'bool'], -'Reflection::getModifierNames' => ['array', 'modifiers'=>'int'], -'ReflectionClass::__clone' => ['void'], -'ReflectionClass::__construct' => ['void', 'argument'=>''], -'ReflectionClass::__toString' => ['string'], -'ReflectionClass::export' => ['string|null', 'argument'=>'string|object', 'return='=>'bool'], -'ReflectionClass::getConstant' => ['mixed', 'name'=>'string'], -'ReflectionClass::getConstants' => ['array'], -'ReflectionClass::getConstructor' => ['ReflectionMethod|null'], -'ReflectionClass::getDefaultProperties' => ['array'], -'ReflectionClass::getDocComment' => ['string|false'], -'ReflectionClass::getEndLine' => ['int|false'], -'ReflectionClass::getExtension' => ['ReflectionExtension|null'], -'ReflectionClass::getExtensionName' => ['string|false'], -'ReflectionClass::getFileName' => ['string|false'], -'ReflectionClass::getInterfaceNames' => ['string[]'], -'ReflectionClass::getInterfaces' => ['array'], -'ReflectionClass::getMethod' => ['ReflectionMethod', 'name'=>'string'], -'ReflectionClass::getMethods' => ['ReflectionMethod[]', 'filter='=>'int'], -'ReflectionClass::getModifiers' => ['int'], -'ReflectionClass::getName' => ['string'], -'ReflectionClass::getNamespaceName' => ['string'], -'ReflectionClass::getParentClass' => ['ReflectionClass|false'], -'ReflectionClass::getProperties' => ['ReflectionProperty[]', 'filter='=>'int'], -'ReflectionClass::getProperty' => ['ReflectionProperty', 'name'=>'string'], -'ReflectionClass::getReflectionConstant' => ['ReflectionClassConstant|false', 'name'=>'string'], -'ReflectionClass::getReflectionConstants' => ['array'], -'ReflectionClass::getShortName' => ['string'], -'ReflectionClass::getStartLine' => ['int|false'], -'ReflectionClass::getStaticProperties' => ['ReflectionProperty[]'], -'ReflectionClass::getStaticPropertyValue' => ['mixed', 'name'=>'string', 'default='=>'mixed'], -'ReflectionClass::getTraitAliases' => ['array'], -'ReflectionClass::getTraitNames' => ['array'], -'ReflectionClass::getTraits' => ['array'], -'ReflectionClass::hasConstant' => ['bool', 'name'=>'string'], -'ReflectionClass::hasMethod' => ['bool', 'name'=>'string'], -'ReflectionClass::hasProperty' => ['bool', 'name'=>'string'], -'ReflectionClass::implementsInterface' => ['bool', 'interface_name'=>'string|reflectionclass'], -'ReflectionClass::inNamespace' => ['bool'], -'ReflectionClass::isAbstract' => ['bool'], -'ReflectionClass::isAnonymous' => ['bool'], -'ReflectionClass::isCloneable' => ['bool'], -'ReflectionClass::isFinal' => ['bool'], -'ReflectionClass::isInstance' => ['bool', 'object'=>'object'], -'ReflectionClass::isInstantiable' => ['bool'], -'ReflectionClass::isInterface' => ['bool'], -'ReflectionClass::isInternal' => ['bool'], -'ReflectionClass::isIterable' => ['bool'], -'ReflectionClass::isIterateable' => ['bool'], -'ReflectionClass::isSubclassOf' => ['bool', 'class'=>'string|reflectionclass'], -'ReflectionClass::isTrait' => ['bool'], -'ReflectionClass::isUserDefined' => ['bool'], -'ReflectionClass::newInstance' => ['object', 'args='=>'mixed', '...args='=>'mixed'], -'ReflectionClass::newInstanceArgs' => ['object', 'args='=>'array'], -'ReflectionClass::newInstanceWithoutConstructor' => ['object'], -'ReflectionClass::setStaticPropertyValue' => ['void', 'name'=>'string', 'value'=>'string'], -'ReflectionClassConstant::__construct' => ['void', 'class'=>'mixed', 'name'=>'string'], -'ReflectionClassConstant::__toString' => ['string'], -'ReflectionClassConstant::export' => ['string', 'class'=>'mixed', 'name'=>'string', 'return='=>'bool'], -'ReflectionClassConstant::getDeclaringClass' => ['ReflectionClass'], -'ReflectionClassConstant::getDocComment' => ['string|false'], -'ReflectionClassConstant::getModifiers' => ['int'], -'ReflectionClassConstant::getName' => ['string'], -'ReflectionClassConstant::getValue' => ['mixed'], -'ReflectionClassConstant::isPrivate' => ['bool'], -'ReflectionClassConstant::isProtected' => ['bool'], -'ReflectionClassConstant::isPublic' => ['bool'], -'ReflectionExtension::__clone' => ['void'], -'ReflectionExtension::__construct' => ['void', 'name'=>'string'], -'ReflectionExtension::__toString' => ['string'], -'ReflectionExtension::export' => ['string|null', 'name'=>'string', 'return='=>'bool'], -'ReflectionExtension::getClasses' => ['array'], -'ReflectionExtension::getClassNames' => ['array'], -'ReflectionExtension::getConstants' => ['array'], -'ReflectionExtension::getDependencies' => ['array'], -'ReflectionExtension::getFunctions' => ['array'], -'ReflectionExtension::getINIEntries' => ['array'], -'ReflectionExtension::getName' => ['string'], -'ReflectionExtension::getVersion' => ['string'], -'ReflectionExtension::info' => ['void'], -'ReflectionExtension::isPersistent' => ['void'], -'ReflectionExtension::isTemporary' => ['bool'], -'ReflectionFunction::__construct' => ['void', 'name'=>'string|Closure'], -'ReflectionFunction::__toString' => ['string'], -'ReflectionFunction::export' => ['string|null', 'name'=>'string', 'return='=>'bool'], -'ReflectionFunction::getClosure' => ['?Closure'], -'ReflectionFunction::getClosureScopeClass' => ['ReflectionClass'], -'ReflectionFunction::getClosureThis' => ['bool'], -'ReflectionFunction::getDocComment' => ['string|false'], -'ReflectionFunction::getEndLine' => ['int|false'], -'ReflectionFunction::getExtension' => ['ReflectionExtension|null'], -'ReflectionFunction::getExtensionName' => ['string|false'], -'ReflectionFunction::getFileName' => ['string|false'], -'ReflectionFunction::getName' => ['string'], -'ReflectionFunction::getNamespaceName' => ['string'], -'ReflectionFunction::getNumberOfParameters' => ['int'], -'ReflectionFunction::getNumberOfRequiredParameters' => ['int'], -'ReflectionFunction::getParameters' => ['array'], -'ReflectionFunction::getReturnType' => ['?ReflectionType'], -'ReflectionFunction::getShortName' => ['string'], -'ReflectionFunction::getStartLine' => ['int|false'], -'ReflectionFunction::getStaticVariables' => ['array'], -'ReflectionFunction::inNamespace' => ['bool'], -'ReflectionFunction::invoke' => ['mixed', '...args='=>'mixed'], -'ReflectionFunction::invokeArgs' => ['mixed', 'args'=>'array'], -'ReflectionFunction::isClosure' => ['bool'], -'ReflectionFunction::isDeprecated' => ['bool'], -'ReflectionFunction::isDisabled' => ['bool'], -'ReflectionFunction::isGenerator' => ['bool'], -'ReflectionFunction::isInternal' => ['bool'], -'ReflectionFunction::isUserDefined' => ['bool'], -'ReflectionFunction::isVariadic' => ['bool'], -'ReflectionFunction::returnsReference' => ['bool'], -'ReflectionFunctionAbstract::__clone' => ['void'], -'ReflectionFunctionAbstract::__toString' => ['string'], -'ReflectionFunctionAbstract::getClosureScopeClass' => ['ReflectionClass'], -'ReflectionFunctionAbstract::getClosureThis' => ['object'], -'ReflectionFunctionAbstract::getDocComment' => ['string|false'], -'ReflectionFunctionAbstract::getEndLine' => ['int|false'], -'ReflectionFunctionAbstract::getExtension' => ['ReflectionExtension'], -'ReflectionFunctionAbstract::getExtensionName' => ['string'], -'ReflectionFunctionAbstract::getFileName' => ['string|false'], -'ReflectionFunctionAbstract::getName' => ['string'], -'ReflectionFunctionAbstract::getNamespaceName' => ['string'], -'ReflectionFunctionAbstract::getNumberOfParameters' => ['int'], -'ReflectionFunctionAbstract::getNumberOfRequiredParameters' => ['int'], -'ReflectionFunctionAbstract::getParameters' => ['array'], -'ReflectionFunctionAbstract::getReturnType' => ['?ReflectionType'], -'ReflectionFunctionAbstract::getShortName' => ['string'], -'ReflectionFunctionAbstract::getStartLine' => ['int|false'], -'ReflectionFunctionAbstract::getStaticVariables' => ['array'], -'ReflectionFunctionAbstract::hasReturnType' => ['bool'], -'ReflectionFunctionAbstract::inNamespace' => ['bool'], -'ReflectionFunctionAbstract::isClosure' => ['bool'], -'ReflectionFunctionAbstract::isDeprecated' => ['bool'], -'ReflectionFunctionAbstract::isGenerator' => ['bool'], -'ReflectionFunctionAbstract::isInternal' => ['bool'], -'ReflectionFunctionAbstract::isUserDefined' => ['bool'], -'ReflectionFunctionAbstract::isVariadic' => ['bool'], -'ReflectionFunctionAbstract::returnsReference' => ['bool'], -'ReflectionGenerator::__construct' => ['void', 'generator'=>'object'], -'ReflectionGenerator::getExecutingFile' => ['string'], -'ReflectionGenerator::getExecutingGenerator' => ['Generator'], -'ReflectionGenerator::getExecutingLine' => ['int'], -'ReflectionGenerator::getFunction' => ['ReflectionFunctionAbstract'], -'ReflectionGenerator::getThis' => ['object'], -'ReflectionGenerator::getTrace' => ['array', 'options'=>'int'], -'ReflectionMethod::__construct' => ['void', 'class'=>'string|object', 'name'=>'string'], -'ReflectionMethod::__construct\'1' => ['void', 'class_method'=>'string'], -'ReflectionMethod::__toString' => ['string'], -'ReflectionMethod::export' => ['string|null', 'class'=>'string', 'name'=>'string', 'return='=>'bool'], -'ReflectionMethod::getClosure' => ['?Closure', 'object'=>'?object'], -'ReflectionMethod::getDeclaringClass' => ['ReflectionClass'], -'ReflectionMethod::getModifiers' => ['int'], -'ReflectionMethod::getPrototype' => ['ReflectionMethod'], -'ReflectionMethod::invoke' => ['mixed', 'object'=>'?object', '...args='=>'mixed'], -'ReflectionMethod::invokeArgs' => ['mixed', 'object'=>'?object', 'args'=>'array'], -'ReflectionMethod::isAbstract' => ['bool'], -'ReflectionMethod::isConstructor' => ['bool'], -'ReflectionMethod::isDestructor' => ['bool'], -'ReflectionMethod::isFinal' => ['bool'], -'ReflectionMethod::isPrivate' => ['bool'], -'ReflectionMethod::isProtected' => ['bool'], -'ReflectionMethod::isPublic' => ['bool'], -'ReflectionMethod::isStatic' => ['bool'], -'ReflectionMethod::setAccessible' => ['void', 'visible'=>'bool'], -'ReflectionNamedType::getName' => ['string'], -'ReflectionObject::__construct' => ['void', 'argument'=>'object'], -'ReflectionObject::export' => ['string|null', 'argument'=>'object', 'return='=>'bool'], -'ReflectionParameter::__clone' => ['void'], -'ReflectionParameter::__construct' => ['void', 'function'=>'', 'parameter'=>''], -'ReflectionParameter::__toString' => ['string'], -'ReflectionParameter::allowsNull' => ['bool'], -'ReflectionParameter::canBePassedByValue' => ['bool'], -'ReflectionParameter::export' => ['string|null', 'function'=>'string', 'parameter'=>'string', 'return='=>'bool'], -'ReflectionParameter::getClass' => ['ReflectionClass|null'], -'ReflectionParameter::getDeclaringClass' => ['ReflectionClass|null'], -'ReflectionParameter::getDeclaringFunction' => ['ReflectionFunctionAbstract'], -'ReflectionParameter::getDefaultValue' => ['mixed'], -'ReflectionParameter::getDefaultValueConstantName' => ['string'], -'ReflectionParameter::getName' => ['string'], -'ReflectionParameter::getPosition' => ['int'], -'ReflectionParameter::getType' => ['ReflectionType|null'], -'ReflectionParameter::hasType' => ['bool'], -'ReflectionParameter::isArray' => ['bool'], -'ReflectionParameter::isCallable' => ['bool'], -'ReflectionParameter::isDefaultValueAvailable' => ['bool'], -'ReflectionParameter::isDefaultValueConstant' => ['bool'], -'ReflectionParameter::isOptional' => ['bool'], -'ReflectionParameter::isPassedByReference' => ['bool'], -'ReflectionParameter::isVariadic' => ['bool'], -'ReflectionProperty::__clone' => ['void'], -'ReflectionProperty::__construct' => ['void', 'class'=>'', 'name'=>'string'], -'ReflectionProperty::__toString' => ['string'], -'ReflectionProperty::export' => ['string|null', 'class'=>'mixed', 'name'=>'string', 'return='=>'bool'], -'ReflectionProperty::getDeclaringClass' => ['ReflectionClass'], -'ReflectionProperty::getDocComment' => ['string|false'], -'ReflectionProperty::getModifiers' => ['int'], -'ReflectionProperty::getName' => ['string'], -'ReflectionProperty::getValue' => ['mixed', 'object='=>'object'], -'ReflectionProperty::isDefault' => ['bool'], -'ReflectionProperty::isPrivate' => ['bool'], -'ReflectionProperty::isProtected' => ['bool'], -'ReflectionProperty::isPublic' => ['bool'], -'ReflectionProperty::isStatic' => ['bool'], -'ReflectionProperty::setAccessible' => ['void', 'visible'=>'bool'], -'ReflectionProperty::setValue' => ['void', 'object'=>'object', 'value'=>''], -'ReflectionProperty::setValue\'1' => ['void', 'value'=>''], -'ReflectionType::__toString' => ['string'], -'ReflectionType::allowsNull' => ['bool'], -'ReflectionType::getName' => ['string'], -'ReflectionType::isBuiltin' => ['bool'], -'ReflectionZendExtension::__clone' => ['void'], -'ReflectionZendExtension::__construct' => ['void', 'name'=>'string'], -'ReflectionZendExtension::__toString' => ['string'], -'ReflectionZendExtension::export' => ['string|null', 'name'=>'string', 'return='=>'bool'], -'ReflectionZendExtension::getAuthor' => ['string'], -'ReflectionZendExtension::getCopyright' => ['string'], -'ReflectionZendExtension::getName' => ['string'], -'ReflectionZendExtension::getURL' => ['string'], -'ReflectionZendExtension::getVersion' => ['string'], -'Reflector::__toString' => ['string'], -'Reflector::export' => ['?string'], -'RegexIterator::__construct' => ['void', 'it'=>'iterator', 'regex'=>'string', 'mode='=>'int', 'flags='=>'int', 'preg_flags='=>'int'], -'RegexIterator::accept' => ['bool'], -'RegexIterator::getFlags' => ['int'], -'RegexIterator::getMode' => ['int'], -'RegexIterator::getPregFlags' => ['int'], -'RegexIterator::getRegex' => ['string'], -'RegexIterator::setFlags' => ['bool', 'new_flags'=>'int'], -'RegexIterator::setMode' => ['bool', 'new_mode'=>'int'], -'RegexIterator::setPregFlags' => ['bool', 'new_flags'=>'int'], -'register_event_handler' => ['bool', 'event_handler_func'=>'event_handler_func', 'handler_register_name'=>'handler_register_name', 'event_type_mask'=>'event_type_mask'], -'register_shutdown_function' => ['void', 'function'=>'callable(): void', '...parameter='=>'mixed'], -'register_tick_function' => ['bool', 'function'=>'callable(): void', '...args='=>'mixed'], -'rename' => ['bool', 'old_name'=>'string', 'new_name'=>'string', 'context='=>'resource'], -'rename_function' => ['bool', 'original_name'=>'string', 'new_name'=>'string'], -'reset' => ['mixed', '&rw_array_arg'=>'array|object'], -'ResourceBundle::__construct' => ['void', 'locale'=>'string', 'bundlename'=>'string', 'fallback='=>'bool'], -'ResourceBundle::count' => ['int'], -'ResourceBundle::create' => ['?ResourceBundle', 'locale'=>'string', 'bundlename'=>'string', 'fallback='=>'bool'], -'ResourceBundle::get' => ['', 'index'=>'string|int', 'fallback='=>'bool'], -'ResourceBundle::getErrorCode' => ['int'], -'ResourceBundle::getErrorMessage' => ['string'], -'ResourceBundle::getLocales' => ['array', 'bundlename'=>'string'], -'resourcebundle_count' => ['int', 'r'=>'resourcebundle'], -'resourcebundle_create' => ['?ResourceBundle', 'locale'=>'string', 'bundlename'=>'string', 'fallback='=>'bool'], -'resourcebundle_get' => ['', 'r'=>'resourcebundle', 'index'=>'string|int', 'fallback='=>'bool'], -'resourcebundle_get_error_code' => ['int', 'r'=>'resourcebundle'], -'resourcebundle_get_error_message' => ['string', 'r'=>'resourcebundle'], -'resourcebundle_locales' => ['array', 'bundlename'=>'string'], -'restore_error_handler' => ['bool'], -'restore_exception_handler' => ['bool'], -'restore_include_path' => ['void'], -'rewind' => ['bool', 'fp'=>'resource'], -'rewinddir' => ['void', 'dir_handle='=>'resource'], -'rmdir' => ['bool', 'dirname'=>'string', 'context='=>'resource'], -'round' => ['float', 'number'=>'float', 'precision='=>'int', 'mode='=>'int'], -'rpm_close' => ['bool', 'rpmr'=>'resource'], -'rpm_get_tag' => ['mixed', 'rpmr'=>'resource', 'tagnum'=>'int'], -'rpm_is_valid' => ['bool', 'filename'=>'string'], -'rpm_open' => ['resource', 'filename'=>'string'], -'rpm_version' => ['string'], -'rrd_create' => ['bool', 'filename'=>'string', 'options'=>'array'], -'rrd_error' => ['string'], -'rrd_fetch' => ['array', 'filename'=>'string', 'options'=>'array'], -'rrd_first' => ['int', 'file'=>'string', 'raaindex='=>'int'], -'rrd_graph' => ['array', 'filename'=>'string', 'options'=>'array'], -'rrd_info' => ['array', 'filename'=>'string'], -'rrd_last' => ['int', 'filename'=>'string'], -'rrd_lastupdate' => ['array', 'filename'=>'string'], -'rrd_restore' => ['bool', 'xml_file'=>'string', 'rrd_file'=>'string', 'options='=>'array'], -'rrd_tune' => ['bool', 'filename'=>'string', 'options'=>'array'], -'rrd_update' => ['bool', 'filename'=>'string', 'options'=>'array'], -'rrd_version' => ['string'], -'rrd_xport' => ['array', 'options'=>'array'], -'rrdc_disconnect' => ['void'], -'RRDCreator::__construct' => ['void', 'path'=>'string', 'starttime='=>'string', 'step='=>'int'], -'RRDCreator::addArchive' => ['void', 'description'=>'string'], -'RRDCreator::addDataSource' => ['void', 'description'=>'string'], -'RRDCreator::save' => ['bool'], -'RRDGraph::__construct' => ['void', 'path'=>'string'], -'RRDGraph::save' => ['array'], -'RRDGraph::saveVerbose' => ['array'], -'RRDGraph::setOptions' => ['void', 'options'=>'array'], -'RRDUpdater::__construct' => ['void', 'path'=>'string'], -'RRDUpdater::update' => ['bool', 'values'=>'array', 'time='=>'string'], -'rsort' => ['bool', '&rw_array_arg'=>'array', 'sort_flags='=>'int'], -'rtrim' => ['string', 'str'=>'string', 'character_mask='=>'string'], -'runkit_class_adopt' => ['bool', 'classname'=>'string', 'parentname'=>'string'], -'runkit_class_emancipate' => ['bool', 'classname'=>'string'], -'runkit_constant_add' => ['bool', 'constname'=>'string', 'value'=>'mixed'], -'runkit_constant_redefine' => ['bool', 'constname'=>'string', 'newvalue'=>'mixed'], -'runkit_constant_remove' => ['bool', 'constname'=>'string'], -'runkit_function_add' => ['bool', 'funcname'=>'string', 'arglist'=>'string', 'code'=>'string', 'doccomment='=>'?string'], -'runkit_function_add\'1' => ['bool', 'funcname'=>'string', 'closure'=>'Closure', 'doccomment='=>'?string'], -'runkit_function_copy' => ['bool', 'funcname'=>'string', 'targetname'=>'string'], -'runkit_function_redefine' => ['bool', 'funcname'=>'string', 'arglist'=>'string', 'code'=>'string', 'doccomment='=>'?string'], -'runkit_function_redefine\'1' => ['bool', 'funcname'=>'string', 'closure'=>'Closure', 'doccomment='=>'?string'], -'runkit_function_remove' => ['bool', 'funcname'=>'string'], -'runkit_function_rename' => ['bool', 'funcname'=>'string', 'newname'=>'string'], -'runkit_import' => ['bool', 'filename'=>'string', 'flags='=>'int'], -'runkit_lint' => ['bool', 'code'=>'string'], -'runkit_lint_file' => ['bool', 'filename'=>'string'], -'runkit_method_add' => ['bool', 'classname'=>'string', 'methodname'=>'string', 'args'=>'string', 'code'=>'string', 'flags='=>'int', 'doccomment='=>'?string'], -'runkit_method_add\'1' => ['bool', 'classname'=>'string', 'methodname'=>'string', 'closure'=>'Closure', 'flags='=>'int', 'doccomment='=>'?string'], -'runkit_method_copy' => ['bool', 'dclass'=>'string', 'dmethod'=>'string', 'sclass'=>'string', 'smethod='=>'string'], -'runkit_method_redefine' => ['bool', 'classname'=>'string', 'methodname'=>'string', 'args'=>'string', 'code'=>'string', 'flags='=>'int', 'doccomment='=>'?string'], -'runkit_method_redefine\'1' => ['bool', 'classname'=>'string', 'methodname'=>'string', 'closure'=>'Closure', 'flags='=>'int', 'doccomment='=>'?string'], -'runkit_method_remove' => ['bool', 'classname'=>'string', 'methodname'=>'string'], -'runkit_method_rename' => ['bool', 'classname'=>'string', 'methodname'=>'string', 'newname'=>'string'], -'runkit_return_value_used' => ['bool'], -'Runkit_Sandbox::__construct' => ['void', 'options='=>'array'], -'runkit_sandbox_output_handler' => ['mixed', 'sandbox'=>'object', 'callback='=>'mixed'], -'Runkit_Sandbox_Parent' => [''], -'Runkit_Sandbox_Parent::__construct' => ['void'], -'runkit_superglobals' => ['array'], -'RuntimeException::__clone' => ['void'], -'RuntimeException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'(?Throwable)|(?RuntimeException)'], -'RuntimeException::__toString' => ['string'], -'RuntimeException::getCode' => ['int'], -'RuntimeException::getFile' => ['string'], -'RuntimeException::getLine' => ['int'], -'RuntimeException::getMessage' => ['string'], -'RuntimeException::getPrevious' => ['Throwable|RuntimeException|null'], -'RuntimeException::getTrace' => ['array'], -'RuntimeException::getTraceAsString' => ['string'], -'SAMConnection::commit' => ['bool'], -'SAMConnection::connect' => ['bool', 'protocol'=>'string', 'properties='=>'array'], -'SAMConnection::disconnect' => ['bool'], -'SAMConnection::errno' => ['int'], -'SAMConnection::error' => ['string'], -'SAMConnection::isConnected' => ['bool'], -'SAMConnection::peek' => ['SAMMessage', 'target'=>'string', 'properties='=>'array'], -'SAMConnection::peekAll' => ['array', 'target'=>'string', 'properties='=>'array'], -'SAMConnection::receive' => ['SAMMessage', 'target'=>'string', 'properties='=>'array'], -'SAMConnection::remove' => ['SAMMessage', 'target'=>'string', 'properties='=>'array'], -'SAMConnection::rollback' => ['bool'], -'SAMConnection::send' => ['string', 'target'=>'string', 'msg'=>'sammessage', 'properties='=>'array'], -'SAMConnection::setDebug' => ['', 'switch'=>'bool'], -'SAMConnection::subscribe' => ['string', 'targettopic'=>'string'], -'SAMConnection::unsubscribe' => ['bool', 'subscriptionid'=>'string', 'targettopic='=>'string'], -'SAMMessage::body' => ['string'], -'SAMMessage::header' => ['object'], -'sapi_windows_cp_conv' => ['string', 'in_codepage'=>'int|string', 'out_codepage'=>'int|string', 'subject'=>'string'], -'sapi_windows_cp_get' => ['int'], -'sapi_windows_cp_is_utf8' => ['bool'], -'sapi_windows_cp_set' => ['bool', 'code_page'=>'int'], -'sapi_windows_vt100_support' => ['bool', 'stream'=>'resource', 'enable='=>'bool'], -'SCA::createDataObject' => ['SDO_DataObject', 'type_namespace_uri'=>'string', 'type_name'=>'string'], -'SCA::getService' => ['', 'target'=>'string', 'binding='=>'string', 'config='=>'array'], -'SCA_LocalProxy::createDataObject' => ['SDO_DataObject', 'type_namespace_uri'=>'string', 'type_name'=>'string'], -'SCA_SoapProxy::createDataObject' => ['SDO_DataObject', 'type_namespace_uri'=>'string', 'type_name'=>'string'], -'scalebarObj::convertToString' => ['string'], -'scalebarObj::free' => ['void'], -'scalebarObj::set' => ['int', 'property_name'=>'string', 'new_value'=>''], -'scalebarObj::setImageColor' => ['int', 'red'=>'int', 'green'=>'int', 'blue'=>'int'], -'scalebarObj::updateFromString' => ['int', 'snippet'=>'string'], -'scandir' => ['array|false', 'dir'=>'string', 'sorting_order='=>'int', 'context='=>'resource'], -'SDO_DAS_ChangeSummary::beginLogging' => [''], -'SDO_DAS_ChangeSummary::endLogging' => [''], -'SDO_DAS_ChangeSummary::getChangedDataObjects' => ['SDO_List'], -'SDO_DAS_ChangeSummary::getChangeType' => ['int', 'dataobject'=>'sdo_dataobject'], -'SDO_DAS_ChangeSummary::getOldContainer' => ['SDO_DataObject', 'data_object'=>'sdo_dataobject'], -'SDO_DAS_ChangeSummary::getOldValues' => ['SDO_List', 'data_object'=>'sdo_dataobject'], -'SDO_DAS_ChangeSummary::isLogging' => ['bool'], -'SDO_DAS_DataFactory::addPropertyToType' => ['', 'parent_type_namespace_uri'=>'string', 'parent_type_name'=>'string', 'property_name'=>'string', 'type_namespace_uri'=>'string', 'type_name'=>'string', 'options='=>'array'], -'SDO_DAS_DataFactory::addType' => ['', 'type_namespace_uri'=>'string', 'type_name'=>'string', 'options='=>'array'], -'SDO_DAS_DataFactory::getDataFactory' => ['SDO_DAS_DataFactory'], -'SDO_DAS_DataObject::getChangeSummary' => ['SDO_DAS_ChangeSummary'], -'SDO_DAS_Relational::__construct' => ['void', 'database_metadata'=>'array', 'application_root_type='=>'string', 'sdo_containment_references_metadata='=>'array'], -'SDO_DAS_Relational::applyChanges' => ['', 'database_handle'=>'pdo', 'root_data_object'=>'sdodataobject'], -'SDO_DAS_Relational::createRootDataObject' => ['SDODataObject'], -'SDO_DAS_Relational::executePreparedQuery' => ['SDODataObject', 'database_handle'=>'pdo', 'prepared_statement'=>'pdostatement', 'value_list'=>'array', 'column_specifier='=>'array'], -'SDO_DAS_Relational::executeQuery' => ['SDODataObject', 'database_handle'=>'pdo', 'sql_statement'=>'string', 'column_specifier='=>'array'], -'SDO_DAS_Setting::getListIndex' => ['int'], -'SDO_DAS_Setting::getPropertyIndex' => ['int'], -'SDO_DAS_Setting::getPropertyName' => ['string'], -'SDO_DAS_Setting::getValue' => [''], -'SDO_DAS_Setting::isSet' => ['bool'], -'SDO_DAS_XML::addTypes' => ['', 'xsd_file'=>'string'], -'SDO_DAS_XML::create' => ['SDO_DAS_XML', 'xsd_file='=>'mixed', 'key='=>'string'], -'SDO_DAS_XML::createDataObject' => ['SDO_DataObject', 'namespace_uri'=>'string', 'type_name'=>'string'], -'SDO_DAS_XML::createDocument' => ['SDO_DAS_XML_Document', 'document_element_name'=>'string', 'document_element_namespace_uri'=>'string', 'dataobject='=>'sdo_dataobject'], -'SDO_DAS_XML::loadFile' => ['SDO_XMLDocument', 'xml_file'=>'string'], -'SDO_DAS_XML::loadString' => ['SDO_DAS_XML_Document', 'xml_string'=>'string'], -'SDO_DAS_XML::saveFile' => ['', 'xdoc'=>'sdo_xmldocument', 'xml_file'=>'string', 'indent='=>'int'], -'SDO_DAS_XML::saveString' => ['string', 'xdoc'=>'sdo_xmldocument', 'indent='=>'int'], -'SDO_DAS_XML_Document::getRootDataObject' => ['SDO_DataObject'], -'SDO_DAS_XML_Document::getRootElementName' => ['string'], -'SDO_DAS_XML_Document::getRootElementURI' => ['string'], -'SDO_DAS_XML_Document::setEncoding' => ['', 'encoding'=>'string'], -'SDO_DAS_XML_Document::setXMLDeclaration' => ['', 'xmldeclatation'=>'bool'], -'SDO_DAS_XML_Document::setXMLVersion' => ['', 'xmlversion'=>'string'], -'SDO_DataFactory::create' => ['void', 'type_namespace_uri'=>'string', 'type_name'=>'string'], -'SDO_DataObject::clear' => ['void'], -'SDO_DataObject::createDataObject' => ['SDO_DataObject', 'identifier'=>''], -'SDO_DataObject::getContainer' => ['SDO_DataObject'], -'SDO_DataObject::getSequence' => ['SDO_Sequence'], -'SDO_DataObject::getTypeName' => ['string'], -'SDO_DataObject::getTypeNamespaceURI' => ['string'], -'SDO_Exception::getCause' => [''], -'SDO_List::insert' => ['void', 'value'=>'mixed', 'index='=>'int'], -'SDO_Model_Property::getContainingType' => ['SDO_Model_Type'], -'SDO_Model_Property::getDefault' => [''], -'SDO_Model_Property::getName' => ['string'], -'SDO_Model_Property::getType' => ['SDO_Model_Type'], -'SDO_Model_Property::isContainment' => ['bool'], -'SDO_Model_Property::isMany' => ['bool'], -'SDO_Model_ReflectionDataObject::__construct' => ['void', 'data_object'=>'sdo_dataobject'], -'SDO_Model_ReflectionDataObject::export' => ['mixed', 'rdo'=>'sdo_model_reflectiondataobject', 'return='=>'bool'], -'SDO_Model_ReflectionDataObject::getContainmentProperty' => ['SDO_Model_Property'], -'SDO_Model_ReflectionDataObject::getInstanceProperties' => ['array'], -'SDO_Model_ReflectionDataObject::getType' => ['SDO_Model_Type'], -'SDO_Model_Type::getBaseType' => ['SDO_Model_Type'], -'SDO_Model_Type::getName' => ['string'], -'SDO_Model_Type::getNamespaceURI' => ['string'], -'SDO_Model_Type::getProperties' => ['array'], -'SDO_Model_Type::getProperty' => ['SDO_Model_Property', 'identifier'=>''], -'SDO_Model_Type::isAbstractType' => ['bool'], -'SDO_Model_Type::isDataType' => ['bool'], -'SDO_Model_Type::isInstance' => ['bool', 'data_object'=>'sdo_dataobject'], -'SDO_Model_Type::isOpenType' => ['bool'], -'SDO_Model_Type::isSequencedType' => ['bool'], -'SDO_Sequence::getProperty' => ['SDO_Model_Property', 'sequence_index'=>'int'], -'SDO_Sequence::insert' => ['void', 'value'=>'mixed', 'sequenceindex='=>'int', 'propertyidentifier='=>'mixed'], -'SDO_Sequence::move' => ['void', 'toindex'=>'int', 'fromindex'=>'int'], -'SeekableIterator::seek' => ['void', 'position'=>'int'], -'sem_acquire' => ['bool', 'sem_identifier'=>'resource', 'nowait='=>'bool'], -'sem_get' => ['resource', 'key'=>'int', 'max_acquire='=>'int', 'perm='=>'int', 'auto_release='=>'int'], -'sem_release' => ['bool', 'sem_identifier'=>'resource'], -'sem_remove' => ['bool', 'sem_identifier'=>'resource'], -'Serializable::serialize' => ['string'], -'Serializable::unserialize' => ['void', 'serialized'=>'string'], -'serialize' => ['string', 'variable'=>'mixed'], -'ServerRequest::withInput' => ['ServerRequest', 'input'=>'mixed'], -'ServerRequest::withoutParams' => ['ServerRequest', 'params'=>'int|string'], -'ServerRequest::withParam' => ['ServerRequest', 'key'=>'int|string', 'val'=>'mixed'], -'ServerRequest::withParams' => ['ServerRequest', 'params'=>'mixed'], -'ServerRequest::withUrl' => ['ServerRequest', 'url'=>'array'], -'ServerResponse::addHeader' => ['void', 'label'=>'string', 'value'=>'string'], -'ServerResponse::date' => ['string', 'date'=>'string|DateTimeInterface'], -'ServerResponse::getHeader' => ['string', 'label'=>'string'], -'ServerResponse::getHeaders' => ['string[]'], -'ServerResponse::getStatus' => ['int'], -'ServerResponse::getVersion' => ['string'], -'ServerResponse::setHeader' => ['void', 'label'=>'string', 'value'=>'string'], -'ServerResponse::setStatus' => ['void', 'status'=>'int'], -'ServerResponse::setVersion' => ['void', 'version'=>'string'], -'session_abort' => ['bool'], -'session_cache_expire' => ['int', 'new_cache_expire='=>'int'], -'session_cache_limiter' => ['string', 'new_cache_limiter='=>'string'], -'session_commit' => ['bool'], -'session_create_id' => ['string', 'prefix='=>'string'], -'session_decode' => ['bool', 'data'=>'string'], -'session_destroy' => ['bool'], -'session_encode' => ['string'], -'session_gc' => ['int'], -'session_get_cookie_params' => ['array'], -'session_id' => ['string', 'newid='=>'string'], -'session_is_registered' => ['bool', 'name'=>'string'], -'session_module_name' => ['string', 'newname='=>'string'], -'session_name' => ['string', 'newname='=>'string'], -'session_pgsql_add_error' => ['bool', 'error_level'=>'int', 'error_message='=>'string'], -'session_pgsql_get_error' => ['array', 'with_error_message='=>'bool'], -'session_pgsql_get_field' => ['string'], -'session_pgsql_reset' => ['bool'], -'session_pgsql_set_field' => ['bool', 'value'=>'string'], -'session_pgsql_status' => ['array'], -'session_regenerate_id' => ['bool', 'delete_old_session='=>'bool'], -'session_register' => ['bool', 'name'=>'mixed', '...args='=>'mixed'], -'session_register_shutdown' => ['void'], -'session_reset' => ['bool'], -'session_save_path' => ['string', 'newname='=>'string'], -'session_set_cookie_params' => ['bool', 'lifetime'=>'int', 'path='=>'string', 'domain='=>'?string', 'secure='=>'bool', 'httponly='=>'bool'], -'session_set_cookie_params\'1' => ['bool', 'options'=>'array{lifetime?:int,path?:string,domain?:?string,secure?:bool,httponly?:bool}'], -'session_set_save_handler' => ['bool', 'open'=>'callable(string,string):bool', 'close'=>'callable():bool', 'read'=>'callable(string):string', 'write'=>'callable(string,string):bool', 'destroy'=>'callable(string):bool', 'gc'=>'callable(string):bool', 'create_sid='=>'callable():string', 'validate_sid='=>'callable(string):bool', 'update_timestamp='=>'callable(string):bool'], -'session_set_save_handler\'1' => ['bool', 'sessionhandler'=>'SessionHandlerInterface', 'register_shutdown='=>'bool'], -'session_start' => ['bool', 'options='=>'array'], -'session_status' => ['int'], -'session_unregister' => ['bool', 'name'=>'string'], -'session_unset' => ['bool'], -'session_write_close' => ['bool'], -'SessionHandler::close' => ['bool'], -'SessionHandler::create_sid' => ['char'], -'SessionHandler::destroy' => ['bool', 'id'=>'string'], -'SessionHandler::gc' => ['bool', 'maxlifetime'=>'int'], -'SessionHandler::open' => ['bool', 'save_path'=>'string', 'session_name'=>'string'], -'SessionHandler::read' => ['string', 'id'=>'string'], -'SessionHandler::updateTimestamp' => ['bool', 'session_id'=>'string', 'session_data'=>'string'], -'SessionHandler::validateId' => ['bool', 'session_id'=>'string'], -'SessionHandler::write' => ['bool', 'id'=>'string', 'data'=>'string'], -'SessionHandlerInterface::close' => ['bool'], -'SessionHandlerInterface::destroy' => ['bool', 'session_id'=>'string'], -'SessionHandlerInterface::gc' => ['bool', 'maxlifetime'=>'int'], -'SessionHandlerInterface::open' => ['bool', 'save_path'=>'string', 'name'=>'string'], -'SessionHandlerInterface::read' => ['string', 'session_id'=>'string'], -'SessionHandlerInterface::write' => ['bool', 'session_id'=>'string', 'session_data'=>'string'], -'SessionIdInterface::create_sid' => ['string'], -'SessionUpdateTimestampHandler::updateTimestamp' => ['bool', 'id'=>'string', 'data'=>'string'], -'SessionUpdateTimestampHandler::validateId' => ['char', 'id'=>'string'], -'SessionUpdateTimestampHandlerInterface::updateTimestamp' => ['bool', 'key'=>'string', 'val'=>'string'], -'SessionUpdateTimestampHandlerInterface::validateId' => ['bool', 'key'=>'string'], -'set_error_handler' => ['?callable', 'error_handler'=>'null|callable(int,string,string,int,array):bool|callable(int,string,string,int):bool|callable(int,string,string):bool|callable(int,string):bool', 'error_types='=>'int'], -'set_exception_handler' => ['null|callable(Throwable):void', 'exception_handler'=>'null|callable(Throwable):void'], -'set_file_buffer' => ['int', 'fp'=>'resource', 'buffer'=>'int'], -'set_include_path' => ['string', 'new_include_path'=>'string'], -'set_magic_quotes_runtime' => ['bool', 'new_setting'=>'bool'], -'set_time_limit' => ['bool', 'seconds'=>'int'], -'setcookie' => ['bool', 'name'=>'string', 'value='=>'string', 'expires='=>'int', 'path='=>'string', 'domain='=>'string', 'secure='=>'bool', 'httponly='=>'bool'], -'setLeftFill' => ['void', 'red'=>'int', 'green'=>'int', 'blue'=>'int', 'a='=>'int'], -'setLine' => ['void', 'width'=>'int', 'red'=>'int', 'green'=>'int', 'blue'=>'int', 'a='=>'int'], -'setlocale' => ['string|false', 'category'=>'int', 'locale'=>'string', '...args='=>'string'], -'setlocale\'1' => ['string|false', 'category'=>'int', 'locale'=>'?array'], -'setproctitle' => ['void', 'title'=>'string'], -'setrawcookie' => ['bool', 'name'=>'string', 'value='=>'string', 'expires='=>'int', 'path='=>'string', 'domain='=>'string', 'secure='=>'bool', 'httponly='=>'bool'], -'setRightFill' => ['void', 'red'=>'int', 'green'=>'int', 'blue'=>'int', 'a='=>'int'], -'setthreadtitle' => ['bool', 'title'=>'string'], -'settype' => ['bool', '&rw_var'=>'mixed', 'type'=>'string'], -'sha1' => ['string', 'str'=>'string', 'raw_output='=>'bool'], -'sha1_file' => ['string|false', 'filename'=>'string', 'raw_output='=>'bool'], -'sha256' => ['string', 'str'=>'string', 'raw_output='=>'bool'], -'sha256_file' => ['string', 'filename'=>'string', 'raw_output='=>'bool'], -'shapefileObj::__construct' => ['void', 'filename'=>'string', 'type'=>'int'], -'shapefileObj::addPoint' => ['int', 'point'=>'pointObj'], -'shapefileObj::addShape' => ['int', 'shape'=>'shapeObj'], -'shapefileObj::free' => ['void'], -'shapefileObj::getExtent' => ['rectObj', 'i'=>'int'], -'shapefileObj::getPoint' => ['shapeObj', 'i'=>'int'], -'shapefileObj::getShape' => ['shapeObj', 'i'=>'int'], -'shapefileObj::getTransformed' => ['shapeObj', 'map'=>'MapObj', 'i'=>'int'], -'shapefileObj::ms_newShapefileObj' => ['shapefileObj', 'filename'=>'string', 'type'=>'int'], -'shapeObj::__construct' => ['void', 'type'=>'int'], -'shapeObj::add' => ['int', 'line'=>'lineObj'], -'shapeObj::boundary' => ['shapeObj'], -'shapeObj::contains' => ['bool', 'point'=>'pointObj'], -'shapeObj::containsShape' => ['int', 'shape2'=>'shapeObj'], -'shapeObj::convexhull' => ['shapeObj'], -'shapeObj::crosses' => ['int', 'shape'=>'shapeObj'], -'shapeObj::difference' => ['shapeObj', 'shape'=>'shapeObj'], -'shapeObj::disjoint' => ['int', 'shape'=>'shapeObj'], -'shapeObj::draw' => ['int', 'map'=>'MapObj', 'layer'=>'layerObj', 'img'=>'imageObj'], -'shapeObj::equals' => ['int', 'shape'=>'shapeObj'], -'shapeObj::free' => ['void'], -'shapeObj::getArea' => ['float'], -'shapeObj::getCentroid' => ['pointObj'], -'shapeObj::getLabelPoint' => ['pointObj'], -'shapeObj::getLength' => ['float'], -'shapeObj::getPointUsingMeasure' => ['pointObj', 'm'=>'float'], -'shapeObj::getValue' => ['string', 'layer'=>'layerObj', 'filedname'=>'string'], -'shapeObj::intersection' => ['shapeObj', 'shape'=>'shapeObj'], -'shapeObj::intersects' => ['bool', 'shape'=>'shapeObj'], -'shapeObj::line' => ['lineObj', 'i'=>'int'], -'shapeObj::ms_shapeObjFromWkt' => ['shapeObj', 'wkt'=>'string'], -'shapeObj::overlaps' => ['int', 'shape'=>'shapeObj'], -'shapeObj::project' => ['int', 'in'=>'projectionObj', 'out'=>'projectionObj'], -'shapeObj::set' => ['int', 'property_name'=>'string', 'new_value'=>''], -'shapeObj::setBounds' => ['int'], -'shapeObj::simplify' => ['shapeObj', 'tolerance'=>'float'], -'shapeObj::symdifference' => ['shapeObj', 'shape'=>'shapeObj'], -'shapeObj::topologyPreservingSimplify' => ['shapeObj', 'tolerance'=>'float'], -'shapeObj::touches' => ['int', 'shape'=>'shapeObj'], -'shapeObj::toWkt' => ['string'], -'shapeObj::union' => ['shapeObj', 'shape'=>'shapeObj'], -'shapeObj::within' => ['int', 'shape2'=>'shapeObj'], -'shell_exec' => ['?string', 'cmd'=>'string'], -'shm_attach' => ['resource', 'key'=>'int', 'memsize='=>'int', 'perm='=>'int'], -'shm_detach' => ['bool', 'shm_identifier'=>'resource'], -'shm_get_var' => ['mixed', 'id'=>'resource', 'variable_key'=>'int'], -'shm_has_var' => ['bool', 'shm_identifier'=>'resource', 'variable_key'=>'int'], -'shm_put_var' => ['bool', 'shm_identifier'=>'resource', 'variable_key'=>'int', 'variable'=>'mixed'], -'shm_remove' => ['bool', 'shm_identifier'=>'resource'], -'shm_remove_var' => ['bool', 'shm_identifier'=>'resource', 'variable_key'=>'int'], -'shmop_close' => ['void', 'shmid'=>'resource'], -'shmop_delete' => ['bool', 'shmid'=>'resource'], -'shmop_open' => ['resource|false', 'key'=>'int', 'flags'=>'string', 'mode'=>'int', 'size'=>'int'], -'shmop_read' => ['string', 'shmid'=>'resource', 'start'=>'int', 'count'=>'int'], -'shmop_size' => ['int', 'shmid'=>'resource'], -'shmop_write' => ['int', 'shmid'=>'resource', 'data'=>'string', 'offset'=>'int'], -'show_source' => ['', 'file_name'=>'', 'return'=>''], -'shuffle' => ['bool', '&rw_array_arg'=>'array'], -'signeurlpaiement' => ['string', 'clent'=>'string', 'data'=>'string'], -'similar_text' => ['int', 'str1'=>'string', 'str2'=>'string', '&w_percent='=>'float'], -'simplexml_import_dom' => ['SimpleXMLElement|false', 'node'=>'DOMNode', 'class_name='=>'string'], -'simplexml_load_file' => ['SimpleXMLElement|false', 'filename'=>'string', 'class_name='=>'string', 'options='=>'int', 'ns='=>'string', 'is_prefix='=>'bool'], -'simplexml_load_string' => ['SimpleXMLElement|false', 'data'=>'string', 'class_name='=>'string', 'options='=>'int', 'ns='=>'string', 'is_prefix='=>'bool'], -'SimpleXMLElement::__construct' => ['void', 'data'=>'string', 'options='=>'int', 'data_is_url='=>'bool', 'ns='=>'string', 'is_prefix='=>'bool'], -'SimpleXMLElement::__toString' => ['string'], -'SimpleXMLElement::__get' => ['SimpleXMLElement', 'name'=>'string'], -'SimpleXMLElement::addAttribute' => ['void', 'name'=>'string', 'value='=>'string', 'ns='=>'string'], -'SimpleXMLElement::addChild' => ['SimpleXMLElement', 'name'=>'string', 'value='=>'string', 'ns='=>'string'], -'SimpleXMLElement::asXML' => ['string|bool', 'filename='=>'string'], -'SimpleXMLElement::attributes' => ['SimpleXMLElement|null', 'ns='=>'string', 'is_prefix='=>'bool'], -'SimpleXMLElement::children' => ['SimpleXMLElement', 'ns='=>'string', 'is_prefix='=>'bool'], -'SimpleXMLElement::count' => ['int'], -'SimpleXMLElement::getDocNamespaces' => ['string[]', 'recursive='=>'bool', 'from_root='=>'bool'], -'SimpleXMLElement::getName' => ['string'], -'SimpleXMLElement::getNamespaces' => ['string[]', 'recursive='=>'bool'], -'SimpleXMLElement::registerXPathNamespace' => ['bool', 'prefix'=>'string', 'ns'=>'string'], -'SimpleXMLElement::xpath' => ['SimpleXMLElement[]|false', 'path'=>'string'], -'SimpleXMLIterator::current' => ['SimpleXMLIterator|null'], -'SimpleXMLIterator::getChildren' => ['SimpleXMLIterator'], -'SimpleXMLIterator::hasChildren' => ['bool'], -'SimpleXMLIterator::key' => ['string|false'], -'SimpleXMLIterator::next' => ['void'], -'SimpleXMLIterator::rewind' => ['void'], -'SimpleXMLIterator::valid' => ['bool'], -'sin' => ['float', 'number'=>'float'], -'sinh' => ['float', 'number'=>'float'], -'sizeof' => ['int', 'var'=>'Countable|array', 'mode='=>'int'], -'sleep' => ['int|false', 'seconds'=>'int'], -'snmp2_get' => ['string|false', 'host'=>'string', 'community'=>'string', 'object_id'=>'string', 'timeout='=>'int', 'retries='=>'int'], -'snmp2_getnext' => ['string|false', 'host'=>'string', 'community'=>'string', 'object_id'=>'string', 'timeout='=>'int', 'retries='=>'int'], -'snmp2_real_walk' => ['array|false', 'host'=>'string', 'community'=>'string', 'object_id'=>'string', 'timeout='=>'int', 'retries='=>'int'], -'snmp2_set' => ['bool', 'host'=>'string', 'community'=>'string', 'object_id'=>'string', 'type'=>'string', 'value'=>'string', 'timeout='=>'int', 'retries='=>'int'], -'snmp2_walk' => ['array|false', 'host'=>'string', 'community'=>'string', 'object_id'=>'string', 'timeout='=>'int', 'retries='=>'int'], -'snmp3_get' => ['string|false', 'host'=>'string', 'sec_name'=>'string', 'sec_level'=>'string', 'auth_protocol'=>'string', 'auth_passphrase'=>'string', 'priv_protocol'=>'string', 'priv_passphrase'=>'string', 'object_id'=>'string', 'timeout='=>'int', 'retries='=>'int'], -'snmp3_getnext' => ['string|false', 'host'=>'string', 'sec_name'=>'string', 'sec_level'=>'string', 'auth_protocol'=>'string', 'auth_passphrase'=>'string', 'priv_protocol'=>'string', 'priv_passphrase'=>'string', 'object_id'=>'string', 'timeout='=>'int', 'retries='=>'int'], -'snmp3_real_walk' => ['array|false', 'host'=>'string', 'sec_name'=>'string', 'sec_level'=>'string', 'auth_protocol'=>'string', 'auth_passphrase'=>'string', 'priv_protocol'=>'string', 'priv_passphrase'=>'string', 'object_id'=>'string', 'timeout='=>'int', 'retries='=>'int'], -'snmp3_set' => ['bool', 'host'=>'string', 'sec_name'=>'string', 'sec_level'=>'string', 'auth_protocol'=>'string', 'auth_passphrase'=>'string', 'priv_protocol'=>'string', 'priv_passphrase'=>'string', 'object_id'=>'string', 'type'=>'string', 'value'=>'string', 'timeout='=>'int', 'retries='=>'int'], -'snmp3_walk' => ['array|false', 'host'=>'string', 'sec_name'=>'string', 'sec_level'=>'string', 'auth_protocol'=>'string', 'auth_passphrase'=>'string', 'priv_protocol'=>'string', 'priv_passphrase'=>'string', 'object_id'=>'string', 'timeout='=>'int', 'retries='=>'int'], -'SNMP::__construct' => ['void', 'version'=>'int', 'hostname'=>'string', 'community'=>'string', 'timeout'=>'int', 'retries'=>'int'], -'SNMP::close' => ['bool'], -'SNMP::get' => ['mixed', 'object_id'=>'mixed', 'preserve_keys'=>'bool'], -'SNMP::getErrno' => ['int'], -'SNMP::getError' => ['int'], -'SNMP::getnext' => ['mixed', 'object_id'=>'mixed'], -'SNMP::set' => ['bool', 'object_id'=>'mixed', 'type'=>'mixed', 'value'=>'mixed'], -'SNMP::setSecurity' => ['bool', 'sec_level'=>'string', 'auth_protocol'=>'string', 'auth_passphrase'=>'string', 'priv_protocol'=>'string', 'priv_passphrase'=>'string', 'contextname'=>'string', 'contextengineid'=>'string'], -'SNMP::walk' => ['array', 'object_id'=>'string', 'suffix_as_key'=>'bool', 'max_repetitions'=>'int', 'non_repeaters'=>'int'], -'snmp_get_quick_print' => ['bool'], -'snmp_get_valueretrieval' => ['int'], -'snmp_read_mib' => ['bool', 'filename'=>'string'], -'snmp_set_enum_print' => ['bool', 'enum_print'=>'int'], -'snmp_set_oid_numeric_print' => ['void', 'oid_format'=>'int'], -'snmp_set_oid_output_format' => ['bool', 'oid_format'=>'int'], -'snmp_set_quick_print' => ['bool', 'quick_print'=>'int'], -'snmp_set_valueretrieval' => ['bool', 'method'=>'int'], -'snmpget' => ['string|false', 'host'=>'string', 'community'=>'string', 'object_id'=>'string', 'timeout='=>'int', 'retries='=>'int'], -'snmpgetnext' => ['string|false', 'host'=>'string', 'community'=>'string', 'object_id'=>'string', 'timeout='=>'int', 'retries='=>'int'], -'snmprealwalk' => ['array|false', 'host'=>'string', 'community'=>'string', 'object_id'=>'string', 'timeout='=>'int', 'retries='=>'int'], -'snmpset' => ['bool', 'host'=>'string', 'community'=>'string', 'object_id'=>'string', 'type'=>'string', 'value'=>'mixed', 'timeout='=>'int', 'retries='=>'int'], -'snmpwalk' => ['array|false', 'host'=>'string', 'community'=>'string', 'object_id'=>'string', 'timeout='=>'int', 'retries='=>'int'], -'snmpwalkoid' => ['array|false', 'hostname'=>'string', 'community'=>'string', 'object_id'=>'string', 'timeout='=>'int', 'retries='=>'int'], -'SoapClient::__call' => ['', 'function_name'=>'string', 'arguments'=>'string'], -'SoapClient::__construct' => ['void', 'wsdl'=>'mixed', 'options='=>'array'], -'SoapClient::__doRequest' => ['string', 'request'=>'string', 'location'=>'string', 'action'=>'string', 'version'=>'int', 'one_way='=>'int'], -'SoapClient::__getCookies' => ['array'], -'SoapClient::__getFunctions' => ['array'], -'SoapClient::__getLastRequest' => ['string'], -'SoapClient::__getLastRequestHeaders' => ['string'], -'SoapClient::__getLastResponse' => ['string'], -'SoapClient::__getLastResponseHeaders' => ['string'], -'SoapClient::__getTypes' => ['array'], -'SoapClient::__setCookie' => ['', 'name'=>'string', 'value='=>'string'], -'SoapClient::__setLocation' => ['string', 'new_location='=>'string'], -'SoapClient::__setSoapHeaders' => ['bool', 'soapheaders='=>''], -'SoapClient::__soapCall' => ['', 'function_name'=>'string', 'arguments'=>'array', 'options='=>'array', 'input_headers='=>'', '&w_output_headers='=>'array'], -'SoapClient::SoapClient' => ['object', 'wsdl'=>'mixed', 'options='=>'array'], -'SoapFault::__construct' => ['void', 'faultcode'=>'string', 'faultstring'=>'string', 'faultactor='=>'string', 'detail='=>'string', 'faultname='=>'string', 'headerfault='=>'string'], -'SoapFault::__toString' => ['string'], -'SoapFault::SoapFault' => ['object', 'faultcode'=>'string', 'faultstring'=>'string', 'faultactor='=>'string', 'detail='=>'string', 'faultname='=>'string', 'headerfault='=>'string'], -'SoapHeader::__construct' => ['void', 'namespace'=>'string', 'name'=>'string', 'data='=>'mixed', 'mustunderstand='=>'bool', 'actor='=>'string'], -'SoapHeader::SoapHeader' => ['object', 'namespace'=>'string', 'name'=>'string', 'data='=>'mixed', 'mustunderstand='=>'bool', 'actor='=>'string'], -'SoapParam::__construct' => ['void', 'data'=>'mixed', 'name'=>'string'], -'SoapParam::SoapParam' => ['object', 'data'=>'mixed', 'name'=>'string'], -'SoapServer::__construct' => ['void', 'wsdl'=>'?string', 'options='=>'array'], -'SoapServer::addFunction' => ['void', 'functions'=>'mixed'], -'SoapServer::addSoapHeader' => ['void', 'object'=>'soapheader'], -'SoapServer::fault' => ['void', 'code'=>'string', 'string'=>'string', 'actor='=>'string', 'details='=>'string', 'name='=>'string'], -'SoapServer::getFunctions' => ['array'], -'SoapServer::handle' => ['void', 'soap_request='=>'string'], -'SoapServer::setClass' => ['void', 'class_name'=>'string', '...args='=>'mixed'], -'SoapServer::setObject' => ['void', 'obj'=>'object'], -'SoapServer::setPersistence' => ['void', 'mode'=>'int'], -'SoapServer::SoapServer' => ['object', 'wsdl'=>'?string', 'options'=>'array'], -'SoapVar::__construct' => ['void', 'data'=>'mixed', 'encoding'=>'int', 'type_name='=>'string', 'type_namespace='=>'string', 'node_name='=>'string', 'node_namespace='=>'string'], -'SoapVar::SoapVar' => ['object', 'data'=>'mixed', 'encoding'=>'int', 'type_name='=>'string', 'type_namespace='=>'string', 'node_name='=>'string', 'node_namespace='=>'string'], -'socket_accept' => ['resource|false', 'socket'=>'resource'], -'socket_addrinfo_bind' => ['resource|null', 'addrinfo'=>'resource'], -'socket_addrinfo_connect' => ['resource|null', 'addrinfo'=>'resource'], -'socket_addrinfo_explain' => ['array', 'addrinfo'=>'resource'], -'socket_addrinfo_lookup' => ['resource[]', 'node'=>'string', 'service='=>'mixed', 'hints='=>'array'], -'socket_bind' => ['bool', 'socket'=>'resource', 'addr'=>'string', 'port='=>'int'], -'socket_clear_error' => ['void', 'socket='=>'resource'], -'socket_close' => ['void', 'socket'=>'resource'], -'socket_cmsg_space' => ['int', 'level'=>'int', 'type'=>'int'], -'socket_connect' => ['bool', 'socket'=>'resource', 'addr'=>'string', 'port='=>'int'], -'socket_create' => ['resource|false', 'domain'=>'int', 'type'=>'int', 'protocol'=>'int'], -'socket_create_listen' => ['resource|false', 'port'=>'int', 'backlog='=>'int'], -'socket_create_pair' => ['bool', 'domain'=>'int', 'type'=>'int', 'protocol'=>'int', '&w_fd'=>'resource[]'], -'socket_export_stream' => ['resource|false', 'socket'=>'resource'], -'socket_get_option' => ['mixed', 'socket'=>'resource', 'level'=>'int', 'optname'=>'int'], -'socket_getopt' => ['mixed', 'socket'=>'resource', 'level'=>'int', 'optname'=>'int'], -'socket_getpeername' => ['bool', 'socket'=>'resource', '&w_addr'=>'string', '&w_port='=>'int'], -'socket_getsockname' => ['bool', 'socket'=>'resource', '&w_addr'=>'string', '&w_port='=>'int'], -'socket_import_stream' => ['resource|false', 'stream'=>'resource'], -'socket_last_error' => ['int', 'socket='=>'resource'], -'socket_listen' => ['bool', 'socket'=>'resource', 'backlog='=>'int'], -'socket_read' => ['string|false', 'socket'=>'resource', 'length'=>'int', 'type='=>'int'], -'socket_recv' => ['int|false', 'socket'=>'resource', '&w_buf'=>'string', 'len'=>'int', 'flags'=>'int'], -'socket_recvfrom' => ['int|false', 'socket'=>'resource', '&w_buf'=>'string', 'len'=>'int', 'flags'=>'int', '&w_name'=>'string', '&w_port='=>'int'], -'socket_recvmsg' => ['int|false', 'socket'=>'resource', '&w_message'=>'string', 'flags='=>'int'], -'socket_select' => ['int|false', '&rw_read_fds'=>'resource[]|null', '&rw_write_fds'=>'resource[]|null', '&rw_except_fds'=>'resource[]|null', 'tv_sec'=>'int', 'tv_usec='=>'int'], -'socket_send' => ['int|false', 'socket'=>'resource', 'buf'=>'string', 'len'=>'int', 'flags'=>'int'], -'socket_sendmsg' => ['int|false', 'socket'=>'resource', 'message'=>'array', 'flags'=>'int'], -'socket_sendto' => ['int|false', 'socket'=>'resource', 'buf'=>'string', 'len'=>'int', 'flags'=>'int', 'addr'=>'string', 'port='=>'int'], -'socket_set_block' => ['bool', 'socket'=>'resource'], -'socket_set_nonblock' => ['bool', 'socket'=>'resource'], -'socket_set_option' => ['bool', 'socket'=>'resource', 'level'=>'int', 'optname'=>'int', 'optval'=>'int|string|array'], -'socket_shutdown' => ['bool', 'socket'=>'resource', 'how='=>'int'], -'socket_strerror' => ['string', 'errno'=>'int'], -'socket_write' => ['int|false', 'socket'=>'resource', 'buf'=>'string', 'length='=>'int'], -'socket_wsaprotocol_info_export' => ['string|false', 'stream'=>'resource', 'target_pid'=>'int'], -'socket_wsaprotocol_info_import' => ['resource|false', 'id'=>'string'], -'socket_wsaprotocol_info_release' => ['bool', 'id'=>'string'], -'Sodium\add' => ['', '&left'=>'string', 'right'=>'string'], -'Sodium\bin2hex' => ['string', 'binary'=>'string'], -'Sodium\compare' => ['int', 'left'=>'string', 'right'=>'string'], -'Sodium\crypto_aead_aes256gcm_decrypt' => ['string', 'msg'=>'string', 'nonce'=>'string', 'key'=>'string', 'ad='=>'string'], -'Sodium\crypto_aead_aes256gcm_encrypt' => ['string', 'msg'=>'string', 'nonce'=>'string', 'key'=>'string', 'ad='=>'string'], -'Sodium\crypto_aead_aes256gcm_is_available' => ['bool'], -'Sodium\crypto_aead_chacha20poly1305_decrypt' => ['string', 'msg'=>'string', 'nonce'=>'string', 'key'=>'string', 'ad='=>'string'], -'Sodium\crypto_aead_chacha20poly1305_encrypt' => ['string', 'msg'=>'string', 'nonce'=>'string', 'key'=>'string', 'ad='=>'string'], -'Sodium\crypto_auth' => ['string', 'msg'=>'string', 'key'=>'string'], -'Sodium\crypto_auth_verify' => ['bool', 'mac'=>'string', 'msg'=>'string', 'key'=>'string'], -'Sodium\crypto_box' => ['string', 'msg'=>'string', 'nonce'=>'string', 'keypair'=>'string'], -'Sodium\crypto_box_keypair' => ['string'], -'Sodium\crypto_box_keypair_from_secretkey_and_publickey' => ['string', 'secretkey'=>'string', 'publickey'=>'string'], -'Sodium\crypto_box_open' => ['string', 'msg'=>'string', 'nonce'=>'string', 'keypair'=>'string'], -'Sodium\crypto_box_publickey' => ['string', 'keypair'=>'string'], -'Sodium\crypto_box_publickey_from_secretkey' => ['string', 'secretkey'=>'string'], -'Sodium\crypto_box_seal' => ['string', 'message'=>'string', 'publickey'=>'string'], -'Sodium\crypto_box_seal_open' => ['string', 'encrypted'=>'string', 'keypair'=>'string'], -'Sodium\crypto_box_secretkey' => ['string', 'keypair'=>'string'], -'Sodium\crypto_box_seed_keypair' => ['string', 'seed'=>'string'], -'Sodium\crypto_generichash' => ['string', 'input'=>'string', 'key='=>'string', 'length='=>'int'], -'Sodium\crypto_generichash_final' => ['string', 'state'=>'string', 'length='=>'int'], -'Sodium\crypto_generichash_init' => ['string', 'key='=>'string', 'length='=>'int'], -'Sodium\crypto_generichash_update' => ['bool', '&hashState'=>'string', 'append'=>'string'], -'Sodium\crypto_kx' => ['string', 'secretkey'=>'string', 'publickey'=>'string', 'client_publickey'=>'string', 'server_publickey'=>'string'], -'Sodium\crypto_pwhash' => ['string', 'out_len'=>'int', 'passwd'=>'string', 'salt'=>'string', 'opslimit'=>'int', 'memlimit'=>'int'], -'Sodium\crypto_pwhash_scryptsalsa208sha256' => ['string', 'out_len'=>'int', 'passwd'=>'string', 'salt'=>'string', 'opslimit'=>'int', 'memlimit'=>'int'], -'Sodium\crypto_pwhash_scryptsalsa208sha256_str' => ['string', 'passwd'=>'string', 'opslimit'=>'int', 'memlimit'=>'int'], -'Sodium\crypto_pwhash_scryptsalsa208sha256_str_verify' => ['bool', 'hash'=>'string', 'passwd'=>'string'], -'Sodium\crypto_pwhash_str' => ['string', 'passwd'=>'string', 'opslimit'=>'int', 'memlimit'=>'int'], -'Sodium\crypto_pwhash_str_verify' => ['bool', 'hash'=>'string', 'passwd'=>'string'], -'Sodium\crypto_scalarmult' => ['string', 'ecdhA'=>'string', 'ecdhB'=>'string'], -'Sodium\crypto_scalarmult_base' => ['string', 'sk'=>'string'], -'Sodium\crypto_secretbox' => ['string', 'plaintext'=>'string', 'nonce'=>'string', 'key'=>'string'], -'Sodium\crypto_secretbox_open' => ['string', 'ciphertext'=>'string', 'nonce'=>'string', 'key'=>'string'], -'Sodium\crypto_shorthash' => ['string', 'message'=>'string', 'key'=>'string'], -'Sodium\crypto_sign' => ['string', 'message'=>'string', 'secretkey'=>'string'], -'Sodium\crypto_sign_detached' => ['string', 'message'=>'string', 'secretkey'=>'string'], -'Sodium\crypto_sign_ed25519_pk_to_curve25519' => ['string', 'sign_pk'=>'string'], -'Sodium\crypto_sign_ed25519_sk_to_curve25519' => ['string', 'sign_sk'=>'string'], -'Sodium\crypto_sign_keypair' => ['string'], -'Sodium\crypto_sign_keypair_from_secretkey_and_publickey' => ['string', 'secretkey'=>'string', 'publickey'=>'string'], -'Sodium\crypto_sign_open' => ['string|false', 'signed_message'=>'string', 'publickey'=>'string'], -'Sodium\crypto_sign_publickey' => ['string', 'keypair'=>'string'], -'Sodium\crypto_sign_publickey_from_secretkey' => ['string', 'secretkey'=>'string'], -'Sodium\crypto_sign_secretkey' => ['string', 'keypair'=>'string'], -'Sodium\crypto_sign_seed_keypair' => ['string', 'seed'=>'string'], -'Sodium\crypto_sign_verify_detached' => ['bool', 'signature'=>'string', 'msg'=>'string', 'publickey'=>'string'], -'Sodium\crypto_stream' => ['string', 'length'=>'int', 'nonce'=>'string', 'key'=>'string'], -'Sodium\crypto_stream_xor' => ['string', 'plaintext'=>'string', 'nonce'=>'string', 'key'=>'string'], -'Sodium\hex2bin' => ['string', 'hex'=>'string'], -'Sodium\increment' => ['string', '&nonce'=>'string'], -'Sodium\library_version_major' => ['int'], -'Sodium\library_version_minor' => ['int'], -'Sodium\memcmp' => ['int', 'left'=>'string', 'right'=>'string'], -'Sodium\memzero' => ['', '&target'=>'string'], -'Sodium\randombytes_buf' => ['string', 'length'=>'int'], -'Sodium\randombytes_random16' => ['int|string'], -'Sodium\randombytes_uniform' => ['int', 'upperBoundNonInclusive'=>'int'], -'Sodium\version_string' => ['string'], -'sodium_add' => ['string', 'string_1'=>'string', 'string_2'=>'string'], -'sodium_base642bin' => ['string', 'base64'=>'string', 'variant'=>'int', 'ignore'=>'string'], -'sodium_bin2base64' => ['string', 'binary'=>'string', 'variant'=>'int'], -'sodium_bin2hex' => ['string', 'binary'=>'string'], -'sodium_compare' => ['int', 'string_1'=>'string', 'string_2'=>'string'], -'sodium_crypto_aead_aes256gcm_decrypt' => ['string|false', 'confidential_message'=>'string', 'public_message'=>'string', 'nonce'=>'string', 'key'=>'string'], -'sodium_crypto_aead_aes256gcm_encrypt' => ['string', 'confidential_message'=>'string', 'public_message'=>'string', 'nonce'=>'string', 'key'=>'string'], -'sodium_crypto_aead_aes256gcm_is_available' => ['bool'], -'sodium_crypto_aead_aes256gcm_keygen' => ['string'], -'sodium_crypto_aead_chacha20poly1305_decrypt' => ['string', 'confidential_message'=>'string', 'public_message'=>'string', 'nonce'=>'string', 'key'=>'string'], -'sodium_crypto_aead_chacha20poly1305_encrypt' => ['string', 'confidential_message'=>'string', 'public_message'=>'string', 'nonce'=>'string', 'key'=>'string'], -'sodium_crypto_aead_chacha20poly1305_ietf_decrypt' => ['string|false', 'confidential_message'=>'string', 'public_message'=>'string', 'nonce'=>'string', 'key'=>'string'], -'sodium_crypto_aead_chacha20poly1305_ietf_encrypt' => ['string', 'confidential_message'=>'string', 'public_message'=>'string', 'nonce'=>'string', 'key'=>'string'], -'sodium_crypto_aead_chacha20poly1305_ietf_keygen' => ['string'], -'sodium_crypto_aead_chacha20poly1305_keygen' => ['string'], -'sodium_crypto_aead_xchacha20poly1305_ietf_decrypt' => ['string|false', 'confidential_message'=>'string', 'public_message'=>'string', 'nonce'=>'string', 'key'=>'string'], -'sodium_crypto_aead_xchacha20poly1305_ietf_encrypt' => ['string', 'confidential_message'=>'string', 'public_message'=>'string', 'nonce'=>'string', 'key'=>'string'], -'sodium_crypto_aead_xchacha20poly1305_ietf_keygen' => ['string'], -'sodium_crypto_auth' => ['string', 'message'=>'string', 'key'=>'string'], -'sodium_crypto_auth_keygen' => ['string'], -'sodium_crypto_auth_verify' => ['bool', 'mac'=>'string', 'message'=>'string', 'key'=>'string'], -'sodium_crypto_box' => ['string', 'string'=>'string', 'nonce'=>'string', 'key'=>'string'], -'sodium_crypto_box_keypair' => ['string'], -'sodium_crypto_box_keypair_from_secretkey_and_publickey' => ['string', 'secret_key'=>'string', 'public_key'=>'string'], -'sodium_crypto_box_open' => ['string|false', 'message'=>'string', 'nonce'=>'string', 'message_keypair'=>'string'], -'sodium_crypto_box_publickey' => ['string', 'keypair'=>'string'], -'sodium_crypto_box_publickey_from_secretkey' => ['string', 'secretkey'=>'string'], -'sodium_crypto_box_seal' => ['string', 'message'=>'string', 'publickey'=>'string'], -'sodium_crypto_box_seal_open' => ['string|false', 'message'=>'string', 'recipient_keypair'=>'string'], -'sodium_crypto_box_secretkey' => ['string', 'keypair'=>'string'], -'sodium_crypto_box_seed_keypair' => ['string', 'seed'=>'string'], -'sodium_crypto_generichash' => ['string', 'msg'=>'string', 'key='=>'?string', 'length='=>'?int'], -'sodium_crypto_generichash_final' => ['string', 'state'=>'string', 'length='=>'?int'], -'sodium_crypto_generichash_init' => ['string', 'key='=>'?string', 'length='=>'?int'], -'sodium_crypto_generichash_keygen' => ['string'], -'sodium_crypto_generichash_update' => ['bool', 'state'=>'string', 'string'=>'string'], -'sodium_crypto_kdf_derive_from_key' => ['string', 'subkey_len'=>'int', 'subkey_id'=>'int', 'context'=>'string', 'key'=>'string'], -'sodium_crypto_kdf_keygen' => ['string'], -'sodium_crypto_kx' => ['string', 'secretkey'=>'string', 'publickey'=>'string', 'client_publickey'=>'string', 'server_publickey'=>'string'], -'sodium_crypto_kx_client_session_keys' => ['string', 'client_keypair'=>'string', 'server_key'=>'string'], -'sodium_crypto_kx_keypair' => ['string'], -'sodium_crypto_kx_publickey' => ['string', 'keypair'=>'string'], -'sodium_crypto_kx_secretkey' => ['string', 'keypair'=>'string'], -'sodium_crypto_kx_seed_keypair' => ['string', 'seed'=>'string'], -'sodium_crypto_kx_server_session_keys' => ['string', 'server_keypair'=>'string', 'client_key'=>'string'], -'sodium_crypto_pwhash' => ['string', 'length'=>'int', 'password'=>'string', 'salt'=>'string', 'opslimit'=>'int', 'memlimit'=>'int', 'alg='=>'int'], -'sodium_crypto_pwhash_scryptsalsa208sha256' => ['string', 'length'=>'int', 'password'=>'string', 'salt'=>'string', 'opslimit'=>'int', 'memlimit'=>'int'], -'sodium_crypto_pwhash_scryptsalsa208sha256_str' => ['string', 'password'=>'string', 'opslimit'=>'int', 'memlimit'=>'int'], -'sodium_crypto_pwhash_scryptsalsa208sha256_str_verify' => ['bool', 'hash'=>'string', 'password'=>'string'], -'sodium_crypto_pwhash_str' => ['string', 'password'=>'string', 'opslimit'=>'int', 'memlimit'=>'int'], -'sodium_crypto_pwhash_str_needs_rehash' => ['bool', 'password'=>'string', 'opslimit'=>'int', 'memlimit'=>'int'], -'sodium_crypto_pwhash_str_verify' => ['bool', 'hash'=>'string', 'password'=>'string'], -'sodium_crypto_scalarmult' => ['string', 'string_1'=>'string', 'string_2'=>'string'], -'sodium_crypto_scalarmult_base' => ['string', 'key'=>'string'], -'sodium_crypto_secretbox' => ['string', 'plaintext'=>'string', 'nonce'=>'string', 'key'=>'string'], -'sodium_crypto_secretbox_keygen' => ['string'], -'sodium_crypto_secretbox_open' => ['string|false', 'ciphertext'=>'string', 'nonce'=>'string', 'key'=>'string'], -'sodium_crypto_secretstream_xchacha20poly1305_init_pull' => ['string', 'header'=>'string', 'key'=>'string'], -'sodium_crypto_secretstream_xchacha20poly1305_init_push' => ['array', 'key'=>'string'], -'sodium_crypto_secretstream_xchacha20poly1305_keygen' => ['string'], -'sodium_crypto_secretstream_xchacha20poly1305_pull' => ['array', 'state'=>'string', 'c'=>'string', 'ad='=>'string'], -'sodium_crypto_secretstream_xchacha20poly1305_push' => ['string', 'state'=>'string', 'msg'=>'string', 'ad='=>'string', 'tag='=>'int'], -'sodium_crypto_secretstream_xchacha20poly1305_rekey' => ['void', 'state'=>'string'], -'sodium_crypto_shorthash' => ['string', 'message'=>'string', 'key'=>'string'], -'sodium_crypto_shorthash_keygen' => ['string'], -'sodium_crypto_sign' => ['string', 'message'=>'string', 'secretkey'=>'string'], -'sodium_crypto_sign_detached' => ['string', 'message'=>'string', 'secretkey'=>'string'], -'sodium_crypto_sign_ed25519_pk_to_curve25519' => ['string', 'ed25519pk'=>'string'], -'sodium_crypto_sign_ed25519_sk_to_curve25519' => ['string', 'ed25519sk'=>'string'], -'sodium_crypto_sign_keypair' => ['string'], -'sodium_crypto_sign_keypair_from_secretkey_and_publickey' => ['string', 'secret_key'=>'string', 'public_key'=>'string'], -'sodium_crypto_sign_open' => ['string|false', 'message'=>'string', 'publickey'=>'string'], -'sodium_crypto_sign_publickey' => ['string', 'keypair'=>'string'], -'sodium_crypto_sign_publickey_from_secretkey' => ['string', 'secretkey'=>'string'], -'sodium_crypto_sign_secretkey' => ['string', 'keypair'=>'string'], -'sodium_crypto_sign_seed_keypair' => ['string', 'seed'=>'string'], -'sodium_crypto_sign_verify_detached' => ['bool', 'signature'=>'string', 'message'=>'string', 'publickey'=>'string'], -'sodium_crypto_stream' => ['string', 'length'=>'int', 'nonce'=>'string', 'key'=>'string'], -'sodium_crypto_stream_keygen' => ['string'], -'sodium_crypto_stream_xor' => ['string', 'message'=>'string', 'nonce'=>'string', 'key'=>'string'], -'sodium_hex2bin' => ['string', 'hex'=>'string', 'ignore='=>'string'], -'sodium_increment' => ['string', '&binary_string'=>'string'], -'sodium_library_version_major' => ['int'], -'sodium_library_version_minor' => ['int'], -'sodium_memcmp' => ['int', 'string_1'=>'string', 'string_2'=>'string'], -'sodium_memzero' => ['void', '&secret'=>'string'], -'sodium_pad' => ['string', 'unpadded'=>'string', 'length'=>'int'], -'sodium_randombytes_buf' => ['string', 'length'=>'int'], -'sodium_randombytes_random16' => ['int|string'], -'sodium_randombytes_uniform' => ['int', 'upperBoundNonInclusive'=>'int'], -'sodium_unpad' => ['string', 'padded'=>'string', 'length'=>'int'], -'sodium_version_string' => ['string'], -'solid_fetch_prev' => ['bool', 'result_id'=>''], -'solr_get_version' => ['string'], -'SolrClient::__construct' => ['void', 'clientOptions'=>'array'], -'SolrClient::__destruct' => [''], -'SolrClient::addDocument' => ['SolrUpdateResponse', 'doc'=>'solrinputdocument', 'allowdups='=>'bool', 'commitwithin='=>'int'], -'SolrClient::addDocuments' => ['SolrUpdateResponse', 'docs'=>'array', 'allowdups='=>'bool', 'commitwithin='=>'int'], -'SolrClient::commit' => ['SolrUpdateResponse', 'maxsegments='=>'int', 'waitflush='=>'bool', 'waitsearcher='=>'bool'], -'SolrClient::deleteById' => ['SolrUpdateResponse', 'id'=>'string'], -'SolrClient::deleteByIds' => ['SolrUpdateResponse', 'ids'=>'array'], -'SolrClient::deleteByQueries' => ['SolrUpdateResponse', 'queries'=>'array'], -'SolrClient::deleteByQuery' => ['SolrUpdateResponse', 'query'=>'string'], -'SolrClient::getById' => ['SolrQueryResponse', 'id'=>'string'], -'SolrClient::getByIds' => ['SolrQueryResponse', 'ids'=>'array'], -'SolrClient::getDebug' => ['string'], -'SolrClient::getOptions' => ['array'], -'SolrClient::optimize' => ['SolrUpdateResponse', 'maxsegments='=>'int', 'waitflush='=>'bool', 'waitsearcher='=>'bool'], -'SolrClient::ping' => ['SolrPingResponse'], -'SolrClient::query' => ['SolrQueryResponse', 'query'=>'solrparams'], -'SolrClient::request' => ['SolrUpdateResponse', 'raw_request'=>'string'], -'SolrClient::rollback' => ['SolrUpdateResponse'], -'SolrClient::setResponseWriter' => ['void', 'responsewriter'=>'string'], -'SolrClient::setServlet' => ['bool', 'type'=>'int', 'value'=>'string'], -'SolrClient::system' => ['void'], -'SolrClient::threads' => ['void'], -'SolrClientException::getInternalInfo' => ['array'], -'SolrCollapseFunction::__toString' => ['string'], -'SolrCollapseFunction::getField' => ['string'], -'SolrCollapseFunction::getHint' => ['string'], -'SolrCollapseFunction::getMax' => ['string'], -'SolrCollapseFunction::getMin' => ['string'], -'SolrCollapseFunction::getNullPolicy' => ['string'], -'SolrCollapseFunction::getSize' => ['int'], -'SolrCollapseFunction::setField' => ['SolrCollapseFunction', 'fieldName'=>'string'], -'SolrCollapseFunction::setHint' => ['SolrCollapseFunction', 'hint'=>'string'], -'SolrCollapseFunction::setMax' => ['SolrCollapseFunction', 'max'=>'string'], -'SolrCollapseFunction::setMin' => ['SolrCollapseFunction', 'min'=>'string'], -'SolrCollapseFunction::setNullPolicy' => ['SolrCollapseFunction', 'nullPolicy'=>'string'], -'SolrCollapseFunction::setSize' => ['SolrCollapseFunction', 'size'=>'int'], -'SolrDisMaxQuery::__construct' => ['void', 'q='=>'string'], -'SolrDisMaxQuery::addBigramPhraseField' => ['SolrDisMaxQuery', 'field'=>'string', 'boost'=>'string', 'slop='=>'string'], -'SolrDisMaxQuery::addBoostQuery' => ['SolrDisMaxQuery', 'field'=>'string', 'value'=>'string', 'boost='=>'string'], -'SolrDisMaxQuery::addExpandFilterQuery' => ['SolrQuery', 'fq'=>'string'], -'SolrDisMaxQuery::addExpandSortField' => ['SolrQuery', 'field'=>'string', 'order'=>'string'], -'SolrDisMaxQuery::addFacetDateField' => ['SolrQuery', 'dateField'=>'string'], -'SolrDisMaxQuery::addFacetDateOther' => ['SolrQuery', 'value'=>'string', 'field_override'=>'string'], -'SolrDisMaxQuery::addFacetField' => ['SolrQuery', 'field'=>'string'], -'SolrDisMaxQuery::addFacetQuery' => ['SolrQuery', 'facetQuery'=>'string'], -'SolrDisMaxQuery::addField' => ['SolrQuery', 'field'=>'string'], -'SolrDisMaxQuery::addFilterQuery' => ['SolrQuery', 'fq'=>'string'], -'SolrDisMaxQuery::addGroupField' => ['SolrQuery', 'value'=>'string'], -'SolrDisMaxQuery::addGroupFunction' => ['SolrQuery', 'value'=>'string'], -'SolrDisMaxQuery::addGroupQuery' => ['SolrQuery', 'value'=>'string'], -'SolrDisMaxQuery::addGroupSortField' => ['SolrQuery', 'field'=>'string', 'order'=>'int'], -'SolrDisMaxQuery::addHighlightField' => ['SolrQuery', 'field'=>'string'], -'SolrDisMaxQuery::addMltField' => ['SolrQuery', 'field'=>'string'], -'SolrDisMaxQuery::addMltQueryField' => ['SolrQuery', 'field'=>'string', 'boost'=>'float'], -'SolrDisMaxQuery::addParam' => ['SolrParams', 'name'=>'string', 'value'=>'string'], -'SolrDisMaxQuery::addPhraseField' => ['SolrDisMaxQuery', 'field'=>'string', 'boost'=>'string', 'slop='=>'string'], -'SolrDisMaxQuery::addQueryField' => ['SolrDisMaxQuery', 'field'=>'string', 'boost='=>'string'], -'SolrDisMaxQuery::addSortField' => ['SolrQuery', 'field'=>'string', 'order='=>'int'], -'SolrDisMaxQuery::addStatsFacet' => ['SolrQuery', 'field'=>'string'], -'SolrDisMaxQuery::addStatsField' => ['SolrQuery', 'field'=>'string'], -'SolrDisMaxQuery::addTrigramPhraseField' => ['SolrDisMaxQuery', 'field'=>'string', 'boost'=>'string', 'slop='=>'string'], -'SolrDisMaxQuery::addUserField' => ['SolrDisMaxQuery', 'field'=>'string'], -'SolrDisMaxQuery::collapse' => ['SolrQuery', 'collapseFunction'=>'SolrCollapseFunction'], -'SolrDisMaxQuery::get' => ['mixed', 'param_name'=>'string'], -'SolrDisMaxQuery::getExpand' => ['bool'], -'SolrDisMaxQuery::getExpandFilterQueries' => ['array'], -'SolrDisMaxQuery::getExpandQuery' => ['array'], -'SolrDisMaxQuery::getExpandRows' => ['int'], -'SolrDisMaxQuery::getExpandSortFields' => ['array'], -'SolrDisMaxQuery::getFacet' => ['bool'], -'SolrDisMaxQuery::getFacetDateEnd' => ['string', 'field_override'=>'string'], -'SolrDisMaxQuery::getFacetDateFields' => ['array'], -'SolrDisMaxQuery::getFacetDateGap' => ['string', 'field_override'=>'string'], -'SolrDisMaxQuery::getFacetDateHardEnd' => ['string', 'field_override'=>'string'], -'SolrDisMaxQuery::getFacetDateOther' => ['string', 'field_override'=>'string'], -'SolrDisMaxQuery::getFacetDateStart' => ['string', 'field_override'=>'string'], -'SolrDisMaxQuery::getFacetFields' => ['array'], -'SolrDisMaxQuery::getFacetLimit' => ['int', 'field_override'=>'string'], -'SolrDisMaxQuery::getFacetMethod' => ['string', 'field_override'=>'string'], -'SolrDisMaxQuery::getFacetMinCount' => ['int', 'field_override'=>'string'], -'SolrDisMaxQuery::getFacetMissing' => ['string', 'field_override'=>'string'], -'SolrDisMaxQuery::getFacetOffset' => ['int', 'field_override'=>'string'], -'SolrDisMaxQuery::getFacetPrefix' => ['string', 'field_override'=>'string'], -'SolrDisMaxQuery::getFacetQueries' => ['string'], -'SolrDisMaxQuery::getFacetSort' => ['int', 'field_override'=>'string'], -'SolrDisMaxQuery::getFields' => ['string'], -'SolrDisMaxQuery::getFilterQueries' => ['string'], -'SolrDisMaxQuery::getGroup' => ['bool'], -'SolrDisMaxQuery::getGroupCachePercent' => ['int'], -'SolrDisMaxQuery::getGroupFacet' => ['bool'], -'SolrDisMaxQuery::getGroupFields' => ['array'], -'SolrDisMaxQuery::getGroupFormat' => ['string'], -'SolrDisMaxQuery::getGroupFunctions' => ['array'], -'SolrDisMaxQuery::getGroupLimit' => ['int'], -'SolrDisMaxQuery::getGroupMain' => ['bool'], -'SolrDisMaxQuery::getGroupNGroups' => ['bool'], -'SolrDisMaxQuery::getGroupOffset' => ['bool'], -'SolrDisMaxQuery::getGroupQueries' => ['array'], -'SolrDisMaxQuery::getGroupSortFields' => ['array'], -'SolrDisMaxQuery::getGroupTruncate' => ['bool'], -'SolrDisMaxQuery::getHighlight' => ['bool'], -'SolrDisMaxQuery::getHighlightAlternateField' => ['string', 'field_override'=>'string'], -'SolrDisMaxQuery::getHighlightFields' => ['array'], -'SolrDisMaxQuery::getHighlightFormatter' => ['string', 'field_override'=>'string'], -'SolrDisMaxQuery::getHighlightFragmenter' => ['string', 'field_override'=>'string'], -'SolrDisMaxQuery::getHighlightFragsize' => ['int', 'field_override'=>'string'], -'SolrDisMaxQuery::getHighlightHighlightMultiTerm' => ['bool'], -'SolrDisMaxQuery::getHighlightMaxAlternateFieldLength' => ['int', 'field_override'=>'string'], -'SolrDisMaxQuery::getHighlightMaxAnalyzedChars' => ['int'], -'SolrDisMaxQuery::getHighlightMergeContiguous' => ['bool', 'field_override'=>'string'], -'SolrDisMaxQuery::getHighlightRegexMaxAnalyzedChars' => ['int'], -'SolrDisMaxQuery::getHighlightRegexPattern' => ['string'], -'SolrDisMaxQuery::getHighlightRegexSlop' => ['float'], -'SolrDisMaxQuery::getHighlightRequireFieldMatch' => ['bool'], -'SolrDisMaxQuery::getHighlightSimplePost' => ['string', 'field_override'=>'string'], -'SolrDisMaxQuery::getHighlightSimplePre' => ['string', 'field_override'=>'string'], -'SolrDisMaxQuery::getHighlightSnippets' => ['int', 'field_override'=>'string'], -'SolrDisMaxQuery::getHighlightUsePhraseHighlighter' => ['bool'], -'SolrDisMaxQuery::getMlt' => ['bool'], -'SolrDisMaxQuery::getMltBoost' => ['bool'], -'SolrDisMaxQuery::getMltCount' => ['int'], -'SolrDisMaxQuery::getMltFields' => ['array'], -'SolrDisMaxQuery::getMltMaxNumQueryTerms' => ['int'], -'SolrDisMaxQuery::getMltMaxNumTokens' => ['int'], -'SolrDisMaxQuery::getMltMaxWordLength' => ['int'], -'SolrDisMaxQuery::getMltMinDocFrequency' => ['int'], -'SolrDisMaxQuery::getMltMinTermFrequency' => ['int'], -'SolrDisMaxQuery::getMltMinWordLength' => ['int'], -'SolrDisMaxQuery::getMltQueryFields' => ['array'], -'SolrDisMaxQuery::getParam' => ['mixed', 'param_name'=>'string'], -'SolrDisMaxQuery::getParams' => ['array'], -'SolrDisMaxQuery::getPreparedParams' => ['array'], -'SolrDisMaxQuery::getQuery' => ['string'], -'SolrDisMaxQuery::getRows' => ['int'], -'SolrDisMaxQuery::getSortFields' => ['array'], -'SolrDisMaxQuery::getStart' => ['int'], -'SolrDisMaxQuery::getStats' => ['bool'], -'SolrDisMaxQuery::getStatsFacets' => ['array'], -'SolrDisMaxQuery::getStatsFields' => ['array'], -'SolrDisMaxQuery::getTerms' => ['bool'], -'SolrDisMaxQuery::getTermsField' => ['string'], -'SolrDisMaxQuery::getTermsIncludeLowerBound' => ['bool'], -'SolrDisMaxQuery::getTermsIncludeUpperBound' => ['bool'], -'SolrDisMaxQuery::getTermsLimit' => ['int'], -'SolrDisMaxQuery::getTermsLowerBound' => ['string'], -'SolrDisMaxQuery::getTermsMaxCount' => ['int'], -'SolrDisMaxQuery::getTermsMinCount' => ['int'], -'SolrDisMaxQuery::getTermsPrefix' => ['string'], -'SolrDisMaxQuery::getTermsReturnRaw' => ['bool'], -'SolrDisMaxQuery::getTermsSort' => ['int'], -'SolrDisMaxQuery::getTermsUpperBound' => ['string'], -'SolrDisMaxQuery::getTimeAllowed' => ['int'], -'SolrDisMaxQuery::removeBigramPhraseField' => ['SolrDisMaxQuery', 'field'=>'string'], -'SolrDisMaxQuery::removeBoostQuery' => ['SolrDisMaxQuery', 'field'=>'string'], -'SolrDisMaxQuery::removeExpandFilterQuery' => ['SolrQuery', 'fq'=>'string'], -'SolrDisMaxQuery::removeExpandSortField' => ['SolrQuery', 'field'=>'string'], -'SolrDisMaxQuery::removeFacetDateField' => ['SolrQuery', 'field'=>'string'], -'SolrDisMaxQuery::removeFacetDateOther' => ['SolrQuery', 'value'=>'string', 'field_override'=>'string'], -'SolrDisMaxQuery::removeFacetField' => ['SolrQuery', 'field'=>'string'], -'SolrDisMaxQuery::removeFacetQuery' => ['SolrQuery', 'value'=>'string'], -'SolrDisMaxQuery::removeField' => ['SolrQuery', 'field'=>'string'], -'SolrDisMaxQuery::removeFilterQuery' => ['SolrQuery', 'fq'=>'string'], -'SolrDisMaxQuery::removeHighlightField' => ['SolrQuery', 'field'=>'string'], -'SolrDisMaxQuery::removeMltField' => ['SolrQuery', 'field'=>'string'], -'SolrDisMaxQuery::removeMltQueryField' => ['SolrQuery', 'queryField'=>'string'], -'SolrDisMaxQuery::removePhraseField' => ['SolrDisMaxQuery', 'field'=>'string'], -'SolrDisMaxQuery::removeQueryField' => ['SolrDisMaxQuery', 'field'=>'string'], -'SolrDisMaxQuery::removeSortField' => ['SolrQuery', 'field'=>'string'], -'SolrDisMaxQuery::removeStatsFacet' => ['SolrQuery', 'value'=>'string'], -'SolrDisMaxQuery::removeStatsField' => ['SolrQuery', 'field'=>'string'], -'SolrDisMaxQuery::removeTrigramPhraseField' => ['SolrDisMaxQuery', 'field'=>'string'], -'SolrDisMaxQuery::removeUserField' => ['SolrDisMaxQuery', 'field'=>'string'], -'SolrDisMaxQuery::serialize' => ['string'], -'SolrDisMaxQuery::set' => ['SolrParams', 'name'=>'string', 'value'=>''], -'SolrDisMaxQuery::setBigramPhraseFields' => ['SolrDisMaxQuery', 'fields'=>'string'], -'SolrDisMaxQuery::setBigramPhraseSlop' => ['SolrDisMaxQuery', 'slop'=>'string'], -'SolrDisMaxQuery::setBoostFunction' => ['SolrDisMaxQuery', 'function'=>'string'], -'SolrDisMaxQuery::setBoostQuery' => ['SolrDisMaxQuery', 'q'=>'string'], -'SolrDisMaxQuery::setEchoHandler' => ['SolrQuery', 'flag'=>'bool'], -'SolrDisMaxQuery::setEchoParams' => ['SolrQuery', 'type'=>'string'], -'SolrDisMaxQuery::setExpand' => ['SolrQuery', 'value'=>'bool'], -'SolrDisMaxQuery::setExpandQuery' => ['SolrQuery', 'q'=>'string'], -'SolrDisMaxQuery::setExpandRows' => ['SolrQuery', 'value'=>'int'], -'SolrDisMaxQuery::setExplainOther' => ['SolrQuery', 'query'=>'string'], -'SolrDisMaxQuery::setFacet' => ['SolrQuery', 'flag'=>'bool'], -'SolrDisMaxQuery::setFacetDateEnd' => ['SolrQuery', 'value'=>'string', 'field_override'=>'string'], -'SolrDisMaxQuery::setFacetDateGap' => ['SolrQuery', 'value'=>'string', 'field_override'=>'string'], -'SolrDisMaxQuery::setFacetDateHardEnd' => ['SolrQuery', 'value'=>'string', 'field_override'=>'string'], -'SolrDisMaxQuery::setFacetDateStart' => ['SolrQuery', 'value'=>'string', 'field_override'=>'string'], -'SolrDisMaxQuery::setFacetEnumCacheMinDefaultFrequency' => ['SolrQuery', 'frequency'=>'int', 'field_override'=>'string'], -'SolrDisMaxQuery::setFacetLimit' => ['SolrQuery', 'limit'=>'int', 'field_override'=>'string'], -'SolrDisMaxQuery::setFacetMethod' => ['SolrQuery', 'method'=>'string', 'field_override'=>'string'], -'SolrDisMaxQuery::setFacetMinCount' => ['SolrQuery', 'mincount'=>'int', 'field_override'=>'string'], -'SolrDisMaxQuery::setFacetMissing' => ['SolrQuery', 'flag'=>'bool', 'field_override'=>'string'], -'SolrDisMaxQuery::setFacetOffset' => ['SolrQuery', 'offset'=>'int', 'field_override'=>'string'], -'SolrDisMaxQuery::setFacetPrefix' => ['SolrQuery', 'prefix'=>'string', 'field_override'=>'string'], -'SolrDisMaxQuery::setFacetSort' => ['SolrQuery', 'facetSort'=>'int', 'field_override'=>'string'], -'SolrDisMaxQuery::setGroup' => ['SolrQuery', 'value'=>'bool'], -'SolrDisMaxQuery::setGroupCachePercent' => ['SolrQuery', 'percent'=>'int'], -'SolrDisMaxQuery::setGroupFacet' => ['SolrQuery', 'value'=>'bool'], -'SolrDisMaxQuery::setGroupFormat' => ['SolrQuery', 'value'=>'string'], -'SolrDisMaxQuery::setGroupLimit' => ['SolrQuery', 'value'=>'int'], -'SolrDisMaxQuery::setGroupMain' => ['SolrQuery', 'value'=>'string'], -'SolrDisMaxQuery::setGroupNGroups' => ['SolrQuery', 'value'=>'bool'], -'SolrDisMaxQuery::setGroupOffset' => ['SolrQuery', 'value'=>'int'], -'SolrDisMaxQuery::setGroupTruncate' => ['SolrQuery', 'value'=>'bool'], -'SolrDisMaxQuery::setHighlight' => ['SolrQuery', 'flag'=>'bool'], -'SolrDisMaxQuery::setHighlightAlternateField' => ['SolrQuery', 'field'=>'string', 'field_override'=>'string'], -'SolrDisMaxQuery::setHighlightFormatter' => ['SolrQuery', 'formatter'=>'string', 'field_override'=>'string'], -'SolrDisMaxQuery::setHighlightFragmenter' => ['SolrQuery', 'fragmenter'=>'string', 'field_override'=>'string'], -'SolrDisMaxQuery::setHighlightFragsize' => ['SolrQuery', 'size'=>'int', 'field_override'=>'string'], -'SolrDisMaxQuery::setHighlightHighlightMultiTerm' => ['SolrQuery', 'flag'=>'bool'], -'SolrDisMaxQuery::setHighlightMaxAlternateFieldLength' => ['SolrQuery', 'fieldLength'=>'string', 'field_override'=>'string'], -'SolrDisMaxQuery::setHighlightMaxAnalyzedChars' => ['SolrQuery', 'value'=>'int'], -'SolrDisMaxQuery::setHighlightMergeContiguous' => ['SolrQuery', 'flag'=>'bool', 'field_override'=>'string'], -'SolrDisMaxQuery::setHighlightRegexMaxAnalyzedChars' => ['SolrQuery', 'maxAnalyzedChars'=>'int'], -'SolrDisMaxQuery::setHighlightRegexPattern' => ['SolrQuery', 'value'=>'string'], -'SolrDisMaxQuery::setHighlightRegexSlop' => ['SolrQuery', 'factor'=>'float'], -'SolrDisMaxQuery::setHighlightRequireFieldMatch' => ['SolrQuery', 'flag'=>'bool'], -'SolrDisMaxQuery::setHighlightSimplePost' => ['SolrQuery', 'simplePost'=>'string', 'field_override'=>'string'], -'SolrDisMaxQuery::setHighlightSimplePre' => ['SolrQuery', 'simplePre'=>'string', 'field_override'=>'string'], -'SolrDisMaxQuery::setHighlightSnippets' => ['SolrQuery', 'value'=>'int', 'field_override'=>'string'], -'SolrDisMaxQuery::setHighlightUsePhraseHighlighter' => ['SolrQuery', 'flag'=>'bool'], -'SolrDisMaxQuery::setMinimumMatch' => ['SolrDisMaxQuery', 'value'=>'string'], -'SolrDisMaxQuery::setMlt' => ['SolrQuery', 'flag'=>'bool'], -'SolrDisMaxQuery::setMltBoost' => ['SolrQuery', 'flag'=>'bool'], -'SolrDisMaxQuery::setMltCount' => ['SolrQuery', 'count'=>'int'], -'SolrDisMaxQuery::setMltMaxNumQueryTerms' => ['SolrQuery', 'value'=>'int'], -'SolrDisMaxQuery::setMltMaxNumTokens' => ['SolrQuery', 'value'=>'int'], -'SolrDisMaxQuery::setMltMaxWordLength' => ['SolrQuery', 'maxWordLength'=>'int'], -'SolrDisMaxQuery::setMltMinDocFrequency' => ['SolrQuery', 'minDocFrequency'=>'int'], -'SolrDisMaxQuery::setMltMinTermFrequency' => ['SolrQuery', 'minTermFrequency'=>'int'], -'SolrDisMaxQuery::setMltMinWordLength' => ['SolrQuery', 'minWordLength'=>'int'], -'SolrDisMaxQuery::setOmitHeader' => ['SolrQuery', 'flag'=>'bool'], -'SolrDisMaxQuery::setParam' => ['SolrParams', 'name'=>'string', 'value'=>''], -'SolrDisMaxQuery::setPhraseFields' => ['SolrDisMaxQuery', 'fields'=>'string'], -'SolrDisMaxQuery::setPhraseSlop' => ['SolrDisMaxQuery', 'slop'=>'string'], -'SolrDisMaxQuery::setQuery' => ['SolrQuery', 'query'=>'string'], -'SolrDisMaxQuery::setQueryAlt' => ['SolrDisMaxQuery', 'q'=>'string'], -'SolrDisMaxQuery::setQueryPhraseSlop' => ['SolrDisMaxQuery', 'slop'=>'string'], -'SolrDisMaxQuery::setRows' => ['SolrQuery', 'rows'=>'int'], -'SolrDisMaxQuery::setShowDebugInfo' => ['SolrQuery', 'flag'=>'bool'], -'SolrDisMaxQuery::setStart' => ['SolrQuery', 'start'=>'int'], -'SolrDisMaxQuery::setStats' => ['SolrQuery', 'flag'=>'bool'], -'SolrDisMaxQuery::setTerms' => ['SolrQuery', 'flag'=>'bool'], -'SolrDisMaxQuery::setTermsField' => ['SolrQuery', 'fieldname'=>'string'], -'SolrDisMaxQuery::setTermsIncludeLowerBound' => ['SolrQuery', 'flag'=>'bool'], -'SolrDisMaxQuery::setTermsIncludeUpperBound' => ['SolrQuery', 'flag'=>'bool'], -'SolrDisMaxQuery::setTermsLimit' => ['SolrQuery', 'limit'=>'int'], -'SolrDisMaxQuery::setTermsLowerBound' => ['SolrQuery', 'lowerBound'=>'string'], -'SolrDisMaxQuery::setTermsMaxCount' => ['SolrQuery', 'frequency'=>'int'], -'SolrDisMaxQuery::setTermsMinCount' => ['SolrQuery', 'frequency'=>'int'], -'SolrDisMaxQuery::setTermsPrefix' => ['SolrQuery', 'prefix'=>'string'], -'SolrDisMaxQuery::setTermsReturnRaw' => ['SolrQuery', 'flag'=>'bool'], -'SolrDisMaxQuery::setTermsSort' => ['SolrQuery', 'sortType'=>'int'], -'SolrDisMaxQuery::setTermsUpperBound' => ['SolrQuery', 'upperBound'=>'string'], -'SolrDisMaxQuery::setTieBreaker' => ['SolrDisMaxQuery', 'tieBreaker'=>'string'], -'SolrDisMaxQuery::setTimeAllowed' => ['SolrQuery', 'timeAllowed'=>'int'], -'SolrDisMaxQuery::setTrigramPhraseFields' => ['SolrDisMaxQuery', 'fields'=>'string'], -'SolrDisMaxQuery::setTrigramPhraseSlop' => ['SolrDisMaxQuery', 'slop'=>'string'], -'SolrDisMaxQuery::setUserFields' => ['SolrDisMaxQuery', 'fields'=>'string'], -'SolrDisMaxQuery::toString' => ['string', 'url_encode='=>'bool|false'], -'SolrDisMaxQuery::unserialize' => ['void', 'serialized'=>'string'], -'SolrDisMaxQuery::useDisMaxQueryParser' => ['SolrDisMaxQuery'], -'SolrDisMaxQuery::useEDisMaxQueryParser' => ['SolrDisMaxQuery'], -'SolrDocument::__clone' => ['void'], -'SolrDocument::__construct' => ['void'], -'SolrDocument::__destruct' => [''], -'SolrDocument::__get' => ['SolrDocumentField', 'fieldname'=>'string'], -'SolrDocument::__isset' => ['bool', 'fieldname'=>'string'], -'SolrDocument::__set' => ['bool', 'fieldname'=>'string', 'fieldvalue'=>'string'], -'SolrDocument::__unset' => ['bool', 'fieldname'=>'string'], -'SolrDocument::addField' => ['bool', 'fieldname'=>'string', 'fieldvalue'=>'string'], -'SolrDocument::clear' => ['bool'], -'SolrDocument::current' => ['SolrDocumentField'], -'SolrDocument::deleteField' => ['bool', 'fieldname'=>'string'], -'SolrDocument::fieldExists' => ['bool', 'fieldname'=>'string'], -'SolrDocument::getChildDocuments' => ['array'], -'SolrDocument::getChildDocumentsCount' => ['int'], -'SolrDocument::getField' => ['SolrDocumentField', 'fieldname'=>'string'], -'SolrDocument::getFieldCount' => ['int'], -'SolrDocument::getFieldNames' => ['array'], -'SolrDocument::getInputDocument' => ['SolrInputDocument'], -'SolrDocument::hasChildDocuments' => ['bool'], -'SolrDocument::key' => ['string'], -'SolrDocument::merge' => ['bool', 'sourcedoc'=>'solrdocument', 'overwrite='=>'bool'], -'SolrDocument::next' => ['void'], -'SolrDocument::offsetExists' => ['bool', 'fieldname'=>'string'], -'SolrDocument::offsetGet' => ['SolrDocumentField', 'fieldname'=>'string'], -'SolrDocument::offsetSet' => ['void', 'fieldname'=>'string', 'fieldvalue'=>'string'], -'SolrDocument::offsetUnset' => ['void', 'fieldname'=>'string'], -'SolrDocument::reset' => ['bool'], -'SolrDocument::rewind' => ['void'], -'SolrDocument::serialize' => ['string'], -'SolrDocument::sort' => ['bool', 'sortorderby'=>'int', 'sortdirection='=>'int'], -'SolrDocument::toArray' => ['array'], -'SolrDocument::unserialize' => ['void', 'serialized'=>'string'], -'SolrDocument::valid' => ['bool'], -'SolrDocumentField::__construct' => ['void'], -'SolrDocumentField::__destruct' => [''], -'SolrException::__clone' => ['void'], -'SolrException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'(?Exception)|(?Throwable)'], -'SolrException::__toString' => ['string'], -'SolrException::__wakeup' => ['void'], -'SolrException::getCode' => ['int'], -'SolrException::getFile' => ['string'], -'SolrException::getInternalInfo' => ['array'], -'SolrException::getLine' => ['int'], -'SolrException::getMessage' => ['string'], -'SolrException::getPrevious' => ['Exception|Throwable'], -'SolrException::getTrace' => ['array'], -'SolrException::getTraceAsString' => ['string'], -'SolrGenericResponse::__construct' => ['void'], -'SolrGenericResponse::__destruct' => [''], -'SolrGenericResponse::getDigestedResponse' => ['string'], -'SolrGenericResponse::getHttpStatus' => ['int'], -'SolrGenericResponse::getHttpStatusMessage' => ['string'], -'SolrGenericResponse::getRawRequest' => ['string'], -'SolrGenericResponse::getRawRequestHeaders' => ['string'], -'SolrGenericResponse::getRawResponse' => ['string'], -'SolrGenericResponse::getRawResponseHeaders' => ['string'], -'SolrGenericResponse::getRequestUrl' => ['string'], -'SolrGenericResponse::getResponse' => ['SolrObject'], -'SolrGenericResponse::setParseMode' => ['bool', 'parser_mode='=>'int'], -'SolrGenericResponse::success' => ['bool'], -'SolrIllegalArgumentException::__clone' => ['void'], -'SolrIllegalArgumentException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'(?Exception)|(?Throwable)'], -'SolrIllegalArgumentException::__toString' => ['string'], -'SolrIllegalArgumentException::__wakeup' => ['void'], -'SolrIllegalArgumentException::getCode' => ['int'], -'SolrIllegalArgumentException::getFile' => ['string'], -'SolrIllegalArgumentException::getInternalInfo' => ['array'], -'SolrIllegalArgumentException::getLine' => ['int'], -'SolrIllegalArgumentException::getMessage' => ['string'], -'SolrIllegalArgumentException::getPrevious' => ['Exception|Throwable'], -'SolrIllegalArgumentException::getTrace' => ['array'], -'SolrIllegalArgumentException::getTraceAsString' => ['string'], -'SolrIllegalOperationException::__clone' => ['void'], -'SolrIllegalOperationException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'(?Exception)|(?Throwable)'], -'SolrIllegalOperationException::__toString' => ['string'], -'SolrIllegalOperationException::__wakeup' => ['void'], -'SolrIllegalOperationException::getCode' => ['int'], -'SolrIllegalOperationException::getFile' => ['string'], -'SolrIllegalOperationException::getInternalInfo' => ['array'], -'SolrIllegalOperationException::getLine' => ['int'], -'SolrIllegalOperationException::getMessage' => ['string'], -'SolrIllegalOperationException::getPrevious' => ['Exception|Throwable'], -'SolrIllegalOperationException::getTrace' => ['array'], -'SolrIllegalOperationException::getTraceAsString' => ['string'], -'SolrInputDocument::__clone' => ['void'], -'SolrInputDocument::__construct' => ['void'], -'SolrInputDocument::__destruct' => [''], -'SolrInputDocument::addChildDocument' => ['void', 'child'=>'SolrInputDocument'], -'SolrInputDocument::addChildDocuments' => ['void', 'docs'=>'array'], -'SolrInputDocument::addField' => ['bool', 'fieldname'=>'string', 'fieldvalue'=>'string', 'fieldboostvalue='=>'float'], -'SolrInputDocument::clear' => ['bool'], -'SolrInputDocument::deleteField' => ['bool', 'fieldname'=>'string'], -'SolrInputDocument::fieldExists' => ['bool', 'fieldname'=>'string'], -'SolrInputDocument::getBoost' => ['float'], -'SolrInputDocument::getChildDocuments' => ['array'], -'SolrInputDocument::getChildDocumentsCount' => ['int'], -'SolrInputDocument::getField' => ['SolrDocumentField', 'fieldname'=>'string'], -'SolrInputDocument::getFieldBoost' => ['float', 'fieldname'=>'string'], -'SolrInputDocument::getFieldCount' => ['int'], -'SolrInputDocument::getFieldNames' => ['array'], -'SolrInputDocument::hasChildDocuments' => ['bool'], -'SolrInputDocument::merge' => ['bool', 'sourcedoc'=>'solrinputdocument', 'overwrite='=>'bool'], -'SolrInputDocument::reset' => ['bool'], -'SolrInputDocument::setBoost' => ['bool', 'documentboostvalue'=>'float'], -'SolrInputDocument::setFieldBoost' => ['bool', 'fieldname'=>'string', 'fieldboostvalue'=>'float'], -'SolrInputDocument::sort' => ['bool', 'sortorderby'=>'int', 'sortdirection='=>'int'], -'SolrInputDocument::toArray' => ['array'], -'SolrModifiableParams::__construct' => ['void'], -'SolrModifiableParams::__destruct' => [''], -'SolrModifiableParams::add' => ['SolrParams', 'name'=>'string', 'value'=>'string'], -'SolrModifiableParams::addParam' => ['SolrParams', 'name'=>'string', 'value'=>'string'], -'SolrModifiableParams::get' => ['mixed', 'param_name'=>'string'], -'SolrModifiableParams::getParam' => ['mixed', 'param_name'=>'string'], -'SolrModifiableParams::getParams' => ['array'], -'SolrModifiableParams::getPreparedParams' => ['array'], -'SolrModifiableParams::serialize' => ['string'], -'SolrModifiableParams::set' => ['SolrParams', 'name'=>'string', 'value'=>''], -'SolrModifiableParams::setParam' => ['SolrParams', 'name'=>'string', 'value'=>''], -'SolrModifiableParams::toString' => ['string', 'url_encode='=>'bool|false'], -'SolrModifiableParams::unserialize' => ['void', 'serialized'=>'string'], -'SolrObject::__construct' => ['void'], -'SolrObject::__destruct' => [''], -'SolrObject::getPropertyNames' => ['array'], -'SolrObject::offsetExists' => ['bool', 'property_name'=>'string'], -'SolrObject::offsetGet' => ['mixed', 'property_name'=>'string'], -'SolrObject::offsetSet' => ['void', 'property_name'=>'string', 'property_value'=>'string'], -'SolrObject::offsetUnset' => ['void', 'property_name'=>'string'], -'SolrParams::__construct' => ['void'], -'SolrParams::add' => ['SolrParams', 'name'=>'string', 'value'=>'string'], -'SolrParams::addParam' => ['SolrParams', 'name'=>'string', 'value'=>'string'], -'SolrParams::get' => ['mixed', 'param_name'=>'string'], -'SolrParams::getParam' => ['mixed', 'param_name='=>'string'], -'SolrParams::getParams' => ['array'], -'SolrParams::getPreparedParams' => ['array'], -'SolrParams::serialize' => ['string'], -'SolrParams::set' => ['void', 'name'=>'string', 'value'=>'string'], -'SolrParams::setParam' => ['SolrParams', 'name'=>'string', 'value'=>'string'], -'SolrParams::toString' => ['string', 'url_encode='=>'bool'], -'SolrParams::unserialize' => ['void', 'serialized'=>'string'], -'SolrPingResponse::__construct' => ['void'], -'SolrPingResponse::__destruct' => [''], -'SolrPingResponse::getDigestedResponse' => ['string'], -'SolrPingResponse::getHttpStatus' => ['int'], -'SolrPingResponse::getHttpStatusMessage' => ['string'], -'SolrPingResponse::getRawRequest' => ['string'], -'SolrPingResponse::getRawRequestHeaders' => ['string'], -'SolrPingResponse::getRawResponse' => ['string'], -'SolrPingResponse::getRawResponseHeaders' => ['string'], -'SolrPingResponse::getRequestUrl' => ['string'], -'SolrPingResponse::getResponse' => ['string'], -'SolrPingResponse::setParseMode' => ['bool', 'parser_mode='=>'int'], -'SolrPingResponse::success' => ['bool'], -'SolrQuery::__construct' => ['void', 'q='=>'string'], -'SolrQuery::__destruct' => [''], -'SolrQuery::add' => ['SolrParams', 'name'=>'string', 'value'=>'string'], -'SolrQuery::addExpandFilterQuery' => ['SolrQuery', 'fq'=>'string'], -'SolrQuery::addExpandSortField' => ['SolrQuery', 'field'=>'string', 'order='=>'string'], -'SolrQuery::addFacetDateField' => ['SolrQuery', 'datefield'=>'string'], -'SolrQuery::addFacetDateOther' => ['SolrQuery', 'value'=>'string', 'field_override='=>'string'], -'SolrQuery::addFacetField' => ['SolrQuery', 'field'=>'string'], -'SolrQuery::addFacetQuery' => ['SolrQuery', 'facetquery'=>'string'], -'SolrQuery::addField' => ['SolrQuery', 'field'=>'string'], -'SolrQuery::addFilterQuery' => ['SolrQuery', 'fq'=>'string'], -'SolrQuery::addGroupField' => ['SolrQuery', 'value'=>'string'], -'SolrQuery::addGroupFunction' => ['SolrQuery', 'value'=>'string'], -'SolrQuery::addGroupQuery' => ['SolrQuery', 'value'=>'string'], -'SolrQuery::addGroupSortField' => ['SolrQuery', 'field'=>'string', 'order='=>'int'], -'SolrQuery::addHighlightField' => ['SolrQuery', 'field'=>'string'], -'SolrQuery::addMltField' => ['SolrQuery', 'field'=>'string'], -'SolrQuery::addMltQueryField' => ['SolrQuery', 'field'=>'string', 'boost'=>'float'], -'SolrQuery::addParam' => ['SolrParams', 'name'=>'string', 'value'=>'string'], -'SolrQuery::addSortField' => ['SolrQuery', 'field'=>'string', 'order='=>'int'], -'SolrQuery::addStatsFacet' => ['SolrQuery', 'field'=>'string'], -'SolrQuery::addStatsField' => ['SolrQuery', 'field'=>'string'], -'SolrQuery::collapse' => ['SolrQuery', 'collapseFunction'=>'SolrCollapseFunction'], -'SolrQuery::get' => ['mixed', 'param_name'=>'string'], -'SolrQuery::getExpand' => ['bool'], -'SolrQuery::getExpandFilterQueries' => ['array'], -'SolrQuery::getExpandQuery' => ['array'], -'SolrQuery::getExpandRows' => ['int'], -'SolrQuery::getExpandSortFields' => ['array'], -'SolrQuery::getFacet' => ['bool'], -'SolrQuery::getFacetDateEnd' => ['string', 'field_override='=>'string'], -'SolrQuery::getFacetDateFields' => ['array'], -'SolrQuery::getFacetDateGap' => ['string', 'field_override='=>'string'], -'SolrQuery::getFacetDateHardEnd' => ['string', 'field_override='=>'string'], -'SolrQuery::getFacetDateOther' => ['array', 'field_override='=>'string'], -'SolrQuery::getFacetDateStart' => ['string', 'field_override='=>'string'], -'SolrQuery::getFacetFields' => ['array'], -'SolrQuery::getFacetLimit' => ['int', 'field_override='=>'string'], -'SolrQuery::getFacetMethod' => ['string', 'field_override='=>'string'], -'SolrQuery::getFacetMinCount' => ['int', 'field_override='=>'string'], -'SolrQuery::getFacetMissing' => ['bool', 'field_override='=>'string'], -'SolrQuery::getFacetOffset' => ['int', 'field_override='=>'string'], -'SolrQuery::getFacetPrefix' => ['string', 'field_override='=>'string'], -'SolrQuery::getFacetQueries' => ['array'], -'SolrQuery::getFacetSort' => ['int', 'field_override='=>'string'], -'SolrQuery::getFields' => ['array'], -'SolrQuery::getFilterQueries' => ['array'], -'SolrQuery::getGroup' => ['bool'], -'SolrQuery::getGroupCachePercent' => ['int'], -'SolrQuery::getGroupFacet' => ['bool'], -'SolrQuery::getGroupFields' => ['array'], -'SolrQuery::getGroupFormat' => ['string'], -'SolrQuery::getGroupFunctions' => ['array'], -'SolrQuery::getGroupLimit' => ['int'], -'SolrQuery::getGroupMain' => ['bool'], -'SolrQuery::getGroupNGroups' => ['bool'], -'SolrQuery::getGroupOffset' => ['int'], -'SolrQuery::getGroupQueries' => ['array'], -'SolrQuery::getGroupSortFields' => ['array'], -'SolrQuery::getGroupTruncate' => ['bool'], -'SolrQuery::getHighlight' => ['bool'], -'SolrQuery::getHighlightAlternateField' => ['string', 'field_override='=>'string'], -'SolrQuery::getHighlightFields' => ['array'], -'SolrQuery::getHighlightFormatter' => ['string', 'field_override='=>'string'], -'SolrQuery::getHighlightFragmenter' => ['string', 'field_override='=>'string'], -'SolrQuery::getHighlightFragsize' => ['int', 'field_override='=>'string'], -'SolrQuery::getHighlightHighlightMultiTerm' => ['bool'], -'SolrQuery::getHighlightMaxAlternateFieldLength' => ['int', 'field_override='=>'string'], -'SolrQuery::getHighlightMaxAnalyzedChars' => ['int'], -'SolrQuery::getHighlightMergeContiguous' => ['bool', 'field_override='=>'string'], -'SolrQuery::getHighlightRegexMaxAnalyzedChars' => ['int'], -'SolrQuery::getHighlightRegexPattern' => ['string'], -'SolrQuery::getHighlightRegexSlop' => ['float'], -'SolrQuery::getHighlightRequireFieldMatch' => ['bool'], -'SolrQuery::getHighlightSimplePost' => ['string', 'field_override='=>'string'], -'SolrQuery::getHighlightSimplePre' => ['string', 'field_override='=>'string'], -'SolrQuery::getHighlightSnippets' => ['int', 'field_override='=>'string'], -'SolrQuery::getHighlightUsePhraseHighlighter' => ['bool'], -'SolrQuery::getMlt' => ['bool'], -'SolrQuery::getMltBoost' => ['bool'], -'SolrQuery::getMltCount' => ['int'], -'SolrQuery::getMltFields' => ['array'], -'SolrQuery::getMltMaxNumQueryTerms' => ['int'], -'SolrQuery::getMltMaxNumTokens' => ['int'], -'SolrQuery::getMltMaxWordLength' => ['int'], -'SolrQuery::getMltMinDocFrequency' => ['int'], -'SolrQuery::getMltMinTermFrequency' => ['int'], -'SolrQuery::getMltMinWordLength' => ['int'], -'SolrQuery::getMltQueryFields' => ['array'], -'SolrQuery::getParam' => ['mixed', 'param_name'=>'string'], -'SolrQuery::getParams' => ['array'], -'SolrQuery::getPreparedParams' => ['array'], -'SolrQuery::getQuery' => ['string'], -'SolrQuery::getRows' => ['int'], -'SolrQuery::getSortFields' => ['array'], -'SolrQuery::getStart' => ['int'], -'SolrQuery::getStats' => ['bool'], -'SolrQuery::getStatsFacets' => ['array'], -'SolrQuery::getStatsFields' => ['array'], -'SolrQuery::getTerms' => ['bool'], -'SolrQuery::getTermsField' => ['string'], -'SolrQuery::getTermsIncludeLowerBound' => ['bool'], -'SolrQuery::getTermsIncludeUpperBound' => ['bool'], -'SolrQuery::getTermsLimit' => ['int'], -'SolrQuery::getTermsLowerBound' => ['string'], -'SolrQuery::getTermsMaxCount' => ['int'], -'SolrQuery::getTermsMinCount' => ['int'], -'SolrQuery::getTermsPrefix' => ['string'], -'SolrQuery::getTermsReturnRaw' => ['bool'], -'SolrQuery::getTermsSort' => ['int'], -'SolrQuery::getTermsUpperBound' => ['string'], -'SolrQuery::getTimeAllowed' => ['int'], -'SolrQuery::removeExpandFilterQuery' => ['SolrQuery', 'fq'=>'string'], -'SolrQuery::removeExpandSortField' => ['SolrQuery', 'field'=>'string'], -'SolrQuery::removeFacetDateField' => ['SolrQuery', 'field'=>'string'], -'SolrQuery::removeFacetDateOther' => ['SolrQuery', 'value'=>'string', 'field_override='=>'string'], -'SolrQuery::removeFacetField' => ['SolrQuery', 'field'=>'string'], -'SolrQuery::removeFacetQuery' => ['SolrQuery', 'value'=>'string'], -'SolrQuery::removeField' => ['SolrQuery', 'field'=>'string'], -'SolrQuery::removeFilterQuery' => ['SolrQuery', 'fq'=>'string'], -'SolrQuery::removeHighlightField' => ['SolrQuery', 'field'=>'string'], -'SolrQuery::removeMltField' => ['SolrQuery', 'field'=>'string'], -'SolrQuery::removeMltQueryField' => ['SolrQuery', 'queryfield'=>'string'], -'SolrQuery::removeSortField' => ['SolrQuery', 'field'=>'string'], -'SolrQuery::removeStatsFacet' => ['SolrQuery', 'value'=>'string'], -'SolrQuery::removeStatsField' => ['SolrQuery', 'field'=>'string'], -'SolrQuery::serialize' => ['string'], -'SolrQuery::set' => ['SolrParams', 'name'=>'string', 'value'=>''], -'SolrQuery::setEchoHandler' => ['SolrQuery', 'flag'=>'bool'], -'SolrQuery::setEchoParams' => ['SolrQuery', 'type'=>'string'], -'SolrQuery::setExpand' => ['SolrQuery', 'value'=>'bool'], -'SolrQuery::setExpandQuery' => ['SolrQuery', 'q'=>'string'], -'SolrQuery::setExpandRows' => ['SolrQuery', 'value'=>'int'], -'SolrQuery::setExplainOther' => ['SolrQuery', 'query'=>'string'], -'SolrQuery::setFacet' => ['SolrQuery', 'flag'=>'bool'], -'SolrQuery::setFacetDateEnd' => ['SolrQuery', 'value'=>'string', 'field_override='=>'string'], -'SolrQuery::setFacetDateGap' => ['SolrQuery', 'value'=>'string', 'field_override='=>'string'], -'SolrQuery::setFacetDateHardEnd' => ['SolrQuery', 'value'=>'bool', 'field_override='=>'string'], -'SolrQuery::setFacetDateStart' => ['SolrQuery', 'value'=>'string', 'field_override='=>'string'], -'SolrQuery::setFacetEnumCacheMinDefaultFrequency' => ['SolrQuery', 'frequency'=>'int', 'field_override='=>'string'], -'SolrQuery::setFacetLimit' => ['SolrQuery', 'limit'=>'int', 'field_override='=>'string'], -'SolrQuery::setFacetMethod' => ['SolrQuery', 'method'=>'string', 'field_override='=>'string'], -'SolrQuery::setFacetMinCount' => ['SolrQuery', 'mincount'=>'int', 'field_override='=>'string'], -'SolrQuery::setFacetMissing' => ['SolrQuery', 'flag'=>'bool', 'field_override='=>'string'], -'SolrQuery::setFacetOffset' => ['SolrQuery', 'offset'=>'int', 'field_override='=>'string'], -'SolrQuery::setFacetPrefix' => ['SolrQuery', 'prefix'=>'string', 'field_override='=>'string'], -'SolrQuery::setFacetSort' => ['SolrQuery', 'facetsort'=>'int', 'field_override='=>'string'], -'SolrQuery::setGroup' => ['SolrQuery', 'value'=>'bool'], -'SolrQuery::setGroupCachePercent' => ['SolrQuery', 'percent'=>'int'], -'SolrQuery::setGroupFacet' => ['SolrQuery', 'value'=>'bool'], -'SolrQuery::setGroupFormat' => ['SolrQuery', 'value'=>'string'], -'SolrQuery::setGroupLimit' => ['SolrQuery', 'value'=>'int'], -'SolrQuery::setGroupMain' => ['SolrQuery', 'value'=>'string'], -'SolrQuery::setGroupNGroups' => ['SolrQuery', 'value'=>'bool'], -'SolrQuery::setGroupOffset' => ['SolrQuery', 'value'=>'int'], -'SolrQuery::setGroupTruncate' => ['SolrQuery', 'value'=>'bool'], -'SolrQuery::setHighlight' => ['SolrQuery', 'flag'=>'bool'], -'SolrQuery::setHighlightAlternateField' => ['SolrQuery', 'field'=>'string', 'field_override='=>'string'], -'SolrQuery::setHighlightFormatter' => ['SolrQuery', 'formatter'=>'string', 'field_override='=>'string'], -'SolrQuery::setHighlightFragmenter' => ['SolrQuery', 'fragmenter'=>'string', 'field_override='=>'string'], -'SolrQuery::setHighlightFragsize' => ['SolrQuery', 'size'=>'int', 'field_override='=>'string'], -'SolrQuery::setHighlightHighlightMultiTerm' => ['SolrQuery', 'flag'=>'bool'], -'SolrQuery::setHighlightMaxAlternateFieldLength' => ['SolrQuery', 'fieldlength'=>'int', 'field_override='=>'string'], -'SolrQuery::setHighlightMaxAnalyzedChars' => ['SolrQuery', 'value'=>'int'], -'SolrQuery::setHighlightMergeContiguous' => ['SolrQuery', 'flag'=>'bool', 'field_override='=>'string'], -'SolrQuery::setHighlightRegexMaxAnalyzedChars' => ['SolrQuery', 'maxanalyzedchars'=>'int'], -'SolrQuery::setHighlightRegexPattern' => ['SolrQuery', 'value'=>'string'], -'SolrQuery::setHighlightRegexSlop' => ['SolrQuery', 'factor'=>'float'], -'SolrQuery::setHighlightRequireFieldMatch' => ['SolrQuery', 'flag'=>'bool'], -'SolrQuery::setHighlightSimplePost' => ['SolrQuery', 'simplepost'=>'string', 'field_override='=>'string'], -'SolrQuery::setHighlightSimplePre' => ['SolrQuery', 'simplepre'=>'string', 'field_override='=>'string'], -'SolrQuery::setHighlightSnippets' => ['SolrQuery', 'value'=>'int', 'field_override='=>'string'], -'SolrQuery::setHighlightUsePhraseHighlighter' => ['SolrQuery', 'flag'=>'bool'], -'SolrQuery::setMlt' => ['SolrQuery', 'flag'=>'bool'], -'SolrQuery::setMltBoost' => ['SolrQuery', 'flag'=>'bool'], -'SolrQuery::setMltCount' => ['SolrQuery', 'count'=>'int'], -'SolrQuery::setMltMaxNumQueryTerms' => ['SolrQuery', 'value'=>'int'], -'SolrQuery::setMltMaxNumTokens' => ['SolrQuery', 'value'=>'int'], -'SolrQuery::setMltMaxWordLength' => ['SolrQuery', 'maxwordlength'=>'int'], -'SolrQuery::setMltMinDocFrequency' => ['SolrQuery', 'mindocfrequency'=>'int'], -'SolrQuery::setMltMinTermFrequency' => ['SolrQuery', 'mintermfrequency'=>'int'], -'SolrQuery::setMltMinWordLength' => ['SolrQuery', 'minwordlength'=>'int'], -'SolrQuery::setOmitHeader' => ['SolrQuery', 'flag'=>'bool'], -'SolrQuery::setParam' => ['SolrParams', 'name'=>'string', 'value'=>''], -'SolrQuery::setQuery' => ['SolrQuery', 'query'=>'string'], -'SolrQuery::setRows' => ['SolrQuery', 'rows'=>'int'], -'SolrQuery::setShowDebugInfo' => ['SolrQuery', 'flag'=>'bool'], -'SolrQuery::setStart' => ['SolrQuery', 'start'=>'int'], -'SolrQuery::setStats' => ['SolrQuery', 'flag'=>'bool'], -'SolrQuery::setTerms' => ['SolrQuery', 'flag'=>'bool'], -'SolrQuery::setTermsField' => ['SolrQuery', 'fieldname'=>'string'], -'SolrQuery::setTermsIncludeLowerBound' => ['SolrQuery', 'flag'=>'bool'], -'SolrQuery::setTermsIncludeUpperBound' => ['SolrQuery', 'flag'=>'bool'], -'SolrQuery::setTermsLimit' => ['SolrQuery', 'limit'=>'int'], -'SolrQuery::setTermsLowerBound' => ['SolrQuery', 'lowerbound'=>'string'], -'SolrQuery::setTermsMaxCount' => ['SolrQuery', 'frequency'=>'int'], -'SolrQuery::setTermsMinCount' => ['SolrQuery', 'frequency'=>'int'], -'SolrQuery::setTermsPrefix' => ['SolrQuery', 'prefix'=>'string'], -'SolrQuery::setTermsReturnRaw' => ['SolrQuery', 'flag'=>'bool'], -'SolrQuery::setTermsSort' => ['SolrQuery', 'sorttype'=>'int'], -'SolrQuery::setTermsUpperBound' => ['SolrQuery', 'upperbound'=>'string'], -'SolrQuery::setTimeAllowed' => ['SolrQuery', 'timeallowed'=>'int'], -'SolrQuery::toString' => ['string', 'url_encode='=>'bool|false'], -'SolrQuery::unserialize' => ['void', 'serialized'=>'string'], -'SolrQueryResponse::__construct' => ['void'], -'SolrQueryResponse::__destruct' => [''], -'SolrQueryResponse::getDigestedResponse' => ['string'], -'SolrQueryResponse::getHttpStatus' => ['int'], -'SolrQueryResponse::getHttpStatusMessage' => ['string'], -'SolrQueryResponse::getRawRequest' => ['string'], -'SolrQueryResponse::getRawRequestHeaders' => ['string'], -'SolrQueryResponse::getRawResponse' => ['string'], -'SolrQueryResponse::getRawResponseHeaders' => ['string'], -'SolrQueryResponse::getRequestUrl' => ['string'], -'SolrQueryResponse::getResponse' => ['SolrObject'], -'SolrQueryResponse::setParseMode' => ['bool', 'parser_mode='=>'int'], -'SolrQueryResponse::success' => ['bool'], -'SolrResponse::getDigestedResponse' => ['string'], -'SolrResponse::getHttpStatus' => ['int'], -'SolrResponse::getHttpStatusMessage' => ['string'], -'SolrResponse::getRawRequest' => ['string'], -'SolrResponse::getRawRequestHeaders' => ['string'], -'SolrResponse::getRawResponse' => ['string'], -'SolrResponse::getRawResponseHeaders' => ['string'], -'SolrResponse::getRequestUrl' => ['string'], -'SolrResponse::getResponse' => ['SolrObject'], -'SolrResponse::setParseMode' => ['bool', 'parser_mode='=>'int'], -'SolrResponse::success' => ['bool'], -'SolrServerException::__clone' => ['void'], -'SolrServerException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'(?Exception)|(?Throwable)'], -'SolrServerException::__toString' => ['string'], -'SolrServerException::__wakeup' => ['void'], -'SolrServerException::getCode' => ['int'], -'SolrServerException::getFile' => ['string'], -'SolrServerException::getInternalInfo' => ['array'], -'SolrServerException::getLine' => ['int'], -'SolrServerException::getMessage' => ['string'], -'SolrServerException::getPrevious' => ['Exception|Throwable'], -'SolrServerException::getTrace' => ['array'], -'SolrServerException::getTraceAsString' => ['string'], -'SolrUpdateResponse::__construct' => ['void'], -'SolrUpdateResponse::__destruct' => [''], -'SolrUpdateResponse::getDigestedResponse' => ['string'], -'SolrUpdateResponse::getHttpStatus' => ['int'], -'SolrUpdateResponse::getHttpStatusMessage' => ['string'], -'SolrUpdateResponse::getRawRequest' => ['string'], -'SolrUpdateResponse::getRawRequestHeaders' => ['string'], -'SolrUpdateResponse::getRawResponse' => ['string'], -'SolrUpdateResponse::getRawResponseHeaders' => ['string'], -'SolrUpdateResponse::getRequestUrl' => ['string'], -'SolrUpdateResponse::getResponse' => ['SolrObject'], -'SolrUpdateResponse::setParseMode' => ['bool', 'parser_mode='=>'int'], -'SolrUpdateResponse::success' => ['bool'], -'SolrUtils::digestXmlResponse' => ['SolrObject', 'xmlresponse'=>'string', 'parse_mode='=>'int'], -'SolrUtils::escapeQueryChars' => ['string', 'str'=>'string'], -'SolrUtils::getSolrVersion' => ['string'], -'SolrUtils::queryPhrase' => ['string', 'str'=>'string'], -'sort' => ['bool', '&rw_array_arg'=>'array', 'sort_flags='=>'int'], -'soundex' => ['string', 'str'=>'string'], -'SphinxClient::__construct' => ['void'], -'SphinxClient::addQuery' => ['int', 'query'=>'string', 'index='=>'string', 'comment='=>'string'], -'SphinxClient::buildExcerpts' => ['array', 'docs'=>'array', 'index'=>'string', 'words'=>'string', 'opts='=>'array'], -'SphinxClient::buildKeywords' => ['array', 'query'=>'string', 'index'=>'string', 'hits'=>'bool'], -'SphinxClient::close' => ['bool'], -'SphinxClient::escapeString' => ['string', 'string'=>'string'], -'SphinxClient::getLastError' => ['string'], -'SphinxClient::getLastWarning' => ['string'], -'SphinxClient::open' => ['bool'], -'SphinxClient::query' => ['array', 'query'=>'string', 'index='=>'string', 'comment='=>'string'], -'SphinxClient::resetFilters' => ['void'], -'SphinxClient::resetGroupBy' => ['void'], -'SphinxClient::runQueries' => ['array'], -'SphinxClient::setArrayResult' => ['bool', 'array_result'=>'bool'], -'SphinxClient::setConnectTimeout' => ['bool', 'timeout'=>'float'], -'SphinxClient::setFieldWeights' => ['bool', 'weights'=>'array'], -'SphinxClient::setFilter' => ['bool', 'attribute'=>'string', 'values'=>'array', 'exclude='=>'bool'], -'SphinxClient::setFilterFloatRange' => ['bool', 'attribute'=>'string', 'min'=>'float', 'max'=>'float', 'exclude='=>'bool'], -'SphinxClient::setFilterRange' => ['bool', 'attribute'=>'string', 'min'=>'int', 'max'=>'int', 'exclude='=>'bool'], -'SphinxClient::setGeoAnchor' => ['bool', 'attrlat'=>'string', 'attrlong'=>'string', 'latitude'=>'float', 'longitude'=>'float'], -'SphinxClient::setGroupBy' => ['bool', 'attribute'=>'string', 'func'=>'int', 'groupsort='=>'string'], -'SphinxClient::setGroupDistinct' => ['bool', 'attribute'=>'string'], -'SphinxClient::setIDRange' => ['bool', 'min'=>'int', 'max'=>'int'], -'SphinxClient::setIndexWeights' => ['bool', 'weights'=>'array'], -'SphinxClient::setLimits' => ['bool', 'offset'=>'int', 'limit'=>'int', 'max_matches='=>'int', 'cutoff='=>'int'], -'SphinxClient::setMatchMode' => ['bool', 'mode'=>'int'], -'SphinxClient::setMaxQueryTime' => ['bool', 'qtime'=>'int'], -'SphinxClient::setOverride' => ['bool', 'attribute'=>'string', 'type'=>'int', 'values'=>'array'], -'SphinxClient::setRankingMode' => ['bool', 'ranker'=>'int'], -'SphinxClient::setRetries' => ['bool', 'count'=>'int', 'delay='=>'int'], -'SphinxClient::setSelect' => ['bool', 'clause'=>'string'], -'SphinxClient::setServer' => ['bool', 'server'=>'string', 'port'=>'int'], -'SphinxClient::setSortMode' => ['bool', 'mode'=>'int', 'sortby='=>'string'], -'SphinxClient::status' => ['array'], -'SphinxClient::updateAttributes' => ['int', 'index'=>'string', 'attributes'=>'array', 'values'=>'array', 'mva='=>'bool'], -'spl_autoload' => ['void', 'class_name'=>'string', 'file_extensions='=>'string'], -'spl_autoload_call' => ['void', 'class_name'=>'string'], -'spl_autoload_extensions' => ['string', 'file_extensions='=>'string'], -'spl_autoload_functions' => ['false|array'], -'spl_autoload_register' => ['bool', 'autoload_function='=>'callable(string):void', 'throw='=>'bool', 'prepend='=>'bool'], -'spl_autoload_unregister' => ['bool', 'autoload_function'=>'mixed'], -'spl_classes' => ['array'], -'spl_object_hash' => ['string', 'obj'=>'object'], -'spl_object_id' => ['int', 'obj'=>'object'], -'SplDoublyLinkedList::add' => ['void', 'index'=>'mixed', 'newval'=>'mixed'], -'SplDoublyLinkedList::bottom' => ['mixed'], -'SplDoublyLinkedList::count' => ['int'], -'SplDoublyLinkedList::current' => ['mixed'], -'SplDoublyLinkedList::getIteratorMode' => ['int'], -'SplDoublyLinkedList::isEmpty' => ['bool'], -'SplDoublyLinkedList::key' => ['mixed'], -'SplDoublyLinkedList::next' => ['void'], -'SplDoublyLinkedList::offsetExists' => ['bool', 'index'=>'mixed'], -'SplDoublyLinkedList::offsetGet' => ['mixed', 'index'=>'mixed'], -'SplDoublyLinkedList::offsetSet' => ['void', 'index'=>'mixed', 'newval'=>'mixed'], -'SplDoublyLinkedList::offsetUnset' => ['void', 'index'=>'mixed'], -'SplDoublyLinkedList::pop' => ['mixed'], -'SplDoublyLinkedList::prev' => ['void'], -'SplDoublyLinkedList::push' => ['void', 'value'=>'mixed'], -'SplDoublyLinkedList::rewind' => ['void'], -'SplDoublyLinkedList::serialize' => ['string'], -'SplDoublyLinkedList::setIteratorMode' => ['int', 'flags'=>'int'], -'SplDoublyLinkedList::shift' => ['mixed'], -'SplDoublyLinkedList::top' => ['mixed'], -'SplDoublyLinkedList::unserialize' => ['void', 'serialized'=>'string'], -'SplDoublyLinkedList::unshift' => ['bool', 'value'=>'mixed'], -'SplDoublyLinkedList::valid' => ['bool'], -'SplEnum::__construct' => ['void', 'initial_value='=>'mixed', 'strict='=>'bool|true'], -'SplEnum::getConstList' => ['array', 'include_default='=>'bool'], -'SplFileInfo::__construct' => ['void', 'file_name'=>'string'], -'SplFileInfo::__toString' => ['string'], -'SplFileInfo::getATime' => ['int'], -'SplFileInfo::getBasename' => ['string', 'suffix='=>'string'], -'SplFileInfo::getCTime' => ['int'], -'SplFileInfo::getExtension' => ['string'], -'SplFileInfo::getFileInfo' => ['SplFileInfo', 'class_name='=>'string'], -'SplFileInfo::getFilename' => ['string'], -'SplFileInfo::getGroup' => ['int'], -'SplFileInfo::getInode' => ['int'], -'SplFileInfo::getLinkTarget' => ['string'], -'SplFileInfo::getMTime' => ['int'], -'SplFileInfo::getOwner' => ['int'], -'SplFileInfo::getPath' => ['string'], -'SplFileInfo::getPathInfo' => ['SplFileInfo', 'class_name='=>'string'], -'SplFileInfo::getPathname' => ['string'], -'SplFileInfo::getPerms' => ['int'], -'SplFileInfo::getRealPath' => ['string|false'], -'SplFileInfo::getSize' => ['int'], -'SplFileInfo::getType' => ['string'], -'SplFileInfo::isDir' => ['bool'], -'SplFileInfo::isExecutable' => ['bool'], -'SplFileInfo::isFile' => ['bool'], -'SplFileInfo::isLink' => ['bool'], -'SplFileInfo::isReadable' => ['bool'], -'SplFileInfo::isWritable' => ['bool'], -'SplFileInfo::openFile' => ['SplFileObject', 'mode='=>'string', 'use_include_path='=>'bool', 'context='=>'resource'], -'SplFileInfo::setFileClass' => ['void', 'class_name='=>'string'], -'SplFileInfo::setInfoClass' => ['void', 'class_name='=>'string'], -'SplFileObject::__construct' => ['void', 'filename'=>'string', 'mode='=>'string', 'use_include_path='=>'bool', 'context='=>''], -'SplFileObject::__toString' => ['string'], -'SplFileObject::current' => ['string|array|false'], -'SplFileObject::eof' => ['bool'], -'SplFileObject::fflush' => ['bool'], -'SplFileObject::fgetc' => ['string|false'], -'SplFileObject::fgetcsv' => ['array|false|null', 'delimiter='=>'string', 'enclosure='=>'string', 'escape='=>'string'], -'SplFileObject::fgets' => ['string'], -'SplFileObject::fgetss' => ['string', 'allowable_tags='=>'string'], -'SplFileObject::flock' => ['bool', 'operation'=>'int', '&w_wouldblock='=>'int'], -'SplFileObject::fpassthru' => ['int'], -'SplFileObject::fputcsv' => ['int|false', 'fields'=>'array', 'delimiter='=>'string', 'enclosure='=>'string', 'escape='=>'string'], -'SplFileObject::fread' => ['string|false', 'length'=>'int'], -'SplFileObject::fscanf' => ['bool', 'format'=>'string', '&...w_vars='=>'string|int|float'], -'SplFileObject::fseek' => ['int', 'pos'=>'int', 'whence='=>'int'], -'SplFileObject::fstat' => ['array|false'], -'SplFileObject::ftell' => ['int|false'], -'SplFileObject::ftruncate' => ['bool', 'size'=>'int'], -'SplFileObject::fwrite' => ['int', 'str'=>'string', 'length='=>'int'], -'SplFileObject::getChildren' => ['bool'], -'SplFileObject::getCsvControl' => ['array'], -'SplFileObject::getFlags' => ['int'], -'SplFileObject::getMaxLineLen' => ['int'], -'SplFileObject::hasChildren' => ['bool'], -'SplFileObject::key' => ['int'], -'SplFileObject::next' => ['void'], -'SplFileObject::rewind' => ['void'], -'SplFileObject::seek' => ['void', 'line_pos'=>'int'], -'SplFileObject::setCsvControl' => ['void', 'delimiter='=>'string', 'enclosure='=>'string', 'escape='=>'string'], -'SplFileObject::setFlags' => ['void', 'flags'=>'int'], -'SplFileObject::setMaxLineLen' => ['void', 'max_len'=>'int'], -'SplFileObject::valid' => ['bool'], -'SplFixedArray::__construct' => ['void', 'size='=>'int'], -'SplFixedArray::__wakeup' => ['void'], -'SplFixedArray::count' => ['int'], -'SplFixedArray::current' => ['mixed'], -'SplFixedArray::fromArray' => ['SplFixedArray', 'data'=>'array', 'save_indexes='=>'bool'], -'SplFixedArray::getSize' => ['int'], -'SplFixedArray::key' => ['int'], -'SplFixedArray::next' => ['void'], -'SplFixedArray::offsetExists' => ['bool', 'index'=>'int'], -'SplFixedArray::offsetGet' => ['mixed', 'index'=>'int'], -'SplFixedArray::offsetSet' => ['void', 'index'=>'int', 'newval'=>'mixed'], -'SplFixedArray::offsetUnset' => ['void', 'index'=>'int'], -'SplFixedArray::rewind' => ['void'], -'SplFixedArray::setSize' => ['bool', 'size'=>'int'], -'SplFixedArray::toArray' => ['array'], -'SplFixedArray::valid' => ['bool'], -'SplHeap::compare' => ['int', 'value1'=>'mixed', 'value2'=>'mixed'], -'SplHeap::count' => ['int'], -'SplHeap::current' => ['mixed'], -'SplHeap::extract' => ['mixed'], -'SplHeap::insert' => ['bool', 'value'=>'mixed'], -'SplHeap::isCorrupted' => ['int'], -'SplHeap::isEmpty' => ['bool'], -'SplHeap::key' => ['int'], -'SplHeap::next' => ['void'], -'SplHeap::recoverFromCorruption' => ['int'], -'SplHeap::rewind' => ['void'], -'SplHeap::top' => ['mixed'], -'SplHeap::valid' => ['bool'], -'split' => ['array', 'pattern'=>'string', 'string'=>'string', 'limit='=>'int'], -'spliti' => ['array', 'pattern'=>'string', 'string'=>'string', 'limit='=>'int'], -'SplMaxHeap::compare' => ['int', 'a'=>'mixed', 'b'=>'mixed'], -'SplMinHeap::compare' => ['int', 'a'=>'mixed', 'b'=>'mixed'], -'SplObjectStorage::addAll' => ['void', 'os'=>'splobjectstorage'], -'SplObjectStorage::attach' => ['void', 'obj'=>'object', 'inf='=>'mixed'], -'SplObjectStorage::contains' => ['bool', 'obj'=>'object'], -'SplObjectStorage::count' => ['int'], -'SplObjectStorage::current' => ['object'], -'SplObjectStorage::detach' => ['void', 'obj'=>'object'], -'SplObjectStorage::getHash' => ['string', 'obj'=>'object'], -'SplObjectStorage::getInfo' => ['mixed'], -'SplObjectStorage::key' => ['int'], -'SplObjectStorage::next' => ['void'], -'SplObjectStorage::offsetExists' => ['bool', 'object'=>'object'], -'SplObjectStorage::offsetGet' => ['mixed', 'obj'=>'object'], -'SplObjectStorage::offsetSet' => ['object', 'object'=>'object', 'data='=>'mixed'], -'SplObjectStorage::offsetUnset' => ['object', 'object'=>'object'], -'SplObjectStorage::removeAll' => ['void', 'os'=>'splobjectstorage'], -'SplObjectStorage::removeAllExcept' => ['void', 'os'=>'splobjectstorage'], -'SplObjectStorage::rewind' => ['void'], -'SplObjectStorage::serialize' => ['string'], -'SplObjectStorage::setInfo' => ['void', 'inf'=>'mixed'], -'SplObjectStorage::unserialize' => ['void', 'serialized'=>'string'], -'SplObjectStorage::valid' => ['bool'], -'SplObserver::update' => ['void', 'subject'=>'splsubject'], -'SplPriorityQueue::compare' => ['int', 'a'=>'mixed', 'b'=>'mixed'], -'SplPriorityQueue::count' => ['int'], -'SplPriorityQueue::current' => ['mixed'], -'SplPriorityQueue::extract' => ['mixed'], -'SplPriorityQueue::getExtractFlags' => ['int'], -'SplPriorityQueue::insert' => ['bool', 'value'=>'mixed', 'priority'=>'mixed'], -'SplPriorityQueue::isEmpty' => ['bool'], -'SplPriorityQueue::key' => ['mixed'], -'SplPriorityQueue::next' => ['void'], -'SplPriorityQueue::recoverFromCorruption' => ['void'], -'SplPriorityQueue::rewind' => ['void'], -'SplPriorityQueue::setExtractFlags' => ['void', 'flags'=>'int'], -'SplPriorityQueue::top' => ['mixed'], -'SplPriorityQueue::valid' => ['bool'], -'SplQueue::dequeue' => ['mixed'], -'SplQueue::enqueue' => ['void', 'value'=>'mixed'], -'SplQueue::setIteratorMode' => ['void', 'mode'=>'int'], -'SplStack::setIteratorMode' => ['void', 'mode'=>'int'], -'SplSubject::attach' => ['void', 'observer'=>'splobserver'], -'SplSubject::detach' => ['void', 'observer'=>'splobserver'], -'SplSubject::notify' => ['void'], -'SplTempFileObject::__construct' => ['void', 'max_memory='=>'int'], -'SplType::__construct' => ['void', 'initial_value='=>'mixed', 'strict='=>'bool'], -'Spoofchecker::__construct' => ['void'], -'Spoofchecker::areConfusable' => ['bool', 's1'=>'string', 's2'=>'string', '&w_error='=>'string'], -'Spoofchecker::isSuspicious' => ['bool', 'text'=>'string', '&w_error='=>'string'], -'Spoofchecker::setAllowedLocales' => ['void', 'locale_list'=>'string'], -'Spoofchecker::setChecks' => ['void', 'checks'=>'long'], -'Spoofchecker::setRestrictionLevel' => ['void', 'restriction_level'=>'int'], -'sprintf' => ['string', 'format'=>'string', '...args='=>'string|int|float'], -'sql_regcase' => ['string', 'string'=>'string'], -'SQLite3::__construct' => ['void', 'filename'=>'string', 'flags='=>'int', 'encryption_key='=>'string|null'], -'SQLite3::busyTimeout' => ['bool', 'msecs'=>'int'], -'SQLite3::changes' => ['int'], -'SQLite3::close' => ['bool'], -'SQLite3::createAggregate' => ['bool', 'name'=>'string', 'step_callback'=>'callable', 'final_callback'=>'callable', 'argument_count='=>'int'], -'SQLite3::createCollation' => ['bool', 'name'=>'string', 'callback'=>'callable'], -'SQLite3::createFunction' => ['bool', 'name'=>'string', 'callback'=>'callable', 'argument_count='=>'int', 'flags='=>'int'], -'SQLite3::enableExceptions' => ['bool', 'enableexceptions='=>'bool'], -'SQLite3::escapeString' => ['string', 'value'=>'string'], -'SQLite3::exec' => ['bool', 'query'=>'string'], -'SQLite3::lastErrorCode' => ['int'], -'SQLite3::lastErrorMsg' => ['string'], -'SQLite3::lastInsertRowID' => ['int'], -'SQLite3::loadExtension' => ['bool', 'shared_library'=>'string'], -'SQLite3::open' => ['void', 'filename'=>'string', 'flags='=>'int', 'encryption_key='=>'string|null'], -'SQLite3::openBlob' => ['resource', 'table'=>'string', 'column'=>'string', 'rowid'=>'int', 'dbname'=>'string', 'flags='=>'int'], -'SQLite3::prepare' => ['SQLite3Stmt|false', 'query'=>'string'], -'SQLite3::query' => ['SQLite3Result|false', 'query'=>'string'], -'SQLite3::querySingle' => ['array|int|string|bool|float|null|false', 'query'=>'string', 'entire_row='=>'bool'], -'SQLite3::version' => ['array'], -'SQLite3Result::__construct' => ['void'], -'SQLite3Result::columnName' => ['string', 'column_number'=>'int'], -'SQLite3Result::columnType' => ['int', 'column_number'=>'int'], -'SQLite3Result::fetchArray' => ['array', 'mode='=>'int'], -'SQLite3Result::finalize' => ['bool'], -'SQLite3Result::numColumns' => ['int'], -'SQLite3Result::reset' => ['bool'], -'SQLite3Stmt::__construct' => ['void', 'dbobject'=>'sqlite3', 'statement'=>'string'], -'SQLite3Stmt::bindParam' => ['bool', 'parameter_name_or_number'=>'string|int', '&rw_parameter'=>'mixed', 'type='=>'int'], -'SQLite3Stmt::bindValue' => ['bool', 'parameter_name_or_number'=>'string|int', 'parameter'=>'mixed', 'type='=>'int'], -'SQLite3Stmt::clear' => ['bool'], -'SQLite3Stmt::close' => ['bool'], -'SQLite3Stmt::execute' => ['SQLite3Result'], -'SQLite3Stmt::paramCount' => ['int'], -'SQLite3Stmt::readOnly' => ['bool'], -'SQLite3Stmt::reset' => ['bool'], -'sqlite_array_query' => ['array', 'dbhandle'=>'', 'query'=>'string', 'result_type='=>'int', 'decode_binary='=>'bool'], -'sqlite_busy_timeout' => ['', 'dbhandle'=>'', 'milliseconds'=>'int'], -'sqlite_changes' => ['int', 'dbhandle'=>''], -'sqlite_close' => ['void', 'dbhandle'=>'resource'], -'sqlite_column' => ['', 'result'=>'', 'index_or_name'=>'', 'decode_binary='=>'bool'], -'sqlite_create_aggregate' => ['', 'dbhandle'=>'', 'function_name'=>'string', 'step_func'=>'callable', 'finalize_func'=>'callable', 'num_args='=>'int'], -'sqlite_create_function' => ['', 'dbhandle'=>'', 'function_name'=>'string', 'callback'=>'callable', 'num_args='=>'int'], -'sqlite_current' => ['array', 'result'=>'', 'result_type='=>'int', 'decode_binary='=>'bool'], -'sqlite_error_string' => ['string', 'error_code'=>'int'], -'sqlite_escape_string' => ['string', 'item'=>'string'], -'sqlite_exec' => ['bool', 'dbhandle'=>'', 'query'=>'string', 'error_msg='=>'string'], -'sqlite_factory' => ['SQLiteDatabase', 'filename'=>'string', 'mode='=>'int', 'error_message='=>'string'], -'sqlite_fetch_all' => ['array', 'result'=>'', 'result_type='=>'int', 'decode_binary='=>'bool'], -'sqlite_fetch_array' => ['array', 'result'=>'', 'result_type='=>'int', 'decode_binary='=>'bool'], -'sqlite_fetch_column_types' => ['array', 'table_name'=>'string', 'dbhandle'=>'', 'result_type='=>'int'], -'sqlite_fetch_object' => ['object', 'result'=>'', 'class_name='=>'string', 'ctor_params='=>'array', 'decode_binary='=>'bool'], -'sqlite_fetch_single' => ['string', 'result'=>'', 'decode_binary='=>'bool'], -'sqlite_field_name' => ['string', 'result'=>'', 'field_index'=>'int'], -'sqlite_has_more' => ['bool', 'result'=>'resource'], -'sqlite_has_prev' => ['bool', 'result'=>''], -'sqlite_key' => ['int', 'result'=>''], -'sqlite_last_error' => ['int', 'dbhandle'=>''], -'sqlite_last_insert_rowid' => ['int', 'dbhandle'=>''], -'sqlite_libencoding' => ['string'], -'sqlite_libversion' => ['string'], -'sqlite_next' => ['bool', 'result'=>''], -'sqlite_num_fields' => ['int', 'result'=>''], -'sqlite_num_rows' => ['int', 'result'=>''], -'sqlite_open' => ['resource', 'filename'=>'string', 'mode='=>'int', 'error_message='=>'string'], -'sqlite_popen' => ['resource', 'filename'=>'string', 'mode='=>'int', 'error_message='=>'string'], -'sqlite_prev' => ['bool', 'result'=>''], -'sqlite_query' => ['SQLiteResult', 'dbhandle'=>'', 'query'=>'string', 'result_type='=>'int', 'error_msg='=>'string'], -'sqlite_rewind' => ['bool', 'result'=>''], -'sqlite_seek' => ['bool', 'result'=>'', 'rownum'=>'int'], -'sqlite_single_query' => ['array', 'db'=>'', 'query'=>'string', 'first_row_only='=>'bool', 'decode_binary='=>'bool'], -'sqlite_udf_decode_binary' => ['string', 'data'=>'string'], -'sqlite_udf_encode_binary' => ['string', 'data'=>'string'], -'sqlite_unbuffered_query' => ['SQLiteUnbuffered', 'dbhandle'=>'', 'query'=>'string', 'result_type='=>'int', 'error_msg='=>'string'], -'sqlite_valid' => ['bool', 'result'=>''], -'SQLiteDatabase::arrayQuery' => ['array', 'dbhandle'=>'', 'query'=>'string', 'result_type='=>'int', 'decode_binary='=>'bool'], -'SQLiteDatabase::busyTimeout' => ['', 'dbhandle'=>'', 'milliseconds'=>'int'], -'SQLiteDatabase::changes' => ['int', 'dbhandle'=>''], -'SQLiteDatabase::createAggregate' => ['', 'dbhandle'=>'', 'function_name'=>'string', 'step_func'=>'callable', 'finalize_func'=>'callable', 'num_args='=>'int'], -'SQLiteDatabase::createFunction' => ['', 'dbhandle'=>'', 'function_name'=>'string', 'callback'=>'callable', 'num_args='=>'int'], -'SQLiteDatabase::exec' => ['bool', 'dbhandle'=>'', 'query'=>'string', 'error_msg='=>'string'], -'SQLiteDatabase::fetchColumnTypes' => ['array', 'table_name'=>'string', 'dbhandle'=>'', 'result_type='=>'int'], -'SQLiteDatabase::lastError' => ['int', 'dbhandle'=>''], -'SQLiteDatabase::lastInsertRowid' => ['int', 'dbhandle'=>''], -'SQLiteDatabase::query' => ['SQLiteResult', 'dbhandle'=>'', 'query'=>'string', 'result_type='=>'int', 'error_msg='=>'string'], -'SQLiteDatabase::queryExec' => ['bool', 'query'=>'string', '&w_error_msg='=>'string'], -'SQLiteDatabase::singleQuery' => ['array', 'db'=>'', 'query'=>'string', 'first_row_only='=>'bool', 'decode_binary='=>'bool'], -'SQLiteDatabase::unbufferedQuery' => ['SQLiteUnbuffered', 'dbhandle'=>'', 'query'=>'string', 'result_type='=>'int', 'error_msg='=>'string'], -'SQLiteResult::column' => ['', 'result'=>'', 'index_or_name'=>'', 'decode_binary='=>'bool'], -'SQLiteResult::current' => ['array', 'result'=>'', 'result_type='=>'int', 'decode_binary='=>'bool'], -'SQLiteResult::fetch' => ['array', 'result'=>'', 'result_type='=>'int', 'decode_binary='=>'bool'], -'SQLiteResult::fetchAll' => ['array', 'result'=>'', 'result_type='=>'int', 'decode_binary='=>'bool'], -'SQLiteResult::fetchObject' => ['object', 'result'=>'', 'class_name='=>'string', 'ctor_params='=>'array', 'decode_binary='=>'bool'], -'SQLiteResult::fetchSingle' => ['string', 'result'=>'', 'decode_binary='=>'bool'], -'SQLiteResult::fieldName' => ['string', 'result'=>'', 'field_index'=>'int'], -'SQLiteResult::hasPrev' => ['bool', 'result'=>''], -'SQLiteResult::key' => ['int', 'result'=>''], -'SQLiteResult::next' => ['bool', 'result'=>''], -'SQLiteResult::numFields' => ['int', 'result'=>''], -'SQLiteResult::numRows' => ['int', 'result'=>''], -'SQLiteResult::prev' => ['bool', 'result'=>''], -'SQLiteResult::rewind' => ['bool', 'result'=>''], -'SQLiteResult::seek' => ['bool', 'result'=>'', 'rownum'=>'int'], -'SQLiteResult::valid' => ['bool', 'result'=>''], -'SQLiteUnbuffered::column' => ['', 'result'=>'', 'index_or_name'=>'', 'decode_binary='=>'bool'], -'SQLiteUnbuffered::current' => ['array', 'result'=>'', 'result_type='=>'int', 'decode_binary='=>'bool'], -'SQLiteUnbuffered::fetch' => ['array', 'result'=>'', 'result_type='=>'int', 'decode_binary='=>'bool'], -'SQLiteUnbuffered::fetchAll' => ['array', 'result'=>'', 'result_type='=>'int', 'decode_binary='=>'bool'], -'SQLiteUnbuffered::fetchObject' => ['object', 'result'=>'', 'class_name='=>'string', 'ctor_params='=>'array', 'decode_binary='=>'bool'], -'SQLiteUnbuffered::fetchSingle' => ['string', 'result'=>'', 'decode_binary='=>'bool'], -'SQLiteUnbuffered::fieldName' => ['string', 'result'=>'', 'field_index'=>'int'], -'SQLiteUnbuffered::next' => ['bool', 'result'=>''], -'SQLiteUnbuffered::numFields' => ['int', 'result'=>''], -'SQLiteUnbuffered::valid' => ['bool', 'result'=>''], -'sqlsrv_begin_transaction' => ['bool', 'conn'=>'resource'], -'sqlsrv_cancel' => ['bool', 'stmt'=>'resource'], -'sqlsrv_client_info' => ['array|false', 'conn'=>'resource'], -'sqlsrv_close' => ['bool', 'conn'=>'resource'], -'sqlsrv_commit' => ['bool', 'conn'=>'resource'], -'sqlsrv_configure' => ['bool', 'setting'=>'string', 'value'=>'mixed'], -'sqlsrv_connect' => ['resource|false', 'serverName'=>'string', 'connectionInfo='=>'array'], -'sqlsrv_errors' => ['array|null', 'errorsOrWarnings='=>'int'], -'sqlsrv_execute' => ['bool', 'stmt'=>'resource'], -'sqlsrv_fetch' => ['bool|null', 'stmt'=>'resource', 'row='=>'int', 'offset='=>'int'], -'sqlsrv_fetch_array' => ['array|null|false', 'stmt'=>'resource', 'fetchType='=>'int', 'row='=>'int', 'offset='=>'int'], -'sqlsrv_fetch_object' => ['object|null|false', 'stmt'=>'resource', 'className='=>'string', 'ctorParams='=>'array', 'row='=>'int', 'offset='=>'int'], -'sqlsrv_field_metadata' => ['array|false', 'stmt'=>'resource'], -'sqlsrv_free_stmt' => ['bool', 'stmt'=>'resource'], -'sqlsrv_get_config' => ['mixed', 'setting'=>'string'], -'sqlsrv_get_field' => ['mixed', 'stmt'=>'resource', 'fieldIndex'=>'int', 'getAsType='=>'int'], -'sqlsrv_has_rows' => ['bool', 'stmt'=>'resource'], -'sqlsrv_next_result' => ['bool|null', 'stmt'=>'resource'], -'sqlsrv_num_fields' => ['int|false', 'stmt'=>'resource'], -'sqlsrv_num_rows' => ['int|false', 'stmt'=>'resource'], -'sqlsrv_prepare' => ['resource|false', 'conn'=>'resource', 'sql'=>'string', 'params='=>'array', 'options='=>'array'], -'sqlsrv_query' => ['resource|false', 'conn'=>'resource', 'sql'=>'string', 'params='=>'array', 'options='=>'array'], -'sqlsrv_rollback' => ['bool', 'conn'=>'resource'], -'sqlsrv_rows_affected' => ['int|false', 'stmt'=>'resource'], -'sqlsrv_send_stream_data' => ['bool', 'stmt'=>'resource'], -'sqlsrv_server_info' => ['array', 'conn'=>'resource'], -'sqrt' => ['float', 'number'=>'float'], -'srand' => ['void', 'seed='=>'int', 'mode='=>'int'], -'sscanf' => ['mixed', 'str'=>'string', 'format'=>'string', '&...w_vars='=>'string|int|float|null'], -'ssdeep_fuzzy_compare' => ['int', 'signature1'=>'string', 'signature2'=>'string'], -'ssdeep_fuzzy_hash' => ['string', 'to_hash'=>'string'], -'ssdeep_fuzzy_hash_filename' => ['string', 'file_name'=>'string'], -'ssh2_auth_agent' => ['bool', 'session'=>'resource', 'username'=>'string'], -'ssh2_auth_hostbased_file' => ['bool', 'session'=>'resource', 'username'=>'string', 'hostname'=>'string', 'pubkeyfile'=>'string', 'privkeyfile'=>'string', 'passphrase='=>'string', 'local_username='=>'string'], -'ssh2_auth_none' => ['true|string[]', 'session'=>'resource', 'username'=>'string'], -'ssh2_auth_password' => ['bool', 'session'=>'resource', 'username'=>'string', 'password'=>'string'], -'ssh2_auth_pubkey_file' => ['bool', 'session'=>'resource', 'username'=>'string', 'pubkeyfile'=>'string', 'privkeyfile'=>'string', 'passphrase='=>'string'], -'ssh2_connect' => ['resource|false', 'host'=>'string', 'port='=>'int', 'methods='=>'array', 'callbacks='=>'array'], -'ssh2_disconnect' => ['bool', 'session'=>'resource'], -'ssh2_exec' => ['resource|false', 'session'=>'resource', 'command'=>'string', 'pty='=>'string', 'env='=>'array', 'width='=>'int', 'height='=>'int', 'width_height_type='=>'int'], -'ssh2_fetch_stream' => ['resource', 'channel'=>'resource', 'streamid'=>'int'], -'ssh2_fingerprint' => ['string', 'session'=>'resource', 'flags='=>'int'], -'ssh2_methods_negotiated' => ['array', 'session'=>'resource'], -'ssh2_publickey_add' => ['bool', 'pkey'=>'resource', 'algoname'=>'string', 'blob'=>'string', 'overwrite='=>'bool', 'attributes='=>'array'], -'ssh2_publickey_init' => ['resource|false', 'session'=>'resource'], -'ssh2_publickey_list' => ['array', 'pkey'=>'resource'], -'ssh2_publickey_remove' => ['bool', 'pkey'=>'resource', 'algoname'=>'string', 'blob'=>'string'], -'ssh2_scp_recv' => ['bool', 'session'=>'resource', 'remote_file'=>'string', 'local_file'=>'string'], -'ssh2_scp_send' => ['bool', 'session'=>'resource', 'local_file'=>'string', 'remote_file'=>'string', 'create_mode='=>'int'], -'ssh2_sftp' => ['resource', 'session'=>'resource'], -'ssh2_sftp_chmod' => ['bool', 'sftp'=>'resource', 'filename'=>'string', 'mode'=>'int'], -'ssh2_sftp_lstat' => ['array', 'sftp'=>'resource', 'path'=>'string'], -'ssh2_sftp_mkdir' => ['bool', 'sftp'=>'resource', 'dirname'=>'string', 'mode='=>'int', 'recursive='=>'bool'], -'ssh2_sftp_readlink' => ['string', 'sftp'=>'resource', 'link'=>'string'], -'ssh2_sftp_realpath' => ['string', 'sftp'=>'resource', 'filename'=>'string'], -'ssh2_sftp_rename' => ['bool', 'sftp'=>'resource', 'from'=>'string', 'to'=>'string'], -'ssh2_sftp_rmdir' => ['bool', 'sftp'=>'resource', 'dirname'=>'string'], -'ssh2_sftp_stat' => ['array|false', 'sftp'=>'resource', 'path'=>'string'], -'ssh2_sftp_symlink' => ['bool', 'sftp'=>'resource', 'target'=>'string', 'link'=>'string'], -'ssh2_sftp_unlink' => ['bool', 'sftp'=>'resource', 'filename'=>'string'], -'ssh2_shell' => ['resource', 'session'=>'resource', 'term_type='=>'string', 'env='=>'array', 'width='=>'int', 'height='=>'int', 'width_height_type='=>'int'], -'ssh2_tunnel' => ['resource', 'session'=>'resource', 'host'=>'string', 'port'=>'int'], -'stat' => ['array|false', 'filename'=>'string'], -'stats_absolute_deviation' => ['float', 'a'=>'array'], -'stats_cdf_beta' => ['float', 'par1'=>'float', 'par2'=>'float', 'par3'=>'float', 'which'=>'int'], -'stats_cdf_binomial' => ['float', 'par1'=>'float', 'par2'=>'float', 'par3'=>'float', 'which'=>'int'], -'stats_cdf_cauchy' => ['float', 'par1'=>'float', 'par2'=>'float', 'par3'=>'float', 'which'=>'int'], -'stats_cdf_chisquare' => ['float', 'par1'=>'float', 'par2'=>'float', 'which'=>'int'], -'stats_cdf_exponential' => ['float', 'par1'=>'float', 'par2'=>'float', 'which'=>'int'], -'stats_cdf_f' => ['float', 'par1'=>'float', 'par2'=>'float', 'par3'=>'float', 'which'=>'int'], -'stats_cdf_gamma' => ['float', 'par1'=>'float', 'par2'=>'float', 'par3'=>'float', 'which'=>'int'], -'stats_cdf_laplace' => ['float', 'par1'=>'float', 'par2'=>'float', 'par3'=>'float', 'which'=>'int'], -'stats_cdf_logistic' => ['float', 'par1'=>'float', 'par2'=>'float', 'par3'=>'float', 'which'=>'int'], -'stats_cdf_negative_binomial' => ['float', 'par1'=>'float', 'par2'=>'float', 'par3'=>'float', 'which'=>'int'], -'stats_cdf_noncentral_chisquare' => ['float', 'par1'=>'float', 'par2'=>'float', 'par3'=>'float', 'which'=>'int'], -'stats_cdf_noncentral_f' => ['float', 'par1'=>'float', 'par2'=>'float', 'par3'=>'float', 'par4'=>'float', 'which'=>'int'], -'stats_cdf_noncentral_t' => ['float', 'par1'=>'float', 'par2'=>'float', 'par3'=>'float', 'which'=>'int'], -'stats_cdf_normal' => ['float', 'par1'=>'float', 'par2'=>'float', 'par3'=>'float', 'which'=>'int'], -'stats_cdf_poisson' => ['float', 'par1'=>'float', 'par2'=>'float', 'which'=>'int'], -'stats_cdf_t' => ['float', 'par1'=>'float', 'par2'=>'float', 'which'=>'int'], -'stats_cdf_uniform' => ['float', 'par1'=>'float', 'par2'=>'float', 'par3'=>'float', 'which'=>'int'], -'stats_cdf_weibull' => ['float', 'par1'=>'float', 'par2'=>'float', 'par3'=>'float', 'which'=>'int'], -'stats_covariance' => ['float', 'a'=>'array', 'b'=>'array'], -'stats_den_uniform' => ['float', 'x'=>'float', 'a'=>'float', 'b'=>'float'], -'stats_dens_beta' => ['float', 'x'=>'float', 'a'=>'float', 'b'=>'float'], -'stats_dens_cauchy' => ['float', 'x'=>'float', 'ave'=>'float', 'stdev'=>'float'], -'stats_dens_chisquare' => ['float', 'x'=>'float', 'dfr'=>'float'], -'stats_dens_exponential' => ['float', 'x'=>'float', 'scale'=>'float'], -'stats_dens_f' => ['float', 'x'=>'float', 'dfr1'=>'float', 'dfr2'=>'float'], -'stats_dens_gamma' => ['float', 'x'=>'float', 'shape'=>'float', 'scale'=>'float'], -'stats_dens_laplace' => ['float', 'x'=>'float', 'ave'=>'float', 'stdev'=>'float'], -'stats_dens_logistic' => ['float', 'x'=>'float', 'ave'=>'float', 'stdev'=>'float'], -'stats_dens_negative_binomial' => ['float', 'x'=>'float', 'n'=>'float', 'pi'=>'float'], -'stats_dens_normal' => ['float', 'x'=>'float', 'ave'=>'float', 'stdev'=>'float'], -'stats_dens_pmf_binomial' => ['float', 'x'=>'float', 'n'=>'float', 'pi'=>'float'], -'stats_dens_pmf_hypergeometric' => ['float', 'n1'=>'float', 'n2'=>'float', 'N1'=>'float', 'N2'=>'float'], -'stats_dens_pmf_negative_binomial' => ['float', 'x'=>'float', 'n'=>'float', 'pi'=>'float'], -'stats_dens_pmf_poisson' => ['float', 'x'=>'float', 'lb'=>'float'], -'stats_dens_t' => ['float', 'x'=>'float', 'dfr'=>'float'], -'stats_dens_uniform' => ['float', 'x'=>'float', 'a'=>'float', 'b'=>'float'], -'stats_dens_weibull' => ['float', 'x'=>'float', 'a'=>'float', 'b'=>'float'], -'stats_harmonic_mean' => ['float', 'a'=>'array'], -'stats_kurtosis' => ['float', 'a'=>'array'], -'stats_rand_gen_beta' => ['float', 'a'=>'float', 'b'=>'float'], -'stats_rand_gen_chisquare' => ['float', 'df'=>'float'], -'stats_rand_gen_exponential' => ['float', 'av'=>'float'], -'stats_rand_gen_f' => ['float', 'dfn'=>'float', 'dfd'=>'float'], -'stats_rand_gen_funiform' => ['float', 'low'=>'float', 'high'=>'float'], -'stats_rand_gen_gamma' => ['float', 'a'=>'float', 'r'=>'float'], -'stats_rand_gen_ibinomial' => ['int', 'n'=>'int', 'pp'=>'float'], -'stats_rand_gen_ibinomial_negative' => ['int', 'n'=>'int', 'p'=>'float'], -'stats_rand_gen_int' => ['int'], -'stats_rand_gen_ipoisson' => ['int', 'mu'=>'float'], -'stats_rand_gen_iuniform' => ['int', 'low'=>'int', 'high'=>'int'], -'stats_rand_gen_noncenral_chisquare' => ['float', 'df'=>'float', 'xnonc'=>'float'], -'stats_rand_gen_noncentral_chisquare' => ['float', 'df'=>'float', 'xnonc'=>'float'], -'stats_rand_gen_noncentral_f' => ['float', 'dfn'=>'float', 'dfd'=>'float', 'xnonc'=>'float'], -'stats_rand_gen_noncentral_t' => ['float', 'df'=>'float', 'xnonc'=>'float'], -'stats_rand_gen_normal' => ['float', 'av'=>'float', 'sd'=>'float'], -'stats_rand_gen_t' => ['float', 'df'=>'float'], -'stats_rand_get_seeds' => ['array'], -'stats_rand_phrase_to_seeds' => ['array', 'phrase'=>'string'], -'stats_rand_ranf' => ['float'], -'stats_rand_setall' => ['void', 'iseed1'=>'int', 'iseed2'=>'int'], -'stats_skew' => ['float', 'a'=>'array'], -'stats_standard_deviation' => ['float', 'a'=>'array', 'sample='=>'bool'], -'stats_stat_binomial_coef' => ['float', 'x'=>'int', 'n'=>'int'], -'stats_stat_correlation' => ['float', 'arr1'=>'array', 'arr2'=>'array'], -'stats_stat_factorial' => ['float', 'n'=>'int'], -'stats_stat_gennch' => ['float', 'n'=>'int'], -'stats_stat_independent_t' => ['float', 'arr1'=>'array', 'arr2'=>'array'], -'stats_stat_innerproduct' => ['float', 'arr1'=>'array', 'arr2'=>'array'], -'stats_stat_noncentral_t' => ['float', 'par1'=>'float', 'par2'=>'float', 'par3'=>'float', 'which'=>'int'], -'stats_stat_paired_t' => ['float', 'arr1'=>'array', 'arr2'=>'array'], -'stats_stat_percentile' => ['float', 'df'=>'float', 'xnonc'=>'float'], -'stats_stat_powersum' => ['float', 'arr'=>'array', 'power'=>'float'], -'stats_variance' => ['float', 'a'=>'array', 'sample='=>'bool'], -'Stomp::__construct' => ['void', 'broker='=>'string', 'username='=>'string', 'password='=>'string', 'headers='=>'array'], -'Stomp::__destruct' => ['bool', 'link'=>''], -'Stomp::abort' => ['bool', 'transaction_id'=>'string', 'headers='=>'array', 'link='=>''], -'Stomp::ack' => ['bool', 'msg'=>'', 'headers='=>'array', 'link='=>''], -'Stomp::begin' => ['bool', 'transaction_id'=>'string', 'headers='=>'array', 'link='=>''], -'Stomp::commit' => ['bool', 'transaction_id'=>'string', 'headers='=>'array', 'link='=>''], -'Stomp::error' => ['string', 'link'=>''], -'Stomp::getReadTimeout' => ['array', 'link'=>''], -'Stomp::getSessionId' => ['string', 'link'=>''], -'Stomp::hasFrame' => ['bool', 'link'=>''], -'Stomp::readFrame' => ['array', 'class_name='=>'string', 'link='=>''], -'Stomp::send' => ['bool', 'destination'=>'string', 'msg'=>'', 'headers='=>'array', 'link='=>''], -'Stomp::setReadTimeout' => ['', 'seconds'=>'int', 'microseconds='=>'int', 'link='=>''], -'Stomp::subscribe' => ['bool', 'destination'=>'string', 'headers='=>'array', 'link='=>''], -'Stomp::unsubscribe' => ['bool', 'destination'=>'string', 'headers='=>'array', 'link='=>''], -'stomp_abort' => ['bool', 'transaction_id'=>'string', 'headers='=>'array', 'link='=>''], -'stomp_ack' => ['bool', 'msg'=>'', 'headers='=>'array', 'link='=>''], -'stomp_begin' => ['bool', 'transaction_id'=>'string', 'headers='=>'array', 'link='=>''], -'stomp_close' => ['bool', 'link'=>''], -'stomp_commit' => ['bool', 'transaction_id'=>'string', 'headers='=>'array', 'link='=>''], -'stomp_connect' => ['resource', 'broker='=>'string', 'username='=>'string', 'password='=>'string', 'headers='=>'array'], -'stomp_connect_error' => ['string'], -'stomp_error' => ['string', 'link'=>''], -'stomp_get_read_timeout' => ['array', 'link'=>''], -'stomp_get_session_id' => ['string', 'link'=>''], -'stomp_has_frame' => ['bool', 'link'=>''], -'stomp_read_frame' => ['array', 'class_name='=>'string', 'link='=>''], -'stomp_send' => ['bool', 'destination'=>'string', 'msg'=>'', 'headers='=>'array', 'link='=>''], -'stomp_set_read_timeout' => ['', 'seconds'=>'int', 'microseconds='=>'int', 'link='=>''], -'stomp_subscribe' => ['bool', 'destination'=>'string', 'headers='=>'array', 'link='=>''], -'stomp_unsubscribe' => ['bool', 'destination'=>'string', 'headers='=>'array', 'link='=>''], -'stomp_version' => ['string'], -'StompException::getDetails' => ['string'], -'StompFrame::__construct' => ['void', 'command='=>'string', 'headers='=>'array', 'body='=>'string'], -'str_getcsv' => ['array', 'input'=>'string', 'delimiter='=>'string', 'enclosure='=>'string', 'escape='=>'string'], -'str_ireplace' => ['string|string[]', 'search'=>'string|array', 'replace'=>'string|array', 'subject'=>'string|array', '&w_replace_count='=>'int'], -'str_pad' => ['string', 'input'=>'string', 'pad_length'=>'int', 'pad_string='=>'string', 'pad_type='=>'int'], -'str_repeat' => ['string', 'input'=>'string', 'multiplier'=>'int'], -'str_replace' => ['string|array', 'search'=>'string|array', 'replace'=>'string|array', 'subject'=>'string|array', '&w_replace_count='=>'int'], -'str_rot13' => ['string', 'str'=>'string'], -'str_shuffle' => ['string', 'str'=>'string'], -'str_split' => ['array|false', 'str'=>'string', 'split_length='=>'int'], -'str_word_count' => ['array|int', 'string'=>'string', 'format='=>'int', 'charlist='=>'string'], -'strcasecmp' => ['int', 'str1'=>'string', 'str2'=>'string'], -'strchr' => ['string|false', 'haystack'=>'string', 'needle'=>'string', 'before_needle='=>'bool'], -'strcmp' => ['int', 'str1'=>'string', 'str2'=>'string'], -'strcoll' => ['int', 'str1'=>'string', 'str2'=>'string'], -'strcspn' => ['int', 'str'=>'string', 'mask'=>'string', 'start='=>'int', 'length='=>'int'], -'stream_bucket_append' => ['void', 'brigade'=>'resource', 'bucket'=>'object'], -'stream_bucket_make_writeable' => ['object', 'brigade'=>'resource'], -'stream_bucket_new' => ['resource', 'stream'=>'resource', 'buffer'=>'string'], -'stream_bucket_prepend' => ['void', 'brigade'=>'resource', 'bucket'=>'object'], -'stream_context_create' => ['resource', 'options='=>'array', 'params='=>'array'], -'stream_context_get_default' => ['resource', 'options='=>'array'], -'stream_context_get_options' => ['array', 'context'=>'resource'], -'stream_context_get_params' => ['array', 'context'=>'resource'], -'stream_context_set_default' => ['resource', 'options'=>'array'], -'stream_context_set_option' => ['bool', 'context'=>'', 'wrappername'=>'string', 'optionname'=>'string', 'value'=>''], -'stream_context_set_option\'1' => ['bool', 'context'=>'', 'options'=>'array'], -'stream_context_set_params' => ['bool', 'context'=>'resource', 'options'=>'array'], -'stream_copy_to_stream' => ['int|false', 'source'=>'resource', 'dest'=>'resource', 'maxlen='=>'int', 'pos='=>'int'], -'stream_encoding' => ['bool', 'stream'=>'resource', 'encoding='=>'string'], -'stream_filter_append' => ['resource|false', 'stream'=>'resource', 'filtername'=>'string', 'read_write='=>'int', 'filterparams='=>'array'], -'stream_filter_prepend' => ['resource|false', 'stream'=>'resource', 'filtername'=>'string', 'read_write='=>'int', 'filterparams='=>'array'], -'stream_filter_register' => ['bool', 'filtername'=>'string', 'classname'=>'string'], -'stream_filter_remove' => ['bool', 'stream_filter'=>'resource'], -'stream_get_contents' => ['string|false', 'source'=>'resource', 'maxlen='=>'int', 'offset='=>'int'], -'stream_get_filters' => ['array'], -'stream_get_line' => ['string|false', 'stream'=>'resource', 'maxlen'=>'int', 'ending='=>'string'], -'stream_get_meta_data' => ['array{timed_out:bool,blocked:bool,eof:bool,unread_bytes:int,stream_type:string,wrapper_type:string,wrapper_data:mixed,mode:string,seekable:bool,uri:string}', 'fp'=>'resource'], -'stream_get_transports' => ['array'], -'stream_get_wrappers' => ['array'], -'stream_is_local' => ['bool', 'stream'=>'resource|string'], -'stream_isatty' => ['bool', 'stream'=>'resource'], -'stream_notification_callback' => ['callback', 'notification_code'=>'int', 'severity'=>'int', 'message'=>'string', 'message_code'=>'int', 'bytes_transferred'=>'int', 'bytes_max'=>'int'], -'stream_resolve_include_path' => ['string|false', 'filename'=>'string'], -'stream_select' => ['int|false', '&rw_read_streams'=>'resource[]', '&rw_write_streams'=>'resource[]|null', '&rw_except_streams'=>'resource[]|null', 'tv_sec'=>'?int', 'tv_usec='=>'?int'], -'stream_set_blocking' => ['bool', 'socket'=>'resource', 'mode'=>'bool'], -'stream_set_chunk_size' => ['int|false', 'fp'=>'resource', 'chunk_size'=>'int'], -'stream_set_read_buffer' => ['int', 'fp'=>'resource', 'buffer'=>'int'], -'stream_set_timeout' => ['bool', 'stream'=>'resource', 'seconds'=>'int', 'microseconds='=>'int'], -'stream_set_write_buffer' => ['int', 'fp'=>'resource', 'buffer'=>'int'], -'stream_socket_accept' => ['resource|false', 'serverstream'=>'resource', 'timeout='=>'float', '&w_peername='=>'string'], -'stream_socket_client' => ['resource|false', 'remoteaddress'=>'string', '&w_errcode='=>'int', '&w_errstring='=>'string', 'timeout='=>'float', 'flags='=>'int', 'context='=>'resource'], -'stream_socket_enable_crypto' => ['int', 'stream'=>'resource', 'enable'=>'bool', 'cryptokind='=>'int', 'sessionstream='=>'resource'], -'stream_socket_get_name' => ['string', 'stream'=>'resource', 'want_peer'=>'bool'], -'stream_socket_pair' => ['resource[]|false', 'domain'=>'int', 'type'=>'int', 'protocol'=>'int'], -'stream_socket_recvfrom' => ['string', 'stream'=>'resource', 'amount'=>'int', 'flags='=>'int', '&w_remote_addr='=>'string'], -'stream_socket_sendto' => ['int', 'stream'=>'resource', 'data'=>'string', 'flags='=>'int', 'target_addr='=>'string'], -'stream_socket_server' => ['resource|false', 'localaddress'=>'string', '&w_errcode='=>'int', '&w_errstring='=>'string', 'flags='=>'int', 'context='=>'resource'], -'stream_socket_shutdown' => ['bool', 'stream'=>'resource', 'how'=>'int'], -'stream_supports_lock' => ['bool', 'stream'=>'resource'], -'stream_wrapper_register' => ['bool', 'protocol'=>'string', 'classname'=>'string', 'flags='=>'int'], -'stream_wrapper_restore' => ['bool', 'protocol'=>'string'], -'stream_wrapper_unregister' => ['bool', 'protocol'=>'string'], -'streamWrapper::__construct' => ['void'], -'streamWrapper::__destruct' => [''], -'streamWrapper::dir_closedir' => ['bool'], -'streamWrapper::dir_opendir' => ['bool', 'path'=>'string', 'options'=>'int'], -'streamWrapper::dir_readdir' => ['string'], -'streamWrapper::dir_rewinddir' => ['bool'], -'streamWrapper::mkdir' => ['bool', 'path'=>'string', 'mode'=>'int', 'options'=>'int'], -'streamWrapper::rename' => ['bool', 'path_from'=>'string', 'path_to'=>'string'], -'streamWrapper::rmdir' => ['bool', 'path'=>'string', 'options'=>'int'], -'streamWrapper::stream_cast' => ['resource', 'cast_as'=>'int'], -'streamWrapper::stream_close' => ['void'], -'streamWrapper::stream_eof' => ['bool'], -'streamWrapper::stream_flush' => ['bool'], -'streamWrapper::stream_lock' => ['bool', 'operation'=>'mode'], -'streamWrapper::stream_metadata' => ['bool', 'path'=>'string', 'option'=>'int', 'value'=>'mixed'], -'streamWrapper::stream_open' => ['bool', 'path'=>'string', 'mode'=>'string', 'options'=>'int', 'opened_path'=>'string'], -'streamWrapper::stream_read' => ['string', 'count'=>'int'], -'streamWrapper::stream_seek' => ['bool', 'offset'=>'int', 'whence'=>'int'], -'streamWrapper::stream_set_option' => ['bool', 'option'=>'int', 'arg1'=>'int', 'arg2'=>'int'], -'streamWrapper::stream_stat' => ['array'], -'streamWrapper::stream_tell' => ['int'], -'streamWrapper::stream_truncate' => ['bool', 'new_size'=>'int'], -'streamWrapper::stream_write' => ['int', 'data'=>'string'], -'streamWrapper::unlink' => ['bool', 'path'=>'string'], -'streamWrapper::url_stat' => ['array', 'path'=>'string', 'flags'=>'int'], -'strftime' => ['string', 'format'=>'string', 'timestamp='=>'int'], -'strip_tags' => ['string', 'str'=>'string', 'allowable_tags='=>'string'], -'stripcslashes' => ['string', 'str'=>'string'], -'stripos' => ['int|false', 'haystack'=>'string', 'needle'=>'string|int', 'offset='=>'int'], -'stripslashes' => ['string', 'str'=>'string'], -'stristr' => ['string|false', 'haystack'=>'string', 'needle'=>'mixed', 'before_needle='=>'bool'], -'strlen' => ['int', 'string'=>'string'], -'strnatcasecmp' => ['int', 's1'=>'string', 's2'=>'string'], -'strnatcmp' => ['int', 's1'=>'string', 's2'=>'string'], -'strncasecmp' => ['int', 'str1'=>'string', 'str2'=>'string', 'len'=>'int'], -'strncmp' => ['int', 'str1'=>'string', 'str2'=>'string', 'len'=>'int'], -'strpbrk' => ['string|false', 'haystack'=>'string', 'char_list'=>'string'], -'strpos' => ['int|false', 'haystack'=>'string', 'needle'=>'string|int', 'offset='=>'int'], -'strptime' => ['array|false', 'datestr'=>'string', 'format'=>'string'], -'strrchr' => ['string|false', 'haystack'=>'string', 'needle'=>'mixed'], -'strrev' => ['string', 'str'=>'string'], -'strripos' => ['int|false', 'haystack'=>'string', 'needle'=>'string|int', 'offset='=>'int'], -'strrpos' => ['int|false', 'haystack'=>'string', 'needle'=>'string|int', 'offset='=>'int'], -'strspn' => ['int', 'str'=>'string', 'mask'=>'string', 'start='=>'int', 'len='=>'int'], -'strstr' => ['string|false', 'haystack'=>'string', 'needle'=>'mixed', 'before_needle='=>'bool'], -'strtok' => ['string|false', 'str'=>'string', 'token'=>'string'], -'strtok\'1' => ['string|false', 'token'=>'string'], -'strtolower' => ['string', 'str'=>'string'], -'strtotime' => ['int|false', 'time'=>'string', 'now='=>'int'], -'strtoupper' => ['string', 'str'=>'string'], -'strtr' => ['string', 'str'=>'string', 'from'=>'string', 'to'=>'string'], -'strtr\'1' => ['string', 'str'=>'string', 'replace_pairs'=>'array'], -'strval' => ['string', 'var'=>'mixed'], -'substr' => ['string', 'str'=>'string', 'start'=>'int', 'length='=>'int'], -'substr_compare' => ['int|false', 'main_str'=>'string', 'str'=>'string', 'offset'=>'int', 'length='=>'int', 'case_sensitivity='=>'bool'], -'substr_count' => ['int', 'haystack'=>'string', 'needle'=>'string', 'offset='=>'int', 'length='=>'int'], -'substr_replace' => ['string|array', 'str'=>'string|array', 'repl'=>'mixed', 'start'=>'mixed', 'length='=>'mixed'], -'suhosin_encrypt_cookie' => ['string', 'name'=>'string', 'value'=>'string'], -'suhosin_get_raw_cookies' => ['array'], -'SVM::__construct' => ['void'], -'svm::crossvalidate' => ['float', 'problem'=>'array', 'number_of_folds'=>'int'], -'SVM::getOptions' => ['array'], -'SVM::setOptions' => ['bool', 'params'=>'array'], -'svm::train' => ['SVMModel', 'problem'=>'array', 'weights='=>'array'], -'SVMModel::__construct' => ['void', 'filename='=>'string'], -'SVMModel::checkProbabilityModel' => ['bool'], -'SVMModel::getLabels' => ['array'], -'SVMModel::getNrClass' => ['int'], -'SVMModel::getSvmType' => ['int'], -'SVMModel::getSvrProbability' => ['float'], -'SVMModel::load' => ['bool', 'filename'=>'string'], -'SVMModel::predict' => ['float', 'data'=>'array'], -'SVMModel::predict_probability' => ['float', 'data'=>'array'], -'SVMModel::save' => ['bool', 'filename'=>'string'], -'svn_add' => ['bool', 'path'=>'string', 'recursive='=>'bool', 'force='=>'bool'], -'svn_auth_get_parameter' => ['string', 'key'=>'string'], -'svn_auth_set_parameter' => ['void', 'key'=>'string', 'value'=>'string'], -'svn_blame' => ['array', 'repository_url'=>'string', 'revision_no='=>'int'], -'svn_cat' => ['string', 'repos_url'=>'string', 'revision_no='=>'int'], -'svn_checkout' => ['bool', 'repos'=>'string', 'targetpath'=>'string', 'revision='=>'int', 'flags='=>'int'], -'svn_cleanup' => ['bool', 'workingdir'=>'string'], -'svn_client_version' => ['string'], -'svn_commit' => ['array', 'log'=>'string', 'targets'=>'array', 'dontrecurse='=>'bool'], -'svn_delete' => ['bool', 'path'=>'string', 'force='=>'bool'], -'svn_diff' => ['array', 'path1'=>'string', 'rev1'=>'int', 'path2'=>'string', 'rev2'=>'int'], -'svn_export' => ['bool', 'frompath'=>'string', 'topath'=>'string', 'working_copy='=>'bool', 'revision_no='=>'int'], -'svn_fs_abort_txn' => ['bool', 'txn'=>'resource'], -'svn_fs_apply_text' => ['resource', 'root'=>'resource', 'path'=>'string'], -'svn_fs_begin_txn2' => ['resource', 'repos'=>'resource', 'rev'=>'int'], -'svn_fs_change_node_prop' => ['bool', 'root'=>'resource', 'path'=>'string', 'name'=>'string', 'value'=>'string'], -'svn_fs_check_path' => ['int', 'fsroot'=>'resource', 'path'=>'string'], -'svn_fs_contents_changed' => ['bool', 'root1'=>'resource', 'path1'=>'string', 'root2'=>'resource', 'path2'=>'string'], -'svn_fs_copy' => ['bool', 'from_root'=>'resource', 'from_path'=>'string', 'to_root'=>'resource', 'to_path'=>'string'], -'svn_fs_delete' => ['bool', 'root'=>'resource', 'path'=>'string'], -'svn_fs_dir_entries' => ['array', 'fsroot'=>'resource', 'path'=>'string'], -'svn_fs_file_contents' => ['resource', 'fsroot'=>'resource', 'path'=>'string'], -'svn_fs_file_length' => ['int', 'fsroot'=>'resource', 'path'=>'string'], -'svn_fs_is_dir' => ['bool', 'root'=>'resource', 'path'=>'string'], -'svn_fs_is_file' => ['bool', 'root'=>'resource', 'path'=>'string'], -'svn_fs_make_dir' => ['bool', 'root'=>'resource', 'path'=>'string'], -'svn_fs_make_file' => ['bool', 'root'=>'resource', 'path'=>'string'], -'svn_fs_node_created_rev' => ['int', 'fsroot'=>'resource', 'path'=>'string'], -'svn_fs_node_prop' => ['string', 'fsroot'=>'resource', 'path'=>'string', 'propname'=>'string'], -'svn_fs_props_changed' => ['bool', 'root1'=>'resource', 'path1'=>'string', 'root2'=>'resource', 'path2'=>'string'], -'svn_fs_revision_prop' => ['string', 'fs'=>'resource', 'revnum'=>'int', 'propname'=>'string'], -'svn_fs_revision_root' => ['resource', 'fs'=>'resource', 'revnum'=>'int'], -'svn_fs_txn_root' => ['resource', 'txn'=>'resource'], -'svn_fs_youngest_rev' => ['int', 'fs'=>'resource'], -'svn_import' => ['bool', 'path'=>'string', 'url'=>'string', 'nonrecursive'=>'bool'], -'svn_log' => ['array', 'repos_url'=>'string', 'start_revision='=>'int', 'end_revision='=>'int', 'limit='=>'int', 'flags='=>'int'], -'svn_ls' => ['array', 'repos_url'=>'string', 'revision_no='=>'int', 'recurse='=>'bool', 'peg='=>'bool'], -'svn_mkdir' => ['bool', 'path'=>'string', 'log_message='=>'string'], -'svn_move' => ['mixed', 'src_path'=>'string', 'dst_path'=>'string', 'force='=>'bool|false'], -'svn_propget' => ['mixed', 'path'=>'string', 'property_name'=>'string', 'recurse='=>'bool|false', 'revision'=>'int'], -'svn_proplist' => ['mixed', 'path'=>'string', 'recurse='=>'bool|false', 'revision'=>'int'], -'svn_repos_create' => ['resource', 'path'=>'string', 'config='=>'array', 'fsconfig='=>'array'], -'svn_repos_fs' => ['resource', 'repos'=>'resource'], -'svn_repos_fs_begin_txn_for_commit' => ['resource', 'repos'=>'resource', 'rev'=>'int', 'author'=>'string', 'log_msg'=>'string'], -'svn_repos_fs_commit_txn' => ['int', 'txn'=>'resource'], -'svn_repos_hotcopy' => ['bool', 'repospath'=>'string', 'destpath'=>'string', 'cleanlogs'=>'bool'], -'svn_repos_open' => ['resource', 'path'=>'string'], -'svn_repos_recover' => ['bool', 'path'=>'string'], -'svn_revert' => ['bool', 'path'=>'string', 'recursive='=>'bool'], -'svn_status' => ['array', 'path'=>'string', 'flags='=>'int'], -'svn_update' => ['int', 'path'=>'string', 'revno='=>'int', 'recurse='=>'bool'], -'swf_actiongeturl' => ['', 'url'=>'string', 'target'=>'string'], -'swf_actiongotoframe' => ['', 'framenumber'=>'int'], -'swf_actiongotolabel' => ['', 'label'=>'string'], -'swf_actionnextframe' => [''], -'swf_actionplay' => [''], -'swf_actionprevframe' => [''], -'swf_actionsettarget' => ['', 'target'=>'string'], -'swf_actionstop' => [''], -'swf_actiontogglequality' => [''], -'swf_actionwaitforframe' => ['', 'framenumber'=>'int', 'skipcount'=>'int'], -'swf_addbuttonrecord' => ['', 'states'=>'int', 'shapeid'=>'int', 'depth'=>'int'], -'swf_addcolor' => ['', 'r'=>'float', 'g'=>'float', 'b'=>'float', 'a'=>'float'], -'swf_closefile' => ['', 'return_file='=>'int'], -'swf_definebitmap' => ['', 'objid'=>'int', 'image_name'=>'string'], -'swf_definefont' => ['', 'fontid'=>'int', 'fontname'=>'string'], -'swf_defineline' => ['', 'objid'=>'int', 'x1'=>'float', 'y1'=>'float', 'x2'=>'float', 'y2'=>'float', 'width'=>'float'], -'swf_definepoly' => ['', 'objid'=>'int', 'coords'=>'array', 'npoints'=>'int', 'width'=>'float'], -'swf_definerect' => ['', 'objid'=>'int', 'x1'=>'float', 'y1'=>'float', 'x2'=>'float', 'y2'=>'float', 'width'=>'float'], -'swf_definetext' => ['', 'objid'=>'int', 'str'=>'string', 'docenter'=>'int'], -'swf_endbutton' => [''], -'swf_enddoaction' => [''], -'swf_endshape' => [''], -'swf_endsymbol' => [''], -'swf_fontsize' => ['', 'size'=>'float'], -'swf_fontslant' => ['', 'slant'=>'float'], -'swf_fonttracking' => ['', 'tracking'=>'float'], -'swf_getbitmapinfo' => ['array', 'bitmapid'=>'int'], -'swf_getfontinfo' => ['array'], -'swf_getframe' => ['int'], -'swf_labelframe' => ['', 'name'=>'string'], -'swf_lookat' => ['', 'view_x'=>'float', 'view_y'=>'float', 'view_z'=>'float', 'reference_x'=>'float', 'reference_y'=>'float', 'reference_z'=>'float', 'twist'=>'float'], -'swf_modifyobject' => ['', 'depth'=>'int', 'how'=>'int'], -'swf_mulcolor' => ['', 'r'=>'float', 'g'=>'float', 'b'=>'float', 'a'=>'float'], -'swf_nextid' => ['int'], -'swf_oncondition' => ['', 'transition'=>'int'], -'swf_openfile' => ['', 'filename'=>'string', 'width'=>'float', 'height'=>'float', 'framerate'=>'float', 'r'=>'float', 'g'=>'float', 'b'=>'float'], -'swf_ortho' => ['', 'xmin'=>'float', 'xmax'=>'float', 'ymin'=>'float', 'ymax'=>'float', 'zmin'=>'float', 'zmax'=>'float'], -'swf_ortho2' => ['', 'xmin'=>'float', 'xmax'=>'float', 'ymin'=>'float', 'ymax'=>'float'], -'swf_perspective' => ['', 'fovy'=>'float', 'aspect'=>'float', 'near'=>'float', 'far'=>'float'], -'swf_placeobject' => ['', 'objid'=>'int', 'depth'=>'int'], -'swf_polarview' => ['', 'dist'=>'float', 'azimuth'=>'float', 'incidence'=>'float', 'twist'=>'float'], -'swf_popmatrix' => [''], -'swf_posround' => ['', 'round'=>'int'], -'swf_pushmatrix' => [''], -'swf_removeobject' => ['', 'depth'=>'int'], -'swf_rotate' => ['', 'angle'=>'float', 'axis'=>'string'], -'swf_scale' => ['', 'x'=>'float', 'y'=>'float', 'z'=>'float'], -'swf_setfont' => ['', 'fontid'=>'int'], -'swf_setframe' => ['', 'framenumber'=>'int'], -'swf_shapearc' => ['', 'x'=>'float', 'y'=>'float', 'r'=>'float', 'ang1'=>'float', 'ang2'=>'float'], -'swf_shapecurveto' => ['', 'x1'=>'float', 'y1'=>'float', 'x2'=>'float', 'y2'=>'float'], -'swf_shapecurveto3' => ['', 'x1'=>'float', 'y1'=>'float', 'x2'=>'float', 'y2'=>'float', 'x3'=>'float', 'y3'=>'float'], -'swf_shapefillbitmapclip' => ['', 'bitmapid'=>'int'], -'swf_shapefillbitmaptile' => ['', 'bitmapid'=>'int'], -'swf_shapefilloff' => [''], -'swf_shapefillsolid' => ['', 'r'=>'float', 'g'=>'float', 'b'=>'float', 'a'=>'float'], -'swf_shapelinesolid' => ['', 'r'=>'float', 'g'=>'float', 'b'=>'float', 'a'=>'float', 'width'=>'float'], -'swf_shapelineto' => ['', 'x'=>'float', 'y'=>'float'], -'swf_shapemoveto' => ['', 'x'=>'float', 'y'=>'float'], -'swf_showframe' => [''], -'swf_startbutton' => ['', 'objid'=>'int', 'type'=>'int'], -'swf_startdoaction' => [''], -'swf_startshape' => ['', 'objid'=>'int'], -'swf_startsymbol' => ['', 'objid'=>'int'], -'swf_textwidth' => ['float', 'str'=>'string'], -'swf_translate' => ['', 'x'=>'float', 'y'=>'float', 'z'=>'float'], -'swf_viewport' => ['', 'xmin'=>'float', 'xmax'=>'float', 'ymin'=>'float', 'ymax'=>'float'], -'SWFAction::__construct' => ['void', 'script'=>'string'], -'SWFBitmap::__construct' => ['void', 'file'=>'', 'alphafile='=>''], -'SWFBitmap::getHeight' => ['float'], -'SWFBitmap::getWidth' => ['float'], -'SWFButton::__construct' => ['void'], -'SWFButton::addAction' => ['void', 'action'=>'swfaction', 'flags'=>'int'], -'SWFButton::addASound' => ['SWFSoundInstance', 'sound'=>'swfsound', 'flags'=>'int'], -'SWFButton::addShape' => ['void', 'shape'=>'swfshape', 'flags'=>'int'], -'SWFButton::setAction' => ['void', 'action'=>'swfaction'], -'SWFButton::setDown' => ['void', 'shape'=>'swfshape'], -'SWFButton::setHit' => ['void', 'shape'=>'swfshape'], -'SWFButton::setMenu' => ['void', 'flag'=>'int'], -'SWFButton::setOver' => ['void', 'shape'=>'swfshape'], -'SWFButton::setUp' => ['void', 'shape'=>'swfshape'], -'SWFDisplayItem::addAction' => ['void', 'action'=>'swfaction', 'flags'=>'int'], -'SWFDisplayItem::addColor' => ['void', 'red'=>'int', 'green'=>'int', 'blue'=>'int', 'a='=>'int'], -'SWFDisplayItem::endMask' => ['void'], -'SWFDisplayItem::getRot' => ['float'], -'SWFDisplayItem::getX' => ['float'], -'SWFDisplayItem::getXScale' => ['float'], -'SWFDisplayItem::getXSkew' => ['float'], -'SWFDisplayItem::getY' => ['float'], -'SWFDisplayItem::getYScale' => ['float'], -'SWFDisplayItem::getYSkew' => ['float'], -'SWFDisplayItem::move' => ['void', 'dx'=>'float', 'dy'=>'float'], -'SWFDisplayItem::moveTo' => ['void', 'x'=>'float', 'y'=>'float'], -'SWFDisplayItem::multColor' => ['void', 'red'=>'float', 'green'=>'float', 'blue'=>'float', 'a='=>'float'], -'SWFDisplayItem::remove' => ['void'], -'SWFDisplayItem::rotate' => ['void', 'angle'=>'float'], -'SWFDisplayItem::rotateTo' => ['void', 'angle'=>'float'], -'SWFDisplayItem::scale' => ['void', 'dx'=>'float', 'dy'=>'float'], -'SWFDisplayItem::scaleTo' => ['void', 'x'=>'float', 'y='=>'float'], -'SWFDisplayItem::setDepth' => ['void', 'depth'=>'int'], -'SWFDisplayItem::setMaskLevel' => ['void', 'level'=>'int'], -'SWFDisplayItem::setMatrix' => ['void', 'a'=>'float', 'b'=>'float', 'c'=>'float', 'd'=>'float', 'x'=>'float', 'y'=>'float'], -'SWFDisplayItem::setName' => ['void', 'name'=>'string'], -'SWFDisplayItem::setRatio' => ['void', 'ratio'=>'float'], -'SWFDisplayItem::skewX' => ['void', 'ddegrees'=>'float'], -'SWFDisplayItem::skewXTo' => ['void', 'degrees'=>'float'], -'SWFDisplayItem::skewY' => ['void', 'ddegrees'=>'float'], -'SWFDisplayItem::skewYTo' => ['void', 'degrees'=>'float'], -'SWFFill::moveTo' => ['void', 'x'=>'float', 'y'=>'float'], -'SWFFill::rotateTo' => ['void', 'angle'=>'float'], -'SWFFill::scaleTo' => ['void', 'x'=>'float', 'y='=>'float'], -'SWFFill::skewXTo' => ['void', 'x'=>'float'], -'SWFFill::skewYTo' => ['void', 'y'=>'float'], -'SWFFont::__construct' => ['void', 'filename'=>'string'], -'SWFFont::getAscent' => ['float'], -'SWFFont::getDescent' => ['float'], -'SWFFont::getLeading' => ['float'], -'SWFFont::getShape' => ['string', 'code'=>'int'], -'SWFFont::getUTF8Width' => ['float', 'string'=>'string'], -'SWFFont::getWidth' => ['float', 'string'=>'string'], -'SWFFontChar::addChars' => ['void', 'char'=>'string'], -'SWFFontChar::addUTF8Chars' => ['void', 'char'=>'string'], -'SWFGradient::__construct' => ['void'], -'SWFGradient::addEntry' => ['void', 'ratio'=>'float', 'red'=>'int', 'green'=>'int', 'blue'=>'int', 'alpha='=>'int'], -'SWFMorph::__construct' => ['void'], -'SWFMorph::getShape1' => ['SWFShape'], -'SWFMorph::getShape2' => ['SWFShape'], -'SWFMovie::__construct' => ['void', 'version='=>'int'], -'SWFMovie::add' => ['mixed', 'instance'=>'object'], -'SWFMovie::addExport' => ['void', 'char'=>'swfcharacter', 'name'=>'string'], -'SWFMovie::addFont' => ['mixed', 'font'=>'swffont'], -'SWFMovie::importChar' => ['SWFSprite', 'libswf'=>'string', 'name'=>'string'], -'SWFMovie::importFont' => ['SWFFontChar', 'libswf'=>'string', 'name'=>'string'], -'SWFMovie::labelFrame' => ['void', 'label'=>'string'], -'SWFMovie::nextFrame' => ['void'], -'SWFMovie::output' => ['int', 'compression='=>'int'], -'SWFMovie::remove' => ['void', 'instance'=>'object'], -'SWFMovie::save' => ['int', 'filename'=>'string', 'compression='=>'int'], -'SWFMovie::saveToFile' => ['int', 'x'=>'resource', 'compression='=>'int'], -'SWFMovie::setbackground' => ['void', 'red'=>'int', 'green'=>'int', 'blue'=>'int'], -'SWFMovie::setDimension' => ['void', 'width'=>'float', 'height'=>'float'], -'SWFMovie::setFrames' => ['void', 'number'=>'int'], -'SWFMovie::setRate' => ['void', 'rate'=>'float'], -'SWFMovie::startSound' => ['SWFSoundInstance', 'sound'=>'swfsound'], -'SWFMovie::stopSound' => ['void', 'sound'=>'swfsound'], -'SWFMovie::streamMP3' => ['int', 'mp3file'=>'mixed', 'skip='=>'float'], -'SWFMovie::writeExports' => ['void'], -'SWFPrebuiltClip::__construct' => ['void', 'file'=>''], -'SWFShape::__construct' => ['void'], -'SWFShape::addFill' => ['SWFFill', 'red'=>'int', 'green'=>'int', 'blue'=>'int', 'alpha='=>'int', 'bitmap='=>'swfbitmap', 'flags='=>'int', 'gradient='=>'swfgradient'], -'SWFShape::addFill\'1' => ['SWFFill', 'bitmap'=>'SWFBitmap', 'flags='=>'int'], -'SWFShape::addFill\'2' => ['SWFFill', 'gradient'=>'SWFGradient', 'flags='=>'int'], -'SWFShape::drawArc' => ['void', 'r'=>'float', 'startangle'=>'float', 'endangle'=>'float'], -'SWFShape::drawCircle' => ['void', 'r'=>'float'], -'SWFShape::drawCubic' => ['int', 'bx'=>'float', 'by'=>'float', 'cx'=>'float', 'cy'=>'float', 'dx'=>'float', 'dy'=>'float'], -'SWFShape::drawCubicTo' => ['int', 'bx'=>'float', 'by'=>'float', 'cx'=>'float', 'cy'=>'float', 'dx'=>'float', 'dy'=>'float'], -'SWFShape::drawCurve' => ['int', 'controldx'=>'float', 'controldy'=>'float', 'anchordx'=>'float', 'anchordy'=>'float', 'targetdx='=>'float', 'targetdy='=>'float'], -'SWFShape::drawCurveTo' => ['int', 'controlx'=>'float', 'controly'=>'float', 'anchorx'=>'float', 'anchory'=>'float', 'targetx='=>'float', 'targety='=>'float'], -'SWFShape::drawGlyph' => ['void', 'font'=>'swffont', 'character'=>'string', 'size='=>'int'], -'SWFShape::drawLine' => ['void', 'dx'=>'float', 'dy'=>'float'], -'SWFShape::drawLineTo' => ['void', 'x'=>'float', 'y'=>'float'], -'SWFShape::movePen' => ['void', 'dx'=>'float', 'dy'=>'float'], -'SWFShape::movePenTo' => ['void', 'x'=>'float', 'y'=>'float'], -'SWFShape::setLeftFill' => ['', 'fill'=>'swfgradient', 'red'=>'int', 'green'=>'int', 'blue'=>'int', 'a='=>'int'], -'SWFShape::setLine' => ['', 'shape'=>'swfshape', 'width'=>'int', 'red'=>'int', 'green'=>'int', 'blue'=>'int', 'a='=>'int'], -'SWFShape::setRightFill' => ['', 'fill'=>'swfgradient', 'red'=>'int', 'green'=>'int', 'blue'=>'int', 'a='=>'int'], -'SWFSound' => ['SWFSound', 'filename'=>'string', 'flags='=>'int'], -'SWFSound::__construct' => ['void', 'filename'=>'string', 'flags='=>'int'], -'SWFSoundInstance::loopCount' => ['void', 'point'=>'int'], -'SWFSoundInstance::loopInPoint' => ['void', 'point'=>'int'], -'SWFSoundInstance::loopOutPoint' => ['void', 'point'=>'int'], -'SWFSoundInstance::noMultiple' => ['void'], -'SWFSprite::__construct' => ['void'], -'SWFSprite::add' => ['void', 'object'=>'object'], -'SWFSprite::labelFrame' => ['void', 'label'=>'string'], -'SWFSprite::nextFrame' => ['void'], -'SWFSprite::remove' => ['void', 'object'=>'object'], -'SWFSprite::setFrames' => ['void', 'number'=>'int'], -'SWFSprite::startSound' => ['SWFSoundInstance', 'sount'=>'swfsound'], -'SWFSprite::stopSound' => ['void', 'sount'=>'swfsound'], -'SWFText::__construct' => ['void'], -'SWFText::addString' => ['void', 'string'=>'string'], -'SWFText::addUTF8String' => ['void', 'text'=>'string'], -'SWFText::getAscent' => ['float'], -'SWFText::getDescent' => ['float'], -'SWFText::getLeading' => ['float'], -'SWFText::getUTF8Width' => ['float', 'string'=>'string'], -'SWFText::getWidth' => ['float', 'string'=>'string'], -'SWFText::moveTo' => ['void', 'x'=>'float', 'y'=>'float'], -'SWFText::setColor' => ['void', 'red'=>'int', 'green'=>'int', 'blue'=>'int', 'a='=>'int'], -'SWFText::setFont' => ['void', 'font'=>'swffont'], -'SWFText::setHeight' => ['void', 'height'=>'float'], -'SWFText::setSpacing' => ['void', 'spacing'=>'float'], -'SWFTextField::__construct' => ['void', 'flags='=>'int'], -'SWFTextField::addChars' => ['void', 'chars'=>'string'], -'SWFTextField::addString' => ['void', 'string'=>'string'], -'SWFTextField::align' => ['void', 'alignement'=>'int'], -'SWFTextField::setBounds' => ['void', 'width'=>'float', 'height'=>'float'], -'SWFTextField::setColor' => ['void', 'red'=>'int', 'green'=>'int', 'blue'=>'int', 'a='=>'int'], -'SWFTextField::setFont' => ['void', 'font'=>'swffont'], -'SWFTextField::setHeight' => ['void', 'height'=>'float'], -'SWFTextField::setIndentation' => ['void', 'width'=>'float'], -'SWFTextField::setLeftMargin' => ['void', 'width'=>'float'], -'SWFTextField::setLineSpacing' => ['void', 'height'=>'float'], -'SWFTextField::setMargins' => ['void', 'left'=>'float', 'right'=>'float'], -'SWFTextField::setName' => ['void', 'name'=>'string'], -'SWFTextField::setPadding' => ['void', 'padding'=>'float'], -'SWFTextField::setRightMargin' => ['void', 'width'=>'float'], -'SWFVideoStream::__construct' => ['void', 'file='=>'string'], -'SWFVideoStream::getNumFrames' => ['int'], -'SWFVideoStream::setDimension' => ['void', 'x'=>'int', 'y'=>'int'], -'Swish::__construct' => ['void', 'index_names'=>'string'], -'Swish::getMetaList' => ['array', 'index_name'=>'string'], -'Swish::getPropertyList' => ['array', 'index_name'=>'string'], -'Swish::prepare' => ['object', 'query='=>'string'], -'Swish::query' => ['object', 'query'=>'string'], -'SwishResult::getMetaList' => ['array'], -'SwishResult::stem' => ['array', 'word'=>'string'], -'SwishResults::getParsedWords' => ['array', 'index_name'=>'string'], -'SwishResults::getRemovedStopwords' => ['array', 'index_name'=>'string'], -'SwishResults::nextResult' => ['object'], -'SwishResults::seekResult' => ['int', 'position'=>'int'], -'SwishSearch::execute' => ['object', 'query='=>'string'], -'SwishSearch::resetLimit' => [''], -'SwishSearch::setLimit' => ['', 'property'=>'string', 'low'=>'string', 'high'=>'string'], -'SwishSearch::setPhraseDelimiter' => ['', 'delimiter'=>'string'], -'SwishSearch::setSort' => ['', 'sort'=>'string'], -'SwishSearch::setStructure' => ['', 'structure'=>'int'], -'swoole_async_dns_lookup' => ['bool', 'hostname'=>'string', 'callback'=>'callable'], -'swoole_async_read' => ['bool', 'filename'=>'string', 'callback'=>'callable', 'chunk_size='=>'int', 'offset='=>'int'], -'swoole_async_readfile' => ['bool', 'filename'=>'string', 'callback'=>'string'], -'swoole_async_set' => ['void', 'settings'=>'array'], -'swoole_async_write' => ['bool', 'filename'=>'string', 'content'=>'string', 'offset='=>'int', 'callback='=>'callable'], -'swoole_async_writefile' => ['bool', 'filename'=>'string', 'content'=>'string', 'callback='=>'string', 'flags='=>'int'], -'swoole_client_select' => ['int', 'read_array'=>'array', 'write_array'=>'array', 'error_array'=>'array', 'timeout='=>'float'], -'swoole_cpu_num' => ['int'], -'swoole_errno' => ['int'], -'swoole_event_add' => ['int', 'fd'=>'int', 'read_callback='=>'callable', 'write_callback='=>'callable', 'events='=>'int'], -'swoole_event_defer' => ['bool', 'callback'=>'callable'], -'swoole_event_del' => ['bool', 'fd'=>'int'], -'swoole_event_exit' => ['void'], -'swoole_event_set' => ['bool', 'fd'=>'int', 'read_callback='=>'callable', 'write_callback='=>'callable', 'events='=>'int'], -'swoole_event_wait' => ['void'], -'swoole_event_write' => ['bool', 'fd'=>'int', 'data'=>'string'], -'swoole_get_local_ip' => ['array'], -'swoole_last_error' => ['int'], -'swoole_load_module' => ['mixed', 'filename'=>'string'], -'swoole_select' => ['int', 'read_array'=>'array', 'write_array'=>'array', 'error_array'=>'array', 'timeout='=>'float'], -'swoole_set_process_name' => ['void', 'process_name'=>'string', 'size='=>'int'], -'swoole_strerror' => ['string', 'errno'=>'int', 'error_type='=>'int'], -'swoole_timer_after' => ['int', 'ms'=>'int', 'callback'=>'callable', 'param='=>'mixed'], -'swoole_timer_exists' => ['bool', 'timer_id'=>'int'], -'swoole_timer_tick' => ['int', 'ms'=>'int', 'callback'=>'callable', 'param='=>'mixed'], -'swoole_version' => ['string'], -'sybase_affected_rows' => ['int', 'link_identifier='=>'resource'], -'sybase_close' => ['bool', 'link_identifier='=>'resource'], -'sybase_connect' => ['resource', 'servername='=>'string', 'username='=>'string', 'password='=>'string', 'charset='=>'string', 'appname='=>'string', 'new='=>'bool'], -'sybase_data_seek' => ['bool', 'result_identifier'=>'resource', 'row_number'=>'int'], -'sybase_deadlock_retry_count' => ['void', 'retry_count'=>'int'], -'sybase_fetch_array' => ['array', 'result'=>'resource'], -'sybase_fetch_assoc' => ['array', 'result'=>'resource'], -'sybase_fetch_field' => ['object', 'result'=>'resource', 'field_offset='=>'int'], -'sybase_fetch_object' => ['object', 'result'=>'resource', 'object='=>'mixed'], -'sybase_fetch_row' => ['array', 'result'=>'resource'], -'sybase_field_seek' => ['bool', 'result'=>'resource', 'field_offset'=>'int'], -'sybase_free_result' => ['bool', 'result'=>'resource'], -'sybase_get_last_message' => ['string'], -'sybase_min_client_severity' => ['void', 'severity'=>'int'], -'sybase_min_error_severity' => ['void', 'severity'=>'int'], -'sybase_min_message_severity' => ['void', 'severity'=>'int'], -'sybase_min_server_severity' => ['void', 'severity'=>'int'], -'sybase_num_fields' => ['int', 'result'=>'resource'], -'sybase_num_rows' => ['int', 'result'=>'resource'], -'sybase_pconnect' => ['resource', 'servername='=>'string', 'username='=>'string', 'password='=>'string', 'charset='=>'string', 'appname='=>'string'], -'sybase_query' => ['mixed', 'query'=>'string', 'link_identifier='=>'resource'], -'sybase_result' => ['string', 'result'=>'resource', 'row'=>'int', 'field'=>'mixed'], -'sybase_select_db' => ['bool', 'database_name'=>'string', 'link_identifier='=>'resource'], -'sybase_set_message_handler' => ['bool', 'handler'=>'callable', 'connection='=>'resource'], -'sybase_unbuffered_query' => ['resource', 'query'=>'string', 'link_identifier'=>'resource', 'store_result='=>'bool'], -'symbolObj::__construct' => ['void', 'map'=>'MapObj', 'symbolname'=>'string'], -'symbolObj::free' => ['void'], -'symbolObj::getPatternArray' => ['array'], -'symbolObj::getPointsArray' => ['array'], -'symbolObj::ms_newSymbolObj' => ['int', 'map'=>'MapObj', 'symbolname'=>'string'], -'symbolObj::set' => ['int', 'property_name'=>'string', 'new_value'=>''], -'symbolObj::setImagePath' => ['int', 'filename'=>'string'], -'symbolObj::setPattern' => ['int', 'int'=>'array'], -'symbolObj::setPoints' => ['int', 'double'=>'array'], -'symlink' => ['bool', 'target'=>'string', 'link'=>'string'], -'SyncEvent::__construct' => ['void', 'name='=>'string', 'manual='=>'bool'], -'SyncEvent::fire' => ['bool'], -'SyncEvent::reset' => ['bool'], -'SyncEvent::wait' => ['bool', 'wait='=>'int'], -'SyncMutex::__construct' => ['void', 'name='=>'string'], -'SyncMutex::lock' => ['bool', 'wait='=>'int'], -'SyncMutex::unlock' => ['bool', 'all='=>'bool'], -'SyncReaderWriter::__construct' => ['void', 'name='=>'string', 'autounlock='=>'bool'], -'SyncReaderWriter::readlock' => ['bool', 'wait='=>'int'], -'SyncReaderWriter::readunlock' => ['bool'], -'SyncReaderWriter::writelock' => ['bool', 'wait='=>'int'], -'SyncReaderWriter::writeunlock' => ['bool'], -'SyncSemaphore::__construct' => ['void', 'name='=>'string', 'initialval='=>'int', 'autounlock='=>'bool'], -'SyncSemaphore::lock' => ['bool', 'wait='=>'int'], -'SyncSemaphore::unlock' => ['bool', '&w_prevcount='=>'int'], -'SyncSharedMemory::__construct' => ['void', 'name'=>'string', 'size'=>'int'], -'SyncSharedMemory::first' => ['bool'], -'SyncSharedMemory::read' => ['', 'start='=>'int', 'length='=>'int'], -'SyncSharedMemory::size' => ['bool'], -'SyncSharedMemory::write' => ['', 'string='=>'string', 'start='=>'int'], -'sys_get_temp_dir' => ['string'], -'sys_getloadavg' => ['array'], -'syslog' => ['bool', 'priority'=>'int', 'message'=>'string'], -'system' => ['string', 'command'=>'string', '&w_return_value='=>'int'], -'taint' => ['bool', '&rw_string'=>'string', '&...w_other_strings='=>'string'], -'tan' => ['float', 'number'=>'float'], -'tanh' => ['float', 'number'=>'float'], -'tcpwrap_check' => ['bool', 'daemon'=>'string', 'address'=>'string', 'user='=>'string', 'nodns='=>'bool'], -'tempnam' => ['string|false', 'dir'=>'string', 'prefix'=>'string'], -'textdomain' => ['string', 'domain'=>'string'], -'Thread::__construct' => ['void'], -'Thread::chunk' => ['array', 'size'=>'int', 'preserve'=>'bool'], -'Thread::count' => ['int'], -'Thread::detach' => ['void'], -'Thread::getCreatorId' => ['int'], -'Thread::getCurrentThread' => ['Thread'], -'Thread::getCurrentThreadId' => ['int'], -'Thread::getTerminationInfo' => ['array'], -'Thread::getThreadId' => ['int'], -'Thread::globally' => ['mixed'], -'Thread::isJoined' => ['bool'], -'Thread::isRunning' => ['bool'], -'Thread::isStarted' => ['bool'], -'Thread::isTerminated' => ['bool'], -'Thread::isWaiting' => ['bool'], -'Thread::join' => ['bool'], -'Thread::kill' => ['void'], -'Thread::lock' => ['bool'], -'Thread::merge' => ['bool', 'from'=>'', 'overwrite='=>'mixed'], -'Thread::notify' => ['bool'], -'Thread::offsetExists' => ['bool', 'offset'=>'mixed'], -'Thread::offsetGet' => ['mixed', 'offset'=>'mixed'], -'Thread::offsetSet' => ['void', 'offset'=>'mixed', 'value'=>'mixed'], -'Thread::offsetUnset' => ['void', 'offset'=>'mixed'], -'Thread::pop' => ['bool'], -'Thread::run' => ['void'], -'Thread::shift' => ['bool'], -'Thread::start' => ['bool', 'options='=>'int'], -'Thread::synchronized' => ['mixed', 'block'=>'Closure', '_='=>'mixed'], -'Thread::unlock' => ['bool'], -'Thread::wait' => ['bool', 'timeout='=>'int'], -'Threaded::__construct' => ['void'], -'Threaded::chunk' => ['array', 'size'=>'int', 'preserve'=>'bool'], -'Threaded::count' => ['int'], -'Threaded::extend' => ['bool', 'class'=>'string'], -'Threaded::from' => ['Threaded', 'run'=>'Closure', 'construct='=>'Closure', 'args='=>'array'], -'Threaded::getTerminationInfo' => ['array'], -'Threaded::isRunning' => ['bool'], -'Threaded::isTerminated' => ['bool'], -'Threaded::isWaiting' => ['bool'], -'Threaded::lock' => ['bool'], -'Threaded::merge' => ['bool', 'from'=>'mixed', 'overwrite='=>'bool'], -'Threaded::notify' => ['bool'], -'Threaded::notifyOne' => ['bool'], -'Threaded::offsetExists' => ['bool', 'offset'=>'mixed'], -'Threaded::offsetGet' => ['mixed', 'offset'=>'mixed'], -'Threaded::offsetSet' => ['void', 'offset'=>'mixed', 'value'=>'mixed'], -'Threaded::offsetUnset' => ['void', 'offset'=>'mixed'], -'Threaded::pop' => ['bool'], -'Threaded::run' => ['void'], -'Threaded::shift' => ['mixed'], -'Threaded::synchronized' => ['mixed', 'block'=>'Closure', '...args='=>'mixed'], -'Threaded::unlock' => ['bool'], -'Threaded::wait' => ['bool', 'timeout='=>'int'], -'Throwable::__toString' => ['string'], -'Throwable::getCode' => ['mixed'], -'Throwable::getFile' => ['string'], -'Throwable::getLine' => ['int'], -'Throwable::getMessage' => ['string'], -'Throwable::getPrevious' => ['Throwable|null'], -'Throwable::getTrace' => ['array'], -'Throwable::getTraceAsString' => ['string'], -'tidy::__construct' => ['void', 'filename='=>'string', 'config='=>'', 'encoding='=>'string', 'use_include_path='=>'bool'], -'tidy::body' => ['tidyNode'], -'tidy::cleanRepair' => ['bool'], -'tidy::diagnose' => ['bool'], -'tidy::getConfig' => ['array'], -'tidy::getHtmlVer' => ['int'], -'tidy::getOpt' => ['', 'option'=>'string'], -'tidy::getOptDoc' => ['string', 'optname'=>'string'], -'tidy::getRelease' => ['string'], -'tidy::getStatus' => ['int'], -'tidy::head' => ['tidyNode'], -'tidy::html' => ['tidyNode'], -'tidy::htmlver' => ['int'], -'tidy::isXhtml' => ['bool'], -'tidy::isXml' => ['bool'], -'tidy::parseFile' => ['bool', 'filename'=>'string', 'config='=>'', 'encoding='=>'string', 'use_include_path='=>'bool'], -'tidy::parseString' => ['bool', 'input'=>'string', 'config='=>'', 'encoding='=>'string'], -'tidy::repairFile' => ['string', 'filename'=>'string', 'config='=>'', 'encoding='=>'string', 'use_include_path='=>'bool'], -'tidy::repairString' => ['string', 'data'=>'string', 'config='=>'', 'encoding='=>'string'], -'tidy::root' => ['tidyNode'], -'tidy_access_count' => ['int', 'obj'=>'tidy'], -'tidy_clean_repair' => ['bool', 'obj'=>'tidy'], -'tidy_config_count' => ['int', 'obj'=>'tidy'], -'tidy_diagnose' => ['bool', 'obj'=>'tidy'], -'tidy_error_count' => ['int', 'obj'=>'tidy'], -'tidy_get_body' => ['tidyNode', 'obj'=>'tidy'], -'tidy_get_config' => ['array', 'obj'=>'tidy'], -'tidy_get_error_buffer' => ['string', 'obj'=>'tidy'], -'tidy_get_head' => ['tidyNode', 'obj'=>'tidy'], -'tidy_get_html' => ['tidyNode', 'obj'=>'tidy'], -'tidy_get_html_ver' => ['int', 'obj'=>'tidy'], -'tidy_get_opt_doc' => ['string', 'obj'=>'tidy', 'optname'=>'string'], -'tidy_get_output' => ['string', 'obj'=>'tidy'], -'tidy_get_release' => ['string'], -'tidy_get_root' => ['tidyNode', 'obj'=>'tidy'], -'tidy_get_status' => ['int', 'obj'=>'tidy'], -'tidy_getopt' => ['', 'option'=>'string', 'obj'=>'tidy'], -'tidy_is_xhtml' => ['bool', 'obj'=>'tidy'], -'tidy_is_xml' => ['bool', 'obj'=>'tidy'], -'tidy_load_config' => ['void', 'filename'=>'string', 'encoding'=>'string'], -'tidy_parse_file' => ['tidy', 'file'=>'string', 'config_options='=>'', 'encoding='=>'string', 'use_include_path='=>'bool'], -'tidy_parse_string' => ['tidy', 'input'=>'string', 'config_options='=>'', 'encoding='=>'string'], -'tidy_repair_file' => ['string', 'filename'=>'string', 'config_file='=>'', 'encoding='=>'string', 'use_include_path='=>'bool'], -'tidy_repair_string' => ['string', 'data'=>'string', 'config_file='=>'', 'encoding='=>'string'], -'tidy_reset_config' => ['bool'], -'tidy_save_config' => ['bool', 'filename'=>'string'], -'tidy_set_encoding' => ['bool', 'encoding'=>'string'], -'tidy_setopt' => ['bool', 'option'=>'string', 'value'=>'mixed'], -'tidy_warning_count' => ['int', 'obj'=>'tidy'], -'tidyNode::__construct' => ['void'], -'tidyNode::getParent' => ['tidyNode'], -'tidyNode::hasChildren' => ['bool'], -'tidyNode::hasSiblings' => ['bool'], -'tidyNode::isAsp' => ['bool'], -'tidyNode::isComment' => ['bool'], -'tidyNode::isHtml' => ['bool'], -'tidyNode::isJste' => ['bool'], -'tidyNode::isPhp' => ['bool'], -'tidyNode::isText' => ['bool'], -'time' => ['int'], -'time_nanosleep' => ['array{0:int,1:int}|bool', 'seconds'=>'int', 'nanoseconds'=>'int'], -'time_sleep_until' => ['bool', 'timestamp'=>'float'], -'timezone_abbreviations_list' => ['array'], -'timezone_identifiers_list' => ['array', 'what='=>'int', 'country='=>'?string'], -'timezone_location_get' => ['array|false', 'object'=>'DateTimeZone'], -'timezone_name_from_abbr' => ['string|false', 'abbr'=>'string', 'gmtoffset='=>'int', 'isdst='=>'int'], -'timezone_name_get' => ['string', 'object'=>'DateTimeZone'], -'timezone_offset_get' => ['int', 'object'=>'DateTimeZone', 'datetime'=>'DateTime'], -'timezone_open' => ['DateTimeZone', 'timezone'=>'string'], -'timezone_transitions_get' => ['array|false', 'object'=>'DateTimeZone', 'timestamp_begin='=>'int', 'timestamp_end='=>'int'], -'timezone_version_get' => ['string'], -'tmpfile' => ['resource|false'], -'token_get_all' => ['array', 'source'=>'string', 'flags='=>'int'], -'token_name' => ['string', 'type'=>'int'], -'TokyoTyrant::__construct' => ['void', 'host='=>'string', 'port='=>'int', 'options='=>'array'], -'TokyoTyrant::add' => ['int|float', 'key'=>'string', 'increment'=>'float', 'type='=>'int'], -'TokyoTyrant::connect' => ['TokyoTyrant', 'host'=>'string', 'port='=>'int', 'options='=>'array'], -'TokyoTyrant::connectUri' => ['TokyoTyrant', 'uri'=>'string'], -'TokyoTyrant::copy' => ['TokyoTyrant', 'path'=>'string'], -'TokyoTyrant::ext' => ['string', 'name'=>'string', 'options'=>'int', 'key'=>'string', 'value'=>'string'], -'TokyoTyrant::fwmKeys' => ['array', 'prefix'=>'string', 'max_recs'=>'int'], -'TokyoTyrant::get' => ['array', 'keys'=>'mixed'], -'TokyoTyrant::getIterator' => ['TokyoTyrantIterator'], -'TokyoTyrant::num' => ['int'], -'TokyoTyrant::out' => ['string', 'keys'=>'mixed'], -'TokyoTyrant::put' => ['TokyoTyrant', 'keys'=>'mixed', 'value='=>'string'], -'TokyoTyrant::putCat' => ['TokyoTyrant', 'keys'=>'mixed', 'value='=>'string'], -'TokyoTyrant::putKeep' => ['TokyoTyrant', 'keys'=>'mixed', 'value='=>'string'], -'TokyoTyrant::putNr' => ['TokyoTyrant', 'keys'=>'mixed', 'value='=>'string'], -'TokyoTyrant::putShl' => ['mixed', 'key'=>'string', 'value'=>'string', 'width'=>'int'], -'TokyoTyrant::restore' => ['mixed', 'log_dir'=>'string', 'timestamp'=>'int', 'check_consistency='=>'bool'], -'TokyoTyrant::setMaster' => ['mixed', 'host'=>'string', 'port'=>'int', 'timestamp'=>'int', 'check_consistency='=>'bool'], -'TokyoTyrant::size' => ['int', 'key'=>'string'], -'TokyoTyrant::stat' => ['array'], -'TokyoTyrant::sync' => ['mixed'], -'TokyoTyrant::tune' => ['TokyoTyrant', 'timeout'=>'float', 'options='=>'int'], -'TokyoTyrant::vanish' => ['mixed'], -'TokyoTyrantIterator::__construct' => ['void', 'object'=>'mixed'], -'TokyoTyrantIterator::current' => ['mixed'], -'TokyoTyrantIterator::key' => ['mixed'], -'TokyoTyrantIterator::next' => ['mixed'], -'TokyoTyrantIterator::rewind' => ['void'], -'TokyoTyrantIterator::valid' => ['bool'], -'TokyoTyrantQuery::__construct' => ['void', 'table'=>'TokyoTyrantTable'], -'TokyoTyrantQuery::addCond' => ['mixed', 'name'=>'string', 'op'=>'int', 'expr'=>'string'], -'TokyoTyrantQuery::count' => ['int'], -'TokyoTyrantQuery::current' => ['array'], -'TokyoTyrantQuery::hint' => ['string'], -'TokyoTyrantQuery::key' => ['string'], -'TokyoTyrantQuery::metaSearch' => ['array', 'queries'=>'array', 'type'=>'int'], -'TokyoTyrantQuery::next' => ['array'], -'TokyoTyrantQuery::out' => ['TokyoTyrantQuery'], -'TokyoTyrantQuery::rewind' => ['bool'], -'TokyoTyrantQuery::search' => ['array'], -'TokyoTyrantQuery::setLimit' => ['mixed', 'max='=>'int', 'skip='=>'int'], -'TokyoTyrantQuery::setOrder' => ['mixed', 'name'=>'string', 'type'=>'int'], -'TokyoTyrantQuery::valid' => ['bool'], -'TokyoTyrantTable::add' => ['void', 'key'=>'string', 'increment'=>'mixed', 'type='=>'string'], -'TokyoTyrantTable::genUid' => ['int'], -'TokyoTyrantTable::get' => ['array', 'keys'=>'mixed'], -'TokyoTyrantTable::getIterator' => ['TokyoTyrantIterator'], -'TokyoTyrantTable::getQuery' => ['TokyoTyrantQuery'], -'TokyoTyrantTable::out' => ['void', 'keys'=>'mixed'], -'TokyoTyrantTable::put' => ['int', 'key'=>'string', 'columns'=>'array'], -'TokyoTyrantTable::putCat' => ['void', 'key'=>'string', 'columns'=>'array'], -'TokyoTyrantTable::putKeep' => ['void', 'key'=>'string', 'columns'=>'array'], -'TokyoTyrantTable::putNr' => ['void', 'keys'=>'mixed', 'value='=>'string'], -'TokyoTyrantTable::putShl' => ['void', 'key'=>'string', 'value'=>'string', 'width'=>'int'], -'TokyoTyrantTable::setIndex' => ['mixed', 'column'=>'string', 'type'=>'int'], -'touch' => ['bool', 'filename'=>'string', 'time='=>'int', 'atime='=>'int'], -'trader_acos' => ['array', 'real'=>'array'], -'trader_ad' => ['array', 'high'=>'array', 'low'=>'array', 'close'=>'array', 'volume'=>'array'], -'trader_add' => ['array', 'real0'=>'array', 'real1'=>'array'], -'trader_adosc' => ['array', 'high'=>'array', 'low'=>'array', 'close'=>'array', 'volume'=>'array', 'fastPeriod='=>'int', 'slowPeriod='=>'int'], -'trader_adx' => ['array', 'high'=>'array', 'low'=>'array', 'close'=>'array', 'timePeriod='=>'int'], -'trader_adxr' => ['array', 'high'=>'array', 'low'=>'array', 'close'=>'array', 'timePeriod='=>'int'], -'trader_apo' => ['array', 'real'=>'array', 'fastPeriod='=>'int', 'slowPeriod='=>'int', 'mAType='=>'int'], -'trader_aroon' => ['array', 'high'=>'array', 'low'=>'array', 'timePeriod='=>'int'], -'trader_aroonosc' => ['array', 'high'=>'array', 'low'=>'array', 'timePeriod='=>'int'], -'trader_asin' => ['array', 'real'=>'array'], -'trader_atan' => ['array', 'real'=>'array'], -'trader_atr' => ['array', 'high'=>'array', 'low'=>'array', 'close'=>'array', 'timePeriod='=>'int'], -'trader_avgprice' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_bbands' => ['array', 'real'=>'array', 'timePeriod='=>'int', 'nbDevUp='=>'float', 'nbDevDn='=>'float', 'mAType='=>'int'], -'trader_beta' => ['array', 'real0'=>'array', 'real1'=>'array', 'timePeriod='=>'int'], -'trader_bop' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cci' => ['array', 'high'=>'array', 'low'=>'array', 'close'=>'array', 'timePeriod='=>'int'], -'trader_cdl2crows' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdl3blackcrows' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdl3inside' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdl3linestrike' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdl3outside' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdl3starsinsouth' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdl3whitesoldiers' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdlabandonedbaby' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array', 'penetration='=>'float'], -'trader_cdladvanceblock' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdlbelthold' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdlbreakaway' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdlclosingmarubozu' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdlconcealbabyswall' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdlcounterattack' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdldarkcloudcover' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array', 'penetration='=>'float'], -'trader_cdldoji' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdldojistar' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdldragonflydoji' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdlengulfing' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdleveningdojistar' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array', 'penetration='=>'float'], -'trader_cdleveningstar' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array', 'penetration='=>'float'], -'trader_cdlgapsidesidewhite' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdlgravestonedoji' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdlhammer' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdlhangingman' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdlharami' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdlharamicross' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdlhighwave' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdlhikkake' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdlhikkakemod' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdlhomingpigeon' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdlidentical3crows' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdlinneck' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdlinvertedhammer' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdlkicking' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdlkickingbylength' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdlladderbottom' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdllongleggeddoji' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdllongline' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdlmarubozu' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdlmatchinglow' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdlmathold' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array', 'penetration='=>'float'], -'trader_cdlmorningdojistar' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array', 'penetration='=>'float'], -'trader_cdlmorningstar' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array', 'penetration='=>'float'], -'trader_cdlonneck' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdlpiercing' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdlrickshawman' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdlrisefall3methods' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdlseparatinglines' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdlshootingstar' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdlshortline' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdlspinningtop' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdlstalledpattern' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdlsticksandwich' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdltakuri' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdltasukigap' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdlthrusting' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdltristar' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdlunique3river' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdlupsidegap2crows' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_cdlxsidegap3methods' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_ceil' => ['array', 'real'=>'array'], -'trader_cmo' => ['array', 'real'=>'array', 'timePeriod='=>'int'], -'trader_correl' => ['array', 'real0'=>'array', 'real1'=>'array', 'timePeriod='=>'int'], -'trader_cos' => ['array', 'real'=>'array'], -'trader_cosh' => ['array', 'real'=>'array'], -'trader_dema' => ['array', 'real'=>'array', 'timePeriod='=>'int'], -'trader_div' => ['array', 'real0'=>'array', 'real1'=>'array'], -'trader_dx' => ['array', 'high'=>'array', 'low'=>'array', 'close'=>'array', 'timePeriod='=>'int'], -'trader_ema' => ['array', 'real'=>'array', 'timePeriod='=>'int'], -'trader_errno' => ['int'], -'trader_exp' => ['array', 'real'=>'array'], -'trader_floor' => ['array', 'real'=>'array'], -'trader_get_compat' => ['int'], -'trader_get_unstable_period' => ['int', 'functionId'=>'int'], -'trader_ht_dcperiod' => ['array', 'real'=>'array'], -'trader_ht_dcphase' => ['array', 'real'=>'array'], -'trader_ht_phasor' => ['array', 'real'=>'array'], -'trader_ht_sine' => ['array', 'real'=>'array'], -'trader_ht_trendline' => ['array', 'real'=>'array'], -'trader_ht_trendmode' => ['array', 'real'=>'array'], -'trader_kama' => ['array', 'real'=>'array', 'timePeriod='=>'int'], -'trader_linearreg' => ['array', 'real'=>'array', 'timePeriod='=>'int'], -'trader_linearreg_angle' => ['array', 'real'=>'array', 'timePeriod='=>'int'], -'trader_linearreg_intercept' => ['array', 'real'=>'array', 'timePeriod='=>'int'], -'trader_linearreg_slope' => ['array', 'real'=>'array', 'timePeriod='=>'int'], -'trader_ln' => ['array', 'real'=>'array'], -'trader_log10' => ['array', 'real'=>'array'], -'trader_ma' => ['array', 'real'=>'array', 'timePeriod='=>'int', 'mAType='=>'int'], -'trader_macd' => ['array', 'real'=>'array', 'fastPeriod='=>'int', 'slowPeriod='=>'int', 'signalPeriod='=>'int'], -'trader_macdext' => ['array', 'real'=>'array', 'fastPeriod='=>'int', 'fastMAType='=>'int', 'slowPeriod='=>'int', 'slowMAType='=>'int', 'signalPeriod='=>'int', 'signalMAType='=>'int'], -'trader_macdfix' => ['array', 'real'=>'array', 'signalPeriod='=>'int'], -'trader_mama' => ['array', 'real'=>'array', 'fastLimit='=>'float', 'slowLimit='=>'float'], -'trader_mavp' => ['array', 'real'=>'array', 'periods'=>'array', 'minPeriod='=>'int', 'maxPeriod='=>'int', 'mAType='=>'int'], -'trader_max' => ['array', 'real'=>'array', 'timePeriod='=>'int'], -'trader_maxindex' => ['array', 'real'=>'array', 'timePeriod='=>'int'], -'trader_medprice' => ['array', 'high'=>'array', 'low'=>'array'], -'trader_mfi' => ['array', 'high'=>'array', 'low'=>'array', 'close'=>'array', 'volume'=>'array', 'timePeriod='=>'int'], -'trader_midpoint' => ['array', 'real'=>'array', 'timePeriod='=>'int'], -'trader_midprice' => ['array', 'high'=>'array', 'low'=>'array', 'timePeriod='=>'int'], -'trader_min' => ['array', 'real'=>'array', 'timePeriod='=>'int'], -'trader_minindex' => ['array', 'real'=>'array', 'timePeriod='=>'int'], -'trader_minmax' => ['array', 'real'=>'array', 'timePeriod='=>'int'], -'trader_minmaxindex' => ['array', 'real'=>'array', 'timePeriod='=>'int'], -'trader_minus_di' => ['array', 'high'=>'array', 'low'=>'array', 'close'=>'array', 'timePeriod='=>'int'], -'trader_minus_dm' => ['array', 'high'=>'array', 'low'=>'array', 'timePeriod='=>'int'], -'trader_mom' => ['array', 'real'=>'array', 'timePeriod='=>'int'], -'trader_mult' => ['array', 'real0'=>'array', 'real1'=>'array'], -'trader_natr' => ['array', 'high'=>'array', 'low'=>'array', 'close'=>'array', 'timePeriod='=>'int'], -'trader_obv' => ['array', 'real'=>'array', 'volume'=>'array'], -'trader_plus_di' => ['array', 'high'=>'array', 'low'=>'array', 'close'=>'array', 'timePeriod='=>'int'], -'trader_plus_dm' => ['array', 'high'=>'array', 'low'=>'array', 'timePeriod='=>'int'], -'trader_ppo' => ['array', 'real'=>'array', 'fastPeriod='=>'int', 'slowPeriod='=>'int', 'mAType='=>'int'], -'trader_roc' => ['array', 'real'=>'array', 'timePeriod='=>'int'], -'trader_rocp' => ['array', 'real'=>'array', 'timePeriod='=>'int'], -'trader_rocr' => ['array', 'real'=>'array', 'timePeriod='=>'int'], -'trader_rocr100' => ['array', 'real'=>'array', 'timePeriod='=>'int'], -'trader_rsi' => ['array', 'real'=>'array', 'timePeriod='=>'int'], -'trader_sar' => ['array', 'high'=>'array', 'low'=>'array', 'acceleration='=>'float', 'maximum='=>'float'], -'trader_sarext' => ['array', 'high'=>'array', 'low'=>'array', 'startValue='=>'float', 'offsetOnReverse='=>'float', 'accelerationInitLong='=>'float', 'accelerationLong='=>'float', 'accelerationMaxLong='=>'float', 'accelerationInitShort='=>'float', 'accelerationShort='=>'float', 'accelerationMaxShort='=>'float'], -'trader_set_compat' => ['void', 'compatId'=>'int'], -'trader_set_unstable_period' => ['void', 'functionId'=>'int', 'timePeriod'=>'int'], -'trader_sin' => ['array', 'real'=>'array'], -'trader_sinh' => ['array', 'real'=>'array'], -'trader_sma' => ['array', 'real'=>'array', 'timePeriod='=>'int'], -'trader_sqrt' => ['array', 'real'=>'array'], -'trader_stddev' => ['array', 'real'=>'array', 'timePeriod='=>'int', 'nbDev='=>'float'], -'trader_stoch' => ['array', 'high'=>'array', 'low'=>'array', 'close'=>'array', 'fastK_Period='=>'int', 'slowK_Period='=>'int', 'slowK_MAType='=>'int', 'slowD_Period='=>'int', 'slowD_MAType='=>'int'], -'trader_stochf' => ['array', 'high'=>'array', 'low'=>'array', 'close'=>'array', 'fastK_Period='=>'int', 'fastD_Period='=>'int', 'fastD_MAType='=>'int'], -'trader_stochrsi' => ['array', 'real'=>'array', 'timePeriod='=>'int', 'fastK_Period='=>'int', 'fastD_Period='=>'int', 'fastD_MAType='=>'int'], -'trader_sub' => ['array', 'real0'=>'array', 'real1'=>'array'], -'trader_sum' => ['array', 'real'=>'array', 'timePeriod='=>'int'], -'trader_t3' => ['array', 'real'=>'array', 'timePeriod='=>'int', 'vFactor='=>'float'], -'trader_tan' => ['array', 'real'=>'array'], -'trader_tanh' => ['array', 'real'=>'array'], -'trader_tema' => ['array', 'real'=>'array', 'timePeriod='=>'int'], -'trader_trange' => ['array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_trima' => ['array', 'real'=>'array', 'timePeriod='=>'int'], -'trader_trix' => ['array', 'real'=>'array', 'timePeriod='=>'int'], -'trader_tsf' => ['array', 'real'=>'array', 'timePeriod='=>'int'], -'trader_typprice' => ['array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_ultosc' => ['array', 'high'=>'array', 'low'=>'array', 'close'=>'array', 'timePeriod1='=>'int', 'timePeriod2='=>'int', 'timePeriod3='=>'int'], -'trader_var' => ['array', 'real'=>'array', 'timePeriod='=>'int', 'nbDev='=>'float'], -'trader_wclprice' => ['array', 'high'=>'array', 'low'=>'array', 'close'=>'array'], -'trader_willr' => ['array', 'high'=>'array', 'low'=>'array', 'close'=>'array', 'timePeriod='=>'int'], -'trader_wma' => ['array', 'real'=>'array', 'timePeriod='=>'int'], -'trait_exists' => ['bool', 'traitname'=>'string', 'autoload='=>'bool'], -'Transliterator::create' => ['?Transliterator', 'id'=>'string', 'direction='=>'int'], -'Transliterator::createFromRules' => ['?Transliterator', 'rules'=>'string', 'direction='=>'int'], -'Transliterator::createInverse' => ['Transliterator'], -'Transliterator::getErrorCode' => ['int'], -'Transliterator::getErrorMessage' => ['string'], -'Transliterator::listIDs' => ['array'], -'Transliterator::transliterate' => ['string|false', 'subject'=>'string', 'start='=>'int', 'end='=>'int'], -'transliterator_create' => ['?Transliterator', 'id'=>'string', 'direction='=>'int'], -'transliterator_create_from_rules' => ['?Transliterator', 'rules'=>'string', 'direction='=>'int'], -'transliterator_create_inverse' => ['Transliterator', 'obj'=>'Transliterator'], -'transliterator_get_error_code' => ['int', 'obj'=>'Transliterator'], -'transliterator_get_error_message' => ['string', 'obj'=>'Transliterator'], -'transliterator_list_ids' => ['array'], -'transliterator_transliterate' => ['string|false', 'obj'=>'Transliterator|string', 'subject'=>'string', 'start='=>'int', 'end='=>'int'], -'trigger_error' => ['bool', 'message'=>'string', 'error_type='=>'int'], -'trim' => ['string', 'str'=>'string', 'character_mask='=>'string'], -'TypeError::__clone' => ['void'], -'TypeError::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'(?Throwable)|(?TypeError)'], -'TypeError::__toString' => ['string'], -'TypeError::getCode' => ['int'], -'TypeError::getFile' => ['string'], -'TypeError::getLine' => ['int'], -'TypeError::getMessage' => ['string'], -'TypeError::getPrevious' => ['Throwable|TypeError|null'], -'TypeError::getTrace' => ['array'], -'TypeError::getTraceAsString' => ['string'], -'uasort' => ['bool', '&rw_array_arg'=>'array', 'cmp_function'=>'callable(mixed,mixed):int'], -'ucfirst' => ['string', 'str'=>'string'], -'UConverter::__construct' => ['void', 'destination_encoding'=>'string', 'source_encoding='=>'string'], -'UConverter::convert' => ['string', 'str'=>'string', 'reverse='=>'bool'], -'UConverter::fromUCallback' => ['mixed', 'reason'=>'int', 'source'=>'string', 'codePoint'=>'string', '&w_error'=>'int'], -'UConverter::getAliases' => ['array', 'name='=>'string'], -'UConverter::getAvailable' => ['array'], -'UConverter::getDestinationEncoding' => ['string'], -'UConverter::getDestinationType' => ['int'], -'UConverter::getErrorCode' => ['int'], -'UConverter::getErrorMessage' => ['string'], -'UConverter::getSourceEncoding' => ['string'], -'UConverter::getSourceType' => ['int'], -'UConverter::getStandards' => ['array'], -'UConverter::getSubstChars' => ['string'], -'UConverter::reasonText' => ['string', 'reason='=>'int'], -'UConverter::setDestinationEncoding' => ['bool', 'encoding'=>'string'], -'UConverter::setSourceEncoding' => ['bool', 'encoding'=>'string'], -'UConverter::setSubstChars' => ['bool', 'chars'=>'string'], -'UConverter::toUCallback' => ['mixed', 'reason'=>'int', 'source'=>'string', 'codeUnits'=>'string', '&w_error'=>'int'], -'UConverter::transcode' => ['string', 'str'=>'string', 'toEncoding'=>'string', 'fromEncoding'=>'string', 'options='=>'array'], -'ucwords' => ['string', 'str'=>'string', 'delims='=>'string'], -'udm_add_search_limit' => ['bool', 'agent'=>'resource', 'var'=>'int', 'val'=>'string'], -'udm_alloc_agent' => ['resource', 'dbaddr'=>'string', 'dbmode='=>'string'], -'udm_alloc_agent_array' => ['resource', 'databases'=>'array'], -'udm_api_version' => ['int'], -'udm_cat_list' => ['array', 'agent'=>'resource', 'category'=>'string'], -'udm_cat_path' => ['array', 'agent'=>'resource', 'category'=>'string'], -'udm_check_charset' => ['bool', 'agent'=>'resource', 'charset'=>'string'], -'udm_check_stored' => ['int', 'agent'=>'', 'link'=>'int', 'doc_id'=>'string'], -'udm_clear_search_limits' => ['bool', 'agent'=>'resource'], -'udm_close_stored' => ['int', 'agent'=>'', 'link'=>'int'], -'udm_crc32' => ['int', 'agent'=>'resource', 'str'=>'string'], -'udm_errno' => ['int', 'agent'=>'resource'], -'udm_error' => ['string', 'agent'=>'resource'], -'udm_find' => ['resource', 'agent'=>'resource', 'query'=>'string'], -'udm_free_agent' => ['int', 'agent'=>'resource'], -'udm_free_ispell_data' => ['bool', 'agent'=>'int'], -'udm_free_res' => ['bool', 'res'=>'resource'], -'udm_get_doc_count' => ['int', 'agent'=>'resource'], -'udm_get_res_field' => ['string', 'res'=>'resource', 'row'=>'int', 'field'=>'int'], -'udm_get_res_param' => ['string', 'res'=>'resource', 'param'=>'int'], -'udm_hash32' => ['int', 'agent'=>'resource', 'str'=>'string'], -'udm_load_ispell_data' => ['bool', 'agent'=>'resource', 'var'=>'int', 'val1'=>'string', 'val2'=>'string', 'flag'=>'int'], -'udm_open_stored' => ['int', 'agent'=>'', 'storedaddr'=>'string'], -'udm_set_agent_param' => ['bool', 'agent'=>'resource', 'var'=>'int', 'val'=>'string'], -'ui\draw\text\font\fontfamilies' => ['array'], -'ui\quit' => ['void'], -'ui\run' => ['void', 'flags='=>'int'], -'uksort' => ['bool', '&rw_array_arg'=>'array', 'cmp_function'=>'callable(mixed,mixed):int'], -'umask' => ['int', 'mask='=>'int'], -'UnderflowException::__clone' => ['void'], -'UnderflowException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'(?Throwable)|(?UnderflowException)'], -'UnderflowException::__toString' => ['string'], -'UnderflowException::getCode' => ['int'], -'UnderflowException::getFile' => ['string'], -'UnderflowException::getLine' => ['int'], -'UnderflowException::getMessage' => ['string'], -'UnderflowException::getPrevious' => ['Throwable|UnderflowException|null'], -'UnderflowException::getTrace' => ['array'], -'UnderflowException::getTraceAsString' => ['string'], -'UnexpectedValueException::__clone' => ['void'], -'UnexpectedValueException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'(?Throwable)|(?UnexpectedValueException)'], -'UnexpectedValueException::__toString' => ['string'], -'UnexpectedValueException::getCode' => ['int'], -'UnexpectedValueException::getFile' => ['string'], -'UnexpectedValueException::getLine' => ['int'], -'UnexpectedValueException::getMessage' => ['string'], -'UnexpectedValueException::getPrevious' => ['Throwable|UnexpectedValueException|null'], -'UnexpectedValueException::getTrace' => ['array'], -'UnexpectedValueException::getTraceAsString' => ['string'], -'uniqid' => ['string', 'prefix='=>'string', 'more_entropy='=>'bool'], -'unixtojd' => ['int', 'timestamp='=>'int'], -'unlink' => ['bool', 'filename'=>'string', 'context='=>'resource'], -'unpack' => ['array', 'format'=>'string', 'data'=>'string', 'offset='=>'int'], -'unregister_tick_function' => ['void', 'function_name'=>'string'], -'unserialize' => ['mixed', 'variable_representation'=>'string', 'allowed_classes='=>'array{allowed_classes?:string[]|bool}'], -'unset' => ['void', 'var='=>'mixed', '...args='=>'mixed'], -'untaint' => ['bool', '&rw_string'=>'string', '&...rw_strings='=>'string'], -'uopz_allow_exit' => ['void', 'allow'=>'bool'], -'uopz_backup' => ['void', 'class'=>'string', 'function'=>'string'], -'uopz_backup\'1' => ['void', 'function'=>'string'], -'uopz_compose' => ['void', 'name'=>'string', 'classes'=>'array', 'methods='=>'array', 'properties='=>'array', 'flags='=>'int'], -'uopz_copy' => ['Closure', 'class'=>'string', 'function'=>'string'], -'uopz_copy\'1' => ['Closure', 'function'=>'string'], -'uopz_delete' => ['void', 'class'=>'string', 'function'=>'string'], -'uopz_delete\'1' => ['void', 'function'=>'string'], -'uopz_extend' => ['void', 'class'=>'string', 'parent'=>'string'], -'uopz_flags' => ['int', 'class'=>'string', 'function'=>'string', 'flags'=>'int'], -'uopz_flags\'1' => ['int', 'function'=>'string', 'flags'=>'int'], -'uopz_function' => ['void', 'class'=>'string', 'function'=>'string', 'handler'=>'Closure', 'modifiers='=>'int'], -'uopz_function\'1' => ['void', 'function'=>'string', 'handler'=>'Closure', 'modifiers='=>'int'], -'uopz_get_exit_status' => ['mixed'], -'uopz_get_mock' => ['mixed', 'class'=>'string'], -'uopz_get_return' => ['mixed', 'class='=>'string', 'function'=>'string'], -'uopz_implement' => ['void', 'class'=>'string', 'interface'=>'string'], -'uopz_overload' => ['void', 'opcode'=>'int', 'callable'=>'Callable'], -'uopz_redefine' => ['void', 'class'=>'string', 'constant'=>'string', 'value'=>'mixed'], -'uopz_redefine\'1' => ['void', 'constant'=>'string', 'value'=>'mixed'], -'uopz_rename' => ['void', 'class'=>'string', 'function'=>'string', 'rename'=>'string'], -'uopz_rename\'1' => ['void', 'function'=>'string', 'rename'=>'string'], -'uopz_restore' => ['void', 'class'=>'string', 'function'=>'string'], -'uopz_restore\'1' => ['void', 'function'=>'string'], -'uopz_set_mock' => ['void', 'class'=>'string', 'mock'=>'object|string'], -'uopz_set_return' => ['bool', 'class='=>'string', 'function'=>'string', 'value'=>'mixed', 'execute='=>'bool'], -'uopz_set_return\'1' => ['bool', 'function'=>'string', 'value'=>'mixed', 'execute='=>'bool'], -'uopz_undefine' => ['void', 'class'=>'string', 'constant'=>'string'], -'uopz_undefine\'1' => ['void', 'constant'=>'string'], -'uopz_unset_mock' => ['void', 'class'=>'string'], -'uopz_unset_return' => ['bool', 'class='=>'string', 'function'=>'string'], -'uopz_unset_return\'1' => ['bool', 'function'=>'string'], -'urldecode' => ['string', 'str'=>'string'], -'urlencode' => ['string', 'str'=>'string'], -'use_soap_error_handler' => ['bool', 'handler='=>'bool'], -'usleep' => ['void', 'micro_seconds'=>'int'], -'usort' => ['bool', '&rw_array_arg'=>'array', 'cmp_function'=>'callable(mixed,mixed):int'], -'utf8_decode' => ['string', 'data'=>'string'], -'utf8_encode' => ['string', 'data'=>'string'], -'V8Js::__construct' => ['void', 'object_name='=>'string', 'variables='=>'array', 'extensions='=>'array', 'report_uncaught_exceptions='=>'bool', 'snapshot_blob='=>'string'], -'V8Js::clearPendingException' => [''], -'V8Js::compileString' => ['resource', 'script'=>'', 'identifier='=>'string'], -'V8Js::createSnapshot' => ['false|string', 'embed_source'=>'string'], -'V8Js::executeScript' => ['', 'script'=>'resource', 'flags='=>'int', 'time_limit='=>'int', 'memory_limit='=>'int'], -'V8Js::executeString' => ['mixed', 'script'=>'string', 'identifier='=>'string', 'flags='=>'int'], -'V8Js::getExtensions' => ['array'], -'V8Js::getPendingException' => ['V8JsException'], -'V8Js::registerExtension' => ['bool', 'extension_name'=>'string', 'script'=>'string', 'dependencies='=>'array', 'auto_enable='=>'bool'], -'V8Js::setAverageObjectSize' => ['', 'average_object_size'=>'int'], -'V8Js::setMemoryLimit' => ['', 'limit'=>'int'], -'V8Js::setModuleLoader' => ['', 'loader'=>'callable'], -'V8Js::setModuleNormaliser' => ['', 'normaliser'=>'callable'], -'V8Js::setTimeLimit' => ['', 'limit'=>'int'], -'V8JsException::getJsFileName' => ['string'], -'V8JsException::getJsLineNumber' => ['int'], -'V8JsException::getJsSourceLine' => ['int'], -'V8JsException::getJsTrace' => ['string'], -'V8JsScriptException::__clone' => ['void'], -'V8JsScriptException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'(?Exception)|(?Throwable)'], -'V8JsScriptException::__toString' => ['string'], -'V8JsScriptException::__wakeup' => ['void'], -'V8JsScriptException::getCode' => ['int'], -'V8JsScriptException::getFile' => ['string'], -'V8JsScriptException::getJsEndColumn' => ['int'], -'V8JsScriptException::getJsFileName' => ['string'], -'V8JsScriptException::getJsLineNumber' => ['int'], -'V8JsScriptException::getJsSourceLine' => ['string'], -'V8JsScriptException::getJsStartColumn' => ['int'], -'V8JsScriptException::getJsTrace' => ['string'], -'V8JsScriptException::getLine' => ['int'], -'V8JsScriptException::getMessage' => ['string'], -'V8JsScriptException::getPrevious' => ['Exception|Throwable'], -'V8JsScriptException::getTrace' => ['array'], -'V8JsScriptException::getTraceAsString' => ['string'], -'var_dump' => ['void', 'var'=>'mixed', '...args='=>'mixed'], -'var_export' => ['string|null', 'var'=>'mixed', 'return='=>'bool'], -'VARIANT::__construct' => ['void', 'value='=>'mixed', 'type='=>'int', 'codepage='=>'int'], -'variant_abs' => ['mixed', 'left'=>'mixed'], -'variant_add' => ['mixed', 'left'=>'mixed', 'right'=>'mixed'], -'variant_and' => ['mixed', 'left'=>'mixed', 'right'=>'mixed'], -'variant_cast' => ['object', 'variant'=>'object', 'type'=>'int'], -'variant_cat' => ['mixed', 'left'=>'mixed', 'right'=>'mixed'], -'variant_cmp' => ['int', 'left'=>'mixed', 'right'=>'mixed', 'lcid='=>'int', 'flags='=>'int'], -'variant_date_from_timestamp' => ['object', 'timestamp'=>'int'], -'variant_date_to_timestamp' => ['int', 'variant'=>'object'], -'variant_div' => ['mixed', 'left'=>'mixed', 'right'=>'mixed'], -'variant_eqv' => ['mixed', 'left'=>'mixed', 'right'=>'mixed'], -'variant_fix' => ['mixed', 'left'=>'mixed'], -'variant_get_type' => ['int', 'variant'=>'object'], -'variant_idiv' => ['mixed', 'left'=>'mixed', 'right'=>'mixed'], -'variant_imp' => ['mixed', 'left'=>'mixed', 'right'=>'mixed'], -'variant_int' => ['mixed', 'left'=>'mixed'], -'variant_mod' => ['mixed', 'left'=>'mixed', 'right'=>'mixed'], -'variant_mul' => ['mixed', 'left'=>'mixed', 'right'=>'mixed'], -'variant_neg' => ['mixed', 'left'=>'mixed'], -'variant_not' => ['mixed', 'left'=>'mixed'], -'variant_or' => ['mixed', 'left'=>'mixed', 'right'=>'mixed'], -'variant_pow' => ['mixed', 'left'=>'mixed', 'right'=>'mixed'], -'variant_round' => ['mixed', 'left'=>'mixed', 'decimals'=>'int'], -'variant_set' => ['void', 'variant'=>'object', 'value'=>'mixed'], -'variant_set_type' => ['void', 'variant'=>'object', 'type'=>'int'], -'variant_sub' => ['mixed', 'left'=>'mixed', 'right'=>'mixed'], -'variant_xor' => ['mixed', 'left'=>'mixed', 'right'=>'mixed'], -'VarnishAdmin::__construct' => ['void', 'args='=>'array'], -'VarnishAdmin::auth' => ['bool'], -'VarnishAdmin::ban' => ['int', 'vcl_regex'=>'string'], -'VarnishAdmin::banUrl' => ['int', 'vcl_regex'=>'string'], -'VarnishAdmin::clearPanic' => ['int'], -'VarnishAdmin::connect' => ['bool'], -'VarnishAdmin::disconnect' => ['bool'], -'VarnishAdmin::getPanic' => ['string'], -'VarnishAdmin::getParams' => ['array'], -'VarnishAdmin::isRunning' => ['bool'], -'VarnishAdmin::setCompat' => ['void', 'compat'=>'int'], -'VarnishAdmin::setHost' => ['void', 'host'=>'string'], -'VarnishAdmin::setIdent' => ['void', 'ident'=>'string'], -'VarnishAdmin::setParam' => ['int', 'name'=>'string', 'value'=>'string|int'], -'VarnishAdmin::setPort' => ['void', 'port'=>'int'], -'VarnishAdmin::setSecret' => ['void', 'secret'=>'string'], -'VarnishAdmin::setTimeout' => ['void', 'timeout'=>'int'], -'VarnishAdmin::start' => ['int'], -'VarnishAdmin::stop' => ['int'], -'VarnishLog::__construct' => ['void', 'args='=>'array'], -'VarnishLog::getLine' => ['array'], -'VarnishLog::getTagName' => ['string', 'index'=>'int'], -'VarnishStat::__construct' => ['void', 'args='=>'array'], -'VarnishStat::getSnapshot' => ['array'], -'version_compare' => ['int', 'version1'=>'string', 'version2'=>'string'], -'version_compare\'1' => ['bool', 'version1'=>'string', 'version2'=>'string', 'operator'=>'string'], -'vfprintf' => ['int', 'stream'=>'resource', 'format'=>'string', 'args'=>'array'], -'virtual' => ['bool', 'uri'=>'string'], -'vpopmail_add_alias_domain' => ['bool', 'domain'=>'string', 'aliasdomain'=>'string'], -'vpopmail_add_alias_domain_ex' => ['bool', 'olddomain'=>'string', 'newdomain'=>'string'], -'vpopmail_add_domain' => ['bool', 'domain'=>'string', 'dir'=>'string', 'uid'=>'int', 'gid'=>'int'], -'vpopmail_add_domain_ex' => ['bool', 'domain'=>'string', 'passwd'=>'string', 'quota='=>'string', 'bounce='=>'string', 'apop='=>'bool'], -'vpopmail_add_user' => ['bool', 'user'=>'string', 'domain'=>'string', 'password'=>'string', 'gecos='=>'string', 'apop='=>'bool'], -'vpopmail_alias_add' => ['bool', 'user'=>'string', 'domain'=>'string', 'alias'=>'string'], -'vpopmail_alias_del' => ['bool', 'user'=>'string', 'domain'=>'string'], -'vpopmail_alias_del_domain' => ['bool', 'domain'=>'string'], -'vpopmail_alias_get' => ['array', 'alias'=>'string', 'domain'=>'string'], -'vpopmail_alias_get_all' => ['array', 'domain'=>'string'], -'vpopmail_auth_user' => ['bool', 'user'=>'string', 'domain'=>'string', 'password'=>'string', 'apop='=>'string'], -'vpopmail_del_domain' => ['bool', 'domain'=>'string'], -'vpopmail_del_domain_ex' => ['bool', 'domain'=>'string'], -'vpopmail_del_user' => ['bool', 'user'=>'string', 'domain'=>'string'], -'vpopmail_error' => ['string'], -'vpopmail_passwd' => ['bool', 'user'=>'string', 'domain'=>'string', 'password'=>'string', 'apop='=>'bool'], -'vpopmail_set_user_quota' => ['bool', 'user'=>'string', 'domain'=>'string', 'quota'=>'string'], -'vprintf' => ['int', 'format'=>'string', 'args'=>'array'], -'vsprintf' => ['string', 'format'=>'string', 'args'=>'array'], -'w32api_deftype' => ['bool', 'typename'=>'string', 'member1_type'=>'string', 'member1_name'=>'string', '...args='=>'string'], -'w32api_init_dtype' => ['resource', 'typename'=>'string', 'value'=>'', '...args='=>''], -'w32api_invoke_function' => ['', 'funcname'=>'string', 'argument'=>'', '...args='=>''], -'w32api_register_function' => ['bool', 'library'=>'string', 'function_name'=>'string', 'return_type'=>'string'], -'w32api_set_call_method' => ['', 'method'=>'int'], -'wddx_add_vars' => ['bool', 'packet_id'=>'resource', 'var_names'=>'mixed', '...vars='=>'mixed'], -'wddx_deserialize' => ['mixed', 'packet'=>'string'], -'wddx_packet_end' => ['string', 'packet_id'=>'resource'], -'wddx_packet_start' => ['resource', 'comment='=>'string'], -'wddx_serialize_value' => ['string', 'var'=>'mixed', 'comment='=>'string'], -'wddx_serialize_vars' => ['string', 'var_name'=>'mixed', '...vars='=>'mixed'], -'WeakMap::__construct' => ['void'], -'WeakMap::count' => ['int'], -'WeakMap::current' => ['mixed'], -'WeakMap::key' => ['object'], -'WeakMap::next' => ['void'], -'WeakMap::offsetExists' => ['bool', 'object'=>'object'], -'WeakMap::offsetGet' => ['mixed', 'object'=>'object'], -'WeakMap::offsetSet' => ['void', 'object'=>'object', 'value'=>'mixed'], -'WeakMap::offsetUnset' => ['void', 'object'=>'object'], -'WeakMap::rewind' => ['void'], -'WeakMap::valid' => ['bool'], -'Weakref::acquire' => ['bool'], -'Weakref::get' => ['object'], -'Weakref::release' => ['bool'], -'Weakref::valid' => ['bool'], -'webObj::convertToString' => ['string'], -'webObj::free' => ['void'], -'webObj::set' => ['int', 'property_name'=>'string', 'new_value'=>''], -'webObj::updateFromString' => ['int', 'snippet'=>'string'], -'win32_continue_service' => ['int', 'servicename'=>'string', 'machine='=>'string'], -'win32_create_service' => ['mixed', 'details'=>'array', 'machine='=>'string'], -'win32_delete_service' => ['mixed', 'servicename'=>'string', 'machine='=>'string'], -'win32_get_last_control_message' => ['int'], -'win32_pause_service' => ['int', 'servicename'=>'string', 'machine='=>'string'], -'win32_ps_list_procs' => ['array'], -'win32_ps_stat_mem' => ['array'], -'win32_ps_stat_proc' => ['array', 'pid='=>'int'], -'win32_query_service_status' => ['mixed', 'servicename'=>'string', 'machine='=>'string'], -'win32_set_service_status' => ['bool', 'status'=>'int', 'checkpoint='=>'int'], -'win32_start_service' => ['int', 'servicename'=>'string', 'machine='=>'string'], -'win32_start_service_ctrl_dispatcher' => ['mixed', 'name'=>'string'], -'win32_stop_service' => ['int', 'servicename'=>'string', 'machine='=>'string'], -'wincache_fcache_fileinfo' => ['array', 'summaryonly='=>'bool'], -'wincache_fcache_meminfo' => ['array'], -'wincache_lock' => ['bool', 'key'=>'string', 'isglobal='=>'bool'], -'wincache_ocache_fileinfo' => ['array', 'summaryonly='=>'bool'], -'wincache_ocache_meminfo' => ['array'], -'wincache_refresh_if_changed' => ['bool', 'files='=>'array'], -'wincache_rplist_fileinfo' => ['array', 'summaryonly='=>'bool'], -'wincache_rplist_meminfo' => ['array'], -'wincache_scache_info' => ['array', 'summaryonly='=>'bool'], -'wincache_scache_meminfo' => ['array'], -'wincache_ucache_add' => ['bool', 'key'=>'string', 'value'=>'', 'ttl='=>'int'], -'wincache_ucache_add\'1' => ['bool', 'values'=>'array', 'unused='=>'', 'ttl='=>'int'], -'wincache_ucache_cas' => ['bool', 'key'=>'string', 'old_value'=>'int', 'new_value'=>'int'], -'wincache_ucache_clear' => ['bool'], -'wincache_ucache_dec' => ['mixed', 'key'=>'string', 'dec_by='=>'int', 'success='=>'bool'], -'wincache_ucache_delete' => ['bool', 'key'=>'mixed'], -'wincache_ucache_exists' => ['bool', 'key'=>'string'], -'wincache_ucache_get' => ['mixed', 'key'=>'mixed', '&w_success='=>'bool'], -'wincache_ucache_inc' => ['mixed', 'key'=>'string', 'inc_by='=>'int', 'success='=>'bool'], -'wincache_ucache_info' => ['array', 'summaryonly='=>'bool', 'key='=>'string'], -'wincache_ucache_meminfo' => ['array'], -'wincache_ucache_set' => ['bool', 'key'=>'', 'value'=>'', 'ttl='=>'int'], -'wincache_ucache_set\'1' => ['bool', 'values'=>'array', 'unused='=>'', 'ttl='=>'int'], -'wincache_unlock' => ['bool', 'key'=>'string'], -'wordwrap' => ['string', 'str'=>'string', 'width='=>'int', 'break='=>'string', 'cut='=>'bool'], -'Worker::__construct' => ['void'], -'Worker::chunk' => ['array', 'size'=>'int', 'preserve'=>'bool'], -'Worker::collect' => ['int', 'collector='=>'Callable'], -'Worker::count' => ['int'], -'Worker::detach' => ['void'], -'Worker::getCreatorId' => ['int'], -'Worker::getCurrentThread' => ['Thread'], -'Worker::getCurrentThreadId' => ['int'], -'Worker::getStacked' => ['int'], -'Worker::getTerminationInfo' => ['array'], -'Worker::getThreadId' => ['int'], -'Worker::globally' => ['mixed'], -'Worker::isJoined' => ['bool'], -'Worker::isRunning' => ['bool'], -'Worker::isShutdown' => ['bool'], -'Worker::isStarted' => ['bool'], -'Worker::isTerminated' => ['bool'], -'Worker::isWaiting' => ['bool'], -'Worker::isWorking' => ['bool'], -'Worker::join' => ['bool'], -'Worker::kill' => ['bool'], -'Worker::lock' => ['bool'], -'Worker::merge' => ['bool', 'from'=>'', 'overwrite='=>'mixed'], -'Worker::notify' => ['bool'], -'Worker::offsetExists' => ['bool', 'offset'=>'mixed'], -'Worker::offsetGet' => ['mixed', 'offset'=>'mixed'], -'Worker::offsetSet' => ['void', 'offset'=>'mixed', 'value'=>'mixed'], -'Worker::offsetUnset' => ['void', 'offset'=>'mixed'], -'Worker::pop' => ['bool'], -'Worker::run' => ['void'], -'Worker::shift' => ['bool'], -'Worker::shutdown' => ['bool'], -'Worker::stack' => ['int', '&rw_work'=>'Threaded'], -'Worker::start' => ['bool', 'options='=>'int'], -'Worker::synchronized' => ['mixed', 'block'=>'Closure', '_='=>'mixed'], -'Worker::unlock' => ['bool'], -'Worker::unstack' => ['int', '&rw_work='=>'Threaded'], -'Worker::wait' => ['bool', 'timeout='=>'int'], -'xattr_get' => ['string', 'filename'=>'string', 'name'=>'string', 'flags='=>'int'], -'xattr_list' => ['array', 'filename'=>'string', 'flags='=>'int'], -'xattr_remove' => ['bool', 'filename'=>'string', 'name'=>'string', 'flags='=>'int'], -'xattr_set' => ['bool', 'filename'=>'string', 'name'=>'string', 'value'=>'string', 'flags='=>'int'], -'xattr_supported' => ['bool', 'filename'=>'string', 'flags='=>'int'], -'xcache_asm' => ['string', 'filename'=>'string'], -'xcache_clear_cache' => ['void', 'type'=>'int', 'id='=>'int'], -'xcache_coredump' => ['string', 'op_type'=>'int'], -'xcache_count' => ['int', 'type'=>'int'], -'xcache_coverager_decode' => ['array', 'data'=>'string'], -'xcache_coverager_get' => ['array', 'clean='=>'bool|false'], -'xcache_coverager_start' => ['void', 'clean='=>'bool|true'], -'xcache_coverager_stop' => ['void', 'clean='=>'bool|false'], -'xcache_dasm_file' => ['string', 'filename'=>'string'], -'xcache_dasm_string' => ['string', 'code'=>'string'], -'xcache_dec' => ['int', 'name'=>'string', 'value='=>'int|mixed', 'ttl='=>'int'], -'xcache_decode' => ['bool', 'filename'=>'string'], -'xcache_encode' => ['string', 'filename'=>'string'], -'xcache_get' => ['mixed', 'name'=>'string'], -'xcache_get_data_type' => ['string', 'type'=>'int'], -'xcache_get_op_spec' => ['string', 'op_type'=>'int'], -'xcache_get_op_type' => ['string', 'op_type'=>'int'], -'xcache_get_opcode' => ['string', 'opcode'=>'int'], -'xcache_get_opcode_spec' => ['string', 'opcode'=>'int'], -'xcache_inc' => ['int', 'name'=>'string', 'value='=>'int|mixed', 'ttl='=>'int'], -'xcache_info' => ['array', 'type'=>'int', 'id'=>'int'], -'xcache_is_autoglobal' => ['string', 'name'=>'string'], -'xcache_isset' => ['bool', 'name'=>'string'], -'xcache_list' => ['array', 'type'=>'int', 'id'=>'int'], -'xcache_set' => ['bool', 'name'=>'string', 'value'=>'mixed', 'ttl='=>'int'], -'xcache_unset' => ['bool', 'name'=>'string'], -'xcache_unset_by_prefix' => ['bool', 'prefix'=>'string'], -'Xcom::__construct' => ['void', 'fabric_url='=>'string', 'fabric_token='=>'string', 'capability_token='=>'string'], -'Xcom::decode' => ['object', 'avro_msg'=>'string', 'json_schema'=>'string'], -'Xcom::encode' => ['string', 'data'=>'stdClass', 'avro_schema'=>'string'], -'Xcom::getDebugOutput' => ['string'], -'Xcom::getLastResponse' => ['string'], -'Xcom::getLastResponseInfo' => ['array'], -'Xcom::getOnboardingURL' => ['string', 'capability_name'=>'string', 'agreement_url'=>'string'], -'Xcom::send' => ['int', 'topic'=>'string', 'data'=>'mixed', 'json_schema='=>'string', 'http_headers='=>'array'], -'Xcom::sendAsync' => ['int', 'topic'=>'string', 'data'=>'mixed', 'json_schema='=>'string', 'http_headers='=>'array'], -'xdebug_break' => ['bool'], -'xdebug_call_class' => ['string', 'depth=' => 'int'], -'xdebug_call_file' => ['string', 'depth=' => 'int'], -'xdebug_call_function' => ['string', 'depth=' => 'int'], -'xdebug_call_line' => ['int', 'depth=' => 'int'], -'xdebug_clear_aggr_profiling_data' => ['bool'], -'xdebug_code_coverage_started' => ['bool'], -'xdebug_debug_zval' => ['void', '...varName'=>'string'], -'xdebug_debug_zval_stdout' => ['void', '...varName'=>'string'], -'xdebug_disable' => ['void'], -'xdebug_dump_aggr_profiling_data' => ['bool'], -'xdebug_dump_superglobals' => ['void'], -'xdebug_enable' => ['void'], -'xdebug_get_code_coverage' => ['array'], -'xdebug_get_collected_errors' => ['string', 'clean='=>'bool|false'], -'xdebug_get_declared_vars' => ['array'], -'xdebug_get_formatted_function_stack' => [''], -'xdebug_get_function_count' => ['int'], -'xdebug_get_function_stack' => ['array', 'message='=>'string', 'options='=>'int'], -'xdebug_get_headers' => ['array'], -'xdebug_get_monitored_functions' => ['array'], -'xdebug_get_profiler_filename' => ['string'], -'xdebug_get_stack_depth' => ['int'], -'xdebug_get_tracefile_name' => ['string'], -'xdebug_is_debugger_active' => ['bool'], -'xdebug_is_enabled' => ['bool'], -'xdebug_memory_usage' => ['int'], -'xdebug_peak_memory_usage' => ['int'], -'xdebug_print_function_stack' => ['array', 'message='=>'string', 'options=' => 'int'], -'xdebug_set_filter' => ['void', 'group' => 'int', 'list_type' => 'int', 'configuration' => 'array'], -'xdebug_start_code_coverage' => ['void', 'options='=>'int'], -'xdebug_start_error_collection' => ['void'], -'xdebug_start_function_monitor' => ['void', 'list_of_functions_to_monitor'=>'string[]'], -'xdebug_start_trace' => ['void', 'trace_file'=>'', 'options='=>'int|mixed'], -'xdebug_stop_code_coverage' => ['void', 'cleanup='=>'bool|true'], -'xdebug_stop_error_collection' => ['void'], -'xdebug_stop_function_monitor' => ['void'], -'xdebug_stop_trace' => ['void'], -'xdebug_time_index' => ['float'], -'xdebug_var_dump' => ['void', '...var'=>''], -'xdiff_file_bdiff' => ['bool', 'old_file'=>'string', 'new_file'=>'string', 'dest'=>'string'], -'xdiff_file_bdiff_size' => ['int', 'file'=>'string'], -'xdiff_file_bpatch' => ['bool', 'file'=>'string', 'patch'=>'string', 'dest'=>'string'], -'xdiff_file_diff' => ['bool', 'old_file'=>'string', 'new_file'=>'string', 'dest'=>'string', 'context='=>'int', 'minimal='=>'bool'], -'xdiff_file_diff_binary' => ['bool', 'old_file'=>'string', 'new_file'=>'string', 'dest'=>'string'], -'xdiff_file_merge3' => ['mixed', 'old_file'=>'string', 'new_file1'=>'string', 'new_file2'=>'string', 'dest'=>'string'], -'xdiff_file_patch' => ['mixed', 'file'=>'string', 'patch'=>'string', 'dest'=>'string', 'flags='=>'int'], -'xdiff_file_patch_binary' => ['bool', 'file'=>'string', 'patch'=>'string', 'dest'=>'string'], -'xdiff_file_rabdiff' => ['bool', 'old_file'=>'string', 'new_file'=>'string', 'dest'=>'string'], -'xdiff_string_bdiff' => ['string', 'old_data'=>'string', 'new_data'=>'string'], -'xdiff_string_bdiff_size' => ['int', 'patch'=>'string'], -'xdiff_string_bpatch' => ['string', 'str'=>'string', 'patch'=>'string'], -'xdiff_string_diff' => ['string', 'old_data'=>'string', 'new_data'=>'string', 'context='=>'int', 'minimal='=>'bool'], -'xdiff_string_diff_binary' => ['string', 'old_data'=>'string', 'new_data'=>'string'], -'xdiff_string_merge3' => ['mixed', 'old_data'=>'string', 'new_data1'=>'string', 'new_data2'=>'string', 'error='=>'string'], -'xdiff_string_patch' => ['string', 'str'=>'string', 'patch'=>'string', 'flags='=>'int', '&w_error='=>'string'], -'xdiff_string_patch_binary' => ['string', 'str'=>'string', 'patch'=>'string'], -'xdiff_string_rabdiff' => ['string', 'old_data'=>'string', 'new_data'=>'string'], -'xhprof_disable' => ['array'], -'xhprof_enable' => ['void', 'flags='=>'int', 'options='=>'array'], -'xhprof_sample_disable' => ['array'], -'xhprof_sample_enable' => ['void'], -'xml_error_string' => ['string', 'code'=>'int'], -'xml_get_current_byte_index' => ['int', 'parser'=>'resource'], -'xml_get_current_column_number' => ['int', 'parser'=>'resource'], -'xml_get_current_line_number' => ['int', 'parser'=>'resource'], -'xml_get_error_code' => ['int', 'parser'=>'resource'], -'xml_parse' => ['int', 'parser'=>'resource', 'data'=>'string', 'isfinal='=>'bool'], -'xml_parse_into_struct' => ['int', 'parser'=>'resource', 'data'=>'string', '&w_values'=>'array', '&w_index='=>'array'], -'xml_parser_create' => ['resource', 'encoding='=>'string'], -'xml_parser_create_ns' => ['resource', 'encoding='=>'string', 'sep='=>'string'], -'xml_parser_free' => ['bool', 'parser'=>'resource'], -'xml_parser_get_option' => ['mixed', 'parser'=>'resource', 'option'=>'int'], -'xml_parser_set_option' => ['bool', 'parser'=>'resource', 'option'=>'int', 'value'=>'mixed'], -'xml_set_character_data_handler' => ['bool', 'parser'=>'resource', 'hdl'=>'string'], -'xml_set_default_handler' => ['bool', 'parser'=>'resource', 'hdl'=>'string'], -'xml_set_element_handler' => ['bool', 'parser'=>'resource', 'shdl'=>'string', 'ehdl'=>'string'], -'xml_set_end_namespace_decl_handler' => ['bool', 'parser'=>'resource', 'hdl'=>'string'], -'xml_set_external_entity_ref_handler' => ['bool', 'parser'=>'resource', 'hdl'=>'string'], -'xml_set_notation_decl_handler' => ['bool', 'parser'=>'resource', 'hdl'=>'string'], -'xml_set_object' => ['bool', 'parser'=>'resource', 'obj'=>'object'], -'xml_set_processing_instruction_handler' => ['bool', 'parser'=>'resource', 'hdl'=>'string'], -'xml_set_start_namespace_decl_handler' => ['bool', 'parser'=>'resource', 'hdl'=>'string'], -'xml_set_unparsed_entity_decl_handler' => ['bool', 'parser'=>'resource', 'hdl'=>'string'], -'XMLDiff\Base::__construct' => ['void', 'nsname'=>'string'], -'XMLDiff\Base::diff' => ['mixed', 'from'=>'mixed', 'to'=>'mixed'], -'XMLDiff\Base::merge' => ['mixed', 'src'=>'mixed', 'diff'=>'mixed'], -'XMLDiff\DOM::diff' => ['DOMDocument', 'from'=>'DOMDocument', 'to'=>'DOMDocument'], -'XMLDiff\DOM::merge' => ['DOMDocument', 'src'=>'DOMDocument', 'diff'=>'DOMDocument'], -'XMLDiff\File::diff' => ['string', 'from'=>'string', 'to'=>'string'], -'XMLDiff\File::merge' => ['string', 'src'=>'string', 'diff'=>'string'], -'XMLDiff\Memory::diff' => ['string', 'from'=>'string', 'to'=>'string'], -'XMLDiff\Memory::merge' => ['string', 'src'=>'string', 'diff'=>'string'], -'XMLReader::close' => ['bool'], -'XMLReader::expand' => ['DOMNode', 'basenode='=>'DOMNode'], -'XMLReader::getAttribute' => ['string|null', 'name'=>'string'], -'XMLReader::getAttributeNo' => ['string|null', 'index'=>'int'], -'XMLReader::getAttributeNs' => ['string|null', 'name'=>'string', 'namespaceuri'=>'string'], -'XMLReader::getParserProperty' => ['bool', 'property'=>'int'], -'XMLReader::isValid' => ['bool'], -'XMLReader::lookupNamespace' => ['?string', 'prefix'=>'string'], -'XMLReader::moveToAttribute' => ['bool', 'name'=>'string'], -'XMLReader::moveToAttributeNo' => ['bool', 'index'=>'int'], -'XMLReader::moveToAttributeNs' => ['bool', 'localname'=>'string', 'namespaceuri'=>'string'], -'XMLReader::moveToElement' => ['bool'], -'XMLReader::moveToFirstAttribute' => ['bool'], -'XMLReader::moveToNextAttribute' => ['bool'], -'XMLReader::next' => ['bool', 'localname='=>'string'], -'XMLReader::open' => ['bool', 'uri'=>'string', 'encoding='=>'?string', 'options='=>'int'], -'XMLReader::read' => ['bool'], -'XMLReader::readInnerXML' => ['string'], -'XMLReader::readOuterXML' => ['string'], -'XMLReader::readString' => ['string'], -'XMLReader::setParserProperty' => ['bool', 'property'=>'int', 'value'=>'bool'], -'XMLReader::setRelaxNGSchema' => ['bool', 'filename'=>'string'], -'XMLReader::setRelaxNGSchemaSource' => ['bool', 'source'=>'string'], -'XMLReader::setSchema' => ['bool', 'filename'=>'string'], -'XMLReader::XML' => ['bool', 'source'=>'string', 'encoding='=>'?string', 'options='=>'int'], -'xmlrpc_decode' => ['?array', 'xml'=>'string', 'encoding='=>'string'], -'xmlrpc_decode_request' => ['?array', 'xml'=>'string', '&w_method'=>'string', 'encoding='=>'string'], -'xmlrpc_encode' => ['string', 'value'=>'mixed'], -'xmlrpc_encode_request' => ['string', 'method'=>'string', 'params'=>'mixed', 'output_options='=>'array'], -'xmlrpc_get_type' => ['string', 'value'=>'mixed'], -'xmlrpc_is_fault' => ['bool', 'arg'=>'array'], -'xmlrpc_parse_method_descriptions' => ['array', 'xml'=>'string'], -'xmlrpc_server_add_introspection_data' => ['int', 'server'=>'resource', 'desc'=>'array'], -'xmlrpc_server_call_method' => ['string', 'server'=>'resource', 'xml'=>'string', 'user_data'=>'mixed', 'output_options='=>'array'], -'xmlrpc_server_create' => ['resource'], -'xmlrpc_server_destroy' => ['int', 'server'=>'resource'], -'xmlrpc_server_register_introspection_callback' => ['bool', 'server'=>'resource', 'function'=>'string'], -'xmlrpc_server_register_method' => ['bool', 'server'=>'resource', 'method_name'=>'string', 'function'=>'string'], -'xmlrpc_set_type' => ['bool', '&rw_value'=>'string|DateTime', 'type'=>'string'], -'XMLWriter::endAttribute' => ['bool'], -'XMLWriter::endCData' => ['bool'], -'XMLWriter::endComment' => ['bool'], -'XMLWriter::endDocument' => ['bool'], -'XMLWriter::endDTD' => ['bool', 'xmlwriter='=>''], -'XMLWriter::endDTDAttlist' => ['bool'], -'XMLWriter::endDTDElement' => ['bool'], -'XMLWriter::endDTDEntity' => ['bool'], -'XMLWriter::endElement' => ['bool'], -'XMLWriter::endPI' => ['bool'], -'XMLWriter::flush' => ['', 'empty='=>'bool', 'xmlwriter='=>''], -'XMLWriter::fullEndElement' => ['bool'], -'XMLWriter::openMemory' => ['bool'], -'XMLWriter::openURI' => ['resource', 'uri'=>'string'], -'XMLWriter::outputMemory' => ['string', 'flush='=>'bool', 'xmlwriter='=>''], -'XMLWriter::setIndent' => ['bool', 'indent'=>'bool'], -'XMLWriter::setIndentString' => ['bool', 'indentstring'=>'string'], -'XMLWriter::startAttribute' => ['bool', 'name'=>'string'], -'XMLWriter::startAttributeNS' => ['bool', 'prefix'=>'string', 'name'=>'string', 'uri'=>'string'], -'XMLWriter::startCData' => ['bool'], -'XMLWriter::startComment' => ['bool'], -'XMLWriter::startDocument' => ['bool', 'version='=>'string', 'encoding='=>'string', 'standalone='=>'string'], -'XMLWriter::startDTD' => ['bool', 'qualifiedname'=>'string', 'publicid='=>'string', 'systemid='=>'string'], -'XMLWriter::startDTDAttlist' => ['bool', 'name'=>'string'], -'XMLWriter::startDTDElement' => ['bool', 'qualifiedname'=>'string'], -'XMLWriter::startDTDEntity' => ['bool', 'name'=>'string', 'isparam'=>'bool'], -'XMLWriter::startElement' => ['bool', 'name'=>'string'], -'XMLWriter::startElementNS' => ['bool', 'prefix'=>'string', 'name'=>'string', 'uri'=>'string'], -'XMLWriter::startPI' => ['bool', 'target'=>'string'], -'XMLWriter::text' => ['bool', 'content'=>'string'], -'XMLWriter::writeAttribute' => ['bool', 'name'=>'string', 'value'=>'string'], -'XMLWriter::writeAttributeNS' => ['bool', 'prefix'=>'string', 'name'=>'string', 'uri'=>'string', 'content'=>'string'], -'XMLWriter::writeCData' => ['bool', 'content'=>'string'], -'XMLWriter::writeComment' => ['bool', 'content'=>'string'], -'XMLWriter::writeDTD' => ['bool', 'name'=>'string', 'publicid='=>'string', 'systemid='=>'string', 'subset='=>'string'], -'XMLWriter::writeDTDAttlist' => ['bool', 'name'=>'string', 'content'=>'string'], -'XMLWriter::writeDTDElement' => ['bool', 'name'=>'string', 'content'=>'string'], -'XMLWriter::writeDTDEntity' => ['bool', 'name'=>'string', 'content'=>'string', 'pe'=>'bool', 'pubid'=>'string', 'sysid'=>'string', 'ndataid'=>'string'], -'XMLWriter::writeElement' => ['bool', 'name'=>'string', 'content='=>'string|null'], -'XMLWriter::writeElementNS' => ['bool', 'prefix'=>'string', 'name'=>'string', 'uri'=>'string', 'content='=>'string|null'], -'XMLWriter::writePI' => ['bool', 'target'=>'string', 'content'=>'string'], -'XMLWriter::writeRaw' => ['bool', 'content'=>'string'], -'xmlwriter_end_attribute' => ['bool', 'xmlwriter'=>'resource'], -'xmlwriter_end_cdata' => ['bool', 'xmlwriter'=>'resource'], -'xmlwriter_end_comment' => ['bool', 'xmlwriter'=>'resource'], -'xmlwriter_end_document' => ['bool', 'xmlwriter'=>'resource'], -'xmlwriter_end_dtd' => ['bool', 'xmlwriter'=>'resource'], -'xmlwriter_end_dtd_attlist' => ['bool', 'xmlwriter'=>'resource'], -'xmlwriter_end_dtd_element' => ['bool', 'xmlwriter'=>'resource'], -'xmlwriter_end_dtd_entity' => ['bool', 'xmlwriter'=>'resource'], -'xmlwriter_end_element' => ['bool', 'xmlwriter'=>'resource'], -'xmlwriter_end_pi' => ['bool', 'xmlwriter'=>'resource'], -'xmlwriter_flush' => ['', 'xmlwriter'=>'resource', 'empty='=>'bool'], -'xmlwriter_full_end_element' => ['bool', 'xmlwriter'=>'resource'], -'xmlwriter_open_memory' => ['resource'], -'xmlwriter_open_uri' => ['resource', 'source'=>'string'], -'xmlwriter_output_memory' => ['string', 'xmlwriter'=>'resource', 'flush='=>'bool'], -'xmlwriter_set_indent' => ['bool', 'xmlwriter'=>'resource', 'indent'=>'bool'], -'xmlwriter_set_indent_string' => ['bool', 'xmlwriter'=>'resource', 'indentstring'=>'string'], -'xmlwriter_start_attribute' => ['bool', 'xmlwriter'=>'resource', 'name'=>'string'], -'xmlwriter_start_attribute_ns' => ['bool', 'xmlwriter'=>'resource', 'prefix'=>'string', 'name'=>'string', 'uri'=>'string'], -'xmlwriter_start_cdata' => ['bool', 'xmlwriter'=>'resource'], -'xmlwriter_start_comment' => ['bool', 'xmlwriter'=>'resource'], -'xmlwriter_start_document' => ['bool', 'xmlwriter'=>'resource', 'version'=>'string', 'encoding'=>'string', 'standalone'=>'string'], -'xmlwriter_start_dtd' => ['bool', 'xmlwriter'=>'resource', 'name'=>'string', 'pubid'=>'string', 'sysid'=>'string'], -'xmlwriter_start_dtd_attlist' => ['bool', 'xmlwriter'=>'resource', 'name'=>'string'], -'xmlwriter_start_dtd_element' => ['bool', 'xmlwriter'=>'resource', 'name'=>'string'], -'xmlwriter_start_dtd_entity' => ['bool', 'xmlwriter'=>'resource', 'name'=>'string', 'isparam'=>'bool'], -'xmlwriter_start_element' => ['bool', 'xmlwriter'=>'resource', 'name'=>'string'], -'xmlwriter_start_element_ns' => ['bool', 'xmlwriter'=>'resource', 'prefix'=>'string', 'name'=>'string', 'uri'=>'string'], -'xmlwriter_start_pi' => ['bool', 'xmlwriter'=>'resource', 'target'=>'string'], -'xmlwriter_text' => ['bool', 'xmlwriter'=>'resource', 'content'=>'string'], -'xmlwriter_write_attribute' => ['bool', 'xmlwriter'=>'resource', 'name'=>'string', 'content'=>'string'], -'xmlwriter_write_attribute_ns' => ['bool', 'xmlwriter'=>'resource', 'prefix'=>'string', 'name'=>'string', 'uri'=>'string', 'content'=>'string'], -'xmlwriter_write_cdata' => ['bool', 'xmlwriter'=>'resource', 'content'=>'string'], -'xmlwriter_write_comment' => ['bool', 'xmlwriter'=>'resource', 'content'=>'string'], -'xmlwriter_write_dtd' => ['bool', 'xmlwriter'=>'resource', 'name'=>'string', 'pubid'=>'string', 'sysid'=>'string', 'subset'=>'string'], -'xmlwriter_write_dtd_attlist' => ['bool', 'xmlwriter'=>'resource', 'name'=>'string', 'content'=>'string'], -'xmlwriter_write_dtd_element' => ['bool', 'xmlwriter'=>'resource', 'name'=>'string', 'content'=>'string'], -'xmlwriter_write_dtd_entity' => ['bool', 'xmlwriter'=>'resource', 'name'=>'string', 'content'=>'string', 'pe'=>'int', 'pubid'=>'string', 'sysid'=>'string', 'ndataid'=>'string'], -'xmlwriter_write_element' => ['bool', 'xmlwriter'=>'resource', 'name'=>'string', 'content'=>'string'], -'xmlwriter_write_element_ns' => ['bool', 'xmlwriter'=>'resource', 'prefix'=>'string', 'name'=>'string', 'uri'=>'string', 'content'=>'string'], -'xmlwriter_write_pi' => ['bool', 'xmlwriter'=>'resource', 'target'=>'string', 'content'=>'string'], -'xmlwriter_write_raw' => ['bool', 'xmlwriter'=>'resource', 'content'=>'string'], -'xpath_new_context' => ['XPathContext', 'dom_document'=>'DOMDocument'], -'xpath_register_ns' => ['bool', 'xpath_context'=>'xpathcontext', 'prefix'=>'string', 'uri'=>'string'], -'xpath_register_ns_auto' => ['bool', 'xpath_context'=>'xpathcontext', 'context_node='=>'object'], -'xptr_new_context' => ['XPathContext'], -'xsl_xsltprocessor_get_parameter' => ['string', 'namespace'=>'string', 'name'=>'string'], -'xsl_xsltprocessor_get_security_prefs' => ['int'], -'xsl_xsltprocessor_has_exslt_support' => ['bool'], -'xsl_xsltprocessor_register_php_functions' => ['', 'restrict'=>''], -'xsl_xsltprocessor_remove_parameter' => ['bool', 'namespace'=>'string', 'name'=>'string'], -'xsl_xsltprocessor_set_parameter' => ['bool', 'namespace'=>'string', 'name'=>'', 'value'=>'string'], -'xsl_xsltprocessor_set_profiling' => ['bool', 'filename'=>'string'], -'xsl_xsltprocessor_set_security_prefs' => ['int', 'securityprefs'=>'int'], -'xsl_xsltprocessor_transform_to_uri' => ['int', 'doc'=>'DOMDocument', 'uri'=>'string'], -'xsl_xsltprocessor_transform_to_xml' => ['string', 'doc'=>'DOMDocument'], -'xslt_backend_info' => ['string'], -'xslt_backend_name' => ['string'], -'xslt_backend_version' => ['string'], -'xslt_create' => ['resource'], -'xslt_errno' => ['int', 'xh'=>''], -'xslt_error' => ['string', 'xh'=>''], -'xslt_free' => ['', 'xh'=>''], -'xslt_getopt' => ['int', 'processor'=>''], -'xslt_process' => ['', 'xh'=>'', 'xmlcontainer'=>'string', 'xslcontainer'=>'string', 'resultcontainer='=>'string', 'arguments='=>'array', 'parameters='=>'array'], -'xslt_set_base' => ['', 'xh'=>'', 'uri'=>'string'], -'xslt_set_encoding' => ['', 'xh'=>'', 'encoding'=>'string'], -'xslt_set_error_handler' => ['', 'xh'=>'', 'handler'=>''], -'xslt_set_log' => ['', 'xh'=>'', 'log='=>''], -'xslt_set_object' => ['bool', 'processor'=>'', 'obj'=>'object'], -'xslt_set_sax_handler' => ['', 'xh'=>'', 'handlers'=>'array'], -'xslt_set_sax_handlers' => ['', 'processor'=>'', 'handlers'=>'array'], -'xslt_set_scheme_handler' => ['', 'xh'=>'', 'handlers'=>'array'], -'xslt_set_scheme_handlers' => ['', 'xh'=>'', 'handlers'=>'array'], -'xslt_setopt' => ['', 'processor'=>'', 'newmask'=>'int'], -'XSLTProcessor::getParameter' => ['string', 'namespaceuri'=>'string', 'localname'=>'string'], -'XsltProcessor::getSecurityPrefs' => ['int'], -'XSLTProcessor::hasExsltSupport' => ['bool'], -'XSLTProcessor::importStylesheet' => ['bool', 'stylesheet'=>'object'], -'XSLTProcessor::registerPHPFunctions' => ['void', 'restrict='=>'mixed'], -'XSLTProcessor::removeParameter' => ['bool', 'namespaceuri'=>'string', 'localname'=>'string'], -'XSLTProcessor::setParameter' => ['bool', 'namespace'=>'string', 'name'=>'string', 'value'=>'string'], -'XSLTProcessor::setParameter\'1' => ['bool', 'namespace'=>'string', 'options'=>'array'], -'XSLTProcessor::setProfiling' => ['bool', 'filename'=>'string'], -'XsltProcessor::setSecurityPrefs' => ['int', 'securityPrefs'=>'int'], -'XSLTProcessor::transformToDoc' => ['DOMDocument', 'doc'=>'DOMNode'], -'XSLTProcessor::transformToURI' => ['int', 'doc'=>'DOMDocument', 'uri'=>'string'], -'XSLTProcessor::transformToXML' => ['string', 'doc'=>'DOMDocument'], -'Yaconf::get' => ['mixed', 'name'=>'string', 'default_value='=>'mixed'], -'Yaconf::has' => ['bool', 'name'=>'string'], -'Yaf_Action_Abstract::__construct' => ['void', 'request'=>'Yaf_Request_Abstract', 'response'=>'Yaf_Response_Abstract', 'view'=>'Yaf_View_Interface', 'invokeArgs='=>'?array'], -'Yaf_Action_Abstract::display' => ['bool', 'tpl'=>'string', 'parameters='=>'?array'], -'Yaf_Action_Abstract::execute' => ['mixed', 'arg='=>'mixed', '...args='=>'mixed'], -'Yaf_Action_Abstract::forward' => ['bool', 'module'=>'string', 'controller='=>'string', 'action='=>'string', 'parameters='=>'?array'], -'Yaf_Action_Abstract::getController' => ['Yaf_Controller_Abstract'], -'Yaf_Action_Abstract::getInvokeArg' => ['mixed|null', 'name'=>'string'], -'Yaf_Action_Abstract::getInvokeArgs' => ['array'], -'Yaf_Action_Abstract::getModuleName' => ['string'], -'Yaf_Action_Abstract::getRequest' => ['Yaf_Request_Abstract'], -'Yaf_Action_Abstract::getResponse' => ['Yaf_Response_Abstract'], -'Yaf_Action_Abstract::getView' => ['Yaf_View_Interface'], -'Yaf_Action_Abstract::getViewpath' => ['string'], -'Yaf_Action_Abstract::init' => [''], -'Yaf_Action_Abstract::initView' => ['Yaf_Response_Abstract', 'options='=>'?array'], -'Yaf_Action_Abstract::redirect' => ['bool', 'url'=>'string'], -'Yaf_Action_Abstract::render' => ['string', 'tpl'=>'string', 'parameters='=>'?array'], -'Yaf_Action_Abstract::setViewpath' => ['bool', 'view_directory'=>'string'], -'Yaf_Application::__clone' => ['void'], -'Yaf_Application::__construct' => ['void', 'config'=>'mixed', 'envrion='=>'string'], -'Yaf_Application::__destruct' => ['void'], -'Yaf_Application::__sleep' => ['void'], -'Yaf_Application::__wakeup' => ['void'], -'Yaf_Application::app' => ['void'], -'Yaf_Application::bootstrap' => ['void', 'bootstrap='=>'Yaf_Bootstrap_Abstract'], -'Yaf_Application::clearLastError' => ['Yaf_Application'], -'Yaf_Application::environ' => ['void'], -'Yaf_Application::execute' => ['void', 'entry'=>'callable', '...args'=>'string'], -'Yaf_Application::getAppDirectory' => ['Yaf_Application'], -'Yaf_Application::getConfig' => ['Yaf_Config_Abstract'], -'Yaf_Application::getDispatcher' => ['Yaf_Dispatcher'], -'Yaf_Application::getLastErrorMsg' => ['string'], -'Yaf_Application::getLastErrorNo' => ['int'], -'Yaf_Application::getModules' => ['array'], -'Yaf_Application::run' => ['void'], -'Yaf_Application::setAppDirectory' => ['Yaf_Application', 'directory'=>'string'], -'Yaf_Config_Abstract::get' => ['mixed', 'name'=>'string', 'value'=>'mixed'], -'Yaf_Config_Abstract::readonly' => ['bool'], -'Yaf_Config_Abstract::set' => ['Yaf_Config_Abstract'], -'Yaf_Config_Abstract::toArray' => ['array'], -'Yaf_Config_Ini::__construct' => ['void', 'config_file'=>'string', 'section='=>'string'], -'Yaf_Config_Ini::__get' => ['void', 'name='=>'string'], -'Yaf_Config_Ini::__isset' => ['void', 'name'=>'string'], -'Yaf_Config_Ini::__set' => ['void', 'name'=>'string', 'value'=>'mixed'], -'Yaf_Config_Ini::count' => ['void'], -'Yaf_Config_Ini::current' => ['void'], -'Yaf_Config_Ini::get' => ['mixed', 'name='=>'mixed'], -'Yaf_Config_Ini::key' => ['void'], -'Yaf_Config_Ini::next' => ['void'], -'Yaf_Config_Ini::offsetExists' => ['void', 'name'=>'string'], -'Yaf_Config_Ini::offsetGet' => ['void', 'name'=>'string'], -'Yaf_Config_Ini::offsetSet' => ['void', 'name'=>'string', 'value'=>'string'], -'Yaf_Config_Ini::offsetUnset' => ['void', 'name'=>'string'], -'Yaf_Config_Ini::readonly' => ['void'], -'Yaf_Config_Ini::rewind' => ['void'], -'Yaf_Config_Ini::set' => ['Yaf_Config_Abstract', 'name'=>'string', 'value'=>'mixed'], -'Yaf_Config_Ini::toArray' => ['array'], -'Yaf_Config_Ini::valid' => ['void'], -'Yaf_Config_Simple::__construct' => ['void', 'config_file'=>'string', 'section='=>'string'], -'Yaf_Config_Simple::__get' => ['void', 'name='=>'string'], -'Yaf_Config_Simple::__isset' => ['void', 'name'=>'string'], -'Yaf_Config_Simple::__set' => ['void', 'name'=>'string', 'value'=>'string'], -'Yaf_Config_Simple::count' => ['void'], -'Yaf_Config_Simple::current' => ['void'], -'Yaf_Config_Simple::get' => ['mixed', 'name='=>'mixed'], -'Yaf_Config_Simple::key' => ['void'], -'Yaf_Config_Simple::next' => ['void'], -'Yaf_Config_Simple::offsetExists' => ['void', 'name'=>'string'], -'Yaf_Config_Simple::offsetGet' => ['void', 'name'=>'string'], -'Yaf_Config_Simple::offsetSet' => ['void', 'name'=>'string', 'value'=>'string'], -'Yaf_Config_Simple::offsetUnset' => ['void', 'name'=>'string'], -'Yaf_Config_Simple::readonly' => ['void'], -'Yaf_Config_Simple::rewind' => ['void'], -'Yaf_Config_Simple::set' => ['Yaf_Config_Abstract', 'name'=>'string', 'value'=>'mixed'], -'Yaf_Config_Simple::toArray' => ['array'], -'Yaf_Config_Simple::valid' => ['void'], -'Yaf_Controller_Abstract::__clone' => ['void'], -'Yaf_Controller_Abstract::__construct' => ['void'], -'Yaf_Controller_Abstract::display' => ['bool', 'tpl'=>'string', 'parameters='=>'array'], -'Yaf_Controller_Abstract::forward' => ['void', 'action'=>'string', 'parameters='=>'array'], -'Yaf_Controller_Abstract::forward\'1' => ['void', 'controller'=>'string', 'action'=>'string', 'parameters='=>'array'], -'Yaf_Controller_Abstract::forward\'2' => ['void', 'module'=>'string', 'controller'=>'string', 'action'=>'string', 'parameters='=>'array'], -'Yaf_Controller_Abstract::getInvokeArg' => ['void', 'name'=>'string'], -'Yaf_Controller_Abstract::getInvokeArgs' => ['void'], -'Yaf_Controller_Abstract::getModuleName' => ['string'], -'Yaf_Controller_Abstract::getRequest' => ['Yaf_Request_Abstract'], -'Yaf_Controller_Abstract::getResponse' => ['Yaf_Response_Abstract'], -'Yaf_Controller_Abstract::getView' => ['Yaf_View_Interface'], -'Yaf_Controller_Abstract::getViewpath' => ['void'], -'Yaf_Controller_Abstract::init' => ['void'], -'Yaf_Controller_Abstract::initView' => ['void', 'options='=>'array'], -'Yaf_Controller_Abstract::redirect' => ['bool', 'url'=>'string'], -'Yaf_Controller_Abstract::render' => ['string', 'tpl'=>'string', 'parameters='=>'array'], -'Yaf_Controller_Abstract::setViewpath' => ['void', 'view_directory'=>'string'], -'Yaf_Dispatcher::__clone' => ['void'], -'Yaf_Dispatcher::__construct' => ['void'], -'Yaf_Dispatcher::__sleep' => ['void'], -'Yaf_Dispatcher::__wakeup' => ['void'], -'Yaf_Dispatcher::autoRender' => ['Yaf_Dispatcher', 'flag='=>'bool'], -'Yaf_Dispatcher::catchException' => ['Yaf_Dispatcher', 'flag='=>'bool'], -'Yaf_Dispatcher::disableView' => ['bool'], -'Yaf_Dispatcher::dispatch' => ['Yaf_Response_Abstract', 'request'=>'Yaf_Request_Abstract'], -'Yaf_Dispatcher::enableView' => ['Yaf_Dispatcher'], -'Yaf_Dispatcher::flushInstantly' => ['Yaf_Dispatcher', 'flag='=>'bool'], -'Yaf_Dispatcher::getApplication' => ['Yaf_Application'], -'Yaf_Dispatcher::getInstance' => ['Yaf_Dispatcher'], -'Yaf_Dispatcher::getRequest' => ['Yaf_Request_Abstract'], -'Yaf_Dispatcher::getRouter' => ['Yaf_Router'], -'Yaf_Dispatcher::initView' => ['Yaf_View_Interface', 'templates_dir'=>'string', 'options='=>'array'], -'Yaf_Dispatcher::registerPlugin' => ['Yaf_Dispatcher', 'plugin'=>'Yaf_Plugin_Abstract'], -'Yaf_Dispatcher::returnResponse' => ['Yaf_Dispatcher', 'flag'=>'bool'], -'Yaf_Dispatcher::setDefaultAction' => ['Yaf_Dispatcher', 'action'=>'string'], -'Yaf_Dispatcher::setDefaultController' => ['Yaf_Dispatcher', 'controller'=>'string'], -'Yaf_Dispatcher::setDefaultModule' => ['Yaf_Dispatcher', 'module'=>'string'], -'Yaf_Dispatcher::setErrorHandler' => ['Yaf_Dispatcher', 'callback'=>'call', 'error_types'=>'int'], -'Yaf_Dispatcher::setRequest' => ['Yaf_Dispatcher', 'request'=>'Yaf_Request_Abstract'], -'Yaf_Dispatcher::setView' => ['Yaf_Dispatcher', 'view'=>'Yaf_View_Interface'], -'Yaf_Dispatcher::throwException' => ['Yaf_Dispatcher', 'flag='=>'bool'], -'Yaf_Exception::__construct' => ['void'], -'Yaf_Exception::getPrevious' => ['void'], -'Yaf_Loader::__clone' => ['void'], -'Yaf_Loader::__construct' => ['void'], -'Yaf_Loader::__sleep' => ['void'], -'Yaf_Loader::__wakeup' => ['void'], -'Yaf_Loader::autoload' => ['void'], -'Yaf_Loader::clearLocalNamespace' => ['void'], -'Yaf_Loader::getInstance' => ['void'], -'Yaf_Loader::getLibraryPath' => ['Yaf_Loader', 'is_global='=>'bool'], -'Yaf_Loader::getLocalNamespace' => ['void'], -'Yaf_Loader::import' => ['void'], -'Yaf_Loader::isLocalName' => ['void'], -'Yaf_Loader::registerLocalNamespace' => ['void', 'prefix'=>'mixed'], -'Yaf_Loader::setLibraryPath' => ['Yaf_Loader', 'directory'=>'string', 'is_global='=>'bool'], -'Yaf_Plugin_Abstract::dispatchLoopShutdown' => ['void', 'request'=>'Yaf_Request_Abstract', 'response'=>'Yaf_Response_Abstract'], -'Yaf_Plugin_Abstract::dispatchLoopStartup' => ['void', 'request'=>'Yaf_Request_Abstract', 'response'=>'Yaf_Response_Abstract'], -'Yaf_Plugin_Abstract::postDispatch' => ['void', 'request'=>'Yaf_Request_Abstract', 'response'=>'Yaf_Response_Abstract'], -'Yaf_Plugin_Abstract::preDispatch' => ['void', 'request'=>'Yaf_Request_Abstract', 'response'=>'Yaf_Response_Abstract'], -'Yaf_Plugin_Abstract::preResponse' => ['void', 'request'=>'Yaf_Request_Abstract', 'response'=>'Yaf_Response_Abstract'], -'Yaf_Plugin_Abstract::routerShutdown' => ['void', 'request'=>'Yaf_Request_Abstract', 'response'=>'Yaf_Response_Abstract'], -'Yaf_Plugin_Abstract::routerStartup' => ['void', 'request'=>'Yaf_Request_Abstract', 'response'=>'Yaf_Response_Abstract'], -'Yaf_Registry::__clone' => ['void'], -'Yaf_Registry::__construct' => ['void'], -'Yaf_Registry::del' => ['void', 'name'=>'string'], -'Yaf_Registry::get' => ['mixed', 'name'=>'string'], -'Yaf_Registry::has' => ['bool', 'name'=>'string'], -'Yaf_Registry::set' => ['bool', 'name'=>'string', 'value'=>'string'], -'Yaf_Request_Abstract::getActionName' => ['void'], -'Yaf_Request_Abstract::getBaseUri' => ['void'], -'Yaf_Request_Abstract::getControllerName' => ['void'], -'Yaf_Request_Abstract::getEnv' => ['void', 'name'=>'string', 'default='=>'string'], -'Yaf_Request_Abstract::getException' => ['void'], -'Yaf_Request_Abstract::getLanguage' => ['void'], -'Yaf_Request_Abstract::getMethod' => ['void'], -'Yaf_Request_Abstract::getModuleName' => ['void'], -'Yaf_Request_Abstract::getParam' => ['void', 'name'=>'string', 'default='=>'string'], -'Yaf_Request_Abstract::getParams' => ['void'], -'Yaf_Request_Abstract::getRequestUri' => ['void'], -'Yaf_Request_Abstract::getServer' => ['void', 'name'=>'string', 'default='=>'string'], -'Yaf_Request_Abstract::isCli' => ['void'], -'Yaf_Request_Abstract::isDispatched' => ['void'], -'Yaf_Request_Abstract::isGet' => ['void'], -'Yaf_Request_Abstract::isHead' => ['void'], -'Yaf_Request_Abstract::isOptions' => ['void'], -'Yaf_Request_Abstract::isPost' => ['void'], -'Yaf_Request_Abstract::isPut' => ['void'], -'Yaf_Request_Abstract::isRouted' => ['void'], -'Yaf_Request_Abstract::isXmlHttpRequest' => ['void'], -'Yaf_Request_Abstract::setActionName' => ['void', 'action'=>'string'], -'Yaf_Request_Abstract::setBaseUri' => ['bool', 'uir'=>'string'], -'Yaf_Request_Abstract::setControllerName' => ['void', 'controller'=>'string'], -'Yaf_Request_Abstract::setDispatched' => ['void'], -'Yaf_Request_Abstract::setModuleName' => ['void', 'module'=>'string'], -'Yaf_Request_Abstract::setParam' => ['void', 'name'=>'string', 'value='=>'string'], -'Yaf_Request_Abstract::setRequestUri' => ['void', 'uir'=>'string'], -'Yaf_Request_Abstract::setRouted' => ['void', 'flag='=>'string'], -'Yaf_Request_Http::__clone' => ['void'], -'Yaf_Request_Http::__construct' => ['void'], -'Yaf_Request_Http::get' => ['mixed', 'name'=>'string', 'default='=>'string'], -'Yaf_Request_Http::getActionName' => ['string'], -'Yaf_Request_Http::getBaseUri' => ['string'], -'Yaf_Request_Http::getControllerName' => ['string'], -'Yaf_Request_Http::getCookie' => ['mixed', 'name'=>'string', 'default='=>'string'], -'Yaf_Request_Http::getEnv' => ['mixed', 'name='=>'string', 'default='=>'mixed'], -'Yaf_Request_Http::getException' => ['Yaf_Exception'], -'Yaf_Request_Http::getFiles' => ['void'], -'Yaf_Request_Http::getLanguage' => ['string'], -'Yaf_Request_Http::getMethod' => ['string'], -'Yaf_Request_Http::getModuleName' => ['string'], -'Yaf_Request_Http::getParam' => ['mixed', 'name'=>'string', 'default='=>'mixed'], -'Yaf_Request_Http::getParams' => ['array'], -'Yaf_Request_Http::getPost' => ['mixed', 'name'=>'string', 'default='=>'string'], -'Yaf_Request_Http::getQuery' => ['mixed', 'name'=>'string', 'default='=>'string'], -'Yaf_Request_Http::getRaw' => ['mixed'], -'Yaf_Request_Http::getRequest' => ['void'], -'Yaf_Request_Http::getRequestUri' => ['string'], -'Yaf_Request_Http::getServer' => ['mixed', 'name='=>'string', 'default='=>'mixed'], -'Yaf_Request_Http::isCli' => ['bool'], -'Yaf_Request_Http::isDispatched' => ['bool'], -'Yaf_Request_Http::isGet' => ['bool'], -'Yaf_Request_Http::isHead' => ['bool'], -'Yaf_Request_Http::isOptions' => ['bool'], -'Yaf_Request_Http::isPost' => ['bool'], -'Yaf_Request_Http::isPut' => ['bool'], -'Yaf_Request_Http::isRouted' => ['bool'], -'Yaf_Request_Http::isXmlHttpRequest' => ['bool'], -'Yaf_Request_Http::setActionName' => ['Yaf_Request_Abstract|bool', 'action'=>'string'], -'Yaf_Request_Http::setBaseUri' => ['bool', 'uri'=>'string'], -'Yaf_Request_Http::setControllerName' => ['Yaf_Request_Abstract|bool', 'controller'=>'string'], -'Yaf_Request_Http::setDispatched' => ['bool'], -'Yaf_Request_Http::setModuleName' => ['Yaf_Request_Abstract|bool', 'module'=>'string'], -'Yaf_Request_Http::setParam' => ['Yaf_Request_Abstract|bool', 'name'=>'array|string', 'value='=>'string'], -'Yaf_Request_Http::setRequestUri' => ['', 'uri'=>'string'], -'Yaf_Request_Http::setRouted' => ['Yaf_Request_Abstract|bool'], -'Yaf_Request_Simple::__clone' => ['void'], -'Yaf_Request_Simple::__construct' => ['void'], -'Yaf_Request_Simple::get' => ['void'], -'Yaf_Request_Simple::getActionName' => ['string'], -'Yaf_Request_Simple::getBaseUri' => ['string'], -'Yaf_Request_Simple::getControllerName' => ['string'], -'Yaf_Request_Simple::getCookie' => ['void'], -'Yaf_Request_Simple::getEnv' => ['mixed', 'name='=>'string', 'default='=>'mixed'], -'Yaf_Request_Simple::getException' => ['Yaf_Exception'], -'Yaf_Request_Simple::getFiles' => ['void'], -'Yaf_Request_Simple::getLanguage' => ['string'], -'Yaf_Request_Simple::getMethod' => ['string'], -'Yaf_Request_Simple::getModuleName' => ['string'], -'Yaf_Request_Simple::getParam' => ['mixed', 'name'=>'string', 'default='=>'mixed'], -'Yaf_Request_Simple::getParams' => ['array'], -'Yaf_Request_Simple::getPost' => ['void'], -'Yaf_Request_Simple::getQuery' => ['void'], -'Yaf_Request_Simple::getRequest' => ['void'], -'Yaf_Request_Simple::getRequestUri' => ['string'], -'Yaf_Request_Simple::getServer' => ['mixed', 'name='=>'string', 'default='=>'mixed'], -'Yaf_Request_Simple::isCli' => ['bool'], -'Yaf_Request_Simple::isDispatched' => ['bool'], -'Yaf_Request_Simple::isGet' => ['bool'], -'Yaf_Request_Simple::isHead' => ['bool'], -'Yaf_Request_Simple::isOptions' => ['bool'], -'Yaf_Request_Simple::isPost' => ['bool'], -'Yaf_Request_Simple::isPut' => ['bool'], -'Yaf_Request_Simple::isRouted' => ['bool'], -'Yaf_Request_Simple::isXmlHttpRequest' => ['void'], -'Yaf_Request_Simple::setActionName' => ['Yaf_Request_Abstract|bool', 'action'=>'string'], -'Yaf_Request_Simple::setBaseUri' => ['bool', 'uri'=>'string'], -'Yaf_Request_Simple::setControllerName' => ['Yaf_Request_Abstract|bool', 'controller'=>'string'], -'Yaf_Request_Simple::setDispatched' => ['bool'], -'Yaf_Request_Simple::setModuleName' => ['Yaf_Request_Abstract|bool', 'module'=>'string'], -'Yaf_Request_Simple::setParam' => ['Yaf_Request_Abstract|bool', 'name'=>'array|string', 'value='=>'string'], -'Yaf_Request_Simple::setRequestUri' => ['', 'uri'=>'string'], -'Yaf_Request_Simple::setRouted' => ['Yaf_Request_Abstract|bool'], -'Yaf_Response_Abstract::__clone' => ['void'], -'Yaf_Response_Abstract::__construct' => ['void'], -'Yaf_Response_Abstract::__destruct' => ['void'], -'Yaf_Response_Abstract::__toString' => ['string'], -'Yaf_Response_Abstract::appendBody' => ['bool', 'content'=>'string', 'key='=>'string'], -'Yaf_Response_Abstract::clearBody' => ['bool', 'key='=>'string'], -'Yaf_Response_Abstract::clearHeaders' => ['void'], -'Yaf_Response_Abstract::getBody' => ['mixed', 'key='=>'string'], -'Yaf_Response_Abstract::getHeader' => ['void'], -'Yaf_Response_Abstract::prependBody' => ['bool', 'content'=>'string', 'key='=>'string'], -'Yaf_Response_Abstract::response' => ['void'], -'Yaf_Response_Abstract::setAllHeaders' => ['void'], -'Yaf_Response_Abstract::setBody' => ['bool', 'content'=>'string', 'key='=>'string'], -'Yaf_Response_Abstract::setHeader' => ['void'], -'Yaf_Response_Abstract::setRedirect' => ['void'], -'Yaf_Response_Cli::__clone' => [''], -'Yaf_Response_Cli::__construct' => ['void'], -'Yaf_Response_Cli::__destruct' => [''], -'Yaf_Response_Cli::__toString' => ['string'], -'Yaf_Response_Cli::appendBody' => ['bool', 'content'=>'string', 'key='=>'string'], -'Yaf_Response_Cli::clearBody' => ['bool', 'key='=>'string'], -'Yaf_Response_Cli::getBody' => ['mixed', 'key='=>'null|string'], -'Yaf_Response_Cli::prependBody' => ['bool', 'content'=>'string', 'key='=>'string'], -'Yaf_Response_Cli::setBody' => ['bool', 'content'=>'string', 'key='=>'string'], -'Yaf_Response_Http::__clone' => [''], -'Yaf_Response_Http::__construct' => ['void'], -'Yaf_Response_Http::__destruct' => [''], -'Yaf_Response_Http::__toString' => ['string'], -'Yaf_Response_Http::appendBody' => ['bool', 'content'=>'string', 'key='=>'string'], -'Yaf_Response_Http::clearBody' => ['bool', 'key='=>'string'], -'Yaf_Response_Http::clearHeaders' => ['Yaf_Response_Abstract|false', 'name='=>'string'], -'Yaf_Response_Http::getBody' => ['mixed', 'key='=>'null|string'], -'Yaf_Response_Http::getHeader' => ['mixed', 'name='=>'string'], -'Yaf_Response_Http::prependBody' => ['bool', 'content'=>'string', 'key='=>'string'], -'Yaf_Response_Http::response' => ['bool'], -'Yaf_Response_Http::setAllHeaders' => ['bool', 'headers'=>'array'], -'Yaf_Response_Http::setBody' => ['bool', 'content'=>'string', 'key='=>'string'], -'Yaf_Response_Http::setHeader' => ['bool', 'name'=>'string', 'value'=>'string', 'replace='=>'bool|false', 'response_code='=>'int'], -'Yaf_Response_Http::setRedirect' => ['bool', 'url'=>'string'], -'Yaf_Route_Interface::__construct' => ['void'], -'Yaf_Route_Interface::assemble' => ['string', 'info'=>'array', 'query='=>'array'], -'Yaf_Route_Interface::route' => ['bool', 'request'=>'Yaf_Request_Abstract'], -'Yaf_Route_Map::__construct' => ['void', 'controller_prefer='=>'string', 'delimiter='=>'string'], -'Yaf_Route_Map::assemble' => ['string', 'info'=>'array', 'query='=>'array'], -'Yaf_Route_Map::route' => ['bool', 'request'=>'Yaf_Request_Abstract'], -'Yaf_Route_Regex::__construct' => ['void', 'match'=>'string', 'route'=>'array', 'map='=>'array', 'verify='=>'array', 'reverse='=>'string'], -'Yaf_Route_Regex::addConfig' => ['Yaf_Router|bool', 'config'=>'Yaf_Config_Abstract'], -'Yaf_Route_Regex::addRoute' => ['Yaf_Router|bool', 'name'=>'string', 'route'=>'Yaf_Route_Interface'], -'Yaf_Route_Regex::assemble' => ['string', 'info'=>'array', 'query='=>'array'], -'Yaf_Route_Regex::getCurrentRoute' => ['string'], -'Yaf_Route_Regex::getRoute' => ['Yaf_Route_Interface', 'name'=>'string'], -'Yaf_Route_Regex::getRoutes' => ['Yaf_Route_Interface[]'], -'Yaf_Route_Regex::route' => ['bool', 'request'=>'Yaf_Request_Abstract'], -'Yaf_Route_Rewrite::__construct' => ['void', 'match'=>'string', 'route'=>'array', 'verify='=>'array'], -'Yaf_Route_Rewrite::addConfig' => ['Yaf_Router|bool', 'config'=>'Yaf_Config_Abstract'], -'Yaf_Route_Rewrite::addRoute' => ['Yaf_Router|bool', 'name'=>'string', 'route'=>'Yaf_Route_Interface'], -'Yaf_Route_Rewrite::assemble' => ['string', 'info'=>'array', 'query='=>'array'], -'Yaf_Route_Rewrite::getCurrentRoute' => ['string'], -'Yaf_Route_Rewrite::getRoute' => ['Yaf_Route_Interface', 'name'=>'string'], -'Yaf_Route_Rewrite::getRoutes' => ['Yaf_Route_Interface[]'], -'Yaf_Route_Rewrite::route' => ['bool', 'request'=>'Yaf_Request_Abstract'], -'Yaf_Route_Simple::__construct' => ['void', 'module_name'=>'string', 'controller_name'=>'string', 'action_name'=>'string'], -'Yaf_Route_Simple::assemble' => ['string', 'info'=>'array', 'query='=>'array'], -'Yaf_Route_Simple::route' => ['bool', 'request'=>'Yaf_Request_Abstract'], -'Yaf_Route_Static::assemble' => ['string', 'info'=>'array', 'query='=>'array'], -'Yaf_Route_Static::match' => ['void', 'uri'=>'string'], -'Yaf_Route_Static::route' => ['bool', 'request'=>'Yaf_Request_Abstract'], -'Yaf_Route_Supervar::__construct' => ['void', 'supervar_name'=>'string'], -'Yaf_Route_Supervar::assemble' => ['string', 'info'=>'array', 'query='=>'array'], -'Yaf_Route_Supervar::route' => ['bool', 'request'=>'Yaf_Request_Abstract'], -'Yaf_Router::__construct' => ['void'], -'Yaf_Router::addConfig' => ['bool', 'config'=>'Yaf_Config_Abstract'], -'Yaf_Router::addRoute' => ['bool', 'name'=>'string', 'route'=>'Yaf_Route_Abstract'], -'Yaf_Router::getCurrentRoute' => ['string'], -'Yaf_Router::getRoute' => ['Yaf_Route_Interface', 'name'=>'string'], -'Yaf_Router::getRoutes' => ['mixed'], -'Yaf_Router::route' => ['bool', 'request'=>'Yaf_Request_Abstract'], -'Yaf_Session::__clone' => ['void'], -'Yaf_Session::__construct' => ['void'], -'Yaf_Session::__get' => ['void', 'name'=>'string'], -'Yaf_Session::__isset' => ['void', 'name'=>'string'], -'Yaf_Session::__set' => ['void', 'name'=>'string', 'value'=>'string'], -'Yaf_Session::__sleep' => ['void'], -'Yaf_Session::__unset' => ['void', 'name'=>'string'], -'Yaf_Session::__wakeup' => ['void'], -'Yaf_Session::count' => ['void'], -'Yaf_Session::current' => ['void'], -'Yaf_Session::del' => ['void', 'name'=>'string'], -'Yaf_Session::get' => ['mixed', 'name'=>'string'], -'Yaf_Session::getInstance' => ['void'], -'Yaf_Session::has' => ['void', 'name'=>'string'], -'Yaf_Session::key' => ['void'], -'Yaf_Session::next' => ['void'], -'Yaf_Session::offsetExists' => ['void', 'name'=>'string'], -'Yaf_Session::offsetGet' => ['void', 'name'=>'string'], -'Yaf_Session::offsetSet' => ['void', 'name'=>'string', 'value'=>'string'], -'Yaf_Session::offsetUnset' => ['void', 'name'=>'string'], -'Yaf_Session::rewind' => ['void'], -'Yaf_Session::set' => ['Yaf_Session|bool', 'name'=>'string', 'value'=>'mixed'], -'Yaf_Session::start' => ['void'], -'Yaf_Session::valid' => ['void'], -'Yaf_View_Interface::assign' => ['bool', 'name'=>'string', 'value='=>'string'], -'Yaf_View_Interface::display' => ['bool', 'tpl'=>'string', 'tpl_vars='=>'array'], -'Yaf_View_Interface::getScriptPath' => ['void'], -'Yaf_View_Interface::render' => ['string', 'tpl'=>'string', 'tpl_vars='=>'array'], -'Yaf_View_Interface::setScriptPath' => ['void', 'template_dir'=>'string'], -'Yaf_View_Simple::__construct' => ['void', 'tempalte_dir'=>'string', 'options='=>'array'], -'Yaf_View_Simple::__get' => ['void', 'name='=>'string'], -'Yaf_View_Simple::__isset' => ['void', 'name'=>'string'], -'Yaf_View_Simple::__set' => ['void', 'name'=>'string', 'value'=>'mixed'], -'Yaf_View_Simple::assign' => ['bool', 'name'=>'string', 'value='=>'mixed'], -'Yaf_View_Simple::assignRef' => ['bool', 'name'=>'string', '&rw_value'=>'mixed'], -'Yaf_View_Simple::clear' => ['bool', 'name='=>'string'], -'Yaf_View_Simple::display' => ['bool', 'tpl'=>'string', 'tpl_vars='=>'array'], -'Yaf_View_Simple::eval' => ['string', 'tpl_content'=>'string', 'tpl_vars='=>'array'], -'Yaf_View_Simple::getScriptPath' => ['string'], -'Yaf_View_Simple::render' => ['string', 'tpl'=>'string', 'tpl_vars='=>'array'], -'Yaf_View_Simple::setScriptPath' => ['bool', 'template_dir'=>'string'], -'yaml_emit' => ['string', 'data'=>'mixed', 'encoding='=>'int', 'linebreak='=>'int'], -'yaml_emit_file' => ['bool', 'filename'=>'string', 'data'=>'mixed', 'encoding='=>'int', 'linebreak='=>'int'], -'yaml_parse' => ['mixed', 'input'=>'string', 'pos='=>'int', '&w_ndocs='=>'int', 'callbacks='=>'array'], -'yaml_parse_file' => ['mixed', 'filename'=>'string', 'pos='=>'int', '&w_ndocs='=>'int', 'callbacks='=>'array'], -'yaml_parse_url' => ['mixed', 'url'=>'string', 'pos='=>'int', '&w_ndocs='=>'int', 'callbacks='=>'array'], -'Yar_Client::__call' => ['void', 'method'=>'string', 'parameters'=>'array'], -'Yar_Client::__construct' => ['void', 'url'=>'string'], -'Yar_Client::setOpt' => ['bool', 'name'=>'int', 'value'=>'mixed'], -'Yar_Client_Exception::getType' => ['void'], -'Yar_Concurrent_Client::call' => ['int', 'uri'=>'string', 'method'=>'string', 'parameters'=>'array', 'callback='=>'callable'], -'Yar_Concurrent_Client::loop' => ['bool', 'callback='=>'callable', 'error_callback='=>'callable'], -'Yar_Concurrent_Client::reset' => ['bool'], -'Yar_Server::__construct' => ['void', 'obj'=>'Object'], -'Yar_Server::handle' => ['bool'], -'Yar_Server_Exception::getType' => ['string'], -'yaz_addinfo' => ['string', 'id'=>'resource'], -'yaz_ccl_conf' => ['void', 'id'=>'resource', 'config'=>'array'], -'yaz_ccl_parse' => ['bool', 'id'=>'resource', 'query'=>'string', '&w_result'=>'array'], -'yaz_close' => ['bool', 'id'=>'resource'], -'yaz_connect' => ['mixed', 'zurl'=>'string', 'options='=>'mixed'], -'yaz_database' => ['bool', 'id'=>'resource', 'databases'=>'string'], -'yaz_element' => ['bool', 'id'=>'resource', 'elementset'=>'string'], -'yaz_errno' => ['int', 'id'=>'resource'], -'yaz_error' => ['string', 'id'=>'resource'], -'yaz_es' => ['void', 'id'=>'resource', 'type'=>'string', 'args'=>'array'], -'yaz_es_result' => ['array', 'id'=>'resource'], -'yaz_get_option' => ['string', 'id'=>'resource', 'name'=>'string'], -'yaz_hits' => ['int', 'id'=>'resource', 'searchresult='=>'array'], -'yaz_itemorder' => ['void', 'id'=>'resource', 'args'=>'array'], -'yaz_present' => ['bool', 'id'=>'resource'], -'yaz_range' => ['void', 'id'=>'resource', 'start'=>'int', 'number'=>'int'], -'yaz_record' => ['string', 'id'=>'resource', 'pos'=>'int', 'type'=>'string'], -'yaz_scan' => ['void', 'id'=>'resource', 'type'=>'string', 'startterm'=>'string', 'flags='=>'array'], -'yaz_scan_result' => ['array', 'id'=>'resource', 'result='=>'array'], -'yaz_schema' => ['void', 'id'=>'resource', 'schema'=>'string'], -'yaz_search' => ['bool', 'id'=>'resource', 'type'=>'string', 'query'=>'string'], -'yaz_set_option' => ['', 'id'=>'', 'name'=>'string', 'value'=>'string', 'options'=>'array'], -'yaz_sort' => ['void', 'id'=>'resource', 'criteria'=>'string'], -'yaz_syntax' => ['void', 'id'=>'resource', 'syntax'=>'string'], -'yaz_wait' => ['mixed', '&rw_options='=>'array'], -'yp_all' => ['void', 'domain'=>'string', 'map'=>'string', 'callback'=>'string'], -'yp_cat' => ['array', 'domain'=>'string', 'map'=>'string'], -'yp_err_string' => ['string', 'errorcode'=>'int'], -'yp_errno' => ['int'], -'yp_first' => ['array', 'domain'=>'string', 'map'=>'string'], -'yp_get_default_domain' => ['string'], -'yp_master' => ['string', 'domain'=>'string', 'map'=>'string'], -'yp_match' => ['string', 'domain'=>'string', 'map'=>'string', 'key'=>'string'], -'yp_next' => ['array', 'domain'=>'string', 'map'=>'string', 'key'=>'string'], -'yp_order' => ['int', 'domain'=>'string', 'map'=>'string'], -'zem_get_extension_info_by_id' => [''], -'zem_get_extension_info_by_name' => [''], -'zem_get_extensions_info' => [''], -'zem_get_license_info' => [''], -'zend_current_obfuscation_level' => ['int'], -'zend_disk_cache_clear' => ['bool', 'namespace='=>'mixed|string'], -'zend_disk_cache_delete' => ['mixed|null', 'key'=>''], -'zend_disk_cache_fetch' => ['mixed|null', 'key'=>''], -'zend_disk_cache_store' => ['bool', 'key'=>'', 'value'=>'', 'ttl='=>'int|mixed'], -'zend_get_id' => ['array', 'all_ids='=>'all_ids|false'], -'zend_is_configuration_changed' => [''], -'zend_loader_current_file' => ['string'], -'zend_loader_enabled' => ['bool'], -'zend_loader_file_encoded' => ['bool'], -'zend_loader_file_licensed' => ['array'], -'zend_loader_install_license' => ['bool', 'license_file'=>'license_file', 'override'=>'override'], -'zend_logo_guid' => ['string'], -'zend_obfuscate_class_name' => ['string', 'class_name'=>'class_name'], -'zend_obfuscate_function_name' => ['string', 'function_name'=>'function_name'], -'zend_optimizer_version' => ['string'], -'zend_runtime_obfuscate' => ['void'], -'zend_send_buffer' => ['bool', 'buffer'=>'buffer', 'mime_type'=>'mime_type', 'custom_headers'=>'custom_headers'], -'zend_send_file' => ['bool', 'filename'=>'filename', 'mime_type'=>'mime_type', 'custom_headers'=>'custom_headers'], -'zend_set_configuration_changed' => [''], -'zend_shm_cache_clear' => ['bool', 'namespace='=>'mixed|string'], -'zend_shm_cache_delete' => ['mixed|null', 'key'=>''], -'zend_shm_cache_fetch' => ['mixed|null', 'key'=>''], -'zend_shm_cache_store' => ['bool', 'key'=>'', 'value'=>'', 'ttl='=>'int|mixed'], -'zend_thread_id' => ['int'], -'zend_version' => ['string'], -'ZendAPI_Job::addJobToQueue' => ['int', 'jobqueue_url'=>'string', 'password'=>'string'], -'ZendAPI_Job::getApplicationID' => [''], -'ZendAPI_Job::getEndTime' => [''], -'ZendAPI_Job::getGlobalVariables' => [''], -'ZendAPI_Job::getHost' => [''], -'ZendAPI_Job::getID' => [''], -'ZendAPI_Job::getInterval' => [''], -'ZendAPI_Job::getJobDependency' => [''], -'ZendAPI_Job::getJobName' => [''], -'ZendAPI_Job::getJobPriority' => [''], -'ZendAPI_Job::getJobStatus' => ['int'], -'ZendAPI_Job::getLastPerformedStatus' => ['int'], -'ZendAPI_Job::getOutput' => ['An'], -'ZendAPI_Job::getPreserved' => [''], -'ZendAPI_Job::getProperties' => ['array'], -'ZendAPI_Job::getScheduledTime' => [''], -'ZendAPI_Job::getScript' => [''], -'ZendAPI_Job::getTimeToNextRepeat' => ['int'], -'ZendAPI_Job::getUserVariables' => [''], -'ZendAPI_Job::setApplicationID' => ['', 'app_id'=>''], -'ZendAPI_Job::setGlobalVariables' => ['', 'vars'=>''], -'ZendAPI_Job::setJobDependency' => ['', 'job_id'=>''], -'ZendAPI_Job::setJobName' => ['', 'name'=>''], -'ZendAPI_Job::setJobPriority' => ['', 'priority'=>'int'], -'ZendAPI_Job::setPreserved' => ['', 'preserved'=>''], -'ZendAPI_Job::setRecurrenceData' => ['', 'interval'=>'', 'end_time='=>'mixed'], -'ZendAPI_Job::setScheduledTime' => ['', 'timestamp'=>''], -'ZendAPI_Job::setScript' => ['', 'script'=>''], -'ZendAPI_Job::setUserVariables' => ['', 'vars'=>''], -'ZendAPI_Job::ZendAPI_Job' => ['Job', 'script'=>'script'], -'ZendAPI_Queue::addJob' => ['int', '&job'=>'Job'], -'ZendAPI_Queue::getAllApplicationIDs' => ['array'], -'ZendAPI_Queue::getAllhosts' => ['array'], -'ZendAPI_Queue::getHistoricJobs' => ['array', 'status'=>'int', 'start_time'=>'', 'end_time'=>'', 'index'=>'int', 'count'=>'int', '&total'=>'int'], -'ZendAPI_Queue::getJob' => ['Job', 'job_id'=>'int'], -'ZendAPI_Queue::getJobsInQueue' => ['array', 'filter_options='=>'array', 'max_jobs='=>'int', 'with_globals_and_output='=>'bool|false'], -'ZendAPI_Queue::getLastError' => ['string'], -'ZendAPI_Queue::getNumOfJobsInQueue' => ['int', 'filter_options='=>'array'], -'ZendAPI_Queue::getStatistics' => ['array'], -'ZendAPI_Queue::isScriptExists' => ['bool', 'path'=>'string'], -'ZendAPI_Queue::isSuspend' => ['bool'], -'ZendAPI_Queue::login' => ['bool', 'password'=>'string', 'application_id='=>'int'], -'ZendAPI_Queue::removeJob' => ['bool', 'job_id'=>'array|int'], -'ZendAPI_Queue::requeueJob' => ['bool', 'job'=>'Job'], -'ZendAPI_Queue::resumeJob' => ['bool', 'job_id'=>'array|int'], -'ZendAPI_Queue::resumeQueue' => ['bool'], -'ZendAPI_Queue::setMaxHistoryTime' => ['bool'], -'ZendAPI_Queue::suspendJob' => ['bool', 'job_id'=>'array|int'], -'ZendAPI_Queue::suspendQueue' => ['bool'], -'ZendAPI_Queue::updateJob' => ['int', '&job'=>'Job'], -'ZendAPI_Queue::zendapi_queue' => ['ZendAPI_Queue', 'queue_url'=>'string'], -'zip_close' => ['void', 'zip'=>'resource'], -'zip_entry_close' => ['bool', 'zip_ent'=>'resource'], -'zip_entry_compressedsize' => ['int', 'zip_entry'=>'resource'], -'zip_entry_compressionmethod' => ['string', 'zip_entry'=>'resource'], -'zip_entry_filesize' => ['int', 'zip_entry'=>'resource'], -'zip_entry_name' => ['string', 'zip_entry'=>'resource'], -'zip_entry_open' => ['bool', 'zip_dp'=>'resource', 'zip_entry'=>'resource', 'mode='=>'string'], -'zip_entry_read' => ['string|false', 'zip_entry'=>'resource', 'len='=>'int'], -'zip_open' => ['resource', 'filename'=>'string'], -'zip_read' => ['resource', 'zip'=>'resource'], -'ZipArchive::addEmptyDir' => ['bool', 'dirname'=>'string'], -'ZipArchive::addFile' => ['bool', 'filepath'=>'string', 'entryname='=>'string', 'start='=>'int', 'length='=>'int'], -'ZipArchive::addFromString' => ['bool', 'entryname'=>'string', 'content'=>'string'], -'ZipArchive::addGlob' => ['bool', 'pattern'=>'string', 'flags='=>'int', 'options='=>'array'], -'ZipArchive::addPattern' => ['bool', 'pattern'=>'string', 'path='=>'string', 'options='=>'array'], -'ZipArchive::close' => ['bool'], -'ZipArchive::count' => ['int'], -'ZipArchive::createEmptyDir' => ['bool', 'dirname'=>'string'], -'ZipArchive::deleteIndex' => ['bool', 'index'=>'int'], -'ZipArchive::deleteName' => ['bool', 'name'=>'string'], -'ZipArchive::extractTo' => ['bool', 'pathto'=>'string', 'files='=>'string[]|string'], -'ZipArchive::getArchiveComment' => ['string', 'flags='=>'int'], -'ZipArchive::getCommentIndex' => ['string', 'index'=>'int', 'flags='=>'int'], -'ZipArchive::getCommentName' => ['string', 'name'=>'string', 'flags='=>'int'], -'ZipArchive::getExternalAttributesIndex' => ['bool', 'index'=>'int', '&w_opsys'=>'int', '&w_attr'=>'int', 'flags='=>'int'], -'ZipArchive::getExternalAttributesName' => ['bool', 'name'=>'string', '&w_opsys'=>'int', '&w_attr'=>'int', 'flags='=>'int'], -'ZipArchive::getFromIndex' => ['string|false', 'index'=>'int', 'len='=>'int', 'flags='=>'int'], -'ZipArchive::getFromName' => ['string|false', 'entryname'=>'string', 'len='=>'int', 'flags='=>'int'], -'ZipArchive::getNameIndex' => ['string|false', 'index'=>'int', 'flags='=>'int'], -'ZipArchive::getStatusString' => ['string'], -'ZipArchive::getStream' => ['resource|false', 'entryname'=>'string'], -'ZipArchive::locateName' => ['int', 'filename'=>'string', 'flags='=>'int'], -'ZipArchive::open' => ['mixed', 'source'=>'string', 'flags='=>'int'], -'ZipArchive::renameIndex' => ['bool', 'index'=>'int', 'new_name'=>'string'], -'ZipArchive::renameName' => ['bool', 'name'=>'string', 'new_name'=>'string'], -'ZipArchive::setArchiveComment' => ['bool', 'comment'=>'string'], -'ZipArchive::setCommentIndex' => ['bool', 'index'=>'int', 'comment'=>'string'], -'ZipArchive::setCommentName' => ['bool', 'name'=>'string', 'comment'=>'string'], -'ZipArchive::setCompressionIndex' => ['bool', 'index'=>'int', 'comp_method'=>'int', 'comp_flags='=>'int'], -'ZipArchive::setCompressionName' => ['bool', 'name'=>'string', 'comp_method'=>'int', 'comp_flags='=>'int'], -'ZipArchive::setEncryptionIndex' => ['bool', 'index'=>'int', 'method'=>'string', 'password='=>'string'], -'ZipArchive::setEncryptionName' => ['bool', 'name'=>'string', 'method'=>'int', 'password='=>'string'], -'ZipArchive::setExternalAttributesIndex' => ['bool', 'index'=>'int', 'opsys'=>'int', 'attr'=>'int', 'flags='=>'int'], -'ZipArchive::setExternalAttributesName' => ['bool', 'name'=>'string', 'opsys'=>'int', 'attr'=>'int', 'flags='=>'int'], -'ZipArchive::setPassword' => ['bool', 'password'=>'string'], -'ZipArchive::statIndex' => ['array|false', 'index'=>'int', 'flags='=>'int'], -'ZipArchive::statName' => ['array|false', 'filename'=>'string', 'flags='=>'int'], -'ZipArchive::unchangeAll' => ['bool'], -'ZipArchive::unchangeArchive' => ['bool'], -'ZipArchive::unchangeIndex' => ['bool', 'index'=>'int'], -'ZipArchive::unchangeName' => ['bool', 'name'=>'string'], -'zlib_decode' => ['string', 'data'=>'string', 'max_decoded_len='=>'int'], -'zlib_encode' => ['string', 'data'=>'string', 'encoding'=>'int', 'level='=>'string|int'], -'zlib_get_coding_type' => ['string|false'], -'ZMQ::__construct' => ['void'], -'ZMQContext::__construct' => ['void', 'io_threads='=>'int', 'is_persistent='=>'bool'], -'ZMQContext::getOpt' => ['mixed', 'key'=>'string'], -'ZMQContext::getSocket' => ['ZMQSocket', 'type'=>'int', 'persistent_id='=>'string', 'on_new_socket='=>'callable'], -'ZMQContext::isPersistent' => ['bool'], -'ZMQContext::setOpt' => ['ZMQContext', 'key'=>'int', 'value'=>'mixed'], -'ZMQDevice::__construct' => ['void', 'frontend'=>'ZMQSocket', 'backend'=>'ZMQSocket', 'listener='=>'ZMQSocket'], -'ZMQDevice::getIdleTimeout' => ['ZMQDevice'], -'ZMQDevice::getTimerTimeout' => ['ZMQDevice'], -'ZMQDevice::run' => ['void'], -'ZMQDevice::setIdleCallback' => ['ZMQDevice', 'cb_func'=>'callable', 'timeout'=>'int', 'user_data='=>'mixed'], -'ZMQDevice::setIdleTimeout' => ['ZMQDevice', 'timeout'=>'int'], -'ZMQDevice::setTimerCallback' => ['ZMQDevice', 'cb_func'=>'callable', 'timeout'=>'int', 'user_data='=>'mixed'], -'ZMQDevice::setTimerTimeout' => ['ZMQDevice', 'timeout'=>'int'], -'ZMQPoll::add' => ['string', 'entry'=>'mixed', 'type'=>'int'], -'ZMQPoll::clear' => ['ZMQPoll'], -'ZMQPoll::count' => ['int'], -'ZMQPoll::getLastErrors' => ['array'], -'ZMQPoll::poll' => ['int', '&w_readable'=>'array', '&w_writable'=>'array', 'timeout='=>'int'], -'ZMQPoll::remove' => ['bool', 'item'=>'mixed'], -'ZMQSocket::__construct' => ['void', 'context'=>'ZMQContext', 'type'=>'int', 'persistent_id='=>'string', 'on_new_socket='=>'callable'], -'ZMQSocket::bind' => ['ZMQSocket', 'dsn'=>'string', 'force='=>'bool'], -'ZMQSocket::connect' => ['ZMQSocket', 'dsn'=>'string', 'force='=>'bool'], -'ZMQSocket::disconnect' => ['ZMQSocket', 'dsn'=>'string'], -'ZMQSocket::getEndpoints' => ['array'], -'ZMQSocket::getPersistentId' => ['string'], -'ZMQSocket::getSocketType' => ['int'], -'ZMQSocket::getSockOpt' => ['mixed', 'key'=>'string'], -'ZMQSocket::isPersistent' => ['bool'], -'ZMQSocket::recv' => ['string', 'mode='=>'int'], -'ZMQSocket::recvMulti' => ['string', 'mode='=>'int'], -'ZMQSocket::send' => ['ZMQSocket', 'message'=>'array', 'mode='=>'int'], -'ZMQSocket::send\'1' => ['ZMQSocket', 'message'=>'string', 'mode='=>'int'], -'ZMQSocket::sendmulti' => ['ZMQSocket', 'message'=>'array', 'mode='=>'int'], -'ZMQSocket::setSockOpt' => ['ZMQSocket', 'key'=>'int', 'value'=>'mixed'], -'ZMQSocket::unbind' => ['ZMQSocket', 'dsn'=>'string'], -'Zookeeper::addAuth' => ['bool', 'scheme'=>'string', 'cert'=>'string', 'completion_cb='=>'callable'], -'Zookeeper::connect' => ['void', 'host'=>'string', 'watcher_cb='=>'callable', 'recv_timeout='=>'int'], -'Zookeeper::create' => ['string', 'path'=>'string', 'value'=>'string', 'acls'=>'array', 'flags='=>'int'], -'Zookeeper::delete' => ['bool', 'path'=>'string', 'version='=>'int'], -'Zookeeper::exists' => ['bool', 'path'=>'string', 'watcher_cb='=>'callable'], -'Zookeeper::get' => ['string', 'path'=>'string', 'watcher_cb='=>'callable', 'stat='=>'array', 'max_size='=>'int'], -'Zookeeper::getAcl' => ['array', 'path'=>'string'], -'Zookeeper::getChildren' => ['array', 'path'=>'string', 'watcher_cb='=>'callable'], -'Zookeeper::getClientId' => ['int'], -'Zookeeper::getRecvTimeout' => ['int'], -'Zookeeper::getState' => ['int'], -'Zookeeper::isRecoverable' => ['bool'], -'Zookeeper::set' => ['bool', 'path'=>'string', 'value'=>'string', 'version='=>'int', 'stat='=>'array'], -'Zookeeper::setAcl' => ['bool', 'path'=>'string', 'version'=>'int', 'acl'=>'array'], -'Zookeeper::setDebugLevel' => ['bool', 'logLevel'=>'int'], -'Zookeeper::setDeterministicConnOrder' => ['bool', 'yesOrNo'=>'bool'], -'Zookeeper::setLogStream' => ['bool', 'stream'=>'resource'], -'Zookeeper::setWatcher' => ['bool', 'watcher_cb'=>'callable'], -'zookeeper_dispatch' => ['void'], -]; diff --git a/vendor/phpstan/phpstan/src/Reflection/SignatureMap/functionMap_php74delta.php b/vendor/phpstan/phpstan/src/Reflection/SignatureMap/functionMap_php74delta.php deleted file mode 100644 index f1755fc..0000000 --- a/vendor/phpstan/phpstan/src/Reflection/SignatureMap/functionMap_php74delta.php +++ /dev/null @@ -1,53 +0,0 @@ - [ - 'FFI::addr' => ['FFI\CData', '&ptr'=>'FFI\CData'], - 'FFI::alignof' => ['int', '&ptr'=>'mixed'], - 'FFI::arrayType' => ['FFI\CType', 'type'=>'string|FFI\CType', 'dims'=>'array'], - 'FFI::cast' => ['FFI\CData', 'type'=>'string|FFI\CType', '&ptr'=>''], - 'FFI::cdef' => ['FFI', 'code='=>'string', 'lib='=>'?string'], - 'FFI::free' => ['void', '&ptr'=>'FFI\CData'], - 'FFI::load' => ['FFI', 'filename'=>'string'], - 'FFI::memcmp' => ['int', '&ptr1'=>'FFI\CData|string', '&ptr2'=>'FFI\CData|string', 'size'=>'int'], - 'FFI::memcpy' => ['void', '&dst'=>'FFI\CData', '&src'=>'string|FFI\CData', 'size'=>'int'], - 'FFI::memset' => ['void', '&ptr'=>'FFI\CData', 'ch'=>'int', 'size'=>'int'], - 'FFI::new' => ['FFI\CData', 'type'=>'string|FFI\CType', 'owned='=>'bool', 'persistent='=>'bool'], - 'FFI::scope' => ['FFI', 'scope_name'=>'string'], - 'FFI::sizeof' => ['int', '&ptr'=>'FFI\CData|FFI\CType'], - 'FFI::string' => ['string', '&ptr'=>'FFI\CData', 'size='=>'int'], - 'FFI::typeof' => ['FFI\CType', '&ptr'=>'FFI\CData'], - 'FFI::type' => ['FFI\CType', 'type'=>'string'], - 'get_mangled_object_vars' => ['array', 'obj'=>'object'], - 'mb_str_split' => ['array|false', 'str'=>'string', 'split_length='=>'int', 'encoding='=>'string'], - 'password_algos' => ['array'], - 'password_hash' => ['string|false', 'password'=>'string', 'algo'=>'string|null', 'options='=>'array'], - 'password_needs_rehash' => ['bool', 'hash'=>'string', 'algo'=>'string|null', 'options='=>'array'], - 'ReflectionReference::fromArrayElement' => ['?ReflectionReference', 'array'=>'array', 'key'=>'int|string'], - 'ReflectionReference::getId' => ['string'], - 'SQLite3Stmt::getSQL' => ['string', 'expanded='=>'bool'], - 'WeakReference::create' => ['WeakReference', 'referent'=>'object'], - 'WeakReference::get' => ['?object'], - ], - 'old' => [], -]; diff --git a/vendor/phpstan/phpstan/src/Reflection/ThrowableReflection.php b/vendor/phpstan/phpstan/src/Reflection/ThrowableReflection.php deleted file mode 100644 index 8846162..0000000 --- a/vendor/phpstan/phpstan/src/Reflection/ThrowableReflection.php +++ /dev/null @@ -1,12 +0,0 @@ - - */ - public function getParameters(): array - { - return []; - } - - public function isVariadic(): bool - { - return true; - } - - public function getReturnType(): Type - { - return new MixedType(); - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Arrays/AllowedArrayKeysTypes.php b/vendor/phpstan/phpstan/src/Rules/Arrays/AllowedArrayKeysTypes.php deleted file mode 100644 index 6a2cc62..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Arrays/AllowedArrayKeysTypes.php +++ /dev/null @@ -1,27 +0,0 @@ -propertyReflectionFinder = $propertyReflectionFinder; - $this->ruleLevelHelper = $ruleLevelHelper; - } - - public function getNodeType(): string - { - return \PhpParser\Node\Expr::class; - } - - /** - * @param \PhpParser\Node\Expr $node - * @param \PHPStan\Analyser\Scope $scope - * @return string[] - */ - public function processNode(\PhpParser\Node $node, Scope $scope): array - { - if ( - !$node instanceof Assign - && !$node instanceof AssignOp - ) { - return []; - } - - if (!($node->var instanceof ArrayDimFetch)) { - return []; - } - - if ( - !$node->var->var instanceof \PhpParser\Node\Expr\PropertyFetch - && !$node->var->var instanceof \PhpParser\Node\Expr\StaticPropertyFetch - ) { - return []; - } - - $propertyReflection = $this->propertyReflectionFinder->findPropertyReflectionFromNode($node->var->var, $scope); - if ($propertyReflection === null) { - return []; - } - - $assignedToType = $propertyReflection->getType(); - if (!($assignedToType instanceof ArrayType)) { - return []; - } - - if ($node instanceof Assign) { - $assignedValueType = $scope->getType($node->expr); - } else { - $assignedValueType = $scope->getType($node); - } - - $itemType = $assignedToType->getItemType(); - if (!$this->ruleLevelHelper->accepts($itemType, $assignedValueType, $scope->isDeclareStrictTypes())) { - $verbosityLevel = $itemType->isCallable()->and($assignedValueType->isCallable())->yes() ? VerbosityLevel::value() : VerbosityLevel::typeOnly(); - return [ - sprintf( - 'Array (%s) does not accept %s.', - $assignedToType->describe($verbosityLevel), - $assignedValueType->describe($verbosityLevel) - ), - ]; - } - - return []; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Arrays/AppendedArrayKeyTypeRule.php b/vendor/phpstan/phpstan/src/Rules/Arrays/AppendedArrayKeyTypeRule.php deleted file mode 100644 index 323db17..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Arrays/AppendedArrayKeyTypeRule.php +++ /dev/null @@ -1,94 +0,0 @@ -propertyReflectionFinder = $propertyReflectionFinder; - $this->checkUnionTypes = $checkUnionTypes; - } - - public function getNodeType(): string - { - return Assign::class; - } - - /** - * @param \PhpParser\Node\Expr\Assign $node - * @param \PHPStan\Analyser\Scope $scope - * @return string[] - */ - public function processNode(\PhpParser\Node $node, Scope $scope): array - { - if (!($node->var instanceof ArrayDimFetch)) { - return []; - } - - if ( - !$node->var->var instanceof \PhpParser\Node\Expr\PropertyFetch - && !$node->var->var instanceof \PhpParser\Node\Expr\StaticPropertyFetch - ) { - return []; - } - - $propertyReflection = $this->propertyReflectionFinder->findPropertyReflectionFromNode($node->var->var, $scope); - if ($propertyReflection === null) { - return []; - } - - $arrayType = $propertyReflection->getType(); - if (!$arrayType instanceof ArrayType) { - return []; - } - - if ($node->var->dim !== null) { - $dimensionType = $scope->getType($node->var->dim); - $isValidKey = AllowedArrayKeysTypes::getType()->isSuperTypeOf($dimensionType); - if (!$isValidKey->yes()) { - // already handled by InvalidKeyInArrayDimFetchRule - return []; - } - - $keyType = ArrayType::castToArrayKeyType($dimensionType); - if (!$this->checkUnionTypes && $keyType instanceof UnionType) { - return []; - } - } else { - $keyType = new IntegerType(); - } - - if (!$arrayType->getIterableKeyType()->isSuperTypeOf($keyType)->yes()) { - return [ - sprintf( - 'Array (%s) does not accept key %s.', - $arrayType->describe(VerbosityLevel::typeOnly()), - $keyType->describe(VerbosityLevel::value()) - ), - ]; - } - - return []; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Arrays/DeadForeachRule.php b/vendor/phpstan/phpstan/src/Rules/Arrays/DeadForeachRule.php deleted file mode 100644 index afc7d04..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Arrays/DeadForeachRule.php +++ /dev/null @@ -1,38 +0,0 @@ -getType($node->expr); - if ($iterableType->isIterable()->no()) { - return []; - } - - if (!$iterableType->isIterableAtLeastOnce()->no()) { - return []; - } - - return [ - 'Empty array passed to foreach.', - ]; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Arrays/DuplicateKeysInLiteralArraysRule.php b/vendor/phpstan/phpstan/src/Rules/Arrays/DuplicateKeysInLiteralArraysRule.php deleted file mode 100644 index 09d1557..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Arrays/DuplicateKeysInLiteralArraysRule.php +++ /dev/null @@ -1,85 +0,0 @@ -printer = $printer; - } - - public function getNodeType(): string - { - return LiteralArrayNode::class; - } - - /** - * @param LiteralArrayNode $node - * @param \PHPStan\Analyser\Scope $scope - * @return RuleError[] - */ - public function processNode(\PhpParser\Node $node, Scope $scope): array - { - $values = []; - $duplicateKeys = []; - $printedValues = []; - $valueLines = []; - foreach ($node->getItemNodes() as $itemNode) { - $item = $itemNode->getArrayItem(); - if ($item->key === null) { - continue; - } - - $key = $item->key; - $keyType = $itemNode->getScope()->getType($key); - if ( - !$keyType instanceof ConstantScalarType - ) { - continue; - } - - $printedValue = $this->printer->prettyPrintExpr($key); - $value = $keyType->getValue(); - $printedValues[$value][] = $printedValue; - - if (!isset($valueLines[$value])) { - $valueLines[$value] = $item->getLine(); - } - - $previousCount = count($values); - $values[$value] = $printedValue; - if ($previousCount !== count($values)) { - continue; - } - - $duplicateKeys[$value] = true; - } - - $messages = []; - foreach (array_keys($duplicateKeys) as $value) { - $messages[] = RuleErrorBuilder::message(sprintf( - 'Array has %d %s with value %s (%s).', - count($printedValues[$value]), - count($printedValues[$value]) === 1 ? 'duplicate key' : 'duplicate keys', - var_export($value, true), - implode(', ', $printedValues[$value]) - ))->line($valueLines[$value])->build(); - } - - return $messages; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Arrays/InvalidKeyInArrayDimFetchRule.php b/vendor/phpstan/phpstan/src/Rules/Arrays/InvalidKeyInArrayDimFetchRule.php deleted file mode 100644 index eae58dd..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Arrays/InvalidKeyInArrayDimFetchRule.php +++ /dev/null @@ -1,57 +0,0 @@ -reportMaybes = $reportMaybes; - } - - public function getNodeType(): string - { - return \PhpParser\Node\Expr\ArrayDimFetch::class; - } - - /** - * @param \PhpParser\Node\Expr\ArrayDimFetch $node - * @param \PHPStan\Analyser\Scope $scope - * @return string[] - */ - public function processNode(\PhpParser\Node $node, Scope $scope): array - { - if ($node->dim === null) { - return []; - } - - $varType = $scope->getType($node->var); - if (count(TypeUtils::getArrays($varType)) === 0) { - return []; - } - - $dimensionType = $scope->getType($node->dim); - $isSuperType = AllowedArrayKeysTypes::getType()->isSuperTypeOf($dimensionType); - if ($isSuperType->no()) { - return [ - sprintf('Invalid array key type %s.', $dimensionType->describe(VerbosityLevel::typeOnly())), - ]; - } elseif ($this->reportMaybes && $isSuperType->maybe() && !$dimensionType instanceof MixedType) { - return [ - sprintf('Possibly invalid array key type %s.', $dimensionType->describe(VerbosityLevel::typeOnly())), - ]; - } - - return []; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Arrays/InvalidKeyInArrayItemRule.php b/vendor/phpstan/phpstan/src/Rules/Arrays/InvalidKeyInArrayItemRule.php deleted file mode 100644 index 3e4aba0..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Arrays/InvalidKeyInArrayItemRule.php +++ /dev/null @@ -1,51 +0,0 @@ -reportMaybes = $reportMaybes; - } - - public function getNodeType(): string - { - return \PhpParser\Node\Expr\ArrayItem::class; - } - - /** - * @param \PhpParser\Node\Expr\ArrayItem $node - * @param \PHPStan\Analyser\Scope $scope - * @return string[] - */ - public function processNode(\PhpParser\Node $node, Scope $scope): array - { - if ($node->key === null) { - return []; - } - - $dimensionType = $scope->getType($node->key); - $isSuperType = AllowedArrayKeysTypes::getType()->isSuperTypeOf($dimensionType); - if ($isSuperType->no()) { - return [ - sprintf('Invalid array key type %s.', $dimensionType->describe(VerbosityLevel::typeOnly())), - ]; - } elseif ($this->reportMaybes && $isSuperType->maybe() && !$dimensionType instanceof MixedType) { - return [ - sprintf('Possibly invalid array key type %s.', $dimensionType->describe(VerbosityLevel::typeOnly())), - ]; - } - - return []; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Arrays/IterableInForeachRule.php b/vendor/phpstan/phpstan/src/Rules/Arrays/IterableInForeachRule.php deleted file mode 100644 index c402bcc..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Arrays/IterableInForeachRule.php +++ /dev/null @@ -1,61 +0,0 @@ -ruleLevelHelper = $ruleLevelHelper; - } - - public function getNodeType(): string - { - return \PhpParser\Node\Stmt\Foreach_::class; - } - - /** - * @param \PhpParser\Node\Stmt\Foreach_ $node - * @param \PHPStan\Analyser\Scope $scope - * @return RuleError[] - */ - public function processNode(Node $node, Scope $scope): array - { - $typeResult = $this->ruleLevelHelper->findTypeToCheck( - $scope, - $node->expr, - 'Iterating over an object of an unknown class %s.', - static function (Type $type): bool { - return $type->isIterable()->yes(); - } - ); - $type = $typeResult->getType(); - if ($type instanceof ErrorType) { - return $typeResult->getUnknownClassErrors(); - } - if ($type->isIterable()->yes()) { - return []; - } - - return [ - RuleErrorBuilder::message(sprintf( - 'Argument of an invalid type %s supplied for foreach, only iterables are supported.', - $type->describe(VerbosityLevel::typeOnly()) - ))->line($node->expr->getLine())->build(), - ]; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Arrays/NonexistentOffsetInArrayDimFetchRule.php b/vendor/phpstan/phpstan/src/Rules/Arrays/NonexistentOffsetInArrayDimFetchRule.php deleted file mode 100644 index 2dc7c76..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Arrays/NonexistentOffsetInArrayDimFetchRule.php +++ /dev/null @@ -1,140 +0,0 @@ -ruleLevelHelper = $ruleLevelHelper; - $this->reportMaybes = $reportMaybes; - } - - public function getNodeType(): string - { - return \PhpParser\Node\Expr\ArrayDimFetch::class; - } - - /** - * @param \PhpParser\Node\Expr\ArrayDimFetch $node - * @param \PHPStan\Analyser\Scope $scope - * @return RuleError[] - */ - public function processNode(\PhpParser\Node $node, Scope $scope): array - { - if ($node->dim !== null) { - $dimType = $scope->getType($node->dim); - $unknownClassPattern = sprintf('Access to offset %s on an unknown class %%s.', $dimType->describe(VerbosityLevel::value())); - } else { - $dimType = null; - $unknownClassPattern = 'Access to an offset on an unknown class %s.'; - } - - $typeResult = $this->ruleLevelHelper->findTypeToCheck( - $scope, - $node->var, - $unknownClassPattern, - static function (Type $type) use ($dimType): bool { - if ($dimType === null) { - return $type->isOffsetAccessible()->yes(); - } - - return $type->isOffsetAccessible()->yes() && $type->hasOffsetValueType($dimType)->yes(); - } - ); - $type = $typeResult->getType(); - if ($type instanceof ErrorType) { - return $typeResult->getUnknownClassErrors(); - } - - $isOffsetAccessible = $type->isOffsetAccessible(); - - if ($scope->isInExpressionAssign($node) && !$isOffsetAccessible->no()) { - return []; - } - - if (!$isOffsetAccessible->yes()) { - if ($dimType !== null) { - return [ - RuleErrorBuilder::message(sprintf( - 'Cannot access offset %s on %s.', - $dimType->describe(VerbosityLevel::value()), - $type->describe(VerbosityLevel::value()) - ))->build(), - ]; - } - - return [ - RuleErrorBuilder::message(sprintf( - 'Cannot access an offset on %s.', - $type->describe(VerbosityLevel::typeOnly()) - ))->build(), - ]; - } - - if ($dimType === null) { - return []; - } - - $hasOffsetValueType = $type->hasOffsetValueType($dimType); - $report = $hasOffsetValueType->no(); - if ($hasOffsetValueType->maybe()) { - $constantArrays = TypeUtils::getConstantArrays($type); - if (count($constantArrays) > 0) { - foreach ($constantArrays as $constantArray) { - if ($constantArray->hasOffsetValueType($dimType)->no()) { - $report = true; - break; - } - } - } - } - - if (!$report && $this->reportMaybes) { - foreach (TypeUtils::flattenTypes($type) as $innerType) { - if ($dimType instanceof UnionType) { - if ($innerType->hasOffsetValueType($dimType)->no()) { - $report = true; - break; - } - continue; - } - foreach (TypeUtils::flattenTypes($dimType) as $innerDimType) { - if ($innerType->hasOffsetValueType($innerDimType)->no()) { - $report = true; - break; - } - } - } - } - - if ($report) { - return [ - RuleErrorBuilder::message(sprintf('Offset %s does not exist on %s.', $dimType->describe(VerbosityLevel::value()), $type->describe(VerbosityLevel::value())))->build(), - ]; - } - - return []; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Arrays/OffsetAccessAssignOpRule.php b/vendor/phpstan/phpstan/src/Rules/Arrays/OffsetAccessAssignOpRule.php deleted file mode 100644 index ebff85e..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Arrays/OffsetAccessAssignOpRule.php +++ /dev/null @@ -1,95 +0,0 @@ -ruleLevelHelper = $ruleLevelHelper; - } - - public function getNodeType(): string - { - return \PhpParser\Node\Expr\AssignOp::class; - } - - /** - * @param \PhpParser\Node\Expr\AssignOp $node - * @param \PHPStan\Analyser\Scope $scope - * @return string[] - */ - public function processNode(\PhpParser\Node $node, Scope $scope): array - { - if (!$node->var instanceof ArrayDimFetch) { - return []; - } - - $arrayDimFetch = $node->var; - - $potentialDimType = null; - if ($arrayDimFetch->dim !== null) { - $potentialDimType = $scope->getType($arrayDimFetch->dim); - } - - $varTypeResult = $this->ruleLevelHelper->findTypeToCheck( - $scope, - $arrayDimFetch->var, - '', - static function (Type $varType) use ($potentialDimType): bool { - $arrayDimType = $varType->setOffsetValueType($potentialDimType, new MixedType()); - return !($arrayDimType instanceof ErrorType); - } - ); - $varType = $varTypeResult->getType(); - - if ($arrayDimFetch->dim !== null) { - $dimTypeResult = $this->ruleLevelHelper->findTypeToCheck( - $scope, - $arrayDimFetch->dim, - '', - static function (Type $dimType) use ($varType): bool { - $arrayDimType = $varType->setOffsetValueType($dimType, new MixedType()); - return !($arrayDimType instanceof ErrorType); - } - ); - $dimType = $dimTypeResult->getType(); - if ($varType->hasOffsetValueType($dimType)->no()) { - return []; - } - } else { - $dimType = $potentialDimType; - } - - $resultType = $varType->setOffsetValueType($dimType, new MixedType()); - if (!($resultType instanceof ErrorType)) { - return []; - } - - if ($dimType === null) { - return [sprintf( - 'Cannot assign new offset to %s.', - $varType->describe(VerbosityLevel::typeOnly()) - )]; - } - - return [sprintf( - 'Cannot assign offset %s to %s.', - $dimType->describe(VerbosityLevel::value()), - $varType->describe(VerbosityLevel::typeOnly()) - )]; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Arrays/OffsetAccessAssignmentRule.php b/vendor/phpstan/phpstan/src/Rules/Arrays/OffsetAccessAssignmentRule.php deleted file mode 100644 index ee1050a..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Arrays/OffsetAccessAssignmentRule.php +++ /dev/null @@ -1,89 +0,0 @@ -ruleLevelHelper = $ruleLevelHelper; - } - - public function getNodeType(): string - { - return \PhpParser\Node\Expr\ArrayDimFetch::class; - } - - /** - * @param \PhpParser\Node\Expr\ArrayDimFetch $node - * @param \PHPStan\Analyser\Scope $scope - * @return string[] - */ - public function processNode(\PhpParser\Node $node, Scope $scope): array - { - if (!$scope->isInExpressionAssign($node)) { - return []; - } - - $potentialDimType = null; - if ($node->dim !== null) { - $potentialDimType = $scope->getType($node->dim); - } - - $varTypeResult = $this->ruleLevelHelper->findTypeToCheck( - $scope, - $node->var, - '', - static function (Type $varType) use ($potentialDimType): bool { - $arrayDimType = $varType->setOffsetValueType($potentialDimType, new MixedType()); - return !($arrayDimType instanceof ErrorType); - } - ); - $varType = $varTypeResult->getType(); - - if ($node->dim !== null) { - $dimTypeResult = $this->ruleLevelHelper->findTypeToCheck( - $scope, - $node->dim, - '', - static function (Type $dimType) use ($varType): bool { - $arrayDimType = $varType->setOffsetValueType($dimType, new MixedType()); - return !($arrayDimType instanceof ErrorType); - } - ); - $dimType = $dimTypeResult->getType(); - } else { - $dimType = $potentialDimType; - } - - $resultType = $varType->setOffsetValueType($dimType, new MixedType()); - if (!($resultType instanceof ErrorType)) { - return []; - } - - if ($dimType === null) { - return [sprintf( - 'Cannot assign new offset to %s.', - $varType->describe(VerbosityLevel::typeOnly()) - )]; - } - - return [sprintf( - 'Cannot assign offset %s to %s.', - $dimType->describe(VerbosityLevel::value()), - $varType->describe(VerbosityLevel::typeOnly()) - )]; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Arrays/OffsetAccessWithoutDimForReadingRule.php b/vendor/phpstan/phpstan/src/Rules/Arrays/OffsetAccessWithoutDimForReadingRule.php deleted file mode 100644 index f7a015c..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Arrays/OffsetAccessWithoutDimForReadingRule.php +++ /dev/null @@ -1,33 +0,0 @@ -isInExpressionAssign($node)) { - return []; - } - - if ($node->dim !== null) { - return []; - } - - return ['Cannot use [] for reading.']; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Cast/EchoRule.php b/vendor/phpstan/phpstan/src/Rules/Cast/EchoRule.php deleted file mode 100644 index fff0b0f..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Cast/EchoRule.php +++ /dev/null @@ -1,63 +0,0 @@ -ruleLevelHelper = $ruleLevelHelper; - } - - public function getNodeType(): string - { - return Node\Stmt\Echo_::class; - } - - /** - * @param \PhpParser\Node\Stmt\Echo_ $node - * @param Scope $scope - * @return string[] - */ - public function processNode(Node $node, Scope $scope): array - { - $messages = []; - - foreach ($node->exprs as $key => $expr) { - $typeResult = $this->ruleLevelHelper->findTypeToCheck( - $scope, - $expr, - '', - static function (Type $type): bool { - return !$type->toString() instanceof ErrorType; - } - ); - - if ($typeResult->getType() instanceof ErrorType - || !$typeResult->getType()->toString() instanceof ErrorType - ) { - continue; - } - - $messages[] = sprintf( - 'Parameter #%d (%s) of echo cannot be converted to string.', - $key + 1, - $typeResult->getType()->describe(VerbosityLevel::value()) - ); - } - return $messages; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Cast/InvalidCastRule.php b/vendor/phpstan/phpstan/src/Rules/Cast/InvalidCastRule.php deleted file mode 100644 index 27b1d84..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Cast/InvalidCastRule.php +++ /dev/null @@ -1,100 +0,0 @@ -broker = $broker; - $this->ruleLevelHelper = $ruleLevelHelper; - } - - public function getNodeType(): string - { - return \PhpParser\Node\Expr\Cast::class; - } - - /** - * @param \PhpParser\Node\Expr\Cast $node - * @param \PHPStan\Analyser\Scope $scope - * @return RuleError[] - */ - public function processNode(Node $node, Scope $scope): array - { - $castTypeCallback = static function (Type $type) use ($node): ?Type { - if ($node instanceof \PhpParser\Node\Expr\Cast\Int_) { - return $type->toInteger(); - } elseif ($node instanceof \PhpParser\Node\Expr\Cast\Bool_) { - return $type->toBoolean(); - } elseif ($node instanceof \PhpParser\Node\Expr\Cast\Double) { - return $type->toFloat(); - } elseif ($node instanceof \PhpParser\Node\Expr\Cast\String_) { - return $type->toString(); - } - - return null; - }; - - $typeResult = $this->ruleLevelHelper->findTypeToCheck( - $scope, - $node->expr, - '', - static function (Type $type) use ($castTypeCallback): bool { - $castType = $castTypeCallback($type); - if ($castType === null) { - return true; - } - - return !$castType instanceof ErrorType; - } - ); - $type = $typeResult->getType(); - if ($type instanceof ErrorType) { - return []; - } - - $castType = $castTypeCallback($type); - if ($castType instanceof ErrorType) { - $classReflection = $this->broker->getClass(get_class($node)); - $shortName = $classReflection->getNativeReflection()->getShortName(); - $shortName = strtolower($shortName); - if ($shortName === 'double') { - $shortName = 'float'; - } else { - $shortName = substr($shortName, 0, -1); - } - - return [ - RuleErrorBuilder::message(sprintf( - 'Cannot cast %s to %s.', - $scope->getType($node->expr)->describe(VerbosityLevel::value()), - $shortName - ))->build(), - ]; - } - - return []; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Cast/InvalidPartOfEncapsedStringRule.php b/vendor/phpstan/phpstan/src/Rules/Cast/InvalidPartOfEncapsedStringRule.php deleted file mode 100644 index be759d8..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Cast/InvalidPartOfEncapsedStringRule.php +++ /dev/null @@ -1,76 +0,0 @@ -printer = $printer; - $this->ruleLevelHelper = $ruleLevelHelper; - } - - public function getNodeType(): string - { - return \PhpParser\Node\Scalar\Encapsed::class; - } - - /** - * @param \PhpParser\Node\Scalar\Encapsed $node - * @param \PHPStan\Analyser\Scope $scope - * @return string[] errors - */ - public function processNode(Node $node, Scope $scope): array - { - $messages = []; - foreach ($node->parts as $part) { - if ($part instanceof Node\Scalar\EncapsedStringPart) { - continue; - } - - $typeResult = $this->ruleLevelHelper->findTypeToCheck( - $scope, - $part, - '', - static function (Type $type): bool { - return !$type->toString() instanceof ErrorType; - } - ); - $partType = $typeResult->getType(); - if ($partType instanceof ErrorType) { - continue; - } - - $stringPartType = $partType->toString(); - if (!$stringPartType instanceof ErrorType) { - continue; - } - - $messages[] = sprintf( - 'Part %s (%s) of encapsed string cannot be cast to string.', - $this->printer->prettyPrintExpr($part), - $partType->describe(VerbosityLevel::value()) - ); - } - - return $messages; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Cast/PrintRule.php b/vendor/phpstan/phpstan/src/Rules/Cast/PrintRule.php deleted file mode 100644 index db31223..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Cast/PrintRule.php +++ /dev/null @@ -1,57 +0,0 @@ -ruleLevelHelper = $ruleLevelHelper; - } - - public function getNodeType(): string - { - return Node\Expr\Print_::class; - } - - /** - * @param \PhpParser\Node\Expr\Print_ $node - * @param Scope $scope - * @return string[] - */ - public function processNode(Node $node, Scope $scope): array - { - $typeResult = $this->ruleLevelHelper->findTypeToCheck( - $scope, - $node->expr, - '', - static function (Type $type): bool { - return !$type->toString() instanceof ErrorType; - } - ); - - if (!$typeResult->getType() instanceof ErrorType - && $typeResult->getType()->toString() instanceof ErrorType - ) { - return [sprintf( - 'Parameter %s of print cannot be converted to string.', - $typeResult->getType()->describe(VerbosityLevel::value()) - )]; - } - - return []; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/ClassCaseSensitivityCheck.php b/vendor/phpstan/phpstan/src/Rules/ClassCaseSensitivityCheck.php deleted file mode 100644 index 290379b..0000000 --- a/vendor/phpstan/phpstan/src/Rules/ClassCaseSensitivityCheck.php +++ /dev/null @@ -1,62 +0,0 @@ -broker = $broker; - } - - /** - * @param ClassNameNodePair[] $pairs - * @return RuleError[] - */ - public function checkClassNames(array $pairs): array - { - $errors = []; - foreach ($pairs as $pair) { - $className = $pair->getClassName(); - if (!$this->broker->hasClass($className)) { - continue; - } - $classReflection = $this->broker->getClass($className); - $realClassName = $classReflection->getName(); - if (strtolower($realClassName) !== strtolower($className)) { - continue; // skip class alias - } - if ($realClassName === $className) { - continue; - } - - $errors[] = RuleErrorBuilder::message(sprintf( - '%s %s referenced with incorrect case: %s.', - $this->getTypeName($classReflection), - $realClassName, - $className - ))->line($pair->getNode()->getLine())->build(); - } - - return $errors; - } - - private function getTypeName(ClassReflection $classReflection): string - { - if ($classReflection->isInterface()) { - return 'Interface'; - } elseif ($classReflection->isTrait()) { - return 'Trait'; - } - - return 'Class'; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/ClassNameNodePair.php b/vendor/phpstan/phpstan/src/Rules/ClassNameNodePair.php deleted file mode 100644 index 310ed45..0000000 --- a/vendor/phpstan/phpstan/src/Rules/ClassNameNodePair.php +++ /dev/null @@ -1,32 +0,0 @@ -className = $className; - $this->node = $node; - } - - public function getClassName(): string - { - return $this->className; - } - - public function getNode(): Node - { - return $this->node; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Classes/ClassConstantDeclarationRule.php b/vendor/phpstan/phpstan/src/Rules/Classes/ClassConstantDeclarationRule.php deleted file mode 100644 index 0e2c9c7..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Classes/ClassConstantDeclarationRule.php +++ /dev/null @@ -1,36 +0,0 @@ -isInClass()) { - throw new \PHPStan\ShouldNotHappenException(); - } - $classReflection = $scope->getClassReflection(); - - foreach ($node->consts as $const) { - $classReflection->getConstant($const->name->name); - } - - return []; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Classes/ClassConstantRule.php b/vendor/phpstan/phpstan/src/Rules/Classes/ClassConstantRule.php deleted file mode 100644 index 684b4dd..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Classes/ClassConstantRule.php +++ /dev/null @@ -1,165 +0,0 @@ -broker = $broker; - $this->ruleLevelHelper = $ruleLevelHelper; - $this->classCaseSensitivityCheck = $classCaseSensitivityCheck; - } - - public function getNodeType(): string - { - return ClassConstFetch::class; - } - - /** - * @param \PhpParser\Node\Expr\ClassConstFetch $node - * @param \PHPStan\Analyser\Scope $scope - * @return (string|\PHPStan\Rules\RuleError)[] - */ - public function processNode(Node $node, Scope $scope): array - { - if (!$node->name instanceof Node\Identifier) { - return []; - } - $constantName = $node->name->name; - - $class = $node->class; - $messages = []; - if ($class instanceof \PhpParser\Node\Name) { - $className = (string) $class; - $lowercasedClassName = strtolower($className); - if (in_array($lowercasedClassName, ['self', 'static'], true)) { - if (!$scope->isInClass()) { - return [ - sprintf('Using %s outside of class scope.', $className), - ]; - } - - $className = $scope->getClassReflection()->getName(); - } elseif ($lowercasedClassName === 'parent') { - if (!$scope->isInClass()) { - return [ - sprintf('Using %s outside of class scope.', $className), - ]; - } - $currentClassReflection = $scope->getClassReflection(); - if ($currentClassReflection->getParentClass() === false) { - return [ - sprintf( - 'Access to parent::%s but %s does not extend any class.', - $constantName, - $currentClassReflection->getDisplayName() - ), - ]; - } - $className = $currentClassReflection->getParentClass()->getName(); - } else { - if (!$this->broker->hasClass($className)) { - if (strtolower($constantName) === 'class') { - return [ - sprintf('Class %s not found.', $className), - ]; - } - - return [ - sprintf('Access to constant %s on an unknown class %s.', $constantName, $className), - ]; - } else { - $messages = $this->classCaseSensitivityCheck->checkClassNames([new ClassNameNodePair($className, $class)]); - } - - $className = $this->broker->getClass($className)->getName(); - } - - $classType = new ObjectType($className); - } else { - $classTypeResult = $this->ruleLevelHelper->findTypeToCheck( - $scope, - $class, - sprintf('Access to constant %s on an unknown class %%s.', $constantName), - static function (Type $type) use ($constantName): bool { - return $type->canAccessConstants()->yes() && $type->hasConstant($constantName)->yes(); - } - ); - $classType = $classTypeResult->getType(); - if ($classType instanceof ErrorType) { - return $classTypeResult->getUnknownClassErrors(); - } - } - - if ((new StringType())->isSuperTypeOf($classType)->yes()) { - return $messages; - } - - $typeForDescribe = $classType; - $classType = TypeCombinator::remove($classType, new StringType()); - - if (!$classType->canAccessConstants()->yes()) { - return array_merge($messages, [ - sprintf('Cannot access constant %s on %s.', $constantName, $typeForDescribe->describe(VerbosityLevel::typeOnly())), - ]); - } - - if (strtolower($constantName) === 'class') { - return $messages; - } - - if (!$classType->hasConstant($constantName)->yes()) { - return array_merge($messages, [ - sprintf( - 'Access to undefined constant %s::%s.', - $typeForDescribe->describe(VerbosityLevel::typeOnly()), - $constantName - ), - ]); - } - - $constantReflection = $classType->getConstant($constantName); - if (!$scope->canAccessConstant($constantReflection)) { - return array_merge($messages, [ - sprintf( - 'Access to %s constant %s of class %s.', - $constantReflection->isPrivate() ? 'private' : 'protected', - $constantName, - $constantReflection->getDeclaringClass()->getDisplayName() - ), - ]); - } - - return $messages; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Classes/ExistingClassInClassExtendsRule.php b/vendor/phpstan/phpstan/src/Rules/Classes/ExistingClassInClassExtendsRule.php deleted file mode 100644 index 0aebdb8..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Classes/ExistingClassInClassExtendsRule.php +++ /dev/null @@ -1,40 +0,0 @@ -classCaseSensitivityCheck = $classCaseSensitivityCheck; - } - - public function getNodeType(): string - { - return Node\Stmt\Class_::class; - } - - /** - * @param \PhpParser\Node\Stmt\Class_ $node - * @param \PHPStan\Analyser\Scope $scope - * @return RuleError[] - */ - public function processNode(Node $node, Scope $scope): array - { - if ($node->extends === null) { - return []; - } - return $this->classCaseSensitivityCheck->checkClassNames([new ClassNameNodePair((string) $node->extends, $node->extends)]); - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Classes/ExistingClassInInstanceOfRule.php b/vendor/phpstan/phpstan/src/Rules/Classes/ExistingClassInInstanceOfRule.php deleted file mode 100644 index 63e969b..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Classes/ExistingClassInInstanceOfRule.php +++ /dev/null @@ -1,82 +0,0 @@ -broker = $broker; - $this->classCaseSensitivityCheck = $classCaseSensitivityCheck; - $this->checkClassCaseSensitivity = $checkClassCaseSensitivity; - } - - public function getNodeType(): string - { - return Instanceof_::class; - } - - /** - * @param \PhpParser\Node\Expr\Instanceof_ $node - * @param \PHPStan\Analyser\Scope $scope - * @return RuleError[] - */ - public function processNode(Node $node, Scope $scope): array - { - $class = $node->class; - if (!($class instanceof \PhpParser\Node\Name)) { - return []; - } - - $name = (string) $class; - $lowercaseName = strtolower($name); - - if (in_array($lowercaseName, [ - 'self', - 'static', - 'parent', - ], true)) { - if (!$scope->isInClass()) { - return [ - RuleErrorBuilder::message(sprintf('Using %s outside of class scope.', $lowercaseName))->line($class->getLine())->build(), - ]; - } - - return []; - } - - if (!$this->broker->hasClass($name)) { - return [ - RuleErrorBuilder::message(sprintf('Class %s not found.', $name))->line($class->getLine())->build(), - ]; - } elseif ($this->checkClassCaseSensitivity) { - return $this->classCaseSensitivityCheck->checkClassNames([new ClassNameNodePair($name, $class)]); - } - - return []; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Classes/ExistingClassInTraitUseRule.php b/vendor/phpstan/phpstan/src/Rules/Classes/ExistingClassInTraitUseRule.php deleted file mode 100644 index e845487..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Classes/ExistingClassInTraitUseRule.php +++ /dev/null @@ -1,41 +0,0 @@ -classCaseSensitivityCheck = $classCaseSensitivityCheck; - } - - public function getNodeType(): string - { - return \PhpParser\Node\Stmt\TraitUse::class; - } - - /** - * @param \PhpParser\Node\Stmt\TraitUse $node - * @param \PHPStan\Analyser\Scope $scope - * @return RuleError[] - */ - public function processNode(Node $node, Scope $scope): array - { - return $this->classCaseSensitivityCheck->checkClassNames( - array_map(static function (Node\Name $traitName): ClassNameNodePair { - return new ClassNameNodePair((string) $traitName, $traitName); - }, $node->traits) - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Classes/ExistingClassesInClassImplementsRule.php b/vendor/phpstan/phpstan/src/Rules/Classes/ExistingClassesInClassImplementsRule.php deleted file mode 100644 index 642c50d..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Classes/ExistingClassesInClassImplementsRule.php +++ /dev/null @@ -1,41 +0,0 @@ -classCaseSensitivityCheck = $classCaseSensitivityCheck; - } - - public function getNodeType(): string - { - return Node\Stmt\Class_::class; - } - - /** - * @param \PhpParser\Node\Stmt\Class_ $node - * @param \PHPStan\Analyser\Scope $scope - * @return RuleError[] - */ - public function processNode(Node $node, Scope $scope): array - { - return $this->classCaseSensitivityCheck->checkClassNames( - array_map(static function (Node\Name $interfaceName): ClassNameNodePair { - return new ClassNameNodePair((string) $interfaceName, $interfaceName); - }, $node->implements) - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Classes/ExistingClassesInInterfaceExtendsRule.php b/vendor/phpstan/phpstan/src/Rules/Classes/ExistingClassesInInterfaceExtendsRule.php deleted file mode 100644 index 6001e36..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Classes/ExistingClassesInInterfaceExtendsRule.php +++ /dev/null @@ -1,41 +0,0 @@ -classCaseSensitivityCheck = $classCaseSensitivityCheck; - } - - public function getNodeType(): string - { - return Node\Stmt\Interface_::class; - } - - /** - * @param \PhpParser\Node\Stmt\Interface_ $node - * @param \PHPStan\Analyser\Scope $scope - * @return RuleError[] - */ - public function processNode(Node $node, Scope $scope): array - { - return $this->classCaseSensitivityCheck->checkClassNames( - array_map(static function (Node\Name $interfaceName): ClassNameNodePair { - return new ClassNameNodePair((string) $interfaceName, $interfaceName); - }, $node->extends) - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Classes/ImpossibleInstanceOfRule.php b/vendor/phpstan/phpstan/src/Rules/Classes/ImpossibleInstanceOfRule.php deleted file mode 100644 index a2d5c50..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Classes/ImpossibleInstanceOfRule.php +++ /dev/null @@ -1,69 +0,0 @@ -checkAlwaysTrueInstanceof = $checkAlwaysTrueInstanceof; - } - - public function getNodeType(): string - { - return Node\Expr\Instanceof_::class; - } - - /** - * @param \PhpParser\Node\Expr\Instanceof_ $node - * @param \PHPStan\Analyser\Scope $scope - * @return string[] - */ - public function processNode(Node $node, Scope $scope): array - { - $instanceofType = $scope->getType($node); - - if (!$instanceofType instanceof ConstantBooleanType) { - return []; - } - - $expressionType = $scope->getType($node->expr); - if ($node->class instanceof Node\Name) { - $className = $scope->resolveName($node->class); - $type = new ObjectType($className); - } else { - $type = $scope->getType($node->class); - } - - if (!$instanceofType->getValue()) { - return [ - sprintf( - 'Instanceof between %s and %s will always evaluate to false.', - $expressionType->describe(VerbosityLevel::typeOnly()), - $type->describe(VerbosityLevel::typeOnly()) - ), - ]; - } elseif ($this->checkAlwaysTrueInstanceof) { - return [ - sprintf( - 'Instanceof between %s and %s will always evaluate to true.', - $expressionType->describe(VerbosityLevel::typeOnly()), - $type->describe(VerbosityLevel::typeOnly()) - ), - ]; - } - - return []; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Classes/InstantiationRule.php b/vendor/phpstan/phpstan/src/Rules/Classes/InstantiationRule.php deleted file mode 100644 index 35f283c..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Classes/InstantiationRule.php +++ /dev/null @@ -1,219 +0,0 @@ -broker = $broker; - $this->check = $check; - $this->classCaseSensitivityCheck = $classCaseSensitivityCheck; - } - - public function getNodeType(): string - { - return New_::class; - } - - /** - * @param \PhpParser\Node\Expr\New_ $node - * @param \PHPStan\Analyser\Scope $scope - * @return (string|\PHPStan\Rules\RuleError)[] - */ - public function processNode(Node $node, Scope $scope): array - { - $errors = []; - foreach ($this->getClassNames($node, $scope) as $class) { - $errors = array_merge($errors, $this->checkClassName($class, $node, $scope)); - } - return $errors; - } - - /** - * @param string $class - * @param \PhpParser\Node\Expr\New_ $node - * @param Scope $scope - * @return (string|\PHPStan\Rules\RuleError)[] - */ - private function checkClassName(string $class, Node $node, Scope $scope): array - { - $lowercasedClass = strtolower($class); - $messages = []; - $isStatic = false; - if ($lowercasedClass === 'static') { - if (!$scope->isInClass()) { - return [ - sprintf('Using %s outside of class scope.', $class), - ]; - } - - $isStatic = true; - $classReflection = $scope->getClassReflection(); - if (!$classReflection->isFinal()) { - if (!$classReflection->hasConstructor()) { - return []; - } - - $constructor = $classReflection->getConstructor(); - if ( - !$constructor->getPrototype()->getDeclaringClass()->isInterface() - && $constructor instanceof PhpMethodReflection - && !$constructor->isFinal() - && !$constructor->getPrototype()->isAbstract() - ) { - return []; - } - } - } elseif ($lowercasedClass === 'self') { - if (!$scope->isInClass()) { - return [ - sprintf('Using %s outside of class scope.', $class), - ]; - } - $classReflection = $scope->getClassReflection(); - } elseif ($lowercasedClass === 'parent') { - if (!$scope->isInClass()) { - return [ - sprintf('Using %s outside of class scope.', $class), - ]; - } - if ($scope->getClassReflection()->getParentClass() === false) { - return [ - sprintf( - '%s::%s() calls new parent but %s does not extend any class.', - $scope->getClassReflection()->getDisplayName(), - $scope->getFunctionName(), - $scope->getClassReflection()->getDisplayName() - ), - ]; - } - $classReflection = $scope->getClassReflection()->getParentClass(); - } else { - if (!$this->broker->hasClass($class)) { - return [ - sprintf('Instantiated class %s not found.', $class), - ]; - } else { - $messages = $this->classCaseSensitivityCheck->checkClassNames([ - new ClassNameNodePair($class, $node->class), - ]); - } - - $classReflection = $this->broker->getClass($class); - } - - if (!$isStatic && $classReflection->isInterface()) { - return [ - sprintf('Cannot instantiate interface %s.', $classReflection->getDisplayName()), - ]; - } - - if (!$isStatic && $classReflection->isAbstract()) { - return [ - sprintf('Instantiated class %s is abstract.', $classReflection->getDisplayName()), - ]; - } - - if (!$classReflection->hasConstructor()) { - if (count($node->args) > 0) { - return array_merge($messages, [ - sprintf( - 'Class %s does not have a constructor and must be instantiated without any parameters.', - $classReflection->getDisplayName() - ), - ]); - } - - return $messages; - } - - $constructorReflection = $classReflection->getConstructor(); - if (!$scope->canCallMethod($constructorReflection)) { - $messages[] = sprintf( - 'Cannot instantiate class %s via %s constructor %s::%s().', - $classReflection->getDisplayName(), - $constructorReflection->isPrivate() ? 'private' : 'protected', - $constructorReflection->getDeclaringClass()->getDisplayName(), - $constructorReflection->getName() - ); - } - - return array_merge($messages, $this->check->check( - ParametersAcceptorSelector::selectFromArgs( - $scope, - $node->args, - $constructorReflection->getVariants() - ), - $scope, - $node, - [ - 'Class ' . $classReflection->getDisplayName() . ' constructor invoked with %d parameter, %d required.', - 'Class ' . $classReflection->getDisplayName() . ' constructor invoked with %d parameters, %d required.', - 'Class ' . $classReflection->getDisplayName() . ' constructor invoked with %d parameter, at least %d required.', - 'Class ' . $classReflection->getDisplayName() . ' constructor invoked with %d parameters, at least %d required.', - 'Class ' . $classReflection->getDisplayName() . ' constructor invoked with %d parameter, %d-%d required.', - 'Class ' . $classReflection->getDisplayName() . ' constructor invoked with %d parameters, %d-%d required.', - 'Parameter #%d %s of class ' . $classReflection->getDisplayName() . ' constructor expects %s, %s given.', - '', // constructor does not have a return type - 'Parameter #%d %s of class ' . $classReflection->getDisplayName() . ' constructor is passed by reference, so it expects variables only', - ] - )); - } - - /** - * @param \PhpParser\Node\Expr\New_ $node $node - * @param Scope $scope - * @return string[] - */ - private function getClassNames(Node $node, Scope $scope): array - { - if ($node->class instanceof \PhpParser\Node\Name) { - return [(string) $node->class]; - } - - if ($node->class instanceof Node\Stmt\Class_) { - $anonymousClassType = $scope->getType($node); - if (!$anonymousClassType instanceof TypeWithClassName) { - throw new \PHPStan\ShouldNotHappenException(); - } - - return [$anonymousClassType->getClassName()]; - } - - return array_map( - static function (ConstantStringType $type): string { - return $type->getValue(); - }, - TypeUtils::getConstantStrings($scope->getType($node->class)) - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Classes/NewStaticRule.php b/vendor/phpstan/phpstan/src/Rules/Classes/NewStaticRule.php deleted file mode 100644 index 1b1ce84..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Classes/NewStaticRule.php +++ /dev/null @@ -1,68 +0,0 @@ -class instanceof Node\Name) { - return []; - } - - if (!$scope->isInClass()) { - return []; - } - - if (strtolower($node->class->toString()) !== 'static') { - return []; - } - - $classReflection = $scope->getClassReflection(); - if ($classReflection->isFinal()) { - return []; - } - - $messages = [ - "Unsafe usage of new static().\n💡 Consider making the class or the constructor final.", - ]; - if (!$classReflection->hasConstructor()) { - return $messages; - } - - $constructor = $classReflection->getConstructor(); - if ($constructor->getPrototype()->getDeclaringClass()->isInterface()) { - return []; - } - - if ($constructor instanceof PhpMethodReflection) { - if ($constructor->isFinal()) { - return []; - } - - $prototype = $constructor->getPrototype(); - if ($prototype->isAbstract()) { - return []; - } - } - - return $messages; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Classes/RequireParentConstructCallRule.php b/vendor/phpstan/phpstan/src/Rules/Classes/RequireParentConstructCallRule.php deleted file mode 100644 index d3420ad..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Classes/RequireParentConstructCallRule.php +++ /dev/null @@ -1,147 +0,0 @@ -isInClass()) { - throw new \PHPStan\ShouldNotHappenException(); - } - - if ($scope->isInTrait()) { - return []; - } - - if ($node->name->name !== '__construct') { - return []; - } - - $classReflection = $scope->getClassReflection()->getNativeReflection(); - if ($classReflection->isInterface() || $classReflection->isAnonymous()) { - return []; - } - - if ($this->callsParentConstruct($node)) { - if ($classReflection->getParentClass() === false) { - return [ - sprintf( - '%s::__construct() calls parent constructor but does not extend any class.', - $classReflection->getName() - ), - ]; - } - - if ($this->getParentConstructorClass($classReflection) === false) { - return [ - sprintf( - '%s::__construct() calls parent constructor but parent does not have one.', - $classReflection->getName() - ), - ]; - } - } else { - $parentClass = $this->getParentConstructorClass($classReflection); - if ($parentClass !== false) { - return [ - sprintf( - '%s::__construct() does not call parent constructor from %s.', - $classReflection->getName(), - $parentClass->getName() - ), - ]; - } - } - - return []; - } - - private function callsParentConstruct(Node $parserNode): bool - { - if (!isset($parserNode->stmts)) { - return false; - } - - foreach ($parserNode->stmts as $statement) { - if ($statement instanceof Node\Stmt\Expression) { - $statement = $statement->expr; - } - - $statement = $this->ignoreErrorSuppression($statement); - if ($statement instanceof \PhpParser\Node\Expr\StaticCall) { - if ( - $statement->class instanceof Name - && ((string) $statement->class === 'parent') - && $statement->name instanceof Node\Identifier - && $statement->name->name === '__construct' - ) { - return true; - } - } else { - if ($this->callsParentConstruct($statement)) { - return true; - } - } - } - - return false; - } - - /** - * @param \ReflectionClass $classReflection - * @return \ReflectionClass|false - */ - private function getParentConstructorClass(\ReflectionClass $classReflection) - { - while ($classReflection->getParentClass() !== false) { - $constructor = $classReflection->getParentClass()->hasMethod('__construct') ? $classReflection->getParentClass()->getMethod('__construct') : null; - $constructorWithClassName = $classReflection->getParentClass()->hasMethod($classReflection->getParentClass()->getName()) ? $classReflection->getParentClass()->getMethod($classReflection->getParentClass()->getName()) : null; - if ( - ( - $constructor !== null - && $constructor->getDeclaringClass()->getName() === $classReflection->getParentClass()->getName() - && !$constructor->isAbstract() - && !$constructor->isPrivate() - ) || ( - $constructorWithClassName !== null - && $constructorWithClassName->getDeclaringClass()->getName() === $classReflection->getParentClass()->getName() - && !$constructorWithClassName->isAbstract() - ) - ) { - return $classReflection->getParentClass(); - } - - $classReflection = $classReflection->getParentClass(); - } - - return false; - } - - private function ignoreErrorSuppression(Node $statement): Node - { - if ($statement instanceof Node\Expr\ErrorSuppress) { - - return $statement->expr; - } - - return $statement; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Classes/UnusedConstructorParametersRule.php b/vendor/phpstan/phpstan/src/Rules/Classes/UnusedConstructorParametersRule.php deleted file mode 100644 index 3769950..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Classes/UnusedConstructorParametersRule.php +++ /dev/null @@ -1,65 +0,0 @@ -check = $check; - } - - public function getNodeType(): string - { - return ClassMethod::class; - } - - /** - * @param \PhpParser\Node\Stmt\ClassMethod $node - * @param \PHPStan\Analyser\Scope $scope - * @return string[] - */ - public function processNode(Node $node, Scope $scope): array - { - if (!$scope->isInClass()) { - throw new \PHPStan\ShouldNotHappenException(); - } - - if ($node->name->name !== '__construct' || $node->stmts === null) { - return []; - } - - if (count($node->params) === 0) { - return []; - } - - $message = sprintf('Constructor of class %s has an unused parameter $%%s.', $scope->getClassReflection()->getDisplayName()); - if ($scope->getClassReflection()->isAnonymous()) { - $message = 'Constructor of an anonymous class has an unused parameter $%s.'; - } - - return $this->check->getUnusedParameters( - $scope, - array_map(static function (Param $parameter): string { - if (!$parameter->var instanceof Variable || !is_string($parameter->var->name)) { - throw new \PHPStan\ShouldNotHappenException(); - } - return $parameter->var->name; - }, $node->params), - $node->stmts, - $message - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Comparison/BooleanAndConstantConditionRule.php b/vendor/phpstan/phpstan/src/Rules/Comparison/BooleanAndConstantConditionRule.php deleted file mode 100644 index c08c5ca..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Comparison/BooleanAndConstantConditionRule.php +++ /dev/null @@ -1,70 +0,0 @@ -helper = $helper; - } - - public function getNodeType(): string - { - return \PhpParser\Node\Expr\BinaryOp\BooleanAnd::class; - } - - /** - * @param \PhpParser\Node\Expr\BinaryOp\BooleanAnd $node - * @param \PHPStan\Analyser\Scope $scope - * @return RuleError[] - */ - public function processNode( - \PhpParser\Node $node, - \PHPStan\Analyser\Scope $scope - ): array - { - $errors = []; - $leftType = $this->helper->getBooleanType($scope, $node->left); - if ($leftType instanceof ConstantBooleanType) { - $errors[] = RuleErrorBuilder::message(sprintf( - 'Left side of && is always %s.', - $leftType->getValue() ? 'true' : 'false' - ))->line($node->left->getLine())->build(); - } - - $rightType = $this->helper->getBooleanType( - $scope->filterByTruthyValue($node->left), - $node->right - ); - if ($rightType instanceof ConstantBooleanType) { - $errors[] = RuleErrorBuilder::message(sprintf( - 'Right side of && is always %s.', - $rightType->getValue() ? 'true' : 'false' - ))->line($node->right->getLine())->build(); - } - - if (count($errors) === 0) { - $nodeType = $scope->getType($node); - if ($nodeType instanceof ConstantBooleanType) { - $errors[] = RuleErrorBuilder::message(sprintf( - 'Result of && is always %s.', - $nodeType->getValue() ? 'true' : 'false' - ))->build(); - } - } - - return $errors; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Comparison/BooleanNotConstantConditionRule.php b/vendor/phpstan/phpstan/src/Rules/Comparison/BooleanNotConstantConditionRule.php deleted file mode 100644 index dd3344e..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Comparison/BooleanNotConstantConditionRule.php +++ /dev/null @@ -1,50 +0,0 @@ -helper = $helper; - } - - public function getNodeType(): string - { - return \PhpParser\Node\Expr\BooleanNot::class; - } - - /** - * @param \PhpParser\Node\Expr\BooleanNot $node - * @param \PHPStan\Analyser\Scope $scope - * @return RuleError[] - */ - public function processNode( - \PhpParser\Node $node, - \PHPStan\Analyser\Scope $scope - ): array - { - $exprType = $this->helper->getBooleanType($scope, $node->expr); - if ($exprType instanceof ConstantBooleanType) { - return [ - RuleErrorBuilder::message(sprintf( - 'Negated boolean expression is always %s.', - $exprType->getValue() ? 'false' : 'true' - ))->line($node->expr->getLine())->build(), - ]; - } - - return []; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Comparison/BooleanOrConstantConditionRule.php b/vendor/phpstan/phpstan/src/Rules/Comparison/BooleanOrConstantConditionRule.php deleted file mode 100644 index 26c449e..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Comparison/BooleanOrConstantConditionRule.php +++ /dev/null @@ -1,70 +0,0 @@ -helper = $helper; - } - - public function getNodeType(): string - { - return \PhpParser\Node\Expr\BinaryOp\BooleanOr::class; - } - - /** - * @param \PhpParser\Node\Expr\BinaryOp\BooleanOr $node - * @param \PHPStan\Analyser\Scope $scope - * @return RuleError[] - */ - public function processNode( - \PhpParser\Node $node, - \PHPStan\Analyser\Scope $scope - ): array - { - $messages = []; - $leftType = $this->helper->getBooleanType($scope, $node->left); - if ($leftType instanceof ConstantBooleanType) { - $messages[] = RuleErrorBuilder::message(sprintf( - 'Left side of || is always %s.', - $leftType->getValue() ? 'true' : 'false' - ))->line($node->left->getLine())->build(); - } - - $rightType = $this->helper->getBooleanType( - $scope->filterByFalseyValue($node->left), - $node->right - ); - if ($rightType instanceof ConstantBooleanType) { - $messages[] = RuleErrorBuilder::message(sprintf( - 'Right side of || is always %s.', - $rightType->getValue() ? 'true' : 'false' - ))->line($node->right->getLine())->build(); - } - - if (count($messages) === 0) { - $nodeType = $scope->getType($node); - if ($nodeType instanceof ConstantBooleanType) { - $messages[] = RuleErrorBuilder::message(sprintf( - 'Result of || is always %s.', - $nodeType->getValue() ? 'true' : 'false' - ))->build(); - } - } - - return $messages; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Comparison/ConstantConditionRuleHelper.php b/vendor/phpstan/phpstan/src/Rules/Comparison/ConstantConditionRuleHelper.php deleted file mode 100644 index 6e98e24..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Comparison/ConstantConditionRuleHelper.php +++ /dev/null @@ -1,70 +0,0 @@ -impossibleCheckTypeHelper = $impossibleCheckTypeHelper; - } - - public function shouldReportAlwaysTrueByDefault(Expr $expr): bool - { - return $expr instanceof Expr\BooleanNot - || $expr instanceof Expr\BinaryOp\BooleanOr - || $expr instanceof Expr\BinaryOp\BooleanAnd - || $expr instanceof Expr\Ternary - || $expr instanceof Expr\Isset_; - } - - public function shouldSkip(Scope $scope, Expr $expr): bool - { - if ( - $expr instanceof Expr\Instanceof_ - || $expr instanceof Expr\BinaryOp\Identical - || $expr instanceof Expr\BinaryOp\NotIdentical - || $expr instanceof Expr\BooleanNot - || $expr instanceof Expr\BinaryOp\BooleanOr - || $expr instanceof Expr\BinaryOp\BooleanAnd - || $expr instanceof Expr\Ternary - || $expr instanceof Expr\Isset_ - ) { - // already checked by different rules - return true; - } - - if ( - $expr instanceof FuncCall - || $expr instanceof MethodCall - || $expr instanceof Expr\StaticCall - ) { - $isAlways = $this->impossibleCheckTypeHelper->findSpecifiedType($scope, $expr); - if ($isAlways !== null) { - return true; - } - } - - return false; - } - - public function getBooleanType(Scope $scope, Expr $expr): BooleanType - { - if ($this->shouldSkip($scope, $expr)) { - return new BooleanType(); - } - - return $scope->getType($expr)->toBoolean(); - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Comparison/ElseIfConstantConditionRule.php b/vendor/phpstan/phpstan/src/Rules/Comparison/ElseIfConstantConditionRule.php deleted file mode 100644 index 62590d1..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Comparison/ElseIfConstantConditionRule.php +++ /dev/null @@ -1,50 +0,0 @@ -helper = $helper; - } - - public function getNodeType(): string - { - return \PhpParser\Node\Stmt\ElseIf_::class; - } - - /** - * @param \PhpParser\Node\Stmt\ElseIf_ $node - * @param \PHPStan\Analyser\Scope $scope - * @return RuleError[] - */ - public function processNode( - \PhpParser\Node $node, - \PHPStan\Analyser\Scope $scope - ): array - { - $exprType = $this->helper->getBooleanType($scope, $node->cond); - if ($exprType instanceof ConstantBooleanType) { - return [ - RuleErrorBuilder::message(sprintf( - 'Elseif condition is always %s.', - $exprType->getValue() ? 'true' : 'false' - ))->line($node->cond->getLine())->build(), - ]; - } - - return []; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Comparison/IfConstantConditionRule.php b/vendor/phpstan/phpstan/src/Rules/Comparison/IfConstantConditionRule.php deleted file mode 100644 index d9fd5d8..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Comparison/IfConstantConditionRule.php +++ /dev/null @@ -1,50 +0,0 @@ -helper = $helper; - } - - public function getNodeType(): string - { - return \PhpParser\Node\Stmt\If_::class; - } - - /** - * @param \PhpParser\Node\Stmt\If_ $node - * @param \PHPStan\Analyser\Scope $scope - * @return RuleError[] - */ - public function processNode( - \PhpParser\Node $node, - \PHPStan\Analyser\Scope $scope - ): array - { - $exprType = $this->helper->getBooleanType($scope, $node->cond); - if ($exprType instanceof ConstantBooleanType) { - return [ - RuleErrorBuilder::message(sprintf( - 'If condition is always %s.', - $exprType->getValue() ? 'true' : 'false' - ))->line($node->cond->getLine())->build(), - ]; - } - - return []; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Comparison/ImpossibleCheckTypeFunctionCallRule.php b/vendor/phpstan/phpstan/src/Rules/Comparison/ImpossibleCheckTypeFunctionCallRule.php deleted file mode 100644 index b058e1d..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Comparison/ImpossibleCheckTypeFunctionCallRule.php +++ /dev/null @@ -1,68 +0,0 @@ -impossibleCheckTypeHelper = $impossibleCheckTypeHelper; - $this->checkAlwaysTrueCheckTypeFunctionCall = $checkAlwaysTrueCheckTypeFunctionCall; - } - - public function getNodeType(): string - { - return \PhpParser\Node\Expr\FuncCall::class; - } - - /** - * @param \PhpParser\Node\Expr\FuncCall $node - * @param \PHPStan\Analyser\Scope $scope - * @return string[] errors - */ - public function processNode(Node $node, Scope $scope): array - { - if (!$node->name instanceof Node\Name) { - return []; - } - - $functionName = (string) $node->name; - if (strtolower($functionName) === 'is_a') { - return []; - } - $isAlways = $this->impossibleCheckTypeHelper->findSpecifiedType($scope, $node); - if ($isAlways === null) { - return []; - } - - if (!$isAlways) { - return [sprintf( - 'Call to function %s()%s will always evaluate to false.', - $functionName, - $this->impossibleCheckTypeHelper->getArgumentsDescription($scope, $node->args) - )]; - } elseif ($this->checkAlwaysTrueCheckTypeFunctionCall) { - return [sprintf( - 'Call to function %s()%s will always evaluate to true.', - $functionName, - $this->impossibleCheckTypeHelper->getArgumentsDescription($scope, $node->args) - )]; - } - - return []; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Comparison/ImpossibleCheckTypeHelper.php b/vendor/phpstan/phpstan/src/Rules/Comparison/ImpossibleCheckTypeHelper.php deleted file mode 100644 index 6331904..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Comparison/ImpossibleCheckTypeHelper.php +++ /dev/null @@ -1,245 +0,0 @@ -broker = $broker; - $this->typeSpecifier = $typeSpecifier; - } - - public function findSpecifiedType( - Scope $scope, - Expr $node - ): ?bool - { - if ( - $node instanceof FuncCall - && count($node->args) > 0 - ) { - if ($node->name instanceof \PhpParser\Node\Name) { - $functionName = strtolower((string) $node->name); - if ($functionName === 'count') { - return null; - } elseif ($functionName === 'is_numeric') { - $argType = $scope->getType($node->args[0]->value); - if (count(TypeUtils::getConstantScalars($argType)) > 0) { - return !$argType->toNumber() instanceof ErrorType; - } - - if (!(new StringType())->isSuperTypeOf($argType)->no()) { - return null; - } - } elseif ($functionName === 'defined') { - return null; - } elseif ( - $functionName === 'in_array' - && count($node->args) >= 3 - ) { - $haystackType = $scope->getType($node->args[1]->value); - if ($haystackType instanceof MixedType) { - return null; - } - - if (!$haystackType instanceof ConstantArrayType || count($haystackType->getValueTypes()) > 1) { - $needleType = $scope->getType($node->args[0]->value); - - $haystackArrayTypes = TypeUtils::getArrays($haystackType); - if (count($haystackArrayTypes) === 1 && $haystackArrayTypes[0]->getIterableValueType() instanceof NeverType) { - return null; - } - - $valueType = TypeCombinator::union(...$haystackArrayTypes)->getIterableValueType(); - $isNeedleSupertype = $needleType->isSuperTypeOf($valueType); - - if ($isNeedleSupertype->maybe() || $isNeedleSupertype->yes()) { - foreach ($haystackArrayTypes as $haystackArrayType) { - foreach (TypeUtils::getConstantScalars($haystackArrayType->getIterableValueType()) as $constantScalarType) { - if ($needleType->isSuperTypeOf($constantScalarType)->yes()) { - continue 2; - } - } - - return null; - } - } - - if ($isNeedleSupertype->yes()) { - $hasConstantNeedleTypes = count(TypeUtils::getConstantScalars($needleType)) > 0; - $hasConstantHaystackTypes = count(TypeUtils::getConstantScalars($valueType)) > 0; - if ( - ( - !$hasConstantNeedleTypes - && !$hasConstantHaystackTypes - ) - || $hasConstantNeedleTypes !== $hasConstantHaystackTypes - ) { - return null; - } - } - } - } elseif ( - $functionName === 'property_exists' - && count($node->args) >= 2 - ) { - $classNames = TypeUtils::getDirectClassNames( - $scope->getType($node->args[0]->value) - ); - foreach ($classNames as $className) { - if (!$this->broker->hasClass($className)) { - continue; - } - - if (UniversalObjectCratesClassReflectionExtension::isUniversalObjectCrate( - $this->broker, - $this->broker->getUniversalObjectCratesClasses(), - $this->broker->getClass($className) - )) { - return null; - } - } - } - } - } - - $specifiedTypes = $this->typeSpecifier->specifyTypesInCondition($scope, $node, TypeSpecifierContext::createTruthy()); - $sureTypes = $specifiedTypes->getSureTypes(); - $sureNotTypes = $specifiedTypes->getSureNotTypes(); - - $isSpecified = static function (Expr $expr) use ($scope, $node): bool { - return ( - $node instanceof FuncCall - || $node instanceof MethodCall - || $node instanceof Expr\StaticCall - ) && $scope->isSpecified($expr); - }; - - if (count($sureTypes) === 1) { - $sureType = reset($sureTypes); - if ($isSpecified($sureType[0])) { - return null; - } - - $argumentType = $scope->getType($sureType[0]); - - /** @var \PHPStan\Type\Type $resultType */ - $resultType = $sureType[1]; - - $isSuperType = $resultType->isSuperTypeOf($argumentType); - if ($isSuperType->yes()) { - return true; - } elseif ($isSuperType->no()) { - return false; - } - - return null; - } elseif (count($sureNotTypes) === 1) { - $sureNotType = reset($sureNotTypes); - if ($isSpecified($sureNotType[0])) { - return null; - } - - $argumentType = $scope->getType($sureNotType[0]); - - /** @var \PHPStan\Type\Type $resultType */ - $resultType = $sureNotType[1]; - - $isSuperType = $resultType->isSuperTypeOf($argumentType); - if ($isSuperType->yes()) { - return false; - } elseif ($isSuperType->no()) { - return true; - } - - return null; - } elseif (count($sureTypes) > 0) { - foreach ($sureTypes as $sureType) { - if ($isSpecified($sureType[0])) { - return null; - } - } - $types = TypeCombinator::union( - ...array_column($sureTypes, 1) - ); - if ($types instanceof NeverType) { - return false; - } - } elseif (count($sureNotTypes) > 0) { - foreach ($sureNotTypes as $sureNotType) { - if ($isSpecified($sureNotType[0])) { - return null; - } - } - $types = TypeCombinator::union( - ...array_column($sureNotTypes, 1) - ); - if ($types instanceof NeverType) { - return true; - } - } - - return null; - } - - /** - * @param Scope $scope - * @param \PhpParser\Node\Arg[] $args - * @return string - */ - public function getArgumentsDescription( - Scope $scope, - array $args - ): string - { - if (count($args) === 0) { - return ''; - } - - $descriptions = array_map(static function (Arg $arg) use ($scope): string { - return $scope->getType($arg->value)->describe(VerbosityLevel::value()); - }, $args); - - if (count($descriptions) < 3) { - return sprintf(' with %s', implode(' and ', $descriptions)); - } - - $lastDescription = array_pop($descriptions); - - return sprintf( - ' with arguments %s and %s', - implode(', ', $descriptions), - $lastDescription - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Comparison/ImpossibleCheckTypeMethodCallRule.php b/vendor/phpstan/phpstan/src/Rules/Comparison/ImpossibleCheckTypeMethodCallRule.php deleted file mode 100644 index b90f6e8..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Comparison/ImpossibleCheckTypeMethodCallRule.php +++ /dev/null @@ -1,84 +0,0 @@ -impossibleCheckTypeHelper = $impossibleCheckTypeHelper; - $this->checkAlwaysTrueCheckTypeFunctionCall = $checkAlwaysTrueCheckTypeFunctionCall; - } - - public function getNodeType(): string - { - return \PhpParser\Node\Expr\MethodCall::class; - } - - /** - * @param \PhpParser\Node\Expr\MethodCall $node - * @param \PHPStan\Analyser\Scope $scope - * @return string[] errors - */ - public function processNode(Node $node, Scope $scope): array - { - if (!$node->name instanceof Node\Identifier) { - return []; - } - - $isAlways = $this->impossibleCheckTypeHelper->findSpecifiedType($scope, $node); - if ($isAlways === null) { - return []; - } - - if (!$isAlways) { - $method = $this->getMethod($node->var, $node->name->name, $scope); - return [sprintf( - 'Call to method %s::%s()%s will always evaluate to false.', - $method->getDeclaringClass()->getDisplayName(), - $method->getName(), - $this->impossibleCheckTypeHelper->getArgumentsDescription($scope, $node->args) - )]; - } elseif ($this->checkAlwaysTrueCheckTypeFunctionCall) { - $method = $this->getMethod($node->var, $node->name->name, $scope); - return [sprintf( - 'Call to method %s::%s()%s will always evaluate to true.', - $method->getDeclaringClass()->getDisplayName(), - $method->getName(), - $this->impossibleCheckTypeHelper->getArgumentsDescription($scope, $node->args) - )]; - } - - return []; - } - - private function getMethod( - Expr $var, - string $methodName, - Scope $scope - ): MethodReflection - { - $calledOnType = $scope->getType($var); - if (!$calledOnType->hasMethod($methodName)->yes()) { - throw new \PHPStan\ShouldNotHappenException(); - } - - return $calledOnType->getMethod($methodName, $scope); - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Comparison/ImpossibleCheckTypeStaticMethodCallRule.php b/vendor/phpstan/phpstan/src/Rules/Comparison/ImpossibleCheckTypeStaticMethodCallRule.php deleted file mode 100644 index 6b7bb7f..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Comparison/ImpossibleCheckTypeStaticMethodCallRule.php +++ /dev/null @@ -1,99 +0,0 @@ -impossibleCheckTypeHelper = $impossibleCheckTypeHelper; - $this->checkAlwaysTrueCheckTypeFunctionCall = $checkAlwaysTrueCheckTypeFunctionCall; - } - - public function getNodeType(): string - { - return \PhpParser\Node\Expr\StaticCall::class; - } - - /** - * @param \PhpParser\Node\Expr\StaticCall $node - * @param \PHPStan\Analyser\Scope $scope - * @return string[] errors - */ - public function processNode(Node $node, Scope $scope): array - { - if (!$node->name instanceof Node\Identifier) { - return []; - } - - $isAlways = $this->impossibleCheckTypeHelper->findSpecifiedType($scope, $node); - if ($isAlways === null) { - return []; - } - - if (!$isAlways) { - $method = $this->getMethod($node->class, $node->name->name, $scope); - - return [sprintf( - 'Call to static method %s::%s()%s will always evaluate to false.', - $method->getDeclaringClass()->getDisplayName(), - $method->getName(), - $this->impossibleCheckTypeHelper->getArgumentsDescription($scope, $node->args) - )]; - } elseif ($this->checkAlwaysTrueCheckTypeFunctionCall) { - $method = $this->getMethod($node->class, $node->name->name, $scope); - - return [sprintf( - 'Call to static method %s::%s()%s will always evaluate to true.', - $method->getDeclaringClass()->getDisplayName(), - $method->getName(), - $this->impossibleCheckTypeHelper->getArgumentsDescription($scope, $node->args) - )]; - } - - return []; - } - - /** - * @param Node\Name|Expr $class - * @param string $methodName - * @param Scope $scope - * @return MethodReflection - * @throws \PHPStan\ShouldNotHappenException - */ - private function getMethod( - $class, - string $methodName, - Scope $scope - ): MethodReflection - { - if ($class instanceof Node\Name) { - $calledOnType = new ObjectType($scope->resolveName($class)); - } else { - $calledOnType = $scope->getType($class); - } - - if (!$calledOnType->hasMethod($methodName)->yes()) { - throw new \PHPStan\ShouldNotHappenException(); - } - - return $calledOnType->getMethod($methodName, $scope); - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Comparison/StrictComparisonOfDifferentTypesRule.php b/vendor/phpstan/phpstan/src/Rules/Comparison/StrictComparisonOfDifferentTypesRule.php deleted file mode 100644 index 3cf9ce1..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Comparison/StrictComparisonOfDifferentTypesRule.php +++ /dev/null @@ -1,85 +0,0 @@ -checkAlwaysTrueStrictComparison = $checkAlwaysTrueStrictComparison; - } - - public function getNodeType(): string - { - return Node\Expr\BinaryOp::class; - } - - /** - * @param \PhpParser\Node\Expr\BinaryOp $node - * @param \PHPStan\Analyser\Scope $scope - * @return string[] errors - */ - public function processNode(Node $node, Scope $scope): array - { - if (!$node instanceof Node\Expr\BinaryOp\Identical && !$node instanceof Node\Expr\BinaryOp\NotIdentical) { - return []; - } - - if ( - $this->isSpecifiedFunctionCall($scope, $node->left) - || $this->isSpecifiedFunctionCall($scope, $node->right) - ) { - return []; - } - - $nodeType = $scope->getType($node); - if (!$nodeType instanceof ConstantBooleanType) { - return []; - } - - $leftType = $scope->getType($node->left); - $rightType = $scope->getType($node->right); - - if (!$nodeType->getValue()) { - return [ - sprintf( - 'Strict comparison using %s between %s and %s will always evaluate to false.', - $node instanceof Node\Expr\BinaryOp\Identical ? '===' : '!==', - $leftType->describe(VerbosityLevel::value()), - $rightType->describe(VerbosityLevel::value()) - ), - ]; - } elseif ($this->checkAlwaysTrueStrictComparison) { - return [ - sprintf( - 'Strict comparison using %s between %s and %s will always evaluate to true.', - $node instanceof Node\Expr\BinaryOp\Identical ? '===' : '!==', - $leftType->describe(VerbosityLevel::value()), - $rightType->describe(VerbosityLevel::value()) - ), - ]; - } - - return []; - } - - private function isSpecifiedFunctionCall(Scope $scope, Expr $node): bool - { - return ( - $node instanceof Expr\FuncCall - || $node instanceof Expr\MethodCall - || $node instanceof Expr\StaticCall - ) && $scope->isSpecified($node); - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Comparison/TernaryOperatorConstantConditionRule.php b/vendor/phpstan/phpstan/src/Rules/Comparison/TernaryOperatorConstantConditionRule.php deleted file mode 100644 index 34390c6..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Comparison/TernaryOperatorConstantConditionRule.php +++ /dev/null @@ -1,48 +0,0 @@ -helper = $helper; - } - - public function getNodeType(): string - { - return \PhpParser\Node\Expr\Ternary::class; - } - - /** - * @param \PhpParser\Node\Expr\Ternary $node - * @param \PHPStan\Analyser\Scope $scope - * @return string[] - */ - public function processNode( - \PhpParser\Node $node, - \PHPStan\Analyser\Scope $scope - ): array - { - $exprType = $this->helper->getBooleanType($scope, $node->cond); - if ($exprType instanceof ConstantBooleanType) { - return [ - sprintf( - 'Ternary operator condition is always %s.', - $exprType->getValue() ? 'true' : 'false' - ), - ]; - } - - return []; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Comparison/UnreachableIfBranchesRule.php b/vendor/phpstan/phpstan/src/Rules/Comparison/UnreachableIfBranchesRule.php deleted file mode 100644 index b0ced8e..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Comparison/UnreachableIfBranchesRule.php +++ /dev/null @@ -1,57 +0,0 @@ -helper = $helper; - } - - public function getNodeType(): string - { - return Node\Stmt\If_::class; - } - - /** - * @param \PhpParser\Node\Stmt\If_ $node - * @param Scope $scope - * @return RuleError[] - */ - public function processNode(Node $node, Scope $scope): array - { - $errors = []; - $conditionType = $scope->getType($node->cond)->toBoolean(); - $nextBranchIsDead = $conditionType instanceof ConstantBooleanType && $conditionType->getValue() && $this->helper->shouldSkip($scope, $node->cond) && !$this->helper->shouldReportAlwaysTrueByDefault($node->cond); - - foreach ($node->elseifs as $elseif) { - if ($nextBranchIsDead) { - $errors[] = RuleErrorBuilder::message('Elseif branch is unreachable because previous condition is always true.')->line($elseif->getLine())->build(); - continue; - } - - $elseIfConditionType = $scope->getType($elseif->cond)->toBoolean(); - $nextBranchIsDead = $elseIfConditionType instanceof ConstantBooleanType && $elseIfConditionType->getValue() && $this->helper->shouldSkip($scope, $elseif->cond) && !$this->helper->shouldReportAlwaysTrueByDefault($elseif->cond); - } - - if ($node->else !== null && $nextBranchIsDead) { - $errors[] = RuleErrorBuilder::message('Else branch is unreachable because previous condition is always true.')->line($node->else->getLine())->build(); - } - - return $errors; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Comparison/UnreachableTernaryElseBranchRule.php b/vendor/phpstan/phpstan/src/Rules/Comparison/UnreachableTernaryElseBranchRule.php deleted file mode 100644 index c6e052a..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Comparison/UnreachableTernaryElseBranchRule.php +++ /dev/null @@ -1,52 +0,0 @@ -helper = $helper; - } - - public function getNodeType(): string - { - return Node\Expr\Ternary::class; - } - - /** - * @param \PhpParser\Node\Expr\Ternary $node - * @param Scope $scope - * @return RuleError[] - */ - public function processNode(Node $node, Scope $scope): array - { - $conditionType = $scope->getType($node->cond)->toBoolean(); - if ( - $conditionType instanceof ConstantBooleanType - && $conditionType->getValue() - && $this->helper->shouldSkip($scope, $node->cond) - && !$this->helper->shouldReportAlwaysTrueByDefault($node->cond) - ) { - return [ - RuleErrorBuilder::message('Else branch is unreachable because ternary operator condition is always true.')->line($node->else->getLine())->build(), - ]; - } - - return []; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Constants/ConstantRule.php b/vendor/phpstan/phpstan/src/Rules/Constants/ConstantRule.php deleted file mode 100644 index b8a359f..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Constants/ConstantRule.php +++ /dev/null @@ -1,35 +0,0 @@ -hasConstant($node->name)) { - return [ - sprintf( - 'Constant %s not found.', - (string) $node->name - ), - ]; - } - - return []; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/DeadCode/NoopRule.php b/vendor/phpstan/phpstan/src/Rules/DeadCode/NoopRule.php deleted file mode 100644 index fd01b3f..0000000 --- a/vendor/phpstan/phpstan/src/Rules/DeadCode/NoopRule.php +++ /dev/null @@ -1,65 +0,0 @@ -printer = $printer; - } - - public function getNodeType(): string - { - return Node\Stmt\Expression::class; - } - - /** - * @param Node\Stmt\Expression $node - * @param Scope $scope - * @return string[] - */ - public function processNode(Node $node, Scope $scope): array - { - $originalExpr = $node->expr; - $expr = $originalExpr; - if ( - $expr instanceof Node\Expr\Cast - || $expr instanceof Node\Expr\UnaryMinus - || $expr instanceof Node\Expr\UnaryPlus - || $expr instanceof Node\Expr\ErrorSuppress - ) { - $expr = $expr->expr; - } - if ( - !$expr instanceof Node\Expr\Variable - && !$expr instanceof Node\Expr\PropertyFetch - && !$expr instanceof Node\Expr\StaticPropertyFetch - && !$expr instanceof Node\Expr\ArrayDimFetch - && !$expr instanceof Node\Scalar - && !$expr instanceof Node\Expr\Isset_ - && !$expr instanceof Node\Expr\Empty_ - && !$expr instanceof Node\Expr\ConstFetch - && !$expr instanceof Node\Expr\ClassConstFetch - ) { - return []; - } - - return [ - sprintf( - 'Expression "%s" on a separate line does not do anything.', - $this->printer->prettyPrintExpr($originalExpr) - ), - ]; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/DeadCode/UnreachableStatementRule.php b/vendor/phpstan/phpstan/src/Rules/DeadCode/UnreachableStatementRule.php deleted file mode 100644 index b52dfd0..0000000 --- a/vendor/phpstan/phpstan/src/Rules/DeadCode/UnreachableStatementRule.php +++ /dev/null @@ -1,34 +0,0 @@ -getOriginalStatement() instanceof Node\Stmt\Nop) { - return []; - } - - return [ - 'Unreachable statement - code above always terminates.', - ]; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Exceptions/CaughtExceptionExistenceRule.php b/vendor/phpstan/phpstan/src/Rules/Exceptions/CaughtExceptionExistenceRule.php deleted file mode 100644 index 759aa31..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Exceptions/CaughtExceptionExistenceRule.php +++ /dev/null @@ -1,75 +0,0 @@ -broker = $broker; - $this->classCaseSensitivityCheck = $classCaseSensitivityCheck; - $this->checkClassCaseSensitivity = $checkClassCaseSensitivity; - } - - public function getNodeType(): string - { - return Catch_::class; - } - - /** - * @param \PhpParser\Node\Stmt\Catch_ $node - * @param \PHPStan\Analyser\Scope $scope - * @return RuleError[] - */ - public function processNode(Node $node, Scope $scope): array - { - $errors = []; - foreach ($node->types as $class) { - $className = (string) $class; - if (!$this->broker->hasClass($className)) { - $errors[] = RuleErrorBuilder::message(sprintf('Caught class %s not found.', $className))->line($class->getLine())->build(); - continue; - } - - $classReflection = $this->broker->getClass($className); - if (!$classReflection->isInterface() && !$classReflection->getNativeReflection()->implementsInterface(\Throwable::class)) { - $errors[] = RuleErrorBuilder::message(sprintf('Caught class %s is not an exception.', $classReflection->getDisplayName()))->line($class->getLine())->build(); - } - - if (!$this->checkClassCaseSensitivity) { - continue; - } - - $errors = array_merge( - $errors, - $this->classCaseSensitivityCheck->checkClassNames([new ClassNameNodePair($className, $class)]) - ); - } - - return $errors; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Exceptions/DeadCatchRule.php b/vendor/phpstan/phpstan/src/Rules/Exceptions/DeadCatchRule.php deleted file mode 100644 index 6364958..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Exceptions/DeadCatchRule.php +++ /dev/null @@ -1,56 +0,0 @@ -toString()); - }, $catch->types)); - }, $node->catches); - $catchesCount = count($catchTypes); - $errors = []; - for ($i = 0; $i < $catchesCount - 1; $i++) { - $firstType = $catchTypes[$i]; - for ($j = $i + 1; $j < $catchesCount; $j++) { - $secondType = $catchTypes[$j]; - if (!$firstType->isSuperTypeOf($secondType)->yes()) { - continue; - } - - $errors[] = RuleErrorBuilder::message(sprintf( - 'Dead catch - %s is already caught by %s above.', - $secondType->describe(VerbosityLevel::typeOnly()), - $firstType->describe(VerbosityLevel::typeOnly()) - ))->line($node->catches[$j]->getLine())->build(); - } - } - - return $errors; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/FileRuleError.php b/vendor/phpstan/phpstan/src/Rules/FileRuleError.php deleted file mode 100644 index 7f5cd7f..0000000 --- a/vendor/phpstan/phpstan/src/Rules/FileRuleError.php +++ /dev/null @@ -1,10 +0,0 @@ -type = $type; - $this->referencedClasses = $referencedClasses; - $this->unknownClassErrors = $unknownClassErrors; - } - - public function getType(): Type - { - return $this->type; - } - - /** - * @return string[] - */ - public function getReferencedClasses(): array - { - return $this->referencedClasses; - } - - /** - * @return RuleError[] - */ - public function getUnknownClassErrors(): array - { - return $this->unknownClassErrors; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/FunctionCallParametersCheck.php b/vendor/phpstan/phpstan/src/Rules/FunctionCallParametersCheck.php deleted file mode 100644 index 228b138..0000000 --- a/vendor/phpstan/phpstan/src/Rules/FunctionCallParametersCheck.php +++ /dev/null @@ -1,192 +0,0 @@ -ruleLevelHelper = $ruleLevelHelper; - $this->checkArgumentTypes = $checkArgumentTypes; - $this->checkArgumentsPassedByReference = $checkArgumentsPassedByReference; - } - - /** - * @param \PHPStan\Reflection\ParametersAcceptor $parametersAcceptor - * @param \PHPStan\Analyser\Scope $scope - * @param \PhpParser\Node\Expr\FuncCall|\PhpParser\Node\Expr\MethodCall|\PhpParser\Node\Expr\StaticCall|\PhpParser\Node\Expr\New_ $funcCall - * @param string[] $messages Eight message templates - * @return string[] - */ - public function check( - ParametersAcceptor $parametersAcceptor, - Scope $scope, - $funcCall, - array $messages - ): array - { - $functionParametersMinCount = 0; - $functionParametersMaxCount = 0; - foreach ($parametersAcceptor->getParameters() as $parameter) { - if (!$parameter->isOptional()) { - $functionParametersMinCount++; - } - - $functionParametersMaxCount++; - } - - if ($parametersAcceptor->isVariadic()) { - $functionParametersMaxCount = -1; - } - - $errors = []; - $invokedParametersCount = count($funcCall->args); - foreach ($funcCall->args as $arg) { - if ($arg->unpack) { - $invokedParametersCount = max($functionParametersMinCount, $functionParametersMaxCount); - break; - } - } - - if ($invokedParametersCount < $functionParametersMinCount || $invokedParametersCount > $functionParametersMaxCount) { - if ($functionParametersMinCount === $functionParametersMaxCount) { - $errors[] = sprintf( - $invokedParametersCount === 1 ? $messages[0] : $messages[1], - $invokedParametersCount, - $functionParametersMinCount - ); - } elseif ($functionParametersMaxCount === -1 && $invokedParametersCount < $functionParametersMinCount) { - $errors[] = sprintf( - $invokedParametersCount === 1 ? $messages[2] : $messages[3], - $invokedParametersCount, - $functionParametersMinCount - ); - } elseif ($functionParametersMaxCount !== -1) { - $errors[] = sprintf( - $invokedParametersCount === 1 ? $messages[4] : $messages[5], - $invokedParametersCount, - $functionParametersMinCount, - $functionParametersMaxCount - ); - } - } - - if ( - $scope->getType($funcCall) instanceof VoidType - && !$scope->isInFirstLevelStatement() - && !$funcCall instanceof \PhpParser\Node\Expr\New_ - ) { - $errors[] = $messages[7]; - } - - if (!$this->checkArgumentTypes && !$this->checkArgumentsPassedByReference) { - return $errors; - } - - $parameters = $parametersAcceptor->getParameters(); - - /** @var array $args */ - $args = $funcCall->args; - foreach ($args as $i => $argument) { - if (!isset($parameters[$i])) { - if (!$parametersAcceptor->isVariadic() || count($parameters) === 0) { - break; - } - - $parameter = $parameters[count($parameters) - 1]; - $parameterType = $parameter->getType(); - if (!($parameterType instanceof ArrayType)) { - break; - } - - if (!$argument->unpack) { - $parameterType = $parameterType->getItemType(); - } - } else { - $parameter = $parameters[$i]; - $parameterType = $parameter->getType(); - if ($parameter->isVariadic()) { - if ($parameterType instanceof ArrayType && !$argument->unpack) { - $parameterType = $parameterType->getItemType(); - } - } elseif ($argument->unpack) { - continue; - } - } - - $argumentValueType = $scope->getType($argument->value); - $secondAccepts = null; - if ($parameterType->isIterable()->yes() && $parameter->isVariadic()) { - $secondAccepts = $this->ruleLevelHelper->accepts( - new IterableType( - new MixedType(), - $parameterType->getIterableValueType() - ), - $argumentValueType, - $scope->isDeclareStrictTypes() - ); - } - - if ( - $this->checkArgumentTypes - && !$parameter->passedByReference()->createsNewVariable() - && !$this->ruleLevelHelper->accepts($parameterType, $argumentValueType, $scope->isDeclareStrictTypes()) - && ($secondAccepts === null || !$secondAccepts) - ) { - $verbosityLevel = TypeUtils::containsCallable($parameterType) || count(TypeUtils::getConstantArrays($parameterType)) > 0 - ? VerbosityLevel::value() - : VerbosityLevel::typeOnly(); - $errors[] = sprintf( - $messages[6], - $i + 1, - sprintf('%s$%s', $parameter->isVariadic() ? '...' : '', $parameter->getName()), - $parameterType->describe($verbosityLevel), - $argumentValueType->describe($verbosityLevel) - ); - } - - if ( - !$this->checkArgumentsPassedByReference - || !$parameter->passedByReference()->yes() - || $argument->value instanceof \PhpParser\Node\Expr\Variable - || $argument->value instanceof \PhpParser\Node\Expr\ArrayDimFetch - || $argument->value instanceof \PhpParser\Node\Expr\PropertyFetch - || $argument->value instanceof \PhpParser\Node\Expr\StaticPropertyFetch - ) { - continue; - } - - $errors[] = sprintf( - $messages[8], - $i + 1, - sprintf('%s$%s', $parameter->isVariadic() ? '...' : '', $parameter->getName()) - ); - } - - return $errors; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/FunctionDefinitionCheck.php b/vendor/phpstan/phpstan/src/Rules/FunctionDefinitionCheck.php deleted file mode 100644 index 1a2f2ea..0000000 --- a/vendor/phpstan/phpstan/src/Rules/FunctionDefinitionCheck.php +++ /dev/null @@ -1,323 +0,0 @@ -broker = $broker; - $this->classCaseSensitivityCheck = $classCaseSensitivityCheck; - $this->checkClassCaseSensitivity = $checkClassCaseSensitivity; - $this->checkThisOnly = $checkThisOnly; - } - - /** - * @param \PhpParser\Node\FunctionLike $function - * @param string $parameterMessage - * @param string $returnMessage - * @return RuleError[] - */ - public function checkFunction( - FunctionLike $function, - string $parameterMessage, - string $returnMessage - ): array - { - if ($function instanceof ClassMethod) { - throw new \PHPStan\ShouldNotHappenException('Use FunctionDefinitionCheck::checkClassMethod() instead.'); - } - if ($function instanceof Function_) { - $functionName = $function->name->name; - if (isset($function->namespacedName)) { - $functionName = (string) $function->namespacedName; - } - $functionNameName = new Name($functionName); - if (!$this->broker->hasCustomFunction($functionNameName, null)) { - return []; - } - - $functionReflection = $this->broker->getCustomFunction($functionNameName, null); - - /** @var \PHPStan\Reflection\ParametersAcceptorWithPhpDocs $parametersAcceptor */ - $parametersAcceptor = ParametersAcceptorSelector::selectSingle($functionReflection->getVariants()); - - return $this->checkParametersAcceptor( - $parametersAcceptor, - $function, - $parameterMessage, - $returnMessage - ); - } - - return $this->checkAnonymousFunction( - $function->getParams(), - $function->getReturnType(), - $parameterMessage, - $returnMessage - ); - } - - /** - * @param \PhpParser\Node\Param[] $parameters - * @param \PhpParser\Node\Identifier|\PhpParser\Node\Name|\PhpParser\Node\NullableType|null $returnTypeNode - * @param string $parameterMessage - * @param string $returnMessage - * @return \PHPStan\Rules\RuleError[] - */ - public function checkAnonymousFunction( - array $parameters, - $returnTypeNode, - string $parameterMessage, - string $returnMessage - ): array - { - $errors = []; - foreach ($parameters as $param) { - if ($param->type === null) { - continue; - } - $class = $param->type instanceof NullableType - ? (string) $param->type->type - : (string) $param->type; - $lowercasedClass = strtolower($class); - if ($lowercasedClass === '' || in_array($lowercasedClass, self::VALID_TYPEHINTS, true)) { - continue; - } - - if (!$this->broker->hasClass($class) || $this->broker->getClass($class)->isTrait()) { - if (!$param->var instanceof Variable || !is_string($param->var->name)) { - throw new \PHPStan\ShouldNotHappenException(); - } - $errors[] = RuleErrorBuilder::message(sprintf($parameterMessage, $param->var->name, $class))->line($param->type->getLine())->build(); - } elseif ($this->checkClassCaseSensitivity) { - $errors = array_merge( - $errors, - $this->classCaseSensitivityCheck->checkClassNames([ - new ClassNameNodePair($class, $param->type), - ]) - ); - } - } - - if ($returnTypeNode === null) { - return $errors; - } - - $returnType = $returnTypeNode instanceof NullableType - ? (string) $returnTypeNode->type - : (string) $returnTypeNode; - - $lowercasedReturnType = strtolower($returnType); - - if ( - $lowercasedReturnType !== '' - && !in_array($lowercasedReturnType, self::VALID_TYPEHINTS, true) - ) { - if (!$this->broker->hasClass($returnType) || $this->broker->getClass($returnType)->isTrait()) { - $errors[] = RuleErrorBuilder::message(sprintf($returnMessage, $returnType))->line($returnTypeNode->getLine())->build(); - } elseif ($this->checkClassCaseSensitivity) { - $errors = array_merge( - $errors, - $this->classCaseSensitivityCheck->checkClassNames([ - new ClassNameNodePair($returnType, $returnTypeNode), - ]) - ); - } - } - - return $errors; - } - - /** - * @param PhpMethodFromParserNodeReflection $methodReflection - * @param ClassMethod $methodNode - * @param string $parameterMessage - * @param string $returnMessage - * @return RuleError[] - */ - public function checkClassMethod( - PhpMethodFromParserNodeReflection $methodReflection, - ClassMethod $methodNode, - string $parameterMessage, - string $returnMessage - ): array - { - /** @var \PHPStan\Reflection\ParametersAcceptorWithPhpDocs $parametersAcceptor */ - $parametersAcceptor = ParametersAcceptorSelector::selectSingle($methodReflection->getVariants()); - - return $this->checkParametersAcceptor( - $parametersAcceptor, - $methodNode, - $parameterMessage, - $returnMessage - ); - } - - /** - * @param ParametersAcceptorWithPhpDocs $parametersAcceptor - * @param FunctionLike $functionNode - * @param string $parameterMessage - * @param string $returnMessage - * @return RuleError[] - */ - private function checkParametersAcceptor( - ParametersAcceptorWithPhpDocs $parametersAcceptor, - FunctionLike $functionNode, - string $parameterMessage, - string $returnMessage - ): array - { - $errors = []; - $parameterNodes = $functionNode->getParams(); - $returnTypeNode = $functionNode->getReturnType() ?? $functionNode; - foreach ($parametersAcceptor->getParameters() as $parameter) { - if ($this->checkThisOnly) { - $referencedClasses = $parameter->getType()->getReferencedClasses(); - } else { - $referencedClasses = array_merge( - $parameter->getNativeType()->getReferencedClasses(), - $parameter->getPhpDocType()->getReferencedClasses() - ); - } - $parameterNode = null; - $parameterNodeCallback = function () use ($parameter, $parameterNodes, &$parameterNode): Param { - if ($parameterNode === null) { - $parameterNode = $this->getParameterNode($parameter->getName(), $parameterNodes); - } - - return $parameterNode; - }; - foreach ($referencedClasses as $class) { - if ($this->broker->hasClass($class) && !$this->broker->getClass($class)->isTrait()) { - continue; - } - - $errors[] = RuleErrorBuilder::message(sprintf( - $parameterMessage, - $parameter->getName(), - $class - ))->line($parameterNodeCallback()->getLine())->build(); - } - - if ($this->checkClassCaseSensitivity) { - $errors = array_merge( - $errors, - $this->classCaseSensitivityCheck->checkClassNames(array_map(static function (string $class) use ($parameterNodeCallback): ClassNameNodePair { - return new ClassNameNodePair($class, $parameterNodeCallback()); - }, $referencedClasses)) - ); - } - if (!($parameter->getType() instanceof NonexistentParentClassType)) { - continue; - } - - $errors[] = RuleErrorBuilder::message(sprintf($parameterMessage, $parameter->getName(), $parameter->getType()->describe(VerbosityLevel::typeOnly())))->line($parameterNodeCallback()->getLine())->build(); - } - - if ($this->checkThisOnly) { - $returnTypeReferencedClasses = $parametersAcceptor->getReturnType()->getReferencedClasses(); - } else { - $returnTypeReferencedClasses = array_merge( - $parametersAcceptor->getNativeReturnType()->getReferencedClasses(), - $parametersAcceptor->getPhpDocReturnType()->getReferencedClasses() - ); - } - - foreach ($returnTypeReferencedClasses as $class) { - if ($this->broker->hasClass($class) && !$this->broker->getClass($class)->isTrait()) { - continue; - } - - $errors[] = RuleErrorBuilder::message(sprintf($returnMessage, $class))->line($returnTypeNode->getLine())->build(); - } - - if ($this->checkClassCaseSensitivity) { - $errors = array_merge( - $errors, - $this->classCaseSensitivityCheck->checkClassNames(array_map(static function (string $class) use ($returnTypeNode): ClassNameNodePair { - return new ClassNameNodePair($class, $returnTypeNode); - }, $returnTypeReferencedClasses)) - ); - } - if ($parametersAcceptor->getReturnType() instanceof NonexistentParentClassType) { - $errors[] = RuleErrorBuilder::message(sprintf($returnMessage, $parametersAcceptor->getReturnType()->describe(VerbosityLevel::typeOnly())))->line($returnTypeNode->getLine())->build(); - } - - return $errors; - } - - /** - * @param string $parameterName - * @param Param[] $parameterNodes - * @return Param - */ - private function getParameterNode( - string $parameterName, - array $parameterNodes - ): Param - { - foreach ($parameterNodes as $param) { - if ($param->var instanceof \PhpParser\Node\Expr\Error) { - continue; - } - - if (!is_string($param->var->name)) { - continue; - } - - if ($param->var->name === $parameterName) { - return $param; - } - } - - throw new \PHPStan\ShouldNotHappenException(sprintf('Parameter %s not found.', $parameterName)); - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/FunctionReturnTypeCheck.php b/vendor/phpstan/phpstan/src/Rules/FunctionReturnTypeCheck.php deleted file mode 100644 index 51218bd..0000000 --- a/vendor/phpstan/phpstan/src/Rules/FunctionReturnTypeCheck.php +++ /dev/null @@ -1,88 +0,0 @@ -ruleLevelHelper = $ruleLevelHelper; - } - - /** - * @param \PHPStan\Analyser\Scope $scope - * @param \PHPStan\Type\Type $returnType - * @param \PhpParser\Node\Expr|null $returnValue - * @param string $emptyReturnStatementMessage - * @param string $voidMessage - * @param string $typeMismatchMessage - * @param bool $isGenerator - * @return string[] - */ - public function checkReturnType( - Scope $scope, - Type $returnType, - ?Expr $returnValue, - string $emptyReturnStatementMessage, - string $voidMessage, - string $typeMismatchMessage, - bool $isGenerator - ): array - { - if ($isGenerator) { - return []; - } - - $isVoidSuperType = (new VoidType())->isSuperTypeOf($returnType); - $verbosityLevel = $returnType->isCallable()->yes() || count(TypeUtils::getConstantArrays($returnType)) > 0 - ? VerbosityLevel::value() - : VerbosityLevel::typeOnly(); - if ($returnValue === null) { - if (!$isVoidSuperType->no()) { - return []; - } - - return [ - sprintf( - $emptyReturnStatementMessage, - $returnType->describe($verbosityLevel) - ), - ]; - } - - $returnValueType = $scope->getType($returnValue); - - if ($isVoidSuperType->yes()) { - return [ - sprintf( - $voidMessage, - $returnValueType->describe($verbosityLevel) - ), - ]; - } - - if (!$this->ruleLevelHelper->accepts($returnType, $returnValueType, $scope->isDeclareStrictTypes())) { - return [ - sprintf( - $typeMismatchMessage, - $returnType->describe($verbosityLevel), - $returnValueType->describe($verbosityLevel) - ), - ]; - } - - return []; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Functions/ArrowFunctionReturnTypeRule.php b/vendor/phpstan/phpstan/src/Rules/Functions/ArrowFunctionReturnTypeRule.php deleted file mode 100644 index eeb52f7..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Functions/ArrowFunctionReturnTypeRule.php +++ /dev/null @@ -1,53 +0,0 @@ -returnTypeCheck = $returnTypeCheck; - } - - public function getNodeType(): string - { - return InArrowFunctionNode::class; - } - - /** - * @param \PHPStan\Node\InArrowFunctionNode $node - * @param \PHPStan\Analyser\Scope $scope - * @return string[] - */ - public function processNode(Node $node, Scope $scope): array - { - if (!$scope->isInAnonymousFunction()) { - throw new \PHPStan\ShouldNotHappenException(); - } - - /** @var \PHPStan\Type\Type $returnType */ - $returnType = $scope->getAnonymousFunctionReturnType(); - $generatorType = new ObjectType(\Generator::class); - - return $this->returnTypeCheck->checkReturnType( - $scope, - $returnType, - $node->getOriginalNode()->expr, - 'Anonymous function should return %s but empty return statement found.', - 'Anonymous function with return type void returns %s but should not return anything.', - 'Anonymous function should return %s but returns %s.', - $generatorType->isSuperTypeOf($returnType)->yes() - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Functions/CallCallablesRule.php b/vendor/phpstan/phpstan/src/Rules/Functions/CallCallablesRule.php deleted file mode 100644 index cb76168..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Functions/CallCallablesRule.php +++ /dev/null @@ -1,131 +0,0 @@ -check = $check; - $this->ruleLevelHelper = $ruleLevelHelper; - $this->reportMaybes = $reportMaybes; - } - - public function getNodeType(): string - { - return \PhpParser\Node\Expr\FuncCall::class; - } - - /** - * @param \PhpParser\Node\Expr\FuncCall $node - * @param \PHPStan\Analyser\Scope $scope - * @return (string|\PHPStan\Rules\RuleError)[] - */ - public function processNode( - \PhpParser\Node $node, - Scope $scope - ): array - { - if (!$node->name instanceof \PhpParser\Node\Expr) { - return []; - } - - $typeResult = $this->ruleLevelHelper->findTypeToCheck( - $scope, - $node->name, - 'Invoking callable on an unknown class %s.', - static function (Type $type): bool { - return $type->isCallable()->yes(); - } - ); - $type = $typeResult->getType(); - if ($type instanceof ErrorType) { - return $typeResult->getUnknownClassErrors(); - } - - $isCallable = $type->isCallable(); - if ($isCallable->no()) { - return [ - sprintf('Trying to invoke %s but it\'s not a callable.', $type->describe(VerbosityLevel::value())), - ]; - } - if ($this->reportMaybes && $isCallable->maybe()) { - return [ - sprintf('Trying to invoke %s but it might not be a callable.', $type->describe(VerbosityLevel::value())), - ]; - } - - $parametersAcceptors = $type->getCallableParametersAcceptors($scope); - $messages = []; - - if ( - count($parametersAcceptors) === 1 - && $parametersAcceptors[0] instanceof InaccessibleMethod - ) { - $method = $parametersAcceptors[0]->getMethod(); - $messages[] = sprintf( - 'Call to %s method %s() of class %s.', - $method->isPrivate() ? 'private' : 'protected', - $method->getName(), - $method->getDeclaringClass()->getDisplayName() - ); - } - - $parametersAcceptor = ParametersAcceptorSelector::selectFromArgs( - $scope, - $node->args, - $parametersAcceptors - ); - - if ($type instanceof ClosureType) { - $callableDescription = 'closure'; - } else { - $callableDescription = sprintf('callable %s', $type->describe(VerbosityLevel::value())); - } - - return array_merge( - $messages, - $this->check->check( - $parametersAcceptor, - $scope, - $node, - [ - ucfirst($callableDescription) . ' invoked with %d parameter, %d required.', - ucfirst($callableDescription) . ' invoked with %d parameters, %d required.', - ucfirst($callableDescription) . ' invoked with %d parameter, at least %d required.', - ucfirst($callableDescription) . ' invoked with %d parameters, at least %d required.', - ucfirst($callableDescription) . ' invoked with %d parameter, %d-%d required.', - ucfirst($callableDescription) . ' invoked with %d parameters, %d-%d required.', - 'Parameter #%d %s of ' . $callableDescription . ' expects %s, %s given.', - 'Result of ' . $callableDescription . ' (void) is used.', - 'Parameter #%d %s of ' . $callableDescription . ' is passed by reference, so it expects variables only.', - ] - ) - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Functions/CallToFunctionParametersRule.php b/vendor/phpstan/phpstan/src/Rules/Functions/CallToFunctionParametersRule.php deleted file mode 100644 index 7093e9a..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Functions/CallToFunctionParametersRule.php +++ /dev/null @@ -1,71 +0,0 @@ -broker = $broker; - $this->check = $check; - } - - public function getNodeType(): string - { - return FuncCall::class; - } - - /** - * @param \PhpParser\Node\Expr\FuncCall $node - * @param \PHPStan\Analyser\Scope $scope - * @return string[] - */ - public function processNode(Node $node, Scope $scope): array - { - if (!($node->name instanceof \PhpParser\Node\Name)) { - return []; - } - - if (!$this->broker->hasFunction($node->name, $scope)) { - return []; - } - - $function = $this->broker->getFunction($node->name, $scope); - - return $this->check->check( - ParametersAcceptorSelector::selectFromArgs( - $scope, - $node->args, - $function->getVariants() - ), - $scope, - $node, - [ - 'Function ' . $function->getName() . ' invoked with %d parameter, %d required.', - 'Function ' . $function->getName() . ' invoked with %d parameters, %d required.', - 'Function ' . $function->getName() . ' invoked with %d parameter, at least %d required.', - 'Function ' . $function->getName() . ' invoked with %d parameters, at least %d required.', - 'Function ' . $function->getName() . ' invoked with %d parameter, %d-%d required.', - 'Function ' . $function->getName() . ' invoked with %d parameters, %d-%d required.', - 'Parameter #%d %s of function ' . $function->getName() . ' expects %s, %s given.', - 'Result of function ' . $function->getName() . ' (void) is used.', - 'Parameter #%d %s of function ' . $function->getName() . ' is passed by reference, so it expects variables only.', - ] - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Functions/CallToNonExistentFunctionRule.php b/vendor/phpstan/phpstan/src/Rules/Functions/CallToNonExistentFunctionRule.php deleted file mode 100644 index 47557d2..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Functions/CallToNonExistentFunctionRule.php +++ /dev/null @@ -1,65 +0,0 @@ -broker = $broker; - $this->checkFunctionNameCase = $checkFunctionNameCase; - } - - public function getNodeType(): string - { - return FuncCall::class; - } - - /** - * @param \PhpParser\Node\Expr\FuncCall $node - * @param \PHPStan\Analyser\Scope $scope - * @return string[] - */ - public function processNode(Node $node, Scope $scope): array - { - if (!($node->name instanceof \PhpParser\Node\Name)) { - return []; - } - - if (!$this->broker->hasFunction($node->name, $scope)) { - return [sprintf('Function %s not found.', (string) $node->name)]; - } - - $function = $this->broker->getFunction($node->name, $scope); - $name = (string) $node->name; - - if ($this->checkFunctionNameCase) { - /** @var string $calledFunctionName */ - $calledFunctionName = $this->broker->resolveFunctionName($node->name, $scope); - if ( - strtolower($function->getName()) === strtolower($calledFunctionName) - && $function->getName() !== $calledFunctionName - ) { - return [sprintf('Call to function %s() with incorrect case: %s', $function->getName(), $name)]; - } - } - - return []; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Functions/ClosureReturnTypeRule.php b/vendor/phpstan/phpstan/src/Rules/Functions/ClosureReturnTypeRule.php deleted file mode 100644 index 8d77ad6..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Functions/ClosureReturnTypeRule.php +++ /dev/null @@ -1,53 +0,0 @@ -returnTypeCheck = $returnTypeCheck; - } - - public function getNodeType(): string - { - return Return_::class; - } - - /** - * @param \PhpParser\Node\Stmt\Return_ $node - * @param \PHPStan\Analyser\Scope $scope - * @return string[] - */ - public function processNode(Node $node, Scope $scope): array - { - if (!$scope->isInAnonymousFunction()) { - return []; - } - - /** @var \PHPStan\Type\Type $returnType */ - $returnType = $scope->getAnonymousFunctionReturnType(); - $generatorType = new ObjectType(\Generator::class); - - return $this->returnTypeCheck->checkReturnType( - $scope, - $returnType, - $node->expr, - 'Anonymous function should return %s but empty return statement found.', - 'Anonymous function with return type void returns %s but should not return anything.', - 'Anonymous function should return %s but returns %s.', - $generatorType->isSuperTypeOf($returnType)->yes() - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Functions/ExistingClassesInArrowFunctionTypehintsRule.php b/vendor/phpstan/phpstan/src/Rules/Functions/ExistingClassesInArrowFunctionTypehintsRule.php deleted file mode 100644 index 8dad919..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Functions/ExistingClassesInArrowFunctionTypehintsRule.php +++ /dev/null @@ -1,41 +0,0 @@ -check = $check; - } - - public function getNodeType(): string - { - return Node\Expr\ArrowFunction::class; - } - - /** - * @param \PhpParser\Node\Expr\ArrowFunction $node - * @param \PHPStan\Analyser\Scope $scope - * @return RuleError[] - */ - public function processNode(Node $node, Scope $scope): array - { - return $this->check->checkAnonymousFunction( - $node->getParams(), - $node->getReturnType(), - 'Parameter $%s of anonymous function has invalid typehint type %s.', - 'Return typehint of anonymous function has invalid type %s.' - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Functions/ExistingClassesInClosureTypehintsRule.php b/vendor/phpstan/phpstan/src/Rules/Functions/ExistingClassesInClosureTypehintsRule.php deleted file mode 100644 index c94e6bb..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Functions/ExistingClassesInClosureTypehintsRule.php +++ /dev/null @@ -1,42 +0,0 @@ -check = $check; - } - - public function getNodeType(): string - { - return Closure::class; - } - - /** - * @param \PhpParser\Node\Expr\Closure $node - * @param \PHPStan\Analyser\Scope $scope - * @return RuleError[] - */ - public function processNode(Node $node, Scope $scope): array - { - return $this->check->checkAnonymousFunction( - $node->getParams(), - $node->getReturnType(), - 'Parameter $%s of anonymous function has invalid typehint type %s.', - 'Return typehint of anonymous function has invalid type %s.' - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Functions/ExistingClassesInTypehintsRule.php b/vendor/phpstan/phpstan/src/Rules/Functions/ExistingClassesInTypehintsRule.php deleted file mode 100644 index 2386636..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Functions/ExistingClassesInTypehintsRule.php +++ /dev/null @@ -1,47 +0,0 @@ -check = $check; - } - - public function getNodeType(): string - { - return Function_::class; - } - - /** - * @param \PhpParser\Node\Stmt\Function_ $node - * @param \PHPStan\Analyser\Scope $scope - * @return RuleError[] - */ - public function processNode(Node $node, Scope $scope): array - { - return $this->check->checkFunction( - $node, - sprintf( - 'Parameter $%%s of function %s() has invalid typehint type %%s.', - (string) $node->namespacedName - ), - sprintf( - 'Return typehint of function %s() has invalid type %%s.', - (string) $node->namespacedName - ) - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Functions/IncompatibleDefaultParameterTypeRule.php b/vendor/phpstan/phpstan/src/Rules/Functions/IncompatibleDefaultParameterTypeRule.php deleted file mode 100644 index ef9d319..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Functions/IncompatibleDefaultParameterTypeRule.php +++ /dev/null @@ -1,83 +0,0 @@ -broker = $broker; - } - - public function getNodeType(): string - { - return FunctionLike::class; - } - - /** - * @param FunctionLike $node - * @param Scope $scope - * @return RuleError[] - */ - public function processNode(Node $node, Scope $scope): array - { - if (!($node instanceof Function_)) { - return []; - } - - $name = $node->namespacedName; - if (!$this->broker->hasFunction($name, $scope)) { - return []; - } - - $function = $this->broker->getFunction($name, $scope); - $parameters = ParametersAcceptorSelector::selectSingle($function->getVariants()); - - $errors = []; - foreach ($node->getParams() as $paramI => $param) { - if ($param->default === null) { - continue; - } - if ( - $param->var instanceof Node\Expr\Error - || !is_string($param->var->name) - ) { - throw new \PHPStan\ShouldNotHappenException(); - } - - $defaultValueType = $scope->getType($param->default); - $parameterType = $parameters->getParameters()[$paramI]->getType(); - - if ($parameterType->isSuperTypeOf($defaultValueType)->yes()) { - continue; - } - - $errors[] = RuleErrorBuilder::message(sprintf( - 'Default value of the parameter #%d $%s (%s) of function %s() is incompatible with type %s.', - $paramI + 1, - $param->var->name, - $defaultValueType->describe(VerbosityLevel::value()), - $function->getName(), - $parameterType->describe(VerbosityLevel::value()) - ))->line($param->getLine())->build(); - } - - return $errors; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Functions/InnerFunctionRule.php b/vendor/phpstan/phpstan/src/Rules/Functions/InnerFunctionRule.php deleted file mode 100644 index fc43ab6..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Functions/InnerFunctionRule.php +++ /dev/null @@ -1,33 +0,0 @@ -getFunction() === null) { - return []; - } - - return [ - 'Inner named functions are not supported by PHPStan. Consider refactoring to an anonymous function, class method, or a top-level-defined function. See issue #165 (https://github.com/phpstan/phpstan/issues/165) for more details.', - ]; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Functions/NonExistentDefinedFunctionRule.php b/vendor/phpstan/phpstan/src/Rules/Functions/NonExistentDefinedFunctionRule.php deleted file mode 100644 index 4f99bbf..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Functions/NonExistentDefinedFunctionRule.php +++ /dev/null @@ -1,51 +0,0 @@ -broker = $broker; - } - - public function getNodeType(): string - { - return Function_::class; - } - - /** - * @param \PhpParser\Node\Stmt\Function_ $node - * @param \PHPStan\Analyser\Scope $scope - * @return string[] - */ - public function processNode(Node $node, Scope $scope): array - { - $functionName = $node->name->name; - if (isset($node->namespacedName)) { - $functionName = (string) $node->namespacedName; - } - $functionNameName = new Name($functionName); - if ($this->broker->hasFunction($functionNameName, null)) { - return []; - } - - return [ - sprintf( - 'Function %s not found while trying to analyse it - autoloading is probably not configured properly.', - $functionName - ), - ]; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Functions/PrintfParametersRule.php b/vendor/phpstan/phpstan/src/Rules/Functions/PrintfParametersRule.php deleted file mode 100644 index 9ad60f6..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Functions/PrintfParametersRule.php +++ /dev/null @@ -1,128 +0,0 @@ -name instanceof \PhpParser\Node\Name)) { - return []; - } - - $functionsArgumentPositions = [ - 'printf' => 0, - 'sprintf' => 0, - 'sscanf' => 1, - 'fscanf' => 1, - ]; - $minimumNumberOfArguments = [ - 'printf' => 1, - 'sprintf' => 1, - 'sscanf' => 3, - 'fscanf' => 3, - ]; - - $name = strtolower((string) $node->name); - if (!isset($functionsArgumentPositions[$name])) { - return []; - } - - $formatArgumentPosition = $functionsArgumentPositions[$name]; - - $args = $node->args; - foreach ($args as $arg) { - if ($arg->unpack) { - return []; - } - } - $argsCount = count($args); - if ($argsCount < $minimumNumberOfArguments[$name]) { - return []; // caught by CallToFunctionParametersRule - } - - $formatArgType = $scope->getType($args[$formatArgumentPosition]->value); - $placeHoldersCount = null; - foreach (TypeUtils::getConstantStrings($formatArgType) as $formatString) { - $format = $formatString->getValue(); - $tempPlaceHoldersCount = $this->getPlaceholdersCount($name, $format); - if ($placeHoldersCount === null) { - $placeHoldersCount = $tempPlaceHoldersCount; - } elseif ($tempPlaceHoldersCount > $placeHoldersCount) { - $placeHoldersCount = $tempPlaceHoldersCount; - } - } - - if ($placeHoldersCount === null) { - return []; - } - - $argsCount -= $formatArgumentPosition; - - if ($argsCount !== $placeHoldersCount + 1) { - return [ - sprintf( - sprintf( - '%s, %s.', - $placeHoldersCount === 1 ? 'Call to %s contains %d placeholder' : 'Call to %s contains %d placeholders', - $argsCount - 1 === 1 ? '%d value given' : '%d values given' - ), - $name, - $placeHoldersCount, - $argsCount - 1 - ), - ]; - } - - return []; - } - - private function getPlaceholdersCount(string $functionName, string $format): int - { - $specifiers = in_array($functionName, ['sprintf', 'printf'], true) ? '[bcdeEfFgGosuxX]' : '(?:[cdDeEfinosuxX]|\[[^\]]+\])'; - $pattern = '~(?%*)%(?:(?\d+)\$)?[-+]?(?:[ 0]|(?:\'[^%]))?-?\d*(?:\.\d*)?' . $specifiers . '~'; - - $matches = \Nette\Utils\Strings::matchAll($format, $pattern, PREG_SET_ORDER); - - if (count($matches) === 0) { - return 0; - } - - $placeholders = array_filter($matches, static function (array $match): bool { - return strlen($match['before']) % 2 === 0; - }); - - if (count($placeholders) === 0) { - return 0; - } - - $maxPositionedNumber = 0; - $maxOrdinaryNumber = 0; - foreach ($placeholders as $placeholder) { - if (isset($placeholder['position']) && $placeholder['position'] !== '') { - $maxPositionedNumber = max((int) $placeholder['position'], $maxPositionedNumber); - } else { - $maxOrdinaryNumber++; - } - } - - return max($maxPositionedNumber, $maxOrdinaryNumber); - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Functions/ReturnTypeRule.php b/vendor/phpstan/phpstan/src/Rules/Functions/ReturnTypeRule.php deleted file mode 100644 index 5d6f841..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Functions/ReturnTypeRule.php +++ /dev/null @@ -1,77 +0,0 @@ -returnTypeCheck = $returnTypeCheck; - } - - public function getNodeType(): string - { - return Return_::class; - } - - /** - * @param \PhpParser\Node\Stmt\Return_ $node - * @param \PHPStan\Analyser\Scope $scope - * @return string[] - */ - public function processNode(Node $node, Scope $scope): array - { - if ($scope->getFunction() === null) { - return []; - } - - if ($scope->isInAnonymousFunction()) { - return []; - } - - $function = $scope->getFunction(); - if ( - !($function instanceof PhpFunctionFromParserNodeReflection) - || $function instanceof PhpMethodFromParserNodeReflection - ) { - return []; - } - - $reflection = null; - if (function_exists($function->getName())) { - $reflection = new \ReflectionFunction($function->getName()); - } - - return $this->returnTypeCheck->checkReturnType( - $scope, - ParametersAcceptorSelector::selectSingle($function->getVariants())->getReturnType(), - $node->expr, - sprintf( - 'Function %s() should return %%s but empty return statement found.', - $function->getName() - ), - sprintf( - 'Function %s() with return type void returns %%s but should not return anything.', - $function->getName() - ), - sprintf( - 'Function %s() should return %%s but returns %%s.', - $function->getName() - ), - $reflection !== null && $reflection->isGenerator() - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Functions/UnusedClosureUsesRule.php b/vendor/phpstan/phpstan/src/Rules/Functions/UnusedClosureUsesRule.php deleted file mode 100644 index 2c2aa2f..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Functions/UnusedClosureUsesRule.php +++ /dev/null @@ -1,49 +0,0 @@ -check = $check; - } - - public function getNodeType(): string - { - return Node\Expr\Closure::class; - } - - /** - * @param \PhpParser\Node\Expr\Closure $node - * @param \PHPStan\Analyser\Scope $scope - * @return string[] - */ - public function processNode(Node $node, Scope $scope): array - { - if (count($node->uses) === 0) { - return []; - } - - return $this->check->getUnusedParameters( - $scope, - array_map(static function (Node\Expr\ClosureUse $use): string { - if (!is_string($use->var->name)) { - throw new \PHPStan\ShouldNotHappenException(); - } - return $use->var->name; - }, $node->uses), - $node->stmts, - 'Anonymous function has an unused use $%s.' - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Generators/YieldFromTypeRule.php b/vendor/phpstan/phpstan/src/Rules/Generators/YieldFromTypeRule.php deleted file mode 100644 index 51c20db..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Generators/YieldFromTypeRule.php +++ /dev/null @@ -1,94 +0,0 @@ -ruleLevelHelper = $ruleLevelHelper; - $this->reportMaybes = $reportMaybes; - } - - public function getNodeType(): string - { - return YieldFrom::class; - } - - /** - * @param YieldFrom $node - * @param Scope $scope - * @return string[] - */ - public function processNode(Node $node, Scope $scope): array - { - $exprType = $scope->getType($node->expr); - $isIterable = $exprType->isIterable(); - $messagePattern = 'Argument of an invalid type %s passed to yield from, only iterables are supported.'; - if ($isIterable->no()) { - return [ - sprintf($messagePattern, $exprType->describe(VerbosityLevel::typeOnly())), - ]; - } elseif ( - !$exprType instanceof MixedType - && $this->reportMaybes - && $isIterable->maybe() - ) { - return [ - sprintf($messagePattern, $exprType->describe(VerbosityLevel::typeOnly())), - ]; - } - - $anonymousFunctionReturnType = $scope->getAnonymousFunctionReturnType(); - $scopeFunction = $scope->getFunction(); - if ($anonymousFunctionReturnType !== null) { - $returnType = $anonymousFunctionReturnType; - } elseif ($scopeFunction !== null) { - $returnType = ParametersAcceptorSelector::selectSingle($scopeFunction->getVariants())->getReturnType(); - } else { - return []; // already reported by YieldInGeneratorRule - } - - if ($returnType instanceof MixedType) { - return []; - } - - $messages = []; - if (!$this->ruleLevelHelper->accepts($returnType->getIterableKeyType(), $exprType->getIterableKeyType(), $scope->isDeclareStrictTypes())) { - $messages[] = sprintf( - 'Generator expects key type %s, %s given.', - $returnType->getIterableKeyType()->describe(VerbosityLevel::typeOnly()), - $exprType->getIterableKeyType()->describe(VerbosityLevel::typeOnly()) - ); - } - if (!$this->ruleLevelHelper->accepts($returnType->getIterableValueType(), $exprType->getIterableValueType(), $scope->isDeclareStrictTypes())) { - $messages[] = sprintf( - 'Generator expects value type %s, %s given.', - $returnType->getIterableValueType()->describe(VerbosityLevel::typeOnly()), - $exprType->getIterableValueType()->describe(VerbosityLevel::typeOnly()) - ); - } - - return $messages; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Generators/YieldInGeneratorRule.php b/vendor/phpstan/phpstan/src/Rules/Generators/YieldInGeneratorRule.php deleted file mode 100644 index 21cbc91..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Generators/YieldInGeneratorRule.php +++ /dev/null @@ -1,75 +0,0 @@ -reportMaybes = $reportMaybes; - } - - public function getNodeType(): string - { - return Node\Expr::class; - } - - /** - * @param Node\Expr $node - * @param Scope $scope - * @return string[] - */ - public function processNode(Node $node, Scope $scope): array - { - if (!$node instanceof Node\Expr\Yield_ && !$node instanceof Node\Expr\YieldFrom) { - return []; - } - - $anonymousFunctionReturnType = $scope->getAnonymousFunctionReturnType(); - $scopeFunction = $scope->getFunction(); - if ($anonymousFunctionReturnType !== null) { - $returnType = $anonymousFunctionReturnType; - } elseif ($scopeFunction !== null) { - $returnType = ParametersAcceptorSelector::selectSingle($scopeFunction->getVariants())->getReturnType(); - } else { - return [ - 'Yield can be used only inside a function.', - ]; - } - - if ($returnType instanceof MixedType) { - return []; - } - - $isSuperType = $returnType->isIterable()->and(TrinaryLogic::createFromBoolean( - $returnType instanceof ArrayType - )->negate()); - if ($isSuperType->yes()) { - return []; - } - - if ($isSuperType->maybe() && !$this->reportMaybes) { - return []; - } - - return [ - sprintf( - 'Yield can be used only with these return types: %s.', - 'Generator, Iterator, Traversable, iterable' - ), - ]; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Generators/YieldTypeRule.php b/vendor/phpstan/phpstan/src/Rules/Generators/YieldTypeRule.php deleted file mode 100644 index 974fbb8..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Generators/YieldTypeRule.php +++ /dev/null @@ -1,85 +0,0 @@ -ruleLevelHelper = $ruleLevelHelper; - } - - public function getNodeType(): string - { - return Node\Expr\Yield_::class; - } - - /** - * @param Node\Expr\Yield_ $node - * @param Scope $scope - * @return string[] - */ - public function processNode(Node $node, Scope $scope): array - { - $anonymousFunctionReturnType = $scope->getAnonymousFunctionReturnType(); - $scopeFunction = $scope->getFunction(); - if ($anonymousFunctionReturnType !== null) { - $returnType = $anonymousFunctionReturnType; - } elseif ($scopeFunction !== null) { - $returnType = ParametersAcceptorSelector::selectSingle($scopeFunction->getVariants())->getReturnType(); - } else { - return []; // already reported by YieldInGeneratorRule - } - - if ($returnType instanceof MixedType) { - return []; - } - - if ($node->key === null) { - $keyType = new IntegerType(); - } else { - $keyType = $scope->getType($node->key); - } - - if ($node->value === null) { - $valueType = new NullType(); - } else { - $valueType = $scope->getType($node->value); - } - - $messages = []; - if (!$this->ruleLevelHelper->accepts($returnType->getIterableKeyType(), $keyType, $scope->isDeclareStrictTypes())) { - $messages[] = sprintf( - 'Generator expects key type %s, %s given.', - $returnType->getIterableKeyType()->describe(VerbosityLevel::typeOnly()), - $keyType->describe(VerbosityLevel::typeOnly()) - ); - } - if (!$this->ruleLevelHelper->accepts($returnType->getIterableValueType(), $valueType, $scope->isDeclareStrictTypes())) { - $messages[] = sprintf( - 'Generator expects value type %s, %s given.', - $returnType->getIterableValueType()->describe(VerbosityLevel::typeOnly()), - $valueType->describe(VerbosityLevel::typeOnly()) - ); - } - - return $messages; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/LineRuleError.php b/vendor/phpstan/phpstan/src/Rules/LineRuleError.php deleted file mode 100644 index 0388b7f..0000000 --- a/vendor/phpstan/phpstan/src/Rules/LineRuleError.php +++ /dev/null @@ -1,10 +0,0 @@ -broker = $broker; - $this->check = $check; - $this->ruleLevelHelper = $ruleLevelHelper; - $this->checkFunctionNameCase = $checkFunctionNameCase; - $this->reportMagicMethods = $reportMagicMethods; - } - - public function getNodeType(): string - { - return MethodCall::class; - } - - /** - * @param \PhpParser\Node\Expr\MethodCall $node - * @param \PHPStan\Analyser\Scope $scope - * @return (string|\PHPStan\Rules\RuleError)[] - */ - public function processNode(Node $node, Scope $scope): array - { - if (!$node->name instanceof Node\Identifier) { - return []; - } - - $name = $node->name->name; - $typeResult = $this->ruleLevelHelper->findTypeToCheck( - $scope, - $node->var, - sprintf('Call to method %s() on an unknown class %%s.', $name), - static function (Type $type) use ($name): bool { - return $type->canCallMethods()->yes() && $type->hasMethod($name)->yes(); - } - ); - $type = $typeResult->getType(); - if ($type instanceof ErrorType) { - return $typeResult->getUnknownClassErrors(); - } - if (!$type->canCallMethods()->yes()) { - return [ - sprintf('Cannot call method %s() on %s.', $name, $type->describe(VerbosityLevel::typeOnly())), - ]; - } - - if (!$type->hasMethod($name)->yes()) { - $directClassNames = $typeResult->getReferencedClasses(); - if (!$this->reportMagicMethods) { - foreach ($directClassNames as $className) { - if (!$this->broker->hasClass($className)) { - continue; - } - - $classReflection = $this->broker->getClass($className); - if ($classReflection->hasNativeMethod('__call')) { - return []; - } - } - } - - if (count($directClassNames) === 1) { - $referencedClass = $directClassNames[0]; - $methodClassReflection = $this->broker->getClass($referencedClass); - $parentClassReflection = $methodClassReflection->getParentClass(); - while ($parentClassReflection !== false) { - if ($parentClassReflection->hasMethod($name)) { - return [ - sprintf( - 'Call to private method %s() of parent class %s.', - $parentClassReflection->getMethod($name, $scope)->getName(), - $parentClassReflection->getDisplayName() - ), - ]; - } - - $parentClassReflection = $parentClassReflection->getParentClass(); - } - } - - return [ - sprintf( - 'Call to an undefined method %s::%s().', - $type->describe(VerbosityLevel::typeOnly()), - $name - ), - ]; - } - - $methodReflection = $type->getMethod($name, $scope); - $messagesMethodName = $methodReflection->getDeclaringClass()->getDisplayName() . '::' . $methodReflection->getName() . '()'; - $errors = []; - if (!$scope->canCallMethod($methodReflection)) { - $errors[] = sprintf( - 'Call to %s method %s() of class %s.', - $methodReflection->isPrivate() ? 'private' : 'protected', - $methodReflection->getName(), - $methodReflection->getDeclaringClass()->getDisplayName() - ); - } - - $errors = array_merge($errors, $this->check->check( - ParametersAcceptorSelector::selectFromArgs( - $scope, - $node->args, - $methodReflection->getVariants() - ), - $scope, - $node, - [ - 'Method ' . $messagesMethodName . ' invoked with %d parameter, %d required.', - 'Method ' . $messagesMethodName . ' invoked with %d parameters, %d required.', - 'Method ' . $messagesMethodName . ' invoked with %d parameter, at least %d required.', - 'Method ' . $messagesMethodName . ' invoked with %d parameters, at least %d required.', - 'Method ' . $messagesMethodName . ' invoked with %d parameter, %d-%d required.', - 'Method ' . $messagesMethodName . ' invoked with %d parameters, %d-%d required.', - 'Parameter #%d %s of method ' . $messagesMethodName . ' expects %s, %s given.', - 'Result of method ' . $messagesMethodName . ' (void) is used.', - 'Parameter #%d %s of method ' . $messagesMethodName . ' is passed by reference, so it expects variables only.', - ] - )); - - if ( - $this->checkFunctionNameCase - && strtolower($methodReflection->getName()) === strtolower($name) - && $methodReflection->getName() !== $name - ) { - $errors[] = sprintf('Call to method %s with incorrect case: %s', $messagesMethodName, $name); - } - - return $errors; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Methods/CallStaticMethodsRule.php b/vendor/phpstan/phpstan/src/Rules/Methods/CallStaticMethodsRule.php deleted file mode 100644 index d60584a..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Methods/CallStaticMethodsRule.php +++ /dev/null @@ -1,279 +0,0 @@ -broker = $broker; - $this->check = $check; - $this->ruleLevelHelper = $ruleLevelHelper; - $this->classCaseSensitivityCheck = $classCaseSensitivityCheck; - $this->checkFunctionNameCase = $checkFunctionNameCase; - $this->reportMagicMethods = $reportMagicMethods; - } - - public function getNodeType(): string - { - return StaticCall::class; - } - - /** - * @param \PhpParser\Node\Expr\StaticCall $node - * @param \PHPStan\Analyser\Scope $scope - * @return (string|\PHPStan\Rules\RuleError)[] - */ - public function processNode(Node $node, Scope $scope): array - { - if (!$node->name instanceof Node\Identifier) { - return []; - } - $methodName = $node->name->name; - - $class = $node->class; - $errors = []; - $isInterface = false; - if ($class instanceof Name) { - $className = (string) $class; - $lowercasedClassName = strtolower($className); - if (in_array($lowercasedClassName, ['self', 'static'], true)) { - if (!$scope->isInClass()) { - return [ - sprintf( - 'Calling %s::%s() outside of class scope.', - $className, - $methodName - ), - ]; - } - $className = $scope->getClassReflection()->getName(); - } elseif ($lowercasedClassName === 'parent') { - if (!$scope->isInClass()) { - return [ - sprintf( - 'Calling %s::%s() outside of class scope.', - $className, - $methodName - ), - ]; - } - $currentClassReflection = $scope->getClassReflection(); - if ($currentClassReflection->getParentClass() === false) { - return [ - sprintf( - '%s::%s() calls parent::%s() but %s does not extend any class.', - $scope->getClassReflection()->getDisplayName(), - $scope->getFunctionName(), - $methodName, - $scope->getClassReflection()->getDisplayName() - ), - ]; - } - - if ($scope->getFunctionName() === null) { - throw new \PHPStan\ShouldNotHappenException(); - } - - $className = $currentClassReflection->getParentClass()->getName(); - } else { - if (!$this->broker->hasClass($className)) { - return [ - sprintf('Call to static method %s() on an unknown class %s.', $methodName, $className), - ]; - } else { - $errors = $this->classCaseSensitivityCheck->checkClassNames([new ClassNameNodePair($className, $class)]); - } - - $classReflection = $this->broker->getClass($className); - $isInterface = $classReflection->isInterface(); - $className = $classReflection->getName(); - } - - $classType = new ObjectType($className); - } else { - $classTypeResult = $this->ruleLevelHelper->findTypeToCheck( - $scope, - $class, - sprintf('Call to static method %s() on an unknown class %%s.', $methodName), - static function (Type $type) use ($methodName): bool { - return $type->canCallMethods()->yes() && $type->hasMethod($methodName)->yes(); - } - ); - $classType = $classTypeResult->getType(); - if ($classType instanceof ErrorType) { - return $classTypeResult->getUnknownClassErrors(); - } - } - - if ((new StringType())->isSuperTypeOf($classType)->yes()) { - return []; - } - - $typeForDescribe = $classType; - $classType = TypeCombinator::remove($classType, new StringType()); - - if (!$classType->canCallMethods()->yes()) { - return array_merge($errors, [ - sprintf('Cannot call static method %s() on %s.', $methodName, $typeForDescribe->describe(VerbosityLevel::typeOnly())), - ]); - } - - if (!$classType->hasMethod($methodName)->yes()) { - if (!$this->reportMagicMethods) { - $directClassNames = TypeUtils::getDirectClassNames($classType); - foreach ($directClassNames as $className) { - if (!$this->broker->hasClass($className)) { - continue; - } - - $classReflection = $this->broker->getClass($className); - if ($classReflection->hasNativeMethod('__callStatic')) { - return []; - } - } - } - - return array_merge($errors, [ - sprintf( - 'Call to an undefined static method %s::%s().', - $typeForDescribe->describe(VerbosityLevel::typeOnly()), - $methodName - ), - ]); - } - - $method = $classType->getMethod($methodName, $scope); - if (!$method->isStatic()) { - $function = $scope->getFunction(); - if ( - !$function instanceof MethodReflection - || $function->isStatic() - || !$scope->isInClass() - || ( - $classType instanceof TypeWithClassName - && $scope->getClassReflection()->getName() !== $classType->getClassName() - && !$scope->getClassReflection()->isSubclassOf($classType->getClassName()) - ) - ) { - return array_merge($errors, [ - sprintf( - 'Static call to instance method %s::%s().', - $method->getDeclaringClass()->getDisplayName(), - $method->getName() - ), - ]); - } - } - - if (!$scope->canCallMethod($method)) { - $errors = array_merge($errors, [ - sprintf( - 'Call to %s %s %s() of class %s.', - $method->isPrivate() ? 'private' : 'protected', - $method->isStatic() ? 'static method' : 'method', - $method->getName(), - $method->getDeclaringClass()->getDisplayName() - ), - ]); - } - - if ($isInterface && $method->isStatic()) { - return [ - sprintf( - 'Cannot call static method %s() on interface %s.', - $method->getName(), - $classType->describe(VerbosityLevel::typeOnly()) - ), - ]; - } - - $lowercasedMethodName = sprintf( - '%s %s', - $method->isStatic() ? 'static method' : 'method', - $method->getDeclaringClass()->getDisplayName() . '::' . $method->getName() . '()' - ); - $displayMethodName = sprintf( - '%s %s', - $method->isStatic() ? 'Static method' : 'Method', - $method->getDeclaringClass()->getDisplayName() . '::' . $method->getName() . '()' - ); - - $errors = array_merge($errors, $this->check->check( - ParametersAcceptorSelector::selectFromArgs( - $scope, - $node->args, - $method->getVariants() - ), - $scope, - $node, - [ - $displayMethodName . ' invoked with %d parameter, %d required.', - $displayMethodName . ' invoked with %d parameters, %d required.', - $displayMethodName . ' invoked with %d parameter, at least %d required.', - $displayMethodName . ' invoked with %d parameters, at least %d required.', - $displayMethodName . ' invoked with %d parameter, %d-%d required.', - $displayMethodName . ' invoked with %d parameters, %d-%d required.', - 'Parameter #%d %s of ' . $lowercasedMethodName . ' expects %s, %s given.', - 'Result of ' . $lowercasedMethodName . ' (void) is used.', - 'Parameter #%d %s of ' . $lowercasedMethodName . ' is passed by reference, so it expects variables only.', - ] - )); - - if ( - $this->checkFunctionNameCase - && $method->getName() !== $methodName - ) { - $errors[] = sprintf('Call to %s with incorrect case: %s', $lowercasedMethodName, $methodName); - } - - return $errors; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Methods/ExistingClassesInTypehintsRule.php b/vendor/phpstan/phpstan/src/Rules/Methods/ExistingClassesInTypehintsRule.php deleted file mode 100644 index 9cffefc..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Methods/ExistingClassesInTypehintsRule.php +++ /dev/null @@ -1,59 +0,0 @@ -check = $check; - } - - public function getNodeType(): string - { - return InClassMethodNode::class; - } - - /** - * @param \PHPStan\Node\InClassMethodNode $node - * @param \PHPStan\Analyser\Scope $scope - * @return RuleError[] - */ - public function processNode(Node $node, Scope $scope): array - { - $methodReflection = $scope->getFunction(); - if (!$methodReflection instanceof PhpMethodFromParserNodeReflection) { - throw new \PHPStan\ShouldNotHappenException(); - } - if (!$scope->isInClass()) { - throw new \PHPStan\ShouldNotHappenException(); - } - - return $this->check->checkClassMethod( - $methodReflection, - $node->getOriginalNode(), - sprintf( - 'Parameter $%%s of method %s::%s() has invalid typehint type %%s.', - $scope->getClassReflection()->getDisplayName(), - $methodReflection->getName() - ), - sprintf( - 'Return typehint of method %s::%s() has invalid type %%s.', - $scope->getClassReflection()->getDisplayName(), - $methodReflection->getName() - ) - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Methods/IncompatibleDefaultParameterTypeRule.php b/vendor/phpstan/phpstan/src/Rules/Methods/IncompatibleDefaultParameterTypeRule.php deleted file mode 100644 index 1115ec4..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Methods/IncompatibleDefaultParameterTypeRule.php +++ /dev/null @@ -1,70 +0,0 @@ -getFunction(); - if (!$method instanceof PhpMethodFromParserNodeReflection) { - return []; - } - - $parameters = ParametersAcceptorSelector::selectSingle($method->getVariants()); - - $errors = []; - foreach ($node->getOriginalNode()->getParams() as $paramI => $param) { - if ($param->default === null) { - continue; - } - if ( - $param->var instanceof Node\Expr\Error - || !is_string($param->var->name) - ) { - throw new \PHPStan\ShouldNotHappenException(); - } - - $defaultValueType = $scope->getType($param->default); - $parameterType = $parameters->getParameters()[$paramI]->getType(); - - if ($parameterType->isSuperTypeOf($defaultValueType)->yes()) { - continue; - } - - $errors[] = RuleErrorBuilder::message(sprintf( - 'Default value of the parameter #%d $%s (%s) of method %s::%s() is incompatible with type %s.', - $paramI + 1, - $param->var->name, - $defaultValueType->describe(VerbosityLevel::value()), - $method->getDeclaringClass()->getDisplayName(), - $method->getName(), - $parameterType->describe(VerbosityLevel::value()) - ))->line($param->getLine())->build(); - } - - return $errors; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Methods/MethodSignatureRule.php b/vendor/phpstan/phpstan/src/Rules/Methods/MethodSignatureRule.php deleted file mode 100644 index d62acd1..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Methods/MethodSignatureRule.php +++ /dev/null @@ -1,188 +0,0 @@ -reportMaybes = $reportMaybes; - $this->reportStatic = $reportStatic; - } - - public function getNodeType(): string - { - return ClassMethod::class; - } - - /** - * @param \PhpParser\Node\Stmt\ClassMethod $node - * @param \PHPStan\Analyser\Scope $scope - * @return string[] - */ - public function processNode(Node $node, Scope $scope): array - { - $methodName = (string) $node->name; - - if ($methodName === '__construct') { - return []; - } - - $class = $scope->getClassReflection(); - if ($class === null) { - throw new \PHPStan\ShouldNotHappenException(); - } - $method = $class->getNativeMethod($methodName); - if (!$this->reportStatic && $method->isStatic()) { - return []; - } - if ($method->isPrivate()) { - return []; - } - $parameters = ParametersAcceptorSelector::selectSingle($method->getVariants()); - - $errors = []; - foreach ($this->collectParentMethods($methodName, $class, $scope) as $parentMethod) { - $parentParameters = ParametersAcceptorSelector::selectFromTypes(array_map(static function (ParameterReflection $parameter): Type { - return $parameter->getType(); - }, $parameters->getParameters()), $parentMethod->getVariants(), false); - - $returnTypeCompatibility = $this->checkReturnTypeCompatibility($parameters->getReturnType(), $parentParameters->getReturnType()); - if ($returnTypeCompatibility->no() || (!$returnTypeCompatibility->yes() && $this->reportMaybes)) { - $errors[] = sprintf( - 'Return type (%s) of method %s::%s() should be %s with return type (%s) of method %s::%s()', - $parameters->getReturnType()->describe(VerbosityLevel::typeOnly()), - $method->getDeclaringClass()->getDisplayName(), - $method->getName(), - $returnTypeCompatibility->no() ? 'compatible' : 'covariant', - $parentParameters->getReturnType()->describe(VerbosityLevel::typeOnly()), - $parentMethod->getDeclaringClass()->getDisplayName(), - $parentMethod->getName() - ); - } - - $parameterResults = $this->checkParameterTypeCompatibility($parameters->getParameters(), $parentParameters->getParameters()); - foreach ($parameterResults as $parameterIndex => $parameterResult) { - if ($parameterResult->yes()) { - continue; - } - if (!$parameterResult->no() && !$this->reportMaybes) { - continue; - } - $parameter = $parameters->getParameters()[$parameterIndex]; - $parentParameter = $parentParameters->getParameters()[$parameterIndex]; - $errors[] = sprintf( - 'Parameter #%d $%s (%s) of method %s::%s() should be %s with parameter $%s (%s) of method %s::%s()', - $parameterIndex + 1, - $parameter->getName(), - $parameter->getType()->describe(VerbosityLevel::typeOnly()), - $method->getDeclaringClass()->getDisplayName(), - $method->getName(), - $parameterResult->no() ? 'compatible' : 'contravariant', - $parentParameter->getName(), - $parentParameter->getType()->describe(VerbosityLevel::typeOnly()), - $parentMethod->getDeclaringClass()->getDisplayName(), - $parentMethod->getName() - ); - } - } - - return $errors; - } - - /** - * @param string $methodName - * @param \PHPStan\Reflection\ClassReflection $class - * @param \PHPStan\Analyser\Scope $scope - * @return \PHPStan\Reflection\MethodReflection[] - */ - private function collectParentMethods(string $methodName, ClassReflection $class, Scope $scope): array - { - $parentMethods = []; - - $parentClass = $class->getParentClass(); - if ($parentClass !== false && $parentClass->hasMethod($methodName)) { - $parentMethod = $parentClass->getMethod($methodName, $scope); - if (!$parentMethod->isPrivate()) { - $parentMethods[] = $parentMethod; - } - } - - foreach ($class->getInterfaces() as $interface) { - if (!$interface->hasMethod($methodName)) { - continue; - } - - $parentMethods[] = $interface->getMethod($methodName, $scope); - } - - return $parentMethods; - } - - private function checkReturnTypeCompatibility( - Type $returnType, - Type $parentReturnType - ): TrinaryLogic - { - // Allow adding `void` return type hints when the parent defines no return type - if ($returnType instanceof VoidType && $parentReturnType instanceof MixedType) { - return TrinaryLogic::createYes(); - } - - // We can return anything - if ($parentReturnType instanceof VoidType) { - return TrinaryLogic::createYes(); - } - - return $parentReturnType->isSuperTypeOf($returnType); - } - - /** - * @param \PHPStan\Reflection\ParameterReflection[] $parameters - * @param \PHPStan\Reflection\ParameterReflection[] $parentParameters - * @return array - */ - private function checkParameterTypeCompatibility( - array $parameters, - array $parentParameters - ): array - { - $parameterResults = []; - - $numberOfParameters = min(count($parameters), count($parentParameters)); - for ($i = 0; $i < $numberOfParameters; $i++) { - $parameter = $parameters[$i]; - $parentParameter = $parentParameters[$i]; - - $parameterType = $parameter->getType(); - $parentParameterType = $parentParameter->getType(); - - $parameterResults[] = $parameterType->isSuperTypeOf($parentParameterType); - } - - return $parameterResults; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Methods/ReturnTypeRule.php b/vendor/phpstan/phpstan/src/Rules/Methods/ReturnTypeRule.php deleted file mode 100644 index 2c68c20..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Methods/ReturnTypeRule.php +++ /dev/null @@ -1,76 +0,0 @@ -returnTypeCheck = $returnTypeCheck; - } - - public function getNodeType(): string - { - return Return_::class; - } - - /** - * @param \PhpParser\Node\Stmt\Return_ $node - * @param \PHPStan\Analyser\Scope $scope - * @return string[] - */ - public function processNode(Node $node, Scope $scope): array - { - if ($scope->getFunction() === null) { - return []; - } - - if ($scope->isInAnonymousFunction()) { - return []; - } - - $method = $scope->getFunction(); - if (!($method instanceof MethodReflection)) { - return []; - } - - $reflection = null; - if ($method->getDeclaringClass()->getNativeReflection()->hasMethod($method->getName())) { - $reflection = $method->getDeclaringClass()->getNativeReflection()->getMethod($method->getName()); - } - - return $this->returnTypeCheck->checkReturnType( - $scope, - ParametersAcceptorSelector::selectSingle($method->getVariants())->getReturnType(), - $node->expr, - sprintf( - 'Method %s::%s() should return %%s but empty return statement found.', - $method->getDeclaringClass()->getDisplayName(), - $method->getName() - ), - sprintf( - 'Method %s::%s() with return type void returns %%s but should not return anything.', - $method->getDeclaringClass()->getDisplayName(), - $method->getName() - ), - sprintf( - 'Method %s::%s() should return %%s but returns %%s.', - $method->getDeclaringClass()->getDisplayName(), - $method->getName() - ), - $reflection !== null && $reflection->isGenerator() - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Missing/MissingClosureNativeReturnTypehintRule.php b/vendor/phpstan/phpstan/src/Rules/Missing/MissingClosureNativeReturnTypehintRule.php deleted file mode 100644 index d9dad39..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Missing/MissingClosureNativeReturnTypehintRule.php +++ /dev/null @@ -1,141 +0,0 @@ -checkObjectTypehint = $checkObjectTypehint; - } - - public function getNodeType(): string - { - return ClosureReturnStatementsNode::class; - } - - /** - * @param \PHPStan\Node\ClosureReturnStatementsNode $node - * @param \PHPStan\Analyser\Scope $scope - * @return RuleError[] errors - */ - public function processNode(Node $node, Scope $scope): array - { - $closure = $node->getClosureExpr(); - if ($closure->returnType !== null) { - return []; - } - - $messagePattern = 'Anonymous function should have native typehint "%s".'; - $statementResult = $node->getStatementResult(); - if ($statementResult->hasYield()) { - return [ - RuleErrorBuilder::message(sprintf($messagePattern, 'Generator'))->build(), - ]; - } - - $returnStatements = $node->getReturnStatements(); - if (count($returnStatements) === 0) { - return [ - RuleErrorBuilder::message(sprintf($messagePattern, 'void'))->build(), - ]; - } - - $returnTypes = []; - $voidReturnNodes = []; - $hasNull = false; - foreach ($returnStatements as $returnStatement) { - $returnNode = $returnStatement->getReturnNode(); - if ($returnNode->expr === null) { - $voidReturnNodes[] = $returnNode; - $hasNull = true; - continue; - } - - $returnTypes[] = $returnStatement->getScope()->getType($returnNode->expr); - } - - if (count($returnTypes) === 0) { - return [ - RuleErrorBuilder::message(sprintf($messagePattern, 'void'))->build(), - ]; - } - - $messages = []; - foreach ($voidReturnNodes as $voidReturnStatement) { - $messages[] = RuleErrorBuilder::message('Mixing returning values with empty return statements - return null should be used here.') - ->line($voidReturnStatement->getLine()) - ->build(); - } - - $returnType = TypeCombinator::union(...$returnTypes); - if ( - $returnType instanceof MixedType - || $returnType instanceof NeverType - || $returnType instanceof IntersectionType - || $returnType instanceof NullType - ) { - return $messages; - } - - if (TypeCombinator::containsNull($returnType)) { - $hasNull = true; - $returnType = TypeCombinator::removeNull($returnType); - } - - if ( - $returnType instanceof UnionType - || $returnType instanceof ResourceType - ) { - return $messages; - } - - if (!$statementResult->isAlwaysTerminating()) { - $messages[] = RuleErrorBuilder::message('Anonymous function sometimes return something but return statement at the end is missing.')->build(); - return $messages; - } - - $returnType = TypeUtils::generalizeType($returnType); - $description = $returnType->describe(VerbosityLevel::typeOnly()); - if ($returnType instanceof ArrayType) { - $description = 'array'; - } - if ($hasNull) { - $description = '?' . $description; - } - - if ( - !$this->checkObjectTypehint - && $returnType instanceof ObjectWithoutClassType - ) { - return $messages; - } - - $messages[] = RuleErrorBuilder::message(sprintf($messagePattern, $description))->build(); - - return $messages; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Missing/MissingReturnRule.php b/vendor/phpstan/phpstan/src/Rules/Missing/MissingReturnRule.php deleted file mode 100644 index 99bc991..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Missing/MissingReturnRule.php +++ /dev/null @@ -1,96 +0,0 @@ -checkExplicitMixedMissingReturn = $checkExplicitMixedMissingReturn; - $this->checkPhpDocMissingReturn = $checkPhpDocMissingReturn; - } - - public function getNodeType(): string - { - return ExecutionEndNode::class; - } - - /** - * @param ExecutionEndNode $node - * @param Scope $scope - * @return RuleError[] - */ - public function processNode(Node $node, Scope $scope): array - { - $statementResult = $node->getStatementResult(); - if ($statementResult->isAlwaysTerminating()) { - return []; - } - if ($statementResult->hasYield()) { - return []; - } - - if (!$node->hasNativeReturnTypehint() && !$this->checkPhpDocMissingReturn) { - return []; - } - - $anonymousFunctionReturnType = $scope->getAnonymousFunctionReturnType(); - $scopeFunction = $scope->getFunction(); - if ($anonymousFunctionReturnType !== null) { - $returnType = $anonymousFunctionReturnType; - $description = 'Anonymous function'; - } elseif ($scopeFunction !== null) { - $returnType = ParametersAcceptorSelector::selectSingle($scopeFunction->getVariants())->getReturnType(); - if ($scopeFunction instanceof MethodReflection) { - $description = sprintf('Method %s::%s()', $scopeFunction->getDeclaringClass()->getDisplayName(), $scopeFunction->getName()); - } else { - $description = sprintf('Function %s()', $scopeFunction->getName()); - } - } else { - throw new \PHPStan\ShouldNotHappenException(); - } - - if ($returnType instanceof VoidType) { - return []; - } - - if ( - $returnType instanceof MixedType - && ( - !$returnType->isExplicitMixed() - || !$this->checkExplicitMixedMissingReturn - ) - ) { - return []; - } - - return [ - RuleErrorBuilder::message( - sprintf('%s should return %s but return statement is missing.', $description, $returnType->describe(VerbosityLevel::typeOnly())) - )->line($node->getNode()->getStartLine())->build(), - ]; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Namespaces/ExistingNamesInGroupUseRule.php b/vendor/phpstan/phpstan/src/Rules/Namespaces/ExistingNamesInGroupUseRule.php deleted file mode 100644 index 15e5a81..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Namespaces/ExistingNamesInGroupUseRule.php +++ /dev/null @@ -1,129 +0,0 @@ -broker = $broker; - $this->classCaseSensitivityCheck = $classCaseSensitivityCheck; - $this->checkFunctionNameCase = $checkFunctionNameCase; - } - - public function getNodeType(): string - { - return \PhpParser\Node\Stmt\GroupUse::class; - } - - /** - * @param \PhpParser\Node\Stmt\GroupUse $node - * @param \PHPStan\Analyser\Scope $scope - * @return RuleError[] - */ - public function processNode(Node $node, Scope $scope): array - { - $errors = []; - foreach ($node->uses as $use) { - $error = null; - - /** @var Node\Name $name */ - $name = Node\Name::concat($node->prefix, $use->name); - if ( - $node->type === Use_::TYPE_CONSTANT - || $use->type === Use_::TYPE_CONSTANT - ) { - $error = $this->checkConstant($name); - } elseif ( - $node->type === Use_::TYPE_FUNCTION - || $use->type === Use_::TYPE_FUNCTION - ) { - $error = $this->checkFunction($name); - } elseif ($use->type === Use_::TYPE_NORMAL) { - $error = $this->checkClass($name); - } else { - throw new \PHPStan\ShouldNotHappenException(); - } - - if ($error === null) { - continue; - } - - $errors[] = $error; - } - - return $errors; - } - - private function checkConstant(Node\Name $name): ?RuleError - { - if (!$this->broker->hasConstant($name, null)) { - return RuleErrorBuilder::message(sprintf('Used constant %s not found.', (string) $name))->build(); - } - - return null; - } - - private function checkFunction(Node\Name $name): ?RuleError - { - if (!$this->broker->hasFunction($name, null)) { - return RuleErrorBuilder::message(sprintf('Used function %s not found.', (string) $name))->build(); - } - - if ($this->checkFunctionNameCase) { - $functionReflection = $this->broker->getFunction($name, null); - $realName = $functionReflection->getName(); - $usedName = (string) $name; - if ( - strtolower($realName) === strtolower($usedName) - && $realName !== $usedName - ) { - return RuleErrorBuilder::message(sprintf( - 'Function %s used with incorrect case: %s.', - $realName, - $usedName - ))->build(); - } - } - - return null; - } - - private function checkClass(Node\Name $name): ?RuleError - { - $errors = $this->classCaseSensitivityCheck->checkClassNames([ - new ClassNameNodePair((string) $name, $name), - ]); - if (count($errors) === 0) { - return null; - } elseif (count($errors) === 1) { - return $errors[0]; - } - - throw new \PHPStan\ShouldNotHappenException(); - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Namespaces/ExistingNamesInUseRule.php b/vendor/phpstan/phpstan/src/Rules/Namespaces/ExistingNamesInUseRule.php deleted file mode 100644 index a1b8ba2..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Namespaces/ExistingNamesInUseRule.php +++ /dev/null @@ -1,130 +0,0 @@ -broker = $broker; - $this->classCaseSensitivityCheck = $classCaseSensitivityCheck; - $this->checkFunctionNameCase = $checkFunctionNameCase; - } - - public function getNodeType(): string - { - return \PhpParser\Node\Stmt\Use_::class; - } - - /** - * @param \PhpParser\Node\Stmt\Use_ $node - * @param \PHPStan\Analyser\Scope $scope - * @return RuleError[] - */ - public function processNode(Node $node, Scope $scope): array - { - if ($node->type === Node\Stmt\Use_::TYPE_UNKNOWN) { - throw new \PHPStan\ShouldNotHappenException(); - } - - foreach ($node->uses as $use) { - if ($use->type !== Node\Stmt\Use_::TYPE_UNKNOWN) { - throw new \PHPStan\ShouldNotHappenException(); - } - } - - if ($node->type === Node\Stmt\Use_::TYPE_CONSTANT) { - return $this->checkConstants($node->uses); - } - - if ($node->type === Node\Stmt\Use_::TYPE_FUNCTION) { - return $this->checkFunctions($node->uses); - } - - return $this->checkClasses($node->uses); - } - - /** - * @param \PhpParser\Node\Stmt\UseUse[] $uses - * @return RuleError[] - */ - private function checkConstants(array $uses): array - { - $errors = []; - foreach ($uses as $use) { - if ($this->broker->hasConstant($use->name, null)) { - continue; - } - - $errors[] = RuleErrorBuilder::message(sprintf('Used constant %s not found.', (string) $use->name))->line($use->name->getLine())->build(); - } - - return $errors; - } - - /** - * @param \PhpParser\Node\Stmt\UseUse[] $uses - * @return RuleError[] - */ - private function checkFunctions(array $uses): array - { - $errors = []; - foreach ($uses as $use) { - if (!$this->broker->hasFunction($use->name, null)) { - $errors[] = RuleErrorBuilder::message(sprintf('Used function %s not found.', (string) $use->name))->line($use->name->getLine())->build(); - } elseif ($this->checkFunctionNameCase) { - $functionReflection = $this->broker->getFunction($use->name, null); - $realName = $functionReflection->getName(); - $usedName = (string) $use->name; - if ( - strtolower($realName) === strtolower($usedName) - && $realName !== $usedName - ) { - $errors[] = RuleErrorBuilder::message(sprintf( - 'Function %s used with incorrect case: %s.', - $realName, - $usedName - ))->line($use->name->getLine())->build(); - } - } - } - - return $errors; - } - - /** - * @param \PhpParser\Node\Stmt\UseUse[] $uses - * @return RuleError[] - */ - private function checkClasses(array $uses): array - { - return $this->classCaseSensitivityCheck->checkClassNames( - array_map(static function (\PhpParser\Node\Stmt\UseUse $use): ClassNameNodePair { - return new ClassNameNodePair((string) $use->name, $use->name); - }, $uses) - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Operators/InvalidBinaryOperationRule.php b/vendor/phpstan/phpstan/src/Rules/Operators/InvalidBinaryOperationRule.php deleted file mode 100644 index aa3d0a1..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Operators/InvalidBinaryOperationRule.php +++ /dev/null @@ -1,119 +0,0 @@ -printer = $printer; - $this->ruleLevelHelper = $ruleLevelHelper; - } - - public function getNodeType(): string - { - return Node\Expr::class; - } - - /** - * @param \PhpParser\Node\Expr $node - * @param \PHPStan\Analyser\Scope $scope - * @return string[] - */ - public function processNode(\PhpParser\Node $node, Scope $scope): array - { - if ( - !$node instanceof Node\Expr\BinaryOp - && !$node instanceof Node\Expr\AssignOp - ) { - return []; - } - - if ($scope->getType($node) instanceof ErrorType) { - $leftName = '__PHPSTAN__LEFT__'; - $rightName = '__PHPSTAN__RIGHT__'; - $leftVariable = new Node\Expr\Variable($leftName); - $rightVariable = new Node\Expr\Variable($rightName); - if ($node instanceof Node\Expr\AssignOp) { - $newNode = clone $node; - $left = $node->var; - $right = $node->expr; - $newNode->var = $leftVariable; - $newNode->expr = $rightVariable; - } else { - $newNode = clone $node; - $left = $node->left; - $right = $node->right; - $newNode->left = $leftVariable; - $newNode->right = $rightVariable; - } - - if ($node instanceof Node\Expr\AssignOp\Concat || $node instanceof Node\Expr\BinaryOp\Concat) { - $callback = static function (Type $type): bool { - return !$type->toString() instanceof ErrorType; - }; - } else { - $callback = static function (Type $type): bool { - return !$type->toNumber() instanceof ErrorType; - }; - } - - $leftType = $this->ruleLevelHelper->findTypeToCheck( - $scope, - $left, - '', - $callback - )->getType(); - if ($leftType instanceof ErrorType) { - return []; - } - - $rightType = $this->ruleLevelHelper->findTypeToCheck( - $scope, - $right, - '', - $callback - )->getType(); - if ($rightType instanceof ErrorType) { - return []; - } - - $scope = $scope - ->assignVariable($leftName, $leftType) - ->assignVariable($rightName, $rightType); - - if (!$scope->getType($newNode) instanceof ErrorType) { - return []; - } - - return [ - sprintf( - 'Binary operation "%s" between %s and %s results in an error.', - substr(substr($this->printer->prettyPrintExpr($newNode), strlen($leftName) + 2), 0, -(strlen($rightName) + 2)), - $scope->getType($left)->describe(VerbosityLevel::value()), - $scope->getType($right)->describe(VerbosityLevel::value()) - ), - ]; - } - - return []; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Operators/InvalidComparisonOperationRule.php b/vendor/phpstan/phpstan/src/Rules/Operators/InvalidComparisonOperationRule.php deleted file mode 100644 index c64c189..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Operators/InvalidComparisonOperationRule.php +++ /dev/null @@ -1,114 +0,0 @@ -ruleLevelHelper = $ruleLevelHelper; - } - - public function getNodeType(): string - { - return Node\Expr\BinaryOp::class; - } - - /** - * @param Node $node - * @param \PHPStan\Analyser\Scope $scope - * @return string[] - */ - public function processNode(Node $node, Scope $scope): array - { - if ( - !$node instanceof Node\Expr\BinaryOp\Equal - && !$node instanceof Node\Expr\BinaryOp\NotEqual - && !$node instanceof Node\Expr\BinaryOp\Smaller - && !$node instanceof Node\Expr\BinaryOp\SmallerOrEqual - && !$node instanceof Node\Expr\BinaryOp\Greater - && !$node instanceof Node\Expr\BinaryOp\GreaterOrEqual - && !$node instanceof Node\Expr\BinaryOp\Spaceship - ) { - return []; - } - - $isNumericLeft = $this->isNumberType($scope, $node->left); - $isObjectLeft = $this->isObjectType($scope, $node->left); - $isNumericRight = $this->isNumberType($scope, $node->right); - $isObjectRight = $this->isObjectType($scope, $node->right); - - if (($isNumericLeft && $isObjectRight) || ($isObjectLeft && $isNumericRight)) { - return [ - sprintf( - 'Comparison operation "%s" between %s and %s results in an error.', - $node->getOperatorSigil(), - $scope->getType($node->left)->describe(VerbosityLevel::value()), - $scope->getType($node->right)->describe(VerbosityLevel::value()) - ), - ]; - } - - return []; - } - - private function isNumberType(Scope $scope, Node\Expr $expr): bool - { - $acceptedType = new UnionType([new IntegerType(), new FloatType()]); - $onlyNumber = static function (Type $type) use ($acceptedType): bool { - return $acceptedType->accepts($type, true)->yes(); - }; - - $type = $this->ruleLevelHelper->findTypeToCheck($scope, $expr, '', $onlyNumber)->getType(); - - if ( - $type instanceof ErrorType - || !$type->equals($scope->getType($expr)) - ) { - return false; - } - - return !$acceptedType->isSuperTypeOf($type)->no(); - } - - private function isObjectType(Scope $scope, Node\Expr $expr): bool - { - $acceptedType = new ObjectWithoutClassType(); - - $type = $this->ruleLevelHelper->findTypeToCheck( - $scope, - $expr, - '', - static function (Type $type) use ($acceptedType): bool { - return $acceptedType->isSuperTypeOf($type)->yes(); - } - )->getType(); - - if ($type instanceof ErrorType) { - return false; - } - - $isSuperType = $acceptedType->isSuperTypeOf($type); - if ($type instanceof \PHPStan\Type\BenevolentUnionType) { - return !$isSuperType->no(); - } - - return $isSuperType->yes(); - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Operators/InvalidIncDecOperationRule.php b/vendor/phpstan/phpstan/src/Rules/Operators/InvalidIncDecOperationRule.php deleted file mode 100644 index bf41e4d..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Operators/InvalidIncDecOperationRule.php +++ /dev/null @@ -1,77 +0,0 @@ -checkThisOnly = $checkThisOnly; - } - - public function getNodeType(): string - { - return \PhpParser\Node\Expr::class; - } - - /** - * @param \PhpParser\Node\Expr $node - * @param \PHPStan\Analyser\Scope $scope - * @return string[] - */ - public function processNode(\PhpParser\Node $node, \PHPStan\Analyser\Scope $scope): array - { - if ( - !$node instanceof \PhpParser\Node\Expr\PreInc - && !$node instanceof \PhpParser\Node\Expr\PostInc - && !$node instanceof \PhpParser\Node\Expr\PreDec - && !$node instanceof \PhpParser\Node\Expr\PostDec - ) { - return []; - } - - $operatorString = $node instanceof \PhpParser\Node\Expr\PreInc || $node instanceof \PhpParser\Node\Expr\PostInc ? '++' : '--'; - - if ( - !$node->var instanceof \PhpParser\Node\Expr\Variable - && !$node->var instanceof \PhpParser\Node\Expr\ArrayDimFetch - && !$node->var instanceof \PhpParser\Node\Expr\PropertyFetch - && !$node->var instanceof \PhpParser\Node\Expr\StaticPropertyFetch - ) { - return [ - sprintf( - 'Cannot use %s on a non-variable.', - $operatorString - ), - ]; - } - - if (!$this->checkThisOnly) { - $varType = $scope->getType($node->var); - if (!$varType->toString() instanceof ErrorType) { - return []; - } - if (!$varType->toNumber() instanceof ErrorType) { - return []; - } - - return [ - sprintf( - 'Cannot use %s on %s.', - $operatorString, - $varType->describe(VerbosityLevel::value()) - ), - ]; - } - - return []; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Operators/InvalidUnaryOperationRule.php b/vendor/phpstan/phpstan/src/Rules/Operators/InvalidUnaryOperationRule.php deleted file mode 100644 index 09a5820..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Operators/InvalidUnaryOperationRule.php +++ /dev/null @@ -1,44 +0,0 @@ -getType($node) instanceof ErrorType) { - return [ - sprintf( - 'Unary operation "%s" on %s results in an error.', - $node instanceof \PhpParser\Node\Expr\UnaryPlus ? '+' : '-', - $scope->getType($node->expr)->describe(VerbosityLevel::value()) - ), - ]; - } - - return []; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/PhpDoc/IncompatiblePhpDocTypeRule.php b/vendor/phpstan/phpstan/src/Rules/PhpDoc/IncompatiblePhpDocTypeRule.php deleted file mode 100644 index 28b44c5..0000000 --- a/vendor/phpstan/phpstan/src/Rules/PhpDoc/IncompatiblePhpDocTypeRule.php +++ /dev/null @@ -1,161 +0,0 @@ -fileTypeMapper = $fileTypeMapper; - } - - public function getNodeType(): string - { - return \PhpParser\Node\FunctionLike::class; - } - - /** - * @param \PhpParser\Node\FunctionLike $node - * @param \PHPStan\Analyser\Scope $scope - * @return string[] - */ - public function processNode(Node $node, Scope $scope): array - { - $docComment = $node->getDocComment(); - if ($docComment === null) { - return []; - } - - $resolvedPhpDoc = $this->fileTypeMapper->getResolvedPhpDoc( - $scope->getFile(), - $scope->isInClass() ? $scope->getClassReflection()->getName() : null, - $scope->isInTrait() ? $scope->getTraitReflection()->getName() : null, - $docComment->getText() - ); - $nativeParameterTypes = $this->getNativeParameterTypes($node, $scope); - $nativeReturnType = $this->getNativeReturnType($node, $scope); - - $errors = []; - - foreach ($resolvedPhpDoc->getParamTags() as $parameterName => $phpDocParamTag) { - $phpDocParamType = $phpDocParamTag->getType(); - if (!isset($nativeParameterTypes[$parameterName])) { - $errors[] = sprintf( - 'PHPDoc tag @param references unknown parameter: $%s', - $parameterName - ); - - } elseif ( - $phpDocParamType instanceof ErrorType - || ($phpDocParamType instanceof NeverType && !$phpDocParamType->isExplicit()) - ) { - $errors[] = sprintf( - 'PHPDoc tag @param for parameter $%s contains unresolvable type.', - $parameterName - ); - - } else { - $nativeParamType = $nativeParameterTypes[$parameterName]; - $isParamSuperType = $nativeParamType->isSuperTypeOf($phpDocParamType); - - if ( - $phpDocParamTag->isVariadic() - && $nativeParamType instanceof ArrayType - && $nativeParamType->getItemType() instanceof ArrayType - ) { - continue; - } - - if ($isParamSuperType->no()) { - $errors[] = sprintf( - 'PHPDoc tag @param for parameter $%s with type %s is incompatible with native type %s.', - $parameterName, - $phpDocParamType->describe(VerbosityLevel::typeOnly()), - $nativeParamType->describe(VerbosityLevel::typeOnly()) - ); - - } elseif ($isParamSuperType->maybe()) { - $errors[] = sprintf( - 'PHPDoc tag @param for parameter $%s with type %s is not subtype of native type %s.', - $parameterName, - $phpDocParamType->describe(VerbosityLevel::typeOnly()), - $nativeParamType->describe(VerbosityLevel::typeOnly()) - ); - } - } - } - - if ($resolvedPhpDoc->getReturnTag() !== null) { - $phpDocReturnType = $resolvedPhpDoc->getReturnTag()->getType(); - - if ( - $phpDocReturnType instanceof ErrorType - || ($phpDocReturnType instanceof NeverType && !$phpDocReturnType->isExplicit()) - ) { - $errors[] = 'PHPDoc tag @return contains unresolvable type.'; - - } else { - $isReturnSuperType = $nativeReturnType->isSuperTypeOf($phpDocReturnType); - if ($isReturnSuperType->no()) { - $errors[] = sprintf( - 'PHPDoc tag @return with type %s is incompatible with native type %s.', - $phpDocReturnType->describe(VerbosityLevel::typeOnly()), - $nativeReturnType->describe(VerbosityLevel::typeOnly()) - ); - - } elseif ($isReturnSuperType->maybe()) { - $errors[] = sprintf( - 'PHPDoc tag @return with type %s is not subtype of native type %s.', - $phpDocReturnType->describe(VerbosityLevel::typeOnly()), - $nativeReturnType->describe(VerbosityLevel::typeOnly()) - ); - } - } - } - - return $errors; - } - - /** - * @param Node\FunctionLike $node - * @param Scope $scope - * @return Type[] - */ - private function getNativeParameterTypes(\PhpParser\Node\FunctionLike $node, Scope $scope): array - { - $nativeParameterTypes = []; - foreach ($node->getParams() as $parameter) { - $isNullable = $scope->isParameterValueNullable($parameter); - if (!$parameter->var instanceof Variable || !is_string($parameter->var->name)) { - throw new \PHPStan\ShouldNotHappenException(); - } - $nativeParameterTypes[$parameter->var->name] = $scope->getFunctionType( - $parameter->type, - $isNullable, - $parameter->variadic - ); - } - - return $nativeParameterTypes; - } - - private function getNativeReturnType(\PhpParser\Node\FunctionLike $node, Scope $scope): Type - { - return $scope->getFunctionType($node->getReturnType(), false, false); - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/PhpDoc/IncompatiblePropertyPhpDocTypeRule.php b/vendor/phpstan/phpstan/src/Rules/PhpDoc/IncompatiblePropertyPhpDocTypeRule.php deleted file mode 100644 index 954a1c4..0000000 --- a/vendor/phpstan/phpstan/src/Rules/PhpDoc/IncompatiblePropertyPhpDocTypeRule.php +++ /dev/null @@ -1,76 +0,0 @@ -isInClass()) { - throw new \PHPStan\ShouldNotHappenException(); - } - - $propertyName = $node->name->toString(); - $propertyReflection = $scope->getClassReflection()->getNativeProperty($propertyName); - - if (!$propertyReflection->hasPhpDoc()) { - return []; - } - - $phpDocType = $propertyReflection->getPhpDocType(); - - $messages = []; - if ( - $phpDocType instanceof ErrorType - || ($phpDocType instanceof NeverType && !$phpDocType->isExplicit()) - ) { - $messages[] = sprintf( - 'PHPDoc tag @var for property %s::$%s contains unresolvable type.', - $propertyReflection->getDeclaringClass()->getName(), - $propertyName - ); - } - - $nativeType = $propertyReflection->getNativeType(); - $isSuperType = $nativeType->isSuperTypeOf($phpDocType); - if ($isSuperType->no()) { - $messages[] = sprintf( - 'PHPDoc tag @var for property %s::$%s with type %s is incompatible with native type %s.', - $propertyReflection->getDeclaringClass()->getDisplayName(), - $propertyName, - $phpDocType->describe(VerbosityLevel::typeOnly()), - $nativeType->describe(VerbosityLevel::typeOnly()) - ); - - } elseif ($isSuperType->maybe()) { - $messages[] = sprintf( - 'PHPDoc tag @var for property %s::$%s with type %s is not subtype of native type %s.', - $propertyReflection->getDeclaringClass()->getDisplayName(), - $propertyName, - $phpDocType->describe(VerbosityLevel::typeOnly()), - $nativeType->describe(VerbosityLevel::typeOnly()) - ); - } - - return $messages; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/PhpDoc/InvalidPhpDocTagValueRule.php b/vendor/phpstan/phpstan/src/Rules/PhpDoc/InvalidPhpDocTagValueRule.php deleted file mode 100644 index 5d64582..0000000 --- a/vendor/phpstan/phpstan/src/Rules/PhpDoc/InvalidPhpDocTagValueRule.php +++ /dev/null @@ -1,76 +0,0 @@ -phpDocLexer = $phpDocLexer; - $this->phpDocParser = $phpDocParser; - } - - public function getNodeType(): string - { - return \PhpParser\Node::class; - } - - /** - * @param \PhpParser\Node $node - * @param \PHPStan\Analyser\Scope $scope - * @return string[] - */ - public function processNode(Node $node, Scope $scope): array - { - if ( - !$node instanceof Node\Stmt\ClassLike - && !$node instanceof Node\FunctionLike - && !$node instanceof Node\Stmt\Foreach_ - && !$node instanceof Node\Stmt\Property - && !$node instanceof Node\Expr\Assign - && !$node instanceof Node\Expr\AssignRef - ) { - return []; - } - - $docComment = $node->getDocComment(); - if ($docComment === null) { - return []; - } - - $phpDocString = $docComment->getText(); - $tokens = new TokenIterator($this->phpDocLexer->tokenize($phpDocString)); - $phpDocNode = $this->phpDocParser->parse($tokens); - - $errors = []; - foreach ($phpDocNode->getTags() as $phpDocTag) { - if (!($phpDocTag->value instanceof InvalidTagValueNode)) { - continue; - } - - $errors[] = sprintf( - 'PHPDoc tag %s has invalid value (%s): %s', - $phpDocTag->name, - $phpDocTag->value->value, - $phpDocTag->value->exception->getMessage() - ); - } - - return $errors; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/PhpDoc/InvalidPhpDocVarTagTypeRule.php b/vendor/phpstan/phpstan/src/Rules/PhpDoc/InvalidPhpDocVarTagTypeRule.php deleted file mode 100644 index 16c7451..0000000 --- a/vendor/phpstan/phpstan/src/Rules/PhpDoc/InvalidPhpDocVarTagTypeRule.php +++ /dev/null @@ -1,126 +0,0 @@ -fileTypeMapper = $fileTypeMapper; - $this->broker = $broker; - $this->classCaseSensitivityCheck = $classCaseSensitivityCheck; - $this->checkClassCaseSensitivity = $checkClassCaseSensitivity; - } - - public function getNodeType(): string - { - return \PhpParser\Node::class; - } - - /** - * @param \PhpParser\Node $node - * @param \PHPStan\Analyser\Scope $scope - * @return \PHPStan\Rules\RuleError[] - */ - public function processNode(Node $node, Scope $scope): array - { - if ( - !$node instanceof Node\Stmt\Foreach_ - && !$node instanceof Node\Expr\Assign - && !$node instanceof Node\Expr\AssignRef - && !$node instanceof Node\Stmt\Static_ - ) { - return []; - } - - $docComment = $node->getDocComment(); - if ($docComment === null) { - return []; - } - - $resolvedPhpDoc = $this->fileTypeMapper->getResolvedPhpDoc( - $scope->getFile(), - $scope->isInClass() ? $scope->getClassReflection()->getName() : null, - $scope->isInTrait() ? $scope->getTraitReflection()->getName() : null, - $docComment->getText() - ); - - $errors = []; - foreach ($resolvedPhpDoc->getVarTags() as $name => $varTag) { - $varTagType = $varTag->getType(); - $identifier = 'PHPDoc tag @var'; - if (is_string($name)) { - $identifier .= sprintf(' for variable $%s', $name); - } - if ( - $varTagType instanceof ErrorType - || ($varTagType instanceof NeverType && !$varTagType->isExplicit()) - ) { - $errors[] = RuleErrorBuilder::message(sprintf('%s contains unresolvable type.', $identifier))->line($docComment->getLine())->build(); - continue; - } - - $referencedClasses = $varTagType->getReferencedClasses(); - foreach ($referencedClasses as $referencedClass) { - if ($this->broker->hasClass($referencedClass)) { - if ($this->broker->getClass($referencedClass)->isTrait()) { - $errors[] = RuleErrorBuilder::message(sprintf( - sprintf('%s has invalid type %%s.', $identifier), - $referencedClass - ))->build(); - } - continue; - } - - $errors[] = RuleErrorBuilder::message(sprintf( - sprintf('%s contains unknown class %%s.', $identifier), - $referencedClass - ))->build(); - } - - if (!$this->checkClassCaseSensitivity) { - continue; - } - - $errors = array_merge( - $errors, - $this->classCaseSensitivityCheck->checkClassNames(array_map(static function (string $class) use ($node): ClassNameNodePair { - return new ClassNameNodePair($class, $node); - }, $referencedClasses)) - ); - } - - return $errors; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/PhpDoc/InvalidThrowsPhpDocValueRule.php b/vendor/phpstan/phpstan/src/Rules/PhpDoc/InvalidThrowsPhpDocValueRule.php deleted file mode 100644 index ffdad0f..0000000 --- a/vendor/phpstan/phpstan/src/Rules/PhpDoc/InvalidThrowsPhpDocValueRule.php +++ /dev/null @@ -1,67 +0,0 @@ -fileTypeMapper = $fileTypeMapper; - } - - public function getNodeType(): string - { - return \PhpParser\Node\FunctionLike::class; - } - - /** - * @param \PhpParser\Node\FunctionLike $node - * @param \PHPStan\Analyser\Scope $scope - * @return string[] - */ - public function processNode(Node $node, Scope $scope): array - { - $docComment = $node->getDocComment(); - if ($docComment === null) { - return []; - } - - $resolvedPhpDoc = $this->fileTypeMapper->getResolvedPhpDoc( - $scope->getFile(), - $scope->isInClass() ? $scope->getClassReflection()->getName() : null, - $scope->isInTrait() ? $scope->getTraitReflection()->getName() : null, - $docComment->getText() - ); - - if ($resolvedPhpDoc->getThrowsTag() === null) { - return []; - } - - $phpDocThrowsType = $resolvedPhpDoc->getThrowsTag()->getType(); - if ((new VoidType())->isSuperTypeOf($phpDocThrowsType)->yes()) { - return []; - } - - $isThrowsSuperType = (new ObjectType(\Throwable::class))->isSuperTypeOf($phpDocThrowsType); - if ($isThrowsSuperType->yes()) { - return []; - } - - return [sprintf( - 'PHPDoc tag @throws with type %s is not subtype of Throwable', - $phpDocThrowsType->describe(VerbosityLevel::typeOnly()) - )]; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/PhpDoc/WrongVariableNameInVarTagRule.php b/vendor/phpstan/phpstan/src/Rules/PhpDoc/WrongVariableNameInVarTagRule.php deleted file mode 100644 index 15b1954..0000000 --- a/vendor/phpstan/phpstan/src/Rules/PhpDoc/WrongVariableNameInVarTagRule.php +++ /dev/null @@ -1,283 +0,0 @@ -fileTypeMapper = $fileTypeMapper; - } - - public function getNodeType(): string - { - return \PhpParser\Node::class; - } - - /** - * @param \PhpParser\Node $node - * @param \PHPStan\Analyser\Scope $scope - * @return \PHPStan\Rules\RuleError[] - */ - public function processNode(Node $node, Scope $scope): array - { - if ( - !$node instanceof Node\Stmt\Foreach_ - && !$node instanceof Node\Expr\Assign - && !$node instanceof Node\Expr\AssignRef - && !$node instanceof Node\Stmt\Static_ - && !$node instanceof Node\Stmt\Echo_ - && !$node instanceof Node\Stmt\Return_ - && !$node instanceof Node\Stmt\Expression - && !$node instanceof Node\Stmt\Throw_ - && !$node instanceof Node\Stmt\If_ - && !$node instanceof Node\Stmt\While_ - && !$node instanceof Node\Stmt\Switch_ - && !$node instanceof Node\Stmt\Nop - ) { - return []; - } - - $docComment = $node->getDocComment(); - if ($docComment === null) { - return []; - } - - $resolvedPhpDoc = $this->fileTypeMapper->getResolvedPhpDoc( - $scope->getFile(), - $scope->isInClass() ? $scope->getClassReflection()->getName() : null, - $scope->isInTrait() ? $scope->getTraitReflection()->getName() : null, - $docComment->getText() - ); - $varTags = $resolvedPhpDoc->getVarTags(); - if (count($varTags) === 0) { - return []; - } - if ($node instanceof Node\Expr\Assign || $node instanceof Node\Expr\AssignRef) { - return $this->processAssign($scope, $node->var, $varTags); - } - - if ($node instanceof Node\Stmt\Foreach_) { - return $this->processForeach($node->keyVar, $node->valueVar, $varTags); - } - - if ($node instanceof Node\Stmt\Static_) { - return $this->processStatic($node->vars, $varTags); - } - - if ($node instanceof Node\Stmt\Expression) { - return $this->processExpression($scope, $node->expr, $varTags); - } - - return $this->processStmt($scope, $varTags); - } - - /** - * @param \PHPStan\Analyser\Scope $scope - * @param \PhpParser\Node\Expr $var - * @param \PHPStan\PhpDoc\Tag\VarTag[] $varTags - * @return \PHPStan\Rules\RuleError[] - */ - private function processAssign(Scope $scope, Node\Expr $var, array $varTags): array - { - if ($var instanceof Node\Expr\Variable && is_string($var->name)) { - if (count($varTags) === 1) { - $key = key($varTags); - if (is_int($key)) { - return []; - } - - if ($key !== $var->name) { - if (!$scope->hasVariableType($key)->no()) { - return []; - } - - return [ - RuleErrorBuilder::message(sprintf( - 'Variable $%s in PHPDoc tag @var does not match assigned variable $%s.', - $key, - $var->name - ))->build(), - ]; - } - - return []; - } - - return [ - RuleErrorBuilder::message('Multiple PHPDoc @var tags above single variable assignment are not supported.')->build(), - ]; - } - - return []; - } - - /** - * @param \PhpParser\Node\Expr|null $keyVar - * @param \PhpParser\Node\Expr $valueVar - * @param \PHPStan\PhpDoc\Tag\VarTag[] $varTags - * @return \PHPStan\Rules\RuleError[] - */ - private function processForeach(?Node\Expr $keyVar, Node\Expr $valueVar, array $varTags): array - { - $variableNames = []; - if ($keyVar instanceof Node\Expr\Variable && is_string($keyVar->name)) { - $variableNames[$keyVar->name] = true; - } - if ($valueVar instanceof Node\Expr\Variable && is_string($valueVar->name)) { - $variableNames[$valueVar->name] = true; - } - if ($valueVar instanceof Node\Expr\Array_ || $valueVar instanceof Node\Expr\List_) { - $variableNames = $this->getVariablesFromList($variableNames, $valueVar->items); - } - - $errors = []; - foreach (array_keys($varTags) as $name) { - if (is_int($name)) { - $errors[] = RuleErrorBuilder::message( - 'PHPDoc tag @var above foreach loop does not specify variable name.' - )->build(); - continue; - } - - if (isset($variableNames[$name])) { - continue; - } - - $errors[] = RuleErrorBuilder::message(sprintf( - 'Variable $%s in PHPDoc tag @var does not match any variable in the foreach loop: %s', - $name, - implode(', ', array_map(static function (string $name): string { - return sprintf('$%s', $name); - }, array_keys($variableNames))) - ))->build(); - } - - return $errors; - } - - /** - * @param array $variableNames - * @param (\PhpParser\Node\Expr\ArrayItem|null)[] $items - * @return array - */ - private function getVariablesFromList(array $variableNames, array $items): array - { - foreach ($items as $item) { - if ($item === null) { - continue; - } - - $value = $item->value; - - if ($value instanceof Node\Expr\Variable && is_string($value->name)) { - $variableNames[$value->name] = true; - continue; - } - - if (!($value instanceof Node\Expr\Array_) && !($value instanceof Node\Expr\List_)) { - continue; - } - - $variableNames = $this->getVariablesFromList($variableNames, $value->items); - } - - return $variableNames; - } - - /** - * @param \PhpParser\Node\Stmt\StaticVar[] $vars - * @param \PHPStan\PhpDoc\Tag\VarTag[] $varTags - * @return \PHPStan\Rules\RuleError[] - */ - private function processStatic(array $vars, array $varTags): array - { - $variableNames = []; - foreach ($vars as $var) { - if (!is_string($var->var->name)) { - continue; - } - - $variableNames[$var->var->name] = true; - } - - $errors = []; - foreach (array_keys($varTags) as $name) { - if (is_int($name)) { - if (count($vars) === 1) { - continue; - } - - $errors[] = RuleErrorBuilder::message( - 'PHPDoc tag @var above multiple static variables does not specify variable name.' - )->build(); - continue; - } - - if (isset($variableNames[$name])) { - continue; - } - - $errors[] = RuleErrorBuilder::message(sprintf( - 'Variable $%s in PHPDoc tag @var does not match any static variable: %s', - $name, - implode(', ', array_map(static function (string $name): string { - return sprintf('$%s', $name); - }, array_keys($variableNames))) - ))->build(); - } - - return $errors; - } - - /** - * @param \PHPStan\Analyser\Scope $scope - * @param \PhpParser\Node\Expr $expr - * @param \PHPStan\PhpDoc\Tag\VarTag[] $varTags - * @return \PHPStan\Rules\RuleError[] - */ - private function processExpression(Scope $scope, Expr $expr, array $varTags): array - { - if ($expr instanceof Node\Expr\Assign || $expr instanceof Node\Expr\AssignRef) { - return []; - } - - return $this->processStmt($scope, $varTags); - } - - /** - * @param \PHPStan\Analyser\Scope $scope - * @param \PHPStan\PhpDoc\Tag\VarTag[] $varTags - * @return \PHPStan\Rules\RuleError[] - */ - private function processStmt(Scope $scope, array $varTags): array - { - $errors = []; - foreach (array_keys($varTags) as $name) { - if (is_int($name)) { - $errors[] = RuleErrorBuilder::message('PHPDoc tag @var does not specify variable name.')->build(); - continue; - } - - if (!$scope->hasVariableType($name)->no()) { - continue; - } - - $errors[] = RuleErrorBuilder::message(sprintf('Variable $%s in PHPDoc tag @var does not exist.', $name))->build(); - } - - return $errors; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Properties/AccessPropertiesInAssignRule.php b/vendor/phpstan/phpstan/src/Rules/Properties/AccessPropertiesInAssignRule.php deleted file mode 100644 index 4641ed1..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Properties/AccessPropertiesInAssignRule.php +++ /dev/null @@ -1,39 +0,0 @@ -accessPropertiesRule = $accessPropertiesRule; - } - - public function getNodeType(): string - { - return Node\Expr\Assign::class; - } - - /** - * @param \PhpParser\Node\Expr\Assign $node - * @param \PHPStan\Analyser\Scope $scope - * @return (string|\PHPStan\Rules\RuleError)[] - */ - public function processNode(Node $node, Scope $scope): array - { - if (!$node->var instanceof Node\Expr\PropertyFetch) { - return []; - } - - return $this->accessPropertiesRule->processNode($node->var, $scope); - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Properties/AccessPropertiesRule.php b/vendor/phpstan/phpstan/src/Rules/Properties/AccessPropertiesRule.php deleted file mode 100644 index a8ff004..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Properties/AccessPropertiesRule.php +++ /dev/null @@ -1,141 +0,0 @@ -broker = $broker; - $this->ruleLevelHelper = $ruleLevelHelper; - $this->reportMagicProperties = $reportMagicProperties; - } - - public function getNodeType(): string - { - return PropertyFetch::class; - } - - /** - * @param \PhpParser\Node\Expr\PropertyFetch $node - * @param \PHPStan\Analyser\Scope $scope - * @return (string|\PHPStan\Rules\RuleError)[] - */ - public function processNode(\PhpParser\Node $node, Scope $scope): array - { - if (!$node->name instanceof \PhpParser\Node\Identifier) { - return []; - } - - $name = $node->name->name; - $typeResult = $this->ruleLevelHelper->findTypeToCheck( - $scope, - $node->var, - sprintf('Access to property $%s on an unknown class %%s.', $name), - static function (Type $type) use ($name): bool { - return $type->canAccessProperties()->yes() && $type->hasProperty($name)->yes(); - } - ); - $type = $typeResult->getType(); - if ($type instanceof ErrorType) { - return $typeResult->getUnknownClassErrors(); - } - - if ($scope->isInExpressionAssign($node)) { - return []; - } - - if (!$type->canAccessProperties()->yes()) { - return [ - sprintf('Cannot access property $%s on %s.', $name, $type->describe(VerbosityLevel::typeOnly())), - ]; - } - - if (!$type->hasProperty($name)->yes()) { - if ($scope->isSpecified($node)) { - return []; - } - - $classNames = $typeResult->getReferencedClasses(); - if (!$this->reportMagicProperties) { - foreach ($classNames as $className) { - if (!$this->broker->hasClass($className)) { - continue; - } - - $classReflection = $this->broker->getClass($className); - if ( - $classReflection->hasNativeMethod('__get') - || $classReflection->hasNativeMethod('__set') - ) { - return []; - } - } - } - - if (count($classNames) === 1) { - $referencedClass = $typeResult->getReferencedClasses()[0]; - $propertyClassReflection = $this->broker->getClass($referencedClass); - $parentClassReflection = $propertyClassReflection->getParentClass(); - while ($parentClassReflection !== false) { - if ($parentClassReflection->hasProperty($name)) { - return [ - sprintf( - 'Access to private property $%s of parent class %s.', - $name, - $parentClassReflection->getDisplayName() - ), - ]; - } - - $parentClassReflection = $parentClassReflection->getParentClass(); - } - } - - return [ - sprintf( - 'Access to an undefined property %s::$%s.', - $type->describe(VerbosityLevel::typeOnly()), - $name - ), - ]; - } - - $propertyReflection = $type->getProperty($name, $scope); - if (!$scope->canAccessProperty($propertyReflection)) { - return [ - sprintf( - 'Access to %s property %s::$%s.', - $propertyReflection->isPrivate() ? 'private' : 'protected', - $type->describe(VerbosityLevel::typeOnly()), - $name - ), - ]; - } - - return []; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Properties/AccessStaticPropertiesInAssignRule.php b/vendor/phpstan/phpstan/src/Rules/Properties/AccessStaticPropertiesInAssignRule.php deleted file mode 100644 index b54e6e5..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Properties/AccessStaticPropertiesInAssignRule.php +++ /dev/null @@ -1,39 +0,0 @@ -accessStaticPropertiesRule = $accessStaticPropertiesRule; - } - - public function getNodeType(): string - { - return Node\Expr\Assign::class; - } - - /** - * @param \PhpParser\Node\Expr\Assign $node - * @param \PHPStan\Analyser\Scope $scope - * @return (string|\PHPStan\Rules\RuleError)[] - */ - public function processNode(Node $node, Scope $scope): array - { - if (!$node->var instanceof Node\Expr\StaticPropertyFetch) { - return []; - } - - return $this->accessStaticPropertiesRule->processNode($node->var, $scope); - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Properties/AccessStaticPropertiesRule.php b/vendor/phpstan/phpstan/src/Rules/Properties/AccessStaticPropertiesRule.php deleted file mode 100644 index 1b47e62..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Properties/AccessStaticPropertiesRule.php +++ /dev/null @@ -1,203 +0,0 @@ -broker = $broker; - $this->ruleLevelHelper = $ruleLevelHelper; - $this->classCaseSensitivityCheck = $classCaseSensitivityCheck; - } - - public function getNodeType(): string - { - return StaticPropertyFetch::class; - } - - /** - * @param \PhpParser\Node\Expr\StaticPropertyFetch $node - * @param \PHPStan\Analyser\Scope $scope - * @return (string|\PHPStan\Rules\RuleError)[] - */ - public function processNode(Node $node, Scope $scope): array - { - if (!$node->name instanceof Node\VarLikeIdentifier) { - return []; - } - - $name = $node->name->name; - $messages = []; - if ($node->class instanceof Name) { - $class = (string) $node->class; - $lowercasedClass = strtolower($class); - if (in_array($lowercasedClass, ['self', 'static'], true)) { - if (!$scope->isInClass()) { - return [ - sprintf( - 'Accessing %s::$%s outside of class scope.', - $class, - $name - ), - ]; - } - $className = $scope->getClassReflection()->getName(); - } elseif ($lowercasedClass === 'parent') { - if (!$scope->isInClass()) { - return [ - sprintf( - 'Accessing %s::$%s outside of class scope.', - $class, - $name - ), - ]; - } - if ($scope->getClassReflection()->getParentClass() === false) { - return [ - sprintf( - '%s::%s() accesses parent::$%s but %s does not extend any class.', - $scope->getClassReflection()->getDisplayName(), - $scope->getFunctionName(), - $name, - $scope->getClassReflection()->getDisplayName() - ), - ]; - } - - if ($scope->getFunctionName() === null) { - throw new \PHPStan\ShouldNotHappenException(); - } - - $currentMethodReflection = $scope->getClassReflection()->getNativeMethod($scope->getFunctionName()); - if (!$currentMethodReflection->isStatic()) { - // calling parent::method() from instance method - return []; - } - - $className = $scope->getClassReflection()->getParentClass()->getName(); - } else { - if (!$this->broker->hasClass($class)) { - return [ - sprintf( - 'Access to static property $%s on an unknown class %s.', - $name, - $class - ), - ]; - } else { - $messages = $this->classCaseSensitivityCheck->checkClassNames([new ClassNameNodePair($class, $node->class)]); - } - $className = $this->broker->getClass($class)->getName(); - } - - $classType = new ObjectType($className); - } else { - $classTypeResult = $this->ruleLevelHelper->findTypeToCheck( - $scope, - $node->class, - sprintf('Access to static property $%s on an unknown class %%s.', $name), - static function (Type $type) use ($name): bool { - return $type->canAccessProperties()->yes() && $type->hasProperty($name)->yes(); - } - ); - $classType = $classTypeResult->getType(); - if ($classType instanceof ErrorType) { - return $classTypeResult->getUnknownClassErrors(); - } - } - - if ((new StringType())->isSuperTypeOf($classType)->yes()) { - return []; - } - - $typeForDescribe = $classType; - $classType = TypeCombinator::remove($classType, new StringType()); - - if ($scope->isInExpressionAssign($node)) { - return []; - } - - if (!$classType->canAccessProperties()->yes()) { - return array_merge($messages, [ - sprintf('Cannot access static property $%s on %s.', $name, $typeForDescribe->describe(VerbosityLevel::typeOnly())), - ]); - } - - if (!$classType->hasProperty($name)->yes()) { - if ($scope->isSpecified($node)) { - return $messages; - } - - return array_merge($messages, [ - sprintf( - 'Access to an undefined static property %s::$%s.', - $typeForDescribe->describe(VerbosityLevel::typeOnly()), - $name - ), - ]); - } - - $property = $classType->getProperty($name, $scope); - if (!$property->isStatic()) { - $hasPropertyTypes = TypeUtils::getHasPropertyTypes($classType); - foreach ($hasPropertyTypes as $hasPropertyType) { - if ($hasPropertyType->getPropertyName() === $name) { - return []; - } - } - - return array_merge($messages, [ - sprintf( - 'Static access to instance property %s::$%s.', - $property->getDeclaringClass()->getDisplayName(), - $name - ), - ]); - } - - if (!$scope->canAccessProperty($property)) { - return array_merge($messages, [ - sprintf( - 'Access to %s property $%s of class %s.', - $property->isPrivate() ? 'private' : 'protected', - $name, - $property->getDeclaringClass()->getDisplayName() - ), - ]); - } - - return $messages; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Properties/DefaultValueTypesAssignedToPropertiesRule.php b/vendor/phpstan/phpstan/src/Rules/Properties/DefaultValueTypesAssignedToPropertiesRule.php deleted file mode 100644 index 76d709b..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Properties/DefaultValueTypesAssignedToPropertiesRule.php +++ /dev/null @@ -1,70 +0,0 @@ -ruleLevelHelper = $ruleLevelHelper; - } - - public function getNodeType(): string - { - return Property::class; - } - - /** - * @param \PhpParser\Node\Stmt\Property $node - * @param \PHPStan\Analyser\Scope $scope - * @return string[] - */ - public function processNode(Node $node, Scope $scope): array - { - if (!$scope->isInClass()) { - throw new \PHPStan\ShouldNotHappenException(); - } - - $classReflection = $scope->getClassReflection(); - - $errors = []; - foreach ($node->props as $property) { - if ($property->default === null) { - continue; - } - - if ($property->default instanceof Node\Expr\ConstFetch && (string) $property->default->name === 'null') { - continue; - } - - $propertyReflection = $classReflection->getNativeProperty($property->name->name); - $propertyType = $propertyReflection->getType(); - $defaultValueType = $scope->getType($property->default); - if ($this->ruleLevelHelper->accepts($propertyType, $defaultValueType, $scope->isDeclareStrictTypes())) { - continue; - } - - $errors[] = sprintf( - '%s %s::$%s (%s) does not accept default value of type %s.', - $node->isStatic() ? 'Static property' : 'Property', - $classReflection->getDisplayName(), - $property->name->name, - $propertyType->describe(VerbosityLevel::typeOnly()), - $defaultValueType->describe(VerbosityLevel::typeOnly()) - ); - } - - return $errors; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Properties/ExistingClassesInPropertiesRule.php b/vendor/phpstan/phpstan/src/Rules/Properties/ExistingClassesInPropertiesRule.php deleted file mode 100644 index 31b535f..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Properties/ExistingClassesInPropertiesRule.php +++ /dev/null @@ -1,102 +0,0 @@ -broker = $broker; - $this->classCaseSensitivityCheck = $classCaseSensitivityCheck; - $this->checkClassCaseSensitivity = $checkClassCaseSensitivity; - $this->checkThisOnly = $checkThisOnly; - } - - public function getNodeType(): string - { - return PropertyProperty::class; - } - - /** - * @param \PhpParser\Node\Stmt\PropertyProperty $node - * @param \PHPStan\Analyser\Scope $scope - * @return RuleError[] - */ - public function processNode(Node $node, Scope $scope): array - { - if (!$scope->isInClass()) { - throw new \PHPStan\ShouldNotHappenException(); - } - - $propertyReflection = $scope->getClassReflection()->getNativeProperty($node->name->name); - if ($this->checkThisOnly) { - $referencedClasses = $propertyReflection->getNativeType()->getReferencedClasses(); - } else { - $referencedClasses = array_merge( - $propertyReflection->getNativeType()->getReferencedClasses(), - $propertyReflection->getPhpDocType()->getReferencedClasses() - ); - } - - $errors = []; - foreach ($referencedClasses as $referencedClass) { - if ($this->broker->hasClass($referencedClass)) { - if ($this->broker->getClass($referencedClass)->isTrait()) { - $errors[] = RuleErrorBuilder::message(sprintf( - 'Property %s::$%s has invalid type %s.', - $propertyReflection->getDeclaringClass()->getDisplayName(), - $node->name->name, - $referencedClass - ))->build(); - } - continue; - } - - $errors[] = RuleErrorBuilder::message(sprintf( - 'Property %s::$%s has unknown class %s as its type.', - $propertyReflection->getDeclaringClass()->getDisplayName(), - $node->name->name, - $referencedClass - ))->build(); - } - - if ($this->checkClassCaseSensitivity) { - $errors = array_merge( - $errors, - $this->classCaseSensitivityCheck->checkClassNames(array_map(static function (string $class) use ($node): ClassNameNodePair { - return new ClassNameNodePair($class, $node); - }, $referencedClasses)) - ); - } - - return $errors; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Properties/PropertyDescriptor.php b/vendor/phpstan/phpstan/src/Rules/Properties/PropertyDescriptor.php deleted file mode 100644 index 7f526bb..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Properties/PropertyDescriptor.php +++ /dev/null @@ -1,26 +0,0 @@ -name; - if ($propertyFetch instanceof \PhpParser\Node\Expr\PropertyFetch) { - return sprintf('Property %s::$%s', $property->getDeclaringClass()->getDisplayName(), $name->name); - } - - return sprintf('Static property %s::$%s', $property->getDeclaringClass()->getDisplayName(), $name->name); - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Properties/PropertyReflectionFinder.php b/vendor/phpstan/phpstan/src/Rules/Properties/PropertyReflectionFinder.php deleted file mode 100644 index 21567c5..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Properties/PropertyReflectionFinder.php +++ /dev/null @@ -1,49 +0,0 @@ -name instanceof \PhpParser\Node\Identifier) { - return null; - } - $propertyHolderType = $scope->getType($propertyFetch->var); - return $this->findPropertyReflection($propertyHolderType, $propertyFetch->name->name, $scope); - } - - if (!$propertyFetch->name instanceof \PhpParser\Node\Identifier) { - return null; - } - - if ($propertyFetch->class instanceof \PhpParser\Node\Name) { - $propertyHolderType = new ObjectType($scope->resolveName($propertyFetch->class)); - } else { - $propertyHolderType = $scope->getType($propertyFetch->class); - } - - return $this->findPropertyReflection($propertyHolderType, $propertyFetch->name->name, $scope); - } - - private function findPropertyReflection(Type $propertyHolderType, string $propertyName, Scope $scope): ?\PHPStan\Reflection\PropertyReflection - { - if (!$propertyHolderType->hasProperty($propertyName)->yes()) { - return null; - } - - return $propertyHolderType->getProperty($propertyName, $scope); - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Properties/ReadingWriteOnlyPropertiesRule.php b/vendor/phpstan/phpstan/src/Rules/Properties/ReadingWriteOnlyPropertiesRule.php deleted file mode 100644 index 0c2307b..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Properties/ReadingWriteOnlyPropertiesRule.php +++ /dev/null @@ -1,90 +0,0 @@ -propertyDescriptor = $propertyDescriptor; - $this->propertyReflectionFinder = $propertyReflectionFinder; - $this->ruleLevelHelper = $ruleLevelHelper; - $this->checkThisOnly = $checkThisOnly; - } - - public function getNodeType(): string - { - return \PhpParser\Node\Expr::class; - } - - /** - * @param \PhpParser\Node\Expr $node - * @param Scope $scope - * @return string[] - */ - public function processNode(Node $node, Scope $scope): array - { - if ( - !($node instanceof Node\Expr\PropertyFetch) - && !($node instanceof Node\Expr\StaticPropertyFetch) - ) { - return []; - } - - if ( - $node instanceof Node\Expr\PropertyFetch - && $this->checkThisOnly - && !$this->ruleLevelHelper->isThis($node->var) - ) { - return []; - } - - if ($scope->isInExpressionAssign($node)) { - return []; - } - - $propertyReflection = $this->propertyReflectionFinder->findPropertyReflectionFromNode($node, $scope); - if ($propertyReflection === null) { - return []; - } - if (!$scope->canAccessProperty($propertyReflection)) { - return []; - } - - if (!$propertyReflection->isReadable()) { - $propertyDescription = $this->propertyDescriptor->describeProperty($propertyReflection, $node); - - return [ - sprintf( - '%s is not readable.', - $propertyDescription - ), - ]; - } - - return []; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Properties/TypesAssignedToPropertiesRule.php b/vendor/phpstan/phpstan/src/Rules/Properties/TypesAssignedToPropertiesRule.php deleted file mode 100644 index 7588e01..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Properties/TypesAssignedToPropertiesRule.php +++ /dev/null @@ -1,94 +0,0 @@ -ruleLevelHelper = $ruleLevelHelper; - $this->propertyDescriptor = $propertyDescriptor; - $this->propertyReflectionFinder = $propertyReflectionFinder; - } - - public function getNodeType(): string - { - return \PhpParser\Node\Expr::class; - } - - /** - * @param \PhpParser\Node\Expr $node - * @param \PHPStan\Analyser\Scope $scope - * @return string[] - */ - public function processNode(Node $node, Scope $scope): array - { - if ( - !$node instanceof Node\Expr\Assign - && !$node instanceof Node\Expr\AssignOp - ) { - return []; - } - - if ( - !($node->var instanceof Node\Expr\PropertyFetch) - && !($node->var instanceof Node\Expr\StaticPropertyFetch) - ) { - return []; - } - - /** @var \PhpParser\Node\Expr\PropertyFetch|\PhpParser\Node\Expr\StaticPropertyFetch $propertyFetch */ - $propertyFetch = $node->var; - $propertyReflection = $this->propertyReflectionFinder->findPropertyReflectionFromNode($propertyFetch, $scope); - if ($propertyReflection === null) { - return []; - } - - if ($propertyReflection instanceof ExtendedPropertyReflection) { - $propertyType = $propertyReflection->getWritableType(); - } else { - $propertyType = $propertyReflection->getType(); - } - - if ($node instanceof Node\Expr\Assign) { - $assignedValueType = $scope->getType($node->expr); - } else { - $assignedValueType = $scope->getType($node); - } - if (!$this->ruleLevelHelper->accepts($propertyType, $assignedValueType, $scope->isDeclareStrictTypes())) { - $propertyDescription = $this->propertyDescriptor->describeProperty($propertyReflection, $propertyFetch); - - return [ - sprintf( - '%s (%s) does not accept %s.', - $propertyDescription, - $propertyType->describe(VerbosityLevel::typeOnly()), - $assignedValueType->describe(VerbosityLevel::typeOnly()) - ), - ]; - } - - return []; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Properties/WritingToReadOnlyPropertiesRule.php b/vendor/phpstan/phpstan/src/Rules/Properties/WritingToReadOnlyPropertiesRule.php deleted file mode 100644 index 0feea7e..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Properties/WritingToReadOnlyPropertiesRule.php +++ /dev/null @@ -1,96 +0,0 @@ -ruleLevelHelper = $ruleLevelHelper; - $this->propertyDescriptor = $propertyDescriptor; - $this->propertyReflectionFinder = $propertyReflectionFinder; - $this->checkThisOnly = $checkThisOnly; - } - - public function getNodeType(): string - { - return \PhpParser\Node\Expr::class; - } - - /** - * @param \PhpParser\Node\Expr $node - * @param \PHPStan\Analyser\Scope $scope - * @return string[] - */ - public function processNode(Node $node, Scope $scope): array - { - if ( - !$node instanceof Node\Expr\Assign - && !$node instanceof Node\Expr\AssignOp - ) { - return []; - } - - if ( - !($node->var instanceof Node\Expr\PropertyFetch) - && !($node->var instanceof Node\Expr\StaticPropertyFetch) - ) { - return []; - } - - if ( - $node->var instanceof Node\Expr\PropertyFetch - && $this->checkThisOnly - && !$this->ruleLevelHelper->isThis($node->var->var) - ) { - return []; - } - - /** @var \PhpParser\Node\Expr\PropertyFetch|\PhpParser\Node\Expr\StaticPropertyFetch $propertyFetch */ - $propertyFetch = $node->var; - $propertyReflection = $this->propertyReflectionFinder->findPropertyReflectionFromNode($propertyFetch, $scope); - if ($propertyReflection === null) { - return []; - } - - if (!$scope->canAccessProperty($propertyReflection)) { - return []; - } - - if (!$propertyReflection->isWritable()) { - $propertyDescription = $this->propertyDescriptor->describeProperty($propertyReflection, $propertyFetch); - - return [ - sprintf( - '%s is not writable.', - $propertyDescription - ), - ]; - } - - return []; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Regexp/RegularExpressionPatternRule.php b/vendor/phpstan/phpstan/src/Rules/Regexp/RegularExpressionPatternRule.php deleted file mode 100644 index d9451b6..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Regexp/RegularExpressionPatternRule.php +++ /dev/null @@ -1,126 +0,0 @@ -extractPatterns($node, $scope); - - $errors = []; - foreach ($patterns as $pattern) { - $errorMessage = $this->validatePattern($pattern); - if ($errorMessage === null) { - continue; - } - - $errors[] = sprintf('Regex pattern is invalid: %s', $errorMessage); - } - - return $errors; - } - - /** - * @param FuncCall $functionCall - * @param Scope $scope - * @return string[] - */ - private function extractPatterns(FuncCall $functionCall, Scope $scope): array - { - if (!$functionCall->name instanceof Node\Name) { - return []; - } - $functionName = strtolower((string) $functionCall->name); - if (!\Nette\Utils\Strings::startsWith($functionName, 'preg_')) { - return []; - } - - if (!isset($functionCall->args[0])) { - return []; - } - $patternNode = $functionCall->args[0]->value; - $patternType = $scope->getType($patternNode); - - $patternStrings = []; - - foreach (TypeUtils::getConstantStrings($patternType) as $constantStringType) { - if ( - !in_array($functionName, [ - 'preg_match', - 'preg_match_all', - 'preg_split', - 'preg_grep', - 'preg_replace', - 'preg_replace_callback', - 'preg_filter', - ], true) - ) { - continue; - } - - $patternStrings[] = $constantStringType->getValue(); - } - - foreach (TypeUtils::getConstantArrays($patternType) as $constantArrayType) { - if ( - in_array($functionName, [ - 'preg_replace', - 'preg_replace_callback', - 'preg_filter', - ], true) - ) { - foreach ($constantArrayType->getValueTypes() as $arrayKeyType) { - if (!$arrayKeyType instanceof ConstantStringType) { - continue; - } - - $patternStrings[] = $arrayKeyType->getValue(); - } - } - - if ($functionName !== 'preg_replace_callback_array') { - continue; - } - - foreach ($constantArrayType->getKeyTypes() as $arrayKeyType) { - if (!$arrayKeyType instanceof ConstantStringType) { - continue; - } - - $patternStrings[] = $arrayKeyType->getValue(); - } - } - - return $patternStrings; - } - - private function validatePattern(string $pattern): ?string - { - try { - \Nette\Utils\Strings::match('', $pattern); - } catch (\Nette\Utils\RegexpException $e) { - return $e->getMessage(); - } - - return null; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Registry.php b/vendor/phpstan/phpstan/src/Rules/Registry.php deleted file mode 100644 index cf1c290..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Registry.php +++ /dev/null @@ -1,46 +0,0 @@ -rules[$rule->getNodeType()][] = $rule; - } - } - - /** - * @param string $nodeType - * @return \PHPStan\Rules\Rule[] - */ - public function getRules(string $nodeType): array - { - if (!isset($this->cache[$nodeType])) { - $parentNodeTypes = [$nodeType] + class_parents($nodeType) + class_implements($nodeType); - - $rules = []; - foreach ($parentNodeTypes as $parentNodeType) { - foreach ($this->rules[$parentNodeType] ?? [] as $rule) { - $rules[] = $rule; - } - } - - $this->cache[$nodeType] = $rules; - } - - return $this->cache[$nodeType]; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/RegistryFactory.php b/vendor/phpstan/phpstan/src/Rules/RegistryFactory.php deleted file mode 100644 index 935897b..0000000 --- a/vendor/phpstan/phpstan/src/Rules/RegistryFactory.php +++ /dev/null @@ -1,27 +0,0 @@ -container = $container; - } - - public function create(): Registry - { - return new Registry( - $this->container->getServicesByTag(self::RULE_TAG) - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Rule.php b/vendor/phpstan/phpstan/src/Rules/Rule.php deleted file mode 100644 index db2c668..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Rule.php +++ /dev/null @@ -1,23 +0,0 @@ -message = $message; - - return $self; - } - - public function line(int $line): self - { - $this->line = $line; - - return $this; - } - - public function file(string $file): self - { - $this->file = $file; - - return $this; - } - - public function build(): RuleError - { - if ($this->line !== null && $this->file !== null) { - return new RuleErrorWithMessageAndLineAndFile($this->message, $this->line, $this->file); - } - if ($this->line !== null && $this->file === null) { - return new RuleErrorWithMessageAndLine($this->message, $this->line); - } - if ($this->line === null && $this->file !== null) { - return new RuleErrorWithMessageAndFile($this->message, $this->file); - } - - return new RuleErrorWithMessage($this->message); - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/RuleErrors/RuleErrorWithMessage.php b/vendor/phpstan/phpstan/src/Rules/RuleErrors/RuleErrorWithMessage.php deleted file mode 100644 index 822a68a..0000000 --- a/vendor/phpstan/phpstan/src/Rules/RuleErrors/RuleErrorWithMessage.php +++ /dev/null @@ -1,23 +0,0 @@ -message = $message; - } - - public function getMessage(): string - { - return $this->message; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/RuleErrors/RuleErrorWithMessageAndFile.php b/vendor/phpstan/phpstan/src/Rules/RuleErrors/RuleErrorWithMessageAndFile.php deleted file mode 100644 index 68032ab..0000000 --- a/vendor/phpstan/phpstan/src/Rules/RuleErrors/RuleErrorWithMessageAndFile.php +++ /dev/null @@ -1,32 +0,0 @@ -message = $message; - $this->file = $file; - } - - public function getMessage(): string - { - return $this->message; - } - - public function getFile(): string - { - return $this->file; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/RuleErrors/RuleErrorWithMessageAndLine.php b/vendor/phpstan/phpstan/src/Rules/RuleErrors/RuleErrorWithMessageAndLine.php deleted file mode 100644 index 0431445..0000000 --- a/vendor/phpstan/phpstan/src/Rules/RuleErrors/RuleErrorWithMessageAndLine.php +++ /dev/null @@ -1,32 +0,0 @@ -message = $message; - $this->line = $line; - } - - public function getMessage(): string - { - return $this->message; - } - - public function getLine(): int - { - return $this->line; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/RuleErrors/RuleErrorWithMessageAndLineAndFile.php b/vendor/phpstan/phpstan/src/Rules/RuleErrors/RuleErrorWithMessageAndLineAndFile.php deleted file mode 100644 index 5edb9aa..0000000 --- a/vendor/phpstan/phpstan/src/Rules/RuleErrors/RuleErrorWithMessageAndLineAndFile.php +++ /dev/null @@ -1,42 +0,0 @@ -message = $message; - $this->line = $line; - $this->file = $file; - } - - public function getMessage(): string - { - return $this->message; - } - - public function getLine(): int - { - return $this->line; - } - - public function getFile(): string - { - return $this->file; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/RuleLevelHelper.php b/vendor/phpstan/phpstan/src/Rules/RuleLevelHelper.php deleted file mode 100644 index 79040a2..0000000 --- a/vendor/phpstan/phpstan/src/Rules/RuleLevelHelper.php +++ /dev/null @@ -1,208 +0,0 @@ -broker = $broker; - $this->checkNullables = $checkNullables; - $this->checkThisOnly = $checkThisOnly; - $this->checkUnionTypes = $checkUnionTypes; - } - - public function isThis(Expr $expression): bool - { - return $expression instanceof Expr\Variable && $expression->name === 'this'; - } - - public function accepts(Type $acceptingType, Type $acceptedType, bool $strictTypes): bool - { - if ( - !$this->checkNullables - && !$acceptingType instanceof NullType - && !$acceptedType instanceof NullType - && !$acceptedType instanceof BenevolentUnionType - ) { - $acceptedType = TypeCombinator::removeNull($acceptedType); - } - - if ( - $acceptedType->isArray()->yes() - && $acceptingType->isArray()->yes() - && !$acceptingType instanceof ConstantArrayType - ) { - $acceptedConstantArrays = TypeUtils::getConstantArrays($acceptedType); - if (count($acceptedConstantArrays) > 0) { - foreach ($acceptedConstantArrays as $acceptedConstantArray) { - foreach ($acceptedConstantArray->getKeyTypes() as $i => $keyType) { - $valueType = $acceptedConstantArray->getValueTypes()[$i]; - if ( - !self::accepts( - $acceptingType->getIterableKeyType(), - $keyType, - $strictTypes - ) || !self::accepts( - $acceptingType->getIterableValueType(), - $valueType, - $strictTypes - ) - ) { - return false; - } - } - } - - return true; - } - - if ( - !self::accepts( - $acceptingType->getIterableKeyType(), - $acceptedType->getIterableKeyType(), - $strictTypes - ) || !self::accepts( - $acceptingType->getIterableValueType(), - $acceptedType->getIterableValueType(), - $strictTypes - ) - ) { - return false; - } - - return true; - } - - if ($acceptingType instanceof UnionType && !$acceptedType instanceof CompoundType) { - foreach ($acceptingType->getTypes() as $innerType) { - if (self::accepts($innerType, $acceptedType, $strictTypes)) { - return true; - } - } - - return false; - } - - if ( - $acceptedType->isArray()->yes() - && $acceptingType->isArray()->yes() - && !$acceptingType instanceof ConstantArrayType - ) { - return self::accepts( - $acceptingType->getIterableKeyType(), - $acceptedType->getIterableKeyType(), - $strictTypes - ) && self::accepts( - $acceptingType->getIterableValueType(), - $acceptedType->getIterableValueType(), - $strictTypes - ); - } - - $accepts = $acceptingType->accepts($acceptedType, $strictTypes); - - return $this->checkUnionTypes ? $accepts->yes() : !$accepts->no(); - } - - /** - * @param Scope $scope - * @param Expr $var - * @param string $unknownClassErrorPattern - * @param callable(Type $type): bool $unionTypeCriteriaCallback - * @return FoundTypeResult - */ - public function findTypeToCheck( - Scope $scope, - Expr $var, - string $unknownClassErrorPattern, - callable $unionTypeCriteriaCallback - ): FoundTypeResult - { - if ($this->checkThisOnly && !$this->isThis($var)) { - return new FoundTypeResult(new ErrorType(), [], []); - } - $type = $scope->getType($var); - if (!$this->checkNullables && !$type instanceof NullType) { - $type = \PHPStan\Type\TypeCombinator::removeNull($type); - } - if ($type instanceof MixedType || $type instanceof NeverType) { - return new FoundTypeResult(new ErrorType(), [], []); - } - if ($type instanceof StaticType) { - $type = $type->resolveStatic($type->getBaseClass()); - } - - $errors = []; - $directClassNames = TypeUtils::getDirectClassNames($type); - foreach ($directClassNames as $referencedClass) { - if ($this->broker->hasClass($referencedClass)) { - continue; - } - - $errors[] = RuleErrorBuilder::message(sprintf($unknownClassErrorPattern, $referencedClass))->line($var->getLine())->build(); - } - - if (count($errors) > 0) { - return new FoundTypeResult(new ErrorType(), [], $errors); - } - - if (!$this->checkUnionTypes) { - if ($type instanceof ObjectWithoutClassType) { - return new FoundTypeResult(new ErrorType(), [], []); - } - if ($type instanceof UnionType) { - $newTypes = []; - foreach ($type->getTypes() as $innerType) { - if (!$unionTypeCriteriaCallback($innerType)) { - continue; - } - - $newTypes[] = $innerType; - } - - if (count($newTypes) > 0) { - return new FoundTypeResult(TypeCombinator::union(...$newTypes), $directClassNames, []); - } - } - } - - return new FoundTypeResult($type, $directClassNames, []); - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/TooWideTypehints/TooWideClosureReturnTypehintRule.php b/vendor/phpstan/phpstan/src/Rules/TooWideTypehints/TooWideClosureReturnTypehintRule.php deleted file mode 100644 index d8b832f..0000000 --- a/vendor/phpstan/phpstan/src/Rules/TooWideTypehints/TooWideClosureReturnTypehintRule.php +++ /dev/null @@ -1,70 +0,0 @@ -getAnonymousFunctionReturnType(); - if ($closureReturnType === null || !$closureReturnType instanceof UnionType) { - return []; - } - $statementResult = $node->getStatementResult(); - if ($statementResult->hasYield()) { - return []; - } - - $returnStatements = $node->getReturnStatements(); - if (count($returnStatements) === 0) { - return []; - } - - $returnTypes = []; - foreach ($returnStatements as $returnStatement) { - $returnNode = $returnStatement->getReturnNode(); - if ($returnNode->expr === null) { - continue; - } - - $returnTypes[] = $returnStatement->getScope()->getType($returnNode->expr); - } - - if (count($returnTypes) === 0) { - return []; - } - - $returnType = TypeCombinator::union(...$returnTypes); - - $messages = []; - foreach ($closureReturnType->getTypes() as $type) { - if (!$type->isSuperTypeOf($returnType)->no()) { - continue; - } - - $messages[] = sprintf('Anonymous function never returns %s so it can be removed from the return typehint.', $type->describe(VerbosityLevel::typeOnly())); - } - - return $messages; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/TooWideTypehints/TooWideFunctionReturnTypehintRule.php b/vendor/phpstan/phpstan/src/Rules/TooWideTypehints/TooWideFunctionReturnTypehintRule.php deleted file mode 100644 index 6fd9d7e..0000000 --- a/vendor/phpstan/phpstan/src/Rules/TooWideTypehints/TooWideFunctionReturnTypehintRule.php +++ /dev/null @@ -1,77 +0,0 @@ -getFunction(); - if (!$function instanceof FunctionReflection) { - throw new \PHPStan\ShouldNotHappenException(); - } - - $functionReturnType = ParametersAcceptorSelector::selectSingle($function->getVariants())->getReturnType(); - if (!$functionReturnType instanceof UnionType) { - return []; - } - $statementResult = $node->getStatementResult(); - if ($statementResult->hasYield()) { - return []; - } - - $returnStatements = $node->getReturnStatements(); - if (count($returnStatements) === 0) { - return []; - } - - $returnTypes = []; - foreach ($returnStatements as $returnStatement) { - $returnNode = $returnStatement->getReturnNode(); - if ($returnNode->expr === null) { - continue; - } - - $returnTypes[] = $returnStatement->getScope()->getType($returnNode->expr); - } - - if (count($returnTypes) === 0) { - return []; - } - - $returnType = TypeCombinator::union(...$returnTypes); - - $messages = []; - foreach ($functionReturnType->getTypes() as $type) { - if (!$type->isSuperTypeOf($returnType)->no()) { - continue; - } - - $messages[] = sprintf('Function %s() never returns %s so it can be removed from the return typehint.', $function->getName(), $type->describe(VerbosityLevel::typeOnly())); - } - - return $messages; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/TooWideTypehints/TooWidePrivateMethodReturnTypehintRule.php b/vendor/phpstan/phpstan/src/Rules/TooWideTypehints/TooWidePrivateMethodReturnTypehintRule.php deleted file mode 100644 index c5d9d3c..0000000 --- a/vendor/phpstan/phpstan/src/Rules/TooWideTypehints/TooWidePrivateMethodReturnTypehintRule.php +++ /dev/null @@ -1,80 +0,0 @@ -getFunction(); - if (!$method instanceof MethodReflection) { - throw new \PHPStan\ShouldNotHappenException(); - } - if (!$method->isPrivate()) { - return []; - } - - $methodReturnType = ParametersAcceptorSelector::selectSingle($method->getVariants())->getReturnType(); - if (!$methodReturnType instanceof UnionType) { - return []; - } - $statementResult = $node->getStatementResult(); - if ($statementResult->hasYield()) { - return []; - } - - $returnStatements = $node->getReturnStatements(); - if (count($returnStatements) === 0) { - return []; - } - - $returnTypes = []; - foreach ($returnStatements as $returnStatement) { - $returnNode = $returnStatement->getReturnNode(); - if ($returnNode->expr === null) { - continue; - } - - $returnTypes[] = $returnStatement->getScope()->getType($returnNode->expr); - } - - if (count($returnTypes) === 0) { - return []; - } - - $returnType = TypeCombinator::union(...$returnTypes); - - $messages = []; - foreach ($methodReturnType->getTypes() as $type) { - if (!$type->isSuperTypeOf($returnType)->no()) { - continue; - } - - $messages[] = sprintf('Private method %s::%s() never returns %s so it can be removed from the return typehint.', $method->getDeclaringClass()->getDisplayName(), $method->getName(), $type->describe(VerbosityLevel::typeOnly())); - } - - return $messages; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/UnusedFunctionParametersCheck.php b/vendor/phpstan/phpstan/src/Rules/UnusedFunctionParametersCheck.php deleted file mode 100644 index 5154500..0000000 --- a/vendor/phpstan/phpstan/src/Rules/UnusedFunctionParametersCheck.php +++ /dev/null @@ -1,87 +0,0 @@ -getUsedVariables($scope, $statements) as $variableName) { - if (!isset($unusedParameters[$variableName])) { - continue; - } - - unset($unusedParameters[$variableName]); - } - $errors = []; - foreach (array_keys($unusedParameters) as $name) { - $errors[] = sprintf($unusedParameterMessage, $name); - } - - return $errors; - } - - /** - * @param \PHPStan\Analyser\Scope $scope - * @param \PhpParser\Node[]|\PhpParser\Node|scalar $node - * @return string[] - */ - private function getUsedVariables(Scope $scope, $node): array - { - $variableNames = []; - if ($node instanceof Node) { - if ($node instanceof Node\Expr\Variable && is_string($node->name) && $node->name !== 'this') { - return [$node->name]; - } - if ($node instanceof Node\Expr\ClosureUse && is_string($node->var->name)) { - return [$node->var->name]; - } - if ( - $node instanceof Node\Expr\FuncCall - && $node->name instanceof Node\Name - && (string) $node->name === 'compact' - ) { - foreach ($node->args as $arg) { - $argType = $scope->getType($arg->value); - if (!($argType instanceof ConstantStringType)) { - continue; - } - - $variableNames[] = $argType->getValue(); - } - } - foreach ($node->getSubNodeNames() as $subNodeName) { - if ($node instanceof Node\Expr\Closure && $subNodeName !== 'uses') { - continue; - } - $subNode = $node->{$subNodeName}; - $variableNames = array_merge($variableNames, $this->getUsedVariables($scope, $subNode)); - } - } elseif (is_array($node)) { - foreach ($node as $subNode) { - $variableNames = array_merge($variableNames, $this->getUsedVariables($scope, $subNode)); - } - } - - return $variableNames; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Variables/DefinedVariableInAnonymousFunctionUseRule.php b/vendor/phpstan/phpstan/src/Rules/Variables/DefinedVariableInAnonymousFunctionUseRule.php deleted file mode 100644 index cacd4f6..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Variables/DefinedVariableInAnonymousFunctionUseRule.php +++ /dev/null @@ -1,54 +0,0 @@ -checkMaybeUndefinedVariables = $checkMaybeUndefinedVariables; - } - - public function getNodeType(): string - { - return ClosureUse::class; - } - - /** - * @param \PhpParser\Node\Expr\ClosureUse $node - * @param \PHPStan\Analyser\Scope $scope - * @return string[] - */ - public function processNode(Node $node, Scope $scope): array - { - if ($node->byRef || !is_string($node->var->name)) { - return []; - } - - if ($scope->hasVariableType($node->var->name)->no()) { - return [ - sprintf('Undefined variable: $%s', $node->var->name), - ]; - } elseif ( - $this->checkMaybeUndefinedVariables - && !$scope->hasVariableType($node->var->name)->yes() - ) { - return [ - sprintf('Variable $%s might not be defined.', $node->var->name), - ]; - } - - return []; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Variables/DefinedVariableRule.php b/vendor/phpstan/phpstan/src/Rules/Variables/DefinedVariableRule.php deleted file mode 100644 index 25932a2..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Variables/DefinedVariableRule.php +++ /dev/null @@ -1,73 +0,0 @@ -cliArgumentsVariablesRegistered = $cliArgumentsVariablesRegistered; - $this->checkMaybeUndefinedVariables = $checkMaybeUndefinedVariables; - } - - public function getNodeType(): string - { - return Variable::class; - } - - /** - * @param \PhpParser\Node\Expr\Variable $node - * @param \PHPStan\Analyser\Scope $scope - * @return string[] - */ - public function processNode(Node $node, Scope $scope): array - { - if (!is_string($node->name)) { - return []; - } - - if ($this->cliArgumentsVariablesRegistered && in_array($node->name, [ - 'argc', - 'argv', - ], true)) { - $isInMain = !$scope->isInClass() && !$scope->isInAnonymousFunction() && $scope->getFunction() === null; - if ($isInMain) { - return []; - } - } - - if ($scope->isInExpressionAssign($node)) { - return []; - } - - if ($scope->hasVariableType($node->name)->no()) { - return [ - sprintf('Undefined variable: $%s', $node->name), - ]; - } elseif ( - $this->checkMaybeUndefinedVariables - && !$scope->hasVariableType($node->name)->yes() - ) { - return [ - sprintf('Variable $%s might not be defined.', $node->name), - ]; - } - - return []; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Variables/ThisVariableRule.php b/vendor/phpstan/phpstan/src/Rules/Variables/ThisVariableRule.php deleted file mode 100644 index c68ff4a..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Variables/ThisVariableRule.php +++ /dev/null @@ -1,57 +0,0 @@ -name) || $node->name !== 'this') { - return []; - } - - if ($scope->isInClosureBind()) { - return []; - } - - if (!$scope->isInClass()) { - return [ - 'Using $this outside a class.', - ]; - } - - $function = $scope->getFunction(); - if (!$function instanceof MethodReflection) { - throw new \PHPStan\ShouldNotHappenException(); - } - - if ($function->isStatic()) { - return [ - sprintf( - 'Using $this in static method %s::%s().', - $scope->getClassReflection()->getDisplayName(), - $function->getName() - ), - ]; - } - - return []; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Variables/ThrowTypeRule.php b/vendor/phpstan/phpstan/src/Rules/Variables/ThrowTypeRule.php deleted file mode 100644 index 65dbe25..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Variables/ThrowTypeRule.php +++ /dev/null @@ -1,63 +0,0 @@ -ruleLevelHelper = $ruleLevelHelper; - } - - public function getNodeType(): string - { - return \PhpParser\Node\Stmt\Throw_::class; - } - - /** - * @param \PhpParser\Node\Stmt\Throw_ $node - * @param \PHPStan\Analyser\Scope $scope - * @return (string|\PHPStan\Rules\RuleError)[] - */ - public function processNode(Node $node, Scope $scope): array - { - $throwableType = new ObjectType(\Throwable::class); - $typeResult = $this->ruleLevelHelper->findTypeToCheck( - $scope, - $node->expr, - 'Throwing object of an unknown class %s.', - static function (Type $type) use ($throwableType): bool { - return $throwableType->isSuperTypeOf($type)->yes(); - } - ); - - $foundType = $typeResult->getType(); - if ($foundType instanceof ErrorType) { - return $typeResult->getUnknownClassErrors(); - } - - $isSuperType = $throwableType->isSuperTypeOf($foundType); - if ($isSuperType->yes()) { - return []; - } - - return [ - sprintf('Invalid type %s to throw.', $foundType->describe(VerbosityLevel::typeOnly())), - ]; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Variables/VariableCertaintyInIssetRule.php b/vendor/phpstan/phpstan/src/Rules/Variables/VariableCertaintyInIssetRule.php deleted file mode 100644 index 306719d..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Variables/VariableCertaintyInIssetRule.php +++ /dev/null @@ -1,66 +0,0 @@ -vars as $var) { - $isSubNode = false; - while ( - $var instanceof Node\Expr\ArrayDimFetch - || $var instanceof Node\Expr\PropertyFetch - || ( - $var instanceof Node\Expr\StaticPropertyFetch - && $var->class instanceof Node\Expr - ) - ) { - if ($var instanceof Node\Expr\StaticPropertyFetch) { - $var = $var->class; - } else { - $var = $var->var; - } - $isSubNode = true; - } - - if (!$var instanceof Node\Expr\Variable || !is_string($var->name)) { - continue; - } - - $certainty = $scope->hasVariableType($var->name); - if ($certainty->no()) { - if ( - $scope->getFunction() !== null - || $scope->isInAnonymousFunction() - ) { - $messages[] = sprintf('Variable $%s in isset() is never defined.', $var->name); - } - } elseif ($certainty->yes() && !$isSubNode) { - $variableType = $scope->getVariableType($var->name); - if ($variableType->isSuperTypeOf(new NullType())->no()) { - $messages[] = sprintf('Variable $%s in isset() always exists and is not nullable.', $var->name); - } - } - } - - return $messages; - } - -} diff --git a/vendor/phpstan/phpstan/src/Rules/Variables/VariableCloningRule.php b/vendor/phpstan/phpstan/src/Rules/Variables/VariableCloningRule.php deleted file mode 100644 index 0da080b..0000000 --- a/vendor/phpstan/phpstan/src/Rules/Variables/VariableCloningRule.php +++ /dev/null @@ -1,68 +0,0 @@ -ruleLevelHelper = $ruleLevelHelper; - } - - public function getNodeType(): string - { - return Clone_::class; - } - - /** - * @param \PhpParser\Node\Expr\Clone_ $node - * @param \PHPStan\Analyser\Scope $scope - * @return (string|\PHPStan\Rules\RuleError)[] - */ - public function processNode(Node $node, Scope $scope): array - { - $typeResult = $this->ruleLevelHelper->findTypeToCheck( - $scope, - $node->expr, - 'Cloning object of an unknown class %s.', - static function (Type $type): bool { - return $type->isCloneable()->yes(); - } - ); - $type = $typeResult->getType(); - if ($type instanceof ErrorType) { - return $typeResult->getUnknownClassErrors(); - } - if ($type->isCloneable()->yes()) { - return []; - } - - if ($node->expr instanceof Variable && is_string($node->expr->name)) { - return [ - sprintf( - 'Cannot clone non-object variable $%s of type %s.', - $node->expr->name, - $type->describe(VerbosityLevel::typeOnly()) - ), - ]; - } - - return [ - sprintf('Cannot clone %s.', $type->describe(VerbosityLevel::typeOnly())), - ]; - } - -} diff --git a/vendor/phpstan/phpstan/src/ShouldNotHappenException.php b/vendor/phpstan/phpstan/src/ShouldNotHappenException.php deleted file mode 100644 index 9957588..0000000 --- a/vendor/phpstan/phpstan/src/ShouldNotHappenException.php +++ /dev/null @@ -1,13 +0,0 @@ -getDataPath(), $topic); - $command = escapeshellcmd($this->getPhpStanExecutablePath()); - $configPath = $this->getPhpStanConfigPath(); - $fileHelper = new FileHelper(__DIR__ . '/../..'); - - $previousMessages = []; - - $exceptions = []; - - foreach (range(0, 7) as $level) { - unset($outputLines); - exec(sprintf('%s %s analyse --no-progress --error-format=prettyJson --level=%d %s --autoload-file %s %s', escapeshellarg(PHP_BINARY), $command, $level, $configPath !== null ? '--configuration ' . escapeshellarg($configPath) : '', escapeshellarg($file), escapeshellarg($file)), $outputLines); - - $output = implode("\n", $outputLines); - - try { - $actualJson = \Nette\Utils\Json::decode($output, \Nette\Utils\Json::FORCE_ARRAY); - } catch (\Nette\Utils\JsonException $e) { - throw new \Nette\Utils\JsonException(sprintf('Cannot decode: %s', $output)); - } - if (count($actualJson['files']) > 0) { - $messagesBeforeDiffing = $actualJson['files'][$fileHelper->normalizePath($file)]['messages']; - } else { - $messagesBeforeDiffing = []; - } - - $messages = []; - foreach ($messagesBeforeDiffing as $message) { - foreach ($previousMessages as $lastMessage) { - if ( - $message['message'] === $lastMessage['message'] - && $message['line'] === $lastMessage['line'] - ) { - continue 2; - } - } - - $messages[] = $message; - } - - $missingMessages = []; - foreach ($previousMessages as $previousMessage) { - foreach ($messagesBeforeDiffing as $message) { - if ( - $previousMessage['message'] === $message['message'] - && $previousMessage['line'] === $message['line'] - ) { - continue 2; - } - } - - $missingMessages[] = $previousMessage; - } - - $previousMessages = array_merge($previousMessages, $messages); - $expectedJsonFile = sprintf('%s/%s-%d%s.json', $this->getDataPath(), $topic, $level, $this->getResultSuffix()); - - $exception = $this->compareFiles($expectedJsonFile, $messages); - if ($exception !== null) { - $exceptions[] = $exception; - } - - $expectedJsonMissingFile = sprintf('%s/%s-%d-missing%s.json', $this->getDataPath(), $topic, $level, $this->getResultSuffix()); - $exception = $this->compareFiles($expectedJsonMissingFile, $missingMessages); - if ($exception === null) { - continue; - } - - $exceptions[] = $exception; - } - - if (count($exceptions) > 0) { - throw $exceptions[0]; - } - } - - private function compareFiles(string $expectedJsonFile, array $expectedMessages): ?\PHPUnit\Framework\AssertionFailedError - { - if (count($expectedMessages) === 0) { - try { - $this->assertFileNotExists($expectedJsonFile); - return null; - } catch (\PHPUnit\Framework\AssertionFailedError $e) { - unlink($expectedJsonFile); - return $e; - } - } - - $actualOutput = \Nette\Utils\Json::encode($expectedMessages, \Nette\Utils\Json::PRETTY); - - try { - $this->assertJsonStringEqualsJsonFile( - $expectedJsonFile, - $actualOutput - ); - } catch (\PHPUnit\Framework\AssertionFailedError $e) { - file_put_contents($expectedJsonFile, $actualOutput); - return $e; - } - - return null; - } - -} diff --git a/vendor/phpstan/phpstan/src/Testing/RuleTestCase.php b/vendor/phpstan/phpstan/src/Testing/RuleTestCase.php deleted file mode 100644 index 1107416..0000000 --- a/vendor/phpstan/phpstan/src/Testing/RuleTestCase.php +++ /dev/null @@ -1,154 +0,0 @@ -createTypeSpecifier( - new \PhpParser\PrettyPrinter\Standard(), - $this->createBroker(), - $this->getMethodTypeSpecifyingExtensions(), - $this->getStaticMethodTypeSpecifyingExtensions() - ); - } - - private function getAnalyser(): Analyser - { - if ($this->analyser === null) { - $registry = new Registry([ - $this->getRule(), - ]); - - $broker = $this->createBroker(); - $printer = new \PhpParser\PrettyPrinter\Standard(); - $fileHelper = $this->getFileHelper(); - $typeSpecifier = $this->createTypeSpecifier( - $printer, - $broker, - $this->getMethodTypeSpecifyingExtensions(), - $this->getStaticMethodTypeSpecifyingExtensions() - ); - $currentWorkingDirectory = $this->getCurrentWorkingDirectory(); - $this->analyser = new Analyser( - $this->createScopeFactory($broker, $typeSpecifier), - $this->getParser(), - $registry, - new NodeScopeResolver( - $broker, - $this->getParser(), - new FileTypeMapper($this->getParser(), self::getContainer()->getByType(PhpDocStringResolver::class), $this->createMock(Cache::class), new AnonymousClassNameHelper(new FileHelper($currentWorkingDirectory), new FuzzyRelativePathHelper($currentWorkingDirectory, DIRECTORY_SEPARATOR, [])), new \PHPStan\PhpDoc\TypeNodeResolver($this->getTypeNodeResolverExtensions())), - $fileHelper, - $typeSpecifier, - $this->shouldPolluteScopeWithLoopInitialAssignments(), - $this->shouldPolluteCatchScopeWithTryAssignments(), - $this->shouldPolluteScopeWithAlwaysIterableForeach(), - [], - false - ), - $fileHelper, - [], - true, - 50 - ); - } - - return $this->analyser; - } - - /** - * @return \PHPStan\Type\MethodTypeSpecifyingExtension[] - */ - protected function getMethodTypeSpecifyingExtensions(): array - { - return []; - } - - /** - * @return \PHPStan\Type\StaticMethodTypeSpecifyingExtension[] - */ - protected function getStaticMethodTypeSpecifyingExtensions(): array - { - return []; - } - - /** - * @return \PHPStan\PhpDoc\TypeNodeResolverExtension[] - */ - protected function getTypeNodeResolverExtensions(): array - { - return []; - } - - /** - * @param string[] $files - * @param mixed[] $expectedErrors - */ - public function analyse(array $files, array $expectedErrors): void - { - $files = array_map([$this->getFileHelper(), 'normalizePath'], $files); - $actualErrors = $this->getAnalyser()->analyse($files, false); - - $strictlyTypedSprintf = static function (int $line, string $message): string { - return sprintf('%02d: %s', $line, $message); - }; - - $expectedErrors = array_map( - static function (array $error) use ($strictlyTypedSprintf): string { - if (!isset($error[0])) { - throw new \InvalidArgumentException('Missing expected error message.'); - } - if (!isset($error[1])) { - throw new \InvalidArgumentException('Missing expected file line.'); - } - return $strictlyTypedSprintf($error[1], $error[0]); - }, - $expectedErrors - ); - - $actualErrors = array_map( - static function (Error $error): string { - return sprintf('%02d: %s', $error->getLine(), $error->getMessage()); - }, - $actualErrors - ); - - $this->assertSame(implode("\n", $expectedErrors), implode("\n", $actualErrors)); - } - - protected function shouldPolluteScopeWithLoopInitialAssignments(): bool - { - return false; - } - - protected function shouldPolluteCatchScopeWithTryAssignments(): bool - { - return false; - } - - protected function shouldPolluteScopeWithAlwaysIterableForeach(): bool - { - return true; - } - -} diff --git a/vendor/phpstan/phpstan/src/Testing/TestCase.php b/vendor/phpstan/phpstan/src/Testing/TestCase.php deleted file mode 100644 index 467fa21..0000000 --- a/vendor/phpstan/phpstan/src/Testing/TestCase.php +++ /dev/null @@ -1,375 +0,0 @@ -create($tmpDir, [ - $containerFactory->getConfigDirectory() . '/config.level7.neon', - ], []); - } - - return self::$container; - } - - public function getParser(): \PHPStan\Parser\Parser - { - /** @var \PHPStan\Parser\Parser $parser */ - $parser = self::getContainer()->getService('directParser'); - return $parser; - } - - /** - * @param \PHPStan\Type\DynamicMethodReturnTypeExtension[] $dynamicMethodReturnTypeExtensions - * @param \PHPStan\Type\DynamicStaticMethodReturnTypeExtension[] $dynamicStaticMethodReturnTypeExtensions - * @return \PHPStan\Broker\Broker - */ - public function createBroker( - array $dynamicMethodReturnTypeExtensions = [], - array $dynamicStaticMethodReturnTypeExtensions = [] - ): Broker - { - $functionCallStatementFinder = new FunctionCallStatementFinder(); - $parser = $this->getParser(); - $cache = new Cache(new MemoryCacheStorage()); - $methodReflectionFactory = new class($parser, $functionCallStatementFinder, $cache) implements PhpMethodReflectionFactory { - - /** @var \PHPStan\Parser\Parser */ - private $parser; - - /** @var \PHPStan\Parser\FunctionCallStatementFinder */ - private $functionCallStatementFinder; - - /** @var \PHPStan\Cache\Cache */ - private $cache; - - /** @var \PHPStan\Broker\Broker */ - public $broker; - - public function __construct( - Parser $parser, - FunctionCallStatementFinder $functionCallStatementFinder, - Cache $cache - ) - { - $this->parser = $parser; - $this->functionCallStatementFinder = $functionCallStatementFinder; - $this->cache = $cache; - } - - /** - * @param ClassReflection $declaringClass - * @param ClassReflection|null $declaringTrait - * @param \PHPStan\Reflection\Php\BuiltinMethodReflection $reflection - * @param Type[] $phpDocParameterTypes - * @param Type|null $phpDocReturnType - * @param Type|null $phpDocThrowType - * @param string|null $deprecatedDescription - * @param bool $isDeprecated - * @param bool $isInternal - * @param bool $isFinal - * @return PhpMethodReflection - */ - public function create( - ClassReflection $declaringClass, - ?ClassReflection $declaringTrait, - \PHPStan\Reflection\Php\BuiltinMethodReflection $reflection, - array $phpDocParameterTypes, - ?Type $phpDocReturnType, - ?Type $phpDocThrowType, - ?string $deprecatedDescription, - bool $isDeprecated, - bool $isInternal, - bool $isFinal - ): PhpMethodReflection - { - return new PhpMethodReflection( - $declaringClass, - $declaringTrait, - $reflection, - $this->broker, - $this->parser, - $this->functionCallStatementFinder, - $this->cache, - $phpDocParameterTypes, - $phpDocReturnType, - $phpDocThrowType, - $deprecatedDescription, - $isDeprecated, - $isInternal, - $isFinal - ); - } - - }; - $phpDocStringResolver = self::getContainer()->getByType(PhpDocStringResolver::class); - $currentWorkingDirectory = $this->getCurrentWorkingDirectory(); - $fileTypeMapper = new FileTypeMapper($parser, $phpDocStringResolver, $cache, new AnonymousClassNameHelper(new FileHelper($currentWorkingDirectory), new FuzzyRelativePathHelper($currentWorkingDirectory, DIRECTORY_SEPARATOR, [])), self::getContainer()->getByType(\PHPStan\PhpDoc\TypeNodeResolver::class)); - $annotationsMethodsClassReflectionExtension = new AnnotationsMethodsClassReflectionExtension($fileTypeMapper); - $annotationsPropertiesClassReflectionExtension = new AnnotationsPropertiesClassReflectionExtension($fileTypeMapper); - $signatureMapProvider = self::getContainer()->getByType(SignatureMapProvider::class); - $phpExtension = new PhpClassReflectionExtension(new NetteContainer(self::getContainer()), $methodReflectionFactory, $fileTypeMapper, $annotationsMethodsClassReflectionExtension, $annotationsPropertiesClassReflectionExtension, $signatureMapProvider, $parser, true); - $functionReflectionFactory = new class($this->getParser(), $functionCallStatementFinder, $cache) implements FunctionReflectionFactory { - - /** @var \PHPStan\Parser\Parser */ - private $parser; - - /** @var \PHPStan\Parser\FunctionCallStatementFinder */ - private $functionCallStatementFinder; - - /** @var \PHPStan\Cache\Cache */ - private $cache; - - public function __construct( - Parser $parser, - FunctionCallStatementFinder $functionCallStatementFinder, - Cache $cache - ) - { - $this->parser = $parser; - $this->functionCallStatementFinder = $functionCallStatementFinder; - $this->cache = $cache; - } - - /** - * @param \ReflectionFunction $function - * @param Type[] $phpDocParameterTypes - * @param Type|null $phpDocReturnType - * @param Type|null $phpDocThrowType - * @param string|null $deprecatedDescription - * @param bool $isDeprecated - * @param bool $isInternal - * @param bool $isFinal - * @param string|false $filename - * @return PhpFunctionReflection - */ - public function create( - \ReflectionFunction $function, - array $phpDocParameterTypes, - ?Type $phpDocReturnType, - ?Type $phpDocThrowType, - ?string $deprecatedDescription, - bool $isDeprecated, - bool $isInternal, - bool $isFinal, - $filename - ): PhpFunctionReflection - { - return new PhpFunctionReflection( - $function, - $this->parser, - $this->functionCallStatementFinder, - $this->cache, - $phpDocParameterTypes, - $phpDocReturnType, - $phpDocThrowType, - $deprecatedDescription, - $isDeprecated, - $isInternal, - $isFinal, - $filename - ); - } - - }; - - $tagToService = static function (array $tags) { - return array_map(static function (string $serviceName) { - return self::getContainer()->getService($serviceName); - }, array_keys($tags)); - }; - - $currentWorkingDirectory = $this->getCurrentWorkingDirectory(); - $anonymousClassNameHelper = new AnonymousClassNameHelper(new FileHelper($currentWorkingDirectory), new FuzzyRelativePathHelper($currentWorkingDirectory, DIRECTORY_SEPARATOR, [])); - $broker = new Broker( - [ - $phpExtension, - new PhpDefectClassReflectionExtension(self::getContainer()->getByType(TypeStringResolver::class), $annotationsPropertiesClassReflectionExtension), - new UniversalObjectCratesClassReflectionExtension([\stdClass::class]), - $annotationsPropertiesClassReflectionExtension, - ], - [ - $phpExtension, - $annotationsMethodsClassReflectionExtension, - ], - array_merge($dynamicMethodReturnTypeExtensions, $this->getDynamicMethodReturnTypeExtensions()), - array_merge($dynamicStaticMethodReturnTypeExtensions, $this->getDynamicStaticMethodReturnTypeExtensions()), - array_merge($tagToService(self::getContainer()->findByTag(BrokerFactory::DYNAMIC_FUNCTION_RETURN_TYPE_EXTENSION_TAG)), $this->getDynamicFunctionReturnTypeExtensions()), - $this->getOperatorTypeSpecifyingExtensions(), - $functionReflectionFactory, - new FileTypeMapper($this->getParser(), $phpDocStringResolver, $cache, $anonymousClassNameHelper, self::getContainer()->getByType(\PHPStan\PhpDoc\TypeNodeResolver::class)), - $signatureMapProvider, - self::getContainer()->getByType(Standard::class), - $anonymousClassNameHelper, - self::getContainer()->getByType(Parser::class), - new FuzzyRelativePathHelper($this->getCurrentWorkingDirectory(), DIRECTORY_SEPARATOR, []), - self::getContainer()->parameters['universalObjectCratesClasses'] - ); - $methodReflectionFactory->broker = $broker; - - return $broker; - } - - /** - * @param Broker $broker - * @param TypeSpecifier $typeSpecifier - * @param string[] $dynamicConstantNames - * - * @return ScopeFactory - */ - public function createScopeFactory(Broker $broker, TypeSpecifier $typeSpecifier, array $dynamicConstantNames = []): ScopeFactory - { - $container = self::getContainer(); - - if (count($dynamicConstantNames) > 0) { - $container->parameters['dynamicConstantNames'] = array_merge($container->parameters['dynamicConstantNames'], $dynamicConstantNames); - } - - return new ScopeFactory( - Scope::class, - $broker, - new \PhpParser\PrettyPrinter\Standard(), - $typeSpecifier, - new PropertyReflectionFinder(), - $container->getByType(Container::class) - ); - } - - public function getCurrentWorkingDirectory(): string - { - return $this->getFileHelper()->normalizePath(__DIR__ . '/../..'); - } - - /** - * @return \PHPStan\Type\DynamicMethodReturnTypeExtension[] - */ - public function getDynamicMethodReturnTypeExtensions(): array - { - return []; - } - - /** - * @return \PHPStan\Type\DynamicStaticMethodReturnTypeExtension[] - */ - public function getDynamicStaticMethodReturnTypeExtensions(): array - { - return []; - } - - /** - * @return \PHPStan\Type\DynamicFunctionReturnTypeExtension[] - */ - public function getDynamicFunctionReturnTypeExtensions(): array - { - return []; - } - - /** - * @return \PHPStan\Type\OperatorTypeSpecifyingExtension[] - */ - public function getOperatorTypeSpecifyingExtensions(): array - { - return []; - } - - /** - * @param \PhpParser\PrettyPrinter\Standard $printer - * @param \PHPStan\Broker\Broker $broker - * @param \PHPStan\Type\MethodTypeSpecifyingExtension[] $methodTypeSpecifyingExtensions - * @param \PHPStan\Type\StaticMethodTypeSpecifyingExtension[] $staticMethodTypeSpecifyingExtensions - * @return \PHPStan\Analyser\TypeSpecifier - */ - public function createTypeSpecifier( - Standard $printer, - Broker $broker, - array $methodTypeSpecifyingExtensions = [], - array $staticMethodTypeSpecifyingExtensions = [] - ): TypeSpecifier - { - $tagToService = static function (array $tags) { - return array_map(static function (string $serviceName) { - return self::getContainer()->getService($serviceName); - }, array_keys($tags)); - }; - - return new TypeSpecifier( - $printer, - $broker, - $tagToService(self::getContainer()->findByTag(TypeSpecifierFactory::FUNCTION_TYPE_SPECIFYING_EXTENSION_TAG)), - $methodTypeSpecifyingExtensions, - $staticMethodTypeSpecifyingExtensions - ); - } - - public function getFileHelper(): FileHelper - { - return self::getContainer()->getByType(FileHelper::class); - } - - protected function skipIfNotOnWindows(): void - { - if (DIRECTORY_SEPARATOR === '\\') { - return; - } - - self::markTestSkipped(); - } - - protected function skipIfNotOnUnix(): void - { - if (DIRECTORY_SEPARATOR === '/') { - return; - } - - self::markTestSkipped(); - } - -} diff --git a/vendor/phpstan/phpstan/src/TrinaryLogic.php b/vendor/phpstan/phpstan/src/TrinaryLogic.php deleted file mode 100644 index 41aa5a8..0000000 --- a/vendor/phpstan/phpstan/src/TrinaryLogic.php +++ /dev/null @@ -1,148 +0,0 @@ -value = $value; - } - - public static function createYes(): self - { - return self::create(self::YES); - } - - public static function createNo(): self - { - return self::create(self::NO); - } - - public static function createMaybe(): self - { - return self::create(self::MAYBE); - } - - public static function createFromBoolean(bool $value): self - { - return self::create($value ? self::YES : self::NO); - } - - private static function create(int $value): self - { - self::$registry[$value] = self::$registry[$value] ?? new self($value); - return self::$registry[$value]; - } - - public function yes(): bool - { - return $this->value === self::YES; - } - - public function maybe(): bool - { - return $this->value === self::MAYBE; - } - - public function no(): bool - { - return $this->value === self::NO; - } - - public function toBooleanType(): BooleanType - { - if ($this->value === self::MAYBE) { - return new BooleanType(); - } - - return new ConstantBooleanType($this->value === self::YES); - } - - public function and(self ...$operands): self - { - $operandValues = array_column($operands, 'value'); - $operandValues[] = $this->value; - return self::create(min($operandValues)); - } - - public function or(self ...$operands): self - { - $operandValues = array_column($operands, 'value'); - $operandValues[] = $this->value; - return self::create(max($operandValues)); - } - - public static function extremeIdentity(self ...$operands): self - { - $operandValues = array_column($operands, 'value'); - $min = min($operandValues); - $max = max($operandValues); - return self::create($min === $max ? $min : self::MAYBE); - } - - public static function maxMin(self ...$operands): self - { - $operandValues = array_column($operands, 'value'); - return self::create(max($operandValues) > 0 ? max($operandValues) : min($operandValues)); - } - - public function negate(): self - { - return self::create(-$this->value); - } - - public function equals(self $other): bool - { - return $this === $other; - } - - public function compareTo(self $other): ?self - { - if ($this->value > $other->value) { - return $this; - } elseif ($other->value > $this->value) { - return $other; - } - - return null; - } - - public function describe(): string - { - static $labels = [ - self::NO => 'No', - self::MAYBE => 'Maybe', - self::YES => 'Yes', - ]; - - return $labels[$this->value]; - } - - /** - * @param mixed[] $properties - * @return self - */ - public static function __set_state(array $properties): self - { - return self::create($properties['value']); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Accessory/AccessoryType.php b/vendor/phpstan/phpstan/src/Type/Accessory/AccessoryType.php deleted file mode 100644 index 734ee43..0000000 --- a/vendor/phpstan/phpstan/src/Type/Accessory/AccessoryType.php +++ /dev/null @@ -1,10 +0,0 @@ -methodName = $methodName; - } - - public function getReferencedClasses(): array - { - return []; - } - - private function getCanonicalMethodName(): string - { - return strtolower($this->methodName); - } - - public function accepts(Type $type, bool $strictTypes): TrinaryLogic - { - return TrinaryLogic::createFromBoolean($this->equals($type)); - } - - public function isSuperTypeOf(Type $type): TrinaryLogic - { - return $type->hasMethod($this->methodName); - } - - public function isSubTypeOf(Type $otherType): TrinaryLogic - { - if ($otherType instanceof UnionType || $otherType instanceof IntersectionType) { - return $otherType->isSuperTypeOf($this); - } - - if ($otherType instanceof self) { - $limit = TrinaryLogic::createYes(); - } else { - $limit = TrinaryLogic::createMaybe(); - } - - return $limit->and($otherType->hasMethod($this->methodName)); - } - - public function isAcceptedBy(Type $acceptingType, bool $strictTypes): TrinaryLogic - { - return $this->isSubTypeOf($acceptingType); - } - - public function equals(Type $type): bool - { - return $type instanceof self - && $this->getCanonicalMethodName() === $type->getCanonicalMethodName(); - } - - public function describe(\PHPStan\Type\VerbosityLevel $level): string - { - return sprintf('hasMethod(%s)', $this->methodName); - } - - public function hasMethod(string $methodName): TrinaryLogic - { - if ($this->getCanonicalMethodName() === strtolower($methodName)) { - return TrinaryLogic::createYes(); - } - - return TrinaryLogic::createMaybe(); - } - - public function getMethod(string $methodName, ClassMemberAccessAnswerer $scope): MethodReflection - { - return new DummyMethodReflection($this->methodName); - } - - public function isCallable(): TrinaryLogic - { - if ($this->getCanonicalMethodName() === '__invoke') { - return TrinaryLogic::createYes(); - } - - return TrinaryLogic::createMaybe(); - } - - public function getCallableParametersAcceptors(ClassMemberAccessAnswerer $scope): array - { - return [ - new TrivialParametersAcceptor(), - ]; - } - - public function traverse(callable $cb): Type - { - return $this; - } - - public static function __set_state(array $properties): Type - { - return new self($properties['methodName']); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Accessory/HasOffsetType.php b/vendor/phpstan/phpstan/src/Type/Accessory/HasOffsetType.php deleted file mode 100644 index 4a8b24a..0000000 --- a/vendor/phpstan/phpstan/src/Type/Accessory/HasOffsetType.php +++ /dev/null @@ -1,157 +0,0 @@ -offsetType = $offsetType; - } - - public function getReferencedClasses(): array - { - return []; - } - - public function accepts(Type $type, bool $strictTypes): TrinaryLogic - { - if ($type instanceof CompoundType) { - return CompoundTypeHelper::accepts($type, $this, $strictTypes); - } - - return $type->isOffsetAccessible() - ->and($type->hasOffsetValueType($this->offsetType)); - } - - public function isSuperTypeOf(Type $type): TrinaryLogic - { - if ($this->equals($type)) { - return TrinaryLogic::createYes(); - } - return $type->isOffsetAccessible() - ->and($type->hasOffsetValueType($this->offsetType)); - } - - public function isSubTypeOf(Type $otherType): TrinaryLogic - { - if ($otherType instanceof UnionType || $otherType instanceof IntersectionType) { - return $otherType->isSuperTypeOf($this); - } - - return $otherType->isOffsetAccessible() - ->and($otherType->hasOffsetValueType($this->offsetType)) - ->and($otherType instanceof self ? TrinaryLogic::createYes() : TrinaryLogic::createMaybe()); - } - - public function isAcceptedBy(Type $acceptingType, bool $strictTypes): TrinaryLogic - { - return $this->isSubTypeOf($acceptingType); - } - - public function equals(Type $type): bool - { - return $type instanceof self - && $this->offsetType->equals($type->offsetType); - } - - public function describe(\PHPStan\Type\VerbosityLevel $level): string - { - return sprintf('hasOffset(%s)', $this->offsetType->describe($level)); - } - - public function isOffsetAccessible(): TrinaryLogic - { - return TrinaryLogic::createYes(); - } - - public function hasOffsetValueType(Type $offsetType): TrinaryLogic - { - if ($offsetType instanceof ConstantScalarType && $offsetType->equals($this->offsetType)) { - return TrinaryLogic::createYes(); - } - - return TrinaryLogic::createMaybe(); - } - - public function getOffsetValueType(Type $offsetType): Type - { - return new MixedType(); - } - - public function setOffsetValueType(?Type $offsetType, Type $valueType): Type - { - return $this; - } - - public function isIterableAtLeastOnce(): TrinaryLogic - { - return TrinaryLogic::createYes(); - } - - public function isArray(): TrinaryLogic - { - return TrinaryLogic::createMaybe(); - } - - public function toNumber(): Type - { - return new ErrorType(); - } - - public function toInteger(): Type - { - return new ErrorType(); - } - - public function toFloat(): Type - { - return new ErrorType(); - } - - public function toString(): Type - { - return new ErrorType(); - } - - public function toArray(): Type - { - return new MixedType(); - } - - public function traverse(callable $cb): Type - { - return $this; - } - - public static function __set_state(array $properties): Type - { - return new self($properties['offsetType']); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Accessory/HasPropertyType.php b/vendor/phpstan/phpstan/src/Type/Accessory/HasPropertyType.php deleted file mode 100644 index 4e26cb4..0000000 --- a/vendor/phpstan/phpstan/src/Type/Accessory/HasPropertyType.php +++ /dev/null @@ -1,107 +0,0 @@ -propertyName = $propertyName; - } - - /** - * @return string[] - */ - public function getReferencedClasses(): array - { - return []; - } - - public function getPropertyName(): string - { - return $this->propertyName; - } - - public function accepts(Type $type, bool $strictTypes): TrinaryLogic - { - return TrinaryLogic::createFromBoolean($this->equals($type)); - } - - public function isSuperTypeOf(Type $type): TrinaryLogic - { - return $type->hasProperty($this->propertyName); - } - - public function isSubTypeOf(Type $otherType): TrinaryLogic - { - if ($otherType instanceof UnionType || $otherType instanceof IntersectionType) { - return $otherType->isSuperTypeOf($this); - } - - if ($otherType instanceof self) { - $limit = TrinaryLogic::createYes(); - } else { - $limit = TrinaryLogic::createMaybe(); - } - - return $limit->and($otherType->hasProperty($this->propertyName)); - } - - public function isAcceptedBy(Type $acceptingType, bool $strictTypes): TrinaryLogic - { - return $this->isSubTypeOf($acceptingType); - } - - public function equals(Type $type): bool - { - return $type instanceof self - && $this->propertyName === $type->propertyName; - } - - public function describe(\PHPStan\Type\VerbosityLevel $level): string - { - return sprintf('hasProperty(%s)', $this->propertyName); - } - - public function hasProperty(string $propertyName): TrinaryLogic - { - if ($this->propertyName === $propertyName) { - return TrinaryLogic::createYes(); - } - - return TrinaryLogic::createMaybe(); - } - - public function getCallableParametersAcceptors(ClassMemberAccessAnswerer $scope): array - { - return [new TrivialParametersAcceptor()]; - } - - public function traverse(callable $cb): Type - { - return $this; - } - - public static function __set_state(array $properties): Type - { - return new self($properties['propertyName']); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Accessory/NonEmptyArrayType.php b/vendor/phpstan/phpstan/src/Type/Accessory/NonEmptyArrayType.php deleted file mode 100644 index 6a0b9c1..0000000 --- a/vendor/phpstan/phpstan/src/Type/Accessory/NonEmptyArrayType.php +++ /dev/null @@ -1,161 +0,0 @@ -isSuperTypeOf($type) - ->and($type->isIterableAtLeastOnce()); - } - - public function isSuperTypeOf(Type $type): TrinaryLogic - { - if ($this->equals($type)) { - return TrinaryLogic::createYes(); - } - - return (new ArrayType(new MixedType(), new MixedType())) - ->isSuperTypeOf($type) - ->and($type->isIterableAtLeastOnce()); - } - - public function isSubTypeOf(Type $otherType): TrinaryLogic - { - if ($otherType instanceof UnionType || $otherType instanceof IntersectionType) { - return $otherType->isSuperTypeOf($this); - } - - return (new ArrayType(new MixedType(), new MixedType())) - ->isSuperTypeOf($otherType) - ->and($otherType->isIterableAtLeastOnce()) - ->and($otherType instanceof self ? TrinaryLogic::createYes() : TrinaryLogic::createMaybe()); - } - - public function isAcceptedBy(Type $acceptingType, bool $strictTypes): TrinaryLogic - { - return $this->isSubTypeOf($acceptingType); - } - - public function equals(Type $type): bool - { - return $type instanceof self; - } - - public function describe(\PHPStan\Type\VerbosityLevel $level): string - { - return 'nonEmpty'; - } - - public function isOffsetAccessible(): TrinaryLogic - { - return TrinaryLogic::createYes(); - } - - public function hasOffsetValueType(Type $offsetType): TrinaryLogic - { - return TrinaryLogic::createMaybe(); - } - - public function getOffsetValueType(Type $offsetType): Type - { - return new MixedType(); - } - - public function setOffsetValueType(?Type $offsetType, Type $valueType): Type - { - return $this; - } - - public function isIterable(): TrinaryLogic - { - return TrinaryLogic::createYes(); - } - - public function isIterableAtLeastOnce(): TrinaryLogic - { - return TrinaryLogic::createYes(); - } - - public function getIterableKeyType(): Type - { - return new MixedType(); - } - - public function getIterableValueType(): Type - { - return new MixedType(); - } - - public function isArray(): TrinaryLogic - { - return TrinaryLogic::createYes(); - } - - public function toNumber(): Type - { - return new ErrorType(); - } - - public function toInteger(): Type - { - return new ErrorType(); - } - - public function toFloat(): Type - { - return new ErrorType(); - } - - public function toString(): Type - { - return new ErrorType(); - } - - public function toArray(): Type - { - return new MixedType(); - } - - public function traverse(callable $cb): Type - { - return $this; - } - - public static function __set_state(array $properties): Type - { - return new self(); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/ArrayType.php b/vendor/phpstan/phpstan/src/Type/ArrayType.php deleted file mode 100644 index 9caa1cc..0000000 --- a/vendor/phpstan/phpstan/src/Type/ArrayType.php +++ /dev/null @@ -1,349 +0,0 @@ -describe(VerbosityLevel::value()) === '(int|string)') { - $keyType = new MixedType(); - } - $this->keyType = $keyType; - $this->itemType = $itemType; - } - - public function getKeyType(): Type - { - return $this->keyType; - } - - public function getItemType(): Type - { - return $this->itemType; - } - - /** - * @return string[] - */ - public function getReferencedClasses(): array - { - return array_merge( - $this->keyType->getReferencedClasses(), - $this->getItemType()->getReferencedClasses() - ); - } - - public function accepts(Type $type, bool $strictTypes): TrinaryLogic - { - $arrays = TypeUtils::getArrays($type); - if (count($arrays) > 0) { - $result = TrinaryLogic::createYes(); - foreach ($arrays as $array) { - $result = $result - ->and($this->getItemType()->accepts($array->getItemType(), $strictTypes)) - ->and($this->keyType->accepts($array->keyType, $strictTypes)); - } - - return $result; - } - - if ($type instanceof CompoundType) { - return CompoundTypeHelper::accepts($type, $this, $strictTypes); - } - - return TrinaryLogic::createNo(); - } - - public function isSuperTypeOf(Type $type): TrinaryLogic - { - if ($type instanceof self) { - return $this->getItemType()->isSuperTypeOf($type->getItemType()) - ->and($this->keyType->isSuperTypeOf($type->keyType)); - } - - if ($type instanceof CompoundType) { - return $type->isSubTypeOf($this); - } - - return TrinaryLogic::createNo(); - } - - public function equals(Type $type): bool - { - return $type instanceof self - && $this->getItemType()->equals($type->getItemType()) - && $this->keyType->equals($type->keyType); - } - - public function describe(VerbosityLevel $level): string - { - $isMixedKeyType = $this->keyType instanceof MixedType && !$this->keyType instanceof TemplateType; - $isMixedItemType = $this->itemType instanceof MixedType && !$this->itemType instanceof TemplateType; - - if ($isMixedKeyType || $this->keyType instanceof NeverType) { - if ($isMixedItemType || $this->itemType instanceof NeverType) { - return 'array'; - } - - return sprintf('array<%s>', $this->itemType->describe($level)); - } - - return sprintf('array<%s, %s>', $this->keyType->describe($level), $this->itemType->describe($level)); - } - - public function generalizeValues(): self - { - return new self($this->keyType, TypeUtils::generalizeType($this->itemType)); - } - - public function getKeysArray(): self - { - return new self(new IntegerType(), $this->keyType); - } - - public function getValuesArray(): self - { - return new self(new IntegerType(), $this->itemType); - } - - public function resolveStatic(string $className): Type - { - if ($this->getItemType() instanceof StaticResolvableType) { - return new self( - $this->keyType, - $this->getItemType()->resolveStatic($className) - ); - } - - return $this; - } - - public function changeBaseClass(string $className): StaticResolvableType - { - if ($this->getItemType() instanceof StaticResolvableType) { - return new self( - $this->keyType, - $this->getItemType()->changeBaseClass($className) - ); - } - - return $this; - } - - public function isIterable(): TrinaryLogic - { - return TrinaryLogic::createYes(); - } - - public function isIterableAtLeastOnce(): TrinaryLogic - { - return TrinaryLogic::createMaybe(); - } - - public function getIterableKeyType(): Type - { - $keyType = $this->keyType; - if ($keyType instanceof MixedType) { - return new BenevolentUnionType([new IntegerType(), new StringType()]); - } - - return $keyType; - } - - public function getIterableValueType(): Type - { - return $this->getItemType(); - } - - public function isArray(): TrinaryLogic - { - return TrinaryLogic::createYes(); - } - - public function isOffsetAccessible(): TrinaryLogic - { - return TrinaryLogic::createYes(); - } - - public function hasOffsetValueType(Type $offsetType): TrinaryLogic - { - $offsetType = self::castToArrayKeyType($offsetType); - if ($this->getKeyType()->isSuperTypeOf($offsetType)->no()) { - return TrinaryLogic::createNo(); - } - - return TrinaryLogic::createMaybe(); - } - - public function getOffsetValueType(Type $offsetType): Type - { - $offsetType = self::castToArrayKeyType($offsetType); - if ($this->getKeyType()->isSuperTypeOf($offsetType)->no()) { - return new ErrorType(); - } - - $type = $this->getItemType(); - if ($type instanceof ErrorType) { - return new MixedType(); - } - - return $type; - } - - public function setOffsetValueType(?Type $offsetType, Type $valueType): Type - { - if ($offsetType === null) { - $offsetType = new IntegerType(); - } - - return new ArrayType( - TypeCombinator::union($this->keyType, self::castToArrayKeyType($offsetType)), - TypeCombinator::union($this->itemType, $valueType) - ); - } - - public function isCallable(): TrinaryLogic - { - return TrinaryLogic::createMaybe()->and((new StringType())->isSuperTypeOf($this->itemType)); - } - - /** - * @param \PHPStan\Reflection\ClassMemberAccessAnswerer $scope - * @return \PHPStan\Reflection\ParametersAcceptor[] - */ - public function getCallableParametersAcceptors(ClassMemberAccessAnswerer $scope): array - { - if ($this->isCallable()->no()) { - throw new \PHPStan\ShouldNotHappenException(); - } - - return [new TrivialParametersAcceptor()]; - } - - public function toNumber(): Type - { - return new ErrorType(); - } - - public function toString(): Type - { - return new ErrorType(); - } - - public function toInteger(): Type - { - return new ErrorType(); - } - - public function toFloat(): Type - { - return new ErrorType(); - } - - public function toArray(): Type - { - return $this; - } - - public function count(): Type - { - return new IntegerType(); - } - - public static function castToArrayKeyType(Type $offsetType): Type - { - if ($offsetType instanceof UnionType) { - return TypeCombinator::union(...array_map(static function (Type $type): Type { - return self::castToArrayKeyType($type); - }, $offsetType->getTypes())); - } - - if ($offsetType instanceof ConstantScalarType) { - /** @var int|string $offsetValue */ - $offsetValue = key([$offsetType->getValue() => null]); - return is_int($offsetValue) ? new ConstantIntegerType($offsetValue) : new ConstantStringType($offsetValue); - } - - if ($offsetType instanceof IntegerType || $offsetType instanceof FloatType || $offsetType instanceof BooleanType) { - return new IntegerType(); - } - - if ($offsetType instanceof StringType) { - return new StringType(); - } - - return new UnionType([new IntegerType(), new StringType()]); - } - - public function inferTemplateTypes(Type $receivedType): TemplateTypeMap - { - if ($receivedType instanceof UnionType || $receivedType instanceof IntersectionType) { - return $receivedType->inferTemplateTypesOn($this); - } - - if ( - $receivedType instanceof ArrayType - && !$this->getKeyType()->isSuperTypeOf($receivedType->getKeyType())->no() - && !$this->getItemType()->isSuperTypeOf($receivedType->getItemType())->no() - ) { - $receivedKey = $receivedType->getKeyType(); - $receivedItem = $receivedType->getItemType(); - } else { - $receivedKey = new NeverType(); - $receivedItem = new NeverType(); - } - - $keyTypeMap = $this->getKeyType()->inferTemplateTypes($receivedKey); - $itemTypeMap = $this->getItemType()->inferTemplateTypes($receivedItem); - - return $keyTypeMap->union($itemTypeMap); - } - - public function traverse(callable $cb): Type - { - $keyType = $cb($this->keyType); - $itemType = $cb($this->itemType); - - if ($keyType !== $this->keyType || $itemType !== $this->itemType) { - return new self($keyType, $itemType); - } - - return $this; - } - - /** - * @param mixed[] $properties - * @return Type - */ - public static function __set_state(array $properties): Type - { - return new self( - $properties['keyType'], - $properties['itemType'] - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/BenevolentUnionType.php b/vendor/phpstan/phpstan/src/Type/BenevolentUnionType.php deleted file mode 100644 index 6530139..0000000 --- a/vendor/phpstan/phpstan/src/Type/BenevolentUnionType.php +++ /dev/null @@ -1,45 +0,0 @@ -getTypes() as $type) { - $result = $getType($type); - if ($result instanceof ErrorType) { - continue; - } - - $resultTypes[] = $result; - } - - if (count($resultTypes) === 0) { - return new ErrorType(); - } - - return TypeCombinator::union(...$resultTypes); - } - - public function isAcceptedBy(Type $acceptingType, bool $strictTypes): TrinaryLogic - { - foreach ($this->getTypes() as $innerType) { - if ($acceptingType->accepts($innerType, $strictTypes)->yes()) { - return TrinaryLogic::createYes(); - } - } - - return TrinaryLogic::createNo(); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/BooleanType.php b/vendor/phpstan/phpstan/src/Type/BooleanType.php deleted file mode 100644 index 2056180..0000000 --- a/vendor/phpstan/phpstan/src/Type/BooleanType.php +++ /dev/null @@ -1,98 +0,0 @@ -toInteger(); - } - - public function toString(): Type - { - return TypeCombinator::union( - new ConstantStringType(''), - new ConstantStringType('1') - ); - } - - public function toInteger(): Type - { - return TypeCombinator::union( - new ConstantIntegerType(0), - new ConstantIntegerType(1) - ); - } - - public function toFloat(): Type - { - return TypeCombinator::union( - new ConstantFloatType(0.0), - new ConstantFloatType(1.0) - ); - } - - public function toArray(): Type - { - return new ConstantArrayType( - [new ConstantIntegerType(0)], - [$this], - 1 - ); - } - - public function isOffsetAccessible(): TrinaryLogic - { - return TrinaryLogic::createYes(); - } - - public function hasOffsetValueType(Type $offsetType): TrinaryLogic - { - return TrinaryLogic::createYes(); - } - - public function getOffsetValueType(Type $offsetType): Type - { - return new NullType(); - } - - public function setOffsetValueType(?Type $offsetType, Type $valueType): Type - { - return new ErrorType(); - } - - /** - * @param mixed[] $properties - * @return Type - */ - public static function __set_state(array $properties): Type - { - return new self(); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/CallableType.php b/vendor/phpstan/phpstan/src/Type/CallableType.php deleted file mode 100644 index b2a77a5..0000000 --- a/vendor/phpstan/phpstan/src/Type/CallableType.php +++ /dev/null @@ -1,279 +0,0 @@ - */ - private $parameters; - - /** @var Type */ - private $returnType; - - /** @var bool */ - private $variadic; - - /** @var bool */ - private $isCommonCallable; - - /** - * @param array $parameters - * @param Type $returnType - * @param bool $variadic - */ - public function __construct( - ?array $parameters = null, - ?Type $returnType = null, - bool $variadic = true - ) - { - $this->parameters = $parameters ?? []; - $this->returnType = $returnType ?? new MixedType(); - $this->variadic = $variadic; - $this->isCommonCallable = $parameters === null && $returnType === null; - } - - /** - * @return string[] - */ - public function getReferencedClasses(): array - { - return []; - } - - public function accepts(Type $type, bool $strictTypes): TrinaryLogic - { - if ($type instanceof CompoundType && !$type instanceof self) { - return CompoundTypeHelper::accepts($type, $this, $strictTypes); - } - - return $this->isSuperTypeOfInternal($type, true); - } - - public function isSuperTypeOf(Type $type): TrinaryLogic - { - return $this->isSuperTypeOfInternal($type, false); - } - - private function isSuperTypeOfInternal(Type $type, bool $treatMixedAsAny): TrinaryLogic - { - $isCallable = $type->isCallable(); - if ($isCallable->no() || $this->isCommonCallable) { - return $isCallable; - } - - static $scope; - if ($scope === null) { - $scope = new OutOfClassScope(); - } - - $variantsResult = null; - foreach ($type->getCallableParametersAcceptors($scope) as $variant) { - $isSuperType = CallableTypeHelper::isParametersAcceptorSuperTypeOf($this, $variant, $treatMixedAsAny); - if ($variantsResult === null) { - $variantsResult = $isSuperType; - } else { - $variantsResult = $variantsResult->or($isSuperType); - } - } - - if ($variantsResult === null) { - throw new \PHPStan\ShouldNotHappenException(); - } - - return $isCallable->and($variantsResult); - } - - public function isSubTypeOf(Type $otherType): TrinaryLogic - { - if ($otherType instanceof IntersectionType || $otherType instanceof UnionType) { - return $otherType->isSuperTypeOf($this); - } - - return $otherType->isCallable() - ->and($otherType instanceof self ? TrinaryLogic::createYes() : TrinaryLogic::createMaybe()); - } - - public function isAcceptedBy(Type $acceptingType, bool $strictTypes): TrinaryLogic - { - return $this->isSubTypeOf($acceptingType); - } - - public function equals(Type $type): bool - { - return $type instanceof self; - } - - public function describe(VerbosityLevel $level): string - { - return $level->handle( - static function (): string { - return 'callable'; - }, - function () use ($level): string { - return sprintf( - 'callable(%s): %s', - implode(', ', array_map( - static function (NativeParameterReflection $param) use ($level): string { - return $param->getType()->describe($level); - }, - $this->getParameters() - )), - $this->returnType->describe($level) - ); - } - ); - } - - public function isCallable(): TrinaryLogic - { - return TrinaryLogic::createYes(); - } - - /** - * @param \PHPStan\Reflection\ClassMemberAccessAnswerer $scope - * @return \PHPStan\Reflection\ParametersAcceptor[] - */ - public function getCallableParametersAcceptors(ClassMemberAccessAnswerer $scope): array - { - return [$this]; - } - - public function toNumber(): Type - { - return new ErrorType(); - } - - public function toString(): Type - { - return new ErrorType(); - } - - public function toInteger(): Type - { - return new ErrorType(); - } - - public function toFloat(): Type - { - return new ErrorType(); - } - - public function toArray(): Type - { - return new ArrayType(new MixedType(), new MixedType()); - } - - /** - * @return array - */ - public function getParameters(): array - { - return $this->parameters; - } - - public function isVariadic(): bool - { - return $this->variadic; - } - - public function getReturnType(): Type - { - return $this->returnType; - } - - public function inferTemplateTypes(Type $receivedType): TemplateTypeMap - { - if ($receivedType instanceof UnionType || $receivedType instanceof IntersectionType) { - return $receivedType->inferTemplateTypesOn($this); - } - - if ($receivedType->isCallable()->no()) { - return TemplateTypeMap::empty(); - } - - $parametersAcceptors = $receivedType->getCallableParametersAcceptors(new OutOfClassScope()); - - $typeMap = TemplateTypeMap::empty(); - - foreach ($parametersAcceptors as $parametersAcceptor) { - $typeMap = $typeMap->union($this->inferTemplateTypesOnParametersAcceptor($receivedType, $parametersAcceptor)); - } - - return $typeMap; - } - - private function inferTemplateTypesOnParametersAcceptor(Type $receivedType, ParametersAcceptor $parametersAcceptor): TemplateTypeMap - { - $typeMap = TemplateTypeMap::empty(); - $args = $parametersAcceptor->getParameters(); - $returnType = $parametersAcceptor->getReturnType(); - - foreach ($this->getParameters() as $i => $param) { - $argType = isset($args[$i]) ? $args[$i]->getType() : new NeverType(); - $paramType = $param->getType(); - $typeMap = $typeMap->union($paramType->inferTemplateTypes($argType)); - } - - return $typeMap->union($this->getReturnType()->inferTemplateTypes($returnType)); - } - - public function traverse(callable $cb): Type - { - if ($this->isCommonCallable) { - return $this; - } - - $parameters = array_map(static function (NativeParameterReflection $param) use ($cb): NativeParameterReflection { - return new NativeParameterReflection( - $param->getName(), - $param->isOptional(), - $cb($param->getType()), - $param->passedByReference(), - $param->isVariadic() - ); - }, $this->getParameters()); - - return new self( - $parameters, - $cb($this->getReturnType()), - $this->isVariadic() - ); - } - - public function isArray(): TrinaryLogic - { - return TrinaryLogic::createMaybe(); - } - - /** - * @param mixed[] $properties - * @return Type - */ - public static function __set_state(array $properties): Type - { - return new self( - (bool) $properties['isCommonCallable'] ? null : $properties['parameters'], - (bool) $properties['isCommonCallable'] ? null : $properties['returnType'], - $properties['variadic'] - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/CallableTypeHelper.php b/vendor/phpstan/phpstan/src/Type/CallableTypeHelper.php deleted file mode 100644 index aac31ef..0000000 --- a/vendor/phpstan/phpstan/src/Type/CallableTypeHelper.php +++ /dev/null @@ -1,59 +0,0 @@ -getParameters(); - $ourParameters = $ours->getParameters(); - - $result = null; - foreach ($theirParameters as $i => $theirParameter) { - if (!isset($ourParameters[$i])) { - if ($theirParameter->isOptional()) { - continue; - } - - return TrinaryLogic::createNo(); - } - - $ourParameter = $ourParameters[$i]; - $ourParameterType = $ourParameter->getType(); - if ($treatMixedAsAny && $ourParameterType instanceof MixedType) { - $isSuperType = TrinaryLogic::createYes(); - } else { - $isSuperType = $theirParameter->getType()->isSuperTypeOf($ourParameterType); - } - if ($result === null) { - $result = $isSuperType; - } else { - $result = $result->and($isSuperType); - } - } - - $theirReturnType = $theirs->getReturnType(); - if ($treatMixedAsAny && $theirReturnType instanceof MixedType) { - $isReturnTypeSuperType = TrinaryLogic::createYes(); - } else { - $isReturnTypeSuperType = $ours->getReturnType()->isSuperTypeOf($theirReturnType); - } - if ($result === null) { - $result = $isReturnTypeSuperType; - } else { - $result = $result->and($isReturnTypeSuperType); - } - - return $result; - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/ClosureType.php b/vendor/phpstan/phpstan/src/Type/ClosureType.php deleted file mode 100644 index 46dc547..0000000 --- a/vendor/phpstan/phpstan/src/Type/ClosureType.php +++ /dev/null @@ -1,319 +0,0 @@ - */ - private $parameters; - - /** @var Type */ - private $returnType; - - /** @var bool */ - private $variadic; - - /** - * @param array $parameters - * @param Type $returnType - * @param bool $variadic - */ - public function __construct( - array $parameters, - Type $returnType, - bool $variadic - ) - { - $this->objectType = new ObjectType(\Closure::class); - $this->parameters = $parameters; - $this->returnType = $returnType; - $this->variadic = $variadic; - } - - public function getClassName(): string - { - return $this->objectType->getClassName(); - } - - /** - * @return string[] - */ - public function getReferencedClasses(): array - { - $classes = $this->objectType->getReferencedClasses(); - foreach ($this->parameters as $parameter) { - $classes = array_merge($classes, $parameter->getType()->getReferencedClasses()); - } - - return array_merge($classes, $this->returnType->getReferencedClasses()); - } - - public function accepts(Type $type, bool $strictTypes): TrinaryLogic - { - if ($type instanceof CompoundType) { - return CompoundTypeHelper::accepts($type, $this, $strictTypes); - } - - if (!$type instanceof ClosureType) { - return $this->objectType->accepts($type, $strictTypes); - } - - return $this->isSuperTypeOfInternal($type, true); - } - - public function isSuperTypeOf(Type $type): TrinaryLogic - { - return $this->isSuperTypeOfInternal($type, false); - } - - private function isSuperTypeOfInternal(Type $type, bool $treatMixedAsAny): TrinaryLogic - { - if ($type instanceof self) { - return CallableTypeHelper::isParametersAcceptorSuperTypeOf( - $this, - $type, - $treatMixedAsAny - ); - } - - if ( - $type instanceof TypeWithClassName - && $type->getClassName() === \Closure::class - ) { - return TrinaryLogic::createMaybe(); - } - - return $this->objectType->isSuperTypeOf($type); - } - - public function equals(Type $type): bool - { - if (!$type instanceof self) { - return false; - } - - return $this->returnType->equals($type->returnType); - } - - public function describe(VerbosityLevel $level): string - { - return sprintf( - 'Closure(%s): %s', - implode(', ', array_map(static function (ParameterReflection $parameter) use ($level): string { - return $parameter->getType()->describe($level); - }, $this->parameters)), - $this->returnType->describe($level) - ); - } - - public function canAccessProperties(): TrinaryLogic - { - return $this->objectType->canAccessProperties(); - } - - public function hasProperty(string $propertyName): TrinaryLogic - { - return $this->objectType->hasProperty($propertyName); - } - - public function getProperty(string $propertyName, ClassMemberAccessAnswerer $scope): PropertyReflection - { - return $this->objectType->getProperty($propertyName, $scope); - } - - public function canCallMethods(): TrinaryLogic - { - return $this->objectType->canCallMethods(); - } - - public function hasMethod(string $methodName): TrinaryLogic - { - return $this->objectType->hasMethod($methodName); - } - - public function getMethod(string $methodName, ClassMemberAccessAnswerer $scope): MethodReflection - { - return $this->objectType->getMethod($methodName, $scope); - } - - public function canAccessConstants(): TrinaryLogic - { - return $this->objectType->canAccessConstants(); - } - - public function hasConstant(string $constantName): TrinaryLogic - { - return $this->objectType->hasConstant($constantName); - } - - public function getConstant(string $constantName): ConstantReflection - { - return $this->objectType->getConstant($constantName); - } - - public function isIterable(): TrinaryLogic - { - return TrinaryLogic::createNo(); - } - - public function isIterableAtLeastOnce(): TrinaryLogic - { - return TrinaryLogic::createNo(); - } - - public function getIterableKeyType(): Type - { - return new ErrorType(); - } - - public function getIterableValueType(): Type - { - return new ErrorType(); - } - - public function isOffsetAccessible(): TrinaryLogic - { - return TrinaryLogic::createNo(); - } - - public function hasOffsetValueType(Type $offsetType): TrinaryLogic - { - return TrinaryLogic::createNo(); - } - - public function getOffsetValueType(Type $offsetType): Type - { - return new ErrorType(); - } - - public function setOffsetValueType(?Type $offsetType, Type $valueType): Type - { - return new ErrorType(); - } - - public function isCallable(): TrinaryLogic - { - return TrinaryLogic::createYes(); - } - - /** - * @param \PHPStan\Reflection\ClassMemberAccessAnswerer $scope - * @return \PHPStan\Reflection\ParametersAcceptor[] - */ - public function getCallableParametersAcceptors(ClassMemberAccessAnswerer $scope): array - { - return [$this]; - } - - public function isCloneable(): TrinaryLogic - { - return TrinaryLogic::createYes(); - } - - public function toBoolean(): BooleanType - { - return new ConstantBooleanType(true); - } - - public function toNumber(): Type - { - return new ErrorType(); - } - - public function toInteger(): Type - { - return new ErrorType(); - } - - public function toFloat(): Type - { - return new ErrorType(); - } - - public function toString(): Type - { - return new ErrorType(); - } - - public function toArray(): Type - { - return new ConstantArrayType( - [new ConstantIntegerType(0)], - [$this], - 1 - ); - } - - /** - * @return array - */ - public function getParameters(): array - { - return $this->parameters; - } - - public function isVariadic(): bool - { - return $this->variadic; - } - - public function getReturnType(): Type - { - return $this->returnType; - } - - public function traverse(callable $cb): Type - { - return new self( - array_map(static function (NativeParameterReflection $param) use ($cb): NativeParameterReflection { - return new NativeParameterReflection( - $param->getName(), - $param->isOptional(), - $cb($param->getType()), - $param->passedByReference(), - $param->isVariadic() - ); - }, $this->getParameters()), - $cb($this->getReturnType()), - $this->isVariadic() - ); - } - - public function isArray(): TrinaryLogic - { - return TrinaryLogic::createNo(); - } - - /** - * @param mixed[] $properties - * @return Type - */ - public static function __set_state(array $properties): Type - { - return new self( - $properties['parameters'], - $properties['returnType'], - $properties['variadic'] - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/CommentHelper.php b/vendor/phpstan/phpstan/src/Type/CommentHelper.php deleted file mode 100644 index 7681e75..0000000 --- a/vendor/phpstan/phpstan/src/Type/CommentHelper.php +++ /dev/null @@ -1,20 +0,0 @@ -getDocComment(); - if ($phpDoc !== null) { - return $phpDoc->getText(); - } - - return null; - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/CompoundType.php b/vendor/phpstan/phpstan/src/Type/CompoundType.php deleted file mode 100644 index 7513e3d..0000000 --- a/vendor/phpstan/phpstan/src/Type/CompoundType.php +++ /dev/null @@ -1,14 +0,0 @@ -isAcceptedBy($otherType, $strictTypes); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Constant/ConstantArrayType.php b/vendor/phpstan/phpstan/src/Type/Constant/ConstantArrayType.php deleted file mode 100644 index 18862bb..0000000 --- a/vendor/phpstan/phpstan/src/Type/Constant/ConstantArrayType.php +++ /dev/null @@ -1,583 +0,0 @@ - */ - private $keyTypes; - - /** @var array */ - private $valueTypes; - - /** @var int */ - private $nextAutoIndex; - - /** - * @param array $keyTypes - * @param array $valueTypes - * @param int $nextAutoIndex - */ - public function __construct(array $keyTypes, array $valueTypes, int $nextAutoIndex = 0) - { - assert(count($keyTypes) === count($valueTypes)); - - parent::__construct( - count($keyTypes) > 0 ? TypeCombinator::union(...$keyTypes) : new NeverType(), - count($valueTypes) > 0 ? TypeCombinator::union(...$valueTypes) : new NeverType() - ); - - $this->keyTypes = $keyTypes; - $this->valueTypes = $valueTypes; - $this->nextAutoIndex = $nextAutoIndex; - } - - public function getNextAutoIndex(): int - { - return $this->nextAutoIndex; - } - - public function getKeyType(): Type - { - if (count($this->keyTypes) > 1) { - return new UnionType($this->keyTypes); - } - - return parent::getKeyType(); - } - - /** - * @return array - */ - public function getKeyTypes(): array - { - return $this->keyTypes; - } - - /** - * @return array - */ - public function getValueTypes(): array - { - return $this->valueTypes; - } - - public function accepts(Type $type, bool $strictTypes): TrinaryLogic - { - if (parent::isSuperTypeOf($type)->no()) { - return TrinaryLogic::createNo(); - } - - $result = TrinaryLogic::createYes(); - foreach ($this->keyTypes as $i => $keyType) { - $valueType = $this->valueTypes[$i]; - $hasOffset = $type->hasOffsetValueType($keyType); - if ($hasOffset->no()) { - return $hasOffset; - } - - $result = $result->and($hasOffset); - $otherValueType = $type->getOffsetValueType($keyType); - $acceptsValue = $valueType->accepts($otherValueType, $strictTypes); - if ($acceptsValue->no()) { - return $acceptsValue; - } - $result = $result->and($acceptsValue); - } - - return $result; - } - - public function isSuperTypeOf(Type $type): TrinaryLogic - { - if ($type instanceof self) { - if (count($this->keyTypes) !== count($type->keyTypes)) { - return TrinaryLogic::createNo(); - } - - $results = []; - foreach (array_keys($this->keyTypes) as $i) { - $results[] = $this->keyTypes[$i]->isSuperTypeOf($type->keyTypes[$i]); - $results[] = $this->valueTypes[$i]->isSuperTypeOf($type->valueTypes[$i]); - } - - return TrinaryLogic::createYes()->and(...$results); - } - - if ($type instanceof ArrayType) { - $result = TrinaryLogic::createMaybe(); - if (count($this->keyTypes) === 0) { - return $result; - } - - return $result->and( - $this->getKeyType()->isSuperTypeOf($type->getKeyType()), - $this->getItemType()->isSuperTypeOf($type->getItemType()) - ); - } - - if ($type instanceof CompoundType) { - return $type->isSubTypeOf($this); - } - - return TrinaryLogic::createNo(); - } - - public function equals(Type $type): bool - { - if (!$type instanceof self) { - return false; - } - - if (count($this->keyTypes) !== count($type->keyTypes)) { - return false; - } - - foreach ($this->keyTypes as $i => $keyType) { - $valueType = $this->valueTypes[$i]; - if (!$valueType->equals($type->valueTypes[$i])) { - return false; - } - if (!$keyType->equals($type->keyTypes[$i])) { - return false; - } - } - - return true; - } - - public function isCallable(): TrinaryLogic - { - $typeAndMethod = $this->findTypeAndMethodName(); - if ($typeAndMethod === null) { - return TrinaryLogic::createNo(); - } - - return $typeAndMethod->getCertainty(); - } - - /** - * @param \PHPStan\Reflection\ClassMemberAccessAnswerer $scope - * @return \PHPStan\Reflection\ParametersAcceptor[] - */ - public function getCallableParametersAcceptors(ClassMemberAccessAnswerer $scope): array - { - $typeAndMethodName = $this->findTypeAndMethodName(); - if ($typeAndMethodName === null) { - throw new \PHPStan\ShouldNotHappenException(); - } - - if ($typeAndMethodName->isUnknown() || !$typeAndMethodName->getCertainty()->yes()) { - return [new TrivialParametersAcceptor()]; - } - - $method = $typeAndMethodName->getType() - ->getMethod($typeAndMethodName->getMethod(), $scope); - - if (!$scope->canCallMethod($method)) { - return [new InaccessibleMethod($method)]; - } - - return $method->getVariants(); - } - - private function findTypeAndMethodName(): ?ConstantArrayTypeAndMethod - { - if (count($this->keyTypes) !== 2) { - return null; - } - - if ($this->keyTypes[0]->isSuperTypeOf(new ConstantIntegerType(0))->no()) { - return null; - } - - if ($this->keyTypes[1]->isSuperTypeOf(new ConstantIntegerType(1))->no()) { - return null; - } - - [$classOrObject, $method] = $this->valueTypes; - - if (!$method instanceof ConstantStringType) { - return ConstantArrayTypeAndMethod::createUnknown(); - } - - if ($classOrObject instanceof ConstantStringType) { - $broker = Broker::getInstance(); - if (!$broker->hasClass($classOrObject->getValue())) { - return ConstantArrayTypeAndMethod::createUnknown(); - } - $type = new ObjectType($broker->getClass($classOrObject->getValue())->getName()); - } elseif ((new \PHPStan\Type\ObjectWithoutClassType())->isSuperTypeOf($classOrObject)->yes()) { - $type = $classOrObject; - } else { - return ConstantArrayTypeAndMethod::createUnknown(); - } - - $has = $type->hasMethod($method->getValue()); - if (!$has->no()) { - return ConstantArrayTypeAndMethod::createConcrete($type, $method->getValue(), $has); - } - - return null; - } - - public function hasOffsetValueType(Type $offsetType): TrinaryLogic - { - $offsetType = ArrayType::castToArrayKeyType($offsetType); - if ($offsetType instanceof UnionType) { - $results = []; - foreach ($offsetType->getTypes() as $innerType) { - $results[] = $this->hasOffsetValueType($innerType); - } - - return TrinaryLogic::extremeIdentity(...$results); - } - - return $this->getKeyType()->isSuperTypeOf($offsetType); - } - - public function getOffsetValueType(Type $offsetType): Type - { - $offsetType = ArrayType::castToArrayKeyType($offsetType); - $matchingValueTypes = []; - foreach ($this->keyTypes as $i => $keyType) { - if ($keyType->isSuperTypeOf($offsetType)->no()) { - continue; - } - - $matchingValueTypes[] = $this->valueTypes[$i]; - } - - if (count($matchingValueTypes) > 0) { - $type = TypeCombinator::union(...$matchingValueTypes); - if ($type instanceof ErrorType) { - return new MixedType(); - } - - return $type; - } - - return new ErrorType(); // undefined offset - } - - public function setOffsetValueType(?Type $offsetType, Type $valueType): Type - { - $builder = ConstantArrayTypeBuilder::createFromConstantArray($this); - $builder->setOffsetValueType($offsetType, $valueType); - - return $builder->getArray(); - } - - public function unsetOffset(Type $offsetType): Type - { - $offsetType = ArrayType::castToArrayKeyType($offsetType); - if ($offsetType instanceof ConstantIntegerType || $offsetType instanceof ConstantStringType) { - foreach ($this->keyTypes as $i => $keyType) { - if ($keyType->getValue() === $offsetType->getValue()) { - $newKeyTypes = $this->keyTypes; - unset($newKeyTypes[$i]); - $newValueTypes = $this->valueTypes; - unset($newValueTypes[$i]); - return new self(array_values($newKeyTypes), array_values($newValueTypes), $this->nextAutoIndex); - } - } - } - - return $this->generalize(); - } - - public function isIterableAtLeastOnce(): TrinaryLogic - { - return TrinaryLogic::createFromBoolean(count($this->keyTypes) > 0); - } - - public function removeLast(): self - { - if (count($this->keyTypes) === 0) { - return $this; - } - - $keyTypes = $this->keyTypes; - $valueTypes = $this->valueTypes; - - $removedKeyType = array_pop($keyTypes); - array_pop($valueTypes); - $nextAutoindex = $removedKeyType instanceof ConstantIntegerType - ? $removedKeyType->getValue() - : $this->nextAutoIndex; - - return new self( - $keyTypes, - $valueTypes, - $nextAutoindex - ); - } - - public function removeFirst(): ArrayType - { - $builder = ConstantArrayTypeBuilder::createEmpty(); - foreach ($this->keyTypes as $i => $keyType) { - if ($i === 0) { - continue; - } - - $valueType = $this->valueTypes[$i]; - if ($keyType instanceof ConstantIntegerType) { - $keyType = null; - } - - $builder->setOffsetValueType($keyType, $valueType); - } - - return $builder->getArray(); - } - - public function slice(int $offset, ?int $limit, bool $preserveKeys = false): self - { - if (count($this->keyTypes) === 0) { - return $this; - } - - $keyTypes = array_slice($this->keyTypes, $offset, $limit); - $valueTypes = array_slice($this->valueTypes, $offset, $limit); - - if (!$preserveKeys) { - $i = 0; - /** @var array $keyTypes */ - $keyTypes = array_map(static function ($keyType) use (&$i) { - if ($keyType instanceof ConstantIntegerType) { - $i++; - return new ConstantIntegerType($i - 1); - } - - return $keyType; - }, $keyTypes); - } - - /** @var int|float $nextAutoIndex */ - $nextAutoIndex = 0; - foreach ($keyTypes as $keyType) { - if (!$keyType instanceof ConstantIntegerType) { - continue; - } - - /** @var int|float $nextAutoIndex */ - $nextAutoIndex = max($nextAutoIndex, $keyType->getValue() + 1); - } - - return new self( - $keyTypes, - $valueTypes, - (int) $nextAutoIndex - ); - } - - public function toBoolean(): BooleanType - { - return new ConstantBooleanType(count($this->keyTypes) > 0); - } - - public function generalize(): Type - { - return new ArrayType( - TypeUtils::generalizeType($this->getKeyType()), - $this->getItemType() - ); - } - - /** - * @return static - */ - public function generalizeValues(): ArrayType - { - $valueTypes = []; - foreach ($this->valueTypes as $valueType) { - $valueTypes[] = TypeUtils::generalizeType($valueType); - } - - return new self($this->keyTypes, $valueTypes, $this->nextAutoIndex); - } - - /** - * @return static - */ - public function getKeysArray(): ArrayType - { - $keyTypes = []; - $valueTypes = []; - $autoIndex = 0; - - foreach ($this->keyTypes as $i => $keyType) { - $keyTypes[] = new ConstantIntegerType($i); - $valueTypes[] = $keyType; - $autoIndex++; - } - - return new self($keyTypes, $valueTypes, $autoIndex); - } - - /** - * @return static - */ - public function getValuesArray(): ArrayType - { - $keyTypes = []; - $valueTypes = []; - $autoIndex = 0; - - foreach ($this->valueTypes as $i => $valueType) { - $keyTypes[] = new ConstantIntegerType($i); - $valueTypes[] = $valueType; - $autoIndex++; - } - - return new self($keyTypes, $valueTypes, $autoIndex); - } - - public function count(): Type - { - return new ConstantIntegerType(count($this->getKeyTypes())); - } - - public function describe(VerbosityLevel $level): string - { - $describeValue = function (bool $truncate) use ($level): string { - $items = []; - $values = []; - $exportValuesOnly = true; - foreach ($this->keyTypes as $i => $keyType) { - $valueType = $this->valueTypes[$i]; - if ($keyType->getValue() !== $i) { - $exportValuesOnly = false; - } - - $items[] = sprintf('%s => %s', var_export($keyType->getValue(), true), $valueType->describe($level)); - $values[] = $valueType->describe($level); - } - - $append = ''; - if ($truncate && count($items) > self::DESCRIBE_LIMIT) { - $items = array_slice($items, 0, self::DESCRIBE_LIMIT); - $values = array_slice($values, 0, self::DESCRIBE_LIMIT); - $append = ', ...'; - } - - return sprintf( - 'array(%s%s)', - implode(', ', $exportValuesOnly ? $values : $items), - $append - ); - }; - return $level->handle( - function () use ($level): string { - return parent::describe($level); - }, - static function () use ($describeValue): string { - return $describeValue(true); - }, - static function () use ($describeValue): string { - return $describeValue(false); - } - ); - } - - public function resolveStatic(string $className): Type - { - $keyTypes = $this->keyTypes; - $valueTypes = $this->valueTypes; - foreach (array_keys($keyTypes) as $i) { - $valueType = $valueTypes[$i]; - if (!$valueType instanceof StaticResolvableType) { - continue; - } - - $valueTypes[$i] = $valueType->resolveStatic($className); - } - - return new self($keyTypes, $valueTypes, $this->nextAutoIndex); - } - - public function changeBaseClass(string $className): StaticResolvableType - { - $keyTypes = $this->keyTypes; - $valueTypes = $this->valueTypes; - foreach (array_keys($keyTypes) as $i) { - $valueType = $valueTypes[$i]; - if (!$valueType instanceof StaticResolvableType) { - continue; - } - - $valueTypes[$i] = $valueType->changeBaseClass($className); - } - - return new self($keyTypes, $valueTypes, $this->nextAutoIndex); - } - - public function traverse(callable $cb): Type - { - $keyTypes = []; - $valueTypes = []; - - $stillOriginal = true; - foreach ($this->keyTypes as $keyType) { - $transformedKeyType = $cb($keyType); - if ($transformedKeyType !== $keyType) { - $stillOriginal = false; - } - - if (!$transformedKeyType instanceof ConstantIntegerType && !$transformedKeyType instanceof ConstantStringType) { - throw new \PHPStan\ShouldNotHappenException(); - } - - $keyTypes[] = $transformedKeyType; - } - - foreach ($this->valueTypes as $valueType) { - $transformedValueType = $cb($valueType); - if ($transformedValueType !== $valueType) { - $stillOriginal = false; - } - - $valueTypes[] = $transformedValueType; - } - - if ($stillOriginal) { - return $this; - } - - return new self($keyTypes, $valueTypes, $this->nextAutoIndex); - } - - /** - * @param mixed[] $properties - * @return Type - */ - public static function __set_state(array $properties): Type - { - return new self($properties['keyTypes'], $properties['valueTypes'], $properties['nextAutoIndex']); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Constant/ConstantArrayTypeAndMethod.php b/vendor/phpstan/phpstan/src/Type/Constant/ConstantArrayTypeAndMethod.php deleted file mode 100644 index f390a9d..0000000 --- a/vendor/phpstan/phpstan/src/Type/Constant/ConstantArrayTypeAndMethod.php +++ /dev/null @@ -1,76 +0,0 @@ -type = $type; - $this->method = $method; - $this->certainty = $certainty; - } - - public static function createConcrete( - Type $type, - string $method, - TrinaryLogic $certainty - ): self - { - if ($certainty->no()) { - throw new \PHPStan\ShouldNotHappenException(); - } - return new self($type, $method, $certainty); - } - - public static function createUnknown(): self - { - return new self(null, null, TrinaryLogic::createMaybe()); - } - - public function isUnknown(): bool - { - return $this->type === null; - } - - public function getType(): Type - { - if ($this->type === null) { - throw new \PHPStan\ShouldNotHappenException(); - } - - return $this->type; - } - - public function getMethod(): string - { - if ($this->method === null) { - throw new \PHPStan\ShouldNotHappenException(); - } - - return $this->method; - } - - public function getCertainty(): TrinaryLogic - { - return $this->certainty; - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Constant/ConstantArrayTypeBuilder.php b/vendor/phpstan/phpstan/src/Type/Constant/ConstantArrayTypeBuilder.php deleted file mode 100644 index 13e6d39..0000000 --- a/vendor/phpstan/phpstan/src/Type/Constant/ConstantArrayTypeBuilder.php +++ /dev/null @@ -1,111 +0,0 @@ - */ - private $keyTypes = []; - - /** @var array */ - private $valueTypes = []; - - /** @var int */ - private $nextAutoIndex; - - /** @var bool */ - private $degradeToGeneralArray = false; - - /** - * @param array $keyTypes - * @param array $valueTypes - * @param int $nextAutoIndex - */ - private function __construct( - array $keyTypes, - array $valueTypes, - int $nextAutoIndex - ) - { - $this->keyTypes = $keyTypes; - $this->valueTypes = $valueTypes; - $this->nextAutoIndex = $nextAutoIndex; - } - - public static function createEmpty(): self - { - return new self([], [], 0); - } - - public static function createFromConstantArray(ConstantArrayType $startArrayType): self - { - return new self( - $startArrayType->getKeyTypes(), - $startArrayType->getValueTypes(), - $startArrayType->getNextAutoIndex() - ); - } - - public function setOffsetValueType(?Type $offsetType, Type $valueType): void - { - if ($offsetType === null) { - $offsetType = new ConstantIntegerType($this->nextAutoIndex); - } else { - $offsetType = ArrayType::castToArrayKeyType($offsetType); - } - - if ( - !$this->degradeToGeneralArray - && ($offsetType instanceof ConstantIntegerType || $offsetType instanceof ConstantStringType) - ) { - /** @var ConstantIntegerType|ConstantStringType $keyType */ - foreach ($this->keyTypes as $i => $keyType) { - if ($keyType->getValue() === $offsetType->getValue()) { - $this->valueTypes[$i] = $valueType; - return; - } - } - - $this->keyTypes[] = $offsetType; - $this->valueTypes[] = $valueType; - - /** @var int|float $newNextAutoIndex */ - $newNextAutoIndex = $offsetType instanceof ConstantIntegerType - ? max($this->nextAutoIndex, $offsetType->getValue() + 1) - : $this->nextAutoIndex; - if (!is_float($newNextAutoIndex)) { - $this->nextAutoIndex = $newNextAutoIndex; - } - return; - } - - $this->keyTypes[] = $offsetType; - $this->valueTypes[] = $valueType; - $this->degradeToGeneralArray = true; - } - - public function degradeToGeneralArray(): void - { - $this->degradeToGeneralArray = true; - } - - public function getArray(): ArrayType - { - if (!$this->degradeToGeneralArray) { - /** @var array $keyTypes */ - $keyTypes = $this->keyTypes; - return new ConstantArrayType($keyTypes, $this->valueTypes, $this->nextAutoIndex); - } - - return new ArrayType( - TypeCombinator::union(...$this->keyTypes), - TypeCombinator::union(...$this->valueTypes) - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Constant/ConstantBooleanType.php b/vendor/phpstan/phpstan/src/Type/Constant/ConstantBooleanType.php deleted file mode 100644 index c0bb6e2..0000000 --- a/vendor/phpstan/phpstan/src/Type/Constant/ConstantBooleanType.php +++ /dev/null @@ -1,68 +0,0 @@ -value = $value; - } - - public function getValue(): bool - { - return $this->value; - } - - public function describe(VerbosityLevel $level): string - { - return $this->value ? 'true' : 'false'; - } - - public function toBoolean(): BooleanType - { - return $this; - } - - public function toNumber(): Type - { - return new ConstantIntegerType((int) $this->value); - } - - public function toString(): Type - { - return new ConstantStringType((string) $this->value); - } - - public function toInteger(): Type - { - return new ConstantIntegerType((int) $this->value); - } - - public function toFloat(): Type - { - return new ConstantFloatType((float) $this->value); - } - - /** - * @param mixed[] $properties - * @return Type - */ - public static function __set_state(array $properties): Type - { - return new self($properties['value']); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Constant/ConstantFloatType.php b/vendor/phpstan/phpstan/src/Type/Constant/ConstantFloatType.php deleted file mode 100644 index c067574..0000000 --- a/vendor/phpstan/phpstan/src/Type/Constant/ConstantFloatType.php +++ /dev/null @@ -1,93 +0,0 @@ -value = $value; - } - - public function getValue(): float - { - return $this->value; - } - - public function describe(VerbosityLevel $level): string - { - return $level->handle( - static function (): string { - return 'float'; - }, - function (): string { - $formatted = (string) $this->value; - if (strpos($formatted, '.') === false) { - $formatted .= '.0'; - } - - return $formatted; - } - ); - } - - public function isSuperTypeOf(Type $type): TrinaryLogic - { - if ($type instanceof self) { - if (!$this->equals($type)) { - if ($this->describe(VerbosityLevel::value()) === $type->describe(VerbosityLevel::value())) { - return TrinaryLogic::createMaybe(); - } - - return TrinaryLogic::createNo(); - } - - return TrinaryLogic::createYes(); - } - - if ($type instanceof parent) { - return TrinaryLogic::createMaybe(); - } - - if ($type instanceof CompoundType) { - return $type->isSubTypeOf($this); - } - - return TrinaryLogic::createNo(); - } - - public function toString(): Type - { - return new ConstantStringType((string) $this->value); - } - - public function toInteger(): Type - { - return new ConstantIntegerType((int) $this->value); - } - - /** - * @param mixed[] $properties - * @return Type - */ - public static function __set_state(array $properties): Type - { - return new self($properties['value']); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Constant/ConstantIntegerType.php b/vendor/phpstan/phpstan/src/Type/Constant/ConstantIntegerType.php deleted file mode 100644 index 9deb65c..0000000 --- a/vendor/phpstan/phpstan/src/Type/Constant/ConstantIntegerType.php +++ /dev/null @@ -1,61 +0,0 @@ -value = $value; - } - - public function getValue(): int - { - return $this->value; - } - - public function describe(VerbosityLevel $level): string - { - return $level->handle( - static function (): string { - return 'int'; - }, - function (): string { - return sprintf('%s', $this->value); - } - ); - } - - public function toFloat(): Type - { - return new ConstantFloatType($this->value); - } - - public function toString(): Type - { - return new ConstantStringType((string) $this->value); - } - - /** - * @param mixed[] $properties - * @return Type - */ - public static function __set_state(array $properties): Type - { - return new self($properties['value']); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Constant/ConstantScalarToBooleanTrait.php b/vendor/phpstan/phpstan/src/Type/Constant/ConstantScalarToBooleanTrait.php deleted file mode 100644 index 4b2e0ff..0000000 --- a/vendor/phpstan/phpstan/src/Type/Constant/ConstantScalarToBooleanTrait.php +++ /dev/null @@ -1,15 +0,0 @@ -value); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Constant/ConstantStringType.php b/vendor/phpstan/phpstan/src/Type/Constant/ConstantStringType.php deleted file mode 100644 index e5e580c..0000000 --- a/vendor/phpstan/phpstan/src/Type/Constant/ConstantStringType.php +++ /dev/null @@ -1,224 +0,0 @@ -value = $value; - } - - public function getValue(): string - { - return $this->value; - } - - public function describe(VerbosityLevel $level): string - { - return $level->handle( - static function (): string { - return 'string'; - }, - function (): string { - return var_export( - \Nette\Utils\Strings::truncate($this->value, self::DESCRIBE_LIMIT), - true - ); - }, - function (): string { - return var_export($this->value, true); - } - ); - } - - public function isCallable(): TrinaryLogic - { - if ($this->value === '') { - return TrinaryLogic::createNo(); - } - - $broker = Broker::getInstance(); - - // 'my_function' - if ($broker->hasFunction(new Name($this->value), null)) { - return TrinaryLogic::createYes(); - } - - // 'MyClass::myStaticFunction' - $matches = \Nette\Utils\Strings::match($this->value, '#^([a-zA-Z_\\x7f-\\xff\\\\][a-zA-Z0-9_\\x7f-\\xff\\\\]*)::([a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*)\z#'); - if ($matches !== null) { - if (!$broker->hasClass($matches[1])) { - return TrinaryLogic::createMaybe(); - } - - $classRef = $broker->getClass($matches[1]); - if ($classRef->hasMethod($matches[2])) { - return TrinaryLogic::createYes(); - } - - if (!$classRef->getNativeReflection()->isFinal()) { - return TrinaryLogic::createMaybe(); - } - - return TrinaryLogic::createNo(); - } - - return TrinaryLogic::createNo(); - } - - /** - * @param \PHPStan\Reflection\ClassMemberAccessAnswerer $scope - * @return \PHPStan\Reflection\ParametersAcceptor[] - */ - public function getCallableParametersAcceptors(ClassMemberAccessAnswerer $scope): array - { - $broker = Broker::getInstance(); - - // 'my_function' - $functionName = new Name($this->value); - if ($broker->hasFunction($functionName, null)) { - return $broker->getFunction($functionName, null)->getVariants(); - } - - // 'MyClass::myStaticFunction' - $matches = \Nette\Utils\Strings::match($this->value, '#^([a-zA-Z_\\x7f-\\xff\\\\][a-zA-Z0-9_\\x7f-\\xff\\\\]*)::([a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*)\z#'); - if ($matches !== null) { - if (!$broker->hasClass($matches[1])) { - return [new TrivialParametersAcceptor()]; - } - - $classReflection = $broker->getClass($matches[1]); - if ($classReflection->hasMethod($matches[2])) { - $method = $classReflection->getMethod($matches[2], $scope); - if (!$scope->canCallMethod($method)) { - return [new InaccessibleMethod($method)]; - } - - return $method->getVariants(); - } - - if (!$classReflection->getNativeReflection()->isFinal()) { - return [new TrivialParametersAcceptor()]; - } - } - - throw new \PHPStan\ShouldNotHappenException(); - } - - public function toNumber(): Type - { - if (is_numeric($this->value)) { - /** @var mixed $value */ - $value = $this->value; - $value = +$value; - if (is_float($value)) { - return new ConstantFloatType($value); - } - - return new ConstantIntegerType($value); - } - - return new ErrorType(); - } - - public function toInteger(): Type - { - $type = $this->toNumber(); - if ($type instanceof ErrorType) { - return $type; - } - - return $type->toInteger(); - } - - public function toFloat(): Type - { - $type = $this->toNumber(); - if ($type instanceof ErrorType) { - return $type; - } - - return $type->toFloat(); - } - - public function hasOffsetValueType(Type $offsetType): TrinaryLogic - { - if ($offsetType instanceof ConstantIntegerType) { - return TrinaryLogic::createFromBoolean( - $offsetType->getValue() < strlen($this->value) - ); - } - - return parent::hasOffsetValueType($offsetType); - } - - public function getOffsetValueType(Type $offsetType): Type - { - if ($offsetType instanceof ConstantIntegerType) { - if ($offsetType->getValue() < strlen($this->value)) { - return new self($this->value[$offsetType->getValue()]); - } - - return new ErrorType(); - } - - return parent::getOffsetValueType($offsetType); - } - - public function setOffsetValueType(?Type $offsetType, Type $valueType): Type - { - $valueStringType = $valueType->toString(); - if ($valueStringType instanceof ErrorType) { - return new ErrorType(); - } - if ( - $offsetType instanceof ConstantIntegerType - && $valueStringType instanceof ConstantStringType - ) { - $value = $this->value; - $value[$offsetType->getValue()] = $valueStringType->getValue(); - - return new self($value); - } - - return parent::setOffsetValueType($offsetType, $valueType); - } - - public function append(self $otherString): self - { - return new self($this->getValue() . $otherString->getValue()); - } - - /** - * @param mixed[] $properties - * @return Type - */ - public static function __set_state(array $properties): Type - { - return new self($properties['value']); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/ConstantScalarType.php b/vendor/phpstan/phpstan/src/Type/ConstantScalarType.php deleted file mode 100644 index 1e06686..0000000 --- a/vendor/phpstan/phpstan/src/Type/ConstantScalarType.php +++ /dev/null @@ -1,13 +0,0 @@ -phpParser = $phpParser; - $this->phpDocStringResolver = $phpDocStringResolver; - $this->cache = $cache; - $this->anonymousClassNameHelper = $anonymousClassNameHelper; - $this->typeNodeResolver = $typeNodeResolver; - } - - public function getResolvedPhpDoc( - string $fileName, - ?string $className, - ?string $traitName, - string $docComment - ): ResolvedPhpDocBlock - { - if ($className === null && $traitName !== null) { - throw new \PHPStan\ShouldNotHappenException(); - } - - $phpDocKey = $this->getPhpDocKey($className, $traitName, $docComment); - $phpDocMap = []; - - if (!isset($this->inProcess[$fileName])) { - $phpDocMap = $this->getResolvedPhpDocMap($fileName); - } - - if (isset($phpDocMap[$phpDocKey])) { - return $phpDocMap[$phpDocKey]; - } - - if (!isset($this->inProcess[$fileName][$phpDocKey])) { // wrong $fileName due to traits - return ResolvedPhpDocBlock::createEmpty(); - } - - if ($this->inProcess[$fileName][$phpDocKey] === false) { // PHPDoc has cyclic dependency - return ResolvedPhpDocBlock::createEmpty(); - } - - if (is_callable($this->inProcess[$fileName][$phpDocKey])) { - $resolveCallback = $this->inProcess[$fileName][$phpDocKey]; - $this->inProcess[$fileName][$phpDocKey] = false; - $this->inProcess[$fileName][$phpDocKey] = $resolveCallback(); - } - - assert($this->inProcess[$fileName][$phpDocKey] instanceof ResolvedPhpDocBlock); - return $this->inProcess[$fileName][$phpDocKey]; - } - - /** - * @param string $fileName - * @return \PHPStan\PhpDoc\ResolvedPhpDocBlock[] - */ - private function getResolvedPhpDocMap(string $fileName): array - { - if (!isset($this->memoryCache[$fileName])) { - $modifiedTime = filemtime($fileName); - if ($modifiedTime === false) { - $modifiedTime = time(); - } - $cacheKey = sprintf('%s-%d-%s', $fileName, $modifiedTime, $this->typeNodeResolver->getCacheKey()); - $map = $this->cache->load($cacheKey); - - if ($map === null) { - $map = $this->createResolvedPhpDocMap($fileName); - $this->cache->save($cacheKey, $map); - } - - $this->memoryCache[$fileName] = $map; - } - - return $this->memoryCache[$fileName]; - } - - /** - * @param string $fileName - * @return \PHPStan\PhpDoc\ResolvedPhpDocBlock[] - */ - private function createResolvedPhpDocMap(string $fileName): array - { - $phpDocMap = $this->createFilePhpDocMap($fileName, null, null); - - try { - $this->inProcess[$fileName] = $phpDocMap; - - foreach ($phpDocMap as $phpDocKey => $resolveCallback) { - $this->inProcess[$fileName][$phpDocKey] = false; - $this->inProcess[$fileName][$phpDocKey] = $data = $resolveCallback(); - $phpDocMap[$phpDocKey] = $data; - } - - } finally { - unset($this->inProcess[$fileName]); - } - - return $phpDocMap; - } - - /** - * @param string $fileName - * @param string|null $lookForTrait - * @param string|null $traitUseClass - * @return callable[] - */ - private function createFilePhpDocMap( - string $fileName, - ?string $lookForTrait, - ?string $traitUseClass - ): array - { - /** @var callable[] $phpDocMap */ - $phpDocMap = []; - - /** @var string[] $classStack */ - $classStack = []; - if ($lookForTrait !== null && $traitUseClass !== null) { - $classStack[] = $traitUseClass; - } - $namespace = null; - $uses = []; - $this->processNodes( - $this->phpParser->parseFile($fileName), - function (\PhpParser\Node $node) use ($fileName, $lookForTrait, &$phpDocMap, &$classStack, &$namespace, &$uses) { - if ($node instanceof Node\Stmt\ClassLike) { - if ($lookForTrait !== null) { - if (!$node instanceof Node\Stmt\Trait_) { - return false; - } - if ((string) $node->namespacedName !== $lookForTrait) { - return false; - } - } else { - if ($node->name === null) { - if (!$node instanceof Node\Stmt\Class_) { - throw new \PHPStan\ShouldNotHappenException(); - } - - $className = $this->anonymousClassNameHelper->getAnonymousClassName($node, $fileName); - } elseif ((bool) $node->getAttribute('anonymousClass', false)) { - $className = $node->name->name; - } else { - $className = ltrim(sprintf('%s\\%s', $namespace, $node->name->name), '\\'); - } - $classStack[] = $className; - } - } elseif ($node instanceof Node\Stmt\TraitUse) { - foreach ($node->traits as $traitName) { - $traitName = (string) $traitName; - if (!trait_exists($traitName)) { - continue; - } - - $traitReflection = new \ReflectionClass($traitName); - if ($traitReflection->getFileName() === false) { - continue; - } - if (!file_exists($traitReflection->getFileName())) { - continue; - } - - $className = $classStack[count($classStack) - 1] ?? null; - if ($className === null) { - throw new \PHPStan\ShouldNotHappenException(); - } - - $traitPhpDocMap = $this->createFilePhpDocMap( - $traitReflection->getFileName(), - $traitName, - $className - ); - $phpDocMap = array_merge($phpDocMap, $traitPhpDocMap); - } - return null; - } elseif ($node instanceof \PhpParser\Node\Stmt\Namespace_) { - $namespace = (string) $node->name; - return null; - } elseif ($node instanceof \PhpParser\Node\Stmt\Use_ && $node->type === \PhpParser\Node\Stmt\Use_::TYPE_NORMAL) { - foreach ($node->uses as $use) { - $uses[strtolower($use->getAlias()->name)] = (string) $use->name; - } - return null; - } elseif ($node instanceof \PhpParser\Node\Stmt\GroupUse) { - $prefix = (string) $node->prefix; - foreach ($node->uses as $use) { - if ($node->type !== \PhpParser\Node\Stmt\Use_::TYPE_NORMAL && $use->type !== \PhpParser\Node\Stmt\Use_::TYPE_NORMAL) { - continue; - } - - $uses[strtolower($use->getAlias()->name)] = sprintf('%s\\%s', $prefix, (string) $use->name); - } - return null; - } elseif (!in_array(get_class($node), [ - Node\Stmt\Property::class, - Node\Stmt\ClassMethod::class, - Node\Stmt\Function_::class, - Node\Stmt\Foreach_::class, - Node\Expr\Assign::class, - Node\Expr\AssignRef::class, - Node\Stmt\Class_::class, - Node\Stmt\ClassConst::class, - Node\Stmt\Static_::class, - Node\Stmt\Echo_::class, - Node\Stmt\Return_::class, - Node\Stmt\Expression::class, - Node\Stmt\Throw_::class, - Node\Stmt\If_::class, - Node\Stmt\While_::class, - Node\Stmt\Switch_::class, - Node\Stmt\Nop::class, - ], true)) { - return null; - } - - $phpDocString = CommentHelper::getDocComment($node); - if ($phpDocString === null) { - return null; - } - - $className = $classStack[count($classStack) - 1] ?? null; - $nameScope = new NameScope($namespace, $uses, $className); - $phpDocKey = $this->getPhpDocKey($className, $lookForTrait, $phpDocString); - $phpDocMap[$phpDocKey] = function () use ($phpDocString, $nameScope): ResolvedPhpDocBlock { - return $this->phpDocStringResolver->resolve($phpDocString, $nameScope); - }; - }, - static function (\PhpParser\Node $node) use ($lookForTrait, &$namespace, &$classStack, &$uses): void { - if ($node instanceof Node\Stmt\ClassLike && $lookForTrait === null) { - if (count($classStack) === 0) { - throw new \PHPStan\ShouldNotHappenException(); - } - array_pop($classStack); - } elseif ($node instanceof \PhpParser\Node\Stmt\Namespace_) { - $namespace = null; - $uses = []; - } - } - ); - - return $phpDocMap; - } - - /** - * @param \PhpParser\Node[]|\PhpParser\Node|scalar $node - * @param \Closure(\PhpParser\Node $node): mixed $nodeCallback - * @param \Closure(\PhpParser\Node $node): void $endNodeCallback - */ - private function processNodes($node, \Closure $nodeCallback, \Closure $endNodeCallback): void - { - if ($node instanceof Node) { - $callbackResult = $nodeCallback($node); - if ($callbackResult === false) { - return; - } - foreach ($node->getSubNodeNames() as $subNodeName) { - $subNode = $node->{$subNodeName}; - $this->processNodes($subNode, $nodeCallback, $endNodeCallback); - } - $endNodeCallback($node); - } elseif (is_array($node)) { - foreach ($node as $subNode) { - $this->processNodes($subNode, $nodeCallback, $endNodeCallback); - } - } - } - - private function getPhpDocKey( - ?string $class, - ?string $trait, - string $docComment - ): string - { - $docComment = \Nette\Utils\Strings::replace($docComment, '#\s+#', ' '); - - return md5(sprintf('%s-%s-%s', $class, $trait, $docComment)); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/FloatType.php b/vendor/phpstan/phpstan/src/Type/FloatType.php deleted file mode 100644 index e1b9b3b..0000000 --- a/vendor/phpstan/phpstan/src/Type/FloatType.php +++ /dev/null @@ -1,138 +0,0 @@ -isAcceptedBy(new UnionType([ - $this, - new IntegerType(), - ]), $strictTypes); - } - - return TrinaryLogic::createNo(); - } - - public function isSuperTypeOf(Type $type): TrinaryLogic - { - if ($type instanceof self) { - return TrinaryLogic::createYes(); - } - - if ($type instanceof CompoundType) { - return $type->isSubTypeOf($this); - } - - return TrinaryLogic::createNo(); - } - - public function equals(Type $type): bool - { - return $type instanceof self; - } - - public function describe(VerbosityLevel $level): string - { - return 'float'; - } - - public function toNumber(): Type - { - return $this; - } - - public function toFloat(): Type - { - return $this; - } - - public function toInteger(): Type - { - return new IntegerType(); - } - - public function toString(): Type - { - return new StringType(); - } - - public function toArray(): Type - { - return new ConstantArrayType( - [new ConstantIntegerType(0)], - [$this], - 1 - ); - } - - public function isOffsetAccessible(): TrinaryLogic - { - return TrinaryLogic::createYes(); - } - - public function hasOffsetValueType(Type $offsetType): TrinaryLogic - { - return TrinaryLogic::createYes(); - } - - public function getOffsetValueType(Type $offsetType): Type - { - return new NullType(); - } - - public function setOffsetValueType(?Type $offsetType, Type $valueType): Type - { - return new ErrorType(); - } - - public function isArray(): TrinaryLogic - { - return TrinaryLogic::createNo(); - } - - public function traverse(callable $cb): Type - { - return $this; - } - - /** - * @param mixed[] $properties - * @return Type - */ - public static function __set_state(array $properties): Type - { - return new self(); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/FunctionTypeSpecifyingExtension.php b/vendor/phpstan/phpstan/src/Type/FunctionTypeSpecifyingExtension.php deleted file mode 100644 index d9bbd6c..0000000 --- a/vendor/phpstan/phpstan/src/Type/FunctionTypeSpecifyingExtension.php +++ /dev/null @@ -1,18 +0,0 @@ -scope = $scope; - $this->strategy = $templateTypeStrategy; - $this->name = $name; - } - - public function getName(): string - { - return $this->name; - } - - public function getScope(): TemplateTypeScope - { - return $this->scope; - } - - public function describe(VerbosityLevel $level): string - { - return $this->name; - } - - public function equals(Type $type): bool - { - return $type instanceof self - && $type->scope->equals($this->scope) - && $type->name === $this->name; - } - - public function getBound(): Type - { - return new MixedType( - $this->isExplicitMixed(), - $this->getSubtractedType() - ); - } - - public function accepts(Type $type, bool $strictTypes): TrinaryLogic - { - return $this->strategy->accepts($this, $type, $strictTypes); - } - - public function isSuperTypeOf(Type $type): TrinaryLogic - { - if ($type instanceof CompoundType) { - return $type->isSubTypeOf($this); - } - - return $this->getBound()->isSuperTypeOf($type) - ->and(TrinaryLogic::createMaybe()); - } - - public function isSubTypeOf(Type $type): TrinaryLogic - { - if ($type instanceof UnionType || $type instanceof IntersectionType) { - return $type->isSuperTypeOf($this); - } - - if (!$type instanceof TemplateType) { - return $type->isSuperTypeOf($this->getBound()) - ->and(TrinaryLogic::createMaybe()); - } - - if ($this->equals($type)) { - return TrinaryLogic::createYes(); - } - - return $type->getBound()->isSuperTypeOf($this->getBound()) - ->and(TrinaryLogic::createMaybe()); - } - - public function inferTemplateTypes(Type $receivedType): TemplateTypeMap - { - if ($receivedType instanceof UnionType || $receivedType instanceof IntersectionType) { - return $receivedType->inferTemplateTypesOn($this); - } - - if ($this->isSuperTypeOf($receivedType)->no()) { - return TemplateTypeMap::empty(); - } - - return new TemplateTypeMap([ - $this->name => $receivedType, - ]); - } - - public function isArgument(): bool - { - return $this->strategy->isArgument(); - } - - public function toArgument(): TemplateType - { - return new self( - $this->scope, - new TemplateTypeArgumentStrategy(), - $this->name, - $this->isExplicitMixed(), - $this->getSubtractedType() - ); - } - - public function subtract(Type $type): Type - { - if ($type instanceof self) { - return new NeverType(); - } - if ($this->getSubtractedType() !== null) { - $type = TypeCombinator::union($this->getSubtractedType(), $type); - } - - return new self( - $this->scope, - $this->strategy, - $this->name, - $this->isExplicitMixed(), - $type - ); - } - - public function getTypeWithoutSubtractedType(): Type - { - return new self( - $this->scope, - $this->strategy, - $this->name, - $this->isExplicitMixed(), - null - ); - } - - public function changeSubtractedType(?Type $subtractedType): Type - { - return new self( - $this->scope, - $this->strategy, - $this->name, - $this->isExplicitMixed(), - $subtractedType - ); - } - - /** - * @param mixed[] $properties - * @return Type - */ - public static function __set_state(array $properties): Type - { - return new self( - $properties['scope'], - $properties['strategy'], - $properties['name'], - $properties['isExplicitMixed'], - $properties['subtractedType'] - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Generic/TemplateObjectType.php b/vendor/phpstan/phpstan/src/Type/Generic/TemplateObjectType.php deleted file mode 100644 index 1bc715d..0000000 --- a/vendor/phpstan/phpstan/src/Type/Generic/TemplateObjectType.php +++ /dev/null @@ -1,198 +0,0 @@ -scope = $scope; - $this->strategy = $templateTypeStrategy; - $this->name = $name; - } - - public function getName(): string - { - return $this->name; - } - - public function getScope(): TemplateTypeScope - { - return $this->scope; - } - - public function describe(VerbosityLevel $level): string - { - return sprintf( - '%s of %s', - $this->name, - parent::describe($level) - ); - } - - public function equals(Type $type): bool - { - return $type instanceof self - && $type->scope->equals($this->scope) - && $type->name === $this->name - && parent::equals($type); - } - - public function getBound(): Type - { - return new ObjectType( - $this->getClassName(), - $this->getSubtractedType() - ); - } - - public function accepts(Type $type, bool $strictTypes): TrinaryLogic - { - return $this->strategy->accepts($this, $type, $strictTypes); - } - - public function isSuperTypeOf(Type $type): TrinaryLogic - { - if ($type instanceof CompoundType) { - return $type->isSubTypeOf($this); - } - - return $this->getBound()->isSuperTypeOf($type) - ->and(TrinaryLogic::createMaybe()); - } - - public function isSubTypeOf(Type $type): TrinaryLogic - { - if ($type instanceof UnionType || $type instanceof IntersectionType) { - return $type->isSuperTypeOf($this); - } - - if (!$type instanceof TemplateType) { - return $type->isSuperTypeOf($this->getBound()) - ->and(TrinaryLogic::createMaybe()); - } - - if ($this->equals($type)) { - return TrinaryLogic::createYes(); - } - - return $type->getBound()->isSuperTypeOf($this->getBound()) - ->and(TrinaryLogic::createMaybe()); - } - - public function isAcceptedBy(Type $acceptingType, bool $strictTypes): TrinaryLogic - { - return $this->isSubTypeOf($acceptingType); - } - - public function inferTemplateTypes(Type $receivedType): TemplateTypeMap - { - if ($receivedType instanceof UnionType || $receivedType instanceof IntersectionType) { - return $receivedType->inferTemplateTypesOn($this); - } - - if ($this->isSuperTypeOf($receivedType)->no()) { - return TemplateTypeMap::empty(); - } - - return new TemplateTypeMap([ - $this->name => $receivedType, - ]); - } - - public function isArgument(): bool - { - return $this->strategy->isArgument(); - } - - public function toArgument(): TemplateType - { - return new self( - $this->scope, - new TemplateTypeArgumentStrategy(), - $this->name, - $this->getClassName(), - $this->getSubtractedType() - ); - } - - public function subtract(Type $type): Type - { - if ($this->getSubtractedType() !== null) { - $type = TypeCombinator::union($this->getSubtractedType(), $type); - } - - return new self( - $this->scope, - $this->strategy, - $this->name, - $this->getClassName(), - $type - ); - } - - public function getTypeWithoutSubtractedType(): Type - { - return new self( - $this->scope, - $this->strategy, - $this->name, - $this->getClassName(), - null - ); - } - - public function changeSubtractedType(?Type $subtractedType): Type - { - return new self( - $this->scope, - $this->strategy, - $this->name, - $this->getClassName(), - $subtractedType - ); - } - - /** - * @param mixed[] $properties - * @return Type - */ - public static function __set_state(array $properties): Type - { - return new self( - $properties['scope'], - $properties['strategy'], - $properties['name'], - $properties['className'], - $properties['subtractedType'] - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Generic/TemplateType.php b/vendor/phpstan/phpstan/src/Type/Generic/TemplateType.php deleted file mode 100644 index f214fa3..0000000 --- a/vendor/phpstan/phpstan/src/Type/Generic/TemplateType.php +++ /dev/null @@ -1,21 +0,0 @@ -equals($right)) - ->or(TrinaryLogic::createFromBoolean($right->equals(new MixedType()))); - } - - public function isArgument(): bool - { - return true; - } - - /** - * @param mixed[] $properties - */ - public static function __set_state(array $properties): self - { - return new self(); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Generic/TemplateTypeFactory.php b/vendor/phpstan/phpstan/src/Type/Generic/TemplateTypeFactory.php deleted file mode 100644 index 69405b2..0000000 --- a/vendor/phpstan/phpstan/src/Type/Generic/TemplateTypeFactory.php +++ /dev/null @@ -1,28 +0,0 @@ -getClassName()); - } - - if ($bound === null || $bound instanceof MixedType) { - return new TemplateMixedType($scope, $strategy, $name); - } - - return new ErrorType(); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Generic/TemplateTypeHelper.php b/vendor/phpstan/phpstan/src/Type/Generic/TemplateTypeHelper.php deleted file mode 100644 index fe7e497..0000000 --- a/vendor/phpstan/phpstan/src/Type/Generic/TemplateTypeHelper.php +++ /dev/null @@ -1,46 +0,0 @@ -isArgument()) { - $newType = $standins->getType($type->getName()); - - if ($newType === null) { - return new ErrorType(); - } - - return $traverse($newType); - } - - return $traverse($type); - }); - } - - /** - * Switches all template types to their argument strategy - */ - public static function toArgument(Type $type): Type - { - return TypeTraverser::map($type, static function (Type $type, callable $traverse): Type { - if ($type instanceof TemplateType) { - return $traverse($type->toArgument()); - } - - return $traverse($type); - }); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Generic/TemplateTypeMap.php b/vendor/phpstan/phpstan/src/Type/Generic/TemplateTypeMap.php deleted file mode 100644 index a22fc70..0000000 --- a/vendor/phpstan/phpstan/src/Type/Generic/TemplateTypeMap.php +++ /dev/null @@ -1,66 +0,0 @@ - */ - private $types; - - /** @param array $types */ - public function __construct(array $types) - { - $this->types = $types; - } - - public static function empty(): self - { - return new self([]); - } - - /** @return array */ - public function getTypes(): array - { - return $this->types; - } - - public function getType(string $name): ?Type - { - return $this->types[$name] ?? null; - } - - public function union(self $other): self - { - $result = $this->types; - - foreach ($other->types as $name => $type) { - if (isset($result[$name])) { - $result[$name] = TypeCombinator::union($result[$name], $type); - } else { - $result[$name] = $type; - } - } - - return new self($result); - } - - public function intersect(self $other): self - { - $result = $this->types; - - foreach ($other->types as $name => $type) { - if (isset($result[$name])) { - $result[$name] = TypeCombinator::intersect($result[$name], $type); - } else { - $result[$name] = $type; - } - } - - return new self($result); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Generic/TemplateTypeParameterStrategy.php b/vendor/phpstan/phpstan/src/Type/Generic/TemplateTypeParameterStrategy.php deleted file mode 100644 index 89e69d6..0000000 --- a/vendor/phpstan/phpstan/src/Type/Generic/TemplateTypeParameterStrategy.php +++ /dev/null @@ -1,38 +0,0 @@ -getBound()->accepts($right, $strictTypes); - } - - public function isArgument(): bool - { - return false; - } - - /** - * @param mixed[] $properties - */ - public static function __set_state(array $properties): self - { - return new self(); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Generic/TemplateTypeScope.php b/vendor/phpstan/phpstan/src/Type/Generic/TemplateTypeScope.php deleted file mode 100644 index 3b2f156..0000000 --- a/vendor/phpstan/phpstan/src/Type/Generic/TemplateTypeScope.php +++ /dev/null @@ -1,37 +0,0 @@ -className = $className; - $this->functionName = $functionName; - } - - public function equals(self $other): bool - { - return $this->className === $other->className - && $this->functionName === $other->functionName; - } - - /** - * @param mixed[] $properties - */ - public static function __set_state(array $properties): self - { - return new self( - $properties['className'], - $properties['functionName'] - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Generic/TemplateTypeStrategy.php b/vendor/phpstan/phpstan/src/Type/Generic/TemplateTypeStrategy.php deleted file mode 100644 index d90dc73..0000000 --- a/vendor/phpstan/phpstan/src/Type/Generic/TemplateTypeStrategy.php +++ /dev/null @@ -1,15 +0,0 @@ -types = UnionTypeHelper::sortTypes($types); - } - - /** - * @return Type[] - */ - public function getTypes(): array - { - return $this->types; - } - - /** - * @return string[] - */ - public function getReferencedClasses(): array - { - return UnionTypeHelper::getReferencedClasses($this->types); - } - - public function accepts(Type $otherType, bool $strictTypes): TrinaryLogic - { - foreach ($this->types as $type) { - if (!$type->accepts($otherType, $strictTypes)->yes()) { - return TrinaryLogic::createNo(); - } - } - - return TrinaryLogic::createYes(); - } - - public function isSuperTypeOf(Type $otherType): TrinaryLogic - { - $results = []; - foreach ($this->getTypes() as $innerType) { - $results[] = $innerType->isSuperTypeOf($otherType); - } - - return TrinaryLogic::createYes()->and(...$results); - } - - public function isSubTypeOf(Type $otherType): TrinaryLogic - { - if ($otherType instanceof self || $otherType instanceof UnionType) { - return $otherType->isSuperTypeOf($this); - } - - $results = []; - foreach ($this->getTypes() as $innerType) { - $results[] = $otherType->isSuperTypeOf($innerType); - } - - return TrinaryLogic::maxMin(...$results); - } - - public function isAcceptedBy(Type $acceptingType, bool $strictTypes): TrinaryLogic - { - return $this->isSubTypeOf($acceptingType); - } - - public function equals(Type $type): bool - { - if (!$type instanceof self) { - return false; - } - - if (count($this->types) !== count($type->types)) { - return false; - } - - foreach ($this->types as $i => $innerType) { - if (!$innerType->equals($type->types[$i])) { - return false; - } - } - - return true; - } - - public function describe(VerbosityLevel $level): string - { - return $level->handle( - function () use ($level): string { - $typeNames = []; - foreach ($this->types as $type) { - if ($type instanceof AccessoryType) { - continue; - } - $typeNames[] = TypeUtils::generalizeType($type)->describe($level); - } - - return implode('&', $typeNames); - }, - function () use ($level): string { - $typeNames = []; - foreach ($this->types as $type) { - if ($type instanceof AccessoryType) { - continue; - } - $typeNames[] = $type->describe($level); - } - - return implode('&', $typeNames); - }, - function () use ($level): string { - $typeNames = []; - foreach ($this->types as $type) { - $typeNames[] = $type->describe($level); - } - - return implode('&', $typeNames); - } - ); - } - - public function canAccessProperties(): TrinaryLogic - { - return $this->intersectResults(static function (Type $type): TrinaryLogic { - return $type->canAccessProperties(); - }); - } - - public function hasProperty(string $propertyName): TrinaryLogic - { - return $this->intersectResults(static function (Type $type) use ($propertyName): TrinaryLogic { - return $type->hasProperty($propertyName); - }); - } - - public function getProperty(string $propertyName, ClassMemberAccessAnswerer $scope): PropertyReflection - { - foreach ($this->types as $type) { - if ($type->hasProperty($propertyName)->yes()) { - return $type->getProperty($propertyName, $scope); - } - } - - throw new \PHPStan\ShouldNotHappenException(); - } - - public function canCallMethods(): TrinaryLogic - { - return $this->intersectResults(static function (Type $type): TrinaryLogic { - return $type->canCallMethods(); - }); - } - - public function hasMethod(string $methodName): TrinaryLogic - { - return $this->intersectResults(static function (Type $type) use ($methodName): TrinaryLogic { - return $type->hasMethod($methodName); - }); - } - - public function getMethod(string $methodName, ClassMemberAccessAnswerer $scope): MethodReflection - { - foreach ($this->types as $type) { - if ($type->hasMethod($methodName)->yes()) { - return $type->getMethod($methodName, $scope); - } - } - - throw new \PHPStan\ShouldNotHappenException(); - } - - public function canAccessConstants(): TrinaryLogic - { - return $this->intersectResults(static function (Type $type): TrinaryLogic { - return $type->canAccessConstants(); - }); - } - - public function hasConstant(string $constantName): TrinaryLogic - { - return $this->intersectResults(static function (Type $type) use ($constantName): TrinaryLogic { - return $type->hasConstant($constantName); - }); - } - - public function getConstant(string $constantName): ConstantReflection - { - foreach ($this->types as $type) { - if ($type->hasConstant($constantName)->yes()) { - return $type->getConstant($constantName); - } - } - - throw new \PHPStan\ShouldNotHappenException(); - } - - public function isIterable(): TrinaryLogic - { - return $this->intersectResults(static function (Type $type): TrinaryLogic { - return $type->isIterable(); - }); - } - - public function isIterableAtLeastOnce(): TrinaryLogic - { - return $this->intersectResults(static function (Type $type): TrinaryLogic { - return $type->isIterableAtLeastOnce(); - }); - } - - public function getIterableKeyType(): Type - { - return $this->intersectTypes(static function (Type $type): Type { - return $type->getIterableKeyType(); - }); - } - - public function getIterableValueType(): Type - { - return $this->intersectTypes(static function (Type $type): Type { - return $type->getIterableValueType(); - }); - } - - public function isArray(): TrinaryLogic - { - return $this->intersectResults(static function (Type $type): TrinaryLogic { - return $type->isArray(); - }); - } - - public function isOffsetAccessible(): TrinaryLogic - { - return $this->intersectResults(static function (Type $type): TrinaryLogic { - return $type->isOffsetAccessible(); - }); - } - - public function hasOffsetValueType(Type $offsetType): TrinaryLogic - { - return $this->intersectResults(static function (Type $type) use ($offsetType): TrinaryLogic { - return $type->hasOffsetValueType($offsetType); - }); - } - - public function getOffsetValueType(Type $offsetType): Type - { - return $this->intersectTypes(static function (Type $type) use ($offsetType): Type { - return $type->getOffsetValueType($offsetType); - }); - } - - public function setOffsetValueType(?Type $offsetType, Type $valueType): Type - { - return $this->intersectTypes(static function (Type $type) use ($offsetType, $valueType): Type { - return $type->setOffsetValueType($offsetType, $valueType); - }); - } - - public function isCallable(): TrinaryLogic - { - return $this->intersectResults(static function (Type $type): TrinaryLogic { - return $type->isCallable(); - }); - } - - /** - * @param \PHPStan\Reflection\ClassMemberAccessAnswerer $scope - * @return \PHPStan\Reflection\ParametersAcceptor[] - */ - public function getCallableParametersAcceptors(ClassMemberAccessAnswerer $scope): array - { - if ($this->isCallable()->no()) { - throw new \PHPStan\ShouldNotHappenException(); - } - - return [new TrivialParametersAcceptor()]; - } - - public function isCloneable(): TrinaryLogic - { - return $this->intersectResults(static function (Type $type): TrinaryLogic { - return $type->isCloneable(); - }); - } - - public function toBoolean(): BooleanType - { - /** @var BooleanType $type */ - $type = $this->intersectTypes(static function (Type $type): BooleanType { - return $type->toBoolean(); - }); - - return $type; - } - - public function toNumber(): Type - { - $type = $this->intersectTypes(static function (Type $type): Type { - return $type->toNumber(); - }); - - return $type; - } - - public function toString(): Type - { - $type = $this->intersectTypes(static function (Type $type): Type { - return $type->toString(); - }); - - return $type; - } - - public function toInteger(): Type - { - $type = $this->intersectTypes(static function (Type $type): Type { - return $type->toInteger(); - }); - - return $type; - } - - public function toFloat(): Type - { - $type = $this->intersectTypes(static function (Type $type): Type { - return $type->toFloat(); - }); - - return $type; - } - - public function toArray(): Type - { - $type = $this->intersectTypes(static function (Type $type): Type { - return $type->toArray(); - }); - - return $type; - } - - public function resolveStatic(string $className): Type - { - return new self(UnionTypeHelper::resolveStatic($className, $this->getTypes())); - } - - public function changeBaseClass(string $className): StaticResolvableType - { - return new self(UnionTypeHelper::changeBaseClass($className, $this->getTypes())); - } - - public function inferTemplateTypes(Type $receivedType): TemplateTypeMap - { - $types = TemplateTypeMap::empty(); - - foreach ($this->types as $type) { - $receive = $type->isSuperTypeOf($receivedType)->yes() ? $receivedType : new NeverType(); - $types = $types->intersect($type->inferTemplateTypes($receive)); - } - - return $types; - } - - public function inferTemplateTypesOn(Type $templateType): TemplateTypeMap - { - $types = TemplateTypeMap::empty(); - - foreach ($this->types as $type) { - $types = $types->intersect($templateType->inferTemplateTypes($type)); - } - - return $types; - } - - public function traverse(callable $cb): Type - { - $types = []; - $changed = false; - - foreach ($this->types as $type) { - $newType = $cb($type); - if ($type !== $newType) { - $changed = true; - } - $types[] = $newType; - } - - if ($changed) { - return TypeCombinator::intersect(...$types); - } - - return $this; - } - - /** - * @param mixed[] $properties - * @return Type - */ - public static function __set_state(array $properties): Type - { - return new self($properties['types']); - } - - /** - * @param callable(Type $type): TrinaryLogic $getResult - * @return TrinaryLogic - */ - private function intersectResults(callable $getResult): TrinaryLogic - { - $operands = array_map($getResult, $this->types); - return TrinaryLogic::maxMin(...$operands); - } - - /** - * @param callable(Type $type): Type $getType - * @return Type - */ - private function intersectTypes(callable $getType): Type - { - $operands = array_map($getType, $this->types); - return TypeCombinator::intersect(...$operands); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/IterableType.php b/vendor/phpstan/phpstan/src/Type/IterableType.php deleted file mode 100644 index dc4c897..0000000 --- a/vendor/phpstan/phpstan/src/Type/IterableType.php +++ /dev/null @@ -1,221 +0,0 @@ -keyType = $keyType; - $this->itemType = $itemType; - } - - public function getItemType(): Type - { - return $this->itemType; - } - - /** - * @return string[] - */ - public function getReferencedClasses(): array - { - return array_merge( - $this->keyType->getReferencedClasses(), - $this->getItemType()->getReferencedClasses() - ); - } - - public function accepts(Type $type, bool $strictTypes): TrinaryLogic - { - if ($type->isIterable()->yes()) { - return $this->getIterableValueType()->accepts($type->getIterableValueType(), $strictTypes) - ->and($this->getIterableKeyType()->accepts($type->getIterableKeyType(), $strictTypes)); - } - - if ($type instanceof CompoundType) { - return CompoundTypeHelper::accepts($type, $this, $strictTypes); - } - - return TrinaryLogic::createNo(); - } - - public function isSuperTypeOf(Type $type): TrinaryLogic - { - return $type->isIterable() - ->and($this->getIterableValueType()->isSuperTypeOf($type->getIterableValueType())) - ->and($this->getIterableKeyType()->isSuperTypeOf($type->getIterableKeyType())); - } - - public function isSubTypeOf(Type $otherType): TrinaryLogic - { - if ($otherType instanceof IntersectionType || $otherType instanceof UnionType) { - return $otherType->isSuperTypeOf(new UnionType([ - new ArrayType($this->keyType, $this->itemType), - new IntersectionType([ - new ObjectType(\Traversable::class), - $this, - ]), - ])); - } - - if ($otherType instanceof self) { - $limit = TrinaryLogic::createYes(); - } else { - $limit = TrinaryLogic::createMaybe(); - } - - return $limit->and( - $otherType->isIterable(), - $otherType->getIterableValueType()->isSuperTypeOf($this->itemType), - $otherType->getIterableKeyType()->isSuperTypeOf($this->keyType) - ); - } - - public function isAcceptedBy(Type $acceptingType, bool $strictTypes): TrinaryLogic - { - return $this->isSubTypeOf($acceptingType); - } - - public function equals(Type $type): bool - { - if (!$type instanceof self) { - return false; - } - - return $this->keyType->equals($type->keyType) - && $this->itemType->equals($type->itemType); - } - - public function describe(VerbosityLevel $level): string - { - if ($this->keyType instanceof MixedType) { - if ($this->itemType instanceof MixedType) { - return 'iterable'; - } - - return sprintf('iterable<%s>', $this->itemType->describe($level)); - } - - return sprintf('iterable<%s, %s>', $this->keyType->describe($level), $this->itemType->describe($level)); - } - - public function toNumber(): Type - { - return new ErrorType(); - } - - public function toString(): Type - { - return new ErrorType(); - } - - public function toInteger(): Type - { - return new ErrorType(); - } - - public function toFloat(): Type - { - return new ErrorType(); - } - - public function toArray(): Type - { - return new ArrayType($this->keyType, $this->getItemType()); - } - - public function resolveStatic(string $className): Type - { - if ($this->getItemType() instanceof StaticResolvableType) { - return new self( - $this->keyType, - $this->getItemType()->resolveStatic($className) - ); - } - - return $this; - } - - public function changeBaseClass(string $className): StaticResolvableType - { - if ($this->getItemType() instanceof StaticResolvableType) { - return new self( - $this->keyType, - $this->getItemType()->changeBaseClass($className) - ); - } - - return $this; - } - - public function isIterable(): TrinaryLogic - { - return TrinaryLogic::createYes(); - } - - public function isIterableAtLeastOnce(): TrinaryLogic - { - return TrinaryLogic::createMaybe(); - } - - public function getIterableKeyType(): Type - { - return $this->keyType; - } - - public function getIterableValueType(): Type - { - return $this->getItemType(); - } - - public function isArray(): TrinaryLogic - { - return TrinaryLogic::createMaybe(); - } - - public function traverse(callable $cb): Type - { - $keyType = $cb($this->keyType); - $itemType = $cb($this->itemType); - - if ($keyType !== $this->keyType || $itemType !== $this->itemType) { - return new self($keyType, $itemType); - } - - return $this; - } - - /** - * @param mixed[] $properties - * @return Type - */ - public static function __set_state(array $properties): Type - { - return new self($properties['keyType'], $properties['itemType']); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/JustNullableTypeTrait.php b/vendor/phpstan/phpstan/src/Type/JustNullableTypeTrait.php deleted file mode 100644 index 0d3f126..0000000 --- a/vendor/phpstan/phpstan/src/Type/JustNullableTypeTrait.php +++ /dev/null @@ -1,59 +0,0 @@ -isSubTypeOf($this); - } - - return TrinaryLogic::createNo(); - } - - public function equals(Type $type): bool - { - return $type instanceof self; - } - - public function traverse(callable $cb): Type - { - return $this; - } - - public function isArray(): TrinaryLogic - { - return TrinaryLogic::createNo(); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/MethodTypeSpecifyingExtension.php b/vendor/phpstan/phpstan/src/Type/MethodTypeSpecifyingExtension.php deleted file mode 100644 index 2776d8d..0000000 --- a/vendor/phpstan/phpstan/src/Type/MethodTypeSpecifyingExtension.php +++ /dev/null @@ -1,20 +0,0 @@ -isExplicitMixed = $isExplicitMixed; - $this->subtractedType = $subtractedType; - } - - /** - * @return string[] - */ - public function getReferencedClasses(): array - { - return []; - } - - public function accepts(Type $type, bool $strictTypes): TrinaryLogic - { - return TrinaryLogic::createYes(); - } - - public function isSuperTypeOf(Type $type): TrinaryLogic - { - if ($this->subtractedType === null) { - return TrinaryLogic::createYes(); - } - - if ($type instanceof self) { - if ($type->subtractedType === null) { - return TrinaryLogic::createMaybe(); - } - $isSuperType = $type->subtractedType->isSuperTypeOf($this->subtractedType); - if ($isSuperType->yes()) { - return TrinaryLogic::createYes(); - } - - return TrinaryLogic::createMaybe(); - } - - return $this->subtractedType->isSuperTypeOf($type)->negate(); - } - - public function setOffsetValueType(?Type $offsetType, Type $valueType): Type - { - return new MixedType(); - } - - public function isCallable(): TrinaryLogic - { - if ( - $this->subtractedType !== null - && $this->subtractedType->isCallable()->yes() - ) { - return TrinaryLogic::createNo(); - } - - return TrinaryLogic::createMaybe(); - } - - /** - * @param \PHPStan\Reflection\ClassMemberAccessAnswerer $scope - * @return \PHPStan\Reflection\ParametersAcceptor[] - */ - public function getCallableParametersAcceptors(ClassMemberAccessAnswerer $scope): array - { - return [new TrivialParametersAcceptor()]; - } - - public function equals(Type $type): bool - { - if (!$type instanceof self) { - return false; - } - - if ($this->subtractedType === null) { - if ($type->subtractedType === null) { - return true; - } - - return false; - } - - if ($type->subtractedType === null) { - return false; - } - - return $this->subtractedType->equals($type->subtractedType); - } - - public function isSubTypeOf(Type $otherType): TrinaryLogic - { - if ($otherType instanceof self) { - return TrinaryLogic::createYes(); - } - - if ($this->subtractedType !== null) { - $isSuperType = $this->subtractedType->isSuperTypeOf($otherType); - if ($isSuperType->yes()) { - return TrinaryLogic::createNo(); - } - } - - return TrinaryLogic::createMaybe(); - } - - public function isAcceptedBy(Type $acceptingType, bool $strictTypes): TrinaryLogic - { - $isSuperType = $this->isSuperTypeOf($acceptingType); - if ($isSuperType->no()) { - return $isSuperType; - } - return TrinaryLogic::createYes(); - } - - public function canAccessProperties(): TrinaryLogic - { - return TrinaryLogic::createYes(); - } - - public function hasProperty(string $propertyName): TrinaryLogic - { - return TrinaryLogic::createYes(); - } - - public function getProperty(string $propertyName, ClassMemberAccessAnswerer $scope): PropertyReflection - { - return new DummyPropertyReflection(); - } - - public function canCallMethods(): TrinaryLogic - { - return TrinaryLogic::createYes(); - } - - public function hasMethod(string $methodName): TrinaryLogic - { - return TrinaryLogic::createYes(); - } - - public function getMethod(string $methodName, ClassMemberAccessAnswerer $scope): MethodReflection - { - return new DummyMethodReflection($methodName); - } - - public function canAccessConstants(): TrinaryLogic - { - return TrinaryLogic::createYes(); - } - - public function hasConstant(string $constantName): TrinaryLogic - { - return TrinaryLogic::createYes(); - } - - public function getConstant(string $constantName): ConstantReflection - { - return new DummyConstantReflection($constantName); - } - - public function isCloneable(): TrinaryLogic - { - return TrinaryLogic::createYes(); - } - - public function describe(VerbosityLevel $level): string - { - return $level->handle( - static function (): string { - return 'mixed'; - }, - static function (): string { - return 'mixed'; - }, - function () use ($level): string { - $description = 'mixed'; - if ($this->subtractedType !== null) { - $description .= sprintf('~%s', $this->subtractedType->describe($level)); - } - - return $description; - } - ); - } - - public function toNumber(): Type - { - return new UnionType([ - $this->toInteger(), - $this->toFloat(), - ]); - } - - public function toInteger(): Type - { - return new IntegerType(); - } - - public function toFloat(): Type - { - return new FloatType(); - } - - public function toString(): Type - { - return new StringType(); - } - - public function toArray(): Type - { - return new ArrayType(new MixedType(), new MixedType()); - } - - public function isExplicitMixed(): bool - { - return $this->isExplicitMixed; - } - - public function subtract(Type $type): Type - { - if ($type instanceof self) { - return new NeverType(); - } - if ($this->subtractedType !== null) { - $type = TypeCombinator::union($this->subtractedType, $type); - } - - return new self($this->isExplicitMixed, $type); - } - - public function getTypeWithoutSubtractedType(): Type - { - return new self($this->isExplicitMixed); - } - - public function changeSubtractedType(?Type $subtractedType): Type - { - return new self($this->isExplicitMixed, $subtractedType); - } - - public function getSubtractedType(): ?Type - { - return $this->subtractedType; - } - - public function traverse(callable $cb): Type - { - return $this; - } - - public function isArray(): TrinaryLogic - { - return TrinaryLogic::createMaybe(); - } - - /** - * @param mixed[] $properties - * @return Type - */ - public static function __set_state(array $properties): Type - { - return new self( - $properties['isExplicitMixed'], - $properties['subtractedType'] ?? null - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/NeverType.php b/vendor/phpstan/phpstan/src/Type/NeverType.php deleted file mode 100644 index 5b6afd6..0000000 --- a/vendor/phpstan/phpstan/src/Type/NeverType.php +++ /dev/null @@ -1,223 +0,0 @@ -isExplicit = $isExplicit; - } - - public function isExplicit(): bool - { - return $this->isExplicit; - } - - /** - * @return string[] - */ - public function getReferencedClasses(): array - { - return []; - } - - public function accepts(Type $type, bool $strictTypes): TrinaryLogic - { - return TrinaryLogic::createYes(); - } - - public function isSuperTypeOf(Type $type): TrinaryLogic - { - if ($type instanceof self) { - return TrinaryLogic::createYes(); - } - - return TrinaryLogic::createNo(); - } - - public function equals(Type $type): bool - { - return $type instanceof self; - } - - public function isSubTypeOf(Type $otherType): TrinaryLogic - { - return TrinaryLogic::createYes(); - } - - public function isAcceptedBy(Type $acceptingType, bool $strictTypes): TrinaryLogic - { - return $this->isSubTypeOf($acceptingType); - } - - public function describe(VerbosityLevel $level): string - { - return '*NEVER*'; - } - - public function canAccessProperties(): TrinaryLogic - { - return TrinaryLogic::createYes(); - } - - public function hasProperty(string $propertyName): TrinaryLogic - { - return TrinaryLogic::createNo(); - } - - public function getProperty(string $propertyName, ClassMemberAccessAnswerer $scope): PropertyReflection - { - throw new \PHPStan\ShouldNotHappenException(); - } - - public function canCallMethods(): TrinaryLogic - { - return TrinaryLogic::createYes(); - } - - public function hasMethod(string $methodName): TrinaryLogic - { - return TrinaryLogic::createNo(); - } - - public function getMethod(string $methodName, ClassMemberAccessAnswerer $scope): MethodReflection - { - throw new \PHPStan\ShouldNotHappenException(); - } - - public function canAccessConstants(): TrinaryLogic - { - return TrinaryLogic::createYes(); - } - - public function hasConstant(string $constantName): TrinaryLogic - { - return TrinaryLogic::createNo(); - } - - public function getConstant(string $constantName): ConstantReflection - { - throw new \PHPStan\ShouldNotHappenException(); - } - - public function isIterable(): TrinaryLogic - { - return TrinaryLogic::createYes(); - } - - public function isIterableAtLeastOnce(): TrinaryLogic - { - return TrinaryLogic::createMaybe(); - } - - public function getIterableKeyType(): Type - { - return new NeverType(); - } - - public function getIterableValueType(): Type - { - return new NeverType(); - } - - public function isOffsetAccessible(): TrinaryLogic - { - return TrinaryLogic::createYes(); - } - - public function hasOffsetValueType(Type $offsetType): TrinaryLogic - { - return TrinaryLogic::createYes(); - } - - public function getOffsetValueType(Type $offsetType): Type - { - return new NeverType(); - } - - public function setOffsetValueType(?Type $offsetType, Type $valueType): Type - { - return new NeverType(); - } - - public function isCallable(): TrinaryLogic - { - return TrinaryLogic::createYes(); - } - - /** - * @param \PHPStan\Reflection\ClassMemberAccessAnswerer $scope - * @return \PHPStan\Reflection\ParametersAcceptor[] - */ - public function getCallableParametersAcceptors(ClassMemberAccessAnswerer $scope): array - { - return [new TrivialParametersAcceptor()]; - } - - public function isCloneable(): TrinaryLogic - { - return TrinaryLogic::createYes(); - } - - public function toNumber(): Type - { - return $this; - } - - public function toString(): Type - { - return $this; - } - - public function toInteger(): Type - { - return $this; - } - - public function toFloat(): Type - { - return $this; - } - - public function toArray(): Type - { - return $this; - } - - public function traverse(callable $cb): Type - { - return $this; - } - - public function isArray(): TrinaryLogic - { - return TrinaryLogic::createNo(); - } - - /** - * @param mixed[] $properties - * @return Type - */ - public static function __set_state(array $properties): Type - { - return new self($properties['isExplicit']); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/NonexistentParentClassType.php b/vendor/phpstan/phpstan/src/Type/NonexistentParentClassType.php deleted file mode 100644 index 4d73853..0000000 --- a/vendor/phpstan/phpstan/src/Type/NonexistentParentClassType.php +++ /dev/null @@ -1,115 +0,0 @@ -isSubTypeOf($this); - } - - return TrinaryLogic::createNo(); - } - - public function equals(Type $type): bool - { - return $type instanceof self; - } - - public function describe(VerbosityLevel $level): string - { - return 'null'; - } - - public function toNumber(): Type - { - return new ConstantIntegerType(0); - } - - public function toString(): Type - { - return new ConstantStringType(''); - } - - public function toInteger(): Type - { - return $this->toNumber(); - } - - public function toFloat(): Type - { - return $this->toNumber()->toFloat(); - } - - public function toArray(): Type - { - return new ConstantArrayType([], []); - } - - public function isOffsetAccessible(): TrinaryLogic - { - return TrinaryLogic::createYes(); - } - - public function hasOffsetValueType(Type $offsetType): TrinaryLogic - { - return TrinaryLogic::createYes(); - } - - public function getOffsetValueType(Type $offsetType): Type - { - return new NullType(); - } - - public function setOffsetValueType(?Type $offsetType, Type $valueType): Type - { - $array = new ConstantArrayType([], []); - return $array->setOffsetValueType($offsetType, $valueType); - } - - public function traverse(callable $cb): Type - { - return $this; - } - - public function isArray(): TrinaryLogic - { - return TrinaryLogic::createNo(); - } - - /** - * @param mixed[] $properties - * @return Type - */ - public static function __set_state(array $properties): Type - { - return new self(); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/ObjectType.php b/vendor/phpstan/phpstan/src/Type/ObjectType.php deleted file mode 100644 index 5dad04c..0000000 --- a/vendor/phpstan/phpstan/src/Type/ObjectType.php +++ /dev/null @@ -1,730 +0,0 @@ -className = $className; - $this->subtractedType = $subtractedType; - } - - public function getClassName(): string - { - return $this->className; - } - - public function hasProperty(string $propertyName): TrinaryLogic - { - $broker = Broker::getInstance(); - if (!$broker->hasClass($this->className)) { - return TrinaryLogic::createMaybe(); - } - - $classReflection = $broker->getClass($this->className); - if ($classReflection->hasProperty($propertyName)) { - return TrinaryLogic::createYes(); - } - - if ($classReflection->isFinal()) { - return TrinaryLogic::createNo(); - } - - return TrinaryLogic::createMaybe(); - } - - public function getProperty(string $propertyName, ClassMemberAccessAnswerer $scope): PropertyReflection - { - $broker = Broker::getInstance(); - return $broker->getClass($this->className)->getProperty($propertyName, $scope); - } - - /** - * @return string[] - */ - public function getReferencedClasses(): array - { - return [$this->className]; - } - - public function accepts(Type $type, bool $strictTypes): TrinaryLogic - { - if ($type instanceof StaticType) { - return $this->checkSubclassAcceptability($type->getBaseClass()); - } - - if ($type instanceof CompoundType) { - return CompoundTypeHelper::accepts($type, $this, $strictTypes); - } - - if ($type instanceof ClosureType) { - return $this->isInstanceOf(\Closure::class); - } - - if (!$type instanceof TypeWithClassName) { - return TrinaryLogic::createNo(); - } - - return $this->checkSubclassAcceptability($type->getClassName()); - } - - public function isSuperTypeOf(Type $type): TrinaryLogic - { - if ($type instanceof CompoundType) { - return $type->isSubTypeOf($this); - } - - if ($type instanceof ObjectWithoutClassType) { - if ($type->getSubtractedType() !== null) { - $isSuperType = $type->getSubtractedType()->isSuperTypeOf($this); - if ($isSuperType->yes()) { - return TrinaryLogic::createNo(); - } - } - return TrinaryLogic::createMaybe(); - } - - if (!$type instanceof TypeWithClassName) { - return TrinaryLogic::createNo(); - } - - if ($this->subtractedType !== null) { - $isSuperType = $this->subtractedType->isSuperTypeOf($type); - if ($isSuperType->yes()) { - return TrinaryLogic::createNo(); - } - } - - if ( - $type instanceof SubtractableType - && $type->getSubtractedType() !== null - ) { - $isSuperType = $type->getSubtractedType()->isSuperTypeOf($this); - if ($isSuperType->yes()) { - return TrinaryLogic::createNo(); - } - } - - $thisClassName = $this->className; - $thatClassName = $type->getClassName(); - - if ($thatClassName === $thisClassName) { - return TrinaryLogic::createYes(); - } - - $broker = Broker::getInstance(); - - if (!$broker->hasClass($thisClassName) || !$broker->hasClass($thatClassName)) { - return TrinaryLogic::createMaybe(); - } - - $thisClassReflection = $broker->getClass($thisClassName); - $thatClassReflection = $broker->getClass($thatClassName); - - if ($thisClassReflection->getName() === $thatClassReflection->getName()) { - return TrinaryLogic::createYes(); - } - - if ($thatClassReflection->isSubclassOf($thisClassName)) { - return TrinaryLogic::createYes(); - } - - if ($thisClassReflection->isSubclassOf($thatClassName)) { - return TrinaryLogic::createMaybe(); - } - - if ($thisClassReflection->isInterface() && !$thatClassReflection->getNativeReflection()->isFinal()) { - return TrinaryLogic::createMaybe(); - } - - if ($thatClassReflection->isInterface() && !$thisClassReflection->getNativeReflection()->isFinal()) { - return TrinaryLogic::createMaybe(); - } - - return TrinaryLogic::createNo(); - } - - public function equals(Type $type): bool - { - if (!$type instanceof self) { - return false; - } - - if ($this->className !== $type->className) { - return false; - } - - if ($this->subtractedType === null) { - if ($type->subtractedType === null) { - return true; - } - - return false; - } - - if ($type->subtractedType === null) { - return false; - } - - return $this->subtractedType->equals($type->subtractedType); - } - - private function checkSubclassAcceptability(string $thatClass): TrinaryLogic - { - if ($this->className === $thatClass) { - return TrinaryLogic::createYes(); - } - - $broker = Broker::getInstance(); - - if (!$broker->hasClass($this->className) || !$broker->hasClass($thatClass)) { - return TrinaryLogic::createNo(); - } - - $thisReflection = $broker->getClass($this->className); - $thatReflection = $broker->getClass($thatClass); - - if ($thisReflection->getName() === $thatReflection->getName()) { - // class alias - return TrinaryLogic::createYes(); - } - - if ($thisReflection->isInterface() && $thatReflection->isInterface()) { - return TrinaryLogic::createFromBoolean( - $thatReflection->getNativeReflection()->implementsInterface($this->className) - ); - } - - return TrinaryLogic::createFromBoolean( - $thatReflection->isSubclassOf($this->className) - ); - } - - public function describe(VerbosityLevel $level): string - { - return $level->handle( - function (): string { - $broker = Broker::getInstance(); - if (!$broker->hasClass($this->className)) { - return $this->className; - } - - return $broker->getClass($this->className)->getDisplayName(); - }, - function (): string { - return $this->className; - }, - function () use ($level): string { - $description = $this->className; - if ($this->subtractedType !== null) { - $description .= sprintf('~%s', $this->subtractedType->describe($level)); - } - - return $description; - } - ); - } - - public function toNumber(): Type - { - if ($this->isInstanceOf('SimpleXMLElement')->yes()) { - return new UnionType([ - new FloatType(), - new IntegerType(), - ]); - } - - return new ErrorType(); - } - - public function toInteger(): Type - { - if ($this->isInstanceOf('SimpleXMLElement')->yes()) { - return new IntegerType(); - } - - return new ErrorType(); - } - - public function toFloat(): Type - { - if ($this->isInstanceOf('SimpleXMLElement')->yes()) { - return new FloatType(); - } - return new ErrorType(); - } - - public function toString(): Type - { - $broker = Broker::getInstance(); - if (!$broker->hasClass($this->className)) { - return new ErrorType(); - } - - $classReflection = $broker->getClass($this->className); - if ($classReflection->hasNativeMethod('__toString')) { - return new StringType(); - } - - return new ErrorType(); - } - - public function toArray(): Type - { - $broker = Broker::getInstance(); - if (!$broker->hasClass($this->className)) { - return new ArrayType(new MixedType(), new MixedType()); - } - - $classReflection = $broker->getClass($this->className); - if ( - !$classReflection->getNativeReflection()->isUserDefined() - || UniversalObjectCratesClassReflectionExtension::isUniversalObjectCrate( - $broker, - $broker->getUniversalObjectCratesClasses(), - $classReflection - ) - ) { - return new ArrayType(new MixedType(), new MixedType()); - } - $arrayKeys = []; - $arrayValues = []; - - do { - foreach ($classReflection->getNativeReflection()->getProperties() as $nativeProperty) { - if ($nativeProperty->isStatic()) { - continue; - } - - $declaringClass = $broker->getClass($nativeProperty->getDeclaringClass()->getName()); - $property = $declaringClass->getNativeProperty($nativeProperty->getName()); - - $keyName = $nativeProperty->getName(); - if ($nativeProperty->isPrivate()) { - $keyName = sprintf( - "\0%s\0%s", - $declaringClass->getName(), - $keyName - ); - } elseif ($nativeProperty->isProtected()) { - $keyName = sprintf( - "\0*\0%s", - $keyName - ); - } - - $arrayKeys[] = new ConstantStringType($keyName); - $arrayValues[] = $property->getType(); - } - - $classReflection = $classReflection->getParentClass(); - } while ($classReflection !== false); - - return new ConstantArrayType($arrayKeys, $arrayValues); - } - - public function canAccessProperties(): TrinaryLogic - { - return TrinaryLogic::createYes(); - } - - public function canCallMethods(): TrinaryLogic - { - if (strtolower($this->className) === 'stdclass') { - return TrinaryLogic::createNo(); - } - - return TrinaryLogic::createYes(); - } - - public function hasMethod(string $methodName): TrinaryLogic - { - $broker = Broker::getInstance(); - if (!$broker->hasClass($this->className)) { - return TrinaryLogic::createMaybe(); - } - - $classReflection = $broker->getClass($this->className); - if ($classReflection->hasMethod($methodName)) { - return TrinaryLogic::createYes(); - } - - if ($classReflection->isFinal()) { - return TrinaryLogic::createNo(); - } - - return TrinaryLogic::createMaybe(); - } - - public function getMethod(string $methodName, ClassMemberAccessAnswerer $scope): MethodReflection - { - $broker = Broker::getInstance(); - return $broker->getClass($this->className)->getMethod($methodName, $scope); - } - - public function canAccessConstants(): TrinaryLogic - { - return TrinaryLogic::createYes(); - } - - public function hasConstant(string $constantName): TrinaryLogic - { - $broker = Broker::getInstance(); - if (!$broker->hasClass($this->className)) { - return TrinaryLogic::createNo(); - } - - return TrinaryLogic::createFromBoolean( - $broker->getClass($this->className)->hasConstant($constantName) - ); - } - - public function getConstant(string $constantName): ConstantReflection - { - $broker = Broker::getInstance(); - return $broker->getClass($this->className)->getConstant($constantName); - } - - public function isIterable(): TrinaryLogic - { - return $this->isInstanceOf(\Traversable::class); - } - - public function isIterableAtLeastOnce(): TrinaryLogic - { - return $this->isInstanceOf(\Traversable::class) - ->and(TrinaryLogic::createMaybe()); - } - - public function getIterableKeyType(): Type - { - $broker = Broker::getInstance(); - - if (!$broker->hasClass($this->className)) { - return new ErrorType(); - } - - $classReflection = $broker->getClass($this->className); - - if ($this->isInstanceOf(\Iterator::class)->yes()) { - return ParametersAcceptorSelector::selectSingle($classReflection->getNativeMethod('key')->getVariants())->getReturnType(); - } - - if ($this->isInstanceOf(\IteratorAggregate::class)->yes()) { - return RecursionGuard::run($this, static function () use ($classReflection): Type { - return ParametersAcceptorSelector::selectSingle( - $classReflection->getNativeMethod('getIterator')->getVariants() - )->getReturnType()->getIterableKeyType(); - }); - } - - if ($this->isInstanceOf(\Traversable::class)->yes()) { - return new MixedType(); - } - - return new ErrorType(); - } - - public function getIterableValueType(): Type - { - $broker = Broker::getInstance(); - - if (!$broker->hasClass($this->className)) { - return new ErrorType(); - } - - $classReflection = $broker->getClass($this->className); - - if ($this->isInstanceOf(\Iterator::class)->yes()) { - return ParametersAcceptorSelector::selectSingle( - $classReflection->getNativeMethod('current')->getVariants() - )->getReturnType(); - } - - if ($this->isInstanceOf(\IteratorAggregate::class)->yes()) { - return RecursionGuard::run($this, static function () use ($classReflection): Type { - return ParametersAcceptorSelector::selectSingle( - $classReflection->getNativeMethod('getIterator')->getVariants() - )->getReturnType()->getIterableValueType(); - }); - } - - if ($this->isInstanceOf(\Traversable::class)->yes()) { - return new MixedType(); - } - - return new ErrorType(); - } - - public function isArray(): TrinaryLogic - { - return TrinaryLogic::createNo(); - } - - private function isExtraOffsetAccessibleClass(): TrinaryLogic - { - $broker = Broker::getInstance(); - if (!$broker->hasClass($this->className)) { - return TrinaryLogic::createMaybe(); - } - - $classReflection = $broker->getClass($this->className); - - foreach (self::EXTRA_OFFSET_CLASSES as $extraOffsetClass) { - if ($classReflection->getName() === $extraOffsetClass) { - return TrinaryLogic::createYes(); - } - if ($classReflection->isSubclassOf($extraOffsetClass)) { - return TrinaryLogic::createYes(); - } - } - - return TrinaryLogic::createNo(); - } - - public function isOffsetAccessible(): TrinaryLogic - { - return $this->isInstanceOf(\ArrayAccess::class)->or( - $this->isExtraOffsetAccessibleClass() - ); - } - - public function hasOffsetValueType(Type $offsetType): TrinaryLogic - { - $broker = Broker::getInstance(); - if (!$broker->hasClass($this->className)) { - return TrinaryLogic::createNo(); - } - - return $this->isExtraOffsetAccessibleClass() - ->or($this->isInstanceOf(\ArrayAccess::class)) - ->and(TrinaryLogic::createMaybe()); - } - - public function getOffsetValueType(Type $offsetType): Type - { - $broker = Broker::getInstance(); - - if (!$broker->hasClass($this->className)) { - return new ErrorType(); - } - - if (!$this->isExtraOffsetAccessibleClass()->no()) { - return new MixedType(); - } - - if ($this->isInstanceOf(\ArrayAccess::class)->yes()) { - $classReflection = $broker->getClass($this->className); - return RecursionGuard::run($this, static function () use ($classReflection): Type { - return ParametersAcceptorSelector::selectSingle($classReflection->getNativeMethod('offsetGet')->getVariants())->getReturnType(); - }); - } - - return new ErrorType(); - } - - public function setOffsetValueType(?Type $offsetType, Type $valueType): Type - { - if ($this->isOffsetAccessible()->no()) { - return new ErrorType(); - } - - $broker = Broker::getInstance(); - if ($this->isInstanceOf(\ArrayAccess::class)->yes()) { - $classReflection = $broker->getClass($this->className); - $acceptedValueType = new NeverType(); - $acceptedOffsetType = RecursionGuard::run($this, function () use ($classReflection, &$acceptedValueType): Type { - $parameters = ParametersAcceptorSelector::selectSingle($classReflection->getNativeMethod('offsetSet')->getVariants())->getParameters(); - if (count($parameters) < 2) { - throw new \PHPStan\ShouldNotHappenException(sprintf( - 'Method %s::%s() has less than 2 parameters.', - $this->className, - 'offsetSet' - )); - } - - $offsetParameter = $parameters[0]; - $acceptedValueType = $parameters[1]->getType(); - - return $offsetParameter->getType(); - }); - - if ($offsetType === null) { - $offsetType = new NullType(); - } - - if ( - (!$offsetType instanceof MixedType && !$acceptedOffsetType->isSuperTypeOf($offsetType)->yes()) - || (!$valueType instanceof MixedType && !$acceptedValueType->isSuperTypeOf($valueType)->yes()) - ) { - return new ErrorType(); - } - } - - // in the future we may return intersection of $this and OffsetAccessibleType() - return $this; - } - - public function isCallable(): TrinaryLogic - { - $parametersAcceptors = $this->findCallableParametersAcceptors(); - if ($parametersAcceptors === null) { - return TrinaryLogic::createNo(); - } - - if ( - count($parametersAcceptors) === 1 - && $parametersAcceptors[0] instanceof TrivialParametersAcceptor - ) { - return TrinaryLogic::createMaybe(); - } - - return TrinaryLogic::createYes(); - } - - /** - * @param \PHPStan\Reflection\ClassMemberAccessAnswerer $scope - * @return \PHPStan\Reflection\ParametersAcceptor[] - */ - public function getCallableParametersAcceptors(ClassMemberAccessAnswerer $scope): array - { - if ($this->className === \Closure::class) { - return [new TrivialParametersAcceptor()]; - } - $parametersAcceptors = $this->findCallableParametersAcceptors(); - if ($parametersAcceptors === null) { - throw new \PHPStan\ShouldNotHappenException(); - } - - return $parametersAcceptors; - } - - /** - * @return \PHPStan\Reflection\ParametersAcceptor[]|null - */ - private function findCallableParametersAcceptors(): ?array - { - $broker = Broker::getInstance(); - - if (!$broker->hasClass($this->className)) { - return [new TrivialParametersAcceptor()]; - } - - $classReflection = $broker->getClass($this->className); - if ($classReflection->hasNativeMethod('__invoke')) { - return $classReflection->getNativeMethod('__invoke')->getVariants(); - } - - if (!$classReflection->getNativeReflection()->isFinal()) { - return [new TrivialParametersAcceptor()]; - } - - return null; - } - - public function isCloneable(): TrinaryLogic - { - return TrinaryLogic::createYes(); - } - - /** - * @param mixed[] $properties - * @return Type - */ - public static function __set_state(array $properties): Type - { - return new self( - $properties['className'], - $properties['subtractedType'] ?? null - ); - } - - public function isInstanceOf(string $className): TrinaryLogic - { - $broker = Broker::getInstance(); - - if (!$broker->hasClass($this->className)) { - return TrinaryLogic::createMaybe(); - } - - $classReflection = $broker->getClass($this->className); - if ($classReflection->isSubclassOf($className) || $classReflection->getName() === $className) { - return TrinaryLogic::createYes(); - } - - if ($classReflection->isInterface()) { - return TrinaryLogic::createMaybe(); - } - - return TrinaryLogic::createNo(); - } - - public function subtract(Type $type): Type - { - if ($this->subtractedType !== null) { - $type = TypeCombinator::union($this->subtractedType, $type); - } - - return new self($this->className, $type); - } - - public function getTypeWithoutSubtractedType(): Type - { - return new self($this->className); - } - - public function changeSubtractedType(?Type $subtractedType): Type - { - return new self($this->className, $subtractedType); - } - - public function getSubtractedType(): ?Type - { - return $this->subtractedType; - } - - public function traverse(callable $cb): Type - { - $subtractedType = $this->subtractedType !== null ? $cb($this->subtractedType) : null; - - if ($subtractedType !== $this->subtractedType) { - return new self( - $this->className, - $subtractedType - ); - } - - return $this; - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/ObjectWithoutClassType.php b/vendor/phpstan/phpstan/src/Type/ObjectWithoutClassType.php deleted file mode 100644 index 9ab74de..0000000 --- a/vendor/phpstan/phpstan/src/Type/ObjectWithoutClassType.php +++ /dev/null @@ -1,164 +0,0 @@ -subtractedType = $subtractedType; - } - - /** - * @return string[] - */ - public function getReferencedClasses(): array - { - return []; - } - - public function accepts(Type $type, bool $strictTypes): TrinaryLogic - { - if ($type instanceof CompoundType) { - return CompoundTypeHelper::accepts($type, $this, $strictTypes); - } - - return TrinaryLogic::createFromBoolean( - $type instanceof self || $type instanceof TypeWithClassName - ); - } - - public function isSuperTypeOf(Type $type): TrinaryLogic - { - if ($type instanceof CompoundType) { - return $type->isSubTypeOf($this); - } - - if ($type instanceof self) { - if ($this->subtractedType === null) { - return TrinaryLogic::createYes(); - } - if ($type->subtractedType !== null) { - $isSuperType = $type->subtractedType->isSuperTypeOf($this->subtractedType); - if ($isSuperType->yes()) { - return TrinaryLogic::createYes(); - } - } - - return TrinaryLogic::createMaybe(); - } - - if ($type instanceof TypeWithClassName) { - if ($this->subtractedType === null) { - return TrinaryLogic::createYes(); - } - - return $this->subtractedType->isSuperTypeOf($type)->negate(); - } - - return TrinaryLogic::createNo(); - } - - public function equals(Type $type): bool - { - if (!$type instanceof self) { - return false; - } - - if ($this->subtractedType === null) { - if ($type->subtractedType === null) { - return true; - } - - return false; - } - - if ($type->subtractedType === null) { - return false; - } - - return $this->subtractedType->equals($type->subtractedType); - } - - public function describe(VerbosityLevel $level): string - { - return $level->handle( - static function (): string { - return 'object'; - }, - static function (): string { - return 'object'; - }, - function () use ($level): string { - $description = 'object'; - if ($this->subtractedType !== null) { - $description .= sprintf('~%s', $this->subtractedType->describe($level)); - } - - return $description; - } - ); - } - - public function subtract(Type $type): Type - { - if ($type instanceof self) { - return new NeverType(); - } - if ($this->subtractedType !== null) { - $type = TypeCombinator::union($this->subtractedType, $type); - } - - return new self($type); - } - - public function getTypeWithoutSubtractedType(): Type - { - return new self(); - } - - public function changeSubtractedType(?Type $subtractedType): Type - { - return new self($subtractedType); - } - - public function getSubtractedType(): ?Type - { - return $this->subtractedType; - } - - - public function traverse(callable $cb): Type - { - $subtractedType = $this->subtractedType !== null ? $cb($this->subtractedType) : null; - - if ($subtractedType !== $this->subtractedType) { - return new self($subtractedType); - } - - return $this; - } - - /** - * @param mixed[] $properties - * @return Type - */ - public static function __set_state(array $properties): Type - { - return new self($properties['subtractedType'] ?? null); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/OperatorTypeSpecifyingExtension.php b/vendor/phpstan/phpstan/src/Type/OperatorTypeSpecifyingExtension.php deleted file mode 100644 index 7766086..0000000 --- a/vendor/phpstan/phpstan/src/Type/OperatorTypeSpecifyingExtension.php +++ /dev/null @@ -1,12 +0,0 @@ - 0, - 'array_reverse' => 0, - 'array_change_key_case' => 0, - 'array_diff_assoc' => 0, - 'array_diff_key' => 0, - 'array_diff_uassoc' => 0, - 'array_diff_ukey' => 0, - 'array_diff' => 0, - 'array_udiff_assoc' => 0, - 'array_udiff_uassoc' => 0, - 'array_udiff' => 0, - 'array_intersect_assoc' => 0, - 'array_intersect_key' => 0, - 'array_intersect_uassoc' => 0, - 'array_intersect_ukey' => 0, - 'array_intersect' => 0, - 'array_uintersect_assoc' => 0, - 'array_uintersect_uassoc' => 0, - 'array_uintersect' => 0, - ]; - - public function isFunctionSupported(FunctionReflection $functionReflection): bool - { - return isset($this->functionNames[$functionReflection->getName()]); - } - - public function getTypeFromFunctionCall(FunctionReflection $functionReflection, FuncCall $functionCall, Scope $scope): Type - { - $argumentPosition = $this->functionNames[$functionReflection->getName()]; - - if (!isset($functionCall->args[$argumentPosition])) { - return ParametersAcceptorSelector::selectSingle($functionReflection->getVariants())->getReturnType(); - } - - $argument = $functionCall->args[$argumentPosition]; - $argumentType = $scope->getType($argument->value); - $argumentKeyType = $argumentType->getIterableKeyType(); - $argumentValueType = $argumentType->getIterableValueType(); - if ($argument->unpack) { - $argumentKeyType = TypeUtils::generalizeType($argumentKeyType); - $argumentValueType = TypeUtils::generalizeType($argumentValueType->getIterableValueType()); - } - - return new ArrayType( - $argumentKeyType, - $argumentValueType - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/ArrayFillFunctionReturnTypeExtension.php b/vendor/phpstan/phpstan/src/Type/Php/ArrayFillFunctionReturnTypeExtension.php deleted file mode 100644 index 8b1819d..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/ArrayFillFunctionReturnTypeExtension.php +++ /dev/null @@ -1,72 +0,0 @@ -getName() === 'array_fill'; - } - - public function getTypeFromFunctionCall(FunctionReflection $functionReflection, FuncCall $functionCall, Scope $scope): Type - { - if (count($functionCall->args) < 3) { - return ParametersAcceptorSelector::selectSingle($functionReflection->getVariants())->getReturnType(); - } - - $startIndexType = $scope->getType($functionCall->args[0]->value); - $numberType = $scope->getType($functionCall->args[1]->value); - $valueType = $scope->getType($functionCall->args[2]->value); - - if ( - $startIndexType instanceof ConstantIntegerType - && $numberType instanceof ConstantIntegerType - && $numberType->getValue() <= static::MAX_SIZE_USE_CONSTANT_ARRAY - ) { - $arrayBuilder = ConstantArrayTypeBuilder::createEmpty(); - $nextIndex = $startIndexType->getValue(); - for ($i = 0; $i < $numberType->getValue(); $i++) { - $arrayBuilder->setOffsetValueType( - new ConstantIntegerType($nextIndex), - $valueType - ); - if ($nextIndex < 0) { - $nextIndex = 0; - } else { - $nextIndex++; - } - } - - return $arrayBuilder->getArray(); - } - - if ( - $numberType instanceof ConstantIntegerType - && $numberType->getValue() > 0 - ) { - return new IntersectionType([ - new ArrayType(new IntegerType(), $valueType), - new NonEmptyArrayType(), - ]); - } - - return new ArrayType(new IntegerType(), $valueType); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/ArrayFillKeysFunctionReturnTypeExtension.php b/vendor/phpstan/phpstan/src/Type/Php/ArrayFillKeysFunctionReturnTypeExtension.php deleted file mode 100644 index 28ffedb..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/ArrayFillKeysFunctionReturnTypeExtension.php +++ /dev/null @@ -1,48 +0,0 @@ -getName() === 'array_fill_keys'; - } - - public function getTypeFromFunctionCall(FunctionReflection $functionReflection, FuncCall $functionCall, Scope $scope): Type - { - if (count($functionCall->args) < 2) { - return ParametersAcceptorSelector::selectSingle($functionReflection->getVariants())->getReturnType(); - } - - $valueType = $scope->getType($functionCall->args[1]->value); - $keysType = $scope->getType($functionCall->args[0]->value); - $constantArrays = TypeUtils::getConstantArrays($keysType); - if (count($constantArrays) === 0) { - return new ArrayType($keysType->getIterableValueType(), $valueType); - } - - $arrayTypes = []; - foreach ($constantArrays as $constantArray) { - $arrayBuilder = ConstantArrayTypeBuilder::createEmpty(); - foreach ($constantArray->getValueTypes() as $keyType) { - $arrayBuilder->setOffsetValueType($keyType, $valueType); - } - $arrayTypes[] = $arrayBuilder->getArray(); - } - - return TypeCombinator::union(...$arrayTypes); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/ArrayFilterFunctionReturnTypeReturnTypeExtension.php b/vendor/phpstan/phpstan/src/Type/Php/ArrayFilterFunctionReturnTypeReturnTypeExtension.php deleted file mode 100644 index 24a851b..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/ArrayFilterFunctionReturnTypeReturnTypeExtension.php +++ /dev/null @@ -1,124 +0,0 @@ -getName() === 'array_filter'; - } - - public function getTypeFromFunctionCall(FunctionReflection $functionReflection, FuncCall $functionCall, Scope $scope): Type - { - $arrayArg = $functionCall->args[0]->value ?? null; - $callbackArg = $functionCall->args[1]->value ?? null; - $flagArg = $functionCall->args[2]->value ?? null; - - if ($arrayArg !== null) { - $arrayArgType = $scope->getType($arrayArg); - $keyType = $arrayArgType->getIterableKeyType(); - $itemType = $arrayArgType->getIterableValueType(); - - if ($arrayArgType instanceof MixedType) { - return new BenevolentUnionType([ - new ArrayType(new MixedType(), new MixedType()), - new NullType(), - ]); - } - - if ($callbackArg === null) { - return TypeCombinator::union( - ...array_map([$this, 'removeFalsey'], TypeUtils::getArrays($arrayArgType)) - ); - } - - if ($flagArg === null && $callbackArg instanceof Closure && count($callbackArg->stmts) === 1) { - $statement = $callbackArg->stmts[0]; - if ($statement instanceof Return_ && $statement->expr !== null && count($callbackArg->params) > 0) { - if (!$callbackArg->params[0]->var instanceof Variable || !is_string($callbackArg->params[0]->var->name)) { - throw new \PHPStan\ShouldNotHappenException(); - } - $itemVariableName = $callbackArg->params[0]->var->name; - $scope = $scope->assignVariable($itemVariableName, $itemType); - $scope = $scope->filterByTruthyValue($statement->expr); - $itemType = $scope->getVariableType($itemVariableName); - } - } - - } else { - $keyType = new MixedType(); - $itemType = new MixedType(); - } - - return new ArrayType($keyType, $itemType); - } - - public function removeFalsey(Type $type): Type - { - $falseyTypes = new UnionType([ - new NullType(), - new ConstantBooleanType(false), - new ConstantIntegerType(0), - new ConstantFloatType(0.0), - new ConstantStringType(''), - new ConstantArrayType([], []), - ]); - - if ($type instanceof ConstantArrayType) { - $keys = $type->getKeyTypes(); - $values = $type->getValueTypes(); - - $generalize = false; - - foreach ($values as $offset => $value) { - $isFalsey = $falseyTypes->isSuperTypeOf($value); - - if ($isFalsey->yes()) { - unset($keys[$offset], $values[$offset]); - } elseif ($isFalsey->maybe()) { - $values[$offset] = TypeCombinator::remove($values[$offset], $falseyTypes); - $generalize = true; - } - } - - $filteredArray = new ConstantArrayType(array_values($keys), array_values($values)); - - return $generalize ? $filteredArray->generalize() : $filteredArray; - } - - $keyType = $type->getIterableKeyType(); - $valueType = $type->getIterableValueType(); - - $valueType = TypeCombinator::remove($valueType, $falseyTypes); - - if ($valueType instanceof NeverType) { - return new ConstantArrayType([], []); - } - - return new ArrayType($keyType, $valueType); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/ArrayKeyDynamicReturnTypeExtension.php b/vendor/phpstan/phpstan/src/Type/Php/ArrayKeyDynamicReturnTypeExtension.php deleted file mode 100644 index 08cb301..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/ArrayKeyDynamicReturnTypeExtension.php +++ /dev/null @@ -1,41 +0,0 @@ -getName() === 'key'; - } - - public function getTypeFromFunctionCall(FunctionReflection $functionReflection, FuncCall $functionCall, Scope $scope): Type - { - if (!isset($functionCall->args[0])) { - return ParametersAcceptorSelector::selectSingle($functionReflection->getVariants())->getReturnType(); - } - - $argType = $scope->getType($functionCall->args[0]->value); - $iterableAtLeastOnce = $argType->isIterableAtLeastOnce(); - if ($iterableAtLeastOnce->no()) { - return new NullType(); - } - - $keyType = $argType->getIterableKeyType(); - if ($iterableAtLeastOnce->yes()) { - return $keyType; - } - - return TypeCombinator::union($keyType, new NullType()); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/ArrayKeyExistsFunctionTypeSpecifyingExtension.php b/vendor/phpstan/phpstan/src/Type/Php/ArrayKeyExistsFunctionTypeSpecifyingExtension.php deleted file mode 100644 index 4726b44..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/ArrayKeyExistsFunctionTypeSpecifyingExtension.php +++ /dev/null @@ -1,65 +0,0 @@ -typeSpecifier = $typeSpecifier; - } - - public function isFunctionSupported( - FunctionReflection $functionReflection, - FuncCall $node, - TypeSpecifierContext $context - ): bool - { - return $functionReflection->getName() === 'array_key_exists' - && count($node->args) >= 2 - && !$context->null(); - } - - public function specifyTypes( - FunctionReflection $functionReflection, - FuncCall $node, - Scope $scope, - TypeSpecifierContext $context - ): SpecifiedTypes - { - $keyType = $scope->getType($node->args[0]->value); - - if ($context->truthy()) { - $type = TypeCombinator::intersect( - new ArrayType(new MixedType(), new MixedType()), - new HasOffsetType($keyType) - ); - } else { - $type = new HasOffsetType($keyType); - } - - return $this->typeSpecifier->create( - $node->args[1]->value, - $type, - $context - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/ArrayKeyFirstDynamicReturnTypeExtension.php b/vendor/phpstan/phpstan/src/Type/Php/ArrayKeyFirstDynamicReturnTypeExtension.php deleted file mode 100644 index c868e7a..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/ArrayKeyFirstDynamicReturnTypeExtension.php +++ /dev/null @@ -1,58 +0,0 @@ -getName() === 'array_key_first'; - } - - public function getTypeFromFunctionCall(FunctionReflection $functionReflection, FuncCall $functionCall, Scope $scope): Type - { - if (!isset($functionCall->args[0])) { - return ParametersAcceptorSelector::selectSingle($functionReflection->getVariants())->getReturnType(); - } - - $argType = $scope->getType($functionCall->args[0]->value); - $iterableAtLeastOnce = $argType->isIterableAtLeastOnce(); - if ($iterableAtLeastOnce->no()) { - return new NullType(); - } - - $constantArrays = TypeUtils::getConstantArrays($argType); - if (count($constantArrays) > 0) { - $keyTypes = []; - foreach ($constantArrays as $constantArray) { - $arrayKeyTypes = $constantArray->getKeyTypes(); - if (count($arrayKeyTypes) === 0) { - $keyTypes[] = new NullType(); - continue; - } - - $keyTypes[] = $arrayKeyTypes[0]; - } - - return TypeCombinator::union(...$keyTypes); - } - - $keyType = $argType->getIterableKeyType(); - if ($iterableAtLeastOnce->yes()) { - return $keyType; - } - - return TypeCombinator::union($keyType, new NullType()); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/ArrayKeyLastDynamicReturnTypeExtension.php b/vendor/phpstan/phpstan/src/Type/Php/ArrayKeyLastDynamicReturnTypeExtension.php deleted file mode 100644 index 25bec78..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/ArrayKeyLastDynamicReturnTypeExtension.php +++ /dev/null @@ -1,58 +0,0 @@ -getName() === 'array_key_last'; - } - - public function getTypeFromFunctionCall(FunctionReflection $functionReflection, FuncCall $functionCall, Scope $scope): Type - { - if (!isset($functionCall->args[0])) { - return ParametersAcceptorSelector::selectSingle($functionReflection->getVariants())->getReturnType(); - } - - $argType = $scope->getType($functionCall->args[0]->value); - $iterableAtLeastOnce = $argType->isIterableAtLeastOnce(); - if ($iterableAtLeastOnce->no()) { - return new NullType(); - } - - $constantArrays = TypeUtils::getConstantArrays($argType); - if (count($constantArrays) > 0) { - $keyTypes = []; - foreach ($constantArrays as $constantArray) { - $arrayKeyTypes = $constantArray->getKeyTypes(); - if (count($arrayKeyTypes) === 0) { - $keyTypes[] = new NullType(); - continue; - } - - $keyTypes[] = $arrayKeyTypes[count($arrayKeyTypes) - 1]; - } - - return TypeCombinator::union(...$keyTypes); - } - - $keyType = $argType->getIterableKeyType(); - if ($iterableAtLeastOnce->yes()) { - return $keyType; - } - - return TypeCombinator::union($keyType, new NullType()); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/ArrayKeysFunctionDynamicReturnTypeExtension.php b/vendor/phpstan/phpstan/src/Type/Php/ArrayKeysFunctionDynamicReturnTypeExtension.php deleted file mode 100644 index 056294f..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/ArrayKeysFunctionDynamicReturnTypeExtension.php +++ /dev/null @@ -1,45 +0,0 @@ -getName() === 'array_keys'; - } - - public function getTypeFromFunctionCall(FunctionReflection $functionReflection, FuncCall $functionCall, Scope $scope): Type - { - $arrayArg = $functionCall->args[0]->value ?? null; - if ($arrayArg !== null) { - $valueType = $scope->getType($arrayArg); - if ($valueType->isArray()->yes()) { - if ($valueType instanceof ConstantArrayType) { - return $valueType->getKeysArray(); - } - $keyType = $valueType->getIterableKeyType(); - return TypeCombinator::intersect(new ArrayType(new IntegerType(), $keyType), ...TypeUtils::getAccessoryTypes($valueType)); - } - } - - return new ArrayType( - new IntegerType(), - new UnionType([new StringType(), new IntegerType()]) - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/ArrayMapFunctionReturnTypeExtension.php b/vendor/phpstan/phpstan/src/Type/Php/ArrayMapFunctionReturnTypeExtension.php deleted file mode 100644 index e21cdbf..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/ArrayMapFunctionReturnTypeExtension.php +++ /dev/null @@ -1,69 +0,0 @@ -getName() === 'array_map'; - } - - public function getTypeFromFunctionCall(FunctionReflection $functionReflection, FuncCall $functionCall, Scope $scope): Type - { - if (count($functionCall->args) < 2) { - return ParametersAcceptorSelector::selectSingle($functionReflection->getVariants())->getReturnType(); - } - - $valueType = new MixedType(); - $callableType = $scope->getType($functionCall->args[0]->value); - if (!$callableType->isCallable()->no()) { - $valueType = ParametersAcceptorSelector::selectFromArgs( - $scope, - $functionCall->args, - $callableType->getCallableParametersAcceptors($scope) - )->getReturnType(); - } - - $arrayType = $scope->getType($functionCall->args[1]->value); - $constantArrays = TypeUtils::getConstantArrays($arrayType); - if (count($constantArrays) > 0) { - $arrayTypes = []; - foreach ($constantArrays as $constantArray) { - $returnedArrayBuilder = ConstantArrayTypeBuilder::createEmpty(); - foreach ($constantArray->getKeyTypes() as $keyType) { - $returnedArrayBuilder->setOffsetValueType( - $keyType, - $valueType - ); - } - $arrayTypes[] = $returnedArrayBuilder->getArray(); - } - - return TypeCombinator::union(...$arrayTypes); - } elseif ($arrayType->isArray()->yes()) { - return TypeCombinator::intersect(new ArrayType( - $arrayType->getIterableKeyType(), - $valueType - ), ...TypeUtils::getAccessoryTypes($arrayType)); - } - - return new ArrayType( - new MixedType(), - $valueType - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/ArrayMergeFunctionDynamicReturnTypeExtension.php b/vendor/phpstan/phpstan/src/Type/Php/ArrayMergeFunctionDynamicReturnTypeExtension.php deleted file mode 100644 index 38bb6b3..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/ArrayMergeFunctionDynamicReturnTypeExtension.php +++ /dev/null @@ -1,52 +0,0 @@ -getName() === 'array_merge'; - } - - public function getTypeFromFunctionCall(FunctionReflection $functionReflection, FuncCall $functionCall, Scope $scope): Type - { - if (!isset($functionCall->args[0])) { - return ParametersAcceptorSelector::selectSingle($functionReflection->getVariants())->getReturnType(); - } - - $keyTypes = []; - $valueTypes = []; - foreach ($functionCall->args as $arg) { - $argType = $scope->getType($arg->value); - if ($arg->unpack) { - $argType = $argType->getIterableValueType(); - if ($argType instanceof UnionType) { - foreach ($argType->getTypes() as $innerType) { - $argType = $innerType; - } - } - } - - $keyTypes[] = TypeUtils::generalizeType($argType->getIterableKeyType()); - $valueTypes[] = $argType->getIterableValueType(); - } - - return new ArrayType( - TypeCombinator::union(...$keyTypes), - TypeCombinator::union(...$valueTypes) - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/ArrayPointerFunctionsDynamicReturnTypeExtension.php b/vendor/phpstan/phpstan/src/Type/Php/ArrayPointerFunctionsDynamicReturnTypeExtension.php deleted file mode 100644 index 747d174..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/ArrayPointerFunctionsDynamicReturnTypeExtension.php +++ /dev/null @@ -1,72 +0,0 @@ -getName(), $this->functions, true); - } - - public function getTypeFromFunctionCall( - FunctionReflection $functionReflection, - FuncCall $functionCall, - Scope $scope - ): Type - { - if (count($functionCall->args) === 0) { - return ParametersAcceptorSelector::selectSingle($functionReflection->getVariants())->getReturnType(); - } - - $argType = $scope->getType($functionCall->args[0]->value); - $iterableAtLeastOnce = $argType->isIterableAtLeastOnce(); - if ($iterableAtLeastOnce->no()) { - return new ConstantBooleanType(false); - } - - $constantArrays = TypeUtils::getConstantArrays($argType); - if (count($constantArrays) > 0) { - $keyTypes = []; - foreach ($constantArrays as $constantArray) { - $arrayKeyTypes = $constantArray->getKeyTypes(); - if (count($arrayKeyTypes) === 0) { - $keyTypes[] = new ConstantBooleanType(false); - continue; - } - - $valueOffset = $functionReflection->getName() === 'reset' - ? $arrayKeyTypes[0] - : $arrayKeyTypes[count($arrayKeyTypes) - 1]; - - $keyTypes[] = $constantArray->getOffsetValueType($valueOffset); - } - - return TypeCombinator::union(...$keyTypes); - } - - $itemType = $argType->getIterableValueType(); - if ($iterableAtLeastOnce->yes()) { - return $itemType; - } - - return TypeCombinator::union($itemType, new ConstantBooleanType(false)); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/ArrayPopFunctionReturnTypeExtension.php b/vendor/phpstan/phpstan/src/Type/Php/ArrayPopFunctionReturnTypeExtension.php deleted file mode 100644 index 2e26f43..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/ArrayPopFunctionReturnTypeExtension.php +++ /dev/null @@ -1,58 +0,0 @@ -getName() === 'array_pop'; - } - - public function getTypeFromFunctionCall(FunctionReflection $functionReflection, FuncCall $functionCall, Scope $scope): Type - { - if (!isset($functionCall->args[0])) { - return ParametersAcceptorSelector::selectSingle($functionReflection->getVariants())->getReturnType(); - } - - $argType = $scope->getType($functionCall->args[0]->value); - $iterableAtLeastOnce = $argType->isIterableAtLeastOnce(); - if ($iterableAtLeastOnce->no()) { - return new NullType(); - } - - $constantArrays = TypeUtils::getConstantArrays($argType); - if (count($constantArrays) > 0) { - $valueTypes = []; - foreach ($constantArrays as $constantArray) { - $arrayKeyTypes = $constantArray->getKeyTypes(); - if (count($arrayKeyTypes) === 0) { - $valueTypes[] = new NullType(); - continue; - } - - $valueTypes[] = $constantArray->getOffsetValueType($arrayKeyTypes[count($arrayKeyTypes) - 1]); - } - - return TypeCombinator::union(...$valueTypes); - } - - $itemType = $argType->getIterableValueType(); - if ($iterableAtLeastOnce->yes()) { - return $itemType; - } - - return TypeCombinator::union($itemType, new NullType()); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/ArrayReduceFunctionReturnTypeExtension.php b/vendor/phpstan/phpstan/src/Type/Php/ArrayReduceFunctionReturnTypeExtension.php deleted file mode 100644 index ec876b4..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/ArrayReduceFunctionReturnTypeExtension.php +++ /dev/null @@ -1,67 +0,0 @@ -getName() === 'array_reduce'; - } - - public function getTypeFromFunctionCall(FunctionReflection $functionReflection, FuncCall $functionCall, Scope $scope): Type - { - if (!isset($functionCall->args[1])) { - return ParametersAcceptorSelector::selectSingle($functionReflection->getVariants())->getReturnType(); - } - - $callbackType = $scope->getType($functionCall->args[1]->value); - if ($callbackType->isCallable()->no()) { - return ParametersAcceptorSelector::selectSingle($functionReflection->getVariants())->getReturnType(); - } - - $callbackReturnType = ParametersAcceptorSelector::selectFromArgs( - $scope, - $functionCall->args, - $callbackType->getCallableParametersAcceptors($scope) - )->getReturnType(); - - if (isset($functionCall->args[2])) { - $initialType = $scope->getType($functionCall->args[2]->value); - } else { - $initialType = new NullType(); - } - - $arraysType = $scope->getType($functionCall->args[0]->value); - $constantArrays = TypeUtils::getConstantArrays($arraysType); - if (count($constantArrays) > 0) { - $onlyEmpty = true; - $onlyNonEmpty = true; - foreach ($constantArrays as $constantArray) { - $isEmpty = count($constantArray->getValueTypes()) === 0; - $onlyEmpty = $onlyEmpty && $isEmpty; - $onlyNonEmpty = $onlyNonEmpty && !$isEmpty; - } - - if ($onlyEmpty) { - return $initialType; - } - if ($onlyNonEmpty) { - return $callbackReturnType; - } - } - - return TypeCombinator::union($callbackReturnType, $initialType); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/ArraySearchFunctionDynamicReturnTypeExtension.php b/vendor/phpstan/phpstan/src/Type/Php/ArraySearchFunctionDynamicReturnTypeExtension.php deleted file mode 100644 index 21f616e..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/ArraySearchFunctionDynamicReturnTypeExtension.php +++ /dev/null @@ -1,165 +0,0 @@ -getName() === 'array_search'; - } - - public function getTypeFromFunctionCall(FunctionReflection $functionReflection, FuncCall $functionCall, Scope $scope): Type - { - $argsCount = count($functionCall->args); - if ($argsCount < 2) { - return ParametersAcceptorSelector::selectSingle($functionReflection->getVariants())->getReturnType(); - } - - $haystackArgType = $scope->getType($functionCall->args[1]->value); - $haystackIsArray = (new ArrayType(new MixedType(), new MixedType()))->isSuperTypeOf($haystackArgType); - if ($haystackIsArray->no()) { - return new NullType(); - } - - if ($argsCount < 3) { - return ParametersAcceptorSelector::selectSingle($functionReflection->getVariants())->getReturnType(); - } - - $strictArgType = $scope->getType($functionCall->args[2]->value); - if (!($strictArgType instanceof ConstantBooleanType) || $strictArgType->getValue() === false) { - return TypeCombinator::union($haystackArgType->getIterableKeyType(), new ConstantBooleanType(false), new NullType()); - } - - $needleArgType = $scope->getType($functionCall->args[0]->value); - if ($haystackArgType->getIterableValueType()->isSuperTypeOf($needleArgType)->no()) { - return new ConstantBooleanType(false); - } - - $typesFromConstantArrays = []; - if ($haystackIsArray->maybe()) { - $typesFromConstantArrays[] = new NullType(); - } - - $haystackArrays = $this->pickArrays($haystackArgType); - if (count($haystackArrays) === 0) { - return ParametersAcceptorSelector::selectSingle($functionReflection->getVariants())->getReturnType(); - } - - $arrays = []; - $typesFromConstantArraysCount = 0; - foreach ($haystackArrays as $haystackArray) { - if (!$haystackArray instanceof ConstantArrayType) { - $arrays[] = $haystackArray; - continue; - } - - $typesFromConstantArrays[] = $this->resolveTypeFromConstantHaystackAndNeedle($needleArgType, $haystackArray); - $typesFromConstantArraysCount++; - } - - if ( - $typesFromConstantArraysCount > 0 - && count($haystackArrays) === $typesFromConstantArraysCount - ) { - return TypeCombinator::union(...$typesFromConstantArrays); - } - - $iterableKeyType = TypeCombinator::union(...$arrays)->getIterableKeyType(); - if ($iterableKeyType instanceof BenevolentUnionType) { - $iterableKeyType = new MixedType(); - } - - return TypeCombinator::union( - $iterableKeyType, - new ConstantBooleanType(false), - ...$typesFromConstantArrays - ); - } - - private function resolveTypeFromConstantHaystackAndNeedle(Type $needle, ConstantArrayType $haystack): Type - { - $matchesByType = []; - - foreach ($haystack->getValueTypes() as $index => $valueType) { - $isNeedleSuperType = $valueType->isSuperTypeOf($needle); - if ($isNeedleSuperType->no()) { - $matchesByType[] = new ConstantBooleanType(false); - continue; - } - - if ($needle instanceof ConstantScalarType && $valueType instanceof ConstantScalarType - && $needle->getValue() === $valueType->getValue() - ) { - return $haystack->getKeyTypes()[$index]; - } - - $matchesByType[] = $haystack->getKeyTypes()[$index]; - if (!$isNeedleSuperType->maybe()) { - continue; - } - - $matchesByType[] = new ConstantBooleanType(false); - } - - if (count($matchesByType) > 0) { - if ( - $haystack->getIterableValueType()->accepts($needle, true)->yes() - && $needle->isSuperTypeOf(new ObjectWithoutClassType())->no() - ) { - return TypeCombinator::union(...$matchesByType); - } - - return TypeCombinator::union(new ConstantBooleanType(false), ...$matchesByType); - } - - return new ConstantBooleanType(false); - } - - /** - * @param Type $type - * @return Type[] - */ - private function pickArrays(Type $type): array - { - if ($type instanceof ArrayType) { - return [$type]; - } - - if ($type instanceof UnionType || $type instanceof IntersectionType) { - $arrayTypes = []; - - foreach ($type->getTypes() as $innerType) { - if (!($innerType instanceof ArrayType)) { - continue; - } - - $arrayTypes[] = $innerType; - } - - return $arrayTypes; - } - - return []; - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/ArrayShiftFunctionReturnTypeExtension.php b/vendor/phpstan/phpstan/src/Type/Php/ArrayShiftFunctionReturnTypeExtension.php deleted file mode 100644 index b7feab7..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/ArrayShiftFunctionReturnTypeExtension.php +++ /dev/null @@ -1,58 +0,0 @@ -getName() === 'array_shift'; - } - - public function getTypeFromFunctionCall(FunctionReflection $functionReflection, FuncCall $functionCall, Scope $scope): Type - { - if (!isset($functionCall->args[0])) { - return ParametersAcceptorSelector::selectSingle($functionReflection->getVariants())->getReturnType(); - } - - $argType = $scope->getType($functionCall->args[0]->value); - $iterableAtLeastOnce = $argType->isIterableAtLeastOnce(); - if ($iterableAtLeastOnce->no()) { - return new NullType(); - } - - $constantArrays = TypeUtils::getConstantArrays($argType); - if (count($constantArrays) > 0) { - $valueTypes = []; - foreach ($constantArrays as $constantArray) { - $arrayKeyTypes = $constantArray->getKeyTypes(); - if (count($arrayKeyTypes) === 0) { - $valueTypes[] = new NullType(); - continue; - } - - $valueTypes[] = $constantArray->getOffsetValueType($arrayKeyTypes[0]); - } - - return TypeCombinator::union(...$valueTypes); - } - - $itemType = $argType->getIterableValueType(); - if ($iterableAtLeastOnce->yes()) { - return $itemType; - } - - return TypeCombinator::union($itemType, new NullType()); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/ArraySliceFunctionReturnTypeExtension.php b/vendor/phpstan/phpstan/src/Type/Php/ArraySliceFunctionReturnTypeExtension.php deleted file mode 100644 index e46fa68..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/ArraySliceFunctionReturnTypeExtension.php +++ /dev/null @@ -1,81 +0,0 @@ -getName() === 'array_slice'; - } - - public function getTypeFromFunctionCall( - FunctionReflection $functionReflection, - FuncCall $functionCall, - Scope $scope - ): Type - { - $arrayArg = $functionCall->args[0]->value ?? null; - - if ($arrayArg === null) { - return new ArrayType( - new IntegerType(), - new MixedType() - ); - } - - $valueType = $scope->getType($arrayArg); - - if (isset($functionCall->args[1])) { - $offset = $scope->getType($functionCall->args[1]->value); - if (!$offset instanceof ConstantIntegerType) { - $offset = new ConstantIntegerType(0); - } - } else { - $offset = new ConstantIntegerType(0); - } - - if (isset($functionCall->args[2])) { - $limit = $scope->getType($functionCall->args[2]->value); - if (!$limit instanceof ConstantIntegerType) { - $limit = new NullType(); - } - } else { - $limit = new NullType(); - } - - $constantArrays = TypeUtils::getConstantArrays($valueType); - if (count($constantArrays) === 0) { - return $valueType; - } - - if (isset($functionCall->args[3])) { - $preserveKeys = $scope->getType($functionCall->args[3]->value); - $preserveKeys = (new ConstantBooleanType(true))->isSuperTypeOf($preserveKeys)->yes(); - } else { - $preserveKeys = false; - } - - $arrayTypes = array_map(static function (ConstantArrayType $constantArray) use ($offset, $limit, $preserveKeys): ConstantArrayType { - return $constantArray->slice($offset->getValue(), $limit->getValue(), $preserveKeys); - }, $constantArrays); - - return TypeCombinator::union(...$arrayTypes); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/ArrayValuesFunctionDynamicReturnTypeExtension.php b/vendor/phpstan/phpstan/src/Type/Php/ArrayValuesFunctionDynamicReturnTypeExtension.php deleted file mode 100644 index 0c43caa..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/ArrayValuesFunctionDynamicReturnTypeExtension.php +++ /dev/null @@ -1,43 +0,0 @@ -getName() === 'array_values'; - } - - public function getTypeFromFunctionCall(FunctionReflection $functionReflection, FuncCall $functionCall, Scope $scope): Type - { - $arrayArg = $functionCall->args[0]->value ?? null; - if ($arrayArg !== null) { - $valueType = $scope->getType($arrayArg); - if ($valueType->isArray()->yes()) { - if ($valueType instanceof ConstantArrayType) { - return $valueType->getValuesArray(); - } - return TypeCombinator::intersect(new ArrayType(new IntegerType(), $valueType->getIterableValueType()), ...TypeUtils::getAccessoryTypes($valueType)); - } - } - - return new ArrayType( - new IntegerType(), - new MixedType() - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/AssertFunctionTypeSpecifyingExtension.php b/vendor/phpstan/phpstan/src/Type/Php/AssertFunctionTypeSpecifyingExtension.php deleted file mode 100644 index 1e838fe..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/AssertFunctionTypeSpecifyingExtension.php +++ /dev/null @@ -1,36 +0,0 @@ -getName() === 'assert' - && isset($node->args[0]); - } - - public function specifyTypes(FunctionReflection $functionReflection, FuncCall $node, Scope $scope, TypeSpecifierContext $context): SpecifiedTypes - { - return $this->typeSpecifier->specifyTypesInCondition($scope, $node->args[0]->value, TypeSpecifierContext::createTruthy()); - } - - public function setTypeSpecifier(TypeSpecifier $typeSpecifier): void - { - $this->typeSpecifier = $typeSpecifier; - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/CountFunctionReturnTypeExtension.php b/vendor/phpstan/phpstan/src/Type/Php/CountFunctionReturnTypeExtension.php deleted file mode 100644 index 84f3da1..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/CountFunctionReturnTypeExtension.php +++ /dev/null @@ -1,51 +0,0 @@ -getName() === 'count'; - } - - public function getTypeFromFunctionCall( - FunctionReflection $functionReflection, - FuncCall $functionCall, - Scope $scope - ): Type - { - if (count($functionCall->args) < 1) { - return ParametersAcceptorSelector::selectSingle($functionReflection->getVariants())->getReturnType(); - } - - if (count($functionCall->args) > 1) { - $mode = $scope->getType($functionCall->args[1]->value); - if ($mode->isSuperTypeOf(new ConstantIntegerType(\COUNT_RECURSIVE))->yes()) { - return ParametersAcceptorSelector::selectSingle($functionReflection->getVariants())->getReturnType(); - } - } - - $arrays = TypeUtils::getArrays($scope->getType($functionCall->args[0]->value)); - if (count($arrays) === 0) { - return ParametersAcceptorSelector::selectSingle($functionReflection->getVariants())->getReturnType(); - } - $countTypes = []; - foreach ($arrays as $array) { - $countTypes[] = $array->count(); - } - - return TypeCombinator::union(...$countTypes); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/CountFunctionTypeSpecifyingExtension.php b/vendor/phpstan/phpstan/src/Type/Php/CountFunctionTypeSpecifyingExtension.php deleted file mode 100644 index fd6b14e..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/CountFunctionTypeSpecifyingExtension.php +++ /dev/null @@ -1,53 +0,0 @@ -null() - && count($node->args) >= 1 - && $functionReflection->getName() === 'count'; - } - - public function specifyTypes( - FunctionReflection $functionReflection, - FuncCall $node, - Scope $scope, - TypeSpecifierContext $context - ): SpecifiedTypes - { - if (!(new ArrayType(new MixedType(), new MixedType()))->isSuperTypeOf($scope->getType($node->args[0]->value))->yes()) { - return new SpecifiedTypes([], []); - } - - return $this->typeSpecifier->create($node->args[0]->value, new NonEmptyArrayType(), $context); - } - - public function setTypeSpecifier(TypeSpecifier $typeSpecifier): void - { - $this->typeSpecifier = $typeSpecifier; - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/CurlInitReturnTypeExtension.php b/vendor/phpstan/phpstan/src/Type/Php/CurlInitReturnTypeExtension.php deleted file mode 100644 index 885707c..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/CurlInitReturnTypeExtension.php +++ /dev/null @@ -1,37 +0,0 @@ -getName() === 'curl_init'; - } - - public function getTypeFromFunctionCall( - FunctionReflection $functionReflection, - \PhpParser\Node\Expr\FuncCall $functionCall, - Scope $scope - ): Type - { - $argsCount = count($functionCall->args); - if ($argsCount === 0) { - return new ResourceType(); - } - - return new UnionType([ - new ResourceType(), - new ConstantBooleanType(false), - ]); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/DefineConstantTypeSpecifyingExtension.php b/vendor/phpstan/phpstan/src/Type/Php/DefineConstantTypeSpecifyingExtension.php deleted file mode 100644 index 4da869b..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/DefineConstantTypeSpecifyingExtension.php +++ /dev/null @@ -1,61 +0,0 @@ -typeSpecifier = $typeSpecifier; - } - - public function isFunctionSupported( - FunctionReflection $functionReflection, - FuncCall $node, - TypeSpecifierContext $context - ): bool - { - return $functionReflection->getName() === 'define' - && $context->null() - && count($node->args) >= 2; - } - - public function specifyTypes( - FunctionReflection $functionReflection, - FuncCall $node, - Scope $scope, - TypeSpecifierContext $context - ): SpecifiedTypes - { - $constantName = $scope->getType($node->args[0]->value); - if ( - !$constantName instanceof ConstantStringType - || $constantName->getValue() === '' - ) { - return new SpecifiedTypes([], []); - } - - return $this->typeSpecifier->create( - new \PhpParser\Node\Expr\ConstFetch( - new \PhpParser\Node\Name\FullyQualified($constantName->getValue()) - ), - $scope->getType($node->args[1]->value), - TypeSpecifierContext::createTruthy() - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/DefinedConstantTypeSpecifyingExtension.php b/vendor/phpstan/phpstan/src/Type/Php/DefinedConstantTypeSpecifyingExtension.php deleted file mode 100644 index ac6e590..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/DefinedConstantTypeSpecifyingExtension.php +++ /dev/null @@ -1,62 +0,0 @@ -typeSpecifier = $typeSpecifier; - } - - public function isFunctionSupported( - FunctionReflection $functionReflection, - FuncCall $node, - TypeSpecifierContext $context - ): bool - { - return $functionReflection->getName() === 'defined' - && count($node->args) >= 1 - && !$context->null(); - } - - public function specifyTypes( - FunctionReflection $functionReflection, - FuncCall $node, - Scope $scope, - TypeSpecifierContext $context - ): SpecifiedTypes - { - $constantName = $scope->getType($node->args[0]->value); - if ( - !$constantName instanceof ConstantStringType - || $constantName->getValue() === '' - ) { - return new SpecifiedTypes([], []); - } - - return $this->typeSpecifier->create( - new \PhpParser\Node\Expr\ConstFetch( - new \PhpParser\Node\Name\FullyQualified($constantName->getValue()) - ), - new MixedType(), - $context - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/DioStatDynamicFunctionReturnTypeExtension.php b/vendor/phpstan/phpstan/src/Type/Php/DioStatDynamicFunctionReturnTypeExtension.php deleted file mode 100644 index a134c6d..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/DioStatDynamicFunctionReturnTypeExtension.php +++ /dev/null @@ -1,49 +0,0 @@ -getName() === 'dio_stat'; - } - - public function getTypeFromFunctionCall(FunctionReflection $functionReflection, FuncCall $functionCall, Scope $scope): Type - { - $valueType = new IntegerType(); - $builder = ConstantArrayTypeBuilder::createEmpty(); - $keys = [ - 'device', - 'inode', - 'mode', - 'nlink', - 'uid', - 'gid', - 'device_type', - 'size', - 'blocksize', - 'blocks', - 'atime', - 'mtime', - 'ctime', - ]; - - foreach ($keys as $key) { - $builder->setOffsetValueType(new ConstantStringType($key), $valueType); - } - - return TypeCombinator::addNull($builder->getArray()); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/ExplodeFunctionDynamicReturnTypeExtension.php b/vendor/phpstan/phpstan/src/Type/Php/ExplodeFunctionDynamicReturnTypeExtension.php deleted file mode 100644 index fdead7b..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/ExplodeFunctionDynamicReturnTypeExtension.php +++ /dev/null @@ -1,52 +0,0 @@ -getName() === 'explode'; - } - - public function getTypeFromFunctionCall( - FunctionReflection $functionReflection, - FuncCall $functionCall, - Scope $scope - ): Type - { - if (count($functionCall->args) < 2) { - return ParametersAcceptorSelector::selectSingle($functionReflection->getVariants())->getReturnType(); - } - - $delimiterType = $scope->getType($functionCall->args[0]->value); - $isSuperset = (new ConstantStringType(''))->isSuperTypeOf($delimiterType); - if ($isSuperset->yes()) { - return new ConstantBooleanType(false); - } elseif ($isSuperset->no()) { - return new ArrayType(new IntegerType(), new StringType()); - } - - $returnType = ParametersAcceptorSelector::selectSingle($functionReflection->getVariants())->getReturnType(); - if ($delimiterType instanceof MixedType) { - return TypeUtils::toBenevolentUnion($returnType); - } - - return $returnType; - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/FilterVarDynamicReturnTypeExtension.php b/vendor/phpstan/phpstan/src/Type/Php/FilterVarDynamicReturnTypeExtension.php deleted file mode 100644 index b6b14cc..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/FilterVarDynamicReturnTypeExtension.php +++ /dev/null @@ -1,80 +0,0 @@ - */ - private $filterTypesHashMaps; - - public function __construct() - { - $booleanType = new BooleanType(); - $floatOrFalseType = new UnionType([new FloatType(), new ConstantBooleanType(false)]); - $intOrFalseType = new UnionType([new IntegerType(), new ConstantBooleanType(false)]); - $stringOrFalseType = new UnionType([new StringType(), new ConstantBooleanType(false)]); - - $this->filterTypesHashMaps = [ - 'FILTER_SANITIZE_EMAIL' => $stringOrFalseType, - 'FILTER_SANITIZE_ENCODED' => $stringOrFalseType, - 'FILTER_SANITIZE_MAGIC_QUOTES' => $stringOrFalseType, - 'FILTER_SANITIZE_NUMBER_FLOAT' => $stringOrFalseType, - 'FILTER_SANITIZE_NUMBER_INT' => $stringOrFalseType, - 'FILTER_SANITIZE_SPECIAL_CHARS' => $stringOrFalseType, - 'FILTER_SANITIZE_STRING' => $stringOrFalseType, - 'FILTER_SANITIZE_URL' => $stringOrFalseType, - 'FILTER_VALIDATE_BOOLEAN' => $booleanType, - 'FILTER_VALIDATE_EMAIL' => $stringOrFalseType, - 'FILTER_VALIDATE_FLOAT' => $floatOrFalseType, - 'FILTER_VALIDATE_INT' => $intOrFalseType, - 'FILTER_VALIDATE_IP' => $stringOrFalseType, - 'FILTER_VALIDATE_MAC' => $stringOrFalseType, - 'FILTER_VALIDATE_REGEXP' => $stringOrFalseType, - 'FILTER_VALIDATE_URL' => $stringOrFalseType, - ]; - } - - public function isFunctionSupported(FunctionReflection $functionReflection): bool - { - return strtolower($functionReflection->getName()) === 'filter_var'; - } - - public function getTypeFromFunctionCall( - FunctionReflection $functionReflection, - FuncCall $functionCall, - Scope $scope - ): Type - { - $mixedType = new MixedType(); - - $filterArg = $functionCall->args[1] ?? null; - if ($filterArg === null) { - return $mixedType; - } - - $filterExpr = $filterArg->value; - if (!$filterExpr instanceof ConstFetch) { - return $mixedType; - } - - $filterName = (string) $filterExpr->name; - - return $this->filterTypesHashMaps[$filterName] ?? $mixedType; - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/GetParentClassDynamicFunctionReturnTypeExtension.php b/vendor/phpstan/phpstan/src/Type/Php/GetParentClassDynamicFunctionReturnTypeExtension.php deleted file mode 100644 index 15ec754..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/GetParentClassDynamicFunctionReturnTypeExtension.php +++ /dev/null @@ -1,104 +0,0 @@ -broker = $broker; - } - - public function isFunctionSupported( - FunctionReflection $functionReflection - ): bool - { - return $functionReflection->getName() === 'get_parent_class'; - } - - public function getTypeFromFunctionCall( - FunctionReflection $functionReflection, - FuncCall $functionCall, - Scope $scope - ): Type - { - $defaultReturnType = ParametersAcceptorSelector::selectSingle( - $functionReflection->getVariants() - )->getReturnType(); - if (count($functionCall->args) === 0) { - if ($scope->isInTrait()) { - return $defaultReturnType; - } - if ($scope->isInClass()) { - return $this->findParentClassType( - $scope->getClassReflection() - ); - } - - return new ConstantBooleanType(false); - } - - $argType = $scope->getType($functionCall->args[0]->value); - if ($scope->isInTrait() && TypeUtils::findThisType($argType) !== null) { - return $defaultReturnType; - } - - $constantStrings = TypeUtils::getConstantStrings($argType); - if (count($constantStrings) > 0) { - return \PHPStan\Type\TypeCombinator::union(...array_map(function (ConstantStringType $stringType): Type { - return $this->findParentClassNameType($stringType->getValue()); - }, $constantStrings)); - } - - $classNames = TypeUtils::getDirectClassNames($argType); - if (count($classNames) > 0) { - return \PHPStan\Type\TypeCombinator::union(...array_map(function (string $classNames): Type { - return $this->findParentClassNameType($classNames); - }, $classNames)); - } - - return $defaultReturnType; - } - - private function findParentClassNameType(string $className): Type - { - if (!$this->broker->hasClass($className)) { - return new UnionType([ - new StringType(), - new ConstantBooleanType(false), - ]); - } - - return $this->findParentClassType($this->broker->getClass($className)); - } - - private function findParentClassType( - ClassReflection $classReflection - ): Type - { - $parentClass = $classReflection->getParentClass(); - if ($parentClass === false) { - return new ConstantBooleanType(false); - } - - return new ConstantStringType($parentClass->getName()); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/GettimeofdayDynamicFunctionReturnTypeExtension.php b/vendor/phpstan/phpstan/src/Type/Php/GettimeofdayDynamicFunctionReturnTypeExtension.php deleted file mode 100644 index 8fdb910..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/GettimeofdayDynamicFunctionReturnTypeExtension.php +++ /dev/null @@ -1,63 +0,0 @@ -getName() === 'gettimeofday'; - } - - public function getTypeFromFunctionCall(FunctionReflection $functionReflection, FuncCall $functionCall, Scope $scope): Type - { - $arrayType = new ConstantArrayType([ - new ConstantStringType('sec'), - new ConstantStringType('usec'), - new ConstantStringType('minuteswest'), - new ConstantStringType('dsttime'), - ], [ - new IntegerType(), - new IntegerType(), - new IntegerType(), - new IntegerType(), - ]); - $floatType = new FloatType(); - - if (!isset($functionCall->args[0])) { - return $arrayType; - } - - $argType = $scope->getType($functionCall->args[0]->value); - $isTrueType = (new ConstantBooleanType(true))->isSuperTypeOf($argType); - $isFalseType = (new ConstantBooleanType(false))->isSuperTypeOf($argType); - $compareTypes = $isTrueType->compareTo($isFalseType); - if ($compareTypes === $isTrueType) { - return $floatType; - } - if ($compareTypes === $isFalseType) { - return $arrayType; - } - - if ($argType instanceof MixedType) { - return new BenevolentUnionType([$arrayType, $floatType]); - } - - return new UnionType([$arrayType, $floatType]); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/HrtimeFunctionReturnTypeExtension.php b/vendor/phpstan/phpstan/src/Type/Php/HrtimeFunctionReturnTypeExtension.php deleted file mode 100644 index 37b255b..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/HrtimeFunctionReturnTypeExtension.php +++ /dev/null @@ -1,47 +0,0 @@ -getName() === 'hrtime'; - } - - public function getTypeFromFunctionCall(FunctionReflection $functionReflection, FuncCall $functionCall, Scope $scope): Type - { - $arrayType = new ConstantArrayType([new ConstantIntegerType(0), new ConstantIntegerType(1)], [new IntegerType(), new IntegerType()], 2); - $numberType = TypeCombinator::union(new IntegerType(), new FloatType()); - - if (count($functionCall->args) < 1) { - return $arrayType; - } - - $argType = $scope->getType($functionCall->args[0]->value); - $isTrueType = (new ConstantBooleanType(true))->isSuperTypeOf($argType); - $isFalseType = (new ConstantBooleanType(false))->isSuperTypeOf($argType); - $compareTypes = $isTrueType->compareTo($isFalseType); - if ($compareTypes === $isTrueType) { - return $numberType; - } - if ($compareTypes === $isFalseType) { - return $arrayType; - } - - return TypeCombinator::union($arrayType, $numberType); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/InArrayFunctionTypeSpecifyingExtension.php b/vendor/phpstan/phpstan/src/Type/Php/InArrayFunctionTypeSpecifyingExtension.php deleted file mode 100644 index acfa8cd..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/InArrayFunctionTypeSpecifyingExtension.php +++ /dev/null @@ -1,57 +0,0 @@ -typeSpecifier = $typeSpecifier; - } - - public function isFunctionSupported(FunctionReflection $functionReflection, FuncCall $node, TypeSpecifierContext $context): bool - { - return strtolower($functionReflection->getName()) === 'in_array' - && count($node->args) >= 3 - && !$context->null(); - } - - public function specifyTypes(FunctionReflection $functionReflection, FuncCall $node, Scope $scope, TypeSpecifierContext $context): SpecifiedTypes - { - $strictNodeType = $scope->getType($node->args[2]->value); - if (!(new ConstantBooleanType(true))->isSuperTypeOf($strictNodeType)->yes()) { - return new SpecifiedTypes([], []); - } - - $arrayValueType = $scope->getType($node->args[1]->value)->getIterableValueType(); - - if ( - $context->truthy() - || count(TypeUtils::getConstantScalars($arrayValueType)) > 0 - ) { - return $this->typeSpecifier->create( - $node->args[0]->value, - $arrayValueType, - $context - ); - } - - return new SpecifiedTypes([], []); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/IsAFunctionTypeSpecifyingExtension.php b/vendor/phpstan/phpstan/src/Type/Php/IsAFunctionTypeSpecifyingExtension.php deleted file mode 100644 index 020b0c3..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/IsAFunctionTypeSpecifyingExtension.php +++ /dev/null @@ -1,81 +0,0 @@ -getName()) === 'is_a' - && isset($node->args[0]) - && isset($node->args[1]) - && !$context->null(); - } - - public function specifyTypes(FunctionReflection $functionReflection, FuncCall $node, Scope $scope, TypeSpecifierContext $context): SpecifiedTypes - { - if ($context->null()) { - throw new \PHPStan\ShouldNotHappenException(); - } - - $classNameArgExpr = $node->args[1]->value; - $classNameArgExprType = $scope->getType($classNameArgExpr); - if ( - $classNameArgExpr instanceof ClassConstFetch - && $classNameArgExpr->class instanceof Name - && $classNameArgExpr->name instanceof \PhpParser\Node\Identifier - && strtolower($classNameArgExpr->name->name) === 'class' - ) { - $className = $scope->resolveName($classNameArgExpr->class); - if (strtolower($classNameArgExpr->class->toString()) === 'static') { - $objectType = new StaticType($className); - } else { - $objectType = new ObjectType($className); - } - $types = $this->typeSpecifier->create($node->args[0]->value, $objectType, $context); - } elseif ($classNameArgExprType instanceof ConstantStringType) { - $objectType = new ObjectType($classNameArgExprType->getValue()); - $types = $this->typeSpecifier->create($node->args[0]->value, $objectType, $context); - } elseif ($context->true()) { - $objectType = new ObjectWithoutClassType(); - $types = $this->typeSpecifier->create($node->args[0]->value, $objectType, $context); - } else { - $types = new SpecifiedTypes(); - } - - if (isset($node->args[2]) && $context->true()) { - if (!$scope->getType($node->args[2]->value)->isSuperTypeOf(new ConstantBooleanType(true))->no()) { - $types = $types->intersectWith($this->typeSpecifier->create($node->args[0]->value, new StringType(), $context)); - } - } - - return $types; - } - - public function setTypeSpecifier(TypeSpecifier $typeSpecifier): void - { - $this->typeSpecifier = $typeSpecifier; - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/IsArrayFunctionTypeSpecifyingExtension.php b/vendor/phpstan/phpstan/src/Type/Php/IsArrayFunctionTypeSpecifyingExtension.php deleted file mode 100644 index e5e1a5e..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/IsArrayFunctionTypeSpecifyingExtension.php +++ /dev/null @@ -1,43 +0,0 @@ -getName()) === 'is_array' - && isset($node->args[0]) - && !$context->null(); - } - - public function specifyTypes(FunctionReflection $functionReflection, FuncCall $node, Scope $scope, TypeSpecifierContext $context): SpecifiedTypes - { - if ($context->null()) { - throw new \PHPStan\ShouldNotHappenException(); - } - - return $this->typeSpecifier->create($node->args[0]->value, new ArrayType(new MixedType(), new MixedType()), $context); - } - - public function setTypeSpecifier(TypeSpecifier $typeSpecifier): void - { - $this->typeSpecifier = $typeSpecifier; - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/IsBoolFunctionTypeSpecifyingExtension.php b/vendor/phpstan/phpstan/src/Type/Php/IsBoolFunctionTypeSpecifyingExtension.php deleted file mode 100644 index 0b513e8..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/IsBoolFunctionTypeSpecifyingExtension.php +++ /dev/null @@ -1,42 +0,0 @@ -getName()) === 'is_bool' - && isset($node->args[0]) - && !$context->null(); - } - - public function specifyTypes(FunctionReflection $functionReflection, FuncCall $node, Scope $scope, TypeSpecifierContext $context): SpecifiedTypes - { - if ($context->null()) { - throw new \PHPStan\ShouldNotHappenException(); - } - - return $this->typeSpecifier->create($node->args[0]->value, new BooleanType(), $context); - } - - public function setTypeSpecifier(TypeSpecifier $typeSpecifier): void - { - $this->typeSpecifier = $typeSpecifier; - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/IsCallableFunctionTypeSpecifyingExtension.php b/vendor/phpstan/phpstan/src/Type/Php/IsCallableFunctionTypeSpecifyingExtension.php deleted file mode 100644 index 8a9c41b..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/IsCallableFunctionTypeSpecifyingExtension.php +++ /dev/null @@ -1,69 +0,0 @@ -methodExistsExtension = $methodExistsExtension; - } - - public function isFunctionSupported(FunctionReflection $functionReflection, FuncCall $node, TypeSpecifierContext $context): bool - { - return strtolower($functionReflection->getName()) === 'is_callable' - && isset($node->args[0]) - && !$context->null(); - } - - public function specifyTypes(FunctionReflection $functionReflection, FuncCall $node, Scope $scope, TypeSpecifierContext $context): SpecifiedTypes - { - if ($context->null()) { - throw new \PHPStan\ShouldNotHappenException(); - } - - $value = $node->args[0]->value; - $valueType = $scope->getType($value); - if ( - $value instanceof Array_ - && count($value->items) === 2 - && $valueType instanceof ConstantArrayType - && !$valueType->isCallable()->no() - ) { - $functionCall = new FuncCall(new Name('method_exists'), [ - new Arg($value->items[0]->value), - new Arg($value->items[1]->value), - ]); - return $this->methodExistsExtension->specifyTypes($functionReflection, $functionCall, $scope, $context); - } - - return $this->typeSpecifier->create($value, new CallableType(), $context); - } - - public function setTypeSpecifier(TypeSpecifier $typeSpecifier): void - { - $this->typeSpecifier = $typeSpecifier; - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/IsCountableFunctionTypeSpecifyingExtension.php b/vendor/phpstan/phpstan/src/Type/Php/IsCountableFunctionTypeSpecifyingExtension.php deleted file mode 100644 index 0e6886c..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/IsCountableFunctionTypeSpecifyingExtension.php +++ /dev/null @@ -1,52 +0,0 @@ -getName()) === 'is_countable' - && isset($node->args[0]) - && !$context->null(); - } - - public function specifyTypes(FunctionReflection $functionReflection, FuncCall $node, Scope $scope, TypeSpecifierContext $context): SpecifiedTypes - { - if ($context->null()) { - throw new \PHPStan\ShouldNotHappenException(); - } - - return $this->typeSpecifier->create( - $node->args[0]->value, - new UnionType([ - new ArrayType(new MixedType(), new MixedType()), - new ObjectType(\Countable::class), - ]), - $context - ); - } - - public function setTypeSpecifier(TypeSpecifier $typeSpecifier): void - { - $this->typeSpecifier = $typeSpecifier; - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/IsFloatFunctionTypeSpecifyingExtension.php b/vendor/phpstan/phpstan/src/Type/Php/IsFloatFunctionTypeSpecifyingExtension.php deleted file mode 100644 index 3577d0a..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/IsFloatFunctionTypeSpecifyingExtension.php +++ /dev/null @@ -1,46 +0,0 @@ -getName()), [ - 'is_float', - 'is_double', - 'is_real', - ], true) - && isset($node->args[0]) - && !$context->null(); - } - - public function specifyTypes(FunctionReflection $functionReflection, FuncCall $node, Scope $scope, TypeSpecifierContext $context): SpecifiedTypes - { - if ($context->null()) { - throw new \PHPStan\ShouldNotHappenException(); - } - - return $this->typeSpecifier->create($node->args[0]->value, new FloatType(), $context); - } - - public function setTypeSpecifier(TypeSpecifier $typeSpecifier): void - { - $this->typeSpecifier = $typeSpecifier; - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/IsIntFunctionTypeSpecifyingExtension.php b/vendor/phpstan/phpstan/src/Type/Php/IsIntFunctionTypeSpecifyingExtension.php deleted file mode 100644 index e492ceb..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/IsIntFunctionTypeSpecifyingExtension.php +++ /dev/null @@ -1,46 +0,0 @@ -getName()), [ - 'is_int', - 'is_integer', - 'is_long', - ], true) - && isset($node->args[0]) - && !$context->null(); - } - - public function specifyTypes(FunctionReflection $functionReflection, FuncCall $node, Scope $scope, TypeSpecifierContext $context): SpecifiedTypes - { - if ($context->null()) { - throw new \PHPStan\ShouldNotHappenException(); - } - - return $this->typeSpecifier->create($node->args[0]->value, new IntegerType(), $context); - } - - public function setTypeSpecifier(TypeSpecifier $typeSpecifier): void - { - $this->typeSpecifier = $typeSpecifier; - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/IsIterableFunctionTypeSpecifyingExtension.php b/vendor/phpstan/phpstan/src/Type/Php/IsIterableFunctionTypeSpecifyingExtension.php deleted file mode 100644 index 1a6646d..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/IsIterableFunctionTypeSpecifyingExtension.php +++ /dev/null @@ -1,43 +0,0 @@ -getName()) === 'is_iterable' - && isset($node->args[0]) - && !$context->null(); - } - - public function specifyTypes(FunctionReflection $functionReflection, FuncCall $node, Scope $scope, TypeSpecifierContext $context): SpecifiedTypes - { - if ($context->null()) { - throw new \PHPStan\ShouldNotHappenException(); - } - - return $this->typeSpecifier->create($node->args[0]->value, new IterableType(new MixedType(), new MixedType()), $context); - } - - public function setTypeSpecifier(TypeSpecifier $typeSpecifier): void - { - $this->typeSpecifier = $typeSpecifier; - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/IsNullFunctionTypeSpecifyingExtension.php b/vendor/phpstan/phpstan/src/Type/Php/IsNullFunctionTypeSpecifyingExtension.php deleted file mode 100644 index 620f350..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/IsNullFunctionTypeSpecifyingExtension.php +++ /dev/null @@ -1,42 +0,0 @@ -getName()) === 'is_null' - && isset($node->args[0]) - && !$context->null(); - } - - public function specifyTypes(FunctionReflection $functionReflection, FuncCall $node, Scope $scope, TypeSpecifierContext $context): SpecifiedTypes - { - if ($context->null()) { - throw new \PHPStan\ShouldNotHappenException(); - } - - return $this->typeSpecifier->create($node->args[0]->value, new NullType(), $context); - } - - public function setTypeSpecifier(TypeSpecifier $typeSpecifier): void - { - $this->typeSpecifier = $typeSpecifier; - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/IsNumericFunctionTypeSpecifyingExtension.php b/vendor/phpstan/phpstan/src/Type/Php/IsNumericFunctionTypeSpecifyingExtension.php deleted file mode 100644 index 2810aa7..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/IsNumericFunctionTypeSpecifyingExtension.php +++ /dev/null @@ -1,54 +0,0 @@ -getName() === 'is_numeric' - && isset($node->args[0]) - && !$context->null(); - } - - public function specifyTypes(FunctionReflection $functionReflection, FuncCall $node, Scope $scope, TypeSpecifierContext $context): SpecifiedTypes - { - if ($context->null()) { - throw new \PHPStan\ShouldNotHappenException(); - } - - $numericTypes = [ - new IntegerType(), - new FloatType(), - ]; - - if ($context->truthy()) { - $numericTypes[] = new StringType(); - } - - return $this->typeSpecifier->create($node->args[0]->value, new UnionType($numericTypes), $context); - } - - public function setTypeSpecifier(TypeSpecifier $typeSpecifier): void - { - $this->typeSpecifier = $typeSpecifier; - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/IsObjectFunctionTypeSpecifyingExtension.php b/vendor/phpstan/phpstan/src/Type/Php/IsObjectFunctionTypeSpecifyingExtension.php deleted file mode 100644 index 6434211..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/IsObjectFunctionTypeSpecifyingExtension.php +++ /dev/null @@ -1,42 +0,0 @@ -getName()) === 'is_object' - && isset($node->args[0]) - && !$context->null(); - } - - public function specifyTypes(FunctionReflection $functionReflection, FuncCall $node, Scope $scope, TypeSpecifierContext $context): SpecifiedTypes - { - if ($context->null()) { - throw new \PHPStan\ShouldNotHappenException(); - } - - return $this->typeSpecifier->create($node->args[0]->value, new ObjectWithoutClassType(), $context); - } - - public function setTypeSpecifier(TypeSpecifier $typeSpecifier): void - { - $this->typeSpecifier = $typeSpecifier; - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/IsResourceFunctionTypeSpecifyingExtension.php b/vendor/phpstan/phpstan/src/Type/Php/IsResourceFunctionTypeSpecifyingExtension.php deleted file mode 100644 index 0d8b153..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/IsResourceFunctionTypeSpecifyingExtension.php +++ /dev/null @@ -1,42 +0,0 @@ -getName()) === 'is_resource' - && isset($node->args[0]) - && !$context->null(); - } - - public function specifyTypes(FunctionReflection $functionReflection, FuncCall $node, Scope $scope, TypeSpecifierContext $context): SpecifiedTypes - { - if ($context->null()) { - throw new \PHPStan\ShouldNotHappenException(); - } - - return $this->typeSpecifier->create($node->args[0]->value, new ResourceType(), $context); - } - - public function setTypeSpecifier(TypeSpecifier $typeSpecifier): void - { - $this->typeSpecifier = $typeSpecifier; - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/IsScalarFunctionTypeSpecifyingExtension.php b/vendor/phpstan/phpstan/src/Type/Php/IsScalarFunctionTypeSpecifyingExtension.php deleted file mode 100644 index 5594454..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/IsScalarFunctionTypeSpecifyingExtension.php +++ /dev/null @@ -1,51 +0,0 @@ -getName() === 'is_scalar' - && isset($node->args[0]) - && !$context->null(); - } - - public function specifyTypes(FunctionReflection $functionReflection, FuncCall $node, Scope $scope, TypeSpecifierContext $context): SpecifiedTypes - { - if ($context->null()) { - throw new \PHPStan\ShouldNotHappenException(); - } - - return $this->typeSpecifier->create($node->args[0]->value, new UnionType([ - new StringType(), - new IntegerType(), - new FloatType(), - new BooleanType(), - ]), $context); - } - - public function setTypeSpecifier(TypeSpecifier $typeSpecifier): void - { - $this->typeSpecifier = $typeSpecifier; - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/IsStringFunctionTypeSpecifyingExtension.php b/vendor/phpstan/phpstan/src/Type/Php/IsStringFunctionTypeSpecifyingExtension.php deleted file mode 100644 index b8cea61..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/IsStringFunctionTypeSpecifyingExtension.php +++ /dev/null @@ -1,42 +0,0 @@ -getName()) === 'is_string' - && isset($node->args[0]) - && !$context->null(); - } - - public function specifyTypes(FunctionReflection $functionReflection, FuncCall $node, Scope $scope, TypeSpecifierContext $context): SpecifiedTypes - { - if ($context->null()) { - throw new \PHPStan\ShouldNotHappenException(); - } - - return $this->typeSpecifier->create($node->args[0]->value, new StringType(), $context); - } - - public function setTypeSpecifier(TypeSpecifier $typeSpecifier): void - { - $this->typeSpecifier = $typeSpecifier; - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/IsSubclassOfFunctionTypeSpecifyingExtension.php b/vendor/phpstan/phpstan/src/Type/Php/IsSubclassOfFunctionTypeSpecifyingExtension.php deleted file mode 100644 index 0a9ad0f..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/IsSubclassOfFunctionTypeSpecifyingExtension.php +++ /dev/null @@ -1,85 +0,0 @@ -getName()) === 'is_subclass_of' - && count($node->args) >= 2 - && !$context->null(); - } - - public function specifyTypes(FunctionReflection $functionReflection, FuncCall $node, Scope $scope, TypeSpecifierContext $context): SpecifiedTypes - { - $objectType = $scope->getType($node->args[0]->value); - $stringType = new StringType(); - if ( - !$objectType instanceof MixedType - && !$objectType instanceof UnionType - && !$stringType->isSuperTypeOf($objectType)->no() - ) { - return new SpecifiedTypes(); - } - - $classType = $scope->getType($node->args[1]->value); - if ($classType instanceof ConstantStringType && $classType->getValue() !== '') { - $type = new ObjectType($classType->getValue()); - } elseif ($objectType instanceof UnionType) { - $type = TypeCombinator::union(...array_filter( - $objectType->getTypes(), - static function (Type $type): bool { - return $type instanceof ObjectWithoutClassType || $type instanceof TypeWithClassName; - } - )); - } else { - $type = new ObjectWithoutClassType(); - } - - $types = $this->typeSpecifier->create($node->args[0]->value, $type, $context); - - if (!$objectType->isSuperTypeOf(new StringType())->no() - && (!isset($node->args[2]) - || $scope->getType($node->args[2]->value)->equals(new ConstantBooleanType(true))) - ) { - $stringTypes = $this->typeSpecifier->create( - $node->args[0]->value, - $objectType instanceof ConstantStringType ? $objectType : $stringType, - $context - ); - $types = $types->intersectWith($stringTypes); - } - - return $types; - } - - public function setTypeSpecifier(TypeSpecifier $typeSpecifier): void - { - $this->typeSpecifier = $typeSpecifier; - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/JsonThrowOnErrorDynamicReturnTypeExtension.php b/vendor/phpstan/phpstan/src/Type/Php/JsonThrowOnErrorDynamicReturnTypeExtension.php deleted file mode 100644 index bdc94bc..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/JsonThrowOnErrorDynamicReturnTypeExtension.php +++ /dev/null @@ -1,62 +0,0 @@ - */ - private $argumentPositions = [ - 'json_encode' => 1, - 'json_decode' => 3, - ]; - - public function isFunctionSupported( - FunctionReflection $functionReflection - ): bool - { - return defined('JSON_THROW_ON_ERROR') && in_array( - $functionReflection->getName(), - [ - 'json_encode', - 'json_decode', - ], - true - ); - } - - public function getTypeFromFunctionCall( - FunctionReflection $functionReflection, - FuncCall $functionCall, - Scope $scope - ): Type - { - $argumentPosition = $this->argumentPositions[$functionReflection->getName()]; - $defaultReturnType = ParametersAcceptorSelector::selectSingle($functionReflection->getVariants())->getReturnType(); - if (!isset($functionCall->args[$argumentPosition])) { - return $defaultReturnType; - } - - $valueType = $scope->getType($functionCall->args[$argumentPosition]->value); - if (!$valueType instanceof ConstantIntegerType) { - return $defaultReturnType; - } - - $value = $valueType->getValue(); - if (($value & JSON_THROW_ON_ERROR) !== JSON_THROW_ON_ERROR) { - return $defaultReturnType; - } - - return TypeCombinator::remove($defaultReturnType, new ConstantBooleanType(false)); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/MbFunctionsReturnTypeExtension.php b/vendor/phpstan/phpstan/src/Type/Php/MbFunctionsReturnTypeExtension.php deleted file mode 100644 index 256d1eb..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/MbFunctionsReturnTypeExtension.php +++ /dev/null @@ -1,87 +0,0 @@ - 1, - 'mb_regex_encoding' => 1, - 'mb_internal_encoding' => 1, - 'mb_encoding_aliases' => 1, - 'mb_strlen' => 2, - 'mb_chr' => 2, - 'mb_ord' => 2, - ]; - - public function __construct() - { - $supportedEncodings = []; - if (function_exists('mb_list_encodings')) { - foreach (mb_list_encodings() as $encoding) { - $aliases = mb_encoding_aliases($encoding); - if ($aliases === false) { - throw new \PHPStan\ShouldNotHappenException(); - } - $supportedEncodings = array_merge($supportedEncodings, $aliases, [$encoding]); - } - } - $this->supportedEncodings = array_map('strtoupper', $supportedEncodings); - } - - public function isFunctionSupported(FunctionReflection $functionReflection): bool - { - return array_key_exists($functionReflection->getName(), $this->encodingPositionMap); - } - - private function isSupportedEncoding(string $encoding): bool - { - return in_array(strtoupper($encoding), $this->supportedEncodings, true); - } - - public function getTypeFromFunctionCall(FunctionReflection $functionReflection, FuncCall $functionCall, Scope $scope): Type - { - $returnType = ParametersAcceptorSelector::selectSingle($functionReflection->getVariants())->getReturnType(); - $positionEncodingParam = $this->encodingPositionMap[$functionReflection->getName()]; - - if (count($functionCall->args) < $positionEncodingParam) { - return TypeCombinator::remove($returnType, new BooleanType()); - } - - $strings = TypeUtils::getConstantStrings($scope->getType($functionCall->args[$positionEncodingParam - 1]->value)); - $results = array_unique(array_map(function (ConstantStringType $encoding): bool { - return $this->isSupportedEncoding($encoding->getValue()); - }, $strings)); - - if ($returnType->equals(new UnionType([new StringType(), new BooleanType()]))) { - return count($results) === 1 ? new ConstantBooleanType($results[0]) : new BooleanType(); - } - - if (count($results) === 1) { - return $results[0] - ? TypeCombinator::remove($returnType, new ConstantBooleanType(false)) - : new ConstantBooleanType(false); - } - - return $returnType; - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/MethodExistsTypeSpecifyingExtension.php b/vendor/phpstan/phpstan/src/Type/Php/MethodExistsTypeSpecifyingExtension.php deleted file mode 100644 index e25e7d9..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/MethodExistsTypeSpecifyingExtension.php +++ /dev/null @@ -1,62 +0,0 @@ -typeSpecifier = $typeSpecifier; - } - - public function isFunctionSupported( - FunctionReflection $functionReflection, - FuncCall $node, - TypeSpecifierContext $context - ): bool - { - return $functionReflection->getName() === 'method_exists' - && $context->truthy() - && count($node->args) >= 2; - } - - public function specifyTypes( - FunctionReflection $functionReflection, - FuncCall $node, - Scope $scope, - TypeSpecifierContext $context - ): SpecifiedTypes - { - $methodNameType = $scope->getType($node->args[1]->value); - if (!$methodNameType instanceof ConstantStringType) { - return new SpecifiedTypes([], []); - } - - return $this->typeSpecifier->create( - $node->args[0]->value, - new IntersectionType([ - new ObjectWithoutClassType(), - new HasMethodType($methodNameType->getValue()), - ]), - $context - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/MicrotimeFunctionReturnTypeExtension.php b/vendor/phpstan/phpstan/src/Type/Php/MicrotimeFunctionReturnTypeExtension.php deleted file mode 100644 index 15ef477..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/MicrotimeFunctionReturnTypeExtension.php +++ /dev/null @@ -1,48 +0,0 @@ -getName() === 'microtime'; - } - - public function getTypeFromFunctionCall(FunctionReflection $functionReflection, FuncCall $functionCall, Scope $scope): Type - { - if (count($functionCall->args) < 1) { - return new StringType(); - } - - $argType = $scope->getType($functionCall->args[0]->value); - $isTrueType = (new ConstantBooleanType(true))->isSuperTypeOf($argType); - $isFalseType = (new ConstantBooleanType(false))->isSuperTypeOf($argType); - $compareTypes = $isTrueType->compareTo($isFalseType); - if ($compareTypes === $isTrueType) { - return new FloatType(); - } - if ($compareTypes === $isFalseType) { - return new StringType(); - } - - if ($argType instanceof MixedType) { - return new BenevolentUnionType([new StringType(), new FloatType()]); - } - - return new UnionType([new StringType(), new FloatType()]); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/MinMaxFunctionReturnTypeExtension.php b/vendor/phpstan/phpstan/src/Type/Php/MinMaxFunctionReturnTypeExtension.php deleted file mode 100644 index 0980f4f..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/MinMaxFunctionReturnTypeExtension.php +++ /dev/null @@ -1,183 +0,0 @@ - '', - 'max' => '', - ]; - - public function isFunctionSupported(FunctionReflection $functionReflection): bool - { - return isset($this->functionNames[$functionReflection->getName()]); - } - - public function getTypeFromFunctionCall(FunctionReflection $functionReflection, FuncCall $functionCall, Scope $scope): Type - { - if (!isset($functionCall->args[0])) { - return ParametersAcceptorSelector::selectSingle($functionReflection->getVariants())->getReturnType(); - } - - if (count($functionCall->args) === 1) { - $argType = $scope->getType($functionCall->args[0]->value); - if ($argType->isArray()->yes()) { - $iterableValueType = $argType->getIterableValueType(); - $argumentTypes = []; - if ($iterableValueType instanceof UnionType) { - foreach ($iterableValueType->getTypes() as $innerType) { - $argumentTypes[] = $innerType; - } - } else { - $argumentTypes[] = $iterableValueType; - } - - return $this->processType( - $functionReflection->getName(), - $argumentTypes - ); - } - - return new ErrorType(); - } - - $argumentTypes = []; - foreach ($functionCall->args as $arg) { - $argType = $scope->getType($arg->value); - if ($arg->unpack) { - $iterableValueType = $argType->getIterableValueType(); - if ($iterableValueType instanceof UnionType) { - foreach ($iterableValueType->getTypes() as $innerType) { - $argumentTypes[] = $innerType; - } - } else { - $argumentTypes[] = $iterableValueType; - } - continue; - } - - $argumentTypes[] = $argType; - } - - return $this->processType( - $functionReflection->getName(), - $argumentTypes - ); - } - - /** - * @param string $functionName - * @param \PHPStan\Type\Type[] $types - * @return Type - */ - private function processType( - string $functionName, - array $types - ): Type - { - $resultType = null; - foreach ($types as $type) { - if (!$type instanceof ConstantType) { - return TypeCombinator::union(...$types); - } - - if ($resultType === null) { - $resultType = $type; - continue; - } - - $compareResult = $this->compareTypes($resultType, $type); - if ($functionName === 'min') { - if ($compareResult === $type) { - $resultType = $type; - } - } elseif ($functionName === 'max') { - if ($compareResult === $resultType) { - $resultType = $type; - } - } - } - - if ($resultType === null) { - return new ErrorType(); - } - - return $resultType; - } - - private function compareTypes( - Type $firstType, - Type $secondType - ): ?Type - { - if ( - $firstType instanceof ConstantArrayType - && $secondType instanceof ConstantScalarType - ) { - return $secondType; - } - - if ( - $firstType instanceof ConstantScalarType - && $secondType instanceof ConstantArrayType - ) { - return $firstType; - } - - if ( - $firstType instanceof ConstantArrayType - && $secondType instanceof ConstantArrayType - ) { - if ($secondType->count() < $firstType->count()) { - return $secondType; - } elseif ($firstType->count() < $secondType->count()) { - return $firstType; - } - - foreach ($firstType->getValueTypes() as $i => $firstValueType) { - $secondValueType = $secondType->getValueTypes()[$i]; - $compareResult = $this->compareTypes($firstValueType, $secondValueType); - if ($compareResult === $firstValueType) { - return $firstType; - } - - if ($compareResult === $secondValueType) { - return $secondType; - } - } - - return null; - } - - if ( - $firstType instanceof ConstantScalarType - && $secondType instanceof ConstantScalarType - ) { - if ($secondType->getValue() < $firstType->getValue()) { - return $secondType; - } - - if ($firstType->getValue() < $secondType->getValue()) { - return $firstType; - } - } - - return null; - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/ParseUrlFunctionDynamicReturnTypeExtension.php b/vendor/phpstan/phpstan/src/Type/Php/ParseUrlFunctionDynamicReturnTypeExtension.php deleted file mode 100644 index 266b412..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/ParseUrlFunctionDynamicReturnTypeExtension.php +++ /dev/null @@ -1,137 +0,0 @@ - */ - private $componentTypesPairedConstants; - - /** @var array */ - private $componentTypesPairedStrings; - - /** @var Type */ - private $allComponentsTogetherType; - - public function isFunctionSupported(FunctionReflection $functionReflection): bool - { - return $functionReflection->getName() === 'parse_url'; - } - - public function getTypeFromFunctionCall(FunctionReflection $functionReflection, FuncCall $functionCall, Scope $scope): Type - { - $defaultReturnType = ParametersAcceptorSelector::selectSingle( - $functionReflection->getVariants() - )->getReturnType(); - - if (count($functionCall->args) < 1) { - return $defaultReturnType; - } - - $this->cacheReturnTypes(); - - $urlType = $scope->getType($functionCall->args[0]->value); - if (count($functionCall->args) > 1) { - $componentType = $scope->getType($functionCall->args[1]->value); - - if (!$componentType instanceof ConstantType) { - return $this->createAllComponentsReturnType(); - } - - $componentType = $componentType->toInteger(); - - if (!$componentType instanceof ConstantIntegerType) { - throw new \PHPStan\ShouldNotHappenException(); - } - } else { - $componentType = new ConstantIntegerType(-1); - } - - if ($urlType instanceof ConstantStringType) { - $result = @parse_url($urlType->getValue(), $componentType->getValue()); - - return $scope->getTypeFromValue($result); - } - - if ($componentType->getValue() === -1) { - return $this->createAllComponentsReturnType(); - } - - return $this->componentTypesPairedConstants[$componentType->getValue()] ?? new ConstantBooleanType(false); - } - - private function createAllComponentsReturnType(): Type - { - if ($this->allComponentsTogetherType === null) { - $returnTypes = [ - new ConstantBooleanType(false), - new ConstantArrayType([], []), - ]; - - $builder = ConstantArrayTypeBuilder::createEmpty(); - - foreach ($this->componentTypesPairedStrings as $componentName => $componentValueType) { - $builder->setOffsetValueType(new ConstantStringType($componentName), $componentValueType); - } - - $returnTypes[] = $builder->getArray(); - - $this->allComponentsTogetherType = TypeCombinator::union(...$returnTypes); - } - - return $this->allComponentsTogetherType; - } - - private function cacheReturnTypes(): void - { - if ($this->componentTypesPairedConstants !== null) { - return; - } - - $string = new StringType(); - $integer = new IntegerType(); - - $stringOrNull = TypeCombinator::addNull($string); - $integerOrNull = TypeCombinator::addNull($integer); - - $this->componentTypesPairedConstants = [ - PHP_URL_SCHEME => $stringOrNull, - PHP_URL_HOST => $stringOrNull, - PHP_URL_PORT => $integerOrNull, - PHP_URL_USER => $stringOrNull, - PHP_URL_PASS => $stringOrNull, - PHP_URL_PATH => $stringOrNull, - PHP_URL_QUERY => $stringOrNull, - PHP_URL_FRAGMENT => $stringOrNull, - ]; - - $this->componentTypesPairedStrings = [ - 'scheme' => $string, - 'host' => $string, - 'port' => $integer, - 'user' => $string, - 'pass' => $string, - 'path' => $string, - 'query' => $string, - 'fragment' => $string, - ]; - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/PathinfoFunctionDynamicReturnTypeExtension.php b/vendor/phpstan/phpstan/src/Type/Php/PathinfoFunctionDynamicReturnTypeExtension.php deleted file mode 100644 index 2f3ca6c..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/PathinfoFunctionDynamicReturnTypeExtension.php +++ /dev/null @@ -1,54 +0,0 @@ -getName() === 'pathinfo'; - } - - public function getTypeFromFunctionCall( - FunctionReflection $functionReflection, - \PhpParser\Node\Expr\FuncCall $functionCall, - Scope $scope - ): Type - { - $argsCount = count($functionCall->args); - if ($argsCount === 0) { - return ParametersAcceptorSelector::selectSingle($functionReflection->getVariants())->getReturnType(); - } elseif ($argsCount === 1) { - $stringType = new StringType(); - - $dirname = new ConstantStringType('dirname'); - $basename = new ConstantStringType('basename'); - $extension = new ConstantStringType('extension'); - $filename = new ConstantStringType('filename'); - - return new UnionType([ - new ConstantArrayType( - [$dirname, $basename, $filename], - [$stringType, $stringType, $stringType] - ), - new ConstantArrayType( - [$dirname, $basename, $extension, $filename], - [$stringType, $stringType, $stringType, $stringType] - ), - ]); - } - - return new StringType(); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/PropertyExistsTypeSpecifyingExtension.php b/vendor/phpstan/phpstan/src/Type/Php/PropertyExistsTypeSpecifyingExtension.php deleted file mode 100644 index 194a376..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/PropertyExistsTypeSpecifyingExtension.php +++ /dev/null @@ -1,62 +0,0 @@ -typeSpecifier = $typeSpecifier; - } - - public function isFunctionSupported( - FunctionReflection $functionReflection, - FuncCall $node, - TypeSpecifierContext $context - ): bool - { - return $functionReflection->getName() === 'property_exists' - && $context->truthy() - && count($node->args) >= 2; - } - - public function specifyTypes( - FunctionReflection $functionReflection, - FuncCall $node, - Scope $scope, - TypeSpecifierContext $context - ): SpecifiedTypes - { - $propertyNameType = $scope->getType($node->args[1]->value); - if (!$propertyNameType instanceof ConstantStringType) { - return new SpecifiedTypes([], []); - } - - return $this->typeSpecifier->create( - $node->args[0]->value, - new IntersectionType([ - new ObjectWithoutClassType(), - new HasPropertyType($propertyNameType->getValue()), - ]), - $context - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/RangeFunctionReturnTypeExtension.php b/vendor/phpstan/phpstan/src/Type/Php/RangeFunctionReturnTypeExtension.php deleted file mode 100644 index 65a7ab3..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/RangeFunctionReturnTypeExtension.php +++ /dev/null @@ -1,106 +0,0 @@ -getName() === 'range'; - } - - public function getTypeFromFunctionCall(FunctionReflection $functionReflection, FuncCall $functionCall, Scope $scope): Type - { - if (count($functionCall->args) < 2) { - return ParametersAcceptorSelector::selectSingle($functionReflection->getVariants())->getReturnType(); - } - - $startType = $scope->getType($functionCall->args[0]->value); - $endType = $scope->getType($functionCall->args[1]->value); - $stepType = count($functionCall->args) >= 3 ? $scope->getType($functionCall->args[2]->value) : new ConstantIntegerType(1); - - $constantReturnTypes = []; - - $startConstants = TypeUtils::getConstantScalars($startType); - foreach ($startConstants as $startConstant) { - if (!$startConstant instanceof ConstantIntegerType && !$startConstant instanceof ConstantFloatType) { - continue; - } - - $endConstants = TypeUtils::getConstantScalars($endType); - foreach ($endConstants as $endConstant) { - if (!$endConstant instanceof ConstantIntegerType && !$endConstant instanceof ConstantFloatType) { - continue; - } - - $stepConstants = TypeUtils::getConstantScalars($stepType); - foreach ($stepConstants as $stepConstant) { - if (!$stepConstant instanceof ConstantIntegerType && !$stepConstant instanceof ConstantFloatType) { - continue; - } - - $rangeLength = (int) ceil(abs($startConstant->getValue() - $endConstant->getValue()) / $stepConstant->getValue()) + 1; - if ($rangeLength > self::RANGE_LENGTH_THRESHOLD) { - continue; - } - - $keyTypes = []; - $valueTypes = []; - - $rangeValues = range($startConstant->getValue(), $endConstant->getValue(), $stepConstant->getValue()); - foreach ($rangeValues as $key => $value) { - $keyTypes[] = new ConstantIntegerType($key); - $valueTypes[] = $scope->getTypeFromValue($value); - } - - $constantReturnTypes[] = new ConstantArrayType($keyTypes, $valueTypes, $rangeLength); - } - } - } - - if (count($constantReturnTypes) > 0) { - return TypeCombinator::union(...$constantReturnTypes); - } - - $startType = TypeUtils::generalizeType($startType); - $endType = TypeUtils::generalizeType($endType); - $stepType = TypeUtils::generalizeType($stepType); - - if ( - $startType instanceof IntegerType - && $endType instanceof IntegerType - && $stepType instanceof IntegerType - ) { - return new ArrayType(new IntegerType(), new IntegerType()); - } - - if ( - $startType instanceof FloatType - || $endType instanceof FloatType - || $stepType instanceof FloatType - ) { - return new ArrayType(new IntegerType(), new FloatType()); - } - - return new ArrayType(new IntegerType(), new UnionType([new IntegerType(), new FloatType()])); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/ReplaceFunctionsDynamicReturnTypeExtension.php b/vendor/phpstan/phpstan/src/Type/Php/ReplaceFunctionsDynamicReturnTypeExtension.php deleted file mode 100644 index ace448b..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/ReplaceFunctionsDynamicReturnTypeExtension.php +++ /dev/null @@ -1,86 +0,0 @@ - */ - private $functions = [ - 'preg_replace' => 2, - 'preg_replace_callback' => 2, - 'preg_replace_callback_array' => 1, - 'str_replace' => 2, - 'str_ireplace' => 2, - 'substr_replace' => 0, - ]; - - public function isFunctionSupported(FunctionReflection $functionReflection): bool - { - return array_key_exists($functionReflection->getName(), $this->functions); - } - - public function getTypeFromFunctionCall( - FunctionReflection $functionReflection, - FuncCall $functionCall, - Scope $scope - ): Type - { - $type = $this->getPreliminarilyResolvedTypeFromFunctionCall($functionReflection, $functionCall, $scope); - - $possibleTypes = ParametersAcceptorSelector::selectSingle($functionReflection->getVariants())->getReturnType(); - - if (TypeCombinator::containsNull($possibleTypes)) { - $type = TypeCombinator::addNull($type); - } - - return $type; - } - - private function getPreliminarilyResolvedTypeFromFunctionCall( - FunctionReflection $functionReflection, - FuncCall $functionCall, - Scope $scope - ): Type - { - $argumentPosition = $this->functions[$functionReflection->getName()]; - if (count($functionCall->args) <= $argumentPosition) { - return ParametersAcceptorSelector::selectSingle($functionReflection->getVariants())->getReturnType(); - } - - $subjectArgumentType = $scope->getType($functionCall->args[$argumentPosition]->value); - $defaultReturnType = ParametersAcceptorSelector::selectSingle($functionReflection->getVariants())->getReturnType(); - if ($subjectArgumentType instanceof MixedType) { - return TypeUtils::toBenevolentUnion($defaultReturnType); - } - $stringType = new StringType(); - $arrayType = new ArrayType(new MixedType(), new MixedType()); - - $isStringSuperType = $stringType->isSuperTypeOf($subjectArgumentType); - $isArraySuperType = $arrayType->isSuperTypeOf($subjectArgumentType); - $compareSuperTypes = $isStringSuperType->compareTo($isArraySuperType); - if ($compareSuperTypes === $isStringSuperType) { - return $stringType; - } elseif ($compareSuperTypes === $isArraySuperType) { - if ($subjectArgumentType instanceof ArrayType) { - return $subjectArgumentType->generalizeValues(); - } - return $subjectArgumentType; - } - - return $defaultReturnType; - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/SimpleXMLElementClassPropertyReflectionExtension.php b/vendor/phpstan/phpstan/src/Type/Php/SimpleXMLElementClassPropertyReflectionExtension.php deleted file mode 100644 index 0b2feb1..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/SimpleXMLElementClassPropertyReflectionExtension.php +++ /dev/null @@ -1,25 +0,0 @@ -getName() === 'SimpleXMLElement'; - } - - - public function getProperty(ClassReflection $classReflection, string $propertyName): PropertyReflection - { - return new SimpleXMLElementProperty($classReflection, new ObjectType('SimpleXMLElement')); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/SprintfFunctionDynamicReturnTypeExtension.php b/vendor/phpstan/phpstan/src/Type/Php/SprintfFunctionDynamicReturnTypeExtension.php deleted file mode 100644 index f27d242..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/SprintfFunctionDynamicReturnTypeExtension.php +++ /dev/null @@ -1,47 +0,0 @@ -getName() === 'sprintf'; - } - - public function getTypeFromFunctionCall( - FunctionReflection $functionReflection, - FuncCall $functionCall, - Scope $scope - ): Type - { - $values = []; - $returnType = new StringType(); - foreach ($functionCall->args as $arg) { - $argType = $scope->getType($arg->value); - if (!$argType instanceof ConstantScalarType) { - return $returnType; - } - - $values[] = $argType->getValue(); - } - - try { - $value = sprintf(...$values); - } catch (\Throwable $e) { - return $returnType; - } - - return $scope->getTypeFromValue($value); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/StatDynamicReturnTypeExtension.php b/vendor/phpstan/phpstan/src/Type/Php/StatDynamicReturnTypeExtension.php deleted file mode 100644 index ccc97ff..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/StatDynamicReturnTypeExtension.php +++ /dev/null @@ -1,76 +0,0 @@ -getName(), ['stat', 'lstat', 'fstat', 'ssh2_sftp_stat'], true); - } - - public function getTypeFromFunctionCall(FunctionReflection $functionReflection, FuncCall $functionCall, Scope $scope): Type - { - return $this->getReturnType(); - } - - public function getClass(): string - { - return \SplFileObject::class; - } - - public function isMethodSupported(MethodReflection $methodReflection): bool - { - return $methodReflection->getName() === 'fstat'; - } - - public function getTypeFromMethodCall(MethodReflection $methodReflection, MethodCall $methodCall, Scope $scope): Type - { - return $this->getReturnType(); - } - - private function getReturnType(): Type - { - $valueType = new IntegerType(); - $builder = ConstantArrayTypeBuilder::createEmpty(); - $keys = [ - 'dev', - 'ino', - 'mode', - 'nlink', - 'uid', - 'gid', - 'rdev', - 'size', - 'atime', - 'mtime', - 'ctime', - 'blksize', - 'blocks', - ]; - - foreach ($keys as $key) { - $builder->setOffsetValueType(null, $valueType); - } - - foreach ($keys as $key) { - $builder->setOffsetValueType(new ConstantStringType($key), $valueType); - } - - return TypeCombinator::union($builder->getArray(), new ConstantBooleanType(false)); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/StrSplitFunctionReturnTypeExtension.php b/vendor/phpstan/phpstan/src/Type/Php/StrSplitFunctionReturnTypeExtension.php deleted file mode 100644 index c62efd1..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/StrSplitFunctionReturnTypeExtension.php +++ /dev/null @@ -1,84 +0,0 @@ -getName() === 'str_split'; - } - - public function getTypeFromFunctionCall(FunctionReflection $functionReflection, FuncCall $functionCall, Scope $scope): Type - { - $defaultReturnType = ParametersAcceptorSelector::selectSingle($functionReflection->getVariants())->getReturnType(); - - if (count($functionCall->args) < 1) { - return $defaultReturnType; - } - - $splitLength = 1; - if (count($functionCall->args) >= 2) { - $splitLengthType = $scope->getType($functionCall->args[1]->value); - if (!$splitLengthType instanceof ConstantIntegerType) { - return $defaultReturnType; - } - $splitLength = $splitLengthType->getValue(); - if ($splitLength < 1) { - return new ConstantBooleanType(false); - } - } - - $stringType = $scope->getType($functionCall->args[0]->value); - if (!$stringType instanceof ConstantStringType) { - return new ArrayType(new IntegerType(), new StringType()); - } - $stringValue = $stringType->getValue(); - - $items = str_split($stringValue, $splitLength); - if (!is_array($items)) { - throw new \PHPStan\ShouldNotHappenException(); - } - - return self::createConstantArrayFrom($items, $scope); - } - - private static function createConstantArrayFrom(array $constantArray, Scope $scope): ConstantArrayType - { - $keyTypes = []; - $valueTypes = []; - $isList = true; - $i = 0; - - foreach ($constantArray as $key => $value) { - $keyType = $scope->getTypeFromValue($key); - if (!$keyType instanceof ConstantIntegerType) { - throw new \PHPStan\ShouldNotHappenException(); - } - $keyTypes[] = $keyType; - - $valueTypes[] = $scope->getTypeFromValue($value); - - $isList = $isList && $key === $i; - $i++; - } - - return new ConstantArrayType($keyTypes, $valueTypes, $isList ? $i : 0); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/StrtotimeFunctionReturnTypeExtension.php b/vendor/phpstan/phpstan/src/Type/Php/StrtotimeFunctionReturnTypeExtension.php deleted file mode 100644 index 767c141..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/StrtotimeFunctionReturnTypeExtension.php +++ /dev/null @@ -1,45 +0,0 @@ -getName() === 'strtotime'; - } - - public function getTypeFromFunctionCall(FunctionReflection $functionReflection, FuncCall $functionCall, Scope $scope): Type - { - $defaultReturnType = ParametersAcceptorSelector::selectSingle($functionReflection->getVariants())->getReturnType(); - if (count($functionCall->args) === 0) { - return $defaultReturnType; - } - $argType = $scope->getType($functionCall->args[0]->value); - if ($argType instanceof MixedType) { - return TypeUtils::toBenevolentUnion($defaultReturnType); - } - $result = array_unique(array_map(static function (ConstantStringType $string): bool { - return is_int(strtotime($string->getValue())); - }, TypeUtils::getConstantStrings($argType))); - - if (count($result) !== 1) { - return $defaultReturnType; - } - - return $result[0] ? new IntegerType() : new ConstantBooleanType(false); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/TypeSpecifyingFunctionsDynamicReturnTypeExtension.php b/vendor/phpstan/phpstan/src/Type/Php/TypeSpecifyingFunctionsDynamicReturnTypeExtension.php deleted file mode 100644 index e83ab82..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/TypeSpecifyingFunctionsDynamicReturnTypeExtension.php +++ /dev/null @@ -1,93 +0,0 @@ -broker = $broker; - } - - public function setTypeSpecifier(TypeSpecifier $typeSpecifier): void - { - $this->typeSpecifier = $typeSpecifier; - } - - public function isFunctionSupported(FunctionReflection $functionReflection): bool - { - return in_array($functionReflection->getName(), [ - 'array_key_exists', - 'in_array', - 'is_numeric', - 'is_int', - 'is_array', - 'is_bool', - 'is_callable', - 'is_float', - 'is_double', - 'is_real', - 'is_iterable', - 'is_null', - 'is_object', - 'is_resource', - 'is_scalar', - 'is_string', - 'is_subclass_of', - ], true); - } - - public function getTypeFromFunctionCall( - FunctionReflection $functionReflection, - FuncCall $functionCall, - Scope $scope - ): Type - { - if (count($functionCall->args) === 0) { - return ParametersAcceptorSelector::selectSingle($functionReflection->getVariants())->getReturnType(); - } - - $isAlways = $this->getHelper()->findSpecifiedType( - $scope, - $functionCall - ); - if ($isAlways === null) { - return ParametersAcceptorSelector::selectSingle($functionReflection->getVariants())->getReturnType(); - } - - return new ConstantBooleanType($isAlways); - } - - private function getHelper(): ImpossibleCheckTypeHelper - { - if ($this->helper === null) { - $this->helper = new ImpossibleCheckTypeHelper($this->broker, $this->typeSpecifier); - } - - return $this->helper; - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/VarExportFunctionDynamicReturnTypeExtension.php b/vendor/phpstan/phpstan/src/Type/Php/VarExportFunctionDynamicReturnTypeExtension.php deleted file mode 100644 index b90055c..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/VarExportFunctionDynamicReturnTypeExtension.php +++ /dev/null @@ -1,58 +0,0 @@ -getName(), - [ - 'var_export', - 'highlight_file', - 'highlight_string', - 'print_r', - ], - true - ); - } - - public function getTypeFromFunctionCall(\PHPStan\Reflection\FunctionReflection $functionReflection, \PhpParser\Node\Expr\FuncCall $functionCall, \PHPStan\Analyser\Scope $scope): \PHPStan\Type\Type - { - if ($functionReflection->getName() === 'var_export') { - $fallbackReturnType = new NullType(); - } elseif ($functionReflection->getName() === 'print_r') { - $fallbackReturnType = new ConstantBooleanType(true); - } else { - $fallbackReturnType = new BooleanType(); - } - - if (count($functionCall->args) < 1) { - return TypeCombinator::union( - new StringType(), - $fallbackReturnType - ); - } - - if (count($functionCall->args) < 2) { - return $fallbackReturnType; - } - - $returnArgumentType = $scope->getType($functionCall->args[1]->value); - if ((new ConstantBooleanType(true))->isSuperTypeOf($returnArgumentType)->yes()) { - return new StringType(); - } - - return $fallbackReturnType; - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Php/VersionCompareFunctionDynamicReturnTypeExtension.php b/vendor/phpstan/phpstan/src/Type/Php/VersionCompareFunctionDynamicReturnTypeExtension.php deleted file mode 100644 index d0a6c37..0000000 --- a/vendor/phpstan/phpstan/src/Type/Php/VersionCompareFunctionDynamicReturnTypeExtension.php +++ /dev/null @@ -1,82 +0,0 @@ -getName() === 'version_compare'; - } - - public function getTypeFromFunctionCall( - FunctionReflection $functionReflection, - FuncCall $functionCall, - Scope $scope - ): Type - { - if (count($functionCall->args) < 2) { - return ParametersAcceptorSelector::selectFromArgs($scope, $functionCall->args, $functionReflection->getVariants())->getReturnType(); - } - - $version1Strings = TypeUtils::getConstantStrings($scope->getType($functionCall->args[0]->value)); - $version2Strings = TypeUtils::getConstantStrings($scope->getType($functionCall->args[1]->value)); - $counts = [ - count($version1Strings), - count($version2Strings), - ]; - - if (isset($functionCall->args[2])) { - $operatorStrings = TypeUtils::getConstantStrings($scope->getType($functionCall->args[2]->value)); - $counts[] = count($operatorStrings); - $returnType = new BooleanType(); - } else { - $returnType = TypeCombinator::union( - new ConstantIntegerType(-1), - new ConstantIntegerType(0), - new ConstantIntegerType(1) - ); - } - - if (count(array_filter($counts, static function (int $count): bool { - return $count === 0; - })) > 0) { - return $returnType; // one of the arguments is not a constant string - } - - if (count(array_filter($counts, static function (int $count): bool { - return $count > 1; - })) > 1) { - return $returnType; // more than one argument can have multiple possibilities, avoid combinatorial explosion - } - - $types = []; - foreach ($version1Strings as $version1String) { - foreach ($version2Strings as $version2String) { - if (isset($operatorStrings)) { - foreach ($operatorStrings as $operatorString) { - $value = version_compare($version1String->getValue(), $version2String->getValue(), $operatorString->getValue()); - $types[$value] = new ConstantBooleanType($value); - } - } else { - $value = version_compare($version1String->getValue(), $version2String->getValue()); - $types[$value] = new ConstantIntegerType($value); - } - } - } - return TypeCombinator::union(...$types); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/RecursionGuard.php b/vendor/phpstan/phpstan/src/Type/RecursionGuard.php deleted file mode 100644 index 1c109fa..0000000 --- a/vendor/phpstan/phpstan/src/Type/RecursionGuard.php +++ /dev/null @@ -1,26 +0,0 @@ -describe(VerbosityLevel::value()); - if (isset(self::$context[$key])) { - return new ErrorType(); - } - - try { - self::$context[$key] = true; - return $callback(); - } finally { - unset(self::$context[$key]); - } - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/ResourceType.php b/vendor/phpstan/phpstan/src/Type/ResourceType.php deleted file mode 100644 index f6c833e..0000000 --- a/vendor/phpstan/phpstan/src/Type/ResourceType.php +++ /dev/null @@ -1,87 +0,0 @@ -baseClass = $baseClass; - $this->staticObjectType = new ObjectType($baseClass); - } - - public function getClassName(): string - { - return $this->baseClass; - } - - protected function getStaticObjectType(): ObjectType - { - return $this->staticObjectType; - } - - /** - * @return string[] - */ - public function getReferencedClasses(): array - { - return $this->staticObjectType->getReferencedClasses(); - } - - public function getBaseClass(): string - { - return $this->baseClass; - } - - public function accepts(Type $type, bool $strictTypes): TrinaryLogic - { - return $this->staticObjectType->accepts($type, $strictTypes); - } - - public function isSuperTypeOf(Type $type): TrinaryLogic - { - if ($type instanceof self) { - return $this->staticObjectType->isSuperTypeOf($type); - } - - if ($type instanceof ObjectWithoutClassType) { - return TrinaryLogic::createMaybe(); - } - - if ($type instanceof ObjectType) { - return TrinaryLogic::createMaybe()->and($this->staticObjectType->isSuperTypeOf($type)); - } - - if ($type instanceof CompoundType) { - return $type->isSubTypeOf($this); - } - - return TrinaryLogic::createNo(); - } - - public function equals(Type $type): bool - { - if (get_class($type) !== static::class) { - return false; - } - - /** @var StaticType $type */ - $type = $type; - return $this->staticObjectType->equals($type->staticObjectType); - } - - public function describe(VerbosityLevel $level): string - { - return sprintf('static(%s)', $this->staticObjectType->describe($level)); - } - - public function canAccessProperties(): TrinaryLogic - { - return $this->staticObjectType->canAccessProperties(); - } - - public function hasProperty(string $propertyName): TrinaryLogic - { - return $this->staticObjectType->hasProperty($propertyName); - } - - public function getProperty(string $propertyName, ClassMemberAccessAnswerer $scope): PropertyReflection - { - return $this->staticObjectType->getProperty($propertyName, $scope); - } - - public function canCallMethods(): TrinaryLogic - { - return $this->staticObjectType->canCallMethods(); - } - - public function hasMethod(string $methodName): TrinaryLogic - { - return $this->staticObjectType->hasMethod($methodName); - } - - public function getMethod(string $methodName, ClassMemberAccessAnswerer $scope): MethodReflection - { - return $this->staticObjectType->getMethod($methodName, $scope); - } - - public function canAccessConstants(): TrinaryLogic - { - return $this->staticObjectType->canAccessConstants(); - } - - public function hasConstant(string $constantName): TrinaryLogic - { - return $this->staticObjectType->hasConstant($constantName); - } - - public function getConstant(string $constantName): ConstantReflection - { - return $this->staticObjectType->getConstant($constantName); - } - - public function resolveStatic(string $className): Type - { - return new ObjectType($className); - } - - public function changeBaseClass(string $className): StaticResolvableType - { - $thisClass = static::class; - return new $thisClass($className); - } - - public function isIterable(): TrinaryLogic - { - return $this->staticObjectType->isIterable(); - } - - public function isIterableAtLeastOnce(): TrinaryLogic - { - return $this->staticObjectType->isIterableAtLeastOnce(); - } - - public function getIterableKeyType(): Type - { - return $this->staticObjectType->getIterableKeyType(); - } - - public function getIterableValueType(): Type - { - return $this->staticObjectType->getIterableValueType(); - } - - public function isOffsetAccessible(): TrinaryLogic - { - return $this->staticObjectType->isInstanceOf(\ArrayAccess::class); - } - - public function hasOffsetValueType(Type $offsetType): TrinaryLogic - { - return $this->staticObjectType->hasOffsetValueType($offsetType); - } - - public function getOffsetValueType(Type $offsetType): Type - { - return $this->staticObjectType->getOffsetValueType($offsetType); - } - - public function setOffsetValueType(?Type $offsetType, Type $valueType): Type - { - return $this->staticObjectType->setOffsetValueType($offsetType, $valueType); - } - - public function isCallable(): TrinaryLogic - { - return $this->staticObjectType->isCallable(); - } - - public function isArray(): TrinaryLogic - { - return $this->staticObjectType->isArray(); - } - - /** - * @param \PHPStan\Reflection\ClassMemberAccessAnswerer $scope - * @return \PHPStan\Reflection\ParametersAcceptor[] - */ - public function getCallableParametersAcceptors(ClassMemberAccessAnswerer $scope): array - { - return $this->staticObjectType->getCallableParametersAcceptors($scope); - } - - public function isCloneable(): TrinaryLogic - { - return TrinaryLogic::createYes(); - } - - public function toNumber(): Type - { - return new ErrorType(); - } - - public function toString(): Type - { - return $this->staticObjectType->toString(); - } - - public function toInteger(): Type - { - return new ErrorType(); - } - - public function toFloat(): Type - { - return new ErrorType(); - } - - public function toArray(): Type - { - return $this->staticObjectType->toArray(); - } - - public function traverse(callable $cb): Type - { - return $this; - } - - /** - * @param mixed[] $properties - * @return Type - */ - public static function __set_state(array $properties): Type - { - return new static($properties['baseClass']); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/StringAlwaysAcceptingObjectWithToStringType.php b/vendor/phpstan/phpstan/src/Type/StringAlwaysAcceptingObjectWithToStringType.php deleted file mode 100644 index 1be5164..0000000 --- a/vendor/phpstan/phpstan/src/Type/StringAlwaysAcceptingObjectWithToStringType.php +++ /dev/null @@ -1,28 +0,0 @@ -hasClass($type->getClassName())) { - return TrinaryLogic::createNo(); - } - - $typeClass = $broker->getClass($type->getClassName()); - return TrinaryLogic::createFromBoolean( - $typeClass->hasNativeMethod('__toString') - ); - } - - return parent::accepts($type, $strictTypes); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/StringType.php b/vendor/phpstan/phpstan/src/Type/StringType.php deleted file mode 100644 index 2ef2c27..0000000 --- a/vendor/phpstan/phpstan/src/Type/StringType.php +++ /dev/null @@ -1,130 +0,0 @@ -isSuperTypeOf($offsetType)->and(TrinaryLogic::createMaybe()); - } - - public function getOffsetValueType(Type $offsetType): Type - { - if ($this->hasOffsetValueType($offsetType)->no()) { - return new ErrorType(); - } - - return new StringType(); - } - - public function setOffsetValueType(?Type $offsetType, Type $valueType): Type - { - if ($offsetType === null) { - return new ErrorType(); - } - - $valueStringType = $valueType->toString(); - if ($valueStringType instanceof ErrorType) { - return new ErrorType(); - } - - if ((new IntegerType())->isSuperTypeOf($offsetType)->yes()) { - return new StringType(); - } - - return new ErrorType(); - } - - public function accepts(Type $type, bool $strictTypes): TrinaryLogic - { - if ($type instanceof self) { - return TrinaryLogic::createYes(); - } - - if ($type instanceof CompoundType) { - return CompoundTypeHelper::accepts($type, $this, $strictTypes); - } - - if ($type instanceof TypeWithClassName && !$strictTypes) { - $broker = Broker::getInstance(); - if (!$broker->hasClass($type->getClassName())) { - return TrinaryLogic::createNo(); - } - - $typeClass = $broker->getClass($type->getClassName()); - return TrinaryLogic::createFromBoolean( - $typeClass->hasNativeMethod('__toString') - ); - } - - return TrinaryLogic::createNo(); - } - - public function toNumber(): Type - { - return new ErrorType(); - } - - public function toInteger(): Type - { - return new IntegerType(); - } - - public function toFloat(): Type - { - return new FloatType(); - } - - public function toString(): Type - { - return $this; - } - - public function toArray(): Type - { - return new ConstantArrayType( - [new ConstantIntegerType(0)], - [$this], - 1 - ); - } - - /** - * @param mixed[] $properties - * @return Type - */ - public static function __set_state(array $properties): Type - { - return new self(); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/SubtractableType.php b/vendor/phpstan/phpstan/src/Type/SubtractableType.php deleted file mode 100644 index c40188a..0000000 --- a/vendor/phpstan/phpstan/src/Type/SubtractableType.php +++ /dev/null @@ -1,16 +0,0 @@ -getStaticObjectType()->describe($level)); - } - - public function accepts(Type $type, bool $strictTypes): TrinaryLogic - { - if ($type instanceof CompoundType) { - return CompoundTypeHelper::accepts($type, $this, $strictTypes); - } - - return TrinaryLogic::createFromBoolean( - $type instanceof self - && $type->getBaseClass() === $this->getBaseClass() - ); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Traits/ConstantScalarTypeTrait.php b/vendor/phpstan/phpstan/src/Type/Traits/ConstantScalarTypeTrait.php deleted file mode 100644 index 7fd1f9a..0000000 --- a/vendor/phpstan/phpstan/src/Type/Traits/ConstantScalarTypeTrait.php +++ /dev/null @@ -1,53 +0,0 @@ -value === $type->value); - } - - if ($type instanceof CompoundType) { - return CompoundTypeHelper::accepts($type, $this, $strictTypes); - } - - return TrinaryLogic::createNo(); - } - - public function isSuperTypeOf(Type $type): TrinaryLogic - { - if ($type instanceof self) { - return $this->value === $type->value ? TrinaryLogic::createYes() : TrinaryLogic::createNo(); - } - - if ($type instanceof parent) { - return TrinaryLogic::createMaybe(); - } - - if ($type instanceof CompoundType) { - return $type->isSubTypeOf($this); - } - - return TrinaryLogic::createNo(); - } - - public function equals(Type $type): bool - { - return $type instanceof self && $this->value === $type->value; - } - - public function generalize(): Type - { - return new parent(); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/Traits/FalseyBooleanTypeTrait.php b/vendor/phpstan/phpstan/src/Type/Traits/FalseyBooleanTypeTrait.php deleted file mode 100644 index ca1e75e..0000000 --- a/vendor/phpstan/phpstan/src/Type/Traits/FalseyBooleanTypeTrait.php +++ /dev/null @@ -1,16 +0,0 @@ -getTypes() as $unionTypeToRemove) { - $fromType = self::remove($fromType, $unionTypeToRemove); - } - return $fromType; - } - - if ($fromType instanceof UnionType) { - $innerTypes = []; - foreach ($fromType->getTypes() as $innerType) { - $innerTypes[] = self::remove($innerType, $typeToRemove); - } - - return self::union(...$innerTypes); - } - - if ($fromType instanceof BooleanType && $fromType->isSuperTypeOf(new BooleanType())->yes()) { - if ($typeToRemove instanceof ConstantBooleanType) { - return new ConstantBooleanType(!$typeToRemove->getValue()); - } - } elseif ($fromType instanceof IterableType) { - $traversableType = new ObjectType(\Traversable::class); - $arrayType = new ArrayType(new MixedType(), new MixedType()); - if ($typeToRemove->isSuperTypeOf($arrayType)->yes()) { - return $traversableType; - } - if ($typeToRemove->isSuperTypeOf($traversableType)->yes()) { - return $arrayType; - } - } - - if ($typeToRemove->isSuperTypeOf($fromType)->yes()) { - return new NeverType(); - } - - if ( - (new ArrayType(new MixedType(), new MixedType()))->isSuperTypeOf($fromType)->yes() - ) { - if ($typeToRemove instanceof ConstantArrayType - && $typeToRemove->isIterableAtLeastOnce()->no()) { - return self::intersect($fromType, new NonEmptyArrayType()); - } - - if ($typeToRemove instanceof NonEmptyArrayType) { - return new ConstantArrayType([], []); - } - } - - if ( - self::$enableSubtractableTypes - && $fromType instanceof SubtractableType - && $fromType->isSuperTypeOf($typeToRemove)->yes() - && $typeToRemove->isSuperTypeOf($fromType)->maybe() - ) { - return $fromType->subtract($typeToRemove); - } - - return $fromType; - } - - public static function removeNull(Type $type): Type - { - if (self::containsNull($type)) { - return self::remove($type, new NullType()); - } - - return $type; - } - - public static function containsNull(Type $type): bool - { - if ($type instanceof UnionType) { - foreach ($type->getTypes() as $innerType) { - if ($innerType instanceof NullType) { - return true; - } - } - - return false; - } - - return $type instanceof NullType; - } - - public static function union(Type ...$types): Type - { - $benevolentTypes = []; - // transform A | (B | C) to A | B | C - for ($i = 0; $i < count($types); $i++) { - if ($types[$i] instanceof BenevolentUnionType) { - foreach ($types[$i]->getTypes() as $benevolentInnerType) { - $benevolentTypes[$benevolentInnerType->describe(VerbosityLevel::value())] = $benevolentInnerType; - } - array_splice($types, $i, 1, $types[$i]->getTypes()); - continue; - } - if (!($types[$i] instanceof UnionType)) { - continue; - } - - array_splice($types, $i, 1, $types[$i]->getTypes()); - } - - $typesCount = count($types); - $arrayTypes = []; - $arrayAccessoryTypes = []; - $scalarTypes = []; - $hasGenericScalarTypes = []; - for ($i = 0; $i < $typesCount; $i++) { - if ($types[$i] instanceof NeverType) { - unset($types[$i]); - continue; - } - if (!self::$enableSubtractableTypes && $types[$i] instanceof MixedType) { - return $types[$i]; - } - if ($types[$i] instanceof ConstantScalarType) { - $type = $types[$i]; - $scalarTypes[get_class($type)][md5($type->describe(VerbosityLevel::precise()))] = $type; - unset($types[$i]); - continue; - } - if ($types[$i] instanceof BooleanType) { - $hasGenericScalarTypes[ConstantBooleanType::class] = true; - } - if ($types[$i] instanceof FloatType) { - $hasGenericScalarTypes[ConstantFloatType::class] = true; - } - if ($types[$i] instanceof IntegerType) { - $hasGenericScalarTypes[ConstantIntegerType::class] = true; - } - if ($types[$i] instanceof StringType) { - $hasGenericScalarTypes[ConstantStringType::class] = true; - } - if ($types[$i] instanceof IntersectionType) { - $intermediateArrayType = null; - $intermediateAccessoryTypes = []; - foreach ($types[$i]->getTypes() as $innerType) { - if ($innerType instanceof ArrayType) { - $intermediateArrayType = $innerType; - continue; - } - if ($innerType instanceof AccessoryType || $innerType instanceof CallableType) { - $intermediateAccessoryTypes[$innerType->describe(VerbosityLevel::precise())] = $innerType; - continue; - } - } - - if ($intermediateArrayType !== null) { - $arrayTypes[] = $intermediateArrayType; - $arrayAccessoryTypes[] = $intermediateAccessoryTypes; - unset($types[$i]); - continue; - } - } - if (!$types[$i] instanceof ArrayType) { - continue; - } - - $arrayTypes[] = $types[$i]; - $arrayAccessoryTypes[] = []; - unset($types[$i]); - } - - /** @var ArrayType[] $arrayTypes */ - $arrayTypes = $arrayTypes; - - $arrayAccessoryTypesToProcess = []; - if (count($arrayAccessoryTypes) > 1) { - $arrayAccessoryTypesToProcess = array_values(array_intersect_key(...$arrayAccessoryTypes)); - } elseif (count($arrayAccessoryTypes) > 0) { - $arrayAccessoryTypesToProcess = array_values($arrayAccessoryTypes[0]); - } - - $types = array_values( - array_merge( - $types, - self::processArrayTypes($arrayTypes, $arrayAccessoryTypesToProcess) - ) - ); - - // simplify string[] | int[] to (string|int)[] - for ($i = 0; $i < count($types); $i++) { - for ($j = $i + 1; $j < count($types); $j++) { - if ($types[$i] instanceof IterableType && $types[$j] instanceof IterableType) { - $types[$i] = new IterableType( - self::union($types[$i]->getIterableKeyType(), $types[$j]->getIterableKeyType()), - self::union($types[$i]->getIterableValueType(), $types[$j]->getIterableValueType()) - ); - array_splice($types, $j, 1); - continue 2; - } - } - } - - foreach ($scalarTypes as $classType => $scalarTypeItems) { - if (isset($hasGenericScalarTypes[$classType])) { - continue; - } - if ($classType === ConstantBooleanType::class && count($scalarTypeItems) === 2) { - $types[] = new BooleanType(); - continue; - } - foreach ($scalarTypeItems as $type) { - if (count($scalarTypeItems) > self::CONSTANT_SCALAR_UNION_THRESHOLD) { - $types[] = $type->generalize(); - break; - } - $types[] = $type; - } - } - - // transform A | A to A - // transform A | never to A - for ($i = 0; $i < count($types); $i++) { - for ($j = $i + 1; $j < count($types); $j++) { - if (self::$enableSubtractableTypes) { - - if ( - $types[$i] instanceof SubtractableType - && $types[$i]->getTypeWithoutSubtractedType()->isSuperTypeOf($types[$j])->yes() - ) { - $subtractedType = null; - if ($types[$j] instanceof SubtractableType) { - $subtractedType = $types[$j]->getSubtractedType(); - } - $types[$i] = self::intersectWithSubtractedType($types[$i], $subtractedType); - array_splice($types, $j--, 1); - continue 1; - } - - if ( - $types[$j] instanceof SubtractableType - && $types[$j]->getTypeWithoutSubtractedType()->isSuperTypeOf($types[$i])->yes() - ) { - $subtractedType = null; - if ($types[$i] instanceof SubtractableType) { - $subtractedType = $types[$i]->getSubtractedType(); - } - $types[$j] = self::intersectWithSubtractedType($types[$j], $subtractedType); - array_splice($types, $i--, 1); - continue 2; - } - } - - if ( - !$types[$j] instanceof ConstantArrayType - && $types[$j]->isSuperTypeOf($types[$i])->yes() - ) { - array_splice($types, $i--, 1); - continue 2; - } - - if ( - !$types[$i] instanceof ConstantArrayType - && $types[$i]->isSuperTypeOf($types[$j])->yes() - ) { - array_splice($types, $j--, 1); - continue 1; - } - } - } - - if (count($types) === 0) { - return new NeverType(); - - } elseif (count($types) === 1) { - return $types[0]; - } - - if (count($benevolentTypes) > 0) { - $tempTypes = $types; - foreach ($tempTypes as $i => $type) { - if (!isset($benevolentTypes[$type->describe(VerbosityLevel::value())])) { - break; - } - - unset($tempTypes[$i]); - } - - if (count($tempTypes) === 0) { - return new BenevolentUnionType($types); - } - } - - return new UnionType($types); - } - - private static function unionWithSubtractedType( - Type $type, - ?Type $subtractedType - ): Type - { - if ($subtractedType === null) { - return $type; - } - - if ($type instanceof SubtractableType) { - if ($type->getSubtractedType() === null) { - return $type; - } - - $subtractedType = self::union( - $type->getSubtractedType(), - $subtractedType - ); - if ($subtractedType instanceof NeverType) { - $subtractedType = null; - } - - return $type->changeSubtractedType($subtractedType); - } - - if ($subtractedType->isSuperTypeOf($type)->yes()) { - return new NeverType(); - } - - return $type; - } - - private static function intersectWithSubtractedType( - SubtractableType $subtractableType, - ?Type $subtractedType - ): Type - { - if ($subtractableType->getSubtractedType() === null) { - return $subtractableType; - } - - if ($subtractedType === null) { - return $subtractableType->getTypeWithoutSubtractedType(); - } - - $subtractedType = self::intersect( - $subtractableType->getSubtractedType(), - $subtractedType - ); - if ($subtractedType instanceof NeverType) { - $subtractedType = null; - } - - return $subtractableType->changeSubtractedType($subtractedType); - } - - /** - * @param ArrayType[] $arrayTypes - * @param Type[] $accessoryTypes - * @return Type[] - */ - private static function processArrayTypes(array $arrayTypes, array $accessoryTypes): array - { - foreach ($arrayTypes as $arrayType) { - if (!$arrayType instanceof ConstantArrayType) { - continue; - } - if (count($arrayType->getKeyTypes()) > 0) { - continue; - } - - foreach ($accessoryTypes as $i => $accessoryType) { - if (!$accessoryType instanceof NonEmptyArrayType) { - continue; - } - - unset($accessoryTypes[$i]); - break 2; - } - } - if (count($arrayTypes) === 0) { - return []; - } elseif (count($arrayTypes) === 1) { - return [ - self::intersect($arrayTypes[0], ...$accessoryTypes), - ]; - } - - $keyTypesForGeneralArray = []; - $valueTypesForGeneralArray = []; - $generalArrayOcurred = false; - $constantKeyTypesNumbered = []; - - /** @var int|float $nextConstantKeyTypeIndex */ - $nextConstantKeyTypeIndex = 1; - - foreach ($arrayTypes as $arrayType) { - if (!$arrayType instanceof ConstantArrayType || $generalArrayOcurred) { - $keyTypesForGeneralArray[] = $arrayType->getKeyType(); - $valueTypesForGeneralArray[] = $arrayType->getItemType(); - $generalArrayOcurred = true; - continue; - } - - foreach ($arrayType->getKeyTypes() as $i => $keyType) { - $keyTypesForGeneralArray[] = $keyType; - $valueTypesForGeneralArray[] = $arrayType->getValueTypes()[$i]; - - $keyTypeValue = $keyType->getValue(); - if (array_key_exists($keyTypeValue, $constantKeyTypesNumbered)) { - continue; - } - - $constantKeyTypesNumbered[$keyTypeValue] = $nextConstantKeyTypeIndex; - $nextConstantKeyTypeIndex *= 2; - if (!is_int($nextConstantKeyTypeIndex)) { - $generalArrayOcurred = true; - continue; - } - } - } - - $createGeneralArray = static function () use ($keyTypesForGeneralArray, $valueTypesForGeneralArray, $accessoryTypes): Type { - return TypeCombinator::intersect(new ArrayType( - self::union(...$keyTypesForGeneralArray), - self::union(...$valueTypesForGeneralArray) - ), ...$accessoryTypes); - }; - - if ($generalArrayOcurred) { - return [ - $createGeneralArray(), - ]; - } - - /** @var ConstantArrayType[] $arrayTypes */ - $arrayTypes = $arrayTypes; - - /** @var int[] $constantKeyTypesNumbered */ - $constantKeyTypesNumbered = $constantKeyTypesNumbered; - - $constantArraysBuckets = []; - foreach ($arrayTypes as $arrayTypeAgain) { - $arrayIndex = 0; - foreach ($arrayTypeAgain->getKeyTypes() as $keyType) { - $arrayIndex += $constantKeyTypesNumbered[$keyType->getValue()]; - } - - if (!array_key_exists($arrayIndex, $constantArraysBuckets)) { - $bucket = []; - foreach ($arrayTypeAgain->getKeyTypes() as $i => $keyType) { - $bucket[$keyType->getValue()] = [ - 'keyType' => $keyType, - 'valueType' => $arrayTypeAgain->getValueTypes()[$i], - ]; - } - $constantArraysBuckets[$arrayIndex] = $bucket; - continue; - } - - $bucket = $constantArraysBuckets[$arrayIndex]; - foreach ($arrayTypeAgain->getKeyTypes() as $i => $keyType) { - $bucket[$keyType->getValue()]['valueType'] = self::union( - $bucket[$keyType->getValue()]['valueType'], - $arrayTypeAgain->getValueTypes()[$i] - ); - } - - $constantArraysBuckets[$arrayIndex] = $bucket; - } - - if (count($constantArraysBuckets) > self::CONSTANT_ARRAY_UNION_THRESHOLD) { - return [ - $createGeneralArray(), - ]; - } - - $resultArrays = []; - foreach ($constantArraysBuckets as $bucket) { - $builder = ConstantArrayTypeBuilder::createEmpty(); - foreach ($bucket as $data) { - $builder->setOffsetValueType($data['keyType'], $data['valueType']); - } - - $resultArrays[] = self::intersect($builder->getArray(), ...$accessoryTypes); - } - - return $resultArrays; - } - - public static function intersect(Type ...$types): Type - { - // transform A & (B | C) to (A & B) | (A & C) - foreach ($types as $i => $type) { - if ($type instanceof UnionType) { - $topLevelUnionSubTypes = []; - foreach ($type->getTypes() as $innerUnionSubType) { - $topLevelUnionSubTypes[] = self::intersect( - $innerUnionSubType, - ...array_slice($types, 0, $i), - ...array_slice($types, $i + 1) - ); - } - - return self::union(...$topLevelUnionSubTypes); - } - } - - // transform A & (B & C) to A & B & C - foreach ($types as $i => &$type) { - if (!($type instanceof IntersectionType)) { - continue; - } - - array_splice($types, $i, 1, $type->getTypes()); - } - - // transform IntegerType & ConstantIntegerType to ConstantIntegerType - // transform Child & Parent to Child - // transform Object & ~null to Object - // transform A & A to A - // transform int[] & string to never - // transform callable & int to never - // transform A & ~A to never - // transform int & string to never - for ($i = 0; $i < count($types); $i++) { - for ($j = $i + 1; $j < count($types); $j++) { - if (self::$enableSubtractableTypes) { - if ($types[$j] instanceof SubtractableType) { - $isSuperTypeSubtractableA = $types[$j]->getTypeWithoutSubtractedType()->isSuperTypeOf($types[$i]); - if ($isSuperTypeSubtractableA->yes()) { - $types[$i] = self::unionWithSubtractedType($types[$i], $types[$j]->getSubtractedType()); - array_splice($types, $j--, 1); - continue 1; - } - } - - if ($types[$i] instanceof SubtractableType) { - $isSuperTypeSubtractableB = $types[$i]->getTypeWithoutSubtractedType()->isSuperTypeOf($types[$j]); - if ($isSuperTypeSubtractableB->yes()) { - $types[$j] = self::unionWithSubtractedType($types[$j], $types[$i]->getSubtractedType()); - array_splice($types, $i--, 1); - continue 2; - } - } - } - $isSuperTypeA = $types[$j]->isSuperTypeOf($types[$i]); - if ($isSuperTypeA->no()) { - return new NeverType(); - - } elseif ($isSuperTypeA->yes()) { - array_splice($types, $j--, 1); - continue; - } - - $isSuperTypeB = $types[$i]->isSuperTypeOf($types[$j]); - if ($isSuperTypeB->maybe()) { - continue; - } - - if ($isSuperTypeB->yes()) { - array_splice($types, $i--, 1); - continue 2; - } - } - } - - if (count($types) === 1) { - return $types[0]; - - } - - return new IntersectionType($types); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/TypeTraverser.php b/vendor/phpstan/phpstan/src/Type/TypeTraverser.php deleted file mode 100644 index 994d27e..0000000 --- a/vendor/phpstan/phpstan/src/Type/TypeTraverser.php +++ /dev/null @@ -1,47 +0,0 @@ -getValue()); - * } - * // Replaces the current type, and don't traverse - * return new MixedType(); - * }); - * - * @param callable(Type $type, callable(Type): Type $traverse): Type $cb - */ - public static function map(Type $type, callable $cb): Type - { - $map = static function (Type $type) use ($cb, &$map): Type { - static $traverse = null; - if ($traverse === null) { - $traverse = static function (Type $type) use ($map): Type { - return $type->traverse($map); - }; - } - return $cb($type, $traverse); - }; - - return $map($type); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/TypeUtils.php b/vendor/phpstan/phpstan/src/Type/TypeUtils.php deleted file mode 100644 index 9c8ba8b..0000000 --- a/vendor/phpstan/phpstan/src/Type/TypeUtils.php +++ /dev/null @@ -1,262 +0,0 @@ -generalize(); - } elseif ($type instanceof UnionType) { - return TypeCombinator::union(...array_map(static function (Type $innerType): Type { - return self::generalizeType($innerType); - }, $type->getTypes())); - } - - return $type; - } - - /** - * @param Type $type - * @return string[] - */ - public static function getDirectClassNames(Type $type): array - { - if ($type instanceof TypeWithClassName) { - return [$type->getClassName()]; - } - - if ($type instanceof UnionType || $type instanceof IntersectionType) { - $classNames = []; - foreach ($type->getTypes() as $innerType) { - if (!$innerType instanceof TypeWithClassName) { - continue; - } - - $classNames[] = $innerType->getClassName(); - } - - return $classNames; - } - - return []; - } - - /** - * @param Type $type - * @return \PHPStan\Type\ConstantScalarType[] - */ - public static function getConstantScalars(Type $type): array - { - return self::map(ConstantScalarType::class, $type, false); - } - - /** - * @param string $typeClass - * @param Type $type - * @param bool $inspectIntersections - * @param bool $stopOnUnmatched - * @return mixed[] - */ - private static function map( - string $typeClass, - Type $type, - bool $inspectIntersections, - bool $stopOnUnmatched = true - ): array - { - if ($type instanceof $typeClass) { - return [$type]; - } - - if ($type instanceof UnionType) { - $matchingTypes = []; - foreach ($type->getTypes() as $innerType) { - if (!$innerType instanceof $typeClass) { - if ($stopOnUnmatched) { - return []; - } - - continue; - } - - $matchingTypes[] = $innerType; - } - - return $matchingTypes; - } - - if ($inspectIntersections && $type instanceof IntersectionType) { - $matchingTypes = []; - foreach ($type->getTypes() as $innerType) { - if (!$innerType instanceof $typeClass) { - if ($stopOnUnmatched) { - return []; - } - - continue; - } - - $matchingTypes[] = $innerType; - } - - return $matchingTypes; - } - - return []; - } - - public static function toBenevolentUnion(Type $type): Type - { - if ($type instanceof BenevolentUnionType) { - return $type; - } - - if ($type instanceof UnionType) { - return new BenevolentUnionType($type->getTypes()); - } - - return $type; - } - - /** - * @param Type $type - * @return Type[] - */ - public static function flattenTypes(Type $type): array - { - if ($type instanceof UnionType) { - return $type->getTypes(); - } - - return [$type]; - } - - public static function findThisType(Type $type): ?ThisType - { - if ($type instanceof ThisType) { - return $type; - } - - if ($type instanceof UnionType || $type instanceof IntersectionType) { - foreach ($type->getTypes() as $innerType) { - $thisType = self::findThisType($innerType); - if ($thisType !== null) { - return $thisType; - } - } - } - - return null; - } - - /** - * @param Type $type - * @return HasPropertyType[] - */ - public static function getHasPropertyTypes(Type $type): array - { - if ($type instanceof HasPropertyType) { - return [$type]; - } - - if ($type instanceof UnionType || $type instanceof IntersectionType) { - $hasPropertyTypes = [[]]; - foreach ($type->getTypes() as $innerType) { - $hasPropertyTypes[] = self::getHasPropertyTypes($innerType); - } - - return array_merge(...$hasPropertyTypes); - } - - return []; - } - - /** - * @param \PHPStan\Type\Type $type - * @return \PHPStan\Type\Accessory\AccessoryType[] - */ - public static function getAccessoryTypes(Type $type): array - { - return self::map(AccessoryType::class, $type, true, false); - } - - public static function containsCallable(Type $type): bool - { - if ($type->isCallable()->yes()) { - return true; - } - - if ($type instanceof UnionType) { - foreach ($type->getTypes() as $innerType) { - if ($innerType->isCallable()->yes()) { - return true; - } - } - } - - return false; - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/TypeWithClassName.php b/vendor/phpstan/phpstan/src/Type/TypeWithClassName.php deleted file mode 100644 index be37ae6..0000000 --- a/vendor/phpstan/phpstan/src/Type/TypeWithClassName.php +++ /dev/null @@ -1,10 +0,0 @@ -hasClass($selfClass)) { - $classReflection = $broker->getClass($selfClass); - if ($classReflection->getParentClass() !== false) { - return new ObjectType($classReflection->getParentClass()->getName()); - } - } - return new NonexistentParentClassType(); - default: - return new ObjectType($typeString); - } - } - - public static function decideTypeFromReflection( - ?\ReflectionType $reflectionType, - ?Type $phpDocType = null, - ?string $selfClass = null, - bool $isVariadic = false - ): Type - { - if ($reflectionType === null) { - return $phpDocType ?? new MixedType(); - } - - if (!$reflectionType instanceof ReflectionNamedType) { - throw new \PHPStan\ShouldNotHappenException(sprintf('Unexpected type: %s', get_class($reflectionType))); - } - - $reflectionTypeString = $reflectionType->getName(); - if (\Nette\Utils\Strings::endsWith(strtolower($reflectionTypeString), '\\object')) { - $reflectionTypeString = 'object'; - } - $type = self::getTypeObjectFromTypehint($reflectionTypeString, $selfClass); - if ($reflectionType->allowsNull()) { - $type = TypeCombinator::addNull($type); - } - - if ($isVariadic) { - $type = new ArrayType(new IntegerType(), $type); - } - - return self::decideType($type, $phpDocType); - } - - public static function decideType( - Type $type, - ?Type $phpDocType = null - ): Type - { - if ($phpDocType !== null && !$phpDocType instanceof ErrorType) { - if ($type instanceof VoidType || $phpDocType instanceof VoidType) { - return new VoidType(); - } - - if (TypeCombinator::removeNull($type) instanceof IterableType) { - if ($phpDocType instanceof UnionType) { - $innerTypes = []; - foreach ($phpDocType->getTypes() as $innerType) { - if ($innerType instanceof ArrayType) { - $innerTypes[] = new IterableType( - $innerType->getKeyType(), - $innerType->getItemType() - ); - } else { - $innerTypes[] = $innerType; - } - } - $phpDocType = new UnionType($innerTypes); - } elseif ($phpDocType instanceof ArrayType) { - $phpDocType = new IterableType( - $phpDocType->getKeyType(), - $phpDocType->getItemType() - ); - } - } - - $resultType = $type->isSuperTypeOf($phpDocType)->yes() ? $phpDocType : $type; - if (TypeCombinator::containsNull($type)) { - $type = TypeCombinator::addNull($resultType); - } else { - $type = $resultType; - } - } - - return $type; - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/UnionType.php b/vendor/phpstan/phpstan/src/Type/UnionType.php deleted file mode 100644 index b2ac4e7..0000000 --- a/vendor/phpstan/phpstan/src/Type/UnionType.php +++ /dev/null @@ -1,622 +0,0 @@ -describe(VerbosityLevel::value()); - }, $types)) - )); - }; - if (count($types) < 2) { - $throwException(); - } - foreach ($types as $type) { - if (!($type instanceof UnionType)) { - continue; - } - - $throwException(); - } - $this->types = UnionTypeHelper::sortTypes($types); - } - - /** - * @return \PHPStan\Type\Type[] - */ - public function getTypes(): array - { - return $this->types; - } - - /** - * @return string[] - */ - public function getReferencedClasses(): array - { - return UnionTypeHelper::getReferencedClasses($this->getTypes()); - } - - public function accepts(Type $type, bool $strictTypes): TrinaryLogic - { - if ($type instanceof CompoundType && !$type instanceof CallableType) { - return CompoundTypeHelper::accepts($type, $this, $strictTypes); - } - - $results = []; - foreach ($this->getTypes() as $innerType) { - $results[] = $innerType->accepts($type, $strictTypes); - } - - return TrinaryLogic::createNo()->or(...$results); - } - - public function isSuperTypeOf(Type $otherType): TrinaryLogic - { - if ($otherType instanceof self || $otherType instanceof IterableType) { - return $otherType->isSubTypeOf($this); - } - - $results = []; - foreach ($this->getTypes() as $innerType) { - $results[] = $innerType->isSuperTypeOf($otherType); - } - - return TrinaryLogic::createNo()->or(...$results); - } - - public function isSubTypeOf(Type $otherType): TrinaryLogic - { - $results = []; - foreach ($this->getTypes() as $innerType) { - $results[] = $otherType->isSuperTypeOf($innerType); - } - - return TrinaryLogic::extremeIdentity(...$results); - } - - public function isAcceptedBy(Type $acceptingType, bool $strictTypes): TrinaryLogic - { - $results = []; - foreach ($this->getTypes() as $innerType) { - $results[] = $acceptingType->accepts($innerType, $strictTypes); - } - - return TrinaryLogic::extremeIdentity(...$results); - } - - public function equals(Type $type): bool - { - if (!$type instanceof static) { - return false; - } - - if (count($this->types) !== count($type->types)) { - return false; - } - - foreach ($this->types as $i => $innerType) { - if (!$innerType->equals($type->types[$i])) { - return false; - } - } - - return true; - } - - public function describe(VerbosityLevel $level): string - { - $joinTypes = static function (array $types) use ($level): string { - $typeNames = []; - foreach ($types as $type) { - if ($type instanceof IntersectionType || $type instanceof ClosureType || $type instanceof CallableType) { - $typeNames[] = sprintf('(%s)', $type->describe($level)); - } else { - $typeNames[] = $type->describe($level); - } - } - - return implode('|', $typeNames); - }; - - return $level->handle( - function () use ($joinTypes): string { - $types = TypeCombinator::union(...array_map(static function (Type $type): Type { - if ( - $type instanceof ConstantType - && !$type instanceof ConstantBooleanType - ) { - return $type->generalize(); - } - - return $type; - }, $this->types)); - - if ($types instanceof UnionType) { - return $joinTypes($types->getTypes()); - } - - return $joinTypes([$types]); - }, - function () use ($joinTypes): string { - $arrayDescription = []; - $constantArrays = []; - $commonTypes = []; - - foreach ($this->types as $type) { - if (!$type instanceof ConstantArrayType) { - $commonTypes[] = $type; - continue; - } - - $constantArrays[] = $type; - foreach ($type->getKeyTypes() as $i => $keyType) { - if (!isset($arrayDescription[$keyType->getValue()])) { - $arrayDescription[$keyType->getValue()] = [ - 'key' => $keyType, - 'value' => $type->getValueTypes()[$i], - 'count' => 1, - ]; - continue; - } - - $arrayDescription[$keyType->getValue()] = [ - 'key' => $keyType, - 'value' => TypeCombinator::union( - $arrayDescription[$keyType->getValue()]['value'], - $type->getValueTypes()[$i] - ), - 'count' => $arrayDescription[$keyType->getValue()]['count'] + 1, - ]; - } - } - - $someKeyCountIsHigherThanOne = false; - foreach ($arrayDescription as $value) { - if ($value['count'] > 1) { - $someKeyCountIsHigherThanOne = true; - break; - } - } - - if (!$someKeyCountIsHigherThanOne) { - return $joinTypes(UnionTypeHelper::sortTypes(array_merge( - $commonTypes, - $constantArrays - ))); - } - - $constantArraysCount = count($constantArrays); - $constantArraysDescriptions = []; - foreach ($arrayDescription as $value) { - $constantArraysDescriptions[] = sprintf( - '%s%s => %s', - $value['count'] < $constantArraysCount ? '?' : '', - $value['key']->describe(VerbosityLevel::value()), - $value['value']->describe(VerbosityLevel::value()) - ); - } - - $description = ''; - if (count($commonTypes) > 0) { - $description = $joinTypes($commonTypes); - if (count($constantArraysDescriptions) > 0) { - $description .= '|'; - } - } - - if (count($constantArraysDescriptions) > 0) { - $description .= 'array(' . implode(', ', $constantArraysDescriptions) . ')'; - } - - return $description; - } - ); - } - - /** - * @param callable(Type $type): TrinaryLogic $canCallback - * @param callable(Type $type): TrinaryLogic $hasCallback - * @return TrinaryLogic - */ - private function hasInternal( - callable $canCallback, - callable $hasCallback - ): TrinaryLogic - { - $results = []; - foreach ($this->types as $type) { - if ($canCallback($type)->no()) { - $results[] = TrinaryLogic::createNo(); - continue; - } - $results[] = $hasCallback($type); - } - - return TrinaryLogic::extremeIdentity(...$results); - } - - /** - * @param callable(Type $type): TrinaryLogic $hasCallback - * @param callable(Type $type): object $getCallback - * @return object - */ - private function getInternal( - callable $hasCallback, - callable $getCallback - ) - { - /** @var TrinaryLogic|null $result */ - $result = null; - - /** @var object|null $object */ - $object = null; - foreach ($this->types as $type) { - $has = $hasCallback($type); - if (!$has->yes()) { - continue; - } - if ($result !== null && $result->compareTo($has) !== $has) { - continue; - } - - $get = $getCallback($type); - $result = $has; - $object = $get; - } - - if ($object === null) { - throw new \PHPStan\ShouldNotHappenException(); - } - - return $object; - } - - public function canAccessProperties(): TrinaryLogic - { - return $this->unionResults(static function (Type $type): TrinaryLogic { - return $type->canAccessProperties(); - }); - } - - public function hasProperty(string $propertyName): TrinaryLogic - { - return $this->unionResults(static function (Type $type) use ($propertyName): TrinaryLogic { - return $type->hasProperty($propertyName); - }); - } - - public function getProperty(string $propertyName, ClassMemberAccessAnswerer $scope): PropertyReflection - { - return $this->getInternal( - static function (Type $type) use ($propertyName): TrinaryLogic { - return $type->hasProperty($propertyName); - }, - static function (Type $type) use ($propertyName, $scope): PropertyReflection { - return $type->getProperty($propertyName, $scope); - } - ); - } - - public function canCallMethods(): TrinaryLogic - { - return $this->unionResults(static function (Type $type): TrinaryLogic { - return $type->canCallMethods(); - }); - } - - public function hasMethod(string $methodName): TrinaryLogic - { - return $this->unionResults(static function (Type $type) use ($methodName): TrinaryLogic { - return $type->hasMethod($methodName); - }); - } - - public function getMethod(string $methodName, ClassMemberAccessAnswerer $scope): MethodReflection - { - return $this->getInternal( - static function (Type $type) use ($methodName): TrinaryLogic { - return $type->hasMethod($methodName); - }, - static function (Type $type) use ($methodName, $scope): MethodReflection { - return $type->getMethod($methodName, $scope); - } - ); - } - - public function canAccessConstants(): TrinaryLogic - { - return $this->unionResults(static function (Type $type): TrinaryLogic { - return $type->canAccessConstants(); - }); - } - - public function hasConstant(string $constantName): TrinaryLogic - { - return $this->hasInternal( - static function (Type $type): TrinaryLogic { - return $type->canAccessConstants(); - }, - static function (Type $type) use ($constantName): TrinaryLogic { - return $type->hasConstant($constantName); - } - ); - } - - public function getConstant(string $constantName): ConstantReflection - { - return $this->getInternal( - static function (Type $type) use ($constantName): TrinaryLogic { - return $type->hasConstant($constantName); - }, - static function (Type $type) use ($constantName): ConstantReflection { - return $type->getConstant($constantName); - } - ); - } - - public function resolveStatic(string $className): Type - { - return new self(UnionTypeHelper::resolveStatic($className, $this->getTypes())); - } - - public function changeBaseClass(string $className): StaticResolvableType - { - return new self(UnionTypeHelper::changeBaseClass($className, $this->getTypes())); - } - - public function isIterable(): TrinaryLogic - { - return $this->unionResults(static function (Type $type): TrinaryLogic { - return $type->isIterable(); - }); - } - - public function isIterableAtLeastOnce(): TrinaryLogic - { - return $this->unionResults(static function (Type $type): TrinaryLogic { - return $type->isIterableAtLeastOnce(); - }); - } - - public function getIterableKeyType(): Type - { - return $this->unionTypes(static function (Type $type): Type { - return $type->getIterableKeyType(); - }); - } - - public function getIterableValueType(): Type - { - return $this->unionTypes(static function (Type $type): Type { - return $type->getIterableValueType(); - }); - } - - public function isArray(): TrinaryLogic - { - return $this->unionResults(static function (Type $type): TrinaryLogic { - return $type->isArray(); - }); - } - - public function isOffsetAccessible(): TrinaryLogic - { - return $this->unionResults(static function (Type $type): TrinaryLogic { - return $type->isOffsetAccessible(); - }); - } - - public function hasOffsetValueType(Type $offsetType): TrinaryLogic - { - return $this->unionResults(static function (Type $type) use ($offsetType): TrinaryLogic { - return $type->hasOffsetValueType($offsetType); - }); - } - - public function getOffsetValueType(Type $offsetType): Type - { - $types = []; - foreach ($this->types as $innerType) { - $valueType = $innerType->getOffsetValueType($offsetType); - if ($valueType instanceof ErrorType) { - continue; - } - - $types[] = $valueType; - } - - if (count($types) === 0) { - return new ErrorType(); - } - - return TypeCombinator::union(...$types); - } - - public function setOffsetValueType(?Type $offsetType, Type $valueType): Type - { - return $this->unionTypes(static function (Type $type) use ($offsetType, $valueType): Type { - return $type->setOffsetValueType($offsetType, $valueType); - }); - } - - public function isCallable(): TrinaryLogic - { - return $this->unionResults(static function (Type $type): TrinaryLogic { - return $type->isCallable(); - }); - } - - /** - * @param \PHPStan\Reflection\ClassMemberAccessAnswerer $scope - * @return \PHPStan\Reflection\ParametersAcceptor[] - */ - public function getCallableParametersAcceptors(ClassMemberAccessAnswerer $scope): array - { - foreach ($this->types as $type) { - if ($type->isCallable()->no()) { - continue; - } - - return $type->getCallableParametersAcceptors($scope); - } - - throw new \PHPStan\ShouldNotHappenException(); - } - - public function isCloneable(): TrinaryLogic - { - return $this->unionResults(static function (Type $type): TrinaryLogic { - return $type->isCloneable(); - }); - } - - public function toBoolean(): BooleanType - { - /** @var BooleanType $type */ - $type = $this->unionTypes(static function (Type $type): BooleanType { - return $type->toBoolean(); - }); - - return $type; - } - - public function toNumber(): Type - { - $type = $this->unionTypes(static function (Type $type): Type { - return $type->toNumber(); - }); - - return $type; - } - - public function toString(): Type - { - $type = $this->unionTypes(static function (Type $type): Type { - return $type->toString(); - }); - - return $type; - } - - public function toInteger(): Type - { - $type = $this->unionTypes(static function (Type $type): Type { - return $type->toInteger(); - }); - - return $type; - } - - public function toFloat(): Type - { - $type = $this->unionTypes(static function (Type $type): Type { - return $type->toFloat(); - }); - - return $type; - } - - public function toArray(): Type - { - $type = $this->unionTypes(static function (Type $type): Type { - return $type->toArray(); - }); - - return $type; - } - - public function inferTemplateTypes(Type $receivedType): TemplateTypeMap - { - $types = TemplateTypeMap::empty(); - - foreach ($this->types as $type) { - $receive = $type->isSuperTypeOf($receivedType)->yes() ? $receivedType : new NeverType(); - $types = $types->union($type->inferTemplateTypes($receive)); - } - - return $types; - } - - public function inferTemplateTypesOn(Type $templateType): TemplateTypeMap - { - $types = TemplateTypeMap::empty(); - - foreach ($this->types as $type) { - $types = $types->union($templateType->inferTemplateTypes($type)); - } - - return $types; - } - - public function traverse(callable $cb): Type - { - $types = []; - $changed = false; - - foreach ($this->types as $type) { - $newType = $cb($type); - if ($type !== $newType) { - $changed = true; - } - $types[] = $newType; - } - - if ($changed) { - return TypeCombinator::union(...$types); - } - - return $this; - } - - /** - * @param mixed[] $properties - * @return Type - */ - public static function __set_state(array $properties): Type - { - return new self($properties['types']); - } - - /** - * @param callable(Type $type): TrinaryLogic $getResult - * @return TrinaryLogic - */ - private function unionResults(callable $getResult): TrinaryLogic - { - return TrinaryLogic::extremeIdentity(...array_map($getResult, $this->types)); - } - - /** - * @param callable(Type $type): Type $getType - * @return Type - */ - protected function unionTypes(callable $getType): Type - { - return TypeCombinator::union(...array_map($getType, $this->types)); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/UnionTypeHelper.php b/vendor/phpstan/phpstan/src/Type/UnionTypeHelper.php deleted file mode 100644 index f03a1ff..0000000 --- a/vendor/phpstan/phpstan/src/Type/UnionTypeHelper.php +++ /dev/null @@ -1,123 +0,0 @@ - $type) { - if (!($type instanceof StaticResolvableType)) { - continue; - } - - $types[$i] = $type->resolveStatic($className); - } - - return $types; - } - - /** - * @param string $className - * @param \PHPStan\Type\Type[] $types - * @return \PHPStan\Type\Type[] - */ - public static function changeBaseClass(string $className, array $types): array - { - foreach ($types as $i => $type) { - if (!($type instanceof StaticResolvableType)) { - continue; - } - - $types[$i] = $type->changeBaseClass($className); - } - - return $types; - } - - /** - * @param \PHPStan\Type\Type[] $types - * @return string[] - */ - public static function getReferencedClasses(array $types): array - { - $subTypeClasses = []; - foreach ($types as $type) { - $subTypeClasses[] = $type->getReferencedClasses(); - } - - return array_merge(...$subTypeClasses); - } - - /** - * @param \PHPStan\Type\Type[] $types - * @return \PHPStan\Type\Type[] - */ - public static function sortTypes(array $types): array - { - usort($types, static function (Type $a, Type $b): int { - if ($a instanceof NullType) { - return 1; - } elseif ($b instanceof NullType) { - return -1; - } - - if ($a instanceof AccessoryType) { - if ($b instanceof AccessoryType) { - return strcasecmp($a->describe(VerbosityLevel::value()), $b->describe(VerbosityLevel::value())); - } - - return 1; - } - if ($b instanceof AccessoryType) { - return -1; - } - - $aIsBool = $a instanceof ConstantBooleanType; - $bIsBool = $b instanceof ConstantBooleanType; - if ($aIsBool && !$bIsBool) { - return 1; - } elseif ($bIsBool && !$aIsBool) { - return -1; - } - if ($a instanceof ConstantScalarType && !$b instanceof ConstantScalarType) { - return -1; - } elseif (!$a instanceof ConstantScalarType && $b instanceof ConstantScalarType) { - return 1; - } - - if ( - ( - $a instanceof ConstantIntegerType - || $a instanceof ConstantFloatType - ) - && ( - $b instanceof ConstantIntegerType - || $b instanceof ConstantFloatType - ) - ) { - return (int) ($a->getValue() - $b->getValue()); - } - - if ($a instanceof ConstantStringType && $b instanceof ConstantStringType) { - return strcasecmp($a->getValue(), $b->getValue()); - } - - return strcasecmp($a->describe(VerbosityLevel::typeOnly()), $b->describe(VerbosityLevel::typeOnly())); - }); - return $types; - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/VerbosityLevel.php b/vendor/phpstan/phpstan/src/Type/VerbosityLevel.php deleted file mode 100644 index 467d050..0000000 --- a/vendor/phpstan/phpstan/src/Type/VerbosityLevel.php +++ /dev/null @@ -1,67 +0,0 @@ -value = $value; - } - - private static function create(int $value): self - { - self::$registry[$value] = self::$registry[$value] ?? new self($value); - return self::$registry[$value]; - } - - public static function typeOnly(): self - { - return self::create(self::TYPE_ONLY); - } - - public static function value(): self - { - return self::create(self::VALUE); - } - - public static function precise(): self - { - return self::create(self::PRECISE); - } - - /** - * @param callable(): string $typeOnlyCallback - * @param callable(): string $valueCallback - * @param callable(): string|null $preciseCallback - * @return string - */ - public function handle( - callable $typeOnlyCallback, - callable $valueCallback, - ?callable $preciseCallback = null - ): string - { - if ($this->value === self::TYPE_ONLY) { - return $typeOnlyCallback(); - } - - if ($this->value === self::VALUE || $preciseCallback === null) { - return $valueCallback(); - } - - return $preciseCallback(); - } - -} diff --git a/vendor/phpstan/phpstan/src/Type/VoidType.php b/vendor/phpstan/phpstan/src/Type/VoidType.php deleted file mode 100644 index 6224878..0000000 --- a/vendor/phpstan/phpstan/src/Type/VoidType.php +++ /dev/null @@ -1,103 +0,0 @@ -isSubTypeOf($this); - } - - return TrinaryLogic::createNo(); - } - - public function equals(Type $type): bool - { - return $type instanceof self; - } - - public function describe(VerbosityLevel $level): string - { - return 'void'; - } - - public function toNumber(): Type - { - return new ErrorType(); - } - - public function toString(): Type - { - return new ErrorType(); - } - - public function toInteger(): Type - { - return new ErrorType(); - } - - public function toFloat(): Type - { - return new ErrorType(); - } - - public function toArray(): Type - { - return new ErrorType(); - } - - public function isArray(): TrinaryLogic - { - return TrinaryLogic::createNo(); - } - - public function traverse(callable $cb): Type - { - return $this; - } - - /** - * @param mixed[] $properties - * @return Type - */ - public static function __set_state(array $properties): Type - { - return new self(); - } - -} diff --git a/vendor/phpstan/phpstan/tmp/.gitignore b/vendor/phpstan/phpstan/tmp/.gitignore deleted file mode 100644 index 1945e31..0000000 --- a/vendor/phpstan/phpstan/tmp/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -* -!/cache -!/generated -!.* diff --git a/vendor/phpstan/phpstan/tmp/cache/.gitignore b/vendor/phpstan/phpstan/tmp/cache/.gitignore deleted file mode 100644 index 125e342..0000000 --- a/vendor/phpstan/phpstan/tmp/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.* diff --git a/vendor/phpstan/phpstan/tmp/generated/.gitignore b/vendor/phpstan/phpstan/tmp/generated/.gitignore deleted file mode 100644 index 125e342..0000000 --- a/vendor/phpstan/phpstan/tmp/generated/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.* diff --git a/vendor/phpunit/php-code-coverage/.gitattributes b/vendor/phpunit/php-code-coverage/.gitattributes deleted file mode 100644 index 34d242b..0000000 --- a/vendor/phpunit/php-code-coverage/.gitattributes +++ /dev/null @@ -1,3 +0,0 @@ -/tools export-ignore - -*.php diff=php diff --git a/vendor/phpunit/php-code-coverage/.github/CONTRIBUTING.md b/vendor/phpunit/php-code-coverage/.github/CONTRIBUTING.md deleted file mode 100644 index 3339250..0000000 --- a/vendor/phpunit/php-code-coverage/.github/CONTRIBUTING.md +++ /dev/null @@ -1 +0,0 @@ -Please refer to [https://github.com/sebastianbergmann/phpunit/blob/master/CONTRIBUTING.md](https://github.com/sebastianbergmann/phpunit/blob/master/.github/CONTRIBUTING.md) for details on how to contribute to this project. diff --git a/vendor/phpunit/php-code-coverage/.github/FUNDING.yml b/vendor/phpunit/php-code-coverage/.github/FUNDING.yml deleted file mode 100644 index c2fba0f..0000000 --- a/vendor/phpunit/php-code-coverage/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -github: sebastianbergmann diff --git a/vendor/phpunit/php-code-coverage/.github/ISSUE_TEMPLATE.md b/vendor/phpunit/php-code-coverage/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index dc8e3b0..0000000 --- a/vendor/phpunit/php-code-coverage/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,18 +0,0 @@ -| Q | A -| --------------------------| --------------- -| php-code-coverage version | x.y.z -| PHP version | x.y.z -| Driver | Xdebug / PHPDBG -| Xdebug version (if used) | x.y.z -| Installation Method | Composer / PHPUnit PHAR -| Usage Method | PHPUnit / other -| PHPUnit version (if used) | x.y.z - - - diff --git a/vendor/phpunit/php-code-coverage/.gitignore b/vendor/phpunit/php-code-coverage/.gitignore deleted file mode 100644 index 3c77ffd..0000000 --- a/vendor/phpunit/php-code-coverage/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -/tests/_files/tmp -/vendor -/composer.lock -/.idea -/.php_cs -/.php_cs.cache -/.phpunit.result.cache diff --git a/vendor/phpunit/php-code-coverage/.php_cs.dist b/vendor/phpunit/php-code-coverage/.php_cs.dist deleted file mode 100644 index cc20644..0000000 --- a/vendor/phpunit/php-code-coverage/.php_cs.dist +++ /dev/null @@ -1,197 +0,0 @@ - - -For the full copyright and license information, please view the LICENSE -file that was distributed with this source code. -EOF; - -return PhpCsFixer\Config::create() - ->setRiskyAllowed(true) - ->setRules( - [ - 'align_multiline_comment' => true, - 'array_indentation' => true, - 'array_syntax' => ['syntax' => 'short'], - 'binary_operator_spaces' => [ - 'operators' => [ - '=' => 'align', - '=>' => 'align', - ], - ], - 'blank_line_after_namespace' => true, - 'blank_line_before_statement' => [ - 'statements' => [ - 'break', - 'continue', - 'declare', - 'do', - 'for', - 'foreach', - 'if', - 'include', - 'include_once', - 'require', - 'require_once', - 'return', - 'switch', - 'throw', - 'try', - 'while', - 'yield', - ], - ], - 'braces' => true, - 'cast_spaces' => true, - 'class_attributes_separation' => ['elements' => ['const', 'method', 'property']], - 'combine_consecutive_issets' => true, - 'combine_consecutive_unsets' => true, - 'compact_nullable_typehint' => true, - 'concat_space' => ['spacing' => 'one'], - 'declare_equal_normalize' => ['space' => 'none'], - 'declare_strict_types' => true, - 'dir_constant' => true, - 'elseif' => true, - 'encoding' => true, - 'full_opening_tag' => true, - 'function_declaration' => true, - 'header_comment' => ['header' => $header, 'separate' => 'none'], - 'indentation_type' => true, - 'is_null' => true, - 'line_ending' => true, - 'list_syntax' => ['syntax' => 'short'], - 'logical_operators' => true, - 'lowercase_cast' => true, - 'lowercase_constants' => true, - 'lowercase_keywords' => true, - 'lowercase_static_reference' => true, - 'magic_constant_casing' => true, - 'method_argument_space' => ['ensure_fully_multiline' => true], - 'modernize_types_casting' => true, - 'multiline_comment_opening_closing' => true, - 'multiline_whitespace_before_semicolons' => true, - 'native_constant_invocation' => true, - 'native_function_casing' => true, - 'native_function_invocation' => true, - 'new_with_braces' => false, - 'no_alias_functions' => true, - 'no_alternative_syntax' => true, - 'no_blank_lines_after_class_opening' => true, - 'no_blank_lines_after_phpdoc' => true, - 'no_blank_lines_before_namespace' => true, - 'no_closing_tag' => true, - 'no_empty_comment' => true, - 'no_empty_phpdoc' => true, - 'no_empty_statement' => true, - 'no_extra_blank_lines' => true, - 'no_homoglyph_names' => true, - 'no_leading_import_slash' => true, - 'no_leading_namespace_whitespace' => true, - 'no_mixed_echo_print' => ['use' => 'print'], - 'no_multiline_whitespace_around_double_arrow' => true, - 'no_null_property_initialization' => true, - 'no_php4_constructor' => true, - 'no_short_bool_cast' => true, - 'no_short_echo_tag' => true, - 'no_singleline_whitespace_before_semicolons' => true, - 'no_spaces_after_function_name' => true, - 'no_spaces_inside_parenthesis' => true, - 'no_superfluous_elseif' => true, - 'no_superfluous_phpdoc_tags' => true, - 'no_trailing_comma_in_list_call' => true, - 'no_trailing_comma_in_singleline_array' => true, - 'no_trailing_whitespace' => true, - 'no_trailing_whitespace_in_comment' => true, - 'no_unneeded_control_parentheses' => true, - 'no_unneeded_curly_braces' => true, - 'no_unneeded_final_method' => true, - 'no_unreachable_default_argument_value' => true, - 'no_unset_on_property' => true, - 'no_unused_imports' => true, - 'no_useless_else' => true, - 'no_useless_return' => true, - 'no_whitespace_before_comma_in_array' => true, - 'no_whitespace_in_blank_line' => true, - 'non_printable_character' => true, - 'normalize_index_brace' => true, - 'object_operator_without_whitespace' => true, - 'ordered_class_elements' => [ - 'order' => [ - 'use_trait', - 'constant_public', - 'constant_protected', - 'constant_private', - 'property_public_static', - 'property_protected_static', - 'property_private_static', - 'property_public', - 'property_protected', - 'property_private', - 'method_public_static', - 'construct', - 'destruct', - 'magic', - 'phpunit', - 'method_public', - 'method_protected', - 'method_private', - 'method_protected_static', - 'method_private_static', - ], - ], - 'ordered_imports' => true, - 'phpdoc_add_missing_param_annotation' => true, - 'phpdoc_align' => true, - 'phpdoc_annotation_without_dot' => true, - 'phpdoc_indent' => true, - 'phpdoc_no_access' => true, - 'phpdoc_no_empty_return' => true, - 'phpdoc_no_package' => true, - 'phpdoc_order' => true, - 'phpdoc_return_self_reference' => true, - 'phpdoc_scalar' => true, - 'phpdoc_separation' => true, - 'phpdoc_single_line_var_spacing' => true, - 'phpdoc_to_comment' => true, - 'phpdoc_trim' => true, - 'phpdoc_trim_consecutive_blank_line_separation' => true, - 'phpdoc_types' => ['groups' => ['simple', 'meta']], - 'phpdoc_types_order' => true, - 'phpdoc_var_without_name' => true, - 'pow_to_exponentiation' => true, - 'protected_to_private' => true, - 'return_assignment' => true, - 'return_type_declaration' => ['space_before' => 'none'], - 'self_accessor' => true, - 'semicolon_after_instruction' => true, - 'set_type_to_cast' => true, - 'short_scalar_cast' => true, - 'simplified_null_return' => true, - 'single_blank_line_at_eof' => true, - 'single_import_per_statement' => true, - 'single_line_after_imports' => true, - 'single_quote' => true, - 'standardize_not_equals' => true, - 'ternary_to_null_coalescing' => true, - 'trailing_comma_in_multiline_array' => true, - 'trim_array_spaces' => true, - 'unary_operator_spaces' => true, - 'visibility_required' => [ - 'elements' => [ - 'const', - 'method', - 'property', - ], - ], - 'void_return' => true, - 'whitespace_after_comma_in_array' => true, - ] - ) - ->setFinder( - PhpCsFixer\Finder::create() - ->files() - ->in(__DIR__ . '/src') - ->in(__DIR__ . '/tests/tests') - ); diff --git a/vendor/phpunit/php-code-coverage/.travis.yml b/vendor/phpunit/php-code-coverage/.travis.yml deleted file mode 100644 index 1bf5648..0000000 --- a/vendor/phpunit/php-code-coverage/.travis.yml +++ /dev/null @@ -1,60 +0,0 @@ -language: php - -php: - - 7.2 - - 7.3 - - 7.4snapshot - -matrix: - fast_finish: true - -env: - matrix: - - DRIVER="xdebug" DEPENDENCIES="high" - - DRIVER="phpdbg" DEPENDENCIES="high" - - DRIVER="pcov" DEPENDENCIES="high" - - DRIVER="xdebug" DEPENDENCIES="low" - - DRIVER="phpdbg" DEPENDENCIES="low" - - DRIVER="pcov" DEPENDENCIES="low" - global: - - DEFAULT_COMPOSER_FLAGS="--no-interaction --no-ansi --no-progress --no-suggest" - -before_install: - - ./tools/composer clear-cache - -install: - - if [[ "$DEPENDENCIES" = 'high' ]]; then travis_retry ./tools/composer update $DEFAULT_COMPOSER_FLAGS; fi - - if [[ "$DEPENDENCIES" = 'low' ]]; then travis_retry ./tools/composer update $DEFAULT_COMPOSER_FLAGS --prefer-lowest; fi - -before_script: - - | - if [[ "$DRIVER" = 'pcov' ]]; then - echo > $HOME/.phpenv/versions/$TRAVIS_PHP_VERSION/etc/conf.d/xdebug.ini - git clone --single-branch --branch=v1.0.6 --depth=1 https://github.com/krakjoe/pcov - cd pcov - phpize - ./configure - make clean install - echo "extension=pcov.so" > $HOME/.phpenv/versions/$TRAVIS_PHP_VERSION/etc/conf.d/pcov.ini - cd $TRAVIS_BUILD_DIR - fi - -script: - - if [[ "$DRIVER" = 'phpdbg' ]]; then phpdbg -qrr vendor/bin/phpunit --coverage-clover=coverage.xml; fi - - if [[ "$DRIVER" != 'phpdbg' ]]; then vendor/bin/phpunit --coverage-clover=coverage.xml; fi - -after_success: - - bash <(curl -s https://codecov.io/bash) - -notifications: - email: false - -jobs: - include: - - stage: Static Code Analysis - php: 7.3 - env: php-cs-fixer - install: - - phpenv config-rm xdebug.ini - script: - - ./tools/php-cs-fixer fix --dry-run -v --show-progress=dots --diff-format=udiff diff --git a/vendor/phpunit/php-code-coverage/ChangeLog.md b/vendor/phpunit/php-code-coverage/ChangeLog.md deleted file mode 100644 index 2ac79e3..0000000 --- a/vendor/phpunit/php-code-coverage/ChangeLog.md +++ /dev/null @@ -1,166 +0,0 @@ -# ChangeLog - -All notable changes are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. - -## [7.0.15] - 2021-07-26 - -### Changed - -* Bumped required version of php-token-stream - -## [7.0.14] - 2020-12-02 - -### Changed - -* [#837](https://github.com/sebastianbergmann/php-code-coverage/issues/837): Allow version 4 of php-token-stream - -## [7.0.13] - 2020-11-30 - -### Changed - -* Changed PHP version constraint in `composer.json` from `^7.2` to `>=7.2` to allow installation of this version of this library on PHP 8. However, this version of this library does not work on PHP 8. PHPUnit 8.5, which uses this version of this library, does not call into this library and instead shows a message that code coverage functionality is not available for PHPUnit 8.5 on PHP 8. - -## [7.0.12] - 2020-11-27 - -### Added - -* [#834](https://github.com/sebastianbergmann/php-code-coverage/issues/834): Support `XDEBUG_MODE` environment variable - -## [7.0.11] - 2020-11-27 - -### Added - -* Support for Xdebug 3 - -## [7.0.10] - 2019-11-20 - -### Fixed - -* [#710](https://github.com/sebastianbergmann/php-code-coverage/pull/710): Code Coverage does not work in PhpStorm - -## [7.0.9] - 2019-11-20 - -### Changed - -* [#709](https://github.com/sebastianbergmann/php-code-coverage/pull/709): Prioritize PCOV over Xdebug - -## [7.0.8] - 2019-09-17 - -### Changed - -* Update HTML report Bootstrap 4.3.1, jQuery 3.4.1, and popper.js 1.15.0 - -## [7.0.7] - 2019-07-25 - -### Changed - -* Bumped required version of php-token-stream - -## [7.0.6] - 2019-07-08 - -### Changed - -* Bumped required version of php-token-stream - -## [7.0.5] - 2019-06-06 - -### Fixed - -* [#681](https://github.com/sebastianbergmann/php-code-coverage/pull/681): `use function` statements are not ignored - -## [7.0.4] - 2019-05-29 - -### Fixed - -* [#682](https://github.com/sebastianbergmann/php-code-coverage/pull/682): Code that is not executed is reported as being executed when using PCOV - -## [7.0.3] - 2019-02-26 - -### Fixed - -* [#671](https://github.com/sebastianbergmann/php-code-coverage/issues/671): `TypeError` when directory name is a number - -## [7.0.2] - 2019-02-15 - -### Changed - -* Updated HTML report to Bootstrap 4.3.0 - -### Fixed - -* [#667](https://github.com/sebastianbergmann/php-code-coverage/pull/667): `TypeError` in PHP reporter - -## [7.0.1] - 2019-02-01 - -### Fixed - -* [#664](https://github.com/sebastianbergmann/php-code-coverage/issues/664): `TypeError` when whitelisted file does not exist - -## [7.0.0] - 2019-02-01 - -### Added - -* Implemented [#663](https://github.com/sebastianbergmann/php-code-coverage/pull/663): Support for PCOV - -### Fixed - -* [#654](https://github.com/sebastianbergmann/php-code-coverage/issues/654): HTML report fails to load assets -* [#655](https://github.com/sebastianbergmann/php-code-coverage/issues/655): Popin pops in outside of screen - -### Removed - -* This component is no longer supported on PHP 7.1 - -## [6.1.4] - 2018-10-31 - -### Fixed - -* [#650](https://github.com/sebastianbergmann/php-code-coverage/issues/650): Wasted screen space in HTML code coverage report - -## [6.1.3] - 2018-10-23 - -### Changed - -* Use `^3.1` of `sebastian/environment` again due to [regression](https://github.com/sebastianbergmann/environment/issues/31) - -## [6.1.2] - 2018-10-23 - -### Fixed - -* [#645](https://github.com/sebastianbergmann/php-code-coverage/pull/645): Crash that can occur when php-token-stream parses invalid files - -## [6.1.1] - 2018-10-18 - -### Changed - -* This component now allows `^4` of `sebastian/environment` - -## [6.1.0] - 2018-10-16 - -### Changed - -* Class names are now abbreviated (unqualified name shown, fully qualified name shown on hover) in the file view of the HTML report -* Update HTML report to Bootstrap 4 - -[7.0.15]: https://github.com/sebastianbergmann/php-code-coverage/compare/7.0.14...7.0.15 -[7.0.14]: https://github.com/sebastianbergmann/php-code-coverage/compare/7.0.13...7.0.14 -[7.0.13]: https://github.com/sebastianbergmann/php-code-coverage/compare/7.0.12...7.0.13 -[7.0.12]: https://github.com/sebastianbergmann/php-code-coverage/compare/7.0.11...7.0.12 -[7.0.11]: https://github.com/sebastianbergmann/php-code-coverage/compare/7.0.10...7.0.11 -[7.0.10]: https://github.com/sebastianbergmann/php-code-coverage/compare/7.0.9...7.0.10 -[7.0.9]: https://github.com/sebastianbergmann/php-code-coverage/compare/7.0.8...7.0.9 -[7.0.8]: https://github.com/sebastianbergmann/php-code-coverage/compare/7.0.7...7.0.8 -[7.0.7]: https://github.com/sebastianbergmann/php-code-coverage/compare/7.0.6...7.0.7 -[7.0.6]: https://github.com/sebastianbergmann/php-code-coverage/compare/7.0.5...7.0.6 -[7.0.5]: https://github.com/sebastianbergmann/php-code-coverage/compare/7.0.4...7.0.5 -[7.0.4]: https://github.com/sebastianbergmann/php-code-coverage/compare/7.0.3...7.0.4 -[7.0.3]: https://github.com/sebastianbergmann/php-code-coverage/compare/7.0.2...7.0.3 -[7.0.2]: https://github.com/sebastianbergmann/php-code-coverage/compare/7.0.1...7.0.2 -[7.0.1]: https://github.com/sebastianbergmann/php-code-coverage/compare/7.0.0...7.0.1 -[7.0.0]: https://github.com/sebastianbergmann/php-code-coverage/compare/6.1.4...7.0.0 -[6.1.4]: https://github.com/sebastianbergmann/php-code-coverage/compare/6.1.3...6.1.4 -[6.1.3]: https://github.com/sebastianbergmann/php-code-coverage/compare/6.1.2...6.1.3 -[6.1.2]: https://github.com/sebastianbergmann/php-code-coverage/compare/6.1.1...6.1.2 -[6.1.1]: https://github.com/sebastianbergmann/php-code-coverage/compare/6.1.0...6.1.1 -[6.1.0]: https://github.com/sebastianbergmann/php-code-coverage/compare/6.0...6.1.0 - diff --git a/vendor/phpunit/php-code-coverage/LICENSE b/vendor/phpunit/php-code-coverage/LICENSE deleted file mode 100644 index b1a0140..0000000 --- a/vendor/phpunit/php-code-coverage/LICENSE +++ /dev/null @@ -1,33 +0,0 @@ -php-code-coverage - -Copyright (c) 2009-2019, Sebastian Bergmann . -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Sebastian Bergmann nor the names of his - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/phpunit/php-code-coverage/README.md b/vendor/phpunit/php-code-coverage/README.md deleted file mode 100644 index bd4a169..0000000 --- a/vendor/phpunit/php-code-coverage/README.md +++ /dev/null @@ -1,40 +0,0 @@ -[![Latest Stable Version](https://poser.pugx.org/phpunit/php-code-coverage/v/stable.png)](https://packagist.org/packages/phpunit/php-code-coverage) -[![Build Status](https://travis-ci.org/sebastianbergmann/php-code-coverage.svg?branch=master)](https://travis-ci.org/sebastianbergmann/php-code-coverage) - -# SebastianBergmann\CodeCoverage - -**SebastianBergmann\CodeCoverage** is a library that provides collection, processing, and rendering functionality for PHP code coverage information. - -## Installation - -You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): - - composer require phpunit/php-code-coverage - -If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: - - composer require --dev phpunit/php-code-coverage - -## Using the SebastianBergmann\CodeCoverage API - -```php -filter()->addDirectoryToWhitelist('/path/to/src'); - -$coverage->start(''); - -// ... - -$coverage->stop(); - -$writer = new \SebastianBergmann\CodeCoverage\Report\Clover; -$writer->process($coverage, '/tmp/clover.xml'); - -$writer = new \SebastianBergmann\CodeCoverage\Report\Html\Facade; -$writer->process($coverage, '/tmp/code-coverage-report'); -``` - diff --git a/vendor/phpunit/php-code-coverage/build.xml b/vendor/phpunit/php-code-coverage/build.xml deleted file mode 100644 index df8408e..0000000 --- a/vendor/phpunit/php-code-coverage/build.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/phpunit/php-code-coverage/composer.json b/vendor/phpunit/php-code-coverage/composer.json deleted file mode 100644 index ed6e813..0000000 --- a/vendor/phpunit/php-code-coverage/composer.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "phpunit/php-code-coverage", - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "type": "library", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues" - }, - "config": { - "optimize-autoloader": true, - "sort-packages": true - }, - "prefer-stable": true, - "require": { - "php": ">=7.2", - "ext-dom": "*", - "ext-xmlwriter": "*", - "phpunit/php-file-iterator": "^2.0.2", - "phpunit/php-token-stream": "^3.1.3 || ^4.0", - "phpunit/php-text-template": "^1.2.1", - "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^4.2.2", - "sebastian/version": "^2.0.1", - "theseer/tokenizer": "^1.1.3" - }, - "require-dev": { - "phpunit/phpunit": "^8.2.2" - }, - "suggest": { - "ext-xdebug": "^2.7.2" - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "autoload-dev": { - "files": [ - "tests/TestCase.php", - "tests/_files/BankAccountTest.php" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "7.0-dev" - } - } -} diff --git a/vendor/phpunit/php-code-coverage/phive.xml b/vendor/phpunit/php-code-coverage/phive.xml deleted file mode 100644 index 3ec79ee..0000000 --- a/vendor/phpunit/php-code-coverage/phive.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/vendor/phpunit/php-code-coverage/phpunit.xml b/vendor/phpunit/php-code-coverage/phpunit.xml deleted file mode 100644 index 37e2219..0000000 --- a/vendor/phpunit/php-code-coverage/phpunit.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - tests/tests - - - - - src - - - - - - - - diff --git a/vendor/phpunit/php-code-coverage/src/CodeCoverage.php b/vendor/phpunit/php-code-coverage/src/CodeCoverage.php deleted file mode 100644 index ced3b75..0000000 --- a/vendor/phpunit/php-code-coverage/src/CodeCoverage.php +++ /dev/null @@ -1,1006 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage; - -use PHPUnit\Framework\TestCase; -use PHPUnit\Runner\PhptTestCase; -use PHPUnit\Util\Test; -use SebastianBergmann\CodeCoverage\Driver\Driver; -use SebastianBergmann\CodeCoverage\Driver\PCOV; -use SebastianBergmann\CodeCoverage\Driver\PHPDBG; -use SebastianBergmann\CodeCoverage\Driver\Xdebug; -use SebastianBergmann\CodeCoverage\Node\Builder; -use SebastianBergmann\CodeCoverage\Node\Directory; -use SebastianBergmann\CodeUnitReverseLookup\Wizard; -use SebastianBergmann\Environment\Runtime; - -/** - * Provides collection functionality for PHP code coverage information. - */ -final class CodeCoverage -{ - /** - * @var Driver - */ - private $driver; - - /** - * @var Filter - */ - private $filter; - - /** - * @var Wizard - */ - private $wizard; - - /** - * @var bool - */ - private $cacheTokens = false; - - /** - * @var bool - */ - private $checkForUnintentionallyCoveredCode = false; - - /** - * @var bool - */ - private $forceCoversAnnotation = false; - - /** - * @var bool - */ - private $checkForUnexecutedCoveredCode = false; - - /** - * @var bool - */ - private $checkForMissingCoversAnnotation = false; - - /** - * @var bool - */ - private $addUncoveredFilesFromWhitelist = true; - - /** - * @var bool - */ - private $processUncoveredFilesFromWhitelist = false; - - /** - * @var bool - */ - private $ignoreDeprecatedCode = false; - - /** - * @var PhptTestCase|string|TestCase - */ - private $currentId; - - /** - * Code coverage data. - * - * @var array - */ - private $data = []; - - /** - * @var array - */ - private $ignoredLines = []; - - /** - * @var bool - */ - private $disableIgnoredLines = false; - - /** - * Test data. - * - * @var array - */ - private $tests = []; - - /** - * @var string[] - */ - private $unintentionallyCoveredSubclassesWhitelist = []; - - /** - * Determine if the data has been initialized or not - * - * @var bool - */ - private $isInitialized = false; - - /** - * Determine whether we need to check for dead and unused code on each test - * - * @var bool - */ - private $shouldCheckForDeadAndUnused = true; - - /** - * @var Directory - */ - private $report; - - /** - * @throws RuntimeException - */ - public function __construct(Driver $driver = null, Filter $filter = null) - { - if ($filter === null) { - $filter = new Filter; - } - - if ($driver === null) { - $driver = $this->selectDriver($filter); - } - - $this->driver = $driver; - $this->filter = $filter; - - $this->wizard = new Wizard; - } - - /** - * Returns the code coverage information as a graph of node objects. - */ - public function getReport(): Directory - { - if ($this->report === null) { - $this->report = (new Builder)->build($this); - } - - return $this->report; - } - - /** - * Clears collected code coverage data. - */ - public function clear(): void - { - $this->isInitialized = false; - $this->currentId = null; - $this->data = []; - $this->tests = []; - $this->report = null; - } - - /** - * Returns the filter object used. - */ - public function filter(): Filter - { - return $this->filter; - } - - /** - * Returns the collected code coverage data. - */ - public function getData(bool $raw = false): array - { - if (!$raw && $this->addUncoveredFilesFromWhitelist) { - $this->addUncoveredFilesFromWhitelist(); - } - - return $this->data; - } - - /** - * Sets the coverage data. - */ - public function setData(array $data): void - { - $this->data = $data; - $this->report = null; - } - - /** - * Returns the test data. - */ - public function getTests(): array - { - return $this->tests; - } - - /** - * Sets the test data. - */ - public function setTests(array $tests): void - { - $this->tests = $tests; - } - - /** - * Start collection of code coverage information. - * - * @param PhptTestCase|string|TestCase $id - * - * @throws RuntimeException - */ - public function start($id, bool $clear = false): void - { - if ($clear) { - $this->clear(); - } - - if ($this->isInitialized === false) { - $this->initializeData(); - } - - $this->currentId = $id; - - $this->driver->start($this->shouldCheckForDeadAndUnused); - } - - /** - * Stop collection of code coverage information. - * - * @param array|false $linesToBeCovered - * - * @throws MissingCoversAnnotationException - * @throws CoveredCodeNotExecutedException - * @throws RuntimeException - * @throws InvalidArgumentException - * @throws \ReflectionException - */ - public function stop(bool $append = true, $linesToBeCovered = [], array $linesToBeUsed = [], bool $ignoreForceCoversAnnotation = false): array - { - if (!\is_array($linesToBeCovered) && $linesToBeCovered !== false) { - throw InvalidArgumentException::create( - 2, - 'array or false' - ); - } - - $data = $this->driver->stop(); - $this->append($data, null, $append, $linesToBeCovered, $linesToBeUsed, $ignoreForceCoversAnnotation); - - $this->currentId = null; - - return $data; - } - - /** - * Appends code coverage data. - * - * @param PhptTestCase|string|TestCase $id - * @param array|false $linesToBeCovered - * - * @throws \SebastianBergmann\CodeCoverage\UnintentionallyCoveredCodeException - * @throws \SebastianBergmann\CodeCoverage\MissingCoversAnnotationException - * @throws \SebastianBergmann\CodeCoverage\CoveredCodeNotExecutedException - * @throws \ReflectionException - * @throws \SebastianBergmann\CodeCoverage\InvalidArgumentException - * @throws RuntimeException - */ - public function append(array $data, $id = null, bool $append = true, $linesToBeCovered = [], array $linesToBeUsed = [], bool $ignoreForceCoversAnnotation = false): void - { - if ($id === null) { - $id = $this->currentId; - } - - if ($id === null) { - throw new RuntimeException; - } - - $this->applyWhitelistFilter($data); - $this->applyIgnoredLinesFilter($data); - $this->initializeFilesThatAreSeenTheFirstTime($data); - - if (!$append) { - return; - } - - if ($id !== 'UNCOVERED_FILES_FROM_WHITELIST') { - $this->applyCoversAnnotationFilter( - $data, - $linesToBeCovered, - $linesToBeUsed, - $ignoreForceCoversAnnotation - ); - } - - if (empty($data)) { - return; - } - - $size = 'unknown'; - $status = -1; - - if ($id instanceof TestCase) { - $_size = $id->getSize(); - - if ($_size === Test::SMALL) { - $size = 'small'; - } elseif ($_size === Test::MEDIUM) { - $size = 'medium'; - } elseif ($_size === Test::LARGE) { - $size = 'large'; - } - - $status = $id->getStatus(); - $id = \get_class($id) . '::' . $id->getName(); - } elseif ($id instanceof PhptTestCase) { - $size = 'large'; - $id = $id->getName(); - } - - $this->tests[$id] = ['size' => $size, 'status' => $status]; - - foreach ($data as $file => $lines) { - if (!$this->filter->isFile($file)) { - continue; - } - - foreach ($lines as $k => $v) { - if ($v === Driver::LINE_EXECUTED) { - if (empty($this->data[$file][$k]) || !\in_array($id, $this->data[$file][$k])) { - $this->data[$file][$k][] = $id; - } - } - } - } - - $this->report = null; - } - - /** - * Merges the data from another instance. - * - * @param CodeCoverage $that - */ - public function merge(self $that): void - { - $this->filter->setWhitelistedFiles( - \array_merge($this->filter->getWhitelistedFiles(), $that->filter()->getWhitelistedFiles()) - ); - - foreach ($that->data as $file => $lines) { - if (!isset($this->data[$file])) { - if (!$this->filter->isFiltered($file)) { - $this->data[$file] = $lines; - } - - continue; - } - - // we should compare the lines if any of two contains data - $compareLineNumbers = \array_unique( - \array_merge( - \array_keys($this->data[$file]), - \array_keys($that->data[$file]) - ) - ); - - foreach ($compareLineNumbers as $line) { - $thatPriority = $this->getLinePriority($that->data[$file], $line); - $thisPriority = $this->getLinePriority($this->data[$file], $line); - - if ($thatPriority > $thisPriority) { - $this->data[$file][$line] = $that->data[$file][$line]; - } elseif ($thatPriority === $thisPriority && \is_array($this->data[$file][$line])) { - $this->data[$file][$line] = \array_unique( - \array_merge($this->data[$file][$line], $that->data[$file][$line]) - ); - } - } - } - - $this->tests = \array_merge($this->tests, $that->getTests()); - $this->report = null; - } - - public function setCacheTokens(bool $flag): void - { - $this->cacheTokens = $flag; - } - - public function getCacheTokens(): bool - { - return $this->cacheTokens; - } - - public function setCheckForUnintentionallyCoveredCode(bool $flag): void - { - $this->checkForUnintentionallyCoveredCode = $flag; - } - - public function setForceCoversAnnotation(bool $flag): void - { - $this->forceCoversAnnotation = $flag; - } - - public function setCheckForMissingCoversAnnotation(bool $flag): void - { - $this->checkForMissingCoversAnnotation = $flag; - } - - public function setCheckForUnexecutedCoveredCode(bool $flag): void - { - $this->checkForUnexecutedCoveredCode = $flag; - } - - public function setAddUncoveredFilesFromWhitelist(bool $flag): void - { - $this->addUncoveredFilesFromWhitelist = $flag; - } - - public function setProcessUncoveredFilesFromWhitelist(bool $flag): void - { - $this->processUncoveredFilesFromWhitelist = $flag; - } - - public function setDisableIgnoredLines(bool $flag): void - { - $this->disableIgnoredLines = $flag; - } - - public function setIgnoreDeprecatedCode(bool $flag): void - { - $this->ignoreDeprecatedCode = $flag; - } - - public function setUnintentionallyCoveredSubclassesWhitelist(array $whitelist): void - { - $this->unintentionallyCoveredSubclassesWhitelist = $whitelist; - } - - /** - * Determine the priority for a line - * - * 1 = the line is not set - * 2 = the line has not been tested - * 3 = the line is dead code - * 4 = the line has been tested - * - * During a merge, a higher number is better. - * - * @param array $data - * @param int $line - * - * @return int - */ - private function getLinePriority($data, $line) - { - if (!\array_key_exists($line, $data)) { - return 1; - } - - if (\is_array($data[$line]) && \count($data[$line]) === 0) { - return 2; - } - - if ($data[$line] === null) { - return 3; - } - - return 4; - } - - /** - * Applies the @covers annotation filtering. - * - * @param array|false $linesToBeCovered - * - * @throws \SebastianBergmann\CodeCoverage\CoveredCodeNotExecutedException - * @throws \ReflectionException - * @throws MissingCoversAnnotationException - * @throws UnintentionallyCoveredCodeException - */ - private function applyCoversAnnotationFilter(array &$data, $linesToBeCovered, array $linesToBeUsed, bool $ignoreForceCoversAnnotation): void - { - if ($linesToBeCovered === false || - ($this->forceCoversAnnotation && empty($linesToBeCovered) && !$ignoreForceCoversAnnotation)) { - if ($this->checkForMissingCoversAnnotation) { - throw new MissingCoversAnnotationException; - } - - $data = []; - - return; - } - - if (empty($linesToBeCovered)) { - return; - } - - if ($this->checkForUnintentionallyCoveredCode && - (!$this->currentId instanceof TestCase || - (!$this->currentId->isMedium() && !$this->currentId->isLarge()))) { - $this->performUnintentionallyCoveredCodeCheck($data, $linesToBeCovered, $linesToBeUsed); - } - - if ($this->checkForUnexecutedCoveredCode) { - $this->performUnexecutedCoveredCodeCheck($data, $linesToBeCovered, $linesToBeUsed); - } - - $data = \array_intersect_key($data, $linesToBeCovered); - - foreach (\array_keys($data) as $filename) { - $_linesToBeCovered = \array_flip($linesToBeCovered[$filename]); - $data[$filename] = \array_intersect_key($data[$filename], $_linesToBeCovered); - } - } - - private function applyWhitelistFilter(array &$data): void - { - foreach (\array_keys($data) as $filename) { - if ($this->filter->isFiltered($filename)) { - unset($data[$filename]); - } - } - } - - /** - * @throws \SebastianBergmann\CodeCoverage\InvalidArgumentException - */ - private function applyIgnoredLinesFilter(array &$data): void - { - foreach (\array_keys($data) as $filename) { - if (!$this->filter->isFile($filename)) { - continue; - } - - foreach ($this->getLinesToBeIgnored($filename) as $line) { - unset($data[$filename][$line]); - } - } - } - - private function initializeFilesThatAreSeenTheFirstTime(array $data): void - { - foreach ($data as $file => $lines) { - if (!isset($this->data[$file]) && $this->filter->isFile($file)) { - $this->data[$file] = []; - - foreach ($lines as $k => $v) { - $this->data[$file][$k] = $v === -2 ? null : []; - } - } - } - } - - /** - * @throws CoveredCodeNotExecutedException - * @throws InvalidArgumentException - * @throws MissingCoversAnnotationException - * @throws RuntimeException - * @throws UnintentionallyCoveredCodeException - * @throws \ReflectionException - */ - private function addUncoveredFilesFromWhitelist(): void - { - $data = []; - $uncoveredFiles = \array_diff( - $this->filter->getWhitelist(), - \array_keys($this->data) - ); - - foreach ($uncoveredFiles as $uncoveredFile) { - if (!\file_exists($uncoveredFile)) { - continue; - } - - $data[$uncoveredFile] = []; - - $lines = \count(\file($uncoveredFile)); - - for ($i = 1; $i <= $lines; $i++) { - $data[$uncoveredFile][$i] = Driver::LINE_NOT_EXECUTED; - } - } - - $this->append($data, 'UNCOVERED_FILES_FROM_WHITELIST'); - } - - private function getLinesToBeIgnored(string $fileName): array - { - if (isset($this->ignoredLines[$fileName])) { - return $this->ignoredLines[$fileName]; - } - - try { - return $this->getLinesToBeIgnoredInner($fileName); - } catch (\OutOfBoundsException $e) { - // This can happen with PHP_Token_Stream if the file is syntactically invalid, - // and probably affects a file that wasn't executed. - return []; - } - } - - private function getLinesToBeIgnoredInner(string $fileName): array - { - $this->ignoredLines[$fileName] = []; - - $lines = \file($fileName); - - foreach ($lines as $index => $line) { - if (!\trim($line)) { - $this->ignoredLines[$fileName][] = $index + 1; - } - } - - if ($this->cacheTokens) { - $tokens = \PHP_Token_Stream_CachingFactory::get($fileName); - } else { - $tokens = new \PHP_Token_Stream($fileName); - } - - foreach ($tokens->getInterfaces() as $interface) { - $interfaceStartLine = $interface['startLine']; - $interfaceEndLine = $interface['endLine']; - - foreach (\range($interfaceStartLine, $interfaceEndLine) as $line) { - $this->ignoredLines[$fileName][] = $line; - } - } - - foreach (\array_merge($tokens->getClasses(), $tokens->getTraits()) as $classOrTrait) { - $classOrTraitStartLine = $classOrTrait['startLine']; - $classOrTraitEndLine = $classOrTrait['endLine']; - - if (empty($classOrTrait['methods'])) { - foreach (\range($classOrTraitStartLine, $classOrTraitEndLine) as $line) { - $this->ignoredLines[$fileName][] = $line; - } - - continue; - } - - $firstMethod = \array_shift($classOrTrait['methods']); - $firstMethodStartLine = $firstMethod['startLine']; - $lastMethodEndLine = $firstMethod['endLine']; - - do { - $lastMethod = \array_pop($classOrTrait['methods']); - } while ($lastMethod !== null && 0 === \strpos($lastMethod['signature'], 'anonymousFunction')); - - if ($lastMethod !== null) { - $lastMethodEndLine = $lastMethod['endLine']; - } - - foreach (\range($classOrTraitStartLine, $firstMethodStartLine) as $line) { - $this->ignoredLines[$fileName][] = $line; - } - - foreach (\range($lastMethodEndLine + 1, $classOrTraitEndLine) as $line) { - $this->ignoredLines[$fileName][] = $line; - } - } - - if ($this->disableIgnoredLines) { - $this->ignoredLines[$fileName] = \array_unique($this->ignoredLines[$fileName]); - \sort($this->ignoredLines[$fileName]); - - return $this->ignoredLines[$fileName]; - } - - $ignore = false; - $stop = false; - - foreach ($tokens->tokens() as $token) { - switch (\get_class($token)) { - case \PHP_Token_COMMENT::class: - case \PHP_Token_DOC_COMMENT::class: - $_token = \trim((string) $token); - $_line = \trim($lines[$token->getLine() - 1]); - - if ($_token === '// @codeCoverageIgnore' || - $_token === '//@codeCoverageIgnore') { - $ignore = true; - $stop = true; - } elseif ($_token === '// @codeCoverageIgnoreStart' || - $_token === '//@codeCoverageIgnoreStart') { - $ignore = true; - } elseif ($_token === '// @codeCoverageIgnoreEnd' || - $_token === '//@codeCoverageIgnoreEnd') { - $stop = true; - } - - if (!$ignore) { - $start = $token->getLine(); - $end = $start + \substr_count((string) $token, "\n"); - - // Do not ignore the first line when there is a token - // before the comment - if (0 !== \strpos($_token, $_line)) { - $start++; - } - - for ($i = $start; $i < $end; $i++) { - $this->ignoredLines[$fileName][] = $i; - } - - // A DOC_COMMENT token or a COMMENT token starting with "/*" - // does not contain the final \n character in its text - if (isset($lines[$i - 1]) && 0 === \strpos($_token, '/*') && '*/' === \substr(\trim($lines[$i - 1]), -2)) { - $this->ignoredLines[$fileName][] = $i; - } - } - - break; - - case \PHP_Token_INTERFACE::class: - case \PHP_Token_TRAIT::class: - case \PHP_Token_CLASS::class: - case \PHP_Token_FUNCTION::class: - /* @var \PHP_Token_Interface $token */ - - $docblock = (string) $token->getDocblock(); - - $this->ignoredLines[$fileName][] = $token->getLine(); - - if (\strpos($docblock, '@codeCoverageIgnore') || ($this->ignoreDeprecatedCode && \strpos($docblock, '@deprecated'))) { - $endLine = $token->getEndLine(); - - for ($i = $token->getLine(); $i <= $endLine; $i++) { - $this->ignoredLines[$fileName][] = $i; - } - } - - break; - - /* @noinspection PhpMissingBreakStatementInspection */ - case \PHP_Token_NAMESPACE::class: - $this->ignoredLines[$fileName][] = $token->getEndLine(); - - // Intentional fallthrough - case \PHP_Token_DECLARE::class: - case \PHP_Token_OPEN_TAG::class: - case \PHP_Token_CLOSE_TAG::class: - case \PHP_Token_USE::class: - case \PHP_Token_USE_FUNCTION::class: - $this->ignoredLines[$fileName][] = $token->getLine(); - - break; - } - - if ($ignore) { - $this->ignoredLines[$fileName][] = $token->getLine(); - - if ($stop) { - $ignore = false; - $stop = false; - } - } - } - - $this->ignoredLines[$fileName][] = \count($lines) + 1; - - $this->ignoredLines[$fileName] = \array_unique( - $this->ignoredLines[$fileName] - ); - - $this->ignoredLines[$fileName] = \array_unique($this->ignoredLines[$fileName]); - \sort($this->ignoredLines[$fileName]); - - return $this->ignoredLines[$fileName]; - } - - /** - * @throws \ReflectionException - * @throws UnintentionallyCoveredCodeException - */ - private function performUnintentionallyCoveredCodeCheck(array &$data, array $linesToBeCovered, array $linesToBeUsed): void - { - $allowedLines = $this->getAllowedLines( - $linesToBeCovered, - $linesToBeUsed - ); - - $unintentionallyCoveredUnits = []; - - foreach ($data as $file => $_data) { - foreach ($_data as $line => $flag) { - if ($flag === 1 && !isset($allowedLines[$file][$line])) { - $unintentionallyCoveredUnits[] = $this->wizard->lookup($file, $line); - } - } - } - - $unintentionallyCoveredUnits = $this->processUnintentionallyCoveredUnits($unintentionallyCoveredUnits); - - if (!empty($unintentionallyCoveredUnits)) { - throw new UnintentionallyCoveredCodeException( - $unintentionallyCoveredUnits - ); - } - } - - /** - * @throws CoveredCodeNotExecutedException - */ - private function performUnexecutedCoveredCodeCheck(array &$data, array $linesToBeCovered, array $linesToBeUsed): void - { - $executedCodeUnits = $this->coverageToCodeUnits($data); - $message = ''; - - foreach ($this->linesToCodeUnits($linesToBeCovered) as $codeUnit) { - if (!\in_array($codeUnit, $executedCodeUnits)) { - $message .= \sprintf( - '- %s is expected to be executed (@covers) but was not executed' . "\n", - $codeUnit - ); - } - } - - foreach ($this->linesToCodeUnits($linesToBeUsed) as $codeUnit) { - if (!\in_array($codeUnit, $executedCodeUnits)) { - $message .= \sprintf( - '- %s is expected to be executed (@uses) but was not executed' . "\n", - $codeUnit - ); - } - } - - if (!empty($message)) { - throw new CoveredCodeNotExecutedException($message); - } - } - - private function getAllowedLines(array $linesToBeCovered, array $linesToBeUsed): array - { - $allowedLines = []; - - foreach (\array_keys($linesToBeCovered) as $file) { - if (!isset($allowedLines[$file])) { - $allowedLines[$file] = []; - } - - $allowedLines[$file] = \array_merge( - $allowedLines[$file], - $linesToBeCovered[$file] - ); - } - - foreach (\array_keys($linesToBeUsed) as $file) { - if (!isset($allowedLines[$file])) { - $allowedLines[$file] = []; - } - - $allowedLines[$file] = \array_merge( - $allowedLines[$file], - $linesToBeUsed[$file] - ); - } - - foreach (\array_keys($allowedLines) as $file) { - $allowedLines[$file] = \array_flip( - \array_unique($allowedLines[$file]) - ); - } - - return $allowedLines; - } - - /** - * @throws RuntimeException - */ - private function selectDriver(Filter $filter): Driver - { - $runtime = new Runtime; - - if ($runtime->hasPHPDBGCodeCoverage()) { - return new PHPDBG; - } - - if ($runtime->hasPCOV()) { - return new PCOV; - } - - if ($runtime->hasXdebug()) { - return new Xdebug($filter); - } - - throw new RuntimeException('No code coverage driver available'); - } - - private function processUnintentionallyCoveredUnits(array $unintentionallyCoveredUnits): array - { - $unintentionallyCoveredUnits = \array_unique($unintentionallyCoveredUnits); - \sort($unintentionallyCoveredUnits); - - foreach (\array_keys($unintentionallyCoveredUnits) as $k => $v) { - $unit = \explode('::', $unintentionallyCoveredUnits[$k]); - - if (\count($unit) !== 2) { - continue; - } - - $class = new \ReflectionClass($unit[0]); - - foreach ($this->unintentionallyCoveredSubclassesWhitelist as $whitelisted) { - if ($class->isSubclassOf($whitelisted)) { - unset($unintentionallyCoveredUnits[$k]); - - break; - } - } - } - - return \array_values($unintentionallyCoveredUnits); - } - - /** - * @throws CoveredCodeNotExecutedException - * @throws InvalidArgumentException - * @throws MissingCoversAnnotationException - * @throws RuntimeException - * @throws UnintentionallyCoveredCodeException - * @throws \ReflectionException - */ - private function initializeData(): void - { - $this->isInitialized = true; - - if ($this->processUncoveredFilesFromWhitelist) { - $this->shouldCheckForDeadAndUnused = false; - - $this->driver->start(); - - foreach ($this->filter->getWhitelist() as $file) { - if ($this->filter->isFile($file)) { - include_once $file; - } - } - - $data = []; - - foreach ($this->driver->stop() as $file => $fileCoverage) { - if ($this->filter->isFiltered($file)) { - continue; - } - - foreach (\array_keys($fileCoverage) as $key) { - if ($fileCoverage[$key] === Driver::LINE_EXECUTED) { - $fileCoverage[$key] = Driver::LINE_NOT_EXECUTED; - } - } - - $data[$file] = $fileCoverage; - } - - $this->append($data, 'UNCOVERED_FILES_FROM_WHITELIST'); - } - } - - private function coverageToCodeUnits(array $data): array - { - $codeUnits = []; - - foreach ($data as $filename => $lines) { - foreach ($lines as $line => $flag) { - if ($flag === 1) { - $codeUnits[] = $this->wizard->lookup($filename, $line); - } - } - } - - return \array_unique($codeUnits); - } - - private function linesToCodeUnits(array $data): array - { - $codeUnits = []; - - foreach ($data as $filename => $lines) { - foreach ($lines as $line) { - $codeUnits[] = $this->wizard->lookup($filename, $line); - } - } - - return \array_unique($codeUnits); - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Driver/Driver.php b/vendor/phpunit/php-code-coverage/src/Driver/Driver.php deleted file mode 100644 index 17acbf6..0000000 --- a/vendor/phpunit/php-code-coverage/src/Driver/Driver.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Driver; - -/** - * Interface for code coverage drivers. - */ -interface Driver -{ - /** - * @var int - * - * @see http://xdebug.org/docs/code_coverage - */ - public const LINE_EXECUTED = 1; - - /** - * @var int - * - * @see http://xdebug.org/docs/code_coverage - */ - public const LINE_NOT_EXECUTED = -1; - - /** - * @var int - * - * @see http://xdebug.org/docs/code_coverage - */ - public const LINE_NOT_EXECUTABLE = -2; - - /** - * Start collection of code coverage information. - */ - public function start(bool $determineUnusedAndDead = true): void; - - /** - * Stop collection of code coverage information. - */ - public function stop(): array; -} diff --git a/vendor/phpunit/php-code-coverage/src/Driver/PCOV.php b/vendor/phpunit/php-code-coverage/src/Driver/PCOV.php deleted file mode 100644 index 7a6a3b6..0000000 --- a/vendor/phpunit/php-code-coverage/src/Driver/PCOV.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Driver; - -/** - * Driver for PCOV code coverage functionality. - * - * @codeCoverageIgnore - */ -final class PCOV implements Driver -{ - /** - * Start collection of code coverage information. - */ - public function start(bool $determineUnusedAndDead = true): void - { - \pcov\start(); - } - - /** - * Stop collection of code coverage information. - */ - public function stop(): array - { - \pcov\stop(); - - $waiting = \pcov\waiting(); - $collect = []; - - if ($waiting) { - $collect = \pcov\collect(\pcov\inclusive, $waiting); - - \pcov\clear(); - } - - return $collect; - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Driver/PHPDBG.php b/vendor/phpunit/php-code-coverage/src/Driver/PHPDBG.php deleted file mode 100644 index e9f999a..0000000 --- a/vendor/phpunit/php-code-coverage/src/Driver/PHPDBG.php +++ /dev/null @@ -1,96 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Driver; - -use SebastianBergmann\CodeCoverage\RuntimeException; - -/** - * Driver for PHPDBG's code coverage functionality. - * - * @codeCoverageIgnore - */ -final class PHPDBG implements Driver -{ - /** - * @throws RuntimeException - */ - public function __construct() - { - if (\PHP_SAPI !== 'phpdbg') { - throw new RuntimeException( - 'This driver requires the PHPDBG SAPI' - ); - } - - if (!\function_exists('phpdbg_start_oplog')) { - throw new RuntimeException( - 'This build of PHPDBG does not support code coverage' - ); - } - } - - /** - * Start collection of code coverage information. - */ - public function start(bool $determineUnusedAndDead = true): void - { - \phpdbg_start_oplog(); - } - - /** - * Stop collection of code coverage information. - */ - public function stop(): array - { - static $fetchedLines = []; - - $dbgData = \phpdbg_end_oplog(); - - if ($fetchedLines == []) { - $sourceLines = \phpdbg_get_executable(); - } else { - $newFiles = \array_diff(\get_included_files(), \array_keys($fetchedLines)); - - $sourceLines = []; - - if ($newFiles) { - $sourceLines = phpdbg_get_executable(['files' => $newFiles]); - } - } - - foreach ($sourceLines as $file => $lines) { - foreach ($lines as $lineNo => $numExecuted) { - $sourceLines[$file][$lineNo] = self::LINE_NOT_EXECUTED; - } - } - - $fetchedLines = \array_merge($fetchedLines, $sourceLines); - - return $this->detectExecutedLines($fetchedLines, $dbgData); - } - - /** - * Convert phpdbg based data into the format CodeCoverage expects - */ - private function detectExecutedLines(array $sourceLines, array $dbgData): array - { - foreach ($dbgData as $file => $coveredLines) { - foreach ($coveredLines as $lineNo => $numExecuted) { - // phpdbg also reports $lineNo=0 when e.g. exceptions get thrown. - // make sure we only mark lines executed which are actually executable. - if (isset($sourceLines[$file][$lineNo])) { - $sourceLines[$file][$lineNo] = self::LINE_EXECUTED; - } - } - } - - return $sourceLines; - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Driver/Xdebug.php b/vendor/phpunit/php-code-coverage/src/Driver/Xdebug.php deleted file mode 100644 index 06779ea..0000000 --- a/vendor/phpunit/php-code-coverage/src/Driver/Xdebug.php +++ /dev/null @@ -1,123 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Driver; - -use SebastianBergmann\CodeCoverage\Filter; -use SebastianBergmann\CodeCoverage\RuntimeException; - -/** - * Driver for Xdebug's code coverage functionality. - * - * @codeCoverageIgnore - */ -final class Xdebug implements Driver -{ - /** - * @var array - */ - private $cacheNumLines = []; - - /** - * @var Filter - */ - private $filter; - - /** - * @throws RuntimeException - */ - public function __construct(Filter $filter = null) - { - if (!\extension_loaded('xdebug')) { - throw new RuntimeException('This driver requires Xdebug'); - } - - if (\version_compare(\phpversion('xdebug'), '3', '>=')) { - $mode = \getenv('XDEBUG_MODE'); - - if ($mode === false) { - $mode = \ini_get('xdebug.mode'); - } - - if ($mode === false || - !\in_array('coverage', \explode(',', $mode), true)) { - throw new RuntimeException('XDEBUG_MODE=coverage or xdebug.mode=coverage has to be set'); - } - } elseif (!\ini_get('xdebug.coverage_enable')) { - throw new RuntimeException('xdebug.coverage_enable=On has to be set'); - } - - if ($filter === null) { - $filter = new Filter; - } - - $this->filter = $filter; - } - - /** - * Start collection of code coverage information. - */ - public function start(bool $determineUnusedAndDead = true): void - { - if ($determineUnusedAndDead) { - \xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE); - } else { - \xdebug_start_code_coverage(); - } - } - - /** - * Stop collection of code coverage information. - */ - public function stop(): array - { - $data = \xdebug_get_code_coverage(); - - \xdebug_stop_code_coverage(); - - return $this->cleanup($data); - } - - private function cleanup(array $data): array - { - foreach (\array_keys($data) as $file) { - unset($data[$file][0]); - - if (!$this->filter->isFile($file)) { - continue; - } - - $numLines = $this->getNumberOfLinesInFile($file); - - foreach (\array_keys($data[$file]) as $line) { - if ($line > $numLines) { - unset($data[$file][$line]); - } - } - } - - return $data; - } - - private function getNumberOfLinesInFile(string $fileName): int - { - if (!isset($this->cacheNumLines[$fileName])) { - $buffer = \file_get_contents($fileName); - $lines = \substr_count($buffer, "\n"); - - if (\substr($buffer, -1) !== "\n") { - $lines++; - } - - $this->cacheNumLines[$fileName] = $lines; - } - - return $this->cacheNumLines[$fileName]; - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Exception/CoveredCodeNotExecutedException.php b/vendor/phpunit/php-code-coverage/src/Exception/CoveredCodeNotExecutedException.php deleted file mode 100644 index a88ab34..0000000 --- a/vendor/phpunit/php-code-coverage/src/Exception/CoveredCodeNotExecutedException.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage; - -/** - * Exception that is raised when covered code is not executed. - */ -final class CoveredCodeNotExecutedException extends RuntimeException -{ -} diff --git a/vendor/phpunit/php-code-coverage/src/Exception/Exception.php b/vendor/phpunit/php-code-coverage/src/Exception/Exception.php deleted file mode 100644 index 32bf894..0000000 --- a/vendor/phpunit/php-code-coverage/src/Exception/Exception.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage; - -/** - * Exception interface for php-code-coverage component. - */ -interface Exception -{ -} diff --git a/vendor/phpunit/php-code-coverage/src/Exception/InvalidArgumentException.php b/vendor/phpunit/php-code-coverage/src/Exception/InvalidArgumentException.php deleted file mode 100644 index cf2fcfc..0000000 --- a/vendor/phpunit/php-code-coverage/src/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage; - -final class InvalidArgumentException extends \InvalidArgumentException implements Exception -{ - /** - * @param int $argument - * @param string $type - * @param null|mixed $value - * - * @return InvalidArgumentException - */ - public static function create($argument, $type, $value = null): self - { - $stack = \debug_backtrace(0); - - return new self( - \sprintf( - 'Argument #%d%sof %s::%s() must be a %s', - $argument, - $value !== null ? ' (' . \gettype($value) . '#' . $value . ')' : ' (No Value) ', - $stack[1]['class'], - $stack[1]['function'], - $type - ) - ); - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Exception/MissingCoversAnnotationException.php b/vendor/phpunit/php-code-coverage/src/Exception/MissingCoversAnnotationException.php deleted file mode 100644 index 56c4736..0000000 --- a/vendor/phpunit/php-code-coverage/src/Exception/MissingCoversAnnotationException.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage; - -/** - * Exception that is raised when @covers must be used but is not. - */ -final class MissingCoversAnnotationException extends RuntimeException -{ -} diff --git a/vendor/phpunit/php-code-coverage/src/Exception/RuntimeException.php b/vendor/phpunit/php-code-coverage/src/Exception/RuntimeException.php deleted file mode 100644 index 608650d..0000000 --- a/vendor/phpunit/php-code-coverage/src/Exception/RuntimeException.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage; - -class RuntimeException extends \RuntimeException implements Exception -{ -} diff --git a/vendor/phpunit/php-code-coverage/src/Exception/UnintentionallyCoveredCodeException.php b/vendor/phpunit/php-code-coverage/src/Exception/UnintentionallyCoveredCodeException.php deleted file mode 100644 index ef219b5..0000000 --- a/vendor/phpunit/php-code-coverage/src/Exception/UnintentionallyCoveredCodeException.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage; - -/** - * Exception that is raised when code is unintentionally covered. - */ -final class UnintentionallyCoveredCodeException extends RuntimeException -{ - /** - * @var array - */ - private $unintentionallyCoveredUnits = []; - - public function __construct(array $unintentionallyCoveredUnits) - { - $this->unintentionallyCoveredUnits = $unintentionallyCoveredUnits; - - parent::__construct($this->toString()); - } - - public function getUnintentionallyCoveredUnits(): array - { - return $this->unintentionallyCoveredUnits; - } - - private function toString(): string - { - $message = ''; - - foreach ($this->unintentionallyCoveredUnits as $unit) { - $message .= '- ' . $unit . "\n"; - } - - return $message; - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Filter.php b/vendor/phpunit/php-code-coverage/src/Filter.php deleted file mode 100644 index b3c2d2d..0000000 --- a/vendor/phpunit/php-code-coverage/src/Filter.php +++ /dev/null @@ -1,174 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage; - -use SebastianBergmann\FileIterator\Facade as FileIteratorFacade; - -/** - * Filter for whitelisting of code coverage information. - */ -final class Filter -{ - /** - * Source files that are whitelisted. - * - * @var array - */ - private $whitelistedFiles = []; - - /** - * Remembers the result of the `is_file()` calls. - * - * @var bool[] - */ - private $isFileCallsCache = []; - - /** - * Adds a directory to the whitelist (recursively). - */ - public function addDirectoryToWhitelist(string $directory, string $suffix = '.php', string $prefix = ''): void - { - $facade = new FileIteratorFacade; - $files = $facade->getFilesAsArray($directory, $suffix, $prefix); - - foreach ($files as $file) { - $this->addFileToWhitelist($file); - } - } - - /** - * Adds a file to the whitelist. - */ - public function addFileToWhitelist(string $filename): void - { - $filename = \realpath($filename); - - if (!$filename) { - return; - } - - $this->whitelistedFiles[$filename] = true; - } - - /** - * Adds files to the whitelist. - * - * @param string[] $files - */ - public function addFilesToWhitelist(array $files): void - { - foreach ($files as $file) { - $this->addFileToWhitelist($file); - } - } - - /** - * Removes a directory from the whitelist (recursively). - */ - public function removeDirectoryFromWhitelist(string $directory, string $suffix = '.php', string $prefix = ''): void - { - $facade = new FileIteratorFacade; - $files = $facade->getFilesAsArray($directory, $suffix, $prefix); - - foreach ($files as $file) { - $this->removeFileFromWhitelist($file); - } - } - - /** - * Removes a file from the whitelist. - */ - public function removeFileFromWhitelist(string $filename): void - { - $filename = \realpath($filename); - - if (!$filename || !isset($this->whitelistedFiles[$filename])) { - return; - } - - unset($this->whitelistedFiles[$filename]); - } - - /** - * Checks whether a filename is a real filename. - */ - public function isFile(string $filename): bool - { - if (isset($this->isFileCallsCache[$filename])) { - return $this->isFileCallsCache[$filename]; - } - - if ($filename === '-' || - \strpos($filename, 'vfs://') === 0 || - \strpos($filename, 'xdebug://debug-eval') !== false || - \strpos($filename, 'eval()\'d code') !== false || - \strpos($filename, 'runtime-created function') !== false || - \strpos($filename, 'runkit created function') !== false || - \strpos($filename, 'assert code') !== false || - \strpos($filename, 'regexp code') !== false || - \strpos($filename, 'Standard input code') !== false) { - $isFile = false; - } else { - $isFile = \file_exists($filename); - } - - $this->isFileCallsCache[$filename] = $isFile; - - return $isFile; - } - - /** - * Checks whether or not a file is filtered. - */ - public function isFiltered(string $filename): bool - { - if (!$this->isFile($filename)) { - return true; - } - - return !isset($this->whitelistedFiles[$filename]); - } - - /** - * Returns the list of whitelisted files. - * - * @return string[] - */ - public function getWhitelist(): array - { - return \array_keys($this->whitelistedFiles); - } - - /** - * Returns whether this filter has a whitelist. - */ - public function hasWhitelist(): bool - { - return !empty($this->whitelistedFiles); - } - - /** - * Returns the whitelisted files. - * - * @return string[] - */ - public function getWhitelistedFiles(): array - { - return $this->whitelistedFiles; - } - - /** - * Sets the whitelisted files. - */ - public function setWhitelistedFiles(array $whitelistedFiles): void - { - $this->whitelistedFiles = $whitelistedFiles; - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Node/AbstractNode.php b/vendor/phpunit/php-code-coverage/src/Node/AbstractNode.php deleted file mode 100644 index 116a09f..0000000 --- a/vendor/phpunit/php-code-coverage/src/Node/AbstractNode.php +++ /dev/null @@ -1,328 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Node; - -use SebastianBergmann\CodeCoverage\Util; - -/** - * Base class for nodes in the code coverage information tree. - */ -abstract class AbstractNode implements \Countable -{ - /** - * @var string - */ - private $name; - - /** - * @var string - */ - private $path; - - /** - * @var array - */ - private $pathArray; - - /** - * @var AbstractNode - */ - private $parent; - - /** - * @var string - */ - private $id; - - public function __construct(string $name, self $parent = null) - { - if (\substr($name, -1) == \DIRECTORY_SEPARATOR) { - $name = \substr($name, 0, -1); - } - - $this->name = $name; - $this->parent = $parent; - } - - public function getName(): string - { - return $this->name; - } - - public function getId(): string - { - if ($this->id === null) { - $parent = $this->getParent(); - - if ($parent === null) { - $this->id = 'index'; - } else { - $parentId = $parent->getId(); - - if ($parentId === 'index') { - $this->id = \str_replace(':', '_', $this->name); - } else { - $this->id = $parentId . '/' . $this->name; - } - } - } - - return $this->id; - } - - public function getPath(): string - { - if ($this->path === null) { - if ($this->parent === null || $this->parent->getPath() === null || $this->parent->getPath() === false) { - $this->path = $this->name; - } else { - $this->path = $this->parent->getPath() . \DIRECTORY_SEPARATOR . $this->name; - } - } - - return $this->path; - } - - public function getPathAsArray(): array - { - if ($this->pathArray === null) { - if ($this->parent === null) { - $this->pathArray = []; - } else { - $this->pathArray = $this->parent->getPathAsArray(); - } - - $this->pathArray[] = $this; - } - - return $this->pathArray; - } - - public function getParent(): ?self - { - return $this->parent; - } - - /** - * Returns the percentage of classes that has been tested. - * - * @return int|string - */ - public function getTestedClassesPercent(bool $asString = true) - { - return Util::percent( - $this->getNumTestedClasses(), - $this->getNumClasses(), - $asString - ); - } - - /** - * Returns the percentage of traits that has been tested. - * - * @return int|string - */ - public function getTestedTraitsPercent(bool $asString = true) - { - return Util::percent( - $this->getNumTestedTraits(), - $this->getNumTraits(), - $asString - ); - } - - /** - * Returns the percentage of classes and traits that has been tested. - * - * @return int|string - */ - public function getTestedClassesAndTraitsPercent(bool $asString = true) - { - return Util::percent( - $this->getNumTestedClassesAndTraits(), - $this->getNumClassesAndTraits(), - $asString - ); - } - - /** - * Returns the percentage of functions that has been tested. - * - * @return int|string - */ - public function getTestedFunctionsPercent(bool $asString = true) - { - return Util::percent( - $this->getNumTestedFunctions(), - $this->getNumFunctions(), - $asString - ); - } - - /** - * Returns the percentage of methods that has been tested. - * - * @return int|string - */ - public function getTestedMethodsPercent(bool $asString = true) - { - return Util::percent( - $this->getNumTestedMethods(), - $this->getNumMethods(), - $asString - ); - } - - /** - * Returns the percentage of functions and methods that has been tested. - * - * @return int|string - */ - public function getTestedFunctionsAndMethodsPercent(bool $asString = true) - { - return Util::percent( - $this->getNumTestedFunctionsAndMethods(), - $this->getNumFunctionsAndMethods(), - $asString - ); - } - - /** - * Returns the percentage of executed lines. - * - * @return int|string - */ - public function getLineExecutedPercent(bool $asString = true) - { - return Util::percent( - $this->getNumExecutedLines(), - $this->getNumExecutableLines(), - $asString - ); - } - - /** - * Returns the number of classes and traits. - */ - public function getNumClassesAndTraits(): int - { - return $this->getNumClasses() + $this->getNumTraits(); - } - - /** - * Returns the number of tested classes and traits. - */ - public function getNumTestedClassesAndTraits(): int - { - return $this->getNumTestedClasses() + $this->getNumTestedTraits(); - } - - /** - * Returns the classes and traits of this node. - */ - public function getClassesAndTraits(): array - { - return \array_merge($this->getClasses(), $this->getTraits()); - } - - /** - * Returns the number of functions and methods. - */ - public function getNumFunctionsAndMethods(): int - { - return $this->getNumFunctions() + $this->getNumMethods(); - } - - /** - * Returns the number of tested functions and methods. - */ - public function getNumTestedFunctionsAndMethods(): int - { - return $this->getNumTestedFunctions() + $this->getNumTestedMethods(); - } - - /** - * Returns the functions and methods of this node. - */ - public function getFunctionsAndMethods(): array - { - return \array_merge($this->getFunctions(), $this->getMethods()); - } - - /** - * Returns the classes of this node. - */ - abstract public function getClasses(): array; - - /** - * Returns the traits of this node. - */ - abstract public function getTraits(): array; - - /** - * Returns the functions of this node. - */ - abstract public function getFunctions(): array; - - /** - * Returns the LOC/CLOC/NCLOC of this node. - */ - abstract public function getLinesOfCode(): array; - - /** - * Returns the number of executable lines. - */ - abstract public function getNumExecutableLines(): int; - - /** - * Returns the number of executed lines. - */ - abstract public function getNumExecutedLines(): int; - - /** - * Returns the number of classes. - */ - abstract public function getNumClasses(): int; - - /** - * Returns the number of tested classes. - */ - abstract public function getNumTestedClasses(): int; - - /** - * Returns the number of traits. - */ - abstract public function getNumTraits(): int; - - /** - * Returns the number of tested traits. - */ - abstract public function getNumTestedTraits(): int; - - /** - * Returns the number of methods. - */ - abstract public function getNumMethods(): int; - - /** - * Returns the number of tested methods. - */ - abstract public function getNumTestedMethods(): int; - - /** - * Returns the number of functions. - */ - abstract public function getNumFunctions(): int; - - /** - * Returns the number of tested functions. - */ - abstract public function getNumTestedFunctions(): int; -} diff --git a/vendor/phpunit/php-code-coverage/src/Node/Builder.php b/vendor/phpunit/php-code-coverage/src/Node/Builder.php deleted file mode 100644 index 5e34bcc..0000000 --- a/vendor/phpunit/php-code-coverage/src/Node/Builder.php +++ /dev/null @@ -1,227 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Node; - -use SebastianBergmann\CodeCoverage\CodeCoverage; - -final class Builder -{ - public function build(CodeCoverage $coverage): Directory - { - $files = $coverage->getData(); - $commonPath = $this->reducePaths($files); - $root = new Directory( - $commonPath, - null - ); - - $this->addItems( - $root, - $this->buildDirectoryStructure($files), - $coverage->getTests(), - $coverage->getCacheTokens() - ); - - return $root; - } - - private function addItems(Directory $root, array $items, array $tests, bool $cacheTokens): void - { - foreach ($items as $key => $value) { - $key = (string) $key; - - if (\substr($key, -2) === '/f') { - $key = \substr($key, 0, -2); - - if (\file_exists($root->getPath() . \DIRECTORY_SEPARATOR . $key)) { - $root->addFile($key, $value, $tests, $cacheTokens); - } - } else { - $child = $root->addDirectory($key); - $this->addItems($child, $value, $tests, $cacheTokens); - } - } - } - - /** - * Builds an array representation of the directory structure. - * - * For instance, - * - * - * Array - * ( - * [Money.php] => Array - * ( - * ... - * ) - * - * [MoneyBag.php] => Array - * ( - * ... - * ) - * ) - * - * - * is transformed into - * - * - * Array - * ( - * [.] => Array - * ( - * [Money.php] => Array - * ( - * ... - * ) - * - * [MoneyBag.php] => Array - * ( - * ... - * ) - * ) - * ) - * - */ - private function buildDirectoryStructure(array $files): array - { - $result = []; - - foreach ($files as $path => $file) { - $path = \explode(\DIRECTORY_SEPARATOR, $path); - $pointer = &$result; - $max = \count($path); - - for ($i = 0; $i < $max; $i++) { - $type = ''; - - if ($i === ($max - 1)) { - $type = '/f'; - } - - $pointer = &$pointer[$path[$i] . $type]; - } - - $pointer = $file; - } - - return $result; - } - - /** - * Reduces the paths by cutting the longest common start path. - * - * For instance, - * - * - * Array - * ( - * [/home/sb/Money/Money.php] => Array - * ( - * ... - * ) - * - * [/home/sb/Money/MoneyBag.php] => Array - * ( - * ... - * ) - * ) - * - * - * is reduced to - * - * - * Array - * ( - * [Money.php] => Array - * ( - * ... - * ) - * - * [MoneyBag.php] => Array - * ( - * ... - * ) - * ) - * - */ - private function reducePaths(array &$files): string - { - if (empty($files)) { - return '.'; - } - - $commonPath = ''; - $paths = \array_keys($files); - - if (\count($files) === 1) { - $commonPath = \dirname($paths[0]) . \DIRECTORY_SEPARATOR; - $files[\basename($paths[0])] = $files[$paths[0]]; - - unset($files[$paths[0]]); - - return $commonPath; - } - - $max = \count($paths); - - for ($i = 0; $i < $max; $i++) { - // strip phar:// prefixes - if (\strpos($paths[$i], 'phar://') === 0) { - $paths[$i] = \substr($paths[$i], 7); - $paths[$i] = \str_replace('/', \DIRECTORY_SEPARATOR, $paths[$i]); - } - $paths[$i] = \explode(\DIRECTORY_SEPARATOR, $paths[$i]); - - if (empty($paths[$i][0])) { - $paths[$i][0] = \DIRECTORY_SEPARATOR; - } - } - - $done = false; - $max = \count($paths); - - while (!$done) { - for ($i = 0; $i < $max - 1; $i++) { - if (!isset($paths[$i][0]) || - !isset($paths[$i + 1][0]) || - $paths[$i][0] !== $paths[$i + 1][0]) { - $done = true; - - break; - } - } - - if (!$done) { - $commonPath .= $paths[0][0]; - - if ($paths[0][0] !== \DIRECTORY_SEPARATOR) { - $commonPath .= \DIRECTORY_SEPARATOR; - } - - for ($i = 0; $i < $max; $i++) { - \array_shift($paths[$i]); - } - } - } - - $original = \array_keys($files); - $max = \count($original); - - for ($i = 0; $i < $max; $i++) { - $files[\implode(\DIRECTORY_SEPARATOR, $paths[$i])] = $files[$original[$i]]; - unset($files[$original[$i]]); - } - - \ksort($files); - - return \substr($commonPath, 0, -1); - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Node/Directory.php b/vendor/phpunit/php-code-coverage/src/Node/Directory.php deleted file mode 100644 index 7f1b5b2..0000000 --- a/vendor/phpunit/php-code-coverage/src/Node/Directory.php +++ /dev/null @@ -1,427 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Node; - -use SebastianBergmann\CodeCoverage\InvalidArgumentException; - -/** - * Represents a directory in the code coverage information tree. - */ -final class Directory extends AbstractNode implements \IteratorAggregate -{ - /** - * @var AbstractNode[] - */ - private $children = []; - - /** - * @var Directory[] - */ - private $directories = []; - - /** - * @var File[] - */ - private $files = []; - - /** - * @var array - */ - private $classes; - - /** - * @var array - */ - private $traits; - - /** - * @var array - */ - private $functions; - - /** - * @var array - */ - private $linesOfCode; - - /** - * @var int - */ - private $numFiles = -1; - - /** - * @var int - */ - private $numExecutableLines = -1; - - /** - * @var int - */ - private $numExecutedLines = -1; - - /** - * @var int - */ - private $numClasses = -1; - - /** - * @var int - */ - private $numTestedClasses = -1; - - /** - * @var int - */ - private $numTraits = -1; - - /** - * @var int - */ - private $numTestedTraits = -1; - - /** - * @var int - */ - private $numMethods = -1; - - /** - * @var int - */ - private $numTestedMethods = -1; - - /** - * @var int - */ - private $numFunctions = -1; - - /** - * @var int - */ - private $numTestedFunctions = -1; - - /** - * Returns the number of files in/under this node. - */ - public function count(): int - { - if ($this->numFiles === -1) { - $this->numFiles = 0; - - foreach ($this->children as $child) { - $this->numFiles += \count($child); - } - } - - return $this->numFiles; - } - - /** - * Returns an iterator for this node. - */ - public function getIterator(): \RecursiveIteratorIterator - { - return new \RecursiveIteratorIterator( - new Iterator($this), - \RecursiveIteratorIterator::SELF_FIRST - ); - } - - /** - * Adds a new directory. - */ - public function addDirectory(string $name): self - { - $directory = new self($name, $this); - - $this->children[] = $directory; - $this->directories[] = &$this->children[\count($this->children) - 1]; - - return $directory; - } - - /** - * Adds a new file. - * - * @throws InvalidArgumentException - */ - public function addFile(string $name, array $coverageData, array $testData, bool $cacheTokens): File - { - $file = new File($name, $this, $coverageData, $testData, $cacheTokens); - - $this->children[] = $file; - $this->files[] = &$this->children[\count($this->children) - 1]; - - $this->numExecutableLines = -1; - $this->numExecutedLines = -1; - - return $file; - } - - /** - * Returns the directories in this directory. - */ - public function getDirectories(): array - { - return $this->directories; - } - - /** - * Returns the files in this directory. - */ - public function getFiles(): array - { - return $this->files; - } - - /** - * Returns the child nodes of this node. - */ - public function getChildNodes(): array - { - return $this->children; - } - - /** - * Returns the classes of this node. - */ - public function getClasses(): array - { - if ($this->classes === null) { - $this->classes = []; - - foreach ($this->children as $child) { - $this->classes = \array_merge( - $this->classes, - $child->getClasses() - ); - } - } - - return $this->classes; - } - - /** - * Returns the traits of this node. - */ - public function getTraits(): array - { - if ($this->traits === null) { - $this->traits = []; - - foreach ($this->children as $child) { - $this->traits = \array_merge( - $this->traits, - $child->getTraits() - ); - } - } - - return $this->traits; - } - - /** - * Returns the functions of this node. - */ - public function getFunctions(): array - { - if ($this->functions === null) { - $this->functions = []; - - foreach ($this->children as $child) { - $this->functions = \array_merge( - $this->functions, - $child->getFunctions() - ); - } - } - - return $this->functions; - } - - /** - * Returns the LOC/CLOC/NCLOC of this node. - */ - public function getLinesOfCode(): array - { - if ($this->linesOfCode === null) { - $this->linesOfCode = ['loc' => 0, 'cloc' => 0, 'ncloc' => 0]; - - foreach ($this->children as $child) { - $linesOfCode = $child->getLinesOfCode(); - - $this->linesOfCode['loc'] += $linesOfCode['loc']; - $this->linesOfCode['cloc'] += $linesOfCode['cloc']; - $this->linesOfCode['ncloc'] += $linesOfCode['ncloc']; - } - } - - return $this->linesOfCode; - } - - /** - * Returns the number of executable lines. - */ - public function getNumExecutableLines(): int - { - if ($this->numExecutableLines === -1) { - $this->numExecutableLines = 0; - - foreach ($this->children as $child) { - $this->numExecutableLines += $child->getNumExecutableLines(); - } - } - - return $this->numExecutableLines; - } - - /** - * Returns the number of executed lines. - */ - public function getNumExecutedLines(): int - { - if ($this->numExecutedLines === -1) { - $this->numExecutedLines = 0; - - foreach ($this->children as $child) { - $this->numExecutedLines += $child->getNumExecutedLines(); - } - } - - return $this->numExecutedLines; - } - - /** - * Returns the number of classes. - */ - public function getNumClasses(): int - { - if ($this->numClasses === -1) { - $this->numClasses = 0; - - foreach ($this->children as $child) { - $this->numClasses += $child->getNumClasses(); - } - } - - return $this->numClasses; - } - - /** - * Returns the number of tested classes. - */ - public function getNumTestedClasses(): int - { - if ($this->numTestedClasses === -1) { - $this->numTestedClasses = 0; - - foreach ($this->children as $child) { - $this->numTestedClasses += $child->getNumTestedClasses(); - } - } - - return $this->numTestedClasses; - } - - /** - * Returns the number of traits. - */ - public function getNumTraits(): int - { - if ($this->numTraits === -1) { - $this->numTraits = 0; - - foreach ($this->children as $child) { - $this->numTraits += $child->getNumTraits(); - } - } - - return $this->numTraits; - } - - /** - * Returns the number of tested traits. - */ - public function getNumTestedTraits(): int - { - if ($this->numTestedTraits === -1) { - $this->numTestedTraits = 0; - - foreach ($this->children as $child) { - $this->numTestedTraits += $child->getNumTestedTraits(); - } - } - - return $this->numTestedTraits; - } - - /** - * Returns the number of methods. - */ - public function getNumMethods(): int - { - if ($this->numMethods === -1) { - $this->numMethods = 0; - - foreach ($this->children as $child) { - $this->numMethods += $child->getNumMethods(); - } - } - - return $this->numMethods; - } - - /** - * Returns the number of tested methods. - */ - public function getNumTestedMethods(): int - { - if ($this->numTestedMethods === -1) { - $this->numTestedMethods = 0; - - foreach ($this->children as $child) { - $this->numTestedMethods += $child->getNumTestedMethods(); - } - } - - return $this->numTestedMethods; - } - - /** - * Returns the number of functions. - */ - public function getNumFunctions(): int - { - if ($this->numFunctions === -1) { - $this->numFunctions = 0; - - foreach ($this->children as $child) { - $this->numFunctions += $child->getNumFunctions(); - } - } - - return $this->numFunctions; - } - - /** - * Returns the number of tested functions. - */ - public function getNumTestedFunctions(): int - { - if ($this->numTestedFunctions === -1) { - $this->numTestedFunctions = 0; - - foreach ($this->children as $child) { - $this->numTestedFunctions += $child->getNumTestedFunctions(); - } - } - - return $this->numTestedFunctions; - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Node/File.php b/vendor/phpunit/php-code-coverage/src/Node/File.php deleted file mode 100644 index 840d119..0000000 --- a/vendor/phpunit/php-code-coverage/src/Node/File.php +++ /dev/null @@ -1,611 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Node; - -/** - * Represents a file in the code coverage information tree. - */ -final class File extends AbstractNode -{ - /** - * @var array - */ - private $coverageData; - - /** - * @var array - */ - private $testData; - - /** - * @var int - */ - private $numExecutableLines = 0; - - /** - * @var int - */ - private $numExecutedLines = 0; - - /** - * @var array - */ - private $classes = []; - - /** - * @var array - */ - private $traits = []; - - /** - * @var array - */ - private $functions = []; - - /** - * @var array - */ - private $linesOfCode = []; - - /** - * @var int - */ - private $numClasses; - - /** - * @var int - */ - private $numTestedClasses = 0; - - /** - * @var int - */ - private $numTraits; - - /** - * @var int - */ - private $numTestedTraits = 0; - - /** - * @var int - */ - private $numMethods; - - /** - * @var int - */ - private $numTestedMethods; - - /** - * @var int - */ - private $numTestedFunctions; - - /** - * @var bool - */ - private $cacheTokens; - - /** - * @var array - */ - private $codeUnitsByLine = []; - - public function __construct(string $name, AbstractNode $parent, array $coverageData, array $testData, bool $cacheTokens) - { - parent::__construct($name, $parent); - - $this->coverageData = $coverageData; - $this->testData = $testData; - $this->cacheTokens = $cacheTokens; - - $this->calculateStatistics(); - } - - /** - * Returns the number of files in/under this node. - */ - public function count(): int - { - return 1; - } - - /** - * Returns the code coverage data of this node. - */ - public function getCoverageData(): array - { - return $this->coverageData; - } - - /** - * Returns the test data of this node. - */ - public function getTestData(): array - { - return $this->testData; - } - - /** - * Returns the classes of this node. - */ - public function getClasses(): array - { - return $this->classes; - } - - /** - * Returns the traits of this node. - */ - public function getTraits(): array - { - return $this->traits; - } - - /** - * Returns the functions of this node. - */ - public function getFunctions(): array - { - return $this->functions; - } - - /** - * Returns the LOC/CLOC/NCLOC of this node. - */ - public function getLinesOfCode(): array - { - return $this->linesOfCode; - } - - /** - * Returns the number of executable lines. - */ - public function getNumExecutableLines(): int - { - return $this->numExecutableLines; - } - - /** - * Returns the number of executed lines. - */ - public function getNumExecutedLines(): int - { - return $this->numExecutedLines; - } - - /** - * Returns the number of classes. - */ - public function getNumClasses(): int - { - if ($this->numClasses === null) { - $this->numClasses = 0; - - foreach ($this->classes as $class) { - foreach ($class['methods'] as $method) { - if ($method['executableLines'] > 0) { - $this->numClasses++; - - continue 2; - } - } - } - } - - return $this->numClasses; - } - - /** - * Returns the number of tested classes. - */ - public function getNumTestedClasses(): int - { - return $this->numTestedClasses; - } - - /** - * Returns the number of traits. - */ - public function getNumTraits(): int - { - if ($this->numTraits === null) { - $this->numTraits = 0; - - foreach ($this->traits as $trait) { - foreach ($trait['methods'] as $method) { - if ($method['executableLines'] > 0) { - $this->numTraits++; - - continue 2; - } - } - } - } - - return $this->numTraits; - } - - /** - * Returns the number of tested traits. - */ - public function getNumTestedTraits(): int - { - return $this->numTestedTraits; - } - - /** - * Returns the number of methods. - */ - public function getNumMethods(): int - { - if ($this->numMethods === null) { - $this->numMethods = 0; - - foreach ($this->classes as $class) { - foreach ($class['methods'] as $method) { - if ($method['executableLines'] > 0) { - $this->numMethods++; - } - } - } - - foreach ($this->traits as $trait) { - foreach ($trait['methods'] as $method) { - if ($method['executableLines'] > 0) { - $this->numMethods++; - } - } - } - } - - return $this->numMethods; - } - - /** - * Returns the number of tested methods. - */ - public function getNumTestedMethods(): int - { - if ($this->numTestedMethods === null) { - $this->numTestedMethods = 0; - - foreach ($this->classes as $class) { - foreach ($class['methods'] as $method) { - if ($method['executableLines'] > 0 && - $method['coverage'] === 100) { - $this->numTestedMethods++; - } - } - } - - foreach ($this->traits as $trait) { - foreach ($trait['methods'] as $method) { - if ($method['executableLines'] > 0 && - $method['coverage'] === 100) { - $this->numTestedMethods++; - } - } - } - } - - return $this->numTestedMethods; - } - - /** - * Returns the number of functions. - */ - public function getNumFunctions(): int - { - return \count($this->functions); - } - - /** - * Returns the number of tested functions. - */ - public function getNumTestedFunctions(): int - { - if ($this->numTestedFunctions === null) { - $this->numTestedFunctions = 0; - - foreach ($this->functions as $function) { - if ($function['executableLines'] > 0 && - $function['coverage'] === 100) { - $this->numTestedFunctions++; - } - } - } - - return $this->numTestedFunctions; - } - - private function calculateStatistics(): void - { - if ($this->cacheTokens) { - $tokens = \PHP_Token_Stream_CachingFactory::get($this->getPath()); - } else { - $tokens = new \PHP_Token_Stream($this->getPath()); - } - - $this->linesOfCode = $tokens->getLinesOfCode(); - - foreach (\range(1, $this->linesOfCode['loc']) as $lineNumber) { - $this->codeUnitsByLine[$lineNumber] = []; - } - - try { - $this->processClasses($tokens); - $this->processTraits($tokens); - $this->processFunctions($tokens); - } catch (\OutOfBoundsException $e) { - // This can happen with PHP_Token_Stream if the file is syntactically invalid, - // and probably affects a file that wasn't executed. - } - unset($tokens); - - foreach (\range(1, $this->linesOfCode['loc']) as $lineNumber) { - if (isset($this->coverageData[$lineNumber])) { - foreach ($this->codeUnitsByLine[$lineNumber] as &$codeUnit) { - $codeUnit['executableLines']++; - } - - unset($codeUnit); - - $this->numExecutableLines++; - - if (\count($this->coverageData[$lineNumber]) > 0) { - foreach ($this->codeUnitsByLine[$lineNumber] as &$codeUnit) { - $codeUnit['executedLines']++; - } - - unset($codeUnit); - - $this->numExecutedLines++; - } - } - } - - foreach ($this->traits as &$trait) { - foreach ($trait['methods'] as &$method) { - if ($method['executableLines'] > 0) { - $method['coverage'] = ($method['executedLines'] / - $method['executableLines']) * 100; - } else { - $method['coverage'] = 100; - } - - $method['crap'] = $this->crap( - $method['ccn'], - $method['coverage'] - ); - - $trait['ccn'] += $method['ccn']; - } - - unset($method); - - if ($trait['executableLines'] > 0) { - $trait['coverage'] = ($trait['executedLines'] / - $trait['executableLines']) * 100; - - if ($trait['coverage'] === 100) { - $this->numTestedClasses++; - } - } else { - $trait['coverage'] = 100; - } - - $trait['crap'] = $this->crap( - $trait['ccn'], - $trait['coverage'] - ); - } - - unset($trait); - - foreach ($this->classes as &$class) { - foreach ($class['methods'] as &$method) { - if ($method['executableLines'] > 0) { - $method['coverage'] = ($method['executedLines'] / - $method['executableLines']) * 100; - } else { - $method['coverage'] = 100; - } - - $method['crap'] = $this->crap( - $method['ccn'], - $method['coverage'] - ); - - $class['ccn'] += $method['ccn']; - } - - unset($method); - - if ($class['executableLines'] > 0) { - $class['coverage'] = ($class['executedLines'] / - $class['executableLines']) * 100; - - if ($class['coverage'] === 100) { - $this->numTestedClasses++; - } - } else { - $class['coverage'] = 100; - } - - $class['crap'] = $this->crap( - $class['ccn'], - $class['coverage'] - ); - } - - unset($class); - - foreach ($this->functions as &$function) { - if ($function['executableLines'] > 0) { - $function['coverage'] = ($function['executedLines'] / - $function['executableLines']) * 100; - } else { - $function['coverage'] = 100; - } - - if ($function['coverage'] === 100) { - $this->numTestedFunctions++; - } - - $function['crap'] = $this->crap( - $function['ccn'], - $function['coverage'] - ); - } - } - - private function processClasses(\PHP_Token_Stream $tokens): void - { - $classes = $tokens->getClasses(); - $link = $this->getId() . '.html#'; - - foreach ($classes as $className => $class) { - if (\strpos($className, 'anonymous') === 0) { - continue; - } - - if (!empty($class['package']['namespace'])) { - $className = $class['package']['namespace'] . '\\' . $className; - } - - $this->classes[$className] = [ - 'className' => $className, - 'methods' => [], - 'startLine' => $class['startLine'], - 'executableLines' => 0, - 'executedLines' => 0, - 'ccn' => 0, - 'coverage' => 0, - 'crap' => 0, - 'package' => $class['package'], - 'link' => $link . $class['startLine'], - ]; - - foreach ($class['methods'] as $methodName => $method) { - if (\strpos($methodName, 'anonymous') === 0) { - continue; - } - - $this->classes[$className]['methods'][$methodName] = $this->newMethod($methodName, $method, $link); - - foreach (\range($method['startLine'], $method['endLine']) as $lineNumber) { - $this->codeUnitsByLine[$lineNumber] = [ - &$this->classes[$className], - &$this->classes[$className]['methods'][$methodName], - ]; - } - } - } - } - - private function processTraits(\PHP_Token_Stream $tokens): void - { - $traits = $tokens->getTraits(); - $link = $this->getId() . '.html#'; - - foreach ($traits as $traitName => $trait) { - $this->traits[$traitName] = [ - 'traitName' => $traitName, - 'methods' => [], - 'startLine' => $trait['startLine'], - 'executableLines' => 0, - 'executedLines' => 0, - 'ccn' => 0, - 'coverage' => 0, - 'crap' => 0, - 'package' => $trait['package'], - 'link' => $link . $trait['startLine'], - ]; - - foreach ($trait['methods'] as $methodName => $method) { - if (\strpos($methodName, 'anonymous') === 0) { - continue; - } - - $this->traits[$traitName]['methods'][$methodName] = $this->newMethod($methodName, $method, $link); - - foreach (\range($method['startLine'], $method['endLine']) as $lineNumber) { - $this->codeUnitsByLine[$lineNumber] = [ - &$this->traits[$traitName], - &$this->traits[$traitName]['methods'][$methodName], - ]; - } - } - } - } - - private function processFunctions(\PHP_Token_Stream $tokens): void - { - $functions = $tokens->getFunctions(); - $link = $this->getId() . '.html#'; - - foreach ($functions as $functionName => $function) { - if (\strpos($functionName, 'anonymous') === 0) { - continue; - } - - $this->functions[$functionName] = [ - 'functionName' => $functionName, - 'signature' => $function['signature'], - 'startLine' => $function['startLine'], - 'executableLines' => 0, - 'executedLines' => 0, - 'ccn' => $function['ccn'], - 'coverage' => 0, - 'crap' => 0, - 'link' => $link . $function['startLine'], - ]; - - foreach (\range($function['startLine'], $function['endLine']) as $lineNumber) { - $this->codeUnitsByLine[$lineNumber] = [&$this->functions[$functionName]]; - } - } - } - - private function crap(int $ccn, float $coverage): string - { - if ($coverage === 0.0) { - return (string) ($ccn ** 2 + $ccn); - } - - if ($coverage >= 95) { - return (string) $ccn; - } - - return \sprintf( - '%01.2F', - $ccn ** 2 * (1 - $coverage / 100) ** 3 + $ccn - ); - } - - private function newMethod(string $methodName, array $method, string $link): array - { - return [ - 'methodName' => $methodName, - 'visibility' => $method['visibility'], - 'signature' => $method['signature'], - 'startLine' => $method['startLine'], - 'endLine' => $method['endLine'], - 'executableLines' => 0, - 'executedLines' => 0, - 'ccn' => $method['ccn'], - 'coverage' => 0, - 'crap' => 0, - 'link' => $link . $method['startLine'], - ]; - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Node/Iterator.php b/vendor/phpunit/php-code-coverage/src/Node/Iterator.php deleted file mode 100644 index f2dd9a7..0000000 --- a/vendor/phpunit/php-code-coverage/src/Node/Iterator.php +++ /dev/null @@ -1,89 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Node; - -/** - * Recursive iterator for node object graphs. - */ -final class Iterator implements \RecursiveIterator -{ - /** - * @var int - */ - private $position; - - /** - * @var AbstractNode[] - */ - private $nodes; - - public function __construct(Directory $node) - { - $this->nodes = $node->getChildNodes(); - } - - /** - * Rewinds the Iterator to the first element. - */ - public function rewind(): void - { - $this->position = 0; - } - - /** - * Checks if there is a current element after calls to rewind() or next(). - */ - public function valid(): bool - { - return $this->position < \count($this->nodes); - } - - /** - * Returns the key of the current element. - */ - public function key(): int - { - return $this->position; - } - - /** - * Returns the current element. - */ - public function current(): AbstractNode - { - return $this->valid() ? $this->nodes[$this->position] : null; - } - - /** - * Moves forward to next element. - */ - public function next(): void - { - $this->position++; - } - - /** - * Returns the sub iterator for the current element. - * - * @return Iterator - */ - public function getChildren(): self - { - return new self($this->nodes[$this->position]); - } - - /** - * Checks whether the current element has children. - */ - public function hasChildren(): bool - { - return $this->nodes[$this->position] instanceof Directory; - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Clover.php b/vendor/phpunit/php-code-coverage/src/Report/Clover.php deleted file mode 100644 index e0f893c..0000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Clover.php +++ /dev/null @@ -1,258 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Report; - -use SebastianBergmann\CodeCoverage\CodeCoverage; -use SebastianBergmann\CodeCoverage\Node\File; -use SebastianBergmann\CodeCoverage\RuntimeException; - -/** - * Generates a Clover XML logfile from a code coverage object. - */ -final class Clover -{ - /** - * @throws \RuntimeException - */ - public function process(CodeCoverage $coverage, ?string $target = null, ?string $name = null): string - { - $xmlDocument = new \DOMDocument('1.0', 'UTF-8'); - $xmlDocument->formatOutput = true; - - $xmlCoverage = $xmlDocument->createElement('coverage'); - $xmlCoverage->setAttribute('generated', (string) $_SERVER['REQUEST_TIME']); - $xmlDocument->appendChild($xmlCoverage); - - $xmlProject = $xmlDocument->createElement('project'); - $xmlProject->setAttribute('timestamp', (string) $_SERVER['REQUEST_TIME']); - - if (\is_string($name)) { - $xmlProject->setAttribute('name', $name); - } - - $xmlCoverage->appendChild($xmlProject); - - $packages = []; - $report = $coverage->getReport(); - - foreach ($report as $item) { - if (!$item instanceof File) { - continue; - } - - /* @var File $item */ - - $xmlFile = $xmlDocument->createElement('file'); - $xmlFile->setAttribute('name', $item->getPath()); - - $classes = $item->getClassesAndTraits(); - $coverageData = $item->getCoverageData(); - $lines = []; - $namespace = 'global'; - - foreach ($classes as $className => $class) { - $classStatements = 0; - $coveredClassStatements = 0; - $coveredMethods = 0; - $classMethods = 0; - - foreach ($class['methods'] as $methodName => $method) { - if ($method['executableLines'] == 0) { - continue; - } - - $classMethods++; - $classStatements += $method['executableLines']; - $coveredClassStatements += $method['executedLines']; - - if ($method['coverage'] == 100) { - $coveredMethods++; - } - - $methodCount = 0; - - foreach (\range($method['startLine'], $method['endLine']) as $line) { - if (isset($coverageData[$line]) && ($coverageData[$line] !== null)) { - $methodCount = \max($methodCount, \count($coverageData[$line])); - } - } - - $lines[$method['startLine']] = [ - 'ccn' => $method['ccn'], - 'count' => $methodCount, - 'crap' => $method['crap'], - 'type' => 'method', - 'visibility' => $method['visibility'], - 'name' => $methodName, - ]; - } - - if (!empty($class['package']['namespace'])) { - $namespace = $class['package']['namespace']; - } - - $xmlClass = $xmlDocument->createElement('class'); - $xmlClass->setAttribute('name', $className); - $xmlClass->setAttribute('namespace', $namespace); - - if (!empty($class['package']['fullPackage'])) { - $xmlClass->setAttribute( - 'fullPackage', - $class['package']['fullPackage'] - ); - } - - if (!empty($class['package']['category'])) { - $xmlClass->setAttribute( - 'category', - $class['package']['category'] - ); - } - - if (!empty($class['package']['package'])) { - $xmlClass->setAttribute( - 'package', - $class['package']['package'] - ); - } - - if (!empty($class['package']['subpackage'])) { - $xmlClass->setAttribute( - 'subpackage', - $class['package']['subpackage'] - ); - } - - $xmlFile->appendChild($xmlClass); - - $xmlMetrics = $xmlDocument->createElement('metrics'); - $xmlMetrics->setAttribute('complexity', (string) $class['ccn']); - $xmlMetrics->setAttribute('methods', (string) $classMethods); - $xmlMetrics->setAttribute('coveredmethods', (string) $coveredMethods); - $xmlMetrics->setAttribute('conditionals', '0'); - $xmlMetrics->setAttribute('coveredconditionals', '0'); - $xmlMetrics->setAttribute('statements', (string) $classStatements); - $xmlMetrics->setAttribute('coveredstatements', (string) $coveredClassStatements); - $xmlMetrics->setAttribute('elements', (string) ($classMethods + $classStatements /* + conditionals */)); - $xmlMetrics->setAttribute('coveredelements', (string) ($coveredMethods + $coveredClassStatements /* + coveredconditionals */)); - $xmlClass->appendChild($xmlMetrics); - } - - foreach ($coverageData as $line => $data) { - if ($data === null || isset($lines[$line])) { - continue; - } - - $lines[$line] = [ - 'count' => \count($data), 'type' => 'stmt', - ]; - } - - \ksort($lines); - - foreach ($lines as $line => $data) { - $xmlLine = $xmlDocument->createElement('line'); - $xmlLine->setAttribute('num', (string) $line); - $xmlLine->setAttribute('type', $data['type']); - - if (isset($data['name'])) { - $xmlLine->setAttribute('name', $data['name']); - } - - if (isset($data['visibility'])) { - $xmlLine->setAttribute('visibility', $data['visibility']); - } - - if (isset($data['ccn'])) { - $xmlLine->setAttribute('complexity', (string) $data['ccn']); - } - - if (isset($data['crap'])) { - $xmlLine->setAttribute('crap', (string) $data['crap']); - } - - $xmlLine->setAttribute('count', (string) $data['count']); - $xmlFile->appendChild($xmlLine); - } - - $linesOfCode = $item->getLinesOfCode(); - - $xmlMetrics = $xmlDocument->createElement('metrics'); - $xmlMetrics->setAttribute('loc', (string) $linesOfCode['loc']); - $xmlMetrics->setAttribute('ncloc', (string) $linesOfCode['ncloc']); - $xmlMetrics->setAttribute('classes', (string) $item->getNumClassesAndTraits()); - $xmlMetrics->setAttribute('methods', (string) $item->getNumMethods()); - $xmlMetrics->setAttribute('coveredmethods', (string) $item->getNumTestedMethods()); - $xmlMetrics->setAttribute('conditionals', '0'); - $xmlMetrics->setAttribute('coveredconditionals', '0'); - $xmlMetrics->setAttribute('statements', (string) $item->getNumExecutableLines()); - $xmlMetrics->setAttribute('coveredstatements', (string) $item->getNumExecutedLines()); - $xmlMetrics->setAttribute('elements', (string) ($item->getNumMethods() + $item->getNumExecutableLines() /* + conditionals */)); - $xmlMetrics->setAttribute('coveredelements', (string) ($item->getNumTestedMethods() + $item->getNumExecutedLines() /* + coveredconditionals */)); - $xmlFile->appendChild($xmlMetrics); - - if ($namespace === 'global') { - $xmlProject->appendChild($xmlFile); - } else { - if (!isset($packages[$namespace])) { - $packages[$namespace] = $xmlDocument->createElement( - 'package' - ); - - $packages[$namespace]->setAttribute('name', $namespace); - $xmlProject->appendChild($packages[$namespace]); - } - - $packages[$namespace]->appendChild($xmlFile); - } - } - - $linesOfCode = $report->getLinesOfCode(); - - $xmlMetrics = $xmlDocument->createElement('metrics'); - $xmlMetrics->setAttribute('files', (string) \count($report)); - $xmlMetrics->setAttribute('loc', (string) $linesOfCode['loc']); - $xmlMetrics->setAttribute('ncloc', (string) $linesOfCode['ncloc']); - $xmlMetrics->setAttribute('classes', (string) $report->getNumClassesAndTraits()); - $xmlMetrics->setAttribute('methods', (string) $report->getNumMethods()); - $xmlMetrics->setAttribute('coveredmethods', (string) $report->getNumTestedMethods()); - $xmlMetrics->setAttribute('conditionals', '0'); - $xmlMetrics->setAttribute('coveredconditionals', '0'); - $xmlMetrics->setAttribute('statements', (string) $report->getNumExecutableLines()); - $xmlMetrics->setAttribute('coveredstatements', (string) $report->getNumExecutedLines()); - $xmlMetrics->setAttribute('elements', (string) ($report->getNumMethods() + $report->getNumExecutableLines() /* + conditionals */)); - $xmlMetrics->setAttribute('coveredelements', (string) ($report->getNumTestedMethods() + $report->getNumExecutedLines() /* + coveredconditionals */)); - $xmlProject->appendChild($xmlMetrics); - - $buffer = $xmlDocument->saveXML(); - - if ($target !== null) { - if (!$this->createDirectory(\dirname($target))) { - throw new \RuntimeException(\sprintf('Directory "%s" was not created', \dirname($target))); - } - - if (@\file_put_contents($target, $buffer) === false) { - throw new RuntimeException( - \sprintf( - 'Could not write to "%s', - $target - ) - ); - } - } - - return $buffer; - } - - private function createDirectory(string $directory): bool - { - return !(!\is_dir($directory) && !@\mkdir($directory, 0777, true) && !\is_dir($directory)); - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Crap4j.php b/vendor/phpunit/php-code-coverage/src/Report/Crap4j.php deleted file mode 100644 index 6713be0..0000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Crap4j.php +++ /dev/null @@ -1,165 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Report; - -use SebastianBergmann\CodeCoverage\CodeCoverage; -use SebastianBergmann\CodeCoverage\Node\File; -use SebastianBergmann\CodeCoverage\RuntimeException; - -final class Crap4j -{ - /** - * @var int - */ - private $threshold; - - public function __construct(int $threshold = 30) - { - $this->threshold = $threshold; - } - - /** - * @throws \RuntimeException - */ - public function process(CodeCoverage $coverage, ?string $target = null, ?string $name = null): string - { - $document = new \DOMDocument('1.0', 'UTF-8'); - $document->formatOutput = true; - - $root = $document->createElement('crap_result'); - $document->appendChild($root); - - $project = $document->createElement('project', \is_string($name) ? $name : ''); - $root->appendChild($project); - $root->appendChild($document->createElement('timestamp', \date('Y-m-d H:i:s', $_SERVER['REQUEST_TIME']))); - - $stats = $document->createElement('stats'); - $methodsNode = $document->createElement('methods'); - - $report = $coverage->getReport(); - unset($coverage); - - $fullMethodCount = 0; - $fullCrapMethodCount = 0; - $fullCrapLoad = 0; - $fullCrap = 0; - - foreach ($report as $item) { - $namespace = 'global'; - - if (!$item instanceof File) { - continue; - } - - $file = $document->createElement('file'); - $file->setAttribute('name', $item->getPath()); - - $classes = $item->getClassesAndTraits(); - - foreach ($classes as $className => $class) { - foreach ($class['methods'] as $methodName => $method) { - $crapLoad = $this->getCrapLoad($method['crap'], $method['ccn'], $method['coverage']); - - $fullCrap += $method['crap']; - $fullCrapLoad += $crapLoad; - $fullMethodCount++; - - if ($method['crap'] >= $this->threshold) { - $fullCrapMethodCount++; - } - - $methodNode = $document->createElement('method'); - - if (!empty($class['package']['namespace'])) { - $namespace = $class['package']['namespace']; - } - - $methodNode->appendChild($document->createElement('package', $namespace)); - $methodNode->appendChild($document->createElement('className', $className)); - $methodNode->appendChild($document->createElement('methodName', $methodName)); - $methodNode->appendChild($document->createElement('methodSignature', \htmlspecialchars($method['signature']))); - $methodNode->appendChild($document->createElement('fullMethod', \htmlspecialchars($method['signature']))); - $methodNode->appendChild($document->createElement('crap', (string) $this->roundValue($method['crap']))); - $methodNode->appendChild($document->createElement('complexity', (string) $method['ccn'])); - $methodNode->appendChild($document->createElement('coverage', (string) $this->roundValue($method['coverage']))); - $methodNode->appendChild($document->createElement('crapLoad', (string) \round($crapLoad))); - - $methodsNode->appendChild($methodNode); - } - } - } - - $stats->appendChild($document->createElement('name', 'Method Crap Stats')); - $stats->appendChild($document->createElement('methodCount', (string) $fullMethodCount)); - $stats->appendChild($document->createElement('crapMethodCount', (string) $fullCrapMethodCount)); - $stats->appendChild($document->createElement('crapLoad', (string) \round($fullCrapLoad))); - $stats->appendChild($document->createElement('totalCrap', (string) $fullCrap)); - - $crapMethodPercent = 0; - - if ($fullMethodCount > 0) { - $crapMethodPercent = $this->roundValue((100 * $fullCrapMethodCount) / $fullMethodCount); - } - - $stats->appendChild($document->createElement('crapMethodPercent', (string) $crapMethodPercent)); - - $root->appendChild($stats); - $root->appendChild($methodsNode); - - $buffer = $document->saveXML(); - - if ($target !== null) { - if (!$this->createDirectory(\dirname($target))) { - throw new \RuntimeException(\sprintf('Directory "%s" was not created', \dirname($target))); - } - - if (@\file_put_contents($target, $buffer) === false) { - throw new RuntimeException( - \sprintf( - 'Could not write to "%s', - $target - ) - ); - } - } - - return $buffer; - } - - /** - * @param float $crapValue - * @param int $cyclomaticComplexity - * @param float $coveragePercent - */ - private function getCrapLoad($crapValue, $cyclomaticComplexity, $coveragePercent): float - { - $crapLoad = 0; - - if ($crapValue >= $this->threshold) { - $crapLoad += $cyclomaticComplexity * (1.0 - $coveragePercent / 100); - $crapLoad += $cyclomaticComplexity / $this->threshold; - } - - return $crapLoad; - } - - /** - * @param float $value - */ - private function roundValue($value): float - { - return \round($value, 2); - } - - private function createDirectory(string $directory): bool - { - return !(!\is_dir($directory) && !@\mkdir($directory, 0777, true) && !\is_dir($directory)); - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Facade.php b/vendor/phpunit/php-code-coverage/src/Report/Html/Facade.php deleted file mode 100644 index 318b49a..0000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Facade.php +++ /dev/null @@ -1,167 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Report\Html; - -use SebastianBergmann\CodeCoverage\CodeCoverage; -use SebastianBergmann\CodeCoverage\Node\Directory as DirectoryNode; -use SebastianBergmann\CodeCoverage\RuntimeException; - -/** - * Generates an HTML report from a code coverage object. - */ -final class Facade -{ - /** - * @var string - */ - private $templatePath; - - /** - * @var string - */ - private $generator; - - /** - * @var int - */ - private $lowUpperBound; - - /** - * @var int - */ - private $highLowerBound; - - public function __construct(int $lowUpperBound = 50, int $highLowerBound = 90, string $generator = '') - { - $this->generator = $generator; - $this->highLowerBound = $highLowerBound; - $this->lowUpperBound = $lowUpperBound; - $this->templatePath = __DIR__ . '/Renderer/Template/'; - } - - /** - * @throws RuntimeException - * @throws \InvalidArgumentException - * @throws \RuntimeException - */ - public function process(CodeCoverage $coverage, string $target): void - { - $target = $this->getDirectory($target); - $report = $coverage->getReport(); - - if (!isset($_SERVER['REQUEST_TIME'])) { - $_SERVER['REQUEST_TIME'] = \time(); - } - - $date = \date('D M j G:i:s T Y', $_SERVER['REQUEST_TIME']); - - $dashboard = new Dashboard( - $this->templatePath, - $this->generator, - $date, - $this->lowUpperBound, - $this->highLowerBound - ); - - $directory = new Directory( - $this->templatePath, - $this->generator, - $date, - $this->lowUpperBound, - $this->highLowerBound - ); - - $file = new File( - $this->templatePath, - $this->generator, - $date, - $this->lowUpperBound, - $this->highLowerBound - ); - - $directory->render($report, $target . 'index.html'); - $dashboard->render($report, $target . 'dashboard.html'); - - foreach ($report as $node) { - $id = $node->getId(); - - if ($node instanceof DirectoryNode) { - if (!$this->createDirectory($target . $id)) { - throw new \RuntimeException(\sprintf('Directory "%s" was not created', $target . $id)); - } - - $directory->render($node, $target . $id . '/index.html'); - $dashboard->render($node, $target . $id . '/dashboard.html'); - } else { - $dir = \dirname($target . $id); - - if (!$this->createDirectory($dir)) { - throw new \RuntimeException(\sprintf('Directory "%s" was not created', $dir)); - } - - $file->render($node, $target . $id . '.html'); - } - } - - $this->copyFiles($target); - } - - /** - * @throws RuntimeException - */ - private function copyFiles(string $target): void - { - $dir = $this->getDirectory($target . '_css'); - - \copy($this->templatePath . 'css/bootstrap.min.css', $dir . 'bootstrap.min.css'); - \copy($this->templatePath . 'css/nv.d3.min.css', $dir . 'nv.d3.min.css'); - \copy($this->templatePath . 'css/style.css', $dir . 'style.css'); - \copy($this->templatePath . 'css/custom.css', $dir . 'custom.css'); - \copy($this->templatePath . 'css/octicons.css', $dir . 'octicons.css'); - - $dir = $this->getDirectory($target . '_icons'); - \copy($this->templatePath . 'icons/file-code.svg', $dir . 'file-code.svg'); - \copy($this->templatePath . 'icons/file-directory.svg', $dir . 'file-directory.svg'); - - $dir = $this->getDirectory($target . '_js'); - \copy($this->templatePath . 'js/bootstrap.min.js', $dir . 'bootstrap.min.js'); - \copy($this->templatePath . 'js/popper.min.js', $dir . 'popper.min.js'); - \copy($this->templatePath . 'js/d3.min.js', $dir . 'd3.min.js'); - \copy($this->templatePath . 'js/jquery.min.js', $dir . 'jquery.min.js'); - \copy($this->templatePath . 'js/nv.d3.min.js', $dir . 'nv.d3.min.js'); - \copy($this->templatePath . 'js/file.js', $dir . 'file.js'); - } - - /** - * @throws RuntimeException - */ - private function getDirectory(string $directory): string - { - if (\substr($directory, -1, 1) != \DIRECTORY_SEPARATOR) { - $directory .= \DIRECTORY_SEPARATOR; - } - - if (!$this->createDirectory($directory)) { - throw new RuntimeException( - \sprintf( - 'Directory "%s" does not exist.', - $directory - ) - ); - } - - return $directory; - } - - private function createDirectory(string $directory): bool - { - return !(!\is_dir($directory) && !@\mkdir($directory, 0777, true) && !\is_dir($directory)); - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer.php b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer.php deleted file mode 100644 index 2a9024c..0000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer.php +++ /dev/null @@ -1,277 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Report\Html; - -use SebastianBergmann\CodeCoverage\Node\AbstractNode; -use SebastianBergmann\CodeCoverage\Node\Directory as DirectoryNode; -use SebastianBergmann\CodeCoverage\Node\File as FileNode; -use SebastianBergmann\CodeCoverage\Version; -use SebastianBergmann\Environment\Runtime; - -/** - * Base class for node renderers. - */ -abstract class Renderer -{ - /** - * @var string - */ - protected $templatePath; - - /** - * @var string - */ - protected $generator; - - /** - * @var string - */ - protected $date; - - /** - * @var int - */ - protected $lowUpperBound; - - /** - * @var int - */ - protected $highLowerBound; - - /** - * @var string - */ - protected $version; - - public function __construct(string $templatePath, string $generator, string $date, int $lowUpperBound, int $highLowerBound) - { - $this->templatePath = $templatePath; - $this->generator = $generator; - $this->date = $date; - $this->lowUpperBound = $lowUpperBound; - $this->highLowerBound = $highLowerBound; - $this->version = Version::id(); - } - - protected function renderItemTemplate(\Text_Template $template, array $data): string - { - $numSeparator = ' / '; - - if (isset($data['numClasses']) && $data['numClasses'] > 0) { - $classesLevel = $this->getColorLevel($data['testedClassesPercent']); - - $classesNumber = $data['numTestedClasses'] . $numSeparator . - $data['numClasses']; - - $classesBar = $this->getCoverageBar( - $data['testedClassesPercent'] - ); - } else { - $classesLevel = ''; - $classesNumber = '0' . $numSeparator . '0'; - $classesBar = ''; - $data['testedClassesPercentAsString'] = 'n/a'; - } - - if ($data['numMethods'] > 0) { - $methodsLevel = $this->getColorLevel($data['testedMethodsPercent']); - - $methodsNumber = $data['numTestedMethods'] . $numSeparator . - $data['numMethods']; - - $methodsBar = $this->getCoverageBar( - $data['testedMethodsPercent'] - ); - } else { - $methodsLevel = ''; - $methodsNumber = '0' . $numSeparator . '0'; - $methodsBar = ''; - $data['testedMethodsPercentAsString'] = 'n/a'; - } - - if ($data['numExecutableLines'] > 0) { - $linesLevel = $this->getColorLevel($data['linesExecutedPercent']); - - $linesNumber = $data['numExecutedLines'] . $numSeparator . - $data['numExecutableLines']; - - $linesBar = $this->getCoverageBar( - $data['linesExecutedPercent'] - ); - } else { - $linesLevel = ''; - $linesNumber = '0' . $numSeparator . '0'; - $linesBar = ''; - $data['linesExecutedPercentAsString'] = 'n/a'; - } - - $template->setVar( - [ - 'icon' => $data['icon'] ?? '', - 'crap' => $data['crap'] ?? '', - 'name' => $data['name'], - 'lines_bar' => $linesBar, - 'lines_executed_percent' => $data['linesExecutedPercentAsString'], - 'lines_level' => $linesLevel, - 'lines_number' => $linesNumber, - 'methods_bar' => $methodsBar, - 'methods_tested_percent' => $data['testedMethodsPercentAsString'], - 'methods_level' => $methodsLevel, - 'methods_number' => $methodsNumber, - 'classes_bar' => $classesBar, - 'classes_tested_percent' => $data['testedClassesPercentAsString'] ?? '', - 'classes_level' => $classesLevel, - 'classes_number' => $classesNumber, - ] - ); - - return $template->render(); - } - - protected function setCommonTemplateVariables(\Text_Template $template, AbstractNode $node): void - { - $template->setVar( - [ - 'id' => $node->getId(), - 'full_path' => $node->getPath(), - 'path_to_root' => $this->getPathToRoot($node), - 'breadcrumbs' => $this->getBreadcrumbs($node), - 'date' => $this->date, - 'version' => $this->version, - 'runtime' => $this->getRuntimeString(), - 'generator' => $this->generator, - 'low_upper_bound' => $this->lowUpperBound, - 'high_lower_bound' => $this->highLowerBound, - ] - ); - } - - protected function getBreadcrumbs(AbstractNode $node): string - { - $breadcrumbs = ''; - $path = $node->getPathAsArray(); - $pathToRoot = []; - $max = \count($path); - - if ($node instanceof FileNode) { - $max--; - } - - for ($i = 0; $i < $max; $i++) { - $pathToRoot[] = \str_repeat('../', $i); - } - - foreach ($path as $step) { - if ($step !== $node) { - $breadcrumbs .= $this->getInactiveBreadcrumb( - $step, - \array_pop($pathToRoot) - ); - } else { - $breadcrumbs .= $this->getActiveBreadcrumb($step); - } - } - - return $breadcrumbs; - } - - protected function getActiveBreadcrumb(AbstractNode $node): string - { - $buffer = \sprintf( - ' ' . "\n", - $node->getName() - ); - - if ($node instanceof DirectoryNode) { - $buffer .= ' ' . "\n"; - } - - return $buffer; - } - - protected function getInactiveBreadcrumb(AbstractNode $node, string $pathToRoot): string - { - return \sprintf( - ' ' . "\n", - $pathToRoot, - $node->getName() - ); - } - - protected function getPathToRoot(AbstractNode $node): string - { - $id = $node->getId(); - $depth = \substr_count($id, '/'); - - if ($id !== 'index' && - $node instanceof DirectoryNode) { - $depth++; - } - - return \str_repeat('../', $depth); - } - - protected function getCoverageBar(float $percent): string - { - $level = $this->getColorLevel($percent); - - $template = new \Text_Template( - $this->templatePath . 'coverage_bar.html', - '{{', - '}}' - ); - - $template->setVar(['level' => $level, 'percent' => \sprintf('%.2F', $percent)]); - - return $template->render(); - } - - protected function getColorLevel(float $percent): string - { - if ($percent <= $this->lowUpperBound) { - return 'danger'; - } - - if ($percent > $this->lowUpperBound && - $percent < $this->highLowerBound) { - return 'warning'; - } - - return 'success'; - } - - private function getRuntimeString(): string - { - $runtime = new Runtime; - - $buffer = \sprintf( - '%s %s', - $runtime->getVendorUrl(), - $runtime->getName(), - $runtime->getVersion() - ); - - if ($runtime->hasXdebug() && !$runtime->hasPHPDBGCodeCoverage()) { - $buffer .= \sprintf( - ' with Xdebug %s', - \phpversion('xdebug') - ); - } - - if ($runtime->hasPCOV() && !$runtime->hasPHPDBGCodeCoverage()) { - $buffer .= \sprintf( - ' with PCOV %s', - \phpversion('pcov') - ); - } - - return $buffer; - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Dashboard.php b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Dashboard.php deleted file mode 100644 index cc801b6..0000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Dashboard.php +++ /dev/null @@ -1,281 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Report\Html; - -use SebastianBergmann\CodeCoverage\Node\AbstractNode; -use SebastianBergmann\CodeCoverage\Node\Directory as DirectoryNode; - -/** - * Renders the dashboard for a directory node. - */ -final class Dashboard extends Renderer -{ - /** - * @throws \InvalidArgumentException - * @throws \RuntimeException - */ - public function render(DirectoryNode $node, string $file): void - { - $classes = $node->getClassesAndTraits(); - $template = new \Text_Template( - $this->templatePath . 'dashboard.html', - '{{', - '}}' - ); - - $this->setCommonTemplateVariables($template, $node); - - $baseLink = $node->getId() . '/'; - $complexity = $this->complexity($classes, $baseLink); - $coverageDistribution = $this->coverageDistribution($classes); - $insufficientCoverage = $this->insufficientCoverage($classes, $baseLink); - $projectRisks = $this->projectRisks($classes, $baseLink); - - $template->setVar( - [ - 'insufficient_coverage_classes' => $insufficientCoverage['class'], - 'insufficient_coverage_methods' => $insufficientCoverage['method'], - 'project_risks_classes' => $projectRisks['class'], - 'project_risks_methods' => $projectRisks['method'], - 'complexity_class' => $complexity['class'], - 'complexity_method' => $complexity['method'], - 'class_coverage_distribution' => $coverageDistribution['class'], - 'method_coverage_distribution' => $coverageDistribution['method'], - ] - ); - - $template->renderTo($file); - } - - /** - * Returns the data for the Class/Method Complexity charts. - */ - protected function complexity(array $classes, string $baseLink): array - { - $result = ['class' => [], 'method' => []]; - - foreach ($classes as $className => $class) { - foreach ($class['methods'] as $methodName => $method) { - if ($className !== '*') { - $methodName = $className . '::' . $methodName; - } - - $result['method'][] = [ - $method['coverage'], - $method['ccn'], - \sprintf( - '%s', - \str_replace($baseLink, '', $method['link']), - $methodName - ), - ]; - } - - $result['class'][] = [ - $class['coverage'], - $class['ccn'], - \sprintf( - '%s', - \str_replace($baseLink, '', $class['link']), - $className - ), - ]; - } - - return [ - 'class' => \json_encode($result['class']), - 'method' => \json_encode($result['method']), - ]; - } - - /** - * Returns the data for the Class / Method Coverage Distribution chart. - */ - protected function coverageDistribution(array $classes): array - { - $result = [ - 'class' => [ - '0%' => 0, - '0-10%' => 0, - '10-20%' => 0, - '20-30%' => 0, - '30-40%' => 0, - '40-50%' => 0, - '50-60%' => 0, - '60-70%' => 0, - '70-80%' => 0, - '80-90%' => 0, - '90-100%' => 0, - '100%' => 0, - ], - 'method' => [ - '0%' => 0, - '0-10%' => 0, - '10-20%' => 0, - '20-30%' => 0, - '30-40%' => 0, - '40-50%' => 0, - '50-60%' => 0, - '60-70%' => 0, - '70-80%' => 0, - '80-90%' => 0, - '90-100%' => 0, - '100%' => 0, - ], - ]; - - foreach ($classes as $class) { - foreach ($class['methods'] as $methodName => $method) { - if ($method['coverage'] === 0) { - $result['method']['0%']++; - } elseif ($method['coverage'] === 100) { - $result['method']['100%']++; - } else { - $key = \floor($method['coverage'] / 10) * 10; - $key = $key . '-' . ($key + 10) . '%'; - $result['method'][$key]++; - } - } - - if ($class['coverage'] === 0) { - $result['class']['0%']++; - } elseif ($class['coverage'] === 100) { - $result['class']['100%']++; - } else { - $key = \floor($class['coverage'] / 10) * 10; - $key = $key . '-' . ($key + 10) . '%'; - $result['class'][$key]++; - } - } - - return [ - 'class' => \json_encode(\array_values($result['class'])), - 'method' => \json_encode(\array_values($result['method'])), - ]; - } - - /** - * Returns the classes / methods with insufficient coverage. - */ - protected function insufficientCoverage(array $classes, string $baseLink): array - { - $leastTestedClasses = []; - $leastTestedMethods = []; - $result = ['class' => '', 'method' => '']; - - foreach ($classes as $className => $class) { - foreach ($class['methods'] as $methodName => $method) { - if ($method['coverage'] < $this->highLowerBound) { - $key = $methodName; - - if ($className !== '*') { - $key = $className . '::' . $methodName; - } - - $leastTestedMethods[$key] = $method['coverage']; - } - } - - if ($class['coverage'] < $this->highLowerBound) { - $leastTestedClasses[$className] = $class['coverage']; - } - } - - \asort($leastTestedClasses); - \asort($leastTestedMethods); - - foreach ($leastTestedClasses as $className => $coverage) { - $result['class'] .= \sprintf( - ' %s%d%%' . "\n", - \str_replace($baseLink, '', $classes[$className]['link']), - $className, - $coverage - ); - } - - foreach ($leastTestedMethods as $methodName => $coverage) { - [$class, $method] = \explode('::', $methodName); - - $result['method'] .= \sprintf( - ' %s%d%%' . "\n", - \str_replace($baseLink, '', $classes[$class]['methods'][$method]['link']), - $methodName, - $method, - $coverage - ); - } - - return $result; - } - - /** - * Returns the project risks according to the CRAP index. - */ - protected function projectRisks(array $classes, string $baseLink): array - { - $classRisks = []; - $methodRisks = []; - $result = ['class' => '', 'method' => '']; - - foreach ($classes as $className => $class) { - foreach ($class['methods'] as $methodName => $method) { - if ($method['coverage'] < $this->highLowerBound && $method['ccn'] > 1) { - $key = $methodName; - - if ($className !== '*') { - $key = $className . '::' . $methodName; - } - - $methodRisks[$key] = $method['crap']; - } - } - - if ($class['coverage'] < $this->highLowerBound && - $class['ccn'] > \count($class['methods'])) { - $classRisks[$className] = $class['crap']; - } - } - - \arsort($classRisks); - \arsort($methodRisks); - - foreach ($classRisks as $className => $crap) { - $result['class'] .= \sprintf( - ' %s%d' . "\n", - \str_replace($baseLink, '', $classes[$className]['link']), - $className, - $crap - ); - } - - foreach ($methodRisks as $methodName => $crap) { - [$class, $method] = \explode('::', $methodName); - - $result['method'] .= \sprintf( - ' %s%d' . "\n", - \str_replace($baseLink, '', $classes[$class]['methods'][$method]['link']), - $methodName, - $method, - $crap - ); - } - - return $result; - } - - protected function getActiveBreadcrumb(AbstractNode $node): string - { - return \sprintf( - ' ' . "\n" . - ' ' . "\n", - $node->getName() - ); - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Directory.php b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Directory.php deleted file mode 100644 index c2f0860..0000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Directory.php +++ /dev/null @@ -1,98 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Report\Html; - -use SebastianBergmann\CodeCoverage\Node\AbstractNode as Node; -use SebastianBergmann\CodeCoverage\Node\Directory as DirectoryNode; - -/** - * Renders a directory node. - */ -final class Directory extends Renderer -{ - /** - * @throws \InvalidArgumentException - * @throws \RuntimeException - */ - public function render(DirectoryNode $node, string $file): void - { - $template = new \Text_Template($this->templatePath . 'directory.html', '{{', '}}'); - - $this->setCommonTemplateVariables($template, $node); - - $items = $this->renderItem($node, true); - - foreach ($node->getDirectories() as $item) { - $items .= $this->renderItem($item); - } - - foreach ($node->getFiles() as $item) { - $items .= $this->renderItem($item); - } - - $template->setVar( - [ - 'id' => $node->getId(), - 'items' => $items, - ] - ); - - $template->renderTo($file); - } - - protected function renderItem(Node $node, bool $total = false): string - { - $data = [ - 'numClasses' => $node->getNumClassesAndTraits(), - 'numTestedClasses' => $node->getNumTestedClassesAndTraits(), - 'numMethods' => $node->getNumFunctionsAndMethods(), - 'numTestedMethods' => $node->getNumTestedFunctionsAndMethods(), - 'linesExecutedPercent' => $node->getLineExecutedPercent(false), - 'linesExecutedPercentAsString' => $node->getLineExecutedPercent(), - 'numExecutedLines' => $node->getNumExecutedLines(), - 'numExecutableLines' => $node->getNumExecutableLines(), - 'testedMethodsPercent' => $node->getTestedFunctionsAndMethodsPercent(false), - 'testedMethodsPercentAsString' => $node->getTestedFunctionsAndMethodsPercent(), - 'testedClassesPercent' => $node->getTestedClassesAndTraitsPercent(false), - 'testedClassesPercentAsString' => $node->getTestedClassesAndTraitsPercent(), - ]; - - if ($total) { - $data['name'] = 'Total'; - } else { - if ($node instanceof DirectoryNode) { - $data['name'] = \sprintf( - '%s', - $node->getName(), - $node->getName() - ); - - $up = \str_repeat('../', \count($node->getPathAsArray()) - 2); - - $data['icon'] = \sprintf('', $up); - } else { - $data['name'] = \sprintf( - '%s', - $node->getName(), - $node->getName() - ); - - $up = \str_repeat('../', \count($node->getPathAsArray()) - 2); - - $data['icon'] = \sprintf('', $up); - } - } - - return $this->renderItemTemplate( - new \Text_Template($this->templatePath . 'directory_item.html', '{{', '}}'), - $data - ); - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/File.php b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/File.php deleted file mode 100644 index f0604bf..0000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/File.php +++ /dev/null @@ -1,529 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Report\Html; - -use SebastianBergmann\CodeCoverage\Node\File as FileNode; -use SebastianBergmann\CodeCoverage\Util; - -/** - * Renders a file node. - */ -final class File extends Renderer -{ - /** - * @var int - */ - private $htmlSpecialCharsFlags = \ENT_COMPAT | \ENT_HTML401 | \ENT_SUBSTITUTE; - - /** - * @throws \RuntimeException - */ - public function render(FileNode $node, string $file): void - { - $template = new \Text_Template($this->templatePath . 'file.html', '{{', '}}'); - - $template->setVar( - [ - 'items' => $this->renderItems($node), - 'lines' => $this->renderSource($node), - ] - ); - - $this->setCommonTemplateVariables($template, $node); - - $template->renderTo($file); - } - - protected function renderItems(FileNode $node): string - { - $template = new \Text_Template($this->templatePath . 'file_item.html', '{{', '}}'); - - $methodItemTemplate = new \Text_Template( - $this->templatePath . 'method_item.html', - '{{', - '}}' - ); - - $items = $this->renderItemTemplate( - $template, - [ - 'name' => 'Total', - 'numClasses' => $node->getNumClassesAndTraits(), - 'numTestedClasses' => $node->getNumTestedClassesAndTraits(), - 'numMethods' => $node->getNumFunctionsAndMethods(), - 'numTestedMethods' => $node->getNumTestedFunctionsAndMethods(), - 'linesExecutedPercent' => $node->getLineExecutedPercent(false), - 'linesExecutedPercentAsString' => $node->getLineExecutedPercent(), - 'numExecutedLines' => $node->getNumExecutedLines(), - 'numExecutableLines' => $node->getNumExecutableLines(), - 'testedMethodsPercent' => $node->getTestedFunctionsAndMethodsPercent(false), - 'testedMethodsPercentAsString' => $node->getTestedFunctionsAndMethodsPercent(), - 'testedClassesPercent' => $node->getTestedClassesAndTraitsPercent(false), - 'testedClassesPercentAsString' => $node->getTestedClassesAndTraitsPercent(), - 'crap' => 'CRAP', - ] - ); - - $items .= $this->renderFunctionItems( - $node->getFunctions(), - $methodItemTemplate - ); - - $items .= $this->renderTraitOrClassItems( - $node->getTraits(), - $template, - $methodItemTemplate - ); - - $items .= $this->renderTraitOrClassItems( - $node->getClasses(), - $template, - $methodItemTemplate - ); - - return $items; - } - - protected function renderTraitOrClassItems(array $items, \Text_Template $template, \Text_Template $methodItemTemplate): string - { - $buffer = ''; - - if (empty($items)) { - return $buffer; - } - - foreach ($items as $name => $item) { - $numMethods = 0; - $numTestedMethods = 0; - - foreach ($item['methods'] as $method) { - if ($method['executableLines'] > 0) { - $numMethods++; - - if ($method['executedLines'] === $method['executableLines']) { - $numTestedMethods++; - } - } - } - - if ($item['executableLines'] > 0) { - $numClasses = 1; - $numTestedClasses = $numTestedMethods == $numMethods ? 1 : 0; - $linesExecutedPercentAsString = Util::percent( - $item['executedLines'], - $item['executableLines'], - true - ); - } else { - $numClasses = 'n/a'; - $numTestedClasses = 'n/a'; - $linesExecutedPercentAsString = 'n/a'; - } - - $buffer .= $this->renderItemTemplate( - $template, - [ - 'name' => $this->abbreviateClassName($name), - 'numClasses' => $numClasses, - 'numTestedClasses' => $numTestedClasses, - 'numMethods' => $numMethods, - 'numTestedMethods' => $numTestedMethods, - 'linesExecutedPercent' => Util::percent( - $item['executedLines'], - $item['executableLines'], - false - ), - 'linesExecutedPercentAsString' => $linesExecutedPercentAsString, - 'numExecutedLines' => $item['executedLines'], - 'numExecutableLines' => $item['executableLines'], - 'testedMethodsPercent' => Util::percent( - $numTestedMethods, - $numMethods - ), - 'testedMethodsPercentAsString' => Util::percent( - $numTestedMethods, - $numMethods, - true - ), - 'testedClassesPercent' => Util::percent( - $numTestedMethods == $numMethods ? 1 : 0, - 1 - ), - 'testedClassesPercentAsString' => Util::percent( - $numTestedMethods == $numMethods ? 1 : 0, - 1, - true - ), - 'crap' => $item['crap'], - ] - ); - - foreach ($item['methods'] as $method) { - $buffer .= $this->renderFunctionOrMethodItem( - $methodItemTemplate, - $method, - ' ' - ); - } - } - - return $buffer; - } - - protected function renderFunctionItems(array $functions, \Text_Template $template): string - { - if (empty($functions)) { - return ''; - } - - $buffer = ''; - - foreach ($functions as $function) { - $buffer .= $this->renderFunctionOrMethodItem( - $template, - $function - ); - } - - return $buffer; - } - - protected function renderFunctionOrMethodItem(\Text_Template $template, array $item, string $indent = ''): string - { - $numMethods = 0; - $numTestedMethods = 0; - - if ($item['executableLines'] > 0) { - $numMethods = 1; - - if ($item['executedLines'] === $item['executableLines']) { - $numTestedMethods = 1; - } - } - - return $this->renderItemTemplate( - $template, - [ - 'name' => \sprintf( - '%s%s', - $indent, - $item['startLine'], - \htmlspecialchars($item['signature'], $this->htmlSpecialCharsFlags), - $item['functionName'] ?? $item['methodName'] - ), - 'numMethods' => $numMethods, - 'numTestedMethods' => $numTestedMethods, - 'linesExecutedPercent' => Util::percent( - $item['executedLines'], - $item['executableLines'] - ), - 'linesExecutedPercentAsString' => Util::percent( - $item['executedLines'], - $item['executableLines'], - true - ), - 'numExecutedLines' => $item['executedLines'], - 'numExecutableLines' => $item['executableLines'], - 'testedMethodsPercent' => Util::percent( - $numTestedMethods, - 1 - ), - 'testedMethodsPercentAsString' => Util::percent( - $numTestedMethods, - 1, - true - ), - 'crap' => $item['crap'], - ] - ); - } - - protected function renderSource(FileNode $node): string - { - $coverageData = $node->getCoverageData(); - $testData = $node->getTestData(); - $codeLines = $this->loadFile($node->getPath()); - $lines = ''; - $i = 1; - - foreach ($codeLines as $line) { - $trClass = ''; - $popoverContent = ''; - $popoverTitle = ''; - - if (\array_key_exists($i, $coverageData)) { - $numTests = ($coverageData[$i] ? \count($coverageData[$i]) : 0); - - if ($coverageData[$i] === null) { - $trClass = ' class="warning"'; - } elseif ($numTests == 0) { - $trClass = ' class="danger"'; - } else { - $lineCss = 'covered-by-large-tests'; - $popoverContent = '
    '; - - if ($numTests > 1) { - $popoverTitle = $numTests . ' tests cover line ' . $i; - } else { - $popoverTitle = '1 test covers line ' . $i; - } - - foreach ($coverageData[$i] as $test) { - if ($lineCss == 'covered-by-large-tests' && $testData[$test]['size'] == 'medium') { - $lineCss = 'covered-by-medium-tests'; - } elseif ($testData[$test]['size'] == 'small') { - $lineCss = 'covered-by-small-tests'; - } - - switch ($testData[$test]['status']) { - case 0: - switch ($testData[$test]['size']) { - case 'small': - $testCSS = ' class="covered-by-small-tests"'; - - break; - - case 'medium': - $testCSS = ' class="covered-by-medium-tests"'; - - break; - - default: - $testCSS = ' class="covered-by-large-tests"'; - - break; - } - - break; - - case 1: - case 2: - $testCSS = ' class="warning"'; - - break; - - case 3: - $testCSS = ' class="danger"'; - - break; - - case 4: - $testCSS = ' class="danger"'; - - break; - - default: - $testCSS = ''; - } - - $popoverContent .= \sprintf( - '%s', - $testCSS, - \htmlspecialchars($test, $this->htmlSpecialCharsFlags) - ); - } - - $popoverContent .= '
'; - $trClass = ' class="' . $lineCss . ' popin"'; - } - } - - $popover = ''; - - if (!empty($popoverTitle)) { - $popover = \sprintf( - ' data-title="%s" data-content="%s" data-placement="top" data-html="true"', - $popoverTitle, - \htmlspecialchars($popoverContent, $this->htmlSpecialCharsFlags) - ); - } - - $lines .= \sprintf( - ' %s' . "\n", - $trClass, - $popover, - $i, - $i, - $i, - $line - ); - - $i++; - } - - return $lines; - } - - /** - * @param string $file - */ - protected function loadFile($file): array - { - $buffer = \file_get_contents($file); - $tokens = \token_get_all($buffer); - $result = ['']; - $i = 0; - $stringFlag = false; - $fileEndsWithNewLine = \substr($buffer, -1) == "\n"; - - unset($buffer); - - foreach ($tokens as $j => $token) { - if (\is_string($token)) { - if ($token === '"' && $tokens[$j - 1] !== '\\') { - $result[$i] .= \sprintf( - '%s', - \htmlspecialchars($token, $this->htmlSpecialCharsFlags) - ); - - $stringFlag = !$stringFlag; - } else { - $result[$i] .= \sprintf( - '%s', - \htmlspecialchars($token, $this->htmlSpecialCharsFlags) - ); - } - - continue; - } - - [$token, $value] = $token; - - $value = \str_replace( - ["\t", ' '], - ['    ', ' '], - \htmlspecialchars($value, $this->htmlSpecialCharsFlags) - ); - - if ($value === "\n") { - $result[++$i] = ''; - } else { - $lines = \explode("\n", $value); - - foreach ($lines as $jj => $line) { - $line = \trim($line); - - if ($line !== '') { - if ($stringFlag) { - $colour = 'string'; - } else { - switch ($token) { - case \T_INLINE_HTML: - $colour = 'html'; - - break; - - case \T_COMMENT: - case \T_DOC_COMMENT: - $colour = 'comment'; - - break; - - case \T_ABSTRACT: - case \T_ARRAY: - case \T_AS: - case \T_BREAK: - case \T_CALLABLE: - case \T_CASE: - case \T_CATCH: - case \T_CLASS: - case \T_CLONE: - case \T_CONTINUE: - case \T_DEFAULT: - case \T_ECHO: - case \T_ELSE: - case \T_ELSEIF: - case \T_EMPTY: - case \T_ENDDECLARE: - case \T_ENDFOR: - case \T_ENDFOREACH: - case \T_ENDIF: - case \T_ENDSWITCH: - case \T_ENDWHILE: - case \T_EXIT: - case \T_EXTENDS: - case \T_FINAL: - case \T_FINALLY: - case \T_FOREACH: - case \T_FUNCTION: - case \T_GLOBAL: - case \T_IF: - case \T_IMPLEMENTS: - case \T_INCLUDE: - case \T_INCLUDE_ONCE: - case \T_INSTANCEOF: - case \T_INSTEADOF: - case \T_INTERFACE: - case \T_ISSET: - case \T_LOGICAL_AND: - case \T_LOGICAL_OR: - case \T_LOGICAL_XOR: - case \T_NAMESPACE: - case \T_NEW: - case \T_PRIVATE: - case \T_PROTECTED: - case \T_PUBLIC: - case \T_REQUIRE: - case \T_REQUIRE_ONCE: - case \T_RETURN: - case \T_STATIC: - case \T_THROW: - case \T_TRAIT: - case \T_TRY: - case \T_UNSET: - case \T_USE: - case \T_VAR: - case \T_WHILE: - case \T_YIELD: - $colour = 'keyword'; - - break; - - default: - $colour = 'default'; - } - } - - $result[$i] .= \sprintf( - '%s', - $colour, - $line - ); - } - - if (isset($lines[$jj + 1])) { - $result[++$i] = ''; - } - } - } - } - - if ($fileEndsWithNewLine) { - unset($result[\count($result) - 1]); - } - - return $result; - } - - private function abbreviateClassName(string $className): string - { - $tmp = \explode('\\', $className); - - if (\count($tmp) > 1) { - $className = \sprintf( - '%s', - $className, - \array_pop($tmp) - ); - } - - return $className; - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/coverage_bar.html.dist b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/coverage_bar.html.dist deleted file mode 100644 index 7fcf6f4..0000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/coverage_bar.html.dist +++ /dev/null @@ -1,5 +0,0 @@ -
-
- {{percent}}% covered ({{level}}) -
-
diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/css/bootstrap.min.css b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/css/bootstrap.min.css deleted file mode 100644 index 92e3fe8..0000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/css/bootstrap.min.css +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * Bootstrap v4.3.1 (https://getbootstrap.com/) - * Copyright 2011-2019 The Bootstrap Authors - * Copyright 2011-2019 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - */:root{--blue:#007bff;--indigo:#6610f2;--purple:#6f42c1;--pink:#e83e8c;--red:#dc3545;--orange:#fd7e14;--yellow:#ffc107;--green:#28a745;--teal:#20c997;--cyan:#17a2b8;--white:#fff;--gray:#6c757d;--gray-dark:#343a40;--primary:#007bff;--secondary:#6c757d;--success:#28a745;--info:#17a2b8;--warning:#ffc107;--danger:#dc3545;--light:#f8f9fa;--dark:#343a40;--breakpoint-xs:0;--breakpoint-sm:576px;--breakpoint-md:768px;--breakpoint-lg:992px;--breakpoint-xl:1200px;--font-family-sans-serif:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-family-monospace:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace}*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg{overflow:hidden;vertical-align:middle}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}select{word-wrap:normal}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{margin-bottom:.5rem;font-weight:500;line-height:1.2}.h1,h1{font-size:2.5rem}.h2,h2{font-size:2rem}.h3,h3{font-size:1.75rem}.h4,h4{font-size:1.5rem}.h5,h5{font-size:1.25rem}.h6,h6{font-size:1rem}.lead{font-size:1.25rem;font-weight:300}.display-1{font-size:6rem;font-weight:300;line-height:1.2}.display-2{font-size:5.5rem;font-weight:300;line-height:1.2}.display-3{font-size:4.5rem;font-weight:300;line-height:1.2}.display-4{font-size:3.5rem;font-weight:300;line-height:1.2}hr{margin-top:1rem;margin-bottom:1rem;border:0;border-top:1px solid rgba(0,0,0,.1)}.small,small{font-size:80%;font-weight:400}.mark,mark{padding:.2em;background-color:#fcf8e3}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none}.list-inline-item{display:inline-block}.list-inline-item:not(:last-child){margin-right:.5rem}.initialism{font-size:90%;text-transform:uppercase}.blockquote{margin-bottom:1rem;font-size:1.25rem}.blockquote-footer{display:block;font-size:80%;color:#6c757d}.blockquote-footer::before{content:"\2014\00A0"}.img-fluid{max-width:100%;height:auto}.img-thumbnail{padding:.25rem;background-color:#fff;border:1px solid #dee2e6;border-radius:.25rem;max-width:100%;height:auto}.figure{display:inline-block}.figure-img{margin-bottom:.5rem;line-height:1}.figure-caption{font-size:90%;color:#6c757d}code{font-size:87.5%;color:#e83e8c;word-break:break-word}a>code{color:inherit}kbd{padding:.2rem .4rem;font-size:87.5%;color:#fff;background-color:#212529;border-radius:.2rem}kbd kbd{padding:0;font-size:100%;font-weight:700}pre{display:block;font-size:87.5%;color:#212529}pre code{font-size:inherit;color:inherit;word-break:normal}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:576px){.container{max-width:540px}}@media (min-width:768px){.container{max-width:720px}}@media (min-width:992px){.container{max-width:960px}}@media (min-width:1200px){.container{max-width:1140px}}.container-fluid{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-15px;margin-left:-15px}.no-gutters{margin-right:0;margin-left:0}.no-gutters>.col,.no-gutters>[class*=col-]{padding-right:0;padding-left:0}.col,.col-1,.col-10,.col-11,.col-12,.col-2,.col-3,.col-4,.col-5,.col-6,.col-7,.col-8,.col-9,.col-auto,.col-lg,.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-auto,.col-md,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-auto,.col-sm,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-auto,.col-xl,.col-xl-1,.col-xl-10,.col-xl-11,.col-xl-12,.col-xl-2,.col-xl-3,.col-xl-4,.col-xl-5,.col-xl-6,.col-xl-7,.col-xl-8,.col-xl-9,.col-xl-auto{position:relative;width:100%;padding-right:15px;padding-left:15px}.col{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-first{-ms-flex-order:-1;order:-1}.order-last{-ms-flex-order:13;order:13}.order-0{-ms-flex-order:0;order:0}.order-1{-ms-flex-order:1;order:1}.order-2{-ms-flex-order:2;order:2}.order-3{-ms-flex-order:3;order:3}.order-4{-ms-flex-order:4;order:4}.order-5{-ms-flex-order:5;order:5}.order-6{-ms-flex-order:6;order:6}.order-7{-ms-flex-order:7;order:7}.order-8{-ms-flex-order:8;order:8}.order-9{-ms-flex-order:9;order:9}.order-10{-ms-flex-order:10;order:10}.order-11{-ms-flex-order:11;order:11}.order-12{-ms-flex-order:12;order:12}.offset-1{margin-left:8.333333%}.offset-2{margin-left:16.666667%}.offset-3{margin-left:25%}.offset-4{margin-left:33.333333%}.offset-5{margin-left:41.666667%}.offset-6{margin-left:50%}.offset-7{margin-left:58.333333%}.offset-8{margin-left:66.666667%}.offset-9{margin-left:75%}.offset-10{margin-left:83.333333%}.offset-11{margin-left:91.666667%}@media (min-width:576px){.col-sm{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-sm-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-sm-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-sm-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-sm-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-sm-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-sm-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-sm-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-sm-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-sm-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-sm-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-sm-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-sm-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-sm-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-sm-first{-ms-flex-order:-1;order:-1}.order-sm-last{-ms-flex-order:13;order:13}.order-sm-0{-ms-flex-order:0;order:0}.order-sm-1{-ms-flex-order:1;order:1}.order-sm-2{-ms-flex-order:2;order:2}.order-sm-3{-ms-flex-order:3;order:3}.order-sm-4{-ms-flex-order:4;order:4}.order-sm-5{-ms-flex-order:5;order:5}.order-sm-6{-ms-flex-order:6;order:6}.order-sm-7{-ms-flex-order:7;order:7}.order-sm-8{-ms-flex-order:8;order:8}.order-sm-9{-ms-flex-order:9;order:9}.order-sm-10{-ms-flex-order:10;order:10}.order-sm-11{-ms-flex-order:11;order:11}.order-sm-12{-ms-flex-order:12;order:12}.offset-sm-0{margin-left:0}.offset-sm-1{margin-left:8.333333%}.offset-sm-2{margin-left:16.666667%}.offset-sm-3{margin-left:25%}.offset-sm-4{margin-left:33.333333%}.offset-sm-5{margin-left:41.666667%}.offset-sm-6{margin-left:50%}.offset-sm-7{margin-left:58.333333%}.offset-sm-8{margin-left:66.666667%}.offset-sm-9{margin-left:75%}.offset-sm-10{margin-left:83.333333%}.offset-sm-11{margin-left:91.666667%}}@media (min-width:768px){.col-md{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-md-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-md-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-md-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-md-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-md-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-md-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-md-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-md-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-md-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-md-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-md-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-md-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-md-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-md-first{-ms-flex-order:-1;order:-1}.order-md-last{-ms-flex-order:13;order:13}.order-md-0{-ms-flex-order:0;order:0}.order-md-1{-ms-flex-order:1;order:1}.order-md-2{-ms-flex-order:2;order:2}.order-md-3{-ms-flex-order:3;order:3}.order-md-4{-ms-flex-order:4;order:4}.order-md-5{-ms-flex-order:5;order:5}.order-md-6{-ms-flex-order:6;order:6}.order-md-7{-ms-flex-order:7;order:7}.order-md-8{-ms-flex-order:8;order:8}.order-md-9{-ms-flex-order:9;order:9}.order-md-10{-ms-flex-order:10;order:10}.order-md-11{-ms-flex-order:11;order:11}.order-md-12{-ms-flex-order:12;order:12}.offset-md-0{margin-left:0}.offset-md-1{margin-left:8.333333%}.offset-md-2{margin-left:16.666667%}.offset-md-3{margin-left:25%}.offset-md-4{margin-left:33.333333%}.offset-md-5{margin-left:41.666667%}.offset-md-6{margin-left:50%}.offset-md-7{margin-left:58.333333%}.offset-md-8{margin-left:66.666667%}.offset-md-9{margin-left:75%}.offset-md-10{margin-left:83.333333%}.offset-md-11{margin-left:91.666667%}}@media (min-width:992px){.col-lg{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-lg-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-lg-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-lg-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-lg-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-lg-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-lg-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-lg-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-lg-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-lg-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-lg-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-lg-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-lg-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-lg-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-lg-first{-ms-flex-order:-1;order:-1}.order-lg-last{-ms-flex-order:13;order:13}.order-lg-0{-ms-flex-order:0;order:0}.order-lg-1{-ms-flex-order:1;order:1}.order-lg-2{-ms-flex-order:2;order:2}.order-lg-3{-ms-flex-order:3;order:3}.order-lg-4{-ms-flex-order:4;order:4}.order-lg-5{-ms-flex-order:5;order:5}.order-lg-6{-ms-flex-order:6;order:6}.order-lg-7{-ms-flex-order:7;order:7}.order-lg-8{-ms-flex-order:8;order:8}.order-lg-9{-ms-flex-order:9;order:9}.order-lg-10{-ms-flex-order:10;order:10}.order-lg-11{-ms-flex-order:11;order:11}.order-lg-12{-ms-flex-order:12;order:12}.offset-lg-0{margin-left:0}.offset-lg-1{margin-left:8.333333%}.offset-lg-2{margin-left:16.666667%}.offset-lg-3{margin-left:25%}.offset-lg-4{margin-left:33.333333%}.offset-lg-5{margin-left:41.666667%}.offset-lg-6{margin-left:50%}.offset-lg-7{margin-left:58.333333%}.offset-lg-8{margin-left:66.666667%}.offset-lg-9{margin-left:75%}.offset-lg-10{margin-left:83.333333%}.offset-lg-11{margin-left:91.666667%}}@media (min-width:1200px){.col-xl{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-xl-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-xl-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-xl-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-xl-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-xl-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-xl-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-xl-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-xl-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-xl-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-xl-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-xl-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-xl-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-xl-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-xl-first{-ms-flex-order:-1;order:-1}.order-xl-last{-ms-flex-order:13;order:13}.order-xl-0{-ms-flex-order:0;order:0}.order-xl-1{-ms-flex-order:1;order:1}.order-xl-2{-ms-flex-order:2;order:2}.order-xl-3{-ms-flex-order:3;order:3}.order-xl-4{-ms-flex-order:4;order:4}.order-xl-5{-ms-flex-order:5;order:5}.order-xl-6{-ms-flex-order:6;order:6}.order-xl-7{-ms-flex-order:7;order:7}.order-xl-8{-ms-flex-order:8;order:8}.order-xl-9{-ms-flex-order:9;order:9}.order-xl-10{-ms-flex-order:10;order:10}.order-xl-11{-ms-flex-order:11;order:11}.order-xl-12{-ms-flex-order:12;order:12}.offset-xl-0{margin-left:0}.offset-xl-1{margin-left:8.333333%}.offset-xl-2{margin-left:16.666667%}.offset-xl-3{margin-left:25%}.offset-xl-4{margin-left:33.333333%}.offset-xl-5{margin-left:41.666667%}.offset-xl-6{margin-left:50%}.offset-xl-7{margin-left:58.333333%}.offset-xl-8{margin-left:66.666667%}.offset-xl-9{margin-left:75%}.offset-xl-10{margin-left:83.333333%}.offset-xl-11{margin-left:91.666667%}}.table{width:100%;margin-bottom:1rem;color:#212529}.table td,.table th{padding:.75rem;vertical-align:top;border-top:1px solid #dee2e6}.table thead th{vertical-align:bottom;border-bottom:2px solid #dee2e6}.table tbody+tbody{border-top:2px solid #dee2e6}.table-sm td,.table-sm th{padding:.3rem}.table-bordered{border:1px solid #dee2e6}.table-bordered td,.table-bordered th{border:1px solid #dee2e6}.table-bordered thead td,.table-bordered thead th{border-bottom-width:2px}.table-borderless tbody+tbody,.table-borderless td,.table-borderless th,.table-borderless thead th{border:0}.table-striped tbody tr:nth-of-type(odd){background-color:rgba(0,0,0,.05)}.table-hover tbody tr:hover{color:#212529;background-color:rgba(0,0,0,.075)}.table-primary,.table-primary>td,.table-primary>th{background-color:#b8daff}.table-primary tbody+tbody,.table-primary td,.table-primary th,.table-primary thead th{border-color:#7abaff}.table-hover .table-primary:hover{background-color:#9fcdff}.table-hover .table-primary:hover>td,.table-hover .table-primary:hover>th{background-color:#9fcdff}.table-secondary,.table-secondary>td,.table-secondary>th{background-color:#d6d8db}.table-secondary tbody+tbody,.table-secondary td,.table-secondary th,.table-secondary thead th{border-color:#b3b7bb}.table-hover .table-secondary:hover{background-color:#c8cbcf}.table-hover .table-secondary:hover>td,.table-hover .table-secondary:hover>th{background-color:#c8cbcf}.table-success,.table-success>td,.table-success>th{background-color:#c3e6cb}.table-success tbody+tbody,.table-success td,.table-success th,.table-success thead th{border-color:#8fd19e}.table-hover .table-success:hover{background-color:#b1dfbb}.table-hover .table-success:hover>td,.table-hover .table-success:hover>th{background-color:#b1dfbb}.table-info,.table-info>td,.table-info>th{background-color:#bee5eb}.table-info tbody+tbody,.table-info td,.table-info th,.table-info thead th{border-color:#86cfda}.table-hover .table-info:hover{background-color:#abdde5}.table-hover .table-info:hover>td,.table-hover .table-info:hover>th{background-color:#abdde5}.table-warning,.table-warning>td,.table-warning>th{background-color:#ffeeba}.table-warning tbody+tbody,.table-warning td,.table-warning th,.table-warning thead th{border-color:#ffdf7e}.table-hover .table-warning:hover{background-color:#ffe8a1}.table-hover .table-warning:hover>td,.table-hover .table-warning:hover>th{background-color:#ffe8a1}.table-danger,.table-danger>td,.table-danger>th{background-color:#f5c6cb}.table-danger tbody+tbody,.table-danger td,.table-danger th,.table-danger thead th{border-color:#ed969e}.table-hover .table-danger:hover{background-color:#f1b0b7}.table-hover .table-danger:hover>td,.table-hover .table-danger:hover>th{background-color:#f1b0b7}.table-light,.table-light>td,.table-light>th{background-color:#fdfdfe}.table-light tbody+tbody,.table-light td,.table-light th,.table-light thead th{border-color:#fbfcfc}.table-hover .table-light:hover{background-color:#ececf6}.table-hover .table-light:hover>td,.table-hover .table-light:hover>th{background-color:#ececf6}.table-dark,.table-dark>td,.table-dark>th{background-color:#c6c8ca}.table-dark tbody+tbody,.table-dark td,.table-dark th,.table-dark thead th{border-color:#95999c}.table-hover .table-dark:hover{background-color:#b9bbbe}.table-hover .table-dark:hover>td,.table-hover .table-dark:hover>th{background-color:#b9bbbe}.table-active,.table-active>td,.table-active>th{background-color:rgba(0,0,0,.075)}.table-hover .table-active:hover{background-color:rgba(0,0,0,.075)}.table-hover .table-active:hover>td,.table-hover .table-active:hover>th{background-color:rgba(0,0,0,.075)}.table .thead-dark th{color:#fff;background-color:#343a40;border-color:#454d55}.table .thead-light th{color:#495057;background-color:#e9ecef;border-color:#dee2e6}.table-dark{color:#fff;background-color:#343a40}.table-dark td,.table-dark th,.table-dark thead th{border-color:#454d55}.table-dark.table-bordered{border:0}.table-dark.table-striped tbody tr:nth-of-type(odd){background-color:rgba(255,255,255,.05)}.table-dark.table-hover tbody tr:hover{color:#fff;background-color:rgba(255,255,255,.075)}@media (max-width:575.98px){.table-responsive-sm{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-sm>.table-bordered{border:0}}@media (max-width:767.98px){.table-responsive-md{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-md>.table-bordered{border:0}}@media (max-width:991.98px){.table-responsive-lg{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-lg>.table-bordered{border:0}}@media (max-width:1199.98px){.table-responsive-xl{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-xl>.table-bordered{border:0}}.table-responsive{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive>.table-bordered{border:0}.form-control{display:block;width:100%;height:calc(1.5em + .75rem + 2px);padding:.375rem .75rem;font-size:1rem;font-weight:400;line-height:1.5;color:#495057;background-color:#fff;background-clip:padding-box;border:1px solid #ced4da;border-radius:.25rem;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.form-control{transition:none}}.form-control::-ms-expand{background-color:transparent;border:0}.form-control:focus{color:#495057;background-color:#fff;border-color:#80bdff;outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.form-control::-webkit-input-placeholder{color:#6c757d;opacity:1}.form-control::-moz-placeholder{color:#6c757d;opacity:1}.form-control:-ms-input-placeholder{color:#6c757d;opacity:1}.form-control::-ms-input-placeholder{color:#6c757d;opacity:1}.form-control::placeholder{color:#6c757d;opacity:1}.form-control:disabled,.form-control[readonly]{background-color:#e9ecef;opacity:1}select.form-control:focus::-ms-value{color:#495057;background-color:#fff}.form-control-file,.form-control-range{display:block;width:100%}.col-form-label{padding-top:calc(.375rem + 1px);padding-bottom:calc(.375rem + 1px);margin-bottom:0;font-size:inherit;line-height:1.5}.col-form-label-lg{padding-top:calc(.5rem + 1px);padding-bottom:calc(.5rem + 1px);font-size:1.25rem;line-height:1.5}.col-form-label-sm{padding-top:calc(.25rem + 1px);padding-bottom:calc(.25rem + 1px);font-size:.875rem;line-height:1.5}.form-control-plaintext{display:block;width:100%;padding-top:.375rem;padding-bottom:.375rem;margin-bottom:0;line-height:1.5;color:#212529;background-color:transparent;border:solid transparent;border-width:1px 0}.form-control-plaintext.form-control-lg,.form-control-plaintext.form-control-sm{padding-right:0;padding-left:0}.form-control-sm{height:calc(1.5em + .5rem + 2px);padding:.25rem .5rem;font-size:.875rem;line-height:1.5;border-radius:.2rem}.form-control-lg{height:calc(1.5em + 1rem + 2px);padding:.5rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:.3rem}select.form-control[multiple],select.form-control[size]{height:auto}textarea.form-control{height:auto}.form-group{margin-bottom:1rem}.form-text{display:block;margin-top:.25rem}.form-row{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-5px;margin-left:-5px}.form-row>.col,.form-row>[class*=col-]{padding-right:5px;padding-left:5px}.form-check{position:relative;display:block;padding-left:1.25rem}.form-check-input{position:absolute;margin-top:.3rem;margin-left:-1.25rem}.form-check-input:disabled~.form-check-label{color:#6c757d}.form-check-label{margin-bottom:0}.form-check-inline{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;padding-left:0;margin-right:.75rem}.form-check-inline .form-check-input{position:static;margin-top:0;margin-right:.3125rem;margin-left:0}.valid-feedback{display:none;width:100%;margin-top:.25rem;font-size:80%;color:#28a745}.valid-tooltip{position:absolute;top:100%;z-index:5;display:none;max-width:100%;padding:.25rem .5rem;margin-top:.1rem;font-size:.875rem;line-height:1.5;color:#fff;background-color:rgba(40,167,69,.9);border-radius:.25rem}.form-control.is-valid,.was-validated .form-control:valid{border-color:#28a745;padding-right:calc(1.5em + .75rem);background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");background-repeat:no-repeat;background-position:center right calc(.375em + .1875rem);background-size:calc(.75em + .375rem) calc(.75em + .375rem)}.form-control.is-valid:focus,.was-validated .form-control:valid:focus{border-color:#28a745;box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.form-control.is-valid~.valid-feedback,.form-control.is-valid~.valid-tooltip,.was-validated .form-control:valid~.valid-feedback,.was-validated .form-control:valid~.valid-tooltip{display:block}.was-validated textarea.form-control:valid,textarea.form-control.is-valid{padding-right:calc(1.5em + .75rem);background-position:top calc(.375em + .1875rem) right calc(.375em + .1875rem)}.custom-select.is-valid,.was-validated .custom-select:valid{border-color:#28a745;padding-right:calc((1em + .75rem) * 3 / 4 + 1.75rem);background:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat right .75rem center/8px 10px,url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e") #fff no-repeat center right 1.75rem/calc(.75em + .375rem) calc(.75em + .375rem)}.custom-select.is-valid:focus,.was-validated .custom-select:valid:focus{border-color:#28a745;box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.custom-select.is-valid~.valid-feedback,.custom-select.is-valid~.valid-tooltip,.was-validated .custom-select:valid~.valid-feedback,.was-validated .custom-select:valid~.valid-tooltip{display:block}.form-control-file.is-valid~.valid-feedback,.form-control-file.is-valid~.valid-tooltip,.was-validated .form-control-file:valid~.valid-feedback,.was-validated .form-control-file:valid~.valid-tooltip{display:block}.form-check-input.is-valid~.form-check-label,.was-validated .form-check-input:valid~.form-check-label{color:#28a745}.form-check-input.is-valid~.valid-feedback,.form-check-input.is-valid~.valid-tooltip,.was-validated .form-check-input:valid~.valid-feedback,.was-validated .form-check-input:valid~.valid-tooltip{display:block}.custom-control-input.is-valid~.custom-control-label,.was-validated .custom-control-input:valid~.custom-control-label{color:#28a745}.custom-control-input.is-valid~.custom-control-label::before,.was-validated .custom-control-input:valid~.custom-control-label::before{border-color:#28a745}.custom-control-input.is-valid~.valid-feedback,.custom-control-input.is-valid~.valid-tooltip,.was-validated .custom-control-input:valid~.valid-feedback,.was-validated .custom-control-input:valid~.valid-tooltip{display:block}.custom-control-input.is-valid:checked~.custom-control-label::before,.was-validated .custom-control-input:valid:checked~.custom-control-label::before{border-color:#34ce57;background-color:#34ce57}.custom-control-input.is-valid:focus~.custom-control-label::before,.was-validated .custom-control-input:valid:focus~.custom-control-label::before{box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.custom-control-input.is-valid:focus:not(:checked)~.custom-control-label::before,.was-validated .custom-control-input:valid:focus:not(:checked)~.custom-control-label::before{border-color:#28a745}.custom-file-input.is-valid~.custom-file-label,.was-validated .custom-file-input:valid~.custom-file-label{border-color:#28a745}.custom-file-input.is-valid~.valid-feedback,.custom-file-input.is-valid~.valid-tooltip,.was-validated .custom-file-input:valid~.valid-feedback,.was-validated .custom-file-input:valid~.valid-tooltip{display:block}.custom-file-input.is-valid:focus~.custom-file-label,.was-validated .custom-file-input:valid:focus~.custom-file-label{border-color:#28a745;box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.invalid-feedback{display:none;width:100%;margin-top:.25rem;font-size:80%;color:#dc3545}.invalid-tooltip{position:absolute;top:100%;z-index:5;display:none;max-width:100%;padding:.25rem .5rem;margin-top:.1rem;font-size:.875rem;line-height:1.5;color:#fff;background-color:rgba(220,53,69,.9);border-radius:.25rem}.form-control.is-invalid,.was-validated .form-control:invalid{border-color:#dc3545;padding-right:calc(1.5em + .75rem);background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23dc3545' viewBox='-2 -2 7 7'%3e%3cpath stroke='%23dc3545' d='M0 0l3 3m0-3L0 3'/%3e%3ccircle r='.5'/%3e%3ccircle cx='3' r='.5'/%3e%3ccircle cy='3' r='.5'/%3e%3ccircle cx='3' cy='3' r='.5'/%3e%3c/svg%3E");background-repeat:no-repeat;background-position:center right calc(.375em + .1875rem);background-size:calc(.75em + .375rem) calc(.75em + .375rem)}.form-control.is-invalid:focus,.was-validated .form-control:invalid:focus{border-color:#dc3545;box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.form-control.is-invalid~.invalid-feedback,.form-control.is-invalid~.invalid-tooltip,.was-validated .form-control:invalid~.invalid-feedback,.was-validated .form-control:invalid~.invalid-tooltip{display:block}.was-validated textarea.form-control:invalid,textarea.form-control.is-invalid{padding-right:calc(1.5em + .75rem);background-position:top calc(.375em + .1875rem) right calc(.375em + .1875rem)}.custom-select.is-invalid,.was-validated .custom-select:invalid{border-color:#dc3545;padding-right:calc((1em + .75rem) * 3 / 4 + 1.75rem);background:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat right .75rem center/8px 10px,url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23dc3545' viewBox='-2 -2 7 7'%3e%3cpath stroke='%23dc3545' d='M0 0l3 3m0-3L0 3'/%3e%3ccircle r='.5'/%3e%3ccircle cx='3' r='.5'/%3e%3ccircle cy='3' r='.5'/%3e%3ccircle cx='3' cy='3' r='.5'/%3e%3c/svg%3E") #fff no-repeat center right 1.75rem/calc(.75em + .375rem) calc(.75em + .375rem)}.custom-select.is-invalid:focus,.was-validated .custom-select:invalid:focus{border-color:#dc3545;box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.custom-select.is-invalid~.invalid-feedback,.custom-select.is-invalid~.invalid-tooltip,.was-validated .custom-select:invalid~.invalid-feedback,.was-validated .custom-select:invalid~.invalid-tooltip{display:block}.form-control-file.is-invalid~.invalid-feedback,.form-control-file.is-invalid~.invalid-tooltip,.was-validated .form-control-file:invalid~.invalid-feedback,.was-validated .form-control-file:invalid~.invalid-tooltip{display:block}.form-check-input.is-invalid~.form-check-label,.was-validated .form-check-input:invalid~.form-check-label{color:#dc3545}.form-check-input.is-invalid~.invalid-feedback,.form-check-input.is-invalid~.invalid-tooltip,.was-validated .form-check-input:invalid~.invalid-feedback,.was-validated .form-check-input:invalid~.invalid-tooltip{display:block}.custom-control-input.is-invalid~.custom-control-label,.was-validated .custom-control-input:invalid~.custom-control-label{color:#dc3545}.custom-control-input.is-invalid~.custom-control-label::before,.was-validated .custom-control-input:invalid~.custom-control-label::before{border-color:#dc3545}.custom-control-input.is-invalid~.invalid-feedback,.custom-control-input.is-invalid~.invalid-tooltip,.was-validated .custom-control-input:invalid~.invalid-feedback,.was-validated .custom-control-input:invalid~.invalid-tooltip{display:block}.custom-control-input.is-invalid:checked~.custom-control-label::before,.was-validated .custom-control-input:invalid:checked~.custom-control-label::before{border-color:#e4606d;background-color:#e4606d}.custom-control-input.is-invalid:focus~.custom-control-label::before,.was-validated .custom-control-input:invalid:focus~.custom-control-label::before{box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.custom-control-input.is-invalid:focus:not(:checked)~.custom-control-label::before,.was-validated .custom-control-input:invalid:focus:not(:checked)~.custom-control-label::before{border-color:#dc3545}.custom-file-input.is-invalid~.custom-file-label,.was-validated .custom-file-input:invalid~.custom-file-label{border-color:#dc3545}.custom-file-input.is-invalid~.invalid-feedback,.custom-file-input.is-invalid~.invalid-tooltip,.was-validated .custom-file-input:invalid~.invalid-feedback,.was-validated .custom-file-input:invalid~.invalid-tooltip{display:block}.custom-file-input.is-invalid:focus~.custom-file-label,.was-validated .custom-file-input:invalid:focus~.custom-file-label{border-color:#dc3545;box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.form-inline{display:-ms-flexbox;display:flex;-ms-flex-flow:row wrap;flex-flow:row wrap;-ms-flex-align:center;align-items:center}.form-inline .form-check{width:100%}@media (min-width:576px){.form-inline label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;margin-bottom:0}.form-inline .form-group{display:-ms-flexbox;display:flex;-ms-flex:0 0 auto;flex:0 0 auto;-ms-flex-flow:row wrap;flex-flow:row wrap;-ms-flex-align:center;align-items:center;margin-bottom:0}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-plaintext{display:inline-block}.form-inline .custom-select,.form-inline .input-group{width:auto}.form-inline .form-check{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:auto;padding-left:0}.form-inline .form-check-input{position:relative;-ms-flex-negative:0;flex-shrink:0;margin-top:0;margin-right:.25rem;margin-left:0}.form-inline .custom-control{-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.form-inline .custom-control-label{margin-bottom:0}}.btn{display:inline-block;font-weight:400;color:#212529;text-align:center;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:transparent;border:1px solid transparent;padding:.375rem .75rem;font-size:1rem;line-height:1.5;border-radius:.25rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.btn{transition:none}}.btn:hover{color:#212529;text-decoration:none}.btn.focus,.btn:focus{outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.btn.disabled,.btn:disabled{opacity:.65}a.btn.disabled,fieldset:disabled a.btn{pointer-events:none}.btn-primary{color:#fff;background-color:#007bff;border-color:#007bff}.btn-primary:hover{color:#fff;background-color:#0069d9;border-color:#0062cc}.btn-primary.focus,.btn-primary:focus{box-shadow:0 0 0 .2rem rgba(38,143,255,.5)}.btn-primary.disabled,.btn-primary:disabled{color:#fff;background-color:#007bff;border-color:#007bff}.btn-primary:not(:disabled):not(.disabled).active,.btn-primary:not(:disabled):not(.disabled):active,.show>.btn-primary.dropdown-toggle{color:#fff;background-color:#0062cc;border-color:#005cbf}.btn-primary:not(:disabled):not(.disabled).active:focus,.btn-primary:not(:disabled):not(.disabled):active:focus,.show>.btn-primary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(38,143,255,.5)}.btn-secondary{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-secondary:hover{color:#fff;background-color:#5a6268;border-color:#545b62}.btn-secondary.focus,.btn-secondary:focus{box-shadow:0 0 0 .2rem rgba(130,138,145,.5)}.btn-secondary.disabled,.btn-secondary:disabled{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-secondary:not(:disabled):not(.disabled).active,.btn-secondary:not(:disabled):not(.disabled):active,.show>.btn-secondary.dropdown-toggle{color:#fff;background-color:#545b62;border-color:#4e555b}.btn-secondary:not(:disabled):not(.disabled).active:focus,.btn-secondary:not(:disabled):not(.disabled):active:focus,.show>.btn-secondary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(130,138,145,.5)}.btn-success{color:#fff;background-color:#28a745;border-color:#28a745}.btn-success:hover{color:#fff;background-color:#218838;border-color:#1e7e34}.btn-success.focus,.btn-success:focus{box-shadow:0 0 0 .2rem rgba(72,180,97,.5)}.btn-success.disabled,.btn-success:disabled{color:#fff;background-color:#28a745;border-color:#28a745}.btn-success:not(:disabled):not(.disabled).active,.btn-success:not(:disabled):not(.disabled):active,.show>.btn-success.dropdown-toggle{color:#fff;background-color:#1e7e34;border-color:#1c7430}.btn-success:not(:disabled):not(.disabled).active:focus,.btn-success:not(:disabled):not(.disabled):active:focus,.show>.btn-success.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(72,180,97,.5)}.btn-info{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-info:hover{color:#fff;background-color:#138496;border-color:#117a8b}.btn-info.focus,.btn-info:focus{box-shadow:0 0 0 .2rem rgba(58,176,195,.5)}.btn-info.disabled,.btn-info:disabled{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-info:not(:disabled):not(.disabled).active,.btn-info:not(:disabled):not(.disabled):active,.show>.btn-info.dropdown-toggle{color:#fff;background-color:#117a8b;border-color:#10707f}.btn-info:not(:disabled):not(.disabled).active:focus,.btn-info:not(:disabled):not(.disabled):active:focus,.show>.btn-info.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(58,176,195,.5)}.btn-warning{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-warning:hover{color:#212529;background-color:#e0a800;border-color:#d39e00}.btn-warning.focus,.btn-warning:focus{box-shadow:0 0 0 .2rem rgba(222,170,12,.5)}.btn-warning.disabled,.btn-warning:disabled{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-warning:not(:disabled):not(.disabled).active,.btn-warning:not(:disabled):not(.disabled):active,.show>.btn-warning.dropdown-toggle{color:#212529;background-color:#d39e00;border-color:#c69500}.btn-warning:not(:disabled):not(.disabled).active:focus,.btn-warning:not(:disabled):not(.disabled):active:focus,.show>.btn-warning.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(222,170,12,.5)}.btn-danger{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-danger:hover{color:#fff;background-color:#c82333;border-color:#bd2130}.btn-danger.focus,.btn-danger:focus{box-shadow:0 0 0 .2rem rgba(225,83,97,.5)}.btn-danger.disabled,.btn-danger:disabled{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-danger:not(:disabled):not(.disabled).active,.btn-danger:not(:disabled):not(.disabled):active,.show>.btn-danger.dropdown-toggle{color:#fff;background-color:#bd2130;border-color:#b21f2d}.btn-danger:not(:disabled):not(.disabled).active:focus,.btn-danger:not(:disabled):not(.disabled):active:focus,.show>.btn-danger.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(225,83,97,.5)}.btn-light{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-light:hover{color:#212529;background-color:#e2e6ea;border-color:#dae0e5}.btn-light.focus,.btn-light:focus{box-shadow:0 0 0 .2rem rgba(216,217,219,.5)}.btn-light.disabled,.btn-light:disabled{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-light:not(:disabled):not(.disabled).active,.btn-light:not(:disabled):not(.disabled):active,.show>.btn-light.dropdown-toggle{color:#212529;background-color:#dae0e5;border-color:#d3d9df}.btn-light:not(:disabled):not(.disabled).active:focus,.btn-light:not(:disabled):not(.disabled):active:focus,.show>.btn-light.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(216,217,219,.5)}.btn-dark{color:#fff;background-color:#343a40;border-color:#343a40}.btn-dark:hover{color:#fff;background-color:#23272b;border-color:#1d2124}.btn-dark.focus,.btn-dark:focus{box-shadow:0 0 0 .2rem rgba(82,88,93,.5)}.btn-dark.disabled,.btn-dark:disabled{color:#fff;background-color:#343a40;border-color:#343a40}.btn-dark:not(:disabled):not(.disabled).active,.btn-dark:not(:disabled):not(.disabled):active,.show>.btn-dark.dropdown-toggle{color:#fff;background-color:#1d2124;border-color:#171a1d}.btn-dark:not(:disabled):not(.disabled).active:focus,.btn-dark:not(:disabled):not(.disabled):active:focus,.show>.btn-dark.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(82,88,93,.5)}.btn-outline-primary{color:#007bff;border-color:#007bff}.btn-outline-primary:hover{color:#fff;background-color:#007bff;border-color:#007bff}.btn-outline-primary.focus,.btn-outline-primary:focus{box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.btn-outline-primary.disabled,.btn-outline-primary:disabled{color:#007bff;background-color:transparent}.btn-outline-primary:not(:disabled):not(.disabled).active,.btn-outline-primary:not(:disabled):not(.disabled):active,.show>.btn-outline-primary.dropdown-toggle{color:#fff;background-color:#007bff;border-color:#007bff}.btn-outline-primary:not(:disabled):not(.disabled).active:focus,.btn-outline-primary:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-primary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.btn-outline-secondary{color:#6c757d;border-color:#6c757d}.btn-outline-secondary:hover{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-outline-secondary.focus,.btn-outline-secondary:focus{box-shadow:0 0 0 .2rem rgba(108,117,125,.5)}.btn-outline-secondary.disabled,.btn-outline-secondary:disabled{color:#6c757d;background-color:transparent}.btn-outline-secondary:not(:disabled):not(.disabled).active,.btn-outline-secondary:not(:disabled):not(.disabled):active,.show>.btn-outline-secondary.dropdown-toggle{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-outline-secondary:not(:disabled):not(.disabled).active:focus,.btn-outline-secondary:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-secondary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(108,117,125,.5)}.btn-outline-success{color:#28a745;border-color:#28a745}.btn-outline-success:hover{color:#fff;background-color:#28a745;border-color:#28a745}.btn-outline-success.focus,.btn-outline-success:focus{box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.btn-outline-success.disabled,.btn-outline-success:disabled{color:#28a745;background-color:transparent}.btn-outline-success:not(:disabled):not(.disabled).active,.btn-outline-success:not(:disabled):not(.disabled):active,.show>.btn-outline-success.dropdown-toggle{color:#fff;background-color:#28a745;border-color:#28a745}.btn-outline-success:not(:disabled):not(.disabled).active:focus,.btn-outline-success:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-success.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.btn-outline-info{color:#17a2b8;border-color:#17a2b8}.btn-outline-info:hover{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-outline-info.focus,.btn-outline-info:focus{box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.btn-outline-info.disabled,.btn-outline-info:disabled{color:#17a2b8;background-color:transparent}.btn-outline-info:not(:disabled):not(.disabled).active,.btn-outline-info:not(:disabled):not(.disabled):active,.show>.btn-outline-info.dropdown-toggle{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-outline-info:not(:disabled):not(.disabled).active:focus,.btn-outline-info:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-info.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.btn-outline-warning{color:#ffc107;border-color:#ffc107}.btn-outline-warning:hover{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-outline-warning.focus,.btn-outline-warning:focus{box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.btn-outline-warning.disabled,.btn-outline-warning:disabled{color:#ffc107;background-color:transparent}.btn-outline-warning:not(:disabled):not(.disabled).active,.btn-outline-warning:not(:disabled):not(.disabled):active,.show>.btn-outline-warning.dropdown-toggle{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-outline-warning:not(:disabled):not(.disabled).active:focus,.btn-outline-warning:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-warning.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.btn-outline-danger{color:#dc3545;border-color:#dc3545}.btn-outline-danger:hover{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-outline-danger.focus,.btn-outline-danger:focus{box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.btn-outline-danger.disabled,.btn-outline-danger:disabled{color:#dc3545;background-color:transparent}.btn-outline-danger:not(:disabled):not(.disabled).active,.btn-outline-danger:not(:disabled):not(.disabled):active,.show>.btn-outline-danger.dropdown-toggle{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-outline-danger:not(:disabled):not(.disabled).active:focus,.btn-outline-danger:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-danger.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.btn-outline-light{color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light:hover{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light.focus,.btn-outline-light:focus{box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.btn-outline-light.disabled,.btn-outline-light:disabled{color:#f8f9fa;background-color:transparent}.btn-outline-light:not(:disabled):not(.disabled).active,.btn-outline-light:not(:disabled):not(.disabled):active,.show>.btn-outline-light.dropdown-toggle{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light:not(:disabled):not(.disabled).active:focus,.btn-outline-light:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-light.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.btn-outline-dark{color:#343a40;border-color:#343a40}.btn-outline-dark:hover{color:#fff;background-color:#343a40;border-color:#343a40}.btn-outline-dark.focus,.btn-outline-dark:focus{box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.btn-outline-dark.disabled,.btn-outline-dark:disabled{color:#343a40;background-color:transparent}.btn-outline-dark:not(:disabled):not(.disabled).active,.btn-outline-dark:not(:disabled):not(.disabled):active,.show>.btn-outline-dark.dropdown-toggle{color:#fff;background-color:#343a40;border-color:#343a40}.btn-outline-dark:not(:disabled):not(.disabled).active:focus,.btn-outline-dark:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-dark.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.btn-link{font-weight:400;color:#007bff;text-decoration:none}.btn-link:hover{color:#0056b3;text-decoration:underline}.btn-link.focus,.btn-link:focus{text-decoration:underline;box-shadow:none}.btn-link.disabled,.btn-link:disabled{color:#6c757d;pointer-events:none}.btn-group-lg>.btn,.btn-lg{padding:.5rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:.3rem}.btn-group-sm>.btn,.btn-sm{padding:.25rem .5rem;font-size:.875rem;line-height:1.5;border-radius:.2rem}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:.5rem}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{transition:opacity .15s linear}@media (prefers-reduced-motion:reduce){.fade{transition:none}}.fade:not(.show){opacity:0}.collapse:not(.show){display:none}.collapsing{position:relative;height:0;overflow:hidden;transition:height .35s ease}@media (prefers-reduced-motion:reduce){.collapsing{transition:none}}.dropdown,.dropleft,.dropright,.dropup{position:relative}.dropdown-toggle{white-space:nowrap}.dropdown-toggle::after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:.3em solid;border-right:.3em solid transparent;border-bottom:0;border-left:.3em solid transparent}.dropdown-toggle:empty::after{margin-left:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:10rem;padding:.5rem 0;margin:.125rem 0 0;font-size:1rem;color:#212529;text-align:left;list-style:none;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.15);border-radius:.25rem}.dropdown-menu-left{right:auto;left:0}.dropdown-menu-right{right:0;left:auto}@media (min-width:576px){.dropdown-menu-sm-left{right:auto;left:0}.dropdown-menu-sm-right{right:0;left:auto}}@media (min-width:768px){.dropdown-menu-md-left{right:auto;left:0}.dropdown-menu-md-right{right:0;left:auto}}@media (min-width:992px){.dropdown-menu-lg-left{right:auto;left:0}.dropdown-menu-lg-right{right:0;left:auto}}@media (min-width:1200px){.dropdown-menu-xl-left{right:auto;left:0}.dropdown-menu-xl-right{right:0;left:auto}}.dropup .dropdown-menu{top:auto;bottom:100%;margin-top:0;margin-bottom:.125rem}.dropup .dropdown-toggle::after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:0;border-right:.3em solid transparent;border-bottom:.3em solid;border-left:.3em solid transparent}.dropup .dropdown-toggle:empty::after{margin-left:0}.dropright .dropdown-menu{top:0;right:auto;left:100%;margin-top:0;margin-left:.125rem}.dropright .dropdown-toggle::after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:.3em solid transparent;border-right:0;border-bottom:.3em solid transparent;border-left:.3em solid}.dropright .dropdown-toggle:empty::after{margin-left:0}.dropright .dropdown-toggle::after{vertical-align:0}.dropleft .dropdown-menu{top:0;right:100%;left:auto;margin-top:0;margin-right:.125rem}.dropleft .dropdown-toggle::after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:""}.dropleft .dropdown-toggle::after{display:none}.dropleft .dropdown-toggle::before{display:inline-block;margin-right:.255em;vertical-align:.255em;content:"";border-top:.3em solid transparent;border-right:.3em solid;border-bottom:.3em solid transparent}.dropleft .dropdown-toggle:empty::after{margin-left:0}.dropleft .dropdown-toggle::before{vertical-align:0}.dropdown-menu[x-placement^=bottom],.dropdown-menu[x-placement^=left],.dropdown-menu[x-placement^=right],.dropdown-menu[x-placement^=top]{right:auto;bottom:auto}.dropdown-divider{height:0;margin:.5rem 0;overflow:hidden;border-top:1px solid #e9ecef}.dropdown-item{display:block;width:100%;padding:.25rem 1.5rem;clear:both;font-weight:400;color:#212529;text-align:inherit;white-space:nowrap;background-color:transparent;border:0}.dropdown-item:focus,.dropdown-item:hover{color:#16181b;text-decoration:none;background-color:#f8f9fa}.dropdown-item.active,.dropdown-item:active{color:#fff;text-decoration:none;background-color:#007bff}.dropdown-item.disabled,.dropdown-item:disabled{color:#6c757d;pointer-events:none;background-color:transparent}.dropdown-menu.show{display:block}.dropdown-header{display:block;padding:.5rem 1.5rem;margin-bottom:0;font-size:.875rem;color:#6c757d;white-space:nowrap}.dropdown-item-text{display:block;padding:.25rem 1.5rem;color:#212529}.btn-group,.btn-group-vertical{position:relative;display:-ms-inline-flexbox;display:inline-flex;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;-ms-flex:1 1 auto;flex:1 1 auto}.btn-group-vertical>.btn:hover,.btn-group>.btn:hover{z-index:1}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus{z-index:1}.btn-toolbar{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:start;justify-content:flex-start}.btn-toolbar .input-group{width:auto}.btn-group>.btn-group:not(:first-child),.btn-group>.btn:not(:first-child){margin-left:-1px}.btn-group>.btn-group:not(:last-child)>.btn,.btn-group>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:not(:first-child)>.btn,.btn-group>.btn:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.dropdown-toggle-split{padding-right:.5625rem;padding-left:.5625rem}.dropdown-toggle-split::after,.dropright .dropdown-toggle-split::after,.dropup .dropdown-toggle-split::after{margin-left:0}.dropleft .dropdown-toggle-split::before{margin-right:0}.btn-group-sm>.btn+.dropdown-toggle-split,.btn-sm+.dropdown-toggle-split{padding-right:.375rem;padding-left:.375rem}.btn-group-lg>.btn+.dropdown-toggle-split,.btn-lg+.dropdown-toggle-split{padding-right:.75rem;padding-left:.75rem}.btn-group-vertical{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:flex-start;-ms-flex-pack:center;justify-content:center}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group{width:100%}.btn-group-vertical>.btn-group:not(:first-child),.btn-group-vertical>.btn:not(:first-child){margin-top:-1px}.btn-group-vertical>.btn-group:not(:last-child)>.btn,.btn-group-vertical>.btn:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:not(:first-child)>.btn,.btn-group-vertical>.btn:not(:first-child){border-top-left-radius:0;border-top-right-radius:0}.btn-group-toggle>.btn,.btn-group-toggle>.btn-group>.btn{margin-bottom:0}.btn-group-toggle>.btn input[type=checkbox],.btn-group-toggle>.btn input[type=radio],.btn-group-toggle>.btn-group>.btn input[type=checkbox],.btn-group-toggle>.btn-group>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:stretch;align-items:stretch;width:100%}.input-group>.custom-file,.input-group>.custom-select,.input-group>.form-control,.input-group>.form-control-plaintext{position:relative;-ms-flex:1 1 auto;flex:1 1 auto;width:1%;margin-bottom:0}.input-group>.custom-file+.custom-file,.input-group>.custom-file+.custom-select,.input-group>.custom-file+.form-control,.input-group>.custom-select+.custom-file,.input-group>.custom-select+.custom-select,.input-group>.custom-select+.form-control,.input-group>.form-control+.custom-file,.input-group>.form-control+.custom-select,.input-group>.form-control+.form-control,.input-group>.form-control-plaintext+.custom-file,.input-group>.form-control-plaintext+.custom-select,.input-group>.form-control-plaintext+.form-control{margin-left:-1px}.input-group>.custom-file .custom-file-input:focus~.custom-file-label,.input-group>.custom-select:focus,.input-group>.form-control:focus{z-index:3}.input-group>.custom-file .custom-file-input:focus{z-index:4}.input-group>.custom-select:not(:last-child),.input-group>.form-control:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.custom-select:not(:first-child),.input-group>.form-control:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.input-group>.custom-file{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.input-group>.custom-file:not(:last-child) .custom-file-label,.input-group>.custom-file:not(:last-child) .custom-file-label::after{border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.custom-file:not(:first-child) .custom-file-label{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-append,.input-group-prepend{display:-ms-flexbox;display:flex}.input-group-append .btn,.input-group-prepend .btn{position:relative;z-index:2}.input-group-append .btn:focus,.input-group-prepend .btn:focus{z-index:3}.input-group-append .btn+.btn,.input-group-append .btn+.input-group-text,.input-group-append .input-group-text+.btn,.input-group-append .input-group-text+.input-group-text,.input-group-prepend .btn+.btn,.input-group-prepend .btn+.input-group-text,.input-group-prepend .input-group-text+.btn,.input-group-prepend .input-group-text+.input-group-text{margin-left:-1px}.input-group-prepend{margin-right:-1px}.input-group-append{margin-left:-1px}.input-group-text{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:.375rem .75rem;margin-bottom:0;font-size:1rem;font-weight:400;line-height:1.5;color:#495057;text-align:center;white-space:nowrap;background-color:#e9ecef;border:1px solid #ced4da;border-radius:.25rem}.input-group-text input[type=checkbox],.input-group-text input[type=radio]{margin-top:0}.input-group-lg>.custom-select,.input-group-lg>.form-control:not(textarea){height:calc(1.5em + 1rem + 2px)}.input-group-lg>.custom-select,.input-group-lg>.form-control,.input-group-lg>.input-group-append>.btn,.input-group-lg>.input-group-append>.input-group-text,.input-group-lg>.input-group-prepend>.btn,.input-group-lg>.input-group-prepend>.input-group-text{padding:.5rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:.3rem}.input-group-sm>.custom-select,.input-group-sm>.form-control:not(textarea){height:calc(1.5em + .5rem + 2px)}.input-group-sm>.custom-select,.input-group-sm>.form-control,.input-group-sm>.input-group-append>.btn,.input-group-sm>.input-group-append>.input-group-text,.input-group-sm>.input-group-prepend>.btn,.input-group-sm>.input-group-prepend>.input-group-text{padding:.25rem .5rem;font-size:.875rem;line-height:1.5;border-radius:.2rem}.input-group-lg>.custom-select,.input-group-sm>.custom-select{padding-right:1.75rem}.input-group>.input-group-append:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group>.input-group-append:last-child>.input-group-text:not(:last-child),.input-group>.input-group-append:not(:last-child)>.btn,.input-group>.input-group-append:not(:last-child)>.input-group-text,.input-group>.input-group-prepend>.btn,.input-group>.input-group-prepend>.input-group-text{border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.input-group-append>.btn,.input-group>.input-group-append>.input-group-text,.input-group>.input-group-prepend:first-child>.btn:not(:first-child),.input-group>.input-group-prepend:first-child>.input-group-text:not(:first-child),.input-group>.input-group-prepend:not(:first-child)>.btn,.input-group>.input-group-prepend:not(:first-child)>.input-group-text{border-top-left-radius:0;border-bottom-left-radius:0}.custom-control{position:relative;display:block;min-height:1.5rem;padding-left:1.5rem}.custom-control-inline{display:-ms-inline-flexbox;display:inline-flex;margin-right:1rem}.custom-control-input{position:absolute;z-index:-1;opacity:0}.custom-control-input:checked~.custom-control-label::before{color:#fff;border-color:#007bff;background-color:#007bff}.custom-control-input:focus~.custom-control-label::before{box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.custom-control-input:focus:not(:checked)~.custom-control-label::before{border-color:#80bdff}.custom-control-input:not(:disabled):active~.custom-control-label::before{color:#fff;background-color:#b3d7ff;border-color:#b3d7ff}.custom-control-input:disabled~.custom-control-label{color:#6c757d}.custom-control-input:disabled~.custom-control-label::before{background-color:#e9ecef}.custom-control-label{position:relative;margin-bottom:0;vertical-align:top}.custom-control-label::before{position:absolute;top:.25rem;left:-1.5rem;display:block;width:1rem;height:1rem;pointer-events:none;content:"";background-color:#fff;border:#adb5bd solid 1px}.custom-control-label::after{position:absolute;top:.25rem;left:-1.5rem;display:block;width:1rem;height:1rem;content:"";background:no-repeat 50%/50% 50%}.custom-checkbox .custom-control-label::before{border-radius:.25rem}.custom-checkbox .custom-control-input:checked~.custom-control-label::after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3e%3c/svg%3e")}.custom-checkbox .custom-control-input:indeterminate~.custom-control-label::before{border-color:#007bff;background-color:#007bff}.custom-checkbox .custom-control-input:indeterminate~.custom-control-label::after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 4'%3e%3cpath stroke='%23fff' d='M0 2h4'/%3e%3c/svg%3e")}.custom-checkbox .custom-control-input:disabled:checked~.custom-control-label::before{background-color:rgba(0,123,255,.5)}.custom-checkbox .custom-control-input:disabled:indeterminate~.custom-control-label::before{background-color:rgba(0,123,255,.5)}.custom-radio .custom-control-label::before{border-radius:50%}.custom-radio .custom-control-input:checked~.custom-control-label::after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e")}.custom-radio .custom-control-input:disabled:checked~.custom-control-label::before{background-color:rgba(0,123,255,.5)}.custom-switch{padding-left:2.25rem}.custom-switch .custom-control-label::before{left:-2.25rem;width:1.75rem;pointer-events:all;border-radius:.5rem}.custom-switch .custom-control-label::after{top:calc(.25rem + 2px);left:calc(-2.25rem + 2px);width:calc(1rem - 4px);height:calc(1rem - 4px);background-color:#adb5bd;border-radius:.5rem;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out,-webkit-transform .15s ease-in-out;transition:transform .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:transform .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out,-webkit-transform .15s ease-in-out}@media (prefers-reduced-motion:reduce){.custom-switch .custom-control-label::after{transition:none}}.custom-switch .custom-control-input:checked~.custom-control-label::after{background-color:#fff;-webkit-transform:translateX(.75rem);transform:translateX(.75rem)}.custom-switch .custom-control-input:disabled:checked~.custom-control-label::before{background-color:rgba(0,123,255,.5)}.custom-select{display:inline-block;width:100%;height:calc(1.5em + .75rem + 2px);padding:.375rem 1.75rem .375rem .75rem;font-size:1rem;font-weight:400;line-height:1.5;color:#495057;vertical-align:middle;background:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat right .75rem center/8px 10px;background-color:#fff;border:1px solid #ced4da;border-radius:.25rem;-webkit-appearance:none;-moz-appearance:none;appearance:none}.custom-select:focus{border-color:#80bdff;outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.custom-select:focus::-ms-value{color:#495057;background-color:#fff}.custom-select[multiple],.custom-select[size]:not([size="1"]){height:auto;padding-right:.75rem;background-image:none}.custom-select:disabled{color:#6c757d;background-color:#e9ecef}.custom-select::-ms-expand{display:none}.custom-select-sm{height:calc(1.5em + .5rem + 2px);padding-top:.25rem;padding-bottom:.25rem;padding-left:.5rem;font-size:.875rem}.custom-select-lg{height:calc(1.5em + 1rem + 2px);padding-top:.5rem;padding-bottom:.5rem;padding-left:1rem;font-size:1.25rem}.custom-file{position:relative;display:inline-block;width:100%;height:calc(1.5em + .75rem + 2px);margin-bottom:0}.custom-file-input{position:relative;z-index:2;width:100%;height:calc(1.5em + .75rem + 2px);margin:0;opacity:0}.custom-file-input:focus~.custom-file-label{border-color:#80bdff;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.custom-file-input:disabled~.custom-file-label{background-color:#e9ecef}.custom-file-input:lang(en)~.custom-file-label::after{content:"Browse"}.custom-file-input~.custom-file-label[data-browse]::after{content:attr(data-browse)}.custom-file-label{position:absolute;top:0;right:0;left:0;z-index:1;height:calc(1.5em + .75rem + 2px);padding:.375rem .75rem;font-weight:400;line-height:1.5;color:#495057;background-color:#fff;border:1px solid #ced4da;border-radius:.25rem}.custom-file-label::after{position:absolute;top:0;right:0;bottom:0;z-index:3;display:block;height:calc(1.5em + .75rem);padding:.375rem .75rem;line-height:1.5;color:#495057;content:"Browse";background-color:#e9ecef;border-left:inherit;border-radius:0 .25rem .25rem 0}.custom-range{width:100%;height:calc(1rem + .4rem);padding:0;background-color:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none}.custom-range:focus{outline:0}.custom-range:focus::-webkit-slider-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .2rem rgba(0,123,255,.25)}.custom-range:focus::-moz-range-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .2rem rgba(0,123,255,.25)}.custom-range:focus::-ms-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .2rem rgba(0,123,255,.25)}.custom-range::-moz-focus-outer{border:0}.custom-range::-webkit-slider-thumb{width:1rem;height:1rem;margin-top:-.25rem;background-color:#007bff;border:0;border-radius:1rem;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;-webkit-appearance:none;appearance:none}@media (prefers-reduced-motion:reduce){.custom-range::-webkit-slider-thumb{transition:none}}.custom-range::-webkit-slider-thumb:active{background-color:#b3d7ff}.custom-range::-webkit-slider-runnable-track{width:100%;height:.5rem;color:transparent;cursor:pointer;background-color:#dee2e6;border-color:transparent;border-radius:1rem}.custom-range::-moz-range-thumb{width:1rem;height:1rem;background-color:#007bff;border:0;border-radius:1rem;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;-moz-appearance:none;appearance:none}@media (prefers-reduced-motion:reduce){.custom-range::-moz-range-thumb{transition:none}}.custom-range::-moz-range-thumb:active{background-color:#b3d7ff}.custom-range::-moz-range-track{width:100%;height:.5rem;color:transparent;cursor:pointer;background-color:#dee2e6;border-color:transparent;border-radius:1rem}.custom-range::-ms-thumb{width:1rem;height:1rem;margin-top:0;margin-right:.2rem;margin-left:.2rem;background-color:#007bff;border:0;border-radius:1rem;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;appearance:none}@media (prefers-reduced-motion:reduce){.custom-range::-ms-thumb{transition:none}}.custom-range::-ms-thumb:active{background-color:#b3d7ff}.custom-range::-ms-track{width:100%;height:.5rem;color:transparent;cursor:pointer;background-color:transparent;border-color:transparent;border-width:.5rem}.custom-range::-ms-fill-lower{background-color:#dee2e6;border-radius:1rem}.custom-range::-ms-fill-upper{margin-right:15px;background-color:#dee2e6;border-radius:1rem}.custom-range:disabled::-webkit-slider-thumb{background-color:#adb5bd}.custom-range:disabled::-webkit-slider-runnable-track{cursor:default}.custom-range:disabled::-moz-range-thumb{background-color:#adb5bd}.custom-range:disabled::-moz-range-track{cursor:default}.custom-range:disabled::-ms-thumb{background-color:#adb5bd}.custom-control-label::before,.custom-file-label,.custom-select{transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.custom-control-label::before,.custom-file-label,.custom-select{transition:none}}.nav{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;padding-left:0;margin-bottom:0;list-style:none}.nav-link{display:block;padding:.5rem 1rem}.nav-link:focus,.nav-link:hover{text-decoration:none}.nav-link.disabled{color:#6c757d;pointer-events:none;cursor:default}.nav-tabs{border-bottom:1px solid #dee2e6}.nav-tabs .nav-item{margin-bottom:-1px}.nav-tabs .nav-link{border:1px solid transparent;border-top-left-radius:.25rem;border-top-right-radius:.25rem}.nav-tabs .nav-link:focus,.nav-tabs .nav-link:hover{border-color:#e9ecef #e9ecef #dee2e6}.nav-tabs .nav-link.disabled{color:#6c757d;background-color:transparent;border-color:transparent}.nav-tabs .nav-item.show .nav-link,.nav-tabs .nav-link.active{color:#495057;background-color:#fff;border-color:#dee2e6 #dee2e6 #fff}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.nav-pills .nav-link{border-radius:.25rem}.nav-pills .nav-link.active,.nav-pills .show>.nav-link{color:#fff;background-color:#007bff}.nav-fill .nav-item{-ms-flex:1 1 auto;flex:1 1 auto;text-align:center}.nav-justified .nav-item{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;text-align:center}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.navbar{position:relative;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;padding:.5rem 1rem}.navbar>.container,.navbar>.container-fluid{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between}.navbar-brand{display:inline-block;padding-top:.3125rem;padding-bottom:.3125rem;margin-right:1rem;font-size:1.25rem;line-height:inherit;white-space:nowrap}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-nav{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;padding-left:0;margin-bottom:0;list-style:none}.navbar-nav .nav-link{padding-right:0;padding-left:0}.navbar-nav .dropdown-menu{position:static;float:none}.navbar-text{display:inline-block;padding-top:.5rem;padding-bottom:.5rem}.navbar-collapse{-ms-flex-preferred-size:100%;flex-basis:100%;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:center;align-items:center}.navbar-toggler{padding:.25rem .75rem;font-size:1.25rem;line-height:1;background-color:transparent;border:1px solid transparent;border-radius:.25rem}.navbar-toggler:focus,.navbar-toggler:hover{text-decoration:none}.navbar-toggler-icon{display:inline-block;width:1.5em;height:1.5em;vertical-align:middle;content:"";background:no-repeat center center;background-size:100% 100%}@media (max-width:575.98px){.navbar-expand-sm>.container,.navbar-expand-sm>.container-fluid{padding-right:0;padding-left:0}}@media (min-width:576px){.navbar-expand-sm{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-sm .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand-sm .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-sm .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-sm>.container,.navbar-expand-sm>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-sm .navbar-collapse{display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-sm .navbar-toggler{display:none}}@media (max-width:767.98px){.navbar-expand-md>.container,.navbar-expand-md>.container-fluid{padding-right:0;padding-left:0}}@media (min-width:768px){.navbar-expand-md{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-md .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand-md .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-md .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-md>.container,.navbar-expand-md>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-md .navbar-collapse{display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-md .navbar-toggler{display:none}}@media (max-width:991.98px){.navbar-expand-lg>.container,.navbar-expand-lg>.container-fluid{padding-right:0;padding-left:0}}@media (min-width:992px){.navbar-expand-lg{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-lg .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-lg .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-lg>.container,.navbar-expand-lg>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-lg .navbar-collapse{display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-lg .navbar-toggler{display:none}}@media (max-width:1199.98px){.navbar-expand-xl>.container,.navbar-expand-xl>.container-fluid{padding-right:0;padding-left:0}}@media (min-width:1200px){.navbar-expand-xl{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-xl .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-xl .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-xl>.container,.navbar-expand-xl>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-xl .navbar-collapse{display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-xl .navbar-toggler{display:none}}.navbar-expand{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand>.container,.navbar-expand>.container-fluid{padding-right:0;padding-left:0}.navbar-expand .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand .navbar-nav .dropdown-menu{position:absolute}.navbar-expand .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand>.container,.navbar-expand>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand .navbar-collapse{display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand .navbar-toggler{display:none}.navbar-light .navbar-brand{color:rgba(0,0,0,.9)}.navbar-light .navbar-brand:focus,.navbar-light .navbar-brand:hover{color:rgba(0,0,0,.9)}.navbar-light .navbar-nav .nav-link{color:rgba(0,0,0,.5)}.navbar-light .navbar-nav .nav-link:focus,.navbar-light .navbar-nav .nav-link:hover{color:rgba(0,0,0,.7)}.navbar-light .navbar-nav .nav-link.disabled{color:rgba(0,0,0,.3)}.navbar-light .navbar-nav .active>.nav-link,.navbar-light .navbar-nav .nav-link.active,.navbar-light .navbar-nav .nav-link.show,.navbar-light .navbar-nav .show>.nav-link{color:rgba(0,0,0,.9)}.navbar-light .navbar-toggler{color:rgba(0,0,0,.5);border-color:rgba(0,0,0,.1)}.navbar-light .navbar-toggler-icon{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3e%3cpath stroke='rgba(0, 0, 0, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e")}.navbar-light .navbar-text{color:rgba(0,0,0,.5)}.navbar-light .navbar-text a{color:rgba(0,0,0,.9)}.navbar-light .navbar-text a:focus,.navbar-light .navbar-text a:hover{color:rgba(0,0,0,.9)}.navbar-dark .navbar-brand{color:#fff}.navbar-dark .navbar-brand:focus,.navbar-dark .navbar-brand:hover{color:#fff}.navbar-dark .navbar-nav .nav-link{color:rgba(255,255,255,.5)}.navbar-dark .navbar-nav .nav-link:focus,.navbar-dark .navbar-nav .nav-link:hover{color:rgba(255,255,255,.75)}.navbar-dark .navbar-nav .nav-link.disabled{color:rgba(255,255,255,.25)}.navbar-dark .navbar-nav .active>.nav-link,.navbar-dark .navbar-nav .nav-link.active,.navbar-dark .navbar-nav .nav-link.show,.navbar-dark .navbar-nav .show>.nav-link{color:#fff}.navbar-dark .navbar-toggler{color:rgba(255,255,255,.5);border-color:rgba(255,255,255,.1)}.navbar-dark .navbar-toggler-icon{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3e%3cpath stroke='rgba(255, 255, 255, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e")}.navbar-dark .navbar-text{color:rgba(255,255,255,.5)}.navbar-dark .navbar-text a{color:#fff}.navbar-dark .navbar-text a:focus,.navbar-dark .navbar-text a:hover{color:#fff}.card{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;min-width:0;word-wrap:break-word;background-color:#fff;background-clip:border-box;border:1px solid rgba(0,0,0,.125);border-radius:.25rem}.card>hr{margin-right:0;margin-left:0}.card>.list-group:first-child .list-group-item:first-child{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.card>.list-group:last-child .list-group-item:last-child{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.card-body{-ms-flex:1 1 auto;flex:1 1 auto;padding:1.25rem}.card-title{margin-bottom:.75rem}.card-subtitle{margin-top:-.375rem;margin-bottom:0}.card-text:last-child{margin-bottom:0}.card-link:hover{text-decoration:none}.card-link+.card-link{margin-left:1.25rem}.card-header{padding:.75rem 1.25rem;margin-bottom:0;background-color:rgba(0,0,0,.03);border-bottom:1px solid rgba(0,0,0,.125)}.card-header:first-child{border-radius:calc(.25rem - 1px) calc(.25rem - 1px) 0 0}.card-header+.list-group .list-group-item:first-child{border-top:0}.card-footer{padding:.75rem 1.25rem;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.125)}.card-footer:last-child{border-radius:0 0 calc(.25rem - 1px) calc(.25rem - 1px)}.card-header-tabs{margin-right:-.625rem;margin-bottom:-.75rem;margin-left:-.625rem;border-bottom:0}.card-header-pills{margin-right:-.625rem;margin-left:-.625rem}.card-img-overlay{position:absolute;top:0;right:0;bottom:0;left:0;padding:1.25rem}.card-img{width:100%;border-radius:calc(.25rem - 1px)}.card-img-top{width:100%;border-top-left-radius:calc(.25rem - 1px);border-top-right-radius:calc(.25rem - 1px)}.card-img-bottom{width:100%;border-bottom-right-radius:calc(.25rem - 1px);border-bottom-left-radius:calc(.25rem - 1px)}.card-deck{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.card-deck .card{margin-bottom:15px}@media (min-width:576px){.card-deck{-ms-flex-flow:row wrap;flex-flow:row wrap;margin-right:-15px;margin-left:-15px}.card-deck .card{display:-ms-flexbox;display:flex;-ms-flex:1 0 0%;flex:1 0 0%;-ms-flex-direction:column;flex-direction:column;margin-right:15px;margin-bottom:0;margin-left:15px}}.card-group{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.card-group>.card{margin-bottom:15px}@media (min-width:576px){.card-group{-ms-flex-flow:row wrap;flex-flow:row wrap}.card-group>.card{-ms-flex:1 0 0%;flex:1 0 0%;margin-bottom:0}.card-group>.card+.card{margin-left:0;border-left:0}.card-group>.card:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.card-group>.card:not(:last-child) .card-header,.card-group>.card:not(:last-child) .card-img-top{border-top-right-radius:0}.card-group>.card:not(:last-child) .card-footer,.card-group>.card:not(:last-child) .card-img-bottom{border-bottom-right-radius:0}.card-group>.card:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.card-group>.card:not(:first-child) .card-header,.card-group>.card:not(:first-child) .card-img-top{border-top-left-radius:0}.card-group>.card:not(:first-child) .card-footer,.card-group>.card:not(:first-child) .card-img-bottom{border-bottom-left-radius:0}}.card-columns .card{margin-bottom:.75rem}@media (min-width:576px){.card-columns{-webkit-column-count:3;-moz-column-count:3;column-count:3;-webkit-column-gap:1.25rem;-moz-column-gap:1.25rem;column-gap:1.25rem;orphans:1;widows:1}.card-columns .card{display:inline-block;width:100%}}.accordion>.card{overflow:hidden}.accordion>.card:not(:first-of-type) .card-header:first-child{border-radius:0}.accordion>.card:not(:first-of-type):not(:last-of-type){border-bottom:0;border-radius:0}.accordion>.card:first-of-type{border-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.accordion>.card:last-of-type{border-top-left-radius:0;border-top-right-radius:0}.accordion>.card .card-header{margin-bottom:-1px}.breadcrumb{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;padding:.75rem 1rem;margin-bottom:1rem;list-style:none;background-color:#e9ecef;border-radius:.25rem}.breadcrumb-item+.breadcrumb-item{padding-left:.5rem}.breadcrumb-item+.breadcrumb-item::before{display:inline-block;padding-right:.5rem;color:#6c757d;content:"/"}.breadcrumb-item+.breadcrumb-item:hover::before{text-decoration:underline}.breadcrumb-item+.breadcrumb-item:hover::before{text-decoration:none}.breadcrumb-item.active{color:#6c757d}.pagination{display:-ms-flexbox;display:flex;padding-left:0;list-style:none;border-radius:.25rem}.page-link{position:relative;display:block;padding:.5rem .75rem;margin-left:-1px;line-height:1.25;color:#007bff;background-color:#fff;border:1px solid #dee2e6}.page-link:hover{z-index:2;color:#0056b3;text-decoration:none;background-color:#e9ecef;border-color:#dee2e6}.page-link:focus{z-index:2;outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.page-item:first-child .page-link{margin-left:0;border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.page-item:last-child .page-link{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.page-item.active .page-link{z-index:1;color:#fff;background-color:#007bff;border-color:#007bff}.page-item.disabled .page-link{color:#6c757d;pointer-events:none;cursor:auto;background-color:#fff;border-color:#dee2e6}.pagination-lg .page-link{padding:.75rem 1.5rem;font-size:1.25rem;line-height:1.5}.pagination-lg .page-item:first-child .page-link{border-top-left-radius:.3rem;border-bottom-left-radius:.3rem}.pagination-lg .page-item:last-child .page-link{border-top-right-radius:.3rem;border-bottom-right-radius:.3rem}.pagination-sm .page-link{padding:.25rem .5rem;font-size:.875rem;line-height:1.5}.pagination-sm .page-item:first-child .page-link{border-top-left-radius:.2rem;border-bottom-left-radius:.2rem}.pagination-sm .page-item:last-child .page-link{border-top-right-radius:.2rem;border-bottom-right-radius:.2rem}.badge{display:inline-block;padding:.25em .4em;font-size:75%;font-weight:700;line-height:1;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.badge{transition:none}}a.badge:focus,a.badge:hover{text-decoration:none}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.badge-pill{padding-right:.6em;padding-left:.6em;border-radius:10rem}.badge-primary{color:#fff;background-color:#007bff}a.badge-primary:focus,a.badge-primary:hover{color:#fff;background-color:#0062cc}a.badge-primary.focus,a.badge-primary:focus{outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.badge-secondary{color:#fff;background-color:#6c757d}a.badge-secondary:focus,a.badge-secondary:hover{color:#fff;background-color:#545b62}a.badge-secondary.focus,a.badge-secondary:focus{outline:0;box-shadow:0 0 0 .2rem rgba(108,117,125,.5)}.badge-success{color:#fff;background-color:#28a745}a.badge-success:focus,a.badge-success:hover{color:#fff;background-color:#1e7e34}a.badge-success.focus,a.badge-success:focus{outline:0;box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.badge-info{color:#fff;background-color:#17a2b8}a.badge-info:focus,a.badge-info:hover{color:#fff;background-color:#117a8b}a.badge-info.focus,a.badge-info:focus{outline:0;box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.badge-warning{color:#212529;background-color:#ffc107}a.badge-warning:focus,a.badge-warning:hover{color:#212529;background-color:#d39e00}a.badge-warning.focus,a.badge-warning:focus{outline:0;box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.badge-danger{color:#fff;background-color:#dc3545}a.badge-danger:focus,a.badge-danger:hover{color:#fff;background-color:#bd2130}a.badge-danger.focus,a.badge-danger:focus{outline:0;box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.badge-light{color:#212529;background-color:#f8f9fa}a.badge-light:focus,a.badge-light:hover{color:#212529;background-color:#dae0e5}a.badge-light.focus,a.badge-light:focus{outline:0;box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.badge-dark{color:#fff;background-color:#343a40}a.badge-dark:focus,a.badge-dark:hover{color:#fff;background-color:#1d2124}a.badge-dark.focus,a.badge-dark:focus{outline:0;box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.jumbotron{padding:2rem 1rem;margin-bottom:2rem;background-color:#e9ecef;border-radius:.3rem}@media (min-width:576px){.jumbotron{padding:4rem 2rem}}.jumbotron-fluid{padding-right:0;padding-left:0;border-radius:0}.alert{position:relative;padding:.75rem 1.25rem;margin-bottom:1rem;border:1px solid transparent;border-radius:.25rem}.alert-heading{color:inherit}.alert-link{font-weight:700}.alert-dismissible{padding-right:4rem}.alert-dismissible .close{position:absolute;top:0;right:0;padding:.75rem 1.25rem;color:inherit}.alert-primary{color:#004085;background-color:#cce5ff;border-color:#b8daff}.alert-primary hr{border-top-color:#9fcdff}.alert-primary .alert-link{color:#002752}.alert-secondary{color:#383d41;background-color:#e2e3e5;border-color:#d6d8db}.alert-secondary hr{border-top-color:#c8cbcf}.alert-secondary .alert-link{color:#202326}.alert-success{color:#155724;background-color:#d4edda;border-color:#c3e6cb}.alert-success hr{border-top-color:#b1dfbb}.alert-success .alert-link{color:#0b2e13}.alert-info{color:#0c5460;background-color:#d1ecf1;border-color:#bee5eb}.alert-info hr{border-top-color:#abdde5}.alert-info .alert-link{color:#062c33}.alert-warning{color:#856404;background-color:#fff3cd;border-color:#ffeeba}.alert-warning hr{border-top-color:#ffe8a1}.alert-warning .alert-link{color:#533f03}.alert-danger{color:#721c24;background-color:#f8d7da;border-color:#f5c6cb}.alert-danger hr{border-top-color:#f1b0b7}.alert-danger .alert-link{color:#491217}.alert-light{color:#818182;background-color:#fefefe;border-color:#fdfdfe}.alert-light hr{border-top-color:#ececf6}.alert-light .alert-link{color:#686868}.alert-dark{color:#1b1e21;background-color:#d6d8d9;border-color:#c6c8ca}.alert-dark hr{border-top-color:#b9bbbe}.alert-dark .alert-link{color:#040505}@-webkit-keyframes progress-bar-stripes{from{background-position:1rem 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:1rem 0}to{background-position:0 0}}.progress{display:-ms-flexbox;display:flex;height:1rem;overflow:hidden;font-size:.75rem;background-color:#e9ecef;border-radius:.25rem}.progress-bar{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;color:#fff;text-align:center;white-space:nowrap;background-color:#007bff;transition:width .6s ease}@media (prefers-reduced-motion:reduce){.progress-bar{transition:none}}.progress-bar-striped{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:1rem 1rem}.progress-bar-animated{-webkit-animation:progress-bar-stripes 1s linear infinite;animation:progress-bar-stripes 1s linear infinite}@media (prefers-reduced-motion:reduce){.progress-bar-animated{-webkit-animation:none;animation:none}}.media{display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start}.media-body{-ms-flex:1;flex:1}.list-group{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;padding-left:0;margin-bottom:0}.list-group-item-action{width:100%;color:#495057;text-align:inherit}.list-group-item-action:focus,.list-group-item-action:hover{z-index:1;color:#495057;text-decoration:none;background-color:#f8f9fa}.list-group-item-action:active{color:#212529;background-color:#e9ecef}.list-group-item{position:relative;display:block;padding:.75rem 1.25rem;margin-bottom:-1px;background-color:#fff;border:1px solid rgba(0,0,0,.125)}.list-group-item:first-child{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.list-group-item.disabled,.list-group-item:disabled{color:#6c757d;pointer-events:none;background-color:#fff}.list-group-item.active{z-index:2;color:#fff;background-color:#007bff;border-color:#007bff}.list-group-horizontal{-ms-flex-direction:row;flex-direction:row}.list-group-horizontal .list-group-item{margin-right:-1px;margin-bottom:0}.list-group-horizontal .list-group-item:first-child{border-top-left-radius:.25rem;border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal .list-group-item:last-child{margin-right:0;border-top-right-radius:.25rem;border-bottom-right-radius:.25rem;border-bottom-left-radius:0}@media (min-width:576px){.list-group-horizontal-sm{-ms-flex-direction:row;flex-direction:row}.list-group-horizontal-sm .list-group-item{margin-right:-1px;margin-bottom:0}.list-group-horizontal-sm .list-group-item:first-child{border-top-left-radius:.25rem;border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-sm .list-group-item:last-child{margin-right:0;border-top-right-radius:.25rem;border-bottom-right-radius:.25rem;border-bottom-left-radius:0}}@media (min-width:768px){.list-group-horizontal-md{-ms-flex-direction:row;flex-direction:row}.list-group-horizontal-md .list-group-item{margin-right:-1px;margin-bottom:0}.list-group-horizontal-md .list-group-item:first-child{border-top-left-radius:.25rem;border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-md .list-group-item:last-child{margin-right:0;border-top-right-radius:.25rem;border-bottom-right-radius:.25rem;border-bottom-left-radius:0}}@media (min-width:992px){.list-group-horizontal-lg{-ms-flex-direction:row;flex-direction:row}.list-group-horizontal-lg .list-group-item{margin-right:-1px;margin-bottom:0}.list-group-horizontal-lg .list-group-item:first-child{border-top-left-radius:.25rem;border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-lg .list-group-item:last-child{margin-right:0;border-top-right-radius:.25rem;border-bottom-right-radius:.25rem;border-bottom-left-radius:0}}@media (min-width:1200px){.list-group-horizontal-xl{-ms-flex-direction:row;flex-direction:row}.list-group-horizontal-xl .list-group-item{margin-right:-1px;margin-bottom:0}.list-group-horizontal-xl .list-group-item:first-child{border-top-left-radius:.25rem;border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-xl .list-group-item:last-child{margin-right:0;border-top-right-radius:.25rem;border-bottom-right-radius:.25rem;border-bottom-left-radius:0}}.list-group-flush .list-group-item{border-right:0;border-left:0;border-radius:0}.list-group-flush .list-group-item:last-child{margin-bottom:-1px}.list-group-flush:first-child .list-group-item:first-child{border-top:0}.list-group-flush:last-child .list-group-item:last-child{margin-bottom:0;border-bottom:0}.list-group-item-primary{color:#004085;background-color:#b8daff}.list-group-item-primary.list-group-item-action:focus,.list-group-item-primary.list-group-item-action:hover{color:#004085;background-color:#9fcdff}.list-group-item-primary.list-group-item-action.active{color:#fff;background-color:#004085;border-color:#004085}.list-group-item-secondary{color:#383d41;background-color:#d6d8db}.list-group-item-secondary.list-group-item-action:focus,.list-group-item-secondary.list-group-item-action:hover{color:#383d41;background-color:#c8cbcf}.list-group-item-secondary.list-group-item-action.active{color:#fff;background-color:#383d41;border-color:#383d41}.list-group-item-success{color:#155724;background-color:#c3e6cb}.list-group-item-success.list-group-item-action:focus,.list-group-item-success.list-group-item-action:hover{color:#155724;background-color:#b1dfbb}.list-group-item-success.list-group-item-action.active{color:#fff;background-color:#155724;border-color:#155724}.list-group-item-info{color:#0c5460;background-color:#bee5eb}.list-group-item-info.list-group-item-action:focus,.list-group-item-info.list-group-item-action:hover{color:#0c5460;background-color:#abdde5}.list-group-item-info.list-group-item-action.active{color:#fff;background-color:#0c5460;border-color:#0c5460}.list-group-item-warning{color:#856404;background-color:#ffeeba}.list-group-item-warning.list-group-item-action:focus,.list-group-item-warning.list-group-item-action:hover{color:#856404;background-color:#ffe8a1}.list-group-item-warning.list-group-item-action.active{color:#fff;background-color:#856404;border-color:#856404}.list-group-item-danger{color:#721c24;background-color:#f5c6cb}.list-group-item-danger.list-group-item-action:focus,.list-group-item-danger.list-group-item-action:hover{color:#721c24;background-color:#f1b0b7}.list-group-item-danger.list-group-item-action.active{color:#fff;background-color:#721c24;border-color:#721c24}.list-group-item-light{color:#818182;background-color:#fdfdfe}.list-group-item-light.list-group-item-action:focus,.list-group-item-light.list-group-item-action:hover{color:#818182;background-color:#ececf6}.list-group-item-light.list-group-item-action.active{color:#fff;background-color:#818182;border-color:#818182}.list-group-item-dark{color:#1b1e21;background-color:#c6c8ca}.list-group-item-dark.list-group-item-action:focus,.list-group-item-dark.list-group-item-action:hover{color:#1b1e21;background-color:#b9bbbe}.list-group-item-dark.list-group-item-action.active{color:#fff;background-color:#1b1e21;border-color:#1b1e21}.close{float:right;font-size:1.5rem;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.5}.close:hover{color:#000;text-decoration:none}.close:not(:disabled):not(.disabled):focus,.close:not(:disabled):not(.disabled):hover{opacity:.75}button.close{padding:0;background-color:transparent;border:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}a.close.disabled{pointer-events:none}.toast{max-width:350px;overflow:hidden;font-size:.875rem;background-color:rgba(255,255,255,.85);background-clip:padding-box;border:1px solid rgba(0,0,0,.1);box-shadow:0 .25rem .75rem rgba(0,0,0,.1);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);opacity:0;border-radius:.25rem}.toast:not(:last-child){margin-bottom:.75rem}.toast.showing{opacity:1}.toast.show{display:block;opacity:1}.toast.hide{display:none}.toast-header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:.25rem .75rem;color:#6c757d;background-color:rgba(255,255,255,.85);background-clip:padding-box;border-bottom:1px solid rgba(0,0,0,.05)}.toast-body{padding:.75rem}.modal-open{overflow:hidden}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal{position:fixed;top:0;left:0;z-index:1050;display:none;width:100%;height:100%;overflow:hidden;outline:0}.modal-dialog{position:relative;width:auto;margin:.5rem;pointer-events:none}.modal.fade .modal-dialog{transition:-webkit-transform .3s ease-out;transition:transform .3s ease-out;transition:transform .3s ease-out,-webkit-transform .3s ease-out;-webkit-transform:translate(0,-50px);transform:translate(0,-50px)}@media (prefers-reduced-motion:reduce){.modal.fade .modal-dialog{transition:none}}.modal.show .modal-dialog{-webkit-transform:none;transform:none}.modal-dialog-scrollable{display:-ms-flexbox;display:flex;max-height:calc(100% - 1rem)}.modal-dialog-scrollable .modal-content{max-height:calc(100vh - 1rem);overflow:hidden}.modal-dialog-scrollable .modal-footer,.modal-dialog-scrollable .modal-header{-ms-flex-negative:0;flex-shrink:0}.modal-dialog-scrollable .modal-body{overflow-y:auto}.modal-dialog-centered{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:calc(100% - 1rem)}.modal-dialog-centered::before{display:block;height:calc(100vh - 1rem);content:""}.modal-dialog-centered.modal-dialog-scrollable{-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;height:100%}.modal-dialog-centered.modal-dialog-scrollable .modal-content{max-height:none}.modal-dialog-centered.modal-dialog-scrollable::before{content:none}.modal-content{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;width:100%;pointer-events:auto;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.2);border-radius:.3rem;outline:0}.modal-backdrop{position:fixed;top:0;left:0;z-index:1040;width:100vw;height:100vh;background-color:#000}.modal-backdrop.fade{opacity:0}.modal-backdrop.show{opacity:.5}.modal-header{display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start;-ms-flex-pack:justify;justify-content:space-between;padding:1rem 1rem;border-bottom:1px solid #dee2e6;border-top-left-radius:.3rem;border-top-right-radius:.3rem}.modal-header .close{padding:1rem 1rem;margin:-1rem -1rem -1rem auto}.modal-title{margin-bottom:0;line-height:1.5}.modal-body{position:relative;-ms-flex:1 1 auto;flex:1 1 auto;padding:1rem}.modal-footer{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end;padding:1rem;border-top:1px solid #dee2e6;border-bottom-right-radius:.3rem;border-bottom-left-radius:.3rem}.modal-footer>:not(:first-child){margin-left:.25rem}.modal-footer>:not(:last-child){margin-right:.25rem}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:576px){.modal-dialog{max-width:500px;margin:1.75rem auto}.modal-dialog-scrollable{max-height:calc(100% - 3.5rem)}.modal-dialog-scrollable .modal-content{max-height:calc(100vh - 3.5rem)}.modal-dialog-centered{min-height:calc(100% - 3.5rem)}.modal-dialog-centered::before{height:calc(100vh - 3.5rem)}.modal-sm{max-width:300px}}@media (min-width:992px){.modal-lg,.modal-xl{max-width:800px}}@media (min-width:1200px){.modal-xl{max-width:1140px}}.tooltip{position:absolute;z-index:1070;display:block;margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:.875rem;word-wrap:break-word;opacity:0}.tooltip.show{opacity:.9}.tooltip .arrow{position:absolute;display:block;width:.8rem;height:.4rem}.tooltip .arrow::before{position:absolute;content:"";border-color:transparent;border-style:solid}.bs-tooltip-auto[x-placement^=top],.bs-tooltip-top{padding:.4rem 0}.bs-tooltip-auto[x-placement^=top] .arrow,.bs-tooltip-top .arrow{bottom:0}.bs-tooltip-auto[x-placement^=top] .arrow::before,.bs-tooltip-top .arrow::before{top:0;border-width:.4rem .4rem 0;border-top-color:#000}.bs-tooltip-auto[x-placement^=right],.bs-tooltip-right{padding:0 .4rem}.bs-tooltip-auto[x-placement^=right] .arrow,.bs-tooltip-right .arrow{left:0;width:.4rem;height:.8rem}.bs-tooltip-auto[x-placement^=right] .arrow::before,.bs-tooltip-right .arrow::before{right:0;border-width:.4rem .4rem .4rem 0;border-right-color:#000}.bs-tooltip-auto[x-placement^=bottom],.bs-tooltip-bottom{padding:.4rem 0}.bs-tooltip-auto[x-placement^=bottom] .arrow,.bs-tooltip-bottom .arrow{top:0}.bs-tooltip-auto[x-placement^=bottom] .arrow::before,.bs-tooltip-bottom .arrow::before{bottom:0;border-width:0 .4rem .4rem;border-bottom-color:#000}.bs-tooltip-auto[x-placement^=left],.bs-tooltip-left{padding:0 .4rem}.bs-tooltip-auto[x-placement^=left] .arrow,.bs-tooltip-left .arrow{right:0;width:.4rem;height:.8rem}.bs-tooltip-auto[x-placement^=left] .arrow::before,.bs-tooltip-left .arrow::before{left:0;border-width:.4rem 0 .4rem .4rem;border-left-color:#000}.tooltip-inner{max-width:200px;padding:.25rem .5rem;color:#fff;text-align:center;background-color:#000;border-radius:.25rem}.popover{position:absolute;top:0;left:0;z-index:1060;display:block;max-width:276px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:.875rem;word-wrap:break-word;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.2);border-radius:.3rem}.popover .arrow{position:absolute;display:block;width:1rem;height:.5rem;margin:0 .3rem}.popover .arrow::after,.popover .arrow::before{position:absolute;display:block;content:"";border-color:transparent;border-style:solid}.bs-popover-auto[x-placement^=top],.bs-popover-top{margin-bottom:.5rem}.bs-popover-auto[x-placement^=top]>.arrow,.bs-popover-top>.arrow{bottom:calc((.5rem + 1px) * -1)}.bs-popover-auto[x-placement^=top]>.arrow::before,.bs-popover-top>.arrow::before{bottom:0;border-width:.5rem .5rem 0;border-top-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=top]>.arrow::after,.bs-popover-top>.arrow::after{bottom:1px;border-width:.5rem .5rem 0;border-top-color:#fff}.bs-popover-auto[x-placement^=right],.bs-popover-right{margin-left:.5rem}.bs-popover-auto[x-placement^=right]>.arrow,.bs-popover-right>.arrow{left:calc((.5rem + 1px) * -1);width:.5rem;height:1rem;margin:.3rem 0}.bs-popover-auto[x-placement^=right]>.arrow::before,.bs-popover-right>.arrow::before{left:0;border-width:.5rem .5rem .5rem 0;border-right-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=right]>.arrow::after,.bs-popover-right>.arrow::after{left:1px;border-width:.5rem .5rem .5rem 0;border-right-color:#fff}.bs-popover-auto[x-placement^=bottom],.bs-popover-bottom{margin-top:.5rem}.bs-popover-auto[x-placement^=bottom]>.arrow,.bs-popover-bottom>.arrow{top:calc((.5rem + 1px) * -1)}.bs-popover-auto[x-placement^=bottom]>.arrow::before,.bs-popover-bottom>.arrow::before{top:0;border-width:0 .5rem .5rem .5rem;border-bottom-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=bottom]>.arrow::after,.bs-popover-bottom>.arrow::after{top:1px;border-width:0 .5rem .5rem .5rem;border-bottom-color:#fff}.bs-popover-auto[x-placement^=bottom] .popover-header::before,.bs-popover-bottom .popover-header::before{position:absolute;top:0;left:50%;display:block;width:1rem;margin-left:-.5rem;content:"";border-bottom:1px solid #f7f7f7}.bs-popover-auto[x-placement^=left],.bs-popover-left{margin-right:.5rem}.bs-popover-auto[x-placement^=left]>.arrow,.bs-popover-left>.arrow{right:calc((.5rem + 1px) * -1);width:.5rem;height:1rem;margin:.3rem 0}.bs-popover-auto[x-placement^=left]>.arrow::before,.bs-popover-left>.arrow::before{right:0;border-width:.5rem 0 .5rem .5rem;border-left-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=left]>.arrow::after,.bs-popover-left>.arrow::after{right:1px;border-width:.5rem 0 .5rem .5rem;border-left-color:#fff}.popover-header{padding:.5rem .75rem;margin-bottom:0;font-size:1rem;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-top-left-radius:calc(.3rem - 1px);border-top-right-radius:calc(.3rem - 1px)}.popover-header:empty{display:none}.popover-body{padding:.5rem .75rem;color:#212529}.carousel{position:relative}.carousel.pointer-event{-ms-touch-action:pan-y;touch-action:pan-y}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner::after{display:block;clear:both;content:""}.carousel-item{position:relative;display:none;float:left;width:100%;margin-right:-100%;-webkit-backface-visibility:hidden;backface-visibility:hidden;transition:-webkit-transform .6s ease-in-out;transition:transform .6s ease-in-out;transition:transform .6s ease-in-out,-webkit-transform .6s ease-in-out}@media (prefers-reduced-motion:reduce){.carousel-item{transition:none}}.carousel-item-next,.carousel-item-prev,.carousel-item.active{display:block}.active.carousel-item-right,.carousel-item-next:not(.carousel-item-left){-webkit-transform:translateX(100%);transform:translateX(100%)}.active.carousel-item-left,.carousel-item-prev:not(.carousel-item-right){-webkit-transform:translateX(-100%);transform:translateX(-100%)}.carousel-fade .carousel-item{opacity:0;transition-property:opacity;-webkit-transform:none;transform:none}.carousel-fade .carousel-item-next.carousel-item-left,.carousel-fade .carousel-item-prev.carousel-item-right,.carousel-fade .carousel-item.active{z-index:1;opacity:1}.carousel-fade .active.carousel-item-left,.carousel-fade .active.carousel-item-right{z-index:0;opacity:0;transition:0s .6s opacity}@media (prefers-reduced-motion:reduce){.carousel-fade .active.carousel-item-left,.carousel-fade .active.carousel-item-right{transition:none}}.carousel-control-next,.carousel-control-prev{position:absolute;top:0;bottom:0;z-index:1;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:15%;color:#fff;text-align:center;opacity:.5;transition:opacity .15s ease}@media (prefers-reduced-motion:reduce){.carousel-control-next,.carousel-control-prev{transition:none}}.carousel-control-next:focus,.carousel-control-next:hover,.carousel-control-prev:focus,.carousel-control-prev:hover{color:#fff;text-decoration:none;outline:0;opacity:.9}.carousel-control-prev{left:0}.carousel-control-next{right:0}.carousel-control-next-icon,.carousel-control-prev-icon{display:inline-block;width:20px;height:20px;background:no-repeat 50%/100% 100%}.carousel-control-prev-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 8 8'%3e%3cpath d='M5.25 0l-4 4 4 4 1.5-1.5-2.5-2.5 2.5-2.5-1.5-1.5z'/%3e%3c/svg%3e")}.carousel-control-next-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 8 8'%3e%3cpath d='M2.75 0l-1.5 1.5 2.5 2.5-2.5 2.5 1.5 1.5 4-4-4-4z'/%3e%3c/svg%3e")}.carousel-indicators{position:absolute;right:0;bottom:0;left:0;z-index:15;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;padding-left:0;margin-right:15%;margin-left:15%;list-style:none}.carousel-indicators li{box-sizing:content-box;-ms-flex:0 1 auto;flex:0 1 auto;width:30px;height:3px;margin-right:3px;margin-left:3px;text-indent:-999px;cursor:pointer;background-color:#fff;background-clip:padding-box;border-top:10px solid transparent;border-bottom:10px solid transparent;opacity:.5;transition:opacity .6s ease}@media (prefers-reduced-motion:reduce){.carousel-indicators li{transition:none}}.carousel-indicators .active{opacity:1}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center}@-webkit-keyframes spinner-border{to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes spinner-border{to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.spinner-border{display:inline-block;width:2rem;height:2rem;vertical-align:text-bottom;border:.25em solid currentColor;border-right-color:transparent;border-radius:50%;-webkit-animation:spinner-border .75s linear infinite;animation:spinner-border .75s linear infinite}.spinner-border-sm{width:1rem;height:1rem;border-width:.2em}@-webkit-keyframes spinner-grow{0%{-webkit-transform:scale(0);transform:scale(0)}50%{opacity:1}}@keyframes spinner-grow{0%{-webkit-transform:scale(0);transform:scale(0)}50%{opacity:1}}.spinner-grow{display:inline-block;width:2rem;height:2rem;vertical-align:text-bottom;background-color:currentColor;border-radius:50%;opacity:0;-webkit-animation:spinner-grow .75s linear infinite;animation:spinner-grow .75s linear infinite}.spinner-grow-sm{width:1rem;height:1rem}.align-baseline{vertical-align:baseline!important}.align-top{vertical-align:top!important}.align-middle{vertical-align:middle!important}.align-bottom{vertical-align:bottom!important}.align-text-bottom{vertical-align:text-bottom!important}.align-text-top{vertical-align:text-top!important}.bg-primary{background-color:#007bff!important}a.bg-primary:focus,a.bg-primary:hover,button.bg-primary:focus,button.bg-primary:hover{background-color:#0062cc!important}.bg-secondary{background-color:#6c757d!important}a.bg-secondary:focus,a.bg-secondary:hover,button.bg-secondary:focus,button.bg-secondary:hover{background-color:#545b62!important}.bg-success{background-color:#28a745!important}a.bg-success:focus,a.bg-success:hover,button.bg-success:focus,button.bg-success:hover{background-color:#1e7e34!important}.bg-info{background-color:#17a2b8!important}a.bg-info:focus,a.bg-info:hover,button.bg-info:focus,button.bg-info:hover{background-color:#117a8b!important}.bg-warning{background-color:#ffc107!important}a.bg-warning:focus,a.bg-warning:hover,button.bg-warning:focus,button.bg-warning:hover{background-color:#d39e00!important}.bg-danger{background-color:#dc3545!important}a.bg-danger:focus,a.bg-danger:hover,button.bg-danger:focus,button.bg-danger:hover{background-color:#bd2130!important}.bg-light{background-color:#f8f9fa!important}a.bg-light:focus,a.bg-light:hover,button.bg-light:focus,button.bg-light:hover{background-color:#dae0e5!important}.bg-dark{background-color:#343a40!important}a.bg-dark:focus,a.bg-dark:hover,button.bg-dark:focus,button.bg-dark:hover{background-color:#1d2124!important}.bg-white{background-color:#fff!important}.bg-transparent{background-color:transparent!important}.border{border:1px solid #dee2e6!important}.border-top{border-top:1px solid #dee2e6!important}.border-right{border-right:1px solid #dee2e6!important}.border-bottom{border-bottom:1px solid #dee2e6!important}.border-left{border-left:1px solid #dee2e6!important}.border-0{border:0!important}.border-top-0{border-top:0!important}.border-right-0{border-right:0!important}.border-bottom-0{border-bottom:0!important}.border-left-0{border-left:0!important}.border-primary{border-color:#007bff!important}.border-secondary{border-color:#6c757d!important}.border-success{border-color:#28a745!important}.border-info{border-color:#17a2b8!important}.border-warning{border-color:#ffc107!important}.border-danger{border-color:#dc3545!important}.border-light{border-color:#f8f9fa!important}.border-dark{border-color:#343a40!important}.border-white{border-color:#fff!important}.rounded-sm{border-radius:.2rem!important}.rounded{border-radius:.25rem!important}.rounded-top{border-top-left-radius:.25rem!important;border-top-right-radius:.25rem!important}.rounded-right{border-top-right-radius:.25rem!important;border-bottom-right-radius:.25rem!important}.rounded-bottom{border-bottom-right-radius:.25rem!important;border-bottom-left-radius:.25rem!important}.rounded-left{border-top-left-radius:.25rem!important;border-bottom-left-radius:.25rem!important}.rounded-lg{border-radius:.3rem!important}.rounded-circle{border-radius:50%!important}.rounded-pill{border-radius:50rem!important}.rounded-0{border-radius:0!important}.clearfix::after{display:block;clear:both;content:""}.d-none{display:none!important}.d-inline{display:inline!important}.d-inline-block{display:inline-block!important}.d-block{display:block!important}.d-table{display:table!important}.d-table-row{display:table-row!important}.d-table-cell{display:table-cell!important}.d-flex{display:-ms-flexbox!important;display:flex!important}.d-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}@media (min-width:576px){.d-sm-none{display:none!important}.d-sm-inline{display:inline!important}.d-sm-inline-block{display:inline-block!important}.d-sm-block{display:block!important}.d-sm-table{display:table!important}.d-sm-table-row{display:table-row!important}.d-sm-table-cell{display:table-cell!important}.d-sm-flex{display:-ms-flexbox!important;display:flex!important}.d-sm-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}@media (min-width:768px){.d-md-none{display:none!important}.d-md-inline{display:inline!important}.d-md-inline-block{display:inline-block!important}.d-md-block{display:block!important}.d-md-table{display:table!important}.d-md-table-row{display:table-row!important}.d-md-table-cell{display:table-cell!important}.d-md-flex{display:-ms-flexbox!important;display:flex!important}.d-md-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}@media (min-width:992px){.d-lg-none{display:none!important}.d-lg-inline{display:inline!important}.d-lg-inline-block{display:inline-block!important}.d-lg-block{display:block!important}.d-lg-table{display:table!important}.d-lg-table-row{display:table-row!important}.d-lg-table-cell{display:table-cell!important}.d-lg-flex{display:-ms-flexbox!important;display:flex!important}.d-lg-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}@media (min-width:1200px){.d-xl-none{display:none!important}.d-xl-inline{display:inline!important}.d-xl-inline-block{display:inline-block!important}.d-xl-block{display:block!important}.d-xl-table{display:table!important}.d-xl-table-row{display:table-row!important}.d-xl-table-cell{display:table-cell!important}.d-xl-flex{display:-ms-flexbox!important;display:flex!important}.d-xl-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}@media print{.d-print-none{display:none!important}.d-print-inline{display:inline!important}.d-print-inline-block{display:inline-block!important}.d-print-block{display:block!important}.d-print-table{display:table!important}.d-print-table-row{display:table-row!important}.d-print-table-cell{display:table-cell!important}.d-print-flex{display:-ms-flexbox!important;display:flex!important}.d-print-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}.embed-responsive{position:relative;display:block;width:100%;padding:0;overflow:hidden}.embed-responsive::before{display:block;content:""}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-21by9::before{padding-top:42.857143%}.embed-responsive-16by9::before{padding-top:56.25%}.embed-responsive-4by3::before{padding-top:75%}.embed-responsive-1by1::before{padding-top:100%}.flex-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.flex-fill{-ms-flex:1 1 auto!important;flex:1 1 auto!important}.flex-grow-0{-ms-flex-positive:0!important;flex-grow:0!important}.flex-grow-1{-ms-flex-positive:1!important;flex-grow:1!important}.flex-shrink-0{-ms-flex-negative:0!important;flex-shrink:0!important}.flex-shrink-1{-ms-flex-negative:1!important;flex-shrink:1!important}.justify-content-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-center{-ms-flex-align:center!important;align-items:center!important}.align-items-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}@media (min-width:576px){.flex-sm-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-sm-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-sm-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-sm-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-sm-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-sm-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-sm-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.flex-sm-fill{-ms-flex:1 1 auto!important;flex:1 1 auto!important}.flex-sm-grow-0{-ms-flex-positive:0!important;flex-grow:0!important}.flex-sm-grow-1{-ms-flex-positive:1!important;flex-grow:1!important}.flex-sm-shrink-0{-ms-flex-negative:0!important;flex-shrink:0!important}.flex-sm-shrink-1{-ms-flex-negative:1!important;flex-shrink:1!important}.justify-content-sm-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-sm-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-sm-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-sm-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-sm-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-sm-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-sm-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-sm-center{-ms-flex-align:center!important;align-items:center!important}.align-items-sm-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-sm-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-sm-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-sm-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-sm-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-sm-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-sm-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-sm-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-sm-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-sm-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-sm-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-sm-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-sm-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-sm-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:768px){.flex-md-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-md-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-md-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-md-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-md-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-md-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-md-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.flex-md-fill{-ms-flex:1 1 auto!important;flex:1 1 auto!important}.flex-md-grow-0{-ms-flex-positive:0!important;flex-grow:0!important}.flex-md-grow-1{-ms-flex-positive:1!important;flex-grow:1!important}.flex-md-shrink-0{-ms-flex-negative:0!important;flex-shrink:0!important}.flex-md-shrink-1{-ms-flex-negative:1!important;flex-shrink:1!important}.justify-content-md-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-md-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-md-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-md-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-md-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-md-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-md-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-md-center{-ms-flex-align:center!important;align-items:center!important}.align-items-md-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-md-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-md-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-md-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-md-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-md-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-md-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-md-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-md-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-md-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-md-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-md-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-md-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-md-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:992px){.flex-lg-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-lg-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-lg-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-lg-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-lg-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-lg-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-lg-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.flex-lg-fill{-ms-flex:1 1 auto!important;flex:1 1 auto!important}.flex-lg-grow-0{-ms-flex-positive:0!important;flex-grow:0!important}.flex-lg-grow-1{-ms-flex-positive:1!important;flex-grow:1!important}.flex-lg-shrink-0{-ms-flex-negative:0!important;flex-shrink:0!important}.flex-lg-shrink-1{-ms-flex-negative:1!important;flex-shrink:1!important}.justify-content-lg-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-lg-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-lg-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-lg-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-lg-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-lg-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-lg-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-lg-center{-ms-flex-align:center!important;align-items:center!important}.align-items-lg-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-lg-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-lg-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-lg-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-lg-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-lg-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-lg-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-lg-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-lg-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-lg-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-lg-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-lg-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-lg-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-lg-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:1200px){.flex-xl-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-xl-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-xl-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-xl-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-xl-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-xl-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-xl-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.flex-xl-fill{-ms-flex:1 1 auto!important;flex:1 1 auto!important}.flex-xl-grow-0{-ms-flex-positive:0!important;flex-grow:0!important}.flex-xl-grow-1{-ms-flex-positive:1!important;flex-grow:1!important}.flex-xl-shrink-0{-ms-flex-negative:0!important;flex-shrink:0!important}.flex-xl-shrink-1{-ms-flex-negative:1!important;flex-shrink:1!important}.justify-content-xl-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-xl-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-xl-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-xl-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-xl-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-xl-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-xl-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-xl-center{-ms-flex-align:center!important;align-items:center!important}.align-items-xl-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-xl-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-xl-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-xl-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-xl-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-xl-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-xl-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-xl-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-xl-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-xl-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-xl-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-xl-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-xl-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-xl-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}.float-left{float:left!important}.float-right{float:right!important}.float-none{float:none!important}@media (min-width:576px){.float-sm-left{float:left!important}.float-sm-right{float:right!important}.float-sm-none{float:none!important}}@media (min-width:768px){.float-md-left{float:left!important}.float-md-right{float:right!important}.float-md-none{float:none!important}}@media (min-width:992px){.float-lg-left{float:left!important}.float-lg-right{float:right!important}.float-lg-none{float:none!important}}@media (min-width:1200px){.float-xl-left{float:left!important}.float-xl-right{float:right!important}.float-xl-none{float:none!important}}.overflow-auto{overflow:auto!important}.overflow-hidden{overflow:hidden!important}.position-static{position:static!important}.position-relative{position:relative!important}.position-absolute{position:absolute!important}.position-fixed{position:fixed!important}.position-sticky{position:-webkit-sticky!important;position:sticky!important}.fixed-top{position:fixed;top:0;right:0;left:0;z-index:1030}.fixed-bottom{position:fixed;right:0;bottom:0;left:0;z-index:1030}@supports ((position:-webkit-sticky) or (position:sticky)){.sticky-top{position:-webkit-sticky;position:sticky;top:0;z-index:1020}}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;overflow:visible;clip:auto;white-space:normal}.shadow-sm{box-shadow:0 .125rem .25rem rgba(0,0,0,.075)!important}.shadow{box-shadow:0 .5rem 1rem rgba(0,0,0,.15)!important}.shadow-lg{box-shadow:0 1rem 3rem rgba(0,0,0,.175)!important}.shadow-none{box-shadow:none!important}.w-25{width:25%!important}.w-50{width:50%!important}.w-75{width:75%!important}.w-100{width:100%!important}.w-auto{width:auto!important}.h-25{height:25%!important}.h-50{height:50%!important}.h-75{height:75%!important}.h-100{height:100%!important}.h-auto{height:auto!important}.mw-100{max-width:100%!important}.mh-100{max-height:100%!important}.min-vw-100{min-width:100vw!important}.min-vh-100{min-height:100vh!important}.vw-100{width:100vw!important}.vh-100{height:100vh!important}.stretched-link::after{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;pointer-events:auto;content:"";background-color:rgba(0,0,0,0)}.m-0{margin:0!important}.mt-0,.my-0{margin-top:0!important}.mr-0,.mx-0{margin-right:0!important}.mb-0,.my-0{margin-bottom:0!important}.ml-0,.mx-0{margin-left:0!important}.m-1{margin:.25rem!important}.mt-1,.my-1{margin-top:.25rem!important}.mr-1,.mx-1{margin-right:.25rem!important}.mb-1,.my-1{margin-bottom:.25rem!important}.ml-1,.mx-1{margin-left:.25rem!important}.m-2{margin:.5rem!important}.mt-2,.my-2{margin-top:.5rem!important}.mr-2,.mx-2{margin-right:.5rem!important}.mb-2,.my-2{margin-bottom:.5rem!important}.ml-2,.mx-2{margin-left:.5rem!important}.m-3{margin:1rem!important}.mt-3,.my-3{margin-top:1rem!important}.mr-3,.mx-3{margin-right:1rem!important}.mb-3,.my-3{margin-bottom:1rem!important}.ml-3,.mx-3{margin-left:1rem!important}.m-4{margin:1.5rem!important}.mt-4,.my-4{margin-top:1.5rem!important}.mr-4,.mx-4{margin-right:1.5rem!important}.mb-4,.my-4{margin-bottom:1.5rem!important}.ml-4,.mx-4{margin-left:1.5rem!important}.m-5{margin:3rem!important}.mt-5,.my-5{margin-top:3rem!important}.mr-5,.mx-5{margin-right:3rem!important}.mb-5,.my-5{margin-bottom:3rem!important}.ml-5,.mx-5{margin-left:3rem!important}.p-0{padding:0!important}.pt-0,.py-0{padding-top:0!important}.pr-0,.px-0{padding-right:0!important}.pb-0,.py-0{padding-bottom:0!important}.pl-0,.px-0{padding-left:0!important}.p-1{padding:.25rem!important}.pt-1,.py-1{padding-top:.25rem!important}.pr-1,.px-1{padding-right:.25rem!important}.pb-1,.py-1{padding-bottom:.25rem!important}.pl-1,.px-1{padding-left:.25rem!important}.p-2{padding:.5rem!important}.pt-2,.py-2{padding-top:.5rem!important}.pr-2,.px-2{padding-right:.5rem!important}.pb-2,.py-2{padding-bottom:.5rem!important}.pl-2,.px-2{padding-left:.5rem!important}.p-3{padding:1rem!important}.pt-3,.py-3{padding-top:1rem!important}.pr-3,.px-3{padding-right:1rem!important}.pb-3,.py-3{padding-bottom:1rem!important}.pl-3,.px-3{padding-left:1rem!important}.p-4{padding:1.5rem!important}.pt-4,.py-4{padding-top:1.5rem!important}.pr-4,.px-4{padding-right:1.5rem!important}.pb-4,.py-4{padding-bottom:1.5rem!important}.pl-4,.px-4{padding-left:1.5rem!important}.p-5{padding:3rem!important}.pt-5,.py-5{padding-top:3rem!important}.pr-5,.px-5{padding-right:3rem!important}.pb-5,.py-5{padding-bottom:3rem!important}.pl-5,.px-5{padding-left:3rem!important}.m-n1{margin:-.25rem!important}.mt-n1,.my-n1{margin-top:-.25rem!important}.mr-n1,.mx-n1{margin-right:-.25rem!important}.mb-n1,.my-n1{margin-bottom:-.25rem!important}.ml-n1,.mx-n1{margin-left:-.25rem!important}.m-n2{margin:-.5rem!important}.mt-n2,.my-n2{margin-top:-.5rem!important}.mr-n2,.mx-n2{margin-right:-.5rem!important}.mb-n2,.my-n2{margin-bottom:-.5rem!important}.ml-n2,.mx-n2{margin-left:-.5rem!important}.m-n3{margin:-1rem!important}.mt-n3,.my-n3{margin-top:-1rem!important}.mr-n3,.mx-n3{margin-right:-1rem!important}.mb-n3,.my-n3{margin-bottom:-1rem!important}.ml-n3,.mx-n3{margin-left:-1rem!important}.m-n4{margin:-1.5rem!important}.mt-n4,.my-n4{margin-top:-1.5rem!important}.mr-n4,.mx-n4{margin-right:-1.5rem!important}.mb-n4,.my-n4{margin-bottom:-1.5rem!important}.ml-n4,.mx-n4{margin-left:-1.5rem!important}.m-n5{margin:-3rem!important}.mt-n5,.my-n5{margin-top:-3rem!important}.mr-n5,.mx-n5{margin-right:-3rem!important}.mb-n5,.my-n5{margin-bottom:-3rem!important}.ml-n5,.mx-n5{margin-left:-3rem!important}.m-auto{margin:auto!important}.mt-auto,.my-auto{margin-top:auto!important}.mr-auto,.mx-auto{margin-right:auto!important}.mb-auto,.my-auto{margin-bottom:auto!important}.ml-auto,.mx-auto{margin-left:auto!important}@media (min-width:576px){.m-sm-0{margin:0!important}.mt-sm-0,.my-sm-0{margin-top:0!important}.mr-sm-0,.mx-sm-0{margin-right:0!important}.mb-sm-0,.my-sm-0{margin-bottom:0!important}.ml-sm-0,.mx-sm-0{margin-left:0!important}.m-sm-1{margin:.25rem!important}.mt-sm-1,.my-sm-1{margin-top:.25rem!important}.mr-sm-1,.mx-sm-1{margin-right:.25rem!important}.mb-sm-1,.my-sm-1{margin-bottom:.25rem!important}.ml-sm-1,.mx-sm-1{margin-left:.25rem!important}.m-sm-2{margin:.5rem!important}.mt-sm-2,.my-sm-2{margin-top:.5rem!important}.mr-sm-2,.mx-sm-2{margin-right:.5rem!important}.mb-sm-2,.my-sm-2{margin-bottom:.5rem!important}.ml-sm-2,.mx-sm-2{margin-left:.5rem!important}.m-sm-3{margin:1rem!important}.mt-sm-3,.my-sm-3{margin-top:1rem!important}.mr-sm-3,.mx-sm-3{margin-right:1rem!important}.mb-sm-3,.my-sm-3{margin-bottom:1rem!important}.ml-sm-3,.mx-sm-3{margin-left:1rem!important}.m-sm-4{margin:1.5rem!important}.mt-sm-4,.my-sm-4{margin-top:1.5rem!important}.mr-sm-4,.mx-sm-4{margin-right:1.5rem!important}.mb-sm-4,.my-sm-4{margin-bottom:1.5rem!important}.ml-sm-4,.mx-sm-4{margin-left:1.5rem!important}.m-sm-5{margin:3rem!important}.mt-sm-5,.my-sm-5{margin-top:3rem!important}.mr-sm-5,.mx-sm-5{margin-right:3rem!important}.mb-sm-5,.my-sm-5{margin-bottom:3rem!important}.ml-sm-5,.mx-sm-5{margin-left:3rem!important}.p-sm-0{padding:0!important}.pt-sm-0,.py-sm-0{padding-top:0!important}.pr-sm-0,.px-sm-0{padding-right:0!important}.pb-sm-0,.py-sm-0{padding-bottom:0!important}.pl-sm-0,.px-sm-0{padding-left:0!important}.p-sm-1{padding:.25rem!important}.pt-sm-1,.py-sm-1{padding-top:.25rem!important}.pr-sm-1,.px-sm-1{padding-right:.25rem!important}.pb-sm-1,.py-sm-1{padding-bottom:.25rem!important}.pl-sm-1,.px-sm-1{padding-left:.25rem!important}.p-sm-2{padding:.5rem!important}.pt-sm-2,.py-sm-2{padding-top:.5rem!important}.pr-sm-2,.px-sm-2{padding-right:.5rem!important}.pb-sm-2,.py-sm-2{padding-bottom:.5rem!important}.pl-sm-2,.px-sm-2{padding-left:.5rem!important}.p-sm-3{padding:1rem!important}.pt-sm-3,.py-sm-3{padding-top:1rem!important}.pr-sm-3,.px-sm-3{padding-right:1rem!important}.pb-sm-3,.py-sm-3{padding-bottom:1rem!important}.pl-sm-3,.px-sm-3{padding-left:1rem!important}.p-sm-4{padding:1.5rem!important}.pt-sm-4,.py-sm-4{padding-top:1.5rem!important}.pr-sm-4,.px-sm-4{padding-right:1.5rem!important}.pb-sm-4,.py-sm-4{padding-bottom:1.5rem!important}.pl-sm-4,.px-sm-4{padding-left:1.5rem!important}.p-sm-5{padding:3rem!important}.pt-sm-5,.py-sm-5{padding-top:3rem!important}.pr-sm-5,.px-sm-5{padding-right:3rem!important}.pb-sm-5,.py-sm-5{padding-bottom:3rem!important}.pl-sm-5,.px-sm-5{padding-left:3rem!important}.m-sm-n1{margin:-.25rem!important}.mt-sm-n1,.my-sm-n1{margin-top:-.25rem!important}.mr-sm-n1,.mx-sm-n1{margin-right:-.25rem!important}.mb-sm-n1,.my-sm-n1{margin-bottom:-.25rem!important}.ml-sm-n1,.mx-sm-n1{margin-left:-.25rem!important}.m-sm-n2{margin:-.5rem!important}.mt-sm-n2,.my-sm-n2{margin-top:-.5rem!important}.mr-sm-n2,.mx-sm-n2{margin-right:-.5rem!important}.mb-sm-n2,.my-sm-n2{margin-bottom:-.5rem!important}.ml-sm-n2,.mx-sm-n2{margin-left:-.5rem!important}.m-sm-n3{margin:-1rem!important}.mt-sm-n3,.my-sm-n3{margin-top:-1rem!important}.mr-sm-n3,.mx-sm-n3{margin-right:-1rem!important}.mb-sm-n3,.my-sm-n3{margin-bottom:-1rem!important}.ml-sm-n3,.mx-sm-n3{margin-left:-1rem!important}.m-sm-n4{margin:-1.5rem!important}.mt-sm-n4,.my-sm-n4{margin-top:-1.5rem!important}.mr-sm-n4,.mx-sm-n4{margin-right:-1.5rem!important}.mb-sm-n4,.my-sm-n4{margin-bottom:-1.5rem!important}.ml-sm-n4,.mx-sm-n4{margin-left:-1.5rem!important}.m-sm-n5{margin:-3rem!important}.mt-sm-n5,.my-sm-n5{margin-top:-3rem!important}.mr-sm-n5,.mx-sm-n5{margin-right:-3rem!important}.mb-sm-n5,.my-sm-n5{margin-bottom:-3rem!important}.ml-sm-n5,.mx-sm-n5{margin-left:-3rem!important}.m-sm-auto{margin:auto!important}.mt-sm-auto,.my-sm-auto{margin-top:auto!important}.mr-sm-auto,.mx-sm-auto{margin-right:auto!important}.mb-sm-auto,.my-sm-auto{margin-bottom:auto!important}.ml-sm-auto,.mx-sm-auto{margin-left:auto!important}}@media (min-width:768px){.m-md-0{margin:0!important}.mt-md-0,.my-md-0{margin-top:0!important}.mr-md-0,.mx-md-0{margin-right:0!important}.mb-md-0,.my-md-0{margin-bottom:0!important}.ml-md-0,.mx-md-0{margin-left:0!important}.m-md-1{margin:.25rem!important}.mt-md-1,.my-md-1{margin-top:.25rem!important}.mr-md-1,.mx-md-1{margin-right:.25rem!important}.mb-md-1,.my-md-1{margin-bottom:.25rem!important}.ml-md-1,.mx-md-1{margin-left:.25rem!important}.m-md-2{margin:.5rem!important}.mt-md-2,.my-md-2{margin-top:.5rem!important}.mr-md-2,.mx-md-2{margin-right:.5rem!important}.mb-md-2,.my-md-2{margin-bottom:.5rem!important}.ml-md-2,.mx-md-2{margin-left:.5rem!important}.m-md-3{margin:1rem!important}.mt-md-3,.my-md-3{margin-top:1rem!important}.mr-md-3,.mx-md-3{margin-right:1rem!important}.mb-md-3,.my-md-3{margin-bottom:1rem!important}.ml-md-3,.mx-md-3{margin-left:1rem!important}.m-md-4{margin:1.5rem!important}.mt-md-4,.my-md-4{margin-top:1.5rem!important}.mr-md-4,.mx-md-4{margin-right:1.5rem!important}.mb-md-4,.my-md-4{margin-bottom:1.5rem!important}.ml-md-4,.mx-md-4{margin-left:1.5rem!important}.m-md-5{margin:3rem!important}.mt-md-5,.my-md-5{margin-top:3rem!important}.mr-md-5,.mx-md-5{margin-right:3rem!important}.mb-md-5,.my-md-5{margin-bottom:3rem!important}.ml-md-5,.mx-md-5{margin-left:3rem!important}.p-md-0{padding:0!important}.pt-md-0,.py-md-0{padding-top:0!important}.pr-md-0,.px-md-0{padding-right:0!important}.pb-md-0,.py-md-0{padding-bottom:0!important}.pl-md-0,.px-md-0{padding-left:0!important}.p-md-1{padding:.25rem!important}.pt-md-1,.py-md-1{padding-top:.25rem!important}.pr-md-1,.px-md-1{padding-right:.25rem!important}.pb-md-1,.py-md-1{padding-bottom:.25rem!important}.pl-md-1,.px-md-1{padding-left:.25rem!important}.p-md-2{padding:.5rem!important}.pt-md-2,.py-md-2{padding-top:.5rem!important}.pr-md-2,.px-md-2{padding-right:.5rem!important}.pb-md-2,.py-md-2{padding-bottom:.5rem!important}.pl-md-2,.px-md-2{padding-left:.5rem!important}.p-md-3{padding:1rem!important}.pt-md-3,.py-md-3{padding-top:1rem!important}.pr-md-3,.px-md-3{padding-right:1rem!important}.pb-md-3,.py-md-3{padding-bottom:1rem!important}.pl-md-3,.px-md-3{padding-left:1rem!important}.p-md-4{padding:1.5rem!important}.pt-md-4,.py-md-4{padding-top:1.5rem!important}.pr-md-4,.px-md-4{padding-right:1.5rem!important}.pb-md-4,.py-md-4{padding-bottom:1.5rem!important}.pl-md-4,.px-md-4{padding-left:1.5rem!important}.p-md-5{padding:3rem!important}.pt-md-5,.py-md-5{padding-top:3rem!important}.pr-md-5,.px-md-5{padding-right:3rem!important}.pb-md-5,.py-md-5{padding-bottom:3rem!important}.pl-md-5,.px-md-5{padding-left:3rem!important}.m-md-n1{margin:-.25rem!important}.mt-md-n1,.my-md-n1{margin-top:-.25rem!important}.mr-md-n1,.mx-md-n1{margin-right:-.25rem!important}.mb-md-n1,.my-md-n1{margin-bottom:-.25rem!important}.ml-md-n1,.mx-md-n1{margin-left:-.25rem!important}.m-md-n2{margin:-.5rem!important}.mt-md-n2,.my-md-n2{margin-top:-.5rem!important}.mr-md-n2,.mx-md-n2{margin-right:-.5rem!important}.mb-md-n2,.my-md-n2{margin-bottom:-.5rem!important}.ml-md-n2,.mx-md-n2{margin-left:-.5rem!important}.m-md-n3{margin:-1rem!important}.mt-md-n3,.my-md-n3{margin-top:-1rem!important}.mr-md-n3,.mx-md-n3{margin-right:-1rem!important}.mb-md-n3,.my-md-n3{margin-bottom:-1rem!important}.ml-md-n3,.mx-md-n3{margin-left:-1rem!important}.m-md-n4{margin:-1.5rem!important}.mt-md-n4,.my-md-n4{margin-top:-1.5rem!important}.mr-md-n4,.mx-md-n4{margin-right:-1.5rem!important}.mb-md-n4,.my-md-n4{margin-bottom:-1.5rem!important}.ml-md-n4,.mx-md-n4{margin-left:-1.5rem!important}.m-md-n5{margin:-3rem!important}.mt-md-n5,.my-md-n5{margin-top:-3rem!important}.mr-md-n5,.mx-md-n5{margin-right:-3rem!important}.mb-md-n5,.my-md-n5{margin-bottom:-3rem!important}.ml-md-n5,.mx-md-n5{margin-left:-3rem!important}.m-md-auto{margin:auto!important}.mt-md-auto,.my-md-auto{margin-top:auto!important}.mr-md-auto,.mx-md-auto{margin-right:auto!important}.mb-md-auto,.my-md-auto{margin-bottom:auto!important}.ml-md-auto,.mx-md-auto{margin-left:auto!important}}@media (min-width:992px){.m-lg-0{margin:0!important}.mt-lg-0,.my-lg-0{margin-top:0!important}.mr-lg-0,.mx-lg-0{margin-right:0!important}.mb-lg-0,.my-lg-0{margin-bottom:0!important}.ml-lg-0,.mx-lg-0{margin-left:0!important}.m-lg-1{margin:.25rem!important}.mt-lg-1,.my-lg-1{margin-top:.25rem!important}.mr-lg-1,.mx-lg-1{margin-right:.25rem!important}.mb-lg-1,.my-lg-1{margin-bottom:.25rem!important}.ml-lg-1,.mx-lg-1{margin-left:.25rem!important}.m-lg-2{margin:.5rem!important}.mt-lg-2,.my-lg-2{margin-top:.5rem!important}.mr-lg-2,.mx-lg-2{margin-right:.5rem!important}.mb-lg-2,.my-lg-2{margin-bottom:.5rem!important}.ml-lg-2,.mx-lg-2{margin-left:.5rem!important}.m-lg-3{margin:1rem!important}.mt-lg-3,.my-lg-3{margin-top:1rem!important}.mr-lg-3,.mx-lg-3{margin-right:1rem!important}.mb-lg-3,.my-lg-3{margin-bottom:1rem!important}.ml-lg-3,.mx-lg-3{margin-left:1rem!important}.m-lg-4{margin:1.5rem!important}.mt-lg-4,.my-lg-4{margin-top:1.5rem!important}.mr-lg-4,.mx-lg-4{margin-right:1.5rem!important}.mb-lg-4,.my-lg-4{margin-bottom:1.5rem!important}.ml-lg-4,.mx-lg-4{margin-left:1.5rem!important}.m-lg-5{margin:3rem!important}.mt-lg-5,.my-lg-5{margin-top:3rem!important}.mr-lg-5,.mx-lg-5{margin-right:3rem!important}.mb-lg-5,.my-lg-5{margin-bottom:3rem!important}.ml-lg-5,.mx-lg-5{margin-left:3rem!important}.p-lg-0{padding:0!important}.pt-lg-0,.py-lg-0{padding-top:0!important}.pr-lg-0,.px-lg-0{padding-right:0!important}.pb-lg-0,.py-lg-0{padding-bottom:0!important}.pl-lg-0,.px-lg-0{padding-left:0!important}.p-lg-1{padding:.25rem!important}.pt-lg-1,.py-lg-1{padding-top:.25rem!important}.pr-lg-1,.px-lg-1{padding-right:.25rem!important}.pb-lg-1,.py-lg-1{padding-bottom:.25rem!important}.pl-lg-1,.px-lg-1{padding-left:.25rem!important}.p-lg-2{padding:.5rem!important}.pt-lg-2,.py-lg-2{padding-top:.5rem!important}.pr-lg-2,.px-lg-2{padding-right:.5rem!important}.pb-lg-2,.py-lg-2{padding-bottom:.5rem!important}.pl-lg-2,.px-lg-2{padding-left:.5rem!important}.p-lg-3{padding:1rem!important}.pt-lg-3,.py-lg-3{padding-top:1rem!important}.pr-lg-3,.px-lg-3{padding-right:1rem!important}.pb-lg-3,.py-lg-3{padding-bottom:1rem!important}.pl-lg-3,.px-lg-3{padding-left:1rem!important}.p-lg-4{padding:1.5rem!important}.pt-lg-4,.py-lg-4{padding-top:1.5rem!important}.pr-lg-4,.px-lg-4{padding-right:1.5rem!important}.pb-lg-4,.py-lg-4{padding-bottom:1.5rem!important}.pl-lg-4,.px-lg-4{padding-left:1.5rem!important}.p-lg-5{padding:3rem!important}.pt-lg-5,.py-lg-5{padding-top:3rem!important}.pr-lg-5,.px-lg-5{padding-right:3rem!important}.pb-lg-5,.py-lg-5{padding-bottom:3rem!important}.pl-lg-5,.px-lg-5{padding-left:3rem!important}.m-lg-n1{margin:-.25rem!important}.mt-lg-n1,.my-lg-n1{margin-top:-.25rem!important}.mr-lg-n1,.mx-lg-n1{margin-right:-.25rem!important}.mb-lg-n1,.my-lg-n1{margin-bottom:-.25rem!important}.ml-lg-n1,.mx-lg-n1{margin-left:-.25rem!important}.m-lg-n2{margin:-.5rem!important}.mt-lg-n2,.my-lg-n2{margin-top:-.5rem!important}.mr-lg-n2,.mx-lg-n2{margin-right:-.5rem!important}.mb-lg-n2,.my-lg-n2{margin-bottom:-.5rem!important}.ml-lg-n2,.mx-lg-n2{margin-left:-.5rem!important}.m-lg-n3{margin:-1rem!important}.mt-lg-n3,.my-lg-n3{margin-top:-1rem!important}.mr-lg-n3,.mx-lg-n3{margin-right:-1rem!important}.mb-lg-n3,.my-lg-n3{margin-bottom:-1rem!important}.ml-lg-n3,.mx-lg-n3{margin-left:-1rem!important}.m-lg-n4{margin:-1.5rem!important}.mt-lg-n4,.my-lg-n4{margin-top:-1.5rem!important}.mr-lg-n4,.mx-lg-n4{margin-right:-1.5rem!important}.mb-lg-n4,.my-lg-n4{margin-bottom:-1.5rem!important}.ml-lg-n4,.mx-lg-n4{margin-left:-1.5rem!important}.m-lg-n5{margin:-3rem!important}.mt-lg-n5,.my-lg-n5{margin-top:-3rem!important}.mr-lg-n5,.mx-lg-n5{margin-right:-3rem!important}.mb-lg-n5,.my-lg-n5{margin-bottom:-3rem!important}.ml-lg-n5,.mx-lg-n5{margin-left:-3rem!important}.m-lg-auto{margin:auto!important}.mt-lg-auto,.my-lg-auto{margin-top:auto!important}.mr-lg-auto,.mx-lg-auto{margin-right:auto!important}.mb-lg-auto,.my-lg-auto{margin-bottom:auto!important}.ml-lg-auto,.mx-lg-auto{margin-left:auto!important}}@media (min-width:1200px){.m-xl-0{margin:0!important}.mt-xl-0,.my-xl-0{margin-top:0!important}.mr-xl-0,.mx-xl-0{margin-right:0!important}.mb-xl-0,.my-xl-0{margin-bottom:0!important}.ml-xl-0,.mx-xl-0{margin-left:0!important}.m-xl-1{margin:.25rem!important}.mt-xl-1,.my-xl-1{margin-top:.25rem!important}.mr-xl-1,.mx-xl-1{margin-right:.25rem!important}.mb-xl-1,.my-xl-1{margin-bottom:.25rem!important}.ml-xl-1,.mx-xl-1{margin-left:.25rem!important}.m-xl-2{margin:.5rem!important}.mt-xl-2,.my-xl-2{margin-top:.5rem!important}.mr-xl-2,.mx-xl-2{margin-right:.5rem!important}.mb-xl-2,.my-xl-2{margin-bottom:.5rem!important}.ml-xl-2,.mx-xl-2{margin-left:.5rem!important}.m-xl-3{margin:1rem!important}.mt-xl-3,.my-xl-3{margin-top:1rem!important}.mr-xl-3,.mx-xl-3{margin-right:1rem!important}.mb-xl-3,.my-xl-3{margin-bottom:1rem!important}.ml-xl-3,.mx-xl-3{margin-left:1rem!important}.m-xl-4{margin:1.5rem!important}.mt-xl-4,.my-xl-4{margin-top:1.5rem!important}.mr-xl-4,.mx-xl-4{margin-right:1.5rem!important}.mb-xl-4,.my-xl-4{margin-bottom:1.5rem!important}.ml-xl-4,.mx-xl-4{margin-left:1.5rem!important}.m-xl-5{margin:3rem!important}.mt-xl-5,.my-xl-5{margin-top:3rem!important}.mr-xl-5,.mx-xl-5{margin-right:3rem!important}.mb-xl-5,.my-xl-5{margin-bottom:3rem!important}.ml-xl-5,.mx-xl-5{margin-left:3rem!important}.p-xl-0{padding:0!important}.pt-xl-0,.py-xl-0{padding-top:0!important}.pr-xl-0,.px-xl-0{padding-right:0!important}.pb-xl-0,.py-xl-0{padding-bottom:0!important}.pl-xl-0,.px-xl-0{padding-left:0!important}.p-xl-1{padding:.25rem!important}.pt-xl-1,.py-xl-1{padding-top:.25rem!important}.pr-xl-1,.px-xl-1{padding-right:.25rem!important}.pb-xl-1,.py-xl-1{padding-bottom:.25rem!important}.pl-xl-1,.px-xl-1{padding-left:.25rem!important}.p-xl-2{padding:.5rem!important}.pt-xl-2,.py-xl-2{padding-top:.5rem!important}.pr-xl-2,.px-xl-2{padding-right:.5rem!important}.pb-xl-2,.py-xl-2{padding-bottom:.5rem!important}.pl-xl-2,.px-xl-2{padding-left:.5rem!important}.p-xl-3{padding:1rem!important}.pt-xl-3,.py-xl-3{padding-top:1rem!important}.pr-xl-3,.px-xl-3{padding-right:1rem!important}.pb-xl-3,.py-xl-3{padding-bottom:1rem!important}.pl-xl-3,.px-xl-3{padding-left:1rem!important}.p-xl-4{padding:1.5rem!important}.pt-xl-4,.py-xl-4{padding-top:1.5rem!important}.pr-xl-4,.px-xl-4{padding-right:1.5rem!important}.pb-xl-4,.py-xl-4{padding-bottom:1.5rem!important}.pl-xl-4,.px-xl-4{padding-left:1.5rem!important}.p-xl-5{padding:3rem!important}.pt-xl-5,.py-xl-5{padding-top:3rem!important}.pr-xl-5,.px-xl-5{padding-right:3rem!important}.pb-xl-5,.py-xl-5{padding-bottom:3rem!important}.pl-xl-5,.px-xl-5{padding-left:3rem!important}.m-xl-n1{margin:-.25rem!important}.mt-xl-n1,.my-xl-n1{margin-top:-.25rem!important}.mr-xl-n1,.mx-xl-n1{margin-right:-.25rem!important}.mb-xl-n1,.my-xl-n1{margin-bottom:-.25rem!important}.ml-xl-n1,.mx-xl-n1{margin-left:-.25rem!important}.m-xl-n2{margin:-.5rem!important}.mt-xl-n2,.my-xl-n2{margin-top:-.5rem!important}.mr-xl-n2,.mx-xl-n2{margin-right:-.5rem!important}.mb-xl-n2,.my-xl-n2{margin-bottom:-.5rem!important}.ml-xl-n2,.mx-xl-n2{margin-left:-.5rem!important}.m-xl-n3{margin:-1rem!important}.mt-xl-n3,.my-xl-n3{margin-top:-1rem!important}.mr-xl-n3,.mx-xl-n3{margin-right:-1rem!important}.mb-xl-n3,.my-xl-n3{margin-bottom:-1rem!important}.ml-xl-n3,.mx-xl-n3{margin-left:-1rem!important}.m-xl-n4{margin:-1.5rem!important}.mt-xl-n4,.my-xl-n4{margin-top:-1.5rem!important}.mr-xl-n4,.mx-xl-n4{margin-right:-1.5rem!important}.mb-xl-n4,.my-xl-n4{margin-bottom:-1.5rem!important}.ml-xl-n4,.mx-xl-n4{margin-left:-1.5rem!important}.m-xl-n5{margin:-3rem!important}.mt-xl-n5,.my-xl-n5{margin-top:-3rem!important}.mr-xl-n5,.mx-xl-n5{margin-right:-3rem!important}.mb-xl-n5,.my-xl-n5{margin-bottom:-3rem!important}.ml-xl-n5,.mx-xl-n5{margin-left:-3rem!important}.m-xl-auto{margin:auto!important}.mt-xl-auto,.my-xl-auto{margin-top:auto!important}.mr-xl-auto,.mx-xl-auto{margin-right:auto!important}.mb-xl-auto,.my-xl-auto{margin-bottom:auto!important}.ml-xl-auto,.mx-xl-auto{margin-left:auto!important}}.text-monospace{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace!important}.text-justify{text-align:justify!important}.text-wrap{white-space:normal!important}.text-nowrap{white-space:nowrap!important}.text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-left{text-align:left!important}.text-right{text-align:right!important}.text-center{text-align:center!important}@media (min-width:576px){.text-sm-left{text-align:left!important}.text-sm-right{text-align:right!important}.text-sm-center{text-align:center!important}}@media (min-width:768px){.text-md-left{text-align:left!important}.text-md-right{text-align:right!important}.text-md-center{text-align:center!important}}@media (min-width:992px){.text-lg-left{text-align:left!important}.text-lg-right{text-align:right!important}.text-lg-center{text-align:center!important}}@media (min-width:1200px){.text-xl-left{text-align:left!important}.text-xl-right{text-align:right!important}.text-xl-center{text-align:center!important}}.text-lowercase{text-transform:lowercase!important}.text-uppercase{text-transform:uppercase!important}.text-capitalize{text-transform:capitalize!important}.font-weight-light{font-weight:300!important}.font-weight-lighter{font-weight:lighter!important}.font-weight-normal{font-weight:400!important}.font-weight-bold{font-weight:700!important}.font-weight-bolder{font-weight:bolder!important}.font-italic{font-style:italic!important}.text-white{color:#fff!important}.text-primary{color:#007bff!important}a.text-primary:focus,a.text-primary:hover{color:#0056b3!important}.text-secondary{color:#6c757d!important}a.text-secondary:focus,a.text-secondary:hover{color:#494f54!important}.text-success{color:#28a745!important}a.text-success:focus,a.text-success:hover{color:#19692c!important}.text-info{color:#17a2b8!important}a.text-info:focus,a.text-info:hover{color:#0f6674!important}.text-warning{color:#ffc107!important}a.text-warning:focus,a.text-warning:hover{color:#ba8b00!important}.text-danger{color:#dc3545!important}a.text-danger:focus,a.text-danger:hover{color:#a71d2a!important}.text-light{color:#f8f9fa!important}a.text-light:focus,a.text-light:hover{color:#cbd3da!important}.text-dark{color:#343a40!important}a.text-dark:focus,a.text-dark:hover{color:#121416!important}.text-body{color:#212529!important}.text-muted{color:#6c757d!important}.text-black-50{color:rgba(0,0,0,.5)!important}.text-white-50{color:rgba(255,255,255,.5)!important}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.text-decoration-none{text-decoration:none!important}.text-break{word-break:break-word!important;overflow-wrap:break-word!important}.text-reset{color:inherit!important}.visible{visibility:visible!important}.invisible{visibility:hidden!important}@media print{*,::after,::before{text-shadow:none!important;box-shadow:none!important}a:not(.btn){text-decoration:underline}abbr[title]::after{content:" (" attr(title) ")"}pre{white-space:pre-wrap!important}blockquote,pre{border:1px solid #adb5bd;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}@page{size:a3}body{min-width:992px!important}.container{min-width:992px!important}.navbar{display:none}.badge{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #dee2e6!important}.table-dark{color:inherit}.table-dark tbody+tbody,.table-dark td,.table-dark th,.table-dark thead th{border-color:#dee2e6}.table .thead-dark th{color:inherit;border-color:#dee2e6}} -/*# sourceMappingURL=bootstrap.min.css.map */ \ No newline at end of file diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/css/custom.css b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/css/custom.css deleted file mode 100644 index e69de29..0000000 diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/css/nv.d3.min.css b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/css/nv.d3.min.css deleted file mode 100644 index 7a6f7fe..0000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/css/nv.d3.min.css +++ /dev/null @@ -1 +0,0 @@ -.nvd3 .nv-axis{pointer-events:none;opacity:1}.nvd3 .nv-axis path{fill:none;stroke:#000;stroke-opacity:.75;shape-rendering:crispEdges}.nvd3 .nv-axis path.domain{stroke-opacity:.75}.nvd3 .nv-axis.nv-x path.domain{stroke-opacity:0}.nvd3 .nv-axis line{fill:none;stroke:#e5e5e5;shape-rendering:crispEdges}.nvd3 .nv-axis .zero line,.nvd3 .nv-axis line.zero{stroke-opacity:.75}.nvd3 .nv-axis .nv-axisMaxMin text{font-weight:700}.nvd3 .x .nv-axis .nv-axisMaxMin text,.nvd3 .x2 .nv-axis .nv-axisMaxMin text,.nvd3 .x3 .nv-axis .nv-axisMaxMin text{text-anchor:middle}.nvd3 .nv-axis.nv-disabled{opacity:0}.nvd3 .nv-bars rect{fill-opacity:.75;transition:fill-opacity 250ms linear;-moz-transition:fill-opacity 250ms linear;-webkit-transition:fill-opacity 250ms linear}.nvd3 .nv-bars rect.hover{fill-opacity:1}.nvd3 .nv-bars .hover rect{fill:#add8e6}.nvd3 .nv-bars text{fill:rgba(0,0,0,0)}.nvd3 .nv-bars .hover text{fill:rgba(0,0,0,1)}.nvd3 .nv-multibar .nv-groups rect,.nvd3 .nv-multibarHorizontal .nv-groups rect,.nvd3 .nv-discretebar .nv-groups rect{stroke-opacity:0;transition:fill-opacity 250ms linear;-moz-transition:fill-opacity 250ms linear;-webkit-transition:fill-opacity 250ms linear}.nvd3 .nv-multibar .nv-groups rect:hover,.nvd3 .nv-multibarHorizontal .nv-groups rect:hover,.nvd3 .nv-candlestickBar .nv-ticks rect:hover,.nvd3 .nv-discretebar .nv-groups rect:hover{fill-opacity:1}.nvd3 .nv-discretebar .nv-groups text,.nvd3 .nv-multibarHorizontal .nv-groups text{font-weight:700;fill:rgba(0,0,0,1);stroke:rgba(0,0,0,0)}.nvd3 .nv-boxplot circle{fill-opacity:.5}.nvd3 .nv-boxplot circle:hover{fill-opacity:1}.nvd3 .nv-boxplot rect:hover{fill-opacity:1}.nvd3 line.nv-boxplot-median{stroke:#000}.nv-boxplot-tick:hover{stroke-width:2.5px}.nvd3.nv-bullet{font:10px sans-serif}.nvd3.nv-bullet .nv-measure{fill-opacity:.8}.nvd3.nv-bullet .nv-measure:hover{fill-opacity:1}.nvd3.nv-bullet .nv-marker{stroke:#000;stroke-width:2px}.nvd3.nv-bullet .nv-markerTriangle{stroke:#000;fill:#fff;stroke-width:1.5px}.nvd3.nv-bullet .nv-tick line{stroke:#666;stroke-width:.5px}.nvd3.nv-bullet .nv-range.nv-s0{fill:#eee}.nvd3.nv-bullet .nv-range.nv-s1{fill:#ddd}.nvd3.nv-bullet .nv-range.nv-s2{fill:#ccc}.nvd3.nv-bullet .nv-title{font-size:14px;font-weight:700}.nvd3.nv-bullet .nv-subtitle{fill:#999}.nvd3.nv-bullet .nv-range{fill:#bababa;fill-opacity:.4}.nvd3.nv-bullet .nv-range:hover{fill-opacity:.7}.nvd3.nv-candlestickBar .nv-ticks .nv-tick{stroke-width:1px}.nvd3.nv-candlestickBar .nv-ticks .nv-tick.hover{stroke-width:2px}.nvd3.nv-candlestickBar .nv-ticks .nv-tick.positive rect{stroke:#2ca02c;fill:#2ca02c}.nvd3.nv-candlestickBar .nv-ticks .nv-tick.negative rect{stroke:#d62728;fill:#d62728}.with-transitions .nv-candlestickBar .nv-ticks .nv-tick{transition:stroke-width 250ms linear,stroke-opacity 250ms linear;-moz-transition:stroke-width 250ms linear,stroke-opacity 250ms linear;-webkit-transition:stroke-width 250ms linear,stroke-opacity 250ms linear}.nvd3.nv-candlestickBar .nv-ticks line{stroke:#333}.nvd3 .nv-legend .nv-disabled rect{}.nvd3 .nv-check-box .nv-box{fill-opacity:0;stroke-width:2}.nvd3 .nv-check-box .nv-check{fill-opacity:0;stroke-width:4}.nvd3 .nv-series.nv-disabled .nv-check-box .nv-check{fill-opacity:0;stroke-opacity:0}.nvd3 .nv-controlsWrap .nv-legend .nv-check-box .nv-check{opacity:0}.nvd3.nv-linePlusBar .nv-bar rect{fill-opacity:.75}.nvd3.nv-linePlusBar .nv-bar rect:hover{fill-opacity:1}.nvd3 .nv-groups path.nv-line{fill:none}.nvd3 .nv-groups path.nv-area{stroke:none}.nvd3.nv-line .nvd3.nv-scatter .nv-groups .nv-point{fill-opacity:0;stroke-opacity:0}.nvd3.nv-scatter.nv-single-point .nv-groups .nv-point{fill-opacity:.5!important;stroke-opacity:.5!important}.with-transitions .nvd3 .nv-groups .nv-point{transition:stroke-width 250ms linear,stroke-opacity 250ms linear;-moz-transition:stroke-width 250ms linear,stroke-opacity 250ms linear;-webkit-transition:stroke-width 250ms linear,stroke-opacity 250ms linear}.nvd3.nv-scatter .nv-groups .nv-point.hover,.nvd3 .nv-groups .nv-point.hover{stroke-width:7px;fill-opacity:.95!important;stroke-opacity:.95!important}.nvd3 .nv-point-paths path{stroke:#aaa;stroke-opacity:0;fill:#eee;fill-opacity:0}.nvd3 .nv-indexLine{cursor:ew-resize}svg.nvd3-svg{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-ms-user-select:none;-moz-user-select:none;user-select:none;display:block;width:100%;height:100%}.nvtooltip.with-3d-shadow,.with-3d-shadow .nvtooltip{-moz-box-shadow:0 5px 10px rgba(0,0,0,.2);-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.nvd3 text{font:400 12px Arial}.nvd3 .title{font:700 14px Arial}.nvd3 .nv-background{fill:#fff;fill-opacity:0}.nvd3.nv-noData{font-size:18px;font-weight:700}.nv-brush .extent{fill-opacity:.125;shape-rendering:crispEdges}.nv-brush .resize path{fill:#eee;stroke:#666}.nvd3 .nv-legend .nv-series{cursor:pointer}.nvd3 .nv-legend .nv-disabled circle{fill-opacity:0}.nvd3 .nv-brush .extent{fill-opacity:0!important}.nvd3 .nv-brushBackground rect{stroke:#000;stroke-width:.4;fill:#fff;fill-opacity:.7}.nvd3.nv-ohlcBar .nv-ticks .nv-tick{stroke-width:1px}.nvd3.nv-ohlcBar .nv-ticks .nv-tick.hover{stroke-width:2px}.nvd3.nv-ohlcBar .nv-ticks .nv-tick.positive{stroke:#2ca02c}.nvd3.nv-ohlcBar .nv-ticks .nv-tick.negative{stroke:#d62728}.nvd3 .background path{fill:none;stroke:#EEE;stroke-opacity:.4;shape-rendering:crispEdges}.nvd3 .foreground path{fill:none;stroke-opacity:.7}.nvd3 .nv-parallelCoordinates-brush .extent{fill:#fff;fill-opacity:.6;stroke:gray;shape-rendering:crispEdges}.nvd3 .nv-parallelCoordinates .hover{fill-opacity:1;stroke-width:3px}.nvd3 .missingValuesline line{fill:none;stroke:#000;stroke-width:1;stroke-opacity:1;stroke-dasharray:5,5}.nvd3.nv-pie path{stroke-opacity:0;transition:fill-opacity 250ms linear,stroke-width 250ms linear,stroke-opacity 250ms linear;-moz-transition:fill-opacity 250ms linear,stroke-width 250ms linear,stroke-opacity 250ms linear;-webkit-transition:fill-opacity 250ms linear,stroke-width 250ms linear,stroke-opacity 250ms linear}.nvd3.nv-pie .nv-pie-title{font-size:24px;fill:rgba(19,196,249,.59)}.nvd3.nv-pie .nv-slice text{stroke:#000;stroke-width:0}.nvd3.nv-pie path{stroke:#fff;stroke-width:1px;stroke-opacity:1}.nvd3.nv-pie .hover path{fill-opacity:.7}.nvd3.nv-pie .nv-label{pointer-events:none}.nvd3.nv-pie .nv-label rect{fill-opacity:0;stroke-opacity:0}.nvd3 .nv-groups .nv-point.hover{stroke-width:20px;stroke-opacity:.5}.nvd3 .nv-scatter .nv-point.hover{fill-opacity:1}.nv-noninteractive{pointer-events:none}.nv-distx,.nv-disty{pointer-events:none}.nvd3.nv-sparkline path{fill:none}.nvd3.nv-sparklineplus g.nv-hoverValue{pointer-events:none}.nvd3.nv-sparklineplus .nv-hoverValue line{stroke:#333;stroke-width:1.5px}.nvd3.nv-sparklineplus,.nvd3.nv-sparklineplus g{pointer-events:all}.nvd3 .nv-hoverArea{fill-opacity:0;stroke-opacity:0}.nvd3.nv-sparklineplus .nv-xValue,.nvd3.nv-sparklineplus .nv-yValue{stroke-width:0;font-size:.9em;font-weight:400}.nvd3.nv-sparklineplus .nv-yValue{stroke:#f66}.nvd3.nv-sparklineplus .nv-maxValue{stroke:#2ca02c;fill:#2ca02c}.nvd3.nv-sparklineplus .nv-minValue{stroke:#d62728;fill:#d62728}.nvd3.nv-sparklineplus .nv-currentValue{font-weight:700;font-size:1.1em}.nvd3.nv-stackedarea path.nv-area{fill-opacity:.7;stroke-opacity:0;transition:fill-opacity 250ms linear,stroke-opacity 250ms linear;-moz-transition:fill-opacity 250ms linear,stroke-opacity 250ms linear;-webkit-transition:fill-opacity 250ms linear,stroke-opacity 250ms linear}.nvd3.nv-stackedarea path.nv-area.hover{fill-opacity:.9}.nvd3.nv-stackedarea .nv-groups .nv-point{stroke-opacity:0;fill-opacity:0}.nvtooltip{position:absolute;background-color:rgba(255,255,255,1);color:rgba(0,0,0,1);padding:1px;border:1px solid rgba(0,0,0,.2);z-index:10000;display:block;font-family:Arial;font-size:13px;text-align:left;pointer-events:none;white-space:nowrap;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.nvtooltip{background:rgba(255,255,255,.8);border:1px solid rgba(0,0,0,.5);border-radius:4px}.nvtooltip.with-transitions,.with-transitions .nvtooltip{transition:opacity 50ms linear;-moz-transition:opacity 50ms linear;-webkit-transition:opacity 50ms linear;transition-delay:200ms;-moz-transition-delay:200ms;-webkit-transition-delay:200ms}.nvtooltip.x-nvtooltip,.nvtooltip.y-nvtooltip{padding:8px}.nvtooltip h3{margin:0;padding:4px 14px;line-height:18px;font-weight:400;background-color:rgba(247,247,247,.75);color:rgba(0,0,0,1);text-align:center;border-bottom:1px solid #ebebeb;-webkit-border-radius:5px 5px 0 0;-moz-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0}.nvtooltip p{margin:0;padding:5px 14px;text-align:center}.nvtooltip span{display:inline-block;margin:2px 0}.nvtooltip table{margin:6px;border-spacing:0}.nvtooltip table td{padding:2px 9px 2px 0;vertical-align:middle}.nvtooltip table td.key{font-weight:400}.nvtooltip table td.value{text-align:right;font-weight:700}.nvtooltip table tr.highlight td{padding:1px 9px 1px 0;border-bottom-style:solid;border-bottom-width:1px;border-top-style:solid;border-top-width:1px}.nvtooltip table td.legend-color-guide div{width:8px;height:8px;vertical-align:middle}.nvtooltip table td.legend-color-guide div{width:12px;height:12px;border:1px solid #999}.nvtooltip .footer{padding:3px;text-align:center}.nvtooltip-pending-removal{pointer-events:none;display:none}.nvd3 .nv-interactiveGuideLine{pointer-events:none}.nvd3 line.nv-guideline{stroke:#ccc} \ No newline at end of file diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/css/octicons.css b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/css/octicons.css deleted file mode 100644 index 31d9786..0000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/css/octicons.css +++ /dev/null @@ -1,5 +0,0 @@ -.octicon { - display: inline-block; - vertical-align: text-top; - fill: currentColor; -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/css/style.css b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/css/style.css deleted file mode 100644 index 6d9c21e..0000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/css/style.css +++ /dev/null @@ -1,122 +0,0 @@ -body { - padding-top: 10px; -} - -.popover { - max-width: none; -} - -.octicon { - margin-right:.25em; -} - -.table-bordered>thead>tr>td { - border-bottom-width: 1px; -} - -.table tbody>tr>td, .table thead>tr>td { - padding-top: 3px; - padding-bottom: 3px; -} - -.table-condensed tbody>tr>td { - padding-top: 0; - padding-bottom: 0; -} - -.table .progress { - margin-bottom: inherit; -} - -.table-borderless th, .table-borderless td { - border: 0 !important; -} - -.table tbody tr.covered-by-large-tests, li.covered-by-large-tests, tr.success, td.success, li.success, span.success { - background-color: #dff0d8; -} - -.table tbody tr.covered-by-medium-tests, li.covered-by-medium-tests { - background-color: #c3e3b5; -} - -.table tbody tr.covered-by-small-tests, li.covered-by-small-tests { - background-color: #99cb84; -} - -.table tbody tr.danger, .table tbody td.danger, li.danger, span.danger { - background-color: #f2dede; -} - -.table tbody td.warning, li.warning, span.warning { - background-color: #fcf8e3; -} - -.table tbody td.info { - background-color: #d9edf7; -} - -td.big { - width: 117px; -} - -td.small { -} - -td.codeLine { - font-family: "Source Code Pro", "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; - white-space: pre; -} - -td span.comment { - color: #888a85; -} - -td span.default { - color: #2e3436; -} - -td span.html { - color: #888a85; -} - -td span.keyword { - color: #2e3436; - font-weight: bold; -} - -pre span.string { - color: #2e3436; -} - -span.success, span.warning, span.danger { - margin-right: 2px; - padding-left: 10px; - padding-right: 10px; - text-align: center; -} - -#classCoverageDistribution, #classComplexity { - height: 200px; - width: 475px; -} - -#toplink { - position: fixed; - left: 5px; - bottom: 5px; - outline: 0; -} - -svg text { - font-family: "Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif; - font-size: 11px; - color: #666; - fill: #666; -} - -.scrollbox { - height:245px; - overflow-x:hidden; - overflow-y:scroll; -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/dashboard.html.dist b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/dashboard.html.dist deleted file mode 100644 index aa51bcb..0000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/dashboard.html.dist +++ /dev/null @@ -1,281 +0,0 @@ - - - - - Dashboard for {{full_path}} - - - - - - - -
-
-
-
- -
-
-
-
-
-
-
-

Classes

-
-
-
-
-

Coverage Distribution

-
- -
-
-
-

Complexity

-
- -
-
-
-
-
-

Insufficient Coverage

-
- - - - - - - - -{{insufficient_coverage_classes}} - -
ClassCoverage
-
-
-
-

Project Risks

-
- - - - - - - - -{{project_risks_classes}} - -
ClassCRAP
-
-
-
-
-
-

Methods

-
-
-
-
-

Coverage Distribution

-
- -
-
-
-

Complexity

-
- -
-
-
-
-
-

Insufficient Coverage

-
- - - - - - - - -{{insufficient_coverage_methods}} - -
MethodCoverage
-
-
-
-

Project Risks

-
- - - - - - - - -{{project_risks_methods}} - -
MethodCRAP
-
-
-
- -
- - - - - - diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/directory.html.dist b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/directory.html.dist deleted file mode 100644 index a263463..0000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/directory.html.dist +++ /dev/null @@ -1,60 +0,0 @@ - - - - - Code Coverage for {{full_path}} - - - - - - - -
-
-
-
- -
-
-
-
-
-
- - - - - - - - - - - - - - -{{items}} - -
 
Code Coverage
 
Lines
Functions and Methods
Classes and Traits
-
-
-
-

Legend

-

- Low: 0% to {{low_upper_bound}}% - Medium: {{low_upper_bound}}% to {{high_lower_bound}}% - High: {{high_lower_bound}}% to 100% -

-

- Generated by php-code-coverage {{version}} using {{runtime}}{{generator}} at {{date}}. -

-
-
- - diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/directory_item.html.dist b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/directory_item.html.dist deleted file mode 100644 index f6941a4..0000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/directory_item.html.dist +++ /dev/null @@ -1,13 +0,0 @@ - - {{icon}}{{name}} - {{lines_bar}} -
{{lines_executed_percent}}
-
{{lines_number}}
- {{methods_bar}} -
{{methods_tested_percent}}
-
{{methods_number}}
- {{classes_bar}} -
{{classes_tested_percent}}
-
{{classes_number}}
- - diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/file.html.dist b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/file.html.dist deleted file mode 100644 index 0ca65ed..0000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/file.html.dist +++ /dev/null @@ -1,72 +0,0 @@ - - - - - Code Coverage for {{full_path}} - - - - - - - -
-
-
-
- -
-
-
-
-
-
- - - - - - - - - - - - - - -{{items}} - -
 
Code Coverage
 
Classes and Traits
Functions and Methods
Lines
-
- - -{{lines}} - -
- -
- - - - - - diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/file_item.html.dist b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/file_item.html.dist deleted file mode 100644 index dc754b3..0000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/file_item.html.dist +++ /dev/null @@ -1,14 +0,0 @@ - - {{name}} - {{classes_bar}} -
{{classes_tested_percent}}
-
{{classes_number}}
- {{methods_bar}} -
{{methods_tested_percent}}
-
{{methods_number}}
- {{crap}} - {{lines_bar}} -
{{lines_executed_percent}}
-
{{lines_number}}
- - diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/icons/file-code.svg b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/icons/file-code.svg deleted file mode 100644 index 5b4b199..0000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/icons/file-code.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/icons/file-directory.svg b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/icons/file-directory.svg deleted file mode 100644 index 4bf1f1c..0000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/icons/file-directory.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/js/bootstrap.min.js b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/js/bootstrap.min.js deleted file mode 100644 index c4c0d1f..0000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/js/bootstrap.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * Bootstrap v4.3.1 (https://getbootstrap.com/) - * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("jquery"),require("popper.js")):"function"==typeof define&&define.amd?define(["exports","jquery","popper.js"],e):e((t=t||self).bootstrap={},t.jQuery,t.Popper)}(this,function(t,g,u){"use strict";function i(t,e){for(var n=0;nthis._items.length-1||t<0))if(this._isSliding)g(this._element).one(Q.SLID,function(){return e.to(t)});else{if(n===t)return this.pause(),void this.cycle();var i=ndocument.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},t._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},t._checkScrollbar=function(){var t=document.body.getBoundingClientRect();this._isBodyOverflowing=t.left+t.right
',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:0,container:!1,fallbackPlacement:"flip",boundary:"scrollParent",sanitize:!0,sanitizeFn:null,whiteList:Ee},je="show",He="out",Re={HIDE:"hide"+De,HIDDEN:"hidden"+De,SHOW:"show"+De,SHOWN:"shown"+De,INSERTED:"inserted"+De,CLICK:"click"+De,FOCUSIN:"focusin"+De,FOCUSOUT:"focusout"+De,MOUSEENTER:"mouseenter"+De,MOUSELEAVE:"mouseleave"+De},xe="fade",Fe="show",Ue=".tooltip-inner",We=".arrow",qe="hover",Me="focus",Ke="click",Qe="manual",Be=function(){function i(t,e){if("undefined"==typeof u)throw new TypeError("Bootstrap's tooltips require Popper.js (https://popper.js.org/)");this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}var t=i.prototype;return t.enable=function(){this._isEnabled=!0},t.disable=function(){this._isEnabled=!1},t.toggleEnabled=function(){this._isEnabled=!this._isEnabled},t.toggle=function(t){if(this._isEnabled)if(t){var e=this.constructor.DATA_KEY,n=g(t.currentTarget).data(e);n||(n=new this.constructor(t.currentTarget,this._getDelegateConfig()),g(t.currentTarget).data(e,n)),n._activeTrigger.click=!n._activeTrigger.click,n._isWithActiveTrigger()?n._enter(null,n):n._leave(null,n)}else{if(g(this.getTipElement()).hasClass(Fe))return void this._leave(null,this);this._enter(null,this)}},t.dispose=function(){clearTimeout(this._timeout),g.removeData(this.element,this.constructor.DATA_KEY),g(this.element).off(this.constructor.EVENT_KEY),g(this.element).closest(".modal").off("hide.bs.modal"),this.tip&&g(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,(this._activeTrigger=null)!==this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},t.show=function(){var e=this;if("none"===g(this.element).css("display"))throw new Error("Please use show on visible elements");var t=g.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){g(this.element).trigger(t);var n=_.findShadowRoot(this.element),i=g.contains(null!==n?n:this.element.ownerDocument.documentElement,this.element);if(t.isDefaultPrevented()||!i)return;var o=this.getTipElement(),r=_.getUID(this.constructor.NAME);o.setAttribute("id",r),this.element.setAttribute("aria-describedby",r),this.setContent(),this.config.animation&&g(o).addClass(xe);var s="function"==typeof this.config.placement?this.config.placement.call(this,o,this.element):this.config.placement,a=this._getAttachment(s);this.addAttachmentClass(a);var l=this._getContainer();g(o).data(this.constructor.DATA_KEY,this),g.contains(this.element.ownerDocument.documentElement,this.tip)||g(o).appendTo(l),g(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new u(this.element,o,{placement:a,modifiers:{offset:this._getOffset(),flip:{behavior:this.config.fallbackPlacement},arrow:{element:We},preventOverflow:{boundariesElement:this.config.boundary}},onCreate:function(t){t.originalPlacement!==t.placement&&e._handlePopperPlacementChange(t)},onUpdate:function(t){return e._handlePopperPlacementChange(t)}}),g(o).addClass(Fe),"ontouchstart"in document.documentElement&&g(document.body).children().on("mouseover",null,g.noop);var c=function(){e.config.animation&&e._fixTransition();var t=e._hoverState;e._hoverState=null,g(e.element).trigger(e.constructor.Event.SHOWN),t===He&&e._leave(null,e)};if(g(this.tip).hasClass(xe)){var h=_.getTransitionDurationFromElement(this.tip);g(this.tip).one(_.TRANSITION_END,c).emulateTransitionEnd(h)}else c()}},t.hide=function(t){var e=this,n=this.getTipElement(),i=g.Event(this.constructor.Event.HIDE),o=function(){e._hoverState!==je&&n.parentNode&&n.parentNode.removeChild(n),e._cleanTipClass(),e.element.removeAttribute("aria-describedby"),g(e.element).trigger(e.constructor.Event.HIDDEN),null!==e._popper&&e._popper.destroy(),t&&t()};if(g(this.element).trigger(i),!i.isDefaultPrevented()){if(g(n).removeClass(Fe),"ontouchstart"in document.documentElement&&g(document.body).children().off("mouseover",null,g.noop),this._activeTrigger[Ke]=!1,this._activeTrigger[Me]=!1,this._activeTrigger[qe]=!1,g(this.tip).hasClass(xe)){var r=_.getTransitionDurationFromElement(n);g(n).one(_.TRANSITION_END,o).emulateTransitionEnd(r)}else o();this._hoverState=""}},t.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},t.isWithContent=function(){return Boolean(this.getTitle())},t.addAttachmentClass=function(t){g(this.getTipElement()).addClass(Ae+"-"+t)},t.getTipElement=function(){return this.tip=this.tip||g(this.config.template)[0],this.tip},t.setContent=function(){var t=this.getTipElement();this.setElementContent(g(t.querySelectorAll(Ue)),this.getTitle()),g(t).removeClass(xe+" "+Fe)},t.setElementContent=function(t,e){"object"!=typeof e||!e.nodeType&&!e.jquery?this.config.html?(this.config.sanitize&&(e=Se(e,this.config.whiteList,this.config.sanitizeFn)),t.html(e)):t.text(e):this.config.html?g(e).parent().is(t)||t.empty().append(e):t.text(g(e).text())},t.getTitle=function(){var t=this.element.getAttribute("data-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},t._getOffset=function(){var e=this,t={};return"function"==typeof this.config.offset?t.fn=function(t){return t.offsets=l({},t.offsets,e.config.offset(t.offsets,e.element)||{}),t}:t.offset=this.config.offset,t},t._getContainer=function(){return!1===this.config.container?document.body:_.isElement(this.config.container)?g(this.config.container):g(document).find(this.config.container)},t._getAttachment=function(t){return Pe[t.toUpperCase()]},t._setListeners=function(){var i=this;this.config.trigger.split(" ").forEach(function(t){if("click"===t)g(i.element).on(i.constructor.Event.CLICK,i.config.selector,function(t){return i.toggle(t)});else if(t!==Qe){var e=t===qe?i.constructor.Event.MOUSEENTER:i.constructor.Event.FOCUSIN,n=t===qe?i.constructor.Event.MOUSELEAVE:i.constructor.Event.FOCUSOUT;g(i.element).on(e,i.config.selector,function(t){return i._enter(t)}).on(n,i.config.selector,function(t){return i._leave(t)})}}),g(this.element).closest(".modal").on("hide.bs.modal",function(){i.element&&i.hide()}),this.config.selector?this.config=l({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},t._fixTitle=function(){var t=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},t._enter=function(t,e){var n=this.constructor.DATA_KEY;(e=e||g(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),g(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusin"===t.type?Me:qe]=!0),g(e.getTipElement()).hasClass(Fe)||e._hoverState===je?e._hoverState=je:(clearTimeout(e._timeout),e._hoverState=je,e.config.delay&&e.config.delay.show?e._timeout=setTimeout(function(){e._hoverState===je&&e.show()},e.config.delay.show):e.show())},t._leave=function(t,e){var n=this.constructor.DATA_KEY;(e=e||g(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),g(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusout"===t.type?Me:qe]=!1),e._isWithActiveTrigger()||(clearTimeout(e._timeout),e._hoverState=He,e.config.delay&&e.config.delay.hide?e._timeout=setTimeout(function(){e._hoverState===He&&e.hide()},e.config.delay.hide):e.hide())},t._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},t._getConfig=function(t){var e=g(this.element).data();return Object.keys(e).forEach(function(t){-1!==Oe.indexOf(t)&&delete e[t]}),"number"==typeof(t=l({},this.constructor.Default,e,"object"==typeof t&&t?t:{})).delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),_.typeCheckConfig(be,t,this.constructor.DefaultType),t.sanitize&&(t.template=Se(t.template,t.whiteList,t.sanitizeFn)),t},t._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},t._cleanTipClass=function(){var t=g(this.getTipElement()),e=t.attr("class").match(Ne);null!==e&&e.length&&t.removeClass(e.join(""))},t._handlePopperPlacementChange=function(t){var e=t.instance;this.tip=e.popper,this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(t.placement))},t._fixTransition=function(){var t=this.getTipElement(),e=this.config.animation;null===t.getAttribute("x-placement")&&(g(t).removeClass(xe),this.config.animation=!1,this.hide(),this.show(),this.config.animation=e)},i._jQueryInterface=function(n){return this.each(function(){var t=g(this).data(Ie),e="object"==typeof n&&n;if((t||!/dispose|hide/.test(n))&&(t||(t=new i(this,e),g(this).data(Ie,t)),"string"==typeof n)){if("undefined"==typeof t[n])throw new TypeError('No method named "'+n+'"');t[n]()}})},s(i,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"Default",get:function(){return Le}},{key:"NAME",get:function(){return be}},{key:"DATA_KEY",get:function(){return Ie}},{key:"Event",get:function(){return Re}},{key:"EVENT_KEY",get:function(){return De}},{key:"DefaultType",get:function(){return ke}}]),i}();g.fn[be]=Be._jQueryInterface,g.fn[be].Constructor=Be,g.fn[be].noConflict=function(){return g.fn[be]=we,Be._jQueryInterface};var Ve="popover",Ye="bs.popover",ze="."+Ye,Xe=g.fn[Ve],$e="bs-popover",Ge=new RegExp("(^|\\s)"+$e+"\\S+","g"),Je=l({},Be.Default,{placement:"right",trigger:"click",content:"",template:''}),Ze=l({},Be.DefaultType,{content:"(string|element|function)"}),tn="fade",en="show",nn=".popover-header",on=".popover-body",rn={HIDE:"hide"+ze,HIDDEN:"hidden"+ze,SHOW:"show"+ze,SHOWN:"shown"+ze,INSERTED:"inserted"+ze,CLICK:"click"+ze,FOCUSIN:"focusin"+ze,FOCUSOUT:"focusout"+ze,MOUSEENTER:"mouseenter"+ze,MOUSELEAVE:"mouseleave"+ze},sn=function(t){var e,n;function i(){return t.apply(this,arguments)||this}n=t,(e=i).prototype=Object.create(n.prototype),(e.prototype.constructor=e).__proto__=n;var o=i.prototype;return o.isWithContent=function(){return this.getTitle()||this._getContent()},o.addAttachmentClass=function(t){g(this.getTipElement()).addClass($e+"-"+t)},o.getTipElement=function(){return this.tip=this.tip||g(this.config.template)[0],this.tip},o.setContent=function(){var t=g(this.getTipElement());this.setElementContent(t.find(nn),this.getTitle());var e=this._getContent();"function"==typeof e&&(e=e.call(this.element)),this.setElementContent(t.find(on),e),t.removeClass(tn+" "+en)},o._getContent=function(){return this.element.getAttribute("data-content")||this.config.content},o._cleanTipClass=function(){var t=g(this.getTipElement()),e=t.attr("class").match(Ge);null!==e&&0=this._offsets[o]&&("undefined"==typeof this._offsets[o+1]||tn?-1:n>t?1:n>=t?0:NaN}function r(n){return null===n?NaN:+n}function i(n){return!isNaN(n)}function u(n){return{left:function(t,e,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);i>r;){var u=r+i>>>1;n(t[u],e)<0?r=u+1:i=u}return r},right:function(t,e,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);i>r;){var u=r+i>>>1;n(t[u],e)>0?i=u:r=u+1}return r}}}function o(n){return n.length}function a(n){for(var t=1;n*t%1;)t*=10;return t}function l(n,t){for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}function c(){this._=Object.create(null)}function f(n){return(n+="")===bo||n[0]===_o?_o+n:n}function s(n){return(n+="")[0]===_o?n.slice(1):n}function h(n){return f(n)in this._}function p(n){return(n=f(n))in this._&&delete this._[n]}function g(){var n=[];for(var t in this._)n.push(s(t));return n}function v(){var n=0;for(var t in this._)++n;return n}function d(){for(var n in this._)return!1;return!0}function y(){this._=Object.create(null)}function m(n){return n}function M(n,t,e){return function(){var r=e.apply(t,arguments);return r===t?n:r}}function x(n,t){if(t in n)return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var e=0,r=wo.length;r>e;++e){var i=wo[e]+t;if(i in n)return i}}function b(){}function _(){}function w(n){function t(){for(var t,r=e,i=-1,u=r.length;++ie;e++)for(var i,u=n[e],o=0,a=u.length;a>o;o++)(i=u[o])&&t(i,o,e);return n}function Z(n){return ko(n,qo),n}function V(n){var t,e;return function(r,i,u){var o,a=n[u].update,l=a.length;for(u!=e&&(e=u,t=0),i>=t&&(t=i+1);!(o=a[t])&&++t0&&(n=n.slice(0,a));var c=To.get(n);return c&&(n=c,l=B),a?t?i:r:t?b:u}function $(n,t){return function(e){var r=ao.event;ao.event=e,t[0]=this.__data__;try{n.apply(this,t)}finally{ao.event=r}}}function B(n,t){var e=$(n,t);return function(n){var t=this,r=n.relatedTarget;r&&(r===t||8&r.compareDocumentPosition(t))||e.call(t,n)}}function W(e){var r=".dragsuppress-"+ ++Do,i="click"+r,u=ao.select(t(e)).on("touchmove"+r,S).on("dragstart"+r,S).on("selectstart"+r,S);if(null==Ro&&(Ro="onselectstart"in e?!1:x(e.style,"userSelect")),Ro){var o=n(e).style,a=o[Ro];o[Ro]="none"}return function(n){if(u.on(r,null),Ro&&(o[Ro]=a),n){var t=function(){u.on(i,null)};u.on(i,function(){S(),t()},!0),setTimeout(t,0)}}}function J(n,e){e.changedTouches&&(e=e.changedTouches[0]);var r=n.ownerSVGElement||n;if(r.createSVGPoint){var i=r.createSVGPoint();if(0>Po){var u=t(n);if(u.scrollX||u.scrollY){r=ao.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var o=r[0][0].getScreenCTM();Po=!(o.f||o.e),r.remove()}}return Po?(i.x=e.pageX,i.y=e.pageY):(i.x=e.clientX,i.y=e.clientY),i=i.matrixTransform(n.getScreenCTM().inverse()),[i.x,i.y]}var a=n.getBoundingClientRect();return[e.clientX-a.left-n.clientLeft,e.clientY-a.top-n.clientTop]}function G(){return ao.event.changedTouches[0].identifier}function K(n){return n>0?1:0>n?-1:0}function Q(n,t,e){return(t[0]-n[0])*(e[1]-n[1])-(t[1]-n[1])*(e[0]-n[0])}function nn(n){return n>1?0:-1>n?Fo:Math.acos(n)}function tn(n){return n>1?Io:-1>n?-Io:Math.asin(n)}function en(n){return((n=Math.exp(n))-1/n)/2}function rn(n){return((n=Math.exp(n))+1/n)/2}function un(n){return((n=Math.exp(2*n))-1)/(n+1)}function on(n){return(n=Math.sin(n/2))*n}function an(){}function ln(n,t,e){return this instanceof ln?(this.h=+n,this.s=+t,void(this.l=+e)):arguments.length<2?n instanceof ln?new ln(n.h,n.s,n.l):_n(""+n,wn,ln):new ln(n,t,e)}function cn(n,t,e){function r(n){return n>360?n-=360:0>n&&(n+=360),60>n?u+(o-u)*n/60:180>n?o:240>n?u+(o-u)*(240-n)/60:u}function i(n){return Math.round(255*r(n))}var u,o;return n=isNaN(n)?0:(n%=360)<0?n+360:n,t=isNaN(t)?0:0>t?0:t>1?1:t,e=0>e?0:e>1?1:e,o=.5>=e?e*(1+t):e+t-e*t,u=2*e-o,new mn(i(n+120),i(n),i(n-120))}function fn(n,t,e){return this instanceof fn?(this.h=+n,this.c=+t,void(this.l=+e)):arguments.length<2?n instanceof fn?new fn(n.h,n.c,n.l):n instanceof hn?gn(n.l,n.a,n.b):gn((n=Sn((n=ao.rgb(n)).r,n.g,n.b)).l,n.a,n.b):new fn(n,t,e)}function sn(n,t,e){return isNaN(n)&&(n=0),isNaN(t)&&(t=0),new hn(e,Math.cos(n*=Yo)*t,Math.sin(n)*t)}function hn(n,t,e){return this instanceof hn?(this.l=+n,this.a=+t,void(this.b=+e)):arguments.length<2?n instanceof hn?new hn(n.l,n.a,n.b):n instanceof fn?sn(n.h,n.c,n.l):Sn((n=mn(n)).r,n.g,n.b):new hn(n,t,e)}function pn(n,t,e){var r=(n+16)/116,i=r+t/500,u=r-e/200;return i=vn(i)*na,r=vn(r)*ta,u=vn(u)*ea,new mn(yn(3.2404542*i-1.5371385*r-.4985314*u),yn(-.969266*i+1.8760108*r+.041556*u),yn(.0556434*i-.2040259*r+1.0572252*u))}function gn(n,t,e){return n>0?new fn(Math.atan2(e,t)*Zo,Math.sqrt(t*t+e*e),n):new fn(NaN,NaN,n)}function vn(n){return n>.206893034?n*n*n:(n-4/29)/7.787037}function dn(n){return n>.008856?Math.pow(n,1/3):7.787037*n+4/29}function yn(n){return Math.round(255*(.00304>=n?12.92*n:1.055*Math.pow(n,1/2.4)-.055))}function mn(n,t,e){return this instanceof mn?(this.r=~~n,this.g=~~t,void(this.b=~~e)):arguments.length<2?n instanceof mn?new mn(n.r,n.g,n.b):_n(""+n,mn,cn):new mn(n,t,e)}function Mn(n){return new mn(n>>16,n>>8&255,255&n)}function xn(n){return Mn(n)+""}function bn(n){return 16>n?"0"+Math.max(0,n).toString(16):Math.min(255,n).toString(16)}function _n(n,t,e){var r,i,u,o=0,a=0,l=0;if(r=/([a-z]+)\((.*)\)/.exec(n=n.toLowerCase()))switch(i=r[2].split(","),r[1]){case"hsl":return e(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return t(Nn(i[0]),Nn(i[1]),Nn(i[2]))}return(u=ua.get(n))?t(u.r,u.g,u.b):(null==n||"#"!==n.charAt(0)||isNaN(u=parseInt(n.slice(1),16))||(4===n.length?(o=(3840&u)>>4,o=o>>4|o,a=240&u,a=a>>4|a,l=15&u,l=l<<4|l):7===n.length&&(o=(16711680&u)>>16,a=(65280&u)>>8,l=255&u)),t(o,a,l))}function wn(n,t,e){var r,i,u=Math.min(n/=255,t/=255,e/=255),o=Math.max(n,t,e),a=o-u,l=(o+u)/2;return a?(i=.5>l?a/(o+u):a/(2-o-u),r=n==o?(t-e)/a+(e>t?6:0):t==o?(e-n)/a+2:(n-t)/a+4,r*=60):(r=NaN,i=l>0&&1>l?0:r),new ln(r,i,l)}function Sn(n,t,e){n=kn(n),t=kn(t),e=kn(e);var r=dn((.4124564*n+.3575761*t+.1804375*e)/na),i=dn((.2126729*n+.7151522*t+.072175*e)/ta),u=dn((.0193339*n+.119192*t+.9503041*e)/ea);return hn(116*i-16,500*(r-i),200*(i-u))}function kn(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function Nn(n){var t=parseFloat(n);return"%"===n.charAt(n.length-1)?Math.round(2.55*t):t}function En(n){return"function"==typeof n?n:function(){return n}}function An(n){return function(t,e,r){return 2===arguments.length&&"function"==typeof e&&(r=e,e=null),Cn(t,e,n,r)}}function Cn(n,t,e,r){function i(){var n,t=l.status;if(!t&&Ln(l)||t>=200&&300>t||304===t){try{n=e.call(u,l)}catch(r){return void o.error.call(u,r)}o.load.call(u,n)}else o.error.call(u,l)}var u={},o=ao.dispatch("beforesend","progress","load","error"),a={},l=new XMLHttpRequest,c=null;return!this.XDomainRequest||"withCredentials"in l||!/^(http(s)?:)?\/\//.test(n)||(l=new XDomainRequest),"onload"in l?l.onload=l.onerror=i:l.onreadystatechange=function(){l.readyState>3&&i()},l.onprogress=function(n){var t=ao.event;ao.event=n;try{o.progress.call(u,l)}finally{ao.event=t}},u.header=function(n,t){return n=(n+"").toLowerCase(),arguments.length<2?a[n]:(null==t?delete a[n]:a[n]=t+"",u)},u.mimeType=function(n){return arguments.length?(t=null==n?null:n+"",u):t},u.responseType=function(n){return arguments.length?(c=n,u):c},u.response=function(n){return e=n,u},["get","post"].forEach(function(n){u[n]=function(){return u.send.apply(u,[n].concat(co(arguments)))}}),u.send=function(e,r,i){if(2===arguments.length&&"function"==typeof r&&(i=r,r=null),l.open(e,n,!0),null==t||"accept"in a||(a.accept=t+",*/*"),l.setRequestHeader)for(var f in a)l.setRequestHeader(f,a[f]);return null!=t&&l.overrideMimeType&&l.overrideMimeType(t),null!=c&&(l.responseType=c),null!=i&&u.on("error",i).on("load",function(n){i(null,n)}),o.beforesend.call(u,l),l.send(null==r?null:r),u},u.abort=function(){return l.abort(),u},ao.rebind(u,o,"on"),null==r?u:u.get(zn(r))}function zn(n){return 1===n.length?function(t,e){n(null==t?e:null)}:n}function Ln(n){var t=n.responseType;return t&&"text"!==t?n.response:n.responseText}function qn(n,t,e){var r=arguments.length;2>r&&(t=0),3>r&&(e=Date.now());var i=e+t,u={c:n,t:i,n:null};return aa?aa.n=u:oa=u,aa=u,la||(ca=clearTimeout(ca),la=1,fa(Tn)),u}function Tn(){var n=Rn(),t=Dn()-n;t>24?(isFinite(t)&&(clearTimeout(ca),ca=setTimeout(Tn,t)),la=0):(la=1,fa(Tn))}function Rn(){for(var n=Date.now(),t=oa;t;)n>=t.t&&t.c(n-t.t)&&(t.c=null),t=t.n;return n}function Dn(){for(var n,t=oa,e=1/0;t;)t.c?(t.t8?function(n){return n/e}:function(n){return n*e},symbol:n}}function jn(n){var t=n.decimal,e=n.thousands,r=n.grouping,i=n.currency,u=r&&e?function(n,t){for(var i=n.length,u=[],o=0,a=r[0],l=0;i>0&&a>0&&(l+a+1>t&&(a=Math.max(1,t-l)),u.push(n.substring(i-=a,i+a)),!((l+=a+1)>t));)a=r[o=(o+1)%r.length];return u.reverse().join(e)}:m;return function(n){var e=ha.exec(n),r=e[1]||" ",o=e[2]||">",a=e[3]||"-",l=e[4]||"",c=e[5],f=+e[6],s=e[7],h=e[8],p=e[9],g=1,v="",d="",y=!1,m=!0;switch(h&&(h=+h.substring(1)),(c||"0"===r&&"="===o)&&(c=r="0",o="="),p){case"n":s=!0,p="g";break;case"%":g=100,d="%",p="f";break;case"p":g=100,d="%",p="r";break;case"b":case"o":case"x":case"X":"#"===l&&(v="0"+p.toLowerCase());case"c":m=!1;case"d":y=!0,h=0;break;case"s":g=-1,p="r"}"$"===l&&(v=i[0],d=i[1]),"r"!=p||h||(p="g"),null!=h&&("g"==p?h=Math.max(1,Math.min(21,h)):"e"!=p&&"f"!=p||(h=Math.max(0,Math.min(20,h)))),p=pa.get(p)||Fn;var M=c&&s;return function(n){var e=d;if(y&&n%1)return"";var i=0>n||0===n&&0>1/n?(n=-n,"-"):"-"===a?"":a;if(0>g){var l=ao.formatPrefix(n,h);n=l.scale(n),e=l.symbol+d}else n*=g;n=p(n,h);var x,b,_=n.lastIndexOf(".");if(0>_){var w=m?n.lastIndexOf("e"):-1;0>w?(x=n,b=""):(x=n.substring(0,w),b=n.substring(w))}else x=n.substring(0,_),b=t+n.substring(_+1);!c&&s&&(x=u(x,1/0));var S=v.length+x.length+b.length+(M?0:i.length),k=f>S?new Array(S=f-S+1).join(r):"";return M&&(x=u(k+x,k.length?f-b.length:1/0)),i+=v,n=x+b,("<"===o?i+n+k:">"===o?k+i+n:"^"===o?k.substring(0,S>>=1)+i+n+k.substring(S):i+(M?n:k+n))+e}}}function Fn(n){return n+""}function Hn(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function On(n,t,e){function r(t){var e=n(t),r=u(e,1);return r-t>t-e?e:r}function i(e){return t(e=n(new va(e-1)),1),e}function u(n,e){return t(n=new va(+n),e),n}function o(n,r,u){var o=i(n),a=[];if(u>1)for(;r>o;)e(o)%u||a.push(new Date(+o)),t(o,1);else for(;r>o;)a.push(new Date(+o)),t(o,1);return a}function a(n,t,e){try{va=Hn;var r=new Hn;return r._=n,o(r,t,e)}finally{va=Date}}n.floor=n,n.round=r,n.ceil=i,n.offset=u,n.range=o;var l=n.utc=In(n);return l.floor=l,l.round=In(r),l.ceil=In(i),l.offset=In(u),l.range=a,n}function In(n){return function(t,e){try{va=Hn;var r=new Hn;return r._=t,n(r,e)._}finally{va=Date}}}function Yn(n){function t(n){function t(t){for(var e,i,u,o=[],a=-1,l=0;++aa;){if(r>=c)return-1;if(i=t.charCodeAt(a++),37===i){if(o=t.charAt(a++),u=C[o in ya?t.charAt(a++):o],!u||(r=u(n,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}function r(n,t,e){_.lastIndex=0;var r=_.exec(t.slice(e));return r?(n.w=w.get(r[0].toLowerCase()),e+r[0].length):-1}function i(n,t,e){x.lastIndex=0;var r=x.exec(t.slice(e));return r?(n.w=b.get(r[0].toLowerCase()),e+r[0].length):-1}function u(n,t,e){N.lastIndex=0;var r=N.exec(t.slice(e));return r?(n.m=E.get(r[0].toLowerCase()),e+r[0].length):-1}function o(n,t,e){S.lastIndex=0;var r=S.exec(t.slice(e));return r?(n.m=k.get(r[0].toLowerCase()),e+r[0].length):-1}function a(n,t,r){return e(n,A.c.toString(),t,r)}function l(n,t,r){return e(n,A.x.toString(),t,r)}function c(n,t,r){return e(n,A.X.toString(),t,r)}function f(n,t,e){var r=M.get(t.slice(e,e+=2).toLowerCase());return null==r?-1:(n.p=r,e)}var s=n.dateTime,h=n.date,p=n.time,g=n.periods,v=n.days,d=n.shortDays,y=n.months,m=n.shortMonths;t.utc=function(n){function e(n){try{va=Hn;var t=new va;return t._=n,r(t)}finally{va=Date}}var r=t(n);return e.parse=function(n){try{va=Hn;var t=r.parse(n);return t&&t._}finally{va=Date}},e.toString=r.toString,e},t.multi=t.utc.multi=ct;var M=ao.map(),x=Vn(v),b=Xn(v),_=Vn(d),w=Xn(d),S=Vn(y),k=Xn(y),N=Vn(m),E=Xn(m);g.forEach(function(n,t){M.set(n.toLowerCase(),t)});var A={a:function(n){return d[n.getDay()]},A:function(n){return v[n.getDay()]},b:function(n){return m[n.getMonth()]},B:function(n){return y[n.getMonth()]},c:t(s),d:function(n,t){return Zn(n.getDate(),t,2)},e:function(n,t){return Zn(n.getDate(),t,2)},H:function(n,t){return Zn(n.getHours(),t,2)},I:function(n,t){return Zn(n.getHours()%12||12,t,2)},j:function(n,t){return Zn(1+ga.dayOfYear(n),t,3)},L:function(n,t){return Zn(n.getMilliseconds(),t,3)},m:function(n,t){return Zn(n.getMonth()+1,t,2)},M:function(n,t){return Zn(n.getMinutes(),t,2)},p:function(n){return g[+(n.getHours()>=12)]},S:function(n,t){return Zn(n.getSeconds(),t,2)},U:function(n,t){return Zn(ga.sundayOfYear(n),t,2)},w:function(n){return n.getDay()},W:function(n,t){return Zn(ga.mondayOfYear(n),t,2)},x:t(h),X:t(p),y:function(n,t){return Zn(n.getFullYear()%100,t,2)},Y:function(n,t){return Zn(n.getFullYear()%1e4,t,4)},Z:at,"%":function(){return"%"}},C={a:r,A:i,b:u,B:o,c:a,d:tt,e:tt,H:rt,I:rt,j:et,L:ot,m:nt,M:it,p:f,S:ut,U:Bn,w:$n,W:Wn,x:l,X:c,y:Gn,Y:Jn,Z:Kn,"%":lt};return t}function Zn(n,t,e){var r=0>n?"-":"",i=(r?-n:n)+"",u=i.length;return r+(e>u?new Array(e-u+1).join(t)+i:i)}function Vn(n){return new RegExp("^(?:"+n.map(ao.requote).join("|")+")","i")}function Xn(n){for(var t=new c,e=-1,r=n.length;++e68?1900:2e3)}function nt(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+2));return r?(n.m=r[0]-1,e+r[0].length):-1}function tt(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+2));return r?(n.d=+r[0],e+r[0].length):-1}function et(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+3));return r?(n.j=+r[0],e+r[0].length):-1}function rt(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+2));return r?(n.H=+r[0],e+r[0].length):-1}function it(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+2));return r?(n.M=+r[0],e+r[0].length):-1}function ut(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+2));return r?(n.S=+r[0],e+r[0].length):-1}function ot(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+3));return r?(n.L=+r[0],e+r[0].length):-1}function at(n){var t=n.getTimezoneOffset(),e=t>0?"-":"+",r=xo(t)/60|0,i=xo(t)%60;return e+Zn(r,"0",2)+Zn(i,"0",2)}function lt(n,t,e){Ma.lastIndex=0;var r=Ma.exec(t.slice(e,e+1));return r?e+r[0].length:-1}function ct(n){for(var t=n.length,e=-1;++e=0?1:-1,a=o*e,l=Math.cos(t),c=Math.sin(t),f=u*c,s=i*l+f*Math.cos(a),h=f*o*Math.sin(a);ka.add(Math.atan2(h,s)),r=n,i=l,u=c}var t,e,r,i,u;Na.point=function(o,a){Na.point=n,r=(t=o)*Yo,i=Math.cos(a=(e=a)*Yo/2+Fo/4),u=Math.sin(a)},Na.lineEnd=function(){n(t,e)}}function dt(n){var t=n[0],e=n[1],r=Math.cos(e);return[r*Math.cos(t),r*Math.sin(t),Math.sin(e)]}function yt(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function mt(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function Mt(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function xt(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function bt(n){var t=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}function _t(n){return[Math.atan2(n[1],n[0]),tn(n[2])]}function wt(n,t){return xo(n[0]-t[0])a;++a)i.point((e=n[a])[0],e[1]);return void i.lineEnd()}var l=new Tt(e,n,null,!0),c=new Tt(e,null,l,!1);l.o=c,u.push(l),o.push(c),l=new Tt(r,n,null,!1),c=new Tt(r,null,l,!0),l.o=c,u.push(l),o.push(c)}}),o.sort(t),qt(u),qt(o),u.length){for(var a=0,l=e,c=o.length;c>a;++a)o[a].e=l=!l;for(var f,s,h=u[0];;){for(var p=h,g=!0;p.v;)if((p=p.n)===h)return;f=p.z,i.lineStart();do{if(p.v=p.o.v=!0,p.e){if(g)for(var a=0,c=f.length;c>a;++a)i.point((s=f[a])[0],s[1]);else r(p.x,p.n.x,1,i);p=p.n}else{if(g){f=p.p.z;for(var a=f.length-1;a>=0;--a)i.point((s=f[a])[0],s[1])}else r(p.x,p.p.x,-1,i);p=p.p}p=p.o,f=p.z,g=!g}while(!p.v);i.lineEnd()}}}function qt(n){if(t=n.length){for(var t,e,r=0,i=n[0];++r0){for(b||(u.polygonStart(),b=!0),u.lineStart();++o1&&2&t&&e.push(e.pop().concat(e.shift())),p.push(e.filter(Dt))}var p,g,v,d=t(u),y=i.invert(r[0],r[1]),m={point:o,lineStart:l,lineEnd:c,polygonStart:function(){m.point=f,m.lineStart=s,m.lineEnd=h,p=[],g=[]},polygonEnd:function(){m.point=o,m.lineStart=l,m.lineEnd=c,p=ao.merge(p);var n=Ot(y,g);p.length?(b||(u.polygonStart(),b=!0),Lt(p,Ut,n,e,u)):n&&(b||(u.polygonStart(),b=!0),u.lineStart(),e(null,null,1,u),u.lineEnd()),b&&(u.polygonEnd(),b=!1),p=g=null},sphere:function(){u.polygonStart(),u.lineStart(),e(null,null,1,u),u.lineEnd(),u.polygonEnd()}},M=Pt(),x=t(M),b=!1;return m}}function Dt(n){return n.length>1}function Pt(){var n,t=[];return{lineStart:function(){t.push(n=[])},point:function(t,e){n.push([t,e])},lineEnd:b,buffer:function(){var e=t;return t=[],n=null,e},rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))}}}function Ut(n,t){return((n=n.x)[0]<0?n[1]-Io-Uo:Io-n[1])-((t=t.x)[0]<0?t[1]-Io-Uo:Io-t[1])}function jt(n){var t,e=NaN,r=NaN,i=NaN;return{lineStart:function(){n.lineStart(),t=1},point:function(u,o){var a=u>0?Fo:-Fo,l=xo(u-e);xo(l-Fo)0?Io:-Io),n.point(i,r),n.lineEnd(),n.lineStart(),n.point(a,r),n.point(u,r),t=0):i!==a&&l>=Fo&&(xo(e-i)Uo?Math.atan((Math.sin(t)*(u=Math.cos(r))*Math.sin(e)-Math.sin(r)*(i=Math.cos(t))*Math.sin(n))/(i*u*o)):(t+r)/2}function Ht(n,t,e,r){var i;if(null==n)i=e*Io,r.point(-Fo,i),r.point(0,i),r.point(Fo,i),r.point(Fo,0),r.point(Fo,-i),r.point(0,-i),r.point(-Fo,-i),r.point(-Fo,0),r.point(-Fo,i);else if(xo(n[0]-t[0])>Uo){var u=n[0]a;++a){var c=t[a],f=c.length;if(f)for(var s=c[0],h=s[0],p=s[1]/2+Fo/4,g=Math.sin(p),v=Math.cos(p),d=1;;){d===f&&(d=0),n=c[d];var y=n[0],m=n[1]/2+Fo/4,M=Math.sin(m),x=Math.cos(m),b=y-h,_=b>=0?1:-1,w=_*b,S=w>Fo,k=g*M;if(ka.add(Math.atan2(k*_*Math.sin(w),v*x+k*Math.cos(w))),u+=S?b+_*Ho:b,S^h>=e^y>=e){var N=mt(dt(s),dt(n));bt(N);var E=mt(i,N);bt(E);var A=(S^b>=0?-1:1)*tn(E[2]);(r>A||r===A&&(N[0]||N[1]))&&(o+=S^b>=0?1:-1)}if(!d++)break;h=y,g=M,v=x,s=n}}return(-Uo>u||Uo>u&&-Uo>ka)^1&o}function It(n){function t(n,t){return Math.cos(n)*Math.cos(t)>u}function e(n){var e,u,l,c,f;return{lineStart:function(){c=l=!1,f=1},point:function(s,h){var p,g=[s,h],v=t(s,h),d=o?v?0:i(s,h):v?i(s+(0>s?Fo:-Fo),h):0;if(!e&&(c=l=v)&&n.lineStart(),v!==l&&(p=r(e,g),(wt(e,p)||wt(g,p))&&(g[0]+=Uo,g[1]+=Uo,v=t(g[0],g[1]))),v!==l)f=0,v?(n.lineStart(),p=r(g,e),n.point(p[0],p[1])):(p=r(e,g),n.point(p[0],p[1]),n.lineEnd()),e=p;else if(a&&e&&o^v){var y;d&u||!(y=r(g,e,!0))||(f=0,o?(n.lineStart(),n.point(y[0][0],y[0][1]),n.point(y[1][0],y[1][1]),n.lineEnd()):(n.point(y[1][0],y[1][1]),n.lineEnd(),n.lineStart(),n.point(y[0][0],y[0][1])))}!v||e&&wt(e,g)||n.point(g[0],g[1]),e=g,l=v,u=d},lineEnd:function(){l&&n.lineEnd(),e=null},clean:function(){return f|(c&&l)<<1}}}function r(n,t,e){var r=dt(n),i=dt(t),o=[1,0,0],a=mt(r,i),l=yt(a,a),c=a[0],f=l-c*c;if(!f)return!e&&n;var s=u*l/f,h=-u*c/f,p=mt(o,a),g=xt(o,s),v=xt(a,h);Mt(g,v);var d=p,y=yt(g,d),m=yt(d,d),M=y*y-m*(yt(g,g)-1);if(!(0>M)){var x=Math.sqrt(M),b=xt(d,(-y-x)/m);if(Mt(b,g),b=_t(b),!e)return b;var _,w=n[0],S=t[0],k=n[1],N=t[1];w>S&&(_=w,w=S,S=_);var E=S-w,A=xo(E-Fo)E;if(!A&&k>N&&(_=k,k=N,N=_),C?A?k+N>0^b[1]<(xo(b[0]-w)Fo^(w<=b[0]&&b[0]<=S)){var z=xt(d,(-y+x)/m);return Mt(z,g),[b,_t(z)]}}}function i(t,e){var r=o?n:Fo-n,i=0;return-r>t?i|=1:t>r&&(i|=2),-r>e?i|=4:e>r&&(i|=8),i}var u=Math.cos(n),o=u>0,a=xo(u)>Uo,l=ve(n,6*Yo);return Rt(t,e,l,o?[0,-n]:[-Fo,n-Fo])}function Yt(n,t,e,r){return function(i){var u,o=i.a,a=i.b,l=o.x,c=o.y,f=a.x,s=a.y,h=0,p=1,g=f-l,v=s-c;if(u=n-l,g||!(u>0)){if(u/=g,0>g){if(h>u)return;p>u&&(p=u)}else if(g>0){if(u>p)return;u>h&&(h=u)}if(u=e-l,g||!(0>u)){if(u/=g,0>g){if(u>p)return;u>h&&(h=u)}else if(g>0){if(h>u)return;p>u&&(p=u)}if(u=t-c,v||!(u>0)){if(u/=v,0>v){if(h>u)return;p>u&&(p=u)}else if(v>0){if(u>p)return;u>h&&(h=u)}if(u=r-c,v||!(0>u)){if(u/=v,0>v){if(u>p)return;u>h&&(h=u)}else if(v>0){if(h>u)return;p>u&&(p=u)}return h>0&&(i.a={x:l+h*g,y:c+h*v}),1>p&&(i.b={x:l+p*g,y:c+p*v}),i}}}}}}function Zt(n,t,e,r){function i(r,i){return xo(r[0]-n)0?0:3:xo(r[0]-e)0?2:1:xo(r[1]-t)0?1:0:i>0?3:2}function u(n,t){return o(n.x,t.x)}function o(n,t){var e=i(n,1),r=i(t,1);return e!==r?e-r:0===e?t[1]-n[1]:1===e?n[0]-t[0]:2===e?n[1]-t[1]:t[0]-n[0]}return function(a){function l(n){for(var t=0,e=d.length,r=n[1],i=0;e>i;++i)for(var u,o=1,a=d[i],l=a.length,c=a[0];l>o;++o)u=a[o],c[1]<=r?u[1]>r&&Q(c,u,n)>0&&++t:u[1]<=r&&Q(c,u,n)<0&&--t,c=u;return 0!==t}function c(u,a,l,c){var f=0,s=0;if(null==u||(f=i(u,l))!==(s=i(a,l))||o(u,a)<0^l>0){do c.point(0===f||3===f?n:e,f>1?r:t);while((f=(f+l+4)%4)!==s)}else c.point(a[0],a[1])}function f(i,u){return i>=n&&e>=i&&u>=t&&r>=u}function s(n,t){f(n,t)&&a.point(n,t)}function h(){C.point=g,d&&d.push(y=[]),S=!0,w=!1,b=_=NaN}function p(){v&&(g(m,M),x&&w&&E.rejoin(),v.push(E.buffer())),C.point=s,w&&a.lineEnd()}function g(n,t){n=Math.max(-Ha,Math.min(Ha,n)),t=Math.max(-Ha,Math.min(Ha,t));var e=f(n,t);if(d&&y.push([n,t]),S)m=n,M=t,x=e,S=!1,e&&(a.lineStart(),a.point(n,t));else if(e&&w)a.point(n,t);else{var r={a:{x:b,y:_},b:{x:n,y:t}};A(r)?(w||(a.lineStart(),a.point(r.a.x,r.a.y)),a.point(r.b.x,r.b.y),e||a.lineEnd(),k=!1):e&&(a.lineStart(),a.point(n,t),k=!1)}b=n,_=t,w=e}var v,d,y,m,M,x,b,_,w,S,k,N=a,E=Pt(),A=Yt(n,t,e,r),C={point:s,lineStart:h,lineEnd:p,polygonStart:function(){a=E,v=[],d=[],k=!0},polygonEnd:function(){a=N,v=ao.merge(v);var t=l([n,r]),e=k&&t,i=v.length;(e||i)&&(a.polygonStart(),e&&(a.lineStart(),c(null,null,1,a),a.lineEnd()),i&&Lt(v,u,t,c,a),a.polygonEnd()),v=d=y=null}};return C}}function Vt(n){var t=0,e=Fo/3,r=ae(n),i=r(t,e);return i.parallels=function(n){return arguments.length?r(t=n[0]*Fo/180,e=n[1]*Fo/180):[t/Fo*180,e/Fo*180]},i}function Xt(n,t){function e(n,t){var e=Math.sqrt(u-2*i*Math.sin(t))/i;return[e*Math.sin(n*=i),o-e*Math.cos(n)]}var r=Math.sin(n),i=(r+Math.sin(t))/2,u=1+r*(2*i-r),o=Math.sqrt(u)/i;return e.invert=function(n,t){var e=o-t;return[Math.atan2(n,e)/i,tn((u-(n*n+e*e)*i*i)/(2*i))]},e}function $t(){function n(n,t){Ia+=i*n-r*t,r=n,i=t}var t,e,r,i;$a.point=function(u,o){$a.point=n,t=r=u,e=i=o},$a.lineEnd=function(){n(t,e)}}function Bt(n,t){Ya>n&&(Ya=n),n>Va&&(Va=n),Za>t&&(Za=t),t>Xa&&(Xa=t)}function Wt(){function n(n,t){o.push("M",n,",",t,u)}function t(n,t){o.push("M",n,",",t),a.point=e}function e(n,t){o.push("L",n,",",t)}function r(){a.point=n}function i(){o.push("Z")}var u=Jt(4.5),o=[],a={point:n,lineStart:function(){a.point=t},lineEnd:r,polygonStart:function(){a.lineEnd=i},polygonEnd:function(){a.lineEnd=r,a.point=n},pointRadius:function(n){return u=Jt(n),a},result:function(){if(o.length){var n=o.join("");return o=[],n}}};return a}function Jt(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function Gt(n,t){Ca+=n,za+=t,++La}function Kt(){function n(n,r){var i=n-t,u=r-e,o=Math.sqrt(i*i+u*u);qa+=o*(t+n)/2,Ta+=o*(e+r)/2,Ra+=o,Gt(t=n,e=r)}var t,e;Wa.point=function(r,i){Wa.point=n,Gt(t=r,e=i)}}function Qt(){Wa.point=Gt}function ne(){function n(n,t){var e=n-r,u=t-i,o=Math.sqrt(e*e+u*u);qa+=o*(r+n)/2,Ta+=o*(i+t)/2,Ra+=o,o=i*n-r*t,Da+=o*(r+n),Pa+=o*(i+t),Ua+=3*o,Gt(r=n,i=t)}var t,e,r,i;Wa.point=function(u,o){Wa.point=n,Gt(t=r=u,e=i=o)},Wa.lineEnd=function(){n(t,e)}}function te(n){function t(t,e){n.moveTo(t+o,e),n.arc(t,e,o,0,Ho)}function e(t,e){n.moveTo(t,e),a.point=r}function r(t,e){n.lineTo(t,e)}function i(){a.point=t}function u(){n.closePath()}var o=4.5,a={point:t,lineStart:function(){a.point=e},lineEnd:i,polygonStart:function(){a.lineEnd=u},polygonEnd:function(){a.lineEnd=i,a.point=t},pointRadius:function(n){return o=n,a},result:b};return a}function ee(n){function t(n){return(a?r:e)(n)}function e(t){return ue(t,function(e,r){e=n(e,r),t.point(e[0],e[1])})}function r(t){function e(e,r){e=n(e,r),t.point(e[0],e[1])}function r(){M=NaN,S.point=u,t.lineStart()}function u(e,r){var u=dt([e,r]),o=n(e,r);i(M,x,m,b,_,w,M=o[0],x=o[1],m=e,b=u[0],_=u[1],w=u[2],a,t),t.point(M,x)}function o(){S.point=e,t.lineEnd()}function l(){ -r(),S.point=c,S.lineEnd=f}function c(n,t){u(s=n,h=t),p=M,g=x,v=b,d=_,y=w,S.point=u}function f(){i(M,x,m,b,_,w,p,g,s,v,d,y,a,t),S.lineEnd=o,o()}var s,h,p,g,v,d,y,m,M,x,b,_,w,S={point:e,lineStart:r,lineEnd:o,polygonStart:function(){t.polygonStart(),S.lineStart=l},polygonEnd:function(){t.polygonEnd(),S.lineStart=r}};return S}function i(t,e,r,a,l,c,f,s,h,p,g,v,d,y){var m=f-t,M=s-e,x=m*m+M*M;if(x>4*u&&d--){var b=a+p,_=l+g,w=c+v,S=Math.sqrt(b*b+_*_+w*w),k=Math.asin(w/=S),N=xo(xo(w)-1)u||xo((m*z+M*L)/x-.5)>.3||o>a*p+l*g+c*v)&&(i(t,e,r,a,l,c,A,C,N,b/=S,_/=S,w,d,y),y.point(A,C),i(A,C,N,b,_,w,f,s,h,p,g,v,d,y))}}var u=.5,o=Math.cos(30*Yo),a=16;return t.precision=function(n){return arguments.length?(a=(u=n*n)>0&&16,t):Math.sqrt(u)},t}function re(n){var t=ee(function(t,e){return n([t*Zo,e*Zo])});return function(n){return le(t(n))}}function ie(n){this.stream=n}function ue(n,t){return{point:t,sphere:function(){n.sphere()},lineStart:function(){n.lineStart()},lineEnd:function(){n.lineEnd()},polygonStart:function(){n.polygonStart()},polygonEnd:function(){n.polygonEnd()}}}function oe(n){return ae(function(){return n})()}function ae(n){function t(n){return n=a(n[0]*Yo,n[1]*Yo),[n[0]*h+l,c-n[1]*h]}function e(n){return n=a.invert((n[0]-l)/h,(c-n[1])/h),n&&[n[0]*Zo,n[1]*Zo]}function r(){a=Ct(o=se(y,M,x),u);var n=u(v,d);return l=p-n[0]*h,c=g+n[1]*h,i()}function i(){return f&&(f.valid=!1,f=null),t}var u,o,a,l,c,f,s=ee(function(n,t){return n=u(n,t),[n[0]*h+l,c-n[1]*h]}),h=150,p=480,g=250,v=0,d=0,y=0,M=0,x=0,b=Fa,_=m,w=null,S=null;return t.stream=function(n){return f&&(f.valid=!1),f=le(b(o,s(_(n)))),f.valid=!0,f},t.clipAngle=function(n){return arguments.length?(b=null==n?(w=n,Fa):It((w=+n)*Yo),i()):w},t.clipExtent=function(n){return arguments.length?(S=n,_=n?Zt(n[0][0],n[0][1],n[1][0],n[1][1]):m,i()):S},t.scale=function(n){return arguments.length?(h=+n,r()):h},t.translate=function(n){return arguments.length?(p=+n[0],g=+n[1],r()):[p,g]},t.center=function(n){return arguments.length?(v=n[0]%360*Yo,d=n[1]%360*Yo,r()):[v*Zo,d*Zo]},t.rotate=function(n){return arguments.length?(y=n[0]%360*Yo,M=n[1]%360*Yo,x=n.length>2?n[2]%360*Yo:0,r()):[y*Zo,M*Zo,x*Zo]},ao.rebind(t,s,"precision"),function(){return u=n.apply(this,arguments),t.invert=u.invert&&e,r()}}function le(n){return ue(n,function(t,e){n.point(t*Yo,e*Yo)})}function ce(n,t){return[n,t]}function fe(n,t){return[n>Fo?n-Ho:-Fo>n?n+Ho:n,t]}function se(n,t,e){return n?t||e?Ct(pe(n),ge(t,e)):pe(n):t||e?ge(t,e):fe}function he(n){return function(t,e){return t+=n,[t>Fo?t-Ho:-Fo>t?t+Ho:t,e]}}function pe(n){var t=he(n);return t.invert=he(-n),t}function ge(n,t){function e(n,t){var e=Math.cos(t),a=Math.cos(n)*e,l=Math.sin(n)*e,c=Math.sin(t),f=c*r+a*i;return[Math.atan2(l*u-f*o,a*r-c*i),tn(f*u+l*o)]}var r=Math.cos(n),i=Math.sin(n),u=Math.cos(t),o=Math.sin(t);return e.invert=function(n,t){var e=Math.cos(t),a=Math.cos(n)*e,l=Math.sin(n)*e,c=Math.sin(t),f=c*u-l*o;return[Math.atan2(l*u+c*o,a*r+f*i),tn(f*r-a*i)]},e}function ve(n,t){var e=Math.cos(n),r=Math.sin(n);return function(i,u,o,a){var l=o*t;null!=i?(i=de(e,i),u=de(e,u),(o>0?u>i:i>u)&&(i+=o*Ho)):(i=n+o*Ho,u=n-.5*l);for(var c,f=i;o>0?f>u:u>f;f-=l)a.point((c=_t([e,-r*Math.cos(f),-r*Math.sin(f)]))[0],c[1])}}function de(n,t){var e=dt(t);e[0]-=n,bt(e);var r=nn(-e[1]);return((-e[2]<0?-r:r)+2*Math.PI-Uo)%(2*Math.PI)}function ye(n,t,e){var r=ao.range(n,t-Uo,e).concat(t);return function(n){return r.map(function(t){return[n,t]})}}function me(n,t,e){var r=ao.range(n,t-Uo,e).concat(t);return function(n){return r.map(function(t){return[t,n]})}}function Me(n){return n.source}function xe(n){return n.target}function be(n,t,e,r){var i=Math.cos(t),u=Math.sin(t),o=Math.cos(r),a=Math.sin(r),l=i*Math.cos(n),c=i*Math.sin(n),f=o*Math.cos(e),s=o*Math.sin(e),h=2*Math.asin(Math.sqrt(on(r-t)+i*o*on(e-n))),p=1/Math.sin(h),g=h?function(n){var t=Math.sin(n*=h)*p,e=Math.sin(h-n)*p,r=e*l+t*f,i=e*c+t*s,o=e*u+t*a;return[Math.atan2(i,r)*Zo,Math.atan2(o,Math.sqrt(r*r+i*i))*Zo]}:function(){return[n*Zo,t*Zo]};return g.distance=h,g}function _e(){function n(n,i){var u=Math.sin(i*=Yo),o=Math.cos(i),a=xo((n*=Yo)-t),l=Math.cos(a);Ja+=Math.atan2(Math.sqrt((a=o*Math.sin(a))*a+(a=r*u-e*o*l)*a),e*u+r*o*l),t=n,e=u,r=o}var t,e,r;Ga.point=function(i,u){t=i*Yo,e=Math.sin(u*=Yo),r=Math.cos(u),Ga.point=n},Ga.lineEnd=function(){Ga.point=Ga.lineEnd=b}}function we(n,t){function e(t,e){var r=Math.cos(t),i=Math.cos(e),u=n(r*i);return[u*i*Math.sin(t),u*Math.sin(e)]}return e.invert=function(n,e){var r=Math.sqrt(n*n+e*e),i=t(r),u=Math.sin(i),o=Math.cos(i);return[Math.atan2(n*u,r*o),Math.asin(r&&e*u/r)]},e}function Se(n,t){function e(n,t){o>0?-Io+Uo>t&&(t=-Io+Uo):t>Io-Uo&&(t=Io-Uo);var e=o/Math.pow(i(t),u);return[e*Math.sin(u*n),o-e*Math.cos(u*n)]}var r=Math.cos(n),i=function(n){return Math.tan(Fo/4+n/2)},u=n===t?Math.sin(n):Math.log(r/Math.cos(t))/Math.log(i(t)/i(n)),o=r*Math.pow(i(n),u)/u;return u?(e.invert=function(n,t){var e=o-t,r=K(u)*Math.sqrt(n*n+e*e);return[Math.atan2(n,e)/u,2*Math.atan(Math.pow(o/r,1/u))-Io]},e):Ne}function ke(n,t){function e(n,t){var e=u-t;return[e*Math.sin(i*n),u-e*Math.cos(i*n)]}var r=Math.cos(n),i=n===t?Math.sin(n):(r-Math.cos(t))/(t-n),u=r/i+n;return xo(i)i;i++){for(;r>1&&Q(n[e[r-2]],n[e[r-1]],n[i])<=0;)--r;e[r++]=i}return e.slice(0,r)}function qe(n,t){return n[0]-t[0]||n[1]-t[1]}function Te(n,t,e){return(e[0]-t[0])*(n[1]-t[1])<(e[1]-t[1])*(n[0]-t[0])}function Re(n,t,e,r){var i=n[0],u=e[0],o=t[0]-i,a=r[0]-u,l=n[1],c=e[1],f=t[1]-l,s=r[1]-c,h=(a*(l-c)-s*(i-u))/(s*o-a*f);return[i+h*o,l+h*f]}function De(n){var t=n[0],e=n[n.length-1];return!(t[0]-e[0]||t[1]-e[1])}function Pe(){rr(this),this.edge=this.site=this.circle=null}function Ue(n){var t=cl.pop()||new Pe;return t.site=n,t}function je(n){Be(n),ol.remove(n),cl.push(n),rr(n)}function Fe(n){var t=n.circle,e=t.x,r=t.cy,i={x:e,y:r},u=n.P,o=n.N,a=[n];je(n);for(var l=u;l.circle&&xo(e-l.circle.x)f;++f)c=a[f],l=a[f-1],nr(c.edge,l.site,c.site,i);l=a[0],c=a[s-1],c.edge=Ke(l.site,c.site,null,i),$e(l),$e(c)}function He(n){for(var t,e,r,i,u=n.x,o=n.y,a=ol._;a;)if(r=Oe(a,o)-u,r>Uo)a=a.L;else{if(i=u-Ie(a,o),!(i>Uo)){r>-Uo?(t=a.P,e=a):i>-Uo?(t=a,e=a.N):t=e=a;break}if(!a.R){t=a;break}a=a.R}var l=Ue(n);if(ol.insert(t,l),t||e){if(t===e)return Be(t),e=Ue(t.site),ol.insert(l,e),l.edge=e.edge=Ke(t.site,l.site),$e(t),void $e(e);if(!e)return void(l.edge=Ke(t.site,l.site));Be(t),Be(e);var c=t.site,f=c.x,s=c.y,h=n.x-f,p=n.y-s,g=e.site,v=g.x-f,d=g.y-s,y=2*(h*d-p*v),m=h*h+p*p,M=v*v+d*d,x={x:(d*m-p*M)/y+f,y:(h*M-v*m)/y+s};nr(e.edge,c,g,x),l.edge=Ke(c,n,null,x),e.edge=Ke(n,g,null,x),$e(t),$e(e)}}function Oe(n,t){var e=n.site,r=e.x,i=e.y,u=i-t;if(!u)return r;var o=n.P;if(!o)return-(1/0);e=o.site;var a=e.x,l=e.y,c=l-t;if(!c)return a;var f=a-r,s=1/u-1/c,h=f/c;return s?(-h+Math.sqrt(h*h-2*s*(f*f/(-2*c)-l+c/2+i-u/2)))/s+r:(r+a)/2}function Ie(n,t){var e=n.N;if(e)return Oe(e,t);var r=n.site;return r.y===t?r.x:1/0}function Ye(n){this.site=n,this.edges=[]}function Ze(n){for(var t,e,r,i,u,o,a,l,c,f,s=n[0][0],h=n[1][0],p=n[0][1],g=n[1][1],v=ul,d=v.length;d--;)if(u=v[d],u&&u.prepare())for(a=u.edges,l=a.length,o=0;l>o;)f=a[o].end(),r=f.x,i=f.y,c=a[++o%l].start(),t=c.x,e=c.y,(xo(r-t)>Uo||xo(i-e)>Uo)&&(a.splice(o,0,new tr(Qe(u.site,f,xo(r-s)Uo?{x:s,y:xo(t-s)Uo?{x:xo(e-g)Uo?{x:h,y:xo(t-h)Uo?{x:xo(e-p)=-jo)){var p=l*l+c*c,g=f*f+s*s,v=(s*p-c*g)/h,d=(l*g-f*p)/h,s=d+a,y=fl.pop()||new Xe;y.arc=n,y.site=i,y.x=v+o,y.y=s+Math.sqrt(v*v+d*d),y.cy=s,n.circle=y;for(var m=null,M=ll._;M;)if(y.yd||d>=a)return;if(h>g){if(u){if(u.y>=c)return}else u={x:d,y:l};e={x:d,y:c}}else{if(u){if(u.yr||r>1)if(h>g){if(u){if(u.y>=c)return}else u={x:(l-i)/r,y:l};e={x:(c-i)/r,y:c}}else{if(u){if(u.yp){if(u){if(u.x>=a)return}else u={x:o,y:r*o+i};e={x:a,y:r*a+i}}else{if(u){if(u.xu||s>o||r>h||i>p)){if(g=n.point){var g,v=t-n.x,d=e-n.y,y=v*v+d*d;if(l>y){var m=Math.sqrt(l=y);r=t-m,i=e-m,u=t+m,o=e+m,a=g}}for(var M=n.nodes,x=.5*(f+h),b=.5*(s+p),_=t>=x,w=e>=b,S=w<<1|_,k=S+4;k>S;++S)if(n=M[3&S])switch(3&S){case 0:c(n,f,s,x,b);break;case 1:c(n,x,s,h,b);break;case 2:c(n,f,b,x,p);break;case 3:c(n,x,b,h,p)}}}(n,r,i,u,o),a}function vr(n,t){n=ao.rgb(n),t=ao.rgb(t);var e=n.r,r=n.g,i=n.b,u=t.r-e,o=t.g-r,a=t.b-i;return function(n){return"#"+bn(Math.round(e+u*n))+bn(Math.round(r+o*n))+bn(Math.round(i+a*n))}}function dr(n,t){var e,r={},i={};for(e in n)e in t?r[e]=Mr(n[e],t[e]):i[e]=n[e];for(e in t)e in n||(i[e]=t[e]);return function(n){for(e in r)i[e]=r[e](n);return i}}function yr(n,t){return n=+n,t=+t,function(e){return n*(1-e)+t*e}}function mr(n,t){var e,r,i,u=hl.lastIndex=pl.lastIndex=0,o=-1,a=[],l=[];for(n+="",t+="";(e=hl.exec(n))&&(r=pl.exec(t));)(i=r.index)>u&&(i=t.slice(u,i),a[o]?a[o]+=i:a[++o]=i),(e=e[0])===(r=r[0])?a[o]?a[o]+=r:a[++o]=r:(a[++o]=null,l.push({i:o,x:yr(e,r)})),u=pl.lastIndex;return ur;++r)a[(e=l[r]).i]=e.x(n);return a.join("")})}function Mr(n,t){for(var e,r=ao.interpolators.length;--r>=0&&!(e=ao.interpolators[r](n,t)););return e}function xr(n,t){var e,r=[],i=[],u=n.length,o=t.length,a=Math.min(n.length,t.length);for(e=0;a>e;++e)r.push(Mr(n[e],t[e]));for(;u>e;++e)i[e]=n[e];for(;o>e;++e)i[e]=t[e];return function(n){for(e=0;a>e;++e)i[e]=r[e](n);return i}}function br(n){return function(t){return 0>=t?0:t>=1?1:n(t)}}function _r(n){return function(t){return 1-n(1-t)}}function wr(n){return function(t){return.5*(.5>t?n(2*t):2-n(2-2*t))}}function Sr(n){return n*n}function kr(n){return n*n*n}function Nr(n){if(0>=n)return 0;if(n>=1)return 1;var t=n*n,e=t*n;return 4*(.5>n?e:3*(n-t)+e-.75)}function Er(n){return function(t){return Math.pow(t,n)}}function Ar(n){return 1-Math.cos(n*Io)}function Cr(n){return Math.pow(2,10*(n-1))}function zr(n){return 1-Math.sqrt(1-n*n)}function Lr(n,t){var e;return arguments.length<2&&(t=.45),arguments.length?e=t/Ho*Math.asin(1/n):(n=1,e=t/4),function(r){return 1+n*Math.pow(2,-10*r)*Math.sin((r-e)*Ho/t)}}function qr(n){return n||(n=1.70158),function(t){return t*t*((n+1)*t-n)}}function Tr(n){return 1/2.75>n?7.5625*n*n:2/2.75>n?7.5625*(n-=1.5/2.75)*n+.75:2.5/2.75>n?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375}function Rr(n,t){n=ao.hcl(n),t=ao.hcl(t);var e=n.h,r=n.c,i=n.l,u=t.h-e,o=t.c-r,a=t.l-i;return isNaN(o)&&(o=0,r=isNaN(r)?t.c:r),isNaN(u)?(u=0,e=isNaN(e)?t.h:e):u>180?u-=360:-180>u&&(u+=360),function(n){return sn(e+u*n,r+o*n,i+a*n)+""}}function Dr(n,t){n=ao.hsl(n),t=ao.hsl(t);var e=n.h,r=n.s,i=n.l,u=t.h-e,o=t.s-r,a=t.l-i;return isNaN(o)&&(o=0,r=isNaN(r)?t.s:r),isNaN(u)?(u=0,e=isNaN(e)?t.h:e):u>180?u-=360:-180>u&&(u+=360),function(n){return cn(e+u*n,r+o*n,i+a*n)+""}}function Pr(n,t){n=ao.lab(n),t=ao.lab(t);var e=n.l,r=n.a,i=n.b,u=t.l-e,o=t.a-r,a=t.b-i;return function(n){return pn(e+u*n,r+o*n,i+a*n)+""}}function Ur(n,t){return t-=n,function(e){return Math.round(n+t*e)}}function jr(n){var t=[n.a,n.b],e=[n.c,n.d],r=Hr(t),i=Fr(t,e),u=Hr(Or(e,t,-i))||0;t[0]*e[1]180?t+=360:t-n>180&&(n+=360),r.push({i:e.push(Ir(e)+"rotate(",null,")")-2,x:yr(n,t)})):t&&e.push(Ir(e)+"rotate("+t+")")}function Vr(n,t,e,r){n!==t?r.push({i:e.push(Ir(e)+"skewX(",null,")")-2,x:yr(n,t)}):t&&e.push(Ir(e)+"skewX("+t+")")}function Xr(n,t,e,r){if(n[0]!==t[0]||n[1]!==t[1]){var i=e.push(Ir(e)+"scale(",null,",",null,")");r.push({i:i-4,x:yr(n[0],t[0])},{i:i-2,x:yr(n[1],t[1])})}else 1===t[0]&&1===t[1]||e.push(Ir(e)+"scale("+t+")")}function $r(n,t){var e=[],r=[];return n=ao.transform(n),t=ao.transform(t),Yr(n.translate,t.translate,e,r),Zr(n.rotate,t.rotate,e,r),Vr(n.skew,t.skew,e,r),Xr(n.scale,t.scale,e,r),n=t=null,function(n){for(var t,i=-1,u=r.length;++i=0;)e.push(i[r])}function oi(n,t){for(var e=[n],r=[];null!=(n=e.pop());)if(r.push(n),(u=n.children)&&(i=u.length))for(var i,u,o=-1;++oe;++e)(t=n[e][1])>i&&(r=e,i=t);return r}function yi(n){return n.reduce(mi,0)}function mi(n,t){return n+t[1]}function Mi(n,t){return xi(n,Math.ceil(Math.log(t.length)/Math.LN2+1))}function xi(n,t){for(var e=-1,r=+n[0],i=(n[1]-r)/t,u=[];++e<=t;)u[e]=i*e+r;return u}function bi(n){return[ao.min(n),ao.max(n)]}function _i(n,t){return n.value-t.value}function wi(n,t){var e=n._pack_next;n._pack_next=t,t._pack_prev=n,t._pack_next=e,e._pack_prev=t}function Si(n,t){n._pack_next=t,t._pack_prev=n}function ki(n,t){var e=t.x-n.x,r=t.y-n.y,i=n.r+t.r;return.999*i*i>e*e+r*r}function Ni(n){function t(n){f=Math.min(n.x-n.r,f),s=Math.max(n.x+n.r,s),h=Math.min(n.y-n.r,h),p=Math.max(n.y+n.r,p)}if((e=n.children)&&(c=e.length)){var e,r,i,u,o,a,l,c,f=1/0,s=-(1/0),h=1/0,p=-(1/0);if(e.forEach(Ei),r=e[0],r.x=-r.r,r.y=0,t(r),c>1&&(i=e[1],i.x=i.r,i.y=0,t(i),c>2))for(u=e[2],zi(r,i,u),t(u),wi(r,u),r._pack_prev=u,wi(u,i),i=r._pack_next,o=3;c>o;o++){zi(r,i,u=e[o]);var g=0,v=1,d=1;for(a=i._pack_next;a!==i;a=a._pack_next,v++)if(ki(a,u)){g=1;break}if(1==g)for(l=r._pack_prev;l!==a._pack_prev&&!ki(l,u);l=l._pack_prev,d++);g?(d>v||v==d&&i.ro;o++)u=e[o],u.x-=y,u.y-=m,M=Math.max(M,u.r+Math.sqrt(u.x*u.x+u.y*u.y));n.r=M,e.forEach(Ai)}}function Ei(n){n._pack_next=n._pack_prev=n}function Ai(n){delete n._pack_next,delete n._pack_prev}function Ci(n,t,e,r){var i=n.children;if(n.x=t+=r*n.x,n.y=e+=r*n.y,n.r*=r,i)for(var u=-1,o=i.length;++u=0;)t=i[u],t.z+=e,t.m+=e,e+=t.s+(r+=t.c)}function Pi(n,t,e){return n.a.parent===t.parent?n.a:e}function Ui(n){return 1+ao.max(n,function(n){return n.y})}function ji(n){return n.reduce(function(n,t){return n+t.x},0)/n.length}function Fi(n){var t=n.children;return t&&t.length?Fi(t[0]):n}function Hi(n){var t,e=n.children;return e&&(t=e.length)?Hi(e[t-1]):n}function Oi(n){return{x:n.x,y:n.y,dx:n.dx,dy:n.dy}}function Ii(n,t){var e=n.x+t[3],r=n.y+t[0],i=n.dx-t[1]-t[3],u=n.dy-t[0]-t[2];return 0>i&&(e+=i/2,i=0),0>u&&(r+=u/2,u=0),{x:e,y:r,dx:i,dy:u}}function Yi(n){var t=n[0],e=n[n.length-1];return e>t?[t,e]:[e,t]}function Zi(n){return n.rangeExtent?n.rangeExtent():Yi(n.range())}function Vi(n,t,e,r){var i=e(n[0],n[1]),u=r(t[0],t[1]);return function(n){return u(i(n))}}function Xi(n,t){var e,r=0,i=n.length-1,u=n[r],o=n[i];return u>o&&(e=r,r=i,i=e,e=u,u=o,o=e),n[r]=t.floor(u),n[i]=t.ceil(o),n}function $i(n){return n?{floor:function(t){return Math.floor(t/n)*n},ceil:function(t){return Math.ceil(t/n)*n}}:Sl}function Bi(n,t,e,r){var i=[],u=[],o=0,a=Math.min(n.length,t.length)-1;for(n[a]2?Bi:Vi,l=r?Wr:Br;return o=i(n,t,l,e),a=i(t,n,l,Mr),u}function u(n){return o(n)}var o,a;return u.invert=function(n){return a(n)},u.domain=function(t){return arguments.length?(n=t.map(Number),i()):n},u.range=function(n){return arguments.length?(t=n,i()):t},u.rangeRound=function(n){return u.range(n).interpolate(Ur)},u.clamp=function(n){return arguments.length?(r=n,i()):r},u.interpolate=function(n){return arguments.length?(e=n,i()):e},u.ticks=function(t){return Qi(n,t)},u.tickFormat=function(t,e){return nu(n,t,e)},u.nice=function(t){return Gi(n,t),i()},u.copy=function(){return Wi(n,t,e,r)},i()}function Ji(n,t){return ao.rebind(n,t,"range","rangeRound","interpolate","clamp")}function Gi(n,t){return Xi(n,$i(Ki(n,t)[2])),Xi(n,$i(Ki(n,t)[2])),n}function Ki(n,t){null==t&&(t=10);var e=Yi(n),r=e[1]-e[0],i=Math.pow(10,Math.floor(Math.log(r/t)/Math.LN10)),u=t/r*i;return.15>=u?i*=10:.35>=u?i*=5:.75>=u&&(i*=2),e[0]=Math.ceil(e[0]/i)*i,e[1]=Math.floor(e[1]/i)*i+.5*i,e[2]=i,e}function Qi(n,t){return ao.range.apply(ao,Ki(n,t))}function nu(n,t,e){var r=Ki(n,t);if(e){var i=ha.exec(e);if(i.shift(),"s"===i[8]){var u=ao.formatPrefix(Math.max(xo(r[0]),xo(r[1])));return i[7]||(i[7]="."+tu(u.scale(r[2]))),i[8]="f",e=ao.format(i.join("")),function(n){return e(u.scale(n))+u.symbol}}i[7]||(i[7]="."+eu(i[8],r)),e=i.join("")}else e=",."+tu(r[2])+"f";return ao.format(e)}function tu(n){return-Math.floor(Math.log(n)/Math.LN10+.01)}function eu(n,t){var e=tu(t[2]);return n in kl?Math.abs(e-tu(Math.max(xo(t[0]),xo(t[1]))))+ +("e"!==n):e-2*("%"===n)}function ru(n,t,e,r){function i(n){return(e?Math.log(0>n?0:n):-Math.log(n>0?0:-n))/Math.log(t)}function u(n){return e?Math.pow(t,n):-Math.pow(t,-n)}function o(t){return n(i(t))}return o.invert=function(t){return u(n.invert(t))},o.domain=function(t){return arguments.length?(e=t[0]>=0,n.domain((r=t.map(Number)).map(i)),o):r},o.base=function(e){return arguments.length?(t=+e,n.domain(r.map(i)),o):t},o.nice=function(){var t=Xi(r.map(i),e?Math:El);return n.domain(t),r=t.map(u),o},o.ticks=function(){var n=Yi(r),o=[],a=n[0],l=n[1],c=Math.floor(i(a)),f=Math.ceil(i(l)),s=t%1?2:t;if(isFinite(f-c)){if(e){for(;f>c;c++)for(var h=1;s>h;h++)o.push(u(c)*h);o.push(u(c))}else for(o.push(u(c));c++0;h--)o.push(u(c)*h);for(c=0;o[c]l;f--);o=o.slice(c,f)}return o},o.tickFormat=function(n,e){if(!arguments.length)return Nl;arguments.length<2?e=Nl:"function"!=typeof e&&(e=ao.format(e));var r=Math.max(1,t*n/o.ticks().length);return function(n){var o=n/u(Math.round(i(n)));return t-.5>o*t&&(o*=t),r>=o?e(n):""}},o.copy=function(){return ru(n.copy(),t,e,r)},Ji(o,n)}function iu(n,t,e){function r(t){return n(i(t))}var i=uu(t),u=uu(1/t);return r.invert=function(t){return u(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain((e=t.map(Number)).map(i)),r):e},r.ticks=function(n){return Qi(e,n)},r.tickFormat=function(n,t){return nu(e,n,t)},r.nice=function(n){return r.domain(Gi(e,n))},r.exponent=function(o){return arguments.length?(i=uu(t=o),u=uu(1/t),n.domain(e.map(i)),r):t},r.copy=function(){return iu(n.copy(),t,e)},Ji(r,n)}function uu(n){return function(t){return 0>t?-Math.pow(-t,n):Math.pow(t,n)}}function ou(n,t){function e(e){return u[((i.get(e)||("range"===t.t?i.set(e,n.push(e)):NaN))-1)%u.length]}function r(t,e){return ao.range(n.length).map(function(n){return t+e*n})}var i,u,o;return e.domain=function(r){if(!arguments.length)return n;n=[],i=new c;for(var u,o=-1,a=r.length;++oe?[NaN,NaN]:[e>0?a[e-1]:n[0],et?NaN:t/u+n,[t,t+1/u]},r.copy=function(){return lu(n,t,e)},i()}function cu(n,t){function e(e){return e>=e?t[ao.bisect(n,e)]:void 0}return e.domain=function(t){return arguments.length?(n=t,e):n},e.range=function(n){return arguments.length?(t=n,e):t},e.invertExtent=function(e){return e=t.indexOf(e),[n[e-1],n[e]]},e.copy=function(){return cu(n,t)},e}function fu(n){function t(n){return+n}return t.invert=t,t.domain=t.range=function(e){return arguments.length?(n=e.map(t),t):n},t.ticks=function(t){return Qi(n,t)},t.tickFormat=function(t,e){return nu(n,t,e)},t.copy=function(){return fu(n)},t}function su(){return 0}function hu(n){return n.innerRadius}function pu(n){return n.outerRadius}function gu(n){return n.startAngle}function vu(n){return n.endAngle}function du(n){return n&&n.padAngle}function yu(n,t,e,r){return(n-e)*t-(t-r)*n>0?0:1}function mu(n,t,e,r,i){var u=n[0]-t[0],o=n[1]-t[1],a=(i?r:-r)/Math.sqrt(u*u+o*o),l=a*o,c=-a*u,f=n[0]+l,s=n[1]+c,h=t[0]+l,p=t[1]+c,g=(f+h)/2,v=(s+p)/2,d=h-f,y=p-s,m=d*d+y*y,M=e-r,x=f*p-h*s,b=(0>y?-1:1)*Math.sqrt(Math.max(0,M*M*m-x*x)),_=(x*y-d*b)/m,w=(-x*d-y*b)/m,S=(x*y+d*b)/m,k=(-x*d+y*b)/m,N=_-g,E=w-v,A=S-g,C=k-v;return N*N+E*E>A*A+C*C&&(_=S,w=k),[[_-l,w-c],[_*e/M,w*e/M]]}function Mu(n){function t(t){function o(){c.push("M",u(n(f),a))}for(var l,c=[],f=[],s=-1,h=t.length,p=En(e),g=En(r);++s1?n.join("L"):n+"Z"}function bu(n){return n.join("L")+"Z"}function _u(n){for(var t=0,e=n.length,r=n[0],i=[r[0],",",r[1]];++t1&&i.push("H",r[0]),i.join("")}function wu(n){for(var t=0,e=n.length,r=n[0],i=[r[0],",",r[1]];++t1){a=t[1],u=n[l],l++,r+="C"+(i[0]+o[0])+","+(i[1]+o[1])+","+(u[0]-a[0])+","+(u[1]-a[1])+","+u[0]+","+u[1];for(var c=2;c9&&(i=3*t/Math.sqrt(i),o[a]=i*e,o[a+1]=i*r));for(a=-1;++a<=l;)i=(n[Math.min(l,a+1)][0]-n[Math.max(0,a-1)][0])/(6*(1+o[a]*o[a])),u.push([i||0,o[a]*i||0]);return u}function Fu(n){return n.length<3?xu(n):n[0]+Au(n,ju(n))}function Hu(n){for(var t,e,r,i=-1,u=n.length;++i=t?o(n-t):void(f.c=o)}function o(e){var i=g.active,u=g[i];u&&(u.timer.c=null,u.timer.t=NaN,--g.count,delete g[i],u.event&&u.event.interrupt.call(n,n.__data__,u.index));for(var o in g)if(r>+o){var c=g[o];c.timer.c=null,c.timer.t=NaN,--g.count,delete g[o]}f.c=a,qn(function(){return f.c&&a(e||1)&&(f.c=null,f.t=NaN),1},0,l),g.active=r,v.event&&v.event.start.call(n,n.__data__,t),p=[],v.tween.forEach(function(e,r){(r=r.call(n,n.__data__,t))&&p.push(r)}),h=v.ease,s=v.duration}function a(i){for(var u=i/s,o=h(u),a=p.length;a>0;)p[--a].call(n,o);return u>=1?(v.event&&v.event.end.call(n,n.__data__,t),--g.count?delete g[r]:delete n[e],1):void 0}var l,f,s,h,p,g=n[e]||(n[e]={active:0,count:0}),v=g[r];v||(l=i.time,f=qn(u,0,l),v=g[r]={tween:new c,time:l,timer:f,delay:i.delay,duration:i.duration,ease:i.ease,index:t},i=null,++g.count)}function no(n,t,e){n.attr("transform",function(n){var r=t(n);return"translate("+(isFinite(r)?r:e(n))+",0)"})}function to(n,t,e){n.attr("transform",function(n){var r=t(n);return"translate(0,"+(isFinite(r)?r:e(n))+")"})}function eo(n){return n.toISOString()}function ro(n,t,e){function r(t){return n(t)}function i(n,e){var r=n[1]-n[0],i=r/e,u=ao.bisect(Kl,i);return u==Kl.length?[t.year,Ki(n.map(function(n){return n/31536e6}),e)[2]]:u?t[i/Kl[u-1]1?{floor:function(t){for(;e(t=n.floor(t));)t=io(t-1);return t},ceil:function(t){for(;e(t=n.ceil(t));)t=io(+t+1);return t}}:n))},r.ticks=function(n,t){var e=Yi(r.domain()),u=null==n?i(e,10):"number"==typeof n?i(e,n):!n.range&&[{range:n},t];return u&&(n=u[0],t=u[1]),n.range(e[0],io(+e[1]+1),1>t?1:t)},r.tickFormat=function(){return e},r.copy=function(){return ro(n.copy(),t,e)},Ji(r,n)}function io(n){return new Date(n)}function uo(n){return JSON.parse(n.responseText)}function oo(n){var t=fo.createRange();return t.selectNode(fo.body),t.createContextualFragment(n.responseText)}var ao={version:"3.5.17"},lo=[].slice,co=function(n){return lo.call(n)},fo=this.document;if(fo)try{co(fo.documentElement.childNodes)[0].nodeType}catch(so){co=function(n){for(var t=n.length,e=new Array(t);t--;)e[t]=n[t];return e}}if(Date.now||(Date.now=function(){return+new Date}),fo)try{fo.createElement("DIV").style.setProperty("opacity",0,"")}catch(ho){var po=this.Element.prototype,go=po.setAttribute,vo=po.setAttributeNS,yo=this.CSSStyleDeclaration.prototype,mo=yo.setProperty;po.setAttribute=function(n,t){go.call(this,n,t+"")},po.setAttributeNS=function(n,t,e){vo.call(this,n,t,e+"")},yo.setProperty=function(n,t,e){mo.call(this,n,t+"",e)}}ao.ascending=e,ao.descending=function(n,t){return n>t?-1:t>n?1:t>=n?0:NaN},ao.min=function(n,t){var e,r,i=-1,u=n.length;if(1===arguments.length){for(;++i=r){e=r;break}for(;++ir&&(e=r)}else{for(;++i=r){e=r;break}for(;++ir&&(e=r)}return e},ao.max=function(n,t){var e,r,i=-1,u=n.length;if(1===arguments.length){for(;++i=r){e=r;break}for(;++ie&&(e=r)}else{for(;++i=r){e=r;break}for(;++ie&&(e=r)}return e},ao.extent=function(n,t){var e,r,i,u=-1,o=n.length;if(1===arguments.length){for(;++u=r){e=i=r;break}for(;++ur&&(e=r),r>i&&(i=r))}else{for(;++u=r){e=i=r;break}for(;++ur&&(e=r),r>i&&(i=r))}return[e,i]},ao.sum=function(n,t){var e,r=0,u=n.length,o=-1;if(1===arguments.length)for(;++o1?l/(f-1):void 0},ao.deviation=function(){var n=ao.variance.apply(this,arguments);return n?Math.sqrt(n):n};var Mo=u(e);ao.bisectLeft=Mo.left,ao.bisect=ao.bisectRight=Mo.right,ao.bisector=function(n){return u(1===n.length?function(t,r){return e(n(t),r)}:n)},ao.shuffle=function(n,t,e){(u=arguments.length)<3&&(e=n.length,2>u&&(t=0));for(var r,i,u=e-t;u;)i=Math.random()*u--|0,r=n[u+t],n[u+t]=n[i+t],n[i+t]=r;return n},ao.permute=function(n,t){for(var e=t.length,r=new Array(e);e--;)r[e]=n[t[e]];return r},ao.pairs=function(n){for(var t,e=0,r=n.length-1,i=n[0],u=new Array(0>r?0:r);r>e;)u[e]=[t=i,i=n[++e]];return u},ao.transpose=function(n){if(!(i=n.length))return[];for(var t=-1,e=ao.min(n,o),r=new Array(e);++t=0;)for(r=n[i],t=r.length;--t>=0;)e[--o]=r[t];return e};var xo=Math.abs;ao.range=function(n,t,e){if(arguments.length<3&&(e=1,arguments.length<2&&(t=n,n=0)),(t-n)/e===1/0)throw new Error("infinite range");var r,i=[],u=a(xo(e)),o=-1;if(n*=u,t*=u,e*=u,0>e)for(;(r=n+e*++o)>t;)i.push(r/u);else for(;(r=n+e*++o)=u.length)return r?r.call(i,o):e?o.sort(e):o;for(var l,f,s,h,p=-1,g=o.length,v=u[a++],d=new c;++p=u.length)return n;var r=[],i=o[e++];return n.forEach(function(n,i){r.push({key:n,values:t(i,e)})}),i?r.sort(function(n,t){return i(n.key,t.key)}):r}var e,r,i={},u=[],o=[];return i.map=function(t,e){return n(e,t,0)},i.entries=function(e){return t(n(ao.map,e,0),0)},i.key=function(n){return u.push(n),i},i.sortKeys=function(n){return o[u.length-1]=n,i},i.sortValues=function(n){return e=n,i},i.rollup=function(n){return r=n,i},i},ao.set=function(n){var t=new y;if(n)for(var e=0,r=n.length;r>e;++e)t.add(n[e]);return t},l(y,{has:h,add:function(n){return this._[f(n+="")]=!0,n},remove:p,values:g,size:v,empty:d,forEach:function(n){for(var t in this._)n.call(this,s(t))}}),ao.behavior={},ao.rebind=function(n,t){for(var e,r=1,i=arguments.length;++r=0&&(r=n.slice(e+1),n=n.slice(0,e)),n)return arguments.length<2?this[n].on(r):this[n].on(r,t);if(2===arguments.length){if(null==t)for(n in this)this.hasOwnProperty(n)&&this[n].on(r,null);return this}},ao.event=null,ao.requote=function(n){return n.replace(So,"\\$&")};var So=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,ko={}.__proto__?function(n,t){n.__proto__=t}:function(n,t){for(var e in t)n[e]=t[e]},No=function(n,t){return t.querySelector(n)},Eo=function(n,t){return t.querySelectorAll(n)},Ao=function(n,t){var e=n.matches||n[x(n,"matchesSelector")];return(Ao=function(n,t){return e.call(n,t)})(n,t)};"function"==typeof Sizzle&&(No=function(n,t){return Sizzle(n,t)[0]||null},Eo=Sizzle,Ao=Sizzle.matchesSelector),ao.selection=function(){return ao.select(fo.documentElement)};var Co=ao.selection.prototype=[];Co.select=function(n){var t,e,r,i,u=[];n=A(n);for(var o=-1,a=this.length;++o=0&&"xmlns"!==(e=n.slice(0,t))&&(n=n.slice(t+1)),Lo.hasOwnProperty(e)?{space:Lo[e],local:n}:n}},Co.attr=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node();return n=ao.ns.qualify(n),n.local?e.getAttributeNS(n.space,n.local):e.getAttribute(n)}for(t in n)this.each(z(t,n[t]));return this}return this.each(z(n,t))},Co.classed=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node(),r=(n=T(n)).length,i=-1;if(t=e.classList){for(;++ii){if("string"!=typeof n){2>i&&(e="");for(r in n)this.each(P(r,n[r],e));return this}if(2>i){var u=this.node();return t(u).getComputedStyle(u,null).getPropertyValue(n)}r=""}return this.each(P(n,e,r))},Co.property=function(n,t){if(arguments.length<2){if("string"==typeof n)return this.node()[n];for(t in n)this.each(U(t,n[t]));return this}return this.each(U(n,t))},Co.text=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.textContent=null==t?"":t}:null==n?function(){this.textContent=""}:function(){this.textContent=n}):this.node().textContent},Co.html=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.innerHTML=null==t?"":t}:null==n?function(){this.innerHTML=""}:function(){this.innerHTML=n}):this.node().innerHTML},Co.append=function(n){return n=j(n),this.select(function(){return this.appendChild(n.apply(this,arguments))})},Co.insert=function(n,t){return n=j(n),t=A(t),this.select(function(){return this.insertBefore(n.apply(this,arguments),t.apply(this,arguments)||null)})},Co.remove=function(){return this.each(F)},Co.data=function(n,t){function e(n,e){var r,i,u,o=n.length,s=e.length,h=Math.min(o,s),p=new Array(s),g=new Array(s),v=new Array(o);if(t){var d,y=new c,m=new Array(o);for(r=-1;++rr;++r)g[r]=H(e[r]);for(;o>r;++r)v[r]=n[r]}g.update=p,g.parentNode=p.parentNode=v.parentNode=n.parentNode,a.push(g),l.push(p),f.push(v)}var r,i,u=-1,o=this.length;if(!arguments.length){for(n=new Array(o=(r=this[0]).length);++uu;u++){i.push(t=[]),t.parentNode=(e=this[u]).parentNode;for(var a=0,l=e.length;l>a;a++)(r=e[a])&&n.call(r,r.__data__,a,u)&&t.push(r)}return E(i)},Co.order=function(){for(var n=-1,t=this.length;++n=0;)(e=r[i])&&(u&&u!==e.nextSibling&&u.parentNode.insertBefore(e,u),u=e);return this},Co.sort=function(n){n=I.apply(this,arguments);for(var t=-1,e=this.length;++tn;n++)for(var e=this[n],r=0,i=e.length;i>r;r++){var u=e[r];if(u)return u}return null},Co.size=function(){var n=0;return Y(this,function(){++n}),n};var qo=[];ao.selection.enter=Z,ao.selection.enter.prototype=qo,qo.append=Co.append,qo.empty=Co.empty,qo.node=Co.node,qo.call=Co.call,qo.size=Co.size,qo.select=function(n){for(var t,e,r,i,u,o=[],a=-1,l=this.length;++ar){if("string"!=typeof n){2>r&&(t=!1);for(e in n)this.each(X(e,n[e],t));return this}if(2>r)return(r=this.node()["__on"+n])&&r._;e=!1}return this.each(X(n,t,e))};var To=ao.map({mouseenter:"mouseover",mouseleave:"mouseout"});fo&&To.forEach(function(n){"on"+n in fo&&To.remove(n)});var Ro,Do=0;ao.mouse=function(n){return J(n,k())};var Po=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;ao.touch=function(n,t,e){if(arguments.length<3&&(e=t,t=k().changedTouches),t)for(var r,i=0,u=t.length;u>i;++i)if((r=t[i]).identifier===e)return J(n,r)},ao.behavior.drag=function(){function n(){this.on("mousedown.drag",u).on("touchstart.drag",o)}function e(n,t,e,u,o){return function(){function a(){var n,e,r=t(h,v);r&&(n=r[0]-M[0],e=r[1]-M[1],g|=n|e,M=r,p({type:"drag",x:r[0]+c[0],y:r[1]+c[1],dx:n,dy:e}))}function l(){t(h,v)&&(y.on(u+d,null).on(o+d,null),m(g),p({type:"dragend"}))}var c,f=this,s=ao.event.target.correspondingElement||ao.event.target,h=f.parentNode,p=r.of(f,arguments),g=0,v=n(),d=".drag"+(null==v?"":"-"+v),y=ao.select(e(s)).on(u+d,a).on(o+d,l),m=W(s),M=t(h,v);i?(c=i.apply(f,arguments),c=[c.x-M[0],c.y-M[1]]):c=[0,0],p({type:"dragstart"})}}var r=N(n,"drag","dragstart","dragend"),i=null,u=e(b,ao.mouse,t,"mousemove","mouseup"),o=e(G,ao.touch,m,"touchmove","touchend");return n.origin=function(t){return arguments.length?(i=t,n):i},ao.rebind(n,r,"on")},ao.touches=function(n,t){return arguments.length<2&&(t=k().touches),t?co(t).map(function(t){var e=J(n,t);return e.identifier=t.identifier,e}):[]};var Uo=1e-6,jo=Uo*Uo,Fo=Math.PI,Ho=2*Fo,Oo=Ho-Uo,Io=Fo/2,Yo=Fo/180,Zo=180/Fo,Vo=Math.SQRT2,Xo=2,$o=4;ao.interpolateZoom=function(n,t){var e,r,i=n[0],u=n[1],o=n[2],a=t[0],l=t[1],c=t[2],f=a-i,s=l-u,h=f*f+s*s;if(jo>h)r=Math.log(c/o)/Vo,e=function(n){return[i+n*f,u+n*s,o*Math.exp(Vo*n*r)]};else{var p=Math.sqrt(h),g=(c*c-o*o+$o*h)/(2*o*Xo*p),v=(c*c-o*o-$o*h)/(2*c*Xo*p),d=Math.log(Math.sqrt(g*g+1)-g),y=Math.log(Math.sqrt(v*v+1)-v);r=(y-d)/Vo,e=function(n){var t=n*r,e=rn(d),a=o/(Xo*p)*(e*un(Vo*t+d)-en(d));return[i+a*f,u+a*s,o*e/rn(Vo*t+d)]}}return e.duration=1e3*r,e},ao.behavior.zoom=function(){function n(n){n.on(L,s).on(Wo+".zoom",p).on("dblclick.zoom",g).on(R,h)}function e(n){return[(n[0]-k.x)/k.k,(n[1]-k.y)/k.k]}function r(n){return[n[0]*k.k+k.x,n[1]*k.k+k.y]}function i(n){k.k=Math.max(A[0],Math.min(A[1],n))}function u(n,t){t=r(t),k.x+=n[0]-t[0],k.y+=n[1]-t[1]}function o(t,e,r,o){t.__chart__={x:k.x,y:k.y,k:k.k},i(Math.pow(2,o)),u(d=e,r),t=ao.select(t),C>0&&(t=t.transition().duration(C)),t.call(n.event)}function a(){b&&b.domain(x.range().map(function(n){return(n-k.x)/k.k}).map(x.invert)),w&&w.domain(_.range().map(function(n){return(n-k.y)/k.k}).map(_.invert))}function l(n){z++||n({type:"zoomstart"})}function c(n){a(),n({type:"zoom",scale:k.k,translate:[k.x,k.y]})}function f(n){--z||(n({type:"zoomend"}),d=null)}function s(){function n(){a=1,u(ao.mouse(i),h),c(o)}function r(){s.on(q,null).on(T,null),p(a),f(o)}var i=this,o=D.of(i,arguments),a=0,s=ao.select(t(i)).on(q,n).on(T,r),h=e(ao.mouse(i)),p=W(i);Il.call(i),l(o)}function h(){function n(){var n=ao.touches(g);return p=k.k,n.forEach(function(n){n.identifier in d&&(d[n.identifier]=e(n))}),n}function t(){var t=ao.event.target;ao.select(t).on(x,r).on(b,a),_.push(t);for(var e=ao.event.changedTouches,i=0,u=e.length;u>i;++i)d[e[i].identifier]=null;var l=n(),c=Date.now();if(1===l.length){if(500>c-M){var f=l[0];o(g,f,d[f.identifier],Math.floor(Math.log(k.k)/Math.LN2)+1),S()}M=c}else if(l.length>1){var f=l[0],s=l[1],h=f[0]-s[0],p=f[1]-s[1];y=h*h+p*p}}function r(){var n,t,e,r,o=ao.touches(g);Il.call(g);for(var a=0,l=o.length;l>a;++a,r=null)if(e=o[a],r=d[e.identifier]){if(t)break;n=e,t=r}if(r){var f=(f=e[0]-n[0])*f+(f=e[1]-n[1])*f,s=y&&Math.sqrt(f/y);n=[(n[0]+e[0])/2,(n[1]+e[1])/2],t=[(t[0]+r[0])/2,(t[1]+r[1])/2],i(s*p)}M=null,u(n,t),c(v)}function a(){if(ao.event.touches.length){for(var t=ao.event.changedTouches,e=0,r=t.length;r>e;++e)delete d[t[e].identifier];for(var i in d)return void n()}ao.selectAll(_).on(m,null),w.on(L,s).on(R,h),N(),f(v)}var p,g=this,v=D.of(g,arguments),d={},y=0,m=".zoom-"+ao.event.changedTouches[0].identifier,x="touchmove"+m,b="touchend"+m,_=[],w=ao.select(g),N=W(g);t(),l(v),w.on(L,null).on(R,t)}function p(){var n=D.of(this,arguments);m?clearTimeout(m):(Il.call(this),v=e(d=y||ao.mouse(this)),l(n)),m=setTimeout(function(){m=null,f(n)},50),S(),i(Math.pow(2,.002*Bo())*k.k),u(d,v),c(n)}function g(){var n=ao.mouse(this),t=Math.log(k.k)/Math.LN2;o(this,n,e(n),ao.event.shiftKey?Math.ceil(t)-1:Math.floor(t)+1)}var v,d,y,m,M,x,b,_,w,k={x:0,y:0,k:1},E=[960,500],A=Jo,C=250,z=0,L="mousedown.zoom",q="mousemove.zoom",T="mouseup.zoom",R="touchstart.zoom",D=N(n,"zoomstart","zoom","zoomend");return Wo||(Wo="onwheel"in fo?(Bo=function(){return-ao.event.deltaY*(ao.event.deltaMode?120:1)},"wheel"):"onmousewheel"in fo?(Bo=function(){return ao.event.wheelDelta},"mousewheel"):(Bo=function(){return-ao.event.detail},"MozMousePixelScroll")),n.event=function(n){n.each(function(){var n=D.of(this,arguments),t=k;Hl?ao.select(this).transition().each("start.zoom",function(){k=this.__chart__||{x:0,y:0,k:1},l(n)}).tween("zoom:zoom",function(){var e=E[0],r=E[1],i=d?d[0]:e/2,u=d?d[1]:r/2,o=ao.interpolateZoom([(i-k.x)/k.k,(u-k.y)/k.k,e/k.k],[(i-t.x)/t.k,(u-t.y)/t.k,e/t.k]);return function(t){var r=o(t),a=e/r[2];this.__chart__=k={x:i-r[0]*a,y:u-r[1]*a,k:a},c(n)}}).each("interrupt.zoom",function(){f(n)}).each("end.zoom",function(){f(n)}):(this.__chart__=k,l(n),c(n),f(n))})},n.translate=function(t){return arguments.length?(k={x:+t[0],y:+t[1],k:k.k},a(),n):[k.x,k.y]},n.scale=function(t){return arguments.length?(k={x:k.x,y:k.y,k:null},i(+t),a(),n):k.k},n.scaleExtent=function(t){return arguments.length?(A=null==t?Jo:[+t[0],+t[1]],n):A},n.center=function(t){return arguments.length?(y=t&&[+t[0],+t[1]],n):y},n.size=function(t){return arguments.length?(E=t&&[+t[0],+t[1]],n):E},n.duration=function(t){return arguments.length?(C=+t,n):C},n.x=function(t){return arguments.length?(b=t,x=t.copy(),k={x:0,y:0,k:1},n):b},n.y=function(t){return arguments.length?(w=t,_=t.copy(),k={x:0,y:0,k:1},n):w},ao.rebind(n,D,"on")};var Bo,Wo,Jo=[0,1/0];ao.color=an,an.prototype.toString=function(){return this.rgb()+""},ao.hsl=ln;var Go=ln.prototype=new an;Go.brighter=function(n){return n=Math.pow(.7,arguments.length?n:1),new ln(this.h,this.s,this.l/n)},Go.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new ln(this.h,this.s,n*this.l)},Go.rgb=function(){return cn(this.h,this.s,this.l)},ao.hcl=fn;var Ko=fn.prototype=new an;Ko.brighter=function(n){return new fn(this.h,this.c,Math.min(100,this.l+Qo*(arguments.length?n:1)))},Ko.darker=function(n){return new fn(this.h,this.c,Math.max(0,this.l-Qo*(arguments.length?n:1)))},Ko.rgb=function(){return sn(this.h,this.c,this.l).rgb()},ao.lab=hn;var Qo=18,na=.95047,ta=1,ea=1.08883,ra=hn.prototype=new an;ra.brighter=function(n){return new hn(Math.min(100,this.l+Qo*(arguments.length?n:1)),this.a,this.b)},ra.darker=function(n){return new hn(Math.max(0,this.l-Qo*(arguments.length?n:1)),this.a,this.b)},ra.rgb=function(){return pn(this.l,this.a,this.b)},ao.rgb=mn;var ia=mn.prototype=new an;ia.brighter=function(n){n=Math.pow(.7,arguments.length?n:1);var t=this.r,e=this.g,r=this.b,i=30;return t||e||r?(t&&i>t&&(t=i),e&&i>e&&(e=i),r&&i>r&&(r=i),new mn(Math.min(255,t/n),Math.min(255,e/n),Math.min(255,r/n))):new mn(i,i,i)},ia.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new mn(n*this.r,n*this.g,n*this.b)},ia.hsl=function(){return wn(this.r,this.g,this.b)},ia.toString=function(){return"#"+bn(this.r)+bn(this.g)+bn(this.b)};var ua=ao.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});ua.forEach(function(n,t){ua.set(n,Mn(t))}),ao.functor=En,ao.xhr=An(m),ao.dsv=function(n,t){function e(n,e,u){arguments.length<3&&(u=e,e=null);var o=Cn(n,t,null==e?r:i(e),u);return o.row=function(n){return arguments.length?o.response(null==(e=n)?r:i(n)):e},o}function r(n){return e.parse(n.responseText)}function i(n){return function(t){return e.parse(t.responseText,n)}}function u(t){return t.map(o).join(n)}function o(n){return a.test(n)?'"'+n.replace(/\"/g,'""')+'"':n}var a=new RegExp('["'+n+"\n]"),l=n.charCodeAt(0);return e.parse=function(n,t){var r;return e.parseRows(n,function(n,e){if(r)return r(n,e-1);var i=new Function("d","return {"+n.map(function(n,t){return JSON.stringify(n)+": d["+t+"]"}).join(",")+"}");r=t?function(n,e){return t(i(n),e)}:i})},e.parseRows=function(n,t){function e(){if(f>=c)return o;if(i)return i=!1,u;var t=f;if(34===n.charCodeAt(t)){for(var e=t;e++f;){var r=n.charCodeAt(f++),a=1;if(10===r)i=!0;else if(13===r)i=!0,10===n.charCodeAt(f)&&(++f,++a);else if(r!==l)continue;return n.slice(t,f-a)}return n.slice(t)}for(var r,i,u={},o={},a=[],c=n.length,f=0,s=0;(r=e())!==o;){for(var h=[];r!==u&&r!==o;)h.push(r),r=e();t&&null==(h=t(h,s++))||a.push(h)}return a},e.format=function(t){if(Array.isArray(t[0]))return e.formatRows(t);var r=new y,i=[];return t.forEach(function(n){for(var t in n)r.has(t)||i.push(r.add(t))}),[i.map(o).join(n)].concat(t.map(function(t){return i.map(function(n){return o(t[n])}).join(n)})).join("\n")},e.formatRows=function(n){return n.map(u).join("\n")},e},ao.csv=ao.dsv(",","text/csv"),ao.tsv=ao.dsv(" ","text/tab-separated-values");var oa,aa,la,ca,fa=this[x(this,"requestAnimationFrame")]||function(n){setTimeout(n,17)};ao.timer=function(){qn.apply(this,arguments)},ao.timer.flush=function(){Rn(),Dn()},ao.round=function(n,t){return t?Math.round(n*(t=Math.pow(10,t)))/t:Math.round(n)};var sa=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"].map(Un);ao.formatPrefix=function(n,t){var e=0;return(n=+n)&&(0>n&&(n*=-1),t&&(n=ao.round(n,Pn(n,t))),e=1+Math.floor(1e-12+Math.log(n)/Math.LN10),e=Math.max(-24,Math.min(24,3*Math.floor((e-1)/3)))),sa[8+e/3]};var ha=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,pa=ao.map({b:function(n){return n.toString(2)},c:function(n){return String.fromCharCode(n)},o:function(n){return n.toString(8)},x:function(n){return n.toString(16)},X:function(n){return n.toString(16).toUpperCase()},g:function(n,t){return n.toPrecision(t)},e:function(n,t){return n.toExponential(t)},f:function(n,t){return n.toFixed(t)},r:function(n,t){return(n=ao.round(n,Pn(n,t))).toFixed(Math.max(0,Math.min(20,Pn(n*(1+1e-15),t))))}}),ga=ao.time={},va=Date;Hn.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){da.setUTCDate.apply(this._,arguments)},setDay:function(){da.setUTCDay.apply(this._,arguments)},setFullYear:function(){da.setUTCFullYear.apply(this._,arguments)},setHours:function(){da.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){da.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){da.setUTCMinutes.apply(this._,arguments)},setMonth:function(){da.setUTCMonth.apply(this._,arguments)},setSeconds:function(){da.setUTCSeconds.apply(this._,arguments)},setTime:function(){da.setTime.apply(this._,arguments)}};var da=Date.prototype;ga.year=On(function(n){return n=ga.day(n),n.setMonth(0,1),n},function(n,t){n.setFullYear(n.getFullYear()+t)},function(n){return n.getFullYear()}),ga.years=ga.year.range,ga.years.utc=ga.year.utc.range,ga.day=On(function(n){var t=new va(2e3,0);return t.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),t},function(n,t){n.setDate(n.getDate()+t)},function(n){return n.getDate()-1}),ga.days=ga.day.range,ga.days.utc=ga.day.utc.range,ga.dayOfYear=function(n){var t=ga.year(n);return Math.floor((n-t-6e4*(n.getTimezoneOffset()-t.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(n,t){t=7-t;var e=ga[n]=On(function(n){return(n=ga.day(n)).setDate(n.getDate()-(n.getDay()+t)%7),n},function(n,t){n.setDate(n.getDate()+7*Math.floor(t))},function(n){var e=ga.year(n).getDay();return Math.floor((ga.dayOfYear(n)+(e+t)%7)/7)-(e!==t)});ga[n+"s"]=e.range,ga[n+"s"].utc=e.utc.range,ga[n+"OfYear"]=function(n){var e=ga.year(n).getDay();return Math.floor((ga.dayOfYear(n)+(e+t)%7)/7)}}),ga.week=ga.sunday,ga.weeks=ga.sunday.range,ga.weeks.utc=ga.sunday.utc.range,ga.weekOfYear=ga.sundayOfYear;var ya={"-":"",_:" ",0:"0"},ma=/^\s*\d+/,Ma=/^%/;ao.locale=function(n){return{numberFormat:jn(n),timeFormat:Yn(n)}};var xa=ao.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"], -shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});ao.format=xa.numberFormat,ao.geo={},ft.prototype={s:0,t:0,add:function(n){st(n,this.t,ba),st(ba.s,this.s,this),this.s?this.t+=ba.t:this.s=ba.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var ba=new ft;ao.geo.stream=function(n,t){n&&_a.hasOwnProperty(n.type)?_a[n.type](n,t):ht(n,t)};var _a={Feature:function(n,t){ht(n.geometry,t)},FeatureCollection:function(n,t){for(var e=n.features,r=-1,i=e.length;++rn?4*Fo+n:n,Na.lineStart=Na.lineEnd=Na.point=b}};ao.geo.bounds=function(){function n(n,t){M.push(x=[f=n,h=n]),s>t&&(s=t),t>p&&(p=t)}function t(t,e){var r=dt([t*Yo,e*Yo]);if(y){var i=mt(y,r),u=[i[1],-i[0],0],o=mt(u,i);bt(o),o=_t(o);var l=t-g,c=l>0?1:-1,v=o[0]*Zo*c,d=xo(l)>180;if(d^(v>c*g&&c*t>v)){var m=o[1]*Zo;m>p&&(p=m)}else if(v=(v+360)%360-180,d^(v>c*g&&c*t>v)){var m=-o[1]*Zo;s>m&&(s=m)}else s>e&&(s=e),e>p&&(p=e);d?g>t?a(f,t)>a(f,h)&&(h=t):a(t,h)>a(f,h)&&(f=t):h>=f?(f>t&&(f=t),t>h&&(h=t)):t>g?a(f,t)>a(f,h)&&(h=t):a(t,h)>a(f,h)&&(f=t)}else n(t,e);y=r,g=t}function e(){b.point=t}function r(){x[0]=f,x[1]=h,b.point=n,y=null}function i(n,e){if(y){var r=n-g;m+=xo(r)>180?r+(r>0?360:-360):r}else v=n,d=e;Na.point(n,e),t(n,e)}function u(){Na.lineStart()}function o(){i(v,d),Na.lineEnd(),xo(m)>Uo&&(f=-(h=180)),x[0]=f,x[1]=h,y=null}function a(n,t){return(t-=n)<0?t+360:t}function l(n,t){return n[0]-t[0]}function c(n,t){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:nka?(f=-(h=180),s=-(p=90)):m>Uo?p=90:-Uo>m&&(s=-90),x[0]=f,x[1]=h}};return function(n){p=h=-(f=s=1/0),M=[],ao.geo.stream(n,b);var t=M.length;if(t){M.sort(l);for(var e,r=1,i=M[0],u=[i];t>r;++r)e=M[r],c(e[0],i)||c(e[1],i)?(a(i[0],e[1])>a(i[0],i[1])&&(i[1]=e[1]),a(e[0],i[1])>a(i[0],i[1])&&(i[0]=e[0])):u.push(i=e);for(var o,e,g=-(1/0),t=u.length-1,r=0,i=u[t];t>=r;i=e,++r)e=u[r],(o=a(i[1],e[0]))>g&&(g=o,f=e[0],h=i[1])}return M=x=null,f===1/0||s===1/0?[[NaN,NaN],[NaN,NaN]]:[[f,s],[h,p]]}}(),ao.geo.centroid=function(n){Ea=Aa=Ca=za=La=qa=Ta=Ra=Da=Pa=Ua=0,ao.geo.stream(n,ja);var t=Da,e=Pa,r=Ua,i=t*t+e*e+r*r;return jo>i&&(t=qa,e=Ta,r=Ra,Uo>Aa&&(t=Ca,e=za,r=La),i=t*t+e*e+r*r,jo>i)?[NaN,NaN]:[Math.atan2(e,t)*Zo,tn(r/Math.sqrt(i))*Zo]};var Ea,Aa,Ca,za,La,qa,Ta,Ra,Da,Pa,Ua,ja={sphere:b,point:St,lineStart:Nt,lineEnd:Et,polygonStart:function(){ja.lineStart=At},polygonEnd:function(){ja.lineStart=Nt}},Fa=Rt(zt,jt,Ht,[-Fo,-Fo/2]),Ha=1e9;ao.geo.clipExtent=function(){var n,t,e,r,i,u,o={stream:function(n){return i&&(i.valid=!1),i=u(n),i.valid=!0,i},extent:function(a){return arguments.length?(u=Zt(n=+a[0][0],t=+a[0][1],e=+a[1][0],r=+a[1][1]),i&&(i.valid=!1,i=null),o):[[n,t],[e,r]]}};return o.extent([[0,0],[960,500]])},(ao.geo.conicEqualArea=function(){return Vt(Xt)}).raw=Xt,ao.geo.albers=function(){return ao.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},ao.geo.albersUsa=function(){function n(n){var u=n[0],o=n[1];return t=null,e(u,o),t||(r(u,o),t)||i(u,o),t}var t,e,r,i,u=ao.geo.albers(),o=ao.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),a=ao.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(n,e){t=[n,e]}};return n.invert=function(n){var t=u.scale(),e=u.translate(),r=(n[0]-e[0])/t,i=(n[1]-e[1])/t;return(i>=.12&&.234>i&&r>=-.425&&-.214>r?o:i>=.166&&.234>i&&r>=-.214&&-.115>r?a:u).invert(n)},n.stream=function(n){var t=u.stream(n),e=o.stream(n),r=a.stream(n);return{point:function(n,i){t.point(n,i),e.point(n,i),r.point(n,i)},sphere:function(){t.sphere(),e.sphere(),r.sphere()},lineStart:function(){t.lineStart(),e.lineStart(),r.lineStart()},lineEnd:function(){t.lineEnd(),e.lineEnd(),r.lineEnd()},polygonStart:function(){t.polygonStart(),e.polygonStart(),r.polygonStart()},polygonEnd:function(){t.polygonEnd(),e.polygonEnd(),r.polygonEnd()}}},n.precision=function(t){return arguments.length?(u.precision(t),o.precision(t),a.precision(t),n):u.precision()},n.scale=function(t){return arguments.length?(u.scale(t),o.scale(.35*t),a.scale(t),n.translate(u.translate())):u.scale()},n.translate=function(t){if(!arguments.length)return u.translate();var c=u.scale(),f=+t[0],s=+t[1];return e=u.translate(t).clipExtent([[f-.455*c,s-.238*c],[f+.455*c,s+.238*c]]).stream(l).point,r=o.translate([f-.307*c,s+.201*c]).clipExtent([[f-.425*c+Uo,s+.12*c+Uo],[f-.214*c-Uo,s+.234*c-Uo]]).stream(l).point,i=a.translate([f-.205*c,s+.212*c]).clipExtent([[f-.214*c+Uo,s+.166*c+Uo],[f-.115*c-Uo,s+.234*c-Uo]]).stream(l).point,n},n.scale(1070)};var Oa,Ia,Ya,Za,Va,Xa,$a={point:b,lineStart:b,lineEnd:b,polygonStart:function(){Ia=0,$a.lineStart=$t},polygonEnd:function(){$a.lineStart=$a.lineEnd=$a.point=b,Oa+=xo(Ia/2)}},Ba={point:Bt,lineStart:b,lineEnd:b,polygonStart:b,polygonEnd:b},Wa={point:Gt,lineStart:Kt,lineEnd:Qt,polygonStart:function(){Wa.lineStart=ne},polygonEnd:function(){Wa.point=Gt,Wa.lineStart=Kt,Wa.lineEnd=Qt}};ao.geo.path=function(){function n(n){return n&&("function"==typeof a&&u.pointRadius(+a.apply(this,arguments)),o&&o.valid||(o=i(u)),ao.geo.stream(n,o)),u.result()}function t(){return o=null,n}var e,r,i,u,o,a=4.5;return n.area=function(n){return Oa=0,ao.geo.stream(n,i($a)),Oa},n.centroid=function(n){return Ca=za=La=qa=Ta=Ra=Da=Pa=Ua=0,ao.geo.stream(n,i(Wa)),Ua?[Da/Ua,Pa/Ua]:Ra?[qa/Ra,Ta/Ra]:La?[Ca/La,za/La]:[NaN,NaN]},n.bounds=function(n){return Va=Xa=-(Ya=Za=1/0),ao.geo.stream(n,i(Ba)),[[Ya,Za],[Va,Xa]]},n.projection=function(n){return arguments.length?(i=(e=n)?n.stream||re(n):m,t()):e},n.context=function(n){return arguments.length?(u=null==(r=n)?new Wt:new te(n),"function"!=typeof a&&u.pointRadius(a),t()):r},n.pointRadius=function(t){return arguments.length?(a="function"==typeof t?t:(u.pointRadius(+t),+t),n):a},n.projection(ao.geo.albersUsa()).context(null)},ao.geo.transform=function(n){return{stream:function(t){var e=new ie(t);for(var r in n)e[r]=n[r];return e}}},ie.prototype={point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},ao.geo.projection=oe,ao.geo.projectionMutator=ae,(ao.geo.equirectangular=function(){return oe(ce)}).raw=ce.invert=ce,ao.geo.rotation=function(n){function t(t){return t=n(t[0]*Yo,t[1]*Yo),t[0]*=Zo,t[1]*=Zo,t}return n=se(n[0]%360*Yo,n[1]*Yo,n.length>2?n[2]*Yo:0),t.invert=function(t){return t=n.invert(t[0]*Yo,t[1]*Yo),t[0]*=Zo,t[1]*=Zo,t},t},fe.invert=ce,ao.geo.circle=function(){function n(){var n="function"==typeof r?r.apply(this,arguments):r,t=se(-n[0]*Yo,-n[1]*Yo,0).invert,i=[];return e(null,null,1,{point:function(n,e){i.push(n=t(n,e)),n[0]*=Zo,n[1]*=Zo}}),{type:"Polygon",coordinates:[i]}}var t,e,r=[0,0],i=6;return n.origin=function(t){return arguments.length?(r=t,n):r},n.angle=function(r){return arguments.length?(e=ve((t=+r)*Yo,i*Yo),n):t},n.precision=function(r){return arguments.length?(e=ve(t*Yo,(i=+r)*Yo),n):i},n.angle(90)},ao.geo.distance=function(n,t){var e,r=(t[0]-n[0])*Yo,i=n[1]*Yo,u=t[1]*Yo,o=Math.sin(r),a=Math.cos(r),l=Math.sin(i),c=Math.cos(i),f=Math.sin(u),s=Math.cos(u);return Math.atan2(Math.sqrt((e=s*o)*e+(e=c*f-l*s*a)*e),l*f+c*s*a)},ao.geo.graticule=function(){function n(){return{type:"MultiLineString",coordinates:t()}}function t(){return ao.range(Math.ceil(u/d)*d,i,d).map(h).concat(ao.range(Math.ceil(c/y)*y,l,y).map(p)).concat(ao.range(Math.ceil(r/g)*g,e,g).filter(function(n){return xo(n%d)>Uo}).map(f)).concat(ao.range(Math.ceil(a/v)*v,o,v).filter(function(n){return xo(n%y)>Uo}).map(s))}var e,r,i,u,o,a,l,c,f,s,h,p,g=10,v=g,d=90,y=360,m=2.5;return n.lines=function(){return t().map(function(n){return{type:"LineString",coordinates:n}})},n.outline=function(){return{type:"Polygon",coordinates:[h(u).concat(p(l).slice(1),h(i).reverse().slice(1),p(c).reverse().slice(1))]}},n.extent=function(t){return arguments.length?n.majorExtent(t).minorExtent(t):n.minorExtent()},n.majorExtent=function(t){return arguments.length?(u=+t[0][0],i=+t[1][0],c=+t[0][1],l=+t[1][1],u>i&&(t=u,u=i,i=t),c>l&&(t=c,c=l,l=t),n.precision(m)):[[u,c],[i,l]]},n.minorExtent=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],a=+t[0][1],o=+t[1][1],r>e&&(t=r,r=e,e=t),a>o&&(t=a,a=o,o=t),n.precision(m)):[[r,a],[e,o]]},n.step=function(t){return arguments.length?n.majorStep(t).minorStep(t):n.minorStep()},n.majorStep=function(t){return arguments.length?(d=+t[0],y=+t[1],n):[d,y]},n.minorStep=function(t){return arguments.length?(g=+t[0],v=+t[1],n):[g,v]},n.precision=function(t){return arguments.length?(m=+t,f=ye(a,o,90),s=me(r,e,m),h=ye(c,l,90),p=me(u,i,m),n):m},n.majorExtent([[-180,-90+Uo],[180,90-Uo]]).minorExtent([[-180,-80-Uo],[180,80+Uo]])},ao.geo.greatArc=function(){function n(){return{type:"LineString",coordinates:[t||r.apply(this,arguments),e||i.apply(this,arguments)]}}var t,e,r=Me,i=xe;return n.distance=function(){return ao.geo.distance(t||r.apply(this,arguments),e||i.apply(this,arguments))},n.source=function(e){return arguments.length?(r=e,t="function"==typeof e?null:e,n):r},n.target=function(t){return arguments.length?(i=t,e="function"==typeof t?null:t,n):i},n.precision=function(){return arguments.length?n:0},n},ao.geo.interpolate=function(n,t){return be(n[0]*Yo,n[1]*Yo,t[0]*Yo,t[1]*Yo)},ao.geo.length=function(n){return Ja=0,ao.geo.stream(n,Ga),Ja};var Ja,Ga={sphere:b,point:b,lineStart:_e,lineEnd:b,polygonStart:b,polygonEnd:b},Ka=we(function(n){return Math.sqrt(2/(1+n))},function(n){return 2*Math.asin(n/2)});(ao.geo.azimuthalEqualArea=function(){return oe(Ka)}).raw=Ka;var Qa=we(function(n){var t=Math.acos(n);return t&&t/Math.sin(t)},m);(ao.geo.azimuthalEquidistant=function(){return oe(Qa)}).raw=Qa,(ao.geo.conicConformal=function(){return Vt(Se)}).raw=Se,(ao.geo.conicEquidistant=function(){return Vt(ke)}).raw=ke;var nl=we(function(n){return 1/n},Math.atan);(ao.geo.gnomonic=function(){return oe(nl)}).raw=nl,Ne.invert=function(n,t){return[n,2*Math.atan(Math.exp(t))-Io]},(ao.geo.mercator=function(){return Ee(Ne)}).raw=Ne;var tl=we(function(){return 1},Math.asin);(ao.geo.orthographic=function(){return oe(tl)}).raw=tl;var el=we(function(n){return 1/(1+n)},function(n){return 2*Math.atan(n)});(ao.geo.stereographic=function(){return oe(el)}).raw=el,Ae.invert=function(n,t){return[-t,2*Math.atan(Math.exp(n))-Io]},(ao.geo.transverseMercator=function(){var n=Ee(Ae),t=n.center,e=n.rotate;return n.center=function(n){return n?t([-n[1],n[0]]):(n=t(),[n[1],-n[0]])},n.rotate=function(n){return n?e([n[0],n[1],n.length>2?n[2]+90:90]):(n=e(),[n[0],n[1],n[2]-90])},e([0,0,90])}).raw=Ae,ao.geom={},ao.geom.hull=function(n){function t(n){if(n.length<3)return[];var t,i=En(e),u=En(r),o=n.length,a=[],l=[];for(t=0;o>t;t++)a.push([+i.call(this,n[t],t),+u.call(this,n[t],t),t]);for(a.sort(qe),t=0;o>t;t++)l.push([a[t][0],-a[t][1]]);var c=Le(a),f=Le(l),s=f[0]===c[0],h=f[f.length-1]===c[c.length-1],p=[];for(t=c.length-1;t>=0;--t)p.push(n[a[c[t]][2]]);for(t=+s;t=r&&c.x<=u&&c.y>=i&&c.y<=o?[[r,o],[u,o],[u,i],[r,i]]:[];f.point=n[a]}),t}function e(n){return n.map(function(n,t){return{x:Math.round(u(n,t)/Uo)*Uo,y:Math.round(o(n,t)/Uo)*Uo,i:t}})}var r=Ce,i=ze,u=r,o=i,a=sl;return n?t(n):(t.links=function(n){return ar(e(n)).edges.filter(function(n){return n.l&&n.r}).map(function(t){return{source:n[t.l.i],target:n[t.r.i]}})},t.triangles=function(n){var t=[];return ar(e(n)).cells.forEach(function(e,r){for(var i,u,o=e.site,a=e.edges.sort(Ve),l=-1,c=a.length,f=a[c-1].edge,s=f.l===o?f.r:f.l;++l=c,h=r>=f,p=h<<1|s;n.leaf=!1,n=n.nodes[p]||(n.nodes[p]=hr()),s?i=c:a=c,h?o=f:l=f,u(n,t,e,r,i,o,a,l)}var f,s,h,p,g,v,d,y,m,M=En(a),x=En(l);if(null!=t)v=t,d=e,y=r,m=i;else if(y=m=-(v=d=1/0),s=[],h=[],g=n.length,o)for(p=0;g>p;++p)f=n[p],f.xy&&(y=f.x),f.y>m&&(m=f.y),s.push(f.x),h.push(f.y);else for(p=0;g>p;++p){var b=+M(f=n[p],p),_=+x(f,p);v>b&&(v=b),d>_&&(d=_),b>y&&(y=b),_>m&&(m=_),s.push(b),h.push(_)}var w=y-v,S=m-d;w>S?m=d+w:y=v+S;var k=hr();if(k.add=function(n){u(k,n,+M(n,++p),+x(n,p),v,d,y,m)},k.visit=function(n){pr(n,k,v,d,y,m)},k.find=function(n){return gr(k,n[0],n[1],v,d,y,m)},p=-1,null==t){for(;++p=0?n.slice(0,t):n,r=t>=0?n.slice(t+1):"in";return e=vl.get(e)||gl,r=dl.get(r)||m,br(r(e.apply(null,lo.call(arguments,1))))},ao.interpolateHcl=Rr,ao.interpolateHsl=Dr,ao.interpolateLab=Pr,ao.interpolateRound=Ur,ao.transform=function(n){var t=fo.createElementNS(ao.ns.prefix.svg,"g");return(ao.transform=function(n){if(null!=n){t.setAttribute("transform",n);var e=t.transform.baseVal.consolidate()}return new jr(e?e.matrix:yl)})(n)},jr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var yl={a:1,b:0,c:0,d:1,e:0,f:0};ao.interpolateTransform=$r,ao.layout={},ao.layout.bundle=function(){return function(n){for(var t=[],e=-1,r=n.length;++ea*a/y){if(v>l){var c=t.charge/l;n.px-=u*c,n.py-=o*c}return!0}if(t.point&&l&&v>l){var c=t.pointCharge/l;n.px-=u*c,n.py-=o*c}}return!t.charge}}function t(n){n.px=ao.event.x,n.py=ao.event.y,l.resume()}var e,r,i,u,o,a,l={},c=ao.dispatch("start","tick","end"),f=[1,1],s=.9,h=ml,p=Ml,g=-30,v=xl,d=.1,y=.64,M=[],x=[];return l.tick=function(){if((i*=.99)<.005)return e=null,c.end({type:"end",alpha:i=0}),!0;var t,r,l,h,p,v,y,m,b,_=M.length,w=x.length;for(r=0;w>r;++r)l=x[r],h=l.source,p=l.target,m=p.x-h.x,b=p.y-h.y,(v=m*m+b*b)&&(v=i*o[r]*((v=Math.sqrt(v))-u[r])/v,m*=v,b*=v,p.x-=m*(y=h.weight+p.weight?h.weight/(h.weight+p.weight):.5),p.y-=b*y,h.x+=m*(y=1-y),h.y+=b*y);if((y=i*d)&&(m=f[0]/2,b=f[1]/2,r=-1,y))for(;++r<_;)l=M[r],l.x+=(m-l.x)*y,l.y+=(b-l.y)*y;if(g)for(ri(t=ao.geom.quadtree(M),i,a),r=-1;++r<_;)(l=M[r]).fixed||t.visit(n(l));for(r=-1;++r<_;)l=M[r],l.fixed?(l.x=l.px,l.y=l.py):(l.x-=(l.px-(l.px=l.x))*s,l.y-=(l.py-(l.py=l.y))*s);c.tick({type:"tick",alpha:i})},l.nodes=function(n){return arguments.length?(M=n,l):M},l.links=function(n){return arguments.length?(x=n,l):x},l.size=function(n){return arguments.length?(f=n,l):f},l.linkDistance=function(n){return arguments.length?(h="function"==typeof n?n:+n,l):h},l.distance=l.linkDistance,l.linkStrength=function(n){return arguments.length?(p="function"==typeof n?n:+n,l):p},l.friction=function(n){return arguments.length?(s=+n,l):s},l.charge=function(n){return arguments.length?(g="function"==typeof n?n:+n,l):g},l.chargeDistance=function(n){return arguments.length?(v=n*n,l):Math.sqrt(v)},l.gravity=function(n){return arguments.length?(d=+n,l):d},l.theta=function(n){return arguments.length?(y=n*n,l):Math.sqrt(y)},l.alpha=function(n){return arguments.length?(n=+n,i?n>0?i=n:(e.c=null,e.t=NaN,e=null,c.end({type:"end",alpha:i=0})):n>0&&(c.start({type:"start",alpha:i=n}),e=qn(l.tick)),l):i},l.start=function(){function n(n,r){if(!e){for(e=new Array(i),l=0;i>l;++l)e[l]=[];for(l=0;c>l;++l){var u=x[l];e[u.source.index].push(u.target),e[u.target.index].push(u.source)}}for(var o,a=e[t],l=-1,f=a.length;++lt;++t)(r=M[t]).index=t,r.weight=0;for(t=0;c>t;++t)r=x[t],"number"==typeof r.source&&(r.source=M[r.source]),"number"==typeof r.target&&(r.target=M[r.target]),++r.source.weight,++r.target.weight;for(t=0;i>t;++t)r=M[t],isNaN(r.x)&&(r.x=n("x",s)),isNaN(r.y)&&(r.y=n("y",v)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(u=[],"function"==typeof h)for(t=0;c>t;++t)u[t]=+h.call(this,x[t],t);else for(t=0;c>t;++t)u[t]=h;if(o=[],"function"==typeof p)for(t=0;c>t;++t)o[t]=+p.call(this,x[t],t);else for(t=0;c>t;++t)o[t]=p;if(a=[],"function"==typeof g)for(t=0;i>t;++t)a[t]=+g.call(this,M[t],t);else for(t=0;i>t;++t)a[t]=g;return l.resume()},l.resume=function(){return l.alpha(.1)},l.stop=function(){return l.alpha(0)},l.drag=function(){return r||(r=ao.behavior.drag().origin(m).on("dragstart.force",Qr).on("drag.force",t).on("dragend.force",ni)),arguments.length?void this.on("mouseover.force",ti).on("mouseout.force",ei).call(r):r},ao.rebind(l,c,"on")};var ml=20,Ml=1,xl=1/0;ao.layout.hierarchy=function(){function n(i){var u,o=[i],a=[];for(i.depth=0;null!=(u=o.pop());)if(a.push(u),(c=e.call(n,u,u.depth))&&(l=c.length)){for(var l,c,f;--l>=0;)o.push(f=c[l]),f.parent=u,f.depth=u.depth+1;r&&(u.value=0),u.children=c}else r&&(u.value=+r.call(n,u,u.depth)||0),delete u.children;return oi(i,function(n){var e,i;t&&(e=n.children)&&e.sort(t),r&&(i=n.parent)&&(i.value+=n.value)}),a}var t=ci,e=ai,r=li;return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(ui(t,function(n){n.children&&(n.value=0)}),oi(t,function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)})),t},n},ao.layout.partition=function(){function n(t,e,r,i){var u=t.children;if(t.x=e,t.y=t.depth*i,t.dx=r,t.dy=i,u&&(o=u.length)){var o,a,l,c=-1;for(r=t.value?r/t.value:0;++cs?-1:1),g=ao.sum(c),v=g?(s-l*p)/g:0,d=ao.range(l),y=[];return null!=e&&d.sort(e===bl?function(n,t){return c[t]-c[n]}:function(n,t){return e(o[n],o[t])}),d.forEach(function(n){y[n]={data:o[n],value:a=c[n],startAngle:f,endAngle:f+=a*v+p,padAngle:h}}),y}var t=Number,e=bl,r=0,i=Ho,u=0;return n.value=function(e){return arguments.length?(t=e,n):t},n.sort=function(t){return arguments.length?(e=t,n):e},n.startAngle=function(t){return arguments.length?(r=t,n):r},n.endAngle=function(t){return arguments.length?(i=t,n):i},n.padAngle=function(t){return arguments.length?(u=t,n):u},n};var bl={};ao.layout.stack=function(){function n(a,l){if(!(h=a.length))return a;var c=a.map(function(e,r){return t.call(n,e,r)}),f=c.map(function(t){return t.map(function(t,e){return[u.call(n,t,e),o.call(n,t,e)]})}),s=e.call(n,f,l);c=ao.permute(c,s),f=ao.permute(f,s);var h,p,g,v,d=r.call(n,f,l),y=c[0].length;for(g=0;y>g;++g)for(i.call(n,c[0][g],v=d[g],f[0][g][1]),p=1;h>p;++p)i.call(n,c[p][g],v+=f[p-1][g][1],f[p][g][1]);return a}var t=m,e=gi,r=vi,i=pi,u=si,o=hi;return n.values=function(e){return arguments.length?(t=e,n):t},n.order=function(t){return arguments.length?(e="function"==typeof t?t:_l.get(t)||gi,n):e},n.offset=function(t){return arguments.length?(r="function"==typeof t?t:wl.get(t)||vi,n):r},n.x=function(t){return arguments.length?(u=t,n):u},n.y=function(t){return arguments.length?(o=t,n):o},n.out=function(t){return arguments.length?(i=t,n):i},n};var _l=ao.map({"inside-out":function(n){var t,e,r=n.length,i=n.map(di),u=n.map(yi),o=ao.range(r).sort(function(n,t){return i[n]-i[t]}),a=0,l=0,c=[],f=[];for(t=0;r>t;++t)e=o[t],l>a?(a+=u[e],c.push(e)):(l+=u[e],f.push(e));return f.reverse().concat(c)},reverse:function(n){return ao.range(n.length).reverse()},"default":gi}),wl=ao.map({silhouette:function(n){var t,e,r,i=n.length,u=n[0].length,o=[],a=0,l=[];for(e=0;u>e;++e){for(t=0,r=0;i>t;t++)r+=n[t][e][1];r>a&&(a=r),o.push(r)}for(e=0;u>e;++e)l[e]=(a-o[e])/2;return l},wiggle:function(n){var t,e,r,i,u,o,a,l,c,f=n.length,s=n[0],h=s.length,p=[];for(p[0]=l=c=0,e=1;h>e;++e){for(t=0,i=0;f>t;++t)i+=n[t][e][1];for(t=0,u=0,a=s[e][0]-s[e-1][0];f>t;++t){for(r=0,o=(n[t][e][1]-n[t][e-1][1])/(2*a);t>r;++r)o+=(n[r][e][1]-n[r][e-1][1])/a;u+=o*n[t][e][1]}p[e]=l-=i?u/i*a:0,c>l&&(c=l)}for(e=0;h>e;++e)p[e]-=c;return p},expand:function(n){var t,e,r,i=n.length,u=n[0].length,o=1/i,a=[];for(e=0;u>e;++e){for(t=0,r=0;i>t;t++)r+=n[t][e][1];if(r)for(t=0;i>t;t++)n[t][e][1]/=r;else for(t=0;i>t;t++)n[t][e][1]=o}for(e=0;u>e;++e)a[e]=0;return a},zero:vi});ao.layout.histogram=function(){function n(n,u){for(var o,a,l=[],c=n.map(e,this),f=r.call(this,c,u),s=i.call(this,f,c,u),u=-1,h=c.length,p=s.length-1,g=t?1:1/h;++u0)for(u=-1;++u=f[0]&&a<=f[1]&&(o=l[ao.bisect(s,a,1,p)-1],o.y+=g,o.push(n[u]));return l}var t=!0,e=Number,r=bi,i=Mi;return n.value=function(t){return arguments.length?(e=t,n):e},n.range=function(t){return arguments.length?(r=En(t),n):r},n.bins=function(t){return arguments.length?(i="number"==typeof t?function(n){return xi(n,t)}:En(t),n):i},n.frequency=function(e){return arguments.length?(t=!!e,n):t},n},ao.layout.pack=function(){function n(n,u){var o=e.call(this,n,u),a=o[0],l=i[0],c=i[1],f=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(a.x=a.y=0,oi(a,function(n){n.r=+f(n.value)}),oi(a,Ni),r){var s=r*(t?1:Math.max(2*a.r/l,2*a.r/c))/2;oi(a,function(n){n.r+=s}),oi(a,Ni),oi(a,function(n){n.r-=s})}return Ci(a,l/2,c/2,t?1:1/Math.max(2*a.r/l,2*a.r/c)),o}var t,e=ao.layout.hierarchy().sort(_i),r=0,i=[1,1];return n.size=function(t){return arguments.length?(i=t,n):i},n.radius=function(e){return arguments.length?(t=null==e||"function"==typeof e?e:+e,n):t},n.padding=function(t){return arguments.length?(r=+t,n):r},ii(n,e)},ao.layout.tree=function(){function n(n,i){var f=o.call(this,n,i),s=f[0],h=t(s);if(oi(h,e),h.parent.m=-h.z,ui(h,r),c)ui(s,u);else{var p=s,g=s,v=s;ui(s,function(n){n.xg.x&&(g=n),n.depth>v.depth&&(v=n)});var d=a(p,g)/2-p.x,y=l[0]/(g.x+a(g,p)/2+d),m=l[1]/(v.depth||1);ui(s,function(n){n.x=(n.x+d)*y,n.y=n.depth*m})}return f}function t(n){for(var t,e={A:null,children:[n]},r=[e];null!=(t=r.pop());)for(var i,u=t.children,o=0,a=u.length;a>o;++o)r.push((u[o]=i={_:u[o],parent:t,children:(i=u[o].children)&&i.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=i);return e.children[0]}function e(n){var t=n.children,e=n.parent.children,r=n.i?e[n.i-1]:null;if(t.length){Di(n);var u=(t[0].z+t[t.length-1].z)/2;r?(n.z=r.z+a(n._,r._),n.m=n.z-u):n.z=u}else r&&(n.z=r.z+a(n._,r._));n.parent.A=i(n,r,n.parent.A||e[0])}function r(n){n._.x=n.z+n.parent.m,n.m+=n.parent.m}function i(n,t,e){if(t){for(var r,i=n,u=n,o=t,l=i.parent.children[0],c=i.m,f=u.m,s=o.m,h=l.m;o=Ti(o),i=qi(i),o&&i;)l=qi(l),u=Ti(u),u.a=n,r=o.z+s-i.z-c+a(o._,i._),r>0&&(Ri(Pi(o,n,e),n,r),c+=r,f+=r),s+=o.m,c+=i.m,h+=l.m,f+=u.m;o&&!Ti(u)&&(u.t=o,u.m+=s-f),i&&!qi(l)&&(l.t=i,l.m+=c-h,e=n)}return e}function u(n){n.x*=l[0],n.y=n.depth*l[1]}var o=ao.layout.hierarchy().sort(null).value(null),a=Li,l=[1,1],c=null;return n.separation=function(t){return arguments.length?(a=t,n):a},n.size=function(t){return arguments.length?(c=null==(l=t)?u:null,n):c?null:l},n.nodeSize=function(t){return arguments.length?(c=null==(l=t)?null:u,n):c?l:null},ii(n,o)},ao.layout.cluster=function(){function n(n,u){var o,a=t.call(this,n,u),l=a[0],c=0;oi(l,function(n){var t=n.children;t&&t.length?(n.x=ji(t),n.y=Ui(t)):(n.x=o?c+=e(n,o):0,n.y=0,o=n)});var f=Fi(l),s=Hi(l),h=f.x-e(f,s)/2,p=s.x+e(s,f)/2;return oi(l,i?function(n){n.x=(n.x-l.x)*r[0],n.y=(l.y-n.y)*r[1]}:function(n){n.x=(n.x-h)/(p-h)*r[0],n.y=(1-(l.y?n.y/l.y:1))*r[1]}),a}var t=ao.layout.hierarchy().sort(null).value(null),e=Li,r=[1,1],i=!1;return n.separation=function(t){return arguments.length?(e=t,n):e},n.size=function(t){return arguments.length?(i=null==(r=t),n):i?null:r},n.nodeSize=function(t){return arguments.length?(i=null!=(r=t),n):i?r:null},ii(n,t)},ao.layout.treemap=function(){function n(n,t){for(var e,r,i=-1,u=n.length;++it?0:t),e.area=isNaN(r)||0>=r?0:r}function t(e){var u=e.children;if(u&&u.length){var o,a,l,c=s(e),f=[],h=u.slice(),g=1/0,v="slice"===p?c.dx:"dice"===p?c.dy:"slice-dice"===p?1&e.depth?c.dy:c.dx:Math.min(c.dx,c.dy);for(n(h,c.dx*c.dy/e.value),f.area=0;(l=h.length)>0;)f.push(o=h[l-1]),f.area+=o.area,"squarify"!==p||(a=r(f,v))<=g?(h.pop(),g=a):(f.area-=f.pop().area,i(f,v,c,!1),v=Math.min(c.dx,c.dy),f.length=f.area=0,g=1/0);f.length&&(i(f,v,c,!0),f.length=f.area=0),u.forEach(t)}}function e(t){var r=t.children;if(r&&r.length){var u,o=s(t),a=r.slice(),l=[];for(n(a,o.dx*o.dy/t.value),l.area=0;u=a.pop();)l.push(u),l.area+=u.area,null!=u.z&&(i(l,u.z?o.dx:o.dy,o,!a.length),l.length=l.area=0);r.forEach(e)}}function r(n,t){for(var e,r=n.area,i=0,u=1/0,o=-1,a=n.length;++oe&&(u=e),e>i&&(i=e));return r*=r,t*=t,r?Math.max(t*i*g/r,r/(t*u*g)):1/0}function i(n,t,e,r){var i,u=-1,o=n.length,a=e.x,c=e.y,f=t?l(n.area/t):0; -if(t==e.dx){for((r||f>e.dy)&&(f=e.dy);++ue.dx)&&(f=e.dx);++ue&&(t=1),1>e&&(n=0),function(){var e,r,i;do e=2*Math.random()-1,r=2*Math.random()-1,i=e*e+r*r;while(!i||i>1);return n+t*e*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var n=ao.random.normal.apply(ao,arguments);return function(){return Math.exp(n())}},bates:function(n){var t=ao.random.irwinHall(n);return function(){return t()/n}},irwinHall:function(n){return function(){for(var t=0,e=0;n>e;e++)t+=Math.random();return t}}},ao.scale={};var Sl={floor:m,ceil:m};ao.scale.linear=function(){return Wi([0,1],[0,1],Mr,!1)};var kl={s:1,g:1,p:1,r:1,e:1};ao.scale.log=function(){return ru(ao.scale.linear().domain([0,1]),10,!0,[1,10])};var Nl=ao.format(".0e"),El={floor:function(n){return-Math.ceil(-n)},ceil:function(n){return-Math.floor(-n)}};ao.scale.pow=function(){return iu(ao.scale.linear(),1,[0,1])},ao.scale.sqrt=function(){return ao.scale.pow().exponent(.5)},ao.scale.ordinal=function(){return ou([],{t:"range",a:[[]]})},ao.scale.category10=function(){return ao.scale.ordinal().range(Al)},ao.scale.category20=function(){return ao.scale.ordinal().range(Cl)},ao.scale.category20b=function(){return ao.scale.ordinal().range(zl)},ao.scale.category20c=function(){return ao.scale.ordinal().range(Ll)};var Al=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(xn),Cl=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(xn),zl=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(xn),Ll=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(xn);ao.scale.quantile=function(){return au([],[])},ao.scale.quantize=function(){return lu(0,1,[0,1])},ao.scale.threshold=function(){return cu([.5],[0,1])},ao.scale.identity=function(){return fu([0,1])},ao.svg={},ao.svg.arc=function(){function n(){var n=Math.max(0,+e.apply(this,arguments)),c=Math.max(0,+r.apply(this,arguments)),f=o.apply(this,arguments)-Io,s=a.apply(this,arguments)-Io,h=Math.abs(s-f),p=f>s?0:1;if(n>c&&(g=c,c=n,n=g),h>=Oo)return t(c,p)+(n?t(n,1-p):"")+"Z";var g,v,d,y,m,M,x,b,_,w,S,k,N=0,E=0,A=[];if((y=(+l.apply(this,arguments)||0)/2)&&(d=u===ql?Math.sqrt(n*n+c*c):+u.apply(this,arguments),p||(E*=-1),c&&(E=tn(d/c*Math.sin(y))),n&&(N=tn(d/n*Math.sin(y)))),c){m=c*Math.cos(f+E),M=c*Math.sin(f+E),x=c*Math.cos(s-E),b=c*Math.sin(s-E);var C=Math.abs(s-f-2*E)<=Fo?0:1;if(E&&yu(m,M,x,b)===p^C){var z=(f+s)/2;m=c*Math.cos(z),M=c*Math.sin(z),x=b=null}}else m=M=0;if(n){_=n*Math.cos(s-N),w=n*Math.sin(s-N),S=n*Math.cos(f+N),k=n*Math.sin(f+N);var L=Math.abs(f-s+2*N)<=Fo?0:1;if(N&&yu(_,w,S,k)===1-p^L){var q=(f+s)/2;_=n*Math.cos(q),w=n*Math.sin(q),S=k=null}}else _=w=0;if(h>Uo&&(g=Math.min(Math.abs(c-n)/2,+i.apply(this,arguments)))>.001){v=c>n^p?0:1;var T=g,R=g;if(Fo>h){var D=null==S?[_,w]:null==x?[m,M]:Re([m,M],[S,k],[x,b],[_,w]),P=m-D[0],U=M-D[1],j=x-D[0],F=b-D[1],H=1/Math.sin(Math.acos((P*j+U*F)/(Math.sqrt(P*P+U*U)*Math.sqrt(j*j+F*F)))/2),O=Math.sqrt(D[0]*D[0]+D[1]*D[1]);R=Math.min(g,(n-O)/(H-1)),T=Math.min(g,(c-O)/(H+1))}if(null!=x){var I=mu(null==S?[_,w]:[S,k],[m,M],c,T,p),Y=mu([x,b],[_,w],c,T,p);g===T?A.push("M",I[0],"A",T,",",T," 0 0,",v," ",I[1],"A",c,",",c," 0 ",1-p^yu(I[1][0],I[1][1],Y[1][0],Y[1][1]),",",p," ",Y[1],"A",T,",",T," 0 0,",v," ",Y[0]):A.push("M",I[0],"A",T,",",T," 0 1,",v," ",Y[0])}else A.push("M",m,",",M);if(null!=S){var Z=mu([m,M],[S,k],n,-R,p),V=mu([_,w],null==x?[m,M]:[x,b],n,-R,p);g===R?A.push("L",V[0],"A",R,",",R," 0 0,",v," ",V[1],"A",n,",",n," 0 ",p^yu(V[1][0],V[1][1],Z[1][0],Z[1][1]),",",1-p," ",Z[1],"A",R,",",R," 0 0,",v," ",Z[0]):A.push("L",V[0],"A",R,",",R," 0 0,",v," ",Z[0])}else A.push("L",_,",",w)}else A.push("M",m,",",M),null!=x&&A.push("A",c,",",c," 0 ",C,",",p," ",x,",",b),A.push("L",_,",",w),null!=S&&A.push("A",n,",",n," 0 ",L,",",1-p," ",S,",",k);return A.push("Z"),A.join("")}function t(n,t){return"M0,"+n+"A"+n+","+n+" 0 1,"+t+" 0,"+-n+"A"+n+","+n+" 0 1,"+t+" 0,"+n}var e=hu,r=pu,i=su,u=ql,o=gu,a=vu,l=du;return n.innerRadius=function(t){return arguments.length?(e=En(t),n):e},n.outerRadius=function(t){return arguments.length?(r=En(t),n):r},n.cornerRadius=function(t){return arguments.length?(i=En(t),n):i},n.padRadius=function(t){return arguments.length?(u=t==ql?ql:En(t),n):u},n.startAngle=function(t){return arguments.length?(o=En(t),n):o},n.endAngle=function(t){return arguments.length?(a=En(t),n):a},n.padAngle=function(t){return arguments.length?(l=En(t),n):l},n.centroid=function(){var n=(+e.apply(this,arguments)+ +r.apply(this,arguments))/2,t=(+o.apply(this,arguments)+ +a.apply(this,arguments))/2-Io;return[Math.cos(t)*n,Math.sin(t)*n]},n};var ql="auto";ao.svg.line=function(){return Mu(m)};var Tl=ao.map({linear:xu,"linear-closed":bu,step:_u,"step-before":wu,"step-after":Su,basis:zu,"basis-open":Lu,"basis-closed":qu,bundle:Tu,cardinal:Eu,"cardinal-open":ku,"cardinal-closed":Nu,monotone:Fu});Tl.forEach(function(n,t){t.key=n,t.closed=/-closed$/.test(n)});var Rl=[0,2/3,1/3,0],Dl=[0,1/3,2/3,0],Pl=[0,1/6,2/3,1/6];ao.svg.line.radial=function(){var n=Mu(Hu);return n.radius=n.x,delete n.x,n.angle=n.y,delete n.y,n},wu.reverse=Su,Su.reverse=wu,ao.svg.area=function(){return Ou(m)},ao.svg.area.radial=function(){var n=Ou(Hu);return n.radius=n.x,delete n.x,n.innerRadius=n.x0,delete n.x0,n.outerRadius=n.x1,delete n.x1,n.angle=n.y,delete n.y,n.startAngle=n.y0,delete n.y0,n.endAngle=n.y1,delete n.y1,n},ao.svg.chord=function(){function n(n,a){var l=t(this,u,n,a),c=t(this,o,n,a);return"M"+l.p0+r(l.r,l.p1,l.a1-l.a0)+(e(l,c)?i(l.r,l.p1,l.r,l.p0):i(l.r,l.p1,c.r,c.p0)+r(c.r,c.p1,c.a1-c.a0)+i(c.r,c.p1,l.r,l.p0))+"Z"}function t(n,t,e,r){var i=t.call(n,e,r),u=a.call(n,i,r),o=l.call(n,i,r)-Io,f=c.call(n,i,r)-Io;return{r:u,a0:o,a1:f,p0:[u*Math.cos(o),u*Math.sin(o)],p1:[u*Math.cos(f),u*Math.sin(f)]}}function e(n,t){return n.a0==t.a0&&n.a1==t.a1}function r(n,t,e){return"A"+n+","+n+" 0 "+ +(e>Fo)+",1 "+t}function i(n,t,e,r){return"Q 0,0 "+r}var u=Me,o=xe,a=Iu,l=gu,c=vu;return n.radius=function(t){return arguments.length?(a=En(t),n):a},n.source=function(t){return arguments.length?(u=En(t),n):u},n.target=function(t){return arguments.length?(o=En(t),n):o},n.startAngle=function(t){return arguments.length?(l=En(t),n):l},n.endAngle=function(t){return arguments.length?(c=En(t),n):c},n},ao.svg.diagonal=function(){function n(n,i){var u=t.call(this,n,i),o=e.call(this,n,i),a=(u.y+o.y)/2,l=[u,{x:u.x,y:a},{x:o.x,y:a},o];return l=l.map(r),"M"+l[0]+"C"+l[1]+" "+l[2]+" "+l[3]}var t=Me,e=xe,r=Yu;return n.source=function(e){return arguments.length?(t=En(e),n):t},n.target=function(t){return arguments.length?(e=En(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},ao.svg.diagonal.radial=function(){var n=ao.svg.diagonal(),t=Yu,e=n.projection;return n.projection=function(n){return arguments.length?e(Zu(t=n)):t},n},ao.svg.symbol=function(){function n(n,r){return(Ul.get(t.call(this,n,r))||$u)(e.call(this,n,r))}var t=Xu,e=Vu;return n.type=function(e){return arguments.length?(t=En(e),n):t},n.size=function(t){return arguments.length?(e=En(t),n):e},n};var Ul=ao.map({circle:$u,cross:function(n){var t=Math.sqrt(n/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(n){var t=Math.sqrt(n/(2*Fl)),e=t*Fl;return"M0,"+-t+"L"+e+",0 0,"+t+" "+-e+",0Z"},square:function(n){var t=Math.sqrt(n)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(n){var t=Math.sqrt(n/jl),e=t*jl/2;return"M0,"+e+"L"+t+","+-e+" "+-t+","+-e+"Z"},"triangle-up":function(n){var t=Math.sqrt(n/jl),e=t*jl/2;return"M0,"+-e+"L"+t+","+e+" "+-t+","+e+"Z"}});ao.svg.symbolTypes=Ul.keys();var jl=Math.sqrt(3),Fl=Math.tan(30*Yo);Co.transition=function(n){for(var t,e,r=Hl||++Zl,i=Ku(n),u=[],o=Ol||{time:Date.now(),ease:Nr,delay:0,duration:250},a=-1,l=this.length;++au;u++){i.push(t=[]);for(var e=this[u],a=0,l=e.length;l>a;a++)(r=e[a])&&n.call(r,r.__data__,a,u)&&t.push(r)}return Wu(i,this.namespace,this.id)},Yl.tween=function(n,t){var e=this.id,r=this.namespace;return arguments.length<2?this.node()[r][e].tween.get(n):Y(this,null==t?function(t){t[r][e].tween.remove(n)}:function(i){i[r][e].tween.set(n,t)})},Yl.attr=function(n,t){function e(){this.removeAttribute(a)}function r(){this.removeAttributeNS(a.space,a.local)}function i(n){return null==n?e:(n+="",function(){var t,e=this.getAttribute(a);return e!==n&&(t=o(e,n),function(n){this.setAttribute(a,t(n))})})}function u(n){return null==n?r:(n+="",function(){var t,e=this.getAttributeNS(a.space,a.local);return e!==n&&(t=o(e,n),function(n){this.setAttributeNS(a.space,a.local,t(n))})})}if(arguments.length<2){for(t in n)this.attr(t,n[t]);return this}var o="transform"==n?$r:Mr,a=ao.ns.qualify(n);return Ju(this,"attr."+n,t,a.local?u:i)},Yl.attrTween=function(n,t){function e(n,e){var r=t.call(this,n,e,this.getAttribute(i));return r&&function(n){this.setAttribute(i,r(n))}}function r(n,e){var r=t.call(this,n,e,this.getAttributeNS(i.space,i.local));return r&&function(n){this.setAttributeNS(i.space,i.local,r(n))}}var i=ao.ns.qualify(n);return this.tween("attr."+n,i.local?r:e)},Yl.style=function(n,e,r){function i(){this.style.removeProperty(n)}function u(e){return null==e?i:(e+="",function(){var i,u=t(this).getComputedStyle(this,null).getPropertyValue(n);return u!==e&&(i=Mr(u,e),function(t){this.style.setProperty(n,i(t),r)})})}var o=arguments.length;if(3>o){if("string"!=typeof n){2>o&&(e="");for(r in n)this.style(r,n[r],e);return this}r=""}return Ju(this,"style."+n,e,u)},Yl.styleTween=function(n,e,r){function i(i,u){var o=e.call(this,i,u,t(this).getComputedStyle(this,null).getPropertyValue(n));return o&&function(t){this.style.setProperty(n,o(t),r)}}return arguments.length<3&&(r=""),this.tween("style."+n,i)},Yl.text=function(n){return Ju(this,"text",n,Gu)},Yl.remove=function(){var n=this.namespace;return this.each("end.transition",function(){var t;this[n].count<2&&(t=this.parentNode)&&t.removeChild(this)})},Yl.ease=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].ease:("function"!=typeof n&&(n=ao.ease.apply(ao,arguments)),Y(this,function(r){r[e][t].ease=n}))},Yl.delay=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].delay:Y(this,"function"==typeof n?function(r,i,u){r[e][t].delay=+n.call(r,r.__data__,i,u)}:(n=+n,function(r){r[e][t].delay=n}))},Yl.duration=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].duration:Y(this,"function"==typeof n?function(r,i,u){r[e][t].duration=Math.max(1,n.call(r,r.__data__,i,u))}:(n=Math.max(1,n),function(r){r[e][t].duration=n}))},Yl.each=function(n,t){var e=this.id,r=this.namespace;if(arguments.length<2){var i=Ol,u=Hl;try{Hl=e,Y(this,function(t,i,u){Ol=t[r][e],n.call(t,t.__data__,i,u)})}finally{Ol=i,Hl=u}}else Y(this,function(i){var u=i[r][e];(u.event||(u.event=ao.dispatch("start","end","interrupt"))).on(n,t)});return this},Yl.transition=function(){for(var n,t,e,r,i=this.id,u=++Zl,o=this.namespace,a=[],l=0,c=this.length;c>l;l++){a.push(n=[]);for(var t=this[l],f=0,s=t.length;s>f;f++)(e=t[f])&&(r=e[o][i],Qu(e,f,o,u,{time:r.time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration})),n.push(e)}return Wu(a,o,u)},ao.svg.axis=function(){function n(n){n.each(function(){var n,c=ao.select(this),f=this.__chart__||e,s=this.__chart__=e.copy(),h=null==l?s.ticks?s.ticks.apply(s,a):s.domain():l,p=null==t?s.tickFormat?s.tickFormat.apply(s,a):m:t,g=c.selectAll(".tick").data(h,s),v=g.enter().insert("g",".domain").attr("class","tick").style("opacity",Uo),d=ao.transition(g.exit()).style("opacity",Uo).remove(),y=ao.transition(g.order()).style("opacity",1),M=Math.max(i,0)+o,x=Zi(s),b=c.selectAll(".domain").data([0]),_=(b.enter().append("path").attr("class","domain"),ao.transition(b));v.append("line"),v.append("text");var w,S,k,N,E=v.select("line"),A=y.select("line"),C=g.select("text").text(p),z=v.select("text"),L=y.select("text"),q="top"===r||"left"===r?-1:1;if("bottom"===r||"top"===r?(n=no,w="x",k="y",S="x2",N="y2",C.attr("dy",0>q?"0em":".71em").style("text-anchor","middle"),_.attr("d","M"+x[0]+","+q*u+"V0H"+x[1]+"V"+q*u)):(n=to,w="y",k="x",S="y2",N="x2",C.attr("dy",".32em").style("text-anchor",0>q?"end":"start"),_.attr("d","M"+q*u+","+x[0]+"H0V"+x[1]+"H"+q*u)),E.attr(N,q*i),z.attr(k,q*M),A.attr(S,0).attr(N,q*i),L.attr(w,0).attr(k,q*M),s.rangeBand){var T=s,R=T.rangeBand()/2;f=s=function(n){return T(n)+R}}else f.rangeBand?f=s:d.call(n,s,f);v.call(n,f,s),y.call(n,s,s)})}var t,e=ao.scale.linear(),r=Vl,i=6,u=6,o=3,a=[10],l=null;return n.scale=function(t){return arguments.length?(e=t,n):e},n.orient=function(t){return arguments.length?(r=t in Xl?t+"":Vl,n):r},n.ticks=function(){return arguments.length?(a=co(arguments),n):a},n.tickValues=function(t){return arguments.length?(l=t,n):l},n.tickFormat=function(e){return arguments.length?(t=e,n):t},n.tickSize=function(t){var e=arguments.length;return e?(i=+t,u=+arguments[e-1],n):i},n.innerTickSize=function(t){return arguments.length?(i=+t,n):i},n.outerTickSize=function(t){return arguments.length?(u=+t,n):u},n.tickPadding=function(t){return arguments.length?(o=+t,n):o},n.tickSubdivide=function(){return arguments.length&&n},n};var Vl="bottom",Xl={top:1,right:1,bottom:1,left:1};ao.svg.brush=function(){function n(t){t.each(function(){var t=ao.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",u).on("touchstart.brush",u),o=t.selectAll(".background").data([0]);o.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),t.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var a=t.selectAll(".resize").data(v,m);a.exit().remove(),a.enter().append("g").attr("class",function(n){return"resize "+n}).style("cursor",function(n){return $l[n]}).append("rect").attr("x",function(n){return/[ew]$/.test(n)?-3:null}).attr("y",function(n){return/^[ns]/.test(n)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),a.style("display",n.empty()?"none":null);var l,s=ao.transition(t),h=ao.transition(o);c&&(l=Zi(c),h.attr("x",l[0]).attr("width",l[1]-l[0]),r(s)),f&&(l=Zi(f),h.attr("y",l[0]).attr("height",l[1]-l[0]),i(s)),e(s)})}function e(n){n.selectAll(".resize").attr("transform",function(n){return"translate("+s[+/e$/.test(n)]+","+h[+/^s/.test(n)]+")"})}function r(n){n.select(".extent").attr("x",s[0]),n.selectAll(".extent,.n>rect,.s>rect").attr("width",s[1]-s[0])}function i(n){n.select(".extent").attr("y",h[0]),n.selectAll(".extent,.e>rect,.w>rect").attr("height",h[1]-h[0])}function u(){function u(){32==ao.event.keyCode&&(C||(M=null,L[0]-=s[1],L[1]-=h[1],C=2),S())}function v(){32==ao.event.keyCode&&2==C&&(L[0]+=s[1],L[1]+=h[1],C=0,S())}function d(){var n=ao.mouse(b),t=!1;x&&(n[0]+=x[0],n[1]+=x[1]),C||(ao.event.altKey?(M||(M=[(s[0]+s[1])/2,(h[0]+h[1])/2]),L[0]=s[+(n[0]f?(i=r,r=f):i=f),v[0]!=r||v[1]!=i?(e?a=null:o=null,v[0]=r,v[1]=i,!0):void 0}function m(){d(),k.style("pointer-events","all").selectAll(".resize").style("display",n.empty()?"none":null),ao.select("body").style("cursor",null),q.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),z(),w({type:"brushend"})}var M,x,b=this,_=ao.select(ao.event.target),w=l.of(b,arguments),k=ao.select(b),N=_.datum(),E=!/^(n|s)$/.test(N)&&c,A=!/^(e|w)$/.test(N)&&f,C=_.classed("extent"),z=W(b),L=ao.mouse(b),q=ao.select(t(b)).on("keydown.brush",u).on("keyup.brush",v);if(ao.event.changedTouches?q.on("touchmove.brush",d).on("touchend.brush",m):q.on("mousemove.brush",d).on("mouseup.brush",m),k.interrupt().selectAll("*").interrupt(),C)L[0]=s[0]-L[0],L[1]=h[0]-L[1];else if(N){var T=+/w$/.test(N),R=+/^n/.test(N);x=[s[1-T]-L[0],h[1-R]-L[1]],L[0]=s[T],L[1]=h[R]}else ao.event.altKey&&(M=L.slice());k.style("pointer-events","none").selectAll(".resize").style("display",null),ao.select("body").style("cursor",_.style("cursor")),w({type:"brushstart"}),d()}var o,a,l=N(n,"brushstart","brush","brushend"),c=null,f=null,s=[0,0],h=[0,0],p=!0,g=!0,v=Bl[0];return n.event=function(n){n.each(function(){var n=l.of(this,arguments),t={x:s,y:h,i:o,j:a},e=this.__chart__||t;this.__chart__=t,Hl?ao.select(this).transition().each("start.brush",function(){o=e.i,a=e.j,s=e.x,h=e.y,n({type:"brushstart"})}).tween("brush:brush",function(){var e=xr(s,t.x),r=xr(h,t.y);return o=a=null,function(i){s=t.x=e(i),h=t.y=r(i),n({type:"brush",mode:"resize"})}}).each("end.brush",function(){o=t.i,a=t.j,n({type:"brush",mode:"resize"}),n({type:"brushend"})}):(n({type:"brushstart"}),n({type:"brush",mode:"resize"}),n({type:"brushend"}))})},n.x=function(t){return arguments.length?(c=t,v=Bl[!c<<1|!f],n):c},n.y=function(t){return arguments.length?(f=t,v=Bl[!c<<1|!f],n):f},n.clamp=function(t){return arguments.length?(c&&f?(p=!!t[0],g=!!t[1]):c?p=!!t:f&&(g=!!t),n):c&&f?[p,g]:c?p:f?g:null},n.extent=function(t){var e,r,i,u,l;return arguments.length?(c&&(e=t[0],r=t[1],f&&(e=e[0],r=r[0]),o=[e,r],c.invert&&(e=c(e),r=c(r)),e>r&&(l=e,e=r,r=l),e==s[0]&&r==s[1]||(s=[e,r])),f&&(i=t[0],u=t[1],c&&(i=i[1],u=u[1]),a=[i,u],f.invert&&(i=f(i),u=f(u)),i>u&&(l=i,i=u,u=l),i==h[0]&&u==h[1]||(h=[i,u])),n):(c&&(o?(e=o[0],r=o[1]):(e=s[0],r=s[1],c.invert&&(e=c.invert(e),r=c.invert(r)),e>r&&(l=e,e=r,r=l))),f&&(a?(i=a[0],u=a[1]):(i=h[0],u=h[1],f.invert&&(i=f.invert(i),u=f.invert(u)),i>u&&(l=i,i=u,u=l))),c&&f?[[e,i],[r,u]]:c?[e,r]:f&&[i,u])},n.clear=function(){return n.empty()||(s=[0,0],h=[0,0],o=a=null),n},n.empty=function(){return!!c&&s[0]==s[1]||!!f&&h[0]==h[1]},ao.rebind(n,l,"on")};var $l={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Bl=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Wl=ga.format=xa.timeFormat,Jl=Wl.utc,Gl=Jl("%Y-%m-%dT%H:%M:%S.%LZ");Wl.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?eo:Gl,eo.parse=function(n){var t=new Date(n);return isNaN(t)?null:t},eo.toString=Gl.toString,ga.second=On(function(n){return new va(1e3*Math.floor(n/1e3))},function(n,t){n.setTime(n.getTime()+1e3*Math.floor(t))},function(n){return n.getSeconds()}),ga.seconds=ga.second.range,ga.seconds.utc=ga.second.utc.range,ga.minute=On(function(n){return new va(6e4*Math.floor(n/6e4))},function(n,t){n.setTime(n.getTime()+6e4*Math.floor(t))},function(n){return n.getMinutes()}),ga.minutes=ga.minute.range,ga.minutes.utc=ga.minute.utc.range,ga.hour=On(function(n){var t=n.getTimezoneOffset()/60;return new va(36e5*(Math.floor(n/36e5-t)+t))},function(n,t){n.setTime(n.getTime()+36e5*Math.floor(t))},function(n){return n.getHours()}),ga.hours=ga.hour.range,ga.hours.utc=ga.hour.utc.range,ga.month=On(function(n){return n=ga.day(n),n.setDate(1),n},function(n,t){n.setMonth(n.getMonth()+t)},function(n){return n.getMonth()}),ga.months=ga.month.range,ga.months.utc=ga.month.utc.range;var Kl=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Ql=[[ga.second,1],[ga.second,5],[ga.second,15],[ga.second,30],[ga.minute,1],[ga.minute,5],[ga.minute,15],[ga.minute,30],[ga.hour,1],[ga.hour,3],[ga.hour,6],[ga.hour,12],[ga.day,1],[ga.day,2],[ga.week,1],[ga.month,1],[ga.month,3],[ga.year,1]],nc=Wl.multi([[".%L",function(n){return n.getMilliseconds()}],[":%S",function(n){return n.getSeconds()}],["%I:%M",function(n){return n.getMinutes()}],["%I %p",function(n){return n.getHours()}],["%a %d",function(n){return n.getDay()&&1!=n.getDate()}],["%b %d",function(n){return 1!=n.getDate()}],["%B",function(n){return n.getMonth()}],["%Y",zt]]),tc={range:function(n,t,e){return ao.range(Math.ceil(n/e)*e,+t,e).map(io)},floor:m,ceil:m};Ql.year=ga.year,ga.scale=function(){return ro(ao.scale.linear(),Ql,nc)};var ec=Ql.map(function(n){return[n[0].utc,n[1]]}),rc=Jl.multi([[".%L",function(n){return n.getUTCMilliseconds()}],[":%S",function(n){return n.getUTCSeconds()}],["%I:%M",function(n){return n.getUTCMinutes()}],["%I %p",function(n){return n.getUTCHours()}],["%a %d",function(n){return n.getUTCDay()&&1!=n.getUTCDate()}],["%b %d",function(n){return 1!=n.getUTCDate()}],["%B",function(n){return n.getUTCMonth()}],["%Y",zt]]);ec.year=ga.year.utc,ga.scale.utc=function(){return ro(ao.scale.linear(),ec,rc)},ao.text=An(function(n){return n.responseText}),ao.json=function(n,t){return Cn(n,"application/json",uo,t)},ao.html=function(n,t){return Cn(n,"text/html",oo,t)},ao.xml=An(function(n){return n.responseXML}),"function"==typeof define&&define.amd?(this.d3=ao,define(ao)):"object"==typeof module&&module.exports?module.exports=ao:this.d3=ao}(); \ No newline at end of file diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/js/file.js b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/js/file.js deleted file mode 100644 index 29cacd4..0000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/js/file.js +++ /dev/null @@ -1,62 +0,0 @@ - $(function() { - var $window = $(window) - , $top_link = $('#toplink') - , $body = $('body, html') - , offset = $('#code').offset().top - , hidePopover = function ($target) { - $target.data('popover-hover', false); - - setTimeout(function () { - if (!$target.data('popover-hover')) { - $target.popover('hide'); - } - }, 300); - }; - - $top_link.hide().click(function(event) { - event.preventDefault(); - $body.animate({scrollTop:0}, 800); - }); - - $window.scroll(function() { - if($window.scrollTop() > offset) { - $top_link.fadeIn(); - } else { - $top_link.fadeOut(); - } - }).scroll(); - - $('.popin') - .popover({trigger: 'manual'}) - .on({ - 'mouseenter.popover': function () { - var $target = $(this); - var $container = $target.children().first(); - - $target.data('popover-hover', true); - - // popover already displayed - if ($target.next('.popover').length) { - return; - } - - // show the popover - $container.popover('show'); - - // register mouse events on the popover - $target.next('.popover:not(.popover-initialized)') - .on({ - 'mouseenter': function () { - $target.data('popover-hover', true); - }, - 'mouseleave': function () { - hidePopover($container); - } - }) - .addClass('popover-initialized'); - }, - 'mouseleave.popover': function () { - hidePopover($(this).children().first()); - } - }); - }); diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/js/jquery.min.js b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/js/jquery.min.js deleted file mode 100644 index a1c07fd..0000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/js/jquery.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! jQuery v3.4.1 | (c) JS Foundation and other contributors | jquery.org/license */ -!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],E=C.document,r=Object.getPrototypeOf,s=t.slice,g=t.concat,u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.4.1",k=function(e,t){return new k.fn.init(e,t)},p=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function d(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp($),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+$),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ne=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(m.childNodes),m.childNodes),t[m.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&((e?e.ownerDocument||e:m)!==C&&T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!A[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&U.test(t)){(s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=k),o=(l=h(t)).length;while(o--)l[o]="#"+s+" "+xe(l[o]);c=l.join(","),f=ee.test(t)&&ye(e.parentNode)||e}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){A(t,!0)}finally{s===k&&e.removeAttribute("id")}}}return g(t.replace(B,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[k]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:m;return r!==C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),m!==C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=k,!C.getElementsByName||!C.getElementsByName(k).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+k+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+k+"+*").length||v.push(".#.+[+~]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",$)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e===C||e.ownerDocument===m&&y(m,e)?-1:t===C||t.ownerDocument===m&&y(m,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===C?-1:t===C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]===m?-1:s[r]===m?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if((e.ownerDocument||e)!==C&&T(e),d.matchesSelector&&E&&!A[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){A(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=p[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&p(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?k.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?k.grep(e,function(e){return e===n!==r}):"string"!=typeof n?k.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(k.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:L.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof k?t[0]:t,k.merge(this,k.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),D.test(r[1])&&k.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(k):k.makeArray(e,this)}).prototype=k.fn,q=k(E);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}k.fn.extend({has:function(e){var t=k(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?k.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;nx",y.noCloneChecked=!!me.cloneNode(!0).lastChild.defaultValue;var Te=/^key/,Ce=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ee=/^([^.]*)(?:\.(.+)|)/;function ke(){return!0}function Se(){return!1}function Ne(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function Ae(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ae(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Se;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return k().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=k.guid++)),e.each(function(){k.event.add(this,t,i,r,n)})}function De(e,i,o){o?(Q.set(e,i,!1),k.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Q.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(k.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Q.set(this,i,r),t=o(this,i),this[i](),r!==(n=Q.get(this,i))||t?Q.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n.value}else r.length&&(Q.set(this,i,{value:k.event.trigger(k.extend(r[0],k.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Q.get(e,i)&&k.event.add(e,i,ke)}k.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.get(t);if(v){n.handler&&(n=(o=n).handler,i=o.selector),i&&k.find.matchesSelector(ie,i),n.guid||(n.guid=k.guid++),(u=v.events)||(u=v.events={}),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof k&&k.event.triggered!==e.type?k.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(R)||[""]).length;while(l--)d=g=(s=Ee.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=k.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=k.event.special[d]||{},c=k.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&k.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),k.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.hasData(e)&&Q.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(R)||[""]).length;while(l--)if(d=g=(s=Ee.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=k.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||k.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)k.event.remove(e,d+t[l],n,r,!0);k.isEmptyObject(u)&&Q.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=k.event.fix(e),u=new Array(arguments.length),l=(Q.get(this,"events")||{})[s.type]||[],c=k.event.special[s.type]||{};for(u[0]=s,t=1;t\x20\t\r\n\f]*)[^>]*)\/>/gi,qe=/\s*$/g;function Oe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&k(e).children("tbody")[0]||e}function Pe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Re(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Me(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(Q.hasData(e)&&(o=Q.access(e),a=Q.set(t,o),l=o.events))for(i in delete a.handle,a.events={},l)for(n=0,r=l[i].length;n")},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=oe(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||k.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Vt,Gt=[],Yt=/(=)\?(?=&|$)|\?\?/;k.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Gt.pop()||k.expando+"_"+kt++;return this[e]=!0,e}}),k.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Yt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Yt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Yt,"$1"+r):!1!==e.jsonp&&(e.url+=(St.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||k.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?k(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Gt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Vt=E.implementation.createHTMLDocument("").body).innerHTML="
",2===Vt.childNodes.length),k.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=D.exec(e))?[t.createElement(i[1])]:(i=we([e],t,o),o&&o.length&&k(o).remove(),k.merge([],i.childNodes)));var r,i,o},k.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(k.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},k.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){k.fn[t]=function(e){return this.on(t,e)}}),k.expr.pseudos.animated=function(t){return k.grep(k.timers,function(e){return t===e.elem}).length},k.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=k.css(e,"position"),c=k(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=k.css(e,"top"),u=k.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,k.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},k.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){k.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===k.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===k.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=k(e).offset()).top+=k.css(e,"borderTopWidth",!0),i.left+=k.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-k.css(r,"marginTop",!0),left:t.left-i.left-k.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===k.css(e,"position"))e=e.offsetParent;return e||ie})}}),k.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;k.fn[t]=function(e){return _(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),k.each(["top","left"],function(e,n){k.cssHooks[n]=ze(y.pixelPosition,function(e,t){if(t)return t=_e(e,n),$e.test(t)?k(e).position()[n]+"px":t})}),k.each({Height:"height",Width:"width"},function(a,s){k.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){k.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return _(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?k.css(e,t,i):k.style(e,t,n,i)},s,n?e:void 0,n)}})}),k.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){k.fn[n]=function(e,t){return 0f&&(e=a.render.queue[f]);f++)d=e.generate(),typeof e.callback==typeof Function&&e.callback(d);a.render.queue.splice(0,f),a.render.queue.length?setTimeout(c):(a.dispatch.render_end(),a.render.active=!1)};setTimeout(c)},a.render.active=!1,a.render.queue=[],a.addGraph=function(b){typeof arguments[0]==typeof Function&&(b={generate:arguments[0],callback:arguments[1]}),a.render.queue.push(b),a.render.active||a.render()},"undefined"!=typeof module&&"undefined"!=typeof exports&&(module.exports=a),"undefined"!=typeof window&&(window.nv=a),a.dom.write=function(a){return void 0!==window.fastdom?fastdom.write(a):a()},a.dom.read=function(a){return void 0!==window.fastdom?fastdom.read(a):a()},a.interactiveGuideline=function(){"use strict";function b(l){l.each(function(l){function m(){var a=d3.mouse(this),d=a[0],e=a[1],i=!0,j=!1;if(k&&(d=d3.event.offsetX,e=d3.event.offsetY,"svg"!==d3.event.target.tagName&&(i=!1),d3.event.target.className.baseVal.match("nv-legend")&&(j=!0)),i&&(d-=f.left,e-=f.top),0>d||0>e||d>o||e>p||d3.event.relatedTarget&&void 0===d3.event.relatedTarget.ownerSVGElement||j){if(k&&d3.event.relatedTarget&&void 0===d3.event.relatedTarget.ownerSVGElement&&(void 0===d3.event.relatedTarget.className||d3.event.relatedTarget.className.match(c.nvPointerEventsClass)))return;return h.elementMouseout({mouseX:d,mouseY:e}),b.renderGuideLine(null),void c.hidden(!0)}c.hidden(!1);var l=g.invert(d);h.elementMousemove({mouseX:d,mouseY:e,pointXValue:l}),"dblclick"===d3.event.type&&h.elementDblclick({mouseX:d,mouseY:e,pointXValue:l}),"click"===d3.event.type&&h.elementClick({mouseX:d,mouseY:e,pointXValue:l})}var n=d3.select(this),o=d||960,p=e||400,q=n.selectAll("g.nv-wrap.nv-interactiveLineLayer").data([l]),r=q.enter().append("g").attr("class"," nv-wrap nv-interactiveLineLayer");r.append("g").attr("class","nv-interactiveGuideLine"),j&&(j.on("touchmove",m).on("mousemove",m,!0).on("mouseout",m,!0).on("dblclick",m).on("click",m),b.guideLine=null,b.renderGuideLine=function(c){i&&(b.guideLine&&b.guideLine.attr("x1")===c||a.dom.write(function(){var b=q.select(".nv-interactiveGuideLine").selectAll("line").data(null!=c?[a.utils.NaNtoZero(c)]:[],String);b.enter().append("line").attr("class","nv-guideline").attr("x1",function(a){return a}).attr("x2",function(a){return a}).attr("y1",p).attr("y2",0),b.exit().remove()}))})})}var c=a.models.tooltip();c.duration(0).hideDelay(0)._isInteractiveLayer(!0).hidden(!1);var d=null,e=null,f={left:0,top:0},g=d3.scale.linear(),h=d3.dispatch("elementMousemove","elementMouseout","elementClick","elementDblclick"),i=!0,j=null,k="ActiveXObject"in window;return b.dispatch=h,b.tooltip=c,b.margin=function(a){return arguments.length?(f.top="undefined"!=typeof a.top?a.top:f.top,f.left="undefined"!=typeof a.left?a.left:f.left,b):f},b.width=function(a){return arguments.length?(d=a,b):d},b.height=function(a){return arguments.length?(e=a,b):e},b.xScale=function(a){return arguments.length?(g=a,b):g},b.showGuideLine=function(a){return arguments.length?(i=a,b):i},b.svgContainer=function(a){return arguments.length?(j=a,b):j},b},a.interactiveBisect=function(a,b,c){"use strict";if(!(a instanceof Array))return null;var d;d="function"!=typeof c?function(a){return a.x}:c;var e=function(a,b){return d(a)-b},f=d3.bisector(e).left,g=d3.max([0,f(a,b)-1]),h=d(a[g]);if("undefined"==typeof h&&(h=g),h===b)return g;var i=d3.min([g+1,a.length-1]),j=d(a[i]);return"undefined"==typeof j&&(j=i),Math.abs(j-b)>=Math.abs(h-b)?g:i},a.nearestValueIndex=function(a,b,c){"use strict";var d=1/0,e=null;return a.forEach(function(a,f){var g=Math.abs(b-a);null!=a&&d>=g&&c>g&&(d=g,e=f)}),e},function(){"use strict";a.models.tooltip=function(){function b(){if(k){var a=d3.select(k);"svg"!==a.node().tagName&&(a=a.select("svg"));var b=a.node()?a.attr("viewBox"):null;if(b){b=b.split(" ");var c=parseInt(a.style("width"),10)/b[2];p.left=p.left*c,p.top=p.top*c}}}function c(){if(!n){var a;a=k?k:document.body,n=d3.select(a).append("div").attr("class","nvtooltip "+(j?j:"xy-tooltip")).attr("id",v),n.style("top",0).style("left",0),n.style("opacity",0),n.selectAll("div, table, td, tr").classed(w,!0),n.classed(w,!0),o=n.node()}}function d(){if(r&&B(e)){b();var f=p.left,g=null!==i?i:p.top;return a.dom.write(function(){c();var b=A(e);b&&(o.innerHTML=b),k&&u?a.dom.read(function(){var a=k.getElementsByTagName("svg")[0],b={left:0,top:0};if(a){var c=a.getBoundingClientRect(),d=k.getBoundingClientRect(),e=c.top;if(0>e){var i=k.getBoundingClientRect();e=Math.abs(e)>i.height?0:e}b.top=Math.abs(e-d.top),b.left=Math.abs(c.left-d.left)}f+=k.offsetLeft+b.left-2*k.scrollLeft,g+=k.offsetTop+b.top-2*k.scrollTop,h&&h>0&&(g=Math.floor(g/h)*h),C([f,g])}):C([f,g])}),d}}var e=null,f="w",g=25,h=0,i=null,j=null,k=null,l=!0,m=400,n=null,o=null,p={left:null,top:null},q={left:0,top:0},r=!0,s=100,t=!0,u=!1,v="nvtooltip-"+Math.floor(1e5*Math.random()),w="nv-pointer-events-none",x=function(a){return a},y=function(a){return a},z=function(a){return a},A=function(a){if(null===a)return"";var b=d3.select(document.createElement("table"));if(t){var c=b.selectAll("thead").data([a]).enter().append("thead");c.append("tr").append("td").attr("colspan",3).append("strong").classed("x-value",!0).html(y(a.value))}var d=b.selectAll("tbody").data([a]).enter().append("tbody"),e=d.selectAll("tr").data(function(a){return a.series}).enter().append("tr").classed("highlight",function(a){return a.highlight});e.append("td").classed("legend-color-guide",!0).append("div").style("background-color",function(a){return a.color}),e.append("td").classed("key",!0).html(function(a,b){return z(a.key,b)}),e.append("td").classed("value",!0).html(function(a,b){return x(a.value,b)}),e.selectAll("td").each(function(a){if(a.highlight){var b=d3.scale.linear().domain([0,1]).range(["#fff",a.color]),c=.6;d3.select(this).style("border-bottom-color",b(c)).style("border-top-color",b(c))}});var f=b.node().outerHTML;return void 0!==a.footer&&(f+=""),f},B=function(a){if(a&&a.series){if(a.series instanceof Array)return!!a.series.length;if(a.series instanceof Object)return a.series=[a.series],!0}return!1},C=function(b){o&&a.dom.read(function(){var c,d,e=parseInt(o.offsetHeight,10),h=parseInt(o.offsetWidth,10),i=a.utils.windowSize().width,j=a.utils.windowSize().height,k=window.pageYOffset,p=window.pageXOffset;j=window.innerWidth>=document.body.scrollWidth?j:j-16,i=window.innerHeight>=document.body.scrollHeight?i:i-16;var r,t,u=function(a){var b=d;do isNaN(a.offsetTop)||(b+=a.offsetTop),a=a.offsetParent;while(a);return b},v=function(a){var b=c;do isNaN(a.offsetLeft)||(b+=a.offsetLeft),a=a.offsetParent;while(a);return b};switch(f){case"e":c=b[0]-h-g,d=b[1]-e/2,r=v(o),t=u(o),p>r&&(c=b[0]+g>p?b[0]+g:p-r+c),k>t&&(d=k-t+d),t+e>k+j&&(d=k+j-t+d-e);break;case"w":c=b[0]+g,d=b[1]-e/2,r=v(o),t=u(o),r+h>i&&(c=b[0]-h-g),k>t&&(d=k+5),t+e>k+j&&(d=k+j-t+d-e);break;case"n":c=b[0]-h/2-5,d=b[1]+g,r=v(o),t=u(o),p>r&&(c=p+5),r+h>i&&(c=c-h/2+5),t+e>k+j&&(d=k+j-t+d-e);break;case"s":c=b[0]-h/2,d=b[1]-e-g,r=v(o),t=u(o),p>r&&(c=p+5),r+h>i&&(c=c-h/2+5),k>t&&(d=k);break;case"none":c=b[0],d=b[1]-g,r=v(o),t=u(o)}c-=q.left,d-=q.top;var w=o.getBoundingClientRect(),k=window.pageYOffset||document.documentElement.scrollTop,p=window.pageXOffset||document.documentElement.scrollLeft,x="translate("+(w.left+p)+"px, "+(w.top+k)+"px)",y="translate("+c+"px, "+d+"px)",z=d3.interpolateString(x,y),A=n.style("opacity")<.1;l?n.transition().delay(m).duration(0).style("opacity",0):n.interrupt().transition().duration(A?0:s).styleTween("transform",function(){return z},"important").style("-webkit-transform",y).style("opacity",1)})};return d.nvPointerEventsClass=w,d.options=a.utils.optionsFunc.bind(d),d._options=Object.create({},{duration:{get:function(){return s},set:function(a){s=a}},gravity:{get:function(){return f},set:function(a){f=a}},distance:{get:function(){return g},set:function(a){g=a}},snapDistance:{get:function(){return h},set:function(a){h=a}},classes:{get:function(){return j},set:function(a){j=a}},chartContainer:{get:function(){return k},set:function(a){k=a}},fixedTop:{get:function(){return i},set:function(a){i=a}},enabled:{get:function(){return r},set:function(a){r=a}},hideDelay:{get:function(){return m},set:function(a){m=a}},contentGenerator:{get:function(){return A},set:function(a){A=a}},valueFormatter:{get:function(){return x},set:function(a){x=a}},headerFormatter:{get:function(){return y},set:function(a){y=a}},keyFormatter:{get:function(){return z},set:function(a){z=a}},headerEnabled:{get:function(){return t},set:function(a){t=a}},_isInteractiveLayer:{get:function(){return u},set:function(a){u=!!a}},position:{get:function(){return p},set:function(a){p.left=void 0!==a.left?a.left:p.left,p.top=void 0!==a.top?a.top:p.top}},offset:{get:function(){return q},set:function(a){q.left=void 0!==a.left?a.left:q.left,q.top=void 0!==a.top?a.top:q.top}},hidden:{get:function(){return l},set:function(a){l!=a&&(l=!!a,d())}},data:{get:function(){return e},set:function(a){a.point&&(a.value=a.point.x,a.series=a.series||{},a.series.value=a.point.y,a.series.color=a.point.color||a.series.color),e=a}},tooltipElem:{get:function(){return o},set:function(){}},id:{get:function(){return v},set:function(){}}}),a.utils.initOptions(d),d}}(),a.utils.windowSize=function(){var a={width:640,height:480};return window.innerWidth&&window.innerHeight?(a.width=window.innerWidth,a.height=window.innerHeight,a):"CSS1Compat"==document.compatMode&&document.documentElement&&document.documentElement.offsetWidth?(a.width=document.documentElement.offsetWidth,a.height=document.documentElement.offsetHeight,a):document.body&&document.body.offsetWidth?(a.width=document.body.offsetWidth,a.height=document.body.offsetHeight,a):a},a.utils.windowResize=function(b){return window.addEventListener?window.addEventListener("resize",b):a.log("ERROR: Failed to bind to window.resize with: ",b),{callback:b,clear:function(){window.removeEventListener("resize",b)}}},a.utils.getColor=function(b){if(void 0===b)return a.utils.defaultColor();if(Array.isArray(b)){var c=d3.scale.ordinal().range(b);return function(a,b){var d=void 0===b?a:b;return a.color||c(d)}}return b},a.utils.defaultColor=function(){return a.utils.getColor(d3.scale.category20().range())},a.utils.customTheme=function(a,b,c){b=b||function(a){return a.key},c=c||d3.scale.category20().range();var d=c.length;return function(e){var f=b(e);return"function"==typeof a[f]?a[f]():void 0!==a[f]?a[f]:(d||(d=c.length),d-=1,c[d])}},a.utils.pjax=function(b,c){var d=function(d){d3.html(d,function(d){var e=d3.select(c).node();e.parentNode.replaceChild(d3.select(d).select(c).node(),e),a.utils.pjax(b,c)})};d3.selectAll(b).on("click",function(){history.pushState(this.href,this.textContent,this.href),d(this.href),d3.event.preventDefault()}),d3.select(window).on("popstate",function(){d3.event.state&&d(d3.event.state)})},a.utils.calcApproxTextWidth=function(a){if("function"==typeof a.style&&"function"==typeof a.text){var b=parseInt(a.style("font-size").replace("px",""),10),c=a.text().length;return c*b*.5}return 0},a.utils.NaNtoZero=function(a){return"number"!=typeof a||isNaN(a)||null===a||1/0===a||a===-1/0?0:a},d3.selection.prototype.watchTransition=function(a){var b=[this].concat([].slice.call(arguments,1));return a.transition.apply(a,b)},a.utils.renderWatch=function(b,c){if(!(this instanceof a.utils.renderWatch))return new a.utils.renderWatch(b,c);var d=void 0!==c?c:250,e=[],f=this;this.models=function(a){return a=[].slice.call(arguments,0),a.forEach(function(a){a.__rendered=!1,function(a){a.dispatch.on("renderEnd",function(){a.__rendered=!0,f.renderEnd("model")})}(a),e.indexOf(a)<0&&e.push(a)}),this},this.reset=function(a){void 0!==a&&(d=a),e=[]},this.transition=function(a,b,c){if(b=arguments.length>1?[].slice.call(arguments,1):[],c=b.length>1?b.pop():void 0!==d?d:250,a.__rendered=!1,e.indexOf(a)<0&&e.push(a),0===c)return a.__rendered=!0,a.delay=function(){return this},a.duration=function(){return this},a;a.__rendered=0===a.length?!0:a.every(function(a){return!a.length})?!0:!1;var g=0;return a.transition().duration(c).each(function(){++g}).each("end",function(){0===--g&&(a.__rendered=!0,f.renderEnd.apply(this,b))})},this.renderEnd=function(){e.every(function(a){return a.__rendered})&&(e.forEach(function(a){a.__rendered=!1}),b.renderEnd.apply(this,arguments))}},a.utils.deepExtend=function(b){var c=arguments.length>1?[].slice.call(arguments,1):[];c.forEach(function(c){for(var d in c){var e=b[d]instanceof Array,f="object"==typeof b[d],g="object"==typeof c[d];f&&!e&&g?a.utils.deepExtend(b[d],c[d]):b[d]=c[d]}})},a.utils.state=function(){if(!(this instanceof a.utils.state))return new a.utils.state;var b={},c=function(){},d=function(){return{}},e=null,f=null;this.dispatch=d3.dispatch("change","set"),this.dispatch.on("set",function(a){c(a,!0)}),this.getter=function(a){return d=a,this},this.setter=function(a,b){return b||(b=function(){}),c=function(c,d){a(c),d&&b()},this},this.init=function(b){e=e||{},a.utils.deepExtend(e,b)};var g=function(){var a=d();if(JSON.stringify(a)===JSON.stringify(b))return!1;for(var c in a)void 0===b[c]&&(b[c]={}),b[c]=a[c],f=!0;return!0};this.update=function(){e&&(c(e,!1),e=null),g.call(this)&&this.dispatch.change(b)}},a.utils.optionsFunc=function(a){return a&&d3.map(a).forEach(function(a,b){"function"==typeof this[a]&&this[a](b)}.bind(this)),this},a.utils.calcTicksX=function(b,c){var d=1,e=0;for(e;ed?f:d}return a.log("Requested number of ticks: ",b),a.log("Calculated max values to be: ",d),b=b>d?b=d-1:b,b=1>b?1:b,b=Math.floor(b),a.log("Calculating tick count as: ",b),b},a.utils.calcTicksY=function(b,c){return a.utils.calcTicksX(b,c)},a.utils.initOption=function(a,b){a._calls&&a._calls[b]?a[b]=a._calls[b]:(a[b]=function(c){return arguments.length?(a._overrides[b]=!0,a._options[b]=c,a):a._options[b]},a["_"+b]=function(c){return arguments.length?(a._overrides[b]||(a._options[b]=c),a):a._options[b]})},a.utils.initOptions=function(b){b._overrides=b._overrides||{};var c=Object.getOwnPropertyNames(b._options||{}),d=Object.getOwnPropertyNames(b._calls||{});c=c.concat(d);for(var e in c)a.utils.initOption(b,c[e])},a.utils.inheritOptionsD3=function(a,b,c){a._d3options=c.concat(a._d3options||[]),c.unshift(b),c.unshift(a),d3.rebind.apply(this,c)},a.utils.arrayUnique=function(a){return a.sort().filter(function(b,c){return!c||b!=a[c-1]})},a.utils.symbolMap=d3.map(),a.utils.symbol=function(){function b(b,e){var f=c.call(this,b,e),g=d.call(this,b,e);return-1!==d3.svg.symbolTypes.indexOf(f)?d3.svg.symbol().type(f).size(g)():a.utils.symbolMap.get(f)(g)}var c,d=64;return b.type=function(a){return arguments.length?(c=d3.functor(a),b):c},b.size=function(a){return arguments.length?(d=d3.functor(a),b):d},b},a.utils.inheritOptions=function(b,c){var d=Object.getOwnPropertyNames(c._options||{}),e=Object.getOwnPropertyNames(c._calls||{}),f=c._inherited||[],g=c._d3options||[],h=d.concat(e).concat(f).concat(g);h.unshift(c),h.unshift(b),d3.rebind.apply(this,h),b._inherited=a.utils.arrayUnique(d.concat(e).concat(f).concat(d).concat(b._inherited||[])),b._d3options=a.utils.arrayUnique(g.concat(b._d3options||[]))},a.utils.initSVG=function(a){a.classed({"nvd3-svg":!0})},a.utils.sanitizeHeight=function(a,b){return a||parseInt(b.style("height"),10)||400},a.utils.sanitizeWidth=function(a,b){return a||parseInt(b.style("width"),10)||960},a.utils.availableHeight=function(b,c,d){return a.utils.sanitizeHeight(b,c)-d.top-d.bottom},a.utils.availableWidth=function(b,c,d){return a.utils.sanitizeWidth(b,c)-d.left-d.right},a.utils.noData=function(b,c){var d=b.options(),e=d.margin(),f=d.noData(),g=null==f?["No Data Available."]:[f],h=a.utils.availableHeight(d.height(),c,e),i=a.utils.availableWidth(d.width(),c,e),j=e.left+i/2,k=e.top+h/2;c.selectAll("g").remove();var l=c.selectAll(".nv-noData").data(g);l.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),l.attr("x",j).attr("y",k).text(function(a){return a})},a.models.axis=function(){"use strict";function b(g){return s.reset(),g.each(function(b){var g=d3.select(this);a.utils.initSVG(g);var p=g.selectAll("g.nv-wrap.nv-axis").data([b]),q=p.enter().append("g").attr("class","nvd3 nv-wrap nv-axis"),t=(q.append("g"),p.select("g"));null!==n?c.ticks(n):("top"==c.orient()||"bottom"==c.orient())&&c.ticks(Math.abs(d.range()[1]-d.range()[0])/100),t.watchTransition(s,"axis").call(c),r=r||c.scale();var u=c.tickFormat();null==u&&(u=r.tickFormat());var v=t.selectAll("text.nv-axislabel").data([h||null]);v.exit().remove();var w,x,y;switch(c.orient()){case"top":v.enter().append("text").attr("class","nv-axislabel"),y=d.range().length<2?0:2===d.range().length?d.range()[1]:d.range()[d.range().length-1]+(d.range()[1]-d.range()[0]),v.attr("text-anchor","middle").attr("y",0).attr("x",y/2),i&&(x=p.selectAll("g.nv-axisMaxMin").data(d.domain()),x.enter().append("g").attr("class",function(a,b){return["nv-axisMaxMin","nv-axisMaxMin-x",0==b?"nv-axisMin-x":"nv-axisMax-x"].join(" ")}).append("text"),x.exit().remove(),x.attr("transform",function(b){return"translate("+a.utils.NaNtoZero(d(b))+",0)"}).select("text").attr("dy","-0.5em").attr("y",-c.tickPadding()).attr("text-anchor","middle").text(function(a){var b=u(a);return(""+b).match("NaN")?"":b}),x.watchTransition(s,"min-max top").attr("transform",function(b,c){return"translate("+a.utils.NaNtoZero(d.range()[c])+",0)"}));break;case"bottom":w=o+36;var z=30,A=0,B=t.selectAll("g").select("text"),C="";if(j%360){B.each(function(){var a=this.getBoundingClientRect(),b=a.width;A=a.height,b>z&&(z=b)}),C="rotate("+j+" 0,"+(A/2+c.tickPadding())+")";var D=Math.abs(Math.sin(j*Math.PI/180));w=(D?D*z:z)+30,B.attr("transform",C).style("text-anchor",j%360>0?"start":"end")}v.enter().append("text").attr("class","nv-axislabel"),y=d.range().length<2?0:2===d.range().length?d.range()[1]:d.range()[d.range().length-1]+(d.range()[1]-d.range()[0]),v.attr("text-anchor","middle").attr("y",w).attr("x",y/2),i&&(x=p.selectAll("g.nv-axisMaxMin").data([d.domain()[0],d.domain()[d.domain().length-1]]),x.enter().append("g").attr("class",function(a,b){return["nv-axisMaxMin","nv-axisMaxMin-x",0==b?"nv-axisMin-x":"nv-axisMax-x"].join(" ")}).append("text"),x.exit().remove(),x.attr("transform",function(b){return"translate("+a.utils.NaNtoZero(d(b)+(m?d.rangeBand()/2:0))+",0)"}).select("text").attr("dy",".71em").attr("y",c.tickPadding()).attr("transform",C).style("text-anchor",j?j%360>0?"start":"end":"middle").text(function(a){var b=u(a);return(""+b).match("NaN")?"":b}),x.watchTransition(s,"min-max bottom").attr("transform",function(b){return"translate("+a.utils.NaNtoZero(d(b)+(m?d.rangeBand()/2:0))+",0)"})),l&&B.attr("transform",function(a,b){return"translate(0,"+(b%2==0?"0":"12")+")"});break;case"right":v.enter().append("text").attr("class","nv-axislabel"),v.style("text-anchor",k?"middle":"begin").attr("transform",k?"rotate(90)":"").attr("y",k?-Math.max(e.right,f)+12:-10).attr("x",k?d3.max(d.range())/2:c.tickPadding()),i&&(x=p.selectAll("g.nv-axisMaxMin").data(d.domain()),x.enter().append("g").attr("class",function(a,b){return["nv-axisMaxMin","nv-axisMaxMin-y",0==b?"nv-axisMin-y":"nv-axisMax-y"].join(" ")}).append("text").style("opacity",0),x.exit().remove(),x.attr("transform",function(b){return"translate(0,"+a.utils.NaNtoZero(d(b))+")"}).select("text").attr("dy",".32em").attr("y",0).attr("x",c.tickPadding()).style("text-anchor","start").text(function(a){var b=u(a);return(""+b).match("NaN")?"":b}),x.watchTransition(s,"min-max right").attr("transform",function(b,c){return"translate(0,"+a.utils.NaNtoZero(d.range()[c])+")"}).select("text").style("opacity",1));break;case"left":v.enter().append("text").attr("class","nv-axislabel"),v.style("text-anchor",k?"middle":"end").attr("transform",k?"rotate(-90)":"").attr("y",k?-Math.max(e.left,f)+25-(o||0):-10).attr("x",k?-d3.max(d.range())/2:-c.tickPadding()),i&&(x=p.selectAll("g.nv-axisMaxMin").data(d.domain()),x.enter().append("g").attr("class",function(a,b){return["nv-axisMaxMin","nv-axisMaxMin-y",0==b?"nv-axisMin-y":"nv-axisMax-y"].join(" ")}).append("text").style("opacity",0),x.exit().remove(),x.attr("transform",function(b){return"translate(0,"+a.utils.NaNtoZero(r(b))+")"}).select("text").attr("dy",".32em").attr("y",0).attr("x",-c.tickPadding()).attr("text-anchor","end").text(function(a){var b=u(a);return(""+b).match("NaN")?"":b}),x.watchTransition(s,"min-max right").attr("transform",function(b,c){return"translate(0,"+a.utils.NaNtoZero(d.range()[c])+")"}).select("text").style("opacity",1))}if(v.text(function(a){return a}),!i||"left"!==c.orient()&&"right"!==c.orient()||(t.selectAll("g").each(function(a){d3.select(this).select("text").attr("opacity",1),(d(a)d.range()[0]-10)&&((a>1e-10||-1e-10>a)&&d3.select(this).attr("opacity",0),d3.select(this).select("text").attr("opacity",0))}),d.domain()[0]==d.domain()[1]&&0==d.domain()[0]&&p.selectAll("g.nv-axisMaxMin").style("opacity",function(a,b){return b?0:1})),i&&("top"===c.orient()||"bottom"===c.orient())){var E=[];p.selectAll("g.nv-axisMaxMin").each(function(a,b){try{E.push(b?d(a)-this.getBoundingClientRect().width-4:d(a)+this.getBoundingClientRect().width+4)}catch(c){E.push(b?d(a)-4:d(a)+4)}}),t.selectAll("g").each(function(a){(d(a)E[1])&&(a>1e-10||-1e-10>a?d3.select(this).remove():d3.select(this).select("text").remove())})}t.selectAll(".tick").filter(function(a){return!parseFloat(Math.round(1e5*a)/1e6)&&void 0!==a}).classed("zero",!0),r=d.copy()}),s.renderEnd("axis immediate"),b}var c=d3.svg.axis(),d=d3.scale.linear(),e={top:0,right:0,bottom:0,left:0},f=75,g=60,h=null,i=!0,j=0,k=!0,l=!1,m=!1,n=null,o=0,p=250,q=d3.dispatch("renderEnd");c.scale(d).orient("bottom").tickFormat(function(a){return a});var r,s=a.utils.renderWatch(q,p);return b.axis=c,b.dispatch=q,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{axisLabelDistance:{get:function(){return o},set:function(a){o=a}},staggerLabels:{get:function(){return l},set:function(a){l=a}},rotateLabels:{get:function(){return j},set:function(a){j=a}},rotateYLabel:{get:function(){return k},set:function(a){k=a}},showMaxMin:{get:function(){return i},set:function(a){i=a}},axisLabel:{get:function(){return h},set:function(a){h=a}},height:{get:function(){return g},set:function(a){g=a}},ticks:{get:function(){return n},set:function(a){n=a}},width:{get:function(){return f},set:function(a){f=a}},margin:{get:function(){return e},set:function(a){e.top=void 0!==a.top?a.top:e.top,e.right=void 0!==a.right?a.right:e.right,e.bottom=void 0!==a.bottom?a.bottom:e.bottom,e.left=void 0!==a.left?a.left:e.left}},duration:{get:function(){return p},set:function(a){p=a,s.reset(p)}},scale:{get:function(){return d},set:function(e){d=e,c.scale(d),m="function"==typeof d.rangeBands,a.utils.inheritOptionsD3(b,d,["domain","range","rangeBand","rangeBands"])}}}),a.utils.initOptions(b),a.utils.inheritOptionsD3(b,c,["orient","tickValues","tickSubdivide","tickSize","tickPadding","tickFormat"]),a.utils.inheritOptionsD3(b,d,["domain","range","rangeBand","rangeBands"]),b},a.models.boxPlot=function(){"use strict";function b(l){return v.reset(),l.each(function(b){var l=j-i.left-i.right,p=k-i.top-i.bottom;r=d3.select(this),a.utils.initSVG(r),m.domain(c||b.map(function(a,b){return o(a,b)})).rangeBands(e||[0,l],.1);var w=[];if(!d){var x=d3.min(b.map(function(a){var b=[];return b.push(a.values.Q1),a.values.hasOwnProperty("whisker_low")&&null!==a.values.whisker_low&&b.push(a.values.whisker_low),a.values.hasOwnProperty("outliers")&&null!==a.values.outliers&&(b=b.concat(a.values.outliers)),d3.min(b)})),y=d3.max(b.map(function(a){var b=[];return b.push(a.values.Q3),a.values.hasOwnProperty("whisker_high")&&null!==a.values.whisker_high&&b.push(a.values.whisker_high),a.values.hasOwnProperty("outliers")&&null!==a.values.outliers&&(b=b.concat(a.values.outliers)),d3.max(b)}));w=[x,y]}n.domain(d||w),n.range(f||[p,0]),g=g||m,h=h||n.copy().range([n(0),n(0)]);{var z=r.selectAll("g.nv-wrap").data([b]);z.enter().append("g").attr("class","nvd3 nv-wrap")}z.attr("transform","translate("+i.left+","+i.top+")");var A=z.selectAll(".nv-boxplot").data(function(a){return a}),B=A.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6);A.attr("class","nv-boxplot").attr("transform",function(a,b){return"translate("+(m(o(a,b))+.05*m.rangeBand())+", 0)"}).classed("hover",function(a){return a.hover}),A.watchTransition(v,"nv-boxplot: boxplots").style("stroke-opacity",1).style("fill-opacity",.75).delay(function(a,c){return c*t/b.length}).attr("transform",function(a,b){return"translate("+(m(o(a,b))+.05*m.rangeBand())+", 0)"}),A.exit().remove(),B.each(function(a,b){var c=d3.select(this);["low","high"].forEach(function(d){a.values.hasOwnProperty("whisker_"+d)&&null!==a.values["whisker_"+d]&&(c.append("line").style("stroke",a.color?a.color:q(a,b)).attr("class","nv-boxplot-whisker nv-boxplot-"+d),c.append("line").style("stroke",a.color?a.color:q(a,b)).attr("class","nv-boxplot-tick nv-boxplot-"+d))})});var C=A.selectAll(".nv-boxplot-outlier").data(function(a){return a.values.hasOwnProperty("outliers")&&null!==a.values.outliers?a.values.outliers:[]});C.enter().append("circle").style("fill",function(a,b,c){return q(a,c)}).style("stroke",function(a,b,c){return q(a,c)}).on("mouseover",function(a,b,c){d3.select(this).classed("hover",!0),s.elementMouseover({series:{key:a,color:q(a,c)},e:d3.event})}).on("mouseout",function(a,b,c){d3.select(this).classed("hover",!1),s.elementMouseout({series:{key:a,color:q(a,c)},e:d3.event})}).on("mousemove",function(){s.elementMousemove({e:d3.event})}),C.attr("class","nv-boxplot-outlier"),C.watchTransition(v,"nv-boxplot: nv-boxplot-outlier").attr("cx",.45*m.rangeBand()).attr("cy",function(a){return n(a)}).attr("r","3"),C.exit().remove();var D=function(){return null===u?.9*m.rangeBand():Math.min(75,.9*m.rangeBand())},E=function(){return.45*m.rangeBand()-D()/2},F=function(){return.45*m.rangeBand()+D()/2};["low","high"].forEach(function(a){var b="low"===a?"Q1":"Q3";A.select("line.nv-boxplot-whisker.nv-boxplot-"+a).watchTransition(v,"nv-boxplot: boxplots").attr("x1",.45*m.rangeBand()).attr("y1",function(b){return n(b.values["whisker_"+a])}).attr("x2",.45*m.rangeBand()).attr("y2",function(a){return n(a.values[b])}),A.select("line.nv-boxplot-tick.nv-boxplot-"+a).watchTransition(v,"nv-boxplot: boxplots").attr("x1",E).attr("y1",function(b){return n(b.values["whisker_"+a])}).attr("x2",F).attr("y2",function(b){return n(b.values["whisker_"+a])})}),["low","high"].forEach(function(a){B.selectAll(".nv-boxplot-"+a).on("mouseover",function(b,c,d){d3.select(this).classed("hover",!0),s.elementMouseover({series:{key:b.values["whisker_"+a],color:q(b,d)},e:d3.event})}).on("mouseout",function(b,c,d){d3.select(this).classed("hover",!1),s.elementMouseout({series:{key:b.values["whisker_"+a],color:q(b,d)},e:d3.event})}).on("mousemove",function(){s.elementMousemove({e:d3.event})})}),B.append("rect").attr("class","nv-boxplot-box").on("mouseover",function(a,b){d3.select(this).classed("hover",!0),s.elementMouseover({key:a.label,value:a.label,series:[{key:"Q3",value:a.values.Q3,color:a.color||q(a,b)},{key:"Q2",value:a.values.Q2,color:a.color||q(a,b)},{key:"Q1",value:a.values.Q1,color:a.color||q(a,b)}],data:a,index:b,e:d3.event})}).on("mouseout",function(a,b){d3.select(this).classed("hover",!1),s.elementMouseout({key:a.label,value:a.label,series:[{key:"Q3",value:a.values.Q3,color:a.color||q(a,b)},{key:"Q2",value:a.values.Q2,color:a.color||q(a,b)},{key:"Q1",value:a.values.Q1,color:a.color||q(a,b)}],data:a,index:b,e:d3.event})}).on("mousemove",function(){s.elementMousemove({e:d3.event})}),A.select("rect.nv-boxplot-box").watchTransition(v,"nv-boxplot: boxes").attr("y",function(a){return n(a.values.Q3)}).attr("width",D).attr("x",E).attr("height",function(a){return Math.abs(n(a.values.Q3)-n(a.values.Q1))||1}).style("fill",function(a,b){return a.color||q(a,b)}).style("stroke",function(a,b){return a.color||q(a,b)}),B.append("line").attr("class","nv-boxplot-median"),A.select("line.nv-boxplot-median").watchTransition(v,"nv-boxplot: boxplots line").attr("x1",E).attr("y1",function(a){return n(a.values.Q2)}).attr("x2",F).attr("y2",function(a){return n(a.values.Q2)}),g=m.copy(),h=n.copy()}),v.renderEnd("nv-boxplot immediate"),b}var c,d,e,f,g,h,i={top:0,right:0,bottom:0,left:0},j=960,k=500,l=Math.floor(1e4*Math.random()),m=d3.scale.ordinal(),n=d3.scale.linear(),o=function(a){return a.x},p=function(a){return a.y},q=a.utils.defaultColor(),r=null,s=d3.dispatch("elementMouseover","elementMouseout","elementMousemove","renderEnd"),t=250,u=null,v=a.utils.renderWatch(s,t);return b.dispatch=s,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return j},set:function(a){j=a}},height:{get:function(){return k},set:function(a){k=a}},maxBoxWidth:{get:function(){return u},set:function(a){u=a}},x:{get:function(){return o},set:function(a){o=a}},y:{get:function(){return p},set:function(a){p=a}},xScale:{get:function(){return m},set:function(a){m=a}},yScale:{get:function(){return n},set:function(a){n=a}},xDomain:{get:function(){return c},set:function(a){c=a}},yDomain:{get:function(){return d},set:function(a){d=a}},xRange:{get:function(){return e},set:function(a){e=a}},yRange:{get:function(){return f},set:function(a){f=a}},id:{get:function(){return l},set:function(a){l=a}},margin:{get:function(){return i},set:function(a){i.top=void 0!==a.top?a.top:i.top,i.right=void 0!==a.right?a.right:i.right,i.bottom=void 0!==a.bottom?a.bottom:i.bottom,i.left=void 0!==a.left?a.left:i.left}},color:{get:function(){return q},set:function(b){q=a.utils.getColor(b)}},duration:{get:function(){return t},set:function(a){t=a,v.reset(t)}}}),a.utils.initOptions(b),b},a.models.boxPlotChart=function(){"use strict";function b(k){return t.reset(),t.models(e),l&&t.models(f),m&&t.models(g),k.each(function(k){var p=d3.select(this);a.utils.initSVG(p);var t=(i||parseInt(p.style("width"))||960)-h.left-h.right,u=(j||parseInt(p.style("height"))||400)-h.top-h.bottom;if(b.update=function(){r.beforeUpdate(),p.transition().duration(s).call(b)},b.container=this,!(k&&k.length&&k.filter(function(a){return a.values.hasOwnProperty("Q1")&&a.values.hasOwnProperty("Q2")&&a.values.hasOwnProperty("Q3")}).length)){var v=p.selectAll(".nv-noData").data([q]);return v.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),v.attr("x",h.left+t/2).attr("y",h.top+u/2).text(function(a){return a}),b}p.selectAll(".nv-noData").remove(),c=e.xScale(),d=e.yScale().clamp(!0);var w=p.selectAll("g.nv-wrap.nv-boxPlotWithAxes").data([k]),x=w.enter().append("g").attr("class","nvd3 nv-wrap nv-boxPlotWithAxes").append("g"),y=x.append("defs"),z=w.select("g"); -x.append("g").attr("class","nv-x nv-axis"),x.append("g").attr("class","nv-y nv-axis").append("g").attr("class","nv-zeroLine").append("line"),x.append("g").attr("class","nv-barsWrap"),z.attr("transform","translate("+h.left+","+h.top+")"),n&&z.select(".nv-y.nv-axis").attr("transform","translate("+t+",0)"),e.width(t).height(u);var A=z.select(".nv-barsWrap").datum(k.filter(function(a){return!a.disabled}));if(A.transition().call(e),y.append("clipPath").attr("id","nv-x-label-clip-"+e.id()).append("rect"),z.select("#nv-x-label-clip-"+e.id()+" rect").attr("width",c.rangeBand()*(o?2:1)).attr("height",16).attr("x",-c.rangeBand()/(o?1:2)),l){f.scale(c).ticks(a.utils.calcTicksX(t/100,k)).tickSize(-u,0),z.select(".nv-x.nv-axis").attr("transform","translate(0,"+d.range()[0]+")"),z.select(".nv-x.nv-axis").call(f);var B=z.select(".nv-x.nv-axis").selectAll("g");o&&B.selectAll("text").attr("transform",function(a,b,c){return"translate(0,"+(c%2==0?"5":"17")+")"})}m&&(g.scale(d).ticks(Math.floor(u/36)).tickSize(-t,0),z.select(".nv-y.nv-axis").call(g)),z.select(".nv-zeroLine line").attr("x1",0).attr("x2",t).attr("y1",d(0)).attr("y2",d(0))}),t.renderEnd("nv-boxplot chart immediate"),b}var c,d,e=a.models.boxPlot(),f=a.models.axis(),g=a.models.axis(),h={top:15,right:10,bottom:50,left:60},i=null,j=null,k=a.utils.getColor(),l=!0,m=!0,n=!1,o=!1,p=a.models.tooltip(),q="No Data Available.",r=d3.dispatch("tooltipShow","tooltipHide","beforeUpdate","renderEnd"),s=250;f.orient("bottom").showMaxMin(!1).tickFormat(function(a){return a}),g.orient(n?"right":"left").tickFormat(d3.format(",.1f")),p.duration(0);var t=a.utils.renderWatch(r,s);return e.dispatch.on("elementMouseover.tooltip",function(a){p.data(a).hidden(!1)}),e.dispatch.on("elementMouseout.tooltip",function(a){p.data(a).hidden(!0)}),e.dispatch.on("elementMousemove.tooltip",function(){p.position({top:d3.event.pageY,left:d3.event.pageX})()}),b.dispatch=r,b.boxplot=e,b.xAxis=f,b.yAxis=g,b.tooltip=p,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return i},set:function(a){i=a}},height:{get:function(){return j},set:function(a){j=a}},staggerLabels:{get:function(){return o},set:function(a){o=a}},showXAxis:{get:function(){return l},set:function(a){l=a}},showYAxis:{get:function(){return m},set:function(a){m=a}},tooltips:{get:function(){return tooltips},set:function(a){tooltips=a}},tooltipContent:{get:function(){return p},set:function(a){p=a}},noData:{get:function(){return q},set:function(a){q=a}},margin:{get:function(){return h},set:function(a){h.top=void 0!==a.top?a.top:h.top,h.right=void 0!==a.right?a.right:h.right,h.bottom=void 0!==a.bottom?a.bottom:h.bottom,h.left=void 0!==a.left?a.left:h.left}},duration:{get:function(){return s},set:function(a){s=a,t.reset(s),e.duration(s),f.duration(s),g.duration(s)}},color:{get:function(){return k},set:function(b){k=a.utils.getColor(b),e.color(k)}},rightAlignYAxis:{get:function(){return n},set:function(a){n=a,g.orient(a?"right":"left")}}}),a.utils.inheritOptions(b,e),a.utils.initOptions(b),b},a.models.bullet=function(){"use strict";function b(d){return d.each(function(b,d){var p=m-c.left-c.right,s=n-c.top-c.bottom;o=d3.select(this),a.utils.initSVG(o);{var t=f.call(this,b,d).slice().sort(d3.descending),u=g.call(this,b,d).slice().sort(d3.descending),v=h.call(this,b,d).slice().sort(d3.descending),w=i.call(this,b,d).slice(),x=j.call(this,b,d).slice(),y=k.call(this,b,d).slice(),z=d3.scale.linear().domain(d3.extent(d3.merge([l,t]))).range(e?[p,0]:[0,p]);this.__chart__||d3.scale.linear().domain([0,1/0]).range(z.range())}this.__chart__=z;var A=d3.min(t),B=d3.max(t),C=t[1],D=o.selectAll("g.nv-wrap.nv-bullet").data([b]),E=D.enter().append("g").attr("class","nvd3 nv-wrap nv-bullet"),F=E.append("g"),G=D.select("g");F.append("rect").attr("class","nv-range nv-rangeMax"),F.append("rect").attr("class","nv-range nv-rangeAvg"),F.append("rect").attr("class","nv-range nv-rangeMin"),F.append("rect").attr("class","nv-measure"),D.attr("transform","translate("+c.left+","+c.top+")");var H=function(a){return Math.abs(z(a)-z(0))},I=function(a){return z(0>a?a:0)};G.select("rect.nv-rangeMax").attr("height",s).attr("width",H(B>0?B:A)).attr("x",I(B>0?B:A)).datum(B>0?B:A),G.select("rect.nv-rangeAvg").attr("height",s).attr("width",H(C)).attr("x",I(C)).datum(C),G.select("rect.nv-rangeMin").attr("height",s).attr("width",H(B)).attr("x",I(B)).attr("width",H(B>0?A:B)).attr("x",I(B>0?A:B)).datum(B>0?A:B),G.select("rect.nv-measure").style("fill",q).attr("height",s/3).attr("y",s/3).attr("width",0>v?z(0)-z(v[0]):z(v[0])-z(0)).attr("x",I(v)).on("mouseover",function(){r.elementMouseover({value:v[0],label:y[0]||"Current",color:d3.select(this).style("fill")})}).on("mousemove",function(){r.elementMousemove({value:v[0],label:y[0]||"Current",color:d3.select(this).style("fill")})}).on("mouseout",function(){r.elementMouseout({value:v[0],label:y[0]||"Current",color:d3.select(this).style("fill")})});var J=s/6,K=u.map(function(a,b){return{value:a,label:x[b]}});F.selectAll("path.nv-markerTriangle").data(K).enter().append("path").attr("class","nv-markerTriangle").attr("transform",function(a){return"translate("+z(a.value)+","+s/2+")"}).attr("d","M0,"+J+"L"+J+","+-J+" "+-J+","+-J+"Z").on("mouseover",function(a){r.elementMouseover({value:a.value,label:a.label||"Previous",color:d3.select(this).style("fill"),pos:[z(a.value),s/2]})}).on("mousemove",function(a){r.elementMousemove({value:a.value,label:a.label||"Previous",color:d3.select(this).style("fill")})}).on("mouseout",function(a){r.elementMouseout({value:a.value,label:a.label||"Previous",color:d3.select(this).style("fill")})}),D.selectAll(".nv-range").on("mouseover",function(a,b){var c=w[b]||(b?1==b?"Mean":"Minimum":"Maximum");r.elementMouseover({value:a,label:c,color:d3.select(this).style("fill")})}).on("mousemove",function(){r.elementMousemove({value:v[0],label:y[0]||"Previous",color:d3.select(this).style("fill")})}).on("mouseout",function(a,b){var c=w[b]||(b?1==b?"Mean":"Minimum":"Maximum");r.elementMouseout({value:a,label:c,color:d3.select(this).style("fill")})})}),b}var c={top:0,right:0,bottom:0,left:0},d="left",e=!1,f=function(a){return a.ranges},g=function(a){return a.markers?a.markers:[0]},h=function(a){return a.measures},i=function(a){return a.rangeLabels?a.rangeLabels:[]},j=function(a){return a.markerLabels?a.markerLabels:[]},k=function(a){return a.measureLabels?a.measureLabels:[]},l=[0],m=380,n=30,o=null,p=null,q=a.utils.getColor(["#1f77b4"]),r=d3.dispatch("elementMouseover","elementMouseout","elementMousemove");return b.dispatch=r,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{ranges:{get:function(){return f},set:function(a){f=a}},markers:{get:function(){return g},set:function(a){g=a}},measures:{get:function(){return h},set:function(a){h=a}},forceX:{get:function(){return l},set:function(a){l=a}},width:{get:function(){return m},set:function(a){m=a}},height:{get:function(){return n},set:function(a){n=a}},tickFormat:{get:function(){return p},set:function(a){p=a}},margin:{get:function(){return c},set:function(a){c.top=void 0!==a.top?a.top:c.top,c.right=void 0!==a.right?a.right:c.right,c.bottom=void 0!==a.bottom?a.bottom:c.bottom,c.left=void 0!==a.left?a.left:c.left}},orient:{get:function(){return d},set:function(a){d=a,e="right"==d||"bottom"==d}},color:{get:function(){return q},set:function(b){q=a.utils.getColor(b)}}}),a.utils.initOptions(b),b},a.models.bulletChart=function(){"use strict";function b(d){return d.each(function(e,o){var p=d3.select(this);a.utils.initSVG(p);var q=a.utils.availableWidth(k,p,g),r=l-g.top-g.bottom;if(b.update=function(){b(d)},b.container=this,!e||!h.call(this,e,o))return a.utils.noData(b,p),b;p.selectAll(".nv-noData").remove();var s=h.call(this,e,o).slice().sort(d3.descending),t=i.call(this,e,o).slice().sort(d3.descending),u=j.call(this,e,o).slice().sort(d3.descending),v=p.selectAll("g.nv-wrap.nv-bulletChart").data([e]),w=v.enter().append("g").attr("class","nvd3 nv-wrap nv-bulletChart"),x=w.append("g"),y=v.select("g");x.append("g").attr("class","nv-bulletWrap"),x.append("g").attr("class","nv-titles"),v.attr("transform","translate("+g.left+","+g.top+")");var z=d3.scale.linear().domain([0,Math.max(s[0],t[0],u[0])]).range(f?[q,0]:[0,q]),A=this.__chart__||d3.scale.linear().domain([0,1/0]).range(z.range());this.__chart__=z;var B=x.select(".nv-titles").append("g").attr("text-anchor","end").attr("transform","translate(-6,"+(l-g.top-g.bottom)/2+")");B.append("text").attr("class","nv-title").text(function(a){return a.title}),B.append("text").attr("class","nv-subtitle").attr("dy","1em").text(function(a){return a.subtitle}),c.width(q).height(r);var C=y.select(".nv-bulletWrap");d3.transition(C).call(c);var D=m||z.tickFormat(q/100),E=y.selectAll("g.nv-tick").data(z.ticks(n?n:q/50),function(a){return this.textContent||D(a)}),F=E.enter().append("g").attr("class","nv-tick").attr("transform",function(a){return"translate("+A(a)+",0)"}).style("opacity",1e-6);F.append("line").attr("y1",r).attr("y2",7*r/6),F.append("text").attr("text-anchor","middle").attr("dy","1em").attr("y",7*r/6).text(D);var G=d3.transition(E).attr("transform",function(a){return"translate("+z(a)+",0)"}).style("opacity",1);G.select("line").attr("y1",r).attr("y2",7*r/6),G.select("text").attr("y",7*r/6),d3.transition(E.exit()).attr("transform",function(a){return"translate("+z(a)+",0)"}).style("opacity",1e-6).remove()}),d3.timer.flush(),b}var c=a.models.bullet(),d=a.models.tooltip(),e="left",f=!1,g={top:5,right:40,bottom:20,left:120},h=function(a){return a.ranges},i=function(a){return a.markers?a.markers:[0]},j=function(a){return a.measures},k=null,l=55,m=null,n=null,o=null,p=d3.dispatch("tooltipShow","tooltipHide");return d.duration(0).headerEnabled(!1),c.dispatch.on("elementMouseover.tooltip",function(a){a.series={key:a.label,value:a.value,color:a.color},d.data(a).hidden(!1)}),c.dispatch.on("elementMouseout.tooltip",function(){d.hidden(!0)}),c.dispatch.on("elementMousemove.tooltip",function(){d.position({top:d3.event.pageY,left:d3.event.pageX})()}),b.bullet=c,b.dispatch=p,b.tooltip=d,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{ranges:{get:function(){return h},set:function(a){h=a}},markers:{get:function(){return i},set:function(a){i=a}},measures:{get:function(){return j},set:function(a){j=a}},width:{get:function(){return k},set:function(a){k=a}},height:{get:function(){return l},set:function(a){l=a}},tickFormat:{get:function(){return m},set:function(a){m=a}},ticks:{get:function(){return n},set:function(a){n=a}},noData:{get:function(){return o},set:function(a){o=a}},tooltips:{get:function(){return d.enabled()},set:function(b){a.deprecated("tooltips","use chart.tooltip.enabled() instead"),d.enabled(!!b)}},tooltipContent:{get:function(){return d.contentGenerator()},set:function(b){a.deprecated("tooltipContent","use chart.tooltip.contentGenerator() instead"),d.contentGenerator(b)}},margin:{get:function(){return g},set:function(a){g.top=void 0!==a.top?a.top:g.top,g.right=void 0!==a.right?a.right:g.right,g.bottom=void 0!==a.bottom?a.bottom:g.bottom,g.left=void 0!==a.left?a.left:g.left}},orient:{get:function(){return e},set:function(a){e=a,f="right"==e||"bottom"==e}}}),a.utils.inheritOptions(b,c),a.utils.initOptions(b),b},a.models.candlestickBar=function(){"use strict";function b(x){return x.each(function(b){c=d3.select(this);var x=a.utils.availableWidth(i,c,h),y=a.utils.availableHeight(j,c,h);a.utils.initSVG(c);var A=x/b[0].values.length*.45;l.domain(d||d3.extent(b[0].values.map(n).concat(t))),l.range(v?f||[.5*x/b[0].values.length,x*(b[0].values.length-.5)/b[0].values.length]:f||[5+A/2,x-A/2-5]),m.domain(e||[d3.min(b[0].values.map(s).concat(u)),d3.max(b[0].values.map(r).concat(u))]).range(g||[y,0]),l.domain()[0]===l.domain()[1]&&l.domain(l.domain()[0]?[l.domain()[0]-.01*l.domain()[0],l.domain()[1]+.01*l.domain()[1]]:[-1,1]),m.domain()[0]===m.domain()[1]&&m.domain(m.domain()[0]?[m.domain()[0]+.01*m.domain()[0],m.domain()[1]-.01*m.domain()[1]]:[-1,1]);var B=d3.select(this).selectAll("g.nv-wrap.nv-candlestickBar").data([b[0].values]),C=B.enter().append("g").attr("class","nvd3 nv-wrap nv-candlestickBar"),D=C.append("defs"),E=C.append("g"),F=B.select("g");E.append("g").attr("class","nv-ticks"),B.attr("transform","translate("+h.left+","+h.top+")"),c.on("click",function(a,b){z.chartClick({data:a,index:b,pos:d3.event,id:k})}),D.append("clipPath").attr("id","nv-chart-clip-path-"+k).append("rect"),B.select("#nv-chart-clip-path-"+k+" rect").attr("width",x).attr("height",y),F.attr("clip-path",w?"url(#nv-chart-clip-path-"+k+")":"");var G=B.select(".nv-ticks").selectAll(".nv-tick").data(function(a){return a});G.exit().remove();{var H=G.enter().append("g").attr("class",function(a,b,c){return(p(a,b)>q(a,b)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+c+"-"+b});H.append("line").attr("class","nv-candlestick-lines").attr("transform",function(a,b){return"translate("+l(n(a,b))+",0)"}).attr("x1",0).attr("y1",function(a,b){return m(r(a,b))}).attr("x2",0).attr("y2",function(a,b){return m(s(a,b))}),H.append("rect").attr("class","nv-candlestick-rects nv-bars").attr("transform",function(a,b){return"translate("+(l(n(a,b))-A/2)+","+(m(o(a,b))-(p(a,b)>q(a,b)?m(q(a,b))-m(p(a,b)):0))+")"}).attr("x",0).attr("y",0).attr("width",A).attr("height",function(a,b){var c=p(a,b),d=q(a,b);return c>d?m(d)-m(c):m(c)-m(d)})}c.selectAll(".nv-candlestick-lines").transition().attr("transform",function(a,b){return"translate("+l(n(a,b))+",0)"}).attr("x1",0).attr("y1",function(a,b){return m(r(a,b))}).attr("x2",0).attr("y2",function(a,b){return m(s(a,b))}),c.selectAll(".nv-candlestick-rects").transition().attr("transform",function(a,b){return"translate("+(l(n(a,b))-A/2)+","+(m(o(a,b))-(p(a,b)>q(a,b)?m(q(a,b))-m(p(a,b)):0))+")"}).attr("x",0).attr("y",0).attr("width",A).attr("height",function(a,b){var c=p(a,b),d=q(a,b);return c>d?m(d)-m(c):m(c)-m(d)})}),b}var c,d,e,f,g,h={top:0,right:0,bottom:0,left:0},i=null,j=null,k=Math.floor(1e4*Math.random()),l=d3.scale.linear(),m=d3.scale.linear(),n=function(a){return a.x},o=function(a){return a.y},p=function(a){return a.open},q=function(a){return a.close},r=function(a){return a.high},s=function(a){return a.low},t=[],u=[],v=!1,w=!0,x=a.utils.defaultColor(),y=!1,z=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState","renderEnd","chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove");return b.highlightPoint=function(a,d){b.clearHighlights(),c.select(".nv-candlestickBar .nv-tick-0-"+a).classed("hover",d)},b.clearHighlights=function(){c.select(".nv-candlestickBar .nv-tick.hover").classed("hover",!1)},b.dispatch=z,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return i},set:function(a){i=a}},height:{get:function(){return j},set:function(a){j=a}},xScale:{get:function(){return l},set:function(a){l=a}},yScale:{get:function(){return m},set:function(a){m=a}},xDomain:{get:function(){return d},set:function(a){d=a}},yDomain:{get:function(){return e},set:function(a){e=a}},xRange:{get:function(){return f},set:function(a){f=a}},yRange:{get:function(){return g},set:function(a){g=a}},forceX:{get:function(){return t},set:function(a){t=a}},forceY:{get:function(){return u},set:function(a){u=a}},padData:{get:function(){return v},set:function(a){v=a}},clipEdge:{get:function(){return w},set:function(a){w=a}},id:{get:function(){return k},set:function(a){k=a}},interactive:{get:function(){return y},set:function(a){y=a}},x:{get:function(){return n},set:function(a){n=a}},y:{get:function(){return o},set:function(a){o=a}},open:{get:function(){return p()},set:function(a){p=a}},close:{get:function(){return q()},set:function(a){q=a}},high:{get:function(){return r},set:function(a){r=a}},low:{get:function(){return s},set:function(a){s=a}},margin:{get:function(){return h},set:function(a){h.top=void 0!=a.top?a.top:h.top,h.right=void 0!=a.right?a.right:h.right,h.bottom=void 0!=a.bottom?a.bottom:h.bottom,h.left=void 0!=a.left?a.left:h.left}},color:{get:function(){return x},set:function(b){x=a.utils.getColor(b)}}}),a.utils.initOptions(b),b},a.models.cumulativeLineChart=function(){"use strict";function b(l){return H.reset(),H.models(f),r&&H.models(g),s&&H.models(h),l.each(function(l){function A(){d3.select(b.container).style("cursor","ew-resize")}function E(){G.x=d3.event.x,G.i=Math.round(F.invert(G.x)),K()}function H(){d3.select(b.container).style("cursor","auto"),y.index=G.i,C.stateChange(y)}function K(){bb.data([G]);var a=b.duration();b.duration(0),b.update(),b.duration(a)}var L=d3.select(this);a.utils.initSVG(L),L.classed("nv-chart-"+x,!0);var M=this,N=a.utils.availableWidth(o,L,m),O=a.utils.availableHeight(p,L,m);if(b.update=function(){0===D?L.call(b):L.transition().duration(D).call(b)},b.container=this,y.setter(J(l),b.update).getter(I(l)).update(),y.disabled=l.map(function(a){return!!a.disabled}),!z){var P;z={};for(P in y)z[P]=y[P]instanceof Array?y[P].slice(0):y[P]}var Q=d3.behavior.drag().on("dragstart",A).on("drag",E).on("dragend",H);if(!(l&&l.length&&l.filter(function(a){return a.values.length}).length))return a.utils.noData(b,L),b;if(L.selectAll(".nv-noData").remove(),d=f.xScale(),e=f.yScale(),w)f.yDomain(null);else{var R=l.filter(function(a){return!a.disabled}).map(function(a){var b=d3.extent(a.values,f.y());return b[0]<-.95&&(b[0]=-.95),[(b[0]-b[1])/(1+b[1]),(b[1]-b[0])/(1+b[0])]}),S=[d3.min(R,function(a){return a[0]}),d3.max(R,function(a){return a[1]})];f.yDomain(S)}F.domain([0,l[0].values.length-1]).range([0,N]).clamp(!0);var l=c(G.i,l),T=v?"none":"all",U=L.selectAll("g.nv-wrap.nv-cumulativeLine").data([l]),V=U.enter().append("g").attr("class","nvd3 nv-wrap nv-cumulativeLine").append("g"),W=U.select("g");if(V.append("g").attr("class","nv-interactive"),V.append("g").attr("class","nv-x nv-axis").style("pointer-events","none"),V.append("g").attr("class","nv-y nv-axis"),V.append("g").attr("class","nv-background"),V.append("g").attr("class","nv-linesWrap").style("pointer-events",T),V.append("g").attr("class","nv-avgLinesWrap").style("pointer-events","none"),V.append("g").attr("class","nv-legendWrap"),V.append("g").attr("class","nv-controlsWrap"),q&&(i.width(N),W.select(".nv-legendWrap").datum(l).call(i),m.top!=i.height()&&(m.top=i.height(),O=a.utils.availableHeight(p,L,m)),W.select(".nv-legendWrap").attr("transform","translate(0,"+-m.top+")")),u){var X=[{key:"Re-scale y-axis",disabled:!w}];j.width(140).color(["#444","#444","#444"]).rightAlign(!1).margin({top:5,right:0,bottom:5,left:20}),W.select(".nv-controlsWrap").datum(X).attr("transform","translate(0,"+-m.top+")").call(j)}U.attr("transform","translate("+m.left+","+m.top+")"),t&&W.select(".nv-y.nv-axis").attr("transform","translate("+N+",0)");var Y=l.filter(function(a){return a.tempDisabled});U.select(".tempDisabled").remove(),Y.length&&U.append("text").attr("class","tempDisabled").attr("x",N/2).attr("y","-.71em").style("text-anchor","end").text(Y.map(function(a){return a.key}).join(", ")+" values cannot be calculated for this time period."),v&&(k.width(N).height(O).margin({left:m.left,top:m.top}).svgContainer(L).xScale(d),U.select(".nv-interactive").call(k)),V.select(".nv-background").append("rect"),W.select(".nv-background rect").attr("width",N).attr("height",O),f.y(function(a){return a.display.y}).width(N).height(O).color(l.map(function(a,b){return a.color||n(a,b)}).filter(function(a,b){return!l[b].disabled&&!l[b].tempDisabled}));var Z=W.select(".nv-linesWrap").datum(l.filter(function(a){return!a.disabled&&!a.tempDisabled}));Z.call(f),l.forEach(function(a,b){a.seriesIndex=b});var $=l.filter(function(a){return!a.disabled&&!!B(a)}),_=W.select(".nv-avgLinesWrap").selectAll("line").data($,function(a){return a.key}),ab=function(a){var b=e(B(a));return 0>b?0:b>O?O:b};_.enter().append("line").style("stroke-width",2).style("stroke-dasharray","10,10").style("stroke",function(a){return f.color()(a,a.seriesIndex)}).attr("x1",0).attr("x2",N).attr("y1",ab).attr("y2",ab),_.style("stroke-opacity",function(a){var b=e(B(a));return 0>b||b>O?0:1}).attr("x1",0).attr("x2",N).attr("y1",ab).attr("y2",ab),_.exit().remove();var bb=Z.selectAll(".nv-indexLine").data([G]);bb.enter().append("rect").attr("class","nv-indexLine").attr("width",3).attr("x",-2).attr("fill","red").attr("fill-opacity",.5).style("pointer-events","all").call(Q),bb.attr("transform",function(a){return"translate("+F(a.i)+",0)"}).attr("height",O),r&&(g.scale(d)._ticks(a.utils.calcTicksX(N/70,l)).tickSize(-O,0),W.select(".nv-x.nv-axis").attr("transform","translate(0,"+e.range()[0]+")"),W.select(".nv-x.nv-axis").call(g)),s&&(h.scale(e)._ticks(a.utils.calcTicksY(O/36,l)).tickSize(-N,0),W.select(".nv-y.nv-axis").call(h)),W.select(".nv-background rect").on("click",function(){G.x=d3.mouse(this)[0],G.i=Math.round(F.invert(G.x)),y.index=G.i,C.stateChange(y),K()}),f.dispatch.on("elementClick",function(a){G.i=a.pointIndex,G.x=F(G.i),y.index=G.i,C.stateChange(y),K()}),j.dispatch.on("legendClick",function(a){a.disabled=!a.disabled,w=!a.disabled,y.rescaleY=w,C.stateChange(y),b.update()}),i.dispatch.on("stateChange",function(a){for(var c in a)y[c]=a[c];C.stateChange(y),b.update()}),k.dispatch.on("elementMousemove",function(c){f.clearHighlights();var d,e,i,j=[];if(l.filter(function(a,b){return a.seriesIndex=b,!a.disabled}).forEach(function(g,h){e=a.interactiveBisect(g.values,c.pointXValue,b.x()),f.highlightPoint(h,e,!0);var k=g.values[e];"undefined"!=typeof k&&("undefined"==typeof d&&(d=k),"undefined"==typeof i&&(i=b.xScale()(b.x()(k,e))),j.push({key:g.key,value:b.y()(k,e),color:n(g,g.seriesIndex)}))}),j.length>2){var o=b.yScale().invert(c.mouseY),p=Math.abs(b.yScale().domain()[0]-b.yScale().domain()[1]),q=.03*p,r=a.nearestValueIndex(j.map(function(a){return a.value}),o,q);null!==r&&(j[r].highlight=!0)}var s=g.tickFormat()(b.x()(d,e),e);k.tooltip.position({left:i+m.left,top:c.mouseY+m.top}).chartContainer(M.parentNode).valueFormatter(function(a){return h.tickFormat()(a)}).data({value:s,series:j})(),k.renderGuideLine(i)}),k.dispatch.on("elementMouseout",function(){f.clearHighlights()}),C.on("changeState",function(a){"undefined"!=typeof a.disabled&&(l.forEach(function(b,c){b.disabled=a.disabled[c]}),y.disabled=a.disabled),"undefined"!=typeof a.index&&(G.i=a.index,G.x=F(G.i),y.index=a.index,bb.data([G])),"undefined"!=typeof a.rescaleY&&(w=a.rescaleY),b.update()})}),H.renderEnd("cumulativeLineChart immediate"),b}function c(a,b){return K||(K=f.y()),b.map(function(b){if(!b.values)return b;var c=b.values[a];if(null==c)return b;var d=K(c,a);return-.95>d&&!E?(b.tempDisabled=!0,b):(b.tempDisabled=!1,b.values=b.values.map(function(a,b){return a.display={y:(K(a,b)-d)/(1+d)},a}),b)})}var d,e,f=a.models.line(),g=a.models.axis(),h=a.models.axis(),i=a.models.legend(),j=a.models.legend(),k=a.interactiveGuideline(),l=a.models.tooltip(),m={top:30,right:30,bottom:50,left:60},n=a.utils.defaultColor(),o=null,p=null,q=!0,r=!0,s=!0,t=!1,u=!0,v=!1,w=!0,x=f.id(),y=a.utils.state(),z=null,A=null,B=function(a){return a.average},C=d3.dispatch("stateChange","changeState","renderEnd"),D=250,E=!1;y.index=0,y.rescaleY=w,g.orient("bottom").tickPadding(7),h.orient(t?"right":"left"),l.valueFormatter(function(a,b){return h.tickFormat()(a,b)}).headerFormatter(function(a,b){return g.tickFormat()(a,b)}),j.updateState(!1);var F=d3.scale.linear(),G={i:0,x:0},H=a.utils.renderWatch(C,D),I=function(a){return function(){return{active:a.map(function(a){return!a.disabled}),index:G.i,rescaleY:w}}},J=function(a){return function(b){void 0!==b.index&&(G.i=b.index),void 0!==b.rescaleY&&(w=b.rescaleY),void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}};f.dispatch.on("elementMouseover.tooltip",function(a){var c={x:b.x()(a.point),y:b.y()(a.point),color:a.point.color};a.point=c,l.data(a).position(a.pos).hidden(!1)}),f.dispatch.on("elementMouseout.tooltip",function(){l.hidden(!0)});var K=null;return b.dispatch=C,b.lines=f,b.legend=i,b.controls=j,b.xAxis=g,b.yAxis=h,b.interactiveLayer=k,b.state=y,b.tooltip=l,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return o},set:function(a){o=a}},height:{get:function(){return p},set:function(a){p=a}},rescaleY:{get:function(){return w},set:function(a){w=a}},showControls:{get:function(){return u},set:function(a){u=a}},showLegend:{get:function(){return q},set:function(a){q=a}},average:{get:function(){return B},set:function(a){B=a}},defaultState:{get:function(){return z},set:function(a){z=a}},noData:{get:function(){return A},set:function(a){A=a}},showXAxis:{get:function(){return r},set:function(a){r=a}},showYAxis:{get:function(){return s},set:function(a){s=a}},noErrorCheck:{get:function(){return E},set:function(a){E=a}},tooltips:{get:function(){return l.enabled()},set:function(b){a.deprecated("tooltips","use chart.tooltip.enabled() instead"),l.enabled(!!b)}},tooltipContent:{get:function(){return l.contentGenerator()},set:function(b){a.deprecated("tooltipContent","use chart.tooltip.contentGenerator() instead"),l.contentGenerator(b)}},margin:{get:function(){return m},set:function(a){m.top=void 0!==a.top?a.top:m.top,m.right=void 0!==a.right?a.right:m.right,m.bottom=void 0!==a.bottom?a.bottom:m.bottom,m.left=void 0!==a.left?a.left:m.left}},color:{get:function(){return n},set:function(b){n=a.utils.getColor(b),i.color(n)}},useInteractiveGuideline:{get:function(){return v},set:function(a){v=a,a===!0&&(b.interactive(!1),b.useVoronoi(!1))}},rightAlignYAxis:{get:function(){return t},set:function(a){t=a,h.orient(a?"right":"left")}},duration:{get:function(){return D},set:function(a){D=a,f.duration(D),g.duration(D),h.duration(D),H.reset(D)}}}),a.utils.inheritOptions(b,f),a.utils.initOptions(b),b},a.models.discreteBar=function(){"use strict";function b(m){return y.reset(),m.each(function(b){var m=k-j.left-j.right,x=l-j.top-j.bottom;c=d3.select(this),a.utils.initSVG(c),b.forEach(function(a,b){a.values.forEach(function(a){a.series=b})});var z=d&&e?[]:b.map(function(a){return a.values.map(function(a,b){return{x:p(a,b),y:q(a,b),y0:a.y0}})});n.domain(d||d3.merge(z).map(function(a){return a.x})).rangeBands(f||[0,m],.1),o.domain(e||d3.extent(d3.merge(z).map(function(a){return a.y}).concat(r))),o.range(t?g||[x-(o.domain()[0]<0?12:0),o.domain()[1]>0?12:0]:g||[x,0]),h=h||n,i=i||o.copy().range([o(0),o(0)]);{var A=c.selectAll("g.nv-wrap.nv-discretebar").data([b]),B=A.enter().append("g").attr("class","nvd3 nv-wrap nv-discretebar"),C=B.append("g");A.select("g")}C.append("g").attr("class","nv-groups"),A.attr("transform","translate("+j.left+","+j.top+")");var D=A.select(".nv-groups").selectAll(".nv-group").data(function(a){return a},function(a){return a.key});D.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),D.exit().watchTransition(y,"discreteBar: exit groups").style("stroke-opacity",1e-6).style("fill-opacity",1e-6).remove(),D.attr("class",function(a,b){return"nv-group nv-series-"+b}).classed("hover",function(a){return a.hover}),D.watchTransition(y,"discreteBar: groups").style("stroke-opacity",1).style("fill-opacity",.75);var E=D.selectAll("g.nv-bar").data(function(a){return a.values});E.exit().remove();var F=E.enter().append("g").attr("transform",function(a,b){return"translate("+(n(p(a,b))+.05*n.rangeBand())+", "+o(0)+")"}).on("mouseover",function(a,b){d3.select(this).classed("hover",!0),v.elementMouseover({data:a,index:b,color:d3.select(this).style("fill")})}).on("mouseout",function(a,b){d3.select(this).classed("hover",!1),v.elementMouseout({data:a,index:b,color:d3.select(this).style("fill")})}).on("mousemove",function(a,b){v.elementMousemove({data:a,index:b,color:d3.select(this).style("fill")})}).on("click",function(a,b){v.elementClick({data:a,index:b,color:d3.select(this).style("fill")}),d3.event.stopPropagation()}).on("dblclick",function(a,b){v.elementDblClick({data:a,index:b,color:d3.select(this).style("fill")}),d3.event.stopPropagation()});F.append("rect").attr("height",0).attr("width",.9*n.rangeBand()/b.length),t?(F.append("text").attr("text-anchor","middle"),E.select("text").text(function(a,b){return u(q(a,b))}).watchTransition(y,"discreteBar: bars text").attr("x",.9*n.rangeBand()/2).attr("y",function(a,b){return q(a,b)<0?o(q(a,b))-o(0)+12:-4})):E.selectAll("text").remove(),E.attr("class",function(a,b){return q(a,b)<0?"nv-bar negative":"nv-bar positive"}).style("fill",function(a,b){return a.color||s(a,b)}).style("stroke",function(a,b){return a.color||s(a,b)}).select("rect").attr("class",w).watchTransition(y,"discreteBar: bars rect").attr("width",.9*n.rangeBand()/b.length),E.watchTransition(y,"discreteBar: bars").attr("transform",function(a,b){var c=n(p(a,b))+.05*n.rangeBand(),d=q(a,b)<0?o(0):o(0)-o(q(a,b))<1?o(0)-1:o(q(a,b));return"translate("+c+", "+d+")"}).select("rect").attr("height",function(a,b){return Math.max(Math.abs(o(q(a,b))-o(e&&e[0]||0))||1)}),h=n.copy(),i=o.copy()}),y.renderEnd("discreteBar immediate"),b}var c,d,e,f,g,h,i,j={top:0,right:0,bottom:0,left:0},k=960,l=500,m=Math.floor(1e4*Math.random()),n=d3.scale.ordinal(),o=d3.scale.linear(),p=function(a){return a.x},q=function(a){return a.y},r=[0],s=a.utils.defaultColor(),t=!1,u=d3.format(",.2f"),v=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),w="discreteBar",x=250,y=a.utils.renderWatch(v,x);return b.dispatch=v,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return k},set:function(a){k=a}},height:{get:function(){return l},set:function(a){l=a}},forceY:{get:function(){return r},set:function(a){r=a}},showValues:{get:function(){return t},set:function(a){t=a}},x:{get:function(){return p},set:function(a){p=a}},y:{get:function(){return q},set:function(a){q=a}},xScale:{get:function(){return n},set:function(a){n=a}},yScale:{get:function(){return o},set:function(a){o=a}},xDomain:{get:function(){return d},set:function(a){d=a}},yDomain:{get:function(){return e},set:function(a){e=a}},xRange:{get:function(){return f},set:function(a){f=a}},yRange:{get:function(){return g},set:function(a){g=a}},valueFormat:{get:function(){return u},set:function(a){u=a}},id:{get:function(){return m},set:function(a){m=a}},rectClass:{get:function(){return w},set:function(a){w=a}},margin:{get:function(){return j},set:function(a){j.top=void 0!==a.top?a.top:j.top,j.right=void 0!==a.right?a.right:j.right,j.bottom=void 0!==a.bottom?a.bottom:j.bottom,j.left=void 0!==a.left?a.left:j.left}},color:{get:function(){return s},set:function(b){s=a.utils.getColor(b)}},duration:{get:function(){return x},set:function(a){x=a,y.reset(x)}}}),a.utils.initOptions(b),b},a.models.discreteBarChart=function(){"use strict";function b(h){return t.reset(),t.models(e),m&&t.models(f),n&&t.models(g),h.each(function(h){var l=d3.select(this);a.utils.initSVG(l);var q=a.utils.availableWidth(j,l,i),t=a.utils.availableHeight(k,l,i);if(b.update=function(){r.beforeUpdate(),l.transition().duration(s).call(b)},b.container=this,!(h&&h.length&&h.filter(function(a){return a.values.length}).length))return a.utils.noData(b,l),b;l.selectAll(".nv-noData").remove(),c=e.xScale(),d=e.yScale().clamp(!0);var u=l.selectAll("g.nv-wrap.nv-discreteBarWithAxes").data([h]),v=u.enter().append("g").attr("class","nvd3 nv-wrap nv-discreteBarWithAxes").append("g"),w=v.append("defs"),x=u.select("g");v.append("g").attr("class","nv-x nv-axis"),v.append("g").attr("class","nv-y nv-axis").append("g").attr("class","nv-zeroLine").append("line"),v.append("g").attr("class","nv-barsWrap"),x.attr("transform","translate("+i.left+","+i.top+")"),o&&x.select(".nv-y.nv-axis").attr("transform","translate("+q+",0)"),e.width(q).height(t);var y=x.select(".nv-barsWrap").datum(h.filter(function(a){return!a.disabled}));if(y.transition().call(e),w.append("clipPath").attr("id","nv-x-label-clip-"+e.id()).append("rect"),x.select("#nv-x-label-clip-"+e.id()+" rect").attr("width",c.rangeBand()*(p?2:1)).attr("height",16).attr("x",-c.rangeBand()/(p?1:2)),m){f.scale(c)._ticks(a.utils.calcTicksX(q/100,h)).tickSize(-t,0),x.select(".nv-x.nv-axis").attr("transform","translate(0,"+(d.range()[0]+(e.showValues()&&d.domain()[0]<0?16:0))+")"),x.select(".nv-x.nv-axis").call(f); -var z=x.select(".nv-x.nv-axis").selectAll("g");p&&z.selectAll("text").attr("transform",function(a,b,c){return"translate(0,"+(c%2==0?"5":"17")+")"})}n&&(g.scale(d)._ticks(a.utils.calcTicksY(t/36,h)).tickSize(-q,0),x.select(".nv-y.nv-axis").call(g)),x.select(".nv-zeroLine line").attr("x1",0).attr("x2",q).attr("y1",d(0)).attr("y2",d(0))}),t.renderEnd("discreteBar chart immediate"),b}var c,d,e=a.models.discreteBar(),f=a.models.axis(),g=a.models.axis(),h=a.models.tooltip(),i={top:15,right:10,bottom:50,left:60},j=null,k=null,l=a.utils.getColor(),m=!0,n=!0,o=!1,p=!1,q=null,r=d3.dispatch("beforeUpdate","renderEnd"),s=250;f.orient("bottom").showMaxMin(!1).tickFormat(function(a){return a}),g.orient(o?"right":"left").tickFormat(d3.format(",.1f")),h.duration(0).headerEnabled(!1).valueFormatter(function(a,b){return g.tickFormat()(a,b)}).keyFormatter(function(a,b){return f.tickFormat()(a,b)});var t=a.utils.renderWatch(r,s);return e.dispatch.on("elementMouseover.tooltip",function(a){a.series={key:b.x()(a.data),value:b.y()(a.data),color:a.color},h.data(a).hidden(!1)}),e.dispatch.on("elementMouseout.tooltip",function(){h.hidden(!0)}),e.dispatch.on("elementMousemove.tooltip",function(){h.position({top:d3.event.pageY,left:d3.event.pageX})()}),b.dispatch=r,b.discretebar=e,b.xAxis=f,b.yAxis=g,b.tooltip=h,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return j},set:function(a){j=a}},height:{get:function(){return k},set:function(a){k=a}},staggerLabels:{get:function(){return p},set:function(a){p=a}},showXAxis:{get:function(){return m},set:function(a){m=a}},showYAxis:{get:function(){return n},set:function(a){n=a}},noData:{get:function(){return q},set:function(a){q=a}},tooltips:{get:function(){return h.enabled()},set:function(b){a.deprecated("tooltips","use chart.tooltip.enabled() instead"),h.enabled(!!b)}},tooltipContent:{get:function(){return h.contentGenerator()},set:function(b){a.deprecated("tooltipContent","use chart.tooltip.contentGenerator() instead"),h.contentGenerator(b)}},margin:{get:function(){return i},set:function(a){i.top=void 0!==a.top?a.top:i.top,i.right=void 0!==a.right?a.right:i.right,i.bottom=void 0!==a.bottom?a.bottom:i.bottom,i.left=void 0!==a.left?a.left:i.left}},duration:{get:function(){return s},set:function(a){s=a,t.reset(s),e.duration(s),f.duration(s),g.duration(s)}},color:{get:function(){return l},set:function(b){l=a.utils.getColor(b),e.color(l)}},rightAlignYAxis:{get:function(){return o},set:function(a){o=a,g.orient(a?"right":"left")}}}),a.utils.inheritOptions(b,e),a.utils.initOptions(b),b},a.models.distribution=function(){"use strict";function b(k){return m.reset(),k.each(function(b){var k=(e-("x"===g?d.left+d.right:d.top+d.bottom),"x"==g?"y":"x"),l=d3.select(this);a.utils.initSVG(l),c=c||j;var n=l.selectAll("g.nv-distribution").data([b]),o=n.enter().append("g").attr("class","nvd3 nv-distribution"),p=(o.append("g"),n.select("g"));n.attr("transform","translate("+d.left+","+d.top+")");var q=p.selectAll("g.nv-dist").data(function(a){return a},function(a){return a.key});q.enter().append("g"),q.attr("class",function(a,b){return"nv-dist nv-series-"+b}).style("stroke",function(a,b){return i(a,b)});var r=q.selectAll("line.nv-dist"+g).data(function(a){return a.values});r.enter().append("line").attr(g+"1",function(a,b){return c(h(a,b))}).attr(g+"2",function(a,b){return c(h(a,b))}),m.transition(q.exit().selectAll("line.nv-dist"+g),"dist exit").attr(g+"1",function(a,b){return j(h(a,b))}).attr(g+"2",function(a,b){return j(h(a,b))}).style("stroke-opacity",0).remove(),r.attr("class",function(a,b){return"nv-dist"+g+" nv-dist"+g+"-"+b}).attr(k+"1",0).attr(k+"2",f),m.transition(r,"dist").attr(g+"1",function(a,b){return j(h(a,b))}).attr(g+"2",function(a,b){return j(h(a,b))}),c=j.copy()}),m.renderEnd("distribution immediate"),b}var c,d={top:0,right:0,bottom:0,left:0},e=400,f=8,g="x",h=function(a){return a[g]},i=a.utils.defaultColor(),j=d3.scale.linear(),k=250,l=d3.dispatch("renderEnd"),m=a.utils.renderWatch(l,k);return b.options=a.utils.optionsFunc.bind(b),b.dispatch=l,b.margin=function(a){return arguments.length?(d.top="undefined"!=typeof a.top?a.top:d.top,d.right="undefined"!=typeof a.right?a.right:d.right,d.bottom="undefined"!=typeof a.bottom?a.bottom:d.bottom,d.left="undefined"!=typeof a.left?a.left:d.left,b):d},b.width=function(a){return arguments.length?(e=a,b):e},b.axis=function(a){return arguments.length?(g=a,b):g},b.size=function(a){return arguments.length?(f=a,b):f},b.getData=function(a){return arguments.length?(h=d3.functor(a),b):h},b.scale=function(a){return arguments.length?(j=a,b):j},b.color=function(c){return arguments.length?(i=a.utils.getColor(c),b):i},b.duration=function(a){return arguments.length?(k=a,m.reset(k),b):k},b},a.models.furiousLegend=function(){"use strict";function b(p){function q(a,b){return"furious"!=o?"#000":m?a.disengaged?g(a,b):"#fff":m?void 0:a.disabled?g(a,b):"#fff"}function r(a,b){return m&&"furious"==o?a.disengaged?"#fff":g(a,b):a.disabled?"#fff":g(a,b)}return p.each(function(b){var p=d-c.left-c.right,s=d3.select(this);a.utils.initSVG(s);var t=s.selectAll("g.nv-legend").data([b]),u=(t.enter().append("g").attr("class","nvd3 nv-legend").append("g"),t.select("g"));t.attr("transform","translate("+c.left+","+c.top+")");var v,w=u.selectAll(".nv-series").data(function(a){return"furious"!=o?a:a.filter(function(a){return m?!0:!a.disengaged})}),x=w.enter().append("g").attr("class","nv-series");if("classic"==o)x.append("circle").style("stroke-width",2).attr("class","nv-legend-symbol").attr("r",5),v=w.select("circle");else if("furious"==o){x.append("rect").style("stroke-width",2).attr("class","nv-legend-symbol").attr("rx",3).attr("ry",3),v=w.select("rect"),x.append("g").attr("class","nv-check-box").property("innerHTML",'').attr("transform","translate(-10,-8)scale(0.5)");var y=w.select(".nv-check-box");y.each(function(a,b){d3.select(this).selectAll("path").attr("stroke",q(a,b))})}x.append("text").attr("text-anchor","start").attr("class","nv-legend-text").attr("dy",".32em").attr("dx","8");var z=w.select("text.nv-legend-text");w.on("mouseover",function(a,b){n.legendMouseover(a,b)}).on("mouseout",function(a,b){n.legendMouseout(a,b)}).on("click",function(a,b){n.legendClick(a,b);var c=w.data();if(k){if("classic"==o)l?(c.forEach(function(a){a.disabled=!0}),a.disabled=!1):(a.disabled=!a.disabled,c.every(function(a){return a.disabled})&&c.forEach(function(a){a.disabled=!1}));else if("furious"==o)if(m)a.disengaged=!a.disengaged,a.userDisabled=void 0==a.userDisabled?!!a.disabled:a.userDisabled,a.disabled=a.disengaged||a.userDisabled;else if(!m){a.disabled=!a.disabled,a.userDisabled=a.disabled;var d=c.filter(function(a){return!a.disengaged});d.every(function(a){return a.userDisabled})&&c.forEach(function(a){a.disabled=a.userDisabled=!1})}n.stateChange({disabled:c.map(function(a){return!!a.disabled}),disengaged:c.map(function(a){return!!a.disengaged})})}}).on("dblclick",function(a,b){if(("furious"!=o||!m)&&(n.legendDblclick(a,b),k)){var c=w.data();c.forEach(function(a){a.disabled=!0,"furious"==o&&(a.userDisabled=a.disabled)}),a.disabled=!1,"furious"==o&&(a.userDisabled=a.disabled),n.stateChange({disabled:c.map(function(a){return!!a.disabled})})}}),w.classed("nv-disabled",function(a){return a.userDisabled}),w.exit().remove(),z.attr("fill",q).text(f);var A;switch(o){case"furious":A=23;break;case"classic":A=20}if(h){var B=[];w.each(function(){var b,c=d3.select(this).select("text");try{if(b=c.node().getComputedTextLength(),0>=b)throw Error()}catch(d){b=a.utils.calcApproxTextWidth(c)}B.push(b+i)});for(var C=0,D=0,E=[];p>D&&Cp&&C>1;){E=[],C--;for(var F=0;F(E[F%C]||0)&&(E[F%C]=B[F]);D=E.reduce(function(a,b){return a+b})}for(var G=[],H=0,I=0;C>H;H++)G[H]=I,I+=E[H];w.attr("transform",function(a,b){return"translate("+G[b%C]+","+(5+Math.floor(b/C)*A)+")"}),j?u.attr("transform","translate("+(d-c.right-D)+","+c.top+")"):u.attr("transform","translate(0,"+c.top+")"),e=c.top+c.bottom+Math.ceil(B.length/C)*A}else{var J,K=5,L=5,M=0;w.attr("transform",function(){var a=d3.select(this).select("text").node().getComputedTextLength()+i;return J=L,dM&&(M=L),"translate("+J+","+K+")"}),u.attr("transform","translate("+(d-c.right-M)+","+c.top+")"),e=c.top+c.bottom+K+15}"furious"==o&&v.attr("width",function(a,b){return z[0][b].getComputedTextLength()+27}).attr("height",18).attr("y",-9).attr("x",-15),v.style("fill",r).style("stroke",function(a,b){return a.color||g(a,b)})}),b}var c={top:5,right:0,bottom:5,left:0},d=400,e=20,f=function(a){return a.key},g=a.utils.getColor(),h=!0,i=28,j=!0,k=!0,l=!1,m=!1,n=d3.dispatch("legendClick","legendDblclick","legendMouseover","legendMouseout","stateChange"),o="classic";return b.dispatch=n,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return d},set:function(a){d=a}},height:{get:function(){return e},set:function(a){e=a}},key:{get:function(){return f},set:function(a){f=a}},align:{get:function(){return h},set:function(a){h=a}},rightAlign:{get:function(){return j},set:function(a){j=a}},padding:{get:function(){return i},set:function(a){i=a}},updateState:{get:function(){return k},set:function(a){k=a}},radioButtonMode:{get:function(){return l},set:function(a){l=a}},expanded:{get:function(){return m},set:function(a){m=a}},vers:{get:function(){return o},set:function(a){o=a}},margin:{get:function(){return c},set:function(a){c.top=void 0!==a.top?a.top:c.top,c.right=void 0!==a.right?a.right:c.right,c.bottom=void 0!==a.bottom?a.bottom:c.bottom,c.left=void 0!==a.left?a.left:c.left}},color:{get:function(){return g},set:function(b){g=a.utils.getColor(b)}}}),a.utils.initOptions(b),b},a.models.historicalBar=function(){"use strict";function b(x){return x.each(function(b){w.reset(),k=d3.select(this);var x=a.utils.availableWidth(h,k,g),y=a.utils.availableHeight(i,k,g);a.utils.initSVG(k),l.domain(c||d3.extent(b[0].values.map(n).concat(p))),l.range(r?e||[.5*x/b[0].values.length,x*(b[0].values.length-.5)/b[0].values.length]:e||[0,x]),m.domain(d||d3.extent(b[0].values.map(o).concat(q))).range(f||[y,0]),l.domain()[0]===l.domain()[1]&&l.domain(l.domain()[0]?[l.domain()[0]-.01*l.domain()[0],l.domain()[1]+.01*l.domain()[1]]:[-1,1]),m.domain()[0]===m.domain()[1]&&m.domain(m.domain()[0]?[m.domain()[0]+.01*m.domain()[0],m.domain()[1]-.01*m.domain()[1]]:[-1,1]);var z=k.selectAll("g.nv-wrap.nv-historicalBar-"+j).data([b[0].values]),A=z.enter().append("g").attr("class","nvd3 nv-wrap nv-historicalBar-"+j),B=A.append("defs"),C=A.append("g"),D=z.select("g");C.append("g").attr("class","nv-bars"),z.attr("transform","translate("+g.left+","+g.top+")"),k.on("click",function(a,b){u.chartClick({data:a,index:b,pos:d3.event,id:j})}),B.append("clipPath").attr("id","nv-chart-clip-path-"+j).append("rect"),z.select("#nv-chart-clip-path-"+j+" rect").attr("width",x).attr("height",y),D.attr("clip-path",s?"url(#nv-chart-clip-path-"+j+")":"");var E=z.select(".nv-bars").selectAll(".nv-bar").data(function(a){return a},function(a,b){return n(a,b)});E.exit().remove(),E.enter().append("rect").attr("x",0).attr("y",function(b,c){return a.utils.NaNtoZero(m(Math.max(0,o(b,c))))}).attr("height",function(b,c){return a.utils.NaNtoZero(Math.abs(m(o(b,c))-m(0)))}).attr("transform",function(a,c){return"translate("+(l(n(a,c))-x/b[0].values.length*.45)+",0)"}).on("mouseover",function(a,b){v&&(d3.select(this).classed("hover",!0),u.elementMouseover({data:a,index:b,color:d3.select(this).style("fill")}))}).on("mouseout",function(a,b){v&&(d3.select(this).classed("hover",!1),u.elementMouseout({data:a,index:b,color:d3.select(this).style("fill")}))}).on("mousemove",function(a,b){v&&u.elementMousemove({data:a,index:b,color:d3.select(this).style("fill")})}).on("click",function(a,b){v&&(u.elementClick({data:a,index:b,color:d3.select(this).style("fill")}),d3.event.stopPropagation())}).on("dblclick",function(a,b){v&&(u.elementDblClick({data:a,index:b,color:d3.select(this).style("fill")}),d3.event.stopPropagation())}),E.attr("fill",function(a,b){return t(a,b)}).attr("class",function(a,b,c){return(o(a,b)<0?"nv-bar negative":"nv-bar positive")+" nv-bar-"+c+"-"+b}).watchTransition(w,"bars").attr("transform",function(a,c){return"translate("+(l(n(a,c))-x/b[0].values.length*.45)+",0)"}).attr("width",x/b[0].values.length*.9),E.watchTransition(w,"bars").attr("y",function(b,c){var d=o(b,c)<0?m(0):m(0)-m(o(b,c))<1?m(0)-1:m(o(b,c));return a.utils.NaNtoZero(d)}).attr("height",function(b,c){return a.utils.NaNtoZero(Math.max(Math.abs(m(o(b,c))-m(0)),1))})}),w.renderEnd("historicalBar immediate"),b}var c,d,e,f,g={top:0,right:0,bottom:0,left:0},h=null,i=null,j=Math.floor(1e4*Math.random()),k=null,l=d3.scale.linear(),m=d3.scale.linear(),n=function(a){return a.x},o=function(a){return a.y},p=[],q=[0],r=!1,s=!0,t=a.utils.defaultColor(),u=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),v=!0,w=a.utils.renderWatch(u,0);return b.highlightPoint=function(a,b){k.select(".nv-bars .nv-bar-0-"+a).classed("hover",b)},b.clearHighlights=function(){k.select(".nv-bars .nv-bar.hover").classed("hover",!1)},b.dispatch=u,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return h},set:function(a){h=a}},height:{get:function(){return i},set:function(a){i=a}},forceX:{get:function(){return p},set:function(a){p=a}},forceY:{get:function(){return q},set:function(a){q=a}},padData:{get:function(){return r},set:function(a){r=a}},x:{get:function(){return n},set:function(a){n=a}},y:{get:function(){return o},set:function(a){o=a}},xScale:{get:function(){return l},set:function(a){l=a}},yScale:{get:function(){return m},set:function(a){m=a}},xDomain:{get:function(){return c},set:function(a){c=a}},yDomain:{get:function(){return d},set:function(a){d=a}},xRange:{get:function(){return e},set:function(a){e=a}},yRange:{get:function(){return f},set:function(a){f=a}},clipEdge:{get:function(){return s},set:function(a){s=a}},id:{get:function(){return j},set:function(a){j=a}},interactive:{get:function(){return v},set:function(a){v=a}},margin:{get:function(){return g},set:function(a){g.top=void 0!==a.top?a.top:g.top,g.right=void 0!==a.right?a.right:g.right,g.bottom=void 0!==a.bottom?a.bottom:g.bottom,g.left=void 0!==a.left?a.left:g.left}},color:{get:function(){return t},set:function(b){t=a.utils.getColor(b)}}}),a.utils.initOptions(b),b},a.models.historicalBarChart=function(b){"use strict";function c(b){return b.each(function(k){z.reset(),z.models(f),q&&z.models(g),r&&z.models(h);var w=d3.select(this),A=this;a.utils.initSVG(w);var B=a.utils.availableWidth(n,w,l),C=a.utils.availableHeight(o,w,l);if(c.update=function(){w.transition().duration(y).call(c)},c.container=this,u.disabled=k.map(function(a){return!!a.disabled}),!v){var D;v={};for(D in u)v[D]=u[D]instanceof Array?u[D].slice(0):u[D]}if(!(k&&k.length&&k.filter(function(a){return a.values.length}).length))return a.utils.noData(c,w),c;w.selectAll(".nv-noData").remove(),d=f.xScale(),e=f.yScale();var E=w.selectAll("g.nv-wrap.nv-historicalBarChart").data([k]),F=E.enter().append("g").attr("class","nvd3 nv-wrap nv-historicalBarChart").append("g"),G=E.select("g");F.append("g").attr("class","nv-x nv-axis"),F.append("g").attr("class","nv-y nv-axis"),F.append("g").attr("class","nv-barsWrap"),F.append("g").attr("class","nv-legendWrap"),F.append("g").attr("class","nv-interactive"),p&&(i.width(B),G.select(".nv-legendWrap").datum(k).call(i),l.top!=i.height()&&(l.top=i.height(),C=a.utils.availableHeight(o,w,l)),E.select(".nv-legendWrap").attr("transform","translate(0,"+-l.top+")")),E.attr("transform","translate("+l.left+","+l.top+")"),s&&G.select(".nv-y.nv-axis").attr("transform","translate("+B+",0)"),t&&(j.width(B).height(C).margin({left:l.left,top:l.top}).svgContainer(w).xScale(d),E.select(".nv-interactive").call(j)),f.width(B).height(C).color(k.map(function(a,b){return a.color||m(a,b)}).filter(function(a,b){return!k[b].disabled}));var H=G.select(".nv-barsWrap").datum(k.filter(function(a){return!a.disabled}));H.transition().call(f),q&&(g.scale(d)._ticks(a.utils.calcTicksX(B/100,k)).tickSize(-C,0),G.select(".nv-x.nv-axis").attr("transform","translate(0,"+e.range()[0]+")"),G.select(".nv-x.nv-axis").transition().call(g)),r&&(h.scale(e)._ticks(a.utils.calcTicksY(C/36,k)).tickSize(-B,0),G.select(".nv-y.nv-axis").transition().call(h)),j.dispatch.on("elementMousemove",function(b){f.clearHighlights();var d,e,i,n=[];k.filter(function(a,b){return a.seriesIndex=b,!a.disabled}).forEach(function(g){e=a.interactiveBisect(g.values,b.pointXValue,c.x()),f.highlightPoint(e,!0);var h=g.values[e];void 0!==h&&(void 0===d&&(d=h),void 0===i&&(i=c.xScale()(c.x()(h,e))),n.push({key:g.key,value:c.y()(h,e),color:m(g,g.seriesIndex),data:g.values[e]}))});var o=g.tickFormat()(c.x()(d,e));j.tooltip.position({left:i+l.left,top:b.mouseY+l.top}).chartContainer(A.parentNode).valueFormatter(function(a){return h.tickFormat()(a)}).data({value:o,index:e,series:n})(),j.renderGuideLine(i)}),j.dispatch.on("elementMouseout",function(){x.tooltipHide(),f.clearHighlights()}),i.dispatch.on("legendClick",function(a){a.disabled=!a.disabled,k.filter(function(a){return!a.disabled}).length||k.map(function(a){return a.disabled=!1,E.selectAll(".nv-series").classed("disabled",!1),a}),u.disabled=k.map(function(a){return!!a.disabled}),x.stateChange(u),b.transition().call(c)}),i.dispatch.on("legendDblclick",function(a){k.forEach(function(a){a.disabled=!0}),a.disabled=!1,u.disabled=k.map(function(a){return!!a.disabled}),x.stateChange(u),c.update()}),x.on("changeState",function(a){"undefined"!=typeof a.disabled&&(k.forEach(function(b,c){b.disabled=a.disabled[c]}),u.disabled=a.disabled),c.update()})}),z.renderEnd("historicalBarChart immediate"),c}var d,e,f=b||a.models.historicalBar(),g=a.models.axis(),h=a.models.axis(),i=a.models.legend(),j=a.interactiveGuideline(),k=a.models.tooltip(),l={top:30,right:90,bottom:50,left:90},m=a.utils.defaultColor(),n=null,o=null,p=!1,q=!0,r=!0,s=!1,t=!1,u={},v=null,w=null,x=d3.dispatch("tooltipHide","stateChange","changeState","renderEnd"),y=250;g.orient("bottom").tickPadding(7),h.orient(s?"right":"left"),k.duration(0).headerEnabled(!1).valueFormatter(function(a,b){return h.tickFormat()(a,b)}).headerFormatter(function(a,b){return g.tickFormat()(a,b)});var z=a.utils.renderWatch(x,0);return f.dispatch.on("elementMouseover.tooltip",function(a){a.series={key:c.x()(a.data),value:c.y()(a.data),color:a.color},k.data(a).hidden(!1)}),f.dispatch.on("elementMouseout.tooltip",function(){k.hidden(!0)}),f.dispatch.on("elementMousemove.tooltip",function(){k.position({top:d3.event.pageY,left:d3.event.pageX})()}),c.dispatch=x,c.bars=f,c.legend=i,c.xAxis=g,c.yAxis=h,c.interactiveLayer=j,c.tooltip=k,c.options=a.utils.optionsFunc.bind(c),c._options=Object.create({},{width:{get:function(){return n},set:function(a){n=a}},height:{get:function(){return o},set:function(a){o=a}},showLegend:{get:function(){return p},set:function(a){p=a}},showXAxis:{get:function(){return q},set:function(a){q=a}},showYAxis:{get:function(){return r},set:function(a){r=a}},defaultState:{get:function(){return v},set:function(a){v=a}},noData:{get:function(){return w},set:function(a){w=a}},tooltips:{get:function(){return k.enabled()},set:function(b){a.deprecated("tooltips","use chart.tooltip.enabled() instead"),k.enabled(!!b)}},tooltipContent:{get:function(){return k.contentGenerator()},set:function(b){a.deprecated("tooltipContent","use chart.tooltip.contentGenerator() instead"),k.contentGenerator(b)}},margin:{get:function(){return l},set:function(a){l.top=void 0!==a.top?a.top:l.top,l.right=void 0!==a.right?a.right:l.right,l.bottom=void 0!==a.bottom?a.bottom:l.bottom,l.left=void 0!==a.left?a.left:l.left}},color:{get:function(){return m},set:function(b){m=a.utils.getColor(b),i.color(m),f.color(m)}},duration:{get:function(){return y},set:function(a){y=a,z.reset(y),h.duration(y),g.duration(y)}},rightAlignYAxis:{get:function(){return s},set:function(a){s=a,h.orient(a?"right":"left")}},useInteractiveGuideline:{get:function(){return t},set:function(a){t=a,a===!0&&c.interactive(!1)}}}),a.utils.inheritOptions(c,f),a.utils.initOptions(c),c},a.models.ohlcBarChart=function(){var b=a.models.historicalBarChart(a.models.ohlcBar());return b.useInteractiveGuideline(!0),b.interactiveLayer.tooltip.contentGenerator(function(a){var c=a.series[0].data,d=c.open'+a.value+"
open:"+b.yAxis.tickFormat()(c.open)+"
close:"+b.yAxis.tickFormat()(c.close)+"
high"+b.yAxis.tickFormat()(c.high)+"
low:"+b.yAxis.tickFormat()(c.low)+"
"}),b},a.models.candlestickBarChart=function(){var b=a.models.historicalBarChart(a.models.candlestickBar());return b.useInteractiveGuideline(!0),b.interactiveLayer.tooltip.contentGenerator(function(a){var c=a.series[0].data,d=c.open'+a.value+"
open:"+b.yAxis.tickFormat()(c.open)+"
close:"+b.yAxis.tickFormat()(c.close)+"
high"+b.yAxis.tickFormat()(c.high)+"
low:"+b.yAxis.tickFormat()(c.low)+"
"}),b},a.models.legend=function(){"use strict";function b(p){function q(a,b){return"furious"!=o?"#000":m?a.disengaged?"#000":"#fff":m?void 0:(a.color||(a.color=g(a,b)),a.disabled?a.color:"#fff")}function r(a,b){return m&&"furious"==o&&a.disengaged?"#eee":a.color||g(a,b)}function s(a){return m&&"furious"==o?1:a.disabled?0:1}return p.each(function(b){var g=d-c.left-c.right,p=d3.select(this);a.utils.initSVG(p);var t=p.selectAll("g.nv-legend").data([b]),u=t.enter().append("g").attr("class","nvd3 nv-legend").append("g"),v=t.select("g");t.attr("transform","translate("+c.left+","+c.top+")");var w,x,y=v.selectAll(".nv-series").data(function(a){return"furious"!=o?a:a.filter(function(a){return m?!0:!a.disengaged})}),z=y.enter().append("g").attr("class","nv-series");switch(o){case"furious":x=23;break;case"classic":x=20}if("classic"==o)z.append("circle").style("stroke-width",2).attr("class","nv-legend-symbol").attr("r",5),w=y.select("circle");else if("furious"==o){z.append("rect").style("stroke-width",2).attr("class","nv-legend-symbol").attr("rx",3).attr("ry",3),w=y.select(".nv-legend-symbol"),z.append("g").attr("class","nv-check-box").property("innerHTML",'').attr("transform","translate(-10,-8)scale(0.5)");var A=y.select(".nv-check-box");A.each(function(a,b){d3.select(this).selectAll("path").attr("stroke",q(a,b))})}z.append("text").attr("text-anchor","start").attr("class","nv-legend-text").attr("dy",".32em").attr("dx","8");var B=y.select("text.nv-legend-text");y.on("mouseover",function(a,b){n.legendMouseover(a,b)}).on("mouseout",function(a,b){n.legendMouseout(a,b)}).on("click",function(a,b){n.legendClick(a,b);var c=y.data();if(k){if("classic"==o)l?(c.forEach(function(a){a.disabled=!0}),a.disabled=!1):(a.disabled=!a.disabled,c.every(function(a){return a.disabled})&&c.forEach(function(a){a.disabled=!1}));else if("furious"==o)if(m)a.disengaged=!a.disengaged,a.userDisabled=void 0==a.userDisabled?!!a.disabled:a.userDisabled,a.disabled=a.disengaged||a.userDisabled;else if(!m){a.disabled=!a.disabled,a.userDisabled=a.disabled;var d=c.filter(function(a){return!a.disengaged});d.every(function(a){return a.userDisabled})&&c.forEach(function(a){a.disabled=a.userDisabled=!1})}n.stateChange({disabled:c.map(function(a){return!!a.disabled}),disengaged:c.map(function(a){return!!a.disengaged})})}}).on("dblclick",function(a,b){if(("furious"!=o||!m)&&(n.legendDblclick(a,b),k)){var c=y.data();c.forEach(function(a){a.disabled=!0,"furious"==o&&(a.userDisabled=a.disabled)}),a.disabled=!1,"furious"==o&&(a.userDisabled=a.disabled),n.stateChange({disabled:c.map(function(a){return!!a.disabled})})}}),y.classed("nv-disabled",function(a){return a.userDisabled}),y.exit().remove(),B.attr("fill",q).text(f);var C=0;if(h){var D=[];y.each(function(){var b,c=d3.select(this).select("text");try{if(b=c.node().getComputedTextLength(),0>=b)throw Error()}catch(d){b=a.utils.calcApproxTextWidth(c)}D.push(b+i)});var E=0,F=[];for(C=0;g>C&&Eg&&E>1;){F=[],E--;for(var G=0;G(F[G%E]||0)&&(F[G%E]=D[G]);C=F.reduce(function(a,b){return a+b})}for(var H=[],I=0,J=0;E>I;I++)H[I]=J,J+=F[I];y.attr("transform",function(a,b){return"translate("+H[b%E]+","+(5+Math.floor(b/E)*x)+")"}),j?v.attr("transform","translate("+(d-c.right-C)+","+c.top+")"):v.attr("transform","translate(0,"+c.top+")"),e=c.top+c.bottom+Math.ceil(D.length/E)*x}else{var K,L=5,M=5,N=0;y.attr("transform",function(){var a=d3.select(this).select("text").node().getComputedTextLength()+i;return K=M,dN&&(N=M),K+N>C&&(C=K+N),"translate("+K+","+L+")"}),v.attr("transform","translate("+(d-c.right-N)+","+c.top+")"),e=c.top+c.bottom+L+15}if("furious"==o){w.attr("width",function(a,b){return B[0][b].getComputedTextLength()+27}).attr("height",18).attr("y",-9).attr("x",-15),u.insert("rect",":first-child").attr("class","nv-legend-bg").attr("fill","#eee").attr("opacity",0);var O=v.select(".nv-legend-bg");O.transition().duration(300).attr("x",-x).attr("width",C+x-12).attr("height",e+10).attr("y",-c.top-10).attr("opacity",m?1:0)}w.style("fill",r).style("fill-opacity",s).style("stroke",r)}),b}var c={top:5,right:0,bottom:5,left:0},d=400,e=20,f=function(a){return a.key},g=a.utils.getColor(),h=!0,i=32,j=!0,k=!0,l=!1,m=!1,n=d3.dispatch("legendClick","legendDblclick","legendMouseover","legendMouseout","stateChange"),o="classic";return b.dispatch=n,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return d},set:function(a){d=a}},height:{get:function(){return e},set:function(a){e=a}},key:{get:function(){return f},set:function(a){f=a}},align:{get:function(){return h},set:function(a){h=a}},rightAlign:{get:function(){return j},set:function(a){j=a}},padding:{get:function(){return i},set:function(a){i=a}},updateState:{get:function(){return k},set:function(a){k=a}},radioButtonMode:{get:function(){return l},set:function(a){l=a}},expanded:{get:function(){return m},set:function(a){m=a}},vers:{get:function(){return o},set:function(a){o=a}},margin:{get:function(){return c},set:function(a){c.top=void 0!==a.top?a.top:c.top,c.right=void 0!==a.right?a.right:c.right,c.bottom=void 0!==a.bottom?a.bottom:c.bottom,c.left=void 0!==a.left?a.left:c.left}},color:{get:function(){return g},set:function(b){g=a.utils.getColor(b)}}}),a.utils.initOptions(b),b},a.models.line=function(){"use strict";function b(r){return v.reset(),v.models(e),r.each(function(b){i=d3.select(this);var r=a.utils.availableWidth(g,i,f),s=a.utils.availableHeight(h,i,f);a.utils.initSVG(i),c=e.xScale(),d=e.yScale(),t=t||c,u=u||d;var w=i.selectAll("g.nv-wrap.nv-line").data([b]),x=w.enter().append("g").attr("class","nvd3 nv-wrap nv-line"),y=x.append("defs"),z=x.append("g"),A=w.select("g");z.append("g").attr("class","nv-groups"),z.append("g").attr("class","nv-scatterWrap"),w.attr("transform","translate("+f.left+","+f.top+")"),e.width(r).height(s);var B=w.select(".nv-scatterWrap");B.call(e),y.append("clipPath").attr("id","nv-edge-clip-"+e.id()).append("rect"),w.select("#nv-edge-clip-"+e.id()+" rect").attr("width",r).attr("height",s>0?s:0),A.attr("clip-path",p?"url(#nv-edge-clip-"+e.id()+")":""),B.attr("clip-path",p?"url(#nv-edge-clip-"+e.id()+")":"");var C=w.select(".nv-groups").selectAll(".nv-group").data(function(a){return a},function(a){return a.key});C.enter().append("g").style("stroke-opacity",1e-6).style("stroke-width",function(a){return a.strokeWidth||j}).style("fill-opacity",1e-6),C.exit().remove(),C.attr("class",function(a,b){return(a.classed||"")+" nv-group nv-series-"+b}).classed("hover",function(a){return a.hover}).style("fill",function(a,b){return k(a,b)}).style("stroke",function(a,b){return k(a,b)}),C.watchTransition(v,"line: groups").style("stroke-opacity",1).style("fill-opacity",function(a){return a.fillOpacity||.5});var D=C.selectAll("path.nv-area").data(function(a){return o(a)?[a]:[]});D.enter().append("path").attr("class","nv-area").attr("d",function(b){return d3.svg.area().interpolate(q).defined(n).x(function(b,c){return a.utils.NaNtoZero(t(l(b,c)))}).y0(function(b,c){return a.utils.NaNtoZero(u(m(b,c)))}).y1(function(){return u(d.domain()[0]<=0?d.domain()[1]>=0?0:d.domain()[1]:d.domain()[0])}).apply(this,[b.values])}),C.exit().selectAll("path.nv-area").remove(),D.watchTransition(v,"line: areaPaths").attr("d",function(b){return d3.svg.area().interpolate(q).defined(n).x(function(b,d){return a.utils.NaNtoZero(c(l(b,d)))}).y0(function(b,c){return a.utils.NaNtoZero(d(m(b,c)))}).y1(function(){return d(d.domain()[0]<=0?d.domain()[1]>=0?0:d.domain()[1]:d.domain()[0])}).apply(this,[b.values])});var E=C.selectAll("path.nv-line").data(function(a){return[a.values]});E.enter().append("path").attr("class","nv-line").attr("d",d3.svg.line().interpolate(q).defined(n).x(function(b,c){return a.utils.NaNtoZero(t(l(b,c)))}).y(function(b,c){return a.utils.NaNtoZero(u(m(b,c)))})),E.watchTransition(v,"line: linePaths").attr("d",d3.svg.line().interpolate(q).defined(n).x(function(b,d){return a.utils.NaNtoZero(c(l(b,d)))}).y(function(b,c){return a.utils.NaNtoZero(d(m(b,c)))})),t=c.copy(),u=d.copy()}),v.renderEnd("line immediate"),b}var c,d,e=a.models.scatter(),f={top:0,right:0,bottom:0,left:0},g=960,h=500,i=null,j=1.5,k=a.utils.defaultColor(),l=function(a){return a.x},m=function(a){return a.y},n=function(a,b){return!isNaN(m(a,b))&&null!==m(a,b)},o=function(a){return a.area},p=!1,q="linear",r=250,s=d3.dispatch("elementClick","elementMouseover","elementMouseout","renderEnd");e.pointSize(16).pointDomain([16,256]);var t,u,v=a.utils.renderWatch(s,r);return b.dispatch=s,b.scatter=e,e.dispatch.on("elementClick",function(){s.elementClick.apply(this,arguments)}),e.dispatch.on("elementMouseover",function(){s.elementMouseover.apply(this,arguments)}),e.dispatch.on("elementMouseout",function(){s.elementMouseout.apply(this,arguments)}),b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return g},set:function(a){g=a}},height:{get:function(){return h},set:function(a){h=a}},defined:{get:function(){return n},set:function(a){n=a}},interpolate:{get:function(){return q},set:function(a){q=a}},clipEdge:{get:function(){return p},set:function(a){p=a}},margin:{get:function(){return f},set:function(a){f.top=void 0!==a.top?a.top:f.top,f.right=void 0!==a.right?a.right:f.right,f.bottom=void 0!==a.bottom?a.bottom:f.bottom,f.left=void 0!==a.left?a.left:f.left}},duration:{get:function(){return r},set:function(a){r=a,v.reset(r),e.duration(r)}},isArea:{get:function(){return o},set:function(a){o=d3.functor(a)}},x:{get:function(){return l},set:function(a){l=a,e.x(a)}},y:{get:function(){return m},set:function(a){m=a,e.y(a)}},color:{get:function(){return k},set:function(b){k=a.utils.getColor(b),e.color(k)}}}),a.utils.inheritOptions(b,e),a.utils.initOptions(b),b},a.models.lineChart=function(){"use strict";function b(j){return y.reset(),y.models(e),p&&y.models(f),q&&y.models(g),j.each(function(j){var v=d3.select(this),y=this;a.utils.initSVG(v);var B=a.utils.availableWidth(m,v,k),C=a.utils.availableHeight(n,v,k);if(b.update=function(){0===x?v.call(b):v.transition().duration(x).call(b)},b.container=this,t.setter(A(j),b.update).getter(z(j)).update(),t.disabled=j.map(function(a){return!!a.disabled}),!u){var D;u={};for(D in t)u[D]=t[D]instanceof Array?t[D].slice(0):t[D] -}if(!(j&&j.length&&j.filter(function(a){return a.values.length}).length))return a.utils.noData(b,v),b;v.selectAll(".nv-noData").remove(),c=e.xScale(),d=e.yScale();var E=v.selectAll("g.nv-wrap.nv-lineChart").data([j]),F=E.enter().append("g").attr("class","nvd3 nv-wrap nv-lineChart").append("g"),G=E.select("g");F.append("rect").style("opacity",0),F.append("g").attr("class","nv-x nv-axis"),F.append("g").attr("class","nv-y nv-axis"),F.append("g").attr("class","nv-linesWrap"),F.append("g").attr("class","nv-legendWrap"),F.append("g").attr("class","nv-interactive"),G.select("rect").attr("width",B).attr("height",C>0?C:0),o&&(h.width(B),G.select(".nv-legendWrap").datum(j).call(h),k.top!=h.height()&&(k.top=h.height(),C=a.utils.availableHeight(n,v,k)),E.select(".nv-legendWrap").attr("transform","translate(0,"+-k.top+")")),E.attr("transform","translate("+k.left+","+k.top+")"),r&&G.select(".nv-y.nv-axis").attr("transform","translate("+B+",0)"),s&&(i.width(B).height(C).margin({left:k.left,top:k.top}).svgContainer(v).xScale(c),E.select(".nv-interactive").call(i)),e.width(B).height(C).color(j.map(function(a,b){return a.color||l(a,b)}).filter(function(a,b){return!j[b].disabled}));var H=G.select(".nv-linesWrap").datum(j.filter(function(a){return!a.disabled}));H.call(e),p&&(f.scale(c)._ticks(a.utils.calcTicksX(B/100,j)).tickSize(-C,0),G.select(".nv-x.nv-axis").attr("transform","translate(0,"+d.range()[0]+")"),G.select(".nv-x.nv-axis").call(f)),q&&(g.scale(d)._ticks(a.utils.calcTicksY(C/36,j)).tickSize(-B,0),G.select(".nv-y.nv-axis").call(g)),h.dispatch.on("stateChange",function(a){for(var c in a)t[c]=a[c];w.stateChange(t),b.update()}),i.dispatch.on("elementMousemove",function(c){e.clearHighlights();var d,h,m,n=[];if(j.filter(function(a,b){return a.seriesIndex=b,!a.disabled}).forEach(function(f,g){h=a.interactiveBisect(f.values,c.pointXValue,b.x());var i=f.values[h],j=b.y()(i,h);null!=j&&e.highlightPoint(g,h,!0),void 0!==i&&(void 0===d&&(d=i),void 0===m&&(m=b.xScale()(b.x()(i,h))),n.push({key:f.key,value:j,color:l(f,f.seriesIndex)}))}),n.length>2){var o=b.yScale().invert(c.mouseY),p=Math.abs(b.yScale().domain()[0]-b.yScale().domain()[1]),q=.03*p,r=a.nearestValueIndex(n.map(function(a){return a.value}),o,q);null!==r&&(n[r].highlight=!0)}var s=f.tickFormat()(b.x()(d,h));i.tooltip.position({left:c.mouseX+k.left,top:c.mouseY+k.top}).chartContainer(y.parentNode).valueFormatter(function(a){return null==a?"N/A":g.tickFormat()(a)}).data({value:s,index:h,series:n})(),i.renderGuideLine(m)}),i.dispatch.on("elementClick",function(c){var d,f=[];j.filter(function(a,b){return a.seriesIndex=b,!a.disabled}).forEach(function(e){var g=a.interactiveBisect(e.values,c.pointXValue,b.x()),h=e.values[g];if("undefined"!=typeof h){"undefined"==typeof d&&(d=b.xScale()(b.x()(h,g)));var i=b.yScale()(b.y()(h,g));f.push({point:h,pointIndex:g,pos:[d,i],seriesIndex:e.seriesIndex,series:e})}}),e.dispatch.elementClick(f)}),i.dispatch.on("elementMouseout",function(){e.clearHighlights()}),w.on("changeState",function(a){"undefined"!=typeof a.disabled&&j.length===a.disabled.length&&(j.forEach(function(b,c){b.disabled=a.disabled[c]}),t.disabled=a.disabled),b.update()})}),y.renderEnd("lineChart immediate"),b}var c,d,e=a.models.line(),f=a.models.axis(),g=a.models.axis(),h=a.models.legend(),i=a.interactiveGuideline(),j=a.models.tooltip(),k={top:30,right:20,bottom:50,left:60},l=a.utils.defaultColor(),m=null,n=null,o=!0,p=!0,q=!0,r=!1,s=!1,t=a.utils.state(),u=null,v=null,w=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState","renderEnd"),x=250;f.orient("bottom").tickPadding(7),g.orient(r?"right":"left"),j.valueFormatter(function(a,b){return g.tickFormat()(a,b)}).headerFormatter(function(a,b){return f.tickFormat()(a,b)});var y=a.utils.renderWatch(w,x),z=function(a){return function(){return{active:a.map(function(a){return!a.disabled})}}},A=function(a){return function(b){void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}};return e.dispatch.on("elementMouseover.tooltip",function(a){j.data(a).position(a.pos).hidden(!1)}),e.dispatch.on("elementMouseout.tooltip",function(){j.hidden(!0)}),b.dispatch=w,b.lines=e,b.legend=h,b.xAxis=f,b.yAxis=g,b.interactiveLayer=i,b.tooltip=j,b.dispatch=w,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return m},set:function(a){m=a}},height:{get:function(){return n},set:function(a){n=a}},showLegend:{get:function(){return o},set:function(a){o=a}},showXAxis:{get:function(){return p},set:function(a){p=a}},showYAxis:{get:function(){return q},set:function(a){q=a}},defaultState:{get:function(){return u},set:function(a){u=a}},noData:{get:function(){return v},set:function(a){v=a}},tooltips:{get:function(){return j.enabled()},set:function(b){a.deprecated("tooltips","use chart.tooltip.enabled() instead"),j.enabled(!!b)}},tooltipContent:{get:function(){return j.contentGenerator()},set:function(b){a.deprecated("tooltipContent","use chart.tooltip.contentGenerator() instead"),j.contentGenerator(b)}},margin:{get:function(){return k},set:function(a){k.top=void 0!==a.top?a.top:k.top,k.right=void 0!==a.right?a.right:k.right,k.bottom=void 0!==a.bottom?a.bottom:k.bottom,k.left=void 0!==a.left?a.left:k.left}},duration:{get:function(){return x},set:function(a){x=a,y.reset(x),e.duration(x),f.duration(x),g.duration(x)}},color:{get:function(){return l},set:function(b){l=a.utils.getColor(b),h.color(l),e.color(l)}},rightAlignYAxis:{get:function(){return r},set:function(a){r=a,g.orient(r?"right":"left")}},useInteractiveGuideline:{get:function(){return s},set:function(a){s=a,s&&(e.interactive(!1),e.useVoronoi(!1))}}}),a.utils.inheritOptions(b,e),a.utils.initOptions(b),b},a.models.linePlusBarChart=function(){"use strict";function b(v){return v.each(function(v){function J(a){var b=+("e"==a),c=b?1:-1,d=X/3;return"M"+.5*c+","+d+"A6,6 0 0 "+b+" "+6.5*c+","+(d+6)+"V"+(2*d-6)+"A6,6 0 0 "+b+" "+.5*c+","+2*d+"ZM"+2.5*c+","+(d+8)+"V"+(2*d-8)+"M"+4.5*c+","+(d+8)+"V"+(2*d-8)}function S(){u.empty()||u.extent(I),kb.data([u.empty()?e.domain():I]).each(function(a){var b=e(a[0])-e.range()[0],c=e.range()[1]-e(a[1]);d3.select(this).select(".left").attr("width",0>b?0:b),d3.select(this).select(".right").attr("x",e(a[1])).attr("width",0>c?0:c)})}function T(){I=u.empty()?null:u.extent(),c=u.empty()?e.domain():u.extent(),K.brush({extent:c,brush:u}),S(),l.width(V).height(W).color(v.map(function(a,b){return a.color||C(a,b)}).filter(function(a,b){return!v[b].disabled&&v[b].bar})),j.width(V).height(W).color(v.map(function(a,b){return a.color||C(a,b)}).filter(function(a,b){return!v[b].disabled&&!v[b].bar}));var b=db.select(".nv-focus .nv-barsWrap").datum(Z.length?Z.map(function(a){return{key:a.key,values:a.values.filter(function(a,b){return l.x()(a,b)>=c[0]&&l.x()(a,b)<=c[1]})}}):[{values:[]}]),h=db.select(".nv-focus .nv-linesWrap").datum($[0].disabled?[{values:[]}]:$.map(function(a){return{area:a.area,fillOpacity:a.fillOpacity,key:a.key,values:a.values.filter(function(a,b){return j.x()(a,b)>=c[0]&&j.x()(a,b)<=c[1]})}}));d=Z.length?l.xScale():j.xScale(),n.scale(d)._ticks(a.utils.calcTicksX(V/100,v)).tickSize(-W,0),n.domain([Math.ceil(c[0]),Math.floor(c[1])]),db.select(".nv-x.nv-axis").transition().duration(L).call(n),b.transition().duration(L).call(l),h.transition().duration(L).call(j),db.select(".nv-focus .nv-x.nv-axis").attr("transform","translate(0,"+f.range()[0]+")"),p.scale(f)._ticks(a.utils.calcTicksY(W/36,v)).tickSize(-V,0),q.scale(g)._ticks(a.utils.calcTicksY(W/36,v)).tickSize(Z.length?0:-V,0),db.select(".nv-focus .nv-y1.nv-axis").style("opacity",Z.length?1:0),db.select(".nv-focus .nv-y2.nv-axis").style("opacity",$.length&&!$[0].disabled?1:0).attr("transform","translate("+d.range()[1]+",0)"),db.select(".nv-focus .nv-y1.nv-axis").transition().duration(L).call(p),db.select(".nv-focus .nv-y2.nv-axis").transition().duration(L).call(q)}var U=d3.select(this);a.utils.initSVG(U);var V=a.utils.availableWidth(y,U,w),W=a.utils.availableHeight(z,U,w)-(E?H:0),X=H-x.top-x.bottom;if(b.update=function(){U.transition().duration(L).call(b)},b.container=this,M.setter(R(v),b.update).getter(Q(v)).update(),M.disabled=v.map(function(a){return!!a.disabled}),!N){var Y;N={};for(Y in M)N[Y]=M[Y]instanceof Array?M[Y].slice(0):M[Y]}if(!(v&&v.length&&v.filter(function(a){return a.values.length}).length))return a.utils.noData(b,U),b;U.selectAll(".nv-noData").remove();var Z=v.filter(function(a){return!a.disabled&&a.bar}),$=v.filter(function(a){return!a.bar});d=l.xScale(),e=o.scale(),f=l.yScale(),g=j.yScale(),h=m.yScale(),i=k.yScale();var _=v.filter(function(a){return!a.disabled&&a.bar}).map(function(a){return a.values.map(function(a,b){return{x:A(a,b),y:B(a,b)}})}),ab=v.filter(function(a){return!a.disabled&&!a.bar}).map(function(a){return a.values.map(function(a,b){return{x:A(a,b),y:B(a,b)}})});d.range([0,V]),e.domain(d3.extent(d3.merge(_.concat(ab)),function(a){return a.x})).range([0,V]);var bb=U.selectAll("g.nv-wrap.nv-linePlusBar").data([v]),cb=bb.enter().append("g").attr("class","nvd3 nv-wrap nv-linePlusBar").append("g"),db=bb.select("g");cb.append("g").attr("class","nv-legendWrap");var eb=cb.append("g").attr("class","nv-focus");eb.append("g").attr("class","nv-x nv-axis"),eb.append("g").attr("class","nv-y1 nv-axis"),eb.append("g").attr("class","nv-y2 nv-axis"),eb.append("g").attr("class","nv-barsWrap"),eb.append("g").attr("class","nv-linesWrap");var fb=cb.append("g").attr("class","nv-context");if(fb.append("g").attr("class","nv-x nv-axis"),fb.append("g").attr("class","nv-y1 nv-axis"),fb.append("g").attr("class","nv-y2 nv-axis"),fb.append("g").attr("class","nv-barsWrap"),fb.append("g").attr("class","nv-linesWrap"),fb.append("g").attr("class","nv-brushBackground"),fb.append("g").attr("class","nv-x nv-brush"),D){var gb=t.align()?V/2:V,hb=t.align()?gb:0;t.width(gb),db.select(".nv-legendWrap").datum(v.map(function(a){return a.originalKey=void 0===a.originalKey?a.key:a.originalKey,a.key=a.originalKey+(a.bar?O:P),a})).call(t),w.top!=t.height()&&(w.top=t.height(),W=a.utils.availableHeight(z,U,w)-H),db.select(".nv-legendWrap").attr("transform","translate("+hb+","+-w.top+")")}bb.attr("transform","translate("+w.left+","+w.top+")"),db.select(".nv-context").style("display",E?"initial":"none"),m.width(V).height(X).color(v.map(function(a,b){return a.color||C(a,b)}).filter(function(a,b){return!v[b].disabled&&v[b].bar})),k.width(V).height(X).color(v.map(function(a,b){return a.color||C(a,b)}).filter(function(a,b){return!v[b].disabled&&!v[b].bar}));var ib=db.select(".nv-context .nv-barsWrap").datum(Z.length?Z:[{values:[]}]),jb=db.select(".nv-context .nv-linesWrap").datum($[0].disabled?[{values:[]}]:$);db.select(".nv-context").attr("transform","translate(0,"+(W+w.bottom+x.top)+")"),ib.transition().call(m),jb.transition().call(k),G&&(o._ticks(a.utils.calcTicksX(V/100,v)).tickSize(-X,0),db.select(".nv-context .nv-x.nv-axis").attr("transform","translate(0,"+h.range()[0]+")"),db.select(".nv-context .nv-x.nv-axis").transition().call(o)),F&&(r.scale(h)._ticks(X/36).tickSize(-V,0),s.scale(i)._ticks(X/36).tickSize(Z.length?0:-V,0),db.select(".nv-context .nv-y3.nv-axis").style("opacity",Z.length?1:0).attr("transform","translate(0,"+e.range()[0]+")"),db.select(".nv-context .nv-y2.nv-axis").style("opacity",$.length?1:0).attr("transform","translate("+e.range()[1]+",0)"),db.select(".nv-context .nv-y1.nv-axis").transition().call(r),db.select(".nv-context .nv-y2.nv-axis").transition().call(s)),u.x(e).on("brush",T),I&&u.extent(I);var kb=db.select(".nv-brushBackground").selectAll("g").data([I||u.extent()]),lb=kb.enter().append("g");lb.append("rect").attr("class","left").attr("x",0).attr("y",0).attr("height",X),lb.append("rect").attr("class","right").attr("x",0).attr("y",0).attr("height",X);var mb=db.select(".nv-x.nv-brush").call(u);mb.selectAll("rect").attr("height",X),mb.selectAll(".resize").append("path").attr("d",J),t.dispatch.on("stateChange",function(a){for(var c in a)M[c]=a[c];K.stateChange(M),b.update()}),K.on("changeState",function(a){"undefined"!=typeof a.disabled&&(v.forEach(function(b,c){b.disabled=a.disabled[c]}),M.disabled=a.disabled),b.update()}),T()}),b}var c,d,e,f,g,h,i,j=a.models.line(),k=a.models.line(),l=a.models.historicalBar(),m=a.models.historicalBar(),n=a.models.axis(),o=a.models.axis(),p=a.models.axis(),q=a.models.axis(),r=a.models.axis(),s=a.models.axis(),t=a.models.legend(),u=d3.svg.brush(),v=a.models.tooltip(),w={top:30,right:30,bottom:30,left:60},x={top:0,right:30,bottom:20,left:60},y=null,z=null,A=function(a){return a.x},B=function(a){return a.y},C=a.utils.defaultColor(),D=!0,E=!0,F=!1,G=!0,H=50,I=null,J=null,K=d3.dispatch("brush","stateChange","changeState"),L=0,M=a.utils.state(),N=null,O=" (left axis)",P=" (right axis)";j.clipEdge(!0),k.interactive(!1),n.orient("bottom").tickPadding(5),p.orient("left"),q.orient("right"),o.orient("bottom").tickPadding(5),r.orient("left"),s.orient("right"),v.headerEnabled(!0).headerFormatter(function(a,b){return n.tickFormat()(a,b)});var Q=function(a){return function(){return{active:a.map(function(a){return!a.disabled})}}},R=function(a){return function(b){void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}};return j.dispatch.on("elementMouseover.tooltip",function(a){v.duration(100).valueFormatter(function(a,b){return q.tickFormat()(a,b)}).data(a).position(a.pos).hidden(!1)}),j.dispatch.on("elementMouseout.tooltip",function(){v.hidden(!0)}),l.dispatch.on("elementMouseover.tooltip",function(a){a.value=b.x()(a.data),a.series={value:b.y()(a.data),color:a.color},v.duration(0).valueFormatter(function(a,b){return p.tickFormat()(a,b)}).data(a).hidden(!1)}),l.dispatch.on("elementMouseout.tooltip",function(){v.hidden(!0)}),l.dispatch.on("elementMousemove.tooltip",function(){v.position({top:d3.event.pageY,left:d3.event.pageX})()}),b.dispatch=K,b.legend=t,b.lines=j,b.lines2=k,b.bars=l,b.bars2=m,b.xAxis=n,b.x2Axis=o,b.y1Axis=p,b.y2Axis=q,b.y3Axis=r,b.y4Axis=s,b.tooltip=v,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return y},set:function(a){y=a}},height:{get:function(){return z},set:function(a){z=a}},showLegend:{get:function(){return D},set:function(a){D=a}},brushExtent:{get:function(){return I},set:function(a){I=a}},noData:{get:function(){return J},set:function(a){J=a}},focusEnable:{get:function(){return E},set:function(a){E=a}},focusHeight:{get:function(){return H},set:function(a){H=a}},focusShowAxisX:{get:function(){return G},set:function(a){G=a}},focusShowAxisY:{get:function(){return F},set:function(a){F=a}},legendLeftAxisHint:{get:function(){return O},set:function(a){O=a}},legendRightAxisHint:{get:function(){return P},set:function(a){P=a}},tooltips:{get:function(){return v.enabled()},set:function(b){a.deprecated("tooltips","use chart.tooltip.enabled() instead"),v.enabled(!!b)}},tooltipContent:{get:function(){return v.contentGenerator()},set:function(b){a.deprecated("tooltipContent","use chart.tooltip.contentGenerator() instead"),v.contentGenerator(b)}},margin:{get:function(){return w},set:function(a){w.top=void 0!==a.top?a.top:w.top,w.right=void 0!==a.right?a.right:w.right,w.bottom=void 0!==a.bottom?a.bottom:w.bottom,w.left=void 0!==a.left?a.left:w.left}},duration:{get:function(){return L},set:function(a){L=a}},color:{get:function(){return C},set:function(b){C=a.utils.getColor(b),t.color(C)}},x:{get:function(){return A},set:function(a){A=a,j.x(a),k.x(a),l.x(a),m.x(a)}},y:{get:function(){return B},set:function(a){B=a,j.y(a),k.y(a),l.y(a),m.y(a)}}}),a.utils.inheritOptions(b,j),a.utils.initOptions(b),b},a.models.lineWithFocusChart=function(){"use strict";function b(o){return o.each(function(o){function z(a){var b=+("e"==a),c=b?1:-1,d=M/3;return"M"+.5*c+","+d+"A6,6 0 0 "+b+" "+6.5*c+","+(d+6)+"V"+(2*d-6)+"A6,6 0 0 "+b+" "+.5*c+","+2*d+"ZM"+2.5*c+","+(d+8)+"V"+(2*d-8)+"M"+4.5*c+","+(d+8)+"V"+(2*d-8)}function G(){n.empty()||n.extent(y),U.data([n.empty()?e.domain():y]).each(function(a){var b=e(a[0])-c.range()[0],d=K-e(a[1]);d3.select(this).select(".left").attr("width",0>b?0:b),d3.select(this).select(".right").attr("x",e(a[1])).attr("width",0>d?0:d)})}function H(){y=n.empty()?null:n.extent();var a=n.empty()?e.domain():n.extent();if(!(Math.abs(a[0]-a[1])<=1)){A.brush({extent:a,brush:n}),G();var b=Q.select(".nv-focus .nv-linesWrap").datum(o.filter(function(a){return!a.disabled}).map(function(b){return{key:b.key,area:b.area,values:b.values.filter(function(b,c){return g.x()(b,c)>=a[0]&&g.x()(b,c)<=a[1]})}}));b.transition().duration(B).call(g),Q.select(".nv-focus .nv-x.nv-axis").transition().duration(B).call(i),Q.select(".nv-focus .nv-y.nv-axis").transition().duration(B).call(j)}}var I=d3.select(this),J=this;a.utils.initSVG(I);var K=a.utils.availableWidth(t,I,q),L=a.utils.availableHeight(u,I,q)-v,M=v-r.top-r.bottom;if(b.update=function(){I.transition().duration(B).call(b)},b.container=this,C.setter(F(o),b.update).getter(E(o)).update(),C.disabled=o.map(function(a){return!!a.disabled}),!D){var N;D={};for(N in C)D[N]=C[N]instanceof Array?C[N].slice(0):C[N]}if(!(o&&o.length&&o.filter(function(a){return a.values.length}).length))return a.utils.noData(b,I),b;I.selectAll(".nv-noData").remove(),c=g.xScale(),d=g.yScale(),e=h.xScale(),f=h.yScale();var O=I.selectAll("g.nv-wrap.nv-lineWithFocusChart").data([o]),P=O.enter().append("g").attr("class","nvd3 nv-wrap nv-lineWithFocusChart").append("g"),Q=O.select("g");P.append("g").attr("class","nv-legendWrap");var R=P.append("g").attr("class","nv-focus");R.append("g").attr("class","nv-x nv-axis"),R.append("g").attr("class","nv-y nv-axis"),R.append("g").attr("class","nv-linesWrap"),R.append("g").attr("class","nv-interactive");var S=P.append("g").attr("class","nv-context");S.append("g").attr("class","nv-x nv-axis"),S.append("g").attr("class","nv-y nv-axis"),S.append("g").attr("class","nv-linesWrap"),S.append("g").attr("class","nv-brushBackground"),S.append("g").attr("class","nv-x nv-brush"),x&&(m.width(K),Q.select(".nv-legendWrap").datum(o).call(m),q.top!=m.height()&&(q.top=m.height(),L=a.utils.availableHeight(u,I,q)-v),Q.select(".nv-legendWrap").attr("transform","translate(0,"+-q.top+")")),O.attr("transform","translate("+q.left+","+q.top+")"),w&&(p.width(K).height(L).margin({left:q.left,top:q.top}).svgContainer(I).xScale(c),O.select(".nv-interactive").call(p)),g.width(K).height(L).color(o.map(function(a,b){return a.color||s(a,b)}).filter(function(a,b){return!o[b].disabled})),h.defined(g.defined()).width(K).height(M).color(o.map(function(a,b){return a.color||s(a,b)}).filter(function(a,b){return!o[b].disabled})),Q.select(".nv-context").attr("transform","translate(0,"+(L+q.bottom+r.top)+")");var T=Q.select(".nv-context .nv-linesWrap").datum(o.filter(function(a){return!a.disabled}));d3.transition(T).call(h),i.scale(c)._ticks(a.utils.calcTicksX(K/100,o)).tickSize(-L,0),j.scale(d)._ticks(a.utils.calcTicksY(L/36,o)).tickSize(-K,0),Q.select(".nv-focus .nv-x.nv-axis").attr("transform","translate(0,"+L+")"),n.x(e).on("brush",function(){H()}),y&&n.extent(y);var U=Q.select(".nv-brushBackground").selectAll("g").data([y||n.extent()]),V=U.enter().append("g");V.append("rect").attr("class","left").attr("x",0).attr("y",0).attr("height",M),V.append("rect").attr("class","right").attr("x",0).attr("y",0).attr("height",M);var W=Q.select(".nv-x.nv-brush").call(n);W.selectAll("rect").attr("height",M),W.selectAll(".resize").append("path").attr("d",z),H(),k.scale(e)._ticks(a.utils.calcTicksX(K/100,o)).tickSize(-M,0),Q.select(".nv-context .nv-x.nv-axis").attr("transform","translate(0,"+f.range()[0]+")"),d3.transition(Q.select(".nv-context .nv-x.nv-axis")).call(k),l.scale(f)._ticks(a.utils.calcTicksY(M/36,o)).tickSize(-K,0),d3.transition(Q.select(".nv-context .nv-y.nv-axis")).call(l),Q.select(".nv-context .nv-x.nv-axis").attr("transform","translate(0,"+f.range()[0]+")"),m.dispatch.on("stateChange",function(a){for(var c in a)C[c]=a[c];A.stateChange(C),b.update()}),p.dispatch.on("elementMousemove",function(c){g.clearHighlights();var d,f,h,k=[];if(o.filter(function(a,b){return a.seriesIndex=b,!a.disabled}).forEach(function(i,j){var l=n.empty()?e.domain():n.extent(),m=i.values.filter(function(a,b){return g.x()(a,b)>=l[0]&&g.x()(a,b)<=l[1]});f=a.interactiveBisect(m,c.pointXValue,g.x());var o=m[f],p=b.y()(o,f);null!=p&&g.highlightPoint(j,f,!0),void 0!==o&&(void 0===d&&(d=o),void 0===h&&(h=b.xScale()(b.x()(o,f))),k.push({key:i.key,value:b.y()(o,f),color:s(i,i.seriesIndex)}))}),k.length>2){var l=b.yScale().invert(c.mouseY),m=Math.abs(b.yScale().domain()[0]-b.yScale().domain()[1]),r=.03*m,t=a.nearestValueIndex(k.map(function(a){return a.value}),l,r);null!==t&&(k[t].highlight=!0)}var u=i.tickFormat()(b.x()(d,f));p.tooltip.position({left:c.mouseX+q.left,top:c.mouseY+q.top}).chartContainer(J.parentNode).valueFormatter(function(a){return null==a?"N/A":j.tickFormat()(a)}).data({value:u,index:f,series:k})(),p.renderGuideLine(h)}),p.dispatch.on("elementMouseout",function(){g.clearHighlights()}),A.on("changeState",function(a){"undefined"!=typeof a.disabled&&o.forEach(function(b,c){b.disabled=a.disabled[c]}),b.update()})}),b}var c,d,e,f,g=a.models.line(),h=a.models.line(),i=a.models.axis(),j=a.models.axis(),k=a.models.axis(),l=a.models.axis(),m=a.models.legend(),n=d3.svg.brush(),o=a.models.tooltip(),p=a.interactiveGuideline(),q={top:30,right:30,bottom:30,left:60},r={top:0,right:30,bottom:20,left:60},s=a.utils.defaultColor(),t=null,u=null,v=50,w=!1,x=!0,y=null,z=null,A=d3.dispatch("brush","stateChange","changeState"),B=250,C=a.utils.state(),D=null;g.clipEdge(!0).duration(0),h.interactive(!1),i.orient("bottom").tickPadding(5),j.orient("left"),k.orient("bottom").tickPadding(5),l.orient("left"),o.valueFormatter(function(a,b){return j.tickFormat()(a,b)}).headerFormatter(function(a,b){return i.tickFormat()(a,b)});var E=function(a){return function(){return{active:a.map(function(a){return!a.disabled})}}},F=function(a){return function(b){void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}};return g.dispatch.on("elementMouseover.tooltip",function(a){o.data(a).position(a.pos).hidden(!1)}),g.dispatch.on("elementMouseout.tooltip",function(){o.hidden(!0)}),b.dispatch=A,b.legend=m,b.lines=g,b.lines2=h,b.xAxis=i,b.yAxis=j,b.x2Axis=k,b.y2Axis=l,b.interactiveLayer=p,b.tooltip=o,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return t},set:function(a){t=a}},height:{get:function(){return u},set:function(a){u=a}},focusHeight:{get:function(){return v},set:function(a){v=a}},showLegend:{get:function(){return x},set:function(a){x=a}},brushExtent:{get:function(){return y},set:function(a){y=a}},defaultState:{get:function(){return D},set:function(a){D=a}},noData:{get:function(){return z},set:function(a){z=a}},tooltips:{get:function(){return o.enabled()},set:function(b){a.deprecated("tooltips","use chart.tooltip.enabled() instead"),o.enabled(!!b)}},tooltipContent:{get:function(){return o.contentGenerator()},set:function(b){a.deprecated("tooltipContent","use chart.tooltip.contentGenerator() instead"),o.contentGenerator(b)}},margin:{get:function(){return q},set:function(a){q.top=void 0!==a.top?a.top:q.top,q.right=void 0!==a.right?a.right:q.right,q.bottom=void 0!==a.bottom?a.bottom:q.bottom,q.left=void 0!==a.left?a.left:q.left}},color:{get:function(){return s},set:function(b){s=a.utils.getColor(b),m.color(s)}},interpolate:{get:function(){return g.interpolate()},set:function(a){g.interpolate(a),h.interpolate(a)}},xTickFormat:{get:function(){return i.tickFormat()},set:function(a){i.tickFormat(a),k.tickFormat(a)}},yTickFormat:{get:function(){return j.tickFormat()},set:function(a){j.tickFormat(a),l.tickFormat(a)}},duration:{get:function(){return B},set:function(a){B=a,j.duration(B),l.duration(B),i.duration(B),k.duration(B)}},x:{get:function(){return g.x()},set:function(a){g.x(a),h.x(a)}},y:{get:function(){return g.y()},set:function(a){g.y(a),h.y(a)}},useInteractiveGuideline:{get:function(){return w},set:function(a){w=a,w&&(g.interactive(!1),g.useVoronoi(!1))}}}),a.utils.inheritOptions(b,g),a.utils.initOptions(b),b},a.models.multiBar=function(){"use strict";function b(E){return C.reset(),E.each(function(b){var E=k-j.left-j.right,F=l-j.top-j.bottom;p=d3.select(this),a.utils.initSVG(p);var G=0;if(x&&b.length&&(x=[{values:b[0].values.map(function(a){return{x:a.x,y:0,series:a.series,size:.01}})}]),u){var H=d3.layout.stack().offset(v).values(function(a){return a.values}).y(r)(!b.length&&x?x:b);H.forEach(function(a,c){a.nonStackable?(b[c].nonStackableSeries=G++,H[c]=b[c]):c>0&&H[c-1].nonStackable&&H[c].values.map(function(a,b){a.y0-=H[c-1].values[b].y,a.y1=a.y0+a.y})}),b=H}b.forEach(function(a,b){a.values.forEach(function(c){c.series=b,c.key=a.key})}),u&&b[0].values.map(function(a,c){var d=0,e=0;b.map(function(a,f){if(!b[f].nonStackable){var g=a.values[c];g.size=Math.abs(g.y),g.y<0?(g.y1=e,e-=g.size):(g.y1=g.size+d,d+=g.size)}})});var I=d&&e?[]:b.map(function(a,b){return a.values.map(function(a,c){return{x:q(a,c),y:r(a,c),y0:a.y0,y1:a.y1,idx:b}})});m.domain(d||d3.merge(I).map(function(a){return a.x})).rangeBands(f||[0,E],A),n.domain(e||d3.extent(d3.merge(I).map(function(a){var c=a.y;return u&&!b[a.idx].nonStackable&&(c=a.y>0?a.y1:a.y1+a.y),c}).concat(s))).range(g||[F,0]),m.domain()[0]===m.domain()[1]&&m.domain(m.domain()[0]?[m.domain()[0]-.01*m.domain()[0],m.domain()[1]+.01*m.domain()[1]]:[-1,1]),n.domain()[0]===n.domain()[1]&&n.domain(n.domain()[0]?[n.domain()[0]+.01*n.domain()[0],n.domain()[1]-.01*n.domain()[1]]:[-1,1]),h=h||m,i=i||n;var J=p.selectAll("g.nv-wrap.nv-multibar").data([b]),K=J.enter().append("g").attr("class","nvd3 nv-wrap nv-multibar"),L=K.append("defs"),M=K.append("g"),N=J.select("g");M.append("g").attr("class","nv-groups"),J.attr("transform","translate("+j.left+","+j.top+")"),L.append("clipPath").attr("id","nv-edge-clip-"+o).append("rect"),J.select("#nv-edge-clip-"+o+" rect").attr("width",E).attr("height",F),N.attr("clip-path",t?"url(#nv-edge-clip-"+o+")":"");var O=J.select(".nv-groups").selectAll(".nv-group").data(function(a){return a},function(a,b){return b});O.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6);var P=C.transition(O.exit().selectAll("rect.nv-bar"),"multibarExit",Math.min(100,z)).attr("y",function(a){var c=i(0)||0;return u&&b[a.series]&&!b[a.series].nonStackable&&(c=i(a.y0)),c}).attr("height",0).remove();P.delay&&P.delay(function(a,b){var c=b*(z/(D+1))-b;return c}),O.attr("class",function(a,b){return"nv-group nv-series-"+b}).classed("hover",function(a){return a.hover}).style("fill",function(a,b){return w(a,b)}).style("stroke",function(a,b){return w(a,b)}),O.style("stroke-opacity",1).style("fill-opacity",.75);var Q=O.selectAll("rect.nv-bar").data(function(a){return x&&!b.length?x.values:a.values});Q.exit().remove();Q.enter().append("rect").attr("class",function(a,b){return r(a,b)<0?"nv-bar negative":"nv-bar positive"}).attr("x",function(a,c,d){return u&&!b[d].nonStackable?0:d*m.rangeBand()/b.length}).attr("y",function(a,c,d){return i(u&&!b[d].nonStackable?a.y0:0)||0}).attr("height",0).attr("width",function(a,c,d){return m.rangeBand()/(u&&!b[d].nonStackable?1:b.length)}).attr("transform",function(a,b){return"translate("+m(q(a,b))+",0)"});Q.style("fill",function(a,b,c){return w(a,c,b)}).style("stroke",function(a,b,c){return w(a,c,b)}).on("mouseover",function(a,b){d3.select(this).classed("hover",!0),B.elementMouseover({data:a,index:b,color:d3.select(this).style("fill")})}).on("mouseout",function(a,b){d3.select(this).classed("hover",!1),B.elementMouseout({data:a,index:b,color:d3.select(this).style("fill")})}).on("mousemove",function(a,b){B.elementMousemove({data:a,index:b,color:d3.select(this).style("fill")})}).on("click",function(a,b){B.elementClick({data:a,index:b,color:d3.select(this).style("fill")}),d3.event.stopPropagation()}).on("dblclick",function(a,b){B.elementDblClick({data:a,index:b,color:d3.select(this).style("fill")}),d3.event.stopPropagation()}),Q.attr("class",function(a,b){return r(a,b)<0?"nv-bar negative":"nv-bar positive"}).attr("transform",function(a,b){return"translate("+m(q(a,b))+",0)"}),y&&(c||(c=b.map(function(){return!0})),Q.style("fill",function(a,b,d){return d3.rgb(y(a,b)).darker(c.map(function(a,b){return b}).filter(function(a,b){return!c[b]})[d]).toString()}).style("stroke",function(a,b,d){return d3.rgb(y(a,b)).darker(c.map(function(a,b){return b}).filter(function(a,b){return!c[b]})[d]).toString()}));var R=Q.watchTransition(C,"multibar",Math.min(250,z)).delay(function(a,c){return c*z/b[0].values.length});u?R.attr("y",function(a,c,d){var e=0;return e=b[d].nonStackable?r(a,c)<0?n(0):n(0)-n(r(a,c))<-1?n(0)-1:n(r(a,c))||0:n(a.y1)}).attr("height",function(a,c,d){return b[d].nonStackable?Math.max(Math.abs(n(r(a,c))-n(0)),1)||0:Math.max(Math.abs(n(a.y+a.y0)-n(a.y0)),1)}).attr("x",function(a,c,d){var e=0;return b[d].nonStackable&&(e=a.series*m.rangeBand()/b.length,b.length!==G&&(e=b[d].nonStackableSeries*m.rangeBand()/(2*G))),e}).attr("width",function(a,c,d){if(b[d].nonStackable){var e=m.rangeBand()/G;return b.length!==G&&(e=m.rangeBand()/(2*G)),e}return m.rangeBand()}):R.attr("x",function(a){return a.series*m.rangeBand()/b.length}).attr("width",m.rangeBand()/b.length).attr("y",function(a,b){return r(a,b)<0?n(0):n(0)-n(r(a,b))<1?n(0)-1:n(r(a,b))||0}).attr("height",function(a,b){return Math.max(Math.abs(n(r(a,b))-n(0)),1)||0}),h=m.copy(),i=n.copy(),b[0]&&b[0].values&&(D=b[0].values.length)}),C.renderEnd("multibar immediate"),b}var c,d,e,f,g,h,i,j={top:0,right:0,bottom:0,left:0},k=960,l=500,m=d3.scale.ordinal(),n=d3.scale.linear(),o=Math.floor(1e4*Math.random()),p=null,q=function(a){return a.x},r=function(a){return a.y},s=[0],t=!0,u=!1,v="zero",w=a.utils.defaultColor(),x=!1,y=null,z=500,A=.1,B=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),C=a.utils.renderWatch(B,z),D=0;return b.dispatch=B,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return k},set:function(a){k=a}},height:{get:function(){return l},set:function(a){l=a}},x:{get:function(){return q},set:function(a){q=a}},y:{get:function(){return r},set:function(a){r=a}},xScale:{get:function(){return m},set:function(a){m=a}},yScale:{get:function(){return n},set:function(a){n=a}},xDomain:{get:function(){return d},set:function(a){d=a}},yDomain:{get:function(){return e},set:function(a){e=a}},xRange:{get:function(){return f},set:function(a){f=a}},yRange:{get:function(){return g},set:function(a){g=a}},forceY:{get:function(){return s},set:function(a){s=a}},stacked:{get:function(){return u},set:function(a){u=a}},stackOffset:{get:function(){return v},set:function(a){v=a}},clipEdge:{get:function(){return t},set:function(a){t=a}},disabled:{get:function(){return c},set:function(a){c=a}},id:{get:function(){return o},set:function(a){o=a}},hideable:{get:function(){return x},set:function(a){x=a}},groupSpacing:{get:function(){return A},set:function(a){A=a}},margin:{get:function(){return j},set:function(a){j.top=void 0!==a.top?a.top:j.top,j.right=void 0!==a.right?a.right:j.right,j.bottom=void 0!==a.bottom?a.bottom:j.bottom,j.left=void 0!==a.left?a.left:j.left}},duration:{get:function(){return z},set:function(a){z=a,C.reset(z)}},color:{get:function(){return w},set:function(b){w=a.utils.getColor(b)}},barColor:{get:function(){return y},set:function(b){y=b?a.utils.getColor(b):null}}}),a.utils.initOptions(b),b},a.models.multiBarChart=function(){"use strict";function b(j){return D.reset(),D.models(e),r&&D.models(f),s&&D.models(g),j.each(function(j){var z=d3.select(this);a.utils.initSVG(z);var D=a.utils.availableWidth(l,z,k),H=a.utils.availableHeight(m,z,k);if(b.update=function(){0===C?z.call(b):z.transition().duration(C).call(b)},b.container=this,x.setter(G(j),b.update).getter(F(j)).update(),x.disabled=j.map(function(a){return!!a.disabled}),!y){var I;y={};for(I in x)y[I]=x[I]instanceof Array?x[I].slice(0):x[I]}if(!(j&&j.length&&j.filter(function(a){return a.values.length}).length))return a.utils.noData(b,z),b;z.selectAll(".nv-noData").remove(),c=e.xScale(),d=e.yScale(); -var J=z.selectAll("g.nv-wrap.nv-multiBarWithLegend").data([j]),K=J.enter().append("g").attr("class","nvd3 nv-wrap nv-multiBarWithLegend").append("g"),L=J.select("g");if(K.append("g").attr("class","nv-x nv-axis"),K.append("g").attr("class","nv-y nv-axis"),K.append("g").attr("class","nv-barsWrap"),K.append("g").attr("class","nv-legendWrap"),K.append("g").attr("class","nv-controlsWrap"),q&&(h.width(D-B()),L.select(".nv-legendWrap").datum(j).call(h),k.top!=h.height()&&(k.top=h.height(),H=a.utils.availableHeight(m,z,k)),L.select(".nv-legendWrap").attr("transform","translate("+B()+","+-k.top+")")),o){var M=[{key:p.grouped||"Grouped",disabled:e.stacked()},{key:p.stacked||"Stacked",disabled:!e.stacked()}];i.width(B()).color(["#444","#444","#444"]),L.select(".nv-controlsWrap").datum(M).attr("transform","translate(0,"+-k.top+")").call(i)}J.attr("transform","translate("+k.left+","+k.top+")"),t&&L.select(".nv-y.nv-axis").attr("transform","translate("+D+",0)"),e.disabled(j.map(function(a){return a.disabled})).width(D).height(H).color(j.map(function(a,b){return a.color||n(a,b)}).filter(function(a,b){return!j[b].disabled}));var N=L.select(".nv-barsWrap").datum(j.filter(function(a){return!a.disabled}));if(N.call(e),r){f.scale(c)._ticks(a.utils.calcTicksX(D/100,j)).tickSize(-H,0),L.select(".nv-x.nv-axis").attr("transform","translate(0,"+d.range()[0]+")"),L.select(".nv-x.nv-axis").call(f);var O=L.select(".nv-x.nv-axis > g").selectAll("g");if(O.selectAll("line, text").style("opacity",1),v){var P=function(a,b){return"translate("+a+","+b+")"},Q=5,R=17;O.selectAll("text").attr("transform",function(a,b,c){return P(0,c%2==0?Q:R)});var S=d3.selectAll(".nv-x.nv-axis .nv-wrap g g text")[0].length;L.selectAll(".nv-x.nv-axis .nv-axisMaxMin text").attr("transform",function(a,b){return P(0,0===b||S%2!==0?R:Q)})}u&&O.filter(function(a,b){return b%Math.ceil(j[0].values.length/(D/100))!==0}).selectAll("text, line").style("opacity",0),w&&O.selectAll(".tick text").attr("transform","rotate("+w+" 0,0)").style("text-anchor",w>0?"start":"end"),L.select(".nv-x.nv-axis").selectAll("g.nv-axisMaxMin text").style("opacity",1)}s&&(g.scale(d)._ticks(a.utils.calcTicksY(H/36,j)).tickSize(-D,0),L.select(".nv-y.nv-axis").call(g)),h.dispatch.on("stateChange",function(a){for(var c in a)x[c]=a[c];A.stateChange(x),b.update()}),i.dispatch.on("legendClick",function(a){if(a.disabled){switch(M=M.map(function(a){return a.disabled=!0,a}),a.disabled=!1,a.key){case"Grouped":case p.grouped:e.stacked(!1);break;case"Stacked":case p.stacked:e.stacked(!0)}x.stacked=e.stacked(),A.stateChange(x),b.update()}}),A.on("changeState",function(a){"undefined"!=typeof a.disabled&&(j.forEach(function(b,c){b.disabled=a.disabled[c]}),x.disabled=a.disabled),"undefined"!=typeof a.stacked&&(e.stacked(a.stacked),x.stacked=a.stacked,E=a.stacked),b.update()})}),D.renderEnd("multibarchart immediate"),b}var c,d,e=a.models.multiBar(),f=a.models.axis(),g=a.models.axis(),h=a.models.legend(),i=a.models.legend(),j=a.models.tooltip(),k={top:30,right:20,bottom:50,left:60},l=null,m=null,n=a.utils.defaultColor(),o=!0,p={},q=!0,r=!0,s=!0,t=!1,u=!0,v=!1,w=0,x=a.utils.state(),y=null,z=null,A=d3.dispatch("stateChange","changeState","renderEnd"),B=function(){return o?180:0},C=250;x.stacked=!1,e.stacked(!1),f.orient("bottom").tickPadding(7).showMaxMin(!1).tickFormat(function(a){return a}),g.orient(t?"right":"left").tickFormat(d3.format(",.1f")),j.duration(0).valueFormatter(function(a,b){return g.tickFormat()(a,b)}).headerFormatter(function(a,b){return f.tickFormat()(a,b)}),i.updateState(!1);var D=a.utils.renderWatch(A),E=!1,F=function(a){return function(){return{active:a.map(function(a){return!a.disabled}),stacked:E}}},G=function(a){return function(b){void 0!==b.stacked&&(E=b.stacked),void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}};return e.dispatch.on("elementMouseover.tooltip",function(a){a.value=b.x()(a.data),a.series={key:a.data.key,value:b.y()(a.data),color:a.color},j.data(a).hidden(!1)}),e.dispatch.on("elementMouseout.tooltip",function(){j.hidden(!0)}),e.dispatch.on("elementMousemove.tooltip",function(){j.position({top:d3.event.pageY,left:d3.event.pageX})()}),b.dispatch=A,b.multibar=e,b.legend=h,b.controls=i,b.xAxis=f,b.yAxis=g,b.state=x,b.tooltip=j,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return l},set:function(a){l=a}},height:{get:function(){return m},set:function(a){m=a}},showLegend:{get:function(){return q},set:function(a){q=a}},showControls:{get:function(){return o},set:function(a){o=a}},controlLabels:{get:function(){return p},set:function(a){p=a}},showXAxis:{get:function(){return r},set:function(a){r=a}},showYAxis:{get:function(){return s},set:function(a){s=a}},defaultState:{get:function(){return y},set:function(a){y=a}},noData:{get:function(){return z},set:function(a){z=a}},reduceXTicks:{get:function(){return u},set:function(a){u=a}},rotateLabels:{get:function(){return w},set:function(a){w=a}},staggerLabels:{get:function(){return v},set:function(a){v=a}},tooltips:{get:function(){return j.enabled()},set:function(b){a.deprecated("tooltips","use chart.tooltip.enabled() instead"),j.enabled(!!b)}},tooltipContent:{get:function(){return j.contentGenerator()},set:function(b){a.deprecated("tooltipContent","use chart.tooltip.contentGenerator() instead"),j.contentGenerator(b)}},margin:{get:function(){return k},set:function(a){k.top=void 0!==a.top?a.top:k.top,k.right=void 0!==a.right?a.right:k.right,k.bottom=void 0!==a.bottom?a.bottom:k.bottom,k.left=void 0!==a.left?a.left:k.left}},duration:{get:function(){return C},set:function(a){C=a,e.duration(C),f.duration(C),g.duration(C),D.reset(C)}},color:{get:function(){return n},set:function(b){n=a.utils.getColor(b),h.color(n)}},rightAlignYAxis:{get:function(){return t},set:function(a){t=a,g.orient(t?"right":"left")}},barColor:{get:function(){return e.barColor},set:function(a){e.barColor(a),h.color(function(a,b){return d3.rgb("#ccc").darker(1.5*b).toString()})}}}),a.utils.inheritOptions(b,e),a.utils.initOptions(b),b},a.models.multiBarHorizontal=function(){"use strict";function b(m){return E.reset(),m.each(function(b){var m=k-j.left-j.right,C=l-j.top-j.bottom;n=d3.select(this),a.utils.initSVG(n),w&&(b=d3.layout.stack().offset("zero").values(function(a){return a.values}).y(r)(b)),b.forEach(function(a,b){a.values.forEach(function(c){c.series=b,c.key=a.key})}),w&&b[0].values.map(function(a,c){var d=0,e=0;b.map(function(a){var b=a.values[c];b.size=Math.abs(b.y),b.y<0?(b.y1=e-b.size,e-=b.size):(b.y1=d,d+=b.size)})});var F=d&&e?[]:b.map(function(a){return a.values.map(function(a,b){return{x:q(a,b),y:r(a,b),y0:a.y0,y1:a.y1}})});o.domain(d||d3.merge(F).map(function(a){return a.x})).rangeBands(f||[0,C],A),p.domain(e||d3.extent(d3.merge(F).map(function(a){return w?a.y>0?a.y1+a.y:a.y1:a.y}).concat(t))),p.range(x&&!w?g||[p.domain()[0]<0?z:0,m-(p.domain()[1]>0?z:0)]:g||[0,m]),h=h||o,i=i||d3.scale.linear().domain(p.domain()).range([p(0),p(0)]);{var G=d3.select(this).selectAll("g.nv-wrap.nv-multibarHorizontal").data([b]),H=G.enter().append("g").attr("class","nvd3 nv-wrap nv-multibarHorizontal"),I=(H.append("defs"),H.append("g"));G.select("g")}I.append("g").attr("class","nv-groups"),G.attr("transform","translate("+j.left+","+j.top+")");var J=G.select(".nv-groups").selectAll(".nv-group").data(function(a){return a},function(a,b){return b});J.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),J.exit().watchTransition(E,"multibarhorizontal: exit groups").style("stroke-opacity",1e-6).style("fill-opacity",1e-6).remove(),J.attr("class",function(a,b){return"nv-group nv-series-"+b}).classed("hover",function(a){return a.hover}).style("fill",function(a,b){return u(a,b)}).style("stroke",function(a,b){return u(a,b)}),J.watchTransition(E,"multibarhorizontal: groups").style("stroke-opacity",1).style("fill-opacity",.75);var K=J.selectAll("g.nv-bar").data(function(a){return a.values});K.exit().remove();var L=K.enter().append("g").attr("transform",function(a,c,d){return"translate("+i(w?a.y0:0)+","+(w?0:d*o.rangeBand()/b.length+o(q(a,c)))+")"});L.append("rect").attr("width",0).attr("height",o.rangeBand()/(w?1:b.length)),K.on("mouseover",function(a,b){d3.select(this).classed("hover",!0),D.elementMouseover({data:a,index:b,color:d3.select(this).style("fill")})}).on("mouseout",function(a,b){d3.select(this).classed("hover",!1),D.elementMouseout({data:a,index:b,color:d3.select(this).style("fill")})}).on("mouseout",function(a,b){D.elementMouseout({data:a,index:b,color:d3.select(this).style("fill")})}).on("mousemove",function(a,b){D.elementMousemove({data:a,index:b,color:d3.select(this).style("fill")})}).on("click",function(a,b){D.elementClick({data:a,index:b,color:d3.select(this).style("fill")}),d3.event.stopPropagation()}).on("dblclick",function(a,b){D.elementDblClick({data:a,index:b,color:d3.select(this).style("fill")}),d3.event.stopPropagation()}),s(b[0],0)&&(L.append("polyline"),K.select("polyline").attr("fill","none").attr("points",function(a,c){var d=s(a,c),e=.8*o.rangeBand()/(2*(w?1:b.length));d=d.length?d:[-Math.abs(d),Math.abs(d)],d=d.map(function(a){return p(a)-p(0)});var f=[[d[0],-e],[d[0],e],[d[0],0],[d[1],0],[d[1],-e],[d[1],e]];return f.map(function(a){return a.join(",")}).join(" ")}).attr("transform",function(a,c){var d=o.rangeBand()/(2*(w?1:b.length));return"translate("+(r(a,c)<0?0:p(r(a,c))-p(0))+", "+d+")"})),L.append("text"),x&&!w?(K.select("text").attr("text-anchor",function(a,b){return r(a,b)<0?"end":"start"}).attr("y",o.rangeBand()/(2*b.length)).attr("dy",".32em").text(function(a,b){var c=B(r(a,b)),d=s(a,b);return void 0===d?c:d.length?c+"+"+B(Math.abs(d[1]))+"-"+B(Math.abs(d[0])):c+"±"+B(Math.abs(d))}),K.watchTransition(E,"multibarhorizontal: bars").select("text").attr("x",function(a,b){return r(a,b)<0?-4:p(r(a,b))-p(0)+4})):K.selectAll("text").text(""),y&&!w?(L.append("text").classed("nv-bar-label",!0),K.select("text.nv-bar-label").attr("text-anchor",function(a,b){return r(a,b)<0?"start":"end"}).attr("y",o.rangeBand()/(2*b.length)).attr("dy",".32em").text(function(a,b){return q(a,b)}),K.watchTransition(E,"multibarhorizontal: bars").select("text.nv-bar-label").attr("x",function(a,b){return r(a,b)<0?p(0)-p(r(a,b))+4:-4})):K.selectAll("text.nv-bar-label").text(""),K.attr("class",function(a,b){return r(a,b)<0?"nv-bar negative":"nv-bar positive"}),v&&(c||(c=b.map(function(){return!0})),K.style("fill",function(a,b,d){return d3.rgb(v(a,b)).darker(c.map(function(a,b){return b}).filter(function(a,b){return!c[b]})[d]).toString()}).style("stroke",function(a,b,d){return d3.rgb(v(a,b)).darker(c.map(function(a,b){return b}).filter(function(a,b){return!c[b]})[d]).toString()})),w?K.watchTransition(E,"multibarhorizontal: bars").attr("transform",function(a,b){return"translate("+p(a.y1)+","+o(q(a,b))+")"}).select("rect").attr("width",function(a,b){return Math.abs(p(r(a,b)+a.y0)-p(a.y0))}).attr("height",o.rangeBand()):K.watchTransition(E,"multibarhorizontal: bars").attr("transform",function(a,c){return"translate("+p(r(a,c)<0?r(a,c):0)+","+(a.series*o.rangeBand()/b.length+o(q(a,c)))+")"}).select("rect").attr("height",o.rangeBand()/b.length).attr("width",function(a,b){return Math.max(Math.abs(p(r(a,b))-p(0)),1)}),h=o.copy(),i=p.copy()}),E.renderEnd("multibarHorizontal immediate"),b}var c,d,e,f,g,h,i,j={top:0,right:0,bottom:0,left:0},k=960,l=500,m=Math.floor(1e4*Math.random()),n=null,o=d3.scale.ordinal(),p=d3.scale.linear(),q=function(a){return a.x},r=function(a){return a.y},s=function(a){return a.yErr},t=[0],u=a.utils.defaultColor(),v=null,w=!1,x=!1,y=!1,z=60,A=.1,B=d3.format(",.2f"),C=250,D=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),E=a.utils.renderWatch(D,C);return b.dispatch=D,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return k},set:function(a){k=a}},height:{get:function(){return l},set:function(a){l=a}},x:{get:function(){return q},set:function(a){q=a}},y:{get:function(){return r},set:function(a){r=a}},yErr:{get:function(){return s},set:function(a){s=a}},xScale:{get:function(){return o},set:function(a){o=a}},yScale:{get:function(){return p},set:function(a){p=a}},xDomain:{get:function(){return d},set:function(a){d=a}},yDomain:{get:function(){return e},set:function(a){e=a}},xRange:{get:function(){return f},set:function(a){f=a}},yRange:{get:function(){return g},set:function(a){g=a}},forceY:{get:function(){return t},set:function(a){t=a}},stacked:{get:function(){return w},set:function(a){w=a}},showValues:{get:function(){return x},set:function(a){x=a}},disabled:{get:function(){return c},set:function(a){c=a}},id:{get:function(){return m},set:function(a){m=a}},valueFormat:{get:function(){return B},set:function(a){B=a}},valuePadding:{get:function(){return z},set:function(a){z=a}},groupSpacing:{get:function(){return A},set:function(a){A=a}},margin:{get:function(){return j},set:function(a){j.top=void 0!==a.top?a.top:j.top,j.right=void 0!==a.right?a.right:j.right,j.bottom=void 0!==a.bottom?a.bottom:j.bottom,j.left=void 0!==a.left?a.left:j.left}},duration:{get:function(){return C},set:function(a){C=a,E.reset(C)}},color:{get:function(){return u},set:function(b){u=a.utils.getColor(b)}},barColor:{get:function(){return v},set:function(b){v=b?a.utils.getColor(b):null}}}),a.utils.initOptions(b),b},a.models.multiBarHorizontalChart=function(){"use strict";function b(j){return C.reset(),C.models(e),r&&C.models(f),s&&C.models(g),j.each(function(j){var w=d3.select(this);a.utils.initSVG(w);var C=a.utils.availableWidth(l,w,k),D=a.utils.availableHeight(m,w,k);if(b.update=function(){w.transition().duration(z).call(b)},b.container=this,t=e.stacked(),u.setter(B(j),b.update).getter(A(j)).update(),u.disabled=j.map(function(a){return!!a.disabled}),!v){var E;v={};for(E in u)v[E]=u[E]instanceof Array?u[E].slice(0):u[E]}if(!(j&&j.length&&j.filter(function(a){return a.values.length}).length))return a.utils.noData(b,w),b;w.selectAll(".nv-noData").remove(),c=e.xScale(),d=e.yScale();var F=w.selectAll("g.nv-wrap.nv-multiBarHorizontalChart").data([j]),G=F.enter().append("g").attr("class","nvd3 nv-wrap nv-multiBarHorizontalChart").append("g"),H=F.select("g");if(G.append("g").attr("class","nv-x nv-axis"),G.append("g").attr("class","nv-y nv-axis").append("g").attr("class","nv-zeroLine").append("line"),G.append("g").attr("class","nv-barsWrap"),G.append("g").attr("class","nv-legendWrap"),G.append("g").attr("class","nv-controlsWrap"),q&&(h.width(C-y()),H.select(".nv-legendWrap").datum(j).call(h),k.top!=h.height()&&(k.top=h.height(),D=a.utils.availableHeight(m,w,k)),H.select(".nv-legendWrap").attr("transform","translate("+y()+","+-k.top+")")),o){var I=[{key:p.grouped||"Grouped",disabled:e.stacked()},{key:p.stacked||"Stacked",disabled:!e.stacked()}];i.width(y()).color(["#444","#444","#444"]),H.select(".nv-controlsWrap").datum(I).attr("transform","translate(0,"+-k.top+")").call(i)}F.attr("transform","translate("+k.left+","+k.top+")"),e.disabled(j.map(function(a){return a.disabled})).width(C).height(D).color(j.map(function(a,b){return a.color||n(a,b)}).filter(function(a,b){return!j[b].disabled}));var J=H.select(".nv-barsWrap").datum(j.filter(function(a){return!a.disabled}));if(J.transition().call(e),r){f.scale(c)._ticks(a.utils.calcTicksY(D/24,j)).tickSize(-C,0),H.select(".nv-x.nv-axis").call(f);var K=H.select(".nv-x.nv-axis").selectAll("g");K.selectAll("line, text")}s&&(g.scale(d)._ticks(a.utils.calcTicksX(C/100,j)).tickSize(-D,0),H.select(".nv-y.nv-axis").attr("transform","translate(0,"+D+")"),H.select(".nv-y.nv-axis").call(g)),H.select(".nv-zeroLine line").attr("x1",d(0)).attr("x2",d(0)).attr("y1",0).attr("y2",-D),h.dispatch.on("stateChange",function(a){for(var c in a)u[c]=a[c];x.stateChange(u),b.update()}),i.dispatch.on("legendClick",function(a){if(a.disabled){switch(I=I.map(function(a){return a.disabled=!0,a}),a.disabled=!1,a.key){case"Grouped":e.stacked(!1);break;case"Stacked":e.stacked(!0)}u.stacked=e.stacked(),x.stateChange(u),t=e.stacked(),b.update()}}),x.on("changeState",function(a){"undefined"!=typeof a.disabled&&(j.forEach(function(b,c){b.disabled=a.disabled[c]}),u.disabled=a.disabled),"undefined"!=typeof a.stacked&&(e.stacked(a.stacked),u.stacked=a.stacked,t=a.stacked),b.update()})}),C.renderEnd("multibar horizontal chart immediate"),b}var c,d,e=a.models.multiBarHorizontal(),f=a.models.axis(),g=a.models.axis(),h=a.models.legend().height(30),i=a.models.legend().height(30),j=a.models.tooltip(),k={top:30,right:20,bottom:50,left:60},l=null,m=null,n=a.utils.defaultColor(),o=!0,p={},q=!0,r=!0,s=!0,t=!1,u=a.utils.state(),v=null,w=null,x=d3.dispatch("stateChange","changeState","renderEnd"),y=function(){return o?180:0},z=250;u.stacked=!1,e.stacked(t),f.orient("left").tickPadding(5).showMaxMin(!1).tickFormat(function(a){return a}),g.orient("bottom").tickFormat(d3.format(",.1f")),j.duration(0).valueFormatter(function(a,b){return g.tickFormat()(a,b)}).headerFormatter(function(a,b){return f.tickFormat()(a,b)}),i.updateState(!1);var A=function(a){return function(){return{active:a.map(function(a){return!a.disabled}),stacked:t}}},B=function(a){return function(b){void 0!==b.stacked&&(t=b.stacked),void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}},C=a.utils.renderWatch(x,z);return e.dispatch.on("elementMouseover.tooltip",function(a){a.value=b.x()(a.data),a.series={key:a.data.key,value:b.y()(a.data),color:a.color},j.data(a).hidden(!1)}),e.dispatch.on("elementMouseout.tooltip",function(){j.hidden(!0)}),e.dispatch.on("elementMousemove.tooltip",function(){j.position({top:d3.event.pageY,left:d3.event.pageX})()}),b.dispatch=x,b.multibar=e,b.legend=h,b.controls=i,b.xAxis=f,b.yAxis=g,b.state=u,b.tooltip=j,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return l},set:function(a){l=a}},height:{get:function(){return m},set:function(a){m=a}},showLegend:{get:function(){return q},set:function(a){q=a}},showControls:{get:function(){return o},set:function(a){o=a}},controlLabels:{get:function(){return p},set:function(a){p=a}},showXAxis:{get:function(){return r},set:function(a){r=a}},showYAxis:{get:function(){return s},set:function(a){s=a}},defaultState:{get:function(){return v},set:function(a){v=a}},noData:{get:function(){return w},set:function(a){w=a}},tooltips:{get:function(){return j.enabled()},set:function(b){a.deprecated("tooltips","use chart.tooltip.enabled() instead"),j.enabled(!!b)}},tooltipContent:{get:function(){return j.contentGenerator()},set:function(b){a.deprecated("tooltipContent","use chart.tooltip.contentGenerator() instead"),j.contentGenerator(b)}},margin:{get:function(){return k},set:function(a){k.top=void 0!==a.top?a.top:k.top,k.right=void 0!==a.right?a.right:k.right,k.bottom=void 0!==a.bottom?a.bottom:k.bottom,k.left=void 0!==a.left?a.left:k.left}},duration:{get:function(){return z},set:function(a){z=a,C.reset(z),e.duration(z),f.duration(z),g.duration(z)}},color:{get:function(){return n},set:function(b){n=a.utils.getColor(b),h.color(n)}},barColor:{get:function(){return e.barColor},set:function(a){e.barColor(a),h.color(function(a,b){return d3.rgb("#ccc").darker(1.5*b).toString()})}}}),a.utils.inheritOptions(b,e),a.utils.initOptions(b),b},a.models.multiChart=function(){"use strict";function b(j){return j.each(function(j){function k(a){var b=2===j[a.seriesIndex].yAxis?z:y;a.value=a.point.x,a.series={value:a.point.y,color:a.point.color},B.duration(100).valueFormatter(function(a,c){return b.tickFormat()(a,c)}).data(a).position(a.pos).hidden(!1)}function l(a){var b=2===j[a.seriesIndex].yAxis?z:y;a.point.x=v.x()(a.point),a.point.y=v.y()(a.point),B.duration(100).valueFormatter(function(a,c){return b.tickFormat()(a,c)}).data(a).position(a.pos).hidden(!1)}function n(a){var b=2===j[a.data.series].yAxis?z:y;a.value=t.x()(a.data),a.series={value:t.y()(a.data),color:a.color},B.duration(0).valueFormatter(function(a,c){return b.tickFormat()(a,c)}).data(a).hidden(!1)}var C=d3.select(this);a.utils.initSVG(C),b.update=function(){C.transition().call(b)},b.container=this;var D=a.utils.availableWidth(g,C,e),E=a.utils.availableHeight(h,C,e),F=j.filter(function(a){return"line"==a.type&&1==a.yAxis}),G=j.filter(function(a){return"line"==a.type&&2==a.yAxis}),H=j.filter(function(a){return"bar"==a.type&&1==a.yAxis}),I=j.filter(function(a){return"bar"==a.type&&2==a.yAxis}),J=j.filter(function(a){return"area"==a.type&&1==a.yAxis}),K=j.filter(function(a){return"area"==a.type&&2==a.yAxis});if(!(j&&j.length&&j.filter(function(a){return a.values.length}).length))return a.utils.noData(b,C),b;C.selectAll(".nv-noData").remove();var L=j.filter(function(a){return!a.disabled&&1==a.yAxis}).map(function(a){return a.values.map(function(a){return{x:a.x,y:a.y}})}),M=j.filter(function(a){return!a.disabled&&2==a.yAxis}).map(function(a){return a.values.map(function(a){return{x:a.x,y:a.y}})});o.domain(d3.extent(d3.merge(L.concat(M)),function(a){return a.x})).range([0,D]);var N=C.selectAll("g.wrap.multiChart").data([j]),O=N.enter().append("g").attr("class","wrap nvd3 multiChart").append("g");O.append("g").attr("class","nv-x nv-axis"),O.append("g").attr("class","nv-y1 nv-axis"),O.append("g").attr("class","nv-y2 nv-axis"),O.append("g").attr("class","lines1Wrap"),O.append("g").attr("class","lines2Wrap"),O.append("g").attr("class","bars1Wrap"),O.append("g").attr("class","bars2Wrap"),O.append("g").attr("class","stack1Wrap"),O.append("g").attr("class","stack2Wrap"),O.append("g").attr("class","legendWrap");var P=N.select("g"),Q=j.map(function(a,b){return j[b].color||f(a,b)});if(i){var R=A.align()?D/2:D,S=A.align()?R:0;A.width(R),A.color(Q),P.select(".legendWrap").datum(j.map(function(a){return a.originalKey=void 0===a.originalKey?a.key:a.originalKey,a.key=a.originalKey+(1==a.yAxis?"":" (right axis)"),a})).call(A),e.top!=A.height()&&(e.top=A.height(),E=a.utils.availableHeight(h,C,e)),P.select(".legendWrap").attr("transform","translate("+S+","+-e.top+")")}r.width(D).height(E).interpolate(m).color(Q.filter(function(a,b){return!j[b].disabled&&1==j[b].yAxis&&"line"==j[b].type})),s.width(D).height(E).interpolate(m).color(Q.filter(function(a,b){return!j[b].disabled&&2==j[b].yAxis&&"line"==j[b].type})),t.width(D).height(E).color(Q.filter(function(a,b){return!j[b].disabled&&1==j[b].yAxis&&"bar"==j[b].type})),u.width(D).height(E).color(Q.filter(function(a,b){return!j[b].disabled&&2==j[b].yAxis&&"bar"==j[b].type})),v.width(D).height(E).color(Q.filter(function(a,b){return!j[b].disabled&&1==j[b].yAxis&&"area"==j[b].type})),w.width(D).height(E).color(Q.filter(function(a,b){return!j[b].disabled&&2==j[b].yAxis&&"area"==j[b].type})),P.attr("transform","translate("+e.left+","+e.top+")");var T=P.select(".lines1Wrap").datum(F.filter(function(a){return!a.disabled})),U=P.select(".bars1Wrap").datum(H.filter(function(a){return!a.disabled})),V=P.select(".stack1Wrap").datum(J.filter(function(a){return!a.disabled})),W=P.select(".lines2Wrap").datum(G.filter(function(a){return!a.disabled})),X=P.select(".bars2Wrap").datum(I.filter(function(a){return!a.disabled})),Y=P.select(".stack2Wrap").datum(K.filter(function(a){return!a.disabled})),Z=J.length?J.map(function(a){return a.values}).reduce(function(a,b){return a.map(function(a,c){return{x:a.x,y:a.y+b[c].y}})}).concat([{x:0,y:0}]):[],$=K.length?K.map(function(a){return a.values}).reduce(function(a,b){return a.map(function(a,c){return{x:a.x,y:a.y+b[c].y}})}).concat([{x:0,y:0}]):[];p.domain(c||d3.extent(d3.merge(L).concat(Z),function(a){return a.y})).range([0,E]),q.domain(d||d3.extent(d3.merge(M).concat($),function(a){return a.y})).range([0,E]),r.yDomain(p.domain()),t.yDomain(p.domain()),v.yDomain(p.domain()),s.yDomain(q.domain()),u.yDomain(q.domain()),w.yDomain(q.domain()),J.length&&d3.transition(V).call(v),K.length&&d3.transition(Y).call(w),H.length&&d3.transition(U).call(t),I.length&&d3.transition(X).call(u),F.length&&d3.transition(T).call(r),G.length&&d3.transition(W).call(s),x._ticks(a.utils.calcTicksX(D/100,j)).tickSize(-E,0),P.select(".nv-x.nv-axis").attr("transform","translate(0,"+E+")"),d3.transition(P.select(".nv-x.nv-axis")).call(x),y._ticks(a.utils.calcTicksY(E/36,j)).tickSize(-D,0),d3.transition(P.select(".nv-y1.nv-axis")).call(y),z._ticks(a.utils.calcTicksY(E/36,j)).tickSize(-D,0),d3.transition(P.select(".nv-y2.nv-axis")).call(z),P.select(".nv-y1.nv-axis").classed("nv-disabled",L.length?!1:!0).attr("transform","translate("+o.range()[0]+",0)"),P.select(".nv-y2.nv-axis").classed("nv-disabled",M.length?!1:!0).attr("transform","translate("+o.range()[1]+",0)"),A.dispatch.on("stateChange",function(){b.update()}),r.dispatch.on("elementMouseover.tooltip",k),s.dispatch.on("elementMouseover.tooltip",k),r.dispatch.on("elementMouseout.tooltip",function(){B.hidden(!0)}),s.dispatch.on("elementMouseout.tooltip",function(){B.hidden(!0)}),v.dispatch.on("elementMouseover.tooltip",l),w.dispatch.on("elementMouseover.tooltip",l),v.dispatch.on("elementMouseout.tooltip",function(){B.hidden(!0)}),w.dispatch.on("elementMouseout.tooltip",function(){B.hidden(!0)}),t.dispatch.on("elementMouseover.tooltip",n),u.dispatch.on("elementMouseover.tooltip",n),t.dispatch.on("elementMouseout.tooltip",function(){B.hidden(!0)}),u.dispatch.on("elementMouseout.tooltip",function(){B.hidden(!0)}),t.dispatch.on("elementMousemove.tooltip",function(){B.position({top:d3.event.pageY,left:d3.event.pageX})()}),u.dispatch.on("elementMousemove.tooltip",function(){B.position({top:d3.event.pageY,left:d3.event.pageX})()})}),b}var c,d,e={top:30,right:20,bottom:50,left:60},f=a.utils.defaultColor(),g=null,h=null,i=!0,j=null,k=function(a){return a.x},l=function(a){return a.y},m="monotone",n=!0,o=d3.scale.linear(),p=d3.scale.linear(),q=d3.scale.linear(),r=a.models.line().yScale(p),s=a.models.line().yScale(q),t=a.models.multiBar().stacked(!1).yScale(p),u=a.models.multiBar().stacked(!1).yScale(q),v=a.models.stackedArea().yScale(p),w=a.models.stackedArea().yScale(q),x=a.models.axis().scale(o).orient("bottom").tickPadding(5),y=a.models.axis().scale(p).orient("left"),z=a.models.axis().scale(q).orient("right"),A=a.models.legend().height(30),B=a.models.tooltip(),C=d3.dispatch();return b.dispatch=C,b.lines1=r,b.lines2=s,b.bars1=t,b.bars2=u,b.stack1=v,b.stack2=w,b.xAxis=x,b.yAxis1=y,b.yAxis2=z,b.tooltip=B,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return g},set:function(a){g=a}},height:{get:function(){return h},set:function(a){h=a}},showLegend:{get:function(){return i},set:function(a){i=a}},yDomain1:{get:function(){return c},set:function(a){c=a}},yDomain2:{get:function(){return d},set:function(a){d=a}},noData:{get:function(){return j},set:function(a){j=a}},interpolate:{get:function(){return m},set:function(a){m=a}},tooltips:{get:function(){return B.enabled()},set:function(b){a.deprecated("tooltips","use chart.tooltip.enabled() instead"),B.enabled(!!b)}},tooltipContent:{get:function(){return B.contentGenerator()},set:function(b){a.deprecated("tooltipContent","use chart.tooltip.contentGenerator() instead"),B.contentGenerator(b)}},margin:{get:function(){return e},set:function(a){e.top=void 0!==a.top?a.top:e.top,e.right=void 0!==a.right?a.right:e.right,e.bottom=void 0!==a.bottom?a.bottom:e.bottom,e.left=void 0!==a.left?a.left:e.left}},color:{get:function(){return f},set:function(b){f=a.utils.getColor(b)}},x:{get:function(){return k},set:function(a){k=a,r.x(a),s.x(a),t.x(a),u.x(a),v.x(a),w.x(a)}},y:{get:function(){return l},set:function(a){l=a,r.y(a),s.y(a),v.y(a),w.y(a),t.y(a),u.y(a)}},useVoronoi:{get:function(){return n},set:function(a){n=a,r.useVoronoi(a),s.useVoronoi(a),v.useVoronoi(a),w.useVoronoi(a)}}}),a.utils.initOptions(b),b},a.models.ohlcBar=function(){"use strict";function b(y){return y.each(function(b){k=d3.select(this);var y=a.utils.availableWidth(h,k,g),A=a.utils.availableHeight(i,k,g);a.utils.initSVG(k);var B=y/b[0].values.length*.9;l.domain(c||d3.extent(b[0].values.map(n).concat(t))),l.range(v?e||[.5*y/b[0].values.length,y*(b[0].values.length-.5)/b[0].values.length]:e||[5+B/2,y-B/2-5]),m.domain(d||[d3.min(b[0].values.map(s).concat(u)),d3.max(b[0].values.map(r).concat(u))]).range(f||[A,0]),l.domain()[0]===l.domain()[1]&&l.domain(l.domain()[0]?[l.domain()[0]-.01*l.domain()[0],l.domain()[1]+.01*l.domain()[1]]:[-1,1]),m.domain()[0]===m.domain()[1]&&m.domain(m.domain()[0]?[m.domain()[0]+.01*m.domain()[0],m.domain()[1]-.01*m.domain()[1]]:[-1,1]);var C=d3.select(this).selectAll("g.nv-wrap.nv-ohlcBar").data([b[0].values]),D=C.enter().append("g").attr("class","nvd3 nv-wrap nv-ohlcBar"),E=D.append("defs"),F=D.append("g"),G=C.select("g");F.append("g").attr("class","nv-ticks"),C.attr("transform","translate("+g.left+","+g.top+")"),k.on("click",function(a,b){z.chartClick({data:a,index:b,pos:d3.event,id:j})}),E.append("clipPath").attr("id","nv-chart-clip-path-"+j).append("rect"),C.select("#nv-chart-clip-path-"+j+" rect").attr("width",y).attr("height",A),G.attr("clip-path",w?"url(#nv-chart-clip-path-"+j+")":"");var H=C.select(".nv-ticks").selectAll(".nv-tick").data(function(a){return a});H.exit().remove(),H.enter().append("path").attr("class",function(a,b,c){return(p(a,b)>q(a,b)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+c+"-"+b}).attr("d",function(a,b){return"m0,0l0,"+(m(p(a,b))-m(r(a,b)))+"l"+-B/2+",0l"+B/2+",0l0,"+(m(s(a,b))-m(p(a,b)))+"l0,"+(m(q(a,b))-m(s(a,b)))+"l"+B/2+",0l"+-B/2+",0z"}).attr("transform",function(a,b){return"translate("+l(n(a,b))+","+m(r(a,b))+")"}).attr("fill",function(){return x[0]}).attr("stroke",function(){return x[0]}).attr("x",0).attr("y",function(a,b){return m(Math.max(0,o(a,b)))}).attr("height",function(a,b){return Math.abs(m(o(a,b))-m(0))}),H.attr("class",function(a,b,c){return(p(a,b)>q(a,b)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+c+"-"+b}),d3.transition(H).attr("transform",function(a,b){return"translate("+l(n(a,b))+","+m(r(a,b))+")"}).attr("d",function(a,c){var d=y/b[0].values.length*.9;return"m0,0l0,"+(m(p(a,c))-m(r(a,c)))+"l"+-d/2+",0l"+d/2+",0l0,"+(m(s(a,c))-m(p(a,c)))+"l0,"+(m(q(a,c))-m(s(a,c)))+"l"+d/2+",0l"+-d/2+",0z"})}),b}var c,d,e,f,g={top:0,right:0,bottom:0,left:0},h=null,i=null,j=Math.floor(1e4*Math.random()),k=null,l=d3.scale.linear(),m=d3.scale.linear(),n=function(a){return a.x},o=function(a){return a.y},p=function(a){return a.open},q=function(a){return a.close},r=function(a){return a.high},s=function(a){return a.low},t=[],u=[],v=!1,w=!0,x=a.utils.defaultColor(),y=!1,z=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState","renderEnd","chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove");return b.highlightPoint=function(a,c){b.clearHighlights(),k.select(".nv-ohlcBar .nv-tick-0-"+a).classed("hover",c)},b.clearHighlights=function(){k.select(".nv-ohlcBar .nv-tick.hover").classed("hover",!1)},b.dispatch=z,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return h},set:function(a){h=a}},height:{get:function(){return i},set:function(a){i=a}},xScale:{get:function(){return l},set:function(a){l=a}},yScale:{get:function(){return m},set:function(a){m=a}},xDomain:{get:function(){return c},set:function(a){c=a}},yDomain:{get:function(){return d},set:function(a){d=a}},xRange:{get:function(){return e},set:function(a){e=a}},yRange:{get:function(){return f},set:function(a){f=a}},forceX:{get:function(){return t},set:function(a){t=a}},forceY:{get:function(){return u},set:function(a){u=a}},padData:{get:function(){return v},set:function(a){v=a}},clipEdge:{get:function(){return w},set:function(a){w=a}},id:{get:function(){return j},set:function(a){j=a}},interactive:{get:function(){return y},set:function(a){y=a}},x:{get:function(){return n},set:function(a){n=a}},y:{get:function(){return o},set:function(a){o=a}},open:{get:function(){return p()},set:function(a){p=a}},close:{get:function(){return q()},set:function(a){q=a}},high:{get:function(){return r},set:function(a){r=a}},low:{get:function(){return s},set:function(a){s=a}},margin:{get:function(){return g},set:function(a){g.top=void 0!=a.top?a.top:g.top,g.right=void 0!=a.right?a.right:g.right,g.bottom=void 0!=a.bottom?a.bottom:g.bottom,g.left=void 0!=a.left?a.left:g.left -}},color:{get:function(){return x},set:function(b){x=a.utils.getColor(b)}}}),a.utils.initOptions(b),b},a.models.parallelCoordinates=function(){"use strict";function b(p){return p.each(function(b){function p(a){return F(h.map(function(b){if(isNaN(a[b])||isNaN(parseFloat(a[b]))){var c=g[b].domain(),d=g[b].range(),e=c[0]-(c[1]-c[0])/9;if(J.indexOf(b)<0){var h=d3.scale.linear().domain([e,c[1]]).range([x-12,d[1]]);g[b].brush.y(h),J.push(b)}return[f(b),g[b](e)]}return J.length>0?(D.style("display","inline"),E.style("display","inline")):(D.style("display","none"),E.style("display","none")),[f(b),g[b](a[b])]}))}function q(){var a=h.filter(function(a){return!g[a].brush.empty()}),b=a.map(function(a){return g[a].brush.extent()});k=[],a.forEach(function(a,c){k[c]={dimension:a,extent:b[c]}}),l=[],M.style("display",function(c){var d=a.every(function(a,d){return isNaN(c[a])&&b[d][0]==g[a].brush.y().domain()[0]?!0:b[d][0]<=c[a]&&c[a]<=b[d][1]});return d&&l.push(c),d?null:"none"}),o.brush({filters:k,active:l})}function r(a){m[a]=this.parentNode.__origin__=f(a),L.attr("visibility","hidden")}function s(a){m[a]=Math.min(w,Math.max(0,this.parentNode.__origin__+=d3.event.x)),M.attr("d",p),h.sort(function(a,b){return u(a)-u(b)}),f.domain(h),N.attr("transform",function(a){return"translate("+u(a)+")"})}function t(a){delete this.parentNode.__origin__,delete m[a],d3.select(this.parentNode).attr("transform","translate("+f(a)+")"),M.attr("d",p),L.attr("d",p).attr("visibility",null)}function u(a){var b=m[a];return null==b?f(a):b}var v=d3.select(this),w=a.utils.availableWidth(d,v,c),x=a.utils.availableHeight(e,v,c);a.utils.initSVG(v),l=b,f.rangePoints([0,w],1).domain(h);var y={};h.forEach(function(a){var c=d3.extent(b,function(b){return+b[a]});return y[a]=!1,void 0===c[0]&&(y[a]=!0,c[0]=0,c[1]=0),c[0]===c[1]&&(c[0]=c[0]-1,c[1]=c[1]+1),g[a]=d3.scale.linear().domain(c).range([.9*(x-12),0]),g[a].brush=d3.svg.brush().y(g[a]).on("brush",q),"name"!=a});var z=v.selectAll("g.nv-wrap.nv-parallelCoordinates").data([b]),A=z.enter().append("g").attr("class","nvd3 nv-wrap nv-parallelCoordinates"),B=A.append("g"),C=z.select("g");B.append("g").attr("class","nv-parallelCoordinates background"),B.append("g").attr("class","nv-parallelCoordinates foreground"),B.append("g").attr("class","nv-parallelCoordinates missingValuesline"),z.attr("transform","translate("+c.left+","+c.top+")");var D,E,F=d3.svg.line().interpolate("cardinal").tension(n),G=d3.svg.axis().orient("left"),H=d3.behavior.drag().on("dragstart",r).on("drag",s).on("dragend",t),I=f.range()[1]-f.range()[0],J=[],K=[0+I/2,x-12,w-I/2,x-12];D=z.select(".missingValuesline").selectAll("line").data([K]),D.enter().append("line"),D.exit().remove(),D.attr("x1",function(a){return a[0]}).attr("y1",function(a){return a[1]}).attr("x2",function(a){return a[2]}).attr("y2",function(a){return a[3]}),E=z.select(".missingValuesline").selectAll("text").data(["undefined values"]),E.append("text").data(["undefined values"]),E.enter().append("text"),E.exit().remove(),E.attr("y",x).attr("x",w-92-I/2).text(function(a){return a});var L=z.select(".background").selectAll("path").data(b);L.enter().append("path"),L.exit().remove(),L.attr("d",p);var M=z.select(".foreground").selectAll("path").data(b);M.enter().append("path"),M.exit().remove(),M.attr("d",p).attr("stroke",j),M.on("mouseover",function(a,b){d3.select(this).classed("hover",!0),o.elementMouseover({label:a.name,data:a.data,index:b,pos:[d3.mouse(this.parentNode)[0],d3.mouse(this.parentNode)[1]]})}),M.on("mouseout",function(a,b){d3.select(this).classed("hover",!1),o.elementMouseout({label:a.name,data:a.data,index:b})});var N=C.selectAll(".dimension").data(h),O=N.enter().append("g").attr("class","nv-parallelCoordinates dimension");O.append("g").attr("class","nv-parallelCoordinates nv-axis"),O.append("g").attr("class","nv-parallelCoordinates-brush"),O.append("text").attr("class","nv-parallelCoordinates nv-label"),N.attr("transform",function(a){return"translate("+f(a)+",0)"}),N.exit().remove(),N.select(".nv-label").style("cursor","move").attr("dy","-1em").attr("text-anchor","middle").text(String).on("mouseover",function(a){o.elementMouseover({dim:a,pos:[d3.mouse(this.parentNode.parentNode)[0],d3.mouse(this.parentNode.parentNode)[1]]})}).on("mouseout",function(a){o.elementMouseout({dim:a})}).call(H),N.select(".nv-axis").each(function(a,b){d3.select(this).call(G.scale(g[a]).tickFormat(d3.format(i[b])))}),N.select(".nv-parallelCoordinates-brush").each(function(a){d3.select(this).call(g[a].brush)}).selectAll("rect").attr("x",-8).attr("width",16)}),b}var c={top:30,right:0,bottom:10,left:0},d=null,e=null,f=d3.scale.ordinal(),g={},h=[],i=[],j=a.utils.defaultColor(),k=[],l=[],m=[],n=1,o=d3.dispatch("brush","elementMouseover","elementMouseout");return b.dispatch=o,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return d},set:function(a){d=a}},height:{get:function(){return e},set:function(a){e=a}},dimensionNames:{get:function(){return h},set:function(a){h=a}},dimensionFormats:{get:function(){return i},set:function(a){i=a}},lineTension:{get:function(){return n},set:function(a){n=a}},dimensions:{get:function(){return h},set:function(b){a.deprecated("dimensions","use dimensionNames instead"),h=b}},margin:{get:function(){return c},set:function(a){c.top=void 0!==a.top?a.top:c.top,c.right=void 0!==a.right?a.right:c.right,c.bottom=void 0!==a.bottom?a.bottom:c.bottom,c.left=void 0!==a.left?a.left:c.left}},color:{get:function(){return j},set:function(b){j=a.utils.getColor(b)}}}),a.utils.initOptions(b),b},a.models.pie=function(){"use strict";function b(E){return D.reset(),E.each(function(b){function E(a,b){a.endAngle=isNaN(a.endAngle)?0:a.endAngle,a.startAngle=isNaN(a.startAngle)?0:a.startAngle,p||(a.innerRadius=0);var c=d3.interpolate(this._current,a);return this._current=c(0),function(a){return B[b](c(a))}}var F=d-c.left-c.right,G=e-c.top-c.bottom,H=Math.min(F,G)/2,I=[],J=[];if(i=d3.select(this),0===z.length)for(var K=H-H/5,L=y*H,M=0;Mc)return"";if("function"==typeof n)d=n(a,b,{key:f(a.data),value:g(a.data),percent:k(c)});else switch(n){case"key":d=f(a.data);break;case"value":d=k(g(a.data));break;case"percent":d=d3.format("%")(c)}return d})}}),D.renderEnd("pie immediate"),b}var c={top:0,right:0,bottom:0,left:0},d=500,e=500,f=function(a){return a.x},g=function(a){return a.y},h=Math.floor(1e4*Math.random()),i=null,j=a.utils.defaultColor(),k=d3.format(",.2f"),l=!0,m=!1,n="key",o=.02,p=!1,q=!1,r=!0,s=0,t=!1,u=!1,v=!1,w=!1,x=0,y=.5,z=[],A=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),B=[],C=[],D=a.utils.renderWatch(A);return b.dispatch=A,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{arcsRadius:{get:function(){return z},set:function(a){z=a}},width:{get:function(){return d},set:function(a){d=a}},height:{get:function(){return e},set:function(a){e=a}},showLabels:{get:function(){return l},set:function(a){l=a}},title:{get:function(){return q},set:function(a){q=a}},titleOffset:{get:function(){return s},set:function(a){s=a}},labelThreshold:{get:function(){return o},set:function(a){o=a}},valueFormat:{get:function(){return k},set:function(a){k=a}},x:{get:function(){return f},set:function(a){f=a}},id:{get:function(){return h},set:function(a){h=a}},endAngle:{get:function(){return w},set:function(a){w=a}},startAngle:{get:function(){return u},set:function(a){u=a}},padAngle:{get:function(){return v},set:function(a){v=a}},cornerRadius:{get:function(){return x},set:function(a){x=a}},donutRatio:{get:function(){return y},set:function(a){y=a}},labelsOutside:{get:function(){return m},set:function(a){m=a}},labelSunbeamLayout:{get:function(){return t},set:function(a){t=a}},donut:{get:function(){return p},set:function(a){p=a}},growOnHover:{get:function(){return r},set:function(a){r=a}},pieLabelsOutside:{get:function(){return m},set:function(b){m=b,a.deprecated("pieLabelsOutside","use labelsOutside instead")}},donutLabelsOutside:{get:function(){return m},set:function(b){m=b,a.deprecated("donutLabelsOutside","use labelsOutside instead")}},labelFormat:{get:function(){return k},set:function(b){k=b,a.deprecated("labelFormat","use valueFormat instead")}},margin:{get:function(){return c},set:function(a){c.top="undefined"!=typeof a.top?a.top:c.top,c.right="undefined"!=typeof a.right?a.right:c.right,c.bottom="undefined"!=typeof a.bottom?a.bottom:c.bottom,c.left="undefined"!=typeof a.left?a.left:c.left}},y:{get:function(){return g},set:function(a){g=d3.functor(a)}},color:{get:function(){return j},set:function(b){j=a.utils.getColor(b)}},labelType:{get:function(){return n},set:function(a){n=a||"key"}}}),a.utils.initOptions(b),b},a.models.pieChart=function(){"use strict";function b(e){return q.reset(),q.models(c),e.each(function(e){var k=d3.select(this);a.utils.initSVG(k);var n=a.utils.availableWidth(g,k,f),o=a.utils.availableHeight(h,k,f);if(b.update=function(){k.transition().call(b)},b.container=this,l.setter(s(e),b.update).getter(r(e)).update(),l.disabled=e.map(function(a){return!!a.disabled}),!m){var q;m={};for(q in l)m[q]=l[q]instanceof Array?l[q].slice(0):l[q]}if(!e||!e.length)return a.utils.noData(b,k),b;k.selectAll(".nv-noData").remove();var t=k.selectAll("g.nv-wrap.nv-pieChart").data([e]),u=t.enter().append("g").attr("class","nvd3 nv-wrap nv-pieChart").append("g"),v=t.select("g");if(u.append("g").attr("class","nv-pieWrap"),u.append("g").attr("class","nv-legendWrap"),i)if("top"===j)d.width(n).key(c.x()),t.select(".nv-legendWrap").datum(e).call(d),f.top!=d.height()&&(f.top=d.height(),o=a.utils.availableHeight(h,k,f)),t.select(".nv-legendWrap").attr("transform","translate(0,"+-f.top+")");else if("right"===j){var w=a.models.legend().width();w>n/2&&(w=n/2),d.height(o).key(c.x()),d.width(w),n-=d.width(),t.select(".nv-legendWrap").datum(e).call(d).attr("transform","translate("+n+",0)")}t.attr("transform","translate("+f.left+","+f.top+")"),c.width(n).height(o);var x=v.select(".nv-pieWrap").datum([e]);d3.transition(x).call(c),d.dispatch.on("stateChange",function(a){for(var c in a)l[c]=a[c];p.stateChange(l),b.update()}),p.on("changeState",function(a){"undefined"!=typeof a.disabled&&(e.forEach(function(b,c){b.disabled=a.disabled[c]}),l.disabled=a.disabled),b.update()})}),q.renderEnd("pieChart immediate"),b}var c=a.models.pie(),d=a.models.legend(),e=a.models.tooltip(),f={top:30,right:20,bottom:20,left:20},g=null,h=null,i=!0,j="top",k=a.utils.defaultColor(),l=a.utils.state(),m=null,n=null,o=250,p=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState","renderEnd");e.headerEnabled(!1).duration(0).valueFormatter(function(a,b){return c.valueFormat()(a,b)});var q=a.utils.renderWatch(p),r=function(a){return function(){return{active:a.map(function(a){return!a.disabled})}}},s=function(a){return function(b){void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}};return c.dispatch.on("elementMouseover.tooltip",function(a){a.series={key:b.x()(a.data),value:b.y()(a.data),color:a.color},e.data(a).hidden(!1)}),c.dispatch.on("elementMouseout.tooltip",function(){e.hidden(!0)}),c.dispatch.on("elementMousemove.tooltip",function(){e.position({top:d3.event.pageY,left:d3.event.pageX})()}),b.legend=d,b.dispatch=p,b.pie=c,b.tooltip=e,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{noData:{get:function(){return n},set:function(a){n=a}},showLegend:{get:function(){return i},set:function(a){i=a}},legendPosition:{get:function(){return j},set:function(a){j=a}},defaultState:{get:function(){return m},set:function(a){m=a}},tooltips:{get:function(){return e.enabled()},set:function(b){a.deprecated("tooltips","use chart.tooltip.enabled() instead"),e.enabled(!!b)}},tooltipContent:{get:function(){return e.contentGenerator()},set:function(b){a.deprecated("tooltipContent","use chart.tooltip.contentGenerator() instead"),e.contentGenerator(b)}},color:{get:function(){return k},set:function(a){k=a,d.color(k),c.color(k)}},duration:{get:function(){return o},set:function(a){o=a,q.reset(o)}},margin:{get:function(){return f},set:function(a){f.top=void 0!==a.top?a.top:f.top,f.right=void 0!==a.right?a.right:f.right,f.bottom=void 0!==a.bottom?a.bottom:f.bottom,f.left=void 0!==a.left?a.left:f.left}}}),a.utils.inheritOptions(b,c),a.utils.initOptions(b),b},a.models.scatter=function(){"use strict";function b(N){return P.reset(),N.each(function(b){function N(){if(O=!1,!w)return!1;if(M===!0){var a=d3.merge(b.map(function(a,b){return a.values.map(function(a,c){var d=p(a,c),e=q(a,c);return[m(d)+1e-4*Math.random(),n(e)+1e-4*Math.random(),b,c,a]}).filter(function(a,b){return x(a[4],b)})}));if(0==a.length)return!1;a.length<3&&(a.push([m.range()[0]-20,n.range()[0]-20,null,null]),a.push([m.range()[1]+20,n.range()[1]+20,null,null]),a.push([m.range()[0]-20,n.range()[0]+20,null,null]),a.push([m.range()[1]+20,n.range()[1]-20,null,null]));var c=d3.geom.polygon([[-10,-10],[-10,i+10],[h+10,i+10],[h+10,-10]]),d=d3.geom.voronoi(a).map(function(b,d){return{data:c.clip(b),series:a[d][2],point:a[d][3]}});U.select(".nv-point-paths").selectAll("path").remove();var e=U.select(".nv-point-paths").selectAll("path").data(d),f=e.enter().append("svg:path").attr("d",function(a){return a&&a.data&&0!==a.data.length?"M"+a.data.join(",")+"Z":"M 0 0"}).attr("id",function(a,b){return"nv-path-"+b}).attr("clip-path",function(a,b){return"url(#nv-clip-"+b+")"});C&&f.style("fill",d3.rgb(230,230,230)).style("fill-opacity",.4).style("stroke-opacity",1).style("stroke",d3.rgb(200,200,200)),B&&(U.select(".nv-point-clips").selectAll("clipPath").remove(),U.select(".nv-point-clips").selectAll("clipPath").data(a).enter().append("svg:clipPath").attr("id",function(a,b){return"nv-clip-"+b}).append("svg:circle").attr("cx",function(a){return a[0]}).attr("cy",function(a){return a[1]}).attr("r",D));var k=function(a,c){if(O)return 0;var d=b[a.series];if(void 0!==d){var e=d.values[a.point];e.color=j(d,a.series),e.x=p(e),e.y=q(e);var f=l.node().getBoundingClientRect(),h=window.pageYOffset||document.documentElement.scrollTop,i=window.pageXOffset||document.documentElement.scrollLeft,k={left:m(p(e,a.point))+f.left+i+g.left+10,top:n(q(e,a.point))+f.top+h+g.top+10};c({point:e,series:d,pos:k,seriesIndex:a.series,pointIndex:a.point})}};e.on("click",function(a){k(a,L.elementClick)}).on("dblclick",function(a){k(a,L.elementDblClick)}).on("mouseover",function(a){k(a,L.elementMouseover)}).on("mouseout",function(a){k(a,L.elementMouseout)})}else U.select(".nv-groups").selectAll(".nv-group").selectAll(".nv-point").on("click",function(a,c){if(O||!b[a.series])return 0;var d=b[a.series],e=d.values[c];L.elementClick({point:e,series:d,pos:[m(p(e,c))+g.left,n(q(e,c))+g.top],seriesIndex:a.series,pointIndex:c})}).on("dblclick",function(a,c){if(O||!b[a.series])return 0;var d=b[a.series],e=d.values[c];L.elementDblClick({point:e,series:d,pos:[m(p(e,c))+g.left,n(q(e,c))+g.top],seriesIndex:a.series,pointIndex:c})}).on("mouseover",function(a,c){if(O||!b[a.series])return 0;var d=b[a.series],e=d.values[c];L.elementMouseover({point:e,series:d,pos:[m(p(e,c))+g.left,n(q(e,c))+g.top],seriesIndex:a.series,pointIndex:c,color:j(a,c)})}).on("mouseout",function(a,c){if(O||!b[a.series])return 0;var d=b[a.series],e=d.values[c];L.elementMouseout({point:e,series:d,seriesIndex:a.series,pointIndex:c,color:j(a,c)})})}l=d3.select(this);var R=a.utils.availableWidth(h,l,g),S=a.utils.availableHeight(i,l,g);a.utils.initSVG(l),b.forEach(function(a,b){a.values.forEach(function(a){a.series=b})});var T=E&&F&&I?[]:d3.merge(b.map(function(a){return a.values.map(function(a,b){return{x:p(a,b),y:q(a,b),size:r(a,b)}})}));m.domain(E||d3.extent(T.map(function(a){return a.x}).concat(t))),m.range(y&&b[0]?G||[(R*z+R)/(2*b[0].values.length),R-R*(1+z)/(2*b[0].values.length)]:G||[0,R]),n.domain(F||d3.extent(T.map(function(a){return a.y}).concat(u))).range(H||[S,0]),o.domain(I||d3.extent(T.map(function(a){return a.size}).concat(v))).range(J||Q),K=m.domain()[0]===m.domain()[1]||n.domain()[0]===n.domain()[1],m.domain()[0]===m.domain()[1]&&m.domain(m.domain()[0]?[m.domain()[0]-.01*m.domain()[0],m.domain()[1]+.01*m.domain()[1]]:[-1,1]),n.domain()[0]===n.domain()[1]&&n.domain(n.domain()[0]?[n.domain()[0]-.01*n.domain()[0],n.domain()[1]+.01*n.domain()[1]]:[-1,1]),isNaN(m.domain()[0])&&m.domain([-1,1]),isNaN(n.domain()[0])&&n.domain([-1,1]),c=c||m,d=d||n,e=e||o;var U=l.selectAll("g.nv-wrap.nv-scatter").data([b]),V=U.enter().append("g").attr("class","nvd3 nv-wrap nv-scatter nv-chart-"+k),W=V.append("defs"),X=V.append("g"),Y=U.select("g");U.classed("nv-single-point",K),X.append("g").attr("class","nv-groups"),X.append("g").attr("class","nv-point-paths"),V.append("g").attr("class","nv-point-clips"),U.attr("transform","translate("+g.left+","+g.top+")"),W.append("clipPath").attr("id","nv-edge-clip-"+k).append("rect"),U.select("#nv-edge-clip-"+k+" rect").attr("width",R).attr("height",S>0?S:0),Y.attr("clip-path",A?"url(#nv-edge-clip-"+k+")":""),O=!0;var Z=U.select(".nv-groups").selectAll(".nv-group").data(function(a){return a},function(a){return a.key});Z.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),Z.exit().remove(),Z.attr("class",function(a,b){return"nv-group nv-series-"+b}).classed("hover",function(a){return a.hover}),Z.watchTransition(P,"scatter: groups").style("fill",function(a,b){return j(a,b)}).style("stroke",function(a,b){return j(a,b)}).style("stroke-opacity",1).style("fill-opacity",.5);var $=Z.selectAll("path.nv-point").data(function(a){return a.values.map(function(a,b){return[a,b]}).filter(function(a,b){return x(a[0],b)})});$.enter().append("path").style("fill",function(a){return a.color}).style("stroke",function(a){return a.color}).attr("transform",function(a){return"translate("+c(p(a[0],a[1]))+","+d(q(a[0],a[1]))+")"}).attr("d",a.utils.symbol().type(function(a){return s(a[0])}).size(function(a){return o(r(a[0],a[1]))})),$.exit().remove(),Z.exit().selectAll("path.nv-point").watchTransition(P,"scatter exit").attr("transform",function(a){return"translate("+m(p(a[0],a[1]))+","+n(q(a[0],a[1]))+")"}).remove(),$.each(function(a){d3.select(this).classed("nv-point",!0).classed("nv-point-"+a[1],!0).classed("nv-noninteractive",!w).classed("hover",!1)}),$.watchTransition(P,"scatter points").attr("transform",function(a){return"translate("+m(p(a[0],a[1]))+","+n(q(a[0],a[1]))+")"}).attr("d",a.utils.symbol().type(function(a){return s(a[0])}).size(function(a){return o(r(a[0],a[1]))})),clearTimeout(f),f=setTimeout(N,300),c=m.copy(),d=n.copy(),e=o.copy()}),P.renderEnd("scatter immediate"),b}var c,d,e,f,g={top:0,right:0,bottom:0,left:0},h=null,i=null,j=a.utils.defaultColor(),k=Math.floor(1e5*Math.random()),l=null,m=d3.scale.linear(),n=d3.scale.linear(),o=d3.scale.linear(),p=function(a){return a.x},q=function(a){return a.y},r=function(a){return a.size||1},s=function(a){return a.shape||"circle"},t=[],u=[],v=[],w=!0,x=function(a){return!a.notActive},y=!1,z=.1,A=!1,B=!0,C=!1,D=function(){return 25},E=null,F=null,G=null,H=null,I=null,J=null,K=!1,L=d3.dispatch("elementClick","elementDblClick","elementMouseover","elementMouseout","renderEnd"),M=!0,N=250,O=!1,P=a.utils.renderWatch(L,N),Q=[16,256];return b.dispatch=L,b.options=a.utils.optionsFunc.bind(b),b._calls=new function(){this.clearHighlights=function(){return a.dom.write(function(){l.selectAll(".nv-point.hover").classed("hover",!1)}),null},this.highlightPoint=function(b,c,d){a.dom.write(function(){l.select(" .nv-series-"+b+" .nv-point-"+c).classed("hover",d)})}},L.on("elementMouseover.point",function(a){w&&b._calls.highlightPoint(a.seriesIndex,a.pointIndex,!0)}),L.on("elementMouseout.point",function(a){w&&b._calls.highlightPoint(a.seriesIndex,a.pointIndex,!1)}),b._options=Object.create({},{width:{get:function(){return h},set:function(a){h=a}},height:{get:function(){return i},set:function(a){i=a}},xScale:{get:function(){return m},set:function(a){m=a}},yScale:{get:function(){return n},set:function(a){n=a}},pointScale:{get:function(){return o},set:function(a){o=a}},xDomain:{get:function(){return E},set:function(a){E=a}},yDomain:{get:function(){return F},set:function(a){F=a}},pointDomain:{get:function(){return I},set:function(a){I=a}},xRange:{get:function(){return G},set:function(a){G=a}},yRange:{get:function(){return H},set:function(a){H=a}},pointRange:{get:function(){return J},set:function(a){J=a}},forceX:{get:function(){return t},set:function(a){t=a}},forceY:{get:function(){return u},set:function(a){u=a}},forcePoint:{get:function(){return v},set:function(a){v=a}},interactive:{get:function(){return w},set:function(a){w=a}},pointActive:{get:function(){return x},set:function(a){x=a}},padDataOuter:{get:function(){return z},set:function(a){z=a}},padData:{get:function(){return y},set:function(a){y=a}},clipEdge:{get:function(){return A},set:function(a){A=a}},clipVoronoi:{get:function(){return B},set:function(a){B=a}},clipRadius:{get:function(){return D},set:function(a){D=a}},showVoronoi:{get:function(){return C},set:function(a){C=a}},id:{get:function(){return k},set:function(a){k=a}},x:{get:function(){return p},set:function(a){p=d3.functor(a)}},y:{get:function(){return q},set:function(a){q=d3.functor(a)}},pointSize:{get:function(){return r},set:function(a){r=d3.functor(a)}},pointShape:{get:function(){return s},set:function(a){s=d3.functor(a)}},margin:{get:function(){return g},set:function(a){g.top=void 0!==a.top?a.top:g.top,g.right=void 0!==a.right?a.right:g.right,g.bottom=void 0!==a.bottom?a.bottom:g.bottom,g.left=void 0!==a.left?a.left:g.left}},duration:{get:function(){return N},set:function(a){N=a,P.reset(N)}},color:{get:function(){return j},set:function(b){j=a.utils.getColor(b)}},useVoronoi:{get:function(){return M},set:function(a){M=a,M===!1&&(B=!1)}}}),a.utils.initOptions(b),b},a.models.scatterChart=function(){"use strict";function b(z){return D.reset(),D.models(c),t&&D.models(d),u&&D.models(e),q&&D.models(g),r&&D.models(h),z.each(function(z){m=d3.select(this),a.utils.initSVG(m);var G=a.utils.availableWidth(k,m,j),H=a.utils.availableHeight(l,m,j);if(b.update=function(){0===A?m.call(b):m.transition().duration(A).call(b)},b.container=this,w.setter(F(z),b.update).getter(E(z)).update(),w.disabled=z.map(function(a){return!!a.disabled}),!x){var I;x={};for(I in w)x[I]=w[I]instanceof Array?w[I].slice(0):w[I]}if(!(z&&z.length&&z.filter(function(a){return a.values.length}).length))return a.utils.noData(b,m),D.renderEnd("scatter immediate"),b;m.selectAll(".nv-noData").remove(),o=c.xScale(),p=c.yScale();var J=m.selectAll("g.nv-wrap.nv-scatterChart").data([z]),K=J.enter().append("g").attr("class","nvd3 nv-wrap nv-scatterChart nv-chart-"+c.id()),L=K.append("g"),M=J.select("g");if(L.append("rect").attr("class","nvd3 nv-background").style("pointer-events","none"),L.append("g").attr("class","nv-x nv-axis"),L.append("g").attr("class","nv-y nv-axis"),L.append("g").attr("class","nv-scatterWrap"),L.append("g").attr("class","nv-regressionLinesWrap"),L.append("g").attr("class","nv-distWrap"),L.append("g").attr("class","nv-legendWrap"),v&&M.select(".nv-y.nv-axis").attr("transform","translate("+G+",0)"),s){var N=G;f.width(N),J.select(".nv-legendWrap").datum(z).call(f),j.top!=f.height()&&(j.top=f.height(),H=a.utils.availableHeight(l,m,j)),J.select(".nv-legendWrap").attr("transform","translate(0,"+-j.top+")")}J.attr("transform","translate("+j.left+","+j.top+")"),c.width(G).height(H).color(z.map(function(a,b){return a.color=a.color||n(a,b),a.color}).filter(function(a,b){return!z[b].disabled})),J.select(".nv-scatterWrap").datum(z.filter(function(a){return!a.disabled})).call(c),J.select(".nv-regressionLinesWrap").attr("clip-path","url(#nv-edge-clip-"+c.id()+")");var O=J.select(".nv-regressionLinesWrap").selectAll(".nv-regLines").data(function(a){return a});O.enter().append("g").attr("class","nv-regLines");var P=O.selectAll(".nv-regLine").data(function(a){return[a]});P.enter().append("line").attr("class","nv-regLine").style("stroke-opacity",0),P.filter(function(a){return a.intercept&&a.slope}).watchTransition(D,"scatterPlusLineChart: regline").attr("x1",o.range()[0]).attr("x2",o.range()[1]).attr("y1",function(a){return p(o.domain()[0]*a.slope+a.intercept)}).attr("y2",function(a){return p(o.domain()[1]*a.slope+a.intercept)}).style("stroke",function(a,b,c){return n(a,c)}).style("stroke-opacity",function(a){return a.disabled||"undefined"==typeof a.slope||"undefined"==typeof a.intercept?0:1}),t&&(d.scale(o)._ticks(a.utils.calcTicksX(G/100,z)).tickSize(-H,0),M.select(".nv-x.nv-axis").attr("transform","translate(0,"+p.range()[0]+")").call(d)),u&&(e.scale(p)._ticks(a.utils.calcTicksY(H/36,z)).tickSize(-G,0),M.select(".nv-y.nv-axis").call(e)),q&&(g.getData(c.x()).scale(o).width(G).color(z.map(function(a,b){return a.color||n(a,b)}).filter(function(a,b){return!z[b].disabled})),L.select(".nv-distWrap").append("g").attr("class","nv-distributionX"),M.select(".nv-distributionX").attr("transform","translate(0,"+p.range()[0]+")").datum(z.filter(function(a){return!a.disabled})).call(g)),r&&(h.getData(c.y()).scale(p).width(H).color(z.map(function(a,b){return a.color||n(a,b)}).filter(function(a,b){return!z[b].disabled})),L.select(".nv-distWrap").append("g").attr("class","nv-distributionY"),M.select(".nv-distributionY").attr("transform","translate("+(v?G:-h.size())+",0)").datum(z.filter(function(a){return!a.disabled})).call(h)),f.dispatch.on("stateChange",function(a){for(var c in a)w[c]=a[c];y.stateChange(w),b.update()}),y.on("changeState",function(a){"undefined"!=typeof a.disabled&&(z.forEach(function(b,c){b.disabled=a.disabled[c]}),w.disabled=a.disabled),b.update()}),c.dispatch.on("elementMouseout.tooltip",function(a){i.hidden(!0),m.select(".nv-chart-"+c.id()+" .nv-series-"+a.seriesIndex+" .nv-distx-"+a.pointIndex).attr("y1",0),m.select(".nv-chart-"+c.id()+" .nv-series-"+a.seriesIndex+" .nv-disty-"+a.pointIndex).attr("x2",h.size())}),c.dispatch.on("elementMouseover.tooltip",function(a){m.select(".nv-series-"+a.seriesIndex+" .nv-distx-"+a.pointIndex).attr("y1",a.pos.top-H-j.top),m.select(".nv-series-"+a.seriesIndex+" .nv-disty-"+a.pointIndex).attr("x2",a.pos.left+g.size()-j.left),i.position(a.pos).data(a).hidden(!1)}),B=o.copy(),C=p.copy()}),D.renderEnd("scatter with line immediate"),b}var c=a.models.scatter(),d=a.models.axis(),e=a.models.axis(),f=a.models.legend(),g=a.models.distribution(),h=a.models.distribution(),i=a.models.tooltip(),j={top:30,right:20,bottom:50,left:75},k=null,l=null,m=null,n=a.utils.defaultColor(),o=c.xScale(),p=c.yScale(),q=!1,r=!1,s=!0,t=!0,u=!0,v=!1,w=a.utils.state(),x=null,y=d3.dispatch("stateChange","changeState","renderEnd"),z=null,A=250;c.xScale(o).yScale(p),d.orient("bottom").tickPadding(10),e.orient(v?"right":"left").tickPadding(10),g.axis("x"),h.axis("y"),i.headerFormatter(function(a,b){return d.tickFormat()(a,b)}).valueFormatter(function(a,b){return e.tickFormat()(a,b)});var B,C,D=a.utils.renderWatch(y,A),E=function(a){return function(){return{active:a.map(function(a){return!a.disabled})}}},F=function(a){return function(b){void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}};return b.dispatch=y,b.scatter=c,b.legend=f,b.xAxis=d,b.yAxis=e,b.distX=g,b.distY=h,b.tooltip=i,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return k},set:function(a){k=a}},height:{get:function(){return l},set:function(a){l=a}},container:{get:function(){return m},set:function(a){m=a}},showDistX:{get:function(){return q},set:function(a){q=a}},showDistY:{get:function(){return r},set:function(a){r=a}},showLegend:{get:function(){return s},set:function(a){s=a}},showXAxis:{get:function(){return t},set:function(a){t=a}},showYAxis:{get:function(){return u},set:function(a){u=a}},defaultState:{get:function(){return x},set:function(a){x=a}},noData:{get:function(){return z},set:function(a){z=a}},duration:{get:function(){return A},set:function(a){A=a}},tooltips:{get:function(){return i.enabled()},set:function(b){a.deprecated("tooltips","use chart.tooltip.enabled() instead"),i.enabled(!!b) -}},tooltipContent:{get:function(){return i.contentGenerator()},set:function(b){a.deprecated("tooltipContent","use chart.tooltip.contentGenerator() instead"),i.contentGenerator(b)}},tooltipXContent:{get:function(){return i.contentGenerator()},set:function(){a.deprecated("tooltipContent","This option is removed, put values into main tooltip.")}},tooltipYContent:{get:function(){return i.contentGenerator()},set:function(){a.deprecated("tooltipContent","This option is removed, put values into main tooltip.")}},margin:{get:function(){return j},set:function(a){j.top=void 0!==a.top?a.top:j.top,j.right=void 0!==a.right?a.right:j.right,j.bottom=void 0!==a.bottom?a.bottom:j.bottom,j.left=void 0!==a.left?a.left:j.left}},rightAlignYAxis:{get:function(){return v},set:function(a){v=a,e.orient(a?"right":"left")}},color:{get:function(){return n},set:function(b){n=a.utils.getColor(b),f.color(n),g.color(n),h.color(n)}}}),a.utils.inheritOptions(b,c),a.utils.initOptions(b),b},a.models.sparkline=function(){"use strict";function b(k){return k.each(function(b){var k=h-g.left-g.right,q=i-g.top-g.bottom;j=d3.select(this),a.utils.initSVG(j),l.domain(c||d3.extent(b,n)).range(e||[0,k]),m.domain(d||d3.extent(b,o)).range(f||[q,0]);{var r=j.selectAll("g.nv-wrap.nv-sparkline").data([b]),s=r.enter().append("g").attr("class","nvd3 nv-wrap nv-sparkline");s.append("g"),r.select("g")}r.attr("transform","translate("+g.left+","+g.top+")");var t=r.selectAll("path").data(function(a){return[a]});t.enter().append("path"),t.exit().remove(),t.style("stroke",function(a,b){return a.color||p(a,b)}).attr("d",d3.svg.line().x(function(a,b){return l(n(a,b))}).y(function(a,b){return m(o(a,b))}));var u=r.selectAll("circle.nv-point").data(function(a){function b(b){if(-1!=b){var c=a[b];return c.pointIndex=b,c}return null}var c=a.map(function(a,b){return o(a,b)}),d=b(c.lastIndexOf(m.domain()[1])),e=b(c.indexOf(m.domain()[0])),f=b(c.length-1);return[e,d,f].filter(function(a){return null!=a})});u.enter().append("circle"),u.exit().remove(),u.attr("cx",function(a){return l(n(a,a.pointIndex))}).attr("cy",function(a){return m(o(a,a.pointIndex))}).attr("r",2).attr("class",function(a){return n(a,a.pointIndex)==l.domain()[1]?"nv-point nv-currentValue":o(a,a.pointIndex)==m.domain()[0]?"nv-point nv-minValue":"nv-point nv-maxValue"})}),b}var c,d,e,f,g={top:2,right:0,bottom:2,left:0},h=400,i=32,j=null,k=!0,l=d3.scale.linear(),m=d3.scale.linear(),n=function(a){return a.x},o=function(a){return a.y},p=a.utils.getColor(["#000"]);return b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return h},set:function(a){h=a}},height:{get:function(){return i},set:function(a){i=a}},xDomain:{get:function(){return c},set:function(a){c=a}},yDomain:{get:function(){return d},set:function(a){d=a}},xRange:{get:function(){return e},set:function(a){e=a}},yRange:{get:function(){return f},set:function(a){f=a}},xScale:{get:function(){return l},set:function(a){l=a}},yScale:{get:function(){return m},set:function(a){m=a}},animate:{get:function(){return k},set:function(a){k=a}},x:{get:function(){return n},set:function(a){n=d3.functor(a)}},y:{get:function(){return o},set:function(a){o=d3.functor(a)}},margin:{get:function(){return g},set:function(a){g.top=void 0!==a.top?a.top:g.top,g.right=void 0!==a.right?a.right:g.right,g.bottom=void 0!==a.bottom?a.bottom:g.bottom,g.left=void 0!==a.left?a.left:g.left}},color:{get:function(){return p},set:function(b){p=a.utils.getColor(b)}}}),a.utils.initOptions(b),b},a.models.sparklinePlus=function(){"use strict";function b(p){return p.each(function(p){function q(){if(!j){var a=z.selectAll(".nv-hoverValue").data(i),b=a.enter().append("g").attr("class","nv-hoverValue").style("stroke-opacity",0).style("fill-opacity",0);a.exit().transition().duration(250).style("stroke-opacity",0).style("fill-opacity",0).remove(),a.attr("transform",function(a){return"translate("+c(e.x()(p[a],a))+",0)"}).transition().duration(250).style("stroke-opacity",1).style("fill-opacity",1),i.length&&(b.append("line").attr("x1",0).attr("y1",-f.top).attr("x2",0).attr("y2",u),b.append("text").attr("class","nv-xValue").attr("x",-6).attr("y",-f.top).attr("text-anchor","end").attr("dy",".9em"),z.select(".nv-hoverValue .nv-xValue").text(k(e.x()(p[i[0]],i[0]))),b.append("text").attr("class","nv-yValue").attr("x",6).attr("y",-f.top).attr("text-anchor","start").attr("dy",".9em"),z.select(".nv-hoverValue .nv-yValue").text(l(e.y()(p[i[0]],i[0]))))}}function r(){function a(a,b){for(var c=Math.abs(e.x()(a[0],0)-b),d=0,f=0;fc;++c){for(b=0,d=0;bb;b++)a[b][c][1]/=d;else for(b=0;e>b;b++)a[b][c][1]=0}for(c=0;f>c;++c)g[c]=0;return g}}),u.renderEnd("stackedArea immediate"),b}var c,d,e={top:0,right:0,bottom:0,left:0},f=960,g=500,h=a.utils.defaultColor(),i=Math.floor(1e5*Math.random()),j=null,k=function(a){return a.x},l=function(a){return a.y},m="stack",n="zero",o="default",p="linear",q=!1,r=a.models.scatter(),s=250,t=d3.dispatch("areaClick","areaMouseover","areaMouseout","renderEnd","elementClick","elementMouseover","elementMouseout");r.pointSize(2.2).pointDomain([2.2,2.2]);var u=a.utils.renderWatch(t,s);return b.dispatch=t,b.scatter=r,r.dispatch.on("elementClick",function(){t.elementClick.apply(this,arguments)}),r.dispatch.on("elementMouseover",function(){t.elementMouseover.apply(this,arguments)}),r.dispatch.on("elementMouseout",function(){t.elementMouseout.apply(this,arguments)}),b.interpolate=function(a){return arguments.length?(p=a,b):p},b.duration=function(a){return arguments.length?(s=a,u.reset(s),r.duration(s),b):s},b.dispatch=t,b.scatter=r,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return f},set:function(a){f=a}},height:{get:function(){return g},set:function(a){g=a}},clipEdge:{get:function(){return q},set:function(a){q=a}},offset:{get:function(){return n},set:function(a){n=a}},order:{get:function(){return o},set:function(a){o=a}},interpolate:{get:function(){return p},set:function(a){p=a}},x:{get:function(){return k},set:function(a){k=d3.functor(a)}},y:{get:function(){return l},set:function(a){l=d3.functor(a)}},margin:{get:function(){return e},set:function(a){e.top=void 0!==a.top?a.top:e.top,e.right=void 0!==a.right?a.right:e.right,e.bottom=void 0!==a.bottom?a.bottom:e.bottom,e.left=void 0!==a.left?a.left:e.left}},color:{get:function(){return h},set:function(b){h=a.utils.getColor(b)}},style:{get:function(){return m},set:function(a){switch(m=a){case"stack":b.offset("zero"),b.order("default");break;case"stream":b.offset("wiggle"),b.order("inside-out");break;case"stream-center":b.offset("silhouette"),b.order("inside-out");break;case"expand":b.offset("expand"),b.order("default");break;case"stack_percent":b.offset(b.d3_stackedOffset_stackPercent),b.order("default")}}},duration:{get:function(){return s},set:function(a){s=a,u.reset(s),r.duration(s)}}}),a.utils.inheritOptions(b,r),a.utils.initOptions(b),b},a.models.stackedAreaChart=function(){"use strict";function b(k){return F.reset(),F.models(e),r&&F.models(f),s&&F.models(g),k.each(function(k){var x=d3.select(this),F=this;a.utils.initSVG(x);var K=a.utils.availableWidth(m,x,l),L=a.utils.availableHeight(n,x,l);if(b.update=function(){x.transition().duration(C).call(b)},b.container=this,v.setter(I(k),b.update).getter(H(k)).update(),v.disabled=k.map(function(a){return!!a.disabled}),!w){var M;w={};for(M in v)w[M]=v[M]instanceof Array?v[M].slice(0):v[M]}if(!(k&&k.length&&k.filter(function(a){return a.values.length}).length))return a.utils.noData(b,x),b;x.selectAll(".nv-noData").remove(),c=e.xScale(),d=e.yScale();var N=x.selectAll("g.nv-wrap.nv-stackedAreaChart").data([k]),O=N.enter().append("g").attr("class","nvd3 nv-wrap nv-stackedAreaChart").append("g"),P=N.select("g");if(O.append("rect").style("opacity",0),O.append("g").attr("class","nv-x nv-axis"),O.append("g").attr("class","nv-y nv-axis"),O.append("g").attr("class","nv-stackedWrap"),O.append("g").attr("class","nv-legendWrap"),O.append("g").attr("class","nv-controlsWrap"),O.append("g").attr("class","nv-interactive"),P.select("rect").attr("width",K).attr("height",L),q){var Q=p?K-z:K;h.width(Q),P.select(".nv-legendWrap").datum(k).call(h),l.top!=h.height()&&(l.top=h.height(),L=a.utils.availableHeight(n,x,l)),P.select(".nv-legendWrap").attr("transform","translate("+(K-Q)+","+-l.top+")")}if(p){var R=[{key:B.stacked||"Stacked",metaKey:"Stacked",disabled:"stack"!=e.style(),style:"stack"},{key:B.stream||"Stream",metaKey:"Stream",disabled:"stream"!=e.style(),style:"stream"},{key:B.expanded||"Expanded",metaKey:"Expanded",disabled:"expand"!=e.style(),style:"expand"},{key:B.stack_percent||"Stack %",metaKey:"Stack_Percent",disabled:"stack_percent"!=e.style(),style:"stack_percent"}];z=A.length/3*260,R=R.filter(function(a){return-1!==A.indexOf(a.metaKey)}),i.width(z).color(["#444","#444","#444"]),P.select(".nv-controlsWrap").datum(R).call(i),l.top!=Math.max(i.height(),h.height())&&(l.top=Math.max(i.height(),h.height()),L=a.utils.availableHeight(n,x,l)),P.select(".nv-controlsWrap").attr("transform","translate(0,"+-l.top+")")}N.attr("transform","translate("+l.left+","+l.top+")"),t&&P.select(".nv-y.nv-axis").attr("transform","translate("+K+",0)"),u&&(j.width(K).height(L).margin({left:l.left,top:l.top}).svgContainer(x).xScale(c),N.select(".nv-interactive").call(j)),e.width(K).height(L);var S=P.select(".nv-stackedWrap").datum(k);if(S.transition().call(e),r&&(f.scale(c)._ticks(a.utils.calcTicksX(K/100,k)).tickSize(-L,0),P.select(".nv-x.nv-axis").attr("transform","translate(0,"+L+")"),P.select(".nv-x.nv-axis").transition().duration(0).call(f)),s){var T;if(T="wiggle"===e.offset()?0:a.utils.calcTicksY(L/36,k),g.scale(d)._ticks(T).tickSize(-K,0),"expand"===e.style()||"stack_percent"===e.style()){var U=g.tickFormat();D&&U===J||(D=U),g.tickFormat(J)}else D&&(g.tickFormat(D),D=null);P.select(".nv-y.nv-axis").transition().duration(0).call(g)}e.dispatch.on("areaClick.toggle",function(a){k.forEach(1===k.filter(function(a){return!a.disabled}).length?function(a){a.disabled=!1}:function(b,c){b.disabled=c!=a.seriesIndex}),v.disabled=k.map(function(a){return!!a.disabled}),y.stateChange(v),b.update()}),h.dispatch.on("stateChange",function(a){for(var c in a)v[c]=a[c];y.stateChange(v),b.update()}),i.dispatch.on("legendClick",function(a){a.disabled&&(R=R.map(function(a){return a.disabled=!0,a}),a.disabled=!1,e.style(a.style),v.style=e.style(),y.stateChange(v),b.update())}),j.dispatch.on("elementMousemove",function(c){e.clearHighlights();var d,g,h,i=[];if(k.filter(function(a,b){return a.seriesIndex=b,!a.disabled}).forEach(function(f,j){g=a.interactiveBisect(f.values,c.pointXValue,b.x());var k=f.values[g],l=b.y()(k,g);if(null!=l&&e.highlightPoint(j,g,!0),"undefined"!=typeof k){"undefined"==typeof d&&(d=k),"undefined"==typeof h&&(h=b.xScale()(b.x()(k,g)));var m="expand"==e.style()?k.display.y:b.y()(k,g);i.push({key:f.key,value:m,color:o(f,f.seriesIndex),stackedValue:k.display})}}),i.reverse(),i.length>2){var m=b.yScale().invert(c.mouseY),n=null;i.forEach(function(a,b){m=Math.abs(m);var c=Math.abs(a.stackedValue.y0),d=Math.abs(a.stackedValue.y);return m>=c&&d+c>=m?void(n=b):void 0}),null!=n&&(i[n].highlight=!0)}var p=f.tickFormat()(b.x()(d,g)),q=j.tooltip.valueFormatter();"expand"===e.style()||"stack_percent"===e.style()?(E||(E=q),q=d3.format(".1%")):E&&(q=E,E=null),j.tooltip.position({left:h+l.left,top:c.mouseY+l.top}).chartContainer(F.parentNode).valueFormatter(q).data({value:p,series:i})(),j.renderGuideLine(h)}),j.dispatch.on("elementMouseout",function(){e.clearHighlights()}),y.on("changeState",function(a){"undefined"!=typeof a.disabled&&k.length===a.disabled.length&&(k.forEach(function(b,c){b.disabled=a.disabled[c]}),v.disabled=a.disabled),"undefined"!=typeof a.style&&(e.style(a.style),G=a.style),b.update()})}),F.renderEnd("stacked Area chart immediate"),b}var c,d,e=a.models.stackedArea(),f=a.models.axis(),g=a.models.axis(),h=a.models.legend(),i=a.models.legend(),j=a.interactiveGuideline(),k=a.models.tooltip(),l={top:30,right:25,bottom:50,left:60},m=null,n=null,o=a.utils.defaultColor(),p=!0,q=!0,r=!0,s=!0,t=!1,u=!1,v=a.utils.state(),w=null,x=null,y=d3.dispatch("stateChange","changeState","renderEnd"),z=250,A=["Stacked","Stream","Expanded"],B={},C=250;v.style=e.style(),f.orient("bottom").tickPadding(7),g.orient(t?"right":"left"),k.headerFormatter(function(a,b){return f.tickFormat()(a,b)}).valueFormatter(function(a,b){return g.tickFormat()(a,b)}),j.tooltip.headerFormatter(function(a,b){return f.tickFormat()(a,b)}).valueFormatter(function(a,b){return g.tickFormat()(a,b)});var D=null,E=null;i.updateState(!1);var F=a.utils.renderWatch(y),G=e.style(),H=function(a){return function(){return{active:a.map(function(a){return!a.disabled}),style:e.style()}}},I=function(a){return function(b){void 0!==b.style&&(G=b.style),void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}},J=d3.format("%");return e.dispatch.on("elementMouseover.tooltip",function(a){a.point.x=e.x()(a.point),a.point.y=e.y()(a.point),k.data(a).position(a.pos).hidden(!1)}),e.dispatch.on("elementMouseout.tooltip",function(){k.hidden(!0)}),b.dispatch=y,b.stacked=e,b.legend=h,b.controls=i,b.xAxis=f,b.yAxis=g,b.interactiveLayer=j,b.tooltip=k,b.dispatch=y,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return m},set:function(a){m=a}},height:{get:function(){return n},set:function(a){n=a}},showLegend:{get:function(){return q},set:function(a){q=a}},showXAxis:{get:function(){return r},set:function(a){r=a}},showYAxis:{get:function(){return s},set:function(a){s=a}},defaultState:{get:function(){return w},set:function(a){w=a}},noData:{get:function(){return x},set:function(a){x=a}},showControls:{get:function(){return p},set:function(a){p=a}},controlLabels:{get:function(){return B},set:function(a){B=a}},controlOptions:{get:function(){return A},set:function(a){A=a}},tooltips:{get:function(){return k.enabled()},set:function(b){a.deprecated("tooltips","use chart.tooltip.enabled() instead"),k.enabled(!!b)}},tooltipContent:{get:function(){return k.contentGenerator()},set:function(b){a.deprecated("tooltipContent","use chart.tooltip.contentGenerator() instead"),k.contentGenerator(b)}},margin:{get:function(){return l},set:function(a){l.top=void 0!==a.top?a.top:l.top,l.right=void 0!==a.right?a.right:l.right,l.bottom=void 0!==a.bottom?a.bottom:l.bottom,l.left=void 0!==a.left?a.left:l.left}},duration:{get:function(){return C},set:function(a){C=a,F.reset(C),e.duration(C),f.duration(C),g.duration(C)}},color:{get:function(){return o},set:function(b){o=a.utils.getColor(b),h.color(o),e.color(o)}},rightAlignYAxis:{get:function(){return t},set:function(a){t=a,g.orient(t?"right":"left")}},useInteractiveGuideline:{get:function(){return u},set:function(a){u=!!a,b.interactive(!a),b.useVoronoi(!a),e.scatter.interactive(!a)}}}),a.utils.inheritOptions(b,e),a.utils.initOptions(b),b},a.models.sunburst=function(){"use strict";function b(u){return t.reset(),u.each(function(b){function t(a){a.x0=a.x,a.dx0=a.dx}function u(a){var b=d3.interpolate(p.domain(),[a.x,a.x+a.dx]),c=d3.interpolate(q.domain(),[a.y,1]),d=d3.interpolate(q.range(),[a.y?20:0,y]);return function(a,e){return e?function(){return s(a)}:function(e){return p.domain(b(e)),q.domain(c(e)).range(d(e)),s(a)}}}l=d3.select(this);var v,w=a.utils.availableWidth(g,l,f),x=a.utils.availableHeight(h,l,f),y=Math.min(w,x)/2;a.utils.initSVG(l);var z=l.selectAll(".nv-wrap.nv-sunburst").data(b),A=z.enter().append("g").attr("class","nvd3 nv-wrap nv-sunburst nv-chart-"+k),B=A.selectAll("nv-sunburst");z.attr("transform","translate("+w/2+","+x/2+")"),l.on("click",function(a,b){o.chartClick({data:a,index:b,pos:d3.event,id:k})}),q.range([0,y]),c=c||b,e=b[0],r.value(j[i]||j.count),v=B.data(r.nodes).enter().append("path").attr("d",s).style("fill",function(a){return m((a.children?a:a.parent).name)}).style("stroke","#FFF").on("click",function(a){d!==c&&c!==a&&(d=c),c=a,v.transition().duration(n).attrTween("d",u(a))}).each(t).on("dblclick",function(a){d.parent==a&&v.transition().duration(n).attrTween("d",u(e))}).each(t).on("mouseover",function(a){d3.select(this).classed("hover",!0).style("opacity",.8),o.elementMouseover({data:a,color:d3.select(this).style("fill")})}).on("mouseout",function(a){d3.select(this).classed("hover",!1).style("opacity",1),o.elementMouseout({data:a})}).on("mousemove",function(a){o.elementMousemove({data:a})})}),t.renderEnd("sunburst immediate"),b}var c,d,e,f={top:0,right:0,bottom:0,left:0},g=null,h=null,i="count",j={count:function(){return 1},size:function(a){return a.size}},k=Math.floor(1e4*Math.random()),l=null,m=a.utils.defaultColor(),n=500,o=d3.dispatch("chartClick","elementClick","elementDblClick","elementMousemove","elementMouseover","elementMouseout","renderEnd"),p=d3.scale.linear().range([0,2*Math.PI]),q=d3.scale.sqrt(),r=d3.layout.partition().sort(null).value(function(){return 1}),s=d3.svg.arc().startAngle(function(a){return Math.max(0,Math.min(2*Math.PI,p(a.x)))}).endAngle(function(a){return Math.max(0,Math.min(2*Math.PI,p(a.x+a.dx)))}).innerRadius(function(a){return Math.max(0,q(a.y))}).outerRadius(function(a){return Math.max(0,q(a.y+a.dy))}),t=a.utils.renderWatch(o);return b.dispatch=o,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return g},set:function(a){g=a}},height:{get:function(){return h},set:function(a){h=a}},mode:{get:function(){return i},set:function(a){i=a}},id:{get:function(){return k},set:function(a){k=a}},duration:{get:function(){return n},set:function(a){n=a}},margin:{get:function(){return f},set:function(a){f.top=void 0!=a.top?a.top:f.top,f.right=void 0!=a.right?a.right:f.right,f.bottom=void 0!=a.bottom?a.bottom:f.bottom,f.left=void 0!=a.left?a.left:f.left}},color:{get:function(){return m},set:function(b){m=a.utils.getColor(b)}}}),a.utils.initOptions(b),b},a.models.sunburstChart=function(){"use strict";function b(d){return m.reset(),m.models(c),d.each(function(d){var h=d3.select(this);a.utils.initSVG(h);var i=a.utils.availableWidth(f,h,e),j=a.utils.availableHeight(g,h,e);if(b.update=function(){0===k?h.call(b):h.transition().duration(k).call(b)},b.container=this,!d||!d.length)return a.utils.noData(b,h),b;h.selectAll(".nv-noData").remove();var l=h.selectAll("g.nv-wrap.nv-sunburstChart").data(d),m=l.enter().append("g").attr("class","nvd3 nv-wrap nv-sunburstChart").append("g"),n=l.select("g");m.append("g").attr("class","nv-sunburstWrap"),l.attr("transform","translate("+e.left+","+e.top+")"),c.width(i).height(j);var o=n.select(".nv-sunburstWrap").datum(d);d3.transition(o).call(c)}),m.renderEnd("sunburstChart immediate"),b}var c=a.models.sunburst(),d=a.models.tooltip(),e={top:30,right:20,bottom:20,left:20},f=null,g=null,h=a.utils.defaultColor(),i=(Math.round(1e5*Math.random()),null),j=null,k=250,l=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState","renderEnd"),m=a.utils.renderWatch(l);return d.headerEnabled(!1).duration(0).valueFormatter(function(a){return a}),c.dispatch.on("elementMouseover.tooltip",function(a){a.series={key:a.data.name,value:a.data.size,color:a.color},d.data(a).hidden(!1)}),c.dispatch.on("elementMouseout.tooltip",function(){d.hidden(!0)}),c.dispatch.on("elementMousemove.tooltip",function(){d.position({top:d3.event.pageY,left:d3.event.pageX})()}),b.dispatch=l,b.sunburst=c,b.tooltip=d,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{noData:{get:function(){return j},set:function(a){j=a}},defaultState:{get:function(){return i},set:function(a){i=a}},color:{get:function(){return h},set:function(a){h=a,c.color(h)}},duration:{get:function(){return k},set:function(a){k=a,m.reset(k),c.duration(k)}},margin:{get:function(){return e},set:function(a){e.top=void 0!==a.top?a.top:e.top,e.right=void 0!==a.right?a.right:e.right,e.bottom=void 0!==a.bottom?a.bottom:e.bottom,e.left=void 0!==a.left?a.left:e.left}}}),a.utils.inheritOptions(b,c),a.utils.initOptions(b),b},a.version="1.8.1"}(); \ No newline at end of file diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/js/popper.min.js b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/js/popper.min.js deleted file mode 100644 index 36c2aeb..0000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/js/popper.min.js +++ /dev/null @@ -1,5 +0,0 @@ -/* - Copyright (C) Federico Zivolo 2019 - Distributed under the MIT License (license terms are at http://opensource.org/licenses/MIT). - */(function(e,t){'object'==typeof exports&&'undefined'!=typeof module?module.exports=t():'function'==typeof define&&define.amd?define(t):e.Popper=t()})(this,function(){'use strict';function e(e){return e&&'[object Function]'==={}.toString.call(e)}function t(e,t){if(1!==e.nodeType)return[];var o=e.ownerDocument.defaultView,n=o.getComputedStyle(e,null);return t?n[t]:n}function o(e){return'HTML'===e.nodeName?e:e.parentNode||e.host}function n(e){if(!e)return document.body;switch(e.nodeName){case'HTML':case'BODY':return e.ownerDocument.body;case'#document':return e.body;}var i=t(e),r=i.overflow,p=i.overflowX,s=i.overflowY;return /(auto|scroll|overlay)/.test(r+s+p)?e:n(o(e))}function r(e){return 11===e?pe:10===e?se:pe||se}function p(e){if(!e)return document.documentElement;for(var o=r(10)?document.body:null,n=e.offsetParent||null;n===o&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var i=n&&n.nodeName;return i&&'BODY'!==i&&'HTML'!==i?-1!==['TH','TD','TABLE'].indexOf(n.nodeName)&&'static'===t(n,'position')?p(n):n:e?e.ownerDocument.documentElement:document.documentElement}function s(e){var t=e.nodeName;return'BODY'!==t&&('HTML'===t||p(e.firstElementChild)===e)}function d(e){return null===e.parentNode?e:d(e.parentNode)}function a(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return document.documentElement;var o=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,n=o?e:t,i=o?t:e,r=document.createRange();r.setStart(n,0),r.setEnd(i,0);var l=r.commonAncestorContainer;if(e!==l&&t!==l||n.contains(i))return s(l)?l:p(l);var f=d(e);return f.host?a(f.host,t):a(e,d(t).host)}function l(e){var t=1=o.clientWidth&&n>=o.clientHeight}),l=0a[e]&&!t.escapeWithReference&&(n=Q(f[o],a[e]-('right'===e?f.width:f.height))),le({},o,n)}};return l.forEach(function(e){var t=-1===['left','top'].indexOf(e)?'secondary':'primary';f=fe({},f,m[t](e))}),e.offsets.popper=f,e},priority:['left','right','top','bottom'],padding:5,boundariesElement:'scrollParent'},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,o=t.popper,n=t.reference,i=e.placement.split('-')[0],r=Z,p=-1!==['top','bottom'].indexOf(i),s=p?'right':'bottom',d=p?'left':'top',a=p?'width':'height';return o[s]r(n[s])&&(e.offsets.popper[d]=r(n[s])),e}},arrow:{order:500,enabled:!0,fn:function(e,o){var n;if(!K(e.instance.modifiers,'arrow','keepTogether'))return e;var i=o.element;if('string'==typeof i){if(i=e.instance.popper.querySelector(i),!i)return e;}else if(!e.instance.popper.contains(i))return console.warn('WARNING: `arrow.element` must be child of its popper element!'),e;var r=e.placement.split('-')[0],p=e.offsets,s=p.popper,d=p.reference,a=-1!==['left','right'].indexOf(r),l=a?'height':'width',f=a?'Top':'Left',m=f.toLowerCase(),h=a?'left':'top',c=a?'bottom':'right',u=S(i)[l];d[c]-us[c]&&(e.offsets.popper[m]+=d[m]+u-s[c]),e.offsets.popper=g(e.offsets.popper);var b=d[m]+d[l]/2-u/2,w=t(e.instance.popper),y=parseFloat(w['margin'+f],10),E=parseFloat(w['border'+f+'Width'],10),v=b-e.offsets.popper[m]-y-E;return v=ee(Q(s[l]-u,v),0),e.arrowElement=i,e.offsets.arrow=(n={},le(n,m,$(v)),le(n,h,''),n),e},element:'[x-arrow]'},flip:{order:600,enabled:!0,fn:function(e,t){if(W(e.instance.modifiers,'inner'))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var o=v(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),n=e.placement.split('-')[0],i=T(n),r=e.placement.split('-')[1]||'',p=[];switch(t.behavior){case ge.FLIP:p=[n,i];break;case ge.CLOCKWISE:p=G(n);break;case ge.COUNTERCLOCKWISE:p=G(n,!0);break;default:p=t.behavior;}return p.forEach(function(s,d){if(n!==s||p.length===d+1)return e;n=e.placement.split('-')[0],i=T(n);var a=e.offsets.popper,l=e.offsets.reference,f=Z,m='left'===n&&f(a.right)>f(l.left)||'right'===n&&f(a.left)f(l.top)||'bottom'===n&&f(a.top)f(o.right),g=f(a.top)f(o.bottom),b='left'===n&&h||'right'===n&&c||'top'===n&&g||'bottom'===n&&u,w=-1!==['top','bottom'].indexOf(n),y=!!t.flipVariations&&(w&&'start'===r&&h||w&&'end'===r&&c||!w&&'start'===r&&g||!w&&'end'===r&&u),E=!!t.flipVariationsByContent&&(w&&'start'===r&&c||w&&'end'===r&&h||!w&&'start'===r&&u||!w&&'end'===r&&g),v=y||E;(m||b||v)&&(e.flipped=!0,(m||b)&&(n=p[d+1]),v&&(r=z(r)),e.placement=n+(r?'-'+r:''),e.offsets.popper=fe({},e.offsets.popper,C(e.instance.popper,e.offsets.reference,e.placement)),e=P(e.instance.modifiers,e,'flip'))}),e},behavior:'flip',padding:5,boundariesElement:'viewport',flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,o=t.split('-')[0],n=e.offsets,i=n.popper,r=n.reference,p=-1!==['left','right'].indexOf(o),s=-1===['top','left'].indexOf(o);return i[p?'left':'top']=r[o]-(s?i[p?'width':'height']:0),e.placement=T(t),e.offsets.popper=g(i),e}},hide:{order:800,enabled:!0,fn:function(e){if(!K(e.instance.modifiers,'hide','preventOverflow'))return e;var t=e.offsets.reference,o=D(e.instance.modifiers,function(e){return'preventOverflow'===e.name}).boundaries;if(t.bottomo.right||t.top>o.bottom||t.rightwindow.devicePixelRatio||!me),c='bottom'===o?'top':'bottom',g='right'===n?'left':'right',b=B('transform');if(d='bottom'==c?'HTML'===l.nodeName?-l.clientHeight+h.bottom:-f.height+h.bottom:h.top,s='right'==g?'HTML'===l.nodeName?-l.clientWidth+h.right:-f.width+h.right:h.left,a&&b)m[b]='translate3d('+s+'px, '+d+'px, 0)',m[c]=0,m[g]=0,m.willChange='transform';else{var w='bottom'==c?-1:1,y='right'==g?-1:1;m[c]=d*w,m[g]=s*y,m.willChange=c+', '+g}var E={"x-placement":e.placement};return e.attributes=fe({},E,e.attributes),e.styles=fe({},m,e.styles),e.arrowStyles=fe({},e.offsets.arrow,e.arrowStyles),e},gpuAcceleration:!0,x:'bottom',y:'right'},applyStyle:{order:900,enabled:!0,fn:function(e){return V(e.instance.popper,e.styles),j(e.instance.popper,e.attributes),e.arrowElement&&Object.keys(e.arrowStyles).length&&V(e.arrowElement,e.arrowStyles),e},onLoad:function(e,t,o,n,i){var r=L(i,t,e,o.positionFixed),p=O(o.placement,r,t,e,o.modifiers.flip.boundariesElement,o.modifiers.flip.padding);return t.setAttribute('x-placement',p),V(t,{position:o.positionFixed?'fixed':'absolute'}),o},gpuAcceleration:void 0}}},ue}); -//# sourceMappingURL=popper.min.js.map diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/method_item.html.dist b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/method_item.html.dist deleted file mode 100644 index d8890ed..0000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/method_item.html.dist +++ /dev/null @@ -1,11 +0,0 @@ - - {{name}} - {{methods_bar}} -
{{methods_tested_percent}}
-
{{methods_number}}
- {{crap}} - {{lines_bar}} -
{{lines_executed_percent}}
-
{{lines_number}}
- - diff --git a/vendor/phpunit/php-code-coverage/src/Report/PHP.php b/vendor/phpunit/php-code-coverage/src/Report/PHP.php deleted file mode 100644 index 73e2f4d..0000000 --- a/vendor/phpunit/php-code-coverage/src/Report/PHP.php +++ /dev/null @@ -1,64 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Report; - -use SebastianBergmann\CodeCoverage\CodeCoverage; -use SebastianBergmann\CodeCoverage\RuntimeException; - -/** - * Uses var_export() to write a SebastianBergmann\CodeCoverage\CodeCoverage object to a file. - */ -final class PHP -{ - /** - * @throws \SebastianBergmann\CodeCoverage\RuntimeException - */ - public function process(CodeCoverage $coverage, ?string $target = null): string - { - $filter = $coverage->filter(); - - $buffer = \sprintf( - 'setData(%s); -$coverage->setTests(%s); - -$filter = $coverage->filter(); -$filter->setWhitelistedFiles(%s); - -return $coverage;', - \var_export($coverage->getData(true), true), - \var_export($coverage->getTests(), true), - \var_export($filter->getWhitelistedFiles(), true) - ); - - if ($target !== null) { - if (!$this->createDirectory(\dirname($target))) { - throw new \RuntimeException(\sprintf('Directory "%s" was not created', \dirname($target))); - } - - if (@\file_put_contents($target, $buffer) === false) { - throw new RuntimeException( - \sprintf( - 'Could not write to "%s', - $target - ) - ); - } - } - - return $buffer; - } - - private function createDirectory(string $directory): bool - { - return !(!\is_dir($directory) && !@\mkdir($directory, 0777, true) && !\is_dir($directory)); - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Text.php b/vendor/phpunit/php-code-coverage/src/Report/Text.php deleted file mode 100644 index 9593a22..0000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Text.php +++ /dev/null @@ -1,283 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Report; - -use SebastianBergmann\CodeCoverage\CodeCoverage; -use SebastianBergmann\CodeCoverage\Node\File; -use SebastianBergmann\CodeCoverage\Util; - -/** - * Generates human readable output from a code coverage object. - * - * The output gets put into a text file our written to the CLI. - */ -final class Text -{ - /** - * @var string - */ - private const COLOR_GREEN = "\x1b[30;42m"; - - /** - * @var string - */ - private const COLOR_YELLOW = "\x1b[30;43m"; - - /** - * @var string - */ - private const COLOR_RED = "\x1b[37;41m"; - - /** - * @var string - */ - private const COLOR_HEADER = "\x1b[1;37;40m"; - - /** - * @var string - */ - private const COLOR_RESET = "\x1b[0m"; - - /** - * @var string - */ - private const COLOR_EOL = "\x1b[2K"; - - /** - * @var int - */ - private $lowUpperBound; - - /** - * @var int - */ - private $highLowerBound; - - /** - * @var bool - */ - private $showUncoveredFiles; - - /** - * @var bool - */ - private $showOnlySummary; - - public function __construct(int $lowUpperBound = 50, int $highLowerBound = 90, bool $showUncoveredFiles = false, bool $showOnlySummary = false) - { - $this->lowUpperBound = $lowUpperBound; - $this->highLowerBound = $highLowerBound; - $this->showUncoveredFiles = $showUncoveredFiles; - $this->showOnlySummary = $showOnlySummary; - } - - public function process(CodeCoverage $coverage, bool $showColors = false): string - { - $output = \PHP_EOL . \PHP_EOL; - $report = $coverage->getReport(); - - $colors = [ - 'header' => '', - 'classes' => '', - 'methods' => '', - 'lines' => '', - 'reset' => '', - 'eol' => '', - ]; - - if ($showColors) { - $colors['classes'] = $this->getCoverageColor( - $report->getNumTestedClassesAndTraits(), - $report->getNumClassesAndTraits() - ); - - $colors['methods'] = $this->getCoverageColor( - $report->getNumTestedMethods(), - $report->getNumMethods() - ); - - $colors['lines'] = $this->getCoverageColor( - $report->getNumExecutedLines(), - $report->getNumExecutableLines() - ); - - $colors['reset'] = self::COLOR_RESET; - $colors['header'] = self::COLOR_HEADER; - $colors['eol'] = self::COLOR_EOL; - } - - $classes = \sprintf( - ' Classes: %6s (%d/%d)', - Util::percent( - $report->getNumTestedClassesAndTraits(), - $report->getNumClassesAndTraits(), - true - ), - $report->getNumTestedClassesAndTraits(), - $report->getNumClassesAndTraits() - ); - - $methods = \sprintf( - ' Methods: %6s (%d/%d)', - Util::percent( - $report->getNumTestedMethods(), - $report->getNumMethods(), - true - ), - $report->getNumTestedMethods(), - $report->getNumMethods() - ); - - $lines = \sprintf( - ' Lines: %6s (%d/%d)', - Util::percent( - $report->getNumExecutedLines(), - $report->getNumExecutableLines(), - true - ), - $report->getNumExecutedLines(), - $report->getNumExecutableLines() - ); - - $padding = \max(\array_map('strlen', [$classes, $methods, $lines])); - - if ($this->showOnlySummary) { - $title = 'Code Coverage Report Summary:'; - $padding = \max($padding, \strlen($title)); - - $output .= $this->format($colors['header'], $padding, $title); - } else { - $date = \date(' Y-m-d H:i:s', $_SERVER['REQUEST_TIME']); - $title = 'Code Coverage Report:'; - - $output .= $this->format($colors['header'], $padding, $title); - $output .= $this->format($colors['header'], $padding, $date); - $output .= $this->format($colors['header'], $padding, ''); - $output .= $this->format($colors['header'], $padding, ' Summary:'); - } - - $output .= $this->format($colors['classes'], $padding, $classes); - $output .= $this->format($colors['methods'], $padding, $methods); - $output .= $this->format($colors['lines'], $padding, $lines); - - if ($this->showOnlySummary) { - return $output . \PHP_EOL; - } - - $classCoverage = []; - - foreach ($report as $item) { - if (!$item instanceof File) { - continue; - } - - $classes = $item->getClassesAndTraits(); - - foreach ($classes as $className => $class) { - $classStatements = 0; - $coveredClassStatements = 0; - $coveredMethods = 0; - $classMethods = 0; - - foreach ($class['methods'] as $method) { - if ($method['executableLines'] == 0) { - continue; - } - - $classMethods++; - $classStatements += $method['executableLines']; - $coveredClassStatements += $method['executedLines']; - - if ($method['coverage'] == 100) { - $coveredMethods++; - } - } - - $namespace = ''; - - if (!empty($class['package']['namespace'])) { - $namespace = '\\' . $class['package']['namespace'] . '::'; - } elseif (!empty($class['package']['fullPackage'])) { - $namespace = '@' . $class['package']['fullPackage'] . '::'; - } - - $classCoverage[$namespace . $className] = [ - 'namespace' => $namespace, - 'className ' => $className, - 'methodsCovered' => $coveredMethods, - 'methodCount' => $classMethods, - 'statementsCovered' => $coveredClassStatements, - 'statementCount' => $classStatements, - ]; - } - } - - \ksort($classCoverage); - - $methodColor = ''; - $linesColor = ''; - $resetColor = ''; - - foreach ($classCoverage as $fullQualifiedPath => $classInfo) { - if ($this->showUncoveredFiles || $classInfo['statementsCovered'] != 0) { - if ($showColors) { - $methodColor = $this->getCoverageColor($classInfo['methodsCovered'], $classInfo['methodCount']); - $linesColor = $this->getCoverageColor($classInfo['statementsCovered'], $classInfo['statementCount']); - $resetColor = $colors['reset']; - } - - $output .= \PHP_EOL . $fullQualifiedPath . \PHP_EOL - . ' ' . $methodColor . 'Methods: ' . $this->printCoverageCounts($classInfo['methodsCovered'], $classInfo['methodCount'], 2) . $resetColor . ' ' - . ' ' . $linesColor . 'Lines: ' . $this->printCoverageCounts($classInfo['statementsCovered'], $classInfo['statementCount'], 3) . $resetColor; - } - } - - return $output . \PHP_EOL; - } - - private function getCoverageColor(int $numberOfCoveredElements, int $totalNumberOfElements): string - { - $coverage = Util::percent( - $numberOfCoveredElements, - $totalNumberOfElements - ); - - if ($coverage >= $this->highLowerBound) { - return self::COLOR_GREEN; - } - - if ($coverage > $this->lowUpperBound) { - return self::COLOR_YELLOW; - } - - return self::COLOR_RED; - } - - private function printCoverageCounts(int $numberOfCoveredElements, int $totalNumberOfElements, int $precision): string - { - $format = '%' . $precision . 's'; - - return Util::percent( - $numberOfCoveredElements, - $totalNumberOfElements, - true, - true - ) . - ' (' . \sprintf($format, $numberOfCoveredElements) . '/' . - \sprintf($format, $totalNumberOfElements) . ')'; - } - - private function format($color, $padding, $string): string - { - $reset = $color ? self::COLOR_RESET : ''; - - return $color . \str_pad($string, $padding) . $reset . \PHP_EOL; - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Xml/BuildInformation.php b/vendor/phpunit/php-code-coverage/src/Report/Xml/BuildInformation.php deleted file mode 100644 index c12a5d2..0000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Xml/BuildInformation.php +++ /dev/null @@ -1,81 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Report\Xml; - -use SebastianBergmann\Environment\Runtime; - -final class BuildInformation -{ - /** - * @var \DOMElement - */ - private $contextNode; - - public function __construct(\DOMElement $contextNode) - { - $this->contextNode = $contextNode; - } - - public function setRuntimeInformation(Runtime $runtime): void - { - $runtimeNode = $this->getNodeByName('runtime'); - - $runtimeNode->setAttribute('name', $runtime->getName()); - $runtimeNode->setAttribute('version', $runtime->getVersion()); - $runtimeNode->setAttribute('url', $runtime->getVendorUrl()); - - $driverNode = $this->getNodeByName('driver'); - - if ($runtime->hasPHPDBGCodeCoverage()) { - $driverNode->setAttribute('name', 'phpdbg'); - $driverNode->setAttribute('version', \constant('PHPDBG_VERSION')); - } - - if ($runtime->hasXdebug()) { - $driverNode->setAttribute('name', 'xdebug'); - $driverNode->setAttribute('version', \phpversion('xdebug')); - } - - if ($runtime->hasPCOV()) { - $driverNode->setAttribute('name', 'pcov'); - $driverNode->setAttribute('version', \phpversion('pcov')); - } - } - - public function setBuildTime(\DateTime $date): void - { - $this->contextNode->setAttribute('time', $date->format('D M j G:i:s T Y')); - } - - public function setGeneratorVersions(string $phpUnitVersion, string $coverageVersion): void - { - $this->contextNode->setAttribute('phpunit', $phpUnitVersion); - $this->contextNode->setAttribute('coverage', $coverageVersion); - } - - private function getNodeByName(string $name): \DOMElement - { - $node = $this->contextNode->getElementsByTagNameNS( - 'https://schema.phpunit.de/coverage/1.0', - $name - )->item(0); - - if (!$node) { - $node = $this->contextNode->appendChild( - $this->contextNode->ownerDocument->createElementNS( - 'https://schema.phpunit.de/coverage/1.0', - $name - ) - ); - } - - return $node; - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Xml/Coverage.php b/vendor/phpunit/php-code-coverage/src/Report/Xml/Coverage.php deleted file mode 100644 index 996a619..0000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Xml/Coverage.php +++ /dev/null @@ -1,69 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Report\Xml; - -use SebastianBergmann\CodeCoverage\RuntimeException; - -final class Coverage -{ - /** - * @var \XMLWriter - */ - private $writer; - - /** - * @var \DOMElement - */ - private $contextNode; - - /** - * @var bool - */ - private $finalized = false; - - public function __construct(\DOMElement $context, string $line) - { - $this->contextNode = $context; - - $this->writer = new \XMLWriter(); - $this->writer->openMemory(); - $this->writer->startElementNS(null, $context->nodeName, 'https://schema.phpunit.de/coverage/1.0'); - $this->writer->writeAttribute('nr', $line); - } - - /** - * @throws RuntimeException - */ - public function addTest(string $test): void - { - if ($this->finalized) { - throw new RuntimeException('Coverage Report already finalized'); - } - - $this->writer->startElement('covered'); - $this->writer->writeAttribute('by', $test); - $this->writer->endElement(); - } - - public function finalize(): void - { - $this->writer->endElement(); - - $fragment = $this->contextNode->ownerDocument->createDocumentFragment(); - $fragment->appendXML($this->writer->outputMemory()); - - $this->contextNode->parentNode->replaceChild( - $fragment, - $this->contextNode - ); - - $this->finalized = true; - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Xml/Directory.php b/vendor/phpunit/php-code-coverage/src/Report/Xml/Directory.php deleted file mode 100644 index b182321..0000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Xml/Directory.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Report\Xml; - -final class Directory extends Node -{ -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Xml/Facade.php b/vendor/phpunit/php-code-coverage/src/Report/Xml/Facade.php deleted file mode 100644 index c908a15..0000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Xml/Facade.php +++ /dev/null @@ -1,287 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Report\Xml; - -use SebastianBergmann\CodeCoverage\CodeCoverage; -use SebastianBergmann\CodeCoverage\Node\AbstractNode; -use SebastianBergmann\CodeCoverage\Node\Directory as DirectoryNode; -use SebastianBergmann\CodeCoverage\Node\File as FileNode; -use SebastianBergmann\CodeCoverage\RuntimeException; -use SebastianBergmann\CodeCoverage\Version; -use SebastianBergmann\Environment\Runtime; - -final class Facade -{ - /** - * @var string - */ - private $target; - - /** - * @var Project - */ - private $project; - - /** - * @var string - */ - private $phpUnitVersion; - - public function __construct(string $version) - { - $this->phpUnitVersion = $version; - } - - /** - * @throws RuntimeException - */ - public function process(CodeCoverage $coverage, string $target): void - { - if (\substr($target, -1, 1) !== \DIRECTORY_SEPARATOR) { - $target .= \DIRECTORY_SEPARATOR; - } - - $this->target = $target; - $this->initTargetDirectory($target); - - $report = $coverage->getReport(); - - $this->project = new Project( - $coverage->getReport()->getName() - ); - - $this->setBuildInformation(); - $this->processTests($coverage->getTests()); - $this->processDirectory($report, $this->project); - - $this->saveDocument($this->project->asDom(), 'index'); - } - - private function setBuildInformation(): void - { - $buildNode = $this->project->getBuildInformation(); - $buildNode->setRuntimeInformation(new Runtime()); - $buildNode->setBuildTime(\DateTime::createFromFormat('U', (string) $_SERVER['REQUEST_TIME'])); - $buildNode->setGeneratorVersions($this->phpUnitVersion, Version::id()); - } - - /** - * @throws RuntimeException - */ - private function initTargetDirectory(string $directory): void - { - if (\file_exists($directory)) { - if (!\is_dir($directory)) { - throw new RuntimeException( - "'$directory' exists but is not a directory." - ); - } - - if (!\is_writable($directory)) { - throw new RuntimeException( - "'$directory' exists but is not writable." - ); - } - } elseif (!$this->createDirectory($directory)) { - throw new RuntimeException( - "'$directory' could not be created." - ); - } - } - - private function processDirectory(DirectoryNode $directory, Node $context): void - { - $directoryName = $directory->getName(); - - if ($this->project->getProjectSourceDirectory() === $directoryName) { - $directoryName = '/'; - } - - $directoryObject = $context->addDirectory($directoryName); - - $this->setTotals($directory, $directoryObject->getTotals()); - - foreach ($directory->getDirectories() as $node) { - $this->processDirectory($node, $directoryObject); - } - - foreach ($directory->getFiles() as $node) { - $this->processFile($node, $directoryObject); - } - } - - /** - * @throws RuntimeException - */ - private function processFile(FileNode $file, Directory $context): void - { - $fileObject = $context->addFile( - $file->getName(), - $file->getId() . '.xml' - ); - - $this->setTotals($file, $fileObject->getTotals()); - - $path = \substr( - $file->getPath(), - \strlen($this->project->getProjectSourceDirectory()) - ); - - $fileReport = new Report($path); - - $this->setTotals($file, $fileReport->getTotals()); - - foreach ($file->getClassesAndTraits() as $unit) { - $this->processUnit($unit, $fileReport); - } - - foreach ($file->getFunctions() as $function) { - $this->processFunction($function, $fileReport); - } - - foreach ($file->getCoverageData() as $line => $tests) { - if (!\is_array($tests) || \count($tests) === 0) { - continue; - } - - $coverage = $fileReport->getLineCoverage((string) $line); - - foreach ($tests as $test) { - $coverage->addTest($test); - } - - $coverage->finalize(); - } - - $fileReport->getSource()->setSourceCode( - \file_get_contents($file->getPath()) - ); - - $this->saveDocument($fileReport->asDom(), $file->getId()); - } - - private function processUnit(array $unit, Report $report): void - { - if (isset($unit['className'])) { - $unitObject = $report->getClassObject($unit['className']); - } else { - $unitObject = $report->getTraitObject($unit['traitName']); - } - - $unitObject->setLines( - $unit['startLine'], - $unit['executableLines'], - $unit['executedLines'] - ); - - $unitObject->setCrap((float) $unit['crap']); - - $unitObject->setPackage( - $unit['package']['fullPackage'], - $unit['package']['package'], - $unit['package']['subpackage'], - $unit['package']['category'] - ); - - $unitObject->setNamespace($unit['package']['namespace']); - - foreach ($unit['methods'] as $method) { - $methodObject = $unitObject->addMethod($method['methodName']); - $methodObject->setSignature($method['signature']); - $methodObject->setLines((string) $method['startLine'], (string) $method['endLine']); - $methodObject->setCrap($method['crap']); - $methodObject->setTotals( - (string) $method['executableLines'], - (string) $method['executedLines'], - (string) $method['coverage'] - ); - } - } - - private function processFunction(array $function, Report $report): void - { - $functionObject = $report->getFunctionObject($function['functionName']); - - $functionObject->setSignature($function['signature']); - $functionObject->setLines((string) $function['startLine']); - $functionObject->setCrap($function['crap']); - $functionObject->setTotals((string) $function['executableLines'], (string) $function['executedLines'], (string) $function['coverage']); - } - - private function processTests(array $tests): void - { - $testsObject = $this->project->getTests(); - - foreach ($tests as $test => $result) { - if ($test === 'UNCOVERED_FILES_FROM_WHITELIST') { - continue; - } - - $testsObject->addTest($test, $result); - } - } - - private function setTotals(AbstractNode $node, Totals $totals): void - { - $loc = $node->getLinesOfCode(); - - $totals->setNumLines( - $loc['loc'], - $loc['cloc'], - $loc['ncloc'], - $node->getNumExecutableLines(), - $node->getNumExecutedLines() - ); - - $totals->setNumClasses( - $node->getNumClasses(), - $node->getNumTestedClasses() - ); - - $totals->setNumTraits( - $node->getNumTraits(), - $node->getNumTestedTraits() - ); - - $totals->setNumMethods( - $node->getNumMethods(), - $node->getNumTestedMethods() - ); - - $totals->setNumFunctions( - $node->getNumFunctions(), - $node->getNumTestedFunctions() - ); - } - - private function getTargetDirectory(): string - { - return $this->target; - } - - /** - * @throws RuntimeException - */ - private function saveDocument(\DOMDocument $document, string $name): void - { - $filename = \sprintf('%s/%s.xml', $this->getTargetDirectory(), $name); - - $document->formatOutput = true; - $document->preserveWhiteSpace = false; - $this->initTargetDirectory(\dirname($filename)); - - $document->save($filename); - } - - private function createDirectory(string $directory): bool - { - return !(!\is_dir($directory) && !@\mkdir($directory, 0777, true) && !\is_dir($directory)); - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Xml/File.php b/vendor/phpunit/php-code-coverage/src/Report/Xml/File.php deleted file mode 100644 index 02af644..0000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Xml/File.php +++ /dev/null @@ -1,81 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Report\Xml; - -class File -{ - /** - * @var \DOMDocument - */ - private $dom; - - /** - * @var \DOMElement - */ - private $contextNode; - - public function __construct(\DOMElement $context) - { - $this->dom = $context->ownerDocument; - $this->contextNode = $context; - } - - public function getTotals(): Totals - { - $totalsContainer = $this->contextNode->firstChild; - - if (!$totalsContainer) { - $totalsContainer = $this->contextNode->appendChild( - $this->dom->createElementNS( - 'https://schema.phpunit.de/coverage/1.0', - 'totals' - ) - ); - } - - return new Totals($totalsContainer); - } - - public function getLineCoverage(string $line): Coverage - { - $coverage = $this->contextNode->getElementsByTagNameNS( - 'https://schema.phpunit.de/coverage/1.0', - 'coverage' - )->item(0); - - if (!$coverage) { - $coverage = $this->contextNode->appendChild( - $this->dom->createElementNS( - 'https://schema.phpunit.de/coverage/1.0', - 'coverage' - ) - ); - } - - $lineNode = $coverage->appendChild( - $this->dom->createElementNS( - 'https://schema.phpunit.de/coverage/1.0', - 'line' - ) - ); - - return new Coverage($lineNode, $line); - } - - protected function getContextNode(): \DOMElement - { - return $this->contextNode; - } - - protected function getDomDocument(): \DOMDocument - { - return $this->dom; - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Xml/Method.php b/vendor/phpunit/php-code-coverage/src/Report/Xml/Method.php deleted file mode 100644 index b6a7f16..0000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Xml/Method.php +++ /dev/null @@ -1,56 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Report\Xml; - -final class Method -{ - /** - * @var \DOMElement - */ - private $contextNode; - - public function __construct(\DOMElement $context, string $name) - { - $this->contextNode = $context; - - $this->setName($name); - } - - public function setSignature(string $signature): void - { - $this->contextNode->setAttribute('signature', $signature); - } - - public function setLines(string $start, ?string $end = null): void - { - $this->contextNode->setAttribute('start', $start); - - if ($end !== null) { - $this->contextNode->setAttribute('end', $end); - } - } - - public function setTotals(string $executable, string $executed, string $coverage): void - { - $this->contextNode->setAttribute('executable', $executable); - $this->contextNode->setAttribute('executed', $executed); - $this->contextNode->setAttribute('coverage', $coverage); - } - - public function setCrap(string $crap): void - { - $this->contextNode->setAttribute('crap', $crap); - } - - private function setName(string $name): void - { - $this->contextNode->setAttribute('name', $name); - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Xml/Node.php b/vendor/phpunit/php-code-coverage/src/Report/Xml/Node.php deleted file mode 100644 index d3ba223..0000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Xml/Node.php +++ /dev/null @@ -1,87 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Report\Xml; - -abstract class Node -{ - /** - * @var \DOMDocument - */ - private $dom; - - /** - * @var \DOMElement - */ - private $contextNode; - - public function __construct(\DOMElement $context) - { - $this->setContextNode($context); - } - - public function getDom(): \DOMDocument - { - return $this->dom; - } - - public function getTotals(): Totals - { - $totalsContainer = $this->getContextNode()->firstChild; - - if (!$totalsContainer) { - $totalsContainer = $this->getContextNode()->appendChild( - $this->dom->createElementNS( - 'https://schema.phpunit.de/coverage/1.0', - 'totals' - ) - ); - } - - return new Totals($totalsContainer); - } - - public function addDirectory(string $name): Directory - { - $dirNode = $this->getDom()->createElementNS( - 'https://schema.phpunit.de/coverage/1.0', - 'directory' - ); - - $dirNode->setAttribute('name', $name); - $this->getContextNode()->appendChild($dirNode); - - return new Directory($dirNode); - } - - public function addFile(string $name, string $href): File - { - $fileNode = $this->getDom()->createElementNS( - 'https://schema.phpunit.de/coverage/1.0', - 'file' - ); - - $fileNode->setAttribute('name', $name); - $fileNode->setAttribute('href', $href); - $this->getContextNode()->appendChild($fileNode); - - return new File($fileNode); - } - - protected function setContextNode(\DOMElement $context): void - { - $this->dom = $context->ownerDocument; - $this->contextNode = $context; - } - - protected function getContextNode(): \DOMElement - { - return $this->contextNode; - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Xml/Project.php b/vendor/phpunit/php-code-coverage/src/Report/Xml/Project.php deleted file mode 100644 index 5f32852..0000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Xml/Project.php +++ /dev/null @@ -1,85 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Report\Xml; - -final class Project extends Node -{ - public function __construct(string $directory) - { - $this->init(); - $this->setProjectSourceDirectory($directory); - } - - public function getProjectSourceDirectory(): string - { - return $this->getContextNode()->getAttribute('source'); - } - - public function getBuildInformation(): BuildInformation - { - $buildNode = $this->getDom()->getElementsByTagNameNS( - 'https://schema.phpunit.de/coverage/1.0', - 'build' - )->item(0); - - if (!$buildNode) { - $buildNode = $this->getDom()->documentElement->appendChild( - $this->getDom()->createElementNS( - 'https://schema.phpunit.de/coverage/1.0', - 'build' - ) - ); - } - - return new BuildInformation($buildNode); - } - - public function getTests(): Tests - { - $testsNode = $this->getContextNode()->getElementsByTagNameNS( - 'https://schema.phpunit.de/coverage/1.0', - 'tests' - )->item(0); - - if (!$testsNode) { - $testsNode = $this->getContextNode()->appendChild( - $this->getDom()->createElementNS( - 'https://schema.phpunit.de/coverage/1.0', - 'tests' - ) - ); - } - - return new Tests($testsNode); - } - - public function asDom(): \DOMDocument - { - return $this->getDom(); - } - - private function init(): void - { - $dom = new \DOMDocument; - $dom->loadXML(''); - - $this->setContextNode( - $dom->getElementsByTagNameNS( - 'https://schema.phpunit.de/coverage/1.0', - 'project' - )->item(0) - ); - } - - private function setProjectSourceDirectory(string $name): void - { - $this->getContextNode()->setAttribute('source', $name); - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Xml/Report.php b/vendor/phpunit/php-code-coverage/src/Report/Xml/Report.php deleted file mode 100644 index 6ec94c1..0000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Xml/Report.php +++ /dev/null @@ -1,92 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Report\Xml; - -final class Report extends File -{ - public function __construct(string $name) - { - $dom = new \DOMDocument(); - $dom->loadXML(''); - - $contextNode = $dom->getElementsByTagNameNS( - 'https://schema.phpunit.de/coverage/1.0', - 'file' - )->item(0); - - parent::__construct($contextNode); - - $this->setName($name); - } - - public function asDom(): \DOMDocument - { - return $this->getDomDocument(); - } - - public function getFunctionObject($name): Method - { - $node = $this->getContextNode()->appendChild( - $this->getDomDocument()->createElementNS( - 'https://schema.phpunit.de/coverage/1.0', - 'function' - ) - ); - - return new Method($node, $name); - } - - public function getClassObject($name): Unit - { - return $this->getUnitObject('class', $name); - } - - public function getTraitObject($name): Unit - { - return $this->getUnitObject('trait', $name); - } - - public function getSource(): Source - { - $source = $this->getContextNode()->getElementsByTagNameNS( - 'https://schema.phpunit.de/coverage/1.0', - 'source' - )->item(0); - - if (!$source) { - $source = $this->getContextNode()->appendChild( - $this->getDomDocument()->createElementNS( - 'https://schema.phpunit.de/coverage/1.0', - 'source' - ) - ); - } - - return new Source($source); - } - - private function setName($name): void - { - $this->getContextNode()->setAttribute('name', \basename($name)); - $this->getContextNode()->setAttribute('path', \dirname($name)); - } - - private function getUnitObject($tagName, $name): Unit - { - $node = $this->getContextNode()->appendChild( - $this->getDomDocument()->createElementNS( - 'https://schema.phpunit.de/coverage/1.0', - $tagName - ) - ); - - return new Unit($node, $name); - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Xml/Source.php b/vendor/phpunit/php-code-coverage/src/Report/Xml/Source.php deleted file mode 100644 index 67bf9cb..0000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Xml/Source.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Report\Xml; - -use TheSeer\Tokenizer\NamespaceUri; -use TheSeer\Tokenizer\Tokenizer; -use TheSeer\Tokenizer\XMLSerializer; - -final class Source -{ - /** @var \DOMElement */ - private $context; - - public function __construct(\DOMElement $context) - { - $this->context = $context; - } - - public function setSourceCode(string $source): void - { - $context = $this->context; - - $tokens = (new Tokenizer())->parse($source); - $srcDom = (new XMLSerializer(new NamespaceUri($context->namespaceURI)))->toDom($tokens); - - $context->parentNode->replaceChild( - $context->ownerDocument->importNode($srcDom->documentElement, true), - $context - ); - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Xml/Tests.php b/vendor/phpunit/php-code-coverage/src/Report/Xml/Tests.php deleted file mode 100644 index c1bcd25..0000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Xml/Tests.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Report\Xml; - -final class Tests -{ - private $contextNode; - - private $codeMap = [ - -1 => 'UNKNOWN', // PHPUnit_Runner_BaseTestRunner::STATUS_UNKNOWN - 0 => 'PASSED', // PHPUnit_Runner_BaseTestRunner::STATUS_PASSED - 1 => 'SKIPPED', // PHPUnit_Runner_BaseTestRunner::STATUS_SKIPPED - 2 => 'INCOMPLETE', // PHPUnit_Runner_BaseTestRunner::STATUS_INCOMPLETE - 3 => 'FAILURE', // PHPUnit_Runner_BaseTestRunner::STATUS_FAILURE - 4 => 'ERROR', // PHPUnit_Runner_BaseTestRunner::STATUS_ERROR - 5 => 'RISKY', // PHPUnit_Runner_BaseTestRunner::STATUS_RISKY - 6 => 'WARNING', // PHPUnit_Runner_BaseTestRunner::STATUS_WARNING - ]; - - public function __construct(\DOMElement $context) - { - $this->contextNode = $context; - } - - public function addTest(string $test, array $result): void - { - $node = $this->contextNode->appendChild( - $this->contextNode->ownerDocument->createElementNS( - 'https://schema.phpunit.de/coverage/1.0', - 'test' - ) - ); - - $node->setAttribute('name', $test); - $node->setAttribute('size', $result['size']); - $node->setAttribute('result', (string) $result['status']); - $node->setAttribute('status', $this->codeMap[(int) $result['status']]); - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Xml/Totals.php b/vendor/phpunit/php-code-coverage/src/Report/Xml/Totals.php deleted file mode 100644 index 019f348..0000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Xml/Totals.php +++ /dev/null @@ -1,140 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Report\Xml; - -use SebastianBergmann\CodeCoverage\Util; - -final class Totals -{ - /** - * @var \DOMNode - */ - private $container; - - /** - * @var \DOMElement - */ - private $linesNode; - - /** - * @var \DOMElement - */ - private $methodsNode; - - /** - * @var \DOMElement - */ - private $functionsNode; - - /** - * @var \DOMElement - */ - private $classesNode; - - /** - * @var \DOMElement - */ - private $traitsNode; - - public function __construct(\DOMElement $container) - { - $this->container = $container; - $dom = $container->ownerDocument; - - $this->linesNode = $dom->createElementNS( - 'https://schema.phpunit.de/coverage/1.0', - 'lines' - ); - - $this->methodsNode = $dom->createElementNS( - 'https://schema.phpunit.de/coverage/1.0', - 'methods' - ); - - $this->functionsNode = $dom->createElementNS( - 'https://schema.phpunit.de/coverage/1.0', - 'functions' - ); - - $this->classesNode = $dom->createElementNS( - 'https://schema.phpunit.de/coverage/1.0', - 'classes' - ); - - $this->traitsNode = $dom->createElementNS( - 'https://schema.phpunit.de/coverage/1.0', - 'traits' - ); - - $container->appendChild($this->linesNode); - $container->appendChild($this->methodsNode); - $container->appendChild($this->functionsNode); - $container->appendChild($this->classesNode); - $container->appendChild($this->traitsNode); - } - - public function getContainer(): \DOMNode - { - return $this->container; - } - - public function setNumLines(int $loc, int $cloc, int $ncloc, int $executable, int $executed): void - { - $this->linesNode->setAttribute('total', (string) $loc); - $this->linesNode->setAttribute('comments', (string) $cloc); - $this->linesNode->setAttribute('code', (string) $ncloc); - $this->linesNode->setAttribute('executable', (string) $executable); - $this->linesNode->setAttribute('executed', (string) $executed); - $this->linesNode->setAttribute( - 'percent', - $executable === 0 ? '0' : \sprintf('%01.2F', Util::percent($executed, $executable)) - ); - } - - public function setNumClasses(int $count, int $tested): void - { - $this->classesNode->setAttribute('count', (string) $count); - $this->classesNode->setAttribute('tested', (string) $tested); - $this->classesNode->setAttribute( - 'percent', - $count === 0 ? '0' : \sprintf('%01.2F', Util::percent($tested, $count)) - ); - } - - public function setNumTraits(int $count, int $tested): void - { - $this->traitsNode->setAttribute('count', (string) $count); - $this->traitsNode->setAttribute('tested', (string) $tested); - $this->traitsNode->setAttribute( - 'percent', - $count === 0 ? '0' : \sprintf('%01.2F', Util::percent($tested, $count)) - ); - } - - public function setNumMethods(int $count, int $tested): void - { - $this->methodsNode->setAttribute('count', (string) $count); - $this->methodsNode->setAttribute('tested', (string) $tested); - $this->methodsNode->setAttribute( - 'percent', - $count === 0 ? '0' : \sprintf('%01.2F', Util::percent($tested, $count)) - ); - } - - public function setNumFunctions(int $count, int $tested): void - { - $this->functionsNode->setAttribute('count', (string) $count); - $this->functionsNode->setAttribute('tested', (string) $tested); - $this->functionsNode->setAttribute( - 'percent', - $count === 0 ? '0' : \sprintf('%01.2F', Util::percent($tested, $count)) - ); - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Xml/Unit.php b/vendor/phpunit/php-code-coverage/src/Report/Xml/Unit.php deleted file mode 100644 index c235dfb..0000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Xml/Unit.php +++ /dev/null @@ -1,95 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Report\Xml; - -final class Unit -{ - /** - * @var \DOMElement - */ - private $contextNode; - - public function __construct(\DOMElement $context, string $name) - { - $this->contextNode = $context; - - $this->setName($name); - } - - public function setLines(int $start, int $executable, int $executed): void - { - $this->contextNode->setAttribute('start', (string) $start); - $this->contextNode->setAttribute('executable', (string) $executable); - $this->contextNode->setAttribute('executed', (string) $executed); - } - - public function setCrap(float $crap): void - { - $this->contextNode->setAttribute('crap', (string) $crap); - } - - public function setPackage(string $full, string $package, string $sub, string $category): void - { - $node = $this->contextNode->getElementsByTagNameNS( - 'https://schema.phpunit.de/coverage/1.0', - 'package' - )->item(0); - - if (!$node) { - $node = $this->contextNode->appendChild( - $this->contextNode->ownerDocument->createElementNS( - 'https://schema.phpunit.de/coverage/1.0', - 'package' - ) - ); - } - - $node->setAttribute('full', $full); - $node->setAttribute('name', $package); - $node->setAttribute('sub', $sub); - $node->setAttribute('category', $category); - } - - public function setNamespace(string $namespace): void - { - $node = $this->contextNode->getElementsByTagNameNS( - 'https://schema.phpunit.de/coverage/1.0', - 'namespace' - )->item(0); - - if (!$node) { - $node = $this->contextNode->appendChild( - $this->contextNode->ownerDocument->createElementNS( - 'https://schema.phpunit.de/coverage/1.0', - 'namespace' - ) - ); - } - - $node->setAttribute('name', $namespace); - } - - public function addMethod(string $name): Method - { - $node = $this->contextNode->appendChild( - $this->contextNode->ownerDocument->createElementNS( - 'https://schema.phpunit.de/coverage/1.0', - 'method' - ) - ); - - return new Method($node, $name); - } - - private function setName(string $name): void - { - $this->contextNode->setAttribute('name', $name); - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Util.php b/vendor/phpunit/php-code-coverage/src/Util.php deleted file mode 100644 index ee8894c..0000000 --- a/vendor/phpunit/php-code-coverage/src/Util.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage; - -/** - * Utility methods. - */ -final class Util -{ - /** - * @return float|int|string - */ - public static function percent(float $a, float $b, bool $asString = false, bool $fixedWidth = false) - { - if ($asString && $b == 0) { - return ''; - } - - $percent = 100; - - if ($b > 0) { - $percent = ($a / $b) * 100; - } - - if ($asString) { - $format = $fixedWidth ? '%6.2F%%' : '%01.2F%%'; - - return \sprintf($format, $percent); - } - - return $percent; - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Version.php b/vendor/phpunit/php-code-coverage/src/Version.php deleted file mode 100644 index 21547dd..0000000 --- a/vendor/phpunit/php-code-coverage/src/Version.php +++ /dev/null @@ -1,30 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage; - -use SebastianBergmann\Version as VersionId; - -final class Version -{ - /** - * @var string - */ - private static $version; - - public static function id(): string - { - if (self::$version === null) { - $version = new VersionId('7.0.15', \dirname(__DIR__)); - self::$version = $version->getVersion(); - } - - return self::$version; - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/TestCase.php b/vendor/phpunit/php-code-coverage/tests/TestCase.php deleted file mode 100644 index 6a9824e..0000000 --- a/vendor/phpunit/php-code-coverage/tests/TestCase.php +++ /dev/null @@ -1,395 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\CodeCoverage; - -use SebastianBergmann\CodeCoverage\Driver\Driver; -use SebastianBergmann\CodeCoverage\Report\Xml\Coverage; - -abstract class TestCase extends \PHPUnit\Framework\TestCase -{ - protected static $TEST_TMP_PATH; - - public static function setUpBeforeClass(): void - { - self::$TEST_TMP_PATH = TEST_FILES_PATH . 'tmp'; - } - - protected function getXdebugDataForBankAccount() - { - return [ - [ - TEST_FILES_PATH . 'BankAccount.php' => [ - 8 => 1, - 9 => -2, - 13 => -1, - 14 => -1, - 15 => -1, - 16 => -1, - 18 => -1, - 22 => -1, - 24 => -1, - 25 => -2, - 29 => -1, - 31 => -1, - 32 => -2 - ] - ], - [ - TEST_FILES_PATH . 'BankAccount.php' => [ - 8 => 1, - 13 => 1, - 16 => 1, - 29 => 1, - ] - ], - [ - TEST_FILES_PATH . 'BankAccount.php' => [ - 8 => 1, - 13 => 1, - 16 => 1, - 22 => 1, - ] - ], - [ - TEST_FILES_PATH . 'BankAccount.php' => [ - 8 => 1, - 13 => 1, - 14 => 1, - 15 => 1, - 18 => 1, - 22 => 1, - 24 => 1, - 29 => 1, - 31 => 1, - ] - ] - ]; - } - - protected function getCoverageForBankAccount(): CodeCoverage - { - $data = $this->getXdebugDataForBankAccount(); - - $stub = $this->createMock(Driver::class); - - $stub->expects($this->any()) - ->method('stop') - ->will($this->onConsecutiveCalls( - $data[0], - $data[1], - $data[2], - $data[3] - )); - - $filter = new Filter; - $filter->addFileToWhitelist(TEST_FILES_PATH . 'BankAccount.php'); - - $coverage = new CodeCoverage($stub, $filter); - - $coverage->start( - new \BankAccountTest('testBalanceIsInitiallyZero'), - true - ); - - $coverage->stop( - true, - [TEST_FILES_PATH . 'BankAccount.php' => range(6, 9)] - ); - - $coverage->start( - new \BankAccountTest('testBalanceCannotBecomeNegative') - ); - - $coverage->stop( - true, - [TEST_FILES_PATH . 'BankAccount.php' => range(27, 32)] - ); - - $coverage->start( - new \BankAccountTest('testBalanceCannotBecomeNegative2') - ); - - $coverage->stop( - true, - [TEST_FILES_PATH . 'BankAccount.php' => range(20, 25)] - ); - - $coverage->start( - new \BankAccountTest('testDepositWithdrawMoney') - ); - - $coverage->stop( - true, - [ - TEST_FILES_PATH . 'BankAccount.php' => array_merge( - range(6, 9), - range(20, 25), - range(27, 32) - ) - ] - ); - - return $coverage; - } - - protected function getCoverageForBankAccountForFirstTwoTests(): CodeCoverage - { - $data = $this->getXdebugDataForBankAccount(); - - $stub = $this->createMock(Driver::class); - - $stub->expects($this->any()) - ->method('stop') - ->will($this->onConsecutiveCalls( - $data[0], - $data[1] - )); - - $filter = new Filter; - $filter->addFileToWhitelist(TEST_FILES_PATH . 'BankAccount.php'); - - $coverage = new CodeCoverage($stub, $filter); - - $coverage->start( - new \BankAccountTest('testBalanceIsInitiallyZero'), - true - ); - - $coverage->stop( - true, - [TEST_FILES_PATH . 'BankAccount.php' => range(6, 9)] - ); - - $coverage->start( - new \BankAccountTest('testBalanceCannotBecomeNegative') - ); - - $coverage->stop( - true, - [TEST_FILES_PATH . 'BankAccount.php' => range(27, 32)] - ); - - return $coverage; - } - - protected function getCoverageForBankAccountForLastTwoTests() - { - $data = $this->getXdebugDataForBankAccount(); - - $stub = $this->createMock(Driver::class); - - $stub->expects($this->any()) - ->method('stop') - ->will($this->onConsecutiveCalls( - $data[2], - $data[3] - )); - - $filter = new Filter; - $filter->addFileToWhitelist(TEST_FILES_PATH . 'BankAccount.php'); - - $coverage = new CodeCoverage($stub, $filter); - - $coverage->start( - new \BankAccountTest('testBalanceCannotBecomeNegative2') - ); - - $coverage->stop( - true, - [TEST_FILES_PATH . 'BankAccount.php' => range(20, 25)] - ); - - $coverage->start( - new \BankAccountTest('testDepositWithdrawMoney') - ); - - $coverage->stop( - true, - [ - TEST_FILES_PATH . 'BankAccount.php' => array_merge( - range(6, 9), - range(20, 25), - range(27, 32) - ) - ] - ); - - return $coverage; - } - - protected function getExpectedDataArrayForBankAccount(): array - { - return [ - TEST_FILES_PATH . 'BankAccount.php' => [ - 8 => [ - 0 => 'BankAccountTest::testBalanceIsInitiallyZero', - 1 => 'BankAccountTest::testDepositWithdrawMoney' - ], - 9 => null, - 13 => [], - 14 => [], - 15 => [], - 16 => [], - 18 => [], - 22 => [ - 0 => 'BankAccountTest::testBalanceCannotBecomeNegative2', - 1 => 'BankAccountTest::testDepositWithdrawMoney' - ], - 24 => [ - 0 => 'BankAccountTest::testDepositWithdrawMoney', - ], - 25 => null, - 29 => [ - 0 => 'BankAccountTest::testBalanceCannotBecomeNegative', - 1 => 'BankAccountTest::testDepositWithdrawMoney' - ], - 31 => [ - 0 => 'BankAccountTest::testDepositWithdrawMoney' - ], - 32 => null - ] - ]; - } - - protected function getExpectedDataArrayForBankAccountInReverseOrder(): array - { - return [ - TEST_FILES_PATH . 'BankAccount.php' => [ - 8 => [ - 0 => 'BankAccountTest::testDepositWithdrawMoney', - 1 => 'BankAccountTest::testBalanceIsInitiallyZero' - ], - 9 => null, - 13 => [], - 14 => [], - 15 => [], - 16 => [], - 18 => [], - 22 => [ - 0 => 'BankAccountTest::testBalanceCannotBecomeNegative2', - 1 => 'BankAccountTest::testDepositWithdrawMoney' - ], - 24 => [ - 0 => 'BankAccountTest::testDepositWithdrawMoney', - ], - 25 => null, - 29 => [ - 0 => 'BankAccountTest::testDepositWithdrawMoney', - 1 => 'BankAccountTest::testBalanceCannotBecomeNegative' - ], - 31 => [ - 0 => 'BankAccountTest::testDepositWithdrawMoney' - ], - 32 => null - ] - ]; - } - - protected function getCoverageForFileWithIgnoredLines(): CodeCoverage - { - $filter = new Filter; - $filter->addFileToWhitelist(TEST_FILES_PATH . 'source_with_ignore.php'); - - $coverage = new CodeCoverage( - $this->setUpXdebugStubForFileWithIgnoredLines(), - $filter - ); - - $coverage->start('FileWithIgnoredLines', true); - $coverage->stop(); - - return $coverage; - } - - protected function setUpXdebugStubForFileWithIgnoredLines(): Driver - { - $stub = $this->createMock(Driver::class); - - $stub->expects($this->any()) - ->method('stop') - ->will($this->returnValue( - [ - TEST_FILES_PATH . 'source_with_ignore.php' => [ - 2 => 1, - 4 => -1, - 6 => -1, - 7 => 1 - ] - ] - )); - - return $stub; - } - - protected function getCoverageForClassWithAnonymousFunction(): CodeCoverage - { - $filter = new Filter; - $filter->addFileToWhitelist(TEST_FILES_PATH . 'source_with_class_and_anonymous_function.php'); - - $coverage = new CodeCoverage( - $this->setUpXdebugStubForClassWithAnonymousFunction(), - $filter - ); - - $coverage->start('ClassWithAnonymousFunction', true); - $coverage->stop(); - - return $coverage; - } - - protected function setUpXdebugStubForClassWithAnonymousFunction(): Driver - { - $stub = $this->createMock(Driver::class); - - $stub->expects($this->any()) - ->method('stop') - ->will($this->returnValue( - [ - TEST_FILES_PATH . 'source_with_class_and_anonymous_function.php' => [ - 7 => 1, - 9 => 1, - 10 => -1, - 11 => 1, - 12 => 1, - 13 => 1, - 14 => 1, - 17 => 1, - 18 => 1 - ] - ] - )); - - return $stub; - } - - protected function getCoverageForCrashParsing(): CodeCoverage - { - $filter = new Filter; - $filter->addFileToWhitelist(TEST_FILES_PATH . 'Crash.php'); - - // This is a file with invalid syntax, so it isn't executed. - return new CodeCoverage( - $this->setUpXdebugStubForCrashParsing(), - $filter - ); - } - - protected function setUpXdebugStubForCrashParsing(): Driver - { - $stub = $this->createMock(Driver::class); - - $stub->expects($this->any()) - ->method('stop') - ->will($this->returnValue([])); - return $stub; - } - -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/BankAccount-clover.xml b/vendor/phpunit/php-code-coverage/tests/_files/BankAccount-clover.xml deleted file mode 100644 index 2f11d81..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/BankAccount-clover.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/phpunit/php-code-coverage/tests/_files/BankAccount-crap4j.xml b/vendor/phpunit/php-code-coverage/tests/_files/BankAccount-crap4j.xml deleted file mode 100644 index f2f56ea..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/BankAccount-crap4j.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - BankAccount - %s - - Method Crap Stats - 4 - 0 - 0 - 9 - 0 - - - - global - BankAccount - getBalance - getBalance() - getBalance() - 1 - 1 - 100 - 0 - - - global - BankAccount - setBalance - setBalance($balance) - setBalance($balance) - 6 - 2 - 0 - 0 - - - global - BankAccount - depositMoney - depositMoney($balance) - depositMoney($balance) - 1 - 1 - 100 - 0 - - - global - BankAccount - withdrawMoney - withdrawMoney($balance) - withdrawMoney($balance) - 1 - 1 - 100 - 0 - - - diff --git a/vendor/phpunit/php-code-coverage/tests/_files/BankAccount-text.txt b/vendor/phpunit/php-code-coverage/tests/_files/BankAccount-text.txt deleted file mode 100644 index 892d834..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/BankAccount-text.txt +++ /dev/null @@ -1,12 +0,0 @@ - - -Code Coverage Report: - %s - - Summary: - Classes: 0.00% (0/1) - Methods: 75.00% (3/4) - Lines: 50.00% (5/10) - -BankAccount - Methods: 75.00% ( 3/ 4) Lines: 50.00% ( 5/ 10) diff --git a/vendor/phpunit/php-code-coverage/tests/_files/BankAccount.php b/vendor/phpunit/php-code-coverage/tests/_files/BankAccount.php deleted file mode 100644 index 4238c15..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/BankAccount.php +++ /dev/null @@ -1,33 +0,0 @@ -balance; - } - - protected function setBalance($balance) - { - if ($balance >= 0) { - $this->balance = $balance; - } else { - throw new RuntimeException; - } - } - - public function depositMoney($balance) - { - $this->setBalance($this->getBalance() + $balance); - - return $this->getBalance(); - } - - public function withdrawMoney($balance) - { - $this->setBalance($this->getBalance() - $balance); - - return $this->getBalance(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/BankAccountTest.php b/vendor/phpunit/php-code-coverage/tests/_files/BankAccountTest.php deleted file mode 100644 index 803c892..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/BankAccountTest.php +++ /dev/null @@ -1,66 +0,0 @@ -ba = new BankAccount; - } - - /** - * @covers BankAccount::getBalance - */ - public function testBalanceIsInitiallyZero() - { - $this->assertEquals(0, $this->ba->getBalance()); - } - - /** - * @covers BankAccount::withdrawMoney - */ - public function testBalanceCannotBecomeNegative() - { - try { - $this->ba->withdrawMoney(1); - } catch (RuntimeException $e) { - $this->assertEquals(0, $this->ba->getBalance()); - - return; - } - - $this->fail(); - } - - /** - * @covers BankAccount::depositMoney - */ - public function testBalanceCannotBecomeNegative2() - { - try { - $this->ba->depositMoney(-1); - } catch (RuntimeException $e) { - $this->assertEquals(0, $this->ba->getBalance()); - - return; - } - - $this->fail(); - } - - /** - * @covers BankAccount::getBalance - * @covers BankAccount::depositMoney - * @covers BankAccount::withdrawMoney - */ - public function testDepositWithdrawMoney() - { - $this->assertEquals(0, $this->ba->getBalance()); - $this->ba->depositMoney(1); - $this->assertEquals(1, $this->ba->getBalance()); - $this->ba->withdrawMoney(1); - $this->assertEquals(0, $this->ba->getBalance()); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/CoverageClassExtendedTest.php b/vendor/phpunit/php-code-coverage/tests/_files/CoverageClassExtendedTest.php deleted file mode 100644 index e6d496e..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/CoverageClassExtendedTest.php +++ /dev/null @@ -1,14 +0,0 @@ - - */ - public function testSomething() - { - $o = new CoveredClass; - $o->publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/CoverageClassTest.php b/vendor/phpunit/php-code-coverage/tests/_files/CoverageClassTest.php deleted file mode 100644 index baa04d8..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/CoverageClassTest.php +++ /dev/null @@ -1,14 +0,0 @@ -publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/CoverageFunctionParenthesesTest.php b/vendor/phpunit/php-code-coverage/tests/_files/CoverageFunctionParenthesesTest.php deleted file mode 100644 index 560e381..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/CoverageFunctionParenthesesTest.php +++ /dev/null @@ -1,13 +0,0 @@ -publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/CoverageMethodParenthesesTest.php b/vendor/phpunit/php-code-coverage/tests/_files/CoverageMethodParenthesesTest.php deleted file mode 100644 index b624ed9..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/CoverageMethodParenthesesTest.php +++ /dev/null @@ -1,14 +0,0 @@ -publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/CoverageMethodParenthesesWhitespaceTest.php b/vendor/phpunit/php-code-coverage/tests/_files/CoverageMethodParenthesesWhitespaceTest.php deleted file mode 100644 index 20d2e75..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/CoverageMethodParenthesesWhitespaceTest.php +++ /dev/null @@ -1,14 +0,0 @@ -publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/CoverageMethodTest.php b/vendor/phpunit/php-code-coverage/tests/_files/CoverageMethodTest.php deleted file mode 100644 index fb7a882..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/CoverageMethodTest.php +++ /dev/null @@ -1,14 +0,0 @@ -publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/CoverageNoneTest.php b/vendor/phpunit/php-code-coverage/tests/_files/CoverageNoneTest.php deleted file mode 100644 index d8d9cae..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/CoverageNoneTest.php +++ /dev/null @@ -1,11 +0,0 @@ -publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/CoverageNotPrivateTest.php b/vendor/phpunit/php-code-coverage/tests/_files/CoverageNotPrivateTest.php deleted file mode 100644 index e98efd8..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/CoverageNotPrivateTest.php +++ /dev/null @@ -1,14 +0,0 @@ - - */ - public function testSomething() - { - $o = new CoveredClass; - $o->publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/CoverageNotProtectedTest.php b/vendor/phpunit/php-code-coverage/tests/_files/CoverageNotProtectedTest.php deleted file mode 100644 index 7c9c488..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/CoverageNotProtectedTest.php +++ /dev/null @@ -1,14 +0,0 @@ - - */ - public function testSomething() - { - $o = new CoveredClass; - $o->publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/CoverageNotPublicTest.php b/vendor/phpunit/php-code-coverage/tests/_files/CoverageNotPublicTest.php deleted file mode 100644 index 202724a..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/CoverageNotPublicTest.php +++ /dev/null @@ -1,14 +0,0 @@ - - */ - public function testSomething() - { - $o = new CoveredClass; - $o->publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/CoverageNothingTest.php b/vendor/phpunit/php-code-coverage/tests/_files/CoverageNothingTest.php deleted file mode 100644 index 4e1c0d0..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/CoverageNothingTest.php +++ /dev/null @@ -1,15 +0,0 @@ -publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/CoveragePrivateTest.php b/vendor/phpunit/php-code-coverage/tests/_files/CoveragePrivateTest.php deleted file mode 100644 index 849c348..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/CoveragePrivateTest.php +++ /dev/null @@ -1,14 +0,0 @@ - - */ - public function testSomething() - { - $o = new CoveredClass; - $o->publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/CoverageProtectedTest.php b/vendor/phpunit/php-code-coverage/tests/_files/CoverageProtectedTest.php deleted file mode 100644 index 6ae3544..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/CoverageProtectedTest.php +++ /dev/null @@ -1,14 +0,0 @@ - - */ - public function testSomething() - { - $o = new CoveredClass; - $o->publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/CoveragePublicTest.php b/vendor/phpunit/php-code-coverage/tests/_files/CoveragePublicTest.php deleted file mode 100644 index d977090..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/CoveragePublicTest.php +++ /dev/null @@ -1,14 +0,0 @@ - - */ - public function testSomething() - { - $o = new CoveredClass; - $o->publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/CoverageTwoDefaultClassAnnotations.php b/vendor/phpunit/php-code-coverage/tests/_files/CoverageTwoDefaultClassAnnotations.php deleted file mode 100644 index 06949cb..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/CoverageTwoDefaultClassAnnotations.php +++ /dev/null @@ -1,17 +0,0 @@ - - */ - public function testSomething() - { - $o = new Foo\CoveredClass; - $o->publicMethod(); - } - -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/CoveredClass.php b/vendor/phpunit/php-code-coverage/tests/_files/CoveredClass.php deleted file mode 100644 index f382ce9..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/CoveredClass.php +++ /dev/null @@ -1,36 +0,0 @@ -privateMethod(); - } - - public function publicMethod() - { - $this->protectedMethod(); - } -} - -class CoveredClass extends CoveredParentClass -{ - private function privateMethod() - { - } - - protected function protectedMethod() - { - parent::protectedMethod(); - $this->privateMethod(); - } - - public function publicMethod() - { - parent::publicMethod(); - $this->protectedMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/CoveredFunction.php b/vendor/phpunit/php-code-coverage/tests/_files/CoveredFunction.php deleted file mode 100644 index 9989eb0..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/CoveredFunction.php +++ /dev/null @@ -1,4 +0,0 @@ - - */ - public function testSomething() - { - $o = new Foo\CoveredClass; - $o->publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageClassTest.php b/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageClassTest.php deleted file mode 100644 index 2b91f1f..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageClassTest.php +++ /dev/null @@ -1,14 +0,0 @@ -publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageCoversClassPublicTest.php b/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageCoversClassPublicTest.php deleted file mode 100644 index d3bc1a9..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageCoversClassPublicTest.php +++ /dev/null @@ -1,17 +0,0 @@ -publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageCoversClassTest.php b/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageCoversClassTest.php deleted file mode 100644 index 67752dd..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageCoversClassTest.php +++ /dev/null @@ -1,22 +0,0 @@ -publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageMethodTest.php b/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageMethodTest.php deleted file mode 100644 index f83ae5f..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageMethodTest.php +++ /dev/null @@ -1,14 +0,0 @@ -publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageNotPrivateTest.php b/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageNotPrivateTest.php deleted file mode 100644 index b4983c7..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageNotPrivateTest.php +++ /dev/null @@ -1,14 +0,0 @@ - - */ - public function testSomething() - { - $o = new Foo\CoveredClass; - $o->publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageNotProtectedTest.php b/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageNotProtectedTest.php deleted file mode 100644 index ceb7b35..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageNotProtectedTest.php +++ /dev/null @@ -1,14 +0,0 @@ - - */ - public function testSomething() - { - $o = new Foo\CoveredClass; - $o->publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageNotPublicTest.php b/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageNotPublicTest.php deleted file mode 100644 index 60aff7a..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageNotPublicTest.php +++ /dev/null @@ -1,14 +0,0 @@ - - */ - public function testSomething() - { - $o = new Foo\CoveredClass; - $o->publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoveragePrivateTest.php b/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoveragePrivateTest.php deleted file mode 100644 index d5eb77e..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoveragePrivateTest.php +++ /dev/null @@ -1,14 +0,0 @@ - - */ - public function testSomething() - { - $o = new Foo\CoveredClass; - $o->publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageProtectedTest.php b/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageProtectedTest.php deleted file mode 100644 index 6a6eaca..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageProtectedTest.php +++ /dev/null @@ -1,14 +0,0 @@ - - */ - public function testSomething() - { - $o = new Foo\CoveredClass; - $o->publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoveragePublicTest.php b/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoveragePublicTest.php deleted file mode 100644 index f32803e..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoveragePublicTest.php +++ /dev/null @@ -1,14 +0,0 @@ - - */ - public function testSomething() - { - $o = new Foo\CoveredClass; - $o->publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoveredClass.php b/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoveredClass.php deleted file mode 100644 index 5bd0ddf..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoveredClass.php +++ /dev/null @@ -1,38 +0,0 @@ -privateMethod(); - } - - public function publicMethod() - { - $this->protectedMethod(); - } -} - -class CoveredClass extends CoveredParentClass -{ - private function privateMethod() - { - } - - protected function protectedMethod() - { - parent::protectedMethod(); - $this->privateMethod(); - } - - public function publicMethod() - { - parent::publicMethod(); - $this->protectedMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/NotExistingCoveredElementTest.php b/vendor/phpunit/php-code-coverage/tests/_files/NotExistingCoveredElementTest.php deleted file mode 100644 index 0836a8c..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/NotExistingCoveredElementTest.php +++ /dev/null @@ -1,26 +0,0 @@ - - */ - public function testThree() - { - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/Report/HTML/CoverageForBankAccount/BankAccount.php.html b/vendor/phpunit/php-code-coverage/tests/_files/Report/HTML/CoverageForBankAccount/BankAccount.php.html deleted file mode 100644 index 467602e..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/Report/HTML/CoverageForBankAccount/BankAccount.php.html +++ /dev/null @@ -1,249 +0,0 @@ - - - - - Code Coverage for %s%eBankAccount.php - - - - - - - -
-
-
-
- -
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
-
- 0.00% covered (danger) -
-
-
0.00%
0 / 1
-
- 75.00% covered (warning) -
-
-
75.00%
3 / 4
CRAP
-
- 50.00% covered (danger) -
-
-
50.00%
5 / 10
BankAccount
-
- 0.00% covered (danger) -
-
-
0.00%
0 / 1
-
- 75.00% covered (warning) -
-
-
75.00%
3 / 4
8.12
-
- 50.00% covered (danger) -
-
-
50.00%
5 / 10
 getBalance
-
- 100.00% covered (success) -
-
-
100.00%
1 / 1
1
-
- 100.00% covered (success) -
-
-
100.00%
1 / 1
 setBalance
-
- 0.00% covered (danger) -
-
-
0.00%
0 / 1
6
-
- 0.00% covered (danger) -
-
-
0.00%
0 / 5
 depositMoney
-
- 100.00% covered (success) -
-
-
100.00%
1 / 1
1
-
- 100.00% covered (success) -
-
-
100.00%
2 / 2
 withdrawMoney
-
- 100.00% covered (success) -
-
-
100.00%
1 / 1
1
-
- 100.00% covered (success) -
-
-
100.00%
2 / 2
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
<?php
class BankAccount
{
    protected $balance = 0;
    public function getBalance()
    {
        return $this->balance;
    }
    protected function setBalance($balance)
    {
        if ($balance >= 0) {
            $this->balance = $balance;
        } else {
            throw new RuntimeException;
        }
    }
    public function depositMoney($balance)
    {
        $this->setBalance($this->getBalance() + $balance);
        return $this->getBalance();
    }
    public function withdrawMoney($balance)
    {
        $this->setBalance($this->getBalance() - $balance);
        return $this->getBalance();
    }
}
- -
- - - - - - diff --git a/vendor/phpunit/php-code-coverage/tests/_files/Report/HTML/CoverageForBankAccount/dashboard.html b/vendor/phpunit/php-code-coverage/tests/_files/Report/HTML/CoverageForBankAccount/dashboard.html deleted file mode 100644 index e47929f..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/Report/HTML/CoverageForBankAccount/dashboard.html +++ /dev/null @@ -1,287 +0,0 @@ - - - - - Dashboard for %s - - - - - - - -
-
-
-
- -
-
-
-
-
-
-
-

Classes

-
-
-
-
-

Coverage Distribution

-
- -
-
-
-

Complexity

-
- -
-
-
-
-
-

Insufficient Coverage

-
- - - - - - - - - - - -
ClassCoverage
BankAccount50%
-
-
-
-

Project Risks

-
- - - - - - - - - - - -
ClassCRAP
BankAccount8
-
-
-
-
-
-

Methods

-
-
-
-
-

Coverage Distribution

-
- -
-
-
-

Complexity

-
- -
-
-
-
-
-

Insufficient Coverage

-
- - - - - - - - - - - -
MethodCoverage
setBalance0%
-
-
-
-

Project Risks

-
- - - - - - - - - - - -
MethodCRAP
setBalance6
-
-
-
- -
- - - - - - diff --git a/vendor/phpunit/php-code-coverage/tests/_files/Report/HTML/CoverageForBankAccount/index.html b/vendor/phpunit/php-code-coverage/tests/_files/Report/HTML/CoverageForBankAccount/index.html deleted file mode 100644 index e0c9ed9..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/Report/HTML/CoverageForBankAccount/index.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - - Code Coverage for %s - - - - - - - -
-
-
-
- -
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
-
- 50.00% covered (danger) -
-
-
50.00%
5 / 10
-
- 75.00% covered (warning) -
-
-
75.00%
3 / 4
-
- 0.00% covered (danger) -
-
-
0.00%
0 / 1
BankAccount.php
-
- 50.00% covered (danger) -
-
-
50.00%
5 / 10
-
- 75.00% covered (warning) -
-
-
75.00%
3 / 4
-
- 0.00% covered (danger) -
-
-
0.00%
0 / 1
-
-
-
-

Legend

-

- Low: 0% to 50% - Medium: 50% to 90% - High: 90% to 100% -

-

- Generated by php-code-coverage %s using %s at %s. -

-
-
- - diff --git a/vendor/phpunit/php-code-coverage/tests/_files/Report/HTML/CoverageForClassWithAnonymousFunction/dashboard.html b/vendor/phpunit/php-code-coverage/tests/_files/Report/HTML/CoverageForClassWithAnonymousFunction/dashboard.html deleted file mode 100644 index 8b27809..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/Report/HTML/CoverageForClassWithAnonymousFunction/dashboard.html +++ /dev/null @@ -1,285 +0,0 @@ - - - - - Dashboard for %s - - - - - - - -
-
-
-
- -
-
-
-
-
-
-
-

Classes

-
-
-
-
-

Coverage Distribution

-
- -
-
-
-

Complexity

-
- -
-
-
-
-
-

Insufficient Coverage

-
- - - - - - - - - - - -
ClassCoverage
CoveredClassWithAnonymousFunctionInStaticMethod87%
-
-
-
-

Project Risks

-
- - - - - - - - - - -
ClassCRAP
-
-
-
-
-
-

Methods

-
-
-
-
-

Coverage Distribution

-
- -
-
-
-

Complexity

-
- -
-
-
-
-
-

Insufficient Coverage

-
- - - - - - - - - - - -
MethodCoverage
runAnonymous87%
-
-
-
-

Project Risks

-
- - - - - - - - - - -
MethodCRAP
-
-
-
- -
- - - - - - diff --git a/vendor/phpunit/php-code-coverage/tests/_files/Report/HTML/CoverageForClassWithAnonymousFunction/index.html b/vendor/phpunit/php-code-coverage/tests/_files/Report/HTML/CoverageForClassWithAnonymousFunction/index.html deleted file mode 100644 index 68318d0..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/Report/HTML/CoverageForClassWithAnonymousFunction/index.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - - Code Coverage for %s - - - - - - - -
-
-
-
- -
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
-
- 87.50% covered (warning) -
-
-
87.50%
7 / 8
-
- 0.00% covered (danger) -
-
-
0.00%
0 / 1
-
- 0.00% covered (danger) -
-
-
0.00%
0 / 1
source_with_class_and_anonymous_function.php
-
- 87.50% covered (warning) -
-
-
87.50%
7 / 8
-
- 0.00% covered (danger) -
-
-
0.00%
0 / 1
-
- 0.00% covered (danger) -
-
-
0.00%
0 / 1
-
-
-
-

Legend

-

- Low: 0% to 50% - Medium: 50% to 90% - High: 90% to 100% -

-

- Generated by php-code-coverage %s using %s at %s. -

-
-
- - diff --git a/vendor/phpunit/php-code-coverage/tests/_files/Report/HTML/CoverageForClassWithAnonymousFunction/source_with_class_and_anonymous_function.php.html b/vendor/phpunit/php-code-coverage/tests/_files/Report/HTML/CoverageForClassWithAnonymousFunction/source_with_class_and_anonymous_function.php.html deleted file mode 100644 index c261c6e..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/Report/HTML/CoverageForClassWithAnonymousFunction/source_with_class_and_anonymous_function.php.html +++ /dev/null @@ -1,172 +0,0 @@ - - - - - Code Coverage for %s%esource_with_class_and_anonymous_function.php - - - - - - - -
-
-
-
- -
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
-
- 0.00% covered (danger) -
-
-
0.00%
0 / 1
-
- 0.00% covered (danger) -
-
-
0.00%
0 / 1
CRAP
-
- 87.50% covered (warning) -
-
-
87.50%
7 / 8
CoveredClassWithAnonymousFunctionInStaticMethod
-
- 0.00% covered (danger) -
-
-
0.00%
0 / 1
-
- 0.00% covered (danger) -
-
-
0.00%
0 / 1
1.00
-
- 87.50% covered (warning) -
-
-
87.50%
7 / 8
 runAnonymous
-
- 0.00% covered (danger) -
-
-
0.00%
0 / 1
1.00
-
- 87.50% covered (warning) -
-
-
87.50%
7 / 8
-
- - - - - - - - - - - - - - - - - - - - - - - -
<?php
class CoveredClassWithAnonymousFunctionInStaticMethod
{
    public static function runAnonymous()
    {
        $filter = ['abc124', 'abc123', '123'];
        array_walk(
            $filter,
            function (&$val, $key) {
                $val = preg_replace('|[^0-9]|', '', $val);
            }
        );
        // Should be covered
        $extravar = true;
    }
}
- -
- - - - - - diff --git a/vendor/phpunit/php-code-coverage/tests/_files/Report/HTML/CoverageForFileWithIgnoredLines/dashboard.html b/vendor/phpunit/php-code-coverage/tests/_files/Report/HTML/CoverageForFileWithIgnoredLines/dashboard.html deleted file mode 100644 index 4cf93ad..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/Report/HTML/CoverageForFileWithIgnoredLines/dashboard.html +++ /dev/null @@ -1,283 +0,0 @@ - - - - - Dashboard for %s - - - - - - - -
-
-
-
- -
-
-
-
-
-
-
-

Classes

-
-
-
-
-

Coverage Distribution

-
- -
-
-
-

Complexity

-
- -
-
-
-
-
-

Insufficient Coverage

-
- - - - - - - - - - -
ClassCoverage
-
-
-
-

Project Risks

-
- - - - - - - - - - -
ClassCRAP
-
-
-
-
-
-

Methods

-
-
-
-
-

Coverage Distribution

-
- -
-
-
-

Complexity

-
- -
-
-
-
-
-

Insufficient Coverage

-
- - - - - - - - - - -
MethodCoverage
-
-
-
-

Project Risks

-
- - - - - - - - - - -
MethodCRAP
-
-
-
- -
- - - - - - diff --git a/vendor/phpunit/php-code-coverage/tests/_files/Report/HTML/CoverageForFileWithIgnoredLines/index.html b/vendor/phpunit/php-code-coverage/tests/_files/Report/HTML/CoverageForFileWithIgnoredLines/index.html deleted file mode 100644 index 7d4cfff..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/Report/HTML/CoverageForFileWithIgnoredLines/index.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - - Code Coverage for %s - - - - - - - -
-
-
-
- -
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
-
- 50.00% covered (danger) -
-
-
50.00%
1 / 2
-
- 100.00% covered (success) -
-
-
100.00%
1 / 1
n/a
0 / 0
source_with_ignore.php
-
- 50.00% covered (danger) -
-
-
50.00%
1 / 2
-
- 100.00% covered (success) -
-
-
100.00%
1 / 1
n/a
0 / 0
-
-
-
-

Legend

-

- Low: 0% to 50% - Medium: 50% to 90% - High: 90% to 100% -

-

- Generated by php-code-coverage %s using %s at %s. -

-
-
- - diff --git a/vendor/phpunit/php-code-coverage/tests/_files/Report/HTML/CoverageForFileWithIgnoredLines/source_with_ignore.php.html b/vendor/phpunit/php-code-coverage/tests/_files/Report/HTML/CoverageForFileWithIgnoredLines/source_with_ignore.php.html deleted file mode 100644 index a18a5aa..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/Report/HTML/CoverageForFileWithIgnoredLines/source_with_ignore.php.html +++ /dev/null @@ -1,196 +0,0 @@ - - - - - Code Coverage for %s%esource_with_ignore.php - - - - - - - -
-
-
-
- -
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
n/a
0 / 0
-
- 100.00% covered (success) -
-
-
100.00%
1 / 1
CRAP
-
- 50.00% covered (danger) -
-
-
50.00%
1 / 2
baz
n/a
0 / 0
1
n/a
0 / 0
Foo
n/a
0 / 0
n/a
0 / 0
1
n/a
0 / 0
 bar
n/a
0 / 0
1
n/a
0 / 0
Bar
n/a
0 / 0
n/a
0 / 0
1
n/a
0 / 0
 foo
n/a
0 / 0
1
n/a
0 / 0
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
<?php
if ($neverHappens) {
    // @codeCoverageIgnoreStart
    print '*';
    // @codeCoverageIgnoreEnd
}
/**
 * @codeCoverageIgnore
 */
class Foo
{
    public function bar()
    {
    }
}
class Bar
{
    /**
     * @codeCoverageIgnore
     */
    public function foo()
    {
    }
}
function baz()
{
    print '*'; // @codeCoverageIgnore
}
interface Bor
{
    public function foo();
}
- -
- - - - - - diff --git a/vendor/phpunit/php-code-coverage/tests/_files/Report/XML/CoverageForBankAccount/BankAccount.php.xml b/vendor/phpunit/php-code-coverage/tests/_files/Report/XML/CoverageForBankAccount/BankAccount.php.xml deleted file mode 100644 index 238548b..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/Report/XML/CoverageForBankAccount/BankAccount.php.xml +++ /dev/null @@ -1,262 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <?php - - - class - - BankAccount - - - { - - - - protected - - $balance - - = - - 0 - ; - - - - - public - - function - - getBalance - ( - ) - - - - { - - - - return - - $this - -> - balance - ; - - - - } - - - - - protected - - function - - setBalance - ( - $balance - ) - - - - { - - - - if - - ( - $balance - - >= - - 0 - ) - - { - - - - $this - -> - balance - - = - - $balance - ; - - - - } - - else - - { - - - - throw - - new - - RuntimeException - ; - - - - } - - - - } - - - - - public - - function - - depositMoney - ( - $balance - ) - - - - { - - - - $this - -> - setBalance - ( - $this - -> - getBalance - ( - ) - - + - - $balance - ) - ; - - - - - return - - $this - -> - getBalance - ( - ) - ; - - - - } - - - - - public - - function - - withdrawMoney - ( - $balance - ) - - - - { - - - - $this - -> - setBalance - ( - $this - -> - getBalance - ( - ) - - - - - $balance - ) - ; - - - - - return - - $this - -> - getBalance - ( - ) - ; - - - - } - - - } - - - - - diff --git a/vendor/phpunit/php-code-coverage/tests/_files/Report/XML/CoverageForBankAccount/index.xml b/vendor/phpunit/php-code-coverage/tests/_files/Report/XML/CoverageForBankAccount/index.xml deleted file mode 100644 index df433b0..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/Report/XML/CoverageForBankAccount/index.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/phpunit/php-code-coverage/tests/_files/Report/XML/CoverageForClassWithAnonymousFunction/index.xml b/vendor/phpunit/php-code-coverage/tests/_files/Report/XML/CoverageForClassWithAnonymousFunction/index.xml deleted file mode 100644 index c8d90ba..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/Report/XML/CoverageForClassWithAnonymousFunction/index.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/phpunit/php-code-coverage/tests/_files/Report/XML/CoverageForClassWithAnonymousFunction/source_with_class_and_anonymous_function.php.xml b/vendor/phpunit/php-code-coverage/tests/_files/Report/XML/CoverageForClassWithAnonymousFunction/source_with_class_and_anonymous_function.php.xml deleted file mode 100644 index a413174..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/Report/XML/CoverageForClassWithAnonymousFunction/source_with_class_and_anonymous_function.php.xml +++ /dev/null @@ -1,161 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <?php - - - - class - - CoveredClassWithAnonymousFunctionInStaticMethod - - - { - - - - public - - static - - function - - runAnonymous - ( - ) - - - - { - - - - $filter - - = - - [ - 'abc124' - , - - 'abc123' - , - - '123' - ] - ; - - - - - array_walk - ( - - - - $filter - , - - - - function - - ( - & - $val - , - - $key - ) - - { - - - - $val - - = - - preg_replace - ( - '|[^0-9]|' - , - - '' - , - - $val - ) - ; - - - - } - - - - ) - ; - - - - - // Should be covered - - - - $extravar - - = - - true - ; - - - - } - - - } - - - - - diff --git a/vendor/phpunit/php-code-coverage/tests/_files/Report/XML/CoverageForFileWithIgnoredLines/index.xml b/vendor/phpunit/php-code-coverage/tests/_files/Report/XML/CoverageForFileWithIgnoredLines/index.xml deleted file mode 100644 index d44f970..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/Report/XML/CoverageForFileWithIgnoredLines/index.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/phpunit/php-code-coverage/tests/_files/Report/XML/CoverageForFileWithIgnoredLines/source_with_ignore.php.xml b/vendor/phpunit/php-code-coverage/tests/_files/Report/XML/CoverageForFileWithIgnoredLines/source_with_ignore.php.xml deleted file mode 100644 index 5ff1d6b..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/Report/XML/CoverageForFileWithIgnoredLines/source_with_ignore.php.xml +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <?php - - - if - - ( - $neverHappens - ) - - { - - - - // @codeCoverageIgnoreStart - - - - print - - '*' - ; - - - - // @codeCoverageIgnoreEnd - - - } - - - - /** - - - * @codeCoverageIgnore - - - */ - - - class - - Foo - - - { - - - - public - - function - - bar - ( - ) - - - - { - - - - } - - - } - - - - class - - Bar - - - { - - - - /** - - - * @codeCoverageIgnore - - - */ - - - - public - - function - - foo - ( - ) - - - - { - - - - } - - - } - - - - function - - baz - ( - ) - - - { - - - - print - - '*' - ; - - // @codeCoverageIgnore - - - } - - - - interface - - Bor - - - { - - - - public - - function - - foo - ( - ) - ; - - - - } - - - - - diff --git a/vendor/phpunit/php-code-coverage/tests/_files/class-with-anonymous-function-clover.xml b/vendor/phpunit/php-code-coverage/tests/_files/class-with-anonymous-function-clover.xml deleted file mode 100644 index 008db55..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/class-with-anonymous-function-clover.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/phpunit/php-code-coverage/tests/_files/class-with-anonymous-function-crap4j.xml b/vendor/phpunit/php-code-coverage/tests/_files/class-with-anonymous-function-crap4j.xml deleted file mode 100644 index 5bd2535..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/class-with-anonymous-function-crap4j.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - CoverageForClassWithAnonymousFunction - %s - - Method Crap Stats - 1 - 0 - 0 - 1 - 0 - - - - global - CoveredClassWithAnonymousFunctionInStaticMethod - runAnonymous - runAnonymous() - runAnonymous() - 1 - 1 - 87.5 - 0 - - - diff --git a/vendor/phpunit/php-code-coverage/tests/_files/class-with-anonymous-function-text.txt b/vendor/phpunit/php-code-coverage/tests/_files/class-with-anonymous-function-text.txt deleted file mode 100644 index e4204cc..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/class-with-anonymous-function-text.txt +++ /dev/null @@ -1,12 +0,0 @@ - - -Code Coverage Report: - %s - - Summary: - Classes: 0.00% (0/1) - Methods: 0.00% (0/1) - Lines: 87.50% (7/8) - -CoveredClassWithAnonymousFunctionInStaticMethod - Methods: 0.00% ( 0/ 1) Lines: 87.50% ( 7/ 8) diff --git a/vendor/phpunit/php-code-coverage/tests/_files/ignored-lines-clover.xml b/vendor/phpunit/php-code-coverage/tests/_files/ignored-lines-clover.xml deleted file mode 100644 index efd3801..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/ignored-lines-clover.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/vendor/phpunit/php-code-coverage/tests/_files/ignored-lines-crap4j.xml b/vendor/phpunit/php-code-coverage/tests/_files/ignored-lines-crap4j.xml deleted file mode 100644 index 2607b59..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/ignored-lines-crap4j.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - CoverageForFileWithIgnoredLines - %s - - Method Crap Stats - 2 - 0 - 0 - 2 - 0 - - - - global - Foo - bar - bar() - bar() - 1 - 1 - 100 - 0 - - - global - Bar - foo - foo() - foo() - 1 - 1 - 100 - 0 - - - diff --git a/vendor/phpunit/php-code-coverage/tests/_files/ignored-lines-text.txt b/vendor/phpunit/php-code-coverage/tests/_files/ignored-lines-text.txt deleted file mode 100644 index 6e8e149..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/ignored-lines-text.txt +++ /dev/null @@ -1,10 +0,0 @@ - - -Code Coverage Report:%w - %s -%w - Summary:%w - Classes: (0/0) - Methods: (0/0) - Lines: 50.00% (1/2) - diff --git a/vendor/phpunit/php-code-coverage/tests/_files/source_with_class_and_anonymous_function.php b/vendor/phpunit/php-code-coverage/tests/_files/source_with_class_and_anonymous_function.php deleted file mode 100644 index 72aa938..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/source_with_class_and_anonymous_function.php +++ /dev/null @@ -1,19 +0,0 @@ - 1, 'b' => 2, 'c' => 3, 'd' => 4], - static function ($v, $k) - { - return $k === 'b' || $v === 4; - }, - ARRAY_FILTER_USE_BOTH - ); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/source_without_ignore.php b/vendor/phpunit/php-code-coverage/tests/_files/source_without_ignore.php deleted file mode 100644 index be4e836..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/source_without_ignore.php +++ /dev/null @@ -1,4 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Report; - -use SebastianBergmann\CodeCoverage\Node\Builder; -use SebastianBergmann\CodeCoverage\TestCase; - -class BuilderTest extends TestCase -{ - protected $factory; - - protected function setUp(): void - { - $this->factory = new Builder; - } - - public function testSomething(): void - { - $root = $this->getCoverageForBankAccount()->getReport(); - - $expectedPath = \rtrim(TEST_FILES_PATH, \DIRECTORY_SEPARATOR); - $this->assertEquals($expectedPath, $root->getName()); - $this->assertEquals($expectedPath, $root->getPath()); - $this->assertEquals(10, $root->getNumExecutableLines()); - $this->assertEquals(5, $root->getNumExecutedLines()); - $this->assertEquals(1, $root->getNumClasses()); - $this->assertEquals(0, $root->getNumTestedClasses()); - $this->assertEquals(4, $root->getNumMethods()); - $this->assertEquals(3, $root->getNumTestedMethods()); - $this->assertEquals('0.00%', $root->getTestedClassesPercent()); - $this->assertEquals('75.00%', $root->getTestedMethodsPercent()); - $this->assertEquals('50.00%', $root->getLineExecutedPercent()); - $this->assertEquals(0, $root->getNumFunctions()); - $this->assertEquals(0, $root->getNumTestedFunctions()); - $this->assertNull($root->getParent()); - $this->assertEquals([], $root->getDirectories()); - #$this->assertEquals(array(), $root->getFiles()); - #$this->assertEquals(array(), $root->getChildNodes()); - - $this->assertEquals( - [ - 'BankAccount' => [ - 'methods' => [ - 'getBalance' => [ - 'signature' => 'getBalance()', - 'startLine' => 6, - 'endLine' => 9, - 'executableLines' => 1, - 'executedLines' => 1, - 'ccn' => 1, - 'coverage' => 100, - 'crap' => '1', - 'link' => 'BankAccount.php.html#6', - 'methodName' => 'getBalance', - 'visibility' => 'public', - ], - 'setBalance' => [ - 'signature' => 'setBalance($balance)', - 'startLine' => 11, - 'endLine' => 18, - 'executableLines' => 5, - 'executedLines' => 0, - 'ccn' => 2, - 'coverage' => 0, - 'crap' => 6, - 'link' => 'BankAccount.php.html#11', - 'methodName' => 'setBalance', - 'visibility' => 'protected', - ], - 'depositMoney' => [ - 'signature' => 'depositMoney($balance)', - 'startLine' => 20, - 'endLine' => 25, - 'executableLines' => 2, - 'executedLines' => 2, - 'ccn' => 1, - 'coverage' => 100, - 'crap' => '1', - 'link' => 'BankAccount.php.html#20', - 'methodName' => 'depositMoney', - 'visibility' => 'public', - ], - 'withdrawMoney' => [ - 'signature' => 'withdrawMoney($balance)', - 'startLine' => 27, - 'endLine' => 32, - 'executableLines' => 2, - 'executedLines' => 2, - 'ccn' => 1, - 'coverage' => 100, - 'crap' => '1', - 'link' => 'BankAccount.php.html#27', - 'methodName' => 'withdrawMoney', - 'visibility' => 'public', - ], - ], - 'startLine' => 2, - 'executableLines' => 10, - 'executedLines' => 5, - 'ccn' => 5, - 'coverage' => 50, - 'crap' => '8.12', - 'package' => [ - 'namespace' => '', - 'fullPackage' => '', - 'category' => '', - 'package' => '', - 'subpackage' => '', - ], - 'link' => 'BankAccount.php.html#2', - 'className' => 'BankAccount', - ], - ], - $root->getClasses() - ); - - $this->assertEquals([], $root->getFunctions()); - } - - public function testNotCrashParsing(): void - { - $coverage = $this->getCoverageForCrashParsing(); - $root = $coverage->getReport(); - - $expectedPath = \rtrim(TEST_FILES_PATH, \DIRECTORY_SEPARATOR); - $this->assertEquals($expectedPath, $root->getName()); - $this->assertEquals($expectedPath, $root->getPath()); - $this->assertEquals(2, $root->getNumExecutableLines()); - $this->assertEquals(0, $root->getNumExecutedLines()); - $data = $coverage->getData(); - $expectedFile = $expectedPath . \DIRECTORY_SEPARATOR . 'Crash.php'; - $this->assertSame([$expectedFile => [1 => [], 2 => []]], $data); - } - - public function testBuildDirectoryStructure(): void - { - $s = \DIRECTORY_SEPARATOR; - - $method = new \ReflectionMethod( - Builder::class, - 'buildDirectoryStructure' - ); - - $method->setAccessible(true); - - $this->assertEquals( - [ - 'src' => [ - 'Money.php/f' => [], - 'MoneyBag.php/f' => [], - 'Foo' => [ - 'Bar' => [ - 'Baz' => [ - 'Foo.php/f' => [], - ], - ], - ], - ], - ], - $method->invoke( - $this->factory, - [ - "src{$s}Money.php" => [], - "src{$s}MoneyBag.php" => [], - "src{$s}Foo{$s}Bar{$s}Baz{$s}Foo.php" => [], - ] - ) - ); - } - - /** - * @dataProvider reducePathsProvider - */ - public function testReducePaths($reducedPaths, $commonPath, $paths): void - { - $method = new \ReflectionMethod( - Builder::class, - 'reducePaths' - ); - - $method->setAccessible(true); - - $_commonPath = $method->invokeArgs($this->factory, [&$paths]); - - $this->assertEquals($reducedPaths, $paths); - $this->assertEquals($commonPath, $_commonPath); - } - - public function reducePathsProvider() - { - $s = \DIRECTORY_SEPARATOR; - - yield [ - [], - '.', - [], - ]; - - $prefixes = ["C:$s", "$s"]; - - foreach ($prefixes as $p) { - yield [ - [ - 'Money.php' => [], - ], - "{$p}home{$s}sb{$s}Money{$s}", - [ - "{$p}home{$s}sb{$s}Money{$s}Money.php" => [], - ], - ]; - - yield [ - [ - 'Money.php' => [], - 'MoneyBag.php' => [], - ], - "{$p}home{$s}sb{$s}Money", - [ - "{$p}home{$s}sb{$s}Money{$s}Money.php" => [], - "{$p}home{$s}sb{$s}Money{$s}MoneyBag.php" => [], - ], - ]; - - yield [ - [ - 'Money.php' => [], - 'MoneyBag.php' => [], - "Cash.phar{$s}Cash.php" => [], - ], - "{$p}home{$s}sb{$s}Money", - [ - "{$p}home{$s}sb{$s}Money{$s}Money.php" => [], - "{$p}home{$s}sb{$s}Money{$s}MoneyBag.php" => [], - "phar://{$p}home{$s}sb{$s}Money{$s}Cash.phar{$s}Cash.php" => [], - ], - ]; - } - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/tests/CloverTest.php b/vendor/phpunit/php-code-coverage/tests/tests/CloverTest.php deleted file mode 100644 index 7fdbf7d..0000000 --- a/vendor/phpunit/php-code-coverage/tests/tests/CloverTest.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Report; - -use SebastianBergmann\CodeCoverage\TestCase; - -/** - * @covers SebastianBergmann\CodeCoverage\Report\Clover - */ -class CloverTest extends TestCase -{ - public function testCloverForBankAccountTest(): void - { - $clover = new Clover; - - $this->assertStringMatchesFormatFile( - TEST_FILES_PATH . 'BankAccount-clover.xml', - $clover->process($this->getCoverageForBankAccount(), null, 'BankAccount') - ); - } - - public function testCloverForFileWithIgnoredLines(): void - { - $clover = new Clover; - - $this->assertStringMatchesFormatFile( - TEST_FILES_PATH . 'ignored-lines-clover.xml', - $clover->process($this->getCoverageForFileWithIgnoredLines()) - ); - } - - public function testCloverForClassWithAnonymousFunction(): void - { - $clover = new Clover; - - $this->assertStringMatchesFormatFile( - TEST_FILES_PATH . 'class-with-anonymous-function-clover.xml', - $clover->process($this->getCoverageForClassWithAnonymousFunction()) - ); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/tests/CodeCoverageTest.php b/vendor/phpunit/php-code-coverage/tests/tests/CodeCoverageTest.php deleted file mode 100644 index ce2471a..0000000 --- a/vendor/phpunit/php-code-coverage/tests/tests/CodeCoverageTest.php +++ /dev/null @@ -1,359 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage; - -use SebastianBergmann\CodeCoverage\Driver\Driver; -use SebastianBergmann\Environment\Runtime; - -/** - * @covers SebastianBergmann\CodeCoverage\CodeCoverage - */ -class CodeCoverageTest extends TestCase -{ - /** - * @var CodeCoverage - */ - private $coverage; - - protected function setUp(): void - { - $runtime = new Runtime; - - if (!$runtime->canCollectCodeCoverage()) { - $this->markTestSkipped('No code coverage driver available'); - } - - $this->coverage = new CodeCoverage; - } - - public function testCannotStopWithInvalidSecondArgument(): void - { - $this->expectException(Exception::class); - - $this->coverage->stop(true, null); - } - - public function testCannotAppendWithInvalidArgument(): void - { - $this->expectException(Exception::class); - - $this->coverage->append([], null); - } - - public function testCollect(): void - { - $coverage = $this->getCoverageForBankAccount(); - - $this->assertEquals( - $this->getExpectedDataArrayForBankAccount(), - $coverage->getData() - ); - - $this->assertEquals( - [ - 'BankAccountTest::testBalanceIsInitiallyZero' => ['size' => 'unknown', 'status' => -1], - 'BankAccountTest::testBalanceCannotBecomeNegative' => ['size' => 'unknown', 'status' => -1], - 'BankAccountTest::testBalanceCannotBecomeNegative2' => ['size' => 'unknown', 'status' => -1], - 'BankAccountTest::testDepositWithdrawMoney' => ['size' => 'unknown', 'status' => -1], - ], - $coverage->getTests() - ); - } - - public function testMerge(): void - { - $coverage = $this->getCoverageForBankAccountForFirstTwoTests(); - $coverage->merge($this->getCoverageForBankAccountForLastTwoTests()); - - $this->assertEquals( - $this->getExpectedDataArrayForBankAccount(), - $coverage->getData() - ); - } - - public function testMergeReverseOrder(): void - { - $coverage = $this->getCoverageForBankAccountForLastTwoTests(); - $coverage->merge($this->getCoverageForBankAccountForFirstTwoTests()); - - $this->assertEquals( - $this->getExpectedDataArrayForBankAccountInReverseOrder(), - $coverage->getData() - ); - } - - public function testMerge2(): void - { - $coverage = new CodeCoverage( - $this->createMock(Driver::class), - new Filter - ); - - $coverage->merge($this->getCoverageForBankAccount()); - - $this->assertEquals( - $this->getExpectedDataArrayForBankAccount(), - $coverage->getData() - ); - } - - public function testGetLinesToBeIgnored(): void - { - $this->assertEquals( - [ - 1, - 3, - 4, - 5, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23, - 24, - 25, - 26, - 27, - 28, - 30, - 32, - 33, - 34, - 35, - 36, - 37, - 38, - ], - $this->getLinesToBeIgnored()->invoke( - $this->coverage, - TEST_FILES_PATH . 'source_with_ignore.php' - ) - ); - } - - public function testGetLinesToBeIgnored2(): void - { - $this->assertEquals( - [1, 5], - $this->getLinesToBeIgnored()->invoke( - $this->coverage, - TEST_FILES_PATH . 'source_without_ignore.php' - ) - ); - } - - public function testGetLinesToBeIgnored3(): void - { - $this->assertEquals( - [ - 1, - 2, - 3, - 4, - 5, - 8, - 11, - 15, - 16, - 19, - 20, - ], - $this->getLinesToBeIgnored()->invoke( - $this->coverage, - TEST_FILES_PATH . 'source_with_class_and_anonymous_function.php' - ) - ); - } - - public function testGetLinesToBeIgnoredOneLineAnnotations(): void - { - $this->assertEquals( - [ - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 14, - 15, - 16, - 18, - 20, - 21, - 23, - 24, - 25, - 27, - 28, - 29, - 30, - 31, - 32, - 33, - 34, - 37, - ], - $this->getLinesToBeIgnored()->invoke( - $this->coverage, - TEST_FILES_PATH . 'source_with_oneline_annotations.php' - ) - ); - } - - public function testGetLinesToBeIgnoredWhenIgnoreIsDisabled(): void - { - $this->coverage->setDisableIgnoredLines(true); - - $this->assertEquals( - [ - 7, - 11, - 12, - 13, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23, - 26, - 27, - 32, - 33, - 34, - 35, - 36, - 37, - ], - $this->getLinesToBeIgnored()->invoke( - $this->coverage, - TEST_FILES_PATH . 'source_with_ignore.php' - ) - ); - } - - public function testUseStatementsAreIgnored(): void - { - $this->assertEquals( - [ - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 13, - 16, - 23, - 24, - ], - $this->getLinesToBeIgnored()->invoke( - $this->coverage, - TEST_FILES_PATH . 'source_with_use_statements.php' - ) - ); - } - - public function testAppendThrowsExceptionIfCoveredCodeWasNotExecuted(): void - { - $this->coverage->filter()->addDirectoryToWhitelist(TEST_FILES_PATH); - $this->coverage->setCheckForUnexecutedCoveredCode(true); - - $data = [ - TEST_FILES_PATH . 'BankAccount.php' => [ - 29 => -1, - 31 => -1, - ], - ]; - - $linesToBeCovered = [ - TEST_FILES_PATH . 'BankAccount.php' => [ - 22, - 24, - ], - ]; - - $linesToBeUsed = []; - - $this->expectException(CoveredCodeNotExecutedException::class); - - $this->coverage->append($data, 'File1.php', true, $linesToBeCovered, $linesToBeUsed); - } - - public function testAppendThrowsExceptionIfUsedCodeWasNotExecuted(): void - { - $this->coverage->filter()->addDirectoryToWhitelist(TEST_FILES_PATH); - $this->coverage->setCheckForUnexecutedCoveredCode(true); - - $data = [ - TEST_FILES_PATH . 'BankAccount.php' => [ - 29 => -1, - 31 => -1, - ], - ]; - - $linesToBeCovered = [ - TEST_FILES_PATH . 'BankAccount.php' => [ - 29, - 31, - ], - ]; - - $linesToBeUsed = [ - TEST_FILES_PATH . 'BankAccount.php' => [ - 22, - 24, - ], - ]; - - $this->expectException(CoveredCodeNotExecutedException::class); - - $this->coverage->append($data, 'File1.php', true, $linesToBeCovered, $linesToBeUsed); - } - - /** - * @return \ReflectionMethod - */ - private function getLinesToBeIgnored() - { - $getLinesToBeIgnored = new \ReflectionMethod( - 'SebastianBergmann\CodeCoverage\CodeCoverage', - 'getLinesToBeIgnored' - ); - - $getLinesToBeIgnored->setAccessible(true); - - return $getLinesToBeIgnored; - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/tests/Crap4jTest.php b/vendor/phpunit/php-code-coverage/tests/tests/Crap4jTest.php deleted file mode 100644 index 033fe4c..0000000 --- a/vendor/phpunit/php-code-coverage/tests/tests/Crap4jTest.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Report; - -use SebastianBergmann\CodeCoverage\TestCase; - -/** - * @covers SebastianBergmann\CodeCoverage\Report\Crap4j - */ -class Crap4jTest extends TestCase -{ - public function testForBankAccountTest(): void - { - $crap4j = new Crap4j; - - $this->assertStringMatchesFormatFile( - TEST_FILES_PATH . 'BankAccount-crap4j.xml', - $crap4j->process($this->getCoverageForBankAccount(), null, 'BankAccount') - ); - } - - public function testForFileWithIgnoredLines(): void - { - $crap4j = new Crap4j; - - $this->assertStringMatchesFormatFile( - TEST_FILES_PATH . 'ignored-lines-crap4j.xml', - $crap4j->process($this->getCoverageForFileWithIgnoredLines(), null, 'CoverageForFileWithIgnoredLines') - ); - } - - public function testForClassWithAnonymousFunction(): void - { - $crap4j = new Crap4j; - - $this->assertStringMatchesFormatFile( - TEST_FILES_PATH . 'class-with-anonymous-function-crap4j.xml', - $crap4j->process($this->getCoverageForClassWithAnonymousFunction(), null, 'CoverageForClassWithAnonymousFunction') - ); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/tests/Exception/UnintentionallyCoveredCodeExceptionTest.php b/vendor/phpunit/php-code-coverage/tests/tests/Exception/UnintentionallyCoveredCodeExceptionTest.php deleted file mode 100644 index dffc227..0000000 --- a/vendor/phpunit/php-code-coverage/tests/tests/Exception/UnintentionallyCoveredCodeExceptionTest.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\tests\Exception; - -use PHPUnit\Framework\TestCase; -use SebastianBergmann\CodeCoverage\RuntimeException; -use SebastianBergmann\CodeCoverage\UnintentionallyCoveredCodeException; - -final class UnintentionallyCoveredCodeExceptionTest extends TestCase -{ - public function testCanConstructWithEmptyArray(): void - { - $unintentionallyCoveredUnits = []; - - $exception = new UnintentionallyCoveredCodeException($unintentionallyCoveredUnits); - - $this->assertInstanceOf(RuntimeException::class, $exception); - $this->assertSame($unintentionallyCoveredUnits, $exception->getUnintentionallyCoveredUnits()); - $this->assertSame('', $exception->getMessage()); - } - - public function testCanConstructWithNonEmptyArray(): void - { - $unintentionallyCoveredUnits = [ - 'foo', - 'bar', - 'baz', - ]; - - $exception = new UnintentionallyCoveredCodeException($unintentionallyCoveredUnits); - - $this->assertInstanceOf(RuntimeException::class, $exception); - $this->assertSame($unintentionallyCoveredUnits, $exception->getUnintentionallyCoveredUnits()); - - $expected = <<assertSame($expected, $exception->getMessage()); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/tests/FilterTest.php b/vendor/phpunit/php-code-coverage/tests/tests/FilterTest.php deleted file mode 100644 index 373b349..0000000 --- a/vendor/phpunit/php-code-coverage/tests/tests/FilterTest.php +++ /dev/null @@ -1,213 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage; - -use PHPUnit\Framework\TestCase; -use SebastianBergmann\FileIterator\Facade as FileIteratorFacade; - -class FilterTest extends TestCase -{ - /** - * @var Filter - */ - private $filter; - - /** - * @var array - */ - private $files = []; - - protected function setUp(): void - { - $this->filter = \unserialize('O:37:"SebastianBergmann\CodeCoverage\Filter":0:{}'); - - $this->files = [ - TEST_FILES_PATH . 'BankAccount.php', - TEST_FILES_PATH . 'BankAccountTest.php', - TEST_FILES_PATH . 'CoverageClassExtendedTest.php', - TEST_FILES_PATH . 'CoverageClassTest.php', - TEST_FILES_PATH . 'CoverageFunctionParenthesesTest.php', - TEST_FILES_PATH . 'CoverageFunctionParenthesesWhitespaceTest.php', - TEST_FILES_PATH . 'CoverageFunctionTest.php', - TEST_FILES_PATH . 'CoverageMethodOneLineAnnotationTest.php', - TEST_FILES_PATH . 'CoverageMethodParenthesesTest.php', - TEST_FILES_PATH . 'CoverageMethodParenthesesWhitespaceTest.php', - TEST_FILES_PATH . 'CoverageMethodTest.php', - TEST_FILES_PATH . 'CoverageNoneTest.php', - TEST_FILES_PATH . 'CoverageNotPrivateTest.php', - TEST_FILES_PATH . 'CoverageNotProtectedTest.php', - TEST_FILES_PATH . 'CoverageNotPublicTest.php', - TEST_FILES_PATH . 'CoverageNothingTest.php', - TEST_FILES_PATH . 'CoveragePrivateTest.php', - TEST_FILES_PATH . 'CoverageProtectedTest.php', - TEST_FILES_PATH . 'CoveragePublicTest.php', - TEST_FILES_PATH . 'CoverageTwoDefaultClassAnnotations.php', - TEST_FILES_PATH . 'CoveredClass.php', - TEST_FILES_PATH . 'CoveredFunction.php', - TEST_FILES_PATH . 'Crash.php', - TEST_FILES_PATH . 'NamespaceCoverageClassExtendedTest.php', - TEST_FILES_PATH . 'NamespaceCoverageClassTest.php', - TEST_FILES_PATH . 'NamespaceCoverageCoversClassPublicTest.php', - TEST_FILES_PATH . 'NamespaceCoverageCoversClassTest.php', - TEST_FILES_PATH . 'NamespaceCoverageMethodTest.php', - TEST_FILES_PATH . 'NamespaceCoverageNotPrivateTest.php', - TEST_FILES_PATH . 'NamespaceCoverageNotProtectedTest.php', - TEST_FILES_PATH . 'NamespaceCoverageNotPublicTest.php', - TEST_FILES_PATH . 'NamespaceCoveragePrivateTest.php', - TEST_FILES_PATH . 'NamespaceCoverageProtectedTest.php', - TEST_FILES_PATH . 'NamespaceCoveragePublicTest.php', - TEST_FILES_PATH . 'NamespaceCoveredClass.php', - TEST_FILES_PATH . 'NotExistingCoveredElementTest.php', - TEST_FILES_PATH . 'source_with_class_and_anonymous_function.php', - TEST_FILES_PATH . 'source_with_ignore.php', - TEST_FILES_PATH . 'source_with_namespace.php', - TEST_FILES_PATH . 'source_with_oneline_annotations.php', - TEST_FILES_PATH . 'source_with_use_statements.php', - TEST_FILES_PATH . 'source_without_ignore.php', - TEST_FILES_PATH . 'source_without_namespace.php', - ]; - } - - /** - * @covers SebastianBergmann\CodeCoverage\Filter::addFileToWhitelist - * @covers SebastianBergmann\CodeCoverage\Filter::getWhitelist - */ - public function testAddingAFileToTheWhitelistWorks(): void - { - $this->filter->addFileToWhitelist($this->files[0]); - - $this->assertEquals( - [$this->files[0]], - $this->filter->getWhitelist() - ); - } - - /** - * @covers SebastianBergmann\CodeCoverage\Filter::removeFileFromWhitelist - * @covers SebastianBergmann\CodeCoverage\Filter::getWhitelist - */ - public function testRemovingAFileFromTheWhitelistWorks(): void - { - $this->filter->addFileToWhitelist($this->files[0]); - $this->filter->removeFileFromWhitelist($this->files[0]); - - $this->assertEquals([], $this->filter->getWhitelist()); - } - - /** - * @covers SebastianBergmann\CodeCoverage\Filter::addDirectoryToWhitelist - * @covers SebastianBergmann\CodeCoverage\Filter::getWhitelist - * @depends testAddingAFileToTheWhitelistWorks - */ - public function testAddingADirectoryToTheWhitelistWorks(): void - { - $this->filter->addDirectoryToWhitelist(TEST_FILES_PATH); - - $whitelist = $this->filter->getWhitelist(); - \sort($whitelist); - - $this->assertEquals($this->files, $whitelist); - } - - /** - * @covers SebastianBergmann\CodeCoverage\Filter::addFilesToWhitelist - * @covers SebastianBergmann\CodeCoverage\Filter::getWhitelist - */ - public function testAddingFilesToTheWhitelistWorks(): void - { - $facade = new FileIteratorFacade; - - $files = $facade->getFilesAsArray( - TEST_FILES_PATH, - $suffixes = '.php' - ); - - $this->filter->addFilesToWhitelist($files); - - $whitelist = $this->filter->getWhitelist(); - \sort($whitelist); - - $this->assertEquals($this->files, $whitelist); - } - - /** - * @covers SebastianBergmann\CodeCoverage\Filter::removeDirectoryFromWhitelist - * @covers SebastianBergmann\CodeCoverage\Filter::getWhitelist - * @depends testAddingADirectoryToTheWhitelistWorks - */ - public function testRemovingADirectoryFromTheWhitelistWorks(): void - { - $this->filter->addDirectoryToWhitelist(TEST_FILES_PATH); - $this->filter->removeDirectoryFromWhitelist(TEST_FILES_PATH); - - $this->assertEquals([], $this->filter->getWhitelist()); - } - - /** - * @covers SebastianBergmann\CodeCoverage\Filter::isFile - */ - public function testIsFile(): void - { - $this->assertFalse($this->filter->isFile('vfs://root/a/path')); - $this->assertFalse($this->filter->isFile('xdebug://debug-eval')); - $this->assertFalse($this->filter->isFile('eval()\'d code')); - $this->assertFalse($this->filter->isFile('runtime-created function')); - $this->assertFalse($this->filter->isFile('assert code')); - $this->assertFalse($this->filter->isFile('regexp code')); - $this->assertTrue($this->filter->isFile(__FILE__)); - } - - /** - * @covers SebastianBergmann\CodeCoverage\Filter::isFiltered - */ - public function testWhitelistedFileIsNotFiltered(): void - { - $this->filter->addFileToWhitelist($this->files[0]); - $this->assertFalse($this->filter->isFiltered($this->files[0])); - } - - /** - * @covers SebastianBergmann\CodeCoverage\Filter::isFiltered - */ - public function testNotWhitelistedFileIsFiltered(): void - { - $this->filter->addFileToWhitelist($this->files[0]); - $this->assertTrue($this->filter->isFiltered($this->files[1])); - } - - /** - * @covers SebastianBergmann\CodeCoverage\Filter::isFiltered - * @covers SebastianBergmann\CodeCoverage\Filter::isFile - */ - public function testNonFilesAreFiltered(): void - { - $this->assertTrue($this->filter->isFiltered('vfs://root/a/path')); - $this->assertTrue($this->filter->isFiltered('xdebug://debug-eval')); - $this->assertTrue($this->filter->isFiltered('eval()\'d code')); - $this->assertTrue($this->filter->isFiltered('runtime-created function')); - $this->assertTrue($this->filter->isFiltered('assert code')); - $this->assertTrue($this->filter->isFiltered('regexp code')); - } - - /** - * @covers SebastianBergmann\CodeCoverage\Filter::addFileToWhitelist - * @covers SebastianBergmann\CodeCoverage\Filter::getWhitelist - * - * @ticket https://github.com/sebastianbergmann/php-code-coverage/issues/664 - */ - public function testTryingToAddFileThatDoesNotExistDoesNotChangeFilter(): void - { - $filter = new Filter; - - $filter->addFileToWhitelist('does_not_exist'); - - $this->assertEmpty($filter->getWhitelistedFiles()); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/tests/HTMLTest.php b/vendor/phpunit/php-code-coverage/tests/tests/HTMLTest.php deleted file mode 100644 index 0ddd85d..0000000 --- a/vendor/phpunit/php-code-coverage/tests/tests/HTMLTest.php +++ /dev/null @@ -1,102 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Report\Html; - -use SebastianBergmann\CodeCoverage\TestCase; - -class HTMLTest extends TestCase -{ - private static $TEST_REPORT_PATH_SOURCE; - - public static function setUpBeforeClass(): void - { - parent::setUpBeforeClass(); - - self::$TEST_REPORT_PATH_SOURCE = TEST_FILES_PATH . 'Report' . \DIRECTORY_SEPARATOR . 'HTML'; - } - - protected function tearDown(): void - { - parent::tearDown(); - - $tmpFilesIterator = new \RecursiveIteratorIterator( - new \RecursiveDirectoryIterator(self::$TEST_TMP_PATH, \RecursiveDirectoryIterator::SKIP_DOTS), - \RecursiveIteratorIterator::CHILD_FIRST - ); - - foreach ($tmpFilesIterator as $path => $fileInfo) { - /* @var \SplFileInfo $fileInfo */ - $pathname = $fileInfo->getPathname(); - $fileInfo->isDir() ? \rmdir($pathname) : \unlink($pathname); - } - } - - public function testForBankAccountTest(): void - { - $expectedFilesPath = self::$TEST_REPORT_PATH_SOURCE . \DIRECTORY_SEPARATOR . 'CoverageForBankAccount'; - - $report = new Facade; - $report->process($this->getCoverageForBankAccount(), self::$TEST_TMP_PATH); - - $this->assertFilesEquals($expectedFilesPath, self::$TEST_TMP_PATH); - } - - public function testForFileWithIgnoredLines(): void - { - $expectedFilesPath = self::$TEST_REPORT_PATH_SOURCE . \DIRECTORY_SEPARATOR . 'CoverageForFileWithIgnoredLines'; - - $report = new Facade; - $report->process($this->getCoverageForFileWithIgnoredLines(), self::$TEST_TMP_PATH); - - $this->assertFilesEquals($expectedFilesPath, self::$TEST_TMP_PATH); - } - - public function testForClassWithAnonymousFunction(): void - { - $expectedFilesPath = - self::$TEST_REPORT_PATH_SOURCE . \DIRECTORY_SEPARATOR . 'CoverageForClassWithAnonymousFunction'; - - $report = new Facade; - $report->process($this->getCoverageForClassWithAnonymousFunction(), self::$TEST_TMP_PATH); - - $this->assertFilesEquals($expectedFilesPath, self::$TEST_TMP_PATH); - } - - /** - * @param string $expectedFilesPath - * @param string $actualFilesPath - */ - private function assertFilesEquals($expectedFilesPath, $actualFilesPath): void - { - $expectedFilesIterator = new \FilesystemIterator($expectedFilesPath); - $actualFilesIterator = new \RegexIterator(new \FilesystemIterator($actualFilesPath), '/.html/'); - - $this->assertEquals( - \iterator_count($expectedFilesIterator), - \iterator_count($actualFilesIterator), - 'Generated files and expected files not match' - ); - - foreach ($expectedFilesIterator as $path => $fileInfo) { - /* @var \SplFileInfo $fileInfo */ - $filename = $fileInfo->getFilename(); - - $actualFile = $actualFilesPath . \DIRECTORY_SEPARATOR . $filename; - - $this->assertFileExists($actualFile); - - $this->assertStringMatchesFormatFile( - $fileInfo->getPathname(), - \str_replace(\PHP_EOL, "\n", \file_get_contents($actualFile)), - "${filename} not match" - ); - } - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/tests/TextTest.php b/vendor/phpunit/php-code-coverage/tests/tests/TextTest.php deleted file mode 100644 index 501226f..0000000 --- a/vendor/phpunit/php-code-coverage/tests/tests/TextTest.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Report; - -use SebastianBergmann\CodeCoverage\TestCase; - -/** - * @covers SebastianBergmann\CodeCoverage\Report\Text - */ -class TextTest extends TestCase -{ - public function testTextForBankAccountTest(): void - { - $text = new Text(50, 90, false, false); - - $this->assertStringMatchesFormatFile( - TEST_FILES_PATH . 'BankAccount-text.txt', - \str_replace(\PHP_EOL, "\n", $text->process($this->getCoverageForBankAccount())) - ); - } - - public function testTextForFileWithIgnoredLines(): void - { - $text = new Text(50, 90, false, false); - - $this->assertStringMatchesFormatFile( - TEST_FILES_PATH . 'ignored-lines-text.txt', - \str_replace(\PHP_EOL, "\n", $text->process($this->getCoverageForFileWithIgnoredLines())) - ); - } - - public function testTextForClassWithAnonymousFunction(): void - { - $text = new Text(50, 90, false, false); - - $this->assertStringMatchesFormatFile( - TEST_FILES_PATH . 'class-with-anonymous-function-text.txt', - \str_replace(\PHP_EOL, "\n", $text->process($this->getCoverageForClassWithAnonymousFunction())) - ); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/tests/UtilTest.php b/vendor/phpunit/php-code-coverage/tests/tests/UtilTest.php deleted file mode 100644 index 2ebfb61..0000000 --- a/vendor/phpunit/php-code-coverage/tests/tests/UtilTest.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage; - -use PHPUnit\Framework\TestCase; - -/** - * @covers SebastianBergmann\CodeCoverage\Util - */ -class UtilTest extends TestCase -{ - public function testPercent(): void - { - $this->assertEquals(100, Util::percent(100, 0)); - $this->assertEquals(100, Util::percent(100, 100)); - $this->assertEquals( - '100.00%', - Util::percent(100, 100, true) - ); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/tests/XmlTest.php b/vendor/phpunit/php-code-coverage/tests/tests/XmlTest.php deleted file mode 100644 index 13045a7..0000000 --- a/vendor/phpunit/php-code-coverage/tests/tests/XmlTest.php +++ /dev/null @@ -1,97 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Report\Xml; - -use SebastianBergmann\CodeCoverage\TestCase; - -class XmlTest extends TestCase -{ - private static $TEST_REPORT_PATH_SOURCE; - - public static function setUpBeforeClass(): void - { - parent::setUpBeforeClass(); - - self::$TEST_REPORT_PATH_SOURCE = TEST_FILES_PATH . 'Report' . \DIRECTORY_SEPARATOR . 'XML'; - } - - protected function tearDown(): void - { - parent::tearDown(); - - $tmpFilesIterator = new \FilesystemIterator(self::$TEST_TMP_PATH); - - foreach ($tmpFilesIterator as $path => $fileInfo) { - /* @var \SplFileInfo $fileInfo */ - \unlink($fileInfo->getPathname()); - } - } - - public function testForBankAccountTest(): void - { - $expectedFilesPath = self::$TEST_REPORT_PATH_SOURCE . \DIRECTORY_SEPARATOR . 'CoverageForBankAccount'; - - $xml = new Facade('1.0.0'); - $xml->process($this->getCoverageForBankAccount(), self::$TEST_TMP_PATH); - - $this->assertFilesEquals($expectedFilesPath, self::$TEST_TMP_PATH); - } - - public function testForFileWithIgnoredLines(): void - { - $expectedFilesPath = self::$TEST_REPORT_PATH_SOURCE . \DIRECTORY_SEPARATOR . 'CoverageForFileWithIgnoredLines'; - - $xml = new Facade('1.0.0'); - $xml->process($this->getCoverageForFileWithIgnoredLines(), self::$TEST_TMP_PATH); - - $this->assertFilesEquals($expectedFilesPath, self::$TEST_TMP_PATH); - } - - public function testForClassWithAnonymousFunction(): void - { - $expectedFilesPath = self::$TEST_REPORT_PATH_SOURCE . \DIRECTORY_SEPARATOR . 'CoverageForClassWithAnonymousFunction'; - - $xml = new Facade('1.0.0'); - $xml->process($this->getCoverageForClassWithAnonymousFunction(), self::$TEST_TMP_PATH); - - $this->assertFilesEquals($expectedFilesPath, self::$TEST_TMP_PATH); - } - - /** - * @param string $expectedFilesPath - * @param string $actualFilesPath - */ - private function assertFilesEquals($expectedFilesPath, $actualFilesPath): void - { - $expectedFilesIterator = new \FilesystemIterator($expectedFilesPath); - $actualFilesIterator = new \FilesystemIterator($actualFilesPath); - - $this->assertEquals( - \iterator_count($expectedFilesIterator), - \iterator_count($actualFilesIterator), - 'Generated files and expected files not match' - ); - - foreach ($expectedFilesIterator as $path => $fileInfo) { - /* @var \SplFileInfo $fileInfo */ - $filename = $fileInfo->getFilename(); - - $actualFile = $actualFilesPath . \DIRECTORY_SEPARATOR . $filename; - - $this->assertFileExists($actualFile); - - $this->assertStringMatchesFormatFile( - $fileInfo->getPathname(), - \file_get_contents($actualFile), - "${filename} not match" - ); - } - } -} diff --git a/vendor/phpunit/php-file-iterator/.gitattributes b/vendor/phpunit/php-file-iterator/.gitattributes deleted file mode 100644 index 461090b..0000000 --- a/vendor/phpunit/php-file-iterator/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.php diff=php diff --git a/vendor/phpunit/php-file-iterator/.github/stale.yml b/vendor/phpunit/php-file-iterator/.github/stale.yml deleted file mode 100644 index 4eadca3..0000000 --- a/vendor/phpunit/php-file-iterator/.github/stale.yml +++ /dev/null @@ -1,40 +0,0 @@ -# Configuration for probot-stale - https://github.com/probot/stale - -# Number of days of inactivity before an Issue or Pull Request becomes stale -daysUntilStale: 60 - -# Number of days of inactivity before a stale Issue or Pull Request is closed. -# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale. -daysUntilClose: 7 - -# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable -exemptLabels: - - enhancement - -# Set to true to ignore issues in a project (defaults to false) -exemptProjects: false - -# Set to true to ignore issues in a milestone (defaults to false) -exemptMilestones: false - -# Label to use when marking as stale -staleLabel: stale - -# Comment to post when marking as stale. Set to `false` to disable -markComment: > - This issue has been automatically marked as stale because it has not had activity within the last 60 days. It will be closed after 7 days if no further activity occurs. Thank you for your contributions. - -# Comment to post when removing the stale label. -# unmarkComment: > -# Your comment here. - -# Comment to post when closing a stale Issue or Pull Request. -closeComment: > - This issue has been automatically closed because it has not had activity since it was marked as stale. Thank you for your contributions. - -# Limit the number of actions per hour, from 1-30. Default is 30 -limitPerRun: 30 - -# Limit to only `issues` or `pulls` -only: issues - diff --git a/vendor/phpunit/php-file-iterator/.gitignore b/vendor/phpunit/php-file-iterator/.gitignore deleted file mode 100644 index 5ad7a64..0000000 --- a/vendor/phpunit/php-file-iterator/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -/.idea -/vendor/ -/.php_cs -/.php_cs.cache -/composer.lock diff --git a/vendor/phpunit/php-file-iterator/.php_cs.dist b/vendor/phpunit/php-file-iterator/.php_cs.dist deleted file mode 100644 index efc649f..0000000 --- a/vendor/phpunit/php-file-iterator/.php_cs.dist +++ /dev/null @@ -1,168 +0,0 @@ - - -For the full copyright and license information, please view the LICENSE -file that was distributed with this source code. -EOF; - -return PhpCsFixer\Config::create() - ->setRiskyAllowed(true) - ->setRules( - [ - 'array_syntax' => ['syntax' => 'short'], - 'binary_operator_spaces' => [ - 'operators' => [ - '=' => 'align', - '=>' => 'align', - ], - ], - 'blank_line_after_namespace' => true, - 'blank_line_before_statement' => [ - 'statements' => [ - 'break', - 'continue', - 'declare', - 'do', - 'for', - 'foreach', - 'if', - 'include', - 'include_once', - 'require', - 'require_once', - 'return', - 'switch', - 'throw', - 'try', - 'while', - 'yield', - ], - ], - 'braces' => true, - 'cast_spaces' => true, - 'class_attributes_separation' => ['elements' => ['method']], - 'compact_nullable_typehint' => true, - 'concat_space' => ['spacing' => 'one'], - 'declare_equal_normalize' => ['space' => 'none'], - 'dir_constant' => true, - 'elseif' => true, - 'encoding' => true, - 'full_opening_tag' => true, - 'function_declaration' => true, - 'header_comment' => ['header' => $header, 'separate' => 'none'], - 'indentation_type' => true, - 'line_ending' => true, - 'list_syntax' => ['syntax' => 'short'], - 'lowercase_cast' => true, - 'lowercase_constants' => true, - 'lowercase_keywords' => true, - 'magic_constant_casing' => true, - 'method_argument_space' => ['ensure_fully_multiline' => true], - 'modernize_types_casting' => true, - 'native_function_casing' => true, - 'native_function_invocation' => true, - 'no_alias_functions' => true, - 'no_blank_lines_after_class_opening' => true, - 'no_blank_lines_after_phpdoc' => true, - 'no_closing_tag' => true, - 'no_empty_comment' => true, - 'no_empty_phpdoc' => true, - 'no_empty_statement' => true, - 'no_extra_blank_lines' => true, - 'no_homoglyph_names' => true, - 'no_leading_import_slash' => true, - 'no_leading_namespace_whitespace' => true, - 'no_mixed_echo_print' => ['use' => 'print'], - 'no_null_property_initialization' => true, - 'no_short_bool_cast' => true, - 'no_short_echo_tag' => true, - 'no_singleline_whitespace_before_semicolons' => true, - 'no_spaces_after_function_name' => true, - 'no_spaces_inside_parenthesis' => true, - 'no_superfluous_elseif' => true, - 'no_trailing_comma_in_list_call' => true, - 'no_trailing_comma_in_singleline_array' => true, - 'no_trailing_whitespace' => true, - 'no_trailing_whitespace_in_comment' => true, - 'no_unneeded_control_parentheses' => true, - 'no_unneeded_curly_braces' => true, - 'no_unneeded_final_method' => true, - 'no_unreachable_default_argument_value' => true, - 'no_unused_imports' => true, - 'no_useless_else' => true, - 'no_whitespace_before_comma_in_array' => true, - 'no_whitespace_in_blank_line' => true, - 'non_printable_character' => true, - 'normalize_index_brace' => true, - 'object_operator_without_whitespace' => true, - 'ordered_class_elements' => [ - 'order' => [ - 'use_trait', - 'constant_public', - 'constant_protected', - 'constant_private', - 'property_public_static', - 'property_protected_static', - 'property_private_static', - 'property_public', - 'property_protected', - 'property_private', - 'method_public_static', - 'construct', - 'destruct', - 'magic', - 'phpunit', - 'method_public', - 'method_protected', - 'method_private', - 'method_protected_static', - 'method_private_static', - ], - ], - 'ordered_imports' => true, - 'phpdoc_add_missing_param_annotation' => true, - 'phpdoc_align' => true, - 'phpdoc_annotation_without_dot' => true, - 'phpdoc_indent' => true, - 'phpdoc_no_access' => true, - 'phpdoc_no_empty_return' => true, - 'phpdoc_no_package' => true, - 'phpdoc_order' => true, - 'phpdoc_return_self_reference' => true, - 'phpdoc_scalar' => true, - 'phpdoc_separation' => true, - 'phpdoc_single_line_var_spacing' => true, - 'phpdoc_to_comment' => true, - 'phpdoc_trim' => true, - 'phpdoc_types' => true, - 'phpdoc_types_order' => true, - 'phpdoc_var_without_name' => true, - 'pow_to_exponentiation' => true, - 'protected_to_private' => true, - 'return_type_declaration' => ['space_before' => 'none'], - 'self_accessor' => true, - 'short_scalar_cast' => true, - 'simplified_null_return' => true, - 'single_blank_line_at_eof' => true, - 'single_import_per_statement' => true, - 'single_line_after_imports' => true, - 'single_quote' => true, - 'standardize_not_equals' => true, - 'ternary_to_null_coalescing' => true, - 'trim_array_spaces' => true, - 'unary_operator_spaces' => true, - 'visibility_required' => true, - 'void_return' => true, - 'whitespace_after_comma_in_array' => true, - ] - ) - ->setFinder( - PhpCsFixer\Finder::create() - ->files() - ->in(__DIR__ . '/src') - ->in(__DIR__ . '/tests') - ->notName('*.phpt') - ); diff --git a/vendor/phpunit/php-file-iterator/.travis.yml b/vendor/phpunit/php-file-iterator/.travis.yml deleted file mode 100644 index 16b399c..0000000 --- a/vendor/phpunit/php-file-iterator/.travis.yml +++ /dev/null @@ -1,32 +0,0 @@ -language: php - -sudo: false - -php: - - 7.1 - - 7.2 - - master - -env: - matrix: - - DEPENDENCIES="high" - - DEPENDENCIES="low" - global: - - DEFAULT_COMPOSER_FLAGS="--no-interaction --no-ansi --no-progress --no-suggest" - -before_install: - - composer self-update - - composer clear-cache - -install: - - if [[ "$DEPENDENCIES" = 'high' ]]; then travis_retry composer update $DEFAULT_COMPOSER_FLAGS; fi - - if [[ "$DEPENDENCIES" = 'low' ]]; then travis_retry composer update $DEFAULT_COMPOSER_FLAGS --prefer-lowest; fi - -script: - - ./vendor/bin/phpunit --coverage-clover=coverage.xml - -after_success: - - bash <(curl -s https://codecov.io/bash) - -notifications: - email: false diff --git a/vendor/phpunit/php-file-iterator/ChangeLog.md b/vendor/phpunit/php-file-iterator/ChangeLog.md deleted file mode 100644 index 9accca3..0000000 --- a/vendor/phpunit/php-file-iterator/ChangeLog.md +++ /dev/null @@ -1,95 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). - -## [2.0.5] - 2021-12-02 - -### Changed - -* [#73](https://github.com/sebastianbergmann/php-file-iterator/pull/73): Micro performance improvements on parsing paths - -### Fixed - -* [#74](https://github.com/sebastianbergmann/php-file-iterator/pull/74): Document return type of `SebastianBergmann\FileIterator\Iterator::accept()` so that Symfony's `DebugClassLoader` does not trigger a deprecation warning - -## [2.0.4] - 2021-07-19 - -### Changed - -* Added `ReturnTypeWillChange` attribute to `SebastianBergmann\FileIterator\Iterator::accept()` because the return type of `\FilterIterator::accept()` will change in PHP 8.1 - -## [2.0.3] - 2020-11-30 - -### Changed - -* Changed PHP version constraint in `composer.json` from `^7.1` to `>=7.1` - -## [2.0.2] - 2018-09-13 - -### Fixed - -* [#48](https://github.com/sebastianbergmann/php-file-iterator/issues/48): Excluding an array that contains false ends up excluding the current working directory - -## [2.0.1] - 2018-06-11 - -### Fixed - -* [#46](https://github.com/sebastianbergmann/php-file-iterator/issues/46): Regression with hidden parent directory - -## [2.0.0] - 2018-05-28 - -### Fixed - -* [#30](https://github.com/sebastianbergmann/php-file-iterator/issues/30): Exclude is not considered if it is a parent of the base path - -### Changed - -* This component now uses namespaces - -### Removed - -* This component is no longer supported on PHP 5.3, PHP 5.4, PHP 5.5, PHP 5.6, and PHP 7.0 - -## [1.4.5] - 2017-11-27 - -### Fixed - -* [#37](https://github.com/sebastianbergmann/php-file-iterator/issues/37): Regression caused by fix for [#30](https://github.com/sebastianbergmann/php-file-iterator/issues/30) - -## [1.4.4] - 2017-11-27 - -### Fixed - -* [#30](https://github.com/sebastianbergmann/php-file-iterator/issues/30): Exclude is not considered if it is a parent of the base path - -## [1.4.3] - 2017-11-25 - -### Fixed - -* [#34](https://github.com/sebastianbergmann/php-file-iterator/issues/34): Factory should use canonical directory names - -## [1.4.2] - 2016-11-26 - -No changes - -## [1.4.1] - 2015-07-26 - -No changes - -## 1.4.0 - 2015-04-02 - -### Added - -* [Added support for wildcards (glob) in exclude](https://github.com/sebastianbergmann/php-file-iterator/pull/23) - -[2.0.5]: https://github.com/sebastianbergmann/php-file-iterator/compare/2.0.4...2.0.5 -[2.0.4]: https://github.com/sebastianbergmann/php-file-iterator/compare/2.0.3...2.0.4 -[2.0.3]: https://github.com/sebastianbergmann/php-file-iterator/compare/2.0.2...2.0.3 -[2.0.2]: https://github.com/sebastianbergmann/php-file-iterator/compare/2.0.1...2.0.2 -[2.0.1]: https://github.com/sebastianbergmann/php-file-iterator/compare/2.0.0...2.0.1 -[2.0.0]: https://github.com/sebastianbergmann/php-file-iterator/compare/1.4...2.0.0 -[1.4.5]: https://github.com/sebastianbergmann/php-file-iterator/compare/1.4.4...1.4.5 -[1.4.4]: https://github.com/sebastianbergmann/php-file-iterator/compare/1.4.3...1.4.4 -[1.4.3]: https://github.com/sebastianbergmann/php-file-iterator/compare/1.4.2...1.4.3 -[1.4.2]: https://github.com/sebastianbergmann/php-file-iterator/compare/1.4.1...1.4.2 -[1.4.1]: https://github.com/sebastianbergmann/php-file-iterator/compare/1.4.0...1.4.1 diff --git a/vendor/phpunit/php-file-iterator/LICENSE b/vendor/phpunit/php-file-iterator/LICENSE deleted file mode 100644 index 87c3b51..0000000 --- a/vendor/phpunit/php-file-iterator/LICENSE +++ /dev/null @@ -1,33 +0,0 @@ -php-file-iterator - -Copyright (c) 2009-2018, Sebastian Bergmann . -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Sebastian Bergmann nor the names of his - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/phpunit/php-file-iterator/README.md b/vendor/phpunit/php-file-iterator/README.md deleted file mode 100644 index 3cbfdaa..0000000 --- a/vendor/phpunit/php-file-iterator/README.md +++ /dev/null @@ -1,14 +0,0 @@ -[![Build Status](https://travis-ci.org/sebastianbergmann/php-file-iterator.svg?branch=master)](https://travis-ci.org/sebastianbergmann/php-file-iterator) - -# php-file-iterator - -## Installation - -You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): - - composer require phpunit/php-file-iterator - -If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: - - composer require --dev phpunit/php-file-iterator - diff --git a/vendor/phpunit/php-file-iterator/composer.json b/vendor/phpunit/php-file-iterator/composer.json deleted file mode 100644 index b1717b8..0000000 --- a/vendor/phpunit/php-file-iterator/composer.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "phpunit/php-file-iterator", - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "type": "library", - "keywords": [ - "iterator", - "filesystem" - ], - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "^8.5" - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - } -} diff --git a/vendor/phpunit/php-file-iterator/phpunit.xml b/vendor/phpunit/php-file-iterator/phpunit.xml deleted file mode 100644 index 3e12be4..0000000 --- a/vendor/phpunit/php-file-iterator/phpunit.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - tests - - - - - - src - - - diff --git a/vendor/phpunit/php-file-iterator/src/Facade.php b/vendor/phpunit/php-file-iterator/src/Facade.php deleted file mode 100644 index 2456e16..0000000 --- a/vendor/phpunit/php-file-iterator/src/Facade.php +++ /dev/null @@ -1,112 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\FileIterator; - -class Facade -{ - /** - * @param array|string $paths - * @param array|string $suffixes - * @param array|string $prefixes - * @param array $exclude - * @param bool $commonPath - * - * @return array - */ - public function getFilesAsArray($paths, $suffixes = '', $prefixes = '', array $exclude = [], bool $commonPath = false): array - { - if (\is_string($paths)) { - $paths = [$paths]; - } - - $factory = new Factory; - - $iterator = $factory->getFileIterator($paths, $suffixes, $prefixes, $exclude); - - $files = []; - - foreach ($iterator as $file) { - $file = $file->getRealPath(); - - if ($file) { - $files[] = $file; - } - } - - foreach ($paths as $path) { - if (\is_file($path)) { - $files[] = \realpath($path); - } - } - - $files = \array_unique($files); - \sort($files); - - if ($commonPath) { - return [ - 'commonPath' => $this->getCommonPath($files), - 'files' => $files - ]; - } - - return $files; - } - - protected function getCommonPath(array $files): string - { - $count = \count($files); - - if ($count === 0) { - return ''; - } - - if ($count === 1) { - return \dirname($files[0]) . DIRECTORY_SEPARATOR; - } - - $_files = []; - - foreach ($files as $file) { - $_files[] = $_fileParts = \explode(DIRECTORY_SEPARATOR, $file); - - if (empty($_fileParts[0])) { - $_fileParts[0] = DIRECTORY_SEPARATOR; - } - } - - $common = ''; - $done = false; - $j = 0; - $count--; - - while (!$done) { - for ($i = 0; $i < $count; $i++) { - if ($_files[$i][$j] != $_files[$i + 1][$j]) { - $done = true; - - break; - } - } - - if (!$done) { - $common .= $_files[0][$j]; - - if ($j > 0) { - $common .= DIRECTORY_SEPARATOR; - } - } - - $j++; - } - - return DIRECTORY_SEPARATOR . $common; - } -} diff --git a/vendor/phpunit/php-file-iterator/src/Factory.php b/vendor/phpunit/php-file-iterator/src/Factory.php deleted file mode 100644 index 9172ad7..0000000 --- a/vendor/phpunit/php-file-iterator/src/Factory.php +++ /dev/null @@ -1,83 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\FileIterator; - -class Factory -{ - /** - * @param array|string $paths - * @param array|string $suffixes - * @param array|string $prefixes - * @param array $exclude - * - * @return \AppendIterator - */ - public function getFileIterator($paths, $suffixes = '', $prefixes = '', array $exclude = []): \AppendIterator - { - if (\is_string($paths)) { - $paths = [$paths]; - } - - $paths = $this->getPathsAfterResolvingWildcards($paths); - $exclude = $this->getPathsAfterResolvingWildcards($exclude); - - if (\is_string($prefixes)) { - if ($prefixes !== '') { - $prefixes = [$prefixes]; - } else { - $prefixes = []; - } - } - - if (\is_string($suffixes)) { - if ($suffixes !== '') { - $suffixes = [$suffixes]; - } else { - $suffixes = []; - } - } - - $iterator = new \AppendIterator; - - foreach ($paths as $path) { - if (\is_dir($path)) { - $iterator->append( - new Iterator( - $path, - new \RecursiveIteratorIterator( - new \RecursiveDirectoryIterator($path, \RecursiveDirectoryIterator::FOLLOW_SYMLINKS | \RecursiveDirectoryIterator::SKIP_DOTS) - ), - $suffixes, - $prefixes, - $exclude - ) - ); - } - } - - return $iterator; - } - - protected function getPathsAfterResolvingWildcards(array $paths): array - { - $_paths = [[]]; - - foreach ($paths as $path) { - if ($locals = \glob($path, GLOB_ONLYDIR)) { - $_paths[] = \array_map('\realpath', $locals); - } else { - $_paths[] = [\realpath($path)]; - } - } - - return \array_filter(\array_merge(...$_paths)); - } -} diff --git a/vendor/phpunit/php-file-iterator/src/Iterator.php b/vendor/phpunit/php-file-iterator/src/Iterator.php deleted file mode 100644 index 4f7127d..0000000 --- a/vendor/phpunit/php-file-iterator/src/Iterator.php +++ /dev/null @@ -1,116 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\FileIterator; - -class Iterator extends \FilterIterator -{ - const PREFIX = 0; - const SUFFIX = 1; - - /** - * @var string - */ - private $basePath; - - /** - * @var array - */ - private $suffixes = []; - - /** - * @var array - */ - private $prefixes = []; - - /** - * @var array - */ - private $exclude = []; - - /** - * @param string $basePath - * @param \Iterator $iterator - * @param array $suffixes - * @param array $prefixes - * @param array $exclude - */ - public function __construct(string $basePath, \Iterator $iterator, array $suffixes = [], array $prefixes = [], array $exclude = []) - { - $this->basePath = \realpath($basePath); - $this->prefixes = $prefixes; - $this->suffixes = $suffixes; - $this->exclude = \array_filter(\array_map('realpath', $exclude)); - - parent::__construct($iterator); - } - - /** - * @return bool - */ - #[\ReturnTypeWillChange] - public function accept() - { - $current = $this->getInnerIterator()->current(); - $filename = $current->getFilename(); - $realPath = $current->getRealPath(); - - return $this->acceptPath($realPath) && - $this->acceptPrefix($filename) && - $this->acceptSuffix($filename); - } - - private function acceptPath(string $path): bool - { - // Filter files in hidden directories by checking path that is relative to the base path. - if (\preg_match('=/\.[^/]*/=', \str_replace($this->basePath, '', $path))) { - return false; - } - - foreach ($this->exclude as $exclude) { - if (\strpos($path, $exclude) === 0) { - return false; - } - } - - return true; - } - - private function acceptPrefix(string $filename): bool - { - return $this->acceptSubString($filename, $this->prefixes, self::PREFIX); - } - - private function acceptSuffix(string $filename): bool - { - return $this->acceptSubString($filename, $this->suffixes, self::SUFFIX); - } - - private function acceptSubString(string $filename, array $subStrings, int $type): bool - { - if (empty($subStrings)) { - return true; - } - - $matched = false; - - foreach ($subStrings as $string) { - if (($type === self::PREFIX && \strpos($filename, $string) === 0) || - ($type === self::SUFFIX && - \substr($filename, -1 * \strlen($string)) === $string)) { - $matched = true; - - break; - } - } - - return $matched; - } -} diff --git a/vendor/phpunit/php-file-iterator/tests/FactoryTest.php b/vendor/phpunit/php-file-iterator/tests/FactoryTest.php deleted file mode 100644 index ba4bdbf..0000000 --- a/vendor/phpunit/php-file-iterator/tests/FactoryTest.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\FileIterator; - -use PHPUnit\Framework\TestCase; - -/** - * @covers \SebastianBergmann\FileIterator\Factory - */ -class FactoryTest extends TestCase -{ - /** - * @var string - */ - private $root; - - /** - * @var Factory - */ - private $factory; - - protected function setUp(): void - { - $this->root = __DIR__; - $this->factory = new Factory; - } - - public function testFindFilesInTestDirectory(): void - { - $iterator = $this->factory->getFileIterator($this->root, 'Test.php'); - $files = \iterator_to_array($iterator); - - $this->assertGreaterThanOrEqual(1, \count($files)); - } - - public function testFindFilesWithExcludedNonExistingSubdirectory(): void - { - $iterator = $this->factory->getFileIterator($this->root, 'Test.php', '', [$this->root . '/nonExistingDir']); - $files = \iterator_to_array($iterator); - - $this->assertGreaterThanOrEqual(1, \count($files)); - } -} diff --git a/vendor/phpunit/php-text-template/.gitattributes b/vendor/phpunit/php-text-template/.gitattributes deleted file mode 100644 index 461090b..0000000 --- a/vendor/phpunit/php-text-template/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.php diff=php diff --git a/vendor/phpunit/php-text-template/.gitignore b/vendor/phpunit/php-text-template/.gitignore deleted file mode 100644 index c599212..0000000 --- a/vendor/phpunit/php-text-template/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -/composer.lock -/composer.phar -/.idea -/vendor - diff --git a/vendor/phpunit/php-text-template/LICENSE b/vendor/phpunit/php-text-template/LICENSE deleted file mode 100644 index 9f9a32d..0000000 --- a/vendor/phpunit/php-text-template/LICENSE +++ /dev/null @@ -1,33 +0,0 @@ -Text_Template - -Copyright (c) 2009-2015, Sebastian Bergmann . -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Sebastian Bergmann nor the names of his - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/phpunit/php-text-template/README.md b/vendor/phpunit/php-text-template/README.md deleted file mode 100644 index ec8f593..0000000 --- a/vendor/phpunit/php-text-template/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# Text_Template - -## Installation - -## Installation - -To add this package as a local, per-project dependency to your project, simply add a dependency on `phpunit/php-text-template` to your project's `composer.json` file. Here is a minimal example of a `composer.json` file that just defines a dependency on Text_Template: - - { - "require": { - "phpunit/php-text-template": "~1.2" - } - } - diff --git a/vendor/phpunit/php-text-template/composer.json b/vendor/phpunit/php-text-template/composer.json deleted file mode 100644 index a5779c8..0000000 --- a/vendor/phpunit/php-text-template/composer.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "phpunit/php-text-template", - "description": "Simple template engine.", - "type": "library", - "keywords": [ - "template" - ], - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-text-template/issues" - }, - "require": { - "php": ">=5.3.3" - }, - "autoload": { - "classmap": [ - "src/" - ] - } -} - diff --git a/vendor/phpunit/php-text-template/src/Template.php b/vendor/phpunit/php-text-template/src/Template.php deleted file mode 100644 index 9eb39ad..0000000 --- a/vendor/phpunit/php-text-template/src/Template.php +++ /dev/null @@ -1,135 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * A simple template engine. - * - * @since Class available since Release 1.0.0 - */ -class Text_Template -{ - /** - * @var string - */ - protected $template = ''; - - /** - * @var string - */ - protected $openDelimiter = '{'; - - /** - * @var string - */ - protected $closeDelimiter = '}'; - - /** - * @var array - */ - protected $values = array(); - - /** - * Constructor. - * - * @param string $file - * @throws InvalidArgumentException - */ - public function __construct($file = '', $openDelimiter = '{', $closeDelimiter = '}') - { - $this->setFile($file); - $this->openDelimiter = $openDelimiter; - $this->closeDelimiter = $closeDelimiter; - } - - /** - * Sets the template file. - * - * @param string $file - * @throws InvalidArgumentException - */ - public function setFile($file) - { - $distFile = $file . '.dist'; - - if (file_exists($file)) { - $this->template = file_get_contents($file); - } - - else if (file_exists($distFile)) { - $this->template = file_get_contents($distFile); - } - - else { - throw new InvalidArgumentException( - 'Template file could not be loaded.' - ); - } - } - - /** - * Sets one or more template variables. - * - * @param array $values - * @param bool $merge - */ - public function setVar(array $values, $merge = TRUE) - { - if (!$merge || empty($this->values)) { - $this->values = $values; - } else { - $this->values = array_merge($this->values, $values); - } - } - - /** - * Renders the template and returns the result. - * - * @return string - */ - public function render() - { - $keys = array(); - - foreach ($this->values as $key => $value) { - $keys[] = $this->openDelimiter . $key . $this->closeDelimiter; - } - - return str_replace($keys, $this->values, $this->template); - } - - /** - * Renders the template and writes the result to a file. - * - * @param string $target - */ - public function renderTo($target) - { - $fp = @fopen($target, 'wt'); - - if ($fp) { - fwrite($fp, $this->render()); - fclose($fp); - } else { - $error = error_get_last(); - - throw new RuntimeException( - sprintf( - 'Could not write to %s: %s', - $target, - substr( - $error['message'], - strpos($error['message'], ':') + 2 - ) - ) - ); - } - } -} - diff --git a/vendor/phpunit/php-timer/.gitattributes b/vendor/phpunit/php-timer/.gitattributes deleted file mode 100644 index 461090b..0000000 --- a/vendor/phpunit/php-timer/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.php diff=php diff --git a/vendor/phpunit/php-timer/.github/FUNDING.yml b/vendor/phpunit/php-timer/.github/FUNDING.yml deleted file mode 100644 index b19ea81..0000000 --- a/vendor/phpunit/php-timer/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -patreon: s_bergmann diff --git a/vendor/phpunit/php-timer/.github/stale.yml b/vendor/phpunit/php-timer/.github/stale.yml deleted file mode 100644 index 4eadca3..0000000 --- a/vendor/phpunit/php-timer/.github/stale.yml +++ /dev/null @@ -1,40 +0,0 @@ -# Configuration for probot-stale - https://github.com/probot/stale - -# Number of days of inactivity before an Issue or Pull Request becomes stale -daysUntilStale: 60 - -# Number of days of inactivity before a stale Issue or Pull Request is closed. -# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale. -daysUntilClose: 7 - -# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable -exemptLabels: - - enhancement - -# Set to true to ignore issues in a project (defaults to false) -exemptProjects: false - -# Set to true to ignore issues in a milestone (defaults to false) -exemptMilestones: false - -# Label to use when marking as stale -staleLabel: stale - -# Comment to post when marking as stale. Set to `false` to disable -markComment: > - This issue has been automatically marked as stale because it has not had activity within the last 60 days. It will be closed after 7 days if no further activity occurs. Thank you for your contributions. - -# Comment to post when removing the stale label. -# unmarkComment: > -# Your comment here. - -# Comment to post when closing a stale Issue or Pull Request. -closeComment: > - This issue has been automatically closed because it has not had activity since it was marked as stale. Thank you for your contributions. - -# Limit the number of actions per hour, from 1-30. Default is 30 -limitPerRun: 30 - -# Limit to only `issues` or `pulls` -only: issues - diff --git a/vendor/phpunit/php-timer/.gitignore b/vendor/phpunit/php-timer/.gitignore deleted file mode 100644 index 953d2a2..0000000 --- a/vendor/phpunit/php-timer/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -/.idea -/.php_cs.cache -/vendor -/composer.lock - diff --git a/vendor/phpunit/php-timer/.php_cs.dist b/vendor/phpunit/php-timer/.php_cs.dist deleted file mode 100644 index c442264..0000000 --- a/vendor/phpunit/php-timer/.php_cs.dist +++ /dev/null @@ -1,197 +0,0 @@ - - -For the full copyright and license information, please view the LICENSE -file that was distributed with this source code. -EOF; - -return PhpCsFixer\Config::create() - ->setRiskyAllowed(true) - ->setRules( - [ - 'align_multiline_comment' => true, - 'array_indentation' => true, - 'array_syntax' => ['syntax' => 'short'], - 'binary_operator_spaces' => [ - 'operators' => [ - '=' => 'align', - '=>' => 'align', - ], - ], - 'blank_line_after_namespace' => true, - 'blank_line_before_statement' => [ - 'statements' => [ - 'break', - 'continue', - 'declare', - 'do', - 'for', - 'foreach', - 'if', - 'include', - 'include_once', - 'require', - 'require_once', - 'return', - 'switch', - 'throw', - 'try', - 'while', - 'yield', - ], - ], - 'braces' => true, - 'cast_spaces' => true, - 'class_attributes_separation' => ['elements' => ['const', 'method', 'property']], - 'combine_consecutive_issets' => true, - 'combine_consecutive_unsets' => true, - 'compact_nullable_typehint' => true, - 'concat_space' => ['spacing' => 'one'], - 'declare_equal_normalize' => ['space' => 'none'], - 'declare_strict_types' => true, - 'dir_constant' => true, - 'elseif' => true, - 'encoding' => true, - 'full_opening_tag' => true, - 'function_declaration' => true, - 'header_comment' => ['header' => $header, 'separate' => 'none'], - 'indentation_type' => true, - 'is_null' => true, - 'line_ending' => true, - 'list_syntax' => ['syntax' => 'short'], - 'logical_operators' => true, - 'lowercase_cast' => true, - 'lowercase_constants' => true, - 'lowercase_keywords' => true, - 'lowercase_static_reference' => true, - 'magic_constant_casing' => true, - 'method_argument_space' => ['ensure_fully_multiline' => true], - 'modernize_types_casting' => true, - 'multiline_comment_opening_closing' => true, - 'multiline_whitespace_before_semicolons' => true, - 'native_constant_invocation' => true, - 'native_function_casing' => true, - 'native_function_invocation' => true, - 'new_with_braces' => false, - 'no_alias_functions' => true, - 'no_alternative_syntax' => true, - 'no_blank_lines_after_class_opening' => true, - 'no_blank_lines_after_phpdoc' => true, - 'no_blank_lines_before_namespace' => true, - 'no_closing_tag' => true, - 'no_empty_comment' => true, - 'no_empty_phpdoc' => true, - 'no_empty_statement' => true, - 'no_extra_blank_lines' => true, - 'no_homoglyph_names' => true, - 'no_leading_import_slash' => true, - 'no_leading_namespace_whitespace' => true, - 'no_mixed_echo_print' => ['use' => 'print'], - 'no_multiline_whitespace_around_double_arrow' => true, - 'no_null_property_initialization' => true, - 'no_php4_constructor' => true, - 'no_short_bool_cast' => true, - 'no_short_echo_tag' => true, - 'no_singleline_whitespace_before_semicolons' => true, - 'no_spaces_after_function_name' => true, - 'no_spaces_inside_parenthesis' => true, - 'no_superfluous_elseif' => true, - 'no_superfluous_phpdoc_tags' => true, - 'no_trailing_comma_in_list_call' => true, - 'no_trailing_comma_in_singleline_array' => true, - 'no_trailing_whitespace' => true, - 'no_trailing_whitespace_in_comment' => true, - 'no_unneeded_control_parentheses' => true, - 'no_unneeded_curly_braces' => true, - 'no_unneeded_final_method' => true, - 'no_unreachable_default_argument_value' => true, - 'no_unset_on_property' => true, - 'no_unused_imports' => true, - 'no_useless_else' => true, - 'no_useless_return' => true, - 'no_whitespace_before_comma_in_array' => true, - 'no_whitespace_in_blank_line' => true, - 'non_printable_character' => true, - 'normalize_index_brace' => true, - 'object_operator_without_whitespace' => true, - 'ordered_class_elements' => [ - 'order' => [ - 'use_trait', - 'constant_public', - 'constant_protected', - 'constant_private', - 'property_public_static', - 'property_protected_static', - 'property_private_static', - 'property_public', - 'property_protected', - 'property_private', - 'method_public_static', - 'construct', - 'destruct', - 'magic', - 'phpunit', - 'method_public', - 'method_protected', - 'method_private', - 'method_protected_static', - 'method_private_static', - ], - ], - 'ordered_imports' => true, - 'phpdoc_add_missing_param_annotation' => true, - 'phpdoc_align' => true, - 'phpdoc_annotation_without_dot' => true, - 'phpdoc_indent' => true, - 'phpdoc_no_access' => true, - 'phpdoc_no_empty_return' => true, - 'phpdoc_no_package' => true, - 'phpdoc_order' => true, - 'phpdoc_return_self_reference' => true, - 'phpdoc_scalar' => true, - 'phpdoc_separation' => true, - 'phpdoc_single_line_var_spacing' => true, - 'phpdoc_to_comment' => true, - 'phpdoc_trim' => true, - 'phpdoc_trim_consecutive_blank_line_separation' => true, - 'phpdoc_types' => ['groups' => ['simple', 'meta']], - 'phpdoc_types_order' => true, - 'phpdoc_var_without_name' => true, - 'pow_to_exponentiation' => true, - 'protected_to_private' => true, - 'return_assignment' => true, - 'return_type_declaration' => ['space_before' => 'none'], - 'self_accessor' => true, - 'semicolon_after_instruction' => true, - 'set_type_to_cast' => true, - 'short_scalar_cast' => true, - 'simplified_null_return' => true, - 'single_blank_line_at_eof' => true, - 'single_import_per_statement' => true, - 'single_line_after_imports' => true, - 'single_quote' => true, - 'standardize_not_equals' => true, - 'ternary_to_null_coalescing' => true, - 'trailing_comma_in_multiline_array' => true, - 'trim_array_spaces' => true, - 'unary_operator_spaces' => true, - 'visibility_required' => [ - 'elements' => [ - 'const', - 'method', - 'property', - ], - ], - 'void_return' => true, - 'whitespace_after_comma_in_array' => true, - ] - ) - ->setFinder( - PhpCsFixer\Finder::create() - ->files() - ->in(__DIR__ . '/src') - ->in(__DIR__ . '/tests') - ); diff --git a/vendor/phpunit/php-timer/.travis.yml b/vendor/phpunit/php-timer/.travis.yml deleted file mode 100644 index a217292..0000000 --- a/vendor/phpunit/php-timer/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -language: php - -php: - - 7.1 - - 7.2 - - 7.3 - - 7.4snapshot - -before_install: - - composer self-update - - composer clear-cache - -install: - - travis_retry composer update --no-interaction --no-ansi --no-progress --no-suggest - -script: - - ./vendor/bin/phpunit --coverage-clover=coverage.xml - -after_success: - - bash <(curl -s https://codecov.io/bash) - -notifications: - email: false diff --git a/vendor/phpunit/php-timer/ChangeLog.md b/vendor/phpunit/php-timer/ChangeLog.md deleted file mode 100644 index 378d453..0000000 --- a/vendor/phpunit/php-timer/ChangeLog.md +++ /dev/null @@ -1,43 +0,0 @@ -# ChangeLog - -All notable changes are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. - -## [2.1.3] - 2020-11-30 - -### Changed - -* Changed PHP version constraint in `composer.json` from `^7.1` to `>=7.1` - -## [2.1.2] - 2019-06-07 - -### Fixed - -* Fixed [#21](https://github.com/sebastianbergmann/php-timer/pull/3352): Formatting of memory consumption does not work on 32bit systems - -## [2.1.1] - 2019-02-20 - -### Changed - -* Improved formatting of memory consumption for `resourceUsage()` - -## [2.1.0] - 2019-02-20 - -### Changed - -* Improved formatting of memory consumption for `resourceUsage()` - -## [2.0.0] - 2018-02-01 - -### Changed - -* This component now uses namespaces - -### Removed - -* This component is no longer supported on PHP 5.3, PHP 5.4, PHP 5.5, PHP 5.6, and PHP 7.0 - -[2.1.3]: https://github.com/sebastianbergmann/diff/compare/2.1.2...2.1.3 -[2.1.2]: https://github.com/sebastianbergmann/diff/compare/2.1.1...2.1.2 -[2.1.1]: https://github.com/sebastianbergmann/diff/compare/2.1.0...2.1.1 -[2.1.0]: https://github.com/sebastianbergmann/diff/compare/2.0.0...2.1.0 -[2.0.0]: https://github.com/sebastianbergmann/diff/compare/1.0.9...2.0.0 diff --git a/vendor/phpunit/php-timer/LICENSE b/vendor/phpunit/php-timer/LICENSE deleted file mode 100644 index a4eb944..0000000 --- a/vendor/phpunit/php-timer/LICENSE +++ /dev/null @@ -1,33 +0,0 @@ -phpunit/php-timer - -Copyright (c) 2010-2019, Sebastian Bergmann . -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Sebastian Bergmann nor the names of his - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/phpunit/php-timer/README.md b/vendor/phpunit/php-timer/README.md deleted file mode 100644 index 61725c2..0000000 --- a/vendor/phpunit/php-timer/README.md +++ /dev/null @@ -1,49 +0,0 @@ -[![Build Status](https://travis-ci.org/sebastianbergmann/php-timer.svg?branch=master)](https://travis-ci.org/sebastianbergmann/php-timer) - -# phpunit/php-timer - -Utility class for timing things, factored out of PHPUnit into a stand-alone component. - -## Installation - -You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): - - composer require phpunit/php-timer - -If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: - - composer require --dev phpunit/php-timer - -## Usage - -### Basic Timing - -```php -use SebastianBergmann\Timer\Timer; - -Timer::start(); - -// ... - -$time = Timer::stop(); -var_dump($time); - -print Timer::secondsToTimeString($time); -``` - -The code above yields the output below: - - double(1.0967254638672E-5) - 0 ms - -### Resource Consumption Since PHP Startup - -```php -use SebastianBergmann\Timer\Timer; - -print Timer::resourceUsage(); -``` - -The code above yields the output below: - - Time: 0 ms, Memory: 0.50MB diff --git a/vendor/phpunit/php-timer/build.xml b/vendor/phpunit/php-timer/build.xml deleted file mode 100644 index b8d3256..0000000 --- a/vendor/phpunit/php-timer/build.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/phpunit/php-timer/composer.json b/vendor/phpunit/php-timer/composer.json deleted file mode 100644 index 340d944..0000000 --- a/vendor/phpunit/php-timer/composer.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "phpunit/php-timer", - "description": "Utility class for timing", - "type": "library", - "keywords": [ - "timer" - ], - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-timer/issues" - }, - "prefer-stable": true, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "^8.5" - }, - "config": { - "optimize-autoloader": true, - "sort-packages": true - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - } -} - diff --git a/vendor/phpunit/php-timer/phpunit.xml b/vendor/phpunit/php-timer/phpunit.xml deleted file mode 100644 index 28a95de..0000000 --- a/vendor/phpunit/php-timer/phpunit.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - tests - - - - - src - - - diff --git a/vendor/phpunit/php-timer/src/Exception.php b/vendor/phpunit/php-timer/src/Exception.php deleted file mode 100644 index 7f9a26b..0000000 --- a/vendor/phpunit/php-timer/src/Exception.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Timer; - -interface Exception -{ -} diff --git a/vendor/phpunit/php-timer/src/RuntimeException.php b/vendor/phpunit/php-timer/src/RuntimeException.php deleted file mode 100644 index aff06fa..0000000 --- a/vendor/phpunit/php-timer/src/RuntimeException.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Timer; - -final class RuntimeException extends \RuntimeException implements Exception -{ -} diff --git a/vendor/phpunit/php-timer/src/Timer.php b/vendor/phpunit/php-timer/src/Timer.php deleted file mode 100644 index 378ff72..0000000 --- a/vendor/phpunit/php-timer/src/Timer.php +++ /dev/null @@ -1,100 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Timer; - -final class Timer -{ - /** - * @var int[] - */ - private static $sizes = [ - 'GB' => 1073741824, - 'MB' => 1048576, - 'KB' => 1024, - ]; - - /** - * @var int[] - */ - private static $times = [ - 'hour' => 3600000, - 'minute' => 60000, - 'second' => 1000, - ]; - - /** - * @var float[] - */ - private static $startTimes = []; - - public static function start(): void - { - self::$startTimes[] = \microtime(true); - } - - public static function stop(): float - { - return \microtime(true) - \array_pop(self::$startTimes); - } - - public static function bytesToString(float $bytes): string - { - foreach (self::$sizes as $unit => $value) { - if ($bytes >= $value) { - return \sprintf('%.2f %s', $bytes >= 1024 ? $bytes / $value : $bytes, $unit); - } - } - - return $bytes . ' byte' . ((int) $bytes !== 1 ? 's' : ''); - } - - public static function secondsToTimeString(float $time): string - { - $ms = \round($time * 1000); - - foreach (self::$times as $unit => $value) { - if ($ms >= $value) { - $time = \floor($ms / $value * 100.0) / 100.0; - - return $time . ' ' . ($time == 1 ? $unit : $unit . 's'); - } - } - - return $ms . ' ms'; - } - - /** - * @throws RuntimeException - */ - public static function timeSinceStartOfRequest(): string - { - if (isset($_SERVER['REQUEST_TIME_FLOAT'])) { - $startOfRequest = $_SERVER['REQUEST_TIME_FLOAT']; - } elseif (isset($_SERVER['REQUEST_TIME'])) { - $startOfRequest = $_SERVER['REQUEST_TIME']; - } else { - throw new RuntimeException('Cannot determine time at which the request started'); - } - - return self::secondsToTimeString(\microtime(true) - $startOfRequest); - } - - /** - * @throws RuntimeException - */ - public static function resourceUsage(): string - { - return \sprintf( - 'Time: %s, Memory: %s', - self::timeSinceStartOfRequest(), - self::bytesToString(\memory_get_peak_usage(true)) - ); - } -} diff --git a/vendor/phpunit/php-timer/tests/TimerTest.php b/vendor/phpunit/php-timer/tests/TimerTest.php deleted file mode 100644 index 93cc474..0000000 --- a/vendor/phpunit/php-timer/tests/TimerTest.php +++ /dev/null @@ -1,134 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Timer; - -use PHPUnit\Framework\TestCase; - -/** - * @covers \SebastianBergmann\Timer\Timer - */ -final class TimerTest extends TestCase -{ - public function testCanBeStartedAndStopped(): void - { - $this->assertIsFloat(Timer::stop()); - } - - public function testCanFormatTimeSinceStartOfRequest(): void - { - $this->assertStringMatchesFormat('%f %s', Timer::timeSinceStartOfRequest()); - } - - /** - * @backupGlobals enabled - */ - public function testCanFormatSinceStartOfRequestWhenRequestTimeIsNotAvailableAsFloat(): void - { - if (isset($_SERVER['REQUEST_TIME_FLOAT'])) { - unset($_SERVER['REQUEST_TIME_FLOAT']); - } - - $this->assertStringMatchesFormat('%f %s', Timer::timeSinceStartOfRequest()); - } - - /** - * @backupGlobals enabled - */ - public function testCannotFormatTimeSinceStartOfRequestWhenRequestTimeIsNotAvailable(): void - { - if (isset($_SERVER['REQUEST_TIME_FLOAT'])) { - unset($_SERVER['REQUEST_TIME_FLOAT']); - } - - if (isset($_SERVER['REQUEST_TIME'])) { - unset($_SERVER['REQUEST_TIME']); - } - - $this->expectException(RuntimeException::class); - - Timer::timeSinceStartOfRequest(); - } - - public function testCanFormatResourceUsage(): void - { - $this->assertStringMatchesFormat('Time: %s, Memory: %f %s', Timer::resourceUsage()); - } - - /** - * @dataProvider secondsProvider - */ - public function testCanFormatSecondsAsString(string $string, float $seconds): void - { - $this->assertEquals($string, Timer::secondsToTimeString($seconds)); - } - - public function secondsProvider(): array - { - return [ - ['0 ms', 0], - ['1 ms', .001], - ['10 ms', .01], - ['100 ms', .1], - ['999 ms', .999], - ['1 second', .9999], - ['1 second', 1], - ['2 seconds', 2], - ['59.9 seconds', 59.9], - ['59.99 seconds', 59.99], - ['59.99 seconds', 59.999], - ['1 minute', 59.9999], - ['59 seconds', 59.001], - ['59.01 seconds', 59.01], - ['1 minute', 60], - ['1.01 minutes', 61], - ['2 minutes', 120], - ['2.01 minutes', 121], - ['59.99 minutes', 3599.9], - ['59.99 minutes', 3599.99], - ['59.99 minutes', 3599.999], - ['1 hour', 3599.9999], - ['59.98 minutes', 3599.001], - ['59.98 minutes', 3599.01], - ['1 hour', 3600], - ['1 hour', 3601], - ['1 hour', 3601.9], - ['1 hour', 3601.99], - ['1 hour', 3601.999], - ['1 hour', 3601.9999], - ['1.01 hours', 3659.9999], - ['1.01 hours', 3659.001], - ['1.01 hours', 3659.01], - ['2 hours', 7199.9999], - ]; - } - - /** - * @dataProvider bytesProvider - */ - public function testCanFormatBytesAsString(string $string, float $bytes): void - { - $this->assertEquals($string, Timer::bytesToString($bytes)); - } - - public function bytesProvider(): array - { - return [ - ['0 bytes', 0], - ['1 byte', 1], - ['1023 bytes', 1023], - ['1.00 KB', 1024], - ['1.50 KB', 1.5 * 1024], - ['2.00 MB', 2 * 1048576], - ['2.50 MB', 2.5 * 1048576], - ['3.00 GB', 3 * 1073741824], - ['3.50 GB', 3.5 * 1073741824], - ]; - } -} diff --git a/vendor/phpunit/php-token-stream/.gitattributes b/vendor/phpunit/php-token-stream/.gitattributes deleted file mode 100644 index a88b8c6..0000000 --- a/vendor/phpunit/php-token-stream/.gitattributes +++ /dev/null @@ -1,12 +0,0 @@ -/.github export-ignore -/.phive export-ignore -/.php_cs.dist export-ignore -/.psalm export-ignore -/bin export-ignore -/build.xml export-ignore -/phpunit.xml export-ignore -/tests export-ignore -/tools export-ignore -/tools/* binary - -*.php diff=php diff --git a/vendor/phpunit/php-token-stream/.gitignore b/vendor/phpunit/php-token-stream/.gitignore deleted file mode 100644 index 93a0be4..0000000 --- a/vendor/phpunit/php-token-stream/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -/.idea -/.php_cs -/.php_cs.cache -/.phpunit.result.cache -/.psalm/cache -/composer.lock -/vendor diff --git a/vendor/phpunit/php-token-stream/ChangeLog.md b/vendor/phpunit/php-token-stream/ChangeLog.md deleted file mode 100644 index 4a93f52..0000000 --- a/vendor/phpunit/php-token-stream/ChangeLog.md +++ /dev/null @@ -1,92 +0,0 @@ -# Change Log - -All notable changes to `sebastianbergmann/php-token-stream` are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. - -## [4.0.4] - 2020-08-04 - -### Added - -* Support for `NAME_FULLY_QUALIFIED`, `NAME_QUALIFIED`, and `NAME_RELATIVE` tokens - -## [4.0.3] - 2020-06-27 - -### Added - -* This component is now supported on PHP 8 - -## [4.0.2] - 2020-06-16 - -### Fixed - -* Fixed backward compatibility breaks introduced in version 4.0.1 - -## [4.0.1] - 2020-05-06 - -### Fixed - -* [#93](https://github.com/sebastianbergmann/php-token-stream/issues/93): Class with method that uses anonymous class is not processed correctly - -## [4.0.0] - 2020-02-07 - -### Removed - -* This component is no longer supported PHP 7.1 and PHP 7.2 - -## [3.1.1] - 2019-09-17 - -### Fixed - -* [#84](https://github.com/sebastianbergmann/php-token-stream/issues/84): Methods named `class` are not handled correctly - -## [3.1.0] - 2019-07-25 - -### Added - -* Added support for `FN` and `COALESCE_EQUAL` tokens introduced in PHP 7.4 - -## [3.0.2] - 2019-07-08 - -### Changed - -* [#82](https://github.com/sebastianbergmann/php-token-stream/issues/82): Make sure this component works when its classes are prefixed using php-scoper - -## [3.0.1] - 2018-10-30 - -### Fixed - -* [#78](https://github.com/sebastianbergmann/php-token-stream/pull/78): `getEndTokenId()` does not handle string-dollar (`"${var}"`) interpolation - -## [3.0.0] - 2018-02-01 - -### Removed - -* [#71](https://github.com/sebastianbergmann/php-token-stream/issues/71): Remove code specific to Hack language constructs -* [#72](https://github.com/sebastianbergmann/php-token-stream/issues/72): Drop support for PHP 7.0 - -## [2.0.2] - 2017-11-27 - -### Fixed - -* [#69](https://github.com/sebastianbergmann/php-token-stream/issues/69): `PHP_Token_USE_FUNCTION` does not serialize correctly - -## [2.0.1] - 2017-08-20 - -### Fixed - -* [#68](https://github.com/sebastianbergmann/php-token-stream/issues/68): Method with name `empty` wrongly recognized as anonymous function - -## [2.0.0] - 2017-08-03 - -[4.0.4]: https://github.com/sebastianbergmann/php-token-stream/compare/4.0.3...4.0.4 -[4.0.3]: https://github.com/sebastianbergmann/php-token-stream/compare/4.0.2...4.0.3 -[4.0.2]: https://github.com/sebastianbergmann/php-token-stream/compare/4.0.1...4.0.2 -[4.0.1]: https://github.com/sebastianbergmann/php-token-stream/compare/4.0.0...4.0.1 -[4.0.0]: https://github.com/sebastianbergmann/php-token-stream/compare/3.1.1...4.0.0 -[3.1.1]: https://github.com/sebastianbergmann/php-token-stream/compare/3.1.0...3.1.1 -[3.1.0]: https://github.com/sebastianbergmann/php-token-stream/compare/3.0.2...3.1.0 -[3.0.2]: https://github.com/sebastianbergmann/php-token-stream/compare/3.0.1...3.0.2 -[3.0.1]: https://github.com/sebastianbergmann/php-token-stream/compare/3.0.0...3.0.1 -[3.0.0]: https://github.com/sebastianbergmann/php-token-stream/compare/2.0...3.0.0 -[2.0.2]: https://github.com/sebastianbergmann/php-token-stream/compare/2.0.1...2.0.2 -[2.0.1]: https://github.com/sebastianbergmann/php-token-stream/compare/2.0.0...2.0.1 -[2.0.0]: https://github.com/sebastianbergmann/php-token-stream/compare/1.4.11...2.0.0 diff --git a/vendor/phpunit/php-token-stream/LICENSE b/vendor/phpunit/php-token-stream/LICENSE deleted file mode 100644 index a6d0c8c..0000000 --- a/vendor/phpunit/php-token-stream/LICENSE +++ /dev/null @@ -1,33 +0,0 @@ -php-token-stream - -Copyright (c) 2009-2020, Sebastian Bergmann . -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Sebastian Bergmann nor the names of his - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/phpunit/php-token-stream/README.md b/vendor/phpunit/php-token-stream/README.md deleted file mode 100644 index 162de8d..0000000 --- a/vendor/phpunit/php-token-stream/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# phpunit/php-token-stream - -[![CI Status](https://github.com/sebastianbergmann/php-token-stream/workflows/CI/badge.svg)](https://github.com/sebastianbergmann/php-token-stream/actions) -[![Type Coverage](https://shepherd.dev/github/sebastianbergmann/php-token-stream/coverage.svg)](https://shepherd.dev/github/sebastianbergmann/php-token-stream) - -## Installation - -You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): - -``` -composer require phpunit/php-token-stream -``` - -If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: - -``` -composer require --dev phpunit/php-token-stream -``` diff --git a/vendor/phpunit/php-token-stream/composer.json b/vendor/phpunit/php-token-stream/composer.json deleted file mode 100644 index e0d0b4d..0000000 --- a/vendor/phpunit/php-token-stream/composer.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "phpunit/php-token-stream", - "description": "Wrapper around PHP's tokenizer extension.", - "type": "library", - "keywords": ["tokenizer"], - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-token-stream/issues" - }, - "prefer-stable": true, - "require": { - "php": "^7.3 || ^8.0", - "ext-tokenizer": "*" - }, - "require-dev": { - "phpunit/phpunit": "^9.0" - }, - "config": { - "platform": { - "php": "7.3.0" - }, - "optimize-autoloader": true, - "sort-packages": true - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - } -} diff --git a/vendor/phpunit/php-token-stream/src/Abstract.php b/vendor/phpunit/php-token-stream/src/Abstract.php deleted file mode 100644 index 7bbb555..0000000 --- a/vendor/phpunit/php-token-stream/src/Abstract.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_ABSTRACT extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Ampersand.php b/vendor/phpunit/php-token-stream/src/Ampersand.php deleted file mode 100644 index 3996f34..0000000 --- a/vendor/phpunit/php-token-stream/src/Ampersand.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_AMPERSAND extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/AndEqual.php b/vendor/phpunit/php-token-stream/src/AndEqual.php deleted file mode 100644 index 9984442..0000000 --- a/vendor/phpunit/php-token-stream/src/AndEqual.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_AND_EQUAL extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Array.php b/vendor/phpunit/php-token-stream/src/Array.php deleted file mode 100644 index 72041e9..0000000 --- a/vendor/phpunit/php-token-stream/src/Array.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_ARRAY extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/ArrayCast.php b/vendor/phpunit/php-token-stream/src/ArrayCast.php deleted file mode 100644 index 9d113db..0000000 --- a/vendor/phpunit/php-token-stream/src/ArrayCast.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_ARRAY_CAST extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/As.php b/vendor/phpunit/php-token-stream/src/As.php deleted file mode 100644 index 286578e..0000000 --- a/vendor/phpunit/php-token-stream/src/As.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_AS extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/At.php b/vendor/phpunit/php-token-stream/src/At.php deleted file mode 100644 index d8d2468..0000000 --- a/vendor/phpunit/php-token-stream/src/At.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_AT extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Backtick.php b/vendor/phpunit/php-token-stream/src/Backtick.php deleted file mode 100644 index 3d8b55b..0000000 --- a/vendor/phpunit/php-token-stream/src/Backtick.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_BACKTICK extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/BadCharacter.php b/vendor/phpunit/php-token-stream/src/BadCharacter.php deleted file mode 100644 index dfc7a40..0000000 --- a/vendor/phpunit/php-token-stream/src/BadCharacter.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_BAD_CHARACTER extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/BoolCast.php b/vendor/phpunit/php-token-stream/src/BoolCast.php deleted file mode 100644 index 201cfea..0000000 --- a/vendor/phpunit/php-token-stream/src/BoolCast.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_BOOL_CAST extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/BooleanAnd.php b/vendor/phpunit/php-token-stream/src/BooleanAnd.php deleted file mode 100644 index 03f9833..0000000 --- a/vendor/phpunit/php-token-stream/src/BooleanAnd.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_BOOLEAN_AND extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/BooleanOr.php b/vendor/phpunit/php-token-stream/src/BooleanOr.php deleted file mode 100644 index 0f33924..0000000 --- a/vendor/phpunit/php-token-stream/src/BooleanOr.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_BOOLEAN_OR extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/CachingFactory.php b/vendor/phpunit/php-token-stream/src/CachingFactory.php deleted file mode 100644 index c557a84..0000000 --- a/vendor/phpunit/php-token-stream/src/CachingFactory.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_Stream_CachingFactory -{ - /** - * @var array - */ - protected static $cache = []; - - /** - * @param string $filename - * - * @return PHP_Token_Stream - */ - public static function get($filename) - { - if (!isset(self::$cache[$filename])) { - self::$cache[$filename] = new PHP_Token_Stream($filename); - } - - return self::$cache[$filename]; - } - - /** - * @param string $filename - */ - public static function clear($filename = null)/*: void*/ - { - if (\is_string($filename)) { - unset(self::$cache[$filename]); - } else { - self::$cache = []; - } - } -} diff --git a/vendor/phpunit/php-token-stream/src/Callable.php b/vendor/phpunit/php-token-stream/src/Callable.php deleted file mode 100644 index 4f57512..0000000 --- a/vendor/phpunit/php-token-stream/src/Callable.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_CALLABLE extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Caret.php b/vendor/phpunit/php-token-stream/src/Caret.php deleted file mode 100644 index af453d8..0000000 --- a/vendor/phpunit/php-token-stream/src/Caret.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_CARET extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Case.php b/vendor/phpunit/php-token-stream/src/Case.php deleted file mode 100644 index ab9b906..0000000 --- a/vendor/phpunit/php-token-stream/src/Case.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_CASE extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Catch.php b/vendor/phpunit/php-token-stream/src/Catch.php deleted file mode 100644 index 8c244ac..0000000 --- a/vendor/phpunit/php-token-stream/src/Catch.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_CATCH extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Character.php b/vendor/phpunit/php-token-stream/src/Character.php deleted file mode 100644 index eea0db0..0000000 --- a/vendor/phpunit/php-token-stream/src/Character.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_CHARACTER extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Class.php b/vendor/phpunit/php-token-stream/src/Class.php deleted file mode 100644 index 09167f2..0000000 --- a/vendor/phpunit/php-token-stream/src/Class.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_CLASS extends PHP_Token_INTERFACE -{ - /** - * @var bool - */ - private $anonymous = false; - - /** - * @var string - */ - private $name; - - /** - * @return string - */ - public function getName() - { - if ($this->name !== null) { - return $this->name; - } - - $next = $this->tokenStream[$this->id + 1]; - - if ($next instanceof PHP_Token_WHITESPACE) { - $next = $this->tokenStream[$this->id + 2]; - } - - if ($next instanceof PHP_Token_STRING) { - $this->name =(string) $next; - - return $this->name; - } - - if ($next instanceof PHP_Token_OPEN_CURLY || - $next instanceof PHP_Token_EXTENDS || - $next instanceof PHP_Token_IMPLEMENTS) { - $this->name = \sprintf( - 'AnonymousClass:%s#%s', - $this->getLine(), - $this->getId() - ); - - $this->anonymous = true; - - return $this->name; - } - } - - public function isAnonymous() - { - return $this->anonymous; - } -} diff --git a/vendor/phpunit/php-token-stream/src/ClassC.php b/vendor/phpunit/php-token-stream/src/ClassC.php deleted file mode 100644 index 2350c99..0000000 --- a/vendor/phpunit/php-token-stream/src/ClassC.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_CLASS_C extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/ClassNameConstant.php b/vendor/phpunit/php-token-stream/src/ClassNameConstant.php deleted file mode 100644 index 1b557e3..0000000 --- a/vendor/phpunit/php-token-stream/src/ClassNameConstant.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_CLASS_NAME_CONSTANT extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Clone.php b/vendor/phpunit/php-token-stream/src/Clone.php deleted file mode 100644 index 24e6610..0000000 --- a/vendor/phpunit/php-token-stream/src/Clone.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_CLONE extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/CloseBracket.php b/vendor/phpunit/php-token-stream/src/CloseBracket.php deleted file mode 100644 index b86b745..0000000 --- a/vendor/phpunit/php-token-stream/src/CloseBracket.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_CLOSE_BRACKET extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/CloseCurly.php b/vendor/phpunit/php-token-stream/src/CloseCurly.php deleted file mode 100644 index aa86cdc..0000000 --- a/vendor/phpunit/php-token-stream/src/CloseCurly.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_CLOSE_CURLY extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/CloseSquare.php b/vendor/phpunit/php-token-stream/src/CloseSquare.php deleted file mode 100644 index fc819d0..0000000 --- a/vendor/phpunit/php-token-stream/src/CloseSquare.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_CLOSE_SQUARE extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/CloseTag.php b/vendor/phpunit/php-token-stream/src/CloseTag.php deleted file mode 100644 index 419510c..0000000 --- a/vendor/phpunit/php-token-stream/src/CloseTag.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_CLOSE_TAG extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Coalesce.php b/vendor/phpunit/php-token-stream/src/Coalesce.php deleted file mode 100644 index 55b2beb..0000000 --- a/vendor/phpunit/php-token-stream/src/Coalesce.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_COALESCE extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/CoalesceEqual.php b/vendor/phpunit/php-token-stream/src/CoalesceEqual.php deleted file mode 100644 index b600961..0000000 --- a/vendor/phpunit/php-token-stream/src/CoalesceEqual.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_COALESCE_EQUAL extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Colon.php b/vendor/phpunit/php-token-stream/src/Colon.php deleted file mode 100644 index 66dd840..0000000 --- a/vendor/phpunit/php-token-stream/src/Colon.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_COLON extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Comma.php b/vendor/phpunit/php-token-stream/src/Comma.php deleted file mode 100644 index b57ba37..0000000 --- a/vendor/phpunit/php-token-stream/src/Comma.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_COMMA extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Comment.php b/vendor/phpunit/php-token-stream/src/Comment.php deleted file mode 100644 index c50c80b..0000000 --- a/vendor/phpunit/php-token-stream/src/Comment.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_COMMENT extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/ConcatEqual.php b/vendor/phpunit/php-token-stream/src/ConcatEqual.php deleted file mode 100644 index f57c748..0000000 --- a/vendor/phpunit/php-token-stream/src/ConcatEqual.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_CONCAT_EQUAL extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Const.php b/vendor/phpunit/php-token-stream/src/Const.php deleted file mode 100644 index a537642..0000000 --- a/vendor/phpunit/php-token-stream/src/Const.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_CONST extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/ConstantEncapsedString.php b/vendor/phpunit/php-token-stream/src/ConstantEncapsedString.php deleted file mode 100644 index 2a030cd..0000000 --- a/vendor/phpunit/php-token-stream/src/ConstantEncapsedString.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_CONSTANT_ENCAPSED_STRING extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Continue.php b/vendor/phpunit/php-token-stream/src/Continue.php deleted file mode 100644 index a21c8ba..0000000 --- a/vendor/phpunit/php-token-stream/src/Continue.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_CONTINUE extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/CurlyOpen.php b/vendor/phpunit/php-token-stream/src/CurlyOpen.php deleted file mode 100644 index 7c3e9bc..0000000 --- a/vendor/phpunit/php-token-stream/src/CurlyOpen.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_CURLY_OPEN extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/DNumber.php b/vendor/phpunit/php-token-stream/src/DNumber.php deleted file mode 100644 index bf5751f..0000000 --- a/vendor/phpunit/php-token-stream/src/DNumber.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_DNUMBER extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Dec.php b/vendor/phpunit/php-token-stream/src/Dec.php deleted file mode 100644 index 6f06341..0000000 --- a/vendor/phpunit/php-token-stream/src/Dec.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_DEC extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Declare.php b/vendor/phpunit/php-token-stream/src/Declare.php deleted file mode 100644 index 60dab6f..0000000 --- a/vendor/phpunit/php-token-stream/src/Declare.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_DECLARE extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Default.php b/vendor/phpunit/php-token-stream/src/Default.php deleted file mode 100644 index 81f3bfd..0000000 --- a/vendor/phpunit/php-token-stream/src/Default.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_DEFAULT extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Dir.php b/vendor/phpunit/php-token-stream/src/Dir.php deleted file mode 100644 index add4bf8..0000000 --- a/vendor/phpunit/php-token-stream/src/Dir.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_DIR extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Div.php b/vendor/phpunit/php-token-stream/src/Div.php deleted file mode 100644 index 87e11d7..0000000 --- a/vendor/phpunit/php-token-stream/src/Div.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_DIV extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/DivEqual.php b/vendor/phpunit/php-token-stream/src/DivEqual.php deleted file mode 100644 index cb558a8..0000000 --- a/vendor/phpunit/php-token-stream/src/DivEqual.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_DIV_EQUAL extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Do.php b/vendor/phpunit/php-token-stream/src/Do.php deleted file mode 100644 index 32ceff1..0000000 --- a/vendor/phpunit/php-token-stream/src/Do.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_DO extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/DocComment.php b/vendor/phpunit/php-token-stream/src/DocComment.php deleted file mode 100644 index 2ca6f22..0000000 --- a/vendor/phpunit/php-token-stream/src/DocComment.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_DOC_COMMENT extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Dollar.php b/vendor/phpunit/php-token-stream/src/Dollar.php deleted file mode 100644 index a2a8d59..0000000 --- a/vendor/phpunit/php-token-stream/src/Dollar.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_DOLLAR extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/DollarOpenCurlyBraces.php b/vendor/phpunit/php-token-stream/src/DollarOpenCurlyBraces.php deleted file mode 100644 index 030bcb2..0000000 --- a/vendor/phpunit/php-token-stream/src/DollarOpenCurlyBraces.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_DOLLAR_OPEN_CURLY_BRACES extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Dot.php b/vendor/phpunit/php-token-stream/src/Dot.php deleted file mode 100644 index b50a49e..0000000 --- a/vendor/phpunit/php-token-stream/src/Dot.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_DOT extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/DoubleArrow.php b/vendor/phpunit/php-token-stream/src/DoubleArrow.php deleted file mode 100644 index bc2c6d0..0000000 --- a/vendor/phpunit/php-token-stream/src/DoubleArrow.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_DOUBLE_ARROW extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/DoubleCast.php b/vendor/phpunit/php-token-stream/src/DoubleCast.php deleted file mode 100644 index eb72f36..0000000 --- a/vendor/phpunit/php-token-stream/src/DoubleCast.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_DOUBLE_CAST extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/DoubleColon.php b/vendor/phpunit/php-token-stream/src/DoubleColon.php deleted file mode 100644 index 46ff6e7..0000000 --- a/vendor/phpunit/php-token-stream/src/DoubleColon.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_DOUBLE_COLON extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/DoubleQuotes.php b/vendor/phpunit/php-token-stream/src/DoubleQuotes.php deleted file mode 100644 index 1077980..0000000 --- a/vendor/phpunit/php-token-stream/src/DoubleQuotes.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_DOUBLE_QUOTES extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Echo.php b/vendor/phpunit/php-token-stream/src/Echo.php deleted file mode 100644 index bfee30c..0000000 --- a/vendor/phpunit/php-token-stream/src/Echo.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_ECHO extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Ellipsis.php b/vendor/phpunit/php-token-stream/src/Ellipsis.php deleted file mode 100644 index d932ced..0000000 --- a/vendor/phpunit/php-token-stream/src/Ellipsis.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_ELLIPSIS extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Else.php b/vendor/phpunit/php-token-stream/src/Else.php deleted file mode 100644 index a3266f8..0000000 --- a/vendor/phpunit/php-token-stream/src/Else.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_ELSE extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Elseif.php b/vendor/phpunit/php-token-stream/src/Elseif.php deleted file mode 100644 index 76a7d4e..0000000 --- a/vendor/phpunit/php-token-stream/src/Elseif.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_ELSEIF extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Empty.php b/vendor/phpunit/php-token-stream/src/Empty.php deleted file mode 100644 index 15f662c..0000000 --- a/vendor/phpunit/php-token-stream/src/Empty.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_EMPTY extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/EncapsedAndWhitespace.php b/vendor/phpunit/php-token-stream/src/EncapsedAndWhitespace.php deleted file mode 100644 index 5224806..0000000 --- a/vendor/phpunit/php-token-stream/src/EncapsedAndWhitespace.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_ENCAPSED_AND_WHITESPACE extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/EndHeredoc.php b/vendor/phpunit/php-token-stream/src/EndHeredoc.php deleted file mode 100644 index e95930c..0000000 --- a/vendor/phpunit/php-token-stream/src/EndHeredoc.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_END_HEREDOC extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Enddeclare.php b/vendor/phpunit/php-token-stream/src/Enddeclare.php deleted file mode 100644 index dd96d7f..0000000 --- a/vendor/phpunit/php-token-stream/src/Enddeclare.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_ENDDECLARE extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Endfor.php b/vendor/phpunit/php-token-stream/src/Endfor.php deleted file mode 100644 index a5382a2..0000000 --- a/vendor/phpunit/php-token-stream/src/Endfor.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_ENDFOR extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Endforeach.php b/vendor/phpunit/php-token-stream/src/Endforeach.php deleted file mode 100644 index d2ab78a..0000000 --- a/vendor/phpunit/php-token-stream/src/Endforeach.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_ENDFOREACH extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Endif.php b/vendor/phpunit/php-token-stream/src/Endif.php deleted file mode 100644 index 910eeea..0000000 --- a/vendor/phpunit/php-token-stream/src/Endif.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_ENDIF extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Endswitch.php b/vendor/phpunit/php-token-stream/src/Endswitch.php deleted file mode 100644 index 0fc8146..0000000 --- a/vendor/phpunit/php-token-stream/src/Endswitch.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_ENDSWITCH extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Endwhile.php b/vendor/phpunit/php-token-stream/src/Endwhile.php deleted file mode 100644 index 9a289f1..0000000 --- a/vendor/phpunit/php-token-stream/src/Endwhile.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_ENDWHILE extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Equal.php b/vendor/phpunit/php-token-stream/src/Equal.php deleted file mode 100644 index c8ecb0b..0000000 --- a/vendor/phpunit/php-token-stream/src/Equal.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_EQUAL extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Eval.php b/vendor/phpunit/php-token-stream/src/Eval.php deleted file mode 100644 index fb82bfd..0000000 --- a/vendor/phpunit/php-token-stream/src/Eval.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_EVAL extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/ExclamationMark.php b/vendor/phpunit/php-token-stream/src/ExclamationMark.php deleted file mode 100644 index 009ea23..0000000 --- a/vendor/phpunit/php-token-stream/src/ExclamationMark.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_EXCLAMATION_MARK extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Exit.php b/vendor/phpunit/php-token-stream/src/Exit.php deleted file mode 100644 index 9475887..0000000 --- a/vendor/phpunit/php-token-stream/src/Exit.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_EXIT extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Extends.php b/vendor/phpunit/php-token-stream/src/Extends.php deleted file mode 100644 index bf51160..0000000 --- a/vendor/phpunit/php-token-stream/src/Extends.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_EXTENDS extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/File.php b/vendor/phpunit/php-token-stream/src/File.php deleted file mode 100644 index a89449c..0000000 --- a/vendor/phpunit/php-token-stream/src/File.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_FILE extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Final.php b/vendor/phpunit/php-token-stream/src/Final.php deleted file mode 100644 index f1355d2..0000000 --- a/vendor/phpunit/php-token-stream/src/Final.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_FINAL extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Finally.php b/vendor/phpunit/php-token-stream/src/Finally.php deleted file mode 100644 index 8d31fc3..0000000 --- a/vendor/phpunit/php-token-stream/src/Finally.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_FINALLY extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Fn.php b/vendor/phpunit/php-token-stream/src/Fn.php deleted file mode 100644 index 8c1ceec..0000000 --- a/vendor/phpunit/php-token-stream/src/Fn.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_FN extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/For.php b/vendor/phpunit/php-token-stream/src/For.php deleted file mode 100644 index 5b7bcbf..0000000 --- a/vendor/phpunit/php-token-stream/src/For.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_FOR extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Foreach.php b/vendor/phpunit/php-token-stream/src/Foreach.php deleted file mode 100644 index 76906b0..0000000 --- a/vendor/phpunit/php-token-stream/src/Foreach.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_FOREACH extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/FuncC.php b/vendor/phpunit/php-token-stream/src/FuncC.php deleted file mode 100644 index 853446f..0000000 --- a/vendor/phpunit/php-token-stream/src/FuncC.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_FUNC_C extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Function.php b/vendor/phpunit/php-token-stream/src/Function.php deleted file mode 100644 index 8cc9eb1..0000000 --- a/vendor/phpunit/php-token-stream/src/Function.php +++ /dev/null @@ -1,196 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_FUNCTION extends PHP_TokenWithScopeAndVisibility -{ - /** - * @var array - */ - protected $arguments; - - /** - * @var int - */ - protected $ccn; - - /** - * @var string - */ - protected $name; - - /** - * @var string - */ - protected $signature; - - /** - * @var bool - */ - private $anonymous = false; - - /** - * @return array - */ - public function getArguments() - { - if ($this->arguments !== null) { - return $this->arguments; - } - - $this->arguments = []; - $tokens = $this->tokenStream->tokens(); - $typeDeclaration = null; - - // Search for first token inside brackets - $i = $this->id + 2; - - while (!$tokens[$i - 1] instanceof PHP_Token_OPEN_BRACKET) { - $i++; - } - - while (!$tokens[$i] instanceof PHP_Token_CLOSE_BRACKET) { - if ($tokens[$i] instanceof PHP_Token_STRING) { - $typeDeclaration = (string) $tokens[$i]; - } elseif ($tokens[$i] instanceof PHP_Token_VARIABLE) { - $this->arguments[(string) $tokens[$i]] = $typeDeclaration; - $typeDeclaration = null; - } - - $i++; - } - - return $this->arguments; - } - - /** - * @return string - */ - public function getName() - { - if ($this->name !== null) { - return $this->name; - } - - $tokens = $this->tokenStream->tokens(); - - $i = $this->id + 1; - - if ($tokens[$i] instanceof PHP_Token_WHITESPACE) { - $i++; - } - - if ($tokens[$i] instanceof PHP_Token_AMPERSAND) { - $i++; - } - - if ($tokens[$i + 1] instanceof PHP_Token_OPEN_BRACKET) { - $this->name = (string) $tokens[$i]; - } elseif ($tokens[$i + 1] instanceof PHP_Token_WHITESPACE && $tokens[$i + 2] instanceof PHP_Token_OPEN_BRACKET) { - $this->name = (string) $tokens[$i]; - } else { - $this->anonymous = true; - - $this->name = \sprintf( - 'anonymousFunction:%s#%s', - $this->getLine(), - $this->getId() - ); - } - - if (!$this->isAnonymous()) { - for ($i = $this->id; $i; --$i) { - if ($tokens[$i] instanceof PHP_Token_NAMESPACE) { - $this->name = $tokens[$i]->getName() . '\\' . $this->name; - - break; - } - - if ($tokens[$i] instanceof PHP_Token_INTERFACE) { - break; - } - } - } - - return $this->name; - } - - /** - * @return int - */ - public function getCCN() - { - if ($this->ccn !== null) { - return $this->ccn; - } - - $this->ccn = 1; - $end = $this->getEndTokenId(); - $tokens = $this->tokenStream->tokens(); - - for ($i = $this->id; $i <= $end; $i++) { - switch (\get_class($tokens[$i])) { - case PHP_Token_IF::class: - case PHP_Token_ELSEIF::class: - case PHP_Token_FOR::class: - case PHP_Token_FOREACH::class: - case PHP_Token_WHILE::class: - case PHP_Token_CASE::class: - case PHP_Token_CATCH::class: - case PHP_Token_BOOLEAN_AND::class: - case PHP_Token_LOGICAL_AND::class: - case PHP_Token_BOOLEAN_OR::class: - case PHP_Token_LOGICAL_OR::class: - case PHP_Token_QUESTION_MARK::class: - $this->ccn++; - - break; - } - } - - return $this->ccn; - } - - /** - * @return string - */ - public function getSignature() - { - if ($this->signature !== null) { - return $this->signature; - } - - if ($this->isAnonymous()) { - $this->signature = 'anonymousFunction'; - $i = $this->id + 1; - } else { - $this->signature = ''; - $i = $this->id + 2; - } - - $tokens = $this->tokenStream->tokens(); - - while (isset($tokens[$i]) && - !$tokens[$i] instanceof PHP_Token_OPEN_CURLY && - !$tokens[$i] instanceof PHP_Token_SEMICOLON) { - $this->signature .= $tokens[$i++]; - } - - $this->signature = \trim($this->signature); - - return $this->signature; - } - - /** - * @return bool - */ - public function isAnonymous() - { - return $this->anonymous; - } -} diff --git a/vendor/phpunit/php-token-stream/src/Global.php b/vendor/phpunit/php-token-stream/src/Global.php deleted file mode 100644 index 15d34c0..0000000 --- a/vendor/phpunit/php-token-stream/src/Global.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_GLOBAL extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Goto.php b/vendor/phpunit/php-token-stream/src/Goto.php deleted file mode 100644 index 68cbce0..0000000 --- a/vendor/phpunit/php-token-stream/src/Goto.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_GOTO extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Gt.php b/vendor/phpunit/php-token-stream/src/Gt.php deleted file mode 100644 index 1df2bc9..0000000 --- a/vendor/phpunit/php-token-stream/src/Gt.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_GT extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/HaltCompiler.php b/vendor/phpunit/php-token-stream/src/HaltCompiler.php deleted file mode 100644 index 1976e9b..0000000 --- a/vendor/phpunit/php-token-stream/src/HaltCompiler.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_HALT_COMPILER extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/If.php b/vendor/phpunit/php-token-stream/src/If.php deleted file mode 100644 index 2f888f1..0000000 --- a/vendor/phpunit/php-token-stream/src/If.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_IF extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Implements.php b/vendor/phpunit/php-token-stream/src/Implements.php deleted file mode 100644 index bfb035b..0000000 --- a/vendor/phpunit/php-token-stream/src/Implements.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_IMPLEMENTS extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Inc.php b/vendor/phpunit/php-token-stream/src/Inc.php deleted file mode 100644 index ca19c33..0000000 --- a/vendor/phpunit/php-token-stream/src/Inc.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_INC extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Include.php b/vendor/phpunit/php-token-stream/src/Include.php deleted file mode 100644 index cffb378..0000000 --- a/vendor/phpunit/php-token-stream/src/Include.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_INCLUDE extends PHP_Token_Includes -{ -} diff --git a/vendor/phpunit/php-token-stream/src/IncludeOnce.php b/vendor/phpunit/php-token-stream/src/IncludeOnce.php deleted file mode 100644 index da28d61..0000000 --- a/vendor/phpunit/php-token-stream/src/IncludeOnce.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_INCLUDE_ONCE extends PHP_Token_Includes -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Includes.php b/vendor/phpunit/php-token-stream/src/Includes.php deleted file mode 100644 index 285dfbf..0000000 --- a/vendor/phpunit/php-token-stream/src/Includes.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -abstract class PHP_Token_Includes extends PHP_Token -{ - /** - * @var string - */ - protected $name; - - /** - * @var string - */ - protected $type; - - /** - * @return string - */ - public function getName() - { - if ($this->name === null) { - $this->process(); - } - - return $this->name; - } - - /** - * @return string - */ - public function getType() - { - if ($this->type === null) { - $this->process(); - } - - return $this->type; - } - - private function process(): void - { - $tokens = $this->tokenStream->tokens(); - - if ($tokens[$this->id + 2] instanceof PHP_Token_CONSTANT_ENCAPSED_STRING) { - $this->name = \trim((string) $tokens[$this->id + 2], "'\""); - $this->type = \strtolower( - \str_replace('PHP_Token_', '', PHP_Token_Util::getClass($tokens[$this->id])) - ); - } - } -} diff --git a/vendor/phpunit/php-token-stream/src/InlineHtml.php b/vendor/phpunit/php-token-stream/src/InlineHtml.php deleted file mode 100644 index a4fc15e..0000000 --- a/vendor/phpunit/php-token-stream/src/InlineHtml.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_INLINE_HTML extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Instanceof.php b/vendor/phpunit/php-token-stream/src/Instanceof.php deleted file mode 100644 index c41dd0e..0000000 --- a/vendor/phpunit/php-token-stream/src/Instanceof.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_INSTANCEOF extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Insteadof.php b/vendor/phpunit/php-token-stream/src/Insteadof.php deleted file mode 100644 index d8c0bc4..0000000 --- a/vendor/phpunit/php-token-stream/src/Insteadof.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_INSTEADOF extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/IntCast.php b/vendor/phpunit/php-token-stream/src/IntCast.php deleted file mode 100644 index 2b25601..0000000 --- a/vendor/phpunit/php-token-stream/src/IntCast.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_INT_CAST extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Interface.php b/vendor/phpunit/php-token-stream/src/Interface.php deleted file mode 100644 index d2732f5..0000000 --- a/vendor/phpunit/php-token-stream/src/Interface.php +++ /dev/null @@ -1,166 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_INTERFACE extends PHP_TokenWithScopeAndVisibility -{ - /** - * @var array - */ - protected $interfaces; - - /** - * @return string - */ - public function getName() - { - return (string) $this->tokenStream[$this->id + 2]; - } - - /** - * @return bool - */ - public function hasParent() - { - return $this->tokenStream[$this->id + 4] instanceof PHP_Token_EXTENDS; - } - - /** - * @return array - */ - public function getPackage() - { - $result = [ - 'namespace' => '', - 'fullPackage' => '', - 'category' => '', - 'package' => '', - 'subpackage' => '', - ]; - - $docComment = $this->getDocblock(); - $className = $this->getName(); - - for ($i = $this->id; $i; --$i) { - if ($this->tokenStream[$i] instanceof PHP_Token_NAMESPACE) { - $result['namespace'] = $this->tokenStream[$i]->getName(); - - break; - } - } - - if ($docComment === null) { - return $result; - } - - if (\preg_match('/@category[\s]+([\.\w]+)/', $docComment, $matches)) { - $result['category'] = $matches[1]; - } - - if (\preg_match('/@package[\s]+([\.\w]+)/', $docComment, $matches)) { - $result['package'] = $matches[1]; - $result['fullPackage'] = $matches[1]; - } - - if (\preg_match('/@subpackage[\s]+([\.\w]+)/', $docComment, $matches)) { - $result['subpackage'] = $matches[1]; - $result['fullPackage'] .= '.' . $matches[1]; - } - - if (empty($result['fullPackage'])) { - $result['fullPackage'] = $this->arrayToName( - \explode('_', \str_replace('\\', '_', $className)), - '.' - ); - } - - return $result; - } - - /** - * @return bool|string - */ - public function getParent() - { - if (!$this->hasParent()) { - return false; - } - - $i = $this->id + 6; - $tokens = $this->tokenStream->tokens(); - $className = (string) $tokens[$i]; - - while (isset($tokens[$i + 1]) && - !$tokens[$i + 1] instanceof PHP_Token_WHITESPACE) { - $className .= (string) $tokens[++$i]; - } - - return $className; - } - - /** - * @return bool - */ - public function hasInterfaces() - { - return (isset($this->tokenStream[$this->id + 4]) && - $this->tokenStream[$this->id + 4] instanceof PHP_Token_IMPLEMENTS) || - (isset($this->tokenStream[$this->id + 8]) && - $this->tokenStream[$this->id + 8] instanceof PHP_Token_IMPLEMENTS); - } - - /** - * @return array|bool - */ - public function getInterfaces() - { - if ($this->interfaces !== null) { - return $this->interfaces; - } - - if (!$this->hasInterfaces()) { - return $this->interfaces = false; - } - - if ($this->tokenStream[$this->id + 4] instanceof PHP_Token_IMPLEMENTS) { - $i = $this->id + 3; - } else { - $i = $this->id + 7; - } - - $tokens = $this->tokenStream->tokens(); - - while (!$tokens[$i + 1] instanceof PHP_Token_OPEN_CURLY) { - $i++; - - if ($tokens[$i] instanceof PHP_Token_STRING) { - $this->interfaces[] = (string) $tokens[$i]; - } - } - - return $this->interfaces; - } - - /** - * @param string $join - * - * @return string - */ - protected function arrayToName(array $parts, $join = '\\') - { - $result = ''; - - if (\count($parts) > 1) { - \array_pop($parts); - - $result = \implode($join, $parts); - } - - return $result; - } -} diff --git a/vendor/phpunit/php-token-stream/src/IsEqual.php b/vendor/phpunit/php-token-stream/src/IsEqual.php deleted file mode 100644 index 70f00af..0000000 --- a/vendor/phpunit/php-token-stream/src/IsEqual.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_IS_EQUAL extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/IsGreaterOrEqual.php b/vendor/phpunit/php-token-stream/src/IsGreaterOrEqual.php deleted file mode 100644 index 0227baf..0000000 --- a/vendor/phpunit/php-token-stream/src/IsGreaterOrEqual.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_IS_GREATER_OR_EQUAL extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/IsIdentical.php b/vendor/phpunit/php-token-stream/src/IsIdentical.php deleted file mode 100644 index 28388df..0000000 --- a/vendor/phpunit/php-token-stream/src/IsIdentical.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_IS_IDENTICAL extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/IsNotEqual.php b/vendor/phpunit/php-token-stream/src/IsNotEqual.php deleted file mode 100644 index f70f229..0000000 --- a/vendor/phpunit/php-token-stream/src/IsNotEqual.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_IS_NOT_EQUAL extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/IsNotIdentical.php b/vendor/phpunit/php-token-stream/src/IsNotIdentical.php deleted file mode 100644 index 9fe3a71..0000000 --- a/vendor/phpunit/php-token-stream/src/IsNotIdentical.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_IS_NOT_IDENTICAL extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/IsSmallerOrEqual.php b/vendor/phpunit/php-token-stream/src/IsSmallerOrEqual.php deleted file mode 100644 index 7ac0c2f..0000000 --- a/vendor/phpunit/php-token-stream/src/IsSmallerOrEqual.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_IS_SMALLER_OR_EQUAL extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Isset.php b/vendor/phpunit/php-token-stream/src/Isset.php deleted file mode 100644 index 47941d6..0000000 --- a/vendor/phpunit/php-token-stream/src/Isset.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_ISSET extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Line.php b/vendor/phpunit/php-token-stream/src/Line.php deleted file mode 100644 index ffed4db..0000000 --- a/vendor/phpunit/php-token-stream/src/Line.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_LINE extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/List.php b/vendor/phpunit/php-token-stream/src/List.php deleted file mode 100644 index 9410fc5..0000000 --- a/vendor/phpunit/php-token-stream/src/List.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_LIST extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Lnumber.php b/vendor/phpunit/php-token-stream/src/Lnumber.php deleted file mode 100644 index e996bd0..0000000 --- a/vendor/phpunit/php-token-stream/src/Lnumber.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_LNUMBER extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/LogicalAnd.php b/vendor/phpunit/php-token-stream/src/LogicalAnd.php deleted file mode 100644 index 72beb47..0000000 --- a/vendor/phpunit/php-token-stream/src/LogicalAnd.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_LOGICAL_AND extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/LogicalOr.php b/vendor/phpunit/php-token-stream/src/LogicalOr.php deleted file mode 100644 index ec8be70..0000000 --- a/vendor/phpunit/php-token-stream/src/LogicalOr.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_LOGICAL_OR extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/LogicalXor.php b/vendor/phpunit/php-token-stream/src/LogicalXor.php deleted file mode 100644 index e1e223b..0000000 --- a/vendor/phpunit/php-token-stream/src/LogicalXor.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_LOGICAL_XOR extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Lt.php b/vendor/phpunit/php-token-stream/src/Lt.php deleted file mode 100644 index 288a413..0000000 --- a/vendor/phpunit/php-token-stream/src/Lt.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_LT extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/MethodC.php b/vendor/phpunit/php-token-stream/src/MethodC.php deleted file mode 100644 index 1bebf00..0000000 --- a/vendor/phpunit/php-token-stream/src/MethodC.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_METHOD_C extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Minus.php b/vendor/phpunit/php-token-stream/src/Minus.php deleted file mode 100644 index 6ca52f5..0000000 --- a/vendor/phpunit/php-token-stream/src/Minus.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_MINUS extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/MinusEqual.php b/vendor/phpunit/php-token-stream/src/MinusEqual.php deleted file mode 100644 index 1bfb24c..0000000 --- a/vendor/phpunit/php-token-stream/src/MinusEqual.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_MINUS_EQUAL extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/ModEqual.php b/vendor/phpunit/php-token-stream/src/ModEqual.php deleted file mode 100644 index 28aab58..0000000 --- a/vendor/phpunit/php-token-stream/src/ModEqual.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_MOD_EQUAL extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/MulEqual.php b/vendor/phpunit/php-token-stream/src/MulEqual.php deleted file mode 100644 index 16a0d24..0000000 --- a/vendor/phpunit/php-token-stream/src/MulEqual.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_MUL_EQUAL extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Mult.php b/vendor/phpunit/php-token-stream/src/Mult.php deleted file mode 100644 index bd6daed..0000000 --- a/vendor/phpunit/php-token-stream/src/Mult.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_MULT extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/NameFullyQualified.php b/vendor/phpunit/php-token-stream/src/NameFullyQualified.php deleted file mode 100644 index 744118a..0000000 --- a/vendor/phpunit/php-token-stream/src/NameFullyQualified.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_NAME_FULLY_QUALIFIED extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/NameQualified.php b/vendor/phpunit/php-token-stream/src/NameQualified.php deleted file mode 100644 index a893144..0000000 --- a/vendor/phpunit/php-token-stream/src/NameQualified.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_NAME_QUALIFIED extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/NameRelative.php b/vendor/phpunit/php-token-stream/src/NameRelative.php deleted file mode 100644 index 0b358cc..0000000 --- a/vendor/phpunit/php-token-stream/src/NameRelative.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_NAME_RELATIVE extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Namespace.php b/vendor/phpunit/php-token-stream/src/Namespace.php deleted file mode 100644 index 634d8ad..0000000 --- a/vendor/phpunit/php-token-stream/src/Namespace.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_NAMESPACE extends PHP_TokenWithScope -{ - /** - * @return string - */ - public function getName() - { - $tokens = $this->tokenStream->tokens(); - $namespace = (string) $tokens[$this->id + 2]; - - for ($i = $this->id + 3;; $i += 2) { - if (isset($tokens[$i]) && - $tokens[$i] instanceof PHP_Token_NS_SEPARATOR) { - $namespace .= '\\' . $tokens[$i + 1]; - } else { - break; - } - } - - return $namespace; - } -} diff --git a/vendor/phpunit/php-token-stream/src/New.php b/vendor/phpunit/php-token-stream/src/New.php deleted file mode 100644 index bd67af2..0000000 --- a/vendor/phpunit/php-token-stream/src/New.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_NEW extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/NsC.php b/vendor/phpunit/php-token-stream/src/NsC.php deleted file mode 100644 index 2778ea4..0000000 --- a/vendor/phpunit/php-token-stream/src/NsC.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_NS_C extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/NsSeparator.php b/vendor/phpunit/php-token-stream/src/NsSeparator.php deleted file mode 100644 index 950291e..0000000 --- a/vendor/phpunit/php-token-stream/src/NsSeparator.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_NS_SEPARATOR extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/NumString.php b/vendor/phpunit/php-token-stream/src/NumString.php deleted file mode 100644 index a073e3d..0000000 --- a/vendor/phpunit/php-token-stream/src/NumString.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_NUM_STRING extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/ObjectCast.php b/vendor/phpunit/php-token-stream/src/ObjectCast.php deleted file mode 100644 index c0ec7d5..0000000 --- a/vendor/phpunit/php-token-stream/src/ObjectCast.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_OBJECT_CAST extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/ObjectOperator.php b/vendor/phpunit/php-token-stream/src/ObjectOperator.php deleted file mode 100644 index a4ca75b..0000000 --- a/vendor/phpunit/php-token-stream/src/ObjectOperator.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_OBJECT_OPERATOR extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/OpenBracket.php b/vendor/phpunit/php-token-stream/src/OpenBracket.php deleted file mode 100644 index 2cb93ed..0000000 --- a/vendor/phpunit/php-token-stream/src/OpenBracket.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_OPEN_BRACKET extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/OpenCurly.php b/vendor/phpunit/php-token-stream/src/OpenCurly.php deleted file mode 100644 index 59c118d..0000000 --- a/vendor/phpunit/php-token-stream/src/OpenCurly.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_OPEN_CURLY extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/OpenSquare.php b/vendor/phpunit/php-token-stream/src/OpenSquare.php deleted file mode 100644 index 04cfefa..0000000 --- a/vendor/phpunit/php-token-stream/src/OpenSquare.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_OPEN_SQUARE extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/OpenTag.php b/vendor/phpunit/php-token-stream/src/OpenTag.php deleted file mode 100644 index d3e0023..0000000 --- a/vendor/phpunit/php-token-stream/src/OpenTag.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_OPEN_TAG extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/OpenTagWithEcho.php b/vendor/phpunit/php-token-stream/src/OpenTagWithEcho.php deleted file mode 100644 index ec981a2..0000000 --- a/vendor/phpunit/php-token-stream/src/OpenTagWithEcho.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_OPEN_TAG_WITH_ECHO extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/OrEqual.php b/vendor/phpunit/php-token-stream/src/OrEqual.php deleted file mode 100644 index 8e7005d..0000000 --- a/vendor/phpunit/php-token-stream/src/OrEqual.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_OR_EQUAL extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/PaamayimNekudotayim.php b/vendor/phpunit/php-token-stream/src/PaamayimNekudotayim.php deleted file mode 100644 index 3185555..0000000 --- a/vendor/phpunit/php-token-stream/src/PaamayimNekudotayim.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_PAAMAYIM_NEKUDOTAYIM extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Percent.php b/vendor/phpunit/php-token-stream/src/Percent.php deleted file mode 100644 index a2baab5..0000000 --- a/vendor/phpunit/php-token-stream/src/Percent.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_PERCENT extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Pipe.php b/vendor/phpunit/php-token-stream/src/Pipe.php deleted file mode 100644 index 4e9438f..0000000 --- a/vendor/phpunit/php-token-stream/src/Pipe.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_PIPE extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Plus.php b/vendor/phpunit/php-token-stream/src/Plus.php deleted file mode 100644 index 5a4ae32..0000000 --- a/vendor/phpunit/php-token-stream/src/Plus.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_PLUS extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/PlusEqual.php b/vendor/phpunit/php-token-stream/src/PlusEqual.php deleted file mode 100644 index 23825f3..0000000 --- a/vendor/phpunit/php-token-stream/src/PlusEqual.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_PLUS_EQUAL extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Pow.php b/vendor/phpunit/php-token-stream/src/Pow.php deleted file mode 100644 index 84276d7..0000000 --- a/vendor/phpunit/php-token-stream/src/Pow.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_POW extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/PowEqual.php b/vendor/phpunit/php-token-stream/src/PowEqual.php deleted file mode 100644 index 5e5288d..0000000 --- a/vendor/phpunit/php-token-stream/src/PowEqual.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_POW_EQUAL extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Print.php b/vendor/phpunit/php-token-stream/src/Print.php deleted file mode 100644 index 72ef8e6..0000000 --- a/vendor/phpunit/php-token-stream/src/Print.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_PRINT extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Private.php b/vendor/phpunit/php-token-stream/src/Private.php deleted file mode 100644 index 0eb36d5..0000000 --- a/vendor/phpunit/php-token-stream/src/Private.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_PRIVATE extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Protected.php b/vendor/phpunit/php-token-stream/src/Protected.php deleted file mode 100644 index 9c9cc33..0000000 --- a/vendor/phpunit/php-token-stream/src/Protected.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_PROTECTED extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Public.php b/vendor/phpunit/php-token-stream/src/Public.php deleted file mode 100644 index b37d4a9..0000000 --- a/vendor/phpunit/php-token-stream/src/Public.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_PUBLIC extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/QuestionMark.php b/vendor/phpunit/php-token-stream/src/QuestionMark.php deleted file mode 100644 index 4202d59..0000000 --- a/vendor/phpunit/php-token-stream/src/QuestionMark.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_QUESTION_MARK extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Require.php b/vendor/phpunit/php-token-stream/src/Require.php deleted file mode 100644 index e18c03f..0000000 --- a/vendor/phpunit/php-token-stream/src/Require.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_REQUIRE extends PHP_Token_Includes -{ -} diff --git a/vendor/phpunit/php-token-stream/src/RequireOnce.php b/vendor/phpunit/php-token-stream/src/RequireOnce.php deleted file mode 100644 index 15628a3..0000000 --- a/vendor/phpunit/php-token-stream/src/RequireOnce.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_REQUIRE_ONCE extends PHP_Token_Includes -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Return.php b/vendor/phpunit/php-token-stream/src/Return.php deleted file mode 100644 index acdbc23..0000000 --- a/vendor/phpunit/php-token-stream/src/Return.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_RETURN extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Semicolon.php b/vendor/phpunit/php-token-stream/src/Semicolon.php deleted file mode 100644 index 47bfa5e..0000000 --- a/vendor/phpunit/php-token-stream/src/Semicolon.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_SEMICOLON extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Sl.php b/vendor/phpunit/php-token-stream/src/Sl.php deleted file mode 100644 index cda5ecc..0000000 --- a/vendor/phpunit/php-token-stream/src/Sl.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_SL extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/SlEqual.php b/vendor/phpunit/php-token-stream/src/SlEqual.php deleted file mode 100644 index 3d8a17e..0000000 --- a/vendor/phpunit/php-token-stream/src/SlEqual.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_SL_EQUAL extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Spaceship.php b/vendor/phpunit/php-token-stream/src/Spaceship.php deleted file mode 100644 index 639a2e3..0000000 --- a/vendor/phpunit/php-token-stream/src/Spaceship.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_SPACESHIP extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Sr.php b/vendor/phpunit/php-token-stream/src/Sr.php deleted file mode 100644 index 749bf0d..0000000 --- a/vendor/phpunit/php-token-stream/src/Sr.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_SR extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/SrEqual.php b/vendor/phpunit/php-token-stream/src/SrEqual.php deleted file mode 100644 index 674039f..0000000 --- a/vendor/phpunit/php-token-stream/src/SrEqual.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_SR_EQUAL extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/StartHeredoc.php b/vendor/phpunit/php-token-stream/src/StartHeredoc.php deleted file mode 100644 index 867a357..0000000 --- a/vendor/phpunit/php-token-stream/src/StartHeredoc.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_START_HEREDOC extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Static.php b/vendor/phpunit/php-token-stream/src/Static.php deleted file mode 100644 index 53307ce..0000000 --- a/vendor/phpunit/php-token-stream/src/Static.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_STATIC extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Stream.php b/vendor/phpunit/php-token-stream/src/Stream.php deleted file mode 100644 index bcdb48a..0000000 --- a/vendor/phpunit/php-token-stream/src/Stream.php +++ /dev/null @@ -1,658 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_Stream implements ArrayAccess, Countable, SeekableIterator -{ - /** - * @var array> - */ - protected static $customTokens = [ - '(' => PHP_Token_OPEN_BRACKET::class, - ')' => PHP_Token_CLOSE_BRACKET::class, - '[' => PHP_Token_OPEN_SQUARE::class, - ']' => PHP_Token_CLOSE_SQUARE::class, - '{' => PHP_Token_OPEN_CURLY::class, - '}' => PHP_Token_CLOSE_CURLY::class, - ';' => PHP_Token_SEMICOLON::class, - '.' => PHP_Token_DOT::class, - ',' => PHP_Token_COMMA::class, - '=' => PHP_Token_EQUAL::class, - '<' => PHP_Token_LT::class, - '>' => PHP_Token_GT::class, - '+' => PHP_Token_PLUS::class, - '-' => PHP_Token_MINUS::class, - '*' => PHP_Token_MULT::class, - '/' => PHP_Token_DIV::class, - '?' => PHP_Token_QUESTION_MARK::class, - '!' => PHP_Token_EXCLAMATION_MARK::class, - ':' => PHP_Token_COLON::class, - '"' => PHP_Token_DOUBLE_QUOTES::class, - '@' => PHP_Token_AT::class, - '&' => PHP_Token_AMPERSAND::class, - '%' => PHP_Token_PERCENT::class, - '|' => PHP_Token_PIPE::class, - '$' => PHP_Token_DOLLAR::class, - '^' => PHP_Token_CARET::class, - '~' => PHP_Token_TILDE::class, - '`' => PHP_Token_BACKTICK::class, - ]; - - /** - * @var string - */ - protected $filename; - - /** - * @var array - */ - protected $tokens = []; - - /** - * @var array - */ - protected $tokensByLine = []; - - /** - * @var int - */ - protected $position = 0; - - /** - * @var array - */ - protected $linesOfCode = ['loc' => 0, 'cloc' => 0, 'ncloc' => 0]; - - /** - * @var array - */ - protected $classes; - - /** - * @var array - */ - protected $functions; - - /** - * @var array - */ - protected $includes; - - /** - * @var array - */ - protected $interfaces; - - /** - * @var array - */ - protected $traits; - - /** - * @var array - */ - protected $lineToFunctionMap = []; - - /** - * Constructor. - * - * @param string $sourceCode - */ - public function __construct($sourceCode) - { - if (\is_file($sourceCode)) { - $this->filename = $sourceCode; - $sourceCode = \file_get_contents($sourceCode); - } - - $this->scan($sourceCode); - } - - /** - * Destructor. - */ - public function __destruct() - { - $this->tokens = []; - $this->tokensByLine = []; - } - - /** - * @return string - */ - public function __toString() - { - $buffer = ''; - - foreach ($this as $token) { - $buffer .= $token; - } - - return $buffer; - } - - /** - * @return string - */ - public function getFilename() - { - return $this->filename; - } - - /** - * @return int - */ - public function count() - { - return \count($this->tokens); - } - - /** - * @return PHP_Token[] - */ - public function tokens() - { - return $this->tokens; - } - - /** - * @return array - */ - public function getClasses() - { - if ($this->classes !== null) { - return $this->classes; - } - - $this->parse(); - - return $this->classes; - } - - /** - * @return array - */ - public function getFunctions() - { - if ($this->functions !== null) { - return $this->functions; - } - - $this->parse(); - - return $this->functions; - } - - /** - * @return array - */ - public function getInterfaces() - { - if ($this->interfaces !== null) { - return $this->interfaces; - } - - $this->parse(); - - return $this->interfaces; - } - - /** - * @return array - */ - public function getTraits() - { - if ($this->traits !== null) { - return $this->traits; - } - - $this->parse(); - - return $this->traits; - } - - /** - * Gets the names of all files that have been included - * using include(), include_once(), require() or require_once(). - * - * Parameter $categorize set to TRUE causing this function to return a - * multi-dimensional array with categories in the keys of the first dimension - * and constants and their values in the second dimension. - * - * Parameter $category allow to filter following specific inclusion type - * - * @param bool $categorize OPTIONAL - * @param string $category OPTIONAL Either 'require_once', 'require', - * 'include_once', 'include' - * - * @return array - */ - public function getIncludes($categorize = false, $category = null) - { - if ($this->includes === null) { - $this->includes = [ - 'require_once' => [], - 'require' => [], - 'include_once' => [], - 'include' => [], - ]; - - foreach ($this->tokens as $token) { - switch (\get_class($token)) { - case PHP_Token_REQUIRE_ONCE::class: - case PHP_Token_REQUIRE::class: - case PHP_Token_INCLUDE_ONCE::class: - case PHP_Token_INCLUDE::class: - $this->includes[$token->getType()][] = $token->getName(); - - break; - } - } - } - - if (isset($this->includes[$category])) { - $includes = $this->includes[$category]; - } elseif ($categorize === false) { - $includes = \array_merge( - $this->includes['require_once'], - $this->includes['require'], - $this->includes['include_once'], - $this->includes['include'] - ); - } else { - $includes = $this->includes; - } - - return $includes; - } - - /** - * Returns the name of the function or method a line belongs to. - * - * @return string or null if the line is not in a function or method - */ - public function getFunctionForLine($line) - { - $this->parse(); - - if (isset($this->lineToFunctionMap[$line])) { - return $this->lineToFunctionMap[$line]; - } - } - - /** - * @return array - */ - public function getLinesOfCode() - { - return $this->linesOfCode; - } - - public function rewind()/*: void*/ - { - $this->position = 0; - } - - /** - * @return bool - */ - public function valid() - { - return isset($this->tokens[$this->position]); - } - - /** - * @return int - */ - public function key() - { - return $this->position; - } - - /** - * @return PHP_Token - */ - public function current() - { - return $this->tokens[$this->position]; - } - - public function next()/*: void*/ - { - $this->position++; - } - - /** - * @param int $offset - * - * @return bool - */ - public function offsetExists($offset) - { - return isset($this->tokens[$offset]); - } - - /** - * @param int $offset - * - * @throws OutOfBoundsException - */ - public function offsetGet($offset) - { - if (!$this->offsetExists($offset)) { - throw new OutOfBoundsException( - \sprintf( - 'No token at position "%s"', - $offset - ) - ); - } - - return $this->tokens[$offset]; - } - - /** - * @param int $offset - */ - public function offsetSet($offset, $value)/*: void*/ - { - $this->tokens[$offset] = $value; - } - - /** - * @param int $offset - * - * @throws OutOfBoundsException - */ - public function offsetUnset($offset)/*: void*/ - { - if (!$this->offsetExists($offset)) { - throw new OutOfBoundsException( - \sprintf( - 'No token at position "%s"', - $offset - ) - ); - } - - unset($this->tokens[$offset]); - } - - /** - * Seek to an absolute position. - * - * @param int $position - * - * @throws OutOfBoundsException - */ - public function seek($position)/*: void*/ - { - $this->position = $position; - - if (!$this->valid()) { - throw new OutOfBoundsException( - \sprintf( - 'No token at position "%s"', - $this->position - ) - ); - } - } - - /** - * Scans the source for sequences of characters and converts them into a - * stream of tokens. - * - * @param string $sourceCode - */ - protected function scan($sourceCode)/*: void*/ - { - $id = 0; - $line = 1; - $tokens = \token_get_all($sourceCode); - $numTokens = \count($tokens); - - $lastNonWhitespaceTokenWasDoubleColon = false; - - $name = null; - - for ($i = 0; $i < $numTokens; ++$i) { - $token = $tokens[$i]; - $skip = 0; - - if (\is_array($token)) { - $name = \substr(\token_name($token[0]), 2); - $text = $token[1]; - - if ($lastNonWhitespaceTokenWasDoubleColon && $name == 'CLASS') { - $name = 'CLASS_NAME_CONSTANT'; - } elseif ($name == 'USE' && isset($tokens[$i + 2][0]) && $tokens[$i + 2][0] == \T_FUNCTION) { - $name = 'USE_FUNCTION'; - $text .= $tokens[$i + 1][1] . $tokens[$i + 2][1]; - $skip = 2; - } - - /** @var class-string $tokenClass */ - $tokenClass = 'PHP_Token_' . $name; - } else { - $text = $token; - $tokenClass = self::$customTokens[$token]; - } - - /* - * @see https://github.com/sebastianbergmann/php-token-stream/issues/95 - */ - if (PHP_MAJOR_VERSION >= 8 && - $name === 'WHITESPACE' && // Current token is T_WHITESPACE - isset($this->tokens[$id - 1]) && // Current token is not the first token - $this->tokens[$id - 1] instanceof PHP_Token_COMMENT && // Previous token is T_COMMENT - strpos((string) $this->tokens[$id - 1], '/*') === false && // Previous token is comment that starts with '#' or '//' - strpos($text, "\n") === 0 // Text of current token begins with newline - ) { - $this->tokens[$id - 1] = new PHP_Token_COMMENT( - $this->tokens[$id - 1] . "\n", - $this->tokens[$id - 1]->getLine(), - $this, - $id - 1 - ); - - $text = substr($text, 1); - - $line++; - - if (empty($text)) { - continue; - } - } - - if (!isset($this->tokensByLine[$line])) { - $this->tokensByLine[$line] = []; - } - - $token = new $tokenClass($text, $line, $this, $id++); - - $this->tokens[] = $token; - $this->tokensByLine[$line][] = $token; - - $line += \substr_count($text, "\n"); - - if ($tokenClass == PHP_Token_HALT_COMPILER::class) { - break; - } - - if ($name == 'DOUBLE_COLON') { - $lastNonWhitespaceTokenWasDoubleColon = true; - } elseif ($name != 'WHITESPACE') { - $lastNonWhitespaceTokenWasDoubleColon = false; - } - - $i += $skip; - } - - foreach ($this->tokens as $token) { - if (!$token instanceof PHP_Token_COMMENT && !$token instanceof PHP_Token_DOC_COMMENT) { - continue; - } - - foreach ($this->tokensByLine[$token->getLine()] as $_token) { - if (!$_token instanceof PHP_Token_COMMENT && !$_token instanceof PHP_Token_DOC_COMMENT && !$_token instanceof PHP_Token_WHITESPACE) { - continue 2; - } - } - - $this->linesOfCode['cloc'] += max(1, \substr_count((string) $token, "\n")); - } - - $this->linesOfCode['loc'] = \substr_count($sourceCode, "\n"); - $this->linesOfCode['ncloc'] = $this->linesOfCode['loc'] - - $this->linesOfCode['cloc']; - } - - protected function parse()/*: void*/ - { - $this->interfaces = []; - $this->classes = []; - $this->traits = []; - $this->functions = []; - $class = []; - $classEndLine = []; - $trait = false; - $traitEndLine = false; - $interface = false; - $interfaceEndLine = false; - - foreach ($this->tokens as $token) { - switch (\get_class($token)) { - case PHP_Token_HALT_COMPILER::class: - return; - - case PHP_Token_INTERFACE::class: - $interface = $token->getName(); - $interfaceEndLine = $token->getEndLine(); - - $this->interfaces[$interface] = [ - 'methods' => [], - 'parent' => $token->getParent(), - 'keywords' => $token->getKeywords(), - 'docblock' => $token->getDocblock(), - 'startLine' => $token->getLine(), - 'endLine' => $interfaceEndLine, - 'package' => $token->getPackage(), - 'file' => $this->filename, - ]; - - break; - - case PHP_Token_CLASS::class: - case PHP_Token_TRAIT::class: - $tmp = [ - 'methods' => [], - 'parent' => $token->getParent(), - 'interfaces'=> $token->getInterfaces(), - 'keywords' => $token->getKeywords(), - 'docblock' => $token->getDocblock(), - 'startLine' => $token->getLine(), - 'endLine' => $token->getEndLine(), - 'package' => $token->getPackage(), - 'file' => $this->filename, - ]; - - if ($token instanceof PHP_Token_CLASS) { - $class[] = $token->getName(); - $classEndLine[] = $token->getEndLine(); - - if ($token->getName() !== null) { - $this->classes[$class[\count($class) - 1]] = $tmp; - } - } else { - $trait = $token->getName(); - $traitEndLine = $token->getEndLine(); - $this->traits[$trait] = $tmp; - } - - break; - - case PHP_Token_FUNCTION::class: - $name = $token->getName(); - $tmp = [ - 'docblock' => $token->getDocblock(), - 'keywords' => $token->getKeywords(), - 'visibility'=> $token->getVisibility(), - 'signature' => $token->getSignature(), - 'startLine' => $token->getLine(), - 'endLine' => $token->getEndLine(), - 'ccn' => $token->getCCN(), - 'file' => $this->filename, - ]; - - if (empty($class) && - $trait === false && - $interface === false) { - $this->functions[$name] = $tmp; - - $this->addFunctionToMap( - $name, - $tmp['startLine'], - $tmp['endLine'] - ); - } elseif (!empty($class)) { - if ($class[\count($class) - 1] !== null) { - $this->classes[$class[\count($class) - 1]]['methods'][$name] = $tmp; - - $this->addFunctionToMap( - $class[\count($class) - 1] . '::' . $name, - $tmp['startLine'], - $tmp['endLine'] - ); - } - } elseif ($trait !== false) { - $this->traits[$trait]['methods'][$name] = $tmp; - - $this->addFunctionToMap( - $trait . '::' . $name, - $tmp['startLine'], - $tmp['endLine'] - ); - } else { - $this->interfaces[$interface]['methods'][$name] = $tmp; - } - - break; - - case PHP_Token_CLOSE_CURLY::class: - if (!empty($classEndLine) && - $classEndLine[\count($classEndLine) - 1] == $token->getLine()) { - \array_pop($classEndLine); - \array_pop($class); - } elseif ($traitEndLine !== false && - $traitEndLine == $token->getLine()) { - $trait = false; - $traitEndLine = false; - } elseif ($interfaceEndLine !== false && - $interfaceEndLine == $token->getLine()) { - $interface = false; - $interfaceEndLine = false; - } - - break; - } - } - } - - /** - * @param string $name - * @param int $startLine - * @param int $endLine - */ - private function addFunctionToMap($name, $startLine, $endLine): void - { - for ($line = $startLine; $line <= $endLine; $line++) { - $this->lineToFunctionMap[$line] = $name; - } - } -} diff --git a/vendor/phpunit/php-token-stream/src/String.php b/vendor/phpunit/php-token-stream/src/String.php deleted file mode 100644 index 89deb00..0000000 --- a/vendor/phpunit/php-token-stream/src/String.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_STRING extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/StringCast.php b/vendor/phpunit/php-token-stream/src/StringCast.php deleted file mode 100644 index f2df377..0000000 --- a/vendor/phpunit/php-token-stream/src/StringCast.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_STRING_CAST extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/StringVarname.php b/vendor/phpunit/php-token-stream/src/StringVarname.php deleted file mode 100644 index 9012f1f..0000000 --- a/vendor/phpunit/php-token-stream/src/StringVarname.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_STRING_VARNAME extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Switch.php b/vendor/phpunit/php-token-stream/src/Switch.php deleted file mode 100644 index 030d43b..0000000 --- a/vendor/phpunit/php-token-stream/src/Switch.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_SWITCH extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Throw.php b/vendor/phpunit/php-token-stream/src/Throw.php deleted file mode 100644 index 213fda0..0000000 --- a/vendor/phpunit/php-token-stream/src/Throw.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_THROW extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Tilde.php b/vendor/phpunit/php-token-stream/src/Tilde.php deleted file mode 100644 index c6c6ca5..0000000 --- a/vendor/phpunit/php-token-stream/src/Tilde.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_TILDE extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Token.php b/vendor/phpunit/php-token-stream/src/Token.php deleted file mode 100644 index d6280f3..0000000 --- a/vendor/phpunit/php-token-stream/src/Token.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -abstract class PHP_Token -{ - /** - * @var string - */ - protected $text; - - /** - * @var int - */ - protected $line; - - /** - * @var PHP_Token_Stream - */ - protected $tokenStream; - - /** - * @var int - */ - protected $id; - - /** - * @param string $text - * @param int $line - * @param int $id - */ - public function __construct($text, $line, PHP_Token_Stream $tokenStream, $id) - { - $this->text = $text; - $this->line = $line; - $this->tokenStream = $tokenStream; - $this->id = $id; - } - - /** - * @return string - */ - public function __toString() - { - return $this->text; - } - - /** - * @return int - */ - public function getLine() - { - return $this->line; - } - - /** - * @return int - */ - public function getId() - { - return $this->id; - } -} diff --git a/vendor/phpunit/php-token-stream/src/TokenWithScope.php b/vendor/phpunit/php-token-stream/src/TokenWithScope.php deleted file mode 100644 index 876b350..0000000 --- a/vendor/phpunit/php-token-stream/src/TokenWithScope.php +++ /dev/null @@ -1,107 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -abstract class PHP_TokenWithScope extends PHP_Token -{ - /** - * @var int - */ - protected $endTokenId; - - /** - * Get the docblock for this token. - * - * This method will fetch the docblock belonging to the current token. The - * docblock must be placed on the line directly above the token to be - * recognized. - * - * @return null|string Returns the docblock as a string if found - */ - public function getDocblock() - { - $tokens = $this->tokenStream->tokens(); - $currentLineNumber = $tokens[$this->id]->getLine(); - $prevLineNumber = $currentLineNumber - 1; - - for ($i = $this->id - 1; $i; $i--) { - if (!isset($tokens[$i])) { - return; - } - - if ($tokens[$i] instanceof PHP_Token_FUNCTION || - $tokens[$i] instanceof PHP_Token_CLASS || - $tokens[$i] instanceof PHP_Token_TRAIT) { - // Some other trait, class or function, no docblock can be - // used for the current token - break; - } - - $line = $tokens[$i]->getLine(); - - if ($line == $currentLineNumber || - ($line == $prevLineNumber && - $tokens[$i] instanceof PHP_Token_WHITESPACE)) { - continue; - } - - if ($line < $currentLineNumber && - !$tokens[$i] instanceof PHP_Token_DOC_COMMENT) { - break; - } - - return (string) $tokens[$i]; - } - } - - /** - * @return int - */ - public function getEndTokenId() - { - $block = 0; - $i = $this->id; - $tokens = $this->tokenStream->tokens(); - - while ($this->endTokenId === null && isset($tokens[$i])) { - if ($tokens[$i] instanceof PHP_Token_OPEN_CURLY || - $tokens[$i] instanceof PHP_Token_DOLLAR_OPEN_CURLY_BRACES || - $tokens[$i] instanceof PHP_Token_CURLY_OPEN) { - $block++; - } elseif ($tokens[$i] instanceof PHP_Token_CLOSE_CURLY) { - $block--; - - if ($block === 0) { - $this->endTokenId = $i; - } - } elseif (($this instanceof PHP_Token_FUNCTION || - $this instanceof PHP_Token_NAMESPACE) && - $tokens[$i] instanceof PHP_Token_SEMICOLON) { - if ($block === 0) { - $this->endTokenId = $i; - } - } - - $i++; - } - - if ($this->endTokenId === null) { - $this->endTokenId = $this->id; - } - - return $this->endTokenId; - } - - /** - * @return int - */ - public function getEndLine() - { - return $this->tokenStream[$this->getEndTokenId()]->getLine(); - } -} diff --git a/vendor/phpunit/php-token-stream/src/TokenWithScopeAndVisibility.php b/vendor/phpunit/php-token-stream/src/TokenWithScopeAndVisibility.php deleted file mode 100644 index fce0c8e..0000000 --- a/vendor/phpunit/php-token-stream/src/TokenWithScopeAndVisibility.php +++ /dev/null @@ -1,67 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -abstract class PHP_TokenWithScopeAndVisibility extends PHP_TokenWithScope -{ - /** - * @return string - */ - public function getVisibility() - { - $tokens = $this->tokenStream->tokens(); - - for ($i = $this->id - 2; $i > $this->id - 7; $i -= 2) { - if (isset($tokens[$i]) && - ($tokens[$i] instanceof PHP_Token_PRIVATE || - $tokens[$i] instanceof PHP_Token_PROTECTED || - $tokens[$i] instanceof PHP_Token_PUBLIC)) { - return \strtolower( - \str_replace('PHP_Token_', '', PHP_Token_Util::getClass($tokens[$i])) - ); - } - - if (isset($tokens[$i]) && - !($tokens[$i] instanceof PHP_Token_STATIC || - $tokens[$i] instanceof PHP_Token_FINAL || - $tokens[$i] instanceof PHP_Token_ABSTRACT)) { - // no keywords; stop visibility search - break; - } - } - } - - /** - * @return string - */ - public function getKeywords() - { - $keywords = []; - $tokens = $this->tokenStream->tokens(); - - for ($i = $this->id - 2; $i > $this->id - 7; $i -= 2) { - if (isset($tokens[$i]) && - ($tokens[$i] instanceof PHP_Token_PRIVATE || - $tokens[$i] instanceof PHP_Token_PROTECTED || - $tokens[$i] instanceof PHP_Token_PUBLIC)) { - continue; - } - - if (isset($tokens[$i]) && - ($tokens[$i] instanceof PHP_Token_STATIC || - $tokens[$i] instanceof PHP_Token_FINAL || - $tokens[$i] instanceof PHP_Token_ABSTRACT)) { - $keywords[] = \strtolower( - \str_replace('PHP_Token_', '', PHP_Token_Util::getClass($tokens[$i])) - ); - } - } - - return \implode(',', $keywords); - } -} diff --git a/vendor/phpunit/php-token-stream/src/Trait.php b/vendor/phpunit/php-token-stream/src/Trait.php deleted file mode 100644 index f635f5d..0000000 --- a/vendor/phpunit/php-token-stream/src/Trait.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_TRAIT extends PHP_Token_INTERFACE -{ -} diff --git a/vendor/phpunit/php-token-stream/src/TraitC.php b/vendor/phpunit/php-token-stream/src/TraitC.php deleted file mode 100644 index ae4b2a5..0000000 --- a/vendor/phpunit/php-token-stream/src/TraitC.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_TRAIT_C extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Try.php b/vendor/phpunit/php-token-stream/src/Try.php deleted file mode 100644 index 8c3783e..0000000 --- a/vendor/phpunit/php-token-stream/src/Try.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_TRY extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Unset.php b/vendor/phpunit/php-token-stream/src/Unset.php deleted file mode 100644 index 3d39d0b..0000000 --- a/vendor/phpunit/php-token-stream/src/Unset.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_UNSET extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/UnsetCast.php b/vendor/phpunit/php-token-stream/src/UnsetCast.php deleted file mode 100644 index 133ef29..0000000 --- a/vendor/phpunit/php-token-stream/src/UnsetCast.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_UNSET_CAST extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Use.php b/vendor/phpunit/php-token-stream/src/Use.php deleted file mode 100644 index e62a549..0000000 --- a/vendor/phpunit/php-token-stream/src/Use.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_USE extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/UseFunction.php b/vendor/phpunit/php-token-stream/src/UseFunction.php deleted file mode 100644 index 8250864..0000000 --- a/vendor/phpunit/php-token-stream/src/UseFunction.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_USE_FUNCTION extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Util.php b/vendor/phpunit/php-token-stream/src/Util.php deleted file mode 100644 index 13b636c..0000000 --- a/vendor/phpunit/php-token-stream/src/Util.php +++ /dev/null @@ -1,18 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -final class PHP_Token_Util -{ - public static function getClass($object): string - { - $parts = \explode('\\', \get_class($object)); - - return \array_pop($parts); - } -} diff --git a/vendor/phpunit/php-token-stream/src/Var.php b/vendor/phpunit/php-token-stream/src/Var.php deleted file mode 100644 index 3dbd16f..0000000 --- a/vendor/phpunit/php-token-stream/src/Var.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_VAR extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Variable.php b/vendor/phpunit/php-token-stream/src/Variable.php deleted file mode 100644 index 921e3ae..0000000 --- a/vendor/phpunit/php-token-stream/src/Variable.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_VARIABLE extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/While.php b/vendor/phpunit/php-token-stream/src/While.php deleted file mode 100644 index e92409f..0000000 --- a/vendor/phpunit/php-token-stream/src/While.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_WHILE extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Whitespace.php b/vendor/phpunit/php-token-stream/src/Whitespace.php deleted file mode 100644 index 6b5b641..0000000 --- a/vendor/phpunit/php-token-stream/src/Whitespace.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_WHITESPACE extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/XorEqual.php b/vendor/phpunit/php-token-stream/src/XorEqual.php deleted file mode 100644 index 0095b28..0000000 --- a/vendor/phpunit/php-token-stream/src/XorEqual.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_XOR_EQUAL extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/Yield.php b/vendor/phpunit/php-token-stream/src/Yield.php deleted file mode 100644 index 3fecb6c..0000000 --- a/vendor/phpunit/php-token-stream/src/Yield.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_YIELD extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/YieldFrom.php b/vendor/phpunit/php-token-stream/src/YieldFrom.php deleted file mode 100644 index 8f1a716..0000000 --- a/vendor/phpunit/php-token-stream/src/YieldFrom.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_YIELD_FROM extends PHP_Token -{ -} diff --git a/vendor/phpunit/php-token-stream/src/break.php b/vendor/phpunit/php-token-stream/src/break.php deleted file mode 100644 index 97e96fe..0000000 --- a/vendor/phpunit/php-token-stream/src/break.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class PHP_Token_BREAK extends PHP_Token -{ -} diff --git a/vendor/phpunit/phpunit/.phpstorm.meta.php b/vendor/phpunit/phpunit/.phpstorm.meta.php deleted file mode 100644 index b69ff78..0000000 --- a/vendor/phpunit/phpunit/.phpstorm.meta.php +++ /dev/null @@ -1,33 +0,0 @@ -"$0"]) - ); - - override( - \PHPUnit\Framework\TestCase::createStub(0), - map([""=>"$0"]) - ); - - override( - \PHPUnit\Framework\TestCase::createConfiguredMock(0), - map([""=>"$0"]) - ); - - override( - \PHPUnit\Framework\TestCase::createPartialMock(0), - map([""=>"$0"]) - ); - - override( - \PHPUnit\Framework\TestCase::createTestProxy(0), - map([""=>"$0"]) - ); - - override( - \PHPUnit\Framework\TestCase::getMockForAbstractClass(0), - map([""=>"$0"]) - ); -} diff --git a/vendor/phpunit/phpunit/ChangeLog-8.5.md b/vendor/phpunit/phpunit/ChangeLog-8.5.md deleted file mode 100644 index 89dd359..0000000 --- a/vendor/phpunit/phpunit/ChangeLog-8.5.md +++ /dev/null @@ -1,215 +0,0 @@ -# Changes in PHPUnit 8.5 - -All notable changes of the PHPUnit 8.5 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. - -## [8.5.22] - 2021-12-25 - -### Changed - -* [#4812](https://github.com/sebastianbergmann/phpunit/issues/4812): Do not enforce time limits when a debugging session through DBGp is active -* [#4835](https://github.com/sebastianbergmann/phpunit/issues/4835): Support for `$GLOBALS['_composer_autoload_path']` introduced in Composer 2.2 - -### Fixed - -* [#4840](https://github.com/sebastianbergmann/phpunit/pull/4840): TestDox prettifying for class names does not correctly handle diacritics -* [#4846](https://github.com/sebastianbergmann/phpunit/pull/4846): Composer proxy script is not ignored - -## [8.5.21] - 2021-09-25 - -### Changed - -* PHPUnit no longer converts PHP deprecations to exceptions by default (configure `convertDeprecationsToExceptions="true"` to enable this) -* The PHPUnit XML configuration file generator now configures `convertDeprecationsToExceptions="true"` - -### Fixed - -* [#4772](https://github.com/sebastianbergmann/phpunit/pull/4772): TestDox HTML report not displayed correctly when browser has custom colour settings - -## [8.5.20] - 2021-08-31 - -### Fixed - -* [#4751](https://github.com/sebastianbergmann/phpunit/issues/4751): Configuration validation fails when using brackets in glob pattern - -## [8.5.19] - 2021-07-31 - -### Fixed - -* [#4740](https://github.com/sebastianbergmann/phpunit/issues/4740): `phpunit.phar` does not work with PHP 8.1 - -## [8.5.18] - 2021-07-19 - -### Fixed - -* [#4720](https://github.com/sebastianbergmann/phpunit/issues/4720): PHPUnit does not verify its own PHP extension requirements - -## [8.5.17] - 2021-06-23 - -### Changed - -* PHPUnit now errors out on startup when `PHP_VERSION` contains a value that is not compatible with `version_compare()`, for instance `X.Y.Z-(to be removed in future macOS)` - -## [8.5.16] - 2021-06-05 - -### Changed - -* The test result cache (the storage for which is implemented in `PHPUnit\Runner\DefaultTestResultCache`) no longer uses PHP's `serialize()` and `unserialize()` functions for persistence. It now uses a versioned JSON format instead that is independent of PHP implementation details (see [#3581](https://github.com/sebastianbergmann/phpunit/issues/3581) and [#4662](https://github.com/sebastianbergmann/phpunit/pull/4662) for examples why this is a problem). When PHPUnit tries to load the test result cache from a file that does not exist, or from a file that does not contain data in JSON format, or from a file that contains data in a JSON format version other than the one used by the currently running PHPUnit version, then this is considered to be a "cache miss". An empty `DefaultTestResultCache` object is created in this case. This should also prevent PHPUnit from crashing when trying to load a test result cache file created by a different version of PHPUnit (see [#4580](https://github.com/sebastianbergmann/phpunit/issues/4580) for example). - -### Fixed - -* [#4663](https://github.com/sebastianbergmann/phpunit/issues/4663): `TestCase::expectError()` works on PHP 7.3, but not on PHP >= 7.4 -* [#4678](https://github.com/sebastianbergmann/phpunit/pull/4678): Stubbed methods with `iterable` return types should return empty array by default -* [#4692](https://github.com/sebastianbergmann/phpunit/issues/4692): Annotations in single-line doc-comments are not handled correctly -* [#4694](https://github.com/sebastianbergmann/phpunit/issues/4694): `TestCase::getMockFromWsdl()` does not work with PHP 8.1-dev - -## [8.5.15] - 2021-03-17 - -### Fixed - -* [#4591](https://github.com/sebastianbergmann/phpunit/issues/4591): TeamCity logger logs warnings as test failures - -## [8.5.14] - 2021-01-17 - -### Fixed - -* [#4535](https://github.com/sebastianbergmann/phpunit/issues/4535): `getMockFromWsdl()` does not handle methods that do not have parameters correctly -* [#4572](https://github.com/sebastianbergmann/phpunit/issues/4572): Schema validation does not work with `%xx` sequences in path to `phpunit.xsd` -* [#4575](https://github.com/sebastianbergmann/phpunit/issues/4575): PHPUnit 8.5 incompatibility with PHP 8.1 - -## [8.5.13] - 2020-12-01 - -### Fixed - -* Running tests in isolated processes did not work with PHP 8 on Windows - -## [8.5.12] - 2020-11-30 - -### Changed - -* Changed PHP version constraint in `composer.json` from `^7.2` to `>=7.2` to allow the installation of PHPUnit 8.5 on PHP 8. Please note that the code coverage functionality is not available for PHPUnit 8.5 on PHP 8. - -### Fixed - -* [#4529](https://github.com/sebastianbergmann/phpunit/issues/4529): Debug mode of Xdebug 2 is not disabled for PHPT tests - -## [8.5.11] - 2020-11-27 - -### Changed - -* Bumped required version of `phpunit/php-code-coverage` - -## [8.5.10] - 2020-11-27 - -### Added - -* Support for Xdebug 3 - -### Fixed - -* [#4516](https://github.com/sebastianbergmann/phpunit/issues/4516): `phpunit/phpunit-selenium` does not work with PHPUnit 8.5.9 - -## [8.5.9] - 2020-11-10 - -### Fixed - -* [#3965](https://github.com/sebastianbergmann/phpunit/issues/3965): Process Isolation throws exceptions when PHPDBG is used -* [#4470](https://github.com/sebastianbergmann/phpunit/pull/4470): Infinite recursion when `--static-backup --strict-global-state` is used - -## [8.5.8] - 2020-06-22 - -### Fixed - -* [#4312](https://github.com/sebastianbergmann/phpunit/issues/4312): Fix for [#4299](https://github.com/sebastianbergmann/phpunit/issues/4299) breaks backward compatibility - -## [8.5.7] - 2020-06-21 - -### Fixed - -* [#4299](https://github.com/sebastianbergmann/phpunit/issues/4299): "No tests executed" does not always result in exit code `1` -* [#4306](https://github.com/sebastianbergmann/phpunit/issues/4306): Exceptions during code coverage driver initialization are not handled correctly - -## [8.5.6] - 2020-06-15 - -### Fixed - -* [#4211](https://github.com/sebastianbergmann/phpunit/issues/4211): `phpdbg_*()` functions are scoped to `PHPUnit\phpdbg_*()` - -## [8.5.5] - 2020-05-22 - -### Fixed - -* [#4033](https://github.com/sebastianbergmann/phpunit/issues/4033): Unexpected behaviour when `$GLOBALS` is deleted - -## [8.5.4] - 2020-04-23 - -### Changed - -* Changed how `PHPUnit\TextUI\Command` passes warnings to `PHPUnit\TextUI\TestRunner` - -## [8.5.3] - 2020-03-31 - -### Fixed - -* [#4017](https://github.com/sebastianbergmann/phpunit/issues/4017): Do not suggest refactoring to something that is also deprecated -* [#4133](https://github.com/sebastianbergmann/phpunit/issues/4133): `expectExceptionMessageRegExp()` has been removed in PHPUnit 9 without a deprecation warning being given in PHPUnit 8 -* [#4139](https://github.com/sebastianbergmann/phpunit/issues/4139): Cannot double interfaces that declare a constructor with PHP 8 -* [#4144](https://github.com/sebastianbergmann/phpunit/issues/4144): Empty objects are converted to empty arrays in JSON comparison failure diff - -## [8.5.2] - 2020-01-08 - -### Removed - -* `eval-stdin.php` has been removed, it was not used anymore since PHPUnit 7.2.7 - -## [8.5.1] - 2019-12-25 - -### Changed - -* `eval-stdin.php` can now only be executed with `cli` and `phpdbg` - -### Fixed - -* [#3983](https://github.com/sebastianbergmann/phpunit/issues/3983): Deprecation warning given too eagerly - -## [8.5.0] - 2019-12-06 - -### Added - -* [#3911](https://github.com/sebastianbergmann/phpunit/issues/3911): Support combined use of `addMethods()` and `onlyMethods()` -* [#3949](https://github.com/sebastianbergmann/phpunit/issues/3949): Introduce specialized assertions `assertFileEqualsCanonicalizing()`, `assertFileEqualsIgnoringCase()`, `assertStringEqualsFileCanonicalizing()`, `assertStringEqualsFileIgnoringCase()`, `assertFileNotEqualsCanonicalizing()`, `assertFileNotEqualsIgnoringCase()`, `assertStringNotEqualsFileCanonicalizing()`, and `assertStringNotEqualsFileIgnoringCase()` as alternative to using `assertFileEquals()` etc. with optional parameters - -### Changed - -* [#3860](https://github.com/sebastianbergmann/phpunit/pull/3860): Deprecate invoking PHPUnit commandline test runner with just a class name -* [#3950](https://github.com/sebastianbergmann/phpunit/issues/3950): Deprecate optional parameters of `assertFileEquals()` etc. -* [#3955](https://github.com/sebastianbergmann/phpunit/issues/3955): Deprecate support for doubling multiple interfaces - -### Fixed - -* [#3953](https://github.com/sebastianbergmann/phpunit/issues/3953): Code Coverage for test executed in isolation does not work when the PHAR is used -* [#3967](https://github.com/sebastianbergmann/phpunit/issues/3967): Cannot double interface that extends interface that extends `\Throwable` -* [#3968](https://github.com/sebastianbergmann/phpunit/pull/3968): Test class run in a separate PHP process are passing when `exit` called inside - -[8.5.22]: https://github.com/sebastianbergmann/phpunit/compare/8.5.21...8.5.22 -[8.5.21]: https://github.com/sebastianbergmann/phpunit/compare/8.5.20...8.5.21 -[8.5.20]: https://github.com/sebastianbergmann/phpunit/compare/8.5.19...8.5.20 -[8.5.19]: https://github.com/sebastianbergmann/phpunit/compare/8.5.18...8.5.19 -[8.5.18]: https://github.com/sebastianbergmann/phpunit/compare/8.5.17...8.5.18 -[8.5.17]: https://github.com/sebastianbergmann/phpunit/compare/8.5.16...8.5.17 -[8.5.16]: https://github.com/sebastianbergmann/phpunit/compare/8.5.15...8.5.16 -[8.5.15]: https://github.com/sebastianbergmann/phpunit/compare/8.5.14...8.5.15 -[8.5.14]: https://github.com/sebastianbergmann/phpunit/compare/8.5.13...8.5.14 -[8.5.13]: https://github.com/sebastianbergmann/phpunit/compare/8.5.12...8.5.13 -[8.5.12]: https://github.com/sebastianbergmann/phpunit/compare/8.5.11...8.5.12 -[8.5.11]: https://github.com/sebastianbergmann/phpunit/compare/8.5.10...8.5.11 -[8.5.10]: https://github.com/sebastianbergmann/phpunit/compare/8.5.9...8.5.10 -[8.5.9]: https://github.com/sebastianbergmann/phpunit/compare/8.5.8...8.5.9 -[8.5.8]: https://github.com/sebastianbergmann/phpunit/compare/8.5.7...8.5.8 -[8.5.7]: https://github.com/sebastianbergmann/phpunit/compare/8.5.6...8.5.7 -[8.5.6]: https://github.com/sebastianbergmann/phpunit/compare/8.5.5...8.5.6 -[8.5.5]: https://github.com/sebastianbergmann/phpunit/compare/8.5.4...8.5.5 -[8.5.4]: https://github.com/sebastianbergmann/phpunit/compare/8.5.3...8.5.4 -[8.5.3]: https://github.com/sebastianbergmann/phpunit/compare/8.5.2...8.5.3 -[8.5.2]: https://github.com/sebastianbergmann/phpunit/compare/8.5.1...8.5.2 -[8.5.1]: https://github.com/sebastianbergmann/phpunit/compare/8.5.0...8.5.1 -[8.5.0]: https://github.com/sebastianbergmann/phpunit/compare/8.4.3...8.5.0 diff --git a/vendor/phpunit/phpunit/LICENSE b/vendor/phpunit/phpunit/LICENSE deleted file mode 100644 index 0e3c9a0..0000000 --- a/vendor/phpunit/phpunit/LICENSE +++ /dev/null @@ -1,33 +0,0 @@ -PHPUnit - -Copyright (c) 2001-2021, Sebastian Bergmann . -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Sebastian Bergmann nor the names of his - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/phpunit/phpunit/README.md b/vendor/phpunit/phpunit/README.md deleted file mode 100644 index c1f474d..0000000 --- a/vendor/phpunit/phpunit/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# PHPUnit - -PHPUnit is a programmer-oriented testing framework for PHP. It is an instance of the xUnit architecture for unit testing frameworks. - -[![Latest Stable Version](https://img.shields.io/packagist/v/phpunit/phpunit.svg?style=flat-square)](https://packagist.org/packages/phpunit/phpunit) -[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.2-8892BF.svg?style=flat-square)](https://php.net/) -[![CI Status](https://github.com/sebastianbergmann/phpunit/workflows/CI/badge.svg?branch=8.5&event=push)](https://phpunit.de/build-status.html) -[![Type Coverage](https://shepherd.dev/github/sebastianbergmann/phpunit/coverage.svg)](https://shepherd.dev/github/sebastianbergmann/phpunit) - -## Installation - -We distribute a [PHP Archive (PHAR)](https://php.net/phar) that has all required (as well as some optional) dependencies of PHPUnit bundled in a single file: - -```bash -$ wget https://phar.phpunit.de/phpunit-X.Y.phar - -$ php phpunit-X.Y.phar --version -``` - -Please replace `X.Y` with the version of PHPUnit you are interested in. - -Alternatively, you may use [Composer](https://getcomposer.org/) to download and install PHPUnit as well as its dependencies. Please refer to the "[Getting Started](https://phpunit.de/getting-started-with-phpunit.html)" guide for details on how to install PHPUnit. - -## Contribute - -Please refer to [CONTRIBUTING.md](https://github.com/sebastianbergmann/phpunit/blob/master/.github/CONTRIBUTING.md) for information on how to contribute to PHPUnit and its related projects. - -## List of Contributors - -Thanks to everyone who has contributed to PHPUnit! You can find a detailed list of contributors on every PHPUnit related package on GitHub. This list shows only the major components: - -* [PHPUnit](https://github.com/sebastianbergmann/phpunit/graphs/contributors) -* [php-code-coverage](https://github.com/sebastianbergmann/php-code-coverage/graphs/contributors) - -A very special thanks to everyone who has contributed to the documentation and helps maintain the translations: - -* [English](https://github.com/sebastianbergmann/phpunit-documentation-english/graphs/contributors) -* [Spanish](https://github.com/sebastianbergmann/phpunit-documentation-spanish/graphs/contributors) -* [French](https://github.com/sebastianbergmann/phpunit-documentation-french/graphs/contributors) -* [Japanese](https://github.com/sebastianbergmann/phpunit-documentation-japanese/graphs/contributors) -* [Brazilian Portuguese](https://github.com/sebastianbergmann/phpunit-documentation-brazilian-portuguese/graphs/contributors) -* [Simplified Chinese](https://github.com/sebastianbergmann/phpunit-documentation-chinese/graphs/contributors) - diff --git a/vendor/phpunit/phpunit/composer.json b/vendor/phpunit/phpunit/composer.json deleted file mode 100644 index 7ca2f67..0000000 --- a/vendor/phpunit/phpunit/composer.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "name": "phpunit/phpunit", - "description": "The PHP Unit Testing framework.", - "type": "library", - "keywords": [ - "phpunit", - "xunit", - "testing" - ], - "homepage": "https://phpunit.de/", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "support": { - "issues": "https://github.com/sebastianbergmann/phpunit/issues" - }, - "prefer-stable": true, - "require": { - "php": ">=7.2", - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "ext-xmlwriter": "*", - "doctrine/instantiator": "^1.3.1", - "myclabs/deep-copy": "^1.10.0", - "phar-io/manifest": "^2.0.3", - "phar-io/version": "^3.0.2", - "phpspec/prophecy": "^1.10.3", - "phpunit/php-code-coverage": "^7.0.12", - "phpunit/php-file-iterator": "^2.0.4", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^2.1.2", - "sebastian/comparator": "^3.0.2", - "sebastian/diff": "^3.0.2", - "sebastian/environment": "^4.2.3", - "sebastian/exporter": "^3.1.2", - "sebastian/global-state": "^3.0.0", - "sebastian/object-enumerator": "^3.0.3", - "sebastian/resource-operations": "^2.0.1", - "sebastian/type": "^1.1.3", - "sebastian/version": "^2.0.1" - }, - "require-dev": { - "ext-PDO": "*" - }, - "config": { - "platform": { - "php": "7.2.0" - }, - "optimize-autoloader": true, - "sort-packages": true - }, - "suggest": { - "phpunit/php-invoker": "^2.0.0", - "ext-soap": "*", - "ext-xdebug": "*" - }, - "bin": [ - "phpunit" - ], - "autoload": { - "classmap": [ - "src/" - ] - }, - "autoload-dev": { - "classmap": [ - "tests/" - ], - "files": [ - "src/Framework/Assert/Functions.php", - "tests/_files/CoverageNamespacedFunctionTest.php", - "tests/_files/CoveredFunction.php", - "tests/_files/NamespaceCoveredFunction.php" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "8.5-dev" - } - } -} diff --git a/vendor/phpunit/phpunit/phpunit b/vendor/phpunit/phpunit/phpunit deleted file mode 100755 index d93f852..0000000 --- a/vendor/phpunit/phpunit/phpunit +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/env php - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (!version_compare(PHP_VERSION, PHP_VERSION, '=')) { - fwrite( - STDERR, - sprintf( - '%s declares an invalid value for PHP_VERSION.' . PHP_EOL . - 'This breaks fundamental functionality such as version_compare().' . PHP_EOL . - 'Please use a different PHP interpreter.' . PHP_EOL, - - PHP_BINARY - ) - ); - - die(1); -} - -if (version_compare('7.2.0', PHP_VERSION, '>')) { - fwrite( - STDERR, - sprintf( - 'This version of PHPUnit requires PHP >= 7.2.' . PHP_EOL . - 'You are using PHP %s (%s).' . PHP_EOL, - PHP_VERSION, - PHP_BINARY - ) - ); - - die(1); -} - -foreach (['dom', 'json', 'libxml', 'mbstring', 'tokenizer', 'xml', 'xmlwriter'] as $extension) { - if (extension_loaded($extension)) { - continue; - } - - fwrite( - STDERR, - sprintf( - 'PHPUnit requires the "%s" extension.' . PHP_EOL, - $extension - ) - ); - - die(1); -} - -if (!ini_get('date.timezone')) { - ini_set('date.timezone', 'UTC'); -} - -if (isset($GLOBALS['_composer_autoload_path'])) { - define('PHPUNIT_COMPOSER_INSTALL', $GLOBALS['_composer_autoload_path']); - - unset($GLOBALS['_composer_autoload_path']); -} else { - foreach (array(__DIR__ . '/../../autoload.php', __DIR__ . '/../vendor/autoload.php', __DIR__ . '/vendor/autoload.php') as $file) { - if (file_exists($file)) { - define('PHPUNIT_COMPOSER_INSTALL', $file); - - break; - } - } - - unset($file); -} - -if (!defined('PHPUNIT_COMPOSER_INSTALL')) { - fwrite( - STDERR, - 'You need to set up the project dependencies using Composer:' . PHP_EOL . PHP_EOL . - ' composer install' . PHP_EOL . PHP_EOL . - 'You can learn all about Composer on https://getcomposer.org/.' . PHP_EOL - ); - - die(1); -} - -$options = getopt('', array('prepend:')); - -if (isset($options['prepend'])) { - require $options['prepend']; -} - -unset($options); - -require PHPUNIT_COMPOSER_INSTALL; - -PHPUnit\TextUI\Command::main(); diff --git a/vendor/phpunit/phpunit/phpunit.xsd b/vendor/phpunit/phpunit/phpunit.xsd deleted file mode 100644 index 1ca094c..0000000 --- a/vendor/phpunit/phpunit/phpunit.xsd +++ /dev/null @@ -1,317 +0,0 @@ - - - - - This Schema file defines the rules by which the XML configuration file of PHPUnit 8.5 may be structured. - - - - - - Root Element - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The main type specifying the document structure - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/phpunit/phpunit/src/Exception.php b/vendor/phpunit/phpunit/src/Exception.php deleted file mode 100644 index 4e7c333..0000000 --- a/vendor/phpunit/phpunit/src/Exception.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit; - -use Throwable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -interface Exception extends Throwable -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/Assert.php b/vendor/phpunit/phpunit/src/Framework/Assert.php deleted file mode 100644 index 030f1a5..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Assert.php +++ /dev/null @@ -1,3655 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -use const DEBUG_BACKTRACE_IGNORE_ARGS; -use const PHP_EOL; -use function array_key_exists; -use function array_shift; -use function array_unshift; -use function assert; -use function class_exists; -use function count; -use function debug_backtrace; -use function explode; -use function file_get_contents; -use function func_get_args; -use function implode; -use function interface_exists; -use function is_array; -use function is_bool; -use function is_int; -use function is_iterable; -use function is_object; -use function is_string; -use function preg_match; -use function preg_split; -use function sprintf; -use function strpos; -use ArrayAccess; -use Countable; -use DOMAttr; -use DOMDocument; -use DOMElement; -use PHPUnit\Framework\Constraint\ArrayHasKey; -use PHPUnit\Framework\Constraint\ArraySubset; -use PHPUnit\Framework\Constraint\Attribute; -use PHPUnit\Framework\Constraint\Callback; -use PHPUnit\Framework\Constraint\ClassHasAttribute; -use PHPUnit\Framework\Constraint\ClassHasStaticAttribute; -use PHPUnit\Framework\Constraint\Constraint; -use PHPUnit\Framework\Constraint\Count; -use PHPUnit\Framework\Constraint\DirectoryExists; -use PHPUnit\Framework\Constraint\FileExists; -use PHPUnit\Framework\Constraint\GreaterThan; -use PHPUnit\Framework\Constraint\IsAnything; -use PHPUnit\Framework\Constraint\IsEmpty; -use PHPUnit\Framework\Constraint\IsEqual; -use PHPUnit\Framework\Constraint\IsFalse; -use PHPUnit\Framework\Constraint\IsFinite; -use PHPUnit\Framework\Constraint\IsIdentical; -use PHPUnit\Framework\Constraint\IsInfinite; -use PHPUnit\Framework\Constraint\IsInstanceOf; -use PHPUnit\Framework\Constraint\IsJson; -use PHPUnit\Framework\Constraint\IsNan; -use PHPUnit\Framework\Constraint\IsNull; -use PHPUnit\Framework\Constraint\IsReadable; -use PHPUnit\Framework\Constraint\IsTrue; -use PHPUnit\Framework\Constraint\IsType; -use PHPUnit\Framework\Constraint\IsWritable; -use PHPUnit\Framework\Constraint\JsonMatches; -use PHPUnit\Framework\Constraint\LessThan; -use PHPUnit\Framework\Constraint\LogicalAnd; -use PHPUnit\Framework\Constraint\LogicalNot; -use PHPUnit\Framework\Constraint\LogicalOr; -use PHPUnit\Framework\Constraint\LogicalXor; -use PHPUnit\Framework\Constraint\ObjectHasAttribute; -use PHPUnit\Framework\Constraint\RegularExpression; -use PHPUnit\Framework\Constraint\SameSize; -use PHPUnit\Framework\Constraint\StringContains; -use PHPUnit\Framework\Constraint\StringEndsWith; -use PHPUnit\Framework\Constraint\StringMatchesFormatDescription; -use PHPUnit\Framework\Constraint\StringStartsWith; -use PHPUnit\Framework\Constraint\TraversableContains; -use PHPUnit\Framework\Constraint\TraversableContainsEqual; -use PHPUnit\Framework\Constraint\TraversableContainsIdentical; -use PHPUnit\Framework\Constraint\TraversableContainsOnly; -use PHPUnit\Util\Type; -use PHPUnit\Util\Xml; -use ReflectionClass; -use ReflectionException; -use ReflectionObject; -use Traversable; - -/** - * A set of assertion methods. - */ -abstract class Assert -{ - /** - * @var int - */ - private static $count = 0; - - /** - * Asserts that an array has a specified key. - * - * @param int|string $key - * @param array|ArrayAccess $array - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - */ - public static function assertArrayHasKey($key, $array, string $message = ''): void - { - if (!(is_int($key) || is_string($key))) { - throw InvalidArgumentException::create( - 1, - 'integer or string' - ); - } - - if (!(is_array($array) || $array instanceof ArrayAccess)) { - throw InvalidArgumentException::create( - 2, - 'array or ArrayAccess' - ); - } - - $constraint = new ArrayHasKey($key); - - static::assertThat($array, $constraint, $message); - } - - /** - * Asserts that an array has a specified subset. - * - * @param array|ArrayAccess $subset - * @param array|ArrayAccess $array - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @codeCoverageIgnore - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3494 - */ - public static function assertArraySubset($subset, $array, bool $checkForObjectIdentity = false, string $message = ''): void - { - self::createWarning('assertArraySubset() is deprecated and will be removed in PHPUnit 9.'); - - if (!(is_array($subset) || $subset instanceof ArrayAccess)) { - throw InvalidArgumentException::create( - 1, - 'array or ArrayAccess' - ); - } - - if (!(is_array($array) || $array instanceof ArrayAccess)) { - throw InvalidArgumentException::create( - 2, - 'array or ArrayAccess' - ); - } - - $constraint = new ArraySubset($subset, $checkForObjectIdentity); - - static::assertThat($array, $constraint, $message); - } - - /** - * Asserts that an array does not have a specified key. - * - * @param int|string $key - * @param array|ArrayAccess $array - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - */ - public static function assertArrayNotHasKey($key, $array, string $message = ''): void - { - if (!(is_int($key) || is_string($key))) { - throw InvalidArgumentException::create( - 1, - 'integer or string' - ); - } - - if (!(is_array($array) || $array instanceof ArrayAccess)) { - throw InvalidArgumentException::create( - 2, - 'array or ArrayAccess' - ); - } - - $constraint = new LogicalNot( - new ArrayHasKey($key) - ); - - static::assertThat($array, $constraint, $message); - } - - /** - * Asserts that a haystack contains a needle. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - */ - public static function assertContains($needle, $haystack, string $message = '', bool $ignoreCase = false, bool $checkForObjectIdentity = true, bool $checkForNonObjectIdentity = false): void - { - // @codeCoverageIgnoreStart - if (is_string($haystack)) { - self::createWarning('Using assertContains() with string haystacks is deprecated and will not be supported in PHPUnit 9. Refactor your test to use assertStringContainsString() or assertStringContainsStringIgnoringCase() instead.'); - } - - if (!$checkForObjectIdentity) { - self::createWarning('The optional $checkForObjectIdentity parameter of assertContains() is deprecated and will be removed in PHPUnit 9. Refactor your test to use assertContainsEquals() instead.'); - } - - if ($checkForNonObjectIdentity) { - self::createWarning('The optional $checkForNonObjectIdentity parameter of assertContains() is deprecated and will be removed in PHPUnit 9.'); - } - - if ($ignoreCase) { - self::createWarning('The optional $ignoreCase parameter of assertContains() is deprecated and will be removed in PHPUnit 9.'); - } - // @codeCoverageIgnoreEnd - - if (is_array($haystack) || - (is_object($haystack) && $haystack instanceof Traversable)) { - $constraint = new TraversableContains( - $needle, - $checkForObjectIdentity, - $checkForNonObjectIdentity - ); - } elseif (is_string($haystack)) { - if (!is_string($needle)) { - throw InvalidArgumentException::create( - 1, - 'string' - ); - } - - $constraint = new StringContains( - $needle, - $ignoreCase - ); - } else { - throw InvalidArgumentException::create( - 2, - 'array, traversable or string' - ); - } - - static::assertThat($haystack, $constraint, $message); - } - - public static function assertContainsEquals($needle, iterable $haystack, string $message = ''): void - { - $constraint = new TraversableContainsEqual($needle); - - static::assertThat($haystack, $constraint, $message); - } - - /** - * Asserts that a haystack that is stored in a static attribute of a class - * or an attribute of an object contains a needle. - * - * @param object|string $haystackClassOrObject - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - */ - public static function assertAttributeContains($needle, string $haystackAttributeName, $haystackClassOrObject, string $message = '', bool $ignoreCase = false, bool $checkForObjectIdentity = true, bool $checkForNonObjectIdentity = false): void - { - self::createWarning('assertAttributeContains() is deprecated and will be removed in PHPUnit 9.'); - - static::assertContains( - $needle, - static::readAttribute($haystackClassOrObject, $haystackAttributeName), - $message, - $ignoreCase, - $checkForObjectIdentity, - $checkForNonObjectIdentity - ); - } - - /** - * Asserts that a haystack does not contain a needle. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - */ - public static function assertNotContains($needle, $haystack, string $message = '', bool $ignoreCase = false, bool $checkForObjectIdentity = true, bool $checkForNonObjectIdentity = false): void - { - // @codeCoverageIgnoreStart - if (is_string($haystack)) { - self::createWarning('Using assertNotContains() with string haystacks is deprecated and will not be supported in PHPUnit 9. Refactor your test to use assertStringNotContainsString() or assertStringNotContainsStringIgnoringCase() instead.'); - } - - if (!$checkForObjectIdentity) { - self::createWarning('The optional $checkForObjectIdentity parameter of assertNotContains() is deprecated and will be removed in PHPUnit 9. Refactor your test to use assertNotContainsEquals() instead.'); - } - - if ($checkForNonObjectIdentity) { - self::createWarning('The optional $checkForNonObjectIdentity parameter of assertNotContains() is deprecated and will be removed in PHPUnit 9.'); - } - - if ($ignoreCase) { - self::createWarning('The optional $ignoreCase parameter of assertNotContains() is deprecated and will be removed in PHPUnit 9.'); - } - // @codeCoverageIgnoreEnd - - if (is_array($haystack) || - (is_object($haystack) && $haystack instanceof Traversable)) { - $constraint = new LogicalNot( - new TraversableContains( - $needle, - $checkForObjectIdentity, - $checkForNonObjectIdentity - ) - ); - } elseif (is_string($haystack)) { - if (!is_string($needle)) { - throw InvalidArgumentException::create( - 1, - 'string' - ); - } - - $constraint = new LogicalNot( - new StringContains( - $needle, - $ignoreCase - ) - ); - } else { - throw InvalidArgumentException::create( - 2, - 'array, traversable or string' - ); - } - - static::assertThat($haystack, $constraint, $message); - } - - public static function assertNotContainsEquals($needle, iterable $haystack, string $message = ''): void - { - $constraint = new LogicalNot(new TraversableContainsEqual($needle)); - - static::assertThat($haystack, $constraint, $message); - } - - /** - * Asserts that a haystack that is stored in a static attribute of a class - * or an attribute of an object does not contain a needle. - * - * @param object|string $haystackClassOrObject - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - */ - public static function assertAttributeNotContains($needle, string $haystackAttributeName, $haystackClassOrObject, string $message = '', bool $ignoreCase = false, bool $checkForObjectIdentity = true, bool $checkForNonObjectIdentity = false): void - { - self::createWarning('assertAttributeNotContains() is deprecated and will be removed in PHPUnit 9.'); - - static::assertNotContains( - $needle, - static::readAttribute($haystackClassOrObject, $haystackAttributeName), - $message, - $ignoreCase, - $checkForObjectIdentity, - $checkForNonObjectIdentity - ); - } - - /** - * Asserts that a haystack contains only values of a given type. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertContainsOnly(string $type, iterable $haystack, ?bool $isNativeType = null, string $message = ''): void - { - if ($isNativeType === null) { - $isNativeType = Type::isType($type); - } - - static::assertThat( - $haystack, - new TraversableContainsOnly( - $type, - $isNativeType - ), - $message - ); - } - - /** - * Asserts that a haystack contains only instances of a given class name. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertContainsOnlyInstancesOf(string $className, iterable $haystack, string $message = ''): void - { - static::assertThat( - $haystack, - new TraversableContainsOnly( - $className, - false - ), - $message - ); - } - - /** - * Asserts that a haystack that is stored in a static attribute of a class - * or an attribute of an object contains only values of a given type. - * - * @param object|string $haystackClassOrObject - * @param bool $isNativeType - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - */ - public static function assertAttributeContainsOnly(string $type, string $haystackAttributeName, $haystackClassOrObject, ?bool $isNativeType = null, string $message = ''): void - { - self::createWarning('assertAttributeContainsOnly() is deprecated and will be removed in PHPUnit 9.'); - - static::assertContainsOnly( - $type, - static::readAttribute($haystackClassOrObject, $haystackAttributeName), - $isNativeType, - $message - ); - } - - /** - * Asserts that a haystack does not contain only values of a given type. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertNotContainsOnly(string $type, iterable $haystack, ?bool $isNativeType = null, string $message = ''): void - { - if ($isNativeType === null) { - $isNativeType = Type::isType($type); - } - - static::assertThat( - $haystack, - new LogicalNot( - new TraversableContainsOnly( - $type, - $isNativeType - ) - ), - $message - ); - } - - /** - * Asserts that a haystack that is stored in a static attribute of a class - * or an attribute of an object does not contain only values of a given - * type. - * - * @param object|string $haystackClassOrObject - * @param bool $isNativeType - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - */ - public static function assertAttributeNotContainsOnly(string $type, string $haystackAttributeName, $haystackClassOrObject, ?bool $isNativeType = null, string $message = ''): void - { - self::createWarning('assertAttributeNotContainsOnly() is deprecated and will be removed in PHPUnit 9.'); - - static::assertNotContainsOnly( - $type, - static::readAttribute($haystackClassOrObject, $haystackAttributeName), - $isNativeType, - $message - ); - } - - /** - * Asserts the number of elements of an array, Countable or Traversable. - * - * @param Countable|iterable $haystack - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - */ - public static function assertCount(int $expectedCount, $haystack, string $message = ''): void - { - if (!$haystack instanceof Countable && !is_iterable($haystack)) { - throw InvalidArgumentException::create(2, 'countable or iterable'); - } - - static::assertThat( - $haystack, - new Count($expectedCount), - $message - ); - } - - /** - * Asserts the number of elements of an array, Countable or Traversable - * that is stored in an attribute. - * - * @param object|string $haystackClassOrObject - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - */ - public static function assertAttributeCount(int $expectedCount, string $haystackAttributeName, $haystackClassOrObject, string $message = ''): void - { - self::createWarning('assertAttributeCount() is deprecated and will be removed in PHPUnit 9.'); - - static::assertCount( - $expectedCount, - static::readAttribute($haystackClassOrObject, $haystackAttributeName), - $message - ); - } - - /** - * Asserts the number of elements of an array, Countable or Traversable. - * - * @param Countable|iterable $haystack - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - */ - public static function assertNotCount(int $expectedCount, $haystack, string $message = ''): void - { - if (!$haystack instanceof Countable && !is_iterable($haystack)) { - throw InvalidArgumentException::create(2, 'countable or iterable'); - } - - $constraint = new LogicalNot( - new Count($expectedCount) - ); - - static::assertThat($haystack, $constraint, $message); - } - - /** - * Asserts the number of elements of an array, Countable or Traversable - * that is stored in an attribute. - * - * @param object|string $haystackClassOrObject - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - */ - public static function assertAttributeNotCount(int $expectedCount, string $haystackAttributeName, $haystackClassOrObject, string $message = ''): void - { - self::createWarning('assertAttributeNotCount() is deprecated and will be removed in PHPUnit 9.'); - - static::assertNotCount( - $expectedCount, - static::readAttribute($haystackClassOrObject, $haystackAttributeName), - $message - ); - } - - /** - * Asserts that two variables are equal. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertEquals($expected, $actual, string $message = '', float $delta = 0.0, int $maxDepth = 10, bool $canonicalize = false, bool $ignoreCase = false): void - { - // @codeCoverageIgnoreStart - if ($delta !== 0.0) { - self::createWarning('The optional $delta parameter of assertEquals() is deprecated and will be removed in PHPUnit 9. Refactor your test to use assertEqualsWithDelta() instead.'); - } - - if ($maxDepth !== 10) { - self::createWarning('The optional $maxDepth parameter of assertEquals() is deprecated and will be removed in PHPUnit 9.'); - } - - if ($canonicalize) { - self::createWarning('The optional $canonicalize parameter of assertEquals() is deprecated and will be removed in PHPUnit 9. Refactor your test to use assertEqualsCanonicalizing() instead.'); - } - - if ($ignoreCase) { - self::createWarning('The optional $ignoreCase parameter of assertEquals() is deprecated and will be removed in PHPUnit 9. Refactor your test to use assertEqualsIgnoringCase() instead.'); - } - // @codeCoverageIgnoreEnd - - $constraint = new IsEqual( - $expected, - $delta, - $maxDepth, - $canonicalize, - $ignoreCase - ); - - static::assertThat($actual, $constraint, $message); - } - - /** - * Asserts that two variables are equal (canonicalizing). - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertEqualsCanonicalizing($expected, $actual, string $message = ''): void - { - $constraint = new IsEqual( - $expected, - 0.0, - 10, - true, - false - ); - - static::assertThat($actual, $constraint, $message); - } - - /** - * Asserts that two variables are equal (ignoring case). - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertEqualsIgnoringCase($expected, $actual, string $message = ''): void - { - $constraint = new IsEqual( - $expected, - 0.0, - 10, - false, - true - ); - - static::assertThat($actual, $constraint, $message); - } - - /** - * Asserts that two variables are equal (with delta). - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertEqualsWithDelta($expected, $actual, float $delta, string $message = ''): void - { - $constraint = new IsEqual( - $expected, - $delta - ); - - static::assertThat($actual, $constraint, $message); - } - - /** - * Asserts that a variable is equal to an attribute of an object. - * - * @param object|string $actualClassOrObject - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - */ - public static function assertAttributeEquals($expected, string $actualAttributeName, $actualClassOrObject, string $message = '', float $delta = 0.0, int $maxDepth = 10, bool $canonicalize = false, bool $ignoreCase = false): void - { - self::createWarning('assertAttributeEquals() is deprecated and will be removed in PHPUnit 9.'); - - static::assertEquals( - $expected, - static::readAttribute($actualClassOrObject, $actualAttributeName), - $message, - $delta, - $maxDepth, - $canonicalize, - $ignoreCase - ); - } - - /** - * Asserts that two variables are not equal. - * - * @param float $delta - * @param int $maxDepth - * @param bool $canonicalize - * @param bool $ignoreCase - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertNotEquals($expected, $actual, string $message = '', $delta = 0.0, $maxDepth = 10, $canonicalize = false, $ignoreCase = false): void - { - // @codeCoverageIgnoreStart - if ($delta !== 0.0) { - self::createWarning('The optional $delta parameter of assertNotEquals() is deprecated and will be removed in PHPUnit 9. Refactor your test to use assertNotEqualsWithDelta() instead.'); - } - - if ($maxDepth !== 10) { - self::createWarning('The optional $maxDepth parameter of assertNotEquals() is deprecated and will be removed in PHPUnit 9.'); - } - - if ($canonicalize) { - self::createWarning('The optional $canonicalize parameter of assertNotEquals() is deprecated and will be removed in PHPUnit 9. Refactor your test to use assertNotEqualsCanonicalizing() instead.'); - } - - if ($ignoreCase) { - self::createWarning('The optional $ignoreCase parameter of assertNotEquals() is deprecated and will be removed in PHPUnit 9. Refactor your test to use assertNotEqualsIgnoringCase() instead.'); - } - // @codeCoverageIgnoreEnd - - $constraint = new LogicalNot( - new IsEqual( - $expected, - $delta, - $maxDepth, - $canonicalize, - $ignoreCase - ) - ); - - static::assertThat($actual, $constraint, $message); - } - - /** - * Asserts that two variables are not equal (canonicalizing). - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertNotEqualsCanonicalizing($expected, $actual, string $message = ''): void - { - $constraint = new LogicalNot( - new IsEqual( - $expected, - 0.0, - 10, - true, - false - ) - ); - - static::assertThat($actual, $constraint, $message); - } - - /** - * Asserts that two variables are not equal (ignoring case). - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertNotEqualsIgnoringCase($expected, $actual, string $message = ''): void - { - $constraint = new LogicalNot( - new IsEqual( - $expected, - 0.0, - 10, - false, - true - ) - ); - - static::assertThat($actual, $constraint, $message); - } - - /** - * Asserts that two variables are not equal (with delta). - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertNotEqualsWithDelta($expected, $actual, float $delta, string $message = ''): void - { - $constraint = new LogicalNot( - new IsEqual( - $expected, - $delta - ) - ); - - static::assertThat($actual, $constraint, $message); - } - - /** - * Asserts that a variable is not equal to an attribute of an object. - * - * @param object|string $actualClassOrObject - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - */ - public static function assertAttributeNotEquals($expected, string $actualAttributeName, $actualClassOrObject, string $message = '', float $delta = 0.0, int $maxDepth = 10, bool $canonicalize = false, bool $ignoreCase = false): void - { - self::createWarning('assertAttributeNotEquals() is deprecated and will be removed in PHPUnit 9.'); - - static::assertNotEquals( - $expected, - static::readAttribute($actualClassOrObject, $actualAttributeName), - $message, - $delta, - $maxDepth, - $canonicalize, - $ignoreCase - ); - } - - /** - * Asserts that a variable is empty. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert empty $actual - */ - public static function assertEmpty($actual, string $message = ''): void - { - static::assertThat($actual, static::isEmpty(), $message); - } - - /** - * Asserts that a static attribute of a class or an attribute of an object - * is empty. - * - * @param object|string $haystackClassOrObject - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - */ - public static function assertAttributeEmpty(string $haystackAttributeName, $haystackClassOrObject, string $message = ''): void - { - self::createWarning('assertAttributeEmpty() is deprecated and will be removed in PHPUnit 9.'); - - static::assertEmpty( - static::readAttribute($haystackClassOrObject, $haystackAttributeName), - $message - ); - } - - /** - * Asserts that a variable is not empty. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !empty $actual - */ - public static function assertNotEmpty($actual, string $message = ''): void - { - static::assertThat($actual, static::logicalNot(static::isEmpty()), $message); - } - - /** - * Asserts that a static attribute of a class or an attribute of an object - * is not empty. - * - * @param object|string $haystackClassOrObject - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - */ - public static function assertAttributeNotEmpty(string $haystackAttributeName, $haystackClassOrObject, string $message = ''): void - { - self::createWarning('assertAttributeNotEmpty() is deprecated and will be removed in PHPUnit 9.'); - - static::assertNotEmpty( - static::readAttribute($haystackClassOrObject, $haystackAttributeName), - $message - ); - } - - /** - * Asserts that a value is greater than another value. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertGreaterThan($expected, $actual, string $message = ''): void - { - static::assertThat($actual, static::greaterThan($expected), $message); - } - - /** - * Asserts that an attribute is greater than another value. - * - * @param object|string $actualClassOrObject - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - */ - public static function assertAttributeGreaterThan($expected, string $actualAttributeName, $actualClassOrObject, string $message = ''): void - { - self::createWarning('assertAttributeGreaterThan() is deprecated and will be removed in PHPUnit 9.'); - - static::assertGreaterThan( - $expected, - static::readAttribute($actualClassOrObject, $actualAttributeName), - $message - ); - } - - /** - * Asserts that a value is greater than or equal to another value. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertGreaterThanOrEqual($expected, $actual, string $message = ''): void - { - static::assertThat( - $actual, - static::greaterThanOrEqual($expected), - $message - ); - } - - /** - * Asserts that an attribute is greater than or equal to another value. - * - * @param object|string $actualClassOrObject - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - */ - public static function assertAttributeGreaterThanOrEqual($expected, string $actualAttributeName, $actualClassOrObject, string $message = ''): void - { - self::createWarning('assertAttributeGreaterThanOrEqual() is deprecated and will be removed in PHPUnit 9.'); - - static::assertGreaterThanOrEqual( - $expected, - static::readAttribute($actualClassOrObject, $actualAttributeName), - $message - ); - } - - /** - * Asserts that a value is smaller than another value. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertLessThan($expected, $actual, string $message = ''): void - { - static::assertThat($actual, static::lessThan($expected), $message); - } - - /** - * Asserts that an attribute is smaller than another value. - * - * @param object|string $actualClassOrObject - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - */ - public static function assertAttributeLessThan($expected, string $actualAttributeName, $actualClassOrObject, string $message = ''): void - { - self::createWarning('assertAttributeLessThan() is deprecated and will be removed in PHPUnit 9.'); - - static::assertLessThan( - $expected, - static::readAttribute($actualClassOrObject, $actualAttributeName), - $message - ); - } - - /** - * Asserts that a value is smaller than or equal to another value. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertLessThanOrEqual($expected, $actual, string $message = ''): void - { - static::assertThat($actual, static::lessThanOrEqual($expected), $message); - } - - /** - * Asserts that an attribute is smaller than or equal to another value. - * - * @param object|string $actualClassOrObject - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - */ - public static function assertAttributeLessThanOrEqual($expected, string $actualAttributeName, $actualClassOrObject, string $message = ''): void - { - self::createWarning('assertAttributeLessThanOrEqual() is deprecated and will be removed in PHPUnit 9.'); - - static::assertLessThanOrEqual( - $expected, - static::readAttribute($actualClassOrObject, $actualAttributeName), - $message - ); - } - - /** - * Asserts that the contents of one file is equal to the contents of another - * file. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertFileEquals(string $expected, string $actual, string $message = '', bool $canonicalize = false, bool $ignoreCase = false): void - { - // @codeCoverageIgnoreStart - if ($canonicalize) { - self::createWarning('The optional $canonicalize parameter of assertFileEquals() is deprecated and will be removed in PHPUnit 9. Refactor your test to use assertFileEqualsCanonicalizing() instead.'); - } - - if ($ignoreCase) { - self::createWarning('The optional $ignoreCase parameter of assertFileEquals() is deprecated and will be removed in PHPUnit 9. Refactor your test to use assertFileEqualsIgnoringCase() instead.'); - } - // @codeCoverageIgnoreEnd - - static::assertFileExists($expected, $message); - static::assertFileExists($actual, $message); - - $constraint = new IsEqual( - file_get_contents($expected), - 0.0, - 10, - $canonicalize, - $ignoreCase - ); - - static::assertThat(file_get_contents($actual), $constraint, $message); - } - - /** - * Asserts that the contents of one file is equal to the contents of another - * file (canonicalizing). - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertFileEqualsCanonicalizing(string $expected, string $actual, string $message = ''): void - { - static::assertFileExists($expected, $message); - static::assertFileExists($actual, $message); - - $constraint = new IsEqual( - file_get_contents($expected), - 0.0, - 10, - true - ); - - static::assertThat(file_get_contents($actual), $constraint, $message); - } - - /** - * Asserts that the contents of one file is equal to the contents of another - * file (ignoring case). - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertFileEqualsIgnoringCase(string $expected, string $actual, string $message = ''): void - { - static::assertFileExists($expected, $message); - static::assertFileExists($actual, $message); - - $constraint = new IsEqual( - file_get_contents($expected), - 0.0, - 10, - false, - true - ); - - static::assertThat(file_get_contents($actual), $constraint, $message); - } - - /** - * Asserts that the contents of one file is not equal to the contents of - * another file. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertFileNotEquals(string $expected, string $actual, string $message = '', bool $canonicalize = false, bool $ignoreCase = false): void - { - // @codeCoverageIgnoreStart - if ($canonicalize) { - self::createWarning('The optional $canonicalize parameter of assertFileNotEquals() is deprecated and will be removed in PHPUnit 9. Refactor your test to use assertFileNotEqualsCanonicalizing() instead.'); - } - - if ($ignoreCase) { - self::createWarning('The optional $ignoreCase parameter of assertFileNotEquals() is deprecated and will be removed in PHPUnit 9. Refactor your test to use assertFileNotEqualsIgnoringCase() instead.'); - } - // @codeCoverageIgnoreEnd - - static::assertFileExists($expected, $message); - static::assertFileExists($actual, $message); - - $constraint = new LogicalNot( - new IsEqual( - file_get_contents($expected), - 0.0, - 10, - $canonicalize, - $ignoreCase - ) - ); - - static::assertThat(file_get_contents($actual), $constraint, $message); - } - - /** - * Asserts that the contents of one file is not equal to the contents of another - * file (canonicalizing). - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertFileNotEqualsCanonicalizing(string $expected, string $actual, string $message = ''): void - { - static::assertFileExists($expected, $message); - static::assertFileExists($actual, $message); - - $constraint = new LogicalNot( - new IsEqual( - file_get_contents($expected), - 0.0, - 10, - true - ) - ); - - static::assertThat(file_get_contents($actual), $constraint, $message); - } - - /** - * Asserts that the contents of one file is not equal to the contents of another - * file (ignoring case). - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertFileNotEqualsIgnoringCase(string $expected, string $actual, string $message = ''): void - { - static::assertFileExists($expected, $message); - static::assertFileExists($actual, $message); - - $constraint = new LogicalNot( - new IsEqual( - file_get_contents($expected), - 0.0, - 10, - false, - true - ) - ); - - static::assertThat(file_get_contents($actual), $constraint, $message); - } - - /** - * Asserts that the contents of a string is equal - * to the contents of a file. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertStringEqualsFile(string $expectedFile, string $actualString, string $message = '', bool $canonicalize = false, bool $ignoreCase = false): void - { - // @codeCoverageIgnoreStart - if ($canonicalize) { - self::createWarning('The optional $canonicalize parameter of assertStringEqualsFile() is deprecated and will be removed in PHPUnit 9. Refactor your test to use assertStringEqualsFileCanonicalizing() instead.'); - } - - if ($ignoreCase) { - self::createWarning('The optional $ignoreCase parameter of assertStringEqualsFile() is deprecated and will be removed in PHPUnit 9. Refactor your test to use assertStringEqualsFileIgnoringCase() instead.'); - } - // @codeCoverageIgnoreEnd - - static::assertFileExists($expectedFile, $message); - - $constraint = new IsEqual( - file_get_contents($expectedFile), - 0.0, - 10, - $canonicalize, - $ignoreCase - ); - - static::assertThat($actualString, $constraint, $message); - } - - /** - * Asserts that the contents of a string is equal - * to the contents of a file (canonicalizing). - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertStringEqualsFileCanonicalizing(string $expectedFile, string $actualString, string $message = ''): void - { - static::assertFileExists($expectedFile, $message); - - $constraint = new IsEqual( - file_get_contents($expectedFile), - 0.0, - 10, - true - ); - - static::assertThat($actualString, $constraint, $message); - } - - /** - * Asserts that the contents of a string is equal - * to the contents of a file (ignoring case). - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertStringEqualsFileIgnoringCase(string $expectedFile, string $actualString, string $message = ''): void - { - static::assertFileExists($expectedFile, $message); - - $constraint = new IsEqual( - file_get_contents($expectedFile), - 0.0, - 10, - false, - true - ); - - static::assertThat($actualString, $constraint, $message); - } - - /** - * Asserts that the contents of a string is not equal - * to the contents of a file. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertStringNotEqualsFile(string $expectedFile, string $actualString, string $message = '', bool $canonicalize = false, bool $ignoreCase = false): void - { - // @codeCoverageIgnoreStart - if ($canonicalize) { - self::createWarning('The optional $canonicalize parameter of assertStringNotEqualsFile() is deprecated and will be removed in PHPUnit 9. Refactor your test to use assertStringNotEqualsFileCanonicalizing() instead.'); - } - - if ($ignoreCase) { - self::createWarning('The optional $ignoreCase parameter of assertStringNotEqualsFile() is deprecated and will be removed in PHPUnit 9. Refactor your test to use assertStringNotEqualsFileIgnoringCase() instead.'); - } - // @codeCoverageIgnoreEnd - - static::assertFileExists($expectedFile, $message); - - $constraint = new LogicalNot( - new IsEqual( - file_get_contents($expectedFile), - 0.0, - 10, - $canonicalize, - $ignoreCase - ) - ); - - static::assertThat($actualString, $constraint, $message); - } - - /** - * Asserts that the contents of a string is not equal - * to the contents of a file (canonicalizing). - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertStringNotEqualsFileCanonicalizing(string $expectedFile, string $actualString, string $message = ''): void - { - static::assertFileExists($expectedFile, $message); - - $constraint = new LogicalNot( - new IsEqual( - file_get_contents($expectedFile), - 0.0, - 10, - true - ) - ); - - static::assertThat($actualString, $constraint, $message); - } - - /** - * Asserts that the contents of a string is not equal - * to the contents of a file (ignoring case). - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertStringNotEqualsFileIgnoringCase(string $expectedFile, string $actualString, string $message = ''): void - { - static::assertFileExists($expectedFile, $message); - - $constraint = new LogicalNot( - new IsEqual( - file_get_contents($expectedFile), - 0.0, - 10, - false, - true - ) - ); - - static::assertThat($actualString, $constraint, $message); - } - - /** - * Asserts that a file/dir is readable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertIsReadable(string $filename, string $message = ''): void - { - static::assertThat($filename, new IsReadable, $message); - } - - /** - * Asserts that a file/dir exists and is not readable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertNotIsReadable(string $filename, string $message = ''): void - { - static::assertThat($filename, new LogicalNot(new IsReadable), $message); - } - - /** - * Asserts that a file/dir exists and is writable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertIsWritable(string $filename, string $message = ''): void - { - static::assertThat($filename, new IsWritable, $message); - } - - /** - * Asserts that a file/dir exists and is not writable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertNotIsWritable(string $filename, string $message = ''): void - { - static::assertThat($filename, new LogicalNot(new IsWritable), $message); - } - - /** - * Asserts that a directory exists. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertDirectoryExists(string $directory, string $message = ''): void - { - static::assertThat($directory, new DirectoryExists, $message); - } - - /** - * Asserts that a directory does not exist. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertDirectoryNotExists(string $directory, string $message = ''): void - { - static::assertThat($directory, new LogicalNot(new DirectoryExists), $message); - } - - /** - * Asserts that a directory exists and is readable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertDirectoryIsReadable(string $directory, string $message = ''): void - { - self::assertDirectoryExists($directory, $message); - self::assertIsReadable($directory, $message); - } - - /** - * Asserts that a directory exists and is not readable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertDirectoryNotIsReadable(string $directory, string $message = ''): void - { - self::assertDirectoryExists($directory, $message); - self::assertNotIsReadable($directory, $message); - } - - /** - * Asserts that a directory exists and is writable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertDirectoryIsWritable(string $directory, string $message = ''): void - { - self::assertDirectoryExists($directory, $message); - self::assertIsWritable($directory, $message); - } - - /** - * Asserts that a directory exists and is not writable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertDirectoryNotIsWritable(string $directory, string $message = ''): void - { - self::assertDirectoryExists($directory, $message); - self::assertNotIsWritable($directory, $message); - } - - /** - * Asserts that a file exists. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertFileExists(string $filename, string $message = ''): void - { - static::assertThat($filename, new FileExists, $message); - } - - /** - * Asserts that a file does not exist. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertFileNotExists(string $filename, string $message = ''): void - { - static::assertThat($filename, new LogicalNot(new FileExists), $message); - } - - /** - * Asserts that a file exists and is readable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertFileIsReadable(string $file, string $message = ''): void - { - self::assertFileExists($file, $message); - self::assertIsReadable($file, $message); - } - - /** - * Asserts that a file exists and is not readable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertFileNotIsReadable(string $file, string $message = ''): void - { - self::assertFileExists($file, $message); - self::assertNotIsReadable($file, $message); - } - - /** - * Asserts that a file exists and is writable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertFileIsWritable(string $file, string $message = ''): void - { - self::assertFileExists($file, $message); - self::assertIsWritable($file, $message); - } - - /** - * Asserts that a file exists and is not writable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertFileNotIsWritable(string $file, string $message = ''): void - { - self::assertFileExists($file, $message); - self::assertNotIsWritable($file, $message); - } - - /** - * Asserts that a condition is true. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert true $condition - */ - public static function assertTrue($condition, string $message = ''): void - { - static::assertThat($condition, static::isTrue(), $message); - } - - /** - * Asserts that a condition is not true. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !true $condition - */ - public static function assertNotTrue($condition, string $message = ''): void - { - static::assertThat($condition, static::logicalNot(static::isTrue()), $message); - } - - /** - * Asserts that a condition is false. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert false $condition - */ - public static function assertFalse($condition, string $message = ''): void - { - static::assertThat($condition, static::isFalse(), $message); - } - - /** - * Asserts that a condition is not false. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !false $condition - */ - public static function assertNotFalse($condition, string $message = ''): void - { - static::assertThat($condition, static::logicalNot(static::isFalse()), $message); - } - - /** - * Asserts that a variable is null. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert null $actual - */ - public static function assertNull($actual, string $message = ''): void - { - static::assertThat($actual, static::isNull(), $message); - } - - /** - * Asserts that a variable is not null. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !null $actual - */ - public static function assertNotNull($actual, string $message = ''): void - { - static::assertThat($actual, static::logicalNot(static::isNull()), $message); - } - - /** - * Asserts that a variable is finite. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertFinite($actual, string $message = ''): void - { - static::assertThat($actual, static::isFinite(), $message); - } - - /** - * Asserts that a variable is infinite. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertInfinite($actual, string $message = ''): void - { - static::assertThat($actual, static::isInfinite(), $message); - } - - /** - * Asserts that a variable is nan. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertNan($actual, string $message = ''): void - { - static::assertThat($actual, static::isNan(), $message); - } - - /** - * Asserts that a class has a specified attribute. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - */ - public static function assertClassHasAttribute(string $attributeName, string $className, string $message = ''): void - { - if (!self::isValidClassAttributeName($attributeName)) { - throw InvalidArgumentException::create(1, 'valid attribute name'); - } - - if (!class_exists($className)) { - throw InvalidArgumentException::create(2, 'class name'); - } - - static::assertThat($className, new ClassHasAttribute($attributeName), $message); - } - - /** - * Asserts that a class does not have a specified attribute. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - */ - public static function assertClassNotHasAttribute(string $attributeName, string $className, string $message = ''): void - { - if (!self::isValidClassAttributeName($attributeName)) { - throw InvalidArgumentException::create(1, 'valid attribute name'); - } - - if (!class_exists($className)) { - throw InvalidArgumentException::create(2, 'class name'); - } - - static::assertThat( - $className, - new LogicalNot( - new ClassHasAttribute($attributeName) - ), - $message - ); - } - - /** - * Asserts that a class has a specified static attribute. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - */ - public static function assertClassHasStaticAttribute(string $attributeName, string $className, string $message = ''): void - { - if (!self::isValidClassAttributeName($attributeName)) { - throw InvalidArgumentException::create(1, 'valid attribute name'); - } - - if (!class_exists($className)) { - throw InvalidArgumentException::create(2, 'class name'); - } - - static::assertThat( - $className, - new ClassHasStaticAttribute($attributeName), - $message - ); - } - - /** - * Asserts that a class does not have a specified static attribute. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - */ - public static function assertClassNotHasStaticAttribute(string $attributeName, string $className, string $message = ''): void - { - if (!self::isValidClassAttributeName($attributeName)) { - throw InvalidArgumentException::create(1, 'valid attribute name'); - } - - if (!class_exists($className)) { - throw InvalidArgumentException::create(2, 'class name'); - } - - static::assertThat( - $className, - new LogicalNot( - new ClassHasStaticAttribute($attributeName) - ), - $message - ); - } - - /** - * Asserts that an object has a specified attribute. - * - * @param object $object - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - */ - public static function assertObjectHasAttribute(string $attributeName, $object, string $message = ''): void - { - if (!self::isValidObjectAttributeName($attributeName)) { - throw InvalidArgumentException::create(1, 'valid attribute name'); - } - - if (!is_object($object)) { - throw InvalidArgumentException::create(2, 'object'); - } - - static::assertThat( - $object, - new ObjectHasAttribute($attributeName), - $message - ); - } - - /** - * Asserts that an object does not have a specified attribute. - * - * @param object $object - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - */ - public static function assertObjectNotHasAttribute(string $attributeName, $object, string $message = ''): void - { - if (!self::isValidObjectAttributeName($attributeName)) { - throw InvalidArgumentException::create(1, 'valid attribute name'); - } - - if (!is_object($object)) { - throw InvalidArgumentException::create(2, 'object'); - } - - static::assertThat( - $object, - new LogicalNot( - new ObjectHasAttribute($attributeName) - ), - $message - ); - } - - /** - * Asserts that two variables have the same type and value. - * Used on objects, it asserts that two variables reference - * the same object. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-template ExpectedType - * @psalm-param ExpectedType $expected - * @psalm-assert =ExpectedType $actual - */ - public static function assertSame($expected, $actual, string $message = ''): void - { - static::assertThat( - $actual, - new IsIdentical($expected), - $message - ); - } - - /** - * Asserts that a variable and an attribute of an object have the same type - * and value. - * - * @param object|string $actualClassOrObject - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - */ - public static function assertAttributeSame($expected, string $actualAttributeName, $actualClassOrObject, string $message = ''): void - { - self::createWarning('assertAttributeSame() is deprecated and will be removed in PHPUnit 9.'); - - static::assertSame( - $expected, - static::readAttribute($actualClassOrObject, $actualAttributeName), - $message - ); - } - - /** - * Asserts that two variables do not have the same type and value. - * Used on objects, it asserts that two variables do not reference - * the same object. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertNotSame($expected, $actual, string $message = ''): void - { - if (is_bool($expected) && is_bool($actual)) { - static::assertNotEquals($expected, $actual, $message); - } - - static::assertThat( - $actual, - new LogicalNot( - new IsIdentical($expected) - ), - $message - ); - } - - /** - * Asserts that a variable and an attribute of an object do not have the - * same type and value. - * - * @param object|string $actualClassOrObject - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - */ - public static function assertAttributeNotSame($expected, string $actualAttributeName, $actualClassOrObject, string $message = ''): void - { - self::createWarning('assertAttributeNotSame() is deprecated and will be removed in PHPUnit 9.'); - - static::assertNotSame( - $expected, - static::readAttribute($actualClassOrObject, $actualAttributeName), - $message - ); - } - - /** - * Asserts that a variable is of a given type. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @psalm-template ExpectedType of object - * @psalm-param class-string $expected - * @psalm-assert =ExpectedType $actual - */ - public static function assertInstanceOf(string $expected, $actual, string $message = ''): void - { - if (!class_exists($expected) && !interface_exists($expected)) { - throw InvalidArgumentException::create(1, 'class or interface name'); - } - - static::assertThat( - $actual, - new IsInstanceOf($expected), - $message - ); - } - - /** - * Asserts that an attribute is of a given type. - * - * @param object|string $classOrObject - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - * - * @psalm-param class-string $expected - */ - public static function assertAttributeInstanceOf(string $expected, string $attributeName, $classOrObject, string $message = ''): void - { - self::createWarning('assertAttributeInstanceOf() is deprecated and will be removed in PHPUnit 9.'); - - static::assertInstanceOf( - $expected, - static::readAttribute($classOrObject, $attributeName), - $message - ); - } - - /** - * Asserts that a variable is not of a given type. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @psalm-template ExpectedType of object - * @psalm-param class-string $expected - * @psalm-assert !ExpectedType $actual - */ - public static function assertNotInstanceOf(string $expected, $actual, string $message = ''): void - { - if (!class_exists($expected) && !interface_exists($expected)) { - throw InvalidArgumentException::create(1, 'class or interface name'); - } - - static::assertThat( - $actual, - new LogicalNot( - new IsInstanceOf($expected) - ), - $message - ); - } - - /** - * Asserts that an attribute is of a given type. - * - * @param object|string $classOrObject - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - * - * @psalm-param class-string $expected - */ - public static function assertAttributeNotInstanceOf(string $expected, string $attributeName, $classOrObject, string $message = ''): void - { - self::createWarning('assertAttributeNotInstanceOf() is deprecated and will be removed in PHPUnit 9.'); - - static::assertNotInstanceOf( - $expected, - static::readAttribute($classOrObject, $attributeName), - $message - ); - } - - /** - * Asserts that a variable is of a given type. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3369 - * @codeCoverageIgnore - */ - public static function assertInternalType(string $expected, $actual, string $message = ''): void - { - self::createWarning( - sprintf( - 'assertInternalType() is deprecated and will be removed in PHPUnit 9. Refactor your test to use %s() instead.', - self::assertInternalTypeReplacement($expected, false) - ) - ); - - static::assertThat( - $actual, - new IsType($expected), - $message - ); - } - - /** - * Asserts that an attribute is of a given type. - * - * @param object|string $classOrObject - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - */ - public static function assertAttributeInternalType(string $expected, string $attributeName, $classOrObject, string $message = ''): void - { - self::createWarning('assertAttributeInternalType() is deprecated and will be removed in PHPUnit 9.'); - - static::assertInternalType( - $expected, - static::readAttribute($classOrObject, $attributeName), - $message - ); - } - - /** - * Asserts that a variable is of type array. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert array $actual - */ - public static function assertIsArray($actual, string $message = ''): void - { - static::assertThat( - $actual, - new IsType(IsType::TYPE_ARRAY), - $message - ); - } - - /** - * Asserts that a variable is of type bool. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert bool $actual - */ - public static function assertIsBool($actual, string $message = ''): void - { - static::assertThat( - $actual, - new IsType(IsType::TYPE_BOOL), - $message - ); - } - - /** - * Asserts that a variable is of type float. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert float $actual - */ - public static function assertIsFloat($actual, string $message = ''): void - { - static::assertThat( - $actual, - new IsType(IsType::TYPE_FLOAT), - $message - ); - } - - /** - * Asserts that a variable is of type int. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert int $actual - */ - public static function assertIsInt($actual, string $message = ''): void - { - static::assertThat( - $actual, - new IsType(IsType::TYPE_INT), - $message - ); - } - - /** - * Asserts that a variable is of type numeric. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert numeric $actual - */ - public static function assertIsNumeric($actual, string $message = ''): void - { - static::assertThat( - $actual, - new IsType(IsType::TYPE_NUMERIC), - $message - ); - } - - /** - * Asserts that a variable is of type object. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert object $actual - */ - public static function assertIsObject($actual, string $message = ''): void - { - static::assertThat( - $actual, - new IsType(IsType::TYPE_OBJECT), - $message - ); - } - - /** - * Asserts that a variable is of type resource. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert resource $actual - */ - public static function assertIsResource($actual, string $message = ''): void - { - static::assertThat( - $actual, - new IsType(IsType::TYPE_RESOURCE), - $message - ); - } - - /** - * Asserts that a variable is of type string. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert string $actual - */ - public static function assertIsString($actual, string $message = ''): void - { - static::assertThat( - $actual, - new IsType(IsType::TYPE_STRING), - $message - ); - } - - /** - * Asserts that a variable is of type scalar. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert scalar $actual - */ - public static function assertIsScalar($actual, string $message = ''): void - { - static::assertThat( - $actual, - new IsType(IsType::TYPE_SCALAR), - $message - ); - } - - /** - * Asserts that a variable is of type callable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert callable $actual - */ - public static function assertIsCallable($actual, string $message = ''): void - { - static::assertThat( - $actual, - new IsType(IsType::TYPE_CALLABLE), - $message - ); - } - - /** - * Asserts that a variable is of type iterable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert iterable $actual - */ - public static function assertIsIterable($actual, string $message = ''): void - { - static::assertThat( - $actual, - new IsType(IsType::TYPE_ITERABLE), - $message - ); - } - - /** - * Asserts that a variable is not of a given type. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3369 - * @codeCoverageIgnore - */ - public static function assertNotInternalType(string $expected, $actual, string $message = ''): void - { - self::createWarning( - sprintf( - 'assertNotInternalType() is deprecated and will be removed in PHPUnit 9. Refactor your test to use %s() instead.', - self::assertInternalTypeReplacement($expected, true) - ) - ); - - static::assertThat( - $actual, - new LogicalNot( - new IsType($expected) - ), - $message - ); - } - - /** - * Asserts that a variable is not of type array. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !array $actual - */ - public static function assertIsNotArray($actual, string $message = ''): void - { - static::assertThat( - $actual, - new LogicalNot(new IsType(IsType::TYPE_ARRAY)), - $message - ); - } - - /** - * Asserts that a variable is not of type bool. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !bool $actual - */ - public static function assertIsNotBool($actual, string $message = ''): void - { - static::assertThat( - $actual, - new LogicalNot(new IsType(IsType::TYPE_BOOL)), - $message - ); - } - - /** - * Asserts that a variable is not of type float. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !float $actual - */ - public static function assertIsNotFloat($actual, string $message = ''): void - { - static::assertThat( - $actual, - new LogicalNot(new IsType(IsType::TYPE_FLOAT)), - $message - ); - } - - /** - * Asserts that a variable is not of type int. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !int $actual - */ - public static function assertIsNotInt($actual, string $message = ''): void - { - static::assertThat( - $actual, - new LogicalNot(new IsType(IsType::TYPE_INT)), - $message - ); - } - - /** - * Asserts that a variable is not of type numeric. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !numeric $actual - */ - public static function assertIsNotNumeric($actual, string $message = ''): void - { - static::assertThat( - $actual, - new LogicalNot(new IsType(IsType::TYPE_NUMERIC)), - $message - ); - } - - /** - * Asserts that a variable is not of type object. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !object $actual - */ - public static function assertIsNotObject($actual, string $message = ''): void - { - static::assertThat( - $actual, - new LogicalNot(new IsType(IsType::TYPE_OBJECT)), - $message - ); - } - - /** - * Asserts that a variable is not of type resource. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !resource $actual - */ - public static function assertIsNotResource($actual, string $message = ''): void - { - static::assertThat( - $actual, - new LogicalNot(new IsType(IsType::TYPE_RESOURCE)), - $message - ); - } - - /** - * Asserts that a variable is not of type string. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !string $actual - */ - public static function assertIsNotString($actual, string $message = ''): void - { - static::assertThat( - $actual, - new LogicalNot(new IsType(IsType::TYPE_STRING)), - $message - ); - } - - /** - * Asserts that a variable is not of type scalar. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !scalar $actual - */ - public static function assertIsNotScalar($actual, string $message = ''): void - { - static::assertThat( - $actual, - new LogicalNot(new IsType(IsType::TYPE_SCALAR)), - $message - ); - } - - /** - * Asserts that a variable is not of type callable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !callable $actual - */ - public static function assertIsNotCallable($actual, string $message = ''): void - { - static::assertThat( - $actual, - new LogicalNot(new IsType(IsType::TYPE_CALLABLE)), - $message - ); - } - - /** - * Asserts that a variable is not of type iterable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !iterable $actual - */ - public static function assertIsNotIterable($actual, string $message = ''): void - { - static::assertThat( - $actual, - new LogicalNot(new IsType(IsType::TYPE_ITERABLE)), - $message - ); - } - - /** - * Asserts that an attribute is of a given type. - * - * @param object|string $classOrObject - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - */ - public static function assertAttributeNotInternalType(string $expected, string $attributeName, $classOrObject, string $message = ''): void - { - self::createWarning('assertAttributeNotInternalType() is deprecated and will be removed in PHPUnit 9.'); - - static::assertNotInternalType( - $expected, - static::readAttribute($classOrObject, $attributeName), - $message - ); - } - - /** - * Asserts that a string matches a given regular expression. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertRegExp(string $pattern, string $string, string $message = ''): void - { - static::assertThat($string, new RegularExpression($pattern), $message); - } - - /** - * Asserts that a string does not match a given regular expression. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertNotRegExp(string $pattern, string $string, string $message = ''): void - { - static::assertThat( - $string, - new LogicalNot( - new RegularExpression($pattern) - ), - $message - ); - } - - /** - * Assert that the size of two arrays (or `Countable` or `Traversable` objects) - * is the same. - * - * @param Countable|iterable $expected - * @param Countable|iterable $actual - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - */ - public static function assertSameSize($expected, $actual, string $message = ''): void - { - if (!$expected instanceof Countable && !is_iterable($expected)) { - throw InvalidArgumentException::create(1, 'countable or iterable'); - } - - if (!$actual instanceof Countable && !is_iterable($actual)) { - throw InvalidArgumentException::create(2, 'countable or iterable'); - } - - static::assertThat( - $actual, - new SameSize($expected), - $message - ); - } - - /** - * Assert that the size of two arrays (or `Countable` or `Traversable` objects) - * is not the same. - * - * @param Countable|iterable $expected - * @param Countable|iterable $actual - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - */ - public static function assertNotSameSize($expected, $actual, string $message = ''): void - { - if (!$expected instanceof Countable && !is_iterable($expected)) { - throw InvalidArgumentException::create(1, 'countable or iterable'); - } - - if (!$actual instanceof Countable && !is_iterable($actual)) { - throw InvalidArgumentException::create(2, 'countable or iterable'); - } - - static::assertThat( - $actual, - new LogicalNot( - new SameSize($expected) - ), - $message - ); - } - - /** - * Asserts that a string matches a given format string. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertStringMatchesFormat(string $format, string $string, string $message = ''): void - { - static::assertThat($string, new StringMatchesFormatDescription($format), $message); - } - - /** - * Asserts that a string does not match a given format string. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertStringNotMatchesFormat(string $format, string $string, string $message = ''): void - { - static::assertThat( - $string, - new LogicalNot( - new StringMatchesFormatDescription($format) - ), - $message - ); - } - - /** - * Asserts that a string matches a given format file. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertStringMatchesFormatFile(string $formatFile, string $string, string $message = ''): void - { - static::assertFileExists($formatFile, $message); - - static::assertThat( - $string, - new StringMatchesFormatDescription( - file_get_contents($formatFile) - ), - $message - ); - } - - /** - * Asserts that a string does not match a given format string. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertStringNotMatchesFormatFile(string $formatFile, string $string, string $message = ''): void - { - static::assertFileExists($formatFile, $message); - - static::assertThat( - $string, - new LogicalNot( - new StringMatchesFormatDescription( - file_get_contents($formatFile) - ) - ), - $message - ); - } - - /** - * Asserts that a string starts with a given prefix. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertStringStartsWith(string $prefix, string $string, string $message = ''): void - { - static::assertThat($string, new StringStartsWith($prefix), $message); - } - - /** - * Asserts that a string starts not with a given prefix. - * - * @param string $prefix - * @param string $string - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertStringStartsNotWith($prefix, $string, string $message = ''): void - { - static::assertThat( - $string, - new LogicalNot( - new StringStartsWith($prefix) - ), - $message - ); - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertStringContainsString(string $needle, string $haystack, string $message = ''): void - { - $constraint = new StringContains($needle, false); - - static::assertThat($haystack, $constraint, $message); - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertStringContainsStringIgnoringCase(string $needle, string $haystack, string $message = ''): void - { - $constraint = new StringContains($needle, true); - - static::assertThat($haystack, $constraint, $message); - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertStringNotContainsString(string $needle, string $haystack, string $message = ''): void - { - $constraint = new LogicalNot(new StringContains($needle)); - - static::assertThat($haystack, $constraint, $message); - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertStringNotContainsStringIgnoringCase(string $needle, string $haystack, string $message = ''): void - { - $constraint = new LogicalNot(new StringContains($needle, true)); - - static::assertThat($haystack, $constraint, $message); - } - - /** - * Asserts that a string ends with a given suffix. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertStringEndsWith(string $suffix, string $string, string $message = ''): void - { - static::assertThat($string, new StringEndsWith($suffix), $message); - } - - /** - * Asserts that a string ends not with a given suffix. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertStringEndsNotWith(string $suffix, string $string, string $message = ''): void - { - static::assertThat( - $string, - new LogicalNot( - new StringEndsWith($suffix) - ), - $message - ); - } - - /** - * Asserts that two XML files are equal. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - */ - public static function assertXmlFileEqualsXmlFile(string $expectedFile, string $actualFile, string $message = ''): void - { - $expected = Xml::loadFile($expectedFile); - $actual = Xml::loadFile($actualFile); - - static::assertEquals($expected, $actual, $message); - } - - /** - * Asserts that two XML files are not equal. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - */ - public static function assertXmlFileNotEqualsXmlFile(string $expectedFile, string $actualFile, string $message = ''): void - { - $expected = Xml::loadFile($expectedFile); - $actual = Xml::loadFile($actualFile); - - static::assertNotEquals($expected, $actual, $message); - } - - /** - * Asserts that two XML documents are equal. - * - * @param DOMDocument|string $actualXml - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - */ - public static function assertXmlStringEqualsXmlFile(string $expectedFile, $actualXml, string $message = ''): void - { - $expected = Xml::loadFile($expectedFile); - $actual = Xml::load($actualXml); - - static::assertEquals($expected, $actual, $message); - } - - /** - * Asserts that two XML documents are not equal. - * - * @param DOMDocument|string $actualXml - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - */ - public static function assertXmlStringNotEqualsXmlFile(string $expectedFile, $actualXml, string $message = ''): void - { - $expected = Xml::loadFile($expectedFile); - $actual = Xml::load($actualXml); - - static::assertNotEquals($expected, $actual, $message); - } - - /** - * Asserts that two XML documents are equal. - * - * @param DOMDocument|string $expectedXml - * @param DOMDocument|string $actualXml - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - */ - public static function assertXmlStringEqualsXmlString($expectedXml, $actualXml, string $message = ''): void - { - $expected = Xml::load($expectedXml); - $actual = Xml::load($actualXml); - - static::assertEquals($expected, $actual, $message); - } - - /** - * Asserts that two XML documents are not equal. - * - * @param DOMDocument|string $expectedXml - * @param DOMDocument|string $actualXml - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - */ - public static function assertXmlStringNotEqualsXmlString($expectedXml, $actualXml, string $message = ''): void - { - $expected = Xml::load($expectedXml); - $actual = Xml::load($actualXml); - - static::assertNotEquals($expected, $actual, $message); - } - - /** - * Asserts that a hierarchy of DOMElements matches. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws AssertionFailedError - * @throws ExpectationFailedException - */ - public static function assertEqualXMLStructure(DOMElement $expectedElement, DOMElement $actualElement, bool $checkAttributes = false, string $message = ''): void - { - $expectedElement = Xml::import($expectedElement); - $actualElement = Xml::import($actualElement); - - static::assertSame( - $expectedElement->tagName, - $actualElement->tagName, - $message - ); - - if ($checkAttributes) { - static::assertSame( - $expectedElement->attributes->length, - $actualElement->attributes->length, - sprintf( - '%s%sNumber of attributes on node "%s" does not match', - $message, - !empty($message) ? "\n" : '', - $expectedElement->tagName - ) - ); - - for ($i = 0; $i < $expectedElement->attributes->length; $i++) { - $expectedAttribute = $expectedElement->attributes->item($i); - $actualAttribute = $actualElement->attributes->getNamedItem($expectedAttribute->name); - - assert($expectedAttribute instanceof DOMAttr); - - if (!$actualAttribute) { - static::fail( - sprintf( - '%s%sCould not find attribute "%s" on node "%s"', - $message, - !empty($message) ? "\n" : '', - $expectedAttribute->name, - $expectedElement->tagName - ) - ); - } - } - } - - Xml::removeCharacterDataNodes($expectedElement); - Xml::removeCharacterDataNodes($actualElement); - - static::assertSame( - $expectedElement->childNodes->length, - $actualElement->childNodes->length, - sprintf( - '%s%sNumber of child nodes of "%s" differs', - $message, - !empty($message) ? "\n" : '', - $expectedElement->tagName - ) - ); - - for ($i = 0; $i < $expectedElement->childNodes->length; $i++) { - static::assertEqualXMLStructure( - $expectedElement->childNodes->item($i), - $actualElement->childNodes->item($i), - $checkAttributes, - $message - ); - } - } - - /** - * Evaluates a PHPUnit\Framework\Constraint matcher object. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertThat($value, Constraint $constraint, string $message = ''): void - { - self::$count += count($constraint); - - $constraint->evaluate($value, $message); - } - - /** - * Asserts that a string is a valid JSON string. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertJson(string $actualJson, string $message = ''): void - { - static::assertThat($actualJson, static::isJson(), $message); - } - - /** - * Asserts that two given JSON encoded objects or arrays are equal. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertJsonStringEqualsJsonString(string $expectedJson, string $actualJson, string $message = ''): void - { - static::assertJson($expectedJson, $message); - static::assertJson($actualJson, $message); - - static::assertThat($actualJson, new JsonMatches($expectedJson), $message); - } - - /** - * Asserts that two given JSON encoded objects or arrays are not equal. - * - * @param string $expectedJson - * @param string $actualJson - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertJsonStringNotEqualsJsonString($expectedJson, $actualJson, string $message = ''): void - { - static::assertJson($expectedJson, $message); - static::assertJson($actualJson, $message); - - static::assertThat( - $actualJson, - new LogicalNot( - new JsonMatches($expectedJson) - ), - $message - ); - } - - /** - * Asserts that the generated JSON encoded object and the content of the given file are equal. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertJsonStringEqualsJsonFile(string $expectedFile, string $actualJson, string $message = ''): void - { - static::assertFileExists($expectedFile, $message); - $expectedJson = file_get_contents($expectedFile); - - static::assertJson($expectedJson, $message); - static::assertJson($actualJson, $message); - - static::assertThat($actualJson, new JsonMatches($expectedJson), $message); - } - - /** - * Asserts that the generated JSON encoded object and the content of the given file are not equal. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertJsonStringNotEqualsJsonFile(string $expectedFile, string $actualJson, string $message = ''): void - { - static::assertFileExists($expectedFile, $message); - $expectedJson = file_get_contents($expectedFile); - - static::assertJson($expectedJson, $message); - static::assertJson($actualJson, $message); - - static::assertThat( - $actualJson, - new LogicalNot( - new JsonMatches($expectedJson) - ), - $message - ); - } - - /** - * Asserts that two JSON files are equal. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertJsonFileEqualsJsonFile(string $expectedFile, string $actualFile, string $message = ''): void - { - static::assertFileExists($expectedFile, $message); - static::assertFileExists($actualFile, $message); - - $actualJson = file_get_contents($actualFile); - $expectedJson = file_get_contents($expectedFile); - - static::assertJson($expectedJson, $message); - static::assertJson($actualJson, $message); - - $constraintExpected = new JsonMatches( - $expectedJson - ); - - $constraintActual = new JsonMatches($actualJson); - - static::assertThat($expectedJson, $constraintActual, $message); - static::assertThat($actualJson, $constraintExpected, $message); - } - - /** - * Asserts that two JSON files are not equal. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertJsonFileNotEqualsJsonFile(string $expectedFile, string $actualFile, string $message = ''): void - { - static::assertFileExists($expectedFile, $message); - static::assertFileExists($actualFile, $message); - - $actualJson = file_get_contents($actualFile); - $expectedJson = file_get_contents($expectedFile); - - static::assertJson($expectedJson, $message); - static::assertJson($actualJson, $message); - - $constraintExpected = new JsonMatches( - $expectedJson - ); - - $constraintActual = new JsonMatches($actualJson); - - static::assertThat($expectedJson, new LogicalNot($constraintActual), $message); - static::assertThat($actualJson, new LogicalNot($constraintExpected), $message); - } - - /** - * @throws Exception - */ - public static function logicalAnd(): LogicalAnd - { - $constraints = func_get_args(); - - $constraint = new LogicalAnd; - $constraint->setConstraints($constraints); - - return $constraint; - } - - public static function logicalOr(): LogicalOr - { - $constraints = func_get_args(); - - $constraint = new LogicalOr; - $constraint->setConstraints($constraints); - - return $constraint; - } - - public static function logicalNot(Constraint $constraint): LogicalNot - { - return new LogicalNot($constraint); - } - - public static function logicalXor(): LogicalXor - { - $constraints = func_get_args(); - - $constraint = new LogicalXor; - $constraint->setConstraints($constraints); - - return $constraint; - } - - public static function anything(): IsAnything - { - return new IsAnything; - } - - public static function isTrue(): IsTrue - { - return new IsTrue; - } - - /** - * @psalm-template CallbackInput of mixed - * - * @psalm-param callable(CallbackInput $callback): bool $callback - * - * @psalm-return Callback - */ - public static function callback(callable $callback): Callback - { - return new Callback($callback); - } - - public static function isFalse(): IsFalse - { - return new IsFalse; - } - - public static function isJson(): IsJson - { - return new IsJson; - } - - public static function isNull(): IsNull - { - return new IsNull; - } - - public static function isFinite(): IsFinite - { - return new IsFinite; - } - - public static function isInfinite(): IsInfinite - { - return new IsInfinite; - } - - public static function isNan(): IsNan - { - return new IsNan; - } - - /** - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - */ - public static function attribute(Constraint $constraint, string $attributeName): Attribute - { - self::createWarning('attribute() is deprecated and will be removed in PHPUnit 9.'); - - return new Attribute($constraint, $attributeName); - } - - /** - * @deprecated Use containsEqual() or containsIdentical() instead - */ - public static function contains($value, bool $checkForObjectIdentity = true, bool $checkForNonObjectIdentity = false): TraversableContains - { - return new TraversableContains($value, $checkForObjectIdentity, $checkForNonObjectIdentity); - } - - public static function containsEqual($value): TraversableContainsEqual - { - return new TraversableContainsEqual($value); - } - - public static function containsIdentical($value): TraversableContainsIdentical - { - return new TraversableContainsIdentical($value); - } - - public static function containsOnly(string $type): TraversableContainsOnly - { - return new TraversableContainsOnly($type); - } - - public static function containsOnlyInstancesOf(string $className): TraversableContainsOnly - { - return new TraversableContainsOnly($className, false); - } - - /** - * @param int|string $key - */ - public static function arrayHasKey($key): ArrayHasKey - { - return new ArrayHasKey($key); - } - - public static function equalTo($value, float $delta = 0.0, int $maxDepth = 10, bool $canonicalize = false, bool $ignoreCase = false): IsEqual - { - return new IsEqual($value, $delta, $maxDepth, $canonicalize, $ignoreCase); - } - - /** - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - */ - public static function attributeEqualTo(string $attributeName, $value, float $delta = 0.0, int $maxDepth = 10, bool $canonicalize = false, bool $ignoreCase = false): Attribute - { - self::createWarning('attributeEqualTo() is deprecated and will be removed in PHPUnit 9.'); - - return static::attribute( - static::equalTo( - $value, - $delta, - $maxDepth, - $canonicalize, - $ignoreCase - ), - $attributeName - ); - } - - public static function isEmpty(): IsEmpty - { - return new IsEmpty; - } - - public static function isWritable(): IsWritable - { - return new IsWritable; - } - - public static function isReadable(): IsReadable - { - return new IsReadable; - } - - public static function directoryExists(): DirectoryExists - { - return new DirectoryExists; - } - - public static function fileExists(): FileExists - { - return new FileExists; - } - - public static function greaterThan($value): GreaterThan - { - return new GreaterThan($value); - } - - public static function greaterThanOrEqual($value): LogicalOr - { - return static::logicalOr( - new IsEqual($value), - new GreaterThan($value) - ); - } - - public static function classHasAttribute(string $attributeName): ClassHasAttribute - { - return new ClassHasAttribute($attributeName); - } - - public static function classHasStaticAttribute(string $attributeName): ClassHasStaticAttribute - { - return new ClassHasStaticAttribute($attributeName); - } - - public static function objectHasAttribute($attributeName): ObjectHasAttribute - { - return new ObjectHasAttribute($attributeName); - } - - public static function identicalTo($value): IsIdentical - { - return new IsIdentical($value); - } - - public static function isInstanceOf(string $className): IsInstanceOf - { - return new IsInstanceOf($className); - } - - public static function isType(string $type): IsType - { - return new IsType($type); - } - - public static function lessThan($value): LessThan - { - return new LessThan($value); - } - - public static function lessThanOrEqual($value): LogicalOr - { - return static::logicalOr( - new IsEqual($value), - new LessThan($value) - ); - } - - public static function matchesRegularExpression(string $pattern): RegularExpression - { - return new RegularExpression($pattern); - } - - public static function matches(string $string): StringMatchesFormatDescription - { - return new StringMatchesFormatDescription($string); - } - - public static function stringStartsWith($prefix): StringStartsWith - { - return new StringStartsWith($prefix); - } - - public static function stringContains(string $string, bool $case = true): StringContains - { - return new StringContains($string, $case); - } - - public static function stringEndsWith(string $suffix): StringEndsWith - { - return new StringEndsWith($suffix); - } - - public static function countOf(int $count): Count - { - return new Count($count); - } - - /** - * Fails a test with the given message. - * - * @throws AssertionFailedError - * - * @psalm-return never-return - */ - public static function fail(string $message = ''): void - { - self::$count++; - - throw new AssertionFailedError($message); - } - - /** - * Returns the value of an attribute of a class or an object. - * This also works for attributes that are declared protected or private. - * - * @param object|string $classOrObject - * - * @throws Exception - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - */ - public static function readAttribute($classOrObject, string $attributeName) - { - self::createWarning('readAttribute() is deprecated and will be removed in PHPUnit 9.'); - - if (!self::isValidClassAttributeName($attributeName)) { - throw InvalidArgumentException::create(2, 'valid attribute name'); - } - - if (is_string($classOrObject)) { - if (!class_exists($classOrObject)) { - throw InvalidArgumentException::create( - 1, - 'class name' - ); - } - - return static::getStaticAttribute( - $classOrObject, - $attributeName - ); - } - - if (is_object($classOrObject)) { - return static::getObjectAttribute( - $classOrObject, - $attributeName - ); - } - - throw InvalidArgumentException::create( - 1, - 'class name or object' - ); - } - - /** - * Returns the value of a static attribute. - * This also works for attributes that are declared protected or private. - * - * @throws Exception - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - */ - public static function getStaticAttribute(string $className, string $attributeName) - { - self::createWarning('getStaticAttribute() is deprecated and will be removed in PHPUnit 9.'); - - if (!class_exists($className)) { - throw InvalidArgumentException::create(1, 'class name'); - } - - if (!self::isValidClassAttributeName($attributeName)) { - throw InvalidArgumentException::create(2, 'valid attribute name'); - } - - try { - $class = new ReflectionClass($className); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - while ($class) { - $attributes = $class->getStaticProperties(); - - if (array_key_exists($attributeName, $attributes)) { - return $attributes[$attributeName]; - } - - $class = $class->getParentClass(); - } - - throw new Exception( - sprintf( - 'Attribute "%s" not found in class.', - $attributeName - ) - ); - } - - /** - * Returns the value of an object's attribute. - * This also works for attributes that are declared protected or private. - * - * @param object $object - * - * @throws Exception - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - */ - public static function getObjectAttribute($object, string $attributeName) - { - self::createWarning('getObjectAttribute() is deprecated and will be removed in PHPUnit 9.'); - - if (!is_object($object)) { - throw InvalidArgumentException::create(1, 'object'); - } - - if (!self::isValidClassAttributeName($attributeName)) { - throw InvalidArgumentException::create(2, 'valid attribute name'); - } - - $reflector = new ReflectionObject($object); - - do { - try { - $attribute = $reflector->getProperty($attributeName); - - if (!$attribute || $attribute->isPublic()) { - return $object->{$attributeName}; - } - - $attribute->setAccessible(true); - $value = $attribute->getValue($object); - $attribute->setAccessible(false); - - return $value; - } catch (ReflectionException $e) { - } - } while ($reflector = $reflector->getParentClass()); - - throw new Exception( - sprintf( - 'Attribute "%s" not found in object.', - $attributeName - ) - ); - } - - /** - * Mark the test as incomplete. - * - * @throws IncompleteTestError - * - * @psalm-return never-return - */ - public static function markTestIncomplete(string $message = ''): void - { - throw new IncompleteTestError($message); - } - - /** - * Mark the test as skipped. - * - * @throws SkippedTestError - * @throws SyntheticSkippedError - * - * @psalm-return never-return - */ - public static function markTestSkipped(string $message = ''): void - { - if ($hint = self::detectLocationHint($message)) { - $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); - array_unshift($trace, $hint); - - throw new SyntheticSkippedError($hint['message'], 0, $hint['file'], (int) $hint['line'], $trace); - } - - throw new SkippedTestError($message); - } - - /** - * Return the current assertion count. - */ - public static function getCount(): int - { - return self::$count; - } - - /** - * Reset the assertion counter. - */ - public static function resetCount(): void - { - self::$count = 0; - } - - private static function detectLocationHint(string $message): ?array - { - $hint = null; - $lines = preg_split('/\r\n|\r|\n/', $message); - - while (strpos($lines[0], '__OFFSET') !== false) { - $offset = explode('=', array_shift($lines)); - - if ($offset[0] === '__OFFSET_FILE') { - $hint['file'] = $offset[1]; - } - - if ($offset[0] === '__OFFSET_LINE') { - $hint['line'] = $offset[1]; - } - } - - if ($hint) { - $hint['message'] = implode(PHP_EOL, $lines); - } - - return $hint; - } - - private static function isValidObjectAttributeName(string $attributeName): bool - { - return (bool) preg_match('/[^\x00-\x1f\x7f-\x9f]+/', $attributeName); - } - - private static function isValidClassAttributeName(string $attributeName): bool - { - return (bool) preg_match('/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/', $attributeName); - } - - /** - * @codeCoverageIgnore - */ - private static function createWarning(string $warning): void - { - foreach (debug_backtrace() as $step) { - if (isset($step['object']) && $step['object'] instanceof TestCase) { - assert($step['object'] instanceof TestCase); - - $step['object']->addWarning($warning); - - break; - } - } - } - - /** - * @throws Exception - */ - private static function assertInternalTypeReplacement(string $type, bool $not): string - { - switch ($type) { - case 'numeric': - return 'assertIs' . ($not ? 'Not' : '') . 'Numeric'; - - case 'integer': - case 'int': - return 'assertIs' . ($not ? 'Not' : '') . 'Int'; - - case 'double': - case 'float': - case 'real': - return 'assertIs' . ($not ? 'Not' : '') . 'Float'; - - case 'string': - return 'assertIs' . ($not ? 'Not' : '') . 'String'; - - case 'boolean': - case 'bool': - return 'assertIs' . ($not ? 'Not' : '') . 'Bool'; - - case 'null': - return 'assert' . ($not ? 'Not' : '') . 'Null'; - - case 'array': - return 'assertIs' . ($not ? 'Not' : '') . 'Array'; - - case 'object': - return 'assertIs' . ($not ? 'Not' : '') . 'Object'; - - case 'resource': - return 'assertIs' . ($not ? 'Not' : '') . 'Resource'; - - case 'scalar': - return 'assertIs' . ($not ? 'Not' : '') . 'Scalar'; - - case 'callable': - return 'assertIs' . ($not ? 'Not' : '') . 'Callable'; - - case 'iterable': - return 'assertIs' . ($not ? 'Not' : '') . 'Iterable'; - } - - throw new Exception( - sprintf( - '"%s" is not a type supported by assertInternalType() / assertNotInternalType()', - $type - ) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Assert/Functions.php b/vendor/phpunit/phpunit/src/Framework/Assert/Functions.php deleted file mode 100644 index 6af388b..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Assert/Functions.php +++ /dev/null @@ -1,3009 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -use PHPUnit\Framework\Assert; -use PHPUnit\Framework\AssertionFailedError; -use PHPUnit\Framework\Constraint\ArrayHasKey; -use PHPUnit\Framework\Constraint\Attribute; -use PHPUnit\Framework\Constraint\Callback; -use PHPUnit\Framework\Constraint\ClassHasAttribute; -use PHPUnit\Framework\Constraint\ClassHasStaticAttribute; -use PHPUnit\Framework\Constraint\Constraint; -use PHPUnit\Framework\Constraint\Count; -use PHPUnit\Framework\Constraint\DirectoryExists; -use PHPUnit\Framework\Constraint\FileExists; -use PHPUnit\Framework\Constraint\GreaterThan; -use PHPUnit\Framework\Constraint\IsAnything; -use PHPUnit\Framework\Constraint\IsEmpty; -use PHPUnit\Framework\Constraint\IsEqual; -use PHPUnit\Framework\Constraint\IsFalse; -use PHPUnit\Framework\Constraint\IsFinite; -use PHPUnit\Framework\Constraint\IsIdentical; -use PHPUnit\Framework\Constraint\IsInfinite; -use PHPUnit\Framework\Constraint\IsInstanceOf; -use PHPUnit\Framework\Constraint\IsJson; -use PHPUnit\Framework\Constraint\IsNan; -use PHPUnit\Framework\Constraint\IsNull; -use PHPUnit\Framework\Constraint\IsReadable; -use PHPUnit\Framework\Constraint\IsTrue; -use PHPUnit\Framework\Constraint\IsType; -use PHPUnit\Framework\Constraint\IsWritable; -use PHPUnit\Framework\Constraint\LessThan; -use PHPUnit\Framework\Constraint\LogicalAnd; -use PHPUnit\Framework\Constraint\LogicalNot; -use PHPUnit\Framework\Constraint\LogicalOr; -use PHPUnit\Framework\Constraint\LogicalXor; -use PHPUnit\Framework\Constraint\ObjectHasAttribute; -use PHPUnit\Framework\Constraint\RegularExpression; -use PHPUnit\Framework\Constraint\StringContains; -use PHPUnit\Framework\Constraint\StringEndsWith; -use PHPUnit\Framework\Constraint\StringMatchesFormatDescription; -use PHPUnit\Framework\Constraint\StringStartsWith; -use PHPUnit\Framework\Constraint\TraversableContains; -use PHPUnit\Framework\Constraint\TraversableContainsEqual; -use PHPUnit\Framework\Constraint\TraversableContainsIdentical; -use PHPUnit\Framework\Constraint\TraversableContainsOnly; -use PHPUnit\Framework\ExpectationFailedException; -use PHPUnit\Framework\MockObject\Rule\AnyInvokedCount as AnyInvokedCountMatcher; -use PHPUnit\Framework\MockObject\Rule\InvokedAtIndex as InvokedAtIndexMatcher; -use PHPUnit\Framework\MockObject\Rule\InvokedAtLeastCount as InvokedAtLeastCountMatcher; -use PHPUnit\Framework\MockObject\Rule\InvokedAtLeastOnce as InvokedAtLeastOnceMatcher; -use PHPUnit\Framework\MockObject\Rule\InvokedAtMostCount as InvokedAtMostCountMatcher; -use PHPUnit\Framework\MockObject\Rule\InvokedCount as InvokedCountMatcher; -use PHPUnit\Framework\MockObject\Stub\ConsecutiveCalls as ConsecutiveCallsStub; -use PHPUnit\Framework\MockObject\Stub\Exception as ExceptionStub; -use PHPUnit\Framework\MockObject\Stub\ReturnArgument as ReturnArgumentStub; -use PHPUnit\Framework\MockObject\Stub\ReturnCallback as ReturnCallbackStub; -use PHPUnit\Framework\MockObject\Stub\ReturnSelf as ReturnSelfStub; -use PHPUnit\Framework\MockObject\Stub\ReturnStub; -use PHPUnit\Framework\MockObject\Stub\ReturnValueMap as ReturnValueMapStub; - -if (!function_exists('PHPUnit\Framework\assertArrayHasKey')) { - /** - * Asserts that an array has a specified key. - * - * @param int|string $key - * @param array|ArrayAccess $array - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @see Assert::assertArrayHasKey - */ - function assertArrayHasKey($key, $array, string $message = ''): void - { - Assert::assertArrayHasKey(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertArraySubset')) { - /** - * Asserts that an array has a specified subset. - * - * @param array|ArrayAccess $subset - * @param array|ArrayAccess $array - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @codeCoverageIgnore - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3494 - * @see Assert::assertArraySubset - */ - function assertArraySubset($subset, $array, bool $checkForObjectIdentity = false, string $message = ''): void - { - Assert::assertArraySubset(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertArrayNotHasKey')) { - /** - * Asserts that an array does not have a specified key. - * - * @param int|string $key - * @param array|ArrayAccess $array - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @see Assert::assertArrayNotHasKey - */ - function assertArrayNotHasKey($key, $array, string $message = ''): void - { - Assert::assertArrayNotHasKey(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertContains')) { - /** - * Asserts that a haystack contains a needle. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @see Assert::assertContains - */ - function assertContains($needle, $haystack, string $message = '', bool $ignoreCase = false, bool $checkForObjectIdentity = true, bool $checkForNonObjectIdentity = false): void - { - Assert::assertContains(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertContainsEquals')) { - function assertContainsEquals($needle, iterable $haystack, string $message = ''): void - { - Assert::assertContainsEquals(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertAttributeContains')) { - /** - * Asserts that a haystack that is stored in a static attribute of a class - * or an attribute of an object contains a needle. - * - * @param object|string $haystackClassOrObject - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - * - * @see Assert::assertAttributeContains - */ - function assertAttributeContains($needle, string $haystackAttributeName, $haystackClassOrObject, string $message = '', bool $ignoreCase = false, bool $checkForObjectIdentity = true, bool $checkForNonObjectIdentity = false): void - { - Assert::assertAttributeContains(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertNotContains')) { - /** - * Asserts that a haystack does not contain a needle. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @see Assert::assertNotContains - */ - function assertNotContains($needle, $haystack, string $message = '', bool $ignoreCase = false, bool $checkForObjectIdentity = true, bool $checkForNonObjectIdentity = false): void - { - Assert::assertNotContains(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertNotContainsEquals')) { - function assertNotContainsEquals($needle, iterable $haystack, string $message = ''): void - { - Assert::assertNotContainsEquals(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertAttributeNotContains')) { - /** - * Asserts that a haystack that is stored in a static attribute of a class - * or an attribute of an object does not contain a needle. - * - * @param object|string $haystackClassOrObject - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - * - * @see Assert::assertAttributeNotContains - */ - function assertAttributeNotContains($needle, string $haystackAttributeName, $haystackClassOrObject, string $message = '', bool $ignoreCase = false, bool $checkForObjectIdentity = true, bool $checkForNonObjectIdentity = false): void - { - Assert::assertAttributeNotContains(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertContainsOnly')) { - /** - * Asserts that a haystack contains only values of a given type. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertContainsOnly - */ - function assertContainsOnly(string $type, iterable $haystack, ?bool $isNativeType = null, string $message = ''): void - { - Assert::assertContainsOnly(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertContainsOnlyInstancesOf')) { - /** - * Asserts that a haystack contains only instances of a given class name. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertContainsOnlyInstancesOf - */ - function assertContainsOnlyInstancesOf(string $className, iterable $haystack, string $message = ''): void - { - Assert::assertContainsOnlyInstancesOf(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertAttributeContainsOnly')) { - /** - * Asserts that a haystack that is stored in a static attribute of a class - * or an attribute of an object contains only values of a given type. - * - * @param object|string $haystackClassOrObject - * @param bool $isNativeType - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - * - * @see Assert::assertAttributeContainsOnly - */ - function assertAttributeContainsOnly(string $type, string $haystackAttributeName, $haystackClassOrObject, ?bool $isNativeType = null, string $message = ''): void - { - Assert::assertAttributeContainsOnly(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertNotContainsOnly')) { - /** - * Asserts that a haystack does not contain only values of a given type. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertNotContainsOnly - */ - function assertNotContainsOnly(string $type, iterable $haystack, ?bool $isNativeType = null, string $message = ''): void - { - Assert::assertNotContainsOnly(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertAttributeNotContainsOnly')) { - /** - * Asserts that a haystack that is stored in a static attribute of a class - * or an attribute of an object does not contain only values of a given - * type. - * - * @param object|string $haystackClassOrObject - * @param bool $isNativeType - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - * - * @see Assert::assertAttributeNotContainsOnly - */ - function assertAttributeNotContainsOnly(string $type, string $haystackAttributeName, $haystackClassOrObject, ?bool $isNativeType = null, string $message = ''): void - { - Assert::assertAttributeNotContainsOnly(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertCount')) { - /** - * Asserts the number of elements of an array, Countable or Traversable. - * - * @param Countable|iterable $haystack - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @see Assert::assertCount - */ - function assertCount(int $expectedCount, $haystack, string $message = ''): void - { - Assert::assertCount(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertAttributeCount')) { - /** - * Asserts the number of elements of an array, Countable or Traversable - * that is stored in an attribute. - * - * @param object|string $haystackClassOrObject - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - * - * @see Assert::assertAttributeCount - */ - function assertAttributeCount(int $expectedCount, string $haystackAttributeName, $haystackClassOrObject, string $message = ''): void - { - Assert::assertAttributeCount(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertNotCount')) { - /** - * Asserts the number of elements of an array, Countable or Traversable. - * - * @param Countable|iterable $haystack - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @see Assert::assertNotCount - */ - function assertNotCount(int $expectedCount, $haystack, string $message = ''): void - { - Assert::assertNotCount(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertAttributeNotCount')) { - /** - * Asserts the number of elements of an array, Countable or Traversable - * that is stored in an attribute. - * - * @param object|string $haystackClassOrObject - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - * - * @see Assert::assertAttributeNotCount - */ - function assertAttributeNotCount(int $expectedCount, string $haystackAttributeName, $haystackClassOrObject, string $message = ''): void - { - Assert::assertAttributeNotCount(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertEquals')) { - /** - * Asserts that two variables are equal. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertEquals - */ - function assertEquals($expected, $actual, string $message = '', float $delta = 0.0, int $maxDepth = 10, bool $canonicalize = false, bool $ignoreCase = false): void - { - Assert::assertEquals(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertEqualsCanonicalizing')) { - /** - * Asserts that two variables are equal (canonicalizing). - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertEqualsCanonicalizing - */ - function assertEqualsCanonicalizing($expected, $actual, string $message = ''): void - { - Assert::assertEqualsCanonicalizing(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertEqualsIgnoringCase')) { - /** - * Asserts that two variables are equal (ignoring case). - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertEqualsIgnoringCase - */ - function assertEqualsIgnoringCase($expected, $actual, string $message = ''): void - { - Assert::assertEqualsIgnoringCase(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertEqualsWithDelta')) { - /** - * Asserts that two variables are equal (with delta). - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertEqualsWithDelta - */ - function assertEqualsWithDelta($expected, $actual, float $delta, string $message = ''): void - { - Assert::assertEqualsWithDelta(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertAttributeEquals')) { - /** - * Asserts that a variable is equal to an attribute of an object. - * - * @param object|string $actualClassOrObject - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - * - * @see Assert::assertAttributeEquals - */ - function assertAttributeEquals($expected, string $actualAttributeName, $actualClassOrObject, string $message = '', float $delta = 0.0, int $maxDepth = 10, bool $canonicalize = false, bool $ignoreCase = false): void - { - Assert::assertAttributeEquals(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertNotEquals')) { - /** - * Asserts that two variables are not equal. - * - * @param float $delta - * @param int $maxDepth - * @param bool $canonicalize - * @param bool $ignoreCase - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertNotEquals - */ - function assertNotEquals($expected, $actual, string $message = '', $delta = 0.0, $maxDepth = 10, $canonicalize = false, $ignoreCase = false): void - { - Assert::assertNotEquals(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertNotEqualsCanonicalizing')) { - /** - * Asserts that two variables are not equal (canonicalizing). - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertNotEqualsCanonicalizing - */ - function assertNotEqualsCanonicalizing($expected, $actual, string $message = ''): void - { - Assert::assertNotEqualsCanonicalizing(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertNotEqualsIgnoringCase')) { - /** - * Asserts that two variables are not equal (ignoring case). - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertNotEqualsIgnoringCase - */ - function assertNotEqualsIgnoringCase($expected, $actual, string $message = ''): void - { - Assert::assertNotEqualsIgnoringCase(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertNotEqualsWithDelta')) { - /** - * Asserts that two variables are not equal (with delta). - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertNotEqualsWithDelta - */ - function assertNotEqualsWithDelta($expected, $actual, float $delta, string $message = ''): void - { - Assert::assertNotEqualsWithDelta(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertAttributeNotEquals')) { - /** - * Asserts that a variable is not equal to an attribute of an object. - * - * @param object|string $actualClassOrObject - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - * - * @see Assert::assertAttributeNotEquals - */ - function assertAttributeNotEquals($expected, string $actualAttributeName, $actualClassOrObject, string $message = '', float $delta = 0.0, int $maxDepth = 10, bool $canonicalize = false, bool $ignoreCase = false): void - { - Assert::assertAttributeNotEquals(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertEmpty')) { - /** - * Asserts that a variable is empty. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert empty $actual - * - * @see Assert::assertEmpty - */ - function assertEmpty($actual, string $message = ''): void - { - Assert::assertEmpty(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertAttributeEmpty')) { - /** - * Asserts that a static attribute of a class or an attribute of an object - * is empty. - * - * @param object|string $haystackClassOrObject - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - * - * @see Assert::assertAttributeEmpty - */ - function assertAttributeEmpty(string $haystackAttributeName, $haystackClassOrObject, string $message = ''): void - { - Assert::assertAttributeEmpty(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertNotEmpty')) { - /** - * Asserts that a variable is not empty. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !empty $actual - * - * @see Assert::assertNotEmpty - */ - function assertNotEmpty($actual, string $message = ''): void - { - Assert::assertNotEmpty(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertAttributeNotEmpty')) { - /** - * Asserts that a static attribute of a class or an attribute of an object - * is not empty. - * - * @param object|string $haystackClassOrObject - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - * - * @see Assert::assertAttributeNotEmpty - */ - function assertAttributeNotEmpty(string $haystackAttributeName, $haystackClassOrObject, string $message = ''): void - { - Assert::assertAttributeNotEmpty(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertGreaterThan')) { - /** - * Asserts that a value is greater than another value. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertGreaterThan - */ - function assertGreaterThan($expected, $actual, string $message = ''): void - { - Assert::assertGreaterThan(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertAttributeGreaterThan')) { - /** - * Asserts that an attribute is greater than another value. - * - * @param object|string $actualClassOrObject - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - * - * @see Assert::assertAttributeGreaterThan - */ - function assertAttributeGreaterThan($expected, string $actualAttributeName, $actualClassOrObject, string $message = ''): void - { - Assert::assertAttributeGreaterThan(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertGreaterThanOrEqual')) { - /** - * Asserts that a value is greater than or equal to another value. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertGreaterThanOrEqual - */ - function assertGreaterThanOrEqual($expected, $actual, string $message = ''): void - { - Assert::assertGreaterThanOrEqual(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertAttributeGreaterThanOrEqual')) { - /** - * Asserts that an attribute is greater than or equal to another value. - * - * @param object|string $actualClassOrObject - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - * - * @see Assert::assertAttributeGreaterThanOrEqual - */ - function assertAttributeGreaterThanOrEqual($expected, string $actualAttributeName, $actualClassOrObject, string $message = ''): void - { - Assert::assertAttributeGreaterThanOrEqual(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertLessThan')) { - /** - * Asserts that a value is smaller than another value. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertLessThan - */ - function assertLessThan($expected, $actual, string $message = ''): void - { - Assert::assertLessThan(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertAttributeLessThan')) { - /** - * Asserts that an attribute is smaller than another value. - * - * @param object|string $actualClassOrObject - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - * - * @see Assert::assertAttributeLessThan - */ - function assertAttributeLessThan($expected, string $actualAttributeName, $actualClassOrObject, string $message = ''): void - { - Assert::assertAttributeLessThan(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertLessThanOrEqual')) { - /** - * Asserts that a value is smaller than or equal to another value. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertLessThanOrEqual - */ - function assertLessThanOrEqual($expected, $actual, string $message = ''): void - { - Assert::assertLessThanOrEqual(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertAttributeLessThanOrEqual')) { - /** - * Asserts that an attribute is smaller than or equal to another value. - * - * @param object|string $actualClassOrObject - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - * - * @see Assert::assertAttributeLessThanOrEqual - */ - function assertAttributeLessThanOrEqual($expected, string $actualAttributeName, $actualClassOrObject, string $message = ''): void - { - Assert::assertAttributeLessThanOrEqual(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertFileEquals')) { - /** - * Asserts that the contents of one file is equal to the contents of another - * file. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertFileEquals - */ - function assertFileEquals(string $expected, string $actual, string $message = '', bool $canonicalize = false, bool $ignoreCase = false): void - { - Assert::assertFileEquals(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertFileEqualsCanonicalizing')) { - /** - * Asserts that the contents of one file is equal to the contents of another - * file (canonicalizing). - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertFileEqualsCanonicalizing - */ - function assertFileEqualsCanonicalizing(string $expected, string $actual, string $message = ''): void - { - Assert::assertFileEqualsCanonicalizing(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertFileEqualsIgnoringCase')) { - /** - * Asserts that the contents of one file is equal to the contents of another - * file (ignoring case). - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertFileEqualsIgnoringCase - */ - function assertFileEqualsIgnoringCase(string $expected, string $actual, string $message = ''): void - { - Assert::assertFileEqualsIgnoringCase(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertFileNotEquals')) { - /** - * Asserts that the contents of one file is not equal to the contents of - * another file. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertFileNotEquals - */ - function assertFileNotEquals(string $expected, string $actual, string $message = '', bool $canonicalize = false, bool $ignoreCase = false): void - { - Assert::assertFileNotEquals(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertFileNotEqualsCanonicalizing')) { - /** - * Asserts that the contents of one file is not equal to the contents of another - * file (canonicalizing). - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertFileNotEqualsCanonicalizing - */ - function assertFileNotEqualsCanonicalizing(string $expected, string $actual, string $message = ''): void - { - Assert::assertFileNotEqualsCanonicalizing(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertFileNotEqualsIgnoringCase')) { - /** - * Asserts that the contents of one file is not equal to the contents of another - * file (ignoring case). - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertFileNotEqualsIgnoringCase - */ - function assertFileNotEqualsIgnoringCase(string $expected, string $actual, string $message = ''): void - { - Assert::assertFileNotEqualsIgnoringCase(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertStringEqualsFile')) { - /** - * Asserts that the contents of a string is equal - * to the contents of a file. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertStringEqualsFile - */ - function assertStringEqualsFile(string $expectedFile, string $actualString, string $message = '', bool $canonicalize = false, bool $ignoreCase = false): void - { - Assert::assertStringEqualsFile(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertStringEqualsFileCanonicalizing')) { - /** - * Asserts that the contents of a string is equal - * to the contents of a file (canonicalizing). - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertStringEqualsFileCanonicalizing - */ - function assertStringEqualsFileCanonicalizing(string $expectedFile, string $actualString, string $message = ''): void - { - Assert::assertStringEqualsFileCanonicalizing(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertStringEqualsFileIgnoringCase')) { - /** - * Asserts that the contents of a string is equal - * to the contents of a file (ignoring case). - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertStringEqualsFileIgnoringCase - */ - function assertStringEqualsFileIgnoringCase(string $expectedFile, string $actualString, string $message = ''): void - { - Assert::assertStringEqualsFileIgnoringCase(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertStringNotEqualsFile')) { - /** - * Asserts that the contents of a string is not equal - * to the contents of a file. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertStringNotEqualsFile - */ - function assertStringNotEqualsFile(string $expectedFile, string $actualString, string $message = '', bool $canonicalize = false, bool $ignoreCase = false): void - { - Assert::assertStringNotEqualsFile(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertStringNotEqualsFileCanonicalizing')) { - /** - * Asserts that the contents of a string is not equal - * to the contents of a file (canonicalizing). - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertStringNotEqualsFileCanonicalizing - */ - function assertStringNotEqualsFileCanonicalizing(string $expectedFile, string $actualString, string $message = ''): void - { - Assert::assertStringNotEqualsFileCanonicalizing(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertStringNotEqualsFileIgnoringCase')) { - /** - * Asserts that the contents of a string is not equal - * to the contents of a file (ignoring case). - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertStringNotEqualsFileIgnoringCase - */ - function assertStringNotEqualsFileIgnoringCase(string $expectedFile, string $actualString, string $message = ''): void - { - Assert::assertStringNotEqualsFileIgnoringCase(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsReadable')) { - /** - * Asserts that a file/dir is readable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertIsReadable - */ - function assertIsReadable(string $filename, string $message = ''): void - { - Assert::assertIsReadable(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertNotIsReadable')) { - /** - * Asserts that a file/dir exists and is not readable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertNotIsReadable - */ - function assertNotIsReadable(string $filename, string $message = ''): void - { - Assert::assertNotIsReadable(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsWritable')) { - /** - * Asserts that a file/dir exists and is writable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertIsWritable - */ - function assertIsWritable(string $filename, string $message = ''): void - { - Assert::assertIsWritable(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertNotIsWritable')) { - /** - * Asserts that a file/dir exists and is not writable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertNotIsWritable - */ - function assertNotIsWritable(string $filename, string $message = ''): void - { - Assert::assertNotIsWritable(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertDirectoryExists')) { - /** - * Asserts that a directory exists. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertDirectoryExists - */ - function assertDirectoryExists(string $directory, string $message = ''): void - { - Assert::assertDirectoryExists(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertDirectoryNotExists')) { - /** - * Asserts that a directory does not exist. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertDirectoryNotExists - */ - function assertDirectoryNotExists(string $directory, string $message = ''): void - { - Assert::assertDirectoryNotExists(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertDirectoryIsReadable')) { - /** - * Asserts that a directory exists and is readable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertDirectoryIsReadable - */ - function assertDirectoryIsReadable(string $directory, string $message = ''): void - { - Assert::assertDirectoryIsReadable(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertDirectoryNotIsReadable')) { - /** - * Asserts that a directory exists and is not readable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertDirectoryNotIsReadable - */ - function assertDirectoryNotIsReadable(string $directory, string $message = ''): void - { - Assert::assertDirectoryNotIsReadable(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertDirectoryIsWritable')) { - /** - * Asserts that a directory exists and is writable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertDirectoryIsWritable - */ - function assertDirectoryIsWritable(string $directory, string $message = ''): void - { - Assert::assertDirectoryIsWritable(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertDirectoryNotIsWritable')) { - /** - * Asserts that a directory exists and is not writable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertDirectoryNotIsWritable - */ - function assertDirectoryNotIsWritable(string $directory, string $message = ''): void - { - Assert::assertDirectoryNotIsWritable(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertFileExists')) { - /** - * Asserts that a file exists. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertFileExists - */ - function assertFileExists(string $filename, string $message = ''): void - { - Assert::assertFileExists(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertFileNotExists')) { - /** - * Asserts that a file does not exist. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertFileNotExists - */ - function assertFileNotExists(string $filename, string $message = ''): void - { - Assert::assertFileNotExists(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertFileIsReadable')) { - /** - * Asserts that a file exists and is readable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertFileIsReadable - */ - function assertFileIsReadable(string $file, string $message = ''): void - { - Assert::assertFileIsReadable(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertFileNotIsReadable')) { - /** - * Asserts that a file exists and is not readable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertFileNotIsReadable - */ - function assertFileNotIsReadable(string $file, string $message = ''): void - { - Assert::assertFileNotIsReadable(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertFileIsWritable')) { - /** - * Asserts that a file exists and is writable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertFileIsWritable - */ - function assertFileIsWritable(string $file, string $message = ''): void - { - Assert::assertFileIsWritable(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertFileNotIsWritable')) { - /** - * Asserts that a file exists and is not writable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertFileNotIsWritable - */ - function assertFileNotIsWritable(string $file, string $message = ''): void - { - Assert::assertFileNotIsWritable(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertTrue')) { - /** - * Asserts that a condition is true. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert true $condition - * - * @see Assert::assertTrue - */ - function assertTrue($condition, string $message = ''): void - { - Assert::assertTrue(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertNotTrue')) { - /** - * Asserts that a condition is not true. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !true $condition - * - * @see Assert::assertNotTrue - */ - function assertNotTrue($condition, string $message = ''): void - { - Assert::assertNotTrue(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertFalse')) { - /** - * Asserts that a condition is false. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert false $condition - * - * @see Assert::assertFalse - */ - function assertFalse($condition, string $message = ''): void - { - Assert::assertFalse(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertNotFalse')) { - /** - * Asserts that a condition is not false. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !false $condition - * - * @see Assert::assertNotFalse - */ - function assertNotFalse($condition, string $message = ''): void - { - Assert::assertNotFalse(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertNull')) { - /** - * Asserts that a variable is null. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert null $actual - * - * @see Assert::assertNull - */ - function assertNull($actual, string $message = ''): void - { - Assert::assertNull(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertNotNull')) { - /** - * Asserts that a variable is not null. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !null $actual - * - * @see Assert::assertNotNull - */ - function assertNotNull($actual, string $message = ''): void - { - Assert::assertNotNull(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertFinite')) { - /** - * Asserts that a variable is finite. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertFinite - */ - function assertFinite($actual, string $message = ''): void - { - Assert::assertFinite(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertInfinite')) { - /** - * Asserts that a variable is infinite. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertInfinite - */ - function assertInfinite($actual, string $message = ''): void - { - Assert::assertInfinite(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertNan')) { - /** - * Asserts that a variable is nan. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertNan - */ - function assertNan($actual, string $message = ''): void - { - Assert::assertNan(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertClassHasAttribute')) { - /** - * Asserts that a class has a specified attribute. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @see Assert::assertClassHasAttribute - */ - function assertClassHasAttribute(string $attributeName, string $className, string $message = ''): void - { - Assert::assertClassHasAttribute(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertClassNotHasAttribute')) { - /** - * Asserts that a class does not have a specified attribute. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @see Assert::assertClassNotHasAttribute - */ - function assertClassNotHasAttribute(string $attributeName, string $className, string $message = ''): void - { - Assert::assertClassNotHasAttribute(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertClassHasStaticAttribute')) { - /** - * Asserts that a class has a specified static attribute. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @see Assert::assertClassHasStaticAttribute - */ - function assertClassHasStaticAttribute(string $attributeName, string $className, string $message = ''): void - { - Assert::assertClassHasStaticAttribute(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertClassNotHasStaticAttribute')) { - /** - * Asserts that a class does not have a specified static attribute. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @see Assert::assertClassNotHasStaticAttribute - */ - function assertClassNotHasStaticAttribute(string $attributeName, string $className, string $message = ''): void - { - Assert::assertClassNotHasStaticAttribute(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertObjectHasAttribute')) { - /** - * Asserts that an object has a specified attribute. - * - * @param object $object - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @see Assert::assertObjectHasAttribute - */ - function assertObjectHasAttribute(string $attributeName, $object, string $message = ''): void - { - Assert::assertObjectHasAttribute(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertObjectNotHasAttribute')) { - /** - * Asserts that an object does not have a specified attribute. - * - * @param object $object - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @see Assert::assertObjectNotHasAttribute - */ - function assertObjectNotHasAttribute(string $attributeName, $object, string $message = ''): void - { - Assert::assertObjectNotHasAttribute(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertSame')) { - /** - * Asserts that two variables have the same type and value. - * Used on objects, it asserts that two variables reference - * the same object. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-template ExpectedType - * @psalm-param ExpectedType $expected - * @psalm-assert =ExpectedType $actual - * - * @see Assert::assertSame - */ - function assertSame($expected, $actual, string $message = ''): void - { - Assert::assertSame(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertAttributeSame')) { - /** - * Asserts that a variable and an attribute of an object have the same type - * and value. - * - * @param object|string $actualClassOrObject - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - * - * @see Assert::assertAttributeSame - */ - function assertAttributeSame($expected, string $actualAttributeName, $actualClassOrObject, string $message = ''): void - { - Assert::assertAttributeSame(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertNotSame')) { - /** - * Asserts that two variables do not have the same type and value. - * Used on objects, it asserts that two variables do not reference - * the same object. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertNotSame - */ - function assertNotSame($expected, $actual, string $message = ''): void - { - Assert::assertNotSame(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertAttributeNotSame')) { - /** - * Asserts that a variable and an attribute of an object do not have the - * same type and value. - * - * @param object|string $actualClassOrObject - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - * - * @see Assert::assertAttributeNotSame - */ - function assertAttributeNotSame($expected, string $actualAttributeName, $actualClassOrObject, string $message = ''): void - { - Assert::assertAttributeNotSame(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertInstanceOf')) { - /** - * Asserts that a variable is of a given type. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @psalm-template ExpectedType of object - * @psalm-param class-string $expected - * @psalm-assert =ExpectedType $actual - * - * @see Assert::assertInstanceOf - */ - function assertInstanceOf(string $expected, $actual, string $message = ''): void - { - Assert::assertInstanceOf(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertAttributeInstanceOf')) { - /** - * Asserts that an attribute is of a given type. - * - * @param object|string $classOrObject - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - * - * @psalm-param class-string $expected - * - * @see Assert::assertAttributeInstanceOf - */ - function assertAttributeInstanceOf(string $expected, string $attributeName, $classOrObject, string $message = ''): void - { - Assert::assertAttributeInstanceOf(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertNotInstanceOf')) { - /** - * Asserts that a variable is not of a given type. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @psalm-template ExpectedType of object - * @psalm-param class-string $expected - * @psalm-assert !ExpectedType $actual - * - * @see Assert::assertNotInstanceOf - */ - function assertNotInstanceOf(string $expected, $actual, string $message = ''): void - { - Assert::assertNotInstanceOf(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertAttributeNotInstanceOf')) { - /** - * Asserts that an attribute is of a given type. - * - * @param object|string $classOrObject - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - * - * @psalm-param class-string $expected - * - * @see Assert::assertAttributeNotInstanceOf - */ - function assertAttributeNotInstanceOf(string $expected, string $attributeName, $classOrObject, string $message = ''): void - { - Assert::assertAttributeNotInstanceOf(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertInternalType')) { - /** - * Asserts that a variable is of a given type. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3369 - * @codeCoverageIgnore - * - * @see Assert::assertInternalType - */ - function assertInternalType(string $expected, $actual, string $message = ''): void - { - Assert::assertInternalType(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertAttributeInternalType')) { - /** - * Asserts that an attribute is of a given type. - * - * @param object|string $classOrObject - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - * - * @see Assert::assertAttributeInternalType - */ - function assertAttributeInternalType(string $expected, string $attributeName, $classOrObject, string $message = ''): void - { - Assert::assertAttributeInternalType(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsArray')) { - /** - * Asserts that a variable is of type array. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert array $actual - * - * @see Assert::assertIsArray - */ - function assertIsArray($actual, string $message = ''): void - { - Assert::assertIsArray(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsBool')) { - /** - * Asserts that a variable is of type bool. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert bool $actual - * - * @see Assert::assertIsBool - */ - function assertIsBool($actual, string $message = ''): void - { - Assert::assertIsBool(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsFloat')) { - /** - * Asserts that a variable is of type float. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert float $actual - * - * @see Assert::assertIsFloat - */ - function assertIsFloat($actual, string $message = ''): void - { - Assert::assertIsFloat(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsInt')) { - /** - * Asserts that a variable is of type int. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert int $actual - * - * @see Assert::assertIsInt - */ - function assertIsInt($actual, string $message = ''): void - { - Assert::assertIsInt(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsNumeric')) { - /** - * Asserts that a variable is of type numeric. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert numeric $actual - * - * @see Assert::assertIsNumeric - */ - function assertIsNumeric($actual, string $message = ''): void - { - Assert::assertIsNumeric(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsObject')) { - /** - * Asserts that a variable is of type object. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert object $actual - * - * @see Assert::assertIsObject - */ - function assertIsObject($actual, string $message = ''): void - { - Assert::assertIsObject(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsResource')) { - /** - * Asserts that a variable is of type resource. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert resource $actual - * - * @see Assert::assertIsResource - */ - function assertIsResource($actual, string $message = ''): void - { - Assert::assertIsResource(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsString')) { - /** - * Asserts that a variable is of type string. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert string $actual - * - * @see Assert::assertIsString - */ - function assertIsString($actual, string $message = ''): void - { - Assert::assertIsString(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsScalar')) { - /** - * Asserts that a variable is of type scalar. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert scalar $actual - * - * @see Assert::assertIsScalar - */ - function assertIsScalar($actual, string $message = ''): void - { - Assert::assertIsScalar(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsCallable')) { - /** - * Asserts that a variable is of type callable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert callable $actual - * - * @see Assert::assertIsCallable - */ - function assertIsCallable($actual, string $message = ''): void - { - Assert::assertIsCallable(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsIterable')) { - /** - * Asserts that a variable is of type iterable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert iterable $actual - * - * @see Assert::assertIsIterable - */ - function assertIsIterable($actual, string $message = ''): void - { - Assert::assertIsIterable(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertNotInternalType')) { - /** - * Asserts that a variable is not of a given type. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3369 - * @codeCoverageIgnore - * - * @see Assert::assertNotInternalType - */ - function assertNotInternalType(string $expected, $actual, string $message = ''): void - { - Assert::assertNotInternalType(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsNotArray')) { - /** - * Asserts that a variable is not of type array. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !array $actual - * - * @see Assert::assertIsNotArray - */ - function assertIsNotArray($actual, string $message = ''): void - { - Assert::assertIsNotArray(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsNotBool')) { - /** - * Asserts that a variable is not of type bool. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !bool $actual - * - * @see Assert::assertIsNotBool - */ - function assertIsNotBool($actual, string $message = ''): void - { - Assert::assertIsNotBool(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsNotFloat')) { - /** - * Asserts that a variable is not of type float. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !float $actual - * - * @see Assert::assertIsNotFloat - */ - function assertIsNotFloat($actual, string $message = ''): void - { - Assert::assertIsNotFloat(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsNotInt')) { - /** - * Asserts that a variable is not of type int. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !int $actual - * - * @see Assert::assertIsNotInt - */ - function assertIsNotInt($actual, string $message = ''): void - { - Assert::assertIsNotInt(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsNotNumeric')) { - /** - * Asserts that a variable is not of type numeric. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !numeric $actual - * - * @see Assert::assertIsNotNumeric - */ - function assertIsNotNumeric($actual, string $message = ''): void - { - Assert::assertIsNotNumeric(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsNotObject')) { - /** - * Asserts that a variable is not of type object. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !object $actual - * - * @see Assert::assertIsNotObject - */ - function assertIsNotObject($actual, string $message = ''): void - { - Assert::assertIsNotObject(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsNotResource')) { - /** - * Asserts that a variable is not of type resource. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !resource $actual - * - * @see Assert::assertIsNotResource - */ - function assertIsNotResource($actual, string $message = ''): void - { - Assert::assertIsNotResource(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsNotString')) { - /** - * Asserts that a variable is not of type string. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !string $actual - * - * @see Assert::assertIsNotString - */ - function assertIsNotString($actual, string $message = ''): void - { - Assert::assertIsNotString(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsNotScalar')) { - /** - * Asserts that a variable is not of type scalar. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !scalar $actual - * - * @see Assert::assertIsNotScalar - */ - function assertIsNotScalar($actual, string $message = ''): void - { - Assert::assertIsNotScalar(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsNotCallable')) { - /** - * Asserts that a variable is not of type callable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !callable $actual - * - * @see Assert::assertIsNotCallable - */ - function assertIsNotCallable($actual, string $message = ''): void - { - Assert::assertIsNotCallable(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsNotIterable')) { - /** - * Asserts that a variable is not of type iterable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !iterable $actual - * - * @see Assert::assertIsNotIterable - */ - function assertIsNotIterable($actual, string $message = ''): void - { - Assert::assertIsNotIterable(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertAttributeNotInternalType')) { - /** - * Asserts that an attribute is of a given type. - * - * @param object|string $classOrObject - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - * - * @see Assert::assertAttributeNotInternalType - */ - function assertAttributeNotInternalType(string $expected, string $attributeName, $classOrObject, string $message = ''): void - { - Assert::assertAttributeNotInternalType(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertRegExp')) { - /** - * Asserts that a string matches a given regular expression. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertRegExp - */ - function assertRegExp(string $pattern, string $string, string $message = ''): void - { - Assert::assertRegExp(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertNotRegExp')) { - /** - * Asserts that a string does not match a given regular expression. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertNotRegExp - */ - function assertNotRegExp(string $pattern, string $string, string $message = ''): void - { - Assert::assertNotRegExp(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertSameSize')) { - /** - * Assert that the size of two arrays (or `Countable` or `Traversable` objects) - * is the same. - * - * @param Countable|iterable $expected - * @param Countable|iterable $actual - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @see Assert::assertSameSize - */ - function assertSameSize($expected, $actual, string $message = ''): void - { - Assert::assertSameSize(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertNotSameSize')) { - /** - * Assert that the size of two arrays (or `Countable` or `Traversable` objects) - * is not the same. - * - * @param Countable|iterable $expected - * @param Countable|iterable $actual - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @see Assert::assertNotSameSize - */ - function assertNotSameSize($expected, $actual, string $message = ''): void - { - Assert::assertNotSameSize(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertStringMatchesFormat')) { - /** - * Asserts that a string matches a given format string. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertStringMatchesFormat - */ - function assertStringMatchesFormat(string $format, string $string, string $message = ''): void - { - Assert::assertStringMatchesFormat(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertStringNotMatchesFormat')) { - /** - * Asserts that a string does not match a given format string. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertStringNotMatchesFormat - */ - function assertStringNotMatchesFormat(string $format, string $string, string $message = ''): void - { - Assert::assertStringNotMatchesFormat(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertStringMatchesFormatFile')) { - /** - * Asserts that a string matches a given format file. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertStringMatchesFormatFile - */ - function assertStringMatchesFormatFile(string $formatFile, string $string, string $message = ''): void - { - Assert::assertStringMatchesFormatFile(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertStringNotMatchesFormatFile')) { - /** - * Asserts that a string does not match a given format string. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertStringNotMatchesFormatFile - */ - function assertStringNotMatchesFormatFile(string $formatFile, string $string, string $message = ''): void - { - Assert::assertStringNotMatchesFormatFile(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertStringStartsWith')) { - /** - * Asserts that a string starts with a given prefix. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertStringStartsWith - */ - function assertStringStartsWith(string $prefix, string $string, string $message = ''): void - { - Assert::assertStringStartsWith(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertStringStartsNotWith')) { - /** - * Asserts that a string starts not with a given prefix. - * - * @param string $prefix - * @param string $string - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertStringStartsNotWith - */ - function assertStringStartsNotWith($prefix, $string, string $message = ''): void - { - Assert::assertStringStartsNotWith(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertStringContainsString')) { - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertStringContainsString - */ - function assertStringContainsString(string $needle, string $haystack, string $message = ''): void - { - Assert::assertStringContainsString(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertStringContainsStringIgnoringCase')) { - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertStringContainsStringIgnoringCase - */ - function assertStringContainsStringIgnoringCase(string $needle, string $haystack, string $message = ''): void - { - Assert::assertStringContainsStringIgnoringCase(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertStringNotContainsString')) { - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertStringNotContainsString - */ - function assertStringNotContainsString(string $needle, string $haystack, string $message = ''): void - { - Assert::assertStringNotContainsString(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertStringNotContainsStringIgnoringCase')) { - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertStringNotContainsStringIgnoringCase - */ - function assertStringNotContainsStringIgnoringCase(string $needle, string $haystack, string $message = ''): void - { - Assert::assertStringNotContainsStringIgnoringCase(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertStringEndsWith')) { - /** - * Asserts that a string ends with a given suffix. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertStringEndsWith - */ - function assertStringEndsWith(string $suffix, string $string, string $message = ''): void - { - Assert::assertStringEndsWith(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertStringEndsNotWith')) { - /** - * Asserts that a string ends not with a given suffix. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertStringEndsNotWith - */ - function assertStringEndsNotWith(string $suffix, string $string, string $message = ''): void - { - Assert::assertStringEndsNotWith(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertXmlFileEqualsXmlFile')) { - /** - * Asserts that two XML files are equal. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @see Assert::assertXmlFileEqualsXmlFile - */ - function assertXmlFileEqualsXmlFile(string $expectedFile, string $actualFile, string $message = ''): void - { - Assert::assertXmlFileEqualsXmlFile(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertXmlFileNotEqualsXmlFile')) { - /** - * Asserts that two XML files are not equal. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @see Assert::assertXmlFileNotEqualsXmlFile - */ - function assertXmlFileNotEqualsXmlFile(string $expectedFile, string $actualFile, string $message = ''): void - { - Assert::assertXmlFileNotEqualsXmlFile(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertXmlStringEqualsXmlFile')) { - /** - * Asserts that two XML documents are equal. - * - * @param DOMDocument|string $actualXml - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @see Assert::assertXmlStringEqualsXmlFile - */ - function assertXmlStringEqualsXmlFile(string $expectedFile, $actualXml, string $message = ''): void - { - Assert::assertXmlStringEqualsXmlFile(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertXmlStringNotEqualsXmlFile')) { - /** - * Asserts that two XML documents are not equal. - * - * @param DOMDocument|string $actualXml - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @see Assert::assertXmlStringNotEqualsXmlFile - */ - function assertXmlStringNotEqualsXmlFile(string $expectedFile, $actualXml, string $message = ''): void - { - Assert::assertXmlStringNotEqualsXmlFile(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertXmlStringEqualsXmlString')) { - /** - * Asserts that two XML documents are equal. - * - * @param DOMDocument|string $expectedXml - * @param DOMDocument|string $actualXml - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @see Assert::assertXmlStringEqualsXmlString - */ - function assertXmlStringEqualsXmlString($expectedXml, $actualXml, string $message = ''): void - { - Assert::assertXmlStringEqualsXmlString(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertXmlStringNotEqualsXmlString')) { - /** - * Asserts that two XML documents are not equal. - * - * @param DOMDocument|string $expectedXml - * @param DOMDocument|string $actualXml - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @see Assert::assertXmlStringNotEqualsXmlString - */ - function assertXmlStringNotEqualsXmlString($expectedXml, $actualXml, string $message = ''): void - { - Assert::assertXmlStringNotEqualsXmlString(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertEqualXMLStructure')) { - /** - * Asserts that a hierarchy of DOMElements matches. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws AssertionFailedError - * @throws ExpectationFailedException - * - * @see Assert::assertEqualXMLStructure - */ - function assertEqualXMLStructure(DOMElement $expectedElement, DOMElement $actualElement, bool $checkAttributes = false, string $message = ''): void - { - Assert::assertEqualXMLStructure(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertThat')) { - /** - * Evaluates a PHPUnit\Framework\Constraint matcher object. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertThat - */ - function assertThat($value, Constraint $constraint, string $message = ''): void - { - Assert::assertThat(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertJson')) { - /** - * Asserts that a string is a valid JSON string. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertJson - */ - function assertJson(string $actualJson, string $message = ''): void - { - Assert::assertJson(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertJsonStringEqualsJsonString')) { - /** - * Asserts that two given JSON encoded objects or arrays are equal. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertJsonStringEqualsJsonString - */ - function assertJsonStringEqualsJsonString(string $expectedJson, string $actualJson, string $message = ''): void - { - Assert::assertJsonStringEqualsJsonString(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertJsonStringNotEqualsJsonString')) { - /** - * Asserts that two given JSON encoded objects or arrays are not equal. - * - * @param string $expectedJson - * @param string $actualJson - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertJsonStringNotEqualsJsonString - */ - function assertJsonStringNotEqualsJsonString($expectedJson, $actualJson, string $message = ''): void - { - Assert::assertJsonStringNotEqualsJsonString(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertJsonStringEqualsJsonFile')) { - /** - * Asserts that the generated JSON encoded object and the content of the given file are equal. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertJsonStringEqualsJsonFile - */ - function assertJsonStringEqualsJsonFile(string $expectedFile, string $actualJson, string $message = ''): void - { - Assert::assertJsonStringEqualsJsonFile(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertJsonStringNotEqualsJsonFile')) { - /** - * Asserts that the generated JSON encoded object and the content of the given file are not equal. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertJsonStringNotEqualsJsonFile - */ - function assertJsonStringNotEqualsJsonFile(string $expectedFile, string $actualJson, string $message = ''): void - { - Assert::assertJsonStringNotEqualsJsonFile(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertJsonFileEqualsJsonFile')) { - /** - * Asserts that two JSON files are equal. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertJsonFileEqualsJsonFile - */ - function assertJsonFileEqualsJsonFile(string $expectedFile, string $actualFile, string $message = ''): void - { - Assert::assertJsonFileEqualsJsonFile(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertJsonFileNotEqualsJsonFile')) { - /** - * Asserts that two JSON files are not equal. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @see Assert::assertJsonFileNotEqualsJsonFile - */ - function assertJsonFileNotEqualsJsonFile(string $expectedFile, string $actualFile, string $message = ''): void - { - Assert::assertJsonFileNotEqualsJsonFile(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\logicalAnd')) { - function logicalAnd(): LogicalAnd - { - return Assert::logicalAnd(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\logicalOr')) { - function logicalOr(): LogicalOr - { - return Assert::logicalOr(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\logicalNot')) { - function logicalNot(Constraint $constraint): LogicalNot - { - return Assert::logicalNot(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\logicalXor')) { - function logicalXor(): LogicalXor - { - return Assert::logicalXor(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\anything')) { - function anything(): IsAnything - { - return Assert::anything(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\isTrue')) { - function isTrue(): IsTrue - { - return Assert::isTrue(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\callback')) { - function callback(callable $callback): Callback - { - return Assert::callback(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\isFalse')) { - function isFalse(): IsFalse - { - return Assert::isFalse(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\isJson')) { - function isJson(): IsJson - { - return Assert::isJson(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\isNull')) { - function isNull(): IsNull - { - return Assert::isNull(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\isFinite')) { - function isFinite(): IsFinite - { - return Assert::isFinite(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\isInfinite')) { - function isInfinite(): IsInfinite - { - return Assert::isInfinite(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\isNan')) { - function isNan(): IsNan - { - return Assert::isNan(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\attribute')) { - function attribute(Constraint $constraint, string $attributeName): Attribute - { - return Assert::attribute(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\contains')) { - function contains($value, bool $checkForObjectIdentity = true, bool $checkForNonObjectIdentity = false): TraversableContains - { - return Assert::contains(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\containsEqual')) { - function containsEqual($value): TraversableContainsEqual - { - return Assert::containsEqual(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\containsIdentical')) { - function containsIdentical($value): TraversableContainsIdentical - { - return Assert::containsIdentical(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\containsOnly')) { - function containsOnly(string $type): TraversableContainsOnly - { - return Assert::containsOnly(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\containsOnlyInstancesOf')) { - function containsOnlyInstancesOf(string $className): TraversableContainsOnly - { - return Assert::containsOnlyInstancesOf(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\arrayHasKey')) { - function arrayHasKey($key): ArrayHasKey - { - return Assert::arrayHasKey(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\equalTo')) { - function equalTo($value, float $delta = 0.0, int $maxDepth = 10, bool $canonicalize = false, bool $ignoreCase = false): IsEqual - { - return Assert::equalTo(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\attributeEqualTo')) { - function attributeEqualTo(string $attributeName, $value, float $delta = 0.0, int $maxDepth = 10, bool $canonicalize = false, bool $ignoreCase = false): Attribute - { - return Assert::attributeEqualTo(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\isEmpty')) { - function isEmpty(): IsEmpty - { - return Assert::isEmpty(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\isWritable')) { - function isWritable(): IsWritable - { - return Assert::isWritable(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\isReadable')) { - function isReadable(): IsReadable - { - return Assert::isReadable(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\directoryExists')) { - function directoryExists(): DirectoryExists - { - return Assert::directoryExists(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\fileExists')) { - function fileExists(): FileExists - { - return Assert::fileExists(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\greaterThan')) { - function greaterThan($value): GreaterThan - { - return Assert::greaterThan(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\greaterThanOrEqual')) { - function greaterThanOrEqual($value): LogicalOr - { - return Assert::greaterThanOrEqual(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\classHasAttribute')) { - function classHasAttribute(string $attributeName): ClassHasAttribute - { - return Assert::classHasAttribute(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\classHasStaticAttribute')) { - function classHasStaticAttribute(string $attributeName): ClassHasStaticAttribute - { - return Assert::classHasStaticAttribute(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\objectHasAttribute')) { - function objectHasAttribute($attributeName): ObjectHasAttribute - { - return Assert::objectHasAttribute(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\identicalTo')) { - function identicalTo($value): IsIdentical - { - return Assert::identicalTo(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\isInstanceOf')) { - function isInstanceOf(string $className): IsInstanceOf - { - return Assert::isInstanceOf(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\isType')) { - function isType(string $type): IsType - { - return Assert::isType(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\lessThan')) { - function lessThan($value): LessThan - { - return Assert::lessThan(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\lessThanOrEqual')) { - function lessThanOrEqual($value): LogicalOr - { - return Assert::lessThanOrEqual(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\matchesRegularExpression')) { - function matchesRegularExpression(string $pattern): RegularExpression - { - return Assert::matchesRegularExpression(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\matches')) { - function matches(string $string): StringMatchesFormatDescription - { - return Assert::matches(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\stringStartsWith')) { - function stringStartsWith($prefix): StringStartsWith - { - return Assert::stringStartsWith(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\stringContains')) { - function stringContains(string $string, bool $case = true): StringContains - { - return Assert::stringContains(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\stringEndsWith')) { - function stringEndsWith(string $suffix): StringEndsWith - { - return Assert::stringEndsWith(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\countOf')) { - function countOf(int $count): Count - { - return Assert::countOf(...\func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\any')) { - /** - * Returns a matcher that matches when the method is executed - * zero or more times. - */ - function any(): AnyInvokedCountMatcher - { - return new AnyInvokedCountMatcher; - } -} - -if (!function_exists('PHPUnit\Framework\never')) { - /** - * Returns a matcher that matches when the method is never executed. - */ - function never(): InvokedCountMatcher - { - return new InvokedCountMatcher(0); - } -} - -if (!function_exists('PHPUnit\Framework\atLeast')) { - /** - * Returns a matcher that matches when the method is executed - * at least N times. - */ - function atLeast(int $requiredInvocations): InvokedAtLeastCountMatcher - { - return new InvokedAtLeastCountMatcher( - $requiredInvocations - ); - } -} - -if (!function_exists('PHPUnit\Framework\atLeastOnce')) { - /** - * Returns a matcher that matches when the method is executed at least once. - */ - function atLeastOnce(): InvokedAtLeastOnceMatcher - { - return new InvokedAtLeastOnceMatcher; - } -} - -if (!function_exists('PHPUnit\Framework\once')) { - /** - * Returns a matcher that matches when the method is executed exactly once. - */ - function once(): InvokedCountMatcher - { - return new InvokedCountMatcher(1); - } -} - -if (!function_exists('PHPUnit\Framework\exactly')) { - /** - * Returns a matcher that matches when the method is executed - * exactly $count times. - */ - function exactly(int $count): InvokedCountMatcher - { - return new InvokedCountMatcher($count); - } -} - -if (!function_exists('PHPUnit\Framework\atMost')) { - /** - * Returns a matcher that matches when the method is executed - * at most N times. - */ - function atMost(int $allowedInvocations): InvokedAtMostCountMatcher - { - return new InvokedAtMostCountMatcher($allowedInvocations); - } -} - -if (!function_exists('PHPUnit\Framework\at')) { - /** - * Returns a matcher that matches when the method is executed - * at the given index. - */ - function at(int $index): InvokedAtIndexMatcher - { - return new InvokedAtIndexMatcher($index); - } -} - -if (!function_exists('PHPUnit\Framework\returnValue')) { - function returnValue($value): ReturnStub - { - return new ReturnStub($value); - } -} - -if (!function_exists('PHPUnit\Framework\returnValueMap')) { - function returnValueMap(array $valueMap): ReturnValueMapStub - { - return new ReturnValueMapStub($valueMap); - } -} - -if (!function_exists('PHPUnit\Framework\returnArgument')) { - function returnArgument(int $argumentIndex): ReturnArgumentStub - { - return new ReturnArgumentStub($argumentIndex); - } -} - -if (!function_exists('PHPUnit\Framework\returnCallback')) { - function returnCallback($callback): ReturnCallbackStub - { - return new ReturnCallbackStub($callback); - } -} - -if (!function_exists('PHPUnit\Framework\returnSelf')) { - /** - * Returns the current object. - * - * This method is useful when mocking a fluent interface. - */ - function returnSelf(): ReturnSelfStub - { - return new ReturnSelfStub; - } -} - -if (!function_exists('PHPUnit\Framework\throwException')) { - function throwException(Throwable $exception): ExceptionStub - { - return new ExceptionStub($exception); - } -} - -if (!function_exists('PHPUnit\Framework\onConsecutiveCalls')) { - function onConsecutiveCalls(): ConsecutiveCallsStub - { - $args = \func_get_args(); - - return new ConsecutiveCallsStub($args); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/ArrayHasKey.php b/vendor/phpunit/phpunit/src/Framework/Constraint/ArrayHasKey.php deleted file mode 100644 index 0ba5be9..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/ArrayHasKey.php +++ /dev/null @@ -1,82 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function array_key_exists; -use function is_array; -use ArrayAccess; - -/** - * Constraint that asserts that the array it is evaluated for has a given key. - * - * Uses array_key_exists() to check if the key is found in the input array, if - * not found the evaluation fails. - * - * The array key is passed in the constructor. - */ -final class ArrayHasKey extends Constraint -{ - /** - * @var int|string - */ - private $key; - - /** - * @param int|string $key - */ - public function __construct($key) - { - $this->key = $key; - } - - /** - * Returns a string representation of the constraint. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function toString(): string - { - return 'has the key ' . $this->exporter()->export($this->key); - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - if (is_array($other)) { - return array_key_exists($this->key, $other); - } - - if ($other instanceof ArrayAccess) { - return $other->offsetExists($this->key); - } - - return false; - } - - /** - * Returns the description of the failure. - * - * The beginning of failure messages is "Failed asserting that" in most - * cases. This method should return the second part of that sentence. - * - * @param mixed $other evaluated value or object - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - protected function failureDescription($other): string - { - return 'an array ' . $this->toString(); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/ArraySubset.php b/vendor/phpunit/phpunit/src/Framework/Constraint/ArraySubset.php deleted file mode 100644 index 34c61e3..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/ArraySubset.php +++ /dev/null @@ -1,135 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function array_replace_recursive; -use function is_array; -use function iterator_to_array; -use function var_export; -use ArrayObject; -use PHPUnit\Framework\ExpectationFailedException; -use SebastianBergmann\Comparator\ComparisonFailure; -use Traversable; - -/** - * Constraint that asserts that the array it is evaluated for has a specified subset. - * - * Uses array_replace_recursive() to check if a key value subset is part of the - * subject array. - * - * @codeCoverageIgnore - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3494 - */ -final class ArraySubset extends Constraint -{ - /** - * @var iterable - */ - private $subset; - - /** - * @var bool - */ - private $strict; - - public function __construct(iterable $subset, bool $strict = false) - { - $this->strict = $strict; - $this->subset = $subset; - } - - /** - * Evaluates the constraint for parameter $other. - * - * If $returnResult is set to false (the default), an exception is thrown - * in case of a failure. null is returned otherwise. - * - * If $returnResult is true, the result of the evaluation is returned as - * a boolean value instead: true in case of success, false in case of a - * failure. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public function evaluate($other, string $description = '', bool $returnResult = false) - { - //type cast $other & $this->subset as an array to allow - //support in standard array functions. - $other = $this->toArray($other); - $this->subset = $this->toArray($this->subset); - - $patched = array_replace_recursive($other, $this->subset); - - if ($this->strict) { - $result = $other === $patched; - } else { - $result = $other == $patched; - } - - if ($returnResult) { - return $result; - } - - if (!$result) { - $f = new ComparisonFailure( - $patched, - $other, - var_export($patched, true), - var_export($other, true) - ); - - $this->fail($other, $description, $f); - } - } - - /** - * Returns a string representation of the constraint. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function toString(): string - { - return 'has the subset ' . $this->exporter()->export($this->subset); - } - - /** - * Returns the description of the failure. - * - * The beginning of failure messages is "Failed asserting that" in most - * cases. This method should return the second part of that sentence. - * - * @param mixed $other evaluated value or object - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - protected function failureDescription($other): string - { - return 'an array ' . $this->toString(); - } - - private function toArray(iterable $other): array - { - if (is_array($other)) { - return $other; - } - - if ($other instanceof ArrayObject) { - return $other->getArrayCopy(); - } - - if ($other instanceof Traversable) { - return iterator_to_array($other); - } - - // Keep BC even if we know that array would not be the expected one - return (array) $other; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Attribute.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Attribute.php deleted file mode 100644 index ad4e2f9..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Attribute.php +++ /dev/null @@ -1,79 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use PHPUnit\Framework\Assert; -use PHPUnit\Framework\ExpectationFailedException; - -/** - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - */ -final class Attribute extends Composite -{ - /** - * @var string - */ - private $attributeName; - - public function __construct(Constraint $constraint, string $attributeName) - { - parent::__construct($constraint); - - $this->attributeName = $attributeName; - } - - /** - * Evaluates the constraint for parameter $other. - * - * If $returnResult is set to false (the default), an exception is thrown - * in case of a failure. null is returned otherwise. - * - * If $returnResult is true, the result of the evaluation is returned as - * a boolean value instead: true in case of success, false in case of a - * failure. - * - * @throws \PHPUnit\Framework\Exception - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public function evaluate($other, string $description = '', bool $returnResult = false) - { - return parent::evaluate( - Assert::readAttribute( - $other, - $this->attributeName - ), - $description, - $returnResult - ); - } - - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return 'attribute "' . $this->attributeName . '" ' . $this->innerConstraint()->toString(); - } - - /** - * Returns the description of the failure. - * - * The beginning of failure messages is "Failed asserting that" in most - * cases. This method should return the second part of that sentence. - * - * @param mixed $other evaluated value or object - */ - protected function failureDescription($other): string - { - return $this->toString(); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Callback.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Callback.php deleted file mode 100644 index 7a619b6..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Callback.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -/** - * Constraint that evaluates against a specified closure. - * - * @psalm-template CallbackInput of mixed - */ -final class Callback extends Constraint -{ - /** - * @var callable - * - * @psalm-var callable(CallbackInput $input): bool - */ - private $callback; - - /** @psalm-param callable(CallbackInput $input): bool $callback */ - public function __construct(callable $callback) - { - $this->callback = $callback; - } - - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return 'is accepted by specified callback'; - } - - /** - * Evaluates the constraint for parameter $value. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - * - * @psalm-param CallbackInput $other - */ - protected function matches($other): bool - { - return ($this->callback)($other); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/ClassHasAttribute.php b/vendor/phpunit/phpunit/src/Framework/Constraint/ClassHasAttribute.php deleted file mode 100644 index c42964c..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/ClassHasAttribute.php +++ /dev/null @@ -1,91 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function get_class; -use function is_object; -use function sprintf; -use PHPUnit\Framework\Exception; -use ReflectionClass; -use ReflectionException; - -/** - * Constraint that asserts that the class it is evaluated for has a given - * attribute. - * - * The attribute name is passed in the constructor. - */ -class ClassHasAttribute extends Constraint -{ - /** - * @var string - */ - private $attributeName; - - public function __construct(string $attributeName) - { - $this->attributeName = $attributeName; - } - - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return sprintf( - 'has attribute "%s"', - $this->attributeName - ); - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - try { - return (new ReflectionClass($other))->hasProperty($this->attributeName); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - } - - /** - * Returns the description of the failure. - * - * The beginning of failure messages is "Failed asserting that" in most - * cases. This method should return the second part of that sentence. - * - * @param mixed $other evaluated value or object - */ - protected function failureDescription($other): string - { - return sprintf( - '%sclass "%s" %s', - is_object($other) ? 'object of ' : '', - is_object($other) ? get_class($other) : $other, - $this->toString() - ); - } - - protected function attributeName(): string - { - return $this->attributeName; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/ClassHasStaticAttribute.php b/vendor/phpunit/phpunit/src/Framework/Constraint/ClassHasStaticAttribute.php deleted file mode 100644 index 16e2917..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/ClassHasStaticAttribute.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function sprintf; -use PHPUnit\Framework\Exception; -use ReflectionClass; -use ReflectionException; - -/** - * Constraint that asserts that the class it is evaluated for has a given - * static attribute. - * - * The attribute name is passed in the constructor. - */ -final class ClassHasStaticAttribute extends ClassHasAttribute -{ - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return sprintf( - 'has static attribute "%s"', - $this->attributeName() - ); - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - try { - $class = new ReflectionClass($other); - - if ($class->hasProperty($this->attributeName())) { - return $class->getProperty($this->attributeName())->isStatic(); - } - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - return false; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Composite.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Composite.php deleted file mode 100644 index c9074ea..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Composite.php +++ /dev/null @@ -1,69 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function count; -use PHPUnit\Framework\ExpectationFailedException; - -/** - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338 - * @codeCoverageIgnore - */ -abstract class Composite extends Constraint -{ - /** - * @var Constraint - */ - private $innerConstraint; - - public function __construct(Constraint $innerConstraint) - { - $this->innerConstraint = $innerConstraint; - } - - /** - * Evaluates the constraint for parameter $other. - * - * If $returnResult is set to false (the default), an exception is thrown - * in case of a failure. null is returned otherwise. - * - * If $returnResult is true, the result of the evaluation is returned as - * a boolean value instead: true in case of success, false in case of a - * failure. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public function evaluate($other, string $description = '', bool $returnResult = false) - { - try { - return $this->innerConstraint->evaluate( - $other, - $description, - $returnResult - ); - } catch (ExpectationFailedException $e) { - $this->fail($other, $description, $e->getComparisonFailure()); - } - } - - /** - * Counts the number of constraint elements. - */ - public function count(): int - { - return count($this->innerConstraint); - } - - protected function innerConstraint(): Constraint - { - return $this->innerConstraint; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php deleted file mode 100644 index 52972b1..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php +++ /dev/null @@ -1,155 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function sprintf; -use Countable; -use PHPUnit\Framework\ExpectationFailedException; -use PHPUnit\Framework\SelfDescribing; -use SebastianBergmann\Comparator\ComparisonFailure; -use SebastianBergmann\Exporter\Exporter; - -/** - * Abstract base class for constraints which can be applied to any value. - */ -abstract class Constraint implements Countable, SelfDescribing -{ - /** - * @var Exporter - */ - private $exporter; - - /** - * Evaluates the constraint for parameter $other. - * - * If $returnResult is set to false (the default), an exception is thrown - * in case of a failure. null is returned otherwise. - * - * If $returnResult is true, the result of the evaluation is returned as - * a boolean value instead: true in case of success, false in case of a - * failure. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public function evaluate($other, string $description = '', bool $returnResult = false) - { - $success = false; - - if ($this->matches($other)) { - $success = true; - } - - if ($returnResult) { - return $success; - } - - if (!$success) { - $this->fail($other, $description); - } - } - - /** - * Counts the number of constraint elements. - */ - public function count(): int - { - return 1; - } - - protected function exporter(): Exporter - { - if ($this->exporter === null) { - $this->exporter = new Exporter; - } - - return $this->exporter; - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * This method can be overridden to implement the evaluation algorithm. - * - * @param mixed $other value or object to evaluate - * @codeCoverageIgnore - */ - protected function matches($other): bool - { - return false; - } - - /** - * Throws an exception for the given compared value and test description. - * - * @param mixed $other evaluated value or object - * @param string $description Additional information about the test - * @param ComparisonFailure $comparisonFailure - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-return never-return - */ - protected function fail($other, $description, ComparisonFailure $comparisonFailure = null): void - { - $failureDescription = sprintf( - 'Failed asserting that %s.', - $this->failureDescription($other) - ); - - $additionalFailureDescription = $this->additionalFailureDescription($other); - - if ($additionalFailureDescription) { - $failureDescription .= "\n" . $additionalFailureDescription; - } - - if (!empty($description)) { - $failureDescription = $description . "\n" . $failureDescription; - } - - throw new ExpectationFailedException( - $failureDescription, - $comparisonFailure - ); - } - - /** - * Return additional failure description where needed. - * - * The function can be overridden to provide additional failure - * information like a diff - * - * @param mixed $other evaluated value or object - */ - protected function additionalFailureDescription($other): string - { - return ''; - } - - /** - * Returns the description of the failure. - * - * The beginning of failure messages is "Failed asserting that" in most - * cases. This method should return the second part of that sentence. - * - * To provide additional failure information additionalFailureDescription - * can be used. - * - * @param mixed $other evaluated value or object - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - protected function failureDescription($other): string - { - return $this->exporter()->export($other) . ' ' . $this->toString(); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Count.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Count.php deleted file mode 100644 index 944d908..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Count.php +++ /dev/null @@ -1,128 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function count; -use function is_array; -use function iterator_count; -use function sprintf; -use Countable; -use EmptyIterator; -use Generator; -use Iterator; -use IteratorAggregate; -use Traversable; - -class Count extends Constraint -{ - /** - * @var int - */ - private $expectedCount; - - public function __construct(int $expected) - { - $this->expectedCount = $expected; - } - - public function toString(): string - { - return sprintf( - 'count matches %d', - $this->expectedCount - ); - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - */ - protected function matches($other): bool - { - return $this->expectedCount === $this->getCountOf($other); - } - - /** - * @param iterable $other - */ - protected function getCountOf($other): ?int - { - if ($other instanceof Countable || is_array($other)) { - return count($other); - } - - if ($other instanceof EmptyIterator) { - return 0; - } - - if ($other instanceof Traversable) { - while ($other instanceof IteratorAggregate) { - $other = $other->getIterator(); - } - - $iterator = $other; - - if ($iterator instanceof Generator) { - return $this->getCountOfGenerator($iterator); - } - - if (!$iterator instanceof Iterator) { - return iterator_count($iterator); - } - - $key = $iterator->key(); - $count = iterator_count($iterator); - - // Manually rewind $iterator to previous key, since iterator_count - // moves pointer. - if ($key !== null) { - $iterator->rewind(); - - while ($iterator->valid() && $key !== $iterator->key()) { - $iterator->next(); - } - } - - return $count; - } - - return null; - } - - /** - * Returns the total number of iterations from a generator. - * This will fully exhaust the generator. - */ - protected function getCountOfGenerator(Generator $generator): int - { - for ($count = 0; $generator->valid(); $generator->next()) { - $count++; - } - - return $count; - } - - /** - * Returns the description of the failure. - * - * The beginning of failure messages is "Failed asserting that" in most - * cases. This method should return the second part of that sentence. - * - * @param mixed $other evaluated value or object - */ - protected function failureDescription($other): string - { - return sprintf( - 'actual size %d matches expected size %d', - $this->getCountOf($other), - $this->expectedCount - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/DirectoryExists.php b/vendor/phpunit/phpunit/src/Framework/Constraint/DirectoryExists.php deleted file mode 100644 index ecdad81..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/DirectoryExists.php +++ /dev/null @@ -1,56 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function is_dir; -use function sprintf; - -/** - * Constraint that checks if the directory(name) that it is evaluated for exists. - * - * The file path to check is passed as $other in evaluate(). - */ -final class DirectoryExists extends Constraint -{ - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return 'directory exists'; - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - return is_dir($other); - } - - /** - * Returns the description of the failure. - * - * The beginning of failure messages is "Failed asserting that" in most - * cases. This method should return the second part of that sentence. - * - * @param mixed $other evaluated value or object - */ - protected function failureDescription($other): string - { - return sprintf( - 'directory "%s" exists', - $other - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Exception.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Exception.php deleted file mode 100644 index 5119071..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Exception.php +++ /dev/null @@ -1,82 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function get_class; -use function sprintf; -use PHPUnit\Util\Filter; -use Throwable; - -final class Exception extends Constraint -{ - /** - * @var string - */ - private $className; - - public function __construct(string $className) - { - $this->className = $className; - } - - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return sprintf( - 'exception of type "%s"', - $this->className - ); - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - return $other instanceof $this->className; - } - - /** - * Returns the description of the failure. - * - * The beginning of failure messages is "Failed asserting that" in most - * cases. This method should return the second part of that sentence. - * - * @param mixed $other evaluated value or object - */ - protected function failureDescription($other): string - { - if ($other !== null) { - $message = ''; - - if ($other instanceof Throwable) { - $message = '. Message was: "' . $other->getMessage() . '" at' - . "\n" . Filter::getFilteredStacktrace($other); - } - - return sprintf( - 'exception of type "%s" matches expected exception "%s"%s', - get_class($other), - $this->className, - $message - ); - } - - return sprintf( - 'exception of type "%s" is thrown', - $this->className - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/ExceptionCode.php b/vendor/phpunit/phpunit/src/Framework/Constraint/ExceptionCode.php deleted file mode 100644 index 682f48c..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/ExceptionCode.php +++ /dev/null @@ -1,64 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function sprintf; -use Throwable; - -final class ExceptionCode extends Constraint -{ - /** - * @var int|string - */ - private $expectedCode; - - /** - * @param int|string $expected - */ - public function __construct($expected) - { - $this->expectedCode = $expected; - } - - public function toString(): string - { - return 'exception code is '; - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param Throwable $other - */ - protected function matches($other): bool - { - return (string) $other->getCode() === (string) $this->expectedCode; - } - - /** - * Returns the description of the failure. - * - * The beginning of failure messages is "Failed asserting that" in most - * cases. This method should return the second part of that sentence. - * - * @param mixed $other evaluated value or object - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - protected function failureDescription($other): string - { - return sprintf( - '%s is equal to expected exception code %s', - $this->exporter()->export($other->getCode()), - $this->exporter()->export($this->expectedCode) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/ExceptionMessage.php b/vendor/phpunit/phpunit/src/Framework/Constraint/ExceptionMessage.php deleted file mode 100644 index 4836b15..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/ExceptionMessage.php +++ /dev/null @@ -1,75 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function sprintf; -use function strpos; -use Throwable; - -final class ExceptionMessage extends Constraint -{ - /** - * @var string - */ - private $expectedMessage; - - public function __construct(string $expected) - { - $this->expectedMessage = $expected; - } - - public function toString(): string - { - if ($this->expectedMessage === '') { - return 'exception message is empty'; - } - - return 'exception message contains '; - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param Throwable $other - */ - protected function matches($other): bool - { - if ($this->expectedMessage === '') { - return $other->getMessage() === ''; - } - - return strpos((string) $other->getMessage(), $this->expectedMessage) !== false; - } - - /** - * Returns the description of the failure. - * - * The beginning of failure messages is "Failed asserting that" in most - * cases. This method should return the second part of that sentence. - * - * @param mixed $other evaluated value or object - */ - protected function failureDescription($other): string - { - if ($this->expectedMessage === '') { - return sprintf( - "exception message is empty but is '%s'", - $other->getMessage() - ); - } - - return sprintf( - "exception message '%s' contains '%s'", - $other->getMessage(), - $this->expectedMessage - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/ExceptionMessageRegularExpression.php b/vendor/phpunit/phpunit/src/Framework/Constraint/ExceptionMessageRegularExpression.php deleted file mode 100644 index 1b03482..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/ExceptionMessageRegularExpression.php +++ /dev/null @@ -1,71 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function sprintf; -use Exception; -use PHPUnit\Util\RegularExpression as RegularExpressionUtil; - -final class ExceptionMessageRegularExpression extends Constraint -{ - /** - * @var string - */ - private $expectedMessageRegExp; - - public function __construct(string $expected) - { - $this->expectedMessageRegExp = $expected; - } - - public function toString(): string - { - return 'exception message matches '; - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param \PHPUnit\Framework\Exception $other - * - * @throws \PHPUnit\Framework\Exception - * @throws Exception - */ - protected function matches($other): bool - { - $match = RegularExpressionUtil::safeMatch($this->expectedMessageRegExp, $other->getMessage()); - - if ($match === false) { - throw new \PHPUnit\Framework\Exception( - "Invalid expected exception message regex given: '{$this->expectedMessageRegExp}'" - ); - } - - return $match === 1; - } - - /** - * Returns the description of the failure. - * - * The beginning of failure messages is "Failed asserting that" in most - * cases. This method should return the second part of that sentence. - * - * @param mixed $other evaluated value or object - */ - protected function failureDescription($other): string - { - return sprintf( - "exception message '%s' matches '%s'", - $other->getMessage(), - $this->expectedMessageRegExp - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/FileExists.php b/vendor/phpunit/phpunit/src/Framework/Constraint/FileExists.php deleted file mode 100644 index 8637359..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/FileExists.php +++ /dev/null @@ -1,56 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function file_exists; -use function sprintf; - -/** - * Constraint that checks if the file(name) that it is evaluated for exists. - * - * The file path to check is passed as $other in evaluate(). - */ -final class FileExists extends Constraint -{ - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return 'file exists'; - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - return file_exists($other); - } - - /** - * Returns the description of the failure. - * - * The beginning of failure messages is "Failed asserting that" in most - * cases. This method should return the second part of that sentence. - * - * @param mixed $other evaluated value or object - */ - protected function failureDescription($other): string - { - return sprintf( - 'file "%s" exists', - $other - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/GreaterThan.php b/vendor/phpunit/phpunit/src/Framework/Constraint/GreaterThan.php deleted file mode 100644 index b007615..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/GreaterThan.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -/** - * Constraint that asserts that the value it is evaluated for is greater - * than a given value. - */ -final class GreaterThan extends Constraint -{ - /** - * @var float|int - */ - private $value; - - /** - * @param float|int $value - */ - public function __construct($value) - { - $this->value = $value; - } - - /** - * Returns a string representation of the constraint. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function toString(): string - { - return 'is greater than ' . $this->exporter()->export($this->value); - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - return $this->value < $other; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/IsAnything.php b/vendor/phpunit/phpunit/src/Framework/Constraint/IsAnything.php deleted file mode 100644 index 0407ef1..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/IsAnything.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use PHPUnit\Framework\ExpectationFailedException; - -/** - * Constraint that accepts any input value. - */ -final class IsAnything extends Constraint -{ - /** - * Evaluates the constraint for parameter $other. - * - * If $returnResult is set to false (the default), an exception is thrown - * in case of a failure. null is returned otherwise. - * - * If $returnResult is true, the result of the evaluation is returned as - * a boolean value instead: true in case of success, false in case of a - * failure. - * - * @throws ExpectationFailedException - */ - public function evaluate($other, string $description = '', bool $returnResult = false) - { - return $returnResult ? true : null; - } - - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return 'is anything'; - } - - /** - * Counts the number of constraint elements. - */ - public function count(): int - { - return 0; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/IsEmpty.php b/vendor/phpunit/phpunit/src/Framework/Constraint/IsEmpty.php deleted file mode 100644 index 555afa7..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/IsEmpty.php +++ /dev/null @@ -1,70 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function count; -use function gettype; -use function sprintf; -use function strpos; -use Countable; -use EmptyIterator; - -/** - * Constraint that checks whether a variable is empty(). - */ -final class IsEmpty extends Constraint -{ - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return 'is empty'; - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - if ($other instanceof EmptyIterator) { - return true; - } - - if ($other instanceof Countable) { - return count($other) === 0; - } - - return empty($other); - } - - /** - * Returns the description of the failure. - * - * The beginning of failure messages is "Failed asserting that" in most - * cases. This method should return the second part of that sentence. - * - * @param mixed $other evaluated value or object - */ - protected function failureDescription($other): string - { - $type = gettype($other); - - return sprintf( - '%s %s %s', - strpos($type, 'a') === 0 || strpos($type, 'o') === 0 ? 'an' : 'a', - $type, - $this->toString() - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/IsEqual.php b/vendor/phpunit/phpunit/src/Framework/Constraint/IsEqual.php deleted file mode 100644 index bf90a78..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/IsEqual.php +++ /dev/null @@ -1,142 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function is_string; -use function sprintf; -use function strpos; -use function trim; -use PHPUnit\Framework\ExpectationFailedException; -use SebastianBergmann\Comparator\ComparisonFailure; -use SebastianBergmann\Comparator\Factory as ComparatorFactory; - -/** - * Constraint that checks if one value is equal to another. - * - * Equality is checked with PHP's == operator, the operator is explained in - * detail at {@url https://php.net/manual/en/types.comparisons.php}. - * Two values are equal if they have the same value disregarding type. - * - * The expected value is passed in the constructor. - */ -final class IsEqual extends Constraint -{ - /** - * @var mixed - */ - private $value; - - /** - * @var float - */ - private $delta; - - /** - * @var bool - */ - private $canonicalize; - - /** - * @var bool - */ - private $ignoreCase; - - public function __construct($value, float $delta = 0.0, int $maxDepth = 10, bool $canonicalize = false, bool $ignoreCase = false) - { - $this->value = $value; - $this->delta = $delta; - $this->canonicalize = $canonicalize; - $this->ignoreCase = $ignoreCase; - } - - /** - * Evaluates the constraint for parameter $other. - * - * If $returnResult is set to false (the default), an exception is thrown - * in case of a failure. null is returned otherwise. - * - * If $returnResult is true, the result of the evaluation is returned as - * a boolean value instead: true in case of success, false in case of a - * failure. - * - * @throws ExpectationFailedException - */ - public function evaluate($other, string $description = '', bool $returnResult = false) - { - // If $this->value and $other are identical, they are also equal. - // This is the most common path and will allow us to skip - // initialization of all the comparators. - if ($this->value === $other) { - return true; - } - - $comparatorFactory = ComparatorFactory::getInstance(); - - try { - $comparator = $comparatorFactory->getComparatorFor( - $this->value, - $other - ); - - $comparator->assertEquals( - $this->value, - $other, - $this->delta, - $this->canonicalize, - $this->ignoreCase - ); - } catch (ComparisonFailure $f) { - if ($returnResult) { - return false; - } - - throw new ExpectationFailedException( - trim($description . "\n" . $f->getMessage()), - $f - ); - } - - return true; - } - - /** - * Returns a string representation of the constraint. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function toString(): string - { - $delta = ''; - - if (is_string($this->value)) { - if (strpos($this->value, "\n") !== false) { - return 'is equal to '; - } - - return sprintf( - "is equal to '%s'", - $this->value - ); - } - - if ($this->delta != 0) { - $delta = sprintf( - ' with delta <%F>', - $this->delta - ); - } - - return sprintf( - 'is equal to %s%s', - $this->exporter()->export($this->value), - $delta - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/IsFalse.php b/vendor/phpunit/phpunit/src/Framework/Constraint/IsFalse.php deleted file mode 100644 index 8b11e0a..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/IsFalse.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -/** - * Constraint that accepts false. - */ -final class IsFalse extends Constraint -{ - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return 'is false'; - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - return $other === false; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/IsFinite.php b/vendor/phpunit/phpunit/src/Framework/Constraint/IsFinite.php deleted file mode 100644 index ed727d5..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/IsFinite.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function is_finite; - -/** - * Constraint that accepts finite. - */ -final class IsFinite extends Constraint -{ - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return 'is finite'; - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - return is_finite($other); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/IsIdentical.php b/vendor/phpunit/phpunit/src/Framework/Constraint/IsIdentical.php deleted file mode 100644 index ed0d6f4..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/IsIdentical.php +++ /dev/null @@ -1,147 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function abs; -use function get_class; -use function is_array; -use function is_float; -use function is_infinite; -use function is_nan; -use function is_object; -use function is_string; -use function sprintf; -use PHPUnit\Framework\ExpectationFailedException; -use SebastianBergmann\Comparator\ComparisonFailure; - -/** - * Constraint that asserts that one value is identical to another. - * - * Identical check is performed with PHP's === operator, the operator is - * explained in detail at - * {@url https://php.net/manual/en/types.comparisons.php}. - * Two values are identical if they have the same value and are of the same - * type. - * - * The expected value is passed in the constructor. - */ -final class IsIdentical extends Constraint -{ - /** - * @var float - */ - private const EPSILON = 0.0000000001; - - /** - * @var mixed - */ - private $value; - - public function __construct($value) - { - $this->value = $value; - } - - /** - * Evaluates the constraint for parameter $other. - * - * If $returnResult is set to false (the default), an exception is thrown - * in case of a failure. null is returned otherwise. - * - * If $returnResult is true, the result of the evaluation is returned as - * a boolean value instead: true in case of success, false in case of a - * failure. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public function evaluate($other, string $description = '', bool $returnResult = false) - { - if (is_float($this->value) && is_float($other) && - !is_infinite($this->value) && !is_infinite($other) && - !is_nan($this->value) && !is_nan($other)) { - $success = abs($this->value - $other) < self::EPSILON; - } else { - $success = $this->value === $other; - } - - if ($returnResult) { - return $success; - } - - if (!$success) { - $f = null; - - // if both values are strings, make sure a diff is generated - if (is_string($this->value) && is_string($other)) { - $f = new ComparisonFailure( - $this->value, - $other, - sprintf("'%s'", $this->value), - sprintf("'%s'", $other) - ); - } - - // if both values are array, make sure a diff is generated - if (is_array($this->value) && is_array($other)) { - $f = new ComparisonFailure( - $this->value, - $other, - $this->exporter()->export($this->value), - $this->exporter()->export($other) - ); - } - - $this->fail($other, $description, $f); - } - } - - /** - * Returns a string representation of the constraint. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function toString(): string - { - if (is_object($this->value)) { - return 'is identical to an object of class "' . - get_class($this->value) . '"'; - } - - return 'is identical to ' . $this->exporter()->export($this->value); - } - - /** - * Returns the description of the failure. - * - * The beginning of failure messages is "Failed asserting that" in most - * cases. This method should return the second part of that sentence. - * - * @param mixed $other evaluated value or object - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - protected function failureDescription($other): string - { - if (is_object($this->value) && is_object($other)) { - return 'two variables reference the same object'; - } - - if (is_string($this->value) && is_string($other)) { - return 'two strings are identical'; - } - - if (is_array($this->value) && is_array($other)) { - return 'two arrays are identical'; - } - - return parent::failureDescription($other); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/IsInfinite.php b/vendor/phpunit/phpunit/src/Framework/Constraint/IsInfinite.php deleted file mode 100644 index 0ada7f1..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/IsInfinite.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function is_infinite; - -/** - * Constraint that accepts infinite. - */ -final class IsInfinite extends Constraint -{ - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return 'is infinite'; - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - return is_infinite($other); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/IsInstanceOf.php b/vendor/phpunit/phpunit/src/Framework/Constraint/IsInstanceOf.php deleted file mode 100644 index 02631f8..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/IsInstanceOf.php +++ /dev/null @@ -1,90 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function sprintf; -use ReflectionClass; -use ReflectionException; - -/** - * Constraint that asserts that the object it is evaluated for is an instance - * of a given class. - * - * The expected class name is passed in the constructor. - */ -final class IsInstanceOf extends Constraint -{ - /** - * @var string - */ - private $className; - - public function __construct(string $className) - { - $this->className = $className; - } - - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return sprintf( - 'is instance of %s "%s"', - $this->getType(), - $this->className - ); - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - return $other instanceof $this->className; - } - - /** - * Returns the description of the failure. - * - * The beginning of failure messages is "Failed asserting that" in most - * cases. This method should return the second part of that sentence. - * - * @param mixed $other evaluated value or object - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - protected function failureDescription($other): string - { - return sprintf( - '%s is an instance of %s "%s"', - $this->exporter()->shortenedExport($other), - $this->getType(), - $this->className - ); - } - - private function getType(): string - { - try { - $reflection = new ReflectionClass($this->className); - - if ($reflection->isInterface()) { - return 'interface'; - } - } catch (ReflectionException $e) { - } - - return 'class'; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/IsJson.php b/vendor/phpunit/phpunit/src/Framework/Constraint/IsJson.php deleted file mode 100644 index e10e6c1..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/IsJson.php +++ /dev/null @@ -1,77 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function json_decode; -use function json_last_error; -use function sprintf; - -/** - * Constraint that asserts that a string is valid JSON. - */ -final class IsJson extends Constraint -{ - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return 'is valid JSON'; - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - if ($other === '') { - return false; - } - - json_decode($other); - - if (json_last_error()) { - return false; - } - - return true; - } - - /** - * Returns the description of the failure. - * - * The beginning of failure messages is "Failed asserting that" in most - * cases. This method should return the second part of that sentence. - * - * @param mixed $other evaluated value or object - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - protected function failureDescription($other): string - { - if ($other === '') { - return 'an empty string is valid JSON'; - } - - json_decode($other); - $error = JsonMatchesErrorMessageProvider::determineJsonError( - (string) json_last_error() - ); - - return sprintf( - '%s is valid JSON (%s)', - $this->exporter()->shortenedExport($other), - $error - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/IsNan.php b/vendor/phpunit/phpunit/src/Framework/Constraint/IsNan.php deleted file mode 100644 index 9dde4c6..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/IsNan.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function is_nan; - -/** - * Constraint that accepts nan. - */ -final class IsNan extends Constraint -{ - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return 'is nan'; - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - return is_nan($other); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/IsNull.php b/vendor/phpunit/phpunit/src/Framework/Constraint/IsNull.php deleted file mode 100644 index 1538138..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/IsNull.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -/** - * Constraint that accepts null. - */ -final class IsNull extends Constraint -{ - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return 'is null'; - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - return $other === null; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/IsReadable.php b/vendor/phpunit/phpunit/src/Framework/Constraint/IsReadable.php deleted file mode 100644 index bcf8274..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/IsReadable.php +++ /dev/null @@ -1,56 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function is_readable; -use function sprintf; - -/** - * Constraint that checks if the file/dir(name) that it is evaluated for is readable. - * - * The file path to check is passed as $other in evaluate(). - */ -final class IsReadable extends Constraint -{ - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return 'is readable'; - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - return is_readable($other); - } - - /** - * Returns the description of the failure. - * - * The beginning of failure messages is "Failed asserting that" in most - * cases. This method should return the second part of that sentence. - * - * @param mixed $other evaluated value or object - */ - protected function failureDescription($other): string - { - return sprintf( - '"%s" is readable', - $other - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/IsTrue.php b/vendor/phpunit/phpunit/src/Framework/Constraint/IsTrue.php deleted file mode 100644 index 7948c8f..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/IsTrue.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -/** - * Constraint that accepts true. - */ -final class IsTrue extends Constraint -{ - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return 'is true'; - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - return $other === true; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/IsType.php b/vendor/phpunit/phpunit/src/Framework/Constraint/IsType.php deleted file mode 100644 index 977be34..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/IsType.php +++ /dev/null @@ -1,214 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function get_resource_type; -use function is_array; -use function is_bool; -use function is_callable; -use function is_float; -use function is_int; -use function is_iterable; -use function is_numeric; -use function is_object; -use function is_resource; -use function is_scalar; -use function is_string; -use function sprintf; -use TypeError; - -/** - * Constraint that asserts that the value it is evaluated for is of a - * specified type. - * - * The expected value is passed in the constructor. - */ -final class IsType extends Constraint -{ - /** - * @var string - */ - public const TYPE_ARRAY = 'array'; - - /** - * @var string - */ - public const TYPE_BOOL = 'bool'; - - /** - * @var string - */ - public const TYPE_FLOAT = 'float'; - - /** - * @var string - */ - public const TYPE_INT = 'int'; - - /** - * @var string - */ - public const TYPE_NULL = 'null'; - - /** - * @var string - */ - public const TYPE_NUMERIC = 'numeric'; - - /** - * @var string - */ - public const TYPE_OBJECT = 'object'; - - /** - * @var string - */ - public const TYPE_RESOURCE = 'resource'; - - /** - * @var string - */ - public const TYPE_STRING = 'string'; - - /** - * @var string - */ - public const TYPE_SCALAR = 'scalar'; - - /** - * @var string - */ - public const TYPE_CALLABLE = 'callable'; - - /** - * @var string - */ - public const TYPE_ITERABLE = 'iterable'; - - /** - * @var array - */ - private const KNOWN_TYPES = [ - 'array' => true, - 'boolean' => true, - 'bool' => true, - 'double' => true, - 'float' => true, - 'integer' => true, - 'int' => true, - 'null' => true, - 'numeric' => true, - 'object' => true, - 'real' => true, - 'resource' => true, - 'string' => true, - 'scalar' => true, - 'callable' => true, - 'iterable' => true, - ]; - - /** - * @var string - */ - private $type; - - /** - * @throws \PHPUnit\Framework\Exception - */ - public function __construct(string $type) - { - if (!isset(self::KNOWN_TYPES[$type])) { - throw new \PHPUnit\Framework\Exception( - sprintf( - 'Type specified for PHPUnit\Framework\Constraint\IsType <%s> ' . - 'is not a valid type.', - $type - ) - ); - } - - $this->type = $type; - } - - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return sprintf( - 'is of type "%s"', - $this->type - ); - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - switch ($this->type) { - case 'numeric': - return is_numeric($other); - - case 'integer': - case 'int': - return is_int($other); - - case 'double': - case 'float': - case 'real': - return is_float($other); - - case 'string': - return is_string($other); - - case 'boolean': - case 'bool': - return is_bool($other); - - case 'null': - return null === $other; - - case 'array': - return is_array($other); - - case 'object': - return is_object($other); - - case 'resource': - if (is_resource($other)) { - return true; - } - - try { - $resource = @get_resource_type($other); - - if (is_string($resource)) { - return true; - } - } catch (TypeError $e) { - } - - return false; - - case 'scalar': - return is_scalar($other); - - case 'callable': - return is_callable($other); - - case 'iterable': - return is_iterable($other); - } - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/IsWritable.php b/vendor/phpunit/phpunit/src/Framework/Constraint/IsWritable.php deleted file mode 100644 index 8dd86b5..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/IsWritable.php +++ /dev/null @@ -1,56 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function is_writable; -use function sprintf; - -/** - * Constraint that checks if the file/dir(name) that it is evaluated for is writable. - * - * The file path to check is passed as $other in evaluate(). - */ -final class IsWritable extends Constraint -{ - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return 'is writable'; - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - return is_writable($other); - } - - /** - * Returns the description of the failure. - * - * The beginning of failure messages is "Failed asserting that" in most - * cases. This method should return the second part of that sentence. - * - * @param mixed $other evaluated value or object - */ - protected function failureDescription($other): string - { - return sprintf( - '"%s" is writable', - $other - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/JsonMatches.php b/vendor/phpunit/phpunit/src/Framework/Constraint/JsonMatches.php deleted file mode 100644 index 818a0ee..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/JsonMatches.php +++ /dev/null @@ -1,109 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function json_decode; -use function sprintf; -use PHPUnit\Framework\ExpectationFailedException; -use PHPUnit\Util\Json; -use SebastianBergmann\Comparator\ComparisonFailure; - -/** - * Asserts whether or not two JSON objects are equal. - */ -final class JsonMatches extends Constraint -{ - /** - * @var string - */ - private $value; - - public function __construct(string $value) - { - $this->value = $value; - } - - /** - * Returns a string representation of the object. - */ - public function toString(): string - { - return sprintf( - 'matches JSON string "%s"', - $this->value - ); - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * This method can be overridden to implement the evaluation algorithm. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - [$error, $recodedOther] = Json::canonicalize($other); - - if ($error) { - return false; - } - - [$error, $recodedValue] = Json::canonicalize($this->value); - - if ($error) { - return false; - } - - return $recodedOther == $recodedValue; - } - - /** - * Throws an exception for the given compared value and test description. - * - * @param mixed $other evaluated value or object - * @param string $description Additional information about the test - * @param ComparisonFailure $comparisonFailure - * - * @throws \PHPUnit\Framework\Exception - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-return never-return - */ - protected function fail($other, $description, ComparisonFailure $comparisonFailure = null): void - { - if ($comparisonFailure === null) { - [$error, $recodedOther] = Json::canonicalize($other); - - if ($error) { - parent::fail($other, $description); - } - - [$error, $recodedValue] = Json::canonicalize($this->value); - - if ($error) { - parent::fail($other, $description); - } - - $comparisonFailure = new ComparisonFailure( - json_decode($this->value), - json_decode($other), - Json::prettify($recodedValue), - Json::prettify($recodedOther), - false, - 'Failed asserting that two json values are equal.' - ); - } - - parent::fail($other, $description, $comparisonFailure); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/JsonMatchesErrorMessageProvider.php b/vendor/phpunit/phpunit/src/Framework/Constraint/JsonMatchesErrorMessageProvider.php deleted file mode 100644 index 2d28c27..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/JsonMatchesErrorMessageProvider.php +++ /dev/null @@ -1,72 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use const JSON_ERROR_CTRL_CHAR; -use const JSON_ERROR_DEPTH; -use const JSON_ERROR_NONE; -use const JSON_ERROR_STATE_MISMATCH; -use const JSON_ERROR_SYNTAX; -use const JSON_ERROR_UTF8; -use function strtolower; - -/** - * Provides human readable messages for each JSON error. - */ -final class JsonMatchesErrorMessageProvider -{ - /** - * Translates JSON error to a human readable string. - */ - public static function determineJsonError(string $error, string $prefix = ''): ?string - { - switch ($error) { - case JSON_ERROR_NONE: - return null; - case JSON_ERROR_DEPTH: - return $prefix . 'Maximum stack depth exceeded'; - case JSON_ERROR_STATE_MISMATCH: - return $prefix . 'Underflow or the modes mismatch'; - case JSON_ERROR_CTRL_CHAR: - return $prefix . 'Unexpected control character found'; - case JSON_ERROR_SYNTAX: - return $prefix . 'Syntax error, malformed JSON'; - case JSON_ERROR_UTF8: - return $prefix . 'Malformed UTF-8 characters, possibly incorrectly encoded'; - - default: - return $prefix . 'Unknown error'; - } - } - - /** - * Translates a given type to a human readable message prefix. - */ - public static function translateTypeToPrefix(string $type): string - { - switch (strtolower($type)) { - case 'expected': - $prefix = 'Expected value JSON decode error - '; - - break; - case 'actual': - $prefix = 'Actual value JSON decode error - '; - - break; - - default: - $prefix = ''; - - break; - } - - return $prefix; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/LessThan.php b/vendor/phpunit/phpunit/src/Framework/Constraint/LessThan.php deleted file mode 100644 index 781c817..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/LessThan.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -/** - * Constraint that asserts that the value it is evaluated for is less than - * a given value. - */ -final class LessThan extends Constraint -{ - /** - * @var float|int - */ - private $value; - - /** - * @param float|int $value - */ - public function __construct($value) - { - $this->value = $value; - } - - /** - * Returns a string representation of the constraint. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function toString(): string - { - return 'is less than ' . $this->exporter()->export($this->value); - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - return $this->value > $other; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/LogicalAnd.php b/vendor/phpunit/phpunit/src/Framework/Constraint/LogicalAnd.php deleted file mode 100644 index 6714bf6..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/LogicalAnd.php +++ /dev/null @@ -1,121 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function array_values; -use function count; -use PHPUnit\Framework\ExpectationFailedException; - -/** - * Logical AND. - */ -final class LogicalAnd extends Constraint -{ - /** - * @var Constraint[] - */ - private $constraints = []; - - public static function fromConstraints(Constraint ...$constraints): self - { - $constraint = new self; - - $constraint->constraints = array_values($constraints); - - return $constraint; - } - - /** - * @param Constraint[] $constraints - * - * @throws \PHPUnit\Framework\Exception - */ - public function setConstraints(array $constraints): void - { - $this->constraints = []; - - foreach ($constraints as $constraint) { - if (!($constraint instanceof Constraint)) { - throw new \PHPUnit\Framework\Exception( - 'All parameters to ' . __CLASS__ . - ' must be a constraint object.' - ); - } - - $this->constraints[] = $constraint; - } - } - - /** - * Evaluates the constraint for parameter $other. - * - * If $returnResult is set to false (the default), an exception is thrown - * in case of a failure. null is returned otherwise. - * - * If $returnResult is true, the result of the evaluation is returned as - * a boolean value instead: true in case of success, false in case of a - * failure. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public function evaluate($other, string $description = '', bool $returnResult = false) - { - $success = true; - - foreach ($this->constraints as $constraint) { - if (!$constraint->evaluate($other, $description, true)) { - $success = false; - - break; - } - } - - if ($returnResult) { - return $success; - } - - if (!$success) { - $this->fail($other, $description); - } - } - - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - $text = ''; - - foreach ($this->constraints as $key => $constraint) { - if ($key > 0) { - $text .= ' and '; - } - - $text .= $constraint->toString(); - } - - return $text; - } - - /** - * Counts the number of constraint elements. - */ - public function count(): int - { - $count = 0; - - foreach ($this->constraints as $constraint) { - $count += count($constraint); - } - - return $count; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/LogicalNot.php b/vendor/phpunit/phpunit/src/Framework/Constraint/LogicalNot.php deleted file mode 100644 index e37b4a1..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/LogicalNot.php +++ /dev/null @@ -1,169 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function count; -use function get_class; -use function preg_match; -use function str_replace; -use PHPUnit\Framework\ExpectationFailedException; - -/** - * Logical NOT. - */ -final class LogicalNot extends Constraint -{ - /** - * @var Constraint - */ - private $constraint; - - public static function negate(string $string): string - { - $positives = [ - 'contains ', - 'exists', - 'has ', - 'is ', - 'are ', - 'matches ', - 'starts with ', - 'ends with ', - 'reference ', - 'not not ', - ]; - - $negatives = [ - 'does not contain ', - 'does not exist', - 'does not have ', - 'is not ', - 'are not ', - 'does not match ', - 'starts not with ', - 'ends not with ', - 'don\'t reference ', - 'not ', - ]; - - preg_match('/(\'[\w\W]*\')([\w\W]*)("[\w\W]*")/i', $string, $matches); - - if (count($matches) > 0) { - $nonInput = $matches[2]; - - $negatedString = str_replace( - $nonInput, - str_replace( - $positives, - $negatives, - $nonInput - ), - $string - ); - } else { - $negatedString = str_replace( - $positives, - $negatives, - $string - ); - } - - return $negatedString; - } - - /** - * @param Constraint|mixed $constraint - */ - public function __construct($constraint) - { - if (!($constraint instanceof Constraint)) { - $constraint = new IsEqual($constraint); - } - - $this->constraint = $constraint; - } - - /** - * Evaluates the constraint for parameter $other. - * - * If $returnResult is set to false (the default), an exception is thrown - * in case of a failure. null is returned otherwise. - * - * If $returnResult is true, the result of the evaluation is returned as - * a boolean value instead: true in case of success, false in case of a - * failure. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public function evaluate($other, string $description = '', bool $returnResult = false) - { - $success = !$this->constraint->evaluate($other, $description, true); - - if ($returnResult) { - return $success; - } - - if (!$success) { - $this->fail($other, $description); - } - } - - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - switch (get_class($this->constraint)) { - case LogicalAnd::class: - case self::class: - case LogicalOr::class: - return 'not( ' . $this->constraint->toString() . ' )'; - - default: - return self::negate( - $this->constraint->toString() - ); - } - } - - /** - * Counts the number of constraint elements. - */ - public function count(): int - { - return count($this->constraint); - } - - /** - * Returns the description of the failure. - * - * The beginning of failure messages is "Failed asserting that" in most - * cases. This method should return the second part of that sentence. - * - * @param mixed $other evaluated value or object - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - protected function failureDescription($other): string - { - switch (get_class($this->constraint)) { - case LogicalAnd::class: - case self::class: - case LogicalOr::class: - return 'not( ' . $this->constraint->failureDescription($other) . ' )'; - - default: - return self::negate( - $this->constraint->failureDescription($other) - ); - } - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/LogicalOr.php b/vendor/phpunit/phpunit/src/Framework/Constraint/LogicalOr.php deleted file mode 100644 index 98bd866..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/LogicalOr.php +++ /dev/null @@ -1,118 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function array_values; -use function count; -use PHPUnit\Framework\ExpectationFailedException; - -/** - * Logical OR. - */ -final class LogicalOr extends Constraint -{ - /** - * @var Constraint[] - */ - private $constraints = []; - - public static function fromConstraints(Constraint ...$constraints): self - { - $constraint = new self; - - $constraint->constraints = array_values($constraints); - - return $constraint; - } - - /** - * @param Constraint[] $constraints - */ - public function setConstraints(array $constraints): void - { - $this->constraints = []; - - foreach ($constraints as $constraint) { - if (!($constraint instanceof Constraint)) { - $constraint = new IsEqual( - $constraint - ); - } - - $this->constraints[] = $constraint; - } - } - - /** - * Evaluates the constraint for parameter $other. - * - * If $returnResult is set to false (the default), an exception is thrown - * in case of a failure. null is returned otherwise. - * - * If $returnResult is true, the result of the evaluation is returned as - * a boolean value instead: true in case of success, false in case of a - * failure. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public function evaluate($other, string $description = '', bool $returnResult = false) - { - $success = false; - - foreach ($this->constraints as $constraint) { - if ($constraint->evaluate($other, $description, true)) { - $success = true; - - break; - } - } - - if ($returnResult) { - return $success; - } - - if (!$success) { - $this->fail($other, $description); - } - } - - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - $text = ''; - - foreach ($this->constraints as $key => $constraint) { - if ($key > 0) { - $text .= ' or '; - } - - $text .= $constraint->toString(); - } - - return $text; - } - - /** - * Counts the number of constraint elements. - */ - public function count(): int - { - $count = 0; - - foreach ($this->constraints as $constraint) { - $count += count($constraint); - } - - return $count; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/LogicalXor.php b/vendor/phpunit/phpunit/src/Framework/Constraint/LogicalXor.php deleted file mode 100644 index 12cfff8..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/LogicalXor.php +++ /dev/null @@ -1,123 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function array_values; -use function count; -use PHPUnit\Framework\ExpectationFailedException; - -/** - * Logical XOR. - */ -final class LogicalXor extends Constraint -{ - /** - * @var Constraint[] - */ - private $constraints = []; - - public static function fromConstraints(Constraint ...$constraints): self - { - $constraint = new self; - - $constraint->constraints = array_values($constraints); - - return $constraint; - } - - /** - * @param Constraint[] $constraints - */ - public function setConstraints(array $constraints): void - { - $this->constraints = []; - - foreach ($constraints as $constraint) { - if (!($constraint instanceof Constraint)) { - $constraint = new IsEqual( - $constraint - ); - } - - $this->constraints[] = $constraint; - } - } - - /** - * Evaluates the constraint for parameter $other. - * - * If $returnResult is set to false (the default), an exception is thrown - * in case of a failure. null is returned otherwise. - * - * If $returnResult is true, the result of the evaluation is returned as - * a boolean value instead: true in case of success, false in case of a - * failure. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public function evaluate($other, string $description = '', bool $returnResult = false) - { - $success = true; - $lastResult = null; - - foreach ($this->constraints as $constraint) { - $result = $constraint->evaluate($other, $description, true); - - if ($result === $lastResult) { - $success = false; - - break; - } - - $lastResult = $result; - } - - if ($returnResult) { - return $success; - } - - if (!$success) { - $this->fail($other, $description); - } - } - - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - $text = ''; - - foreach ($this->constraints as $key => $constraint) { - if ($key > 0) { - $text .= ' xor '; - } - - $text .= $constraint->toString(); - } - - return $text; - } - - /** - * Counts the number of constraint elements. - */ - public function count(): int - { - $count = 0; - - foreach ($this->constraints as $constraint) { - $count += count($constraint); - } - - return $count; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/ObjectHasAttribute.php b/vendor/phpunit/phpunit/src/Framework/Constraint/ObjectHasAttribute.php deleted file mode 100644 index 8543c22..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/ObjectHasAttribute.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use ReflectionObject; - -/** - * Constraint that asserts that the object it is evaluated for has a given - * attribute. - * - * The attribute name is passed in the constructor. - */ -final class ObjectHasAttribute extends ClassHasAttribute -{ - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - return (new ReflectionObject($other))->hasProperty($this->attributeName()); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/RegularExpression.php b/vendor/phpunit/phpunit/src/Framework/Constraint/RegularExpression.php deleted file mode 100644 index 963bfd0..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/RegularExpression.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function preg_match; -use function sprintf; - -/** - * Constraint that asserts that the string it is evaluated for matches - * a regular expression. - * - * Checks a given value using the Perl Compatible Regular Expression extension - * in PHP. The pattern is matched by executing preg_match(). - * - * The pattern string passed in the constructor. - */ -class RegularExpression extends Constraint -{ - /** - * @var string - */ - private $pattern; - - public function __construct(string $pattern) - { - $this->pattern = $pattern; - } - - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return sprintf( - 'matches PCRE pattern "%s"', - $this->pattern - ); - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - return preg_match($this->pattern, $other) > 0; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/SameSize.php b/vendor/phpunit/phpunit/src/Framework/Constraint/SameSize.php deleted file mode 100644 index c6b8703..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/SameSize.php +++ /dev/null @@ -1,18 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -final class SameSize extends Count -{ - public function __construct(iterable $expected) - { - parent::__construct($this->getCountOf($expected)); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/StringContains.php b/vendor/phpunit/phpunit/src/Framework/Constraint/StringContains.php deleted file mode 100644 index 5460636..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/StringContains.php +++ /dev/null @@ -1,79 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function mb_stripos; -use function mb_strpos; -use function mb_strtolower; -use function sprintf; - -/** - * Constraint that asserts that the string it is evaluated for contains - * a given string. - * - * Uses mb_strpos() to find the position of the string in the input, if not - * found the evaluation fails. - * - * The sub-string is passed in the constructor. - */ -final class StringContains extends Constraint -{ - /** - * @var string - */ - private $string; - - /** - * @var bool - */ - private $ignoreCase; - - public function __construct(string $string, bool $ignoreCase = false) - { - $this->string = $string; - $this->ignoreCase = $ignoreCase; - } - - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - if ($this->ignoreCase) { - $string = mb_strtolower($this->string); - } else { - $string = $this->string; - } - - return sprintf( - 'contains "%s"', - $string - ); - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - if ('' === $this->string) { - return true; - } - - if ($this->ignoreCase) { - return mb_stripos($other, $this->string) !== false; - } - - return mb_strpos($other, $this->string) !== false; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/StringEndsWith.php b/vendor/phpunit/phpunit/src/Framework/Constraint/StringEndsWith.php deleted file mode 100644 index ed11b01..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/StringEndsWith.php +++ /dev/null @@ -1,49 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function strlen; -use function substr; - -/** - * Constraint that asserts that the string it is evaluated for ends with a given - * suffix. - */ -final class StringEndsWith extends Constraint -{ - /** - * @var string - */ - private $suffix; - - public function __construct(string $suffix) - { - $this->suffix = $suffix; - } - - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return 'ends with "' . $this->suffix . '"'; - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - return substr($other, 0 - strlen($this->suffix)) === $this->suffix; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/StringMatchesFormatDescription.php b/vendor/phpunit/phpunit/src/Framework/Constraint/StringMatchesFormatDescription.php deleted file mode 100644 index f2324bb..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/StringMatchesFormatDescription.php +++ /dev/null @@ -1,108 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use const DIRECTORY_SEPARATOR; -use function explode; -use function implode; -use function preg_match; -use function preg_quote; -use function preg_replace; -use function strtr; -use SebastianBergmann\Diff\Differ; - -/** - * ... - */ -final class StringMatchesFormatDescription extends RegularExpression -{ - /** - * @var string - */ - private $string; - - public function __construct(string $string) - { - parent::__construct( - $this->createPatternFromFormat( - $this->convertNewlines($string) - ) - ); - - $this->string = $string; - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - return parent::matches( - $this->convertNewlines($other) - ); - } - - protected function failureDescription($other): string - { - return 'string matches format description'; - } - - protected function additionalFailureDescription($other): string - { - $from = explode("\n", $this->string); - $to = explode("\n", $this->convertNewlines($other)); - - foreach ($from as $index => $line) { - if (isset($to[$index]) && $line !== $to[$index]) { - $line = $this->createPatternFromFormat($line); - - if (preg_match($line, $to[$index]) > 0) { - $from[$index] = $to[$index]; - } - } - } - - $this->string = implode("\n", $from); - $other = implode("\n", $to); - - return (new Differ("--- Expected\n+++ Actual\n"))->diff($this->string, $other); - } - - private function createPatternFromFormat(string $string): string - { - $string = strtr( - preg_quote($string, '/'), - [ - '%%' => '%', - '%e' => '\\' . DIRECTORY_SEPARATOR, - '%s' => '[^\r\n]+', - '%S' => '[^\r\n]*', - '%a' => '.+', - '%A' => '.*', - '%w' => '\s*', - '%i' => '[+-]?\d+', - '%d' => '\d+', - '%x' => '[0-9a-fA-F]+', - '%f' => '[+-]?\.?\d+\.?\d*(?:[Ee][+-]?\d+)?', - '%c' => '.', - ] - ); - - return '/^' . $string . '$/s'; - } - - private function convertNewlines($text): string - { - return preg_replace('/\r\n/', "\n", $text); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/StringStartsWith.php b/vendor/phpunit/phpunit/src/Framework/Constraint/StringStartsWith.php deleted file mode 100644 index a80a3f6..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/StringStartsWith.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function strlen; -use function strpos; -use PHPUnit\Framework\InvalidArgumentException; - -/** - * Constraint that asserts that the string it is evaluated for begins with a - * given prefix. - */ -final class StringStartsWith extends Constraint -{ - /** - * @var string - */ - private $prefix; - - public function __construct(string $prefix) - { - if (strlen($prefix) === 0) { - throw InvalidArgumentException::create(1, 'non-empty string'); - } - - $this->prefix = $prefix; - } - - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return 'starts with "' . $this->prefix . '"'; - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - return strpos((string) $other, $this->prefix) === 0; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/TraversableContains.php b/vendor/phpunit/phpunit/src/Framework/Constraint/TraversableContains.php deleted file mode 100644 index 1cae5a3..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/TraversableContains.php +++ /dev/null @@ -1,120 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function is_array; -use function is_object; -use function is_string; -use function sprintf; -use function strpos; -use SplObjectStorage; - -/** - * Constraint that asserts that the Traversable it is applied to contains - * a given value. - * - * @deprecated Use TraversableContainsEqual or TraversableContainsIdentical instead - */ -final class TraversableContains extends Constraint -{ - /** - * @var bool - */ - private $checkForObjectIdentity; - - /** - * @var bool - */ - private $checkForNonObjectIdentity; - - /** - * @var mixed - */ - private $value; - - public function __construct($value, bool $checkForObjectIdentity = true, bool $checkForNonObjectIdentity = false) - { - $this->checkForObjectIdentity = $checkForObjectIdentity; - $this->checkForNonObjectIdentity = $checkForNonObjectIdentity; - $this->value = $value; - } - - /** - * Returns a string representation of the constraint. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function toString(): string - { - if (is_string($this->value) && strpos($this->value, "\n") !== false) { - return 'contains "' . $this->value . '"'; - } - - return 'contains ' . $this->exporter()->export($this->value); - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - if ($other instanceof SplObjectStorage) { - return $other->contains($this->value); - } - - if (is_object($this->value)) { - foreach ($other as $element) { - if ($this->checkForObjectIdentity && $element === $this->value) { - return true; - } - - /* @noinspection TypeUnsafeComparisonInspection */ - if (!$this->checkForObjectIdentity && $element == $this->value) { - return true; - } - } - } else { - foreach ($other as $element) { - if ($this->checkForNonObjectIdentity && $element === $this->value) { - return true; - } - - /* @noinspection TypeUnsafeComparisonInspection */ - if (!$this->checkForNonObjectIdentity && $element == $this->value) { - return true; - } - } - } - - return false; - } - - /** - * Returns the description of the failure. - * - * The beginning of failure messages is "Failed asserting that" in most - * cases. This method should return the second part of that sentence. - * - * @param mixed $other evaluated value or object - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - protected function failureDescription($other): string - { - return sprintf( - '%s %s', - is_array($other) ? 'an array' : 'a traversable', - $this->toString() - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/TraversableContainsEqual.php b/vendor/phpunit/phpunit/src/Framework/Constraint/TraversableContainsEqual.php deleted file mode 100644 index 1357332..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/TraversableContainsEqual.php +++ /dev/null @@ -1,88 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function is_array; -use function is_string; -use function sprintf; -use function strpos; -use SplObjectStorage; - -/** - * Constraint that asserts that the Traversable it is applied to contains - * a given value (using non-strict comparison). - */ -final class TraversableContainsEqual extends Constraint -{ - /** - * @var mixed - */ - private $value; - - public function __construct($value) - { - $this->value = $value; - } - - /** - * Returns a string representation of the constraint. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function toString(): string - { - if (is_string($this->value) && strpos($this->value, "\n") !== false) { - return 'contains "' . $this->value . '"'; - } - - return 'contains ' . $this->exporter()->export($this->value); - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - if ($other instanceof SplObjectStorage) { - return $other->contains($this->value); - } - - foreach ($other as $element) { - /* @noinspection TypeUnsafeComparisonInspection */ - if ($this->value == $element) { - return true; - } - } - - return false; - } - - /** - * Returns the description of the failure. - * - * The beginning of failure messages is "Failed asserting that" in most - * cases. This method should return the second part of that sentence. - * - * @param mixed $other evaluated value or object - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - protected function failureDescription($other): string - { - return sprintf( - '%s %s', - is_array($other) ? 'an array' : 'a traversable', - $this->toString() - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/TraversableContainsIdentical.php b/vendor/phpunit/phpunit/src/Framework/Constraint/TraversableContainsIdentical.php deleted file mode 100644 index b455629..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/TraversableContainsIdentical.php +++ /dev/null @@ -1,87 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function is_array; -use function is_string; -use function sprintf; -use function strpos; -use SplObjectStorage; - -/** - * Constraint that asserts that the Traversable it is applied to contains - * a given value (using strict comparison). - */ -final class TraversableContainsIdentical extends Constraint -{ - /** - * @var mixed - */ - private $value; - - public function __construct($value) - { - $this->value = $value; - } - - /** - * Returns a string representation of the constraint. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function toString(): string - { - if (is_string($this->value) && strpos($this->value, "\n") !== false) { - return 'contains "' . $this->value . '"'; - } - - return 'contains ' . $this->exporter()->export($this->value); - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - if ($other instanceof SplObjectStorage) { - return $other->contains($this->value); - } - - foreach ($other as $element) { - if ($this->value === $element) { - return true; - } - } - - return false; - } - - /** - * Returns the description of the failure. - * - * The beginning of failure messages is "Failed asserting that" in most - * cases. This method should return the second part of that sentence. - * - * @param mixed $other evaluated value or object - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - protected function failureDescription($other): string - { - return sprintf( - '%s %s', - is_array($other) ? 'an array' : 'a traversable', - $this->toString() - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/TraversableContainsOnly.php b/vendor/phpunit/phpunit/src/Framework/Constraint/TraversableContainsOnly.php deleted file mode 100644 index a78cfcd..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/TraversableContainsOnly.php +++ /dev/null @@ -1,87 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use PHPUnit\Framework\ExpectationFailedException; - -/** - * Constraint that asserts that the Traversable it is applied to contains - * only values of a given type. - */ -final class TraversableContainsOnly extends Constraint -{ - /** - * @var Constraint - */ - private $constraint; - - /** - * @var string - */ - private $type; - - /** - * @throws \PHPUnit\Framework\Exception - */ - public function __construct(string $type, bool $isNativeType = true) - { - if ($isNativeType) { - $this->constraint = new IsType($type); - } else { - $this->constraint = new IsInstanceOf( - $type - ); - } - - $this->type = $type; - } - - /** - * Evaluates the constraint for parameter $other. - * - * If $returnResult is set to false (the default), an exception is thrown - * in case of a failure. null is returned otherwise. - * - * If $returnResult is true, the result of the evaluation is returned as - * a boolean value instead: true in case of success, false in case of a - * failure. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public function evaluate($other, string $description = '', bool $returnResult = false) - { - $success = true; - - foreach ($other as $item) { - if (!$this->constraint->evaluate($item, '', true)) { - $success = false; - - break; - } - } - - if ($returnResult) { - return $success; - } - - if (!$success) { - $this->fail($other, $description); - } - } - - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return 'contains only values of type "' . $this->type . '"'; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/DataProviderTestSuite.php b/vendor/phpunit/phpunit/src/Framework/DataProviderTestSuite.php deleted file mode 100644 index 2769a2d..0000000 --- a/vendor/phpunit/phpunit/src/Framework/DataProviderTestSuite.php +++ /dev/null @@ -1,63 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -use function count; -use function explode; -use PHPUnit\Util\Test as TestUtil; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class DataProviderTestSuite extends TestSuite -{ - /** - * @var string[] - */ - private $dependencies = []; - - /** - * @param string[] $dependencies - */ - public function setDependencies(array $dependencies): void - { - $this->dependencies = $dependencies; - - foreach ($this->tests as $test) { - if (!$test instanceof TestCase) { - continue; - } - - $test->setDependencies($dependencies); - } - } - - public function getDependencies(): array - { - return $this->dependencies; - } - - public function hasDependencies(): bool - { - return count($this->dependencies) > 0; - } - - /** - * Returns the size of the each test created using the data provider(s). - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function getSize(): int - { - [$className, $methodName] = explode('::', $this->getName()); - - return TestUtil::getSize($className, $methodName); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Error/Deprecated.php b/vendor/phpunit/phpunit/src/Framework/Error/Deprecated.php deleted file mode 100644 index 607c965..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Error/Deprecated.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Error; - -final class Deprecated extends Error -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/Error/Error.php b/vendor/phpunit/phpunit/src/Framework/Error/Error.php deleted file mode 100644 index 61e80f8..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Error/Error.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Error; - -use PHPUnit\Framework\Exception; - -class Error extends Exception -{ - public function __construct(string $message, int $code, string $file, int $line, \Exception $previous = null) - { - parent::__construct($message, $code, $previous); - - $this->file = $file; - $this->line = $line; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Error/Notice.php b/vendor/phpunit/phpunit/src/Framework/Error/Notice.php deleted file mode 100644 index 4a3d01d..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Error/Notice.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Error; - -final class Notice extends Error -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/Error/Warning.php b/vendor/phpunit/phpunit/src/Framework/Error/Warning.php deleted file mode 100644 index d49f991..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Error/Warning.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Error; - -final class Warning extends Error -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/AssertionFailedError.php b/vendor/phpunit/phpunit/src/Framework/Exception/AssertionFailedError.php deleted file mode 100644 index 0ba2528..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/AssertionFailedError.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -class AssertionFailedError extends Exception implements SelfDescribing -{ - /** - * Wrapper for getMessage() which is declared as final. - */ - public function toString(): string - { - return $this->getMessage(); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/CodeCoverageException.php b/vendor/phpunit/phpunit/src/Framework/Exception/CodeCoverageException.php deleted file mode 100644 index 36b0723..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/CodeCoverageException.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -class CodeCoverageException extends Exception -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/CoveredCodeNotExecutedException.php b/vendor/phpunit/phpunit/src/Framework/Exception/CoveredCodeNotExecutedException.php deleted file mode 100644 index 78f89bc..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/CoveredCodeNotExecutedException.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class CoveredCodeNotExecutedException extends RiskyTestError -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/Exception.php b/vendor/phpunit/phpunit/src/Framework/Exception/Exception.php deleted file mode 100644 index 0b21e6d..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/Exception.php +++ /dev/null @@ -1,81 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -use function array_keys; -use function get_object_vars; -use PHPUnit\Util\Filter; -use RuntimeException; -use Throwable; - -/** - * Base class for all PHPUnit Framework exceptions. - * - * Ensures that exceptions thrown during a test run do not leave stray - * references behind. - * - * Every Exception contains a stack trace. Each stack frame contains the 'args' - * of the called function. The function arguments can contain references to - * instantiated objects. The references prevent the objects from being - * destructed (until test results are eventually printed), so memory cannot be - * freed up. - * - * With enabled process isolation, test results are serialized in the child - * process and unserialized in the parent process. The stack trace of Exceptions - * may contain objects that cannot be serialized or unserialized (e.g., PDO - * connections). Unserializing user-space objects from the child process into - * the parent would break the intended encapsulation of process isolation. - * - * @see http://fabien.potencier.org/article/9/php-serialization-stack-traces-and-exceptions - * - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -class Exception extends RuntimeException implements \PHPUnit\Exception -{ - /** - * @var array - */ - protected $serializableTrace; - - public function __construct($message = '', $code = 0, Throwable $previous = null) - { - parent::__construct($message, $code, $previous); - - $this->serializableTrace = $this->getTrace(); - - foreach (array_keys($this->serializableTrace) as $key) { - unset($this->serializableTrace[$key]['args']); - } - } - - public function __toString(): string - { - $string = TestFailure::exceptionToString($this); - - if ($trace = Filter::getFilteredStacktrace($this)) { - $string .= "\n" . $trace; - } - - return $string; - } - - public function __sleep(): array - { - return array_keys(get_object_vars($this)); - } - - /** - * Returns the serializable trace (without 'args'). - */ - public function getSerializableTrace(): array - { - return $this->serializableTrace; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/ExpectationFailedException.php b/vendor/phpunit/phpunit/src/Framework/Exception/ExpectationFailedException.php deleted file mode 100644 index b9a595a..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/ExpectationFailedException.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -use Exception; -use SebastianBergmann\Comparator\ComparisonFailure; - -/** - * Exception for expectations which failed their check. - * - * The exception contains the error message and optionally a - * SebastianBergmann\Comparator\ComparisonFailure which is used to - * generate diff output of the failed expectations. - * - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ExpectationFailedException extends AssertionFailedError -{ - /** - * @var ComparisonFailure - */ - protected $comparisonFailure; - - public function __construct(string $message, ComparisonFailure $comparisonFailure = null, Exception $previous = null) - { - $this->comparisonFailure = $comparisonFailure; - - parent::__construct($message, 0, $previous); - } - - public function getComparisonFailure(): ?ComparisonFailure - { - return $this->comparisonFailure; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/IncompleteTestError.php b/vendor/phpunit/phpunit/src/Framework/Exception/IncompleteTestError.php deleted file mode 100644 index 65f9c8b..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/IncompleteTestError.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class IncompleteTestError extends AssertionFailedError implements IncompleteTest -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/InvalidArgumentException.php b/vendor/phpunit/phpunit/src/Framework/Exception/InvalidArgumentException.php deleted file mode 100644 index aec29f4..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -use function debug_backtrace; -use function in_array; -use function lcfirst; -use function sprintf; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class InvalidArgumentException extends Exception -{ - public static function create(int $argument, string $type): self - { - $stack = debug_backtrace(); - - return new self( - sprintf( - 'Argument #%d of %s::%s() must be %s %s', - $argument, - $stack[1]['class'], - $stack[1]['function'], - in_array(lcfirst($type)[0], ['a', 'e', 'i', 'o', 'u'], true) ? 'an' : 'a', - $type - ) - ); - } - - private function __construct(string $message = '', int $code = 0, \Exception $previous = null) - { - parent::__construct($message, $code, $previous); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/InvalidCoversTargetException.php b/vendor/phpunit/phpunit/src/Framework/Exception/InvalidCoversTargetException.php deleted file mode 100644 index ebf2994..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/InvalidCoversTargetException.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class InvalidCoversTargetException extends CodeCoverageException -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/InvalidDataProviderException.php b/vendor/phpunit/phpunit/src/Framework/Exception/InvalidDataProviderException.php deleted file mode 100644 index 7e2ef24..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/InvalidDataProviderException.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class InvalidDataProviderException extends Exception -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/MissingCoversAnnotationException.php b/vendor/phpunit/phpunit/src/Framework/Exception/MissingCoversAnnotationException.php deleted file mode 100644 index 567a6c4..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/MissingCoversAnnotationException.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class MissingCoversAnnotationException extends RiskyTestError -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/NoChildTestSuiteException.php b/vendor/phpunit/phpunit/src/Framework/Exception/NoChildTestSuiteException.php deleted file mode 100644 index 7ef4153..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/NoChildTestSuiteException.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class NoChildTestSuiteException extends Exception -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/OutputError.php b/vendor/phpunit/phpunit/src/Framework/Exception/OutputError.php deleted file mode 100644 index 1c8b37e..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/OutputError.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class OutputError extends AssertionFailedError -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/PHPTAssertionFailedError.php b/vendor/phpunit/phpunit/src/Framework/Exception/PHPTAssertionFailedError.php deleted file mode 100644 index 1712613..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/PHPTAssertionFailedError.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class PHPTAssertionFailedError extends SyntheticError -{ - /** - * @var string - */ - private $diff; - - public function __construct(string $message, int $code, string $file, int $line, array $trace, string $diff) - { - parent::__construct($message, $code, $file, $line, $trace); - $this->diff = $diff; - } - - public function getDiff(): string - { - return $this->diff; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/RiskyTestError.php b/vendor/phpunit/phpunit/src/Framework/Exception/RiskyTestError.php deleted file mode 100644 index a66552c..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/RiskyTestError.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -class RiskyTestError extends AssertionFailedError -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/SkippedTestError.php b/vendor/phpunit/phpunit/src/Framework/Exception/SkippedTestError.php deleted file mode 100644 index 7d553dc..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/SkippedTestError.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class SkippedTestError extends AssertionFailedError implements SkippedTest -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/SkippedTestSuiteError.php b/vendor/phpunit/phpunit/src/Framework/Exception/SkippedTestSuiteError.php deleted file mode 100644 index 5448508..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/SkippedTestSuiteError.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class SkippedTestSuiteError extends AssertionFailedError implements SkippedTest -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/SyntheticError.php b/vendor/phpunit/phpunit/src/Framework/Exception/SyntheticError.php deleted file mode 100644 index c3124ba..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/SyntheticError.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -class SyntheticError extends AssertionFailedError -{ - /** - * The synthetic file. - * - * @var string - */ - protected $syntheticFile = ''; - - /** - * The synthetic line number. - * - * @var int - */ - protected $syntheticLine = 0; - - /** - * The synthetic trace. - * - * @var array - */ - protected $syntheticTrace = []; - - public function __construct(string $message, int $code, string $file, int $line, array $trace) - { - parent::__construct($message, $code); - - $this->syntheticFile = $file; - $this->syntheticLine = $line; - $this->syntheticTrace = $trace; - } - - public function getSyntheticFile(): string - { - return $this->syntheticFile; - } - - public function getSyntheticLine(): int - { - return $this->syntheticLine; - } - - public function getSyntheticTrace(): array - { - return $this->syntheticTrace; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/SyntheticSkippedError.php b/vendor/phpunit/phpunit/src/Framework/Exception/SyntheticSkippedError.php deleted file mode 100644 index f6e155d..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/SyntheticSkippedError.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class SyntheticSkippedError extends SyntheticError implements SkippedTest -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/UnintentionallyCoveredCodeError.php b/vendor/phpunit/phpunit/src/Framework/Exception/UnintentionallyCoveredCodeError.php deleted file mode 100644 index fcd1d82..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/UnintentionallyCoveredCodeError.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class UnintentionallyCoveredCodeError extends RiskyTestError -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/Warning.php b/vendor/phpunit/phpunit/src/Framework/Exception/Warning.php deleted file mode 100644 index 35e9449..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/Warning.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Warning extends Exception implements SelfDescribing -{ - /** - * Wrapper for getMessage() which is declared as final. - */ - public function toString(): string - { - return $this->getMessage(); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/ExceptionWrapper.php b/vendor/phpunit/phpunit/src/Framework/ExceptionWrapper.php deleted file mode 100644 index ec74153..0000000 --- a/vendor/phpunit/phpunit/src/Framework/ExceptionWrapper.php +++ /dev/null @@ -1,120 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -use function array_keys; -use function get_class; -use function spl_object_hash; -use PHPUnit\Util\Filter; -use Throwable; - -/** - * Wraps Exceptions thrown by code under test. - * - * Re-instantiates Exceptions thrown by user-space code to retain their original - * class names, properties, and stack traces (but without arguments). - * - * Unlike PHPUnit\Framework_\Exception, the complete stack of previous Exceptions - * is processed. - * - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ExceptionWrapper extends Exception -{ - /** - * @var string - */ - protected $className; - - /** - * @var null|ExceptionWrapper - */ - protected $previous; - - public function __construct(Throwable $t) - { - // PDOException::getCode() is a string. - // @see https://php.net/manual/en/class.pdoexception.php#95812 - parent::__construct($t->getMessage(), (int) $t->getCode()); - $this->setOriginalException($t); - } - - public function __toString(): string - { - $string = TestFailure::exceptionToString($this); - - if ($trace = Filter::getFilteredStacktrace($this)) { - $string .= "\n" . $trace; - } - - if ($this->previous) { - $string .= "\nCaused by\n" . $this->previous; - } - - return $string; - } - - public function getClassName(): string - { - return $this->className; - } - - public function getPreviousWrapped(): ?self - { - return $this->previous; - } - - public function setClassName(string $className): void - { - $this->className = $className; - } - - public function setOriginalException(Throwable $t): void - { - $this->originalException($t); - - $this->className = get_class($t); - $this->file = $t->getFile(); - $this->line = $t->getLine(); - - $this->serializableTrace = $t->getTrace(); - - foreach (array_keys($this->serializableTrace) as $key) { - unset($this->serializableTrace[$key]['args']); - } - - if ($t->getPrevious()) { - $this->previous = new self($t->getPrevious()); - } - } - - public function getOriginalException(): ?Throwable - { - return $this->originalException(); - } - - /** - * Method to contain static originalException to exclude it from stacktrace to prevent the stacktrace contents, - * which can be quite big, from being garbage-collected, thus blocking memory until shutdown. - * Approach works both for var_dump() and var_export() and print_r(). - */ - private function originalException(Throwable $exceptionToStore = null): ?Throwable - { - static $originalExceptions; - - $instanceId = spl_object_hash($this); - - if ($exceptionToStore) { - $originalExceptions[$instanceId] = $exceptionToStore; - } - - return $originalExceptions[$instanceId] ?? null; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/IncompleteTest.php b/vendor/phpunit/phpunit/src/Framework/IncompleteTest.php deleted file mode 100644 index 268957c..0000000 --- a/vendor/phpunit/phpunit/src/Framework/IncompleteTest.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -interface IncompleteTest -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/IncompleteTestCase.php b/vendor/phpunit/phpunit/src/Framework/IncompleteTestCase.php deleted file mode 100644 index ee1e3e9..0000000 --- a/vendor/phpunit/phpunit/src/Framework/IncompleteTestCase.php +++ /dev/null @@ -1,66 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class IncompleteTestCase extends TestCase -{ - /** - * @var bool - */ - protected $backupGlobals = false; - - /** - * @var bool - */ - protected $backupStaticAttributes = false; - - /** - * @var bool - */ - protected $runTestInSeparateProcess = false; - - /** - * @var string - */ - private $message; - - public function __construct(string $className, string $methodName, string $message = '') - { - parent::__construct($className . '::' . $methodName); - - $this->message = $message; - } - - public function getMessage(): string - { - return $this->message; - } - - /** - * Returns a string representation of the test case. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function toString(): string - { - return $this->getName(); - } - - /** - * @throws Exception - */ - protected function runTest(): void - { - $this->markTestIncomplete($this->message); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/InvalidParameterGroupException.php b/vendor/phpunit/phpunit/src/Framework/InvalidParameterGroupException.php deleted file mode 100644 index feb9cc9..0000000 --- a/vendor/phpunit/phpunit/src/Framework/InvalidParameterGroupException.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class InvalidParameterGroupException extends Exception -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Api/Api.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Api/Api.php deleted file mode 100644 index e2f0a28..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Api/Api.php +++ /dev/null @@ -1,97 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use PHPUnit\Framework\MockObject\Builder\InvocationMocker as InvocationMockerBuilder; -use PHPUnit\Framework\MockObject\Rule\InvocationOrder; - -/** - * @internal This trait is not covered by the backward compatibility promise for PHPUnit - */ -trait Api -{ - /** - * @var ConfigurableMethod[] - */ - private static $__phpunit_configurableMethods; - - /** - * @var object - */ - private $__phpunit_originalObject; - - /** - * @var bool - */ - private $__phpunit_returnValueGeneration = true; - - /** - * @var InvocationHandler - */ - private $__phpunit_invocationMocker; - - /** @noinspection MagicMethodsValidityInspection */ - public static function __phpunit_initConfigurableMethods(ConfigurableMethod ...$configurableMethods): void - { - if (isset(static::$__phpunit_configurableMethods)) { - throw new ConfigurableMethodsAlreadyInitializedException( - 'Configurable methods is already initialized and can not be reinitialized' - ); - } - - static::$__phpunit_configurableMethods = $configurableMethods; - } - - /** @noinspection MagicMethodsValidityInspection */ - public function __phpunit_setOriginalObject($originalObject): void - { - $this->__phpunit_originalObject = $originalObject; - } - - /** @noinspection MagicMethodsValidityInspection */ - public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration): void - { - $this->__phpunit_returnValueGeneration = $returnValueGeneration; - } - - /** @noinspection MagicMethodsValidityInspection */ - public function __phpunit_getInvocationHandler(): InvocationHandler - { - if ($this->__phpunit_invocationMocker === null) { - $this->__phpunit_invocationMocker = new InvocationHandler( - static::$__phpunit_configurableMethods, - $this->__phpunit_returnValueGeneration - ); - } - - return $this->__phpunit_invocationMocker; - } - - /** @noinspection MagicMethodsValidityInspection */ - public function __phpunit_hasMatchers(): bool - { - return $this->__phpunit_getInvocationHandler()->hasMatchers(); - } - - /** @noinspection MagicMethodsValidityInspection */ - public function __phpunit_verify(bool $unsetInvocationMocker = true): void - { - $this->__phpunit_getInvocationHandler()->verify(); - - if ($unsetInvocationMocker) { - $this->__phpunit_invocationMocker = null; - } - } - - public function expects(InvocationOrder $matcher): InvocationMockerBuilder - { - return $this->__phpunit_getInvocationHandler()->expects($matcher); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Api/Method.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Api/Method.php deleted file mode 100644 index f6df753..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Api/Method.php +++ /dev/null @@ -1,30 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use function call_user_func_array; -use function func_get_args; -use PHPUnit\Framework\MockObject\Rule\AnyInvokedCount; - -/** - * @internal This trait is not covered by the backward compatibility promise for PHPUnit - */ -trait Method -{ - public function method() - { - $expects = $this->expects(new AnyInvokedCount); - - return call_user_func_array( - [$expects, 'method'], - func_get_args() - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Api/MockedCloneMethod.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Api/MockedCloneMethod.php deleted file mode 100644 index 91e35f9..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Api/MockedCloneMethod.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -/** - * @internal This trait is not covered by the backward compatibility promise for PHPUnit - */ -trait MockedCloneMethod -{ - public function __clone() - { - $this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationHandler(); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Api/UnmockedCloneMethod.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Api/UnmockedCloneMethod.php deleted file mode 100644 index 3f493d2..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Api/UnmockedCloneMethod.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -/** - * @internal This trait is not covered by the backward compatibility promise for PHPUnit - */ -trait UnmockedCloneMethod -{ - public function __clone() - { - $this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationHandler(); - - parent::__clone(); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/Identity.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/Identity.php deleted file mode 100644 index a68bfad..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/Identity.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Builder; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -interface Identity -{ - /** - * Sets the identification of the expectation to $id. - * - * @note The identifier is unique per mock object. - * - * @param string $id unique identification of expectation - */ - public function id($id); -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationMocker.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationMocker.php deleted file mode 100644 index 974ca87..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationMocker.php +++ /dev/null @@ -1,300 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Builder; - -use function array_map; -use function array_merge; -use function count; -use function get_class; -use function gettype; -use function in_array; -use function is_object; -use function is_string; -use function sprintf; -use function strtolower; -use PHPUnit\Framework\Constraint\Constraint; -use PHPUnit\Framework\MockObject\ConfigurableMethod; -use PHPUnit\Framework\MockObject\IncompatibleReturnValueException; -use PHPUnit\Framework\MockObject\InvocationHandler; -use PHPUnit\Framework\MockObject\Matcher; -use PHPUnit\Framework\MockObject\Rule; -use PHPUnit\Framework\MockObject\RuntimeException; -use PHPUnit\Framework\MockObject\Stub\ConsecutiveCalls; -use PHPUnit\Framework\MockObject\Stub\Exception; -use PHPUnit\Framework\MockObject\Stub\ReturnArgument; -use PHPUnit\Framework\MockObject\Stub\ReturnCallback; -use PHPUnit\Framework\MockObject\Stub\ReturnReference; -use PHPUnit\Framework\MockObject\Stub\ReturnSelf; -use PHPUnit\Framework\MockObject\Stub\ReturnStub; -use PHPUnit\Framework\MockObject\Stub\ReturnValueMap; -use PHPUnit\Framework\MockObject\Stub\Stub; -use Throwable; - -final class InvocationMocker implements InvocationStubber, MethodNameMatch -{ - /** - * @var InvocationHandler - */ - private $invocationHandler; - - /** - * @var Matcher - */ - private $matcher; - - /** - * @var ConfigurableMethod[] - */ - private $configurableMethods; - - public function __construct(InvocationHandler $handler, Matcher $matcher, ConfigurableMethod ...$configurableMethods) - { - $this->invocationHandler = $handler; - $this->matcher = $matcher; - $this->configurableMethods = $configurableMethods; - } - - /** - * @return $this - */ - public function id($id): self - { - $this->invocationHandler->registerMatcher($id, $this->matcher); - - return $this; - } - - /** - * @return $this - */ - public function will(Stub $stub): Identity - { - $this->matcher->setStub($stub); - - return $this; - } - - public function willReturn($value, ...$nextValues): self - { - if (count($nextValues) === 0) { - $this->ensureTypeOfReturnValues([$value]); - - $stub = $value instanceof Stub ? $value : new ReturnStub($value); - } else { - $values = array_merge([$value], $nextValues); - - $this->ensureTypeOfReturnValues($values); - - $stub = new ConsecutiveCalls($values); - } - - return $this->will($stub); - } - - public function willReturnReference(&$reference): self - { - $stub = new ReturnReference($reference); - - return $this->will($stub); - } - - public function willReturnMap(array $valueMap): self - { - $stub = new ReturnValueMap($valueMap); - - return $this->will($stub); - } - - public function willReturnArgument($argumentIndex): self - { - $stub = new ReturnArgument($argumentIndex); - - return $this->will($stub); - } - - public function willReturnCallback($callback): self - { - $stub = new ReturnCallback($callback); - - return $this->will($stub); - } - - public function willReturnSelf(): self - { - $stub = new ReturnSelf; - - return $this->will($stub); - } - - public function willReturnOnConsecutiveCalls(...$values): self - { - $stub = new ConsecutiveCalls($values); - - return $this->will($stub); - } - - public function willThrowException(Throwable $exception): self - { - $stub = new Exception($exception); - - return $this->will($stub); - } - - /** - * @return $this - */ - public function after($id): self - { - $this->matcher->setAfterMatchBuilderId($id); - - return $this; - } - - /** - * @throws RuntimeException - * - * @return $this - */ - public function with(...$arguments): self - { - $this->canDefineParameters(); - - $this->matcher->setParametersRule(new Rule\Parameters($arguments)); - - return $this; - } - - /** - * @param array ...$arguments - * - * @throws RuntimeException - * - * @return $this - */ - public function withConsecutive(...$arguments): self - { - $this->canDefineParameters(); - - $this->matcher->setParametersRule(new Rule\ConsecutiveParameters($arguments)); - - return $this; - } - - /** - * @throws RuntimeException - * - * @return $this - */ - public function withAnyParameters(): self - { - $this->canDefineParameters(); - - $this->matcher->setParametersRule(new Rule\AnyParameters); - - return $this; - } - - /** - * @param Constraint|string $constraint - * - * @throws RuntimeException - * - * @return $this - */ - public function method($constraint): self - { - if ($this->matcher->hasMethodNameRule()) { - throw new RuntimeException( - 'Rule for method name is already defined, cannot redefine' - ); - } - - $configurableMethodNames = array_map( - static function (ConfigurableMethod $configurable) - { - return strtolower($configurable->getName()); - }, - $this->configurableMethods - ); - - if (is_string($constraint) && !in_array(strtolower($constraint), $configurableMethodNames, true)) { - throw new RuntimeException( - sprintf( - 'Trying to configure method "%s" which cannot be configured because it does not exist, has not been specified, is final, or is static', - $constraint - ) - ); - } - - $this->matcher->setMethodNameRule(new Rule\MethodName($constraint)); - - return $this; - } - - /** - * Validate that a parameters rule can be defined, throw exceptions otherwise. - * - * @throws RuntimeException - */ - private function canDefineParameters(): void - { - if (!$this->matcher->hasMethodNameRule()) { - throw new RuntimeException( - 'Rule for method name is not defined, cannot define rule for parameters ' . - 'without one' - ); - } - - if ($this->matcher->hasParametersRule()) { - throw new RuntimeException( - 'Rule for parameters is already defined, cannot redefine' - ); - } - } - - private function getConfiguredMethod(): ?ConfigurableMethod - { - $configuredMethod = null; - - foreach ($this->configurableMethods as $configurableMethod) { - if ($this->matcher->getMethodNameRule()->matchesName($configurableMethod->getName())) { - if ($configuredMethod !== null) { - return null; - } - - $configuredMethod = $configurableMethod; - } - } - - return $configuredMethod; - } - - private function ensureTypeOfReturnValues(array $values): void - { - $configuredMethod = $this->getConfiguredMethod(); - - if ($configuredMethod === null) { - return; - } - - foreach ($values as $value) { - if (!$configuredMethod->mayReturn($value)) { - throw new IncompatibleReturnValueException( - sprintf( - 'Method %s may not return value of type %s, its return declaration is "%s"', - $configuredMethod->getName(), - is_object($value) ? get_class($value) : gettype($value), - $configuredMethod->getReturnTypeDeclaration() - ) - ); - } - } - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationStubber.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationStubber.php deleted file mode 100644 index c0e51b0..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationStubber.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Builder; - -use PHPUnit\Framework\MockObject\Stub\Stub; -use Throwable; - -interface InvocationStubber -{ - public function will(Stub $stub): Identity; - - /** @return self */ - public function willReturn($value, ...$nextValues)/*: self */; - - /** - * @param mixed $reference - * - * @return self - */ - public function willReturnReference(&$reference)/*: self */; - - /** - * @param array> $valueMap - * - * @return self - */ - public function willReturnMap(array $valueMap)/*: self */; - - /** - * @param int $argumentIndex - * - * @return self - */ - public function willReturnArgument($argumentIndex)/*: self */; - - /** - * @param callable $callback - * - * @return self - */ - public function willReturnCallback($callback)/*: self */; - - /** @return self */ - public function willReturnSelf()/*: self */; - - /** - * @param mixed $values - * - * @return self - */ - public function willReturnOnConsecutiveCalls(...$values)/*: self */; - - /** @return self */ - public function willThrowException(Throwable $exception)/*: self */; -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/Match_.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/Match_.php deleted file mode 100644 index 6cec73a..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/Match_.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Builder; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -interface Match_ extends Stub -{ - /** - * Defines the expectation which must occur before the current is valid. - * - * @param string $id the identification of the expectation that should - * occur before this one - * - * @return Stub - */ - public function after($id); -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/MethodNameMatch.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/MethodNameMatch.php deleted file mode 100644 index 543d596..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/MethodNameMatch.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Builder; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -interface MethodNameMatch extends ParametersMatch -{ - /** - * Adds a new method name match and returns the parameter match object for - * further matching possibilities. - * - * @param \PHPUnit\Framework\Constraint\Constraint $constraint Constraint for matching method, if a string is passed it will use the PHPUnit_Framework_Constraint_IsEqual - * - * @return ParametersMatch - */ - public function method($constraint); -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/ParametersMatch.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/ParametersMatch.php deleted file mode 100644 index 6f5fecd..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/ParametersMatch.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Builder; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -interface ParametersMatch extends Match_ -{ - /** - * Sets the parameters to match for, each parameter to this function will - * be part of match. To perform specific matches or constraints create a - * new PHPUnit\Framework\Constraint\Constraint and use it for the parameter. - * If the parameter value is not a constraint it will use the - * PHPUnit\Framework\Constraint\IsEqual for the value. - * - * Some examples: - * - * // match first parameter with value 2 - * $b->with(2); - * // match first parameter with value 'smock' and second identical to 42 - * $b->with('smock', new PHPUnit\Framework\Constraint\IsEqual(42)); - * - * - * @return ParametersMatch - */ - public function with(...$arguments); - - /** - * Sets a rule which allows any kind of parameters. - * - * Some examples: - * - * // match any number of parameters - * $b->withAnyParameters(); - * - * - * @return ParametersMatch - */ - public function withAnyParameters(); -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/Stub.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/Stub.php deleted file mode 100644 index d7cb78f..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/Stub.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Builder; - -use PHPUnit\Framework\MockObject\Stub\Stub as BaseStub; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -interface Stub extends Identity -{ - /** - * Stubs the matching method with the stub object $stub. Any invocations of - * the matched method will now be handled by the stub instead. - */ - public function will(BaseStub $stub): Identity; -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/ConfigurableMethod.php b/vendor/phpunit/phpunit/src/Framework/MockObject/ConfigurableMethod.php deleted file mode 100644 index f65983d..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/ConfigurableMethod.php +++ /dev/null @@ -1,53 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use SebastianBergmann\Type\Type; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ConfigurableMethod -{ - /** - * @var string - */ - private $name; - - /** - * @var Type - */ - private $returnType; - - public function __construct(string $name, Type $returnType) - { - $this->name = $name; - $this->returnType = $returnType; - } - - public function getName(): string - { - return $this->name; - } - - public function mayReturn($value): bool - { - if ($value === null && $this->returnType->allowsNull()) { - return true; - } - - return $this->returnType->isAssignable(Type::fromValue($value, false)); - } - - public function getReturnTypeDeclaration(): string - { - return $this->returnType->getReturnTypeDeclaration(); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/BadMethodCallException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/BadMethodCallException.php deleted file mode 100644 index 7e655e2..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/BadMethodCallException.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class BadMethodCallException extends \BadMethodCallException implements Exception -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ConfigurableMethodsAlreadyInitializedException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ConfigurableMethodsAlreadyInitializedException.php deleted file mode 100644 index d12ac99..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ConfigurableMethodsAlreadyInitializedException.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ConfigurableMethodsAlreadyInitializedException extends \PHPUnit\Framework\Exception implements Exception -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/Exception.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/Exception.php deleted file mode 100644 index 5880bc0..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/Exception.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use Throwable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -interface Exception extends Throwable -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/IncompatibleReturnValueException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/IncompatibleReturnValueException.php deleted file mode 100644 index f1ceb1d..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/IncompatibleReturnValueException.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class IncompatibleReturnValueException extends \PHPUnit\Framework\Exception implements Exception -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/RuntimeException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/RuntimeException.php deleted file mode 100644 index 33b6a5b..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/RuntimeException.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class RuntimeException extends \RuntimeException implements Exception -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Generator.php deleted file mode 100644 index 9ece81e..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator.php +++ /dev/null @@ -1,1102 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use const DIRECTORY_SEPARATOR; -use const PHP_EOL; -use const PHP_MAJOR_VERSION; -use const PREG_OFFSET_CAPTURE; -use const WSDL_CACHE_NONE; -use function array_diff_assoc; -use function array_map; -use function array_merge; -use function array_pop; -use function array_unique; -use function class_exists; -use function count; -use function explode; -use function extension_loaded; -use function implode; -use function in_array; -use function interface_exists; -use function is_array; -use function is_object; -use function is_string; -use function md5; -use function mt_rand; -use function preg_match; -use function preg_match_all; -use function range; -use function serialize; -use function sort; -use function sprintf; -use function str_replace; -use function strlen; -use function strpos; -use function strtolower; -use function substr; -use function trait_exists; -use Doctrine\Instantiator\Exception\ExceptionInterface as InstantiatorException; -use Doctrine\Instantiator\Instantiator; -use Exception; -use Iterator; -use IteratorAggregate; -use PHPUnit\Framework\InvalidArgumentException; -use ReflectionClass; -use ReflectionException; -use ReflectionMethod; -use SoapClient; -use SoapFault; -use Text_Template; -use Throwable; -use Traversable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Generator -{ - /** - * @var array - */ - private const BLACKLISTED_METHOD_NAMES = [ - '__CLASS__' => true, - '__DIR__' => true, - '__FILE__' => true, - '__FUNCTION__' => true, - '__LINE__' => true, - '__METHOD__' => true, - '__NAMESPACE__' => true, - '__TRAIT__' => true, - '__clone' => true, - '__halt_compiler' => true, - ]; - - /** - * @var array - */ - private static $cache = []; - - /** - * @var Text_Template[] - */ - private static $templates = []; - - /** - * Returns a mock object for the specified class. - * - * @param string|string[] $type - * @param null|array $methods - * - * @throws RuntimeException - */ - public function getMock($type, $methods = [], array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true, bool $cloneArguments = true, bool $callOriginalMethods = false, object $proxyTarget = null, bool $allowMockingUnknownTypes = true, bool $returnValueGeneration = true): MockObject - { - if (!is_array($type) && !is_string($type)) { - throw InvalidArgumentException::create(1, 'array or string'); - } - - if (!is_array($methods) && null !== $methods) { - throw InvalidArgumentException::create(2, 'array'); - } - - if ($type === 'Traversable' || $type === '\\Traversable') { - $type = 'Iterator'; - } - - if (is_array($type)) { - $type = array_unique( - array_map( - static function ($type) - { - if ($type === 'Traversable' || - $type === '\\Traversable' || - $type === '\\Iterator') { - return 'Iterator'; - } - - return $type; - }, - $type - ) - ); - } - - if (!$allowMockingUnknownTypes) { - if (is_array($type)) { - foreach ($type as $_type) { - if (!class_exists($_type, $callAutoload) && - !interface_exists($_type, $callAutoload)) { - throw new RuntimeException( - sprintf( - 'Cannot stub or mock class or interface "%s" which does not exist', - $_type - ) - ); - } - } - } elseif (!class_exists($type, $callAutoload) && !interface_exists($type, $callAutoload)) { - throw new RuntimeException( - sprintf( - 'Cannot stub or mock class or interface "%s" which does not exist', - $type - ) - ); - } - } - - if (null !== $methods) { - foreach ($methods as $method) { - if (!preg_match('~[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*~', (string) $method)) { - throw new RuntimeException( - sprintf( - 'Cannot stub or mock method with invalid name "%s"', - $method - ) - ); - } - } - - if ($methods !== array_unique($methods)) { - throw new RuntimeException( - sprintf( - 'Cannot stub or mock using a method list that contains duplicates: "%s" (duplicate: "%s")', - implode(', ', $methods), - implode(', ', array_unique(array_diff_assoc($methods, array_unique($methods)))) - ) - ); - } - } - - if ($mockClassName !== '' && class_exists($mockClassName, false)) { - try { - $reflector = new ReflectionClass($mockClassName); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new RuntimeException( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - if (!$reflector->implementsInterface(MockObject::class)) { - throw new RuntimeException( - sprintf( - 'Class "%s" already exists.', - $mockClassName - ) - ); - } - } - - if (!$callOriginalConstructor && $callOriginalMethods) { - throw new RuntimeException( - 'Proxying to original methods requires invoking the original constructor' - ); - } - - $mock = $this->generate( - $type, - $methods, - $mockClassName, - $callOriginalClone, - $callAutoload, - $cloneArguments, - $callOriginalMethods - ); - - return $this->getObject( - $mock, - $type, - $callOriginalConstructor, - $callAutoload, - $arguments, - $callOriginalMethods, - $proxyTarget, - $returnValueGeneration - ); - } - - /** - * Returns a mock object for the specified abstract class with all abstract - * methods of the class mocked. Concrete methods to mock can be specified with - * the $mockedMethods parameter. - * - * @psalm-template RealInstanceType of object - * @psalm-param class-string $originalClassName - * @psalm-return MockObject&RealInstanceType - * - * @throws RuntimeException - */ - public function getMockForAbstractClass(string $originalClassName, array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true, array $mockedMethods = null, bool $cloneArguments = true): MockObject - { - if (class_exists($originalClassName, $callAutoload) || - interface_exists($originalClassName, $callAutoload)) { - try { - $reflector = new ReflectionClass($originalClassName); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new RuntimeException( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - $methods = $mockedMethods; - - foreach ($reflector->getMethods() as $method) { - if ($method->isAbstract() && !in_array($method->getName(), $methods ?? [], true)) { - $methods[] = $method->getName(); - } - } - - if (empty($methods)) { - $methods = null; - } - - return $this->getMock( - $originalClassName, - $methods, - $arguments, - $mockClassName, - $callOriginalConstructor, - $callOriginalClone, - $callAutoload, - $cloneArguments - ); - } - - throw new RuntimeException( - sprintf('Class "%s" does not exist.', $originalClassName) - ); - } - - /** - * Returns a mock object for the specified trait with all abstract methods - * of the trait mocked. Concrete methods to mock can be specified with the - * `$mockedMethods` parameter. - * - * @throws RuntimeException - */ - public function getMockForTrait(string $traitName, array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true, array $mockedMethods = null, bool $cloneArguments = true): MockObject - { - if (!trait_exists($traitName, $callAutoload)) { - throw new RuntimeException( - sprintf( - 'Trait "%s" does not exist.', - $traitName - ) - ); - } - - $className = $this->generateClassName( - $traitName, - '', - 'Trait_' - ); - - $classTemplate = $this->getTemplate('trait_class.tpl'); - - $classTemplate->setVar( - [ - 'prologue' => 'abstract ', - 'class_name' => $className['className'], - 'trait_name' => $traitName, - ] - ); - - $mockTrait = new MockTrait($classTemplate->render(), $className['className']); - $mockTrait->generate(); - - return $this->getMockForAbstractClass($className['className'], $arguments, $mockClassName, $callOriginalConstructor, $callOriginalClone, $callAutoload, $mockedMethods, $cloneArguments); - } - - /** - * Returns an object for the specified trait. - * - * @throws RuntimeException - */ - public function getObjectForTrait(string $traitName, string $traitClassName = '', bool $callAutoload = true, bool $callOriginalConstructor = false, array $arguments = []): object - { - if (!trait_exists($traitName, $callAutoload)) { - throw new RuntimeException( - sprintf( - 'Trait "%s" does not exist.', - $traitName - ) - ); - } - - $className = $this->generateClassName( - $traitName, - $traitClassName, - 'Trait_' - ); - - $classTemplate = $this->getTemplate('trait_class.tpl'); - - $classTemplate->setVar( - [ - 'prologue' => '', - 'class_name' => $className['className'], - 'trait_name' => $traitName, - ] - ); - - return $this->getObject( - new MockTrait( - $classTemplate->render(), - $className['className'] - ), - '', - $callOriginalConstructor, - $callAutoload, - $arguments - ); - } - - public function generate($type, array $methods = null, string $mockClassName = '', bool $callOriginalClone = true, bool $callAutoload = true, bool $cloneArguments = true, bool $callOriginalMethods = false): MockClass - { - if (is_array($type)) { - sort($type); - } - - if ($mockClassName !== '') { - return $this->generateMock( - $type, - $methods, - $mockClassName, - $callOriginalClone, - $callAutoload, - $cloneArguments, - $callOriginalMethods - ); - } - - $key = md5( - is_array($type) ? implode('_', $type) : $type . - serialize($methods) . - serialize($callOriginalClone) . - serialize($cloneArguments) . - serialize($callOriginalMethods) - ); - - if (!isset(self::$cache[$key])) { - self::$cache[$key] = $this->generateMock( - $type, - $methods, - $mockClassName, - $callOriginalClone, - $callAutoload, - $cloneArguments, - $callOriginalMethods - ); - } - - return self::$cache[$key]; - } - - /** - * @throws RuntimeException - */ - public function generateClassFromWsdl(string $wsdlFile, string $className, array $methods = [], array $options = []): string - { - if (!extension_loaded('soap')) { - throw new RuntimeException( - 'The SOAP extension is required to generate a mock object from WSDL.' - ); - } - - $options = array_merge($options, ['cache_wsdl' => WSDL_CACHE_NONE]); - - try { - $client = new SoapClient($wsdlFile, $options); - $_methods = array_unique($client->__getFunctions()); - unset($client); - } catch (SoapFault $e) { - throw new RuntimeException( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - - sort($_methods); - - $methodTemplate = $this->getTemplate('wsdl_method.tpl'); - $methodsBuffer = ''; - - foreach ($_methods as $method) { - preg_match_all('/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*\(/', $method, $matches, PREG_OFFSET_CAPTURE); - $lastFunction = array_pop($matches[0]); - $nameStart = $lastFunction[1]; - $nameEnd = $nameStart + strlen($lastFunction[0]) - 1; - $name = str_replace('(', '', $lastFunction[0]); - - if (empty($methods) || in_array($name, $methods, true)) { - $args = explode( - ',', - str_replace(')', '', substr($method, $nameEnd + 1)) - ); - - foreach (range(0, count($args) - 1) as $i) { - $parameterStart = strpos($args[$i], '$'); - - if (!$parameterStart) { - continue; - } - - $args[$i] = substr($args[$i], $parameterStart); - } - - $methodTemplate->setVar( - [ - 'method_name' => $name, - 'arguments' => implode(', ', $args), - ] - ); - - $methodsBuffer .= $methodTemplate->render(); - } - } - - $optionsBuffer = '['; - - foreach ($options as $key => $value) { - $optionsBuffer .= $key . ' => ' . $value; - } - - $optionsBuffer .= ']'; - - $classTemplate = $this->getTemplate('wsdl_class.tpl'); - $namespace = ''; - - if (strpos($className, '\\') !== false) { - $parts = explode('\\', $className); - $className = array_pop($parts); - $namespace = 'namespace ' . implode('\\', $parts) . ';' . "\n\n"; - } - - $classTemplate->setVar( - [ - 'namespace' => $namespace, - 'class_name' => $className, - 'wsdl' => $wsdlFile, - 'options' => $optionsBuffer, - 'methods' => $methodsBuffer, - ] - ); - - return $classTemplate->render(); - } - - /** - * @throws RuntimeException - * - * @return string[] - */ - public function getClassMethods(string $className): array - { - try { - $class = new ReflectionClass($className); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new RuntimeException( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - $methods = []; - - foreach ($class->getMethods() as $method) { - if ($method->isPublic() || $method->isAbstract()) { - $methods[] = $method->getName(); - } - } - - return $methods; - } - - /** - * @throws RuntimeException - * - * @return MockMethod[] - */ - public function mockClassMethods(string $className, bool $callOriginalMethods, bool $cloneArguments): array - { - try { - $class = new ReflectionClass($className); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new RuntimeException( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - $methods = []; - - foreach ($class->getMethods() as $method) { - if (($method->isPublic() || $method->isAbstract()) && $this->canMockMethod($method)) { - $methods[] = MockMethod::fromReflection($method, $callOriginalMethods, $cloneArguments); - } - } - - return $methods; - } - - /** - * @throws RuntimeException - * - * @return MockMethod[] - */ - public function mockInterfaceMethods(string $interfaceName, bool $cloneArguments): array - { - try { - $class = new ReflectionClass($interfaceName); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new RuntimeException( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - $methods = []; - - foreach ($class->getMethods() as $method) { - $methods[] = MockMethod::fromReflection($method, false, $cloneArguments); - } - - return $methods; - } - - /** - * @psalm-param class-string $interfaceName - * - * @return ReflectionMethod[] - */ - private function userDefinedInterfaceMethods(string $interfaceName): array - { - try { - // @codeCoverageIgnoreStart - $interface = new ReflectionClass($interfaceName); - } catch (ReflectionException $e) { - throw new RuntimeException( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - $methods = []; - - foreach ($interface->getMethods() as $method) { - if (!$method->isUserDefined()) { - continue; - } - - $methods[] = $method; - } - - return $methods; - } - - private function getObject(MockType $mockClass, $type = '', bool $callOriginalConstructor = false, bool $callAutoload = false, array $arguments = [], bool $callOriginalMethods = false, object $proxyTarget = null, bool $returnValueGeneration = true) - { - $className = $mockClass->generate(); - - if ($callOriginalConstructor) { - if (count($arguments) === 0) { - $object = new $className; - } else { - try { - $class = new ReflectionClass($className); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new RuntimeException( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - $object = $class->newInstanceArgs($arguments); - } - } else { - try { - $object = (new Instantiator)->instantiate($className); - } catch (InstantiatorException $exception) { - throw new RuntimeException($exception->getMessage()); - } - } - - if ($callOriginalMethods) { - if (!is_object($proxyTarget)) { - if (count($arguments) === 0) { - $proxyTarget = new $type; - } else { - try { - $class = new ReflectionClass($type); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new RuntimeException( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - $proxyTarget = $class->newInstanceArgs($arguments); - } - } - - $object->__phpunit_setOriginalObject($proxyTarget); - } - - if ($object instanceof MockObject) { - $object->__phpunit_setReturnValueGeneration($returnValueGeneration); - } - - return $object; - } - - /** - * @param array|string $type - * - * @throws RuntimeException - */ - private function generateMock($type, ?array $explicitMethods, string $mockClassName, bool $callOriginalClone, bool $callAutoload, bool $cloneArguments, bool $callOriginalMethods): MockClass - { - $classTemplate = $this->getTemplate('mocked_class.tpl'); - $additionalInterfaces = []; - $mockedCloneMethod = false; - $unmockedCloneMethod = false; - $isClass = false; - $isInterface = false; - $class = null; - $mockMethods = new MockMethodSet; - - if (is_array($type)) { - $interfaceMethods = []; - - foreach ($type as $_type) { - if (!interface_exists($_type, $callAutoload)) { - throw new RuntimeException( - sprintf( - 'Interface "%s" does not exist.', - $_type - ) - ); - } - - $additionalInterfaces[] = $_type; - - try { - $typeClass = new ReflectionClass($_type); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new RuntimeException( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - foreach ($this->getClassMethods($_type) as $method) { - if (in_array($method, $interfaceMethods, true)) { - throw new RuntimeException( - sprintf( - 'Duplicate method "%s" not allowed.', - $method - ) - ); - } - - try { - $methodReflection = $typeClass->getMethod($method); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new RuntimeException( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - if ($this->canMockMethod($methodReflection)) { - $mockMethods->addMethods( - MockMethod::fromReflection($methodReflection, $callOriginalMethods, $cloneArguments) - ); - - $interfaceMethods[] = $method; - } - } - } - - unset($interfaceMethods); - } - - $mockClassName = $this->generateClassName( - $type, - $mockClassName, - 'Mock_' - ); - - if (class_exists($mockClassName['fullClassName'], $callAutoload)) { - $isClass = true; - } elseif (interface_exists($mockClassName['fullClassName'], $callAutoload)) { - $isInterface = true; - } - - if (!$isClass && !$isInterface) { - $prologue = 'class ' . $mockClassName['originalClassName'] . "\n{\n}\n\n"; - - if (!empty($mockClassName['namespaceName'])) { - $prologue = 'namespace ' . $mockClassName['namespaceName'] . - " {\n\n" . $prologue . "}\n\n" . - "namespace {\n\n"; - - $epilogue = "\n\n}"; - } - - $mockedCloneMethod = true; - } else { - try { - $class = new ReflectionClass($mockClassName['fullClassName']); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new RuntimeException( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - if ($class->isFinal()) { - throw new RuntimeException( - sprintf( - 'Class "%s" is declared "final" and cannot be mocked.', - $mockClassName['fullClassName'] - ) - ); - } - - // @see https://github.com/sebastianbergmann/phpunit/issues/2995 - if ($isInterface && $class->implementsInterface(Throwable::class)) { - $actualClassName = Exception::class; - $additionalInterfaces[] = $class->getName(); - $isInterface = false; - - try { - $class = new ReflectionClass($actualClassName); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new RuntimeException( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - foreach ($this->userDefinedInterfaceMethods($mockClassName['fullClassName']) as $method) { - $methodName = $method->getName(); - - if ($class->hasMethod($methodName)) { - try { - $classMethod = $class->getMethod($methodName); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new RuntimeException( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - if (!$this->canMockMethod($classMethod)) { - continue; - } - } - - $mockMethods->addMethods( - MockMethod::fromReflection($method, $callOriginalMethods, $cloneArguments) - ); - } - - $mockClassName = $this->generateClassName( - $actualClassName, - $mockClassName['className'], - 'Mock_' - ); - } - - // @see https://github.com/sebastianbergmann/phpunit-mock-objects/issues/103 - if ($isInterface && $class->implementsInterface(Traversable::class) && - !$class->implementsInterface(Iterator::class) && - !$class->implementsInterface(IteratorAggregate::class)) { - $additionalInterfaces[] = Iterator::class; - - $mockMethods->addMethods( - ...$this->mockClassMethods(Iterator::class, $callOriginalMethods, $cloneArguments) - ); - } - - if ($class->hasMethod('__clone')) { - try { - $cloneMethod = $class->getMethod('__clone'); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new RuntimeException( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - if (!$cloneMethod->isFinal()) { - if ($callOriginalClone && !$isInterface) { - $unmockedCloneMethod = true; - } else { - $mockedCloneMethod = true; - } - } - } else { - $mockedCloneMethod = true; - } - } - - if ($isClass && $explicitMethods === []) { - $mockMethods->addMethods( - ...$this->mockClassMethods($mockClassName['fullClassName'], $callOriginalMethods, $cloneArguments) - ); - } - - if ($isInterface && ($explicitMethods === [] || $explicitMethods === null)) { - $mockMethods->addMethods( - ...$this->mockInterfaceMethods($mockClassName['fullClassName'], $cloneArguments) - ); - } - - if (is_array($explicitMethods)) { - foreach ($explicitMethods as $methodName) { - if ($class !== null && $class->hasMethod($methodName)) { - try { - $method = $class->getMethod($methodName); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new RuntimeException( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - if ($this->canMockMethod($method)) { - $mockMethods->addMethods( - MockMethod::fromReflection($method, $callOriginalMethods, $cloneArguments) - ); - } - } else { - $mockMethods->addMethods( - MockMethod::fromName( - $mockClassName['fullClassName'], - $methodName, - $cloneArguments - ) - ); - } - } - } - - $mockedMethods = ''; - $configurable = []; - - foreach ($mockMethods->asArray() as $mockMethod) { - $mockedMethods .= $mockMethod->generateCode(); - $configurable[] = new ConfigurableMethod($mockMethod->getName(), $mockMethod->getReturnType()); - } - - $method = ''; - - if (!$mockMethods->hasMethod('method') && (!isset($class) || !$class->hasMethod('method'))) { - $method = PHP_EOL . ' use \PHPUnit\Framework\MockObject\Method;'; - } - - $cloneTrait = ''; - - if ($mockedCloneMethod) { - $cloneTrait = PHP_EOL . ' use \PHPUnit\Framework\MockObject\MockedCloneMethod;'; - } - - if ($unmockedCloneMethod) { - $cloneTrait = PHP_EOL . ' use \PHPUnit\Framework\MockObject\UnmockedCloneMethod;'; - } - - $classTemplate->setVar( - [ - 'prologue' => $prologue ?? '', - 'epilogue' => $epilogue ?? '', - 'class_declaration' => $this->generateMockClassDeclaration( - $mockClassName, - $isInterface, - $additionalInterfaces - ), - 'clone' => $cloneTrait, - 'mock_class_name' => $mockClassName['className'], - 'mocked_methods' => $mockedMethods, - 'method' => $method, - ] - ); - - return new MockClass( - $classTemplate->render(), - $mockClassName['className'], - $configurable - ); - } - - /** - * @param array|string $type - */ - private function generateClassName($type, string $className, string $prefix): array - { - if (is_array($type)) { - $type = implode('_', $type); - } - - if ($type[0] === '\\') { - $type = substr($type, 1); - } - - $classNameParts = explode('\\', $type); - - if (count($classNameParts) > 1) { - $type = array_pop($classNameParts); - $namespaceName = implode('\\', $classNameParts); - $fullClassName = $namespaceName . '\\' . $type; - } else { - $namespaceName = ''; - $fullClassName = $type; - } - - if ($className === '') { - do { - $className = $prefix . $type . '_' . - substr(md5((string) mt_rand()), 0, 8); - } while (class_exists($className, false)); - } - - return [ - 'className' => $className, - 'originalClassName' => $type, - 'fullClassName' => $fullClassName, - 'namespaceName' => $namespaceName, - ]; - } - - private function generateMockClassDeclaration(array $mockClassName, bool $isInterface, array $additionalInterfaces = []): string - { - $buffer = 'class '; - - $additionalInterfaces[] = MockObject::class; - $interfaces = implode(', ', $additionalInterfaces); - - if ($isInterface) { - $buffer .= sprintf( - '%s implements %s', - $mockClassName['className'], - $interfaces - ); - - if (!in_array($mockClassName['originalClassName'], $additionalInterfaces, true)) { - $buffer .= ', '; - - if (!empty($mockClassName['namespaceName'])) { - $buffer .= $mockClassName['namespaceName'] . '\\'; - } - - $buffer .= $mockClassName['originalClassName']; - } - } else { - $buffer .= sprintf( - '%s extends %s%s implements %s', - $mockClassName['className'], - !empty($mockClassName['namespaceName']) ? $mockClassName['namespaceName'] . '\\' : '', - $mockClassName['originalClassName'], - $interfaces - ); - } - - return $buffer; - } - - private function canMockMethod(ReflectionMethod $method): bool - { - return !($this->isConstructor($method) || $method->isFinal() || $method->isPrivate() || $this->isMethodNameBlacklisted($method->getName())); - } - - private function isMethodNameBlacklisted(string $name): bool - { - return isset(self::BLACKLISTED_METHOD_NAMES[$name]); - } - - private function getTemplate(string $template): Text_Template - { - $filename = __DIR__ . DIRECTORY_SEPARATOR . 'Generator' . DIRECTORY_SEPARATOR . $template; - - if (!isset(self::$templates[$filename])) { - self::$templates[$filename] = new Text_Template($filename); - } - - return self::$templates[$filename]; - } - - /** - * @see https://github.com/sebastianbergmann/phpunit/issues/4139#issuecomment-605409765 - */ - private function isConstructor(ReflectionMethod $method): bool - { - $methodName = strtolower($method->getName()); - - if ($methodName === '__construct') { - return true; - } - - if (PHP_MAJOR_VERSION >= 8) { - return false; - } - - $className = strtolower($method->getDeclaringClass()->getName()); - - return $methodName === $className; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/deprecation.tpl b/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/deprecation.tpl deleted file mode 100644 index 5bf06f5..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/deprecation.tpl +++ /dev/null @@ -1,2 +0,0 @@ - - @trigger_error({deprecation}, E_USER_DEPRECATED); diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/mocked_class.tpl b/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/mocked_class.tpl deleted file mode 100644 index 593119f..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/mocked_class.tpl +++ /dev/null @@ -1,6 +0,0 @@ -declare(strict_types=1); - -{prologue}{class_declaration} -{ - use \PHPUnit\Framework\MockObject\Api;{method}{clone} -{mocked_methods}}{epilogue} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/mocked_method.tpl b/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/mocked_method.tpl deleted file mode 100644 index 32304f3..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/mocked_method.tpl +++ /dev/null @@ -1,22 +0,0 @@ - - {modifier} function {reference}{method_name}({arguments_decl}){return_declaration} - {{deprecation} - $__phpunit_arguments = [{arguments_call}]; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > {arguments_count}) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = {arguments_count}; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - '{class_name}', '{method_name}', $__phpunit_arguments, '{return_declaration}', $this, {clone_arguments} - ) - ); - - return $__phpunit_result; - } diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/mocked_method_void.tpl b/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/mocked_method_void.tpl deleted file mode 100644 index 6ea6f45..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/mocked_method_void.tpl +++ /dev/null @@ -1,20 +0,0 @@ - - {modifier} function {reference}{method_name}({arguments_decl}){return_declaration} - {{deprecation} - $__phpunit_arguments = [{arguments_call}]; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > {arguments_count}) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = {arguments_count}; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - '{class_name}', '{method_name}', $__phpunit_arguments, '{return_declaration}', $this, {clone_arguments} - ) - ); - } diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/mocked_static_method.tpl b/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/mocked_static_method.tpl deleted file mode 100644 index 5e5cf23..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/mocked_static_method.tpl +++ /dev/null @@ -1,5 +0,0 @@ - - {modifier} function {reference}{method_name}({arguments_decl}){return_declaration} - { - throw new \PHPUnit\Framework\MockObject\BadMethodCallException('Static method "{method_name}" cannot be invoked on mock object'); - } diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/proxied_method.tpl b/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/proxied_method.tpl deleted file mode 100644 index 6f699be..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/proxied_method.tpl +++ /dev/null @@ -1,22 +0,0 @@ - - {modifier} function {reference}{method_name}({arguments_decl}){return_declaration} - { - $__phpunit_arguments = [{arguments_call}]; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > {arguments_count}) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = {arguments_count}; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - '{class_name}', '{method_name}', $__phpunit_arguments, '{return_declaration}', $this, {clone_arguments}, true - ) - ); - - return call_user_func_array(array($this->__phpunit_originalObject, "{method_name}"), $__phpunit_arguments); - } diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/proxied_method_void.tpl b/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/proxied_method_void.tpl deleted file mode 100644 index b2f963d..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/proxied_method_void.tpl +++ /dev/null @@ -1,22 +0,0 @@ - - {modifier} function {reference}{method_name}({arguments_decl}){return_declaration} - { - $__phpunit_arguments = [{arguments_call}]; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > {arguments_count}) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = {arguments_count}; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - '{class_name}', '{method_name}', $__phpunit_arguments, '{return_declaration}', $this, {clone_arguments}, true - ) - ); - - call_user_func_array(array($this->__phpunit_originalObject, "{method_name}"), $__phpunit_arguments); - } diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/trait_class.tpl b/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/trait_class.tpl deleted file mode 100644 index a8fe470..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/trait_class.tpl +++ /dev/null @@ -1,6 +0,0 @@ -declare(strict_types=1); - -{prologue}class {class_name} -{ - use {trait_name}; -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/wsdl_class.tpl b/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/wsdl_class.tpl deleted file mode 100644 index b3100b4..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/wsdl_class.tpl +++ /dev/null @@ -1,9 +0,0 @@ -declare(strict_types=1); - -{namespace}class {class_name} extends \SoapClient -{ - public function __construct($wsdl, array $options) - { - parent::__construct('{wsdl}', $options); - } -{methods}} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/wsdl_method.tpl b/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/wsdl_method.tpl deleted file mode 100644 index bb16e76..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/wsdl_method.tpl +++ /dev/null @@ -1,4 +0,0 @@ - - public function {method_name}({arguments}) - { - } diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Invocation.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Invocation.php deleted file mode 100644 index 098b4fc..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Invocation.php +++ /dev/null @@ -1,201 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use function array_map; -use function implode; -use function is_object; -use function ltrim; -use function sprintf; -use function strpos; -use function strtolower; -use function substr; -use PHPUnit\Framework\SelfDescribing; -use PHPUnit\Util\Type; -use SebastianBergmann\Exporter\Exporter; -use stdClass; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Invocation implements SelfDescribing -{ - /** - * @var string - */ - private $className; - - /** - * @var string - */ - private $methodName; - - /** - * @var array - */ - private $parameters; - - /** - * @var string - */ - private $returnType; - - /** - * @var bool - */ - private $isReturnTypeNullable = false; - - /** - * @var bool - */ - private $proxiedCall; - - /** - * @var object - */ - private $object; - - public function __construct(string $className, string $methodName, array $parameters, string $returnType, object $object, bool $cloneObjects = false, bool $proxiedCall = false) - { - $this->className = $className; - $this->methodName = $methodName; - $this->parameters = $parameters; - $this->object = $object; - $this->proxiedCall = $proxiedCall; - - $returnType = ltrim($returnType, ': '); - - if (strtolower($methodName) === '__tostring') { - $returnType = 'string'; - } - - if (strpos($returnType, '?') === 0) { - $returnType = substr($returnType, 1); - $this->isReturnTypeNullable = true; - } - - $this->returnType = $returnType; - - if (!$cloneObjects) { - return; - } - - foreach ($this->parameters as $key => $value) { - if (is_object($value)) { - $this->parameters[$key] = $this->cloneObject($value); - } - } - } - - public function getClassName(): string - { - return $this->className; - } - - public function getMethodName(): string - { - return $this->methodName; - } - - public function getParameters(): array - { - return $this->parameters; - } - - /** - * @throws RuntimeException - * - * @return mixed Mocked return value - */ - public function generateReturnValue() - { - if ($this->isReturnTypeNullable || $this->proxiedCall) { - return; - } - - switch (strtolower($this->returnType)) { - case '': - case 'void': - return; - - case 'string': - return ''; - - case 'float': - return 0.0; - - case 'int': - return 0; - - case 'bool': - return false; - - case 'array': - return []; - - case 'object': - return new stdClass; - - case 'callable': - case 'closure': - return static function (): void - { - }; - - case 'traversable': - case 'generator': - case 'iterable': - $generator = static function () - { - yield from []; - }; - - return $generator(); - - default: - $generator = new Generator; - - return $generator->getMock($this->returnType, [], [], '', false); - } - } - - public function toString(): string - { - $exporter = new Exporter; - - return sprintf( - '%s::%s(%s)%s', - $this->className, - $this->methodName, - implode( - ', ', - array_map( - [$exporter, 'shortenedExport'], - $this->parameters - ) - ), - $this->returnType ? sprintf(': %s', $this->returnType) : '' - ); - } - - public function getObject(): object - { - return $this->object; - } - - private function cloneObject(object $original): object - { - if (Type::isCloneable($original)) { - return clone $original; - } - - return $original; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/InvocationHandler.php b/vendor/phpunit/phpunit/src/Framework/MockObject/InvocationHandler.php deleted file mode 100644 index 77d7825..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/InvocationHandler.php +++ /dev/null @@ -1,197 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use function sprintf; -use function strtolower; -use Exception; -use PHPUnit\Framework\ExpectationFailedException; -use PHPUnit\Framework\MockObject\Builder\InvocationMocker; -use PHPUnit\Framework\MockObject\Rule\InvocationOrder; -use Throwable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class InvocationHandler -{ - /** - * @var Matcher[] - */ - private $matchers = []; - - /** - * @var Matcher[] - */ - private $matcherMap = []; - - /** - * @var ConfigurableMethod[] - */ - private $configurableMethods; - - /** - * @var bool - */ - private $returnValueGeneration; - - /** - * @var Throwable - */ - private $deferredError; - - public function __construct(array $configurableMethods, bool $returnValueGeneration) - { - $this->configurableMethods = $configurableMethods; - $this->returnValueGeneration = $returnValueGeneration; - } - - public function hasMatchers(): bool - { - foreach ($this->matchers as $matcher) { - if ($matcher->hasMatchers()) { - return true; - } - } - - return false; - } - - /** - * Looks up the match builder with identification $id and returns it. - * - * @param string $id The identification of the match builder - */ - public function lookupMatcher(string $id): ?Matcher - { - if (isset($this->matcherMap[$id])) { - return $this->matcherMap[$id]; - } - - return null; - } - - /** - * Registers a matcher with the identification $id. The matcher can later be - * looked up using lookupMatcher() to figure out if it has been invoked. - * - * @param string $id The identification of the matcher - * @param Matcher $matcher The builder which is being registered - * - * @throws RuntimeException - */ - public function registerMatcher(string $id, Matcher $matcher): void - { - if (isset($this->matcherMap[$id])) { - throw new RuntimeException( - 'Matcher with id <' . $id . '> is already registered.' - ); - } - - $this->matcherMap[$id] = $matcher; - } - - public function expects(InvocationOrder $rule): InvocationMocker - { - $matcher = new Matcher($rule); - $this->addMatcher($matcher); - - return new InvocationMocker( - $this, - $matcher, - ...$this->configurableMethods - ); - } - - /** - * @throws Exception - * - * @return mixed|void - */ - public function invoke(Invocation $invocation) - { - $exception = null; - $hasReturnValue = false; - $returnValue = null; - - foreach ($this->matchers as $match) { - try { - if ($match->matches($invocation)) { - $value = $match->invoked($invocation); - - if (!$hasReturnValue) { - $returnValue = $value; - $hasReturnValue = true; - } - } - } catch (Exception $e) { - $exception = $e; - } - } - - if ($exception !== null) { - throw $exception; - } - - if ($hasReturnValue) { - return $returnValue; - } - - if (!$this->returnValueGeneration) { - $exception = new ExpectationFailedException( - sprintf( - 'Return value inference disabled and no expectation set up for %s::%s()', - $invocation->getClassName(), - $invocation->getMethodName() - ) - ); - - if (strtolower($invocation->getMethodName()) === '__tostring') { - $this->deferredError = $exception; - - return ''; - } - - throw $exception; - } - - return $invocation->generateReturnValue(); - } - - public function matches(Invocation $invocation): bool - { - foreach ($this->matchers as $matcher) { - if (!$matcher->matches($invocation)) { - return false; - } - } - - return true; - } - - /** - * @throws \PHPUnit\Framework\ExpectationFailedException - */ - public function verify(): void - { - foreach ($this->matchers as $matcher) { - $matcher->verify(); - } - - if ($this->deferredError) { - throw $this->deferredError; - } - } - - private function addMatcher(Matcher $matcher): void - { - $this->matchers[] = $matcher; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Matcher.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Matcher.php deleted file mode 100644 index 2b1cd8c..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Matcher.php +++ /dev/null @@ -1,278 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use function assert; -use function implode; -use function sprintf; -use Exception; -use PHPUnit\Framework\ExpectationFailedException; -use PHPUnit\Framework\MockObject\Rule\AnyInvokedCount; -use PHPUnit\Framework\MockObject\Rule\AnyParameters; -use PHPUnit\Framework\MockObject\Rule\InvocationOrder; -use PHPUnit\Framework\MockObject\Rule\InvokedCount; -use PHPUnit\Framework\MockObject\Rule\MethodName; -use PHPUnit\Framework\MockObject\Rule\ParametersRule; -use PHPUnit\Framework\MockObject\Stub\Stub; -use PHPUnit\Framework\TestFailure; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Matcher -{ - /** - * @var InvocationOrder - */ - private $invocationRule; - - /** - * @var mixed - */ - private $afterMatchBuilderId; - - /** - * @var bool - */ - private $afterMatchBuilderIsInvoked = false; - - /** - * @var MethodName - */ - private $methodNameRule; - - /** - * @var ParametersRule - */ - private $parametersRule; - - /** - * @var Stub - */ - private $stub; - - public function __construct(InvocationOrder $rule) - { - $this->invocationRule = $rule; - } - - public function hasMatchers(): bool - { - return !$this->invocationRule instanceof AnyInvokedCount; - } - - public function hasMethodNameRule(): bool - { - return $this->methodNameRule !== null; - } - - public function getMethodNameRule(): MethodName - { - return $this->methodNameRule; - } - - public function setMethodNameRule(MethodName $rule): void - { - $this->methodNameRule = $rule; - } - - public function hasParametersRule(): bool - { - return $this->parametersRule !== null; - } - - public function setParametersRule(ParametersRule $rule): void - { - $this->parametersRule = $rule; - } - - public function setStub(Stub $stub): void - { - $this->stub = $stub; - } - - public function setAfterMatchBuilderId(string $id): void - { - $this->afterMatchBuilderId = $id; - } - - /** - * @throws Exception - * @throws ExpectationFailedException - * @throws RuntimeException - */ - public function invoked(Invocation $invocation) - { - if ($this->methodNameRule === null) { - throw new RuntimeException('No method rule is set'); - } - - if ($this->afterMatchBuilderId !== null) { - $matcher = $invocation->getObject() - ->__phpunit_getInvocationHandler() - ->lookupMatcher($this->afterMatchBuilderId); - - if (!$matcher) { - throw new RuntimeException( - sprintf( - 'No builder found for match builder identification <%s>', - $this->afterMatchBuilderId - ) - ); - } - assert($matcher instanceof self); - - if ($matcher->invocationRule->hasBeenInvoked()) { - $this->afterMatchBuilderIsInvoked = true; - } - } - - $this->invocationRule->invoked($invocation); - - try { - if ($this->parametersRule !== null) { - $this->parametersRule->apply($invocation); - } - } catch (ExpectationFailedException $e) { - throw new ExpectationFailedException( - sprintf( - "Expectation failed for %s when %s\n%s", - $this->methodNameRule->toString(), - $this->invocationRule->toString(), - $e->getMessage() - ), - $e->getComparisonFailure() - ); - } - - if ($this->stub) { - return $this->stub->invoke($invocation); - } - - return $invocation->generateReturnValue(); - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * @throws RuntimeException - */ - public function matches(Invocation $invocation): bool - { - if ($this->afterMatchBuilderId !== null) { - $matcher = $invocation->getObject() - ->__phpunit_getInvocationHandler() - ->lookupMatcher($this->afterMatchBuilderId); - - if (!$matcher) { - throw new RuntimeException( - sprintf( - 'No builder found for match builder identification <%s>', - $this->afterMatchBuilderId - ) - ); - } - assert($matcher instanceof self); - - if (!$matcher->invocationRule->hasBeenInvoked()) { - return false; - } - } - - if ($this->methodNameRule === null) { - throw new RuntimeException('No method rule is set'); - } - - if (!$this->invocationRule->matches($invocation)) { - return false; - } - - try { - if (!$this->methodNameRule->matches($invocation)) { - return false; - } - } catch (ExpectationFailedException $e) { - throw new ExpectationFailedException( - sprintf( - "Expectation failed for %s when %s\n%s", - $this->methodNameRule->toString(), - $this->invocationRule->toString(), - $e->getMessage() - ), - $e->getComparisonFailure() - ); - } - - return true; - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * @throws RuntimeException - */ - public function verify(): void - { - if ($this->methodNameRule === null) { - throw new RuntimeException('No method rule is set'); - } - - try { - $this->invocationRule->verify(); - - if ($this->parametersRule === null) { - $this->parametersRule = new AnyParameters; - } - - $invocationIsAny = $this->invocationRule instanceof AnyInvokedCount; - $invocationIsNever = $this->invocationRule instanceof InvokedCount && $this->invocationRule->isNever(); - - if (!$invocationIsAny && !$invocationIsNever) { - $this->parametersRule->verify(); - } - } catch (ExpectationFailedException $e) { - throw new ExpectationFailedException( - sprintf( - "Expectation failed for %s when %s.\n%s", - $this->methodNameRule->toString(), - $this->invocationRule->toString(), - TestFailure::exceptionToString($e) - ) - ); - } - } - - public function toString(): string - { - $list = []; - - if ($this->invocationRule !== null) { - $list[] = $this->invocationRule->toString(); - } - - if ($this->methodNameRule !== null) { - $list[] = 'where ' . $this->methodNameRule->toString(); - } - - if ($this->parametersRule !== null) { - $list[] = 'and ' . $this->parametersRule->toString(); - } - - if ($this->afterMatchBuilderId !== null) { - $list[] = 'after ' . $this->afterMatchBuilderId; - } - - if ($this->stub !== null) { - $list[] = 'will ' . $this->stub->toString(); - } - - return implode(' ', $list); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/MethodNameConstraint.php b/vendor/phpunit/phpunit/src/Framework/MockObject/MethodNameConstraint.php deleted file mode 100644 index 3082ab3..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/MethodNameConstraint.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use function is_string; -use function sprintf; -use function strtolower; -use PHPUnit\Framework\Constraint\Constraint; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class MethodNameConstraint extends Constraint -{ - /** - * @var string - */ - private $methodName; - - public function __construct(string $methodName) - { - $this->methodName = $methodName; - } - - public function toString(): string - { - return sprintf( - 'is "%s"', - $this->methodName - ); - } - - protected function matches($other): bool - { - if (!is_string($other)) { - return false; - } - - return strtolower($this->methodName) === strtolower($other); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/MockBuilder.php b/vendor/phpunit/phpunit/src/Framework/MockObject/MockBuilder.php deleted file mode 100644 index 6ff2b26..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/MockBuilder.php +++ /dev/null @@ -1,511 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use function array_diff; -use function array_merge; -use function sprintf; -use PHPUnit\Framework\TestCase; -use ReflectionClass; -use ReflectionException; - -/** - * @psalm-template MockedType - */ -final class MockBuilder -{ - /** - * @var TestCase - */ - private $testCase; - - /** - * @var string - */ - private $type; - - /** - * @var null|string[] - */ - private $methods = []; - - /** - * @var bool - */ - private $emptyMethodsArray = false; - - /** - * @var string - */ - private $mockClassName = ''; - - /** - * @var array - */ - private $constructorArgs = []; - - /** - * @var bool - */ - private $originalConstructor = true; - - /** - * @var bool - */ - private $originalClone = true; - - /** - * @var bool - */ - private $autoload = true; - - /** - * @var bool - */ - private $cloneArguments = false; - - /** - * @var bool - */ - private $callOriginalMethods = false; - - /** - * @var ?object - */ - private $proxyTarget; - - /** - * @var bool - */ - private $allowMockingUnknownTypes = true; - - /** - * @var bool - */ - private $returnValueGeneration = true; - - /** - * @var Generator - */ - private $generator; - - /** - * @param string|string[] $type - * - * @psalm-param class-string|string|string[] $type - */ - public function __construct(TestCase $testCase, $type) - { - $this->testCase = $testCase; - $this->type = $type; - $this->generator = new Generator; - } - - /** - * Creates a mock object using a fluent interface. - * - * @throws RuntimeException - * - * @psalm-return MockObject&MockedType - */ - public function getMock(): MockObject - { - $object = $this->generator->getMock( - $this->type, - !$this->emptyMethodsArray ? $this->methods : null, - $this->constructorArgs, - $this->mockClassName, - $this->originalConstructor, - $this->originalClone, - $this->autoload, - $this->cloneArguments, - $this->callOriginalMethods, - $this->proxyTarget, - $this->allowMockingUnknownTypes, - $this->returnValueGeneration - ); - - $this->testCase->registerMockObject($object); - - return $object; - } - - /** - * Creates a mock object for an abstract class using a fluent interface. - * - * @throws \PHPUnit\Framework\Exception - * @throws RuntimeException - * - * @psalm-return MockObject&MockedType - */ - public function getMockForAbstractClass(): MockObject - { - $object = $this->generator->getMockForAbstractClass( - $this->type, - $this->constructorArgs, - $this->mockClassName, - $this->originalConstructor, - $this->originalClone, - $this->autoload, - $this->methods, - $this->cloneArguments - ); - - $this->testCase->registerMockObject($object); - - return $object; - } - - /** - * Creates a mock object for a trait using a fluent interface. - * - * @throws \PHPUnit\Framework\Exception - * @throws RuntimeException - * - * @psalm-return MockObject&MockedType - */ - public function getMockForTrait(): MockObject - { - $object = $this->generator->getMockForTrait( - $this->type, - $this->constructorArgs, - $this->mockClassName, - $this->originalConstructor, - $this->originalClone, - $this->autoload, - $this->methods, - $this->cloneArguments - ); - - $this->testCase->registerMockObject($object); - - return $object; - } - - /** - * Specifies the subset of methods to mock. Default is to mock none of them. - * - * @deprecated https://github.com/sebastianbergmann/phpunit/pull/3687 - * - * @return $this - */ - public function setMethods(?array $methods = null): self - { - if ($methods === null) { - $this->methods = $methods; - } else { - $this->methods = array_merge($this->methods ?? [], $methods); - } - - return $this; - } - - /** - * Specifies the subset of methods to mock, requiring each to exist in the class. - * - * @param string[] $methods - * - * @throws RuntimeException - * - * @return $this - */ - public function onlyMethods(array $methods): self - { - if (empty($methods)) { - $this->emptyMethodsArray = true; - - return $this; - } - - try { - $reflector = new ReflectionClass($this->type); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new RuntimeException( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - foreach ($methods as $method) { - if (!$reflector->hasMethod($method)) { - throw new RuntimeException( - sprintf( - 'Trying to set mock method "%s" with onlyMethods, but it does not exist in class "%s". Use addMethods() for methods that don\'t exist in the class.', - $method, - $this->type - ) - ); - } - } - - $this->methods = array_merge($this->methods ?? [], $methods); - - return $this; - } - - /** - * Specifies methods that don't exist in the class which you want to mock. - * - * @param string[] $methods - * - * @throws RuntimeException - * - * @return $this - */ - public function addMethods(array $methods): self - { - if (empty($methods)) { - $this->emptyMethodsArray = true; - - return $this; - } - - try { - $reflector = new ReflectionClass($this->type); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new RuntimeException( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - foreach ($methods as $method) { - if ($reflector->hasMethod($method)) { - throw new RuntimeException( - sprintf( - 'Trying to set mock method "%s" with addMethods(), but it exists in class "%s". Use onlyMethods() for methods that exist in the class.', - $method, - $this->type - ) - ); - } - } - - $this->methods = array_merge($this->methods ?? [], $methods); - - return $this; - } - - /** - * Specifies the subset of methods to not mock. Default is to mock all of them. - */ - public function setMethodsExcept(array $methods = []): self - { - return $this->setMethods( - array_diff( - $this->generator->getClassMethods($this->type), - $methods - ) - ); - } - - /** - * Specifies the arguments for the constructor. - * - * @return $this - */ - public function setConstructorArgs(array $args): self - { - $this->constructorArgs = $args; - - return $this; - } - - /** - * Specifies the name for the mock class. - * - * @return $this - */ - public function setMockClassName(string $name): self - { - $this->mockClassName = $name; - - return $this; - } - - /** - * Disables the invocation of the original constructor. - * - * @return $this - */ - public function disableOriginalConstructor(): self - { - $this->originalConstructor = false; - - return $this; - } - - /** - * Enables the invocation of the original constructor. - * - * @return $this - */ - public function enableOriginalConstructor(): self - { - $this->originalConstructor = true; - - return $this; - } - - /** - * Disables the invocation of the original clone constructor. - * - * @return $this - */ - public function disableOriginalClone(): self - { - $this->originalClone = false; - - return $this; - } - - /** - * Enables the invocation of the original clone constructor. - * - * @return $this - */ - public function enableOriginalClone(): self - { - $this->originalClone = true; - - return $this; - } - - /** - * Disables the use of class autoloading while creating the mock object. - * - * @return $this - */ - public function disableAutoload(): self - { - $this->autoload = false; - - return $this; - } - - /** - * Enables the use of class autoloading while creating the mock object. - * - * @return $this - */ - public function enableAutoload(): self - { - $this->autoload = true; - - return $this; - } - - /** - * Disables the cloning of arguments passed to mocked methods. - * - * @return $this - */ - public function disableArgumentCloning(): self - { - $this->cloneArguments = false; - - return $this; - } - - /** - * Enables the cloning of arguments passed to mocked methods. - * - * @return $this - */ - public function enableArgumentCloning(): self - { - $this->cloneArguments = true; - - return $this; - } - - /** - * Enables the invocation of the original methods. - * - * @return $this - */ - public function enableProxyingToOriginalMethods(): self - { - $this->callOriginalMethods = true; - - return $this; - } - - /** - * Disables the invocation of the original methods. - * - * @return $this - */ - public function disableProxyingToOriginalMethods(): self - { - $this->callOriginalMethods = false; - $this->proxyTarget = null; - - return $this; - } - - /** - * Sets the proxy target. - * - * @return $this - */ - public function setProxyTarget(object $object): self - { - $this->proxyTarget = $object; - - return $this; - } - - /** - * @return $this - */ - public function allowMockingUnknownTypes(): self - { - $this->allowMockingUnknownTypes = true; - - return $this; - } - - /** - * @return $this - */ - public function disallowMockingUnknownTypes(): self - { - $this->allowMockingUnknownTypes = false; - - return $this; - } - - /** - * @return $this - */ - public function enableAutoReturnValueGeneration(): self - { - $this->returnValueGeneration = true; - - return $this; - } - - /** - * @return $this - */ - public function disableAutoReturnValueGeneration(): self - { - $this->returnValueGeneration = false; - - return $this; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/MockClass.php b/vendor/phpunit/phpunit/src/Framework/MockObject/MockClass.php deleted file mode 100644 index 4aaac1b..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/MockClass.php +++ /dev/null @@ -1,63 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use function call_user_func; -use function class_exists; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class MockClass implements MockType -{ - /** - * @var string - */ - private $classCode; - - /** - * @var string - */ - private $mockName; - - /** - * @var ConfigurableMethod[] - */ - private $configurableMethods; - - public function __construct(string $classCode, string $mockName, array $configurableMethods) - { - $this->classCode = $classCode; - $this->mockName = $mockName; - $this->configurableMethods = $configurableMethods; - } - - public function generate(): string - { - if (!class_exists($this->mockName, false)) { - eval($this->classCode); - - call_user_func( - [ - $this->mockName, - '__phpunit_initConfigurableMethods', - ], - ...$this->configurableMethods - ); - } - - return $this->mockName; - } - - public function getClassCode(): string - { - return $this->classCode; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/MockMethod.php b/vendor/phpunit/phpunit/src/Framework/MockObject/MockMethod.php deleted file mode 100644 index 91a6864..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/MockMethod.php +++ /dev/null @@ -1,403 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use const DIRECTORY_SEPARATOR; -use function implode; -use function is_string; -use function method_exists; -use function preg_match; -use function preg_replace; -use function sprintf; -use function str_replace; -use function substr_count; -use function trim; -use function var_export; -use ReflectionException; -use ReflectionMethod; -use ReflectionNamedType; -use ReflectionType; -use SebastianBergmann\Type\ObjectType; -use SebastianBergmann\Type\Type; -use SebastianBergmann\Type\UnknownType; -use SebastianBergmann\Type\VoidType; -use Text_Template; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class MockMethod -{ - /** - * @var Text_Template[] - */ - private static $templates = []; - - /** - * @var string - */ - private $className; - - /** - * @var string - */ - private $methodName; - - /** - * @var bool - */ - private $cloneArguments; - - /** - * @var string - */ - private $modifier; - - /** - * @var string - */ - private $argumentsForDeclaration; - - /** - * @var string - */ - private $argumentsForCall; - - /** - * @var Type - */ - private $returnType; - - /** - * @var string - */ - private $reference; - - /** - * @var bool - */ - private $callOriginalMethod; - - /** - * @var bool - */ - private $static; - - /** - * @var ?string - */ - private $deprecation; - - /** - * @throws RuntimeException - */ - public static function fromReflection(ReflectionMethod $method, bool $callOriginalMethod, bool $cloneArguments): self - { - if ($method->isPrivate()) { - $modifier = 'private'; - } elseif ($method->isProtected()) { - $modifier = 'protected'; - } else { - $modifier = 'public'; - } - - if ($method->isStatic()) { - $modifier .= ' static'; - } - - if ($method->returnsReference()) { - $reference = '&'; - } else { - $reference = ''; - } - - $docComment = $method->getDocComment(); - - if (is_string($docComment) && - preg_match('#\*[ \t]*+@deprecated[ \t]*+(.*?)\r?+\n[ \t]*+\*(?:[ \t]*+@|/$)#s', $docComment, $deprecation)) { - $deprecation = trim(preg_replace('#[ \t]*\r?\n[ \t]*+\*[ \t]*+#', ' ', $deprecation[1])); - } else { - $deprecation = null; - } - - return new self( - $method->getDeclaringClass()->getName(), - $method->getName(), - $cloneArguments, - $modifier, - self::getMethodParametersForDeclaration($method), - self::getMethodParametersForCall($method), - self::deriveReturnType($method), - $reference, - $callOriginalMethod, - $method->isStatic(), - $deprecation - ); - } - - public static function fromName(string $fullClassName, string $methodName, bool $cloneArguments): self - { - return new self( - $fullClassName, - $methodName, - $cloneArguments, - 'public', - '', - '', - new UnknownType, - '', - false, - false, - null - ); - } - - public function __construct(string $className, string $methodName, bool $cloneArguments, string $modifier, string $argumentsForDeclaration, string $argumentsForCall, Type $returnType, string $reference, bool $callOriginalMethod, bool $static, ?string $deprecation) - { - $this->className = $className; - $this->methodName = $methodName; - $this->cloneArguments = $cloneArguments; - $this->modifier = $modifier; - $this->argumentsForDeclaration = $argumentsForDeclaration; - $this->argumentsForCall = $argumentsForCall; - $this->returnType = $returnType; - $this->reference = $reference; - $this->callOriginalMethod = $callOriginalMethod; - $this->static = $static; - $this->deprecation = $deprecation; - } - - public function getName(): string - { - return $this->methodName; - } - - /** - * @throws RuntimeException - */ - public function generateCode(): string - { - if ($this->static) { - $templateFile = 'mocked_static_method.tpl'; - } elseif ($this->returnType instanceof VoidType) { - $templateFile = sprintf( - '%s_method_void.tpl', - $this->callOriginalMethod ? 'proxied' : 'mocked' - ); - } else { - $templateFile = sprintf( - '%s_method.tpl', - $this->callOriginalMethod ? 'proxied' : 'mocked' - ); - } - - $deprecation = $this->deprecation; - - if (null !== $this->deprecation) { - $deprecation = "The {$this->className}::{$this->methodName} method is deprecated ({$this->deprecation})."; - $deprecationTemplate = $this->getTemplate('deprecation.tpl'); - - $deprecationTemplate->setVar([ - 'deprecation' => var_export($deprecation, true), - ]); - - $deprecation = $deprecationTemplate->render(); - } - - /** - * This is required as the version of sebastian/type used - * by PHPUnit 8.5 does now know about the mixed type. - */ - $returnTypeDeclaration = str_replace( - '?mixed', - 'mixed', - $this->returnType->getReturnTypeDeclaration() - ); - - $template = $this->getTemplate($templateFile); - - $template->setVar( - [ - 'arguments_decl' => $this->argumentsForDeclaration, - 'arguments_call' => $this->argumentsForCall, - 'return_declaration' => $returnTypeDeclaration, - 'arguments_count' => !empty($this->argumentsForCall) ? substr_count($this->argumentsForCall, ',') + 1 : 0, - 'class_name' => $this->className, - 'method_name' => $this->methodName, - 'modifier' => $this->modifier, - 'reference' => $this->reference, - 'clone_arguments' => $this->cloneArguments ? 'true' : 'false', - 'deprecation' => $deprecation, - ] - ); - - return $template->render(); - } - - public function getReturnType(): Type - { - return $this->returnType; - } - - private function getTemplate(string $template): Text_Template - { - $filename = __DIR__ . DIRECTORY_SEPARATOR . 'Generator' . DIRECTORY_SEPARATOR . $template; - - if (!isset(self::$templates[$filename])) { - self::$templates[$filename] = new Text_Template($filename); - } - - return self::$templates[$filename]; - } - - /** - * Returns the parameters of a function or method. - * - * @throws RuntimeException - */ - private static function getMethodParametersForDeclaration(ReflectionMethod $method): string - { - $parameters = []; - - foreach ($method->getParameters() as $i => $parameter) { - $name = '$' . $parameter->getName(); - - /* Note: PHP extensions may use empty names for reference arguments - * or "..." for methods taking a variable number of arguments. - */ - if ($name === '$' || $name === '$...') { - $name = '$arg' . $i; - } - - $nullable = ''; - $default = ''; - $reference = ''; - $typeDeclaration = ''; - $type = null; - $typeName = null; - - if ($parameter->hasType()) { - $type = $parameter->getType(); - - if ($type instanceof ReflectionNamedType) { - $typeName = $type->getName(); - } - } - - if ($parameter->isVariadic()) { - $name = '...' . $name; - } elseif ($parameter->isDefaultValueAvailable()) { - $default = ' = ' . var_export($parameter->getDefaultValue(), true); - } elseif ($parameter->isOptional()) { - $default = ' = null'; - } - - if ($type !== null) { - if ($typeName !== 'mixed' && $parameter->allowsNull()) { - $nullable = '?'; - } - - if ($typeName === 'self') { - $typeDeclaration = $method->getDeclaringClass()->getName() . ' '; - } elseif ($typeName !== null) { - $typeDeclaration = $typeName . ' '; - } - } - - if ($parameter->isPassedByReference()) { - $reference = '&'; - } - - $parameters[] = $nullable . $typeDeclaration . $reference . $name . $default; - } - - return implode(', ', $parameters); - } - - /** - * Returns the parameters of a function or method. - * - * @throws ReflectionException - */ - private static function getMethodParametersForCall(ReflectionMethod $method): string - { - $parameters = []; - - foreach ($method->getParameters() as $i => $parameter) { - $name = '$' . $parameter->getName(); - - /* Note: PHP extensions may use empty names for reference arguments - * or "..." for methods taking a variable number of arguments. - */ - if ($name === '$' || $name === '$...') { - $name = '$arg' . $i; - } - - if ($parameter->isVariadic()) { - continue; - } - - if ($parameter->isPassedByReference()) { - $parameters[] = '&' . $name; - } else { - $parameters[] = $name; - } - } - - return implode(', ', $parameters); - } - - private static function deriveReturnType(ReflectionMethod $method): Type - { - $returnType = self::reflectionMethodGetReturnType($method); - - if ($returnType === null) { - return new UnknownType; - } - - // @see https://bugs.php.net/bug.php?id=70722 - if ($returnType instanceof ReflectionNamedType && $returnType->getName() === 'self') { - return ObjectType::fromName($method->getDeclaringClass()->getName(), $returnType->allowsNull()); - } - - // @see https://github.com/sebastianbergmann/phpunit-mock-objects/issues/406 - if ($returnType instanceof ReflectionNamedType && $returnType->getName() === 'parent') { - $parentClass = $method->getDeclaringClass()->getParentClass(); - - if ($parentClass === false) { - throw new RuntimeException( - sprintf( - 'Cannot mock %s::%s because "parent" return type declaration is used but %s does not have a parent class', - $method->getDeclaringClass()->getName(), - $method->getName(), - $method->getDeclaringClass()->getName() - ) - ); - } - - return ObjectType::fromName($parentClass->getName(), $returnType->allowsNull()); - } - - return Type::fromName($returnType->getName(), $returnType->allowsNull()); - } - - private static function reflectionMethodGetReturnType(ReflectionMethod $method): ?ReflectionType - { - if ($method->hasReturnType()) { - return $method->getReturnType(); - } - - if (!method_exists($method, 'getTentativeReturnType')) { - return null; - } - - return $method->getTentativeReturnType(); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/MockMethodSet.php b/vendor/phpunit/phpunit/src/Framework/MockObject/MockMethodSet.php deleted file mode 100644 index 1c78963..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/MockMethodSet.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use function array_key_exists; -use function array_values; -use function strtolower; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class MockMethodSet -{ - /** - * @var MockMethod[] - */ - private $methods = []; - - public function addMethods(MockMethod ...$methods): void - { - foreach ($methods as $method) { - $this->methods[strtolower($method->getName())] = $method; - } - } - - /** - * @return MockMethod[] - */ - public function asArray(): array - { - return array_values($this->methods); - } - - public function hasMethod(string $methodName): bool - { - return array_key_exists(strtolower($methodName), $this->methods); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/MockObject.php b/vendor/phpunit/phpunit/src/Framework/MockObject/MockObject.php deleted file mode 100644 index 4db11e1..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/MockObject.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use PHPUnit\Framework\MockObject\Builder\InvocationMocker as BuilderInvocationMocker; -use PHPUnit\Framework\MockObject\Rule\InvocationOrder; - -/** - * @method BuilderInvocationMocker method($constraint) - */ -interface MockObject extends Stub -{ - public function __phpunit_setOriginalObject($originalObject): void; - - public function __phpunit_verify(bool $unsetInvocationMocker = true): void; - - public function expects(InvocationOrder $invocationRule): BuilderInvocationMocker; -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/MockTrait.php b/vendor/phpunit/phpunit/src/Framework/MockObject/MockTrait.php deleted file mode 100644 index 7b9f450..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/MockTrait.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use function class_exists; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class MockTrait implements MockType -{ - /** - * @var string - */ - private $classCode; - - /** - * @var string - */ - private $mockName; - - public function __construct(string $classCode, string $mockName) - { - $this->classCode = $classCode; - $this->mockName = $mockName; - } - - public function generate(): string - { - if (!class_exists($this->mockName, false)) { - eval($this->classCode); - } - - return $this->mockName; - } - - public function getClassCode(): string - { - return $this->classCode; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/MockType.php b/vendor/phpunit/phpunit/src/Framework/MockObject/MockType.php deleted file mode 100644 index b35ac30..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/MockType.php +++ /dev/null @@ -1,18 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -interface MockType -{ - public function generate(): string; -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/AnyInvokedCount.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/AnyInvokedCount.php deleted file mode 100644 index f93e568..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/AnyInvokedCount.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Rule; - -use PHPUnit\Framework\MockObject\Invocation as BaseInvocation; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class AnyInvokedCount extends InvocationOrder -{ - public function toString(): string - { - return 'invoked zero or more times'; - } - - public function verify(): void - { - } - - public function matches(BaseInvocation $invocation): bool - { - return true; - } - - protected function invokedDo(BaseInvocation $invocation): void - { - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/AnyParameters.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/AnyParameters.php deleted file mode 100644 index 61de788..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/AnyParameters.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Rule; - -use PHPUnit\Framework\MockObject\Invocation as BaseInvocation; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class AnyParameters implements ParametersRule -{ - public function toString(): string - { - return 'with any parameters'; - } - - public function apply(BaseInvocation $invocation): void - { - } - - public function verify(): void - { - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/ConsecutiveParameters.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/ConsecutiveParameters.php deleted file mode 100644 index 9cb8137..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/ConsecutiveParameters.php +++ /dev/null @@ -1,136 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Rule; - -use function count; -use function gettype; -use function is_iterable; -use function sprintf; -use PHPUnit\Framework\Constraint\Constraint; -use PHPUnit\Framework\Constraint\IsEqual; -use PHPUnit\Framework\ExpectationFailedException; -use PHPUnit\Framework\InvalidParameterGroupException; -use PHPUnit\Framework\MockObject\Invocation as BaseInvocation; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ConsecutiveParameters implements ParametersRule -{ - /** - * @var array - */ - private $parameterGroups = []; - - /** - * @var array - */ - private $invocations = []; - - /** - * @throws \PHPUnit\Framework\Exception - */ - public function __construct(array $parameterGroups) - { - foreach ($parameterGroups as $index => $parameters) { - if (!is_iterable($parameters)) { - throw new InvalidParameterGroupException( - sprintf( - 'Parameter group #%d must be an array or Traversable, got %s', - $index, - gettype($parameters) - ) - ); - } - - foreach ($parameters as $parameter) { - if (!$parameter instanceof Constraint) { - $parameter = new IsEqual($parameter); - } - - $this->parameterGroups[$index][] = $parameter; - } - } - } - - public function toString(): string - { - return 'with consecutive parameters'; - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public function apply(BaseInvocation $invocation): void - { - $this->invocations[] = $invocation; - $callIndex = count($this->invocations) - 1; - - $this->verifyInvocation($invocation, $callIndex); - } - - /** - * @throws \PHPUnit\Framework\ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function verify(): void - { - foreach ($this->invocations as $callIndex => $invocation) { - $this->verifyInvocation($invocation, $callIndex); - } - } - - /** - * Verify a single invocation. - * - * @param int $callIndex - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - private function verifyInvocation(BaseInvocation $invocation, $callIndex): void - { - if (!isset($this->parameterGroups[$callIndex])) { - // no parameter assertion for this call index - return; - } - - if ($invocation === null) { - throw new ExpectationFailedException( - 'Mocked method does not exist.' - ); - } - - $parameters = $this->parameterGroups[$callIndex]; - - if (count($invocation->getParameters()) < count($parameters)) { - throw new ExpectationFailedException( - sprintf( - 'Parameter count for invocation %s is too low.', - $invocation->toString() - ) - ); - } - - foreach ($parameters as $i => $parameter) { - $parameter->evaluate( - $invocation->getParameters()[$i], - sprintf( - 'Parameter %s for invocation #%d %s does not match expected ' . - 'value.', - $i, - $callIndex, - $invocation->toString() - ) - ); - } - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvocationOrder.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvocationOrder.php deleted file mode 100644 index 90aa493..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvocationOrder.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Rule; - -use function count; -use PHPUnit\Framework\MockObject\Invocation as BaseInvocation; -use PHPUnit\Framework\MockObject\Verifiable; -use PHPUnit\Framework\SelfDescribing; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -abstract class InvocationOrder implements SelfDescribing, Verifiable -{ - /** - * @var BaseInvocation[] - */ - private $invocations = []; - - public function getInvocationCount(): int - { - return count($this->invocations); - } - - public function hasBeenInvoked(): bool - { - return count($this->invocations) > 0; - } - - final public function invoked(BaseInvocation $invocation) - { - $this->invocations[] = $invocation; - - return $this->invokedDo($invocation); - } - - abstract public function matches(BaseInvocation $invocation): bool; - - abstract protected function invokedDo(BaseInvocation $invocation); -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtIndex.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtIndex.php deleted file mode 100644 index 3d8446c..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtIndex.php +++ /dev/null @@ -1,72 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Rule; - -use function sprintf; -use PHPUnit\Framework\ExpectationFailedException; -use PHPUnit\Framework\MockObject\Invocation as BaseInvocation; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -class InvokedAtIndex extends InvocationOrder -{ - /** - * @var int - */ - private $sequenceIndex; - - /** - * @var int - */ - private $currentIndex = -1; - - /** - * @param int $sequenceIndex - */ - public function __construct($sequenceIndex) - { - $this->sequenceIndex = $sequenceIndex; - } - - public function toString(): string - { - return 'invoked at sequence index ' . $this->sequenceIndex; - } - - public function matches(BaseInvocation $invocation): bool - { - $this->currentIndex++; - - return $this->currentIndex == $this->sequenceIndex; - } - - /** - * Verifies that the current expectation is valid. If everything is OK the - * code should just return, if not it must throw an exception. - * - * @throws ExpectationFailedException - */ - public function verify(): void - { - if ($this->currentIndex < $this->sequenceIndex) { - throw new ExpectationFailedException( - sprintf( - 'The expected invocation at index %s was never reached.', - $this->sequenceIndex - ) - ); - } - } - - protected function invokedDo(BaseInvocation $invocation): void - { - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastCount.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastCount.php deleted file mode 100644 index a84aa65..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastCount.php +++ /dev/null @@ -1,64 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Rule; - -use PHPUnit\Framework\ExpectationFailedException; -use PHPUnit\Framework\MockObject\Invocation as BaseInvocation; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class InvokedAtLeastCount extends InvocationOrder -{ - /** - * @var int - */ - private $requiredInvocations; - - /** - * @param int $requiredInvocations - */ - public function __construct($requiredInvocations) - { - $this->requiredInvocations = $requiredInvocations; - } - - public function toString(): string - { - return 'invoked at least ' . $this->requiredInvocations . ' times'; - } - - /** - * Verifies that the current expectation is valid. If everything is OK the - * code should just return, if not it must throw an exception. - * - * @throws ExpectationFailedException - */ - public function verify(): void - { - $count = $this->getInvocationCount(); - - if ($count < $this->requiredInvocations) { - throw new ExpectationFailedException( - 'Expected invocation at least ' . $this->requiredInvocations . - ' times but it occurred ' . $count . ' time(s).' - ); - } - } - - public function matches(BaseInvocation $invocation): bool - { - return true; - } - - protected function invokedDo(BaseInvocation $invocation): void - { - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastOnce.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastOnce.php deleted file mode 100644 index d0ad1f8..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastOnce.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Rule; - -use PHPUnit\Framework\ExpectationFailedException; -use PHPUnit\Framework\MockObject\Invocation as BaseInvocation; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class InvokedAtLeastOnce extends InvocationOrder -{ - public function toString(): string - { - return 'invoked at least once'; - } - - /** - * Verifies that the current expectation is valid. If everything is OK the - * code should just return, if not it must throw an exception. - * - * @throws ExpectationFailedException - */ - public function verify(): void - { - $count = $this->getInvocationCount(); - - if ($count < 1) { - throw new ExpectationFailedException( - 'Expected invocation at least once but it never occurred.' - ); - } - } - - public function matches(BaseInvocation $invocation): bool - { - return true; - } - - protected function invokedDo(BaseInvocation $invocation): void - { - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtMostCount.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtMostCount.php deleted file mode 100644 index c3b815a..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtMostCount.php +++ /dev/null @@ -1,64 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Rule; - -use PHPUnit\Framework\ExpectationFailedException; -use PHPUnit\Framework\MockObject\Invocation as BaseInvocation; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class InvokedAtMostCount extends InvocationOrder -{ - /** - * @var int - */ - private $allowedInvocations; - - /** - * @param int $allowedInvocations - */ - public function __construct($allowedInvocations) - { - $this->allowedInvocations = $allowedInvocations; - } - - public function toString(): string - { - return 'invoked at most ' . $this->allowedInvocations . ' times'; - } - - /** - * Verifies that the current expectation is valid. If everything is OK the - * code should just return, if not it must throw an exception. - * - * @throws ExpectationFailedException - */ - public function verify(): void - { - $count = $this->getInvocationCount(); - - if ($count > $this->allowedInvocations) { - throw new ExpectationFailedException( - 'Expected invocation at most ' . $this->allowedInvocations . - ' times but it occurred ' . $count . ' time(s).' - ); - } - } - - public function matches(BaseInvocation $invocation): bool - { - return true; - } - - protected function invokedDo(BaseInvocation $invocation): void - { - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedCount.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedCount.php deleted file mode 100644 index 188326c..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedCount.php +++ /dev/null @@ -1,102 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Rule; - -use function sprintf; -use PHPUnit\Framework\ExpectationFailedException; -use PHPUnit\Framework\MockObject\Invocation as BaseInvocation; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class InvokedCount extends InvocationOrder -{ - /** - * @var int - */ - private $expectedCount; - - /** - * @param int $expectedCount - */ - public function __construct($expectedCount) - { - $this->expectedCount = $expectedCount; - } - - public function isNever(): bool - { - return $this->expectedCount === 0; - } - - public function toString(): string - { - return 'invoked ' . $this->expectedCount . ' time(s)'; - } - - public function matches(BaseInvocation $invocation): bool - { - return true; - } - - /** - * Verifies that the current expectation is valid. If everything is OK the - * code should just return, if not it must throw an exception. - * - * @throws ExpectationFailedException - */ - public function verify(): void - { - $count = $this->getInvocationCount(); - - if ($count !== $this->expectedCount) { - throw new ExpectationFailedException( - sprintf( - 'Method was expected to be called %d times, ' . - 'actually called %d times.', - $this->expectedCount, - $count - ) - ); - } - } - - /** - * @throws ExpectationFailedException - */ - protected function invokedDo(BaseInvocation $invocation): void - { - $count = $this->getInvocationCount(); - - if ($count > $this->expectedCount) { - $message = $invocation->toString() . ' '; - - switch ($this->expectedCount) { - case 0: - $message .= 'was not expected to be called.'; - - break; - - case 1: - $message .= 'was not expected to be called more than once.'; - - break; - - default: - $message .= sprintf( - 'was not expected to be called more than %d times.', - $this->expectedCount - ); - } - - throw new ExpectationFailedException($message); - } - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/MethodName.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/MethodName.php deleted file mode 100644 index 39fb333..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/MethodName.php +++ /dev/null @@ -1,64 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Rule; - -use function is_string; -use PHPUnit\Framework\Constraint\Constraint; -use PHPUnit\Framework\InvalidArgumentException; -use PHPUnit\Framework\MockObject\Invocation as BaseInvocation; -use PHPUnit\Framework\MockObject\MethodNameConstraint; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class MethodName -{ - /** - * @var Constraint - */ - private $constraint; - - /** - * @param Constraint|string $constraint - * - * @throws InvalidArgumentException - */ - public function __construct($constraint) - { - if (is_string($constraint)) { - $constraint = new MethodNameConstraint($constraint); - } - - if (!$constraint instanceof Constraint) { - throw InvalidArgumentException::create(1, 'PHPUnit\Framework\Constraint\Constraint object or string'); - } - - $this->constraint = $constraint; - } - - public function toString(): string - { - return 'method name ' . $this->constraint->toString(); - } - - /** - * @throws \PHPUnit\Framework\ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function matches(BaseInvocation $invocation): bool - { - return $this->matchesName($invocation->getMethodName()); - } - - public function matchesName(string $methodName): bool - { - return $this->constraint->evaluate($methodName, '', true); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/Parameters.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/Parameters.php deleted file mode 100644 index 3f1cc53..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/Parameters.php +++ /dev/null @@ -1,160 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Rule; - -use function count; -use function get_class; -use function sprintf; -use Exception; -use PHPUnit\Framework\Constraint\Constraint; -use PHPUnit\Framework\Constraint\IsAnything; -use PHPUnit\Framework\Constraint\IsEqual; -use PHPUnit\Framework\ExpectationFailedException; -use PHPUnit\Framework\MockObject\Invocation as BaseInvocation; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Parameters implements ParametersRule -{ - /** - * @var Constraint[] - */ - private $parameters = []; - - /** - * @var BaseInvocation - */ - private $invocation; - - /** - * @var bool|ExpectationFailedException - */ - private $parameterVerificationResult; - - /** - * @throws \PHPUnit\Framework\Exception - */ - public function __construct(array $parameters) - { - foreach ($parameters as $parameter) { - if (!($parameter instanceof Constraint)) { - $parameter = new IsEqual( - $parameter - ); - } - - $this->parameters[] = $parameter; - } - } - - public function toString(): string - { - $text = 'with parameter'; - - foreach ($this->parameters as $index => $parameter) { - if ($index > 0) { - $text .= ' and'; - } - - $text .= ' ' . $index . ' ' . $parameter->toString(); - } - - return $text; - } - - /** - * @throws Exception - */ - public function apply(BaseInvocation $invocation): void - { - $this->invocation = $invocation; - $this->parameterVerificationResult = null; - - try { - $this->parameterVerificationResult = $this->doVerify(); - } catch (ExpectationFailedException $e) { - $this->parameterVerificationResult = $e; - - throw $this->parameterVerificationResult; - } - } - - /** - * Checks if the invocation $invocation matches the current rules. If it - * does the rule will get the invoked() method called which should check - * if an expectation is met. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public function verify(): void - { - $this->doVerify(); - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - private function doVerify(): bool - { - if (isset($this->parameterVerificationResult)) { - return $this->guardAgainstDuplicateEvaluationOfParameterConstraints(); - } - - if ($this->invocation === null) { - throw new ExpectationFailedException('Mocked method does not exist.'); - } - - if (count($this->invocation->getParameters()) < count($this->parameters)) { - $message = 'Parameter count for invocation %s is too low.'; - - // The user called `->with($this->anything())`, but may have meant - // `->withAnyParameters()`. - // - // @see https://github.com/sebastianbergmann/phpunit-mock-objects/issues/199 - if (count($this->parameters) === 1 && - get_class($this->parameters[0]) === IsAnything::class) { - $message .= "\nTo allow 0 or more parameters with any value, omit ->with() or use ->withAnyParameters() instead."; - } - - throw new ExpectationFailedException( - sprintf($message, $this->invocation->toString()) - ); - } - - foreach ($this->parameters as $i => $parameter) { - $parameter->evaluate( - $this->invocation->getParameters()[$i], - sprintf( - 'Parameter %s for invocation %s does not match expected ' . - 'value.', - $i, - $this->invocation->toString() - ) - ); - } - - return true; - } - - /** - * @throws ExpectationFailedException - */ - private function guardAgainstDuplicateEvaluationOfParameterConstraints(): bool - { - if ($this->parameterVerificationResult instanceof ExpectationFailedException) { - throw $this->parameterVerificationResult; - } - - return (bool) $this->parameterVerificationResult; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/ParametersRule.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/ParametersRule.php deleted file mode 100644 index 0c9f191..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/ParametersRule.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Rule; - -use PHPUnit\Framework\ExpectationFailedException; -use PHPUnit\Framework\MockObject\Invocation as BaseInvocation; -use PHPUnit\Framework\MockObject\Verifiable; -use PHPUnit\Framework\SelfDescribing; - -interface ParametersRule extends SelfDescribing, Verifiable -{ - /** - * @throws ExpectationFailedException if the invocation violates the rule - */ - public function apply(BaseInvocation $invocation): void; - - public function verify(): void; -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Stub.php deleted file mode 100644 index f7358af..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use PHPUnit\Framework\MockObject\Builder\InvocationStubber; - -/** - * @method InvocationStubber method($constraint) - */ -interface Stub -{ - public function __phpunit_getInvocationHandler(): InvocationHandler; - - public function __phpunit_hasMatchers(): bool; - - public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration): void; -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ConsecutiveCalls.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ConsecutiveCalls.php deleted file mode 100644 index 0dcf386..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ConsecutiveCalls.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Stub; - -use function array_shift; -use function sprintf; -use PHPUnit\Framework\MockObject\Invocation; -use SebastianBergmann\Exporter\Exporter; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ConsecutiveCalls implements Stub -{ - /** - * @var array - */ - private $stack; - - /** - * @var mixed - */ - private $value; - - public function __construct(array $stack) - { - $this->stack = $stack; - } - - public function invoke(Invocation $invocation) - { - $this->value = array_shift($this->stack); - - if ($this->value instanceof Stub) { - $this->value = $this->value->invoke($invocation); - } - - return $this->value; - } - - public function toString(): string - { - $exporter = new Exporter; - - return sprintf( - 'return user-specified value %s', - $exporter->export($this->value) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/Exception.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/Exception.php deleted file mode 100644 index 5d64c96..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/Exception.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Stub; - -use function sprintf; -use PHPUnit\Framework\MockObject\Invocation; -use SebastianBergmann\Exporter\Exporter; -use Throwable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Exception implements Stub -{ - private $exception; - - public function __construct(Throwable $exception) - { - $this->exception = $exception; - } - - /** - * @throws Throwable - */ - public function invoke(Invocation $invocation): void - { - throw $this->exception; - } - - public function toString(): string - { - $exporter = new Exporter; - - return sprintf( - 'raise user-specified exception %s', - $exporter->export($this->exception) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnArgument.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnArgument.php deleted file mode 100644 index c7b3f8f..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnArgument.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Stub; - -use function sprintf; -use PHPUnit\Framework\MockObject\Invocation; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ReturnArgument implements Stub -{ - /** - * @var int - */ - private $argumentIndex; - - public function __construct($argumentIndex) - { - $this->argumentIndex = $argumentIndex; - } - - public function invoke(Invocation $invocation) - { - if (isset($invocation->getParameters()[$this->argumentIndex])) { - return $invocation->getParameters()[$this->argumentIndex]; - } - } - - public function toString(): string - { - return sprintf('return argument #%d', $this->argumentIndex); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnCallback.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnCallback.php deleted file mode 100644 index e02181e..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnCallback.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Stub; - -use function call_user_func_array; -use function get_class; -use function is_array; -use function is_object; -use function sprintf; -use PHPUnit\Framework\MockObject\Invocation; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ReturnCallback implements Stub -{ - private $callback; - - public function __construct($callback) - { - $this->callback = $callback; - } - - public function invoke(Invocation $invocation) - { - return call_user_func_array($this->callback, $invocation->getParameters()); - } - - public function toString(): string - { - if (is_array($this->callback)) { - if (is_object($this->callback[0])) { - $class = get_class($this->callback[0]); - $type = '->'; - } else { - $class = $this->callback[0]; - $type = '::'; - } - - return sprintf( - 'return result of user defined callback %s%s%s() with the ' . - 'passed arguments', - $class, - $type, - $this->callback[1] - ); - } - - return 'return result of user defined callback ' . $this->callback . - ' with the passed arguments'; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnReference.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnReference.php deleted file mode 100644 index 0d288ce..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnReference.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Stub; - -use function sprintf; -use PHPUnit\Framework\MockObject\Invocation; -use SebastianBergmann\Exporter\Exporter; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ReturnReference implements Stub -{ - /** - * @var mixed - */ - private $reference; - - public function __construct(&$reference) - { - $this->reference = &$reference; - } - - public function invoke(Invocation $invocation) - { - return $this->reference; - } - - public function toString(): string - { - $exporter = new Exporter; - - return sprintf( - 'return user-specified reference %s', - $exporter->export($this->reference) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnSelf.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnSelf.php deleted file mode 100644 index 6d2137b..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnSelf.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Stub; - -use PHPUnit\Framework\MockObject\Invocation; -use PHPUnit\Framework\MockObject\RuntimeException; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ReturnSelf implements Stub -{ - /** - * @throws RuntimeException - */ - public function invoke(Invocation $invocation) - { - return $invocation->getObject(); - } - - public function toString(): string - { - return 'return the current object'; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnStub.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnStub.php deleted file mode 100644 index fbcd0a0..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnStub.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Stub; - -use function sprintf; -use PHPUnit\Framework\MockObject\Invocation; -use SebastianBergmann\Exporter\Exporter; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ReturnStub implements Stub -{ - /** - * @var mixed - */ - private $value; - - public function __construct($value) - { - $this->value = $value; - } - - public function invoke(Invocation $invocation) - { - return $this->value; - } - - public function toString(): string - { - $exporter = new Exporter; - - return sprintf( - 'return user-specified value %s', - $exporter->export($this->value) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnValueMap.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnValueMap.php deleted file mode 100644 index 5fcd3a0..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnValueMap.php +++ /dev/null @@ -1,53 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Stub; - -use function array_pop; -use function count; -use function is_array; -use PHPUnit\Framework\MockObject\Invocation; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ReturnValueMap implements Stub -{ - /** - * @var array - */ - private $valueMap; - - public function __construct(array $valueMap) - { - $this->valueMap = $valueMap; - } - - public function invoke(Invocation $invocation) - { - $parameterCount = count($invocation->getParameters()); - - foreach ($this->valueMap as $map) { - if (!is_array($map) || $parameterCount !== (count($map) - 1)) { - continue; - } - - $return = array_pop($map); - - if ($invocation->getParameters() === $map) { - return $return; - } - } - } - - public function toString(): string - { - return 'return value from a map'; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/Stub.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/Stub.php deleted file mode 100644 index 15cfce5..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/Stub.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Stub; - -use PHPUnit\Framework\MockObject\Invocation; -use PHPUnit\Framework\SelfDescribing; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -interface Stub extends SelfDescribing -{ - /** - * Fakes the processing of the invocation $invocation by returning a - * specific value. - * - * @param Invocation $invocation The invocation which was mocked and matched by the current method and argument matchers - */ - public function invoke(Invocation $invocation); -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Verifiable.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Verifiable.php deleted file mode 100644 index 8c9a82c..0000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Verifiable.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use PHPUnit\Framework\ExpectationFailedException; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -interface Verifiable -{ - /** - * Verifies that the current expectation is valid. If everything is OK the - * code should just return, if not it must throw an exception. - * - * @throws ExpectationFailedException - */ - public function verify(): void; -} diff --git a/vendor/phpunit/phpunit/src/Framework/SelfDescribing.php b/vendor/phpunit/phpunit/src/Framework/SelfDescribing.php deleted file mode 100644 index 73034f6..0000000 --- a/vendor/phpunit/phpunit/src/Framework/SelfDescribing.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -interface SelfDescribing -{ - /** - * Returns a string representation of the object. - */ - public function toString(): string; -} diff --git a/vendor/phpunit/phpunit/src/Framework/SkippedTest.php b/vendor/phpunit/phpunit/src/Framework/SkippedTest.php deleted file mode 100644 index c5ac84e..0000000 --- a/vendor/phpunit/phpunit/src/Framework/SkippedTest.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -interface SkippedTest -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/SkippedTestCase.php b/vendor/phpunit/phpunit/src/Framework/SkippedTestCase.php deleted file mode 100644 index 51c0061..0000000 --- a/vendor/phpunit/phpunit/src/Framework/SkippedTestCase.php +++ /dev/null @@ -1,66 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class SkippedTestCase extends TestCase -{ - /** - * @var bool - */ - protected $backupGlobals = false; - - /** - * @var bool - */ - protected $backupStaticAttributes = false; - - /** - * @var bool - */ - protected $runTestInSeparateProcess = false; - - /** - * @var string - */ - private $message; - - public function __construct(string $className, string $methodName, string $message = '') - { - parent::__construct($className . '::' . $methodName); - - $this->message = $message; - } - - public function getMessage(): string - { - return $this->message; - } - - /** - * Returns a string representation of the test case. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function toString(): string - { - return $this->getName(); - } - - /** - * @throws Exception - */ - protected function runTest(): void - { - $this->markTestSkipped($this->message); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Test.php b/vendor/phpunit/phpunit/src/Framework/Test.php deleted file mode 100644 index 7740afc..0000000 --- a/vendor/phpunit/phpunit/src/Framework/Test.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -use Countable; - -/** - * A Test can be run and collect its results. - */ -interface Test extends Countable -{ - /** - * Runs a test and collects its result in a TestResult instance. - */ - public function run(TestResult $result = null): TestResult; -} diff --git a/vendor/phpunit/phpunit/src/Framework/TestBuilder.php b/vendor/phpunit/phpunit/src/Framework/TestBuilder.php deleted file mode 100644 index 583a9f2..0000000 --- a/vendor/phpunit/phpunit/src/Framework/TestBuilder.php +++ /dev/null @@ -1,239 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -use function assert; -use function count; -use function get_class; -use function sprintf; -use function trim; -use PHPUnit\Util\Filter; -use PHPUnit\Util\InvalidDataSetException; -use PHPUnit\Util\Test as TestUtil; -use ReflectionClass; -use Throwable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class TestBuilder -{ - public function build(ReflectionClass $theClass, string $methodName): Test - { - $className = $theClass->getName(); - - if (!$theClass->isInstantiable()) { - return new WarningTestCase( - sprintf('Cannot instantiate class "%s".', $className) - ); - } - - $backupSettings = TestUtil::getBackupSettings( - $className, - $methodName - ); - - $preserveGlobalState = TestUtil::getPreserveGlobalStateSettings( - $className, - $methodName - ); - - $runTestInSeparateProcess = TestUtil::getProcessIsolationSettings( - $className, - $methodName - ); - - $runClassInSeparateProcess = TestUtil::getClassProcessIsolationSettings( - $className, - $methodName - ); - - $constructor = $theClass->getConstructor(); - - if ($constructor === null) { - throw new Exception('No valid test provided.'); - } - - $parameters = $constructor->getParameters(); - - // TestCase() or TestCase($name) - if (count($parameters) < 2) { - $test = $this->buildTestWithoutData($className); - } // TestCase($name, $data) - else { - try { - $data = TestUtil::getProvidedData( - $className, - $methodName - ); - } catch (IncompleteTestError $e) { - $message = sprintf( - "Test for %s::%s marked incomplete by data provider\n%s", - $className, - $methodName, - $this->throwableToString($e) - ); - - $data = new IncompleteTestCase($className, $methodName, $message); - } catch (SkippedTestError $e) { - $message = sprintf( - "Test for %s::%s skipped by data provider\n%s", - $className, - $methodName, - $this->throwableToString($e) - ); - - $data = new SkippedTestCase($className, $methodName, $message); - } catch (Throwable $t) { - $message = sprintf( - "The data provider specified for %s::%s is invalid.\n%s", - $className, - $methodName, - $this->throwableToString($t) - ); - - $data = new WarningTestCase($message); - } - - // Test method with @dataProvider. - if (isset($data)) { - $test = $this->buildDataProviderTestSuite( - $methodName, - $className, - $data, - $runTestInSeparateProcess, - $preserveGlobalState, - $runClassInSeparateProcess, - $backupSettings - ); - } else { - $test = $this->buildTestWithoutData($className); - } - } - - if ($test instanceof TestCase) { - $test->setName($methodName); - $this->configureTestCase( - $test, - $runTestInSeparateProcess, - $preserveGlobalState, - $runClassInSeparateProcess, - $backupSettings - ); - } - - return $test; - } - - /** @psalm-param class-string $className */ - private function buildTestWithoutData(string $className) - { - return new $className; - } - - /** @psalm-param class-string $className */ - private function buildDataProviderTestSuite( - string $methodName, - string $className, - $data, - bool $runTestInSeparateProcess, - ?bool $preserveGlobalState, - bool $runClassInSeparateProcess, - array $backupSettings - ): DataProviderTestSuite { - $dataProviderTestSuite = new DataProviderTestSuite( - $className . '::' . $methodName - ); - - $groups = TestUtil::getGroups($className, $methodName); - - if ($data instanceof WarningTestCase || - $data instanceof SkippedTestCase || - $data instanceof IncompleteTestCase) { - $dataProviderTestSuite->addTest($data, $groups); - } else { - foreach ($data as $_dataName => $_data) { - $_test = new $className($methodName, $_data, $_dataName); - - assert($_test instanceof TestCase); - - $this->configureTestCase( - $_test, - $runTestInSeparateProcess, - $preserveGlobalState, - $runClassInSeparateProcess, - $backupSettings - ); - - $dataProviderTestSuite->addTest($_test, $groups); - } - } - - return $dataProviderTestSuite; - } - - private function configureTestCase( - TestCase $test, - bool $runTestInSeparateProcess, - ?bool $preserveGlobalState, - bool $runClassInSeparateProcess, - array $backupSettings - ): void { - if ($runTestInSeparateProcess) { - $test->setRunTestInSeparateProcess(true); - - if ($preserveGlobalState !== null) { - $test->setPreserveGlobalState($preserveGlobalState); - } - } - - if ($runClassInSeparateProcess) { - $test->setRunClassInSeparateProcess(true); - - if ($preserveGlobalState !== null) { - $test->setPreserveGlobalState($preserveGlobalState); - } - } - - if ($backupSettings['backupGlobals'] !== null) { - $test->setBackupGlobals($backupSettings['backupGlobals']); - } - - if ($backupSettings['backupStaticAttributes'] !== null) { - $test->setBackupStaticAttributes( - $backupSettings['backupStaticAttributes'] - ); - } - } - - private function throwableToString(Throwable $t): string - { - $message = $t->getMessage(); - - if (empty(trim($message))) { - $message = ''; - } - - if ($t instanceof InvalidDataSetException) { - return sprintf( - "%s\n%s", - $message, - Filter::getFilteredStacktrace($t) - ); - } - - return sprintf( - "%s: %s\n%s", - get_class($t), - $message, - Filter::getFilteredStacktrace($t) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/TestCase.php b/vendor/phpunit/phpunit/src/Framework/TestCase.php deleted file mode 100644 index 3b76cde..0000000 --- a/vendor/phpunit/phpunit/src/Framework/TestCase.php +++ /dev/null @@ -1,2594 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -use const LC_ALL; -use const LC_COLLATE; -use const LC_CTYPE; -use const LC_MESSAGES; -use const LC_MONETARY; -use const LC_NUMERIC; -use const LC_TIME; -use const PATHINFO_FILENAME; -use const PHP_EOL; -use const PHP_URL_PATH; -use function array_filter; -use function array_flip; -use function array_keys; -use function array_merge; -use function array_unique; -use function array_values; -use function assert; -use function basename; -use function call_user_func; -use function chdir; -use function class_exists; -use function clearstatcache; -use function count; -use function defined; -use function explode; -use function get_class; -use function get_include_path; -use function getcwd; -use function implode; -use function in_array; -use function ini_set; -use function is_array; -use function is_int; -use function is_object; -use function is_string; -use function libxml_clear_errors; -use function method_exists; -use function ob_end_clean; -use function ob_get_contents; -use function ob_get_level; -use function ob_start; -use function parse_url; -use function pathinfo; -use function preg_replace; -use function serialize; -use function setlocale; -use function sprintf; -use function strlen; -use function strpos; -use function substr; -use function trim; -use function var_export; -use DeepCopy\DeepCopy; -use PHPUnit\Framework\Constraint\Exception as ExceptionConstraint; -use PHPUnit\Framework\Constraint\ExceptionCode; -use PHPUnit\Framework\Constraint\ExceptionMessage; -use PHPUnit\Framework\Constraint\ExceptionMessageRegularExpression; -use PHPUnit\Framework\Constraint\LogicalOr; -use PHPUnit\Framework\Error\Deprecated; -use PHPUnit\Framework\Error\Error; -use PHPUnit\Framework\Error\Notice; -use PHPUnit\Framework\Error\Warning as WarningError; -use PHPUnit\Framework\MockObject\Generator as MockGenerator; -use PHPUnit\Framework\MockObject\MockBuilder; -use PHPUnit\Framework\MockObject\MockObject; -use PHPUnit\Framework\MockObject\Rule\AnyInvokedCount as AnyInvokedCountMatcher; -use PHPUnit\Framework\MockObject\Rule\InvokedAtIndex as InvokedAtIndexMatcher; -use PHPUnit\Framework\MockObject\Rule\InvokedAtLeastCount as InvokedAtLeastCountMatcher; -use PHPUnit\Framework\MockObject\Rule\InvokedAtLeastOnce as InvokedAtLeastOnceMatcher; -use PHPUnit\Framework\MockObject\Rule\InvokedAtMostCount as InvokedAtMostCountMatcher; -use PHPUnit\Framework\MockObject\Rule\InvokedCount as InvokedCountMatcher; -use PHPUnit\Framework\MockObject\Stub; -use PHPUnit\Framework\MockObject\Stub\ConsecutiveCalls as ConsecutiveCallsStub; -use PHPUnit\Framework\MockObject\Stub\Exception as ExceptionStub; -use PHPUnit\Framework\MockObject\Stub\ReturnArgument as ReturnArgumentStub; -use PHPUnit\Framework\MockObject\Stub\ReturnCallback as ReturnCallbackStub; -use PHPUnit\Framework\MockObject\Stub\ReturnSelf as ReturnSelfStub; -use PHPUnit\Framework\MockObject\Stub\ReturnStub; -use PHPUnit\Framework\MockObject\Stub\ReturnValueMap as ReturnValueMapStub; -use PHPUnit\Runner\BaseTestRunner; -use PHPUnit\Runner\PhptTestCase; -use PHPUnit\Util\Exception as UtilException; -use PHPUnit\Util\GlobalState; -use PHPUnit\Util\PHP\AbstractPhpProcess; -use PHPUnit\Util\Test as TestUtil; -use PHPUnit\Util\Type; -use Prophecy\Exception\Prediction\PredictionException; -use Prophecy\Prophecy\MethodProphecy; -use Prophecy\Prophecy\ObjectProphecy; -use Prophecy\Prophet; -use ReflectionClass; -use ReflectionException; -use SebastianBergmann\Comparator\Comparator; -use SebastianBergmann\Comparator\Factory as ComparatorFactory; -use SebastianBergmann\Diff\Differ; -use SebastianBergmann\Exporter\Exporter; -use SebastianBergmann\GlobalState\Blacklist; -use SebastianBergmann\GlobalState\Restorer; -use SebastianBergmann\GlobalState\Snapshot; -use SebastianBergmann\ObjectEnumerator\Enumerator; -use Text_Template; -use Throwable; - -abstract class TestCase extends Assert implements SelfDescribing, Test -{ - private const LOCALE_CATEGORIES = [LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY, LC_NUMERIC, LC_TIME]; - - /** - * @var ?bool - */ - protected $backupGlobals; - - /** - * @var string[] - */ - protected $backupGlobalsBlacklist = []; - - /** - * @var bool - */ - protected $backupStaticAttributes; - - /** - * @var array> - */ - protected $backupStaticAttributesBlacklist = []; - - /** - * @var bool - */ - protected $runTestInSeparateProcess; - - /** - * @var bool - */ - protected $preserveGlobalState = true; - - /** - * @var bool - */ - private $runClassInSeparateProcess; - - /** - * @var bool - */ - private $inIsolation = false; - - /** - * @var array - */ - private $data; - - /** - * @var string - */ - private $dataName; - - /** - * @var null|string - */ - private $expectedException; - - /** - * @var null|string - */ - private $expectedExceptionMessage; - - /** - * @var null|string - */ - private $expectedExceptionMessageRegExp; - - /** - * @var null|int|string - */ - private $expectedExceptionCode; - - /** - * @var string - */ - private $name = ''; - - /** - * @var string[] - */ - private $dependencies = []; - - /** - * @var array - */ - private $dependencyInput = []; - - /** - * @var array - */ - private $iniSettings = []; - - /** - * @var array - */ - private $locale = []; - - /** - * @var MockObject[] - */ - private $mockObjects = []; - - /** - * @var MockGenerator - */ - private $mockObjectGenerator; - - /** - * @var int - */ - private $status = BaseTestRunner::STATUS_UNKNOWN; - - /** - * @var string - */ - private $statusMessage = ''; - - /** - * @var int - */ - private $numAssertions = 0; - - /** - * @var TestResult - */ - private $result; - - /** - * @var mixed - */ - private $testResult; - - /** - * @var string - */ - private $output = ''; - - /** - * @var string - */ - private $outputExpectedRegex; - - /** - * @var string - */ - private $outputExpectedString; - - /** - * @var mixed - */ - private $outputCallback = false; - - /** - * @var bool - */ - private $outputBufferingActive = false; - - /** - * @var int - */ - private $outputBufferingLevel; - - /** - * @var bool - */ - private $outputRetrievedForAssertion = false; - - /** - * @var Snapshot - */ - private $snapshot; - - /** - * @var \Prophecy\Prophet - */ - private $prophet; - - /** - * @var bool - */ - private $beStrictAboutChangesToGlobalState = false; - - /** - * @var bool - */ - private $registerMockObjectsFromTestArgumentsRecursively = false; - - /** - * @var string[] - */ - private $warnings = []; - - /** - * @var string[] - */ - private $groups = []; - - /** - * @var bool - */ - private $doesNotPerformAssertions = false; - - /** - * @var Comparator[] - */ - private $customComparators = []; - - /** - * @var string[] - */ - private $doubledTypes = []; - - /** - * @var bool - */ - private $deprecatedExpectExceptionMessageRegExpUsed = false; - - /** - * Returns a matcher that matches when the method is executed - * zero or more times. - */ - public static function any(): AnyInvokedCountMatcher - { - return new AnyInvokedCountMatcher; - } - - /** - * Returns a matcher that matches when the method is never executed. - */ - public static function never(): InvokedCountMatcher - { - return new InvokedCountMatcher(0); - } - - /** - * Returns a matcher that matches when the method is executed - * at least N times. - */ - public static function atLeast(int $requiredInvocations): InvokedAtLeastCountMatcher - { - return new InvokedAtLeastCountMatcher( - $requiredInvocations - ); - } - - /** - * Returns a matcher that matches when the method is executed at least once. - */ - public static function atLeastOnce(): InvokedAtLeastOnceMatcher - { - return new InvokedAtLeastOnceMatcher; - } - - /** - * Returns a matcher that matches when the method is executed exactly once. - */ - public static function once(): InvokedCountMatcher - { - return new InvokedCountMatcher(1); - } - - /** - * Returns a matcher that matches when the method is executed - * exactly $count times. - */ - public static function exactly(int $count): InvokedCountMatcher - { - return new InvokedCountMatcher($count); - } - - /** - * Returns a matcher that matches when the method is executed - * at most N times. - */ - public static function atMost(int $allowedInvocations): InvokedAtMostCountMatcher - { - return new InvokedAtMostCountMatcher($allowedInvocations); - } - - /** - * Returns a matcher that matches when the method is executed - * at the given index. - */ - public static function at(int $index): InvokedAtIndexMatcher - { - return new InvokedAtIndexMatcher($index); - } - - public static function returnValue($value): ReturnStub - { - return new ReturnStub($value); - } - - public static function returnValueMap(array $valueMap): ReturnValueMapStub - { - return new ReturnValueMapStub($valueMap); - } - - public static function returnArgument(int $argumentIndex): ReturnArgumentStub - { - return new ReturnArgumentStub($argumentIndex); - } - - public static function returnCallback($callback): ReturnCallbackStub - { - return new ReturnCallbackStub($callback); - } - - /** - * Returns the current object. - * - * This method is useful when mocking a fluent interface. - */ - public static function returnSelf(): ReturnSelfStub - { - return new ReturnSelfStub; - } - - public static function throwException(Throwable $exception): ExceptionStub - { - return new ExceptionStub($exception); - } - - public static function onConsecutiveCalls(...$args): ConsecutiveCallsStub - { - return new ConsecutiveCallsStub($args); - } - - /** - * @param string $name - * @param string $dataName - * - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function __construct($name = null, array $data = [], $dataName = '') - { - if ($name !== null) { - $this->setName($name); - } - - $this->data = $data; - $this->dataName = $dataName; - } - - /** - * This method is called before the first test of this test class is run. - */ - public static function setUpBeforeClass(): void - { - } - - /** - * This method is called after the last test of this test class is run. - */ - public static function tearDownAfterClass(): void - { - } - - /** - * This method is called before each test. - */ - protected function setUp(): void - { - } - - /** - * Performs assertions shared by all tests of a test case. - * - * This method is called between setUp() and test. - */ - protected function assertPreConditions(): void - { - } - - /** - * Performs assertions shared by all tests of a test case. - * - * This method is called between test and tearDown(). - */ - protected function assertPostConditions(): void - { - } - - /** - * This method is called after each test. - */ - protected function tearDown(): void - { - } - - /** - * Returns a string representation of the test case. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - */ - public function toString(): string - { - try { - $class = new ReflectionClass($this); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - $buffer = sprintf( - '%s::%s', - $class->name, - $this->getName(false) - ); - - return $buffer . $this->getDataSetAsString(); - } - - public function count(): int - { - return 1; - } - - public function getActualOutputForAssertion(): string - { - $this->outputRetrievedForAssertion = true; - - return $this->getActualOutput(); - } - - public function expectOutputRegex(string $expectedRegex): void - { - $this->outputExpectedRegex = $expectedRegex; - } - - public function expectOutputString(string $expectedString): void - { - $this->outputExpectedString = $expectedString; - } - - /** - * @psalm-param class-string<\Throwable> $exception - */ - public function expectException(string $exception): void - { - $this->expectedException = $exception; - } - - /** - * @param int|string $code - */ - public function expectExceptionCode($code): void - { - $this->expectedExceptionCode = $code; - } - - public function expectExceptionMessage(string $message): void - { - $this->expectedExceptionMessage = $message; - } - - public function expectExceptionMessageMatches(string $regularExpression): void - { - $this->expectedExceptionMessageRegExp = $regularExpression; - } - - /** - * @deprecated Use expectExceptionMessageMatches() instead - */ - public function expectExceptionMessageRegExp(string $regularExpression): void - { - $this->deprecatedExpectExceptionMessageRegExpUsed = true; - - $this->expectExceptionMessageMatches($regularExpression); - } - - /** - * Sets up an expectation for an exception to be raised by the code under test. - * Information for expected exception class, expected exception message, and - * expected exception code are retrieved from a given Exception object. - */ - public function expectExceptionObject(\Exception $exception): void - { - $this->expectException(get_class($exception)); - $this->expectExceptionMessage($exception->getMessage()); - $this->expectExceptionCode($exception->getCode()); - } - - public function expectNotToPerformAssertions(): void - { - $this->doesNotPerformAssertions = true; - } - - public function expectDeprecation(): void - { - $this->expectException(Deprecated::class); - } - - public function expectDeprecationMessage(string $message): void - { - $this->expectExceptionMessage($message); - } - - public function expectDeprecationMessageMatches(string $regularExpression): void - { - $this->expectExceptionMessageMatches($regularExpression); - } - - public function expectNotice(): void - { - $this->expectException(Notice::class); - } - - public function expectNoticeMessage(string $message): void - { - $this->expectExceptionMessage($message); - } - - public function expectNoticeMessageMatches(string $regularExpression): void - { - $this->expectExceptionMessageMatches($regularExpression); - } - - public function expectWarning(): void - { - $this->expectException(WarningError::class); - } - - public function expectWarningMessage(string $message): void - { - $this->expectExceptionMessage($message); - } - - public function expectWarningMessageMatches(string $regularExpression): void - { - $this->expectExceptionMessageMatches($regularExpression); - } - - public function expectError(): void - { - $this->expectException(Error::class); - } - - public function expectErrorMessage(string $message): void - { - $this->expectExceptionMessage($message); - } - - public function expectErrorMessageMatches(string $regularExpression): void - { - $this->expectExceptionMessageMatches($regularExpression); - } - - public function getStatus(): int - { - return $this->status; - } - - public function markAsRisky(): void - { - $this->status = BaseTestRunner::STATUS_RISKY; - } - - public function getStatusMessage(): string - { - return $this->statusMessage; - } - - public function hasFailed(): bool - { - $status = $this->getStatus(); - - return $status === BaseTestRunner::STATUS_FAILURE || $status === BaseTestRunner::STATUS_ERROR; - } - - /** - * Runs the test case and collects the results in a TestResult object. - * If no TestResult object is passed a new one will be created. - * - * @throws \SebastianBergmann\CodeCoverage\CoveredCodeNotExecutedException - * @throws \SebastianBergmann\CodeCoverage\InvalidArgumentException - * @throws \SebastianBergmann\CodeCoverage\MissingCoversAnnotationException - * @throws \SebastianBergmann\CodeCoverage\RuntimeException - * @throws \SebastianBergmann\CodeCoverage\UnintentionallyCoveredCodeException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws CodeCoverageException - * @throws UtilException - */ - public function run(TestResult $result = null): TestResult - { - if ($result === null) { - $result = $this->createResult(); - } - - if (!$this instanceof WarningTestCase) { - $this->setTestResultObject($result); - } - - if (!$this instanceof WarningTestCase && - !$this instanceof SkippedTestCase && - !$this->handleDependencies()) { - return $result; - } - - if ($this->runInSeparateProcess()) { - $runEntireClass = $this->runClassInSeparateProcess && !$this->runTestInSeparateProcess; - - try { - $class = new ReflectionClass($this); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - if ($runEntireClass) { - $template = new Text_Template( - __DIR__ . '/../Util/PHP/Template/TestCaseClass.tpl' - ); - } else { - $template = new Text_Template( - __DIR__ . '/../Util/PHP/Template/TestCaseMethod.tpl' - ); - } - - if ($this->preserveGlobalState) { - $constants = GlobalState::getConstantsAsString(); - $globals = GlobalState::getGlobalsAsString(); - $includedFiles = GlobalState::getIncludedFilesAsString(); - $iniSettings = GlobalState::getIniSettingsAsString(); - } else { - $constants = ''; - - if (!empty($GLOBALS['__PHPUNIT_BOOTSTRAP'])) { - $globals = '$GLOBALS[\'__PHPUNIT_BOOTSTRAP\'] = ' . var_export($GLOBALS['__PHPUNIT_BOOTSTRAP'], true) . ";\n"; - } else { - $globals = ''; - } - - $includedFiles = ''; - $iniSettings = ''; - } - - $coverage = $result->getCollectCodeCoverageInformation() ? 'true' : 'false'; - $isStrictAboutTestsThatDoNotTestAnything = $result->isStrictAboutTestsThatDoNotTestAnything() ? 'true' : 'false'; - $isStrictAboutOutputDuringTests = $result->isStrictAboutOutputDuringTests() ? 'true' : 'false'; - $enforcesTimeLimit = $result->enforcesTimeLimit() ? 'true' : 'false'; - $isStrictAboutTodoAnnotatedTests = $result->isStrictAboutTodoAnnotatedTests() ? 'true' : 'false'; - $isStrictAboutResourceUsageDuringSmallTests = $result->isStrictAboutResourceUsageDuringSmallTests() ? 'true' : 'false'; - - if (defined('PHPUNIT_COMPOSER_INSTALL')) { - $composerAutoload = var_export(PHPUNIT_COMPOSER_INSTALL, true); - } else { - $composerAutoload = '\'\''; - } - - if (defined('__PHPUNIT_PHAR__')) { - $phar = var_export(__PHPUNIT_PHAR__, true); - } else { - $phar = '\'\''; - } - - if ($result->getCodeCoverage()) { - $codeCoverageFilter = $result->getCodeCoverage()->filter(); - } else { - $codeCoverageFilter = null; - } - - $data = var_export(serialize($this->data), true); - $dataName = var_export($this->dataName, true); - $dependencyInput = var_export(serialize($this->dependencyInput), true); - $includePath = var_export(get_include_path(), true); - $codeCoverageFilter = var_export(serialize($codeCoverageFilter), true); - // must do these fixes because TestCaseMethod.tpl has unserialize('{data}') in it, and we can't break BC - // the lines above used to use addcslashes() rather than var_export(), which breaks null byte escape sequences - $data = "'." . $data . ".'"; - $dataName = "'.(" . $dataName . ").'"; - $dependencyInput = "'." . $dependencyInput . ".'"; - $includePath = "'." . $includePath . ".'"; - $codeCoverageFilter = "'." . $codeCoverageFilter . ".'"; - - $configurationFilePath = $GLOBALS['__PHPUNIT_CONFIGURATION_FILE'] ?? ''; - - $var = [ - 'composerAutoload' => $composerAutoload, - 'phar' => $phar, - 'filename' => $class->getFileName(), - 'className' => $class->getName(), - 'collectCodeCoverageInformation' => $coverage, - 'data' => $data, - 'dataName' => $dataName, - 'dependencyInput' => $dependencyInput, - 'constants' => $constants, - 'globals' => $globals, - 'include_path' => $includePath, - 'included_files' => $includedFiles, - 'iniSettings' => $iniSettings, - 'isStrictAboutTestsThatDoNotTestAnything' => $isStrictAboutTestsThatDoNotTestAnything, - 'isStrictAboutOutputDuringTests' => $isStrictAboutOutputDuringTests, - 'enforcesTimeLimit' => $enforcesTimeLimit, - 'isStrictAboutTodoAnnotatedTests' => $isStrictAboutTodoAnnotatedTests, - 'isStrictAboutResourceUsageDuringSmallTests' => $isStrictAboutResourceUsageDuringSmallTests, - 'codeCoverageFilter' => $codeCoverageFilter, - 'configurationFilePath' => $configurationFilePath, - 'name' => $this->getName(false), - ]; - - if (!$runEntireClass) { - $var['methodName'] = $this->name; - } - - $template->setVar($var); - - $php = AbstractPhpProcess::factory(); - $php->runTestJob($template->render(), $this, $result); - } else { - $result->run($this); - } - - $this->result = null; - - return $result; - } - - /** - * Returns a builder object to create mock objects using a fluent interface. - * - * @param string|string[] $className - * - * @psalm-template RealInstanceType of object - * @psalm-param class-string|string[] $className - * @psalm-return MockBuilder - */ - public function getMockBuilder($className): MockBuilder - { - if (!is_string($className)) { - $this->addWarning('Passing an array of interface names to getMockBuilder() for creating a test double that implements multiple interfaces is deprecated and will no longer be supported in PHPUnit 9.'); - } - - $this->recordDoubledType($className); - - return new MockBuilder($this, $className); - } - - public function registerComparator(Comparator $comparator): void - { - ComparatorFactory::getInstance()->register($comparator); - - $this->customComparators[] = $comparator; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - * - * @deprecated Invoking this method has no effect; it will be removed in PHPUnit 9 - */ - public function setUseErrorHandler(bool $useErrorHandler): void - { - } - - /** - * @return string[] - * - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function doubledTypes(): array - { - return array_unique($this->doubledTypes); - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function getGroups(): array - { - return $this->groups; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function setGroups(array $groups): void - { - $this->groups = $groups; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function getAnnotations(): array - { - return TestUtil::parseTestMethodAnnotations( - static::class, - $this->name - ); - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function getName(bool $withDataSet = true): string - { - if ($withDataSet) { - return $this->name . $this->getDataSetAsString(false); - } - - return $this->name; - } - - /** - * Returns the size of the test. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function getSize(): int - { - return TestUtil::getSize( - static::class, - $this->getName(false) - ); - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function hasSize(): bool - { - return $this->getSize() !== TestUtil::UNKNOWN; - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function isSmall(): bool - { - return $this->getSize() === TestUtil::SMALL; - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function isMedium(): bool - { - return $this->getSize() === TestUtil::MEDIUM; - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function isLarge(): bool - { - return $this->getSize() === TestUtil::LARGE; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function getActualOutput(): string - { - if (!$this->outputBufferingActive) { - return $this->output; - } - - return (string) ob_get_contents(); - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function hasOutput(): bool - { - if ($this->output === '') { - return false; - } - - if ($this->hasExpectationOnOutput()) { - return false; - } - - return true; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function doesNotPerformAssertions(): bool - { - return $this->doesNotPerformAssertions; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function hasExpectationOnOutput(): bool - { - return is_string($this->outputExpectedString) || is_string($this->outputExpectedRegex) || $this->outputRetrievedForAssertion; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function getExpectedException(): ?string - { - return $this->expectedException; - } - - /** - * @return null|int|string - * - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function getExpectedExceptionCode() - { - return $this->expectedExceptionCode; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function getExpectedExceptionMessage(): ?string - { - return $this->expectedExceptionMessage; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function getExpectedExceptionMessageRegExp(): ?string - { - return $this->expectedExceptionMessageRegExp; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function setRegisterMockObjectsFromTestArgumentsRecursively(bool $flag): void - { - $this->registerMockObjectsFromTestArgumentsRecursively = $flag; - } - - /** - * @throws Throwable - * - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function runBare(): void - { - $this->numAssertions = 0; - - $this->snapshotGlobalState(); - $this->startOutputBuffering(); - clearstatcache(); - $currentWorkingDirectory = getcwd(); - - $hookMethods = TestUtil::getHookMethods(static::class); - - $hasMetRequirements = false; - - try { - $this->checkRequirements(); - $hasMetRequirements = true; - - if ($this->inIsolation) { - foreach ($hookMethods['beforeClass'] as $method) { - $this->{$method}(); - } - } - - $this->setExpectedExceptionFromAnnotation(); - $this->setDoesNotPerformAssertionsFromAnnotation(); - - foreach ($hookMethods['before'] as $method) { - $this->{$method}(); - } - - $this->assertPreConditions(); - $this->testResult = $this->runTest(); - $this->verifyMockObjects(); - $this->assertPostConditions(); - - if (!empty($this->warnings)) { - throw new Warning( - implode( - "\n", - array_unique($this->warnings) - ) - ); - } - - $this->status = BaseTestRunner::STATUS_PASSED; - } catch (IncompleteTest $e) { - $this->status = BaseTestRunner::STATUS_INCOMPLETE; - $this->statusMessage = $e->getMessage(); - } catch (SkippedTest $e) { - $this->status = BaseTestRunner::STATUS_SKIPPED; - $this->statusMessage = $e->getMessage(); - } catch (Warning $e) { - $this->status = BaseTestRunner::STATUS_WARNING; - $this->statusMessage = $e->getMessage(); - } catch (AssertionFailedError $e) { - $this->status = BaseTestRunner::STATUS_FAILURE; - $this->statusMessage = $e->getMessage(); - } catch (PredictionException $e) { - $this->status = BaseTestRunner::STATUS_FAILURE; - $this->statusMessage = $e->getMessage(); - } catch (Throwable $_e) { - $e = $_e; - $this->status = BaseTestRunner::STATUS_ERROR; - $this->statusMessage = $_e->getMessage(); - } - - $this->mockObjects = []; - $this->prophet = null; - - // Tear down the fixture. An exception raised in tearDown() will be - // caught and passed on when no exception was raised before. - try { - if ($hasMetRequirements) { - foreach ($hookMethods['after'] as $method) { - $this->{$method}(); - } - - if ($this->inIsolation) { - foreach ($hookMethods['afterClass'] as $method) { - $this->{$method}(); - } - } - } - } catch (Throwable $_e) { - $e = $e ?? $_e; - } - - try { - $this->stopOutputBuffering(); - } catch (RiskyTestError $_e) { - $e = $e ?? $_e; - } - - if (isset($_e)) { - $this->status = BaseTestRunner::STATUS_ERROR; - $this->statusMessage = $_e->getMessage(); - } - - clearstatcache(); - - if ($currentWorkingDirectory !== getcwd()) { - chdir($currentWorkingDirectory); - } - - $this->restoreGlobalState(); - $this->unregisterCustomComparators(); - $this->cleanupIniSettings(); - $this->cleanupLocaleSettings(); - libxml_clear_errors(); - - // Perform assertion on output. - if (!isset($e)) { - try { - if ($this->outputExpectedRegex !== null) { - $this->assertRegExp($this->outputExpectedRegex, $this->output); - } elseif ($this->outputExpectedString !== null) { - $this->assertEquals($this->outputExpectedString, $this->output); - } - } catch (Throwable $_e) { - $e = $_e; - } - } - - // Workaround for missing "finally". - if (isset($e)) { - if ($e instanceof PredictionException) { - $e = new AssertionFailedError($e->getMessage()); - } - - $this->onNotSuccessfulTest($e); - } - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function setName(string $name): void - { - $this->name = $name; - } - - /** - * @param string[] $dependencies - * - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function setDependencies(array $dependencies): void - { - $this->dependencies = $dependencies; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function getDependencies(): array - { - return $this->dependencies; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function hasDependencies(): bool - { - return count($this->dependencies) > 0; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function setDependencyInput(array $dependencyInput): void - { - $this->dependencyInput = $dependencyInput; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function getDependencyInput(): array - { - return $this->dependencyInput; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function setBeStrictAboutChangesToGlobalState(?bool $beStrictAboutChangesToGlobalState): void - { - $this->beStrictAboutChangesToGlobalState = $beStrictAboutChangesToGlobalState; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function setBackupGlobals(?bool $backupGlobals): void - { - if ($this->backupGlobals === null && $backupGlobals !== null) { - $this->backupGlobals = $backupGlobals; - } - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function setBackupStaticAttributes(?bool $backupStaticAttributes): void - { - if ($this->backupStaticAttributes === null && $backupStaticAttributes !== null) { - $this->backupStaticAttributes = $backupStaticAttributes; - } - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function setRunTestInSeparateProcess(bool $runTestInSeparateProcess): void - { - if ($this->runTestInSeparateProcess === null) { - $this->runTestInSeparateProcess = $runTestInSeparateProcess; - } - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function setRunClassInSeparateProcess(bool $runClassInSeparateProcess): void - { - if ($this->runClassInSeparateProcess === null) { - $this->runClassInSeparateProcess = $runClassInSeparateProcess; - } - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function setPreserveGlobalState(bool $preserveGlobalState): void - { - $this->preserveGlobalState = $preserveGlobalState; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function setInIsolation(bool $inIsolation): void - { - $this->inIsolation = $inIsolation; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function isInIsolation(): bool - { - return $this->inIsolation; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function getResult() - { - return $this->testResult; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function setResult($result): void - { - $this->testResult = $result; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function setOutputCallback(callable $callback): void - { - $this->outputCallback = $callback; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function getTestResultObject(): ?TestResult - { - return $this->result; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function setTestResultObject(TestResult $result): void - { - $this->result = $result; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function registerMockObject(MockObject $mockObject): void - { - $this->mockObjects[] = $mockObject; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function addToAssertionCount(int $count): void - { - $this->numAssertions += $count; - } - - /** - * Returns the number of assertions performed by this test. - * - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function getNumAssertions(): int - { - return $this->numAssertions; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function usesDataProvider(): bool - { - return !empty($this->data); - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function dataDescription(): string - { - return is_string($this->dataName) ? $this->dataName : ''; - } - - /** - * @return int|string - * - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function dataName() - { - return $this->dataName; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function getDataSetAsString(bool $includeData = true): string - { - $buffer = ''; - - if (!empty($this->data)) { - if (is_int($this->dataName)) { - $buffer .= sprintf(' with data set #%d', $this->dataName); - } else { - $buffer .= sprintf(' with data set "%s"', $this->dataName); - } - - if ($includeData) { - $exporter = new Exporter; - - $buffer .= sprintf(' (%s)', $exporter->shortenedRecursiveExport($this->data)); - } - } - - return $buffer; - } - - /** - * Gets the data set of a TestCase. - * - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function getProvidedData(): array - { - return $this->data; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function addWarning(string $warning): void - { - $this->warnings[] = $warning; - } - - /** - * Override to run the test and assert its state. - * - * @throws \SebastianBergmann\ObjectEnumerator\InvalidArgumentException - * @throws AssertionFailedError - * @throws Exception - * @throws ExpectationFailedException - * @throws Throwable - */ - protected function runTest() - { - if (trim($this->name) === '') { - throw new Exception( - 'PHPUnit\Framework\TestCase::$name must be a non-blank string.' - ); - } - - $testArguments = array_merge($this->data, $this->dependencyInput); - - $this->registerMockObjectsFromTestArguments($testArguments); - - try { - $testResult = $this->{$this->name}(...array_values($testArguments)); - } catch (Throwable $exception) { - if (!$this->checkExceptionExpectations($exception)) { - throw $exception; - } - - if ($this->expectedException !== null) { - if ($this->expectedException === Error::class) { - $this->assertThat( - $exception, - LogicalOr::fromConstraints( - new ExceptionConstraint(Error::class), - new ExceptionConstraint(\Error::class) - ) - ); - } else { - $this->assertThat( - $exception, - new ExceptionConstraint( - $this->expectedException - ) - ); - } - } - - if ($this->expectedExceptionMessage !== null) { - $this->assertThat( - $exception, - new ExceptionMessage( - $this->expectedExceptionMessage - ) - ); - } - - if ($this->expectedExceptionMessageRegExp !== null) { - $this->assertThat( - $exception, - new ExceptionMessageRegularExpression( - $this->expectedExceptionMessageRegExp - ) - ); - } - - if ($this->expectedExceptionCode !== null) { - $this->assertThat( - $exception, - new ExceptionCode( - $this->expectedExceptionCode - ) - ); - } - - if ($this->deprecatedExpectExceptionMessageRegExpUsed) { - $this->addWarning('expectExceptionMessageRegExp() is deprecated in PHPUnit 8 and will be removed in PHPUnit 9. Use expectExceptionMessageMatches() instead.'); - } - - return; - } - - if ($this->expectedException !== null) { - $this->assertThat( - null, - new ExceptionConstraint( - $this->expectedException - ) - ); - } elseif ($this->expectedExceptionMessage !== null) { - $this->numAssertions++; - - throw new AssertionFailedError( - sprintf( - 'Failed asserting that exception with message "%s" is thrown', - $this->expectedExceptionMessage - ) - ); - } elseif ($this->expectedExceptionMessageRegExp !== null) { - $this->numAssertions++; - - throw new AssertionFailedError( - sprintf( - 'Failed asserting that exception with message matching "%s" is thrown', - $this->expectedExceptionMessageRegExp - ) - ); - } elseif ($this->expectedExceptionCode !== null) { - $this->numAssertions++; - - throw new AssertionFailedError( - sprintf( - 'Failed asserting that exception with code "%s" is thrown', - $this->expectedExceptionCode - ) - ); - } - - return $testResult; - } - - /** - * This method is a wrapper for the ini_set() function that automatically - * resets the modified php.ini setting to its original value after the - * test is run. - * - * @throws Exception - */ - protected function iniSet(string $varName, string $newValue): void - { - $currentValue = ini_set($varName, $newValue); - - if ($currentValue !== false) { - $this->iniSettings[$varName] = $currentValue; - } else { - throw new Exception( - sprintf( - 'INI setting "%s" could not be set to "%s".', - $varName, - $newValue - ) - ); - } - } - - /** - * This method is a wrapper for the setlocale() function that automatically - * resets the locale to its original value after the test is run. - * - * @throws Exception - */ - protected function setLocale(...$args): void - { - if (count($args) < 2) { - throw new Exception; - } - - [$category, $locale] = $args; - - if (defined('LC_MESSAGES')) { - $categories[] = LC_MESSAGES; - } - - if (!in_array($category, self::LOCALE_CATEGORIES, true)) { - throw new Exception; - } - - if (!is_array($locale) && !is_string($locale)) { - throw new Exception; - } - - $this->locale[$category] = setlocale($category, 0); - - $result = setlocale(...$args); - - if ($result === false) { - throw new Exception( - 'The locale functionality is not implemented on your platform, ' . - 'the specified locale does not exist or the category name is ' . - 'invalid.' - ); - } - } - - /** - * Makes configurable stub for the specified class. - * - * @psalm-template RealInstanceType of object - * @psalm-param class-string $originalClassName - * @psalm-return Stub&RealInstanceType - */ - protected function createStub(string $originalClassName): Stub - { - return $this->createMock($originalClassName); - } - - /** - * Returns a mock object for the specified class. - * - * @param string|string[] $originalClassName - * - * @psalm-template RealInstanceType of object - * @psalm-param class-string|string[] $originalClassName - * @psalm-return MockObject&RealInstanceType - */ - protected function createMock($originalClassName): MockObject - { - if (!is_string($originalClassName)) { - $this->addWarning('Passing an array of interface names to createMock() for creating a test double that implements multiple interfaces is deprecated and will no longer be supported in PHPUnit 9.'); - } - - return $this->getMockBuilder($originalClassName) - ->disableOriginalConstructor() - ->disableOriginalClone() - ->disableArgumentCloning() - ->disallowMockingUnknownTypes() - ->getMock(); - } - - /** - * Returns a configured mock object for the specified class. - * - * @param string|string[] $originalClassName - * - * @psalm-template RealInstanceType of object - * @psalm-param class-string|string[] $originalClassName - * @psalm-return MockObject&RealInstanceType - */ - protected function createConfiguredMock($originalClassName, array $configuration): MockObject - { - $o = $this->createMock($originalClassName); - - foreach ($configuration as $method => $return) { - $o->method($method)->willReturn($return); - } - - return $o; - } - - /** - * Returns a partial mock object for the specified class. - * - * @param string|string[] $originalClassName - * @param string[] $methods - * - * @psalm-template RealInstanceType of object - * @psalm-param class-string|string[] $originalClassName - * @psalm-return MockObject&RealInstanceType - */ - protected function createPartialMock($originalClassName, array $methods): MockObject - { - if (!is_string($originalClassName)) { - $this->addWarning('Passing an array of interface names to createPartialMock() for creating a test double that implements multiple interfaces is deprecated and will no longer be supported in PHPUnit 9.'); - } - - $class_names = is_array($originalClassName) ? $originalClassName : [$originalClassName]; - - foreach ($class_names as $class_name) { - $reflection = new ReflectionClass($class_name); - - $mockedMethodsThatDontExist = array_filter( - $methods, - static function (string $method) use ($reflection) - { - return !$reflection->hasMethod($method); - } - ); - - if ($mockedMethodsThatDontExist) { - $this->addWarning( - sprintf( - 'createPartialMock called with method(s) %s that do not exist in %s. This will not be allowed in future versions of PHPUnit.', - implode(', ', $mockedMethodsThatDontExist), - $class_name - ) - ); - } - } - - return $this->getMockBuilder($originalClassName) - ->disableOriginalConstructor() - ->disableOriginalClone() - ->disableArgumentCloning() - ->disallowMockingUnknownTypes() - ->setMethods(empty($methods) ? null : $methods) - ->getMock(); - } - - /** - * Returns a test proxy for the specified class. - * - * @psalm-template RealInstanceType of object - * @psalm-param class-string $originalClassName - * @psalm-return MockObject&RealInstanceType - */ - protected function createTestProxy(string $originalClassName, array $constructorArguments = []): MockObject - { - return $this->getMockBuilder($originalClassName) - ->setConstructorArgs($constructorArguments) - ->enableProxyingToOriginalMethods() - ->getMock(); - } - - /** - * Mocks the specified class and returns the name of the mocked class. - * - * @param string $originalClassName - * @param array $methods - * @param string $mockClassName - * @param bool $callOriginalConstructor - * @param bool $callOriginalClone - * @param bool $callAutoload - * @param bool $cloneArguments - * - * @psalm-template RealInstanceType of object - * @psalm-param class-string|string $originalClassName - * @psalm-return class-string - */ - protected function getMockClass($originalClassName, $methods = [], array $arguments = [], $mockClassName = '', $callOriginalConstructor = false, $callOriginalClone = true, $callAutoload = true, $cloneArguments = false): string - { - $this->recordDoubledType($originalClassName); - - $mock = $this->getMockObjectGenerator()->getMock( - $originalClassName, - $methods, - $arguments, - $mockClassName, - $callOriginalConstructor, - $callOriginalClone, - $callAutoload, - $cloneArguments - ); - - return get_class($mock); - } - - /** - * Returns a mock object for the specified abstract class with all abstract - * methods of the class mocked. Concrete methods are not mocked by default. - * To mock concrete methods, use the 7th parameter ($mockedMethods). - * - * @param string $originalClassName - * @param string $mockClassName - * @param bool $callOriginalConstructor - * @param bool $callOriginalClone - * @param bool $callAutoload - * @param array $mockedMethods - * @param bool $cloneArguments - * - * @psalm-template RealInstanceType of object - * @psalm-param class-string $originalClassName - * @psalm-return MockObject&RealInstanceType - */ - protected function getMockForAbstractClass($originalClassName, array $arguments = [], $mockClassName = '', $callOriginalConstructor = true, $callOriginalClone = true, $callAutoload = true, $mockedMethods = [], $cloneArguments = false): MockObject - { - $this->recordDoubledType($originalClassName); - - $mockObject = $this->getMockObjectGenerator()->getMockForAbstractClass( - $originalClassName, - $arguments, - $mockClassName, - $callOriginalConstructor, - $callOriginalClone, - $callAutoload, - $mockedMethods, - $cloneArguments - ); - - $this->registerMockObject($mockObject); - - return $mockObject; - } - - /** - * Returns a mock object based on the given WSDL file. - * - * @param string $wsdlFile - * @param string $originalClassName - * @param string $mockClassName - * @param bool $callOriginalConstructor - * @param array $options An array of options passed to SOAPClient::_construct - * - * @psalm-template RealInstanceType of object - * @psalm-param class-string|string $originalClassName - * @psalm-return MockObject&RealInstanceType - */ - protected function getMockFromWsdl($wsdlFile, $originalClassName = '', $mockClassName = '', array $methods = [], $callOriginalConstructor = true, array $options = []): MockObject - { - $this->recordDoubledType('SoapClient'); - - if ($originalClassName === '') { - $fileName = pathinfo(basename(parse_url($wsdlFile, PHP_URL_PATH)), PATHINFO_FILENAME); - $originalClassName = preg_replace('/\W/', '', $fileName); - } - - if (!class_exists($originalClassName)) { - eval( - $this->getMockObjectGenerator()->generateClassFromWsdl( - $wsdlFile, - $originalClassName, - $methods, - $options - ) - ); - } - - $mockObject = $this->getMockObjectGenerator()->getMock( - $originalClassName, - $methods, - ['', $options], - $mockClassName, - $callOriginalConstructor, - false, - false - ); - - $this->registerMockObject($mockObject); - - return $mockObject; - } - - /** - * Returns a mock object for the specified trait with all abstract methods - * of the trait mocked. Concrete methods to mock can be specified with the - * `$mockedMethods` parameter. - * - * @param string $traitName - * @param string $mockClassName - * @param bool $callOriginalConstructor - * @param bool $callOriginalClone - * @param bool $callAutoload - * @param array $mockedMethods - * @param bool $cloneArguments - */ - protected function getMockForTrait($traitName, array $arguments = [], $mockClassName = '', $callOriginalConstructor = true, $callOriginalClone = true, $callAutoload = true, $mockedMethods = [], $cloneArguments = false): MockObject - { - $this->recordDoubledType($traitName); - - $mockObject = $this->getMockObjectGenerator()->getMockForTrait( - $traitName, - $arguments, - $mockClassName, - $callOriginalConstructor, - $callOriginalClone, - $callAutoload, - $mockedMethods, - $cloneArguments - ); - - $this->registerMockObject($mockObject); - - return $mockObject; - } - - /** - * Returns an object for the specified trait. - * - * @param string $traitName - * @param string $traitClassName - * @param bool $callOriginalConstructor - * @param bool $callOriginalClone - * @param bool $callAutoload - * - * @return object - */ - protected function getObjectForTrait($traitName, array $arguments = [], $traitClassName = '', $callOriginalConstructor = true, $callOriginalClone = true, $callAutoload = true)/*: object*/ - { - $this->recordDoubledType($traitName); - - return $this->getMockObjectGenerator()->getObjectForTrait( - $traitName, - $traitClassName, - $callAutoload, - $callOriginalConstructor, - $arguments - ); - } - - /** - * @param null|string $classOrInterface - * - * @throws \Prophecy\Exception\Doubler\ClassNotFoundException - * @throws \Prophecy\Exception\Doubler\DoubleException - * @throws \Prophecy\Exception\Doubler\InterfaceNotFoundException - * - * @psalm-param class-string|null $classOrInterface - */ - protected function prophesize($classOrInterface = null): ObjectProphecy - { - if (is_string($classOrInterface)) { - $this->recordDoubledType($classOrInterface); - } - - return $this->getProphet()->prophesize($classOrInterface); - } - - /** - * Creates a default TestResult object. - * - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - protected function createResult(): TestResult - { - return new TestResult; - } - - /** - * This method is called when a test method did not execute successfully. - * - * @throws Throwable - */ - protected function onNotSuccessfulTest(Throwable $t): void - { - throw $t; - } - - private function setExpectedExceptionFromAnnotation(): void - { - if ($this->name === null) { - return; - } - - try { - $expectedException = TestUtil::getExpectedException( - static::class, - $this->name - ); - - if ($expectedException !== false) { - $this->addWarning('The @expectedException, @expectedExceptionCode, @expectedExceptionMessage, and @expectedExceptionMessageRegExp annotations are deprecated. They will be removed in PHPUnit 9. Refactor your test to use expectException(), expectExceptionCode(), expectExceptionMessage(), or expectExceptionMessageMatches() instead.'); - - $this->expectException($expectedException['class']); - - if ($expectedException['code'] !== null) { - $this->expectExceptionCode($expectedException['code']); - } - - if ($expectedException['message'] !== '') { - $this->expectExceptionMessage($expectedException['message']); - } elseif ($expectedException['message_regex'] !== '') { - $this->expectExceptionMessageMatches($expectedException['message_regex']); - } - } - } catch (UtilException $e) { - } - } - - /** - * @throws SkippedTestError - * @throws SyntheticSkippedError - * @throws Warning - */ - private function checkRequirements(): void - { - if (!$this->name || !method_exists($this, $this->name)) { - return; - } - - $missingRequirements = TestUtil::getMissingRequirements( - static::class, - $this->name - ); - - if (!empty($missingRequirements)) { - $this->markTestSkipped(implode(PHP_EOL, $missingRequirements)); - } - } - - /** - * @throws Throwable - */ - private function verifyMockObjects(): void - { - foreach ($this->mockObjects as $mockObject) { - if ($mockObject->__phpunit_hasMatchers()) { - $this->numAssertions++; - } - - $mockObject->__phpunit_verify( - $this->shouldInvocationMockerBeReset($mockObject) - ); - } - - if ($this->prophet !== null) { - try { - $this->prophet->checkPredictions(); - } finally { - foreach ($this->prophet->getProphecies() as $objectProphecy) { - foreach ($objectProphecy->getMethodProphecies() as $methodProphecies) { - foreach ($methodProphecies as $methodProphecy) { - assert($methodProphecy instanceof MethodProphecy); - - $this->numAssertions += count($methodProphecy->getCheckedPredictions()); - } - } - } - } - } - } - - private function handleDependencies(): bool - { - if (!empty($this->dependencies) && !$this->inIsolation) { - $passed = $this->result->passed(); - $passedKeys = array_keys($passed); - - foreach ($passedKeys as $key => $value) { - $pos = strpos($value, ' with data set'); - - if ($pos !== false) { - $passedKeys[$key] = substr($value, 0, $pos); - } - } - - $passedKeys = array_flip(array_unique($passedKeys)); - - foreach ($this->dependencies as $dependency) { - $deepClone = false; - $shallowClone = false; - - if (empty($dependency)) { - $this->markSkippedForNotSpecifyingDependency(); - - return false; - } - - if (strpos($dependency, 'clone ') === 0) { - $deepClone = true; - $dependency = substr($dependency, strlen('clone ')); - } elseif (strpos($dependency, '!clone ') === 0) { - $deepClone = false; - $dependency = substr($dependency, strlen('!clone ')); - } - - if (strpos($dependency, 'shallowClone ') === 0) { - $shallowClone = true; - $dependency = substr($dependency, strlen('shallowClone ')); - } elseif (strpos($dependency, '!shallowClone ') === 0) { - $shallowClone = false; - $dependency = substr($dependency, strlen('!shallowClone ')); - } - - if (strpos($dependency, '::') === false) { - $dependency = static::class . '::' . $dependency; - } - - if (!isset($passedKeys[$dependency])) { - if (!$this->isCallableTestMethod($dependency)) { - $this->warnAboutDependencyThatDoesNotExist($dependency); - } else { - $this->markSkippedForMissingDependency($dependency); - } - - return false; - } - - if (isset($passed[$dependency])) { - if ($passed[$dependency]['size'] !== TestUtil::UNKNOWN && - $this->getSize() !== TestUtil::UNKNOWN && - $passed[$dependency]['size'] > $this->getSize()) { - $this->result->addError( - $this, - new SkippedTestError( - 'This test depends on a test that is larger than itself.' - ), - 0 - ); - - return false; - } - - if ($deepClone) { - $deepCopy = new DeepCopy; - $deepCopy->skipUncloneable(false); - - $this->dependencyInput[$dependency] = $deepCopy->copy($passed[$dependency]['result']); - } elseif ($shallowClone) { - $this->dependencyInput[$dependency] = clone $passed[$dependency]['result']; - } else { - $this->dependencyInput[$dependency] = $passed[$dependency]['result']; - } - } else { - $this->dependencyInput[$dependency] = null; - } - } - } - - return true; - } - - private function markSkippedForNotSpecifyingDependency(): void - { - $this->status = BaseTestRunner::STATUS_SKIPPED; - - $this->result->startTest($this); - - $this->result->addError( - $this, - new SkippedTestError( - 'This method has an invalid @depends annotation.' - ), - 0 - ); - - $this->result->endTest($this, 0); - } - - private function markSkippedForMissingDependency(string $dependency): void - { - $this->status = BaseTestRunner::STATUS_SKIPPED; - - $this->result->startTest($this); - - $this->result->addError( - $this, - new SkippedTestError( - sprintf( - 'This test depends on "%s" to pass.', - $dependency - ) - ), - 0 - ); - - $this->result->endTest($this, 0); - } - - private function warnAboutDependencyThatDoesNotExist(string $dependency): void - { - $this->status = BaseTestRunner::STATUS_WARNING; - - $this->result->startTest($this); - - $this->result->addWarning( - $this, - new Warning( - sprintf( - 'This test depends on "%s" which does not exist.', - $dependency - ) - ), - 0 - ); - - $this->result->endTest($this, 0); - } - - /** - * Get the mock object generator, creating it if it doesn't exist. - */ - private function getMockObjectGenerator(): MockGenerator - { - if ($this->mockObjectGenerator === null) { - $this->mockObjectGenerator = new MockGenerator; - } - - return $this->mockObjectGenerator; - } - - private function startOutputBuffering(): void - { - ob_start(); - - $this->outputBufferingActive = true; - $this->outputBufferingLevel = ob_get_level(); - } - - /** - * @throws RiskyTestError - */ - private function stopOutputBuffering(): void - { - if (ob_get_level() !== $this->outputBufferingLevel) { - while (ob_get_level() >= $this->outputBufferingLevel) { - ob_end_clean(); - } - - throw new RiskyTestError( - 'Test code or tested code did not (only) close its own output buffers' - ); - } - - $this->output = ob_get_contents(); - - if ($this->outputCallback !== false) { - $this->output = (string) call_user_func($this->outputCallback, $this->output); - } - - ob_end_clean(); - - $this->outputBufferingActive = false; - $this->outputBufferingLevel = ob_get_level(); - } - - private function snapshotGlobalState(): void - { - if ($this->runTestInSeparateProcess || $this->inIsolation || - (!$this->backupGlobals && !$this->backupStaticAttributes)) { - return; - } - - $this->snapshot = $this->createGlobalStateSnapshot($this->backupGlobals === true); - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws RiskyTestError - */ - private function restoreGlobalState(): void - { - if (!$this->snapshot instanceof Snapshot) { - return; - } - - if ($this->beStrictAboutChangesToGlobalState) { - try { - $this->compareGlobalStateSnapshots( - $this->snapshot, - $this->createGlobalStateSnapshot($this->backupGlobals === true) - ); - } catch (RiskyTestError $rte) { - // Intentionally left empty - } - } - - $restorer = new Restorer; - - if ($this->backupGlobals) { - $restorer->restoreGlobalVariables($this->snapshot); - } - - if ($this->backupStaticAttributes) { - $restorer->restoreStaticAttributes($this->snapshot); - } - - $this->snapshot = null; - - if (isset($rte)) { - throw $rte; - } - } - - private function createGlobalStateSnapshot(bool $backupGlobals): Snapshot - { - $blacklist = new Blacklist; - - foreach ($this->backupGlobalsBlacklist as $globalVariable) { - $blacklist->addGlobalVariable($globalVariable); - } - - if (!defined('PHPUNIT_TESTSUITE')) { - $blacklist->addClassNamePrefix('PHPUnit'); - $blacklist->addClassNamePrefix('SebastianBergmann\CodeCoverage'); - $blacklist->addClassNamePrefix('SebastianBergmann\FileIterator'); - $blacklist->addClassNamePrefix('SebastianBergmann\Invoker'); - $blacklist->addClassNamePrefix('SebastianBergmann\Timer'); - $blacklist->addClassNamePrefix('PHP_Token'); - $blacklist->addClassNamePrefix('Symfony'); - $blacklist->addClassNamePrefix('Text_Template'); - $blacklist->addClassNamePrefix('Doctrine\Instantiator'); - $blacklist->addClassNamePrefix('Prophecy'); - $blacklist->addStaticAttribute(ComparatorFactory::class, 'instance'); - - foreach ($this->backupStaticAttributesBlacklist as $class => $attributes) { - foreach ($attributes as $attribute) { - $blacklist->addStaticAttribute($class, $attribute); - } - } - } - - return new Snapshot( - $blacklist, - $backupGlobals, - (bool) $this->backupStaticAttributes, - false, - false, - false, - false, - false, - false, - false - ); - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws RiskyTestError - */ - private function compareGlobalStateSnapshots(Snapshot $before, Snapshot $after): void - { - $backupGlobals = $this->backupGlobals === null || $this->backupGlobals; - - if ($backupGlobals) { - $this->compareGlobalStateSnapshotPart( - $before->globalVariables(), - $after->globalVariables(), - "--- Global variables before the test\n+++ Global variables after the test\n" - ); - - $this->compareGlobalStateSnapshotPart( - $before->superGlobalVariables(), - $after->superGlobalVariables(), - "--- Super-global variables before the test\n+++ Super-global variables after the test\n" - ); - } - - if ($this->backupStaticAttributes) { - $this->compareGlobalStateSnapshotPart( - $before->staticAttributes(), - $after->staticAttributes(), - "--- Static attributes before the test\n+++ Static attributes after the test\n" - ); - } - } - - /** - * @throws RiskyTestError - */ - private function compareGlobalStateSnapshotPart(array $before, array $after, string $header): void - { - if ($before != $after) { - $differ = new Differ($header); - $exporter = new Exporter; - - $diff = $differ->diff( - $exporter->export($before), - $exporter->export($after) - ); - - throw new RiskyTestError( - $diff - ); - } - } - - private function getProphet(): Prophet - { - if ($this->prophet === null) { - $this->prophet = new Prophet; - } - - return $this->prophet; - } - - /** - * @throws \SebastianBergmann\ObjectEnumerator\InvalidArgumentException - */ - private function shouldInvocationMockerBeReset(MockObject $mock): bool - { - $enumerator = new Enumerator; - - foreach ($enumerator->enumerate($this->dependencyInput) as $object) { - if ($mock === $object) { - return false; - } - } - - if (!is_array($this->testResult) && !is_object($this->testResult)) { - return true; - } - - return !in_array($mock, $enumerator->enumerate($this->testResult), true); - } - - /** - * @throws \SebastianBergmann\ObjectEnumerator\InvalidArgumentException - * @throws \SebastianBergmann\ObjectReflector\InvalidArgumentException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - private function registerMockObjectsFromTestArguments(array $testArguments, array &$visited = []): void - { - if ($this->registerMockObjectsFromTestArgumentsRecursively) { - foreach ((new Enumerator)->enumerate($testArguments) as $object) { - if ($object instanceof MockObject) { - $this->registerMockObject($object); - } - } - } else { - foreach ($testArguments as $testArgument) { - if ($testArgument instanceof MockObject) { - if (Type::isCloneable($testArgument)) { - $testArgument = clone $testArgument; - } - - $this->registerMockObject($testArgument); - } elseif (is_array($testArgument) && !in_array($testArgument, $visited, true)) { - $visited[] = $testArgument; - - $this->registerMockObjectsFromTestArguments( - $testArgument, - $visited - ); - } - } - } - } - - private function setDoesNotPerformAssertionsFromAnnotation(): void - { - $annotations = $this->getAnnotations(); - - if (isset($annotations['method']['doesNotPerformAssertions'])) { - $this->doesNotPerformAssertions = true; - } - } - - private function unregisterCustomComparators(): void - { - $factory = ComparatorFactory::getInstance(); - - foreach ($this->customComparators as $comparator) { - $factory->unregister($comparator); - } - - $this->customComparators = []; - } - - private function cleanupIniSettings(): void - { - foreach ($this->iniSettings as $varName => $oldValue) { - ini_set($varName, $oldValue); - } - - $this->iniSettings = []; - } - - private function cleanupLocaleSettings(): void - { - foreach ($this->locale as $category => $locale) { - setlocale($category, $locale); - } - - $this->locale = []; - } - - /** - * @throws Exception - */ - private function checkExceptionExpectations(Throwable $throwable): bool - { - $result = false; - - if ($this->expectedException !== null || $this->expectedExceptionCode !== null || $this->expectedExceptionMessage !== null || $this->expectedExceptionMessageRegExp !== null) { - $result = true; - } - - if ($throwable instanceof Exception) { - $result = false; - } - - if (is_string($this->expectedException)) { - try { - $reflector = new ReflectionClass($this->expectedException); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - if ($this->expectedException === 'PHPUnit\Framework\Exception' || - $this->expectedException === '\PHPUnit\Framework\Exception' || - $reflector->isSubclassOf(Exception::class)) { - $result = true; - } - } - - return $result; - } - - private function runInSeparateProcess(): bool - { - return ($this->runTestInSeparateProcess || $this->runClassInSeparateProcess) && - !$this->inIsolation && !$this instanceof PhptTestCase; - } - - /** - * @param string|string[] $originalClassName - */ - private function recordDoubledType($originalClassName): void - { - if (is_string($originalClassName)) { - $this->doubledTypes[] = $originalClassName; - } - - if (is_array($originalClassName)) { - foreach ($originalClassName as $_originalClassName) { - if (is_string($_originalClassName)) { - $this->doubledTypes[] = $_originalClassName; - } - } - } - } - - private function isCallableTestMethod(string $dependency): bool - { - [$className, $methodName] = explode('::', $dependency); - - if (!class_exists($className)) { - return false; - } - - try { - $class = new ReflectionClass($className); - } catch (ReflectionException $e) { - return false; - } - - if (!$class->isSubclassOf(__CLASS__)) { - return false; - } - - if (!$class->hasMethod($methodName)) { - return false; - } - - try { - $method = $class->getMethod($methodName); - } catch (ReflectionException $e) { - return false; - } - - return TestUtil::isTestMethod($method); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/TestFailure.php b/vendor/phpunit/phpunit/src/Framework/TestFailure.php deleted file mode 100644 index 5849d36..0000000 --- a/vendor/phpunit/phpunit/src/Framework/TestFailure.php +++ /dev/null @@ -1,157 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -use function get_class; -use function sprintf; -use function trim; -use PHPUnit\Framework\Error\Error; -use Throwable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class TestFailure -{ - /** - * @var null|Test - */ - private $failedTest; - - /** - * @var Throwable - */ - private $thrownException; - - /** - * @var string - */ - private $testName; - - /** - * Returns a description for an exception. - */ - public static function exceptionToString(Throwable $e): string - { - if ($e instanceof SelfDescribing) { - $buffer = $e->toString(); - - if ($e instanceof ExpectationFailedException && $e->getComparisonFailure()) { - $buffer .= $e->getComparisonFailure()->getDiff(); - } - - if ($e instanceof PHPTAssertionFailedError) { - $buffer .= $e->getDiff(); - } - - if (!empty($buffer)) { - $buffer = trim($buffer) . "\n"; - } - - return $buffer; - } - - if ($e instanceof Error) { - return $e->getMessage() . "\n"; - } - - if ($e instanceof ExceptionWrapper) { - return $e->getClassName() . ': ' . $e->getMessage() . "\n"; - } - - return get_class($e) . ': ' . $e->getMessage() . "\n"; - } - - /** - * Constructs a TestFailure with the given test and exception. - * - * @param Throwable $t - */ - public function __construct(Test $failedTest, $t) - { - if ($failedTest instanceof SelfDescribing) { - $this->testName = $failedTest->toString(); - } else { - $this->testName = get_class($failedTest); - } - - if (!$failedTest instanceof TestCase || !$failedTest->isInIsolation()) { - $this->failedTest = $failedTest; - } - - $this->thrownException = $t; - } - - /** - * Returns a short description of the failure. - */ - public function toString(): string - { - return sprintf( - '%s: %s', - $this->testName, - $this->thrownException->getMessage() - ); - } - - /** - * Returns a description for the thrown exception. - */ - public function getExceptionAsString(): string - { - return self::exceptionToString($this->thrownException); - } - - /** - * Returns the name of the failing test (including data set, if any). - */ - public function getTestName(): string - { - return $this->testName; - } - - /** - * Returns the failing test. - * - * Note: The test object is not set when the test is executed in process - * isolation. - * - * @see Exception - */ - public function failedTest(): ?Test - { - return $this->failedTest; - } - - /** - * Gets the thrown exception. - */ - public function thrownException(): Throwable - { - return $this->thrownException; - } - - /** - * Returns the exception's message. - */ - public function exceptionMessage(): string - { - return $this->thrownException()->getMessage(); - } - - /** - * Returns true if the thrown exception - * is of type AssertionFailedError. - */ - public function isFailure(): bool - { - return $this->thrownException() instanceof AssertionFailedError; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/TestListener.php b/vendor/phpunit/phpunit/src/Framework/TestListener.php deleted file mode 100644 index 96ce4ee..0000000 --- a/vendor/phpunit/phpunit/src/Framework/TestListener.php +++ /dev/null @@ -1,84 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -use Throwable; - -/** - * @deprecated Use the `TestHook` interfaces instead - */ -interface TestListener -{ - /** - * An error occurred. - * - * @deprecated Use `AfterTestErrorHook::executeAfterTestError` instead - */ - public function addError(Test $test, Throwable $t, float $time): void; - - /** - * A warning occurred. - * - * @deprecated Use `AfterTestWarningHook::executeAfterTestWarning` instead - */ - public function addWarning(Test $test, Warning $e, float $time): void; - - /** - * A failure occurred. - * - * @deprecated Use `AfterTestFailureHook::executeAfterTestFailure` instead - */ - public function addFailure(Test $test, AssertionFailedError $e, float $time): void; - - /** - * Incomplete test. - * - * @deprecated Use `AfterIncompleteTestHook::executeAfterIncompleteTest` instead - */ - public function addIncompleteTest(Test $test, Throwable $t, float $time): void; - - /** - * Risky test. - * - * @deprecated Use `AfterRiskyTestHook::executeAfterRiskyTest` instead - */ - public function addRiskyTest(Test $test, Throwable $t, float $time): void; - - /** - * Skipped test. - * - * @deprecated Use `AfterSkippedTestHook::executeAfterSkippedTest` instead - */ - public function addSkippedTest(Test $test, Throwable $t, float $time): void; - - /** - * A test suite started. - */ - public function startTestSuite(TestSuite $suite): void; - - /** - * A test suite ended. - */ - public function endTestSuite(TestSuite $suite): void; - - /** - * A test started. - * - * @deprecated Use `BeforeTestHook::executeBeforeTest` instead - */ - public function startTest(Test $test): void; - - /** - * A test ended. - * - * @deprecated Use `AfterTestHook::executeAfterTest` instead - */ - public function endTest(Test $test, float $time): void; -} diff --git a/vendor/phpunit/phpunit/src/Framework/TestListenerDefaultImplementation.php b/vendor/phpunit/phpunit/src/Framework/TestListenerDefaultImplementation.php deleted file mode 100644 index 7c99f5c..0000000 --- a/vendor/phpunit/phpunit/src/Framework/TestListenerDefaultImplementation.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -use Throwable; - -/** - * @deprecated The `TestListener` interface is deprecated - */ -trait TestListenerDefaultImplementation -{ - public function addError(Test $test, Throwable $t, float $time): void - { - } - - public function addWarning(Test $test, Warning $e, float $time): void - { - } - - public function addFailure(Test $test, AssertionFailedError $e, float $time): void - { - } - - public function addIncompleteTest(Test $test, Throwable $t, float $time): void - { - } - - public function addRiskyTest(Test $test, Throwable $t, float $time): void - { - } - - public function addSkippedTest(Test $test, Throwable $t, float $time): void - { - } - - public function startTestSuite(TestSuite $suite): void - { - } - - public function endTestSuite(TestSuite $suite): void - { - } - - public function startTest(Test $test): void - { - } - - public function endTest(Test $test, float $time): void - { - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/TestResult.php b/vendor/phpunit/phpunit/src/Framework/TestResult.php deleted file mode 100644 index d94d863..0000000 --- a/vendor/phpunit/phpunit/src/Framework/TestResult.php +++ /dev/null @@ -1,1257 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -use const PHP_EOL; -use function class_exists; -use function count; -use function extension_loaded; -use function function_exists; -use function get_class; -use function sprintf; -use function xdebug_get_monitored_functions; -use function xdebug_is_debugger_active; -use function xdebug_start_function_monitor; -use function xdebug_stop_function_monitor; -use AssertionError; -use Countable; -use Error; -use PHPUnit\Framework\MockObject\Exception as MockObjectException; -use PHPUnit\Util\Blacklist; -use PHPUnit\Util\ErrorHandler; -use PHPUnit\Util\Printer; -use PHPUnit\Util\Test as TestUtil; -use ReflectionClass; -use ReflectionException; -use SebastianBergmann\CodeCoverage\CodeCoverage; -use SebastianBergmann\CodeCoverage\CoveredCodeNotExecutedException as OriginalCoveredCodeNotExecutedException; -use SebastianBergmann\CodeCoverage\Exception as OriginalCodeCoverageException; -use SebastianBergmann\CodeCoverage\MissingCoversAnnotationException as OriginalMissingCoversAnnotationException; -use SebastianBergmann\CodeCoverage\UnintentionallyCoveredCodeException; -use SebastianBergmann\Invoker\Invoker; -use SebastianBergmann\Invoker\TimeoutException; -use SebastianBergmann\ResourceOperations\ResourceOperations; -use SebastianBergmann\Timer\Timer; -use Throwable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class TestResult implements Countable -{ - /** - * @var array - */ - private $passed = []; - - /** - * @var TestFailure[] - */ - private $errors = []; - - /** - * @var TestFailure[] - */ - private $failures = []; - - /** - * @var TestFailure[] - */ - private $warnings = []; - - /** - * @var TestFailure[] - */ - private $notImplemented = []; - - /** - * @var TestFailure[] - */ - private $risky = []; - - /** - * @var TestFailure[] - */ - private $skipped = []; - - /** - * @deprecated Use the `TestHook` interfaces instead - * - * @var TestListener[] - */ - private $listeners = []; - - /** - * @var int - */ - private $runTests = 0; - - /** - * @var float - */ - private $time = 0; - - /** - * @var TestSuite - */ - private $topTestSuite; - - /** - * Code Coverage information. - * - * @var CodeCoverage - */ - private $codeCoverage; - - /** - * @var bool - */ - private $convertDeprecationsToExceptions = false; - - /** - * @var bool - */ - private $convertErrorsToExceptions = true; - - /** - * @var bool - */ - private $convertNoticesToExceptions = true; - - /** - * @var bool - */ - private $convertWarningsToExceptions = true; - - /** - * @var bool - */ - private $stop = false; - - /** - * @var bool - */ - private $stopOnError = false; - - /** - * @var bool - */ - private $stopOnFailure = false; - - /** - * @var bool - */ - private $stopOnWarning = false; - - /** - * @var bool - */ - private $beStrictAboutTestsThatDoNotTestAnything = true; - - /** - * @var bool - */ - private $beStrictAboutOutputDuringTests = false; - - /** - * @var bool - */ - private $beStrictAboutTodoAnnotatedTests = false; - - /** - * @var bool - */ - private $beStrictAboutResourceUsageDuringSmallTests = false; - - /** - * @var bool - */ - private $enforceTimeLimit = false; - - /** - * @var int - */ - private $timeoutForSmallTests = 1; - - /** - * @var int - */ - private $timeoutForMediumTests = 10; - - /** - * @var int - */ - private $timeoutForLargeTests = 60; - - /** - * @var bool - */ - private $stopOnRisky = false; - - /** - * @var bool - */ - private $stopOnIncomplete = false; - - /** - * @var bool - */ - private $stopOnSkipped = false; - - /** - * @var bool - */ - private $lastTestFailed = false; - - /** - * @var int - */ - private $defaultTimeLimit = 0; - - /** - * @var bool - */ - private $stopOnDefect = false; - - /** - * @var bool - */ - private $registerMockObjectsFromTestArgumentsRecursively = false; - - /** - * @deprecated Use the `TestHook` interfaces instead - * - * @codeCoverageIgnore - * - * Registers a TestListener. - */ - public function addListener(TestListener $listener): void - { - $this->listeners[] = $listener; - } - - /** - * @deprecated Use the `TestHook` interfaces instead - * - * @codeCoverageIgnore - * - * Unregisters a TestListener. - */ - public function removeListener(TestListener $listener): void - { - foreach ($this->listeners as $key => $_listener) { - if ($listener === $_listener) { - unset($this->listeners[$key]); - } - } - } - - /** - * @deprecated Use the `TestHook` interfaces instead - * - * @codeCoverageIgnore - * - * Flushes all flushable TestListeners. - */ - public function flushListeners(): void - { - foreach ($this->listeners as $listener) { - if ($listener instanceof Printer) { - $listener->flush(); - } - } - } - - /** - * Adds an error to the list of errors. - */ - public function addError(Test $test, Throwable $t, float $time): void - { - if ($t instanceof RiskyTestError) { - $this->risky[] = new TestFailure($test, $t); - $notifyMethod = 'addRiskyTest'; - - if ($test instanceof TestCase) { - $test->markAsRisky(); - } - - if ($this->stopOnRisky || $this->stopOnDefect) { - $this->stop(); - } - } elseif ($t instanceof IncompleteTest) { - $this->notImplemented[] = new TestFailure($test, $t); - $notifyMethod = 'addIncompleteTest'; - - if ($this->stopOnIncomplete) { - $this->stop(); - } - } elseif ($t instanceof SkippedTest) { - $this->skipped[] = new TestFailure($test, $t); - $notifyMethod = 'addSkippedTest'; - - if ($this->stopOnSkipped) { - $this->stop(); - } - } else { - $this->errors[] = new TestFailure($test, $t); - $notifyMethod = 'addError'; - - if ($this->stopOnError || $this->stopOnFailure) { - $this->stop(); - } - } - - // @see https://github.com/sebastianbergmann/phpunit/issues/1953 - if ($t instanceof Error) { - $t = new ExceptionWrapper($t); - } - - foreach ($this->listeners as $listener) { - $listener->{$notifyMethod}($test, $t, $time); - } - - $this->lastTestFailed = true; - $this->time += $time; - } - - /** - * Adds a warning to the list of warnings. - * The passed in exception caused the warning. - */ - public function addWarning(Test $test, Warning $e, float $time): void - { - if ($this->stopOnWarning || $this->stopOnDefect) { - $this->stop(); - } - - $this->warnings[] = new TestFailure($test, $e); - - foreach ($this->listeners as $listener) { - $listener->addWarning($test, $e, $time); - } - - $this->time += $time; - } - - /** - * Adds a failure to the list of failures. - * The passed in exception caused the failure. - */ - public function addFailure(Test $test, AssertionFailedError $e, float $time): void - { - if ($e instanceof RiskyTestError || $e instanceof OutputError) { - $this->risky[] = new TestFailure($test, $e); - $notifyMethod = 'addRiskyTest'; - - if ($test instanceof TestCase) { - $test->markAsRisky(); - } - - if ($this->stopOnRisky || $this->stopOnDefect) { - $this->stop(); - } - } elseif ($e instanceof IncompleteTest) { - $this->notImplemented[] = new TestFailure($test, $e); - $notifyMethod = 'addIncompleteTest'; - - if ($this->stopOnIncomplete) { - $this->stop(); - } - } elseif ($e instanceof SkippedTest) { - $this->skipped[] = new TestFailure($test, $e); - $notifyMethod = 'addSkippedTest'; - - if ($this->stopOnSkipped) { - $this->stop(); - } - } else { - $this->failures[] = new TestFailure($test, $e); - $notifyMethod = 'addFailure'; - - if ($this->stopOnFailure || $this->stopOnDefect) { - $this->stop(); - } - } - - foreach ($this->listeners as $listener) { - $listener->{$notifyMethod}($test, $e, $time); - } - - $this->lastTestFailed = true; - $this->time += $time; - } - - /** - * Informs the result that a test suite will be started. - */ - public function startTestSuite(TestSuite $suite): void - { - if ($this->topTestSuite === null) { - $this->topTestSuite = $suite; - } - - foreach ($this->listeners as $listener) { - $listener->startTestSuite($suite); - } - } - - /** - * Informs the result that a test suite was completed. - */ - public function endTestSuite(TestSuite $suite): void - { - foreach ($this->listeners as $listener) { - $listener->endTestSuite($suite); - } - } - - /** - * Informs the result that a test will be started. - */ - public function startTest(Test $test): void - { - $this->lastTestFailed = false; - $this->runTests += count($test); - - foreach ($this->listeners as $listener) { - $listener->startTest($test); - } - } - - /** - * Informs the result that a test was completed. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function endTest(Test $test, float $time): void - { - foreach ($this->listeners as $listener) { - $listener->endTest($test, $time); - } - - if (!$this->lastTestFailed && $test instanceof TestCase) { - $class = get_class($test); - $key = $class . '::' . $test->getName(); - - $this->passed[$key] = [ - 'result' => $test->getResult(), - 'size' => TestUtil::getSize( - $class, - $test->getName(false) - ), - ]; - - $this->time += $time; - } - } - - /** - * Returns true if no risky test occurred. - */ - public function allHarmless(): bool - { - return $this->riskyCount() == 0; - } - - /** - * Gets the number of risky tests. - */ - public function riskyCount(): int - { - return count($this->risky); - } - - /** - * Returns true if no incomplete test occurred. - */ - public function allCompletelyImplemented(): bool - { - return $this->notImplementedCount() == 0; - } - - /** - * Gets the number of incomplete tests. - */ - public function notImplementedCount(): int - { - return count($this->notImplemented); - } - - /** - * Returns an array of TestFailure objects for the risky tests. - * - * @return TestFailure[] - */ - public function risky(): array - { - return $this->risky; - } - - /** - * Returns an array of TestFailure objects for the incomplete tests. - * - * @return TestFailure[] - */ - public function notImplemented(): array - { - return $this->notImplemented; - } - - /** - * Returns true if no test has been skipped. - */ - public function noneSkipped(): bool - { - return $this->skippedCount() == 0; - } - - /** - * Gets the number of skipped tests. - */ - public function skippedCount(): int - { - return count($this->skipped); - } - - /** - * Returns an array of TestFailure objects for the skipped tests. - * - * @return TestFailure[] - */ - public function skipped(): array - { - return $this->skipped; - } - - /** - * Gets the number of detected errors. - */ - public function errorCount(): int - { - return count($this->errors); - } - - /** - * Returns an array of TestFailure objects for the errors. - * - * @return TestFailure[] - */ - public function errors(): array - { - return $this->errors; - } - - /** - * Gets the number of detected failures. - */ - public function failureCount(): int - { - return count($this->failures); - } - - /** - * Returns an array of TestFailure objects for the failures. - * - * @return TestFailure[] - */ - public function failures(): array - { - return $this->failures; - } - - /** - * Gets the number of detected warnings. - */ - public function warningCount(): int - { - return count($this->warnings); - } - - /** - * Returns an array of TestFailure objects for the warnings. - * - * @return TestFailure[] - */ - public function warnings(): array - { - return $this->warnings; - } - - /** - * Returns the names of the tests that have passed. - */ - public function passed(): array - { - return $this->passed; - } - - /** - * Returns the (top) test suite. - */ - public function topTestSuite(): TestSuite - { - return $this->topTestSuite; - } - - /** - * Returns whether code coverage information should be collected. - */ - public function getCollectCodeCoverageInformation(): bool - { - return $this->codeCoverage !== null; - } - - /** - * Runs a TestCase. - * - * @throws \SebastianBergmann\CodeCoverage\InvalidArgumentException - * @throws \SebastianBergmann\CodeCoverage\RuntimeException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws CodeCoverageException - * @throws OriginalCoveredCodeNotExecutedException - * @throws OriginalMissingCoversAnnotationException - * @throws UnintentionallyCoveredCodeException - */ - public function run(Test $test): void - { - Assert::resetCount(); - - $size = TestUtil::UNKNOWN; - - if ($test instanceof TestCase) { - $test->setRegisterMockObjectsFromTestArgumentsRecursively( - $this->registerMockObjectsFromTestArgumentsRecursively - ); - - $isAnyCoverageRequired = TestUtil::requiresCodeCoverageDataCollection($test); - $size = $test->getSize(); - } - - $error = false; - $failure = false; - $warning = false; - $incomplete = false; - $risky = false; - $skipped = false; - - $this->startTest($test); - - if ($this->convertDeprecationsToExceptions || $this->convertErrorsToExceptions || $this->convertNoticesToExceptions || $this->convertWarningsToExceptions) { - $errorHandler = new ErrorHandler( - $this->convertDeprecationsToExceptions, - $this->convertErrorsToExceptions, - $this->convertNoticesToExceptions, - $this->convertWarningsToExceptions - ); - - $errorHandler->register(); - } - - $collectCodeCoverage = $this->codeCoverage !== null && - !$test instanceof WarningTestCase && - $isAnyCoverageRequired; - - if ($collectCodeCoverage) { - $this->codeCoverage->start($test); - } - - $monitorFunctions = $this->beStrictAboutResourceUsageDuringSmallTests && - !$test instanceof WarningTestCase && - $size === TestUtil::SMALL && - function_exists('xdebug_start_function_monitor'); - - if ($monitorFunctions) { - /* @noinspection ForgottenDebugOutputInspection */ - xdebug_start_function_monitor(ResourceOperations::getFunctions()); - } - - Timer::start(); - - try { - if (!$test instanceof WarningTestCase && - $this->shouldTimeLimitBeEnforced($size)) { - switch ($size) { - case TestUtil::SMALL: - $_timeout = $this->timeoutForSmallTests; - - break; - - case TestUtil::MEDIUM: - $_timeout = $this->timeoutForMediumTests; - - break; - - case TestUtil::LARGE: - $_timeout = $this->timeoutForLargeTests; - - break; - - default: - $_timeout = $this->defaultTimeLimit; - } - - $invoker = new Invoker; - $invoker->invoke([$test, 'runBare'], [], $_timeout); - } else { - $test->runBare(); - } - } catch (TimeoutException $e) { - $this->addFailure( - $test, - new RiskyTestError( - $e->getMessage() - ), - $_timeout - ); - - $risky = true; - } catch (MockObjectException $e) { - $e = new Warning( - $e->getMessage() - ); - - $warning = true; - } catch (AssertionFailedError $e) { - $failure = true; - - if ($e instanceof RiskyTestError) { - $risky = true; - } elseif ($e instanceof IncompleteTestError) { - $incomplete = true; - } elseif ($e instanceof SkippedTestError) { - $skipped = true; - } - } catch (AssertionError $e) { - $test->addToAssertionCount(1); - - $failure = true; - $frame = $e->getTrace()[0]; - - $e = new AssertionFailedError( - sprintf( - '%s in %s:%s', - $e->getMessage(), - $frame['file'], - $frame['line'] - ) - ); - } catch (Warning $e) { - $warning = true; - } catch (Exception $e) { - $error = true; - } catch (Throwable $e) { - $e = new ExceptionWrapper($e); - $error = true; - } - - $time = Timer::stop(); - $test->addToAssertionCount(Assert::getCount()); - - if ($monitorFunctions) { - $blacklist = new Blacklist; - - /** @noinspection ForgottenDebugOutputInspection */ - $functions = xdebug_get_monitored_functions(); - - /* @noinspection ForgottenDebugOutputInspection */ - xdebug_stop_function_monitor(); - - foreach ($functions as $function) { - if (!$blacklist->isBlacklisted($function['filename'])) { - $this->addFailure( - $test, - new RiskyTestError( - sprintf( - '%s() used in %s:%s', - $function['function'], - $function['filename'], - $function['lineno'] - ) - ), - $time - ); - } - } - } - - if ($this->beStrictAboutTestsThatDoNotTestAnything && - $test->getNumAssertions() == 0) { - $risky = true; - } - - if ($collectCodeCoverage) { - $append = !$risky && !$incomplete && !$skipped; - $linesToBeCovered = []; - $linesToBeUsed = []; - - if ($append && $test instanceof TestCase) { - try { - $linesToBeCovered = TestUtil::getLinesToBeCovered( - get_class($test), - $test->getName(false) - ); - - $linesToBeUsed = TestUtil::getLinesToBeUsed( - get_class($test), - $test->getName(false) - ); - } catch (InvalidCoversTargetException $cce) { - $this->addWarning( - $test, - new Warning( - $cce->getMessage() - ), - $time - ); - } - } - - try { - $this->codeCoverage->stop( - $append, - $linesToBeCovered, - $linesToBeUsed - ); - } catch (UnintentionallyCoveredCodeException $cce) { - $this->addFailure( - $test, - new UnintentionallyCoveredCodeError( - 'This test executed code that is not listed as code to be covered or used:' . - PHP_EOL . $cce->getMessage() - ), - $time - ); - } catch (OriginalCoveredCodeNotExecutedException $cce) { - $this->addFailure( - $test, - new CoveredCodeNotExecutedException( - 'This test did not execute all the code that is listed as code to be covered:' . - PHP_EOL . $cce->getMessage() - ), - $time - ); - } catch (OriginalMissingCoversAnnotationException $cce) { - if ($linesToBeCovered !== false) { - $this->addFailure( - $test, - new MissingCoversAnnotationException( - 'This test does not have a @covers annotation but is expected to have one' - ), - $time - ); - } - } catch (OriginalCodeCoverageException $cce) { - $error = true; - - $e = $e ?? $cce; - } - } - - if (isset($errorHandler)) { - $errorHandler->unregister(); - - unset($errorHandler); - } - - if ($error) { - $this->addError($test, $e, $time); - } elseif ($failure) { - $this->addFailure($test, $e, $time); - } elseif ($warning) { - $this->addWarning($test, $e, $time); - } elseif ($this->beStrictAboutTestsThatDoNotTestAnything && - !$test->doesNotPerformAssertions() && - $test->getNumAssertions() == 0) { - try { - $reflected = new ReflectionClass($test); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - $name = $test->getName(false); - - if ($name && $reflected->hasMethod($name)) { - try { - $reflected = $reflected->getMethod($name); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - } - - $this->addFailure( - $test, - new RiskyTestError( - sprintf( - "This test did not perform any assertions\n\n%s:%d", - $reflected->getFileName(), - $reflected->getStartLine() - ) - ), - $time - ); - } elseif ($this->beStrictAboutTestsThatDoNotTestAnything && - $test->doesNotPerformAssertions() && - $test->getNumAssertions() > 0) { - $this->addFailure( - $test, - new RiskyTestError( - sprintf( - 'This test is annotated with "@doesNotPerformAssertions" but performed %d assertions', - $test->getNumAssertions() - ) - ), - $time - ); - } elseif ($this->beStrictAboutOutputDuringTests && $test->hasOutput()) { - $this->addFailure( - $test, - new OutputError( - sprintf( - 'This test printed output: %s', - $test->getActualOutput() - ) - ), - $time - ); - } elseif ($this->beStrictAboutTodoAnnotatedTests && $test instanceof TestCase) { - $annotations = $test->getAnnotations(); - - if (isset($annotations['method']['todo'])) { - $this->addFailure( - $test, - new RiskyTestError( - 'Test method is annotated with @todo' - ), - $time - ); - } - } - - $this->endTest($test, $time); - } - - /** - * Gets the number of run tests. - */ - public function count(): int - { - return $this->runTests; - } - - /** - * Checks whether the test run should stop. - */ - public function shouldStop(): bool - { - return $this->stop; - } - - /** - * Marks that the test run should stop. - */ - public function stop(): void - { - $this->stop = true; - } - - /** - * Returns the code coverage object. - */ - public function getCodeCoverage(): ?CodeCoverage - { - return $this->codeCoverage; - } - - /** - * Sets the code coverage object. - */ - public function setCodeCoverage(CodeCoverage $codeCoverage): void - { - $this->codeCoverage = $codeCoverage; - } - - /** - * Enables or disables the deprecation-to-exception conversion. - */ - public function convertDeprecationsToExceptions(bool $flag): void - { - $this->convertDeprecationsToExceptions = $flag; - } - - /** - * Returns the deprecation-to-exception conversion setting. - */ - public function getConvertDeprecationsToExceptions(): bool - { - return $this->convertDeprecationsToExceptions; - } - - /** - * Enables or disables the error-to-exception conversion. - */ - public function convertErrorsToExceptions(bool $flag): void - { - $this->convertErrorsToExceptions = $flag; - } - - /** - * Returns the error-to-exception conversion setting. - */ - public function getConvertErrorsToExceptions(): bool - { - return $this->convertErrorsToExceptions; - } - - /** - * Enables or disables the notice-to-exception conversion. - */ - public function convertNoticesToExceptions(bool $flag): void - { - $this->convertNoticesToExceptions = $flag; - } - - /** - * Returns the notice-to-exception conversion setting. - */ - public function getConvertNoticesToExceptions(): bool - { - return $this->convertNoticesToExceptions; - } - - /** - * Enables or disables the warning-to-exception conversion. - */ - public function convertWarningsToExceptions(bool $flag): void - { - $this->convertWarningsToExceptions = $flag; - } - - /** - * Returns the warning-to-exception conversion setting. - */ - public function getConvertWarningsToExceptions(): bool - { - return $this->convertWarningsToExceptions; - } - - /** - * Enables or disables the stopping when an error occurs. - */ - public function stopOnError(bool $flag): void - { - $this->stopOnError = $flag; - } - - /** - * Enables or disables the stopping when a failure occurs. - */ - public function stopOnFailure(bool $flag): void - { - $this->stopOnFailure = $flag; - } - - /** - * Enables or disables the stopping when a warning occurs. - */ - public function stopOnWarning(bool $flag): void - { - $this->stopOnWarning = $flag; - } - - public function beStrictAboutTestsThatDoNotTestAnything(bool $flag): void - { - $this->beStrictAboutTestsThatDoNotTestAnything = $flag; - } - - public function isStrictAboutTestsThatDoNotTestAnything(): bool - { - return $this->beStrictAboutTestsThatDoNotTestAnything; - } - - public function beStrictAboutOutputDuringTests(bool $flag): void - { - $this->beStrictAboutOutputDuringTests = $flag; - } - - public function isStrictAboutOutputDuringTests(): bool - { - return $this->beStrictAboutOutputDuringTests; - } - - public function beStrictAboutResourceUsageDuringSmallTests(bool $flag): void - { - $this->beStrictAboutResourceUsageDuringSmallTests = $flag; - } - - public function isStrictAboutResourceUsageDuringSmallTests(): bool - { - return $this->beStrictAboutResourceUsageDuringSmallTests; - } - - public function enforceTimeLimit(bool $flag): void - { - $this->enforceTimeLimit = $flag; - } - - public function enforcesTimeLimit(): bool - { - return $this->enforceTimeLimit; - } - - public function beStrictAboutTodoAnnotatedTests(bool $flag): void - { - $this->beStrictAboutTodoAnnotatedTests = $flag; - } - - public function isStrictAboutTodoAnnotatedTests(): bool - { - return $this->beStrictAboutTodoAnnotatedTests; - } - - /** - * Enables or disables the stopping for risky tests. - */ - public function stopOnRisky(bool $flag): void - { - $this->stopOnRisky = $flag; - } - - /** - * Enables or disables the stopping for incomplete tests. - */ - public function stopOnIncomplete(bool $flag): void - { - $this->stopOnIncomplete = $flag; - } - - /** - * Enables or disables the stopping for skipped tests. - */ - public function stopOnSkipped(bool $flag): void - { - $this->stopOnSkipped = $flag; - } - - /** - * Enables or disables the stopping for defects: error, failure, warning. - */ - public function stopOnDefect(bool $flag): void - { - $this->stopOnDefect = $flag; - } - - /** - * Returns the time spent running the tests. - */ - public function time(): float - { - return $this->time; - } - - /** - * Returns whether the entire test was successful or not. - */ - public function wasSuccessful(): bool - { - return $this->wasSuccessfulIgnoringWarnings() && empty($this->warnings); - } - - public function wasSuccessfulIgnoringWarnings(): bool - { - return empty($this->errors) && empty($this->failures); - } - - public function wasSuccessfulAndNoTestIsRiskyOrSkippedOrIncomplete(): bool - { - return $this->wasSuccessful() && $this->allHarmless() && $this->allCompletelyImplemented() && $this->noneSkipped(); - } - - /** - * Sets the default timeout for tests. - */ - public function setDefaultTimeLimit(int $timeout): void - { - $this->defaultTimeLimit = $timeout; - } - - /** - * Sets the timeout for small tests. - */ - public function setTimeoutForSmallTests(int $timeout): void - { - $this->timeoutForSmallTests = $timeout; - } - - /** - * Sets the timeout for medium tests. - */ - public function setTimeoutForMediumTests(int $timeout): void - { - $this->timeoutForMediumTests = $timeout; - } - - /** - * Sets the timeout for large tests. - */ - public function setTimeoutForLargeTests(int $timeout): void - { - $this->timeoutForLargeTests = $timeout; - } - - /** - * Returns the set timeout for large tests. - */ - public function getTimeoutForLargeTests(): int - { - return $this->timeoutForLargeTests; - } - - public function setRegisterMockObjectsFromTestArgumentsRecursively(bool $flag): void - { - $this->registerMockObjectsFromTestArgumentsRecursively = $flag; - } - - private function shouldTimeLimitBeEnforced(int $size): bool - { - if (!$this->enforceTimeLimit) { - return false; - } - - if (!(($this->defaultTimeLimit || $size !== TestUtil::UNKNOWN))) { - return false; - } - - if (!extension_loaded('pcntl')) { - return false; - } - - if (!class_exists(Invoker::class)) { - return false; - } - - if (extension_loaded('xdebug') && xdebug_is_debugger_active()) { - return false; - } - - return true; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/TestSuite.php b/vendor/phpunit/phpunit/src/Framework/TestSuite.php deleted file mode 100644 index 144cb6f..0000000 --- a/vendor/phpunit/phpunit/src/Framework/TestSuite.php +++ /dev/null @@ -1,796 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -use const PHP_EOL; -use function array_diff; -use function array_keys; -use function array_merge; -use function basename; -use function call_user_func; -use function class_exists; -use function count; -use function dirname; -use function file_exists; -use function get_declared_classes; -use function implode; -use function is_bool; -use function is_object; -use function is_string; -use function method_exists; -use function preg_match; -use function preg_quote; -use function sprintf; -use function substr; -use Iterator; -use IteratorAggregate; -use PHPUnit\Runner\BaseTestRunner; -use PHPUnit\Runner\Filter\Factory; -use PHPUnit\Runner\PhptTestCase; -use PHPUnit\Util\FileLoader; -use PHPUnit\Util\Test as TestUtil; -use ReflectionClass; -use ReflectionException; -use ReflectionMethod; -use Throwable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -class TestSuite implements IteratorAggregate, SelfDescribing, Test -{ - /** - * Enable or disable the backup and restoration of the $GLOBALS array. - * - * @var bool - */ - protected $backupGlobals; - - /** - * Enable or disable the backup and restoration of static attributes. - * - * @var bool - */ - protected $backupStaticAttributes; - - /** - * @var bool - */ - protected $runTestInSeparateProcess = false; - - /** - * The name of the test suite. - * - * @var string - */ - protected $name = ''; - - /** - * The test groups of the test suite. - * - * @var array - */ - protected $groups = []; - - /** - * The tests in the test suite. - * - * @var Test[] - */ - protected $tests = []; - - /** - * The number of tests in the test suite. - * - * @var int - */ - protected $numTests = -1; - - /** - * @var bool - */ - protected $testCase = false; - - /** - * @var string[] - */ - protected $foundClasses = []; - - /** - * Last count of tests in this suite. - * - * @var null|int - */ - private $cachedNumTests; - - /** - * @var bool - */ - private $beStrictAboutChangesToGlobalState; - - /** - * @var Factory - */ - private $iteratorFilter; - - /** - * @var string[] - */ - private $declaredClasses; - - /** - * Constructs a new TestSuite:. - * - * - PHPUnit\Framework\TestSuite() constructs an empty TestSuite. - * - * - PHPUnit\Framework\TestSuite(ReflectionClass) constructs a - * TestSuite from the given class. - * - * - PHPUnit\Framework\TestSuite(ReflectionClass, String) - * constructs a TestSuite from the given class with the given - * name. - * - * - PHPUnit\Framework\TestSuite(String) either constructs a - * TestSuite from the given class (if the passed string is the - * name of an existing class) or constructs an empty TestSuite - * with the given name. - * - * @param ReflectionClass|string $theClass - * - * @throws Exception - */ - public function __construct($theClass = '', string $name = '') - { - if (!is_string($theClass) && !$theClass instanceof ReflectionClass) { - throw InvalidArgumentException::create( - 1, - 'ReflectionClass object or string' - ); - } - - $this->declaredClasses = get_declared_classes(); - - if (!$theClass instanceof ReflectionClass) { - if (class_exists($theClass, true)) { - if ($name === '') { - $name = $theClass; - } - - try { - $theClass = new ReflectionClass($theClass); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - } else { - $this->setName($theClass); - - return; - } - } - - if (!$theClass->isSubclassOf(TestCase::class)) { - $this->setName((string) $theClass); - - return; - } - - if ($name !== '') { - $this->setName($name); - } else { - $this->setName($theClass->getName()); - } - - $constructor = $theClass->getConstructor(); - - if ($constructor !== null && - !$constructor->isPublic()) { - $this->addTest( - new WarningTestCase( - sprintf( - 'Class "%s" has no public constructor.', - $theClass->getName() - ) - ) - ); - - return; - } - - foreach ($theClass->getMethods() as $method) { - if ($method->getDeclaringClass()->getName() === Assert::class) { - continue; - } - - if ($method->getDeclaringClass()->getName() === TestCase::class) { - continue; - } - - if (!TestUtil::isTestMethod($method)) { - continue; - } - - $this->addTestMethod($theClass, $method); - } - - if (empty($this->tests)) { - $this->addTest( - new WarningTestCase( - sprintf( - 'No tests found in class "%s".', - $theClass->getName() - ) - ) - ); - } - - $this->testCase = true; - } - - /** - * Returns a string representation of the test suite. - */ - public function toString(): string - { - return $this->getName(); - } - - /** - * Adds a test to the suite. - * - * @param array $groups - */ - public function addTest(Test $test, $groups = []): void - { - try { - $class = new ReflectionClass($test); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - if (!$class->isAbstract()) { - $this->tests[] = $test; - $this->numTests = -1; - - if ($test instanceof self && empty($groups)) { - $groups = $test->getGroups(); - } - - if (empty($groups)) { - $groups = ['default']; - } - - foreach ($groups as $group) { - if (!isset($this->groups[$group])) { - $this->groups[$group] = [$test]; - } else { - $this->groups[$group][] = $test; - } - } - - if ($test instanceof TestCase) { - $test->setGroups($groups); - } - } - } - - /** - * Adds the tests from the given class to the suite. - * - * @param object|string $testClass - * - * @throws Exception - */ - public function addTestSuite($testClass): void - { - if (!(is_object($testClass) || (is_string($testClass) && class_exists($testClass)))) { - throw InvalidArgumentException::create( - 1, - 'class name or object' - ); - } - - if (!is_object($testClass)) { - try { - $testClass = new ReflectionClass($testClass); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - } - - if ($testClass instanceof self) { - $this->addTest($testClass); - } elseif ($testClass instanceof ReflectionClass) { - $suiteMethod = false; - - if (!$testClass->isAbstract() && $testClass->hasMethod(BaseTestRunner::SUITE_METHODNAME)) { - try { - $method = $testClass->getMethod( - BaseTestRunner::SUITE_METHODNAME - ); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - if ($method->isStatic()) { - $this->addTest( - $method->invoke(null, $testClass->getName()) - ); - - $suiteMethod = true; - } - } - - if (!$suiteMethod && !$testClass->isAbstract() && $testClass->isSubclassOf(TestCase::class)) { - $this->addTest(new self($testClass)); - } - } else { - throw new Exception; - } - } - - /** - * Wraps both addTest() and addTestSuite - * as well as the separate import statements for the user's convenience. - * - * If the named file cannot be read or there are no new tests that can be - * added, a PHPUnit\Framework\WarningTestCase will be created instead, - * leaving the current test run untouched. - * - * @throws Exception - */ - public function addTestFile(string $filename): void - { - if (file_exists($filename) && substr($filename, -5) === '.phpt') { - $this->addTest( - new PhptTestCase($filename) - ); - - return; - } - - // The given file may contain further stub classes in addition to the - // test class itself. Figure out the actual test class. - $filename = FileLoader::checkAndLoad($filename); - $newClasses = array_diff(get_declared_classes(), $this->declaredClasses); - - // The diff is empty in case a parent class (with test methods) is added - // AFTER a child class that inherited from it. To account for that case, - // accumulate all discovered classes, so the parent class may be found in - // a later invocation. - if (!empty($newClasses)) { - // On the assumption that test classes are defined first in files, - // process discovered classes in approximate LIFO order, so as to - // avoid unnecessary reflection. - $this->foundClasses = array_merge($newClasses, $this->foundClasses); - $this->declaredClasses = get_declared_classes(); - } - - // The test class's name must match the filename, either in full, or as - // a PEAR/PSR-0 prefixed short name ('NameSpace_ShortName'), or as a - // PSR-1 local short name ('NameSpace\ShortName'). The comparison must be - // anchored to prevent false-positive matches (e.g., 'OtherShortName'). - $shortName = basename($filename, '.php'); - $shortNameRegEx = '/(?:^|_|\\\\)' . preg_quote($shortName, '/') . '$/'; - - foreach ($this->foundClasses as $i => $className) { - if (preg_match($shortNameRegEx, $className)) { - try { - $class = new ReflectionClass($className); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - if ($class->getFileName() == $filename) { - $newClasses = [$className]; - unset($this->foundClasses[$i]); - - break; - } - } - } - - foreach ($newClasses as $className) { - try { - $class = new ReflectionClass($className); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - if (dirname($class->getFileName()) === __DIR__) { - continue; - } - - if (!$class->isAbstract()) { - if ($class->hasMethod(BaseTestRunner::SUITE_METHODNAME)) { - try { - $method = $class->getMethod( - BaseTestRunner::SUITE_METHODNAME - ); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - if ($method->isStatic()) { - $this->addTest($method->invoke(null, $className)); - } - } elseif ($class->implementsInterface(Test::class)) { - $this->addTestSuite($class); - } - } - } - - $this->numTests = -1; - } - - /** - * Wrapper for addTestFile() that adds multiple test files. - * - * @throws Exception - */ - public function addTestFiles(iterable $fileNames): void - { - foreach ($fileNames as $filename) { - $this->addTestFile((string) $filename); - } - } - - /** - * Counts the number of test cases that will be run by this test. - */ - public function count(bool $preferCache = false): int - { - if ($preferCache && $this->cachedNumTests !== null) { - return $this->cachedNumTests; - } - - $numTests = 0; - - foreach ($this as $test) { - $numTests += count($test); - } - - $this->cachedNumTests = $numTests; - - return $numTests; - } - - /** - * Returns the name of the suite. - */ - public function getName(): string - { - return $this->name; - } - - /** - * Returns the test groups of the suite. - */ - public function getGroups(): array - { - return array_keys($this->groups); - } - - public function getGroupDetails(): array - { - return $this->groups; - } - - /** - * Set tests groups of the test case. - */ - public function setGroupDetails(array $groups): void - { - $this->groups = $groups; - } - - /** - * Runs the tests and collects their result in a TestResult. - * - * @throws \PHPUnit\Framework\CodeCoverageException - * @throws \SebastianBergmann\CodeCoverage\CoveredCodeNotExecutedException - * @throws \SebastianBergmann\CodeCoverage\InvalidArgumentException - * @throws \SebastianBergmann\CodeCoverage\MissingCoversAnnotationException - * @throws \SebastianBergmann\CodeCoverage\RuntimeException - * @throws \SebastianBergmann\CodeCoverage\UnintentionallyCoveredCodeException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Warning - */ - public function run(TestResult $result = null): TestResult - { - if ($result === null) { - $result = $this->createResult(); - } - - if (count($this) === 0) { - return $result; - } - - /** @psalm-var class-string $className */ - $className = $this->name; - $hookMethods = TestUtil::getHookMethods($className); - - $result->startTestSuite($this); - - try { - foreach ($hookMethods['beforeClass'] as $beforeClassMethod) { - if ($this->testCase && - class_exists($this->name, false) && - method_exists($this->name, $beforeClassMethod)) { - if ($missingRequirements = TestUtil::getMissingRequirements($this->name, $beforeClassMethod)) { - $this->markTestSuiteSkipped(implode(PHP_EOL, $missingRequirements)); - } - - call_user_func([$this->name, $beforeClassMethod]); - } - } - } catch (SkippedTestSuiteError $error) { - foreach ($this->tests() as $test) { - $result->startTest($test); - $result->addFailure($test, $error, 0); - $result->endTest($test, 0); - } - - $result->endTestSuite($this); - - return $result; - } catch (Throwable $t) { - $errorAdded = false; - - foreach ($this->tests() as $test) { - if ($result->shouldStop()) { - break; - } - - $result->startTest($test); - - if (!$errorAdded) { - $result->addError($test, $t, 0); - - $errorAdded = true; - } else { - $result->addFailure( - $test, - new SkippedTestError('Test skipped because of an error in hook method'), - 0 - ); - } - - $result->endTest($test, 0); - } - - $result->endTestSuite($this); - - return $result; - } - - foreach ($this as $test) { - if ($result->shouldStop()) { - break; - } - - if ($test instanceof TestCase || $test instanceof self) { - $test->setBeStrictAboutChangesToGlobalState($this->beStrictAboutChangesToGlobalState); - $test->setBackupGlobals($this->backupGlobals); - $test->setBackupStaticAttributes($this->backupStaticAttributes); - $test->setRunTestInSeparateProcess($this->runTestInSeparateProcess); - } - - $test->run($result); - } - - try { - foreach ($hookMethods['afterClass'] as $afterClassMethod) { - if ($this->testCase && - class_exists($this->name, false) && - method_exists($this->name, $afterClassMethod)) { - call_user_func([$this->name, $afterClassMethod]); - } - } - } catch (Throwable $t) { - $message = "Exception in {$this->name}::{$afterClassMethod}" . PHP_EOL . $t->getMessage(); - $error = new SyntheticError($message, 0, $t->getFile(), $t->getLine(), $t->getTrace()); - - $placeholderTest = clone $test; - $placeholderTest->setName($afterClassMethod); - - $result->startTest($placeholderTest); - $result->addFailure($placeholderTest, $error, 0); - $result->endTest($placeholderTest, 0); - } - - $result->endTestSuite($this); - - return $result; - } - - public function setRunTestInSeparateProcess(bool $runTestInSeparateProcess): void - { - $this->runTestInSeparateProcess = $runTestInSeparateProcess; - } - - public function setName(string $name): void - { - $this->name = $name; - } - - /** - * Returns the test at the given index. - * - * @return false|Test - */ - public function testAt(int $index) - { - return $this->tests[$index] ?? false; - } - - /** - * Returns the tests as an enumeration. - * - * @return Test[] - */ - public function tests(): array - { - return $this->tests; - } - - /** - * Set tests of the test suite. - * - * @param Test[] $tests - */ - public function setTests(array $tests): void - { - $this->tests = $tests; - } - - /** - * Mark the test suite as skipped. - * - * @param string $message - * - * @throws SkippedTestSuiteError - * - * @psalm-return never-return - */ - public function markTestSuiteSkipped($message = ''): void - { - throw new SkippedTestSuiteError($message); - } - - /** - * @param bool $beStrictAboutChangesToGlobalState - */ - public function setBeStrictAboutChangesToGlobalState($beStrictAboutChangesToGlobalState): void - { - if (null === $this->beStrictAboutChangesToGlobalState && is_bool($beStrictAboutChangesToGlobalState)) { - $this->beStrictAboutChangesToGlobalState = $beStrictAboutChangesToGlobalState; - } - } - - /** - * @param bool $backupGlobals - */ - public function setBackupGlobals($backupGlobals): void - { - if (null === $this->backupGlobals && is_bool($backupGlobals)) { - $this->backupGlobals = $backupGlobals; - } - } - - /** - * @param bool $backupStaticAttributes - */ - public function setBackupStaticAttributes($backupStaticAttributes): void - { - if (null === $this->backupStaticAttributes && is_bool($backupStaticAttributes)) { - $this->backupStaticAttributes = $backupStaticAttributes; - } - } - - /** - * Returns an iterator for this test suite. - */ - public function getIterator(): Iterator - { - $iterator = new TestSuiteIterator($this); - - if ($this->iteratorFilter !== null) { - $iterator = $this->iteratorFilter->factory($iterator, $this); - } - - return $iterator; - } - - public function injectFilter(Factory $filter): void - { - $this->iteratorFilter = $filter; - - foreach ($this as $test) { - if ($test instanceof self) { - $test->injectFilter($filter); - } - } - } - - /** - * Creates a default TestResult object. - */ - protected function createResult(): TestResult - { - return new TestResult; - } - - /** - * @throws Exception - */ - protected function addTestMethod(ReflectionClass $class, ReflectionMethod $method): void - { - if (!TestUtil::isTestMethod($method)) { - return; - } - - $methodName = $method->getName(); - - $test = (new TestBuilder)->build($class, $methodName); - - if ($test instanceof TestCase || $test instanceof DataProviderTestSuite) { - $test->setDependencies( - TestUtil::getDependencies($class->getName(), $methodName) - ); - } - - $this->addTest( - $test, - TestUtil::getGroups($class->getName(), $methodName) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/TestSuiteIterator.php b/vendor/phpunit/phpunit/src/Framework/TestSuiteIterator.php deleted file mode 100644 index e351622..0000000 --- a/vendor/phpunit/phpunit/src/Framework/TestSuiteIterator.php +++ /dev/null @@ -1,83 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -use function assert; -use function count; -use RecursiveIterator; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class TestSuiteIterator implements RecursiveIterator -{ - /** - * @var int - */ - private $position = 0; - - /** - * @var Test[] - */ - private $tests; - - public function __construct(TestSuite $testSuite) - { - $this->tests = $testSuite->tests(); - } - - public function rewind(): void - { - $this->position = 0; - } - - public function valid(): bool - { - return $this->position < count($this->tests); - } - - public function key(): int - { - return $this->position; - } - - public function current(): Test - { - return $this->tests[$this->position]; - } - - public function next(): void - { - $this->position++; - } - - /** - * @throws NoChildTestSuiteException - */ - public function getChildren(): self - { - if (!$this->hasChildren()) { - throw new NoChildTestSuiteException( - 'The current item is not a TestSuite instance and therefore does not have any children.' - ); - } - - $current = $this->current(); - - assert($current instanceof TestSuite); - - return new self($current); - } - - public function hasChildren(): bool - { - return $this->valid() && $this->current() instanceof TestSuite; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/WarningTestCase.php b/vendor/phpunit/phpunit/src/Framework/WarningTestCase.php deleted file mode 100644 index e1e41bc..0000000 --- a/vendor/phpunit/phpunit/src/Framework/WarningTestCase.php +++ /dev/null @@ -1,66 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class WarningTestCase extends TestCase -{ - /** - * @var bool - */ - protected $backupGlobals = false; - - /** - * @var bool - */ - protected $backupStaticAttributes = false; - - /** - * @var bool - */ - protected $runTestInSeparateProcess = false; - - /** - * @var string - */ - private $message; - - public function __construct(string $message = '') - { - $this->message = $message; - - parent::__construct('Warning'); - } - - public function getMessage(): string - { - return $this->message; - } - - /** - * Returns a string representation of the test case. - */ - public function toString(): string - { - return 'Warning'; - } - - /** - * @throws Exception - * - * @psalm-return never-return - */ - protected function runTest(): void - { - throw new Warning($this->message); - } -} diff --git a/vendor/phpunit/phpunit/src/Runner/BaseTestRunner.php b/vendor/phpunit/phpunit/src/Runner/BaseTestRunner.php deleted file mode 100644 index 3e5e0f7..0000000 --- a/vendor/phpunit/phpunit/src/Runner/BaseTestRunner.php +++ /dev/null @@ -1,160 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner; - -use function is_dir; -use function is_file; -use PHPUnit\Framework\Exception; -use PHPUnit\Framework\Test; -use PHPUnit\Framework\TestSuite; -use ReflectionClass; -use ReflectionException; -use SebastianBergmann\FileIterator\Facade as FileIteratorFacade; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -abstract class BaseTestRunner -{ - /** - * @var int - */ - public const STATUS_UNKNOWN = -1; - - /** - * @var int - */ - public const STATUS_PASSED = 0; - - /** - * @var int - */ - public const STATUS_SKIPPED = 1; - - /** - * @var int - */ - public const STATUS_INCOMPLETE = 2; - - /** - * @var int - */ - public const STATUS_FAILURE = 3; - - /** - * @var int - */ - public const STATUS_ERROR = 4; - - /** - * @var int - */ - public const STATUS_RISKY = 5; - - /** - * @var int - */ - public const STATUS_WARNING = 6; - - /** - * @var string - */ - public const SUITE_METHODNAME = 'suite'; - - /** - * Returns the loader to be used. - */ - public function getLoader(): TestSuiteLoader - { - return new StandardTestSuiteLoader; - } - - /** - * Returns the Test corresponding to the given suite. - * This is a template method, subclasses override - * the runFailed() and clearStatus() methods. - * - * @param string|string[] $suffixes - * - * @throws Exception - */ - public function getTest(string $suiteClassName, string $suiteClassFile = '', $suffixes = ''): ?Test - { - if (empty($suiteClassFile) && is_dir($suiteClassName) && !is_file($suiteClassName . '.php')) { - /** @var string[] $files */ - $files = (new FileIteratorFacade)->getFilesAsArray( - $suiteClassName, - $suffixes - ); - - $suite = new TestSuite($suiteClassName); - $suite->addTestFiles($files); - - return $suite; - } - - try { - $testClass = $this->loadSuiteClass( - $suiteClassName, - $suiteClassFile - ); - } catch (Exception $e) { - $this->runFailed($e->getMessage()); - - return null; - } - - try { - $suiteMethod = $testClass->getMethod(self::SUITE_METHODNAME); - - if (!$suiteMethod->isStatic()) { - $this->runFailed( - 'suite() method must be static.' - ); - - return null; - } - - $test = $suiteMethod->invoke(null, $testClass->getName()); - } catch (ReflectionException $e) { - try { - $test = new TestSuite($testClass); - } catch (Exception $e) { - $test = new TestSuite; - $test->setName($suiteClassName); - } - } - - $this->clearStatus(); - - return $test; - } - - /** - * Returns the loaded ReflectionClass for a suite name. - */ - protected function loadSuiteClass(string $suiteClassName, string $suiteClassFile = ''): ReflectionClass - { - return $this->getLoader()->load($suiteClassName, $suiteClassFile); - } - - /** - * Clears the status message. - */ - protected function clearStatus(): void - { - } - - /** - * Override to define how to handle a failed loading of - * a test suite. - */ - abstract protected function runFailed(string $message): void; -} diff --git a/vendor/phpunit/phpunit/src/Runner/DefaultTestResultCache.php b/vendor/phpunit/phpunit/src/Runner/DefaultTestResultCache.php deleted file mode 100644 index 19278cc..0000000 --- a/vendor/phpunit/phpunit/src/Runner/DefaultTestResultCache.php +++ /dev/null @@ -1,157 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner; - -use const DIRECTORY_SEPARATOR; -use const LOCK_EX; -use function assert; -use function dirname; -use function file_get_contents; -use function file_put_contents; -use function in_array; -use function is_array; -use function is_dir; -use function is_file; -use function json_decode; -use function json_encode; -use PHPUnit\Util\Filesystem; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class DefaultTestResultCache implements TestResultCache -{ - /** - * @var int - */ - private const VERSION = 1; - - /** - * @psalm-var list - */ - private const ALLOWED_TEST_STATUSES = [ - BaseTestRunner::STATUS_SKIPPED, - BaseTestRunner::STATUS_INCOMPLETE, - BaseTestRunner::STATUS_FAILURE, - BaseTestRunner::STATUS_ERROR, - BaseTestRunner::STATUS_RISKY, - BaseTestRunner::STATUS_WARNING, - ]; - - /** - * @var string - */ - private const DEFAULT_RESULT_CACHE_FILENAME = '.phpunit.result.cache'; - - /** - * @var string - */ - private $cacheFilename; - - /** - * @psalm-var array - */ - private $defects = []; - - /** - * @psalm-var array - */ - private $times = []; - - public function __construct(?string $filepath = null) - { - if ($filepath !== null && is_dir($filepath)) { - $filepath .= DIRECTORY_SEPARATOR . self::DEFAULT_RESULT_CACHE_FILENAME; - } - - $this->cacheFilename = $filepath ?? $_ENV['PHPUNIT_RESULT_CACHE'] ?? self::DEFAULT_RESULT_CACHE_FILENAME; - } - - public function setState(string $testName, int $state): void - { - if (!in_array($state, self::ALLOWED_TEST_STATUSES, true)) { - return; - } - - $this->defects[$testName] = $state; - } - - public function getState(string $testName): int - { - return $this->defects[$testName] ?? BaseTestRunner::STATUS_UNKNOWN; - } - - public function setTime(string $testName, float $time): void - { - $this->times[$testName] = $time; - } - - public function getTime(string $testName): float - { - return $this->times[$testName] ?? 0.0; - } - - public function load(): void - { - if (!is_file($this->cacheFilename)) { - return; - } - - $data = json_decode( - file_get_contents($this->cacheFilename), - true - ); - - if ($data === null) { - return; - } - - if (!isset($data['version'])) { - return; - } - - if ($data['version'] !== self::VERSION) { - return; - } - - assert(isset($data['defects']) && is_array($data['defects'])); - assert(isset($data['times']) && is_array($data['times'])); - - $this->defects = $data['defects']; - $this->times = $data['times']; - } - - /** - * @throws Exception - */ - public function persist(): void - { - if (!Filesystem::createDirectory(dirname($this->cacheFilename))) { - throw new Exception( - sprintf( - 'Cannot create directory "%s" for result cache file', - $this->cacheFilename - ) - ); - } - - file_put_contents( - $this->cacheFilename, - json_encode( - [ - 'version' => self::VERSION, - 'defects' => $this->defects, - 'times' => $this->times, - ] - ), - LOCK_EX - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Runner/Exception.php b/vendor/phpunit/phpunit/src/Runner/Exception.php deleted file mode 100644 index adcd115..0000000 --- a/vendor/phpunit/phpunit/src/Runner/Exception.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner; - -use RuntimeException; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Exception extends RuntimeException implements \PHPUnit\Exception -{ -} diff --git a/vendor/phpunit/phpunit/src/Runner/Filter/ExcludeGroupFilterIterator.php b/vendor/phpunit/phpunit/src/Runner/Filter/ExcludeGroupFilterIterator.php deleted file mode 100644 index 4b26e57..0000000 --- a/vendor/phpunit/phpunit/src/Runner/Filter/ExcludeGroupFilterIterator.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner\Filter; - -use function in_array; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ExcludeGroupFilterIterator extends GroupFilterIterator -{ - protected function doAccept(string $hash): bool - { - return !in_array($hash, $this->groupTests, true); - } -} diff --git a/vendor/phpunit/phpunit/src/Runner/Filter/Factory.php b/vendor/phpunit/phpunit/src/Runner/Filter/Factory.php deleted file mode 100644 index 82dc1b7..0000000 --- a/vendor/phpunit/phpunit/src/Runner/Filter/Factory.php +++ /dev/null @@ -1,56 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner\Filter; - -use function sprintf; -use FilterIterator; -use InvalidArgumentException; -use Iterator; -use PHPUnit\Framework\TestSuite; -use RecursiveFilterIterator; -use ReflectionClass; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Factory -{ - /** - * @var array - */ - private $filters = []; - - /** - * @throws InvalidArgumentException - */ - public function addFilter(ReflectionClass $filter, $args): void - { - if (!$filter->isSubclassOf(RecursiveFilterIterator::class)) { - throw new InvalidArgumentException( - sprintf( - 'Class "%s" does not extend RecursiveFilterIterator', - $filter->name - ) - ); - } - - $this->filters[] = [$filter, $args]; - } - - public function factory(Iterator $iterator, TestSuite $suite): FilterIterator - { - foreach ($this->filters as $filter) { - [$class, $args] = $filter; - $iterator = $class->newInstance($iterator, $args, $suite); - } - - return $iterator; - } -} diff --git a/vendor/phpunit/phpunit/src/Runner/Filter/GroupFilterIterator.php b/vendor/phpunit/phpunit/src/Runner/Filter/GroupFilterIterator.php deleted file mode 100644 index 42ca77a..0000000 --- a/vendor/phpunit/phpunit/src/Runner/Filter/GroupFilterIterator.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner\Filter; - -use function array_map; -use function array_merge; -use function in_array; -use function spl_object_hash; -use PHPUnit\Framework\TestSuite; -use RecursiveFilterIterator; -use RecursiveIterator; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -abstract class GroupFilterIterator extends RecursiveFilterIterator -{ - /** - * @var string[] - */ - protected $groupTests = []; - - public function __construct(RecursiveIterator $iterator, array $groups, TestSuite $suite) - { - parent::__construct($iterator); - - foreach ($suite->getGroupDetails() as $group => $tests) { - if (in_array((string) $group, $groups, true)) { - $testHashes = array_map( - 'spl_object_hash', - $tests - ); - - $this->groupTests = array_merge($this->groupTests, $testHashes); - } - } - } - - public function accept(): bool - { - $test = $this->getInnerIterator()->current(); - - if ($test instanceof TestSuite) { - return true; - } - - return $this->doAccept(spl_object_hash($test)); - } - - abstract protected function doAccept(string $hash); -} diff --git a/vendor/phpunit/phpunit/src/Runner/Filter/IncludeGroupFilterIterator.php b/vendor/phpunit/phpunit/src/Runner/Filter/IncludeGroupFilterIterator.php deleted file mode 100644 index 0346c60..0000000 --- a/vendor/phpunit/phpunit/src/Runner/Filter/IncludeGroupFilterIterator.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner\Filter; - -use function in_array; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class IncludeGroupFilterIterator extends GroupFilterIterator -{ - protected function doAccept(string $hash): bool - { - return in_array($hash, $this->groupTests, true); - } -} diff --git a/vendor/phpunit/phpunit/src/Runner/Filter/NameFilterIterator.php b/vendor/phpunit/phpunit/src/Runner/Filter/NameFilterIterator.php deleted file mode 100644 index d90054d..0000000 --- a/vendor/phpunit/phpunit/src/Runner/Filter/NameFilterIterator.php +++ /dev/null @@ -1,135 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner\Filter; - -use function end; -use function implode; -use function preg_match; -use function sprintf; -use function str_replace; -use Exception; -use PHPUnit\Framework\TestSuite; -use PHPUnit\Framework\WarningTestCase; -use PHPUnit\Util\RegularExpression; -use RecursiveFilterIterator; -use RecursiveIterator; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class NameFilterIterator extends RecursiveFilterIterator -{ - /** - * @var string - */ - private $filter; - - /** - * @var int - */ - private $filterMin; - - /** - * @var int - */ - private $filterMax; - - /** - * @throws Exception - */ - public function __construct(RecursiveIterator $iterator, string $filter) - { - parent::__construct($iterator); - - $this->setFilter($filter); - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function accept(): bool - { - $test = $this->getInnerIterator()->current(); - - if ($test instanceof TestSuite) { - return true; - } - - $tmp = \PHPUnit\Util\Test::describe($test); - - if ($test instanceof WarningTestCase) { - $name = $test->getMessage(); - } elseif ($tmp[0] !== '') { - $name = implode('::', $tmp); - } else { - $name = $tmp[1]; - } - - $accepted = @preg_match($this->filter, $name, $matches); - - if ($accepted && isset($this->filterMax)) { - $set = end($matches); - $accepted = $set >= $this->filterMin && $set <= $this->filterMax; - } - - return (bool) $accepted; - } - - /** - * @throws Exception - */ - private function setFilter(string $filter): void - { - if (RegularExpression::safeMatch($filter, '') === false) { - // Handles: - // * testAssertEqualsSucceeds#4 - // * testAssertEqualsSucceeds#4-8 - if (preg_match('/^(.*?)#(\d+)(?:-(\d+))?$/', $filter, $matches)) { - if (isset($matches[3]) && $matches[2] < $matches[3]) { - $filter = sprintf( - '%s.*with data set #(\d+)$', - $matches[1] - ); - - $this->filterMin = (int) $matches[2]; - $this->filterMax = (int) $matches[3]; - } else { - $filter = sprintf( - '%s.*with data set #%s$', - $matches[1], - $matches[2] - ); - } - } // Handles: - // * testDetermineJsonError@JSON_ERROR_NONE - // * testDetermineJsonError@JSON.* - elseif (preg_match('/^(.*?)@(.+)$/', $filter, $matches)) { - $filter = sprintf( - '%s.*with data set "%s"$', - $matches[1], - $matches[2] - ); - } - - // Escape delimiters in regular expression. Do NOT use preg_quote, - // to keep magic characters. - $filter = sprintf( - '/%s/i', - str_replace( - '/', - '\\/', - $filter - ) - ); - } - - $this->filter = $filter; - } -} diff --git a/vendor/phpunit/phpunit/src/Runner/Hook/AfterIncompleteTestHook.php b/vendor/phpunit/phpunit/src/Runner/Hook/AfterIncompleteTestHook.php deleted file mode 100644 index 35ded5d..0000000 --- a/vendor/phpunit/phpunit/src/Runner/Hook/AfterIncompleteTestHook.php +++ /dev/null @@ -1,15 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner; - -interface AfterIncompleteTestHook extends TestHook -{ - public function executeAfterIncompleteTest(string $test, string $message, float $time): void; -} diff --git a/vendor/phpunit/phpunit/src/Runner/Hook/AfterLastTestHook.php b/vendor/phpunit/phpunit/src/Runner/Hook/AfterLastTestHook.php deleted file mode 100644 index 7dee9f9..0000000 --- a/vendor/phpunit/phpunit/src/Runner/Hook/AfterLastTestHook.php +++ /dev/null @@ -1,15 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner; - -interface AfterLastTestHook extends Hook -{ - public function executeAfterLastTest(): void; -} diff --git a/vendor/phpunit/phpunit/src/Runner/Hook/AfterRiskyTestHook.php b/vendor/phpunit/phpunit/src/Runner/Hook/AfterRiskyTestHook.php deleted file mode 100644 index 7fe9ee7..0000000 --- a/vendor/phpunit/phpunit/src/Runner/Hook/AfterRiskyTestHook.php +++ /dev/null @@ -1,15 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner; - -interface AfterRiskyTestHook extends TestHook -{ - public function executeAfterRiskyTest(string $test, string $message, float $time): void; -} diff --git a/vendor/phpunit/phpunit/src/Runner/Hook/AfterSkippedTestHook.php b/vendor/phpunit/phpunit/src/Runner/Hook/AfterSkippedTestHook.php deleted file mode 100644 index f9253b5..0000000 --- a/vendor/phpunit/phpunit/src/Runner/Hook/AfterSkippedTestHook.php +++ /dev/null @@ -1,15 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner; - -interface AfterSkippedTestHook extends TestHook -{ - public function executeAfterSkippedTest(string $test, string $message, float $time): void; -} diff --git a/vendor/phpunit/phpunit/src/Runner/Hook/AfterSuccessfulTestHook.php b/vendor/phpunit/phpunit/src/Runner/Hook/AfterSuccessfulTestHook.php deleted file mode 100644 index 6b55cc8..0000000 --- a/vendor/phpunit/phpunit/src/Runner/Hook/AfterSuccessfulTestHook.php +++ /dev/null @@ -1,15 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner; - -interface AfterSuccessfulTestHook extends TestHook -{ - public function executeAfterSuccessfulTest(string $test, float $time): void; -} diff --git a/vendor/phpunit/phpunit/src/Runner/Hook/AfterTestErrorHook.php b/vendor/phpunit/phpunit/src/Runner/Hook/AfterTestErrorHook.php deleted file mode 100644 index f5c23fb..0000000 --- a/vendor/phpunit/phpunit/src/Runner/Hook/AfterTestErrorHook.php +++ /dev/null @@ -1,15 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner; - -interface AfterTestErrorHook extends TestHook -{ - public function executeAfterTestError(string $test, string $message, float $time): void; -} diff --git a/vendor/phpunit/phpunit/src/Runner/Hook/AfterTestFailureHook.php b/vendor/phpunit/phpunit/src/Runner/Hook/AfterTestFailureHook.php deleted file mode 100644 index 9ed2939..0000000 --- a/vendor/phpunit/phpunit/src/Runner/Hook/AfterTestFailureHook.php +++ /dev/null @@ -1,15 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner; - -interface AfterTestFailureHook extends TestHook -{ - public function executeAfterTestFailure(string $test, string $message, float $time): void; -} diff --git a/vendor/phpunit/phpunit/src/Runner/Hook/AfterTestHook.php b/vendor/phpunit/phpunit/src/Runner/Hook/AfterTestHook.php deleted file mode 100644 index 7e0af80..0000000 --- a/vendor/phpunit/phpunit/src/Runner/Hook/AfterTestHook.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner; - -interface AfterTestHook extends TestHook -{ - /** - * This hook will fire after any test, regardless of the result. - * - * For more fine grained control, have a look at the other hooks - * that extend PHPUnit\Runner\Hook. - */ - public function executeAfterTest(string $test, float $time): void; -} diff --git a/vendor/phpunit/phpunit/src/Runner/Hook/AfterTestWarningHook.php b/vendor/phpunit/phpunit/src/Runner/Hook/AfterTestWarningHook.php deleted file mode 100644 index 12de80f..0000000 --- a/vendor/phpunit/phpunit/src/Runner/Hook/AfterTestWarningHook.php +++ /dev/null @@ -1,15 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner; - -interface AfterTestWarningHook extends TestHook -{ - public function executeAfterTestWarning(string $test, string $message, float $time): void; -} diff --git a/vendor/phpunit/phpunit/src/Runner/Hook/BeforeFirstTestHook.php b/vendor/phpunit/phpunit/src/Runner/Hook/BeforeFirstTestHook.php deleted file mode 100644 index 59b6666..0000000 --- a/vendor/phpunit/phpunit/src/Runner/Hook/BeforeFirstTestHook.php +++ /dev/null @@ -1,15 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner; - -interface BeforeFirstTestHook extends Hook -{ - public function executeBeforeFirstTest(): void; -} diff --git a/vendor/phpunit/phpunit/src/Runner/Hook/BeforeTestHook.php b/vendor/phpunit/phpunit/src/Runner/Hook/BeforeTestHook.php deleted file mode 100644 index 8bbf8a9..0000000 --- a/vendor/phpunit/phpunit/src/Runner/Hook/BeforeTestHook.php +++ /dev/null @@ -1,15 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner; - -interface BeforeTestHook extends TestHook -{ - public function executeBeforeTest(string $test): void; -} diff --git a/vendor/phpunit/phpunit/src/Runner/Hook/Hook.php b/vendor/phpunit/phpunit/src/Runner/Hook/Hook.php deleted file mode 100644 index 546f1a3..0000000 --- a/vendor/phpunit/phpunit/src/Runner/Hook/Hook.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner; - -interface Hook -{ -} diff --git a/vendor/phpunit/phpunit/src/Runner/Hook/TestHook.php b/vendor/phpunit/phpunit/src/Runner/Hook/TestHook.php deleted file mode 100644 index 47c41f9..0000000 --- a/vendor/phpunit/phpunit/src/Runner/Hook/TestHook.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner; - -interface TestHook extends Hook -{ -} diff --git a/vendor/phpunit/phpunit/src/Runner/Hook/TestListenerAdapter.php b/vendor/phpunit/phpunit/src/Runner/Hook/TestListenerAdapter.php deleted file mode 100644 index 60fbfba..0000000 --- a/vendor/phpunit/phpunit/src/Runner/Hook/TestListenerAdapter.php +++ /dev/null @@ -1,141 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner; - -use PHPUnit\Framework\AssertionFailedError; -use PHPUnit\Framework\Test; -use PHPUnit\Framework\TestListener; -use PHPUnit\Framework\TestSuite; -use PHPUnit\Framework\Warning; -use PHPUnit\Util\Test as TestUtil; -use Throwable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class TestListenerAdapter implements TestListener -{ - /** - * @var TestHook[] - */ - private $hooks = []; - - /** - * @var bool - */ - private $lastTestWasNotSuccessful; - - public function add(TestHook $hook): void - { - $this->hooks[] = $hook; - } - - public function startTest(Test $test): void - { - foreach ($this->hooks as $hook) { - if ($hook instanceof BeforeTestHook) { - $hook->executeBeforeTest(TestUtil::describeAsString($test)); - } - } - - $this->lastTestWasNotSuccessful = false; - } - - public function addError(Test $test, Throwable $t, float $time): void - { - foreach ($this->hooks as $hook) { - if ($hook instanceof AfterTestErrorHook) { - $hook->executeAfterTestError(TestUtil::describeAsString($test), $t->getMessage(), $time); - } - } - - $this->lastTestWasNotSuccessful = true; - } - - public function addWarning(Test $test, Warning $e, float $time): void - { - foreach ($this->hooks as $hook) { - if ($hook instanceof AfterTestWarningHook) { - $hook->executeAfterTestWarning(TestUtil::describeAsString($test), $e->getMessage(), $time); - } - } - - $this->lastTestWasNotSuccessful = true; - } - - public function addFailure(Test $test, AssertionFailedError $e, float $time): void - { - foreach ($this->hooks as $hook) { - if ($hook instanceof AfterTestFailureHook) { - $hook->executeAfterTestFailure(TestUtil::describeAsString($test), $e->getMessage(), $time); - } - } - - $this->lastTestWasNotSuccessful = true; - } - - public function addIncompleteTest(Test $test, Throwable $t, float $time): void - { - foreach ($this->hooks as $hook) { - if ($hook instanceof AfterIncompleteTestHook) { - $hook->executeAfterIncompleteTest(TestUtil::describeAsString($test), $t->getMessage(), $time); - } - } - - $this->lastTestWasNotSuccessful = true; - } - - public function addRiskyTest(Test $test, Throwable $t, float $time): void - { - foreach ($this->hooks as $hook) { - if ($hook instanceof AfterRiskyTestHook) { - $hook->executeAfterRiskyTest(TestUtil::describeAsString($test), $t->getMessage(), $time); - } - } - - $this->lastTestWasNotSuccessful = true; - } - - public function addSkippedTest(Test $test, Throwable $t, float $time): void - { - foreach ($this->hooks as $hook) { - if ($hook instanceof AfterSkippedTestHook) { - $hook->executeAfterSkippedTest(TestUtil::describeAsString($test), $t->getMessage(), $time); - } - } - - $this->lastTestWasNotSuccessful = true; - } - - public function endTest(Test $test, float $time): void - { - if (!$this->lastTestWasNotSuccessful) { - foreach ($this->hooks as $hook) { - if ($hook instanceof AfterSuccessfulTestHook) { - $hook->executeAfterSuccessfulTest(TestUtil::describeAsString($test), $time); - } - } - } - - foreach ($this->hooks as $hook) { - if ($hook instanceof AfterTestHook) { - $hook->executeAfterTest(TestUtil::describeAsString($test), $time); - } - } - } - - public function startTestSuite(TestSuite $suite): void - { - } - - public function endTestSuite(TestSuite $suite): void - { - } -} diff --git a/vendor/phpunit/phpunit/src/Runner/NullTestResultCache.php b/vendor/phpunit/phpunit/src/Runner/NullTestResultCache.php deleted file mode 100644 index 2aa8653..0000000 --- a/vendor/phpunit/phpunit/src/Runner/NullTestResultCache.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class NullTestResultCache implements TestResultCache -{ - public function setState(string $testName, int $state): void - { - } - - public function getState(string $testName): int - { - return BaseTestRunner::STATUS_UNKNOWN; - } - - public function setTime(string $testName, float $time): void - { - } - - public function getTime(string $testName): float - { - return 0; - } - - public function load(): void - { - } - - public function persist(): void - { - } -} diff --git a/vendor/phpunit/phpunit/src/Runner/PhptTestCase.php b/vendor/phpunit/phpunit/src/Runner/PhptTestCase.php deleted file mode 100644 index da7e49e..0000000 --- a/vendor/phpunit/phpunit/src/Runner/PhptTestCase.php +++ /dev/null @@ -1,819 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner; - -use const DEBUG_BACKTRACE_IGNORE_ARGS; -use const DIRECTORY_SEPARATOR; -use function array_merge; -use function basename; -use function debug_backtrace; -use function defined; -use function dirname; -use function explode; -use function extension_loaded; -use function file; -use function file_exists; -use function file_get_contents; -use function file_put_contents; -use function is_array; -use function is_file; -use function is_readable; -use function is_string; -use function ltrim; -use function phpversion; -use function preg_match; -use function preg_replace; -use function preg_split; -use function realpath; -use function rtrim; -use function sprintf; -use function str_replace; -use function strncasecmp; -use function strpos; -use function substr; -use function trim; -use function unlink; -use function unserialize; -use function var_export; -use function version_compare; -use PHPUnit\Framework\Assert; -use PHPUnit\Framework\AssertionFailedError; -use PHPUnit\Framework\ExpectationFailedException; -use PHPUnit\Framework\IncompleteTestError; -use PHPUnit\Framework\PHPTAssertionFailedError; -use PHPUnit\Framework\SelfDescribing; -use PHPUnit\Framework\SkippedTestError; -use PHPUnit\Framework\SyntheticSkippedError; -use PHPUnit\Framework\Test; -use PHPUnit\Framework\TestResult; -use PHPUnit\Util\PHP\AbstractPhpProcess; -use SebastianBergmann\Timer\Timer; -use Text_Template; -use Throwable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class PhptTestCase implements SelfDescribing, Test -{ - /** - * @var string - */ - private $filename; - - /** - * @var AbstractPhpProcess - */ - private $phpUtil; - - /** - * @var string - */ - private $output = ''; - - /** - * Constructs a test case with the given filename. - * - * @throws Exception - */ - public function __construct(string $filename, AbstractPhpProcess $phpUtil = null) - { - if (!is_file($filename)) { - throw new Exception( - sprintf( - 'File "%s" does not exist.', - $filename - ) - ); - } - - $this->filename = $filename; - $this->phpUtil = $phpUtil ?: AbstractPhpProcess::factory(); - } - - /** - * Counts the number of test cases executed by run(TestResult result). - */ - public function count(): int - { - return 1; - } - - /** - * Runs a test and collects its result in a TestResult instance. - * - * @throws \SebastianBergmann\CodeCoverage\CoveredCodeNotExecutedException - * @throws \SebastianBergmann\CodeCoverage\InvalidArgumentException - * @throws \SebastianBergmann\CodeCoverage\MissingCoversAnnotationException - * @throws \SebastianBergmann\CodeCoverage\RuntimeException - * @throws \SebastianBergmann\CodeCoverage\UnintentionallyCoveredCodeException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - */ - public function run(TestResult $result = null): TestResult - { - if ($result === null) { - $result = new TestResult; - } - - try { - $sections = $this->parse(); - } catch (Exception $e) { - $result->startTest($this); - $result->addFailure($this, new SkippedTestError($e->getMessage()), 0); - $result->endTest($this, 0); - - return $result; - } - - $code = $this->render($sections['FILE']); - $xfail = false; - $settings = $this->parseIniSection($this->settings($result->getCollectCodeCoverageInformation())); - - $result->startTest($this); - - if (isset($sections['INI'])) { - $settings = $this->parseIniSection($sections['INI'], $settings); - } - - if (isset($sections['ENV'])) { - $env = $this->parseEnvSection($sections['ENV']); - $this->phpUtil->setEnv($env); - } - - $this->phpUtil->setUseStderrRedirection(true); - - if ($result->enforcesTimeLimit()) { - $this->phpUtil->setTimeout($result->getTimeoutForLargeTests()); - } - - $skip = $this->runSkip($sections, $result, $settings); - - if ($skip) { - return $result; - } - - if (isset($sections['XFAIL'])) { - $xfail = trim($sections['XFAIL']); - } - - if (isset($sections['STDIN'])) { - $this->phpUtil->setStdin($sections['STDIN']); - } - - if (isset($sections['ARGS'])) { - $this->phpUtil->setArgs($sections['ARGS']); - } - - if ($result->getCollectCodeCoverageInformation()) { - $this->renderForCoverage($code); - } - - Timer::start(); - - $jobResult = $this->phpUtil->runJob($code, $this->stringifyIni($settings)); - $time = Timer::stop(); - $this->output = $jobResult['stdout'] ?? ''; - - if ($result->getCollectCodeCoverageInformation() && ($coverage = $this->cleanupForCoverage())) { - $result->getCodeCoverage()->append($coverage, $this, true, [], [], true); - } - - try { - $this->assertPhptExpectation($sections, $this->output); - } catch (AssertionFailedError $e) { - $failure = $e; - - if ($xfail !== false) { - $failure = new IncompleteTestError($xfail, 0, $e); - } elseif ($e instanceof ExpectationFailedException) { - $comparisonFailure = $e->getComparisonFailure(); - - if ($comparisonFailure) { - $diff = $comparisonFailure->getDiff(); - } else { - $diff = $e->getMessage(); - } - - $hint = $this->getLocationHintFromDiff($diff, $sections); - $trace = array_merge($hint, debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS)); - $failure = new PHPTAssertionFailedError( - $e->getMessage(), - 0, - $trace[0]['file'], - $trace[0]['line'], - $trace, - $comparisonFailure ? $diff : '' - ); - } - - $result->addFailure($this, $failure, $time); - } catch (Throwable $t) { - $result->addError($this, $t, $time); - } - - if ($xfail !== false && $result->allCompletelyImplemented()) { - $result->addFailure($this, new IncompleteTestError('XFAIL section but test passes'), $time); - } - - $this->runClean($sections, $result->getCollectCodeCoverageInformation()); - - $result->endTest($this, $time); - - return $result; - } - - /** - * Returns the name of the test case. - */ - public function getName(): string - { - return $this->toString(); - } - - /** - * Returns a string representation of the test case. - */ - public function toString(): string - { - return $this->filename; - } - - public function usesDataProvider(): bool - { - return false; - } - - public function getNumAssertions(): int - { - return 1; - } - - public function getActualOutput(): string - { - return $this->output; - } - - public function hasOutput(): bool - { - return !empty($this->output); - } - - /** - * Parse --INI-- section key value pairs and return as array. - * - * @param array|string - */ - private function parseIniSection($content, $ini = []): array - { - if (is_string($content)) { - $content = explode("\n", trim($content)); - } - - foreach ($content as $setting) { - if (strpos($setting, '=') === false) { - continue; - } - - $setting = explode('=', $setting, 2); - $name = trim($setting[0]); - $value = trim($setting[1]); - - if ($name === 'extension' || $name === 'zend_extension') { - if (!isset($ini[$name])) { - $ini[$name] = []; - } - - $ini[$name][] = $value; - - continue; - } - - $ini[$name] = $value; - } - - return $ini; - } - - private function parseEnvSection(string $content): array - { - $env = []; - - foreach (explode("\n", trim($content)) as $e) { - $e = explode('=', trim($e), 2); - - if (!empty($e[0]) && isset($e[1])) { - $env[$e[0]] = $e[1]; - } - } - - return $env; - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - */ - private function assertPhptExpectation(array $sections, string $output): void - { - $assertions = [ - 'EXPECT' => 'assertEquals', - 'EXPECTF' => 'assertStringMatchesFormat', - 'EXPECTREGEX' => 'assertRegExp', - ]; - - $actual = preg_replace('/\r\n/', "\n", trim($output)); - - foreach ($assertions as $sectionName => $sectionAssertion) { - if (isset($sections[$sectionName])) { - $sectionContent = preg_replace('/\r\n/', "\n", trim($sections[$sectionName])); - $expected = $sectionName === 'EXPECTREGEX' ? "/{$sectionContent}/" : $sectionContent; - - if ($expected === null) { - throw new Exception('No PHPT expectation found'); - } - - Assert::$sectionAssertion($expected, $actual); - - return; - } - } - - throw new Exception('No PHPT assertion found'); - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - private function runSkip(array &$sections, TestResult $result, array $settings): bool - { - if (!isset($sections['SKIPIF'])) { - return false; - } - - $skipif = $this->render($sections['SKIPIF']); - $jobResult = $this->phpUtil->runJob($skipif, $this->stringifyIni($settings)); - - if (!strncasecmp('skip', ltrim($jobResult['stdout']), 4)) { - $message = ''; - - if (preg_match('/^\s*skip\s*(.+)\s*/i', $jobResult['stdout'], $skipMatch)) { - $message = substr($skipMatch[1], 2); - } - - $hint = $this->getLocationHint($message, $sections, 'SKIPIF'); - $trace = array_merge($hint, debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS)); - $result->addFailure( - $this, - new SyntheticSkippedError($message, 0, $trace[0]['file'], $trace[0]['line'], $trace), - 0 - ); - $result->endTest($this, 0); - - return true; - } - - return false; - } - - private function runClean(array &$sections, bool $collectCoverage): void - { - $this->phpUtil->setStdin(''); - $this->phpUtil->setArgs(''); - - if (isset($sections['CLEAN'])) { - $cleanCode = $this->render($sections['CLEAN']); - - $this->phpUtil->runJob($cleanCode, $this->settings($collectCoverage)); - } - } - - /** - * @throws Exception - */ - private function parse(): array - { - $sections = []; - $section = ''; - - $unsupportedSections = [ - 'CGI', - 'COOKIE', - 'DEFLATE_POST', - 'EXPECTHEADERS', - 'EXTENSIONS', - 'GET', - 'GZIP_POST', - 'HEADERS', - 'PHPDBG', - 'POST', - 'POST_RAW', - 'PUT', - 'REDIRECTTEST', - 'REQUEST', - ]; - - $lineNr = 0; - - foreach (file($this->filename) as $line) { - $lineNr++; - - if (preg_match('/^--([_A-Z]+)--/', $line, $result)) { - $section = $result[1]; - $sections[$section] = ''; - $sections[$section . '_offset'] = $lineNr; - - continue; - } - - if (empty($section)) { - throw new Exception('Invalid PHPT file: empty section header'); - } - - $sections[$section] .= $line; - } - - if (isset($sections['FILEEOF'])) { - $sections['FILE'] = rtrim($sections['FILEEOF'], "\r\n"); - unset($sections['FILEEOF']); - } - - $this->parseExternal($sections); - - if (!$this->validate($sections)) { - throw new Exception('Invalid PHPT file'); - } - - foreach ($unsupportedSections as $section) { - if (isset($sections[$section])) { - throw new Exception( - "PHPUnit does not support PHPT {$section} sections" - ); - } - } - - return $sections; - } - - /** - * @throws Exception - */ - private function parseExternal(array &$sections): void - { - $allowSections = [ - 'FILE', - 'EXPECT', - 'EXPECTF', - 'EXPECTREGEX', - ]; - $testDirectory = dirname($this->filename) . DIRECTORY_SEPARATOR; - - foreach ($allowSections as $section) { - if (isset($sections[$section . '_EXTERNAL'])) { - $externalFilename = trim($sections[$section . '_EXTERNAL']); - - if (!is_file($testDirectory . $externalFilename) || - !is_readable($testDirectory . $externalFilename)) { - throw new Exception( - sprintf( - 'Could not load --%s-- %s for PHPT file', - $section . '_EXTERNAL', - $testDirectory . $externalFilename - ) - ); - } - - $sections[$section] = file_get_contents($testDirectory . $externalFilename); - } - } - } - - private function validate(array &$sections): bool - { - $requiredSections = [ - 'FILE', - [ - 'EXPECT', - 'EXPECTF', - 'EXPECTREGEX', - ], - ]; - - foreach ($requiredSections as $section) { - if (is_array($section)) { - $foundSection = false; - - foreach ($section as $anySection) { - if (isset($sections[$anySection])) { - $foundSection = true; - - break; - } - } - - if (!$foundSection) { - return false; - } - - continue; - } - - if (!isset($sections[$section])) { - return false; - } - } - - return true; - } - - private function render(string $code): string - { - return str_replace( - [ - '__DIR__', - '__FILE__', - ], - [ - "'" . dirname($this->filename) . "'", - "'" . $this->filename . "'", - ], - $code - ); - } - - private function getCoverageFiles(): array - { - $baseDir = dirname(realpath($this->filename)) . DIRECTORY_SEPARATOR; - $basename = basename($this->filename, 'phpt'); - - return [ - 'coverage' => $baseDir . $basename . 'coverage', - 'job' => $baseDir . $basename . 'php', - ]; - } - - private function renderForCoverage(string &$job): void - { - $files = $this->getCoverageFiles(); - - $template = new Text_Template( - __DIR__ . '/../Util/PHP/Template/PhptTestCase.tpl' - ); - - $composerAutoload = '\'\''; - - if (defined('PHPUNIT_COMPOSER_INSTALL')) { - $composerAutoload = var_export(PHPUNIT_COMPOSER_INSTALL, true); - } - - $phar = '\'\''; - - if (defined('__PHPUNIT_PHAR__')) { - $phar = var_export(__PHPUNIT_PHAR__, true); - } - - $globals = ''; - - if (!empty($GLOBALS['__PHPUNIT_BOOTSTRAP'])) { - $globals = '$GLOBALS[\'__PHPUNIT_BOOTSTRAP\'] = ' . var_export( - $GLOBALS['__PHPUNIT_BOOTSTRAP'], - true - ) . ";\n"; - } - - $template->setVar( - [ - 'composerAutoload' => $composerAutoload, - 'phar' => $phar, - 'globals' => $globals, - 'job' => $files['job'], - 'coverageFile' => $files['coverage'], - ] - ); - - file_put_contents($files['job'], $job); - $job = $template->render(); - } - - private function cleanupForCoverage(): array - { - $coverage = []; - $files = $this->getCoverageFiles(); - - if (file_exists($files['coverage'])) { - $buffer = @file_get_contents($files['coverage']); - - if ($buffer !== false) { - $coverage = @unserialize($buffer); - - if ($coverage === false) { - $coverage = []; - } - } - } - - foreach ($files as $file) { - @unlink($file); - } - - return $coverage; - } - - private function stringifyIni(array $ini): array - { - $settings = []; - - foreach ($ini as $key => $value) { - if (is_array($value)) { - foreach ($value as $val) { - $settings[] = $key . '=' . $val; - } - - continue; - } - - $settings[] = $key . '=' . $value; - } - - return $settings; - } - - private function getLocationHintFromDiff(string $message, array $sections): array - { - $needle = ''; - $previousLine = ''; - $block = 'message'; - - foreach (preg_split('/\r\n|\r|\n/', $message) as $line) { - $line = trim($line); - - if ($block === 'message' && $line === '--- Expected') { - $block = 'expected'; - } - - if ($block === 'expected' && $line === '@@ @@') { - $block = 'diff'; - } - - if ($block === 'diff') { - if (strpos($line, '+') === 0) { - $needle = $this->getCleanDiffLine($previousLine); - - break; - } - - if (strpos($line, '-') === 0) { - $needle = $this->getCleanDiffLine($line); - - break; - } - } - - if (!empty($line)) { - $previousLine = $line; - } - } - - return $this->getLocationHint($needle, $sections); - } - - private function getCleanDiffLine(string $line): string - { - if (preg_match('/^[\-+]([\'\"]?)(.*)\1$/', $line, $matches)) { - $line = $matches[2]; - } - - return $line; - } - - private function getLocationHint(string $needle, array $sections, ?string $sectionName = null): array - { - $needle = trim($needle); - - if (empty($needle)) { - return [[ - 'file' => realpath($this->filename), - 'line' => 1, - ]]; - } - - if ($sectionName) { - $search = [$sectionName]; - } else { - $search = [ - // 'FILE', - 'EXPECT', - 'EXPECTF', - 'EXPECTREGEX', - ]; - } - - foreach ($search as $section) { - if (!isset($sections[$section])) { - continue; - } - - if (isset($sections[$section . '_EXTERNAL'])) { - $externalFile = trim($sections[$section . '_EXTERNAL']); - - return [ - [ - 'file' => realpath(dirname($this->filename) . DIRECTORY_SEPARATOR . $externalFile), - 'line' => 1, - ], - [ - 'file' => realpath($this->filename), - 'line' => ($sections[$section . '_EXTERNAL_offset'] ?? 0) + 1, - ], - ]; - } - - $sectionOffset = $sections[$section . '_offset'] ?? 0; - $offset = $sectionOffset + 1; - - foreach (preg_split('/\r\n|\r|\n/', $sections[$section]) as $line) { - if (strpos($line, $needle) !== false) { - return [[ - 'file' => realpath($this->filename), - 'line' => $offset, - ]]; - } - $offset++; - } - } - - if ($sectionName) { - // String not found in specified section, show user the start of the named section - return [[ - 'file' => realpath($this->filename), - 'line' => $sectionOffset, - ]]; - } - - // No section specified, show user start of code - return [[ - 'file' => realpath($this->filename), - 'line' => 1, - ]]; - } - - /** - * @psalm-return list - */ - private function settings(bool $collectCoverage): array - { - $settings = [ - 'allow_url_fopen=1', - 'auto_append_file=', - 'auto_prepend_file=', - 'disable_functions=', - 'display_errors=1', - 'docref_ext=.html', - 'docref_root=', - 'error_append_string=', - 'error_prepend_string=', - 'error_reporting=-1', - 'html_errors=0', - 'log_errors=0', - 'open_basedir=', - 'output_buffering=Off', - 'output_handler=', - 'report_memleaks=0', - 'report_zend_debug=0', - ]; - - if (extension_loaded('pcov')) { - if ($collectCoverage) { - $settings[] = 'pcov.enabled=1'; - } else { - $settings[] = 'pcov.enabled=0'; - } - } - - if (extension_loaded('xdebug')) { - if (version_compare(phpversion('xdebug'), '3', '>=')) { - if ($collectCoverage) { - $settings[] = 'xdebug.mode=coverage'; - } else { - $settings[] = 'xdebug.mode=off'; - } - } else { - $settings[] = 'xdebug.default_enable=0'; - - if ($collectCoverage) { - $settings[] = 'xdebug.coverage_enable=1'; - } - } - } - - return $settings; - } -} diff --git a/vendor/phpunit/phpunit/src/Runner/ResultCacheExtension.php b/vendor/phpunit/phpunit/src/Runner/ResultCacheExtension.php deleted file mode 100644 index 31d7610..0000000 --- a/vendor/phpunit/phpunit/src/Runner/ResultCacheExtension.php +++ /dev/null @@ -1,110 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner; - -use function preg_match; -use function round; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ResultCacheExtension implements AfterIncompleteTestHook, AfterLastTestHook, AfterRiskyTestHook, AfterSkippedTestHook, AfterSuccessfulTestHook, AfterTestErrorHook, AfterTestFailureHook, AfterTestWarningHook -{ - /** - * @var TestResultCache - */ - private $cache; - - public function __construct(TestResultCache $cache) - { - $this->cache = $cache; - } - - public function flush(): void - { - $this->cache->persist(); - } - - public function executeAfterSuccessfulTest(string $test, float $time): void - { - $testName = $this->getTestName($test); - - $this->cache->setTime($testName, round($time, 3)); - } - - public function executeAfterIncompleteTest(string $test, string $message, float $time): void - { - $testName = $this->getTestName($test); - - $this->cache->setTime($testName, round($time, 3)); - $this->cache->setState($testName, BaseTestRunner::STATUS_INCOMPLETE); - } - - public function executeAfterRiskyTest(string $test, string $message, float $time): void - { - $testName = $this->getTestName($test); - - $this->cache->setTime($testName, round($time, 3)); - $this->cache->setState($testName, BaseTestRunner::STATUS_RISKY); - } - - public function executeAfterSkippedTest(string $test, string $message, float $time): void - { - $testName = $this->getTestName($test); - - $this->cache->setTime($testName, round($time, 3)); - $this->cache->setState($testName, BaseTestRunner::STATUS_SKIPPED); - } - - public function executeAfterTestError(string $test, string $message, float $time): void - { - $testName = $this->getTestName($test); - - $this->cache->setTime($testName, round($time, 3)); - $this->cache->setState($testName, BaseTestRunner::STATUS_ERROR); - } - - public function executeAfterTestFailure(string $test, string $message, float $time): void - { - $testName = $this->getTestName($test); - - $this->cache->setTime($testName, round($time, 3)); - $this->cache->setState($testName, BaseTestRunner::STATUS_FAILURE); - } - - public function executeAfterTestWarning(string $test, string $message, float $time): void - { - $testName = $this->getTestName($test); - - $this->cache->setTime($testName, round($time, 3)); - $this->cache->setState($testName, BaseTestRunner::STATUS_WARNING); - } - - public function executeAfterLastTest(): void - { - $this->flush(); - } - - /** - * @param string $test A long description format of the current test - * - * @return string The test name without TestSuiteClassName:: and @dataprovider details - */ - private function getTestName(string $test): string - { - $matches = []; - - if (preg_match('/^(?\S+::\S+)(?:(? with data set (?:#\d+|"[^"]+"))\s\()?/', $test, $matches)) { - $test = $matches['name'] . ($matches['dataname'] ?? ''); - } - - return $test; - } -} diff --git a/vendor/phpunit/phpunit/src/Runner/StandardTestSuiteLoader.php b/vendor/phpunit/phpunit/src/Runner/StandardTestSuiteLoader.php deleted file mode 100644 index b658dfc..0000000 --- a/vendor/phpunit/phpunit/src/Runner/StandardTestSuiteLoader.php +++ /dev/null @@ -1,164 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner; - -use function array_diff; -use function array_values; -use function class_exists; -use function get_declared_classes; -use function realpath; -use function sprintf; -use function str_replace; -use function strlen; -use function substr; -use PHPUnit\Framework\TestCase; -use PHPUnit\Util\FileLoader; -use PHPUnit\Util\Filesystem; -use ReflectionClass; -use ReflectionException; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class StandardTestSuiteLoader implements TestSuiteLoader -{ - /** - * @throws \PHPUnit\Framework\Exception - * @throws Exception - */ - public function load(string $suiteClassName, string $suiteClassFile = ''): ReflectionClass - { - $suiteClassName = str_replace('.php', '', $suiteClassName); - $filename = null; - - if (empty($suiteClassFile)) { - $suiteClassFile = Filesystem::classNameToFilename( - $suiteClassName - ); - } - - if (!class_exists($suiteClassName, false)) { - $loadedClasses = get_declared_classes(); - - $filename = FileLoader::checkAndLoad($suiteClassFile); - - $loadedClasses = array_values( - array_diff(get_declared_classes(), $loadedClasses) - ); - } - - if (!empty($loadedClasses) && !class_exists($suiteClassName, false)) { - $offset = 0 - strlen($suiteClassName); - - foreach ($loadedClasses as $loadedClass) { - try { - $class = new ReflectionClass($loadedClass); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - if (substr($loadedClass, $offset) === $suiteClassName && - $class->getFileName() == $filename) { - $suiteClassName = $loadedClass; - - break; - } - } - } - - if (!empty($loadedClasses) && !class_exists($suiteClassName, false)) { - $testCaseClass = TestCase::class; - - foreach ($loadedClasses as $loadedClass) { - try { - $class = new ReflectionClass($loadedClass); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - $classFile = $class->getFileName(); - - if ($class->isSubclassOf($testCaseClass) && !$class->isAbstract()) { - $suiteClassName = $loadedClass; - $testCaseClass = $loadedClass; - - if ($classFile == realpath($suiteClassFile)) { - break; - } - } - - if ($class->hasMethod('suite')) { - try { - $method = $class->getMethod('suite'); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - if (!$method->isAbstract() && $method->isPublic() && $method->isStatic()) { - $suiteClassName = $loadedClass; - - if ($classFile == realpath($suiteClassFile)) { - break; - } - } - } - } - } - - if (class_exists($suiteClassName, false)) { - try { - $class = new ReflectionClass($suiteClassName); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - if ($class->getFileName() == realpath($suiteClassFile)) { - return $class; - } - } - - throw new Exception( - sprintf( - "Class '%s' could not be found in '%s'.", - $suiteClassName, - $suiteClassFile - ) - ); - } - - public function reload(ReflectionClass $aClass): ReflectionClass - { - return $aClass; - } -} diff --git a/vendor/phpunit/phpunit/src/Runner/TestResultCache.php b/vendor/phpunit/phpunit/src/Runner/TestResultCache.php deleted file mode 100644 index 69e6282..0000000 --- a/vendor/phpunit/phpunit/src/Runner/TestResultCache.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -interface TestResultCache -{ - public function setState(string $testName, int $state): void; - - public function getState(string $testName): int; - - public function setTime(string $testName, float $time): void; - - public function getTime(string $testName): float; - - public function load(): void; - - public function persist(): void; -} diff --git a/vendor/phpunit/phpunit/src/Runner/TestSuiteLoader.php b/vendor/phpunit/phpunit/src/Runner/TestSuiteLoader.php deleted file mode 100644 index f059688..0000000 --- a/vendor/phpunit/phpunit/src/Runner/TestSuiteLoader.php +++ /dev/null @@ -1,22 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner; - -use ReflectionClass; - -/** - * An interface to define how a test suite should be loaded. - */ -interface TestSuiteLoader -{ - public function load(string $suiteClassName, string $suiteClassFile = ''): ReflectionClass; - - public function reload(ReflectionClass $aClass): ReflectionClass; -} diff --git a/vendor/phpunit/phpunit/src/Runner/TestSuiteSorter.php b/vendor/phpunit/phpunit/src/Runner/TestSuiteSorter.php deleted file mode 100644 index 0d7d641..0000000 --- a/vendor/phpunit/phpunit/src/Runner/TestSuiteSorter.php +++ /dev/null @@ -1,454 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner; - -use function array_intersect; -use function array_map; -use function array_merge; -use function array_reduce; -use function array_reverse; -use function array_splice; -use function count; -use function get_class; -use function in_array; -use function max; -use function shuffle; -use function strpos; -use function substr; -use function usort; -use PHPUnit\Framework\DataProviderTestSuite; -use PHPUnit\Framework\Test; -use PHPUnit\Framework\TestCase; -use PHPUnit\Framework\TestSuite; -use PHPUnit\Util\Test as TestUtil; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class TestSuiteSorter -{ - /** - * @var int - */ - public const ORDER_DEFAULT = 0; - - /** - * @var int - */ - public const ORDER_RANDOMIZED = 1; - - /** - * @var int - */ - public const ORDER_REVERSED = 2; - - /** - * @var int - */ - public const ORDER_DEFECTS_FIRST = 3; - - /** - * @var int - */ - public const ORDER_DURATION = 4; - - /** - * Order tests by @size annotation 'small', 'medium', 'large'. - * - * @var int - */ - public const ORDER_SIZE = 5; - - /** - * List of sorting weights for all test result codes. A higher number gives higher priority. - */ - private const DEFECT_SORT_WEIGHT = [ - BaseTestRunner::STATUS_ERROR => 6, - BaseTestRunner::STATUS_FAILURE => 5, - BaseTestRunner::STATUS_WARNING => 4, - BaseTestRunner::STATUS_INCOMPLETE => 3, - BaseTestRunner::STATUS_RISKY => 2, - BaseTestRunner::STATUS_SKIPPED => 1, - BaseTestRunner::STATUS_UNKNOWN => 0, - ]; - - private const SIZE_SORT_WEIGHT = [ - TestUtil::SMALL => 1, - TestUtil::MEDIUM => 2, - TestUtil::LARGE => 3, - TestUtil::UNKNOWN => 4, - ]; - - /** - * @var array Associative array of (string => DEFECT_SORT_WEIGHT) elements - */ - private $defectSortOrder = []; - - /** - * @var TestResultCache - */ - private $cache; - - /** - * @var string[] A list of normalized names of tests before reordering - */ - private $originalExecutionOrder = []; - - /** - * @var string[] A list of normalized names of tests affected by reordering - */ - private $executionOrder = []; - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public static function getTestSorterUID(Test $test): string - { - if ($test instanceof PhptTestCase) { - return $test->getName(); - } - - if ($test instanceof TestCase) { - $testName = $test->getName(true); - - if (strpos($testName, '::') === false) { - $testName = get_class($test) . '::' . $testName; - } - - return $testName; - } - - return $test->getName(); - } - - public function __construct(?TestResultCache $cache = null) - { - $this->cache = $cache ?? new NullTestResultCache; - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - */ - public function reorderTestsInSuite(Test $suite, int $order, bool $resolveDependencies, int $orderDefects, bool $isRootTestSuite = true): void - { - $allowedOrders = [ - self::ORDER_DEFAULT, - self::ORDER_REVERSED, - self::ORDER_RANDOMIZED, - self::ORDER_DURATION, - self::ORDER_SIZE, - ]; - - if (!in_array($order, $allowedOrders, true)) { - throw new Exception( - '$order must be one of TestSuiteSorter::ORDER_[DEFAULT|REVERSED|RANDOMIZED|DURATION|SIZE]' - ); - } - - $allowedOrderDefects = [ - self::ORDER_DEFAULT, - self::ORDER_DEFECTS_FIRST, - ]; - - if (!in_array($orderDefects, $allowedOrderDefects, true)) { - throw new Exception( - '$orderDefects must be one of TestSuiteSorter::ORDER_DEFAULT, TestSuiteSorter::ORDER_DEFECTS_FIRST' - ); - } - - if ($isRootTestSuite) { - $this->originalExecutionOrder = $this->calculateTestExecutionOrder($suite); - } - - if ($suite instanceof TestSuite) { - foreach ($suite as $_suite) { - $this->reorderTestsInSuite($_suite, $order, $resolveDependencies, $orderDefects, false); - } - - if ($orderDefects === self::ORDER_DEFECTS_FIRST) { - $this->addSuiteToDefectSortOrder($suite); - } - - $this->sort($suite, $order, $resolveDependencies, $orderDefects); - } - - if ($isRootTestSuite) { - $this->executionOrder = $this->calculateTestExecutionOrder($suite); - } - } - - public function getOriginalExecutionOrder(): array - { - return $this->originalExecutionOrder; - } - - public function getExecutionOrder(): array - { - return $this->executionOrder; - } - - private function sort(TestSuite $suite, int $order, bool $resolveDependencies, int $orderDefects): void - { - if (empty($suite->tests())) { - return; - } - - if ($order === self::ORDER_REVERSED) { - $suite->setTests($this->reverse($suite->tests())); - } elseif ($order === self::ORDER_RANDOMIZED) { - $suite->setTests($this->randomize($suite->tests())); - } elseif ($order === self::ORDER_DURATION && $this->cache !== null) { - $suite->setTests($this->sortByDuration($suite->tests())); - } elseif ($order === self::ORDER_SIZE) { - $suite->setTests($this->sortBySize($suite->tests())); - } - - if ($orderDefects === self::ORDER_DEFECTS_FIRST && $this->cache !== null) { - $suite->setTests($this->sortDefectsFirst($suite->tests())); - } - - if ($resolveDependencies && !($suite instanceof DataProviderTestSuite) && $this->suiteOnlyContainsTests($suite)) { - /** @var TestCase[] $tests */ - $tests = $suite->tests(); - - $suite->setTests($this->resolveDependencies($tests)); - } - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - private function addSuiteToDefectSortOrder(TestSuite $suite): void - { - $max = 0; - - foreach ($suite->tests() as $test) { - $testname = self::getTestSorterUID($test); - - if (!isset($this->defectSortOrder[$testname])) { - $this->defectSortOrder[$testname] = self::DEFECT_SORT_WEIGHT[$this->cache->getState($testname)]; - $max = max($max, $this->defectSortOrder[$testname]); - } - } - - $this->defectSortOrder[$suite->getName()] = $max; - } - - private function suiteOnlyContainsTests(TestSuite $suite): bool - { - return array_reduce( - $suite->tests(), - static function ($carry, $test) - { - return $carry && ($test instanceof TestCase || $test instanceof DataProviderTestSuite); - }, - true - ); - } - - private function reverse(array $tests): array - { - return array_reverse($tests); - } - - private function randomize(array $tests): array - { - shuffle($tests); - - return $tests; - } - - private function sortDefectsFirst(array $tests): array - { - usort( - $tests, - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - function ($left, $right) - { - return $this->cmpDefectPriorityAndTime($left, $right); - } - ); - - return $tests; - } - - private function sortByDuration(array $tests): array - { - usort( - $tests, - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - function ($left, $right) - { - return $this->cmpDuration($left, $right); - } - ); - - return $tests; - } - - private function sortBySize(array $tests): array - { - usort( - $tests, - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - function ($left, $right) - { - return $this->cmpSize($left, $right); - } - ); - - return $tests; - } - - /** - * Comparator callback function to sort tests for "reach failure as fast as possible": - * 1. sort tests by defect weight defined in self::DEFECT_SORT_WEIGHT - * 2. when tests are equally defective, sort the fastest to the front - * 3. do not reorder successful tests. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - private function cmpDefectPriorityAndTime(Test $a, Test $b): int - { - $priorityA = $this->defectSortOrder[self::getTestSorterUID($a)] ?? 0; - $priorityB = $this->defectSortOrder[self::getTestSorterUID($b)] ?? 0; - - if ($priorityB <=> $priorityA) { - // Sort defect weight descending - return $priorityB <=> $priorityA; - } - - if ($priorityA || $priorityB) { - return $this->cmpDuration($a, $b); - } - - // do not change execution order - return 0; - } - - /** - * Compares test duration for sorting tests by duration ascending. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - private function cmpDuration(Test $a, Test $b): int - { - return $this->cache->getTime(self::getTestSorterUID($a)) <=> $this->cache->getTime(self::getTestSorterUID($b)); - } - - /** - * Compares test size for sorting tests small->medium->large->unknown. - */ - private function cmpSize(Test $a, Test $b): int - { - $sizeA = ($a instanceof TestCase || $a instanceof DataProviderTestSuite) - ? $a->getSize() - : TestUtil::UNKNOWN; - $sizeB = ($b instanceof TestCase || $b instanceof DataProviderTestSuite) - ? $b->getSize() - : TestUtil::UNKNOWN; - - return self::SIZE_SORT_WEIGHT[$sizeA] <=> self::SIZE_SORT_WEIGHT[$sizeB]; - } - - /** - * Reorder Tests within a TestCase in such a way as to resolve as many dependencies as possible. - * The algorithm will leave the tests in original running order when it can. - * For more details see the documentation for test dependencies. - * - * Short description of algorithm: - * 1. Pick the next Test from remaining tests to be checked for dependencies. - * 2. If the test has no dependencies: mark done, start again from the top - * 3. If the test has dependencies but none left to do: mark done, start again from the top - * 4. When we reach the end add any leftover tests to the end. These will be marked 'skipped' during execution. - * - * @param array $tests - * - * @return array - */ - private function resolveDependencies(array $tests): array - { - $newTestOrder = []; - $i = 0; - - do { - $todoNames = array_map( - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - static function ($test) - { - return self::getTestSorterUID($test); - }, - $tests - ); - - if (!$tests[$i]->hasDependencies() || empty(array_intersect($this->getNormalizedDependencyNames($tests[$i]), $todoNames))) { - $newTestOrder = array_merge($newTestOrder, array_splice($tests, $i, 1)); - $i = 0; - } else { - $i++; - } - } while (!empty($tests) && ($i < count($tests))); - - return array_merge($newTestOrder, $tests); - } - - /** - * @param DataProviderTestSuite|TestCase $test - * - * @return array A list of full test names as "TestSuiteClassName::testMethodName" - */ - private function getNormalizedDependencyNames($test): array - { - if ($test instanceof DataProviderTestSuite) { - $testClass = substr($test->getName(), 0, strpos($test->getName(), '::')); - } else { - $testClass = get_class($test); - } - - $names = array_map( - static function ($name) use ($testClass) - { - return strpos($name, '::') === false ? $testClass . '::' . $name : $name; - }, - $test->getDependencies() - ); - - return $names; - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - private function calculateTestExecutionOrder(Test $suite): array - { - $tests = []; - - if ($suite instanceof TestSuite) { - foreach ($suite->tests() as $test) { - if (!($test instanceof TestSuite)) { - $tests[] = self::getTestSorterUID($test); - } else { - $tests = array_merge($tests, $this->calculateTestExecutionOrder($test)); - } - } - } - - return $tests; - } -} diff --git a/vendor/phpunit/phpunit/src/Runner/Version.php b/vendor/phpunit/phpunit/src/Runner/Version.php deleted file mode 100644 index 5052b8d..0000000 --- a/vendor/phpunit/phpunit/src/Runner/Version.php +++ /dev/null @@ -1,71 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner; - -use function array_slice; -use function dirname; -use function explode; -use function implode; -use function strpos; -use SebastianBergmann\Version as VersionId; - -final class Version -{ - /** - * @var string - */ - private static $pharVersion = ''; - - /** - * @var string - */ - private static $version = ''; - - /** - * Returns the current version of PHPUnit. - */ - public static function id(): string - { - if (self::$pharVersion !== '') { - return self::$pharVersion; - } - - if (self::$version === '') { - self::$version = (new VersionId('8.5.22', dirname(__DIR__, 2)))->getVersion(); - } - - return self::$version; - } - - public static function series(): string - { - if (strpos(self::id(), '-')) { - $version = explode('-', self::id())[0]; - } else { - $version = self::id(); - } - - return implode('.', array_slice(explode('.', $version), 0, 2)); - } - - public static function getVersionString(): string - { - return 'PHPUnit ' . self::id() . ' by Sebastian Bergmann and contributors.'; - } - - public static function getReleaseChannel(): string - { - if (strpos(self::$pharVersion, '-') !== false) { - return '-snapshot'; - } - - return ''; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/Command.php b/vendor/phpunit/phpunit/src/TextUI/Command.php deleted file mode 100644 index f11c9f3..0000000 --- a/vendor/phpunit/phpunit/src/TextUI/Command.php +++ /dev/null @@ -1,1367 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI; - -use const PATH_SEPARATOR; -use const PHP_EOL; -use const STDIN; -use function array_keys; -use function assert; -use function class_exists; -use function explode; -use function extension_loaded; -use function fgets; -use function file_exists; -use function file_get_contents; -use function file_put_contents; -use function getcwd; -use function ini_get; -use function ini_set; -use function is_callable; -use function is_dir; -use function is_file; -use function is_numeric; -use function is_string; -use function printf; -use function realpath; -use function sort; -use function sprintf; -use function str_replace; -use function stream_resolve_include_path; -use function strrpos; -use function substr; -use function trim; -use function version_compare; -use PharIo\Manifest\ApplicationName; -use PharIo\Manifest\Exception as ManifestException; -use PharIo\Manifest\ManifestLoader; -use PharIo\Version\Version as PharIoVersion; -use PHPUnit\Framework\Exception; -use PHPUnit\Framework\Test; -use PHPUnit\Framework\TestListener; -use PHPUnit\Framework\TestSuite; -use PHPUnit\Runner\StandardTestSuiteLoader; -use PHPUnit\Runner\TestSuiteLoader; -use PHPUnit\Runner\TestSuiteSorter; -use PHPUnit\Runner\Version; -use PHPUnit\Util\Configuration; -use PHPUnit\Util\ConfigurationGenerator; -use PHPUnit\Util\FileLoader; -use PHPUnit\Util\Filesystem; -use PHPUnit\Util\Getopt; -use PHPUnit\Util\Log\TeamCity; -use PHPUnit\Util\Printer; -use PHPUnit\Util\TestDox\CliTestDoxPrinter; -use PHPUnit\Util\TextTestListRenderer; -use PHPUnit\Util\XmlTestListRenderer; -use ReflectionClass; -use ReflectionException; -use SebastianBergmann\FileIterator\Facade as FileIteratorFacade; -use Throwable; - -/** - * A TestRunner for the Command Line Interface (CLI) - * PHP SAPI Module. - */ -class Command -{ - /** - * @var array - */ - protected $arguments = [ - 'listGroups' => false, - 'listSuites' => false, - 'listTests' => false, - 'listTestsXml' => false, - 'loader' => null, - 'useDefaultConfiguration' => true, - 'loadedExtensions' => [], - 'notLoadedExtensions' => [], - ]; - - /** - * @var array - */ - protected $options = []; - - /** - * @var array - */ - protected $longOptions = [ - 'atleast-version=' => null, - 'prepend=' => null, - 'bootstrap=' => null, - 'cache-result' => null, - 'do-not-cache-result' => null, - 'cache-result-file=' => null, - 'check-version' => null, - 'colors==' => null, - 'columns=' => null, - 'configuration=' => null, - 'coverage-clover=' => null, - 'coverage-crap4j=' => null, - 'coverage-html=' => null, - 'coverage-php=' => null, - 'coverage-text==' => null, - 'coverage-xml=' => null, - 'debug' => null, - 'disallow-test-output' => null, - 'disallow-resource-usage' => null, - 'disallow-todo-tests' => null, - 'default-time-limit=' => null, - 'enforce-time-limit' => null, - 'exclude-group=' => null, - 'filter=' => null, - 'generate-configuration' => null, - 'globals-backup' => null, - 'group=' => null, - 'help' => null, - 'resolve-dependencies' => null, - 'ignore-dependencies' => null, - 'include-path=' => null, - 'list-groups' => null, - 'list-suites' => null, - 'list-tests' => null, - 'list-tests-xml=' => null, - 'loader=' => null, - 'log-junit=' => null, - 'log-teamcity=' => null, - 'no-configuration' => null, - 'no-coverage' => null, - 'no-logging' => null, - 'no-interaction' => null, - 'no-extensions' => null, - 'order-by=' => null, - 'printer=' => null, - 'process-isolation' => null, - 'repeat=' => null, - 'dont-report-useless-tests' => null, - 'random-order' => null, - 'random-order-seed=' => null, - 'reverse-order' => null, - 'reverse-list' => null, - 'static-backup' => null, - 'stderr' => null, - 'stop-on-defect' => null, - 'stop-on-error' => null, - 'stop-on-failure' => null, - 'stop-on-warning' => null, - 'stop-on-incomplete' => null, - 'stop-on-risky' => null, - 'stop-on-skipped' => null, - 'fail-on-warning' => null, - 'fail-on-risky' => null, - 'strict-coverage' => null, - 'disable-coverage-ignore' => null, - 'strict-global-state' => null, - 'teamcity' => null, - 'testdox' => null, - 'testdox-group=' => null, - 'testdox-exclude-group=' => null, - 'testdox-html=' => null, - 'testdox-text=' => null, - 'testdox-xml=' => null, - 'test-suffix=' => null, - 'testsuite=' => null, - 'verbose' => null, - 'version' => null, - 'whitelist=' => null, - 'dump-xdebug-filter=' => null, - ]; - - /** - * @var @psalm-var list - */ - private $warnings = []; - - /** - * @var bool - */ - private $versionStringPrinted = false; - - /** - * @throws \PHPUnit\Framework\Exception - */ - public static function main(bool $exit = true): int - { - return (new static)->run($_SERVER['argv'], $exit); - } - - /** - * @throws Exception - */ - public function run(array $argv, bool $exit = true): int - { - $this->handleArguments($argv); - - $runner = $this->createRunner(); - - if ($this->arguments['test'] instanceof Test) { - $suite = $this->arguments['test']; - } else { - $suite = $runner->getTest( - $this->arguments['test'], - $this->arguments['testFile'], - $this->arguments['testSuffixes'] - ); - } - - if ($this->arguments['listGroups']) { - return $this->handleListGroups($suite, $exit); - } - - if ($this->arguments['listSuites']) { - return $this->handleListSuites($exit); - } - - if ($this->arguments['listTests']) { - return $this->handleListTests($suite, $exit); - } - - if ($this->arguments['listTestsXml']) { - return $this->handleListTestsXml($suite, $this->arguments['listTestsXml'], $exit); - } - - unset($this->arguments['test'], $this->arguments['testFile']); - - try { - $result = $runner->doRun($suite, $this->arguments, $this->warnings, $exit); - } catch (Exception $e) { - print $e->getMessage() . PHP_EOL; - } - - $return = TestRunner::FAILURE_EXIT; - - if (isset($result) && $result->wasSuccessful()) { - $return = TestRunner::SUCCESS_EXIT; - } elseif (!isset($result) || $result->errorCount() > 0) { - $return = TestRunner::EXCEPTION_EXIT; - } - - if ($exit) { - exit($return); - } - - return $return; - } - - /** - * Create a TestRunner, override in subclasses. - */ - protected function createRunner(): TestRunner - { - return new TestRunner($this->arguments['loader']); - } - - /** - * Handles the command-line arguments. - * - * A child class of PHPUnit\TextUI\Command can hook into the argument - * parsing by adding the switch(es) to the $longOptions array and point to a - * callback method that handles the switch(es) in the child class like this - * - * - * longOptions['my-switch'] = 'myHandler'; - * // my-secondswitch will accept a value - note the equals sign - * $this->longOptions['my-secondswitch='] = 'myOtherHandler'; - * } - * - * // --my-switch -> myHandler() - * protected function myHandler() - * { - * } - * - * // --my-secondswitch foo -> myOtherHandler('foo') - * protected function myOtherHandler ($value) - * { - * } - * - * // You will also need this - the static keyword in the - * // PHPUnit\TextUI\Command will mean that it'll be - * // PHPUnit\TextUI\Command that gets instantiated, - * // not MyCommand - * public static function main($exit = true) - * { - * $command = new static; - * - * return $command->run($_SERVER['argv'], $exit); - * } - * - * } - * - * - * @throws Exception - */ - protected function handleArguments(array $argv): void - { - try { - $this->options = Getopt::parse( - $argv, - 'd:c:hv', - array_keys($this->longOptions) - ); - } catch (Exception $t) { - $this->exitWithErrorMessage($t->getMessage()); - } - - foreach ($this->options[0] as $option) { - switch ($option[0]) { - case '--colors': - $this->arguments['colors'] = $option[1] ?: ResultPrinter::COLOR_AUTO; - - break; - - case '--bootstrap': - $this->arguments['bootstrap'] = $option[1]; - - break; - - case '--cache-result': - $this->arguments['cacheResult'] = true; - - break; - - case '--do-not-cache-result': - $this->arguments['cacheResult'] = false; - - break; - - case '--cache-result-file': - $this->arguments['cacheResultFile'] = $option[1]; - - break; - - case '--columns': - if (is_numeric($option[1])) { - $this->arguments['columns'] = (int) $option[1]; - } elseif ($option[1] === 'max') { - $this->arguments['columns'] = 'max'; - } - - break; - - case 'c': - case '--configuration': - $this->arguments['configuration'] = $option[1]; - - break; - - case '--coverage-clover': - $this->arguments['coverageClover'] = $option[1]; - - break; - - case '--coverage-crap4j': - $this->arguments['coverageCrap4J'] = $option[1]; - - break; - - case '--coverage-html': - $this->arguments['coverageHtml'] = $option[1]; - - break; - - case '--coverage-php': - $this->arguments['coveragePHP'] = $option[1]; - - break; - - case '--coverage-text': - if ($option[1] === null) { - $option[1] = 'php://stdout'; - } - - $this->arguments['coverageText'] = $option[1]; - $this->arguments['coverageTextShowUncoveredFiles'] = false; - $this->arguments['coverageTextShowOnlySummary'] = false; - - break; - - case '--coverage-xml': - $this->arguments['coverageXml'] = $option[1]; - - break; - - case 'd': - $ini = explode('=', $option[1]); - - if (isset($ini[0])) { - if (isset($ini[1])) { - ini_set($ini[0], $ini[1]); - } else { - ini_set($ini[0], '1'); - } - } - - break; - - case '--debug': - $this->arguments['debug'] = true; - - break; - - case 'h': - case '--help': - $this->showHelp(); - - exit(TestRunner::SUCCESS_EXIT); - - break; - - case '--filter': - $this->arguments['filter'] = $option[1]; - - break; - - case '--testsuite': - $this->arguments['testsuite'] = $option[1]; - - break; - - case '--generate-configuration': - $this->printVersionString(); - - print 'Generating phpunit.xml in ' . getcwd() . PHP_EOL . PHP_EOL; - - print 'Bootstrap script (relative to path shown above; default: vendor/autoload.php): '; - $bootstrapScript = trim(fgets(STDIN)); - - print 'Tests directory (relative to path shown above; default: tests): '; - $testsDirectory = trim(fgets(STDIN)); - - print 'Source directory (relative to path shown above; default: src): '; - $src = trim(fgets(STDIN)); - - if ($bootstrapScript === '') { - $bootstrapScript = 'vendor/autoload.php'; - } - - if ($testsDirectory === '') { - $testsDirectory = 'tests'; - } - - if ($src === '') { - $src = 'src'; - } - - $generator = new ConfigurationGenerator; - - file_put_contents( - 'phpunit.xml', - $generator->generateDefaultConfiguration( - Version::series(), - $bootstrapScript, - $testsDirectory, - $src - ) - ); - - print PHP_EOL . 'Generated phpunit.xml in ' . getcwd() . PHP_EOL; - - exit(TestRunner::SUCCESS_EXIT); - - break; - - case '--group': - $this->arguments['groups'] = explode(',', $option[1]); - - break; - - case '--exclude-group': - $this->arguments['excludeGroups'] = explode( - ',', - $option[1] - ); - - break; - - case '--test-suffix': - $this->arguments['testSuffixes'] = explode( - ',', - $option[1] - ); - - break; - - case '--include-path': - $includePath = $option[1]; - - break; - - case '--list-groups': - $this->arguments['listGroups'] = true; - - break; - - case '--list-suites': - $this->arguments['listSuites'] = true; - - break; - - case '--list-tests': - $this->arguments['listTests'] = true; - - break; - - case '--list-tests-xml': - $this->arguments['listTestsXml'] = $option[1]; - - break; - - case '--printer': - $this->arguments['printer'] = $option[1]; - - break; - - case '--loader': - $this->arguments['loader'] = $option[1]; - - break; - - case '--log-junit': - $this->arguments['junitLogfile'] = $option[1]; - - break; - - case '--log-teamcity': - $this->arguments['teamcityLogfile'] = $option[1]; - - break; - - case '--order-by': - $this->handleOrderByOption($option[1]); - - break; - - case '--process-isolation': - $this->arguments['processIsolation'] = true; - - break; - - case '--repeat': - $this->arguments['repeat'] = (int) $option[1]; - - break; - - case '--stderr': - $this->arguments['stderr'] = true; - - break; - - case '--stop-on-defect': - $this->arguments['stopOnDefect'] = true; - - break; - - case '--stop-on-error': - $this->arguments['stopOnError'] = true; - - break; - - case '--stop-on-failure': - $this->arguments['stopOnFailure'] = true; - - break; - - case '--stop-on-warning': - $this->arguments['stopOnWarning'] = true; - - break; - - case '--stop-on-incomplete': - $this->arguments['stopOnIncomplete'] = true; - - break; - - case '--stop-on-risky': - $this->arguments['stopOnRisky'] = true; - - break; - - case '--stop-on-skipped': - $this->arguments['stopOnSkipped'] = true; - - break; - - case '--fail-on-warning': - $this->arguments['failOnWarning'] = true; - - break; - - case '--fail-on-risky': - $this->arguments['failOnRisky'] = true; - - break; - - case '--teamcity': - $this->arguments['printer'] = TeamCity::class; - - break; - - case '--testdox': - $this->arguments['printer'] = CliTestDoxPrinter::class; - - break; - - case '--testdox-group': - $this->arguments['testdoxGroups'] = explode( - ',', - $option[1] - ); - - break; - - case '--testdox-exclude-group': - $this->arguments['testdoxExcludeGroups'] = explode( - ',', - $option[1] - ); - - break; - - case '--testdox-html': - $this->arguments['testdoxHTMLFile'] = $option[1]; - - break; - - case '--testdox-text': - $this->arguments['testdoxTextFile'] = $option[1]; - - break; - - case '--testdox-xml': - $this->arguments['testdoxXMLFile'] = $option[1]; - - break; - - case '--no-configuration': - $this->arguments['useDefaultConfiguration'] = false; - - break; - - case '--no-extensions': - $this->arguments['noExtensions'] = true; - - break; - - case '--no-coverage': - $this->arguments['noCoverage'] = true; - - break; - - case '--no-logging': - $this->arguments['noLogging'] = true; - - break; - - case '--no-interaction': - $this->arguments['noInteraction'] = true; - - break; - - case '--globals-backup': - $this->arguments['backupGlobals'] = true; - - break; - - case '--static-backup': - $this->arguments['backupStaticAttributes'] = true; - - break; - - case 'v': - case '--verbose': - $this->arguments['verbose'] = true; - - break; - - case '--atleast-version': - if (version_compare(Version::id(), $option[1], '>=')) { - exit(TestRunner::SUCCESS_EXIT); - } - - exit(TestRunner::FAILURE_EXIT); - - break; - - case '--version': - $this->printVersionString(); - - exit(TestRunner::SUCCESS_EXIT); - - break; - - case '--dont-report-useless-tests': - $this->arguments['reportUselessTests'] = false; - - break; - - case '--strict-coverage': - $this->arguments['strictCoverage'] = true; - - break; - - case '--disable-coverage-ignore': - $this->arguments['disableCodeCoverageIgnore'] = true; - - break; - - case '--strict-global-state': - $this->arguments['beStrictAboutChangesToGlobalState'] = true; - - break; - - case '--disallow-test-output': - $this->arguments['disallowTestOutput'] = true; - - break; - - case '--disallow-resource-usage': - $this->arguments['beStrictAboutResourceUsageDuringSmallTests'] = true; - - break; - - case '--default-time-limit': - $this->arguments['defaultTimeLimit'] = (int) $option[1]; - - break; - - case '--enforce-time-limit': - $this->arguments['enforceTimeLimit'] = true; - - break; - - case '--disallow-todo-tests': - $this->arguments['disallowTodoAnnotatedTests'] = true; - - break; - - case '--reverse-list': - $this->arguments['reverseList'] = true; - - break; - - case '--check-version': - $this->handleVersionCheck(); - - break; - - case '--whitelist': - $this->arguments['whitelist'] = $option[1]; - - break; - - case '--random-order': - $this->handleOrderByOption('random'); - - break; - - case '--random-order-seed': - $this->arguments['randomOrderSeed'] = (int) $option[1]; - - break; - - case '--resolve-dependencies': - $this->handleOrderByOption('depends'); - - break; - - case '--ignore-dependencies': - $this->handleOrderByOption('no-depends'); - - break; - - case '--reverse-order': - $this->handleOrderByOption('reverse'); - - break; - - case '--dump-xdebug-filter': - $this->arguments['xdebugFilterFile'] = $option[1]; - - break; - - default: - $optionName = str_replace('--', '', $option[0]); - - $handler = null; - - if (isset($this->longOptions[$optionName])) { - $handler = $this->longOptions[$optionName]; - } elseif (isset($this->longOptions[$optionName . '='])) { - $handler = $this->longOptions[$optionName . '=']; - } - - if (isset($handler) && is_callable([$this, $handler])) { - $this->{$handler}($option[1]); - } - } - } - - $this->handleCustomTestSuite(); - - if (!isset($this->arguments['testSuffixes'])) { - $this->arguments['testSuffixes'] = ['Test.php', '.phpt']; - } - - if (isset($this->options[1][0]) && - substr($this->options[1][0], -5, 5) !== '.phpt' && - substr($this->options[1][0], -4, 4) !== '.php' && - substr($this->options[1][0], -1, 1) !== '/' && - !is_dir($this->options[1][0])) { - $this->warnings[] = 'Invocation with class name is deprecated'; - } - - if (!isset($this->arguments['test'])) { - if (isset($this->options[1][0])) { - $this->arguments['test'] = $this->options[1][0]; - } - - if (isset($this->options[1][1])) { - $testFile = realpath($this->options[1][1]); - - if ($testFile === false) { - $this->exitWithErrorMessage( - sprintf( - 'Cannot open file "%s".', - $this->options[1][1] - ) - ); - } - $this->arguments['testFile'] = $testFile; - } else { - $this->arguments['testFile'] = ''; - } - - if (isset($this->arguments['test']) && - is_file($this->arguments['test']) && - strrpos($this->arguments['test'], '.') !== false && - substr($this->arguments['test'], -5, 5) !== '.phpt') { - $this->arguments['testFile'] = realpath($this->arguments['test']); - $this->arguments['test'] = substr($this->arguments['test'], 0, strrpos($this->arguments['test'], '.')); - } - - if (isset($this->arguments['test']) && - is_string($this->arguments['test']) && - substr($this->arguments['test'], -5, 5) === '.phpt') { - $suite = new TestSuite; - $suite->addTestFile($this->arguments['test']); - $this->arguments['test'] = $suite; - } - } - - if (isset($includePath)) { - ini_set( - 'include_path', - $includePath . PATH_SEPARATOR . ini_get('include_path') - ); - } - - if ($this->arguments['loader'] !== null) { - $this->arguments['loader'] = $this->handleLoader($this->arguments['loader']); - } - - if (isset($this->arguments['configuration']) && - is_dir($this->arguments['configuration'])) { - $configurationFile = $this->arguments['configuration'] . '/phpunit.xml'; - - if (file_exists($configurationFile)) { - $this->arguments['configuration'] = realpath( - $configurationFile - ); - } elseif (file_exists($configurationFile . '.dist')) { - $this->arguments['configuration'] = realpath( - $configurationFile . '.dist' - ); - } - } elseif (!isset($this->arguments['configuration']) && - $this->arguments['useDefaultConfiguration']) { - if (file_exists('phpunit.xml')) { - $this->arguments['configuration'] = realpath('phpunit.xml'); - } elseif (file_exists('phpunit.xml.dist')) { - $this->arguments['configuration'] = realpath( - 'phpunit.xml.dist' - ); - } - } - - if (isset($this->arguments['configuration'])) { - try { - $configuration = Configuration::getInstance( - $this->arguments['configuration'] - ); - } catch (Throwable $t) { - print $t->getMessage() . PHP_EOL; - - exit(TestRunner::FAILURE_EXIT); - } - - $phpunitConfiguration = $configuration->getPHPUnitConfiguration(); - - $configuration->handlePHPConfiguration(); - - /* - * Issue #1216 - */ - if (isset($this->arguments['bootstrap'])) { - $this->handleBootstrap($this->arguments['bootstrap']); - } elseif (isset($phpunitConfiguration['bootstrap'])) { - $this->handleBootstrap($phpunitConfiguration['bootstrap']); - } - - /* - * Issue #657 - */ - if (isset($phpunitConfiguration['stderr']) && !isset($this->arguments['stderr'])) { - $this->arguments['stderr'] = $phpunitConfiguration['stderr']; - } - - if (isset($phpunitConfiguration['extensionsDirectory']) && !isset($this->arguments['noExtensions']) && extension_loaded('phar')) { - $this->handleExtensions($phpunitConfiguration['extensionsDirectory']); - } - - if (isset($phpunitConfiguration['columns']) && !isset($this->arguments['columns'])) { - $this->arguments['columns'] = $phpunitConfiguration['columns']; - } - - if (!isset($this->arguments['printer']) && isset($phpunitConfiguration['printerClass'])) { - $file = $phpunitConfiguration['printerFile'] ?? ''; - - $this->arguments['printer'] = $this->handlePrinter( - $phpunitConfiguration['printerClass'], - $file - ); - } - - if (isset($phpunitConfiguration['testSuiteLoaderClass'])) { - $file = $phpunitConfiguration['testSuiteLoaderFile'] ?? ''; - - $this->arguments['loader'] = $this->handleLoader( - $phpunitConfiguration['testSuiteLoaderClass'], - $file - ); - } - - if (!isset($this->arguments['testsuite']) && isset($phpunitConfiguration['defaultTestSuite'])) { - $this->arguments['testsuite'] = $phpunitConfiguration['defaultTestSuite']; - } - - if (!isset($this->arguments['test'])) { - $testSuite = $configuration->getTestSuiteConfiguration($this->arguments['testsuite'] ?? ''); - - if ($testSuite !== null) { - $this->arguments['test'] = $testSuite; - } - } - } elseif (isset($this->arguments['bootstrap'])) { - $this->handleBootstrap($this->arguments['bootstrap']); - } - - if (isset($this->arguments['printer']) && - is_string($this->arguments['printer'])) { - $this->arguments['printer'] = $this->handlePrinter($this->arguments['printer']); - } - - if (!isset($this->arguments['test'])) { - $this->showHelp(); - - exit(TestRunner::EXCEPTION_EXIT); - } - } - - /** - * Handles the loading of the PHPUnit\Runner\TestSuiteLoader implementation. - */ - protected function handleLoader(string $loaderClass, string $loaderFile = ''): ?TestSuiteLoader - { - if (!class_exists($loaderClass, false)) { - if ($loaderFile == '') { - $loaderFile = Filesystem::classNameToFilename( - $loaderClass - ); - } - - $loaderFile = stream_resolve_include_path($loaderFile); - - if ($loaderFile) { - require $loaderFile; - } - } - - if (class_exists($loaderClass, false)) { - try { - $class = new ReflectionClass($loaderClass); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - if ($class->implementsInterface(TestSuiteLoader::class) && $class->isInstantiable()) { - $object = $class->newInstance(); - - assert($object instanceof TestSuiteLoader); - - return $object; - } - } - - if ($loaderClass == StandardTestSuiteLoader::class) { - return null; - } - - $this->exitWithErrorMessage( - sprintf( - 'Could not use "%s" as loader.', - $loaderClass - ) - ); - - return null; - } - - /** - * Handles the loading of the PHPUnit\Util\Printer implementation. - * - * @return null|Printer|string - */ - protected function handlePrinter(string $printerClass, string $printerFile = '') - { - if (!class_exists($printerClass, false)) { - if ($printerFile == '') { - $printerFile = Filesystem::classNameToFilename( - $printerClass - ); - } - - $printerFile = stream_resolve_include_path($printerFile); - - if ($printerFile) { - require $printerFile; - } - } - - if (!class_exists($printerClass)) { - $this->exitWithErrorMessage( - sprintf( - 'Could not use "%s" as printer: class does not exist', - $printerClass - ) - ); - } - - try { - $class = new ReflectionClass($printerClass); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - // @codeCoverageIgnoreEnd - } - - if (!$class->implementsInterface(TestListener::class)) { - $this->exitWithErrorMessage( - sprintf( - 'Could not use "%s" as printer: class does not implement %s', - $printerClass, - TestListener::class - ) - ); - } - - if (!$class->isSubclassOf(Printer::class)) { - $this->exitWithErrorMessage( - sprintf( - 'Could not use "%s" as printer: class does not extend %s', - $printerClass, - Printer::class - ) - ); - } - - if (!$class->isInstantiable()) { - $this->exitWithErrorMessage( - sprintf( - 'Could not use "%s" as printer: class cannot be instantiated', - $printerClass - ) - ); - } - - if ($class->isSubclassOf(ResultPrinter::class)) { - return $printerClass; - } - - $outputStream = isset($this->arguments['stderr']) ? 'php://stderr' : null; - - return $class->newInstance($outputStream); - } - - /** - * Loads a bootstrap file. - */ - protected function handleBootstrap(string $filename): void - { - try { - FileLoader::checkAndLoad($filename); - } catch (Exception $e) { - $this->exitWithErrorMessage($e->getMessage()); - } - } - - protected function handleVersionCheck(): void - { - $this->printVersionString(); - - $latestVersion = file_get_contents('https://phar.phpunit.de/latest-version-of/phpunit'); - $isOutdated = version_compare($latestVersion, Version::id(), '>'); - - if ($isOutdated) { - printf( - 'You are not using the latest version of PHPUnit.' . PHP_EOL . - 'The latest version is PHPUnit %s.' . PHP_EOL, - $latestVersion - ); - } else { - print 'You are using the latest version of PHPUnit.' . PHP_EOL; - } - - exit(TestRunner::SUCCESS_EXIT); - } - - /** - * Show the help message. - */ - protected function showHelp(): void - { - $this->printVersionString(); - (new Help)->writeToConsole(); - } - - /** - * Custom callback for test suite discovery. - */ - protected function handleCustomTestSuite(): void - { - } - - private function printVersionString(): void - { - if ($this->versionStringPrinted) { - return; - } - - print Version::getVersionString() . PHP_EOL . PHP_EOL; - - $this->versionStringPrinted = true; - } - - private function exitWithErrorMessage(string $message): void - { - $this->printVersionString(); - - print $message . PHP_EOL; - - exit(TestRunner::FAILURE_EXIT); - } - - private function handleExtensions(string $directory): void - { - foreach ((new FileIteratorFacade)->getFilesAsArray($directory, '.phar') as $file) { - if (!file_exists('phar://' . $file . '/manifest.xml')) { - $this->arguments['notLoadedExtensions'][] = $file . ' is not an extension for PHPUnit'; - - continue; - } - - try { - $applicationName = new ApplicationName('phpunit/phpunit'); - $version = new PharIoVersion(Version::series()); - $manifest = ManifestLoader::fromFile('phar://' . $file . '/manifest.xml'); - - if (!$manifest->isExtensionFor($applicationName)) { - $this->arguments['notLoadedExtensions'][] = $file . ' is not an extension for PHPUnit'; - - continue; - } - - if (!$manifest->isExtensionFor($applicationName, $version)) { - $this->arguments['notLoadedExtensions'][] = $file . ' is not compatible with this version of PHPUnit'; - - continue; - } - } catch (ManifestException $e) { - $this->arguments['notLoadedExtensions'][] = $file . ': ' . $e->getMessage(); - - continue; - } - - require $file; - - $this->arguments['loadedExtensions'][] = $manifest->getName()->asString() . ' ' . $manifest->getVersion()->getVersionString(); - } - } - - private function handleListGroups(TestSuite $suite, bool $exit): int - { - $this->printVersionString(); - - print 'Available test group(s):' . PHP_EOL; - - $groups = $suite->getGroups(); - sort($groups); - - foreach ($groups as $group) { - printf( - ' - %s' . PHP_EOL, - $group - ); - } - - if ($exit) { - exit(TestRunner::SUCCESS_EXIT); - } - - return TestRunner::SUCCESS_EXIT; - } - - /** - * @throws \PHPUnit\Framework\Exception - */ - private function handleListSuites(bool $exit): int - { - $this->printVersionString(); - - print 'Available test suite(s):' . PHP_EOL; - - $configuration = Configuration::getInstance( - $this->arguments['configuration'] - ); - - foreach ($configuration->getTestSuiteNames() as $suiteName) { - printf( - ' - %s' . PHP_EOL, - $suiteName - ); - } - - if ($exit) { - exit(TestRunner::SUCCESS_EXIT); - } - - return TestRunner::SUCCESS_EXIT; - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - private function handleListTests(TestSuite $suite, bool $exit): int - { - $this->printVersionString(); - - $renderer = new TextTestListRenderer; - - print $renderer->render($suite); - - if ($exit) { - exit(TestRunner::SUCCESS_EXIT); - } - - return TestRunner::SUCCESS_EXIT; - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - private function handleListTestsXml(TestSuite $suite, string $target, bool $exit): int - { - $this->printVersionString(); - - $renderer = new XmlTestListRenderer; - - file_put_contents($target, $renderer->render($suite)); - - printf( - 'Wrote list of tests that would have been run to %s' . PHP_EOL, - $target - ); - - if ($exit) { - exit(TestRunner::SUCCESS_EXIT); - } - - return TestRunner::SUCCESS_EXIT; - } - - private function handleOrderByOption(string $value): void - { - foreach (explode(',', $value) as $order) { - switch ($order) { - case 'default': - $this->arguments['executionOrder'] = TestSuiteSorter::ORDER_DEFAULT; - $this->arguments['executionOrderDefects'] = TestSuiteSorter::ORDER_DEFAULT; - $this->arguments['resolveDependencies'] = true; - - break; - - case 'defects': - $this->arguments['executionOrderDefects'] = TestSuiteSorter::ORDER_DEFECTS_FIRST; - - break; - - case 'depends': - $this->arguments['resolveDependencies'] = true; - - break; - - case 'duration': - $this->arguments['executionOrder'] = TestSuiteSorter::ORDER_DURATION; - - break; - - case 'no-depends': - $this->arguments['resolveDependencies'] = false; - - break; - - case 'random': - $this->arguments['executionOrder'] = TestSuiteSorter::ORDER_RANDOMIZED; - - break; - - case 'reverse': - $this->arguments['executionOrder'] = TestSuiteSorter::ORDER_REVERSED; - - break; - - case 'size': - $this->arguments['executionOrder'] = TestSuiteSorter::ORDER_SIZE; - - break; - - default: - $this->exitWithErrorMessage("unrecognized --order-by option: {$order}"); - } - } - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/Exception.php b/vendor/phpunit/phpunit/src/TextUI/Exception.php deleted file mode 100644 index 7c261e5..0000000 --- a/vendor/phpunit/phpunit/src/TextUI/Exception.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI; - -use RuntimeException; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Exception extends RuntimeException implements \PHPUnit\Exception -{ -} diff --git a/vendor/phpunit/phpunit/src/TextUI/Help.php b/vendor/phpunit/phpunit/src/TextUI/Help.php deleted file mode 100644 index 2dd8956..0000000 --- a/vendor/phpunit/phpunit/src/TextUI/Help.php +++ /dev/null @@ -1,256 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI; - -use const PHP_EOL; -use function count; -use function explode; -use function max; -use function preg_replace_callback; -use function str_pad; -use function str_repeat; -use function strlen; -use function wordwrap; -use PHPUnit\Util\Color; -use SebastianBergmann\Environment\Console; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Help -{ - private const LEFT_MARGIN = ' '; - - private const HELP_TEXT = [ - 'Usage' => [ - ['text' => 'phpunit [options] UnitTest [UnitTest.php]'], - ['text' => 'phpunit [options] '], - ], - 'Code Coverage Options' => [ - ['arg' => '--coverage-clover ', 'desc' => 'Generate code coverage report in Clover XML format'], - ['arg' => '--coverage-crap4j ', 'desc' => 'Generate code coverage report in Crap4J XML format'], - ['arg' => '--coverage-html ', 'desc' => 'Generate code coverage report in HTML format'], - ['arg' => '--coverage-php ', 'desc' => 'Export PHP_CodeCoverage object to file'], - ['arg' => '--coverage-text=', 'desc' => 'Generate code coverage report in text format [default: standard output]'], - ['arg' => '--coverage-xml ', 'desc' => 'Generate code coverage report in PHPUnit XML format'], - ['arg' => '--whitelist ', 'desc' => 'Whitelist for code coverage analysis'], - ['arg' => '--disable-coverage-ignore', 'desc' => 'Disable annotations for ignoring code coverage'], - ['arg' => '--no-coverage', 'desc' => 'Ignore code coverage configuration'], - ['arg' => '--dump-xdebug-filter ', 'desc' => 'Generate script to set Xdebug code coverage filter'], - ], - - 'Logging Options' => [ - ['arg' => '--log-junit ', 'desc' => 'Log test execution in JUnit XML format to file'], - ['arg' => '--log-teamcity ', 'desc' => 'Log test execution in TeamCity format to file'], - ['arg' => '--testdox-html ', 'desc' => 'Write agile documentation in HTML format to file'], - ['arg' => '--testdox-text ', 'desc' => 'Write agile documentation in Text format to file'], - ['arg' => '--testdox-xml ', 'desc' => 'Write agile documentation in XML format to file'], - ['arg' => '--reverse-list', 'desc' => 'Print defects in reverse order'], - ['arg' => '--no-logging', 'desc' => 'Ignore logging configuration'], - ], - - 'Test Selection Options' => [ - ['arg' => '--filter ', 'desc' => 'Filter which tests to run'], - ['arg' => '--testsuite ', 'desc' => 'Filter which testsuite to run'], - ['arg' => '--group ', 'desc' => 'Only runs tests from the specified group(s)'], - ['arg' => '--exclude-group ', 'desc' => 'Exclude tests from the specified group(s)'], - ['arg' => '--list-groups', 'desc' => 'List available test groups'], - ['arg' => '--list-suites', 'desc' => 'List available test suites'], - ['arg' => '--list-tests', 'desc' => 'List available tests'], - ['arg' => '--list-tests-xml ', 'desc' => 'List available tests in XML format'], - ['arg' => '--test-suffix ', 'desc' => 'Only search for test in files with specified suffix(es). Default: Test.php,.phpt'], - ], - - 'Test Execution Options' => [ - ['arg' => '--dont-report-useless-tests', 'desc' => 'Do not report tests that do not test anything'], - ['arg' => '--strict-coverage', 'desc' => 'Be strict about @covers annotation usage'], - ['arg' => '--strict-global-state', 'desc' => 'Be strict about changes to global state'], - ['arg' => '--disallow-test-output', 'desc' => 'Be strict about output during tests'], - ['arg' => '--disallow-resource-usage', 'desc' => 'Be strict about resource usage during small tests'], - ['arg' => '--enforce-time-limit', 'desc' => 'Enforce time limit based on test size'], - ['arg' => '--default-time-limit=', 'desc' => 'Timeout in seconds for tests without @small, @medium or @large'], - ['arg' => '--disallow-todo-tests', 'desc' => 'Disallow @todo-annotated tests'], - ['spacer' => ''], - - ['arg' => '--process-isolation', 'desc' => 'Run each test in a separate PHP process'], - ['arg' => '--globals-backup', 'desc' => 'Backup and restore $GLOBALS for each test'], - ['arg' => '--static-backup', 'desc' => 'Backup and restore static attributes for each test'], - ['spacer' => ''], - - ['arg' => '--colors=', 'desc' => 'Use colors in output ("never", "auto" or "always")'], - ['arg' => '--columns ', 'desc' => 'Number of columns to use for progress output'], - ['arg' => '--columns max', 'desc' => 'Use maximum number of columns for progress output'], - ['arg' => '--stderr', 'desc' => 'Write to STDERR instead of STDOUT'], - ['arg' => '--stop-on-defect', 'desc' => 'Stop execution upon first not-passed test'], - ['arg' => '--stop-on-error', 'desc' => 'Stop execution upon first error'], - ['arg' => '--stop-on-failure', 'desc' => 'Stop execution upon first error or failure'], - ['arg' => '--stop-on-warning', 'desc' => 'Stop execution upon first warning'], - ['arg' => '--stop-on-risky', 'desc' => 'Stop execution upon first risky test'], - ['arg' => '--stop-on-skipped', 'desc' => 'Stop execution upon first skipped test'], - ['arg' => '--stop-on-incomplete', 'desc' => 'Stop execution upon first incomplete test'], - ['arg' => '--fail-on-warning', 'desc' => 'Treat tests with warnings as failures'], - ['arg' => '--fail-on-risky', 'desc' => 'Treat risky tests as failures'], - ['arg' => '-v|--verbose', 'desc' => 'Output more verbose information'], - ['arg' => '--debug', 'desc' => 'Display debugging information'], - ['spacer' => ''], - - ['arg' => '--loader ', 'desc' => 'TestSuiteLoader implementation to use'], - ['arg' => '--repeat ', 'desc' => 'Runs the test(s) repeatedly'], - ['arg' => '--teamcity', 'desc' => 'Report test execution progress in TeamCity format'], - ['arg' => '--testdox', 'desc' => 'Report test execution progress in TestDox format'], - ['arg' => '--testdox-group', 'desc' => 'Only include tests from the specified group(s)'], - ['arg' => '--testdox-exclude-group', 'desc' => 'Exclude tests from the specified group(s)'], - ['arg' => '--no-interaction', 'desc' => 'Disable TestDox progress animation'], - ['arg' => '--printer ', 'desc' => 'TestListener implementation to use'], - ['spacer' => ''], - - ['arg' => '--order-by=', 'desc' => 'Run tests in order: default|defects|duration|no-depends|random|reverse|size'], - ['arg' => '--random-order-seed=', 'desc' => 'Use a specific random seed for random order'], - ['arg' => '--cache-result', 'desc' => 'Write test results to cache file'], - ['arg' => '--do-not-cache-result', 'desc' => 'Do not write test results to cache file'], - ], - - 'Configuration Options' => [ - ['arg' => '--prepend ', 'desc' => 'A PHP script that is included as early as possible'], - ['arg' => '--bootstrap ', 'desc' => 'A PHP script that is included before the tests run'], - ['arg' => '-c|--configuration ', 'desc' => 'Read configuration from XML file'], - ['arg' => '--no-configuration', 'desc' => 'Ignore default configuration file (phpunit.xml)'], - ['arg' => '--no-extensions', 'desc' => 'Do not load PHPUnit extensions'], - ['arg' => '--include-path ', 'desc' => 'Prepend PHP\'s include_path with given path(s)'], - ['arg' => '-d ', 'desc' => 'Sets a php.ini value'], - ['arg' => '--generate-configuration', 'desc' => 'Generate configuration file with suggested settings'], - ['arg' => '--cache-result-file=', 'desc' => 'Specify result cache path and filename'], - ], - - 'Miscellaneous Options' => [ - ['arg' => '-h|--help', 'desc' => 'Prints this usage information'], - ['arg' => '--version', 'desc' => 'Prints the version and exits'], - ['arg' => '--atleast-version ', 'desc' => 'Checks that version is greater than min and exits'], - ['arg' => '--check-version', 'desc' => 'Check whether PHPUnit is the latest version'], - ], - - ]; - - /** - * @var int Number of columns required to write the longest option name to the console - */ - private $maxArgLength = 0; - - /** - * @var int Number of columns left for the description field after padding and option - */ - private $maxDescLength; - - /** - * @var bool Use color highlights for sections, options and parameters - */ - private $hasColor = false; - - public function __construct(?int $width = null, ?bool $withColor = null) - { - if ($width === null) { - $width = (new Console)->getNumberOfColumns(); - } - - if ($withColor === null) { - $this->hasColor = (new Console)->hasColorSupport(); - } else { - $this->hasColor = $withColor; - } - - foreach (self::HELP_TEXT as $options) { - foreach ($options as $option) { - if (isset($option['arg'])) { - $this->maxArgLength = max($this->maxArgLength, isset($option['arg']) ? strlen($option['arg']) : 0); - } - } - } - - $this->maxDescLength = $width - $this->maxArgLength - 4; - } - - /** - * Write the help file to the CLI, adapting width and colors to the console. - */ - public function writeToConsole(): void - { - if ($this->hasColor) { - $this->writeWithColor(); - } else { - $this->writePlaintext(); - } - } - - private function writePlaintext(): void - { - foreach (self::HELP_TEXT as $section => $options) { - print "{$section}:" . PHP_EOL; - - if ($section !== 'Usage') { - print PHP_EOL; - } - - foreach ($options as $option) { - if (isset($option['spacer'])) { - print PHP_EOL; - } - - if (isset($option['text'])) { - print self::LEFT_MARGIN . $option['text'] . PHP_EOL; - } - - if (isset($option['arg'])) { - $arg = str_pad($option['arg'], $this->maxArgLength); - print self::LEFT_MARGIN . $arg . ' ' . $option['desc'] . PHP_EOL; - } - } - - print PHP_EOL; - } - } - - private function writeWithColor(): void - { - foreach (self::HELP_TEXT as $section => $options) { - print Color::colorize('fg-yellow', "{$section}:") . PHP_EOL; - - foreach ($options as $option) { - if (isset($option['spacer'])) { - print PHP_EOL; - } - - if (isset($option['text'])) { - print self::LEFT_MARGIN . $option['text'] . PHP_EOL; - } - - if (isset($option['arg'])) { - $arg = Color::colorize('fg-green', str_pad($option['arg'], $this->maxArgLength)); - $arg = preg_replace_callback( - '/(<[^>]+>)/', - static function ($matches) - { - return Color::colorize('fg-cyan', $matches[0]); - }, - $arg - ); - $desc = explode(PHP_EOL, wordwrap($option['desc'], $this->maxDescLength, PHP_EOL)); - - print self::LEFT_MARGIN . $arg . ' ' . $desc[0] . PHP_EOL; - - for ($i = 1; $i < count($desc); $i++) { - print str_repeat(' ', $this->maxArgLength + 3) . $desc[$i] . PHP_EOL; - } - } - } - - print PHP_EOL; - } - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/ResultPrinter.php b/vendor/phpunit/phpunit/src/TextUI/ResultPrinter.php deleted file mode 100644 index c4d06b3..0000000 --- a/vendor/phpunit/phpunit/src/TextUI/ResultPrinter.php +++ /dev/null @@ -1,588 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI; - -use const PHP_EOL; -use function array_map; -use function array_reverse; -use function count; -use function floor; -use function implode; -use function in_array; -use function is_int; -use function max; -use function preg_split; -use function sprintf; -use function str_pad; -use function str_repeat; -use function strlen; -use function vsprintf; -use PHPUnit\Framework\AssertionFailedError; -use PHPUnit\Framework\Exception; -use PHPUnit\Framework\InvalidArgumentException; -use PHPUnit\Framework\Test; -use PHPUnit\Framework\TestCase; -use PHPUnit\Framework\TestFailure; -use PHPUnit\Framework\TestListener; -use PHPUnit\Framework\TestResult; -use PHPUnit\Framework\TestSuite; -use PHPUnit\Framework\Warning; -use PHPUnit\Runner\PhptTestCase; -use PHPUnit\Util\Color; -use PHPUnit\Util\Printer; -use SebastianBergmann\Environment\Console; -use SebastianBergmann\Timer\Timer; -use Throwable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -class ResultPrinter extends Printer implements TestListener -{ - public const EVENT_TEST_START = 0; - - public const EVENT_TEST_END = 1; - - public const EVENT_TESTSUITE_START = 2; - - public const EVENT_TESTSUITE_END = 3; - - public const COLOR_NEVER = 'never'; - - public const COLOR_AUTO = 'auto'; - - public const COLOR_ALWAYS = 'always'; - - public const COLOR_DEFAULT = self::COLOR_NEVER; - - private const AVAILABLE_COLORS = [self::COLOR_NEVER, self::COLOR_AUTO, self::COLOR_ALWAYS]; - - /** - * @var int - */ - protected $column = 0; - - /** - * @var int - */ - protected $maxColumn; - - /** - * @var bool - */ - protected $lastTestFailed = false; - - /** - * @var int - */ - protected $numAssertions = 0; - - /** - * @var int - */ - protected $numTests = -1; - - /** - * @var int - */ - protected $numTestsRun = 0; - - /** - * @var int - */ - protected $numTestsWidth; - - /** - * @var bool - */ - protected $colors = false; - - /** - * @var bool - */ - protected $debug = false; - - /** - * @var bool - */ - protected $verbose = false; - - /** - * @var int - */ - private $numberOfColumns; - - /** - * @var bool - */ - private $reverse; - - /** - * @var bool - */ - private $defectListPrinted = false; - - /** - * Constructor. - * - * @param null|resource|string $out - * @param int|string $numberOfColumns - * - * @throws Exception - */ - public function __construct($out = null, bool $verbose = false, string $colors = self::COLOR_DEFAULT, bool $debug = false, $numberOfColumns = 80, bool $reverse = false) - { - parent::__construct($out); - - if (!in_array($colors, self::AVAILABLE_COLORS, true)) { - throw InvalidArgumentException::create( - 3, - vsprintf('value from "%s", "%s" or "%s"', self::AVAILABLE_COLORS) - ); - } - - if (!is_int($numberOfColumns) && $numberOfColumns !== 'max') { - throw InvalidArgumentException::create(5, 'integer or "max"'); - } - - $console = new Console; - $maxNumberOfColumns = $console->getNumberOfColumns(); - - if ($numberOfColumns === 'max' || ($numberOfColumns !== 80 && $numberOfColumns > $maxNumberOfColumns)) { - $numberOfColumns = $maxNumberOfColumns; - } - - $this->numberOfColumns = $numberOfColumns; - $this->verbose = $verbose; - $this->debug = $debug; - $this->reverse = $reverse; - - if ($colors === self::COLOR_AUTO && $console->hasColorSupport()) { - $this->colors = true; - } else { - $this->colors = (self::COLOR_ALWAYS === $colors); - } - } - - /** - * @throws \SebastianBergmann\Timer\RuntimeException - */ - public function printResult(TestResult $result): void - { - $this->printHeader($result); - $this->printErrors($result); - $this->printWarnings($result); - $this->printFailures($result); - $this->printRisky($result); - - if ($this->verbose) { - $this->printIncompletes($result); - $this->printSkipped($result); - } - - $this->printFooter($result); - } - - /** - * An error occurred. - */ - public function addError(Test $test, Throwable $t, float $time): void - { - $this->writeProgressWithColor('fg-red, bold', 'E'); - $this->lastTestFailed = true; - } - - /** - * A failure occurred. - */ - public function addFailure(Test $test, AssertionFailedError $e, float $time): void - { - $this->writeProgressWithColor('bg-red, fg-white', 'F'); - $this->lastTestFailed = true; - } - - /** - * A warning occurred. - */ - public function addWarning(Test $test, Warning $e, float $time): void - { - $this->writeProgressWithColor('fg-yellow, bold', 'W'); - $this->lastTestFailed = true; - } - - /** - * Incomplete test. - */ - public function addIncompleteTest(Test $test, Throwable $t, float $time): void - { - $this->writeProgressWithColor('fg-yellow, bold', 'I'); - $this->lastTestFailed = true; - } - - /** - * Risky test. - */ - public function addRiskyTest(Test $test, Throwable $t, float $time): void - { - $this->writeProgressWithColor('fg-yellow, bold', 'R'); - $this->lastTestFailed = true; - } - - /** - * Skipped test. - */ - public function addSkippedTest(Test $test, Throwable $t, float $time): void - { - $this->writeProgressWithColor('fg-cyan, bold', 'S'); - $this->lastTestFailed = true; - } - - /** - * A testsuite started. - */ - public function startTestSuite(TestSuite $suite): void - { - if ($this->numTests == -1) { - $this->numTests = count($suite); - $this->numTestsWidth = strlen((string) $this->numTests); - $this->maxColumn = $this->numberOfColumns - strlen(' / (XXX%)') - (2 * $this->numTestsWidth); - } - } - - /** - * A testsuite ended. - */ - public function endTestSuite(TestSuite $suite): void - { - } - - /** - * A test started. - */ - public function startTest(Test $test): void - { - if ($this->debug) { - $this->write( - sprintf( - "Test '%s' started\n", - \PHPUnit\Util\Test::describeAsString($test) - ) - ); - } - } - - /** - * A test ended. - */ - public function endTest(Test $test, float $time): void - { - if ($this->debug) { - $this->write( - sprintf( - "Test '%s' ended\n", - \PHPUnit\Util\Test::describeAsString($test) - ) - ); - } - - if (!$this->lastTestFailed) { - $this->writeProgress('.'); - } - - if ($test instanceof TestCase) { - $this->numAssertions += $test->getNumAssertions(); - } elseif ($test instanceof PhptTestCase) { - $this->numAssertions++; - } - - $this->lastTestFailed = false; - - if ($test instanceof TestCase && !$test->hasExpectationOnOutput()) { - $this->write($test->getActualOutput()); - } - } - - protected function printDefects(array $defects, string $type): void - { - $count = count($defects); - - if ($count == 0) { - return; - } - - if ($this->defectListPrinted) { - $this->write("\n--\n\n"); - } - - $this->write( - sprintf( - "There %s %d %s%s:\n", - ($count == 1) ? 'was' : 'were', - $count, - $type, - ($count == 1) ? '' : 's' - ) - ); - - $i = 1; - - if ($this->reverse) { - $defects = array_reverse($defects); - } - - foreach ($defects as $defect) { - $this->printDefect($defect, $i++); - } - - $this->defectListPrinted = true; - } - - protected function printDefect(TestFailure $defect, int $count): void - { - $this->printDefectHeader($defect, $count); - $this->printDefectTrace($defect); - } - - protected function printDefectHeader(TestFailure $defect, int $count): void - { - $this->write( - sprintf( - "\n%d) %s\n", - $count, - $defect->getTestName() - ) - ); - } - - protected function printDefectTrace(TestFailure $defect): void - { - $e = $defect->thrownException(); - $this->write((string) $e); - - while ($e = $e->getPrevious()) { - $this->write("\nCaused by\n" . $e); - } - } - - protected function printErrors(TestResult $result): void - { - $this->printDefects($result->errors(), 'error'); - } - - protected function printFailures(TestResult $result): void - { - $this->printDefects($result->failures(), 'failure'); - } - - protected function printWarnings(TestResult $result): void - { - $this->printDefects($result->warnings(), 'warning'); - } - - protected function printIncompletes(TestResult $result): void - { - $this->printDefects($result->notImplemented(), 'incomplete test'); - } - - protected function printRisky(TestResult $result): void - { - $this->printDefects($result->risky(), 'risky test'); - } - - protected function printSkipped(TestResult $result): void - { - $this->printDefects($result->skipped(), 'skipped test'); - } - - /** - * @throws \SebastianBergmann\Timer\RuntimeException - */ - protected function printHeader(TestResult $result): void - { - if (count($result) > 0) { - $this->write(PHP_EOL . PHP_EOL . Timer::resourceUsage() . PHP_EOL . PHP_EOL); - } - } - - protected function printFooter(TestResult $result): void - { - if (count($result) === 0) { - $this->writeWithColor( - 'fg-black, bg-yellow', - 'No tests executed!' - ); - - return; - } - - if ($result->wasSuccessfulAndNoTestIsRiskyOrSkippedOrIncomplete()) { - $this->writeWithColor( - 'fg-black, bg-green', - sprintf( - 'OK (%d test%s, %d assertion%s)', - count($result), - (count($result) == 1) ? '' : 's', - $this->numAssertions, - ($this->numAssertions == 1) ? '' : 's' - ) - ); - - return; - } - - $color = 'fg-black, bg-yellow'; - - if ($result->wasSuccessful()) { - if ($this->verbose || !$result->allHarmless()) { - $this->write("\n"); - } - - $this->writeWithColor( - $color, - 'OK, but incomplete, skipped, or risky tests!' - ); - } else { - $this->write("\n"); - - if ($result->errorCount()) { - $color = 'fg-white, bg-red'; - - $this->writeWithColor( - $color, - 'ERRORS!' - ); - } elseif ($result->failureCount()) { - $color = 'fg-white, bg-red'; - - $this->writeWithColor( - $color, - 'FAILURES!' - ); - } elseif ($result->warningCount()) { - $color = 'fg-black, bg-yellow'; - - $this->writeWithColor( - $color, - 'WARNINGS!' - ); - } - } - - $this->writeCountString(count($result), 'Tests', $color, true); - $this->writeCountString($this->numAssertions, 'Assertions', $color, true); - $this->writeCountString($result->errorCount(), 'Errors', $color); - $this->writeCountString($result->failureCount(), 'Failures', $color); - $this->writeCountString($result->warningCount(), 'Warnings', $color); - $this->writeCountString($result->skippedCount(), 'Skipped', $color); - $this->writeCountString($result->notImplementedCount(), 'Incomplete', $color); - $this->writeCountString($result->riskyCount(), 'Risky', $color); - $this->writeWithColor($color, '.'); - } - - protected function writeProgress(string $progress): void - { - if ($this->debug) { - return; - } - - $this->write($progress); - $this->column++; - $this->numTestsRun++; - - if ($this->column == $this->maxColumn || $this->numTestsRun == $this->numTests) { - if ($this->numTestsRun == $this->numTests) { - $this->write(str_repeat(' ', $this->maxColumn - $this->column)); - } - - $this->write( - sprintf( - ' %' . $this->numTestsWidth . 'd / %' . - $this->numTestsWidth . 'd (%3s%%)', - $this->numTestsRun, - $this->numTests, - floor(($this->numTestsRun / $this->numTests) * 100) - ) - ); - - if ($this->column == $this->maxColumn) { - $this->writeNewLine(); - } - } - } - - protected function writeNewLine(): void - { - $this->column = 0; - $this->write("\n"); - } - - /** - * Formats a buffer with a specified ANSI color sequence if colors are - * enabled. - */ - protected function colorizeTextBox(string $color, string $buffer): string - { - if (!$this->colors) { - return $buffer; - } - - $lines = preg_split('/\r\n|\r|\n/', $buffer); - $padding = max(array_map('\strlen', $lines)); - - $styledLines = []; - - foreach ($lines as $line) { - $styledLines[] = Color::colorize($color, str_pad($line, $padding)); - } - - return implode(PHP_EOL, $styledLines); - } - - /** - * Writes a buffer out with a color sequence if colors are enabled. - */ - protected function writeWithColor(string $color, string $buffer, bool $lf = true): void - { - $this->write($this->colorizeTextBox($color, $buffer)); - - if ($lf) { - $this->write(PHP_EOL); - } - } - - /** - * Writes progress with a color sequence if colors are enabled. - */ - protected function writeProgressWithColor(string $color, string $buffer): void - { - $buffer = $this->colorizeTextBox($color, $buffer); - $this->writeProgress($buffer); - } - - private function writeCountString(int $count, string $name, string $color, bool $always = false): void - { - static $first = true; - - if ($always || $count > 0) { - $this->writeWithColor( - $color, - sprintf( - '%s%s: %d', - !$first ? ', ' : '', - $name, - $count - ), - false - ); - - $first = false; - } - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/TestRunner.php b/vendor/phpunit/phpunit/src/TextUI/TestRunner.php deleted file mode 100644 index a837512..0000000 --- a/vendor/phpunit/phpunit/src/TextUI/TestRunner.php +++ /dev/null @@ -1,1392 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI; - -use const PHP_EOL; -use const PHP_MAJOR_VERSION; -use const PHP_SAPI; -use function array_diff; -use function assert; -use function class_exists; -use function count; -use function dirname; -use function extension_loaded; -use function file_put_contents; -use function htmlspecialchars; -use function ini_get; -use function is_int; -use function is_string; -use function is_subclass_of; -use function mt_srand; -use function range; -use function realpath; -use function sprintf; -use function strpos; -use function time; -use PHPUnit\Framework\Exception; -use PHPUnit\Framework\Test; -use PHPUnit\Framework\TestCase; -use PHPUnit\Framework\TestListener; -use PHPUnit\Framework\TestResult; -use PHPUnit\Framework\TestSuite; -use PHPUnit\Runner\AfterLastTestHook; -use PHPUnit\Runner\BaseTestRunner; -use PHPUnit\Runner\BeforeFirstTestHook; -use PHPUnit\Runner\DefaultTestResultCache; -use PHPUnit\Runner\Filter\ExcludeGroupFilterIterator; -use PHPUnit\Runner\Filter\Factory; -use PHPUnit\Runner\Filter\IncludeGroupFilterIterator; -use PHPUnit\Runner\Filter\NameFilterIterator; -use PHPUnit\Runner\Hook; -use PHPUnit\Runner\NullTestResultCache; -use PHPUnit\Runner\ResultCacheExtension; -use PHPUnit\Runner\StandardTestSuiteLoader; -use PHPUnit\Runner\TestHook; -use PHPUnit\Runner\TestListenerAdapter; -use PHPUnit\Runner\TestSuiteLoader; -use PHPUnit\Runner\TestSuiteSorter; -use PHPUnit\Runner\Version; -use PHPUnit\Util\Configuration; -use PHPUnit\Util\Filesystem; -use PHPUnit\Util\Log\JUnit; -use PHPUnit\Util\Log\TeamCity; -use PHPUnit\Util\Printer; -use PHPUnit\Util\TestDox\CliTestDoxPrinter; -use PHPUnit\Util\TestDox\HtmlResultPrinter; -use PHPUnit\Util\TestDox\TextResultPrinter; -use PHPUnit\Util\TestDox\XmlResultPrinter; -use PHPUnit\Util\XdebugFilterScriptGenerator; -use ReflectionClass; -use ReflectionException; -use SebastianBergmann\CodeCoverage\CodeCoverage; -use SebastianBergmann\CodeCoverage\Exception as CodeCoverageException; -use SebastianBergmann\CodeCoverage\Filter as CodeCoverageFilter; -use SebastianBergmann\CodeCoverage\Report\Clover as CloverReport; -use SebastianBergmann\CodeCoverage\Report\Crap4j as Crap4jReport; -use SebastianBergmann\CodeCoverage\Report\Html\Facade as HtmlReport; -use SebastianBergmann\CodeCoverage\Report\PHP as PhpReport; -use SebastianBergmann\CodeCoverage\Report\Text as TextReport; -use SebastianBergmann\CodeCoverage\Report\Xml\Facade as XmlReport; -use SebastianBergmann\Comparator\Comparator; -use SebastianBergmann\Environment\Runtime; -use SebastianBergmann\Invoker\Invoker; -use SebastianBergmann\Timer\Timer; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class TestRunner extends BaseTestRunner -{ - public const SUCCESS_EXIT = 0; - - public const FAILURE_EXIT = 1; - - public const EXCEPTION_EXIT = 2; - - /** - * @var bool - */ - private static $versionStringPrinted = false; - - /** - * @var CodeCoverageFilter - */ - private $codeCoverageFilter; - - /** - * @var TestSuiteLoader - */ - private $loader; - - /** - * @psalm-var Printer&TestListener - */ - private $printer; - - /** - * @var Runtime - */ - private $runtime; - - /** - * @var bool - */ - private $messagePrinted = false; - - /** - * @var Hook[] - */ - private $extensions = []; - - public function __construct(TestSuiteLoader $loader = null, CodeCoverageFilter $filter = null) - { - if ($filter === null) { - $filter = new CodeCoverageFilter; - } - - $this->codeCoverageFilter = $filter; - $this->loader = $loader; - $this->runtime = new Runtime; - } - - /** - * @throws \PHPUnit\Runner\Exception - * @throws Exception - */ - public function doRun(Test $suite, array $arguments = [], array $warnings = [], bool $exit = true): TestResult - { - if (isset($arguments['configuration'])) { - $GLOBALS['__PHPUNIT_CONFIGURATION_FILE'] = $arguments['configuration']; - } - - $this->handleConfiguration($arguments); - - if (is_int($arguments['columns']) && $arguments['columns'] < 16) { - $arguments['columns'] = 16; - $tooFewColumnsRequested = true; - } - - if (isset($arguments['bootstrap'])) { - $GLOBALS['__PHPUNIT_BOOTSTRAP'] = $arguments['bootstrap']; - } - - if ($suite instanceof TestCase || $suite instanceof TestSuite) { - if ($arguments['backupGlobals'] === true) { - $suite->setBackupGlobals(true); - } - - if ($arguments['backupStaticAttributes'] === true) { - $suite->setBackupStaticAttributes(true); - } - - if ($arguments['beStrictAboutChangesToGlobalState'] === true) { - $suite->setBeStrictAboutChangesToGlobalState(true); - } - } - - if ($arguments['executionOrder'] === TestSuiteSorter::ORDER_RANDOMIZED) { - mt_srand($arguments['randomOrderSeed']); - } - - if ($arguments['cacheResult']) { - if (!isset($arguments['cacheResultFile'])) { - if (isset($arguments['configuration']) && $arguments['configuration'] instanceof Configuration) { - $cacheLocation = $arguments['configuration']->getFilename(); - } else { - $cacheLocation = $_SERVER['PHP_SELF']; - } - - $arguments['cacheResultFile'] = null; - - $cacheResultFile = realpath($cacheLocation); - - if ($cacheResultFile !== false) { - $arguments['cacheResultFile'] = dirname($cacheResultFile); - } - } - - $cache = new DefaultTestResultCache($arguments['cacheResultFile']); - - $this->addExtension(new ResultCacheExtension($cache)); - } - - if ($arguments['executionOrder'] !== TestSuiteSorter::ORDER_DEFAULT || $arguments['executionOrderDefects'] !== TestSuiteSorter::ORDER_DEFAULT || $arguments['resolveDependencies']) { - $cache = $cache ?? new NullTestResultCache; - - $cache->load(); - - $sorter = new TestSuiteSorter($cache); - - $sorter->reorderTestsInSuite($suite, $arguments['executionOrder'], $arguments['resolveDependencies'], $arguments['executionOrderDefects']); - $originalExecutionOrder = $sorter->getOriginalExecutionOrder(); - - unset($sorter); - } - - if (is_int($arguments['repeat']) && $arguments['repeat'] > 0) { - $_suite = new TestSuite; - - /* @noinspection PhpUnusedLocalVariableInspection */ - foreach (range(1, $arguments['repeat']) as $step) { - $_suite->addTest($suite); - } - - $suite = $_suite; - - unset($_suite); - } - - $result = $this->createTestResult(); - - $listener = new TestListenerAdapter; - $listenerNeeded = false; - - foreach ($this->extensions as $extension) { - if ($extension instanceof TestHook) { - $listener->add($extension); - - $listenerNeeded = true; - } - } - - if ($listenerNeeded) { - $result->addListener($listener); - } - - unset($listener, $listenerNeeded); - - if ($arguments['convertDeprecationsToExceptions']) { - $result->convertDeprecationsToExceptions(true); - } - - if (!$arguments['convertErrorsToExceptions']) { - $result->convertErrorsToExceptions(false); - } - - if (!$arguments['convertNoticesToExceptions']) { - $result->convertNoticesToExceptions(false); - } - - if (!$arguments['convertWarningsToExceptions']) { - $result->convertWarningsToExceptions(false); - } - - if ($arguments['stopOnError']) { - $result->stopOnError(true); - } - - if ($arguments['stopOnFailure']) { - $result->stopOnFailure(true); - } - - if ($arguments['stopOnWarning']) { - $result->stopOnWarning(true); - } - - if ($arguments['stopOnIncomplete']) { - $result->stopOnIncomplete(true); - } - - if ($arguments['stopOnRisky']) { - $result->stopOnRisky(true); - } - - if ($arguments['stopOnSkipped']) { - $result->stopOnSkipped(true); - } - - if ($arguments['stopOnDefect']) { - $result->stopOnDefect(true); - } - - if ($arguments['registerMockObjectsFromTestArgumentsRecursively']) { - $result->setRegisterMockObjectsFromTestArgumentsRecursively(true); - } - - if ($this->printer === null) { - if (isset($arguments['printer'])) { - if ($arguments['printer'] instanceof Printer && $arguments['printer'] instanceof TestListener) { - $this->printer = $arguments['printer']; - } elseif (is_string($arguments['printer']) && class_exists($arguments['printer'], false)) { - try { - new ReflectionClass($arguments['printer']); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - if (is_subclass_of($arguments['printer'], ResultPrinter::class)) { - $this->printer = $this->createPrinter($arguments['printer'], $arguments); - } - } - } else { - $this->printer = $this->createPrinter(ResultPrinter::class, $arguments); - } - } - - if (isset($originalExecutionOrder) && $this->printer instanceof CliTestDoxPrinter) { - assert($this->printer instanceof CliTestDoxPrinter); - - $this->printer->setOriginalExecutionOrder($originalExecutionOrder); - $this->printer->setShowProgressAnimation(!$arguments['noInteraction']); - } - - $this->printer->write( - Version::getVersionString() . "\n" - ); - - self::$versionStringPrinted = true; - - if ($arguments['verbose']) { - $this->writeMessage('Runtime', $this->runtime->getNameWithVersionAndCodeCoverageDriver()); - - if (isset($arguments['configuration'])) { - $this->writeMessage( - 'Configuration', - $arguments['configuration']->getFilename() - ); - } - - foreach ($arguments['loadedExtensions'] as $extension) { - $this->writeMessage( - 'Extension', - $extension - ); - } - - foreach ($arguments['notLoadedExtensions'] as $extension) { - $this->writeMessage( - 'Extension', - $extension - ); - } - } - - foreach ($warnings as $warning) { - $this->writeMessage('Warning', $warning); - } - - if ($arguments['executionOrder'] === TestSuiteSorter::ORDER_RANDOMIZED) { - $this->writeMessage( - 'Random seed', - (string) $arguments['randomOrderSeed'] - ); - } - - if (isset($tooFewColumnsRequested)) { - $this->writeMessage('Error', 'Less than 16 columns requested, number of columns set to 16'); - } - - if ($this->runtime->discardsComments()) { - $this->writeMessage('Warning', 'opcache.save_comments=0 set; annotations will not work'); - } - - if (isset($arguments['configuration']) && $arguments['configuration']->hasValidationErrors()) { - $this->write( - "\n Warning - The configuration file did not pass validation!\n The following problems have been detected:\n" - ); - - foreach ($arguments['configuration']->getValidationErrors() as $line => $errors) { - $this->write(sprintf("\n Line %d:\n", $line)); - - foreach ($errors as $msg) { - $this->write(sprintf(" - %s\n", $msg)); - } - } - - $this->write("\n Test results may not be as expected.\n\n"); - } - - if (isset($arguments['conflictBetweenPrinterClassAndTestdox'])) { - $this->writeMessage('Warning', 'Directives printerClass and testdox are mutually exclusive'); - } - - foreach ($arguments['listeners'] as $listener) { - $result->addListener($listener); - } - - $result->addListener($this->printer); - - $codeCoverageReports = 0; - - if (!isset($arguments['noLogging'])) { - if (isset($arguments['testdoxHTMLFile'])) { - $result->addListener( - new HtmlResultPrinter( - $arguments['testdoxHTMLFile'], - $arguments['testdoxGroups'], - $arguments['testdoxExcludeGroups'] - ) - ); - } - - if (isset($arguments['testdoxTextFile'])) { - $result->addListener( - new TextResultPrinter( - $arguments['testdoxTextFile'], - $arguments['testdoxGroups'], - $arguments['testdoxExcludeGroups'] - ) - ); - } - - if (isset($arguments['testdoxXMLFile'])) { - $result->addListener( - new XmlResultPrinter( - $arguments['testdoxXMLFile'] - ) - ); - } - - if (isset($arguments['teamcityLogfile'])) { - $result->addListener( - new TeamCity($arguments['teamcityLogfile']) - ); - } - - if (isset($arguments['junitLogfile'])) { - $result->addListener( - new JUnit( - $arguments['junitLogfile'], - $arguments['reportUselessTests'] - ) - ); - } - - if (isset($arguments['coverageClover'])) { - $codeCoverageReports++; - } - - if (isset($arguments['coverageCrap4J'])) { - $codeCoverageReports++; - } - - if (isset($arguments['coverageHtml'])) { - $codeCoverageReports++; - } - - if (isset($arguments['coveragePHP'])) { - $codeCoverageReports++; - } - - if (isset($arguments['coverageText'])) { - $codeCoverageReports++; - } - - if (isset($arguments['coverageXml'])) { - $codeCoverageReports++; - } - } - - if (isset($arguments['noCoverage'])) { - $codeCoverageReports = 0; - } - - if ($codeCoverageReports > 0 && PHP_MAJOR_VERSION < 8 && !$this->runtime->canCollectCodeCoverage()) { - $this->writeMessage('Error', 'No code coverage driver is available'); - - $codeCoverageReports = 0; - } - - if ($codeCoverageReports > 0 || isset($arguments['xdebugFilterFile'])) { - $whitelistFromConfigurationFile = false; - $whitelistFromOption = false; - - if (isset($arguments['whitelist'])) { - $this->codeCoverageFilter->addDirectoryToWhitelist($arguments['whitelist']); - - $whitelistFromOption = true; - } - - if (isset($arguments['configuration'])) { - $filterConfiguration = $arguments['configuration']->getFilterConfiguration(); - - if (!empty($filterConfiguration['whitelist'])) { - $whitelistFromConfigurationFile = true; - } - - if (!empty($filterConfiguration['whitelist'])) { - foreach ($filterConfiguration['whitelist']['include']['directory'] as $dir) { - $this->codeCoverageFilter->addDirectoryToWhitelist( - $dir['path'], - $dir['suffix'], - $dir['prefix'] - ); - } - - foreach ($filterConfiguration['whitelist']['include']['file'] as $file) { - $this->codeCoverageFilter->addFileToWhitelist($file); - } - - foreach ($filterConfiguration['whitelist']['exclude']['directory'] as $dir) { - $this->codeCoverageFilter->removeDirectoryFromWhitelist( - $dir['path'], - $dir['suffix'], - $dir['prefix'] - ); - } - - foreach ($filterConfiguration['whitelist']['exclude']['file'] as $file) { - $this->codeCoverageFilter->removeFileFromWhitelist($file); - } - } - } - } - - if ($codeCoverageReports > 0) { - if (PHP_MAJOR_VERSION >= 8) { - $this->writeMessage('Error', 'This version of PHPUnit does not support code coverage on PHP 8'); - - $codeCoverageReports = 0; - } else { - try { - $codeCoverage = new CodeCoverage( - null, - $this->codeCoverageFilter - ); - - $codeCoverage->setUnintentionallyCoveredSubclassesWhitelist( - [Comparator::class] - ); - - $codeCoverage->setCheckForUnintentionallyCoveredCode( - $arguments['strictCoverage'] - ); - - $codeCoverage->setCheckForMissingCoversAnnotation( - $arguments['strictCoverage'] - ); - - if (isset($arguments['forceCoversAnnotation'])) { - $codeCoverage->setForceCoversAnnotation( - $arguments['forceCoversAnnotation'] - ); - } - - if (isset($arguments['ignoreDeprecatedCodeUnitsFromCodeCoverage'])) { - $codeCoverage->setIgnoreDeprecatedCode( - $arguments['ignoreDeprecatedCodeUnitsFromCodeCoverage'] - ); - } - - if (isset($arguments['disableCodeCoverageIgnore'])) { - $codeCoverage->setDisableIgnoredLines(true); - } - - if (!empty($filterConfiguration['whitelist'])) { - $codeCoverage->setAddUncoveredFilesFromWhitelist( - $filterConfiguration['whitelist']['addUncoveredFilesFromWhitelist'] - ); - - $codeCoverage->setProcessUncoveredFilesFromWhitelist( - $filterConfiguration['whitelist']['processUncoveredFilesFromWhitelist'] - ); - } - - if (!$this->codeCoverageFilter->hasWhitelist()) { - if (!$whitelistFromConfigurationFile && !$whitelistFromOption) { - $this->writeMessage('Error', 'No whitelist is configured, no code coverage will be generated.'); - } else { - $this->writeMessage('Error', 'Incorrect whitelist config, no code coverage will be generated.'); - } - - $codeCoverageReports = 0; - - unset($codeCoverage); - } - } catch (CodeCoverageException $e) { - $this->writeMessage('Error', $e->getMessage()); - - $codeCoverageReports = 0; - } - } - } - - if (isset($arguments['xdebugFilterFile'], $filterConfiguration)) { - $this->write("\n"); - - $script = (new XdebugFilterScriptGenerator)->generate($filterConfiguration['whitelist']); - - if ($arguments['xdebugFilterFile'] !== 'php://stdout' && $arguments['xdebugFilterFile'] !== 'php://stderr' && !Filesystem::createDirectory(dirname($arguments['xdebugFilterFile']))) { - $this->write(sprintf('Cannot write Xdebug filter script to %s ' . PHP_EOL, $arguments['xdebugFilterFile'])); - - exit(self::EXCEPTION_EXIT); - } - - file_put_contents($arguments['xdebugFilterFile'], $script); - - $this->write(sprintf('Wrote Xdebug filter script to %s ' . PHP_EOL, $arguments['xdebugFilterFile'])); - - exit(self::SUCCESS_EXIT); - } - - $this->printer->write("\n"); - - if (isset($codeCoverage)) { - $result->setCodeCoverage($codeCoverage); - - if ($codeCoverageReports > 1 && isset($arguments['cacheTokens'])) { - $codeCoverage->setCacheTokens($arguments['cacheTokens']); - } - } - - $result->beStrictAboutTestsThatDoNotTestAnything($arguments['reportUselessTests']); - $result->beStrictAboutOutputDuringTests($arguments['disallowTestOutput']); - $result->beStrictAboutTodoAnnotatedTests($arguments['disallowTodoAnnotatedTests']); - $result->beStrictAboutResourceUsageDuringSmallTests($arguments['beStrictAboutResourceUsageDuringSmallTests']); - - if ($arguments['enforceTimeLimit'] === true) { - if (!class_exists(Invoker::class)) { - $this->writeMessage('Error', 'Package phpunit/php-invoker is required for enforcing time limits'); - } - - if (!extension_loaded('pcntl') || strpos(ini_get('disable_functions'), 'pcntl') !== false) { - $this->writeMessage('Error', 'PHP extension pcntl is required for enforcing time limits'); - } - } - $result->enforceTimeLimit($arguments['enforceTimeLimit']); - $result->setDefaultTimeLimit($arguments['defaultTimeLimit']); - $result->setTimeoutForSmallTests($arguments['timeoutForSmallTests']); - $result->setTimeoutForMediumTests($arguments['timeoutForMediumTests']); - $result->setTimeoutForLargeTests($arguments['timeoutForLargeTests']); - - if ($suite instanceof TestSuite) { - $this->processSuiteFilters($suite, $arguments); - $suite->setRunTestInSeparateProcess($arguments['processIsolation']); - } - - foreach ($this->extensions as $extension) { - if ($extension instanceof BeforeFirstTestHook) { - $extension->executeBeforeFirstTest(); - } - } - - $suite->run($result); - - foreach ($this->extensions as $extension) { - if ($extension instanceof AfterLastTestHook) { - $extension->executeAfterLastTest(); - } - } - - $result->flushListeners(); - - if ($this->printer instanceof ResultPrinter) { - $this->printer->printResult($result); - } - - if (isset($codeCoverage)) { - if (isset($arguments['coverageClover'])) { - $this->codeCoverageGenerationStart('Clover XML'); - - try { - $writer = new CloverReport; - $writer->process($codeCoverage, $arguments['coverageClover']); - - $this->codeCoverageGenerationSucceeded(); - - unset($writer); - } catch (CodeCoverageException $e) { - $this->codeCoverageGenerationFailed($e); - } - } - - if (isset($arguments['coverageCrap4J'])) { - $this->codeCoverageGenerationStart('Crap4J XML'); - - try { - $writer = new Crap4jReport($arguments['crap4jThreshold']); - $writer->process($codeCoverage, $arguments['coverageCrap4J']); - - $this->codeCoverageGenerationSucceeded(); - - unset($writer); - } catch (CodeCoverageException $e) { - $this->codeCoverageGenerationFailed($e); - } - } - - if (isset($arguments['coverageHtml'])) { - $this->codeCoverageGenerationStart('HTML'); - - try { - $writer = new HtmlReport( - $arguments['reportLowUpperBound'], - $arguments['reportHighLowerBound'], - sprintf( - ' and PHPUnit %s', - Version::id() - ) - ); - - $writer->process($codeCoverage, $arguments['coverageHtml']); - - $this->codeCoverageGenerationSucceeded(); - - unset($writer); - } catch (CodeCoverageException $e) { - $this->codeCoverageGenerationFailed($e); - } - } - - if (isset($arguments['coveragePHP'])) { - $this->codeCoverageGenerationStart('PHP'); - - try { - $writer = new PhpReport; - $writer->process($codeCoverage, $arguments['coveragePHP']); - - $this->codeCoverageGenerationSucceeded(); - - unset($writer); - } catch (CodeCoverageException $e) { - $this->codeCoverageGenerationFailed($e); - } - } - - if (isset($arguments['coverageText'])) { - if ($arguments['coverageText'] === 'php://stdout') { - $outputStream = $this->printer; - $colors = $arguments['colors'] && $arguments['colors'] !== ResultPrinter::COLOR_NEVER; - } else { - $outputStream = new Printer($arguments['coverageText']); - $colors = false; - } - - $processor = new TextReport( - $arguments['reportLowUpperBound'], - $arguments['reportHighLowerBound'], - $arguments['coverageTextShowUncoveredFiles'], - $arguments['coverageTextShowOnlySummary'] - ); - - $outputStream->write( - $processor->process($codeCoverage, $colors) - ); - } - - if (isset($arguments['coverageXml'])) { - $this->codeCoverageGenerationStart('PHPUnit XML'); - - try { - $writer = new XmlReport(Version::id()); - $writer->process($codeCoverage, $arguments['coverageXml']); - - $this->codeCoverageGenerationSucceeded(); - - unset($writer); - } catch (CodeCoverageException $e) { - $this->codeCoverageGenerationFailed($e); - } - } - } - - if ($exit) { - if ($result->wasSuccessfulIgnoringWarnings()) { - if ($arguments['failOnRisky'] && !$result->allHarmless()) { - exit(self::FAILURE_EXIT); - } - - if ($arguments['failOnWarning'] && $result->warningCount() > 0) { - exit(self::FAILURE_EXIT); - } - - exit(self::SUCCESS_EXIT); - } - - if ($result->errorCount() > 0) { - exit(self::EXCEPTION_EXIT); - } - - if ($result->failureCount() > 0) { - exit(self::FAILURE_EXIT); - } - } - - return $result; - } - - public function setPrinter(ResultPrinter $resultPrinter): void - { - $this->printer = $resultPrinter; - } - - /** - * Returns the loader to be used. - */ - public function getLoader(): TestSuiteLoader - { - if ($this->loader === null) { - $this->loader = new StandardTestSuiteLoader; - } - - return $this->loader; - } - - public function addExtension(Hook $extension): void - { - $this->extensions[] = $extension; - } - - /** - * Override to define how to handle a failed loading of - * a test suite. - */ - protected function runFailed(string $message): void - { - $this->write($message . PHP_EOL); - - exit(self::FAILURE_EXIT); - } - - private function createTestResult(): TestResult - { - return new TestResult; - } - - private function write(string $buffer): void - { - if (PHP_SAPI !== 'cli' && PHP_SAPI !== 'phpdbg') { - $buffer = htmlspecialchars($buffer); - } - - if ($this->printer !== null) { - $this->printer->write($buffer); - } else { - print $buffer; - } - } - - /** - * @throws Exception - */ - private function handleConfiguration(array &$arguments): void - { - if (isset($arguments['configuration']) && - !$arguments['configuration'] instanceof Configuration) { - $arguments['configuration'] = Configuration::getInstance( - $arguments['configuration'] - ); - } - - $arguments['debug'] = $arguments['debug'] ?? false; - $arguments['filter'] = $arguments['filter'] ?? false; - $arguments['listeners'] = $arguments['listeners'] ?? []; - - if (isset($arguments['configuration'])) { - $arguments['configuration']->handlePHPConfiguration(); - - $phpunitConfiguration = $arguments['configuration']->getPHPUnitConfiguration(); - - if (isset($phpunitConfiguration['backupGlobals']) && !isset($arguments['backupGlobals'])) { - $arguments['backupGlobals'] = $phpunitConfiguration['backupGlobals']; - } - - if (isset($phpunitConfiguration['backupStaticAttributes']) && !isset($arguments['backupStaticAttributes'])) { - $arguments['backupStaticAttributes'] = $phpunitConfiguration['backupStaticAttributes']; - } - - if (isset($phpunitConfiguration['beStrictAboutChangesToGlobalState']) && !isset($arguments['beStrictAboutChangesToGlobalState'])) { - $arguments['beStrictAboutChangesToGlobalState'] = $phpunitConfiguration['beStrictAboutChangesToGlobalState']; - } - - if (isset($phpunitConfiguration['bootstrap']) && !isset($arguments['bootstrap'])) { - $arguments['bootstrap'] = $phpunitConfiguration['bootstrap']; - } - - if (isset($phpunitConfiguration['cacheResult']) && !isset($arguments['cacheResult'])) { - $arguments['cacheResult'] = $phpunitConfiguration['cacheResult']; - } - - if (isset($phpunitConfiguration['cacheResultFile']) && !isset($arguments['cacheResultFile'])) { - $arguments['cacheResultFile'] = $phpunitConfiguration['cacheResultFile']; - } - - if (isset($phpunitConfiguration['cacheTokens']) && !isset($arguments['cacheTokens'])) { - $arguments['cacheTokens'] = $phpunitConfiguration['cacheTokens']; - } - - if (isset($phpunitConfiguration['cacheTokens']) && !isset($arguments['cacheTokens'])) { - $arguments['cacheTokens'] = $phpunitConfiguration['cacheTokens']; - } - - if (isset($phpunitConfiguration['colors']) && !isset($arguments['colors'])) { - $arguments['colors'] = $phpunitConfiguration['colors']; - } - - if (isset($phpunitConfiguration['convertDeprecationsToExceptions']) && !isset($arguments['convertDeprecationsToExceptions'])) { - $arguments['convertDeprecationsToExceptions'] = $phpunitConfiguration['convertDeprecationsToExceptions']; - } - - if (isset($phpunitConfiguration['convertErrorsToExceptions']) && !isset($arguments['convertErrorsToExceptions'])) { - $arguments['convertErrorsToExceptions'] = $phpunitConfiguration['convertErrorsToExceptions']; - } - - if (isset($phpunitConfiguration['convertNoticesToExceptions']) && !isset($arguments['convertNoticesToExceptions'])) { - $arguments['convertNoticesToExceptions'] = $phpunitConfiguration['convertNoticesToExceptions']; - } - - if (isset($phpunitConfiguration['convertWarningsToExceptions']) && !isset($arguments['convertWarningsToExceptions'])) { - $arguments['convertWarningsToExceptions'] = $phpunitConfiguration['convertWarningsToExceptions']; - } - - if (isset($phpunitConfiguration['processIsolation']) && !isset($arguments['processIsolation'])) { - $arguments['processIsolation'] = $phpunitConfiguration['processIsolation']; - } - - if (isset($phpunitConfiguration['stopOnDefect']) && !isset($arguments['stopOnDefect'])) { - $arguments['stopOnDefect'] = $phpunitConfiguration['stopOnDefect']; - } - - if (isset($phpunitConfiguration['stopOnError']) && !isset($arguments['stopOnError'])) { - $arguments['stopOnError'] = $phpunitConfiguration['stopOnError']; - } - - if (isset($phpunitConfiguration['stopOnFailure']) && !isset($arguments['stopOnFailure'])) { - $arguments['stopOnFailure'] = $phpunitConfiguration['stopOnFailure']; - } - - if (isset($phpunitConfiguration['stopOnWarning']) && !isset($arguments['stopOnWarning'])) { - $arguments['stopOnWarning'] = $phpunitConfiguration['stopOnWarning']; - } - - if (isset($phpunitConfiguration['stopOnIncomplete']) && !isset($arguments['stopOnIncomplete'])) { - $arguments['stopOnIncomplete'] = $phpunitConfiguration['stopOnIncomplete']; - } - - if (isset($phpunitConfiguration['stopOnRisky']) && !isset($arguments['stopOnRisky'])) { - $arguments['stopOnRisky'] = $phpunitConfiguration['stopOnRisky']; - } - - if (isset($phpunitConfiguration['stopOnSkipped']) && !isset($arguments['stopOnSkipped'])) { - $arguments['stopOnSkipped'] = $phpunitConfiguration['stopOnSkipped']; - } - - if (isset($phpunitConfiguration['failOnWarning']) && !isset($arguments['failOnWarning'])) { - $arguments['failOnWarning'] = $phpunitConfiguration['failOnWarning']; - } - - if (isset($phpunitConfiguration['failOnRisky']) && !isset($arguments['failOnRisky'])) { - $arguments['failOnRisky'] = $phpunitConfiguration['failOnRisky']; - } - - if (isset($phpunitConfiguration['timeoutForSmallTests']) && !isset($arguments['timeoutForSmallTests'])) { - $arguments['timeoutForSmallTests'] = $phpunitConfiguration['timeoutForSmallTests']; - } - - if (isset($phpunitConfiguration['timeoutForMediumTests']) && !isset($arguments['timeoutForMediumTests'])) { - $arguments['timeoutForMediumTests'] = $phpunitConfiguration['timeoutForMediumTests']; - } - - if (isset($phpunitConfiguration['timeoutForLargeTests']) && !isset($arguments['timeoutForLargeTests'])) { - $arguments['timeoutForLargeTests'] = $phpunitConfiguration['timeoutForLargeTests']; - } - - if (isset($phpunitConfiguration['reportUselessTests']) && !isset($arguments['reportUselessTests'])) { - $arguments['reportUselessTests'] = $phpunitConfiguration['reportUselessTests']; - } - - if (isset($phpunitConfiguration['strictCoverage']) && !isset($arguments['strictCoverage'])) { - $arguments['strictCoverage'] = $phpunitConfiguration['strictCoverage']; - } - - if (isset($phpunitConfiguration['ignoreDeprecatedCodeUnitsFromCodeCoverage']) && !isset($arguments['ignoreDeprecatedCodeUnitsFromCodeCoverage'])) { - $arguments['ignoreDeprecatedCodeUnitsFromCodeCoverage'] = $phpunitConfiguration['ignoreDeprecatedCodeUnitsFromCodeCoverage']; - } - - if (isset($phpunitConfiguration['disallowTestOutput']) && !isset($arguments['disallowTestOutput'])) { - $arguments['disallowTestOutput'] = $phpunitConfiguration['disallowTestOutput']; - } - - if (isset($phpunitConfiguration['defaultTimeLimit']) && !isset($arguments['defaultTimeLimit'])) { - $arguments['defaultTimeLimit'] = $phpunitConfiguration['defaultTimeLimit']; - } - - if (isset($phpunitConfiguration['enforceTimeLimit']) && !isset($arguments['enforceTimeLimit'])) { - $arguments['enforceTimeLimit'] = $phpunitConfiguration['enforceTimeLimit']; - } - - if (isset($phpunitConfiguration['disallowTodoAnnotatedTests']) && !isset($arguments['disallowTodoAnnotatedTests'])) { - $arguments['disallowTodoAnnotatedTests'] = $phpunitConfiguration['disallowTodoAnnotatedTests']; - } - - if (isset($phpunitConfiguration['beStrictAboutResourceUsageDuringSmallTests']) && !isset($arguments['beStrictAboutResourceUsageDuringSmallTests'])) { - $arguments['beStrictAboutResourceUsageDuringSmallTests'] = $phpunitConfiguration['beStrictAboutResourceUsageDuringSmallTests']; - } - - if (isset($phpunitConfiguration['verbose']) && !isset($arguments['verbose'])) { - $arguments['verbose'] = $phpunitConfiguration['verbose']; - } - - if (isset($phpunitConfiguration['reverseDefectList']) && !isset($arguments['reverseList'])) { - $arguments['reverseList'] = $phpunitConfiguration['reverseDefectList']; - } - - if (isset($phpunitConfiguration['forceCoversAnnotation']) && !isset($arguments['forceCoversAnnotation'])) { - $arguments['forceCoversAnnotation'] = $phpunitConfiguration['forceCoversAnnotation']; - } - - if (isset($phpunitConfiguration['disableCodeCoverageIgnore']) && !isset($arguments['disableCodeCoverageIgnore'])) { - $arguments['disableCodeCoverageIgnore'] = $phpunitConfiguration['disableCodeCoverageIgnore']; - } - - if (isset($phpunitConfiguration['registerMockObjectsFromTestArgumentsRecursively']) && !isset($arguments['registerMockObjectsFromTestArgumentsRecursively'])) { - $arguments['registerMockObjectsFromTestArgumentsRecursively'] = $phpunitConfiguration['registerMockObjectsFromTestArgumentsRecursively']; - } - - if (isset($phpunitConfiguration['executionOrder']) && !isset($arguments['executionOrder'])) { - $arguments['executionOrder'] = $phpunitConfiguration['executionOrder']; - } - - if (isset($phpunitConfiguration['executionOrderDefects']) && !isset($arguments['executionOrderDefects'])) { - $arguments['executionOrderDefects'] = $phpunitConfiguration['executionOrderDefects']; - } - - if (isset($phpunitConfiguration['resolveDependencies']) && !isset($arguments['resolveDependencies'])) { - $arguments['resolveDependencies'] = $phpunitConfiguration['resolveDependencies']; - } - - if (isset($phpunitConfiguration['noInteraction']) && !isset($arguments['noInteraction'])) { - $arguments['noInteraction'] = $phpunitConfiguration['noInteraction']; - } - - if (isset($phpunitConfiguration['conflictBetweenPrinterClassAndTestdox'])) { - $arguments['conflictBetweenPrinterClassAndTestdox'] = true; - } - - $groupCliArgs = []; - - if (!empty($arguments['groups'])) { - $groupCliArgs = $arguments['groups']; - } - - $groupConfiguration = $arguments['configuration']->getGroupConfiguration(); - - if (!empty($groupConfiguration['include']) && !isset($arguments['groups'])) { - $arguments['groups'] = $groupConfiguration['include']; - } - - if (!empty($groupConfiguration['exclude']) && !isset($arguments['excludeGroups'])) { - $arguments['excludeGroups'] = array_diff($groupConfiguration['exclude'], $groupCliArgs); - } - - foreach ($arguments['configuration']->getExtensionConfiguration() as $extension) { - if ($extension['file'] !== '' && !class_exists($extension['class'], false)) { - require_once $extension['file']; - } - - if (!class_exists($extension['class'])) { - throw new Exception( - sprintf( - 'Class "%s" does not exist', - $extension['class'] - ) - ); - } - - try { - $extensionClass = new ReflectionClass($extension['class']); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - if (!$extensionClass->implementsInterface(Hook::class)) { - throw new Exception( - sprintf( - 'Class "%s" does not implement a PHPUnit\Runner\Hook interface', - $extension['class'] - ) - ); - } - - if (count($extension['arguments']) === 0) { - $extensionObject = $extensionClass->newInstance(); - } else { - $extensionObject = $extensionClass->newInstanceArgs( - $extension['arguments'] - ); - } - - assert($extensionObject instanceof Hook); - - $this->addExtension($extensionObject); - } - - foreach ($arguments['configuration']->getListenerConfiguration() as $listener) { - if ($listener['file'] !== '' && !class_exists($listener['class'], false)) { - require_once $listener['file']; - } - - if (!class_exists($listener['class'])) { - throw new Exception( - sprintf( - 'Class "%s" does not exist', - $listener['class'] - ) - ); - } - - try { - $listenerClass = new ReflectionClass($listener['class']); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - if (!$listenerClass->implementsInterface(TestListener::class)) { - throw new Exception( - sprintf( - 'Class "%s" does not implement the PHPUnit\Framework\TestListener interface', - $listener['class'] - ) - ); - } - - if (count($listener['arguments']) === 0) { - $listener = new $listener['class']; - } else { - $listener = $listenerClass->newInstanceArgs( - $listener['arguments'] - ); - } - - $arguments['listeners'][] = $listener; - } - - $loggingConfiguration = $arguments['configuration']->getLoggingConfiguration(); - - if (isset($loggingConfiguration['coverage-clover']) && !isset($arguments['coverageClover'])) { - $arguments['coverageClover'] = $loggingConfiguration['coverage-clover']; - } - - if (isset($loggingConfiguration['coverage-crap4j']) && !isset($arguments['coverageCrap4J'])) { - $arguments['coverageCrap4J'] = $loggingConfiguration['coverage-crap4j']; - - if (isset($loggingConfiguration['crap4jThreshold']) && !isset($arguments['crap4jThreshold'])) { - $arguments['crap4jThreshold'] = $loggingConfiguration['crap4jThreshold']; - } - } - - if (isset($loggingConfiguration['coverage-html']) && !isset($arguments['coverageHtml'])) { - if (isset($loggingConfiguration['lowUpperBound']) && !isset($arguments['reportLowUpperBound'])) { - $arguments['reportLowUpperBound'] = $loggingConfiguration['lowUpperBound']; - } - - if (isset($loggingConfiguration['highLowerBound']) && !isset($arguments['reportHighLowerBound'])) { - $arguments['reportHighLowerBound'] = $loggingConfiguration['highLowerBound']; - } - - $arguments['coverageHtml'] = $loggingConfiguration['coverage-html']; - } - - if (isset($loggingConfiguration['coverage-php']) && !isset($arguments['coveragePHP'])) { - $arguments['coveragePHP'] = $loggingConfiguration['coverage-php']; - } - - if (isset($loggingConfiguration['coverage-text']) && !isset($arguments['coverageText'])) { - $arguments['coverageText'] = $loggingConfiguration['coverage-text']; - $arguments['coverageTextShowUncoveredFiles'] = $loggingConfiguration['coverageTextShowUncoveredFiles'] ?? false; - $arguments['coverageTextShowOnlySummary'] = $loggingConfiguration['coverageTextShowOnlySummary'] ?? false; - } - - if (isset($loggingConfiguration['coverage-xml']) && !isset($arguments['coverageXml'])) { - $arguments['coverageXml'] = $loggingConfiguration['coverage-xml']; - } - - if (isset($loggingConfiguration['plain'])) { - $arguments['listeners'][] = new ResultPrinter( - $loggingConfiguration['plain'], - true - ); - } - - if (isset($loggingConfiguration['teamcity']) && !isset($arguments['teamcityLogfile'])) { - $arguments['teamcityLogfile'] = $loggingConfiguration['teamcity']; - } - - if (isset($loggingConfiguration['junit']) && !isset($arguments['junitLogfile'])) { - $arguments['junitLogfile'] = $loggingConfiguration['junit']; - } - - if (isset($loggingConfiguration['testdox-html']) && !isset($arguments['testdoxHTMLFile'])) { - $arguments['testdoxHTMLFile'] = $loggingConfiguration['testdox-html']; - } - - if (isset($loggingConfiguration['testdox-text']) && !isset($arguments['testdoxTextFile'])) { - $arguments['testdoxTextFile'] = $loggingConfiguration['testdox-text']; - } - - if (isset($loggingConfiguration['testdox-xml']) && !isset($arguments['testdoxXMLFile'])) { - $arguments['testdoxXMLFile'] = $loggingConfiguration['testdox-xml']; - } - - $testdoxGroupConfiguration = $arguments['configuration']->getTestdoxGroupConfiguration(); - - if (isset($testdoxGroupConfiguration['include']) && - !isset($arguments['testdoxGroups'])) { - $arguments['testdoxGroups'] = $testdoxGroupConfiguration['include']; - } - - if (isset($testdoxGroupConfiguration['exclude']) && - !isset($arguments['testdoxExcludeGroups'])) { - $arguments['testdoxExcludeGroups'] = $testdoxGroupConfiguration['exclude']; - } - } - - $arguments['addUncoveredFilesFromWhitelist'] = $arguments['addUncoveredFilesFromWhitelist'] ?? true; - $arguments['backupGlobals'] = $arguments['backupGlobals'] ?? null; - $arguments['backupStaticAttributes'] = $arguments['backupStaticAttributes'] ?? null; - $arguments['beStrictAboutChangesToGlobalState'] = $arguments['beStrictAboutChangesToGlobalState'] ?? null; - $arguments['beStrictAboutResourceUsageDuringSmallTests'] = $arguments['beStrictAboutResourceUsageDuringSmallTests'] ?? false; - $arguments['cacheResult'] = $arguments['cacheResult'] ?? true; - $arguments['cacheTokens'] = $arguments['cacheTokens'] ?? false; - $arguments['colors'] = $arguments['colors'] ?? ResultPrinter::COLOR_DEFAULT; - $arguments['columns'] = $arguments['columns'] ?? 80; - $arguments['convertDeprecationsToExceptions'] = $arguments['convertDeprecationsToExceptions'] ?? false; - $arguments['convertErrorsToExceptions'] = $arguments['convertErrorsToExceptions'] ?? true; - $arguments['convertNoticesToExceptions'] = $arguments['convertNoticesToExceptions'] ?? true; - $arguments['convertWarningsToExceptions'] = $arguments['convertWarningsToExceptions'] ?? true; - $arguments['crap4jThreshold'] = $arguments['crap4jThreshold'] ?? 30; - $arguments['disallowTestOutput'] = $arguments['disallowTestOutput'] ?? false; - $arguments['disallowTodoAnnotatedTests'] = $arguments['disallowTodoAnnotatedTests'] ?? false; - $arguments['defaultTimeLimit'] = $arguments['defaultTimeLimit'] ?? 0; - $arguments['enforceTimeLimit'] = $arguments['enforceTimeLimit'] ?? false; - $arguments['excludeGroups'] = $arguments['excludeGroups'] ?? []; - $arguments['executionOrder'] = $arguments['executionOrder'] ?? TestSuiteSorter::ORDER_DEFAULT; - $arguments['executionOrderDefects'] = $arguments['executionOrderDefects'] ?? TestSuiteSorter::ORDER_DEFAULT; - $arguments['failOnRisky'] = $arguments['failOnRisky'] ?? false; - $arguments['failOnWarning'] = $arguments['failOnWarning'] ?? false; - $arguments['groups'] = $arguments['groups'] ?? []; - $arguments['noInteraction'] = $arguments['noInteraction'] ?? false; - $arguments['processIsolation'] = $arguments['processIsolation'] ?? false; - $arguments['processUncoveredFilesFromWhitelist'] = $arguments['processUncoveredFilesFromWhitelist'] ?? false; - $arguments['randomOrderSeed'] = $arguments['randomOrderSeed'] ?? time(); - $arguments['registerMockObjectsFromTestArgumentsRecursively'] = $arguments['registerMockObjectsFromTestArgumentsRecursively'] ?? false; - $arguments['repeat'] = $arguments['repeat'] ?? false; - $arguments['reportHighLowerBound'] = $arguments['reportHighLowerBound'] ?? 90; - $arguments['reportLowUpperBound'] = $arguments['reportLowUpperBound'] ?? 50; - $arguments['reportUselessTests'] = $arguments['reportUselessTests'] ?? true; - $arguments['reverseList'] = $arguments['reverseList'] ?? false; - $arguments['resolveDependencies'] = $arguments['resolveDependencies'] ?? true; - $arguments['stopOnError'] = $arguments['stopOnError'] ?? false; - $arguments['stopOnFailure'] = $arguments['stopOnFailure'] ?? false; - $arguments['stopOnIncomplete'] = $arguments['stopOnIncomplete'] ?? false; - $arguments['stopOnRisky'] = $arguments['stopOnRisky'] ?? false; - $arguments['stopOnSkipped'] = $arguments['stopOnSkipped'] ?? false; - $arguments['stopOnWarning'] = $arguments['stopOnWarning'] ?? false; - $arguments['stopOnDefect'] = $arguments['stopOnDefect'] ?? false; - $arguments['strictCoverage'] = $arguments['strictCoverage'] ?? false; - $arguments['testdoxExcludeGroups'] = $arguments['testdoxExcludeGroups'] ?? []; - $arguments['testdoxGroups'] = $arguments['testdoxGroups'] ?? []; - $arguments['timeoutForLargeTests'] = $arguments['timeoutForLargeTests'] ?? 60; - $arguments['timeoutForMediumTests'] = $arguments['timeoutForMediumTests'] ?? 10; - $arguments['timeoutForSmallTests'] = $arguments['timeoutForSmallTests'] ?? 1; - $arguments['verbose'] = $arguments['verbose'] ?? false; - } - - private function processSuiteFilters(TestSuite $suite, array $arguments): void - { - if (!$arguments['filter'] && - empty($arguments['groups']) && - empty($arguments['excludeGroups'])) { - return; - } - - $filterFactory = new Factory; - - if (!empty($arguments['excludeGroups'])) { - $filterFactory->addFilter( - new ReflectionClass(ExcludeGroupFilterIterator::class), - $arguments['excludeGroups'] - ); - } - - if (!empty($arguments['groups'])) { - $filterFactory->addFilter( - new ReflectionClass(IncludeGroupFilterIterator::class), - $arguments['groups'] - ); - } - - if ($arguments['filter']) { - $filterFactory->addFilter( - new ReflectionClass(NameFilterIterator::class), - $arguments['filter'] - ); - } - - $suite->injectFilter($filterFactory); - } - - private function writeMessage(string $type, string $message): void - { - if (!$this->messagePrinted) { - $this->write("\n"); - } - - $this->write( - sprintf( - "%-15s%s\n", - $type . ':', - $message - ) - ); - - $this->messagePrinted = true; - } - - /** - * @template T as Printer - * - * @param class-string $class - * - * @return T - */ - private function createPrinter(string $class, array $arguments): Printer - { - return new $class( - (isset($arguments['stderr']) && $arguments['stderr'] === true) ? 'php://stderr' : null, - $arguments['verbose'], - $arguments['colors'], - $arguments['debug'], - $arguments['columns'], - $arguments['reverseList'] - ); - } - - private function codeCoverageGenerationStart(string $format): void - { - $this->printer->write( - sprintf( - "\nGenerating code coverage report in %s format ... ", - $format - ) - ); - - Timer::start(); - } - - private function codeCoverageGenerationSucceeded(): void - { - $this->printer->write( - sprintf( - "done [%s]\n", - Timer::secondsToTimeString(Timer::stop()) - ) - ); - } - - private function codeCoverageGenerationFailed(\Exception $e): void - { - $this->printer->write( - sprintf( - "failed [%s]\n%s\n", - Timer::secondsToTimeString(Timer::stop()), - $e->getMessage() - ) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Annotation/DocBlock.php b/vendor/phpunit/phpunit/src/Util/Annotation/DocBlock.php deleted file mode 100644 index 22d3313..0000000 --- a/vendor/phpunit/phpunit/src/Util/Annotation/DocBlock.php +++ /dev/null @@ -1,621 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util\Annotation; - -use const JSON_ERROR_NONE; -use const PREG_OFFSET_CAPTURE; -use function array_filter; -use function array_key_exists; -use function array_map; -use function array_merge; -use function array_pop; -use function array_slice; -use function array_values; -use function constant; -use function count; -use function defined; -use function explode; -use function file; -use function implode; -use function is_array; -use function is_int; -use function is_numeric; -use function is_string; -use function json_decode; -use function json_last_error; -use function json_last_error_msg; -use function preg_match; -use function preg_match_all; -use function preg_replace; -use function preg_split; -use function realpath; -use function rtrim; -use function sprintf; -use function str_replace; -use function strlen; -use function strpos; -use function strtolower; -use function substr; -use function substr_count; -use function trim; -use PharIo\Version\VersionConstraintParser; -use PHPUnit\Framework\InvalidDataProviderException; -use PHPUnit\Framework\SkippedTestError; -use PHPUnit\Framework\Warning; -use PHPUnit\Util\Exception; -use PHPUnit\Util\InvalidDataSetException; -use ReflectionClass; -use ReflectionException; -use ReflectionFunctionAbstract; -use ReflectionMethod; -use Reflector; -use Traversable; - -/** - * This is an abstraction around a PHPUnit-specific docBlock, - * allowing us to ask meaningful questions about a specific - * reflection symbol. - * - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class DocBlock -{ - /** - * @todo This constant should be private (it's public because of TestTest::testGetProvidedDataRegEx) - */ - public const REGEX_DATA_PROVIDER = '/@dataProvider\s+([a-zA-Z0-9._:-\\\\x7f-\xff]+)/'; - - private const REGEX_REQUIRES_VERSION = '/@requires\s+(?PPHP(?:Unit)?)\s+(?P[<>=!]{0,2})\s*(?P[\d\.-]+(dev|(RC|alpha|beta)[\d\.])?)[ \t]*\r?$/m'; - - private const REGEX_REQUIRES_VERSION_CONSTRAINT = '/@requires\s+(?PPHP(?:Unit)?)\s+(?P[\d\t \-.|~^]+)[ \t]*\r?$/m'; - - private const REGEX_REQUIRES_OS = '/@requires\s+(?POS(?:FAMILY)?)\s+(?P.+?)[ \t]*\r?$/m'; - - private const REGEX_REQUIRES_SETTING = '/@requires\s+(?Psetting)\s+(?P([^ ]+?))\s*(?P[\w\.-]+[\w\.]?)?[ \t]*\r?$/m'; - - private const REGEX_REQUIRES = '/@requires\s+(?Pfunction|extension)\s+(?P([^\s<>=!]+))\s*(?P[<>=!]{0,2})\s*(?P[\d\.-]+[\d\.]?)?[ \t]*\r?$/m'; - - private const REGEX_TEST_WITH = '/@testWith\s+/'; - - private const REGEX_EXPECTED_EXCEPTION = '(@expectedException\s+([:.\w\\\\x7f-\xff]+)(?:[\t ]+(\S*))?(?:[\t ]+(\S*))?\s*$)m'; - - /** @var string */ - private $docComment; - - /** @var bool */ - private $isMethod; - - /** @var array> pre-parsed annotations indexed by name and occurrence index */ - private $symbolAnnotations; - - /** - * @var null|array - * - * @psalm-var null|(array{ - * __OFFSET: array&array{__FILE: string}, - * setting?: array, - * extension_versions?: array - * }&array< - * string, - * string|array{version: string, operator: string}|array{constraint: string}|array - * >) - */ - private $parsedRequirements; - - /** @var int */ - private $startLine; - - /** @var int */ - private $endLine; - - /** @var string */ - private $fileName; - - /** @var string */ - private $name; - - /** - * @var string - * - * @psalm-var class-string - */ - private $className; - - public static function ofClass(ReflectionClass $class): self - { - $className = $class->getName(); - - return new self( - (string) $class->getDocComment(), - false, - self::extractAnnotationsFromReflector($class), - $class->getStartLine(), - $class->getEndLine(), - $class->getFileName(), - $className, - $className - ); - } - - /** - * @psalm-param class-string $classNameInHierarchy - */ - public static function ofMethod(ReflectionMethod $method, string $classNameInHierarchy): self - { - return new self( - (string) $method->getDocComment(), - true, - self::extractAnnotationsFromReflector($method), - $method->getStartLine(), - $method->getEndLine(), - $method->getFileName(), - $method->getName(), - $classNameInHierarchy - ); - } - - /** - * Note: we do not preserve an instance of the reflection object, since it cannot be safely (de-)serialized. - * - * @param array> $symbolAnnotations - * - * @psalm-param class-string $className - */ - private function __construct(string $docComment, bool $isMethod, array $symbolAnnotations, int $startLine, int $endLine, string $fileName, string $name, string $className) - { - $this->docComment = $docComment; - $this->isMethod = $isMethod; - $this->symbolAnnotations = $symbolAnnotations; - $this->startLine = $startLine; - $this->endLine = $endLine; - $this->fileName = $fileName; - $this->name = $name; - $this->className = $className; - } - - /** - * @psalm-return array{ - * __OFFSET: array&array{__FILE: string}, - * setting?: array, - * extension_versions?: array - * }&array< - * string, - * string|array{version: string, operator: string}|array{constraint: string}|array - * > - * - * @throws Warning if the requirements version constraint is not well-formed - */ - public function requirements(): array - { - if ($this->parsedRequirements !== null) { - return $this->parsedRequirements; - } - - $offset = $this->startLine; - $requires = []; - $recordedSettings = []; - $extensionVersions = []; - $recordedOffsets = [ - '__FILE' => realpath($this->fileName), - ]; - - // Trim docblock markers, split it into lines and rewind offset to start of docblock - $lines = preg_replace(['#^/\*{2}#', '#\*/$#'], '', preg_split('/\r\n|\r|\n/', $this->docComment)); - $offset -= count($lines); - - foreach ($lines as $line) { - if (preg_match(self::REGEX_REQUIRES_OS, $line, $matches)) { - $requires[$matches['name']] = $matches['value']; - $recordedOffsets[$matches['name']] = $offset; - } - - if (preg_match(self::REGEX_REQUIRES_VERSION, $line, $matches)) { - $requires[$matches['name']] = [ - 'version' => $matches['version'], - 'operator' => $matches['operator'], - ]; - $recordedOffsets[$matches['name']] = $offset; - } - - if (preg_match(self::REGEX_REQUIRES_VERSION_CONSTRAINT, $line, $matches)) { - if (!empty($requires[$matches['name']])) { - $offset++; - - continue; - } - - try { - $versionConstraintParser = new VersionConstraintParser; - - $requires[$matches['name'] . '_constraint'] = [ - 'constraint' => $versionConstraintParser->parse(trim($matches['constraint'])), - ]; - $recordedOffsets[$matches['name'] . '_constraint'] = $offset; - } catch (\PharIo\Version\Exception $e) { - /* @TODO this catch is currently not valid, see https://github.com/phar-io/version/issues/16 */ - throw new Warning($e->getMessage(), $e->getCode(), $e); - } - } - - if (preg_match(self::REGEX_REQUIRES_SETTING, $line, $matches)) { - $recordedSettings[$matches['setting']] = $matches['value']; - $recordedOffsets['__SETTING_' . $matches['setting']] = $offset; - } - - if (preg_match(self::REGEX_REQUIRES, $line, $matches)) { - $name = $matches['name'] . 's'; - - if (!isset($requires[$name])) { - $requires[$name] = []; - } - - $requires[$name][] = $matches['value']; - $recordedOffsets[$matches['name'] . '_' . $matches['value']] = $offset; - - if ($name === 'extensions' && !empty($matches['version'])) { - $extensionVersions[$matches['value']] = [ - 'version' => $matches['version'], - 'operator' => $matches['operator'], - ]; - } - } - - $offset++; - } - - return $this->parsedRequirements = array_merge( - $requires, - ['__OFFSET' => $recordedOffsets], - array_filter([ - 'setting' => $recordedSettings, - 'extension_versions' => $extensionVersions, - ]) - ); - } - - /** - * @return array|bool - * - * @psalm-return false|array{ - * class: class-string, - * code: int|string|null, - * message: string, - * message_regex: string - * } - */ - public function expectedException() - { - $docComment = (string) substr($this->docComment, 3, -2); - - if (1 !== preg_match(self::REGEX_EXPECTED_EXCEPTION, $docComment, $matches)) { - return false; - } - - /** @psalm-var class-string $class */ - $class = $matches[1]; - $annotations = $this->symbolAnnotations(); - $code = null; - $message = ''; - $messageRegExp = ''; - - if (isset($matches[2])) { - $message = trim($matches[2]); - } elseif (isset($annotations['expectedExceptionMessage'])) { - $message = $this->parseAnnotationContent($annotations['expectedExceptionMessage'][0]); - } - - if (isset($annotations['expectedExceptionMessageRegExp'])) { - $messageRegExp = $this->parseAnnotationContent($annotations['expectedExceptionMessageRegExp'][0]); - } - - if (isset($matches[3])) { - $code = $matches[3]; - } elseif (isset($annotations['expectedExceptionCode'])) { - $code = $this->parseAnnotationContent($annotations['expectedExceptionCode'][0]); - } - - if (is_numeric($code)) { - $code = (int) $code; - } elseif (is_string($code) && defined($code)) { - $code = (int) constant($code); - } - - return [ - 'class' => $class, - 'code' => $code, - 'message' => $message, - 'message_regex' => $messageRegExp, - ]; - } - - /** - * Returns the provided data for a method. - * - * @throws Exception - */ - public function getProvidedData(): ?array - { - /** @noinspection SuspiciousBinaryOperationInspection */ - $data = $this->getDataFromDataProviderAnnotation($this->docComment) ?? $this->getDataFromTestWithAnnotation($this->docComment); - - if ($data === null) { - return null; - } - - if ($data === []) { - throw new SkippedTestError; - } - - foreach ($data as $key => $value) { - if (!is_array($value)) { - throw new InvalidDataSetException( - sprintf( - 'Data set %s is invalid.', - is_int($key) ? '#' . $key : '"' . $key . '"' - ) - ); - } - } - - return $data; - } - - /** - * @psalm-return array - */ - public function getInlineAnnotations(): array - { - $code = file($this->fileName); - $lineNumber = $this->startLine; - $startLine = $this->startLine - 1; - $endLine = $this->endLine - 1; - $codeLines = array_slice($code, $startLine, $endLine - $startLine + 1); - $annotations = []; - - foreach ($codeLines as $line) { - if (preg_match('#/\*\*?\s*@(?P[A-Za-z_-]+)(?:[ \t]+(?P.*?))?[ \t]*\r?\*/$#m', $line, $matches)) { - $annotations[strtolower($matches['name'])] = [ - 'line' => $lineNumber, - 'value' => $matches['value'], - ]; - } - - $lineNumber++; - } - - return $annotations; - } - - public function symbolAnnotations(): array - { - return $this->symbolAnnotations; - } - - public function isHookToBeExecutedBeforeClass(): bool - { - return $this->isMethod && - false !== strpos($this->docComment, '@beforeClass'); - } - - public function isHookToBeExecutedAfterClass(): bool - { - return $this->isMethod && - false !== strpos($this->docComment, '@afterClass'); - } - - public function isToBeExecutedBeforeTest(): bool - { - return 1 === preg_match('/@before\b/', $this->docComment); - } - - public function isToBeExecutedAfterTest(): bool - { - return 1 === preg_match('/@after\b/', $this->docComment); - } - - /** - * Parse annotation content to use constant/class constant values. - * - * Constants are specified using a starting '@'. For example: @ClassName::CONST_NAME - * - * If the constant is not found the string is used as is to ensure maximum BC. - */ - private function parseAnnotationContent(string $message): string - { - if (defined($message) && - (strpos($message, '::') !== false && substr_count($message, '::') + 1 === 2)) { - return constant($message); - } - - return $message; - } - - private function getDataFromDataProviderAnnotation(string $docComment): ?array - { - $methodName = null; - $className = $this->className; - - if ($this->isMethod) { - $methodName = $this->name; - } - - if (!preg_match_all(self::REGEX_DATA_PROVIDER, $docComment, $matches)) { - return null; - } - - $result = []; - - foreach ($matches[1] as $match) { - $dataProviderMethodNameNamespace = explode('\\', $match); - $leaf = explode('::', array_pop($dataProviderMethodNameNamespace)); - $dataProviderMethodName = array_pop($leaf); - - if (empty($dataProviderMethodNameNamespace)) { - $dataProviderMethodNameNamespace = ''; - } else { - $dataProviderMethodNameNamespace = implode('\\', $dataProviderMethodNameNamespace) . '\\'; - } - - if (empty($leaf)) { - $dataProviderClassName = $className; - } else { - /** @psalm-var class-string $dataProviderClassName */ - $dataProviderClassName = $dataProviderMethodNameNamespace . array_pop($leaf); - } - - try { - $dataProviderClass = new ReflectionClass($dataProviderClassName); - - $dataProviderMethod = $dataProviderClass->getMethod( - $dataProviderMethodName - ); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - // @codeCoverageIgnoreEnd - } - - if ($dataProviderMethod->isStatic()) { - $object = null; - } else { - $object = $dataProviderClass->newInstance(); - } - - if ($dataProviderMethod->getNumberOfParameters() === 0) { - $data = $dataProviderMethod->invoke($object); - } else { - $data = $dataProviderMethod->invoke($object, $methodName); - } - - if ($data instanceof Traversable) { - $origData = $data; - $data = []; - - foreach ($origData as $key => $value) { - if (is_int($key)) { - $data[] = $value; - } elseif (array_key_exists($key, $data)) { - throw new InvalidDataProviderException( - sprintf( - 'The key "%s" has already been defined in the data provider "%s".', - $key, - $match - ) - ); - } else { - $data[$key] = $value; - } - } - } - - if (is_array($data)) { - $result = array_merge($result, $data); - } - } - - return $result; - } - - /** - * @throws Exception - */ - private function getDataFromTestWithAnnotation(string $docComment): ?array - { - $docComment = $this->cleanUpMultiLineAnnotation($docComment); - - if (!preg_match(self::REGEX_TEST_WITH, $docComment, $matches, PREG_OFFSET_CAPTURE)) { - return null; - } - - $offset = strlen($matches[0][0]) + $matches[0][1]; - $annotationContent = substr($docComment, $offset); - $data = []; - - foreach (explode("\n", $annotationContent) as $candidateRow) { - $candidateRow = trim($candidateRow); - - if ($candidateRow[0] !== '[') { - break; - } - - $dataSet = json_decode($candidateRow, true); - - if (json_last_error() !== JSON_ERROR_NONE) { - throw new Exception( - 'The data set for the @testWith annotation cannot be parsed: ' . json_last_error_msg() - ); - } - - $data[] = $dataSet; - } - - if (!$data) { - throw new Exception('The data set for the @testWith annotation cannot be parsed.'); - } - - return $data; - } - - private function cleanUpMultiLineAnnotation(string $docComment): string - { - //removing initial ' * ' for docComment - $docComment = str_replace("\r\n", "\n", $docComment); - $docComment = preg_replace('/' . '\n' . '\s*' . '\*' . '\s?' . '/', "\n", $docComment); - $docComment = (string) substr($docComment, 0, -1); - - return rtrim($docComment, "\n"); - } - - /** @return array> */ - private static function parseDocBlock(string $docBlock): array - { - // Strip away the docblock header and footer to ease parsing of one line annotations - $docBlock = (string) substr($docBlock, 3, -2); - $annotations = []; - - if (preg_match_all('/@(?P[A-Za-z_-]+)(?:[ \t]+(?P.*?))?[ \t]*\r?$/m', $docBlock, $matches)) { - $numMatches = count($matches[0]); - - for ($i = 0; $i < $numMatches; $i++) { - $annotations[$matches['name'][$i]][] = (string) $matches['value'][$i]; - } - } - - return $annotations; - } - - /** @param ReflectionClass|ReflectionFunctionAbstract $reflector */ - private static function extractAnnotationsFromReflector(Reflector $reflector): array - { - $annotations = []; - - if ($reflector instanceof ReflectionClass) { - $annotations = array_merge( - $annotations, - ...array_map( - static function (ReflectionClass $trait): array - { - return self::parseDocBlock((string) $trait->getDocComment()); - }, - array_values($reflector->getTraits()) - ) - ); - } - - return array_merge( - $annotations, - self::parseDocBlock((string) $reflector->getDocComment()) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Annotation/Registry.php b/vendor/phpunit/phpunit/src/Util/Annotation/Registry.php deleted file mode 100644 index 8df14cf..0000000 --- a/vendor/phpunit/phpunit/src/Util/Annotation/Registry.php +++ /dev/null @@ -1,93 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util\Annotation; - -use function array_key_exists; -use PHPUnit\Util\Exception; -use ReflectionClass; -use ReflectionException; -use ReflectionMethod; - -/** - * Reflection information, and therefore DocBlock information, is static within - * a single PHP process. It is therefore okay to use a Singleton registry here. - * - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Registry -{ - /** @var null|self */ - private static $instance; - - /** @var array indexed by class name */ - private $classDocBlocks = []; - - /** @var array> indexed by class name and method name */ - private $methodDocBlocks = []; - - public static function getInstance(): self - { - return self::$instance ?? self::$instance = new self; - } - - private function __construct() - { - } - - /** - * @throws Exception - * @psalm-param class-string $class - */ - public function forClassName(string $class): DocBlock - { - if (array_key_exists($class, $this->classDocBlocks)) { - return $this->classDocBlocks[$class]; - } - - try { - $reflection = new ReflectionClass($class); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - return $this->classDocBlocks[$class] = DocBlock::ofClass($reflection); - } - - /** - * @throws Exception - * @psalm-param class-string $classInHierarchy - */ - public function forMethod(string $classInHierarchy, string $method): DocBlock - { - if (isset($this->methodDocBlocks[$classInHierarchy][$method])) { - return $this->methodDocBlocks[$classInHierarchy][$method]; - } - - try { - $reflection = new ReflectionMethod($classInHierarchy, $method); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - return $this->methodDocBlocks[$classInHierarchy][$method] = DocBlock::ofMethod($reflection, $classInHierarchy); - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Blacklist.php b/vendor/phpunit/phpunit/src/Util/Blacklist.php deleted file mode 100644 index dd89dcd..0000000 --- a/vendor/phpunit/phpunit/src/Util/Blacklist.php +++ /dev/null @@ -1,224 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util; - -use const DIRECTORY_SEPARATOR; -use function class_exists; -use function defined; -use function dirname; -use function strpos; -use function sys_get_temp_dir; -use Composer\Autoload\ClassLoader; -use DeepCopy\DeepCopy; -use Doctrine\Instantiator\Instantiator; -use PharIo\Manifest\Manifest; -use PharIo\Version\Version as PharIoVersion; -use PHP_Token; -use phpDocumentor\Reflection\DocBlock; -use phpDocumentor\Reflection\Project; -use phpDocumentor\Reflection\Type; -use PHPUnit\Framework\TestCase; -use Prophecy\Prophet; -use ReflectionClass; -use ReflectionException; -use SebastianBergmann\CodeCoverage\CodeCoverage; -use SebastianBergmann\CodeUnitReverseLookup\Wizard; -use SebastianBergmann\Comparator\Comparator; -use SebastianBergmann\Diff\Diff; -use SebastianBergmann\Environment\Runtime; -use SebastianBergmann\Exporter\Exporter; -use SebastianBergmann\FileIterator\Facade as FileIteratorFacade; -use SebastianBergmann\GlobalState\Snapshot; -use SebastianBergmann\Invoker\Invoker; -use SebastianBergmann\ObjectEnumerator\Enumerator; -use SebastianBergmann\RecursionContext\Context; -use SebastianBergmann\ResourceOperations\ResourceOperations; -use SebastianBergmann\Timer\Timer; -use SebastianBergmann\Type\TypeName; -use SebastianBergmann\Version; -use Text_Template; -use TheSeer\Tokenizer\Tokenizer; -use Webmozart\Assert\Assert; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Blacklist -{ - /** - * @var array - */ - public static $blacklistedClassNames = [ - // composer - ClassLoader::class => 1, - - // doctrine/instantiator - Instantiator::class => 1, - - // myclabs/deepcopy - DeepCopy::class => 1, - - // phar-io/manifest - Manifest::class => 1, - - // phar-io/version - PharIoVersion::class => 1, - - // phpdocumentor/reflection-common - Project::class => 1, - - // phpdocumentor/reflection-docblock - DocBlock::class => 1, - - // phpdocumentor/type-resolver - Type::class => 1, - - // phpspec/prophecy - Prophet::class => 1, - - // phpunit/phpunit - TestCase::class => 2, - - // phpunit/php-code-coverage - CodeCoverage::class => 1, - - // phpunit/php-file-iterator - FileIteratorFacade::class => 1, - - // phpunit/php-invoker - Invoker::class => 1, - - // phpunit/php-text-template - Text_Template::class => 1, - - // phpunit/php-timer - Timer::class => 1, - - // phpunit/php-token-stream - PHP_Token::class => 1, - - // sebastian/code-unit-reverse-lookup - Wizard::class => 1, - - // sebastian/comparator - Comparator::class => 1, - - // sebastian/diff - Diff::class => 1, - - // sebastian/environment - Runtime::class => 1, - - // sebastian/exporter - Exporter::class => 1, - - // sebastian/global-state - Snapshot::class => 1, - - // sebastian/object-enumerator - Enumerator::class => 1, - - // sebastian/recursion-context - Context::class => 1, - - // sebastian/resource-operations - ResourceOperations::class => 1, - - // sebastian/type - TypeName::class => 1, - - // sebastian/version - Version::class => 1, - - // theseer/tokenizer - Tokenizer::class => 1, - - // webmozart/assert - Assert::class => 1, - ]; - - /** - * @var string[] - */ - private static $directories; - - /** - * @throws Exception - * - * @return string[] - */ - public function getBlacklistedDirectories(): array - { - $this->initialize(); - - return self::$directories; - } - - /** - * @throws Exception - */ - public function isBlacklisted(string $file): bool - { - if (defined('PHPUNIT_TESTSUITE')) { - return false; - } - - $this->initialize(); - - foreach (self::$directories as $directory) { - if (strpos($file, $directory) === 0) { - return true; - } - } - - return false; - } - - /** - * @throws Exception - */ - private function initialize(): void - { - if (self::$directories === null) { - self::$directories = []; - - foreach (self::$blacklistedClassNames as $className => $parent) { - if (!class_exists($className)) { - continue; - } - - try { - $directory = (new ReflectionClass($className))->getFileName(); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - for ($i = 0; $i < $parent; $i++) { - $directory = dirname($directory); - } - - self::$directories[] = $directory; - } - - // Hide process isolation workaround on Windows. - if (DIRECTORY_SEPARATOR === '\\') { - // tempnam() prefix is limited to first 3 chars. - // @see https://php.net/manual/en/function.tempnam.php - self::$directories[] = sys_get_temp_dir() . '\\PHP'; - } - } - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Color.php b/vendor/phpunit/phpunit/src/Util/Color.php deleted file mode 100644 index b96eb47..0000000 --- a/vendor/phpunit/phpunit/src/Util/Color.php +++ /dev/null @@ -1,159 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util; - -use const DIRECTORY_SEPARATOR; -use function array_keys; -use function array_map; -use function array_values; -use function count; -use function explode; -use function implode; -use function min; -use function preg_replace; -use function preg_replace_callback; -use function sprintf; -use function strtr; -use function trim; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Color -{ - /** - * @var array - */ - private const WHITESPACE_MAP = [ - ' ' => '·', - "\t" => '⇥', - ]; - - /** - * @var array - */ - private const WHITESPACE_EOL_MAP = [ - ' ' => '·', - "\t" => '⇥', - "\n" => '↵', - "\r" => '⟵', - ]; - - /** - * @var array - */ - private static $ansiCodes = [ - 'reset' => '0', - 'bold' => '1', - 'dim' => '2', - 'dim-reset' => '22', - 'underlined' => '4', - 'fg-default' => '39', - 'fg-black' => '30', - 'fg-red' => '31', - 'fg-green' => '32', - 'fg-yellow' => '33', - 'fg-blue' => '34', - 'fg-magenta' => '35', - 'fg-cyan' => '36', - 'fg-white' => '37', - 'bg-default' => '49', - 'bg-black' => '40', - 'bg-red' => '41', - 'bg-green' => '42', - 'bg-yellow' => '43', - 'bg-blue' => '44', - 'bg-magenta' => '45', - 'bg-cyan' => '46', - 'bg-white' => '47', - ]; - - public static function colorize(string $color, string $buffer): string - { - if (trim($buffer) === '') { - return $buffer; - } - - $codes = array_map('\trim', explode(',', $color)); - $styles = []; - - foreach ($codes as $code) { - if (isset(self::$ansiCodes[$code])) { - $styles[] = self::$ansiCodes[$code] ?? ''; - } - } - - if (empty($styles)) { - return $buffer; - } - - return self::optimizeColor(sprintf("\x1b[%sm", implode(';', $styles)) . $buffer . "\x1b[0m"); - } - - public static function colorizePath(string $path, ?string $prevPath = null, bool $colorizeFilename = false): string - { - if ($prevPath === null) { - $prevPath = ''; - } - - $path = explode(DIRECTORY_SEPARATOR, $path); - $prevPath = explode(DIRECTORY_SEPARATOR, $prevPath); - - for ($i = 0; $i < min(count($path), count($prevPath)); $i++) { - if ($path[$i] == $prevPath[$i]) { - $path[$i] = self::dim($path[$i]); - } - } - - if ($colorizeFilename) { - $last = count($path) - 1; - $path[$last] = preg_replace_callback( - '/([\-_\.]+|phpt$)/', - static function ($matches) - { - return self::dim($matches[0]); - }, - $path[$last] - ); - } - - return self::optimizeColor(implode(self::dim(DIRECTORY_SEPARATOR), $path)); - } - - public static function dim(string $buffer): string - { - if (trim($buffer) === '') { - return $buffer; - } - - return "\e[2m{$buffer}\e[22m"; - } - - public static function visualizeWhitespace(string $buffer, bool $visualizeEOL = false): string - { - $replaceMap = $visualizeEOL ? self::WHITESPACE_EOL_MAP : self::WHITESPACE_MAP; - - return preg_replace_callback('/\s+/', static function ($matches) use ($replaceMap) - { - return self::dim(strtr($matches[0], $replaceMap)); - }, $buffer); - } - - private static function optimizeColor(string $buffer): string - { - $patterns = [ - "/\e\\[22m\e\\[2m/" => '', - "/\e\\[([^m]*)m\e\\[([1-9][0-9;]*)m/" => "\e[$1;$2m", - "/(\e\\[[^m]*m)+(\e\\[0m)/" => '$2', - ]; - - return preg_replace(array_keys($patterns), array_values($patterns), $buffer); - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Configuration.php b/vendor/phpunit/phpunit/src/Util/Configuration.php deleted file mode 100644 index 1cb5f77..0000000 --- a/vendor/phpunit/phpunit/src/Util/Configuration.php +++ /dev/null @@ -1,1231 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util; - -use const DIRECTORY_SEPARATOR; -use const PATH_SEPARATOR; -use const PHP_VERSION; -use function assert; -use function constant; -use function count; -use function define; -use function defined; -use function dirname; -use function explode; -use function file_exists; -use function file_get_contents; -use function getenv; -use function implode; -use function in_array; -use function ini_get; -use function ini_set; -use function is_numeric; -use function libxml_clear_errors; -use function libxml_get_errors; -use function libxml_use_internal_errors; -use function preg_match; -use function putenv; -use function realpath; -use function sprintf; -use function stream_resolve_include_path; -use function strlen; -use function strpos; -use function strtolower; -use function strtoupper; -use function substr; -use function trim; -use function version_compare; -use DOMDocument; -use DOMElement; -use DOMNodeList; -use DOMXPath; -use LibXMLError; -use PHPUnit\Framework\Exception; -use PHPUnit\Framework\TestSuite; -use PHPUnit\Runner\TestSuiteSorter; -use PHPUnit\TextUI\ResultPrinter; -use PHPUnit\Util\TestDox\CliTestDoxPrinter; -use SebastianBergmann\FileIterator\Facade as FileIteratorFacade; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Configuration -{ - /** - * @var self[] - */ - private static $instances = []; - - /** - * @var DOMDocument - */ - private $document; - - /** - * @var DOMXPath - */ - private $xpath; - - /** - * @var string - */ - private $filename; - - /** - * @var LibXMLError[] - */ - private $errors = []; - - /** - * Returns a PHPUnit configuration object. - * - * @throws Exception - */ - public static function getInstance(string $filename): self - { - $realPath = realpath($filename); - - if ($realPath === false) { - throw new Exception( - sprintf( - 'Could not read "%s".', - $filename - ) - ); - } - - if (!isset(self::$instances[$realPath])) { - self::$instances[$realPath] = new self($realPath); - } - - return self::$instances[$realPath]; - } - - /** - * Loads a PHPUnit configuration file. - * - * @throws Exception - */ - private function __construct(string $filename) - { - $this->filename = $filename; - $this->document = Xml::loadFile($filename, false, true, true); - $this->xpath = new DOMXPath($this->document); - - $this->validateConfigurationAgainstSchema(); - } - - /** - * @codeCoverageIgnore - */ - private function __clone() - { - } - - public function hasValidationErrors(): bool - { - return count($this->errors) > 0; - } - - public function getValidationErrors(): array - { - $result = []; - - foreach ($this->errors as $error) { - if (!isset($result[$error->line])) { - $result[$error->line] = []; - } - $result[$error->line][] = trim($error->message); - } - - return $result; - } - - /** - * Returns the real path to the configuration file. - */ - public function getFilename(): string - { - return $this->filename; - } - - public function getExtensionConfiguration(): array - { - $result = []; - - foreach ($this->xpath->query('extensions/extension') as $extension) { - $result[] = $this->getElementConfigurationParameters($extension); - } - - return $result; - } - - /** - * Returns the configuration for SUT filtering. - */ - public function getFilterConfiguration(): array - { - $addUncoveredFilesFromWhitelist = true; - $processUncoveredFilesFromWhitelist = false; - $includeDirectory = []; - $includeFile = []; - $excludeDirectory = []; - $excludeFile = []; - - $tmp = $this->xpath->query('filter/whitelist'); - - if ($tmp->length === 1) { - if ($tmp->item(0)->hasAttribute('addUncoveredFilesFromWhitelist')) { - $addUncoveredFilesFromWhitelist = $this->getBoolean( - (string) $tmp->item(0)->getAttribute( - 'addUncoveredFilesFromWhitelist' - ), - true - ); - } - - if ($tmp->item(0)->hasAttribute('processUncoveredFilesFromWhitelist')) { - $processUncoveredFilesFromWhitelist = $this->getBoolean( - (string) $tmp->item(0)->getAttribute( - 'processUncoveredFilesFromWhitelist' - ), - false - ); - } - - $includeDirectory = $this->readFilterDirectories( - 'filter/whitelist/directory' - ); - - $includeFile = $this->readFilterFiles( - 'filter/whitelist/file' - ); - - $excludeDirectory = $this->readFilterDirectories( - 'filter/whitelist/exclude/directory' - ); - - $excludeFile = $this->readFilterFiles( - 'filter/whitelist/exclude/file' - ); - } - - return [ - 'whitelist' => [ - 'addUncoveredFilesFromWhitelist' => $addUncoveredFilesFromWhitelist, - 'processUncoveredFilesFromWhitelist' => $processUncoveredFilesFromWhitelist, - 'include' => [ - 'directory' => $includeDirectory, - 'file' => $includeFile, - ], - 'exclude' => [ - 'directory' => $excludeDirectory, - 'file' => $excludeFile, - ], - ], - ]; - } - - /** - * Returns the configuration for groups. - */ - public function getGroupConfiguration(): array - { - return $this->parseGroupConfiguration('groups'); - } - - /** - * Returns the configuration for testdox groups. - */ - public function getTestdoxGroupConfiguration(): array - { - return $this->parseGroupConfiguration('testdoxGroups'); - } - - /** - * Returns the configuration for listeners. - */ - public function getListenerConfiguration(): array - { - $result = []; - - foreach ($this->xpath->query('listeners/listener') as $listener) { - $result[] = $this->getElementConfigurationParameters($listener); - } - - return $result; - } - - /** - * Returns the logging configuration. - */ - public function getLoggingConfiguration(): array - { - $result = []; - - foreach ($this->xpath->query('logging/log') as $log) { - assert($log instanceof DOMElement); - - $type = (string) $log->getAttribute('type'); - $target = (string) $log->getAttribute('target'); - - if (!$target) { - continue; - } - - $target = $this->toAbsolutePath($target); - - if ($type === 'coverage-html') { - if ($log->hasAttribute('lowUpperBound')) { - $result['lowUpperBound'] = $this->getInteger( - (string) $log->getAttribute('lowUpperBound'), - 50 - ); - } - - if ($log->hasAttribute('highLowerBound')) { - $result['highLowerBound'] = $this->getInteger( - (string) $log->getAttribute('highLowerBound'), - 90 - ); - } - } elseif ($type === 'coverage-crap4j') { - if ($log->hasAttribute('threshold')) { - $result['crap4jThreshold'] = $this->getInteger( - (string) $log->getAttribute('threshold'), - 30 - ); - } - } elseif ($type === 'coverage-text') { - if ($log->hasAttribute('showUncoveredFiles')) { - $result['coverageTextShowUncoveredFiles'] = $this->getBoolean( - (string) $log->getAttribute('showUncoveredFiles'), - false - ); - } - - if ($log->hasAttribute('showOnlySummary')) { - $result['coverageTextShowOnlySummary'] = $this->getBoolean( - (string) $log->getAttribute('showOnlySummary'), - false - ); - } - } - - $result[$type] = $target; - } - - return $result; - } - - /** - * Returns the PHP configuration. - */ - public function getPHPConfiguration(): array - { - $result = [ - 'include_path' => [], - 'ini' => [], - 'const' => [], - 'var' => [], - 'env' => [], - 'post' => [], - 'get' => [], - 'cookie' => [], - 'server' => [], - 'files' => [], - 'request' => [], - ]; - - foreach ($this->xpath->query('php/includePath') as $includePath) { - $path = (string) $includePath->textContent; - - if ($path) { - $result['include_path'][] = $this->toAbsolutePath($path); - } - } - - foreach ($this->xpath->query('php/ini') as $ini) { - assert($ini instanceof DOMElement); - - $name = (string) $ini->getAttribute('name'); - $value = (string) $ini->getAttribute('value'); - - $result['ini'][$name]['value'] = $value; - } - - foreach ($this->xpath->query('php/const') as $const) { - assert($const instanceof DOMElement); - - $name = (string) $const->getAttribute('name'); - $value = (string) $const->getAttribute('value'); - - $result['const'][$name]['value'] = $this->getBoolean($value, $value); - } - - foreach (['var', 'env', 'post', 'get', 'cookie', 'server', 'files', 'request'] as $array) { - foreach ($this->xpath->query('php/' . $array) as $var) { - assert($var instanceof DOMElement); - - $name = (string) $var->getAttribute('name'); - $value = (string) $var->getAttribute('value'); - $verbatim = false; - - if ($var->hasAttribute('verbatim')) { - $verbatim = $this->getBoolean($var->getAttribute('verbatim'), false); - $result[$array][$name]['verbatim'] = $verbatim; - } - - if ($var->hasAttribute('force')) { - $force = $this->getBoolean($var->getAttribute('force'), false); - $result[$array][$name]['force'] = $force; - } - - if (!$verbatim) { - $value = $this->getBoolean($value, $value); - } - - $result[$array][$name]['value'] = $value; - } - } - - return $result; - } - - /** - * Handles the PHP configuration. - */ - public function handlePHPConfiguration(): void - { - $configuration = $this->getPHPConfiguration(); - - if (!empty($configuration['include_path'])) { - ini_set( - 'include_path', - implode(PATH_SEPARATOR, $configuration['include_path']) . - PATH_SEPARATOR . - ini_get('include_path') - ); - } - - foreach ($configuration['ini'] as $name => $data) { - $value = $data['value']; - - if (defined($value)) { - $value = (string) constant($value); - } - - ini_set($name, $value); - } - - foreach ($configuration['const'] as $name => $data) { - $value = $data['value']; - - if (!defined($name)) { - define($name, $value); - } - } - - foreach ($configuration['var'] as $name => $data) { - $GLOBALS[$name] = $data['value']; - } - - foreach ($configuration['server'] as $name => $data) { - $_SERVER[$name] = $data['value']; - } - - foreach (['post', 'get', 'cookie', 'files', 'request'] as $array) { - $target = &$GLOBALS['_' . strtoupper($array)]; - - foreach ($configuration[$array] as $name => $data) { - $target[$name] = $data['value']; - } - } - - foreach ($configuration['env'] as $name => $data) { - $value = $data['value']; - $force = $data['force'] ?? false; - - if ($force || getenv($name) === false) { - putenv("{$name}={$value}"); - } - - $value = getenv($name); - - if (!isset($_ENV[$name])) { - $_ENV[$name] = $value; - } - - if ($force) { - $_ENV[$name] = $value; - } - } - } - - /** - * Returns the PHPUnit configuration. - */ - public function getPHPUnitConfiguration(): array - { - $result = []; - $root = $this->document->documentElement; - - if ($root->hasAttribute('cacheTokens')) { - $result['cacheTokens'] = $this->getBoolean( - (string) $root->getAttribute('cacheTokens'), - false - ); - } - - if ($root->hasAttribute('columns')) { - $columns = (string) $root->getAttribute('columns'); - - if ($columns === 'max') { - $result['columns'] = 'max'; - } else { - $result['columns'] = $this->getInteger($columns, 80); - } - } - - if ($root->hasAttribute('colors')) { - /* only allow boolean for compatibility with previous versions - 'always' only allowed from command line */ - if ($this->getBoolean($root->getAttribute('colors'), false)) { - $result['colors'] = ResultPrinter::COLOR_AUTO; - } else { - $result['colors'] = ResultPrinter::COLOR_NEVER; - } - } - - /* - * @see https://github.com/sebastianbergmann/phpunit/issues/657 - */ - if ($root->hasAttribute('stderr')) { - $result['stderr'] = $this->getBoolean( - (string) $root->getAttribute('stderr'), - false - ); - } - - if ($root->hasAttribute('backupGlobals')) { - $result['backupGlobals'] = $this->getBoolean( - (string) $root->getAttribute('backupGlobals'), - false - ); - } - - if ($root->hasAttribute('backupStaticAttributes')) { - $result['backupStaticAttributes'] = $this->getBoolean( - (string) $root->getAttribute('backupStaticAttributes'), - false - ); - } - - if ($root->getAttribute('bootstrap')) { - $result['bootstrap'] = $this->toAbsolutePath( - (string) $root->getAttribute('bootstrap') - ); - } - - if ($root->hasAttribute('convertDeprecationsToExceptions')) { - $result['convertDeprecationsToExceptions'] = $this->getBoolean( - (string) $root->getAttribute('convertDeprecationsToExceptions'), - false - ); - } - - if ($root->hasAttribute('convertErrorsToExceptions')) { - $result['convertErrorsToExceptions'] = $this->getBoolean( - (string) $root->getAttribute('convertErrorsToExceptions'), - true - ); - } - - if ($root->hasAttribute('convertNoticesToExceptions')) { - $result['convertNoticesToExceptions'] = $this->getBoolean( - (string) $root->getAttribute('convertNoticesToExceptions'), - true - ); - } - - if ($root->hasAttribute('convertWarningsToExceptions')) { - $result['convertWarningsToExceptions'] = $this->getBoolean( - (string) $root->getAttribute('convertWarningsToExceptions'), - true - ); - } - - if ($root->hasAttribute('forceCoversAnnotation')) { - $result['forceCoversAnnotation'] = $this->getBoolean( - (string) $root->getAttribute('forceCoversAnnotation'), - false - ); - } - - if ($root->hasAttribute('disableCodeCoverageIgnore')) { - $result['disableCodeCoverageIgnore'] = $this->getBoolean( - (string) $root->getAttribute('disableCodeCoverageIgnore'), - false - ); - } - - if ($root->hasAttribute('processIsolation')) { - $result['processIsolation'] = $this->getBoolean( - (string) $root->getAttribute('processIsolation'), - false - ); - } - - if ($root->hasAttribute('stopOnDefect')) { - $result['stopOnDefect'] = $this->getBoolean( - (string) $root->getAttribute('stopOnDefect'), - false - ); - } - - if ($root->hasAttribute('stopOnError')) { - $result['stopOnError'] = $this->getBoolean( - (string) $root->getAttribute('stopOnError'), - false - ); - } - - if ($root->hasAttribute('stopOnFailure')) { - $result['stopOnFailure'] = $this->getBoolean( - (string) $root->getAttribute('stopOnFailure'), - false - ); - } - - if ($root->hasAttribute('stopOnWarning')) { - $result['stopOnWarning'] = $this->getBoolean( - (string) $root->getAttribute('stopOnWarning'), - false - ); - } - - if ($root->hasAttribute('stopOnIncomplete')) { - $result['stopOnIncomplete'] = $this->getBoolean( - (string) $root->getAttribute('stopOnIncomplete'), - false - ); - } - - if ($root->hasAttribute('stopOnRisky')) { - $result['stopOnRisky'] = $this->getBoolean( - (string) $root->getAttribute('stopOnRisky'), - false - ); - } - - if ($root->hasAttribute('stopOnSkipped')) { - $result['stopOnSkipped'] = $this->getBoolean( - (string) $root->getAttribute('stopOnSkipped'), - false - ); - } - - if ($root->hasAttribute('failOnWarning')) { - $result['failOnWarning'] = $this->getBoolean( - (string) $root->getAttribute('failOnWarning'), - false - ); - } - - if ($root->hasAttribute('failOnRisky')) { - $result['failOnRisky'] = $this->getBoolean( - (string) $root->getAttribute('failOnRisky'), - false - ); - } - - if ($root->hasAttribute('testSuiteLoaderClass')) { - $result['testSuiteLoaderClass'] = (string) $root->getAttribute( - 'testSuiteLoaderClass' - ); - } - - if ($root->hasAttribute('defaultTestSuite')) { - $result['defaultTestSuite'] = (string) $root->getAttribute( - 'defaultTestSuite' - ); - } - - if ($root->getAttribute('testSuiteLoaderFile')) { - $result['testSuiteLoaderFile'] = $this->toAbsolutePath( - (string) $root->getAttribute('testSuiteLoaderFile') - ); - } - - if ($root->hasAttribute('printerClass')) { - $result['printerClass'] = (string) $root->getAttribute( - 'printerClass' - ); - } - - if ($root->getAttribute('printerFile')) { - $result['printerFile'] = $this->toAbsolutePath( - (string) $root->getAttribute('printerFile') - ); - } - - if ($root->hasAttribute('beStrictAboutChangesToGlobalState')) { - $result['beStrictAboutChangesToGlobalState'] = $this->getBoolean( - (string) $root->getAttribute('beStrictAboutChangesToGlobalState'), - false - ); - } - - if ($root->hasAttribute('beStrictAboutOutputDuringTests')) { - $result['disallowTestOutput'] = $this->getBoolean( - (string) $root->getAttribute('beStrictAboutOutputDuringTests'), - false - ); - } - - if ($root->hasAttribute('beStrictAboutResourceUsageDuringSmallTests')) { - $result['beStrictAboutResourceUsageDuringSmallTests'] = $this->getBoolean( - (string) $root->getAttribute('beStrictAboutResourceUsageDuringSmallTests'), - false - ); - } - - if ($root->hasAttribute('beStrictAboutTestsThatDoNotTestAnything')) { - $result['reportUselessTests'] = $this->getBoolean( - (string) $root->getAttribute('beStrictAboutTestsThatDoNotTestAnything'), - true - ); - } - - if ($root->hasAttribute('beStrictAboutTodoAnnotatedTests')) { - $result['disallowTodoAnnotatedTests'] = $this->getBoolean( - (string) $root->getAttribute('beStrictAboutTodoAnnotatedTests'), - false - ); - } - - if ($root->hasAttribute('beStrictAboutCoversAnnotation')) { - $result['strictCoverage'] = $this->getBoolean( - (string) $root->getAttribute('beStrictAboutCoversAnnotation'), - false - ); - } - - if ($root->hasAttribute('defaultTimeLimit')) { - $result['defaultTimeLimit'] = $this->getInteger( - (string) $root->getAttribute('defaultTimeLimit'), - 1 - ); - } - - if ($root->hasAttribute('enforceTimeLimit')) { - $result['enforceTimeLimit'] = $this->getBoolean( - (string) $root->getAttribute('enforceTimeLimit'), - false - ); - } - - if ($root->hasAttribute('ignoreDeprecatedCodeUnitsFromCodeCoverage')) { - $result['ignoreDeprecatedCodeUnitsFromCodeCoverage'] = $this->getBoolean( - (string) $root->getAttribute('ignoreDeprecatedCodeUnitsFromCodeCoverage'), - false - ); - } - - if ($root->hasAttribute('timeoutForSmallTests')) { - $result['timeoutForSmallTests'] = $this->getInteger( - (string) $root->getAttribute('timeoutForSmallTests'), - 1 - ); - } - - if ($root->hasAttribute('timeoutForMediumTests')) { - $result['timeoutForMediumTests'] = $this->getInteger( - (string) $root->getAttribute('timeoutForMediumTests'), - 10 - ); - } - - if ($root->hasAttribute('timeoutForLargeTests')) { - $result['timeoutForLargeTests'] = $this->getInteger( - (string) $root->getAttribute('timeoutForLargeTests'), - 60 - ); - } - - if ($root->hasAttribute('reverseDefectList')) { - $result['reverseDefectList'] = $this->getBoolean( - (string) $root->getAttribute('reverseDefectList'), - false - ); - } - - if ($root->hasAttribute('verbose')) { - $result['verbose'] = $this->getBoolean( - (string) $root->getAttribute('verbose'), - false - ); - } - - if ($root->hasAttribute('testdox')) { - $testdox = $this->getBoolean( - (string) $root->getAttribute('testdox'), - false - ); - - if ($testdox) { - if (isset($result['printerClass'])) { - $result['conflictBetweenPrinterClassAndTestdox'] = true; - } else { - $result['printerClass'] = CliTestDoxPrinter::class; - } - } - } - - if ($root->hasAttribute('registerMockObjectsFromTestArgumentsRecursively')) { - $result['registerMockObjectsFromTestArgumentsRecursively'] = $this->getBoolean( - (string) $root->getAttribute('registerMockObjectsFromTestArgumentsRecursively'), - false - ); - } - - if ($root->hasAttribute('extensionsDirectory')) { - $result['extensionsDirectory'] = $this->toAbsolutePath( - (string) $root->getAttribute( - 'extensionsDirectory' - ) - ); - } - - if ($root->hasAttribute('cacheResult')) { - $result['cacheResult'] = $this->getBoolean( - (string) $root->getAttribute('cacheResult'), - true - ); - } - - if ($root->hasAttribute('cacheResultFile')) { - $result['cacheResultFile'] = $this->toAbsolutePath( - (string) $root->getAttribute('cacheResultFile') - ); - } - - if ($root->hasAttribute('executionOrder')) { - foreach (explode(',', $root->getAttribute('executionOrder')) as $order) { - switch ($order) { - case 'default': - $result['executionOrder'] = TestSuiteSorter::ORDER_DEFAULT; - $result['executionOrderDefects'] = TestSuiteSorter::ORDER_DEFAULT; - $result['resolveDependencies'] = false; - - break; - - case 'defects': - $result['executionOrderDefects'] = TestSuiteSorter::ORDER_DEFECTS_FIRST; - - break; - - case 'depends': - $result['resolveDependencies'] = true; - - break; - - case 'duration': - $result['executionOrder'] = TestSuiteSorter::ORDER_DURATION; - - break; - - case 'no-depends': - $result['resolveDependencies'] = false; - - break; - - case 'random': - $result['executionOrder'] = TestSuiteSorter::ORDER_RANDOMIZED; - - break; - - case 'reverse': - $result['executionOrder'] = TestSuiteSorter::ORDER_REVERSED; - - break; - - case 'size': - $result['executionOrder'] = TestSuiteSorter::ORDER_SIZE; - - break; - } - } - } - - if ($root->hasAttribute('resolveDependencies')) { - $result['resolveDependencies'] = $this->getBoolean( - (string) $root->getAttribute('resolveDependencies'), - false - ); - } - - if ($root->hasAttribute('noInteraction')) { - $result['noInteraction'] = $this->getBoolean( - (string) $root->getAttribute('noInteraction'), - false - ); - } - - return $result; - } - - /** - * Returns the test suite configuration. - * - * @throws Exception - */ - public function getTestSuiteConfiguration(string $testSuiteFilter = ''): TestSuite - { - $testSuiteNodes = $this->xpath->query('testsuites/testsuite'); - - if ($testSuiteNodes->length === 0) { - $testSuiteNodes = $this->xpath->query('testsuite'); - } - - if ($testSuiteNodes->length === 1) { - return $this->getTestSuite($testSuiteNodes->item(0), $testSuiteFilter); - } - - $suite = new TestSuite; - - foreach ($testSuiteNodes as $testSuiteNode) { - $suite->addTestSuite( - $this->getTestSuite($testSuiteNode, $testSuiteFilter) - ); - } - - return $suite; - } - - /** - * Returns the test suite names from the configuration. - */ - public function getTestSuiteNames(): array - { - $names = []; - - foreach ($this->xpath->query('*/testsuite') as $node) { - /* @var DOMElement $node */ - $names[] = $node->getAttribute('name'); - } - - return $names; - } - - private function validateConfigurationAgainstSchema(): void - { - $original = libxml_use_internal_errors(true); - $xsdFilename = __DIR__ . '/../../phpunit.xsd'; - - if (defined('__PHPUNIT_PHAR_ROOT__')) { - $xsdFilename = __PHPUNIT_PHAR_ROOT__ . '/phpunit.xsd'; - } - - $this->document->schemaValidateSource(file_get_contents($xsdFilename)); - $this->errors = libxml_get_errors(); - libxml_clear_errors(); - libxml_use_internal_errors($original); - } - - /** - * Collects and returns the configuration arguments from the PHPUnit - * XML configuration. - */ - private function getConfigurationArguments(DOMNodeList $nodes): array - { - $arguments = []; - - if ($nodes->length === 0) { - return $arguments; - } - - foreach ($nodes as $node) { - if (!$node instanceof DOMElement) { - continue; - } - - if ($node->tagName !== 'arguments') { - continue; - } - - foreach ($node->childNodes as $argument) { - if (!$argument instanceof DOMElement) { - continue; - } - - if ($argument->tagName === 'file' || $argument->tagName === 'directory') { - $arguments[] = $this->toAbsolutePath((string) $argument->textContent); - } else { - $arguments[] = Xml::xmlToVariable($argument); - } - } - } - - return $arguments; - } - - /** - * @throws \PHPUnit\Framework\Exception - */ - private function getTestSuite(DOMElement $testSuiteNode, string $testSuiteFilter = ''): TestSuite - { - if ($testSuiteNode->hasAttribute('name')) { - $suite = new TestSuite( - (string) $testSuiteNode->getAttribute('name') - ); - } else { - $suite = new TestSuite; - } - - $exclude = []; - - foreach ($testSuiteNode->getElementsByTagName('exclude') as $excludeNode) { - $excludeFile = (string) $excludeNode->textContent; - - if ($excludeFile) { - $exclude[] = $this->toAbsolutePath($excludeFile); - } - } - - $fileIteratorFacade = new FileIteratorFacade; - $testSuiteFilter = $testSuiteFilter ? explode(',', $testSuiteFilter) : []; - - foreach ($testSuiteNode->getElementsByTagName('directory') as $directoryNode) { - assert($directoryNode instanceof DOMElement); - - if (!empty($testSuiteFilter) && !in_array($directoryNode->parentNode->getAttribute('name'), $testSuiteFilter, true)) { - continue; - } - - $directory = (string) $directoryNode->textContent; - - if (empty($directory)) { - continue; - } - - if (!$this->satisfiesPhpVersion($directoryNode)) { - continue; - } - - $files = $fileIteratorFacade->getFilesAsArray( - $this->toAbsolutePath($directory), - $directoryNode->hasAttribute('suffix') ? (string) $directoryNode->getAttribute('suffix') : 'Test.php', - $directoryNode->hasAttribute('prefix') ? (string) $directoryNode->getAttribute('prefix') : '', - $exclude - ); - - $suite->addTestFiles($files); - } - - foreach ($testSuiteNode->getElementsByTagName('file') as $fileNode) { - assert($fileNode instanceof DOMElement); - - if (!empty($testSuiteFilter) && !in_array($fileNode->parentNode->getAttribute('name'), $testSuiteFilter, true)) { - continue; - } - - $file = (string) $fileNode->textContent; - - if (empty($file)) { - continue; - } - - $file = $fileIteratorFacade->getFilesAsArray( - $this->toAbsolutePath($file) - ); - - if (!isset($file[0])) { - continue; - } - - $file = $file[0]; - - if (!$this->satisfiesPhpVersion($fileNode)) { - continue; - } - - $suite->addTestFile($file); - } - - return $suite; - } - - private function satisfiesPhpVersion(DOMElement $node): bool - { - $phpVersion = PHP_VERSION; - $phpVersionOperator = '>='; - - if ($node->hasAttribute('phpVersion')) { - $phpVersion = (string) $node->getAttribute('phpVersion'); - } - - if ($node->hasAttribute('phpVersionOperator')) { - $phpVersionOperator = (string) $node->getAttribute('phpVersionOperator'); - } - - return version_compare(PHP_VERSION, $phpVersion, (new VersionComparisonOperator($phpVersionOperator))->asString()); - } - - /** - * if $value is 'false' or 'true', this returns the value that $value represents. - * Otherwise, returns $default, which may be a string in rare cases. - * See PHPUnit\Util\ConfigurationTest::testPHPConfigurationIsReadCorrectly. - * - * @param bool|string $default - * - * @return bool|string - */ - private function getBoolean(string $value, $default) - { - if (strtolower($value) === 'false') { - return false; - } - - if (strtolower($value) === 'true') { - return true; - } - - return $default; - } - - private function getInteger(string $value, int $default): int - { - if (is_numeric($value)) { - return (int) $value; - } - - return $default; - } - - private function readFilterDirectories(string $query): array - { - $directories = []; - - foreach ($this->xpath->query($query) as $directoryNode) { - assert($directoryNode instanceof DOMElement); - - $directoryPath = (string) $directoryNode->textContent; - - if (!$directoryPath) { - continue; - } - - $directories[] = [ - 'path' => $this->toAbsolutePath($directoryPath), - 'prefix' => $directoryNode->hasAttribute('prefix') ? (string) $directoryNode->getAttribute('prefix') : '', - 'suffix' => $directoryNode->hasAttribute('suffix') ? (string) $directoryNode->getAttribute('suffix') : '.php', - 'group' => $directoryNode->hasAttribute('group') ? (string) $directoryNode->getAttribute('group') : 'DEFAULT', - ]; - } - - return $directories; - } - - /** - * @return string[] - */ - private function readFilterFiles(string $query): array - { - $files = []; - - foreach ($this->xpath->query($query) as $file) { - $filePath = (string) $file->textContent; - - if ($filePath) { - $files[] = $this->toAbsolutePath($filePath); - } - } - - return $files; - } - - private function toAbsolutePath(string $path, bool $useIncludePath = false): string - { - $path = trim($path); - - if (strpos($path, '/') === 0) { - return $path; - } - - // Matches the following on Windows: - // - \\NetworkComputer\Path - // - \\.\D: - // - \\.\c: - // - C:\Windows - // - C:\windows - // - C:/windows - // - c:/windows - if (defined('PHP_WINDOWS_VERSION_BUILD') && - ($path[0] === '\\' || (strlen($path) >= 3 && preg_match('#^[A-Z]\:[/\\\]#i', substr($path, 0, 3))))) { - return $path; - } - - if (strpos($path, '://') !== false) { - return $path; - } - - $file = dirname($this->filename) . DIRECTORY_SEPARATOR . $path; - - if ($useIncludePath && !file_exists($file)) { - $includePathFile = stream_resolve_include_path($path); - - if ($includePathFile) { - $file = $includePathFile; - } - } - - return $file; - } - - private function parseGroupConfiguration(string $root): array - { - $groups = [ - 'include' => [], - 'exclude' => [], - ]; - - foreach ($this->xpath->query($root . '/include/group') as $group) { - $groups['include'][] = (string) $group->textContent; - } - - foreach ($this->xpath->query($root . '/exclude/group') as $group) { - $groups['exclude'][] = (string) $group->textContent; - } - - return $groups; - } - - private function getElementConfigurationParameters(DOMElement $element): array - { - $class = (string) $element->getAttribute('class'); - $file = ''; - $arguments = $this->getConfigurationArguments($element->childNodes); - - if ($element->getAttribute('file')) { - $file = $this->toAbsolutePath( - (string) $element->getAttribute('file'), - true - ); - } - - return [ - 'class' => $class, - 'file' => $file, - 'arguments' => $arguments, - ]; - } -} diff --git a/vendor/phpunit/phpunit/src/Util/ConfigurationGenerator.php b/vendor/phpunit/phpunit/src/Util/ConfigurationGenerator.php deleted file mode 100644 index e7e9ea1..0000000 --- a/vendor/phpunit/phpunit/src/Util/ConfigurationGenerator.php +++ /dev/null @@ -1,67 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util; - -use function str_replace; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ConfigurationGenerator -{ - /** - * @var string - */ - private const TEMPLATE = <<<'EOT' - - - - - {tests_directory} - - - - - - {src_directory} - - - - -EOT; - - public function generateDefaultConfiguration(string $phpunitVersion, string $bootstrapScript, string $testsDirectory, string $srcDirectory): string - { - return str_replace( - [ - '{phpunit_version}', - '{bootstrap_script}', - '{tests_directory}', - '{src_directory}', - ], - [ - $phpunitVersion, - $bootstrapScript, - $testsDirectory, - $srcDirectory, - ], - self::TEMPLATE - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Util/ErrorHandler.php b/vendor/phpunit/phpunit/src/Util/ErrorHandler.php deleted file mode 100644 index f856634..0000000 --- a/vendor/phpunit/phpunit/src/Util/ErrorHandler.php +++ /dev/null @@ -1,156 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util; - -use const E_DEPRECATED; -use const E_NOTICE; -use const E_STRICT; -use const E_USER_DEPRECATED; -use const E_USER_NOTICE; -use const E_USER_WARNING; -use const E_WARNING; -use function error_reporting; -use function restore_error_handler; -use function set_error_handler; -use PHPUnit\Framework\Error\Deprecated; -use PHPUnit\Framework\Error\Error; -use PHPUnit\Framework\Error\Notice; -use PHPUnit\Framework\Error\Warning; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ErrorHandler -{ - /** - * @var bool - */ - private $convertDeprecationsToExceptions; - - /** - * @var bool - */ - private $convertErrorsToExceptions; - - /** - * @var bool - */ - private $convertNoticesToExceptions; - - /** - * @var bool - */ - private $convertWarningsToExceptions; - - /** - * @var bool - */ - private $registered = false; - - public static function invokeIgnoringWarnings(callable $callable) - { - set_error_handler( - static function ($errorNumber, $errorString) - { - if ($errorNumber === E_WARNING) { - return; - } - - return false; - } - ); - - $result = $callable(); - - restore_error_handler(); - - return $result; - } - - public function __construct(bool $convertDeprecationsToExceptions, bool $convertErrorsToExceptions, bool $convertNoticesToExceptions, bool $convertWarningsToExceptions) - { - $this->convertDeprecationsToExceptions = $convertDeprecationsToExceptions; - $this->convertErrorsToExceptions = $convertErrorsToExceptions; - $this->convertNoticesToExceptions = $convertNoticesToExceptions; - $this->convertWarningsToExceptions = $convertWarningsToExceptions; - } - - public function __invoke(int $errorNumber, string $errorString, string $errorFile, int $errorLine): bool - { - /* - * Do not raise an exception when the error suppression operator (@) was used. - * - * @see https://github.com/sebastianbergmann/phpunit/issues/3739 - */ - if (!($errorNumber & error_reporting())) { - return false; - } - - switch ($errorNumber) { - case E_NOTICE: - case E_USER_NOTICE: - case E_STRICT: - if (!$this->convertNoticesToExceptions) { - return false; - } - - throw new Notice($errorString, $errorNumber, $errorFile, $errorLine); - - case E_WARNING: - case E_USER_WARNING: - if (!$this->convertWarningsToExceptions) { - return false; - } - - throw new Warning($errorString, $errorNumber, $errorFile, $errorLine); - - case E_DEPRECATED: - case E_USER_DEPRECATED: - if (!$this->convertDeprecationsToExceptions) { - return false; - } - - throw new Deprecated($errorString, $errorNumber, $errorFile, $errorLine); - - default: - if (!$this->convertErrorsToExceptions) { - return false; - } - - throw new Error($errorString, $errorNumber, $errorFile, $errorLine); - } - } - - public function register(): void - { - if ($this->registered) { - return; - } - - $oldErrorHandler = set_error_handler($this); - - if ($oldErrorHandler !== null) { - restore_error_handler(); - - return; - } - - $this->registered = true; - } - - public function unregister(): void - { - if (!$this->registered) { - return; - } - - restore_error_handler(); - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Exception.php b/vendor/phpunit/phpunit/src/Util/Exception.php deleted file mode 100644 index 6bcb3d1..0000000 --- a/vendor/phpunit/phpunit/src/Util/Exception.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util; - -use RuntimeException; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Exception extends RuntimeException implements \PHPUnit\Exception -{ -} diff --git a/vendor/phpunit/phpunit/src/Util/FileLoader.php b/vendor/phpunit/phpunit/src/Util/FileLoader.php deleted file mode 100644 index 1390d8c..0000000 --- a/vendor/phpunit/phpunit/src/Util/FileLoader.php +++ /dev/null @@ -1,84 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util; - -use const DIRECTORY_SEPARATOR; -use function array_diff; -use function array_keys; -use function fopen; -use function get_defined_vars; -use function sprintf; -use function stream_resolve_include_path; -use PHPUnit\Framework\Exception; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class FileLoader -{ - /** - * Checks if a PHP sourcecode file is readable. The sourcecode file is loaded through the load() method. - * - * As a fallback, PHP looks in the directory of the file executing the stream_resolve_include_path function. - * We do not want to load the Test.php file here, so skip it if it found that. - * PHP prioritizes the include_path setting, so if the current directory is in there, it will first look in the - * current working directory. - * - * @throws Exception - */ - public static function checkAndLoad(string $filename): string - { - $includePathFilename = stream_resolve_include_path($filename); - - if (!$includePathFilename) { - throw new Exception( - sprintf('Cannot open file "%s".' . "\n", $filename) - ); - } - - $localFile = __DIR__ . DIRECTORY_SEPARATOR . $filename; - - if ($includePathFilename === $localFile || !self::isReadable($includePathFilename)) { - throw new Exception( - sprintf('Cannot open file "%s".' . "\n", $filename) - ); - } - - self::load($includePathFilename); - - return $includePathFilename; - } - - /** - * Loads a PHP sourcefile. - */ - public static function load(string $filename): void - { - $oldVariableNames = array_keys(get_defined_vars()); - - include_once $filename; - - $newVariables = get_defined_vars(); - - foreach (array_diff(array_keys($newVariables), $oldVariableNames) as $variableName) { - if ($variableName !== 'oldVariableNames') { - $GLOBALS[$variableName] = $newVariables[$variableName]; - } - } - } - - /** - * @see https://github.com/sebastianbergmann/phpunit/pull/2751 - */ - private static function isReadable(string $filename): bool - { - return @fopen($filename, 'r') !== false; - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Filesystem.php b/vendor/phpunit/phpunit/src/Util/Filesystem.php deleted file mode 100644 index cd0c125..0000000 --- a/vendor/phpunit/phpunit/src/Util/Filesystem.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util; - -use const DIRECTORY_SEPARATOR; -use function is_dir; -use function mkdir; -use function str_replace; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Filesystem -{ - /** - * Maps class names to source file names: - * - PEAR CS: Foo_Bar_Baz -> Foo/Bar/Baz.php - * - Namespace: Foo\Bar\Baz -> Foo/Bar/Baz.php. - */ - public static function classNameToFilename(string $className): string - { - return str_replace( - ['_', '\\'], - DIRECTORY_SEPARATOR, - $className - ) . '.php'; - } - - public static function createDirectory(string $directory): bool - { - return !(!is_dir($directory) && !@mkdir($directory, 0777, true) && !is_dir($directory)); - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Filter.php b/vendor/phpunit/phpunit/src/Util/Filter.php deleted file mode 100644 index 06f58d5..0000000 --- a/vendor/phpunit/phpunit/src/Util/Filter.php +++ /dev/null @@ -1,115 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util; - -use function array_unshift; -use function defined; -use function in_array; -use function is_file; -use function realpath; -use function sprintf; -use function strpos; -use PHPUnit\Framework\Exception; -use PHPUnit\Framework\SyntheticError; -use Throwable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Filter -{ - /** - * @throws Exception - */ - public static function getFilteredStacktrace(Throwable $t): string - { - $filteredStacktrace = ''; - - if ($t instanceof SyntheticError) { - $eTrace = $t->getSyntheticTrace(); - $eFile = $t->getSyntheticFile(); - $eLine = $t->getSyntheticLine(); - } elseif ($t instanceof Exception) { - $eTrace = $t->getSerializableTrace(); - $eFile = $t->getFile(); - $eLine = $t->getLine(); - } else { - if ($t->getPrevious()) { - $t = $t->getPrevious(); - } - - $eTrace = $t->getTrace(); - $eFile = $t->getFile(); - $eLine = $t->getLine(); - } - - if (!self::frameExists($eTrace, $eFile, $eLine)) { - array_unshift( - $eTrace, - ['file' => $eFile, 'line' => $eLine] - ); - } - - $prefix = defined('__PHPUNIT_PHAR_ROOT__') ? __PHPUNIT_PHAR_ROOT__ : false; - $blacklist = new Blacklist; - - foreach ($eTrace as $frame) { - if (self::shouldPrintFrame($frame, $prefix, $blacklist)) { - $filteredStacktrace .= sprintf( - "%s:%s\n", - $frame['file'], - $frame['line'] ?? '?' - ); - } - } - - return $filteredStacktrace; - } - - private static function shouldPrintFrame($frame, $prefix, Blacklist $blacklist): bool - { - if (!isset($frame['file'])) { - return false; - } - - $file = $frame['file']; - $fileIsNotPrefixed = $prefix === false || strpos($file, $prefix) !== 0; - - // @see https://github.com/sebastianbergmann/phpunit/issues/4033 - if (isset($GLOBALS['_SERVER']['SCRIPT_NAME'])) { - $script = realpath($GLOBALS['_SERVER']['SCRIPT_NAME']); - } else { - $script = ''; - } - - return is_file($file) && - self::fileIsBlacklisted($file, $blacklist) && - $fileIsNotPrefixed && - $file !== $script; - } - - private static function fileIsBlacklisted($file, Blacklist $blacklist): bool - { - return (empty($GLOBALS['__PHPUNIT_ISOLATION_BLACKLIST']) || - !in_array($file, $GLOBALS['__PHPUNIT_ISOLATION_BLACKLIST'], true)) && - !$blacklist->isBlacklisted($file); - } - - private static function frameExists(array $trace, string $file, int $line): bool - { - foreach ($trace as $frame) { - if (isset($frame['file'], $frame['line']) && $frame['file'] === $file && $frame['line'] === $line) { - return true; - } - } - - return false; - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Getopt.php b/vendor/phpunit/phpunit/src/Util/Getopt.php deleted file mode 100644 index 878e2a4..0000000 --- a/vendor/phpunit/phpunit/src/Util/Getopt.php +++ /dev/null @@ -1,197 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util; - -use function array_map; -use function array_merge; -use function array_shift; -use function array_slice; -use function count; -use function current; -use function explode; -use function key; -use function next; -use function preg_replace; -use function reset; -use function sort; -use function strlen; -use function strpos; -use function strstr; -use function substr; -use PHPUnit\Framework\Exception; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Getopt -{ - /** - * @throws Exception - */ - public static function parse(array $args, string $short_options, array $long_options = null): array - { - if (empty($args)) { - return [[], []]; - } - - $opts = []; - $non_opts = []; - - if ($long_options) { - sort($long_options); - } - - if (isset($args[0][0]) && $args[0][0] !== '-') { - array_shift($args); - } - - reset($args); - - $args = array_map('trim', $args); - - /* @noinspection ComparisonOperandsOrderInspection */ - while (false !== $arg = current($args)) { - $i = key($args); - next($args); - - if ($arg === '') { - continue; - } - - if ($arg === '--') { - $non_opts = array_merge($non_opts, array_slice($args, $i + 1)); - - break; - } - - if ($arg[0] !== '-' || (strlen($arg) > 1 && $arg[1] === '-' && !$long_options)) { - $non_opts[] = $args[$i]; - - continue; - } - - if (strlen($arg) > 1 && $arg[1] === '-') { - self::parseLongOption( - substr($arg, 2), - $long_options, - $opts, - $args - ); - } else { - self::parseShortOption( - substr($arg, 1), - $short_options, - $opts, - $args - ); - } - } - - return [$opts, $non_opts]; - } - - /** - * @throws Exception - */ - private static function parseShortOption(string $arg, string $short_options, array &$opts, array &$args): void - { - $argLen = strlen($arg); - - for ($i = 0; $i < $argLen; $i++) { - $opt = $arg[$i]; - $opt_arg = null; - - if ($arg[$i] === ':' || ($spec = strstr($short_options, $opt)) === false) { - throw new Exception( - "unrecognized option -- {$opt}" - ); - } - - if (strlen($spec) > 1 && $spec[1] === ':') { - if ($i + 1 < $argLen) { - $opts[] = [$opt, substr($arg, $i + 1)]; - - break; - } - - if (!(strlen($spec) > 2 && $spec[2] === ':')) { - /* @noinspection ComparisonOperandsOrderInspection */ - if (false === $opt_arg = current($args)) { - throw new Exception( - "option requires an argument -- {$opt}" - ); - } - - next($args); - } - } - - $opts[] = [$opt, $opt_arg]; - } - } - - /** - * @throws Exception - */ - private static function parseLongOption(string $arg, array $long_options, array &$opts, array &$args): void - { - $count = count($long_options); - $list = explode('=', $arg); - $opt = $list[0]; - $opt_arg = null; - - if (count($list) > 1) { - $opt_arg = $list[1]; - } - - $opt_len = strlen($opt); - - foreach ($long_options as $i => $long_opt) { - $opt_start = substr($long_opt, 0, $opt_len); - - if ($opt_start !== $opt) { - continue; - } - - $opt_rest = substr($long_opt, $opt_len); - - if ($opt_rest !== '' && $i + 1 < $count && $opt[0] !== '=' && strpos($long_options[$i + 1], $opt) === 0) { - throw new Exception( - "option --{$opt} is ambiguous" - ); - } - - if (substr($long_opt, -1) === '=') { - /* @noinspection StrlenInEmptyStringCheckContextInspection */ - if (substr($long_opt, -2) !== '==' && !strlen((string) $opt_arg)) { - /* @noinspection ComparisonOperandsOrderInspection */ - if (false === $opt_arg = current($args)) { - throw new Exception( - "option --{$opt} requires an argument" - ); - } - - next($args); - } - } elseif ($opt_arg) { - throw new Exception( - "option --{$opt} doesn't allow an argument" - ); - } - - $full_option = '--' . preg_replace('/={1,2}$/', '', $long_opt); - $opts[] = [$full_option, $opt_arg]; - - return; - } - - throw new Exception("unrecognized option --{$opt}"); - } -} diff --git a/vendor/phpunit/phpunit/src/Util/GlobalState.php b/vendor/phpunit/phpunit/src/Util/GlobalState.php deleted file mode 100644 index 5f483f3..0000000 --- a/vendor/phpunit/phpunit/src/Util/GlobalState.php +++ /dev/null @@ -1,205 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util; - -use function array_keys; -use function array_shift; -use function count; -use function defined; -use function get_defined_constants; -use function get_included_files; -use function in_array; -use function ini_get_all; -use function is_array; -use function is_file; -use function is_scalar; -use function preg_match; -use function serialize; -use function sprintf; -use function strpos; -use function strtr; -use function substr; -use function var_export; -use Closure; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class GlobalState -{ - /** - * @var string[] - */ - private const SUPER_GLOBAL_ARRAYS = [ - '_ENV', - '_POST', - '_GET', - '_COOKIE', - '_SERVER', - '_FILES', - '_REQUEST', - ]; - - /** - * @throws Exception - */ - public static function getIncludedFilesAsString(): string - { - return self::processIncludedFilesAsString(get_included_files()); - } - - /** - * @param string[] $files - * - * @throws Exception - */ - public static function processIncludedFilesAsString(array $files): string - { - $blacklist = new Blacklist; - $prefix = false; - $result = ''; - - if (defined('__PHPUNIT_PHAR__')) { - $prefix = 'phar://' . __PHPUNIT_PHAR__ . '/'; - } - - // Do not process bootstrap script - array_shift($files); - - // If bootstrap script was a Composer bin proxy, skip the second entry as well - if (substr(strtr($files[0], '\\', '/'), -24) === '/phpunit/phpunit/phpunit') { - array_shift($files); - } - - for ($i = count($files) - 1; $i >= 0; $i--) { - $file = $files[$i]; - - if (!empty($GLOBALS['__PHPUNIT_ISOLATION_BLACKLIST']) && - in_array($file, $GLOBALS['__PHPUNIT_ISOLATION_BLACKLIST'], true)) { - continue; - } - - if ($prefix !== false && strpos($file, $prefix) === 0) { - continue; - } - - // Skip virtual file system protocols - if (preg_match('/^(vfs|phpvfs[a-z0-9]+):/', $file)) { - continue; - } - - if (!$blacklist->isBlacklisted($file) && is_file($file)) { - $result = 'require_once \'' . $file . "';\n" . $result; - } - } - - return $result; - } - - public static function getIniSettingsAsString(): string - { - $result = ''; - - foreach (ini_get_all(null, false) as $key => $value) { - $result .= sprintf( - '@ini_set(%s, %s);' . "\n", - self::exportVariable($key), - self::exportVariable((string) $value) - ); - } - - return $result; - } - - public static function getConstantsAsString(): string - { - $constants = get_defined_constants(true); - $result = ''; - - if (isset($constants['user'])) { - foreach ($constants['user'] as $name => $value) { - $result .= sprintf( - 'if (!defined(\'%s\')) define(\'%s\', %s);' . "\n", - $name, - $name, - self::exportVariable($value) - ); - } - } - - return $result; - } - - public static function getGlobalsAsString(): string - { - $result = ''; - - foreach (self::SUPER_GLOBAL_ARRAYS as $superGlobalArray) { - if (isset($GLOBALS[$superGlobalArray]) && is_array($GLOBALS[$superGlobalArray])) { - foreach (array_keys($GLOBALS[$superGlobalArray]) as $key) { - if ($GLOBALS[$superGlobalArray][$key] instanceof Closure) { - continue; - } - - $result .= sprintf( - '$GLOBALS[\'%s\'][\'%s\'] = %s;' . "\n", - $superGlobalArray, - $key, - self::exportVariable($GLOBALS[$superGlobalArray][$key]) - ); - } - } - } - - $blacklist = self::SUPER_GLOBAL_ARRAYS; - $blacklist[] = 'GLOBALS'; - - foreach (array_keys($GLOBALS) as $key) { - if (!$GLOBALS[$key] instanceof Closure && !in_array($key, $blacklist, true)) { - $result .= sprintf( - '$GLOBALS[\'%s\'] = %s;' . "\n", - $key, - self::exportVariable($GLOBALS[$key]) - ); - } - } - - return $result; - } - - private static function exportVariable($variable): string - { - if (is_scalar($variable) || $variable === null || - (is_array($variable) && self::arrayOnlyContainsScalars($variable))) { - return var_export($variable, true); - } - - return 'unserialize(' . var_export(serialize($variable), true) . ')'; - } - - private static function arrayOnlyContainsScalars(array $array): bool - { - $result = true; - - foreach ($array as $element) { - if (is_array($element)) { - $result = self::arrayOnlyContainsScalars($element); - } elseif (!is_scalar($element) && $element !== null) { - $result = false; - } - - if (!$result) { - break; - } - } - - return $result; - } -} diff --git a/vendor/phpunit/phpunit/src/Util/InvalidDataSetException.php b/vendor/phpunit/phpunit/src/Util/InvalidDataSetException.php deleted file mode 100644 index 3493d11..0000000 --- a/vendor/phpunit/phpunit/src/Util/InvalidDataSetException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util; - -use RuntimeException; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class InvalidDataSetException extends RuntimeException implements \PHPUnit\Exception -{ -} diff --git a/vendor/phpunit/phpunit/src/Util/Json.php b/vendor/phpunit/phpunit/src/Util/Json.php deleted file mode 100644 index 752c1fd..0000000 --- a/vendor/phpunit/phpunit/src/Util/Json.php +++ /dev/null @@ -1,98 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util; - -use const JSON_PRETTY_PRINT; -use const JSON_UNESCAPED_SLASHES; -use const JSON_UNESCAPED_UNICODE; -use function count; -use function is_array; -use function is_object; -use function json_decode; -use function json_encode; -use function json_last_error; -use function ksort; -use PHPUnit\Framework\Exception; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Json -{ - /** - * Prettify json string. - * - * @throws \PHPUnit\Framework\Exception - */ - public static function prettify(string $json): string - { - $decodedJson = json_decode($json, false); - - if (json_last_error()) { - throw new Exception( - 'Cannot prettify invalid json' - ); - } - - return json_encode($decodedJson, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); - } - - /** - * To allow comparison of JSON strings, first process them into a consistent - * format so that they can be compared as strings. - * - * @return array ($error, $canonicalized_json) The $error parameter is used - * to indicate an error decoding the json. This is used to avoid ambiguity - * with JSON strings consisting entirely of 'null' or 'false'. - */ - public static function canonicalize(string $json): array - { - $decodedJson = json_decode($json); - - if (json_last_error()) { - return [true, null]; - } - - self::recursiveSort($decodedJson); - - $reencodedJson = json_encode($decodedJson); - - return [false, $reencodedJson]; - } - - /** - * JSON object keys are unordered while PHP array keys are ordered. - * - * Sort all array keys to ensure both the expected and actual values have - * their keys in the same order. - */ - private static function recursiveSort(&$json): void - { - if (!is_array($json)) { - // If the object is not empty, change it to an associative array - // so we can sort the keys (and we will still re-encode it - // correctly, since PHP encodes associative arrays as JSON objects.) - // But EMPTY objects MUST remain empty objects. (Otherwise we will - // re-encode it as a JSON array rather than a JSON object.) - // See #2919. - if (is_object($json) && count((array) $json) > 0) { - $json = (array) $json; - } else { - return; - } - } - - ksort($json); - - foreach ($json as $key => &$value) { - self::recursiveSort($value); - } - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Log/JUnit.php b/vendor/phpunit/phpunit/src/Util/Log/JUnit.php deleted file mode 100644 index 710e2c4..0000000 --- a/vendor/phpunit/phpunit/src/Util/Log/JUnit.php +++ /dev/null @@ -1,432 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util\Log; - -use function class_exists; -use function get_class; -use function method_exists; -use function sprintf; -use function str_replace; -use DOMDocument; -use DOMElement; -use PHPUnit\Framework\AssertionFailedError; -use PHPUnit\Framework\ExceptionWrapper; -use PHPUnit\Framework\SelfDescribing; -use PHPUnit\Framework\Test; -use PHPUnit\Framework\TestFailure; -use PHPUnit\Framework\TestListener; -use PHPUnit\Framework\TestSuite; -use PHPUnit\Framework\Warning; -use PHPUnit\Util\Exception; -use PHPUnit\Util\Filter; -use PHPUnit\Util\Printer; -use PHPUnit\Util\Xml; -use ReflectionClass; -use ReflectionException; -use Throwable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class JUnit extends Printer implements TestListener -{ - /** - * @var DOMDocument - */ - private $document; - - /** - * @var DOMElement - */ - private $root; - - /** - * @var bool - */ - private $reportRiskyTests = false; - - /** - * @var DOMElement[] - */ - private $testSuites = []; - - /** - * @var int[] - */ - private $testSuiteTests = [0]; - - /** - * @var int[] - */ - private $testSuiteAssertions = [0]; - - /** - * @var int[] - */ - private $testSuiteErrors = [0]; - - /** - * @var int[] - */ - private $testSuiteWarnings = [0]; - - /** - * @var int[] - */ - private $testSuiteFailures = [0]; - - /** - * @var int[] - */ - private $testSuiteSkipped = [0]; - - /** - * @var int[] - */ - private $testSuiteTimes = [0]; - - /** - * @var int - */ - private $testSuiteLevel = 0; - - /** - * @var DOMElement - */ - private $currentTestCase; - - /** - * @param null|mixed $out - */ - public function __construct($out = null, bool $reportRiskyTests = false) - { - $this->document = new DOMDocument('1.0', 'UTF-8'); - $this->document->formatOutput = true; - - $this->root = $this->document->createElement('testsuites'); - $this->document->appendChild($this->root); - - parent::__construct($out); - - $this->reportRiskyTests = $reportRiskyTests; - } - - /** - * Flush buffer and close output. - */ - public function flush(): void - { - $this->write($this->getXML()); - - parent::flush(); - } - - /** - * An error occurred. - */ - public function addError(Test $test, Throwable $t, float $time): void - { - $this->doAddFault($test, $t, $time, 'error'); - $this->testSuiteErrors[$this->testSuiteLevel]++; - } - - /** - * A warning occurred. - */ - public function addWarning(Test $test, Warning $e, float $time): void - { - $this->doAddFault($test, $e, $time, 'warning'); - $this->testSuiteWarnings[$this->testSuiteLevel]++; - } - - /** - * A failure occurred. - */ - public function addFailure(Test $test, AssertionFailedError $e, float $time): void - { - $this->doAddFault($test, $e, $time, 'failure'); - $this->testSuiteFailures[$this->testSuiteLevel]++; - } - - /** - * Incomplete test. - */ - public function addIncompleteTest(Test $test, Throwable $t, float $time): void - { - $this->doAddSkipped(); - } - - /** - * Risky test. - */ - public function addRiskyTest(Test $test, Throwable $t, float $time): void - { - if (!$this->reportRiskyTests || $this->currentTestCase === null) { - return; - } - - $error = $this->document->createElement( - 'error', - Xml::prepareString( - "Risky Test\n" . - Filter::getFilteredStacktrace($t) - ) - ); - - $error->setAttribute('type', get_class($t)); - - $this->currentTestCase->appendChild($error); - - $this->testSuiteErrors[$this->testSuiteLevel]++; - } - - /** - * Skipped test. - */ - public function addSkippedTest(Test $test, Throwable $t, float $time): void - { - $this->doAddSkipped(); - } - - /** - * A testsuite started. - */ - public function startTestSuite(TestSuite $suite): void - { - $testSuite = $this->document->createElement('testsuite'); - $testSuite->setAttribute('name', $suite->getName()); - - if (class_exists($suite->getName(), false)) { - try { - $class = new ReflectionClass($suite->getName()); - - $testSuite->setAttribute('file', $class->getFileName()); - } catch (ReflectionException $e) { - } - } - - if ($this->testSuiteLevel > 0) { - $this->testSuites[$this->testSuiteLevel]->appendChild($testSuite); - } else { - $this->root->appendChild($testSuite); - } - - $this->testSuiteLevel++; - $this->testSuites[$this->testSuiteLevel] = $testSuite; - $this->testSuiteTests[$this->testSuiteLevel] = 0; - $this->testSuiteAssertions[$this->testSuiteLevel] = 0; - $this->testSuiteErrors[$this->testSuiteLevel] = 0; - $this->testSuiteWarnings[$this->testSuiteLevel] = 0; - $this->testSuiteFailures[$this->testSuiteLevel] = 0; - $this->testSuiteSkipped[$this->testSuiteLevel] = 0; - $this->testSuiteTimes[$this->testSuiteLevel] = 0; - } - - /** - * A testsuite ended. - */ - public function endTestSuite(TestSuite $suite): void - { - $this->testSuites[$this->testSuiteLevel]->setAttribute( - 'tests', - (string) $this->testSuiteTests[$this->testSuiteLevel] - ); - - $this->testSuites[$this->testSuiteLevel]->setAttribute( - 'assertions', - (string) $this->testSuiteAssertions[$this->testSuiteLevel] - ); - - $this->testSuites[$this->testSuiteLevel]->setAttribute( - 'errors', - (string) $this->testSuiteErrors[$this->testSuiteLevel] - ); - - $this->testSuites[$this->testSuiteLevel]->setAttribute( - 'warnings', - (string) $this->testSuiteWarnings[$this->testSuiteLevel] - ); - - $this->testSuites[$this->testSuiteLevel]->setAttribute( - 'failures', - (string) $this->testSuiteFailures[$this->testSuiteLevel] - ); - - $this->testSuites[$this->testSuiteLevel]->setAttribute( - 'skipped', - (string) $this->testSuiteSkipped[$this->testSuiteLevel] - ); - - $this->testSuites[$this->testSuiteLevel]->setAttribute( - 'time', - sprintf('%F', $this->testSuiteTimes[$this->testSuiteLevel]) - ); - - if ($this->testSuiteLevel > 1) { - $this->testSuiteTests[$this->testSuiteLevel - 1] += $this->testSuiteTests[$this->testSuiteLevel]; - $this->testSuiteAssertions[$this->testSuiteLevel - 1] += $this->testSuiteAssertions[$this->testSuiteLevel]; - $this->testSuiteErrors[$this->testSuiteLevel - 1] += $this->testSuiteErrors[$this->testSuiteLevel]; - $this->testSuiteWarnings[$this->testSuiteLevel - 1] += $this->testSuiteWarnings[$this->testSuiteLevel]; - $this->testSuiteFailures[$this->testSuiteLevel - 1] += $this->testSuiteFailures[$this->testSuiteLevel]; - $this->testSuiteSkipped[$this->testSuiteLevel - 1] += $this->testSuiteSkipped[$this->testSuiteLevel]; - $this->testSuiteTimes[$this->testSuiteLevel - 1] += $this->testSuiteTimes[$this->testSuiteLevel]; - } - - $this->testSuiteLevel--; - } - - /** - * A test started. - */ - public function startTest(Test $test): void - { - $usesDataprovider = false; - - if (method_exists($test, 'usesDataProvider')) { - $usesDataprovider = $test->usesDataProvider(); - } - - $testCase = $this->document->createElement('testcase'); - $testCase->setAttribute('name', $test->getName()); - - try { - $class = new ReflectionClass($test); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - $methodName = $test->getName(!$usesDataprovider); - - if ($class->hasMethod($methodName)) { - try { - $method = $class->getMethod($methodName); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - $testCase->setAttribute('class', $class->getName()); - $testCase->setAttribute('classname', str_replace('\\', '.', $class->getName())); - $testCase->setAttribute('file', $class->getFileName()); - $testCase->setAttribute('line', (string) $method->getStartLine()); - } - - $this->currentTestCase = $testCase; - } - - /** - * A test ended. - */ - public function endTest(Test $test, float $time): void - { - $numAssertions = 0; - - if (method_exists($test, 'getNumAssertions')) { - $numAssertions = $test->getNumAssertions(); - } - - $this->testSuiteAssertions[$this->testSuiteLevel] += $numAssertions; - - $this->currentTestCase->setAttribute( - 'assertions', - (string) $numAssertions - ); - - $this->currentTestCase->setAttribute( - 'time', - sprintf('%F', $time) - ); - - $this->testSuites[$this->testSuiteLevel]->appendChild( - $this->currentTestCase - ); - - $this->testSuiteTests[$this->testSuiteLevel]++; - $this->testSuiteTimes[$this->testSuiteLevel] += $time; - - $testOutput = ''; - - if (method_exists($test, 'hasOutput') && method_exists($test, 'getActualOutput')) { - $testOutput = $test->hasOutput() ? $test->getActualOutput() : ''; - } - - if (!empty($testOutput)) { - $systemOut = $this->document->createElement( - 'system-out', - Xml::prepareString($testOutput) - ); - - $this->currentTestCase->appendChild($systemOut); - } - - $this->currentTestCase = null; - } - - /** - * Returns the XML as a string. - */ - public function getXML(): string - { - return $this->document->saveXML(); - } - - private function doAddFault(Test $test, Throwable $t, float $time, $type): void - { - if ($this->currentTestCase === null) { - return; - } - - if ($test instanceof SelfDescribing) { - $buffer = $test->toString() . "\n"; - } else { - $buffer = ''; - } - - $buffer .= TestFailure::exceptionToString($t) . "\n" . - Filter::getFilteredStacktrace($t); - - $fault = $this->document->createElement( - $type, - Xml::prepareString($buffer) - ); - - if ($t instanceof ExceptionWrapper) { - $fault->setAttribute('type', $t->getClassName()); - } else { - $fault->setAttribute('type', get_class($t)); - } - - $this->currentTestCase->appendChild($fault); - } - - private function doAddSkipped(): void - { - if ($this->currentTestCase === null) { - return; - } - - $skipped = $this->document->createElement('skipped'); - - $this->currentTestCase->appendChild($skipped); - - $this->testSuiteSkipped[$this->testSuiteLevel]++; - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Log/TeamCity.php b/vendor/phpunit/phpunit/src/Util/Log/TeamCity.php deleted file mode 100644 index 695760d..0000000 --- a/vendor/phpunit/phpunit/src/Util/Log/TeamCity.php +++ /dev/null @@ -1,386 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util\Log; - -use function class_exists; -use function count; -use function explode; -use function get_class; -use function getmypid; -use function ini_get; -use function is_bool; -use function is_scalar; -use function method_exists; -use function print_r; -use function round; -use function str_replace; -use function stripos; -use PHPUnit\Framework\AssertionFailedError; -use PHPUnit\Framework\ExceptionWrapper; -use PHPUnit\Framework\ExpectationFailedException; -use PHPUnit\Framework\Test; -use PHPUnit\Framework\TestCase; -use PHPUnit\Framework\TestFailure; -use PHPUnit\Framework\TestResult; -use PHPUnit\Framework\TestSuite; -use PHPUnit\Framework\Warning; -use PHPUnit\TextUI\ResultPrinter; -use PHPUnit\Util\Exception; -use PHPUnit\Util\Filter; -use ReflectionClass; -use ReflectionException; -use SebastianBergmann\Comparator\ComparisonFailure; -use Throwable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class TeamCity extends ResultPrinter -{ - /** - * @var bool - */ - private $isSummaryTestCountPrinted = false; - - /** - * @var string - */ - private $startedTestName; - - /** - * @var false|int - */ - private $flowId; - - /** - * @throws \SebastianBergmann\Timer\RuntimeException - */ - public function printResult(TestResult $result): void - { - $this->printHeader($result); - $this->printFooter($result); - } - - /** - * An error occurred. - */ - public function addError(Test $test, Throwable $t, float $time): void - { - $this->printEvent( - 'testFailed', - [ - 'name' => $test->getName(), - 'message' => self::getMessage($t), - 'details' => self::getDetails($t), - 'duration' => self::toMilliseconds($time), - ] - ); - } - - /** - * A warning occurred. - */ - public function addWarning(Test $test, Warning $e, float $time): void - { - $this->write(self::getMessage($e) . PHP_EOL); - } - - /** - * A failure occurred. - */ - public function addFailure(Test $test, AssertionFailedError $e, float $time): void - { - $parameters = [ - 'name' => $test->getName(), - 'message' => self::getMessage($e), - 'details' => self::getDetails($e), - 'duration' => self::toMilliseconds($time), - ]; - - if ($e instanceof ExpectationFailedException) { - $comparisonFailure = $e->getComparisonFailure(); - - if ($comparisonFailure instanceof ComparisonFailure) { - $expectedString = $comparisonFailure->getExpectedAsString(); - - if ($expectedString === null || empty($expectedString)) { - $expectedString = self::getPrimitiveValueAsString($comparisonFailure->getExpected()); - } - - $actualString = $comparisonFailure->getActualAsString(); - - if ($actualString === null || empty($actualString)) { - $actualString = self::getPrimitiveValueAsString($comparisonFailure->getActual()); - } - - if ($actualString !== null && $expectedString !== null) { - $parameters['type'] = 'comparisonFailure'; - $parameters['actual'] = $actualString; - $parameters['expected'] = $expectedString; - } - } - } - - $this->printEvent('testFailed', $parameters); - } - - /** - * Incomplete test. - */ - public function addIncompleteTest(Test $test, Throwable $t, float $time): void - { - $this->printIgnoredTest($test->getName(), $t, $time); - } - - /** - * Risky test. - */ - public function addRiskyTest(Test $test, Throwable $t, float $time): void - { - $this->addError($test, $t, $time); - } - - /** - * Skipped test. - */ - public function addSkippedTest(Test $test, Throwable $t, float $time): void - { - $testName = $test->getName(); - - if ($this->startedTestName !== $testName) { - $this->startTest($test); - $this->printIgnoredTest($testName, $t, $time); - $this->endTest($test, $time); - } else { - $this->printIgnoredTest($testName, $t, $time); - } - } - - public function printIgnoredTest($testName, Throwable $t, float $time): void - { - $this->printEvent( - 'testIgnored', - [ - 'name' => $testName, - 'message' => self::getMessage($t), - 'details' => self::getDetails($t), - 'duration' => self::toMilliseconds($time), - ] - ); - } - - /** - * A testsuite started. - */ - public function startTestSuite(TestSuite $suite): void - { - if (stripos(ini_get('disable_functions'), 'getmypid') === false) { - $this->flowId = getmypid(); - } else { - $this->flowId = false; - } - - if (!$this->isSummaryTestCountPrinted) { - $this->isSummaryTestCountPrinted = true; - - $this->printEvent( - 'testCount', - ['count' => count($suite)] - ); - } - - $suiteName = $suite->getName(); - - if (empty($suiteName)) { - return; - } - - $parameters = ['name' => $suiteName]; - - if (class_exists($suiteName, false)) { - $fileName = self::getFileName($suiteName); - $parameters['locationHint'] = "php_qn://{$fileName}::\\{$suiteName}"; - } else { - $split = explode('::', $suiteName); - - if (count($split) === 2 && class_exists($split[0]) && method_exists($split[0], $split[1])) { - $fileName = self::getFileName($split[0]); - $parameters['locationHint'] = "php_qn://{$fileName}::\\{$suiteName}"; - $parameters['name'] = $split[1]; - } - } - - $this->printEvent('testSuiteStarted', $parameters); - } - - /** - * A testsuite ended. - */ - public function endTestSuite(TestSuite $suite): void - { - $suiteName = $suite->getName(); - - if (empty($suiteName)) { - return; - } - - $parameters = ['name' => $suiteName]; - - if (!class_exists($suiteName, false)) { - $split = explode('::', $suiteName); - - if (count($split) === 2 && class_exists($split[0]) && method_exists($split[0], $split[1])) { - $parameters['name'] = $split[1]; - } - } - - $this->printEvent('testSuiteFinished', $parameters); - } - - /** - * A test started. - */ - public function startTest(Test $test): void - { - $testName = $test->getName(); - $this->startedTestName = $testName; - $params = ['name' => $testName]; - - if ($test instanceof TestCase) { - $className = get_class($test); - $fileName = self::getFileName($className); - $params['locationHint'] = "php_qn://{$fileName}::\\{$className}::{$testName}"; - } - - $this->printEvent('testStarted', $params); - } - - /** - * A test ended. - */ - public function endTest(Test $test, float $time): void - { - parent::endTest($test, $time); - - $this->printEvent( - 'testFinished', - [ - 'name' => $test->getName(), - 'duration' => self::toMilliseconds($time), - ] - ); - } - - protected function writeProgress(string $progress): void - { - } - - private function printEvent(string $eventName, array $params = []): void - { - $this->write("\n##teamcity[{$eventName}"); - - if ($this->flowId) { - $params['flowId'] = $this->flowId; - } - - foreach ($params as $key => $value) { - $escapedValue = self::escapeValue((string) $value); - $this->write(" {$key}='{$escapedValue}'"); - } - - $this->write("]\n"); - } - - private static function getMessage(Throwable $t): string - { - $message = ''; - - if ($t instanceof ExceptionWrapper) { - if ($t->getClassName() !== '') { - $message .= $t->getClassName(); - } - - if ($message !== '' && $t->getMessage() !== '') { - $message .= ' : '; - } - } - - return $message . $t->getMessage(); - } - - private static function getDetails(Throwable $t): string - { - $stackTrace = Filter::getFilteredStacktrace($t); - $previous = $t instanceof ExceptionWrapper ? $t->getPreviousWrapped() : $t->getPrevious(); - - while ($previous) { - $stackTrace .= "\nCaused by\n" . - TestFailure::exceptionToString($previous) . "\n" . - Filter::getFilteredStacktrace($previous); - - $previous = $previous instanceof ExceptionWrapper ? - $previous->getPreviousWrapped() : $previous->getPrevious(); - } - - return ' ' . str_replace("\n", "\n ", $stackTrace); - } - - private static function getPrimitiveValueAsString($value): ?string - { - if ($value === null) { - return 'null'; - } - - if (is_bool($value)) { - return $value ? 'true' : 'false'; - } - - if (is_scalar($value)) { - return print_r($value, true); - } - - return null; - } - - private static function escapeValue(string $text): string - { - return str_replace( - ['|', "'", "\n", "\r", ']', '['], - ['||', "|'", '|n', '|r', '|]', '|['], - $text - ); - } - - /** - * @param string $className - */ - private static function getFileName($className): string - { - try { - return (new ReflectionClass($className))->getFileName(); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - } - - /** - * @param float $time microseconds - */ - private static function toMilliseconds(float $time): int - { - return (int) round($time * 1000); - } -} diff --git a/vendor/phpunit/phpunit/src/Util/PHP/AbstractPhpProcess.php b/vendor/phpunit/phpunit/src/Util/PHP/AbstractPhpProcess.php deleted file mode 100644 index 8706ae1..0000000 --- a/vendor/phpunit/phpunit/src/Util/PHP/AbstractPhpProcess.php +++ /dev/null @@ -1,416 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util\PHP; - -use const DIRECTORY_SEPARATOR; -use const PHP_SAPI; -use function array_keys; -use function array_merge; -use function assert; -use function escapeshellarg; -use function ini_get_all; -use function restore_error_handler; -use function set_error_handler; -use function sprintf; -use function str_replace; -use function strpos; -use function strrpos; -use function substr; -use function trim; -use function unserialize; -use __PHP_Incomplete_Class; -use ErrorException; -use PHPUnit\Framework\AssertionFailedError; -use PHPUnit\Framework\Exception; -use PHPUnit\Framework\SyntheticError; -use PHPUnit\Framework\Test; -use PHPUnit\Framework\TestCase; -use PHPUnit\Framework\TestFailure; -use PHPUnit\Framework\TestResult; -use SebastianBergmann\Environment\Runtime; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -abstract class AbstractPhpProcess -{ - /** - * @var Runtime - */ - protected $runtime; - - /** - * @var bool - */ - protected $stderrRedirection = false; - - /** - * @var string - */ - protected $stdin = ''; - - /** - * @var string - */ - protected $args = ''; - - /** - * @var array - */ - protected $env = []; - - /** - * @var int - */ - protected $timeout = 0; - - public static function factory(): self - { - if (DIRECTORY_SEPARATOR === '\\') { - return new WindowsPhpProcess; - } - - return new DefaultPhpProcess; - } - - public function __construct() - { - $this->runtime = new Runtime; - } - - /** - * Defines if should use STDERR redirection or not. - * - * Then $stderrRedirection is TRUE, STDERR is redirected to STDOUT. - */ - public function setUseStderrRedirection(bool $stderrRedirection): void - { - $this->stderrRedirection = $stderrRedirection; - } - - /** - * Returns TRUE if uses STDERR redirection or FALSE if not. - */ - public function useStderrRedirection(): bool - { - return $this->stderrRedirection; - } - - /** - * Sets the input string to be sent via STDIN. - */ - public function setStdin(string $stdin): void - { - $this->stdin = $stdin; - } - - /** - * Returns the input string to be sent via STDIN. - */ - public function getStdin(): string - { - return $this->stdin; - } - - /** - * Sets the string of arguments to pass to the php job. - */ - public function setArgs(string $args): void - { - $this->args = $args; - } - - /** - * Returns the string of arguments to pass to the php job. - */ - public function getArgs(): string - { - return $this->args; - } - - /** - * Sets the array of environment variables to start the child process with. - * - * @param array $env - */ - public function setEnv(array $env): void - { - $this->env = $env; - } - - /** - * Returns the array of environment variables to start the child process with. - */ - public function getEnv(): array - { - return $this->env; - } - - /** - * Sets the amount of seconds to wait before timing out. - */ - public function setTimeout(int $timeout): void - { - $this->timeout = $timeout; - } - - /** - * Returns the amount of seconds to wait before timing out. - */ - public function getTimeout(): int - { - return $this->timeout; - } - - /** - * Runs a single test in a separate PHP process. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function runTestJob(string $job, Test $test, TestResult $result): void - { - $result->startTest($test); - - $_result = $this->runJob($job); - - $this->processChildResult( - $test, - $result, - $_result['stdout'], - $_result['stderr'] - ); - } - - /** - * Returns the command based into the configurations. - */ - public function getCommand(array $settings, string $file = null): string - { - $command = $this->runtime->getBinary(); - - if ($this->runtime->hasPCOV()) { - $settings = array_merge( - $settings, - $this->runtime->getCurrentSettings( - array_keys(ini_get_all('pcov')) - ) - ); - } elseif ($this->runtime->hasXdebug()) { - $settings = array_merge( - $settings, - $this->runtime->getCurrentSettings( - array_keys(ini_get_all('xdebug')) - ) - ); - } - - $command .= $this->settingsToParameters($settings); - - if (PHP_SAPI === 'phpdbg') { - $command .= ' -qrr'; - - if (!$file) { - $command .= 's='; - } - } - - if ($file) { - $command .= ' ' . escapeshellarg($file); - } - - if ($this->args) { - if (!$file) { - $command .= ' --'; - } - $command .= ' ' . $this->args; - } - - if ($this->stderrRedirection) { - $command .= ' 2>&1'; - } - - return $command; - } - - /** - * Runs a single job (PHP code) using a separate PHP process. - */ - abstract public function runJob(string $job, array $settings = []): array; - - protected function settingsToParameters(array $settings): string - { - $buffer = ''; - - foreach ($settings as $setting) { - $buffer .= ' -d ' . escapeshellarg($setting); - } - - return $buffer; - } - - /** - * Processes the TestResult object from an isolated process. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - private function processChildResult(Test $test, TestResult $result, string $stdout, string $stderr): void - { - $time = 0; - - if (!empty($stderr)) { - $result->addError( - $test, - new Exception(trim($stderr)), - $time - ); - } else { - set_error_handler( - /** - * @throws ErrorException - */ - static function ($errno, $errstr, $errfile, $errline): void - { - throw new ErrorException($errstr, $errno, $errno, $errfile, $errline); - } - ); - - try { - if (strpos($stdout, "#!/usr/bin/env php\n") === 0) { - $stdout = substr($stdout, 19); - } - - $childResult = unserialize(str_replace("#!/usr/bin/env php\n", '', $stdout)); - restore_error_handler(); - - if ($childResult === false) { - $result->addFailure( - $test, - new AssertionFailedError('Test was run in child process and ended unexpectedly'), - $time - ); - } - } catch (ErrorException $e) { - restore_error_handler(); - $childResult = false; - - $result->addError( - $test, - new Exception(trim($stdout), 0, $e), - $time - ); - } - - if ($childResult !== false) { - if (!empty($childResult['output'])) { - $output = $childResult['output']; - } - - /* @var TestCase $test */ - - $test->setResult($childResult['testResult']); - $test->addToAssertionCount($childResult['numAssertions']); - - $childResult = $childResult['result']; - assert($childResult instanceof TestResult); - - if ($result->getCollectCodeCoverageInformation()) { - $result->getCodeCoverage()->merge( - $childResult->getCodeCoverage() - ); - } - - $time = $childResult->time(); - $notImplemented = $childResult->notImplemented(); - $risky = $childResult->risky(); - $skipped = $childResult->skipped(); - $errors = $childResult->errors(); - $warnings = $childResult->warnings(); - $failures = $childResult->failures(); - - if (!empty($notImplemented)) { - $result->addError( - $test, - $this->getException($notImplemented[0]), - $time - ); - } elseif (!empty($risky)) { - $result->addError( - $test, - $this->getException($risky[0]), - $time - ); - } elseif (!empty($skipped)) { - $result->addError( - $test, - $this->getException($skipped[0]), - $time - ); - } elseif (!empty($errors)) { - $result->addError( - $test, - $this->getException($errors[0]), - $time - ); - } elseif (!empty($warnings)) { - $result->addWarning( - $test, - $this->getException($warnings[0]), - $time - ); - } elseif (!empty($failures)) { - $result->addFailure( - $test, - $this->getException($failures[0]), - $time - ); - } - } - } - - $result->endTest($test, $time); - - if (!empty($output)) { - print $output; - } - } - - /** - * Gets the thrown exception from a PHPUnit\Framework\TestFailure. - * - * @see https://github.com/sebastianbergmann/phpunit/issues/74 - */ - private function getException(TestFailure $error): Exception - { - $exception = $error->thrownException(); - - if ($exception instanceof __PHP_Incomplete_Class) { - $exceptionArray = []; - - foreach ((array) $exception as $key => $value) { - $key = substr($key, strrpos($key, "\0") + 1); - $exceptionArray[$key] = $value; - } - - $exception = new SyntheticError( - sprintf( - '%s: %s', - $exceptionArray['_PHP_Incomplete_Class_Name'], - $exceptionArray['message'] - ), - $exceptionArray['code'], - $exceptionArray['file'], - $exceptionArray['line'], - $exceptionArray['trace'] - ); - } - - return $exception; - } -} diff --git a/vendor/phpunit/phpunit/src/Util/PHP/DefaultPhpProcess.php b/vendor/phpunit/phpunit/src/Util/PHP/DefaultPhpProcess.php deleted file mode 100644 index b835043..0000000 --- a/vendor/phpunit/phpunit/src/Util/PHP/DefaultPhpProcess.php +++ /dev/null @@ -1,233 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util\PHP; - -use function array_merge; -use function fclose; -use function file_put_contents; -use function fread; -use function fwrite; -use function is_array; -use function is_resource; -use function proc_close; -use function proc_open; -use function proc_terminate; -use function rewind; -use function sprintf; -use function stream_get_contents; -use function stream_select; -use function sys_get_temp_dir; -use function tempnam; -use function unlink; -use PHPUnit\Framework\Exception; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -class DefaultPhpProcess extends AbstractPhpProcess -{ - /** - * @var string - */ - protected $tempFile; - - /** - * Runs a single job (PHP code) using a separate PHP process. - * - * @throws Exception - */ - public function runJob(string $job, array $settings = []): array - { - if ($this->stdin || $this->useTemporaryFile()) { - if (!($this->tempFile = tempnam(sys_get_temp_dir(), 'PHPUnit')) || - file_put_contents($this->tempFile, $job) === false) { - throw new Exception( - 'Unable to write temporary file' - ); - } - - $job = $this->stdin; - } - - return $this->runProcess($job, $settings); - } - - /** - * Returns an array of file handles to be used in place of pipes. - */ - protected function getHandles(): array - { - return []; - } - - /** - * Handles creating the child process and returning the STDOUT and STDERR. - * - * @throws Exception - */ - protected function runProcess(string $job, array $settings): array - { - $handles = $this->getHandles(); - - $env = null; - - if ($this->env) { - $env = $_SERVER ?? []; - unset($env['argv'], $env['argc']); - $env = array_merge($env, $this->env); - - foreach ($env as $envKey => $envVar) { - if (is_array($envVar)) { - unset($env[$envKey]); - } - } - } - - $pipeSpec = [ - 0 => $handles[0] ?? ['pipe', 'r'], - 1 => $handles[1] ?? ['pipe', 'w'], - 2 => $handles[2] ?? ['pipe', 'w'], - ]; - - $process = proc_open( - $this->getCommand($settings, $this->tempFile), - $pipeSpec, - $pipes, - null, - $env - ); - - if (!is_resource($process)) { - throw new Exception( - 'Unable to spawn worker process' - ); - } - - if ($job) { - $this->process($pipes[0], $job); - } - - fclose($pipes[0]); - - $stderr = $stdout = ''; - - if ($this->timeout) { - unset($pipes[0]); - - while (true) { - $r = $pipes; - $w = null; - $e = null; - - $n = @stream_select($r, $w, $e, $this->timeout); - - if ($n === false) { - break; - } - - if ($n === 0) { - proc_terminate($process, 9); - - throw new Exception( - sprintf( - 'Job execution aborted after %d seconds', - $this->timeout - ) - ); - } - - if ($n > 0) { - foreach ($r as $pipe) { - $pipeOffset = 0; - - foreach ($pipes as $i => $origPipe) { - if ($pipe === $origPipe) { - $pipeOffset = $i; - - break; - } - } - - if (!$pipeOffset) { - break; - } - - $line = fread($pipe, 8192); - - if ($line === '' || $line === false) { - fclose($pipes[$pipeOffset]); - - unset($pipes[$pipeOffset]); - } elseif ($pipeOffset === 1) { - $stdout .= $line; - } else { - $stderr .= $line; - } - } - - if (empty($pipes)) { - break; - } - } - } - } else { - if (isset($pipes[1])) { - $stdout = stream_get_contents($pipes[1]); - - fclose($pipes[1]); - } - - if (isset($pipes[2])) { - $stderr = stream_get_contents($pipes[2]); - - fclose($pipes[2]); - } - } - - if (isset($handles[1])) { - rewind($handles[1]); - - $stdout = stream_get_contents($handles[1]); - - fclose($handles[1]); - } - - if (isset($handles[2])) { - rewind($handles[2]); - - $stderr = stream_get_contents($handles[2]); - - fclose($handles[2]); - } - - proc_close($process); - - $this->cleanup(); - - return ['stdout' => $stdout, 'stderr' => $stderr]; - } - - protected function process($pipe, string $job): void - { - fwrite($pipe, $job); - } - - protected function cleanup(): void - { - if ($this->tempFile) { - unlink($this->tempFile); - } - } - - protected function useTemporaryFile(): bool - { - return false; - } -} diff --git a/vendor/phpunit/phpunit/src/Util/PHP/Template/PhptTestCase.tpl b/vendor/phpunit/phpunit/src/Util/PHP/Template/PhptTestCase.tpl deleted file mode 100644 index 14c3e7e..0000000 --- a/vendor/phpunit/phpunit/src/Util/PHP/Template/PhptTestCase.tpl +++ /dev/null @@ -1,40 +0,0 @@ -start(__FILE__); -} - -register_shutdown_function(function() use ($coverage) { - $output = null; - if ($coverage) { - $output = $coverage->stop(); - } - file_put_contents('{coverageFile}', serialize($output)); -}); - -ob_end_clean(); - -require '{job}'; diff --git a/vendor/phpunit/phpunit/src/Util/PHP/Template/TestCaseClass.tpl b/vendor/phpunit/phpunit/src/Util/PHP/Template/TestCaseClass.tpl deleted file mode 100644 index 5d2ea02..0000000 --- a/vendor/phpunit/phpunit/src/Util/PHP/Template/TestCaseClass.tpl +++ /dev/null @@ -1,108 +0,0 @@ -setCodeCoverage( - new CodeCoverage( - null, - unserialize('{codeCoverageFilter}') - ) - ); - } - - $result->beStrictAboutTestsThatDoNotTestAnything({isStrictAboutTestsThatDoNotTestAnything}); - $result->beStrictAboutOutputDuringTests({isStrictAboutOutputDuringTests}); - $result->enforceTimeLimit({enforcesTimeLimit}); - $result->beStrictAboutTodoAnnotatedTests({isStrictAboutTodoAnnotatedTests}); - $result->beStrictAboutResourceUsageDuringSmallTests({isStrictAboutResourceUsageDuringSmallTests}); - - $test = new {className}('{name}', unserialize('{data}'), '{dataName}'); - $test->setDependencyInput(unserialize('{dependencyInput}')); - $test->setInIsolation(TRUE); - - ob_end_clean(); - $test->run($result); - $output = ''; - if (!$test->hasExpectationOnOutput()) { - $output = $test->getActualOutput(); - } - - ini_set('xdebug.scream', '0'); - @rewind(STDOUT); /* @ as not every STDOUT target stream is rewindable */ - if ($stdout = @stream_get_contents(STDOUT)) { - $output = $stdout . $output; - $streamMetaData = stream_get_meta_data(STDOUT); - if (!empty($streamMetaData['stream_type']) && 'STDIO' === $streamMetaData['stream_type']) { - @ftruncate(STDOUT, 0); - @rewind(STDOUT); - } - } - - print serialize( - [ - 'testResult' => $test->getResult(), - 'numAssertions' => $test->getNumAssertions(), - 'result' => $result, - 'output' => $output - ] - ); -} - -$configurationFilePath = '{configurationFilePath}'; - -if ('' !== $configurationFilePath) { - $configuration = PHPUnit\Util\Configuration::getInstance($configurationFilePath); - $configuration->handlePHPConfiguration(); - unset($configuration); -} - -function __phpunit_error_handler($errno, $errstr, $errfile, $errline) -{ - return true; -} - -set_error_handler('__phpunit_error_handler'); - -{constants} -{included_files} -{globals} - -restore_error_handler(); - -if (isset($GLOBALS['__PHPUNIT_BOOTSTRAP'])) { - require_once $GLOBALS['__PHPUNIT_BOOTSTRAP']; - unset($GLOBALS['__PHPUNIT_BOOTSTRAP']); -} - -__phpunit_run_isolated_test(); diff --git a/vendor/phpunit/phpunit/src/Util/PHP/Template/TestCaseMethod.tpl b/vendor/phpunit/phpunit/src/Util/PHP/Template/TestCaseMethod.tpl deleted file mode 100644 index 9dd6c92..0000000 --- a/vendor/phpunit/phpunit/src/Util/PHP/Template/TestCaseMethod.tpl +++ /dev/null @@ -1,111 +0,0 @@ -setCodeCoverage( - new CodeCoverage( - null, - unserialize('{codeCoverageFilter}') - ) - ); - } - - $result->beStrictAboutTestsThatDoNotTestAnything({isStrictAboutTestsThatDoNotTestAnything}); - $result->beStrictAboutOutputDuringTests({isStrictAboutOutputDuringTests}); - $result->enforceTimeLimit({enforcesTimeLimit}); - $result->beStrictAboutTodoAnnotatedTests({isStrictAboutTodoAnnotatedTests}); - $result->beStrictAboutResourceUsageDuringSmallTests({isStrictAboutResourceUsageDuringSmallTests}); - - $test = new {className}('{methodName}', unserialize('{data}'), '{dataName}'); - \assert($test instanceof TestCase); - - $test->setDependencyInput(unserialize('{dependencyInput}')); - $test->setInIsolation(true); - - ob_end_clean(); - $test->run($result); - $output = ''; - if (!$test->hasExpectationOnOutput()) { - $output = $test->getActualOutput(); - } - - ini_set('xdebug.scream', '0'); - @rewind(STDOUT); /* @ as not every STDOUT target stream is rewindable */ - if ($stdout = @stream_get_contents(STDOUT)) { - $output = $stdout . $output; - $streamMetaData = stream_get_meta_data(STDOUT); - if (!empty($streamMetaData['stream_type']) && 'STDIO' === $streamMetaData['stream_type']) { - @ftruncate(STDOUT, 0); - @rewind(STDOUT); - } - } - - print serialize( - [ - 'testResult' => $test->getResult(), - 'numAssertions' => $test->getNumAssertions(), - 'result' => $result, - 'output' => $output - ] - ); -} - -$configurationFilePath = '{configurationFilePath}'; - -if ('' !== $configurationFilePath) { - $configuration = PHPUnit\Util\Configuration::getInstance($configurationFilePath); - $configuration->handlePHPConfiguration(); - unset($configuration); -} - -function __phpunit_error_handler($errno, $errstr, $errfile, $errline) -{ - return true; -} - -set_error_handler('__phpunit_error_handler'); - -{constants} -{included_files} -{globals} - -restore_error_handler(); - -if (isset($GLOBALS['__PHPUNIT_BOOTSTRAP'])) { - require_once $GLOBALS['__PHPUNIT_BOOTSTRAP']; - unset($GLOBALS['__PHPUNIT_BOOTSTRAP']); -} - -__phpunit_run_isolated_test(); diff --git a/vendor/phpunit/phpunit/src/Util/PHP/WindowsPhpProcess.php b/vendor/phpunit/phpunit/src/Util/PHP/WindowsPhpProcess.php deleted file mode 100644 index 9ef9255..0000000 --- a/vendor/phpunit/phpunit/src/Util/PHP/WindowsPhpProcess.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util\PHP; - -use const PHP_MAJOR_VERSION; -use function tmpfile; -use PHPUnit\Framework\Exception; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @see https://bugs.php.net/bug.php?id=51800 - */ -final class WindowsPhpProcess extends DefaultPhpProcess -{ - public function getCommand(array $settings, string $file = null): string - { - if (PHP_MAJOR_VERSION < 8) { - return '"' . parent::getCommand($settings, $file) . '"'; - } - - return parent::getCommand($settings, $file); - } - - /** - * @throws Exception - */ - protected function getHandles(): array - { - if (false === $stdout_handle = tmpfile()) { - throw new Exception( - 'A temporary file could not be created; verify that your TEMP environment variable is writable' - ); - } - - return [ - 1 => $stdout_handle, - ]; - } - - protected function useTemporaryFile(): bool - { - return true; - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Printer.php b/vendor/phpunit/phpunit/src/Util/Printer.php deleted file mode 100644 index c99abfe..0000000 --- a/vendor/phpunit/phpunit/src/Util/Printer.php +++ /dev/null @@ -1,164 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util; - -use const ENT_SUBSTITUTE; -use const PHP_SAPI; -use function assert; -use function count; -use function dirname; -use function explode; -use function fclose; -use function fflush; -use function flush; -use function fopen; -use function fsockopen; -use function fwrite; -use function htmlspecialchars; -use function is_resource; -use function is_string; -use function sprintf; -use function str_replace; -use function strncmp; -use function strpos; -use PHPUnit\Framework\Exception; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -class Printer -{ - /** - * If true, flush output after every write. - * - * @var bool - */ - protected $autoFlush = false; - - /** - * @psalm-var resource|closed-resource - */ - protected $out; - - /** - * @var string - */ - protected $outTarget; - - /** - * Constructor. - * - * @param null|resource|string $out - * - * @throws Exception - */ - public function __construct($out = null) - { - if ($out === null) { - return; - } - - if (is_string($out) === false) { - $this->out = $out; - - return; - } - - if (strpos($out, 'socket://') === 0) { - $out = explode(':', str_replace('socket://', '', $out)); - - if (count($out) !== 2) { - throw new Exception; - } - - $this->out = fsockopen($out[0], $out[1]); - } else { - if (strpos($out, 'php://') === false && !Filesystem::createDirectory(dirname($out))) { - throw new Exception(sprintf('Directory "%s" was not created', dirname($out))); - } - - $this->out = fopen($out, 'wt'); - } - - $this->outTarget = $out; - } - - /** - * Flush buffer and close output if it's not to a PHP stream. - */ - public function flush(): void - { - if ($this->out && strncmp($this->outTarget, 'php://', 6) !== 0) { - assert(is_resource($this->out)); - - fclose($this->out); - } - } - - /** - * Performs a safe, incremental flush. - * - * Do not confuse this function with the flush() function of this class, - * since the flush() function may close the file being written to, rendering - * the current object no longer usable. - */ - public function incrementalFlush(): void - { - if ($this->out) { - assert(is_resource($this->out)); - - fflush($this->out); - } else { - flush(); - } - } - - public function write(string $buffer): void - { - if ($this->out) { - assert(is_resource($this->out)); - - fwrite($this->out, $buffer); - - if ($this->autoFlush) { - $this->incrementalFlush(); - } - } else { - if (PHP_SAPI !== 'cli' && PHP_SAPI !== 'phpdbg') { - $buffer = htmlspecialchars($buffer, ENT_SUBSTITUTE); - } - - print $buffer; - - if ($this->autoFlush) { - $this->incrementalFlush(); - } - } - } - - /** - * Check auto-flush mode. - */ - public function getAutoFlush(): bool - { - return $this->autoFlush; - } - - /** - * Set auto-flushing mode. - * - * If set, *incremental* flushes will be done after each write. This should - * not be confused with the different effects of this class' flush() method. - */ - public function setAutoFlush(bool $autoFlush): void - { - $this->autoFlush = $autoFlush; - } -} diff --git a/vendor/phpunit/phpunit/src/Util/RegularExpression.php b/vendor/phpunit/phpunit/src/Util/RegularExpression.php deleted file mode 100644 index db1dae9..0000000 --- a/vendor/phpunit/phpunit/src/Util/RegularExpression.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util; - -use function preg_match; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class RegularExpression -{ - /** - * @return false|int - */ - public static function safeMatch(string $pattern, string $subject) - { - return ErrorHandler::invokeIgnoringWarnings( - static function () use ($pattern, $subject) - { - return preg_match($pattern, $subject); - } - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Test.php b/vendor/phpunit/phpunit/src/Util/Test.php deleted file mode 100644 index 4d0e79d..0000000 --- a/vendor/phpunit/phpunit/src/Util/Test.php +++ /dev/null @@ -1,934 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util; - -use const PHP_OS; -use const PHP_VERSION; -use function addcslashes; -use function array_flip; -use function array_key_exists; -use function array_keys; -use function array_merge; -use function array_unique; -use function array_unshift; -use function class_exists; -use function class_implements; -use function class_parents; -use function count; -use function explode; -use function extension_loaded; -use function function_exists; -use function get_class; -use function ini_get; -use function interface_exists; -use function is_array; -use function is_int; -use function method_exists; -use function phpversion; -use function preg_match; -use function preg_replace; -use function range; -use function sprintf; -use function str_replace; -use function strncmp; -use function strpos; -use function trait_exists; -use function version_compare; -use PHPUnit\Framework\Assert; -use PHPUnit\Framework\CodeCoverageException; -use PHPUnit\Framework\InvalidCoversTargetException; -use PHPUnit\Framework\SelfDescribing; -use PHPUnit\Framework\TestCase; -use PHPUnit\Framework\Warning; -use PHPUnit\Runner\Version; -use PHPUnit\Util\Annotation\Registry; -use ReflectionClass; -use ReflectionException; -use ReflectionFunction; -use ReflectionMethod; -use SebastianBergmann\Environment\OperatingSystem; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Test -{ - /** - * @var int - */ - public const UNKNOWN = -1; - - /** - * @var int - */ - public const SMALL = 0; - - /** - * @var int - */ - public const MEDIUM = 1; - - /** - * @var int - */ - public const LARGE = 2; - - /** - * @var array - */ - private static $hookMethods = []; - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public static function describe(\PHPUnit\Framework\Test $test): array - { - if ($test instanceof TestCase) { - return [get_class($test), $test->getName()]; - } - - if ($test instanceof SelfDescribing) { - return ['', $test->toString()]; - } - - return ['', get_class($test)]; - } - - public static function describeAsString(\PHPUnit\Framework\Test $test): string - { - if ($test instanceof SelfDescribing) { - return $test->toString(); - } - - return get_class($test); - } - - /** - * @throws CodeCoverageException - * - * @return array|bool - * @psalm-param class-string $className - */ - public static function getLinesToBeCovered(string $className, string $methodName) - { - $annotations = self::parseTestMethodAnnotations( - $className, - $methodName - ); - - if (!self::shouldCoversAnnotationBeUsed($annotations)) { - return false; - } - - return self::getLinesToBeCoveredOrUsed($className, $methodName, 'covers'); - } - - /** - * Returns lines of code specified with the @uses annotation. - * - * @throws CodeCoverageException - * @psalm-param class-string $className - */ - public static function getLinesToBeUsed(string $className, string $methodName): array - { - return self::getLinesToBeCoveredOrUsed($className, $methodName, 'uses'); - } - - public static function requiresCodeCoverageDataCollection(TestCase $test): bool - { - $annotations = $test->getAnnotations(); - - // If there is no @covers annotation but a @coversNothing annotation on - // the test method then code coverage data does not need to be collected - if (isset($annotations['method']['coversNothing'])) { - return false; - } - - // If there is at least one @covers annotation then - // code coverage data needs to be collected - if (isset($annotations['method']['covers'])) { - return true; - } - - // If there is no @covers annotation but a @coversNothing annotation - // then code coverage data does not need to be collected - if (isset($annotations['class']['coversNothing'])) { - return false; - } - - // If there is no @coversNothing annotation then - // code coverage data may be collected - return true; - } - - /** - * @throws Exception - * @psalm-param class-string $className - */ - public static function getRequirements(string $className, string $methodName): array - { - return self::mergeArraysRecursively( - Registry::getInstance()->forClassName($className)->requirements(), - Registry::getInstance()->forMethod($className, $methodName)->requirements() - ); - } - - /** - * Returns the missing requirements for a test. - * - * @throws Exception - * @throws Warning - * @psalm-param class-string $className - */ - public static function getMissingRequirements(string $className, string $methodName): array - { - $required = self::getRequirements($className, $methodName); - $missing = []; - $hint = null; - - if (!empty($required['PHP'])) { - $operator = new VersionComparisonOperator(empty($required['PHP']['operator']) ? '>=' : $required['PHP']['operator']); - - if (!version_compare(PHP_VERSION, $required['PHP']['version'], $operator->asString())) { - $missing[] = sprintf('PHP %s %s is required.', $operator->asString(), $required['PHP']['version']); - $hint = 'PHP'; - } - } elseif (!empty($required['PHP_constraint'])) { - $version = new \PharIo\Version\Version(self::sanitizeVersionNumber(PHP_VERSION)); - - if (!$required['PHP_constraint']['constraint']->complies($version)) { - $missing[] = sprintf( - 'PHP version does not match the required constraint %s.', - $required['PHP_constraint']['constraint']->asString() - ); - - $hint = 'PHP_constraint'; - } - } - - if (!empty($required['PHPUnit'])) { - $phpunitVersion = Version::id(); - - $operator = new VersionComparisonOperator(empty($required['PHPUnit']['operator']) ? '>=' : $required['PHPUnit']['operator']); - - if (!version_compare($phpunitVersion, $required['PHPUnit']['version'], $operator->asString())) { - $missing[] = sprintf('PHPUnit %s %s is required.', $operator->asString(), $required['PHPUnit']['version']); - $hint = $hint ?? 'PHPUnit'; - } - } elseif (!empty($required['PHPUnit_constraint'])) { - $phpunitVersion = new \PharIo\Version\Version(self::sanitizeVersionNumber(Version::id())); - - if (!$required['PHPUnit_constraint']['constraint']->complies($phpunitVersion)) { - $missing[] = sprintf( - 'PHPUnit version does not match the required constraint %s.', - $required['PHPUnit_constraint']['constraint']->asString() - ); - - $hint = $hint ?? 'PHPUnit_constraint'; - } - } - - if (!empty($required['OSFAMILY']) && $required['OSFAMILY'] !== (new OperatingSystem)->getFamily()) { - $missing[] = sprintf('Operating system %s is required.', $required['OSFAMILY']); - $hint = $hint ?? 'OSFAMILY'; - } - - if (!empty($required['OS'])) { - $requiredOsPattern = sprintf('/%s/i', addcslashes($required['OS'], '/')); - - if (!preg_match($requiredOsPattern, PHP_OS)) { - $missing[] = sprintf('Operating system matching %s is required.', $requiredOsPattern); - $hint = $hint ?? 'OS'; - } - } - - if (!empty($required['functions'])) { - foreach ($required['functions'] as $function) { - $pieces = explode('::', $function); - - if (count($pieces) === 2 && class_exists($pieces[0]) && method_exists($pieces[0], $pieces[1])) { - continue; - } - - if (function_exists($function)) { - continue; - } - - $missing[] = sprintf('Function %s is required.', $function); - $hint = $hint ?? 'function_' . $function; - } - } - - if (!empty($required['setting'])) { - foreach ($required['setting'] as $setting => $value) { - if (ini_get($setting) !== $value) { - $missing[] = sprintf('Setting "%s" must be "%s".', $setting, $value); - $hint = $hint ?? '__SETTING_' . $setting; - } - } - } - - if (!empty($required['extensions'])) { - foreach ($required['extensions'] as $extension) { - if (isset($required['extension_versions'][$extension])) { - continue; - } - - if (!extension_loaded($extension)) { - $missing[] = sprintf('Extension %s is required.', $extension); - $hint = $hint ?? 'extension_' . $extension; - } - } - } - - if (!empty($required['extension_versions'])) { - foreach ($required['extension_versions'] as $extension => $req) { - $actualVersion = phpversion($extension); - - $operator = new VersionComparisonOperator(empty($req['operator']) ? '>=' : $req['operator']); - - if ($actualVersion === false || !version_compare($actualVersion, $req['version'], $operator->asString())) { - $missing[] = sprintf('Extension %s %s %s is required.', $extension, $operator->asString(), $req['version']); - $hint = $hint ?? 'extension_' . $extension; - } - } - } - - if ($hint && isset($required['__OFFSET'])) { - array_unshift($missing, '__OFFSET_FILE=' . $required['__OFFSET']['__FILE']); - array_unshift($missing, '__OFFSET_LINE=' . ($required['__OFFSET'][$hint] ?? 1)); - } - - return $missing; - } - - /** - * Returns the expected exception for a test. - * - * @return array|false - * - * @deprecated - * @codeCoverageIgnore - * @psalm-param class-string $className - */ - public static function getExpectedException(string $className, string $methodName) - { - return Registry::getInstance()->forMethod($className, $methodName)->expectedException(); - } - - /** - * Returns the provided data for a method. - * - * @throws Exception - * @psalm-param class-string $className - */ - public static function getProvidedData(string $className, string $methodName): ?array - { - return Registry::getInstance()->forMethod($className, $methodName)->getProvidedData(); - } - - /** - * @psalm-param class-string $className - */ - public static function parseTestMethodAnnotations(string $className, ?string $methodName = ''): array - { - $registry = Registry::getInstance(); - - if ($methodName !== null) { - try { - return [ - 'method' => $registry->forMethod($className, $methodName)->symbolAnnotations(), - 'class' => $registry->forClassName($className)->symbolAnnotations(), - ]; - } catch (Exception $methodNotFound) { - // ignored - } - } - - return [ - 'method' => null, - 'class' => $registry->forClassName($className)->symbolAnnotations(), - ]; - } - - /** - * @psalm-param class-string $className - */ - public static function getInlineAnnotations(string $className, string $methodName): array - { - return Registry::getInstance()->forMethod($className, $methodName)->getInlineAnnotations(); - } - - /** @psalm-param class-string $className */ - public static function getBackupSettings(string $className, string $methodName): array - { - return [ - 'backupGlobals' => self::getBooleanAnnotationSetting( - $className, - $methodName, - 'backupGlobals' - ), - 'backupStaticAttributes' => self::getBooleanAnnotationSetting( - $className, - $methodName, - 'backupStaticAttributes' - ), - ]; - } - - /** @psalm-param class-string $className */ - public static function getDependencies(string $className, string $methodName): array - { - $annotations = self::parseTestMethodAnnotations( - $className, - $methodName - ); - - $dependencies = $annotations['class']['depends'] ?? []; - - if (isset($annotations['method']['depends'])) { - $dependencies = array_merge( - $dependencies, - $annotations['method']['depends'] - ); - } - - return array_unique($dependencies); - } - - /** @psalm-param class-string $className */ - public static function getGroups(string $className, ?string $methodName = ''): array - { - $annotations = self::parseTestMethodAnnotations( - $className, - $methodName - ); - - $groups = []; - - if (isset($annotations['method']['author'])) { - $groups[] = $annotations['method']['author']; - } elseif (isset($annotations['class']['author'])) { - $groups[] = $annotations['class']['author']; - } - - if (isset($annotations['class']['group'])) { - $groups[] = $annotations['class']['group']; - } - - if (isset($annotations['method']['group'])) { - $groups[] = $annotations['method']['group']; - } - - if (isset($annotations['class']['ticket'])) { - $groups[] = $annotations['class']['ticket']; - } - - if (isset($annotations['method']['ticket'])) { - $groups[] = $annotations['method']['ticket']; - } - - foreach (['method', 'class'] as $element) { - foreach (['small', 'medium', 'large'] as $size) { - if (isset($annotations[$element][$size])) { - $groups[] = [$size]; - - break 2; - } - } - } - - return array_unique(array_merge([], ...$groups)); - } - - /** @psalm-param class-string $className */ - public static function getSize(string $className, ?string $methodName): int - { - $groups = array_flip(self::getGroups($className, $methodName)); - - if (isset($groups['large'])) { - return self::LARGE; - } - - if (isset($groups['medium'])) { - return self::MEDIUM; - } - - if (isset($groups['small'])) { - return self::SMALL; - } - - return self::UNKNOWN; - } - - /** @psalm-param class-string $className */ - public static function getProcessIsolationSettings(string $className, string $methodName): bool - { - $annotations = self::parseTestMethodAnnotations( - $className, - $methodName - ); - - return isset($annotations['class']['runTestsInSeparateProcesses']) || isset($annotations['method']['runInSeparateProcess']); - } - - /** @psalm-param class-string $className */ - public static function getClassProcessIsolationSettings(string $className, string $methodName): bool - { - $annotations = self::parseTestMethodAnnotations( - $className, - $methodName - ); - - return isset($annotations['class']['runClassInSeparateProcess']); - } - - /** @psalm-param class-string $className */ - public static function getPreserveGlobalStateSettings(string $className, string $methodName): ?bool - { - return self::getBooleanAnnotationSetting( - $className, - $methodName, - 'preserveGlobalState' - ); - } - - /** @psalm-param class-string $className */ - public static function getHookMethods(string $className): array - { - if (!class_exists($className, false)) { - return self::emptyHookMethodsArray(); - } - - if (!isset(self::$hookMethods[$className])) { - self::$hookMethods[$className] = self::emptyHookMethodsArray(); - - try { - foreach ((new ReflectionClass($className))->getMethods() as $method) { - if ($method->getDeclaringClass()->getName() === Assert::class) { - continue; - } - - if ($method->getDeclaringClass()->getName() === TestCase::class) { - continue; - } - - $docBlock = Registry::getInstance()->forMethod($className, $method->getName()); - - if ($method->isStatic()) { - if ($docBlock->isHookToBeExecutedBeforeClass()) { - array_unshift( - self::$hookMethods[$className]['beforeClass'], - $method->getName() - ); - } - - if ($docBlock->isHookToBeExecutedAfterClass()) { - self::$hookMethods[$className]['afterClass'][] = $method->getName(); - } - } - - if ($docBlock->isToBeExecutedBeforeTest()) { - array_unshift( - self::$hookMethods[$className]['before'], - $method->getName() - ); - } - - if ($docBlock->isToBeExecutedAfterTest()) { - self::$hookMethods[$className]['after'][] = $method->getName(); - } - } - } catch (ReflectionException $e) { - } - } - - return self::$hookMethods[$className]; - } - - public static function isTestMethod(ReflectionMethod $method): bool - { - if (!$method->isPublic()) { - return false; - } - - if (strpos($method->getName(), 'test') === 0) { - return true; - } - - return array_key_exists( - 'test', - Registry::getInstance()->forMethod( - $method->getDeclaringClass()->getName(), - $method->getName() - ) - ->symbolAnnotations() - ); - } - - /** - * @throws CodeCoverageException - * @psalm-param class-string $className - */ - private static function getLinesToBeCoveredOrUsed(string $className, string $methodName, string $mode): array - { - $annotations = self::parseTestMethodAnnotations( - $className, - $methodName - ); - - $classShortcut = null; - - if (!empty($annotations['class'][$mode . 'DefaultClass'])) { - if (count($annotations['class'][$mode . 'DefaultClass']) > 1) { - throw new CodeCoverageException( - sprintf( - 'More than one @%sClass annotation in class or interface "%s".', - $mode, - $className - ) - ); - } - - $classShortcut = $annotations['class'][$mode . 'DefaultClass'][0]; - } - - $list = $annotations['class'][$mode] ?? []; - - if (isset($annotations['method'][$mode])) { - $list = array_merge($list, $annotations['method'][$mode]); - } - - $codeList = []; - - foreach (array_unique($list) as $element) { - if ($classShortcut && strncmp($element, '::', 2) === 0) { - $element = $classShortcut . $element; - } - - $element = preg_replace('/[\s()]+$/', '', $element); - $element = explode(' ', $element); - $element = $element[0]; - - if ($mode === 'covers' && interface_exists($element)) { - throw new InvalidCoversTargetException( - sprintf( - 'Trying to @cover interface "%s".', - $element - ) - ); - } - - $codeList[] = self::resolveElementToReflectionObjects($element); - } - - return self::resolveReflectionObjectsToLines(array_merge([], ...$codeList)); - } - - private static function emptyHookMethodsArray(): array - { - return [ - 'beforeClass' => ['setUpBeforeClass'], - 'before' => ['setUp'], - 'after' => ['tearDown'], - 'afterClass' => ['tearDownAfterClass'], - ]; - } - - /** @psalm-param class-string $className */ - private static function getBooleanAnnotationSetting(string $className, ?string $methodName, string $settingName): ?bool - { - $annotations = self::parseTestMethodAnnotations( - $className, - $methodName - ); - - if (isset($annotations['method'][$settingName])) { - if ($annotations['method'][$settingName][0] === 'enabled') { - return true; - } - - if ($annotations['method'][$settingName][0] === 'disabled') { - return false; - } - } - - if (isset($annotations['class'][$settingName])) { - if ($annotations['class'][$settingName][0] === 'enabled') { - return true; - } - - if ($annotations['class'][$settingName][0] === 'disabled') { - return false; - } - } - - return null; - } - - /** - * @throws InvalidCoversTargetException - */ - private static function resolveElementToReflectionObjects(string $element): array - { - $codeToCoverList = []; - - if (function_exists($element) && strpos($element, '\\') !== false) { - try { - $codeToCoverList[] = new ReflectionFunction($element); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - } elseif (strpos($element, '::') !== false) { - [$className, $methodName] = explode('::', $element); - - if (isset($methodName[0]) && $methodName[0] === '<') { - $classes = [$className]; - - foreach ($classes as $className) { - if (!class_exists($className) && - !interface_exists($className) && - !trait_exists($className)) { - throw new InvalidCoversTargetException( - sprintf( - 'Trying to @cover or @use not existing class or ' . - 'interface "%s".', - $className - ) - ); - } - - try { - $methods = (new ReflectionClass($className))->getMethods(); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - $inverse = isset($methodName[1]) && $methodName[1] === '!'; - $visibility = 'isPublic'; - - if (strpos($methodName, 'protected')) { - $visibility = 'isProtected'; - } elseif (strpos($methodName, 'private')) { - $visibility = 'isPrivate'; - } - - foreach ($methods as $method) { - if ($inverse && !$method->{$visibility}()) { - $codeToCoverList[] = $method; - } elseif (!$inverse && $method->{$visibility}()) { - $codeToCoverList[] = $method; - } - } - } - } else { - $classes = [$className]; - - foreach ($classes as $className) { - if ($className === '' && function_exists($methodName)) { - try { - $codeToCoverList[] = new ReflectionFunction( - $methodName - ); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - } else { - if (!((class_exists($className) || interface_exists($className) || trait_exists($className)) && - method_exists($className, $methodName))) { - throw new InvalidCoversTargetException( - sprintf( - 'Trying to @cover or @use not existing method "%s::%s".', - $className, - $methodName - ) - ); - } - - try { - $codeToCoverList[] = new ReflectionMethod( - $className, - $methodName - ); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - } - } - } - } else { - $extended = false; - - if (strpos($element, '') !== false) { - $element = str_replace('', '', $element); - $extended = true; - } - - $classes = [$element]; - - if ($extended) { - $classes = array_merge( - $classes, - class_implements($element), - class_parents($element) - ); - } - - foreach ($classes as $className) { - if (!class_exists($className) && - !interface_exists($className) && - !trait_exists($className)) { - throw new InvalidCoversTargetException( - sprintf( - 'Trying to @cover or @use not existing class or ' . - 'interface "%s".', - $className - ) - ); - } - - try { - $codeToCoverList[] = new ReflectionClass($className); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - } - } - - return $codeToCoverList; - } - - private static function resolveReflectionObjectsToLines(array $reflectors): array - { - $result = []; - - foreach ($reflectors as $reflector) { - if ($reflector instanceof ReflectionClass) { - foreach ($reflector->getTraits() as $trait) { - $reflectors[] = $trait; - } - } - } - - foreach ($reflectors as $reflector) { - $filename = $reflector->getFileName(); - - if (!isset($result[$filename])) { - $result[$filename] = []; - } - - $result[$filename] = array_merge( - $result[$filename], - range($reflector->getStartLine(), $reflector->getEndLine()) - ); - } - - foreach ($result as $filename => $lineNumbers) { - $result[$filename] = array_keys(array_flip($lineNumbers)); - } - - return $result; - } - - /** - * Trims any extensions from version string that follows after - * the .[.] format. - */ - private static function sanitizeVersionNumber(string $version) - { - return preg_replace( - '/^(\d+\.\d+(?:.\d+)?).*$/', - '$1', - $version - ); - } - - private static function shouldCoversAnnotationBeUsed(array $annotations): bool - { - if (isset($annotations['method']['coversNothing'])) { - return false; - } - - if (isset($annotations['method']['covers'])) { - return true; - } - - if (isset($annotations['class']['coversNothing'])) { - return false; - } - - return true; - } - - /** - * Merge two arrays together. - * - * If an integer key exists in both arrays and preserveNumericKeys is false, the value - * from the second array will be appended to the first array. If both values are arrays, they - * are merged together, else the value of the second array overwrites the one of the first array. - * - * This implementation is copied from https://github.com/zendframework/zend-stdlib/blob/76b653c5e99b40eccf5966e3122c90615134ae46/src/ArrayUtils.php - * - * Zend Framework (http://framework.zend.com/) - * - * @see http://github.com/zendframework/zf2 for the canonical source repository - * - * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License - */ - private static function mergeArraysRecursively(array $a, array $b): array - { - foreach ($b as $key => $value) { - if (array_key_exists($key, $a)) { - if (is_int($key)) { - $a[] = $value; - } elseif (is_array($value) && is_array($a[$key])) { - $a[$key] = self::mergeArraysRecursively($a[$key], $value); - } else { - $a[$key] = $value; - } - } else { - $a[$key] = $value; - } - } - - return $a; - } -} diff --git a/vendor/phpunit/phpunit/src/Util/TestDox/CliTestDoxPrinter.php b/vendor/phpunit/phpunit/src/Util/TestDox/CliTestDoxPrinter.php deleted file mode 100644 index 5c66211..0000000 --- a/vendor/phpunit/phpunit/src/Util/TestDox/CliTestDoxPrinter.php +++ /dev/null @@ -1,366 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util\TestDox; - -use const PHP_EOL; -use function array_map; -use function ceil; -use function count; -use function explode; -use function get_class; -use function implode; -use function preg_match; -use function sprintf; -use function strlen; -use function strpos; -use function trim; -use PHPUnit\Framework\Test; -use PHPUnit\Framework\TestCase; -use PHPUnit\Framework\TestResult; -use PHPUnit\Runner\BaseTestRunner; -use PHPUnit\Runner\PhptTestCase; -use PHPUnit\Util\Color; -use SebastianBergmann\Timer\Timer; -use Throwable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -class CliTestDoxPrinter extends TestDoxPrinter -{ - /** - * The default Testdox left margin for messages is a vertical line. - */ - private const PREFIX_SIMPLE = [ - 'default' => '│', - 'start' => '│', - 'message' => '│', - 'diff' => '│', - 'trace' => '│', - 'last' => '│', - ]; - - /** - * Colored Testdox use box-drawing for a more textured map of the message. - */ - private const PREFIX_DECORATED = [ - 'default' => '│', - 'start' => '┐', - 'message' => '├', - 'diff' => '┊', - 'trace' => '╵', - 'last' => '┴', - ]; - - private const SPINNER_ICONS = [ - " \e[36m◐\e[0m running tests", - " \e[36m◓\e[0m running tests", - " \e[36m◑\e[0m running tests", - " \e[36m◒\e[0m running tests", - ]; - - private const STATUS_STYLES = [ - BaseTestRunner::STATUS_PASSED => [ - 'symbol' => '✔', - 'color' => 'fg-green', - ], - BaseTestRunner::STATUS_ERROR => [ - 'symbol' => '✘', - 'color' => 'fg-yellow', - 'message' => 'bg-yellow,fg-black', - ], - BaseTestRunner::STATUS_FAILURE => [ - 'symbol' => '✘', - 'color' => 'fg-red', - 'message' => 'bg-red,fg-white', - ], - BaseTestRunner::STATUS_SKIPPED => [ - 'symbol' => '↩', - 'color' => 'fg-cyan', - 'message' => 'fg-cyan', - ], - BaseTestRunner::STATUS_RISKY => [ - 'symbol' => '☢', - 'color' => 'fg-yellow', - 'message' => 'fg-yellow', - ], - BaseTestRunner::STATUS_INCOMPLETE => [ - 'symbol' => '∅', - 'color' => 'fg-yellow', - 'message' => 'fg-yellow', - ], - BaseTestRunner::STATUS_WARNING => [ - 'symbol' => '⚠', - 'color' => 'fg-yellow', - 'message' => 'fg-yellow', - ], - BaseTestRunner::STATUS_UNKNOWN => [ - 'symbol' => '?', - 'color' => 'fg-blue', - 'message' => 'fg-white,bg-blue', - ], - ]; - - /** - * @var int[] - */ - private $nonSuccessfulTestResults = []; - - /** - * @throws \SebastianBergmann\Timer\RuntimeException - */ - public function printResult(TestResult $result): void - { - $this->printHeader($result); - - $this->printNonSuccessfulTestsSummary($result->count()); - - $this->printFooter($result); - } - - /** - * @throws \SebastianBergmann\Timer\RuntimeException - */ - protected function printHeader(TestResult $result): void - { - $this->write("\n" . Timer::resourceUsage() . "\n\n"); - } - - protected function formatClassName(Test $test): string - { - if ($test instanceof TestCase) { - return $this->prettifier->prettifyTestClass(get_class($test)); - } - - return get_class($test); - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - protected function registerTestResult(Test $test, ?Throwable $t, int $status, float $time, bool $verbose): void - { - if ($status !== BaseTestRunner::STATUS_PASSED) { - $this->nonSuccessfulTestResults[] = $this->testIndex; - } - - parent::registerTestResult($test, $t, $status, $time, $verbose); - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - protected function formatTestName(Test $test): string - { - if ($test instanceof TestCase) { - return $this->prettifier->prettifyTestCase($test); - } - - return parent::formatTestName($test); - } - - protected function writeTestResult(array $prevResult, array $result): void - { - // spacer line for new suite headers and after verbose messages - if ($prevResult['testName'] !== '' && - (!empty($prevResult['message']) || $prevResult['className'] !== $result['className'])) { - $this->write(PHP_EOL); - } - - // suite header - if ($prevResult['className'] !== $result['className']) { - $this->write($this->colorizeTextBox('underlined', $result['className']) . PHP_EOL); - } - - // test result line - if ($this->colors && $result['className'] === PhptTestCase::class) { - $testName = Color::colorizePath($result['testName'], $prevResult['testName'], true); - } else { - $testName = $result['testMethod']; - } - - $style = self::STATUS_STYLES[$result['status']]; - $line = sprintf( - ' %s %s%s' . PHP_EOL, - $this->colorizeTextBox($style['color'], $style['symbol']), - $testName, - $this->verbose ? ' ' . $this->formatRuntime($result['time'], $style['color']) : '' - ); - - $this->write($line); - - // additional information when verbose - $this->write($result['message']); - } - - protected function formatThrowable(Throwable $t, ?int $status = null): string - { - return trim(\PHPUnit\Framework\TestFailure::exceptionToString($t)); - } - - protected function colorizeMessageAndDiff(string $style, string $buffer): array - { - $lines = $buffer ? array_map('\rtrim', explode(PHP_EOL, $buffer)) : []; - $message = []; - $diff = []; - $insideDiff = false; - - foreach ($lines as $line) { - if ($line === '--- Expected') { - $insideDiff = true; - } - - if (!$insideDiff) { - $message[] = $line; - } else { - if (strpos($line, '-') === 0) { - $line = Color::colorize('fg-red', Color::visualizeWhitespace($line, true)); - } elseif (strpos($line, '+') === 0) { - $line = Color::colorize('fg-green', Color::visualizeWhitespace($line, true)); - } elseif ($line === '@@ @@') { - $line = Color::colorize('fg-cyan', $line); - } - $diff[] = $line; - } - } - $diff = implode(PHP_EOL, $diff); - - if (!empty($message)) { - $message = $this->colorizeTextBox($style, implode(PHP_EOL, $message)); - } - - return [$message, $diff]; - } - - protected function formatStacktrace(Throwable $t): string - { - $trace = \PHPUnit\Util\Filter::getFilteredStacktrace($t); - - if (!$this->colors) { - return $trace; - } - - $lines = []; - $prevPath = ''; - - foreach (explode(PHP_EOL, $trace) as $line) { - if (preg_match('/^(.*):(\d+)$/', $line, $matches)) { - $lines[] = Color::colorizePath($matches[1], $prevPath) . - Color::dim(':') . - Color::colorize('fg-blue', $matches[2]) . - "\n"; - $prevPath = $matches[1]; - } else { - $lines[] = $line; - $prevPath = ''; - } - } - - return implode('', $lines); - } - - protected function formatTestResultMessage(Throwable $t, array $result, ?string $prefix = null): string - { - $message = $this->formatThrowable($t, $result['status']); - $diff = ''; - - if (!($this->verbose || $result['verbose'])) { - return ''; - } - - if ($message && $this->colors) { - $style = self::STATUS_STYLES[$result['status']]['message'] ?? ''; - [$message, $diff] = $this->colorizeMessageAndDiff($style, $message); - } - - if ($prefix === null || !$this->colors) { - $prefix = self::PREFIX_SIMPLE; - } - - if ($this->colors) { - $color = self::STATUS_STYLES[$result['status']]['color'] ?? ''; - $prefix = array_map(static function ($p) use ($color) - { - return Color::colorize($color, $p); - }, self::PREFIX_DECORATED); - } - - $trace = $this->formatStacktrace($t); - $out = $this->prefixLines($prefix['start'], PHP_EOL) . PHP_EOL; - - if ($message) { - $out .= $this->prefixLines($prefix['message'], $message . PHP_EOL) . PHP_EOL; - } - - if ($diff) { - $out .= $this->prefixLines($prefix['diff'], $diff . PHP_EOL) . PHP_EOL; - } - - if ($trace) { - if ($message || $diff) { - $out .= $this->prefixLines($prefix['default'], PHP_EOL) . PHP_EOL; - } - $out .= $this->prefixLines($prefix['trace'], $trace . PHP_EOL) . PHP_EOL; - } - $out .= $this->prefixLines($prefix['last'], PHP_EOL) . PHP_EOL; - - return $out; - } - - protected function drawSpinner(): void - { - if ($this->colors) { - $id = $this->spinState % count(self::SPINNER_ICONS); - $this->write(self::SPINNER_ICONS[$id]); - } - } - - protected function undrawSpinner(): void - { - if ($this->colors) { - $id = $this->spinState % count(self::SPINNER_ICONS); - $this->write("\e[1K\e[" . strlen(self::SPINNER_ICONS[$id]) . 'D'); - } - } - - private function formatRuntime(float $time, string $color = ''): string - { - if (!$this->colors) { - return sprintf('[%.2f ms]', $time * 1000); - } - - if ($time > 1) { - $color = 'fg-magenta'; - } - - return Color::colorize($color, ' ' . (int) ceil($time * 1000) . ' ' . Color::dim('ms')); - } - - private function printNonSuccessfulTestsSummary(int $numberOfExecutedTests): void - { - if (empty($this->nonSuccessfulTestResults)) { - return; - } - - if ((count($this->nonSuccessfulTestResults) / $numberOfExecutedTests) >= 0.7) { - return; - } - - $this->write("Summary of non-successful tests:\n\n"); - - $prevResult = $this->getEmptyTestResult(); - - foreach ($this->nonSuccessfulTestResults as $testIndex) { - $result = $this->testResults[$testIndex]; - $this->writeTestResult($prevResult, $result); - $prevResult = $result; - } - } -} diff --git a/vendor/phpunit/phpunit/src/Util/TestDox/HtmlResultPrinter.php b/vendor/phpunit/phpunit/src/Util/TestDox/HtmlResultPrinter.php deleted file mode 100644 index 354d045..0000000 --- a/vendor/phpunit/phpunit/src/Util/TestDox/HtmlResultPrinter.php +++ /dev/null @@ -1,135 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util\TestDox; - -use function sprintf; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class HtmlResultPrinter extends ResultPrinter -{ - /** - * @var string - */ - private const PAGE_HEADER = <<<'EOT' - - - - - Test Documentation - - - -EOT; - - /** - * @var string - */ - private const CLASS_HEADER = <<<'EOT' - -

%s

-
    - -EOT; - - /** - * @var string - */ - private const CLASS_FOOTER = <<<'EOT' -
-EOT; - - /** - * @var string - */ - private const PAGE_FOOTER = <<<'EOT' - - - -EOT; - - /** - * Handler for 'start run' event. - */ - protected function startRun(): void - { - $this->write(self::PAGE_HEADER); - } - - /** - * Handler for 'start class' event. - */ - protected function startClass(string $name): void - { - $this->write( - sprintf( - self::CLASS_HEADER, - $name, - $this->currentTestClassPrettified - ) - ); - } - - /** - * Handler for 'on test' event. - */ - protected function onTest($name, bool $success = true): void - { - $this->write( - sprintf( - "
  • %s %s
  • \n", - $success ? '#555753' : '#ef2929', - $success ? '✓' : '❌', - $name - ) - ); - } - - /** - * Handler for 'end class' event. - */ - protected function endClass(string $name): void - { - $this->write(self::CLASS_FOOTER); - } - - /** - * Handler for 'end run' event. - */ - protected function endRun(): void - { - $this->write(self::PAGE_FOOTER); - } -} diff --git a/vendor/phpunit/phpunit/src/Util/TestDox/NamePrettifier.php b/vendor/phpunit/phpunit/src/Util/TestDox/NamePrettifier.php deleted file mode 100644 index ca5af05..0000000 --- a/vendor/phpunit/phpunit/src/Util/TestDox/NamePrettifier.php +++ /dev/null @@ -1,308 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util\TestDox; - -use function array_key_exists; -use function array_keys; -use function array_map; -use function array_pop; -use function array_values; -use function explode; -use function get_class; -use function gettype; -use function implode; -use function in_array; -use function is_bool; -use function is_float; -use function is_int; -use function is_numeric; -use function is_object; -use function is_scalar; -use function is_string; -use function ord; -use function preg_quote; -use function preg_replace; -use function range; -use function sprintf; -use function str_replace; -use function strlen; -use function strpos; -use function strtolower; -use function strtoupper; -use function substr; -use function trim; -use PHPUnit\Framework\TestCase; -use PHPUnit\Util\Color; -use PHPUnit\Util\Exception as UtilException; -use PHPUnit\Util\Test; -use ReflectionException; -use ReflectionMethod; -use ReflectionObject; -use SebastianBergmann\Exporter\Exporter; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class NamePrettifier -{ - /** - * @var string[] - */ - private $strings = []; - - /** - * @var bool - */ - private $useColor; - - public function __construct($useColor = false) - { - $this->useColor = $useColor; - } - - /** - * Prettifies the name of a test class. - * - * @psalm-param class-string $className - */ - public function prettifyTestClass(string $className): string - { - try { - $annotations = Test::parseTestMethodAnnotations($className); - - if (isset($annotations['class']['testdox'][0])) { - return $annotations['class']['testdox'][0]; - } - } catch (UtilException $e) { - // ignore, determine className by parsing the provided name - } - - $parts = explode('\\', $className); - $className = array_pop($parts); - - if (substr($className, -1 * strlen('Test')) === 'Test') { - $className = substr($className, 0, strlen($className) - strlen('Test')); - } - - if (strpos($className, 'Tests') === 0) { - $className = substr($className, strlen('Tests')); - } elseif (strpos($className, 'Test') === 0) { - $className = substr($className, strlen('Test')); - } - - if (empty($className)) { - $className = 'UnnamedTests'; - } - - if (!empty($parts)) { - $parts[] = $className; - $fullyQualifiedName = implode('\\', $parts); - } else { - $fullyQualifiedName = $className; - } - - $result = preg_replace('/(?<=[[:lower:]])(?=[[:upper:]])/u', ' ', $className); - - if ($fullyQualifiedName !== $className) { - return $result . ' (' . $fullyQualifiedName . ')'; - } - - return $result; - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function prettifyTestCase(TestCase $test): string - { - $annotations = $test->getAnnotations(); - $annotationWithPlaceholders = false; - - $callback = static function (string $variable): string - { - return sprintf('/%s(?=\b)/', preg_quote($variable, '/')); - }; - - if (isset($annotations['method']['testdox'][0])) { - $result = $annotations['method']['testdox'][0]; - - if (strpos($result, '$') !== false) { - $annotation = $annotations['method']['testdox'][0]; - $providedData = $this->mapTestMethodParameterNamesToProvidedDataValues($test); - $variables = array_map($callback, array_keys($providedData)); - - $result = trim(preg_replace($variables, $providedData, $annotation)); - - $annotationWithPlaceholders = true; - } - } else { - $result = $this->prettifyTestMethod($test->getName(false)); - } - - if (!$annotationWithPlaceholders && $test->usesDataProvider()) { - $result .= $this->prettifyDataSet($test); - } - - return $result; - } - - public function prettifyDataSet(TestCase $test): string - { - if (!$this->useColor) { - return $test->getDataSetAsString(false); - } - - if (is_int($test->dataName())) { - $data = Color::dim(' with data set ') . Color::colorize('fg-cyan', (string) $test->dataName()); - } else { - $data = Color::dim(' with ') . Color::colorize('fg-cyan', Color::visualizeWhitespace((string) $test->dataName())); - } - - return $data; - } - - /** - * Prettifies the name of a test method. - */ - public function prettifyTestMethod(string $name): string - { - $buffer = ''; - - if ($name === '') { - return $buffer; - } - - $string = (string) preg_replace('#\d+$#', '', $name, -1, $count); - - if (in_array($string, $this->strings, true)) { - $name = $string; - } elseif ($count === 0) { - $this->strings[] = $string; - } - - if (strpos($name, 'test_') === 0) { - $name = substr($name, 5); - } elseif (strpos($name, 'test') === 0) { - $name = substr($name, 4); - } - - if ($name === '') { - return $buffer; - } - - $name[0] = strtoupper($name[0]); - - if (strpos($name, '_') !== false) { - return trim(str_replace('_', ' ', $name)); - } - - $wasNumeric = false; - - foreach (range(0, strlen($name) - 1) as $i) { - if ($i > 0 && ord($name[$i]) >= 65 && ord($name[$i]) <= 90) { - $buffer .= ' ' . strtolower($name[$i]); - } else { - $isNumeric = is_numeric($name[$i]); - - if (!$wasNumeric && $isNumeric) { - $buffer .= ' '; - $wasNumeric = true; - } - - if ($wasNumeric && !$isNumeric) { - $wasNumeric = false; - } - - $buffer .= $name[$i]; - } - } - - return $buffer; - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - private function mapTestMethodParameterNamesToProvidedDataValues(TestCase $test): array - { - try { - $reflector = new ReflectionMethod(get_class($test), $test->getName(false)); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new UtilException( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - $providedData = []; - $providedDataValues = array_values($test->getProvidedData()); - $i = 0; - - $providedData['$_dataName'] = $test->dataName(); - - foreach ($reflector->getParameters() as $parameter) { - if (!array_key_exists($i, $providedDataValues) && $parameter->isDefaultValueAvailable()) { - try { - $providedDataValues[$i] = $parameter->getDefaultValue(); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new UtilException( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - } - - $value = $providedDataValues[$i++] ?? null; - - if (is_object($value)) { - $reflector = new ReflectionObject($value); - - if ($reflector->hasMethod('__toString')) { - $value = (string) $value; - } else { - $value = get_class($value); - } - } - - if (!is_scalar($value)) { - $value = gettype($value); - } - - if (is_bool($value) || is_int($value) || is_float($value)) { - $value = (new Exporter)->export($value); - } - - if (is_string($value) && $value === '') { - if ($this->useColor) { - $value = Color::colorize('dim,underlined', 'empty'); - } else { - $value = "''"; - } - } - - $providedData['$' . $parameter->getName()] = $value; - } - - if ($this->useColor) { - $providedData = array_map(static function ($value) - { - return Color::colorize('fg-cyan', Color::visualizeWhitespace((string) $value, true)); - }, $providedData); - } - - return $providedData; - } -} diff --git a/vendor/phpunit/phpunit/src/Util/TestDox/ResultPrinter.php b/vendor/phpunit/phpunit/src/Util/TestDox/ResultPrinter.php deleted file mode 100644 index 1c2a5c9..0000000 --- a/vendor/phpunit/phpunit/src/Util/TestDox/ResultPrinter.php +++ /dev/null @@ -1,342 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util\TestDox; - -use function get_class; -use function in_array; -use PHPUnit\Framework\AssertionFailedError; -use PHPUnit\Framework\Test; -use PHPUnit\Framework\TestCase; -use PHPUnit\Framework\TestListener; -use PHPUnit\Framework\TestSuite; -use PHPUnit\Framework\Warning; -use PHPUnit\Framework\WarningTestCase; -use PHPUnit\Runner\BaseTestRunner; -use PHPUnit\Util\Printer; -use Throwable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -abstract class ResultPrinter extends Printer implements TestListener -{ - /** - * @var NamePrettifier - */ - protected $prettifier; - - /** - * @var string - */ - protected $testClass = ''; - - /** - * @var int - */ - protected $testStatus; - - /** - * @var array - */ - protected $tests = []; - - /** - * @var int - */ - protected $successful = 0; - - /** - * @var int - */ - protected $warned = 0; - - /** - * @var int - */ - protected $failed = 0; - - /** - * @var int - */ - protected $risky = 0; - - /** - * @var int - */ - protected $skipped = 0; - - /** - * @var int - */ - protected $incomplete = 0; - - /** - * @var null|string - */ - protected $currentTestClassPrettified; - - /** - * @var null|string - */ - protected $currentTestMethodPrettified; - - /** - * @var array - */ - private $groups; - - /** - * @var array - */ - private $excludeGroups; - - /** - * @param resource $out - * - * @throws \PHPUnit\Framework\Exception - */ - public function __construct($out = null, array $groups = [], array $excludeGroups = []) - { - parent::__construct($out); - - $this->groups = $groups; - $this->excludeGroups = $excludeGroups; - - $this->prettifier = new NamePrettifier; - $this->startRun(); - } - - /** - * Flush buffer and close output. - */ - public function flush(): void - { - $this->doEndClass(); - $this->endRun(); - - parent::flush(); - } - - /** - * An error occurred. - */ - public function addError(Test $test, Throwable $t, float $time): void - { - if (!$this->isOfInterest($test)) { - return; - } - - $this->testStatus = BaseTestRunner::STATUS_ERROR; - $this->failed++; - } - - /** - * A warning occurred. - */ - public function addWarning(Test $test, Warning $e, float $time): void - { - if (!$this->isOfInterest($test)) { - return; - } - - $this->testStatus = BaseTestRunner::STATUS_WARNING; - $this->warned++; - } - - /** - * A failure occurred. - */ - public function addFailure(Test $test, AssertionFailedError $e, float $time): void - { - if (!$this->isOfInterest($test)) { - return; - } - - $this->testStatus = BaseTestRunner::STATUS_FAILURE; - $this->failed++; - } - - /** - * Incomplete test. - */ - public function addIncompleteTest(Test $test, Throwable $t, float $time): void - { - if (!$this->isOfInterest($test)) { - return; - } - - $this->testStatus = BaseTestRunner::STATUS_INCOMPLETE; - $this->incomplete++; - } - - /** - * Risky test. - */ - public function addRiskyTest(Test $test, Throwable $t, float $time): void - { - if (!$this->isOfInterest($test)) { - return; - } - - $this->testStatus = BaseTestRunner::STATUS_RISKY; - $this->risky++; - } - - /** - * Skipped test. - */ - public function addSkippedTest(Test $test, Throwable $t, float $time): void - { - if (!$this->isOfInterest($test)) { - return; - } - - $this->testStatus = BaseTestRunner::STATUS_SKIPPED; - $this->skipped++; - } - - /** - * A testsuite started. - */ - public function startTestSuite(TestSuite $suite): void - { - } - - /** - * A testsuite ended. - */ - public function endTestSuite(TestSuite $suite): void - { - } - - /** - * A test started. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function startTest(Test $test): void - { - if (!$this->isOfInterest($test)) { - return; - } - - $class = get_class($test); - - if ($this->testClass !== $class) { - if ($this->testClass !== '') { - $this->doEndClass(); - } - - $this->currentTestClassPrettified = $this->prettifier->prettifyTestClass($class); - $this->testClass = $class; - $this->tests = []; - - $this->startClass($class); - } - - if ($test instanceof TestCase) { - $this->currentTestMethodPrettified = $this->prettifier->prettifyTestCase($test); - } - - $this->testStatus = BaseTestRunner::STATUS_PASSED; - } - - /** - * A test ended. - */ - public function endTest(Test $test, float $time): void - { - if (!$this->isOfInterest($test)) { - return; - } - - $this->tests[] = [$this->currentTestMethodPrettified, $this->testStatus]; - - $this->currentTestClassPrettified = null; - $this->currentTestMethodPrettified = null; - } - - protected function doEndClass(): void - { - foreach ($this->tests as $test) { - $this->onTest($test[0], $test[1] === BaseTestRunner::STATUS_PASSED); - } - - $this->endClass($this->testClass); - } - - /** - * Handler for 'start run' event. - */ - protected function startRun(): void - { - } - - /** - * Handler for 'start class' event. - */ - protected function startClass(string $name): void - { - } - - /** - * Handler for 'on test' event. - */ - protected function onTest($name, bool $success = true): void - { - } - - /** - * Handler for 'end class' event. - */ - protected function endClass(string $name): void - { - } - - /** - * Handler for 'end run' event. - */ - protected function endRun(): void - { - } - - private function isOfInterest(Test $test): bool - { - if (!$test instanceof TestCase) { - return false; - } - - if ($test instanceof WarningTestCase) { - return false; - } - - if (!empty($this->groups)) { - foreach ($test->getGroups() as $group) { - if (in_array($group, $this->groups, true)) { - return true; - } - } - - return false; - } - - if (!empty($this->excludeGroups)) { - foreach ($test->getGroups() as $group) { - if (in_array($group, $this->excludeGroups, true)) { - return false; - } - } - - return true; - } - - return true; - } -} diff --git a/vendor/phpunit/phpunit/src/Util/TestDox/TestDoxPrinter.php b/vendor/phpunit/phpunit/src/Util/TestDox/TestDoxPrinter.php deleted file mode 100644 index 41d6067..0000000 --- a/vendor/phpunit/phpunit/src/Util/TestDox/TestDoxPrinter.php +++ /dev/null @@ -1,385 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util\TestDox; - -use const PHP_EOL; -use function array_map; -use function get_class; -use function implode; -use function preg_split; -use function trim; -use PHPUnit\Framework\AssertionFailedError; -use PHPUnit\Framework\Test; -use PHPUnit\Framework\TestCase; -use PHPUnit\Framework\TestResult; -use PHPUnit\Framework\TestSuite; -use PHPUnit\Framework\Warning; -use PHPUnit\Runner\BaseTestRunner; -use PHPUnit\Runner\PhptTestCase; -use PHPUnit\Runner\TestSuiteSorter; -use PHPUnit\TextUI\ResultPrinter; -use Throwable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -class TestDoxPrinter extends ResultPrinter -{ - /** - * @var NamePrettifier - */ - protected $prettifier; - - /** - * @var int The number of test results received from the TestRunner - */ - protected $testIndex = 0; - - /** - * @var int The number of test results already sent to the output - */ - protected $testFlushIndex = 0; - - /** - * @var array Buffer for test results - */ - protected $testResults = []; - - /** - * @var array Lookup table for testname to testResults[index] - */ - protected $testNameResultIndex = []; - - /** - * @var bool - */ - protected $enableOutputBuffer = false; - - /** - * @var array array - */ - protected $originalExecutionOrder = []; - - /** - * @var int - */ - protected $spinState = 0; - - /** - * @var bool - */ - protected $showProgress = true; - - /** - * @param null|resource|string $out - * - * @throws \PHPUnit\Framework\Exception - */ - public function __construct($out = null, bool $verbose = false, string $colors = self::COLOR_DEFAULT, bool $debug = false, $numberOfColumns = 80, bool $reverse = false) - { - parent::__construct($out, $verbose, $colors, $debug, $numberOfColumns, $reverse); - - $this->prettifier = new NamePrettifier($this->colors); - } - - public function setOriginalExecutionOrder(array $order): void - { - $this->originalExecutionOrder = $order; - $this->enableOutputBuffer = !empty($order); - } - - public function setShowProgressAnimation(bool $showProgress): void - { - $this->showProgress = $showProgress; - } - - public function printResult(TestResult $result): void - { - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function endTest(Test $test, float $time): void - { - if (!$test instanceof TestCase && !$test instanceof PhptTestCase && !$test instanceof TestSuite) { - return; - } - - if ($this->testHasPassed()) { - $this->registerTestResult($test, null, BaseTestRunner::STATUS_PASSED, $time, false); - } - - if ($test instanceof TestCase || $test instanceof PhptTestCase) { - $this->testIndex++; - } - - parent::endTest($test, $time); - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function addError(Test $test, Throwable $t, float $time): void - { - $this->registerTestResult($test, $t, BaseTestRunner::STATUS_ERROR, $time, true); - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function addWarning(Test $test, Warning $e, float $time): void - { - $this->registerTestResult($test, $e, BaseTestRunner::STATUS_WARNING, $time, true); - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function addFailure(Test $test, AssertionFailedError $e, float $time): void - { - $this->registerTestResult($test, $e, BaseTestRunner::STATUS_FAILURE, $time, true); - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function addIncompleteTest(Test $test, Throwable $t, float $time): void - { - $this->registerTestResult($test, $t, BaseTestRunner::STATUS_INCOMPLETE, $time, false); - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function addRiskyTest(Test $test, Throwable $t, float $time): void - { - $this->registerTestResult($test, $t, BaseTestRunner::STATUS_RISKY, $time, false); - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function addSkippedTest(Test $test, Throwable $t, float $time): void - { - $this->registerTestResult($test, $t, BaseTestRunner::STATUS_SKIPPED, $time, false); - } - - public function writeProgress(string $progress): void - { - $this->flushOutputBuffer(); - } - - public function flush(): void - { - $this->flushOutputBuffer(true); - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - protected function registerTestResult(Test $test, ?Throwable $t, int $status, float $time, bool $verbose): void - { - $testName = TestSuiteSorter::getTestSorterUID($test); - - $result = [ - 'className' => $this->formatClassName($test), - 'testName' => $testName, - 'testMethod' => $this->formatTestName($test), - 'message' => '', - 'status' => $status, - 'time' => $time, - 'verbose' => $verbose, - ]; - - if ($t !== null) { - $result['message'] = $this->formatTestResultMessage($t, $result); - } - - $this->testResults[$this->testIndex] = $result; - $this->testNameResultIndex[$testName] = $this->testIndex; - } - - protected function formatTestName(Test $test): string - { - return $test->getName(); - } - - protected function formatClassName(Test $test): string - { - return get_class($test); - } - - protected function testHasPassed(): bool - { - if (!isset($this->testResults[$this->testIndex]['status'])) { - return true; - } - - if ($this->testResults[$this->testIndex]['status'] === BaseTestRunner::STATUS_PASSED) { - return true; - } - - return false; - } - - protected function flushOutputBuffer(bool $forceFlush = false): void - { - if ($this->testFlushIndex === $this->testIndex) { - return; - } - - if ($this->testFlushIndex > 0) { - if ($this->enableOutputBuffer) { - $prevResult = $this->getTestResultByName($this->originalExecutionOrder[$this->testFlushIndex - 1]); - } else { - $prevResult = $this->testResults[$this->testFlushIndex - 1]; - } - } else { - $prevResult = $this->getEmptyTestResult(); - } - - if (!$this->enableOutputBuffer) { - $this->writeTestResult($prevResult, $this->testResults[$this->testFlushIndex++]); - } else { - do { - $flushed = false; - - if (!$forceFlush && isset($this->originalExecutionOrder[$this->testFlushIndex])) { - $result = $this->getTestResultByName($this->originalExecutionOrder[$this->testFlushIndex]); - } else { - // This test(name) cannot found in original execution order, - // flush result to output stream right away - $result = $this->testResults[$this->testFlushIndex]; - } - - if (!empty($result)) { - $this->hideSpinner(); - $this->writeTestResult($prevResult, $result); - $this->testFlushIndex++; - $prevResult = $result; - $flushed = true; - } else { - $this->showSpinner(); - } - } while ($flushed && $this->testFlushIndex < $this->testIndex); - } - } - - protected function showSpinner(): void - { - if (!$this->showProgress) { - return; - } - - if ($this->spinState) { - $this->undrawSpinner(); - } - - $this->spinState++; - $this->drawSpinner(); - } - - protected function hideSpinner(): void - { - if (!$this->showProgress) { - return; - } - - if ($this->spinState) { - $this->undrawSpinner(); - } - - $this->spinState = 0; - } - - protected function drawSpinner(): void - { - // optional for CLI printers: show the user a 'buffering output' spinner - } - - protected function undrawSpinner(): void - { - // remove the spinner from the current line - } - - protected function writeTestResult(array $prevResult, array $result): void - { - } - - protected function getEmptyTestResult(): array - { - return [ - 'className' => '', - 'testName' => '', - 'message' => '', - 'failed' => '', - 'verbose' => '', - ]; - } - - protected function getTestResultByName(?string $testName): array - { - if (isset($this->testNameResultIndex[$testName])) { - return $this->testResults[$this->testNameResultIndex[$testName]]; - } - - return []; - } - - protected function formatThrowable(Throwable $t, ?int $status = null): string - { - $message = trim(\PHPUnit\Framework\TestFailure::exceptionToString($t)); - - if ($message) { - $message .= PHP_EOL . PHP_EOL . $this->formatStacktrace($t); - } else { - $message = $this->formatStacktrace($t); - } - - return $message; - } - - protected function formatStacktrace(Throwable $t): string - { - return \PHPUnit\Util\Filter::getFilteredStacktrace($t); - } - - protected function formatTestResultMessage(Throwable $t, array $result, string $prefix = '│'): string - { - $message = $this->formatThrowable($t, $result['status']); - - if ($message === '') { - return ''; - } - - if (!($this->verbose || $result['verbose'])) { - return ''; - } - - return $this->prefixLines($prefix, $message); - } - - protected function prefixLines(string $prefix, string $message): string - { - $message = trim($message); - - return implode( - PHP_EOL, - array_map( - static function (string $text) use ($prefix) - { - return ' ' . $prefix . ($text ? ' ' . $text : ''); - }, - preg_split('/\r\n|\r|\n/', $message) - ) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Util/TestDox/TextResultPrinter.php b/vendor/phpunit/phpunit/src/Util/TestDox/TextResultPrinter.php deleted file mode 100644 index ee08003..0000000 --- a/vendor/phpunit/phpunit/src/Util/TestDox/TextResultPrinter.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util\TestDox; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class TextResultPrinter extends ResultPrinter -{ - /** - * Handler for 'start class' event. - */ - protected function startClass(string $name): void - { - $this->write($this->currentTestClassPrettified . "\n"); - } - - /** - * Handler for 'on test' event. - */ - protected function onTest($name, bool $success = true): void - { - if ($success) { - $this->write(' [x] '); - } else { - $this->write(' [ ] '); - } - - $this->write($name . "\n"); - } - - /** - * Handler for 'end class' event. - */ - protected function endClass(string $name): void - { - $this->write("\n"); - } -} diff --git a/vendor/phpunit/phpunit/src/Util/TestDox/XmlResultPrinter.php b/vendor/phpunit/phpunit/src/Util/TestDox/XmlResultPrinter.php deleted file mode 100644 index fc511ed..0000000 --- a/vendor/phpunit/phpunit/src/Util/TestDox/XmlResultPrinter.php +++ /dev/null @@ -1,255 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util\TestDox; - -use function array_filter; -use function get_class; -use function implode; -use DOMDocument; -use DOMElement; -use PHPUnit\Framework\AssertionFailedError; -use PHPUnit\Framework\Exception; -use PHPUnit\Framework\Test; -use PHPUnit\Framework\TestCase; -use PHPUnit\Framework\TestListener; -use PHPUnit\Framework\TestSuite; -use PHPUnit\Framework\Warning; -use PHPUnit\Util\Printer; -use ReflectionClass; -use ReflectionException; -use Throwable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class XmlResultPrinter extends Printer implements TestListener -{ - /** - * @var DOMDocument - */ - private $document; - - /** - * @var DOMElement - */ - private $root; - - /** - * @var NamePrettifier - */ - private $prettifier; - - /** - * @var null|Throwable - */ - private $exception; - - /** - * @param resource|string $out - * - * @throws Exception - */ - public function __construct($out = null) - { - $this->document = new DOMDocument('1.0', 'UTF-8'); - $this->document->formatOutput = true; - - $this->root = $this->document->createElement('tests'); - $this->document->appendChild($this->root); - - $this->prettifier = new NamePrettifier; - - parent::__construct($out); - } - - /** - * Flush buffer and close output. - */ - public function flush(): void - { - $this->write($this->document->saveXML()); - - parent::flush(); - } - - /** - * An error occurred. - */ - public function addError(Test $test, Throwable $t, float $time): void - { - $this->exception = $t; - } - - /** - * A warning occurred. - */ - public function addWarning(Test $test, Warning $e, float $time): void - { - } - - /** - * A failure occurred. - */ - public function addFailure(Test $test, AssertionFailedError $e, float $time): void - { - $this->exception = $e; - } - - /** - * Incomplete test. - */ - public function addIncompleteTest(Test $test, Throwable $t, float $time): void - { - } - - /** - * Risky test. - */ - public function addRiskyTest(Test $test, Throwable $t, float $time): void - { - } - - /** - * Skipped test. - */ - public function addSkippedTest(Test $test, Throwable $t, float $time): void - { - } - - /** - * A test suite started. - */ - public function startTestSuite(TestSuite $suite): void - { - } - - /** - * A test suite ended. - */ - public function endTestSuite(TestSuite $suite): void - { - } - - /** - * A test started. - */ - public function startTest(Test $test): void - { - $this->exception = null; - } - - /** - * A test ended. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function endTest(Test $test, float $time): void - { - if (!$test instanceof TestCase) { - return; - } - - $groups = array_filter( - $test->getGroups(), - static function ($group) - { - return !($group === 'small' || $group === 'medium' || $group === 'large'); - } - ); - - $testNode = $this->document->createElement('test'); - - $testNode->setAttribute('className', get_class($test)); - $testNode->setAttribute('methodName', $test->getName()); - $testNode->setAttribute('prettifiedClassName', $this->prettifier->prettifyTestClass(get_class($test))); - $testNode->setAttribute('prettifiedMethodName', $this->prettifier->prettifyTestCase($test)); - $testNode->setAttribute('status', (string) $test->getStatus()); - $testNode->setAttribute('time', (string) $time); - $testNode->setAttribute('size', (string) $test->getSize()); - $testNode->setAttribute('groups', implode(',', $groups)); - - foreach ($groups as $group) { - $groupNode = $this->document->createElement('group'); - - $groupNode->setAttribute('name', $group); - - $testNode->appendChild($groupNode); - } - - $annotations = $test->getAnnotations(); - - foreach (['class', 'method'] as $type) { - foreach ($annotations[$type] as $annotation => $values) { - if ($annotation !== 'covers' && $annotation !== 'uses') { - continue; - } - - foreach ($values as $value) { - $coversNode = $this->document->createElement($annotation); - - $coversNode->setAttribute('target', $value); - - $testNode->appendChild($coversNode); - } - } - } - - foreach ($test->doubledTypes() as $doubledType) { - $testDoubleNode = $this->document->createElement('testDouble'); - - $testDoubleNode->setAttribute('type', $doubledType); - - $testNode->appendChild($testDoubleNode); - } - - $inlineAnnotations = \PHPUnit\Util\Test::getInlineAnnotations(get_class($test), $test->getName(false)); - - if (isset($inlineAnnotations['given'], $inlineAnnotations['when'], $inlineAnnotations['then'])) { - $testNode->setAttribute('given', $inlineAnnotations['given']['value']); - $testNode->setAttribute('givenStartLine', (string) $inlineAnnotations['given']['line']); - $testNode->setAttribute('when', $inlineAnnotations['when']['value']); - $testNode->setAttribute('whenStartLine', (string) $inlineAnnotations['when']['line']); - $testNode->setAttribute('then', $inlineAnnotations['then']['value']); - $testNode->setAttribute('thenStartLine', (string) $inlineAnnotations['then']['line']); - } - - if ($this->exception !== null) { - if ($this->exception instanceof Exception) { - $steps = $this->exception->getSerializableTrace(); - } else { - $steps = $this->exception->getTrace(); - } - - try { - $file = (new ReflectionClass($test))->getFileName(); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - foreach ($steps as $step) { - if (isset($step['file']) && $step['file'] === $file) { - $testNode->setAttribute('exceptionLine', (string) $step['line']); - - break; - } - } - - $testNode->setAttribute('exceptionMessage', $this->exception->getMessage()); - } - - $this->root->appendChild($testNode); - } -} diff --git a/vendor/phpunit/phpunit/src/Util/TextTestListRenderer.php b/vendor/phpunit/phpunit/src/Util/TextTestListRenderer.php deleted file mode 100644 index 67168a6..0000000 --- a/vendor/phpunit/phpunit/src/Util/TextTestListRenderer.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util; - -use const PHP_EOL; -use function get_class; -use function sprintf; -use function str_replace; -use PHPUnit\Framework\TestCase; -use PHPUnit\Framework\TestSuite; -use PHPUnit\Runner\PhptTestCase; -use RecursiveIteratorIterator; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class TextTestListRenderer -{ - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function render(TestSuite $suite): string - { - $buffer = 'Available test(s):' . PHP_EOL; - - foreach (new RecursiveIteratorIterator($suite->getIterator()) as $test) { - if ($test instanceof TestCase) { - $name = sprintf( - '%s::%s', - get_class($test), - str_replace(' with data set ', '', $test->getName()) - ); - } elseif ($test instanceof PhptTestCase) { - $name = $test->getName(); - } else { - continue; - } - - $buffer .= sprintf( - ' - %s' . PHP_EOL, - $name - ); - } - - return $buffer; - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Type.php b/vendor/phpunit/phpunit/src/Util/Type.php deleted file mode 100644 index 01a6b19..0000000 --- a/vendor/phpunit/phpunit/src/Util/Type.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util; - -use Throwable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Type -{ - public static function isType(string $type): bool - { - switch ($type) { - case 'numeric': - case 'integer': - case 'int': - case 'iterable': - case 'float': - case 'string': - case 'boolean': - case 'bool': - case 'null': - case 'array': - case 'object': - case 'resource': - case 'scalar': - return true; - - default: - return false; - } - } - - public static function isCloneable(object $object): bool - { - try { - $clone = clone $object; - } catch (Throwable $t) { - return false; - } - - return $clone instanceof $object; - } -} diff --git a/vendor/phpunit/phpunit/src/Util/VersionComparisonOperator.php b/vendor/phpunit/phpunit/src/Util/VersionComparisonOperator.php deleted file mode 100644 index 175ecd2..0000000 --- a/vendor/phpunit/phpunit/src/Util/VersionComparisonOperator.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util; - -use function in_array; -use function sprintf; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * @psalm-immutable - */ -final class VersionComparisonOperator -{ - /** - * @psalm-var '<'|'lt'|'<='|'le'|'>'|'gt'|'>='|'ge'|'=='|'='|'eq'|'!='|'<>'|'ne' - */ - private $operator; - - public function __construct(string $operator) - { - $this->ensureOperatorIsValid($operator); - - $this->operator = $operator; - } - - /** - * @return '!='|'<'|'<='|'<>'|'='|'=='|'>'|'>='|'eq'|'ge'|'gt'|'le'|'lt'|'ne' - */ - public function asString(): string - { - return $this->operator; - } - - /** - * @throws Exception - * - * @psalm-assert '<'|'lt'|'<='|'le'|'>'|'gt'|'>='|'ge'|'=='|'='|'eq'|'!='|'<>'|'ne' $operator - */ - private function ensureOperatorIsValid(string $operator): void - { - if (!in_array($operator, ['<', 'lt', '<=', 'le', '>', 'gt', '>=', 'ge', '==', '=', 'eq', '!=', '<>', 'ne'], true)) { - throw new Exception( - sprintf( - '"%s" is not a valid version_compare() operator', - $operator - ) - ); - } - } -} diff --git a/vendor/phpunit/phpunit/src/Util/XdebugFilterScriptGenerator.php b/vendor/phpunit/phpunit/src/Util/XdebugFilterScriptGenerator.php deleted file mode 100644 index df495a1..0000000 --- a/vendor/phpunit/phpunit/src/Util/XdebugFilterScriptGenerator.php +++ /dev/null @@ -1,84 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util; - -use const DIRECTORY_SEPARATOR; -use function addslashes; -use function array_map; -use function implode; -use function is_string; -use function realpath; -use function sprintf; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class XdebugFilterScriptGenerator -{ - public function generate(array $filterData): string - { - $items = $this->getWhitelistItems($filterData); - - $files = array_map( - static function ($item) - { - return sprintf( - " '%s'", - $item - ); - }, - $items - ); - - $files = implode(",\n", $files); - - return << - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util; - -use const ENT_QUOTES; -use function assert; -use function chdir; -use function class_exists; -use function dirname; -use function error_reporting; -use function file_get_contents; -use function getcwd; -use function gettype; -use function htmlspecialchars; -use function is_string; -use function libxml_get_errors; -use function libxml_use_internal_errors; -use function mb_convert_encoding; -use function ord; -use function preg_replace; -use function settype; -use function sprintf; -use function strlen; -use DOMCharacterData; -use DOMDocument; -use DOMElement; -use DOMNode; -use DOMText; -use PHPUnit\Framework\Exception; -use ReflectionClass; -use ReflectionException; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Xml -{ - public static function import(DOMElement $element): DOMElement - { - return (new DOMDocument)->importNode($element, true); - } - - /** - * Load an $actual document into a DOMDocument. This is called - * from the selector assertions. - * - * If $actual is already a DOMDocument, it is returned with - * no changes. Otherwise, $actual is loaded into a new DOMDocument - * as either HTML or XML, depending on the value of $isHtml. If $isHtml is - * false and $xinclude is true, xinclude is performed on the loaded - * DOMDocument. - * - * Note: prior to PHPUnit 3.3.0, this method loaded a file and - * not a string as it currently does. To load a file into a - * DOMDocument, use loadFile() instead. - * - * @param DOMDocument|string $actual - * - * @throws Exception - */ - public static function load($actual, bool $isHtml = false, string $filename = '', bool $xinclude = false, bool $strict = false): DOMDocument - { - if ($actual instanceof DOMDocument) { - return $actual; - } - - if (!is_string($actual)) { - throw new Exception('Could not load XML from ' . gettype($actual)); - } - - if ($actual === '') { - throw new Exception('Could not load XML from empty string'); - } - - // Required for XInclude on Windows. - if ($xinclude) { - $cwd = getcwd(); - @chdir(dirname($filename)); - } - - $document = new DOMDocument; - $document->preserveWhiteSpace = false; - - $internal = libxml_use_internal_errors(true); - $message = ''; - $reporting = error_reporting(0); - - if ($filename !== '') { - // Required for XInclude - $document->documentURI = $filename; - } - - if ($isHtml) { - $loaded = $document->loadHTML($actual); - } else { - $loaded = $document->loadXML($actual); - } - - if (!$isHtml && $xinclude) { - $document->xinclude(); - } - - foreach (libxml_get_errors() as $error) { - $message .= "\n" . $error->message; - } - - libxml_use_internal_errors($internal); - error_reporting($reporting); - - if (isset($cwd)) { - @chdir($cwd); - } - - if ($loaded === false || ($strict && $message !== '')) { - if ($filename !== '') { - throw new Exception( - sprintf( - 'Could not load "%s".%s', - $filename, - $message !== '' ? "\n" . $message : '' - ) - ); - } - - if ($message === '') { - $message = 'Could not load XML for unknown reason'; - } - - throw new Exception($message); - } - - return $document; - } - - /** - * Loads an XML (or HTML) file into a DOMDocument object. - * - * @throws Exception - */ - public static function loadFile(string $filename, bool $isHtml = false, bool $xinclude = false, bool $strict = false): DOMDocument - { - $reporting = error_reporting(0); - $contents = file_get_contents($filename); - - error_reporting($reporting); - - if ($contents === false) { - throw new Exception( - sprintf( - 'Could not read "%s".', - $filename - ) - ); - } - - return self::load($contents, $isHtml, $filename, $xinclude, $strict); - } - - public static function removeCharacterDataNodes(DOMNode $node): void - { - if ($node->hasChildNodes()) { - for ($i = $node->childNodes->length - 1; $i >= 0; $i--) { - if (($child = $node->childNodes->item($i)) instanceof DOMCharacterData) { - $node->removeChild($child); - } - } - } - } - - /** - * Escapes a string for the use in XML documents. - * - * Any Unicode character is allowed, excluding the surrogate blocks, FFFE, - * and FFFF (not even as character reference). - * - * @see https://www.w3.org/TR/xml/#charsets - */ - public static function prepareString(string $string): string - { - return preg_replace( - '/[\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]/', - '', - htmlspecialchars( - self::convertToUtf8($string), - ENT_QUOTES - ) - ); - } - - /** - * "Convert" a DOMElement object into a PHP variable. - */ - public static function xmlToVariable(DOMElement $element) - { - $variable = null; - - switch ($element->tagName) { - case 'array': - $variable = []; - - foreach ($element->childNodes as $entry) { - if (!$entry instanceof DOMElement || $entry->tagName !== 'element') { - continue; - } - $item = $entry->childNodes->item(0); - - if ($item instanceof DOMText) { - $item = $entry->childNodes->item(1); - } - - $value = self::xmlToVariable($item); - - if ($entry->hasAttribute('key')) { - $variable[(string) $entry->getAttribute('key')] = $value; - } else { - $variable[] = $value; - } - } - - break; - - case 'object': - $className = $element->getAttribute('class'); - - if ($element->hasChildNodes()) { - $arguments = $element->childNodes->item(0)->childNodes; - $constructorArgs = []; - - foreach ($arguments as $argument) { - if ($argument instanceof DOMElement) { - $constructorArgs[] = self::xmlToVariable($argument); - } - } - - try { - assert(class_exists($className)); - - $variable = (new ReflectionClass($className))->newInstanceArgs($constructorArgs); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - } else { - $variable = new $className; - } - - break; - - case 'boolean': - $variable = $element->textContent === 'true'; - - break; - - case 'integer': - case 'double': - case 'string': - $variable = $element->textContent; - - settype($variable, $element->tagName); - - break; - } - - return $variable; - } - - private static function convertToUtf8(string $string): string - { - if (!self::isUtf8($string)) { - $string = mb_convert_encoding($string, 'UTF-8'); - } - - return $string; - } - - private static function isUtf8(string $string): bool - { - $length = strlen($string); - - for ($i = 0; $i < $length; $i++) { - if (ord($string[$i]) < 0x80) { - $n = 0; - } elseif ((ord($string[$i]) & 0xE0) === 0xC0) { - $n = 1; - } elseif ((ord($string[$i]) & 0xF0) === 0xE0) { - $n = 2; - } elseif ((ord($string[$i]) & 0xF0) === 0xF0) { - $n = 3; - } else { - return false; - } - - for ($j = 0; $j < $n; $j++) { - if ((++$i === $length) || ((ord($string[$i]) & 0xC0) !== 0x80)) { - return false; - } - } - } - - return true; - } -} diff --git a/vendor/phpunit/phpunit/src/Util/XmlTestListRenderer.php b/vendor/phpunit/phpunit/src/Util/XmlTestListRenderer.php deleted file mode 100644 index d92e1fe..0000000 --- a/vendor/phpunit/phpunit/src/Util/XmlTestListRenderer.php +++ /dev/null @@ -1,90 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util; - -use function get_class; -use function implode; -use function str_replace; -use PHPUnit\Framework\TestCase; -use PHPUnit\Framework\TestSuite; -use PHPUnit\Runner\PhptTestCase; -use RecursiveIteratorIterator; -use XMLWriter; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class XmlTestListRenderer -{ - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function render(TestSuite $suite): string - { - $writer = new XMLWriter; - - $writer->openMemory(); - $writer->setIndent(true); - $writer->startDocument(); - $writer->startElement('tests'); - - $currentTestCase = null; - - foreach (new RecursiveIteratorIterator($suite->getIterator()) as $test) { - if ($test instanceof TestCase) { - if (get_class($test) !== $currentTestCase) { - if ($currentTestCase !== null) { - $writer->endElement(); - } - - $writer->startElement('testCaseClass'); - $writer->writeAttribute('name', get_class($test)); - - $currentTestCase = get_class($test); - } - - $writer->startElement('testCaseMethod'); - $writer->writeAttribute('name', $test->getName(false)); - $writer->writeAttribute('groups', implode(',', $test->getGroups())); - - if (!empty($test->getDataSetAsString(false))) { - $writer->writeAttribute( - 'dataSet', - str_replace( - ' with data set ', - '', - $test->getDataSetAsString(false) - ) - ); - } - - $writer->endElement(); - } elseif ($test instanceof PhptTestCase) { - if ($currentTestCase !== null) { - $writer->endElement(); - - $currentTestCase = null; - } - - $writer->startElement('phptFile'); - $writer->writeAttribute('path', $test->getName()); - $writer->endElement(); - } - } - - if ($currentTestCase !== null) { - $writer->endElement(); - } - - $writer->endElement(); - - return $writer->outputMemory(); - } -} diff --git a/vendor/psr/container/.gitignore b/vendor/psr/container/.gitignore deleted file mode 100644 index b2395aa..0000000 --- a/vendor/psr/container/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -composer.lock -composer.phar -/vendor/ diff --git a/vendor/psr/container/LICENSE b/vendor/psr/container/LICENSE deleted file mode 100644 index 2877a48..0000000 --- a/vendor/psr/container/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013-2016 container-interop -Copyright (c) 2016 PHP Framework Interoperability Group - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/psr/container/README.md b/vendor/psr/container/README.md deleted file mode 100644 index 1b9d9e5..0000000 --- a/vendor/psr/container/README.md +++ /dev/null @@ -1,13 +0,0 @@ -Container interface -============== - -This repository holds all interfaces related to [PSR-11 (Container Interface)][psr-url]. - -Note that this is not a Container implementation of its own. It is merely abstractions that describe the components of a Dependency Injection Container. - -The installable [package][package-url] and [implementations][implementation-url] are listed on Packagist. - -[psr-url]: https://www.php-fig.org/psr/psr-11/ -[package-url]: https://packagist.org/packages/psr/container -[implementation-url]: https://packagist.org/providers/psr/container-implementation - diff --git a/vendor/psr/container/composer.json b/vendor/psr/container/composer.json deleted file mode 100644 index 017f41e..0000000 --- a/vendor/psr/container/composer.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "psr/container", - "type": "library", - "description": "Common Container Interface (PHP FIG PSR-11)", - "keywords": ["psr", "psr-11", "container", "container-interop", "container-interface"], - "homepage": "https://github.com/php-fig/container", - "license": "MIT", - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "require": { - "php": ">=7.4.0" - }, - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - } -} diff --git a/vendor/psr/container/src/ContainerExceptionInterface.php b/vendor/psr/container/src/ContainerExceptionInterface.php deleted file mode 100644 index 0f213f2..0000000 --- a/vendor/psr/container/src/ContainerExceptionInterface.php +++ /dev/null @@ -1,12 +0,0 @@ -=7.0.0", - "psr/http-message": "^1.0" - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - } -} diff --git a/vendor/psr/http-factory/src/RequestFactoryInterface.php b/vendor/psr/http-factory/src/RequestFactoryInterface.php deleted file mode 100644 index cb39a08..0000000 --- a/vendor/psr/http-factory/src/RequestFactoryInterface.php +++ /dev/null @@ -1,18 +0,0 @@ -=5.3.0" - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - } -} diff --git a/vendor/psr/http-message/src/MessageInterface.php b/vendor/psr/http-message/src/MessageInterface.php deleted file mode 100644 index dd46e5e..0000000 --- a/vendor/psr/http-message/src/MessageInterface.php +++ /dev/null @@ -1,187 +0,0 @@ -getHeaders() as $name => $values) { - * echo $name . ": " . implode(", ", $values); - * } - * - * // Emit headers iteratively: - * foreach ($message->getHeaders() as $name => $values) { - * foreach ($values as $value) { - * header(sprintf('%s: %s', $name, $value), false); - * } - * } - * - * While header names are not case-sensitive, getHeaders() will preserve the - * exact case in which headers were originally specified. - * - * @return string[][] Returns an associative array of the message's headers. Each - * key MUST be a header name, and each value MUST be an array of strings - * for that header. - */ - public function getHeaders(); - - /** - * Checks if a header exists by the given case-insensitive name. - * - * @param string $name Case-insensitive header field name. - * @return bool Returns true if any header names match the given header - * name using a case-insensitive string comparison. Returns false if - * no matching header name is found in the message. - */ - public function hasHeader($name); - - /** - * Retrieves a message header value by the given case-insensitive name. - * - * This method returns an array of all the header values of the given - * case-insensitive header name. - * - * If the header does not appear in the message, this method MUST return an - * empty array. - * - * @param string $name Case-insensitive header field name. - * @return string[] An array of string values as provided for the given - * header. If the header does not appear in the message, this method MUST - * return an empty array. - */ - public function getHeader($name); - - /** - * Retrieves a comma-separated string of the values for a single header. - * - * This method returns all of the header values of the given - * case-insensitive header name as a string concatenated together using - * a comma. - * - * NOTE: Not all header values may be appropriately represented using - * comma concatenation. For such headers, use getHeader() instead - * and supply your own delimiter when concatenating. - * - * If the header does not appear in the message, this method MUST return - * an empty string. - * - * @param string $name Case-insensitive header field name. - * @return string A string of values as provided for the given header - * concatenated together using a comma. If the header does not appear in - * the message, this method MUST return an empty string. - */ - public function getHeaderLine($name); - - /** - * Return an instance with the provided value replacing the specified header. - * - * While header names are case-insensitive, the casing of the header will - * be preserved by this function, and returned from getHeaders(). - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * new and/or updated header and value. - * - * @param string $name Case-insensitive header field name. - * @param string|string[] $value Header value(s). - * @return static - * @throws \InvalidArgumentException for invalid header names or values. - */ - public function withHeader($name, $value); - - /** - * Return an instance with the specified header appended with the given value. - * - * Existing values for the specified header will be maintained. The new - * value(s) will be appended to the existing list. If the header did not - * exist previously, it will be added. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * new header and/or value. - * - * @param string $name Case-insensitive header field name to add. - * @param string|string[] $value Header value(s). - * @return static - * @throws \InvalidArgumentException for invalid header names or values. - */ - public function withAddedHeader($name, $value); - - /** - * Return an instance without the specified header. - * - * Header resolution MUST be done without case-sensitivity. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that removes - * the named header. - * - * @param string $name Case-insensitive header field name to remove. - * @return static - */ - public function withoutHeader($name); - - /** - * Gets the body of the message. - * - * @return StreamInterface Returns the body as a stream. - */ - public function getBody(); - - /** - * Return an instance with the specified message body. - * - * The body MUST be a StreamInterface object. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return a new instance that has the - * new body stream. - * - * @param StreamInterface $body Body. - * @return static - * @throws \InvalidArgumentException When the body is not valid. - */ - public function withBody(StreamInterface $body); -} diff --git a/vendor/psr/http-message/src/RequestInterface.php b/vendor/psr/http-message/src/RequestInterface.php deleted file mode 100644 index a96d4fd..0000000 --- a/vendor/psr/http-message/src/RequestInterface.php +++ /dev/null @@ -1,129 +0,0 @@ -getQuery()` - * or from the `QUERY_STRING` server param. - * - * @return array - */ - public function getQueryParams(); - - /** - * Return an instance with the specified query string arguments. - * - * These values SHOULD remain immutable over the course of the incoming - * request. They MAY be injected during instantiation, such as from PHP's - * $_GET superglobal, or MAY be derived from some other value such as the - * URI. In cases where the arguments are parsed from the URI, the data - * MUST be compatible with what PHP's parse_str() would return for - * purposes of how duplicate query parameters are handled, and how nested - * sets are handled. - * - * Setting query string arguments MUST NOT change the URI stored by the - * request, nor the values in the server params. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated query string arguments. - * - * @param array $query Array of query string arguments, typically from - * $_GET. - * @return static - */ - public function withQueryParams(array $query); - - /** - * Retrieve normalized file upload data. - * - * This method returns upload metadata in a normalized tree, with each leaf - * an instance of Psr\Http\Message\UploadedFileInterface. - * - * These values MAY be prepared from $_FILES or the message body during - * instantiation, or MAY be injected via withUploadedFiles(). - * - * @return array An array tree of UploadedFileInterface instances; an empty - * array MUST be returned if no data is present. - */ - public function getUploadedFiles(); - - /** - * Create a new instance with the specified uploaded files. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated body parameters. - * - * @param array $uploadedFiles An array tree of UploadedFileInterface instances. - * @return static - * @throws \InvalidArgumentException if an invalid structure is provided. - */ - public function withUploadedFiles(array $uploadedFiles); - - /** - * Retrieve any parameters provided in the request body. - * - * If the request Content-Type is either application/x-www-form-urlencoded - * or multipart/form-data, and the request method is POST, this method MUST - * return the contents of $_POST. - * - * Otherwise, this method may return any results of deserializing - * the request body content; as parsing returns structured content, the - * potential types MUST be arrays or objects only. A null value indicates - * the absence of body content. - * - * @return null|array|object The deserialized body parameters, if any. - * These will typically be an array or object. - */ - public function getParsedBody(); - - /** - * Return an instance with the specified body parameters. - * - * These MAY be injected during instantiation. - * - * If the request Content-Type is either application/x-www-form-urlencoded - * or multipart/form-data, and the request method is POST, use this method - * ONLY to inject the contents of $_POST. - * - * The data IS NOT REQUIRED to come from $_POST, but MUST be the results of - * deserializing the request body content. Deserialization/parsing returns - * structured data, and, as such, this method ONLY accepts arrays or objects, - * or a null value if nothing was available to parse. - * - * As an example, if content negotiation determines that the request data - * is a JSON payload, this method could be used to create a request - * instance with the deserialized parameters. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated body parameters. - * - * @param null|array|object $data The deserialized body data. This will - * typically be in an array or object. - * @return static - * @throws \InvalidArgumentException if an unsupported argument type is - * provided. - */ - public function withParsedBody($data); - - /** - * Retrieve attributes derived from the request. - * - * The request "attributes" may be used to allow injection of any - * parameters derived from the request: e.g., the results of path - * match operations; the results of decrypting cookies; the results of - * deserializing non-form-encoded message bodies; etc. Attributes - * will be application and request specific, and CAN be mutable. - * - * @return array Attributes derived from the request. - */ - public function getAttributes(); - - /** - * Retrieve a single derived request attribute. - * - * Retrieves a single derived request attribute as described in - * getAttributes(). If the attribute has not been previously set, returns - * the default value as provided. - * - * This method obviates the need for a hasAttribute() method, as it allows - * specifying a default value to return if the attribute is not found. - * - * @see getAttributes() - * @param string $name The attribute name. - * @param mixed $default Default value to return if the attribute does not exist. - * @return mixed - */ - public function getAttribute($name, $default = null); - - /** - * Return an instance with the specified derived request attribute. - * - * This method allows setting a single derived request attribute as - * described in getAttributes(). - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated attribute. - * - * @see getAttributes() - * @param string $name The attribute name. - * @param mixed $value The value of the attribute. - * @return static - */ - public function withAttribute($name, $value); - - /** - * Return an instance that removes the specified derived request attribute. - * - * This method allows removing a single derived request attribute as - * described in getAttributes(). - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that removes - * the attribute. - * - * @see getAttributes() - * @param string $name The attribute name. - * @return static - */ - public function withoutAttribute($name); -} diff --git a/vendor/psr/http-message/src/StreamInterface.php b/vendor/psr/http-message/src/StreamInterface.php deleted file mode 100644 index f68f391..0000000 --- a/vendor/psr/http-message/src/StreamInterface.php +++ /dev/null @@ -1,158 +0,0 @@ - - * [user-info@]host[:port] - * - * - * If the port component is not set or is the standard port for the current - * scheme, it SHOULD NOT be included. - * - * @see https://tools.ietf.org/html/rfc3986#section-3.2 - * @return string The URI authority, in "[user-info@]host[:port]" format. - */ - public function getAuthority(); - - /** - * Retrieve the user information component of the URI. - * - * If no user information is present, this method MUST return an empty - * string. - * - * If a user is present in the URI, this will return that value; - * additionally, if the password is also present, it will be appended to the - * user value, with a colon (":") separating the values. - * - * The trailing "@" character is not part of the user information and MUST - * NOT be added. - * - * @return string The URI user information, in "username[:password]" format. - */ - public function getUserInfo(); - - /** - * Retrieve the host component of the URI. - * - * If no host is present, this method MUST return an empty string. - * - * The value returned MUST be normalized to lowercase, per RFC 3986 - * Section 3.2.2. - * - * @see http://tools.ietf.org/html/rfc3986#section-3.2.2 - * @return string The URI host. - */ - public function getHost(); - - /** - * Retrieve the port component of the URI. - * - * If a port is present, and it is non-standard for the current scheme, - * this method MUST return it as an integer. If the port is the standard port - * used with the current scheme, this method SHOULD return null. - * - * If no port is present, and no scheme is present, this method MUST return - * a null value. - * - * If no port is present, but a scheme is present, this method MAY return - * the standard port for that scheme, but SHOULD return null. - * - * @return null|int The URI port. - */ - public function getPort(); - - /** - * Retrieve the path component of the URI. - * - * The path can either be empty or absolute (starting with a slash) or - * rootless (not starting with a slash). Implementations MUST support all - * three syntaxes. - * - * Normally, the empty path "" and absolute path "/" are considered equal as - * defined in RFC 7230 Section 2.7.3. But this method MUST NOT automatically - * do this normalization because in contexts with a trimmed base path, e.g. - * the front controller, this difference becomes significant. It's the task - * of the user to handle both "" and "/". - * - * The value returned MUST be percent-encoded, but MUST NOT double-encode - * any characters. To determine what characters to encode, please refer to - * RFC 3986, Sections 2 and 3.3. - * - * As an example, if the value should include a slash ("/") not intended as - * delimiter between path segments, that value MUST be passed in encoded - * form (e.g., "%2F") to the instance. - * - * @see https://tools.ietf.org/html/rfc3986#section-2 - * @see https://tools.ietf.org/html/rfc3986#section-3.3 - * @return string The URI path. - */ - public function getPath(); - - /** - * Retrieve the query string of the URI. - * - * If no query string is present, this method MUST return an empty string. - * - * The leading "?" character is not part of the query and MUST NOT be - * added. - * - * The value returned MUST be percent-encoded, but MUST NOT double-encode - * any characters. To determine what characters to encode, please refer to - * RFC 3986, Sections 2 and 3.4. - * - * As an example, if a value in a key/value pair of the query string should - * include an ampersand ("&") not intended as a delimiter between values, - * that value MUST be passed in encoded form (e.g., "%26") to the instance. - * - * @see https://tools.ietf.org/html/rfc3986#section-2 - * @see https://tools.ietf.org/html/rfc3986#section-3.4 - * @return string The URI query string. - */ - public function getQuery(); - - /** - * Retrieve the fragment component of the URI. - * - * If no fragment is present, this method MUST return an empty string. - * - * The leading "#" character is not part of the fragment and MUST NOT be - * added. - * - * The value returned MUST be percent-encoded, but MUST NOT double-encode - * any characters. To determine what characters to encode, please refer to - * RFC 3986, Sections 2 and 3.5. - * - * @see https://tools.ietf.org/html/rfc3986#section-2 - * @see https://tools.ietf.org/html/rfc3986#section-3.5 - * @return string The URI fragment. - */ - public function getFragment(); - - /** - * Return an instance with the specified scheme. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified scheme. - * - * Implementations MUST support the schemes "http" and "https" case - * insensitively, and MAY accommodate other schemes if required. - * - * An empty scheme is equivalent to removing the scheme. - * - * @param string $scheme The scheme to use with the new instance. - * @return static A new instance with the specified scheme. - * @throws \InvalidArgumentException for invalid or unsupported schemes. - */ - public function withScheme($scheme); - - /** - * Return an instance with the specified user information. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified user information. - * - * Password is optional, but the user information MUST include the - * user; an empty string for the user is equivalent to removing user - * information. - * - * @param string $user The user name to use for authority. - * @param null|string $password The password associated with $user. - * @return static A new instance with the specified user information. - */ - public function withUserInfo($user, $password = null); - - /** - * Return an instance with the specified host. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified host. - * - * An empty host value is equivalent to removing the host. - * - * @param string $host The hostname to use with the new instance. - * @return static A new instance with the specified host. - * @throws \InvalidArgumentException for invalid hostnames. - */ - public function withHost($host); - - /** - * Return an instance with the specified port. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified port. - * - * Implementations MUST raise an exception for ports outside the - * established TCP and UDP port ranges. - * - * A null value provided for the port is equivalent to removing the port - * information. - * - * @param null|int $port The port to use with the new instance; a null value - * removes the port information. - * @return static A new instance with the specified port. - * @throws \InvalidArgumentException for invalid ports. - */ - public function withPort($port); - - /** - * Return an instance with the specified path. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified path. - * - * The path can either be empty or absolute (starting with a slash) or - * rootless (not starting with a slash). Implementations MUST support all - * three syntaxes. - * - * If the path is intended to be domain-relative rather than path relative then - * it must begin with a slash ("/"). Paths not starting with a slash ("/") - * are assumed to be relative to some base path known to the application or - * consumer. - * - * Users can provide both encoded and decoded path characters. - * Implementations ensure the correct encoding as outlined in getPath(). - * - * @param string $path The path to use with the new instance. - * @return static A new instance with the specified path. - * @throws \InvalidArgumentException for invalid paths. - */ - public function withPath($path); - - /** - * Return an instance with the specified query string. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified query string. - * - * Users can provide both encoded and decoded query characters. - * Implementations ensure the correct encoding as outlined in getQuery(). - * - * An empty query string value is equivalent to removing the query string. - * - * @param string $query The query string to use with the new instance. - * @return static A new instance with the specified query string. - * @throws \InvalidArgumentException for invalid query strings. - */ - public function withQuery($query); - - /** - * Return an instance with the specified URI fragment. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified URI fragment. - * - * Users can provide both encoded and decoded fragment characters. - * Implementations ensure the correct encoding as outlined in getFragment(). - * - * An empty fragment value is equivalent to removing the fragment. - * - * @param string $fragment The fragment to use with the new instance. - * @return static A new instance with the specified fragment. - */ - public function withFragment($fragment); - - /** - * Return the string representation as a URI reference. - * - * Depending on which components of the URI are present, the resulting - * string is either a full URI or relative reference according to RFC 3986, - * Section 4.1. The method concatenates the various components of the URI, - * using the appropriate delimiters: - * - * - If a scheme is present, it MUST be suffixed by ":". - * - If an authority is present, it MUST be prefixed by "//". - * - The path can be concatenated without delimiters. But there are two - * cases where the path has to be adjusted to make the URI reference - * valid as PHP does not allow to throw an exception in __toString(): - * - If the path is rootless and an authority is present, the path MUST - * be prefixed by "/". - * - If the path is starting with more than one "/" and no authority is - * present, the starting slashes MUST be reduced to one. - * - If a query is present, it MUST be prefixed by "?". - * - If a fragment is present, it MUST be prefixed by "#". - * - * @see http://tools.ietf.org/html/rfc3986#section-4.1 - * @return string - */ - public function __toString(); -} diff --git a/vendor/psr/log/LICENSE b/vendor/psr/log/LICENSE deleted file mode 100644 index 474c952..0000000 --- a/vendor/psr/log/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2012 PHP Framework Interoperability Group - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/psr/log/Psr/Log/AbstractLogger.php b/vendor/psr/log/Psr/Log/AbstractLogger.php deleted file mode 100644 index e02f9da..0000000 --- a/vendor/psr/log/Psr/Log/AbstractLogger.php +++ /dev/null @@ -1,128 +0,0 @@ -log(LogLevel::EMERGENCY, $message, $context); - } - - /** - * Action must be taken immediately. - * - * Example: Entire website down, database unavailable, etc. This should - * trigger the SMS alerts and wake you up. - * - * @param string $message - * @param mixed[] $context - * - * @return void - */ - public function alert($message, array $context = array()) - { - $this->log(LogLevel::ALERT, $message, $context); - } - - /** - * Critical conditions. - * - * Example: Application component unavailable, unexpected exception. - * - * @param string $message - * @param mixed[] $context - * - * @return void - */ - public function critical($message, array $context = array()) - { - $this->log(LogLevel::CRITICAL, $message, $context); - } - - /** - * Runtime errors that do not require immediate action but should typically - * be logged and monitored. - * - * @param string $message - * @param mixed[] $context - * - * @return void - */ - public function error($message, array $context = array()) - { - $this->log(LogLevel::ERROR, $message, $context); - } - - /** - * Exceptional occurrences that are not errors. - * - * Example: Use of deprecated APIs, poor use of an API, undesirable things - * that are not necessarily wrong. - * - * @param string $message - * @param mixed[] $context - * - * @return void - */ - public function warning($message, array $context = array()) - { - $this->log(LogLevel::WARNING, $message, $context); - } - - /** - * Normal but significant events. - * - * @param string $message - * @param mixed[] $context - * - * @return void - */ - public function notice($message, array $context = array()) - { - $this->log(LogLevel::NOTICE, $message, $context); - } - - /** - * Interesting events. - * - * Example: User logs in, SQL logs. - * - * @param string $message - * @param mixed[] $context - * - * @return void - */ - public function info($message, array $context = array()) - { - $this->log(LogLevel::INFO, $message, $context); - } - - /** - * Detailed debug information. - * - * @param string $message - * @param mixed[] $context - * - * @return void - */ - public function debug($message, array $context = array()) - { - $this->log(LogLevel::DEBUG, $message, $context); - } -} diff --git a/vendor/psr/log/Psr/Log/InvalidArgumentException.php b/vendor/psr/log/Psr/Log/InvalidArgumentException.php deleted file mode 100644 index 67f852d..0000000 --- a/vendor/psr/log/Psr/Log/InvalidArgumentException.php +++ /dev/null @@ -1,7 +0,0 @@ -logger = $logger; - } -} diff --git a/vendor/psr/log/Psr/Log/LoggerInterface.php b/vendor/psr/log/Psr/Log/LoggerInterface.php deleted file mode 100644 index 2206cfd..0000000 --- a/vendor/psr/log/Psr/Log/LoggerInterface.php +++ /dev/null @@ -1,125 +0,0 @@ -log(LogLevel::EMERGENCY, $message, $context); - } - - /** - * Action must be taken immediately. - * - * Example: Entire website down, database unavailable, etc. This should - * trigger the SMS alerts and wake you up. - * - * @param string $message - * @param array $context - * - * @return void - */ - public function alert($message, array $context = array()) - { - $this->log(LogLevel::ALERT, $message, $context); - } - - /** - * Critical conditions. - * - * Example: Application component unavailable, unexpected exception. - * - * @param string $message - * @param array $context - * - * @return void - */ - public function critical($message, array $context = array()) - { - $this->log(LogLevel::CRITICAL, $message, $context); - } - - /** - * Runtime errors that do not require immediate action but should typically - * be logged and monitored. - * - * @param string $message - * @param array $context - * - * @return void - */ - public function error($message, array $context = array()) - { - $this->log(LogLevel::ERROR, $message, $context); - } - - /** - * Exceptional occurrences that are not errors. - * - * Example: Use of deprecated APIs, poor use of an API, undesirable things - * that are not necessarily wrong. - * - * @param string $message - * @param array $context - * - * @return void - */ - public function warning($message, array $context = array()) - { - $this->log(LogLevel::WARNING, $message, $context); - } - - /** - * Normal but significant events. - * - * @param string $message - * @param array $context - * - * @return void - */ - public function notice($message, array $context = array()) - { - $this->log(LogLevel::NOTICE, $message, $context); - } - - /** - * Interesting events. - * - * Example: User logs in, SQL logs. - * - * @param string $message - * @param array $context - * - * @return void - */ - public function info($message, array $context = array()) - { - $this->log(LogLevel::INFO, $message, $context); - } - - /** - * Detailed debug information. - * - * @param string $message - * @param array $context - * - * @return void - */ - public function debug($message, array $context = array()) - { - $this->log(LogLevel::DEBUG, $message, $context); - } - - /** - * Logs with an arbitrary level. - * - * @param mixed $level - * @param string $message - * @param array $context - * - * @return void - * - * @throws \Psr\Log\InvalidArgumentException - */ - abstract public function log($level, $message, array $context = array()); -} diff --git a/vendor/psr/log/Psr/Log/NullLogger.php b/vendor/psr/log/Psr/Log/NullLogger.php deleted file mode 100644 index c8f7293..0000000 --- a/vendor/psr/log/Psr/Log/NullLogger.php +++ /dev/null @@ -1,30 +0,0 @@ -logger) { }` - * blocks. - */ -class NullLogger extends AbstractLogger -{ - /** - * Logs with an arbitrary level. - * - * @param mixed $level - * @param string $message - * @param array $context - * - * @return void - * - * @throws \Psr\Log\InvalidArgumentException - */ - public function log($level, $message, array $context = array()) - { - // noop - } -} diff --git a/vendor/psr/log/Psr/Log/Test/DummyTest.php b/vendor/psr/log/Psr/Log/Test/DummyTest.php deleted file mode 100644 index 9638c11..0000000 --- a/vendor/psr/log/Psr/Log/Test/DummyTest.php +++ /dev/null @@ -1,18 +0,0 @@ - ". - * - * Example ->error('Foo') would yield "error Foo". - * - * @return string[] - */ - abstract public function getLogs(); - - public function testImplements() - { - $this->assertInstanceOf('Psr\Log\LoggerInterface', $this->getLogger()); - } - - /** - * @dataProvider provideLevelsAndMessages - */ - public function testLogsAtAllLevels($level, $message) - { - $logger = $this->getLogger(); - $logger->{$level}($message, array('user' => 'Bob')); - $logger->log($level, $message, array('user' => 'Bob')); - - $expected = array( - $level.' message of level '.$level.' with context: Bob', - $level.' message of level '.$level.' with context: Bob', - ); - $this->assertEquals($expected, $this->getLogs()); - } - - public function provideLevelsAndMessages() - { - return array( - LogLevel::EMERGENCY => array(LogLevel::EMERGENCY, 'message of level emergency with context: {user}'), - LogLevel::ALERT => array(LogLevel::ALERT, 'message of level alert with context: {user}'), - LogLevel::CRITICAL => array(LogLevel::CRITICAL, 'message of level critical with context: {user}'), - LogLevel::ERROR => array(LogLevel::ERROR, 'message of level error with context: {user}'), - LogLevel::WARNING => array(LogLevel::WARNING, 'message of level warning with context: {user}'), - LogLevel::NOTICE => array(LogLevel::NOTICE, 'message of level notice with context: {user}'), - LogLevel::INFO => array(LogLevel::INFO, 'message of level info with context: {user}'), - LogLevel::DEBUG => array(LogLevel::DEBUG, 'message of level debug with context: {user}'), - ); - } - - /** - * @expectedException \Psr\Log\InvalidArgumentException - */ - public function testThrowsOnInvalidLevel() - { - $logger = $this->getLogger(); - $logger->log('invalid level', 'Foo'); - } - - public function testContextReplacement() - { - $logger = $this->getLogger(); - $logger->info('{Message {nothing} {user} {foo.bar} a}', array('user' => 'Bob', 'foo.bar' => 'Bar')); - - $expected = array('info {Message {nothing} Bob Bar a}'); - $this->assertEquals($expected, $this->getLogs()); - } - - public function testObjectCastToString() - { - if (method_exists($this, 'createPartialMock')) { - $dummy = $this->createPartialMock('Psr\Log\Test\DummyTest', array('__toString')); - } else { - $dummy = $this->getMock('Psr\Log\Test\DummyTest', array('__toString')); - } - $dummy->expects($this->once()) - ->method('__toString') - ->will($this->returnValue('DUMMY')); - - $this->getLogger()->warning($dummy); - - $expected = array('warning DUMMY'); - $this->assertEquals($expected, $this->getLogs()); - } - - public function testContextCanContainAnything() - { - $closed = fopen('php://memory', 'r'); - fclose($closed); - - $context = array( - 'bool' => true, - 'null' => null, - 'string' => 'Foo', - 'int' => 0, - 'float' => 0.5, - 'nested' => array('with object' => new DummyTest), - 'object' => new \DateTime, - 'resource' => fopen('php://memory', 'r'), - 'closed' => $closed, - ); - - $this->getLogger()->warning('Crazy context data', $context); - - $expected = array('warning Crazy context data'); - $this->assertEquals($expected, $this->getLogs()); - } - - public function testContextExceptionKeyCanBeExceptionOrOtherValues() - { - $logger = $this->getLogger(); - $logger->warning('Random message', array('exception' => 'oops')); - $logger->critical('Uncaught Exception!', array('exception' => new \LogicException('Fail'))); - - $expected = array( - 'warning Random message', - 'critical Uncaught Exception!' - ); - $this->assertEquals($expected, $this->getLogs()); - } -} diff --git a/vendor/psr/log/Psr/Log/Test/TestLogger.php b/vendor/psr/log/Psr/Log/Test/TestLogger.php deleted file mode 100644 index 1be3230..0000000 --- a/vendor/psr/log/Psr/Log/Test/TestLogger.php +++ /dev/null @@ -1,147 +0,0 @@ - $level, - 'message' => $message, - 'context' => $context, - ]; - - $this->recordsByLevel[$record['level']][] = $record; - $this->records[] = $record; - } - - public function hasRecords($level) - { - return isset($this->recordsByLevel[$level]); - } - - public function hasRecord($record, $level) - { - if (is_string($record)) { - $record = ['message' => $record]; - } - return $this->hasRecordThatPasses(function ($rec) use ($record) { - if ($rec['message'] !== $record['message']) { - return false; - } - if (isset($record['context']) && $rec['context'] !== $record['context']) { - return false; - } - return true; - }, $level); - } - - public function hasRecordThatContains($message, $level) - { - return $this->hasRecordThatPasses(function ($rec) use ($message) { - return strpos($rec['message'], $message) !== false; - }, $level); - } - - public function hasRecordThatMatches($regex, $level) - { - return $this->hasRecordThatPasses(function ($rec) use ($regex) { - return preg_match($regex, $rec['message']) > 0; - }, $level); - } - - public function hasRecordThatPasses(callable $predicate, $level) - { - if (!isset($this->recordsByLevel[$level])) { - return false; - } - foreach ($this->recordsByLevel[$level] as $i => $rec) { - if (call_user_func($predicate, $rec, $i)) { - return true; - } - } - return false; - } - - public function __call($method, $args) - { - if (preg_match('/(.*)(Debug|Info|Notice|Warning|Error|Critical|Alert|Emergency)(.*)/', $method, $matches) > 0) { - $genericMethod = $matches[1] . ('Records' !== $matches[3] ? 'Record' : '') . $matches[3]; - $level = strtolower($matches[2]); - if (method_exists($this, $genericMethod)) { - $args[] = $level; - return call_user_func_array([$this, $genericMethod], $args); - } - } - throw new \BadMethodCallException('Call to undefined method ' . get_class($this) . '::' . $method . '()'); - } - - public function reset() - { - $this->records = []; - $this->recordsByLevel = []; - } -} diff --git a/vendor/psr/log/README.md b/vendor/psr/log/README.md deleted file mode 100644 index a9f20c4..0000000 --- a/vendor/psr/log/README.md +++ /dev/null @@ -1,58 +0,0 @@ -PSR Log -======= - -This repository holds all interfaces/classes/traits related to -[PSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md). - -Note that this is not a logger of its own. It is merely an interface that -describes a logger. See the specification for more details. - -Installation ------------- - -```bash -composer require psr/log -``` - -Usage ------ - -If you need a logger, you can use the interface like this: - -```php -logger = $logger; - } - - public function doSomething() - { - if ($this->logger) { - $this->logger->info('Doing work'); - } - - try { - $this->doSomethingElse(); - } catch (Exception $exception) { - $this->logger->error('Oh no!', array('exception' => $exception)); - } - - // do something useful - } -} -``` - -You can then pick one of the implementations of the interface to get a logger. - -If you want to implement the interface, you can require this package and -implement `Psr\Log\LoggerInterface` in your code. Please read the -[specification text](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md) -for details. diff --git a/vendor/psr/log/composer.json b/vendor/psr/log/composer.json deleted file mode 100644 index ca05695..0000000 --- a/vendor/psr/log/composer.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "psr/log", - "description": "Common interface for logging libraries", - "keywords": ["psr", "psr-3", "log"], - "homepage": "https://github.com/php-fig/log", - "license": "MIT", - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "require": { - "php": ">=5.3.0" - }, - "autoload": { - "psr-4": { - "Psr\\Log\\": "Psr/Log/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - } -} diff --git a/vendor/ralouphie/getallheaders/LICENSE b/vendor/ralouphie/getallheaders/LICENSE deleted file mode 100644 index be5540c..0000000 --- a/vendor/ralouphie/getallheaders/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Ralph Khattar - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/ralouphie/getallheaders/README.md b/vendor/ralouphie/getallheaders/README.md deleted file mode 100644 index 9430d76..0000000 --- a/vendor/ralouphie/getallheaders/README.md +++ /dev/null @@ -1,27 +0,0 @@ -getallheaders -============= - -PHP `getallheaders()` polyfill. Compatible with PHP >= 5.3. - -[![Build Status](https://travis-ci.org/ralouphie/getallheaders.svg?branch=master)](https://travis-ci.org/ralouphie/getallheaders) -[![Coverage Status](https://coveralls.io/repos/ralouphie/getallheaders/badge.png?branch=master)](https://coveralls.io/r/ralouphie/getallheaders?branch=master) -[![Latest Stable Version](https://poser.pugx.org/ralouphie/getallheaders/v/stable.png)](https://packagist.org/packages/ralouphie/getallheaders) -[![Latest Unstable Version](https://poser.pugx.org/ralouphie/getallheaders/v/unstable.png)](https://packagist.org/packages/ralouphie/getallheaders) -[![License](https://poser.pugx.org/ralouphie/getallheaders/license.png)](https://packagist.org/packages/ralouphie/getallheaders) - - -This is a simple polyfill for [`getallheaders()`](http://www.php.net/manual/en/function.getallheaders.php). - -## Install - -For PHP version **`>= 5.6`**: - -``` -composer require ralouphie/getallheaders -``` - -For PHP version **`< 5.6`**: - -``` -composer require ralouphie/getallheaders "^2" -``` diff --git a/vendor/ralouphie/getallheaders/composer.json b/vendor/ralouphie/getallheaders/composer.json deleted file mode 100644 index de8ce62..0000000 --- a/vendor/ralouphie/getallheaders/composer.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "ralouphie/getallheaders", - "description": "A polyfill for getallheaders.", - "license": "MIT", - "authors": [ - { - "name": "Ralph Khattar", - "email": "ralph.khattar@gmail.com" - } - ], - "require": { - "php": ">=5.6" - }, - "require-dev": { - "phpunit/phpunit": "^5 || ^6.5", - "php-coveralls/php-coveralls": "^2.1" - }, - "autoload": { - "files": ["src/getallheaders.php"] - }, - "autoload-dev": { - "psr-4": { - "getallheaders\\Tests\\": "tests/" - } - } -} diff --git a/vendor/ralouphie/getallheaders/src/getallheaders.php b/vendor/ralouphie/getallheaders/src/getallheaders.php deleted file mode 100644 index c7285a5..0000000 --- a/vendor/ralouphie/getallheaders/src/getallheaders.php +++ /dev/null @@ -1,46 +0,0 @@ - 'Content-Type', - 'CONTENT_LENGTH' => 'Content-Length', - 'CONTENT_MD5' => 'Content-Md5', - ); - - foreach ($_SERVER as $key => $value) { - if (substr($key, 0, 5) === 'HTTP_') { - $key = substr($key, 5); - if (!isset($copy_server[$key]) || !isset($_SERVER[$key])) { - $key = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', $key)))); - $headers[$key] = $value; - } - } elseif (isset($copy_server[$key])) { - $headers[$copy_server[$key]] = $value; - } - } - - if (!isset($headers['Authorization'])) { - if (isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION'])) { - $headers['Authorization'] = $_SERVER['REDIRECT_HTTP_AUTHORIZATION']; - } elseif (isset($_SERVER['PHP_AUTH_USER'])) { - $basic_pass = isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : ''; - $headers['Authorization'] = 'Basic ' . base64_encode($_SERVER['PHP_AUTH_USER'] . ':' . $basic_pass); - } elseif (isset($_SERVER['PHP_AUTH_DIGEST'])) { - $headers['Authorization'] = $_SERVER['PHP_AUTH_DIGEST']; - } - } - - return $headers; - } - -} diff --git a/vendor/sebastian/code-unit-reverse-lookup/.gitignore b/vendor/sebastian/code-unit-reverse-lookup/.gitignore deleted file mode 100644 index 9e5f1db..0000000 --- a/vendor/sebastian/code-unit-reverse-lookup/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -/.idea -/composer.lock -/vendor - diff --git a/vendor/sebastian/code-unit-reverse-lookup/.php_cs b/vendor/sebastian/code-unit-reverse-lookup/.php_cs deleted file mode 100644 index b7393bd..0000000 --- a/vendor/sebastian/code-unit-reverse-lookup/.php_cs +++ /dev/null @@ -1,67 +0,0 @@ -files() - ->in('src') - ->in('tests') - ->name('*.php'); - -return Symfony\CS\Config\Config::create() - ->level(\Symfony\CS\FixerInterface::NONE_LEVEL) - ->fixers( - array( - 'align_double_arrow', - 'align_equals', - 'braces', - 'concat_with_spaces', - 'duplicate_semicolon', - 'elseif', - 'empty_return', - 'encoding', - 'eof_ending', - 'extra_empty_lines', - 'function_call_space', - 'function_declaration', - 'indentation', - 'join_function', - 'line_after_namespace', - 'linefeed', - 'list_commas', - 'lowercase_constants', - 'lowercase_keywords', - 'method_argument_space', - 'multiple_use', - 'namespace_no_leading_whitespace', - 'no_blank_lines_after_class_opening', - 'no_empty_lines_after_phpdocs', - 'parenthesis', - 'php_closing_tag', - 'phpdoc_indent', - 'phpdoc_no_access', - 'phpdoc_no_empty_return', - 'phpdoc_no_package', - 'phpdoc_params', - 'phpdoc_scalar', - 'phpdoc_separation', - 'phpdoc_to_comment', - 'phpdoc_trim', - 'phpdoc_types', - 'phpdoc_var_without_name', - 'remove_lines_between_uses', - 'return', - 'self_accessor', - 'short_array_syntax', - 'short_tag', - 'single_line_after_imports', - 'single_quote', - 'spaces_before_semicolon', - 'spaces_cast', - 'ternary_spaces', - 'trailing_spaces', - 'trim_array_spaces', - 'unused_use', - 'visibility', - 'whitespacy_lines' - ) - ) - ->finder($finder); - diff --git a/vendor/sebastian/code-unit-reverse-lookup/.travis.yml b/vendor/sebastian/code-unit-reverse-lookup/.travis.yml deleted file mode 100644 index 9d9c9d9..0000000 --- a/vendor/sebastian/code-unit-reverse-lookup/.travis.yml +++ /dev/null @@ -1,25 +0,0 @@ -language: php - -php: - - 5.6 - - 7.0 - - 7.0snapshot - - 7.1 - - 7.1snapshot - - master - -sudo: false - -before_install: - - composer self-update - - composer clear-cache - -install: - - travis_retry composer update --no-interaction --no-ansi --no-progress --no-suggest --optimize-autoloader --prefer-stable - -script: - - ./vendor/bin/phpunit - -notifications: - email: false - diff --git a/vendor/sebastian/code-unit-reverse-lookup/ChangeLog.md b/vendor/sebastian/code-unit-reverse-lookup/ChangeLog.md deleted file mode 100644 index d136bf5..0000000 --- a/vendor/sebastian/code-unit-reverse-lookup/ChangeLog.md +++ /dev/null @@ -1,15 +0,0 @@ -# Change Log - -All notable changes to `sebastianbergmann/code-unit-reverse-lookup` are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. - -## [1.0.2] - 2020-11-30 - -### Changed - -* Changed PHP version constraint in `composer.json` from `^5.6 || ^7.0` to `>=5.6` - -## 1.0.0 - 2016-02-13 - -* Initial release - -[1.0.2]: https://github.com/sebastianbergmann/code-unit-reverse-lookup/compare/1.0.1...1.0.2 diff --git a/vendor/sebastian/code-unit-reverse-lookup/LICENSE b/vendor/sebastian/code-unit-reverse-lookup/LICENSE deleted file mode 100644 index 8f24384..0000000 --- a/vendor/sebastian/code-unit-reverse-lookup/LICENSE +++ /dev/null @@ -1,33 +0,0 @@ -code-unit-reverse-lookup - -Copyright (c) 2016-2017, Sebastian Bergmann . -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Sebastian Bergmann nor the names of his - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/sebastian/code-unit-reverse-lookup/README.md b/vendor/sebastian/code-unit-reverse-lookup/README.md deleted file mode 100644 index 2bf26af..0000000 --- a/vendor/sebastian/code-unit-reverse-lookup/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# code-unit-reverse-lookup - -Looks up which function or method a line of code belongs to. - -## Installation - -You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): - - composer require sebastian/code-unit-reverse-lookup - -If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: - - composer require --dev sebastian/code-unit-reverse-lookup - diff --git a/vendor/sebastian/code-unit-reverse-lookup/build.xml b/vendor/sebastian/code-unit-reverse-lookup/build.xml deleted file mode 100644 index 24cf32e..0000000 --- a/vendor/sebastian/code-unit-reverse-lookup/build.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/sebastian/code-unit-reverse-lookup/composer.json b/vendor/sebastian/code-unit-reverse-lookup/composer.json deleted file mode 100644 index ba32ed6..0000000 --- a/vendor/sebastian/code-unit-reverse-lookup/composer.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "sebastian/code-unit-reverse-lookup", - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "require": { - "php": ">=5.6" - }, - "require-dev": { - "phpunit/phpunit": "^8.5" - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - } -} diff --git a/vendor/sebastian/code-unit-reverse-lookup/phpunit.xml b/vendor/sebastian/code-unit-reverse-lookup/phpunit.xml deleted file mode 100644 index 2c0569e..0000000 --- a/vendor/sebastian/code-unit-reverse-lookup/phpunit.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - tests - - - - - src - - - diff --git a/vendor/sebastian/code-unit-reverse-lookup/src/Wizard.php b/vendor/sebastian/code-unit-reverse-lookup/src/Wizard.php deleted file mode 100644 index 20f8880..0000000 --- a/vendor/sebastian/code-unit-reverse-lookup/src/Wizard.php +++ /dev/null @@ -1,111 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\CodeUnitReverseLookup; - -/** - * @since Class available since Release 1.0.0 - */ -class Wizard -{ - /** - * @var array - */ - private $lookupTable = []; - - /** - * @var array - */ - private $processedClasses = []; - - /** - * @var array - */ - private $processedFunctions = []; - - /** - * @param string $filename - * @param int $lineNumber - * - * @return string - */ - public function lookup($filename, $lineNumber) - { - if (!isset($this->lookupTable[$filename][$lineNumber])) { - $this->updateLookupTable(); - } - - if (isset($this->lookupTable[$filename][$lineNumber])) { - return $this->lookupTable[$filename][$lineNumber]; - } else { - return $filename . ':' . $lineNumber; - } - } - - private function updateLookupTable() - { - $this->processClassesAndTraits(); - $this->processFunctions(); - } - - private function processClassesAndTraits() - { - foreach (array_merge(get_declared_classes(), get_declared_traits()) as $classOrTrait) { - if (isset($this->processedClasses[$classOrTrait])) { - continue; - } - - $reflector = new \ReflectionClass($classOrTrait); - - foreach ($reflector->getMethods() as $method) { - $this->processFunctionOrMethod($method); - } - - $this->processedClasses[$classOrTrait] = true; - } - } - - private function processFunctions() - { - foreach (get_defined_functions()['user'] as $function) { - if (isset($this->processedFunctions[$function])) { - continue; - } - - $this->processFunctionOrMethod(new \ReflectionFunction($function)); - - $this->processedFunctions[$function] = true; - } - } - - /** - * @param \ReflectionFunctionAbstract $functionOrMethod - */ - private function processFunctionOrMethod(\ReflectionFunctionAbstract $functionOrMethod) - { - if ($functionOrMethod->isInternal()) { - return; - } - - $name = $functionOrMethod->getName(); - - if ($functionOrMethod instanceof \ReflectionMethod) { - $name = $functionOrMethod->getDeclaringClass()->getName() . '::' . $name; - } - - if (!isset($this->lookupTable[$functionOrMethod->getFileName()])) { - $this->lookupTable[$functionOrMethod->getFileName()] = []; - } - - foreach (range($functionOrMethod->getStartLine(), $functionOrMethod->getEndLine()) as $line) { - $this->lookupTable[$functionOrMethod->getFileName()][$line] = $name; - } - } -} diff --git a/vendor/sebastian/code-unit-reverse-lookup/tests/WizardTest.php b/vendor/sebastian/code-unit-reverse-lookup/tests/WizardTest.php deleted file mode 100644 index 711ad28..0000000 --- a/vendor/sebastian/code-unit-reverse-lookup/tests/WizardTest.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\CodeUnitReverseLookup; - -use PHPUnit\Framework\TestCase; - -/** - * @covers SebastianBergmann\CodeUnitReverseLookup\Wizard - */ -class WizardTest extends TestCase -{ - /** - * @var Wizard - */ - private $wizard; - - protected function setUp(): void - { - $this->wizard = new Wizard; - } - - public function testMethodCanBeLookedUp() - { - $this->assertEquals( - __METHOD__, - $this->wizard->lookup(__FILE__, __LINE__) - ); - } - - public function testReturnsFilenameAndLineNumberAsStringWhenNotInCodeUnit() - { - $this->assertEquals( - 'file.php:1', - $this->wizard->lookup('file.php', 1) - ); - } -} diff --git a/vendor/sebastian/comparator/.github/stale.yml b/vendor/sebastian/comparator/.github/stale.yml deleted file mode 100644 index 4eadca3..0000000 --- a/vendor/sebastian/comparator/.github/stale.yml +++ /dev/null @@ -1,40 +0,0 @@ -# Configuration for probot-stale - https://github.com/probot/stale - -# Number of days of inactivity before an Issue or Pull Request becomes stale -daysUntilStale: 60 - -# Number of days of inactivity before a stale Issue or Pull Request is closed. -# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale. -daysUntilClose: 7 - -# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable -exemptLabels: - - enhancement - -# Set to true to ignore issues in a project (defaults to false) -exemptProjects: false - -# Set to true to ignore issues in a milestone (defaults to false) -exemptMilestones: false - -# Label to use when marking as stale -staleLabel: stale - -# Comment to post when marking as stale. Set to `false` to disable -markComment: > - This issue has been automatically marked as stale because it has not had activity within the last 60 days. It will be closed after 7 days if no further activity occurs. Thank you for your contributions. - -# Comment to post when removing the stale label. -# unmarkComment: > -# Your comment here. - -# Comment to post when closing a stale Issue or Pull Request. -closeComment: > - This issue has been automatically closed because it has not had activity since it was marked as stale. Thank you for your contributions. - -# Limit the number of actions per hour, from 1-30. Default is 30 -limitPerRun: 30 - -# Limit to only `issues` or `pulls` -only: issues - diff --git a/vendor/sebastian/comparator/.gitignore b/vendor/sebastian/comparator/.gitignore deleted file mode 100644 index c3e9d7e..0000000 --- a/vendor/sebastian/comparator/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -/.idea -/.php_cs.cache -/composer.lock -/vendor diff --git a/vendor/sebastian/comparator/.php_cs.dist b/vendor/sebastian/comparator/.php_cs.dist deleted file mode 100644 index acf47b3..0000000 --- a/vendor/sebastian/comparator/.php_cs.dist +++ /dev/null @@ -1,189 +0,0 @@ - - -For the full copyright and license information, please view the LICENSE -file that was distributed with this source code. -EOF; - -return PhpCsFixer\Config::create() - ->setRiskyAllowed(true) - ->setRules( - [ - 'align_multiline_comment' => true, - 'array_indentation' => true, - 'array_syntax' => ['syntax' => 'short'], - 'binary_operator_spaces' => [ - 'operators' => [ - '=' => 'align', - '=>' => 'align', - ], - ], - 'blank_line_after_namespace' => true, - 'blank_line_before_statement' => [ - 'statements' => [ - 'break', - 'continue', - 'declare', - 'do', - 'for', - 'foreach', - 'if', - 'include', - 'include_once', - 'require', - 'require_once', - 'return', - 'switch', - 'throw', - 'try', - 'while', - 'yield', - ], - ], - 'braces' => true, - 'cast_spaces' => true, - 'class_attributes_separation' => ['elements' => ['const', 'method', 'property']], - 'combine_consecutive_issets' => true, - 'combine_consecutive_unsets' => true, - 'compact_nullable_typehint' => true, - 'concat_space' => ['spacing' => 'one'], - 'declare_equal_normalize' => ['space' => 'none'], - 'dir_constant' => true, - 'elseif' => true, - 'encoding' => true, - 'full_opening_tag' => true, - 'function_declaration' => true, - 'header_comment' => ['header' => $header, 'separate' => 'none'], - 'indentation_type' => true, - 'is_null' => true, - 'line_ending' => true, - 'list_syntax' => ['syntax' => 'short'], - 'logical_operators' => true, - 'lowercase_cast' => true, - 'lowercase_constants' => true, - 'lowercase_keywords' => true, - 'lowercase_static_reference' => true, - 'magic_constant_casing' => true, - 'method_argument_space' => ['ensure_fully_multiline' => true], - 'modernize_types_casting' => true, - 'multiline_comment_opening_closing' => true, - 'multiline_whitespace_before_semicolons' => true, - 'native_constant_invocation' => true, - 'native_function_casing' => true, - 'native_function_invocation' => true, - 'new_with_braces' => false, - 'no_alias_functions' => true, - 'no_alternative_syntax' => true, - 'no_blank_lines_after_class_opening' => true, - 'no_blank_lines_after_phpdoc' => true, - 'no_blank_lines_before_namespace' => true, - 'no_closing_tag' => true, - 'no_empty_comment' => true, - 'no_empty_phpdoc' => true, - 'no_empty_statement' => true, - 'no_extra_blank_lines' => true, - 'no_homoglyph_names' => true, - 'no_leading_import_slash' => true, - 'no_leading_namespace_whitespace' => true, - 'no_mixed_echo_print' => ['use' => 'print'], - 'no_multiline_whitespace_around_double_arrow' => true, - 'no_null_property_initialization' => true, - 'no_php4_constructor' => true, - 'no_short_bool_cast' => true, - 'no_short_echo_tag' => true, - 'no_singleline_whitespace_before_semicolons' => true, - 'no_spaces_after_function_name' => true, - 'no_spaces_inside_parenthesis' => true, - 'no_superfluous_elseif' => true, - 'no_superfluous_phpdoc_tags' => true, - 'no_trailing_comma_in_list_call' => true, - 'no_trailing_comma_in_singleline_array' => true, - 'no_trailing_whitespace' => true, - 'no_trailing_whitespace_in_comment' => true, - 'no_unneeded_control_parentheses' => true, - 'no_unneeded_curly_braces' => true, - 'no_unneeded_final_method' => true, - 'no_unreachable_default_argument_value' => true, - 'no_unset_on_property' => true, - 'no_unused_imports' => true, - 'no_useless_else' => true, - 'no_useless_return' => true, - 'no_whitespace_before_comma_in_array' => true, - 'no_whitespace_in_blank_line' => true, - 'non_printable_character' => true, - 'normalize_index_brace' => true, - 'object_operator_without_whitespace' => true, - 'ordered_class_elements' => [ - 'order' => [ - 'use_trait', - 'constant_public', - 'constant_protected', - 'constant_private', - 'property_public_static', - 'property_protected_static', - 'property_private_static', - 'property_public', - 'property_protected', - 'property_private', - 'method_public_static', - 'construct', - 'destruct', - 'magic', - 'phpunit', - 'method_public', - 'method_protected', - 'method_private', - 'method_protected_static', - 'method_private_static', - ], - ], - 'ordered_imports' => true, - 'phpdoc_add_missing_param_annotation' => true, - 'phpdoc_align' => true, - 'phpdoc_annotation_without_dot' => true, - 'phpdoc_indent' => true, - 'phpdoc_no_access' => true, - 'phpdoc_no_empty_return' => true, - 'phpdoc_no_package' => true, - 'phpdoc_order' => true, - 'phpdoc_return_self_reference' => true, - 'phpdoc_scalar' => true, - 'phpdoc_separation' => true, - 'phpdoc_single_line_var_spacing' => true, - 'phpdoc_to_comment' => true, - 'phpdoc_trim' => true, - 'phpdoc_trim_consecutive_blank_line_separation' => true, - 'phpdoc_types' => true, - 'phpdoc_types_order' => true, - 'phpdoc_var_without_name' => true, - 'pow_to_exponentiation' => true, - 'protected_to_private' => true, - 'return_assignment' => true, - 'return_type_declaration' => ['space_before' => 'none'], - 'self_accessor' => true, - 'semicolon_after_instruction' => true, - 'set_type_to_cast' => true, - 'short_scalar_cast' => true, - 'simplified_null_return' => true, - 'single_blank_line_at_eof' => true, - 'single_import_per_statement' => true, - 'single_line_after_imports' => true, - 'single_quote' => true, - 'standardize_not_equals' => true, - 'ternary_to_null_coalescing' => true, - 'trim_array_spaces' => true, - 'unary_operator_spaces' => true, - 'visibility_required' => true, - //'void_return' => true, - 'whitespace_after_comma_in_array' => true, - ] - ) - ->setFinder( - PhpCsFixer\Finder::create() - ->files() - ->in(__DIR__ . '/src') - ->in(__DIR__ . '/tests') - ); diff --git a/vendor/sebastian/comparator/.travis.yml b/vendor/sebastian/comparator/.travis.yml deleted file mode 100644 index 7583d0f..0000000 --- a/vendor/sebastian/comparator/.travis.yml +++ /dev/null @@ -1,33 +0,0 @@ -language: php - -sudo: false - -php: - - 7.1 - - 7.2 - - master - -env: - matrix: - - DEPENDENCIES="high" - - DEPENDENCIES="low" - global: - - DEFAULT_COMPOSER_FLAGS="--no-interaction --no-ansi --no-progress --no-suggest" - -before_install: - - composer self-update - - composer clear-cache - -install: - - if [[ "$DEPENDENCIES" = 'high' ]]; then travis_retry composer update $DEFAULT_COMPOSER_FLAGS; fi - - if [[ "$DEPENDENCIES" = 'low' ]]; then travis_retry composer update $DEFAULT_COMPOSER_FLAGS --prefer-lowest; fi - -script: - - ./vendor/bin/phpunit --coverage-clover=coverage.xml - -after_success: - - bash <(curl -s https://codecov.io/bash) - -notifications: - email: false - diff --git a/vendor/sebastian/comparator/ChangeLog.md b/vendor/sebastian/comparator/ChangeLog.md deleted file mode 100644 index f4d9787..0000000 --- a/vendor/sebastian/comparator/ChangeLog.md +++ /dev/null @@ -1,66 +0,0 @@ -# ChangeLog - -All notable changes are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. - -## [3.0.3] - 2020-11-30 - -### Changed - -* Changed PHP version constraint in `composer.json` from `^7.1` to `>=7.1` - -## [3.0.2] - 2018-07-12 - -### Changed - -* By default, `MockObjectComparator` is now tried before all other (default) comparators - -## [3.0.1] - 2018-06-14 - -### Fixed - -* Fixed [#53](https://github.com/sebastianbergmann/comparator/pull/53): `DOMNodeComparator` ignores `$ignoreCase` parameter -* Fixed [#58](https://github.com/sebastianbergmann/comparator/pull/58): `ScalarComparator` does not handle extremely ugly string comparison edge cases - -## [3.0.0] - 2018-04-18 - -### Fixed - -* Fixed [#48](https://github.com/sebastianbergmann/comparator/issues/48): `DateTimeComparator` does not support fractional second deltas - -### Removed - -* Removed support for PHP 7.0 - -## [2.1.3] - 2018-02-01 - -### Changed - -* This component is now compatible with version 3 of `sebastian/diff` - -## [2.1.2] - 2018-01-12 - -### Fixed - -* Fix comparison of `DateTimeImmutable` objects - -## [2.1.1] - 2017-12-22 - -### Fixed - -* Fixed [phpunit/#2923](https://github.com/sebastianbergmann/phpunit/issues/2923): Unexpected failed date matching - -## [2.1.0] - 2017-11-03 - -### Added - -* Added `SebastianBergmann\Comparator\Factory::reset()` to unregister all non-default comparators -* Added support for `phpunit/phpunit-mock-objects` version `^5.0` - -[3.0.3]: https://github.com/sebastianbergmann/comparator/compare/3.0.2...3.0.3 -[3.0.2]: https://github.com/sebastianbergmann/comparator/compare/3.0.1...3.0.2 -[3.0.1]: https://github.com/sebastianbergmann/comparator/compare/3.0.0...3.0.1 -[3.0.0]: https://github.com/sebastianbergmann/comparator/compare/2.1.3...3.0.0 -[2.1.3]: https://github.com/sebastianbergmann/comparator/compare/2.1.2...2.1.3 -[2.1.2]: https://github.com/sebastianbergmann/comparator/compare/2.1.1...2.1.2 -[2.1.1]: https://github.com/sebastianbergmann/comparator/compare/2.1.0...2.1.1 -[2.1.0]: https://github.com/sebastianbergmann/comparator/compare/2.0.2...2.1.0 diff --git a/vendor/sebastian/comparator/LICENSE b/vendor/sebastian/comparator/LICENSE deleted file mode 100644 index 46d0f25..0000000 --- a/vendor/sebastian/comparator/LICENSE +++ /dev/null @@ -1,33 +0,0 @@ -Comparator - -Copyright (c) 2002-2018, Sebastian Bergmann . -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Sebastian Bergmann nor the names of his - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/sebastian/comparator/README.md b/vendor/sebastian/comparator/README.md deleted file mode 100644 index 524211a..0000000 --- a/vendor/sebastian/comparator/README.md +++ /dev/null @@ -1,37 +0,0 @@ -[![Build Status](https://travis-ci.org/sebastianbergmann/comparator.svg?branch=master)](https://travis-ci.org/sebastianbergmann/comparator) - -# Comparator - -This component provides the functionality to compare PHP values for equality. - -## Installation - -You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): - - composer require sebastian/comparator - -If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: - - composer require --dev sebastian/comparator - -## Usage - -```php -getComparatorFor($date1, $date2); - -try { - $comparator->assertEquals($date1, $date2); - print "Dates match"; -} catch (ComparisonFailure $failure) { - print "Dates don't match"; -} -``` - diff --git a/vendor/sebastian/comparator/build.xml b/vendor/sebastian/comparator/build.xml deleted file mode 100644 index 8e27999..0000000 --- a/vendor/sebastian/comparator/build.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/sebastian/comparator/composer.json b/vendor/sebastian/comparator/composer.json deleted file mode 100644 index 00dfc29..0000000 --- a/vendor/sebastian/comparator/composer.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "sebastian/comparator", - "description": "Provides the functionality to compare PHP values for equality", - "keywords": ["comparator","compare","equality"], - "homepage": "https://github.com/sebastianbergmann/comparator", - "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" - } - ], - "prefer-stable": true, - "require": { - "php": ">=7.1", - "sebastian/diff": "^3.0", - "sebastian/exporter": "^3.1" - }, - "require-dev": { - "phpunit/phpunit": "^8.5" - }, - "config": { - "optimize-autoloader": true, - "sort-packages": true - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "autoload-dev": { - "classmap": [ - "tests/_fixture" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - } -} - diff --git a/vendor/sebastian/comparator/phpunit.xml b/vendor/sebastian/comparator/phpunit.xml deleted file mode 100644 index 3e12be4..0000000 --- a/vendor/sebastian/comparator/phpunit.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - tests - - - - - - src - - - diff --git a/vendor/sebastian/comparator/src/ArrayComparator.php b/vendor/sebastian/comparator/src/ArrayComparator.php deleted file mode 100644 index 4b2fadf..0000000 --- a/vendor/sebastian/comparator/src/ArrayComparator.php +++ /dev/null @@ -1,130 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -/** - * Compares arrays for equality. - */ -class ArrayComparator extends Comparator -{ - /** - * Returns whether the comparator can compare two values. - * - * @param mixed $expected The first value to compare - * @param mixed $actual The second value to compare - * - * @return bool - */ - public function accepts($expected, $actual) - { - return \is_array($expected) && \is_array($actual); - } - - /** - * Asserts that two values are equal. - * - * @param mixed $expected First value to compare - * @param mixed $actual Second value to compare - * @param float $delta Allowed numerical distance between two values to consider them equal - * @param bool $canonicalize Arrays are sorted before comparison when set to true - * @param bool $ignoreCase Case is ignored when set to true - * @param array $processed List of already processed elements (used to prevent infinite recursion) - * - * @throws ComparisonFailure - */ - public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false, array &$processed = []) - { - if ($canonicalize) { - \sort($expected); - \sort($actual); - } - - $remaining = $actual; - $actualAsString = "Array (\n"; - $expectedAsString = "Array (\n"; - $equal = true; - - foreach ($expected as $key => $value) { - unset($remaining[$key]); - - if (!\array_key_exists($key, $actual)) { - $expectedAsString .= \sprintf( - " %s => %s\n", - $this->exporter->export($key), - $this->exporter->shortenedExport($value) - ); - - $equal = false; - - continue; - } - - try { - $comparator = $this->factory->getComparatorFor($value, $actual[$key]); - $comparator->assertEquals($value, $actual[$key], $delta, $canonicalize, $ignoreCase, $processed); - - $expectedAsString .= \sprintf( - " %s => %s\n", - $this->exporter->export($key), - $this->exporter->shortenedExport($value) - ); - - $actualAsString .= \sprintf( - " %s => %s\n", - $this->exporter->export($key), - $this->exporter->shortenedExport($actual[$key]) - ); - } catch (ComparisonFailure $e) { - $expectedAsString .= \sprintf( - " %s => %s\n", - $this->exporter->export($key), - $e->getExpectedAsString() ? $this->indent($e->getExpectedAsString()) : $this->exporter->shortenedExport($e->getExpected()) - ); - - $actualAsString .= \sprintf( - " %s => %s\n", - $this->exporter->export($key), - $e->getActualAsString() ? $this->indent($e->getActualAsString()) : $this->exporter->shortenedExport($e->getActual()) - ); - - $equal = false; - } - } - - foreach ($remaining as $key => $value) { - $actualAsString .= \sprintf( - " %s => %s\n", - $this->exporter->export($key), - $this->exporter->shortenedExport($value) - ); - - $equal = false; - } - - $expectedAsString .= ')'; - $actualAsString .= ')'; - - if (!$equal) { - throw new ComparisonFailure( - $expected, - $actual, - $expectedAsString, - $actualAsString, - false, - 'Failed asserting that two arrays are equal.' - ); - } - } - - protected function indent($lines) - { - return \trim(\str_replace("\n", "\n ", $lines)); - } -} diff --git a/vendor/sebastian/comparator/src/Comparator.php b/vendor/sebastian/comparator/src/Comparator.php deleted file mode 100644 index 661746d..0000000 --- a/vendor/sebastian/comparator/src/Comparator.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -use SebastianBergmann\Exporter\Exporter; - -/** - * Abstract base class for comparators which compare values for equality. - */ -abstract class Comparator -{ - /** - * @var Factory - */ - protected $factory; - - /** - * @var Exporter - */ - protected $exporter; - - public function __construct() - { - $this->exporter = new Exporter; - } - - public function setFactory(Factory $factory) - { - $this->factory = $factory; - } - - /** - * Returns whether the comparator can compare two values. - * - * @param mixed $expected The first value to compare - * @param mixed $actual The second value to compare - * - * @return bool - */ - abstract public function accepts($expected, $actual); - - /** - * Asserts that two values are equal. - * - * @param mixed $expected First value to compare - * @param mixed $actual Second value to compare - * @param float $delta Allowed numerical distance between two values to consider them equal - * @param bool $canonicalize Arrays are sorted before comparison when set to true - * @param bool $ignoreCase Case is ignored when set to true - * - * @throws ComparisonFailure - */ - abstract public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false); -} diff --git a/vendor/sebastian/comparator/src/ComparisonFailure.php b/vendor/sebastian/comparator/src/ComparisonFailure.php deleted file mode 100644 index d043288..0000000 --- a/vendor/sebastian/comparator/src/ComparisonFailure.php +++ /dev/null @@ -1,128 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -use SebastianBergmann\Diff\Differ; -use SebastianBergmann\Diff\Output\UnifiedDiffOutputBuilder; - -/** - * Thrown when an assertion for string equality failed. - */ -class ComparisonFailure extends \RuntimeException -{ - /** - * Expected value of the retrieval which does not match $actual. - * - * @var mixed - */ - protected $expected; - - /** - * Actually retrieved value which does not match $expected. - * - * @var mixed - */ - protected $actual; - - /** - * The string representation of the expected value - * - * @var string - */ - protected $expectedAsString; - - /** - * The string representation of the actual value - * - * @var string - */ - protected $actualAsString; - - /** - * @var bool - */ - protected $identical; - - /** - * Optional message which is placed in front of the first line - * returned by toString(). - * - * @var string - */ - protected $message; - - /** - * Initialises with the expected value and the actual value. - * - * @param mixed $expected expected value retrieved - * @param mixed $actual actual value retrieved - * @param string $expectedAsString - * @param string $actualAsString - * @param bool $identical - * @param string $message a string which is prefixed on all returned lines - * in the difference output - */ - public function __construct($expected, $actual, $expectedAsString, $actualAsString, $identical = false, $message = '') - { - $this->expected = $expected; - $this->actual = $actual; - $this->expectedAsString = $expectedAsString; - $this->actualAsString = $actualAsString; - $this->message = $message; - } - - public function getActual() - { - return $this->actual; - } - - public function getExpected() - { - return $this->expected; - } - - /** - * @return string - */ - public function getActualAsString() - { - return $this->actualAsString; - } - - /** - * @return string - */ - public function getExpectedAsString() - { - return $this->expectedAsString; - } - - /** - * @return string - */ - public function getDiff() - { - if (!$this->actualAsString && !$this->expectedAsString) { - return ''; - } - - $differ = new Differ(new UnifiedDiffOutputBuilder("\n--- Expected\n+++ Actual\n")); - - return $differ->diff($this->expectedAsString, $this->actualAsString); - } - - /** - * @return string - */ - public function toString() - { - return $this->message . $this->getDiff(); - } -} diff --git a/vendor/sebastian/comparator/src/DOMNodeComparator.php b/vendor/sebastian/comparator/src/DOMNodeComparator.php deleted file mode 100644 index c0ad70c..0000000 --- a/vendor/sebastian/comparator/src/DOMNodeComparator.php +++ /dev/null @@ -1,86 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -use DOMDocument; -use DOMNode; - -/** - * Compares DOMNode instances for equality. - */ -class DOMNodeComparator extends ObjectComparator -{ - /** - * Returns whether the comparator can compare two values. - * - * @param mixed $expected The first value to compare - * @param mixed $actual The second value to compare - * - * @return bool - */ - public function accepts($expected, $actual) - { - return $expected instanceof DOMNode && $actual instanceof DOMNode; - } - - /** - * Asserts that two values are equal. - * - * @param mixed $expected First value to compare - * @param mixed $actual Second value to compare - * @param float $delta Allowed numerical distance between two values to consider them equal - * @param bool $canonicalize Arrays are sorted before comparison when set to true - * @param bool $ignoreCase Case is ignored when set to true - * @param array $processed List of already processed elements (used to prevent infinite recursion) - * - * @throws ComparisonFailure - */ - public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false, array &$processed = []) - { - $expectedAsString = $this->nodeToText($expected, true, $ignoreCase); - $actualAsString = $this->nodeToText($actual, true, $ignoreCase); - - if ($expectedAsString !== $actualAsString) { - $type = $expected instanceof DOMDocument ? 'documents' : 'nodes'; - - throw new ComparisonFailure( - $expected, - $actual, - $expectedAsString, - $actualAsString, - false, - \sprintf("Failed asserting that two DOM %s are equal.\n", $type) - ); - } - } - - /** - * Returns the normalized, whitespace-cleaned, and indented textual - * representation of a DOMNode. - */ - private function nodeToText(DOMNode $node, bool $canonicalize, bool $ignoreCase): string - { - if ($canonicalize) { - $document = new DOMDocument; - @$document->loadXML($node->C14N()); - - $node = $document; - } - - $document = $node instanceof DOMDocument ? $node : $node->ownerDocument; - - $document->formatOutput = true; - $document->normalizeDocument(); - - $text = $node instanceof DOMDocument ? $node->saveXML() : $document->saveXML($node); - - return $ignoreCase ? \strtolower($text) : $text; - } -} diff --git a/vendor/sebastian/comparator/src/DateTimeComparator.php b/vendor/sebastian/comparator/src/DateTimeComparator.php deleted file mode 100644 index af94b5c..0000000 --- a/vendor/sebastian/comparator/src/DateTimeComparator.php +++ /dev/null @@ -1,86 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -/** - * Compares DateTimeInterface instances for equality. - */ -class DateTimeComparator extends ObjectComparator -{ - /** - * Returns whether the comparator can compare two values. - * - * @param mixed $expected The first value to compare - * @param mixed $actual The second value to compare - * - * @return bool - */ - public function accepts($expected, $actual) - { - return ($expected instanceof \DateTime || $expected instanceof \DateTimeInterface) && - ($actual instanceof \DateTime || $actual instanceof \DateTimeInterface); - } - - /** - * Asserts that two values are equal. - * - * @param mixed $expected First value to compare - * @param mixed $actual Second value to compare - * @param float $delta Allowed numerical distance between two values to consider them equal - * @param bool $canonicalize Arrays are sorted before comparison when set to true - * @param bool $ignoreCase Case is ignored when set to true - * @param array $processed List of already processed elements (used to prevent infinite recursion) - * - * @throws \Exception - * @throws ComparisonFailure - */ - public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false, array &$processed = []) - { - /** @var \DateTimeInterface $expected */ - /** @var \DateTimeInterface $actual */ - $absDelta = \abs($delta); - $delta = new \DateInterval(\sprintf('PT%dS', $absDelta)); - $delta->f = $absDelta - \floor($absDelta); - - $actualClone = (clone $actual) - ->setTimezone(new \DateTimeZone('UTC')); - - $expectedLower = (clone $expected) - ->setTimezone(new \DateTimeZone('UTC')) - ->sub($delta); - - $expectedUpper = (clone $expected) - ->setTimezone(new \DateTimeZone('UTC')) - ->add($delta); - - if ($actualClone < $expectedLower || $actualClone > $expectedUpper) { - throw new ComparisonFailure( - $expected, - $actual, - $this->dateTimeToString($expected), - $this->dateTimeToString($actual), - false, - 'Failed asserting that two DateTime objects are equal.' - ); - } - } - - /** - * Returns an ISO 8601 formatted string representation of a datetime or - * 'Invalid DateTimeInterface object' if the provided DateTimeInterface was not properly - * initialized. - */ - private function dateTimeToString(\DateTimeInterface $datetime): string - { - $string = $datetime->format('Y-m-d\TH:i:s.uO'); - - return $string ?: 'Invalid DateTimeInterface object'; - } -} diff --git a/vendor/sebastian/comparator/src/DoubleComparator.php b/vendor/sebastian/comparator/src/DoubleComparator.php deleted file mode 100644 index f2b0c4e..0000000 --- a/vendor/sebastian/comparator/src/DoubleComparator.php +++ /dev/null @@ -1,56 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -/** - * Compares doubles for equality. - */ -class DoubleComparator extends NumericComparator -{ - /** - * Smallest value available in PHP. - * - * @var float - */ - const EPSILON = 0.0000000001; - - /** - * Returns whether the comparator can compare two values. - * - * @param mixed $expected The first value to compare - * @param mixed $actual The second value to compare - * - * @return bool - */ - public function accepts($expected, $actual) - { - return (\is_float($expected) || \is_float($actual)) && \is_numeric($expected) && \is_numeric($actual); - } - - /** - * Asserts that two values are equal. - * - * @param mixed $expected First value to compare - * @param mixed $actual Second value to compare - * @param float $delta Allowed numerical distance between two values to consider them equal - * @param bool $canonicalize Arrays are sorted before comparison when set to true - * @param bool $ignoreCase Case is ignored when set to true - * - * @throws ComparisonFailure - */ - public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false) - { - if ($delta == 0) { - $delta = self::EPSILON; - } - - parent::assertEquals($expected, $actual, $delta, $canonicalize, $ignoreCase); - } -} diff --git a/vendor/sebastian/comparator/src/ExceptionComparator.php b/vendor/sebastian/comparator/src/ExceptionComparator.php deleted file mode 100644 index 42c40cf..0000000 --- a/vendor/sebastian/comparator/src/ExceptionComparator.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -/** - * Compares Exception instances for equality. - */ -class ExceptionComparator extends ObjectComparator -{ - /** - * Returns whether the comparator can compare two values. - * - * @param mixed $expected The first value to compare - * @param mixed $actual The second value to compare - * - * @return bool - */ - public function accepts($expected, $actual) - { - return $expected instanceof \Exception && $actual instanceof \Exception; - } - - /** - * Converts an object to an array containing all of its private, protected - * and public properties. - * - * @param object $object - * - * @return array - */ - protected function toArray($object) - { - $array = parent::toArray($object); - - unset( - $array['file'], - $array['line'], - $array['trace'], - $array['string'], - $array['xdebug_message'] - ); - - return $array; - } -} diff --git a/vendor/sebastian/comparator/src/Factory.php b/vendor/sebastian/comparator/src/Factory.php deleted file mode 100644 index 53d1c79..0000000 --- a/vendor/sebastian/comparator/src/Factory.php +++ /dev/null @@ -1,138 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -/** - * Factory for comparators which compare values for equality. - */ -class Factory -{ - /** - * @var Factory - */ - private static $instance; - - /** - * @var Comparator[] - */ - private $customComparators = []; - - /** - * @var Comparator[] - */ - private $defaultComparators = []; - - /** - * @return Factory - */ - public static function getInstance() - { - if (self::$instance === null) { - self::$instance = new self; - } - - return self::$instance; - } - - /** - * Constructs a new factory. - */ - public function __construct() - { - $this->registerDefaultComparators(); - } - - /** - * Returns the correct comparator for comparing two values. - * - * @param mixed $expected The first value to compare - * @param mixed $actual The second value to compare - * - * @return Comparator - */ - public function getComparatorFor($expected, $actual) - { - foreach ($this->customComparators as $comparator) { - if ($comparator->accepts($expected, $actual)) { - return $comparator; - } - } - - foreach ($this->defaultComparators as $comparator) { - if ($comparator->accepts($expected, $actual)) { - return $comparator; - } - } - } - - /** - * Registers a new comparator. - * - * This comparator will be returned by getComparatorFor() if its accept() method - * returns TRUE for the compared values. It has higher priority than the - * existing comparators, meaning that its accept() method will be invoked - * before those of the other comparators. - * - * @param Comparator $comparator The comparator to be registered - */ - public function register(Comparator $comparator) - { - \array_unshift($this->customComparators, $comparator); - - $comparator->setFactory($this); - } - - /** - * Unregisters a comparator. - * - * This comparator will no longer be considered by getComparatorFor(). - * - * @param Comparator $comparator The comparator to be unregistered - */ - public function unregister(Comparator $comparator) - { - foreach ($this->customComparators as $key => $_comparator) { - if ($comparator === $_comparator) { - unset($this->customComparators[$key]); - } - } - } - - /** - * Unregisters all non-default comparators. - */ - public function reset() - { - $this->customComparators = []; - } - - private function registerDefaultComparators() - { - $this->registerDefaultComparator(new MockObjectComparator); - $this->registerDefaultComparator(new DateTimeComparator); - $this->registerDefaultComparator(new DOMNodeComparator); - $this->registerDefaultComparator(new SplObjectStorageComparator); - $this->registerDefaultComparator(new ExceptionComparator); - $this->registerDefaultComparator(new ObjectComparator); - $this->registerDefaultComparator(new ResourceComparator); - $this->registerDefaultComparator(new ArrayComparator); - $this->registerDefaultComparator(new DoubleComparator); - $this->registerDefaultComparator(new NumericComparator); - $this->registerDefaultComparator(new ScalarComparator); - $this->registerDefaultComparator(new TypeComparator); - } - - private function registerDefaultComparator(Comparator $comparator) - { - $this->defaultComparators[] = $comparator; - - $comparator->setFactory($this); - } -} diff --git a/vendor/sebastian/comparator/src/MockObjectComparator.php b/vendor/sebastian/comparator/src/MockObjectComparator.php deleted file mode 100644 index f439d84..0000000 --- a/vendor/sebastian/comparator/src/MockObjectComparator.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -/** - * Compares PHPUnit_Framework_MockObject_MockObject instances for equality. - */ -class MockObjectComparator extends ObjectComparator -{ - /** - * Returns whether the comparator can compare two values. - * - * @param mixed $expected The first value to compare - * @param mixed $actual The second value to compare - * - * @return bool - */ - public function accepts($expected, $actual) - { - return ($expected instanceof \PHPUnit_Framework_MockObject_MockObject || $expected instanceof \PHPUnit\Framework\MockObject\MockObject) && - ($actual instanceof \PHPUnit_Framework_MockObject_MockObject || $actual instanceof \PHPUnit\Framework\MockObject\MockObject); - } - - /** - * Converts an object to an array containing all of its private, protected - * and public properties. - * - * @param object $object - * - * @return array - */ - protected function toArray($object) - { - $array = parent::toArray($object); - - unset($array['__phpunit_invocationMocker']); - - return $array; - } -} diff --git a/vendor/sebastian/comparator/src/NumericComparator.php b/vendor/sebastian/comparator/src/NumericComparator.php deleted file mode 100644 index 8a03ffc..0000000 --- a/vendor/sebastian/comparator/src/NumericComparator.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -/** - * Compares numerical values for equality. - */ -class NumericComparator extends ScalarComparator -{ - /** - * Returns whether the comparator can compare two values. - * - * @param mixed $expected The first value to compare - * @param mixed $actual The second value to compare - * - * @return bool - */ - public function accepts($expected, $actual) - { - // all numerical values, but not if one of them is a double - // or both of them are strings - return \is_numeric($expected) && \is_numeric($actual) && - !(\is_float($expected) || \is_float($actual)) && - !(\is_string($expected) && \is_string($actual)); - } - - /** - * Asserts that two values are equal. - * - * @param mixed $expected First value to compare - * @param mixed $actual Second value to compare - * @param float $delta Allowed numerical distance between two values to consider them equal - * @param bool $canonicalize Arrays are sorted before comparison when set to true - * @param bool $ignoreCase Case is ignored when set to true - * - * @throws ComparisonFailure - */ - public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false) - { - if (\is_infinite($actual) && \is_infinite($expected)) { - return; // @codeCoverageIgnore - } - - if ((\is_infinite($actual) xor \is_infinite($expected)) || - (\is_nan($actual) || \is_nan($expected)) || - \abs($actual - $expected) > $delta) { - throw new ComparisonFailure( - $expected, - $actual, - '', - '', - false, - \sprintf( - 'Failed asserting that %s matches expected %s.', - $this->exporter->export($actual), - $this->exporter->export($expected) - ) - ); - } - } -} diff --git a/vendor/sebastian/comparator/src/ObjectComparator.php b/vendor/sebastian/comparator/src/ObjectComparator.php deleted file mode 100644 index 54fce82..0000000 --- a/vendor/sebastian/comparator/src/ObjectComparator.php +++ /dev/null @@ -1,106 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -/** - * Compares objects for equality. - */ -class ObjectComparator extends ArrayComparator -{ - /** - * Returns whether the comparator can compare two values. - * - * @param mixed $expected The first value to compare - * @param mixed $actual The second value to compare - * - * @return bool - */ - public function accepts($expected, $actual) - { - return \is_object($expected) && \is_object($actual); - } - - /** - * Asserts that two values are equal. - * - * @param mixed $expected First value to compare - * @param mixed $actual Second value to compare - * @param float $delta Allowed numerical distance between two values to consider them equal - * @param bool $canonicalize Arrays are sorted before comparison when set to true - * @param bool $ignoreCase Case is ignored when set to true - * @param array $processed List of already processed elements (used to prevent infinite recursion) - * - * @throws ComparisonFailure - */ - public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false, array &$processed = []) - { - if (\get_class($actual) !== \get_class($expected)) { - throw new ComparisonFailure( - $expected, - $actual, - $this->exporter->export($expected), - $this->exporter->export($actual), - false, - \sprintf( - '%s is not instance of expected class "%s".', - $this->exporter->export($actual), - \get_class($expected) - ) - ); - } - - // don't compare twice to allow for cyclic dependencies - if (\in_array([$actual, $expected], $processed, true) || - \in_array([$expected, $actual], $processed, true)) { - return; - } - - $processed[] = [$actual, $expected]; - - // don't compare objects if they are identical - // this helps to avoid the error "maximum function nesting level reached" - // CAUTION: this conditional clause is not tested - if ($actual !== $expected) { - try { - parent::assertEquals( - $this->toArray($expected), - $this->toArray($actual), - $delta, - $canonicalize, - $ignoreCase, - $processed - ); - } catch (ComparisonFailure $e) { - throw new ComparisonFailure( - $expected, - $actual, - // replace "Array" with "MyClass object" - \substr_replace($e->getExpectedAsString(), \get_class($expected) . ' Object', 0, 5), - \substr_replace($e->getActualAsString(), \get_class($actual) . ' Object', 0, 5), - false, - 'Failed asserting that two objects are equal.' - ); - } - } - } - - /** - * Converts an object to an array containing all of its private, protected - * and public properties. - * - * @param object $object - * - * @return array - */ - protected function toArray($object) - { - return $this->exporter->toArray($object); - } -} diff --git a/vendor/sebastian/comparator/src/ResourceComparator.php b/vendor/sebastian/comparator/src/ResourceComparator.php deleted file mode 100644 index 5471826..0000000 --- a/vendor/sebastian/comparator/src/ResourceComparator.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -/** - * Compares resources for equality. - */ -class ResourceComparator extends Comparator -{ - /** - * Returns whether the comparator can compare two values. - * - * @param mixed $expected The first value to compare - * @param mixed $actual The second value to compare - * - * @return bool - */ - public function accepts($expected, $actual) - { - return \is_resource($expected) && \is_resource($actual); - } - - /** - * Asserts that two values are equal. - * - * @param mixed $expected First value to compare - * @param mixed $actual Second value to compare - * @param float $delta Allowed numerical distance between two values to consider them equal - * @param bool $canonicalize Arrays are sorted before comparison when set to true - * @param bool $ignoreCase Case is ignored when set to true - * - * @throws ComparisonFailure - */ - public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false) - { - if ($actual != $expected) { - throw new ComparisonFailure( - $expected, - $actual, - $this->exporter->export($expected), - $this->exporter->export($actual) - ); - } - } -} diff --git a/vendor/sebastian/comparator/src/ScalarComparator.php b/vendor/sebastian/comparator/src/ScalarComparator.php deleted file mode 100644 index e19df4d..0000000 --- a/vendor/sebastian/comparator/src/ScalarComparator.php +++ /dev/null @@ -1,91 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -/** - * Compares scalar or NULL values for equality. - */ -class ScalarComparator extends Comparator -{ - /** - * Returns whether the comparator can compare two values. - * - * @param mixed $expected The first value to compare - * @param mixed $actual The second value to compare - * - * @return bool - * - * @since Method available since Release 3.6.0 - */ - public function accepts($expected, $actual) - { - return ((\is_scalar($expected) xor null === $expected) && - (\is_scalar($actual) xor null === $actual)) - // allow comparison between strings and objects featuring __toString() - || (\is_string($expected) && \is_object($actual) && \method_exists($actual, '__toString')) - || (\is_object($expected) && \method_exists($expected, '__toString') && \is_string($actual)); - } - - /** - * Asserts that two values are equal. - * - * @param mixed $expected First value to compare - * @param mixed $actual Second value to compare - * @param float $delta Allowed numerical distance between two values to consider them equal - * @param bool $canonicalize Arrays are sorted before comparison when set to true - * @param bool $ignoreCase Case is ignored when set to true - * - * @throws ComparisonFailure - */ - public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false) - { - $expectedToCompare = $expected; - $actualToCompare = $actual; - - // always compare as strings to avoid strange behaviour - // otherwise 0 == 'Foobar' - if (\is_string($expected) || \is_string($actual)) { - $expectedToCompare = (string) $expectedToCompare; - $actualToCompare = (string) $actualToCompare; - - if ($ignoreCase) { - $expectedToCompare = \strtolower($expectedToCompare); - $actualToCompare = \strtolower($actualToCompare); - } - } - - if ($expectedToCompare !== $actualToCompare && \is_string($expected) && \is_string($actual)) { - throw new ComparisonFailure( - $expected, - $actual, - $this->exporter->export($expected), - $this->exporter->export($actual), - false, - 'Failed asserting that two strings are equal.' - ); - } - - if ($expectedToCompare != $actualToCompare) { - throw new ComparisonFailure( - $expected, - $actual, - // no diff is required - '', - '', - false, - \sprintf( - 'Failed asserting that %s matches expected %s.', - $this->exporter->export($actual), - $this->exporter->export($expected) - ) - ); - } - } -} diff --git a/vendor/sebastian/comparator/src/SplObjectStorageComparator.php b/vendor/sebastian/comparator/src/SplObjectStorageComparator.php deleted file mode 100644 index 5900d57..0000000 --- a/vendor/sebastian/comparator/src/SplObjectStorageComparator.php +++ /dev/null @@ -1,69 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -/** - * Compares \SplObjectStorage instances for equality. - */ -class SplObjectStorageComparator extends Comparator -{ - /** - * Returns whether the comparator can compare two values. - * - * @param mixed $expected The first value to compare - * @param mixed $actual The second value to compare - * - * @return bool - */ - public function accepts($expected, $actual) - { - return $expected instanceof \SplObjectStorage && $actual instanceof \SplObjectStorage; - } - - /** - * Asserts that two values are equal. - * - * @param mixed $expected First value to compare - * @param mixed $actual Second value to compare - * @param float $delta Allowed numerical distance between two values to consider them equal - * @param bool $canonicalize Arrays are sorted before comparison when set to true - * @param bool $ignoreCase Case is ignored when set to true - * - * @throws ComparisonFailure - */ - public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false) - { - foreach ($actual as $object) { - if (!$expected->contains($object)) { - throw new ComparisonFailure( - $expected, - $actual, - $this->exporter->export($expected), - $this->exporter->export($actual), - false, - 'Failed asserting that two objects are equal.' - ); - } - } - - foreach ($expected as $object) { - if (!$actual->contains($object)) { - throw new ComparisonFailure( - $expected, - $actual, - $this->exporter->export($expected), - $this->exporter->export($actual), - false, - 'Failed asserting that two objects are equal.' - ); - } - } - } -} diff --git a/vendor/sebastian/comparator/src/TypeComparator.php b/vendor/sebastian/comparator/src/TypeComparator.php deleted file mode 100644 index e7f551f..0000000 --- a/vendor/sebastian/comparator/src/TypeComparator.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -/** - * Compares values for type equality. - */ -class TypeComparator extends Comparator -{ - /** - * Returns whether the comparator can compare two values. - * - * @param mixed $expected The first value to compare - * @param mixed $actual The second value to compare - * - * @return bool - */ - public function accepts($expected, $actual) - { - return true; - } - - /** - * Asserts that two values are equal. - * - * @param mixed $expected First value to compare - * @param mixed $actual Second value to compare - * @param float $delta Allowed numerical distance between two values to consider them equal - * @param bool $canonicalize Arrays are sorted before comparison when set to true - * @param bool $ignoreCase Case is ignored when set to true - * - * @throws ComparisonFailure - */ - public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false) - { - if (\gettype($expected) != \gettype($actual)) { - throw new ComparisonFailure( - $expected, - $actual, - // we don't need a diff - '', - '', - false, - \sprintf( - '%s does not match expected type "%s".', - $this->exporter->shortenedExport($actual), - \gettype($expected) - ) - ); - } - } -} diff --git a/vendor/sebastian/comparator/tests/ArrayComparatorTest.php b/vendor/sebastian/comparator/tests/ArrayComparatorTest.php deleted file mode 100644 index 25906bb..0000000 --- a/vendor/sebastian/comparator/tests/ArrayComparatorTest.php +++ /dev/null @@ -1,161 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -use PHPUnit\Framework\TestCase; - -/** - * @covers \SebastianBergmann\Comparator\ArrayComparator - * - * @uses \SebastianBergmann\Comparator\Comparator - * @uses \SebastianBergmann\Comparator\Factory - * @uses \SebastianBergmann\Comparator\ComparisonFailure - */ -final class ArrayComparatorTest extends TestCase -{ - /** - * @var ArrayComparator - */ - private $comparator; - - protected function setUp(): void - { - $this->comparator = new ArrayComparator; - $this->comparator->setFactory(new Factory); - } - - public function acceptsFailsProvider() - { - return [ - [[], null], - [null, []], - [null, null] - ]; - } - - public function assertEqualsSucceedsProvider() - { - return [ - [ - ['a' => 1, 'b' => 2], - ['b' => 2, 'a' => 1] - ], - [ - [1], - ['1'] - ], - [ - [3, 2, 1], - [2, 3, 1], - 0, - true - ], - [ - [2.3], - [2.5], - 0.5 - ], - [ - [[2.3]], - [[2.5]], - 0.5 - ], - [ - [new Struct(2.3)], - [new Struct(2.5)], - 0.5 - ], - ]; - } - - public function assertEqualsFailsProvider() - { - return [ - [ - [], - [0 => 1] - ], - [ - [0 => 1], - [] - ], - [ - [0 => null], - [] - ], - [ - [0 => 1, 1 => 2], - [0 => 1, 1 => 3] - ], - [ - ['a', 'b' => [1, 2]], - ['a', 'b' => [2, 1]] - ], - [ - [2.3], - [4.2], - 0.5 - ], - [ - [[2.3]], - [[4.2]], - 0.5 - ], - [ - [new Struct(2.3)], - [new Struct(4.2)], - 0.5 - ] - ]; - } - - public function testAcceptsSucceeds(): void - { - $this->assertTrue( - $this->comparator->accepts([], []) - ); - } - - /** - * @dataProvider acceptsFailsProvider - */ - public function testAcceptsFails($expected, $actual): void - { - $this->assertFalse( - $this->comparator->accepts($expected, $actual) - ); - } - - /** - * @dataProvider assertEqualsSucceedsProvider - */ - public function testAssertEqualsSucceeds($expected, $actual, $delta = 0.0, $canonicalize = false): void - { - $exception = null; - - try { - $this->comparator->assertEquals($expected, $actual, $delta, $canonicalize); - } catch (ComparisonFailure $exception) { - } - - $this->assertNull($exception, 'Unexpected ComparisonFailure'); - } - - /** - * @dataProvider assertEqualsFailsProvider - */ - public function testAssertEqualsFails($expected, $actual, $delta = 0.0, $canonicalize = false): void - { - $this->expectException(ComparisonFailure::class); - $this->expectExceptionMessage('Failed asserting that two arrays are equal'); - - $this->comparator->assertEquals($expected, $actual, $delta, $canonicalize); - } -} diff --git a/vendor/sebastian/comparator/tests/ComparisonFailureTest.php b/vendor/sebastian/comparator/tests/ComparisonFailureTest.php deleted file mode 100644 index 3b438b7..0000000 --- a/vendor/sebastian/comparator/tests/ComparisonFailureTest.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -use PHPUnit\Framework\TestCase; - -/** - * @covers \SebastianBergmann\Comparator\ComparisonFailure - * - * @uses \SebastianBergmann\Comparator\Factory - */ -final class ComparisonFailureTest extends TestCase -{ - public function testComparisonFailure(): void - { - $actual = "\nB\n"; - $expected = "\nA\n"; - $message = 'Test message'; - - $failure = new ComparisonFailure( - $expected, - $actual, - '|' . $expected, - '|' . $actual, - false, - $message - ); - - $this->assertSame($actual, $failure->getActual()); - $this->assertSame($expected, $failure->getExpected()); - $this->assertSame('|' . $actual, $failure->getActualAsString()); - $this->assertSame('|' . $expected, $failure->getExpectedAsString()); - - $diff = ' ---- Expected -+++ Actual -@@ @@ - | --A -+B -'; - $this->assertSame($diff, $failure->getDiff()); - $this->assertSame($message . $diff, $failure->toString()); - } - - public function testDiffNotPossible(): void - { - $failure = new ComparisonFailure('a', 'b', false, false, true, 'test'); - $this->assertSame('', $failure->getDiff()); - $this->assertSame('test', $failure->toString()); - } -} diff --git a/vendor/sebastian/comparator/tests/DOMNodeComparatorTest.php b/vendor/sebastian/comparator/tests/DOMNodeComparatorTest.php deleted file mode 100644 index 18451e0..0000000 --- a/vendor/sebastian/comparator/tests/DOMNodeComparatorTest.php +++ /dev/null @@ -1,180 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -use DOMDocument; -use DOMNode; -use PHPUnit\Framework\TestCase; - -/** - * @covers \SebastianBergmann\Comparator\DOMNodeComparator - * - * @uses \SebastianBergmann\Comparator\Comparator - * @uses \SebastianBergmann\Comparator\Factory - * @uses \SebastianBergmann\Comparator\ComparisonFailure - */ -final class DOMNodeComparatorTest extends TestCase -{ - /** - * @var DOMNodeComparator - */ - private $comparator; - - protected function setUp(): void - { - $this->comparator = new DOMNodeComparator; - } - - public function acceptsSucceedsProvider() - { - $document = new DOMDocument; - $node = new DOMNode; - - return [ - [$document, $document], - [$node, $node], - [$document, $node], - [$node, $document] - ]; - } - - public function acceptsFailsProvider() - { - $document = new DOMDocument; - - return [ - [$document, null], - [null, $document], - [null, null] - ]; - } - - public function assertEqualsSucceedsProvider() - { - return [ - [ - $this->createDOMDocument(''), - $this->createDOMDocument('') - ], - [ - $this->createDOMDocument(''), - $this->createDOMDocument('') - ], - [ - $this->createDOMDocument(''), - $this->createDOMDocument('') - ], - [ - $this->createDOMDocument("\n \n"), - $this->createDOMDocument('') - ], - [ - $this->createDOMDocument(''), - $this->createDOMDocument(''), - $ignoreCase = true - ], - [ - $this->createDOMDocument(""), - $this->createDOMDocument(""), - ], - ]; - } - - public function assertEqualsFailsProvider() - { - return [ - [ - $this->createDOMDocument(''), - $this->createDOMDocument('') - ], - [ - $this->createDOMDocument(''), - $this->createDOMDocument('') - ], - [ - $this->createDOMDocument(' bar '), - $this->createDOMDocument('') - ], - [ - $this->createDOMDocument(''), - $this->createDOMDocument('') - ], - [ - $this->createDOMDocument(' bar '), - $this->createDOMDocument(' bir ') - ], - [ - $this->createDOMDocument(''), - $this->createDOMDocument('') - ], - [ - $this->createDOMDocument(' bar '), - $this->createDOMDocument(' BAR ') - ] - ]; - } - - /** - * @dataProvider acceptsSucceedsProvider - */ - public function testAcceptsSucceeds($expected, $actual): void - { - $this->assertTrue( - $this->comparator->accepts($expected, $actual) - ); - } - - /** - * @dataProvider acceptsFailsProvider - */ - public function testAcceptsFails($expected, $actual): void - { - $this->assertFalse( - $this->comparator->accepts($expected, $actual) - ); - } - - /** - * @dataProvider assertEqualsSucceedsProvider - */ - public function testAssertEqualsSucceeds($expected, $actual, $ignoreCase = false): void - { - $exception = null; - - try { - $delta = 0.0; - $canonicalize = false; - $this->comparator->assertEquals($expected, $actual, $delta, $canonicalize, $ignoreCase); - } catch (ComparisonFailure $exception) { - } - - $this->assertNull($exception, 'Unexpected ComparisonFailure'); - } - - /** - * @dataProvider assertEqualsFailsProvider - */ - public function testAssertEqualsFails($expected, $actual): void - { - $this->expectException(ComparisonFailure::class); - $this->expectExceptionMessage('Failed asserting that two DOM'); - - $this->comparator->assertEquals($expected, $actual); - } - - private function createDOMDocument($content) - { - $document = new DOMDocument; - $document->preserveWhiteSpace = false; - $document->loadXML($content); - - return $document; - } -} diff --git a/vendor/sebastian/comparator/tests/DateTimeComparatorTest.php b/vendor/sebastian/comparator/tests/DateTimeComparatorTest.php deleted file mode 100644 index 41e1086..0000000 --- a/vendor/sebastian/comparator/tests/DateTimeComparatorTest.php +++ /dev/null @@ -1,213 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -use DateTime; -use DateTimeImmutable; -use DateTimeZone; -use PHPUnit\Framework\TestCase; - -/** - * @covers \SebastianBergmann\Comparator\DateTimeComparator - * - * @uses \SebastianBergmann\Comparator\Comparator - * @uses \SebastianBergmann\Comparator\Factory - * @uses \SebastianBergmann\Comparator\ComparisonFailure - */ -final class DateTimeComparatorTest extends TestCase -{ - /** - * @var DateTimeComparator - */ - private $comparator; - - protected function setUp(): void - { - $this->comparator = new DateTimeComparator; - } - - public function acceptsFailsProvider() - { - $datetime = new DateTime; - - return [ - [$datetime, null], - [null, $datetime], - [null, null] - ]; - } - - public function assertEqualsSucceedsProvider() - { - return [ - [ - new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/New_York')), - new DateTime('2013-03-29 04:13:25', new DateTimeZone('America/New_York')), - 10 - ], - [ - new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/New_York')), - new DateTime('2013-03-29 04:14:40', new DateTimeZone('America/New_York')), - 65 - ], - [ - new DateTime('2013-03-29', new DateTimeZone('America/New_York')), - new DateTime('2013-03-29', new DateTimeZone('America/New_York')) - ], - [ - new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/New_York')), - new DateTime('2013-03-29 03:13:35', new DateTimeZone('America/Chicago')) - ], - [ - new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/New_York')), - new DateTime('2013-03-29 03:13:49', new DateTimeZone('America/Chicago')), - 15 - ], - [ - new DateTime('2013-03-30', new DateTimeZone('America/New_York')), - new DateTime('2013-03-29 23:00:00', new DateTimeZone('America/Chicago')) - ], - [ - new DateTime('2013-03-30', new DateTimeZone('America/New_York')), - new DateTime('2013-03-29 23:01:30', new DateTimeZone('America/Chicago')), - 100 - ], - [ - new DateTime('@1364616000'), - new DateTime('2013-03-29 23:00:00', new DateTimeZone('America/Chicago')) - ], - [ - new DateTime('2013-03-29T05:13:35-0500'), - new DateTime('2013-03-29T04:13:35-0600') - ], - [ - new DateTimeImmutable('2013-03-30', new DateTimeZone('America/New_York')), - new DateTimeImmutable('2013-03-29 23:01:30', new DateTimeZone('America/Chicago')), - 100 - ], - [ - new DateTimeImmutable('2013-03-30 12:00:00', new DateTimeZone('UTC')), - new DateTimeImmutable('2013-03-30 12:00:00.5', new DateTimeZone('UTC')), - 0.5 - ], - ]; - } - - public function assertEqualsFailsProvider() - { - return [ - [ - new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/New_York')), - new DateTime('2013-03-29 03:13:35', new DateTimeZone('America/New_York')) - ], - [ - new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/New_York')), - new DateTime('2013-03-29 03:13:35', new DateTimeZone('America/New_York')), - 3500 - ], - [ - new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/New_York')), - new DateTime('2013-03-29 05:13:35', new DateTimeZone('America/New_York')), - 3500 - ], - [ - new DateTime('2013-03-29', new DateTimeZone('America/New_York')), - new DateTime('2013-03-30', new DateTimeZone('America/New_York')) - ], - [ - new DateTime('2013-03-29', new DateTimeZone('America/New_York')), - new DateTime('2013-03-30', new DateTimeZone('America/New_York')), - 43200 - ], - [ - new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/New_York')), - new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/Chicago')), - ], - [ - new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/New_York')), - new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/Chicago')), - 3500 - ], - [ - new DateTime('2013-03-30', new DateTimeZone('America/New_York')), - new DateTime('2013-03-30', new DateTimeZone('America/Chicago')) - ], - [ - new DateTime('2013-03-29T05:13:35-0600'), - new DateTime('2013-03-29T04:13:35-0600') - ], - [ - new DateTime('2013-03-29T05:13:35-0600'), - new DateTime('2013-03-29T05:13:35-0500') - ], - ]; - } - - public function testAcceptsSucceeds(): void - { - $this->assertTrue( - $this->comparator->accepts( - new DateTime, - new DateTime - ) - ); - } - - /** - * @dataProvider acceptsFailsProvider - */ - public function testAcceptsFails($expected, $actual): void - { - $this->assertFalse( - $this->comparator->accepts($expected, $actual) - ); - } - - /** - * @dataProvider assertEqualsSucceedsProvider - */ - public function testAssertEqualsSucceeds($expected, $actual, $delta = 0.0): void - { - $exception = null; - - try { - $this->comparator->assertEquals($expected, $actual, $delta); - } catch (ComparisonFailure $exception) { - } - - $this->assertNull($exception, 'Unexpected ComparisonFailure'); - } - - /** - * @dataProvider assertEqualsFailsProvider - */ - public function testAssertEqualsFails($expected, $actual, $delta = 0.0): void - { - $this->expectException(ComparisonFailure::class); - $this->expectExceptionMessage('Failed asserting that two DateTime objects are equal.'); - - $this->comparator->assertEquals($expected, $actual, $delta); - } - - public function testAcceptsDateTimeInterface(): void - { - $this->assertTrue($this->comparator->accepts(new DateTime, new DateTimeImmutable)); - } - - public function testSupportsDateTimeInterface(): void - { - $this->assertNull( - $this->comparator->assertEquals( - new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/New_York')), - new DateTimeImmutable('2013-03-29 04:13:35', new DateTimeZone('America/New_York')) - ) - ); - } -} diff --git a/vendor/sebastian/comparator/tests/DoubleComparatorTest.php b/vendor/sebastian/comparator/tests/DoubleComparatorTest.php deleted file mode 100644 index 1a577a2..0000000 --- a/vendor/sebastian/comparator/tests/DoubleComparatorTest.php +++ /dev/null @@ -1,135 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -use PHPUnit\Framework\TestCase; - -/** - * @covers \SebastianBergmann\Comparator\DoubleComparator - * - * @uses \SebastianBergmann\Comparator\Comparator - * @uses \SebastianBergmann\Comparator\Factory - * @uses \SebastianBergmann\Comparator\ComparisonFailure - */ -final class DoubleComparatorTest extends TestCase -{ - /** - * @var DoubleComparator - */ - private $comparator; - - protected function setUp(): void - { - $this->comparator = new DoubleComparator; - } - - public function acceptsSucceedsProvider() - { - return [ - [0, 5.0], - [5.0, 0], - ['5', 4.5], - [1.2e3, 7E-10], - [3, \acos(8)], - [\acos(8), 3], - [\acos(8), \acos(8)] - ]; - } - - public function acceptsFailsProvider() - { - return [ - [5, 5], - ['4.5', 5], - [0x539, 02471], - [5.0, false], - [null, 5.0] - ]; - } - - public function assertEqualsSucceedsProvider() - { - return [ - [2.3, 2.3], - ['2.3', 2.3], - [5.0, 5], - [5, 5.0], - [5.0, '5'], - [1.2e3, 1200], - [2.3, 2.5, 0.5], - [3, 3.05, 0.05], - [1.2e3, 1201, 1], - [(string) (1 / 3), 1 - 2 / 3], - [1 / 3, (string) (1 - 2 / 3)] - ]; - } - - public function assertEqualsFailsProvider() - { - return [ - [2.3, 4.2], - ['2.3', 4.2], - [5.0, '4'], - [5.0, 6], - [1.2e3, 1201], - [2.3, 2.5, 0.2], - [3, 3.05, 0.04], - [3, \acos(8)], - [\acos(8), 3], - [\acos(8), \acos(8)] - ]; - } - - /** - * @dataProvider acceptsSucceedsProvider - */ - public function testAcceptsSucceeds($expected, $actual): void - { - $this->assertTrue( - $this->comparator->accepts($expected, $actual) - ); - } - - /** - * @dataProvider acceptsFailsProvider - */ - public function testAcceptsFails($expected, $actual): void - { - $this->assertFalse( - $this->comparator->accepts($expected, $actual) - ); - } - - /** - * @dataProvider assertEqualsSucceedsProvider - */ - public function testAssertEqualsSucceeds($expected, $actual, $delta = 0.0): void - { - $exception = null; - - try { - $this->comparator->assertEquals($expected, $actual, $delta); - } catch (ComparisonFailure $exception) { - } - - $this->assertNull($exception, 'Unexpected ComparisonFailure'); - } - - /** - * @dataProvider assertEqualsFailsProvider - */ - public function testAssertEqualsFails($expected, $actual, $delta = 0.0): void - { - $this->expectException(ComparisonFailure::class); - $this->expectExceptionMessage('matches expected'); - - $this->comparator->assertEquals($expected, $actual, $delta); - } -} diff --git a/vendor/sebastian/comparator/tests/ExceptionComparatorTest.php b/vendor/sebastian/comparator/tests/ExceptionComparatorTest.php deleted file mode 100644 index 12330ea..0000000 --- a/vendor/sebastian/comparator/tests/ExceptionComparatorTest.php +++ /dev/null @@ -1,136 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -use Exception; -use PHPUnit\Framework\TestCase; -use RuntimeException; - -/** - * @covers \SebastianBergmann\Comparator\ExceptionComparator - * - * @uses \SebastianBergmann\Comparator\Comparator - * @uses \SebastianBergmann\Comparator\Factory - * @uses \SebastianBergmann\Comparator\ComparisonFailure - */ -final class ExceptionComparatorTest extends TestCase -{ - /** - * @var ExceptionComparator - */ - private $comparator; - - protected function setUp(): void - { - $this->comparator = new ExceptionComparator; - $this->comparator->setFactory(new Factory); - } - - public function acceptsSucceedsProvider() - { - return [ - [new Exception, new Exception], - [new RuntimeException, new RuntimeException], - [new Exception, new RuntimeException] - ]; - } - - public function acceptsFailsProvider() - { - return [ - [new Exception, null], - [null, new Exception], - [null, null] - ]; - } - - public function assertEqualsSucceedsProvider() - { - $exception1 = new Exception; - $exception2 = new Exception; - - $exception3 = new RuntimeException('Error', 100); - $exception4 = new RuntimeException('Error', 100); - - return [ - [$exception1, $exception1], - [$exception1, $exception2], - [$exception3, $exception3], - [$exception3, $exception4] - ]; - } - - public function assertEqualsFailsProvider() - { - $typeMessage = 'not instance of expected class'; - $equalMessage = 'Failed asserting that two objects are equal.'; - - $exception1 = new Exception('Error', 100); - $exception2 = new Exception('Error', 101); - $exception3 = new Exception('Errors', 101); - - $exception4 = new RuntimeException('Error', 100); - $exception5 = new RuntimeException('Error', 101); - - return [ - [$exception1, $exception2, $equalMessage], - [$exception1, $exception3, $equalMessage], - [$exception1, $exception4, $typeMessage], - [$exception2, $exception3, $equalMessage], - [$exception4, $exception5, $equalMessage] - ]; - } - - /** - * @dataProvider acceptsSucceedsProvider - */ - public function testAcceptsSucceeds($expected, $actual): void - { - $this->assertTrue( - $this->comparator->accepts($expected, $actual) - ); - } - - /** - * @dataProvider acceptsFailsProvider - */ - public function testAcceptsFails($expected, $actual): void - { - $this->assertFalse( - $this->comparator->accepts($expected, $actual) - ); - } - - /** - * @dataProvider assertEqualsSucceedsProvider - */ - public function testAssertEqualsSucceeds($expected, $actual): void - { - $exception = null; - - try { - $this->comparator->assertEquals($expected, $actual); - } catch (ComparisonFailure $exception) { - } - - $this->assertNull($exception, 'Unexpected ComparisonFailure'); - } - - /** - * @dataProvider assertEqualsFailsProvider - */ - public function testAssertEqualsFails($expected, $actual, $message): void - { - $this->expectException(ComparisonFailure::class); - $this->expectExceptionMessage($message); - - $this->comparator->assertEquals($expected, $actual); - } -} diff --git a/vendor/sebastian/comparator/tests/FactoryTest.php b/vendor/sebastian/comparator/tests/FactoryTest.php deleted file mode 100644 index 82f5343..0000000 --- a/vendor/sebastian/comparator/tests/FactoryTest.php +++ /dev/null @@ -1,117 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -use PHPUnit\Framework\TestCase; - -/** - * @covers \SebastianBergmann\Comparator\Factory - * - * @uses \SebastianBergmann\Comparator\Comparator - * @uses \SebastianBergmann\Comparator\Factory - * @uses \SebastianBergmann\Comparator\ComparisonFailure - */ -final class FactoryTest extends TestCase -{ - public function instanceProvider() - { - $tmpfile = \tmpfile(); - - return [ - [null, null, 'SebastianBergmann\\Comparator\\ScalarComparator'], - [null, true, 'SebastianBergmann\\Comparator\\ScalarComparator'], - [true, null, 'SebastianBergmann\\Comparator\\ScalarComparator'], - [true, true, 'SebastianBergmann\\Comparator\\ScalarComparator'], - [false, false, 'SebastianBergmann\\Comparator\\ScalarComparator'], - [true, false, 'SebastianBergmann\\Comparator\\ScalarComparator'], - [false, true, 'SebastianBergmann\\Comparator\\ScalarComparator'], - ['', '', 'SebastianBergmann\\Comparator\\ScalarComparator'], - ['0', '0', 'SebastianBergmann\\Comparator\\ScalarComparator'], - ['0', 0, 'SebastianBergmann\\Comparator\\NumericComparator'], - [0, '0', 'SebastianBergmann\\Comparator\\NumericComparator'], - [0, 0, 'SebastianBergmann\\Comparator\\NumericComparator'], - [1.0, 0, 'SebastianBergmann\\Comparator\\DoubleComparator'], - [0, 1.0, 'SebastianBergmann\\Comparator\\DoubleComparator'], - [1.0, 1.0, 'SebastianBergmann\\Comparator\\DoubleComparator'], - [[1], [1], 'SebastianBergmann\\Comparator\\ArrayComparator'], - [$tmpfile, $tmpfile, 'SebastianBergmann\\Comparator\\ResourceComparator'], - [new \stdClass, new \stdClass, 'SebastianBergmann\\Comparator\\ObjectComparator'], - [new \DateTime, new \DateTime, 'SebastianBergmann\\Comparator\\DateTimeComparator'], - [new \SplObjectStorage, new \SplObjectStorage, 'SebastianBergmann\\Comparator\\SplObjectStorageComparator'], - [new \Exception, new \Exception, 'SebastianBergmann\\Comparator\\ExceptionComparator'], - [new \DOMDocument, new \DOMDocument, 'SebastianBergmann\\Comparator\\DOMNodeComparator'], - // mixed types - [$tmpfile, [1], 'SebastianBergmann\\Comparator\\TypeComparator'], - [[1], $tmpfile, 'SebastianBergmann\\Comparator\\TypeComparator'], - [$tmpfile, '1', 'SebastianBergmann\\Comparator\\TypeComparator'], - ['1', $tmpfile, 'SebastianBergmann\\Comparator\\TypeComparator'], - [$tmpfile, new \stdClass, 'SebastianBergmann\\Comparator\\TypeComparator'], - [new \stdClass, $tmpfile, 'SebastianBergmann\\Comparator\\TypeComparator'], - [new \stdClass, [1], 'SebastianBergmann\\Comparator\\TypeComparator'], - [[1], new \stdClass, 'SebastianBergmann\\Comparator\\TypeComparator'], - [new \stdClass, '1', 'SebastianBergmann\\Comparator\\TypeComparator'], - ['1', new \stdClass, 'SebastianBergmann\\Comparator\\TypeComparator'], - [new ClassWithToString, '1', 'SebastianBergmann\\Comparator\\ScalarComparator'], - ['1', new ClassWithToString, 'SebastianBergmann\\Comparator\\ScalarComparator'], - [1.0, new \stdClass, 'SebastianBergmann\\Comparator\\TypeComparator'], - [new \stdClass, 1.0, 'SebastianBergmann\\Comparator\\TypeComparator'], - [1.0, [1], 'SebastianBergmann\\Comparator\\TypeComparator'], - [[1], 1.0, 'SebastianBergmann\\Comparator\\TypeComparator'], - ]; - } - - /** - * @dataProvider instanceProvider - */ - public function testGetComparatorFor($a, $b, $expected): void - { - $factory = new Factory; - $actual = $factory->getComparatorFor($a, $b); - $this->assertInstanceOf($expected, $actual); - } - - public function testRegister(): void - { - $comparator = new TestClassComparator; - - $factory = new Factory; - $factory->register($comparator); - - $a = new TestClass; - $b = new TestClass; - $expected = 'SebastianBergmann\\Comparator\\TestClassComparator'; - $actual = $factory->getComparatorFor($a, $b); - - $factory->unregister($comparator); - $this->assertInstanceOf($expected, $actual); - } - - public function testUnregister(): void - { - $comparator = new TestClassComparator; - - $factory = new Factory; - $factory->register($comparator); - $factory->unregister($comparator); - - $a = new TestClass; - $b = new TestClass; - $expected = 'SebastianBergmann\\Comparator\\ObjectComparator'; - $actual = $factory->getComparatorFor($a, $b); - - $this->assertInstanceOf($expected, $actual); - } - - public function testIsSingleton(): void - { - $f = Factory::getInstance(); - $this->assertSame($f, Factory::getInstance()); - } -} diff --git a/vendor/sebastian/comparator/tests/MockObjectComparatorTest.php b/vendor/sebastian/comparator/tests/MockObjectComparatorTest.php deleted file mode 100644 index 922e9d6..0000000 --- a/vendor/sebastian/comparator/tests/MockObjectComparatorTest.php +++ /dev/null @@ -1,168 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -use PHPUnit\Framework\TestCase; -use stdClass; - -/** - * @covers \SebastianBergmann\Comparator\MockObjectComparator - * - * @uses \SebastianBergmann\Comparator\Comparator - * @uses \SebastianBergmann\Comparator\Factory - * @uses \SebastianBergmann\Comparator\ComparisonFailure - */ -final class MockObjectComparatorTest extends TestCase -{ - /** - * @var MockObjectComparator - */ - private $comparator; - - protected function setUp(): void - { - $this->comparator = new MockObjectComparator; - $this->comparator->setFactory(new Factory); - } - - public function acceptsSucceedsProvider() - { - $testmock = $this->createMock(TestClass::class); - $stdmock = $this->createMock(stdClass::class); - - return [ - [$testmock, $testmock], - [$stdmock, $stdmock], - [$stdmock, $testmock] - ]; - } - - public function acceptsFailsProvider() - { - $stdmock = $this->createMock(stdClass::class); - - return [ - [$stdmock, null], - [null, $stdmock], - [null, null] - ]; - } - - public function assertEqualsSucceedsProvider() - { - // cyclic dependencies - $book1 = $this->getMockBuilder(Book::class)->setMethods(null)->getMock(); - $book1->author = $this->getMockBuilder(Author::class)->setMethods(null)->setConstructorArgs(['Terry Pratchett'])->getMock(); - $book1->author->books[] = $book1; - $book2 = $this->getMockBuilder(Book::class)->setMethods(null)->getMock(); - $book2->author = $this->getMockBuilder(Author::class)->setMethods(null)->setConstructorArgs(['Terry Pratchett'])->getMock(); - $book2->author->books[] = $book2; - - $object1 = $this->getMockBuilder(SampleClass::class)->setMethods(null)->setConstructorArgs([4, 8, 15])->getMock(); - $object2 = $this->getMockBuilder(SampleClass::class)->setMethods(null)->setConstructorArgs([4, 8, 15])->getMock(); - - return [ - [$object1, $object1], - [$object1, $object2], - [$book1, $book1], - [$book1, $book2], - [ - $this->getMockBuilder(Struct::class)->setMethods(null)->setConstructorArgs([2.3])->getMock(), - $this->getMockBuilder(Struct::class)->setMethods(null)->setConstructorArgs([2.5])->getMock(), - 0.5 - ] - ]; - } - - public function assertEqualsFailsProvider() - { - $typeMessage = 'is not instance of expected class'; - $equalMessage = 'Failed asserting that two objects are equal.'; - - // cyclic dependencies - $book1 = $this->getMockBuilder(Book::class)->setMethods(null)->getMock(); - $book1->author = $this->getMockBuilder(Author::class)->setMethods(null)->setConstructorArgs(['Terry Pratchett'])->getMock(); - $book1->author->books[] = $book1; - $book2 = $this->getMockBuilder(Book::class)->setMethods(null)->getMock(); - $book1->author = $this->getMockBuilder(Author::class)->setMethods(null)->setConstructorArgs(['Terry Pratch'])->getMock(); - $book2->author->books[] = $book2; - - $book3 = $this->getMockBuilder(Book::class)->setMethods(null)->getMock(); - $book3->author = 'Terry Pratchett'; - $book4 = $this->createMock(stdClass::class); - $book4->author = 'Terry Pratchett'; - - $object1 = $this->getMockBuilder(SampleClass::class)->setMethods(null)->setConstructorArgs([4, 8, 15])->getMock(); - $object2 = $this->getMockBuilder(SampleClass::class)->setMethods(null)->setConstructorArgs([16, 23, 42])->getMock(); - - return [ - [ - $this->getMockBuilder(SampleClass::class)->setMethods(null)->setConstructorArgs([4, 8, 15])->getMock(), - $this->getMockBuilder(SampleClass::class)->setMethods(null)->setConstructorArgs([16, 23, 42])->getMock(), - $equalMessage - ], - [$object1, $object2, $equalMessage], - [$book1, $book2, $equalMessage], - [$book3, $book4, $typeMessage], - [ - $this->getMockBuilder(Struct::class)->setMethods(null)->setConstructorArgs([2.3])->getMock(), - $this->getMockBuilder(Struct::class)->setMethods(null)->setConstructorArgs([4.2])->getMock(), - $equalMessage, - 0.5 - ] - ]; - } - - /** - * @dataProvider acceptsSucceedsProvider - */ - public function testAcceptsSucceeds($expected, $actual): void - { - $this->assertTrue( - $this->comparator->accepts($expected, $actual) - ); - } - - /** - * @dataProvider acceptsFailsProvider - */ - public function testAcceptsFails($expected, $actual): void - { - $this->assertFalse( - $this->comparator->accepts($expected, $actual) - ); - } - - /** - * @dataProvider assertEqualsSucceedsProvider - */ - public function testAssertEqualsSucceeds($expected, $actual, $delta = 0.0): void - { - $exception = null; - - try { - $this->comparator->assertEquals($expected, $actual, $delta); - } catch (ComparisonFailure $exception) { - } - - $this->assertNull($exception, 'Unexpected ComparisonFailure'); - } - - /** - * @dataProvider assertEqualsFailsProvider - */ - public function testAssertEqualsFails($expected, $actual, $message, $delta = 0.0): void - { - $this->expectException(ComparisonFailure::class); - $this->expectExceptionMessage($message); - - $this->comparator->assertEquals($expected, $actual, $delta); - } -} diff --git a/vendor/sebastian/comparator/tests/NumericComparatorTest.php b/vendor/sebastian/comparator/tests/NumericComparatorTest.php deleted file mode 100644 index 504172f..0000000 --- a/vendor/sebastian/comparator/tests/NumericComparatorTest.php +++ /dev/null @@ -1,123 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -use PHPUnit\Framework\TestCase; - -/** - * @covers \SebastianBergmann\Comparator\NumericComparator - * - * @uses \SebastianBergmann\Comparator\Comparator - * @uses \SebastianBergmann\Comparator\Factory - * @uses \SebastianBergmann\Comparator\ComparisonFailure - */ -final class NumericComparatorTest extends TestCase -{ - /** - * @var NumericComparator - */ - private $comparator; - - protected function setUp(): void - { - $this->comparator = new NumericComparator; - } - - public function acceptsSucceedsProvider() - { - return [ - [5, 10], - [8, '0'], - ['10', 0], - [0x74c3b00c, 42], - [0755, 0777] - ]; - } - - public function acceptsFailsProvider() - { - return [ - ['5', '10'], - [8, 5.0], - [5.0, 8], - [10, null], - [false, 12] - ]; - } - - public function assertEqualsSucceedsProvider() - { - return [ - [1337, 1337], - ['1337', 1337], - [0x539, 1337], - [02471, 1337], - [1337, 1338, 1], - ['1337', 1340, 5], - ]; - } - - public function assertEqualsFailsProvider() - { - return [ - [1337, 1338], - ['1338', 1337], - [0x539, 1338], - [1337, 1339, 1], - ['1337', 1340, 2], - ]; - } - - /** - * @dataProvider acceptsSucceedsProvider - */ - public function testAcceptsSucceeds($expected, $actual): void - { - $this->assertTrue( - $this->comparator->accepts($expected, $actual) - ); - } - - /** - * @dataProvider acceptsFailsProvider - */ - public function testAcceptsFails($expected, $actual): void - { - $this->assertFalse( - $this->comparator->accepts($expected, $actual) - ); - } - - /** - * @dataProvider assertEqualsSucceedsProvider - */ - public function testAssertEqualsSucceeds($expected, $actual, $delta = 0.0): void - { - $exception = null; - - try { - $this->comparator->assertEquals($expected, $actual, $delta); - } catch (ComparisonFailure $exception) { - } - - $this->assertNull($exception, 'Unexpected ComparisonFailure'); - } - - /** - * @dataProvider assertEqualsFailsProvider - */ - public function testAssertEqualsFails($expected, $actual, $delta = 0.0): void - { - $this->expectException(ComparisonFailure::class); - $this->expectExceptionMessage('matches expected'); - - $this->comparator->assertEquals($expected, $actual, $delta); - } -} diff --git a/vendor/sebastian/comparator/tests/ObjectComparatorTest.php b/vendor/sebastian/comparator/tests/ObjectComparatorTest.php deleted file mode 100644 index 30ef230..0000000 --- a/vendor/sebastian/comparator/tests/ObjectComparatorTest.php +++ /dev/null @@ -1,150 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -use PHPUnit\Framework\TestCase; -use stdClass; - -/** - * @covers \SebastianBergmann\Comparator\ObjectComparator - * - * @uses \SebastianBergmann\Comparator\Comparator - * @uses \SebastianBergmann\Comparator\Factory - * @uses \SebastianBergmann\Comparator\ComparisonFailure - */ -final class ObjectComparatorTest extends TestCase -{ - /** - * @var ObjectComparator - */ - private $comparator; - - protected function setUp(): void - { - $this->comparator = new ObjectComparator; - $this->comparator->setFactory(new Factory); - } - - public function acceptsSucceedsProvider() - { - return [ - [new TestClass, new TestClass], - [new stdClass, new stdClass], - [new stdClass, new TestClass] - ]; - } - - public function acceptsFailsProvider() - { - return [ - [new stdClass, null], - [null, new stdClass], - [null, null] - ]; - } - - public function assertEqualsSucceedsProvider() - { - // cyclic dependencies - $book1 = new Book; - $book1->author = new Author('Terry Pratchett'); - $book1->author->books[] = $book1; - $book2 = new Book; - $book2->author = new Author('Terry Pratchett'); - $book2->author->books[] = $book2; - - $object1 = new SampleClass(4, 8, 15); - $object2 = new SampleClass(4, 8, 15); - - return [ - [$object1, $object1], - [$object1, $object2], - [$book1, $book1], - [$book1, $book2], - [new Struct(2.3), new Struct(2.5), 0.5] - ]; - } - - public function assertEqualsFailsProvider() - { - $typeMessage = 'is not instance of expected class'; - $equalMessage = 'Failed asserting that two objects are equal.'; - - // cyclic dependencies - $book1 = new Book; - $book1->author = new Author('Terry Pratchett'); - $book1->author->books[] = $book1; - $book2 = new Book; - $book2->author = new Author('Terry Pratch'); - $book2->author->books[] = $book2; - - $book3 = new Book; - $book3->author = 'Terry Pratchett'; - $book4 = new stdClass; - $book4->author = 'Terry Pratchett'; - - $object1 = new SampleClass(4, 8, 15); - $object2 = new SampleClass(16, 23, 42); - - return [ - [new SampleClass(4, 8, 15), new SampleClass(16, 23, 42), $equalMessage], - [$object1, $object2, $equalMessage], - [$book1, $book2, $equalMessage], - [$book3, $book4, $typeMessage], - [new Struct(2.3), new Struct(4.2), $equalMessage, 0.5] - ]; - } - - /** - * @dataProvider acceptsSucceedsProvider - */ - public function testAcceptsSucceeds($expected, $actual): void - { - $this->assertTrue( - $this->comparator->accepts($expected, $actual) - ); - } - - /** - * @dataProvider acceptsFailsProvider - */ - public function testAcceptsFails($expected, $actual): void - { - $this->assertFalse( - $this->comparator->accepts($expected, $actual) - ); - } - - /** - * @dataProvider assertEqualsSucceedsProvider - */ - public function testAssertEqualsSucceeds($expected, $actual, $delta = 0.0): void - { - $exception = null; - - try { - $this->comparator->assertEquals($expected, $actual, $delta); - } catch (ComparisonFailure $exception) { - } - - $this->assertNull($exception, 'Unexpected ComparisonFailure'); - } - - /** - * @dataProvider assertEqualsFailsProvider - */ - public function testAssertEqualsFails($expected, $actual, $message, $delta = 0.0): void - { - $this->expectException(ComparisonFailure::class); - $this->expectExceptionMessage($message); - - $this->comparator->assertEquals($expected, $actual, $delta); - } -} diff --git a/vendor/sebastian/comparator/tests/ResourceComparatorTest.php b/vendor/sebastian/comparator/tests/ResourceComparatorTest.php deleted file mode 100644 index 158aaa9..0000000 --- a/vendor/sebastian/comparator/tests/ResourceComparatorTest.php +++ /dev/null @@ -1,122 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -use PHPUnit\Framework\TestCase; - -/** - * @covers \SebastianBergmann\Comparator\ResourceComparator - * - * @uses \SebastianBergmann\Comparator\Comparator - * @uses \SebastianBergmann\Comparator\Factory - * @uses \SebastianBergmann\Comparator\ComparisonFailure - */ -final class ResourceComparatorTest extends TestCase -{ - /** - * @var ResourceComparator - */ - private $comparator; - - protected function setUp(): void - { - $this->comparator = new ResourceComparator; - } - - public function acceptsSucceedsProvider() - { - $tmpfile1 = \tmpfile(); - $tmpfile2 = \tmpfile(); - - return [ - [$tmpfile1, $tmpfile1], - [$tmpfile2, $tmpfile2], - [$tmpfile1, $tmpfile2] - ]; - } - - public function acceptsFailsProvider() - { - $tmpfile1 = \tmpfile(); - - return [ - [$tmpfile1, null], - [null, $tmpfile1], - [null, null] - ]; - } - - public function assertEqualsSucceedsProvider() - { - $tmpfile1 = \tmpfile(); - $tmpfile2 = \tmpfile(); - - return [ - [$tmpfile1, $tmpfile1], - [$tmpfile2, $tmpfile2] - ]; - } - - public function assertEqualsFailsProvider() - { - $tmpfile1 = \tmpfile(); - $tmpfile2 = \tmpfile(); - - return [ - [$tmpfile1, $tmpfile2], - [$tmpfile2, $tmpfile1] - ]; - } - - /** - * @dataProvider acceptsSucceedsProvider - */ - public function testAcceptsSucceeds($expected, $actual): void - { - $this->assertTrue( - $this->comparator->accepts($expected, $actual) - ); - } - - /** - * @dataProvider acceptsFailsProvider - */ - public function testAcceptsFails($expected, $actual): void - { - $this->assertFalse( - $this->comparator->accepts($expected, $actual) - ); - } - - /** - * @dataProvider assertEqualsSucceedsProvider - */ - public function testAssertEqualsSucceeds($expected, $actual): void - { - $exception = null; - - try { - $this->comparator->assertEquals($expected, $actual); - } catch (ComparisonFailure $exception) { - } - - $this->assertNull($exception, 'Unexpected ComparisonFailure'); - } - - /** - * @dataProvider assertEqualsFailsProvider - */ - public function testAssertEqualsFails($expected, $actual): void - { - $this->expectException(ComparisonFailure::class); - - $this->comparator->assertEquals($expected, $actual); - } -} diff --git a/vendor/sebastian/comparator/tests/ScalarComparatorTest.php b/vendor/sebastian/comparator/tests/ScalarComparatorTest.php deleted file mode 100644 index 11feae2..0000000 --- a/vendor/sebastian/comparator/tests/ScalarComparatorTest.php +++ /dev/null @@ -1,164 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -use PHPUnit\Framework\TestCase; - -/** - * @covers \SebastianBergmann\Comparator\ScalarComparator - * - * @uses \SebastianBergmann\Comparator\Comparator - * @uses \SebastianBergmann\Comparator\Factory - * @uses \SebastianBergmann\Comparator\ComparisonFailure - */ -final class ScalarComparatorTest extends TestCase -{ - /** - * @var ScalarComparator - */ - private $comparator; - - protected function setUp(): void - { - $this->comparator = new ScalarComparator; - } - - public function acceptsSucceedsProvider() - { - return [ - ['string', 'string'], - [new ClassWithToString, 'string'], - ['string', new ClassWithToString], - ['string', null], - [false, 'string'], - [false, true], - [null, false], - [null, null], - ['10', 10], - ['', false], - ['1', true], - [1, true], - [0, false], - [0.1, '0.1'] - ]; - } - - public function acceptsFailsProvider() - { - return [ - [[], []], - ['string', []], - [new ClassWithToString, new ClassWithToString], - [false, new ClassWithToString], - [\tmpfile(), \tmpfile()] - ]; - } - - public function assertEqualsSucceedsProvider() - { - return [ - ['string', 'string'], - [new ClassWithToString, new ClassWithToString], - ['string representation', new ClassWithToString], - [new ClassWithToString, 'string representation'], - ['string', 'STRING', true], - ['STRING', 'string', true], - ['String Representation', new ClassWithToString, true], - [new ClassWithToString, 'String Representation', true], - ['10', 10], - ['', false], - ['1', true], - [1, true], - [0, false], - [0.1, '0.1'], - [false, null], - [false, false], - [true, true], - [null, null] - ]; - } - - public function assertEqualsFailsProvider() - { - $stringException = 'Failed asserting that two strings are equal.'; - $otherException = 'matches expected'; - - return [ - ['string', 'other string', $stringException], - ['string', 'STRING', $stringException], - ['STRING', 'string', $stringException], - ['string', 'other string', $stringException], - // https://github.com/sebastianbergmann/phpunit/issues/1023 - ['9E6666666', '9E7777777', $stringException], - [new ClassWithToString, 'does not match', $otherException], - ['does not match', new ClassWithToString, $otherException], - [0, 'Foobar', $otherException], - ['Foobar', 0, $otherException], - ['10', 25, $otherException], - ['1', false, $otherException], - ['', true, $otherException], - [false, true, $otherException], - [true, false, $otherException], - [null, true, $otherException], - [0, true, $otherException], - ['0', '0.0', $stringException], - ['0.', '0.0', $stringException], - ['0e1', '0e2', $stringException], - ["\n\n\n0.0", ' 0.', $stringException], - ['0.0', '25e-10000', $stringException], - ]; - } - - /** - * @dataProvider acceptsSucceedsProvider - */ - public function testAcceptsSucceeds($expected, $actual): void - { - $this->assertTrue( - $this->comparator->accepts($expected, $actual) - ); - } - - /** - * @dataProvider acceptsFailsProvider - */ - public function testAcceptsFails($expected, $actual): void - { - $this->assertFalse( - $this->comparator->accepts($expected, $actual) - ); - } - - /** - * @dataProvider assertEqualsSucceedsProvider - */ - public function testAssertEqualsSucceeds($expected, $actual, $ignoreCase = false): void - { - $exception = null; - - try { - $this->comparator->assertEquals($expected, $actual, 0.0, false, $ignoreCase); - } catch (ComparisonFailure $exception) { - } - - $this->assertNull($exception, 'Unexpected ComparisonFailure'); - } - - /** - * @dataProvider assertEqualsFailsProvider - */ - public function testAssertEqualsFails($expected, $actual, $message): void - { - $this->expectException(ComparisonFailure::class); - $this->expectExceptionMessage($message); - - $this->comparator->assertEquals($expected, $actual); - } -} diff --git a/vendor/sebastian/comparator/tests/SplObjectStorageComparatorTest.php b/vendor/sebastian/comparator/tests/SplObjectStorageComparatorTest.php deleted file mode 100644 index 19cbe71..0000000 --- a/vendor/sebastian/comparator/tests/SplObjectStorageComparatorTest.php +++ /dev/null @@ -1,145 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -use PHPUnit\Framework\TestCase; -use SplObjectStorage; -use stdClass; - -/** - * @covers \SebastianBergmann\Comparator\SplObjectStorageComparator - * - * @uses \SebastianBergmann\Comparator\Comparator - * @uses \SebastianBergmann\Comparator\Factory - * @uses \SebastianBergmann\Comparator\ComparisonFailure - */ -final class SplObjectStorageComparatorTest extends TestCase -{ - /** - * @var SplObjectStorageComparator - */ - private $comparator; - - protected function setUp(): void - { - $this->comparator = new SplObjectStorageComparator; - } - - public function acceptsFailsProvider() - { - return [ - [new SplObjectStorage, new stdClass], - [new stdClass, new SplObjectStorage], - [new stdClass, new stdClass] - ]; - } - - public function assertEqualsSucceedsProvider() - { - $object1 = new stdClass(); - $object2 = new stdClass(); - - $storage1 = new SplObjectStorage(); - $storage2 = new SplObjectStorage(); - - $storage3 = new SplObjectStorage(); - $storage3->attach($object1); - $storage3->attach($object2); - - $storage4 = new SplObjectStorage(); - $storage4->attach($object2); - $storage4->attach($object1); - - return [ - [$storage1, $storage1], - [$storage1, $storage2], - [$storage3, $storage3], - [$storage3, $storage4] - ]; - } - - public function assertEqualsFailsProvider() - { - $object1 = new stdClass; - $object2 = new stdClass; - - $storage1 = new SplObjectStorage; - - $storage2 = new SplObjectStorage; - $storage2->attach($object1); - - $storage3 = new SplObjectStorage; - $storage3->attach($object2); - $storage3->attach($object1); - - return [ - [$storage1, $storage2], - [$storage1, $storage3], - [$storage2, $storage3], - ]; - } - - public function testAcceptsSucceeds(): void - { - $this->assertTrue( - $this->comparator->accepts( - new SplObjectStorage, - new SplObjectStorage - ) - ); - } - - /** - * @dataProvider acceptsFailsProvider - */ - public function testAcceptsFails($expected, $actual): void - { - $this->assertFalse( - $this->comparator->accepts($expected, $actual) - ); - } - - /** - * @dataProvider assertEqualsSucceedsProvider - */ - public function testAssertEqualsSucceeds($expected, $actual): void - { - $exception = null; - - try { - $this->comparator->assertEquals($expected, $actual); - } catch (ComparisonFailure $exception) { - } - - $this->assertNull($exception, 'Unexpected ComparisonFailure'); - } - - /** - * @dataProvider assertEqualsFailsProvider - */ - public function testAssertEqualsFails($expected, $actual): void - { - $this->expectException(ComparisonFailure::class); - $this->expectExceptionMessage('Failed asserting that two objects are equal.'); - - $this->comparator->assertEquals($expected, $actual); - } - - public function testAssertEqualsFails2(): void - { - $this->expectException(ComparisonFailure::class); - $this->expectExceptionMessage('Failed asserting that two objects are equal.'); - - $t = new SplObjectStorage(); - $t->attach(new \stdClass()); - - $this->comparator->assertEquals($t, new \SplObjectStorage()); - } -} diff --git a/vendor/sebastian/comparator/tests/TypeComparatorTest.php b/vendor/sebastian/comparator/tests/TypeComparatorTest.php deleted file mode 100644 index b8586a5..0000000 --- a/vendor/sebastian/comparator/tests/TypeComparatorTest.php +++ /dev/null @@ -1,107 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -use PHPUnit\Framework\TestCase; -use stdClass; - -/** - * @covers \SebastianBergmann\Comparator\TypeComparator - * - * @uses \SebastianBergmann\Comparator\Comparator - * @uses \SebastianBergmann\Comparator\Factory - * @uses \SebastianBergmann\Comparator\ComparisonFailure - */ -final class TypeComparatorTest extends TestCase -{ - /** - * @var TypeComparator - */ - private $comparator; - - protected function setUp(): void - { - $this->comparator = new TypeComparator; - } - - public function acceptsSucceedsProvider() - { - return [ - [true, 1], - [false, [1]], - [null, new stdClass], - [1.0, 5], - ['', ''] - ]; - } - - public function assertEqualsSucceedsProvider() - { - return [ - [true, true], - [true, false], - [false, false], - [null, null], - [new stdClass, new stdClass], - [0, 0], - [1.0, 2.0], - ['hello', 'world'], - ['', ''], - [[], [1, 2, 3]] - ]; - } - - public function assertEqualsFailsProvider() - { - return [ - [true, null], - [null, false], - [1.0, 0], - [new stdClass, []], - ['1', 1] - ]; - } - - /** - * @dataProvider acceptsSucceedsProvider - */ - public function testAcceptsSucceeds($expected, $actual): void - { - $this->assertTrue( - $this->comparator->accepts($expected, $actual) - ); - } - - /** - * @dataProvider assertEqualsSucceedsProvider - */ - public function testAssertEqualsSucceeds($expected, $actual): void - { - $exception = null; - - try { - $this->comparator->assertEquals($expected, $actual); - } catch (ComparisonFailure $exception) { - } - - $this->assertNull($exception, 'Unexpected ComparisonFailure'); - } - - /** - * @dataProvider assertEqualsFailsProvider - */ - public function testAssertEqualsFails($expected, $actual): void - { - $this->expectException(ComparisonFailure::class); - $this->expectExceptionMessage('does not match expected type'); - - $this->comparator->assertEquals($expected, $actual); - } -} diff --git a/vendor/sebastian/comparator/tests/_fixture/Author.php b/vendor/sebastian/comparator/tests/_fixture/Author.php deleted file mode 100644 index efcb6c0..0000000 --- a/vendor/sebastian/comparator/tests/_fixture/Author.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -/** - * An author. - */ -class Author -{ - // the order of properties is important for testing the cycle! - public $books = []; - - private $name = ''; - - public function __construct($name) - { - $this->name = $name; - } -} diff --git a/vendor/sebastian/comparator/tests/_fixture/Book.php b/vendor/sebastian/comparator/tests/_fixture/Book.php deleted file mode 100644 index 73a5c1b..0000000 --- a/vendor/sebastian/comparator/tests/_fixture/Book.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -/** - * A book. - */ -class Book -{ - // the order of properties is important for testing the cycle! - public $author; -} diff --git a/vendor/sebastian/comparator/tests/_fixture/ClassWithToString.php b/vendor/sebastian/comparator/tests/_fixture/ClassWithToString.php deleted file mode 100644 index 488e85a..0000000 --- a/vendor/sebastian/comparator/tests/_fixture/ClassWithToString.php +++ /dev/null @@ -1,18 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -class ClassWithToString -{ - public function __toString() - { - return 'string representation'; - } -} diff --git a/vendor/sebastian/comparator/tests/_fixture/SampleClass.php b/vendor/sebastian/comparator/tests/_fixture/SampleClass.php deleted file mode 100644 index 7e455e8..0000000 --- a/vendor/sebastian/comparator/tests/_fixture/SampleClass.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -/** - * A sample class. - */ -class SampleClass -{ - public $a; - - protected $b; - - protected $c; - - public function __construct($a, $b, $c) - { - $this->a = $a; - $this->b = $b; - $this->c = $c; - } -} diff --git a/vendor/sebastian/comparator/tests/_fixture/Struct.php b/vendor/sebastian/comparator/tests/_fixture/Struct.php deleted file mode 100644 index 7710de8..0000000 --- a/vendor/sebastian/comparator/tests/_fixture/Struct.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -/** - * A struct. - */ -class Struct -{ - public $var; - - public function __construct($var) - { - $this->var = $var; - } -} diff --git a/vendor/sebastian/comparator/tests/_fixture/TestClass.php b/vendor/sebastian/comparator/tests/_fixture/TestClass.php deleted file mode 100644 index fd10c1b..0000000 --- a/vendor/sebastian/comparator/tests/_fixture/TestClass.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -class TestClass -{ -} diff --git a/vendor/sebastian/comparator/tests/_fixture/TestClassComparator.php b/vendor/sebastian/comparator/tests/_fixture/TestClassComparator.php deleted file mode 100644 index 014de67..0000000 --- a/vendor/sebastian/comparator/tests/_fixture/TestClassComparator.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -class TestClassComparator extends ObjectComparator -{ -} diff --git a/vendor/sebastian/diff/.github/stale.yml b/vendor/sebastian/diff/.github/stale.yml deleted file mode 100644 index 1c523ab..0000000 --- a/vendor/sebastian/diff/.github/stale.yml +++ /dev/null @@ -1,40 +0,0 @@ -# Configuration for probot-stale - https://github.com/probot/stale - -# Number of days of inactivity before an Issue or Pull Request becomes stale -daysUntilStale: 60 - -# Number of days of inactivity before a stale Issue or Pull Request is closed. -# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale. -daysUntilClose: 7 - -# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable -exemptLabels: - - enhancement - -# Set to true to ignore issues in a project (defaults to false) -exemptProjects: false - -# Set to true to ignore issues in a milestone (defaults to false) -exemptMilestones: false - -# Label to use when marking as stale -staleLabel: wontfix - -# Comment to post when marking as stale. Set to `false` to disable -markComment: > - This issue has been automatically marked as stale because it has not had activity within the last 60 days. It will be closed after 7 days if no further activity occurs. Thank you for your contributions. - -# Comment to post when removing the stale label. -# unmarkComment: > -# Your comment here. - -# Comment to post when closing a stale Issue or Pull Request. -closeComment: > - This issue has been automatically closed because it has not had activity since it was marked as stale. Thank you for your contributions. - -# Limit the number of actions per hour, from 1-30. Default is 30 -limitPerRun: 30 - -# Limit to only `issues` or `pulls` -only: issues - diff --git a/vendor/sebastian/diff/.gitignore b/vendor/sebastian/diff/.gitignore deleted file mode 100644 index 35dc211..0000000 --- a/vendor/sebastian/diff/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/.idea -/composer.lock -/vendor -/.php_cs.cache -/.phpunit.result.cache -/from.txt.orig \ No newline at end of file diff --git a/vendor/sebastian/diff/.php_cs.dist b/vendor/sebastian/diff/.php_cs.dist deleted file mode 100644 index 9214607..0000000 --- a/vendor/sebastian/diff/.php_cs.dist +++ /dev/null @@ -1,168 +0,0 @@ - - -For the full copyright and license information, please view the LICENSE -file that was distributed with this source code. -EOF; - -return PhpCsFixer\Config::create() - ->setRiskyAllowed(true) - ->setRules( - [ - 'array_syntax' => ['syntax' => 'short'], - 'binary_operator_spaces' => [ - 'operators' => [ - '=' => 'align', - '=>' => 'align', - ], - ], - 'blank_line_after_namespace' => true, - 'blank_line_before_statement' => [ - 'statements' => [ - 'break', - 'continue', - 'declare', - 'do', - 'for', - 'foreach', - 'if', - 'include', - 'include_once', - 'require', - 'require_once', - 'return', - 'switch', - 'throw', - 'try', - 'while', - 'yield', - ], - ], - 'braces' => true, - 'cast_spaces' => true, - 'class_attributes_separation' => ['elements' => ['method']], - 'compact_nullable_typehint' => true, - 'concat_space' => ['spacing' => 'one'], - 'declare_equal_normalize' => ['space' => 'none'], - 'declare_strict_types' => true, - 'dir_constant' => true, - 'elseif' => true, - 'encoding' => true, - 'full_opening_tag' => true, - 'function_declaration' => true, - 'header_comment' => ['header' => $header, 'separate' => 'none'], - 'indentation_type' => true, - 'line_ending' => true, - 'list_syntax' => ['syntax' => 'short'], - 'lowercase_cast' => true, - 'lowercase_constants' => true, - 'lowercase_keywords' => true, - 'magic_constant_casing' => true, - 'method_argument_space' => ['ensure_fully_multiline' => true], - 'modernize_types_casting' => true, - 'native_function_casing' => true, - 'native_function_invocation' => true, - 'no_alias_functions' => true, - 'no_blank_lines_after_class_opening' => true, - 'no_blank_lines_after_phpdoc' => true, - 'no_closing_tag' => true, - 'no_empty_comment' => true, - 'no_empty_phpdoc' => true, - 'no_empty_statement' => true, - 'no_extra_blank_lines' => true, - 'no_homoglyph_names' => true, - 'no_leading_import_slash' => true, - 'no_leading_namespace_whitespace' => true, - 'no_mixed_echo_print' => ['use' => 'print'], - 'no_null_property_initialization' => true, - 'no_short_bool_cast' => true, - 'no_short_echo_tag' => true, - 'no_singleline_whitespace_before_semicolons' => true, - 'no_spaces_after_function_name' => true, - 'no_spaces_inside_parenthesis' => true, - 'no_superfluous_elseif' => true, - 'no_trailing_comma_in_list_call' => true, - 'no_trailing_comma_in_singleline_array' => true, - 'no_trailing_whitespace' => true, - 'no_trailing_whitespace_in_comment' => true, - 'no_unneeded_control_parentheses' => true, - 'no_unneeded_curly_braces' => true, - 'no_unneeded_final_method' => true, - 'no_unreachable_default_argument_value' => true, - 'no_unused_imports' => true, - 'no_useless_else' => true, - 'no_whitespace_before_comma_in_array' => true, - 'no_whitespace_in_blank_line' => true, - 'non_printable_character' => true, - 'normalize_index_brace' => true, - 'object_operator_without_whitespace' => true, - 'ordered_class_elements' => [ - 'order' => [ - 'use_trait', - 'constant_public', - 'constant_protected', - 'constant_private', - 'property_public_static', - 'property_protected_static', - 'property_private_static', - 'property_public', - 'property_protected', - 'property_private', - 'method_public_static', - 'construct', - 'destruct', - 'magic', - 'phpunit', - 'method_public', - 'method_protected', - 'method_private', - 'method_protected_static', - 'method_private_static', - ], - ], - 'ordered_imports' => true, - 'phpdoc_add_missing_param_annotation' => true, - 'phpdoc_align' => true, - 'phpdoc_annotation_without_dot' => true, - 'phpdoc_indent' => true, - 'phpdoc_no_access' => true, - 'phpdoc_no_empty_return' => true, - 'phpdoc_no_package' => true, - 'phpdoc_order' => true, - 'phpdoc_return_self_reference' => true, - 'phpdoc_scalar' => true, - 'phpdoc_separation' => true, - 'phpdoc_single_line_var_spacing' => true, - 'phpdoc_to_comment' => true, - 'phpdoc_trim' => true, - 'phpdoc_types' => true, - 'phpdoc_types_order' => true, - 'phpdoc_var_without_name' => true, - 'pow_to_exponentiation' => true, - 'protected_to_private' => true, - 'return_type_declaration' => ['space_before' => 'none'], - 'self_accessor' => true, - 'short_scalar_cast' => true, - 'simplified_null_return' => true, - 'single_blank_line_at_eof' => true, - 'single_import_per_statement' => true, - 'single_line_after_imports' => true, - 'single_quote' => true, - 'standardize_not_equals' => true, - 'ternary_to_null_coalescing' => true, - 'trim_array_spaces' => true, - 'unary_operator_spaces' => true, - 'visibility_required' => true, - 'void_return' => true, - 'whitespace_after_comma_in_array' => true, - ] - ) - ->setFinder( - PhpCsFixer\Finder::create() - ->files() - ->in(__DIR__ . '/src') - ->in(__DIR__ . '/tests') - ); diff --git a/vendor/sebastian/diff/.travis.yml b/vendor/sebastian/diff/.travis.yml deleted file mode 100644 index 13cd9ff..0000000 --- a/vendor/sebastian/diff/.travis.yml +++ /dev/null @@ -1,26 +0,0 @@ -language: php - -php: - - 7.1 - - 7.2 - - 7.3 - - master - -sudo: false - -before_install: - - composer self-update - - composer clear-cache - -install: - - travis_retry composer update --no-interaction --no-ansi --no-progress --no-suggest --optimize-autoloader --prefer-stable - -script: - - ./vendor/bin/phpunit --coverage-clover=coverage.xml - -after_success: - - bash <(curl -s https://codecov.io/bash) - -notifications: - email: false - diff --git a/vendor/sebastian/diff/ChangeLog.md b/vendor/sebastian/diff/ChangeLog.md deleted file mode 100644 index 88332f7..0000000 --- a/vendor/sebastian/diff/ChangeLog.md +++ /dev/null @@ -1,60 +0,0 @@ -# ChangeLog - -All notable changes are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. - -## [3.0.3] - 2020-11-30 - -### Changed - -* Changed PHP version constraint in `composer.json` from `^7.1` to `>=7.1` - -## [3.0.2] - 2019-02-04 - -### Changed - -* `Chunk::setLines()` now ensures that the `$lines` array only contains `Line` objects - -## [3.0.1] - 2018-06-10 - -### Fixed - -* Removed `"minimum-stability": "dev",` from `composer.json` - -## [3.0.0] - 2018-02-01 - -* The `StrictUnifiedDiffOutputBuilder` implementation of the `DiffOutputBuilderInterface` was added - -### Changed - -* The default `DiffOutputBuilderInterface` implementation now generates context lines (unchanged lines) - -### Removed - -* Removed support for PHP 7.0 - -### Fixed - -* Fixed [#70](https://github.com/sebastianbergmann/diff/issues/70): Diffing of arrays no longer works - -## [2.0.1] - 2017-08-03 - -### Fixed - -* Fixed [#66](https://github.com/sebastianbergmann/diff/pull/66): Restored backwards compatibility for PHPUnit 6.1.4, 6.2.0, 6.2.1, 6.2.2, and 6.2.3 - -## [2.0.0] - 2017-07-11 [YANKED] - -### Added - -* Implemented [#64](https://github.com/sebastianbergmann/diff/pull/64): Show line numbers for chunks of a diff - -### Removed - -* This component is no longer supported on PHP 5.6 - -[3.0.3]: https://github.com/sebastianbergmann/diff/compare/3.0.2...3.0.3 -[3.0.2]: https://github.com/sebastianbergmann/diff/compare/3.0.1...3.0.2 -[3.0.1]: https://github.com/sebastianbergmann/diff/compare/3.0.0...3.0.1 -[3.0.0]: https://github.com/sebastianbergmann/diff/compare/2.0...3.0.0 -[2.0.1]: https://github.com/sebastianbergmann/diff/compare/c341c98ce083db77f896a0aa64f5ee7652915970...2.0.1 -[2.0.0]: https://github.com/sebastianbergmann/diff/compare/1.4...c341c98ce083db77f896a0aa64f5ee7652915970 diff --git a/vendor/sebastian/diff/LICENSE b/vendor/sebastian/diff/LICENSE deleted file mode 100644 index 3ad1d7c..0000000 --- a/vendor/sebastian/diff/LICENSE +++ /dev/null @@ -1,33 +0,0 @@ -sebastian/diff - -Copyright (c) 2002-2019, Sebastian Bergmann . -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Sebastian Bergmann nor the names of his - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/sebastian/diff/README.md b/vendor/sebastian/diff/README.md deleted file mode 100644 index 78dbecd..0000000 --- a/vendor/sebastian/diff/README.md +++ /dev/null @@ -1,195 +0,0 @@ -# sebastian/diff - -Diff implementation for PHP, factored out of PHPUnit into a stand-alone component. - -## Installation - -You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): - - composer require sebastian/diff - -If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: - - composer require --dev sebastian/diff - -### Usage - -#### Generating diff - -The `Differ` class can be used to generate a textual representation of the difference between two strings: - -```php -diff('foo', 'bar'); -``` - -The code above yields the output below: -```diff ---- Original -+++ New -@@ @@ --foo -+bar -``` - -There are three output builders available in this package: - -#### UnifiedDiffOutputBuilder - -This is default builder, which generates the output close to udiff and is used by PHPUnit. - -```php -diff('foo', 'bar'); -``` - -#### StrictUnifiedDiffOutputBuilder - -Generates (strict) Unified diff's (unidiffs) with hunks, -similar to `diff -u` and compatible with `patch` and `git apply`. - -```php - true, // ranges of length one are rendered with the trailing `,1` - 'commonLineThreshold' => 6, // number of same lines before ending a new hunk and creating a new one (if needed) - 'contextLines' => 3, // like `diff: -u, -U NUM, --unified[=NUM]`, for patch/git apply compatibility best to keep at least @ 3 - 'fromFile' => null, - 'fromFileDate' => null, - 'toFile' => null, - 'toFileDate' => null, -]); - -$differ = new Differ($builder); -print $differ->diff('foo', 'bar'); -``` - -#### DiffOnlyOutputBuilder - -Output only the lines that differ. - -```php -diff('foo', 'bar'); -``` - -#### DiffOutputBuilderInterface - -You can pass any output builder to the `Differ` class as longs as it implements the `DiffOutputBuilderInterface`. - -#### Parsing diff - -The `Parser` class can be used to parse a unified diff into an object graph: - -```php -use SebastianBergmann\Diff\Parser; -use SebastianBergmann\Git; - -$git = new Git('/usr/local/src/money'); - -$diff = $git->getDiff( - '948a1a07768d8edd10dcefa8315c1cbeffb31833', - 'c07a373d2399f3e686234c4f7f088d635eb9641b' -); - -$parser = new Parser; - -print_r($parser->parse($diff)); -``` - -The code above yields the output below: - - Array - ( - [0] => SebastianBergmann\Diff\Diff Object - ( - [from:SebastianBergmann\Diff\Diff:private] => a/tests/MoneyTest.php - [to:SebastianBergmann\Diff\Diff:private] => b/tests/MoneyTest.php - [chunks:SebastianBergmann\Diff\Diff:private] => Array - ( - [0] => SebastianBergmann\Diff\Chunk Object - ( - [start:SebastianBergmann\Diff\Chunk:private] => 87 - [startRange:SebastianBergmann\Diff\Chunk:private] => 7 - [end:SebastianBergmann\Diff\Chunk:private] => 87 - [endRange:SebastianBergmann\Diff\Chunk:private] => 7 - [lines:SebastianBergmann\Diff\Chunk:private] => Array - ( - [0] => SebastianBergmann\Diff\Line Object - ( - [type:SebastianBergmann\Diff\Line:private] => 3 - [content:SebastianBergmann\Diff\Line:private] => * @covers SebastianBergmann\Money\Money::add - ) - - [1] => SebastianBergmann\Diff\Line Object - ( - [type:SebastianBergmann\Diff\Line:private] => 3 - [content:SebastianBergmann\Diff\Line:private] => * @covers SebastianBergmann\Money\Money::newMoney - ) - - [2] => SebastianBergmann\Diff\Line Object - ( - [type:SebastianBergmann\Diff\Line:private] => 3 - [content:SebastianBergmann\Diff\Line:private] => */ - ) - - [3] => SebastianBergmann\Diff\Line Object - ( - [type:SebastianBergmann\Diff\Line:private] => 2 - [content:SebastianBergmann\Diff\Line:private] => public function testAnotherMoneyWithSameCurrencyObjectCanBeAdded() - ) - - [4] => SebastianBergmann\Diff\Line Object - ( - [type:SebastianBergmann\Diff\Line:private] => 1 - [content:SebastianBergmann\Diff\Line:private] => public function testAnotherMoneyObjectWithSameCurrencyCanBeAdded() - ) - - [5] => SebastianBergmann\Diff\Line Object - ( - [type:SebastianBergmann\Diff\Line:private] => 3 - [content:SebastianBergmann\Diff\Line:private] => { - ) - - [6] => SebastianBergmann\Diff\Line Object - ( - [type:SebastianBergmann\Diff\Line:private] => 3 - [content:SebastianBergmann\Diff\Line:private] => $a = new Money(1, new Currency('EUR')); - ) - - [7] => SebastianBergmann\Diff\Line Object - ( - [type:SebastianBergmann\Diff\Line:private] => 3 - [content:SebastianBergmann\Diff\Line:private] => $b = new Money(2, new Currency('EUR')); - ) - ) - ) - ) - ) - ) diff --git a/vendor/sebastian/diff/build.xml b/vendor/sebastian/diff/build.xml deleted file mode 100644 index fa7b7e2..0000000 --- a/vendor/sebastian/diff/build.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/sebastian/diff/composer.json b/vendor/sebastian/diff/composer.json deleted file mode 100644 index fe2d77f..0000000 --- a/vendor/sebastian/diff/composer.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "sebastian/diff", - "description": "Diff implementation", - "keywords": ["diff", "udiff", "unidiff", "unified diff"], - "homepage": "https://github.com/sebastianbergmann/diff", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - } - ], - "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.5 || ^8.0", - "symfony/process": "^2 || ^3.3 || ^4" - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "autoload-dev": { - "classmap": [ - "tests/" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - } -} diff --git a/vendor/sebastian/diff/phpunit.xml b/vendor/sebastian/diff/phpunit.xml deleted file mode 100644 index 3e12be4..0000000 --- a/vendor/sebastian/diff/phpunit.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - tests - - - - - - src - - - diff --git a/vendor/sebastian/diff/src/Chunk.php b/vendor/sebastian/diff/src/Chunk.php deleted file mode 100644 index d030954..0000000 --- a/vendor/sebastian/diff/src/Chunk.php +++ /dev/null @@ -1,90 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Diff; - -final class Chunk -{ - /** - * @var int - */ - private $start; - - /** - * @var int - */ - private $startRange; - - /** - * @var int - */ - private $end; - - /** - * @var int - */ - private $endRange; - - /** - * @var Line[] - */ - private $lines; - - public function __construct(int $start = 0, int $startRange = 1, int $end = 0, int $endRange = 1, array $lines = []) - { - $this->start = $start; - $this->startRange = $startRange; - $this->end = $end; - $this->endRange = $endRange; - $this->lines = $lines; - } - - public function getStart(): int - { - return $this->start; - } - - public function getStartRange(): int - { - return $this->startRange; - } - - public function getEnd(): int - { - return $this->end; - } - - public function getEndRange(): int - { - return $this->endRange; - } - - /** - * @return Line[] - */ - public function getLines(): array - { - return $this->lines; - } - - /** - * @param Line[] $lines - */ - public function setLines(array $lines): void - { - foreach ($lines as $line) { - if (!$line instanceof Line) { - throw new InvalidArgumentException; - } - } - - $this->lines = $lines; - } -} diff --git a/vendor/sebastian/diff/src/Diff.php b/vendor/sebastian/diff/src/Diff.php deleted file mode 100644 index 3029e59..0000000 --- a/vendor/sebastian/diff/src/Diff.php +++ /dev/null @@ -1,67 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Diff; - -final class Diff -{ - /** - * @var string - */ - private $from; - - /** - * @var string - */ - private $to; - - /** - * @var Chunk[] - */ - private $chunks; - - /** - * @param string $from - * @param string $to - * @param Chunk[] $chunks - */ - public function __construct(string $from, string $to, array $chunks = []) - { - $this->from = $from; - $this->to = $to; - $this->chunks = $chunks; - } - - public function getFrom(): string - { - return $this->from; - } - - public function getTo(): string - { - return $this->to; - } - - /** - * @return Chunk[] - */ - public function getChunks(): array - { - return $this->chunks; - } - - /** - * @param Chunk[] $chunks - */ - public function setChunks(array $chunks): void - { - $this->chunks = $chunks; - } -} diff --git a/vendor/sebastian/diff/src/Differ.php b/vendor/sebastian/diff/src/Differ.php deleted file mode 100644 index 3c90a5a..0000000 --- a/vendor/sebastian/diff/src/Differ.php +++ /dev/null @@ -1,330 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Diff; - -use SebastianBergmann\Diff\Output\DiffOutputBuilderInterface; -use SebastianBergmann\Diff\Output\UnifiedDiffOutputBuilder; - -/** - * Diff implementation. - */ -final class Differ -{ - public const OLD = 0; - public const ADDED = 1; - public const REMOVED = 2; - public const DIFF_LINE_END_WARNING = 3; - public const NO_LINE_END_EOF_WARNING = 4; - - /** - * @var DiffOutputBuilderInterface - */ - private $outputBuilder; - - /** - * @param DiffOutputBuilderInterface $outputBuilder - * - * @throws InvalidArgumentException - */ - public function __construct($outputBuilder = null) - { - if ($outputBuilder instanceof DiffOutputBuilderInterface) { - $this->outputBuilder = $outputBuilder; - } elseif (null === $outputBuilder) { - $this->outputBuilder = new UnifiedDiffOutputBuilder; - } elseif (\is_string($outputBuilder)) { - // PHPUnit 6.1.4, 6.2.0, 6.2.1, 6.2.2, and 6.2.3 support - // @see https://github.com/sebastianbergmann/phpunit/issues/2734#issuecomment-314514056 - // @deprecated - $this->outputBuilder = new UnifiedDiffOutputBuilder($outputBuilder); - } else { - throw new InvalidArgumentException( - \sprintf( - 'Expected builder to be an instance of DiffOutputBuilderInterface, or a string, got %s.', - \is_object($outputBuilder) ? 'instance of "' . \get_class($outputBuilder) . '"' : \gettype($outputBuilder) . ' "' . $outputBuilder . '"' - ) - ); - } - } - - /** - * Returns the diff between two arrays or strings as string. - * - * @param array|string $from - * @param array|string $to - * @param null|LongestCommonSubsequenceCalculator $lcs - * - * @return string - */ - public function diff($from, $to, LongestCommonSubsequenceCalculator $lcs = null): string - { - $diff = $this->diffToArray( - $this->normalizeDiffInput($from), - $this->normalizeDiffInput($to), - $lcs - ); - - return $this->outputBuilder->getDiff($diff); - } - - /** - * Returns the diff between two arrays or strings as array. - * - * Each array element contains two elements: - * - [0] => mixed $token - * - [1] => 2|1|0 - * - * - 2: REMOVED: $token was removed from $from - * - 1: ADDED: $token was added to $from - * - 0: OLD: $token is not changed in $to - * - * @param array|string $from - * @param array|string $to - * @param LongestCommonSubsequenceCalculator $lcs - * - * @return array - */ - public function diffToArray($from, $to, LongestCommonSubsequenceCalculator $lcs = null): array - { - if (\is_string($from)) { - $from = $this->splitStringByLines($from); - } elseif (!\is_array($from)) { - throw new InvalidArgumentException('"from" must be an array or string.'); - } - - if (\is_string($to)) { - $to = $this->splitStringByLines($to); - } elseif (!\is_array($to)) { - throw new InvalidArgumentException('"to" must be an array or string.'); - } - - [$from, $to, $start, $end] = self::getArrayDiffParted($from, $to); - - if ($lcs === null) { - $lcs = $this->selectLcsImplementation($from, $to); - } - - $common = $lcs->calculate(\array_values($from), \array_values($to)); - $diff = []; - - foreach ($start as $token) { - $diff[] = [$token, self::OLD]; - } - - \reset($from); - \reset($to); - - foreach ($common as $token) { - while (($fromToken = \reset($from)) !== $token) { - $diff[] = [\array_shift($from), self::REMOVED]; - } - - while (($toToken = \reset($to)) !== $token) { - $diff[] = [\array_shift($to), self::ADDED]; - } - - $diff[] = [$token, self::OLD]; - - \array_shift($from); - \array_shift($to); - } - - while (($token = \array_shift($from)) !== null) { - $diff[] = [$token, self::REMOVED]; - } - - while (($token = \array_shift($to)) !== null) { - $diff[] = [$token, self::ADDED]; - } - - foreach ($end as $token) { - $diff[] = [$token, self::OLD]; - } - - if ($this->detectUnmatchedLineEndings($diff)) { - \array_unshift($diff, ["#Warning: Strings contain different line endings!\n", self::DIFF_LINE_END_WARNING]); - } - - return $diff; - } - - /** - * Casts variable to string if it is not a string or array. - * - * @param mixed $input - * - * @return array|string - */ - private function normalizeDiffInput($input) - { - if (!\is_array($input) && !\is_string($input)) { - return (string) $input; - } - - return $input; - } - - /** - * Checks if input is string, if so it will split it line-by-line. - * - * @param string $input - * - * @return array - */ - private function splitStringByLines(string $input): array - { - return \preg_split('/(.*\R)/', $input, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); - } - - /** - * @param array $from - * @param array $to - * - * @return LongestCommonSubsequenceCalculator - */ - private function selectLcsImplementation(array $from, array $to): LongestCommonSubsequenceCalculator - { - // We do not want to use the time-efficient implementation if its memory - // footprint will probably exceed this value. Note that the footprint - // calculation is only an estimation for the matrix and the LCS method - // will typically allocate a bit more memory than this. - $memoryLimit = 100 * 1024 * 1024; - - if ($this->calculateEstimatedFootprint($from, $to) > $memoryLimit) { - return new MemoryEfficientLongestCommonSubsequenceCalculator; - } - - return new TimeEfficientLongestCommonSubsequenceCalculator; - } - - /** - * Calculates the estimated memory footprint for the DP-based method. - * - * @param array $from - * @param array $to - * - * @return float|int - */ - private function calculateEstimatedFootprint(array $from, array $to) - { - $itemSize = PHP_INT_SIZE === 4 ? 76 : 144; - - return $itemSize * \min(\count($from), \count($to)) ** 2; - } - - /** - * Returns true if line ends don't match in a diff. - * - * @param array $diff - * - * @return bool - */ - private function detectUnmatchedLineEndings(array $diff): bool - { - $newLineBreaks = ['' => true]; - $oldLineBreaks = ['' => true]; - - foreach ($diff as $entry) { - if (self::OLD === $entry[1]) { - $ln = $this->getLinebreak($entry[0]); - $oldLineBreaks[$ln] = true; - $newLineBreaks[$ln] = true; - } elseif (self::ADDED === $entry[1]) { - $newLineBreaks[$this->getLinebreak($entry[0])] = true; - } elseif (self::REMOVED === $entry[1]) { - $oldLineBreaks[$this->getLinebreak($entry[0])] = true; - } - } - - // if either input or output is a single line without breaks than no warning should be raised - if (['' => true] === $newLineBreaks || ['' => true] === $oldLineBreaks) { - return false; - } - - // two way compare - foreach ($newLineBreaks as $break => $set) { - if (!isset($oldLineBreaks[$break])) { - return true; - } - } - - foreach ($oldLineBreaks as $break => $set) { - if (!isset($newLineBreaks[$break])) { - return true; - } - } - - return false; - } - - private function getLinebreak($line): string - { - if (!\is_string($line)) { - return ''; - } - - $lc = \substr($line, -1); - - if ("\r" === $lc) { - return "\r"; - } - - if ("\n" !== $lc) { - return ''; - } - - if ("\r\n" === \substr($line, -2)) { - return "\r\n"; - } - - return "\n"; - } - - private static function getArrayDiffParted(array &$from, array &$to): array - { - $start = []; - $end = []; - - \reset($to); - - foreach ($from as $k => $v) { - $toK = \key($to); - - if ($toK === $k && $v === $to[$k]) { - $start[$k] = $v; - - unset($from[$k], $to[$k]); - } else { - break; - } - } - - \end($from); - \end($to); - - do { - $fromK = \key($from); - $toK = \key($to); - - if (null === $fromK || null === $toK || \current($from) !== \current($to)) { - break; - } - - \prev($from); - \prev($to); - - $end = [$fromK => $from[$fromK]] + $end; - unset($from[$fromK], $to[$toK]); - } while (true); - - return [$from, $to, $start, $end]; - } -} diff --git a/vendor/sebastian/diff/src/Exception/ConfigurationException.php b/vendor/sebastian/diff/src/Exception/ConfigurationException.php deleted file mode 100644 index 78f16fd..0000000 --- a/vendor/sebastian/diff/src/Exception/ConfigurationException.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Diff; - -final class ConfigurationException extends InvalidArgumentException -{ - /** - * @param string $option - * @param string $expected - * @param mixed $value - * @param int $code - * @param null|\Exception $previous - */ - public function __construct( - string $option, - string $expected, - $value, - int $code = 0, - \Exception $previous = null - ) { - parent::__construct( - \sprintf( - 'Option "%s" must be %s, got "%s".', - $option, - $expected, - \is_object($value) ? \get_class($value) : (null === $value ? '' : \gettype($value) . '#' . $value) - ), - $code, - $previous - ); - } -} diff --git a/vendor/sebastian/diff/src/Exception/Exception.php b/vendor/sebastian/diff/src/Exception/Exception.php deleted file mode 100644 index 249a2ba..0000000 --- a/vendor/sebastian/diff/src/Exception/Exception.php +++ /dev/null @@ -1,15 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Diff; - -interface Exception -{ -} diff --git a/vendor/sebastian/diff/src/Exception/InvalidArgumentException.php b/vendor/sebastian/diff/src/Exception/InvalidArgumentException.php deleted file mode 100644 index 7bca77d..0000000 --- a/vendor/sebastian/diff/src/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,15 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Diff; - -class InvalidArgumentException extends \InvalidArgumentException implements Exception -{ -} diff --git a/vendor/sebastian/diff/src/Line.php b/vendor/sebastian/diff/src/Line.php deleted file mode 100644 index 125bafd..0000000 --- a/vendor/sebastian/diff/src/Line.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Diff; - -final class Line -{ - public const ADDED = 1; - public const REMOVED = 2; - public const UNCHANGED = 3; - - /** - * @var int - */ - private $type; - - /** - * @var string - */ - private $content; - - public function __construct(int $type = self::UNCHANGED, string $content = '') - { - $this->type = $type; - $this->content = $content; - } - - public function getContent(): string - { - return $this->content; - } - - public function getType(): int - { - return $this->type; - } -} diff --git a/vendor/sebastian/diff/src/LongestCommonSubsequenceCalculator.php b/vendor/sebastian/diff/src/LongestCommonSubsequenceCalculator.php deleted file mode 100644 index 7eb1707..0000000 --- a/vendor/sebastian/diff/src/LongestCommonSubsequenceCalculator.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Diff; - -interface LongestCommonSubsequenceCalculator -{ - /** - * Calculates the longest common subsequence of two arrays. - * - * @param array $from - * @param array $to - * - * @return array - */ - public function calculate(array $from, array $to): array; -} diff --git a/vendor/sebastian/diff/src/MemoryEfficientLongestCommonSubsequenceCalculator.php b/vendor/sebastian/diff/src/MemoryEfficientLongestCommonSubsequenceCalculator.php deleted file mode 100644 index 82dc20c..0000000 --- a/vendor/sebastian/diff/src/MemoryEfficientLongestCommonSubsequenceCalculator.php +++ /dev/null @@ -1,81 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Diff; - -final class MemoryEfficientLongestCommonSubsequenceCalculator implements LongestCommonSubsequenceCalculator -{ - /** - * {@inheritdoc} - */ - public function calculate(array $from, array $to): array - { - $cFrom = \count($from); - $cTo = \count($to); - - if ($cFrom === 0) { - return []; - } - - if ($cFrom === 1) { - if (\in_array($from[0], $to, true)) { - return [$from[0]]; - } - - return []; - } - - $i = (int) ($cFrom / 2); - $fromStart = \array_slice($from, 0, $i); - $fromEnd = \array_slice($from, $i); - $llB = $this->length($fromStart, $to); - $llE = $this->length(\array_reverse($fromEnd), \array_reverse($to)); - $jMax = 0; - $max = 0; - - for ($j = 0; $j <= $cTo; $j++) { - $m = $llB[$j] + $llE[$cTo - $j]; - - if ($m >= $max) { - $max = $m; - $jMax = $j; - } - } - - $toStart = \array_slice($to, 0, $jMax); - $toEnd = \array_slice($to, $jMax); - - return \array_merge( - $this->calculate($fromStart, $toStart), - $this->calculate($fromEnd, $toEnd) - ); - } - - private function length(array $from, array $to): array - { - $current = \array_fill(0, \count($to) + 1, 0); - $cFrom = \count($from); - $cTo = \count($to); - - for ($i = 0; $i < $cFrom; $i++) { - $prev = $current; - - for ($j = 0; $j < $cTo; $j++) { - if ($from[$i] === $to[$j]) { - $current[$j + 1] = $prev[$j] + 1; - } else { - $current[$j + 1] = \max($current[$j], $prev[$j + 1]); - } - } - } - - return $current; - } -} diff --git a/vendor/sebastian/diff/src/Output/AbstractChunkOutputBuilder.php b/vendor/sebastian/diff/src/Output/AbstractChunkOutputBuilder.php deleted file mode 100644 index 6e590b0..0000000 --- a/vendor/sebastian/diff/src/Output/AbstractChunkOutputBuilder.php +++ /dev/null @@ -1,56 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Diff\Output; - -abstract class AbstractChunkOutputBuilder implements DiffOutputBuilderInterface -{ - /** - * Takes input of the diff array and returns the common parts. - * Iterates through diff line by line. - * - * @param array $diff - * @param int $lineThreshold - * - * @return array - */ - protected function getCommonChunks(array $diff, int $lineThreshold = 5): array - { - $diffSize = \count($diff); - $capturing = false; - $chunkStart = 0; - $chunkSize = 0; - $commonChunks = []; - - for ($i = 0; $i < $diffSize; ++$i) { - if ($diff[$i][1] === 0 /* OLD */) { - if ($capturing === false) { - $capturing = true; - $chunkStart = $i; - $chunkSize = 0; - } else { - ++$chunkSize; - } - } elseif ($capturing !== false) { - if ($chunkSize >= $lineThreshold) { - $commonChunks[$chunkStart] = $chunkStart + $chunkSize; - } - - $capturing = false; - } - } - - if ($capturing !== false && $chunkSize >= $lineThreshold) { - $commonChunks[$chunkStart] = $chunkStart + $chunkSize; - } - - return $commonChunks; - } -} diff --git a/vendor/sebastian/diff/src/Output/DiffOnlyOutputBuilder.php b/vendor/sebastian/diff/src/Output/DiffOnlyOutputBuilder.php deleted file mode 100644 index 8a186b5..0000000 --- a/vendor/sebastian/diff/src/Output/DiffOnlyOutputBuilder.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Diff\Output; - -use SebastianBergmann\Diff\Differ; - -/** - * Builds a diff string representation in a loose unified diff format - * listing only changes lines. Does not include line numbers. - */ -final class DiffOnlyOutputBuilder implements DiffOutputBuilderInterface -{ - /** - * @var string - */ - private $header; - - public function __construct(string $header = "--- Original\n+++ New\n") - { - $this->header = $header; - } - - public function getDiff(array $diff): string - { - $buffer = \fopen('php://memory', 'r+b'); - - if ('' !== $this->header) { - \fwrite($buffer, $this->header); - - if ("\n" !== \substr($this->header, -1, 1)) { - \fwrite($buffer, "\n"); - } - } - - foreach ($diff as $diffEntry) { - if ($diffEntry[1] === Differ::ADDED) { - \fwrite($buffer, '+' . $diffEntry[0]); - } elseif ($diffEntry[1] === Differ::REMOVED) { - \fwrite($buffer, '-' . $diffEntry[0]); - } elseif ($diffEntry[1] === Differ::DIFF_LINE_END_WARNING) { - \fwrite($buffer, ' ' . $diffEntry[0]); - - continue; // Warnings should not be tested for line break, it will always be there - } else { /* Not changed (old) 0 */ - continue; // we didn't write the non changs line, so do not add a line break either - } - - $lc = \substr($diffEntry[0], -1); - - if ($lc !== "\n" && $lc !== "\r") { - \fwrite($buffer, "\n"); // \No newline at end of file - } - } - - $diff = \stream_get_contents($buffer, -1, 0); - \fclose($buffer); - - return $diff; - } -} diff --git a/vendor/sebastian/diff/src/Output/DiffOutputBuilderInterface.php b/vendor/sebastian/diff/src/Output/DiffOutputBuilderInterface.php deleted file mode 100644 index f6e6afd..0000000 --- a/vendor/sebastian/diff/src/Output/DiffOutputBuilderInterface.php +++ /dev/null @@ -1,20 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Diff\Output; - -/** - * Defines how an output builder should take a generated - * diff array and return a string representation of that diff. - */ -interface DiffOutputBuilderInterface -{ - public function getDiff(array $diff): string; -} diff --git a/vendor/sebastian/diff/src/Output/StrictUnifiedDiffOutputBuilder.php b/vendor/sebastian/diff/src/Output/StrictUnifiedDiffOutputBuilder.php deleted file mode 100644 index 941b1a7..0000000 --- a/vendor/sebastian/diff/src/Output/StrictUnifiedDiffOutputBuilder.php +++ /dev/null @@ -1,318 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Diff\Output; - -use SebastianBergmann\Diff\ConfigurationException; -use SebastianBergmann\Diff\Differ; - -/** - * Strict Unified diff output builder. - * - * Generates (strict) Unified diff's (unidiffs) with hunks. - */ -final class StrictUnifiedDiffOutputBuilder implements DiffOutputBuilderInterface -{ - private static $default = [ - 'collapseRanges' => true, // ranges of length one are rendered with the trailing `,1` - 'commonLineThreshold' => 6, // number of same lines before ending a new hunk and creating a new one (if needed) - 'contextLines' => 3, // like `diff: -u, -U NUM, --unified[=NUM]`, for patch/git apply compatibility best to keep at least @ 3 - 'fromFile' => null, - 'fromFileDate' => null, - 'toFile' => null, - 'toFileDate' => null, - ]; - /** - * @var bool - */ - private $changed; - - /** - * @var bool - */ - private $collapseRanges; - - /** - * @var int >= 0 - */ - private $commonLineThreshold; - - /** - * @var string - */ - private $header; - - /** - * @var int >= 0 - */ - private $contextLines; - - public function __construct(array $options = []) - { - $options = \array_merge(self::$default, $options); - - if (!\is_bool($options['collapseRanges'])) { - throw new ConfigurationException('collapseRanges', 'a bool', $options['collapseRanges']); - } - - if (!\is_int($options['contextLines']) || $options['contextLines'] < 0) { - throw new ConfigurationException('contextLines', 'an int >= 0', $options['contextLines']); - } - - if (!\is_int($options['commonLineThreshold']) || $options['commonLineThreshold'] <= 0) { - throw new ConfigurationException('commonLineThreshold', 'an int > 0', $options['commonLineThreshold']); - } - - foreach (['fromFile', 'toFile'] as $option) { - if (!\is_string($options[$option])) { - throw new ConfigurationException($option, 'a string', $options[$option]); - } - } - - foreach (['fromFileDate', 'toFileDate'] as $option) { - if (null !== $options[$option] && !\is_string($options[$option])) { - throw new ConfigurationException($option, 'a string or ', $options[$option]); - } - } - - $this->header = \sprintf( - "--- %s%s\n+++ %s%s\n", - $options['fromFile'], - null === $options['fromFileDate'] ? '' : "\t" . $options['fromFileDate'], - $options['toFile'], - null === $options['toFileDate'] ? '' : "\t" . $options['toFileDate'] - ); - - $this->collapseRanges = $options['collapseRanges']; - $this->commonLineThreshold = $options['commonLineThreshold']; - $this->contextLines = $options['contextLines']; - } - - public function getDiff(array $diff): string - { - if (0 === \count($diff)) { - return ''; - } - - $this->changed = false; - - $buffer = \fopen('php://memory', 'r+b'); - \fwrite($buffer, $this->header); - - $this->writeDiffHunks($buffer, $diff); - - if (!$this->changed) { - \fclose($buffer); - - return ''; - } - - $diff = \stream_get_contents($buffer, -1, 0); - - \fclose($buffer); - - // If the last char is not a linebreak: add it. - // This might happen when both the `from` and `to` do not have a trailing linebreak - $last = \substr($diff, -1); - - return "\n" !== $last && "\r" !== $last - ? $diff . "\n" - : $diff - ; - } - - private function writeDiffHunks($output, array $diff): void - { - // detect "No newline at end of file" and insert into `$diff` if needed - - $upperLimit = \count($diff); - - if (0 === $diff[$upperLimit - 1][1]) { - $lc = \substr($diff[$upperLimit - 1][0], -1); - - if ("\n" !== $lc) { - \array_splice($diff, $upperLimit, 0, [["\n\\ No newline at end of file\n", Differ::NO_LINE_END_EOF_WARNING]]); - } - } else { - // search back for the last `+` and `-` line, - // check if has trailing linebreak, else add under it warning under it - $toFind = [1 => true, 2 => true]; - - for ($i = $upperLimit - 1; $i >= 0; --$i) { - if (isset($toFind[$diff[$i][1]])) { - unset($toFind[$diff[$i][1]]); - $lc = \substr($diff[$i][0], -1); - - if ("\n" !== $lc) { - \array_splice($diff, $i + 1, 0, [["\n\\ No newline at end of file\n", Differ::NO_LINE_END_EOF_WARNING]]); - } - - if (!\count($toFind)) { - break; - } - } - } - } - - // write hunks to output buffer - - $cutOff = \max($this->commonLineThreshold, $this->contextLines); - $hunkCapture = false; - $sameCount = $toRange = $fromRange = 0; - $toStart = $fromStart = 1; - - foreach ($diff as $i => $entry) { - if (0 === $entry[1]) { // same - if (false === $hunkCapture) { - ++$fromStart; - ++$toStart; - - continue; - } - - ++$sameCount; - ++$toRange; - ++$fromRange; - - if ($sameCount === $cutOff) { - $contextStartOffset = ($hunkCapture - $this->contextLines) < 0 - ? $hunkCapture - : $this->contextLines - ; - - // note: $contextEndOffset = $this->contextLines; - // - // because we never go beyond the end of the diff. - // with the cutoff/contextlines here the follow is never true; - // - // if ($i - $cutOff + $this->contextLines + 1 > \count($diff)) { - // $contextEndOffset = count($diff) - 1; - // } - // - // ; that would be true for a trailing incomplete hunk case which is dealt with after this loop - - $this->writeHunk( - $diff, - $hunkCapture - $contextStartOffset, - $i - $cutOff + $this->contextLines + 1, - $fromStart - $contextStartOffset, - $fromRange - $cutOff + $contextStartOffset + $this->contextLines, - $toStart - $contextStartOffset, - $toRange - $cutOff + $contextStartOffset + $this->contextLines, - $output - ); - - $fromStart += $fromRange; - $toStart += $toRange; - - $hunkCapture = false; - $sameCount = $toRange = $fromRange = 0; - } - - continue; - } - - $sameCount = 0; - - if ($entry[1] === Differ::NO_LINE_END_EOF_WARNING) { - continue; - } - - $this->changed = true; - - if (false === $hunkCapture) { - $hunkCapture = $i; - } - - if (Differ::ADDED === $entry[1]) { // added - ++$toRange; - } - - if (Differ::REMOVED === $entry[1]) { // removed - ++$fromRange; - } - } - - if (false === $hunkCapture) { - return; - } - - // we end here when cutoff (commonLineThreshold) was not reached, but we where capturing a hunk, - // do not render hunk till end automatically because the number of context lines might be less than the commonLineThreshold - - $contextStartOffset = $hunkCapture - $this->contextLines < 0 - ? $hunkCapture - : $this->contextLines - ; - - // prevent trying to write out more common lines than there are in the diff _and_ - // do not write more than configured through the context lines - $contextEndOffset = \min($sameCount, $this->contextLines); - - $fromRange -= $sameCount; - $toRange -= $sameCount; - - $this->writeHunk( - $diff, - $hunkCapture - $contextStartOffset, - $i - $sameCount + $contextEndOffset + 1, - $fromStart - $contextStartOffset, - $fromRange + $contextStartOffset + $contextEndOffset, - $toStart - $contextStartOffset, - $toRange + $contextStartOffset + $contextEndOffset, - $output - ); - } - - private function writeHunk( - array $diff, - int $diffStartIndex, - int $diffEndIndex, - int $fromStart, - int $fromRange, - int $toStart, - int $toRange, - $output - ): void { - \fwrite($output, '@@ -' . $fromStart); - - if (!$this->collapseRanges || 1 !== $fromRange) { - \fwrite($output, ',' . $fromRange); - } - - \fwrite($output, ' +' . $toStart); - - if (!$this->collapseRanges || 1 !== $toRange) { - \fwrite($output, ',' . $toRange); - } - - \fwrite($output, " @@\n"); - - for ($i = $diffStartIndex; $i < $diffEndIndex; ++$i) { - if ($diff[$i][1] === Differ::ADDED) { - $this->changed = true; - \fwrite($output, '+' . $diff[$i][0]); - } elseif ($diff[$i][1] === Differ::REMOVED) { - $this->changed = true; - \fwrite($output, '-' . $diff[$i][0]); - } elseif ($diff[$i][1] === Differ::OLD) { - \fwrite($output, ' ' . $diff[$i][0]); - } elseif ($diff[$i][1] === Differ::NO_LINE_END_EOF_WARNING) { - $this->changed = true; - \fwrite($output, $diff[$i][0]); - } - //} elseif ($diff[$i][1] === Differ::DIFF_LINE_END_WARNING) { // custom comment inserted by PHPUnit/diff package - // skip - //} else { - // unknown/invalid - //} - } - } -} diff --git a/vendor/sebastian/diff/src/Output/UnifiedDiffOutputBuilder.php b/vendor/sebastian/diff/src/Output/UnifiedDiffOutputBuilder.php deleted file mode 100644 index e7f0a9d..0000000 --- a/vendor/sebastian/diff/src/Output/UnifiedDiffOutputBuilder.php +++ /dev/null @@ -1,264 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Diff\Output; - -use SebastianBergmann\Diff\Differ; - -/** - * Builds a diff string representation in unified diff format in chunks. - */ -final class UnifiedDiffOutputBuilder extends AbstractChunkOutputBuilder -{ - /** - * @var bool - */ - private $collapseRanges = true; - - /** - * @var int >= 0 - */ - private $commonLineThreshold = 6; - - /** - * @var int >= 0 - */ - private $contextLines = 3; - - /** - * @var string - */ - private $header; - - /** - * @var bool - */ - private $addLineNumbers; - - public function __construct(string $header = "--- Original\n+++ New\n", bool $addLineNumbers = false) - { - $this->header = $header; - $this->addLineNumbers = $addLineNumbers; - } - - public function getDiff(array $diff): string - { - $buffer = \fopen('php://memory', 'r+b'); - - if ('' !== $this->header) { - \fwrite($buffer, $this->header); - - if ("\n" !== \substr($this->header, -1, 1)) { - \fwrite($buffer, "\n"); - } - } - - if (0 !== \count($diff)) { - $this->writeDiffHunks($buffer, $diff); - } - - $diff = \stream_get_contents($buffer, -1, 0); - - \fclose($buffer); - - // If the last char is not a linebreak: add it. - // This might happen when both the `from` and `to` do not have a trailing linebreak - $last = \substr($diff, -1); - - return "\n" !== $last && "\r" !== $last - ? $diff . "\n" - : $diff - ; - } - - private function writeDiffHunks($output, array $diff): void - { - // detect "No newline at end of file" and insert into `$diff` if needed - - $upperLimit = \count($diff); - - if (0 === $diff[$upperLimit - 1][1]) { - $lc = \substr($diff[$upperLimit - 1][0], -1); - - if ("\n" !== $lc) { - \array_splice($diff, $upperLimit, 0, [["\n\\ No newline at end of file\n", Differ::NO_LINE_END_EOF_WARNING]]); - } - } else { - // search back for the last `+` and `-` line, - // check if has trailing linebreak, else add under it warning under it - $toFind = [1 => true, 2 => true]; - - for ($i = $upperLimit - 1; $i >= 0; --$i) { - if (isset($toFind[$diff[$i][1]])) { - unset($toFind[$diff[$i][1]]); - $lc = \substr($diff[$i][0], -1); - - if ("\n" !== $lc) { - \array_splice($diff, $i + 1, 0, [["\n\\ No newline at end of file\n", Differ::NO_LINE_END_EOF_WARNING]]); - } - - if (!\count($toFind)) { - break; - } - } - } - } - - // write hunks to output buffer - - $cutOff = \max($this->commonLineThreshold, $this->contextLines); - $hunkCapture = false; - $sameCount = $toRange = $fromRange = 0; - $toStart = $fromStart = 1; - - foreach ($diff as $i => $entry) { - if (0 === $entry[1]) { // same - if (false === $hunkCapture) { - ++$fromStart; - ++$toStart; - - continue; - } - - ++$sameCount; - ++$toRange; - ++$fromRange; - - if ($sameCount === $cutOff) { - $contextStartOffset = ($hunkCapture - $this->contextLines) < 0 - ? $hunkCapture - : $this->contextLines - ; - - // note: $contextEndOffset = $this->contextLines; - // - // because we never go beyond the end of the diff. - // with the cutoff/contextlines here the follow is never true; - // - // if ($i - $cutOff + $this->contextLines + 1 > \count($diff)) { - // $contextEndOffset = count($diff) - 1; - // } - // - // ; that would be true for a trailing incomplete hunk case which is dealt with after this loop - - $this->writeHunk( - $diff, - $hunkCapture - $contextStartOffset, - $i - $cutOff + $this->contextLines + 1, - $fromStart - $contextStartOffset, - $fromRange - $cutOff + $contextStartOffset + $this->contextLines, - $toStart - $contextStartOffset, - $toRange - $cutOff + $contextStartOffset + $this->contextLines, - $output - ); - - $fromStart += $fromRange; - $toStart += $toRange; - - $hunkCapture = false; - $sameCount = $toRange = $fromRange = 0; - } - - continue; - } - - $sameCount = 0; - - if ($entry[1] === Differ::NO_LINE_END_EOF_WARNING) { - continue; - } - - if (false === $hunkCapture) { - $hunkCapture = $i; - } - - if (Differ::ADDED === $entry[1]) { - ++$toRange; - } - - if (Differ::REMOVED === $entry[1]) { - ++$fromRange; - } - } - - if (false === $hunkCapture) { - return; - } - - // we end here when cutoff (commonLineThreshold) was not reached, but we where capturing a hunk, - // do not render hunk till end automatically because the number of context lines might be less than the commonLineThreshold - - $contextStartOffset = $hunkCapture - $this->contextLines < 0 - ? $hunkCapture - : $this->contextLines - ; - - // prevent trying to write out more common lines than there are in the diff _and_ - // do not write more than configured through the context lines - $contextEndOffset = \min($sameCount, $this->contextLines); - - $fromRange -= $sameCount; - $toRange -= $sameCount; - - $this->writeHunk( - $diff, - $hunkCapture - $contextStartOffset, - $i - $sameCount + $contextEndOffset + 1, - $fromStart - $contextStartOffset, - $fromRange + $contextStartOffset + $contextEndOffset, - $toStart - $contextStartOffset, - $toRange + $contextStartOffset + $contextEndOffset, - $output - ); - } - - private function writeHunk( - array $diff, - int $diffStartIndex, - int $diffEndIndex, - int $fromStart, - int $fromRange, - int $toStart, - int $toRange, - $output - ): void { - if ($this->addLineNumbers) { - \fwrite($output, '@@ -' . $fromStart); - - if (!$this->collapseRanges || 1 !== $fromRange) { - \fwrite($output, ',' . $fromRange); - } - - \fwrite($output, ' +' . $toStart); - - if (!$this->collapseRanges || 1 !== $toRange) { - \fwrite($output, ',' . $toRange); - } - - \fwrite($output, " @@\n"); - } else { - \fwrite($output, "@@ @@\n"); - } - - for ($i = $diffStartIndex; $i < $diffEndIndex; ++$i) { - if ($diff[$i][1] === Differ::ADDED) { - \fwrite($output, '+' . $diff[$i][0]); - } elseif ($diff[$i][1] === Differ::REMOVED) { - \fwrite($output, '-' . $diff[$i][0]); - } elseif ($diff[$i][1] === Differ::OLD) { - \fwrite($output, ' ' . $diff[$i][0]); - } elseif ($diff[$i][1] === Differ::NO_LINE_END_EOF_WARNING) { - \fwrite($output, "\n"); // $diff[$i][0] - } else { /* Not changed (old) Differ::OLD or Warning Differ::DIFF_LINE_END_WARNING */ - \fwrite($output, ' ' . $diff[$i][0]); - } - } - } -} diff --git a/vendor/sebastian/diff/src/Parser.php b/vendor/sebastian/diff/src/Parser.php deleted file mode 100644 index 3c52f43..0000000 --- a/vendor/sebastian/diff/src/Parser.php +++ /dev/null @@ -1,106 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Diff; - -/** - * Unified diff parser. - */ -final class Parser -{ - /** - * @param string $string - * - * @return Diff[] - */ - public function parse(string $string): array - { - $lines = \preg_split('(\r\n|\r|\n)', $string); - - if (!empty($lines) && $lines[\count($lines) - 1] === '') { - \array_pop($lines); - } - - $lineCount = \count($lines); - $diffs = []; - $diff = null; - $collected = []; - - for ($i = 0; $i < $lineCount; ++$i) { - if (\preg_match('(^---\\s+(?P\\S+))', $lines[$i], $fromMatch) && - \preg_match('(^\\+\\+\\+\\s+(?P\\S+))', $lines[$i + 1], $toMatch)) { - if ($diff !== null) { - $this->parseFileDiff($diff, $collected); - - $diffs[] = $diff; - $collected = []; - } - - $diff = new Diff($fromMatch['file'], $toMatch['file']); - - ++$i; - } else { - if (\preg_match('/^(?:diff --git |index [\da-f\.]+|[+-]{3} [ab])/', $lines[$i])) { - continue; - } - - $collected[] = $lines[$i]; - } - } - - if ($diff !== null && \count($collected)) { - $this->parseFileDiff($diff, $collected); - - $diffs[] = $diff; - } - - return $diffs; - } - - private function parseFileDiff(Diff $diff, array $lines): void - { - $chunks = []; - $chunk = null; - - foreach ($lines as $line) { - if (\preg_match('/^@@\s+-(?P\d+)(?:,\s*(?P\d+))?\s+\+(?P\d+)(?:,\s*(?P\d+))?\s+@@/', $line, $match)) { - $chunk = new Chunk( - (int) $match['start'], - isset($match['startrange']) ? \max(1, (int) $match['startrange']) : 1, - (int) $match['end'], - isset($match['endrange']) ? \max(1, (int) $match['endrange']) : 1 - ); - - $chunks[] = $chunk; - $diffLines = []; - - continue; - } - - if (\preg_match('/^(?P[+ -])?(?P.*)/', $line, $match)) { - $type = Line::UNCHANGED; - - if ($match['type'] === '+') { - $type = Line::ADDED; - } elseif ($match['type'] === '-') { - $type = Line::REMOVED; - } - - $diffLines[] = new Line($type, $match['line']); - - if (null !== $chunk) { - $chunk->setLines($diffLines); - } - } - } - - $diff->setChunks($chunks); - } -} diff --git a/vendor/sebastian/diff/src/TimeEfficientLongestCommonSubsequenceCalculator.php b/vendor/sebastian/diff/src/TimeEfficientLongestCommonSubsequenceCalculator.php deleted file mode 100644 index 97dadbd..0000000 --- a/vendor/sebastian/diff/src/TimeEfficientLongestCommonSubsequenceCalculator.php +++ /dev/null @@ -1,66 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Diff; - -final class TimeEfficientLongestCommonSubsequenceCalculator implements LongestCommonSubsequenceCalculator -{ - /** - * {@inheritdoc} - */ - public function calculate(array $from, array $to): array - { - $common = []; - $fromLength = \count($from); - $toLength = \count($to); - $width = $fromLength + 1; - $matrix = new \SplFixedArray($width * ($toLength + 1)); - - for ($i = 0; $i <= $fromLength; ++$i) { - $matrix[$i] = 0; - } - - for ($j = 0; $j <= $toLength; ++$j) { - $matrix[$j * $width] = 0; - } - - for ($i = 1; $i <= $fromLength; ++$i) { - for ($j = 1; $j <= $toLength; ++$j) { - $o = ($j * $width) + $i; - $matrix[$o] = \max( - $matrix[$o - 1], - $matrix[$o - $width], - $from[$i - 1] === $to[$j - 1] ? $matrix[$o - $width - 1] + 1 : 0 - ); - } - } - - $i = $fromLength; - $j = $toLength; - - while ($i > 0 && $j > 0) { - if ($from[$i - 1] === $to[$j - 1]) { - $common[] = $from[$i - 1]; - --$i; - --$j; - } else { - $o = ($j * $width) + $i; - - if ($matrix[$o - $width] > $matrix[$o - 1]) { - --$j; - } else { - --$i; - } - } - } - - return \array_reverse($common); - } -} diff --git a/vendor/sebastian/diff/tests/ChunkTest.php b/vendor/sebastian/diff/tests/ChunkTest.php deleted file mode 100644 index 40106c0..0000000 --- a/vendor/sebastian/diff/tests/ChunkTest.php +++ /dev/null @@ -1,73 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Diff; - -use PHPUnit\Framework\TestCase; - -/** - * @covers SebastianBergmann\Diff\Chunk - */ -final class ChunkTest extends TestCase -{ - /** - * @var Chunk - */ - private $chunk; - - protected function setUp(): void - { - $this->chunk = new Chunk; - } - - public function testHasInitiallyNoLines(): void - { - $this->assertSame([], $this->chunk->getLines()); - } - - public function testCanBeCreatedWithoutArguments(): void - { - $this->assertInstanceOf(Chunk::class, $this->chunk); - } - - public function testStartCanBeRetrieved(): void - { - $this->assertSame(0, $this->chunk->getStart()); - } - - public function testStartRangeCanBeRetrieved(): void - { - $this->assertSame(1, $this->chunk->getStartRange()); - } - - public function testEndCanBeRetrieved(): void - { - $this->assertSame(0, $this->chunk->getEnd()); - } - - public function testEndRangeCanBeRetrieved(): void - { - $this->assertSame(1, $this->chunk->getEndRange()); - } - - public function testLinesCanBeRetrieved(): void - { - $this->assertSame([], $this->chunk->getLines()); - } - - public function testLinesCanBeSet(): void - { - $lines = [new Line(Line::ADDED, 'added'), new Line(Line::REMOVED, 'removed')]; - - $this->chunk->setLines($lines); - - $this->assertSame($lines, $this->chunk->getLines()); - } -} diff --git a/vendor/sebastian/diff/tests/DiffTest.php b/vendor/sebastian/diff/tests/DiffTest.php deleted file mode 100644 index 20f76e1..0000000 --- a/vendor/sebastian/diff/tests/DiffTest.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Diff; - -use PHPUnit\Framework\TestCase; - -/** - * @covers SebastianBergmann\Diff\Diff - * - * @uses SebastianBergmann\Diff\Chunk - */ -final class DiffTest extends TestCase -{ - public function testGettersAfterConstructionWithDefault(): void - { - $from = 'line1a'; - $to = 'line2a'; - $diff = new Diff($from, $to); - - $this->assertSame($from, $diff->getFrom()); - $this->assertSame($to, $diff->getTo()); - $this->assertSame([], $diff->getChunks(), 'Expect chunks to be default value "array()".'); - } - - public function testGettersAfterConstructionWithChunks(): void - { - $from = 'line1b'; - $to = 'line2b'; - $chunks = [new Chunk(), new Chunk(2, 3)]; - - $diff = new Diff($from, $to, $chunks); - - $this->assertSame($from, $diff->getFrom()); - $this->assertSame($to, $diff->getTo()); - $this->assertSame($chunks, $diff->getChunks(), 'Expect chunks to be passed value.'); - } - - public function testSetChunksAfterConstruction(): void - { - $diff = new Diff('line1c', 'line2c'); - $this->assertSame([], $diff->getChunks(), 'Expect chunks to be default value "array()".'); - - $chunks = [new Chunk(), new Chunk(2, 3)]; - $diff->setChunks($chunks); - $this->assertSame($chunks, $diff->getChunks(), 'Expect chunks to be passed value.'); - } -} diff --git a/vendor/sebastian/diff/tests/DifferTest.php b/vendor/sebastian/diff/tests/DifferTest.php deleted file mode 100644 index 5a8962e..0000000 --- a/vendor/sebastian/diff/tests/DifferTest.php +++ /dev/null @@ -1,444 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Diff; - -use PHPUnit\Framework\TestCase; -use SebastianBergmann\Diff\Output\UnifiedDiffOutputBuilder; - -/** - * @covers SebastianBergmann\Diff\Differ - * @covers SebastianBergmann\Diff\Output\UnifiedDiffOutputBuilder - * - * @uses SebastianBergmann\Diff\MemoryEfficientLongestCommonSubsequenceCalculator - * @uses SebastianBergmann\Diff\TimeEfficientLongestCommonSubsequenceCalculator - * @uses SebastianBergmann\Diff\Output\AbstractChunkOutputBuilder - */ -final class DifferTest extends TestCase -{ - /** - * @var Differ - */ - private $differ; - - protected function setUp(): void - { - $this->differ = new Differ; - } - - /** - * @param array $expected - * @param array|string $from - * @param array|string $to - * - * @dataProvider arrayProvider - */ - public function testArrayRepresentationOfDiffCanBeRenderedUsingTimeEfficientLcsImplementation(array $expected, $from, $to): void - { - $this->assertSame($expected, $this->differ->diffToArray($from, $to, new TimeEfficientLongestCommonSubsequenceCalculator)); - } - - /** - * @param string $expected - * @param string $from - * @param string $to - * - * @dataProvider textProvider - */ - public function testTextRepresentationOfDiffCanBeRenderedUsingTimeEfficientLcsImplementation(string $expected, string $from, string $to): void - { - $this->assertSame($expected, $this->differ->diff($from, $to, new TimeEfficientLongestCommonSubsequenceCalculator)); - } - - /** - * @param array $expected - * @param array|string $from - * @param array|string $to - * - * @dataProvider arrayProvider - */ - public function testArrayRepresentationOfDiffCanBeRenderedUsingMemoryEfficientLcsImplementation(array $expected, $from, $to): void - { - $this->assertSame($expected, $this->differ->diffToArray($from, $to, new MemoryEfficientLongestCommonSubsequenceCalculator)); - } - - /** - * @param string $expected - * @param string $from - * @param string $to - * - * @dataProvider textProvider - */ - public function testTextRepresentationOfDiffCanBeRenderedUsingMemoryEfficientLcsImplementation(string $expected, string $from, string $to): void - { - $this->assertSame($expected, $this->differ->diff($from, $to, new MemoryEfficientLongestCommonSubsequenceCalculator)); - } - - public function testTypesOtherThanArrayAndStringCanBePassed(): void - { - $this->assertSame( - "--- Original\n+++ New\n@@ @@\n-1\n+2\n", - $this->differ->diff(1, 2) - ); - } - - public function testArrayDiffs(): void - { - $this->assertSame( - '--- Original -+++ New -@@ @@ --one -+two -', - $this->differ->diff(['one'], ['two']) - ); - } - - public function arrayProvider(): array - { - return [ - [ - [ - ['a', Differ::REMOVED], - ['b', Differ::ADDED], - ], - 'a', - 'b', - ], - [ - [ - ['ba', Differ::REMOVED], - ['bc', Differ::ADDED], - ], - 'ba', - 'bc', - ], - [ - [ - ['ab', Differ::REMOVED], - ['cb', Differ::ADDED], - ], - 'ab', - 'cb', - ], - [ - [ - ['abc', Differ::REMOVED], - ['adc', Differ::ADDED], - ], - 'abc', - 'adc', - ], - [ - [ - ['ab', Differ::REMOVED], - ['abc', Differ::ADDED], - ], - 'ab', - 'abc', - ], - [ - [ - ['bc', Differ::REMOVED], - ['abc', Differ::ADDED], - ], - 'bc', - 'abc', - ], - [ - [ - ['abc', Differ::REMOVED], - ['abbc', Differ::ADDED], - ], - 'abc', - 'abbc', - ], - [ - [ - ['abcdde', Differ::REMOVED], - ['abcde', Differ::ADDED], - ], - 'abcdde', - 'abcde', - ], - 'same start' => [ - [ - [17, Differ::OLD], - ['b', Differ::REMOVED], - ['d', Differ::ADDED], - ], - [30 => 17, 'a' => 'b'], - [30 => 17, 'c' => 'd'], - ], - 'same end' => [ - [ - [1, Differ::REMOVED], - [2, Differ::ADDED], - ['b', Differ::OLD], - ], - [1 => 1, 'a' => 'b'], - [1 => 2, 'a' => 'b'], - ], - 'same start (2), same end (1)' => [ - [ - [17, Differ::OLD], - [2, Differ::OLD], - [4, Differ::REMOVED], - ['a', Differ::ADDED], - [5, Differ::ADDED], - ['x', Differ::OLD], - ], - [30 => 17, 1 => 2, 2 => 4, 'z' => 'x'], - [30 => 17, 1 => 2, 3 => 'a', 2 => 5, 'z' => 'x'], - ], - 'same' => [ - [ - ['x', Differ::OLD], - ], - ['z' => 'x'], - ['z' => 'x'], - ], - 'diff' => [ - [ - ['y', Differ::REMOVED], - ['x', Differ::ADDED], - ], - ['x' => 'y'], - ['z' => 'x'], - ], - 'diff 2' => [ - [ - ['y', Differ::REMOVED], - ['b', Differ::REMOVED], - ['x', Differ::ADDED], - ['d', Differ::ADDED], - ], - ['x' => 'y', 'a' => 'b'], - ['z' => 'x', 'c' => 'd'], - ], - 'test line diff detection' => [ - [ - [ - "#Warning: Strings contain different line endings!\n", - Differ::DIFF_LINE_END_WARNING, - ], - [ - " [ - [ - [ - "#Warning: Strings contain different line endings!\n", - Differ::DIFF_LINE_END_WARNING, - ], - [ - "expectException(InvalidArgumentException::class); - $this->expectExceptionMessageRegExp('#^"from" must be an array or string\.$#'); - - $this->differ->diffToArray(null, ''); - } - - public function testDiffInvalidToType(): void - { - $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessageRegExp('#^"to" must be an array or string\.$#'); - - $this->differ->diffToArray('', new \stdClass); - } - - /** - * @param array $expected - * @param string $input - * - * @dataProvider provideSplitStringByLinesCases - */ - public function testSplitStringByLines(array $expected, string $input): void - { - $reflection = new \ReflectionObject($this->differ); - $method = $reflection->getMethod('splitStringByLines'); - $method->setAccessible(true); - - $this->assertSame($expected, $method->invoke($this->differ, $input)); - } - - public function provideSplitStringByLinesCases(): array - { - return [ - [ - [], - '', - ], - [ - ['a'], - 'a', - ], - [ - ["a\n"], - "a\n", - ], - [ - ["a\r"], - "a\r", - ], - [ - ["a\r\n"], - "a\r\n", - ], - [ - ["\n"], - "\n", - ], - [ - ["\r"], - "\r", - ], - [ - ["\r\n"], - "\r\n", - ], - [ - [ - "A\n", - "B\n", - "\n", - "C\n", - ], - "A\nB\n\nC\n", - ], - [ - [ - "A\r\n", - "B\n", - "\n", - "C\r", - ], - "A\r\nB\n\nC\r", - ], - [ - [ - "\n", - "A\r\n", - "B\n", - "\n", - 'C', - ], - "\nA\r\nB\n\nC", - ], - ]; - } - - public function testConstructorInvalidArgInt(): void - { - $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessageRegExp('/^Expected builder to be an instance of DiffOutputBuilderInterface, or a string, got integer "1"\.$/'); - - new Differ(1); - } - - public function testConstructorInvalidArgObject(): void - { - $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessageRegExp('/^Expected builder to be an instance of DiffOutputBuilderInterface, or a string, got instance of "SplFileInfo"\.$/'); - - new Differ(new \SplFileInfo(__FILE__)); - } -} diff --git a/vendor/sebastian/diff/tests/Exception/ConfigurationExceptionTest.php b/vendor/sebastian/diff/tests/Exception/ConfigurationExceptionTest.php deleted file mode 100644 index 1ce887a..0000000 --- a/vendor/sebastian/diff/tests/Exception/ConfigurationExceptionTest.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Diff; - -use PHPUnit\Framework\TestCase; - -/** - * @covers SebastianBergmann\Diff\ConfigurationException - */ -final class ConfigurationExceptionTest extends TestCase -{ - public function testConstructWithDefaults(): void - { - $e = new ConfigurationException('test', 'A', 'B'); - - $this->assertSame(0, $e->getCode()); - $this->assertNull($e->getPrevious()); - $this->assertSame('Option "test" must be A, got "string#B".', $e->getMessage()); - } - - public function testConstruct(): void - { - $e = new ConfigurationException( - 'test', - 'integer', - new \SplFileInfo(__FILE__), - 789, - new \BadMethodCallException(__METHOD__) - ); - - $this->assertSame('Option "test" must be integer, got "SplFileInfo".', $e->getMessage()); - } -} diff --git a/vendor/sebastian/diff/tests/Exception/InvalidArgumentExceptionTest.php b/vendor/sebastian/diff/tests/Exception/InvalidArgumentExceptionTest.php deleted file mode 100644 index a112920..0000000 --- a/vendor/sebastian/diff/tests/Exception/InvalidArgumentExceptionTest.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Diff; - -use PHPUnit\Framework\TestCase; - -/** - * @covers SebastianBergmann\Diff\InvalidArgumentException - */ -final class InvalidArgumentExceptionTest extends TestCase -{ - public function testInvalidArgumentException(): void - { - $previousException = new \LogicException(); - $message = 'test'; - $code = 123; - - $exception = new InvalidArgumentException($message, $code, $previousException); - - $this->assertInstanceOf(Exception::class, $exception); - $this->assertSame($message, $exception->getMessage()); - $this->assertSame($code, $exception->getCode()); - $this->assertSame($previousException, $exception->getPrevious()); - } -} diff --git a/vendor/sebastian/diff/tests/LineTest.php b/vendor/sebastian/diff/tests/LineTest.php deleted file mode 100644 index 5aca39b..0000000 --- a/vendor/sebastian/diff/tests/LineTest.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Diff; - -use PHPUnit\Framework\TestCase; - -/** - * @covers SebastianBergmann\Diff\Line - */ -final class LineTest extends TestCase -{ - /** - * @var Line - */ - private $line; - - protected function setUp(): void - { - $this->line = new Line; - } - - public function testCanBeCreatedWithoutArguments(): void - { - $this->assertInstanceOf(Line::class, $this->line); - } - - public function testTypeCanBeRetrieved(): void - { - $this->assertSame(Line::UNCHANGED, $this->line->getType()); - } - - public function testContentCanBeRetrieved(): void - { - $this->assertSame('', $this->line->getContent()); - } -} diff --git a/vendor/sebastian/diff/tests/LongestCommonSubsequenceTest.php b/vendor/sebastian/diff/tests/LongestCommonSubsequenceTest.php deleted file mode 100644 index 28d2809..0000000 --- a/vendor/sebastian/diff/tests/LongestCommonSubsequenceTest.php +++ /dev/null @@ -1,201 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Diff; - -use PHPUnit\Framework\TestCase; - -/** - * @coversNothing - */ -abstract class LongestCommonSubsequenceTest extends TestCase -{ - /** - * @var LongestCommonSubsequenceCalculator - */ - private $implementation; - - /** - * @var string - */ - private $memoryLimit; - - /** - * @var int[] - */ - private $stress_sizes = [1, 2, 3, 100, 500, 1000, 2000]; - - protected function setUp(): void - { - $this->memoryLimit = \ini_get('memory_limit'); - \ini_set('memory_limit', '256M'); - - $this->implementation = $this->createImplementation(); - } - - protected function tearDown(): void - { - \ini_set('memory_limit', $this->memoryLimit); - } - - public function testBothEmpty(): void - { - $from = []; - $to = []; - $common = $this->implementation->calculate($from, $to); - - $this->assertSame([], $common); - } - - public function testIsStrictComparison(): void - { - $from = [ - false, 0, 0.0, '', null, [], - true, 1, 1.0, 'foo', ['foo', 'bar'], ['foo' => 'bar'], - ]; - $to = $from; - $common = $this->implementation->calculate($from, $to); - - $this->assertSame($from, $common); - - $to = [ - false, false, false, false, false, false, - true, true, true, true, true, true, - ]; - - $expected = [ - false, - true, - ]; - - $common = $this->implementation->calculate($from, $to); - - $this->assertSame($expected, $common); - } - - public function testEqualSequences(): void - { - foreach ($this->stress_sizes as $size) { - $range = \range(1, $size); - $from = $range; - $to = $range; - $common = $this->implementation->calculate($from, $to); - - $this->assertSame($range, $common); - } - } - - public function testDistinctSequences(): void - { - $from = ['A']; - $to = ['B']; - $common = $this->implementation->calculate($from, $to); - $this->assertSame([], $common); - - $from = ['A', 'B', 'C']; - $to = ['D', 'E', 'F']; - $common = $this->implementation->calculate($from, $to); - $this->assertSame([], $common); - - foreach ($this->stress_sizes as $size) { - $from = \range(1, $size); - $to = \range($size + 1, $size * 2); - $common = $this->implementation->calculate($from, $to); - $this->assertSame([], $common); - } - } - - public function testCommonSubsequence(): void - { - $from = ['A', 'C', 'E', 'F', 'G']; - $to = ['A', 'B', 'D', 'E', 'H']; - $expected = ['A', 'E']; - $common = $this->implementation->calculate($from, $to); - $this->assertSame($expected, $common); - - $from = ['A', 'C', 'E', 'F', 'G']; - $to = ['B', 'C', 'D', 'E', 'F', 'H']; - $expected = ['C', 'E', 'F']; - $common = $this->implementation->calculate($from, $to); - $this->assertSame($expected, $common); - - foreach ($this->stress_sizes as $size) { - $from = $size < 2 ? [1] : \range(1, $size + 1, 2); - $to = $size < 3 ? [1] : \range(1, $size + 1, 3); - $expected = $size < 6 ? [1] : \range(1, $size + 1, 6); - $common = $this->implementation->calculate($from, $to); - - $this->assertSame($expected, $common); - } - } - - public function testSingleElementSubsequenceAtStart(): void - { - foreach ($this->stress_sizes as $size) { - $from = \range(1, $size); - $to = \array_slice($from, 0, 1); - $common = $this->implementation->calculate($from, $to); - - $this->assertSame($to, $common); - } - } - - public function testSingleElementSubsequenceAtMiddle(): void - { - foreach ($this->stress_sizes as $size) { - $from = \range(1, $size); - $to = \array_slice($from, (int) ($size / 2), 1); - $common = $this->implementation->calculate($from, $to); - - $this->assertSame($to, $common); - } - } - - public function testSingleElementSubsequenceAtEnd(): void - { - foreach ($this->stress_sizes as $size) { - $from = \range(1, $size); - $to = \array_slice($from, $size - 1, 1); - $common = $this->implementation->calculate($from, $to); - - $this->assertSame($to, $common); - } - } - - public function testReversedSequences(): void - { - $from = ['A', 'B']; - $to = ['B', 'A']; - $expected = ['A']; - $common = $this->implementation->calculate($from, $to); - $this->assertSame($expected, $common); - - foreach ($this->stress_sizes as $size) { - $from = \range(1, $size); - $to = \array_reverse($from); - $common = $this->implementation->calculate($from, $to); - - $this->assertSame([1], $common); - } - } - - public function testStrictTypeCalculate(): void - { - $diff = $this->implementation->calculate(['5'], ['05']); - - $this->assertIsArray($diff); - $this->assertCount(0, $diff); - } - - /** - * @return LongestCommonSubsequenceCalculator - */ - abstract protected function createImplementation(): LongestCommonSubsequenceCalculator; -} diff --git a/vendor/sebastian/diff/tests/MemoryEfficientImplementationTest.php b/vendor/sebastian/diff/tests/MemoryEfficientImplementationTest.php deleted file mode 100644 index a8a21e2..0000000 --- a/vendor/sebastian/diff/tests/MemoryEfficientImplementationTest.php +++ /dev/null @@ -1,22 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Diff; - -/** - * @covers SebastianBergmann\Diff\MemoryEfficientLongestCommonSubsequenceCalculator - */ -final class MemoryEfficientImplementationTest extends LongestCommonSubsequenceTest -{ - protected function createImplementation(): LongestCommonSubsequenceCalculator - { - return new MemoryEfficientLongestCommonSubsequenceCalculator; - } -} diff --git a/vendor/sebastian/diff/tests/Output/AbstractChunkOutputBuilderTest.php b/vendor/sebastian/diff/tests/Output/AbstractChunkOutputBuilderTest.php deleted file mode 100644 index ad6ceb2..0000000 --- a/vendor/sebastian/diff/tests/Output/AbstractChunkOutputBuilderTest.php +++ /dev/null @@ -1,152 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Diff\Output; - -use PHPUnit\Framework\TestCase; -use SebastianBergmann\Diff\Differ; - -/** - * @covers SebastianBergmann\Diff\Output\AbstractChunkOutputBuilder - * - * @uses SebastianBergmann\Diff\Differ - * @uses SebastianBergmann\Diff\Output\UnifiedDiffOutputBuilder - * @uses SebastianBergmann\Diff\TimeEfficientLongestCommonSubsequenceCalculator - */ -final class AbstractChunkOutputBuilderTest extends TestCase -{ - /** - * @param array $expected - * @param string $from - * @param string $to - * @param int $lineThreshold - * - * @dataProvider provideGetCommonChunks - */ - public function testGetCommonChunks(array $expected, string $from, string $to, int $lineThreshold = 5): void - { - $output = new class extends AbstractChunkOutputBuilder { - public function getDiff(array $diff): string - { - return ''; - } - - public function getChunks(array $diff, $lineThreshold) - { - return $this->getCommonChunks($diff, $lineThreshold); - } - }; - - $this->assertSame( - $expected, - $output->getChunks((new Differ)->diffToArray($from, $to), $lineThreshold) - ); - } - - public function provideGetCommonChunks(): array - { - return[ - 'same (with default threshold)' => [ - [], - 'A', - 'A', - ], - 'same (threshold 0)' => [ - [0 => 0], - 'A', - 'A', - 0, - ], - 'empty' => [ - [], - '', - '', - ], - 'single line diff' => [ - [], - 'A', - 'B', - ], - 'below threshold I' => [ - [], - "A\nX\nC", - "A\nB\nC", - ], - 'below threshold II' => [ - [], - "A\n\n\n\nX\nC", - "A\n\n\n\nB\nC", - ], - 'below threshold III' => [ - [0 => 5], - "A\n\n\n\n\n\nB", - "A\n\n\n\n\n\nA", - ], - 'same start' => [ - [0 => 5], - "A\n\n\n\n\n\nX\nC", - "A\n\n\n\n\n\nB\nC", - ], - 'same start long' => [ - [0 => 13], - "\n\n\n\n\n\n\n\n\n\n\n\n\n\nA", - "\n\n\n\n\n\n\n\n\n\n\n\n\n\nB", - ], - 'same part in between' => [ - [2 => 8], - "A\n\n\n\n\n\n\nX\nY\nZ\n\n", - "B\n\n\n\n\n\n\nX\nA\nZ\n\n", - ], - 'same trailing' => [ - [2 => 14], - "A\n\n\n\n\n\n\n\n\n\n\n\n\n\n", - "B\n\n\n\n\n\n\n\n\n\n\n\n\n\n", - ], - 'same part in between, same trailing' => [ - [2 => 7, 10 => 15], - "A\n\n\n\n\n\n\nA\n\n\n\n\n\n\n", - "B\n\n\n\n\n\n\nB\n\n\n\n\n\n\n", - ], - 'below custom threshold I' => [ - [], - "A\n\nB", - "A\n\nD", - 2, - ], - 'custom threshold I' => [ - [0 => 1], - "A\n\nB", - "A\n\nD", - 1, - ], - 'custom threshold II' => [ - [], - "A\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", - "A\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", - 19, - ], - [ - [3 => 9], - "a\nb\nc\nd\ne\nf\ng\nh\ni\nj\nk", - "a\np\nc\nd\ne\nf\ng\nh\ni\nw\nk", - ], - [ - [0 => 5, 8 => 13], - "A\nA\nA\nA\nA\nA\nX\nC\nC\nC\nC\nC\nC", - "A\nA\nA\nA\nA\nA\nB\nC\nC\nC\nC\nC\nC", - ], - [ - [0 => 5, 8 => 13], - "A\nA\nA\nA\nA\nA\nX\nC\nC\nC\nC\nC\nC\nX", - "A\nA\nA\nA\nA\nA\nB\nC\nC\nC\nC\nC\nC\nY", - ], - ]; - } -} diff --git a/vendor/sebastian/diff/tests/Output/DiffOnlyOutputBuilderTest.php b/vendor/sebastian/diff/tests/Output/DiffOnlyOutputBuilderTest.php deleted file mode 100644 index 87c0176..0000000 --- a/vendor/sebastian/diff/tests/Output/DiffOnlyOutputBuilderTest.php +++ /dev/null @@ -1,76 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Diff\Output; - -use PHPUnit\Framework\TestCase; -use SebastianBergmann\Diff\Differ; - -/** - * @covers SebastianBergmann\Diff\Output\DiffOnlyOutputBuilder - * - * @uses SebastianBergmann\Diff\Differ - * @uses SebastianBergmann\Diff\TimeEfficientLongestCommonSubsequenceCalculator - */ -final class DiffOnlyOutputBuilderTest extends TestCase -{ - /** - * @param string $expected - * @param string $from - * @param string $to - * @param string $header - * - * @dataProvider textForNoNonDiffLinesProvider - */ - public function testDiffDoNotShowNonDiffLines(string $expected, string $from, string $to, string $header = ''): void - { - $differ = new Differ(new DiffOnlyOutputBuilder($header)); - - $this->assertSame($expected, $differ->diff($from, $to)); - } - - public function textForNoNonDiffLinesProvider(): array - { - return [ - [ - " #Warning: Strings contain different line endings!\n-A\r\n+B\n", - "A\r\n", - "B\n", - ], - [ - "-A\n+B\n", - "\nA", - "\nB", - ], - [ - '', - 'a', - 'a', - ], - [ - "-A\n+C\n", - "A\n\n\nB", - "C\n\n\nB", - ], - [ - "header\n", - 'a', - 'a', - 'header', - ], - [ - "header\n", - 'a', - 'a', - "header\n", - ], - ]; - } -} diff --git a/vendor/sebastian/diff/tests/Output/Integration/StrictUnifiedDiffOutputBuilderIntegrationTest.php b/vendor/sebastian/diff/tests/Output/Integration/StrictUnifiedDiffOutputBuilderIntegrationTest.php deleted file mode 100644 index d15f445..0000000 --- a/vendor/sebastian/diff/tests/Output/Integration/StrictUnifiedDiffOutputBuilderIntegrationTest.php +++ /dev/null @@ -1,299 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Diff\Output; - -use PHPUnit\Framework\TestCase; -use SebastianBergmann\Diff\Differ; -use SebastianBergmann\Diff\Utils\FileUtils; -use SebastianBergmann\Diff\Utils\UnifiedDiffAssertTrait; -use Symfony\Component\Process\Process; - -/** - * @covers SebastianBergmann\Diff\Output\StrictUnifiedDiffOutputBuilder - * - * @uses SebastianBergmann\Diff\Differ - * @uses SebastianBergmann\Diff\TimeEfficientLongestCommonSubsequenceCalculator - * - * @requires OS Linux - */ -final class StrictUnifiedDiffOutputBuilderIntegrationTest extends TestCase -{ - use UnifiedDiffAssertTrait; - - private $dir; - - private $fileFrom; - - private $fileTo; - - private $filePatch; - - protected function setUp(): void - { - $this->dir = \realpath(__DIR__ . '/../../fixtures/out') . '/'; - $this->fileFrom = $this->dir . 'from.txt'; - $this->fileTo = $this->dir . 'to.txt'; - $this->filePatch = $this->dir . 'diff.patch'; - - if (!\is_dir($this->dir)) { - throw new \RuntimeException('Integration test working directory not found.'); - } - - $this->cleanUpTempFiles(); - } - - protected function tearDown(): void - { - $this->cleanUpTempFiles(); - } - - /** - * Integration test - * - * - get a file pair - * - create a `diff` between the files - * - test applying the diff using `git apply` - * - test applying the diff using `patch` - * - * @param string $fileFrom - * @param string $fileTo - * - * @dataProvider provideFilePairs - */ - public function testIntegrationUsingPHPFileInVendorGitApply(string $fileFrom, string $fileTo): void - { - $from = FileUtils::getFileContent($fileFrom); - $to = FileUtils::getFileContent($fileTo); - - $diff = (new Differ(new StrictUnifiedDiffOutputBuilder(['fromFile' => 'Original', 'toFile' => 'New'])))->diff($from, $to); - - if ('' === $diff && $from === $to) { - // odd case: test after executing as it is more efficient than to read the files and check the contents every time - $this->addToAssertionCount(1); - - return; - } - - $this->doIntegrationTestGitApply($diff, $from, $to); - } - - /** - * Integration test - * - * - get a file pair - * - create a `diff` between the files - * - test applying the diff using `git apply` - * - test applying the diff using `patch` - * - * @param string $fileFrom - * @param string $fileTo - * - * @dataProvider provideFilePairs - */ - public function testIntegrationUsingPHPFileInVendorPatch(string $fileFrom, string $fileTo): void - { - $from = FileUtils::getFileContent($fileFrom); - $to = FileUtils::getFileContent($fileTo); - - $diff = (new Differ(new StrictUnifiedDiffOutputBuilder(['fromFile' => 'Original', 'toFile' => 'New'])))->diff($from, $to); - - if ('' === $diff && $from === $to) { - // odd case: test after executing as it is more efficient than to read the files and check the contents every time - $this->addToAssertionCount(1); - - return; - } - - $this->doIntegrationTestPatch($diff, $from, $to); - } - - /** - * @param string $expected - * @param string $from - * @param string $to - * - * @dataProvider provideOutputBuildingCases - * @dataProvider provideSample - * @dataProvider provideBasicDiffGeneration - */ - public function testIntegrationOfUnitTestCasesGitApply(string $expected, string $from, string $to): void - { - $this->doIntegrationTestGitApply($expected, $from, $to); - } - - /** - * @param string $expected - * @param string $from - * @param string $to - * - * @dataProvider provideOutputBuildingCases - * @dataProvider provideSample - * @dataProvider provideBasicDiffGeneration - */ - public function testIntegrationOfUnitTestCasesPatch(string $expected, string $from, string $to): void - { - $this->doIntegrationTestPatch($expected, $from, $to); - } - - public function provideOutputBuildingCases(): array - { - return StrictUnifiedDiffOutputBuilderDataProvider::provideOutputBuildingCases(); - } - - public function provideSample(): array - { - return StrictUnifiedDiffOutputBuilderDataProvider::provideSample(); - } - - public function provideBasicDiffGeneration(): array - { - return StrictUnifiedDiffOutputBuilderDataProvider::provideBasicDiffGeneration(); - } - - public function provideFilePairs(): array - { - $cases = []; - $fromFile = __FILE__; - $vendorDir = \realpath(__DIR__ . '/../../../vendor'); - - $fileIterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($vendorDir, \RecursiveDirectoryIterator::SKIP_DOTS)); - - /** @var \SplFileInfo $file */ - foreach ($fileIterator as $file) { - if ('php' !== $file->getExtension()) { - continue; - } - - $toFile = $file->getPathname(); - $cases[\sprintf("Diff file:\n\"%s\"\nvs.\n\"%s\"\n", \realpath($fromFile), \realpath($toFile))] = [$fromFile, $toFile]; - $fromFile = $toFile; - } - - return $cases; - } - - /** - * Compare diff create by builder and against one create by `diff` command. - * - * @param string $diff - * @param string $from - * @param string $to - * - * @dataProvider provideBasicDiffGeneration - */ - public function testIntegrationDiffOutputBuilderVersusDiffCommand(string $diff, string $from, string $to): void - { - $this->assertNotSame('', $diff); - $this->assertValidUnifiedDiffFormat($diff); - - $this->assertNotFalse(\file_put_contents($this->fileFrom, $from)); - $this->assertNotFalse(\file_put_contents($this->fileTo, $to)); - - $p = new Process(\sprintf('diff -u %s %s', \escapeshellarg($this->fileFrom), \escapeshellarg($this->fileTo))); - $p->run(); - $this->assertSame(1, $p->getExitCode()); // note: Process assumes exit code 0 for `isSuccessful`, however `diff` uses the exit code `1` for success with diff - - $output = $p->getOutput(); - - $diffLines = \preg_split('/(.*\R)/', $diff, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); - $diffLines[0] = \preg_replace('#^\-\-\- .*#', '--- /' . $this->fileFrom, $diffLines[0], 1); - $diffLines[1] = \preg_replace('#^\+\+\+ .*#', '+++ /' . $this->fileFrom, $diffLines[1], 1); - $diff = \implode('', $diffLines); - - $outputLines = \preg_split('/(.*\R)/', $output, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); - $outputLines[0] = \preg_replace('#^\-\-\- .*#', '--- /' . $this->fileFrom, $outputLines[0], 1); - $outputLines[1] = \preg_replace('#^\+\+\+ .*#', '+++ /' . $this->fileFrom, $outputLines[1], 1); - $output = \implode('', $outputLines); - - $this->assertSame($diff, $output); - } - - private function doIntegrationTestGitApply(string $diff, string $from, string $to): void - { - $this->assertNotSame('', $diff); - $this->assertValidUnifiedDiffFormat($diff); - - $diff = self::setDiffFileHeader($diff, $this->fileFrom); - - $this->assertNotFalse(\file_put_contents($this->fileFrom, $from)); - $this->assertNotFalse(\file_put_contents($this->filePatch, $diff)); - - $p = new Process(\sprintf( - 'git --git-dir %s apply --check -v --unsafe-paths --ignore-whitespace %s', - \escapeshellarg($this->dir), - \escapeshellarg($this->filePatch) - )); - - $p->run(); - - $this->assertProcessSuccessful($p); - } - - private function doIntegrationTestPatch(string $diff, string $from, string $to): void - { - $this->assertNotSame('', $diff); - $this->assertValidUnifiedDiffFormat($diff); - - $diff = self::setDiffFileHeader($diff, $this->fileFrom); - - $this->assertNotFalse(\file_put_contents($this->fileFrom, $from)); - $this->assertNotFalse(\file_put_contents($this->filePatch, $diff)); - - $command = \sprintf( - 'patch -u --verbose --posix %s < %s', - \escapeshellarg($this->fileFrom), - \escapeshellarg($this->filePatch) - ); - - $p = new Process($command); - $p->run(); - - $this->assertProcessSuccessful($p); - - $this->assertStringEqualsFile( - $this->fileFrom, - $to, - \sprintf('Patch command "%s".', $command) - ); - } - - private function assertProcessSuccessful(Process $p): void - { - $this->assertTrue( - $p->isSuccessful(), - \sprintf( - "Command exec. was not successful:\n\"%s\"\nOutput:\n\"%s\"\nStdErr:\n\"%s\"\nExit code %d.\n", - $p->getCommandLine(), - $p->getOutput(), - $p->getErrorOutput(), - $p->getExitCode() - ) - ); - } - - private function cleanUpTempFiles(): void - { - @\unlink($this->fileFrom . '.orig'); - @\unlink($this->fileFrom . '.rej'); - @\unlink($this->fileFrom); - @\unlink($this->fileTo); - @\unlink($this->filePatch); - } - - private static function setDiffFileHeader(string $diff, string $file): string - { - $diffLines = \preg_split('/(.*\R)/', $diff, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); - $diffLines[0] = \preg_replace('#^\-\-\- .*#', '--- /' . $file, $diffLines[0], 1); - $diffLines[1] = \preg_replace('#^\+\+\+ .*#', '+++ /' . $file, $diffLines[1], 1); - - return \implode('', $diffLines); - } -} diff --git a/vendor/sebastian/diff/tests/Output/Integration/UnifiedDiffOutputBuilderIntegrationTest.php b/vendor/sebastian/diff/tests/Output/Integration/UnifiedDiffOutputBuilderIntegrationTest.php deleted file mode 100644 index c3fe057..0000000 --- a/vendor/sebastian/diff/tests/Output/Integration/UnifiedDiffOutputBuilderIntegrationTest.php +++ /dev/null @@ -1,163 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Diff\Output; - -use PHPUnit\Framework\TestCase; -use SebastianBergmann\Diff\Utils\UnifiedDiffAssertTrait; -use Symfony\Component\Process\Process; - -/** - * @covers SebastianBergmann\Diff\Output\UnifiedDiffOutputBuilder - * - * @uses SebastianBergmann\Diff\Differ - * @uses SebastianBergmann\Diff\TimeEfficientLongestCommonSubsequenceCalculator - * - * @requires OS Linux - */ -final class UnifiedDiffOutputBuilderIntegrationTest extends TestCase -{ - use UnifiedDiffAssertTrait; - - private $dir; - - private $fileFrom; - - private $filePatch; - - protected function setUp(): void - { - $this->dir = \realpath(__DIR__ . '/../../fixtures/out/') . '/'; - $this->fileFrom = $this->dir . 'from.txt'; - $this->filePatch = $this->dir . 'patch.txt'; - - $this->cleanUpTempFiles(); - } - - protected function tearDown(): void - { - $this->cleanUpTempFiles(); - } - - /** - * @dataProvider provideDiffWithLineNumbers - * - * @param mixed $expected - * @param mixed $from - * @param mixed $to - */ - public function testDiffWithLineNumbersPath($expected, $from, $to): void - { - $this->doIntegrationTestPatch($expected, $from, $to); - } - - /** - * @dataProvider provideDiffWithLineNumbers - * - * @param mixed $expected - * @param mixed $from - * @param mixed $to - */ - public function testDiffWithLineNumbersGitApply($expected, $from, $to): void - { - $this->doIntegrationTestGitApply($expected, $from, $to); - } - - public function provideDiffWithLineNumbers() - { - return \array_filter( - UnifiedDiffOutputBuilderDataProvider::provideDiffWithLineNumbers(), - static function ($key) { - return !\is_string($key) || false === \strpos($key, 'non_patch_compat'); - }, - ARRAY_FILTER_USE_KEY - ); - } - - private function doIntegrationTestPatch(string $diff, string $from, string $to): void - { - $this->assertNotSame('', $diff); - $this->assertValidUnifiedDiffFormat($diff); - - $diff = self::setDiffFileHeader($diff, $this->fileFrom); - - $this->assertNotFalse(\file_put_contents($this->fileFrom, $from)); - $this->assertNotFalse(\file_put_contents($this->filePatch, $diff)); - - $command = \sprintf( - 'patch -u --verbose --posix %s < %s', // --posix - \escapeshellarg($this->fileFrom), - \escapeshellarg($this->filePatch) - ); - - $p = new Process($command); - $p->run(); - - $this->assertProcessSuccessful($p); - - $this->assertStringEqualsFile( - $this->fileFrom, - $to, - \sprintf('Patch command "%s".', $command) - ); - } - - private function doIntegrationTestGitApply(string $diff, string $from, string $to): void - { - $this->assertNotSame('', $diff); - $this->assertValidUnifiedDiffFormat($diff); - - $diff = self::setDiffFileHeader($diff, $this->fileFrom); - - $this->assertNotFalse(\file_put_contents($this->fileFrom, $from)); - $this->assertNotFalse(\file_put_contents($this->filePatch, $diff)); - - $command = \sprintf( - 'git --git-dir %s apply --check -v --unsafe-paths --ignore-whitespace %s', - \escapeshellarg($this->dir), - \escapeshellarg($this->filePatch) - ); - - $p = new Process($command); - $p->run(); - - $this->assertProcessSuccessful($p); - } - - private function assertProcessSuccessful(Process $p): void - { - $this->assertTrue( - $p->isSuccessful(), - \sprintf( - "Command exec. was not successful:\n\"%s\"\nOutput:\n\"%s\"\nStdErr:\n\"%s\"\nExit code %d.\n", - $p->getCommandLine(), - $p->getOutput(), - $p->getErrorOutput(), - $p->getExitCode() - ) - ); - } - - private function cleanUpTempFiles(): void - { - @\unlink($this->fileFrom . '.orig'); - @\unlink($this->fileFrom); - @\unlink($this->filePatch); - } - - private static function setDiffFileHeader(string $diff, string $file): string - { - $diffLines = \preg_split('/(.*\R)/', $diff, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); - $diffLines[0] = \preg_replace('#^\-\-\- .*#', '--- /' . $file, $diffLines[0], 1); - $diffLines[1] = \preg_replace('#^\+\+\+ .*#', '+++ /' . $file, $diffLines[1], 1); - - return \implode('', $diffLines); - } -} diff --git a/vendor/sebastian/diff/tests/Output/StrictUnifiedDiffOutputBuilderDataProvider.php b/vendor/sebastian/diff/tests/Output/StrictUnifiedDiffOutputBuilderDataProvider.php deleted file mode 100644 index 56d3a1e..0000000 --- a/vendor/sebastian/diff/tests/Output/StrictUnifiedDiffOutputBuilderDataProvider.php +++ /dev/null @@ -1,189 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Diff\Output; - -final class StrictUnifiedDiffOutputBuilderDataProvider -{ - public static function provideOutputBuildingCases(): array - { - return [ - [ -'--- input.txt -+++ output.txt -@@ -1,3 +1,4 @@ -+b - ' . ' - ' . ' - ' . ' -@@ -16,5 +17,4 @@ - ' . ' - ' . ' - ' . ' -- --B -+A -', - "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nB\n", - "b\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nA\n", - [ - 'fromFile' => 'input.txt', - 'toFile' => 'output.txt', - ], - ], - [ -'--- ' . __FILE__ . "\t2017-10-02 17:38:11.586413675 +0100 -+++ output1.txt\t2017-10-03 12:09:43.086719482 +0100 -@@ -1,1 +1,1 @@ --B -+X -", - "B\n", - "X\n", - [ - 'fromFile' => __FILE__, - 'fromFileDate' => '2017-10-02 17:38:11.586413675 +0100', - 'toFile' => 'output1.txt', - 'toFileDate' => '2017-10-03 12:09:43.086719482 +0100', - 'collapseRanges' => false, - ], - ], - [ -'--- input.txt -+++ output.txt -@@ -1 +1 @@ --B -+X -', - "B\n", - "X\n", - [ - 'fromFile' => 'input.txt', - 'toFile' => 'output.txt', - 'collapseRanges' => true, - ], - ], - ]; - } - - public static function provideSample(): array - { - return [ - [ -'--- input.txt -+++ output.txt -@@ -1,6 +1,6 @@ - 1 - 2 - 3 --4 -+X - 5 - 6 -', - "1\n2\n3\n4\n5\n6\n", - "1\n2\n3\nX\n5\n6\n", - [ - 'fromFile' => 'input.txt', - 'toFile' => 'output.txt', - ], - ], - ]; - } - - public static function provideBasicDiffGeneration(): array - { - return [ - [ -"--- input.txt -+++ output.txt -@@ -1,2 +1 @@ --A --B -+A\rB -", - "A\nB\n", - "A\rB\n", - ], - [ -"--- input.txt -+++ output.txt -@@ -1 +1 @@ -- -+\r -\\ No newline at end of file -", - "\n", - "\r", - ], - [ -"--- input.txt -+++ output.txt -@@ -1 +1 @@ --\r -\\ No newline at end of file -+ -", - "\r", - "\n", - ], - [ -'--- input.txt -+++ output.txt -@@ -1,3 +1,3 @@ - X - A --A -+B -', - "X\nA\nA\n", - "X\nA\nB\n", - ], - [ -'--- input.txt -+++ output.txt -@@ -1,3 +1,3 @@ - X - A --A -\ No newline at end of file -+B -', - "X\nA\nA", - "X\nA\nB\n", - ], - [ -'--- input.txt -+++ output.txt -@@ -1,3 +1,3 @@ - A - A --A -+B -\ No newline at end of file -', - "A\nA\nA\n", - "A\nA\nB", - ], - [ -'--- input.txt -+++ output.txt -@@ -1 +1 @@ --A -\ No newline at end of file -+B -\ No newline at end of file -', - 'A', - 'B', - ], - ]; - } -} diff --git a/vendor/sebastian/diff/tests/Output/StrictUnifiedDiffOutputBuilderTest.php b/vendor/sebastian/diff/tests/Output/StrictUnifiedDiffOutputBuilderTest.php deleted file mode 100644 index 64cb25b..0000000 --- a/vendor/sebastian/diff/tests/Output/StrictUnifiedDiffOutputBuilderTest.php +++ /dev/null @@ -1,684 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Diff\Output; - -use PHPUnit\Framework\TestCase; -use SebastianBergmann\Diff\ConfigurationException; -use SebastianBergmann\Diff\Differ; -use SebastianBergmann\Diff\Utils\UnifiedDiffAssertTrait; - -/** - * @covers SebastianBergmann\Diff\Output\StrictUnifiedDiffOutputBuilder - * - * @uses SebastianBergmann\Diff\Differ - */ -final class StrictUnifiedDiffOutputBuilderTest extends TestCase -{ - use UnifiedDiffAssertTrait; - - /** - * @param string $expected - * @param string $from - * @param string $to - * @param array $options - * - * @dataProvider provideOutputBuildingCases - */ - public function testOutputBuilding(string $expected, string $from, string $to, array $options): void - { - $diff = $this->getDiffer($options)->diff($from, $to); - - $this->assertValidDiffFormat($diff); - $this->assertSame($expected, $diff); - } - - /** - * @param string $expected - * @param string $from - * @param string $to - * @param array $options - * - * @dataProvider provideSample - */ - public function testSample(string $expected, string $from, string $to, array $options): void - { - $diff = $this->getDiffer($options)->diff($from, $to); - - $this->assertValidDiffFormat($diff); - $this->assertSame($expected, $diff); - } - - /** - * {@inheritdoc} - */ - public function assertValidDiffFormat(string $diff): void - { - $this->assertValidUnifiedDiffFormat($diff); - } - - /** - * {@inheritdoc} - */ - public function provideOutputBuildingCases(): array - { - return StrictUnifiedDiffOutputBuilderDataProvider::provideOutputBuildingCases(); - } - - /** - * {@inheritdoc} - */ - public function provideSample(): array - { - return StrictUnifiedDiffOutputBuilderDataProvider::provideSample(); - } - - /** - * @param string $expected - * @param string $from - * @param string $to - * - * @dataProvider provideBasicDiffGeneration - */ - public function testBasicDiffGeneration(string $expected, string $from, string $to): void - { - $diff = $this->getDiffer([ - 'fromFile' => 'input.txt', - 'toFile' => 'output.txt', - ])->diff($from, $to); - - $this->assertValidDiffFormat($diff); - $this->assertSame($expected, $diff); - } - - public function provideBasicDiffGeneration(): array - { - return StrictUnifiedDiffOutputBuilderDataProvider::provideBasicDiffGeneration(); - } - - /** - * @param string $expected - * @param string $from - * @param string $to - * @param array $config - * - * @dataProvider provideConfiguredDiffGeneration - */ - public function testConfiguredDiffGeneration(string $expected, string $from, string $to, array $config = []): void - { - $diff = $this->getDiffer(\array_merge([ - 'fromFile' => 'input.txt', - 'toFile' => 'output.txt', - ], $config))->diff($from, $to); - - $this->assertValidDiffFormat($diff); - $this->assertSame($expected, $diff); - } - - public function provideConfiguredDiffGeneration(): array - { - return [ - [ - '--- input.txt -+++ output.txt -@@ -1 +1 @@ --a -\ No newline at end of file -+b -\ No newline at end of file -', - 'a', - 'b', - ], - [ - '', - "1\n2", - "1\n2", - ], - [ - '', - "1\n", - "1\n", - ], - [ -'--- input.txt -+++ output.txt -@@ -4 +4 @@ --X -+4 -', - "1\n2\n3\nX\n5\n6\n7\n8\n9\n0\n", - "1\n2\n3\n4\n5\n6\n7\n8\n9\n0\n", - [ - 'contextLines' => 0, - ], - ], - [ -'--- input.txt -+++ output.txt -@@ -3,3 +3,3 @@ - 3 --X -+4 - 5 -', - "1\n2\n3\nX\n5\n6\n7\n8\n9\n0\n", - "1\n2\n3\n4\n5\n6\n7\n8\n9\n0\n", - [ - 'contextLines' => 1, - ], - ], - [ -'--- input.txt -+++ output.txt -@@ -1,10 +1,10 @@ - 1 - 2 - 3 --X -+4 - 5 - 6 - 7 - 8 - 9 - 0 -', - "1\n2\n3\nX\n5\n6\n7\n8\n9\n0\n", - "1\n2\n3\n4\n5\n6\n7\n8\n9\n0\n", - [ - 'contextLines' => 999, - ], - ], - [ -'--- input.txt -+++ output.txt -@@ -1,0 +1,2 @@ -+ -+A -', - '', - "\nA\n", - ], - [ -'--- input.txt -+++ output.txt -@@ -1,2 +1,0 @@ -- --A -', - "\nA\n", - '', - ], - [ - '--- input.txt -+++ output.txt -@@ -1,5 +1,5 @@ - 1 --X -+2 - 3 --Y -+4 - 5 -@@ -8,3 +8,3 @@ - 8 --X -+9 - 0 -', - "1\nX\n3\nY\n5\n6\n7\n8\nX\n0\n", - "1\n2\n3\n4\n5\n6\n7\n8\n9\n0\n", - [ - 'commonLineThreshold' => 2, - 'contextLines' => 1, - ], - ], - [ - '--- input.txt -+++ output.txt -@@ -2 +2 @@ --X -+2 -@@ -4 +4 @@ --Y -+4 -@@ -9 +9 @@ --X -+9 -', - "1\nX\n3\nY\n5\n6\n7\n8\nX\n0\n", - "1\n2\n3\n4\n5\n6\n7\n8\n9\n0\n", - [ - 'commonLineThreshold' => 1, - 'contextLines' => 0, - ], - ], - ]; - } - - public function testReUseBuilder(): void - { - $differ = $this->getDiffer([ - 'fromFile' => 'input.txt', - 'toFile' => 'output.txt', - ]); - - $diff = $differ->diff("A\nB\n", "A\nX\n"); - $this->assertSame( -'--- input.txt -+++ output.txt -@@ -1,2 +1,2 @@ - A --B -+X -', - $diff - ); - - $diff = $differ->diff("A\n", "A\n"); - $this->assertSame( - '', - $diff - ); - } - - public function testEmptyDiff(): void - { - $builder = new StrictUnifiedDiffOutputBuilder([ - 'fromFile' => 'input.txt', - 'toFile' => 'output.txt', - ]); - - $this->assertSame( - '', - $builder->getDiff([]) - ); - } - - /** - * @param array $options - * @param string $message - * - * @dataProvider provideInvalidConfiguration - */ - public function testInvalidConfiguration(array $options, string $message): void - { - $this->expectException(ConfigurationException::class); - $this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote($message, '#'))); - - new StrictUnifiedDiffOutputBuilder($options); - } - - public function provideInvalidConfiguration(): array - { - $time = \time(); - - return [ - [ - ['collapseRanges' => 1], - 'Option "collapseRanges" must be a bool, got "integer#1".', - ], - [ - ['contextLines' => 'a'], - 'Option "contextLines" must be an int >= 0, got "string#a".', - ], - [ - ['commonLineThreshold' => -2], - 'Option "commonLineThreshold" must be an int > 0, got "integer#-2".', - ], - [ - ['commonLineThreshold' => 0], - 'Option "commonLineThreshold" must be an int > 0, got "integer#0".', - ], - [ - ['fromFile' => new \SplFileInfo(__FILE__)], - 'Option "fromFile" must be a string, got "SplFileInfo".', - ], - [ - ['fromFile' => null], - 'Option "fromFile" must be a string, got "".', - ], - [ - [ - 'fromFile' => __FILE__, - 'toFile' => 1, - ], - 'Option "toFile" must be a string, got "integer#1".', - ], - [ - [ - 'fromFile' => __FILE__, - 'toFile' => __FILE__, - 'toFileDate' => $time, - ], - 'Option "toFileDate" must be a string or , got "integer#' . $time . '".', - ], - [ - [], - 'Option "fromFile" must be a string, got "".', - ], - ]; - } - - /** - * @param string $expected - * @param string $from - * @param string $to - * @param int $threshold - * - * @dataProvider provideCommonLineThresholdCases - */ - public function testCommonLineThreshold(string $expected, string $from, string $to, int $threshold): void - { - $diff = $this->getDiffer([ - 'fromFile' => 'input.txt', - 'toFile' => 'output.txt', - 'commonLineThreshold' => $threshold, - 'contextLines' => 0, - ])->diff($from, $to); - - $this->assertValidDiffFormat($diff); - $this->assertSame($expected, $diff); - } - - public function provideCommonLineThresholdCases(): array - { - return [ - [ -'--- input.txt -+++ output.txt -@@ -2,3 +2,3 @@ --X -+B - C12 --Y -+D -@@ -7 +7 @@ --X -+Z -', - "A\nX\nC12\nY\nA\nA\nX\n", - "A\nB\nC12\nD\nA\nA\nZ\n", - 2, - ], - [ -'--- input.txt -+++ output.txt -@@ -2 +2 @@ --X -+B -@@ -4 +4 @@ --Y -+D -', - "A\nX\nV\nY\n", - "A\nB\nV\nD\n", - 1, - ], - ]; - } - - /** - * @param string $expected - * @param string $from - * @param string $to - * @param int $contextLines - * @param int $commonLineThreshold - * - * @dataProvider provideContextLineConfigurationCases - */ - public function testContextLineConfiguration(string $expected, string $from, string $to, int $contextLines, int $commonLineThreshold = 6): void - { - $diff = $this->getDiffer([ - 'fromFile' => 'input.txt', - 'toFile' => 'output.txt', - 'contextLines' => $contextLines, - 'commonLineThreshold' => $commonLineThreshold, - ])->diff($from, $to); - - $this->assertValidDiffFormat($diff); - $this->assertSame($expected, $diff); - } - - public function provideContextLineConfigurationCases(): array - { - $from = "A\nB\nC\nD\nE\nF\nX\nG\nH\nI\nJ\nK\nL\nM\n"; - $to = "A\nB\nC\nD\nE\nF\nY\nG\nH\nI\nJ\nK\nL\nM\n"; - - return [ - 'EOF 0' => [ - "--- input.txt\n+++ output.txt\n@@ -3 +3 @@ --X -\\ No newline at end of file -+Y -\\ No newline at end of file -", - "A\nB\nX", - "A\nB\nY", - 0, - ], - 'EOF 1' => [ - "--- input.txt\n+++ output.txt\n@@ -2,2 +2,2 @@ - B --X -\\ No newline at end of file -+Y -\\ No newline at end of file -", - "A\nB\nX", - "A\nB\nY", - 1, -], - 'EOF 2' => [ - "--- input.txt\n+++ output.txt\n@@ -1,3 +1,3 @@ - A - B --X -\\ No newline at end of file -+Y -\\ No newline at end of file -", - "A\nB\nX", - "A\nB\nY", - 2, - ], - 'EOF 200' => [ - "--- input.txt\n+++ output.txt\n@@ -1,3 +1,3 @@ - A - B --X -\\ No newline at end of file -+Y -\\ No newline at end of file -", - "A\nB\nX", - "A\nB\nY", - 200, - ], - 'n/a 0' => [ - "--- input.txt\n+++ output.txt\n@@ -7 +7 @@\n-X\n+Y\n", - $from, - $to, - 0, - ], - 'G' => [ - "--- input.txt\n+++ output.txt\n@@ -6,3 +6,3 @@\n F\n-X\n+Y\n G\n", - $from, - $to, - 1, - ], - 'H' => [ - "--- input.txt\n+++ output.txt\n@@ -5,5 +5,5 @@\n E\n F\n-X\n+Y\n G\n H\n", - $from, - $to, - 2, - ], - 'I' => [ - "--- input.txt\n+++ output.txt\n@@ -4,7 +4,7 @@\n D\n E\n F\n-X\n+Y\n G\n H\n I\n", - $from, - $to, - 3, - ], - 'J' => [ - "--- input.txt\n+++ output.txt\n@@ -3,9 +3,9 @@\n C\n D\n E\n F\n-X\n+Y\n G\n H\n I\n J\n", - $from, - $to, - 4, - ], - 'K' => [ - "--- input.txt\n+++ output.txt\n@@ -2,11 +2,11 @@\n B\n C\n D\n E\n F\n-X\n+Y\n G\n H\n I\n J\n K\n", - $from, - $to, - 5, - ], - 'L' => [ - "--- input.txt\n+++ output.txt\n@@ -1,13 +1,13 @@\n A\n B\n C\n D\n E\n F\n-X\n+Y\n G\n H\n I\n J\n K\n L\n", - $from, - $to, - 6, - ], - 'M' => [ - "--- input.txt\n+++ output.txt\n@@ -1,14 +1,14 @@\n A\n B\n C\n D\n E\n F\n-X\n+Y\n G\n H\n I\n J\n K\n L\n M\n", - $from, - $to, - 7, - ], - 'M no linebreak EOF .1' => [ - "--- input.txt\n+++ output.txt\n@@ -1,14 +1,14 @@\n A\n B\n C\n D\n E\n F\n-X\n+Y\n G\n H\n I\n J\n K\n L\n-M\n+M\n\\ No newline at end of file\n", - $from, - \substr($to, 0, -1), - 7, - ], - 'M no linebreak EOF .2' => [ - "--- input.txt\n+++ output.txt\n@@ -1,14 +1,14 @@\n A\n B\n C\n D\n E\n F\n-X\n+Y\n G\n H\n I\n J\n K\n L\n-M\n\\ No newline at end of file\n+M\n", - \substr($from, 0, -1), - $to, - 7, - ], - 'M no linebreak EOF .3' => [ - "--- input.txt\n+++ output.txt\n@@ -1,14 +1,14 @@\n A\n B\n C\n D\n E\n F\n-X\n+Y\n G\n H\n I\n J\n K\n L\n M\n", - \substr($from, 0, -1), - \substr($to, 0, -1), - 7, - ], - 'M no linebreak EOF .4' => [ - "--- input.txt\n+++ output.txt\n@@ -1,14 +1,14 @@\n A\n B\n C\n D\n E\n F\n-X\n+Y\n G\n H\n I\n J\n K\n L\n M\n\\ No newline at end of file\n", - \substr($from, 0, -1), - \substr($to, 0, -1), - 10000, - 10000, - ], - 'M+1' => [ - "--- input.txt\n+++ output.txt\n@@ -1,14 +1,14 @@\n A\n B\n C\n D\n E\n F\n-X\n+Y\n G\n H\n I\n J\n K\n L\n M\n", - $from, - $to, - 8, - ], - 'M+100' => [ - "--- input.txt\n+++ output.txt\n@@ -1,14 +1,14 @@\n A\n B\n C\n D\n E\n F\n-X\n+Y\n G\n H\n I\n J\n K\n L\n M\n", - $from, - $to, - 107, - ], - '0 II' => [ - "--- input.txt\n+++ output.txt\n@@ -12 +12 @@\n-X\n+Y\n", - "A\nB\nC\nD\nE\nF\nG\nH\nI\nJ\nK\nX\nM\n", - "A\nB\nC\nD\nE\nF\nG\nH\nI\nJ\nK\nY\nM\n", - 0, - 999, - ], - '0\' II' => [ - "--- input.txt\n+++ output.txt\n@@ -12 +12 @@\n-X\n+Y\n", - "A\nB\nC\nD\nE\nF\nG\nH\nI\nJ\nK\nX\nM\nA\nA\nA\nA\nA\n", - "A\nB\nC\nD\nE\nF\nG\nH\nI\nJ\nK\nY\nM\nA\nA\nA\nA\nA\n", - 0, - 999, - ], - '0\'\' II' => [ - "--- input.txt\n+++ output.txt\n@@ -12,2 +12,2 @@\n-X\n-M\n\\ No newline at end of file\n+Y\n+M\n", - "A\nB\nC\nD\nE\nF\nG\nH\nI\nJ\nK\nX\nM", - "A\nB\nC\nD\nE\nF\nG\nH\nI\nJ\nK\nY\nM\n", - 0, - ], - '0\'\'\' II' => [ - "--- input.txt\n+++ output.txt\n@@ -12,2 +12,2 @@\n-X\n-X1\n+Y\n+Y2\n", - "A\nB\nC\nD\nE\nF\nG\nH\nI\nJ\nK\nX\nX1\nM\nA\nA\nA\nA\nA\n", - "A\nB\nC\nD\nE\nF\nG\nH\nI\nJ\nK\nY\nY2\nM\nA\nA\nA\nA\nA\n", - 0, - 999, - ], - '1 II' => [ - "--- input.txt\n+++ output.txt\n@@ -11,3 +11,3 @@\n K\n-X\n+Y\n M\n", - "A\nB\nC\nD\nE\nF\nG\nH\nI\nJ\nK\nX\nM\n", - "A\nB\nC\nD\nE\nF\nG\nH\nI\nJ\nK\nY\nM\n", - 1, - ], - '5 II' => [ - "--- input.txt\n+++ output.txt\n@@ -7,7 +7,7 @@\n G\n H\n I\n J\n K\n-X\n+Y\n M\n", - "A\nB\nC\nD\nE\nF\nG\nH\nI\nJ\nK\nX\nM\n", - "A\nB\nC\nD\nE\nF\nG\nH\nI\nJ\nK\nY\nM\n", - 5, - ], - [ - '--- input.txt -+++ output.txt -@@ -1,28 +1,28 @@ - A --X -+B - V --Y -+D - 1 - A - 2 - A - 3 - A - 4 - A - 8 - A - 9 - A - 5 - A - A - A - A - A - A - A - A - A - A - A -', - "A\nX\nV\nY\n1\nA\n2\nA\n3\nA\n4\nA\n8\nA\n9\nA\n5\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n", - "A\nB\nV\nD\n1\nA\n2\nA\n3\nA\n4\nA\n8\nA\n9\nA\n5\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n", - 9999, - 99999, - ], - ]; - } - - /** - * Returns a new instance of a Differ with a new instance of the class (DiffOutputBuilderInterface) under test. - * - * @param array $options - * - * @return Differ - */ - private function getDiffer(array $options = []): Differ - { - return new Differ(new StrictUnifiedDiffOutputBuilder($options)); - } -} diff --git a/vendor/sebastian/diff/tests/Output/UnifiedDiffOutputBuilderDataProvider.php b/vendor/sebastian/diff/tests/Output/UnifiedDiffOutputBuilderDataProvider.php deleted file mode 100644 index 391a9b1..0000000 --- a/vendor/sebastian/diff/tests/Output/UnifiedDiffOutputBuilderDataProvider.php +++ /dev/null @@ -1,396 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Diff\Output; - -final class UnifiedDiffOutputBuilderDataProvider -{ - public static function provideDiffWithLineNumbers(): array - { - return [ - 'diff line 1 non_patch_compat' => [ -'--- Original -+++ New -@@ -1 +1 @@ --AA -+BA -', - 'AA', - 'BA', - ], - 'diff line +1 non_patch_compat' => [ -'--- Original -+++ New -@@ -1 +1,2 @@ --AZ -+ -+B -', - 'AZ', - "\nB", - ], - 'diff line -1 non_patch_compat' => [ -'--- Original -+++ New -@@ -1,2 +1 @@ -- --AF -+B -', - "\nAF", - 'B', - ], - 'II non_patch_compat' => [ -'--- Original -+++ New -@@ -1,4 +1,2 @@ -- -- - A - 1 -', - "\n\nA\n1", - "A\n1", - ], - 'diff last line II - no trailing linebreak non_patch_compat' => [ -'--- Original -+++ New -@@ -5,4 +5,4 @@ - ' . ' - ' . ' - ' . ' --E -+B -', - "A\n\n\n\n\n\n\nE", - "A\n\n\n\n\n\n\nB", - ], - [ - "--- Original\n+++ New\n@@ -1,2 +1 @@\n \n-\n", - "\n\n", - "\n", - ], - 'diff line endings non_patch_compat' => [ - "--- Original\n+++ New\n@@ -1 +1 @@\n #Warning: Strings contain different line endings!\n- [ -'--- Original -+++ New -', - "AT\n", - "AT\n", - ], - [ -'--- Original -+++ New -@@ -1,4 +1,4 @@ --b -+a - ' . ' - ' . ' - ' . ' -', - "b\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", - "a\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", - ], - 'diff line @1' => [ -'--- Original -+++ New -@@ -1,2 +1,2 @@ - ' . ' --AG -+B -', - "\nAG\n", - "\nB\n", - ], - 'same multiple lines' => [ -'--- Original -+++ New -@@ -1,4 +1,4 @@ - ' . ' - ' . ' --V -+B - C213 -', - "\n\nV\nC213", - "\n\nB\nC213", - ], - 'diff last line I' => [ -'--- Original -+++ New -@@ -5,4 +5,4 @@ - ' . ' - ' . ' - ' . ' --E -+B -', - "A\n\n\n\n\n\n\nE\n", - "A\n\n\n\n\n\n\nB\n", - ], - 'diff line middle' => [ -'--- Original -+++ New -@@ -5,7 +5,7 @@ - ' . ' - ' . ' - ' . ' --X -+Z - ' . ' - ' . ' - ' . ' -', - "A\n\n\n\n\n\n\nX\n\n\n\n\n\n\nAY", - "A\n\n\n\n\n\n\nZ\n\n\n\n\n\n\nAY", - ], - 'diff last line III' => [ -'--- Original -+++ New -@@ -12,4 +12,4 @@ - ' . ' - ' . ' - ' . ' --A -+B -', - "A\n\n\n\n\n\n\nA\n\n\n\n\n\n\nA\n", - "A\n\n\n\n\n\n\nA\n\n\n\n\n\n\nB\n", - ], - [ -'--- Original -+++ New -@@ -1,8 +1,8 @@ - A --B -+B1 - D - E - EE - F --G -+G1 - H -', - "A\nB\nD\nE\nEE\nF\nG\nH", - "A\nB1\nD\nE\nEE\nF\nG1\nH", - ], - [ -'--- Original -+++ New -@@ -1,4 +1,5 @@ - Z -+ - a - b - c -@@ -7,5 +8,5 @@ - f - g - h --i -+x - j -', -'Z -a -b -c -d -e -f -g -h -i -j -', -'Z - -a -b -c -d -e -f -g -h -x -j -', - ], - [ -'--- Original -+++ New -@@ -1,7 +1,5 @@ -- --a -+b - A --X -- -+Y - ' . ' - A -', - "\na\nA\nX\n\n\nA\n", - "b\nA\nY\n\nA\n", - ], - [ -<< - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Diff\Output; - -use PHPUnit\Framework\TestCase; -use SebastianBergmann\Diff\Differ; - -/** - * @covers SebastianBergmann\Diff\Output\UnifiedDiffOutputBuilder - * - * @uses SebastianBergmann\Diff\Differ - * @uses SebastianBergmann\Diff\Output\AbstractChunkOutputBuilder - * @uses SebastianBergmann\Diff\TimeEfficientLongestCommonSubsequenceCalculator - */ -final class UnifiedDiffOutputBuilderTest extends TestCase -{ - /** - * @param string $expected - * @param string $from - * @param string $to - * @param string $header - * - * @dataProvider headerProvider - */ - public function testCustomHeaderCanBeUsed(string $expected, string $from, string $to, string $header): void - { - $differ = new Differ(new UnifiedDiffOutputBuilder($header)); - - $this->assertSame( - $expected, - $differ->diff($from, $to) - ); - } - - public function headerProvider(): array - { - return [ - [ - "CUSTOM HEADER\n@@ @@\n-a\n+b\n", - 'a', - 'b', - 'CUSTOM HEADER', - ], - [ - "CUSTOM HEADER\n@@ @@\n-a\n+b\n", - 'a', - 'b', - "CUSTOM HEADER\n", - ], - [ - "CUSTOM HEADER\n\n@@ @@\n-a\n+b\n", - 'a', - 'b', - "CUSTOM HEADER\n\n", - ], - [ - "@@ @@\n-a\n+b\n", - 'a', - 'b', - '', - ], - ]; - } - - /** - * @param string $expected - * @param string $from - * @param string $to - * - * @dataProvider provideDiffWithLineNumbers - */ - public function testDiffWithLineNumbers($expected, $from, $to): void - { - $differ = new Differ(new UnifiedDiffOutputBuilder("--- Original\n+++ New\n", true)); - $this->assertSame($expected, $differ->diff($from, $to)); - } - - public function provideDiffWithLineNumbers(): array - { - return UnifiedDiffOutputBuilderDataProvider::provideDiffWithLineNumbers(); - } -} diff --git a/vendor/sebastian/diff/tests/ParserTest.php b/vendor/sebastian/diff/tests/ParserTest.php deleted file mode 100644 index 69bf464..0000000 --- a/vendor/sebastian/diff/tests/ParserTest.php +++ /dev/null @@ -1,170 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Diff; - -use PHPUnit\Framework\TestCase; -use SebastianBergmann\Diff\Utils\FileUtils; - -/** - * @covers SebastianBergmann\Diff\Parser - * - * @uses SebastianBergmann\Diff\Chunk - * @uses SebastianBergmann\Diff\Diff - * @uses SebastianBergmann\Diff\Line - */ -final class ParserTest extends TestCase -{ - /** - * @var Parser - */ - private $parser; - - protected function setUp(): void - { - $this->parser = new Parser; - } - - public function testParse(): void - { - $content = FileUtils::getFileContent(__DIR__ . '/fixtures/patch.txt'); - - $diffs = $this->parser->parse($content); - - $this->assertContainsOnlyInstancesOf(Diff::class, $diffs); - $this->assertCount(1, $diffs); - - $chunks = $diffs[0]->getChunks(); - $this->assertContainsOnlyInstancesOf(Chunk::class, $chunks); - - $this->assertCount(1, $chunks); - - $this->assertSame(20, $chunks[0]->getStart()); - - $this->assertCount(4, $chunks[0]->getLines()); - } - - public function testParseWithMultipleChunks(): void - { - $content = FileUtils::getFileContent(__DIR__ . '/fixtures/patch2.txt'); - - $diffs = $this->parser->parse($content); - - $this->assertCount(1, $diffs); - - $chunks = $diffs[0]->getChunks(); - $this->assertCount(3, $chunks); - - $this->assertSame(20, $chunks[0]->getStart()); - $this->assertSame(320, $chunks[1]->getStart()); - $this->assertSame(600, $chunks[2]->getStart()); - - $this->assertCount(5, $chunks[0]->getLines()); - $this->assertCount(5, $chunks[1]->getLines()); - $this->assertCount(4, $chunks[2]->getLines()); - } - - public function testParseWithRemovedLines(): void - { - $content = <<parser->parse($content); - $this->assertContainsOnlyInstancesOf(Diff::class, $diffs); - $this->assertCount(1, $diffs); - - $chunks = $diffs[0]->getChunks(); - - $this->assertContainsOnlyInstancesOf(Chunk::class, $chunks); - $this->assertCount(1, $chunks); - - $chunk = $chunks[0]; - $this->assertSame(49, $chunk->getStart()); - $this->assertSame(49, $chunk->getEnd()); - $this->assertSame(9, $chunk->getStartRange()); - $this->assertSame(8, $chunk->getEndRange()); - - $lines = $chunk->getLines(); - $this->assertContainsOnlyInstancesOf(Line::class, $lines); - $this->assertCount(2, $lines); - - /** @var Line $line */ - $line = $lines[0]; - $this->assertSame('A', $line->getContent()); - $this->assertSame(Line::UNCHANGED, $line->getType()); - - $line = $lines[1]; - $this->assertSame('B', $line->getContent()); - $this->assertSame(Line::REMOVED, $line->getType()); - } - - public function testParseDiffForMulitpleFiles(): void - { - $content = <<parser->parse($content); - $this->assertCount(2, $diffs); - - /** @var Diff $diff */ - $diff = $diffs[0]; - $this->assertSame('a/Test.txt', $diff->getFrom()); - $this->assertSame('b/Test.txt', $diff->getTo()); - $this->assertCount(1, $diff->getChunks()); - - $diff = $diffs[1]; - $this->assertSame('a/Test2.txt', $diff->getFrom()); - $this->assertSame('b/Test2.txt', $diff->getTo()); - $this->assertCount(1, $diff->getChunks()); - } - - /** - * @param string $diff - * @param Diff[] $expected - * - * @dataProvider diffProvider - */ - public function testParser(string $diff, array $expected): void - { - $result = $this->parser->parse($diff); - - $this->assertEquals($expected, $result); - } - - public function diffProvider(): array - { - return [ - [ - "--- old.txt 2014-11-04 08:51:02.661868729 +0300\n+++ new.txt 2014-11-04 08:51:02.665868730 +0300\n@@ -1,3 +1,4 @@\n+2222111\n 1111111\n 1111111\n 1111111\n@@ -5,10 +6,8 @@\n 1111111\n 1111111\n 1111111\n +1121211\n 1111111\n -1111111\n -1111111\n -2222222\n 2222222\n 2222222\n 2222222\n@@ -17,5 +16,6 @@\n 2222222\n 2222222\n 2222222\n +2122212\n 2222222\n 2222222\n", - \unserialize(FileUtils::getFileContent(__DIR__ . '/fixtures/serialized_diff.bin')), - ], - ]; - } -} diff --git a/vendor/sebastian/diff/tests/TimeEfficientImplementationTest.php b/vendor/sebastian/diff/tests/TimeEfficientImplementationTest.php deleted file mode 100644 index 2bb683d..0000000 --- a/vendor/sebastian/diff/tests/TimeEfficientImplementationTest.php +++ /dev/null @@ -1,22 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Diff; - -/** - * @covers SebastianBergmann\Diff\TimeEfficientLongestCommonSubsequenceCalculator - */ -final class TimeEfficientImplementationTest extends LongestCommonSubsequenceTest -{ - protected function createImplementation(): LongestCommonSubsequenceCalculator - { - return new TimeEfficientLongestCommonSubsequenceCalculator; - } -} diff --git a/vendor/sebastian/diff/tests/Utils/FileUtils.php b/vendor/sebastian/diff/tests/Utils/FileUtils.php deleted file mode 100644 index 36e76fa..0000000 --- a/vendor/sebastian/diff/tests/Utils/FileUtils.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Diff\Utils; - -final class FileUtils -{ - public static function getFileContent(string $file): string - { - $content = @\file_get_contents($file); - - if (false === $content) { - $error = \error_get_last(); - - throw new \RuntimeException(\sprintf( - 'Failed to read content of file "%s".%s', - $file, - $error ? ' ' . $error['message'] : '' - )); - } - - return $content; - } -} diff --git a/vendor/sebastian/diff/tests/Utils/UnifiedDiffAssertTrait.php b/vendor/sebastian/diff/tests/Utils/UnifiedDiffAssertTrait.php deleted file mode 100644 index 40ab44c..0000000 --- a/vendor/sebastian/diff/tests/Utils/UnifiedDiffAssertTrait.php +++ /dev/null @@ -1,277 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Diff\Utils; - -trait UnifiedDiffAssertTrait -{ - /** - * @param string $diff - * - * @throws \UnexpectedValueException - */ - public function assertValidUnifiedDiffFormat(string $diff): void - { - if ('' === $diff) { - $this->addToAssertionCount(1); - - return; - } - - // test diff ends with a line break - $last = \substr($diff, -1); - - if ("\n" !== $last && "\r" !== $last) { - throw new \UnexpectedValueException(\sprintf('Expected diff to end with a line break, got "%s".', $last)); - } - - $lines = \preg_split('/(.*\R)/', $diff, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); - $lineCount = \count($lines); - $lineNumber = $diffLineFromNumber = $diffLineToNumber = 1; - $fromStart = $fromTillOffset = $toStart = $toTillOffset = -1; - $expectHunkHeader = true; - - // check for header - if ($lineCount > 1) { - $this->unifiedDiffAssertLinePrefix($lines[0], 'Line 1.'); - $this->unifiedDiffAssertLinePrefix($lines[1], 'Line 2.'); - - if ('---' === \substr($lines[0], 0, 3)) { - if ('+++' !== \substr($lines[1], 0, 3)) { - throw new \UnexpectedValueException(\sprintf("Line 1 indicates a header, so line 2 must start with \"+++\".\nLine 1: \"%s\"\nLine 2: \"%s\".", $lines[0], $lines[1])); - } - - $this->unifiedDiffAssertHeaderLine($lines[0], '--- ', 'Line 1.'); - $this->unifiedDiffAssertHeaderLine($lines[1], '+++ ', 'Line 2.'); - - $lineNumber = 3; - } - } - - $endOfLineTypes = []; - $diffClosed = false; - - // assert format of lines, get all hunks, test the line numbers - for (; $lineNumber <= $lineCount; ++$lineNumber) { - if ($diffClosed) { - throw new \UnexpectedValueException(\sprintf('Unexpected line as 2 "No newline" markers have found, ". Line %d.', $lineNumber)); - } - - $line = $lines[$lineNumber - 1]; // line numbers start by 1, array index at 0 - $type = $this->unifiedDiffAssertLinePrefix($line, \sprintf('Line %d.', $lineNumber)); - - if ($expectHunkHeader && '@' !== $type && '\\' !== $type) { - throw new \UnexpectedValueException(\sprintf('Expected hunk start (\'@\'), got "%s". Line %d.', $type, $lineNumber)); - } - - if ('@' === $type) { - if (!$expectHunkHeader) { - throw new \UnexpectedValueException(\sprintf('Unexpected hunk start (\'@\'). Line %d.', $lineNumber)); - } - - $previousHunkFromEnd = $fromStart + $fromTillOffset; - $previousHunkTillEnd = $toStart + $toTillOffset; - - [$fromStart, $fromTillOffset, $toStart, $toTillOffset] = $this->unifiedDiffAssertHunkHeader($line, \sprintf('Line %d.', $lineNumber)); - - // detect overlapping hunks - if ($fromStart < $previousHunkFromEnd) { - throw new \UnexpectedValueException(\sprintf('Unexpected new hunk; "from" (\'-\') start overlaps previous hunk. Line %d.', $lineNumber)); - } - - if ($toStart < $previousHunkTillEnd) { - throw new \UnexpectedValueException(\sprintf('Unexpected new hunk; "to" (\'+\') start overlaps previous hunk. Line %d.', $lineNumber)); - } - - /* valid states; hunks touches against each other: - $fromStart === $previousHunkFromEnd - $toStart === $previousHunkTillEnd - */ - - $diffLineFromNumber = $fromStart; - $diffLineToNumber = $toStart; - $expectHunkHeader = false; - - continue; - } - - if ('-' === $type) { - if (isset($endOfLineTypes['-'])) { - throw new \UnexpectedValueException(\sprintf('Not expected from (\'-\'), already closed by "\\ No newline at end of file". Line %d.', $lineNumber)); - } - - ++$diffLineFromNumber; - } elseif ('+' === $type) { - if (isset($endOfLineTypes['+'])) { - throw new \UnexpectedValueException(\sprintf('Not expected to (\'+\'), already closed by "\\ No newline at end of file". Line %d.', $lineNumber)); - } - - ++$diffLineToNumber; - } elseif (' ' === $type) { - if (isset($endOfLineTypes['-'])) { - throw new \UnexpectedValueException(\sprintf('Not expected same (\' \'), \'-\' already closed by "\\ No newline at end of file". Line %d.', $lineNumber)); - } - - if (isset($endOfLineTypes['+'])) { - throw new \UnexpectedValueException(\sprintf('Not expected same (\' \'), \'+\' already closed by "\\ No newline at end of file". Line %d.', $lineNumber)); - } - - ++$diffLineFromNumber; - ++$diffLineToNumber; - } elseif ('\\' === $type) { - if (!isset($lines[$lineNumber - 2])) { - throw new \UnexpectedValueException(\sprintf('Unexpected "\\ No newline at end of file", it must be preceded by \'+\' or \'-\' line. Line %d.', $lineNumber)); - } - - $previousType = $this->unifiedDiffAssertLinePrefix($lines[$lineNumber - 2], \sprintf('Preceding line of "\\ No newline at end of file" of unexpected format. Line %d.', $lineNumber)); - - if (isset($endOfLineTypes[$previousType])) { - throw new \UnexpectedValueException(\sprintf('Unexpected "\\ No newline at end of file", "%s" was already closed. Line %d.', $type, $lineNumber)); - } - - $endOfLineTypes[$previousType] = true; - $diffClosed = \count($endOfLineTypes) > 1; - } else { - // internal state error - throw new \RuntimeException(\sprintf('Unexpected line type "%s" Line %d.', $type, $lineNumber)); - } - - $expectHunkHeader = - $diffLineFromNumber === ($fromStart + $fromTillOffset) - && $diffLineToNumber === ($toStart + $toTillOffset) - ; - } - - if ( - $diffLineFromNumber !== ($fromStart + $fromTillOffset) - && $diffLineToNumber !== ($toStart + $toTillOffset) - ) { - throw new \UnexpectedValueException(\sprintf('Unexpected EOF, number of lines in hunk "from" (\'-\')) and "to" (\'+\') mismatched. Line %d.', $lineNumber)); - } - - if ($diffLineFromNumber !== ($fromStart + $fromTillOffset)) { - throw new \UnexpectedValueException(\sprintf('Unexpected EOF, number of lines in hunk "from" (\'-\')) mismatched. Line %d.', $lineNumber)); - } - - if ($diffLineToNumber !== ($toStart + $toTillOffset)) { - throw new \UnexpectedValueException(\sprintf('Unexpected EOF, number of lines in hunk "to" (\'+\')) mismatched. Line %d.', $lineNumber)); - } - - $this->addToAssertionCount(1); - } - - /** - * @param string $line - * @param string $message - * - * @return string '+', '-', '@', ' ' or '\' - */ - private function unifiedDiffAssertLinePrefix(string $line, string $message): string - { - $this->unifiedDiffAssertStrLength($line, 2, $message); // 2: line type indicator ('+', '-', ' ' or '\') and a line break - $firstChar = $line[0]; - - if ('+' === $firstChar || '-' === $firstChar || '@' === $firstChar || ' ' === $firstChar) { - return $firstChar; - } - - if ("\\ No newline at end of file\n" === $line) { - return '\\'; - } - - throw new \UnexpectedValueException(\sprintf('Expected line to start with \'@\', \'-\' or \'+\', got "%s". %s', $line, $message)); - } - - private function unifiedDiffAssertStrLength(string $line, int $min, string $message): void - { - $length = \strlen($line); - - if ($length < $min) { - throw new \UnexpectedValueException(\sprintf('Expected string length of minimal %d, got %d. %s', $min, $length, $message)); - } - } - - /** - * Assert valid unified diff header line - * - * Samples: - * - "+++ from1.txt\t2017-08-24 19:51:29.383985722 +0200" - * - "+++ from1.txt" - * - * @param string $line - * @param string $start - * @param string $message - */ - private function unifiedDiffAssertHeaderLine(string $line, string $start, string $message): void - { - if (0 !== \strpos($line, $start)) { - throw new \UnexpectedValueException(\sprintf('Expected header line to start with "%s", got "%s". %s', $start . ' ', $line, $message)); - } - - // sample "+++ from1.txt\t2017-08-24 19:51:29.383985722 +0200\n" - $match = \preg_match( - "/^([^\t]*)(?:[\t]([\\S].*[\\S]))?\n$/", - \substr($line, 4), // 4 === string length of "+++ " / "--- " - $matches - ); - - if (1 !== $match) { - throw new \UnexpectedValueException(\sprintf('Header line does not match expected pattern, got "%s". %s', $line, $message)); - } - - // $file = $matches[1]; - - if (\count($matches) > 2) { - $this->unifiedDiffAssertHeaderDate($matches[2], $message); - } - } - - private function unifiedDiffAssertHeaderDate(string $date, string $message): void - { - // sample "2017-08-24 19:51:29.383985722 +0200" - $match = \preg_match( - '/^([\d]{4})-([01]?[\d])-([0123]?[\d])(:? [\d]{1,2}:[\d]{1,2}(?::[\d]{1,2}(:?\.[\d]+)?)?(?: ([\+\-][\d]{4}))?)?$/', - $date, - $matches - ); - - if (1 !== $match || ($matchesCount = \count($matches)) < 4) { - throw new \UnexpectedValueException(\sprintf('Date of header line does not match expected pattern, got "%s". %s', $date, $message)); - } - - // [$full, $year, $month, $day, $time] = $matches; - } - - /** - * @param string $line - * @param string $message - * - * @return int[] - */ - private function unifiedDiffAssertHunkHeader(string $line, string $message): array - { - if (1 !== \preg_match('#^@@ -([\d]+)((?:,[\d]+)?) \+([\d]+)((?:,[\d]+)?) @@\n$#', $line, $matches)) { - throw new \UnexpectedValueException( - \sprintf( - 'Hunk header line does not match expected pattern, got "%s". %s', - $line, - $message - ) - ); - } - - return [ - (int) $matches[1], - empty($matches[2]) ? 1 : (int) \substr($matches[2], 1), - (int) $matches[3], - empty($matches[4]) ? 1 : (int) \substr($matches[4], 1), - ]; - } -} diff --git a/vendor/sebastian/diff/tests/Utils/UnifiedDiffAssertTraitIntegrationTest.php b/vendor/sebastian/diff/tests/Utils/UnifiedDiffAssertTraitIntegrationTest.php deleted file mode 100644 index c88dc52..0000000 --- a/vendor/sebastian/diff/tests/Utils/UnifiedDiffAssertTraitIntegrationTest.php +++ /dev/null @@ -1,129 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Diff\Utils; - -use PHPUnit\Framework\TestCase; -use Symfony\Component\Process\Process; - -/** - * @requires OS Linux - * - * @coversNothing - */ -final class UnifiedDiffAssertTraitIntegrationTest extends TestCase -{ - use UnifiedDiffAssertTrait; - - private $filePatch; - - protected function setUp(): void - { - $this->filePatch = __DIR__ . '/../fixtures/out/patch.txt'; - - $this->cleanUpTempFiles(); - } - - protected function tearDown(): void - { - $this->cleanUpTempFiles(); - } - - /** - * @param string $fileFrom - * @param string $fileTo - * - * @dataProvider provideFilePairsCases - */ - public function testValidPatches(string $fileFrom, string $fileTo): void - { - $command = \sprintf( - 'diff -u %s %s > %s', - \escapeshellarg(\realpath($fileFrom)), - \escapeshellarg(\realpath($fileTo)), - \escapeshellarg($this->filePatch) - ); - - $p = new Process($command); - $p->run(); - - $exitCode = $p->getExitCode(); - - if (0 === $exitCode) { - // odd case when two files have the same content. Test after executing as it is more efficient than to read the files and check the contents every time. - $this->addToAssertionCount(1); - - return; - } - - $this->assertSame( - 1, // means `diff` found a diff between the files we gave it - $exitCode, - \sprintf( - "Command exec. was not successful:\n\"%s\"\nOutput:\n\"%s\"\nStdErr:\n\"%s\"\nExit code %d.\n", - $command, - $p->getOutput(), - $p->getErrorOutput(), - $p->getExitCode() - ) - ); - - $this->assertValidUnifiedDiffFormat(FileUtils::getFileContent($this->filePatch)); - } - - /** - * @return array> - */ - public function provideFilePairsCases(): array - { - $cases = []; - - // created cases based on dedicated fixtures - $dir = \realpath(__DIR__ . '/../fixtures/UnifiedDiffAssertTraitIntegrationTest'); - $dirLength = \strlen($dir); - - for ($i = 1;; ++$i) { - $fromFile = \sprintf('%s/%d_a.txt', $dir, $i); - $toFile = \sprintf('%s/%d_b.txt', $dir, $i); - - if (!\file_exists($fromFile)) { - break; - } - - $this->assertFileExists($toFile); - $cases[\sprintf("Diff file:\n\"%s\"\nvs.\n\"%s\"\n", \substr(\realpath($fromFile), $dirLength), \substr(\realpath($toFile), $dirLength))] = [$fromFile, $toFile]; - } - - // create cases based on PHP files within the vendor directory for integration testing - $dir = \realpath(__DIR__ . '/../../vendor'); - $dirLength = \strlen($dir); - - $fileIterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($dir, \RecursiveDirectoryIterator::SKIP_DOTS)); - $fromFile = __FILE__; - - /** @var \SplFileInfo $file */ - foreach ($fileIterator as $file) { - if ('php' !== $file->getExtension()) { - continue; - } - - $toFile = $file->getPathname(); - $cases[\sprintf("Diff file:\n\"%s\"\nvs.\n\"%s\"\n", \substr(\realpath($fromFile), $dirLength), \substr(\realpath($toFile), $dirLength))] = [$fromFile, $toFile]; - $fromFile = $toFile; - } - - return $cases; - } - - private function cleanUpTempFiles(): void - { - @\unlink($this->filePatch); - } -} diff --git a/vendor/sebastian/diff/tests/Utils/UnifiedDiffAssertTraitTest.php b/vendor/sebastian/diff/tests/Utils/UnifiedDiffAssertTraitTest.php deleted file mode 100644 index 7d5cc65..0000000 --- a/vendor/sebastian/diff/tests/Utils/UnifiedDiffAssertTraitTest.php +++ /dev/null @@ -1,434 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Diff\Utils; - -use PHPUnit\Framework\TestCase; - -/** - * @covers SebastianBergmann\Diff\Utils\UnifiedDiffAssertTrait - */ -final class UnifiedDiffAssertTraitTest extends TestCase -{ - use UnifiedDiffAssertTrait; - - /** - * @param string $diff - * - * @dataProvider provideValidCases - */ - public function testValidCases(string $diff): void - { - $this->assertValidUnifiedDiffFormat($diff); - } - - public function provideValidCases(): array - { - return [ - [ -'--- Original -+++ New -@@ -8 +8 @@ --Z -+U -', - ], - [ -'--- Original -+++ New -@@ -8 +8 @@ --Z -+U -@@ -15 +15 @@ --X -+V -', - ], - 'empty diff. is valid' => [ - '', - ], - ]; - } - - public function testNoLinebreakEnd(): void - { - $this->expectException(\UnexpectedValueException::class); - $this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Expected diff to end with a line break, got "C".', '#'))); - - $this->assertValidUnifiedDiffFormat("A\nB\nC"); - } - - public function testInvalidStartWithoutHeader(): void - { - $this->expectException(\UnexpectedValueException::class); - $this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote("Expected line to start with '@', '-' or '+', got \"A\n\". Line 1.", '#'))); - - $this->assertValidUnifiedDiffFormat("A\n"); - } - - public function testInvalidStartHeader1(): void - { - $this->expectException(\UnexpectedValueException::class); - $this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote("Line 1 indicates a header, so line 2 must start with \"+++\".\nLine 1: \"--- A\n\"\nLine 2: \"+ 1\n\".", '#'))); - - $this->assertValidUnifiedDiffFormat("--- A\n+ 1\n"); - } - - public function testInvalidStartHeader2(): void - { - $this->expectException(\UnexpectedValueException::class); - $this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote("Header line does not match expected pattern, got \"+++ file X\n\". Line 2.", '#'))); - - $this->assertValidUnifiedDiffFormat("--- A\n+++ file\tX\n"); - } - - public function testInvalidStartHeader3(): void - { - $this->expectException(\UnexpectedValueException::class); - $this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Date of header line does not match expected pattern, got "[invalid date]". Line 1.', '#'))); - - $this->assertValidUnifiedDiffFormat( -"--- Original\t[invalid date] -+++ New -@@ -1,2 +1,2 @@ --A -+B - " . ' -' - ); - } - - public function testInvalidStartHeader4(): void - { - $this->expectException(\UnexpectedValueException::class); - $this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote("Expected header line to start with \"+++ \", got \"+++INVALID\n\". Line 2.", '#'))); - - $this->assertValidUnifiedDiffFormat( -'--- Original -+++INVALID -@@ -1,2 +1,2 @@ --A -+B - ' . ' -' - ); - } - - public function testInvalidLine1(): void - { - $this->expectException(\UnexpectedValueException::class); - $this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote("Expected line to start with '@', '-' or '+', got \"1\n\". Line 5.", '#'))); - - $this->assertValidUnifiedDiffFormat( -'--- Original -+++ New -@@ -8 +8 @@ --Z -1 -+U -' - ); - } - - public function testInvalidLine2(): void - { - $this->expectException(\UnexpectedValueException::class); - $this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Expected string length of minimal 2, got 1. Line 4.', '#'))); - - $this->assertValidUnifiedDiffFormat( -'--- Original -+++ New -@@ -8 +8 @@ - - -' - ); - } - - public function testHunkInvalidFormat(): void - { - $this->expectException(\UnexpectedValueException::class); - $this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote("Hunk header line does not match expected pattern, got \"@@ INVALID -1,1 +1,1 @@\n\". Line 3.", '#'))); - - $this->assertValidUnifiedDiffFormat( -'--- Original -+++ New -@@ INVALID -1,1 +1,1 @@ --Z -+U -' - ); - } - - public function testHunkOverlapFrom(): void - { - $this->expectException(\UnexpectedValueException::class); - $this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Unexpected new hunk; "from" (\'-\') start overlaps previous hunk. Line 6.', '#'))); - - $this->assertValidUnifiedDiffFormat( -'--- Original -+++ New -@@ -8,1 +8,1 @@ --Z -+U -@@ -7,1 +9,1 @@ --Z -+U -' - ); - } - - public function testHunkOverlapTo(): void - { - $this->expectException(\UnexpectedValueException::class); - $this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Unexpected new hunk; "to" (\'+\') start overlaps previous hunk. Line 6.', '#'))); - - $this->assertValidUnifiedDiffFormat( -'--- Original -+++ New -@@ -8,1 +8,1 @@ --Z -+U -@@ -17,1 +7,1 @@ --Z -+U -' - ); - } - - public function testExpectHunk1(): void - { - $this->expectException(\UnexpectedValueException::class); - $this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Expected hunk start (\'@\'), got "+". Line 6.', '#'))); - - $this->assertValidUnifiedDiffFormat( -'--- Original -+++ New -@@ -8 +8 @@ --Z -+U -+O -' - ); - } - - public function testExpectHunk2(): void - { - $this->expectException(\UnexpectedValueException::class); - $this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Unexpected hunk start (\'@\'). Line 6.', '#'))); - - $this->assertValidUnifiedDiffFormat( -'--- Original -+++ New -@@ -8,12 +8,12 @@ - ' . ' - ' . ' -@@ -38,12 +48,12 @@ -' - ); - } - - public function testMisplacedLineAfterComments1(): void - { - $this->expectException(\UnexpectedValueException::class); - $this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Unexpected line as 2 "No newline" markers have found, ". Line 8.', '#'))); - - $this->assertValidUnifiedDiffFormat( -'--- Original -+++ New -@@ -8 +8 @@ --Z -\ No newline at end of file -+U -\ No newline at end of file -+A -' - ); - } - - public function testMisplacedLineAfterComments2(): void - { - $this->expectException(\UnexpectedValueException::class); - $this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Unexpected line as 2 "No newline" markers have found, ". Line 7.', '#'))); - - $this->assertValidUnifiedDiffFormat( -'--- Original -+++ New -@@ -8 +8 @@ -+U -\ No newline at end of file -\ No newline at end of file -\ No newline at end of file -' - ); - } - - public function testMisplacedLineAfterComments3(): void - { - $this->expectException(\UnexpectedValueException::class); - $this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Unexpected line as 2 "No newline" markers have found, ". Line 7.', '#'))); - - $this->assertValidUnifiedDiffFormat( -'--- Original -+++ New -@@ -8 +8 @@ -+U -\ No newline at end of file -\ No newline at end of file -+A -' - ); - } - - public function testMisplacedComment(): void - { - $this->expectException(\UnexpectedValueException::class); - $this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Unexpected "\ No newline at end of file", it must be preceded by \'+\' or \'-\' line. Line 1.', '#'))); - - $this->assertValidUnifiedDiffFormat( -'\ No newline at end of file -' - ); - } - - public function testUnexpectedDuplicateNoNewLineEOF(): void - { - $this->expectException(\UnexpectedValueException::class); - $this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Unexpected "\\ No newline at end of file", "\\" was already closed. Line 8.', '#'))); - - $this->assertValidUnifiedDiffFormat( -'--- Original -+++ New -@@ -8,12 +8,12 @@ - ' . ' - ' . ' -\ No newline at end of file - ' . ' -\ No newline at end of file -' - ); - } - - public function testFromAfterClose(): void - { - $this->expectException(\UnexpectedValueException::class); - $this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Not expected from (\'-\'), already closed by "\ No newline at end of file". Line 6.', '#'))); - - $this->assertValidUnifiedDiffFormat( -'--- Original -+++ New -@@ -8,12 +8,12 @@ --A -\ No newline at end of file --A -\ No newline at end of file -' - ); - } - - public function testSameAfterFromClose(): void - { - $this->expectException(\UnexpectedValueException::class); - $this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Not expected same (\' \'), \'-\' already closed by "\ No newline at end of file". Line 6.', '#'))); - - $this->assertValidUnifiedDiffFormat( - '--- Original -+++ New -@@ -8,12 +8,12 @@ --A -\ No newline at end of file - A -\ No newline at end of file -' - ); - } - - public function testToAfterClose(): void - { - $this->expectException(\UnexpectedValueException::class); - $this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Not expected to (\'+\'), already closed by "\ No newline at end of file". Line 6.', '#'))); - - $this->assertValidUnifiedDiffFormat( - '--- Original -+++ New -@@ -8,12 +8,12 @@ -+A -\ No newline at end of file -+A -\ No newline at end of file -' - ); - } - - public function testSameAfterToClose(): void - { - $this->expectException(\UnexpectedValueException::class); - $this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Not expected same (\' \'), \'+\' already closed by "\ No newline at end of file". Line 6.', '#'))); - - $this->assertValidUnifiedDiffFormat( - '--- Original -+++ New -@@ -8,12 +8,12 @@ -+A -\ No newline at end of file - A -\ No newline at end of file -' - ); - } - - public function testUnexpectedEOFFromMissingLines(): void - { - $this->expectException(\UnexpectedValueException::class); - $this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Unexpected EOF, number of lines in hunk "from" (\'-\')) mismatched. Line 7.', '#'))); - - $this->assertValidUnifiedDiffFormat( -'--- Original -+++ New -@@ -8,19 +7,2 @@ --A -+B - ' . ' -' - ); - } - - public function testUnexpectedEOFToMissingLines(): void - { - $this->expectException(\UnexpectedValueException::class); - $this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Unexpected EOF, number of lines in hunk "to" (\'+\')) mismatched. Line 7.', '#'))); - - $this->assertValidUnifiedDiffFormat( -'--- Original -+++ New -@@ -8,2 +7,3 @@ --A -+B - ' . ' -' - ); - } - - public function testUnexpectedEOFBothFromAndToMissingLines(): void - { - $this->expectException(\UnexpectedValueException::class); - $this->expectExceptionMessageRegExp(\sprintf('#^%s$#', \preg_quote('Unexpected EOF, number of lines in hunk "from" (\'-\')) and "to" (\'+\') mismatched. Line 7.', '#'))); - - $this->assertValidUnifiedDiffFormat( -'--- Original -+++ New -@@ -1,12 +1,14 @@ --A -+B - ' . ' -' - ); - } -} diff --git a/vendor/sebastian/diff/tests/fixtures/.editorconfig b/vendor/sebastian/diff/tests/fixtures/.editorconfig deleted file mode 100644 index 78b36ca..0000000 --- a/vendor/sebastian/diff/tests/fixtures/.editorconfig +++ /dev/null @@ -1 +0,0 @@ -root = true diff --git a/vendor/sebastian/diff/tests/fixtures/UnifiedDiffAssertTraitIntegrationTest/1_a.txt b/vendor/sebastian/diff/tests/fixtures/UnifiedDiffAssertTraitIntegrationTest/1_a.txt deleted file mode 100644 index 2e65efe..0000000 --- a/vendor/sebastian/diff/tests/fixtures/UnifiedDiffAssertTraitIntegrationTest/1_a.txt +++ /dev/null @@ -1 +0,0 @@ -a \ No newline at end of file diff --git a/vendor/sebastian/diff/tests/fixtures/UnifiedDiffAssertTraitIntegrationTest/1_b.txt b/vendor/sebastian/diff/tests/fixtures/UnifiedDiffAssertTraitIntegrationTest/1_b.txt deleted file mode 100644 index e69de29..0000000 diff --git a/vendor/sebastian/diff/tests/fixtures/UnifiedDiffAssertTraitIntegrationTest/2_a.txt b/vendor/sebastian/diff/tests/fixtures/UnifiedDiffAssertTraitIntegrationTest/2_a.txt deleted file mode 100644 index c7fe26e..0000000 --- a/vendor/sebastian/diff/tests/fixtures/UnifiedDiffAssertTraitIntegrationTest/2_a.txt +++ /dev/null @@ -1,35 +0,0 @@ -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a \ No newline at end of file diff --git a/vendor/sebastian/diff/tests/fixtures/UnifiedDiffAssertTraitIntegrationTest/2_b.txt b/vendor/sebastian/diff/tests/fixtures/UnifiedDiffAssertTraitIntegrationTest/2_b.txt deleted file mode 100644 index 377a70f..0000000 --- a/vendor/sebastian/diff/tests/fixtures/UnifiedDiffAssertTraitIntegrationTest/2_b.txt +++ /dev/null @@ -1,18 +0,0 @@ -a -a -a -a -a -a -a -a -a -a -b -a -a -a -a -a -a -c \ No newline at end of file diff --git a/vendor/sebastian/diff/tests/fixtures/out/.editorconfig b/vendor/sebastian/diff/tests/fixtures/out/.editorconfig deleted file mode 100644 index 78b36ca..0000000 --- a/vendor/sebastian/diff/tests/fixtures/out/.editorconfig +++ /dev/null @@ -1 +0,0 @@ -root = true diff --git a/vendor/sebastian/diff/tests/fixtures/out/.gitignore b/vendor/sebastian/diff/tests/fixtures/out/.gitignore deleted file mode 100644 index f6f7a47..0000000 --- a/vendor/sebastian/diff/tests/fixtures/out/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# reset all ignore rules to create sandbox for integration test -!/** \ No newline at end of file diff --git a/vendor/sebastian/diff/tests/fixtures/patch.txt b/vendor/sebastian/diff/tests/fixtures/patch.txt deleted file mode 100644 index 144b61d..0000000 --- a/vendor/sebastian/diff/tests/fixtures/patch.txt +++ /dev/null @@ -1,9 +0,0 @@ -diff --git a/Foo.php b/Foo.php -index abcdefg..abcdefh 100644 ---- a/Foo.php -+++ b/Foo.php -@@ -20,4 +20,5 @@ class Foo - const ONE = 1; - const TWO = 2; -+ const THREE = 3; - const FOUR = 4; diff --git a/vendor/sebastian/diff/tests/fixtures/patch2.txt b/vendor/sebastian/diff/tests/fixtures/patch2.txt deleted file mode 100644 index 41fbc95..0000000 --- a/vendor/sebastian/diff/tests/fixtures/patch2.txt +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/Foo.php b/Foo.php -index abcdefg..abcdefh 100644 ---- a/Foo.php -+++ b/Foo.php -@@ -20,4 +20,5 @@ class Foo - const ONE = 1; - const TWO = 2; -+ const THREE = 3; - const FOUR = 4; - -@@ -320,4 +320,5 @@ class Foo - const A = 'A'; - const B = 'B'; -+ const C = 'C'; - const D = 'D'; - -@@ -600,4 +600,5 @@ class Foo - public function doSomething() { - -+ return 'foo'; - } diff --git a/vendor/sebastian/diff/tests/fixtures/serialized_diff.bin b/vendor/sebastian/diff/tests/fixtures/serialized_diff.bin deleted file mode 100644 index 377404d..0000000 Binary files a/vendor/sebastian/diff/tests/fixtures/serialized_diff.bin and /dev/null differ diff --git a/vendor/sebastian/environment/.github/FUNDING.yml b/vendor/sebastian/environment/.github/FUNDING.yml deleted file mode 100644 index c2fba0f..0000000 --- a/vendor/sebastian/environment/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -github: sebastianbergmann diff --git a/vendor/sebastian/environment/.gitignore b/vendor/sebastian/environment/.gitignore deleted file mode 100644 index 1adc020..0000000 --- a/vendor/sebastian/environment/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/.idea -/vendor -/composer.lock -/composer.phar -/.php_cs.cache -/.phpunit.result.cache diff --git a/vendor/sebastian/environment/.php_cs.dist b/vendor/sebastian/environment/.php_cs.dist deleted file mode 100644 index 67dd70e..0000000 --- a/vendor/sebastian/environment/.php_cs.dist +++ /dev/null @@ -1,199 +0,0 @@ - - -For the full copyright and license information, please view the LICENSE -file that was distributed with this source code. -EOF; - -return PhpCsFixer\Config::create() - ->setRiskyAllowed(true) - ->setRules( - [ - 'align_multiline_comment' => true, - 'array_indentation' => true, - 'array_syntax' => ['syntax' => 'short'], - 'binary_operator_spaces' => [ - 'operators' => [ - '=' => 'align', - '=>' => 'align', - ], - ], - 'blank_line_after_namespace' => true, - 'blank_line_before_statement' => [ - 'statements' => [ - 'break', - 'continue', - 'declare', - 'do', - 'for', - 'foreach', - 'if', - 'include', - 'include_once', - 'require', - 'require_once', - 'return', - 'switch', - 'throw', - 'try', - 'while', - 'yield', - ], - ], - 'braces' => true, - 'cast_spaces' => true, - 'class_attributes_separation' => ['elements' => ['const', 'method', 'property']], - 'combine_consecutive_issets' => true, - 'combine_consecutive_unsets' => true, - 'combine_nested_dirname' => true, - 'compact_nullable_typehint' => true, - 'concat_space' => ['spacing' => 'one'], - 'declare_equal_normalize' => ['space' => 'none'], - 'declare_strict_types' => true, - 'dir_constant' => true, - 'elseif' => true, - 'encoding' => true, - 'full_opening_tag' => true, - 'function_declaration' => true, - 'header_comment' => ['header' => $header, 'separate' => 'none'], - 'indentation_type' => true, - 'is_null' => true, - 'line_ending' => true, - 'list_syntax' => ['syntax' => 'short'], - 'logical_operators' => true, - 'lowercase_cast' => true, - 'lowercase_constants' => true, - 'lowercase_keywords' => true, - 'lowercase_static_reference' => true, - 'magic_constant_casing' => true, - 'method_argument_space' => ['ensure_fully_multiline' => true], - 'modernize_types_casting' => true, - 'multiline_comment_opening_closing' => true, - 'multiline_whitespace_before_semicolons' => true, - 'native_constant_invocation' => true, - 'native_function_casing' => true, - 'native_function_invocation' => true, - 'new_with_braces' => false, - 'no_alias_functions' => true, - 'no_alternative_syntax' => true, - 'no_blank_lines_after_class_opening' => true, - 'no_blank_lines_after_phpdoc' => true, - 'no_blank_lines_before_namespace' => true, - 'no_closing_tag' => true, - 'no_empty_comment' => true, - 'no_empty_phpdoc' => true, - 'no_empty_statement' => true, - 'no_extra_blank_lines' => true, - 'no_homoglyph_names' => true, - 'no_leading_import_slash' => true, - 'no_leading_namespace_whitespace' => true, - 'no_mixed_echo_print' => ['use' => 'print'], - 'no_multiline_whitespace_around_double_arrow' => true, - 'no_null_property_initialization' => true, - 'no_php4_constructor' => true, - 'no_short_bool_cast' => true, - 'no_short_echo_tag' => true, - 'no_singleline_whitespace_before_semicolons' => true, - 'no_spaces_after_function_name' => true, - 'no_spaces_inside_parenthesis' => true, - 'no_superfluous_elseif' => true, - 'no_superfluous_phpdoc_tags' => true, - 'no_trailing_comma_in_list_call' => true, - 'no_trailing_comma_in_singleline_array' => true, - 'no_trailing_whitespace' => true, - 'no_trailing_whitespace_in_comment' => true, - 'no_unneeded_control_parentheses' => true, - 'no_unneeded_curly_braces' => true, - 'no_unneeded_final_method' => true, - 'no_unreachable_default_argument_value' => true, - 'no_unset_on_property' => true, - 'no_unused_imports' => true, - 'no_useless_else' => true, - 'no_useless_return' => true, - 'no_whitespace_before_comma_in_array' => true, - 'no_whitespace_in_blank_line' => true, - 'non_printable_character' => true, - 'normalize_index_brace' => true, - 'object_operator_without_whitespace' => true, - 'ordered_class_elements' => [ - 'order' => [ - 'use_trait', - 'constant_public', - 'constant_protected', - 'constant_private', - 'property_public_static', - 'property_protected_static', - 'property_private_static', - 'property_public', - 'property_protected', - 'property_private', - 'method_public_static', - 'construct', - 'destruct', - 'magic', - 'phpunit', - 'method_public', - 'method_protected', - 'method_private', - 'method_protected_static', - 'method_private_static', - ], - ], - 'ordered_imports' => true, - 'phpdoc_add_missing_param_annotation' => true, - 'phpdoc_align' => true, - 'phpdoc_annotation_without_dot' => true, - 'phpdoc_indent' => true, - 'phpdoc_no_access' => true, - 'phpdoc_no_empty_return' => true, - 'phpdoc_no_package' => true, - 'phpdoc_order' => true, - 'phpdoc_return_self_reference' => true, - 'phpdoc_scalar' => true, - 'phpdoc_separation' => true, - 'phpdoc_single_line_var_spacing' => true, - 'phpdoc_to_comment' => true, - 'phpdoc_trim' => true, - 'phpdoc_trim_consecutive_blank_line_separation' => true, - 'phpdoc_types' => true, - 'phpdoc_types_order' => true, - 'phpdoc_var_without_name' => true, - 'pow_to_exponentiation' => true, - 'protected_to_private' => true, - 'random_api_migration' => true, - 'return_assignment' => true, - 'return_type_declaration' => ['space_before' => 'none'], - 'self_accessor' => true, - 'semicolon_after_instruction' => true, - 'set_type_to_cast' => true, - 'short_scalar_cast' => true, - 'simplified_null_return' => true, - 'single_blank_line_at_eof' => true, - 'single_import_per_statement' => true, - 'single_line_after_imports' => true, - 'single_quote' => true, - 'standardize_not_equals' => true, - 'ternary_to_null_coalescing' => true, - 'trailing_comma_in_multiline_array' => true, - 'trim_array_spaces' => true, - 'unary_operator_spaces' => true, - 'visibility_required' => [ - 'elements' => [ - 'const', - 'method', - 'property', - ], - ], - 'void_return' => true, - 'whitespace_after_comma_in_array' => true, - ] - ) - ->setFinder( - PhpCsFixer\Finder::create() - ->files() - ->in(__DIR__ . '/src') - ->in(__DIR__ . '/tests') - ); diff --git a/vendor/sebastian/environment/.travis.yml b/vendor/sebastian/environment/.travis.yml deleted file mode 100644 index e066fa9..0000000 --- a/vendor/sebastian/environment/.travis.yml +++ /dev/null @@ -1,28 +0,0 @@ -language: php - -php: - - 7.1 - - 7.2 - - 7.3 - - 7.4snapshot - -env: - matrix: - - DRIVER="phpdbg" - - DRIVER="xdebug" - -before_install: - - composer clear-cache - -install: - - travis_retry composer update --no-interaction --no-ansi --no-progress --no-suggest - -script: - - if [[ "$DRIVER" = 'phpdbg' ]]; then phpdbg -qrr vendor/bin/phpunit --coverage-clover=coverage.xml; fi - - if [[ "$DRIVER" != 'phpdbg' ]]; then vendor/bin/phpunit --coverage-clover=coverage.xml; fi - -after_success: - - bash <(curl -s https://codecov.io/bash) - -notifications: - email: false diff --git a/vendor/sebastian/environment/ChangeLog.md b/vendor/sebastian/environment/ChangeLog.md deleted file mode 100644 index 172a8db..0000000 --- a/vendor/sebastian/environment/ChangeLog.md +++ /dev/null @@ -1,127 +0,0 @@ -# Changes in sebastianbergmann/environment - -All notable changes in `sebastianbergmann/environment` are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. - -## [4.2.4] - 2020-11-30 - -### Changed - -* Changed PHP version constraint in `composer.json` from `^7.1` to `>=7.1` - -## [4.2.3] - 2019-11-20 - -### Changed - -* Implemented [#50](https://github.com/sebastianbergmann/environment/pull/50): Windows improvements to console capabilities - -### Fixed - -* Fixed [#49](https://github.com/sebastianbergmann/environment/issues/49): Detection how OpCache handles docblocks does not work correctly when PHPDBG is used - -## [4.2.2] - 2019-05-05 - -### Fixed - -* Fixed [#44](https://github.com/sebastianbergmann/environment/pull/44): `TypeError` in `Console::getNumberOfColumnsInteractive()` - -## [4.2.1] - 2019-04-25 - -### Fixed - -* Fixed an issue in `Runtime::getCurrentSettings()` - -## [4.2.0] - 2019-04-25 - -### Added - -* Implemented [#36](https://github.com/sebastianbergmann/environment/pull/36): `Runtime::getCurrentSettings()` - -## [4.1.0] - 2019-02-01 - -### Added - -* Implemented `Runtime::getNameWithVersionAndCodeCoverageDriver()` method -* Implemented [#34](https://github.com/sebastianbergmann/environment/pull/34): Support for PCOV extension - -## [4.0.2] - 2019-01-28 - -### Fixed - -* Fixed [#33](https://github.com/sebastianbergmann/environment/issues/33): `Runtime::discardsComments()` returns true too eagerly - -### Removed - -* Removed support for Zend Optimizer+ in `Runtime::discardsComments()` - -## [4.0.1] - 2018-11-25 - -### Fixed - -* Fixed [#31](https://github.com/sebastianbergmann/environment/issues/31): Regressions in `Console` class - -## [4.0.0] - 2018-10-23 [YANKED] - -### Fixed - -* Fixed [#25](https://github.com/sebastianbergmann/environment/pull/25): `Console::hasColorSupport()` does not work on Windows - -### Removed - -* This component is no longer supported on PHP 7.0 - -## [3.1.0] - 2017-07-01 - -### Added - -* Implemented [#21](https://github.com/sebastianbergmann/environment/issues/21): Equivalent of `PHP_OS_FAMILY` (for PHP < 7.2) - -## [3.0.4] - 2017-06-20 - -### Fixed - -* Fixed [#20](https://github.com/sebastianbergmann/environment/pull/20): PHP 7 mode of HHVM not forced - -## [3.0.3] - 2017-05-18 - -### Fixed - -* Fixed [#18](https://github.com/sebastianbergmann/environment/issues/18): `Uncaught TypeError: preg_match() expects parameter 2 to be string, null given` - -## [3.0.2] - 2017-04-21 - -### Fixed - -* Fixed [#17](https://github.com/sebastianbergmann/environment/issues/17): `Uncaught TypeError: trim() expects parameter 1 to be string, boolean given` - -## [3.0.1] - 2017-04-21 - -### Fixed - -* Fixed inverted logic in `Runtime::discardsComments()` - -## [3.0.0] - 2017-04-21 - -### Added - -* Implemented `Runtime::discardsComments()` for querying whether the PHP runtime discards annotations - -### Removed - -* This component is no longer supported on PHP 5.6 - -[4.2.4]: https://github.com/sebastianbergmann/phpunit/compare/4.2.3...4.2.4 -[4.2.3]: https://github.com/sebastianbergmann/phpunit/compare/4.2.2...4.2.3 -[4.2.2]: https://github.com/sebastianbergmann/phpunit/compare/4.2.1...4.2.2 -[4.2.1]: https://github.com/sebastianbergmann/phpunit/compare/4.2.0...4.2.1 -[4.2.0]: https://github.com/sebastianbergmann/phpunit/compare/4.1.0...4.2.0 -[4.1.0]: https://github.com/sebastianbergmann/phpunit/compare/4.0.2...4.1.0 -[4.0.2]: https://github.com/sebastianbergmann/phpunit/compare/4.0.1...4.0.2 -[4.0.1]: https://github.com/sebastianbergmann/phpunit/compare/66691f8e2dc4641909166b275a9a4f45c0e89092...4.0.1 -[4.0.0]: https://github.com/sebastianbergmann/phpunit/compare/3.1.0...66691f8e2dc4641909166b275a9a4f45c0e89092 -[3.1.0]: https://github.com/sebastianbergmann/phpunit/compare/3.0...3.1.0 -[3.0.4]: https://github.com/sebastianbergmann/phpunit/compare/3.0.3...3.0.4 -[3.0.3]: https://github.com/sebastianbergmann/phpunit/compare/3.0.2...3.0.3 -[3.0.2]: https://github.com/sebastianbergmann/phpunit/compare/3.0.1...3.0.2 -[3.0.1]: https://github.com/sebastianbergmann/phpunit/compare/3.0.0...3.0.1 -[3.0.0]: https://github.com/sebastianbergmann/phpunit/compare/2.0...3.0.0 - diff --git a/vendor/sebastian/environment/LICENSE b/vendor/sebastian/environment/LICENSE deleted file mode 100644 index 3291fbd..0000000 --- a/vendor/sebastian/environment/LICENSE +++ /dev/null @@ -1,33 +0,0 @@ -sebastian/environment - -Copyright (c) 2014-2019, Sebastian Bergmann . -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Sebastian Bergmann nor the names of his - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/sebastian/environment/README.md b/vendor/sebastian/environment/README.md deleted file mode 100644 index 3e854af..0000000 --- a/vendor/sebastian/environment/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# sebastian/environment - -This component provides functionality that helps writing PHP code that has runtime-specific (PHP / HHVM) execution paths. - -[![Latest Stable Version](https://img.shields.io/packagist/v/sebastian/environment.svg?style=flat-square)](https://packagist.org/packages/sebastian/environment) -[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.1-8892BF.svg?style=flat-square)](https://php.net/) -[![Build Status](https://travis-ci.org/sebastianbergmann/environment.svg?branch=master)](https://travis-ci.org/sebastianbergmann/environment) - -## Installation - -You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): - - composer require sebastian/environment - -If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: - - composer require --dev sebastian/environment diff --git a/vendor/sebastian/environment/build.xml b/vendor/sebastian/environment/build.xml deleted file mode 100644 index 591a58b..0000000 --- a/vendor/sebastian/environment/build.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/vendor/sebastian/environment/composer.json b/vendor/sebastian/environment/composer.json deleted file mode 100644 index d02bb38..0000000 --- a/vendor/sebastian/environment/composer.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "sebastian/environment", - "description": "Provides functionality to handle HHVM/PHP environments", - "keywords": ["environment","hhvm","xdebug"], - "homepage": "http://www.github.com/sebastianbergmann/environment", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "config": { - "optimize-autoloader": true, - "sort-packages": true - }, - "prefer-stable": true, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.5" - }, - "suggest": { - "ext-posix": "*" - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "4.2-dev" - } - } -} diff --git a/vendor/sebastian/environment/phpunit.xml b/vendor/sebastian/environment/phpunit.xml deleted file mode 100644 index 0185265..0000000 --- a/vendor/sebastian/environment/phpunit.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - tests - - - - - - src - - - diff --git a/vendor/sebastian/environment/src/Console.php b/vendor/sebastian/environment/src/Console.php deleted file mode 100644 index 947dacf..0000000 --- a/vendor/sebastian/environment/src/Console.php +++ /dev/null @@ -1,164 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Environment; - -final class Console -{ - /** - * @var int - */ - public const STDIN = 0; - - /** - * @var int - */ - public const STDOUT = 1; - - /** - * @var int - */ - public const STDERR = 2; - - /** - * Returns true if STDOUT supports colorization. - * - * This code has been copied and adapted from - * Symfony\Component\Console\Output\StreamOutput. - */ - public function hasColorSupport(): bool - { - if ('Hyper' === \getenv('TERM_PROGRAM')) { - return true; - } - - if ($this->isWindows()) { - // @codeCoverageIgnoreStart - return (\defined('STDOUT') && \function_exists('sapi_windows_vt100_support') && @\sapi_windows_vt100_support(\STDOUT)) - || false !== \getenv('ANSICON') - || 'ON' === \getenv('ConEmuANSI') - || 'xterm' === \getenv('TERM'); - // @codeCoverageIgnoreEnd - } - - if (!\defined('STDOUT')) { - // @codeCoverageIgnoreStart - return false; - // @codeCoverageIgnoreEnd - } - - return $this->isInteractive(\STDOUT); - } - - /** - * Returns the number of columns of the terminal. - * - * @codeCoverageIgnore - */ - public function getNumberOfColumns(): int - { - if (!$this->isInteractive(\defined('STDIN') ? \STDIN : self::STDIN)) { - return 80; - } - - if ($this->isWindows()) { - return $this->getNumberOfColumnsWindows(); - } - - return $this->getNumberOfColumnsInteractive(); - } - - /** - * Returns if the file descriptor is an interactive terminal or not. - * - * Normally, we want to use a resource as a parameter, yet sadly it's not always awailable, - * eg when running code in interactive console (`php -a`), STDIN/STDOUT/STDERR constants are not defined. - * - * @param int|resource $fileDescriptor - */ - public function isInteractive($fileDescriptor = self::STDOUT): bool - { - if (\is_resource($fileDescriptor)) { - // These functions require a descriptor that is a real resource, not a numeric ID of it - if (\function_exists('stream_isatty') && @\stream_isatty($fileDescriptor)) { - return true; - } - - $stat = @\fstat(\STDOUT); - // Check if formatted mode is S_IFCHR - return $stat ? 0020000 === ($stat['mode'] & 0170000) : false; - } - - return \function_exists('posix_isatty') && @\posix_isatty($fileDescriptor); - } - - private function isWindows(): bool - { - return \DIRECTORY_SEPARATOR === '\\'; - } - - /** - * @codeCoverageIgnore - */ - private function getNumberOfColumnsInteractive(): int - { - if (\function_exists('shell_exec') && \preg_match('#\d+ (\d+)#', \shell_exec('stty size') ?: '', $match) === 1) { - if ((int) $match[1] > 0) { - return (int) $match[1]; - } - } - - if (\function_exists('shell_exec') && \preg_match('#columns = (\d+);#', \shell_exec('stty') ?: '', $match) === 1) { - if ((int) $match[1] > 0) { - return (int) $match[1]; - } - } - - return 80; - } - - /** - * @codeCoverageIgnore - */ - private function getNumberOfColumnsWindows(): int - { - $ansicon = \getenv('ANSICON'); - $columns = 80; - - if (\is_string($ansicon) && \preg_match('/^(\d+)x\d+ \(\d+x(\d+)\)$/', \trim($ansicon), $matches)) { - $columns = $matches[1]; - } elseif (\function_exists('proc_open')) { - $process = \proc_open( - 'mode CON', - [ - 1 => ['pipe', 'w'], - 2 => ['pipe', 'w'], - ], - $pipes, - null, - null, - ['suppress_errors' => true] - ); - - if (\is_resource($process)) { - $info = \stream_get_contents($pipes[1]); - - \fclose($pipes[1]); - \fclose($pipes[2]); - \proc_close($process); - - if (\preg_match('/--------+\r?\n.+?(\d+)\r?\n.+?(\d+)\r?\n/', $info, $matches)) { - $columns = $matches[2]; - } - } - } - - return $columns - 1; - } -} diff --git a/vendor/sebastian/environment/src/OperatingSystem.php b/vendor/sebastian/environment/src/OperatingSystem.php deleted file mode 100644 index 67a35bc..0000000 --- a/vendor/sebastian/environment/src/OperatingSystem.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Environment; - -final class OperatingSystem -{ - /** - * Returns PHP_OS_FAMILY (if defined (which it is on PHP >= 7.2)). - * Returns a string (compatible with PHP_OS_FAMILY) derived from PHP_OS otherwise. - */ - public function getFamily(): string - { - if (\defined('PHP_OS_FAMILY')) { - return \PHP_OS_FAMILY; - } - - if (\DIRECTORY_SEPARATOR === '\\') { - return 'Windows'; - } - - switch (\PHP_OS) { - case 'Darwin': - return 'Darwin'; - - case 'DragonFly': - case 'FreeBSD': - case 'NetBSD': - case 'OpenBSD': - return 'BSD'; - - case 'Linux': - return 'Linux'; - - case 'SunOS': - return 'Solaris'; - - default: - return 'Unknown'; - } - } -} diff --git a/vendor/sebastian/environment/src/Runtime.php b/vendor/sebastian/environment/src/Runtime.php deleted file mode 100644 index 0cbc4db..0000000 --- a/vendor/sebastian/environment/src/Runtime.php +++ /dev/null @@ -1,265 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Environment; - -/** - * Utility class for HHVM/PHP environment handling. - */ -final class Runtime -{ - /** - * @var string - */ - private static $binary; - - /** - * Returns true when Xdebug or PCOV is available or - * the runtime used is PHPDBG. - */ - public function canCollectCodeCoverage(): bool - { - return $this->hasXdebug() || $this->hasPCOV() || $this->hasPHPDBGCodeCoverage(); - } - - /** - * Returns true when Zend OPcache is loaded, enabled, and is configured to discard comments. - */ - public function discardsComments(): bool - { - if (!\extension_loaded('Zend OPcache')) { - return false; - } - - if (\ini_get('opcache.save_comments') !== '0') { - return false; - } - - if ((\PHP_SAPI === 'cli' || \PHP_SAPI === 'phpdbg') && \ini_get('opcache.enable_cli') === '1') { - return true; - } - - if (\PHP_SAPI !== 'cli' && \PHP_SAPI !== 'phpdbg' && \ini_get('opcache.enable') === '1') { - return true; - } - - return false; - } - - /** - * Returns the path to the binary of the current runtime. - * Appends ' --php' to the path when the runtime is HHVM. - */ - public function getBinary(): string - { - // HHVM - if (self::$binary === null && $this->isHHVM()) { - // @codeCoverageIgnoreStart - if ((self::$binary = \getenv('PHP_BINARY')) === false) { - self::$binary = \PHP_BINARY; - } - - self::$binary = \escapeshellarg(self::$binary) . ' --php' . - ' -d hhvm.php7.all=1'; - // @codeCoverageIgnoreEnd - } - - if (self::$binary === null && \PHP_BINARY !== '') { - self::$binary = \escapeshellarg(\PHP_BINARY); - } - - if (self::$binary === null) { - // @codeCoverageIgnoreStart - $possibleBinaryLocations = [ - \PHP_BINDIR . '/php', - \PHP_BINDIR . '/php-cli.exe', - \PHP_BINDIR . '/php.exe', - ]; - - foreach ($possibleBinaryLocations as $binary) { - if (\is_readable($binary)) { - self::$binary = \escapeshellarg($binary); - - break; - } - } - // @codeCoverageIgnoreEnd - } - - if (self::$binary === null) { - // @codeCoverageIgnoreStart - self::$binary = 'php'; - // @codeCoverageIgnoreEnd - } - - return self::$binary; - } - - public function getNameWithVersion(): string - { - return $this->getName() . ' ' . $this->getVersion(); - } - - public function getNameWithVersionAndCodeCoverageDriver(): string - { - if (!$this->canCollectCodeCoverage() || $this->hasPHPDBGCodeCoverage()) { - return $this->getNameWithVersion(); - } - - if ($this->hasXdebug()) { - return \sprintf( - '%s with Xdebug %s', - $this->getNameWithVersion(), - \phpversion('xdebug') - ); - } - - if ($this->hasPCOV()) { - return \sprintf( - '%s with PCOV %s', - $this->getNameWithVersion(), - \phpversion('pcov') - ); - } - } - - public function getName(): string - { - if ($this->isHHVM()) { - // @codeCoverageIgnoreStart - return 'HHVM'; - // @codeCoverageIgnoreEnd - } - - if ($this->isPHPDBG()) { - // @codeCoverageIgnoreStart - return 'PHPDBG'; - // @codeCoverageIgnoreEnd - } - - return 'PHP'; - } - - public function getVendorUrl(): string - { - if ($this->isHHVM()) { - // @codeCoverageIgnoreStart - return 'http://hhvm.com/'; - // @codeCoverageIgnoreEnd - } - - return 'https://secure.php.net/'; - } - - public function getVersion(): string - { - if ($this->isHHVM()) { - // @codeCoverageIgnoreStart - return HHVM_VERSION; - // @codeCoverageIgnoreEnd - } - - return \PHP_VERSION; - } - - /** - * Returns true when the runtime used is PHP and Xdebug is loaded. - */ - public function hasXdebug(): bool - { - return ($this->isPHP() || $this->isHHVM()) && \extension_loaded('xdebug'); - } - - /** - * Returns true when the runtime used is HHVM. - */ - public function isHHVM(): bool - { - return \defined('HHVM_VERSION'); - } - - /** - * Returns true when the runtime used is PHP without the PHPDBG SAPI. - */ - public function isPHP(): bool - { - return !$this->isHHVM() && !$this->isPHPDBG(); - } - - /** - * Returns true when the runtime used is PHP with the PHPDBG SAPI. - */ - public function isPHPDBG(): bool - { - return \PHP_SAPI === 'phpdbg' && !$this->isHHVM(); - } - - /** - * Returns true when the runtime used is PHP with the PHPDBG SAPI - * and the phpdbg_*_oplog() functions are available (PHP >= 7.0). - */ - public function hasPHPDBGCodeCoverage(): bool - { - return $this->isPHPDBG(); - } - - /** - * Returns true when the runtime used is PHP with PCOV loaded and enabled - */ - public function hasPCOV(): bool - { - return $this->isPHP() && \extension_loaded('pcov') && \ini_get('pcov.enabled'); - } - - /** - * Parses the loaded php.ini file (if any) as well as all - * additional php.ini files from the additional ini dir for - * a list of all configuration settings loaded from files - * at startup. Then checks for each php.ini setting passed - * via the `$values` parameter whether this setting has - * been changed at runtime. Returns an array of strings - * where each string has the format `key=value` denoting - * the name of a changed php.ini setting with its new value. - * - * @return string[] - */ - public function getCurrentSettings(array $values): array - { - $diff = []; - $files = []; - - if ($file = \php_ini_loaded_file()) { - $files[] = $file; - } - - if ($scanned = \php_ini_scanned_files()) { - $files = \array_merge( - $files, - \array_map( - 'trim', - \explode(",\n", $scanned) - ) - ); - } - - foreach ($files as $ini) { - $config = \parse_ini_file($ini, true); - - foreach ($values as $value) { - $set = \ini_get($value); - - if (isset($config[$value]) && $set != $config[$value]) { - $diff[] = \sprintf('%s=%s', $value, $set); - } - } - } - - return $diff; - } -} diff --git a/vendor/sebastian/environment/tests/ConsoleTest.php b/vendor/sebastian/environment/tests/ConsoleTest.php deleted file mode 100644 index e7f6704..0000000 --- a/vendor/sebastian/environment/tests/ConsoleTest.php +++ /dev/null @@ -1,64 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Environment; - -use PHPUnit\Framework\TestCase; - -/** - * @covers \SebastianBergmann\Environment\Console - */ -final class ConsoleTest extends TestCase -{ - /** - * @var \SebastianBergmann\Environment\Console - */ - private $console; - - protected function setUp(): void - { - $this->console = new Console; - } - - /** - * @todo Now that this component is PHP 7-only and uses return type declarations - * this test makes even less sense than before - */ - public function testCanDetectIfStdoutIsInteractiveByDefault(): void - { - $this->assertIsBool($this->console->isInteractive()); - } - - /** - * @todo Now that this component is PHP 7-only and uses return type declarations - * this test makes even less sense than before - */ - public function testCanDetectIfFileDescriptorIsInteractive(): void - { - $this->assertIsBool($this->console->isInteractive(\STDOUT)); - } - - /** - * @todo Now that this component is PHP 7-only and uses return type declarations - * this test makes even less sense than before - */ - public function testCanDetectColorSupport(): void - { - $this->assertIsBool($this->console->hasColorSupport()); - } - - /** - * @todo Now that this component is PHP 7-only and uses return type declarations - * this test makes even less sense than before - */ - public function testCanDetectNumberOfColumns(): void - { - $this->assertIsInt($this->console->getNumberOfColumns()); - } -} diff --git a/vendor/sebastian/environment/tests/OperatingSystemTest.php b/vendor/sebastian/environment/tests/OperatingSystemTest.php deleted file mode 100644 index f48618e..0000000 --- a/vendor/sebastian/environment/tests/OperatingSystemTest.php +++ /dev/null @@ -1,60 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Environment; - -use PHPUnit\Framework\TestCase; - -/** - * @covers \SebastianBergmann\Environment\OperatingSystem - */ -final class OperatingSystemTest extends TestCase -{ - /** - * @var \SebastianBergmann\Environment\OperatingSystem - */ - private $os; - - protected function setUp(): void - { - $this->os = new OperatingSystem; - } - - /** - * @requires OS Linux - */ - public function testFamilyCanBeRetrieved(): void - { - $this->assertEquals('Linux', $this->os->getFamily()); - } - - /** - * @requires OS Darwin - */ - public function testFamilyReturnsDarwinWhenRunningOnDarwin(): void - { - $this->assertEquals('Darwin', $this->os->getFamily()); - } - - /** - * @requires OS Windows - */ - public function testGetFamilyReturnsWindowsWhenRunningOnWindows(): void - { - $this->assertSame('Windows', $this->os->getFamily()); - } - - /** - * @requires PHP 7.2.0 - */ - public function testGetFamilyReturnsPhpOsFamilyWhenRunningOnPhp72AndGreater(): void - { - $this->assertSame(\PHP_OS_FAMILY, $this->os->getFamily()); - } -} diff --git a/vendor/sebastian/environment/tests/RuntimeTest.php b/vendor/sebastian/environment/tests/RuntimeTest.php deleted file mode 100644 index 12be2e5..0000000 --- a/vendor/sebastian/environment/tests/RuntimeTest.php +++ /dev/null @@ -1,165 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Environment; - -use PHPUnit\Framework\TestCase; - -/** - * @covers \SebastianBergmann\Environment\Runtime - */ -final class RuntimeTest extends TestCase -{ - /** - * @var \SebastianBergmann\Environment\Runtime - */ - private $env; - - protected function setUp(): void - { - $this->env = new Runtime; - } - - /** - * @requires extension xdebug - */ - public function testCanCollectCodeCoverageWhenXdebugExtensionIsEnabled(): void - { - $this->assertTrue($this->env->canCollectCodeCoverage()); - } - - /** - * @requires extension pcov - */ - public function testCanCollectCodeCoverageWhenPcovExtensionIsEnabled(): void - { - $this->assertTrue($this->env->canCollectCodeCoverage()); - } - - public function testCanCollectCodeCoverageWhenRunningOnPhpdbg(): void - { - $this->markTestSkippedWhenNotRunningOnPhpdbg(); - - $this->assertTrue($this->env->canCollectCodeCoverage()); - } - - public function testBinaryCanBeRetrieved(): void - { - $this->assertNotEmpty($this->env->getBinary()); - } - - /** - * @requires PHP - */ - public function testIsHhvmReturnsFalseWhenRunningOnPhp(): void - { - $this->assertFalse($this->env->isHHVM()); - } - - /** - * @requires PHP - */ - public function testIsPhpReturnsTrueWhenRunningOnPhp(): void - { - $this->markTestSkippedWhenRunningOnPhpdbg(); - - $this->assertTrue($this->env->isPHP()); - } - - /** - * @requires extension pcov - */ - public function testPCOVCanBeDetected(): void - { - $this->assertTrue($this->env->hasPCOV()); - } - - public function testPhpdbgCanBeDetected(): void - { - $this->markTestSkippedWhenNotRunningOnPhpdbg(); - - $this->assertTrue($this->env->hasPHPDBGCodeCoverage()); - } - - /** - * @requires extension xdebug - */ - public function testXdebugCanBeDetected(): void - { - $this->markTestSkippedWhenRunningOnPhpdbg(); - - $this->assertTrue($this->env->hasXdebug()); - } - - public function testNameAndVersionCanBeRetrieved(): void - { - $this->assertNotEmpty($this->env->getNameWithVersion()); - } - - public function testGetNameReturnsPhpdbgWhenRunningOnPhpdbg(): void - { - $this->markTestSkippedWhenNotRunningOnPhpdbg(); - - $this->assertSame('PHPDBG', $this->env->getName()); - } - - /** - * @requires PHP - */ - public function testGetNameReturnsPhpdbgWhenRunningOnPhp(): void - { - $this->markTestSkippedWhenRunningOnPhpdbg(); - - $this->assertSame('PHP', $this->env->getName()); - } - - public function testNameAndCodeCoverageDriverCanBeRetrieved(): void - { - $this->assertNotEmpty($this->env->getNameWithVersionAndCodeCoverageDriver()); - } - - /** - * @requires PHP - */ - public function testGetVersionReturnsPhpVersionWhenRunningPhp(): void - { - $this->assertSame(\PHP_VERSION, $this->env->getVersion()); - } - - /** - * @requires PHP - */ - public function testGetVendorUrlReturnsPhpDotNetWhenRunningPhp(): void - { - $this->assertSame('https://secure.php.net/', $this->env->getVendorUrl()); - } - - private function markTestSkippedWhenNotRunningOnPhpdbg(): void - { - if ($this->isRunningOnPhpdbg()) { - return; - } - - $this->markTestSkipped('PHPDBG is required.'); - } - - private function markTestSkippedWhenRunningOnPhpdbg(): void - { - if (!$this->isRunningOnPhpdbg()) { - return; - } - - $this->markTestSkipped('Cannot run on PHPDBG'); - } - - private function isRunningOnPhpdbg(): bool - { - return \PHP_SAPI === 'phpdbg'; - } -} diff --git a/vendor/sebastian/exporter/ChangeLog.md b/vendor/sebastian/exporter/ChangeLog.md deleted file mode 100644 index 5d84c29..0000000 --- a/vendor/sebastian/exporter/ChangeLog.md +++ /dev/null @@ -1,29 +0,0 @@ -# ChangeLog - -All notable changes are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. - -## [3.1.4] - 2021-11-11 - -### Changed - -* [#38](https://github.com/sebastianbergmann/exporter/pull/38): Improve export of closed resources - -## [3.1.3] - 2020-11-30 - -### Changed - -* Changed PHP version constraint in `composer.json` from `^7.0` to `>=7.0` - -## [3.1.2] - 2019-09-14 - -### Fixed - -* [#29](https://github.com/sebastianbergmann/exporter/pull/29): Second parameter for `str_repeat()` must be an integer - -### Removed - -* Remove HHVM-specific code that is no longer needed - -[3.1.4]: https://github.com/sebastianbergmann/exporter/compare/3.1.3...3.1.4 -[3.1.3]: https://github.com/sebastianbergmann/exporter/compare/3.1.2...3.1.3 -[3.1.2]: https://github.com/sebastianbergmann/exporter/compare/3.1.1...3.1.2 diff --git a/vendor/sebastian/exporter/LICENSE b/vendor/sebastian/exporter/LICENSE deleted file mode 100644 index 26dc7fe..0000000 --- a/vendor/sebastian/exporter/LICENSE +++ /dev/null @@ -1,33 +0,0 @@ -Exporter - -Copyright (c) 2002-2021, Sebastian Bergmann . -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Sebastian Bergmann nor the names of his - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/sebastian/exporter/README.md b/vendor/sebastian/exporter/README.md deleted file mode 100644 index e5b67f2..0000000 --- a/vendor/sebastian/exporter/README.md +++ /dev/null @@ -1,169 +0,0 @@ -Exporter -======== - -This component provides the functionality to export PHP variables for visualization. - -## Usage - -Exporting: - -```php - '' - 'string' => '' - 'code' => 0 - 'file' => '/home/sebastianbergmann/test.php' - 'line' => 34 - 'previous' => null -) -*/ - -print $exporter->export(new Exception); -``` - -## Data Types - -Exporting simple types: - -```php -export(46); - -// 4.0 -print $exporter->export(4.0); - -// 'hello, world!' -print $exporter->export('hello, world!'); - -// false -print $exporter->export(false); - -// NAN -print $exporter->export(acos(8)); - -// -INF -print $exporter->export(log(0)); - -// null -print $exporter->export(null); - -// resource(13) of type (stream) -print $exporter->export(fopen('php://stderr', 'w')); - -// Binary String: 0x000102030405 -print $exporter->export(chr(0) . chr(1) . chr(2) . chr(3) . chr(4) . chr(5)); -``` - -Exporting complex types: - -```php - Array &1 ( - 0 => 1 - 1 => 2 - 2 => 3 - ) - 1 => Array &2 ( - 0 => '' - 1 => 0 - 2 => false - ) -) -*/ - -print $exporter->export(array(array(1,2,3), array("",0,FALSE))); - -/* -Array &0 ( - 'self' => Array &1 ( - 'self' => Array &1 - ) -) -*/ - -$array = array(); -$array['self'] = &$array; -print $exporter->export($array); - -/* -stdClass Object &0000000003a66dcc0000000025e723e2 ( - 'self' => stdClass Object &0000000003a66dcc0000000025e723e2 -) -*/ - -$obj = new stdClass(); -$obj->self = $obj; -print $exporter->export($obj); -``` - -Compact exports: - -```php -shortenedExport(array()); - -// Array (...) -print $exporter->shortenedExport(array(1,2,3,4,5)); - -// stdClass Object () -print $exporter->shortenedExport(new stdClass); - -// Exception Object (...) -print $exporter->shortenedExport(new Exception); - -// this\nis\na\nsuper\nlong\nstring\nt...\nspace -print $exporter->shortenedExport( -<<=7.0", - "sebastian/recursion-context": "^3.0" - }, - "require-dev": { - "phpunit/phpunit": "^8.5", - "ext-mbstring": "*" - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "3.1.x-dev" - } - } -} - diff --git a/vendor/sebastian/exporter/src/Exporter.php b/vendor/sebastian/exporter/src/Exporter.php deleted file mode 100644 index 41714d9..0000000 --- a/vendor/sebastian/exporter/src/Exporter.php +++ /dev/null @@ -1,366 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Exporter; - -use SebastianBergmann\RecursionContext\Context; - -/** - * A nifty utility for visualizing PHP variables. - * - * - * export(new Exception); - * - */ -class Exporter -{ - /** - * Exports a value as a string - * - * The output of this method is similar to the output of print_r(), but - * improved in various aspects: - * - * - NULL is rendered as "null" (instead of "") - * - TRUE is rendered as "true" (instead of "1") - * - FALSE is rendered as "false" (instead of "") - * - Strings are always quoted with single quotes - * - Carriage returns and newlines are normalized to \n - * - Recursion and repeated rendering is treated properly - * - * @param int $indentation The indentation level of the 2nd+ line - * - * @return string - */ - public function export($value, $indentation = 0) - { - return $this->recursiveExport($value, $indentation); - } - - /** - * @param array $data - * @param Context $context - * - * @return string - */ - public function shortenedRecursiveExport(&$data, Context $context = null) - { - $result = []; - $exporter = new self(); - - if (!$context) { - $context = new Context; - } - - $array = $data; - $context->add($data); - - foreach ($array as $key => $value) { - if (\is_array($value)) { - if ($context->contains($data[$key]) !== false) { - $result[] = '*RECURSION*'; - } else { - $result[] = \sprintf( - 'array(%s)', - $this->shortenedRecursiveExport($data[$key], $context) - ); - } - } else { - $result[] = $exporter->shortenedExport($value); - } - } - - return \implode(', ', $result); - } - - /** - * Exports a value into a single-line string - * - * The output of this method is similar to the output of - * SebastianBergmann\Exporter\Exporter::export(). - * - * Newlines are replaced by the visible string '\n'. - * Contents of arrays and objects (if any) are replaced by '...'. - * - * @return string - * - * @see SebastianBergmann\Exporter\Exporter::export - */ - public function shortenedExport($value) - { - if (\is_string($value)) { - $string = \str_replace("\n", '', $this->export($value)); - - if (\function_exists('mb_strlen')) { - if (\mb_strlen($string) > 40) { - $string = \mb_substr($string, 0, 30) . '...' . \mb_substr($string, -7); - } - } else { - if (\strlen($string) > 40) { - $string = \substr($string, 0, 30) . '...' . \substr($string, -7); - } - } - - return $string; - } - - if (\is_object($value)) { - return \sprintf( - '%s Object (%s)', - \get_class($value), - \count($this->toArray($value)) > 0 ? '...' : '' - ); - } - - if (\is_array($value)) { - return \sprintf( - 'Array (%s)', - \count($value) > 0 ? '...' : '' - ); - } - - return $this->export($value); - } - - /** - * Converts an object to an array containing all of its private, protected - * and public properties. - * - * @return array - */ - public function toArray($value) - { - if (!\is_object($value)) { - return (array) $value; - } - - $array = []; - - foreach ((array) $value as $key => $val) { - // Exception traces commonly reference hundreds to thousands of - // objects currently loaded in memory. Including them in the result - // has a severe negative performance impact. - if ("\0Error\0trace" === $key || "\0Exception\0trace" === $key) { - continue; - } - - // properties are transformed to keys in the following way: - // private $property => "\0Classname\0property" - // protected $property => "\0*\0property" - // public $property => "property" - if (\preg_match('/^\0.+\0(.+)$/', (string) $key, $matches)) { - $key = $matches[1]; - } - - // See https://github.com/php/php-src/commit/5721132 - if ($key === "\0gcdata") { - continue; - } - - $array[$key] = $val; - } - - // Some internal classes like SplObjectStorage don't work with the - // above (fast) mechanism nor with reflection in Zend. - // Format the output similarly to print_r() in this case - if ($value instanceof \SplObjectStorage) { - foreach ($value as $key => $val) { - $array[\spl_object_hash($val)] = [ - 'obj' => $val, - 'inf' => $value->getInfo(), - ]; - } - } - - return $array; - } - - /** - * Recursive implementation of export - * - * @param mixed $value The value to export - * @param int $indentation The indentation level of the 2nd+ line - * @param \SebastianBergmann\RecursionContext\Context $processed Previously processed objects - * - * @return string - * - * @see SebastianBergmann\Exporter\Exporter::export - */ - protected function recursiveExport(&$value, $indentation, $processed = null) - { - if ($value === null) { - return 'null'; - } - - if ($value === true) { - return 'true'; - } - - if ($value === false) { - return 'false'; - } - - if (\is_float($value) && (float) ((int) $value) === $value) { - return "$value.0"; - } - - if ($this->isClosedResource($value)) { - return 'resource (closed)'; - } - - if (\is_resource($value)) { - return \sprintf( - 'resource(%d) of type (%s)', - $value, - \get_resource_type($value) - ); - } - - if (\is_string($value)) { - // Match for most non printable chars somewhat taking multibyte chars into account - if (\preg_match('/[^\x09-\x0d\x1b\x20-\xff]/', $value)) { - return 'Binary String: 0x' . \bin2hex($value); - } - - return "'" . - \str_replace( - '', - "\n", - \str_replace( - ["\r\n", "\n\r", "\r", "\n"], - ['\r\n', '\n\r', '\r', '\n'], - $value - ) - ) . - "'"; - } - - $whitespace = \str_repeat(' ', (int)(4 * $indentation)); - - if (!$processed) { - $processed = new Context; - } - - if (\is_array($value)) { - if (($key = $processed->contains($value)) !== false) { - return 'Array &' . $key; - } - - $array = $value; - $key = $processed->add($value); - $values = ''; - - if (\count($array) > 0) { - foreach ($array as $k => $v) { - $values .= \sprintf( - '%s %s => %s' . "\n", - $whitespace, - $this->recursiveExport($k, $indentation), - $this->recursiveExport($value[$k], $indentation + 1, $processed) - ); - } - - $values = "\n" . $values . $whitespace; - } - - return \sprintf('Array &%s (%s)', $key, $values); - } - - if (\is_object($value)) { - $class = \get_class($value); - - if ($hash = $processed->contains($value)) { - return \sprintf('%s Object &%s', $class, $hash); - } - - $hash = $processed->add($value); - $values = ''; - $array = $this->toArray($value); - - if (\count($array) > 0) { - foreach ($array as $k => $v) { - $values .= \sprintf( - '%s %s => %s' . "\n", - $whitespace, - $this->recursiveExport($k, $indentation), - $this->recursiveExport($v, $indentation + 1, $processed) - ); - } - - $values = "\n" . $values . $whitespace; - } - - return \sprintf('%s Object &%s (%s)', $class, $hash, $values); - } - - return \var_export($value, true); - } - - /** - * Determines whether a variable represents a resource, either open or closed. - * - * @param mixed $actual The variable to test. - * - * @return bool - */ - private function isResource($value) - { - return $value !== null - && \is_scalar($value) === false - && \is_array($value) === false - && \is_object($value) === false; - } - - /** - * Determines whether a variable represents a closed resource. - * - * @param mixed $actual The variable to test. - * - * @return bool - */ - private function isClosedResource($value) - { - /* - * PHP 7.2 introduced "resource (closed)". - */ - if (\gettype($value) === 'resource (closed)') { - return true; - } - - /* - * If gettype did not work, attempt to determine whether this is - * a closed resource in another way. - */ - $isResource = \is_resource($value); - $isNotNonResource = $this->isResource($value); - - if ($isResource === false && $isNotNonResource === true) { - return true; - } - - if ($isNotNonResource === true) { - try { - $resourceType = @\get_resource_type($value); - - if ($resourceType === 'Unknown') { - return true; - } - } catch (TypeError $e) { - // Ignore. Not a resource. - } catch (Exception $e) { - // Ignore. Not a resource. - } - } - - return false; - } -} diff --git a/vendor/sebastian/global-state/.github/stale.yml b/vendor/sebastian/global-state/.github/stale.yml deleted file mode 100644 index 4eadca3..0000000 --- a/vendor/sebastian/global-state/.github/stale.yml +++ /dev/null @@ -1,40 +0,0 @@ -# Configuration for probot-stale - https://github.com/probot/stale - -# Number of days of inactivity before an Issue or Pull Request becomes stale -daysUntilStale: 60 - -# Number of days of inactivity before a stale Issue or Pull Request is closed. -# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale. -daysUntilClose: 7 - -# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable -exemptLabels: - - enhancement - -# Set to true to ignore issues in a project (defaults to false) -exemptProjects: false - -# Set to true to ignore issues in a milestone (defaults to false) -exemptMilestones: false - -# Label to use when marking as stale -staleLabel: stale - -# Comment to post when marking as stale. Set to `false` to disable -markComment: > - This issue has been automatically marked as stale because it has not had activity within the last 60 days. It will be closed after 7 days if no further activity occurs. Thank you for your contributions. - -# Comment to post when removing the stale label. -# unmarkComment: > -# Your comment here. - -# Comment to post when closing a stale Issue or Pull Request. -closeComment: > - This issue has been automatically closed because it has not had activity since it was marked as stale. Thank you for your contributions. - -# Limit the number of actions per hour, from 1-30. Default is 30 -limitPerRun: 30 - -# Limit to only `issues` or `pulls` -only: issues - diff --git a/vendor/sebastian/global-state/.gitignore b/vendor/sebastian/global-state/.gitignore deleted file mode 100644 index 96c0f28..0000000 --- a/vendor/sebastian/global-state/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/.idea -/.php_cs -/.php_cs.cache -/.phpunit.result.cache -/composer.lock -/vendor diff --git a/vendor/sebastian/global-state/.php_cs.dist b/vendor/sebastian/global-state/.php_cs.dist deleted file mode 100644 index c42d7e8..0000000 --- a/vendor/sebastian/global-state/.php_cs.dist +++ /dev/null @@ -1,197 +0,0 @@ - - -For the full copyright and license information, please view the LICENSE -file that was distributed with this source code. -EOF; - -return PhpCsFixer\Config::create() - ->setRiskyAllowed(true) - ->setRules( - [ - 'align_multiline_comment' => true, - 'array_indentation' => true, - 'array_syntax' => ['syntax' => 'short'], - 'binary_operator_spaces' => [ - 'operators' => [ - '=' => 'align', - '=>' => 'align', - ], - ], - 'blank_line_after_namespace' => true, - 'blank_line_before_statement' => [ - 'statements' => [ - 'break', - 'continue', - 'declare', - 'do', - 'for', - 'foreach', - 'if', - 'include', - 'include_once', - 'require', - 'require_once', - 'return', - 'switch', - 'throw', - 'try', - 'while', - 'yield', - ], - ], - 'braces' => true, - 'cast_spaces' => true, - 'class_attributes_separation' => ['elements' => ['const', 'method', 'property']], - 'combine_consecutive_issets' => true, - 'combine_consecutive_unsets' => true, - 'compact_nullable_typehint' => true, - 'concat_space' => ['spacing' => 'one'], - 'declare_equal_normalize' => ['space' => 'none'], - 'declare_strict_types' => true, - 'dir_constant' => true, - 'elseif' => true, - 'encoding' => true, - 'full_opening_tag' => true, - 'function_declaration' => true, - 'header_comment' => ['header' => $header, 'separate' => 'none'], - 'indentation_type' => true, - 'is_null' => true, - 'line_ending' => true, - 'list_syntax' => ['syntax' => 'short'], - 'logical_operators' => true, - 'lowercase_cast' => true, - 'lowercase_constants' => true, - 'lowercase_keywords' => true, - 'lowercase_static_reference' => true, - 'magic_constant_casing' => true, - 'method_argument_space' => ['ensure_fully_multiline' => true], - 'modernize_types_casting' => true, - 'multiline_comment_opening_closing' => true, - 'multiline_whitespace_before_semicolons' => true, - 'native_constant_invocation' => true, - 'native_function_casing' => true, - 'native_function_invocation' => true, - 'new_with_braces' => false, - 'no_alias_functions' => true, - 'no_alternative_syntax' => true, - 'no_blank_lines_after_class_opening' => true, - 'no_blank_lines_after_phpdoc' => true, - 'no_blank_lines_before_namespace' => true, - 'no_closing_tag' => true, - 'no_empty_comment' => true, - 'no_empty_phpdoc' => true, - 'no_empty_statement' => true, - 'no_extra_blank_lines' => true, - 'no_homoglyph_names' => true, - 'no_leading_import_slash' => true, - 'no_leading_namespace_whitespace' => true, - 'no_mixed_echo_print' => ['use' => 'print'], - 'no_multiline_whitespace_around_double_arrow' => true, - 'no_null_property_initialization' => true, - 'no_php4_constructor' => true, - 'no_short_bool_cast' => true, - 'no_short_echo_tag' => true, - 'no_singleline_whitespace_before_semicolons' => true, - 'no_spaces_after_function_name' => true, - 'no_spaces_inside_parenthesis' => true, - 'no_superfluous_elseif' => true, - 'no_superfluous_phpdoc_tags' => true, - 'no_trailing_comma_in_list_call' => true, - 'no_trailing_comma_in_singleline_array' => true, - 'no_trailing_whitespace' => true, - 'no_trailing_whitespace_in_comment' => true, - 'no_unneeded_control_parentheses' => true, - 'no_unneeded_curly_braces' => true, - 'no_unneeded_final_method' => true, - 'no_unreachable_default_argument_value' => true, - 'no_unset_on_property' => true, - 'no_unused_imports' => true, - 'no_useless_else' => true, - 'no_useless_return' => true, - 'no_whitespace_before_comma_in_array' => true, - 'no_whitespace_in_blank_line' => true, - 'non_printable_character' => true, - 'normalize_index_brace' => true, - 'object_operator_without_whitespace' => true, - 'ordered_class_elements' => [ - 'order' => [ - 'use_trait', - 'constant_public', - 'constant_protected', - 'constant_private', - 'property_public_static', - 'property_protected_static', - 'property_private_static', - 'property_public', - 'property_protected', - 'property_private', - 'method_public_static', - 'construct', - 'destruct', - 'magic', - 'phpunit', - 'method_public', - 'method_protected', - 'method_private', - 'method_protected_static', - 'method_private_static', - ], - ], - 'ordered_imports' => true, - 'phpdoc_add_missing_param_annotation' => true, - 'phpdoc_align' => true, - 'phpdoc_annotation_without_dot' => true, - 'phpdoc_indent' => true, - 'phpdoc_no_access' => true, - 'phpdoc_no_empty_return' => true, - 'phpdoc_no_package' => true, - 'phpdoc_order' => true, - 'phpdoc_return_self_reference' => true, - 'phpdoc_scalar' => true, - 'phpdoc_separation' => true, - 'phpdoc_single_line_var_spacing' => true, - 'phpdoc_to_comment' => true, - 'phpdoc_trim' => true, - 'phpdoc_trim_consecutive_blank_line_separation' => true, - 'phpdoc_types' => ['groups' => ['simple', 'meta']], - 'phpdoc_types_order' => true, - 'phpdoc_var_without_name' => true, - 'pow_to_exponentiation' => true, - 'protected_to_private' => true, - 'return_assignment' => true, - 'return_type_declaration' => ['space_before' => 'none'], - 'self_accessor' => true, - 'semicolon_after_instruction' => true, - 'set_type_to_cast' => true, - 'short_scalar_cast' => true, - 'simplified_null_return' => true, - 'single_blank_line_at_eof' => true, - 'single_import_per_statement' => true, - 'single_line_after_imports' => true, - 'single_quote' => true, - 'standardize_not_equals' => true, - 'ternary_to_null_coalescing' => true, - 'trailing_comma_in_multiline_array' => true, - 'trim_array_spaces' => true, - 'unary_operator_spaces' => true, - 'visibility_required' => [ - 'elements' => [ - 'const', - 'method', - 'property', - ], - ], - 'void_return' => true, - 'whitespace_after_comma_in_array' => true, - ] - ) - ->setFinder( - PhpCsFixer\Finder::create() - ->files() - ->in(__DIR__ . '/src') - ->in(__DIR__ . '/tests') - ); diff --git a/vendor/sebastian/global-state/.travis.yml b/vendor/sebastian/global-state/.travis.yml deleted file mode 100644 index 3a84127..0000000 --- a/vendor/sebastian/global-state/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -language: php - -php: - - 7.2 - - 7.3 - - master - -sudo: false - -before_install: - - composer self-update - - composer clear-cache - -install: - - travis_retry composer update --no-interaction --no-ansi --no-progress --no-suggest - -script: - - ./vendor/bin/phpunit --coverage-clover=coverage.xml - -after_success: - - bash <(curl -s https://codecov.io/bash) - -notifications: - email: false diff --git a/vendor/sebastian/global-state/ChangeLog.md b/vendor/sebastian/global-state/ChangeLog.md deleted file mode 100644 index 095cd55..0000000 --- a/vendor/sebastian/global-state/ChangeLog.md +++ /dev/null @@ -1,23 +0,0 @@ -# Changes in sebastian/global-state - -All notable changes in `sebastian/global-state` are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. - -## [3.0.1] - 2020-11-30 - -### Changed - -* Changed PHP version constraint in `composer.json` from `^7.2` to `>=7.2` - -## [3.0.0] - 2019-02-01 - -### Changed - -* `Snapshot::canBeSerialized()` now recursively checks arrays and object graphs for variables that cannot be serialized - -### Removed - -* This component is no longer supported on PHP 7.0 and PHP 7.1 - -[3.0.1]: https://github.com/sebastianbergmann/phpunit/compare/3.0.0...3.0.1 -[3.0.0]: https://github.com/sebastianbergmann/phpunit/compare/2.0.0...3.0.0 - diff --git a/vendor/sebastian/global-state/LICENSE b/vendor/sebastian/global-state/LICENSE deleted file mode 100644 index 1756a1f..0000000 --- a/vendor/sebastian/global-state/LICENSE +++ /dev/null @@ -1,33 +0,0 @@ -sebastian/global-state - -Copyright (c) 2001-2019, Sebastian Bergmann . -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Sebastian Bergmann nor the names of his - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/sebastian/global-state/README.md b/vendor/sebastian/global-state/README.md deleted file mode 100644 index a804f85..0000000 --- a/vendor/sebastian/global-state/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# global-state - -Snapshotting of global state, factored out of PHPUnit into a stand-alone component. - -[![Build Status](https://travis-ci.org/sebastianbergmann/global-state.svg?branch=master)](https://travis-ci.org/sebastianbergmann/global-state) - -## Installation - -You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): - - composer require sebastian/global-state - -If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: - - composer require --dev sebastian/global-state - diff --git a/vendor/sebastian/global-state/build.xml b/vendor/sebastian/global-state/build.xml deleted file mode 100644 index 35c1790..0000000 --- a/vendor/sebastian/global-state/build.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/vendor/sebastian/global-state/composer.json b/vendor/sebastian/global-state/composer.json deleted file mode 100644 index 0cbc33d..0000000 --- a/vendor/sebastian/global-state/composer.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "sebastian/global-state", - "description": "Snapshotting of global state", - "keywords": ["global state"], - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "prefer-stable": true, - "config": { - "optimize-autoloader": true, - "sort-packages": true - }, - "require": { - "php": ">=7.2", - "sebastian/object-reflector": "^1.1.1", - "sebastian/recursion-context": "^3.0" - }, - "require-dev": { - "ext-dom": "*", - "phpunit/phpunit": "^8.0" - }, - "suggest": { - "ext-uopz": "*" - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "autoload-dev": { - "classmap": [ - "tests/_fixture/" - ], - "files": [ - "tests/_fixture/SnapshotFunctions.php" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - } -} diff --git a/vendor/sebastian/global-state/phpunit.xml b/vendor/sebastian/global-state/phpunit.xml deleted file mode 100644 index c02c9bc..0000000 --- a/vendor/sebastian/global-state/phpunit.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - tests - - - - - - - - - - - src - - - diff --git a/vendor/sebastian/global-state/src/Blacklist.php b/vendor/sebastian/global-state/src/Blacklist.php deleted file mode 100644 index ce8f25c..0000000 --- a/vendor/sebastian/global-state/src/Blacklist.php +++ /dev/null @@ -1,118 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\GlobalState; - -/** - * A blacklist for global state elements that should not be snapshotted. - */ -final class Blacklist -{ - /** - * @var array - */ - private $globalVariables = []; - - /** - * @var string[] - */ - private $classes = []; - - /** - * @var string[] - */ - private $classNamePrefixes = []; - - /** - * @var string[] - */ - private $parentClasses = []; - - /** - * @var string[] - */ - private $interfaces = []; - - /** - * @var array - */ - private $staticAttributes = []; - - public function addGlobalVariable(string $variableName): void - { - $this->globalVariables[$variableName] = true; - } - - public function addClass(string $className): void - { - $this->classes[] = $className; - } - - public function addSubclassesOf(string $className): void - { - $this->parentClasses[] = $className; - } - - public function addImplementorsOf(string $interfaceName): void - { - $this->interfaces[] = $interfaceName; - } - - public function addClassNamePrefix(string $classNamePrefix): void - { - $this->classNamePrefixes[] = $classNamePrefix; - } - - public function addStaticAttribute(string $className, string $attributeName): void - { - if (!isset($this->staticAttributes[$className])) { - $this->staticAttributes[$className] = []; - } - - $this->staticAttributes[$className][$attributeName] = true; - } - - public function isGlobalVariableBlacklisted(string $variableName): bool - { - return isset($this->globalVariables[$variableName]); - } - - public function isStaticAttributeBlacklisted(string $className, string $attributeName): bool - { - if (\in_array($className, $this->classes)) { - return true; - } - - foreach ($this->classNamePrefixes as $prefix) { - if (\strpos($className, $prefix) === 0) { - return true; - } - } - - $class = new \ReflectionClass($className); - - foreach ($this->parentClasses as $type) { - if ($class->isSubclassOf($type)) { - return true; - } - } - - foreach ($this->interfaces as $type) { - if ($class->implementsInterface($type)) { - return true; - } - } - - if (isset($this->staticAttributes[$className][$attributeName])) { - return true; - } - - return false; - } -} diff --git a/vendor/sebastian/global-state/src/CodeExporter.php b/vendor/sebastian/global-state/src/CodeExporter.php deleted file mode 100644 index 860457b..0000000 --- a/vendor/sebastian/global-state/src/CodeExporter.php +++ /dev/null @@ -1,91 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\GlobalState; - -/** - * Exports parts of a Snapshot as PHP code. - */ -final class CodeExporter -{ - public function constants(Snapshot $snapshot): string - { - $result = ''; - - foreach ($snapshot->constants() as $name => $value) { - $result .= \sprintf( - 'if (!defined(\'%s\')) define(\'%s\', %s);' . "\n", - $name, - $name, - $this->exportVariable($value) - ); - } - - return $result; - } - - public function globalVariables(Snapshot $snapshot): string - { - $result = '$GLOBALS = [];' . \PHP_EOL; - - foreach ($snapshot->globalVariables() as $name => $value) { - $result .= \sprintf( - '$GLOBALS[%s] = %s;' . \PHP_EOL, - $this->exportVariable($name), - $this->exportVariable($value) - ); - } - - return $result; - } - - public function iniSettings(Snapshot $snapshot): string - { - $result = ''; - - foreach ($snapshot->iniSettings() as $key => $value) { - $result .= \sprintf( - '@ini_set(%s, %s);' . "\n", - $this->exportVariable($key), - $this->exportVariable($value) - ); - } - - return $result; - } - - private function exportVariable($variable): string - { - if (\is_scalar($variable) || null === $variable || - (\is_array($variable) && $this->arrayOnlyContainsScalars($variable))) { - return \var_export($variable, true); - } - - return 'unserialize(' . \var_export(\serialize($variable), true) . ')'; - } - - private function arrayOnlyContainsScalars(array $array): bool - { - $result = true; - - foreach ($array as $element) { - if (\is_array($element)) { - $result = $this->arrayOnlyContainsScalars($element); - } elseif (!\is_scalar($element) && null !== $element) { - $result = false; - } - - if ($result === false) { - break; - } - } - - return $result; - } -} diff --git a/vendor/sebastian/global-state/src/Restorer.php b/vendor/sebastian/global-state/src/Restorer.php deleted file mode 100644 index ed55d9f..0000000 --- a/vendor/sebastian/global-state/src/Restorer.php +++ /dev/null @@ -1,132 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\GlobalState; - -/** - * Restorer of snapshots of global state. - */ -class Restorer -{ - /** - * Deletes function definitions that are not defined in a snapshot. - * - * @throws RuntimeException when the uopz_delete() function is not available - * - * @see https://github.com/krakjoe/uopz - */ - public function restoreFunctions(Snapshot $snapshot): void - { - if (!\function_exists('uopz_delete')) { - throw new RuntimeException('The uopz_delete() function is required for this operation'); - } - - $functions = \get_defined_functions(); - - foreach (\array_diff($functions['user'], $snapshot->functions()) as $function) { - uopz_delete($function); - } - } - - /** - * Restores all global and super-global variables from a snapshot. - */ - public function restoreGlobalVariables(Snapshot $snapshot): void - { - $superGlobalArrays = $snapshot->superGlobalArrays(); - - foreach ($superGlobalArrays as $superGlobalArray) { - $this->restoreSuperGlobalArray($snapshot, $superGlobalArray); - } - - $globalVariables = $snapshot->globalVariables(); - - foreach (\array_keys($GLOBALS) as $key) { - if ($key !== 'GLOBALS' && - !\in_array($key, $superGlobalArrays) && - !$snapshot->blacklist()->isGlobalVariableBlacklisted($key)) { - if (\array_key_exists($key, $globalVariables)) { - $GLOBALS[$key] = $globalVariables[$key]; - } else { - unset($GLOBALS[$key]); - } - } - } - } - - /** - * Restores all static attributes in user-defined classes from this snapshot. - */ - public function restoreStaticAttributes(Snapshot $snapshot): void - { - $current = new Snapshot($snapshot->blacklist(), false, false, false, false, true, false, false, false, false); - $newClasses = \array_diff($current->classes(), $snapshot->classes()); - - unset($current); - - foreach ($snapshot->staticAttributes() as $className => $staticAttributes) { - foreach ($staticAttributes as $name => $value) { - $reflector = new \ReflectionProperty($className, $name); - $reflector->setAccessible(true); - $reflector->setValue($value); - } - } - - foreach ($newClasses as $className) { - $class = new \ReflectionClass($className); - $defaults = $class->getDefaultProperties(); - - foreach ($class->getProperties() as $attribute) { - if (!$attribute->isStatic()) { - continue; - } - - $name = $attribute->getName(); - - if ($snapshot->blacklist()->isStaticAttributeBlacklisted($className, $name)) { - continue; - } - - if (!isset($defaults[$name])) { - continue; - } - - $attribute->setAccessible(true); - $attribute->setValue($defaults[$name]); - } - } - } - - /** - * Restores a super-global variable array from this snapshot. - */ - private function restoreSuperGlobalArray(Snapshot $snapshot, string $superGlobalArray): void - { - $superGlobalVariables = $snapshot->superGlobalVariables(); - - if (isset($GLOBALS[$superGlobalArray]) && - \is_array($GLOBALS[$superGlobalArray]) && - isset($superGlobalVariables[$superGlobalArray])) { - $keys = \array_keys( - \array_merge( - $GLOBALS[$superGlobalArray], - $superGlobalVariables[$superGlobalArray] - ) - ); - - foreach ($keys as $key) { - if (isset($superGlobalVariables[$superGlobalArray][$key])) { - $GLOBALS[$superGlobalArray][$key] = $superGlobalVariables[$superGlobalArray][$key]; - } else { - unset($GLOBALS[$superGlobalArray][$key]); - } - } - } - } -} diff --git a/vendor/sebastian/global-state/src/Snapshot.php b/vendor/sebastian/global-state/src/Snapshot.php deleted file mode 100644 index 5a0e5c7..0000000 --- a/vendor/sebastian/global-state/src/Snapshot.php +++ /dev/null @@ -1,419 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\GlobalState; - -use SebastianBergmann\ObjectReflector\ObjectReflector; -use SebastianBergmann\RecursionContext\Context; - -/** - * A snapshot of global state. - */ -class Snapshot -{ - /** - * @var Blacklist - */ - private $blacklist; - - /** - * @var array - */ - private $globalVariables = []; - - /** - * @var array - */ - private $superGlobalArrays = []; - - /** - * @var array - */ - private $superGlobalVariables = []; - - /** - * @var array - */ - private $staticAttributes = []; - - /** - * @var array - */ - private $iniSettings = []; - - /** - * @var array - */ - private $includedFiles = []; - - /** - * @var array - */ - private $constants = []; - - /** - * @var array - */ - private $functions = []; - - /** - * @var array - */ - private $interfaces = []; - - /** - * @var array - */ - private $classes = []; - - /** - * @var array - */ - private $traits = []; - - /** - * Creates a snapshot of the current global state. - */ - public function __construct(Blacklist $blacklist = null, bool $includeGlobalVariables = true, bool $includeStaticAttributes = true, bool $includeConstants = true, bool $includeFunctions = true, bool $includeClasses = true, bool $includeInterfaces = true, bool $includeTraits = true, bool $includeIniSettings = true, bool $includeIncludedFiles = true) - { - if ($blacklist === null) { - $blacklist = new Blacklist; - } - - $this->blacklist = $blacklist; - - if ($includeConstants) { - $this->snapshotConstants(); - } - - if ($includeFunctions) { - $this->snapshotFunctions(); - } - - if ($includeClasses || $includeStaticAttributes) { - $this->snapshotClasses(); - } - - if ($includeInterfaces) { - $this->snapshotInterfaces(); - } - - if ($includeGlobalVariables) { - $this->setupSuperGlobalArrays(); - $this->snapshotGlobals(); - } - - if ($includeStaticAttributes) { - $this->snapshotStaticAttributes(); - } - - if ($includeIniSettings) { - $this->iniSettings = \ini_get_all(null, false); - } - - if ($includeIncludedFiles) { - $this->includedFiles = \get_included_files(); - } - - $this->traits = \get_declared_traits(); - } - - public function blacklist(): Blacklist - { - return $this->blacklist; - } - - public function globalVariables(): array - { - return $this->globalVariables; - } - - public function superGlobalVariables(): array - { - return $this->superGlobalVariables; - } - - public function superGlobalArrays(): array - { - return $this->superGlobalArrays; - } - - public function staticAttributes(): array - { - return $this->staticAttributes; - } - - public function iniSettings(): array - { - return $this->iniSettings; - } - - public function includedFiles(): array - { - return $this->includedFiles; - } - - public function constants(): array - { - return $this->constants; - } - - public function functions(): array - { - return $this->functions; - } - - public function interfaces(): array - { - return $this->interfaces; - } - - public function classes(): array - { - return $this->classes; - } - - public function traits(): array - { - return $this->traits; - } - - /** - * Creates a snapshot user-defined constants. - */ - private function snapshotConstants(): void - { - $constants = \get_defined_constants(true); - - if (isset($constants['user'])) { - $this->constants = $constants['user']; - } - } - - /** - * Creates a snapshot user-defined functions. - */ - private function snapshotFunctions(): void - { - $functions = \get_defined_functions(); - - $this->functions = $functions['user']; - } - - /** - * Creates a snapshot user-defined classes. - */ - private function snapshotClasses(): void - { - foreach (\array_reverse(\get_declared_classes()) as $className) { - $class = new \ReflectionClass($className); - - if (!$class->isUserDefined()) { - break; - } - - $this->classes[] = $className; - } - - $this->classes = \array_reverse($this->classes); - } - - /** - * Creates a snapshot user-defined interfaces. - */ - private function snapshotInterfaces(): void - { - foreach (\array_reverse(\get_declared_interfaces()) as $interfaceName) { - $class = new \ReflectionClass($interfaceName); - - if (!$class->isUserDefined()) { - break; - } - - $this->interfaces[] = $interfaceName; - } - - $this->interfaces = \array_reverse($this->interfaces); - } - - /** - * Creates a snapshot of all global and super-global variables. - */ - private function snapshotGlobals(): void - { - $superGlobalArrays = $this->superGlobalArrays(); - - foreach ($superGlobalArrays as $superGlobalArray) { - $this->snapshotSuperGlobalArray($superGlobalArray); - } - - foreach (\array_keys($GLOBALS) as $key) { - if ($key !== 'GLOBALS' && - !\in_array($key, $superGlobalArrays) && - $this->canBeSerialized($GLOBALS[$key]) && - !$this->blacklist->isGlobalVariableBlacklisted($key)) { - /* @noinspection UnserializeExploitsInspection */ - $this->globalVariables[$key] = \unserialize(\serialize($GLOBALS[$key])); - } - } - } - - /** - * Creates a snapshot a super-global variable array. - */ - private function snapshotSuperGlobalArray(string $superGlobalArray): void - { - $this->superGlobalVariables[$superGlobalArray] = []; - - if (isset($GLOBALS[$superGlobalArray]) && \is_array($GLOBALS[$superGlobalArray])) { - foreach ($GLOBALS[$superGlobalArray] as $key => $value) { - /* @noinspection UnserializeExploitsInspection */ - $this->superGlobalVariables[$superGlobalArray][$key] = \unserialize(\serialize($value)); - } - } - } - - /** - * Creates a snapshot of all static attributes in user-defined classes. - */ - private function snapshotStaticAttributes(): void - { - foreach ($this->classes as $className) { - $class = new \ReflectionClass($className); - $snapshot = []; - - foreach ($class->getProperties() as $attribute) { - if ($attribute->isStatic()) { - $name = $attribute->getName(); - - if ($this->blacklist->isStaticAttributeBlacklisted($className, $name)) { - continue; - } - - $attribute->setAccessible(true); - $value = $attribute->getValue(); - - if ($this->canBeSerialized($value)) { - /* @noinspection UnserializeExploitsInspection */ - $snapshot[$name] = \unserialize(\serialize($value)); - } - } - } - - if (!empty($snapshot)) { - $this->staticAttributes[$className] = $snapshot; - } - } - } - - /** - * Returns a list of all super-global variable arrays. - */ - private function setupSuperGlobalArrays(): void - { - $this->superGlobalArrays = [ - '_ENV', - '_POST', - '_GET', - '_COOKIE', - '_SERVER', - '_FILES', - '_REQUEST', - ]; - } - - private function canBeSerialized($variable): bool - { - if (\is_scalar($variable) || $variable === null) { - return true; - } - - if (\is_resource($variable)) { - return false; - } - - foreach ($this->enumerateObjectsAndResources($variable) as $value) { - if (\is_resource($value)) { - return false; - } - - if (\is_object($value)) { - $class = new \ReflectionClass($value); - - if ($class->isAnonymous()) { - return false; - } - - try { - @\serialize($value); - } catch (\Throwable $t) { - return false; - } - } - } - - return true; - } - - private function enumerateObjectsAndResources($variable): array - { - if (isset(\func_get_args()[1])) { - $processed = \func_get_args()[1]; - } else { - $processed = new Context; - } - - $result = []; - - if ($processed->contains($variable)) { - return $result; - } - - $array = $variable; - $processed->add($variable); - - if (\is_array($variable)) { - foreach ($array as $element) { - if (!\is_array($element) && !\is_object($element) && !\is_resource($element)) { - continue; - } - - if (!\is_resource($element)) { - /** @noinspection SlowArrayOperationsInLoopInspection */ - $result = \array_merge( - $result, - $this->enumerateObjectsAndResources($element, $processed) - ); - } else { - $result[] = $element; - } - } - } else { - $result[] = $variable; - - foreach ((new ObjectReflector)->getAttributes($variable) as $value) { - if (!\is_array($value) && !\is_object($value) && !\is_resource($value)) { - continue; - } - - if (!\is_resource($value)) { - /** @noinspection SlowArrayOperationsInLoopInspection */ - $result = \array_merge( - $result, - $this->enumerateObjectsAndResources($value, $processed) - ); - } else { - $result[] = $value; - } - } - } - - return $result; - } -} diff --git a/vendor/sebastian/global-state/src/exceptions/Exception.php b/vendor/sebastian/global-state/src/exceptions/Exception.php deleted file mode 100644 index d8fd3c3..0000000 --- a/vendor/sebastian/global-state/src/exceptions/Exception.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\GlobalState; - -interface Exception -{ -} diff --git a/vendor/sebastian/global-state/src/exceptions/RuntimeException.php b/vendor/sebastian/global-state/src/exceptions/RuntimeException.php deleted file mode 100644 index 79f02a1..0000000 --- a/vendor/sebastian/global-state/src/exceptions/RuntimeException.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\GlobalState; - -final class RuntimeException extends \RuntimeException implements Exception -{ -} diff --git a/vendor/sebastian/global-state/tests/BlacklistTest.php b/vendor/sebastian/global-state/tests/BlacklistTest.php deleted file mode 100644 index 4d1b64d..0000000 --- a/vendor/sebastian/global-state/tests/BlacklistTest.php +++ /dev/null @@ -1,117 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\GlobalState; - -use PHPUnit\Framework\TestCase; -use SebastianBergmann\GlobalState\TestFixture\BlacklistedChildClass; -use SebastianBergmann\GlobalState\TestFixture\BlacklistedClass; -use SebastianBergmann\GlobalState\TestFixture\BlacklistedImplementor; -use SebastianBergmann\GlobalState\TestFixture\BlacklistedInterface; - -/** - * @covers \SebastianBergmann\GlobalState\Blacklist - */ -final class BlacklistTest extends TestCase -{ - /** - * @var \SebastianBergmann\GlobalState\Blacklist - */ - private $blacklist; - - protected function setUp(): void - { - $this->blacklist = new Blacklist; - } - - public function testGlobalVariableThatIsNotBlacklistedIsNotTreatedAsBlacklisted(): void - { - $this->assertFalse($this->blacklist->isGlobalVariableBlacklisted('variable')); - } - - public function testGlobalVariableCanBeBlacklisted(): void - { - $this->blacklist->addGlobalVariable('variable'); - - $this->assertTrue($this->blacklist->isGlobalVariableBlacklisted('variable')); - } - - public function testStaticAttributeThatIsNotBlacklistedIsNotTreatedAsBlacklisted(): void - { - $this->assertFalse( - $this->blacklist->isStaticAttributeBlacklisted( - BlacklistedClass::class, - 'attribute' - ) - ); - } - - public function testClassCanBeBlacklisted(): void - { - $this->blacklist->addClass(BlacklistedClass::class); - - $this->assertTrue( - $this->blacklist->isStaticAttributeBlacklisted( - BlacklistedClass::class, - 'attribute' - ) - ); - } - - public function testSubclassesCanBeBlacklisted(): void - { - $this->blacklist->addSubclassesOf(BlacklistedClass::class); - - $this->assertTrue( - $this->blacklist->isStaticAttributeBlacklisted( - BlacklistedChildClass::class, - 'attribute' - ) - ); - } - - public function testImplementorsCanBeBlacklisted(): void - { - $this->blacklist->addImplementorsOf(BlacklistedInterface::class); - - $this->assertTrue( - $this->blacklist->isStaticAttributeBlacklisted( - BlacklistedImplementor::class, - 'attribute' - ) - ); - } - - public function testClassNamePrefixesCanBeBlacklisted(): void - { - $this->blacklist->addClassNamePrefix('SebastianBergmann\GlobalState'); - - $this->assertTrue( - $this->blacklist->isStaticAttributeBlacklisted( - BlacklistedClass::class, - 'attribute' - ) - ); - } - - public function testStaticAttributeCanBeBlacklisted(): void - { - $this->blacklist->addStaticAttribute( - BlacklistedClass::class, - 'attribute' - ); - - $this->assertTrue( - $this->blacklist->isStaticAttributeBlacklisted( - BlacklistedClass::class, - 'attribute' - ) - ); - } -} diff --git a/vendor/sebastian/global-state/tests/CodeExporterTest.php b/vendor/sebastian/global-state/tests/CodeExporterTest.php deleted file mode 100644 index b121d7e..0000000 --- a/vendor/sebastian/global-state/tests/CodeExporterTest.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\GlobalState; - -use PHPUnit\Framework\TestCase; - -/** - * @covers \SebastianBergmann\GlobalState\CodeExporter - */ -final class CodeExporterTest extends TestCase -{ - /** - * @runInSeparateProcess - */ - public function testCanExportGlobalVariablesToCode(): void - { - $GLOBALS = ['foo' => 'bar']; - - $snapshot = new Snapshot(null, true, false, false, false, false, false, false, false, false); - - $exporter = new CodeExporter; - - $this->assertEquals( - '$GLOBALS = [];' . \PHP_EOL . '$GLOBALS[\'foo\'] = \'bar\';' . \PHP_EOL, - $exporter->globalVariables($snapshot) - ); - } -} diff --git a/vendor/sebastian/global-state/tests/RestorerTest.php b/vendor/sebastian/global-state/tests/RestorerTest.php deleted file mode 100644 index 6dcb94e..0000000 --- a/vendor/sebastian/global-state/tests/RestorerTest.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\GlobalState; - -use PHPUnit\Framework\TestCase; - -/** - * @covers \SebastianBergmann\GlobalState\Restorer - * - * @uses \SebastianBergmann\GlobalState\Blacklist - * @uses \SebastianBergmann\GlobalState\Snapshot - */ -final class RestorerTest extends TestCase -{ - public static function setUpBeforeClass(): void - { - $GLOBALS['varBool'] = false; - $GLOBALS['varNull'] = null; - $_GET['varGet'] = 0; - } - - public function testRestorerGlobalVariable(): void - { - $snapshot = new Snapshot(null, true, false, false, false, false, false, false, false, false); - $restorer = new Restorer; - $restorer->restoreGlobalVariables($snapshot); - - $this->assertArrayHasKey('varBool', $GLOBALS); - $this->assertEquals(false, $GLOBALS['varBool']); - $this->assertArrayHasKey('varNull', $GLOBALS); - $this->assertEquals(null, $GLOBALS['varNull']); - $this->assertArrayHasKey('varGet', $_GET); - $this->assertEquals(0, $_GET['varGet']); - } - - /** - * @backupGlobals enabled - */ - public function testIntegrationRestorerGlobalVariables(): void - { - $this->assertArrayHasKey('varBool', $GLOBALS); - $this->assertEquals(false, $GLOBALS['varBool']); - $this->assertArrayHasKey('varNull', $GLOBALS); - $this->assertEquals(null, $GLOBALS['varNull']); - $this->assertArrayHasKey('varGet', $_GET); - $this->assertEquals(0, $_GET['varGet']); - } - - /** - * @depends testIntegrationRestorerGlobalVariables - */ - public function testIntegrationRestorerGlobalVariables2(): void - { - $this->assertArrayHasKey('varBool', $GLOBALS); - $this->assertEquals(false, $GLOBALS['varBool']); - $this->assertArrayHasKey('varNull', $GLOBALS); - $this->assertEquals(null, $GLOBALS['varNull']); - $this->assertArrayHasKey('varGet', $_GET); - $this->assertEquals(0, $_GET['varGet']); - } -} diff --git a/vendor/sebastian/global-state/tests/SnapshotTest.php b/vendor/sebastian/global-state/tests/SnapshotTest.php deleted file mode 100644 index 56d5849..0000000 --- a/vendor/sebastian/global-state/tests/SnapshotTest.php +++ /dev/null @@ -1,120 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\GlobalState; - -use PHPUnit\Framework\TestCase; -use SebastianBergmann\GlobalState\TestFixture\BlacklistedInterface; -use SebastianBergmann\GlobalState\TestFixture\SnapshotClass; -use SebastianBergmann\GlobalState\TestFixture\SnapshotTrait; - -/** - * @covers \SebastianBergmann\GlobalState\Snapshot - * - * @uses \SebastianBergmann\GlobalState\Blacklist - */ -final class SnapshotTest extends TestCase -{ - /** - * @var Blacklist - */ - private $blacklist; - - protected function setUp(): void - { - $this->blacklist = new Blacklist; - } - - public function testStaticAttributes(): void - { - SnapshotClass::init(); - - $this->blacklistAllLoadedClassesExceptSnapshotClass(); - - $snapshot = new Snapshot($this->blacklist, false, true, false, false, false, false, false, false, false); - - $expected = [ - SnapshotClass::class => [ - 'string' => 'string', - 'objects' => [new \stdClass], - ], - ]; - - $this->assertEquals($expected, $snapshot->staticAttributes()); - } - - public function testConstants(): void - { - $snapshot = new Snapshot($this->blacklist, false, false, true, false, false, false, false, false, false); - - $this->assertArrayHasKey('GLOBALSTATE_TESTSUITE', $snapshot->constants()); - } - - public function testFunctions(): void - { - $snapshot = new Snapshot($this->blacklist, false, false, false, true, false, false, false, false, false); - $functions = $snapshot->functions(); - - $this->assertContains('sebastianbergmann\globalstate\testfixture\snapshotfunction', $functions); - $this->assertNotContains('assert', $functions); - } - - public function testClasses(): void - { - $snapshot = new Snapshot($this->blacklist, false, false, false, false, true, false, false, false, false); - $classes = $snapshot->classes(); - - $this->assertContains(TestCase::class, $classes); - $this->assertNotContains(Exception::class, $classes); - } - - public function testInterfaces(): void - { - $snapshot = new Snapshot($this->blacklist, false, false, false, false, false, true, false, false, false); - $interfaces = $snapshot->interfaces(); - - $this->assertContains(BlacklistedInterface::class, $interfaces); - $this->assertNotContains(\Countable::class, $interfaces); - } - - public function testTraits(): void - { - \spl_autoload_call('SebastianBergmann\GlobalState\TestFixture\SnapshotTrait'); - - $snapshot = new Snapshot($this->blacklist, false, false, false, false, false, false, true, false, false); - - $this->assertContains(SnapshotTrait::class, $snapshot->traits()); - } - - public function testIniSettings(): void - { - $snapshot = new Snapshot($this->blacklist, false, false, false, false, false, false, false, true, false); - $iniSettings = $snapshot->iniSettings(); - - $this->assertArrayHasKey('date.timezone', $iniSettings); - $this->assertEquals('Etc/UTC', $iniSettings['date.timezone']); - } - - public function testIncludedFiles(): void - { - $snapshot = new Snapshot($this->blacklist, false, false, false, false, false, false, false, false, true); - $this->assertContains(__FILE__, $snapshot->includedFiles()); - } - - private function blacklistAllLoadedClassesExceptSnapshotClass(): void - { - foreach (\get_declared_classes() as $class) { - if ($class === SnapshotClass::class) { - continue; - } - - $this->blacklist->addClass($class); - } - } -} diff --git a/vendor/sebastian/global-state/tests/_fixture/BlacklistedChildClass.php b/vendor/sebastian/global-state/tests/_fixture/BlacklistedChildClass.php deleted file mode 100644 index 585c396..0000000 --- a/vendor/sebastian/global-state/tests/_fixture/BlacklistedChildClass.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\GlobalState\TestFixture; - -class BlacklistedChildClass extends BlacklistedClass -{ -} diff --git a/vendor/sebastian/global-state/tests/_fixture/BlacklistedClass.php b/vendor/sebastian/global-state/tests/_fixture/BlacklistedClass.php deleted file mode 100644 index c1dc259..0000000 --- a/vendor/sebastian/global-state/tests/_fixture/BlacklistedClass.php +++ /dev/null @@ -1,15 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\GlobalState\TestFixture; - -class BlacklistedClass -{ - private static $attribute; -} diff --git a/vendor/sebastian/global-state/tests/_fixture/BlacklistedImplementor.php b/vendor/sebastian/global-state/tests/_fixture/BlacklistedImplementor.php deleted file mode 100644 index c42751e..0000000 --- a/vendor/sebastian/global-state/tests/_fixture/BlacklistedImplementor.php +++ /dev/null @@ -1,15 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\GlobalState\TestFixture; - -class BlacklistedImplementor implements BlacklistedInterface -{ - private static $attribute; -} diff --git a/vendor/sebastian/global-state/tests/_fixture/BlacklistedInterface.php b/vendor/sebastian/global-state/tests/_fixture/BlacklistedInterface.php deleted file mode 100644 index f531a3a..0000000 --- a/vendor/sebastian/global-state/tests/_fixture/BlacklistedInterface.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\GlobalState\TestFixture; - -interface BlacklistedInterface -{ -} diff --git a/vendor/sebastian/global-state/tests/_fixture/SnapshotClass.php b/vendor/sebastian/global-state/tests/_fixture/SnapshotClass.php deleted file mode 100644 index bf3305d..0000000 --- a/vendor/sebastian/global-state/tests/_fixture/SnapshotClass.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\GlobalState\TestFixture; - -class SnapshotClass -{ - private static $string = 'string'; - - private static $closures = []; - - private static $files = []; - - private static $resources = []; - - private static $objects = []; - - public static function init(): void - { - self::$closures[] = function (): void { - }; - - self::$files[] = new \SplFileInfo(__FILE__); - - self::$resources[] = \fopen('php://memory', 'r'); - - self::$objects[] = new \stdClass; - } -} diff --git a/vendor/sebastian/global-state/tests/_fixture/SnapshotDomDocument.php b/vendor/sebastian/global-state/tests/_fixture/SnapshotDomDocument.php deleted file mode 100644 index 42eafd0..0000000 --- a/vendor/sebastian/global-state/tests/_fixture/SnapshotDomDocument.php +++ /dev/null @@ -1,16 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\GlobalState\TestFixture; - -use DomDocument; - -class SnapshotDomDocument extends DomDocument -{ -} diff --git a/vendor/sebastian/global-state/tests/_fixture/SnapshotFunctions.php b/vendor/sebastian/global-state/tests/_fixture/SnapshotFunctions.php deleted file mode 100644 index b3e8d00..0000000 --- a/vendor/sebastian/global-state/tests/_fixture/SnapshotFunctions.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\GlobalState\TestFixture; - -function snapshotFunction(): void -{ -} diff --git a/vendor/sebastian/global-state/tests/_fixture/SnapshotTrait.php b/vendor/sebastian/global-state/tests/_fixture/SnapshotTrait.php deleted file mode 100644 index c3490a6..0000000 --- a/vendor/sebastian/global-state/tests/_fixture/SnapshotTrait.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\GlobalState\TestFixture; - -trait SnapshotTrait -{ -} diff --git a/vendor/sebastian/object-enumerator/.gitignore b/vendor/sebastian/object-enumerator/.gitignore deleted file mode 100644 index 5d748a8..0000000 --- a/vendor/sebastian/object-enumerator/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -.idea -composer.lock -composer.phar -vendor/ -cache.properties -build/LICENSE -build/README.md -build/*.tgz diff --git a/vendor/sebastian/object-enumerator/.php_cs b/vendor/sebastian/object-enumerator/.php_cs deleted file mode 100644 index b7393bd..0000000 --- a/vendor/sebastian/object-enumerator/.php_cs +++ /dev/null @@ -1,67 +0,0 @@ -files() - ->in('src') - ->in('tests') - ->name('*.php'); - -return Symfony\CS\Config\Config::create() - ->level(\Symfony\CS\FixerInterface::NONE_LEVEL) - ->fixers( - array( - 'align_double_arrow', - 'align_equals', - 'braces', - 'concat_with_spaces', - 'duplicate_semicolon', - 'elseif', - 'empty_return', - 'encoding', - 'eof_ending', - 'extra_empty_lines', - 'function_call_space', - 'function_declaration', - 'indentation', - 'join_function', - 'line_after_namespace', - 'linefeed', - 'list_commas', - 'lowercase_constants', - 'lowercase_keywords', - 'method_argument_space', - 'multiple_use', - 'namespace_no_leading_whitespace', - 'no_blank_lines_after_class_opening', - 'no_empty_lines_after_phpdocs', - 'parenthesis', - 'php_closing_tag', - 'phpdoc_indent', - 'phpdoc_no_access', - 'phpdoc_no_empty_return', - 'phpdoc_no_package', - 'phpdoc_params', - 'phpdoc_scalar', - 'phpdoc_separation', - 'phpdoc_to_comment', - 'phpdoc_trim', - 'phpdoc_types', - 'phpdoc_var_without_name', - 'remove_lines_between_uses', - 'return', - 'self_accessor', - 'short_array_syntax', - 'short_tag', - 'single_line_after_imports', - 'single_quote', - 'spaces_before_semicolon', - 'spaces_cast', - 'ternary_spaces', - 'trailing_spaces', - 'trim_array_spaces', - 'unused_use', - 'visibility', - 'whitespacy_lines' - ) - ) - ->finder($finder); - diff --git a/vendor/sebastian/object-enumerator/.travis.yml b/vendor/sebastian/object-enumerator/.travis.yml deleted file mode 100644 index 5ea0f53..0000000 --- a/vendor/sebastian/object-enumerator/.travis.yml +++ /dev/null @@ -1,26 +0,0 @@ -language: php - -php: - - 7.0 - - 7.0snapshot - - 7.1 - - 7.1snapshot - - master - -sudo: false - -before_install: - - composer self-update - - composer clear-cache - -install: - - travis_retry composer update --no-interaction --no-ansi --no-progress --no-suggest --optimize-autoloader --prefer-stable - -script: - - ./vendor/bin/phpunit --coverage-clover=coverage.xml - -after_success: - - bash <(curl -s https://codecov.io/bash) - -notifications: - email: false diff --git a/vendor/sebastian/object-enumerator/ChangeLog.md b/vendor/sebastian/object-enumerator/ChangeLog.md deleted file mode 100644 index 2bf007b..0000000 --- a/vendor/sebastian/object-enumerator/ChangeLog.md +++ /dev/null @@ -1,60 +0,0 @@ -# Change Log - -All notable changes to `sebastianbergmann/object-enumerator` are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. - -## [3.0.4] - 2020-11-30 - -### Changed - -* Changed PHP version constraint in `composer.json` from `^7.0` to `>=7.0` - -## [3.0.3] - 2017-08-03 - -### Changed - -* Bumped required version of `sebastian/object-reflector` - -## [3.0.2] - 2017-03-12 - -### Changed - -* `sebastian/object-reflector` is now a dependency - -## [3.0.1] - 2017-03-12 - -### Fixed - -* Objects aggregated in inherited attributes are not enumerated - -## [3.0.0] - 2017-03-03 - -### Removed - -* This component is no longer supported on PHP 5.6 - -## [2.0.1] - 2017-02-18 - -### Fixed - -* Fixed [#2](https://github.com/sebastianbergmann/phpunit/pull/2): Exceptions in `ReflectionProperty::getValue()` are not handled - -## [2.0.0] - 2016-11-19 - -### Changed - -* This component is now compatible with `sebastian/recursion-context: ~1.0.4` - -## 1.0.0 - 2016-02-04 - -### Added - -* Initial release - -[3.0.4]: https://github.com/sebastianbergmann/object-enumerator/compare/3.0.3...3.0.4 -[3.0.3]: https://github.com/sebastianbergmann/object-enumerator/compare/3.0.2...3.0.3 -[3.0.2]: https://github.com/sebastianbergmann/object-enumerator/compare/3.0.1...3.0.2 -[3.0.1]: https://github.com/sebastianbergmann/object-enumerator/compare/3.0.0...3.0.1 -[3.0.0]: https://github.com/sebastianbergmann/object-enumerator/compare/2.0...3.0.0 -[2.0.1]: https://github.com/sebastianbergmann/object-enumerator/compare/2.0.0...2.0.1 -[2.0.0]: https://github.com/sebastianbergmann/object-enumerator/compare/1.0...2.0.0 - diff --git a/vendor/sebastian/object-enumerator/LICENSE b/vendor/sebastian/object-enumerator/LICENSE deleted file mode 100644 index ab8b704..0000000 --- a/vendor/sebastian/object-enumerator/LICENSE +++ /dev/null @@ -1,33 +0,0 @@ -Object Enumerator - -Copyright (c) 2016-2017, Sebastian Bergmann . -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Sebastian Bergmann nor the names of his - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/sebastian/object-enumerator/README.md b/vendor/sebastian/object-enumerator/README.md deleted file mode 100644 index be6f2dd..0000000 --- a/vendor/sebastian/object-enumerator/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# Object Enumerator - -Traverses array structures and object graphs to enumerate all referenced objects. - -## Installation - -You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): - - composer require sebastian/object-enumerator - -If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: - - composer require --dev sebastian/object-enumerator - diff --git a/vendor/sebastian/object-enumerator/build.xml b/vendor/sebastian/object-enumerator/build.xml deleted file mode 100644 index 086694f..0000000 --- a/vendor/sebastian/object-enumerator/build.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/sebastian/object-enumerator/composer.json b/vendor/sebastian/object-enumerator/composer.json deleted file mode 100644 index 33a9465..0000000 --- a/vendor/sebastian/object-enumerator/composer.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "sebastian/object-enumerator", - "description": "Traverses array structures and object graphs to enumerate all referenced objects", - "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "require": { - "php": ">=7.0", - "sebastian/object-reflector": "^1.1.1", - "sebastian/recursion-context": "^3.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "autoload-dev": { - "classmap": [ - "tests/_fixture/" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - } -} diff --git a/vendor/sebastian/object-enumerator/phpunit.xml b/vendor/sebastian/object-enumerator/phpunit.xml deleted file mode 100644 index c401ba8..0000000 --- a/vendor/sebastian/object-enumerator/phpunit.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - tests - - - - - src - - - diff --git a/vendor/sebastian/object-enumerator/src/Enumerator.php b/vendor/sebastian/object-enumerator/src/Enumerator.php deleted file mode 100644 index 3a40f6d..0000000 --- a/vendor/sebastian/object-enumerator/src/Enumerator.php +++ /dev/null @@ -1,85 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\ObjectEnumerator; - -use SebastianBergmann\ObjectReflector\ObjectReflector; -use SebastianBergmann\RecursionContext\Context; - -/** - * Traverses array structures and object graphs - * to enumerate all referenced objects. - */ -class Enumerator -{ - /** - * Returns an array of all objects referenced either - * directly or indirectly by a variable. - * - * @param array|object $variable - * - * @return object[] - */ - public function enumerate($variable) - { - if (!is_array($variable) && !is_object($variable)) { - throw new InvalidArgumentException; - } - - if (isset(func_get_args()[1])) { - if (!func_get_args()[1] instanceof Context) { - throw new InvalidArgumentException; - } - - $processed = func_get_args()[1]; - } else { - $processed = new Context; - } - - $objects = []; - - if ($processed->contains($variable)) { - return $objects; - } - - $array = $variable; - $processed->add($variable); - - if (is_array($variable)) { - foreach ($array as $element) { - if (!is_array($element) && !is_object($element)) { - continue; - } - - $objects = array_merge( - $objects, - $this->enumerate($element, $processed) - ); - } - } else { - $objects[] = $variable; - - $reflector = new ObjectReflector; - - foreach ($reflector->getAttributes($variable) as $value) { - if (!is_array($value) && !is_object($value)) { - continue; - } - - $objects = array_merge( - $objects, - $this->enumerate($value, $processed) - ); - } - } - - return $objects; - } -} diff --git a/vendor/sebastian/object-enumerator/src/Exception.php b/vendor/sebastian/object-enumerator/src/Exception.php deleted file mode 100644 index 903b0b1..0000000 --- a/vendor/sebastian/object-enumerator/src/Exception.php +++ /dev/null @@ -1,15 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\ObjectEnumerator; - -interface Exception -{ -} diff --git a/vendor/sebastian/object-enumerator/src/InvalidArgumentException.php b/vendor/sebastian/object-enumerator/src/InvalidArgumentException.php deleted file mode 100644 index 5250c1a..0000000 --- a/vendor/sebastian/object-enumerator/src/InvalidArgumentException.php +++ /dev/null @@ -1,15 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\ObjectEnumerator; - -class InvalidArgumentException extends \InvalidArgumentException implements Exception -{ -} diff --git a/vendor/sebastian/object-enumerator/tests/EnumeratorTest.php b/vendor/sebastian/object-enumerator/tests/EnumeratorTest.php deleted file mode 100644 index a6bd29a..0000000 --- a/vendor/sebastian/object-enumerator/tests/EnumeratorTest.php +++ /dev/null @@ -1,139 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\ObjectEnumerator; - -use SebastianBergmann\ObjectEnumerator\Fixtures\ExceptionThrower; -use PHPUnit\Framework\TestCase; - -/** - * @covers SebastianBergmann\ObjectEnumerator\Enumerator - */ -class EnumeratorTest extends TestCase -{ - /** - * @var Enumerator - */ - private $enumerator; - - protected function setUp() - { - $this->enumerator = new Enumerator; - } - - public function testEnumeratesSingleObject() - { - $a = new \stdClass; - - $objects = $this->enumerator->enumerate($a); - - $this->assertCount(1, $objects); - $this->assertSame($a, $objects[0]); - } - - public function testEnumeratesArrayWithSingleObject() - { - $a = new \stdClass; - - $objects = $this->enumerator->enumerate([$a]); - - $this->assertCount(1, $objects); - $this->assertSame($a, $objects[0]); - } - - public function testEnumeratesArrayWithTwoReferencesToTheSameObject() - { - $a = new \stdClass; - - $objects = $this->enumerator->enumerate([$a, $a]); - - $this->assertCount(1, $objects); - $this->assertSame($a, $objects[0]); - } - - public function testEnumeratesArrayOfObjects() - { - $a = new \stdClass; - $b = new \stdClass; - - $objects = $this->enumerator->enumerate([$a, $b, null]); - - $this->assertCount(2, $objects); - $this->assertSame($a, $objects[0]); - $this->assertSame($b, $objects[1]); - } - - public function testEnumeratesObjectWithAggregatedObject() - { - $a = new \stdClass; - $b = new \stdClass; - - $a->b = $b; - $a->c = null; - - $objects = $this->enumerator->enumerate($a); - - $this->assertCount(2, $objects); - $this->assertSame($a, $objects[0]); - $this->assertSame($b, $objects[1]); - } - - public function testEnumeratesObjectWithAggregatedObjectsInArray() - { - $a = new \stdClass; - $b = new \stdClass; - - $a->b = [$b]; - - $objects = $this->enumerator->enumerate($a); - - $this->assertCount(2, $objects); - $this->assertSame($a, $objects[0]); - $this->assertSame($b, $objects[1]); - } - - public function testEnumeratesObjectsWithCyclicReferences() - { - $a = new \stdClass; - $b = new \stdClass; - - $a->b = $b; - $b->a = $a; - - $objects = $this->enumerator->enumerate([$a, $b]); - - $this->assertCount(2, $objects); - $this->assertSame($a, $objects[0]); - $this->assertSame($b, $objects[1]); - } - - public function testEnumeratesClassThatThrowsException() - { - $thrower = new ExceptionThrower(); - - $objects = $this->enumerator->enumerate($thrower); - - $this->assertSame($thrower, $objects[0]); - } - - public function testExceptionIsRaisedForInvalidArgument() - { - $this->expectException(InvalidArgumentException::class); - - $this->enumerator->enumerate(null); - } - - public function testExceptionIsRaisedForInvalidArgument2() - { - $this->expectException(InvalidArgumentException::class); - - $this->enumerator->enumerate([], ''); - } -} diff --git a/vendor/sebastian/object-enumerator/tests/_fixture/ExceptionThrower.php b/vendor/sebastian/object-enumerator/tests/_fixture/ExceptionThrower.php deleted file mode 100644 index a75f585..0000000 --- a/vendor/sebastian/object-enumerator/tests/_fixture/ExceptionThrower.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\ObjectEnumerator\Fixtures; - -use RuntimeException; - -class ExceptionThrower -{ - private $property; - - public function __construct() - { - unset($this->property); - } - - public function __get($property) - { - throw new RuntimeException; - } -} diff --git a/vendor/sebastian/object-reflector/.gitignore b/vendor/sebastian/object-reflector/.gitignore deleted file mode 100644 index c3e9d7e..0000000 --- a/vendor/sebastian/object-reflector/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -/.idea -/.php_cs.cache -/composer.lock -/vendor diff --git a/vendor/sebastian/object-reflector/.php_cs b/vendor/sebastian/object-reflector/.php_cs deleted file mode 100644 index cb814f3..0000000 --- a/vendor/sebastian/object-reflector/.php_cs +++ /dev/null @@ -1,79 +0,0 @@ - - -For the full copyright and license information, please view the LICENSE -file that was distributed with this source code. -EOF; - -return PhpCsFixer\Config::create() - ->setRiskyAllowed(true) - ->setRules( - [ - 'array_syntax' => ['syntax' => 'short'], - 'binary_operator_spaces' => [ - 'align_double_arrow' => true, - 'align_equals' => true - ], - 'blank_line_after_namespace' => true, - 'blank_line_before_return' => true, - 'braces' => true, - 'cast_spaces' => true, - 'concat_space' => ['spacing' => 'one'], - 'declare_strict_types' => true, - 'elseif' => true, - 'encoding' => true, - 'full_opening_tag' => true, - 'function_declaration' => true, - #'header_comment' => ['header' => $header, 'separate' => 'none'], - 'indentation_type' => true, - 'line_ending' => true, - 'lowercase_constants' => true, - 'lowercase_keywords' => true, - 'method_argument_space' => true, - 'no_alias_functions' => true, - 'no_blank_lines_after_class_opening' => true, - 'no_blank_lines_after_phpdoc' => true, - 'no_closing_tag' => true, - 'no_empty_phpdoc' => true, - 'no_empty_statement' => true, - 'no_extra_consecutive_blank_lines' => true, - 'no_leading_namespace_whitespace' => true, - 'no_singleline_whitespace_before_semicolons' => true, - 'no_spaces_after_function_name' => true, - 'no_spaces_inside_parenthesis' => true, - 'no_trailing_comma_in_list_call' => true, - 'no_trailing_whitespace' => true, - 'no_unused_imports' => true, - 'no_whitespace_in_blank_line' => true, - 'phpdoc_align' => true, - 'phpdoc_indent' => true, - 'phpdoc_no_access' => true, - 'phpdoc_no_empty_return' => true, - 'phpdoc_no_package' => true, - 'phpdoc_scalar' => true, - 'phpdoc_separation' => true, - 'phpdoc_to_comment' => true, - 'phpdoc_trim' => true, - 'phpdoc_types' => true, - 'phpdoc_var_without_name' => true, - 'self_accessor' => true, - 'simplified_null_return' => true, - 'single_blank_line_at_eof' => true, - 'single_import_per_statement' => true, - 'single_line_after_imports' => true, - 'single_quote' => true, - 'ternary_operator_spaces' => true, - 'trim_array_spaces' => true, - 'visibility_required' => true, - ] - ) - ->setFinder( - PhpCsFixer\Finder::create() - ->files() - ->in(__DIR__ . '/src') - ->in(__DIR__ . '/tests') - ->name('*.php') - ); diff --git a/vendor/sebastian/object-reflector/.travis.yml b/vendor/sebastian/object-reflector/.travis.yml deleted file mode 100644 index 5ea0f53..0000000 --- a/vendor/sebastian/object-reflector/.travis.yml +++ /dev/null @@ -1,26 +0,0 @@ -language: php - -php: - - 7.0 - - 7.0snapshot - - 7.1 - - 7.1snapshot - - master - -sudo: false - -before_install: - - composer self-update - - composer clear-cache - -install: - - travis_retry composer update --no-interaction --no-ansi --no-progress --no-suggest --optimize-autoloader --prefer-stable - -script: - - ./vendor/bin/phpunit --coverage-clover=coverage.xml - -after_success: - - bash <(curl -s https://codecov.io/bash) - -notifications: - email: false diff --git a/vendor/sebastian/object-reflector/ChangeLog.md b/vendor/sebastian/object-reflector/ChangeLog.md deleted file mode 100644 index 89b0346..0000000 --- a/vendor/sebastian/object-reflector/ChangeLog.md +++ /dev/null @@ -1,27 +0,0 @@ -# Change Log - -All notable changes to `sebastianbergmann/object-reflector` are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. - -## 1.1.2 - 2020-11-30 - -### Changed - -* Changed PHP version constraint in `composer.json` from `^7.0` to `>=7.1` - -## 1.1.1 - 2017-03-29 - -* Fixed [#1](https://github.com/sebastianbergmann/object-reflector/issues/1): Attributes that with non-string names are not handled correctly - -## 1.1.0 - 2017-03-16 - -### Changed - -* Changed implementation of `ObjectReflector::getattributes()` to use `(array)` cast instead of `ReflectionObject` - -## 1.0.0 - 2017-03-12 - -* Initial release - -[1.1.2]: https://github.com/sebastianbergmann/object-enumerator/compare/1.1.1...1.1.2 -[1.1.1]: https://github.com/sebastianbergmann/object-enumerator/compare/1.1.0...1.1.1 -[1.1.0]: https://github.com/sebastianbergmann/object-enumerator/compare/1.0.0...1.1.0 diff --git a/vendor/sebastian/object-reflector/LICENSE b/vendor/sebastian/object-reflector/LICENSE deleted file mode 100644 index 54b1fd8..0000000 --- a/vendor/sebastian/object-reflector/LICENSE +++ /dev/null @@ -1,33 +0,0 @@ -Object Reflector - -Copyright (c) 2017, Sebastian Bergmann . -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Sebastian Bergmann nor the names of his - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/sebastian/object-reflector/README.md b/vendor/sebastian/object-reflector/README.md deleted file mode 100644 index 13b24f1..0000000 --- a/vendor/sebastian/object-reflector/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# Object Reflector - -Allows reflection of object attributes, including inherited and non-public ones. - -## Installation - -You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): - - composer require sebastian/object-reflector - -If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: - - composer require --dev sebastian/object-reflector - diff --git a/vendor/sebastian/object-reflector/build.xml b/vendor/sebastian/object-reflector/build.xml deleted file mode 100644 index 3368432..0000000 --- a/vendor/sebastian/object-reflector/build.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/sebastian/object-reflector/composer.json b/vendor/sebastian/object-reflector/composer.json deleted file mode 100644 index 14b7c5c..0000000 --- a/vendor/sebastian/object-reflector/composer.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "sebastian/object-reflector", - "description": "Allows reflection of object attributes, including inherited and non-public ones", - "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "require": { - "php": ">=7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "autoload-dev": { - "classmap": [ - "tests/_fixture/" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - } -} diff --git a/vendor/sebastian/object-reflector/phpunit.xml b/vendor/sebastian/object-reflector/phpunit.xml deleted file mode 100644 index 68febeb..0000000 --- a/vendor/sebastian/object-reflector/phpunit.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - tests - - - - - src - - - diff --git a/vendor/sebastian/object-reflector/src/Exception.php b/vendor/sebastian/object-reflector/src/Exception.php deleted file mode 100644 index 9964b09..0000000 --- a/vendor/sebastian/object-reflector/src/Exception.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace SebastianBergmann\ObjectReflector; - -interface Exception -{ -} diff --git a/vendor/sebastian/object-reflector/src/InvalidArgumentException.php b/vendor/sebastian/object-reflector/src/InvalidArgumentException.php deleted file mode 100644 index e63c5d5..0000000 --- a/vendor/sebastian/object-reflector/src/InvalidArgumentException.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace SebastianBergmann\ObjectReflector; - -class InvalidArgumentException extends \InvalidArgumentException implements Exception -{ -} diff --git a/vendor/sebastian/object-reflector/src/ObjectReflector.php b/vendor/sebastian/object-reflector/src/ObjectReflector.php deleted file mode 100644 index 8b0390a..0000000 --- a/vendor/sebastian/object-reflector/src/ObjectReflector.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace SebastianBergmann\ObjectReflector; - -class ObjectReflector -{ - /** - * @param object $object - * - * @return array - * - * @throws InvalidArgumentException - */ - public function getAttributes($object): array - { - if (!is_object($object)) { - throw new InvalidArgumentException; - } - - $attributes = []; - $className = get_class($object); - - foreach ((array) $object as $name => $value) { - $name = explode("\0", (string) $name); - - if (count($name) === 1) { - $name = $name[0]; - } else { - if ($name[1] !== $className) { - $name = $name[1] . '::' . $name[2]; - } else { - $name = $name[2]; - } - } - - $attributes[$name] = $value; - } - - return $attributes; - } -} diff --git a/vendor/sebastian/object-reflector/tests/ObjectReflectorTest.php b/vendor/sebastian/object-reflector/tests/ObjectReflectorTest.php deleted file mode 100644 index ba0d97f..0000000 --- a/vendor/sebastian/object-reflector/tests/ObjectReflectorTest.php +++ /dev/null @@ -1,70 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace SebastianBergmann\ObjectReflector; - -use PHPUnit\Framework\TestCase; -use SebastianBergmann\ObjectReflector\TestFixture\ChildClass; -use SebastianBergmann\ObjectReflector\TestFixture\ClassWithIntegerAttributeName; - -/** - * @covers SebastianBergmann\ObjectReflector\ObjectReflector - */ -class ObjectReflectorTest extends TestCase -{ - /** - * @var ObjectReflector - */ - private $objectReflector; - - protected function setUp()/*: void */ - { - $this->objectReflector = new ObjectReflector; - } - - public function testReflectsAttributesOfObject()/*: void */ - { - $o = new ChildClass; - - $this->assertEquals( - [ - 'privateInChild' => 'private', - 'protectedInChild' => 'protected', - 'publicInChild' => 'public', - 'undeclared' => 'undeclared', - 'SebastianBergmann\ObjectReflector\TestFixture\ParentClass::privateInParent' => 'private', - 'SebastianBergmann\ObjectReflector\TestFixture\ParentClass::protectedInParent' => 'protected', - 'SebastianBergmann\ObjectReflector\TestFixture\ParentClass::publicInParent' => 'public', - ], - $this->objectReflector->getAttributes($o) - ); - } - - public function testReflectsAttributeWithIntegerName()/*: void */ - { - $o = new ClassWithIntegerAttributeName; - - $this->assertEquals( - [ - 1 => 2 - ], - $this->objectReflector->getAttributes($o) - ); - } - - public function testRaisesExceptionWhenPassedArgumentIsNotAnObject()/*: void */ - { - $this->expectException(InvalidArgumentException::class); - - $this->objectReflector->getAttributes(null); - } -} diff --git a/vendor/sebastian/object-reflector/tests/_fixture/ChildClass.php b/vendor/sebastian/object-reflector/tests/_fixture/ChildClass.php deleted file mode 100644 index 5ee05f3..0000000 --- a/vendor/sebastian/object-reflector/tests/_fixture/ChildClass.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace SebastianBergmann\ObjectReflector\TestFixture; - -class ChildClass extends ParentClass -{ - private $privateInChild = 'private'; - private $protectedInChild = 'protected'; - private $publicInChild = 'public'; - - public function __construct() - { - $this->undeclared = 'undeclared'; - } -} diff --git a/vendor/sebastian/object-reflector/tests/_fixture/ClassWithIntegerAttributeName.php b/vendor/sebastian/object-reflector/tests/_fixture/ClassWithIntegerAttributeName.php deleted file mode 100644 index ee49df3..0000000 --- a/vendor/sebastian/object-reflector/tests/_fixture/ClassWithIntegerAttributeName.php +++ /dev/null @@ -1,22 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace SebastianBergmann\ObjectReflector\TestFixture; - -class ClassWithIntegerAttributeName -{ - public function __construct() - { - $i = 1; - $this->$i = 2; - } -} diff --git a/vendor/sebastian/object-reflector/tests/_fixture/ParentClass.php b/vendor/sebastian/object-reflector/tests/_fixture/ParentClass.php deleted file mode 100644 index b6886be..0000000 --- a/vendor/sebastian/object-reflector/tests/_fixture/ParentClass.php +++ /dev/null @@ -1,20 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace SebastianBergmann\ObjectReflector\TestFixture; - -class ParentClass -{ - private $privateInParent = 'private'; - private $protectedInParent = 'protected'; - private $publicInParent = 'public'; -} diff --git a/vendor/sebastian/recursion-context/.gitignore b/vendor/sebastian/recursion-context/.gitignore deleted file mode 100644 index 77aae3d..0000000 --- a/vendor/sebastian/recursion-context/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/.idea -/composer.lock -/vendor diff --git a/vendor/sebastian/recursion-context/.travis.yml b/vendor/sebastian/recursion-context/.travis.yml deleted file mode 100644 index ee0e40b..0000000 --- a/vendor/sebastian/recursion-context/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -language: php - -php: - - 7.0 - - 7.0snapshot - - 7.1 - - 7.1snapshot - - master - -sudo: false - -before_install: - - composer self-update - - composer clear-cache - -install: - - travis_retry composer update --no-interaction --no-ansi --no-progress --no-suggest --optimize-autoloader --prefer-stable - -script: - - ./vendor/bin/phpunit - -notifications: - email: false diff --git a/vendor/sebastian/recursion-context/LICENSE b/vendor/sebastian/recursion-context/LICENSE deleted file mode 100644 index 00bfec5..0000000 --- a/vendor/sebastian/recursion-context/LICENSE +++ /dev/null @@ -1,33 +0,0 @@ -Recursion Context - -Copyright (c) 2002-2017, Sebastian Bergmann . -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Sebastian Bergmann nor the names of his - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/sebastian/recursion-context/README.md b/vendor/sebastian/recursion-context/README.md deleted file mode 100644 index 0b89496..0000000 --- a/vendor/sebastian/recursion-context/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# Recursion Context - -... - -## Installation - -You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): - - composer require sebastian/recursion-context - -If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: - - composer require --dev sebastian/recursion-context - diff --git a/vendor/sebastian/recursion-context/build.xml b/vendor/sebastian/recursion-context/build.xml deleted file mode 100644 index 896bd34..0000000 --- a/vendor/sebastian/recursion-context/build.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/sebastian/recursion-context/composer.json b/vendor/sebastian/recursion-context/composer.json deleted file mode 100644 index f2bef36..0000000 --- a/vendor/sebastian/recursion-context/composer.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "sebastian/recursion-context", - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "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" - } - ], - "require": { - "php": ">=7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - } -} diff --git a/vendor/sebastian/recursion-context/phpunit.xml b/vendor/sebastian/recursion-context/phpunit.xml deleted file mode 100644 index 68febeb..0000000 --- a/vendor/sebastian/recursion-context/phpunit.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - tests - - - - - src - - - diff --git a/vendor/sebastian/recursion-context/src/Context.php b/vendor/sebastian/recursion-context/src/Context.php deleted file mode 100644 index 0b4b8a0..0000000 --- a/vendor/sebastian/recursion-context/src/Context.php +++ /dev/null @@ -1,167 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\RecursionContext; - -/** - * A context containing previously processed arrays and objects - * when recursively processing a value. - */ -final class Context -{ - /** - * @var array[] - */ - private $arrays; - - /** - * @var \SplObjectStorage - */ - private $objects; - - /** - * Initialises the context - */ - public function __construct() - { - $this->arrays = array(); - $this->objects = new \SplObjectStorage; - } - - /** - * Adds a value to the context. - * - * @param array|object $value The value to add. - * - * @return int|string The ID of the stored value, either as a string or integer. - * - * @throws InvalidArgumentException Thrown if $value is not an array or object - */ - public function add(&$value) - { - if (is_array($value)) { - return $this->addArray($value); - } elseif (is_object($value)) { - return $this->addObject($value); - } - - throw new InvalidArgumentException( - 'Only arrays and objects are supported' - ); - } - - /** - * Checks if the given value exists within the context. - * - * @param array|object $value The value to check. - * - * @return int|string|false The string or integer ID of the stored value if it has already been seen, or false if the value is not stored. - * - * @throws InvalidArgumentException Thrown if $value is not an array or object - */ - public function contains(&$value) - { - if (is_array($value)) { - return $this->containsArray($value); - } elseif (is_object($value)) { - return $this->containsObject($value); - } - - throw new InvalidArgumentException( - 'Only arrays and objects are supported' - ); - } - - /** - * @param array $array - * - * @return bool|int - */ - private function addArray(array &$array) - { - $key = $this->containsArray($array); - - if ($key !== false) { - return $key; - } - - $key = count($this->arrays); - $this->arrays[] = &$array; - - if (!isset($array[PHP_INT_MAX]) && !isset($array[PHP_INT_MAX - 1])) { - $array[] = $key; - $array[] = $this->objects; - } else { /* cover the improbable case too */ - do { - $key = random_int(PHP_INT_MIN, PHP_INT_MAX); - } while (isset($array[$key])); - - $array[$key] = $key; - - do { - $key = random_int(PHP_INT_MIN, PHP_INT_MAX); - } while (isset($array[$key])); - - $array[$key] = $this->objects; - } - - return $key; - } - - /** - * @param object $object - * - * @return string - */ - private function addObject($object) - { - if (!$this->objects->contains($object)) { - $this->objects->attach($object); - } - - return spl_object_hash($object); - } - - /** - * @param array $array - * - * @return int|false - */ - private function containsArray(array &$array) - { - $end = array_slice($array, -2); - - return isset($end[1]) && $end[1] === $this->objects ? $end[0] : false; - } - - /** - * @param object $value - * - * @return string|false - */ - private function containsObject($value) - { - if ($this->objects->contains($value)) { - return spl_object_hash($value); - } - - return false; - } - - public function __destruct() - { - foreach ($this->arrays as &$array) { - if (is_array($array)) { - array_pop($array); - array_pop($array); - } - } - } -} diff --git a/vendor/sebastian/recursion-context/src/Exception.php b/vendor/sebastian/recursion-context/src/Exception.php deleted file mode 100644 index 4a1557b..0000000 --- a/vendor/sebastian/recursion-context/src/Exception.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\RecursionContext; - -/** - */ -interface Exception -{ -} diff --git a/vendor/sebastian/recursion-context/src/InvalidArgumentException.php b/vendor/sebastian/recursion-context/src/InvalidArgumentException.php deleted file mode 100644 index 032c504..0000000 --- a/vendor/sebastian/recursion-context/src/InvalidArgumentException.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\RecursionContext; - -/** - */ -final class InvalidArgumentException extends \InvalidArgumentException implements Exception -{ -} diff --git a/vendor/sebastian/recursion-context/tests/ContextTest.php b/vendor/sebastian/recursion-context/tests/ContextTest.php deleted file mode 100644 index 6e7af68..0000000 --- a/vendor/sebastian/recursion-context/tests/ContextTest.php +++ /dev/null @@ -1,142 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\RecursionContext; - -use PHPUnit\Framework\TestCase; - -/** - * @covers SebastianBergmann\RecursionContext\Context - */ -class ContextTest extends TestCase -{ - /** - * @var \SebastianBergmann\RecursionContext\Context - */ - private $context; - - protected function setUp() - { - $this->context = new Context(); - } - - public function failsProvider() - { - return array( - array(true), - array(false), - array(null), - array('string'), - array(1), - array(1.5), - array(fopen('php://memory', 'r')) - ); - } - - public function valuesProvider() - { - $obj2 = new \stdClass(); - $obj2->foo = 'bar'; - - $obj3 = (object) array(1,2,"Test\r\n",4,5,6,7,8); - - $obj = new \stdClass(); - //@codingStandardsIgnoreStart - $obj->null = null; - //@codingStandardsIgnoreEnd - $obj->boolean = true; - $obj->integer = 1; - $obj->double = 1.2; - $obj->string = '1'; - $obj->text = "this\nis\na\nvery\nvery\nvery\nvery\nvery\nvery\rlong\n\rtext"; - $obj->object = $obj2; - $obj->objectagain = $obj2; - $obj->array = array('foo' => 'bar'); - $obj->array2 = array(1,2,3,4,5,6); - $obj->array3 = array($obj, $obj2, $obj3); - $obj->self = $obj; - - $storage = new \SplObjectStorage(); - $storage->attach($obj2); - $storage->foo = $obj2; - - return array( - array($obj, spl_object_hash($obj)), - array($obj2, spl_object_hash($obj2)), - array($obj3, spl_object_hash($obj3)), - array($storage, spl_object_hash($storage)), - array($obj->array, 0), - array($obj->array2, 0), - array($obj->array3, 0) - ); - } - - /** - * @covers SebastianBergmann\RecursionContext\Context::add - * @uses SebastianBergmann\RecursionContext\InvalidArgumentException - * @dataProvider failsProvider - */ - public function testAddFails($value) - { - $this->expectException(Exception::class); - $this->expectExceptionMessage('Only arrays and objects are supported'); - - $this->context->add($value); - } - - /** - * @covers SebastianBergmann\RecursionContext\Context::contains - * @uses SebastianBergmann\RecursionContext\InvalidArgumentException - * @dataProvider failsProvider - */ - public function testContainsFails($value) - { - $this->expectException(Exception::class); - $this->expectExceptionMessage('Only arrays and objects are supported'); - - $this->context->contains($value); - } - - /** - * @covers SebastianBergmann\RecursionContext\Context::add - * @dataProvider valuesProvider - */ - public function testAdd($value, $key) - { - $this->assertEquals($key, $this->context->add($value)); - - // Test we get the same key on subsequent adds - $this->assertEquals($key, $this->context->add($value)); - } - - /** - * @covers SebastianBergmann\RecursionContext\Context::contains - * @uses SebastianBergmann\RecursionContext\Context::add - * @depends testAdd - * @dataProvider valuesProvider - */ - public function testContainsFound($value, $key) - { - $this->context->add($value); - $this->assertEquals($key, $this->context->contains($value)); - - // Test we get the same key on subsequent calls - $this->assertEquals($key, $this->context->contains($value)); - } - - /** - * @covers SebastianBergmann\RecursionContext\Context::contains - * @dataProvider valuesProvider - */ - public function testContainsNotFound($value) - { - $this->assertFalse($this->context->contains($value)); - } -} diff --git a/vendor/sebastian/resource-operations/.github/stale.yml b/vendor/sebastian/resource-operations/.github/stale.yml deleted file mode 100644 index 4eadca3..0000000 --- a/vendor/sebastian/resource-operations/.github/stale.yml +++ /dev/null @@ -1,40 +0,0 @@ -# Configuration for probot-stale - https://github.com/probot/stale - -# Number of days of inactivity before an Issue or Pull Request becomes stale -daysUntilStale: 60 - -# Number of days of inactivity before a stale Issue or Pull Request is closed. -# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale. -daysUntilClose: 7 - -# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable -exemptLabels: - - enhancement - -# Set to true to ignore issues in a project (defaults to false) -exemptProjects: false - -# Set to true to ignore issues in a milestone (defaults to false) -exemptMilestones: false - -# Label to use when marking as stale -staleLabel: stale - -# Comment to post when marking as stale. Set to `false` to disable -markComment: > - This issue has been automatically marked as stale because it has not had activity within the last 60 days. It will be closed after 7 days if no further activity occurs. Thank you for your contributions. - -# Comment to post when removing the stale label. -# unmarkComment: > -# Your comment here. - -# Comment to post when closing a stale Issue or Pull Request. -closeComment: > - This issue has been automatically closed because it has not had activity since it was marked as stale. Thank you for your contributions. - -# Limit the number of actions per hour, from 1-30. Default is 30 -limitPerRun: 30 - -# Limit to only `issues` or `pulls` -only: issues - diff --git a/vendor/sebastian/resource-operations/.gitignore b/vendor/sebastian/resource-operations/.gitignore deleted file mode 100644 index 4f9b239..0000000 --- a/vendor/sebastian/resource-operations/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -/.idea -/.php_cs.cache -/build/FunctionSignatureMap.php -/composer.lock -/vendor diff --git a/vendor/sebastian/resource-operations/.php_cs.dist b/vendor/sebastian/resource-operations/.php_cs.dist deleted file mode 100644 index 22641a6..0000000 --- a/vendor/sebastian/resource-operations/.php_cs.dist +++ /dev/null @@ -1,191 +0,0 @@ - - -For the full copyright and license information, please view the LICENSE -file that was distributed with this source code. -EOF; - -return PhpCsFixer\Config::create() - ->setRiskyAllowed(true) - ->setRules( - [ - 'align_multiline_comment' => true, - 'array_indentation' => true, - 'array_syntax' => ['syntax' => 'short'], - 'binary_operator_spaces' => [ - 'operators' => [ - '=' => 'align', - '=>' => 'align', - ], - ], - 'blank_line_after_namespace' => true, - 'blank_line_before_statement' => [ - 'statements' => [ - 'break', - 'continue', - 'declare', - 'do', - 'for', - 'foreach', - 'if', - 'include', - 'include_once', - 'require', - 'require_once', - 'return', - 'switch', - 'throw', - 'try', - 'while', - 'yield', - ], - ], - 'braces' => true, - 'cast_spaces' => true, - 'class_attributes_separation' => ['elements' => ['const', 'method', 'property']], - 'combine_consecutive_issets' => true, - 'combine_consecutive_unsets' => true, - 'compact_nullable_typehint' => true, - 'concat_space' => ['spacing' => 'one'], - 'declare_equal_normalize' => ['space' => 'none'], - 'declare_strict_types' => true, - 'dir_constant' => true, - 'elseif' => true, - 'encoding' => true, - 'full_opening_tag' => true, - 'function_declaration' => true, - 'header_comment' => ['header' => $header, 'separate' => 'none'], - 'indentation_type' => true, - 'is_null' => true, - 'line_ending' => true, - 'list_syntax' => ['syntax' => 'short'], - 'logical_operators' => true, - 'lowercase_cast' => true, - 'lowercase_constants' => true, - 'lowercase_keywords' => true, - 'lowercase_static_reference' => true, - 'magic_constant_casing' => true, - 'method_argument_space' => ['ensure_fully_multiline' => true], - 'modernize_types_casting' => true, - 'multiline_comment_opening_closing' => true, - 'multiline_whitespace_before_semicolons' => true, - 'native_constant_invocation' => true, - 'native_function_casing' => true, - 'native_function_invocation' => true, - 'new_with_braces' => false, - 'no_alias_functions' => true, - 'no_alternative_syntax' => true, - 'no_blank_lines_after_class_opening' => true, - 'no_blank_lines_after_phpdoc' => true, - 'no_blank_lines_before_namespace' => true, - 'no_closing_tag' => true, - 'no_empty_comment' => true, - 'no_empty_phpdoc' => true, - 'no_empty_statement' => true, - 'no_extra_blank_lines' => true, - 'no_homoglyph_names' => true, - 'no_leading_import_slash' => true, - 'no_leading_namespace_whitespace' => true, - 'no_mixed_echo_print' => ['use' => 'print'], - 'no_multiline_whitespace_around_double_arrow' => true, - 'no_null_property_initialization' => true, - 'no_php4_constructor' => true, - 'no_short_bool_cast' => true, - 'no_short_echo_tag' => true, - 'no_singleline_whitespace_before_semicolons' => true, - 'no_spaces_after_function_name' => true, - 'no_spaces_inside_parenthesis' => true, - 'no_superfluous_elseif' => true, - 'no_superfluous_phpdoc_tags' => true, - 'no_trailing_comma_in_list_call' => true, - 'no_trailing_comma_in_singleline_array' => true, - 'no_trailing_whitespace' => true, - 'no_trailing_whitespace_in_comment' => true, - 'no_unneeded_control_parentheses' => true, - 'no_unneeded_curly_braces' => true, - 'no_unneeded_final_method' => true, - 'no_unreachable_default_argument_value' => true, - 'no_unset_on_property' => true, - 'no_unused_imports' => true, - 'no_useless_else' => true, - 'no_useless_return' => true, - 'no_whitespace_before_comma_in_array' => true, - 'no_whitespace_in_blank_line' => true, - 'non_printable_character' => true, - 'normalize_index_brace' => true, - 'object_operator_without_whitespace' => true, - 'ordered_class_elements' => [ - 'order' => [ - 'use_trait', - 'constant_public', - 'constant_protected', - 'constant_private', - 'property_public_static', - 'property_protected_static', - 'property_private_static', - 'property_public', - 'property_protected', - 'property_private', - 'method_public_static', - 'construct', - 'destruct', - 'magic', - 'phpunit', - 'method_public', - 'method_protected', - 'method_private', - 'method_protected_static', - 'method_private_static', - ], - ], - 'ordered_imports' => true, - 'phpdoc_add_missing_param_annotation' => true, - 'phpdoc_align' => true, - 'phpdoc_annotation_without_dot' => true, - 'phpdoc_indent' => true, - 'phpdoc_no_access' => true, - 'phpdoc_no_empty_return' => true, - 'phpdoc_no_package' => true, - 'phpdoc_order' => true, - 'phpdoc_return_self_reference' => true, - 'phpdoc_scalar' => true, - 'phpdoc_separation' => true, - 'phpdoc_single_line_var_spacing' => true, - 'phpdoc_to_comment' => true, - 'phpdoc_trim' => true, - 'phpdoc_trim_consecutive_blank_line_separation' => true, - 'phpdoc_types' => true, - 'phpdoc_types_order' => true, - 'phpdoc_var_without_name' => true, - 'pow_to_exponentiation' => true, - 'protected_to_private' => true, - 'return_assignment' => true, - 'return_type_declaration' => ['space_before' => 'none'], - 'self_accessor' => true, - 'semicolon_after_instruction' => true, - 'set_type_to_cast' => true, - 'short_scalar_cast' => true, - 'simplified_null_return' => true, - 'single_blank_line_at_eof' => true, - 'single_import_per_statement' => true, - 'single_line_after_imports' => true, - 'single_quote' => true, - 'standardize_not_equals' => true, - 'ternary_to_null_coalescing' => true, - 'trailing_comma_in_multiline_array' => true, - 'trim_array_spaces' => true, - 'unary_operator_spaces' => true, - 'visibility_required' => true, - 'void_return' => true, - 'whitespace_after_comma_in_array' => true, - ] - ) - ->setFinder( - PhpCsFixer\Finder::create() - ->files() - ->in(__DIR__ . '/src') - ->in(__DIR__ . '/tests') - ); diff --git a/vendor/sebastian/resource-operations/ChangeLog.md b/vendor/sebastian/resource-operations/ChangeLog.md deleted file mode 100644 index 311f2d4..0000000 --- a/vendor/sebastian/resource-operations/ChangeLog.md +++ /dev/null @@ -1,33 +0,0 @@ -# ChangeLog - -All notable changes are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. - -## [2.0.2] - 2020-11-30 - -### Changed - -* Changed PHP version constraint in `composer.json` from `^7.1` to `>=7.1` - -## [2.0.1] - 2018-10-04 - -### Fixed - -* Functions and methods with nullable parameters of type `resource` are now also considered - -## [2.0.0] - 2018-09-27 - -### Changed - -* [FunctionSignatureMap.php](https://raw.githubusercontent.com/phan/phan/master/src/Phan/Language/Internal/FunctionSignatureMap.php) from `phan/phan` is now used instead of [arginfo.php](https://raw.githubusercontent.com/rlerdorf/phan/master/includes/arginfo.php) from `rlerdorf/phan` - -### Removed - -* This component is no longer supported on PHP 5.6 and PHP 7.0 - -## 1.0.0 - 2015-07-28 - -* Initial release - -[2.0.2]: https://github.com/sebastianbergmann/comparator/compare/2.0.1...2.0.2 -[2.0.1]: https://github.com/sebastianbergmann/comparator/compare/2.0.0...2.0.1 -[2.0.0]: https://github.com/sebastianbergmann/comparator/compare/1.0.0...2.0.0 diff --git a/vendor/sebastian/resource-operations/LICENSE b/vendor/sebastian/resource-operations/LICENSE deleted file mode 100644 index 2727218..0000000 --- a/vendor/sebastian/resource-operations/LICENSE +++ /dev/null @@ -1,33 +0,0 @@ -Resource Operations - -Copyright (c) 2015-2018, Sebastian Bergmann . -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Sebastian Bergmann nor the names of his - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/sebastian/resource-operations/README.md b/vendor/sebastian/resource-operations/README.md deleted file mode 100644 index 88b05cc..0000000 --- a/vendor/sebastian/resource-operations/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# Resource Operations - -Provides a list of PHP built-in functions that operate on resources. - -## Installation - -You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): - - composer require sebastian/resource-operations - -If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: - - composer require --dev sebastian/resource-operations - diff --git a/vendor/sebastian/resource-operations/build.xml b/vendor/sebastian/resource-operations/build.xml deleted file mode 100644 index 695ffa8..0000000 --- a/vendor/sebastian/resource-operations/build.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/sebastian/resource-operations/build/generate.php b/vendor/sebastian/resource-operations/build/generate.php deleted file mode 100755 index 0354dc4..0000000 --- a/vendor/sebastian/resource-operations/build/generate.php +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env php - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -$functions = require __DIR__ . '/FunctionSignatureMap.php'; -$resourceFunctions = []; - -foreach ($functions as $function => $arguments) { - foreach ($arguments as $argument) { - if (strpos($argument, '?') === 0) { - $argument = substr($argument, 1); - } - - if ($argument === 'resource') { - $resourceFunctions[] = explode('\'', $function)[0]; - } - } -} - -$resourceFunctions = array_unique($resourceFunctions); -sort($resourceFunctions); - -$buffer = << - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\ResourceOperations; - -final class ResourceOperations -{ - /** - * @return string[] - */ - public static function getFunctions(): array - { - return [ - -EOT; - -foreach ($resourceFunctions as $function) { - $buffer .= sprintf(" '%s',\n", $function); -} - -$buffer .= <<< EOT - ]; - } -} - -EOT; - -file_put_contents(__DIR__ . '/../src/ResourceOperations.php', $buffer); - diff --git a/vendor/sebastian/resource-operations/composer.json b/vendor/sebastian/resource-operations/composer.json deleted file mode 100644 index 733a3f8..0000000 --- a/vendor/sebastian/resource-operations/composer.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "sebastian/resource-operations", - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "require": { - "php": ">=7.1" - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "config": { - "platform": { - "php": "7.1.0" - }, - "optimize-autoloader": true, - "sort-packages": true - }, - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - } -} - diff --git a/vendor/sebastian/resource-operations/src/ResourceOperations.php b/vendor/sebastian/resource-operations/src/ResourceOperations.php deleted file mode 100644 index f3911f3..0000000 --- a/vendor/sebastian/resource-operations/src/ResourceOperations.php +++ /dev/null @@ -1,2232 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\ResourceOperations; - -final class ResourceOperations -{ - /** - * @return string[] - */ - public static function getFunctions(): array - { - return [ - 'Directory::close', - 'Directory::read', - 'Directory::rewind', - 'DirectoryIterator::openFile', - 'FilesystemIterator::openFile', - 'Gmagick::readimagefile', - 'HttpResponse::getRequestBodyStream', - 'HttpResponse::getStream', - 'HttpResponse::setStream', - 'Imagick::pingImageFile', - 'Imagick::readImageFile', - 'Imagick::writeImageFile', - 'Imagick::writeImagesFile', - 'MongoGridFSCursor::__construct', - 'MongoGridFSFile::getResource', - 'MysqlndUhConnection::stmtInit', - 'MysqlndUhConnection::storeResult', - 'MysqlndUhConnection::useResult', - 'PDF_activate_item', - 'PDF_add_launchlink', - 'PDF_add_locallink', - 'PDF_add_nameddest', - 'PDF_add_note', - 'PDF_add_pdflink', - 'PDF_add_table_cell', - 'PDF_add_textflow', - 'PDF_add_thumbnail', - 'PDF_add_weblink', - 'PDF_arc', - 'PDF_arcn', - 'PDF_attach_file', - 'PDF_begin_document', - 'PDF_begin_font', - 'PDF_begin_glyph', - 'PDF_begin_item', - 'PDF_begin_layer', - 'PDF_begin_page', - 'PDF_begin_page_ext', - 'PDF_begin_pattern', - 'PDF_begin_template', - 'PDF_begin_template_ext', - 'PDF_circle', - 'PDF_clip', - 'PDF_close', - 'PDF_close_image', - 'PDF_close_pdi', - 'PDF_close_pdi_page', - 'PDF_closepath', - 'PDF_closepath_fill_stroke', - 'PDF_closepath_stroke', - 'PDF_concat', - 'PDF_continue_text', - 'PDF_create_3dview', - 'PDF_create_action', - 'PDF_create_annotation', - 'PDF_create_bookmark', - 'PDF_create_field', - 'PDF_create_fieldgroup', - 'PDF_create_gstate', - 'PDF_create_pvf', - 'PDF_create_textflow', - 'PDF_curveto', - 'PDF_define_layer', - 'PDF_delete', - 'PDF_delete_pvf', - 'PDF_delete_table', - 'PDF_delete_textflow', - 'PDF_encoding_set_char', - 'PDF_end_document', - 'PDF_end_font', - 'PDF_end_glyph', - 'PDF_end_item', - 'PDF_end_layer', - 'PDF_end_page', - 'PDF_end_page_ext', - 'PDF_end_pattern', - 'PDF_end_template', - 'PDF_endpath', - 'PDF_fill', - 'PDF_fill_imageblock', - 'PDF_fill_pdfblock', - 'PDF_fill_stroke', - 'PDF_fill_textblock', - 'PDF_findfont', - 'PDF_fit_image', - 'PDF_fit_pdi_page', - 'PDF_fit_table', - 'PDF_fit_textflow', - 'PDF_fit_textline', - 'PDF_get_apiname', - 'PDF_get_buffer', - 'PDF_get_errmsg', - 'PDF_get_errnum', - 'PDF_get_parameter', - 'PDF_get_pdi_parameter', - 'PDF_get_pdi_value', - 'PDF_get_value', - 'PDF_info_font', - 'PDF_info_matchbox', - 'PDF_info_table', - 'PDF_info_textflow', - 'PDF_info_textline', - 'PDF_initgraphics', - 'PDF_lineto', - 'PDF_load_3ddata', - 'PDF_load_font', - 'PDF_load_iccprofile', - 'PDF_load_image', - 'PDF_makespotcolor', - 'PDF_moveto', - 'PDF_new', - 'PDF_open_ccitt', - 'PDF_open_file', - 'PDF_open_image', - 'PDF_open_image_file', - 'PDF_open_memory_image', - 'PDF_open_pdi', - 'PDF_open_pdi_document', - 'PDF_open_pdi_page', - 'PDF_pcos_get_number', - 'PDF_pcos_get_stream', - 'PDF_pcos_get_string', - 'PDF_place_image', - 'PDF_place_pdi_page', - 'PDF_process_pdi', - 'PDF_rect', - 'PDF_restore', - 'PDF_resume_page', - 'PDF_rotate', - 'PDF_save', - 'PDF_scale', - 'PDF_set_border_color', - 'PDF_set_border_dash', - 'PDF_set_border_style', - 'PDF_set_gstate', - 'PDF_set_info', - 'PDF_set_layer_dependency', - 'PDF_set_parameter', - 'PDF_set_text_pos', - 'PDF_set_value', - 'PDF_setcolor', - 'PDF_setdash', - 'PDF_setdashpattern', - 'PDF_setflat', - 'PDF_setfont', - 'PDF_setgray', - 'PDF_setgray_fill', - 'PDF_setgray_stroke', - 'PDF_setlinecap', - 'PDF_setlinejoin', - 'PDF_setlinewidth', - 'PDF_setmatrix', - 'PDF_setmiterlimit', - 'PDF_setrgbcolor', - 'PDF_setrgbcolor_fill', - 'PDF_setrgbcolor_stroke', - 'PDF_shading', - 'PDF_shading_pattern', - 'PDF_shfill', - 'PDF_show', - 'PDF_show_boxed', - 'PDF_show_xy', - 'PDF_skew', - 'PDF_stringwidth', - 'PDF_stroke', - 'PDF_suspend_page', - 'PDF_translate', - 'PDF_utf16_to_utf8', - 'PDF_utf32_to_utf16', - 'PDF_utf8_to_utf16', - 'PDO::pgsqlLOBOpen', - 'RarEntry::getStream', - 'SQLite3::openBlob', - 'SWFMovie::saveToFile', - 'SplFileInfo::openFile', - 'SplFileObject::openFile', - 'SplTempFileObject::openFile', - 'V8Js::compileString', - 'V8Js::executeScript', - 'Vtiful\Kernel\Excel::setColumn', - 'Vtiful\Kernel\Excel::setRow', - 'Vtiful\Kernel\Format::align', - 'Vtiful\Kernel\Format::bold', - 'Vtiful\Kernel\Format::italic', - 'Vtiful\Kernel\Format::underline', - 'XMLWriter::openMemory', - 'XMLWriter::openURI', - 'ZipArchive::getStream', - 'Zookeeper::setLogStream', - 'apc_bin_dumpfile', - 'apc_bin_loadfile', - 'bbcode_add_element', - 'bbcode_add_smiley', - 'bbcode_create', - 'bbcode_destroy', - 'bbcode_parse', - 'bbcode_set_arg_parser', - 'bbcode_set_flags', - 'bcompiler_read', - 'bcompiler_write_class', - 'bcompiler_write_constant', - 'bcompiler_write_exe_footer', - 'bcompiler_write_file', - 'bcompiler_write_footer', - 'bcompiler_write_function', - 'bcompiler_write_functions_from_file', - 'bcompiler_write_header', - 'bcompiler_write_included_filename', - 'bzclose', - 'bzerrno', - 'bzerror', - 'bzerrstr', - 'bzflush', - 'bzopen', - 'bzread', - 'bzwrite', - 'cairo_surface_write_to_png', - 'closedir', - 'copy', - 'crack_closedict', - 'crack_opendict', - 'cubrid_bind', - 'cubrid_close_prepare', - 'cubrid_close_request', - 'cubrid_col_get', - 'cubrid_col_size', - 'cubrid_column_names', - 'cubrid_column_types', - 'cubrid_commit', - 'cubrid_connect', - 'cubrid_connect_with_url', - 'cubrid_current_oid', - 'cubrid_db_parameter', - 'cubrid_disconnect', - 'cubrid_drop', - 'cubrid_fetch', - 'cubrid_free_result', - 'cubrid_get', - 'cubrid_get_autocommit', - 'cubrid_get_charset', - 'cubrid_get_class_name', - 'cubrid_get_db_parameter', - 'cubrid_get_query_timeout', - 'cubrid_get_server_info', - 'cubrid_insert_id', - 'cubrid_is_instance', - 'cubrid_lob2_bind', - 'cubrid_lob2_close', - 'cubrid_lob2_export', - 'cubrid_lob2_import', - 'cubrid_lob2_new', - 'cubrid_lob2_read', - 'cubrid_lob2_seek', - 'cubrid_lob2_seek64', - 'cubrid_lob2_size', - 'cubrid_lob2_size64', - 'cubrid_lob2_tell', - 'cubrid_lob2_tell64', - 'cubrid_lob2_write', - 'cubrid_lob_export', - 'cubrid_lob_get', - 'cubrid_lob_send', - 'cubrid_lob_size', - 'cubrid_lock_read', - 'cubrid_lock_write', - 'cubrid_move_cursor', - 'cubrid_next_result', - 'cubrid_num_cols', - 'cubrid_num_rows', - 'cubrid_pconnect', - 'cubrid_pconnect_with_url', - 'cubrid_prepare', - 'cubrid_put', - 'cubrid_query', - 'cubrid_rollback', - 'cubrid_schema', - 'cubrid_seq_add', - 'cubrid_seq_drop', - 'cubrid_seq_insert', - 'cubrid_seq_put', - 'cubrid_set_add', - 'cubrid_set_autocommit', - 'cubrid_set_db_parameter', - 'cubrid_set_drop', - 'cubrid_set_query_timeout', - 'cubrid_unbuffered_query', - 'curl_close', - 'curl_copy_handle', - 'curl_errno', - 'curl_error', - 'curl_escape', - 'curl_exec', - 'curl_getinfo', - 'curl_multi_add_handle', - 'curl_multi_close', - 'curl_multi_errno', - 'curl_multi_exec', - 'curl_multi_getcontent', - 'curl_multi_info_read', - 'curl_multi_remove_handle', - 'curl_multi_select', - 'curl_multi_setopt', - 'curl_pause', - 'curl_reset', - 'curl_setopt', - 'curl_setopt_array', - 'curl_share_close', - 'curl_share_errno', - 'curl_share_init', - 'curl_share_setopt', - 'curl_unescape', - 'cyrus_authenticate', - 'cyrus_bind', - 'cyrus_close', - 'cyrus_connect', - 'cyrus_query', - 'cyrus_unbind', - 'db2_autocommit', - 'db2_bind_param', - 'db2_client_info', - 'db2_close', - 'db2_column_privileges', - 'db2_columns', - 'db2_commit', - 'db2_conn_error', - 'db2_conn_errormsg', - 'db2_connect', - 'db2_cursor_type', - 'db2_exec', - 'db2_execute', - 'db2_fetch_array', - 'db2_fetch_assoc', - 'db2_fetch_both', - 'db2_fetch_object', - 'db2_fetch_row', - 'db2_field_display_size', - 'db2_field_name', - 'db2_field_num', - 'db2_field_precision', - 'db2_field_scale', - 'db2_field_type', - 'db2_field_width', - 'db2_foreign_keys', - 'db2_free_result', - 'db2_free_stmt', - 'db2_get_option', - 'db2_last_insert_id', - 'db2_lob_read', - 'db2_next_result', - 'db2_num_fields', - 'db2_num_rows', - 'db2_pclose', - 'db2_pconnect', - 'db2_prepare', - 'db2_primary_keys', - 'db2_procedure_columns', - 'db2_procedures', - 'db2_result', - 'db2_rollback', - 'db2_server_info', - 'db2_set_option', - 'db2_special_columns', - 'db2_statistics', - 'db2_stmt_error', - 'db2_stmt_errormsg', - 'db2_table_privileges', - 'db2_tables', - 'dba_close', - 'dba_delete', - 'dba_exists', - 'dba_fetch', - 'dba_firstkey', - 'dba_insert', - 'dba_nextkey', - 'dba_open', - 'dba_optimize', - 'dba_popen', - 'dba_replace', - 'dba_sync', - 'dbplus_add', - 'dbplus_aql', - 'dbplus_close', - 'dbplus_curr', - 'dbplus_find', - 'dbplus_first', - 'dbplus_flush', - 'dbplus_freelock', - 'dbplus_freerlocks', - 'dbplus_getlock', - 'dbplus_getunique', - 'dbplus_info', - 'dbplus_last', - 'dbplus_lockrel', - 'dbplus_next', - 'dbplus_open', - 'dbplus_prev', - 'dbplus_rchperm', - 'dbplus_rcreate', - 'dbplus_rcrtexact', - 'dbplus_rcrtlike', - 'dbplus_restorepos', - 'dbplus_rkeys', - 'dbplus_ropen', - 'dbplus_rquery', - 'dbplus_rrename', - 'dbplus_rsecindex', - 'dbplus_runlink', - 'dbplus_rzap', - 'dbplus_savepos', - 'dbplus_setindex', - 'dbplus_setindexbynumber', - 'dbplus_sql', - 'dbplus_tremove', - 'dbplus_undo', - 'dbplus_undoprepare', - 'dbplus_unlockrel', - 'dbplus_unselect', - 'dbplus_update', - 'dbplus_xlockrel', - 'dbplus_xunlockrel', - 'deflate_add', - 'dio_close', - 'dio_fcntl', - 'dio_open', - 'dio_read', - 'dio_seek', - 'dio_stat', - 'dio_tcsetattr', - 'dio_truncate', - 'dio_write', - 'dir', - 'eio_busy', - 'eio_cancel', - 'eio_chmod', - 'eio_chown', - 'eio_close', - 'eio_custom', - 'eio_dup2', - 'eio_fallocate', - 'eio_fchmod', - 'eio_fchown', - 'eio_fdatasync', - 'eio_fstat', - 'eio_fstatvfs', - 'eio_fsync', - 'eio_ftruncate', - 'eio_futime', - 'eio_get_last_error', - 'eio_grp', - 'eio_grp_add', - 'eio_grp_cancel', - 'eio_grp_limit', - 'eio_link', - 'eio_lstat', - 'eio_mkdir', - 'eio_mknod', - 'eio_nop', - 'eio_open', - 'eio_read', - 'eio_readahead', - 'eio_readdir', - 'eio_readlink', - 'eio_realpath', - 'eio_rename', - 'eio_rmdir', - 'eio_seek', - 'eio_sendfile', - 'eio_stat', - 'eio_statvfs', - 'eio_symlink', - 'eio_sync', - 'eio_sync_file_range', - 'eio_syncfs', - 'eio_truncate', - 'eio_unlink', - 'eio_utime', - 'eio_write', - 'enchant_broker_describe', - 'enchant_broker_dict_exists', - 'enchant_broker_free', - 'enchant_broker_free_dict', - 'enchant_broker_get_dict_path', - 'enchant_broker_get_error', - 'enchant_broker_init', - 'enchant_broker_list_dicts', - 'enchant_broker_request_dict', - 'enchant_broker_request_pwl_dict', - 'enchant_broker_set_dict_path', - 'enchant_broker_set_ordering', - 'enchant_dict_add_to_personal', - 'enchant_dict_add_to_session', - 'enchant_dict_check', - 'enchant_dict_describe', - 'enchant_dict_get_error', - 'enchant_dict_is_in_session', - 'enchant_dict_quick_check', - 'enchant_dict_store_replacement', - 'enchant_dict_suggest', - 'event_add', - 'event_base_free', - 'event_base_loop', - 'event_base_loopbreak', - 'event_base_loopexit', - 'event_base_new', - 'event_base_priority_init', - 'event_base_reinit', - 'event_base_set', - 'event_buffer_base_set', - 'event_buffer_disable', - 'event_buffer_enable', - 'event_buffer_fd_set', - 'event_buffer_free', - 'event_buffer_new', - 'event_buffer_priority_set', - 'event_buffer_read', - 'event_buffer_set_callback', - 'event_buffer_timeout_set', - 'event_buffer_watermark_set', - 'event_buffer_write', - 'event_del', - 'event_free', - 'event_new', - 'event_priority_set', - 'event_set', - 'event_timer_add', - 'event_timer_del', - 'event_timer_pending', - 'event_timer_set', - 'expect_expectl', - 'expect_popen', - 'fam_cancel_monitor', - 'fam_close', - 'fam_monitor_collection', - 'fam_monitor_directory', - 'fam_monitor_file', - 'fam_next_event', - 'fam_open', - 'fam_pending', - 'fam_resume_monitor', - 'fam_suspend_monitor', - 'fann_cascadetrain_on_data', - 'fann_cascadetrain_on_file', - 'fann_clear_scaling_params', - 'fann_copy', - 'fann_create_from_file', - 'fann_create_shortcut_array', - 'fann_create_standard', - 'fann_create_standard_array', - 'fann_create_train', - 'fann_create_train_from_callback', - 'fann_descale_input', - 'fann_descale_output', - 'fann_descale_train', - 'fann_destroy', - 'fann_destroy_train', - 'fann_duplicate_train_data', - 'fann_get_MSE', - 'fann_get_activation_function', - 'fann_get_activation_steepness', - 'fann_get_bias_array', - 'fann_get_bit_fail', - 'fann_get_bit_fail_limit', - 'fann_get_cascade_activation_functions', - 'fann_get_cascade_activation_functions_count', - 'fann_get_cascade_activation_steepnesses', - 'fann_get_cascade_activation_steepnesses_count', - 'fann_get_cascade_candidate_change_fraction', - 'fann_get_cascade_candidate_limit', - 'fann_get_cascade_candidate_stagnation_epochs', - 'fann_get_cascade_max_cand_epochs', - 'fann_get_cascade_max_out_epochs', - 'fann_get_cascade_min_cand_epochs', - 'fann_get_cascade_min_out_epochs', - 'fann_get_cascade_num_candidate_groups', - 'fann_get_cascade_num_candidates', - 'fann_get_cascade_output_change_fraction', - 'fann_get_cascade_output_stagnation_epochs', - 'fann_get_cascade_weight_multiplier', - 'fann_get_connection_array', - 'fann_get_connection_rate', - 'fann_get_errno', - 'fann_get_errstr', - 'fann_get_layer_array', - 'fann_get_learning_momentum', - 'fann_get_learning_rate', - 'fann_get_network_type', - 'fann_get_num_input', - 'fann_get_num_layers', - 'fann_get_num_output', - 'fann_get_quickprop_decay', - 'fann_get_quickprop_mu', - 'fann_get_rprop_decrease_factor', - 'fann_get_rprop_delta_max', - 'fann_get_rprop_delta_min', - 'fann_get_rprop_delta_zero', - 'fann_get_rprop_increase_factor', - 'fann_get_sarprop_step_error_shift', - 'fann_get_sarprop_step_error_threshold_factor', - 'fann_get_sarprop_temperature', - 'fann_get_sarprop_weight_decay_shift', - 'fann_get_total_connections', - 'fann_get_total_neurons', - 'fann_get_train_error_function', - 'fann_get_train_stop_function', - 'fann_get_training_algorithm', - 'fann_init_weights', - 'fann_length_train_data', - 'fann_merge_train_data', - 'fann_num_input_train_data', - 'fann_num_output_train_data', - 'fann_randomize_weights', - 'fann_read_train_from_file', - 'fann_reset_errno', - 'fann_reset_errstr', - 'fann_run', - 'fann_save', - 'fann_save_train', - 'fann_scale_input', - 'fann_scale_input_train_data', - 'fann_scale_output', - 'fann_scale_output_train_data', - 'fann_scale_train', - 'fann_scale_train_data', - 'fann_set_activation_function', - 'fann_set_activation_function_hidden', - 'fann_set_activation_function_layer', - 'fann_set_activation_function_output', - 'fann_set_activation_steepness', - 'fann_set_activation_steepness_hidden', - 'fann_set_activation_steepness_layer', - 'fann_set_activation_steepness_output', - 'fann_set_bit_fail_limit', - 'fann_set_callback', - 'fann_set_cascade_activation_functions', - 'fann_set_cascade_activation_steepnesses', - 'fann_set_cascade_candidate_change_fraction', - 'fann_set_cascade_candidate_limit', - 'fann_set_cascade_candidate_stagnation_epochs', - 'fann_set_cascade_max_cand_epochs', - 'fann_set_cascade_max_out_epochs', - 'fann_set_cascade_min_cand_epochs', - 'fann_set_cascade_min_out_epochs', - 'fann_set_cascade_num_candidate_groups', - 'fann_set_cascade_output_change_fraction', - 'fann_set_cascade_output_stagnation_epochs', - 'fann_set_cascade_weight_multiplier', - 'fann_set_error_log', - 'fann_set_input_scaling_params', - 'fann_set_learning_momentum', - 'fann_set_learning_rate', - 'fann_set_output_scaling_params', - 'fann_set_quickprop_decay', - 'fann_set_quickprop_mu', - 'fann_set_rprop_decrease_factor', - 'fann_set_rprop_delta_max', - 'fann_set_rprop_delta_min', - 'fann_set_rprop_delta_zero', - 'fann_set_rprop_increase_factor', - 'fann_set_sarprop_step_error_shift', - 'fann_set_sarprop_step_error_threshold_factor', - 'fann_set_sarprop_temperature', - 'fann_set_sarprop_weight_decay_shift', - 'fann_set_scaling_params', - 'fann_set_train_error_function', - 'fann_set_train_stop_function', - 'fann_set_training_algorithm', - 'fann_set_weight', - 'fann_set_weight_array', - 'fann_shuffle_train_data', - 'fann_subset_train_data', - 'fann_test', - 'fann_test_data', - 'fann_train', - 'fann_train_epoch', - 'fann_train_on_data', - 'fann_train_on_file', - 'fbsql_affected_rows', - 'fbsql_autocommit', - 'fbsql_blob_size', - 'fbsql_change_user', - 'fbsql_clob_size', - 'fbsql_close', - 'fbsql_commit', - 'fbsql_connect', - 'fbsql_create_blob', - 'fbsql_create_clob', - 'fbsql_create_db', - 'fbsql_data_seek', - 'fbsql_database', - 'fbsql_database_password', - 'fbsql_db_query', - 'fbsql_db_status', - 'fbsql_drop_db', - 'fbsql_errno', - 'fbsql_error', - 'fbsql_fetch_array', - 'fbsql_fetch_assoc', - 'fbsql_fetch_field', - 'fbsql_fetch_lengths', - 'fbsql_fetch_object', - 'fbsql_fetch_row', - 'fbsql_field_flags', - 'fbsql_field_len', - 'fbsql_field_name', - 'fbsql_field_seek', - 'fbsql_field_table', - 'fbsql_field_type', - 'fbsql_free_result', - 'fbsql_get_autostart_info', - 'fbsql_hostname', - 'fbsql_insert_id', - 'fbsql_list_dbs', - 'fbsql_list_fields', - 'fbsql_list_tables', - 'fbsql_next_result', - 'fbsql_num_fields', - 'fbsql_num_rows', - 'fbsql_password', - 'fbsql_pconnect', - 'fbsql_query', - 'fbsql_read_blob', - 'fbsql_read_clob', - 'fbsql_result', - 'fbsql_rollback', - 'fbsql_rows_fetched', - 'fbsql_select_db', - 'fbsql_set_characterset', - 'fbsql_set_lob_mode', - 'fbsql_set_password', - 'fbsql_set_transaction', - 'fbsql_start_db', - 'fbsql_stop_db', - 'fbsql_table_name', - 'fbsql_username', - 'fclose', - 'fdf_add_doc_javascript', - 'fdf_add_template', - 'fdf_close', - 'fdf_create', - 'fdf_enum_values', - 'fdf_get_ap', - 'fdf_get_attachment', - 'fdf_get_encoding', - 'fdf_get_file', - 'fdf_get_flags', - 'fdf_get_opt', - 'fdf_get_status', - 'fdf_get_value', - 'fdf_get_version', - 'fdf_next_field_name', - 'fdf_open', - 'fdf_open_string', - 'fdf_remove_item', - 'fdf_save', - 'fdf_save_string', - 'fdf_set_ap', - 'fdf_set_encoding', - 'fdf_set_file', - 'fdf_set_flags', - 'fdf_set_javascript_action', - 'fdf_set_on_import_javascript', - 'fdf_set_opt', - 'fdf_set_status', - 'fdf_set_submit_form_action', - 'fdf_set_target_frame', - 'fdf_set_value', - 'fdf_set_version', - 'feof', - 'fflush', - 'ffmpeg_frame::__construct', - 'ffmpeg_frame::toGDImage', - 'fgetc', - 'fgetcsv', - 'fgets', - 'fgetss', - 'file', - 'file_get_contents', - 'file_put_contents', - 'finfo::buffer', - 'finfo::file', - 'finfo_buffer', - 'finfo_close', - 'finfo_file', - 'finfo_open', - 'finfo_set_flags', - 'flock', - 'fopen', - 'fpassthru', - 'fprintf', - 'fputcsv', - 'fputs', - 'fread', - 'fscanf', - 'fseek', - 'fstat', - 'ftell', - 'ftp_alloc', - 'ftp_append', - 'ftp_cdup', - 'ftp_chdir', - 'ftp_chmod', - 'ftp_close', - 'ftp_delete', - 'ftp_exec', - 'ftp_fget', - 'ftp_fput', - 'ftp_get', - 'ftp_get_option', - 'ftp_login', - 'ftp_mdtm', - 'ftp_mkdir', - 'ftp_mlsd', - 'ftp_nb_continue', - 'ftp_nb_fget', - 'ftp_nb_fput', - 'ftp_nb_get', - 'ftp_nb_put', - 'ftp_nlist', - 'ftp_pasv', - 'ftp_put', - 'ftp_pwd', - 'ftp_quit', - 'ftp_raw', - 'ftp_rawlist', - 'ftp_rename', - 'ftp_rmdir', - 'ftp_set_option', - 'ftp_site', - 'ftp_size', - 'ftp_systype', - 'ftruncate', - 'fwrite', - 'get_resource_type', - 'gmp_div', - 'gnupg::init', - 'gnupg_adddecryptkey', - 'gnupg_addencryptkey', - 'gnupg_addsignkey', - 'gnupg_cleardecryptkeys', - 'gnupg_clearencryptkeys', - 'gnupg_clearsignkeys', - 'gnupg_decrypt', - 'gnupg_decryptverify', - 'gnupg_encrypt', - 'gnupg_encryptsign', - 'gnupg_export', - 'gnupg_geterror', - 'gnupg_getprotocol', - 'gnupg_import', - 'gnupg_init', - 'gnupg_keyinfo', - 'gnupg_setarmor', - 'gnupg_seterrormode', - 'gnupg_setsignmode', - 'gnupg_sign', - 'gnupg_verify', - 'gupnp_context_get_host_ip', - 'gupnp_context_get_port', - 'gupnp_context_get_subscription_timeout', - 'gupnp_context_host_path', - 'gupnp_context_new', - 'gupnp_context_set_subscription_timeout', - 'gupnp_context_timeout_add', - 'gupnp_context_unhost_path', - 'gupnp_control_point_browse_start', - 'gupnp_control_point_browse_stop', - 'gupnp_control_point_callback_set', - 'gupnp_control_point_new', - 'gupnp_device_action_callback_set', - 'gupnp_device_info_get', - 'gupnp_device_info_get_service', - 'gupnp_root_device_get_available', - 'gupnp_root_device_get_relative_location', - 'gupnp_root_device_new', - 'gupnp_root_device_set_available', - 'gupnp_root_device_start', - 'gupnp_root_device_stop', - 'gupnp_service_action_get', - 'gupnp_service_action_return', - 'gupnp_service_action_return_error', - 'gupnp_service_action_set', - 'gupnp_service_freeze_notify', - 'gupnp_service_info_get', - 'gupnp_service_info_get_introspection', - 'gupnp_service_introspection_get_state_variable', - 'gupnp_service_notify', - 'gupnp_service_proxy_action_get', - 'gupnp_service_proxy_action_set', - 'gupnp_service_proxy_add_notify', - 'gupnp_service_proxy_callback_set', - 'gupnp_service_proxy_get_subscribed', - 'gupnp_service_proxy_remove_notify', - 'gupnp_service_proxy_send_action', - 'gupnp_service_proxy_set_subscribed', - 'gupnp_service_thaw_notify', - 'gzclose', - 'gzeof', - 'gzgetc', - 'gzgets', - 'gzgetss', - 'gzpassthru', - 'gzputs', - 'gzread', - 'gzrewind', - 'gzseek', - 'gztell', - 'gzwrite', - 'hash_update_stream', - 'http\Env\Response::send', - 'http_get_request_body_stream', - 'ibase_add_user', - 'ibase_affected_rows', - 'ibase_backup', - 'ibase_blob_add', - 'ibase_blob_cancel', - 'ibase_blob_close', - 'ibase_blob_create', - 'ibase_blob_get', - 'ibase_blob_open', - 'ibase_close', - 'ibase_commit', - 'ibase_commit_ret', - 'ibase_connect', - 'ibase_db_info', - 'ibase_delete_user', - 'ibase_drop_db', - 'ibase_execute', - 'ibase_fetch_assoc', - 'ibase_fetch_object', - 'ibase_fetch_row', - 'ibase_field_info', - 'ibase_free_event_handler', - 'ibase_free_query', - 'ibase_free_result', - 'ibase_gen_id', - 'ibase_maintain_db', - 'ibase_modify_user', - 'ibase_name_result', - 'ibase_num_fields', - 'ibase_num_params', - 'ibase_param_info', - 'ibase_pconnect', - 'ibase_prepare', - 'ibase_query', - 'ibase_restore', - 'ibase_rollback', - 'ibase_rollback_ret', - 'ibase_server_info', - 'ibase_service_attach', - 'ibase_service_detach', - 'ibase_set_event_handler', - 'ibase_trans', - 'ifx_affected_rows', - 'ifx_close', - 'ifx_connect', - 'ifx_do', - 'ifx_error', - 'ifx_fetch_row', - 'ifx_fieldproperties', - 'ifx_fieldtypes', - 'ifx_free_result', - 'ifx_getsqlca', - 'ifx_htmltbl_result', - 'ifx_num_fields', - 'ifx_num_rows', - 'ifx_pconnect', - 'ifx_prepare', - 'ifx_query', - 'image2wbmp', - 'imageaffine', - 'imagealphablending', - 'imageantialias', - 'imagearc', - 'imagebmp', - 'imagechar', - 'imagecharup', - 'imagecolorallocate', - 'imagecolorallocatealpha', - 'imagecolorat', - 'imagecolorclosest', - 'imagecolorclosestalpha', - 'imagecolorclosesthwb', - 'imagecolordeallocate', - 'imagecolorexact', - 'imagecolorexactalpha', - 'imagecolormatch', - 'imagecolorresolve', - 'imagecolorresolvealpha', - 'imagecolorset', - 'imagecolorsforindex', - 'imagecolorstotal', - 'imagecolortransparent', - 'imageconvolution', - 'imagecopy', - 'imagecopymerge', - 'imagecopymergegray', - 'imagecopyresampled', - 'imagecopyresized', - 'imagecrop', - 'imagecropauto', - 'imagedashedline', - 'imagedestroy', - 'imageellipse', - 'imagefill', - 'imagefilledarc', - 'imagefilledellipse', - 'imagefilledpolygon', - 'imagefilledrectangle', - 'imagefilltoborder', - 'imagefilter', - 'imageflip', - 'imagefttext', - 'imagegammacorrect', - 'imagegd', - 'imagegd2', - 'imagegetclip', - 'imagegif', - 'imagegrabscreen', - 'imagegrabwindow', - 'imageinterlace', - 'imageistruecolor', - 'imagejpeg', - 'imagelayereffect', - 'imageline', - 'imageopenpolygon', - 'imagepalettecopy', - 'imagepalettetotruecolor', - 'imagepng', - 'imagepolygon', - 'imagepsencodefont', - 'imagepsextendfont', - 'imagepsfreefont', - 'imagepsloadfont', - 'imagepsslantfont', - 'imagepstext', - 'imagerectangle', - 'imageresolution', - 'imagerotate', - 'imagesavealpha', - 'imagescale', - 'imagesetbrush', - 'imagesetclip', - 'imagesetinterpolation', - 'imagesetpixel', - 'imagesetstyle', - 'imagesetthickness', - 'imagesettile', - 'imagestring', - 'imagestringup', - 'imagesx', - 'imagesy', - 'imagetruecolortopalette', - 'imagettftext', - 'imagewbmp', - 'imagewebp', - 'imagexbm', - 'imap_append', - 'imap_body', - 'imap_bodystruct', - 'imap_check', - 'imap_clearflag_full', - 'imap_close', - 'imap_create', - 'imap_createmailbox', - 'imap_delete', - 'imap_deletemailbox', - 'imap_expunge', - 'imap_fetch_overview', - 'imap_fetchbody', - 'imap_fetchheader', - 'imap_fetchmime', - 'imap_fetchstructure', - 'imap_fetchtext', - 'imap_gc', - 'imap_get_quota', - 'imap_get_quotaroot', - 'imap_getacl', - 'imap_getmailboxes', - 'imap_getsubscribed', - 'imap_header', - 'imap_headerinfo', - 'imap_headers', - 'imap_list', - 'imap_listmailbox', - 'imap_listscan', - 'imap_listsubscribed', - 'imap_lsub', - 'imap_mail_copy', - 'imap_mail_move', - 'imap_mailboxmsginfo', - 'imap_msgno', - 'imap_num_msg', - 'imap_num_recent', - 'imap_ping', - 'imap_rename', - 'imap_renamemailbox', - 'imap_reopen', - 'imap_savebody', - 'imap_scan', - 'imap_scanmailbox', - 'imap_search', - 'imap_set_quota', - 'imap_setacl', - 'imap_setflag_full', - 'imap_sort', - 'imap_status', - 'imap_subscribe', - 'imap_thread', - 'imap_uid', - 'imap_undelete', - 'imap_unsubscribe', - 'inflate_add', - 'inflate_get_read_len', - 'inflate_get_status', - 'ingres_autocommit', - 'ingres_autocommit_state', - 'ingres_charset', - 'ingres_close', - 'ingres_commit', - 'ingres_connect', - 'ingres_cursor', - 'ingres_errno', - 'ingres_error', - 'ingres_errsqlstate', - 'ingres_escape_string', - 'ingres_execute', - 'ingres_fetch_array', - 'ingres_fetch_assoc', - 'ingres_fetch_object', - 'ingres_fetch_proc_return', - 'ingres_fetch_row', - 'ingres_field_length', - 'ingres_field_name', - 'ingres_field_nullable', - 'ingres_field_precision', - 'ingres_field_scale', - 'ingres_field_type', - 'ingres_free_result', - 'ingres_next_error', - 'ingres_num_fields', - 'ingres_num_rows', - 'ingres_pconnect', - 'ingres_prepare', - 'ingres_query', - 'ingres_result_seek', - 'ingres_rollback', - 'ingres_set_environment', - 'ingres_unbuffered_query', - 'inotify_add_watch', - 'inotify_init', - 'inotify_queue_len', - 'inotify_read', - 'inotify_rm_watch', - 'kadm5_chpass_principal', - 'kadm5_create_principal', - 'kadm5_delete_principal', - 'kadm5_destroy', - 'kadm5_flush', - 'kadm5_get_policies', - 'kadm5_get_principal', - 'kadm5_get_principals', - 'kadm5_init_with_password', - 'kadm5_modify_principal', - 'ldap_add', - 'ldap_bind', - 'ldap_close', - 'ldap_compare', - 'ldap_control_paged_result', - 'ldap_control_paged_result_response', - 'ldap_count_entries', - 'ldap_delete', - 'ldap_errno', - 'ldap_error', - 'ldap_exop', - 'ldap_exop_passwd', - 'ldap_exop_refresh', - 'ldap_exop_whoami', - 'ldap_first_attribute', - 'ldap_first_entry', - 'ldap_first_reference', - 'ldap_free_result', - 'ldap_get_attributes', - 'ldap_get_dn', - 'ldap_get_entries', - 'ldap_get_option', - 'ldap_get_values', - 'ldap_get_values_len', - 'ldap_mod_add', - 'ldap_mod_del', - 'ldap_mod_replace', - 'ldap_modify', - 'ldap_modify_batch', - 'ldap_next_attribute', - 'ldap_next_entry', - 'ldap_next_reference', - 'ldap_parse_exop', - 'ldap_parse_reference', - 'ldap_parse_result', - 'ldap_rename', - 'ldap_sasl_bind', - 'ldap_set_option', - 'ldap_set_rebind_proc', - 'ldap_sort', - 'ldap_start_tls', - 'ldap_unbind', - 'libxml_set_streams_context', - 'm_checkstatus', - 'm_completeauthorizations', - 'm_connect', - 'm_connectionerror', - 'm_deletetrans', - 'm_destroyconn', - 'm_getcell', - 'm_getcellbynum', - 'm_getcommadelimited', - 'm_getheader', - 'm_initconn', - 'm_iscommadelimited', - 'm_maxconntimeout', - 'm_monitor', - 'm_numcolumns', - 'm_numrows', - 'm_parsecommadelimited', - 'm_responsekeys', - 'm_responseparam', - 'm_returnstatus', - 'm_setblocking', - 'm_setdropfile', - 'm_setip', - 'm_setssl', - 'm_setssl_cafile', - 'm_setssl_files', - 'm_settimeout', - 'm_transactionssent', - 'm_transinqueue', - 'm_transkeyval', - 'm_transnew', - 'm_transsend', - 'm_validateidentifier', - 'm_verifyconnection', - 'm_verifysslcert', - 'mailparse_determine_best_xfer_encoding', - 'mailparse_msg_create', - 'mailparse_msg_extract_part', - 'mailparse_msg_extract_part_file', - 'mailparse_msg_extract_whole_part_file', - 'mailparse_msg_free', - 'mailparse_msg_get_part', - 'mailparse_msg_get_part_data', - 'mailparse_msg_get_structure', - 'mailparse_msg_parse', - 'mailparse_msg_parse_file', - 'mailparse_stream_encode', - 'mailparse_uudecode_all', - 'maxdb::use_result', - 'maxdb_affected_rows', - 'maxdb_connect', - 'maxdb_disable_rpl_parse', - 'maxdb_dump_debug_info', - 'maxdb_embedded_connect', - 'maxdb_enable_reads_from_master', - 'maxdb_enable_rpl_parse', - 'maxdb_errno', - 'maxdb_error', - 'maxdb_fetch_lengths', - 'maxdb_field_tell', - 'maxdb_get_host_info', - 'maxdb_get_proto_info', - 'maxdb_get_server_info', - 'maxdb_get_server_version', - 'maxdb_info', - 'maxdb_init', - 'maxdb_insert_id', - 'maxdb_master_query', - 'maxdb_more_results', - 'maxdb_next_result', - 'maxdb_num_fields', - 'maxdb_num_rows', - 'maxdb_rpl_parse_enabled', - 'maxdb_rpl_probe', - 'maxdb_select_db', - 'maxdb_sqlstate', - 'maxdb_stmt::result_metadata', - 'maxdb_stmt_affected_rows', - 'maxdb_stmt_errno', - 'maxdb_stmt_error', - 'maxdb_stmt_num_rows', - 'maxdb_stmt_param_count', - 'maxdb_stmt_result_metadata', - 'maxdb_stmt_sqlstate', - 'maxdb_thread_id', - 'maxdb_use_result', - 'maxdb_warning_count', - 'mcrypt_enc_get_algorithms_name', - 'mcrypt_enc_get_block_size', - 'mcrypt_enc_get_iv_size', - 'mcrypt_enc_get_key_size', - 'mcrypt_enc_get_modes_name', - 'mcrypt_enc_get_supported_key_sizes', - 'mcrypt_enc_is_block_algorithm', - 'mcrypt_enc_is_block_algorithm_mode', - 'mcrypt_enc_is_block_mode', - 'mcrypt_enc_self_test', - 'mcrypt_generic', - 'mcrypt_generic_deinit', - 'mcrypt_generic_end', - 'mcrypt_generic_init', - 'mcrypt_module_close', - 'mcrypt_module_open', - 'mdecrypt_generic', - 'mkdir', - 'mqseries_back', - 'mqseries_begin', - 'mqseries_close', - 'mqseries_cmit', - 'mqseries_conn', - 'mqseries_connx', - 'mqseries_disc', - 'mqseries_get', - 'mqseries_inq', - 'mqseries_open', - 'mqseries_put', - 'mqseries_put1', - 'mqseries_set', - 'msg_get_queue', - 'msg_receive', - 'msg_remove_queue', - 'msg_send', - 'msg_set_queue', - 'msg_stat_queue', - 'msql_affected_rows', - 'msql_close', - 'msql_connect', - 'msql_create_db', - 'msql_data_seek', - 'msql_db_query', - 'msql_drop_db', - 'msql_fetch_array', - 'msql_fetch_field', - 'msql_fetch_object', - 'msql_fetch_row', - 'msql_field_flags', - 'msql_field_len', - 'msql_field_name', - 'msql_field_seek', - 'msql_field_table', - 'msql_field_type', - 'msql_free_result', - 'msql_list_dbs', - 'msql_list_fields', - 'msql_list_tables', - 'msql_num_fields', - 'msql_num_rows', - 'msql_pconnect', - 'msql_query', - 'msql_result', - 'msql_select_db', - 'mssql_bind', - 'mssql_close', - 'mssql_connect', - 'mssql_data_seek', - 'mssql_execute', - 'mssql_fetch_array', - 'mssql_fetch_assoc', - 'mssql_fetch_batch', - 'mssql_fetch_field', - 'mssql_fetch_object', - 'mssql_fetch_row', - 'mssql_field_length', - 'mssql_field_name', - 'mssql_field_seek', - 'mssql_field_type', - 'mssql_free_result', - 'mssql_free_statement', - 'mssql_init', - 'mssql_next_result', - 'mssql_num_fields', - 'mssql_num_rows', - 'mssql_pconnect', - 'mssql_query', - 'mssql_result', - 'mssql_rows_affected', - 'mssql_select_db', - 'mysql_affected_rows', - 'mysql_client_encoding', - 'mysql_close', - 'mysql_connect', - 'mysql_create_db', - 'mysql_data_seek', - 'mysql_db_name', - 'mysql_db_query', - 'mysql_drop_db', - 'mysql_errno', - 'mysql_error', - 'mysql_fetch_array', - 'mysql_fetch_assoc', - 'mysql_fetch_field', - 'mysql_fetch_lengths', - 'mysql_fetch_object', - 'mysql_fetch_row', - 'mysql_field_flags', - 'mysql_field_len', - 'mysql_field_name', - 'mysql_field_seek', - 'mysql_field_table', - 'mysql_field_type', - 'mysql_free_result', - 'mysql_get_host_info', - 'mysql_get_proto_info', - 'mysql_get_server_info', - 'mysql_info', - 'mysql_insert_id', - 'mysql_list_dbs', - 'mysql_list_fields', - 'mysql_list_processes', - 'mysql_list_tables', - 'mysql_num_fields', - 'mysql_num_rows', - 'mysql_pconnect', - 'mysql_ping', - 'mysql_query', - 'mysql_real_escape_string', - 'mysql_result', - 'mysql_select_db', - 'mysql_set_charset', - 'mysql_stat', - 'mysql_tablename', - 'mysql_thread_id', - 'mysql_unbuffered_query', - 'mysqlnd_uh_convert_to_mysqlnd', - 'ncurses_bottom_panel', - 'ncurses_del_panel', - 'ncurses_delwin', - 'ncurses_getmaxyx', - 'ncurses_getyx', - 'ncurses_hide_panel', - 'ncurses_keypad', - 'ncurses_meta', - 'ncurses_move_panel', - 'ncurses_mvwaddstr', - 'ncurses_new_panel', - 'ncurses_newpad', - 'ncurses_newwin', - 'ncurses_panel_above', - 'ncurses_panel_below', - 'ncurses_panel_window', - 'ncurses_pnoutrefresh', - 'ncurses_prefresh', - 'ncurses_replace_panel', - 'ncurses_show_panel', - 'ncurses_top_panel', - 'ncurses_waddch', - 'ncurses_waddstr', - 'ncurses_wattroff', - 'ncurses_wattron', - 'ncurses_wattrset', - 'ncurses_wborder', - 'ncurses_wclear', - 'ncurses_wcolor_set', - 'ncurses_werase', - 'ncurses_wgetch', - 'ncurses_whline', - 'ncurses_wmouse_trafo', - 'ncurses_wmove', - 'ncurses_wnoutrefresh', - 'ncurses_wrefresh', - 'ncurses_wstandend', - 'ncurses_wstandout', - 'ncurses_wvline', - 'newt_button', - 'newt_button_bar', - 'newt_checkbox', - 'newt_checkbox_get_value', - 'newt_checkbox_set_flags', - 'newt_checkbox_set_value', - 'newt_checkbox_tree', - 'newt_checkbox_tree_add_item', - 'newt_checkbox_tree_find_item', - 'newt_checkbox_tree_get_current', - 'newt_checkbox_tree_get_entry_value', - 'newt_checkbox_tree_get_multi_selection', - 'newt_checkbox_tree_get_selection', - 'newt_checkbox_tree_multi', - 'newt_checkbox_tree_set_current', - 'newt_checkbox_tree_set_entry', - 'newt_checkbox_tree_set_entry_value', - 'newt_checkbox_tree_set_width', - 'newt_compact_button', - 'newt_component_add_callback', - 'newt_component_takes_focus', - 'newt_create_grid', - 'newt_draw_form', - 'newt_entry', - 'newt_entry_get_value', - 'newt_entry_set', - 'newt_entry_set_filter', - 'newt_entry_set_flags', - 'newt_form', - 'newt_form_add_component', - 'newt_form_add_components', - 'newt_form_add_hot_key', - 'newt_form_destroy', - 'newt_form_get_current', - 'newt_form_run', - 'newt_form_set_background', - 'newt_form_set_height', - 'newt_form_set_size', - 'newt_form_set_timer', - 'newt_form_set_width', - 'newt_form_watch_fd', - 'newt_grid_add_components_to_form', - 'newt_grid_basic_window', - 'newt_grid_free', - 'newt_grid_get_size', - 'newt_grid_h_close_stacked', - 'newt_grid_h_stacked', - 'newt_grid_place', - 'newt_grid_set_field', - 'newt_grid_simple_window', - 'newt_grid_v_close_stacked', - 'newt_grid_v_stacked', - 'newt_grid_wrapped_window', - 'newt_grid_wrapped_window_at', - 'newt_label', - 'newt_label_set_text', - 'newt_listbox', - 'newt_listbox_append_entry', - 'newt_listbox_clear', - 'newt_listbox_clear_selection', - 'newt_listbox_delete_entry', - 'newt_listbox_get_current', - 'newt_listbox_get_selection', - 'newt_listbox_insert_entry', - 'newt_listbox_item_count', - 'newt_listbox_select_item', - 'newt_listbox_set_current', - 'newt_listbox_set_current_by_key', - 'newt_listbox_set_data', - 'newt_listbox_set_entry', - 'newt_listbox_set_width', - 'newt_listitem', - 'newt_listitem_get_data', - 'newt_listitem_set', - 'newt_radio_get_current', - 'newt_radiobutton', - 'newt_run_form', - 'newt_scale', - 'newt_scale_set', - 'newt_scrollbar_set', - 'newt_textbox', - 'newt_textbox_get_num_lines', - 'newt_textbox_reflowed', - 'newt_textbox_set_height', - 'newt_textbox_set_text', - 'newt_vertical_scrollbar', - 'oci_bind_array_by_name', - 'oci_bind_by_name', - 'oci_cancel', - 'oci_close', - 'oci_commit', - 'oci_connect', - 'oci_define_by_name', - 'oci_error', - 'oci_execute', - 'oci_fetch', - 'oci_fetch_all', - 'oci_fetch_array', - 'oci_fetch_assoc', - 'oci_fetch_object', - 'oci_fetch_row', - 'oci_field_is_null', - 'oci_field_name', - 'oci_field_precision', - 'oci_field_scale', - 'oci_field_size', - 'oci_field_type', - 'oci_field_type_raw', - 'oci_free_cursor', - 'oci_free_statement', - 'oci_get_implicit_resultset', - 'oci_new_collection', - 'oci_new_connect', - 'oci_new_cursor', - 'oci_new_descriptor', - 'oci_num_fields', - 'oci_num_rows', - 'oci_parse', - 'oci_pconnect', - 'oci_register_taf_callback', - 'oci_result', - 'oci_rollback', - 'oci_server_version', - 'oci_set_action', - 'oci_set_client_identifier', - 'oci_set_client_info', - 'oci_set_module_name', - 'oci_set_prefetch', - 'oci_statement_type', - 'oci_unregister_taf_callback', - 'odbc_autocommit', - 'odbc_close', - 'odbc_columnprivileges', - 'odbc_columns', - 'odbc_commit', - 'odbc_connect', - 'odbc_cursor', - 'odbc_data_source', - 'odbc_do', - 'odbc_error', - 'odbc_errormsg', - 'odbc_exec', - 'odbc_execute', - 'odbc_fetch_array', - 'odbc_fetch_into', - 'odbc_fetch_row', - 'odbc_field_len', - 'odbc_field_name', - 'odbc_field_num', - 'odbc_field_precision', - 'odbc_field_scale', - 'odbc_field_type', - 'odbc_foreignkeys', - 'odbc_free_result', - 'odbc_gettypeinfo', - 'odbc_next_result', - 'odbc_num_fields', - 'odbc_num_rows', - 'odbc_pconnect', - 'odbc_prepare', - 'odbc_primarykeys', - 'odbc_procedurecolumns', - 'odbc_procedures', - 'odbc_result', - 'odbc_result_all', - 'odbc_rollback', - 'odbc_setoption', - 'odbc_specialcolumns', - 'odbc_statistics', - 'odbc_tableprivileges', - 'odbc_tables', - 'openal_buffer_create', - 'openal_buffer_data', - 'openal_buffer_destroy', - 'openal_buffer_get', - 'openal_buffer_loadwav', - 'openal_context_create', - 'openal_context_current', - 'openal_context_destroy', - 'openal_context_process', - 'openal_context_suspend', - 'openal_device_close', - 'openal_device_open', - 'openal_source_create', - 'openal_source_destroy', - 'openal_source_get', - 'openal_source_pause', - 'openal_source_play', - 'openal_source_rewind', - 'openal_source_set', - 'openal_source_stop', - 'openal_stream', - 'opendir', - 'openssl_csr_new', - 'openssl_dh_compute_key', - 'openssl_free_key', - 'openssl_pkey_export', - 'openssl_pkey_free', - 'openssl_pkey_get_details', - 'openssl_spki_new', - 'openssl_x509_free', - 'pclose', - 'pfsockopen', - 'pg_affected_rows', - 'pg_cancel_query', - 'pg_client_encoding', - 'pg_close', - 'pg_connect_poll', - 'pg_connection_busy', - 'pg_connection_reset', - 'pg_connection_status', - 'pg_consume_input', - 'pg_convert', - 'pg_copy_from', - 'pg_copy_to', - 'pg_dbname', - 'pg_delete', - 'pg_end_copy', - 'pg_escape_bytea', - 'pg_escape_identifier', - 'pg_escape_literal', - 'pg_escape_string', - 'pg_execute', - 'pg_fetch_all', - 'pg_fetch_all_columns', - 'pg_fetch_array', - 'pg_fetch_assoc', - 'pg_fetch_row', - 'pg_field_name', - 'pg_field_num', - 'pg_field_size', - 'pg_field_table', - 'pg_field_type', - 'pg_field_type_oid', - 'pg_flush', - 'pg_free_result', - 'pg_get_notify', - 'pg_get_pid', - 'pg_get_result', - 'pg_host', - 'pg_insert', - 'pg_last_error', - 'pg_last_notice', - 'pg_last_oid', - 'pg_lo_close', - 'pg_lo_create', - 'pg_lo_export', - 'pg_lo_import', - 'pg_lo_open', - 'pg_lo_read', - 'pg_lo_read_all', - 'pg_lo_seek', - 'pg_lo_tell', - 'pg_lo_truncate', - 'pg_lo_unlink', - 'pg_lo_write', - 'pg_meta_data', - 'pg_num_fields', - 'pg_num_rows', - 'pg_options', - 'pg_parameter_status', - 'pg_ping', - 'pg_port', - 'pg_prepare', - 'pg_put_line', - 'pg_query', - 'pg_query_params', - 'pg_result_error', - 'pg_result_error_field', - 'pg_result_seek', - 'pg_result_status', - 'pg_select', - 'pg_send_execute', - 'pg_send_prepare', - 'pg_send_query', - 'pg_send_query_params', - 'pg_set_client_encoding', - 'pg_set_error_verbosity', - 'pg_socket', - 'pg_trace', - 'pg_transaction_status', - 'pg_tty', - 'pg_untrace', - 'pg_update', - 'pg_version', - 'php_user_filter::filter', - 'proc_close', - 'proc_get_status', - 'proc_terminate', - 'ps_add_bookmark', - 'ps_add_launchlink', - 'ps_add_locallink', - 'ps_add_note', - 'ps_add_pdflink', - 'ps_add_weblink', - 'ps_arc', - 'ps_arcn', - 'ps_begin_page', - 'ps_begin_pattern', - 'ps_begin_template', - 'ps_circle', - 'ps_clip', - 'ps_close', - 'ps_close_image', - 'ps_closepath', - 'ps_closepath_stroke', - 'ps_continue_text', - 'ps_curveto', - 'ps_delete', - 'ps_end_page', - 'ps_end_pattern', - 'ps_end_template', - 'ps_fill', - 'ps_fill_stroke', - 'ps_findfont', - 'ps_get_buffer', - 'ps_get_parameter', - 'ps_get_value', - 'ps_hyphenate', - 'ps_include_file', - 'ps_lineto', - 'ps_makespotcolor', - 'ps_moveto', - 'ps_new', - 'ps_open_file', - 'ps_open_image', - 'ps_open_image_file', - 'ps_open_memory_image', - 'ps_place_image', - 'ps_rect', - 'ps_restore', - 'ps_rotate', - 'ps_save', - 'ps_scale', - 'ps_set_border_color', - 'ps_set_border_dash', - 'ps_set_border_style', - 'ps_set_info', - 'ps_set_parameter', - 'ps_set_text_pos', - 'ps_set_value', - 'ps_setcolor', - 'ps_setdash', - 'ps_setflat', - 'ps_setfont', - 'ps_setgray', - 'ps_setlinecap', - 'ps_setlinejoin', - 'ps_setlinewidth', - 'ps_setmiterlimit', - 'ps_setoverprintmode', - 'ps_setpolydash', - 'ps_shading', - 'ps_shading_pattern', - 'ps_shfill', - 'ps_show', - 'ps_show2', - 'ps_show_boxed', - 'ps_show_xy', - 'ps_show_xy2', - 'ps_string_geometry', - 'ps_stringwidth', - 'ps_stroke', - 'ps_symbol', - 'ps_symbol_name', - 'ps_symbol_width', - 'ps_translate', - 'px_close', - 'px_create_fp', - 'px_date2string', - 'px_delete', - 'px_delete_record', - 'px_get_field', - 'px_get_info', - 'px_get_parameter', - 'px_get_record', - 'px_get_schema', - 'px_get_value', - 'px_insert_record', - 'px_new', - 'px_numfields', - 'px_numrecords', - 'px_open_fp', - 'px_put_record', - 'px_retrieve_record', - 'px_set_blob_file', - 'px_set_parameter', - 'px_set_tablename', - 'px_set_targetencoding', - 'px_set_value', - 'px_timestamp2string', - 'px_update_record', - 'radius_acct_open', - 'radius_add_server', - 'radius_auth_open', - 'radius_close', - 'radius_config', - 'radius_create_request', - 'radius_demangle', - 'radius_demangle_mppe_key', - 'radius_get_attr', - 'radius_put_addr', - 'radius_put_attr', - 'radius_put_int', - 'radius_put_string', - 'radius_put_vendor_addr', - 'radius_put_vendor_attr', - 'radius_put_vendor_int', - 'radius_put_vendor_string', - 'radius_request_authenticator', - 'radius_salt_encrypt_attr', - 'radius_send_request', - 'radius_server_secret', - 'radius_strerror', - 'readdir', - 'readfile', - 'recode_file', - 'rename', - 'rewind', - 'rewinddir', - 'rmdir', - 'rpm_close', - 'rpm_get_tag', - 'rpm_open', - 'sapi_windows_vt100_support', - 'scandir', - 'sem_acquire', - 'sem_get', - 'sem_release', - 'sem_remove', - 'set_file_buffer', - 'shm_attach', - 'shm_detach', - 'shm_get_var', - 'shm_has_var', - 'shm_put_var', - 'shm_remove', - 'shm_remove_var', - 'shmop_close', - 'shmop_delete', - 'shmop_open', - 'shmop_read', - 'shmop_size', - 'shmop_write', - 'socket_accept', - 'socket_addrinfo_bind', - 'socket_addrinfo_connect', - 'socket_addrinfo_explain', - 'socket_bind', - 'socket_clear_error', - 'socket_close', - 'socket_connect', - 'socket_export_stream', - 'socket_get_option', - 'socket_get_status', - 'socket_getopt', - 'socket_getpeername', - 'socket_getsockname', - 'socket_import_stream', - 'socket_last_error', - 'socket_listen', - 'socket_read', - 'socket_recv', - 'socket_recvfrom', - 'socket_recvmsg', - 'socket_send', - 'socket_sendmsg', - 'socket_sendto', - 'socket_set_block', - 'socket_set_blocking', - 'socket_set_nonblock', - 'socket_set_option', - 'socket_set_timeout', - 'socket_shutdown', - 'socket_write', - 'sqlite_close', - 'sqlite_fetch_string', - 'sqlite_has_more', - 'sqlite_open', - 'sqlite_popen', - 'sqlsrv_begin_transaction', - 'sqlsrv_cancel', - 'sqlsrv_client_info', - 'sqlsrv_close', - 'sqlsrv_commit', - 'sqlsrv_connect', - 'sqlsrv_execute', - 'sqlsrv_fetch', - 'sqlsrv_fetch_array', - 'sqlsrv_fetch_object', - 'sqlsrv_field_metadata', - 'sqlsrv_free_stmt', - 'sqlsrv_get_field', - 'sqlsrv_has_rows', - 'sqlsrv_next_result', - 'sqlsrv_num_fields', - 'sqlsrv_num_rows', - 'sqlsrv_prepare', - 'sqlsrv_query', - 'sqlsrv_rollback', - 'sqlsrv_rows_affected', - 'sqlsrv_send_stream_data', - 'sqlsrv_server_info', - 'ssh2_auth_agent', - 'ssh2_auth_hostbased_file', - 'ssh2_auth_none', - 'ssh2_auth_password', - 'ssh2_auth_pubkey_file', - 'ssh2_disconnect', - 'ssh2_exec', - 'ssh2_fetch_stream', - 'ssh2_fingerprint', - 'ssh2_methods_negotiated', - 'ssh2_publickey_add', - 'ssh2_publickey_init', - 'ssh2_publickey_list', - 'ssh2_publickey_remove', - 'ssh2_scp_recv', - 'ssh2_scp_send', - 'ssh2_sftp', - 'ssh2_sftp_chmod', - 'ssh2_sftp_lstat', - 'ssh2_sftp_mkdir', - 'ssh2_sftp_readlink', - 'ssh2_sftp_realpath', - 'ssh2_sftp_rename', - 'ssh2_sftp_rmdir', - 'ssh2_sftp_stat', - 'ssh2_sftp_symlink', - 'ssh2_sftp_unlink', - 'ssh2_shell', - 'ssh2_tunnel', - 'stomp_connect', - 'streamWrapper::stream_cast', - 'stream_bucket_append', - 'stream_bucket_make_writeable', - 'stream_bucket_new', - 'stream_bucket_prepend', - 'stream_context_create', - 'stream_context_get_default', - 'stream_context_get_options', - 'stream_context_get_params', - 'stream_context_set_default', - 'stream_context_set_params', - 'stream_copy_to_stream', - 'stream_encoding', - 'stream_filter_append', - 'stream_filter_prepend', - 'stream_filter_remove', - 'stream_get_contents', - 'stream_get_line', - 'stream_get_meta_data', - 'stream_isatty', - 'stream_set_blocking', - 'stream_set_chunk_size', - 'stream_set_read_buffer', - 'stream_set_timeout', - 'stream_set_write_buffer', - 'stream_socket_accept', - 'stream_socket_client', - 'stream_socket_enable_crypto', - 'stream_socket_get_name', - 'stream_socket_recvfrom', - 'stream_socket_sendto', - 'stream_socket_server', - 'stream_socket_shutdown', - 'stream_supports_lock', - 'svn_fs_abort_txn', - 'svn_fs_apply_text', - 'svn_fs_begin_txn2', - 'svn_fs_change_node_prop', - 'svn_fs_check_path', - 'svn_fs_contents_changed', - 'svn_fs_copy', - 'svn_fs_delete', - 'svn_fs_dir_entries', - 'svn_fs_file_contents', - 'svn_fs_file_length', - 'svn_fs_is_dir', - 'svn_fs_is_file', - 'svn_fs_make_dir', - 'svn_fs_make_file', - 'svn_fs_node_created_rev', - 'svn_fs_node_prop', - 'svn_fs_props_changed', - 'svn_fs_revision_prop', - 'svn_fs_revision_root', - 'svn_fs_txn_root', - 'svn_fs_youngest_rev', - 'svn_repos_create', - 'svn_repos_fs', - 'svn_repos_fs_begin_txn_for_commit', - 'svn_repos_fs_commit_txn', - 'svn_repos_open', - 'sybase_affected_rows', - 'sybase_close', - 'sybase_connect', - 'sybase_data_seek', - 'sybase_fetch_array', - 'sybase_fetch_assoc', - 'sybase_fetch_field', - 'sybase_fetch_object', - 'sybase_fetch_row', - 'sybase_field_seek', - 'sybase_free_result', - 'sybase_num_fields', - 'sybase_num_rows', - 'sybase_pconnect', - 'sybase_query', - 'sybase_result', - 'sybase_select_db', - 'sybase_set_message_handler', - 'sybase_unbuffered_query', - 'tmpfile', - 'udm_add_search_limit', - 'udm_alloc_agent', - 'udm_alloc_agent_array', - 'udm_cat_list', - 'udm_cat_path', - 'udm_check_charset', - 'udm_clear_search_limits', - 'udm_crc32', - 'udm_errno', - 'udm_error', - 'udm_find', - 'udm_free_agent', - 'udm_free_res', - 'udm_get_doc_count', - 'udm_get_res_field', - 'udm_get_res_param', - 'udm_hash32', - 'udm_load_ispell_data', - 'udm_set_agent_param', - 'unlink', - 'vfprintf', - 'w32api_init_dtype', - 'wddx_add_vars', - 'wddx_packet_end', - 'wddx_packet_start', - 'xml_get_current_byte_index', - 'xml_get_current_column_number', - 'xml_get_current_line_number', - 'xml_get_error_code', - 'xml_parse', - 'xml_parse_into_struct', - 'xml_parser_create', - 'xml_parser_create_ns', - 'xml_parser_free', - 'xml_parser_get_option', - 'xml_parser_set_option', - 'xml_set_character_data_handler', - 'xml_set_default_handler', - 'xml_set_element_handler', - 'xml_set_end_namespace_decl_handler', - 'xml_set_external_entity_ref_handler', - 'xml_set_notation_decl_handler', - 'xml_set_object', - 'xml_set_processing_instruction_handler', - 'xml_set_start_namespace_decl_handler', - 'xml_set_unparsed_entity_decl_handler', - 'xmlrpc_server_add_introspection_data', - 'xmlrpc_server_call_method', - 'xmlrpc_server_create', - 'xmlrpc_server_destroy', - 'xmlrpc_server_register_introspection_callback', - 'xmlrpc_server_register_method', - 'xmlwriter_end_attribute', - 'xmlwriter_end_cdata', - 'xmlwriter_end_comment', - 'xmlwriter_end_document', - 'xmlwriter_end_dtd', - 'xmlwriter_end_dtd_attlist', - 'xmlwriter_end_dtd_element', - 'xmlwriter_end_dtd_entity', - 'xmlwriter_end_element', - 'xmlwriter_end_pi', - 'xmlwriter_flush', - 'xmlwriter_full_end_element', - 'xmlwriter_open_memory', - 'xmlwriter_open_uri', - 'xmlwriter_output_memory', - 'xmlwriter_set_indent', - 'xmlwriter_set_indent_string', - 'xmlwriter_start_attribute', - 'xmlwriter_start_attribute_ns', - 'xmlwriter_start_cdata', - 'xmlwriter_start_comment', - 'xmlwriter_start_document', - 'xmlwriter_start_dtd', - 'xmlwriter_start_dtd_attlist', - 'xmlwriter_start_dtd_element', - 'xmlwriter_start_dtd_entity', - 'xmlwriter_start_element', - 'xmlwriter_start_element_ns', - 'xmlwriter_start_pi', - 'xmlwriter_text', - 'xmlwriter_write_attribute', - 'xmlwriter_write_attribute_ns', - 'xmlwriter_write_cdata', - 'xmlwriter_write_comment', - 'xmlwriter_write_dtd', - 'xmlwriter_write_dtd_attlist', - 'xmlwriter_write_dtd_element', - 'xmlwriter_write_dtd_entity', - 'xmlwriter_write_element', - 'xmlwriter_write_element_ns', - 'xmlwriter_write_pi', - 'xmlwriter_write_raw', - 'xslt_create', - 'yaz_addinfo', - 'yaz_ccl_conf', - 'yaz_ccl_parse', - 'yaz_close', - 'yaz_database', - 'yaz_element', - 'yaz_errno', - 'yaz_error', - 'yaz_es', - 'yaz_es_result', - 'yaz_get_option', - 'yaz_hits', - 'yaz_itemorder', - 'yaz_present', - 'yaz_range', - 'yaz_record', - 'yaz_scan', - 'yaz_scan_result', - 'yaz_schema', - 'yaz_search', - 'yaz_sort', - 'yaz_syntax', - 'zip_close', - 'zip_entry_close', - 'zip_entry_compressedsize', - 'zip_entry_compressionmethod', - 'zip_entry_filesize', - 'zip_entry_name', - 'zip_entry_open', - 'zip_entry_read', - 'zip_open', - 'zip_read', - ]; - } -} diff --git a/vendor/sebastian/resource-operations/tests/ResourceOperationsTest.php b/vendor/sebastian/resource-operations/tests/ResourceOperationsTest.php deleted file mode 100644 index f05ea0d..0000000 --- a/vendor/sebastian/resource-operations/tests/ResourceOperationsTest.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\ResourceOperations; - -use PHPUnit\Framework\TestCase; - -/** - * @covers \SebastianBergmann\ResourceOperations\ResourceOperations - */ -final class ResourceOperationsTest extends TestCase -{ - public function testGetFunctions(): void - { - $functions = ResourceOperations::getFunctions(); - - $this->assertInternalType('array', $functions); - $this->assertContains('fopen', $functions); - } -} diff --git a/vendor/sebastian/type/.gitattributes b/vendor/sebastian/type/.gitattributes deleted file mode 100644 index 15e41cb..0000000 --- a/vendor/sebastian/type/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -/tools export-ignore - diff --git a/vendor/sebastian/type/.github/FUNDING.yml b/vendor/sebastian/type/.github/FUNDING.yml deleted file mode 100644 index b19ea81..0000000 --- a/vendor/sebastian/type/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -patreon: s_bergmann diff --git a/vendor/sebastian/type/.gitignore b/vendor/sebastian/type/.gitignore deleted file mode 100644 index 832c68a..0000000 --- a/vendor/sebastian/type/.gitignore +++ /dev/null @@ -1,72 +0,0 @@ -/.php_cs -/.php_cs.cache -/.phpunit.result.cache -/composer.lock -/vendor - -# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm -# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 - -# User-specific stuff -.idea/**/workspace.xml -.idea/**/tasks.xml -.idea/**/usage.statistics.xml -.idea/**/dictionaries -.idea/**/shelf - -# Generated files -.idea/**/contentModel.xml - -# Sensitive or high-churn files -.idea/**/dataSources/ -.idea/**/dataSources.ids -.idea/**/dataSources.local.xml -.idea/**/sqlDataSources.xml -.idea/**/dynamic.xml -.idea/**/uiDesigner.xml -.idea/**/dbnavigator.xml - -# Gradle -.idea/**/gradle.xml -.idea/**/libraries - -# Gradle and Maven with auto-import -# When using Gradle or Maven with auto-import, you should exclude module files, -# since they will be recreated, and may cause churn. Uncomment if using -# auto-import. -# .idea/modules.xml -# .idea/*.iml -# .idea/modules - -# CMake -cmake-build-*/ - -# Mongo Explorer plugin -.idea/**/mongoSettings.xml - -# File-based project format -*.iws - -# IntelliJ -out/ - -# mpeltonen/sbt-idea plugin -.idea_modules/ - -# JIRA plugin -atlassian-ide-plugin.xml - -# Cursive Clojure plugin -.idea/replstate.xml - -# Crashlytics plugin (for Android Studio and IntelliJ) -com_crashlytics_export_strings.xml -crashlytics.properties -crashlytics-build.properties -fabric.properties - -# Editor-based Rest Client -.idea/httpRequests - -# Android studio 3.1+ serialized cache file -.idea/caches/build_file_checksums.ser diff --git a/vendor/sebastian/type/.idea/inspectionProfiles/Project_Default.xml b/vendor/sebastian/type/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index 272394b..0000000 --- a/vendor/sebastian/type/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,499 +0,0 @@ - - - - \ No newline at end of file diff --git a/vendor/sebastian/type/.idea/misc.xml b/vendor/sebastian/type/.idea/misc.xml deleted file mode 100644 index 28a804d..0000000 --- a/vendor/sebastian/type/.idea/misc.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/vendor/sebastian/type/.idea/modules.xml b/vendor/sebastian/type/.idea/modules.xml deleted file mode 100644 index cfc6039..0000000 --- a/vendor/sebastian/type/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/vendor/sebastian/type/.idea/php-inspections-ea-ultimate.xml b/vendor/sebastian/type/.idea/php-inspections-ea-ultimate.xml deleted file mode 100644 index 26c2a68..0000000 --- a/vendor/sebastian/type/.idea/php-inspections-ea-ultimate.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/vendor/sebastian/type/.idea/php.xml b/vendor/sebastian/type/.idea/php.xml deleted file mode 100644 index b4dab66..0000000 --- a/vendor/sebastian/type/.idea/php.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/vendor/sebastian/type/.idea/type.iml b/vendor/sebastian/type/.idea/type.iml deleted file mode 100644 index 24c4e40..0000000 --- a/vendor/sebastian/type/.idea/type.iml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/vendor/sebastian/type/.idea/vcs.xml b/vendor/sebastian/type/.idea/vcs.xml deleted file mode 100644 index 94a25f7..0000000 --- a/vendor/sebastian/type/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/vendor/sebastian/type/.php_cs.dist b/vendor/sebastian/type/.php_cs.dist deleted file mode 100644 index 00eae39..0000000 --- a/vendor/sebastian/type/.php_cs.dist +++ /dev/null @@ -1,200 +0,0 @@ - - -For the full copyright and license information, please view the LICENSE -file that was distributed with this source code. -EOF; - -return PhpCsFixer\Config::create() - ->setRiskyAllowed(true) - ->setRules( - [ - 'align_multiline_comment' => true, - 'array_indentation' => true, - 'array_syntax' => ['syntax' => 'short'], - 'binary_operator_spaces' => [ - 'operators' => [ - '=' => 'align', - '=>' => 'align', - ], - ], - 'blank_line_after_namespace' => true, - 'blank_line_before_statement' => [ - 'statements' => [ - 'break', - 'continue', - 'declare', - 'do', - 'for', - 'foreach', - 'if', - 'include', - 'include_once', - 'require', - 'require_once', - 'return', - 'switch', - 'throw', - 'try', - 'while', - 'yield', - ], - ], - 'braces' => true, - 'cast_spaces' => true, - 'class_attributes_separation' => ['elements' => ['const', 'method', 'property']], - 'combine_consecutive_issets' => true, - 'combine_consecutive_unsets' => true, - 'compact_nullable_typehint' => true, - 'concat_space' => ['spacing' => 'one'], - 'declare_equal_normalize' => ['space' => 'none'], - 'declare_strict_types' => true, - 'dir_constant' => true, - 'elseif' => true, - 'encoding' => true, - 'full_opening_tag' => true, - 'function_declaration' => true, - 'header_comment' => ['header' => $header, 'separate' => 'none'], - 'indentation_type' => true, - 'is_null' => true, - 'line_ending' => true, - 'list_syntax' => ['syntax' => 'short'], - 'logical_operators' => true, - 'lowercase_cast' => true, - 'lowercase_constants' => true, - 'lowercase_keywords' => true, - 'lowercase_static_reference' => true, - 'magic_constant_casing' => true, - 'method_argument_space' => ['ensure_fully_multiline' => true], - 'modernize_types_casting' => true, - 'multiline_comment_opening_closing' => true, - 'multiline_whitespace_before_semicolons' => true, - 'native_constant_invocation' => true, - 'native_function_casing' => true, - 'native_function_invocation' => true, - 'new_with_braces' => false, - 'no_alias_functions' => true, - 'no_alternative_syntax' => true, - 'no_blank_lines_after_class_opening' => true, - 'no_blank_lines_after_phpdoc' => true, - 'no_blank_lines_before_namespace' => true, - 'no_closing_tag' => true, - 'no_empty_comment' => true, - 'no_empty_phpdoc' => true, - 'no_empty_statement' => true, - 'no_extra_blank_lines' => true, - 'no_homoglyph_names' => true, - 'no_leading_import_slash' => true, - 'no_leading_namespace_whitespace' => true, - 'no_mixed_echo_print' => ['use' => 'print'], - 'no_multiline_whitespace_around_double_arrow' => true, - 'no_null_property_initialization' => true, - 'no_php4_constructor' => true, - 'no_short_bool_cast' => true, - 'no_short_echo_tag' => true, - 'no_singleline_whitespace_before_semicolons' => true, - 'no_spaces_after_function_name' => true, - 'no_spaces_inside_parenthesis' => true, - 'no_superfluous_elseif' => true, - 'no_superfluous_phpdoc_tags' => true, - 'no_trailing_comma_in_list_call' => true, - 'no_trailing_comma_in_singleline_array' => true, - 'no_trailing_whitespace' => true, - 'no_trailing_whitespace_in_comment' => true, - 'no_unneeded_control_parentheses' => true, - 'no_unneeded_curly_braces' => true, - 'no_unneeded_final_method' => true, - 'no_unreachable_default_argument_value' => true, - 'no_unset_on_property' => true, - 'no_unused_imports' => true, - 'no_useless_else' => true, - 'no_useless_return' => true, - 'no_whitespace_before_comma_in_array' => true, - 'no_whitespace_in_blank_line' => true, - 'non_printable_character' => true, - 'normalize_index_brace' => true, - 'object_operator_without_whitespace' => true, - 'ordered_class_elements' => [ - 'order' => [ - 'use_trait', - 'constant_public', - 'constant_protected', - 'constant_private', - 'property_public_static', - 'property_protected_static', - 'property_private_static', - 'property_public', - 'property_protected', - 'property_private', - 'method_public_static', - 'construct', - 'destruct', - 'magic', - 'phpunit', - 'method_public', - 'method_protected', - 'method_private', - 'method_protected_static', - 'method_private_static', - ], - ], - 'ordered_imports' => true, - 'ordered_interfaces' => [ - 'direction' => 'ascend', - 'order' => 'alpha', - ], - 'phpdoc_add_missing_param_annotation' => true, - 'phpdoc_align' => true, - 'phpdoc_annotation_without_dot' => true, - 'phpdoc_indent' => true, - 'phpdoc_no_access' => true, - 'phpdoc_no_empty_return' => true, - 'phpdoc_no_package' => true, - 'phpdoc_order' => true, - 'phpdoc_return_self_reference' => true, - 'phpdoc_scalar' => true, - 'phpdoc_separation' => true, - 'phpdoc_single_line_var_spacing' => true, - 'phpdoc_to_comment' => true, - 'phpdoc_trim' => true, - 'phpdoc_trim_consecutive_blank_line_separation' => true, - 'phpdoc_types' => ['groups' => ['simple', 'meta']], - 'phpdoc_types_order' => true, - 'phpdoc_var_without_name' => true, - 'pow_to_exponentiation' => true, - 'protected_to_private' => true, - 'return_assignment' => true, - 'return_type_declaration' => ['space_before' => 'none'], - 'semicolon_after_instruction' => true, - 'set_type_to_cast' => true, - 'short_scalar_cast' => true, - 'simplified_null_return' => true, - 'single_blank_line_at_eof' => true, - 'single_import_per_statement' => true, - 'single_line_after_imports' => true, - 'single_quote' => true, - 'standardize_not_equals' => true, - 'ternary_to_null_coalescing' => true, - 'trailing_comma_in_multiline_array' => true, - 'trim_array_spaces' => true, - 'unary_operator_spaces' => true, - 'visibility_required' => [ - 'elements' => [ - 'const', - 'method', - 'property', - ], - ], - 'void_return' => true, - 'whitespace_after_comma_in_array' => true, - ] - ) - ->setFinder( - PhpCsFixer\Finder::create() - ->files() - ->in(__DIR__ . '/src') - ->in(__DIR__ . '/tests') - ); diff --git a/vendor/sebastian/type/.travis.yml b/vendor/sebastian/type/.travis.yml deleted file mode 100644 index 961341b..0000000 --- a/vendor/sebastian/type/.travis.yml +++ /dev/null @@ -1,53 +0,0 @@ -language: php - -php: - - 7.2 - - 7.3 - - 7.4snapshot - - nightly - -matrix: - allow_failures: - - php: master - fast_finish: true - -env: - matrix: - - DEPENDENCIES="high" - - DEPENDENCIES="low" - global: - - DEFAULT_COMPOSER_FLAGS="--no-interaction --no-ansi --no-progress --no-suggest" - -before_install: - - ./tools/composer clear-cache - -install: - - if [[ "$DEPENDENCIES" = 'high' ]]; then travis_retry ./tools/composer update $DEFAULT_COMPOSER_FLAGS; fi - - if [[ "$DEPENDENCIES" = 'low' ]]; then travis_retry ./tools/composer update $DEFAULT_COMPOSER_FLAGS --prefer-lowest; fi - -script: - - ./vendor/bin/phpunit --coverage-clover=coverage.xml - -after_success: - - bash <(curl -s https://codecov.io/bash) - -notifications: - email: false - -jobs: - include: - - stage: "Static Code Analysis" - php: 7.3 - env: php-cs-fixer - install: - - phpenv config-rm xdebug.ini - script: - - ./tools/php-cs-fixer fix --dry-run -v --show-progress=dots --diff-format=udiff - - stage: "Static Code Analysis" - php: 7.3 - env: psalm - install: - - phpenv config-rm xdebug.ini - script: - - travis_retry ./tools/composer update $DEFAULT_COMPOSER_FLAGS - - ./tools/psalm --shepherd --stats diff --git a/vendor/sebastian/type/ChangeLog.md b/vendor/sebastian/type/ChangeLog.md deleted file mode 100644 index 3618db1..0000000 --- a/vendor/sebastian/type/ChangeLog.md +++ /dev/null @@ -1,45 +0,0 @@ -# ChangeLog - -All notable changes are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. - -## [1.1.4] - 2020-11-30 - -### Changed - -* Changed PHP version constraint in `composer.json` from `^7.2` to `>=7.2` - -## [1.1.3] - 2019-07-02 - -### Fixed - -* Fixed class name comparison in `ObjectType` to be case insensitive - -## [1.1.2] - 2019-06-19 - -### Fixed - -* Fixed handling of `object` type - -## [1.1.1] - 2019-06-08 - -### Fixed - -* Fixed autoloading of `callback_function.php` fixture file - -## [1.1.0] - 2019-06-07 - -### Added - -* Added support for `callable` type -* Added support for `iterable` type - -## [1.0.0] - 2019-06-06 - -* Initial release based on [code contributed by Michel Hartmann to PHPUnit](https://github.com/sebastianbergmann/phpunit/pull/3673) - -[1.1.4]: https://github.com/sebastianbergmann/type/compare/1.1.3...1.1.4 -[1.1.3]: https://github.com/sebastianbergmann/type/compare/1.1.2...1.1.3 -[1.1.2]: https://github.com/sebastianbergmann/type/compare/1.1.1...1.1.2 -[1.1.1]: https://github.com/sebastianbergmann/type/compare/1.1.0...1.1.1 -[1.1.0]: https://github.com/sebastianbergmann/type/compare/1.0.0...1.1.0 -[1.0.0]: https://github.com/sebastianbergmann/type/compare/ff74aa41746bd8d10e931843ebf37d42da513ede...1.0.0 diff --git a/vendor/sebastian/type/LICENSE b/vendor/sebastian/type/LICENSE deleted file mode 100644 index c58cd4e..0000000 --- a/vendor/sebastian/type/LICENSE +++ /dev/null @@ -1,33 +0,0 @@ -sebastian/type - -Copyright (c) 2019, Sebastian Bergmann . -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Sebastian Bergmann nor the names of his - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/sebastian/type/README.md b/vendor/sebastian/type/README.md deleted file mode 100644 index c7c8da6..0000000 --- a/vendor/sebastian/type/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# sebastian/type - -Collection of value objects that represent the types of the PHP type system. - -## Installation - -You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): - -``` -composer require sebastian/type -``` - -If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: - -``` -composer require --dev sebastian/type -``` diff --git a/vendor/sebastian/type/build.xml b/vendor/sebastian/type/build.xml deleted file mode 100644 index d081430..0000000 --- a/vendor/sebastian/type/build.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/sebastian/type/composer.json b/vendor/sebastian/type/composer.json deleted file mode 100644 index 5a2d622..0000000 --- a/vendor/sebastian/type/composer.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "sebastian/type", - "description": "Collection of value objects that represent the types of the PHP type system", - "type": "library", - "homepage": "https://github.com/sebastianbergmann/type", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "support": { - "issues": "https://github.com/sebastianbergmann/type/issues" - }, - "prefer-stable": true, - "require": { - "php": ">=7.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.2" - }, - "config": { - "platform": { - "php": "7.2.0" - }, - "optimize-autoloader": true, - "sort-packages": true - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "autoload-dev": { - "classmap": [ - "tests/_fixture" - ], - "files": [ - "tests/_fixture/callback_function.php" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - } -} diff --git a/vendor/sebastian/type/phive.xml b/vendor/sebastian/type/phive.xml deleted file mode 100644 index 8c97a15..0000000 --- a/vendor/sebastian/type/phive.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/vendor/sebastian/type/phpunit.xml b/vendor/sebastian/type/phpunit.xml deleted file mode 100644 index 0007cf7..0000000 --- a/vendor/sebastian/type/phpunit.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - tests/unit - - - - - - src - - - diff --git a/vendor/sebastian/type/psalm.xml b/vendor/sebastian/type/psalm.xml deleted file mode 100644 index c94bb67..0000000 --- a/vendor/sebastian/type/psalm.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/sebastian/type/src/CallableType.php b/vendor/sebastian/type/src/CallableType.php deleted file mode 100644 index 28b5df8..0000000 --- a/vendor/sebastian/type/src/CallableType.php +++ /dev/null @@ -1,182 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Type; - -final class CallableType extends Type -{ - /** - * @var bool - */ - private $allowsNull; - - public function __construct(bool $nullable) - { - $this->allowsNull = $nullable; - } - - /** - * @throws RuntimeException - */ - public function isAssignable(Type $other): bool - { - if ($this->allowsNull && $other instanceof NullType) { - return true; - } - - if ($other instanceof self) { - return true; - } - - if ($other instanceof ObjectType) { - if ($this->isClosure($other)) { - return true; - } - - if ($this->hasInvokeMethod($other)) { - return true; - } - } - - if ($other instanceof SimpleType) { - if ($this->isFunction($other)) { - return true; - } - - if ($this->isClassCallback($other)) { - return true; - } - - if ($this->isObjectCallback($other)) { - return true; - } - } - - return false; - } - - public function getReturnTypeDeclaration(): string - { - return ': ' . ($this->allowsNull ? '?' : '') . 'callable'; - } - - public function allowsNull(): bool - { - return $this->allowsNull; - } - - private function isClosure(ObjectType $type): bool - { - return !$type->className()->isNamespaced() && $type->className()->getSimpleName() === \Closure::class; - } - - /** - * @throws RuntimeException - */ - private function hasInvokeMethod(ObjectType $type): bool - { - try { - $class = new \ReflectionClass($type->className()->getQualifiedName()); - // @codeCoverageIgnoreStart - } catch (\ReflectionException $e) { - throw new RuntimeException( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - // @codeCoverageIgnoreEnd - } - - if ($class->hasMethod('__invoke')) { - return true; - } - - return false; - } - - private function isFunction(SimpleType $type): bool - { - if (!\is_string($type->value())) { - return false; - } - - return \function_exists($type->value()); - } - - private function isObjectCallback(SimpleType $type): bool - { - if (!\is_array($type->value())) { - return false; - } - - if (\count($type->value()) !== 2) { - return false; - } - - if (!\is_object($type->value()[0]) || !\is_string($type->value()[1])) { - return false; - } - - [$object, $methodName] = $type->value(); - - $reflector = new \ReflectionObject($object); - - return $reflector->hasMethod($methodName); - } - - private function isClassCallback(SimpleType $type): bool - { - if (!\is_string($type->value()) && !\is_array($type->value())) { - return false; - } - - if (\is_string($type->value())) { - if (\strpos($type->value(), '::') === false) { - return false; - } - - [$className, $methodName] = \explode('::', $type->value()); - } - - if (\is_array($type->value())) { - if (\count($type->value()) !== 2) { - return false; - } - - if (!\is_string($type->value()[0]) || !\is_string($type->value()[1])) { - return false; - } - - [$className, $methodName] = $type->value(); - } - - \assert(isset($className) && \is_string($className)); - \assert(isset($methodName) && \is_string($methodName)); - - try { - $class = new \ReflectionClass($className); - - if ($class->hasMethod($methodName)) { - $method = $class->getMethod($methodName); - - return $method->isPublic() && $method->isStatic(); - } - // @codeCoverageIgnoreStart - } catch (\ReflectionException $e) { - throw new RuntimeException( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - // @codeCoverageIgnoreEnd - } - - return false; - } -} diff --git a/vendor/sebastian/type/src/GenericObjectType.php b/vendor/sebastian/type/src/GenericObjectType.php deleted file mode 100644 index 7e0a6d2..0000000 --- a/vendor/sebastian/type/src/GenericObjectType.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Type; - -final class GenericObjectType extends Type -{ - /** - * @var bool - */ - private $allowsNull; - - public function __construct(bool $nullable) - { - $this->allowsNull = $nullable; - } - - public function isAssignable(Type $other): bool - { - if ($this->allowsNull && $other instanceof NullType) { - return true; - } - - if (!$other instanceof ObjectType) { - return false; - } - - return true; - } - - public function getReturnTypeDeclaration(): string - { - return ': ' . ($this->allowsNull ? '?' : '') . 'object'; - } - - public function allowsNull(): bool - { - return $this->allowsNull; - } -} diff --git a/vendor/sebastian/type/src/IterableType.php b/vendor/sebastian/type/src/IterableType.php deleted file mode 100644 index 49830d3..0000000 --- a/vendor/sebastian/type/src/IterableType.php +++ /dev/null @@ -1,67 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Type; - -final class IterableType extends Type -{ - /** - * @var bool - */ - private $allowsNull; - - public function __construct(bool $nullable) - { - $this->allowsNull = $nullable; - } - - /** - * @throws RuntimeException - */ - public function isAssignable(Type $other): bool - { - if ($this->allowsNull && $other instanceof NullType) { - return true; - } - - if ($other instanceof self) { - return true; - } - - if ($other instanceof SimpleType) { - return \is_iterable($other->value()); - } - - if ($other instanceof ObjectType) { - try { - return (new \ReflectionClass($other->className()->getQualifiedName()))->isIterable(); - // @codeCoverageIgnoreStart - } catch (\ReflectionException $e) { - throw new RuntimeException( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - // @codeCoverageIgnoreEnd - } - } - - return false; - } - - public function getReturnTypeDeclaration(): string - { - return ': ' . ($this->allowsNull ? '?' : '') . 'iterable'; - } - - public function allowsNull(): bool - { - return $this->allowsNull; - } -} diff --git a/vendor/sebastian/type/src/NullType.php b/vendor/sebastian/type/src/NullType.php deleted file mode 100644 index 0efe107..0000000 --- a/vendor/sebastian/type/src/NullType.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Type; - -final class NullType extends Type -{ - public function isAssignable(Type $other): bool - { - return !($other instanceof VoidType); - } - - public function getReturnTypeDeclaration(): string - { - return ''; - } - - public function allowsNull(): bool - { - return true; - } -} diff --git a/vendor/sebastian/type/src/ObjectType.php b/vendor/sebastian/type/src/ObjectType.php deleted file mode 100644 index 9a8d99e..0000000 --- a/vendor/sebastian/type/src/ObjectType.php +++ /dev/null @@ -1,63 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Type; - -final class ObjectType extends Type -{ - /** - * @var TypeName - */ - private $className; - - /** - * @var bool - */ - private $allowsNull; - - public function __construct(TypeName $className, bool $allowsNull) - { - $this->className = $className; - $this->allowsNull = $allowsNull; - } - - public function isAssignable(Type $other): bool - { - if ($this->allowsNull && $other instanceof NullType) { - return true; - } - - if ($other instanceof self) { - if (0 === \strcasecmp($this->className->getQualifiedName(), $other->className->getQualifiedName())) { - return true; - } - - if (\is_subclass_of($other->className->getQualifiedName(), $this->className->getQualifiedName(), true)) { - return true; - } - } - - return false; - } - - public function getReturnTypeDeclaration(): string - { - return ': ' . ($this->allowsNull ? '?' : '') . $this->className->getQualifiedName(); - } - - public function allowsNull(): bool - { - return $this->allowsNull; - } - - public function className(): TypeName - { - return $this->className; - } -} diff --git a/vendor/sebastian/type/src/SimpleType.php b/vendor/sebastian/type/src/SimpleType.php deleted file mode 100644 index 07662b8..0000000 --- a/vendor/sebastian/type/src/SimpleType.php +++ /dev/null @@ -1,86 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Type; - -final class SimpleType extends Type -{ - /** - * @var string - */ - private $name; - - /** - * @var bool - */ - private $allowsNull; - - /** - * @var mixed - */ - private $value; - - public function __construct(string $name, bool $nullable, $value = null) - { - $this->name = $this->normalize($name); - $this->allowsNull = $nullable; - $this->value = $value; - } - - public function isAssignable(Type $other): bool - { - if ($this->allowsNull && $other instanceof NullType) { - return true; - } - - if ($other instanceof self) { - return $this->name === $other->name; - } - - return false; - } - - public function getReturnTypeDeclaration(): string - { - return ': ' . ($this->allowsNull ? '?' : '') . $this->name; - } - - public function allowsNull(): bool - { - return $this->allowsNull; - } - - public function value() - { - return $this->value; - } - - private function normalize(string $name): string - { - $name = \strtolower($name); - - switch ($name) { - case 'boolean': - return 'bool'; - - case 'real': - case 'double': - return 'float'; - - case 'integer': - return 'int'; - - case '[]': - return 'array'; - - default: - return $name; - } - } -} diff --git a/vendor/sebastian/type/src/Type.php b/vendor/sebastian/type/src/Type.php deleted file mode 100644 index df7dce6..0000000 --- a/vendor/sebastian/type/src/Type.php +++ /dev/null @@ -1,75 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Type; - -abstract class Type -{ - public static function fromValue($value, bool $allowsNull): self - { - $typeName = \gettype($value); - - if ($typeName === 'object') { - return new ObjectType(TypeName::fromQualifiedName(\get_class($value)), $allowsNull); - } - - $type = self::fromName($typeName, $allowsNull); - - if ($type instanceof SimpleType) { - $type = new SimpleType($typeName, $allowsNull, $value); - } - - return $type; - } - - public static function fromName(string $typeName, bool $allowsNull): self - { - switch (\strtolower($typeName)) { - case 'callable': - return new CallableType($allowsNull); - - case 'iterable': - return new IterableType($allowsNull); - - case 'null': - return new NullType; - - case 'object': - return new GenericObjectType($allowsNull); - - case 'unknown type': - return new UnknownType; - - case 'void': - return new VoidType; - - case 'array': - case 'bool': - case 'boolean': - case 'double': - case 'float': - case 'int': - case 'integer': - case 'real': - case 'resource': - case 'resource (closed)': - case 'string': - return new SimpleType($typeName, $allowsNull); - - default: - return new ObjectType(TypeName::fromQualifiedName($typeName), $allowsNull); - } - } - - abstract public function isAssignable(Type $other): bool; - - abstract public function getReturnTypeDeclaration(): string; - - abstract public function allowsNull(): bool; -} diff --git a/vendor/sebastian/type/src/TypeName.php b/vendor/sebastian/type/src/TypeName.php deleted file mode 100644 index fbbe36e..0000000 --- a/vendor/sebastian/type/src/TypeName.php +++ /dev/null @@ -1,77 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Type; - -final class TypeName -{ - /** - * @var ?string - */ - private $namespaceName; - - /** - * @var string - */ - private $simpleName; - - public static function fromQualifiedName(string $fullClassName): self - { - if ($fullClassName[0] === '\\') { - $fullClassName = \substr($fullClassName, 1); - } - - $classNameParts = \explode('\\', $fullClassName); - - $simpleName = \array_pop($classNameParts); - $namespaceName = \implode('\\', $classNameParts); - - return new self($namespaceName, $simpleName); - } - - public static function fromReflection(\ReflectionClass $type): self - { - return new self( - $type->getNamespaceName(), - $type->getShortName() - ); - } - - public function __construct(?string $namespaceName, string $simpleName) - { - if ($namespaceName === '') { - $namespaceName = null; - } - - $this->namespaceName = $namespaceName; - $this->simpleName = $simpleName; - } - - public function getNamespaceName(): ?string - { - return $this->namespaceName; - } - - public function getSimpleName(): string - { - return $this->simpleName; - } - - public function getQualifiedName(): string - { - return $this->namespaceName === null - ? $this->simpleName - : $this->namespaceName . '\\' . $this->simpleName; - } - - public function isNamespaced(): bool - { - return $this->namespaceName !== null; - } -} diff --git a/vendor/sebastian/type/src/UnknownType.php b/vendor/sebastian/type/src/UnknownType.php deleted file mode 100644 index 859f01d..0000000 --- a/vendor/sebastian/type/src/UnknownType.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Type; - -final class UnknownType extends Type -{ - public function isAssignable(Type $other): bool - { - return true; - } - - public function getReturnTypeDeclaration(): string - { - return ''; - } - - public function allowsNull(): bool - { - return true; - } -} diff --git a/vendor/sebastian/type/src/VoidType.php b/vendor/sebastian/type/src/VoidType.php deleted file mode 100644 index f6fabaa..0000000 --- a/vendor/sebastian/type/src/VoidType.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Type; - -final class VoidType extends Type -{ - public function isAssignable(Type $other): bool - { - return $other instanceof self; - } - - public function getReturnTypeDeclaration(): string - { - return ': void'; - } - - public function allowsNull(): bool - { - return false; - } -} diff --git a/vendor/sebastian/type/src/exception/Exception.php b/vendor/sebastian/type/src/exception/Exception.php deleted file mode 100644 index 9f0de24..0000000 --- a/vendor/sebastian/type/src/exception/Exception.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Type; - -interface Exception -{ -} diff --git a/vendor/sebastian/type/src/exception/RuntimeException.php b/vendor/sebastian/type/src/exception/RuntimeException.php deleted file mode 100644 index 4dfea6a..0000000 --- a/vendor/sebastian/type/src/exception/RuntimeException.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Type; - -final class RuntimeException extends \RuntimeException implements Exception -{ -} diff --git a/vendor/sebastian/type/tests/_fixture/ChildClass.php b/vendor/sebastian/type/tests/_fixture/ChildClass.php deleted file mode 100644 index 41e4245..0000000 --- a/vendor/sebastian/type/tests/_fixture/ChildClass.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Type\TestFixture; - -class ChildClass extends ParentClass -{ -} diff --git a/vendor/sebastian/type/tests/_fixture/ClassWithCallbackMethods.php b/vendor/sebastian/type/tests/_fixture/ClassWithCallbackMethods.php deleted file mode 100644 index 46137b4..0000000 --- a/vendor/sebastian/type/tests/_fixture/ClassWithCallbackMethods.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Type\TestFixture; - -final class ClassWithCallbackMethods -{ - public static function staticCallback(): void - { - } - - public function nonStaticCallback(): void - { - } -} diff --git a/vendor/sebastian/type/tests/_fixture/ClassWithInvokeMethod.php b/vendor/sebastian/type/tests/_fixture/ClassWithInvokeMethod.php deleted file mode 100644 index 1765570..0000000 --- a/vendor/sebastian/type/tests/_fixture/ClassWithInvokeMethod.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Type\TestFixture; - -final class ClassWithInvokeMethod -{ - public function __invoke(): void - { - } -} diff --git a/vendor/sebastian/type/tests/_fixture/Iterator.php b/vendor/sebastian/type/tests/_fixture/Iterator.php deleted file mode 100644 index e234dbe..0000000 --- a/vendor/sebastian/type/tests/_fixture/Iterator.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Type\TestFixture; - -final class Iterator implements \Iterator -{ - public function current(): void - { - } - - public function next(): void - { - } - - public function key(): void - { - } - - public function valid(): void - { - } - - public function rewind(): void - { - } -} diff --git a/vendor/sebastian/type/tests/_fixture/ParentClass.php b/vendor/sebastian/type/tests/_fixture/ParentClass.php deleted file mode 100644 index 4c28a5e..0000000 --- a/vendor/sebastian/type/tests/_fixture/ParentClass.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Type\TestFixture; - -class ParentClass -{ - public function foo(): void - { - } -} diff --git a/vendor/sebastian/type/tests/_fixture/callback_function.php b/vendor/sebastian/type/tests/_fixture/callback_function.php deleted file mode 100644 index 8dc1807..0000000 --- a/vendor/sebastian/type/tests/_fixture/callback_function.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Type\TestFixture; - -function callback_function(): void -{ -} diff --git a/vendor/sebastian/type/tests/unit/CallableTypeTest.php b/vendor/sebastian/type/tests/unit/CallableTypeTest.php deleted file mode 100644 index 126cedd..0000000 --- a/vendor/sebastian/type/tests/unit/CallableTypeTest.php +++ /dev/null @@ -1,150 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Type; - -use PHPUnit\Framework\TestCase; -use SebastianBergmann\Type\TestFixture\ClassWithCallbackMethods; -use SebastianBergmann\Type\TestFixture\ClassWithInvokeMethod; - -/** - * @covers \SebastianBergmann\Type\CallableType - * - * @uses \SebastianBergmann\Type\Type - * @uses \SebastianBergmann\Type\ObjectType - * @uses \SebastianBergmann\Type\SimpleType - * @uses \SebastianBergmann\Type\TypeName - */ -final class CallableTypeTest extends TestCase -{ - /** - * @var CallableType - */ - private $type; - - protected function setUp(): void - { - $this->type = new CallableType(false); - } - - public function testMayDisallowNull(): void - { - $this->assertFalse($this->type->allowsNull()); - } - - public function testCanGenerateReturnTypeDeclaration(): void - { - $this->assertEquals(': callable', $this->type->getReturnTypeDeclaration()); - } - - public function testMayAllowNull(): void - { - $type = new CallableType(true); - - $this->assertTrue($type->allowsNull()); - } - - public function testCanGenerateNullableReturnTypeDeclaration(): void - { - $type = new CallableType(true); - - $this->assertEquals(': ?callable', $type->getReturnTypeDeclaration()); - } - - public function testNullCanBeAssignedToNullableCallable(): void - { - $type = new CallableType(true); - - $this->assertTrue($type->isAssignable(new NullType)); - } - - public function testCallableCanBeAssignedToCallable(): void - { - $this->assertTrue($this->type->isAssignable(new CallableType(false))); - } - - public function testClosureCanBeAssignedToCallable(): void - { - $this->assertTrue( - $this->type->isAssignable( - new ObjectType( - TypeName::fromQualifiedName(\Closure::class), - false - ) - ) - ); - } - - public function testInvokableCanBeAssignedToCallable(): void - { - $this->assertTrue( - $this->type->isAssignable( - new ObjectType( - TypeName::fromQualifiedName(ClassWithInvokeMethod::class), - false - ) - ) - ); - } - - public function testStringWithFunctionNameCanBeAssignedToCallable(): void - { - $this->assertTrue( - $this->type->isAssignable( - Type::fromValue('SebastianBergmann\Type\TestFixture\callback_function', false) - ) - ); - } - - public function testStringWithClassNameAndStaticMethodNameCanBeAssignedToCallable(): void - { - $this->assertTrue( - $this->type->isAssignable( - Type::fromValue(ClassWithCallbackMethods::class . '::staticCallback', false) - ) - ); - } - - public function testArrayWithClassNameAndStaticMethodNameCanBeAssignedToCallable(): void - { - $this->assertTrue( - $this->type->isAssignable( - Type::fromValue([ClassWithCallbackMethods::class, 'staticCallback'], false) - ) - ); - } - - public function testArrayWithClassNameAndInstanceMethodNameCanBeAssignedToCallable(): void - { - $this->assertTrue( - $this->type->isAssignable( - Type::fromValue([new ClassWithCallbackMethods, 'nonStaticCallback'], false) - ) - ); - } - - public function testSomethingThatIsNotCallableCannotBeAssignedToCallable(): void - { - $this->assertFalse( - $this->type->isAssignable( - Type::fromValue(null, false) - ) - ); - } - - public function testObjectWithoutInvokeMethodCannotBeAssignedToCallable(): void - { - $this->assertFalse( - $this->type->isAssignable( - Type::fromValue(new class { - }, false) - ) - ); - } -} diff --git a/vendor/sebastian/type/tests/unit/GenericObjectTypeTest.php b/vendor/sebastian/type/tests/unit/GenericObjectTypeTest.php deleted file mode 100644 index 2017371..0000000 --- a/vendor/sebastian/type/tests/unit/GenericObjectTypeTest.php +++ /dev/null @@ -1,86 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Type; - -use PHPUnit\Framework\TestCase; - -/** - * @covers \SebastianBergmann\Type\GenericObjectType - * - * @uses \SebastianBergmann\Type\Type - * @uses \SebastianBergmann\Type\ObjectType - * @uses \SebastianBergmann\Type\SimpleType - * @uses \SebastianBergmann\Type\TypeName - */ -final class GenericObjectTypeTest extends TestCase -{ - /** - * @var GenericObjectType - */ - private $type; - - protected function setUp(): void - { - $this->type = new GenericObjectType(false); - } - - public function testMayDisallowNull(): void - { - $this->assertFalse($this->type->allowsNull()); - } - - public function testCanGenerateReturnTypeDeclaration(): void - { - $this->assertEquals(': object', $this->type->getReturnTypeDeclaration()); - } - - public function testMayAllowNull(): void - { - $type = new GenericObjectType(true); - - $this->assertTrue($type->allowsNull()); - } - - public function testCanGenerateNullableReturnTypeDeclaration(): void - { - $type = new GenericObjectType(true); - - $this->assertEquals(': ?object', $type->getReturnTypeDeclaration()); - } - - public function testObjectCanBeAssignedToGenericObject(): void - { - $this->assertTrue( - $this->type->isAssignable( - new ObjectType(TypeName::fromQualifiedName(\stdClass::class), false) - ) - ); - } - - public function testNullCanBeAssignedToNullableGenericObject(): void - { - $type = new GenericObjectType(true); - - $this->assertTrue( - $type->isAssignable( - new NullType - ) - ); - } - - public function testNonObjectCannotBeAssignedToGenericObject(): void - { - $this->assertFalse( - $this->type->isAssignable( - new SimpleType('bool', false) - ) - ); - } -} diff --git a/vendor/sebastian/type/tests/unit/IterableTypeTest.php b/vendor/sebastian/type/tests/unit/IterableTypeTest.php deleted file mode 100644 index 5493222..0000000 --- a/vendor/sebastian/type/tests/unit/IterableTypeTest.php +++ /dev/null @@ -1,97 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Type; - -use PHPUnit\Framework\TestCase; -use SebastianBergmann\Type\TestFixture\Iterator; - -/** - * @covers \SebastianBergmann\Type\IterableType - * - * @uses \SebastianBergmann\Type\Type - * @uses \SebastianBergmann\Type\TypeName - * @uses \SebastianBergmann\Type\ObjectType - * @uses \SebastianBergmann\Type\SimpleType - */ -final class IterableTypeTest extends TestCase -{ - /** - * @var IterableType - */ - private $type; - - protected function setUp(): void - { - $this->type = new IterableType(false); - } - - public function testMayDisallowNull(): void - { - $this->assertFalse($this->type->allowsNull()); - } - - public function testCanGenerateReturnTypeDeclaration(): void - { - $this->assertEquals(': iterable', $this->type->getReturnTypeDeclaration()); - } - - public function testMayAllowNull(): void - { - $type = new IterableType(true); - - $this->assertTrue($type->allowsNull()); - } - - public function testCanGenerateNullableReturnTypeDeclaration(): void - { - $type = new IterableType(true); - - $this->assertEquals(': ?iterable', $type->getReturnTypeDeclaration()); - } - - public function testNullCanBeAssignedToNullableIterable(): void - { - $type = new IterableType(true); - - $this->assertTrue($type->isAssignable(new NullType)); - } - - public function testIterableCanBeAssignedToIterable(): void - { - $this->assertTrue($this->type->isAssignable(new IterableType(false))); - } - - public function testArrayCanBeAssignedToIterable(): void - { - $this->assertTrue( - $this->type->isAssignable( - Type::fromValue([], false) - ) - ); - } - - public function testIteratorCanBeAssignedToIterable(): void - { - $this->assertTrue( - $this->type->isAssignable( - Type::fromValue(new Iterator, false) - ) - ); - } - - public function testSomethingThatIsNotIterableCannotBeAssignedToIterable(): void - { - $this->assertFalse( - $this->type->isAssignable( - Type::fromValue(null, false) - ) - ); - } -} diff --git a/vendor/sebastian/type/tests/unit/NullTypeTest.php b/vendor/sebastian/type/tests/unit/NullTypeTest.php deleted file mode 100644 index 7f4862e..0000000 --- a/vendor/sebastian/type/tests/unit/NullTypeTest.php +++ /dev/null @@ -1,72 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Type; - -use PHPUnit\Framework\TestCase; - -/** - * @covers \SebastianBergmann\Type\NullType - */ -final class NullTypeTest extends TestCase -{ - /** - * @var NullType - */ - private $type; - - protected function setUp(): void - { - $this->type = new NullType; - } - - /** - * @dataProvider assignableTypes - */ - public function testIsAssignable(Type $assignableType): void - { - $this->assertTrue($this->type->isAssignable($assignableType)); - } - - public function assignableTypes(): array - { - return [ - [new SimpleType('int', false)], - [new SimpleType('int', true)], - [new ObjectType(TypeName::fromQualifiedName(self::class), false)], - [new ObjectType(TypeName::fromQualifiedName(self::class), true)], - [new UnknownType], - ]; - } - - /** - * @dataProvider notAssignable - */ - public function testIsNotAssignable(Type $assignedType): void - { - $this->assertFalse($this->type->isAssignable($assignedType)); - } - - public function notAssignable(): array - { - return [ - 'void' => [new VoidType], - ]; - } - - public function testAllowsNull(): void - { - $this->assertTrue($this->type->allowsNull()); - } - - public function testCanGenerateReturnTypeDeclaration(): void - { - $this->assertEquals('', $this->type->getReturnTypeDeclaration()); - } -} diff --git a/vendor/sebastian/type/tests/unit/ObjectTypeTest.php b/vendor/sebastian/type/tests/unit/ObjectTypeTest.php deleted file mode 100644 index bbf64bb..0000000 --- a/vendor/sebastian/type/tests/unit/ObjectTypeTest.php +++ /dev/null @@ -1,140 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Type; - -use PHPUnit\Framework\TestCase; -use SebastianBergmann\Type\TestFixture\ChildClass; -use SebastianBergmann\Type\TestFixture\ParentClass; - -/** - * @covers \SebastianBergmann\Type\ObjectType - * - * @uses \SebastianBergmann\Type\TypeName - * @uses \SebastianBergmann\Type\Type - * @uses \SebastianBergmann\Type\SimpleType - */ -final class ObjectTypeTest extends TestCase -{ - /** - * @var ObjectType - */ - private $childClass; - - /** - * @var ObjectType - */ - private $parentClass; - - protected function setUp(): void - { - $this->childClass = new ObjectType( - TypeName::fromQualifiedName(ChildClass::class), - false - ); - - $this->parentClass = new ObjectType( - TypeName::fromQualifiedName(ParentClass::class), - false - ); - } - - public function testParentIsNotAssignableToChild(): void - { - $this->assertFalse($this->childClass->isAssignable($this->parentClass)); - } - - public function testChildIsAssignableToParent(): void - { - $this->assertTrue($this->parentClass->isAssignable($this->childClass)); - } - - public function testClassIsAssignableToSelf(): void - { - $this->assertTrue($this->parentClass->isAssignable($this->parentClass)); - } - - public function testSimpleTypeIsNotAssignableToClass(): void - { - $this->assertFalse($this->parentClass->isAssignable(new SimpleType('int', false))); - } - - public function testClassFromOneNamespaceIsNotAssignableToClassInOtherNamespace(): void - { - $classFromNamespaceA = new ObjectType( - TypeName::fromQualifiedName(\someNamespaceA\NamespacedClass::class), - false - ); - - $classFromNamespaceB = new ObjectType( - TypeName::fromQualifiedName(\someNamespaceB\NamespacedClass::class), - false - ); - $this->assertFalse($classFromNamespaceA->isAssignable($classFromNamespaceB)); - } - - public function testClassIsAssignableToSelfCaseInsensitively(): void - { - $classLowercased = new ObjectType( - TypeName::fromQualifiedName(\strtolower(ParentClass::class)), - false - ); - - $this->assertTrue($this->parentClass->isAssignable($classLowercased)); - } - - public function testNullIsAssignableToNullableType(): void - { - $someClass = new ObjectType( - TypeName::fromQualifiedName(ParentClass::class), - true - ); - $this->assertTrue($someClass->isAssignable(Type::fromValue(null, true))); - } - - public function testNullIsNotAssignableToNotNullableType(): void - { - $someClass = new ObjectType( - TypeName::fromQualifiedName(ParentClass::class), - false - ); - - $this->assertFalse($someClass->isAssignable(Type::fromValue(null, true))); - } - - public function testPreservesNullNotAllowed(): void - { - $someClass = new ObjectType( - TypeName::fromQualifiedName(ParentClass::class), - false - ); - - $this->assertFalse($someClass->allowsNull()); - } - - public function testPreservesNullAllowed(): void - { - $someClass = new ObjectType( - TypeName::fromQualifiedName(ParentClass::class), - true - ); - - $this->assertTrue($someClass->allowsNull()); - } - - public function testCanGenerateReturnTypeDeclaration(): void - { - $this->assertEquals(': SebastianBergmann\Type\TestFixture\ParentClass', $this->parentClass->getReturnTypeDeclaration()); - } - - public function testHasClassName(): void - { - $this->assertEquals('SebastianBergmann\Type\TestFixture\ParentClass', $this->parentClass->className()->getQualifiedName()); - } -} diff --git a/vendor/sebastian/type/tests/unit/SimpleTypeTest.php b/vendor/sebastian/type/tests/unit/SimpleTypeTest.php deleted file mode 100644 index d795e8c..0000000 --- a/vendor/sebastian/type/tests/unit/SimpleTypeTest.php +++ /dev/null @@ -1,162 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Type; - -use PHPUnit\Framework\TestCase; - -/** - * @covers \SebastianBergmann\Type\SimpleType - * - * @uses \SebastianBergmann\Type\Type - */ -final class SimpleTypeTest extends TestCase -{ - public function testCanBeBool(): void - { - $type = new SimpleType('bool', false); - - $this->assertSame(': bool', $type->getReturnTypeDeclaration()); - } - - public function testCanBeBoolean(): void - { - $type = new SimpleType('boolean', false); - - $this->assertSame(': bool', $type->getReturnTypeDeclaration()); - } - - public function testCanBeDouble(): void - { - $type = new SimpleType('double', false); - - $this->assertSame(': float', $type->getReturnTypeDeclaration()); - } - - public function testCanBeFloat(): void - { - $type = new SimpleType('float', false); - - $this->assertSame(': float', $type->getReturnTypeDeclaration()); - } - - public function testCanBeReal(): void - { - $type = new SimpleType('real', false); - - $this->assertSame(': float', $type->getReturnTypeDeclaration()); - } - - public function testCanBeInt(): void - { - $type = new SimpleType('int', false); - - $this->assertSame(': int', $type->getReturnTypeDeclaration()); - } - - public function testCanBeInteger(): void - { - $type = new SimpleType('integer', false); - - $this->assertSame(': int', $type->getReturnTypeDeclaration()); - } - - public function testCanBeArray(): void - { - $type = new SimpleType('array', false); - - $this->assertSame(': array', $type->getReturnTypeDeclaration()); - } - - public function testCanBeArray2(): void - { - $type = new SimpleType('[]', false); - - $this->assertSame(': array', $type->getReturnTypeDeclaration()); - } - - public function testMayAllowNull(): void - { - $type = new SimpleType('bool', true); - - $this->assertTrue($type->allowsNull()); - $this->assertSame(': ?bool', $type->getReturnTypeDeclaration()); - } - - public function testMayNotAllowNull(): void - { - $type = new SimpleType('bool', false); - - $this->assertFalse($type->allowsNull()); - } - - /** - * @dataProvider assignablePairs - */ - public function testIsAssignable(Type $assignTo, Type $assignedType): void - { - $this->assertTrue($assignTo->isAssignable($assignedType)); - } - - public function assignablePairs(): array - { - return [ - 'nullable to not nullable' => [new SimpleType('int', false), new SimpleType('int', true)], - 'not nullable to nullable' => [new SimpleType('int', true), new SimpleType('int', false)], - 'nullable to nullable' => [new SimpleType('int', true), new SimpleType('int', true)], - 'not nullable to not nullable' => [new SimpleType('int', false), new SimpleType('int', false)], - 'null to not nullable' => [new SimpleType('int', true), new NullType], - ]; - } - - /** - * @dataProvider notAssignablePairs - */ - public function testIsNotAssignable(Type $assignTo, Type $assignedType): void - { - $this->assertFalse($assignTo->isAssignable($assignedType)); - } - - public function notAssignablePairs(): array - { - return [ - 'null to not nullable' => [new SimpleType('int', false), new NullType], - 'int to boolean' => [new SimpleType('boolean', false), new SimpleType('int', false)], - 'object' => [new SimpleType('boolean', false), new ObjectType(TypeName::fromQualifiedName(\stdClass::class), true)], - 'unknown type' => [new SimpleType('boolean', false), new UnknownType], - 'void' => [new SimpleType('boolean', false), new VoidType], - ]; - } - - /** - * @dataProvider returnTypes - */ - public function testReturnTypeDeclaration(Type $type, string $returnType): void - { - $this->assertEquals($type->getReturnTypeDeclaration(), $returnType); - } - - public function returnTypes(): array - { - return [ - '[]' => [new SimpleType('[]', false), ': array'], - 'array' => [new SimpleType('array', false), ': array'], - '?array' => [new SimpleType('array', true), ': ?array'], - 'boolean' => [new SimpleType('boolean', false), ': bool'], - 'real' => [new SimpleType('real', false), ': float'], - 'double' => [new SimpleType('double', false), ': float'], - 'integer' => [new SimpleType('integer', false), ': int'], - ]; - } - - public function testCanHaveValue(): void - { - $this->assertSame('string', Type::fromValue('string', false)->value()); - } -} diff --git a/vendor/sebastian/type/tests/unit/TypeNameTest.php b/vendor/sebastian/type/tests/unit/TypeNameTest.php deleted file mode 100644 index 4e24a9a..0000000 --- a/vendor/sebastian/type/tests/unit/TypeNameTest.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Type; - -use PHPUnit\Framework\TestCase; - -/** - * @covers \SebastianBergmann\Type\TypeName - */ -final class TypeNameTest extends TestCase -{ - public function testFromReflection(): void - { - $class = new \ReflectionClass(TypeName::class); - $typeName = TypeName::fromReflection($class); - - $this->assertTrue($typeName->isNamespaced()); - $this->assertEquals('SebastianBergmann\\Type', $typeName->getNamespaceName()); - $this->assertEquals(TypeName::class, $typeName->getQualifiedName()); - $this->assertEquals('TypeName', $typeName->getSimpleName()); - } - - public function testFromQualifiedName(): void - { - $typeName = TypeName::fromQualifiedName('PHPUnit\\Framework\\MockObject\\TypeName'); - - $this->assertTrue($typeName->isNamespaced()); - $this->assertEquals('PHPUnit\\Framework\\MockObject', $typeName->getNamespaceName()); - $this->assertEquals('PHPUnit\\Framework\\MockObject\\TypeName', $typeName->getQualifiedName()); - $this->assertEquals('TypeName', $typeName->getSimpleName()); - } - - public function testFromQualifiedNameWithLeadingSeparator(): void - { - $typeName = TypeName::fromQualifiedName('\\Foo\\Bar'); - - $this->assertTrue($typeName->isNamespaced()); - $this->assertEquals('Foo', $typeName->getNamespaceName()); - $this->assertEquals('Foo\\Bar', $typeName->getQualifiedName()); - $this->assertEquals('Bar', $typeName->getSimpleName()); - } - - public function testFromQualifiedNameWithoutNamespace(): void - { - $typeName = TypeName::fromQualifiedName('Bar'); - - $this->assertFalse($typeName->isNamespaced()); - $this->assertNull($typeName->getNamespaceName()); - $this->assertEquals('Bar', $typeName->getQualifiedName()); - $this->assertEquals('Bar', $typeName->getSimpleName()); - } -} diff --git a/vendor/sebastian/type/tests/unit/TypeTest.php b/vendor/sebastian/type/tests/unit/TypeTest.php deleted file mode 100644 index 5bc4b7d..0000000 --- a/vendor/sebastian/type/tests/unit/TypeTest.php +++ /dev/null @@ -1,85 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Type; - -use PHPUnit\Framework\TestCase; - -/** - * @covers \SebastianBergmann\Type\Type - * - * @uses \SebastianBergmann\Type\SimpleType - * @uses \SebastianBergmann\Type\GenericObjectType - * @uses \SebastianBergmann\Type\ObjectType - * @uses \SebastianBergmann\Type\TypeName - * @uses \SebastianBergmann\Type\CallableType - * @uses \SebastianBergmann\Type\IterableType - */ -final class TypeTest extends TestCase -{ - /** - * @dataProvider valuesToNullableType - */ - public function testTypeMappingFromValue($value, bool $allowsNull, Type $expectedType): void - { - $this->assertEquals($expectedType, Type::fromValue($value, $allowsNull)); - } - - public function valuesToNullableType(): array - { - return [ - '?null' => [null, true, new NullType], - 'null' => [null, false, new NullType], - '?integer' => [1, true, new SimpleType('int', true, 1)], - 'integer' => [1, false, new SimpleType('int', false, 1)], - '?boolean' => [true, true, new SimpleType('bool', true, true)], - 'boolean' => [true, false, new SimpleType('bool', false, true)], - '?object' => [new \stdClass, true, new ObjectType(TypeName::fromQualifiedName(\stdClass::class), true)], - 'object' => [new \stdClass, false, new ObjectType(TypeName::fromQualifiedName(\stdClass::class), false)], - ]; - } - - /** - * @dataProvider namesToTypes - */ - public function testTypeMappingFromName(string $typeName, bool $allowsNull, $expectedType): void - { - $this->assertEquals($expectedType, Type::fromName($typeName, $allowsNull)); - } - - public function namesToTypes(): array - { - return [ - '?void' => ['void', true, new VoidType], - 'void' => ['void', false, new VoidType], - '?null' => ['null', true, new NullType], - 'null' => ['null', true, new NullType], - '?int' => ['int', true, new SimpleType('int', true)], - '?integer' => ['integer', true, new SimpleType('int', true)], - 'int' => ['int', false, new SimpleType('int', false)], - 'bool' => ['bool', false, new SimpleType('bool', false)], - 'boolean' => ['boolean', false, new SimpleType('bool', false)], - 'object' => ['object', false, new GenericObjectType(false)], - 'real' => ['real', false, new SimpleType('float', false)], - 'double' => ['double', false, new SimpleType('float', false)], - 'float' => ['float', false, new SimpleType('float', false)], - 'string' => ['string', false, new SimpleType('string', false)], - 'array' => ['array', false, new SimpleType('array', false)], - 'resource' => ['resource', false, new SimpleType('resource', false)], - 'resource (closed)' => ['resource (closed)', false, new SimpleType('resource (closed)', false)], - 'unknown type' => ['unknown type', false, new UnknownType], - '?classname' => [\stdClass::class, true, new ObjectType(TypeName::fromQualifiedName(\stdClass::class), true)], - 'classname' => [\stdClass::class, false, new ObjectType(TypeName::fromQualifiedName(\stdClass::class), false)], - 'callable' => ['callable', false, new CallableType(false)], - '?callable' => ['callable', true, new CallableType(true)], - 'iterable' => ['iterable', false, new IterableType(false)], - '?iterable' => ['iterable', true, new IterableType(true)], - ]; - } -} diff --git a/vendor/sebastian/type/tests/unit/UnknownTypeTest.php b/vendor/sebastian/type/tests/unit/UnknownTypeTest.php deleted file mode 100644 index bfa90f6..0000000 --- a/vendor/sebastian/type/tests/unit/UnknownTypeTest.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Type; - -use PHPUnit\Framework\TestCase; - -/** - * @covers \SebastianBergmann\Type\UnknownType - */ -final class UnknownTypeTest extends TestCase -{ - /** - * @var UnknownType - */ - private $type; - - protected function setUp(): void - { - $this->type = new UnknownType; - } - - /** - * @dataProvider assignableTypes - */ - public function testIsAssignable(Type $assignableType): void - { - $this->assertTrue($this->type->isAssignable($assignableType)); - } - - public function assignableTypes(): array - { - return [ - [new SimpleType('int', false)], - [new SimpleType('int', true)], - [new VoidType], - [new ObjectType(TypeName::fromQualifiedName(self::class), false)], - [new ObjectType(TypeName::fromQualifiedName(self::class), true)], - [new UnknownType], - ]; - } - - public function testAllowsNull(): void - { - $this->assertTrue($this->type->allowsNull()); - } - - public function testReturnTypeDeclaration(): void - { - $this->assertEquals('', $this->type->getReturnTypeDeclaration()); - } -} diff --git a/vendor/sebastian/type/tests/unit/VoidTypeTest.php b/vendor/sebastian/type/tests/unit/VoidTypeTest.php deleted file mode 100644 index 794052f..0000000 --- a/vendor/sebastian/type/tests/unit/VoidTypeTest.php +++ /dev/null @@ -1,70 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Type; - -use PHPUnit\Framework\TestCase; - -/** - * @covers \SebastianBergmann\Type\VoidType - */ -final class VoidTypeTest extends TestCase -{ - /** - * @dataProvider assignableTypes - */ - public function testIsAssignable(Type $assignableType): void - { - $type = new VoidType; - - $this->assertTrue($type->isAssignable($assignableType)); - } - - public function assignableTypes(): array - { - return [ - [new VoidType], - ]; - } - - /** - * @dataProvider notAssignableTypes - */ - public function testIsNotAssignable(Type $assignableType): void - { - $type = new VoidType; - - $this->assertFalse($type->isAssignable($assignableType)); - } - - public function notAssignableTypes(): array - { - return [ - [new SimpleType('int', false)], - [new SimpleType('int', true)], - [new ObjectType(TypeName::fromQualifiedName(self::class), false)], - [new ObjectType(TypeName::fromQualifiedName(self::class), true)], - [new UnknownType], - ]; - } - - public function testNotAllowNull(): void - { - $type = new VoidType; - - $this->assertFalse($type->allowsNull()); - } - - public function testCanGenerateReturnTypeDeclaration(): void - { - $type = new VoidType; - - $this->assertEquals(': void', $type->getReturnTypeDeclaration()); - } -} diff --git a/vendor/sebastian/version/.gitattributes b/vendor/sebastian/version/.gitattributes deleted file mode 100644 index 461090b..0000000 --- a/vendor/sebastian/version/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.php diff=php diff --git a/vendor/sebastian/version/.gitignore b/vendor/sebastian/version/.gitignore deleted file mode 100644 index a09c56d..0000000 --- a/vendor/sebastian/version/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/.idea diff --git a/vendor/sebastian/version/.php_cs b/vendor/sebastian/version/.php_cs deleted file mode 100644 index 8cbc57c..0000000 --- a/vendor/sebastian/version/.php_cs +++ /dev/null @@ -1,66 +0,0 @@ -files() - ->in('src') - ->name('*.php'); - -return Symfony\CS\Config\Config::create() - ->level(\Symfony\CS\FixerInterface::NONE_LEVEL) - ->fixers( - array( - 'align_double_arrow', - 'align_equals', - 'braces', - 'concat_with_spaces', - 'duplicate_semicolon', - 'elseif', - 'empty_return', - 'encoding', - 'eof_ending', - 'extra_empty_lines', - 'function_call_space', - 'function_declaration', - 'indentation', - 'join_function', - 'line_after_namespace', - 'linefeed', - 'list_commas', - 'lowercase_constants', - 'lowercase_keywords', - 'method_argument_space', - 'multiple_use', - 'namespace_no_leading_whitespace', - 'no_blank_lines_after_class_opening', - 'no_empty_lines_after_phpdocs', - 'parenthesis', - 'php_closing_tag', - 'phpdoc_indent', - 'phpdoc_no_access', - 'phpdoc_no_empty_return', - 'phpdoc_no_package', - 'phpdoc_params', - 'phpdoc_scalar', - 'phpdoc_separation', - 'phpdoc_to_comment', - 'phpdoc_trim', - 'phpdoc_types', - 'phpdoc_var_without_name', - 'remove_lines_between_uses', - 'return', - 'self_accessor', - 'short_array_syntax', - 'short_tag', - 'single_line_after_imports', - 'single_quote', - 'spaces_before_semicolon', - 'spaces_cast', - 'ternary_spaces', - 'trailing_spaces', - 'trim_array_spaces', - 'unused_use', - 'visibility', - 'whitespacy_lines' - ) - ) - ->finder($finder); - diff --git a/vendor/sebastian/version/LICENSE b/vendor/sebastian/version/LICENSE deleted file mode 100644 index 5b79c41..0000000 --- a/vendor/sebastian/version/LICENSE +++ /dev/null @@ -1,33 +0,0 @@ -Version - -Copyright (c) 2013-2015, Sebastian Bergmann . -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Sebastian Bergmann nor the names of his - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/sebastian/version/README.md b/vendor/sebastian/version/README.md deleted file mode 100644 index 2864c81..0000000 --- a/vendor/sebastian/version/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# Version - -**Version** is a library that helps with managing the version number of Git-hosted PHP projects. - -## Installation - -You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): - - composer require sebastian/version - -If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: - - composer require --dev sebastian/version - -## Usage - -The constructor of the `SebastianBergmann\Version` class expects two parameters: - -* `$release` is the version number of the latest release (`X.Y.Z`, for instance) or the name of the release series (`X.Y`) when no release has been made from that branch / for that release series yet. -* `$path` is the path to the directory (or a subdirectory thereof) where the sourcecode of the project can be found. Simply passing `__DIR__` here usually suffices. - -Apart from the constructor, the `SebastianBergmann\Version` class has a single public method: `getVersion()`. - -Here is a contrived example that shows the basic usage: - - getVersion()); - ?> - - string(18) "3.7.10-17-g00f3408" - -When a new release is prepared, the string that is passed to the constructor as the first argument needs to be updated. - -### How SebastianBergmann\Version::getVersion() works - -* If `$path` is not (part of) a Git repository and `$release` is in `X.Y.Z` format then `$release` is returned as-is. -* If `$path` is not (part of) a Git repository and `$release` is in `X.Y` format then `$release` is returned suffixed with `-dev`. -* If `$path` is (part of) a Git repository and `$release` is in `X.Y.Z` format then the output of `git describe --tags` is returned as-is. -* If `$path` is (part of) a Git repository and `$release` is in `X.Y` format then a string is returned that begins with `X.Y` and ends with information from `git describe --tags`. diff --git a/vendor/sebastian/version/composer.json b/vendor/sebastian/version/composer.json deleted file mode 100644 index 3b87814..0000000 --- a/vendor/sebastian/version/composer.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "sebastian/version", - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "support": { - "issues": "https://github.com/sebastianbergmann/version/issues" - }, - "require": { - "php": ">=5.6" - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - } -} diff --git a/vendor/sebastian/version/src/Version.php b/vendor/sebastian/version/src/Version.php deleted file mode 100644 index fc4cfec..0000000 --- a/vendor/sebastian/version/src/Version.php +++ /dev/null @@ -1,109 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann; - -/** - * @since Class available since Release 1.0.0 - */ -class Version -{ - /** - * @var string - */ - private $path; - - /** - * @var string - */ - private $release; - - /** - * @var string - */ - private $version; - - /** - * @param string $release - * @param string $path - */ - public function __construct($release, $path) - { - $this->release = $release; - $this->path = $path; - } - - /** - * @return string - */ - public function getVersion() - { - if ($this->version === null) { - if (count(explode('.', $this->release)) == 3) { - $this->version = $this->release; - } else { - $this->version = $this->release . '-dev'; - } - - $git = $this->getGitInformation($this->path); - - if ($git) { - if (count(explode('.', $this->release)) == 3) { - $this->version = $git; - } else { - $git = explode('-', $git); - - $this->version = $this->release . '-' . end($git); - } - } - } - - return $this->version; - } - - /** - * @param string $path - * - * @return bool|string - */ - private function getGitInformation($path) - { - if (!is_dir($path . DIRECTORY_SEPARATOR . '.git')) { - return false; - } - - $process = proc_open( - 'git describe --tags', - [ - 1 => ['pipe', 'w'], - 2 => ['pipe', 'w'], - ], - $pipes, - $path - ); - - if (!is_resource($process)) { - return false; - } - - $result = trim(stream_get_contents($pipes[1])); - - fclose($pipes[1]); - fclose($pipes[2]); - - $returnCode = proc_close($process); - - if ($returnCode !== 0) { - return false; - } - - return $result; - } -} diff --git a/vendor/squizlabs/php_codesniffer/CONTRIBUTING.md b/vendor/squizlabs/php_codesniffer/CONTRIBUTING.md deleted file mode 100644 index 5cc7363..0000000 --- a/vendor/squizlabs/php_codesniffer/CONTRIBUTING.md +++ /dev/null @@ -1,13 +0,0 @@ -Contributing -------------- - -Before you contribute code to PHP\_CodeSniffer, please make sure it conforms to the PHPCS coding standard and that the PHP\_CodeSniffer unit tests still pass. The easiest way to contribute is to work on a checkout of the repository, or your own fork, rather than an installed PEAR version. If you do this, you can run the following commands to check if everything is ready to submit: - - cd PHP_CodeSniffer - php bin/phpcs - -Which should display no coding standard errors. And then: - - phpunit - -Which should give you no failures or errors. You can ignore any skipped tests as these are for external tools. diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer.conf.dist b/vendor/squizlabs/php_codesniffer/CodeSniffer.conf.dist deleted file mode 100644 index 62dc395..0000000 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer.conf.dist +++ /dev/null @@ -1,9 +0,0 @@ - 'PSR2', - 'report_format' => 'summary', - 'show_warnings' => '0', - 'show_progress' => '1', - 'report_width' => '120', -) -?> diff --git a/vendor/squizlabs/php_codesniffer/README.md b/vendor/squizlabs/php_codesniffer/README.md deleted file mode 100644 index c0ea8e3..0000000 --- a/vendor/squizlabs/php_codesniffer/README.md +++ /dev/null @@ -1,133 +0,0 @@ -## About - -PHP_CodeSniffer is a set of two PHP scripts; the main `phpcs` script that tokenizes PHP, JavaScript and CSS files to detect violations of a defined coding standard, and a second `phpcbf` script to automatically correct coding standard violations. PHP_CodeSniffer is an essential development tool that ensures your code remains clean and consistent. - -[![Build Status](https://github.com/squizlabs/PHP_CodeSniffer/workflows/Validate/badge.svg?branch=master)](https://github.com/squizlabs/PHP_CodeSniffer/actions) -[![Build Status](https://github.com/squizlabs/PHP_CodeSniffer/workflows/Test/badge.svg?branch=master)](https://github.com/squizlabs/PHP_CodeSniffer/actions) -[![Code consistency](http://squizlabs.github.io/PHP_CodeSniffer/analysis/squizlabs/PHP_CodeSniffer/grade.svg)](http://squizlabs.github.io/PHP_CodeSniffer/analysis/squizlabs/PHP_CodeSniffer) -[![Join the chat at https://gitter.im/squizlabs/PHP_CodeSniffer](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/squizlabs/PHP_CodeSniffer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) - -## Requirements - -PHP_CodeSniffer requires PHP version 5.4.0 or greater, although individual sniffs may have additional requirements such as external applications and scripts. See the [Configuration Options manual page](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Configuration-Options) for a list of these requirements. - -If you're using PHP_CodeSniffer as part of a team, or you're running it on a [CI](https://en.wikipedia.org/wiki/Continuous_integration) server, you may want to configure your project's settings [using a configuration file](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#using-a-default-configuration-file). - - -## Installation - -The easiest way to get started with PHP_CodeSniffer is to download the Phar files for each of the commands: -``` -# Download using curl -curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar -curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar - -# Or download using wget -wget https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar -wget https://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar - -# Then test the downloaded PHARs -php phpcs.phar -h -php phpcbf.phar -h -``` - -### Composer -If you use Composer, you can install PHP_CodeSniffer system-wide with the following command: - - composer global require "squizlabs/php_codesniffer=*" - -Make sure you have the composer bin dir in your PATH. The default value is `~/.composer/vendor/bin/`, but you can check the value that you need to use by running `composer global config bin-dir --absolute`. - -Or alternatively, include a dependency for `squizlabs/php_codesniffer` in your `composer.json` file. For example: - -```json -{ - "require-dev": { - "squizlabs/php_codesniffer": "3.*" - } -} -``` - -You will then be able to run PHP_CodeSniffer from the vendor bin directory: - - ./vendor/bin/phpcs -h - ./vendor/bin/phpcbf -h - -### Phive -If you use Phive, you can install PHP_CodeSniffer as a project tool using the following commands: - - phive install phpcs - phive install phpcbf - -You will then be able to run PHP_CodeSniffer from the tools directory: - - ./tools/phpcs -h - ./tools/phpcbf -h - -### PEAR -If you use PEAR, you can install PHP_CodeSniffer using the PEAR installer. This will make the `phpcs` and `phpcbf` commands immediately available for use. To install PHP_CodeSniffer using the PEAR installer, first ensure you have [installed PEAR](http://pear.php.net/manual/en/installation.getting.php) and then run the following command: - - pear install PHP_CodeSniffer - -### Git Clone -You can also download the PHP_CodeSniffer source and run the `phpcs` and `phpcbf` commands directly from the Git clone: - - git clone https://github.com/squizlabs/PHP_CodeSniffer.git - cd PHP_CodeSniffer - php bin/phpcs -h - php bin/phpcbf -h - -## Getting Started - -The default coding standard used by PHP_CodeSniffer is the PEAR coding standard. To check a file against the PEAR coding standard, simply specify the file's location: - - $ phpcs /path/to/code/myfile.php - -Or if you wish to check an entire directory you can specify the directory location instead of a file. - - $ phpcs /path/to/code-directory - -If you wish to check your code against the PSR-12 coding standard, use the `--standard` command line argument: - - $ phpcs --standard=PSR12 /path/to/code-directory - -If PHP_CodeSniffer finds any coding standard errors, a report will be shown after running the command. - -Full usage information and example reports are available on the [usage page](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage). - -## Documentation - -The documentation for PHP_CodeSniffer is available on the [Github wiki](https://github.com/squizlabs/PHP_CodeSniffer/wiki). - -## Issues - -Bug reports and feature requests can be submitted on the [Github Issue Tracker](https://github.com/squizlabs/PHP_CodeSniffer/issues). - -## Contributing - -See [CONTRIBUTING.md](CONTRIBUTING.md) for information. - -## Versioning - -PHP_CodeSniffer uses a `MAJOR.MINOR.PATCH` version number format. - -The `MAJOR` version is incremented when: -- backwards-incompatible changes are made to how the `phpcs` or `phpcbf` commands are used, or -- backwards-incompatible changes are made to the `ruleset.xml` format, or -- backwards-incompatible changes are made to the API used by sniff developers, or -- custom PHP_CodeSniffer token types are removed, or -- existing sniffs are removed from PHP_CodeSniffer entirely - -The `MINOR` version is incremented when: -- new backwards-compatible features are added to the `phpcs` and `phpcbf` commands, or -- backwards-compatible changes are made to the `ruleset.xml` format, or -- backwards-compatible changes are made to the API used by sniff developers, or -- new sniffs are added to an included standard, or -- existing sniffs are removed from an included standard - -> NOTE: Backwards-compatible changes to the API used by sniff developers will allow an existing sniff to continue running without producing fatal errors but may not result in the sniff reporting the same errors as it did previously without changes being required. - -The `PATCH` version is incremented when: -- backwards-compatible bug fixes are made - -> NOTE: As PHP_CodeSniffer exists to report and fix issues, most bugs are the result of coding standard errors being incorrectly reported or coding standard errors not being reported when they should be. This means that the messages produced by PHP_CodeSniffer, and the fixes it makes, are likely to be different between PATCH versions. diff --git a/vendor/squizlabs/php_codesniffer/autoload.php b/vendor/squizlabs/php_codesniffer/autoload.php deleted file mode 100644 index 0dcf1b4..0000000 --- a/vendor/squizlabs/php_codesniffer/autoload.php +++ /dev/null @@ -1,342 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer; - -if (class_exists('PHP_CodeSniffer\Autoload', false) === false) { - class Autoload - { - - /** - * The composer autoloader. - * - * @var \Composer\Autoload\ClassLoader - */ - private static $composerAutoloader = null; - - /** - * A mapping of file names to class names. - * - * @var array - */ - private static $loadedClasses = []; - - /** - * A mapping of class names to file names. - * - * @var array - */ - private static $loadedFiles = []; - - /** - * A list of additional directories to search during autoloading. - * - * This is typically a list of coding standard directories. - * - * @var string[] - */ - private static $searchPaths = []; - - - /** - * Loads a class. - * - * This method only loads classes that exist in the PHP_CodeSniffer namespace. - * All other classes are ignored and loaded by subsequent autoloaders. - * - * @param string $class The name of the class to load. - * - * @return bool - */ - public static function load($class) - { - // Include the composer autoloader if there is one, but re-register it - // so this autoloader runs before the composer one as we need to include - // all files so we can figure out what the class/interface/trait name is. - if (self::$composerAutoloader === null) { - // Make sure we don't try to load any of Composer's classes - // while the autoloader is being setup. - if (strpos($class, 'Composer\\') === 0) { - return; - } - - if (strpos(__DIR__, 'phar://') !== 0 - && @file_exists(__DIR__.'/../../autoload.php') === true - ) { - self::$composerAutoloader = include __DIR__.'/../../autoload.php'; - if (self::$composerAutoloader instanceof \Composer\Autoload\ClassLoader) { - self::$composerAutoloader->unregister(); - self::$composerAutoloader->register(); - } else { - // Something went wrong, so keep going without the autoloader - // although namespaced sniffs might error. - self::$composerAutoloader = false; - } - } else { - self::$composerAutoloader = false; - } - }//end if - - $ds = DIRECTORY_SEPARATOR; - $path = false; - - if (substr($class, 0, 16) === 'PHP_CodeSniffer\\') { - if (substr($class, 0, 22) === 'PHP_CodeSniffer\Tests\\') { - $isInstalled = !is_dir(__DIR__.$ds.'tests'); - if ($isInstalled === false) { - $path = __DIR__.$ds.'tests'; - } else { - $path = '@test_dir@'.$ds.'PHP_CodeSniffer'.$ds.'CodeSniffer'; - } - - $path .= $ds.substr(str_replace('\\', $ds, $class), 22).'.php'; - } else { - $path = __DIR__.$ds.'src'.$ds.substr(str_replace('\\', $ds, $class), 16).'.php'; - } - } - - // See if the composer autoloader knows where the class is. - if ($path === false && self::$composerAutoloader !== false) { - $path = self::$composerAutoloader->findFile($class); - } - - // See if the class is inside one of our alternate search paths. - if ($path === false) { - foreach (self::$searchPaths as $searchPath => $nsPrefix) { - $className = $class; - if ($nsPrefix !== '' && substr($class, 0, strlen($nsPrefix)) === $nsPrefix) { - $className = substr($class, (strlen($nsPrefix) + 1)); - } - - $path = $searchPath.$ds.str_replace('\\', $ds, $className).'.php'; - if (is_file($path) === true) { - break; - } - - $path = false; - } - } - - if ($path !== false && is_file($path) === true) { - self::loadFile($path); - return true; - } - - return false; - - }//end load() - - - /** - * Includes a file and tracks what class or interface was loaded as a result. - * - * @param string $path The path of the file to load. - * - * @return string The fully qualified name of the class in the loaded file. - */ - public static function loadFile($path) - { - if (strpos(__DIR__, 'phar://') !== 0) { - $path = realpath($path); - if ($path === false) { - return false; - } - } - - if (isset(self::$loadedClasses[$path]) === true) { - return self::$loadedClasses[$path]; - } - - $classesBeforeLoad = [ - 'classes' => get_declared_classes(), - 'interfaces' => get_declared_interfaces(), - 'traits' => get_declared_traits(), - ]; - - include $path; - - $classesAfterLoad = [ - 'classes' => get_declared_classes(), - 'interfaces' => get_declared_interfaces(), - 'traits' => get_declared_traits(), - ]; - - $className = self::determineLoadedClass($classesBeforeLoad, $classesAfterLoad); - - self::$loadedClasses[$path] = $className; - self::$loadedFiles[$className] = $path; - return self::$loadedClasses[$path]; - - }//end loadFile() - - - /** - * Determine which class was loaded based on the before and after lists of loaded classes. - * - * @param array $classesBeforeLoad The classes/interfaces/traits before the file was included. - * @param array $classesAfterLoad The classes/interfaces/traits after the file was included. - * - * @return string The fully qualified name of the class in the loaded file. - */ - public static function determineLoadedClass($classesBeforeLoad, $classesAfterLoad) - { - $className = null; - - $newClasses = array_diff($classesAfterLoad['classes'], $classesBeforeLoad['classes']); - if (PHP_VERSION_ID < 70400) { - $newClasses = array_reverse($newClasses); - } - - // Since PHP 7.4 get_declared_classes() does not guarantee any order, making - // it impossible to use order to determine which is the parent an which is the child. - // Let's reduce the list of candidates by removing all the classes known to be "parents". - // That way, at the end, only the "main" class just included will remain. - $newClasses = array_reduce( - $newClasses, - function ($remaining, $current) { - return array_diff($remaining, class_parents($current)); - }, - $newClasses - ); - - foreach ($newClasses as $name) { - if (isset(self::$loadedFiles[$name]) === false) { - $className = $name; - break; - } - } - - if ($className === null) { - $newClasses = array_reverse(array_diff($classesAfterLoad['interfaces'], $classesBeforeLoad['interfaces'])); - foreach ($newClasses as $name) { - if (isset(self::$loadedFiles[$name]) === false) { - $className = $name; - break; - } - } - } - - if ($className === null) { - $newClasses = array_reverse(array_diff($classesAfterLoad['traits'], $classesBeforeLoad['traits'])); - foreach ($newClasses as $name) { - if (isset(self::$loadedFiles[$name]) === false) { - $className = $name; - break; - } - } - } - - return $className; - - }//end determineLoadedClass() - - - /** - * Adds a directory to search during autoloading. - * - * @param string $path The path to the directory to search. - * @param string $nsPrefix The namespace prefix used by files under this path. - * - * @return void - */ - public static function addSearchPath($path, $nsPrefix='') - { - self::$searchPaths[$path] = rtrim(trim((string) $nsPrefix), '\\'); - - }//end addSearchPath() - - - /** - * Retrieve the namespaces and paths registered by external standards. - * - * @return array - */ - public static function getSearchPaths() - { - return self::$searchPaths; - - }//end getSearchPaths() - - - /** - * Gets the class name for the given file path. - * - * @param string $path The name of the file. - * - * @throws \Exception If the file path has not been loaded. - * @return string - */ - public static function getLoadedClassName($path) - { - if (isset(self::$loadedClasses[$path]) === false) { - throw new \Exception("Cannot get class name for $path; file has not been included"); - } - - return self::$loadedClasses[$path]; - - }//end getLoadedClassName() - - - /** - * Gets the file path for the given class name. - * - * @param string $class The name of the class. - * - * @throws \Exception If the class name has not been loaded - * @return string - */ - public static function getLoadedFileName($class) - { - if (isset(self::$loadedFiles[$class]) === false) { - throw new \Exception("Cannot get file name for $class; class has not been included"); - } - - return self::$loadedFiles[$class]; - - }//end getLoadedFileName() - - - /** - * Gets the mapping of file names to class names. - * - * @return array - */ - public static function getLoadedClasses() - { - return self::$loadedClasses; - - }//end getLoadedClasses() - - - /** - * Gets the mapping of class names to file names. - * - * @return array - */ - public static function getLoadedFiles() - { - return self::$loadedFiles; - - }//end getLoadedFiles() - - - }//end class - - // Register the autoloader before any existing autoloaders to ensure - // it gets a chance to hear about every autoload request, and record - // the file and class name for it. - spl_autoload_register(__NAMESPACE__.'\Autoload::load', true, true); -}//end if diff --git a/vendor/squizlabs/php_codesniffer/bin/phpcbf b/vendor/squizlabs/php_codesniffer/bin/phpcbf deleted file mode 100755 index 45b43f4..0000000 --- a/vendor/squizlabs/php_codesniffer/bin/phpcbf +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env php - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -if (is_file(__DIR__.'/../autoload.php') === true) { - include_once __DIR__.'/../autoload.php'; -} else { - include_once 'PHP/CodeSniffer/autoload.php'; -} - -$runner = new PHP_CodeSniffer\Runner(); -$exitCode = $runner->runPHPCBF(); -exit($exitCode); diff --git a/vendor/squizlabs/php_codesniffer/bin/phpcbf.bat b/vendor/squizlabs/php_codesniffer/bin/phpcbf.bat deleted file mode 100644 index 5b07a7d..0000000 --- a/vendor/squizlabs/php_codesniffer/bin/phpcbf.bat +++ /dev/null @@ -1,12 +0,0 @@ -@echo off -REM PHP Code Beautifier and Fixer fixes violations of a defined coding standard. -REM -REM @author Greg Sherwood -REM @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) -REM @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - -if "%PHP_PEAR_PHP_BIN%" neq "" ( - set PHPBIN=%PHP_PEAR_PHP_BIN% -) else set PHPBIN=php - -"%PHPBIN%" "%~dp0\phpcbf" %* diff --git a/vendor/squizlabs/php_codesniffer/bin/phpcs b/vendor/squizlabs/php_codesniffer/bin/phpcs deleted file mode 100755 index 52d28cd..0000000 --- a/vendor/squizlabs/php_codesniffer/bin/phpcs +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env php - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -if (is_file(__DIR__.'/../autoload.php') === true) { - include_once __DIR__.'/../autoload.php'; -} else { - include_once 'PHP/CodeSniffer/autoload.php'; -} - -$runner = new PHP_CodeSniffer\Runner(); -$exitCode = $runner->runPHPCS(); -exit($exitCode); diff --git a/vendor/squizlabs/php_codesniffer/bin/phpcs.bat b/vendor/squizlabs/php_codesniffer/bin/phpcs.bat deleted file mode 100755 index 9f9be72..0000000 --- a/vendor/squizlabs/php_codesniffer/bin/phpcs.bat +++ /dev/null @@ -1,12 +0,0 @@ -@echo off -REM PHP_CodeSniffer detects violations of a defined coding standard. -REM -REM @author Greg Sherwood -REM @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) -REM @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - -if "%PHP_PEAR_PHP_BIN%" neq "" ( - set PHPBIN=%PHP_PEAR_PHP_BIN% -) else set PHPBIN=php - -"%PHPBIN%" "%~dp0\phpcs" %* diff --git a/vendor/squizlabs/php_codesniffer/composer.json b/vendor/squizlabs/php_codesniffer/composer.json deleted file mode 100644 index 7605a5d..0000000 --- a/vendor/squizlabs/php_codesniffer/composer.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "squizlabs/php_codesniffer", - "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "type": "library", - "keywords": [ - "phpcs", - "standards" - ], - "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Greg Sherwood", - "role": "lead" - } - ], - "support": { - "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", - "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki", - "source": "https://github.com/squizlabs/PHP_CodeSniffer" - }, - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, - "require": { - "php": ">=5.4.0", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "ext-simplexml": "*" - }, - "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" - }, - "bin": [ - "bin/phpcs", - "bin/phpcbf" - ] -} diff --git a/vendor/squizlabs/php_codesniffer/licence.txt b/vendor/squizlabs/php_codesniffer/licence.txt deleted file mode 100644 index 9f95b67..0000000 --- a/vendor/squizlabs/php_codesniffer/licence.txt +++ /dev/null @@ -1,24 +0,0 @@ -Copyright (c) 2012, Squiz Pty Ltd (ABN 77 084 670 600) -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/squizlabs/php_codesniffer/phpcs.xsd b/vendor/squizlabs/php_codesniffer/phpcs.xsd deleted file mode 100644 index d93dd86..0000000 --- a/vendor/squizlabs/php_codesniffer/phpcs.xsd +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Config.php b/vendor/squizlabs/php_codesniffer/src/Config.php deleted file mode 100644 index 6bb5b32..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Config.php +++ /dev/null @@ -1,1704 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer; - -use PHP_CodeSniffer\Exceptions\DeepExitException; -use PHP_CodeSniffer\Exceptions\RuntimeException; -use PHP_CodeSniffer\Util\Common; - -/** - * Stores the configuration used to run PHPCS and PHPCBF. - * - * @property string[] $files The files and directories to check. - * @property string[] $standards The standards being used for checking. - * @property int $verbosity How verbose the output should be. - * 0: no unnecessary output - * 1: basic output for files being checked - * 2: ruleset and file parsing output - * 3: sniff execution output - * @property bool $interactive Enable interactive checking mode. - * @property bool $parallel Check files in parallel. - * @property bool $cache Enable the use of the file cache. - * @property bool $cacheFile A file where the cache data should be written - * @property bool $colors Display colours in output. - * @property bool $explain Explain the coding standards. - * @property bool $local Process local files in directories only (no recursion). - * @property bool $showSources Show sniff source codes in report output. - * @property bool $showProgress Show basic progress information while running. - * @property bool $quiet Quiet mode; disables progress and verbose output. - * @property bool $annotations Process phpcs: annotations. - * @property int $tabWidth How many spaces each tab is worth. - * @property string $encoding The encoding of the files being checked. - * @property string[] $sniffs The sniffs that should be used for checking. - * If empty, all sniffs in the supplied standards will be used. - * @property string[] $exclude The sniffs that should be excluded from checking. - * If empty, all sniffs in the supplied standards will be used. - * @property string[] $ignored Regular expressions used to ignore files and folders during checking. - * @property string $reportFile A file where the report output should be written. - * @property string $generator The documentation generator to use. - * @property string $filter The filter to use for the run. - * @property string[] $bootstrap One of more files to include before the run begins. - * @property int $reportWidth The maximum number of columns that reports should use for output. - * Set to "auto" for have this value changed to the width of the terminal. - * @property int $errorSeverity The minimum severity an error must have to be displayed. - * @property int $warningSeverity The minimum severity a warning must have to be displayed. - * @property bool $recordErrors Record the content of error messages as well as error counts. - * @property string $suffix A suffix to add to fixed files. - * @property string $basepath A file system location to strip from the paths of files shown in reports. - * @property bool $stdin Read content from STDIN instead of supplied files. - * @property string $stdinContent Content passed directly to PHPCS on STDIN. - * @property string $stdinPath The path to use for content passed on STDIN. - * - * @property array $extensions File extensions that should be checked, and what tokenizer to use. - * E.g., array('inc' => 'PHP'); - * @property array $reports The reports to use for printing output after the run. - * The format of the array is: - * array( - * 'reportName1' => 'outputFile', - * 'reportName2' => null, - * ); - * If the array value is NULL, the report will be written to the screen. - * - * @property string[] $unknown Any arguments gathered on the command line that are unknown to us. - * E.g., using `phpcs -c` will give array('c'); - */ -class Config -{ - - /** - * The current version. - * - * @var string - */ - const VERSION = '3.6.2'; - - /** - * Package stability; either stable, beta or alpha. - * - * @var string - */ - const STABILITY = 'stable'; - - /** - * An array of settings that PHPCS and PHPCBF accept. - * - * This array is not meant to be accessed directly. Instead, use the settings - * as if they are class member vars so the __get() and __set() magic methods - * can be used to validate the values. For example, to set the verbosity level to - * level 2, use $this->verbosity = 2; instead of accessing this property directly. - * - * Each of these settings is described in the class comment property list. - * - * @var array - */ - private $settings = [ - 'files' => null, - 'standards' => null, - 'verbosity' => null, - 'interactive' => null, - 'parallel' => null, - 'cache' => null, - 'cacheFile' => null, - 'colors' => null, - 'explain' => null, - 'local' => null, - 'showSources' => null, - 'showProgress' => null, - 'quiet' => null, - 'annotations' => null, - 'tabWidth' => null, - 'encoding' => null, - 'extensions' => null, - 'sniffs' => null, - 'exclude' => null, - 'ignored' => null, - 'reportFile' => null, - 'generator' => null, - 'filter' => null, - 'bootstrap' => null, - 'reports' => null, - 'basepath' => null, - 'reportWidth' => null, - 'errorSeverity' => null, - 'warningSeverity' => null, - 'recordErrors' => null, - 'suffix' => null, - 'stdin' => null, - 'stdinContent' => null, - 'stdinPath' => null, - 'unknown' => null, - ]; - - /** - * Whether or not to kill the process when an unknown command line arg is found. - * - * If FALSE, arguments that are not command line options or file/directory paths - * will be ignored and execution will continue. These values will be stored in - * $this->unknown. - * - * @var boolean - */ - public $dieOnUnknownArg; - - /** - * The current command line arguments we are processing. - * - * @var string[] - */ - private $cliArgs = []; - - /** - * Command line values that the user has supplied directly. - * - * @var array - */ - private static $overriddenDefaults = []; - - /** - * Config file data that has been loaded for the run. - * - * @var array - */ - private static $configData = null; - - /** - * The full path to the config data file that has been loaded. - * - * @var string - */ - private static $configDataFile = null; - - /** - * Automatically discovered executable utility paths. - * - * @var array - */ - private static $executablePaths = []; - - - /** - * Get the value of an inaccessible property. - * - * @param string $name The name of the property. - * - * @return mixed - * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the setting name is invalid. - */ - public function __get($name) - { - if (array_key_exists($name, $this->settings) === false) { - throw new RuntimeException("ERROR: unable to get value of property \"$name\""); - } - - return $this->settings[$name]; - - }//end __get() - - - /** - * Set the value of an inaccessible property. - * - * @param string $name The name of the property. - * @param mixed $value The value of the property. - * - * @return void - * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the setting name is invalid. - */ - public function __set($name, $value) - { - if (array_key_exists($name, $this->settings) === false) { - throw new RuntimeException("Can't __set() $name; setting doesn't exist"); - } - - switch ($name) { - case 'reportWidth' : - // Support auto terminal width. - if ($value === 'auto' - && function_exists('shell_exec') === true - && preg_match('|\d+ (\d+)|', shell_exec('stty size 2>&1'), $matches) === 1 - ) { - $value = (int) $matches[1]; - } else { - $value = (int) $value; - } - break; - case 'standards' : - $cleaned = []; - - // Check if the standard name is valid, or if the case is invalid. - $installedStandards = Util\Standards::getInstalledStandards(); - foreach ($value as $standard) { - foreach ($installedStandards as $validStandard) { - if (strtolower($standard) === strtolower($validStandard)) { - $standard = $validStandard; - break; - } - } - - $cleaned[] = $standard; - } - - $value = $cleaned; - break; - default : - // No validation required. - break; - }//end switch - - $this->settings[$name] = $value; - - }//end __set() - - - /** - * Check if the value of an inaccessible property is set. - * - * @param string $name The name of the property. - * - * @return bool - */ - public function __isset($name) - { - return isset($this->settings[$name]); - - }//end __isset() - - - /** - * Unset the value of an inaccessible property. - * - * @param string $name The name of the property. - * - * @return void - */ - public function __unset($name) - { - $this->settings[$name] = null; - - }//end __unset() - - - /** - * Get the array of all config settings. - * - * @return array - */ - public function getSettings() - { - return $this->settings; - - }//end getSettings() - - - /** - * Set the array of all config settings. - * - * @param array $settings The array of config settings. - * - * @return void - */ - public function setSettings($settings) - { - return $this->settings = $settings; - - }//end setSettings() - - - /** - * Creates a Config object and populates it with command line values. - * - * @param array $cliArgs An array of values gathered from CLI args. - * @param bool $dieOnUnknownArg Whether or not to kill the process when an - * unknown command line arg is found. - * - * @return void - */ - public function __construct(array $cliArgs=[], $dieOnUnknownArg=true) - { - if (defined('PHP_CODESNIFFER_IN_TESTS') === true) { - // Let everything through during testing so that we can - // make use of PHPUnit command line arguments as well. - $this->dieOnUnknownArg = false; - } else { - $this->dieOnUnknownArg = $dieOnUnknownArg; - } - - if (empty($cliArgs) === true) { - $cliArgs = $_SERVER['argv']; - array_shift($cliArgs); - } - - $this->restoreDefaults(); - $this->setCommandLineValues($cliArgs); - - if (isset(self::$overriddenDefaults['standards']) === false) { - // They did not supply a standard to use. - // Look for a default ruleset in the current directory or higher. - $currentDir = getcwd(); - - $defaultFiles = [ - '.phpcs.xml', - 'phpcs.xml', - '.phpcs.xml.dist', - 'phpcs.xml.dist', - ]; - - do { - foreach ($defaultFiles as $defaultFilename) { - $default = $currentDir.DIRECTORY_SEPARATOR.$defaultFilename; - if (is_file($default) === true) { - $this->standards = [$default]; - break(2); - } - } - - $lastDir = $currentDir; - $currentDir = dirname($currentDir); - } while ($currentDir !== '.' && $currentDir !== $lastDir && Common::isReadable($currentDir) === true); - }//end if - - if (defined('STDIN') === false - || strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' - ) { - return; - } - - $handle = fopen('php://stdin', 'r'); - - // Check for content on STDIN. - if ($this->stdin === true - || (Util\Common::isStdinATTY() === false - && feof($handle) === false) - ) { - $readStreams = [$handle]; - $writeSteams = null; - - $fileContents = ''; - while (is_resource($handle) === true && feof($handle) === false) { - // Set a timeout of 200ms. - if (stream_select($readStreams, $writeSteams, $writeSteams, 0, 200000) === 0) { - break; - } - - $fileContents .= fgets($handle); - } - - if (trim($fileContents) !== '') { - $this->stdin = true; - $this->stdinContent = $fileContents; - self::$overriddenDefaults['stdin'] = true; - self::$overriddenDefaults['stdinContent'] = true; - } - }//end if - - fclose($handle); - - }//end __construct() - - - /** - * Set the command line values. - * - * @param array $args An array of command line arguments to set. - * - * @return void - */ - public function setCommandLineValues($args) - { - $this->cliArgs = $args; - $numArgs = count($args); - - for ($i = 0; $i < $numArgs; $i++) { - $arg = $this->cliArgs[$i]; - if ($arg === '') { - continue; - } - - if ($arg[0] === '-') { - if ($arg === '-') { - // Asking to read from STDIN. - $this->stdin = true; - self::$overriddenDefaults['stdin'] = true; - continue; - } - - if ($arg === '--') { - // Empty argument, ignore it. - continue; - } - - if ($arg[1] === '-') { - $this->processLongArgument(substr($arg, 2), $i); - } else { - $switches = str_split($arg); - foreach ($switches as $switch) { - if ($switch === '-') { - continue; - } - - $this->processShortArgument($switch, $i); - } - } - } else { - $this->processUnknownArgument($arg, $i); - }//end if - }//end for - - }//end setCommandLineValues() - - - /** - * Restore default values for all possible command line arguments. - * - * @return void - */ - public function restoreDefaults() - { - $this->files = []; - $this->standards = ['PEAR']; - $this->verbosity = 0; - $this->interactive = false; - $this->cache = false; - $this->cacheFile = null; - $this->colors = false; - $this->explain = false; - $this->local = false; - $this->showSources = false; - $this->showProgress = false; - $this->quiet = false; - $this->annotations = true; - $this->parallel = 1; - $this->tabWidth = 0; - $this->encoding = 'utf-8'; - $this->extensions = [ - 'php' => 'PHP', - 'inc' => 'PHP', - 'js' => 'JS', - 'css' => 'CSS', - ]; - $this->sniffs = []; - $this->exclude = []; - $this->ignored = []; - $this->reportFile = null; - $this->generator = null; - $this->filter = null; - $this->bootstrap = []; - $this->basepath = null; - $this->reports = ['full' => null]; - $this->reportWidth = 'auto'; - $this->errorSeverity = 5; - $this->warningSeverity = 5; - $this->recordErrors = true; - $this->suffix = ''; - $this->stdin = false; - $this->stdinContent = null; - $this->stdinPath = null; - $this->unknown = []; - - $standard = self::getConfigData('default_standard'); - if ($standard !== null) { - $this->standards = explode(',', $standard); - } - - $reportFormat = self::getConfigData('report_format'); - if ($reportFormat !== null) { - $this->reports = [$reportFormat => null]; - } - - $tabWidth = self::getConfigData('tab_width'); - if ($tabWidth !== null) { - $this->tabWidth = (int) $tabWidth; - } - - $encoding = self::getConfigData('encoding'); - if ($encoding !== null) { - $this->encoding = strtolower($encoding); - } - - $severity = self::getConfigData('severity'); - if ($severity !== null) { - $this->errorSeverity = (int) $severity; - $this->warningSeverity = (int) $severity; - } - - $severity = self::getConfigData('error_severity'); - if ($severity !== null) { - $this->errorSeverity = (int) $severity; - } - - $severity = self::getConfigData('warning_severity'); - if ($severity !== null) { - $this->warningSeverity = (int) $severity; - } - - $showWarnings = self::getConfigData('show_warnings'); - if ($showWarnings !== null) { - $showWarnings = (bool) $showWarnings; - if ($showWarnings === false) { - $this->warningSeverity = 0; - } - } - - $reportWidth = self::getConfigData('report_width'); - if ($reportWidth !== null) { - $this->reportWidth = $reportWidth; - } - - $showProgress = self::getConfigData('show_progress'); - if ($showProgress !== null) { - $this->showProgress = (bool) $showProgress; - } - - $quiet = self::getConfigData('quiet'); - if ($quiet !== null) { - $this->quiet = (bool) $quiet; - } - - $colors = self::getConfigData('colors'); - if ($colors !== null) { - $this->colors = (bool) $colors; - } - - if (defined('PHP_CODESNIFFER_IN_TESTS') === false) { - $cache = self::getConfigData('cache'); - if ($cache !== null) { - $this->cache = (bool) $cache; - } - - $parallel = self::getConfigData('parallel'); - if ($parallel !== null) { - $this->parallel = max((int) $parallel, 1); - } - } - - }//end restoreDefaults() - - - /** - * Processes a short (-e) command line argument. - * - * @param string $arg The command line argument. - * @param int $pos The position of the argument on the command line. - * - * @return void - * @throws \PHP_CodeSniffer\Exceptions\DeepExitException - */ - public function processShortArgument($arg, $pos) - { - switch ($arg) { - case 'h': - case '?': - ob_start(); - $this->printUsage(); - $output = ob_get_contents(); - ob_end_clean(); - throw new DeepExitException($output, 0); - case 'i' : - ob_start(); - Util\Standards::printInstalledStandards(); - $output = ob_get_contents(); - ob_end_clean(); - throw new DeepExitException($output, 0); - case 'v' : - if ($this->quiet === true) { - // Ignore when quiet mode is enabled. - break; - } - - $this->verbosity++; - self::$overriddenDefaults['verbosity'] = true; - break; - case 'l' : - $this->local = true; - self::$overriddenDefaults['local'] = true; - break; - case 's' : - $this->showSources = true; - self::$overriddenDefaults['showSources'] = true; - break; - case 'a' : - $this->interactive = true; - self::$overriddenDefaults['interactive'] = true; - break; - case 'e': - $this->explain = true; - self::$overriddenDefaults['explain'] = true; - break; - case 'p' : - if ($this->quiet === true) { - // Ignore when quiet mode is enabled. - break; - } - - $this->showProgress = true; - self::$overriddenDefaults['showProgress'] = true; - break; - case 'q' : - // Quiet mode disables a few other settings as well. - $this->quiet = true; - $this->showProgress = false; - $this->verbosity = 0; - - self::$overriddenDefaults['quiet'] = true; - break; - case 'm' : - $this->recordErrors = false; - self::$overriddenDefaults['recordErrors'] = true; - break; - case 'd' : - $ini = explode('=', $this->cliArgs[($pos + 1)]); - $this->cliArgs[($pos + 1)] = ''; - if (isset($ini[1]) === true) { - ini_set($ini[0], $ini[1]); - } else { - ini_set($ini[0], true); - } - break; - case 'n' : - if (isset(self::$overriddenDefaults['warningSeverity']) === false) { - $this->warningSeverity = 0; - self::$overriddenDefaults['warningSeverity'] = true; - } - break; - case 'w' : - if (isset(self::$overriddenDefaults['warningSeverity']) === false) { - $this->warningSeverity = $this->errorSeverity; - self::$overriddenDefaults['warningSeverity'] = true; - } - break; - default: - if ($this->dieOnUnknownArg === false) { - $unknown = $this->unknown; - $unknown[] = $arg; - $this->unknown = $unknown; - } else { - $this->processUnknownArgument('-'.$arg, $pos); - } - }//end switch - - }//end processShortArgument() - - - /** - * Processes a long (--example) command line argument. - * - * @param string $arg The command line argument. - * @param int $pos The position of the argument on the command line. - * - * @return void - * @throws \PHP_CodeSniffer\Exceptions\DeepExitException - */ - public function processLongArgument($arg, $pos) - { - switch ($arg) { - case 'help': - ob_start(); - $this->printUsage(); - $output = ob_get_contents(); - ob_end_clean(); - throw new DeepExitException($output, 0); - case 'version': - $output = 'PHP_CodeSniffer version '.self::VERSION.' ('.self::STABILITY.') '; - $output .= 'by Squiz (http://www.squiz.net)'.PHP_EOL; - throw new DeepExitException($output, 0); - case 'colors': - if (isset(self::$overriddenDefaults['colors']) === true) { - break; - } - - $this->colors = true; - self::$overriddenDefaults['colors'] = true; - break; - case 'no-colors': - if (isset(self::$overriddenDefaults['colors']) === true) { - break; - } - - $this->colors = false; - self::$overriddenDefaults['colors'] = true; - break; - case 'cache': - if (isset(self::$overriddenDefaults['cache']) === true) { - break; - } - - if (defined('PHP_CODESNIFFER_IN_TESTS') === false) { - $this->cache = true; - self::$overriddenDefaults['cache'] = true; - } - break; - case 'no-cache': - if (isset(self::$overriddenDefaults['cache']) === true) { - break; - } - - $this->cache = false; - self::$overriddenDefaults['cache'] = true; - break; - case 'ignore-annotations': - if (isset(self::$overriddenDefaults['annotations']) === true) { - break; - } - - $this->annotations = false; - self::$overriddenDefaults['annotations'] = true; - break; - case 'config-set': - if (isset($this->cliArgs[($pos + 1)]) === false - || isset($this->cliArgs[($pos + 2)]) === false - ) { - $error = 'ERROR: Setting a config option requires a name and value'.PHP_EOL.PHP_EOL; - $error .= $this->printShortUsage(true); - throw new DeepExitException($error, 3); - } - - $key = $this->cliArgs[($pos + 1)]; - $value = $this->cliArgs[($pos + 2)]; - $current = self::getConfigData($key); - - try { - $this->setConfigData($key, $value); - } catch (\Exception $e) { - throw new DeepExitException($e->getMessage().PHP_EOL, 3); - } - - $output = 'Using config file: '.self::$configDataFile.PHP_EOL.PHP_EOL; - - if ($current === null) { - $output .= "Config value \"$key\" added successfully".PHP_EOL; - } else { - $output .= "Config value \"$key\" updated successfully; old value was \"$current\"".PHP_EOL; - } - throw new DeepExitException($output, 0); - case 'config-delete': - if (isset($this->cliArgs[($pos + 1)]) === false) { - $error = 'ERROR: Deleting a config option requires the name of the option'.PHP_EOL.PHP_EOL; - $error .= $this->printShortUsage(true); - throw new DeepExitException($error, 3); - } - - $output = 'Using config file: '.self::$configDataFile.PHP_EOL.PHP_EOL; - - $key = $this->cliArgs[($pos + 1)]; - $current = self::getConfigData($key); - if ($current === null) { - $output .= "Config value \"$key\" has not been set".PHP_EOL; - } else { - try { - $this->setConfigData($key, null); - } catch (\Exception $e) { - throw new DeepExitException($e->getMessage().PHP_EOL, 3); - } - - $output .= "Config value \"$key\" removed successfully; old value was \"$current\"".PHP_EOL; - } - throw new DeepExitException($output, 0); - case 'config-show': - ob_start(); - $data = self::getAllConfigData(); - echo 'Using config file: '.self::$configDataFile.PHP_EOL.PHP_EOL; - $this->printConfigData($data); - $output = ob_get_contents(); - ob_end_clean(); - throw new DeepExitException($output, 0); - case 'runtime-set': - if (isset($this->cliArgs[($pos + 1)]) === false - || isset($this->cliArgs[($pos + 2)]) === false - ) { - $error = 'ERROR: Setting a runtime config option requires a name and value'.PHP_EOL.PHP_EOL; - $error .= $this->printShortUsage(true); - throw new DeepExitException($error, 3); - } - - $key = $this->cliArgs[($pos + 1)]; - $value = $this->cliArgs[($pos + 2)]; - $this->cliArgs[($pos + 1)] = ''; - $this->cliArgs[($pos + 2)] = ''; - self::setConfigData($key, $value, true); - if (isset(self::$overriddenDefaults['runtime-set']) === false) { - self::$overriddenDefaults['runtime-set'] = []; - } - - self::$overriddenDefaults['runtime-set'][$key] = true; - break; - default: - if (substr($arg, 0, 7) === 'sniffs=') { - if (isset(self::$overriddenDefaults['sniffs']) === true) { - break; - } - - $sniffs = explode(',', substr($arg, 7)); - foreach ($sniffs as $sniff) { - if (substr_count($sniff, '.') !== 2) { - $error = 'ERROR: The specified sniff code "'.$sniff.'" is invalid'.PHP_EOL.PHP_EOL; - $error .= $this->printShortUsage(true); - throw new DeepExitException($error, 3); - } - } - - $this->sniffs = $sniffs; - self::$overriddenDefaults['sniffs'] = true; - } else if (substr($arg, 0, 8) === 'exclude=') { - if (isset(self::$overriddenDefaults['exclude']) === true) { - break; - } - - $sniffs = explode(',', substr($arg, 8)); - foreach ($sniffs as $sniff) { - if (substr_count($sniff, '.') !== 2) { - $error = 'ERROR: The specified sniff code "'.$sniff.'" is invalid'.PHP_EOL.PHP_EOL; - $error .= $this->printShortUsage(true); - throw new DeepExitException($error, 3); - } - } - - $this->exclude = $sniffs; - self::$overriddenDefaults['exclude'] = true; - } else if (defined('PHP_CODESNIFFER_IN_TESTS') === false - && substr($arg, 0, 6) === 'cache=' - ) { - if ((isset(self::$overriddenDefaults['cache']) === true - && $this->cache === false) - || isset(self::$overriddenDefaults['cacheFile']) === true - ) { - break; - } - - // Turn caching on. - $this->cache = true; - self::$overriddenDefaults['cache'] = true; - - $this->cacheFile = Util\Common::realpath(substr($arg, 6)); - - // It may not exist and return false instead. - if ($this->cacheFile === false) { - $this->cacheFile = substr($arg, 6); - - $dir = dirname($this->cacheFile); - if (is_dir($dir) === false) { - $error = 'ERROR: The specified cache file path "'.$this->cacheFile.'" points to a non-existent directory'.PHP_EOL.PHP_EOL; - $error .= $this->printShortUsage(true); - throw new DeepExitException($error, 3); - } - - if ($dir === '.') { - // Passed cache file is a file in the current directory. - $this->cacheFile = getcwd().'/'.basename($this->cacheFile); - } else { - if ($dir[0] === '/') { - // An absolute path. - $dir = Util\Common::realpath($dir); - } else { - $dir = Util\Common::realpath(getcwd().'/'.$dir); - } - - if ($dir !== false) { - // Cache file path is relative. - $this->cacheFile = $dir.'/'.basename($this->cacheFile); - } - } - }//end if - - self::$overriddenDefaults['cacheFile'] = true; - - if (is_dir($this->cacheFile) === true) { - $error = 'ERROR: The specified cache file path "'.$this->cacheFile.'" is a directory'.PHP_EOL.PHP_EOL; - $error .= $this->printShortUsage(true); - throw new DeepExitException($error, 3); - } - } else if (substr($arg, 0, 10) === 'bootstrap=') { - $files = explode(',', substr($arg, 10)); - $bootstrap = []; - foreach ($files as $file) { - $path = Util\Common::realpath($file); - if ($path === false) { - $error = 'ERROR: The specified bootstrap file "'.$file.'" does not exist'.PHP_EOL.PHP_EOL; - $error .= $this->printShortUsage(true); - throw new DeepExitException($error, 3); - } - - $bootstrap[] = $path; - } - - $this->bootstrap = array_merge($this->bootstrap, $bootstrap); - self::$overriddenDefaults['bootstrap'] = true; - } else if (substr($arg, 0, 10) === 'file-list=') { - $fileList = substr($arg, 10); - $path = Util\Common::realpath($fileList); - if ($path === false) { - $error = 'ERROR: The specified file list "'.$fileList.'" does not exist'.PHP_EOL.PHP_EOL; - $error .= $this->printShortUsage(true); - throw new DeepExitException($error, 3); - } - - $files = file($path); - foreach ($files as $inputFile) { - $inputFile = trim($inputFile); - - // Skip empty lines. - if ($inputFile === '') { - continue; - } - - $this->processFilePath($inputFile); - } - } else if (substr($arg, 0, 11) === 'stdin-path=') { - if (isset(self::$overriddenDefaults['stdinPath']) === true) { - break; - } - - $this->stdinPath = Util\Common::realpath(substr($arg, 11)); - - // It may not exist and return false instead, so use whatever they gave us. - if ($this->stdinPath === false) { - $this->stdinPath = trim(substr($arg, 11)); - } - - self::$overriddenDefaults['stdinPath'] = true; - } else if (PHP_CODESNIFFER_CBF === false && substr($arg, 0, 12) === 'report-file=') { - if (isset(self::$overriddenDefaults['reportFile']) === true) { - break; - } - - $this->reportFile = Util\Common::realpath(substr($arg, 12)); - - // It may not exist and return false instead. - if ($this->reportFile === false) { - $this->reportFile = substr($arg, 12); - - $dir = Util\Common::realpath(dirname($this->reportFile)); - if (is_dir($dir) === false) { - $error = 'ERROR: The specified report file path "'.$this->reportFile.'" points to a non-existent directory'.PHP_EOL.PHP_EOL; - $error .= $this->printShortUsage(true); - throw new DeepExitException($error, 3); - } - - $this->reportFile = $dir.'/'.basename($this->reportFile); - }//end if - - self::$overriddenDefaults['reportFile'] = true; - - if (is_dir($this->reportFile) === true) { - $error = 'ERROR: The specified report file path "'.$this->reportFile.'" is a directory'.PHP_EOL.PHP_EOL; - $error .= $this->printShortUsage(true); - throw new DeepExitException($error, 3); - } - } else if (substr($arg, 0, 13) === 'report-width=') { - if (isset(self::$overriddenDefaults['reportWidth']) === true) { - break; - } - - $this->reportWidth = substr($arg, 13); - self::$overriddenDefaults['reportWidth'] = true; - } else if (substr($arg, 0, 9) === 'basepath=') { - if (isset(self::$overriddenDefaults['basepath']) === true) { - break; - } - - self::$overriddenDefaults['basepath'] = true; - - if (substr($arg, 9) === '') { - $this->basepath = null; - break; - } - - $this->basepath = Util\Common::realpath(substr($arg, 9)); - - // It may not exist and return false instead. - if ($this->basepath === false) { - $this->basepath = substr($arg, 9); - } - - if (is_dir($this->basepath) === false) { - $error = 'ERROR: The specified basepath "'.$this->basepath.'" points to a non-existent directory'.PHP_EOL.PHP_EOL; - $error .= $this->printShortUsage(true); - throw new DeepExitException($error, 3); - } - } else if ((substr($arg, 0, 7) === 'report=' || substr($arg, 0, 7) === 'report-')) { - $reports = []; - - if ($arg[6] === '-') { - // This is a report with file output. - $split = strpos($arg, '='); - if ($split === false) { - $report = substr($arg, 7); - $output = null; - } else { - $report = substr($arg, 7, ($split - 7)); - $output = substr($arg, ($split + 1)); - if ($output === false) { - $output = null; - } else { - $dir = Util\Common::realpath(dirname($output)); - if (is_dir($dir) === false) { - $error = 'ERROR: The specified '.$report.' report file path "'.$output.'" points to a non-existent directory'.PHP_EOL.PHP_EOL; - $error .= $this->printShortUsage(true); - throw new DeepExitException($error, 3); - } - - $output = $dir.'/'.basename($output); - - if (is_dir($output) === true) { - $error = 'ERROR: The specified '.$report.' report file path "'.$output.'" is a directory'.PHP_EOL.PHP_EOL; - $error .= $this->printShortUsage(true); - throw new DeepExitException($error, 3); - } - }//end if - }//end if - - $reports[$report] = $output; - } else { - // This is a single report. - if (isset(self::$overriddenDefaults['reports']) === true) { - break; - } - - $reportNames = explode(',', substr($arg, 7)); - foreach ($reportNames as $report) { - $reports[$report] = null; - } - }//end if - - // Remove the default value so the CLI value overrides it. - if (isset(self::$overriddenDefaults['reports']) === false) { - $this->reports = $reports; - } else { - $this->reports = array_merge($this->reports, $reports); - } - - self::$overriddenDefaults['reports'] = true; - } else if (substr($arg, 0, 7) === 'filter=') { - if (isset(self::$overriddenDefaults['filter']) === true) { - break; - } - - $this->filter = substr($arg, 7); - self::$overriddenDefaults['filter'] = true; - } else if (substr($arg, 0, 9) === 'standard=') { - $standards = trim(substr($arg, 9)); - if ($standards !== '') { - $this->standards = explode(',', $standards); - } - - self::$overriddenDefaults['standards'] = true; - } else if (substr($arg, 0, 11) === 'extensions=') { - if (isset(self::$overriddenDefaults['extensions']) === true) { - break; - } - - $extensions = explode(',', substr($arg, 11)); - $newExtensions = []; - foreach ($extensions as $ext) { - $slash = strpos($ext, '/'); - if ($slash !== false) { - // They specified the tokenizer too. - list($ext, $tokenizer) = explode('/', $ext); - $newExtensions[$ext] = strtoupper($tokenizer); - continue; - } - - if (isset($this->extensions[$ext]) === true) { - $newExtensions[$ext] = $this->extensions[$ext]; - } else { - $newExtensions[$ext] = 'PHP'; - } - } - - $this->extensions = $newExtensions; - self::$overriddenDefaults['extensions'] = true; - } else if (substr($arg, 0, 7) === 'suffix=') { - if (isset(self::$overriddenDefaults['suffix']) === true) { - break; - } - - $this->suffix = substr($arg, 7); - self::$overriddenDefaults['suffix'] = true; - } else if (substr($arg, 0, 9) === 'parallel=') { - if (isset(self::$overriddenDefaults['parallel']) === true) { - break; - } - - $this->parallel = max((int) substr($arg, 9), 1); - self::$overriddenDefaults['parallel'] = true; - } else if (substr($arg, 0, 9) === 'severity=') { - $this->errorSeverity = (int) substr($arg, 9); - $this->warningSeverity = $this->errorSeverity; - if (isset(self::$overriddenDefaults['errorSeverity']) === false) { - self::$overriddenDefaults['errorSeverity'] = true; - } - - if (isset(self::$overriddenDefaults['warningSeverity']) === false) { - self::$overriddenDefaults['warningSeverity'] = true; - } - } else if (substr($arg, 0, 15) === 'error-severity=') { - if (isset(self::$overriddenDefaults['errorSeverity']) === true) { - break; - } - - $this->errorSeverity = (int) substr($arg, 15); - self::$overriddenDefaults['errorSeverity'] = true; - } else if (substr($arg, 0, 17) === 'warning-severity=') { - if (isset(self::$overriddenDefaults['warningSeverity']) === true) { - break; - } - - $this->warningSeverity = (int) substr($arg, 17); - self::$overriddenDefaults['warningSeverity'] = true; - } else if (substr($arg, 0, 7) === 'ignore=') { - if (isset(self::$overriddenDefaults['ignored']) === true) { - break; - } - - // Split the ignore string on commas, unless the comma is escaped - // using 1 or 3 slashes (\, or \\\,). - $patterns = preg_split( - '/(?<=(?ignored = $ignored; - self::$overriddenDefaults['ignored'] = true; - } else if (substr($arg, 0, 10) === 'generator=' - && PHP_CODESNIFFER_CBF === false - ) { - if (isset(self::$overriddenDefaults['generator']) === true) { - break; - } - - $this->generator = substr($arg, 10); - self::$overriddenDefaults['generator'] = true; - } else if (substr($arg, 0, 9) === 'encoding=') { - if (isset(self::$overriddenDefaults['encoding']) === true) { - break; - } - - $this->encoding = strtolower(substr($arg, 9)); - self::$overriddenDefaults['encoding'] = true; - } else if (substr($arg, 0, 10) === 'tab-width=') { - if (isset(self::$overriddenDefaults['tabWidth']) === true) { - break; - } - - $this->tabWidth = (int) substr($arg, 10); - self::$overriddenDefaults['tabWidth'] = true; - } else { - if ($this->dieOnUnknownArg === false) { - $eqPos = strpos($arg, '='); - try { - if ($eqPos === false) { - $this->values[$arg] = $arg; - } else { - $value = substr($arg, ($eqPos + 1)); - $arg = substr($arg, 0, $eqPos); - $this->values[$arg] = $value; - } - } catch (RuntimeException $e) { - // Value is not valid, so just ignore it. - } - } else { - $this->processUnknownArgument('--'.$arg, $pos); - } - }//end if - break; - }//end switch - - }//end processLongArgument() - - - /** - * Processes an unknown command line argument. - * - * Assumes all unknown arguments are files and folders to check. - * - * @param string $arg The command line argument. - * @param int $pos The position of the argument on the command line. - * - * @return void - * @throws \PHP_CodeSniffer\Exceptions\DeepExitException - */ - public function processUnknownArgument($arg, $pos) - { - // We don't know about any additional switches; just files. - if ($arg[0] === '-') { - if ($this->dieOnUnknownArg === false) { - return; - } - - $error = "ERROR: option \"$arg\" not known".PHP_EOL.PHP_EOL; - $error .= $this->printShortUsage(true); - throw new DeepExitException($error, 3); - } - - $this->processFilePath($arg); - - }//end processUnknownArgument() - - - /** - * Processes a file path and add it to the file list. - * - * @param string $path The path to the file to add. - * - * @return void - * @throws \PHP_CodeSniffer\Exceptions\DeepExitException - */ - public function processFilePath($path) - { - // If we are processing STDIN, don't record any files to check. - if ($this->stdin === true) { - return; - } - - $file = Util\Common::realpath($path); - if (file_exists($file) === false) { - if ($this->dieOnUnknownArg === false) { - return; - } - - $error = 'ERROR: The file "'.$path.'" does not exist.'.PHP_EOL.PHP_EOL; - $error .= $this->printShortUsage(true); - throw new DeepExitException($error, 3); - } else { - // Can't modify the files array directly because it's not a real - // class member, so need to use this little get/modify/set trick. - $files = $this->files; - $files[] = $file; - $this->files = $files; - self::$overriddenDefaults['files'] = true; - } - - }//end processFilePath() - - - /** - * Prints out the usage information for this script. - * - * @return void - */ - public function printUsage() - { - echo PHP_EOL; - - if (PHP_CODESNIFFER_CBF === true) { - $this->printPHPCBFUsage(); - } else { - $this->printPHPCSUsage(); - } - - echo PHP_EOL; - - }//end printUsage() - - - /** - * Prints out the short usage information for this script. - * - * @param bool $return If TRUE, the usage string is returned - * instead of output to screen. - * - * @return string|void - */ - public function printShortUsage($return=false) - { - if (PHP_CODESNIFFER_CBF === true) { - $usage = 'Run "phpcbf --help" for usage information'; - } else { - $usage = 'Run "phpcs --help" for usage information'; - } - - $usage .= PHP_EOL.PHP_EOL; - - if ($return === true) { - return $usage; - } - - echo $usage; - - }//end printShortUsage() - - - /** - * Prints out the usage information for PHPCS. - * - * @return void - */ - public function printPHPCSUsage() - { - echo 'Usage: phpcs [-nwlsaepqvi] [-d key[=value]] [--colors] [--no-colors]'.PHP_EOL; - echo ' [--cache[=]] [--no-cache] [--tab-width=]'.PHP_EOL; - echo ' [--report=] [--report-file=] [--report-=]'.PHP_EOL; - echo ' [--report-width=] [--basepath=] [--bootstrap=]'.PHP_EOL; - echo ' [--severity=] [--error-severity=] [--warning-severity=]'.PHP_EOL; - echo ' [--runtime-set key value] [--config-set key value] [--config-delete key] [--config-show]'.PHP_EOL; - echo ' [--standard=] [--sniffs=] [--exclude=]'.PHP_EOL; - echo ' [--encoding=] [--parallel=] [--generator=]'.PHP_EOL; - echo ' [--extensions=] [--ignore=] [--ignore-annotations]'.PHP_EOL; - echo ' [--stdin-path=] [--file-list=] [--filter=] - ...'.PHP_EOL; - echo PHP_EOL; - echo ' - Check STDIN instead of local files and directories'.PHP_EOL; - echo ' -n Do not print warnings (shortcut for --warning-severity=0)'.PHP_EOL; - echo ' -w Print both warnings and errors (this is the default)'.PHP_EOL; - echo ' -l Local directory only, no recursion'.PHP_EOL; - echo ' -s Show sniff codes in all reports'.PHP_EOL; - echo ' -a Run interactively'.PHP_EOL; - echo ' -e Explain a standard by showing the sniffs it includes'.PHP_EOL; - echo ' -p Show progress of the run'.PHP_EOL; - echo ' -q Quiet mode; disables progress and verbose output'.PHP_EOL; - echo ' -m Stop error messages from being recorded'.PHP_EOL; - echo ' (saves a lot of memory, but stops many reports from being used)'.PHP_EOL; - echo ' -v Print processed files'.PHP_EOL; - echo ' -vv Print ruleset and token output'.PHP_EOL; - echo ' -vvv Print sniff processing information'.PHP_EOL; - echo ' -i Show a list of installed coding standards'.PHP_EOL; - echo ' -d Set the [key] php.ini value to [value] or [true] if value is omitted'.PHP_EOL; - echo PHP_EOL; - echo ' --help Print this help message'.PHP_EOL; - echo ' --version Print version information'.PHP_EOL; - echo ' --colors Use colors in output'.PHP_EOL; - echo ' --no-colors Do not use colors in output (this is the default)'.PHP_EOL; - echo ' --cache Cache results between runs'.PHP_EOL; - echo ' --no-cache Do not cache results between runs (this is the default)'.PHP_EOL; - echo ' --ignore-annotations Ignore all phpcs: annotations in code comments'.PHP_EOL; - echo PHP_EOL; - echo ' Use a specific file for caching (uses a temporary file by default)'.PHP_EOL; - echo ' A path to strip from the front of file paths inside reports'.PHP_EOL; - echo ' A comma separated list of files to run before processing begins'.PHP_EOL; - echo ' The encoding of the files being checked (default is utf-8)'.PHP_EOL; - echo ' A comma separated list of file extensions to check'.PHP_EOL; - echo ' The type of the file can be specified using: ext/type'.PHP_EOL; - echo ' e.g., module/php,es/js'.PHP_EOL; - echo ' One or more files and/or directories to check'.PHP_EOL; - echo ' A file containing a list of files and/or directories to check (one per line)'.PHP_EOL; - echo ' Use either the "gitmodified" or "gitstaged" filter,'.PHP_EOL; - echo ' or specify the path to a custom filter class'.PHP_EOL; - echo ' Use either the "HTML", "Markdown" or "Text" generator'.PHP_EOL; - echo ' (forces documentation generation instead of checking)'.PHP_EOL; - echo ' A comma separated list of patterns to ignore files and directories'.PHP_EOL; - echo ' How many files should be checked simultaneously (default is 1)'.PHP_EOL; - echo ' Print either the "full", "xml", "checkstyle", "csv"'.PHP_EOL; - echo ' "json", "junit", "emacs", "source", "summary", "diff"'.PHP_EOL; - echo ' "svnblame", "gitblame", "hgblame" or "notifysend" report,'.PHP_EOL; - echo ' or specify the path to a custom report class'.PHP_EOL; - echo ' (the "full" report is printed by default)'.PHP_EOL; - echo ' Write the report to the specified file path'.PHP_EOL; - echo ' How many columns wide screen reports should be printed'.PHP_EOL; - echo ' or set to "auto" to use current screen width, where supported'.PHP_EOL; - echo ' The minimum severity required to display an error or warning'.PHP_EOL; - echo ' A comma separated list of sniff codes to include or exclude from checking'.PHP_EOL; - echo ' (all sniffs must be part of the specified standard)'.PHP_EOL; - echo ' The name or path of the coding standard to use'.PHP_EOL; - echo ' If processing STDIN, the file path that STDIN will be processed as'.PHP_EOL; - echo ' The number of spaces each tab represents'.PHP_EOL; - - }//end printPHPCSUsage() - - - /** - * Prints out the usage information for PHPCBF. - * - * @return void - */ - public function printPHPCBFUsage() - { - echo 'Usage: phpcbf [-nwli] [-d key[=value]] [--ignore-annotations] [--bootstrap=]'.PHP_EOL; - echo ' [--standard=] [--sniffs=] [--exclude=] [--suffix=]'.PHP_EOL; - echo ' [--severity=] [--error-severity=] [--warning-severity=]'.PHP_EOL; - echo ' [--tab-width=] [--encoding=] [--parallel=]'.PHP_EOL; - echo ' [--basepath=] [--extensions=] [--ignore=]'.PHP_EOL; - echo ' [--stdin-path=] [--file-list=] [--filter=] - ...'.PHP_EOL; - echo PHP_EOL; - echo ' - Fix STDIN instead of local files and directories'.PHP_EOL; - echo ' -n Do not fix warnings (shortcut for --warning-severity=0)'.PHP_EOL; - echo ' -w Fix both warnings and errors (on by default)'.PHP_EOL; - echo ' -l Local directory only, no recursion'.PHP_EOL; - echo ' -p Show progress of the run'.PHP_EOL; - echo ' -q Quiet mode; disables progress and verbose output'.PHP_EOL; - echo ' -v Print processed files'.PHP_EOL; - echo ' -vv Print ruleset and token output'.PHP_EOL; - echo ' -vvv Print sniff processing information'.PHP_EOL; - echo ' -i Show a list of installed coding standards'.PHP_EOL; - echo ' -d Set the [key] php.ini value to [value] or [true] if value is omitted'.PHP_EOL; - echo PHP_EOL; - echo ' --help Print this help message'.PHP_EOL; - echo ' --version Print version information'.PHP_EOL; - echo ' --ignore-annotations Ignore all phpcs: annotations in code comments'.PHP_EOL; - echo PHP_EOL; - echo ' A path to strip from the front of file paths inside reports'.PHP_EOL; - echo ' A comma separated list of files to run before processing begins'.PHP_EOL; - echo ' The encoding of the files being fixed (default is utf-8)'.PHP_EOL; - echo ' A comma separated list of file extensions to fix'.PHP_EOL; - echo ' The type of the file can be specified using: ext/type'.PHP_EOL; - echo ' e.g., module/php,es/js'.PHP_EOL; - echo ' One or more files and/or directories to fix'.PHP_EOL; - echo ' A file containing a list of files and/or directories to fix (one per line)'.PHP_EOL; - echo ' Use either the "gitmodified" or "gitstaged" filter,'.PHP_EOL; - echo ' or specify the path to a custom filter class'.PHP_EOL; - echo ' A comma separated list of patterns to ignore files and directories'.PHP_EOL; - echo ' How many files should be fixed simultaneously (default is 1)'.PHP_EOL; - echo ' The minimum severity required to fix an error or warning'.PHP_EOL; - echo ' A comma separated list of sniff codes to include or exclude from fixing'.PHP_EOL; - echo ' (all sniffs must be part of the specified standard)'.PHP_EOL; - echo ' The name or path of the coding standard to use'.PHP_EOL; - echo ' If processing STDIN, the file path that STDIN will be processed as'.PHP_EOL; - echo ' Write modified files to a filename using this suffix'.PHP_EOL; - echo ' ("diff" and "patch" are not used in this mode)'.PHP_EOL; - echo ' The number of spaces each tab represents'.PHP_EOL; - - }//end printPHPCBFUsage() - - - /** - * Get a single config value. - * - * @param string $key The name of the config value. - * - * @return string|null - * @see setConfigData() - * @see getAllConfigData() - */ - public static function getConfigData($key) - { - $phpCodeSnifferConfig = self::getAllConfigData(); - - if ($phpCodeSnifferConfig === null) { - return null; - } - - if (isset($phpCodeSnifferConfig[$key]) === false) { - return null; - } - - return $phpCodeSnifferConfig[$key]; - - }//end getConfigData() - - - /** - * Get the path to an executable utility. - * - * @param string $name The name of the executable utility. - * - * @return string|null - * @see getConfigData() - */ - public static function getExecutablePath($name) - { - $data = self::getConfigData($name.'_path'); - if ($data !== null) { - return $data; - } - - if ($name === "php") { - // For php, we know the executable path. There's no need to look it up. - return PHP_BINARY; - } - - if (array_key_exists($name, self::$executablePaths) === true) { - return self::$executablePaths[$name]; - } - - if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { - $cmd = 'where '.escapeshellarg($name).' 2> nul'; - } else { - $cmd = 'which '.escapeshellarg($name).' 2> /dev/null'; - } - - $result = exec($cmd, $output, $retVal); - if ($retVal !== 0) { - $result = null; - } - - self::$executablePaths[$name] = $result; - return $result; - - }//end getExecutablePath() - - - /** - * Set a single config value. - * - * @param string $key The name of the config value. - * @param string|null $value The value to set. If null, the config - * entry is deleted, reverting it to the - * default value. - * @param boolean $temp Set this config data temporarily for this - * script run. This will not write the config - * data to the config file. - * - * @return bool - * @see getConfigData() - * @throws \PHP_CodeSniffer\Exceptions\DeepExitException If the config file can not be written. - */ - public static function setConfigData($key, $value, $temp=false) - { - if (isset(self::$overriddenDefaults['runtime-set']) === true - && isset(self::$overriddenDefaults['runtime-set'][$key]) === true - ) { - return false; - } - - if ($temp === false) { - $path = ''; - if (is_callable('\Phar::running') === true) { - $path = \Phar::running(false); - } - - if ($path !== '') { - $configFile = dirname($path).DIRECTORY_SEPARATOR.'CodeSniffer.conf'; - } else { - $configFile = dirname(__DIR__).DIRECTORY_SEPARATOR.'CodeSniffer.conf'; - if (is_file($configFile) === false - && strpos('@data_dir@', '@data_dir') === false - ) { - // If data_dir was replaced, this is a PEAR install and we can - // use the PEAR data dir to store the conf file. - $configFile = '@data_dir@/PHP_CodeSniffer/CodeSniffer.conf'; - } - } - - if (is_file($configFile) === true - && is_writable($configFile) === false - ) { - $error = 'ERROR: Config file '.$configFile.' is not writable'.PHP_EOL.PHP_EOL; - throw new DeepExitException($error, 3); - } - }//end if - - $phpCodeSnifferConfig = self::getAllConfigData(); - - if ($value === null) { - if (isset($phpCodeSnifferConfig[$key]) === true) { - unset($phpCodeSnifferConfig[$key]); - } - } else { - $phpCodeSnifferConfig[$key] = $value; - } - - if ($temp === false) { - $output = '<'.'?php'."\n".' $phpCodeSnifferConfig = '; - $output .= var_export($phpCodeSnifferConfig, true); - $output .= "\n?".'>'; - - if (file_put_contents($configFile, $output) === false) { - $error = 'ERROR: Config file '.$configFile.' could not be written'.PHP_EOL.PHP_EOL; - throw new DeepExitException($error, 3); - } - - self::$configDataFile = $configFile; - } - - self::$configData = $phpCodeSnifferConfig; - - // If the installed paths are being set, make sure all known - // standards paths are added to the autoloader. - if ($key === 'installed_paths') { - $installedStandards = Util\Standards::getInstalledStandardDetails(); - foreach ($installedStandards as $name => $details) { - Autoload::addSearchPath($details['path'], $details['namespace']); - } - } - - return true; - - }//end setConfigData() - - - /** - * Get all config data. - * - * @return array - * @see getConfigData() - * @throws \PHP_CodeSniffer\Exceptions\DeepExitException If the config file could not be read. - */ - public static function getAllConfigData() - { - if (self::$configData !== null) { - return self::$configData; - } - - $path = ''; - if (is_callable('\Phar::running') === true) { - $path = \Phar::running(false); - } - - if ($path !== '') { - $configFile = dirname($path).DIRECTORY_SEPARATOR.'CodeSniffer.conf'; - } else { - $configFile = dirname(__DIR__).DIRECTORY_SEPARATOR.'CodeSniffer.conf'; - if (is_file($configFile) === false - && strpos('@data_dir@', '@data_dir') === false - ) { - $configFile = '@data_dir@/PHP_CodeSniffer/CodeSniffer.conf'; - } - } - - if (is_file($configFile) === false) { - self::$configData = []; - return []; - } - - if (Common::isReadable($configFile) === false) { - $error = 'ERROR: Config file '.$configFile.' is not readable'.PHP_EOL.PHP_EOL; - throw new DeepExitException($error, 3); - } - - include $configFile; - self::$configDataFile = $configFile; - self::$configData = $phpCodeSnifferConfig; - return self::$configData; - - }//end getAllConfigData() - - - /** - * Prints out the gathered config data. - * - * @param array $data The config data to print. - * - * @return void - */ - public function printConfigData($data) - { - $max = 0; - $keys = array_keys($data); - foreach ($keys as $key) { - $len = strlen($key); - if (strlen($key) > $max) { - $max = $len; - } - } - - if ($max === 0) { - return; - } - - $max += 2; - ksort($data); - foreach ($data as $name => $value) { - echo str_pad($name.': ', $max).$value.PHP_EOL; - } - - }//end printConfigData() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Exceptions/DeepExitException.php b/vendor/squizlabs/php_codesniffer/src/Exceptions/DeepExitException.php deleted file mode 100644 index b144094..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Exceptions/DeepExitException.php +++ /dev/null @@ -1,18 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Exceptions; - -class DeepExitException extends \Exception -{ - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Exceptions/RuntimeException.php b/vendor/squizlabs/php_codesniffer/src/Exceptions/RuntimeException.php deleted file mode 100644 index 093bf13..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Exceptions/RuntimeException.php +++ /dev/null @@ -1,15 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Exceptions; - -class RuntimeException extends \RuntimeException -{ - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Exceptions/TokenizerException.php b/vendor/squizlabs/php_codesniffer/src/Exceptions/TokenizerException.php deleted file mode 100644 index ceba00c..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Exceptions/TokenizerException.php +++ /dev/null @@ -1,15 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Exceptions; - -class TokenizerException extends \Exception -{ - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Files/DummyFile.php b/vendor/squizlabs/php_codesniffer/src/Files/DummyFile.php deleted file mode 100644 index 6014303..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Files/DummyFile.php +++ /dev/null @@ -1,82 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Files; - -use PHP_CodeSniffer\Ruleset; -use PHP_CodeSniffer\Config; - -class DummyFile extends File -{ - - - /** - * Creates a DummyFile object and sets the content. - * - * @param string $content The content of the file. - * @param \PHP_CodeSniffer\Ruleset $ruleset The ruleset used for the run. - * @param \PHP_CodeSniffer\Config $config The config data for the run. - * - * @return void - */ - public function __construct($content, Ruleset $ruleset, Config $config) - { - $this->setContent($content); - - // See if a filename was defined in the content. - // This is done by including: phpcs_input_file: [file path] - // as the first line of content. - $path = 'STDIN'; - if ($content !== '') { - if (substr($content, 0, 17) === 'phpcs_input_file:') { - $eolPos = strpos($content, $this->eolChar); - $filename = trim(substr($content, 17, ($eolPos - 17))); - $content = substr($content, ($eolPos + strlen($this->eolChar))); - $path = $filename; - - $this->setContent($content); - } - } - - // The CLI arg overrides anything passed in the content. - if ($config->stdinPath !== null) { - $path = $config->stdinPath; - } - - parent::__construct($path, $ruleset, $config); - - }//end __construct() - - - /** - * Set the error, warning, and fixable counts for the file. - * - * @param int $errorCount The number of errors found. - * @param int $warningCount The number of warnings found. - * @param int $fixableCount The number of fixable errors found. - * @param int $fixedCount The number of errors that were fixed. - * - * @return void - */ - public function setErrorCounts($errorCount, $warningCount, $fixableCount, $fixedCount) - { - $this->errorCount = $errorCount; - $this->warningCount = $warningCount; - $this->fixableCount = $fixableCount; - $this->fixedCount = $fixedCount; - - }//end setErrorCounts() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Files/File.php b/vendor/squizlabs/php_codesniffer/src/Files/File.php deleted file mode 100644 index e551dcb..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Files/File.php +++ /dev/null @@ -1,2799 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Files; - -use PHP_CodeSniffer\Ruleset; -use PHP_CodeSniffer\Config; -use PHP_CodeSniffer\Fixer; -use PHP_CodeSniffer\Util; -use PHP_CodeSniffer\Exceptions\RuntimeException; -use PHP_CodeSniffer\Exceptions\TokenizerException; - -class File -{ - - /** - * The absolute path to the file associated with this object. - * - * @var string - */ - public $path = ''; - - /** - * The content of the file. - * - * @var string - */ - protected $content = ''; - - /** - * The config data for the run. - * - * @var \PHP_CodeSniffer\Config - */ - public $config = null; - - /** - * The ruleset used for the run. - * - * @var \PHP_CodeSniffer\Ruleset - */ - public $ruleset = null; - - /** - * If TRUE, the entire file is being ignored. - * - * @var boolean - */ - public $ignored = false; - - /** - * The EOL character this file uses. - * - * @var string - */ - public $eolChar = ''; - - /** - * The Fixer object to control fixing errors. - * - * @var \PHP_CodeSniffer\Fixer - */ - public $fixer = null; - - /** - * The tokenizer being used for this file. - * - * @var \PHP_CodeSniffer\Tokenizers\Tokenizer - */ - public $tokenizer = null; - - /** - * The name of the tokenizer being used for this file. - * - * @var string - */ - public $tokenizerType = 'PHP'; - - /** - * Was the file loaded from cache? - * - * If TRUE, the file was loaded from a local cache. - * If FALSE, the file was tokenized and processed fully. - * - * @var boolean - */ - public $fromCache = false; - - /** - * The number of tokens in this file. - * - * Stored here to save calling count() everywhere. - * - * @var integer - */ - public $numTokens = 0; - - /** - * The tokens stack map. - * - * @var array - */ - protected $tokens = []; - - /** - * The errors raised from sniffs. - * - * @var array - * @see getErrors() - */ - protected $errors = []; - - /** - * The warnings raised from sniffs. - * - * @var array - * @see getWarnings() - */ - protected $warnings = []; - - /** - * The metrics recorded by sniffs. - * - * @var array - * @see getMetrics() - */ - protected $metrics = []; - - /** - * The metrics recorded for each token. - * - * Stops the same metric being recorded for the same token twice. - * - * @var array - * @see getMetrics() - */ - private $metricTokens = []; - - /** - * The total number of errors raised. - * - * @var integer - */ - protected $errorCount = 0; - - /** - * The total number of warnings raised. - * - * @var integer - */ - protected $warningCount = 0; - - /** - * The total number of errors and warnings that can be fixed. - * - * @var integer - */ - protected $fixableCount = 0; - - /** - * The total number of errors and warnings that were fixed. - * - * @var integer - */ - protected $fixedCount = 0; - - /** - * TRUE if errors are being replayed from the cache. - * - * @var boolean - */ - protected $replayingErrors = false; - - /** - * An array of sniffs that are being ignored. - * - * @var array - */ - protected $ignoredListeners = []; - - /** - * An array of message codes that are being ignored. - * - * @var array - */ - protected $ignoredCodes = []; - - /** - * An array of sniffs listening to this file's processing. - * - * @var \PHP_CodeSniffer\Sniffs\Sniff[] - */ - protected $listeners = []; - - /** - * The class name of the sniff currently processing the file. - * - * @var string - */ - protected $activeListener = ''; - - /** - * An array of sniffs being processed and how long they took. - * - * @var array - */ - protected $listenerTimes = []; - - /** - * A cache of often used config settings to improve performance. - * - * Storing them here saves 10k+ calls to __get() in the Config class. - * - * @var array - */ - protected $configCache = []; - - - /** - * Constructs a file. - * - * @param string $path The absolute path to the file to process. - * @param \PHP_CodeSniffer\Ruleset $ruleset The ruleset used for the run. - * @param \PHP_CodeSniffer\Config $config The config data for the run. - * - * @return void - */ - public function __construct($path, Ruleset $ruleset, Config $config) - { - $this->path = $path; - $this->ruleset = $ruleset; - $this->config = $config; - $this->fixer = new Fixer(); - - $parts = explode('.', $path); - $extension = array_pop($parts); - if (isset($config->extensions[$extension]) === true) { - $this->tokenizerType = $config->extensions[$extension]; - } else { - // Revert to default. - $this->tokenizerType = 'PHP'; - } - - $this->configCache['cache'] = $this->config->cache; - $this->configCache['sniffs'] = array_map('strtolower', $this->config->sniffs); - $this->configCache['exclude'] = array_map('strtolower', $this->config->exclude); - $this->configCache['errorSeverity'] = $this->config->errorSeverity; - $this->configCache['warningSeverity'] = $this->config->warningSeverity; - $this->configCache['recordErrors'] = $this->config->recordErrors; - $this->configCache['ignorePatterns'] = $this->ruleset->ignorePatterns; - $this->configCache['includePatterns'] = $this->ruleset->includePatterns; - - }//end __construct() - - - /** - * Set the content of the file. - * - * Setting the content also calculates the EOL char being used. - * - * @param string $content The file content. - * - * @return void - */ - public function setContent($content) - { - $this->content = $content; - $this->tokens = []; - - try { - $this->eolChar = Util\Common::detectLineEndings($content); - } catch (RuntimeException $e) { - $this->addWarningOnLine($e->getMessage(), 1, 'Internal.DetectLineEndings'); - return; - } - - }//end setContent() - - - /** - * Reloads the content of the file. - * - * By default, we have no idea where our content comes from, - * so we can't do anything. - * - * @return void - */ - public function reloadContent() - { - - }//end reloadContent() - - - /** - * Disables caching of this file. - * - * @return void - */ - public function disableCaching() - { - $this->configCache['cache'] = false; - - }//end disableCaching() - - - /** - * Starts the stack traversal and tells listeners when tokens are found. - * - * @return void - */ - public function process() - { - if ($this->ignored === true) { - return; - } - - $this->errors = []; - $this->warnings = []; - $this->errorCount = 0; - $this->warningCount = 0; - $this->fixableCount = 0; - - $this->parse(); - - // Check if tokenizer errors cause this file to be ignored. - if ($this->ignored === true) { - return; - } - - $this->fixer->startFile($this); - - if (PHP_CODESNIFFER_VERBOSITY > 2) { - echo "\t*** START TOKEN PROCESSING ***".PHP_EOL; - } - - $foundCode = false; - $listenerIgnoreTo = []; - $inTests = defined('PHP_CODESNIFFER_IN_TESTS'); - $checkAnnotations = $this->config->annotations; - - // Foreach of the listeners that have registered to listen for this - // token, get them to process it. - foreach ($this->tokens as $stackPtr => $token) { - // Check for ignored lines. - if ($checkAnnotations === true - && ($token['code'] === T_COMMENT - || $token['code'] === T_PHPCS_IGNORE_FILE - || $token['code'] === T_PHPCS_SET - || $token['code'] === T_DOC_COMMENT_STRING - || $token['code'] === T_DOC_COMMENT_TAG - || ($inTests === true && $token['code'] === T_INLINE_HTML)) - ) { - $commentText = ltrim($this->tokens[$stackPtr]['content'], " \t/*#"); - $commentTextLower = strtolower($commentText); - if (strpos($commentText, '@codingStandards') !== false) { - if (strpos($commentText, '@codingStandardsIgnoreFile') !== false) { - // Ignoring the whole file, just a little late. - $this->errors = []; - $this->warnings = []; - $this->errorCount = 0; - $this->warningCount = 0; - $this->fixableCount = 0; - return; - } else if (strpos($commentText, '@codingStandardsChangeSetting') !== false) { - $start = strpos($commentText, '@codingStandardsChangeSetting'); - $comment = substr($commentText, ($start + 30)); - $parts = explode(' ', $comment); - if (count($parts) >= 2) { - $sniffParts = explode('.', $parts[0]); - if (count($sniffParts) >= 3) { - // If the sniff code is not known to us, it has not been registered in this run. - // But don't throw an error as it could be there for a different standard to use. - if (isset($this->ruleset->sniffCodes[$parts[0]]) === true) { - $listenerCode = array_shift($parts); - $propertyCode = array_shift($parts); - $propertyValue = rtrim(implode(' ', $parts), " */\r\n"); - $listenerClass = $this->ruleset->sniffCodes[$listenerCode]; - $this->ruleset->setSniffProperty($listenerClass, $propertyCode, $propertyValue); - } - } - } - }//end if - } else if (substr($commentTextLower, 0, 16) === 'phpcs:ignorefile' - || substr($commentTextLower, 0, 17) === '@phpcs:ignorefile' - ) { - // Ignoring the whole file, just a little late. - $this->errors = []; - $this->warnings = []; - $this->errorCount = 0; - $this->warningCount = 0; - $this->fixableCount = 0; - return; - } else if (substr($commentTextLower, 0, 9) === 'phpcs:set' - || substr($commentTextLower, 0, 10) === '@phpcs:set' - ) { - if (isset($token['sniffCode']) === true) { - $listenerCode = $token['sniffCode']; - if (isset($this->ruleset->sniffCodes[$listenerCode]) === true) { - $propertyCode = $token['sniffProperty']; - $propertyValue = $token['sniffPropertyValue']; - $listenerClass = $this->ruleset->sniffCodes[$listenerCode]; - $this->ruleset->setSniffProperty($listenerClass, $propertyCode, $propertyValue); - } - } - }//end if - }//end if - - if (PHP_CODESNIFFER_VERBOSITY > 2) { - $type = $token['type']; - $content = Util\Common::prepareForOutput($token['content']); - echo "\t\tProcess token $stackPtr: $type => $content".PHP_EOL; - } - - if ($token['code'] !== T_INLINE_HTML) { - $foundCode = true; - } - - if (isset($this->ruleset->tokenListeners[$token['code']]) === false) { - continue; - } - - foreach ($this->ruleset->tokenListeners[$token['code']] as $listenerData) { - if (isset($this->ignoredListeners[$listenerData['class']]) === true - || (isset($listenerIgnoreTo[$listenerData['class']]) === true - && $listenerIgnoreTo[$listenerData['class']] > $stackPtr) - ) { - // This sniff is ignoring past this token, or the whole file. - continue; - } - - // Make sure this sniff supports the tokenizer - // we are currently using. - $class = $listenerData['class']; - - if (isset($listenerData['tokenizers'][$this->tokenizerType]) === false) { - continue; - } - - if (trim($this->path, '\'"') !== 'STDIN') { - // If the file path matches one of our ignore patterns, skip it. - // While there is support for a type of each pattern - // (absolute or relative) we don't actually support it here. - foreach ($listenerData['ignore'] as $pattern) { - // We assume a / directory separator, as do the exclude rules - // most developers write, so we need a special case for any system - // that is different. - if (DIRECTORY_SEPARATOR === '\\') { - $pattern = str_replace('/', '\\\\', $pattern); - } - - $pattern = '`'.$pattern.'`i'; - if (preg_match($pattern, $this->path) === 1) { - $this->ignoredListeners[$class] = true; - continue(2); - } - } - - // If the file path does not match one of our include patterns, skip it. - // While there is support for a type of each pattern - // (absolute or relative) we don't actually support it here. - if (empty($listenerData['include']) === false) { - $included = false; - foreach ($listenerData['include'] as $pattern) { - // We assume a / directory separator, as do the exclude rules - // most developers write, so we need a special case for any system - // that is different. - if (DIRECTORY_SEPARATOR === '\\') { - $pattern = str_replace('/', '\\\\', $pattern); - } - - $pattern = '`'.$pattern.'`i'; - if (preg_match($pattern, $this->path) === 1) { - $included = true; - break; - } - } - - if ($included === false) { - $this->ignoredListeners[$class] = true; - continue; - } - }//end if - }//end if - - $this->activeListener = $class; - - if (PHP_CODESNIFFER_VERBOSITY > 2) { - $startTime = microtime(true); - echo "\t\t\tProcessing ".$this->activeListener.'... '; - } - - $ignoreTo = $this->ruleset->sniffs[$class]->process($this, $stackPtr); - if ($ignoreTo !== null) { - $listenerIgnoreTo[$this->activeListener] = $ignoreTo; - } - - if (PHP_CODESNIFFER_VERBOSITY > 2) { - $timeTaken = (microtime(true) - $startTime); - if (isset($this->listenerTimes[$this->activeListener]) === false) { - $this->listenerTimes[$this->activeListener] = 0; - } - - $this->listenerTimes[$this->activeListener] += $timeTaken; - - $timeTaken = round(($timeTaken), 4); - echo "DONE in $timeTaken seconds".PHP_EOL; - } - - $this->activeListener = ''; - }//end foreach - }//end foreach - - // If short open tags are off but the file being checked uses - // short open tags, the whole content will be inline HTML - // and nothing will be checked. So try and handle this case. - // We don't show this error for STDIN because we can't be sure the content - // actually came directly from the user. It could be something like - // refs from a Git pre-push hook. - if ($foundCode === false && $this->tokenizerType === 'PHP' && $this->path !== 'STDIN') { - $shortTags = (bool) ini_get('short_open_tag'); - if ($shortTags === false) { - $error = 'No PHP code was found in this file and short open tags are not allowed by this install of PHP. This file may be using short open tags but PHP does not allow them.'; - $this->addWarning($error, null, 'Internal.NoCodeFound'); - } - } - - if (PHP_CODESNIFFER_VERBOSITY > 2) { - echo "\t*** END TOKEN PROCESSING ***".PHP_EOL; - echo "\t*** START SNIFF PROCESSING REPORT ***".PHP_EOL; - - asort($this->listenerTimes, SORT_NUMERIC); - $this->listenerTimes = array_reverse($this->listenerTimes, true); - foreach ($this->listenerTimes as $listener => $timeTaken) { - echo "\t$listener: ".round(($timeTaken), 4).' secs'.PHP_EOL; - } - - echo "\t*** END SNIFF PROCESSING REPORT ***".PHP_EOL; - } - - $this->fixedCount += $this->fixer->getFixCount(); - - }//end process() - - - /** - * Tokenizes the file and prepares it for the test run. - * - * @return void - */ - public function parse() - { - if (empty($this->tokens) === false) { - // File has already been parsed. - return; - } - - try { - $tokenizerClass = 'PHP_CodeSniffer\Tokenizers\\'.$this->tokenizerType; - $this->tokenizer = new $tokenizerClass($this->content, $this->config, $this->eolChar); - $this->tokens = $this->tokenizer->getTokens(); - } catch (TokenizerException $e) { - $this->ignored = true; - $this->addWarning($e->getMessage(), null, 'Internal.Tokenizer.Exception'); - if (PHP_CODESNIFFER_VERBOSITY > 0) { - echo "[$this->tokenizerType => tokenizer error]... "; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo PHP_EOL; - } - } - - return; - } - - $this->numTokens = count($this->tokens); - - // Check for mixed line endings as these can cause tokenizer errors and we - // should let the user know that the results they get may be incorrect. - // This is done by removing all backslashes, removing the newline char we - // detected, then converting newlines chars into text. If any backslashes - // are left at the end, we have additional newline chars in use. - $contents = str_replace('\\', '', $this->content); - $contents = str_replace($this->eolChar, '', $contents); - $contents = str_replace("\n", '\n', $contents); - $contents = str_replace("\r", '\r', $contents); - if (strpos($contents, '\\') !== false) { - $error = 'File has mixed line endings; this may cause incorrect results'; - $this->addWarningOnLine($error, 1, 'Internal.LineEndings.Mixed'); - } - - if (PHP_CODESNIFFER_VERBOSITY > 0) { - if ($this->numTokens === 0) { - $numLines = 0; - } else { - $numLines = $this->tokens[($this->numTokens - 1)]['line']; - } - - echo "[$this->tokenizerType => $this->numTokens tokens in $numLines lines]... "; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo PHP_EOL; - } - } - - }//end parse() - - - /** - * Returns the token stack for this file. - * - * @return array - */ - public function getTokens() - { - return $this->tokens; - - }//end getTokens() - - - /** - * Remove vars stored in this file that are no longer required. - * - * @return void - */ - public function cleanUp() - { - $this->listenerTimes = null; - $this->content = null; - $this->tokens = null; - $this->metricTokens = null; - $this->tokenizer = null; - $this->fixer = null; - $this->config = null; - $this->ruleset = null; - - }//end cleanUp() - - - /** - * Records an error against a specific token in the file. - * - * @param string $error The error message. - * @param int $stackPtr The stack position where the error occurred. - * @param string $code A violation code unique to the sniff message. - * @param array $data Replacements for the error message. - * @param int $severity The severity level for this error. A value of 0 - * will be converted into the default severity level. - * @param boolean $fixable Can the error be fixed by the sniff? - * - * @return boolean - */ - public function addError( - $error, - $stackPtr, - $code, - $data=[], - $severity=0, - $fixable=false - ) { - if ($stackPtr === null) { - $line = 1; - $column = 1; - } else { - $line = $this->tokens[$stackPtr]['line']; - $column = $this->tokens[$stackPtr]['column']; - } - - return $this->addMessage(true, $error, $line, $column, $code, $data, $severity, $fixable); - - }//end addError() - - - /** - * Records a warning against a specific token in the file. - * - * @param string $warning The error message. - * @param int $stackPtr The stack position where the error occurred. - * @param string $code A violation code unique to the sniff message. - * @param array $data Replacements for the warning message. - * @param int $severity The severity level for this warning. A value of 0 - * will be converted into the default severity level. - * @param boolean $fixable Can the warning be fixed by the sniff? - * - * @return boolean - */ - public function addWarning( - $warning, - $stackPtr, - $code, - $data=[], - $severity=0, - $fixable=false - ) { - if ($stackPtr === null) { - $line = 1; - $column = 1; - } else { - $line = $this->tokens[$stackPtr]['line']; - $column = $this->tokens[$stackPtr]['column']; - } - - return $this->addMessage(false, $warning, $line, $column, $code, $data, $severity, $fixable); - - }//end addWarning() - - - /** - * Records an error against a specific line in the file. - * - * @param string $error The error message. - * @param int $line The line on which the error occurred. - * @param string $code A violation code unique to the sniff message. - * @param array $data Replacements for the error message. - * @param int $severity The severity level for this error. A value of 0 - * will be converted into the default severity level. - * - * @return boolean - */ - public function addErrorOnLine( - $error, - $line, - $code, - $data=[], - $severity=0 - ) { - return $this->addMessage(true, $error, $line, 1, $code, $data, $severity, false); - - }//end addErrorOnLine() - - - /** - * Records a warning against a specific token in the file. - * - * @param string $warning The error message. - * @param int $line The line on which the warning occurred. - * @param string $code A violation code unique to the sniff message. - * @param array $data Replacements for the warning message. - * @param int $severity The severity level for this warning. A value of 0 will - * will be converted into the default severity level. - * - * @return boolean - */ - public function addWarningOnLine( - $warning, - $line, - $code, - $data=[], - $severity=0 - ) { - return $this->addMessage(false, $warning, $line, 1, $code, $data, $severity, false); - - }//end addWarningOnLine() - - - /** - * Records a fixable error against a specific token in the file. - * - * Returns true if the error was recorded and should be fixed. - * - * @param string $error The error message. - * @param int $stackPtr The stack position where the error occurred. - * @param string $code A violation code unique to the sniff message. - * @param array $data Replacements for the error message. - * @param int $severity The severity level for this error. A value of 0 - * will be converted into the default severity level. - * - * @return boolean - */ - public function addFixableError( - $error, - $stackPtr, - $code, - $data=[], - $severity=0 - ) { - $recorded = $this->addError($error, $stackPtr, $code, $data, $severity, true); - if ($recorded === true && $this->fixer->enabled === true) { - return true; - } - - return false; - - }//end addFixableError() - - - /** - * Records a fixable warning against a specific token in the file. - * - * Returns true if the warning was recorded and should be fixed. - * - * @param string $warning The error message. - * @param int $stackPtr The stack position where the error occurred. - * @param string $code A violation code unique to the sniff message. - * @param array $data Replacements for the warning message. - * @param int $severity The severity level for this warning. A value of 0 - * will be converted into the default severity level. - * - * @return boolean - */ - public function addFixableWarning( - $warning, - $stackPtr, - $code, - $data=[], - $severity=0 - ) { - $recorded = $this->addWarning($warning, $stackPtr, $code, $data, $severity, true); - if ($recorded === true && $this->fixer->enabled === true) { - return true; - } - - return false; - - }//end addFixableWarning() - - - /** - * Adds an error to the error stack. - * - * @param boolean $error Is this an error message? - * @param string $message The text of the message. - * @param int $line The line on which the message occurred. - * @param int $column The column at which the message occurred. - * @param string $code A violation code unique to the sniff message. - * @param array $data Replacements for the message. - * @param int $severity The severity level for this message. A value of 0 - * will be converted into the default severity level. - * @param boolean $fixable Can the problem be fixed by the sniff? - * - * @return boolean - */ - protected function addMessage($error, $message, $line, $column, $code, $data, $severity, $fixable) - { - // Check if this line is ignoring all message codes. - if (isset($this->tokenizer->ignoredLines[$line]['.all']) === true) { - return false; - } - - // Work out which sniff generated the message. - $parts = explode('.', $code); - if ($parts[0] === 'Internal') { - // An internal message. - $listenerCode = Util\Common::getSniffCode($this->activeListener); - $sniffCode = $code; - $checkCodes = [$sniffCode]; - } else { - if ($parts[0] !== $code) { - // The full message code has been passed in. - $sniffCode = $code; - $listenerCode = substr($sniffCode, 0, strrpos($sniffCode, '.')); - } else { - $listenerCode = Util\Common::getSniffCode($this->activeListener); - $sniffCode = $listenerCode.'.'.$code; - $parts = explode('.', $sniffCode); - } - - $checkCodes = [ - $sniffCode, - $parts[0].'.'.$parts[1].'.'.$parts[2], - $parts[0].'.'.$parts[1], - $parts[0], - ]; - }//end if - - if (isset($this->tokenizer->ignoredLines[$line]) === true) { - // Check if this line is ignoring this specific message. - $ignored = false; - foreach ($checkCodes as $checkCode) { - if (isset($this->tokenizer->ignoredLines[$line][$checkCode]) === true) { - $ignored = true; - break; - } - } - - // If it is ignored, make sure it's not whitelisted. - if ($ignored === true - && isset($this->tokenizer->ignoredLines[$line]['.except']) === true - ) { - foreach ($checkCodes as $checkCode) { - if (isset($this->tokenizer->ignoredLines[$line]['.except'][$checkCode]) === true) { - $ignored = false; - break; - } - } - } - - if ($ignored === true) { - return false; - } - }//end if - - $includeAll = true; - if ($this->configCache['cache'] === false - || $this->configCache['recordErrors'] === false - ) { - $includeAll = false; - } - - // Filter out any messages for sniffs that shouldn't have run - // due to the use of the --sniffs command line argument. - if ($includeAll === false - && ((empty($this->configCache['sniffs']) === false - && in_array(strtolower($listenerCode), $this->configCache['sniffs'], true) === false) - || (empty($this->configCache['exclude']) === false - && in_array(strtolower($listenerCode), $this->configCache['exclude'], true) === true)) - ) { - return false; - } - - // If we know this sniff code is being ignored for this file, return early. - foreach ($checkCodes as $checkCode) { - if (isset($this->ignoredCodes[$checkCode]) === true) { - return false; - } - } - - $oppositeType = 'warning'; - if ($error === false) { - $oppositeType = 'error'; - } - - foreach ($checkCodes as $checkCode) { - // Make sure this message type has not been set to the opposite message type. - if (isset($this->ruleset->ruleset[$checkCode]['type']) === true - && $this->ruleset->ruleset[$checkCode]['type'] === $oppositeType - ) { - $error = !$error; - break; - } - } - - if ($error === true) { - $configSeverity = $this->configCache['errorSeverity']; - $messageCount = &$this->errorCount; - $messages = &$this->errors; - } else { - $configSeverity = $this->configCache['warningSeverity']; - $messageCount = &$this->warningCount; - $messages = &$this->warnings; - } - - if ($includeAll === false && $configSeverity === 0) { - // Don't bother doing any processing as these messages are just going to - // be hidden in the reports anyway. - return false; - } - - if ($severity === 0) { - $severity = 5; - } - - foreach ($checkCodes as $checkCode) { - // Make sure we are interested in this severity level. - if (isset($this->ruleset->ruleset[$checkCode]['severity']) === true) { - $severity = $this->ruleset->ruleset[$checkCode]['severity']; - break; - } - } - - if ($includeAll === false && $configSeverity > $severity) { - return false; - } - - // Make sure we are not ignoring this file. - $included = null; - if (trim($this->path, '\'"') === 'STDIN') { - $included = true; - } else { - foreach ($checkCodes as $checkCode) { - $patterns = null; - - if (isset($this->configCache['includePatterns'][$checkCode]) === true) { - $patterns = $this->configCache['includePatterns'][$checkCode]; - $excluding = false; - } else if (isset($this->configCache['ignorePatterns'][$checkCode]) === true) { - $patterns = $this->configCache['ignorePatterns'][$checkCode]; - $excluding = true; - } - - if ($patterns === null) { - continue; - } - - foreach ($patterns as $pattern => $type) { - // While there is support for a type of each pattern - // (absolute or relative) we don't actually support it here. - $replacements = [ - '\\,' => ',', - '*' => '.*', - ]; - - // We assume a / directory separator, as do the exclude rules - // most developers write, so we need a special case for any system - // that is different. - if (DIRECTORY_SEPARATOR === '\\') { - $replacements['/'] = '\\\\'; - } - - $pattern = '`'.strtr($pattern, $replacements).'`i'; - $matched = preg_match($pattern, $this->path); - - if ($matched === 0) { - if ($excluding === false && $included === null) { - // This file path is not being included. - $included = false; - } - - continue; - } - - if ($excluding === true) { - // This file path is being excluded. - $this->ignoredCodes[$checkCode] = true; - return false; - } - - // This file path is being included. - $included = true; - break; - }//end foreach - }//end foreach - }//end if - - if ($included === false) { - // There were include rules set, but this file - // path didn't match any of them. - return false; - } - - $messageCount++; - if ($fixable === true) { - $this->fixableCount++; - } - - if ($this->configCache['recordErrors'] === false - && $includeAll === false - ) { - return true; - } - - // See if there is a custom error message format to use. - // But don't do this if we are replaying errors because replayed - // errors have already used the custom format and have had their - // data replaced. - if ($this->replayingErrors === false - && isset($this->ruleset->ruleset[$sniffCode]['message']) === true - ) { - $message = $this->ruleset->ruleset[$sniffCode]['message']; - } - - if (empty($data) === false) { - $message = vsprintf($message, $data); - } - - if (isset($messages[$line]) === false) { - $messages[$line] = []; - } - - if (isset($messages[$line][$column]) === false) { - $messages[$line][$column] = []; - } - - $messages[$line][$column][] = [ - 'message' => $message, - 'source' => $sniffCode, - 'listener' => $this->activeListener, - 'severity' => $severity, - 'fixable' => $fixable, - ]; - - if (PHP_CODESNIFFER_VERBOSITY > 1 - && $this->fixer->enabled === true - && $fixable === true - ) { - @ob_end_clean(); - echo "\tE: [Line $line] $message ($sniffCode)".PHP_EOL; - ob_start(); - } - - return true; - - }//end addMessage() - - - /** - * Record a metric about the file being examined. - * - * @param int $stackPtr The stack position where the metric was recorded. - * @param string $metric The name of the metric being recorded. - * @param string $value The value of the metric being recorded. - * - * @return boolean - */ - public function recordMetric($stackPtr, $metric, $value) - { - if (isset($this->metrics[$metric]) === false) { - $this->metrics[$metric] = ['values' => [$value => 1]]; - $this->metricTokens[$metric][$stackPtr] = true; - } else if (isset($this->metricTokens[$metric][$stackPtr]) === false) { - $this->metricTokens[$metric][$stackPtr] = true; - if (isset($this->metrics[$metric]['values'][$value]) === false) { - $this->metrics[$metric]['values'][$value] = 1; - } else { - $this->metrics[$metric]['values'][$value]++; - } - } - - return true; - - }//end recordMetric() - - - /** - * Returns the number of errors raised. - * - * @return int - */ - public function getErrorCount() - { - return $this->errorCount; - - }//end getErrorCount() - - - /** - * Returns the number of warnings raised. - * - * @return int - */ - public function getWarningCount() - { - return $this->warningCount; - - }//end getWarningCount() - - - /** - * Returns the number of fixable errors/warnings raised. - * - * @return int - */ - public function getFixableCount() - { - return $this->fixableCount; - - }//end getFixableCount() - - - /** - * Returns the number of fixed errors/warnings. - * - * @return int - */ - public function getFixedCount() - { - return $this->fixedCount; - - }//end getFixedCount() - - - /** - * Returns the list of ignored lines. - * - * @return array - */ - public function getIgnoredLines() - { - return $this->tokenizer->ignoredLines; - - }//end getIgnoredLines() - - - /** - * Returns the errors raised from processing this file. - * - * @return array - */ - public function getErrors() - { - return $this->errors; - - }//end getErrors() - - - /** - * Returns the warnings raised from processing this file. - * - * @return array - */ - public function getWarnings() - { - return $this->warnings; - - }//end getWarnings() - - - /** - * Returns the metrics found while processing this file. - * - * @return array - */ - public function getMetrics() - { - return $this->metrics; - - }//end getMetrics() - - - /** - * Returns the absolute filename of this file. - * - * @return string - */ - public function getFilename() - { - return $this->path; - - }//end getFilename() - - - /** - * Returns the declaration names for classes, interfaces, traits, and functions. - * - * @param int $stackPtr The position of the declaration token which - * declared the class, interface, trait, or function. - * - * @return string|null The name of the class, interface, trait, or function; - * or NULL if the function or class is anonymous. - * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified token is not of type - * T_FUNCTION, T_CLASS, T_ANON_CLASS, - * T_CLOSURE, T_TRAIT, or T_INTERFACE. - */ - public function getDeclarationName($stackPtr) - { - $tokenCode = $this->tokens[$stackPtr]['code']; - - if ($tokenCode === T_ANON_CLASS || $tokenCode === T_CLOSURE) { - return null; - } - - if ($tokenCode !== T_FUNCTION - && $tokenCode !== T_CLASS - && $tokenCode !== T_INTERFACE - && $tokenCode !== T_TRAIT - ) { - throw new RuntimeException('Token type "'.$this->tokens[$stackPtr]['type'].'" is not T_FUNCTION, T_CLASS, T_INTERFACE or T_TRAIT'); - } - - if ($tokenCode === T_FUNCTION - && strtolower($this->tokens[$stackPtr]['content']) !== 'function' - ) { - // This is a function declared without the "function" keyword. - // So this token is the function name. - return $this->tokens[$stackPtr]['content']; - } - - $content = null; - for ($i = $stackPtr; $i < $this->numTokens; $i++) { - if ($this->tokens[$i]['code'] === T_STRING) { - $content = $this->tokens[$i]['content']; - break; - } - } - - return $content; - - }//end getDeclarationName() - - - /** - * Returns the method parameters for the specified function token. - * - * Also supports passing in a USE token for a closure use group. - * - * Each parameter is in the following format: - * - * - * 0 => array( - * 'name' => '$var', // The variable name. - * 'token' => integer, // The stack pointer to the variable name. - * 'content' => string, // The full content of the variable definition. - * 'has_attributes' => boolean, // Does the parameter have one or more attributes attached ? - * 'pass_by_reference' => boolean, // Is the variable passed by reference? - * 'reference_token' => integer, // The stack pointer to the reference operator - * // or FALSE if the param is not passed by reference. - * 'variable_length' => boolean, // Is the param of variable length through use of `...` ? - * 'variadic_token' => integer, // The stack pointer to the ... operator - * // or FALSE if the param is not variable length. - * 'type_hint' => string, // The type hint for the variable. - * 'type_hint_token' => integer, // The stack pointer to the start of the type hint - * // or FALSE if there is no type hint. - * 'type_hint_end_token' => integer, // The stack pointer to the end of the type hint - * // or FALSE if there is no type hint. - * 'nullable_type' => boolean, // TRUE if the type is preceded by the nullability - * // operator. - * 'comma_token' => integer, // The stack pointer to the comma after the param - * // or FALSE if this is the last param. - * ) - * - * - * Parameters with default values have additional array indexes of: - * 'default' => string, // The full content of the default value. - * 'default_token' => integer, // The stack pointer to the start of the default value. - * 'default_equal_token' => integer, // The stack pointer to the equals sign. - * - * Parameters declared using PHP 8 constructor property promotion, have these additional array indexes: - * 'property_visibility' => string, // The property visibility as declared. - * 'visibility_token' => integer, // The stack pointer to the visibility modifier token. - * - * @param int $stackPtr The position in the stack of the function token - * to acquire the parameters for. - * - * @return array - * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified $stackPtr is not of - * type T_FUNCTION, T_CLOSURE, T_USE, - * or T_FN. - */ - public function getMethodParameters($stackPtr) - { - if ($this->tokens[$stackPtr]['code'] !== T_FUNCTION - && $this->tokens[$stackPtr]['code'] !== T_CLOSURE - && $this->tokens[$stackPtr]['code'] !== T_USE - && $this->tokens[$stackPtr]['code'] !== T_FN - ) { - throw new RuntimeException('$stackPtr must be of type T_FUNCTION or T_CLOSURE or T_USE or T_FN'); - } - - if ($this->tokens[$stackPtr]['code'] === T_USE) { - $opener = $this->findNext(T_OPEN_PARENTHESIS, ($stackPtr + 1)); - if ($opener === false || isset($this->tokens[$opener]['parenthesis_owner']) === true) { - throw new RuntimeException('$stackPtr was not a valid T_USE'); - } - } else { - if (isset($this->tokens[$stackPtr]['parenthesis_opener']) === false) { - // Live coding or syntax error, so no params to find. - return []; - } - - $opener = $this->tokens[$stackPtr]['parenthesis_opener']; - } - - if (isset($this->tokens[$opener]['parenthesis_closer']) === false) { - // Live coding or syntax error, so no params to find. - return []; - } - - $closer = $this->tokens[$opener]['parenthesis_closer']; - - $vars = []; - $currVar = null; - $paramStart = ($opener + 1); - $defaultStart = null; - $equalToken = null; - $paramCount = 0; - $hasAttributes = false; - $passByReference = false; - $referenceToken = false; - $variableLength = false; - $variadicToken = false; - $typeHint = ''; - $typeHintToken = false; - $typeHintEndToken = false; - $nullableType = false; - $visibilityToken = null; - - for ($i = $paramStart; $i <= $closer; $i++) { - // Check to see if this token has a parenthesis or bracket opener. If it does - // it's likely to be an array which might have arguments in it. This - // could cause problems in our parsing below, so lets just skip to the - // end of it. - if (isset($this->tokens[$i]['parenthesis_opener']) === true) { - // Don't do this if it's the close parenthesis for the method. - if ($i !== $this->tokens[$i]['parenthesis_closer']) { - $i = $this->tokens[$i]['parenthesis_closer']; - continue; - } - } - - if (isset($this->tokens[$i]['bracket_opener']) === true) { - if ($i !== $this->tokens[$i]['bracket_closer']) { - $i = $this->tokens[$i]['bracket_closer']; - continue; - } - } - - switch ($this->tokens[$i]['code']) { - case T_ATTRIBUTE: - $hasAttributes = true; - - // Skip to the end of the attribute. - $i = $this->tokens[$i]['attribute_closer']; - break; - case T_BITWISE_AND: - if ($defaultStart === null) { - $passByReference = true; - $referenceToken = $i; - } - break; - case T_VARIABLE: - $currVar = $i; - break; - case T_ELLIPSIS: - $variableLength = true; - $variadicToken = $i; - break; - case T_CALLABLE: - if ($typeHintToken === false) { - $typeHintToken = $i; - } - - $typeHint .= $this->tokens[$i]['content']; - $typeHintEndToken = $i; - break; - case T_SELF: - case T_PARENT: - case T_STATIC: - // Self and parent are valid, static invalid, but was probably intended as type hint. - if (isset($defaultStart) === false) { - if ($typeHintToken === false) { - $typeHintToken = $i; - } - - $typeHint .= $this->tokens[$i]['content']; - $typeHintEndToken = $i; - } - break; - case T_STRING: - // This is a string, so it may be a type hint, but it could - // also be a constant used as a default value. - $prevComma = false; - for ($t = $i; $t >= $opener; $t--) { - if ($this->tokens[$t]['code'] === T_COMMA) { - $prevComma = $t; - break; - } - } - - if ($prevComma !== false) { - $nextEquals = false; - for ($t = $prevComma; $t < $i; $t++) { - if ($this->tokens[$t]['code'] === T_EQUAL) { - $nextEquals = $t; - break; - } - } - - if ($nextEquals !== false) { - break; - } - } - - if ($defaultStart === null) { - if ($typeHintToken === false) { - $typeHintToken = $i; - } - - $typeHint .= $this->tokens[$i]['content']; - $typeHintEndToken = $i; - } - break; - case T_NAMESPACE: - case T_NS_SEPARATOR: - case T_TYPE_UNION: - case T_FALSE: - case T_NULL: - // Part of a type hint or default value. - if ($defaultStart === null) { - if ($typeHintToken === false) { - $typeHintToken = $i; - } - - $typeHint .= $this->tokens[$i]['content']; - $typeHintEndToken = $i; - } - break; - case T_NULLABLE: - if ($defaultStart === null) { - $nullableType = true; - $typeHint .= $this->tokens[$i]['content']; - $typeHintEndToken = $i; - } - break; - case T_PUBLIC: - case T_PROTECTED: - case T_PRIVATE: - if ($defaultStart === null) { - $visibilityToken = $i; - } - break; - case T_CLOSE_PARENTHESIS: - case T_COMMA: - // If it's null, then there must be no parameters for this - // method. - if ($currVar === null) { - continue 2; - } - - $vars[$paramCount] = []; - $vars[$paramCount]['token'] = $currVar; - $vars[$paramCount]['name'] = $this->tokens[$currVar]['content']; - $vars[$paramCount]['content'] = trim($this->getTokensAsString($paramStart, ($i - $paramStart))); - - if ($defaultStart !== null) { - $vars[$paramCount]['default'] = trim($this->getTokensAsString($defaultStart, ($i - $defaultStart))); - $vars[$paramCount]['default_token'] = $defaultStart; - $vars[$paramCount]['default_equal_token'] = $equalToken; - } - - $vars[$paramCount]['has_attributes'] = $hasAttributes; - $vars[$paramCount]['pass_by_reference'] = $passByReference; - $vars[$paramCount]['reference_token'] = $referenceToken; - $vars[$paramCount]['variable_length'] = $variableLength; - $vars[$paramCount]['variadic_token'] = $variadicToken; - $vars[$paramCount]['type_hint'] = $typeHint; - $vars[$paramCount]['type_hint_token'] = $typeHintToken; - $vars[$paramCount]['type_hint_end_token'] = $typeHintEndToken; - $vars[$paramCount]['nullable_type'] = $nullableType; - - if ($visibilityToken !== null) { - $vars[$paramCount]['property_visibility'] = $this->tokens[$visibilityToken]['content']; - $vars[$paramCount]['visibility_token'] = $visibilityToken; - } - - if ($this->tokens[$i]['code'] === T_COMMA) { - $vars[$paramCount]['comma_token'] = $i; - } else { - $vars[$paramCount]['comma_token'] = false; - } - - // Reset the vars, as we are about to process the next parameter. - $currVar = null; - $paramStart = ($i + 1); - $defaultStart = null; - $equalToken = null; - $hasAttributes = false; - $passByReference = false; - $referenceToken = false; - $variableLength = false; - $variadicToken = false; - $typeHint = ''; - $typeHintToken = false; - $typeHintEndToken = false; - $nullableType = false; - $visibilityToken = null; - - $paramCount++; - break; - case T_EQUAL: - $defaultStart = $this->findNext(Util\Tokens::$emptyTokens, ($i + 1), null, true); - $equalToken = $i; - break; - }//end switch - }//end for - - return $vars; - - }//end getMethodParameters() - - - /** - * Returns the visibility and implementation properties of a method. - * - * The format of the return value is: - * - * array( - * 'scope' => 'public', // Public, private, or protected - * 'scope_specified' => true, // TRUE if the scope keyword was found. - * 'return_type' => '', // The return type of the method. - * 'return_type_token' => integer, // The stack pointer to the start of the return type - * // or FALSE if there is no return type. - * 'return_type_end_token' => integer, // The stack pointer to the end of the return type - * // or FALSE if there is no return type. - * 'nullable_return_type' => false, // TRUE if the return type is preceded by the - * // nullability operator. - * 'is_abstract' => false, // TRUE if the abstract keyword was found. - * 'is_final' => false, // TRUE if the final keyword was found. - * 'is_static' => false, // TRUE if the static keyword was found. - * 'has_body' => false, // TRUE if the method has a body - * ); - * - * - * @param int $stackPtr The position in the stack of the function token to - * acquire the properties for. - * - * @return array - * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified position is not a - * T_FUNCTION, T_CLOSURE, or T_FN token. - */ - public function getMethodProperties($stackPtr) - { - if ($this->tokens[$stackPtr]['code'] !== T_FUNCTION - && $this->tokens[$stackPtr]['code'] !== T_CLOSURE - && $this->tokens[$stackPtr]['code'] !== T_FN - ) { - throw new RuntimeException('$stackPtr must be of type T_FUNCTION or T_CLOSURE or T_FN'); - } - - if ($this->tokens[$stackPtr]['code'] === T_FUNCTION) { - $valid = [ - T_PUBLIC => T_PUBLIC, - T_PRIVATE => T_PRIVATE, - T_PROTECTED => T_PROTECTED, - T_STATIC => T_STATIC, - T_FINAL => T_FINAL, - T_ABSTRACT => T_ABSTRACT, - T_WHITESPACE => T_WHITESPACE, - T_COMMENT => T_COMMENT, - T_DOC_COMMENT => T_DOC_COMMENT, - ]; - } else { - $valid = [ - T_STATIC => T_STATIC, - T_WHITESPACE => T_WHITESPACE, - T_COMMENT => T_COMMENT, - T_DOC_COMMENT => T_DOC_COMMENT, - ]; - } - - $scope = 'public'; - $scopeSpecified = false; - $isAbstract = false; - $isFinal = false; - $isStatic = false; - - for ($i = ($stackPtr - 1); $i > 0; $i--) { - if (isset($valid[$this->tokens[$i]['code']]) === false) { - break; - } - - switch ($this->tokens[$i]['code']) { - case T_PUBLIC: - $scope = 'public'; - $scopeSpecified = true; - break; - case T_PRIVATE: - $scope = 'private'; - $scopeSpecified = true; - break; - case T_PROTECTED: - $scope = 'protected'; - $scopeSpecified = true; - break; - case T_ABSTRACT: - $isAbstract = true; - break; - case T_FINAL: - $isFinal = true; - break; - case T_STATIC: - $isStatic = true; - break; - }//end switch - }//end for - - $returnType = ''; - $returnTypeToken = false; - $returnTypeEndToken = false; - $nullableReturnType = false; - $hasBody = true; - - if (isset($this->tokens[$stackPtr]['parenthesis_closer']) === true) { - $scopeOpener = null; - if (isset($this->tokens[$stackPtr]['scope_opener']) === true) { - $scopeOpener = $this->tokens[$stackPtr]['scope_opener']; - } - - $valid = [ - T_STRING => T_STRING, - T_CALLABLE => T_CALLABLE, - T_SELF => T_SELF, - T_PARENT => T_PARENT, - T_STATIC => T_STATIC, - T_FALSE => T_FALSE, - T_NULL => T_NULL, - T_NAMESPACE => T_NAMESPACE, - T_NS_SEPARATOR => T_NS_SEPARATOR, - T_TYPE_UNION => T_TYPE_UNION, - ]; - - for ($i = $this->tokens[$stackPtr]['parenthesis_closer']; $i < $this->numTokens; $i++) { - if (($scopeOpener === null && $this->tokens[$i]['code'] === T_SEMICOLON) - || ($scopeOpener !== null && $i === $scopeOpener) - ) { - // End of function definition. - break; - } - - if ($this->tokens[$i]['code'] === T_NULLABLE) { - $nullableReturnType = true; - } - - if (isset($valid[$this->tokens[$i]['code']]) === true) { - if ($returnTypeToken === false) { - $returnTypeToken = $i; - } - - $returnType .= $this->tokens[$i]['content']; - $returnTypeEndToken = $i; - } - }//end for - - if ($this->tokens[$stackPtr]['code'] === T_FN) { - $bodyToken = T_FN_ARROW; - } else { - $bodyToken = T_OPEN_CURLY_BRACKET; - } - - $end = $this->findNext([$bodyToken, T_SEMICOLON], $this->tokens[$stackPtr]['parenthesis_closer']); - $hasBody = $this->tokens[$end]['code'] === $bodyToken; - }//end if - - if ($returnType !== '' && $nullableReturnType === true) { - $returnType = '?'.$returnType; - } - - return [ - 'scope' => $scope, - 'scope_specified' => $scopeSpecified, - 'return_type' => $returnType, - 'return_type_token' => $returnTypeToken, - 'return_type_end_token' => $returnTypeEndToken, - 'nullable_return_type' => $nullableReturnType, - 'is_abstract' => $isAbstract, - 'is_final' => $isFinal, - 'is_static' => $isStatic, - 'has_body' => $hasBody, - ]; - - }//end getMethodProperties() - - - /** - * Returns the visibility and implementation properties of a class member var. - * - * The format of the return value is: - * - * - * array( - * 'scope' => string, // Public, private, or protected. - * 'scope_specified' => boolean, // TRUE if the scope was explicitly specified. - * 'is_static' => boolean, // TRUE if the static keyword was found. - * 'type' => string, // The type of the var (empty if no type specified). - * 'type_token' => integer, // The stack pointer to the start of the type - * // or FALSE if there is no type. - * 'type_end_token' => integer, // The stack pointer to the end of the type - * // or FALSE if there is no type. - * 'nullable_type' => boolean, // TRUE if the type is preceded by the nullability - * // operator. - * ); - * - * - * @param int $stackPtr The position in the stack of the T_VARIABLE token to - * acquire the properties for. - * - * @return array - * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified position is not a - * T_VARIABLE token, or if the position is not - * a class member variable. - */ - public function getMemberProperties($stackPtr) - { - if ($this->tokens[$stackPtr]['code'] !== T_VARIABLE) { - throw new RuntimeException('$stackPtr must be of type T_VARIABLE'); - } - - $conditions = array_keys($this->tokens[$stackPtr]['conditions']); - $ptr = array_pop($conditions); - if (isset($this->tokens[$ptr]) === false - || ($this->tokens[$ptr]['code'] !== T_CLASS - && $this->tokens[$ptr]['code'] !== T_ANON_CLASS - && $this->tokens[$ptr]['code'] !== T_TRAIT) - ) { - if (isset($this->tokens[$ptr]) === true - && $this->tokens[$ptr]['code'] === T_INTERFACE - ) { - // T_VARIABLEs in interfaces can actually be method arguments - // but they wont be seen as being inside the method because there - // are no scope openers and closers for abstract methods. If it is in - // parentheses, we can be pretty sure it is a method argument. - if (isset($this->tokens[$stackPtr]['nested_parenthesis']) === false - || empty($this->tokens[$stackPtr]['nested_parenthesis']) === true - ) { - $error = 'Possible parse error: interfaces may not include member vars'; - $this->addWarning($error, $stackPtr, 'Internal.ParseError.InterfaceHasMemberVar'); - return []; - } - } else { - throw new RuntimeException('$stackPtr is not a class member var'); - } - } - - // Make sure it's not a method parameter. - if (empty($this->tokens[$stackPtr]['nested_parenthesis']) === false) { - $parenthesis = array_keys($this->tokens[$stackPtr]['nested_parenthesis']); - $deepestOpen = array_pop($parenthesis); - if ($deepestOpen > $ptr - && isset($this->tokens[$deepestOpen]['parenthesis_owner']) === true - && $this->tokens[$this->tokens[$deepestOpen]['parenthesis_owner']]['code'] === T_FUNCTION - ) { - throw new RuntimeException('$stackPtr is not a class member var'); - } - } - - $valid = [ - T_PUBLIC => T_PUBLIC, - T_PRIVATE => T_PRIVATE, - T_PROTECTED => T_PROTECTED, - T_STATIC => T_STATIC, - T_VAR => T_VAR, - ]; - - $valid += Util\Tokens::$emptyTokens; - - $scope = 'public'; - $scopeSpecified = false; - $isStatic = false; - - $startOfStatement = $this->findPrevious( - [ - T_SEMICOLON, - T_OPEN_CURLY_BRACKET, - T_CLOSE_CURLY_BRACKET, - T_ATTRIBUTE_END, - ], - ($stackPtr - 1) - ); - - for ($i = ($startOfStatement + 1); $i < $stackPtr; $i++) { - if (isset($valid[$this->tokens[$i]['code']]) === false) { - break; - } - - switch ($this->tokens[$i]['code']) { - case T_PUBLIC: - $scope = 'public'; - $scopeSpecified = true; - break; - case T_PRIVATE: - $scope = 'private'; - $scopeSpecified = true; - break; - case T_PROTECTED: - $scope = 'protected'; - $scopeSpecified = true; - break; - case T_STATIC: - $isStatic = true; - break; - } - }//end for - - $type = ''; - $typeToken = false; - $typeEndToken = false; - $nullableType = false; - - if ($i < $stackPtr) { - // We've found a type. - $valid = [ - T_STRING => T_STRING, - T_CALLABLE => T_CALLABLE, - T_SELF => T_SELF, - T_PARENT => T_PARENT, - T_FALSE => T_FALSE, - T_NULL => T_NULL, - T_NAMESPACE => T_NAMESPACE, - T_NS_SEPARATOR => T_NS_SEPARATOR, - T_TYPE_UNION => T_TYPE_UNION, - ]; - - for ($i; $i < $stackPtr; $i++) { - if ($this->tokens[$i]['code'] === T_VARIABLE) { - // Hit another variable in a group definition. - break; - } - - if ($this->tokens[$i]['code'] === T_NULLABLE) { - $nullableType = true; - } - - if (isset($valid[$this->tokens[$i]['code']]) === true) { - $typeEndToken = $i; - if ($typeToken === false) { - $typeToken = $i; - } - - $type .= $this->tokens[$i]['content']; - } - } - - if ($type !== '' && $nullableType === true) { - $type = '?'.$type; - } - }//end if - - return [ - 'scope' => $scope, - 'scope_specified' => $scopeSpecified, - 'is_static' => $isStatic, - 'type' => $type, - 'type_token' => $typeToken, - 'type_end_token' => $typeEndToken, - 'nullable_type' => $nullableType, - ]; - - }//end getMemberProperties() - - - /** - * Returns the visibility and implementation properties of a class. - * - * The format of the return value is: - * - * array( - * 'is_abstract' => false, // true if the abstract keyword was found. - * 'is_final' => false, // true if the final keyword was found. - * ); - * - * - * @param int $stackPtr The position in the stack of the T_CLASS token to - * acquire the properties for. - * - * @return array - * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified position is not a - * T_CLASS token. - */ - public function getClassProperties($stackPtr) - { - if ($this->tokens[$stackPtr]['code'] !== T_CLASS) { - throw new RuntimeException('$stackPtr must be of type T_CLASS'); - } - - $valid = [ - T_FINAL => T_FINAL, - T_ABSTRACT => T_ABSTRACT, - T_WHITESPACE => T_WHITESPACE, - T_COMMENT => T_COMMENT, - T_DOC_COMMENT => T_DOC_COMMENT, - ]; - - $isAbstract = false; - $isFinal = false; - - for ($i = ($stackPtr - 1); $i > 0; $i--) { - if (isset($valid[$this->tokens[$i]['code']]) === false) { - break; - } - - switch ($this->tokens[$i]['code']) { - case T_ABSTRACT: - $isAbstract = true; - break; - - case T_FINAL: - $isFinal = true; - break; - } - }//end for - - return [ - 'is_abstract' => $isAbstract, - 'is_final' => $isFinal, - ]; - - }//end getClassProperties() - - - /** - * Determine if the passed token is a reference operator. - * - * Returns true if the specified token position represents a reference. - * Returns false if the token represents a bitwise operator. - * - * @param int $stackPtr The position of the T_BITWISE_AND token. - * - * @return boolean - */ - public function isReference($stackPtr) - { - if ($this->tokens[$stackPtr]['code'] !== T_BITWISE_AND) { - return false; - } - - $tokenBefore = $this->findPrevious( - Util\Tokens::$emptyTokens, - ($stackPtr - 1), - null, - true - ); - - if ($this->tokens[$tokenBefore]['code'] === T_FUNCTION - || $this->tokens[$tokenBefore]['code'] === T_CLOSURE - || $this->tokens[$tokenBefore]['code'] === T_FN - ) { - // Function returns a reference. - return true; - } - - if ($this->tokens[$tokenBefore]['code'] === T_DOUBLE_ARROW) { - // Inside a foreach loop or array assignment, this is a reference. - return true; - } - - if ($this->tokens[$tokenBefore]['code'] === T_AS) { - // Inside a foreach loop, this is a reference. - return true; - } - - if (isset(Util\Tokens::$assignmentTokens[$this->tokens[$tokenBefore]['code']]) === true) { - // This is directly after an assignment. It's a reference. Even if - // it is part of an operation, the other tests will handle it. - return true; - } - - $tokenAfter = $this->findNext( - Util\Tokens::$emptyTokens, - ($stackPtr + 1), - null, - true - ); - - if ($this->tokens[$tokenAfter]['code'] === T_NEW) { - return true; - } - - if (isset($this->tokens[$stackPtr]['nested_parenthesis']) === true) { - $brackets = $this->tokens[$stackPtr]['nested_parenthesis']; - $lastBracket = array_pop($brackets); - if (isset($this->tokens[$lastBracket]['parenthesis_owner']) === true) { - $owner = $this->tokens[$this->tokens[$lastBracket]['parenthesis_owner']]; - if ($owner['code'] === T_FUNCTION - || $owner['code'] === T_CLOSURE - || $owner['code'] === T_FN - ) { - $params = $this->getMethodParameters($this->tokens[$lastBracket]['parenthesis_owner']); - foreach ($params as $param) { - if ($param['reference_token'] === $stackPtr) { - // Function parameter declared to be passed by reference. - return true; - } - } - }//end if - } else { - $prev = false; - for ($t = ($this->tokens[$lastBracket]['parenthesis_opener'] - 1); $t >= 0; $t--) { - if ($this->tokens[$t]['code'] !== T_WHITESPACE) { - $prev = $t; - break; - } - } - - if ($prev !== false && $this->tokens[$prev]['code'] === T_USE) { - // Closure use by reference. - return true; - } - }//end if - }//end if - - // Pass by reference in function calls and assign by reference in arrays. - if ($this->tokens[$tokenBefore]['code'] === T_OPEN_PARENTHESIS - || $this->tokens[$tokenBefore]['code'] === T_COMMA - || $this->tokens[$tokenBefore]['code'] === T_OPEN_SHORT_ARRAY - ) { - if ($this->tokens[$tokenAfter]['code'] === T_VARIABLE) { - return true; - } else { - $skip = Util\Tokens::$emptyTokens; - $skip[] = T_NS_SEPARATOR; - $skip[] = T_SELF; - $skip[] = T_PARENT; - $skip[] = T_STATIC; - $skip[] = T_STRING; - $skip[] = T_NAMESPACE; - $skip[] = T_DOUBLE_COLON; - - $nextSignificantAfter = $this->findNext( - $skip, - ($stackPtr + 1), - null, - true - ); - if ($this->tokens[$nextSignificantAfter]['code'] === T_VARIABLE) { - return true; - } - }//end if - }//end if - - return false; - - }//end isReference() - - - /** - * Returns the content of the tokens from the specified start position in - * the token stack for the specified length. - * - * @param int $start The position to start from in the token stack. - * @param int $length The length of tokens to traverse from the start pos. - * @param bool $origContent Whether the original content or the tab replaced - * content should be used. - * - * @return string The token contents. - * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified position does not exist. - */ - public function getTokensAsString($start, $length, $origContent=false) - { - if (is_int($start) === false || isset($this->tokens[$start]) === false) { - throw new RuntimeException('The $start position for getTokensAsString() must exist in the token stack'); - } - - if (is_int($length) === false || $length <= 0) { - return ''; - } - - $str = ''; - $end = ($start + $length); - if ($end > $this->numTokens) { - $end = $this->numTokens; - } - - for ($i = $start; $i < $end; $i++) { - // If tabs are being converted to spaces by the tokeniser, the - // original content should be used instead of the converted content. - if ($origContent === true && isset($this->tokens[$i]['orig_content']) === true) { - $str .= $this->tokens[$i]['orig_content']; - } else { - $str .= $this->tokens[$i]['content']; - } - } - - return $str; - - }//end getTokensAsString() - - - /** - * Returns the position of the previous specified token(s). - * - * If a value is specified, the previous token of the specified type(s) - * containing the specified value will be returned. - * - * Returns false if no token can be found. - * - * @param int|string|array $types The type(s) of tokens to search for. - * @param int $start The position to start searching from in the - * token stack. - * @param int|null $end The end position to fail if no token is found. - * if not specified or null, end will default to - * the start of the token stack. - * @param bool $exclude If true, find the previous token that is NOT of - * the types specified in $types. - * @param string|null $value The value that the token(s) must be equal to. - * If value is omitted, tokens with any value will - * be returned. - * @param bool $local If true, tokens outside the current statement - * will not be checked. IE. checking will stop - * at the previous semi-colon found. - * - * @return int|false - * @see findNext() - */ - public function findPrevious( - $types, - $start, - $end=null, - $exclude=false, - $value=null, - $local=false - ) { - $types = (array) $types; - - if ($end === null) { - $end = 0; - } - - for ($i = $start; $i >= $end; $i--) { - $found = (bool) $exclude; - foreach ($types as $type) { - if ($this->tokens[$i]['code'] === $type) { - $found = !$exclude; - break; - } - } - - if ($found === true) { - if ($value === null) { - return $i; - } else if ($this->tokens[$i]['content'] === $value) { - return $i; - } - } - - if ($local === true) { - if (isset($this->tokens[$i]['scope_opener']) === true - && $i === $this->tokens[$i]['scope_closer'] - ) { - $i = $this->tokens[$i]['scope_opener']; - } else if (isset($this->tokens[$i]['bracket_opener']) === true - && $i === $this->tokens[$i]['bracket_closer'] - ) { - $i = $this->tokens[$i]['bracket_opener']; - } else if (isset($this->tokens[$i]['parenthesis_opener']) === true - && $i === $this->tokens[$i]['parenthesis_closer'] - ) { - $i = $this->tokens[$i]['parenthesis_opener']; - } else if ($this->tokens[$i]['code'] === T_SEMICOLON) { - break; - } - } - }//end for - - return false; - - }//end findPrevious() - - - /** - * Returns the position of the next specified token(s). - * - * If a value is specified, the next token of the specified type(s) - * containing the specified value will be returned. - * - * Returns false if no token can be found. - * - * @param int|string|array $types The type(s) of tokens to search for. - * @param int $start The position to start searching from in the - * token stack. - * @param int|null $end The end position to fail if no token is found. - * if not specified or null, end will default to - * the end of the token stack. - * @param bool $exclude If true, find the next token that is NOT of - * a type specified in $types. - * @param string|null $value The value that the token(s) must be equal to. - * If value is omitted, tokens with any value will - * be returned. - * @param bool $local If true, tokens outside the current statement - * will not be checked. i.e., checking will stop - * at the next semi-colon found. - * - * @return int|false - * @see findPrevious() - */ - public function findNext( - $types, - $start, - $end=null, - $exclude=false, - $value=null, - $local=false - ) { - $types = (array) $types; - - if ($end === null || $end > $this->numTokens) { - $end = $this->numTokens; - } - - for ($i = $start; $i < $end; $i++) { - $found = (bool) $exclude; - foreach ($types as $type) { - if ($this->tokens[$i]['code'] === $type) { - $found = !$exclude; - break; - } - } - - if ($found === true) { - if ($value === null) { - return $i; - } else if ($this->tokens[$i]['content'] === $value) { - return $i; - } - } - - if ($local === true && $this->tokens[$i]['code'] === T_SEMICOLON) { - break; - } - }//end for - - return false; - - }//end findNext() - - - /** - * Returns the position of the first non-whitespace token in a statement. - * - * @param int $start The position to start searching from in the token stack. - * @param int|string|array $ignore Token types that should not be considered stop points. - * - * @return int - */ - public function findStartOfStatement($start, $ignore=null) - { - $startTokens = Util\Tokens::$blockOpeners; - $startTokens[T_OPEN_SHORT_ARRAY] = true; - $startTokens[T_OPEN_TAG] = true; - $startTokens[T_OPEN_TAG_WITH_ECHO] = true; - - $endTokens = [ - T_CLOSE_TAG => true, - T_COLON => true, - T_COMMA => true, - T_DOUBLE_ARROW => true, - T_MATCH_ARROW => true, - T_SEMICOLON => true, - ]; - - if ($ignore !== null) { - $ignore = (array) $ignore; - foreach ($ignore as $code) { - if (isset($startTokens[$code]) === true) { - unset($startTokens[$code]); - } - - if (isset($endTokens[$code]) === true) { - unset($endTokens[$code]); - } - } - } - - // If the start token is inside the case part of a match expression, - // find the start of the condition. If it's in the statement part, find - // the token that comes after the match arrow. - $matchExpression = $this->getCondition($start, T_MATCH); - if ($matchExpression !== false) { - for ($prevMatch = $start; $prevMatch > $this->tokens[$matchExpression]['scope_opener']; $prevMatch--) { - if ($prevMatch !== $start - && ($this->tokens[$prevMatch]['code'] === T_MATCH_ARROW - || $this->tokens[$prevMatch]['code'] === T_COMMA) - ) { - break; - } - - // Skip nested statements. - if (isset($this->tokens[$prevMatch]['bracket_opener']) === true - && $prevMatch === $this->tokens[$prevMatch]['bracket_closer'] - ) { - $prevMatch = $this->tokens[$prevMatch]['bracket_opener']; - } else if (isset($this->tokens[$prevMatch]['parenthesis_opener']) === true - && $prevMatch === $this->tokens[$prevMatch]['parenthesis_closer'] - ) { - $prevMatch = $this->tokens[$prevMatch]['parenthesis_opener']; - } - } - - if ($prevMatch <= $this->tokens[$matchExpression]['scope_opener']) { - // We're before the arrow in the first case. - $next = $this->findNext(Util\Tokens::$emptyTokens, ($this->tokens[$matchExpression]['scope_opener'] + 1), null, true); - if ($next === false) { - return $start; - } - - return $next; - } - - if ($this->tokens[$prevMatch]['code'] === T_COMMA) { - // We're before the arrow, but not in the first case. - $prevMatchArrow = $this->findPrevious(T_MATCH_ARROW, ($prevMatch - 1), $this->tokens[$matchExpression]['scope_opener']); - if ($prevMatchArrow === false) { - // We're before the arrow in the first case. - $next = $this->findNext(Util\Tokens::$emptyTokens, ($this->tokens[$matchExpression]['scope_opener'] + 1), null, true); - return $next; - } - - $end = $this->findEndOfStatement($prevMatchArrow); - $next = $this->findNext(Util\Tokens::$emptyTokens, ($end + 1), null, true); - return $next; - } - }//end if - - $lastNotEmpty = $start; - - // If we are starting at a token that ends a scope block, skip to - // the start and continue from there. - // If we are starting at a token that ends a statement, skip this - // token so we find the true start of the statement. - while (isset($endTokens[$this->tokens[$start]['code']]) === true - || (isset($this->tokens[$start]['scope_condition']) === true - && $start === $this->tokens[$start]['scope_closer']) - ) { - if (isset($this->tokens[$start]['scope_condition']) === true) { - $start = $this->tokens[$start]['scope_condition']; - } else { - $start--; - } - } - - for ($i = $start; $i >= 0; $i--) { - if (isset($startTokens[$this->tokens[$i]['code']]) === true - || isset($endTokens[$this->tokens[$i]['code']]) === true - ) { - // Found the end of the previous statement. - return $lastNotEmpty; - } - - if (isset($this->tokens[$i]['scope_opener']) === true - && $i === $this->tokens[$i]['scope_closer'] - && $this->tokens[$i]['code'] !== T_CLOSE_PARENTHESIS - && $this->tokens[$i]['code'] !== T_END_NOWDOC - && $this->tokens[$i]['code'] !== T_END_HEREDOC - && $this->tokens[$i]['code'] !== T_BREAK - && $this->tokens[$i]['code'] !== T_RETURN - && $this->tokens[$i]['code'] !== T_CONTINUE - && $this->tokens[$i]['code'] !== T_THROW - && $this->tokens[$i]['code'] !== T_EXIT - ) { - // Found the end of the previous scope block. - return $lastNotEmpty; - } - - // Skip nested statements. - if (isset($this->tokens[$i]['bracket_opener']) === true - && $i === $this->tokens[$i]['bracket_closer'] - ) { - $i = $this->tokens[$i]['bracket_opener']; - } else if (isset($this->tokens[$i]['parenthesis_opener']) === true - && $i === $this->tokens[$i]['parenthesis_closer'] - ) { - $i = $this->tokens[$i]['parenthesis_opener']; - } else if ($this->tokens[$i]['code'] === T_CLOSE_USE_GROUP) { - $start = $this->findPrevious(T_OPEN_USE_GROUP, ($i - 1)); - if ($start !== false) { - $i = $start; - } - }//end if - - if (isset(Util\Tokens::$emptyTokens[$this->tokens[$i]['code']]) === false) { - $lastNotEmpty = $i; - } - }//end for - - return 0; - - }//end findStartOfStatement() - - - /** - * Returns the position of the last non-whitespace token in a statement. - * - * @param int $start The position to start searching from in the token stack. - * @param int|string|array $ignore Token types that should not be considered stop points. - * - * @return int - */ - public function findEndOfStatement($start, $ignore=null) - { - $endTokens = [ - T_COLON => true, - T_COMMA => true, - T_DOUBLE_ARROW => true, - T_SEMICOLON => true, - T_CLOSE_PARENTHESIS => true, - T_CLOSE_SQUARE_BRACKET => true, - T_CLOSE_CURLY_BRACKET => true, - T_CLOSE_SHORT_ARRAY => true, - T_OPEN_TAG => true, - T_CLOSE_TAG => true, - ]; - - if ($ignore !== null) { - $ignore = (array) $ignore; - foreach ($ignore as $code) { - unset($endTokens[$code]); - } - } - - // If the start token is inside the case part of a match expression, - // advance to the match arrow and continue looking for the - // end of the statement from there so that we skip over commas. - if ($this->tokens[$start]['code'] !== T_MATCH_ARROW) { - $matchExpression = $this->getCondition($start, T_MATCH); - if ($matchExpression !== false) { - $beforeArrow = true; - $prevMatchArrow = $this->findPrevious(T_MATCH_ARROW, ($start - 1), $this->tokens[$matchExpression]['scope_opener']); - if ($prevMatchArrow !== false) { - $prevComma = $this->findNext(T_COMMA, ($prevMatchArrow + 1), $start); - if ($prevComma === false) { - // No comma between this token and the last match arrow, - // so this token exists after the arrow and we can continue - // checking as normal. - $beforeArrow = false; - } - } - - if ($beforeArrow === true) { - $nextMatchArrow = $this->findNext(T_MATCH_ARROW, ($start + 1), $this->tokens[$matchExpression]['scope_closer']); - if ($nextMatchArrow !== false) { - $start = $nextMatchArrow; - } - } - }//end if - }//end if - - $lastNotEmpty = $start; - for ($i = $start; $i < $this->numTokens; $i++) { - if ($i !== $start && isset($endTokens[$this->tokens[$i]['code']]) === true) { - // Found the end of the statement. - if ($this->tokens[$i]['code'] === T_CLOSE_PARENTHESIS - || $this->tokens[$i]['code'] === T_CLOSE_SQUARE_BRACKET - || $this->tokens[$i]['code'] === T_CLOSE_CURLY_BRACKET - || $this->tokens[$i]['code'] === T_CLOSE_SHORT_ARRAY - || $this->tokens[$i]['code'] === T_OPEN_TAG - || $this->tokens[$i]['code'] === T_CLOSE_TAG - ) { - return $lastNotEmpty; - } - - return $i; - } - - // Skip nested statements. - if (isset($this->tokens[$i]['scope_closer']) === true - && ($i === $this->tokens[$i]['scope_opener'] - || $i === $this->tokens[$i]['scope_condition']) - ) { - if ($this->tokens[$i]['code'] === T_FN) { - $lastNotEmpty = $this->tokens[$i]['scope_closer']; - $i = ($this->tokens[$i]['scope_closer'] - 1); - continue; - } - - if ($i === $start && isset(Util\Tokens::$scopeOpeners[$this->tokens[$i]['code']]) === true) { - return $this->tokens[$i]['scope_closer']; - } - - $i = $this->tokens[$i]['scope_closer']; - } else if (isset($this->tokens[$i]['bracket_closer']) === true - && $i === $this->tokens[$i]['bracket_opener'] - ) { - $i = $this->tokens[$i]['bracket_closer']; - } else if (isset($this->tokens[$i]['parenthesis_closer']) === true - && $i === $this->tokens[$i]['parenthesis_opener'] - ) { - $i = $this->tokens[$i]['parenthesis_closer']; - } else if ($this->tokens[$i]['code'] === T_OPEN_USE_GROUP) { - $end = $this->findNext(T_CLOSE_USE_GROUP, ($i + 1)); - if ($end !== false) { - $i = $end; - } - }//end if - - if (isset(Util\Tokens::$emptyTokens[$this->tokens[$i]['code']]) === false) { - $lastNotEmpty = $i; - } - }//end for - - return ($this->numTokens - 1); - - }//end findEndOfStatement() - - - /** - * Returns the position of the first token on a line, matching given type. - * - * Returns false if no token can be found. - * - * @param int|string|array $types The type(s) of tokens to search for. - * @param int $start The position to start searching from in the - * token stack. The first token matching on - * this line before this token will be returned. - * @param bool $exclude If true, find the token that is NOT of - * the types specified in $types. - * @param string $value The value that the token must be equal to. - * If value is omitted, tokens with any value will - * be returned. - * - * @return int|false - */ - public function findFirstOnLine($types, $start, $exclude=false, $value=null) - { - if (is_array($types) === false) { - $types = [$types]; - } - - $foundToken = false; - - for ($i = $start; $i >= 0; $i--) { - if ($this->tokens[$i]['line'] < $this->tokens[$start]['line']) { - break; - } - - $found = $exclude; - foreach ($types as $type) { - if ($exclude === false) { - if ($this->tokens[$i]['code'] === $type) { - $found = true; - break; - } - } else { - if ($this->tokens[$i]['code'] === $type) { - $found = false; - break; - } - } - } - - if ($found === true) { - if ($value === null) { - $foundToken = $i; - } else if ($this->tokens[$i]['content'] === $value) { - $foundToken = $i; - } - } - }//end for - - return $foundToken; - - }//end findFirstOnLine() - - - /** - * Determine if the passed token has a condition of one of the passed types. - * - * @param int $stackPtr The position of the token we are checking. - * @param int|string|array $types The type(s) of tokens to search for. - * - * @return boolean - */ - public function hasCondition($stackPtr, $types) - { - // Check for the existence of the token. - if (isset($this->tokens[$stackPtr]) === false) { - return false; - } - - // Make sure the token has conditions. - if (isset($this->tokens[$stackPtr]['conditions']) === false) { - return false; - } - - $types = (array) $types; - $conditions = $this->tokens[$stackPtr]['conditions']; - - foreach ($types as $type) { - if (in_array($type, $conditions, true) === true) { - // We found a token with the required type. - return true; - } - } - - return false; - - }//end hasCondition() - - - /** - * Return the position of the condition for the passed token. - * - * Returns FALSE if the token does not have the condition. - * - * @param int $stackPtr The position of the token we are checking. - * @param int|string $type The type of token to search for. - * @param bool $first If TRUE, will return the matched condition - * furthest away from the passed token. - * If FALSE, will return the matched condition - * closest to the passed token. - * - * @return int|false - */ - public function getCondition($stackPtr, $type, $first=true) - { - // Check for the existence of the token. - if (isset($this->tokens[$stackPtr]) === false) { - return false; - } - - // Make sure the token has conditions. - if (isset($this->tokens[$stackPtr]['conditions']) === false) { - return false; - } - - $conditions = $this->tokens[$stackPtr]['conditions']; - if ($first === false) { - $conditions = array_reverse($conditions, true); - } - - foreach ($conditions as $token => $condition) { - if ($condition === $type) { - return $token; - } - } - - return false; - - }//end getCondition() - - - /** - * Returns the name of the class that the specified class extends. - * (works for classes, anonymous classes and interfaces) - * - * Returns FALSE on error or if there is no extended class name. - * - * @param int $stackPtr The stack position of the class. - * - * @return string|false - */ - public function findExtendedClassName($stackPtr) - { - // Check for the existence of the token. - if (isset($this->tokens[$stackPtr]) === false) { - return false; - } - - if ($this->tokens[$stackPtr]['code'] !== T_CLASS - && $this->tokens[$stackPtr]['code'] !== T_ANON_CLASS - && $this->tokens[$stackPtr]['code'] !== T_INTERFACE - ) { - return false; - } - - if (isset($this->tokens[$stackPtr]['scope_opener']) === false) { - return false; - } - - $classOpenerIndex = $this->tokens[$stackPtr]['scope_opener']; - $extendsIndex = $this->findNext(T_EXTENDS, $stackPtr, $classOpenerIndex); - if ($extendsIndex === false) { - return false; - } - - $find = [ - T_NS_SEPARATOR, - T_STRING, - T_WHITESPACE, - ]; - - $end = $this->findNext($find, ($extendsIndex + 1), ($classOpenerIndex + 1), true); - $name = $this->getTokensAsString(($extendsIndex + 1), ($end - $extendsIndex - 1)); - $name = trim($name); - - if ($name === '') { - return false; - } - - return $name; - - }//end findExtendedClassName() - - - /** - * Returns the names of the interfaces that the specified class implements. - * - * Returns FALSE on error or if there are no implemented interface names. - * - * @param int $stackPtr The stack position of the class. - * - * @return array|false - */ - public function findImplementedInterfaceNames($stackPtr) - { - // Check for the existence of the token. - if (isset($this->tokens[$stackPtr]) === false) { - return false; - } - - if ($this->tokens[$stackPtr]['code'] !== T_CLASS - && $this->tokens[$stackPtr]['code'] !== T_ANON_CLASS - ) { - return false; - } - - if (isset($this->tokens[$stackPtr]['scope_closer']) === false) { - return false; - } - - $classOpenerIndex = $this->tokens[$stackPtr]['scope_opener']; - $implementsIndex = $this->findNext(T_IMPLEMENTS, $stackPtr, $classOpenerIndex); - if ($implementsIndex === false) { - return false; - } - - $find = [ - T_NS_SEPARATOR, - T_STRING, - T_WHITESPACE, - T_COMMA, - ]; - - $end = $this->findNext($find, ($implementsIndex + 1), ($classOpenerIndex + 1), true); - $name = $this->getTokensAsString(($implementsIndex + 1), ($end - $implementsIndex - 1)); - $name = trim($name); - - if ($name === '') { - return false; - } else { - $names = explode(',', $name); - $names = array_map('trim', $names); - return $names; - } - - }//end findImplementedInterfaceNames() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Files/FileList.php b/vendor/squizlabs/php_codesniffer/src/Files/FileList.php deleted file mode 100644 index 66833a3..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Files/FileList.php +++ /dev/null @@ -1,255 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Files; - -use PHP_CodeSniffer\Autoload; -use PHP_CodeSniffer\Util; -use PHP_CodeSniffer\Ruleset; -use PHP_CodeSniffer\Config; -use PHP_CodeSniffer\Exceptions\DeepExitException; -use ReturnTypeWillChange; - -class FileList implements \Iterator, \Countable -{ - - /** - * A list of file paths that are included in the list. - * - * @var array - */ - private $files = []; - - /** - * The number of files in the list. - * - * @var integer - */ - private $numFiles = 0; - - /** - * The config data for the run. - * - * @var \PHP_CodeSniffer\Config - */ - public $config = null; - - /** - * The ruleset used for the run. - * - * @var \PHP_CodeSniffer\Ruleset - */ - public $ruleset = null; - - /** - * An array of patterns to use for skipping files. - * - * @var array - */ - protected $ignorePatterns = []; - - - /** - * Constructs a file list and loads in an array of file paths to process. - * - * @param \PHP_CodeSniffer\Config $config The config data for the run. - * @param \PHP_CodeSniffer\Ruleset $ruleset The ruleset used for the run. - * - * @return void - */ - public function __construct(Config $config, Ruleset $ruleset) - { - $this->ruleset = $ruleset; - $this->config = $config; - - $paths = $config->files; - foreach ($paths as $path) { - $isPharFile = Util\Common::isPharFile($path); - if (is_dir($path) === true || $isPharFile === true) { - if ($isPharFile === true) { - $path = 'phar://'.$path; - } - - $filterClass = $this->getFilterClass(); - - $di = new \RecursiveDirectoryIterator($path, (\RecursiveDirectoryIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS)); - $filter = new $filterClass($di, $path, $config, $ruleset); - $iterator = new \RecursiveIteratorIterator($filter); - - foreach ($iterator as $file) { - $this->files[$file->getPathname()] = null; - $this->numFiles++; - } - } else { - $this->addFile($path); - }//end if - }//end foreach - - reset($this->files); - - }//end __construct() - - - /** - * Add a file to the list. - * - * If a file object has already been created, it can be passed here. - * If it is left NULL, it will be created when accessed. - * - * @param string $path The path to the file being added. - * @param \PHP_CodeSniffer\Files\File $file The file being added. - * - * @return void - */ - public function addFile($path, $file=null) - { - // No filtering is done for STDIN when the filename - // has not been specified. - if ($path === 'STDIN') { - $this->files[$path] = $file; - $this->numFiles++; - return; - } - - $filterClass = $this->getFilterClass(); - - $di = new \RecursiveArrayIterator([$path]); - $filter = new $filterClass($di, $path, $this->config, $this->ruleset); - $iterator = new \RecursiveIteratorIterator($filter); - - foreach ($iterator as $path) { - $this->files[$path] = $file; - $this->numFiles++; - } - - }//end addFile() - - - /** - * Get the class name of the filter being used for the run. - * - * @return string - * @throws \PHP_CodeSniffer\Exceptions\DeepExitException If the specified filter could not be found. - */ - private function getFilterClass() - { - $filterType = $this->config->filter; - - if ($filterType === null) { - $filterClass = '\PHP_CodeSniffer\Filters\Filter'; - } else { - if (strpos($filterType, '.') !== false) { - // This is a path to a custom filter class. - $filename = realpath($filterType); - if ($filename === false) { - $error = "ERROR: Custom filter \"$filterType\" not found".PHP_EOL; - throw new DeepExitException($error, 3); - } - - $filterClass = Autoload::loadFile($filename); - } else { - $filterClass = '\PHP_CodeSniffer\Filters\\'.$filterType; - } - } - - return $filterClass; - - }//end getFilterClass() - - - /** - * Rewind the iterator to the first file. - * - * @return void - */ - #[ReturnTypeWillChange] - public function rewind() - { - reset($this->files); - - }//end rewind() - - - /** - * Get the file that is currently being processed. - * - * @return \PHP_CodeSniffer\Files\File - */ - #[ReturnTypeWillChange] - public function current() - { - $path = key($this->files); - if (isset($this->files[$path]) === false) { - $this->files[$path] = new LocalFile($path, $this->ruleset, $this->config); - } - - return $this->files[$path]; - - }//end current() - - - /** - * Return the file path of the current file being processed. - * - * @return void - */ - #[ReturnTypeWillChange] - public function key() - { - return key($this->files); - - }//end key() - - - /** - * Move forward to the next file. - * - * @return void - */ - #[ReturnTypeWillChange] - public function next() - { - next($this->files); - - }//end next() - - - /** - * Checks if current position is valid. - * - * @return boolean - */ - #[ReturnTypeWillChange] - public function valid() - { - if (current($this->files) === false) { - return false; - } - - return true; - - }//end valid() - - - /** - * Return the number of files in the list. - * - * @return integer - */ - #[ReturnTypeWillChange] - public function count() - { - return $this->numFiles; - - }//end count() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Files/LocalFile.php b/vendor/squizlabs/php_codesniffer/src/Files/LocalFile.php deleted file mode 100644 index ca2e74a..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Files/LocalFile.php +++ /dev/null @@ -1,219 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Files; - -use PHP_CodeSniffer\Ruleset; -use PHP_CodeSniffer\Config; -use PHP_CodeSniffer\Util\Cache; -use PHP_CodeSniffer\Util\Common; - -class LocalFile extends File -{ - - - /** - * Creates a LocalFile object and sets the content. - * - * @param string $path The absolute path to the file. - * @param \PHP_CodeSniffer\Ruleset $ruleset The ruleset used for the run. - * @param \PHP_CodeSniffer\Config $config The config data for the run. - * - * @return void - */ - public function __construct($path, Ruleset $ruleset, Config $config) - { - $this->path = trim($path); - if (Common::isReadable($this->path) === false) { - parent::__construct($this->path, $ruleset, $config); - $error = 'Error opening file; file no longer exists or you do not have access to read the file'; - $this->addMessage(true, $error, 1, 1, 'Internal.LocalFile', [], 5, false); - $this->ignored = true; - return; - } - - // Before we go and spend time tokenizing this file, just check - // to see if there is a tag up top to indicate that the whole - // file should be ignored. It must be on one of the first two lines. - if ($config->annotations === true) { - $handle = fopen($this->path, 'r'); - if ($handle !== false) { - $firstContent = fgets($handle); - $firstContent .= fgets($handle); - fclose($handle); - - if (strpos($firstContent, '@codingStandardsIgnoreFile') !== false - || stripos($firstContent, 'phpcs:ignorefile') !== false - ) { - // We are ignoring the whole file. - $this->ignored = true; - return; - } - } - } - - $this->reloadContent(); - - parent::__construct($this->path, $ruleset, $config); - - }//end __construct() - - - /** - * Loads the latest version of the file's content from the file system. - * - * @return void - */ - public function reloadContent() - { - $this->setContent(file_get_contents($this->path)); - - }//end reloadContent() - - - /** - * Processes the file. - * - * @return void - */ - public function process() - { - if ($this->ignored === true) { - return; - } - - if ($this->configCache['cache'] === false) { - parent::process(); - return; - } - - $hash = md5_file($this->path); - $hash .= fileperms($this->path); - $cache = Cache::get($this->path); - if ($cache !== false && $cache['hash'] === $hash) { - // We can't filter metrics, so just load all of them. - $this->metrics = $cache['metrics']; - - if ($this->configCache['recordErrors'] === true) { - // Replay the cached errors and warnings to filter out the ones - // we don't need for this specific run. - $this->configCache['cache'] = false; - $this->replayErrors($cache['errors'], $cache['warnings']); - $this->configCache['cache'] = true; - } else { - $this->errorCount = $cache['errorCount']; - $this->warningCount = $cache['warningCount']; - $this->fixableCount = $cache['fixableCount']; - } - - if (PHP_CODESNIFFER_VERBOSITY > 0 - || (PHP_CODESNIFFER_CBF === true && empty($this->config->files) === false) - ) { - echo "[loaded from cache]... "; - } - - $this->numTokens = $cache['numTokens']; - $this->fromCache = true; - return; - }//end if - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo PHP_EOL; - } - - parent::process(); - - $cache = [ - 'hash' => $hash, - 'errors' => $this->errors, - 'warnings' => $this->warnings, - 'metrics' => $this->metrics, - 'errorCount' => $this->errorCount, - 'warningCount' => $this->warningCount, - 'fixableCount' => $this->fixableCount, - 'numTokens' => $this->numTokens, - ]; - - Cache::set($this->path, $cache); - - // During caching, we don't filter out errors in any way, so - // we need to do that manually now by replaying them. - if ($this->configCache['recordErrors'] === true) { - $this->configCache['cache'] = false; - $this->replayErrors($this->errors, $this->warnings); - $this->configCache['cache'] = true; - } - - }//end process() - - - /** - * Clears and replays error and warnings for the file. - * - * Replaying errors and warnings allows for filtering rules to be changed - * and then errors and warnings to be reapplied with the new rules. This is - * particularly useful while caching. - * - * @param array $errors The list of errors to replay. - * @param array $warnings The list of warnings to replay. - * - * @return void - */ - private function replayErrors($errors, $warnings) - { - $this->errors = []; - $this->warnings = []; - $this->errorCount = 0; - $this->warningCount = 0; - $this->fixableCount = 0; - - $this->replayingErrors = true; - - foreach ($errors as $line => $lineErrors) { - foreach ($lineErrors as $column => $colErrors) { - foreach ($colErrors as $error) { - $this->activeListener = $error['listener']; - $this->addMessage( - true, - $error['message'], - $line, - $column, - $error['source'], - [], - $error['severity'], - $error['fixable'] - ); - } - } - } - - foreach ($warnings as $line => $lineErrors) { - foreach ($lineErrors as $column => $colErrors) { - foreach ($colErrors as $error) { - $this->activeListener = $error['listener']; - $this->addMessage( - false, - $error['message'], - $line, - $column, - $error['source'], - [], - $error['severity'], - $error['fixable'] - ); - } - } - } - - $this->replayingErrors = false; - - }//end replayErrors() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Filters/ExactMatch.php b/vendor/squizlabs/php_codesniffer/src/Filters/ExactMatch.php deleted file mode 100644 index 13af8ff..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Filters/ExactMatch.php +++ /dev/null @@ -1,108 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Filters; - -use PHP_CodeSniffer\Util; - -abstract class ExactMatch extends Filter -{ - - /** - * A list of files to exclude. - * - * @var array - */ - private $blacklist = null; - - /** - * A list of files to include. - * - * If the whitelist is empty, only files in the blacklist will be excluded. - * - * @var array - */ - private $whitelist = null; - - - /** - * Check whether the current element of the iterator is acceptable. - * - * If a file is both blacklisted and whitelisted, it will be deemed unacceptable. - * - * @return bool - */ - public function accept() - { - if (parent::accept() === false) { - return false; - } - - if ($this->blacklist === null) { - $this->blacklist = $this->getblacklist(); - } - - if ($this->whitelist === null) { - $this->whitelist = $this->getwhitelist(); - } - - $filePath = Util\Common::realpath($this->current()); - - // If file is both blacklisted and whitelisted, the blacklist takes precedence. - if (isset($this->blacklist[$filePath]) === true) { - return false; - } - - if (empty($this->whitelist) === true && empty($this->blacklist) === false) { - // We are only checking a blacklist, so everything else should be whitelisted. - return true; - } - - return isset($this->whitelist[$filePath]); - - }//end accept() - - - /** - * Returns an iterator for the current entry. - * - * Ensures that the blacklist and whitelist are preserved so they don't have - * to be generated each time. - * - * @return \RecursiveIterator - */ - public function getChildren() - { - $children = parent::getChildren(); - $children->blacklist = $this->blacklist; - $children->whitelist = $this->whitelist; - return $children; - - }//end getChildren() - - - /** - * Get a list of blacklisted file paths. - * - * @return array - */ - abstract protected function getBlacklist(); - - - /** - * Get a list of whitelisted file paths. - * - * @return array - */ - abstract protected function getWhitelist(); - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Filters/Filter.php b/vendor/squizlabs/php_codesniffer/src/Filters/Filter.php deleted file mode 100644 index a1246a2..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Filters/Filter.php +++ /dev/null @@ -1,285 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Filters; - -use PHP_CodeSniffer\Util; -use PHP_CodeSniffer\Ruleset; -use PHP_CodeSniffer\Config; -use ReturnTypeWillChange; - -class Filter extends \RecursiveFilterIterator -{ - - /** - * The top-level path we are filtering. - * - * @var string - */ - protected $basedir = null; - - /** - * The config data for the run. - * - * @var \PHP_CodeSniffer\Config - */ - protected $config = null; - - /** - * The ruleset used for the run. - * - * @var \PHP_CodeSniffer\Ruleset - */ - protected $ruleset = null; - - /** - * A list of ignore patterns that apply to directories only. - * - * @var array - */ - protected $ignoreDirPatterns = null; - - /** - * A list of ignore patterns that apply to files only. - * - * @var array - */ - protected $ignoreFilePatterns = null; - - /** - * A list of file paths we've already accepted. - * - * Used to ensure we aren't following circular symlinks. - * - * @var array - */ - protected $acceptedPaths = []; - - - /** - * Constructs a filter. - * - * @param \RecursiveIterator $iterator The iterator we are using to get file paths. - * @param string $basedir The top-level path we are filtering. - * @param \PHP_CodeSniffer\Config $config The config data for the run. - * @param \PHP_CodeSniffer\Ruleset $ruleset The ruleset used for the run. - * - * @return void - */ - public function __construct($iterator, $basedir, Config $config, Ruleset $ruleset) - { - parent::__construct($iterator); - $this->basedir = $basedir; - $this->config = $config; - $this->ruleset = $ruleset; - - }//end __construct() - - - /** - * Check whether the current element of the iterator is acceptable. - * - * Files are checked for allowed extensions and ignore patterns. - * Directories are checked for ignore patterns only. - * - * @return bool - */ - #[ReturnTypeWillChange] - public function accept() - { - $filePath = $this->current(); - $realPath = Util\Common::realpath($filePath); - - if ($realPath !== false) { - // It's a real path somewhere, so record it - // to check for circular symlinks. - if (isset($this->acceptedPaths[$realPath]) === true) { - // We've been here before. - return false; - } - } - - $filePath = $this->current(); - if (is_dir($filePath) === true) { - if ($this->config->local === true) { - return false; - } - } else if ($this->shouldProcessFile($filePath) === false) { - return false; - } - - if ($this->shouldIgnorePath($filePath) === true) { - return false; - } - - $this->acceptedPaths[$realPath] = true; - return true; - - }//end accept() - - - /** - * Returns an iterator for the current entry. - * - * Ensures that the ignore patterns are preserved so they don't have - * to be generated each time. - * - * @return \RecursiveIterator - */ - #[ReturnTypeWillChange] - public function getChildren() - { - $filterClass = get_called_class(); - $children = new $filterClass( - new \RecursiveDirectoryIterator($this->current(), (\RecursiveDirectoryIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS)), - $this->basedir, - $this->config, - $this->ruleset - ); - - // Set the ignore patterns so we don't have to generate them again. - $children->ignoreDirPatterns = $this->ignoreDirPatterns; - $children->ignoreFilePatterns = $this->ignoreFilePatterns; - $children->acceptedPaths = $this->acceptedPaths; - return $children; - - }//end getChildren() - - - /** - * Checks filtering rules to see if a file should be checked. - * - * Checks both file extension filters and path ignore filters. - * - * @param string $path The path to the file being checked. - * - * @return bool - */ - protected function shouldProcessFile($path) - { - // Check that the file's extension is one we are checking. - // We are strict about checking the extension and we don't - // let files through with no extension or that start with a dot. - $fileName = basename($path); - $fileParts = explode('.', $fileName); - if ($fileParts[0] === $fileName || $fileParts[0] === '') { - return false; - } - - // Checking multi-part file extensions, so need to create a - // complete extension list and make sure one is allowed. - $extensions = []; - array_shift($fileParts); - foreach ($fileParts as $part) { - $extensions[implode('.', $fileParts)] = 1; - array_shift($fileParts); - } - - $matches = array_intersect_key($extensions, $this->config->extensions); - if (empty($matches) === true) { - return false; - } - - return true; - - }//end shouldProcessFile() - - - /** - * Checks filtering rules to see if a path should be ignored. - * - * @param string $path The path to the file or directory being checked. - * - * @return bool - */ - protected function shouldIgnorePath($path) - { - if ($this->ignoreFilePatterns === null) { - $this->ignoreDirPatterns = []; - $this->ignoreFilePatterns = []; - - $ignorePatterns = $this->config->ignored; - $rulesetIgnorePatterns = $this->ruleset->getIgnorePatterns(); - foreach ($rulesetIgnorePatterns as $pattern => $type) { - // Ignore standard/sniff specific exclude rules. - if (is_array($type) === true) { - continue; - } - - $ignorePatterns[$pattern] = $type; - } - - foreach ($ignorePatterns as $pattern => $type) { - // If the ignore pattern ends with /* then it is ignoring an entire directory. - if (substr($pattern, -2) === '/*') { - // Need to check this pattern for dirs as well as individual file paths. - $this->ignoreFilePatterns[$pattern] = $type; - - $pattern = substr($pattern, 0, -2).'(?=/|$)'; - $this->ignoreDirPatterns[$pattern] = $type; - } else { - // This is a file-specific pattern, so only need to check this - // for individual file paths. - $this->ignoreFilePatterns[$pattern] = $type; - } - } - }//end if - - $relativePath = $path; - if (strpos($path, $this->basedir) === 0) { - // The +1 cuts off the directory separator as well. - $relativePath = substr($path, (strlen($this->basedir) + 1)); - } - - if (is_dir($path) === true) { - $ignorePatterns = $this->ignoreDirPatterns; - } else { - $ignorePatterns = $this->ignoreFilePatterns; - } - - foreach ($ignorePatterns as $pattern => $type) { - // Maintains backwards compatibility in case the ignore pattern does - // not have a relative/absolute value. - if (is_int($pattern) === true) { - $pattern = $type; - $type = 'absolute'; - } - - $replacements = [ - '\\,' => ',', - '*' => '.*', - ]; - - // We assume a / directory separator, as do the exclude rules - // most developers write, so we need a special case for any system - // that is different. - if (DIRECTORY_SEPARATOR === '\\') { - $replacements['/'] = '\\\\'; - } - - $pattern = strtr($pattern, $replacements); - - if ($type === 'relative') { - $testPath = $relativePath; - } else { - $testPath = $path; - } - - $pattern = '`'.$pattern.'`i'; - if (preg_match($pattern, $testPath) === 1) { - return true; - } - }//end foreach - - return false; - - }//end shouldIgnorePath() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Filters/GitModified.php b/vendor/squizlabs/php_codesniffer/src/Filters/GitModified.php deleted file mode 100644 index 4b6ef3f..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Filters/GitModified.php +++ /dev/null @@ -1,66 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Filters; - -use PHP_CodeSniffer\Util; - -class GitModified extends ExactMatch -{ - - - /** - * Get a list of blacklisted file paths. - * - * @return array - */ - protected function getBlacklist() - { - return []; - - }//end getBlacklist() - - - /** - * Get a list of whitelisted file paths. - * - * @return array - */ - protected function getWhitelist() - { - $modified = []; - - $cmd = 'git ls-files -o -m --exclude-standard -- '.escapeshellarg($this->basedir); - $output = []; - exec($cmd, $output); - - $basedir = $this->basedir; - if (is_dir($basedir) === false) { - $basedir = dirname($basedir); - } - - foreach ($output as $path) { - $path = Util\Common::realpath($path); - - if ($path === false) { - continue; - } - - do { - $modified[$path] = true; - $path = dirname($path); - } while ($path !== $basedir); - } - - return $modified; - - }//end getWhitelist() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Filters/GitStaged.php b/vendor/squizlabs/php_codesniffer/src/Filters/GitStaged.php deleted file mode 100644 index fcb92c3..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Filters/GitStaged.php +++ /dev/null @@ -1,68 +0,0 @@ - - * @copyright 2018 Juliette Reinders Folmer. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Filters; - -use PHP_CodeSniffer\Util; - -class GitStaged extends ExactMatch -{ - - - /** - * Get a list of blacklisted file paths. - * - * @return array - */ - protected function getBlacklist() - { - return []; - - }//end getBlacklist() - - - /** - * Get a list of whitelisted file paths. - * - * @return array - */ - protected function getWhitelist() - { - $modified = []; - - $cmd = 'git diff --cached --name-only -- '.escapeshellarg($this->basedir); - $output = []; - exec($cmd, $output); - - $basedir = $this->basedir; - if (is_dir($basedir) === false) { - $basedir = dirname($basedir); - } - - foreach ($output as $path) { - $path = Util\Common::realpath($path); - if ($path === false) { - // Skip deleted files. - continue; - } - - do { - $modified[$path] = true; - $path = dirname($path); - } while ($path !== $basedir); - } - - return $modified; - - }//end getWhitelist() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Fixer.php b/vendor/squizlabs/php_codesniffer/src/Fixer.php deleted file mode 100644 index b8dc05b..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Fixer.php +++ /dev/null @@ -1,806 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Util\Common; - -class Fixer -{ - - /** - * Is the fixer enabled and fixing a file? - * - * Sniffs should check this value to ensure they are not - * doing extra processing to prepare for a fix when fixing is - * not required. - * - * @var boolean - */ - public $enabled = false; - - /** - * The number of times we have looped over a file. - * - * @var integer - */ - public $loops = 0; - - /** - * The file being fixed. - * - * @var \PHP_CodeSniffer\Files\File - */ - private $currentFile = null; - - /** - * The list of tokens that make up the file contents. - * - * This is a simplified list which just contains the token content and nothing - * else. This is the array that is updated as fixes are made, not the file's - * token array. Imploding this array will give you the file content back. - * - * @var array - */ - private $tokens = []; - - /** - * A list of tokens that have already been fixed. - * - * We don't allow the same token to be fixed more than once each time - * through a file as this can easily cause conflicts between sniffs. - * - * @var int[] - */ - private $fixedTokens = []; - - /** - * The last value of each fixed token. - * - * If a token is being "fixed" back to its last value, the fix is - * probably conflicting with another. - * - * @var array - */ - private $oldTokenValues = []; - - /** - * A list of tokens that have been fixed during a changeset. - * - * All changes in changeset must be able to be applied, or else - * the entire changeset is rejected. - * - * @var array - */ - private $changeset = []; - - /** - * Is there an open changeset. - * - * @var boolean - */ - private $inChangeset = false; - - /** - * Is the current fixing loop in conflict? - * - * @var boolean - */ - private $inConflict = false; - - /** - * The number of fixes that have been performed. - * - * @var integer - */ - private $numFixes = 0; - - - /** - * Starts fixing a new file. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being fixed. - * - * @return void - */ - public function startFile(File $phpcsFile) - { - $this->currentFile = $phpcsFile; - $this->numFixes = 0; - $this->fixedTokens = []; - - $tokens = $phpcsFile->getTokens(); - $this->tokens = []; - foreach ($tokens as $index => $token) { - if (isset($token['orig_content']) === true) { - $this->tokens[$index] = $token['orig_content']; - } else { - $this->tokens[$index] = $token['content']; - } - } - - }//end startFile() - - - /** - * Attempt to fix the file by processing it until no fixes are made. - * - * @return boolean - */ - public function fixFile() - { - $fixable = $this->currentFile->getFixableCount(); - if ($fixable === 0) { - // Nothing to fix. - return false; - } - - $this->enabled = true; - - $this->loops = 0; - while ($this->loops < 50) { - ob_start(); - - // Only needed once file content has changed. - $contents = $this->getContents(); - - if (PHP_CODESNIFFER_VERBOSITY > 2) { - @ob_end_clean(); - echo '---START FILE CONTENT---'.PHP_EOL; - $lines = explode($this->currentFile->eolChar, $contents); - $max = strlen(count($lines)); - foreach ($lines as $lineNum => $line) { - $lineNum++; - echo str_pad($lineNum, $max, ' ', STR_PAD_LEFT).'|'.$line.PHP_EOL; - } - - echo '--- END FILE CONTENT ---'.PHP_EOL; - ob_start(); - } - - $this->inConflict = false; - $this->currentFile->ruleset->populateTokenListeners(); - $this->currentFile->setContent($contents); - $this->currentFile->process(); - ob_end_clean(); - - $this->loops++; - - if (PHP_CODESNIFFER_CBF === true && PHP_CODESNIFFER_VERBOSITY > 0) { - echo "\r".str_repeat(' ', 80)."\r"; - echo "\t=> Fixing file: $this->numFixes/$fixable violations remaining [made $this->loops pass"; - if ($this->loops > 1) { - echo 'es'; - } - - echo ']... '; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo PHP_EOL; - } - } - - if ($this->numFixes === 0 && $this->inConflict === false) { - // Nothing left to do. - break; - } else if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t* fixed $this->numFixes violations, starting loop ".($this->loops + 1).' *'.PHP_EOL; - } - }//end while - - $this->enabled = false; - - if ($this->numFixes > 0) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - if (ob_get_level() > 0) { - ob_end_clean(); - } - - echo "\t*** Reached maximum number of loops with $this->numFixes violations left unfixed ***".PHP_EOL; - ob_start(); - } - - return false; - } - - return true; - - }//end fixFile() - - - /** - * Generates a text diff of the original file and the new content. - * - * @param string $filePath Optional file path to diff the file against. - * If not specified, the original version of the - * file will be used. - * @param boolean $colors Print coloured output or not. - * - * @return string - */ - public function generateDiff($filePath=null, $colors=true) - { - if ($filePath === null) { - $filePath = $this->currentFile->getFilename(); - } - - $cwd = getcwd().DIRECTORY_SEPARATOR; - if (strpos($filePath, $cwd) === 0) { - $filename = substr($filePath, strlen($cwd)); - } else { - $filename = $filePath; - } - - $contents = $this->getContents(); - - $tempName = tempnam(sys_get_temp_dir(), 'phpcs-fixer'); - $fixedFile = fopen($tempName, 'w'); - fwrite($fixedFile, $contents); - - // We must use something like shell_exec() because whitespace at the end - // of lines is critical to diff files. - $filename = escapeshellarg($filename); - $cmd = "diff -u -L$filename -LPHP_CodeSniffer $filename \"$tempName\""; - - $diff = shell_exec($cmd); - - fclose($fixedFile); - if (is_file($tempName) === true) { - unlink($tempName); - } - - if ($diff === null) { - return ''; - } - - if ($colors === false) { - return $diff; - } - - $diffLines = explode(PHP_EOL, $diff); - if (count($diffLines) === 1) { - // Seems to be required for cygwin. - $diffLines = explode("\n", $diff); - } - - $diff = []; - foreach ($diffLines as $line) { - if (isset($line[0]) === true) { - switch ($line[0]) { - case '-': - $diff[] = "\033[31m$line\033[0m"; - break; - case '+': - $diff[] = "\033[32m$line\033[0m"; - break; - default: - $diff[] = $line; - } - } - } - - $diff = implode(PHP_EOL, $diff); - - return $diff; - - }//end generateDiff() - - - /** - * Get a count of fixes that have been performed on the file. - * - * This value is reset every time a new file is started, or an existing - * file is restarted. - * - * @return int - */ - public function getFixCount() - { - return $this->numFixes; - - }//end getFixCount() - - - /** - * Get the current content of the file, as a string. - * - * @return string - */ - public function getContents() - { - $contents = implode($this->tokens); - return $contents; - - }//end getContents() - - - /** - * Get the current fixed content of a token. - * - * This function takes changesets into account so should be used - * instead of directly accessing the token array. - * - * @param int $stackPtr The position of the token in the token stack. - * - * @return string - */ - public function getTokenContent($stackPtr) - { - if ($this->inChangeset === true - && isset($this->changeset[$stackPtr]) === true - ) { - return $this->changeset[$stackPtr]; - } else { - return $this->tokens[$stackPtr]; - } - - }//end getTokenContent() - - - /** - * Start recording actions for a changeset. - * - * @return void - */ - public function beginChangeset() - { - if ($this->inConflict === true) { - return false; - } - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $bt = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); - if ($bt[1]['class'] === __CLASS__) { - $sniff = 'Fixer'; - } else { - $sniff = Util\Common::getSniffCode($bt[1]['class']); - } - - $line = $bt[0]['line']; - - @ob_end_clean(); - echo "\t=> Changeset started by $sniff:$line".PHP_EOL; - ob_start(); - } - - $this->changeset = []; - $this->inChangeset = true; - - }//end beginChangeset() - - - /** - * Stop recording actions for a changeset, and apply logged changes. - * - * @return boolean - */ - public function endChangeset() - { - if ($this->inConflict === true) { - return false; - } - - $this->inChangeset = false; - - $success = true; - $applied = []; - foreach ($this->changeset as $stackPtr => $content) { - $success = $this->replaceToken($stackPtr, $content); - if ($success === false) { - break; - } else { - $applied[] = $stackPtr; - } - } - - if ($success === false) { - // Rolling back all changes. - foreach ($applied as $stackPtr) { - $this->revertToken($stackPtr); - } - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - @ob_end_clean(); - echo "\t=> Changeset failed to apply".PHP_EOL; - ob_start(); - } - } else if (PHP_CODESNIFFER_VERBOSITY > 1) { - $fixes = count($this->changeset); - @ob_end_clean(); - echo "\t=> Changeset ended: $fixes changes applied".PHP_EOL; - ob_start(); - } - - $this->changeset = []; - return true; - - }//end endChangeset() - - - /** - * Stop recording actions for a changeset, and discard logged changes. - * - * @return void - */ - public function rollbackChangeset() - { - $this->inChangeset = false; - $this->inConflict = false; - - if (empty($this->changeset) === false) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $bt = debug_backtrace(); - if ($bt[1]['class'] === 'PHP_CodeSniffer\Fixer') { - $sniff = $bt[2]['class']; - $line = $bt[1]['line']; - } else { - $sniff = $bt[1]['class']; - $line = $bt[0]['line']; - } - - $sniff = Util\Common::getSniffCode($sniff); - - $numChanges = count($this->changeset); - - @ob_end_clean(); - echo "\t\tR: $sniff:$line rolled back the changeset ($numChanges changes)".PHP_EOL; - echo "\t=> Changeset rolled back".PHP_EOL; - ob_start(); - } - - $this->changeset = []; - }//end if - - }//end rollbackChangeset() - - - /** - * Replace the entire contents of a token. - * - * @param int $stackPtr The position of the token in the token stack. - * @param string $content The new content of the token. - * - * @return bool If the change was accepted. - */ - public function replaceToken($stackPtr, $content) - { - if ($this->inConflict === true) { - return false; - } - - if ($this->inChangeset === false - && isset($this->fixedTokens[$stackPtr]) === true - ) { - $indent = "\t"; - if (empty($this->changeset) === false) { - $indent .= "\t"; - } - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - @ob_end_clean(); - echo "$indent* token $stackPtr has already been modified, skipping *".PHP_EOL; - ob_start(); - } - - return false; - } - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $bt = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); - if ($bt[1]['class'] === 'PHP_CodeSniffer\Fixer') { - $sniff = $bt[2]['class']; - $line = $bt[1]['line']; - } else { - $sniff = $bt[1]['class']; - $line = $bt[0]['line']; - } - - $sniff = Util\Common::getSniffCode($sniff); - - $tokens = $this->currentFile->getTokens(); - $type = $tokens[$stackPtr]['type']; - $tokenLine = $tokens[$stackPtr]['line']; - $oldContent = Common::prepareForOutput($this->tokens[$stackPtr]); - $newContent = Common::prepareForOutput($content); - if (trim($this->tokens[$stackPtr]) === '' && isset($this->tokens[($stackPtr + 1)]) === true) { - // Add some context for whitespace only changes. - $append = Common::prepareForOutput($this->tokens[($stackPtr + 1)]); - $oldContent .= $append; - $newContent .= $append; - } - }//end if - - if ($this->inChangeset === true) { - $this->changeset[$stackPtr] = $content; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - @ob_end_clean(); - echo "\t\tQ: $sniff:$line replaced token $stackPtr ($type on line $tokenLine) \"$oldContent\" => \"$newContent\"".PHP_EOL; - ob_start(); - } - - return true; - } - - if (isset($this->oldTokenValues[$stackPtr]) === false) { - $this->oldTokenValues[$stackPtr] = [ - 'curr' => $content, - 'prev' => $this->tokens[$stackPtr], - 'loop' => $this->loops, - ]; - } else { - if ($this->oldTokenValues[$stackPtr]['prev'] === $content - && $this->oldTokenValues[$stackPtr]['loop'] === ($this->loops - 1) - ) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $indent = "\t"; - if (empty($this->changeset) === false) { - $indent .= "\t"; - } - - $loop = $this->oldTokenValues[$stackPtr]['loop']; - - @ob_end_clean(); - echo "$indent**** $sniff:$line has possible conflict with another sniff on loop $loop; caused by the following change ****".PHP_EOL; - echo "$indent**** replaced token $stackPtr ($type on line $tokenLine) \"$oldContent\" => \"$newContent\" ****".PHP_EOL; - } - - if ($this->oldTokenValues[$stackPtr]['loop'] >= ($this->loops - 1)) { - $this->inConflict = true; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "$indent**** ignoring all changes until next loop ****".PHP_EOL; - } - } - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - ob_start(); - } - - return false; - }//end if - - $this->oldTokenValues[$stackPtr]['prev'] = $this->oldTokenValues[$stackPtr]['curr']; - $this->oldTokenValues[$stackPtr]['curr'] = $content; - $this->oldTokenValues[$stackPtr]['loop'] = $this->loops; - }//end if - - $this->fixedTokens[$stackPtr] = $this->tokens[$stackPtr]; - $this->tokens[$stackPtr] = $content; - $this->numFixes++; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $indent = "\t"; - if (empty($this->changeset) === false) { - $indent .= "\tA: "; - } - - if (ob_get_level() > 0) { - ob_end_clean(); - } - - echo "$indent$sniff:$line replaced token $stackPtr ($type on line $tokenLine) \"$oldContent\" => \"$newContent\"".PHP_EOL; - ob_start(); - } - - return true; - - }//end replaceToken() - - - /** - * Reverts the previous fix made to a token. - * - * @param int $stackPtr The position of the token in the token stack. - * - * @return bool If a change was reverted. - */ - public function revertToken($stackPtr) - { - if (isset($this->fixedTokens[$stackPtr]) === false) { - return false; - } - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $bt = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); - if ($bt[1]['class'] === 'PHP_CodeSniffer\Fixer') { - $sniff = $bt[2]['class']; - $line = $bt[1]['line']; - } else { - $sniff = $bt[1]['class']; - $line = $bt[0]['line']; - } - - $sniff = Util\Common::getSniffCode($sniff); - - $tokens = $this->currentFile->getTokens(); - $type = $tokens[$stackPtr]['type']; - $tokenLine = $tokens[$stackPtr]['line']; - $oldContent = Common::prepareForOutput($this->tokens[$stackPtr]); - $newContent = Common::prepareForOutput($this->fixedTokens[$stackPtr]); - if (trim($this->tokens[$stackPtr]) === '' && isset($tokens[($stackPtr + 1)]) === true) { - // Add some context for whitespace only changes. - $append = Common::prepareForOutput($this->tokens[($stackPtr + 1)]); - $oldContent .= $append; - $newContent .= $append; - } - }//end if - - $this->tokens[$stackPtr] = $this->fixedTokens[$stackPtr]; - unset($this->fixedTokens[$stackPtr]); - $this->numFixes--; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $indent = "\t"; - if (empty($this->changeset) === false) { - $indent .= "\tR: "; - } - - @ob_end_clean(); - echo "$indent$sniff:$line reverted token $stackPtr ($type on line $tokenLine) \"$oldContent\" => \"$newContent\"".PHP_EOL; - ob_start(); - } - - return true; - - }//end revertToken() - - - /** - * Replace the content of a token with a part of its current content. - * - * @param int $stackPtr The position of the token in the token stack. - * @param int $start The first character to keep. - * @param int $length The number of characters to keep. If NULL, the content of - * the token from $start to the end of the content is kept. - * - * @return bool If the change was accepted. - */ - public function substrToken($stackPtr, $start, $length=null) - { - $current = $this->getTokenContent($stackPtr); - - if ($length === null) { - $newContent = substr($current, $start); - } else { - $newContent = substr($current, $start, $length); - } - - return $this->replaceToken($stackPtr, $newContent); - - }//end substrToken() - - - /** - * Adds a newline to end of a token's content. - * - * @param int $stackPtr The position of the token in the token stack. - * - * @return bool If the change was accepted. - */ - public function addNewline($stackPtr) - { - $current = $this->getTokenContent($stackPtr); - return $this->replaceToken($stackPtr, $current.$this->currentFile->eolChar); - - }//end addNewline() - - - /** - * Adds a newline to the start of a token's content. - * - * @param int $stackPtr The position of the token in the token stack. - * - * @return bool If the change was accepted. - */ - public function addNewlineBefore($stackPtr) - { - $current = $this->getTokenContent($stackPtr); - return $this->replaceToken($stackPtr, $this->currentFile->eolChar.$current); - - }//end addNewlineBefore() - - - /** - * Adds content to the end of a token's current content. - * - * @param int $stackPtr The position of the token in the token stack. - * @param string $content The content to add. - * - * @return bool If the change was accepted. - */ - public function addContent($stackPtr, $content) - { - $current = $this->getTokenContent($stackPtr); - return $this->replaceToken($stackPtr, $current.$content); - - }//end addContent() - - - /** - * Adds content to the start of a token's current content. - * - * @param int $stackPtr The position of the token in the token stack. - * @param string $content The content to add. - * - * @return bool If the change was accepted. - */ - public function addContentBefore($stackPtr, $content) - { - $current = $this->getTokenContent($stackPtr); - return $this->replaceToken($stackPtr, $content.$current); - - }//end addContentBefore() - - - /** - * Adjust the indent of a code block. - * - * @param int $start The position of the token in the token stack - * to start adjusting the indent from. - * @param int $end The position of the token in the token stack - * to end adjusting the indent. - * @param int $change The number of spaces to adjust the indent by - * (positive or negative). - * - * @return void - */ - public function changeCodeBlockIndent($start, $end, $change) - { - $tokens = $this->currentFile->getTokens(); - - $baseIndent = ''; - if ($change > 0) { - $baseIndent = str_repeat(' ', $change); - } - - $useChangeset = false; - if ($this->inChangeset === false) { - $this->beginChangeset(); - $useChangeset = true; - } - - for ($i = $start; $i <= $end; $i++) { - if ($tokens[$i]['column'] !== 1 - || $tokens[($i + 1)]['line'] !== $tokens[$i]['line'] - ) { - continue; - } - - $length = 0; - if ($tokens[$i]['code'] === T_WHITESPACE - || $tokens[$i]['code'] === T_DOC_COMMENT_WHITESPACE - ) { - $length = $tokens[$i]['length']; - - $padding = ($length + $change); - if ($padding > 0) { - $padding = str_repeat(' ', $padding); - } else { - $padding = ''; - } - - $newContent = $padding.ltrim($tokens[$i]['content']); - } else { - $newContent = $baseIndent.$tokens[$i]['content']; - } - - $this->replaceToken($i, $newContent); - }//end for - - if ($useChangeset === true) { - $this->endChangeset(); - } - - }//end changeCodeBlockIndent() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Generators/Generator.php b/vendor/squizlabs/php_codesniffer/src/Generators/Generator.php deleted file mode 100644 index 5604976..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Generators/Generator.php +++ /dev/null @@ -1,117 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Generators; - -use PHP_CodeSniffer\Ruleset; -use PHP_CodeSniffer\Autoload; - -abstract class Generator -{ - - /** - * The ruleset used for the run. - * - * @var \PHP_CodeSniffer\Ruleset - */ - public $ruleset = null; - - /** - * XML documentation files used to produce the final output. - * - * @var string[] - */ - public $docFiles = []; - - - /** - * Constructs a doc generator. - * - * @param \PHP_CodeSniffer\Ruleset $ruleset The ruleset used for the run. - * - * @see generate() - */ - public function __construct(Ruleset $ruleset) - { - $this->ruleset = $ruleset; - - foreach ($ruleset->sniffs as $className => $sniffClass) { - $file = Autoload::getLoadedFileName($className); - $docFile = str_replace( - DIRECTORY_SEPARATOR.'Sniffs'.DIRECTORY_SEPARATOR, - DIRECTORY_SEPARATOR.'Docs'.DIRECTORY_SEPARATOR, - $file - ); - $docFile = str_replace('Sniff.php', 'Standard.xml', $docFile); - - if (is_file($docFile) === true) { - $this->docFiles[] = $docFile; - } - } - - }//end __construct() - - - /** - * Retrieves the title of the sniff from the DOMNode supplied. - * - * @param \DOMNode $doc The DOMNode object for the sniff. - * It represents the "documentation" tag in the XML - * standard file. - * - * @return string - */ - protected function getTitle(\DOMNode $doc) - { - return $doc->getAttribute('title'); - - }//end getTitle() - - - /** - * Generates the documentation for a standard. - * - * It's probably wise for doc generators to override this method so they - * have control over how the docs are produced. Otherwise, the processSniff - * method should be overridden to output content for each sniff. - * - * @return void - * @see processSniff() - */ - public function generate() - { - foreach ($this->docFiles as $file) { - $doc = new \DOMDocument(); - $doc->load($file); - $documentation = $doc->getElementsByTagName('documentation')->item(0); - $this->processSniff($documentation); - } - - }//end generate() - - - /** - * Process the documentation for a single sniff. - * - * Doc generators must implement this function to produce output. - * - * @param \DOMNode $doc The DOMNode object for the sniff. - * It represents the "documentation" tag in the XML - * standard file. - * - * @return void - * @see generate() - */ - abstract protected function processSniff(\DOMNode $doc); - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Generators/HTML.php b/vendor/squizlabs/php_codesniffer/src/Generators/HTML.php deleted file mode 100644 index db26468..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Generators/HTML.php +++ /dev/null @@ -1,270 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Generators; - -use PHP_CodeSniffer\Config; - -class HTML extends Generator -{ - - - /** - * Generates the documentation for a standard. - * - * @return void - * @see processSniff() - */ - public function generate() - { - ob_start(); - $this->printHeader(); - $this->printToc(); - - foreach ($this->docFiles as $file) { - $doc = new \DOMDocument(); - $doc->load($file); - $documentation = $doc->getElementsByTagName('documentation')->item(0); - $this->processSniff($documentation); - } - - $this->printFooter(); - - $content = ob_get_contents(); - ob_end_clean(); - - echo $content; - - }//end generate() - - - /** - * Print the header of the HTML page. - * - * @return void - */ - protected function printHeader() - { - $standard = $this->ruleset->name; - echo ''.PHP_EOL; - echo ' '.PHP_EOL; - echo " $standard Coding Standards".PHP_EOL; - echo ' '.PHP_EOL; - echo ' '.PHP_EOL; - echo ' '.PHP_EOL; - echo "

    $standard Coding Standards

    ".PHP_EOL; - - }//end printHeader() - - - /** - * Print the table of contents for the standard. - * - * The TOC is just an unordered list of bookmarks to sniffs on the page. - * - * @return void - */ - protected function printToc() - { - echo '

    Table of Contents

    '.PHP_EOL; - echo '
    '.PHP_EOL; - - }//end printToc() - - - /** - * Print the footer of the HTML page. - * - * @return void - */ - protected function printFooter() - { - // Turn off errors so we don't get timezone warnings if people - // don't have their timezone set. - $errorLevel = error_reporting(0); - echo '
    '; - echo 'Documentation generated on '.date('r'); - echo ' by PHP_CodeSniffer '.Config::VERSION.''; - echo '
    '.PHP_EOL; - error_reporting($errorLevel); - - echo ' '.PHP_EOL; - echo ''.PHP_EOL; - - }//end printFooter() - - - /** - * Process the documentation for a single sniff. - * - * @param \DOMNode $doc The DOMNode object for the sniff. - * It represents the "documentation" tag in the XML - * standard file. - * - * @return void - */ - public function processSniff(\DOMNode $doc) - { - $title = $this->getTitle($doc); - echo ' '.PHP_EOL; - echo "

    $title

    ".PHP_EOL; - - foreach ($doc->childNodes as $node) { - if ($node->nodeName === 'standard') { - $this->printTextBlock($node); - } else if ($node->nodeName === 'code_comparison') { - $this->printCodeComparisonBlock($node); - } - } - - }//end processSniff() - - - /** - * Print a text block found in a standard. - * - * @param \DOMNode $node The DOMNode object for the text block. - * - * @return void - */ - protected function printTextBlock(\DOMNode $node) - { - $content = trim($node->nodeValue); - $content = htmlspecialchars($content); - - // Allow em tags only. - $content = str_replace('<em>', '', $content); - $content = str_replace('</em>', '', $content); - - echo "

    $content

    ".PHP_EOL; - - }//end printTextBlock() - - - /** - * Print a code comparison block found in a standard. - * - * @param \DOMNode $node The DOMNode object for the code comparison block. - * - * @return void - */ - protected function printCodeComparisonBlock(\DOMNode $node) - { - $codeBlocks = $node->getElementsByTagName('code'); - - $firstTitle = $codeBlocks->item(0)->getAttribute('title'); - $first = trim($codeBlocks->item(0)->nodeValue); - $first = str_replace('', $first); - $first = str_replace(' ', ' ', $first); - $first = str_replace('', '', $first); - $first = str_replace('', '', $first); - - $secondTitle = $codeBlocks->item(1)->getAttribute('title'); - $second = trim($codeBlocks->item(1)->nodeValue); - $second = str_replace('', $second); - $second = str_replace(' ', ' ', $second); - $second = str_replace('', '', $second); - $second = str_replace('', '', $second); - - echo ' '.PHP_EOL; - echo ' '.PHP_EOL; - echo " ".PHP_EOL; - echo " ".PHP_EOL; - echo ' '.PHP_EOL; - echo ' '.PHP_EOL; - echo " ".PHP_EOL; - echo " ".PHP_EOL; - echo ' '.PHP_EOL; - echo '
    $firstTitle$secondTitle
    $first$second
    '.PHP_EOL; - - }//end printCodeComparisonBlock() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Generators/Markdown.php b/vendor/squizlabs/php_codesniffer/src/Generators/Markdown.php deleted file mode 100644 index 9756bcf..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Generators/Markdown.php +++ /dev/null @@ -1,161 +0,0 @@ - - * @copyright 2014 Arroba IT - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Generators; - -use PHP_CodeSniffer\Config; - -class Markdown extends Generator -{ - - - /** - * Generates the documentation for a standard. - * - * @return void - * @see processSniff() - */ - public function generate() - { - ob_start(); - $this->printHeader(); - - foreach ($this->docFiles as $file) { - $doc = new \DOMDocument(); - $doc->load($file); - $documentation = $doc->getElementsByTagName('documentation')->item(0); - $this->processSniff($documentation); - } - - $this->printFooter(); - $content = ob_get_contents(); - ob_end_clean(); - - echo $content; - - }//end generate() - - - /** - * Print the markdown header. - * - * @return void - */ - protected function printHeader() - { - $standard = $this->ruleset->name; - - echo "# $standard Coding Standard".PHP_EOL; - - }//end printHeader() - - - /** - * Print the markdown footer. - * - * @return void - */ - protected function printFooter() - { - // Turn off errors so we don't get timezone warnings if people - // don't have their timezone set. - error_reporting(0); - echo 'Documentation generated on '.date('r'); - echo ' by [PHP_CodeSniffer '.Config::VERSION.'](https://github.com/squizlabs/PHP_CodeSniffer)'.PHP_EOL; - - }//end printFooter() - - - /** - * Process the documentation for a single sniff. - * - * @param \DOMNode $doc The DOMNode object for the sniff. - * It represents the "documentation" tag in the XML - * standard file. - * - * @return void - */ - protected function processSniff(\DOMNode $doc) - { - $title = $this->getTitle($doc); - echo PHP_EOL."## $title".PHP_EOL; - - foreach ($doc->childNodes as $node) { - if ($node->nodeName === 'standard') { - $this->printTextBlock($node); - } else if ($node->nodeName === 'code_comparison') { - $this->printCodeComparisonBlock($node); - } - } - - }//end processSniff() - - - /** - * Print a text block found in a standard. - * - * @param \DOMNode $node The DOMNode object for the text block. - * - * @return void - */ - protected function printTextBlock(\DOMNode $node) - { - $content = trim($node->nodeValue); - $content = htmlspecialchars($content); - - $content = str_replace('<em>', '*', $content); - $content = str_replace('</em>', '*', $content); - - echo $content.PHP_EOL; - - }//end printTextBlock() - - - /** - * Print a code comparison block found in a standard. - * - * @param \DOMNode $node The DOMNode object for the code comparison block. - * - * @return void - */ - protected function printCodeComparisonBlock(\DOMNode $node) - { - $codeBlocks = $node->getElementsByTagName('code'); - - $firstTitle = $codeBlocks->item(0)->getAttribute('title'); - $first = trim($codeBlocks->item(0)->nodeValue); - $first = str_replace("\n", "\n ", $first); - $first = str_replace('', '', $first); - $first = str_replace('', '', $first); - - $secondTitle = $codeBlocks->item(1)->getAttribute('title'); - $second = trim($codeBlocks->item(1)->nodeValue); - $second = str_replace("\n", "\n ", $second); - $second = str_replace('', '', $second); - $second = str_replace('', '', $second); - - echo ' '.PHP_EOL; - echo ' '.PHP_EOL; - echo " ".PHP_EOL; - echo " ".PHP_EOL; - echo ' '.PHP_EOL; - echo ' '.PHP_EOL; - echo ''.PHP_EOL; - echo ''.PHP_EOL; - echo ' '.PHP_EOL; - echo '
    $firstTitle$secondTitle
    '.PHP_EOL.PHP_EOL; - echo " $first".PHP_EOL.PHP_EOL; - echo ''.PHP_EOL.PHP_EOL; - echo " $second".PHP_EOL.PHP_EOL; - echo '
    '.PHP_EOL; - - }//end printCodeComparisonBlock() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Generators/Text.php b/vendor/squizlabs/php_codesniffer/src/Generators/Text.php deleted file mode 100644 index ffff206..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Generators/Text.php +++ /dev/null @@ -1,253 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Generators; - -class Text extends Generator -{ - - - /** - * Process the documentation for a single sniff. - * - * @param \DOMNode $doc The DOMNode object for the sniff. - * It represents the "documentation" tag in the XML - * standard file. - * - * @return void - */ - public function processSniff(\DOMNode $doc) - { - $this->printTitle($doc); - - foreach ($doc->childNodes as $node) { - if ($node->nodeName === 'standard') { - $this->printTextBlock($node); - } else if ($node->nodeName === 'code_comparison') { - $this->printCodeComparisonBlock($node); - } - } - - }//end processSniff() - - - /** - * Prints the title area for a single sniff. - * - * @param \DOMNode $doc The DOMNode object for the sniff. - * It represents the "documentation" tag in the XML - * standard file. - * - * @return void - */ - protected function printTitle(\DOMNode $doc) - { - $title = $this->getTitle($doc); - $standard = $this->ruleset->name; - - echo PHP_EOL; - echo str_repeat('-', (strlen("$standard CODING STANDARD: $title") + 4)); - echo strtoupper(PHP_EOL."| $standard CODING STANDARD: $title |".PHP_EOL); - echo str_repeat('-', (strlen("$standard CODING STANDARD: $title") + 4)); - echo PHP_EOL.PHP_EOL; - - }//end printTitle() - - - /** - * Print a text block found in a standard. - * - * @param \DOMNode $node The DOMNode object for the text block. - * - * @return void - */ - protected function printTextBlock(\DOMNode $node) - { - $text = trim($node->nodeValue); - $text = str_replace('', '*', $text); - $text = str_replace('', '*', $text); - - $nodeLines = explode("\n", $text); - $lines = []; - - foreach ($nodeLines as $currentLine) { - $currentLine = trim($currentLine); - if ($currentLine === '') { - // The text contained a blank line. Respect this. - $lines[] = ''; - continue; - } - - $tempLine = ''; - $words = explode(' ', $currentLine); - - foreach ($words as $word) { - $currentLength = strlen($tempLine.$word); - if ($currentLength < 99) { - $tempLine .= $word.' '; - continue; - } - - if ($currentLength === 99 || $currentLength === 100) { - // We are already at the edge, so we are done. - $lines[] = $tempLine.$word; - $tempLine = ''; - } else { - $lines[] = rtrim($tempLine); - $tempLine = $word.' '; - } - }//end foreach - - if ($tempLine !== '') { - $lines[] = rtrim($tempLine); - } - }//end foreach - - echo implode(PHP_EOL, $lines).PHP_EOL.PHP_EOL; - - }//end printTextBlock() - - - /** - * Print a code comparison block found in a standard. - * - * @param \DOMNode $node The DOMNode object for the code comparison block. - * - * @return void - */ - protected function printCodeComparisonBlock(\DOMNode $node) - { - $codeBlocks = $node->getElementsByTagName('code'); - $first = trim($codeBlocks->item(0)->nodeValue); - $firstTitle = $codeBlocks->item(0)->getAttribute('title'); - - $firstTitleLines = []; - $tempTitle = ''; - $words = explode(' ', $firstTitle); - - foreach ($words as $word) { - if (strlen($tempTitle.$word) >= 45) { - if (strlen($tempTitle.$word) === 45) { - // Adding the extra space will push us to the edge - // so we are done. - $firstTitleLines[] = $tempTitle.$word; - $tempTitle = ''; - } else if (strlen($tempTitle.$word) === 46) { - // We are already at the edge, so we are done. - $firstTitleLines[] = $tempTitle.$word; - $tempTitle = ''; - } else { - $firstTitleLines[] = $tempTitle; - $tempTitle = $word.' '; - } - } else { - $tempTitle .= $word.' '; - } - }//end foreach - - if ($tempTitle !== '') { - $firstTitleLines[] = $tempTitle; - } - - $first = str_replace('', '', $first); - $first = str_replace('', '', $first); - $firstLines = explode("\n", $first); - - $second = trim($codeBlocks->item(1)->nodeValue); - $secondTitle = $codeBlocks->item(1)->getAttribute('title'); - - $secondTitleLines = []; - $tempTitle = ''; - $words = explode(' ', $secondTitle); - - foreach ($words as $word) { - if (strlen($tempTitle.$word) >= 45) { - if (strlen($tempTitle.$word) === 45) { - // Adding the extra space will push us to the edge - // so we are done. - $secondTitleLines[] = $tempTitle.$word; - $tempTitle = ''; - } else if (strlen($tempTitle.$word) === 46) { - // We are already at the edge, so we are done. - $secondTitleLines[] = $tempTitle.$word; - $tempTitle = ''; - } else { - $secondTitleLines[] = $tempTitle; - $tempTitle = $word.' '; - } - } else { - $tempTitle .= $word.' '; - } - }//end foreach - - if ($tempTitle !== '') { - $secondTitleLines[] = $tempTitle; - } - - $second = str_replace('', '', $second); - $second = str_replace('', '', $second); - $secondLines = explode("\n", $second); - - $maxCodeLines = max(count($firstLines), count($secondLines)); - $maxTitleLines = max(count($firstTitleLines), count($secondTitleLines)); - - echo str_repeat('-', 41); - echo ' CODE COMPARISON '; - echo str_repeat('-', 42).PHP_EOL; - - for ($i = 0; $i < $maxTitleLines; $i++) { - if (isset($firstTitleLines[$i]) === true) { - $firstLineText = $firstTitleLines[$i]; - } else { - $firstLineText = ''; - } - - if (isset($secondTitleLines[$i]) === true) { - $secondLineText = $secondTitleLines[$i]; - } else { - $secondLineText = ''; - } - - echo '| '; - echo $firstLineText.str_repeat(' ', (46 - strlen($firstLineText))); - echo ' | '; - echo $secondLineText.str_repeat(' ', (47 - strlen($secondLineText))); - echo ' |'.PHP_EOL; - }//end for - - echo str_repeat('-', 100).PHP_EOL; - - for ($i = 0; $i < $maxCodeLines; $i++) { - if (isset($firstLines[$i]) === true) { - $firstLineText = $firstLines[$i]; - } else { - $firstLineText = ''; - } - - if (isset($secondLines[$i]) === true) { - $secondLineText = $secondLines[$i]; - } else { - $secondLineText = ''; - } - - echo '| '; - echo $firstLineText.str_repeat(' ', max(0, (47 - strlen($firstLineText)))); - echo '| '; - echo $secondLineText.str_repeat(' ', max(0, (48 - strlen($secondLineText)))); - echo '|'.PHP_EOL; - }//end for - - echo str_repeat('-', 100).PHP_EOL.PHP_EOL; - - }//end printCodeComparisonBlock() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Reporter.php b/vendor/squizlabs/php_codesniffer/src/Reporter.php deleted file mode 100644 index e89a20e..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Reporter.php +++ /dev/null @@ -1,423 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer; - -use PHP_CodeSniffer\Exceptions\DeepExitException; -use PHP_CodeSniffer\Exceptions\RuntimeException; -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Reports\Report; -use PHP_CodeSniffer\Util\Common; - -class Reporter -{ - - /** - * The config data for the run. - * - * @var \PHP_CodeSniffer\Config - */ - public $config = null; - - /** - * Total number of files that contain errors or warnings. - * - * @var integer - */ - public $totalFiles = 0; - - /** - * Total number of errors found during the run. - * - * @var integer - */ - public $totalErrors = 0; - - /** - * Total number of warnings found during the run. - * - * @var integer - */ - public $totalWarnings = 0; - - /** - * Total number of errors/warnings that can be fixed. - * - * @var integer - */ - public $totalFixable = 0; - - /** - * Total number of errors/warnings that were fixed. - * - * @var integer - */ - public $totalFixed = 0; - - /** - * When the PHPCS run started. - * - * @var float - */ - public static $startTime = 0; - - /** - * A cache of report objects. - * - * @var array - */ - private $reports = []; - - /** - * A cache of opened temporary files. - * - * @var array - */ - private $tmpFiles = []; - - - /** - * Initialise the reporter. - * - * All reports specified in the config will be created and their - * output file (or a temp file if none is specified) initialised by - * clearing the current contents. - * - * @param \PHP_CodeSniffer\Config $config The config data for the run. - * - * @return void - * @throws \PHP_CodeSniffer\Exceptions\DeepExitException If a custom report class could not be found. - * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If a report class is incorrectly set up. - */ - public function __construct(Config $config) - { - $this->config = $config; - - foreach ($config->reports as $type => $output) { - if ($output === null) { - $output = $config->reportFile; - } - - $reportClassName = ''; - if (strpos($type, '.') !== false) { - // This is a path to a custom report class. - $filename = realpath($type); - if ($filename === false) { - $error = "ERROR: Custom report \"$type\" not found".PHP_EOL; - throw new DeepExitException($error, 3); - } - - $reportClassName = Autoload::loadFile($filename); - } else if (class_exists('PHP_CodeSniffer\Reports\\'.ucfirst($type)) === true) { - // PHPCS native report. - $reportClassName = 'PHP_CodeSniffer\Reports\\'.ucfirst($type); - } else if (class_exists($type) === true) { - // FQN of a custom report. - $reportClassName = $type; - } else { - // OK, so not a FQN, try and find the report using the registered namespaces. - $registeredNamespaces = Autoload::getSearchPaths(); - $trimmedType = ltrim($type, '\\'); - - foreach ($registeredNamespaces as $nsPrefix) { - if ($nsPrefix === '') { - continue; - } - - if (class_exists($nsPrefix.'\\'.$trimmedType) === true) { - $reportClassName = $nsPrefix.'\\'.$trimmedType; - break; - } - } - }//end if - - if ($reportClassName === '') { - $error = "ERROR: Class file for report \"$type\" not found".PHP_EOL; - throw new DeepExitException($error, 3); - } - - $reportClass = new $reportClassName(); - if (($reportClass instanceof Report) === false) { - throw new RuntimeException('Class "'.$reportClassName.'" must implement the "PHP_CodeSniffer\Report" interface.'); - } - - $this->reports[$type] = [ - 'output' => $output, - 'class' => $reportClass, - ]; - - if ($output === null) { - // Using a temp file. - // This needs to be set in the constructor so that all - // child procs use the same report file when running in parallel. - $this->tmpFiles[$type] = tempnam(sys_get_temp_dir(), 'phpcs'); - file_put_contents($this->tmpFiles[$type], ''); - } else { - file_put_contents($output, ''); - } - }//end foreach - - }//end __construct() - - - /** - * Generates and prints final versions of all reports. - * - * Returns TRUE if any of the reports output content to the screen - * or FALSE if all reports were silently printed to a file. - * - * @return bool - */ - public function printReports() - { - $toScreen = false; - foreach ($this->reports as $type => $report) { - if ($report['output'] === null) { - $toScreen = true; - } - - $this->printReport($type); - } - - return $toScreen; - - }//end printReports() - - - /** - * Generates and prints a single final report. - * - * @param string $report The report type to print. - * - * @return void - */ - public function printReport($report) - { - $reportClass = $this->reports[$report]['class']; - $reportFile = $this->reports[$report]['output']; - - if ($reportFile !== null) { - $filename = $reportFile; - $toScreen = false; - } else { - if (isset($this->tmpFiles[$report]) === true) { - $filename = $this->tmpFiles[$report]; - } else { - $filename = null; - } - - $toScreen = true; - } - - $reportCache = ''; - if ($filename !== null) { - $reportCache = file_get_contents($filename); - } - - ob_start(); - $reportClass->generate( - $reportCache, - $this->totalFiles, - $this->totalErrors, - $this->totalWarnings, - $this->totalFixable, - $this->config->showSources, - $this->config->reportWidth, - $this->config->interactive, - $toScreen - ); - $generatedReport = ob_get_contents(); - ob_end_clean(); - - if ($this->config->colors !== true || $reportFile !== null) { - $generatedReport = preg_replace('`\033\[[0-9;]+m`', '', $generatedReport); - } - - if ($reportFile !== null) { - if (PHP_CODESNIFFER_VERBOSITY > 0) { - echo $generatedReport; - } - - file_put_contents($reportFile, $generatedReport.PHP_EOL); - } else { - echo $generatedReport; - if ($filename !== null && file_exists($filename) === true) { - unlink($filename); - unset($this->tmpFiles[$report]); - } - } - - }//end printReport() - - - /** - * Caches the result of a single processed file for all reports. - * - * The report content that is generated is appended to the output file - * assigned to each report. This content may be an intermediate report format - * and not reflect the final report output. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file that has been processed. - * - * @return void - */ - public function cacheFileReport(File $phpcsFile) - { - if (isset($this->config->reports) === false) { - // This happens during unit testing, or any time someone just wants - // the error data and not the printed report. - return; - } - - $reportData = $this->prepareFileReport($phpcsFile); - $errorsShown = false; - - foreach ($this->reports as $type => $report) { - $reportClass = $report['class']; - - ob_start(); - $result = $reportClass->generateFileReport($reportData, $phpcsFile, $this->config->showSources, $this->config->reportWidth); - if ($result === true) { - $errorsShown = true; - } - - $generatedReport = ob_get_contents(); - ob_end_clean(); - - if ($report['output'] === null) { - // Using a temp file. - if (isset($this->tmpFiles[$type]) === false) { - // When running in interactive mode, the reporter prints the full - // report many times, which will unlink the temp file. So we need - // to create a new one if it doesn't exist. - $this->tmpFiles[$type] = tempnam(sys_get_temp_dir(), 'phpcs'); - file_put_contents($this->tmpFiles[$type], ''); - } - - file_put_contents($this->tmpFiles[$type], $generatedReport, (FILE_APPEND | LOCK_EX)); - } else { - file_put_contents($report['output'], $generatedReport, (FILE_APPEND | LOCK_EX)); - }//end if - }//end foreach - - if ($errorsShown === true || PHP_CODESNIFFER_CBF === true) { - $this->totalFiles++; - $this->totalErrors += $reportData['errors']; - $this->totalWarnings += $reportData['warnings']; - - // When PHPCBF is running, we need to use the fixable error values - // after the report has run and fixed what it can. - if (PHP_CODESNIFFER_CBF === true) { - $this->totalFixable += $phpcsFile->getFixableCount(); - $this->totalFixed += $phpcsFile->getFixedCount(); - } else { - $this->totalFixable += $reportData['fixable']; - } - } - - }//end cacheFileReport() - - - /** - * Generate summary information to be used during report generation. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file that has been processed. - * - * @return array - */ - public function prepareFileReport(File $phpcsFile) - { - $report = [ - 'filename' => Common::stripBasepath($phpcsFile->getFilename(), $this->config->basepath), - 'errors' => $phpcsFile->getErrorCount(), - 'warnings' => $phpcsFile->getWarningCount(), - 'fixable' => $phpcsFile->getFixableCount(), - 'messages' => [], - ]; - - if ($report['errors'] === 0 && $report['warnings'] === 0) { - // Prefect score! - return $report; - } - - if ($this->config->recordErrors === false) { - $message = 'Errors are not being recorded but this report requires error messages. '; - $message .= 'This report will not show the correct information.'; - $report['messages'][1][1] = [ - [ - 'message' => $message, - 'source' => 'Internal.RecordErrors', - 'severity' => 5, - 'fixable' => false, - 'type' => 'ERROR', - ], - ]; - return $report; - } - - $errors = []; - - // Merge errors and warnings. - foreach ($phpcsFile->getErrors() as $line => $lineErrors) { - foreach ($lineErrors as $column => $colErrors) { - $newErrors = []; - foreach ($colErrors as $data) { - $newErrors[] = [ - 'message' => $data['message'], - 'source' => $data['source'], - 'severity' => $data['severity'], - 'fixable' => $data['fixable'], - 'type' => 'ERROR', - ]; - } - - $errors[$line][$column] = $newErrors; - } - - ksort($errors[$line]); - }//end foreach - - foreach ($phpcsFile->getWarnings() as $line => $lineWarnings) { - foreach ($lineWarnings as $column => $colWarnings) { - $newWarnings = []; - foreach ($colWarnings as $data) { - $newWarnings[] = [ - 'message' => $data['message'], - 'source' => $data['source'], - 'severity' => $data['severity'], - 'fixable' => $data['fixable'], - 'type' => 'WARNING', - ]; - } - - if (isset($errors[$line]) === false) { - $errors[$line] = []; - } - - if (isset($errors[$line][$column]) === true) { - $errors[$line][$column] = array_merge( - $newWarnings, - $errors[$line][$column] - ); - } else { - $errors[$line][$column] = $newWarnings; - } - }//end foreach - - ksort($errors[$line]); - }//end foreach - - ksort($errors); - $report['messages'] = $errors; - return $report; - - }//end prepareFileReport() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Reports/Cbf.php b/vendor/squizlabs/php_codesniffer/src/Reports/Cbf.php deleted file mode 100644 index 0ecde76..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Reports/Cbf.php +++ /dev/null @@ -1,253 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Reports; - -use PHP_CodeSniffer\Exceptions\DeepExitException; -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Util; - -class Cbf implements Report -{ - - - /** - * Generate a partial report for a single processed file. - * - * Function should return TRUE if it printed or stored data about the file - * and FALSE if it ignored the file. Returning TRUE indicates that the file and - * its data should be counted in the grand totals. - * - * @param array $report Prepared report data. - * @param \PHP_CodeSniffer\File $phpcsFile The file being reported on. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. - * - * @return bool - * @throws \PHP_CodeSniffer\Exceptions\DeepExitException - */ - public function generateFileReport($report, File $phpcsFile, $showSources=false, $width=80) - { - $errors = $phpcsFile->getFixableCount(); - if ($errors !== 0) { - if (PHP_CODESNIFFER_VERBOSITY > 0) { - ob_end_clean(); - $startTime = microtime(true); - echo "\t=> Fixing file: $errors/$errors violations remaining"; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo PHP_EOL; - } - } - - $fixed = $phpcsFile->fixer->fixFile(); - } - - if ($phpcsFile->config->stdin === true) { - // Replacing STDIN, so output current file to STDOUT - // even if nothing was fixed. Exit here because we - // can't process any more than 1 file in this setup. - $fixedContent = $phpcsFile->fixer->getContents(); - throw new DeepExitException($fixedContent, 1); - } - - if ($errors === 0) { - return false; - } - - if (PHP_CODESNIFFER_VERBOSITY > 0) { - if ($fixed === false) { - echo 'ERROR'; - } else { - echo 'DONE'; - } - - $timeTaken = ((microtime(true) - $startTime) * 1000); - if ($timeTaken < 1000) { - $timeTaken = round($timeTaken); - echo " in {$timeTaken}ms".PHP_EOL; - } else { - $timeTaken = round(($timeTaken / 1000), 2); - echo " in $timeTaken secs".PHP_EOL; - } - } - - if ($fixed === true) { - // The filename in the report may be truncated due to a basepath setting - // but we are using it for writing here and not display, - // so find the correct path if basepath is in use. - $newFilename = $report['filename'].$phpcsFile->config->suffix; - if ($phpcsFile->config->basepath !== null) { - $newFilename = $phpcsFile->config->basepath.DIRECTORY_SEPARATOR.$newFilename; - } - - $newContent = $phpcsFile->fixer->getContents(); - file_put_contents($newFilename, $newContent); - - if (PHP_CODESNIFFER_VERBOSITY > 0) { - if ($newFilename === $report['filename']) { - echo "\t=> File was overwritten".PHP_EOL; - } else { - echo "\t=> Fixed file written to ".basename($newFilename).PHP_EOL; - } - } - } - - if (PHP_CODESNIFFER_VERBOSITY > 0) { - ob_start(); - } - - $errorCount = $phpcsFile->getErrorCount(); - $warningCount = $phpcsFile->getWarningCount(); - $fixableCount = $phpcsFile->getFixableCount(); - $fixedCount = ($errors - $fixableCount); - echo $report['filename'].">>$errorCount>>$warningCount>>$fixableCount>>$fixedCount".PHP_EOL; - - return $fixed; - - }//end generateFileReport() - - - /** - * Prints a summary of fixed files. - * - * @param string $cachedData Any partial report data that was returned from - * generateFileReport during the run. - * @param int $totalFiles Total number of files processed during the run. - * @param int $totalErrors Total number of errors found during the run. - * @param int $totalWarnings Total number of warnings found during the run. - * @param int $totalFixable Total number of problems that can be fixed. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. - * @param bool $interactive Are we running in interactive mode? - * @param bool $toScreen Is the report being printed to screen? - * - * @return void - */ - public function generate( - $cachedData, - $totalFiles, - $totalErrors, - $totalWarnings, - $totalFixable, - $showSources=false, - $width=80, - $interactive=false, - $toScreen=true - ) { - $lines = explode(PHP_EOL, $cachedData); - array_pop($lines); - - if (empty($lines) === true) { - echo PHP_EOL.'No fixable errors were found'.PHP_EOL; - return; - } - - $reportFiles = []; - $maxLength = 0; - $totalFixed = 0; - $failures = 0; - - foreach ($lines as $line) { - $parts = explode('>>', $line); - $fileLen = strlen($parts[0]); - $reportFiles[$parts[0]] = [ - 'errors' => $parts[1], - 'warnings' => $parts[2], - 'fixable' => $parts[3], - 'fixed' => $parts[4], - 'strlen' => $fileLen, - ]; - - $maxLength = max($maxLength, $fileLen); - - $totalFixed += $parts[4]; - - if ($parts[3] > 0) { - $failures++; - } - } - - $width = min($width, ($maxLength + 21)); - $width = max($width, 70); - - echo PHP_EOL."\033[1m".'PHPCBF RESULT SUMMARY'."\033[0m".PHP_EOL; - echo str_repeat('-', $width).PHP_EOL; - echo "\033[1m".'FILE'.str_repeat(' ', ($width - 20)).'FIXED REMAINING'."\033[0m".PHP_EOL; - echo str_repeat('-', $width).PHP_EOL; - - foreach ($reportFiles as $file => $data) { - $padding = ($width - 18 - $data['strlen']); - if ($padding < 0) { - $file = '...'.substr($file, (($padding * -1) + 3)); - $padding = 0; - } - - echo $file.str_repeat(' ', $padding).' '; - - if ($data['fixable'] > 0) { - echo "\033[31mFAILED TO FIX\033[0m".PHP_EOL; - continue; - } - - $remaining = ($data['errors'] + $data['warnings']); - - if ($data['fixed'] !== 0) { - echo $data['fixed']; - echo str_repeat(' ', (7 - strlen((string) $data['fixed']))); - } else { - echo '0 '; - } - - if ($remaining !== 0) { - echo $remaining; - } else { - echo '0'; - } - - echo PHP_EOL; - }//end foreach - - echo str_repeat('-', $width).PHP_EOL; - echo "\033[1mA TOTAL OF $totalFixed ERROR"; - if ($totalFixed !== 1) { - echo 'S'; - } - - $numFiles = count($reportFiles); - echo ' WERE FIXED IN '.$numFiles.' FILE'; - if ($numFiles !== 1) { - echo 'S'; - } - - echo "\033[0m"; - - if ($failures > 0) { - echo PHP_EOL.str_repeat('-', $width).PHP_EOL; - echo "\033[1mPHPCBF FAILED TO FIX $failures FILE"; - if ($failures !== 1) { - echo 'S'; - } - - echo "\033[0m"; - } - - echo PHP_EOL.str_repeat('-', $width).PHP_EOL.PHP_EOL; - - if ($toScreen === true && $interactive === false) { - Util\Timing::printRunTime(); - } - - }//end generate() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Reports/Checkstyle.php b/vendor/squizlabs/php_codesniffer/src/Reports/Checkstyle.php deleted file mode 100644 index 06a78e1..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Reports/Checkstyle.php +++ /dev/null @@ -1,109 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Reports; - -use PHP_CodeSniffer\Config; -use PHP_CodeSniffer\Files\File; - -class Checkstyle implements Report -{ - - - /** - * Generate a partial report for a single processed file. - * - * Function should return TRUE if it printed or stored data about the file - * and FALSE if it ignored the file. Returning TRUE indicates that the file and - * its data should be counted in the grand totals. - * - * @param array $report Prepared report data. - * @param \PHP_CodeSniffer\File $phpcsFile The file being reported on. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. - * - * @return bool - */ - public function generateFileReport($report, File $phpcsFile, $showSources=false, $width=80) - { - $out = new \XMLWriter; - $out->openMemory(); - $out->setIndent(true); - - if ($report['errors'] === 0 && $report['warnings'] === 0) { - // Nothing to print. - return false; - } - - $out->startElement('file'); - $out->writeAttribute('name', $report['filename']); - - foreach ($report['messages'] as $line => $lineErrors) { - foreach ($lineErrors as $column => $colErrors) { - foreach ($colErrors as $error) { - $error['type'] = strtolower($error['type']); - if ($phpcsFile->config->encoding !== 'utf-8') { - $error['message'] = iconv($phpcsFile->config->encoding, 'utf-8', $error['message']); - } - - $out->startElement('error'); - $out->writeAttribute('line', $line); - $out->writeAttribute('column', $column); - $out->writeAttribute('severity', $error['type']); - $out->writeAttribute('message', $error['message']); - $out->writeAttribute('source', $error['source']); - $out->endElement(); - } - } - }//end foreach - - $out->endElement(); - echo $out->flush(); - - return true; - - }//end generateFileReport() - - - /** - * Prints all violations for processed files, in a Checkstyle format. - * - * @param string $cachedData Any partial report data that was returned from - * generateFileReport during the run. - * @param int $totalFiles Total number of files processed during the run. - * @param int $totalErrors Total number of errors found during the run. - * @param int $totalWarnings Total number of warnings found during the run. - * @param int $totalFixable Total number of problems that can be fixed. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. - * @param bool $interactive Are we running in interactive mode? - * @param bool $toScreen Is the report being printed to screen? - * - * @return void - */ - public function generate( - $cachedData, - $totalFiles, - $totalErrors, - $totalWarnings, - $totalFixable, - $showSources=false, - $width=80, - $interactive=false, - $toScreen=true - ) { - echo ''.PHP_EOL; - echo ''.PHP_EOL; - echo $cachedData; - echo ''.PHP_EOL; - - }//end generate() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Reports/Code.php b/vendor/squizlabs/php_codesniffer/src/Reports/Code.php deleted file mode 100644 index c54c1e1..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Reports/Code.php +++ /dev/null @@ -1,362 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Reports; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Util; - -class Code implements Report -{ - - - /** - * Generate a partial report for a single processed file. - * - * Function should return TRUE if it printed or stored data about the file - * and FALSE if it ignored the file. Returning TRUE indicates that the file and - * its data should be counted in the grand totals. - * - * @param array $report Prepared report data. - * @param \PHP_CodeSniffer\File $phpcsFile The file being reported on. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. - * - * @return bool - */ - public function generateFileReport($report, File $phpcsFile, $showSources=false, $width=80) - { - if ($report['errors'] === 0 && $report['warnings'] === 0) { - // Nothing to print. - return false; - } - - // How many lines to show about and below the error line. - $surroundingLines = 2; - - $file = $report['filename']; - $tokens = $phpcsFile->getTokens(); - if (empty($tokens) === true) { - if (PHP_CODESNIFFER_VERBOSITY === 1) { - $startTime = microtime(true); - echo 'CODE report is parsing '.basename($file).' '; - } else if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "CODE report is forcing parse of $file".PHP_EOL; - } - - try { - $phpcsFile->parse(); - } catch (\Exception $e) { - // This is a second parse, so ignore exceptions. - // They would have been added to the file's error list already. - } - - if (PHP_CODESNIFFER_VERBOSITY === 1) { - $timeTaken = ((microtime(true) - $startTime) * 1000); - if ($timeTaken < 1000) { - $timeTaken = round($timeTaken); - echo "DONE in {$timeTaken}ms"; - } else { - $timeTaken = round(($timeTaken / 1000), 2); - echo "DONE in $timeTaken secs"; - } - - echo PHP_EOL; - } - - $tokens = $phpcsFile->getTokens(); - }//end if - - // Create an array that maps lines to the first token on the line. - $lineTokens = []; - $lastLine = 0; - $stackPtr = 0; - foreach ($tokens as $stackPtr => $token) { - if ($token['line'] !== $lastLine) { - if ($lastLine > 0) { - $lineTokens[$lastLine]['end'] = ($stackPtr - 1); - } - - $lastLine++; - $lineTokens[$lastLine] = [ - 'start' => $stackPtr, - 'end' => null, - ]; - } - } - - // Make sure the last token in the file sits on an imaginary - // last line so it is easier to generate code snippets at the - // end of the file. - $lineTokens[$lastLine]['end'] = $stackPtr; - - // Determine the longest code line we will be showing. - $maxSnippetLength = 0; - $eolLen = strlen($phpcsFile->eolChar); - foreach ($report['messages'] as $line => $lineErrors) { - $startLine = max(($line - $surroundingLines), 1); - $endLine = min(($line + $surroundingLines), $lastLine); - - $maxLineNumLength = strlen($endLine); - - for ($i = $startLine; $i <= $endLine; $i++) { - if ($i === 1) { - continue; - } - - $lineLength = ($tokens[($lineTokens[$i]['start'] - 1)]['column'] + $tokens[($lineTokens[$i]['start'] - 1)]['length'] - $eolLen); - $maxSnippetLength = max($lineLength, $maxSnippetLength); - } - } - - $maxSnippetLength += ($maxLineNumLength + 8); - - // Determine the longest error message we will be showing. - $maxErrorLength = 0; - foreach ($report['messages'] as $line => $lineErrors) { - foreach ($lineErrors as $column => $colErrors) { - foreach ($colErrors as $error) { - $length = strlen($error['message']); - if ($showSources === true) { - $length += (strlen($error['source']) + 3); - } - - $maxErrorLength = max($maxErrorLength, ($length + 1)); - } - } - } - - // The padding that all lines will require that are printing an error message overflow. - if ($report['warnings'] > 0) { - $typeLength = 7; - } else { - $typeLength = 5; - } - - $errorPadding = str_repeat(' ', ($maxLineNumLength + 7)); - $errorPadding .= str_repeat(' ', $typeLength); - $errorPadding .= ' '; - if ($report['fixable'] > 0) { - $errorPadding .= ' '; - } - - $errorPaddingLength = strlen($errorPadding); - - // The maximum amount of space an error message can use. - $maxErrorSpace = ($width - $errorPaddingLength); - if ($showSources === true) { - // Account for the chars used to print colors. - $maxErrorSpace += 8; - } - - // Figure out the max report width we need and can use. - $fileLength = strlen($file); - $maxWidth = max(($fileLength + 6), ($maxErrorLength + $errorPaddingLength)); - $width = max(min($width, $maxWidth), $maxSnippetLength); - if ($width < 70) { - $width = 70; - } - - // Print the file header. - echo PHP_EOL."\033[1mFILE: "; - if ($fileLength <= ($width - 6)) { - echo $file; - } else { - echo '...'.substr($file, ($fileLength - ($width - 6))); - } - - echo "\033[0m".PHP_EOL; - echo str_repeat('-', $width).PHP_EOL; - - echo "\033[1m".'FOUND '.$report['errors'].' ERROR'; - if ($report['errors'] !== 1) { - echo 'S'; - } - - if ($report['warnings'] > 0) { - echo ' AND '.$report['warnings'].' WARNING'; - if ($report['warnings'] !== 1) { - echo 'S'; - } - } - - echo ' AFFECTING '.count($report['messages']).' LINE'; - if (count($report['messages']) !== 1) { - echo 'S'; - } - - echo "\033[0m".PHP_EOL; - - foreach ($report['messages'] as $line => $lineErrors) { - $startLine = max(($line - $surroundingLines), 1); - $endLine = min(($line + $surroundingLines), $lastLine); - - $snippet = ''; - if (isset($lineTokens[$startLine]) === true) { - for ($i = $lineTokens[$startLine]['start']; $i <= $lineTokens[$endLine]['end']; $i++) { - $snippetLine = $tokens[$i]['line']; - if ($lineTokens[$snippetLine]['start'] === $i) { - // Starting a new line. - if ($snippetLine === $line) { - $snippet .= "\033[1m".'>> '; - } else { - $snippet .= ' '; - } - - $snippet .= str_repeat(' ', ($maxLineNumLength - strlen($snippetLine))); - $snippet .= $snippetLine.': '; - if ($snippetLine === $line) { - $snippet .= "\033[0m"; - } - } - - if (isset($tokens[$i]['orig_content']) === true) { - $tokenContent = $tokens[$i]['orig_content']; - } else { - $tokenContent = $tokens[$i]['content']; - } - - if (strpos($tokenContent, "\t") !== false) { - $token = $tokens[$i]; - $token['content'] = $tokenContent; - if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { - $tab = "\000"; - } else { - $tab = "\033[30;1m»\033[0m"; - } - - $phpcsFile->tokenizer->replaceTabsInToken($token, $tab, "\000"); - $tokenContent = $token['content']; - } - - $tokenContent = Util\Common::prepareForOutput($tokenContent, ["\r", "\n", "\t"]); - $tokenContent = str_replace("\000", ' ', $tokenContent); - - $underline = false; - if ($snippetLine === $line && isset($lineErrors[$tokens[$i]['column']]) === true) { - $underline = true; - } - - // Underline invisible characters as well. - if ($underline === true && trim($tokenContent) === '') { - $snippet .= "\033[4m".' '."\033[0m".$tokenContent; - } else { - if ($underline === true) { - $snippet .= "\033[4m"; - } - - $snippet .= $tokenContent; - - if ($underline === true) { - $snippet .= "\033[0m"; - } - } - }//end for - }//end if - - echo str_repeat('-', $width).PHP_EOL; - - foreach ($lineErrors as $column => $colErrors) { - foreach ($colErrors as $error) { - $padding = ($maxLineNumLength - strlen($line)); - echo 'LINE '.str_repeat(' ', $padding).$line.': '; - - if ($error['type'] === 'ERROR') { - echo "\033[31mERROR\033[0m"; - if ($report['warnings'] > 0) { - echo ' '; - } - } else { - echo "\033[33mWARNING\033[0m"; - } - - echo ' '; - if ($report['fixable'] > 0) { - echo '['; - if ($error['fixable'] === true) { - echo 'x'; - } else { - echo ' '; - } - - echo '] '; - } - - $message = $error['message']; - $message = str_replace("\n", "\n".$errorPadding, $message); - if ($showSources === true) { - $message = "\033[1m".$message."\033[0m".' ('.$error['source'].')'; - } - - $errorMsg = wordwrap( - $message, - $maxErrorSpace, - PHP_EOL.$errorPadding - ); - - echo $errorMsg.PHP_EOL; - }//end foreach - }//end foreach - - echo str_repeat('-', $width).PHP_EOL; - echo rtrim($snippet).PHP_EOL; - }//end foreach - - echo str_repeat('-', $width).PHP_EOL; - if ($report['fixable'] > 0) { - echo "\033[1m".'PHPCBF CAN FIX THE '.$report['fixable'].' MARKED SNIFF VIOLATIONS AUTOMATICALLY'."\033[0m".PHP_EOL; - echo str_repeat('-', $width).PHP_EOL; - } - - return true; - - }//end generateFileReport() - - - /** - * Prints all errors and warnings for each file processed. - * - * @param string $cachedData Any partial report data that was returned from - * generateFileReport during the run. - * @param int $totalFiles Total number of files processed during the run. - * @param int $totalErrors Total number of errors found during the run. - * @param int $totalWarnings Total number of warnings found during the run. - * @param int $totalFixable Total number of problems that can be fixed. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. - * @param bool $interactive Are we running in interactive mode? - * @param bool $toScreen Is the report being printed to screen? - * - * @return void - */ - public function generate( - $cachedData, - $totalFiles, - $totalErrors, - $totalWarnings, - $totalFixable, - $showSources=false, - $width=80, - $interactive=false, - $toScreen=true - ) { - if ($cachedData === '') { - return; - } - - echo $cachedData; - - if ($toScreen === true && $interactive === false) { - Util\Timing::printRunTime(); - } - - }//end generate() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Reports/Csv.php b/vendor/squizlabs/php_codesniffer/src/Reports/Csv.php deleted file mode 100644 index 6db7ecf..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Reports/Csv.php +++ /dev/null @@ -1,91 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Reports; - -use PHP_CodeSniffer\Files\File; - -class Csv implements Report -{ - - - /** - * Generate a partial report for a single processed file. - * - * Function should return TRUE if it printed or stored data about the file - * and FALSE if it ignored the file. Returning TRUE indicates that the file and - * its data should be counted in the grand totals. - * - * @param array $report Prepared report data. - * @param \PHP_CodeSniffer\File $phpcsFile The file being reported on. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. - * - * @return bool - */ - public function generateFileReport($report, File $phpcsFile, $showSources=false, $width=80) - { - if ($report['errors'] === 0 && $report['warnings'] === 0) { - // Nothing to print. - return false; - } - - foreach ($report['messages'] as $line => $lineErrors) { - foreach ($lineErrors as $column => $colErrors) { - foreach ($colErrors as $error) { - $filename = str_replace('"', '\"', $report['filename']); - $message = str_replace('"', '\"', $error['message']); - $type = strtolower($error['type']); - $source = $error['source']; - $severity = $error['severity']; - $fixable = (int) $error['fixable']; - echo "\"$filename\",$line,$column,$type,\"$message\",$source,$severity,$fixable".PHP_EOL; - } - } - } - - return true; - - }//end generateFileReport() - - - /** - * Generates a csv report. - * - * @param string $cachedData Any partial report data that was returned from - * generateFileReport during the run. - * @param int $totalFiles Total number of files processed during the run. - * @param int $totalErrors Total number of errors found during the run. - * @param int $totalWarnings Total number of warnings found during the run. - * @param int $totalFixable Total number of problems that can be fixed. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. - * @param bool $interactive Are we running in interactive mode? - * @param bool $toScreen Is the report being printed to screen? - * - * @return void - */ - public function generate( - $cachedData, - $totalFiles, - $totalErrors, - $totalWarnings, - $totalFixable, - $showSources=false, - $width=80, - $interactive=false, - $toScreen=true - ) { - echo 'File,Line,Column,Type,Message,Source,Severity,Fixable'.PHP_EOL; - echo $cachedData; - - }//end generate() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Reports/Diff.php b/vendor/squizlabs/php_codesniffer/src/Reports/Diff.php deleted file mode 100644 index ce4b31f..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Reports/Diff.php +++ /dev/null @@ -1,130 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Reports; - -use PHP_CodeSniffer\Files\File; - -class Diff implements Report -{ - - - /** - * Generate a partial report for a single processed file. - * - * Function should return TRUE if it printed or stored data about the file - * and FALSE if it ignored the file. Returning TRUE indicates that the file and - * its data should be counted in the grand totals. - * - * @param array $report Prepared report data. - * @param \PHP_CodeSniffer\File $phpcsFile The file being reported on. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. - * - * @return bool - */ - public function generateFileReport($report, File $phpcsFile, $showSources=false, $width=80) - { - $errors = $phpcsFile->getFixableCount(); - if ($errors === 0) { - return false; - } - - $phpcsFile->disableCaching(); - $tokens = $phpcsFile->getTokens(); - if (empty($tokens) === true) { - if (PHP_CODESNIFFER_VERBOSITY === 1) { - $startTime = microtime(true); - echo 'DIFF report is parsing '.basename($report['filename']).' '; - } else if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo 'DIFF report is forcing parse of '.$report['filename'].PHP_EOL; - } - - $phpcsFile->parse(); - - if (PHP_CODESNIFFER_VERBOSITY === 1) { - $timeTaken = ((microtime(true) - $startTime) * 1000); - if ($timeTaken < 1000) { - $timeTaken = round($timeTaken); - echo "DONE in {$timeTaken}ms"; - } else { - $timeTaken = round(($timeTaken / 1000), 2); - echo "DONE in $timeTaken secs"; - } - - echo PHP_EOL; - } - - $phpcsFile->fixer->startFile($phpcsFile); - }//end if - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - ob_end_clean(); - echo "\t*** START FILE FIXING ***".PHP_EOL; - } - - $fixed = $phpcsFile->fixer->fixFile(); - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t*** END FILE FIXING ***".PHP_EOL; - ob_start(); - } - - if ($fixed === false) { - return false; - } - - $diff = $phpcsFile->fixer->generateDiff(); - if ($diff === '') { - // Nothing to print. - return false; - } - - echo $diff.PHP_EOL; - return true; - - }//end generateFileReport() - - - /** - * Prints all errors and warnings for each file processed. - * - * @param string $cachedData Any partial report data that was returned from - * generateFileReport during the run. - * @param int $totalFiles Total number of files processed during the run. - * @param int $totalErrors Total number of errors found during the run. - * @param int $totalWarnings Total number of warnings found during the run. - * @param int $totalFixable Total number of problems that can be fixed. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. - * @param bool $interactive Are we running in interactive mode? - * @param bool $toScreen Is the report being printed to screen? - * - * @return void - */ - public function generate( - $cachedData, - $totalFiles, - $totalErrors, - $totalWarnings, - $totalFixable, - $showSources=false, - $width=80, - $interactive=false, - $toScreen=true - ) { - echo $cachedData; - if ($toScreen === true && $cachedData !== '') { - echo PHP_EOL; - } - - }//end generate() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Reports/Emacs.php b/vendor/squizlabs/php_codesniffer/src/Reports/Emacs.php deleted file mode 100644 index 3555f55..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Reports/Emacs.php +++ /dev/null @@ -1,90 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Reports; - -use PHP_CodeSniffer\Files\File; - -class Emacs implements Report -{ - - - /** - * Generate a partial report for a single processed file. - * - * Function should return TRUE if it printed or stored data about the file - * and FALSE if it ignored the file. Returning TRUE indicates that the file and - * its data should be counted in the grand totals. - * - * @param array $report Prepared report data. - * @param \PHP_CodeSniffer\File $phpcsFile The file being reported on. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. - * - * @return bool - */ - public function generateFileReport($report, File $phpcsFile, $showSources=false, $width=80) - { - if ($report['errors'] === 0 && $report['warnings'] === 0) { - // Nothing to print. - return false; - } - - foreach ($report['messages'] as $line => $lineErrors) { - foreach ($lineErrors as $column => $colErrors) { - foreach ($colErrors as $error) { - $message = $error['message']; - if ($showSources === true) { - $message .= ' ('.$error['source'].')'; - } - - $type = strtolower($error['type']); - echo $report['filename'].':'.$line.':'.$column.': '.$type.' - '.$message.PHP_EOL; - } - } - } - - return true; - - }//end generateFileReport() - - - /** - * Generates an emacs report. - * - * @param string $cachedData Any partial report data that was returned from - * generateFileReport during the run. - * @param int $totalFiles Total number of files processed during the run. - * @param int $totalErrors Total number of errors found during the run. - * @param int $totalWarnings Total number of warnings found during the run. - * @param int $totalFixable Total number of problems that can be fixed. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. - * @param bool $interactive Are we running in interactive mode? - * @param bool $toScreen Is the report being printed to screen? - * - * @return void - */ - public function generate( - $cachedData, - $totalFiles, - $totalErrors, - $totalWarnings, - $totalFixable, - $showSources=false, - $width=80, - $interactive=false, - $toScreen=true - ) { - echo $cachedData; - - }//end generate() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Reports/Full.php b/vendor/squizlabs/php_codesniffer/src/Reports/Full.php deleted file mode 100644 index 084bc8a..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Reports/Full.php +++ /dev/null @@ -1,231 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Reports; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Util; - -class Full implements Report -{ - - - /** - * Generate a partial report for a single processed file. - * - * Function should return TRUE if it printed or stored data about the file - * and FALSE if it ignored the file. Returning TRUE indicates that the file and - * its data should be counted in the grand totals. - * - * @param array $report Prepared report data. - * @param \PHP_CodeSniffer\File $phpcsFile The file being reported on. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. - * - * @return bool - */ - public function generateFileReport($report, File $phpcsFile, $showSources=false, $width=80) - { - if ($report['errors'] === 0 && $report['warnings'] === 0) { - // Nothing to print. - return false; - } - - // The length of the word ERROR or WARNING; used for padding. - if ($report['warnings'] > 0) { - $typeLength = 7; - } else { - $typeLength = 5; - } - - // Work out the max line number length for formatting. - $maxLineNumLength = max(array_map('strlen', array_keys($report['messages']))); - - // The padding that all lines will require that are - // printing an error message overflow. - $paddingLine2 = str_repeat(' ', ($maxLineNumLength + 1)); - $paddingLine2 .= ' | '; - $paddingLine2 .= str_repeat(' ', $typeLength); - $paddingLine2 .= ' | '; - if ($report['fixable'] > 0) { - $paddingLine2 .= ' '; - } - - $paddingLength = strlen($paddingLine2); - - // Make sure the report width isn't too big. - $maxErrorLength = 0; - foreach ($report['messages'] as $line => $lineErrors) { - foreach ($lineErrors as $column => $colErrors) { - foreach ($colErrors as $error) { - $length = strlen($error['message']); - if ($showSources === true) { - $length += (strlen($error['source']) + 3); - } - - $maxErrorLength = max($maxErrorLength, ($length + 1)); - } - } - } - - $file = $report['filename']; - $fileLength = strlen($file); - $maxWidth = max(($fileLength + 6), ($maxErrorLength + $paddingLength)); - $width = min($width, $maxWidth); - if ($width < 70) { - $width = 70; - } - - echo PHP_EOL."\033[1mFILE: "; - if ($fileLength <= ($width - 6)) { - echo $file; - } else { - echo '...'.substr($file, ($fileLength - ($width - 6))); - } - - echo "\033[0m".PHP_EOL; - echo str_repeat('-', $width).PHP_EOL; - - echo "\033[1m".'FOUND '.$report['errors'].' ERROR'; - if ($report['errors'] !== 1) { - echo 'S'; - } - - if ($report['warnings'] > 0) { - echo ' AND '.$report['warnings'].' WARNING'; - if ($report['warnings'] !== 1) { - echo 'S'; - } - } - - echo ' AFFECTING '.count($report['messages']).' LINE'; - if (count($report['messages']) !== 1) { - echo 'S'; - } - - echo "\033[0m".PHP_EOL; - echo str_repeat('-', $width).PHP_EOL; - - // The maximum amount of space an error message can use. - $maxErrorSpace = ($width - $paddingLength - 1); - - foreach ($report['messages'] as $line => $lineErrors) { - foreach ($lineErrors as $column => $colErrors) { - foreach ($colErrors as $error) { - $message = $error['message']; - $msgLines = [$message]; - if (strpos($message, "\n") !== false) { - $msgLines = explode("\n", $message); - } - - $errorMsg = ''; - $lastLine = (count($msgLines) - 1); - foreach ($msgLines as $k => $msgLine) { - if ($k === 0) { - if ($showSources === true) { - $errorMsg .= "\033[1m"; - } - } else { - $errorMsg .= PHP_EOL.$paddingLine2; - } - - if ($k === $lastLine && $showSources === true) { - $msgLine .= "\033[0m".' ('.$error['source'].')'; - } - - $errorMsg .= wordwrap( - $msgLine, - $maxErrorSpace, - PHP_EOL.$paddingLine2 - ); - } - - // The padding that goes on the front of the line. - $padding = ($maxLineNumLength - strlen($line)); - - echo ' '.str_repeat(' ', $padding).$line.' | '; - if ($error['type'] === 'ERROR') { - echo "\033[31mERROR\033[0m"; - if ($report['warnings'] > 0) { - echo ' '; - } - } else { - echo "\033[33mWARNING\033[0m"; - } - - echo ' | '; - if ($report['fixable'] > 0) { - echo '['; - if ($error['fixable'] === true) { - echo 'x'; - } else { - echo ' '; - } - - echo '] '; - } - - echo $errorMsg.PHP_EOL; - }//end foreach - }//end foreach - }//end foreach - - echo str_repeat('-', $width).PHP_EOL; - if ($report['fixable'] > 0) { - echo "\033[1m".'PHPCBF CAN FIX THE '.$report['fixable'].' MARKED SNIFF VIOLATIONS AUTOMATICALLY'."\033[0m".PHP_EOL; - echo str_repeat('-', $width).PHP_EOL; - } - - echo PHP_EOL; - return true; - - }//end generateFileReport() - - - /** - * Prints all errors and warnings for each file processed. - * - * @param string $cachedData Any partial report data that was returned from - * generateFileReport during the run. - * @param int $totalFiles Total number of files processed during the run. - * @param int $totalErrors Total number of errors found during the run. - * @param int $totalWarnings Total number of warnings found during the run. - * @param int $totalFixable Total number of problems that can be fixed. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. - * @param bool $interactive Are we running in interactive mode? - * @param bool $toScreen Is the report being printed to screen? - * - * @return void - */ - public function generate( - $cachedData, - $totalFiles, - $totalErrors, - $totalWarnings, - $totalFixable, - $showSources=false, - $width=80, - $interactive=false, - $toScreen=true - ) { - if ($cachedData === '') { - return; - } - - echo $cachedData; - - if ($toScreen === true && $interactive === false) { - Util\Timing::printRunTime(); - } - - }//end generate() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Reports/Gitblame.php b/vendor/squizlabs/php_codesniffer/src/Reports/Gitblame.php deleted file mode 100644 index 947f3d8..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Reports/Gitblame.php +++ /dev/null @@ -1,91 +0,0 @@ - - * @author Greg Sherwood - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Reports; - -use PHP_CodeSniffer\Exceptions\DeepExitException; - -class Gitblame extends VersionControl -{ - - /** - * The name of the report we want in the output - * - * @var string - */ - protected $reportName = 'GIT'; - - - /** - * Extract the author from a blame line. - * - * @param string $line Line to parse. - * - * @return mixed string or false if impossible to recover. - */ - protected function getAuthor($line) - { - $blameParts = []; - $line = preg_replace('|\s+|', ' ', $line); - preg_match( - '|\(.+[0-9]{4}-[0-9]{2}-[0-9]{2}\s+[0-9]+\)|', - $line, - $blameParts - ); - - if (isset($blameParts[0]) === false) { - return false; - } - - $parts = explode(' ', $blameParts[0]); - - if (count($parts) < 2) { - return false; - } - - $parts = array_slice($parts, 0, (count($parts) - 2)); - $author = preg_replace('|\(|', '', implode(' ', $parts)); - return $author; - - }//end getAuthor() - - - /** - * Gets the blame output. - * - * @param string $filename File to blame. - * - * @return array - * @throws \PHP_CodeSniffer\Exceptions\DeepExitException - */ - protected function getBlameContent($filename) - { - $cwd = getcwd(); - - chdir(dirname($filename)); - $command = 'git blame --date=short "'.$filename.'" 2>&1'; - $handle = popen($command, 'r'); - if ($handle === false) { - $error = 'ERROR: Could not execute "'.$command.'"'.PHP_EOL.PHP_EOL; - throw new DeepExitException($error, 3); - } - - $rawContent = stream_get_contents($handle); - fclose($handle); - - $blames = explode("\n", $rawContent); - chdir($cwd); - - return $blames; - - }//end getBlameContent() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Reports/Hgblame.php b/vendor/squizlabs/php_codesniffer/src/Reports/Hgblame.php deleted file mode 100644 index b0af664..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Reports/Hgblame.php +++ /dev/null @@ -1,110 +0,0 @@ - - * @author Greg Sherwood - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Reports; - -use PHP_CodeSniffer\Exceptions\DeepExitException; - -class Hgblame extends VersionControl -{ - - /** - * The name of the report we want in the output - * - * @var string - */ - protected $reportName = 'MERCURIAL'; - - - /** - * Extract the author from a blame line. - * - * @param string $line Line to parse. - * - * @return mixed string or false if impossible to recover. - */ - protected function getAuthor($line) - { - $blameParts = []; - $line = preg_replace('|\s+|', ' ', $line); - - preg_match( - '|(.+[0-9]{2}:[0-9]{2}:[0-9]{2}\s[0-9]{4}\s.[0-9]{4}:)|', - $line, - $blameParts - ); - - if (isset($blameParts[0]) === false) { - return false; - } - - $parts = explode(' ', $blameParts[0]); - - if (count($parts) < 6) { - return false; - } - - $parts = array_slice($parts, 0, (count($parts) - 6)); - - return trim(preg_replace('|<.+>|', '', implode(' ', $parts))); - - }//end getAuthor() - - - /** - * Gets the blame output. - * - * @param string $filename File to blame. - * - * @return array - * @throws \PHP_CodeSniffer\Exceptions\DeepExitException - */ - protected function getBlameContent($filename) - { - $cwd = getcwd(); - - $fileParts = explode(DIRECTORY_SEPARATOR, $filename); - $found = false; - $location = ''; - while (empty($fileParts) === false) { - array_pop($fileParts); - $location = implode(DIRECTORY_SEPARATOR, $fileParts); - if (is_dir($location.DIRECTORY_SEPARATOR.'.hg') === true) { - $found = true; - break; - } - } - - if ($found === true) { - chdir($location); - } else { - $error = 'ERROR: Could not locate .hg directory '.PHP_EOL.PHP_EOL; - throw new DeepExitException($error, 3); - } - - $command = 'hg blame -u -d -v "'.$filename.'" 2>&1'; - $handle = popen($command, 'r'); - if ($handle === false) { - $error = 'ERROR: Could not execute "'.$command.'"'.PHP_EOL.PHP_EOL; - throw new DeepExitException($error, 3); - } - - $rawContent = stream_get_contents($handle); - fclose($handle); - - $blames = explode("\n", $rawContent); - chdir($cwd); - - return $blames; - - }//end getBlameContent() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Reports/Info.php b/vendor/squizlabs/php_codesniffer/src/Reports/Info.php deleted file mode 100644 index 3181bcc..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Reports/Info.php +++ /dev/null @@ -1,172 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Reports; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Util\Timing; - -class Info implements Report -{ - - - /** - * Generate a partial report for a single processed file. - * - * Function should return TRUE if it printed or stored data about the file - * and FALSE if it ignored the file. Returning TRUE indicates that the file and - * its data should be counted in the grand totals. - * - * @param array $report Prepared report data. - * @param \PHP_CodeSniffer\File $phpcsFile The file being reported on. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. - * - * @return bool - */ - public function generateFileReport($report, File $phpcsFile, $showSources=false, $width=80) - { - $metrics = $phpcsFile->getMetrics(); - foreach ($metrics as $metric => $data) { - foreach ($data['values'] as $value => $count) { - echo "$metric>>$value>>$count".PHP_EOL; - } - } - - return true; - - }//end generateFileReport() - - - /** - * Prints the source of all errors and warnings. - * - * @param string $cachedData Any partial report data that was returned from - * generateFileReport during the run. - * @param int $totalFiles Total number of files processed during the run. - * @param int $totalErrors Total number of errors found during the run. - * @param int $totalWarnings Total number of warnings found during the run. - * @param int $totalFixable Total number of problems that can be fixed. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. - * @param bool $interactive Are we running in interactive mode? - * @param bool $toScreen Is the report being printed to screen? - * - * @return void - */ - public function generate( - $cachedData, - $totalFiles, - $totalErrors, - $totalWarnings, - $totalFixable, - $showSources=false, - $width=80, - $interactive=false, - $toScreen=true - ) { - $lines = explode(PHP_EOL, $cachedData); - array_pop($lines); - - if (empty($lines) === true) { - return; - } - - $metrics = []; - foreach ($lines as $line) { - $parts = explode('>>', $line); - $metric = $parts[0]; - $value = $parts[1]; - $count = $parts[2]; - if (isset($metrics[$metric]) === false) { - $metrics[$metric] = []; - } - - if (isset($metrics[$metric][$value]) === false) { - $metrics[$metric][$value] = $count; - } else { - $metrics[$metric][$value] += $count; - } - } - - ksort($metrics); - - echo PHP_EOL."\033[1m".'PHP CODE SNIFFER INFORMATION REPORT'."\033[0m".PHP_EOL; - echo str_repeat('-', 70).PHP_EOL; - - foreach ($metrics as $metric => $values) { - if (count($values) === 1) { - $count = reset($values); - $value = key($values); - - echo "$metric: \033[4m$value\033[0m [$count/$count, 100%]".PHP_EOL; - } else { - $totalCount = 0; - $valueWidth = 0; - foreach ($values as $value => $count) { - $totalCount += $count; - $valueWidth = max($valueWidth, strlen($value)); - } - - // Length of the total string, plus however many - // thousands separators there are. - $countWidth = strlen($totalCount); - $thousandSeparatorCount = floor($countWidth / 3); - $countWidth += $thousandSeparatorCount; - - // Account for 'total' line. - $valueWidth = max(5, $valueWidth); - - echo "$metric:".PHP_EOL; - - ksort($values, SORT_NATURAL); - arsort($values); - - $percentPrefixWidth = 0; - $percentWidth = 6; - foreach ($values as $value => $count) { - $percent = round(($count / $totalCount * 100), 2); - $percentPrefix = ''; - if ($percent === 0.00) { - $percent = 0.01; - $percentPrefix = '<'; - $percentPrefixWidth = 2; - $percentWidth = 4; - } - - printf( - "\t%-{$valueWidth}s => %{$countWidth}s (%{$percentPrefixWidth}s%{$percentWidth}.2f%%)".PHP_EOL, - $value, - number_format($count), - $percentPrefix, - $percent - ); - } - - echo "\t".str_repeat('-', ($valueWidth + $countWidth + 15)).PHP_EOL; - printf( - "\t%-{$valueWidth}s => %{$countWidth}s (100.00%%)".PHP_EOL, - 'total', - number_format($totalCount) - ); - }//end if - - echo PHP_EOL; - }//end foreach - - echo str_repeat('-', 70).PHP_EOL; - - if ($toScreen === true && $interactive === false) { - Timing::printRunTime(); - } - - }//end generate() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Reports/Json.php b/vendor/squizlabs/php_codesniffer/src/Reports/Json.php deleted file mode 100644 index 59d8f30..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Reports/Json.php +++ /dev/null @@ -1,106 +0,0 @@ - - * @author Greg Sherwood - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Reports; - -use PHP_CodeSniffer\Files\File; - -class Json implements Report -{ - - - /** - * Generate a partial report for a single processed file. - * - * Function should return TRUE if it printed or stored data about the file - * and FALSE if it ignored the file. Returning TRUE indicates that the file and - * its data should be counted in the grand totals. - * - * @param array $report Prepared report data. - * @param \PHP_CodeSniffer\File $phpcsFile The file being reported on. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. - * - * @return bool - */ - public function generateFileReport($report, File $phpcsFile, $showSources=false, $width=80) - { - $filename = str_replace('\\', '\\\\', $report['filename']); - $filename = str_replace('"', '\"', $filename); - $filename = str_replace('/', '\/', $filename); - echo '"'.$filename.'":{'; - echo '"errors":'.$report['errors'].',"warnings":'.$report['warnings'].',"messages":['; - - $messages = ''; - foreach ($report['messages'] as $line => $lineErrors) { - foreach ($lineErrors as $column => $colErrors) { - foreach ($colErrors as $error) { - $error['message'] = str_replace("\n", '\n', $error['message']); - $error['message'] = str_replace("\r", '\r', $error['message']); - $error['message'] = str_replace("\t", '\t', $error['message']); - - $fixable = false; - if ($error['fixable'] === true) { - $fixable = true; - } - - $messagesObject = (object) $error; - $messagesObject->line = $line; - $messagesObject->column = $column; - $messagesObject->fixable = $fixable; - - $messages .= json_encode($messagesObject).","; - } - } - }//end foreach - - echo rtrim($messages, ','); - echo ']},'; - - return true; - - }//end generateFileReport() - - - /** - * Generates a JSON report. - * - * @param string $cachedData Any partial report data that was returned from - * generateFileReport during the run. - * @param int $totalFiles Total number of files processed during the run. - * @param int $totalErrors Total number of errors found during the run. - * @param int $totalWarnings Total number of warnings found during the run. - * @param int $totalFixable Total number of problems that can be fixed. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. - * @param bool $interactive Are we running in interactive mode? - * @param bool $toScreen Is the report being printed to screen? - * - * @return void - */ - public function generate( - $cachedData, - $totalFiles, - $totalErrors, - $totalWarnings, - $totalFixable, - $showSources=false, - $width=80, - $interactive=false, - $toScreen=true - ) { - echo '{"totals":{"errors":'.$totalErrors.',"warnings":'.$totalWarnings.',"fixable":'.$totalFixable.'},"files":{'; - echo rtrim($cachedData, ','); - echo "}}".PHP_EOL; - - }//end generate() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Reports/Junit.php b/vendor/squizlabs/php_codesniffer/src/Reports/Junit.php deleted file mode 100644 index d3ede61..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Reports/Junit.php +++ /dev/null @@ -1,131 +0,0 @@ - - * @author Greg Sherwood - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Reports; - -use PHP_CodeSniffer\Config; -use PHP_CodeSniffer\Files\File; - -class Junit implements Report -{ - - - /** - * Generate a partial report for a single processed file. - * - * Function should return TRUE if it printed or stored data about the file - * and FALSE if it ignored the file. Returning TRUE indicates that the file and - * its data should be counted in the grand totals. - * - * @param array $report Prepared report data. - * @param \PHP_CodeSniffer\File $phpcsFile The file being reported on. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. - * - * @return bool - */ - public function generateFileReport($report, File $phpcsFile, $showSources=false, $width=80) - { - $out = new \XMLWriter; - $out->openMemory(); - $out->setIndent(true); - - $out->startElement('testsuite'); - $out->writeAttribute('name', $report['filename']); - $out->writeAttribute('errors', 0); - - if (count($report['messages']) === 0) { - $out->writeAttribute('tests', 1); - $out->writeAttribute('failures', 0); - - $out->startElement('testcase'); - $out->writeAttribute('name', $report['filename']); - $out->endElement(); - } else { - $failures = ($report['errors'] + $report['warnings']); - $out->writeAttribute('tests', $failures); - $out->writeAttribute('failures', $failures); - - foreach ($report['messages'] as $line => $lineErrors) { - foreach ($lineErrors as $column => $colErrors) { - foreach ($colErrors as $error) { - $out->startElement('testcase'); - $out->writeAttribute('name', $error['source'].' at '.$report['filename']." ($line:$column)"); - - $error['type'] = strtolower($error['type']); - if ($phpcsFile->config->encoding !== 'utf-8') { - $error['message'] = iconv($phpcsFile->config->encoding, 'utf-8', $error['message']); - } - - $out->startElement('failure'); - $out->writeAttribute('type', $error['type']); - $out->writeAttribute('message', $error['message']); - $out->endElement(); - - $out->endElement(); - } - } - } - }//end if - - $out->endElement(); - echo $out->flush(); - return true; - - }//end generateFileReport() - - - /** - * Prints all violations for processed files, in a proprietary XML format. - * - * @param string $cachedData Any partial report data that was returned from - * generateFileReport during the run. - * @param int $totalFiles Total number of files processed during the run. - * @param int $totalErrors Total number of errors found during the run. - * @param int $totalWarnings Total number of warnings found during the run. - * @param int $totalFixable Total number of problems that can be fixed. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. - * @param bool $interactive Are we running in interactive mode? - * @param bool $toScreen Is the report being printed to screen? - * - * @return void - */ - public function generate( - $cachedData, - $totalFiles, - $totalErrors, - $totalWarnings, - $totalFixable, - $showSources=false, - $width=80, - $interactive=false, - $toScreen=true - ) { - // Figure out the total number of tests. - $tests = 0; - $matches = []; - preg_match_all('/tests="([0-9]+)"/', $cachedData, $matches); - if (isset($matches[1]) === true) { - foreach ($matches[1] as $match) { - $tests += $match; - } - } - - $failures = ($totalErrors + $totalWarnings); - echo ''.PHP_EOL; - echo ''.PHP_EOL; - echo $cachedData; - echo ''.PHP_EOL; - - }//end generate() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Reports/Notifysend.php b/vendor/squizlabs/php_codesniffer/src/Reports/Notifysend.php deleted file mode 100644 index 0841662..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Reports/Notifysend.php +++ /dev/null @@ -1,242 +0,0 @@ - - * @author Greg Sherwood - * @copyright 2012-2014 Christian Weiske - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Reports; - -use PHP_CodeSniffer\Config; -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Util\Common; - -class Notifysend implements Report -{ - - /** - * Notification timeout in milliseconds. - * - * @var integer - */ - protected $timeout = 3000; - - /** - * Path to notify-send command. - * - * @var string - */ - protected $path = 'notify-send'; - - /** - * Show "ok, all fine" messages. - * - * @var boolean - */ - protected $showOk = true; - - /** - * Version of installed notify-send executable. - * - * @var string - */ - protected $version = null; - - - /** - * Load configuration data. - */ - public function __construct() - { - $path = Config::getExecutablePath('notifysend'); - if ($path !== null) { - $this->path = Common::escapeshellcmd($path); - } - - $timeout = Config::getConfigData('notifysend_timeout'); - if ($timeout !== null) { - $this->timeout = (int) $timeout; - } - - $showOk = Config::getConfigData('notifysend_showok'); - if ($showOk !== null) { - $this->showOk = (bool) $showOk; - } - - $this->version = str_replace( - 'notify-send ', - '', - exec($this->path.' --version') - ); - - }//end __construct() - - - /** - * Generate a partial report for a single processed file. - * - * Function should return TRUE if it printed or stored data about the file - * and FALSE if it ignored the file. Returning TRUE indicates that the file and - * its data should be counted in the grand totals. - * - * @param array $report Prepared report data. - * @param \PHP_CodeSniffer\File $phpcsFile The file being reported on. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. - * - * @return bool - */ - public function generateFileReport($report, File $phpcsFile, $showSources=false, $width=80) - { - echo $report['filename'].PHP_EOL; - - // We want this file counted in the total number - // of checked files even if it has no errors. - return true; - - }//end generateFileReport() - - - /** - * Generates a summary of errors and warnings for each file processed. - * - * @param string $cachedData Any partial report data that was returned from - * generateFileReport during the run. - * @param int $totalFiles Total number of files processed during the run. - * @param int $totalErrors Total number of errors found during the run. - * @param int $totalWarnings Total number of warnings found during the run. - * @param int $totalFixable Total number of problems that can be fixed. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. - * @param bool $interactive Are we running in interactive mode? - * @param bool $toScreen Is the report being printed to screen? - * - * @return void - */ - public function generate( - $cachedData, - $totalFiles, - $totalErrors, - $totalWarnings, - $totalFixable, - $showSources=false, - $width=80, - $interactive=false, - $toScreen=true - ) { - $checkedFiles = explode(PHP_EOL, trim($cachedData)); - - $msg = $this->generateMessage($checkedFiles, $totalErrors, $totalWarnings); - if ($msg === null) { - if ($this->showOk === true) { - $this->notifyAllFine(); - } - } else { - $this->notifyErrors($msg); - } - - }//end generate() - - - /** - * Generate the error message to show to the user. - * - * @param string[] $checkedFiles The files checked during the run. - * @param int $totalErrors Total number of errors found during the run. - * @param int $totalWarnings Total number of warnings found during the run. - * - * @return string Error message or NULL if no error/warning found. - */ - protected function generateMessage($checkedFiles, $totalErrors, $totalWarnings) - { - if ($totalErrors === 0 && $totalWarnings === 0) { - // Nothing to print. - return null; - } - - $totalFiles = count($checkedFiles); - - $msg = ''; - if ($totalFiles > 1) { - $msg .= 'Checked '.$totalFiles.' files'.PHP_EOL; - } else { - $msg .= $checkedFiles[0].PHP_EOL; - } - - if ($totalWarnings > 0) { - $msg .= $totalWarnings.' warnings'.PHP_EOL; - } - - if ($totalErrors > 0) { - $msg .= $totalErrors.' errors'.PHP_EOL; - } - - return $msg; - - }//end generateMessage() - - - /** - * Tell the user that all is fine and no error/warning has been found. - * - * @return void - */ - protected function notifyAllFine() - { - $cmd = $this->getBasicCommand(); - $cmd .= ' -i info'; - $cmd .= ' "PHP CodeSniffer: Ok"'; - $cmd .= ' "All fine"'; - exec($cmd); - - }//end notifyAllFine() - - - /** - * Tell the user that errors/warnings have been found. - * - * @param string $msg Message to display. - * - * @return void - */ - protected function notifyErrors($msg) - { - $cmd = $this->getBasicCommand(); - $cmd .= ' -i error'; - $cmd .= ' "PHP CodeSniffer: Error"'; - $cmd .= ' '.escapeshellarg(trim($msg)); - exec($cmd); - - }//end notifyErrors() - - - /** - * Generate and return the basic notify-send command string to execute. - * - * @return string Shell command with common parameters. - */ - protected function getBasicCommand() - { - $cmd = $this->path; - $cmd .= ' --category dev.validate'; - $cmd .= ' -h int:transient:1'; - $cmd .= ' -t '.(int) $this->timeout; - if (version_compare($this->version, '0.7.3', '>=') === true) { - $cmd .= ' -a phpcs'; - } - - return $cmd; - - }//end getBasicCommand() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Reports/Report.php b/vendor/squizlabs/php_codesniffer/src/Reports/Report.php deleted file mode 100644 index 38f8a62..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Reports/Report.php +++ /dev/null @@ -1,64 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Reports; - -use PHP_CodeSniffer\Files\File; - -interface Report -{ - - - /** - * Generate a partial report for a single processed file. - * - * Function should return TRUE if it printed or stored data about the file - * and FALSE if it ignored the file. Returning TRUE indicates that the file and - * its data should be counted in the grand totals. - * - * @param array $report Prepared report data. - * @param \PHP_CodeSniffer\File $phpcsFile The file being reported on. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. - * - * @return bool - */ - public function generateFileReport($report, File $phpcsFile, $showSources=false, $width=80); - - - /** - * Generate the actual report. - * - * @param string $cachedData Any partial report data that was returned from - * generateFileReport during the run. - * @param int $totalFiles Total number of files processed during the run. - * @param int $totalErrors Total number of errors found during the run. - * @param int $totalWarnings Total number of warnings found during the run. - * @param int $totalFixable Total number of problems that can be fixed. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. - * @param bool $interactive Are we running in interactive mode? - * @param bool $toScreen Is the report being printed to screen? - * - * @return void - */ - public function generate( - $cachedData, - $totalFiles, - $totalErrors, - $totalWarnings, - $totalFixable, - $showSources=false, - $width=80, - $interactive=false, - $toScreen=true - ); - - -}//end interface diff --git a/vendor/squizlabs/php_codesniffer/src/Reports/Source.php b/vendor/squizlabs/php_codesniffer/src/Reports/Source.php deleted file mode 100644 index ce8c3cf..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Reports/Source.php +++ /dev/null @@ -1,336 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Reports; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Util\Timing; - -class Source implements Report -{ - - - /** - * Generate a partial report for a single processed file. - * - * Function should return TRUE if it printed or stored data about the file - * and FALSE if it ignored the file. Returning TRUE indicates that the file and - * its data should be counted in the grand totals. - * - * @param array $report Prepared report data. - * @param \PHP_CodeSniffer\File $phpcsFile The file being reported on. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. - * - * @return bool - */ - public function generateFileReport($report, File $phpcsFile, $showSources=false, $width=80) - { - if ($report['errors'] === 0 && $report['warnings'] === 0) { - // Nothing to print. - return false; - } - - $sources = []; - - foreach ($report['messages'] as $line => $lineErrors) { - foreach ($lineErrors as $column => $colErrors) { - foreach ($colErrors as $error) { - $src = $error['source']; - if (isset($sources[$src]) === false) { - $sources[$src] = [ - 'fixable' => (int) $error['fixable'], - 'count' => 1, - ]; - } else { - $sources[$src]['count']++; - } - } - } - } - - foreach ($sources as $source => $data) { - echo $source.'>>'.$data['fixable'].'>>'.$data['count'].PHP_EOL; - } - - return true; - - }//end generateFileReport() - - - /** - * Prints the source of all errors and warnings. - * - * @param string $cachedData Any partial report data that was returned from - * generateFileReport during the run. - * @param int $totalFiles Total number of files processed during the run. - * @param int $totalErrors Total number of errors found during the run. - * @param int $totalWarnings Total number of warnings found during the run. - * @param int $totalFixable Total number of problems that can be fixed. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. - * @param bool $interactive Are we running in interactive mode? - * @param bool $toScreen Is the report being printed to screen? - * - * @return void - */ - public function generate( - $cachedData, - $totalFiles, - $totalErrors, - $totalWarnings, - $totalFixable, - $showSources=false, - $width=80, - $interactive=false, - $toScreen=true - ) { - $lines = explode(PHP_EOL, $cachedData); - array_pop($lines); - - if (empty($lines) === true) { - return; - } - - $sources = []; - $maxLength = 0; - - foreach ($lines as $line) { - $parts = explode('>>', $line); - $source = $parts[0]; - $fixable = (bool) $parts[1]; - $count = $parts[2]; - - if (isset($sources[$source]) === false) { - if ($showSources === true) { - $parts = null; - $sniff = $source; - } else { - $parts = explode('.', $source); - if ($parts[0] === 'Internal') { - $parts[2] = $parts[1]; - $parts[1] = ''; - } - - $parts[1] = $this->makeFriendlyName($parts[1]); - - $sniff = $this->makeFriendlyName($parts[2]); - if (isset($parts[3]) === true) { - $name = $this->makeFriendlyName($parts[3]); - $name[0] = strtolower($name[0]); - $sniff .= ' '.$name; - unset($parts[3]); - } - - $parts[2] = $sniff; - }//end if - - $maxLength = max($maxLength, strlen($sniff)); - - $sources[$source] = [ - 'count' => $count, - 'fixable' => $fixable, - 'parts' => $parts, - ]; - } else { - $sources[$source]['count'] += $count; - }//end if - }//end foreach - - if ($showSources === true) { - $width = min($width, ($maxLength + 11)); - } else { - $width = min($width, ($maxLength + 41)); - } - - $width = max($width, 70); - - // Sort the data based on counts and source code. - $sourceCodes = array_keys($sources); - $counts = []; - foreach ($sources as $source => $data) { - $counts[$source] = $data['count']; - } - - array_multisort($counts, SORT_DESC, $sourceCodes, SORT_ASC, SORT_NATURAL, $sources); - - echo PHP_EOL."\033[1mPHP CODE SNIFFER VIOLATION SOURCE SUMMARY\033[0m".PHP_EOL; - echo str_repeat('-', $width).PHP_EOL."\033[1m"; - if ($showSources === true) { - if ($totalFixable > 0) { - echo ' SOURCE'.str_repeat(' ', ($width - 15)).'COUNT'.PHP_EOL; - } else { - echo 'SOURCE'.str_repeat(' ', ($width - 11)).'COUNT'.PHP_EOL; - } - } else { - if ($totalFixable > 0) { - echo ' STANDARD CATEGORY SNIFF'.str_repeat(' ', ($width - 44)).'COUNT'.PHP_EOL; - } else { - echo 'STANDARD CATEGORY SNIFF'.str_repeat(' ', ($width - 40)).'COUNT'.PHP_EOL; - } - } - - echo "\033[0m".str_repeat('-', $width).PHP_EOL; - - $fixableSources = 0; - - if ($showSources === true) { - $maxSniffWidth = ($width - 7); - } else { - $maxSniffWidth = ($width - 37); - } - - if ($totalFixable > 0) { - $maxSniffWidth -= 4; - } - - foreach ($sources as $source => $sourceData) { - if ($totalFixable > 0) { - echo '['; - if ($sourceData['fixable'] === true) { - echo 'x'; - $fixableSources++; - } else { - echo ' '; - } - - echo '] '; - } - - if ($showSources === true) { - if (strlen($source) > $maxSniffWidth) { - $source = substr($source, 0, $maxSniffWidth); - } - - echo $source; - if ($totalFixable > 0) { - echo str_repeat(' ', ($width - 9 - strlen($source))); - } else { - echo str_repeat(' ', ($width - 5 - strlen($source))); - } - } else { - $parts = $sourceData['parts']; - - if (strlen($parts[0]) > 8) { - $parts[0] = substr($parts[0], 0, ((strlen($parts[0]) - 8) * -1)); - } - - echo $parts[0].str_repeat(' ', (10 - strlen($parts[0]))); - - $category = $parts[1]; - if (strlen($category) > 18) { - $category = substr($category, 0, ((strlen($category) - 18) * -1)); - } - - echo $category.str_repeat(' ', (20 - strlen($category))); - - $sniff = $parts[2]; - if (strlen($sniff) > $maxSniffWidth) { - $sniff = substr($sniff, 0, $maxSniffWidth); - } - - if ($totalFixable > 0) { - echo $sniff.str_repeat(' ', ($width - 39 - strlen($sniff))); - } else { - echo $sniff.str_repeat(' ', ($width - 35 - strlen($sniff))); - } - }//end if - - echo $sourceData['count'].PHP_EOL; - }//end foreach - - echo str_repeat('-', $width).PHP_EOL; - echo "\033[1m".'A TOTAL OF '.($totalErrors + $totalWarnings).' SNIFF VIOLATION'; - if (($totalErrors + $totalWarnings) > 1) { - echo 'S'; - } - - echo ' WERE FOUND IN '.count($sources).' SOURCE'; - if (count($sources) !== 1) { - echo 'S'; - } - - echo "\033[0m"; - - if ($totalFixable > 0) { - echo PHP_EOL.str_repeat('-', $width).PHP_EOL; - echo "\033[1mPHPCBF CAN FIX THE $fixableSources MARKED SOURCES AUTOMATICALLY ($totalFixable VIOLATIONS IN TOTAL)\033[0m"; - } - - echo PHP_EOL.str_repeat('-', $width).PHP_EOL.PHP_EOL; - - if ($toScreen === true && $interactive === false) { - Timing::printRunTime(); - } - - }//end generate() - - - /** - * Converts a camel caps name into a readable string. - * - * @param string $name The camel caps name to convert. - * - * @return string - */ - public function makeFriendlyName($name) - { - if (trim($name) === '') { - return ''; - } - - $friendlyName = ''; - $length = strlen($name); - - $lastWasUpper = false; - $lastWasNumeric = false; - for ($i = 0; $i < $length; $i++) { - if (is_numeric($name[$i]) === true) { - if ($lastWasNumeric === false) { - $friendlyName .= ' '; - } - - $lastWasUpper = false; - $lastWasNumeric = true; - } else { - $lastWasNumeric = false; - - $char = strtolower($name[$i]); - if ($char === $name[$i]) { - // Lowercase. - $lastWasUpper = false; - } else { - // Uppercase. - if ($lastWasUpper === false) { - $friendlyName .= ' '; - if ($i < ($length - 1)) { - $next = $name[($i + 1)]; - if (strtolower($next) === $next) { - // Next char is lowercase so it is a word boundary. - $name[$i] = strtolower($name[$i]); - } - } - } - - $lastWasUpper = true; - } - }//end if - - $friendlyName .= $name[$i]; - }//end for - - $friendlyName = trim($friendlyName); - $friendlyName[0] = strtoupper($friendlyName[0]); - - return $friendlyName; - - }//end makeFriendlyName() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Reports/Summary.php b/vendor/squizlabs/php_codesniffer/src/Reports/Summary.php deleted file mode 100644 index 8fe18e7..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Reports/Summary.php +++ /dev/null @@ -1,183 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Reports; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Util; - -class Summary implements Report -{ - - - /** - * Generate a partial report for a single processed file. - * - * Function should return TRUE if it printed or stored data about the file - * and FALSE if it ignored the file. Returning TRUE indicates that the file and - * its data should be counted in the grand totals. - * - * @param array $report Prepared report data. - * @param \PHP_CodeSniffer\File $phpcsFile The file being reported on. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. - * - * @return bool - */ - public function generateFileReport($report, File $phpcsFile, $showSources=false, $width=80) - { - if (PHP_CODESNIFFER_VERBOSITY === 0 - && $report['errors'] === 0 - && $report['warnings'] === 0 - ) { - // Nothing to print. - return false; - } - - echo $report['filename'].'>>'.$report['errors'].'>>'.$report['warnings'].PHP_EOL; - return true; - - }//end generateFileReport() - - - /** - * Generates a summary of errors and warnings for each file processed. - * - * @param string $cachedData Any partial report data that was returned from - * generateFileReport during the run. - * @param int $totalFiles Total number of files processed during the run. - * @param int $totalErrors Total number of errors found during the run. - * @param int $totalWarnings Total number of warnings found during the run. - * @param int $totalFixable Total number of problems that can be fixed. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. - * @param bool $interactive Are we running in interactive mode? - * @param bool $toScreen Is the report being printed to screen? - * - * @return void - */ - public function generate( - $cachedData, - $totalFiles, - $totalErrors, - $totalWarnings, - $totalFixable, - $showSources=false, - $width=80, - $interactive=false, - $toScreen=true - ) { - $lines = explode(PHP_EOL, $cachedData); - array_pop($lines); - - if (empty($lines) === true) { - return; - } - - $reportFiles = []; - $maxLength = 0; - - foreach ($lines as $line) { - $parts = explode('>>', $line); - $fileLen = strlen($parts[0]); - $reportFiles[$parts[0]] = [ - 'errors' => $parts[1], - 'warnings' => $parts[2], - 'strlen' => $fileLen, - ]; - - $maxLength = max($maxLength, $fileLen); - } - - uksort( - $reportFiles, - function ($keyA, $keyB) { - $pathPartsA = explode(DIRECTORY_SEPARATOR, $keyA); - $pathPartsB = explode(DIRECTORY_SEPARATOR, $keyB); - - do { - $partA = array_shift($pathPartsA); - $partB = array_shift($pathPartsB); - } while ($partA === $partB && empty($pathPartsA) === false && empty($pathPartsB) === false); - - if (empty($pathPartsA) === false && empty($pathPartsB) === true) { - return 1; - } else if (empty($pathPartsA) === true && empty($pathPartsB) === false) { - return -1; - } else { - return strcasecmp($partA, $partB); - } - } - ); - - $width = min($width, ($maxLength + 21)); - $width = max($width, 70); - - echo PHP_EOL."\033[1m".'PHP CODE SNIFFER REPORT SUMMARY'."\033[0m".PHP_EOL; - echo str_repeat('-', $width).PHP_EOL; - echo "\033[1m".'FILE'.str_repeat(' ', ($width - 20)).'ERRORS WARNINGS'."\033[0m".PHP_EOL; - echo str_repeat('-', $width).PHP_EOL; - - foreach ($reportFiles as $file => $data) { - $padding = ($width - 18 - $data['strlen']); - if ($padding < 0) { - $file = '...'.substr($file, (($padding * -1) + 3)); - $padding = 0; - } - - echo $file.str_repeat(' ', $padding).' '; - if ($data['errors'] !== 0) { - echo "\033[31m".$data['errors']."\033[0m"; - echo str_repeat(' ', (8 - strlen((string) $data['errors']))); - } else { - echo '0 '; - } - - if ($data['warnings'] !== 0) { - echo "\033[33m".$data['warnings']."\033[0m"; - } else { - echo '0'; - } - - echo PHP_EOL; - }//end foreach - - echo str_repeat('-', $width).PHP_EOL; - echo "\033[1mA TOTAL OF $totalErrors ERROR"; - if ($totalErrors !== 1) { - echo 'S'; - } - - echo ' AND '.$totalWarnings.' WARNING'; - if ($totalWarnings !== 1) { - echo 'S'; - } - - echo ' WERE FOUND IN '.$totalFiles.' FILE'; - if ($totalFiles !== 1) { - echo 'S'; - } - - echo "\033[0m"; - - if ($totalFixable > 0) { - echo PHP_EOL.str_repeat('-', $width).PHP_EOL; - echo "\033[1mPHPCBF CAN FIX $totalFixable OF THESE SNIFF VIOLATIONS AUTOMATICALLY\033[0m"; - } - - echo PHP_EOL.str_repeat('-', $width).PHP_EOL.PHP_EOL; - - if ($toScreen === true && $interactive === false) { - Util\Timing::printRunTime(); - } - - }//end generate() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Reports/Svnblame.php b/vendor/squizlabs/php_codesniffer/src/Reports/Svnblame.php deleted file mode 100644 index f4719fe..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Reports/Svnblame.php +++ /dev/null @@ -1,73 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Reports; - -use PHP_CodeSniffer\Exceptions\DeepExitException; - -class Svnblame extends VersionControl -{ - - /** - * The name of the report we want in the output - * - * @var string - */ - protected $reportName = 'SVN'; - - - /** - * Extract the author from a blame line. - * - * @param string $line Line to parse. - * - * @return mixed string or false if impossible to recover. - */ - protected function getAuthor($line) - { - $blameParts = []; - preg_match('|\s*([^\s]+)\s+([^\s]+)|', $line, $blameParts); - - if (isset($blameParts[2]) === false) { - return false; - } - - return $blameParts[2]; - - }//end getAuthor() - - - /** - * Gets the blame output. - * - * @param string $filename File to blame. - * - * @return array - * @throws \PHP_CodeSniffer\Exceptions\DeepExitException - */ - protected function getBlameContent($filename) - { - $command = 'svn blame "'.$filename.'" 2>&1'; - $handle = popen($command, 'r'); - if ($handle === false) { - $error = 'ERROR: Could not execute "'.$command.'"'.PHP_EOL.PHP_EOL; - throw new DeepExitException($error, 3); - } - - $rawContent = stream_get_contents($handle); - fclose($handle); - - $blames = explode("\n", $rawContent); - - return $blames; - - }//end getBlameContent() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Reports/VersionControl.php b/vendor/squizlabs/php_codesniffer/src/Reports/VersionControl.php deleted file mode 100644 index 0f41456..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Reports/VersionControl.php +++ /dev/null @@ -1,376 +0,0 @@ - - * @author Greg Sherwood - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Reports; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Util\Timing; - -abstract class VersionControl implements Report -{ - - /** - * The name of the report we want in the output. - * - * @var string - */ - protected $reportName = 'VERSION CONTROL'; - - - /** - * Generate a partial report for a single processed file. - * - * Function should return TRUE if it printed or stored data about the file - * and FALSE if it ignored the file. Returning TRUE indicates that the file and - * its data should be counted in the grand totals. - * - * @param array $report Prepared report data. - * @param \PHP_CodeSniffer\File $phpcsFile The file being reported on. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. - * - * @return bool - */ - public function generateFileReport($report, File $phpcsFile, $showSources=false, $width=80) - { - $blames = $this->getBlameContent($report['filename']); - - $authorCache = []; - $praiseCache = []; - $sourceCache = []; - - foreach ($report['messages'] as $line => $lineErrors) { - $author = 'Unknown'; - if (isset($blames[($line - 1)]) === true) { - $blameAuthor = $this->getAuthor($blames[($line - 1)]); - if ($blameAuthor !== false) { - $author = $blameAuthor; - } - } - - if (isset($authorCache[$author]) === false) { - $authorCache[$author] = 0; - $praiseCache[$author] = [ - 'good' => 0, - 'bad' => 0, - ]; - } - - $praiseCache[$author]['bad']++; - - foreach ($lineErrors as $column => $colErrors) { - foreach ($colErrors as $error) { - $authorCache[$author]++; - - if ($showSources === true) { - $source = $error['source']; - if (isset($sourceCache[$author][$source]) === false) { - $sourceCache[$author][$source] = [ - 'count' => 1, - 'fixable' => $error['fixable'], - ]; - } else { - $sourceCache[$author][$source]['count']++; - } - } - } - } - - unset($blames[($line - 1)]); - }//end foreach - - // Now go through and give the authors some credit for - // all the lines that do not have errors. - foreach ($blames as $line) { - $author = $this->getAuthor($line); - if ($author === false) { - $author = 'Unknown'; - } - - if (isset($authorCache[$author]) === false) { - // This author doesn't have any errors. - if (PHP_CODESNIFFER_VERBOSITY === 0) { - continue; - } - - $authorCache[$author] = 0; - $praiseCache[$author] = [ - 'good' => 0, - 'bad' => 0, - ]; - } - - $praiseCache[$author]['good']++; - }//end foreach - - foreach ($authorCache as $author => $errors) { - echo "AUTHOR>>$author>>$errors".PHP_EOL; - } - - foreach ($praiseCache as $author => $praise) { - echo "PRAISE>>$author>>".$praise['good'].'>>'.$praise['bad'].PHP_EOL; - } - - foreach ($sourceCache as $author => $sources) { - foreach ($sources as $source => $sourceData) { - $count = $sourceData['count']; - $fixable = (int) $sourceData['fixable']; - echo "SOURCE>>$author>>$source>>$count>>$fixable".PHP_EOL; - } - } - - return true; - - }//end generateFileReport() - - - /** - * Prints the author of all errors and warnings, as given by "version control blame". - * - * @param string $cachedData Any partial report data that was returned from - * generateFileReport during the run. - * @param int $totalFiles Total number of files processed during the run. - * @param int $totalErrors Total number of errors found during the run. - * @param int $totalWarnings Total number of warnings found during the run. - * @param int $totalFixable Total number of problems that can be fixed. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. - * @param bool $interactive Are we running in interactive mode? - * @param bool $toScreen Is the report being printed to screen? - * - * @return void - */ - public function generate( - $cachedData, - $totalFiles, - $totalErrors, - $totalWarnings, - $totalFixable, - $showSources=false, - $width=80, - $interactive=false, - $toScreen=true - ) { - $errorsShown = ($totalErrors + $totalWarnings); - if ($errorsShown === 0) { - // Nothing to show. - return; - } - - $lines = explode(PHP_EOL, $cachedData); - array_pop($lines); - - if (empty($lines) === true) { - return; - } - - $authorCache = []; - $praiseCache = []; - $sourceCache = []; - - foreach ($lines as $line) { - $parts = explode('>>', $line); - switch ($parts[0]) { - case 'AUTHOR': - if (isset($authorCache[$parts[1]]) === false) { - $authorCache[$parts[1]] = $parts[2]; - } else { - $authorCache[$parts[1]] += $parts[2]; - } - break; - case 'PRAISE': - if (isset($praiseCache[$parts[1]]) === false) { - $praiseCache[$parts[1]] = [ - 'good' => $parts[2], - 'bad' => $parts[3], - ]; - } else { - $praiseCache[$parts[1]]['good'] += $parts[2]; - $praiseCache[$parts[1]]['bad'] += $parts[3]; - } - break; - case 'SOURCE': - if (isset($praiseCache[$parts[1]]) === false) { - $praiseCache[$parts[1]] = []; - } - - if (isset($sourceCache[$parts[1]][$parts[2]]) === false) { - $sourceCache[$parts[1]][$parts[2]] = [ - 'count' => $parts[3], - 'fixable' => (bool) $parts[4], - ]; - } else { - $sourceCache[$parts[1]][$parts[2]]['count'] += $parts[3]; - } - break; - default: - break; - }//end switch - }//end foreach - - // Make sure the report width isn't too big. - $maxLength = 0; - foreach ($authorCache as $author => $count) { - $maxLength = max($maxLength, strlen($author)); - if ($showSources === true && isset($sourceCache[$author]) === true) { - foreach ($sourceCache[$author] as $source => $sourceData) { - if ($source === 'count') { - continue; - } - - $maxLength = max($maxLength, (strlen($source) + 9)); - } - } - } - - $width = min($width, ($maxLength + 30)); - $width = max($width, 70); - arsort($authorCache); - - echo PHP_EOL."\033[1m".'PHP CODE SNIFFER '.$this->reportName.' BLAME SUMMARY'."\033[0m".PHP_EOL; - echo str_repeat('-', $width).PHP_EOL."\033[1m"; - if ($showSources === true) { - echo 'AUTHOR SOURCE'.str_repeat(' ', ($width - 43)).'(Author %) (Overall %) COUNT'.PHP_EOL; - echo str_repeat('-', $width).PHP_EOL; - } else { - echo 'AUTHOR'.str_repeat(' ', ($width - 34)).'(Author %) (Overall %) COUNT'.PHP_EOL; - echo str_repeat('-', $width).PHP_EOL; - } - - echo "\033[0m"; - - if ($showSources === true) { - $maxSniffWidth = ($width - 15); - - if ($totalFixable > 0) { - $maxSniffWidth -= 4; - } - } - - $fixableSources = 0; - - foreach ($authorCache as $author => $count) { - if ($praiseCache[$author]['good'] === 0) { - $percent = 0; - } else { - $total = ($praiseCache[$author]['bad'] + $praiseCache[$author]['good']); - $percent = round(($praiseCache[$author]['bad'] / $total * 100), 2); - } - - $overallPercent = '('.round((($count / $errorsShown) * 100), 2).')'; - $authorPercent = '('.$percent.')'; - $line = str_repeat(' ', (6 - strlen($count))).$count; - $line = str_repeat(' ', (12 - strlen($overallPercent))).$overallPercent.$line; - $line = str_repeat(' ', (11 - strlen($authorPercent))).$authorPercent.$line; - $line = $author.str_repeat(' ', ($width - strlen($author) - strlen($line))).$line; - - if ($showSources === true) { - $line = "\033[1m$line\033[0m"; - } - - echo $line.PHP_EOL; - - if ($showSources === true && isset($sourceCache[$author]) === true) { - $errors = $sourceCache[$author]; - asort($errors); - $errors = array_reverse($errors); - - foreach ($errors as $source => $sourceData) { - if ($source === 'count') { - continue; - } - - $count = $sourceData['count']; - - $srcLength = strlen($source); - if ($srcLength > $maxSniffWidth) { - $source = substr($source, 0, $maxSniffWidth); - } - - $line = str_repeat(' ', (5 - strlen($count))).$count; - - echo ' '; - if ($totalFixable > 0) { - echo '['; - if ($sourceData['fixable'] === true) { - echo 'x'; - $fixableSources++; - } else { - echo ' '; - } - - echo '] '; - } - - echo $source; - if ($totalFixable > 0) { - echo str_repeat(' ', ($width - 18 - strlen($source))); - } else { - echo str_repeat(' ', ($width - 14 - strlen($source))); - } - - echo $line.PHP_EOL; - }//end foreach - }//end if - }//end foreach - - echo str_repeat('-', $width).PHP_EOL; - echo "\033[1m".'A TOTAL OF '.$errorsShown.' SNIFF VIOLATION'; - if ($errorsShown !== 1) { - echo 'S'; - } - - echo ' WERE COMMITTED BY '.count($authorCache).' AUTHOR'; - if (count($authorCache) !== 1) { - echo 'S'; - } - - echo "\033[0m"; - - if ($totalFixable > 0) { - if ($showSources === true) { - echo PHP_EOL.str_repeat('-', $width).PHP_EOL; - echo "\033[1mPHPCBF CAN FIX THE $fixableSources MARKED SOURCES AUTOMATICALLY ($totalFixable VIOLATIONS IN TOTAL)\033[0m"; - } else { - echo PHP_EOL.str_repeat('-', $width).PHP_EOL; - echo "\033[1mPHPCBF CAN FIX $totalFixable OF THESE SNIFF VIOLATIONS AUTOMATICALLY\033[0m"; - } - } - - echo PHP_EOL.str_repeat('-', $width).PHP_EOL.PHP_EOL; - - if ($toScreen === true && $interactive === false) { - Timing::printRunTime(); - } - - }//end generate() - - - /** - * Extract the author from a blame line. - * - * @param string $line Line to parse. - * - * @return mixed string or false if impossible to recover. - */ - abstract protected function getAuthor($line); - - - /** - * Gets the blame output. - * - * @param string $filename File to blame. - * - * @return array - */ - abstract protected function getBlameContent($filename); - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Reports/Xml.php b/vendor/squizlabs/php_codesniffer/src/Reports/Xml.php deleted file mode 100644 index 066383d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Reports/Xml.php +++ /dev/null @@ -1,126 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Reports; - -use PHP_CodeSniffer\Config; -use PHP_CodeSniffer\Files\File; - -class Xml implements Report -{ - - - /** - * Generate a partial report for a single processed file. - * - * Function should return TRUE if it printed or stored data about the file - * and FALSE if it ignored the file. Returning TRUE indicates that the file and - * its data should be counted in the grand totals. - * - * @param array $report Prepared report data. - * @param \PHP_CodeSniffer\File $phpcsFile The file being reported on. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. - * - * @return bool - */ - public function generateFileReport($report, File $phpcsFile, $showSources=false, $width=80) - { - $out = new \XMLWriter; - $out->openMemory(); - $out->setIndent(true); - $out->setIndentString(' '); - $out->startDocument('1.0', 'UTF-8'); - - if ($report['errors'] === 0 && $report['warnings'] === 0) { - // Nothing to print. - return false; - } - - $out->startElement('file'); - $out->writeAttribute('name', $report['filename']); - $out->writeAttribute('errors', $report['errors']); - $out->writeAttribute('warnings', $report['warnings']); - $out->writeAttribute('fixable', $report['fixable']); - - foreach ($report['messages'] as $line => $lineErrors) { - foreach ($lineErrors as $column => $colErrors) { - foreach ($colErrors as $error) { - $error['type'] = strtolower($error['type']); - if ($phpcsFile->config->encoding !== 'utf-8') { - $error['message'] = iconv($phpcsFile->config->encoding, 'utf-8', $error['message']); - } - - $out->startElement($error['type']); - $out->writeAttribute('line', $line); - $out->writeAttribute('column', $column); - $out->writeAttribute('source', $error['source']); - $out->writeAttribute('severity', $error['severity']); - $out->writeAttribute('fixable', (int) $error['fixable']); - $out->text($error['message']); - $out->endElement(); - } - } - }//end foreach - - $out->endElement(); - - // Remove the start of the document because we will - // add that manually later. We only have it in here to - // properly set the encoding. - $content = $out->flush(); - if (strpos($content, PHP_EOL) !== false) { - $content = substr($content, (strpos($content, PHP_EOL) + strlen(PHP_EOL))); - } else if (strpos($content, "\n") !== false) { - $content = substr($content, (strpos($content, "\n") + 1)); - } - - echo $content; - - return true; - - }//end generateFileReport() - - - /** - * Prints all violations for processed files, in a proprietary XML format. - * - * @param string $cachedData Any partial report data that was returned from - * generateFileReport during the run. - * @param int $totalFiles Total number of files processed during the run. - * @param int $totalErrors Total number of errors found during the run. - * @param int $totalWarnings Total number of warnings found during the run. - * @param int $totalFixable Total number of problems that can be fixed. - * @param bool $showSources Show sources? - * @param int $width Maximum allowed line width. - * @param bool $interactive Are we running in interactive mode? - * @param bool $toScreen Is the report being printed to screen? - * - * @return void - */ - public function generate( - $cachedData, - $totalFiles, - $totalErrors, - $totalWarnings, - $totalFixable, - $showSources=false, - $width=80, - $interactive=false, - $toScreen=true - ) { - echo ''.PHP_EOL; - echo ''.PHP_EOL; - echo $cachedData; - echo ''.PHP_EOL; - - }//end generate() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Ruleset.php b/vendor/squizlabs/php_codesniffer/src/Ruleset.php deleted file mode 100644 index 7e65970..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Ruleset.php +++ /dev/null @@ -1,1383 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer; - -use PHP_CodeSniffer\Exceptions\RuntimeException; -use PHP_CodeSniffer\Util; - -class Ruleset -{ - - /** - * The name of the coding standard being used. - * - * If a top-level standard includes other standards, or sniffs - * from other standards, only the name of the top-level standard - * will be stored in here. - * - * If multiple top-level standards are being loaded into - * a single ruleset object, this will store a comma separated list - * of the top-level standard names. - * - * @var string - */ - public $name = ''; - - /** - * A list of file paths for the ruleset files being used. - * - * @var string[] - */ - public $paths = []; - - /** - * A list of regular expressions used to ignore specific sniffs for files and folders. - * - * Is also used to set global exclude patterns. - * The key is the regular expression and the value is the type - * of ignore pattern (absolute or relative). - * - * @var array - */ - public $ignorePatterns = []; - - /** - * A list of regular expressions used to include specific sniffs for files and folders. - * - * The key is the sniff code and the value is an array with - * the key being a regular expression and the value is the type - * of ignore pattern (absolute or relative). - * - * @var array> - */ - public $includePatterns = []; - - /** - * An array of sniff objects that are being used to check files. - * - * The key is the fully qualified name of the sniff class - * and the value is the sniff object. - * - * @var array - */ - public $sniffs = []; - - /** - * A mapping of sniff codes to fully qualified class names. - * - * The key is the sniff code and the value - * is the fully qualified name of the sniff class. - * - * @var array - */ - public $sniffCodes = []; - - /** - * An array of token types and the sniffs that are listening for them. - * - * The key is the token name being listened for and the value - * is the sniff object. - * - * @var array - */ - public $tokenListeners = []; - - /** - * An array of rules from the ruleset.xml file. - * - * It may be empty, indicating that the ruleset does not override - * any of the default sniff settings. - * - * @var array - */ - public $ruleset = []; - - /** - * The directories that the processed rulesets are in. - * - * @var string[] - */ - protected $rulesetDirs = []; - - /** - * The config data for the run. - * - * @var \PHP_CodeSniffer\Config - */ - private $config = null; - - - /** - * Initialise the ruleset that the run will use. - * - * @param \PHP_CodeSniffer\Config $config The config data for the run. - * - * @return void - * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If no sniffs were registered. - */ - public function __construct(Config $config) - { - $this->config = $config; - $restrictions = $config->sniffs; - $exclusions = $config->exclude; - $sniffs = []; - - $standardPaths = []; - foreach ($config->standards as $standard) { - $installed = Util\Standards::getInstalledStandardPath($standard); - if ($installed === null) { - $standard = Util\Common::realpath($standard); - if (is_dir($standard) === true - && is_file(Util\Common::realpath($standard.DIRECTORY_SEPARATOR.'ruleset.xml')) === true - ) { - $standard = Util\Common::realpath($standard.DIRECTORY_SEPARATOR.'ruleset.xml'); - } - } else { - $standard = $installed; - } - - $standardPaths[] = $standard; - } - - foreach ($standardPaths as $standard) { - $ruleset = @simplexml_load_string(file_get_contents($standard)); - if ($ruleset !== false) { - $standardName = (string) $ruleset['name']; - if ($this->name !== '') { - $this->name .= ', '; - } - - $this->name .= $standardName; - - // Allow autoloading of custom files inside this standard. - if (isset($ruleset['namespace']) === true) { - $namespace = (string) $ruleset['namespace']; - } else { - $namespace = basename(dirname($standard)); - } - - Autoload::addSearchPath(dirname($standard), $namespace); - } - - if (defined('PHP_CODESNIFFER_IN_TESTS') === true && empty($restrictions) === false) { - // In unit tests, only register the sniffs that the test wants and not the entire standard. - try { - foreach ($restrictions as $restriction) { - $sniffs = array_merge($sniffs, $this->expandRulesetReference($restriction, dirname($standard))); - } - } catch (RuntimeException $e) { - // Sniff reference could not be expanded, which probably means this - // is an installed standard. Let the unit test system take care of - // setting the correct sniff for testing. - return; - } - - break; - } - - if (PHP_CODESNIFFER_VERBOSITY === 1) { - echo "Registering sniffs in the $standardName standard... "; - if (count($config->standards) > 1 || PHP_CODESNIFFER_VERBOSITY > 2) { - echo PHP_EOL; - } - } - - $sniffs = array_merge($sniffs, $this->processRuleset($standard)); - }//end foreach - - // Ignore sniff restrictions if caching is on. - if ($config->cache === true) { - $restrictions = []; - $exclusions = []; - } - - $sniffRestrictions = []; - foreach ($restrictions as $sniffCode) { - $parts = explode('.', strtolower($sniffCode)); - $sniffName = $parts[0].'\sniffs\\'.$parts[1].'\\'.$parts[2].'sniff'; - $sniffRestrictions[$sniffName] = true; - } - - $sniffExclusions = []; - foreach ($exclusions as $sniffCode) { - $parts = explode('.', strtolower($sniffCode)); - $sniffName = $parts[0].'\sniffs\\'.$parts[1].'\\'.$parts[2].'sniff'; - $sniffExclusions[$sniffName] = true; - } - - $this->registerSniffs($sniffs, $sniffRestrictions, $sniffExclusions); - $this->populateTokenListeners(); - - $numSniffs = count($this->sniffs); - if (PHP_CODESNIFFER_VERBOSITY === 1) { - echo "DONE ($numSniffs sniffs registered)".PHP_EOL; - } - - if ($numSniffs === 0) { - throw new RuntimeException('No sniffs were registered'); - } - - }//end __construct() - - - /** - * Prints a report showing the sniffs contained in a standard. - * - * @return void - */ - public function explain() - { - $sniffs = array_keys($this->sniffCodes); - sort($sniffs); - - ob_start(); - - $lastStandard = null; - $lastCount = ''; - $sniffCount = count($sniffs); - - // Add a dummy entry to the end so we loop - // one last time and clear the output buffer. - $sniffs[] = ''; - - echo PHP_EOL."The $this->name standard contains $sniffCount sniffs".PHP_EOL; - - ob_start(); - - foreach ($sniffs as $i => $sniff) { - if ($i === $sniffCount) { - $currentStandard = null; - } else { - $currentStandard = substr($sniff, 0, strpos($sniff, '.')); - if ($lastStandard === null) { - $lastStandard = $currentStandard; - } - } - - if ($currentStandard !== $lastStandard) { - $sniffList = ob_get_contents(); - ob_end_clean(); - - echo PHP_EOL.$lastStandard.' ('.$lastCount.' sniff'; - if ($lastCount > 1) { - echo 's'; - } - - echo ')'.PHP_EOL; - echo str_repeat('-', (strlen($lastStandard.$lastCount) + 10)); - echo PHP_EOL; - echo $sniffList; - - $lastStandard = $currentStandard; - $lastCount = 0; - - if ($currentStandard === null) { - break; - } - - ob_start(); - }//end if - - echo ' '.$sniff.PHP_EOL; - $lastCount++; - }//end foreach - - }//end explain() - - - /** - * Processes a single ruleset and returns a list of the sniffs it represents. - * - * Rules founds within the ruleset are processed immediately, but sniff classes - * are not registered by this method. - * - * @param string $rulesetPath The path to a ruleset XML file. - * @param int $depth How many nested processing steps we are in. This - * is only used for debug output. - * - * @return string[] - * @throws \PHP_CodeSniffer\Exceptions\RuntimeException - If the ruleset path is invalid. - * - If a specified autoload file could not be found. - */ - public function processRuleset($rulesetPath, $depth=0) - { - $rulesetPath = Util\Common::realpath($rulesetPath); - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo 'Processing ruleset '.Util\Common::stripBasepath($rulesetPath, $this->config->basepath).PHP_EOL; - } - - libxml_use_internal_errors(true); - $ruleset = simplexml_load_string(file_get_contents($rulesetPath)); - if ($ruleset === false) { - $errorMsg = "Ruleset $rulesetPath is not valid".PHP_EOL; - $errors = libxml_get_errors(); - foreach ($errors as $error) { - $errorMsg .= '- On line '.$error->line.', column '.$error->column.': '.$error->message; - } - - libxml_clear_errors(); - throw new RuntimeException($errorMsg); - } - - libxml_use_internal_errors(false); - - $ownSniffs = []; - $includedSniffs = []; - $excludedSniffs = []; - - $this->paths[] = $rulesetPath; - $rulesetDir = dirname($rulesetPath); - $this->rulesetDirs[] = $rulesetDir; - - $sniffDir = $rulesetDir.DIRECTORY_SEPARATOR.'Sniffs'; - if (is_dir($sniffDir) === true) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo "\tAdding sniff files from ".Util\Common::stripBasepath($sniffDir, $this->config->basepath).' directory'.PHP_EOL; - } - - $ownSniffs = $this->expandSniffDirectory($sniffDir, $depth); - } - - // Include custom autoloaders. - foreach ($ruleset->{'autoload'} as $autoload) { - if ($this->shouldProcessElement($autoload) === false) { - continue; - } - - $autoloadPath = (string) $autoload; - - // Try relative autoload paths first. - $relativePath = Util\Common::realPath(dirname($rulesetPath).DIRECTORY_SEPARATOR.$autoloadPath); - - if ($relativePath !== false && is_file($relativePath) === true) { - $autoloadPath = $relativePath; - } else if (is_file($autoloadPath) === false) { - throw new RuntimeException('The specified autoload file "'.$autoload.'" does not exist'); - } - - include_once $autoloadPath; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo "\t=> included autoloader $autoloadPath".PHP_EOL; - } - }//end foreach - - // Process custom sniff config settings. - foreach ($ruleset->{'config'} as $config) { - if ($this->shouldProcessElement($config) === false) { - continue; - } - - Config::setConfigData((string) $config['name'], (string) $config['value'], true); - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo "\t=> set config value ".(string) $config['name'].': '.(string) $config['value'].PHP_EOL; - } - } - - foreach ($ruleset->rule as $rule) { - if (isset($rule['ref']) === false - || $this->shouldProcessElement($rule) === false - ) { - continue; - } - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo "\tProcessing rule \"".$rule['ref'].'"'.PHP_EOL; - } - - $expandedSniffs = $this->expandRulesetReference((string) $rule['ref'], $rulesetDir, $depth); - $newSniffs = array_diff($expandedSniffs, $includedSniffs); - $includedSniffs = array_merge($includedSniffs, $expandedSniffs); - - $parts = explode('.', $rule['ref']); - if (count($parts) === 4 - && $parts[0] !== '' - && $parts[1] !== '' - && $parts[2] !== '' - ) { - $sniffCode = $parts[0].'.'.$parts[1].'.'.$parts[2]; - if (isset($this->ruleset[$sniffCode]['severity']) === true - && $this->ruleset[$sniffCode]['severity'] === 0 - ) { - // This sniff code has already been turned off, but now - // it is being explicitly included again, so turn it back on. - $this->ruleset[(string) $rule['ref']]['severity'] = 5; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo "\t\t* disabling sniff exclusion for specific message code *".PHP_EOL; - echo str_repeat("\t", $depth); - echo "\t\t=> severity set to 5".PHP_EOL; - } - } else if (empty($newSniffs) === false) { - $newSniff = $newSniffs[0]; - if (in_array($newSniff, $ownSniffs, true) === false) { - // Including a sniff that hasn't been included higher up, but - // only including a single message from it. So turn off all messages in - // the sniff, except this one. - $this->ruleset[$sniffCode]['severity'] = 0; - $this->ruleset[(string) $rule['ref']]['severity'] = 5; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo "\t\tExcluding sniff \"".$sniffCode.'" except for "'.$parts[3].'"'.PHP_EOL; - } - } - }//end if - }//end if - - if (isset($rule->exclude) === true) { - foreach ($rule->exclude as $exclude) { - if (isset($exclude['name']) === false) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo "\t\t* ignoring empty exclude rule *".PHP_EOL; - echo "\t\t\t=> ".$exclude->asXML().PHP_EOL; - } - - continue; - } - - if ($this->shouldProcessElement($exclude) === false) { - continue; - } - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo "\t\tExcluding rule \"".$exclude['name'].'"'.PHP_EOL; - } - - // Check if a single code is being excluded, which is a shortcut - // for setting the severity of the message to 0. - $parts = explode('.', $exclude['name']); - if (count($parts) === 4) { - $this->ruleset[(string) $exclude['name']]['severity'] = 0; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo "\t\t=> severity set to 0".PHP_EOL; - } - } else { - $excludedSniffs = array_merge( - $excludedSniffs, - $this->expandRulesetReference((string) $exclude['name'], $rulesetDir, ($depth + 1)) - ); - } - }//end foreach - }//end if - - $this->processRule($rule, $newSniffs, $depth); - }//end foreach - - // Process custom command line arguments. - $cliArgs = []; - foreach ($ruleset->{'arg'} as $arg) { - if ($this->shouldProcessElement($arg) === false) { - continue; - } - - if (isset($arg['name']) === true) { - $argString = '--'.(string) $arg['name']; - if (isset($arg['value']) === true) { - $argString .= '='.(string) $arg['value']; - } - } else { - $argString = '-'.(string) $arg['value']; - } - - $cliArgs[] = $argString; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo "\t=> set command line value $argString".PHP_EOL; - } - }//end foreach - - // Set custom php ini values as CLI args. - foreach ($ruleset->{'ini'} as $arg) { - if ($this->shouldProcessElement($arg) === false) { - continue; - } - - if (isset($arg['name']) === false) { - continue; - } - - $name = (string) $arg['name']; - $argString = $name; - if (isset($arg['value']) === true) { - $value = (string) $arg['value']; - $argString .= "=$value"; - } else { - $value = 'true'; - } - - $cliArgs[] = '-d'; - $cliArgs[] = $argString; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo "\t=> set PHP ini value $name to $value".PHP_EOL; - } - }//end foreach - - if (empty($this->config->files) === true) { - // Process hard-coded file paths. - foreach ($ruleset->{'file'} as $file) { - $file = (string) $file; - $cliArgs[] = $file; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo "\t=> added \"$file\" to the file list".PHP_EOL; - } - } - } - - if (empty($cliArgs) === false) { - // Change the directory so all relative paths are worked - // out based on the location of the ruleset instead of - // the location of the user. - $inPhar = Util\Common::isPharFile($rulesetDir); - if ($inPhar === false) { - $currentDir = getcwd(); - chdir($rulesetDir); - } - - $this->config->setCommandLineValues($cliArgs); - - if ($inPhar === false) { - chdir($currentDir); - } - } - - // Process custom ignore pattern rules. - foreach ($ruleset->{'exclude-pattern'} as $pattern) { - if ($this->shouldProcessElement($pattern) === false) { - continue; - } - - if (isset($pattern['type']) === false) { - $pattern['type'] = 'absolute'; - } - - $this->ignorePatterns[(string) $pattern] = (string) $pattern['type']; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo "\t=> added global ".(string) $pattern['type'].' ignore pattern: '.(string) $pattern.PHP_EOL; - } - } - - $includedSniffs = array_unique(array_merge($ownSniffs, $includedSniffs)); - $excludedSniffs = array_unique($excludedSniffs); - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $included = count($includedSniffs); - $excluded = count($excludedSniffs); - echo str_repeat("\t", $depth); - echo "=> Ruleset processing complete; included $included sniffs and excluded $excluded".PHP_EOL; - } - - // Merge our own sniff list with our externally included - // sniff list, but filter out any excluded sniffs. - $files = []; - foreach ($includedSniffs as $sniff) { - if (in_array($sniff, $excludedSniffs, true) === true) { - continue; - } else { - $files[] = Util\Common::realpath($sniff); - } - } - - return $files; - - }//end processRuleset() - - - /** - * Expands a directory into a list of sniff files within. - * - * @param string $directory The path to a directory. - * @param int $depth How many nested processing steps we are in. This - * is only used for debug output. - * - * @return array - */ - private function expandSniffDirectory($directory, $depth=0) - { - $sniffs = []; - - $rdi = new \RecursiveDirectoryIterator($directory, \RecursiveDirectoryIterator::FOLLOW_SYMLINKS); - $di = new \RecursiveIteratorIterator($rdi, 0, \RecursiveIteratorIterator::CATCH_GET_CHILD); - - $dirLen = strlen($directory); - - foreach ($di as $file) { - $filename = $file->getFilename(); - - // Skip hidden files. - if (substr($filename, 0, 1) === '.') { - continue; - } - - // We are only interested in PHP and sniff files. - $fileParts = explode('.', $filename); - if (array_pop($fileParts) !== 'php') { - continue; - } - - $basename = basename($filename, '.php'); - if (substr($basename, -5) !== 'Sniff') { - continue; - } - - $path = $file->getPathname(); - - // Skip files in hidden directories within the Sniffs directory of this - // standard. We use the offset with strpos() to allow hidden directories - // before, valid example: - // /home/foo/.composer/vendor/squiz/custom_tool/MyStandard/Sniffs/... - if (strpos($path, DIRECTORY_SEPARATOR.'.', $dirLen) !== false) { - continue; - } - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo "\t\t=> ".Util\Common::stripBasepath($path, $this->config->basepath).PHP_EOL; - } - - $sniffs[] = $path; - }//end foreach - - return $sniffs; - - }//end expandSniffDirectory() - - - /** - * Expands a ruleset reference into a list of sniff files. - * - * @param string $ref The reference from the ruleset XML file. - * @param string $rulesetDir The directory of the ruleset XML file, used to - * evaluate relative paths. - * @param int $depth How many nested processing steps we are in. This - * is only used for debug output. - * - * @return array - * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the reference is invalid. - */ - private function expandRulesetReference($ref, $rulesetDir, $depth=0) - { - // Ignore internal sniffs codes as they are used to only - // hide and change internal messages. - if (substr($ref, 0, 9) === 'Internal.') { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo "\t\t* ignoring internal sniff code *".PHP_EOL; - } - - return []; - } - - // As sniffs can't begin with a full stop, assume references in - // this format are relative paths and attempt to convert them - // to absolute paths. If this fails, let the reference run through - // the normal checks and have it fail as normal. - if (substr($ref, 0, 1) === '.') { - $realpath = Util\Common::realpath($rulesetDir.'/'.$ref); - if ($realpath !== false) { - $ref = $realpath; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo "\t\t=> ".Util\Common::stripBasepath($ref, $this->config->basepath).PHP_EOL; - } - } - } - - // As sniffs can't begin with a tilde, assume references in - // this format are relative to the user's home directory. - if (substr($ref, 0, 2) === '~/') { - $realpath = Util\Common::realpath($ref); - if ($realpath !== false) { - $ref = $realpath; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo "\t\t=> ".Util\Common::stripBasepath($ref, $this->config->basepath).PHP_EOL; - } - } - } - - if (is_file($ref) === true) { - if (substr($ref, -9) === 'Sniff.php') { - // A single external sniff. - $this->rulesetDirs[] = dirname(dirname(dirname($ref))); - return [$ref]; - } - } else { - // See if this is a whole standard being referenced. - $path = Util\Standards::getInstalledStandardPath($ref); - if ($path !== null && Util\Common::isPharFile($path) === true && strpos($path, 'ruleset.xml') === false) { - // If the ruleset exists inside the phar file, use it. - if (file_exists($path.DIRECTORY_SEPARATOR.'ruleset.xml') === true) { - $path .= DIRECTORY_SEPARATOR.'ruleset.xml'; - } else { - $path = null; - } - } - - if ($path !== null) { - $ref = $path; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo "\t\t=> ".Util\Common::stripBasepath($ref, $this->config->basepath).PHP_EOL; - } - } else if (is_dir($ref) === false) { - // Work out the sniff path. - $sepPos = strpos($ref, DIRECTORY_SEPARATOR); - if ($sepPos !== false) { - $stdName = substr($ref, 0, $sepPos); - $path = substr($ref, $sepPos); - } else { - $parts = explode('.', $ref); - $stdName = $parts[0]; - if (count($parts) === 1) { - // A whole standard? - $path = ''; - } else if (count($parts) === 2) { - // A directory of sniffs? - $path = DIRECTORY_SEPARATOR.'Sniffs'.DIRECTORY_SEPARATOR.$parts[1]; - } else { - // A single sniff? - $path = DIRECTORY_SEPARATOR.'Sniffs'.DIRECTORY_SEPARATOR.$parts[1].DIRECTORY_SEPARATOR.$parts[2].'Sniff.php'; - } - } - - $newRef = false; - $stdPath = Util\Standards::getInstalledStandardPath($stdName); - if ($stdPath !== null && $path !== '') { - if (Util\Common::isPharFile($stdPath) === true - && strpos($stdPath, 'ruleset.xml') === false - ) { - // Phar files can only return the directory, - // since ruleset can be omitted if building one standard. - $newRef = Util\Common::realpath($stdPath.$path); - } else { - $newRef = Util\Common::realpath(dirname($stdPath).$path); - } - } - - if ($newRef === false) { - // The sniff is not locally installed, so check if it is being - // referenced as a remote sniff outside the install. We do this - // by looking through all directories where we have found ruleset - // files before, looking for ones for this particular standard, - // and seeing if it is in there. - foreach ($this->rulesetDirs as $dir) { - if (strtolower(basename($dir)) !== strtolower($stdName)) { - continue; - } - - $newRef = Util\Common::realpath($dir.$path); - - if ($newRef !== false) { - $ref = $newRef; - } - } - } else { - $ref = $newRef; - } - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo "\t\t=> ".Util\Common::stripBasepath($ref, $this->config->basepath).PHP_EOL; - } - }//end if - }//end if - - if (is_dir($ref) === true) { - if (is_file($ref.DIRECTORY_SEPARATOR.'ruleset.xml') === true) { - // We are referencing an external coding standard. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo "\t\t* rule is referencing a standard using directory name; processing *".PHP_EOL; - } - - return $this->processRuleset($ref.DIRECTORY_SEPARATOR.'ruleset.xml', ($depth + 2)); - } else { - // We are referencing a whole directory of sniffs. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo "\t\t* rule is referencing a directory of sniffs *".PHP_EOL; - echo str_repeat("\t", $depth); - echo "\t\tAdding sniff files from directory".PHP_EOL; - } - - return $this->expandSniffDirectory($ref, ($depth + 1)); - } - } else { - if (is_file($ref) === false) { - $error = "Referenced sniff \"$ref\" does not exist"; - throw new RuntimeException($error); - } - - if (substr($ref, -9) === 'Sniff.php') { - // A single sniff. - return [$ref]; - } else { - // Assume an external ruleset.xml file. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo "\t\t* rule is referencing a standard using ruleset path; processing *".PHP_EOL; - } - - return $this->processRuleset($ref, ($depth + 2)); - } - }//end if - - }//end expandRulesetReference() - - - /** - * Processes a rule from a ruleset XML file, overriding built-in defaults. - * - * @param \SimpleXMLElement $rule The rule object from a ruleset XML file. - * @param string[] $newSniffs An array of sniffs that got included by this rule. - * @param int $depth How many nested processing steps we are in. - * This is only used for debug output. - * - * @return void - * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If rule settings are invalid. - */ - private function processRule($rule, $newSniffs, $depth=0) - { - $ref = (string) $rule['ref']; - $todo = [$ref]; - - $parts = explode('.', $ref); - $partsCount = count($parts); - if ($partsCount <= 2 - || $partsCount > count(array_filter($parts)) - || in_array($ref, $newSniffs) === true - ) { - // We are processing a standard, a category of sniffs or a relative path inclusion. - foreach ($newSniffs as $sniffFile) { - $parts = explode(DIRECTORY_SEPARATOR, $sniffFile); - if (count($parts) === 1 && DIRECTORY_SEPARATOR === '\\') { - // Path using forward slashes while running on Windows. - $parts = explode('/', $sniffFile); - } - - $sniffName = array_pop($parts); - $sniffCategory = array_pop($parts); - array_pop($parts); - $sniffStandard = array_pop($parts); - $todo[] = $sniffStandard.'.'.$sniffCategory.'.'.substr($sniffName, 0, -9); - } - } - - foreach ($todo as $code) { - // Custom severity. - if (isset($rule->severity) === true - && $this->shouldProcessElement($rule->severity) === true - ) { - if (isset($this->ruleset[$code]) === false) { - $this->ruleset[$code] = []; - } - - $this->ruleset[$code]['severity'] = (int) $rule->severity; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo "\t\t=> severity set to ".(int) $rule->severity; - if ($code !== $ref) { - echo " for $code"; - } - - echo PHP_EOL; - } - } - - // Custom message type. - if (isset($rule->type) === true - && $this->shouldProcessElement($rule->type) === true - ) { - if (isset($this->ruleset[$code]) === false) { - $this->ruleset[$code] = []; - } - - $type = strtolower((string) $rule->type); - if ($type !== 'error' && $type !== 'warning') { - throw new RuntimeException("Message type \"$type\" is invalid; must be \"error\" or \"warning\""); - } - - $this->ruleset[$code]['type'] = $type; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo "\t\t=> message type set to ".(string) $rule->type; - if ($code !== $ref) { - echo " for $code"; - } - - echo PHP_EOL; - } - }//end if - - // Custom message. - if (isset($rule->message) === true - && $this->shouldProcessElement($rule->message) === true - ) { - if (isset($this->ruleset[$code]) === false) { - $this->ruleset[$code] = []; - } - - $this->ruleset[$code]['message'] = (string) $rule->message; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo "\t\t=> message set to ".(string) $rule->message; - if ($code !== $ref) { - echo " for $code"; - } - - echo PHP_EOL; - } - } - - // Custom properties. - if (isset($rule->properties) === true - && $this->shouldProcessElement($rule->properties) === true - ) { - foreach ($rule->properties->property as $prop) { - if ($this->shouldProcessElement($prop) === false) { - continue; - } - - if (isset($this->ruleset[$code]) === false) { - $this->ruleset[$code] = [ - 'properties' => [], - ]; - } else if (isset($this->ruleset[$code]['properties']) === false) { - $this->ruleset[$code]['properties'] = []; - } - - $name = (string) $prop['name']; - if (isset($prop['type']) === true - && (string) $prop['type'] === 'array' - ) { - $values = []; - if (isset($prop['extend']) === true - && (string) $prop['extend'] === 'true' - && isset($this->ruleset[$code]['properties'][$name]) === true - ) { - $values = $this->ruleset[$code]['properties'][$name]; - } - - if (isset($prop->element) === true) { - $printValue = ''; - foreach ($prop->element as $element) { - if ($this->shouldProcessElement($element) === false) { - continue; - } - - $value = (string) $element['value']; - if (isset($element['key']) === true) { - $key = (string) $element['key']; - $values[$key] = $value; - $printValue .= $key.'=>'.$value.','; - } else { - $values[] = $value; - $printValue .= $value.','; - } - } - - $printValue = rtrim($printValue, ','); - } else { - $value = (string) $prop['value']; - $printValue = $value; - foreach (explode(',', $value) as $val) { - list($k, $v) = explode('=>', $val.'=>'); - if ($v !== '') { - $values[trim($k)] = trim($v); - } else { - $values[] = trim($k); - } - } - }//end if - - $this->ruleset[$code]['properties'][$name] = $values; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo "\t\t=> array property \"$name\" set to \"$printValue\""; - if ($code !== $ref) { - echo " for $code"; - } - - echo PHP_EOL; - } - } else { - $this->ruleset[$code]['properties'][$name] = (string) $prop['value']; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo "\t\t=> property \"$name\" set to \"".(string) $prop['value'].'"'; - if ($code !== $ref) { - echo " for $code"; - } - - echo PHP_EOL; - } - }//end if - }//end foreach - }//end if - - // Ignore patterns. - foreach ($rule->{'exclude-pattern'} as $pattern) { - if ($this->shouldProcessElement($pattern) === false) { - continue; - } - - if (isset($this->ignorePatterns[$code]) === false) { - $this->ignorePatterns[$code] = []; - } - - if (isset($pattern['type']) === false) { - $pattern['type'] = 'absolute'; - } - - $this->ignorePatterns[$code][(string) $pattern] = (string) $pattern['type']; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo "\t\t=> added rule-specific ".(string) $pattern['type'].' ignore pattern'; - if ($code !== $ref) { - echo " for $code"; - } - - echo ': '.(string) $pattern.PHP_EOL; - } - }//end foreach - - // Include patterns. - foreach ($rule->{'include-pattern'} as $pattern) { - if ($this->shouldProcessElement($pattern) === false) { - continue; - } - - if (isset($this->includePatterns[$code]) === false) { - $this->includePatterns[$code] = []; - } - - if (isset($pattern['type']) === false) { - $pattern['type'] = 'absolute'; - } - - $this->includePatterns[$code][(string) $pattern] = (string) $pattern['type']; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo "\t\t=> added rule-specific ".(string) $pattern['type'].' include pattern'; - if ($code !== $ref) { - echo " for $code"; - } - - echo ': '.(string) $pattern.PHP_EOL; - } - }//end foreach - }//end foreach - - }//end processRule() - - - /** - * Determine if an element should be processed or ignored. - * - * @param \SimpleXMLElement $element An object from a ruleset XML file. - * - * @return bool - */ - private function shouldProcessElement($element) - { - if (isset($element['phpcbf-only']) === false - && isset($element['phpcs-only']) === false - ) { - // No exceptions are being made. - return true; - } - - if (PHP_CODESNIFFER_CBF === true - && isset($element['phpcbf-only']) === true - && (string) $element['phpcbf-only'] === 'true' - ) { - return true; - } - - if (PHP_CODESNIFFER_CBF === false - && isset($element['phpcs-only']) === true - && (string) $element['phpcs-only'] === 'true' - ) { - return true; - } - - return false; - - }//end shouldProcessElement() - - - /** - * Loads and stores sniffs objects used for sniffing files. - * - * @param array $files Paths to the sniff files to register. - * @param array $restrictions The sniff class names to restrict the allowed - * listeners to. - * @param array $exclusions The sniff class names to exclude from the - * listeners list. - * - * @return void - */ - public function registerSniffs($files, $restrictions, $exclusions) - { - $listeners = []; - - foreach ($files as $file) { - // Work out where the position of /StandardName/Sniffs/... is - // so we can determine what the class will be called. - $sniffPos = strrpos($file, DIRECTORY_SEPARATOR.'Sniffs'.DIRECTORY_SEPARATOR); - if ($sniffPos === false) { - continue; - } - - $slashPos = strrpos(substr($file, 0, $sniffPos), DIRECTORY_SEPARATOR); - if ($slashPos === false) { - continue; - } - - $className = Autoload::loadFile($file); - $compareName = Util\Common::cleanSniffClass($className); - - // If they have specified a list of sniffs to restrict to, check - // to see if this sniff is allowed. - if (empty($restrictions) === false - && isset($restrictions[$compareName]) === false - ) { - continue; - } - - // If they have specified a list of sniffs to exclude, check - // to see if this sniff is allowed. - if (empty($exclusions) === false - && isset($exclusions[$compareName]) === true - ) { - continue; - } - - // Skip abstract classes. - $reflection = new \ReflectionClass($className); - if ($reflection->isAbstract() === true) { - continue; - } - - $listeners[$className] = $className; - - if (PHP_CODESNIFFER_VERBOSITY > 2) { - echo "Registered $className".PHP_EOL; - } - }//end foreach - - $this->sniffs = $listeners; - - }//end registerSniffs() - - - /** - * Populates the array of PHP_CodeSniffer_Sniff objects for this file. - * - * @return void - * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If sniff registration fails. - */ - public function populateTokenListeners() - { - // Construct a list of listeners indexed by token being listened for. - $this->tokenListeners = []; - - foreach ($this->sniffs as $sniffClass => $sniffObject) { - $this->sniffs[$sniffClass] = null; - $this->sniffs[$sniffClass] = new $sniffClass(); - - $sniffCode = Util\Common::getSniffCode($sniffClass); - $this->sniffCodes[$sniffCode] = $sniffClass; - - // Set custom properties. - if (isset($this->ruleset[$sniffCode]['properties']) === true) { - foreach ($this->ruleset[$sniffCode]['properties'] as $name => $value) { - $this->setSniffProperty($sniffClass, $name, $value); - } - } - - $tokenizers = []; - $vars = get_class_vars($sniffClass); - if (isset($vars['supportedTokenizers']) === true) { - foreach ($vars['supportedTokenizers'] as $tokenizer) { - $tokenizers[$tokenizer] = $tokenizer; - } - } else { - $tokenizers = ['PHP' => 'PHP']; - } - - $tokens = $this->sniffs[$sniffClass]->register(); - if (is_array($tokens) === false) { - $msg = "Sniff $sniffClass register() method must return an array"; - throw new RuntimeException($msg); - } - - $ignorePatterns = []; - $patterns = $this->getIgnorePatterns($sniffCode); - foreach ($patterns as $pattern => $type) { - $replacements = [ - '\\,' => ',', - '*' => '.*', - ]; - - $ignorePatterns[] = strtr($pattern, $replacements); - } - - $includePatterns = []; - $patterns = $this->getIncludePatterns($sniffCode); - foreach ($patterns as $pattern => $type) { - $replacements = [ - '\\,' => ',', - '*' => '.*', - ]; - - $includePatterns[] = strtr($pattern, $replacements); - } - - foreach ($tokens as $token) { - if (isset($this->tokenListeners[$token]) === false) { - $this->tokenListeners[$token] = []; - } - - if (isset($this->tokenListeners[$token][$sniffClass]) === false) { - $this->tokenListeners[$token][$sniffClass] = [ - 'class' => $sniffClass, - 'source' => $sniffCode, - 'tokenizers' => $tokenizers, - 'ignore' => $ignorePatterns, - 'include' => $includePatterns, - ]; - } - } - }//end foreach - - }//end populateTokenListeners() - - - /** - * Set a single property for a sniff. - * - * @param string $sniffClass The class name of the sniff. - * @param string $name The name of the property to change. - * @param string $value The new value of the property. - * - * @return void - */ - public function setSniffProperty($sniffClass, $name, $value) - { - // Setting a property for a sniff we are not using. - if (isset($this->sniffs[$sniffClass]) === false) { - return; - } - - $name = trim($name); - if (is_string($value) === true) { - $value = trim($value); - } - - if ($value === '') { - $value = null; - } - - // Special case for booleans. - if ($value === 'true') { - $value = true; - } else if ($value === 'false') { - $value = false; - } else if (substr($name, -2) === '[]') { - $name = substr($name, 0, -2); - $values = []; - if ($value !== null) { - foreach (explode(',', $value) as $val) { - list($k, $v) = explode('=>', $val.'=>'); - if ($v !== '') { - $values[trim($k)] = trim($v); - } else { - $values[] = trim($k); - } - } - } - - $value = $values; - } - - $this->sniffs[$sniffClass]->$name = $value; - - }//end setSniffProperty() - - - /** - * Gets the array of ignore patterns. - * - * Optionally takes a listener to get ignore patterns specified - * for that sniff only. - * - * @param string $listener The listener to get patterns for. If NULL, all - * patterns are returned. - * - * @return array - */ - public function getIgnorePatterns($listener=null) - { - if ($listener === null) { - return $this->ignorePatterns; - } - - if (isset($this->ignorePatterns[$listener]) === true) { - return $this->ignorePatterns[$listener]; - } - - return []; - - }//end getIgnorePatterns() - - - /** - * Gets the array of include patterns. - * - * Optionally takes a listener to get include patterns specified - * for that sniff only. - * - * @param string $listener The listener to get patterns for. If NULL, all - * patterns are returned. - * - * @return array - */ - public function getIncludePatterns($listener=null) - { - if ($listener === null) { - return $this->includePatterns; - } - - if (isset($this->includePatterns[$listener]) === true) { - return $this->includePatterns[$listener]; - } - - return []; - - }//end getIncludePatterns() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Runner.php b/vendor/squizlabs/php_codesniffer/src/Runner.php deleted file mode 100644 index 253ec91..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Runner.php +++ /dev/null @@ -1,890 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer; - -use PHP_CodeSniffer\Exceptions\DeepExitException; -use PHP_CodeSniffer\Exceptions\RuntimeException; -use PHP_CodeSniffer\Files\DummyFile; -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Files\FileList; -use PHP_CodeSniffer\Util\Cache; -use PHP_CodeSniffer\Util\Common; -use PHP_CodeSniffer\Util\Standards; - -class Runner -{ - - /** - * The config data for the run. - * - * @var \PHP_CodeSniffer\Config - */ - public $config = null; - - /** - * The ruleset used for the run. - * - * @var \PHP_CodeSniffer\Ruleset - */ - public $ruleset = null; - - /** - * The reporter used for generating reports after the run. - * - * @var \PHP_CodeSniffer\Reporter - */ - public $reporter = null; - - - /** - * Run the PHPCS script. - * - * @return array - */ - public function runPHPCS() - { - try { - Util\Timing::startTiming(); - Runner::checkRequirements(); - - if (defined('PHP_CODESNIFFER_CBF') === false) { - define('PHP_CODESNIFFER_CBF', false); - } - - // Creating the Config object populates it with all required settings - // based on the CLI arguments provided to the script and any config - // values the user has set. - $this->config = new Config(); - - // Init the run and load the rulesets to set additional config vars. - $this->init(); - - // Print a list of sniffs in each of the supplied standards. - // We fudge the config here so that each standard is explained in isolation. - if ($this->config->explain === true) { - $standards = $this->config->standards; - foreach ($standards as $standard) { - $this->config->standards = [$standard]; - $ruleset = new Ruleset($this->config); - $ruleset->explain(); - } - - return 0; - } - - // Generate documentation for each of the supplied standards. - if ($this->config->generator !== null) { - $standards = $this->config->standards; - foreach ($standards as $standard) { - $this->config->standards = [$standard]; - $ruleset = new Ruleset($this->config); - $class = 'PHP_CodeSniffer\Generators\\'.$this->config->generator; - $generator = new $class($ruleset); - $generator->generate(); - } - - return 0; - } - - // Other report formats don't really make sense in interactive mode - // so we hard-code the full report here and when outputting. - // We also ensure parallel processing is off because we need to do one file at a time. - if ($this->config->interactive === true) { - $this->config->reports = ['full' => null]; - $this->config->parallel = 1; - $this->config->showProgress = false; - } - - // Disable caching if we are processing STDIN as we can't be 100% - // sure where the file came from or if it will change in the future. - if ($this->config->stdin === true) { - $this->config->cache = false; - } - - $numErrors = $this->run(); - - // Print all the reports for this run. - $toScreen = $this->reporter->printReports(); - - // Only print timer output if no reports were - // printed to the screen so we don't put additional output - // in something like an XML report. If we are printing to screen, - // the report types would have already worked out who should - // print the timer info. - if ($this->config->interactive === false - && ($toScreen === false - || (($this->reporter->totalErrors + $this->reporter->totalWarnings) === 0 && $this->config->showProgress === true)) - ) { - Util\Timing::printRunTime(); - } - } catch (DeepExitException $e) { - echo $e->getMessage(); - return $e->getCode(); - }//end try - - if ($numErrors === 0) { - // No errors found. - return 0; - } else if ($this->reporter->totalFixable === 0) { - // Errors found, but none of them can be fixed by PHPCBF. - return 1; - } else { - // Errors found, and some can be fixed by PHPCBF. - return 2; - } - - }//end runPHPCS() - - - /** - * Run the PHPCBF script. - * - * @return array - */ - public function runPHPCBF() - { - if (defined('PHP_CODESNIFFER_CBF') === false) { - define('PHP_CODESNIFFER_CBF', true); - } - - try { - Util\Timing::startTiming(); - Runner::checkRequirements(); - - // Creating the Config object populates it with all required settings - // based on the CLI arguments provided to the script and any config - // values the user has set. - $this->config = new Config(); - - // When processing STDIN, we can't output anything to the screen - // or it will end up mixed in with the file output. - if ($this->config->stdin === true) { - $this->config->verbosity = 0; - } - - // Init the run and load the rulesets to set additional config vars. - $this->init(); - - // When processing STDIN, we only process one file at a time and - // we don't process all the way through, so we can't use the parallel - // running system. - if ($this->config->stdin === true) { - $this->config->parallel = 1; - } - - // Override some of the command line settings that might break the fixes. - $this->config->generator = null; - $this->config->explain = false; - $this->config->interactive = false; - $this->config->cache = false; - $this->config->showSources = false; - $this->config->recordErrors = false; - $this->config->reportFile = null; - $this->config->reports = ['cbf' => null]; - - // If a standard tries to set command line arguments itself, some - // may be blocked because PHPCBF is running, so stop the script - // dying if any are found. - $this->config->dieOnUnknownArg = false; - - $this->run(); - $this->reporter->printReports(); - - echo PHP_EOL; - Util\Timing::printRunTime(); - } catch (DeepExitException $e) { - echo $e->getMessage(); - return $e->getCode(); - }//end try - - if ($this->reporter->totalFixed === 0) { - // Nothing was fixed by PHPCBF. - if ($this->reporter->totalFixable === 0) { - // Nothing found that could be fixed. - return 0; - } else { - // Something failed to fix. - return 2; - } - } - - if ($this->reporter->totalFixable === 0) { - // PHPCBF fixed all fixable errors. - return 1; - } - - // PHPCBF fixed some fixable errors, but others failed to fix. - return 2; - - }//end runPHPCBF() - - - /** - * Exits if the minimum requirements of PHP_CodeSniffer are not met. - * - * @return void - * @throws \PHP_CodeSniffer\Exceptions\DeepExitException If the requirements are not met. - */ - public function checkRequirements() - { - // Check the PHP version. - if (PHP_VERSION_ID < 50400) { - $error = 'ERROR: PHP_CodeSniffer requires PHP version 5.4.0 or greater.'.PHP_EOL; - throw new DeepExitException($error, 3); - } - - $requiredExtensions = [ - 'tokenizer', - 'xmlwriter', - 'SimpleXML', - ]; - $missingExtensions = []; - - foreach ($requiredExtensions as $extension) { - if (extension_loaded($extension) === false) { - $missingExtensions[] = $extension; - } - } - - if (empty($missingExtensions) === false) { - $last = array_pop($requiredExtensions); - $required = implode(', ', $requiredExtensions); - $required .= ' and '.$last; - - if (count($missingExtensions) === 1) { - $missing = $missingExtensions[0]; - } else { - $last = array_pop($missingExtensions); - $missing = implode(', ', $missingExtensions); - $missing .= ' and '.$last; - } - - $error = 'ERROR: PHP_CodeSniffer requires the %s extensions to be enabled. Please enable %s.'.PHP_EOL; - $error = sprintf($error, $required, $missing); - throw new DeepExitException($error, 3); - } - - }//end checkRequirements() - - - /** - * Init the rulesets and other high-level settings. - * - * @return void - * @throws \PHP_CodeSniffer\Exceptions\DeepExitException If a referenced standard is not installed. - */ - public function init() - { - if (defined('PHP_CODESNIFFER_CBF') === false) { - define('PHP_CODESNIFFER_CBF', false); - } - - // Ensure this option is enabled or else line endings will not always - // be detected properly for files created on a Mac with the /r line ending. - @ini_set('auto_detect_line_endings', true); - - // Disable the PCRE JIT as this caused issues with parallel running. - ini_set('pcre.jit', false); - - // Check that the standards are valid. - foreach ($this->config->standards as $standard) { - if (Util\Standards::isInstalledStandard($standard) === false) { - // They didn't select a valid coding standard, so help them - // out by letting them know which standards are installed. - $error = 'ERROR: the "'.$standard.'" coding standard is not installed. '; - ob_start(); - Util\Standards::printInstalledStandards(); - $error .= ob_get_contents(); - ob_end_clean(); - throw new DeepExitException($error, 3); - } - } - - // Saves passing the Config object into other objects that only need - // the verbosity flag for debug output. - if (defined('PHP_CODESNIFFER_VERBOSITY') === false) { - define('PHP_CODESNIFFER_VERBOSITY', $this->config->verbosity); - } - - // Create this class so it is autoloaded and sets up a bunch - // of PHP_CodeSniffer-specific token type constants. - $tokens = new Util\Tokens(); - - // Allow autoloading of custom files inside installed standards. - $installedStandards = Standards::getInstalledStandardDetails(); - foreach ($installedStandards as $name => $details) { - Autoload::addSearchPath($details['path'], $details['namespace']); - } - - // The ruleset contains all the information about how the files - // should be checked and/or fixed. - try { - $this->ruleset = new Ruleset($this->config); - } catch (RuntimeException $e) { - $error = 'ERROR: '.$e->getMessage().PHP_EOL.PHP_EOL; - $error .= $this->config->printShortUsage(true); - throw new DeepExitException($error, 3); - } - - }//end init() - - - /** - * Performs the run. - * - * @return int The number of errors and warnings found. - * @throws \PHP_CodeSniffer\Exceptions\DeepExitException - * @throws \PHP_CodeSniffer\Exceptions\RuntimeException - */ - private function run() - { - // The class that manages all reporters for the run. - $this->reporter = new Reporter($this->config); - - // Include bootstrap files. - foreach ($this->config->bootstrap as $bootstrap) { - include $bootstrap; - } - - if ($this->config->stdin === true) { - $fileContents = $this->config->stdinContent; - if ($fileContents === null) { - $handle = fopen('php://stdin', 'r'); - stream_set_blocking($handle, true); - $fileContents = stream_get_contents($handle); - fclose($handle); - } - - $todo = new FileList($this->config, $this->ruleset); - $dummy = new DummyFile($fileContents, $this->ruleset, $this->config); - $todo->addFile($dummy->path, $dummy); - } else { - if (empty($this->config->files) === true) { - $error = 'ERROR: You must supply at least one file or directory to process.'.PHP_EOL.PHP_EOL; - $error .= $this->config->printShortUsage(true); - throw new DeepExitException($error, 3); - } - - if (PHP_CODESNIFFER_VERBOSITY > 0) { - echo 'Creating file list... '; - } - - $todo = new FileList($this->config, $this->ruleset); - - if (PHP_CODESNIFFER_VERBOSITY > 0) { - $numFiles = count($todo); - echo "DONE ($numFiles files in queue)".PHP_EOL; - } - - if ($this->config->cache === true) { - if (PHP_CODESNIFFER_VERBOSITY > 0) { - echo 'Loading cache... '; - } - - Cache::load($this->ruleset, $this->config); - - if (PHP_CODESNIFFER_VERBOSITY > 0) { - $size = Cache::getSize(); - echo "DONE ($size files in cache)".PHP_EOL; - } - } - }//end if - - // Turn all sniff errors into exceptions. - set_error_handler([$this, 'handleErrors']); - - // If verbosity is too high, turn off parallelism so the - // debug output is clean. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $this->config->parallel = 1; - } - - // If the PCNTL extension isn't installed, we can't fork. - if (function_exists('pcntl_fork') === false) { - $this->config->parallel = 1; - } - - $lastDir = ''; - $numFiles = count($todo); - - if ($this->config->parallel === 1) { - // Running normally. - $numProcessed = 0; - foreach ($todo as $path => $file) { - if ($file->ignored === false) { - $currDir = dirname($path); - if ($lastDir !== $currDir) { - if (PHP_CODESNIFFER_VERBOSITY > 0) { - echo 'Changing into directory '.Common::stripBasepath($currDir, $this->config->basepath).PHP_EOL; - } - - $lastDir = $currDir; - } - - $this->processFile($file); - } else if (PHP_CODESNIFFER_VERBOSITY > 0) { - echo 'Skipping '.basename($file->path).PHP_EOL; - } - - $numProcessed++; - $this->printProgress($file, $numFiles, $numProcessed); - } - } else { - // Batching and forking. - $childProcs = []; - $numPerBatch = ceil($numFiles / $this->config->parallel); - - for ($batch = 0; $batch < $this->config->parallel; $batch++) { - $startAt = ($batch * $numPerBatch); - if ($startAt >= $numFiles) { - break; - } - - $endAt = ($startAt + $numPerBatch); - if ($endAt > $numFiles) { - $endAt = $numFiles; - } - - $childOutFilename = tempnam(sys_get_temp_dir(), 'phpcs-child'); - $pid = pcntl_fork(); - if ($pid === -1) { - throw new RuntimeException('Failed to create child process'); - } else if ($pid !== 0) { - $childProcs[] = [ - 'pid' => $pid, - 'out' => $childOutFilename, - ]; - } else { - // Move forward to the start of the batch. - $todo->rewind(); - for ($i = 0; $i < $startAt; $i++) { - $todo->next(); - } - - // Reset the reporter to make sure only figures from this - // file batch are recorded. - $this->reporter->totalFiles = 0; - $this->reporter->totalErrors = 0; - $this->reporter->totalWarnings = 0; - $this->reporter->totalFixable = 0; - $this->reporter->totalFixed = 0; - - // Process the files. - $pathsProcessed = []; - ob_start(); - for ($i = $startAt; $i < $endAt; $i++) { - $path = $todo->key(); - $file = $todo->current(); - - if ($file->ignored === true) { - $todo->next(); - continue; - } - - $currDir = dirname($path); - if ($lastDir !== $currDir) { - if (PHP_CODESNIFFER_VERBOSITY > 0) { - echo 'Changing into directory '.Common::stripBasepath($currDir, $this->config->basepath).PHP_EOL; - } - - $lastDir = $currDir; - } - - $this->processFile($file); - - $pathsProcessed[] = $path; - $todo->next(); - }//end for - - $debugOutput = ob_get_contents(); - ob_end_clean(); - - // Write information about the run to the filesystem - // so it can be picked up by the main process. - $childOutput = [ - 'totalFiles' => $this->reporter->totalFiles, - 'totalErrors' => $this->reporter->totalErrors, - 'totalWarnings' => $this->reporter->totalWarnings, - 'totalFixable' => $this->reporter->totalFixable, - 'totalFixed' => $this->reporter->totalFixed, - ]; - - $output = '<'.'?php'."\n".' $childOutput = '; - $output .= var_export($childOutput, true); - $output .= ";\n\$debugOutput = "; - $output .= var_export($debugOutput, true); - - if ($this->config->cache === true) { - $childCache = []; - foreach ($pathsProcessed as $path) { - $childCache[$path] = Cache::get($path); - } - - $output .= ";\n\$childCache = "; - $output .= var_export($childCache, true); - } - - $output .= ";\n?".'>'; - file_put_contents($childOutFilename, $output); - exit($pid); - }//end if - }//end for - - $success = $this->processChildProcs($childProcs); - if ($success === false) { - throw new RuntimeException('One or more child processes failed to run'); - } - }//end if - - restore_error_handler(); - - if (PHP_CODESNIFFER_VERBOSITY === 0 - && $this->config->interactive === false - && $this->config->showProgress === true - ) { - echo PHP_EOL.PHP_EOL; - } - - if ($this->config->cache === true) { - Cache::save(); - } - - $ignoreWarnings = Config::getConfigData('ignore_warnings_on_exit'); - $ignoreErrors = Config::getConfigData('ignore_errors_on_exit'); - - $return = ($this->reporter->totalErrors + $this->reporter->totalWarnings); - if ($ignoreErrors !== null) { - $ignoreErrors = (bool) $ignoreErrors; - if ($ignoreErrors === true) { - $return -= $this->reporter->totalErrors; - } - } - - if ($ignoreWarnings !== null) { - $ignoreWarnings = (bool) $ignoreWarnings; - if ($ignoreWarnings === true) { - $return -= $this->reporter->totalWarnings; - } - } - - return $return; - - }//end run() - - - /** - * Converts all PHP errors into exceptions. - * - * This method forces a sniff to stop processing if it is not - * able to handle a specific piece of code, instead of continuing - * and potentially getting into a loop. - * - * @param int $code The level of error raised. - * @param string $message The error message. - * @param string $file The path of the file that raised the error. - * @param int $line The line number the error was raised at. - * - * @return void - * @throws \PHP_CodeSniffer\Exceptions\RuntimeException - */ - public function handleErrors($code, $message, $file, $line) - { - if ((error_reporting() & $code) === 0) { - // This type of error is being muted. - return true; - } - - throw new RuntimeException("$message in $file on line $line"); - - }//end handleErrors() - - - /** - * Processes a single file, including checking and fixing. - * - * @param \PHP_CodeSniffer\Files\File $file The file to be processed. - * - * @return void - * @throws \PHP_CodeSniffer\Exceptions\DeepExitException - */ - public function processFile($file) - { - if (PHP_CODESNIFFER_VERBOSITY > 0) { - $startTime = microtime(true); - echo 'Processing '.basename($file->path).' '; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo PHP_EOL; - } - } - - try { - $file->process(); - - if (PHP_CODESNIFFER_VERBOSITY > 0) { - $timeTaken = ((microtime(true) - $startTime) * 1000); - if ($timeTaken < 1000) { - $timeTaken = round($timeTaken); - echo "DONE in {$timeTaken}ms"; - } else { - $timeTaken = round(($timeTaken / 1000), 2); - echo "DONE in $timeTaken secs"; - } - - if (PHP_CODESNIFFER_CBF === true) { - $errors = $file->getFixableCount(); - echo " ($errors fixable violations)".PHP_EOL; - } else { - $errors = $file->getErrorCount(); - $warnings = $file->getWarningCount(); - echo " ($errors errors, $warnings warnings)".PHP_EOL; - } - } - } catch (\Exception $e) { - $error = 'An error occurred during processing; checking has been aborted. The error message was: '.$e->getMessage(); - $file->addErrorOnLine($error, 1, 'Internal.Exception'); - }//end try - - $this->reporter->cacheFileReport($file, $this->config); - - if ($this->config->interactive === true) { - /* - Running interactively. - Print the error report for the current file and then wait for user input. - */ - - // Get current violations and then clear the list to make sure - // we only print violations for a single file each time. - $numErrors = null; - while ($numErrors !== 0) { - $numErrors = ($file->getErrorCount() + $file->getWarningCount()); - if ($numErrors === 0) { - continue; - } - - $this->reporter->printReport('full'); - - echo ' to recheck, [s] to skip or [q] to quit : '; - $input = fgets(STDIN); - $input = trim($input); - - switch ($input) { - case 's': - break(2); - case 'q': - throw new DeepExitException('', 0); - default: - // Repopulate the sniffs because some of them save their state - // and only clear it when the file changes, but we are rechecking - // the same file. - $file->ruleset->populateTokenListeners(); - $file->reloadContent(); - $file->process(); - $this->reporter->cacheFileReport($file, $this->config); - break; - } - }//end while - }//end if - - // Clean up the file to save (a lot of) memory. - $file->cleanUp(); - - }//end processFile() - - - /** - * Waits for child processes to complete and cleans up after them. - * - * The reporting information returned by each child process is merged - * into the main reporter class. - * - * @param array $childProcs An array of child processes to wait for. - * - * @return bool - */ - private function processChildProcs($childProcs) - { - $numProcessed = 0; - $totalBatches = count($childProcs); - - $success = true; - - while (count($childProcs) > 0) { - foreach ($childProcs as $key => $procData) { - $res = pcntl_waitpid($procData['pid'], $status, WNOHANG); - if ($res === $procData['pid']) { - if (file_exists($procData['out']) === true) { - include $procData['out']; - - unlink($procData['out']); - unset($childProcs[$key]); - - $numProcessed++; - - if (isset($childOutput) === false) { - // The child process died, so the run has failed. - $file = new DummyFile('', $this->ruleset, $this->config); - $file->setErrorCounts(1, 0, 0, 0); - $this->printProgress($file, $totalBatches, $numProcessed); - $success = false; - continue; - } - - $this->reporter->totalFiles += $childOutput['totalFiles']; - $this->reporter->totalErrors += $childOutput['totalErrors']; - $this->reporter->totalWarnings += $childOutput['totalWarnings']; - $this->reporter->totalFixable += $childOutput['totalFixable']; - $this->reporter->totalFixed += $childOutput['totalFixed']; - - if (isset($debugOutput) === true) { - echo $debugOutput; - } - - if (isset($childCache) === true) { - foreach ($childCache as $path => $cache) { - Cache::set($path, $cache); - } - } - - // Fake a processed file so we can print progress output for the batch. - $file = new DummyFile('', $this->ruleset, $this->config); - $file->setErrorCounts( - $childOutput['totalErrors'], - $childOutput['totalWarnings'], - $childOutput['totalFixable'], - $childOutput['totalFixed'] - ); - $this->printProgress($file, $totalBatches, $numProcessed); - }//end if - }//end if - }//end foreach - }//end while - - return $success; - - }//end processChildProcs() - - - /** - * Print progress information for a single processed file. - * - * @param \PHP_CodeSniffer\Files\File $file The file that was processed. - * @param int $numFiles The total number of files to process. - * @param int $numProcessed The number of files that have been processed, - * including this one. - * - * @return void - */ - public function printProgress(File $file, $numFiles, $numProcessed) - { - if (PHP_CODESNIFFER_VERBOSITY > 0 - || $this->config->showProgress === false - ) { - return; - } - - // Show progress information. - if ($file->ignored === true) { - echo 'S'; - } else { - $errors = $file->getErrorCount(); - $warnings = $file->getWarningCount(); - $fixable = $file->getFixableCount(); - $fixed = $file->getFixedCount(); - - if (PHP_CODESNIFFER_CBF === true) { - // Files with fixed errors or warnings are F (green). - // Files with unfixable errors or warnings are E (red). - // Files with no errors or warnings are . (black). - if ($fixable > 0) { - if ($this->config->colors === true) { - echo "\033[31m"; - } - - echo 'E'; - - if ($this->config->colors === true) { - echo "\033[0m"; - } - } else if ($fixed > 0) { - if ($this->config->colors === true) { - echo "\033[32m"; - } - - echo 'F'; - - if ($this->config->colors === true) { - echo "\033[0m"; - } - } else { - echo '.'; - }//end if - } else { - // Files with errors are E (red). - // Files with fixable errors are E (green). - // Files with warnings are W (yellow). - // Files with fixable warnings are W (green). - // Files with no errors or warnings are . (black). - if ($errors > 0) { - if ($this->config->colors === true) { - if ($fixable > 0) { - echo "\033[32m"; - } else { - echo "\033[31m"; - } - } - - echo 'E'; - - if ($this->config->colors === true) { - echo "\033[0m"; - } - } else if ($warnings > 0) { - if ($this->config->colors === true) { - if ($fixable > 0) { - echo "\033[32m"; - } else { - echo "\033[33m"; - } - } - - echo 'W'; - - if ($this->config->colors === true) { - echo "\033[0m"; - } - } else { - echo '.'; - }//end if - }//end if - }//end if - - $numPerLine = 60; - if ($numProcessed !== $numFiles && ($numProcessed % $numPerLine) !== 0) { - return; - } - - $percent = round(($numProcessed / $numFiles) * 100); - $padding = (strlen($numFiles) - strlen($numProcessed)); - if ($numProcessed === $numFiles - && $numFiles > $numPerLine - && ($numProcessed % $numPerLine) !== 0 - ) { - $padding += ($numPerLine - ($numFiles - (floor($numFiles / $numPerLine) * $numPerLine))); - } - - echo str_repeat(' ', $padding)." $numProcessed / $numFiles ($percent%)".PHP_EOL; - - }//end printProgress() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractArraySniff.php b/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractArraySniff.php deleted file mode 100644 index 141b9a1..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractArraySniff.php +++ /dev/null @@ -1,172 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Sniffs; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Util\Tokens; - -abstract class AbstractArraySniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - final public function register() - { - return [ - T_ARRAY, - T_OPEN_SHORT_ARRAY, - ]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being checked. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if ($tokens[$stackPtr]['code'] === T_ARRAY) { - $phpcsFile->recordMetric($stackPtr, 'Short array syntax used', 'no'); - - $arrayStart = $tokens[$stackPtr]['parenthesis_opener']; - if (isset($tokens[$arrayStart]['parenthesis_closer']) === false) { - // Incomplete array. - return; - } - - $arrayEnd = $tokens[$arrayStart]['parenthesis_closer']; - } else { - $phpcsFile->recordMetric($stackPtr, 'Short array syntax used', 'yes'); - $arrayStart = $stackPtr; - $arrayEnd = $tokens[$stackPtr]['bracket_closer']; - } - - $lastContent = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($arrayEnd - 1), null, true); - if ($tokens[$lastContent]['code'] === T_COMMA) { - // Last array item ends with a comma. - $phpcsFile->recordMetric($stackPtr, 'Array end comma', 'yes'); - } else { - $phpcsFile->recordMetric($stackPtr, 'Array end comma', 'no'); - } - - $indices = []; - - $current = $arrayStart; - while (($next = $phpcsFile->findNext(Tokens::$emptyTokens, ($current + 1), $arrayEnd, true)) !== false) { - $end = $this->getNext($phpcsFile, $next, $arrayEnd); - - if ($tokens[$end]['code'] === T_DOUBLE_ARROW) { - $indexEnd = $phpcsFile->findPrevious(T_WHITESPACE, ($end - 1), null, true); - $valueStart = $phpcsFile->findNext(Tokens::$emptyTokens, ($end + 1), null, true); - - $indices[] = [ - 'index_start' => $next, - 'index_end' => $indexEnd, - 'arrow' => $end, - 'value_start' => $valueStart, - ]; - } else { - $valueStart = $next; - $indices[] = ['value_start' => $valueStart]; - } - - $current = $this->getNext($phpcsFile, $valueStart, $arrayEnd); - } - - if ($tokens[$arrayStart]['line'] === $tokens[$arrayEnd]['line']) { - $this->processSingleLineArray($phpcsFile, $stackPtr, $arrayStart, $arrayEnd, $indices); - } else { - $this->processMultiLineArray($phpcsFile, $stackPtr, $arrayStart, $arrayEnd, $indices); - } - - }//end process() - - - /** - * Find next separator in array - either: comma or double arrow. - * - * @param File $phpcsFile The current file being checked. - * @param int $ptr The position of current token. - * @param int $arrayEnd The token that ends the array definition. - * - * @return int - */ - private function getNext(File $phpcsFile, $ptr, $arrayEnd) - { - $tokens = $phpcsFile->getTokens(); - - while ($ptr < $arrayEnd) { - if (isset($tokens[$ptr]['scope_closer']) === true) { - $ptr = $tokens[$ptr]['scope_closer']; - } else if (isset($tokens[$ptr]['parenthesis_closer']) === true) { - $ptr = $tokens[$ptr]['parenthesis_closer']; - } else if (isset($tokens[$ptr]['bracket_closer']) === true) { - $ptr = $tokens[$ptr]['bracket_closer']; - } - - if ($tokens[$ptr]['code'] === T_COMMA - || $tokens[$ptr]['code'] === T_DOUBLE_ARROW - ) { - return $ptr; - } - - ++$ptr; - } - - return $ptr; - - }//end getNext() - - - /** - * Processes a single-line array definition. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being checked. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * @param int $arrayStart The token that starts the array definition. - * @param int $arrayEnd The token that ends the array definition. - * @param array $indices An array of token positions for the array keys, - * double arrows, and values. - * - * @return void - */ - abstract protected function processSingleLineArray($phpcsFile, $stackPtr, $arrayStart, $arrayEnd, $indices); - - - /** - * Processes a multi-line array definition. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being checked. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * @param int $arrayStart The token that starts the array definition. - * @param int $arrayEnd The token that ends the array definition. - * @param array $indices An array of token positions for the array keys, - * double arrows, and values. - * - * @return void - */ - abstract protected function processMultiLineArray($phpcsFile, $stackPtr, $arrayStart, $arrayEnd, $indices); - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractPatternSniff.php b/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractPatternSniff.php deleted file mode 100644 index 66bc2f5..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractPatternSniff.php +++ /dev/null @@ -1,936 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Sniffs; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Util\Tokens; -use PHP_CodeSniffer\Tokenizers\PHP; -use PHP_CodeSniffer\Exceptions\RuntimeException; - -abstract class AbstractPatternSniff implements Sniff -{ - - /** - * If true, comments will be ignored if they are found in the code. - * - * @var boolean - */ - public $ignoreComments = false; - - /** - * The current file being checked. - * - * @var string - */ - protected $currFile = ''; - - /** - * The parsed patterns array. - * - * @var array - */ - private $parsedPatterns = []; - - /** - * Tokens that this sniff wishes to process outside of the patterns. - * - * @var int[] - * @see registerSupplementary() - * @see processSupplementary() - */ - private $supplementaryTokens = []; - - /** - * Positions in the stack where errors have occurred. - * - * @var array - */ - private $errorPos = []; - - - /** - * Constructs a AbstractPatternSniff. - * - * @param boolean $ignoreComments If true, comments will be ignored. - */ - public function __construct($ignoreComments=null) - { - // This is here for backwards compatibility. - if ($ignoreComments !== null) { - $this->ignoreComments = $ignoreComments; - } - - $this->supplementaryTokens = $this->registerSupplementary(); - - }//end __construct() - - - /** - * Registers the tokens to listen to. - * - * Classes extending AbstractPatternTest should implement the - * getPatterns() method to register the patterns they wish to test. - * - * @return int[] - * @see process() - */ - final public function register() - { - $listenTypes = []; - $patterns = $this->getPatterns(); - - foreach ($patterns as $pattern) { - $parsedPattern = $this->parse($pattern); - - // Find a token position in the pattern that we can use - // for a listener token. - $pos = $this->getListenerTokenPos($parsedPattern); - $tokenType = $parsedPattern[$pos]['token']; - $listenTypes[] = $tokenType; - - $patternArray = [ - 'listen_pos' => $pos, - 'pattern' => $parsedPattern, - 'pattern_code' => $pattern, - ]; - - if (isset($this->parsedPatterns[$tokenType]) === false) { - $this->parsedPatterns[$tokenType] = []; - } - - $this->parsedPatterns[$tokenType][] = $patternArray; - }//end foreach - - return array_unique(array_merge($listenTypes, $this->supplementaryTokens)); - - }//end register() - - - /** - * Returns the token types that the specified pattern is checking for. - * - * Returned array is in the format: - * - * array( - * T_WHITESPACE => 0, // 0 is the position where the T_WHITESPACE token - * // should occur in the pattern. - * ); - * - * - * @param array $pattern The parsed pattern to find the acquire the token - * types from. - * - * @return array - */ - private function getPatternTokenTypes($pattern) - { - $tokenTypes = []; - foreach ($pattern as $pos => $patternInfo) { - if ($patternInfo['type'] === 'token') { - if (isset($tokenTypes[$patternInfo['token']]) === false) { - $tokenTypes[$patternInfo['token']] = $pos; - } - } - } - - return $tokenTypes; - - }//end getPatternTokenTypes() - - - /** - * Returns the position in the pattern that this test should register as - * a listener for the pattern. - * - * @param array $pattern The pattern to acquire the listener for. - * - * @return int The position in the pattern that this test should register - * as the listener. - * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If we could not determine a token to listen for. - */ - private function getListenerTokenPos($pattern) - { - $tokenTypes = $this->getPatternTokenTypes($pattern); - $tokenCodes = array_keys($tokenTypes); - $token = Tokens::getHighestWeightedToken($tokenCodes); - - // If we could not get a token. - if ($token === false) { - $error = 'Could not determine a token to listen for'; - throw new RuntimeException($error); - } - - return $tokenTypes[$token]; - - }//end getListenerTokenPos() - - - /** - * Processes the test. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The PHP_CodeSniffer file where the - * token occurred. - * @param int $stackPtr The position in the tokens stack - * where the listening token type - * was found. - * - * @return void - * @see register() - */ - final public function process(File $phpcsFile, $stackPtr) - { - $file = $phpcsFile->getFilename(); - if ($this->currFile !== $file) { - // We have changed files, so clean up. - $this->errorPos = []; - $this->currFile = $file; - } - - $tokens = $phpcsFile->getTokens(); - - if (in_array($tokens[$stackPtr]['code'], $this->supplementaryTokens, true) === true) { - $this->processSupplementary($phpcsFile, $stackPtr); - } - - $type = $tokens[$stackPtr]['code']; - - // If the type is not set, then it must have been a token registered - // with registerSupplementary(). - if (isset($this->parsedPatterns[$type]) === false) { - return; - } - - $allErrors = []; - - // Loop over each pattern that is listening to the current token type - // that we are processing. - foreach ($this->parsedPatterns[$type] as $patternInfo) { - // If processPattern returns false, then the pattern that we are - // checking the code with must not be designed to check that code. - $errors = $this->processPattern($patternInfo, $phpcsFile, $stackPtr); - if ($errors === false) { - // The pattern didn't match. - continue; - } else if (empty($errors) === true) { - // The pattern matched, but there were no errors. - break; - } - - foreach ($errors as $stackPtr => $error) { - if (isset($this->errorPos[$stackPtr]) === false) { - $this->errorPos[$stackPtr] = true; - $allErrors[$stackPtr] = $error; - } - } - } - - foreach ($allErrors as $stackPtr => $error) { - $phpcsFile->addError($error, $stackPtr, 'Found'); - } - - }//end process() - - - /** - * Processes the pattern and verifies the code at $stackPtr. - * - * @param array $patternInfo Information about the pattern used - * for checking, which includes are - * parsed token representation of the - * pattern. - * @param \PHP_CodeSniffer\Files\File $phpcsFile The PHP_CodeSniffer file where the - * token occurred. - * @param int $stackPtr The position in the tokens stack where - * the listening token type was found. - * - * @return array - */ - protected function processPattern($patternInfo, File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $pattern = $patternInfo['pattern']; - $patternCode = $patternInfo['pattern_code']; - $errors = []; - $found = ''; - - $ignoreTokens = [T_WHITESPACE => T_WHITESPACE]; - if ($this->ignoreComments === true) { - $ignoreTokens += Tokens::$commentTokens; - } - - $origStackPtr = $stackPtr; - $hasError = false; - - if ($patternInfo['listen_pos'] > 0) { - $stackPtr--; - - for ($i = ($patternInfo['listen_pos'] - 1); $i >= 0; $i--) { - if ($pattern[$i]['type'] === 'token') { - if ($pattern[$i]['token'] === T_WHITESPACE) { - if ($tokens[$stackPtr]['code'] === T_WHITESPACE) { - $found = $tokens[$stackPtr]['content'].$found; - } - - // Only check the size of the whitespace if this is not - // the first token. We don't care about the size of - // leading whitespace, just that there is some. - if ($i !== 0) { - if ($tokens[$stackPtr]['content'] !== $pattern[$i]['value']) { - $hasError = true; - } - } - } else { - // Check to see if this important token is the same as the - // previous important token in the pattern. If it is not, - // then the pattern cannot be for this piece of code. - $prev = $phpcsFile->findPrevious( - $ignoreTokens, - $stackPtr, - null, - true - ); - - if ($prev === false - || $tokens[$prev]['code'] !== $pattern[$i]['token'] - ) { - return false; - } - - // If we skipped past some whitespace tokens, then add them - // to the found string. - $tokenContent = $phpcsFile->getTokensAsString( - ($prev + 1), - ($stackPtr - $prev - 1) - ); - - $found = $tokens[$prev]['content'].$tokenContent.$found; - - if (isset($pattern[($i - 1)]) === true - && $pattern[($i - 1)]['type'] === 'skip' - ) { - $stackPtr = $prev; - } else { - $stackPtr = ($prev - 1); - } - }//end if - } else if ($pattern[$i]['type'] === 'skip') { - // Skip to next piece of relevant code. - if ($pattern[$i]['to'] === 'parenthesis_closer') { - $to = 'parenthesis_opener'; - } else { - $to = 'scope_opener'; - } - - // Find the previous opener. - $next = $phpcsFile->findPrevious( - $ignoreTokens, - $stackPtr, - null, - true - ); - - if ($next === false || isset($tokens[$next][$to]) === false) { - // If there was not opener, then we must be - // using the wrong pattern. - return false; - } - - if ($to === 'parenthesis_opener') { - $found = '{'.$found; - } else { - $found = '('.$found; - } - - $found = '...'.$found; - - // Skip to the opening token. - $stackPtr = ($tokens[$next][$to] - 1); - } else if ($pattern[$i]['type'] === 'string') { - $found = 'abc'; - } else if ($pattern[$i]['type'] === 'newline') { - if ($this->ignoreComments === true - && isset(Tokens::$commentTokens[$tokens[$stackPtr]['code']]) === true - ) { - $startComment = $phpcsFile->findPrevious( - Tokens::$commentTokens, - ($stackPtr - 1), - null, - true - ); - - if ($tokens[$startComment]['line'] !== $tokens[($startComment + 1)]['line']) { - $startComment++; - } - - $tokenContent = $phpcsFile->getTokensAsString( - $startComment, - ($stackPtr - $startComment + 1) - ); - - $found = $tokenContent.$found; - $stackPtr = ($startComment - 1); - } - - if ($tokens[$stackPtr]['code'] === T_WHITESPACE) { - if ($tokens[$stackPtr]['content'] !== $phpcsFile->eolChar) { - $found = $tokens[$stackPtr]['content'].$found; - - // This may just be an indent that comes after a newline - // so check the token before to make sure. If it is a newline, we - // can ignore the error here. - if (($tokens[($stackPtr - 1)]['content'] !== $phpcsFile->eolChar) - && ($this->ignoreComments === true - && isset(Tokens::$commentTokens[$tokens[($stackPtr - 1)]['code']]) === false) - ) { - $hasError = true; - } else { - $stackPtr--; - } - } else { - $found = 'EOL'.$found; - } - } else { - $found = $tokens[$stackPtr]['content'].$found; - $hasError = true; - }//end if - - if ($hasError === false && $pattern[($i - 1)]['type'] !== 'newline') { - // Make sure they only have 1 newline. - $prev = $phpcsFile->findPrevious($ignoreTokens, ($stackPtr - 1), null, true); - if ($prev !== false && $tokens[$prev]['line'] !== $tokens[$stackPtr]['line']) { - $hasError = true; - } - } - }//end if - }//end for - }//end if - - $stackPtr = $origStackPtr; - $lastAddedStackPtr = null; - $patternLen = count($pattern); - - for ($i = $patternInfo['listen_pos']; $i < $patternLen; $i++) { - if (isset($tokens[$stackPtr]) === false) { - break; - } - - if ($pattern[$i]['type'] === 'token') { - if ($pattern[$i]['token'] === T_WHITESPACE) { - if ($this->ignoreComments === true) { - // If we are ignoring comments, check to see if this current - // token is a comment. If so skip it. - if (isset(Tokens::$commentTokens[$tokens[$stackPtr]['code']]) === true) { - continue; - } - - // If the next token is a comment, the we need to skip the - // current token as we should allow a space before a - // comment for readability. - if (isset($tokens[($stackPtr + 1)]) === true - && isset(Tokens::$commentTokens[$tokens[($stackPtr + 1)]['code']]) === true - ) { - continue; - } - } - - $tokenContent = ''; - if ($tokens[$stackPtr]['code'] === T_WHITESPACE) { - if (isset($pattern[($i + 1)]) === false) { - // This is the last token in the pattern, so just compare - // the next token of content. - $tokenContent = $tokens[$stackPtr]['content']; - } else { - // Get all the whitespace to the next token. - $next = $phpcsFile->findNext( - Tokens::$emptyTokens, - $stackPtr, - null, - true - ); - - $tokenContent = $phpcsFile->getTokensAsString( - $stackPtr, - ($next - $stackPtr) - ); - - $lastAddedStackPtr = $stackPtr; - $stackPtr = $next; - }//end if - - if ($stackPtr !== $lastAddedStackPtr) { - $found .= $tokenContent; - } - } else { - if ($stackPtr !== $lastAddedStackPtr) { - $found .= $tokens[$stackPtr]['content']; - $lastAddedStackPtr = $stackPtr; - } - }//end if - - if (isset($pattern[($i + 1)]) === true - && $pattern[($i + 1)]['type'] === 'skip' - ) { - // The next token is a skip token, so we just need to make - // sure the whitespace we found has *at least* the - // whitespace required. - if (strpos($tokenContent, $pattern[$i]['value']) !== 0) { - $hasError = true; - } - } else { - if ($tokenContent !== $pattern[$i]['value']) { - $hasError = true; - } - } - } else { - // Check to see if this important token is the same as the - // next important token in the pattern. If it is not, then - // the pattern cannot be for this piece of code. - $next = $phpcsFile->findNext( - $ignoreTokens, - $stackPtr, - null, - true - ); - - if ($next === false - || $tokens[$next]['code'] !== $pattern[$i]['token'] - ) { - // The next important token did not match the pattern. - return false; - } - - if ($lastAddedStackPtr !== null) { - if (($tokens[$next]['code'] === T_OPEN_CURLY_BRACKET - || $tokens[$next]['code'] === T_CLOSE_CURLY_BRACKET) - && isset($tokens[$next]['scope_condition']) === true - && $tokens[$next]['scope_condition'] > $lastAddedStackPtr - ) { - // This is a brace, but the owner of it is after the current - // token, which means it does not belong to any token in - // our pattern. This means the pattern is not for us. - return false; - } - - if (($tokens[$next]['code'] === T_OPEN_PARENTHESIS - || $tokens[$next]['code'] === T_CLOSE_PARENTHESIS) - && isset($tokens[$next]['parenthesis_owner']) === true - && $tokens[$next]['parenthesis_owner'] > $lastAddedStackPtr - ) { - // This is a bracket, but the owner of it is after the current - // token, which means it does not belong to any token in - // our pattern. This means the pattern is not for us. - return false; - } - }//end if - - // If we skipped past some whitespace tokens, then add them - // to the found string. - if (($next - $stackPtr) > 0) { - $hasComment = false; - for ($j = $stackPtr; $j < $next; $j++) { - $found .= $tokens[$j]['content']; - if (isset(Tokens::$commentTokens[$tokens[$j]['code']]) === true) { - $hasComment = true; - } - } - - // If we are not ignoring comments, this additional - // whitespace or comment is not allowed. If we are - // ignoring comments, there needs to be at least one - // comment for this to be allowed. - if ($this->ignoreComments === false - || ($this->ignoreComments === true - && $hasComment === false) - ) { - $hasError = true; - } - - // Even when ignoring comments, we are not allowed to include - // newlines without the pattern specifying them, so - // everything should be on the same line. - if ($tokens[$next]['line'] !== $tokens[$stackPtr]['line']) { - $hasError = true; - } - }//end if - - if ($next !== $lastAddedStackPtr) { - $found .= $tokens[$next]['content']; - $lastAddedStackPtr = $next; - } - - if (isset($pattern[($i + 1)]) === true - && $pattern[($i + 1)]['type'] === 'skip' - ) { - $stackPtr = $next; - } else { - $stackPtr = ($next + 1); - } - }//end if - } else if ($pattern[$i]['type'] === 'skip') { - if ($pattern[$i]['to'] === 'unknown') { - $next = $phpcsFile->findNext( - $pattern[($i + 1)]['token'], - $stackPtr - ); - - if ($next === false) { - // Couldn't find the next token, so we must - // be using the wrong pattern. - return false; - } - - $found .= '...'; - $stackPtr = $next; - } else { - // Find the previous opener. - $next = $phpcsFile->findPrevious( - Tokens::$blockOpeners, - $stackPtr - ); - - if ($next === false - || isset($tokens[$next][$pattern[$i]['to']]) === false - ) { - // If there was not opener, then we must - // be using the wrong pattern. - return false; - } - - $found .= '...'; - if ($pattern[$i]['to'] === 'parenthesis_closer') { - $found .= ')'; - } else { - $found .= '}'; - } - - // Skip to the closing token. - $stackPtr = ($tokens[$next][$pattern[$i]['to']] + 1); - }//end if - } else if ($pattern[$i]['type'] === 'string') { - if ($tokens[$stackPtr]['code'] !== T_STRING) { - $hasError = true; - } - - if ($stackPtr !== $lastAddedStackPtr) { - $found .= 'abc'; - $lastAddedStackPtr = $stackPtr; - } - - $stackPtr++; - } else if ($pattern[$i]['type'] === 'newline') { - // Find the next token that contains a newline character. - $newline = 0; - for ($j = $stackPtr; $j < $phpcsFile->numTokens; $j++) { - if (strpos($tokens[$j]['content'], $phpcsFile->eolChar) !== false) { - $newline = $j; - break; - } - } - - if ($newline === 0) { - // We didn't find a newline character in the rest of the file. - $next = ($phpcsFile->numTokens - 1); - $hasError = true; - } else { - if ($this->ignoreComments === false) { - // The newline character cannot be part of a comment. - if (isset(Tokens::$commentTokens[$tokens[$newline]['code']]) === true) { - $hasError = true; - } - } - - if ($newline === $stackPtr) { - $next = ($stackPtr + 1); - } else { - // Check that there were no significant tokens that we - // skipped over to find our newline character. - $next = $phpcsFile->findNext( - $ignoreTokens, - $stackPtr, - null, - true - ); - - if ($next < $newline) { - // We skipped a non-ignored token. - $hasError = true; - } else { - $next = ($newline + 1); - } - } - }//end if - - if ($stackPtr !== $lastAddedStackPtr) { - $found .= $phpcsFile->getTokensAsString( - $stackPtr, - ($next - $stackPtr) - ); - - $lastAddedStackPtr = ($next - 1); - } - - $stackPtr = $next; - }//end if - }//end for - - if ($hasError === true) { - $error = $this->prepareError($found, $patternCode); - $errors[$origStackPtr] = $error; - } - - return $errors; - - }//end processPattern() - - - /** - * Prepares an error for the specified patternCode. - * - * @param string $found The actual found string in the code. - * @param string $patternCode The expected pattern code. - * - * @return string The error message. - */ - protected function prepareError($found, $patternCode) - { - $found = str_replace("\r\n", '\n', $found); - $found = str_replace("\n", '\n', $found); - $found = str_replace("\r", '\n', $found); - $found = str_replace("\t", '\t', $found); - $found = str_replace('EOL', '\n', $found); - $expected = str_replace('EOL', '\n', $patternCode); - - $error = "Expected \"$expected\"; found \"$found\""; - - return $error; - - }//end prepareError() - - - /** - * Returns the patterns that should be checked. - * - * @return string[] - */ - abstract protected function getPatterns(); - - - /** - * Registers any supplementary tokens that this test might wish to process. - * - * A sniff may wish to register supplementary tests when it wishes to group - * an arbitrary validation that cannot be performed using a pattern, with - * other pattern tests. - * - * @return int[] - * @see processSupplementary() - */ - protected function registerSupplementary() - { - return []; - - }//end registerSupplementary() - - - /** - * Processes any tokens registered with registerSupplementary(). - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The PHP_CodeSniffer file where to - * process the skip. - * @param int $stackPtr The position in the tokens stack to - * process. - * - * @return void - * @see registerSupplementary() - */ - protected function processSupplementary(File $phpcsFile, $stackPtr) - { - - }//end processSupplementary() - - - /** - * Parses a pattern string into an array of pattern steps. - * - * @param string $pattern The pattern to parse. - * - * @return array The parsed pattern array. - * @see createSkipPattern() - * @see createTokenPattern() - */ - private function parse($pattern) - { - $patterns = []; - $length = strlen($pattern); - $lastToken = 0; - $firstToken = 0; - - for ($i = 0; $i < $length; $i++) { - $specialPattern = false; - $isLastChar = ($i === ($length - 1)); - $oldFirstToken = $firstToken; - - if (substr($pattern, $i, 3) === '...') { - // It's a skip pattern. The skip pattern requires the - // content of the token in the "from" position and the token - // to skip to. - $specialPattern = $this->createSkipPattern($pattern, ($i - 1)); - $lastToken = ($i - $firstToken); - $firstToken = ($i + 3); - $i += 2; - - if ($specialPattern['to'] !== 'unknown') { - $firstToken++; - } - } else if (substr($pattern, $i, 3) === 'abc') { - $specialPattern = ['type' => 'string']; - $lastToken = ($i - $firstToken); - $firstToken = ($i + 3); - $i += 2; - } else if (substr($pattern, $i, 3) === 'EOL') { - $specialPattern = ['type' => 'newline']; - $lastToken = ($i - $firstToken); - $firstToken = ($i + 3); - $i += 2; - }//end if - - if ($specialPattern !== false || $isLastChar === true) { - // If we are at the end of the string, don't worry about a limit. - if ($isLastChar === true) { - // Get the string from the end of the last skip pattern, if any, - // to the end of the pattern string. - $str = substr($pattern, $oldFirstToken); - } else { - // Get the string from the end of the last special pattern, - // if any, to the start of this special pattern. - if ($lastToken === 0) { - // Note that if the last special token was zero characters ago, - // there will be nothing to process so we can skip this bit. - // This happens if you have something like: EOL... in your pattern. - $str = ''; - } else { - $str = substr($pattern, $oldFirstToken, $lastToken); - } - } - - if ($str !== '') { - $tokenPatterns = $this->createTokenPattern($str); - foreach ($tokenPatterns as $tokenPattern) { - $patterns[] = $tokenPattern; - } - } - - // Make sure we don't skip the last token. - if ($isLastChar === false && $i === ($length - 1)) { - $i--; - } - }//end if - - // Add the skip pattern *after* we have processed - // all the tokens from the end of the last skip pattern - // to the start of this skip pattern. - if ($specialPattern !== false) { - $patterns[] = $specialPattern; - } - }//end for - - return $patterns; - - }//end parse() - - - /** - * Creates a skip pattern. - * - * @param string $pattern The pattern being parsed. - * @param string $from The token content that the skip pattern starts from. - * - * @return array The pattern step. - * @see createTokenPattern() - * @see parse() - */ - private function createSkipPattern($pattern, $from) - { - $skip = ['type' => 'skip']; - - $nestedParenthesis = 0; - $nestedBraces = 0; - for ($start = $from; $start >= 0; $start--) { - switch ($pattern[$start]) { - case '(': - if ($nestedParenthesis === 0) { - $skip['to'] = 'parenthesis_closer'; - } - - $nestedParenthesis--; - break; - case '{': - if ($nestedBraces === 0) { - $skip['to'] = 'scope_closer'; - } - - $nestedBraces--; - break; - case '}': - $nestedBraces++; - break; - case ')': - $nestedParenthesis++; - break; - }//end switch - - if (isset($skip['to']) === true) { - break; - } - }//end for - - if (isset($skip['to']) === false) { - $skip['to'] = 'unknown'; - } - - return $skip; - - }//end createSkipPattern() - - - /** - * Creates a token pattern. - * - * @param string $str The tokens string that the pattern should match. - * - * @return array The pattern step. - * @see createSkipPattern() - * @see parse() - */ - private function createTokenPattern($str) - { - // Don't add a space after the closing php tag as it will add a new - // whitespace token. - $tokenizer = new PHP('', null); - - // Remove the getTokens(); - $tokens = array_slice($tokens, 1, (count($tokens) - 2)); - - $patterns = []; - foreach ($tokens as $patternInfo) { - $patterns[] = [ - 'type' => 'token', - 'token' => $patternInfo['code'], - 'value' => $patternInfo['content'], - ]; - } - - return $patterns; - - }//end createTokenPattern() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractScopeSniff.php b/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractScopeSniff.php deleted file mode 100644 index 70d8720..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractScopeSniff.php +++ /dev/null @@ -1,191 +0,0 @@ - - * class ClassScopeTest extends PHP_CodeSniffer_Standards_AbstractScopeSniff - * { - * public function __construct() - * { - * parent::__construct(array(T_CLASS), array(T_FUNCTION)); - * } - * - * protected function processTokenWithinScope(\PHP_CodeSniffer\Files\File $phpcsFile, $stackPtr, $currScope) - * { - * $className = $phpcsFile->getDeclarationName($currScope); - * echo 'encountered a method within class '.$className; - * } - * } - * - * - * @author Greg Sherwood - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Sniffs; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Exceptions\RuntimeException; - -abstract class AbstractScopeSniff implements Sniff -{ - - /** - * The token types that this test wishes to listen to within the scope. - * - * @var array - */ - private $tokens = []; - - /** - * The type of scope opener tokens that this test wishes to listen to. - * - * @var string - */ - private $scopeTokens = []; - - /** - * True if this test should fire on tokens outside of the scope. - * - * @var boolean - */ - private $listenOutside = false; - - - /** - * Constructs a new AbstractScopeTest. - * - * @param array $scopeTokens The type of scope the test wishes to listen to. - * @param array $tokens The tokens that the test wishes to listen to - * within the scope. - * @param boolean $listenOutside If true this test will also alert the - * extending class when a token is found outside - * the scope, by calling the - * processTokenOutsideScope method. - * - * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified tokens arrays are empty - * or invalid. - */ - public function __construct( - array $scopeTokens, - array $tokens, - $listenOutside=false - ) { - if (empty($scopeTokens) === true) { - $error = 'The scope tokens list cannot be empty'; - throw new RuntimeException($error); - } - - if (empty($tokens) === true) { - $error = 'The tokens list cannot be empty'; - throw new RuntimeException($error); - } - - $invalidScopeTokens = array_intersect($scopeTokens, $tokens); - if (empty($invalidScopeTokens) === false) { - $invalid = implode(', ', $invalidScopeTokens); - $error = "Scope tokens [$invalid] can't be in the tokens array"; - throw new RuntimeException($error); - } - - $this->listenOutside = $listenOutside; - $this->scopeTokens = array_flip($scopeTokens); - $this->tokens = $tokens; - - }//end __construct() - - - /** - * The method that is called to register the tokens this test wishes to - * listen to. - * - * DO NOT OVERRIDE THIS METHOD. Use the constructor of this class to register - * for the desired tokens and scope. - * - * @return int[] - * @see __constructor() - */ - final public function register() - { - return $this->tokens; - - }//end register() - - - /** - * Processes the tokens that this test is listening for. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position in the stack where this - * token was found. - * - * @return void|int Optionally returns a stack pointer. The sniff will not be - * called again on the current file until the returned stack - * pointer is reached. Return ($phpcsFile->numTokens + 1) to skip - * the rest of the file. - * @see processTokenWithinScope() - */ - final public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $foundScope = false; - $skipTokens = []; - foreach ($tokens[$stackPtr]['conditions'] as $scope => $code) { - if (isset($this->scopeTokens[$code]) === true) { - $skipTokens[] = $this->processTokenWithinScope($phpcsFile, $stackPtr, $scope); - $foundScope = true; - } - } - - if ($this->listenOutside === true && $foundScope === false) { - $skipTokens[] = $this->processTokenOutsideScope($phpcsFile, $stackPtr); - } - - if (empty($skipTokens) === false) { - return min($skipTokens); - } - - return; - - }//end process() - - - /** - * Processes a token that is found within the scope that this test is - * listening to. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position in the stack where this - * token was found. - * @param int $currScope The position in the tokens array that - * opened the scope that this test is - * listening for. - * - * @return void|int Optionally returns a stack pointer. The sniff will not be - * called again on the current file until the returned stack - * pointer is reached. Return ($phpcsFile->numTokens + 1) to skip - * the rest of the file. - */ - abstract protected function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScope); - - - /** - * Processes a token that is found outside the scope that this test is - * listening to. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position in the stack where this - * token was found. - * - * @return void|int Optionally returns a stack pointer. The sniff will not be - * called again on the current file until the returned stack - * pointer is reached. Return (count($tokens) + 1) to skip - * the rest of the file. - */ - abstract protected function processTokenOutsideScope(File $phpcsFile, $stackPtr); - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractVariableSniff.php b/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractVariableSniff.php deleted file mode 100644 index 5dc8ba5..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractVariableSniff.php +++ /dev/null @@ -1,230 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Sniffs; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Util\Tokens; - -abstract class AbstractVariableSniff extends AbstractScopeSniff -{ - - /** - * List of PHP Reserved variables. - * - * Used by various naming convention sniffs. - * - * @var array - */ - protected $phpReservedVars = [ - '_SERVER' => true, - '_GET' => true, - '_POST' => true, - '_REQUEST' => true, - '_SESSION' => true, - '_ENV' => true, - '_COOKIE' => true, - '_FILES' => true, - 'GLOBALS' => true, - 'http_response_header' => true, - 'HTTP_RAW_POST_DATA' => true, - 'php_errormsg' => true, - ]; - - - /** - * Constructs an AbstractVariableTest. - */ - public function __construct() - { - $scopes = Tokens::$ooScopeTokens; - - $listen = [ - T_VARIABLE, - T_DOUBLE_QUOTED_STRING, - T_HEREDOC, - ]; - - parent::__construct($scopes, $listen, true); - - }//end __construct() - - - /** - * Processes the token in the specified PHP_CodeSniffer\Files\File. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The PHP_CodeSniffer file where this - * token was found. - * @param int $stackPtr The position where the token was found. - * @param int $currScope The current scope opener token. - * - * @return void|int Optionally returns a stack pointer. The sniff will not be - * called again on the current file until the returned stack - * pointer is reached. Return ($phpcsFile->numTokens + 1) to skip - * the rest of the file. - */ - final protected function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScope) - { - $tokens = $phpcsFile->getTokens(); - - if ($tokens[$stackPtr]['code'] === T_DOUBLE_QUOTED_STRING - || $tokens[$stackPtr]['code'] === T_HEREDOC - ) { - // Check to see if this string has a variable in it. - $pattern = '|(?processVariableInString($phpcsFile, $stackPtr); - } - - return; - } - - // If this token is nested inside a function at a deeper - // level than the current OO scope that was found, it's a normal - // variable and not a member var. - $conditions = array_reverse($tokens[$stackPtr]['conditions'], true); - $inFunction = false; - foreach ($conditions as $scope => $code) { - if (isset(Tokens::$ooScopeTokens[$code]) === true) { - break; - } - - if ($code === T_FUNCTION || $code === T_CLOSURE) { - $inFunction = true; - } - } - - if ($scope !== $currScope) { - // We found a closer scope to this token, so ignore - // this particular time through the sniff. We will process - // this token when this closer scope is found to avoid - // duplicate checks. - return; - } - - // Just make sure this isn't a variable in a function declaration. - if ($inFunction === false && isset($tokens[$stackPtr]['nested_parenthesis']) === true) { - foreach ($tokens[$stackPtr]['nested_parenthesis'] as $opener => $closer) { - if (isset($tokens[$opener]['parenthesis_owner']) === false) { - // Check if this is a USE statement for a closure. - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($opener - 1), null, true); - if ($tokens[$prev]['code'] === T_USE) { - $inFunction = true; - break; - } - - continue; - } - - $owner = $tokens[$opener]['parenthesis_owner']; - if ($tokens[$owner]['code'] === T_FUNCTION - || $tokens[$owner]['code'] === T_CLOSURE - ) { - $inFunction = true; - break; - } - } - }//end if - - if ($inFunction === true) { - return $this->processVariable($phpcsFile, $stackPtr); - } else { - return $this->processMemberVar($phpcsFile, $stackPtr); - } - - }//end processTokenWithinScope() - - - /** - * Processes the token outside the scope in the file. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The PHP_CodeSniffer file where this - * token was found. - * @param int $stackPtr The position where the token was found. - * - * @return void|int Optionally returns a stack pointer. The sniff will not be - * called again on the current file until the returned stack - * pointer is reached. Return ($phpcsFile->numTokens + 1) to skip - * the rest of the file. - */ - final protected function processTokenOutsideScope(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - // These variables are not member vars. - if ($tokens[$stackPtr]['code'] === T_VARIABLE) { - return $this->processVariable($phpcsFile, $stackPtr); - } else if ($tokens[$stackPtr]['code'] === T_DOUBLE_QUOTED_STRING - || $tokens[$stackPtr]['code'] === T_HEREDOC - ) { - // Check to see if this string has a variable in it. - $pattern = '|(?processVariableInString($phpcsFile, $stackPtr); - } - } - - }//end processTokenOutsideScope() - - - /** - * Called to process class member vars. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The PHP_CodeSniffer file where this - * token was found. - * @param int $stackPtr The position where the token was found. - * - * @return void|int Optionally returns a stack pointer. The sniff will not be - * called again on the current file until the returned stack - * pointer is reached. Return ($phpcsFile->numTokens + 1) to skip - * the rest of the file. - */ - abstract protected function processMemberVar(File $phpcsFile, $stackPtr); - - - /** - * Called to process normal member vars. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The PHP_CodeSniffer file where this - * token was found. - * @param int $stackPtr The position where the token was found. - * - * @return void|int Optionally returns a stack pointer. The sniff will not be - * called again on the current file until the returned stack - * pointer is reached. Return ($phpcsFile->numTokens + 1) to skip - * the rest of the file. - */ - abstract protected function processVariable(File $phpcsFile, $stackPtr); - - - /** - * Called to process variables found in double quoted strings or heredocs. - * - * Note that there may be more than one variable in the string, which will - * result only in one call for the string or one call per line for heredocs. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The PHP_CodeSniffer file where this - * token was found. - * @param int $stackPtr The position where the double quoted - * string was found. - * - * @return void|int Optionally returns a stack pointer. The sniff will not be - * called again on the current file until the returned stack - * pointer is reached. Return ($phpcsFile->numTokens + 1) to skip - * the rest of the file. - */ - abstract protected function processVariableInString(File $phpcsFile, $stackPtr); - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Sniffs/Sniff.php b/vendor/squizlabs/php_codesniffer/src/Sniffs/Sniff.php deleted file mode 100644 index c9d7dae..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Sniffs/Sniff.php +++ /dev/null @@ -1,80 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Sniffs; - -use PHP_CodeSniffer\Files\File; - -interface Sniff -{ - - - /** - * Registers the tokens that this sniff wants to listen for. - * - * An example return value for a sniff that wants to listen for whitespace - * and any comments would be: - * - * - * return array( - * T_WHITESPACE, - * T_DOC_COMMENT, - * T_COMMENT, - * ); - * - * - * @return mixed[] - * @see Tokens.php - */ - public function register(); - - - /** - * Called when one of the token types that this sniff is listening for - * is found. - * - * The stackPtr variable indicates where in the stack the token was found. - * A sniff can acquire information this token, along with all the other - * tokens within the stack by first acquiring the token stack: - * - * - * $tokens = $phpcsFile->getTokens(); - * echo 'Encountered a '.$tokens[$stackPtr]['type'].' token'; - * echo 'token information: '; - * print_r($tokens[$stackPtr]); - * - * - * If the sniff discovers an anomaly in the code, they can raise an error - * by calling addError() on the \PHP_CodeSniffer\Files\File object, specifying an error - * message and the position of the offending token: - * - * - * $phpcsFile->addError('Encountered an error', $stackPtr); - * - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The PHP_CodeSniffer file where the - * token was found. - * @param int $stackPtr The position in the PHP_CodeSniffer - * file's token stack where the token - * was found. - * - * @return void|int Optionally returns a stack pointer. The sniff will not be - * called again on the current file until the returned stack - * pointer is reached. Return (count($tokens) + 1) to skip - * the rest of the file. - */ - public function process(File $phpcsFile, $stackPtr); - - -}//end interface diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Arrays/DisallowLongArraySyntaxStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Arrays/DisallowLongArraySyntaxStandard.xml deleted file mode 100644 index 21b0d27..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Arrays/DisallowLongArraySyntaxStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - [ - 'foo' => 'bar', -]; - ]]> - - - array( - 'foo' => 'bar', -); - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Arrays/DisallowShortArraySyntaxStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Arrays/DisallowShortArraySyntaxStandard.xml deleted file mode 100644 index f24767c..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Arrays/DisallowShortArraySyntaxStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - array( - 'foo' => 'bar', -); - ]]> - - - [ - 'foo' => 'bar', -]; - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Classes/DuplicateClassNameStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Classes/DuplicateClassNameStandard.xml deleted file mode 100644 index 4b0ec96..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Classes/DuplicateClassNameStandard.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - Foo -{ -} - ]]> - - - Foo -{ -} - -class Foo -{ -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Classes/OpeningBraceSameLineStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Classes/OpeningBraceSameLineStandard.xml deleted file mode 100644 index 6226a3f..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Classes/OpeningBraceSameLineStandard.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - { -} - ]]> - - - { -} - ]]> - - - // Start of class. -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/AssignmentInConditionStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/AssignmentInConditionStandard.xml deleted file mode 100644 index 9961ea0..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/AssignmentInConditionStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - $test === 'abc') { - // Code. -} - ]]> - - - $test = 'abc') { - // Code. -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/EmptyStatementStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/EmptyStatementStandard.xml deleted file mode 100644 index c400d75..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/EmptyStatementStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - // do nothing -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/ForLoopShouldBeWhileLoopStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/ForLoopShouldBeWhileLoopStandard.xml deleted file mode 100644 index 06f0b7a..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/ForLoopShouldBeWhileLoopStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - $i = 0; $i < 10; $i++) { - echo "{$i}\n"; -} - ]]> - - - ;$test;) { - $test = doSomething(); -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/ForLoopWithTestFunctionCallStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/ForLoopWithTestFunctionCallStandard.xml deleted file mode 100644 index f40d94b..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/ForLoopWithTestFunctionCallStandard.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - $end = count($foo); -for ($i = 0; $i < $end; $i++) { - echo $foo[$i]."\n"; -} - ]]> - - - count($foo); $i++) { - echo $foo[$i]."\n"; -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/JumbledIncrementerStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/JumbledIncrementerStandard.xml deleted file mode 100644 index 50f0782..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/JumbledIncrementerStandard.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - $i++) { - for ($j = 0; $j < 10; $j++) { - } -} - ]]> - - - $i++) { - for ($j = 0; $j < 10; $i++) { - } -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/UnconditionalIfStatementStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/UnconditionalIfStatementStandard.xml deleted file mode 100644 index b2eaabe..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/UnconditionalIfStatementStandard.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - $test) { - $var = 1; -} - ]]> - - - true) { - $var = 1; -} - ]]> - - - - - $test) { - $var = 1; -} - ]]> - - - false) { - $var = 1; -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/UnnecessaryFinalModifierStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/UnnecessaryFinalModifierStandard.xml deleted file mode 100644 index 8936740..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/UnnecessaryFinalModifierStandard.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - final function bar() - { - } -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/UnusedFunctionParameterStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/UnusedFunctionParameterStandard.xml deleted file mode 100644 index 181dff4..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/UnusedFunctionParameterStandard.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - $a + $b + $c; -} - ]]> - - - $a + $b; -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/UselessOverridingMethodStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/UselessOverridingMethodStandard.xml deleted file mode 100644 index ba8bd7e..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/UselessOverridingMethodStandard.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - $this->doSomethingElse(); - } -} - ]]> - - - parent::bar(); - } -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Commenting/FixmeStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Commenting/FixmeStandard.xml deleted file mode 100644 index 174c6b0..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Commenting/FixmeStandard.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - Handle strange case -if ($test) { - $var = 1; -} - ]]> - - - FIXME: This needs to be fixed! -if ($test) { - $var = 1; -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Commenting/TodoStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Commenting/TodoStandard.xml deleted file mode 100644 index c9c4fc0..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Commenting/TodoStandard.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - Handle strange case -if ($test) { - $var = 1; -} - ]]> - - - TODO: This needs to be fixed! -if ($test) { - $var = 1; -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/ControlStructures/DisallowYodaConditionsStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/ControlStructures/DisallowYodaConditionsStandard.xml deleted file mode 100644 index 570e419..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/ControlStructures/DisallowYodaConditionsStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - { - $var = 1; -} - ]]> - - - { - $var = 1; -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/ControlStructures/InlineControlStructureStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/ControlStructures/InlineControlStructureStandard.xml deleted file mode 100644 index 06ae14b..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/ControlStructures/InlineControlStructureStandard.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - { - $var = 1; -} - ]]> - - - - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Debug/CSSLintStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Debug/CSSLintStandard.xml deleted file mode 100644 index b57a970..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Debug/CSSLintStandard.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - %; } - ]]> - - - %; } - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Debug/ClosureLinterStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Debug/ClosureLinterStandard.xml deleted file mode 100644 index 9df9aec..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Debug/ClosureLinterStandard.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - ]; - ]]> - - - ,]; - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Debug/JSHintStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Debug/JSHintStandard.xml deleted file mode 100644 index 7525e9e..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Debug/JSHintStandard.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - var foo = 5; - ]]> - - - foo = 5; - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/ByteOrderMarkStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/ByteOrderMarkStandard.xml deleted file mode 100644 index 88591f9..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/ByteOrderMarkStandard.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/EndFileNewlineStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/EndFileNewlineStandard.xml deleted file mode 100644 index aa757ed..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/EndFileNewlineStandard.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/EndFileNoNewlineStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/EndFileNoNewlineStandard.xml deleted file mode 100644 index 227d562..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/EndFileNoNewlineStandard.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/ExecutableFileStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/ExecutableFileStandard.xml deleted file mode 100644 index 6114f24..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/ExecutableFileStandard.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/InlineHTMLStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/InlineHTMLStandard.xml deleted file mode 100644 index 3fbf502..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/InlineHTMLStandard.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - some string here - - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/LineEndingsStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/LineEndingsStandard.xml deleted file mode 100644 index 4554d0f..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/LineEndingsStandard.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/LineLengthStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/LineLengthStandard.xml deleted file mode 100644 index 31342e3..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/LineLengthStandard.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/LowercasedFilenameStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/LowercasedFilenameStandard.xml deleted file mode 100644 index a1be34c..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/LowercasedFilenameStandard.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/OneClassPerFileStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/OneClassPerFileStandard.xml deleted file mode 100644 index 7b58576..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/OneClassPerFileStandard.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - class Foo -{ -} - ]]> - - - class Foo -{ -} - -class Bar -{ -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/OneInterfacePerFileStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/OneInterfacePerFileStandard.xml deleted file mode 100644 index de97531..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/OneInterfacePerFileStandard.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - interface Foo -{ -} - ]]> - - - interface Foo -{ -} - -interface Bar -{ -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/OneObjectStructurePerFileStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/OneObjectStructurePerFileStandard.xml deleted file mode 100644 index 4d957e7..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/OneObjectStructurePerFileStandard.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - trait Foo -{ -} - ]]> - - - trait Foo -{ -} - -class Bar -{ -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/OneTraitPerFileStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/OneTraitPerFileStandard.xml deleted file mode 100644 index 58a6482..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/OneTraitPerFileStandard.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - trait Foo -{ -} - ]]> - - - trait Foo -{ -} - -trait Bar -{ -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Formatting/DisallowMultipleStatementsStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Formatting/DisallowMultipleStatementsStandard.xml deleted file mode 100644 index f0d4490..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Formatting/DisallowMultipleStatementsStandard.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Formatting/MultipleStatementAlignmentStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Formatting/MultipleStatementAlignmentStandard.xml deleted file mode 100644 index 4c33d76..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Formatting/MultipleStatementAlignmentStandard.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - = (1 + 2); -$veryLongVarName = 'string'; -$var = foo($bar, $baz); - ]]> - - - = (1 + 2); -$veryLongVarName = 'string'; -$var = foo($bar, $baz); - ]]> - - - - - - - - += 1; -$veryLongVarName = 1; - ]]> - - - += 1; -$veryLongVarName = 1; - ]]> - - - - - = 1; -$veryLongVarName -= 1; - ]]> - - - = 1; -$veryLongVarName -= 1; - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Formatting/NoSpaceAfterCastStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Formatting/NoSpaceAfterCastStandard.xml deleted file mode 100644 index 042e4f8..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Formatting/NoSpaceAfterCastStandard.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - 1; - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Formatting/SpaceAfterCastStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Formatting/SpaceAfterCastStandard.xml deleted file mode 100644 index 75eba77..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Formatting/SpaceAfterCastStandard.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - 1; - ]]> - - - 1; - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Formatting/SpaceAfterNotStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Formatting/SpaceAfterNotStandard.xml deleted file mode 100644 index dd3e773..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Formatting/SpaceAfterNotStandard.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - $someVar || ! $x instanceOf stdClass) {}; - ]]> - - - $someVar || !$x instanceOf stdClass) {}; - ]]> - - - $someVar || ! - $x instanceOf stdClass) {}; - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Functions/CallTimePassByReferenceStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Functions/CallTimePassByReferenceStandard.xml deleted file mode 100644 index 738998d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Functions/CallTimePassByReferenceStandard.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - &$bar) -{ - $bar++; -} - -$baz = 1; -foo($baz); - ]]> - - - &$baz); - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Functions/FunctionCallArgumentSpacingStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Functions/FunctionCallArgumentSpacingStandard.xml deleted file mode 100644 index 9809844..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Functions/FunctionCallArgumentSpacingStandard.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - $baz) -{ -} - ]]> - - - $baz) -{ -} - ]]> - - - - - = true) -{ -} - ]]> - - - =true) -{ -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Functions/OpeningFunctionBraceBsdAllmanStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Functions/OpeningFunctionBraceBsdAllmanStandard.xml deleted file mode 100644 index 414dc28..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Functions/OpeningFunctionBraceBsdAllmanStandard.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - { - ... -} - ]]> - - - { - ... -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Functions/OpeningFunctionBraceKernighanRitchieStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Functions/OpeningFunctionBraceKernighanRitchieStandard.xml deleted file mode 100644 index 84c2bdd..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Functions/OpeningFunctionBraceKernighanRitchieStandard.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - { - ... -} - ]]> - - - { - ... -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Metrics/CyclomaticComplexityStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Metrics/CyclomaticComplexityStandard.xml deleted file mode 100644 index a928e7d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Metrics/CyclomaticComplexityStandard.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Metrics/NestingLevelStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Metrics/NestingLevelStandard.xml deleted file mode 100644 index f66cd92..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Metrics/NestingLevelStandard.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/NamingConventions/AbstractClassNamePrefixStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/NamingConventions/AbstractClassNamePrefixStandard.xml deleted file mode 100644 index c30d26e..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/NamingConventions/AbstractClassNamePrefixStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - AbstractBar -{ -} - ]]> - - - Bar -{ -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/NamingConventions/CamelCapsFunctionNameStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/NamingConventions/CamelCapsFunctionNameStandard.xml deleted file mode 100644 index f5345b7..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/NamingConventions/CamelCapsFunctionNameStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - doSomething() -{ -} - ]]> - - - do_something() -{ -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/NamingConventions/ConstructorNameStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/NamingConventions/ConstructorNameStandard.xml deleted file mode 100644 index 9dfc175..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/NamingConventions/ConstructorNameStandard.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - __construct() - { - } -} - ]]> - - - Foo() - { - } -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/NamingConventions/InterfaceNameSuffixStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/NamingConventions/InterfaceNameSuffixStandard.xml deleted file mode 100644 index 0aa0c76..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/NamingConventions/InterfaceNameSuffixStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - BarInterface -{ -} - ]]> - - - Bar -{ -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/NamingConventions/TraitNameSuffixStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/NamingConventions/TraitNameSuffixStandard.xml deleted file mode 100644 index 711867e..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/NamingConventions/TraitNameSuffixStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - BarTrait -{ -} - ]]> - - - Bar -{ -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/NamingConventions/UpperCaseConstantNameStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/NamingConventions/UpperCaseConstantNameStandard.xml deleted file mode 100644 index 6ef61b9..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/NamingConventions/UpperCaseConstantNameStandard.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - FOO_CONSTANT', 'foo'); - -class FooClass -{ - const FOO_CONSTANT = 'foo'; -} - ]]> - - - Foo_Constant', 'foo'); - -class FooClass -{ - const foo_constant = 'foo'; -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/BacktickOperatorStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/BacktickOperatorStandard.xml deleted file mode 100644 index 4ebd677..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/BacktickOperatorStandard.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/CharacterBeforePHPOpeningTagStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/CharacterBeforePHPOpeningTagStandard.xml deleted file mode 100644 index df5a0eb..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/CharacterBeforePHPOpeningTagStandard.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - Beginning content - - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/ClosingPHPTagStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/ClosingPHPTagStandard.xml deleted file mode 100644 index 09afb2d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/ClosingPHPTagStandard.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - -echo 'Foo'; -?> - ]]> - - - -echo 'Foo'; - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/DeprecatedFunctionsStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/DeprecatedFunctionsStandard.xml deleted file mode 100644 index 33b803a..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/DeprecatedFunctionsStandard.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - explode('a', $bar); - ]]> - - - split('a', $bar); - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/DisallowAlternativePHPTagsStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/DisallowAlternativePHPTagsStandard.xml deleted file mode 100644 index bdfd5dc..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/DisallowAlternativePHPTagsStandard.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - to delimit PHP code, do not use the ASP <% %> style tags nor the tags. This is the most portable way to include PHP code on differing operating systems and setups. - ]]> - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/DisallowRequestSuperglobalStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/DisallowRequestSuperglobalStandard.xml deleted file mode 100644 index f947694..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/DisallowRequestSuperglobalStandard.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/DisallowShortOpenTagStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/DisallowShortOpenTagStandard.xml deleted file mode 100644 index 8086ea2..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/DisallowShortOpenTagStandard.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - to delimit PHP code, not the shorthand. This is the most portable way to include PHP code on differing operating systems and setups. - ]]> - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/DiscourageGotoStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/DiscourageGotoStandard.xml deleted file mode 100644 index 83bceef..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/DiscourageGotoStandard.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/ForbiddenFunctionsStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/ForbiddenFunctionsStandard.xml deleted file mode 100644 index c0f18b5..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/ForbiddenFunctionsStandard.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - count($bar); - ]]> - - - sizeof($bar); - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/LowerCaseConstantStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/LowerCaseConstantStandard.xml deleted file mode 100644 index 7dc30c1..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/LowerCaseConstantStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - true, false and null constants must always be lowercase. - ]]> - - - - false || $var === null) { - $var = true; -} - ]]> - - - FALSE || $var === NULL) { - $var = TRUE; -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/LowerCaseKeywordStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/LowerCaseKeywordStandard.xml deleted file mode 100644 index 965742d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/LowerCaseKeywordStandard.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - array(); - ]]> - - - Array(); - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/LowerCaseTypeStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/LowerCaseTypeStandard.xml deleted file mode 100644 index f38df3a..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/LowerCaseTypeStandard.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - Int $foo) : STRING { -} - ]]> - - - - - - - - - - - (BOOL) $isValid; - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/NoSilencedErrorsStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/NoSilencedErrorsStandard.xml deleted file mode 100644 index df69887..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/NoSilencedErrorsStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - isset($foo) && $foo) { - echo "Hello\n"; -} - ]]> - - - @$foo) { - echo "Hello\n"; -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/SAPIUsageStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/SAPIUsageStandard.xml deleted file mode 100644 index e74005a..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/SAPIUsageStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - PHP_SAPI === 'cli') { - echo "Hello, CLI user."; -} - ]]> - - - php_sapi_name() === 'cli') { - echo "Hello, CLI user."; -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/UpperCaseConstantStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/UpperCaseConstantStandard.xml deleted file mode 100644 index 1f337f7..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/UpperCaseConstantStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - true, false and null constants must always be uppercase. - ]]> - - - - FALSE || $var === NULL) { - $var = TRUE; -} - ]]> - - - false || $var === null) { - $var = true; -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Strings/UnnecessaryStringConcatStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Strings/UnnecessaryStringConcatStandard.xml deleted file mode 100644 index a4c9887..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Strings/UnnecessaryStringConcatStandard.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/VersionControl/SubversionPropertiesStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/VersionControl/SubversionPropertiesStandard.xml deleted file mode 100644 index f4f3e19..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/VersionControl/SubversionPropertiesStandard.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/ArbitraryParenthesesSpacingStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/ArbitraryParenthesesSpacingStandard.xml deleted file mode 100644 index 30e0def..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/ArbitraryParenthesesSpacingStandard.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/DisallowSpaceIndentStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/DisallowSpaceIndentStandard.xml deleted file mode 100644 index 2e399b3..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/DisallowSpaceIndentStandard.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/DisallowTabIndentStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/DisallowTabIndentStandard.xml deleted file mode 100644 index 7013ffd..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/DisallowTabIndentStandard.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/ScopeIndentStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/ScopeIndentStandard.xml deleted file mode 100644 index bdd36d4..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/ScopeIndentStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - $var = 1; -} - ]]> - - - $var = 1; -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/SpreadOperatorSpacingAfterStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/SpreadOperatorSpacingAfterStandard.xml deleted file mode 100644 index d33b605..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/SpreadOperatorSpacingAfterStandard.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - &...$spread) { - bar(...$spread); - - bar( - [...$foo], - ...array_values($keyedArray) - ); -} - ]]> - - - ... $spread) { - bar(... - $spread - ); - - bar( - [... $foo ],.../*comment*/array_values($keyedArray) - ); -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/ArrayIndentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/ArrayIndentSniff.php deleted file mode 100644 index adb74ec..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/ArrayIndentSniff.php +++ /dev/null @@ -1,177 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Arrays; - -use PHP_CodeSniffer\Sniffs\AbstractArraySniff; -use PHP_CodeSniffer\Util\Tokens; - -class ArrayIndentSniff extends AbstractArraySniff -{ - - /** - * The number of spaces each array key should be indented. - * - * @var integer - */ - public $indent = 4; - - - /** - * Processes a single-line array definition. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being checked. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * @param int $arrayStart The token that starts the array definition. - * @param int $arrayEnd The token that ends the array definition. - * @param array $indices An array of token positions for the array keys, - * double arrows, and values. - * - * @return void - */ - public function processSingleLineArray($phpcsFile, $stackPtr, $arrayStart, $arrayEnd, $indices) - { - - }//end processSingleLineArray() - - - /** - * Processes a multi-line array definition. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being checked. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * @param int $arrayStart The token that starts the array definition. - * @param int $arrayEnd The token that ends the array definition. - * @param array $indices An array of token positions for the array keys, - * double arrows, and values. - * - * @return void - */ - public function processMultiLineArray($phpcsFile, $stackPtr, $arrayStart, $arrayEnd, $indices) - { - $tokens = $phpcsFile->getTokens(); - - // Determine how far indented the entire array declaration should be. - $ignore = Tokens::$emptyTokens; - $ignore[] = T_DOUBLE_ARROW; - $ignore[] = T_COMMA; - $prev = $phpcsFile->findPrevious($ignore, ($stackPtr - 1), null, true); - $start = $phpcsFile->findStartOfStatement($prev); - $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $start, true); - $baseIndent = ($tokens[$first]['column'] - 1); - - $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $stackPtr, true); - $startIndent = ($tokens[$first]['column'] - 1); - - // If the open brace is not indented to at least to the level of the start - // of the statement, the sniff will conflict with other sniffs trying to - // check indent levels because it's not valid. But we don't enforce exactly - // how far indented it should be. - if ($startIndent < $baseIndent) { - $error = 'Array open brace not indented correctly; expected at least %s spaces but found %s'; - $data = [ - $baseIndent, - $startIndent, - ]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'OpenBraceIncorrect', $data); - if ($fix === true) { - $padding = str_repeat(' ', $baseIndent); - if ($startIndent === 0) { - $phpcsFile->fixer->addContentBefore($first, $padding); - } else { - $phpcsFile->fixer->replaceToken(($first - 1), $padding); - } - } - - return; - }//end if - - $expectedIndent = ($startIndent + $this->indent); - - foreach ($indices as $index) { - if (isset($index['index_start']) === true) { - $start = $index['index_start']; - } else { - $start = $index['value_start']; - } - - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($start - 1), null, true); - if ($tokens[$prev]['line'] === $tokens[$start]['line']) { - // This index isn't the only content on the line - // so we can't check indent rules. - continue; - } - - $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $start, true); - - $foundIndent = ($tokens[$first]['column'] - 1); - if ($foundIndent === $expectedIndent) { - continue; - } - - $error = 'Array key not indented correctly; expected %s spaces but found %s'; - $data = [ - $expectedIndent, - $foundIndent, - ]; - $fix = $phpcsFile->addFixableError($error, $first, 'KeyIncorrect', $data); - if ($fix === false) { - continue; - } - - $padding = str_repeat(' ', $expectedIndent); - if ($foundIndent === 0) { - $phpcsFile->fixer->addContentBefore($first, $padding); - } else { - $phpcsFile->fixer->replaceToken(($first - 1), $padding); - } - }//end foreach - - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($arrayEnd - 1), null, true); - if ($tokens[$prev]['line'] === $tokens[$arrayEnd]['line']) { - $error = 'Closing brace of array declaration must be on a new line'; - $fix = $phpcsFile->addFixableError($error, $arrayEnd, 'CloseBraceNotNewLine'); - if ($fix === true) { - $padding = $phpcsFile->eolChar.str_repeat(' ', $expectedIndent); - $phpcsFile->fixer->addContentBefore($arrayEnd, $padding); - } - - return; - } - - // The close brace must be indented one stop less. - $expectedIndent -= $this->indent; - $foundIndent = ($tokens[$arrayEnd]['column'] - 1); - if ($foundIndent === $expectedIndent) { - return; - } - - $error = 'Array close brace not indented correctly; expected %s spaces but found %s'; - $data = [ - $expectedIndent, - $foundIndent, - ]; - $fix = $phpcsFile->addFixableError($error, $arrayEnd, 'CloseBraceIncorrect', $data); - if ($fix === false) { - return; - } - - $padding = str_repeat(' ', $expectedIndent); - if ($foundIndent === 0) { - $phpcsFile->fixer->addContentBefore($arrayEnd, $padding); - } else { - $phpcsFile->fixer->replaceToken(($arrayEnd - 1), $padding); - } - - }//end processMultiLineArray() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/DisallowLongArraySyntaxSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/DisallowLongArraySyntaxSniff.php deleted file mode 100644 index bf7f3ed..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/DisallowLongArraySyntaxSniff.php +++ /dev/null @@ -1,78 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Arrays; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class DisallowLongArraySyntaxSniff implements Sniff -{ - - - /** - * Registers the tokens that this sniff wants to listen for. - * - * @return int[] - */ - public function register() - { - return [T_ARRAY]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $phpcsFile->recordMetric($stackPtr, 'Short array syntax used', 'no'); - - $error = 'Short array syntax must be used to define arrays'; - - if (isset($tokens[$stackPtr]['parenthesis_opener']) === false - || isset($tokens[$stackPtr]['parenthesis_closer']) === false - ) { - // Live coding/parse error, just show the error, don't try and fix it. - $phpcsFile->addError($error, $stackPtr, 'Found'); - return; - } - - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Found'); - - if ($fix === true) { - $opener = $tokens[$stackPtr]['parenthesis_opener']; - $closer = $tokens[$stackPtr]['parenthesis_closer']; - - $phpcsFile->fixer->beginChangeset(); - - if ($opener === null) { - $phpcsFile->fixer->replaceToken($stackPtr, '[]'); - } else { - $phpcsFile->fixer->replaceToken($stackPtr, ''); - $phpcsFile->fixer->replaceToken($opener, '['); - $phpcsFile->fixer->replaceToken($closer, ']'); - } - - $phpcsFile->fixer->endChangeset(); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/DisallowShortArraySyntaxSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/DisallowShortArraySyntaxSniff.php deleted file mode 100644 index 2ba42d6..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/DisallowShortArraySyntaxSniff.php +++ /dev/null @@ -1,61 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Arrays; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class DisallowShortArraySyntaxSniff implements Sniff -{ - - - /** - * Registers the tokens that this sniff wants to listen for. - * - * @return int[] - */ - public function register() - { - return [T_OPEN_SHORT_ARRAY]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $phpcsFile->recordMetric($stackPtr, 'Short array syntax used', 'yes'); - - $error = 'Short array syntax is not allowed'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Found'); - - if ($fix === true) { - $tokens = $phpcsFile->getTokens(); - $opener = $tokens[$stackPtr]['bracket_opener']; - $closer = $tokens[$stackPtr]['bracket_closer']; - - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($opener, 'array('); - $phpcsFile->fixer->replaceToken($closer, ')'); - $phpcsFile->fixer->endChangeset(); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Classes/DuplicateClassNameSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Classes/DuplicateClassNameSniff.php deleted file mode 100644 index 8374bfd..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Classes/DuplicateClassNameSniff.php +++ /dev/null @@ -1,117 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Classes; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class DuplicateClassNameSniff implements Sniff -{ - - /** - * List of classes that have been found during checking. - * - * @var array - */ - protected $foundClasses = []; - - - /** - * Registers the tokens that this sniff wants to listen for. - * - * @return int[] - */ - public function register() - { - return [T_OPEN_TAG]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $namespace = ''; - $findTokens = [ - T_CLASS, - T_INTERFACE, - T_TRAIT, - T_NAMESPACE, - T_CLOSE_TAG, - ]; - - $stackPtr = $phpcsFile->findNext($findTokens, ($stackPtr + 1)); - while ($stackPtr !== false) { - if ($tokens[$stackPtr]['code'] === T_CLOSE_TAG) { - // We can stop here. The sniff will continue from the next open - // tag when PHPCS reaches that token, if there is one. - return; - } - - // Keep track of what namespace we are in. - if ($tokens[$stackPtr]['code'] === T_NAMESPACE) { - $nsEnd = $phpcsFile->findNext( - [ - T_NS_SEPARATOR, - T_STRING, - T_WHITESPACE, - ], - ($stackPtr + 1), - null, - true - ); - - $namespace = trim($phpcsFile->getTokensAsString(($stackPtr + 1), ($nsEnd - $stackPtr - 1))); - $stackPtr = $nsEnd; - } else { - $nameToken = $phpcsFile->findNext(T_STRING, $stackPtr); - $name = $tokens[$nameToken]['content']; - if ($namespace !== '') { - $name = $namespace.'\\'.$name; - } - - $compareName = strtolower($name); - if (isset($this->foundClasses[$compareName]) === true) { - $type = strtolower($tokens[$stackPtr]['content']); - $file = $this->foundClasses[$compareName]['file']; - $line = $this->foundClasses[$compareName]['line']; - $error = 'Duplicate %s name "%s" found; first defined in %s on line %s'; - $data = [ - $type, - $name, - $file, - $line, - ]; - $phpcsFile->addWarning($error, $stackPtr, 'Found', $data); - } else { - $this->foundClasses[$compareName] = [ - 'file' => $phpcsFile->getFilename(), - 'line' => $tokens[$stackPtr]['line'], - ]; - } - }//end if - - $stackPtr = $phpcsFile->findNext($findTokens, ($stackPtr + 1)); - }//end while - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Classes/OpeningBraceSameLineSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Classes/OpeningBraceSameLineSniff.php deleted file mode 100644 index fb92d82..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Classes/OpeningBraceSameLineSniff.php +++ /dev/null @@ -1,123 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Classes; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class OpeningBraceSameLineSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_CLASS, - T_INTERFACE, - T_TRAIT, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $scopeIdentifier = $phpcsFile->findNext(T_STRING, ($stackPtr + 1)); - $errorData = [strtolower($tokens[$stackPtr]['content']).' '.$tokens[$scopeIdentifier]['content']]; - - if (isset($tokens[$stackPtr]['scope_opener']) === false) { - $error = 'Possible parse error: %s missing opening or closing brace'; - $phpcsFile->addWarning($error, $stackPtr, 'MissingBrace', $errorData); - return; - } - - $openingBrace = $tokens[$stackPtr]['scope_opener']; - - // Is the brace on the same line as the class/interface/trait declaration ? - $lastClassLineToken = $phpcsFile->findPrevious(T_WHITESPACE, ($openingBrace - 1), $stackPtr, true); - $lastClassLine = $tokens[$lastClassLineToken]['line']; - $braceLine = $tokens[$openingBrace]['line']; - $lineDifference = ($braceLine - $lastClassLine); - - if ($lineDifference > 0) { - $phpcsFile->recordMetric($stackPtr, 'Class opening brace placement', 'new line'); - $error = 'Opening brace should be on the same line as the declaration for %s'; - $fix = $phpcsFile->addFixableError($error, $openingBrace, 'BraceOnNewLine', $errorData); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->addContent($lastClassLineToken, ' {'); - $phpcsFile->fixer->replaceToken($openingBrace, ''); - $phpcsFile->fixer->endChangeset(); - } - } else { - $phpcsFile->recordMetric($stackPtr, 'Class opening brace placement', 'same line'); - } - - // Is the opening brace the last thing on the line ? - $next = $phpcsFile->findNext(T_WHITESPACE, ($openingBrace + 1), null, true); - if ($tokens[$next]['line'] === $tokens[$openingBrace]['line']) { - if ($next === $tokens[$stackPtr]['scope_closer']) { - // Ignore empty classes. - return; - } - - $error = 'Opening brace must be the last content on the line'; - $fix = $phpcsFile->addFixableError($error, $openingBrace, 'ContentAfterBrace'); - if ($fix === true) { - $phpcsFile->fixer->addNewline($openingBrace); - } - } - - // Only continue checking if the opening brace looks good. - if ($lineDifference > 0) { - return; - } - - // Is there precisely one space before the opening brace ? - if ($tokens[($openingBrace - 1)]['code'] !== T_WHITESPACE) { - $length = 0; - } else if ($tokens[($openingBrace - 1)]['content'] === "\t") { - $length = '\t'; - } else { - $length = $tokens[($openingBrace - 1)]['length']; - } - - if ($length !== 1) { - $error = 'Expected 1 space before opening brace; found %s'; - $data = [$length]; - $fix = $phpcsFile->addFixableError($error, $openingBrace, 'SpaceBeforeBrace', $data); - if ($fix === true) { - if ($length === 0 || $length === '\t') { - $phpcsFile->fixer->addContentBefore($openingBrace, ' '); - } else { - $phpcsFile->fixer->replaceToken(($openingBrace - 1), ' '); - } - } - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/AssignmentInConditionSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/AssignmentInConditionSniff.php deleted file mode 100644 index 8788a91..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/AssignmentInConditionSniff.php +++ /dev/null @@ -1,171 +0,0 @@ - - * @copyright 2017 Juliette Reinders Folmer. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class AssignmentInConditionSniff implements Sniff -{ - - /** - * Assignment tokens to trigger on. - * - * Set in the register() method. - * - * @var array - */ - protected $assignmentTokens = []; - - /** - * The tokens that indicate the start of a condition. - * - * @var array - */ - protected $conditionStartTokens = []; - - - /** - * Registers the tokens that this sniff wants to listen for. - * - * @return int[] - */ - public function register() - { - $this->assignmentTokens = Tokens::$assignmentTokens; - unset($this->assignmentTokens[T_DOUBLE_ARROW]); - - $starters = Tokens::$booleanOperators; - $starters[T_SEMICOLON] = T_SEMICOLON; - $starters[T_OPEN_PARENTHESIS] = T_OPEN_PARENTHESIS; - - $this->conditionStartTokens = $starters; - - return [ - T_IF, - T_ELSEIF, - T_FOR, - T_SWITCH, - T_CASE, - T_WHILE, - T_MATCH, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $token = $tokens[$stackPtr]; - - // Find the condition opener/closer. - if ($token['code'] === T_FOR) { - if (isset($token['parenthesis_opener'], $token['parenthesis_closer']) === false) { - return; - } - - $semicolon = $phpcsFile->findNext(T_SEMICOLON, ($token['parenthesis_opener'] + 1), ($token['parenthesis_closer'])); - if ($semicolon === false) { - return; - } - - $opener = $semicolon; - - $semicolon = $phpcsFile->findNext(T_SEMICOLON, ($opener + 1), ($token['parenthesis_closer'])); - if ($semicolon === false) { - return; - } - - $closer = $semicolon; - unset($semicolon); - } else if ($token['code'] === T_CASE) { - if (isset($token['scope_opener']) === false) { - return; - } - - $opener = $stackPtr; - $closer = $token['scope_opener']; - } else { - if (isset($token['parenthesis_opener'], $token['parenthesis_closer']) === false) { - return; - } - - $opener = $token['parenthesis_opener']; - $closer = $token['parenthesis_closer']; - }//end if - - $startPos = $opener; - - do { - $hasAssignment = $phpcsFile->findNext($this->assignmentTokens, ($startPos + 1), $closer); - if ($hasAssignment === false) { - return; - } - - // Examine whether the left side is a variable. - $hasVariable = false; - $conditionStart = $startPos; - $altConditionStart = $phpcsFile->findPrevious($this->conditionStartTokens, ($hasAssignment - 1), $startPos); - if ($altConditionStart !== false) { - $conditionStart = $altConditionStart; - } - - for ($i = $hasAssignment; $i > $conditionStart; $i--) { - if (isset(Tokens::$emptyTokens[$tokens[$i]['code']]) === true) { - continue; - } - - // If this is a variable or array, we've seen all we need to see. - if ($tokens[$i]['code'] === T_VARIABLE || $tokens[$i]['code'] === T_CLOSE_SQUARE_BRACKET) { - $hasVariable = true; - break; - } - - // If this is a function call or something, we are OK. - if ($tokens[$i]['code'] === T_CLOSE_PARENTHESIS) { - break; - } - } - - if ($hasVariable === true) { - $errorCode = 'Found'; - if ($token['code'] === T_WHILE) { - $errorCode = 'FoundInWhileCondition'; - } - - $phpcsFile->addWarning( - 'Variable assignment found within a condition. Did you mean to do a comparison ?', - $hasAssignment, - $errorCode - ); - } - - $startPos = $hasAssignment; - } while ($startPos < $closer); - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/EmptyPHPStatementSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/EmptyPHPStatementSniff.php deleted file mode 100644 index 1c9e400..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/EmptyPHPStatementSniff.php +++ /dev/null @@ -1,162 +0,0 @@ - - * @copyright 2017 Juliette Reinders Folmer. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class EmptyPHPStatementSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return int[] - */ - public function register() - { - return [ - T_SEMICOLON, - T_CLOSE_TAG, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - switch ($tokens[$stackPtr]['type']) { - // Detect `something();;`. - case 'T_SEMICOLON': - $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - - if ($prevNonEmpty === false) { - return; - } - - if ($tokens[$prevNonEmpty]['code'] !== T_SEMICOLON - && $tokens[$prevNonEmpty]['code'] !== T_OPEN_TAG - && $tokens[$prevNonEmpty]['code'] !== T_OPEN_TAG_WITH_ECHO - ) { - if (isset($tokens[$prevNonEmpty]['scope_condition']) === false) { - return; - } - - if ($tokens[$prevNonEmpty]['scope_opener'] !== $prevNonEmpty - && $tokens[$prevNonEmpty]['code'] !== T_CLOSE_CURLY_BRACKET - ) { - return; - } - - $scopeOwner = $tokens[$tokens[$prevNonEmpty]['scope_condition']]['code']; - if ($scopeOwner === T_CLOSURE || $scopeOwner === T_ANON_CLASS || $scopeOwner === T_MATCH) { - return; - } - - // Else, it's something like `if (foo) {};` and the semi-colon is not needed. - } - - if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) { - $nested = $tokens[$stackPtr]['nested_parenthesis']; - $lastCloser = array_pop($nested); - if (isset($tokens[$lastCloser]['parenthesis_owner']) === true - && $tokens[$tokens[$lastCloser]['parenthesis_owner']]['code'] === T_FOR - ) { - // Empty for() condition. - return; - } - } - - $fix = $phpcsFile->addFixableWarning( - 'Empty PHP statement detected: superfluous semi-colon.', - $stackPtr, - 'SemicolonWithoutCodeDetected' - ); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - - if ($tokens[$prevNonEmpty]['code'] === T_OPEN_TAG - || $tokens[$prevNonEmpty]['code'] === T_OPEN_TAG_WITH_ECHO - ) { - // Check for superfluous whitespace after the semi-colon which will be - // removed as the `fixer->replaceToken(($stackPtr + 1), $replacement); - } - } - - for ($i = $stackPtr; $i > $prevNonEmpty; $i--) { - if ($tokens[$i]['code'] !== T_SEMICOLON - && $tokens[$i]['code'] !== T_WHITESPACE - ) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - }//end if - break; - - // Detect ``. - case 'T_CLOSE_TAG': - $prevNonEmpty = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); - - if ($prevNonEmpty === false - || ($tokens[$prevNonEmpty]['code'] !== T_OPEN_TAG - && $tokens[$prevNonEmpty]['code'] !== T_OPEN_TAG_WITH_ECHO) - ) { - return; - } - - $fix = $phpcsFile->addFixableWarning( - 'Empty PHP open/close tag combination detected.', - $prevNonEmpty, - 'EmptyPHPOpenCloseTagsDetected' - ); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - - for ($i = $prevNonEmpty; $i <= $stackPtr; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - break; - - default: - // Deliberately left empty. - break; - }//end switch - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/EmptyStatementSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/EmptyStatementSniff.php deleted file mode 100644 index 574bb0b..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/EmptyStatementSniff.php +++ /dev/null @@ -1,97 +0,0 @@ - - * stmt { - * // foo - * } - * stmt (conditions) { - * // foo - * } - * - * - * @author Manuel Pichler - * @author Greg Sherwood - * @copyright 2007-2014 Manuel Pichler. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class EmptyStatementSniff implements Sniff -{ - - - /** - * Registers the tokens that this sniff wants to listen for. - * - * @return int[] - */ - public function register() - { - return [ - T_TRY, - T_CATCH, - T_FINALLY, - T_DO, - T_ELSE, - T_ELSEIF, - T_FOR, - T_FOREACH, - T_IF, - T_SWITCH, - T_WHILE, - T_MATCH, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $token = $tokens[$stackPtr]; - - // Skip statements without a body. - if (isset($token['scope_opener']) === false) { - return; - } - - $next = $phpcsFile->findNext( - Tokens::$emptyTokens, - ($token['scope_opener'] + 1), - ($token['scope_closer'] - 1), - true - ); - - if ($next !== false) { - return; - } - - // Get token identifier. - $name = strtoupper($token['content']); - $error = 'Empty %s statement detected'; - $phpcsFile->addError($error, $stackPtr, 'Detected'.ucfirst(strtolower($name)), [$name]); - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/ForLoopShouldBeWhileLoopSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/ForLoopShouldBeWhileLoopSniff.php deleted file mode 100644 index f583e93..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/ForLoopShouldBeWhileLoopSniff.php +++ /dev/null @@ -1,91 +0,0 @@ - - * class Foo - * { - * public function bar($x) - * { - * for (;true;) true; // No Init or Update part, may as well be: while (true) - * } - * } - * - * - * @author Manuel Pichler - * @copyright 2007-2014 Manuel Pichler. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class ForLoopShouldBeWhileLoopSniff implements Sniff -{ - - - /** - * Registers the tokens that this sniff wants to listen for. - * - * @return int[] - */ - public function register() - { - return [T_FOR]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $token = $tokens[$stackPtr]; - - // Skip invalid statement. - if (isset($token['parenthesis_opener']) === false) { - return; - } - - $next = ++$token['parenthesis_opener']; - $end = --$token['parenthesis_closer']; - - $parts = [ - 0, - 0, - 0, - ]; - $index = 0; - - for (; $next <= $end; ++$next) { - $code = $tokens[$next]['code']; - if ($code === T_SEMICOLON) { - ++$index; - } else if (isset(Tokens::$emptyTokens[$code]) === false) { - ++$parts[$index]; - } - } - - if ($parts[0] === 0 && $parts[2] === 0 && $parts[1] > 0) { - $error = 'This FOR loop can be simplified to a WHILE loop'; - $phpcsFile->addWarning($error, $stackPtr, 'CanSimplify'); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/ForLoopWithTestFunctionCallSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/ForLoopWithTestFunctionCallSniff.php deleted file mode 100644 index 62a07b2..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/ForLoopWithTestFunctionCallSniff.php +++ /dev/null @@ -1,101 +0,0 @@ - - * class Foo - * { - * public function bar($x) - * { - * $a = array(1, 2, 3, 4); - * for ($i = 0; $i < count($a); $i++) { - * $a[$i] *= $i; - * } - * } - * } - * - * - * @author Greg Sherwood - * @author Manuel Pichler - * @copyright 2007-2014 Manuel Pichler. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class ForLoopWithTestFunctionCallSniff implements Sniff -{ - - - /** - * Registers the tokens that this sniff wants to listen for. - * - * @return int[] - */ - public function register() - { - return [T_FOR]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $token = $tokens[$stackPtr]; - - // Skip invalid statement. - if (isset($token['parenthesis_opener']) === false) { - return; - } - - $next = ++$token['parenthesis_opener']; - $end = --$token['parenthesis_closer']; - - $position = 0; - - for (; $next <= $end; ++$next) { - $code = $tokens[$next]['code']; - if ($code === T_SEMICOLON) { - ++$position; - } - - if ($position < 1) { - continue; - } else if ($position > 1) { - break; - } else if ($code !== T_VARIABLE && $code !== T_STRING) { - continue; - } - - // Find next non empty token, if it is a open curly brace we have a - // function call. - $index = $phpcsFile->findNext(Tokens::$emptyTokens, ($next + 1), null, true); - - if ($tokens[$index]['code'] === T_OPEN_PARENTHESIS) { - $error = 'Avoid function calls in a FOR loop test part'; - $phpcsFile->addWarning($error, $stackPtr, 'NotAllowed'); - break; - } - }//end for - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/JumbledIncrementerSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/JumbledIncrementerSniff.php deleted file mode 100644 index 364658d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/JumbledIncrementerSniff.php +++ /dev/null @@ -1,134 +0,0 @@ - - * class Foo - * { - * public function bar($x) - * { - * for ($i = 0; $i < 10; $i++) - * { - * for ($k = 0; $k < 20; $i++) - * { - * echo 'Hello'; - * } - * } - * } - * } - * - * - * @author Manuel Pichler - * @copyright 2007-2014 Manuel Pichler. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class JumbledIncrementerSniff implements Sniff -{ - - - /** - * Registers the tokens that this sniff wants to listen for. - * - * @return int[] - */ - public function register() - { - return [T_FOR]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $token = $tokens[$stackPtr]; - - // Skip for-loop without body. - if (isset($token['scope_opener']) === false) { - return; - } - - // Find incrementors for outer loop. - $outer = $this->findIncrementers($tokens, $token); - - // Skip if empty. - if (count($outer) === 0) { - return; - } - - // Find nested for loops. - $start = ++$token['scope_opener']; - $end = --$token['scope_closer']; - - for (; $start <= $end; ++$start) { - if ($tokens[$start]['code'] !== T_FOR) { - continue; - } - - $inner = $this->findIncrementers($tokens, $tokens[$start]); - $diff = array_intersect($outer, $inner); - - if (count($diff) !== 0) { - $error = 'Loop incrementor (%s) jumbling with inner loop'; - $data = [join(', ', $diff)]; - $phpcsFile->addWarning($error, $stackPtr, 'Found', $data); - } - } - - }//end process() - - - /** - * Get all used variables in the incrementer part of a for statement. - * - * @param array(integer=>array) $tokens Array with all code sniffer tokens. - * @param array(string=>mixed) $token Current for loop token - * - * @return string[] List of all found incrementer variables. - */ - protected function findIncrementers(array $tokens, array $token) - { - // Skip invalid statement. - if (isset($token['parenthesis_opener']) === false) { - return []; - } - - $start = ++$token['parenthesis_opener']; - $end = --$token['parenthesis_closer']; - - $incrementers = []; - $semicolons = 0; - for ($next = $start; $next <= $end; ++$next) { - $code = $tokens[$next]['code']; - if ($code === T_SEMICOLON) { - ++$semicolons; - } else if ($semicolons === 2 && $code === T_VARIABLE) { - $incrementers[] = $tokens[$next]['content']; - } - } - - return $incrementers; - - }//end findIncrementers() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UnconditionalIfStatementSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UnconditionalIfStatementSniff.php deleted file mode 100644 index cc9958c..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UnconditionalIfStatementSniff.php +++ /dev/null @@ -1,93 +0,0 @@ -true or false - * - * - * class Foo - * { - * public function close() - * { - * if (true) - * { - * // ... - * } - * } - * } - * - * - * @author Manuel Pichler - * @copyright 2007-2014 Manuel Pichler. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class UnconditionalIfStatementSniff implements Sniff -{ - - - /** - * Registers the tokens that this sniff wants to listen for. - * - * @return int[] - */ - public function register() - { - return [ - T_IF, - T_ELSEIF, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $token = $tokens[$stackPtr]; - - // Skip if statement without body. - if (isset($token['parenthesis_opener']) === false) { - return; - } - - $next = ++$token['parenthesis_opener']; - $end = --$token['parenthesis_closer']; - - $goodCondition = false; - for (; $next <= $end; ++$next) { - $code = $tokens[$next]['code']; - - if (isset(Tokens::$emptyTokens[$code]) === true) { - continue; - } else if ($code !== T_TRUE && $code !== T_FALSE) { - $goodCondition = true; - } - } - - if ($goodCondition === false) { - $error = 'Avoid IF statements that are always true or false'; - $phpcsFile->addWarning($error, $stackPtr, 'Found'); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UnnecessaryFinalModifierSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UnnecessaryFinalModifierSniff.php deleted file mode 100644 index bed67c9..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UnnecessaryFinalModifierSniff.php +++ /dev/null @@ -1,85 +0,0 @@ - - * final class Foo - * { - * public final function bar() - * { - * } - * } - * - * - * @author Manuel Pichler - * @copyright 2007-2014 Manuel Pichler. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class UnnecessaryFinalModifierSniff implements Sniff -{ - - - /** - * Registers the tokens that this sniff wants to listen for. - * - * @return int[] - */ - public function register() - { - return [T_CLASS]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $token = $tokens[$stackPtr]; - - // Skip for-statements without body. - if (isset($token['scope_opener']) === false) { - return; - } - - // Fetch previous token. - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - - // Skip for non final class. - if ($prev === false || $tokens[$prev]['code'] !== T_FINAL) { - return; - } - - $next = ++$token['scope_opener']; - $end = --$token['scope_closer']; - - for (; $next <= $end; ++$next) { - if ($tokens[$next]['code'] === T_FINAL) { - $error = 'Unnecessary FINAL modifier in FINAL class'; - $phpcsFile->addWarning($error, $next, 'Found'); - } - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UnusedFunctionParameterSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UnusedFunctionParameterSniff.php deleted file mode 100644 index 58aa29f..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UnusedFunctionParameterSniff.php +++ /dev/null @@ -1,265 +0,0 @@ - - * @author Greg Sherwood - * @copyright 2007-2014 Manuel Pichler. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class UnusedFunctionParameterSniff implements Sniff -{ - - /** - * The list of class type hints which will be ignored. - * - * @var array - */ - public $ignoreTypeHints = []; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_FUNCTION, - T_CLOSURE, - T_FN, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $token = $tokens[$stackPtr]; - - // Skip broken function declarations. - if (isset($token['scope_opener']) === false || isset($token['parenthesis_opener']) === false) { - return; - } - - $errorCode = 'Found'; - $implements = false; - $extends = false; - $classPtr = $phpcsFile->getCondition($stackPtr, T_CLASS); - if ($classPtr !== false) { - $implements = $phpcsFile->findImplementedInterfaceNames($classPtr); - $extends = $phpcsFile->findExtendedClassName($classPtr); - if ($extends !== false) { - $errorCode .= 'InExtendedClass'; - } else if ($implements !== false) { - $errorCode .= 'InImplementedInterface'; - } - } - - $params = []; - $methodParams = $phpcsFile->getMethodParameters($stackPtr); - - // Skip when no parameters found. - $methodParamsCount = count($methodParams); - if ($methodParamsCount === 0) { - return; - } - - foreach ($methodParams as $param) { - if (isset($param['property_visibility']) === true) { - // Ignore constructor property promotion. - continue; - } - - $params[$param['name']] = $stackPtr; - } - - $next = ++$token['scope_opener']; - $end = --$token['scope_closer']; - - // Check the end token for arrow functions as - // they can end at a content token due to not having - // a clearly defined closing token. - if ($token['code'] === T_FN) { - ++$end; - } - - $foundContent = false; - $validTokens = [ - T_HEREDOC => T_HEREDOC, - T_NOWDOC => T_NOWDOC, - T_END_HEREDOC => T_END_HEREDOC, - T_END_NOWDOC => T_END_NOWDOC, - T_DOUBLE_QUOTED_STRING => T_DOUBLE_QUOTED_STRING, - ]; - $validTokens += Tokens::$emptyTokens; - - for (; $next <= $end; ++$next) { - $token = $tokens[$next]; - $code = $token['code']; - - // Ignorable tokens. - if (isset(Tokens::$emptyTokens[$code]) === true) { - continue; - } - - if ($foundContent === false) { - // A throw statement as the first content indicates an interface method. - if ($code === T_THROW && $implements !== false) { - return; - } - - // A return statement as the first content indicates an interface method. - if ($code === T_RETURN) { - $tmp = $phpcsFile->findNext(Tokens::$emptyTokens, ($next + 1), null, true); - if ($tmp === false && $implements !== false) { - return; - } - - // There is a return. - if ($tokens[$tmp]['code'] === T_SEMICOLON && $implements !== false) { - return; - } - - $tmp = $phpcsFile->findNext(Tokens::$emptyTokens, ($tmp + 1), null, true); - if ($tmp !== false && $tokens[$tmp]['code'] === T_SEMICOLON && $implements !== false) { - // There is a return . - return; - } - }//end if - }//end if - - $foundContent = true; - - if ($code === T_VARIABLE && isset($params[$token['content']]) === true) { - unset($params[$token['content']]); - } else if ($code === T_DOLLAR) { - $nextToken = $phpcsFile->findNext(T_WHITESPACE, ($next + 1), null, true); - if ($tokens[$nextToken]['code'] === T_OPEN_CURLY_BRACKET) { - $nextToken = $phpcsFile->findNext(T_WHITESPACE, ($nextToken + 1), null, true); - if ($tokens[$nextToken]['code'] === T_STRING) { - $varContent = '$'.$tokens[$nextToken]['content']; - if (isset($params[$varContent]) === true) { - unset($params[$varContent]); - } - } - } - } else if ($code === T_DOUBLE_QUOTED_STRING - || $code === T_START_HEREDOC - || $code === T_START_NOWDOC - ) { - // Tokenize strings that can contain variables. - // Make sure the string is re-joined if it occurs over multiple lines. - $content = $token['content']; - for ($i = ($next + 1); $i <= $end; $i++) { - if (isset($validTokens[$tokens[$i]['code']]) === true) { - $content .= $tokens[$i]['content']; - $next++; - } else { - break; - } - } - - $stringTokens = token_get_all(sprintf('', $content)); - foreach ($stringTokens as $stringPtr => $stringToken) { - if (is_array($stringToken) === false) { - continue; - } - - $varContent = ''; - if ($stringToken[0] === T_DOLLAR_OPEN_CURLY_BRACES) { - $varContent = '$'.$stringTokens[($stringPtr + 1)][1]; - } else if ($stringToken[0] === T_VARIABLE) { - $varContent = $stringToken[1]; - } - - if ($varContent !== '' && isset($params[$varContent]) === true) { - unset($params[$varContent]); - } - } - }//end if - }//end for - - if ($foundContent === true && count($params) > 0) { - $error = 'The method parameter %s is never used'; - - // If there is only one parameter and it is unused, no need for additional errorcode toggling logic. - if ($methodParamsCount === 1) { - foreach ($params as $paramName => $position) { - if (in_array($methodParams[0]['type_hint'], $this->ignoreTypeHints, true) === true) { - continue; - } - - $data = [$paramName]; - $phpcsFile->addWarning($error, $position, $errorCode, $data); - } - - return; - } - - $foundLastUsed = false; - $lastIndex = ($methodParamsCount - 1); - $errorInfo = []; - for ($i = $lastIndex; $i >= 0; --$i) { - if ($foundLastUsed !== false) { - if (isset($params[$methodParams[$i]['name']]) === true) { - $errorInfo[$methodParams[$i]['name']] = [ - 'position' => $params[$methodParams[$i]['name']], - 'errorcode' => $errorCode.'BeforeLastUsed', - 'typehint' => $methodParams[$i]['type_hint'], - ]; - } - } else { - if (isset($params[$methodParams[$i]['name']]) === false) { - $foundLastUsed = true; - } else { - $errorInfo[$methodParams[$i]['name']] = [ - 'position' => $params[$methodParams[$i]['name']], - 'errorcode' => $errorCode.'AfterLastUsed', - 'typehint' => $methodParams[$i]['type_hint'], - ]; - } - } - }//end for - - if (count($errorInfo) > 0) { - $errorInfo = array_reverse($errorInfo); - foreach ($errorInfo as $paramName => $info) { - if (in_array($info['typehint'], $this->ignoreTypeHints, true) === true) { - continue; - } - - $data = [$paramName]; - $phpcsFile->addWarning($error, $info['position'], $info['errorcode'], $data); - } - } - }//end if - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UselessOverridingMethodSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UselessOverridingMethodSniff.php deleted file mode 100644 index fded929..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UselessOverridingMethodSniff.php +++ /dev/null @@ -1,161 +0,0 @@ - - * class FooBar { - * public function __construct($a, $b) { - * parent::__construct($a, $b); - * } - * } - * - * - * @author Manuel Pichler - * @copyright 2007-2014 Manuel Pichler. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class UselessOverridingMethodSniff implements Sniff -{ - - - /** - * Registers the tokens that this sniff wants to listen for. - * - * @return int[] - */ - public function register() - { - return [T_FUNCTION]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $token = $tokens[$stackPtr]; - - // Skip function without body. - if (isset($token['scope_opener']) === false) { - return; - } - - // Get function name. - $methodName = $phpcsFile->getDeclarationName($stackPtr); - - // Get all parameters from method signature. - $signature = []; - foreach ($phpcsFile->getMethodParameters($stackPtr) as $param) { - $signature[] = $param['name']; - } - - $next = ++$token['scope_opener']; - $end = --$token['scope_closer']; - - for (; $next <= $end; ++$next) { - $code = $tokens[$next]['code']; - - if (isset(Tokens::$emptyTokens[$code]) === true) { - continue; - } else if ($code === T_RETURN) { - continue; - } - - break; - } - - // Any token except 'parent' indicates correct code. - if ($tokens[$next]['code'] !== T_PARENT) { - return; - } - - // Find next non empty token index, should be double colon. - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($next + 1), null, true); - - // Skip for invalid code. - if ($next === false || $tokens[$next]['code'] !== T_DOUBLE_COLON) { - return; - } - - // Find next non empty token index, should be the function name. - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($next + 1), null, true); - - // Skip for invalid code or other method. - if ($next === false || $tokens[$next]['content'] !== $methodName) { - return; - } - - // Find next non empty token index, should be the open parenthesis. - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($next + 1), null, true); - - // Skip for invalid code. - if ($next === false || $tokens[$next]['code'] !== T_OPEN_PARENTHESIS) { - return; - } - - $parameters = ['']; - $parenthesisCount = 1; - $count = count($tokens); - for (++$next; $next < $count; ++$next) { - $code = $tokens[$next]['code']; - - if ($code === T_OPEN_PARENTHESIS) { - ++$parenthesisCount; - } else if ($code === T_CLOSE_PARENTHESIS) { - --$parenthesisCount; - } else if ($parenthesisCount === 1 && $code === T_COMMA) { - $parameters[] = ''; - } else if (isset(Tokens::$emptyTokens[$code]) === false) { - $parameters[(count($parameters) - 1)] .= $tokens[$next]['content']; - } - - if ($parenthesisCount === 0) { - break; - } - }//end for - - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($next + 1), null, true); - if ($next === false || $tokens[$next]['code'] !== T_SEMICOLON) { - return; - } - - // Check rest of the scope. - for (++$next; $next <= $end; ++$next) { - $code = $tokens[$next]['code']; - // Skip for any other content. - if (isset(Tokens::$emptyTokens[$code]) === false) { - return; - } - } - - $parameters = array_map('trim', $parameters); - $parameters = array_filter($parameters); - - if (count($parameters) === count($signature) && $parameters === $signature) { - $phpcsFile->addWarning('Possible useless method overriding detected', $stackPtr, 'Found'); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php deleted file mode 100644 index 545319b..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php +++ /dev/null @@ -1,353 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Commenting; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class DocCommentSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_DOC_COMMENT_OPEN_TAG]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]['comment_closer']) === false - || ($tokens[$tokens[$stackPtr]['comment_closer']]['content'] === '' - && $tokens[$stackPtr]['comment_closer'] === ($phpcsFile->numTokens - 1)) - ) { - // Don't process an unfinished comment during live coding. - return; - } - - $commentStart = $stackPtr; - $commentEnd = $tokens[$stackPtr]['comment_closer']; - - $empty = [ - T_DOC_COMMENT_WHITESPACE, - T_DOC_COMMENT_STAR, - ]; - - $short = $phpcsFile->findNext($empty, ($stackPtr + 1), $commentEnd, true); - if ($short === false) { - // No content at all. - $error = 'Doc comment is empty'; - $phpcsFile->addError($error, $stackPtr, 'Empty'); - return; - } - - // The first line of the comment should just be the /** code. - if ($tokens[$short]['line'] === $tokens[$stackPtr]['line']) { - $error = 'The open comment tag must be the only content on the line'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'ContentAfterOpen'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->addNewline($stackPtr); - $phpcsFile->fixer->addContentBefore($short, '* '); - $phpcsFile->fixer->endChangeset(); - } - } - - // The last line of the comment should just be the */ code. - $prev = $phpcsFile->findPrevious($empty, ($commentEnd - 1), $stackPtr, true); - if ($tokens[$prev]['line'] === $tokens[$commentEnd]['line']) { - $error = 'The close comment tag must be the only content on the line'; - $fix = $phpcsFile->addFixableError($error, $commentEnd, 'ContentBeforeClose'); - if ($fix === true) { - $phpcsFile->fixer->addNewlineBefore($commentEnd); - } - } - - // Check for additional blank lines at the end of the comment. - if ($tokens[$prev]['line'] < ($tokens[$commentEnd]['line'] - 1)) { - $error = 'Additional blank lines found at end of doc comment'; - $fix = $phpcsFile->addFixableError($error, $commentEnd, 'SpacingAfter'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($prev + 1); $i < $commentEnd; $i++) { - if ($tokens[($i + 1)]['line'] === $tokens[$commentEnd]['line']) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } - - // Check for a comment description. - if ($tokens[$short]['code'] !== T_DOC_COMMENT_STRING) { - $error = 'Missing short description in doc comment'; - $phpcsFile->addError($error, $stackPtr, 'MissingShort'); - } else { - // No extra newline before short description. - if ($tokens[$short]['line'] !== ($tokens[$stackPtr]['line'] + 1)) { - $error = 'Doc comment short description must be on the first line'; - $fix = $phpcsFile->addFixableError($error, $short, 'SpacingBeforeShort'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = $stackPtr; $i < $short; $i++) { - if ($tokens[$i]['line'] === $tokens[$stackPtr]['line']) { - continue; - } else if ($tokens[$i]['line'] === $tokens[$short]['line']) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } - - // Account for the fact that a short description might cover - // multiple lines. - $shortContent = $tokens[$short]['content']; - $shortEnd = $short; - for ($i = ($short + 1); $i < $commentEnd; $i++) { - if ($tokens[$i]['code'] === T_DOC_COMMENT_STRING) { - if ($tokens[$i]['line'] === ($tokens[$shortEnd]['line'] + 1)) { - $shortContent .= $tokens[$i]['content']; - $shortEnd = $i; - } else { - break; - } - } - } - - if (preg_match('/^\p{Ll}/u', $shortContent) === 1) { - $error = 'Doc comment short description must start with a capital letter'; - $phpcsFile->addError($error, $short, 'ShortNotCapital'); - } - - $long = $phpcsFile->findNext($empty, ($shortEnd + 1), ($commentEnd - 1), true); - if ($long !== false && $tokens[$long]['code'] === T_DOC_COMMENT_STRING) { - if ($tokens[$long]['line'] !== ($tokens[$shortEnd]['line'] + 2)) { - $error = 'There must be exactly one blank line between descriptions in a doc comment'; - $fix = $phpcsFile->addFixableError($error, $long, 'SpacingBetween'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($shortEnd + 1); $i < $long; $i++) { - if ($tokens[$i]['line'] === $tokens[$shortEnd]['line']) { - continue; - } else if ($tokens[$i]['line'] === ($tokens[$long]['line'] - 1)) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } - - if (preg_match('/^\p{Ll}/u', $tokens[$long]['content']) === 1) { - $error = 'Doc comment long description must start with a capital letter'; - $phpcsFile->addError($error, $long, 'LongNotCapital'); - } - }//end if - }//end if - - if (empty($tokens[$commentStart]['comment_tags']) === true) { - // No tags in the comment. - return; - } - - $firstTag = $tokens[$commentStart]['comment_tags'][0]; - $prev = $phpcsFile->findPrevious($empty, ($firstTag - 1), $stackPtr, true); - if ($tokens[$firstTag]['line'] !== ($tokens[$prev]['line'] + 2) - && $tokens[$prev]['code'] !== T_DOC_COMMENT_OPEN_TAG - ) { - $error = 'There must be exactly one blank line before the tags in a doc comment'; - $fix = $phpcsFile->addFixableError($error, $firstTag, 'SpacingBeforeTags'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($prev + 1); $i < $firstTag; $i++) { - if ($tokens[$i]['line'] === $tokens[$firstTag]['line']) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $indent = str_repeat(' ', $tokens[$stackPtr]['column']); - $phpcsFile->fixer->addContent($prev, $phpcsFile->eolChar.$indent.'*'.$phpcsFile->eolChar); - $phpcsFile->fixer->endChangeset(); - } - } - - // Break out the tags into groups and check alignment within each. - // A tag group is one where there are no blank lines between tags. - // The param tag group is special as it requires all @param tags to be inside. - $tagGroups = []; - $groupid = 0; - $paramGroupid = null; - foreach ($tokens[$commentStart]['comment_tags'] as $pos => $tag) { - if ($pos > 0) { - $prev = $phpcsFile->findPrevious( - T_DOC_COMMENT_STRING, - ($tag - 1), - $tokens[$commentStart]['comment_tags'][($pos - 1)] - ); - - if ($prev === false) { - $prev = $tokens[$commentStart]['comment_tags'][($pos - 1)]; - } - - if ($tokens[$prev]['line'] !== ($tokens[$tag]['line'] - 1)) { - $groupid++; - } - } - - if ($tokens[$tag]['content'] === '@param') { - if ($paramGroupid !== null - && $paramGroupid !== $groupid - ) { - $error = 'Parameter tags must be grouped together in a doc comment'; - $phpcsFile->addError($error, $tag, 'ParamGroup'); - } - - if ($paramGroupid === null) { - $paramGroupid = $groupid; - } - }//end if - - $tagGroups[$groupid][] = $tag; - }//end foreach - - foreach ($tagGroups as $groupid => $group) { - $maxLength = 0; - $paddings = []; - foreach ($group as $pos => $tag) { - if ($paramGroupid === $groupid - && $tokens[$tag]['content'] !== '@param' - ) { - $error = 'Tag %s cannot be grouped with parameter tags in a doc comment'; - $data = [$tokens[$tag]['content']]; - $phpcsFile->addError($error, $tag, 'NonParamGroup', $data); - } - - $tagLength = $tokens[$tag]['length']; - if ($tagLength > $maxLength) { - $maxLength = $tagLength; - } - - // Check for a value. No value means no padding needed. - $string = $phpcsFile->findNext(T_DOC_COMMENT_STRING, $tag, $commentEnd); - if ($string !== false && $tokens[$string]['line'] === $tokens[$tag]['line']) { - $paddings[$tag] = $tokens[($tag + 1)]['length']; - } - } - - // Check that there was single blank line after the tag block - // but account for a multi-line tag comments. - $lastTag = $group[$pos]; - $next = $phpcsFile->findNext(T_DOC_COMMENT_TAG, ($lastTag + 3), $commentEnd); - if ($next !== false) { - $prev = $phpcsFile->findPrevious([T_DOC_COMMENT_TAG, T_DOC_COMMENT_STRING], ($next - 1), $commentStart); - if ($tokens[$next]['line'] !== ($tokens[$prev]['line'] + 2)) { - $error = 'There must be a single blank line after a tag group'; - $fix = $phpcsFile->addFixableError($error, $lastTag, 'SpacingAfterTagGroup'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($prev + 1); $i < $next; $i++) { - if ($tokens[$i]['line'] === $tokens[$next]['line']) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $indent = str_repeat(' ', $tokens[$stackPtr]['column']); - $phpcsFile->fixer->addContent($prev, $phpcsFile->eolChar.$indent.'*'.$phpcsFile->eolChar); - $phpcsFile->fixer->endChangeset(); - } - } - }//end if - - // Now check paddings. - foreach ($paddings as $tag => $padding) { - $required = ($maxLength - $tokens[$tag]['length'] + 1); - - if ($padding !== $required) { - $error = 'Tag value for %s tag indented incorrectly; expected %s spaces but found %s'; - $data = [ - $tokens[$tag]['content'], - $required, - $padding, - ]; - - $fix = $phpcsFile->addFixableError($error, ($tag + 1), 'TagValueIndent', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($tag + 1), str_repeat(' ', $required)); - } - } - } - }//end foreach - - // If there is a param group, it needs to be first. - if ($paramGroupid !== null && $paramGroupid !== 0) { - $error = 'Parameter tags must be defined first in a doc comment'; - $phpcsFile->addError($error, $tagGroups[$paramGroupid][0], 'ParamNotFirst'); - } - - $foundTags = []; - foreach ($tokens[$stackPtr]['comment_tags'] as $pos => $tag) { - $tagName = $tokens[$tag]['content']; - if (isset($foundTags[$tagName]) === true) { - $lastTag = $tokens[$stackPtr]['comment_tags'][($pos - 1)]; - if ($tokens[$lastTag]['content'] !== $tagName) { - $error = 'Tags must be grouped together in a doc comment'; - $phpcsFile->addError($error, $tag, 'TagsNotGrouped'); - } - - continue; - } - - $foundTags[$tagName] = true; - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/FixmeSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/FixmeSniff.php deleted file mode 100644 index 8438522..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/FixmeSniff.php +++ /dev/null @@ -1,78 +0,0 @@ - - * @author Sam Graham - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Commenting; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class FixmeSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return array_diff(Tokens::$commentTokens, Tokens::$phpcsCommentTokens); - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $content = $tokens[$stackPtr]['content']; - $matches = []; - preg_match('/(?:\A|[^\p{L}]+)fixme([^\p{L}]+(.*)|\Z)/ui', $content, $matches); - if (empty($matches) === false) { - // Clear whitespace and some common characters not required at - // the end of a fixme message to make the error more informative. - $type = 'CommentFound'; - $fixmeMessage = trim($matches[1]); - $fixmeMessage = trim($fixmeMessage, '-:[](). '); - $error = 'Comment refers to a FIXME task'; - $data = [$fixmeMessage]; - if ($fixmeMessage !== '') { - $type = 'TaskFound'; - $error .= ' "%s"'; - } - - $phpcsFile->addError($error, $stackPtr, $type, $data); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/TodoSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/TodoSniff.php deleted file mode 100644 index 6396804..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/TodoSniff.php +++ /dev/null @@ -1,77 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Commenting; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class TodoSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return array_diff(Tokens::$commentTokens, Tokens::$phpcsCommentTokens); - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $content = $tokens[$stackPtr]['content']; - $matches = []; - preg_match('/(?:\A|[^\p{L}]+)todo([^\p{L}]+(.*)|\Z)/ui', $content, $matches); - if (empty($matches) === false) { - // Clear whitespace and some common characters not required at - // the end of a to-do message to make the warning more informative. - $type = 'CommentFound'; - $todoMessage = trim($matches[1]); - $todoMessage = trim($todoMessage, '-:[](). '); - $error = 'Comment refers to a TODO task'; - $data = [$todoMessage]; - if ($todoMessage !== '') { - $type = 'TaskFound'; - $error .= ' "%s"'; - } - - $phpcsFile->addWarning($error, $stackPtr, $type, $data); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/ControlStructures/DisallowYodaConditionsSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/ControlStructures/DisallowYodaConditionsSniff.php deleted file mode 100644 index f760fa1..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/ControlStructures/DisallowYodaConditionsSniff.php +++ /dev/null @@ -1,188 +0,0 @@ - - * @author Mark Scherer - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\ControlStructures; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class DisallowYodaConditionsSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return Tokens::$comparisonTokens; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $previousIndex = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - $relevantTokens = [ - T_CLOSE_SHORT_ARRAY, - T_CLOSE_PARENTHESIS, - T_TRUE, - T_FALSE, - T_NULL, - T_LNUMBER, - T_DNUMBER, - T_CONSTANT_ENCAPSED_STRING, - ]; - - if ($previousIndex === false - || in_array($tokens[$previousIndex]['code'], $relevantTokens, true) === false - ) { - return; - } - - if ($tokens[$previousIndex]['code'] === T_CLOSE_SHORT_ARRAY) { - $previousIndex = $tokens[$previousIndex]['bracket_opener']; - if ($this->isArrayStatic($phpcsFile, $previousIndex) === false) { - return; - } - } - - $prevIndex = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($previousIndex - 1), null, true); - if ($prevIndex === false) { - return; - } - - if (in_array($tokens[$prevIndex]['code'], Tokens::$arithmeticTokens, true) === true) { - return; - } - - if ($tokens[$prevIndex]['code'] === T_STRING_CONCAT) { - return; - } - - // Is it a parenthesis. - if ($tokens[$previousIndex]['code'] === T_CLOSE_PARENTHESIS) { - // Check what exists inside the parenthesis. - $closeParenthesisIndex = $phpcsFile->findPrevious( - Tokens::$emptyTokens, - ($tokens[$previousIndex]['parenthesis_opener'] - 1), - null, - true - ); - - if ($closeParenthesisIndex === false || $tokens[$closeParenthesisIndex]['code'] !== T_ARRAY) { - if ($tokens[$closeParenthesisIndex]['code'] === T_STRING) { - return; - } - - // If it is not an array check what is inside. - $found = $phpcsFile->findPrevious( - T_VARIABLE, - ($previousIndex - 1), - $tokens[$previousIndex]['parenthesis_opener'] - ); - - // If a variable exists, it is not Yoda. - if ($found !== false) { - return; - } - - // If there is nothing inside the parenthesis, it it not a Yoda. - $opener = $tokens[$previousIndex]['parenthesis_opener']; - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($previousIndex - 1), ($opener + 1), true); - if ($prev === false) { - return; - } - } else if ($tokens[$closeParenthesisIndex]['code'] === T_ARRAY - && $this->isArrayStatic($phpcsFile, $closeParenthesisIndex) === false - ) { - return; - }//end if - }//end if - - $phpcsFile->addError( - 'Usage of Yoda conditions is not allowed; switch the expression order', - $stackPtr, - 'Found' - ); - - }//end process() - - - /** - * Determines if an array is a static definition. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $arrayToken The position of the array token. - * - * @return bool - */ - public function isArrayStatic(File $phpcsFile, $arrayToken) - { - $tokens = $phpcsFile->getTokens(); - - $arrayEnd = null; - if ($tokens[$arrayToken]['code'] === T_OPEN_SHORT_ARRAY) { - $start = $arrayToken; - $end = $tokens[$arrayToken]['bracket_closer']; - } else if ($tokens[$arrayToken]['code'] === T_ARRAY) { - $start = $tokens[$arrayToken]['parenthesis_opener']; - $end = $tokens[$arrayToken]['parenthesis_closer']; - } else { - return true; - } - - $staticTokens = Tokens::$emptyTokens; - $staticTokens += Tokens::$textStringTokens; - $staticTokens += Tokens::$assignmentTokens; - $staticTokens += Tokens::$equalityTokens; - $staticTokens += Tokens::$comparisonTokens; - $staticTokens += Tokens::$arithmeticTokens; - $staticTokens += Tokens::$operators; - $staticTokens += Tokens::$booleanOperators; - $staticTokens += Tokens::$castTokens; - $staticTokens += Tokens::$bracketTokens; - $staticTokens += [ - T_DOUBLE_ARROW => T_DOUBLE_ARROW, - T_COMMA => T_COMMA, - T_TRUE => T_TRUE, - T_FALSE => T_FALSE, - ]; - - for ($i = ($start + 1); $i < $end; $i++) { - if (isset($tokens[$i]['scope_closer']) === true) { - $i = $tokens[$i]['scope_closer']; - continue; - } - - if (isset($staticTokens[$tokens[$i]['code']]) === false) { - return false; - } - } - - return true; - - }//end isArrayStatic() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/ControlStructures/InlineControlStructureSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/ControlStructures/InlineControlStructureSniff.php deleted file mode 100644 index a67a6a7..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/ControlStructures/InlineControlStructureSniff.php +++ /dev/null @@ -1,381 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\ControlStructures; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class InlineControlStructureSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - /** - * If true, an error will be thrown; otherwise a warning. - * - * @var boolean - */ - public $error = true; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_IF, - T_ELSE, - T_ELSEIF, - T_FOREACH, - T_WHILE, - T_DO, - T_SWITCH, - T_FOR, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]['scope_opener']) === true) { - $phpcsFile->recordMetric($stackPtr, 'Control structure defined inline', 'no'); - return; - } - - // Ignore the ELSE in ELSE IF. We'll process the IF part later. - if ($tokens[$stackPtr]['code'] === T_ELSE) { - $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($tokens[$next]['code'] === T_IF) { - return; - } - } - - if ($tokens[$stackPtr]['code'] === T_WHILE || $tokens[$stackPtr]['code'] === T_FOR) { - // This could be from a DO WHILE, which doesn't have an opening brace or a while/for without body. - if (isset($tokens[$stackPtr]['parenthesis_closer']) === true) { - $afterParensCloser = $phpcsFile->findNext(Tokens::$emptyTokens, ($tokens[$stackPtr]['parenthesis_closer'] + 1), null, true); - if ($afterParensCloser === false) { - // Live coding. - return; - } - - if ($tokens[$afterParensCloser]['code'] === T_SEMICOLON) { - $phpcsFile->recordMetric($stackPtr, 'Control structure defined inline', 'no'); - return; - } - } - - // In Javascript DO WHILE loops without curly braces are legal. This - // is only valid if a single statement is present between the DO and - // the WHILE. We can detect this by checking only a single semicolon - // is present between them. - if ($tokens[$stackPtr]['code'] === T_WHILE && $phpcsFile->tokenizerType === 'JS') { - $lastDo = $phpcsFile->findPrevious(T_DO, ($stackPtr - 1)); - $lastSemicolon = $phpcsFile->findPrevious(T_SEMICOLON, ($stackPtr - 1)); - if ($lastDo !== false && $lastSemicolon !== false && $lastDo < $lastSemicolon) { - $precedingSemicolon = $phpcsFile->findPrevious(T_SEMICOLON, ($lastSemicolon - 1)); - if ($precedingSemicolon === false || $precedingSemicolon < $lastDo) { - return; - } - } - } - }//end if - - if (isset($tokens[$stackPtr]['parenthesis_opener'], $tokens[$stackPtr]['parenthesis_closer']) === false - && $tokens[$stackPtr]['code'] !== T_ELSE - ) { - if ($tokens[$stackPtr]['code'] !== T_DO) { - // Live coding or parse error. - return; - } - - $nextWhile = $phpcsFile->findNext(T_WHILE, ($stackPtr + 1)); - if ($nextWhile !== false - && isset($tokens[$nextWhile]['parenthesis_opener'], $tokens[$nextWhile]['parenthesis_closer']) === false - ) { - // Live coding or parse error. - return; - } - - unset($nextWhile); - } - - $start = $stackPtr; - if (isset($tokens[$stackPtr]['parenthesis_closer']) === true) { - $start = $tokens[$stackPtr]['parenthesis_closer']; - } - - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($start + 1), null, true); - if ($nextNonEmpty === false) { - // Live coding or parse error. - return; - } - - if ($tokens[$nextNonEmpty]['code'] === T_OPEN_CURLY_BRACKET - || $tokens[$nextNonEmpty]['code'] === T_COLON - ) { - // T_CLOSE_CURLY_BRACKET missing, or alternative control structure with - // T_END... missing. Either live coding, parse error or end - // tag in short open tags and scan run with short_open_tag=Off. - // Bow out completely as any further detection will be unreliable - // and create incorrect fixes or cause fixer conflicts. - return ($phpcsFile->numTokens + 1); - } - - unset($nextNonEmpty, $start); - - // This is a control structure without an opening brace, - // so it is an inline statement. - if ($this->error === true) { - $fix = $phpcsFile->addFixableError('Inline control structures are not allowed', $stackPtr, 'NotAllowed'); - } else { - $fix = $phpcsFile->addFixableWarning('Inline control structures are discouraged', $stackPtr, 'Discouraged'); - } - - $phpcsFile->recordMetric($stackPtr, 'Control structure defined inline', 'yes'); - - // Stop here if we are not fixing the error. - if ($fix !== true) { - return; - } - - $phpcsFile->fixer->beginChangeset(); - if (isset($tokens[$stackPtr]['parenthesis_closer']) === true) { - $closer = $tokens[$stackPtr]['parenthesis_closer']; - } else { - $closer = $stackPtr; - } - - if ($tokens[($closer + 1)]['code'] === T_WHITESPACE - || $tokens[($closer + 1)]['code'] === T_SEMICOLON - ) { - $phpcsFile->fixer->addContent($closer, ' {'); - } else { - $phpcsFile->fixer->addContent($closer, ' { '); - } - - $fixableScopeOpeners = $this->register(); - - $lastNonEmpty = $closer; - for ($end = ($closer + 1); $end < $phpcsFile->numTokens; $end++) { - if ($tokens[$end]['code'] === T_SEMICOLON) { - break; - } - - if ($tokens[$end]['code'] === T_CLOSE_TAG) { - $end = $lastNonEmpty; - break; - } - - if (in_array($tokens[$end]['code'], $fixableScopeOpeners, true) === true - && isset($tokens[$end]['scope_opener']) === false - ) { - // The best way to fix nested inline scopes is middle-out. - // So skip this one. It will be detected and fixed on a future loop. - $phpcsFile->fixer->rollbackChangeset(); - return; - } - - if (isset($tokens[$end]['scope_opener']) === true) { - $type = $tokens[$end]['code']; - $end = $tokens[$end]['scope_closer']; - if ($type === T_DO - || $type === T_IF || $type === T_ELSEIF - || $type === T_TRY || $type === T_CATCH || $type === T_FINALLY - ) { - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($end + 1), null, true); - if ($next === false) { - break; - } - - $nextType = $tokens[$next]['code']; - - // Let additional conditions loop and find their ending. - if (($type === T_IF - || $type === T_ELSEIF) - && ($nextType === T_ELSEIF - || $nextType === T_ELSE) - ) { - continue; - } - - // Account for TRY... CATCH/FINALLY statements. - if (($type === T_TRY - || $type === T_CATCH - || $type === T_FINALLY) - && ($nextType === T_CATCH - || $nextType === T_FINALLY) - ) { - continue; - } - - // Account for DO... WHILE conditions. - if ($type === T_DO && $nextType === T_WHILE) { - $end = $phpcsFile->findNext(T_SEMICOLON, ($next + 1)); - } - } else if ($type === T_CLOSURE) { - // There should be a semicolon after the closing brace. - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($end + 1), null, true); - if ($next !== false && $tokens[$next]['code'] === T_SEMICOLON) { - $end = $next; - } - }//end if - - if ($tokens[$end]['code'] !== T_END_HEREDOC - && $tokens[$end]['code'] !== T_END_NOWDOC - ) { - break; - } - }//end if - - if (isset($tokens[$end]['parenthesis_closer']) === true) { - $end = $tokens[$end]['parenthesis_closer']; - $lastNonEmpty = $end; - continue; - } - - if ($tokens[$end]['code'] !== T_WHITESPACE) { - $lastNonEmpty = $end; - } - }//end for - - if ($end === $phpcsFile->numTokens) { - $end = $lastNonEmpty; - } - - $nextContent = $phpcsFile->findNext(Tokens::$emptyTokens, ($end + 1), null, true); - if ($nextContent === false || $tokens[$nextContent]['line'] !== $tokens[$end]['line']) { - // Looks for completely empty statements. - $next = $phpcsFile->findNext(T_WHITESPACE, ($closer + 1), ($end + 1), true); - } else { - $next = ($end + 1); - $endLine = $end; - } - - if ($next !== $end) { - if ($nextContent === false || $tokens[$nextContent]['line'] !== $tokens[$end]['line']) { - // Account for a comment on the end of the line. - for ($endLine = $end; $endLine < $phpcsFile->numTokens; $endLine++) { - if (isset($tokens[($endLine + 1)]) === false - || $tokens[$endLine]['line'] !== $tokens[($endLine + 1)]['line'] - ) { - break; - } - } - - if (isset(Tokens::$commentTokens[$tokens[$endLine]['code']]) === false - && ($tokens[$endLine]['code'] !== T_WHITESPACE - || isset(Tokens::$commentTokens[$tokens[($endLine - 1)]['code']]) === false) - ) { - $endLine = $end; - } - } - - if ($endLine !== $end) { - $endToken = $endLine; - $addedContent = ''; - } else { - $endToken = $end; - $addedContent = $phpcsFile->eolChar; - - if ($tokens[$end]['code'] !== T_SEMICOLON - && $tokens[$end]['code'] !== T_CLOSE_CURLY_BRACKET - ) { - $phpcsFile->fixer->addContent($end, '; '); - } - } - - $next = $phpcsFile->findNext(T_WHITESPACE, ($endToken + 1), null, true); - if ($next !== false - && ($tokens[$next]['code'] === T_ELSE - || $tokens[$next]['code'] === T_ELSEIF) - ) { - $phpcsFile->fixer->addContentBefore($next, '} '); - } else { - $indent = ''; - for ($first = $stackPtr; $first > 0; $first--) { - if ($tokens[$first]['column'] === 1) { - break; - } - } - - if ($tokens[$first]['code'] === T_WHITESPACE) { - $indent = $tokens[$first]['content']; - } else if ($tokens[$first]['code'] === T_INLINE_HTML - || $tokens[$first]['code'] === T_OPEN_TAG - ) { - $addedContent = ''; - } - - $addedContent .= $indent.'}'; - if ($next !== false && $tokens[$endToken]['code'] === T_COMMENT) { - $addedContent .= $phpcsFile->eolChar; - } - - $phpcsFile->fixer->addContent($endToken, $addedContent); - }//end if - } else { - if ($nextContent === false || $tokens[$nextContent]['line'] !== $tokens[$end]['line']) { - // Account for a comment on the end of the line. - for ($endLine = $end; $endLine < $phpcsFile->numTokens; $endLine++) { - if (isset($tokens[($endLine + 1)]) === false - || $tokens[$endLine]['line'] !== $tokens[($endLine + 1)]['line'] - ) { - break; - } - } - - if ($tokens[$endLine]['code'] !== T_COMMENT - && ($tokens[$endLine]['code'] !== T_WHITESPACE - || $tokens[($endLine - 1)]['code'] !== T_COMMENT) - ) { - $endLine = $end; - } - } - - if ($endLine !== $end) { - $phpcsFile->fixer->replaceToken($end, ''); - $phpcsFile->fixer->addNewlineBefore($endLine); - $phpcsFile->fixer->addContent($endLine, '}'); - } else { - $phpcsFile->fixer->replaceToken($end, '}'); - } - }//end if - - $phpcsFile->fixer->endChangeset(); - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/CSSLintSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/CSSLintSniff.php deleted file mode 100644 index 8128478..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/CSSLintSniff.php +++ /dev/null @@ -1,96 +0,0 @@ - - * @copyright 2013-2014 Roman Levishchenko - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Debug; - -use PHP_CodeSniffer\Config; -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Common; - -class CSSLintSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['CSS']; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return int[] - */ - public function register() - { - return [T_OPEN_TAG]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $csslintPath = Config::getExecutablePath('csslint'); - if ($csslintPath === null) { - return; - } - - $fileName = $phpcsFile->getFilename(); - - $cmd = Common::escapeshellcmd($csslintPath).' '.escapeshellarg($fileName).' 2>&1'; - exec($cmd, $output, $retval); - - if (is_array($output) === false) { - return; - } - - $count = count($output); - - for ($i = 0; $i < $count; $i++) { - $matches = []; - $numMatches = preg_match( - '/(error|warning) at line (\d+)/', - $output[$i], - $matches - ); - - if ($numMatches === 0) { - continue; - } - - $line = (int) $matches[2]; - $message = 'csslint says: '.$output[($i + 1)]; - // First line is message with error line and error code. - // Second is error message. - // Third is wrong line in file. - // Fourth is empty line. - $i += 4; - - $phpcsFile->addWarningOnLine($message, $line, 'ExternalTool'); - }//end for - - // Ignore the rest of the file. - return ($phpcsFile->numTokens + 1); - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/ClosureLinterSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/ClosureLinterSniff.php deleted file mode 100644 index 1920471..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/ClosureLinterSniff.php +++ /dev/null @@ -1,117 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Debug; - -use PHP_CodeSniffer\Config; -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Common; - -class ClosureLinterSniff implements Sniff -{ - - /** - * A list of error codes that should show errors. - * - * All other error codes will show warnings. - * - * @var integer - */ - public $errorCodes = []; - - /** - * A list of error codes to ignore. - * - * @var integer - */ - public $ignoreCodes = []; - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['JS']; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return int[] - */ - public function register() - { - return [T_OPEN_TAG]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If jslint.js could not be run - */ - public function process(File $phpcsFile, $stackPtr) - { - $lintPath = Config::getExecutablePath('gjslint'); - if ($lintPath === null) { - return; - } - - $fileName = $phpcsFile->getFilename(); - - $lintPath = Common::escapeshellcmd($lintPath); - $cmd = $lintPath.' --nosummary --notime --unix_mode '.escapeshellarg($fileName); - exec($cmd, $output, $retval); - - if (is_array($output) === false) { - return; - } - - foreach ($output as $finding) { - $matches = []; - $numMatches = preg_match('/^(.*):([0-9]+):\(.*?([0-9]+)\)(.*)$/', $finding, $matches); - if ($numMatches === 0) { - continue; - } - - // Skip error codes we are ignoring. - $code = $matches[3]; - if (in_array($code, $this->ignoreCodes) === true) { - continue; - } - - $line = (int) $matches[2]; - $error = trim($matches[4]); - - $message = 'gjslint says: (%s) %s'; - $data = [ - $code, - $error, - ]; - if (in_array($code, $this->errorCodes) === true) { - $phpcsFile->addErrorOnLine($message, $line, 'ExternalToolError', $data); - } else { - $phpcsFile->addWarningOnLine($message, $line, 'ExternalTool', $data); - } - }//end foreach - - // Ignore the rest of the file. - return ($phpcsFile->numTokens + 1); - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/ESLintSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/ESLintSniff.php deleted file mode 100644 index d11d347..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/ESLintSniff.php +++ /dev/null @@ -1,113 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Debug; - -use PHP_CodeSniffer\Config; -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Common; - -class ESLintSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['JS']; - - /** - * ESLint configuration file path. - * - * @var string|null Path to eslintrc. Null to autodetect. - */ - public $configFile = null; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return int[] - */ - public function register() - { - return [T_OPEN_TAG]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If jshint.js could not be run - */ - public function process(File $phpcsFile, $stackPtr) - { - $eslintPath = Config::getExecutablePath('eslint'); - if ($eslintPath === null) { - return; - } - - $filename = $phpcsFile->getFilename(); - - $configFile = $this->configFile; - if (empty($configFile) === true) { - // Attempt to autodetect. - $candidates = glob('.eslintrc{.js,.yaml,.yml,.json}', GLOB_BRACE); - if (empty($candidates) === false) { - $configFile = $candidates[0]; - } - } - - $eslintOptions = ['--format json']; - if (empty($configFile) === false) { - $eslintOptions[] = '--config '.escapeshellarg($configFile); - } - - $cmd = Common::escapeshellcmd(escapeshellarg($eslintPath).' '.implode(' ', $eslintOptions).' '.escapeshellarg($filename)); - - // Execute! - exec($cmd, $stdout, $code); - - if ($code <= 0) { - // No errors, continue. - return ($phpcsFile->numTokens + 1); - } - - $data = json_decode(implode("\n", $stdout)); - if (json_last_error() !== JSON_ERROR_NONE) { - // Ignore any errors. - return ($phpcsFile->numTokens + 1); - } - - // Data is a list of files, but we only pass a single one. - $messages = $data[0]->messages; - foreach ($messages as $error) { - $message = 'eslint says: '.$error->message; - if (empty($error->fatal) === false || $error->severity === 2) { - $phpcsFile->addErrorOnLine($message, $error->line, 'ExternalTool'); - } else { - $phpcsFile->addWarningOnLine($message, $error->line, 'ExternalTool'); - } - } - - // Ignore the rest of the file. - return ($phpcsFile->numTokens + 1); - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/JSHintSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/JSHintSniff.php deleted file mode 100644 index 06de359..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/JSHintSniff.php +++ /dev/null @@ -1,95 +0,0 @@ - - * @author Alexander Wei§ - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Debug; - -use PHP_CodeSniffer\Config; -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Common; - -class JSHintSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['JS']; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return int[] - */ - public function register() - { - return [T_OPEN_TAG]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If jshint.js could not be run - */ - public function process(File $phpcsFile, $stackPtr) - { - $rhinoPath = Config::getExecutablePath('rhino'); - $jshintPath = Config::getExecutablePath('jshint'); - if ($rhinoPath === null && $jshintPath === null) { - return; - } - - $fileName = $phpcsFile->getFilename(); - $jshintPath = Common::escapeshellcmd($jshintPath); - - if ($rhinoPath !== null) { - $rhinoPath = Common::escapeshellcmd($rhinoPath); - $cmd = "$rhinoPath \"$jshintPath\" ".escapeshellarg($fileName); - exec($cmd, $output, $retval); - - $regex = '`^(?P.+)\(.+:(?P[0-9]+).*:[0-9]+\)$`'; - } else { - $cmd = "$jshintPath ".escapeshellarg($fileName); - exec($cmd, $output, $retval); - - $regex = '`^(.+?): line (?P[0-9]+), col [0-9]+, (?P.+)$`'; - } - - if (is_array($output) === true) { - foreach ($output as $finding) { - $matches = []; - $numMatches = preg_match($regex, $finding, $matches); - if ($numMatches === 0) { - continue; - } - - $line = (int) $matches['line']; - $message = 'jshint says: '.trim($matches['error']); - $phpcsFile->addWarningOnLine($message, $line, 'ExternalTool'); - } - } - - // Ignore the rest of the file. - return ($phpcsFile->numTokens + 1); - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/ByteOrderMarkSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/ByteOrderMarkSniff.php deleted file mode 100644 index cee8ecc..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/ByteOrderMarkSniff.php +++ /dev/null @@ -1,80 +0,0 @@ - - * @author Greg Sherwood - * @copyright 2010-2014 mediaSELF Sp. z o.o. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class ByteOrderMarkSniff implements Sniff -{ - - /** - * List of supported BOM definitions. - * - * Use encoding names as keys and hex BOM representations as values. - * - * @var array - */ - protected $bomDefinitions = [ - 'UTF-8' => 'efbbbf', - 'UTF-16 (BE)' => 'feff', - 'UTF-16 (LE)' => 'fffe', - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_INLINE_HTML]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - // The BOM will be the very first token in the file. - if ($stackPtr !== 0) { - return; - } - - $tokens = $phpcsFile->getTokens(); - - foreach ($this->bomDefinitions as $bomName => $expectedBomHex) { - $bomByteLength = (strlen($expectedBomHex) / 2); - $htmlBomHex = bin2hex(substr($tokens[$stackPtr]['content'], 0, $bomByteLength)); - if ($htmlBomHex === $expectedBomHex) { - $errorData = [$bomName]; - $error = 'File contains %s byte order mark, which may corrupt your application'; - $phpcsFile->addError($error, $stackPtr, 'Found', $errorData); - $phpcsFile->recordMetric($stackPtr, 'Using byte order mark', 'yes'); - return; - } - } - - $phpcsFile->recordMetric($stackPtr, 'Using byte order mark', 'no'); - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/EndFileNewlineSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/EndFileNewlineSniff.php deleted file mode 100644 index d5375dc..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/EndFileNewlineSniff.php +++ /dev/null @@ -1,84 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class EndFileNewlineSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - 'CSS', - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_OPEN_TAG, - T_OPEN_TAG_WITH_ECHO, - ]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return int - */ - public function process(File $phpcsFile, $stackPtr) - { - // Skip to the end of the file. - $tokens = $phpcsFile->getTokens(); - $stackPtr = ($phpcsFile->numTokens - 1); - - if ($tokens[$stackPtr]['content'] === '') { - $stackPtr--; - } - - $eolCharLen = strlen($phpcsFile->eolChar); - $lastChars = substr($tokens[$stackPtr]['content'], ($eolCharLen * -1)); - if ($lastChars !== $phpcsFile->eolChar) { - $phpcsFile->recordMetric($stackPtr, 'Newline at EOF', 'no'); - - $error = 'File must end with a newline character'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NotFound'); - if ($fix === true) { - $phpcsFile->fixer->addNewline($stackPtr); - } - } else { - $phpcsFile->recordMetric($stackPtr, 'Newline at EOF', 'yes'); - } - - // Ignore the rest of the file. - return ($phpcsFile->numTokens + 1); - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/EndFileNoNewlineSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/EndFileNoNewlineSniff.php deleted file mode 100644 index 41c9c74..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/EndFileNoNewlineSniff.php +++ /dev/null @@ -1,91 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class EndFileNoNewlineSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - 'CSS', - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_OPEN_TAG, - T_OPEN_TAG_WITH_ECHO, - ]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return int - */ - public function process(File $phpcsFile, $stackPtr) - { - // Skip to the end of the file. - $tokens = $phpcsFile->getTokens(); - $stackPtr = ($phpcsFile->numTokens - 1); - - if ($tokens[$stackPtr]['content'] === '') { - --$stackPtr; - } - - $eolCharLen = strlen($phpcsFile->eolChar); - $lastChars = substr($tokens[$stackPtr]['content'], ($eolCharLen * -1)); - if ($lastChars === $phpcsFile->eolChar) { - $error = 'File must not end with a newline character'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Found'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - - for ($i = $stackPtr; $i > 0; $i--) { - $newContent = rtrim($tokens[$i]['content'], $phpcsFile->eolChar); - $phpcsFile->fixer->replaceToken($i, $newContent); - - if ($newContent !== '') { - break; - } - } - - $phpcsFile->fixer->endChangeset(); - } - } - - // Ignore the rest of the file. - return ($phpcsFile->numTokens + 1); - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/ExecutableFileSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/ExecutableFileSniff.php deleted file mode 100644 index e1213d5..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/ExecutableFileSniff.php +++ /dev/null @@ -1,62 +0,0 @@ - - * @copyright 2019 Matthew Peveler - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class ExecutableFileSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_OPEN_TAG, - T_OPEN_TAG_WITH_ECHO, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return int - */ - public function process(File $phpcsFile, $stackPtr) - { - $filename = $phpcsFile->getFilename(); - - if ($filename !== 'STDIN') { - $perms = fileperms($phpcsFile->getFilename()); - if (($perms & 0x0040) !== 0 || ($perms & 0x0008) !== 0 || ($perms & 0x0001) !== 0) { - $error = 'A PHP file should not be executable; found file permissions set to %s'; - $data = [substr(sprintf('%o', $perms), -4)]; - $phpcsFile->addError($error, 0, 'Executable', $data); - } - } - - // Ignore the rest of the file. - return ($phpcsFile->numTokens + 1); - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/InlineHTMLSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/InlineHTMLSniff.php deleted file mode 100644 index eb01da8..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/InlineHTMLSniff.php +++ /dev/null @@ -1,79 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class InlineHTMLSniff implements Sniff -{ - - /** - * List of supported BOM definitions. - * - * Use encoding names as keys and hex BOM representations as values. - * - * @var array - */ - protected $bomDefinitions = [ - 'UTF-8' => 'efbbbf', - 'UTF-16 (BE)' => 'feff', - 'UTF-16 (LE)' => 'fffe', - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_INLINE_HTML]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return int|null - */ - public function process(File $phpcsFile, $stackPtr) - { - // Allow a byte-order mark. - $tokens = $phpcsFile->getTokens(); - foreach ($this->bomDefinitions as $bomName => $expectedBomHex) { - $bomByteLength = (strlen($expectedBomHex) / 2); - $htmlBomHex = bin2hex(substr($tokens[0]['content'], 0, $bomByteLength)); - if ($htmlBomHex === $expectedBomHex && strlen($tokens[0]['content']) === $bomByteLength) { - return; - } - } - - // Ignore shebang lines. - $tokens = $phpcsFile->getTokens(); - if (substr($tokens[$stackPtr]['content'], 0, 2) === '#!') { - return; - } - - $error = 'PHP files must only contain PHP code'; - $phpcsFile->addError($error, $stackPtr, 'Found'); - - return $phpcsFile->numTokens; - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LineEndingsSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LineEndingsSniff.php deleted file mode 100644 index 845e1bc..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LineEndingsSniff.php +++ /dev/null @@ -1,148 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class LineEndingsSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - 'CSS', - ]; - - /** - * The valid EOL character. - * - * @var string - */ - public $eolChar = '\n'; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_OPEN_TAG, - T_OPEN_TAG_WITH_ECHO, - ]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return int - */ - public function process(File $phpcsFile, $stackPtr) - { - $found = $phpcsFile->eolChar; - $found = str_replace("\n", '\n', $found); - $found = str_replace("\r", '\r', $found); - - $phpcsFile->recordMetric($stackPtr, 'EOL char', $found); - - if ($found === $this->eolChar) { - // Ignore the rest of the file. - return ($phpcsFile->numTokens + 1); - } - - // Check for single line files without an EOL. This is a very special - // case and the EOL char is set to \n when this happens. - if ($found === '\n') { - $tokens = $phpcsFile->getTokens(); - $lastToken = ($phpcsFile->numTokens - 1); - if ($tokens[$lastToken]['line'] === 1 - && $tokens[$lastToken]['content'] !== "\n" - ) { - return; - } - } - - $error = 'End of line character is invalid; expected "%s" but found "%s"'; - $expected = $this->eolChar; - $expected = str_replace("\n", '\n', $expected); - $expected = str_replace("\r", '\r', $expected); - $data = [ - $expected, - $found, - ]; - - // Errors are always reported on line 1, no matter where the first PHP tag is. - $fix = $phpcsFile->addFixableError($error, 0, 'InvalidEOLChar', $data); - - if ($fix === true) { - $tokens = $phpcsFile->getTokens(); - switch ($this->eolChar) { - case '\n': - $eolChar = "\n"; - break; - case '\r': - $eolChar = "\r"; - break; - case '\r\n': - $eolChar = "\r\n"; - break; - default: - $eolChar = $this->eolChar; - break; - } - - for ($i = 0; $i < $phpcsFile->numTokens; $i++) { - if (isset($tokens[($i + 1)]) === true - && $tokens[($i + 1)]['line'] <= $tokens[$i]['line'] - ) { - continue; - } - - // Token is the last on a line. - if (isset($tokens[$i]['orig_content']) === true) { - $tokenContent = $tokens[$i]['orig_content']; - } else { - $tokenContent = $tokens[$i]['content']; - } - - if ($tokenContent === '') { - // Special case for JS/CSS close tag. - continue; - } - - $newContent = rtrim($tokenContent, "\r\n"); - $newContent .= $eolChar; - if ($tokenContent !== $newContent) { - $phpcsFile->fixer->replaceToken($i, $newContent); - } - }//end for - }//end if - - // Ignore the rest of the file. - return ($phpcsFile->numTokens + 1); - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LineLengthSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LineLengthSniff.php deleted file mode 100644 index 5aa45ea..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LineLengthSniff.php +++ /dev/null @@ -1,201 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class LineLengthSniff implements Sniff -{ - - /** - * The limit that the length of a line should not exceed. - * - * @var integer - */ - public $lineLimit = 80; - - /** - * The limit that the length of a line must not exceed. - * - * Set to zero (0) to disable. - * - * @var integer - */ - public $absoluteLineLimit = 100; - - /** - * Whether or not to ignore trailing comments. - * - * This has the effect of also ignoring all lines - * that only contain comments. - * - * @var boolean - */ - public $ignoreComments = false; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_OPEN_TAG]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return int - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - for ($i = 1; $i < $phpcsFile->numTokens; $i++) { - if ($tokens[$i]['column'] === 1) { - $this->checkLineLength($phpcsFile, $tokens, $i); - } - } - - $this->checkLineLength($phpcsFile, $tokens, $i); - - // Ignore the rest of the file. - return ($phpcsFile->numTokens + 1); - - }//end process() - - - /** - * Checks if a line is too long. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param array $tokens The token stack. - * @param int $stackPtr The first token on the next line. - * - * @return void - */ - protected function checkLineLength($phpcsFile, $tokens, $stackPtr) - { - // The passed token is the first on the line. - $stackPtr--; - - if ($tokens[$stackPtr]['column'] === 1 - && $tokens[$stackPtr]['length'] === 0 - ) { - // Blank line. - return; - } - - if ($tokens[$stackPtr]['column'] !== 1 - && $tokens[$stackPtr]['content'] === $phpcsFile->eolChar - ) { - $stackPtr--; - } - - $onlyComment = false; - if (isset(Tokens::$commentTokens[$tokens[$stackPtr]['code']]) === true) { - $prevNonWhiteSpace = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if ($tokens[$stackPtr]['line'] !== $tokens[$prevNonWhiteSpace]['line']) { - $onlyComment = true; - } - } - - if ($onlyComment === true - && isset(Tokens::$phpcsCommentTokens[$tokens[$stackPtr]['code']]) === true - ) { - // Ignore PHPCS annotation comments that are on a line by themselves. - return; - } - - $lineLength = ($tokens[$stackPtr]['column'] + $tokens[$stackPtr]['length'] - 1); - - if ($this->ignoreComments === true - && isset(Tokens::$commentTokens[$tokens[$stackPtr]['code']]) === true - ) { - // Trailing comments are being ignored in line length calculations. - if ($onlyComment === true) { - // The comment is the only thing on the line, so no need to check length. - return; - } - - $lineLength -= $tokens[$stackPtr]['length']; - } - - // Record metrics for common line length groupings. - if ($lineLength <= 80) { - $phpcsFile->recordMetric($stackPtr, 'Line length', '80 or less'); - } else if ($lineLength <= 120) { - $phpcsFile->recordMetric($stackPtr, 'Line length', '81-120'); - } else if ($lineLength <= 150) { - $phpcsFile->recordMetric($stackPtr, 'Line length', '121-150'); - } else { - $phpcsFile->recordMetric($stackPtr, 'Line length', '151 or more'); - } - - if ($onlyComment === true) { - // If this is a long comment, check if it can be broken up onto multiple lines. - // Some comments contain unbreakable strings like URLs and so it makes sense - // to ignore the line length in these cases if the URL would be longer than the max - // line length once you indent it to the correct level. - if ($lineLength > $this->lineLimit) { - $oldLength = strlen($tokens[$stackPtr]['content']); - $newLength = strlen(ltrim($tokens[$stackPtr]['content'], "/#\t ")); - $indent = (($tokens[$stackPtr]['column'] - 1) + ($oldLength - $newLength)); - - $nonBreakingLength = $tokens[$stackPtr]['length']; - - $space = strrpos($tokens[$stackPtr]['content'], ' '); - if ($space !== false) { - $nonBreakingLength -= ($space + 1); - } - - if (($nonBreakingLength + $indent) > $this->lineLimit) { - return; - } - } - }//end if - - if ($this->absoluteLineLimit > 0 - && $lineLength > $this->absoluteLineLimit - ) { - $data = [ - $this->absoluteLineLimit, - $lineLength, - ]; - - $error = 'Line exceeds maximum limit of %s characters; contains %s characters'; - $phpcsFile->addError($error, $stackPtr, 'MaxExceeded', $data); - } else if ($lineLength > $this->lineLimit) { - $data = [ - $this->lineLimit, - $lineLength, - ]; - - $warning = 'Line exceeds %s characters; contains %s characters'; - $phpcsFile->addWarning($warning, $stackPtr, 'TooLong', $data); - } - - }//end checkLineLength() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LowercasedFilenameSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LowercasedFilenameSniff.php deleted file mode 100644 index a9fd4c5..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LowercasedFilenameSniff.php +++ /dev/null @@ -1,70 +0,0 @@ - - * @copyright 2010-2014 Andy Grunwald - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class LowercasedFilenameSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_OPEN_TAG, - T_OPEN_TAG_WITH_ECHO, - ]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return int - */ - public function process(File $phpcsFile, $stackPtr) - { - $filename = $phpcsFile->getFilename(); - if ($filename === 'STDIN') { - return; - } - - $filename = basename($filename); - $lowercaseFilename = strtolower($filename); - if ($filename !== $lowercaseFilename) { - $data = [ - $filename, - $lowercaseFilename, - ]; - $error = 'Filename "%s" doesn\'t match the expected filename "%s"'; - $phpcsFile->addError($error, $stackPtr, 'NotFound', $data); - $phpcsFile->recordMetric($stackPtr, 'Lowercase filename', 'no'); - } else { - $phpcsFile->recordMetric($stackPtr, 'Lowercase filename', 'yes'); - } - - // Ignore the rest of the file. - return ($phpcsFile->numTokens + 1); - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneClassPerFileSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneClassPerFileSniff.php deleted file mode 100644 index 9bcc00c..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneClassPerFileSniff.php +++ /dev/null @@ -1,51 +0,0 @@ - - * @copyright 2010-2014 Andy Grunwald - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class OneClassPerFileSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_CLASS]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $nextClass = $phpcsFile->findNext($this->register(), ($stackPtr + 1)); - if ($nextClass !== false) { - $error = 'Only one class is allowed in a file'; - $phpcsFile->addError($error, $nextClass, 'MultipleFound'); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneInterfacePerFileSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneInterfacePerFileSniff.php deleted file mode 100644 index f7cfa8d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneInterfacePerFileSniff.php +++ /dev/null @@ -1,51 +0,0 @@ - - * @copyright 2010-2014 Andy Grunwald - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class OneInterfacePerFileSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_INTERFACE]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $nextInterface = $phpcsFile->findNext($this->register(), ($stackPtr + 1)); - if ($nextInterface !== false) { - $error = 'Only one interface is allowed in a file'; - $phpcsFile->addError($error, $nextInterface, 'MultipleFound'); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneObjectStructurePerFileSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneObjectStructurePerFileSniff.php deleted file mode 100644 index d9d71b6..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneObjectStructurePerFileSniff.php +++ /dev/null @@ -1,55 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class OneObjectStructurePerFileSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_CLASS, - T_INTERFACE, - T_TRAIT, - ]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $nextClass = $phpcsFile->findNext($this->register(), ($stackPtr + 1)); - if ($nextClass !== false) { - $error = 'Only one object structure is allowed in a file'; - $phpcsFile->addError($error, $nextClass, 'MultipleFound'); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneTraitPerFileSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneTraitPerFileSniff.php deleted file mode 100644 index dd97da8..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneTraitPerFileSniff.php +++ /dev/null @@ -1,51 +0,0 @@ - - * @copyright 2010-2014 Alexander Obuhovich - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class OneTraitPerFileSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_TRAIT]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $nextClass = $phpcsFile->findNext($this->register(), ($stackPtr + 1)); - if ($nextClass !== false) { - $error = 'Only one trait is allowed in a file'; - $phpcsFile->addError($error, $nextClass, 'MultipleFound'); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/DisallowMultipleStatementsSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/DisallowMultipleStatementsSniff.php deleted file mode 100644 index 6f9ff9f..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/DisallowMultipleStatementsSniff.php +++ /dev/null @@ -1,105 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class DisallowMultipleStatementsSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_SEMICOLON]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $fixable = true; - $prev = $stackPtr; - - do { - $prev = $phpcsFile->findPrevious([T_SEMICOLON, T_OPEN_TAG, T_OPEN_TAG_WITH_ECHO, T_PHPCS_IGNORE], ($prev - 1)); - if ($prev === false - || $tokens[$prev]['code'] === T_OPEN_TAG - || $tokens[$prev]['code'] === T_OPEN_TAG_WITH_ECHO - ) { - $phpcsFile->recordMetric($stackPtr, 'Multiple statements on same line', 'no'); - return; - } - - if ($tokens[$prev]['code'] === T_PHPCS_IGNORE) { - $fixable = false; - } - } while ($tokens[$prev]['code'] === T_PHPCS_IGNORE); - - // Ignore multiple statements in a FOR condition. - foreach ([$stackPtr, $prev] as $checkToken) { - if (isset($tokens[$checkToken]['nested_parenthesis']) === true) { - foreach ($tokens[$checkToken]['nested_parenthesis'] as $bracket) { - if (isset($tokens[$bracket]['parenthesis_owner']) === false) { - // Probably a closure sitting inside a function call. - continue; - } - - $owner = $tokens[$bracket]['parenthesis_owner']; - if ($tokens[$owner]['code'] === T_FOR) { - return; - } - } - } - } - - if ($tokens[$prev]['line'] === $tokens[$stackPtr]['line']) { - $phpcsFile->recordMetric($stackPtr, 'Multiple statements on same line', 'yes'); - - $error = 'Each PHP statement must be on a line by itself'; - $code = 'SameLine'; - if ($fixable === false) { - $phpcsFile->addError($error, $stackPtr, $code); - return; - } - - $fix = $phpcsFile->addFixableError($error, $stackPtr, $code); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->addNewline($prev); - if ($tokens[($prev + 1)]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->replaceToken(($prev + 1), ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } else { - $phpcsFile->recordMetric($stackPtr, 'Multiple statements on same line', 'no'); - }//end if - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/MultipleStatementAlignmentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/MultipleStatementAlignmentSniff.php deleted file mode 100644 index 802e594..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/MultipleStatementAlignmentSniff.php +++ /dev/null @@ -1,426 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class MultipleStatementAlignmentSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - /** - * If true, an error will be thrown; otherwise a warning. - * - * @var boolean - */ - public $error = false; - - /** - * The maximum amount of padding before the alignment is ignored. - * - * If the amount of padding required to align this assignment with the - * surrounding assignments exceeds this number, the assignment will be - * ignored and no errors or warnings will be thrown. - * - * @var integer - */ - public $maxPadding = 1000; - - /** - * Controls which side of the assignment token is used for alignment. - * - * @var boolean - */ - public $alignAtEnd = true; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - $tokens = Tokens::$assignmentTokens; - unset($tokens[T_DOUBLE_ARROW]); - return $tokens; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return int - */ - public function process(File $phpcsFile, $stackPtr) - { - $lastAssign = $this->checkAlignment($phpcsFile, $stackPtr); - return ($lastAssign + 1); - - }//end process() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * @param int $end The token where checking should end. - * If NULL, the entire file will be checked. - * - * @return int - */ - public function checkAlignment($phpcsFile, $stackPtr, $end=null) - { - $tokens = $phpcsFile->getTokens(); - - // Ignore assignments used in a condition, like an IF or FOR or closure param defaults. - if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) { - // If the parenthesis is on the same line as the assignment, - // then it should be ignored as it is specifically being grouped. - $parens = $tokens[$stackPtr]['nested_parenthesis']; - $lastParen = array_pop($parens); - if ($tokens[$lastParen]['line'] === $tokens[$stackPtr]['line']) { - return $stackPtr; - } - - foreach ($tokens[$stackPtr]['nested_parenthesis'] as $start => $end) { - if (isset($tokens[$start]['parenthesis_owner']) === true) { - return $stackPtr; - } - } - } - - $assignments = []; - $prevAssign = null; - $lastLine = $tokens[$stackPtr]['line']; - $maxPadding = null; - $stopped = null; - $lastCode = $stackPtr; - $lastSemi = null; - $arrayEnd = null; - - if ($end === null) { - $end = $phpcsFile->numTokens; - } - - $find = Tokens::$assignmentTokens; - unset($find[T_DOUBLE_ARROW]); - - $scopes = Tokens::$scopeOpeners; - unset($scopes[T_CLOSURE]); - unset($scopes[T_ANON_CLASS]); - unset($scopes[T_OBJECT]); - - for ($assign = $stackPtr; $assign < $end; $assign++) { - if ($tokens[$assign]['level'] < $tokens[$stackPtr]['level']) { - // Statement is in a different context, so the block is over. - break; - } - - if (isset($tokens[$assign]['scope_opener']) === true - && $tokens[$assign]['level'] === $tokens[$stackPtr]['level'] - ) { - if (isset($scopes[$tokens[$assign]['code']]) === true) { - // This type of scope indicates that the assignment block is over. - break; - } - - // Skip over the scope block because it is seen as part of the assignment block, - // but also process any assignment blocks that are inside as well. - $nextAssign = $phpcsFile->findNext($find, ($assign + 1), ($tokens[$assign]['scope_closer'] - 1)); - if ($nextAssign !== false) { - $assign = $this->checkAlignment($phpcsFile, $nextAssign); - } else { - $assign = $tokens[$assign]['scope_closer']; - } - - $lastCode = $assign; - continue; - } - - if ($assign === $arrayEnd) { - $arrayEnd = null; - } - - if (isset($find[$tokens[$assign]['code']]) === false) { - // A blank line indicates that the assignment block has ended. - if (isset(Tokens::$emptyTokens[$tokens[$assign]['code']]) === false - && ($tokens[$assign]['line'] - $tokens[$lastCode]['line']) > 1 - && $tokens[$assign]['level'] === $tokens[$stackPtr]['level'] - && $arrayEnd === null - ) { - break; - } - - if ($tokens[$assign]['code'] === T_CLOSE_TAG) { - // Breaking out of PHP ends the assignment block. - break; - } - - if ($tokens[$assign]['code'] === T_OPEN_SHORT_ARRAY - && isset($tokens[$assign]['bracket_closer']) === true - ) { - $arrayEnd = $tokens[$assign]['bracket_closer']; - } - - if ($tokens[$assign]['code'] === T_ARRAY - && isset($tokens[$assign]['parenthesis_opener']) === true - && isset($tokens[$tokens[$assign]['parenthesis_opener']]['parenthesis_closer']) === true - ) { - $arrayEnd = $tokens[$tokens[$assign]['parenthesis_opener']]['parenthesis_closer']; - } - - if (isset(Tokens::$emptyTokens[$tokens[$assign]['code']]) === false) { - $lastCode = $assign; - - if ($tokens[$assign]['code'] === T_SEMICOLON) { - if ($tokens[$assign]['conditions'] === $tokens[$stackPtr]['conditions']) { - if ($lastSemi !== null && $prevAssign !== null && $lastSemi > $prevAssign) { - // This statement did not have an assignment operator in it. - break; - } else { - $lastSemi = $assign; - } - } else if ($tokens[$assign]['level'] < $tokens[$stackPtr]['level']) { - // Statement is in a different context, so the block is over. - break; - } - } - }//end if - - continue; - } else if ($assign !== $stackPtr && $tokens[$assign]['line'] === $lastLine) { - // Skip multiple assignments on the same line. We only need to - // try and align the first assignment. - continue; - }//end if - - if ($assign !== $stackPtr) { - if ($tokens[$assign]['level'] > $tokens[$stackPtr]['level']) { - // Has to be nested inside the same conditions as the first assignment. - // We've gone one level down, so process this new block. - $assign = $this->checkAlignment($phpcsFile, $assign); - $lastCode = $assign; - continue; - } else if ($tokens[$assign]['level'] < $tokens[$stackPtr]['level']) { - // We've gone one level up, so the block we are processing is done. - break; - } else if ($arrayEnd !== null) { - // Assignments inside arrays are not part of - // the original block, so process this new block. - $assign = ($this->checkAlignment($phpcsFile, $assign, $arrayEnd) - 1); - $arrayEnd = null; - $lastCode = $assign; - continue; - } - - // Make sure it is not assigned inside a condition (eg. IF, FOR). - if (isset($tokens[$assign]['nested_parenthesis']) === true) { - // If the parenthesis is on the same line as the assignment, - // then it should be ignored as it is specifically being grouped. - $parens = $tokens[$assign]['nested_parenthesis']; - $lastParen = array_pop($parens); - if ($tokens[$lastParen]['line'] === $tokens[$assign]['line']) { - break; - } - - foreach ($tokens[$assign]['nested_parenthesis'] as $start => $end) { - if (isset($tokens[$start]['parenthesis_owner']) === true) { - break(2); - } - } - } - }//end if - - $var = $phpcsFile->findPrevious( - Tokens::$emptyTokens, - ($assign - 1), - null, - true - ); - - // Make sure we wouldn't break our max padding length if we - // aligned with this statement, or they wouldn't break the max - // padding length if they aligned with us. - $varEnd = $tokens[($var + 1)]['column']; - $assignLen = $tokens[$assign]['length']; - if ($this->alignAtEnd !== true) { - $assignLen = 1; - } - - if ($assign !== $stackPtr) { - if ($prevAssign === null) { - // Processing an inner block but no assignments found. - break; - } - - if (($varEnd + 1) > $assignments[$prevAssign]['assign_col']) { - $padding = 1; - $assignColumn = ($varEnd + 1); - } else { - $padding = ($assignments[$prevAssign]['assign_col'] - $varEnd + $assignments[$prevAssign]['assign_len'] - $assignLen); - if ($padding <= 0) { - $padding = 1; - } - - if ($padding > $this->maxPadding) { - $stopped = $assign; - break; - } - - $assignColumn = ($varEnd + $padding); - }//end if - - if (($assignColumn + $assignLen) > ($assignments[$maxPadding]['assign_col'] + $assignments[$maxPadding]['assign_len'])) { - $newPadding = ($varEnd - $assignments[$maxPadding]['var_end'] + $assignLen - $assignments[$maxPadding]['assign_len'] + 1); - if ($newPadding > $this->maxPadding) { - $stopped = $assign; - break; - } else { - // New alignment settings for previous assignments. - foreach ($assignments as $i => $data) { - if ($i === $assign) { - break; - } - - $newPadding = ($varEnd - $data['var_end'] + $assignLen - $data['assign_len'] + 1); - $assignments[$i]['expected'] = $newPadding; - $assignments[$i]['assign_col'] = ($data['var_end'] + $newPadding); - } - - $padding = 1; - $assignColumn = ($varEnd + 1); - } - } else if ($padding > $assignments[$maxPadding]['expected']) { - $maxPadding = $assign; - }//end if - } else { - $padding = 1; - $assignColumn = ($varEnd + 1); - $maxPadding = $assign; - }//end if - - $found = 0; - if ($tokens[($var + 1)]['code'] === T_WHITESPACE) { - $found = $tokens[($var + 1)]['length']; - if ($found === 0) { - // This means a newline was found. - $found = 1; - } - } - - $assignments[$assign] = [ - 'var_end' => $varEnd, - 'assign_len' => $assignLen, - 'assign_col' => $assignColumn, - 'expected' => $padding, - 'found' => $found, - ]; - - $lastLine = $tokens[$assign]['line']; - $prevAssign = $assign; - }//end for - - if (empty($assignments) === true) { - return $stackPtr; - } - - $numAssignments = count($assignments); - - $errorGenerated = false; - foreach ($assignments as $assignment => $data) { - if ($data['found'] === $data['expected']) { - continue; - } - - $expectedText = $data['expected'].' space'; - if ($data['expected'] !== 1) { - $expectedText .= 's'; - } - - if ($data['found'] === null) { - $foundText = 'a new line'; - } else { - $foundText = $data['found'].' space'; - if ($data['found'] !== 1) { - $foundText .= 's'; - } - } - - if ($numAssignments === 1) { - $type = 'Incorrect'; - $error = 'Equals sign not aligned correctly; expected %s but found %s'; - } else { - $type = 'NotSame'; - $error = 'Equals sign not aligned with surrounding assignments; expected %s but found %s'; - } - - $errorData = [ - $expectedText, - $foundText, - ]; - - if ($this->error === true) { - $fix = $phpcsFile->addFixableError($error, $assignment, $type, $errorData); - } else { - $fix = $phpcsFile->addFixableWarning($error, $assignment, $type.'Warning', $errorData); - } - - $errorGenerated = true; - - if ($fix === true && $data['found'] !== null) { - $newContent = str_repeat(' ', $data['expected']); - if ($data['found'] === 0) { - $phpcsFile->fixer->addContentBefore($assignment, $newContent); - } else { - $phpcsFile->fixer->replaceToken(($assignment - 1), $newContent); - } - } - }//end foreach - - if ($numAssignments > 1) { - if ($errorGenerated === true) { - $phpcsFile->recordMetric($stackPtr, 'Adjacent assignments aligned', 'no'); - } else { - $phpcsFile->recordMetric($stackPtr, 'Adjacent assignments aligned', 'yes'); - } - } - - if ($stopped !== null) { - return $this->checkAlignment($phpcsFile, $stopped); - } else { - return $assign; - } - - }//end checkAlignment() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/NoSpaceAfterCastSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/NoSpaceAfterCastSniff.php deleted file mode 100644 index f6a37da..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/NoSpaceAfterCastSniff.php +++ /dev/null @@ -1,61 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.4.0 Use the Generic.Formatting.SpaceAfterCast sniff with - * the $spacing property set to 0 instead. - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class NoSpaceAfterCastSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return Tokens::$castTokens; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if ($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { - return; - } - - $error = 'A cast statement must not be followed by a space'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceFound'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($stackPtr + 1), ''); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/SpaceAfterCastSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/SpaceAfterCastSniff.php deleted file mode 100644 index f19489e..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/SpaceAfterCastSniff.php +++ /dev/null @@ -1,153 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class SpaceAfterCastSniff implements Sniff -{ - - /** - * The number of spaces desired after a cast token. - * - * @var integer - */ - public $spacing = 1; - - /** - * Allow newlines instead of spaces. - * - * @var boolean - */ - public $ignoreNewlines = false; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return Tokens::$castTokens; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $this->spacing = (int) $this->spacing; - - if ($tokens[$stackPtr]['code'] === T_BINARY_CAST - && $tokens[$stackPtr]['content'] === 'b' - ) { - // You can't replace a space after this type of binary casting. - return; - } - - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($nextNonEmpty === false) { - return; - } - - if ($this->ignoreNewlines === true - && $tokens[$stackPtr]['line'] !== $tokens[$nextNonEmpty]['line'] - ) { - $phpcsFile->recordMetric($stackPtr, 'Spacing after cast statement', 'newline'); - return; - } - - if ($this->spacing === 0 && $nextNonEmpty === ($stackPtr + 1)) { - $phpcsFile->recordMetric($stackPtr, 'Spacing after cast statement', 0); - return; - } - - $nextNonWhitespace = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($nextNonEmpty !== $nextNonWhitespace) { - $error = 'Expected %s space(s) after cast statement; comment found'; - $data = [$this->spacing]; - $phpcsFile->addError($error, $stackPtr, 'CommentFound', $data); - - if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE) { - $phpcsFile->recordMetric($stackPtr, 'Spacing after cast statement', $tokens[($stackPtr + 1)]['length']); - } else { - $phpcsFile->recordMetric($stackPtr, 'Spacing after cast statement', 0); - } - - return; - } - - $found = 0; - if ($tokens[$stackPtr]['line'] !== $tokens[$nextNonEmpty]['line']) { - $found = 'newline'; - } else if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE) { - $found = $tokens[($stackPtr + 1)]['length']; - } - - $phpcsFile->recordMetric($stackPtr, 'Spacing after cast statement', $found); - - if ($found === $this->spacing) { - return; - } - - $error = 'Expected %s space(s) after cast statement; %s found'; - $data = [ - $this->spacing, - $found, - ]; - - $errorCode = 'TooMuchSpace'; - if ($this->spacing !== 0) { - if ($found === 0) { - $errorCode = 'NoSpace'; - } else if ($found !== 'newline' && $found < $this->spacing) { - $errorCode = 'TooLittleSpace'; - } - } - - $fix = $phpcsFile->addFixableError($error, $stackPtr, $errorCode, $data); - - if ($fix === true) { - $padding = str_repeat(' ', $this->spacing); - if ($found === 0) { - $phpcsFile->fixer->addContent($stackPtr, $padding); - } else { - $phpcsFile->fixer->beginChangeset(); - $start = ($stackPtr + 1); - - if ($this->spacing > 0) { - $phpcsFile->fixer->replaceToken($start, $padding); - ++$start; - } - - for ($i = $start; $i < $nextNonWhitespace; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/SpaceAfterNotSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/SpaceAfterNotSniff.php deleted file mode 100644 index b74ca80..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/SpaceAfterNotSniff.php +++ /dev/null @@ -1,135 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class SpaceAfterNotSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - /** - * The number of spaces desired after the NOT operator. - * - * @var integer - */ - public $spacing = 1; - - /** - * Allow newlines instead of spaces. - * - * @var boolean - */ - public $ignoreNewlines = false; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_BOOLEAN_NOT]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $this->spacing = (int) $this->spacing; - - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($nextNonEmpty === false) { - return; - } - - if ($this->ignoreNewlines === true - && $tokens[$stackPtr]['line'] !== $tokens[$nextNonEmpty]['line'] - ) { - return; - } - - if ($this->spacing === 0 && $nextNonEmpty === ($stackPtr + 1)) { - return; - } - - $nextNonWhitespace = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($nextNonEmpty !== $nextNonWhitespace) { - $error = 'Expected %s space(s) after NOT operator; comment found'; - $data = [$this->spacing]; - $phpcsFile->addError($error, $stackPtr, 'CommentFound', $data); - return; - } - - $found = 0; - if ($tokens[$stackPtr]['line'] !== $tokens[$nextNonEmpty]['line']) { - $found = 'newline'; - } else if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE) { - $found = $tokens[($stackPtr + 1)]['length']; - } - - if ($found === $this->spacing) { - return; - } - - $error = 'Expected %s space(s) after NOT operator; %s found'; - $data = [ - $this->spacing, - $found, - ]; - - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Incorrect', $data); - if ($fix === true) { - $padding = str_repeat(' ', $this->spacing); - if ($found === 0) { - $phpcsFile->fixer->addContent($stackPtr, $padding); - } else { - $phpcsFile->fixer->beginChangeset(); - $start = ($stackPtr + 1); - - if ($this->spacing > 0) { - $phpcsFile->fixer->replaceToken($start, $padding); - ++$start; - } - - for ($i = $start; $i < $nextNonWhitespace; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/SpaceBeforeCastSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/SpaceBeforeCastSniff.php deleted file mode 100644 index a4f85ae..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/SpaceBeforeCastSniff.php +++ /dev/null @@ -1,73 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class SpaceBeforeCastSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return Tokens::$castTokens; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if ($tokens[$stackPtr]['column'] === 1) { - return; - } - - if ($tokens[($stackPtr - 1)]['code'] !== T_WHITESPACE) { - $error = 'A cast statement must be preceded by a single space'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpace'); - if ($fix === true) { - $phpcsFile->fixer->addContentBefore($stackPtr, ' '); - } - - $phpcsFile->recordMetric($stackPtr, 'Spacing before cast statement', 0); - return; - } - - $phpcsFile->recordMetric($stackPtr, 'Spacing before cast statement', $tokens[($stackPtr - 1)]['length']); - - if ($tokens[($stackPtr - 1)]['column'] !== 1 && $tokens[($stackPtr - 1)]['length'] !== 1) { - $error = 'A cast statement must be preceded by a single space'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'TooMuchSpace'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($stackPtr - 1), ' '); - } - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/CallTimePassByReferenceSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/CallTimePassByReferenceSniff.php deleted file mode 100644 index 425748c..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/CallTimePassByReferenceSniff.php +++ /dev/null @@ -1,141 +0,0 @@ - - * @copyright 2009-2014 Florian Grandel - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Functions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class CallTimePassByReferenceSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_STRING, - T_VARIABLE, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $findTokens = Tokens::$emptyTokens; - $findTokens[] = T_BITWISE_AND; - - $prev = $phpcsFile->findPrevious($findTokens, ($stackPtr - 1), null, true); - - // Skip tokens that are the names of functions or classes - // within their definitions. For example: function myFunction... - // "myFunction" is T_STRING but we should skip because it is not a - // function or method *call*. - $prevCode = $tokens[$prev]['code']; - if ($prevCode === T_FUNCTION || $prevCode === T_CLASS) { - return; - } - - // If the next non-whitespace token after the function or method call - // is not an opening parenthesis then it cant really be a *call*. - $functionName = $stackPtr; - $openBracket = $phpcsFile->findNext( - Tokens::$emptyTokens, - ($functionName + 1), - null, - true - ); - - if ($tokens[$openBracket]['code'] !== T_OPEN_PARENTHESIS) { - return; - } - - if (isset($tokens[$openBracket]['parenthesis_closer']) === false) { - return; - } - - $closeBracket = $tokens[$openBracket]['parenthesis_closer']; - - $nextSeparator = $openBracket; - $find = [ - T_VARIABLE, - T_OPEN_SHORT_ARRAY, - ]; - - while (($nextSeparator = $phpcsFile->findNext($find, ($nextSeparator + 1), $closeBracket)) !== false) { - if (isset($tokens[$nextSeparator]['nested_parenthesis']) === false) { - continue; - } - - if ($tokens[$nextSeparator]['code'] === T_OPEN_SHORT_ARRAY) { - $nextSeparator = $tokens[$nextSeparator]['bracket_closer']; - continue; - } - - // Make sure the variable belongs directly to this function call - // and is not inside a nested function call or array. - $brackets = $tokens[$nextSeparator]['nested_parenthesis']; - $lastBracket = array_pop($brackets); - if ($lastBracket !== $closeBracket) { - continue; - } - - $tokenBefore = $phpcsFile->findPrevious( - Tokens::$emptyTokens, - ($nextSeparator - 1), - null, - true - ); - - if ($tokens[$tokenBefore]['code'] === T_BITWISE_AND) { - if ($phpcsFile->isReference($tokenBefore) === false) { - continue; - } - - // We also want to ignore references used in assignment - // operations passed as function arguments, but isReference() - // sees them as valid references (which they are). - $tokenBefore = $phpcsFile->findPrevious( - Tokens::$emptyTokens, - ($tokenBefore - 1), - null, - true - ); - - if (isset(Tokens::$assignmentTokens[$tokens[$tokenBefore]['code']]) === true) { - continue; - } - - // T_BITWISE_AND represents a pass-by-reference. - $error = 'Call-time pass-by-reference calls are prohibited'; - $phpcsFile->addError($error, $tokenBefore, 'NotAllowed'); - }//end if - }//end while - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/FunctionCallArgumentSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/FunctionCallArgumentSpacingSniff.php deleted file mode 100644 index ca92238..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/FunctionCallArgumentSpacingSniff.php +++ /dev/null @@ -1,185 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Functions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class FunctionCallArgumentSpacingSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return[ - T_STRING, - T_ISSET, - T_UNSET, - T_SELF, - T_STATIC, - T_VARIABLE, - T_CLOSE_CURLY_BRACKET, - T_CLOSE_PARENTHESIS, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Skip tokens that are the names of functions or classes - // within their definitions. For example: - // function myFunction... - // "myFunction" is T_STRING but we should skip because it is not a - // function or method *call*. - $functionName = $stackPtr; - $ignoreTokens = Tokens::$emptyTokens; - $ignoreTokens[] = T_BITWISE_AND; - $functionKeyword = $phpcsFile->findPrevious($ignoreTokens, ($stackPtr - 1), null, true); - if ($tokens[$functionKeyword]['code'] === T_FUNCTION || $tokens[$functionKeyword]['code'] === T_CLASS) { - return; - } - - if ($tokens[$stackPtr]['code'] === T_CLOSE_CURLY_BRACKET - && isset($tokens[$stackPtr]['scope_condition']) === true - ) { - // Not a function call. - return; - } - - // If the next non-whitespace token after the function or method call - // is not an opening parenthesis then it can't really be a *call*. - $openBracket = $phpcsFile->findNext(Tokens::$emptyTokens, ($functionName + 1), null, true); - if ($tokens[$openBracket]['code'] !== T_OPEN_PARENTHESIS) { - return; - } - - if (isset($tokens[$openBracket]['parenthesis_closer']) === false) { - return; - } - - $this->checkSpacing($phpcsFile, $stackPtr, $openBracket); - - }//end process() - - - /** - * Checks the spacing around commas. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * @param int $openBracket The position of the opening bracket - * in the stack passed in $tokens. - * - * @return void - */ - public function checkSpacing(File $phpcsFile, $stackPtr, $openBracket) - { - $tokens = $phpcsFile->getTokens(); - - $closeBracket = $tokens[$openBracket]['parenthesis_closer']; - $nextSeparator = $openBracket; - - $find = [ - T_COMMA, - T_CLOSURE, - T_ANON_CLASS, - T_OPEN_SHORT_ARRAY, - ]; - - while (($nextSeparator = $phpcsFile->findNext($find, ($nextSeparator + 1), $closeBracket)) !== false) { - if ($tokens[$nextSeparator]['code'] === T_CLOSURE - || $tokens[$nextSeparator]['code'] === T_ANON_CLASS - ) { - // Skip closures. - $nextSeparator = $tokens[$nextSeparator]['scope_closer']; - continue; - } else if ($tokens[$nextSeparator]['code'] === T_OPEN_SHORT_ARRAY) { - // Skips arrays using short notation. - $nextSeparator = $tokens[$nextSeparator]['bracket_closer']; - continue; - } - - // Make sure the comma or variable belongs directly to this function call, - // and is not inside a nested function call or array. - $brackets = $tokens[$nextSeparator]['nested_parenthesis']; - $lastBracket = array_pop($brackets); - if ($lastBracket !== $closeBracket) { - continue; - } - - if ($tokens[$nextSeparator]['code'] === T_COMMA) { - if ($tokens[($nextSeparator - 1)]['code'] === T_WHITESPACE) { - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($nextSeparator - 2), null, true); - if (isset(Tokens::$heredocTokens[$tokens[$prev]['code']]) === false) { - $error = 'Space found before comma in argument list'; - $fix = $phpcsFile->addFixableError($error, $nextSeparator, 'SpaceBeforeComma'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - - if ($tokens[$prev]['line'] !== $tokens[$nextSeparator]['line']) { - $phpcsFile->fixer->addContent($prev, ','); - $phpcsFile->fixer->replaceToken($nextSeparator, ''); - } else { - $phpcsFile->fixer->replaceToken(($nextSeparator - 1), ''); - } - - $phpcsFile->fixer->endChangeset(); - } - }//end if - }//end if - - if ($tokens[($nextSeparator + 1)]['code'] !== T_WHITESPACE) { - $error = 'No space found after comma in argument list'; - $fix = $phpcsFile->addFixableError($error, $nextSeparator, 'NoSpaceAfterComma'); - if ($fix === true) { - $phpcsFile->fixer->addContent($nextSeparator, ' '); - } - } else { - // If there is a newline in the space, then they must be formatting - // each argument on a newline, which is valid, so ignore it. - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($nextSeparator + 1), null, true); - if ($tokens[$next]['line'] === $tokens[$nextSeparator]['line']) { - $space = $tokens[($nextSeparator + 1)]['length']; - if ($space > 1) { - $error = 'Expected 1 space after comma in argument list; %s found'; - $data = [$space]; - $fix = $phpcsFile->addFixableError($error, $nextSeparator, 'TooMuchSpaceAfterComma', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($nextSeparator + 1), ' '); - } - } - } - }//end if - }//end if - }//end while - - }//end checkSpacing() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceBsdAllmanSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceBsdAllmanSniff.php deleted file mode 100644 index ff19526..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceBsdAllmanSniff.php +++ /dev/null @@ -1,227 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Functions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class OpeningFunctionBraceBsdAllmanSniff implements Sniff -{ - - /** - * Should this sniff check function braces? - * - * @var boolean - */ - public $checkFunctions = true; - - /** - * Should this sniff check closure braces? - * - * @var boolean - */ - public $checkClosures = false; - - - /** - * Registers the tokens that this sniff wants to listen for. - * - * @return int[] - */ - public function register() - { - return [ - T_FUNCTION, - T_CLOSURE, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]['scope_opener']) === false) { - return; - } - - if (($tokens[$stackPtr]['code'] === T_FUNCTION - && (bool) $this->checkFunctions === false) - || ($tokens[$stackPtr]['code'] === T_CLOSURE - && (bool) $this->checkClosures === false) - ) { - return; - } - - $openingBrace = $tokens[$stackPtr]['scope_opener']; - $closeBracket = $tokens[$stackPtr]['parenthesis_closer']; - if ($tokens[$stackPtr]['code'] === T_CLOSURE) { - $use = $phpcsFile->findNext(T_USE, ($closeBracket + 1), $tokens[$stackPtr]['scope_opener']); - if ($use !== false) { - $openBracket = $phpcsFile->findNext(T_OPEN_PARENTHESIS, ($use + 1)); - $closeBracket = $tokens[$openBracket]['parenthesis_closer']; - } - } - - // Find the end of the function declaration. - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($openingBrace - 1), $closeBracket, true); - - $functionLine = $tokens[$prev]['line']; - $braceLine = $tokens[$openingBrace]['line']; - - $lineDifference = ($braceLine - $functionLine); - - $metricType = 'Function'; - if ($tokens[$stackPtr]['code'] === T_CLOSURE) { - $metricType = 'Closure'; - } - - if ($lineDifference === 0) { - $error = 'Opening brace should be on a new line'; - $fix = $phpcsFile->addFixableError($error, $openingBrace, 'BraceOnSameLine'); - if ($fix === true) { - $hasTrailingAnnotation = false; - for ($nextLine = ($openingBrace + 1); $nextLine < $phpcsFile->numTokens; $nextLine++) { - if ($tokens[$openingBrace]['line'] !== $tokens[$nextLine]['line']) { - break; - } - - if (isset(Tokens::$phpcsCommentTokens[$tokens[$nextLine]['code']]) === true) { - $hasTrailingAnnotation = true; - } - } - - $phpcsFile->fixer->beginChangeset(); - $indent = $phpcsFile->findFirstOnLine([], $openingBrace); - - if ($hasTrailingAnnotation === false || $nextLine === false) { - if ($tokens[$indent]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->addContentBefore($openingBrace, $tokens[$indent]['content']); - } - - if ($tokens[($openingBrace - 1)]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->replaceToken(($openingBrace - 1), ''); - } - - $phpcsFile->fixer->addNewlineBefore($openingBrace); - } else { - $phpcsFile->fixer->replaceToken($openingBrace, ''); - $phpcsFile->fixer->addNewlineBefore($nextLine); - $phpcsFile->fixer->addContentBefore($nextLine, '{'); - - if ($tokens[$indent]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->addContentBefore($nextLine, $tokens[$indent]['content']); - } - } - - $phpcsFile->fixer->endChangeset(); - }//end if - - $phpcsFile->recordMetric($stackPtr, "$metricType opening brace placement", 'same line'); - } else if ($lineDifference > 1) { - $error = 'Opening brace should be on the line after the declaration; found %s blank line(s)'; - $data = [($lineDifference - 1)]; - - $prevNonWs = $phpcsFile->findPrevious(T_WHITESPACE, ($openingBrace - 1), $closeBracket, true); - if ($prevNonWs !== $prev) { - // There must be a comment between the end of the function declaration and the open brace. - // Report, but don't fix. - $phpcsFile->addError($error, $openingBrace, 'BraceSpacing', $data); - } else { - $fix = $phpcsFile->addFixableError($error, $openingBrace, 'BraceSpacing', $data); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = $openingBrace; $i > $prev; $i--) { - if ($tokens[$i]['line'] === $tokens[$openingBrace]['line']) { - if ($tokens[$i]['column'] === 1) { - $phpcsFile->fixer->addNewLineBefore($i); - } - - continue; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - }//end if - }//end if - - $ignore = Tokens::$phpcsCommentTokens; - $ignore[] = T_WHITESPACE; - $next = $phpcsFile->findNext($ignore, ($openingBrace + 1), null, true); - if ($tokens[$next]['line'] === $tokens[$openingBrace]['line']) { - if ($next === $tokens[$stackPtr]['scope_closer']) { - // Ignore empty functions. - return; - } - - $error = 'Opening brace must be the last content on the line'; - $fix = $phpcsFile->addFixableError($error, $openingBrace, 'ContentAfterBrace'); - if ($fix === true) { - $phpcsFile->fixer->addNewline($openingBrace); - } - } - - // Only continue checking if the opening brace looks good. - if ($lineDifference !== 1) { - return; - } - - // We need to actually find the first piece of content on this line, - // as if this is a method with tokens before it (public, static etc) - // or an if with an else before it, then we need to start the scope - // checking from there, rather than the current token. - $lineStart = $phpcsFile->findFirstOnLine(T_WHITESPACE, $stackPtr, true); - - // The opening brace is on the correct line, now it needs to be - // checked to be correctly indented. - $startColumn = $tokens[$lineStart]['column']; - $braceIndent = $tokens[$openingBrace]['column']; - - if ($braceIndent !== $startColumn) { - $expected = ($startColumn - 1); - $found = ($braceIndent - 1); - - $error = 'Opening brace indented incorrectly; expected %s spaces, found %s'; - $data = [ - $expected, - $found, - ]; - - $fix = $phpcsFile->addFixableError($error, $openingBrace, 'BraceIndent', $data); - if ($fix === true) { - $indent = str_repeat(' ', $expected); - if ($found === 0) { - $phpcsFile->fixer->addContentBefore($openingBrace, $indent); - } else { - $phpcsFile->fixer->replaceToken(($openingBrace - 1), $indent); - } - } - }//end if - - $phpcsFile->recordMetric($stackPtr, "$metricType opening brace placement", 'new line'); - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceKernighanRitchieSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceKernighanRitchieSniff.php deleted file mode 100644 index 62eafc1..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceKernighanRitchieSniff.php +++ /dev/null @@ -1,184 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Functions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class OpeningFunctionBraceKernighanRitchieSniff implements Sniff -{ - - /** - * Should this sniff check function braces? - * - * @var boolean - */ - public $checkFunctions = true; - - /** - * Should this sniff check closure braces? - * - * @var boolean - */ - public $checkClosures = false; - - - /** - * Registers the tokens that this sniff wants to listen for. - * - * @return void - */ - public function register() - { - return [ - T_FUNCTION, - T_CLOSURE, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]['scope_opener']) === false) { - return; - } - - if (($tokens[$stackPtr]['code'] === T_FUNCTION - && (bool) $this->checkFunctions === false) - || ($tokens[$stackPtr]['code'] === T_CLOSURE - && (bool) $this->checkClosures === false) - ) { - return; - } - - $openingBrace = $tokens[$stackPtr]['scope_opener']; - $closeBracket = $tokens[$stackPtr]['parenthesis_closer']; - if ($tokens[$stackPtr]['code'] === T_CLOSURE) { - $use = $phpcsFile->findNext(T_USE, ($closeBracket + 1), $tokens[$stackPtr]['scope_opener']); - if ($use !== false) { - $openBracket = $phpcsFile->findNext(T_OPEN_PARENTHESIS, ($use + 1)); - $closeBracket = $tokens[$openBracket]['parenthesis_closer']; - } - } - - // Find the end of the function declaration. - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($openingBrace - 1), $closeBracket, true); - - $functionLine = $tokens[$prev]['line']; - $braceLine = $tokens[$openingBrace]['line']; - - $lineDifference = ($braceLine - $functionLine); - - $metricType = 'Function'; - if ($tokens[$stackPtr]['code'] === T_CLOSURE) { - $metricType = 'Closure'; - } - - if ($lineDifference > 0) { - $phpcsFile->recordMetric($stackPtr, "$metricType opening brace placement", 'new line'); - $error = 'Opening brace should be on the same line as the declaration'; - $fix = $phpcsFile->addFixableError($error, $openingBrace, 'BraceOnNewLine'); - if ($fix === true) { - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($openingBrace - 1), $closeBracket, true); - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->addContent($prev, ' {'); - $phpcsFile->fixer->replaceToken($openingBrace, ''); - if ($tokens[($openingBrace + 1)]['code'] === T_WHITESPACE - && $tokens[($openingBrace + 2)]['line'] > $tokens[$openingBrace]['line'] - ) { - // Brace is followed by a new line, so remove it to ensure we don't - // leave behind a blank line at the top of the block. - $phpcsFile->fixer->replaceToken(($openingBrace + 1), ''); - - if ($tokens[($openingBrace - 1)]['code'] === T_WHITESPACE - && $tokens[($openingBrace - 1)]['line'] === $tokens[$openingBrace]['line'] - && $tokens[($openingBrace - 2)]['line'] < $tokens[$openingBrace]['line'] - ) { - // Brace is preceded by indent, so remove it to ensure we don't - // leave behind more indent than is required for the first line. - $phpcsFile->fixer->replaceToken(($openingBrace - 1), ''); - } - } - - $phpcsFile->fixer->endChangeset(); - }//end if - } else { - $phpcsFile->recordMetric($stackPtr, "$metricType opening brace placement", 'same line'); - }//end if - - $ignore = Tokens::$phpcsCommentTokens; - $ignore[] = T_WHITESPACE; - $next = $phpcsFile->findNext($ignore, ($openingBrace + 1), null, true); - if ($tokens[$next]['line'] === $tokens[$openingBrace]['line']) { - if ($next === $tokens[$stackPtr]['scope_closer'] - || $tokens[$next]['code'] === T_CLOSE_TAG - ) { - // Ignore empty functions. - return; - } - - $error = 'Opening brace must be the last content on the line'; - $fix = $phpcsFile->addFixableError($error, $openingBrace, 'ContentAfterBrace'); - if ($fix === true) { - $phpcsFile->fixer->addNewline($openingBrace); - } - } - - // Only continue checking if the opening brace looks good. - if ($lineDifference > 0) { - return; - } - - // We are looking for tabs, even if they have been replaced, because - // we enforce a space here. - if (isset($tokens[($openingBrace - 1)]['orig_content']) === true) { - $spacing = $tokens[($openingBrace - 1)]['orig_content']; - } else { - $spacing = $tokens[($openingBrace - 1)]['content']; - } - - if ($tokens[($openingBrace - 1)]['code'] !== T_WHITESPACE) { - $length = 0; - } else if ($spacing === "\t") { - $length = '\t'; - } else { - $length = strlen($spacing); - } - - if ($length !== 1) { - $error = 'Expected 1 space before opening brace; found %s'; - $data = [$length]; - $fix = $phpcsFile->addFixableError($error, $closeBracket, 'SpaceBeforeBrace', $data); - if ($fix === true) { - if ($length === 0 || $length === '\t') { - $phpcsFile->fixer->addContentBefore($openingBrace, ' '); - } else { - $phpcsFile->fixer->replaceToken(($openingBrace - 1), ' '); - } - } - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Metrics/CyclomaticComplexitySniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Metrics/CyclomaticComplexitySniff.php deleted file mode 100644 index 18100c2..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Metrics/CyclomaticComplexitySniff.php +++ /dev/null @@ -1,116 +0,0 @@ - - * @author Greg Sherwood - * @copyright 2007-2014 Mayflower GmbH - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Metrics; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class CyclomaticComplexitySniff implements Sniff -{ - - /** - * A complexity higher than this value will throw a warning. - * - * @var integer - */ - public $complexity = 10; - - /** - * A complexity higher than this value will throw an error. - * - * @var integer - */ - public $absoluteComplexity = 20; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_FUNCTION]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Ignore abstract methods. - if (isset($tokens[$stackPtr]['scope_opener']) === false) { - return; - } - - // Detect start and end of this function definition. - $start = $tokens[$stackPtr]['scope_opener']; - $end = $tokens[$stackPtr]['scope_closer']; - - // Predicate nodes for PHP. - $find = [ - T_CASE => true, - T_DEFAULT => true, - T_CATCH => true, - T_IF => true, - T_FOR => true, - T_FOREACH => true, - T_WHILE => true, - T_ELSEIF => true, - T_INLINE_THEN => true, - T_COALESCE => true, - T_COALESCE_EQUAL => true, - T_MATCH_ARROW => true, - ]; - - $complexity = 1; - - // Iterate from start to end and count predicate nodes. - for ($i = ($start + 1); $i < $end; $i++) { - if (isset($find[$tokens[$i]['code']]) === true) { - $complexity++; - } - } - - if ($complexity > $this->absoluteComplexity) { - $error = 'Function\'s cyclomatic complexity (%s) exceeds allowed maximum of %s'; - $data = [ - $complexity, - $this->absoluteComplexity, - ]; - $phpcsFile->addError($error, $stackPtr, 'MaxExceeded', $data); - } else if ($complexity > $this->complexity) { - $warning = 'Function\'s cyclomatic complexity (%s) exceeds %s; consider refactoring the function'; - $data = [ - $complexity, - $this->complexity, - ]; - $phpcsFile->addWarning($warning, $stackPtr, 'TooHigh', $data); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Metrics/NestingLevelSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Metrics/NestingLevelSniff.php deleted file mode 100644 index d001ded..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Metrics/NestingLevelSniff.php +++ /dev/null @@ -1,100 +0,0 @@ - - * @author Greg Sherwood - * @copyright 2007-2014 Mayflower GmbH - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Metrics; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class NestingLevelSniff implements Sniff -{ - - /** - * A nesting level higher than this value will throw a warning. - * - * @var integer - */ - public $nestingLevel = 5; - - /** - * A nesting level higher than this value will throw an error. - * - * @var integer - */ - public $absoluteNestingLevel = 10; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_FUNCTION]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Ignore abstract methods. - if (isset($tokens[$stackPtr]['scope_opener']) === false) { - return; - } - - // Detect start and end of this function definition. - $start = $tokens[$stackPtr]['scope_opener']; - $end = $tokens[$stackPtr]['scope_closer']; - - $nestingLevel = 0; - - // Find the maximum nesting level of any token in the function. - for ($i = ($start + 1); $i < $end; $i++) { - $level = $tokens[$i]['level']; - if ($nestingLevel < $level) { - $nestingLevel = $level; - } - } - - // We subtract the nesting level of the function itself. - $nestingLevel = ($nestingLevel - $tokens[$stackPtr]['level'] - 1); - - if ($nestingLevel > $this->absoluteNestingLevel) { - $error = 'Function\'s nesting level (%s) exceeds allowed maximum of %s'; - $data = [ - $nestingLevel, - $this->absoluteNestingLevel, - ]; - $phpcsFile->addError($error, $stackPtr, 'MaxExceeded', $data); - } else if ($nestingLevel > $this->nestingLevel) { - $warning = 'Function\'s nesting level (%s) exceeds %s; consider refactoring the function'; - $data = [ - $nestingLevel, - $this->nestingLevel, - ]; - $phpcsFile->addWarning($warning, $stackPtr, 'TooHigh', $data); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/AbstractClassNamePrefixSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/AbstractClassNamePrefixSniff.php deleted file mode 100644 index 3e3af83..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/AbstractClassNamePrefixSniff.php +++ /dev/null @@ -1,60 +0,0 @@ - - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class AbstractClassNamePrefixSniff implements Sniff -{ - - - /** - * Registers the tokens that this sniff wants to listen for. - * - * @return int[] - */ - public function register() - { - return [T_CLASS]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - if ($phpcsFile->getClassProperties($stackPtr)['is_abstract'] === false) { - // This class is not abstract so we don't need to check it. - return; - } - - $className = $phpcsFile->getDeclarationName($stackPtr); - if ($className === null) { - // We are not interested in anonymous classes. - return; - } - - $prefix = substr($className, 0, 8); - if (strtolower($prefix) !== 'abstract') { - $phpcsFile->addError('Abstract class names must be prefixed with "Abstract"; found "%s"', $stackPtr, 'Missing', [$className]); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/CamelCapsFunctionNameSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/CamelCapsFunctionNameSniff.php deleted file mode 100644 index b451120..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/CamelCapsFunctionNameSniff.php +++ /dev/null @@ -1,223 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\AbstractScopeSniff; -use PHP_CodeSniffer\Util\Common; -use PHP_CodeSniffer\Util\Tokens; - -class CamelCapsFunctionNameSniff extends AbstractScopeSniff -{ - - /** - * A list of all PHP magic methods. - * - * @var array - */ - protected $magicMethods = [ - 'construct' => true, - 'destruct' => true, - 'call' => true, - 'callstatic' => true, - 'get' => true, - 'set' => true, - 'isset' => true, - 'unset' => true, - 'sleep' => true, - 'wakeup' => true, - 'serialize' => true, - 'unserialize' => true, - 'tostring' => true, - 'invoke' => true, - 'set_state' => true, - 'clone' => true, - 'debuginfo' => true, - ]; - - /** - * A list of all PHP non-magic methods starting with a double underscore. - * - * These come from PHP modules such as SOAPClient. - * - * @var array - */ - protected $methodsDoubleUnderscore = [ - 'dorequest' => true, - 'getcookies' => true, - 'getfunctions' => true, - 'getlastrequest' => true, - 'getlastrequestheaders' => true, - 'getlastresponse' => true, - 'getlastresponseheaders' => true, - 'gettypes' => true, - 'setcookie' => true, - 'setlocation' => true, - 'setsoapheaders' => true, - 'soapcall' => true, - ]; - - /** - * A list of all PHP magic functions. - * - * @var array - */ - protected $magicFunctions = ['autoload' => true]; - - /** - * If TRUE, the string must not have two capital letters next to each other. - * - * @var boolean - */ - public $strict = true; - - - /** - * Constructs a Generic_Sniffs_NamingConventions_CamelCapsFunctionNameSniff. - */ - public function __construct() - { - parent::__construct(Tokens::$ooScopeTokens, [T_FUNCTION], true); - - }//end __construct() - - - /** - * Processes the tokens within the scope. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being processed. - * @param int $stackPtr The position where this token was - * found. - * @param int $currScope The position of the current scope. - * - * @return void - */ - protected function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScope) - { - $tokens = $phpcsFile->getTokens(); - - // Determine if this is a function which needs to be examined. - $conditions = $tokens[$stackPtr]['conditions']; - end($conditions); - $deepestScope = key($conditions); - if ($deepestScope !== $currScope) { - return; - } - - $methodName = $phpcsFile->getDeclarationName($stackPtr); - if ($methodName === null) { - // Ignore closures. - return; - } - - $className = $phpcsFile->getDeclarationName($currScope); - if (isset($className) === false) { - $className = '[Anonymous Class]'; - } - - $errorData = [$className.'::'.$methodName]; - - $methodNameLc = strtolower($methodName); - $classNameLc = strtolower($className); - - // Is this a magic method. i.e., is prefixed with "__" ? - if (preg_match('|^__[^_]|', $methodName) !== 0) { - $magicPart = substr($methodNameLc, 2); - if (isset($this->magicMethods[$magicPart]) === true - || isset($this->methodsDoubleUnderscore[$magicPart]) === true - ) { - return; - } - - $error = 'Method name "%s" is invalid; only PHP magic methods should be prefixed with a double underscore'; - $phpcsFile->addError($error, $stackPtr, 'MethodDoubleUnderscore', $errorData); - } - - // PHP4 constructors are allowed to break our rules. - if ($methodNameLc === $classNameLc) { - return; - } - - // PHP4 destructors are allowed to break our rules. - if ($methodNameLc === '_'.$classNameLc) { - return; - } - - // Ignore first underscore in methods prefixed with "_". - $methodName = ltrim($methodName, '_'); - - $methodProps = $phpcsFile->getMethodProperties($stackPtr); - if (Common::isCamelCaps($methodName, false, true, $this->strict) === false) { - if ($methodProps['scope_specified'] === true) { - $error = '%s method name "%s" is not in camel caps format'; - $data = [ - ucfirst($methodProps['scope']), - $errorData[0], - ]; - $phpcsFile->addError($error, $stackPtr, 'ScopeNotCamelCaps', $data); - } else { - $error = 'Method name "%s" is not in camel caps format'; - $phpcsFile->addError($error, $stackPtr, 'NotCamelCaps', $errorData); - } - - $phpcsFile->recordMetric($stackPtr, 'CamelCase method name', 'no'); - return; - } else { - $phpcsFile->recordMetric($stackPtr, 'CamelCase method name', 'yes'); - } - - }//end processTokenWithinScope() - - - /** - * Processes the tokens outside the scope. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being processed. - * @param int $stackPtr The position where this token was - * found. - * - * @return void - */ - protected function processTokenOutsideScope(File $phpcsFile, $stackPtr) - { - $functionName = $phpcsFile->getDeclarationName($stackPtr); - if ($functionName === null) { - // Ignore closures. - return; - } - - $errorData = [$functionName]; - - // Is this a magic function. i.e., it is prefixed with "__". - if (preg_match('|^__[^_]|', $functionName) !== 0) { - $magicPart = strtolower(substr($functionName, 2)); - if (isset($this->magicFunctions[$magicPart]) === true) { - return; - } - - $error = 'Function name "%s" is invalid; only PHP magic methods should be prefixed with a double underscore'; - $phpcsFile->addError($error, $stackPtr, 'FunctionDoubleUnderscore', $errorData); - } - - // Ignore first underscore in functions prefixed with "_". - $functionName = ltrim($functionName, '_'); - - if (Common::isCamelCaps($functionName, false, true, $this->strict) === false) { - $error = 'Function name "%s" is not in camel caps format'; - $phpcsFile->addError($error, $stackPtr, 'NotCamelCaps', $errorData); - $phpcsFile->recordMetric($stackPtr, 'CamelCase function name', 'no'); - } else { - $phpcsFile->recordMetric($stackPtr, 'CamelCase method name', 'yes'); - } - - }//end processTokenOutsideScope() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/ConstructorNameSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/ConstructorNameSniff.php deleted file mode 100644 index a419606..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/ConstructorNameSniff.php +++ /dev/null @@ -1,163 +0,0 @@ - - * @author Leif Wickland - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\AbstractScopeSniff; - -class ConstructorNameSniff extends AbstractScopeSniff -{ - - /** - * The name of the class we are currently checking. - * - * @var string - */ - private $currentClass = ''; - - /** - * A list of functions in the current class. - * - * @var string[] - */ - private $functionList = []; - - - /** - * Constructs the test with the tokens it wishes to listen for. - */ - public function __construct() - { - parent::__construct([T_CLASS, T_ANON_CLASS], [T_FUNCTION], true); - - }//end __construct() - - - /** - * Processes this test when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * @param int $currScope A pointer to the start of the scope. - * - * @return void - */ - protected function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScope) - { - $tokens = $phpcsFile->getTokens(); - - // Determine if this is a function which needs to be examined. - $conditions = $tokens[$stackPtr]['conditions']; - end($conditions); - $deepestScope = key($conditions); - if ($deepestScope !== $currScope) { - return; - } - - $className = $phpcsFile->getDeclarationName($currScope); - if (empty($className) === false) { - // Not an anonymous class. - $className = strtolower($className); - } - - if ($className !== $this->currentClass) { - $this->loadFunctionNamesInScope($phpcsFile, $currScope); - $this->currentClass = $className; - } - - $methodName = strtolower($phpcsFile->getDeclarationName($stackPtr)); - - if ($methodName === $className) { - if (in_array('__construct', $this->functionList, true) === false) { - $error = 'PHP4 style constructors are not allowed; use "__construct()" instead'; - $phpcsFile->addError($error, $stackPtr, 'OldStyle'); - } - } else if ($methodName !== '__construct') { - // Not a constructor. - return; - } - - // Stop if the constructor doesn't have a body, like when it is abstract. - if (isset($tokens[$stackPtr]['scope_closer']) === false) { - return; - } - - $parentClassName = strtolower($phpcsFile->findExtendedClassName($currScope)); - if ($parentClassName === false) { - return; - } - - $endFunctionIndex = $tokens[$stackPtr]['scope_closer']; - $startIndex = $stackPtr; - while (($doubleColonIndex = $phpcsFile->findNext(T_DOUBLE_COLON, $startIndex, $endFunctionIndex)) !== false) { - if ($tokens[($doubleColonIndex + 1)]['code'] === T_STRING - && strtolower($tokens[($doubleColonIndex + 1)]['content']) === $parentClassName - ) { - $error = 'PHP4 style calls to parent constructors are not allowed; use "parent::__construct()" instead'; - $phpcsFile->addError($error, ($doubleColonIndex + 1), 'OldStyleCall'); - } - - $startIndex = ($doubleColonIndex + 1); - } - - }//end processTokenWithinScope() - - - /** - * Processes a token that is found within the scope that this test is - * listening to. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position in the stack where this - * token was found. - * - * @return void - */ - protected function processTokenOutsideScope(File $phpcsFile, $stackPtr) - { - - }//end processTokenOutsideScope() - - - /** - * Extracts all the function names found in the given scope. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being scanned. - * @param int $currScope A pointer to the start of the scope. - * - * @return void - */ - protected function loadFunctionNamesInScope(File $phpcsFile, $currScope) - { - $this->functionList = []; - $tokens = $phpcsFile->getTokens(); - - for ($i = ($tokens[$currScope]['scope_opener'] + 1); $i < $tokens[$currScope]['scope_closer']; $i++) { - if ($tokens[$i]['code'] !== T_FUNCTION) { - continue; - } - - $this->functionList[] = trim(strtolower($phpcsFile->getDeclarationName($i))); - - if (isset($tokens[$i]['scope_closer']) !== false) { - // Skip past nested functions and such. - $i = $tokens[$i]['scope_closer']; - } - } - - }//end loadFunctionNamesInScope() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/InterfaceNameSuffixSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/InterfaceNameSuffixSniff.php deleted file mode 100644 index c5dc34d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/InterfaceNameSuffixSniff.php +++ /dev/null @@ -1,54 +0,0 @@ - - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class InterfaceNameSuffixSniff implements Sniff -{ - - - /** - * Registers the tokens that this sniff wants to listen for. - * - * @return int[] - */ - public function register() - { - return [T_INTERFACE]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $interfaceName = $phpcsFile->getDeclarationName($stackPtr); - if ($interfaceName === null) { - return; - } - - $suffix = substr($interfaceName, -9); - if (strtolower($suffix) !== 'interface') { - $phpcsFile->addError('Interface names must be suffixed with "Interface"; found "%s"', $stackPtr, 'Missing', [$interfaceName]); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/TraitNameSuffixSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/TraitNameSuffixSniff.php deleted file mode 100644 index 4e3b211..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/TraitNameSuffixSniff.php +++ /dev/null @@ -1,54 +0,0 @@ - - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class TraitNameSuffixSniff implements Sniff -{ - - - /** - * Registers the tokens that this sniff wants to listen for. - * - * @return int[] - */ - public function register() - { - return [T_TRAIT]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $traitName = $phpcsFile->getDeclarationName($stackPtr); - if ($traitName === null) { - return; - } - - $suffix = substr($traitName, -5); - if (strtolower($suffix) !== 'trait') { - $phpcsFile->addError('Trait names must be suffixed with "Trait"; found "%s"', $stackPtr, 'Missing', [$traitName]); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/UpperCaseConstantNameSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/UpperCaseConstantNameSniff.php deleted file mode 100644 index db50eb5..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/UpperCaseConstantNameSniff.php +++ /dev/null @@ -1,141 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class UpperCaseConstantNameSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_STRING, - T_CONST, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if ($tokens[$stackPtr]['code'] === T_CONST) { - // This is a class constant. - $constant = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($constant === false) { - return; - } - - $constName = $tokens[$constant]['content']; - - if (strtoupper($constName) !== $constName) { - if (strtolower($constName) === $constName) { - $phpcsFile->recordMetric($constant, 'Constant name case', 'lower'); - } else { - $phpcsFile->recordMetric($constant, 'Constant name case', 'mixed'); - } - - $error = 'Class constants must be uppercase; expected %s but found %s'; - $data = [ - strtoupper($constName), - $constName, - ]; - $phpcsFile->addError($error, $constant, 'ClassConstantNotUpperCase', $data); - } else { - $phpcsFile->recordMetric($constant, 'Constant name case', 'upper'); - } - - return; - }//end if - - // Only interested in define statements now. - if (strtolower($tokens[$stackPtr]['content']) !== 'define') { - return; - } - - // Make sure this is not a method call. - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); - if ($tokens[$prev]['code'] === T_OBJECT_OPERATOR - || $tokens[$prev]['code'] === T_DOUBLE_COLON - || $tokens[$prev]['code'] === T_NULLSAFE_OBJECT_OPERATOR - ) { - return; - } - - // If the next non-whitespace token after this token - // is not an opening parenthesis then it is not a function call. - $openBracket = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($openBracket === false) { - return; - } - - // The next non-whitespace token must be the constant name. - $constPtr = $phpcsFile->findNext(T_WHITESPACE, ($openBracket + 1), null, true); - if ($tokens[$constPtr]['code'] !== T_CONSTANT_ENCAPSED_STRING) { - return; - } - - $constName = $tokens[$constPtr]['content']; - - // Check for constants like self::CONSTANT. - $prefix = ''; - $splitPos = strpos($constName, '::'); - if ($splitPos !== false) { - $prefix = substr($constName, 0, ($splitPos + 2)); - $constName = substr($constName, ($splitPos + 2)); - } - - // Strip namespace from constant like /foo/bar/CONSTANT. - $splitPos = strrpos($constName, '\\'); - if ($splitPos !== false) { - $prefix = substr($constName, 0, ($splitPos + 1)); - $constName = substr($constName, ($splitPos + 1)); - } - - if (strtoupper($constName) !== $constName) { - if (strtolower($constName) === $constName) { - $phpcsFile->recordMetric($stackPtr, 'Constant name case', 'lower'); - } else { - $phpcsFile->recordMetric($stackPtr, 'Constant name case', 'mixed'); - } - - $error = 'Constants must be uppercase; expected %s but found %s'; - $data = [ - $prefix.strtoupper($constName), - $prefix.$constName, - ]; - $phpcsFile->addError($error, $stackPtr, 'ConstantNotUpperCase', $data); - } else { - $phpcsFile->recordMetric($stackPtr, 'Constant name case', 'upper'); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/BacktickOperatorSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/BacktickOperatorSniff.php deleted file mode 100644 index d455845..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/BacktickOperatorSniff.php +++ /dev/null @@ -1,48 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\PHP; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class BacktickOperatorSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_BACKTICK]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $error = 'Use of the backtick operator is forbidden'; - $phpcsFile->addError($error, $stackPtr, 'Found'); - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/CharacterBeforePHPOpeningTagSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/CharacterBeforePHPOpeningTagSniff.php deleted file mode 100644 index f52180d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/CharacterBeforePHPOpeningTagSniff.php +++ /dev/null @@ -1,86 +0,0 @@ - - * @copyright 2010-2014 Andy Grunwald - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\PHP; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class CharacterBeforePHPOpeningTagSniff implements Sniff -{ - - /** - * List of supported BOM definitions. - * - * Use encoding names as keys and hex BOM representations as values. - * - * @var array - */ - protected $bomDefinitions = [ - 'UTF-8' => 'efbbbf', - 'UTF-16 (BE)' => 'feff', - 'UTF-16 (LE)' => 'fffe', - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_OPEN_TAG]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return int - */ - public function process(File $phpcsFile, $stackPtr) - { - $expected = 0; - if ($stackPtr > 0) { - // Allow a byte-order mark. - $tokens = $phpcsFile->getTokens(); - foreach ($this->bomDefinitions as $bomName => $expectedBomHex) { - $bomByteLength = (strlen($expectedBomHex) / 2); - $htmlBomHex = bin2hex(substr($tokens[0]['content'], 0, $bomByteLength)); - if ($htmlBomHex === $expectedBomHex) { - $expected++; - break; - } - } - - // Allow a shebang line. - if (substr($tokens[0]['content'], 0, 2) === '#!') { - $expected++; - } - } - - if ($stackPtr !== $expected) { - $error = 'The opening PHP tag must be the first content in the file'; - $phpcsFile->addError($error, $stackPtr, 'Found'); - } - - // Skip the rest of the file so we don't pick up additional - // open tags, typically embedded in HTML. - return $phpcsFile->numTokens; - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/ClosingPHPTagSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/ClosingPHPTagSniff.php deleted file mode 100644 index d03bf8a..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/ClosingPHPTagSniff.php +++ /dev/null @@ -1,54 +0,0 @@ - - * @copyright 2010-2014 Stefano Kowalke - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\PHP; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class ClosingPHPTagSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_OPEN_TAG, - T_OPEN_TAG_WITH_ECHO, - ]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $closeTag = $phpcsFile->findNext(T_CLOSE_TAG, $stackPtr); - if ($closeTag === false) { - $error = 'The PHP open tag does not have a corresponding PHP close tag'; - $phpcsFile->addError($error, $stackPtr, 'NotFound'); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DeprecatedFunctionsSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DeprecatedFunctionsSniff.php deleted file mode 100644 index 42eaa40..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DeprecatedFunctionsSniff.php +++ /dev/null @@ -1,73 +0,0 @@ - - * @author Greg Sherwood - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\PHP; - -class DeprecatedFunctionsSniff extends ForbiddenFunctionsSniff -{ - - /** - * A list of forbidden functions with their alternatives. - * - * The value is NULL if no alternative exists. IE, the - * function should just not be used. - * - * @var array - */ - public $forbiddenFunctions = []; - - - /** - * Constructor. - * - * Uses the Reflection API to get a list of deprecated functions. - */ - public function __construct() - { - $functions = get_defined_functions(); - - foreach ($functions['internal'] as $functionName) { - $function = new \ReflectionFunction($functionName); - - if ($function->isDeprecated() === true) { - $this->forbiddenFunctions[$functionName] = null; - } - } - - }//end __construct() - - - /** - * Generates the error or warning for this sniff. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the forbidden function - * in the token array. - * @param string $function The name of the forbidden function. - * @param string $pattern The pattern used for the match. - * - * @return void - */ - protected function addError($phpcsFile, $stackPtr, $function, $pattern=null) - { - $data = [$function]; - $error = 'Function %s() has been deprecated'; - $type = 'Deprecated'; - - if ($this->error === true) { - $phpcsFile->addError($error, $stackPtr, $type, $data); - } else { - $phpcsFile->addWarning($error, $stackPtr, $type, $data); - } - - }//end addError() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DisallowAlternativePHPTagsSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DisallowAlternativePHPTagsSniff.php deleted file mode 100644 index 433750a..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DisallowAlternativePHPTagsSniff.php +++ /dev/null @@ -1,253 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\PHP; - -use PHP_CodeSniffer\Config; -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class DisallowAlternativePHPTagsSniff implements Sniff -{ - - /** - * Whether ASP tags are enabled or not. - * - * @var boolean - */ - private $aspTags = false; - - /** - * The current PHP version. - * - * @var integer - */ - private $phpVersion = null; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - if ($this->phpVersion === null) { - $this->phpVersion = Config::getConfigData('php_version'); - if ($this->phpVersion === null) { - $this->phpVersion = PHP_VERSION_ID; - } - } - - if ($this->phpVersion < 70000) { - $this->aspTags = (bool) ini_get('asp_tags'); - } - - return [ - T_OPEN_TAG, - T_OPEN_TAG_WITH_ECHO, - T_INLINE_HTML, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $openTag = $tokens[$stackPtr]; - $content = $openTag['content']; - - if (trim($content) === '') { - return; - } - - if ($openTag['code'] === T_OPEN_TAG) { - if ($content === '<%') { - $error = 'ASP style opening tag used; expected "findClosingTag($phpcsFile, $tokens, $stackPtr, '%>'); - $errorCode = 'ASPOpenTagFound'; - } else if (strpos($content, ''); - $errorCode = 'ScriptOpenTagFound'; - } - - if (isset($error, $closer, $errorCode) === true) { - $data = [$content]; - - if ($closer === false) { - $phpcsFile->addError($error, $stackPtr, $errorCode, $data); - } else { - $fix = $phpcsFile->addFixableError($error, $stackPtr, $errorCode, $data); - if ($fix === true) { - $this->addChangeset($phpcsFile, $tokens, $stackPtr, $closer); - } - } - } - - return; - }//end if - - if ($openTag['code'] === T_OPEN_TAG_WITH_ECHO && $content === '<%=') { - $error = 'ASP style opening tag used with echo; expected "findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - $snippet = $this->getSnippet($tokens[$nextVar]['content']); - $data = [ - $snippet, - $content, - $snippet, - ]; - - $closer = $this->findClosingTag($phpcsFile, $tokens, $stackPtr, '%>'); - - if ($closer === false) { - $phpcsFile->addError($error, $stackPtr, 'ASPShortOpenTagFound', $data); - } else { - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'ASPShortOpenTagFound', $data); - if ($fix === true) { - $this->addChangeset($phpcsFile, $tokens, $stackPtr, $closer, true); - } - } - - return; - }//end if - - // Account for incorrect script open tags. - if ($openTag['code'] === T_INLINE_HTML - && preg_match('`( - - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.1.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.1.inc.fixed deleted file mode 100644 index 2a695c8..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.1.inc.fixed +++ /dev/null @@ -1,14 +0,0 @@ -
    - -Some content here. - - - - -
    diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.2.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.2.inc deleted file mode 100644 index cd5a662..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.2.inc +++ /dev/null @@ -1,6 +0,0 @@ -
    -<% echo $var; %> -

    Some text <% echo $var; %> and some more text

    -<%= $var . ' and some more text to make sure the snippet works'; %> -

    Some text <%= $var %> and some more text

    -
    diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.2.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.2.inc.fixed deleted file mode 100644 index 6eafb42..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.2.inc.fixed +++ /dev/null @@ -1,6 +0,0 @@ -
    - -

    Some text and some more text

    - -

    Some text and some more text

    -
    diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.3.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.3.inc deleted file mode 100644 index ba86345..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.3.inc +++ /dev/null @@ -1,7 +0,0 @@ - -
    -<% echo $var; %> -

    Some text <% echo $var; %> and some more text

    -<%= $var . ' and some more text to make sure the snippet works'; %> -

    Some text <%= $var %> and some more text

    -
    diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.php deleted file mode 100644 index 953e8ad..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.php +++ /dev/null @@ -1,105 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class DisallowAlternativePHPTagsUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Get a list of all test files to check. - * - * @param string $testFileBase The base path that the unit tests files will have. - * - * @return string[] - */ - protected function getTestFiles($testFileBase) - { - $testFiles = [$testFileBase.'1.inc']; - - $aspTags = false; - if (PHP_VERSION_ID < 70000) { - $aspTags = (bool) ini_get('asp_tags'); - } - - if ($aspTags === true) { - $testFiles[] = $testFileBase.'2.inc'; - } else { - $testFiles[] = $testFileBase.'3.inc'; - } - - return $testFiles; - - }//end getTestFiles() - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'DisallowAlternativePHPTagsUnitTest.1.inc': - return [ - 4 => 1, - 7 => 1, - 8 => 1, - 11 => 1, - ]; - case 'DisallowAlternativePHPTagsUnitTest.2.inc': - return [ - 2 => 1, - 3 => 1, - 4 => 1, - 5 => 1, - ]; - default: - return []; - }//end switch - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getWarningList($testFile='') - { - if ($testFile === 'DisallowAlternativePHPTagsUnitTest.3.inc') { - return [ - 3 => 1, - 4 => 1, - 5 => 1, - 6 => 1, - ]; - } - - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowRequestSuperglobalUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowRequestSuperglobalUnitTest.inc deleted file mode 100644 index 974e45c..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowRequestSuperglobalUnitTest.inc +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowRequestSuperglobalUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowRequestSuperglobalUnitTest.php deleted file mode 100644 index 7ece551..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowRequestSuperglobalUnitTest.php +++ /dev/null @@ -1,51 +0,0 @@ - - * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ -namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class DisallowRequestSuperglobalUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - protected function getErrorList() - { - return [ - 2 => 1, - 12 => 1, - 13 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - protected function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.1.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.1.inc deleted file mode 100644 index 040e62d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.1.inc +++ /dev/null @@ -1,11 +0,0 @@ -
    - -Some content here. - - -Some content Some more content - - -
    diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.1.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.1.inc.fixed deleted file mode 100644 index 1ea281a..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.1.inc.fixed +++ /dev/null @@ -1,11 +0,0 @@ -
    - -Some content here. - - -Some content Some more content - - -
    diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.2.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.2.inc deleted file mode 100644 index 85617de..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.2.inc +++ /dev/null @@ -1,8 +0,0 @@ -
    - -Some content Some more content - - -
    diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.2.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.2.inc.fixed deleted file mode 100644 index afe5d8f..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.2.inc.fixed +++ /dev/null @@ -1,8 +0,0 @@ -
    - -Some content Some more content - - -
    diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.3.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.3.inc deleted file mode 100644 index 9b7ccd6..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.3.inc +++ /dev/null @@ -1,16 +0,0 @@ -// Test warning for when short_open_tag is off. - -Some content Some more content - -// Test multi-line. -Some content Some more content - -// Make sure skipping works. -Some content Some more content - -// Only recognize closing tag after opener. -Some?> content - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class DisallowShortOpenTagUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Get a list of all test files to check. - * - * @param string $testFileBase The base path that the unit tests files will have. - * - * @return string[] - */ - protected function getTestFiles($testFileBase) - { - $testFiles = [$testFileBase.'1.inc']; - - $option = (bool) ini_get('short_open_tag'); - if ($option === true) { - $testFiles[] = $testFileBase.'2.inc'; - } else { - $testFiles[] = $testFileBase.'3.inc'; - } - - return $testFiles; - - }//end getTestFiles() - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'DisallowShortOpenTagUnitTest.1.inc': - return [ - 5 => 1, - 6 => 1, - 7 => 1, - 10 => 1, - ]; - case 'DisallowShortOpenTagUnitTest.2.inc': - return [ - 2 => 1, - 3 => 1, - 4 => 1, - 7 => 1, - ]; - default: - return []; - }//end switch - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getWarningList($testFile='') - { - switch ($testFile) { - case 'DisallowShortOpenTagUnitTest.1.inc': - return []; - case 'DisallowShortOpenTagUnitTest.3.inc': - return [ - 3 => 1, - 6 => 1, - 11 => 1, - ]; - default: - return []; - }//end switch - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DiscourageGotoUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DiscourageGotoUnitTest.inc deleted file mode 100644 index f564215..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DiscourageGotoUnitTest.inc +++ /dev/null @@ -1,18 +0,0 @@ - - * @copyright 2006-2017 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class DiscourageGotoUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return []; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return [ - 3 => 1, - 6 => 1, - 11 => 1, - 16 => 1, - ]; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/ForbiddenFunctionsUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/ForbiddenFunctionsUnitTest.inc deleted file mode 100644 index b30f0dd..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/ForbiddenFunctionsUnitTest.inc +++ /dev/null @@ -1,57 +0,0 @@ -sizeof($array); -$size = $class->count($array); -$class->delete($filepath); -$class->unset($filepath); - -function delete() {} -function unset() {} -function sizeof() {} -function count() {} - -trait DelProvider { - public function delete() { - //irrelevant - } -} - -class LeftSideTest { - use DelProvider { - delete as protected unsetter; - } -} - -class RightSideTest { - use DelProvider { - delete as delete; - } -} - -class RightSideVisTest { - use DelProvider { - delete as protected delete; - DelProvider::delete insteadof delete; - } -} - -namespace Something\sizeof; -$var = new Sizeof(); -class SizeOf implements Something {} - -function mymodule_form_callback(SizeOf $sizeof) { -} - -$size = $class?->sizeof($array); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/ForbiddenFunctionsUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/ForbiddenFunctionsUnitTest.php deleted file mode 100644 index 760e807..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/ForbiddenFunctionsUnitTest.php +++ /dev/null @@ -1,54 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ForbiddenFunctionsUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - $errors = [ - 2 => 1, - 4 => 1, - 6 => 1, - ]; - - return $errors; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.inc deleted file mode 100644 index 63aea51..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.inc +++ /dev/null @@ -1,83 +0,0 @@ -NULL = 7; - -use Zend\Log\Writer\NULL as NullWriter; -new \Zend\Log\Writer\NULL(); - -namespace False; - -class True extends Null implements False {} - -use True\Something; -use Something\True; -class MyClass -{ - public function myFunction() - { - $var = array('foo' => new True()); - } -} - -$x = $f?FALSE:true; -$x = $f? FALSE:true; - -class MyClass -{ - // Spice things up a little. - const TRUE = false; -} - -var_dump(MyClass::TRUE); - -function tRUE() {} - -$input->getFilterChain()->attachByName('Null', ['type' => Null::TYPE_STRING]); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.inc.fixed deleted file mode 100644 index b3c3d8a..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.inc.fixed +++ /dev/null @@ -1,83 +0,0 @@ -NULL = 7; - -use Zend\Log\Writer\NULL as NullWriter; -new \Zend\Log\Writer\NULL(); - -namespace False; - -class True extends Null implements False {} - -use True\Something; -use Something\True; -class MyClass -{ - public function myFunction() - { - $var = array('foo' => new True()); - } -} - -$x = $f?false:true; -$x = $f? false:true; - -class MyClass -{ - // Spice things up a little. - const TRUE = false; -} - -var_dump(MyClass::TRUE); - -function tRUE() {} - -$input->getFilterChain()->attachByName('Null', ['type' => Null::TYPE_STRING]); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.js b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.js deleted file mode 100644 index 87cfb82..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.js +++ /dev/null @@ -1,14 +0,0 @@ -if (variable === true) { } -if (variable === TRUE) { } -if (variable === True) { } -variable = True; - -if (variable === false) { } -if (variable === FALSE) { } -if (variable === False) { } -variable = false; - -if (variable === null) { } -if (variable === NULL) { } -if (variable === Null) { } -variable = NULL; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.js.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.js.fixed deleted file mode 100644 index 7dbf3ad..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.js.fixed +++ /dev/null @@ -1,14 +0,0 @@ -if (variable === true) { } -if (variable === true) { } -if (variable === true) { } -variable = true; - -if (variable === false) { } -if (variable === false) { } -if (variable === false) { } -variable = false; - -if (variable === null) { } -if (variable === null) { } -if (variable === null) { } -variable = null; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.php deleted file mode 100644 index 85e8f70..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.php +++ /dev/null @@ -1,84 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class LowerCaseConstantUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='LowerCaseConstantUnitTest.inc') - { - switch ($testFile) { - case 'LowerCaseConstantUnitTest.inc': - return [ - 7 => 1, - 10 => 1, - 15 => 1, - 16 => 1, - 23 => 1, - 26 => 1, - 31 => 1, - 32 => 1, - 39 => 1, - 42 => 1, - 47 => 1, - 48 => 1, - 70 => 1, - 71 => 1, - ]; - break; - case 'LowerCaseConstantUnitTest.js': - return [ - 2 => 1, - 3 => 1, - 4 => 1, - 7 => 1, - 8 => 1, - 12 => 1, - 13 => 1, - 14 => 1, - ]; - break; - default: - return []; - break; - }//end switch - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.inc deleted file mode 100644 index 8d003c3..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.inc +++ /dev/null @@ -1,39 +0,0 @@ - $x; -$r = Match ($x) { - 1 => 1, - 2 => 2, - DEFAULT, => 3, -}; - -__HALT_COMPILER(); // An exception due to phar support. -function diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.inc.fixed deleted file mode 100644 index bbe76b9..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.inc.fixed +++ /dev/null @@ -1,39 +0,0 @@ - $x; -$r = match ($x) { - 1 => 1, - 2 => 2, - default, => 3, -}; - -__HALT_COMPILER(); // An exception due to phar support. -function diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.php deleted file mode 100644 index b272196..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.php +++ /dev/null @@ -1,63 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class LowerCaseKeywordUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 10 => 3, - 11 => 4, - 12 => 1, - 13 => 3, - 14 => 7, - 15 => 1, - 19 => 1, - 20 => 1, - 21 => 1, - 25 => 1, - 28 => 1, - 31 => 1, - 32 => 1, - 35 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc deleted file mode 100644 index 8e2dca1..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc +++ /dev/null @@ -1,83 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class LowerCaseTypeUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 14 => 1, - 15 => 1, - 16 => 1, - 17 => 1, - 18 => 1, - 21 => 4, - 22 => 3, - 23 => 3, - 25 => 1, - 26 => 2, - 27 => 2, - 32 => 4, - 36 => 1, - 37 => 1, - 38 => 1, - 39 => 1, - 43 => 2, - 44 => 1, - 46 => 1, - 49 => 1, - 51 => 2, - 53 => 1, - 55 => 2, - 60 => 1, - 61 => 1, - 62 => 1, - 63 => 1, - 64 => 1, - 65 => 1, - 66 => 1, - 67 => 1, - 68 => 1, - 69 => 1, - 71 => 3, - 72 => 2, - 73 => 3, - 74 => 3, - 78 => 3, - 82 => 2, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/NoSilencedErrorsUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/NoSilencedErrorsUnitTest.inc deleted file mode 100644 index 72bffe2..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/NoSilencedErrorsUnitTest.inc +++ /dev/null @@ -1,10 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class NoSilencedErrorsUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return []; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return [ - 5 => 1, - 10 => 1, - ]; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.1.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.1.inc deleted file mode 100644 index 387cec2..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.1.inc +++ /dev/null @@ -1,8 +0,0 @@ - - * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class RequireStrictTypesUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'RequireStrictTypesUnitTest.1.inc': - return []; - break; - } - - return [1 => 1]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SAPIUsageUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SAPIUsageUnitTest.inc deleted file mode 100644 index f0f350f..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SAPIUsageUnitTest.inc +++ /dev/null @@ -1,5 +0,0 @@ -php_sapi_name() === true) {} -if ($object?->php_sapi_name() === true) {} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SAPIUsageUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SAPIUsageUnitTest.php deleted file mode 100644 index 08c0ccd..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SAPIUsageUnitTest.php +++ /dev/null @@ -1,48 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class SAPIUsageUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [2 => 1]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SyntaxUnitTest.1.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SyntaxUnitTest.1.inc deleted file mode 100644 index 4f0d9d8..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SyntaxUnitTest.1.inc +++ /dev/null @@ -1,4 +0,0 @@ - -
    text
    - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SyntaxUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SyntaxUnitTest.php deleted file mode 100644 index 98d205c..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SyntaxUnitTest.php +++ /dev/null @@ -1,59 +0,0 @@ - - * @author Blaine Schmeisser - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class SyntaxUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'SyntaxUnitTest.1.inc': - case 'SyntaxUnitTest.2.inc': - return [3 => 1]; - break; - default: - return []; - break; - } - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc deleted file mode 100644 index 965bf3b..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc +++ /dev/null @@ -1,81 +0,0 @@ -null = 7; - -use Zend\Log\Writer\Null as NullWriter; -new \Zend\Log\Writer\Null(); - -namespace False; - -class True extends Null implements False {} - -use True\Something; -use Something\True; -class MyClass -{ - public function myFunction() - { - $var = array('foo' => new True()); - } -} - -$x = $f?false:TRUE; -$x = $f? false:TRUE; - -class MyClass -{ - // Spice things up a little. - const true = FALSE; -} - -var_dump(MyClass::true); - -function true() {} \ No newline at end of file diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc.fixed deleted file mode 100644 index ae83dc9..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc.fixed +++ /dev/null @@ -1,81 +0,0 @@ -null = 7; - -use Zend\Log\Writer\Null as NullWriter; -new \Zend\Log\Writer\Null(); - -namespace False; - -class True extends Null implements False {} - -use True\Something; -use Something\True; -class MyClass -{ - public function myFunction() - { - $var = array('foo' => new True()); - } -} - -$x = $f?FALSE:TRUE; -$x = $f? FALSE:TRUE; - -class MyClass -{ - // Spice things up a little. - const true = FALSE; -} - -var_dump(MyClass::true); - -function true() {} \ No newline at end of file diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.php deleted file mode 100644 index 0bdafe6..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.php +++ /dev/null @@ -1,63 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class UpperCaseConstantUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 7 => 1, - 10 => 1, - 15 => 1, - 16 => 1, - 23 => 1, - 26 => 1, - 31 => 1, - 32 => 1, - 39 => 1, - 42 => 1, - 47 => 1, - 48 => 1, - 70 => 1, - 71 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Strings/UnnecessaryStringConcatUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Strings/UnnecessaryStringConcatUnitTest.inc deleted file mode 100644 index 43c05a1..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Strings/UnnecessaryStringConcatUnitTest.inc +++ /dev/null @@ -1,21 +0,0 @@ -'; -$code = '<'.'?php '; - -$string = 'This is a really long string. ' - . 'It is being used for errors. ' - . 'The message is not translated.'; -?> diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Strings/UnnecessaryStringConcatUnitTest.js b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Strings/UnnecessaryStringConcatUnitTest.js deleted file mode 100644 index 6be7900..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Strings/UnnecessaryStringConcatUnitTest.js +++ /dev/null @@ -1,15 +0,0 @@ -var x = 'My ' + 'string'; -var x = 'My ' + 1234; -var x = 'My ' + y + ' test'; - -this.errors['test'] = x; -this.errors['test' + 10] = x; -this.errors['test' + y] = x; -this.errors['test' + 'blah'] = x; -this.errors[y] = x; -this.errors[y + z] = x; -this.errors[y + z + 'My' + 'String'] = x; - -var long = 'This is a really long string. ' - + 'It is being used for errors. ' - + 'The message is not translated.'; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Strings/UnnecessaryStringConcatUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Strings/UnnecessaryStringConcatUnitTest.php deleted file mode 100644 index 6a92848..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Strings/UnnecessaryStringConcatUnitTest.php +++ /dev/null @@ -1,73 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Tests\Strings; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class UnnecessaryStringConcatUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='UnnecessaryStringConcatUnitTest.inc') - { - switch ($testFile) { - case 'UnnecessaryStringConcatUnitTest.inc': - return [ - 2 => 1, - 6 => 1, - 9 => 1, - 12 => 1, - 19 => 1, - 20 => 1, - ]; - break; - case 'UnnecessaryStringConcatUnitTest.js': - return [ - 1 => 1, - 8 => 1, - 11 => 1, - 14 => 1, - 15 => 1, - ]; - break; - default: - return []; - break; - }//end switch - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.1.css b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.1.css deleted file mode 100644 index de84a94..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.1.css +++ /dev/null @@ -1,35 +0,0 @@ -/* - * This is a CSS comment. -<<<<<<< HEAD - * This is a merge conflict... -======= - * which should be detected. ->>>>>>> ref/heads/feature-branch - */ - -.SettingsTabPaneWidgetType-tab-mid { - background: transparent url(tab_inact_mid.png) repeat-x; -<<<<<<< HEAD - line-height: -25px; -======= - line-height: -20px; ->>>>>>> ref/heads/feature-branch - cursor: pointer; - -moz-user-select: none; -} - -/* - * The above tests are based on "normal" tokens. - * The below test checks that once the tokenizer breaks down because of - * unexpected merge conflict boundaries, subsequent boundaries will still - * be detected correctly. - */ - -/* - * This is a CSS comment. -<<<<<<< HEAD - * This is a merge conflict... -======= - * which should be detected. ->>>>>>> ref/heads/feature-branch - */ diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.1.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.1.inc deleted file mode 100644 index 470c3b8..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.1.inc +++ /dev/null @@ -1,61 +0,0 @@ -> -1); -var_dump( -1 -<< --1 -); - -$string = -<< 'a' -<<<<<<< HEAD - 'b' => 'b' -======= - 'c' => 'c' ->>>>>>> master - ); - } - -/* - * The above tests are based on "normal" tokens. - * The below test checks that once the tokenizer breaks down because of - * unexpected merge conflict boundaries - i.e. after the first merge conflict - * opener in non-comment, non-heredoc/nowdoc, non-inline HTML code -, subsequent - * merge conflict boundaries will still be detected correctly. - */ - -/* - * Testing detecting subsequent merge conflicts. - * -<<<<<<< HEAD - * @var string $bar - */ -public function foo($bar){ } - -/** -============ -The above is not the boundary, the below is. -======= - * @var string $bar ->>>>>>> f19f8a5... Commit message -*/ - -// Test that stray boundaries, i.e. an opener without closer and such, are detected. -<<<<<<< HEAD -$a = 1; -======= diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.2.css b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.2.css deleted file mode 100644 index 6caa78d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.2.css +++ /dev/null @@ -1,32 +0,0 @@ -/* - * This is a CSS comment. -<<<<<<< HEAD - * This is a merge conflict started in a comment, ending in a CSS block. - */ -.SettingsTabPaneWidgetType-tab-mid { - background: transparent url(tab_inact_mid.png) repeat-x; -======= - * which should be detected. - **/ -.SettingsTabPaneWidgetType-tab-start { - line-height: -25px; ->>>>>>> ref/heads/feature-branch - cursor: pointer; - -moz-user-select: none; -} - -/* - * The above tests are based on "normal" tokens. - * The below test checks that once the tokenizer breaks down because of - * unexpected merge conflict boundaries, subsequent boundaries will still - * be detected correctly. - */ - -/* - * This is a CSS comment. -<<<<<<< HEAD - * This is a merge conflict... -======= - * which should be detected. ->>>>>>> ref/heads/feature-branch - */ diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.2.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.2.inc deleted file mode 100644 index 809b17d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.2.inc +++ /dev/null @@ -1,31 +0,0 @@ ->>>>>> master - */ - -/* - * Testing detecting merge conflicts using different comment styles. - * -<<<<<<< HEAD - * @var string $bar - */ -public function foo($bar){ } - -/* -======= - * @var string $bar ->>>>>>> master -*/ - -// Comment -<<<<<<< HEAD -// Second comment line. NOTE: The above opener breaks the tokenizer. -======= -// New second comment line ->>>>>>> master -// Third comment line diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.3.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.3.inc deleted file mode 100644 index ce70941..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.3.inc +++ /dev/null @@ -1,43 +0,0 @@ - -
    -<<<<<<< HEAD -

    Testing a merge conflict.

    -======= -

    Another text string.

    ->>>>>>> ref/heads/feature-branch -
    - - -
    -<<<<<<< HEAD -

    -======= -

    ->>>>>>> ref/heads/feature-branch -
    - ->>>>>> master - -/* - * The above tests are based on "normal" tokens. - * The below test checks that once the tokenizer breaks down because of - * unexpected merge conflict boundaries - i.e. after the first merge conflict - * opener in non-comment, non-heredoc/nowdoc, non-inline HTML code -, subsequent - * merge conflict boundaries will still be detected correctly. - */ -?> - -
    -<<<<<<< HEAD -

    Testing a merge conflict.

    -======= -

    Another text string.

    ->>>>>>> ref/heads/feature-branch -
    diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.4.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.4.inc deleted file mode 100644 index 99c0b99..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.4.inc +++ /dev/null @@ -1,71 +0,0 @@ ->>>>>> ref/heads/other-branchname -And now they are. -EOD; - -// Heredoc with a merge conflict starter, the closer is outside the heredoc. -$string = -<<>>>>>> ref/heads/other-branchname - -// Merge conflict starter outside with a closer inside of the heredoc. -// This breaks the tokenizer. -<<<<<<< HEAD -$string = -<<>>>>>> ref/heads/other-branchname -EOD; - -/* - * The above tests are based on "normal" tokens. - * The below test checks that once the tokenizer breaks down because of - * unexpected merge conflict boundaries - i.e. after the first merge conflict - * opener in non-comment, non-heredoc/nowdoc, non-inline HTML code -, subsequent - * merge conflict boundaries will still be detected correctly. - */ - -$string = -<<>>>>>> ref/heads/other-branchname -And now they are. -EOD; - -$string = -<<>>>>>> ref/heads/other-branchname diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.5.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.5.inc deleted file mode 100644 index 7d55f6d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.5.inc +++ /dev/null @@ -1,34 +0,0 @@ ->>>>>> ref/heads/other-branchname -And now they are. -EOD; - -// Break the tokenizer. -<<<<<<< HEAD - -/* - * The above tests are based on "normal" tokens. - * The below test checks that once the tokenizer breaks down because of - * unexpected merge conflict boundaries - i.e. after the first merge conflict - * opener in non-comment, non-heredoc/nowdoc, non-inline HTML code -, subsequent - * merge conflict boundaries will still be detected correctly. - */ - -$string = -<<<'EOD' -can be problematic. -<<<<<<< HEAD -were previously not detected. -======= -should also be detected. ->>>>>>> ref/heads/other-branchname -And now they are. -EOD; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.6.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.6.inc deleted file mode 100644 index aaea324..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.6.inc +++ /dev/null @@ -1,34 +0,0 @@ ->>>>>> ref/heads/other-branchname - And now they are. - EOD; - -// Break the tokenizer. ->>>>>>> master - -/* - * The above tests are based on "normal" tokens. - * The below test checks that once the tokenizer breaks down because of - * unexpected merge conflict boundaries - i.e. after the first merge conflict - * opener in non-comment, non-heredoc/nowdoc, non-inline HTML code -, subsequent - * merge conflict boundaries will still be detected correctly. - */ - -$string = - <<<"EOD" - Merge conflicts in PHP 7.3 indented heredocs -<<<<<<< HEAD - can be problematic. -======= - should also be detected. ->>>>>>> ref/heads/other-branchname - And now they are. - EOD; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.7.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.7.inc deleted file mode 100644 index 85cae1f..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.7.inc +++ /dev/null @@ -1,19 +0,0 @@ - -
    -<<<<<<< HEAD -

    Testing a merge conflict.

    -======= -

    Another text string.

    ->>>>>>> ref/heads/feature-branch -
    - - -
    -<<<<<<< HEAD -

    -======= -

    ->>>>>>> ref/heads/feature-branch -
    - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.js b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.js deleted file mode 100644 index cd7bc76..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.js +++ /dev/null @@ -1,33 +0,0 @@ - -result = x?y:z; -result = x ? y : z; - -<<<<<<< HEAD -if (something === true -======= -if (something === false ->>>>>>> develop - ^ somethingElse === true -) { -<<<<<<< HEAD - return true; -======= - return false; ->>>>>>> develop -} - -y = 1 - + 2 - - 3; - -/* -<<<<<<< HEAD - * @var string $bar - */ -if (something === true - -/** -======= - * @var string $foo ->>>>>>> master - */ diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.php deleted file mode 100644 index 50986f4..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.php +++ /dev/null @@ -1,170 +0,0 @@ - - * @copyright 2017 Juliette Reinders Folmer. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Tests\VersionControl; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class GitMergeConflictUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='GitMergeConflictUnitTest.1.inc') - { - switch ($testFile) { - case 'GitMergeConflictUnitTest.1.inc': - return [ - 26 => 1, - 28 => 1, - 30 => 1, - 45 => 1, - 53 => 1, - 55 => 1, - 59 => 1, - 61 => 1, - ]; - - case 'GitMergeConflictUnitTest.2.inc': - return [ - 4 => 1, - 6 => 1, - 8 => 1, - 14 => 1, - 20 => 1, - 22 => 1, - 26 => 1, - 28 => 1, - 30 => 1, - ]; - - case 'GitMergeConflictUnitTest.3.inc': - return [ - 3 => 1, - 5 => 1, - 7 => 1, - 12 => 1, - 14 => 1, - 16 => 1, - 22 => 1, - 24 => 1, - 26 => 1, - 38 => 1, - 40 => 1, - 42 => 1, - ]; - - case 'GitMergeConflictUnitTest.4.inc': - return [ - 6 => 1, - 8 => 1, - 10 => 1, - 18 => 1, - 22 => 1, - 25 => 1, - 29 => 1, - 34 => 1, - 39 => 1, - 53 => 1, - 55 => 1, - 57 => 1, - 64 => 1, - 68 => 1, - 71 => 1, - ]; - case 'GitMergeConflictUnitTest.5.inc': - case 'GitMergeConflictUnitTest.6.inc': - return [ - 6 => 1, - 8 => 1, - 10 => 1, - 15 => 1, - 28 => 1, - 30 => 1, - 32 => 1, - ]; - - case 'GitMergeConflictUnitTest.7.inc': - return [ - 3 => 1, - 5 => 1, - 7 => 1, - 12 => 1, - 14 => 1, - 16 => 1, - ]; - - case 'GitMergeConflictUnitTest.1.css': - return [ - 3 => 1, - 5 => 1, - 7 => 1, - 12 => 1, - 14 => 1, - 16 => 1, - 30 => 1, - 32 => 1, - 34 => 1, - ]; - - case 'GitMergeConflictUnitTest.2.css': - return [ - 3 => 1, - 8 => 1, - 13 => 1, - 27 => 1, - 29 => 1, - 31 => 1, - ]; - - case 'GitMergeConflictUnitTest.js': - return [ - 5 => 1, - 7 => 1, - 9 => 1, - 12 => 1, - 14 => 1, - 16 => 1, - 24 => 1, - 30 => 1, - 32 => 1, - ]; - - default: - return []; - }//end switch - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/SubversionPropertiesUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/SubversionPropertiesUnitTest.inc deleted file mode 100644 index e4110de..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/SubversionPropertiesUnitTest.inc +++ /dev/null @@ -1,3 +0,0 @@ - - * @copyright 2019 Juliette Reinders Folmer. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Tests\VersionControl; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class SubversionPropertiesUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Should this test be skipped for some reason. - * - * @return void - */ - protected function shouldSkipTest() - { - // This sniff cannot be tested as no SVN version control directory is available. - return true; - - }//end shouldSkipTest() - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return []; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.inc deleted file mode 100644 index bad3998..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.inc +++ /dev/null @@ -1,165 +0,0 @@ -{$var}( $foo,$bar ); - -$bar(function( $a, $b ) { - return function( $c, $d ) use ( $a, $b ) { - echo $a, $b, $c, $d; - }; -})( 'a','b' )( 'c','d' ); - -$closure( $foo,$bar ); -$var = $closure() + $closure( $foo,$bar ) + self::$closure( $foo,$bar ); - -class Test { - public static function baz( $foo, $bar ) { - $a = new self( $foo,$bar ); - $b = new static( $foo,$bar ); - } -} - -/* - * Test warning for empty parentheses. - */ -$a = 4 + (); // Warning. -$a = 4 + ( ); // Warning. -$a = 4 + (/* Not empty */); - -/* - * Test the actual sniff. - */ -if ((null !== $extra) && ($row->extra !== $extra)) {} - -if (( null !== $extra ) && ( $row->extra !== $extra )) {} // Bad x 4. - -if (( null !== $extra // Bad x 1. - && is_int($extra)) - && ( $row->extra !== $extra // Bad x 1. - || $something ) // Bad x 1. -) {} - -if (( null !== $extra ) // Bad x 2. - && ( $row->extra !== $extra ) // Bad x 2. -) {} - -$a = (null !== $extra); -$a = ( null !== $extra ); // Bad x 2. - -$sx = $vert ? ($w - 1) : 0; - -$this->is_overloaded = ( ( ini_get("mbstring.func_overload") & 2 ) != 0 ) && function_exists('mb_substr'); // Bad x 4. - -$image->flip( ($operation->axis & 1) != 0, ($operation->axis & 2) != 0 ); - -if ( $success && ('nothumb' == $target || 'all' == $target) ) {} - -$directory = ('/' == $file[ strlen($file)-1 ]); - -// phpcs:set Generic.WhiteSpace.ArbitraryParenthesesSpacing spacing 1 -if ((null !== $extra) && ($row->extra !== $extra)) {} // Bad x 4. - -if (( null !== $extra ) && ( $row->extra !== $extra )) {} - -if (( null !== $extra // Bad x 1. - && is_int($extra)) // Bad x 1. - && ( $row->extra !== $extra - || $something ) // Bad x 1. -) {} - -if ((null !== $extra) // Bad x 2. - && ($row->extra !== $extra) // Bad x 2. -) {} - -$a = (null !== $extra); // Bad x 2. -$a = ( null !== $extra ); - -$sx = $vert ? ($w - 1) : 0; // Bad x 2. - -$this->is_overloaded = ((ini_get("mbstring.func_overload") & 2) != 0) && function_exists('mb_substr'); // Bad x 4. - -$image->flip( ($operation->axis & 1) != 0, ($operation->axis & 2) != 0 ); // Bad x 4. - -if ( $success && ('nothumb' == $target || 'all' == $target) ) {} // Bad x 2. - -$directory = ('/' == $file[ strlen($file)-1 ]); // Bad x 2. - -// phpcs:set Generic.WhiteSpace.ArbitraryParenthesesSpacing spacing 0 - -/* - * Test handling of ignoreNewlines. - */ -if ( - ( - null !== $extra - ) && ( - $row->extra !== $extra - ) -) {} // Bad x 4, 1 x line 123, 2 x line 125, 1 x line 127. - - -$a = ( - null !== $extra -); // Bad x 2, 1 x line 131, 1 x line 133. - -// phpcs:set Generic.WhiteSpace.ArbitraryParenthesesSpacing spacing 1 -if ( - ( - null !== $extra - ) && ( - $row->extra !== $extra - ) -) {} // Bad x 4, 1 x line 137, 2 x line 139, 1 x line 141. - -$a = ( - null !== $extra -); // Bad x 2, 1 x line 144, 1 x line 146. -// phpcs:set Generic.WhiteSpace.ArbitraryParenthesesSpacing spacing 0 - -// phpcs:set Generic.WhiteSpace.ArbitraryParenthesesSpacing ignoreNewlines true -if ( - ( - null !== $extra - ) && ( - $row->extra !== $extra - ) -) {} - -$a = ( - null !== $extra -); -// phpcs:set Generic.WhiteSpace.ArbitraryParenthesesSpacing ignoreNewlines false - -if (true) {} ( 1+2) === 3 ? $a = 1 : $a = 2; -class A {} ( 1+2) === 3 ? $a = 1 : $a = 2; -function foo() {} ( 1+2) === 3 ? $a = 1 : $a = 2; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.inc.fixed deleted file mode 100644 index 08fcd62..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.inc.fixed +++ /dev/null @@ -1,153 +0,0 @@ -{$var}( $foo,$bar ); - -$bar(function( $a, $b ) { - return function( $c, $d ) use ( $a, $b ) { - echo $a, $b, $c, $d; - }; -})( 'a','b' )( 'c','d' ); - -$closure( $foo,$bar ); -$var = $closure() + $closure( $foo,$bar ) + self::$closure( $foo,$bar ); - -class Test { - public static function baz( $foo, $bar ) { - $a = new self( $foo,$bar ); - $b = new static( $foo,$bar ); - } -} - -/* - * Test warning for empty parentheses. - */ -$a = 4 + (); // Warning. -$a = 4 + ( ); // Warning. -$a = 4 + (/* Not empty */); - -/* - * Test the actual sniff. - */ -if ((null !== $extra) && ($row->extra !== $extra)) {} - -if ((null !== $extra) && ($row->extra !== $extra)) {} // Bad x 4. - -if ((null !== $extra // Bad x 1. - && is_int($extra)) - && ($row->extra !== $extra // Bad x 1. - || $something) // Bad x 1. -) {} - -if ((null !== $extra) // Bad x 2. - && ($row->extra !== $extra) // Bad x 2. -) {} - -$a = (null !== $extra); -$a = (null !== $extra); // Bad x 2. - -$sx = $vert ? ($w - 1) : 0; - -$this->is_overloaded = ((ini_get("mbstring.func_overload") & 2) != 0) && function_exists('mb_substr'); // Bad x 4. - -$image->flip( ($operation->axis & 1) != 0, ($operation->axis & 2) != 0 ); - -if ( $success && ('nothumb' == $target || 'all' == $target) ) {} - -$directory = ('/' == $file[ strlen($file)-1 ]); - -// phpcs:set Generic.WhiteSpace.ArbitraryParenthesesSpacing spacing 1 -if (( null !== $extra ) && ( $row->extra !== $extra )) {} // Bad x 4. - -if (( null !== $extra ) && ( $row->extra !== $extra )) {} - -if (( null !== $extra // Bad x 1. - && is_int($extra) ) // Bad x 1. - && ( $row->extra !== $extra - || $something ) // Bad x 1. -) {} - -if (( null !== $extra ) // Bad x 2. - && ( $row->extra !== $extra ) // Bad x 2. -) {} - -$a = ( null !== $extra ); // Bad x 2. -$a = ( null !== $extra ); - -$sx = $vert ? ( $w - 1 ) : 0; // Bad x 2. - -$this->is_overloaded = ( ( ini_get("mbstring.func_overload") & 2 ) != 0 ) && function_exists('mb_substr'); // Bad x 4. - -$image->flip( ( $operation->axis & 1 ) != 0, ( $operation->axis & 2 ) != 0 ); // Bad x 4. - -if ( $success && ( 'nothumb' == $target || 'all' == $target ) ) {} // Bad x 2. - -$directory = ( '/' == $file[ strlen($file)-1 ] ); // Bad x 2. - -// phpcs:set Generic.WhiteSpace.ArbitraryParenthesesSpacing spacing 0 - -/* - * Test handling of ignoreNewlines. - */ -if ( - (null !== $extra) && ($row->extra !== $extra) -) {} // Bad x 4, 1 x line 123, 2 x line 125, 1 x line 127. - - -$a = (null !== $extra); // Bad x 2, 1 x line 131, 1 x line 133. - -// phpcs:set Generic.WhiteSpace.ArbitraryParenthesesSpacing spacing 1 -if ( - ( null !== $extra ) && ( $row->extra !== $extra ) -) {} // Bad x 4, 1 x line 137, 2 x line 139, 1 x line 141. - -$a = ( null !== $extra ); // Bad x 2, 1 x line 144, 1 x line 146. -// phpcs:set Generic.WhiteSpace.ArbitraryParenthesesSpacing spacing 0 - -// phpcs:set Generic.WhiteSpace.ArbitraryParenthesesSpacing ignoreNewlines true -if ( - ( - null !== $extra - ) && ( - $row->extra !== $extra - ) -) {} - -$a = ( - null !== $extra -); -// phpcs:set Generic.WhiteSpace.ArbitraryParenthesesSpacing ignoreNewlines false - -if (true) {} (1+2) === 3 ? $a = 1 : $a = 2; -class A {} (1+2) === 3 ? $a = 1 : $a = 2; -function foo() {} (1+2) === 3 ? $a = 1 : $a = 2; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.php deleted file mode 100644 index 0f70e28..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.php +++ /dev/null @@ -1,85 +0,0 @@ - - * @copyright 2006-2017 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ArbitraryParenthesesSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 64 => 4, - 66 => 1, - 68 => 1, - 69 => 1, - 72 => 2, - 73 => 2, - 77 => 2, - 81 => 4, - 90 => 4, - 94 => 1, - 95 => 1, - 97 => 1, - 100 => 2, - 101 => 2, - 104 => 2, - 107 => 2, - 109 => 4, - 111 => 4, - 113 => 2, - 115 => 2, - 123 => 1, - 125 => 2, - 127 => 1, - 131 => 1, - 133 => 1, - 137 => 1, - 139 => 2, - 141 => 1, - 144 => 1, - 146 => 1, - 163 => 1, - 164 => 1, - 165 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return [ - 55 => 1, - 56 => 1, - ]; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.1.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.1.inc deleted file mode 100644 index 1826b58..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.1.inc +++ /dev/null @@ -1,118 +0,0 @@ -"; - return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>"; -// [space][space][space][tab]return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>"; - return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>"; -// Doc comments are indent with tabs and one space -//[tab]/** -//[tab][space]* - /** - * CVS revision for HTTP headers. - * - * @var string - * @access private - */ - /** - * - */ - -$str = 'hello - there'; - -/** - * This PHP DocBlock should be fine, even though there is a single space at the beginning. - * - * @var int $x - */ -$x = 1; - -?> - - - Foo - - -
    -
    -
    -
    -
    -
    - - - -"; - return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>"; -// [space][space][space][tab]return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>"; - return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>"; -// Doc comments are indent with tabs and one space -//[tab]/** -//[tab][space]* - /** - * CVS revision for HTTP headers. - * - * @var string - * @access private - */ - /** - * - */ - -$str = 'hello - there'; - -/** - * This PHP DocBlock should be fine, even though there is a single space at the beginning. - * - * @var int $x - */ -$x = 1; - -?> - - - Foo - - -
    -
    -
    -
    -
    -
    - - - -"; - return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>"; -// [space][space][space][tab]return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>"; - return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>"; -// Doc comments are indent with tabs and one space -//[tab]/** -//[tab][space]* - /** - * CVS revision for HTTP headers. - * - * @var string - * @access private - */ - /** - * - */ - -$str = 'hello - there'; - -/** - * This PHP DocBlock should be fine, even though there is a single space at the beginning. - * - * @var int $x - */ -$x = 1; - -?> - - - Foo - - -
    -
    -
    -
    -
    -
    - - - -"; - return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>"; -// [space][space][space][tab]return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>"; - return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>"; -// Doc comments are indent with tabs and one space -//[tab]/** -//[tab][space]* - /** - * CVS revision for HTTP headers. - * - * @var string - * @access private - */ - /** - * - */ - -$str = 'hello - there'; - -/** - * This PHP DocBlock should be fine, even though there is a single space at the beginning. - * - * @var int $x - */ -$x = 1; - -?> - - - Foo - - -
    -
    -
    -
    -
    -
    - - - - - - - Foo - - -
    -
    -
    -
    -
    -
    - - - - - - - Foo - - -
    -
    -
    -
    -
    -
    - - - - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class DisallowSpaceIndentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Get a list of CLI values to set before the file is tested. - * - * @param string $testFile The name of the file being tested. - * @param \PHP_CodeSniffer\Config $config The config data for the test run. - * - * @return void - */ - public function setCliValues($testFile, $config) - { - if ($testFile === 'DisallowSpaceIndentUnitTest.2.inc') { - return; - } - - $config->tabWidth = 4; - - }//end setCliValues() - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='DisallowSpaceIndentUnitTest.1.inc') - { - switch ($testFile) { - case 'DisallowSpaceIndentUnitTest.1.inc': - case 'DisallowSpaceIndentUnitTest.2.inc': - return [ - 5 => 1, - 9 => 1, - 15 => 1, - 22 => 1, - 24 => 1, - 30 => 1, - 35 => 1, - 50 => 1, - 55 => 1, - 57 => 1, - 58 => 1, - 59 => 1, - 60 => 1, - 65 => 1, - 66 => 1, - 67 => 1, - 68 => 1, - 69 => 1, - 70 => 1, - 73 => 1, - 77 => 1, - 81 => 1, - 104 => 1, - 105 => 1, - 106 => 1, - 107 => 1, - 108 => 1, - 110 => 1, - 111 => 1, - 112 => 1, - 114 => 1, - 115 => 1, - 117 => 1, - 118 => 1, - ]; - break; - case 'DisallowSpaceIndentUnitTest.3.inc': - return [ - 2 => 1, - 5 => 1, - 10 => 1, - 12 => 1, - 13 => 1, - 14 => 1, - 15 => 1, - ]; - break; - case 'DisallowSpaceIndentUnitTest.js': - return [3 => 1]; - break; - case 'DisallowSpaceIndentUnitTest.css': - return [2 => 1]; - break; - default: - return []; - break; - }//end switch - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowTabIndentUnitTest.1.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowTabIndentUnitTest.1.inc deleted file mode 100644 index cf61177..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowTabIndentUnitTest.1.inc +++ /dev/null @@ -1,93 +0,0 @@ - 'Czech republic', - 'România' => 'Romania', - 'Magyarország' => 'Hungary', -); - -$var = "$hello $there"; - -?> - - - Foo - - -
    -
    -
    -
    -
    -
    - - - - 'Czech republic', - 'România' => 'Romania', - 'Magyarország' => 'Hungary', -); - -$var = "$hello $there"; - -?> - - - Foo - - -
    -
    -
    -
    -
    -
    - - - - - - - Foo - - -
    -
    -
    -
    -
    -
    - - - - - - - Foo - - -
    -
    -
    -
    -
    -
    - - - - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class DisallowTabIndentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Get a list of CLI values to set before the file is tested. - * - * @param string $testFile The name of the file being tested. - * @param \PHP_CodeSniffer\Config $config The config data for the test run. - * - * @return void - */ - public function setCliValues($testFile, $config) - { - $config->tabWidth = 4; - - }//end setCliValues() - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'DisallowTabIndentUnitTest.1.inc': - return [ - 5 => 2, - 9 => 1, - 15 => 1, - 20 => 2, - 21 => 1, - 22 => 2, - 23 => 1, - 24 => 2, - 31 => 1, - 32 => 2, - 33 => 2, - 41 => 1, - 42 => 1, - 43 => 1, - 44 => 1, - 45 => 1, - 46 => 1, - 47 => 1, - 48 => 1, - 54 => 1, - 55 => 1, - 56 => 1, - 57 => 1, - 58 => 1, - 59 => 1, - 79 => 1, - 80 => 1, - 81 => 1, - 82 => 1, - 83 => 1, - 85 => 1, - 86 => 1, - 87 => 1, - 89 => 1, - 90 => 1, - 92 => 1, - 93 => 1, - ]; - break; - case 'DisallowTabIndentUnitTest.2.inc': - return [ - 6 => 1, - 7 => 1, - 8 => 1, - 9 => 1, - 10 => 1, - 11 => 1, - 12 => 1, - 13 => 1, - 19 => 1, - ]; - break; - case 'DisallowTabIndentUnitTest.js': - return [ - 3 => 1, - 5 => 1, - 6 => 1, - ]; - break; - case 'DisallowTabIndentUnitTest.css': - return [ - 1 => 1, - 2 => 1, - ]; - break; - default: - return []; - break; - }//end switch - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.inc deleted file mode 100644 index 22c611b..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.inc +++ /dev/null @@ -1,17 +0,0 @@ - - * @copyright 2018 Juliette Reinders Folmer. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class IncrementDecrementSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='IncrementDecrementSpacingUnitTest.inc') - { - switch ($testFile) { - case 'IncrementDecrementSpacingUnitTest.inc': - case 'IncrementDecrementSpacingUnitTest.js': - return [ - 5 => 1, - 6 => 1, - 8 => 1, - 10 => 1, - 13 => 1, - 14 => 1, - 16 => 1, - 17 => 1, - ]; - - default: - return []; - }//end switch - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.inc deleted file mode 100644 index 505cb6e..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.inc +++ /dev/null @@ -1,79 +0,0 @@ - - * @copyright 2006-2017 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class LanguageConstructSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 3 => 1, - 7 => 1, - 11 => 1, - 15 => 1, - 19 => 1, - 23 => 1, - 27 => 1, - 30 => 1, - 33 => 1, - 34 => 1, - 35 => 1, - 36 => 1, - 38 => 1, - 44 => 1, - 45 => 1, - 46 => 2, - 49 => 1, - 51 => 1, - 59 => 1, - 61 => 1, - 63 => 1, - 67 => 1, - 70 => 1, - 71 => 1, - 75 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc deleted file mode 100644 index 6aadcc2..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc +++ /dev/null @@ -1,1595 +0,0 @@ -phpcs:set Generic.WhiteSpace.ScopeIndent tabIndent false - -hello(); - } - - function hello() - { - echo 'hello'; -}//end hello() - - function hello2() - { - if (TRUE) { - echo 'hello'; // no error here as its more than 4 spaces. - } else { - echo 'bye'; - } - - while (TRUE) { - echo 'hello'; - } - - do { - echo 'hello'; - } while (TRUE); - } - - function hello3() - { - switch ($hello) { - case 'hello': - break; - } - } - -} - -?> -
    -
    -
    -validate()) {
    -    $safe = $form->getSubmitValues();
    -}
    -?>
    -
    -open(); // error here - } - - public function open() - { - // Some inline stuff that shouldn't error - if (TRUE) echo 'hello'; - foreach ($tokens as $token) echo $token; - } - - /** - * This is a comment 1. - * This is a comment 2. - * This is a comment 3. - * This is a comment 4. - */ - public function close() - { - // All ok. - if (TRUE) { - if (TRUE) { - } else if (FALSE) { - foreach ($tokens as $token) { - switch ($token) { - case '1': - case '2': - if (true) { - if (false) { - if (false) { - if (false) { - echo 'hello'; - } - } - } - } - break; - case '5': - break; - } - do { - while (true) { - foreach ($tokens as $token) { - for ($i = 0; $i < $token; $i++) { - echo 'hello'; - } - } - } - } while (true); - } - } - } - } - - /* - This is another c style comment 1. - This is another c style comment 2. - This is another c style comment 3. - This is another c style comment 4. - This is another c style comment 5. - */ - - /* This is a T_COMMENT - * - * - * - */ - - /** This is a T_DOC_COMMENT - */ - - /* - This T_COMMENT has a newline in it. - - */ - - public function read() - { - echo 'hello'; - - // no errors below. - $array = array( - 'this', - 'that' => array( - 'hello', - 'hello again' => array( - 'hello', - ), - ), - ); - } -} - -abstract class Test3 -{ - public function parse() - { - - foreach ($t as $ndx => $token) { - if (is_array($token)) { - echo 'here'; - } else { - $ts[] = array("token" => $token, "value" => ''); - - $last = count($ts) - 1; - - switch ($token) { - case '(': - - if ($last >= 3 && - $ts[0]['token'] != T_CLASS && - $ts[$last - 2]['token'] == T_OBJECT_OPERATOR && - $ts[$last - 3]['token'] == T_VARIABLE ) { - - - if (true) { - echo 'hello'; - } - } - array_push($braces, $token); - break; - } - } - } - } -} - -function test() -{ - $o = << - - - - doSomething( - function () { - echo 123; - } - ); - } -} - -some_function( - function() { - $a = 403; - if ($a === 404) { - $a = 403; - } - } -); - -some_function( - function() { - $a = 403; - if ($a === 404) { - $a = 403; - } - } -); - -$myFunction = function() { - $a = 403; - if ($a === 404) { - $a = 403; - } -}; - -class Whatever -{ - protected $_protectedArray = array( - 'normalString' => 'That email address is already in use!', - 'offendingString' => <<<'STRING' -Each line of this string is always said to be at column 0, - no matter how many spaces are placed - at the beginning of each line -and the ending STRING on the next line is reported as having to be indented. -STRING - ); -} - -class MyClass -{ - public static function myFunction() - { - if (empty($keywords) === FALSE) { - $keywords = 'foo'; - $existing = 'foo'; - } - - return $keywords; - - }//end myFunction() - -}//end class - -$var = call_user_func( - $new_var = function () use (&$a) { - if ($a > 0) { - return $a++; - } else { - return $a--; - } - } -); - -class AnonymousFn -{ - public function getAnonFn() - { - return array( - 'functions' => Array( - 'function1' => function ($a, $b, $c) { - $a = $b + $c; - $b = $c / 2; - return Array($a, $b, $c); - }, - ), - ); - } -} -?> - -
    - -
    -
    - -
    -
    - -
    - - "") { - $test = true; - } else { - $test = true; - } - } - ?> - - - -
    -
    -
    - -
    -
    -
    - - -

    some text

    - function ($a) { - if ($a === true) { - echo 'hi'; - } - } -]; - -$list = [ - 'fn' => function ($a) { - if ($a === true) { - echo 'hi'; - } - } -]; - -if ($foo) { - foreach ($bar as $baz) { - if ($baz) { - ?> -
    -
    -
    - 1) { - echo '1'; - } - ?> -
    - 1) { - echo '1'; - } - ?> -
    - 1) { - echo '1'; - } - ?> -
    - -<?= CHtml::encode($this->pageTitle); ?> - -expects($this->at(2)) - ->with($this->callback( - function ($subject) - { - } - ) - ); - -/** @var Database $mockedDatabase */ -/** @var Container $mockedContainer */ - -echo $string->append('foo') - ->appaend('bar') - ->appaend('baz') - ->outputUsing( - function () - { - } - ); - -echo PHP_EOL; - -switch ($arg) { - case 1: - break; - case 2: - if ($arg2 == 'foo') { - } - case 3: - default: - echo 'default'; -} - -if ($tokens[$stackPtr]['content']{0} === '#') { -} else if ($tokens[$stackPtr]['content']{0} === '/' - && $tokens[$stackPtr]['content']{1} === '/' -) { -} - -$var = call_user_func( - function() { - if ($foo) { - $new_var = function() { - if ($a > 0) { - return $a++; - } else { - return $a--; - } - }; - } - } -); - -a( - function() { - $a = function() { - $b = false; - }; - true; - } -); - -$var = [ - [ - '1' => - function () { - return true; - }, - ], - [ - '1' => - function () { - return true; - }, - '2' => true, - ] -]; - -if ($foo) { - ?> -

    - self::_replaceKeywords($failingComment, $result), - 'screenshot' => Test::getScreenshotPath( - $projectid, - $result['class_name'], - ), - ); - -} - -$this->mockedDatabase - ->with( - $this->callback( - function () { - return; - } - ) - ); - -$this->subject->recordLogin(); - -function a() -{ - if (true) { - static::$a[$b] = - static::where($c) - ->where($c) - ->where( - function ($d) { - $d->whereNull(); - $d->orWhere(); - } - ) - ->first(); - - if (static::$a[$b] === null) { - static::$a[$b] = new static( - array( - 'a' => $a->id, - 'a' => $a->id, - ) - ); - } - } - - return static::$a[$b]; -} - -$foo->load( - array( - 'bar' => function ($baz) { - $baz->call(); - } - ) -); - -hello(); - -$foo = array_unique( - array_map( - function ($entry) { - return $entry * 2; - }, - array() - ) -); -bar($foo); - -class PHP_CodeSniffer_Tokenizers_JS -{ - - public $scopeOpeners = array( - T_CASE => array( - 'end' => array( - T_BREAK => T_BREAK, - T_RETURN => T_RETURN, - ), - 'strict' => true, - ), - ); -} - -echo $string-> - append('foo')-> - appaend('bar')-> - appaend('baz')-> - outputUsing( - function () - { - } - ); - -$str = 'the items I want to show are: ' . - implode( - ', ', - array('a', 'b', 'c') - ); - -echo $str; - -$str = 'foo' - . '1' - . '2'; - -echo $str; - -bar([ - 'foo' => foo(function () { - return 'foo'; - }) -]); - -$domains = array_unique( - array_map( - function ($url) { - $urlObject = new \Purl\Url($url); - return $urlObject->registerableDomain; - }, - $sites - ) -); - -return $domains; - -if ($a == 5) : - echo "a equals 5"; - echo "..."; -elseif ($a == 6) : - echo "a equals 6"; - echo "!!!"; -else : - echo "a is neither 5 nor 6"; -endif; - -if ($foo): -if ($bar) $foo = 1; -elseif ($baz) $foo = 2; -endif; - -$this - ->method(array( - 'foo' => 'bar', - ), 'arg', array( - 'foo' => 'bar', - )); - -class Foo -{ - use Bar { - myMethod as renamedMethod; - } -} - -class Foo -{ - use Bar { - myMethod as renamedMethod; - } -} - -foo(); - -array( - 'key1' => function ($bar) { - return $bar; - }, - 'key2' => function ($foo) { - return $foo; - }, -); - -?> - - 1, - ]; -$c = 2; - -class foo -{ - public function get() - { - $foo = ['b' => 'c', - 'd' => [ - ['e' => 'f'] - ]]; - echo '42'; - - $foo = array('b' => 'c', - 'd' => array( - array('e' => 'f') - )); - echo '42'; - } -} - -switch ($foo) { - case 1: - return array(); - case 2: - return ''; - case 3: - return $function(); - case 4: - return $functionCall($param[0]); - case 5: - return array() + array(); // Array Merge - case 6: - // String connect - return $functionReturningString('') . $functionReturningString(array()); - case 7: - return functionCall( - $withMultiLineParam[0], - array(), - $functionReturningString( - $withMultiLineParam[1] - ) - ); - case 8: - return $param[0][0]; -} - -class Test { - - public - $foo - ,$bar - ,$baz = [ ] - ; - - public function wtfindent() { - } -} - -switch ($x) { - case 1: - return [1]; - default: - return [2]; -} - -switch ($foo) { - case self::FOO: - return $this->bar($gfoo, function ($id) { - return FOO::bar($id); - }, $values); - case self::BAR: - $values = $this->bar($foo, $values); - break; -} - -$var = array( - 'long description' => - array(0, 'something'), - 'another long description' => - array(1, "something else") -); - -$services = array( - 'service 1' => - Mockery::mock('class 1') - ->shouldReceive('setFilter')->once() - ->shouldReceive('getNbResults')->atLeast()->once() - ->shouldReceive('getSlice')->once()->andReturn(array()) - ->getMock(), - 'service 2' => - Mockery::mock('class 2') - ->shouldReceive('__invoke')->once() - ->getMock() -); - -class Foo -{ - public function setUp() - { - $this->foo = new class { - public $name = 'Some value'; - }; - } -} - -try { - foo(); -} catch (\Exception $e) { - $foo = function() { - return 'foo'; - }; - - if (true) { - } -} - -if ($foo) { - foo(); -} else if ($e) { - $foo = function() { - return 'foo'; - }; - - if (true) { - } -} else { - $foo = function() { - return 'foo'; - }; - - if (true) { - } -} - -switch ($parameter) { - case null: - return [ - 'foo' => in_array( - 'foo', - [] - ), - ]; - - default: - return []; -} - -class SomeClass -{ - public function someFunc() - { - a(function () { - echo "a"; - })->b(function () { - echo "b"; - }); - - if (true) { - echo "c"; - } - echo "d"; - } -} - -$params = self::validate_parameters(self::read_competency_framework_parameters(), - array( - 'id' => $id, - )); - -$framework = api::read_framework($params['id']); -self::validate_context($framework->get_context()); -$output = $PAGE->get_renderer('tool_lp'); - -class Test123 -{ - protected static - $prop1 = [ - 'testA' => 123, - ], - $prop2 = [ - 'testB' => 456, - ]; - - protected static - $prop3 = array( - 'testA' => 123, - ), - $prop4 = array( - 'testB' => 456, - ); - - protected static $prop5; -} - -$foo = foo( - function () { - $foo->debug( - $a, - $b - ); - - if ($a) { - $b = $a; - } - } -); - -if (somethingIsTrue()) { - ?> -
    - -
    - bar(foo(function () { - }), foo(function () { - })); - -echo 'foo'; - -class Test { - - public function a() { - ?>adebug( - $a, - $b - ); - - if ($a) { - $b = $a; - } - } -); - -function test() -{ - $array = []; - foreach ($array as $data) { - [ - 'key1' => $var1, - 'key2' => $var2, - ] = $data; - foreach ($var1 as $method) { - echo $method . $var2; - } - } -} - -switch ($a) { - case 0: - $a = function () { - }; - case 1: - break; -} - -class Test -{ - public function __construct() - { -if (false) { -echo 0; - } - } -} - -return [ - 'veryLongKeySoIWantToMakeALineBreak' - => 'veryLonValueSoIWantToMakeALineBreak', - - 'someOtherKey' => [ - 'someValue' - ], - - 'arrayWithArraysInThere' => [ - ['Value1', 'Value1'] - ], -]; - -switch ($sContext) { - case 'SOMETHING': - case 'CONSTANT': - do_something(); - break; - case 'GLOBAL': - case 'GLOBAL1': - do_something(); - // Fall through - default: - { - do_something(); - } -} - -array_map( - static function ( $item ) { - echo $item; - }, - $some_array -); - -/** - * Comment. - */ -$a(function () use ($app) { - echo 'hi'; -})(); - -$app->run(); - -function foo() -{ - $foo('some - long description', function () { - }); - - $foo('some - long - description', function () { - }); - - $foo( -'some long description', function () { - }); -} - -switch ( $a ) { -case 'a': - $b = 2; - /** - * A comment. - */ - apply_filter( 'something', $b ); - break; - -case 'aa': - $b = 2; - /* - * A comment. - */ - apply_filter( 'something', $b ); - break; - -case 'b': - $b = 3; -?> - - - - - -
    - -
    - -
    - -
    - - -
    - - - -
    - [ - ], - 'b' => <<<'FOO' -foo; -FOO - ], - $a, -]; - -$query = Model::query() - ->when($a, function () { - static $b = ''; - }); - -$result = array_map( - static fn(int $number) : int => $number + 1, - $numbers -); - -$a = $a === true ? [ - 'a' => 1, - ] : [ - 'a' => 100, -]; - -return [ - Url::make('View Song', fn($song) => $song->url()) - ->onlyOnDetail(), - - new Panel('Information', [ - Text::make('Title') - ]), -]; - -echo $string?->append('foo') - ?->outputUsing(); - -// phpcs:set Generic.WhiteSpace.ScopeIndent exact true -echo $string?->append('foo') - ?->outputUsing(); -// phpcs:set Generic.WhiteSpace.ScopeIndent exact false - -if (true) { - ?> null, - false => false, - 1, 2, 3 => true, - default => $value, -}; - -$value = match ($value) { - '' => null, -false => false, - 1, 2, 3 => true, - default => $value, -}; - -$value = match ( - $value - ) { - '' => null, - false - => false, - 1, - 2, - 3 => true, - default => -$value, -}; - -function toString(): string -{ - return sprintf( - '%s', - match ($type) { - 'foo' => 'bar', - }, - ); -} - -$list = [ - 'fn' => function ($a) { - if ($a === true) { - echo 'hi'; - } - }, - 'fn' => function ($a) { - if ($a === true) { - echo 'hi'; - $list2 = [ - 'fn' => function ($a) { - if ($a === true) { - echo 'hi'; - } - } - ]; - } - } -]; - -$foo = match ($type) { - 'a' => [ - 'aa' => 'DESC', - 'ab' => 'DESC', - ], - 'b' => [ - 'ba' => 'DESC', - 'bb' => 'DESC', - ], - default => [ - 'da' => 'DESC', - ], -}; - -$a = [ - 'a' => [ - 'a' => fn () => foo() - ], - 'a' => [ - 'a' => 'a', - ] -]; - -/* ADD NEW TESTS ABOVE THIS LINE AND MAKE SURE THAT THE 1 (space-based) AND 2 (tab-based) FILES ARE IN SYNC! */ -?> - - - - - - - <<<'INTRO' - lorem ipsum - INTRO, - 'em' => [ - [ - '', - ], - ], - 'abc' => [ - 'a' => 'wop wop', - 'b' => 'ola ola.', - ], -]; - -echo "" diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc.fixed deleted file mode 100644 index 7b07650..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc.fixed +++ /dev/null @@ -1,1595 +0,0 @@ -phpcs:set Generic.WhiteSpace.ScopeIndent tabIndent false - -hello(); - } - - function hello() - { - echo 'hello'; - }//end hello() - - function hello2() - { - if (TRUE) { - echo 'hello'; // no error here as its more than 4 spaces. - } else { - echo 'bye'; - } - - while (TRUE) { - echo 'hello'; - } - - do { - echo 'hello'; - } while (TRUE); - } - - function hello3() - { - switch ($hello) { - case 'hello': - break; - } - } - -} - -?> -
    -
    -
    -validate()) {
    -    $safe = $form->getSubmitValues();
    -}
    -?>
    -
    -open(); // error here - } - - public function open() - { - // Some inline stuff that shouldn't error - if (TRUE) echo 'hello'; - foreach ($tokens as $token) echo $token; - } - - /** - * This is a comment 1. - * This is a comment 2. - * This is a comment 3. - * This is a comment 4. - */ - public function close() - { - // All ok. - if (TRUE) { - if (TRUE) { - } else if (FALSE) { - foreach ($tokens as $token) { - switch ($token) { - case '1': - case '2': - if (true) { - if (false) { - if (false) { - if (false) { - echo 'hello'; - } - } - } - } - break; - case '5': - break; - } - do { - while (true) { - foreach ($tokens as $token) { - for ($i = 0; $i < $token; $i++) { - echo 'hello'; - } - } - } - } while (true); - } - } - } - } - - /* - This is another c style comment 1. - This is another c style comment 2. - This is another c style comment 3. - This is another c style comment 4. - This is another c style comment 5. - */ - - /* This is a T_COMMENT - * - * - * - */ - - /** This is a T_DOC_COMMENT - */ - - /* - This T_COMMENT has a newline in it. - - */ - - public function read() - { - echo 'hello'; - - // no errors below. - $array = array( - 'this', - 'that' => array( - 'hello', - 'hello again' => array( - 'hello', - ), - ), - ); - } -} - -abstract class Test3 -{ - public function parse() - { - - foreach ($t as $ndx => $token) { - if (is_array($token)) { - echo 'here'; - } else { - $ts[] = array("token" => $token, "value" => ''); - - $last = count($ts) - 1; - - switch ($token) { - case '(': - - if ($last >= 3 && - $ts[0]['token'] != T_CLASS && - $ts[$last - 2]['token'] == T_OBJECT_OPERATOR && - $ts[$last - 3]['token'] == T_VARIABLE ) { - - - if (true) { - echo 'hello'; - } - } - array_push($braces, $token); - break; - } - } - } - } -} - -function test() -{ - $o = << - - - - doSomething( - function () { - echo 123; - } - ); - } -} - -some_function( - function() { - $a = 403; - if ($a === 404) { - $a = 403; - } - } -); - -some_function( - function() { - $a = 403; - if ($a === 404) { - $a = 403; - } - } -); - -$myFunction = function() { - $a = 403; - if ($a === 404) { - $a = 403; - } -}; - -class Whatever -{ - protected $_protectedArray = array( - 'normalString' => 'That email address is already in use!', - 'offendingString' => <<<'STRING' -Each line of this string is always said to be at column 0, - no matter how many spaces are placed - at the beginning of each line -and the ending STRING on the next line is reported as having to be indented. -STRING - ); -} - -class MyClass -{ - public static function myFunction() - { - if (empty($keywords) === FALSE) { - $keywords = 'foo'; - $existing = 'foo'; - } - - return $keywords; - - }//end myFunction() - -}//end class - -$var = call_user_func( - $new_var = function () use (&$a) { - if ($a > 0) { - return $a++; - } else { - return $a--; - } - } -); - -class AnonymousFn -{ - public function getAnonFn() - { - return array( - 'functions' => Array( - 'function1' => function ($a, $b, $c) { - $a = $b + $c; - $b = $c / 2; - return Array($a, $b, $c); - }, - ), - ); - } -} -?> - -
    - -
    -
    - -
    -
    - -
    - - "") { - $test = true; - } else { - $test = true; - } - } - ?> - - - -
    -
    -
    - -
    -
    -
    - - -

    some text

    - function ($a) { - if ($a === true) { - echo 'hi'; - } - } -]; - -$list = [ - 'fn' => function ($a) { - if ($a === true) { - echo 'hi'; - } - } -]; - -if ($foo) { - foreach ($bar as $baz) { - if ($baz) { - ?> -
    -
    -
    - 1) { - echo '1'; - } - ?> -
    - 1) { - echo '1'; - } - ?> -
    - 1) { - echo '1'; - } - ?> -
    - -<?= CHtml::encode($this->pageTitle); ?> - -expects($this->at(2)) - ->with($this->callback( - function ($subject) - { - } - ) - ); - -/** @var Database $mockedDatabase */ -/** @var Container $mockedContainer */ - -echo $string->append('foo') - ->appaend('bar') - ->appaend('baz') - ->outputUsing( - function () - { - } - ); - -echo PHP_EOL; - -switch ($arg) { - case 1: - break; - case 2: - if ($arg2 == 'foo') { - } - case 3: - default: - echo 'default'; -} - -if ($tokens[$stackPtr]['content']{0} === '#') { -} else if ($tokens[$stackPtr]['content']{0} === '/' - && $tokens[$stackPtr]['content']{1} === '/' -) { -} - -$var = call_user_func( - function() { - if ($foo) { - $new_var = function() { - if ($a > 0) { - return $a++; - } else { - return $a--; - } - }; - } - } -); - -a( - function() { - $a = function() { - $b = false; - }; - true; - } -); - -$var = [ - [ - '1' => - function () { - return true; - }, - ], - [ - '1' => - function () { - return true; - }, - '2' => true, - ] -]; - -if ($foo) { - ?> -

    - self::_replaceKeywords($failingComment, $result), - 'screenshot' => Test::getScreenshotPath( - $projectid, - $result['class_name'], - ), - ); - -} - -$this->mockedDatabase - ->with( - $this->callback( - function () { - return; - } - ) - ); - -$this->subject->recordLogin(); - -function a() -{ - if (true) { - static::$a[$b] = - static::where($c) - ->where($c) - ->where( - function ($d) { - $d->whereNull(); - $d->orWhere(); - } - ) - ->first(); - - if (static::$a[$b] === null) { - static::$a[$b] = new static( - array( - 'a' => $a->id, - 'a' => $a->id, - ) - ); - } - } - - return static::$a[$b]; -} - -$foo->load( - array( - 'bar' => function ($baz) { - $baz->call(); - } - ) -); - -hello(); - -$foo = array_unique( - array_map( - function ($entry) { - return $entry * 2; - }, - array() - ) -); -bar($foo); - -class PHP_CodeSniffer_Tokenizers_JS -{ - - public $scopeOpeners = array( - T_CASE => array( - 'end' => array( - T_BREAK => T_BREAK, - T_RETURN => T_RETURN, - ), - 'strict' => true, - ), - ); -} - -echo $string-> - append('foo')-> - appaend('bar')-> - appaend('baz')-> - outputUsing( - function () - { - } - ); - -$str = 'the items I want to show are: ' . - implode( - ', ', - array('a', 'b', 'c') - ); - -echo $str; - -$str = 'foo' - . '1' - . '2'; - -echo $str; - -bar([ - 'foo' => foo(function () { - return 'foo'; - }) -]); - -$domains = array_unique( - array_map( - function ($url) { - $urlObject = new \Purl\Url($url); - return $urlObject->registerableDomain; - }, - $sites - ) -); - -return $domains; - -if ($a == 5) : - echo "a equals 5"; - echo "..."; -elseif ($a == 6) : - echo "a equals 6"; - echo "!!!"; -else : - echo "a is neither 5 nor 6"; -endif; - -if ($foo): - if ($bar) $foo = 1; - elseif ($baz) $foo = 2; -endif; - -$this - ->method(array( - 'foo' => 'bar', - ), 'arg', array( - 'foo' => 'bar', - )); - -class Foo -{ - use Bar { - myMethod as renamedMethod; - } -} - -class Foo -{ - use Bar { - myMethod as renamedMethod; - } -} - -foo(); - -array( - 'key1' => function ($bar) { - return $bar; - }, - 'key2' => function ($foo) { - return $foo; - }, -); - -?> - - 1, - ]; -$c = 2; - -class foo -{ - public function get() - { - $foo = ['b' => 'c', - 'd' => [ - ['e' => 'f'] - ]]; - echo '42'; - - $foo = array('b' => 'c', - 'd' => array( - array('e' => 'f') - )); - echo '42'; - } -} - -switch ($foo) { - case 1: - return array(); - case 2: - return ''; - case 3: - return $function(); - case 4: - return $functionCall($param[0]); - case 5: - return array() + array(); // Array Merge - case 6: - // String connect - return $functionReturningString('') . $functionReturningString(array()); - case 7: - return functionCall( - $withMultiLineParam[0], - array(), - $functionReturningString( - $withMultiLineParam[1] - ) - ); - case 8: - return $param[0][0]; -} - -class Test { - - public - $foo - ,$bar - ,$baz = [ ] - ; - - public function wtfindent() { - } -} - -switch ($x) { - case 1: - return [1]; - default: - return [2]; -} - -switch ($foo) { - case self::FOO: - return $this->bar($gfoo, function ($id) { - return FOO::bar($id); - }, $values); - case self::BAR: - $values = $this->bar($foo, $values); - break; -} - -$var = array( - 'long description' => - array(0, 'something'), - 'another long description' => - array(1, "something else") -); - -$services = array( - 'service 1' => - Mockery::mock('class 1') - ->shouldReceive('setFilter')->once() - ->shouldReceive('getNbResults')->atLeast()->once() - ->shouldReceive('getSlice')->once()->andReturn(array()) - ->getMock(), - 'service 2' => - Mockery::mock('class 2') - ->shouldReceive('__invoke')->once() - ->getMock() -); - -class Foo -{ - public function setUp() - { - $this->foo = new class { - public $name = 'Some value'; - }; - } -} - -try { - foo(); -} catch (\Exception $e) { - $foo = function() { - return 'foo'; - }; - - if (true) { - } -} - -if ($foo) { - foo(); -} else if ($e) { - $foo = function() { - return 'foo'; - }; - - if (true) { - } -} else { - $foo = function() { - return 'foo'; - }; - - if (true) { - } -} - -switch ($parameter) { - case null: - return [ - 'foo' => in_array( - 'foo', - [] - ), - ]; - - default: - return []; -} - -class SomeClass -{ - public function someFunc() - { - a(function () { - echo "a"; - })->b(function () { - echo "b"; - }); - - if (true) { - echo "c"; - } - echo "d"; - } -} - -$params = self::validate_parameters(self::read_competency_framework_parameters(), - array( - 'id' => $id, - )); - -$framework = api::read_framework($params['id']); -self::validate_context($framework->get_context()); -$output = $PAGE->get_renderer('tool_lp'); - -class Test123 -{ - protected static - $prop1 = [ - 'testA' => 123, - ], - $prop2 = [ - 'testB' => 456, - ]; - - protected static - $prop3 = array( - 'testA' => 123, - ), - $prop4 = array( - 'testB' => 456, - ); - - protected static $prop5; -} - -$foo = foo( - function () { - $foo->debug( - $a, - $b - ); - - if ($a) { - $b = $a; - } - } -); - -if (somethingIsTrue()) { - ?> -
    - -
    - bar(foo(function () { - }), foo(function () { - })); - -echo 'foo'; - -class Test { - - public function a() { - ?>adebug( - $a, - $b - ); - - if ($a) { - $b = $a; - } - } -); - -function test() -{ - $array = []; - foreach ($array as $data) { - [ - 'key1' => $var1, - 'key2' => $var2, - ] = $data; - foreach ($var1 as $method) { - echo $method . $var2; - } - } -} - -switch ($a) { - case 0: - $a = function () { - }; - case 1: - break; -} - -class Test -{ - public function __construct() - { - if (false) { - echo 0; - } - } -} - -return [ - 'veryLongKeySoIWantToMakeALineBreak' - => 'veryLonValueSoIWantToMakeALineBreak', - - 'someOtherKey' => [ - 'someValue' - ], - - 'arrayWithArraysInThere' => [ - ['Value1', 'Value1'] - ], -]; - -switch ($sContext) { - case 'SOMETHING': - case 'CONSTANT': - do_something(); - break; - case 'GLOBAL': - case 'GLOBAL1': - do_something(); - // Fall through - default: - { - do_something(); - } -} - -array_map( - static function ( $item ) { - echo $item; - }, - $some_array -); - -/** - * Comment. - */ -$a(function () use ($app) { - echo 'hi'; -})(); - -$app->run(); - -function foo() -{ - $foo('some - long description', function () { - }); - - $foo('some - long - description', function () { - }); - - $foo( - 'some long description', function () { - }); -} - -switch ( $a ) { - case 'a': - $b = 2; - /** - * A comment. - */ - apply_filter( 'something', $b ); - break; - - case 'aa': - $b = 2; - /* - * A comment. - */ - apply_filter( 'something', $b ); - break; - - case 'b': - $b = 3; - ?> - - - - - -
    - -
    - -
    - -
    - - -
    - - - -
    - [ - ], - 'b' => <<<'FOO' -foo; -FOO - ], - $a, -]; - -$query = Model::query() - ->when($a, function () { - static $b = ''; - }); - -$result = array_map( - static fn(int $number) : int => $number + 1, - $numbers -); - -$a = $a === true ? [ - 'a' => 1, - ] : [ - 'a' => 100, -]; - -return [ - Url::make('View Song', fn($song) => $song->url()) - ->onlyOnDetail(), - - new Panel('Information', [ - Text::make('Title') - ]), -]; - -echo $string?->append('foo') - ?->outputUsing(); - -// phpcs:set Generic.WhiteSpace.ScopeIndent exact true -echo $string?->append('foo') - ?->outputUsing(); -// phpcs:set Generic.WhiteSpace.ScopeIndent exact false - -if (true) { - ?> null, - false => false, - 1, 2, 3 => true, - default => $value, -}; - -$value = match ($value) { - '' => null, - false => false, - 1, 2, 3 => true, - default => $value, -}; - -$value = match ( - $value - ) { - '' => null, - false - => false, - 1, - 2, - 3 => true, - default => - $value, -}; - -function toString(): string -{ - return sprintf( - '%s', - match ($type) { - 'foo' => 'bar', - }, - ); -} - -$list = [ - 'fn' => function ($a) { - if ($a === true) { - echo 'hi'; - } - }, - 'fn' => function ($a) { - if ($a === true) { - echo 'hi'; - $list2 = [ - 'fn' => function ($a) { - if ($a === true) { - echo 'hi'; - } - } - ]; - } - } -]; - -$foo = match ($type) { - 'a' => [ - 'aa' => 'DESC', - 'ab' => 'DESC', - ], - 'b' => [ - 'ba' => 'DESC', - 'bb' => 'DESC', - ], - default => [ - 'da' => 'DESC', - ], -}; - -$a = [ - 'a' => [ - 'a' => fn () => foo() - ], - 'a' => [ - 'a' => 'a', - ] -]; - -/* ADD NEW TESTS ABOVE THIS LINE AND MAKE SURE THAT THE 1 (space-based) AND 2 (tab-based) FILES ARE IN SYNC! */ -?> - - - - - - - <<<'INTRO' - lorem ipsum - INTRO, - 'em' => [ - [ - '', - ], - ], - 'abc' => [ - 'a' => 'wop wop', - 'b' => 'ola ola.', - ], -]; - -echo "" diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.js b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.js deleted file mode 100644 index 2195bfb..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.js +++ /dev/null @@ -1,239 +0,0 @@ -phpcs:set Generic.WhiteSpace.ScopeIndent tabIndent false -var script = document.createElement('script'); -script.onload = function() -{ - clearTimeout(t); - script456.onload = null; - script.onreadystatechange = null; - callback.call(this); - -}; - -this.callbacks[type] = { - namespaces: {}, -others: [] -}; - -blah = function() -{ - print something; - - } - -test(blah, function() { - print something; -}); - -var test = [{x: 10}]; -var test = [{ - x: 10, - y: { - b14h: 12, - 'b14h': 12 - }, - z: 23 -}]; - -Viper.prototype = { - - _removeEvents: function(elem) - { - if (!elem) { - elem = this.element; - } - - ViperUtil.removeEvent(elem, '.' + this.getEventNamespace()); - - } - -}; - -this.init = function(data) { - if (_pageListWdgt) { - GUI.getWidget('changedPagesList').addItemClickedCallback( - function(itemid, target) { - draftChangeTypeClicked( - itemid, - target, - { - reviewData: _reviewData, - pageid: itemid - } - ); - } - ); - }//end if - -}; - -a( - function() { - var _a = function() { - b = false; - - }; - true - } -); - -(function() { - a = function() { - a(function() { - if (true) { - a = true; - } - }); - - a( - function() { - if (true) { - if (true) { - a = true; - } - } - } - ); - - a( - function() { - if (true) { - a = true; - } - } - ); - - }; - -})(); - -a.prototype = { - - a: function() - { - var currentSize = null; - ViperUtil.addEvent( - header, - 'safedblclick', - function() {}, - ); - - if (topContent) { - ViperUtil.addClass(topContent, 'Viper-popup-top'); - main.appendChild(topContent); - } - - ViperUtil.addClass(midContent, 'Viper-popup-content'); - main.appendChild(midContent); - } - -}; - -a.prototype = { - - a: function() - { - ViperUtil.addClass(midContent, 'Viper-popup-content'); - main.appendChild(midContent); - - var mouseUpAction = function() {}; - var preventMouseUp = false; - var self = this; - if (clickAction) { - } - } - -}; - -a.prototype = { - - a: function() - { - var a = function() { - var a = 'foo'; - }; - - if (true) { - } - - }, - - b: function() - { - ViperUtil.addEvent( - function() { - if (fullScreen !== true) { - currentSize = { - }; - - showfullScreen(); - } - } - ); - - }, - - c: function() - { - this.a( - { - a: function() { - form.onsubmit = function() { - return false; - }; - - var a = true; - } - } - ); - - } - -}; - -a.prototype = { - init: function() - {}, - - _b: function() - { - } - -}; - -for (var i = 0; i < 10; i++) { - var foo = {foo:{'a':'b', - 'c':'d'}}; -} - -class TestOk -{ - destroy() - { - setTimeout(a, 1000); - - if (typeof self.callbackOnClose === "function") { - self.callbackOnClose(); - } - } -} - -class TestBad -{ - destroy() - { - setTimeout(function () { - return; - }, 1000); - - if (typeof self.callbackOnClose === "function") { - self.callbackOnClose(); - } - } -} - -( function( $ ) { - foo(function( value ) { - value.bind( function( newval ) { - $( '#bar' ).html( newval ); - } ); - } )( jQuery ); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.js.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.js.fixed deleted file mode 100644 index d4bf409..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.js.fixed +++ /dev/null @@ -1,239 +0,0 @@ -phpcs:set Generic.WhiteSpace.ScopeIndent tabIndent false -var script = document.createElement('script'); -script.onload = function() -{ - clearTimeout(t); - script456.onload = null; - script.onreadystatechange = null; - callback.call(this); - -}; - -this.callbacks[type] = { - namespaces: {}, - others: [] -}; - -blah = function() -{ - print something; - -} - -test(blah, function() { - print something; -}); - -var test = [{x: 10}]; -var test = [{ - x: 10, - y: { - b14h: 12, - 'b14h': 12 - }, - z: 23 -}]; - -Viper.prototype = { - - _removeEvents: function(elem) - { - if (!elem) { - elem = this.element; - } - - ViperUtil.removeEvent(elem, '.' + this.getEventNamespace()); - - } - -}; - -this.init = function(data) { - if (_pageListWdgt) { - GUI.getWidget('changedPagesList').addItemClickedCallback( - function(itemid, target) { - draftChangeTypeClicked( - itemid, - target, - { - reviewData: _reviewData, - pageid: itemid - } - ); - } - ); - }//end if - -}; - -a( - function() { - var _a = function() { - b = false; - - }; - true - } -); - -(function() { - a = function() { - a(function() { - if (true) { - a = true; - } - }); - - a( - function() { - if (true) { - if (true) { - a = true; - } - } - } - ); - - a( - function() { - if (true) { - a = true; - } - } - ); - - }; - -})(); - -a.prototype = { - - a: function() - { - var currentSize = null; - ViperUtil.addEvent( - header, - 'safedblclick', - function() {}, - ); - - if (topContent) { - ViperUtil.addClass(topContent, 'Viper-popup-top'); - main.appendChild(topContent); - } - - ViperUtil.addClass(midContent, 'Viper-popup-content'); - main.appendChild(midContent); - } - -}; - -a.prototype = { - - a: function() - { - ViperUtil.addClass(midContent, 'Viper-popup-content'); - main.appendChild(midContent); - - var mouseUpAction = function() {}; - var preventMouseUp = false; - var self = this; - if (clickAction) { - } - } - -}; - -a.prototype = { - - a: function() - { - var a = function() { - var a = 'foo'; - }; - - if (true) { - } - - }, - - b: function() - { - ViperUtil.addEvent( - function() { - if (fullScreen !== true) { - currentSize = { - }; - - showfullScreen(); - } - } - ); - - }, - - c: function() - { - this.a( - { - a: function() { - form.onsubmit = function() { - return false; - }; - - var a = true; - } - } - ); - - } - -}; - -a.prototype = { - init: function() - {}, - - _b: function() - { - } - -}; - -for (var i = 0; i < 10; i++) { - var foo = {foo:{'a':'b', - 'c':'d'}}; -} - -class TestOk -{ - destroy() - { - setTimeout(a, 1000); - - if (typeof self.callbackOnClose === "function") { - self.callbackOnClose(); - } - } -} - -class TestBad -{ - destroy() - { - setTimeout(function () { - return; - }, 1000); - - if (typeof self.callbackOnClose === "function") { - self.callbackOnClose(); - } - } -} - -( function( $ ) { - foo(function( value ) { - value.bind( function( newval ) { - $( '#bar' ).html( newval ); - } ); - } )( jQuery ); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc deleted file mode 100644 index 407fc8d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc +++ /dev/null @@ -1,1595 +0,0 @@ -phpcs:set Generic.WhiteSpace.ScopeIndent tabIndent true - -hello(); - } - - function hello() - { - echo 'hello'; -}//end hello() - - function hello2() - { - if (TRUE) { - echo 'hello'; // no error here as its more than 4 spaces. - } else { - echo 'bye'; - } - - while (TRUE) { - echo 'hello'; - } - - do { - echo 'hello'; - } while (TRUE); - } - - function hello3() - { - switch ($hello) { - case 'hello': - break; - } - } - -} - -?> -
    -
    -
    -validate()) {
    -	$safe = $form->getSubmitValues();
    -}
    -?>
    -
    -open(); // error here - } - - public function open() - { - // Some inline stuff that shouldn't error - if (TRUE) echo 'hello'; - foreach ($tokens as $token) echo $token; - } - - /** - * This is a comment 1. - * This is a comment 2. - * This is a comment 3. - * This is a comment 4. - */ - public function close() - { - // All ok. - if (TRUE) { - if (TRUE) { - } else if (FALSE) { - foreach ($tokens as $token) { - switch ($token) { - case '1': - case '2': - if (true) { - if (false) { - if (false) { - if (false) { - echo 'hello'; - } - } - } - } - break; - case '5': - break; - } - do { - while (true) { - foreach ($tokens as $token) { - for ($i = 0; $i < $token; $i++) { - echo 'hello'; - } - } - } - } while (true); - } - } - } - } - - /* - This is another c style comment 1. - This is another c style comment 2. - This is another c style comment 3. - This is another c style comment 4. - This is another c style comment 5. - */ - - /* This is a T_COMMENT - * - * - * - */ - - /** This is a T_DOC_COMMENT - */ - - /* - This T_COMMENT has a newline in it. - - */ - - public function read() - { - echo 'hello'; - - // no errors below. - $array = array( - 'this', - 'that' => array( - 'hello', - 'hello again' => array( - 'hello', - ), - ), - ); - } -} - -abstract class Test3 -{ - public function parse() - { - - foreach ($t as $ndx => $token) { - if (is_array($token)) { - echo 'here'; - } else { - $ts[] = array("token" => $token, "value" => ''); - - $last = count($ts) - 1; - - switch ($token) { - case '(': - - if ($last >= 3 && - $ts[0]['token'] != T_CLASS && - $ts[$last - 2]['token'] == T_OBJECT_OPERATOR && - $ts[$last - 3]['token'] == T_VARIABLE ) { - - - if (true) { - echo 'hello'; - } - } - array_push($braces, $token); - break; - } - } - } - } -} - -function test() -{ - $o = << - - - - doSomething( - function () { - echo 123; - } - ); - } -} - -some_function( - function() { - $a = 403; - if ($a === 404) { - $a = 403; - } - } -); - -some_function( - function() { - $a = 403; - if ($a === 404) { - $a = 403; - } - } -); - -$myFunction = function() { - $a = 403; - if ($a === 404) { - $a = 403; - } -}; - -class Whatever -{ - protected $_protectedArray = array( - 'normalString' => 'That email address is already in use!', - 'offendingString' => <<<'STRING' -Each line of this string is always said to be at column 0, - no matter how many spaces are placed - at the beginning of each line -and the ending STRING on the next line is reported as having to be indented. -STRING - ); -} - -class MyClass -{ - public static function myFunction() - { - if (empty($keywords) === FALSE) { - $keywords = 'foo'; - $existing = 'foo'; - } - - return $keywords; - - }//end myFunction() - -}//end class - -$var = call_user_func( - $new_var = function () use (&$a) { - if ($a > 0) { - return $a++; - } else { - return $a--; - } - } -); - -class AnonymousFn -{ - public function getAnonFn() - { - return array( - 'functions' => Array( - 'function1' => function ($a, $b, $c) { - $a = $b + $c; - $b = $c / 2; - return Array($a, $b, $c); - }, - ), - ); - } -} -?> - -
    - -
    -
    - -
    -
    - -
    - - "") { - $test = true; - } else { - $test = true; - } - } - ?> - - - -
    -
    -
    - -
    -
    -
    - - -

    some text

    - function ($a) { - if ($a === true) { - echo 'hi'; - } - } -]; - -$list = [ - 'fn' => function ($a) { - if ($a === true) { - echo 'hi'; - } - } -]; - -if ($foo) { - foreach ($bar as $baz) { - if ($baz) { - ?> -
    -
    -
    - 1) { - echo '1'; - } - ?> -
    - 1) { - echo '1'; - } - ?> -
    - 1) { - echo '1'; - } - ?> -
    - -<?= CHtml::encode($this->pageTitle); ?> - -expects($this->at(2)) - ->with($this->callback( - function ($subject) - { - } - ) - ); - -/** @var Database $mockedDatabase */ -/** @var Container $mockedContainer */ - -echo $string->append('foo') - ->appaend('bar') - ->appaend('baz') - ->outputUsing( - function () - { - } - ); - -echo PHP_EOL; - -switch ($arg) { - case 1: - break; - case 2: - if ($arg2 == 'foo') { - } - case 3: - default: - echo 'default'; -} - -if ($tokens[$stackPtr]['content']{0} === '#') { -} else if ($tokens[$stackPtr]['content']{0} === '/' - && $tokens[$stackPtr]['content']{1} === '/' -) { -} - -$var = call_user_func( - function() { - if ($foo) { - $new_var = function() { - if ($a > 0) { - return $a++; - } else { - return $a--; - } - }; - } - } -); - -a( - function() { - $a = function() { - $b = false; - }; - true; - } -); - -$var = [ - [ - '1' => - function () { - return true; - }, - ], - [ - '1' => - function () { - return true; - }, - '2' => true, - ] -]; - -if ($foo) { - ?> -

    - self::_replaceKeywords($failingComment, $result), - 'screenshot' => Test::getScreenshotPath( - $projectid, - $result['class_name'], - ), - ); - -} - -$this->mockedDatabase - ->with( - $this->callback( - function () { - return; - } - ) - ); - -$this->subject->recordLogin(); - -function a() -{ - if (true) { - static::$a[$b] = - static::where($c) - ->where($c) - ->where( - function ($d) { - $d->whereNull(); - $d->orWhere(); - } - ) - ->first(); - - if (static::$a[$b] === null) { - static::$a[$b] = new static( - array( - 'a' => $a->id, - 'a' => $a->id, - ) - ); - } - } - - return static::$a[$b]; -} - -$foo->load( - array( - 'bar' => function ($baz) { - $baz->call(); - } - ) -); - -hello(); - -$foo = array_unique( - array_map( - function ($entry) { - return $entry * 2; - }, - array() - ) -); -bar($foo); - -class PHP_CodeSniffer_Tokenizers_JS -{ - - public $scopeOpeners = array( - T_CASE => array( - 'end' => array( - T_BREAK => T_BREAK, - T_RETURN => T_RETURN, - ), - 'strict' => true, - ), - ); -} - -echo $string-> - append('foo')-> - appaend('bar')-> - appaend('baz')-> - outputUsing( - function () - { - } - ); - -$str = 'the items I want to show are: ' . - implode( - ', ', - array('a', 'b', 'c') - ); - -echo $str; - -$str = 'foo' - . '1' - . '2'; - -echo $str; - -bar([ - 'foo' => foo(function () { - return 'foo'; - }) -]); - -$domains = array_unique( - array_map( - function ($url) { - $urlObject = new \Purl\Url($url); - return $urlObject->registerableDomain; - }, - $sites - ) -); - -return $domains; - -if ($a == 5) : - echo "a equals 5"; - echo "..."; -elseif ($a == 6) : - echo "a equals 6"; - echo "!!!"; -else : - echo "a is neither 5 nor 6"; -endif; - -if ($foo): -if ($bar) $foo = 1; -elseif ($baz) $foo = 2; -endif; - -$this - ->method(array( - 'foo' => 'bar', - ), 'arg', array( - 'foo' => 'bar', - )); - -class Foo -{ - use Bar { - myMethod as renamedMethod; - } -} - -class Foo -{ - use Bar { - myMethod as renamedMethod; - } -} - -foo(); - -array( - 'key1' => function ($bar) { - return $bar; - }, - 'key2' => function ($foo) { - return $foo; - }, -); - -?> - - 1, - ]; -$c = 2; - -class foo -{ - public function get() - { - $foo = ['b' => 'c', - 'd' => [ - ['e' => 'f'] - ]]; - echo '42'; - - $foo = array('b' => 'c', - 'd' => array( - array('e' => 'f') - )); - echo '42'; - } -} - -switch ($foo) { - case 1: - return array(); - case 2: - return ''; - case 3: - return $function(); - case 4: - return $functionCall($param[0]); - case 5: - return array() + array(); // Array Merge - case 6: - // String connect - return $functionReturningString('') . $functionReturningString(array()); - case 7: - return functionCall( - $withMultiLineParam[0], - array(), - $functionReturningString( - $withMultiLineParam[1] - ) - ); - case 8: - return $param[0][0]; -} - -class Test { - - public - $foo - ,$bar - ,$baz = [ ] - ; - - public function wtfindent() { - } -} - -switch ($x) { - case 1: - return [1]; - default: - return [2]; -} - -switch ($foo) { - case self::FOO: - return $this->bar($gfoo, function ($id) { - return FOO::bar($id); - }, $values); - case self::BAR: - $values = $this->bar($foo, $values); - break; -} - -$var = array( - 'long description' => - array(0, 'something'), - 'another long description' => - array(1, "something else") -); - -$services = array( - 'service 1' => - Mockery::mock('class 1') - ->shouldReceive('setFilter')->once() - ->shouldReceive('getNbResults')->atLeast()->once() - ->shouldReceive('getSlice')->once()->andReturn(array()) - ->getMock(), - 'service 2' => - Mockery::mock('class 2') - ->shouldReceive('__invoke')->once() - ->getMock() -); - -class Foo -{ - public function setUp() - { - $this->foo = new class { - public $name = 'Some value'; - }; - } -} - -try { - foo(); -} catch (\Exception $e) { - $foo = function() { - return 'foo'; - }; - - if (true) { - } -} - -if ($foo) { - foo(); -} else if ($e) { - $foo = function() { - return 'foo'; - }; - - if (true) { - } -} else { - $foo = function() { - return 'foo'; - }; - - if (true) { - } -} - -switch ($parameter) { - case null: - return [ - 'foo' => in_array( - 'foo', - [] - ), - ]; - - default: - return []; -} - -class SomeClass -{ - public function someFunc() - { - a(function () { - echo "a"; - })->b(function () { - echo "b"; - }); - - if (true) { - echo "c"; - } - echo "d"; - } -} - -$params = self::validate_parameters(self::read_competency_framework_parameters(), - array( - 'id' => $id, - )); - -$framework = api::read_framework($params['id']); -self::validate_context($framework->get_context()); -$output = $PAGE->get_renderer('tool_lp'); - -class Test123 -{ - protected static - $prop1 = [ - 'testA' => 123, - ], - $prop2 = [ - 'testB' => 456, - ]; - - protected static - $prop3 = array( - 'testA' => 123, - ), - $prop4 = array( - 'testB' => 456, - ); - - protected static $prop5; -} - -$foo = foo( - function () { - $foo->debug( - $a, - $b - ); - - if ($a) { - $b = $a; - } - } -); - -if (somethingIsTrue()) { - ?> -
    - -
    - bar(foo(function () { - }), foo(function () { - })); - -echo 'foo'; - -class Test { - - public function a() { - ?>adebug( - $a, - $b - ); - - if ($a) { - $b = $a; - } - } -); - -function test() -{ - $array = []; - foreach ($array as $data) { - [ - 'key1' => $var1, - 'key2' => $var2, - ] = $data; - foreach ($var1 as $method) { - echo $method . $var2; - } - } -} - -switch ($a) { - case 0: - $a = function () { - }; - case 1: - break; -} - -class Test -{ - public function __construct() - { -if (false) { -echo 0; - } - } -} - -return [ - 'veryLongKeySoIWantToMakeALineBreak' - => 'veryLonValueSoIWantToMakeALineBreak', - - 'someOtherKey' => [ - 'someValue' - ], - - 'arrayWithArraysInThere' => [ - ['Value1', 'Value1'] - ], -]; - -switch ($sContext) { - case 'SOMETHING': - case 'CONSTANT': - do_something(); - break; - case 'GLOBAL': - case 'GLOBAL1': - do_something(); - // Fall through - default: - { - do_something(); - } -} - -array_map( - static function ( $item ) { - echo $item; - }, - $some_array -); - -/** - * Comment. - */ -$a(function () use ($app) { - echo 'hi'; -})(); - -$app->run(); - -function foo() -{ - $foo('some - long description', function () { - }); - - $foo('some - long - description', function () { - }); - - $foo( -'some long description', function () { - }); -} - -switch ( $a ) { -case 'a': - $b = 2; - /** - * A comment. - */ - apply_filter( 'something', $b ); - break; - -case 'aa': - $b = 2; - /* - * A comment. - */ - apply_filter( 'something', $b ); - break; - -case 'b': - $b = 3; -?> - - - - - -
    - -
    - -
    - -
    - - -
    - - - -
    - [ - ], - 'b' => <<<'FOO' -foo; -FOO - ], - $a, -]; - -$query = Model::query() - ->when($a, function () { - static $b = ''; - }); - -$result = array_map( - static fn(int $number) : int => $number + 1, - $numbers -); - -$a = $a === true ? [ - 'a' => 1, - ] : [ - 'a' => 100, -]; - -return [ - Url::make('View Song', fn($song) => $song->url()) - ->onlyOnDetail(), - - new Panel('Information', [ - Text::make('Title') - ]), -]; - -echo $string?->append('foo') - ?->outputUsing(); - -// phpcs:set Generic.WhiteSpace.ScopeIndent exact true -echo $string?->append('foo') - ?->outputUsing(); -// phpcs:set Generic.WhiteSpace.ScopeIndent exact false - -if (true) { - ?> null, - false => false, - 1, 2, 3 => true, - default => $value, -}; - -$value = match ($value) { - '' => null, -false => false, - 1, 2, 3 => true, - default => $value, -}; - -$value = match ( - $value - ) { - '' => null, - false - => false, - 1, - 2, - 3 => true, - default => -$value, -}; - -function toString(): string -{ - return sprintf( - '%s', - match ($type) { - 'foo' => 'bar', - }, - ); -} - -$list = [ - 'fn' => function ($a) { - if ($a === true) { - echo 'hi'; - } - }, - 'fn' => function ($a) { - if ($a === true) { - echo 'hi'; - $list2 = [ - 'fn' => function ($a) { - if ($a === true) { - echo 'hi'; - } - } - ]; - } - } -]; - -$foo = match ($type) { - 'a' => [ - 'aa' => 'DESC', - 'ab' => 'DESC', - ], - 'b' => [ - 'ba' => 'DESC', - 'bb' => 'DESC', - ], - default => [ - 'da' => 'DESC', - ], -}; - -$a = [ - 'a' => [ - 'a' => fn () => foo() - ], - 'a' => [ - 'a' => 'a', - ] -]; - -/* ADD NEW TESTS ABOVE THIS LINE AND MAKE SURE THAT THE 1 (space-based) AND 2 (tab-based) FILES ARE IN SYNC! */ -?> - - - - - - - <<<'INTRO' - lorem ipsum - INTRO, - 'em' => [ - [ - '', - ], - ], - 'abc' => [ - 'a' => 'wop wop', - 'b' => 'ola ola.', - ], -]; - -echo "" diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc.fixed deleted file mode 100644 index 5821ab7..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc.fixed +++ /dev/null @@ -1,1595 +0,0 @@ -phpcs:set Generic.WhiteSpace.ScopeIndent tabIndent true - -hello(); - } - - function hello() - { - echo 'hello'; - }//end hello() - - function hello2() - { - if (TRUE) { - echo 'hello'; // no error here as its more than 4 spaces. - } else { - echo 'bye'; - } - - while (TRUE) { - echo 'hello'; - } - - do { - echo 'hello'; - } while (TRUE); - } - - function hello3() - { - switch ($hello) { - case 'hello': - break; - } - } - -} - -?> -
    -
    -
    -validate()) {
    -	$safe = $form->getSubmitValues();
    -}
    -?>
    -
    -open(); // error here - } - - public function open() - { - // Some inline stuff that shouldn't error - if (TRUE) echo 'hello'; - foreach ($tokens as $token) echo $token; - } - - /** - * This is a comment 1. - * This is a comment 2. - * This is a comment 3. - * This is a comment 4. - */ - public function close() - { - // All ok. - if (TRUE) { - if (TRUE) { - } else if (FALSE) { - foreach ($tokens as $token) { - switch ($token) { - case '1': - case '2': - if (true) { - if (false) { - if (false) { - if (false) { - echo 'hello'; - } - } - } - } - break; - case '5': - break; - } - do { - while (true) { - foreach ($tokens as $token) { - for ($i = 0; $i < $token; $i++) { - echo 'hello'; - } - } - } - } while (true); - } - } - } - } - - /* - This is another c style comment 1. - This is another c style comment 2. - This is another c style comment 3. - This is another c style comment 4. - This is another c style comment 5. - */ - - /* This is a T_COMMENT - * - * - * - */ - - /** This is a T_DOC_COMMENT - */ - - /* - This T_COMMENT has a newline in it. - - */ - - public function read() - { - echo 'hello'; - - // no errors below. - $array = array( - 'this', - 'that' => array( - 'hello', - 'hello again' => array( - 'hello', - ), - ), - ); - } -} - -abstract class Test3 -{ - public function parse() - { - - foreach ($t as $ndx => $token) { - if (is_array($token)) { - echo 'here'; - } else { - $ts[] = array("token" => $token, "value" => ''); - - $last = count($ts) - 1; - - switch ($token) { - case '(': - - if ($last >= 3 && - $ts[0]['token'] != T_CLASS && - $ts[$last - 2]['token'] == T_OBJECT_OPERATOR && - $ts[$last - 3]['token'] == T_VARIABLE ) { - - - if (true) { - echo 'hello'; - } - } - array_push($braces, $token); - break; - } - } - } - } -} - -function test() -{ - $o = << - - - - doSomething( - function () { - echo 123; - } - ); - } -} - -some_function( - function() { - $a = 403; - if ($a === 404) { - $a = 403; - } - } -); - -some_function( - function() { - $a = 403; - if ($a === 404) { - $a = 403; - } - } -); - -$myFunction = function() { - $a = 403; - if ($a === 404) { - $a = 403; - } -}; - -class Whatever -{ - protected $_protectedArray = array( - 'normalString' => 'That email address is already in use!', - 'offendingString' => <<<'STRING' -Each line of this string is always said to be at column 0, - no matter how many spaces are placed - at the beginning of each line -and the ending STRING on the next line is reported as having to be indented. -STRING - ); -} - -class MyClass -{ - public static function myFunction() - { - if (empty($keywords) === FALSE) { - $keywords = 'foo'; - $existing = 'foo'; - } - - return $keywords; - - }//end myFunction() - -}//end class - -$var = call_user_func( - $new_var = function () use (&$a) { - if ($a > 0) { - return $a++; - } else { - return $a--; - } - } -); - -class AnonymousFn -{ - public function getAnonFn() - { - return array( - 'functions' => Array( - 'function1' => function ($a, $b, $c) { - $a = $b + $c; - $b = $c / 2; - return Array($a, $b, $c); - }, - ), - ); - } -} -?> - -
    - -
    -
    - -
    -
    - -
    - - "") { - $test = true; - } else { - $test = true; - } - } - ?> - - - -
    -
    -
    - -
    -
    -
    - - -

    some text

    - function ($a) { - if ($a === true) { - echo 'hi'; - } - } -]; - -$list = [ - 'fn' => function ($a) { - if ($a === true) { - echo 'hi'; - } - } -]; - -if ($foo) { - foreach ($bar as $baz) { - if ($baz) { - ?> -
    -
    -
    - 1) { - echo '1'; - } - ?> -
    - 1) { - echo '1'; - } - ?> -
    - 1) { - echo '1'; - } - ?> -
    - -<?= CHtml::encode($this->pageTitle); ?> - -expects($this->at(2)) - ->with($this->callback( - function ($subject) - { - } - ) - ); - -/** @var Database $mockedDatabase */ -/** @var Container $mockedContainer */ - -echo $string->append('foo') - ->appaend('bar') - ->appaend('baz') - ->outputUsing( - function () - { - } - ); - -echo PHP_EOL; - -switch ($arg) { - case 1: - break; - case 2: - if ($arg2 == 'foo') { - } - case 3: - default: - echo 'default'; -} - -if ($tokens[$stackPtr]['content']{0} === '#') { -} else if ($tokens[$stackPtr]['content']{0} === '/' - && $tokens[$stackPtr]['content']{1} === '/' -) { -} - -$var = call_user_func( - function() { - if ($foo) { - $new_var = function() { - if ($a > 0) { - return $a++; - } else { - return $a--; - } - }; - } - } -); - -a( - function() { - $a = function() { - $b = false; - }; - true; - } -); - -$var = [ - [ - '1' => - function () { - return true; - }, - ], - [ - '1' => - function () { - return true; - }, - '2' => true, - ] -]; - -if ($foo) { - ?> -

    - self::_replaceKeywords($failingComment, $result), - 'screenshot' => Test::getScreenshotPath( - $projectid, - $result['class_name'], - ), - ); - -} - -$this->mockedDatabase - ->with( - $this->callback( - function () { - return; - } - ) - ); - -$this->subject->recordLogin(); - -function a() -{ - if (true) { - static::$a[$b] = - static::where($c) - ->where($c) - ->where( - function ($d) { - $d->whereNull(); - $d->orWhere(); - } - ) - ->first(); - - if (static::$a[$b] === null) { - static::$a[$b] = new static( - array( - 'a' => $a->id, - 'a' => $a->id, - ) - ); - } - } - - return static::$a[$b]; -} - -$foo->load( - array( - 'bar' => function ($baz) { - $baz->call(); - } - ) -); - -hello(); - -$foo = array_unique( - array_map( - function ($entry) { - return $entry * 2; - }, - array() - ) -); -bar($foo); - -class PHP_CodeSniffer_Tokenizers_JS -{ - - public $scopeOpeners = array( - T_CASE => array( - 'end' => array( - T_BREAK => T_BREAK, - T_RETURN => T_RETURN, - ), - 'strict' => true, - ), - ); -} - -echo $string-> - append('foo')-> - appaend('bar')-> - appaend('baz')-> - outputUsing( - function () - { - } - ); - -$str = 'the items I want to show are: ' . - implode( - ', ', - array('a', 'b', 'c') - ); - -echo $str; - -$str = 'foo' - . '1' - . '2'; - -echo $str; - -bar([ - 'foo' => foo(function () { - return 'foo'; - }) -]); - -$domains = array_unique( - array_map( - function ($url) { - $urlObject = new \Purl\Url($url); - return $urlObject->registerableDomain; - }, - $sites - ) -); - -return $domains; - -if ($a == 5) : - echo "a equals 5"; - echo "..."; -elseif ($a == 6) : - echo "a equals 6"; - echo "!!!"; -else : - echo "a is neither 5 nor 6"; -endif; - -if ($foo): - if ($bar) $foo = 1; - elseif ($baz) $foo = 2; -endif; - -$this - ->method(array( - 'foo' => 'bar', - ), 'arg', array( - 'foo' => 'bar', - )); - -class Foo -{ - use Bar { - myMethod as renamedMethod; - } -} - -class Foo -{ - use Bar { - myMethod as renamedMethod; - } -} - -foo(); - -array( - 'key1' => function ($bar) { - return $bar; - }, - 'key2' => function ($foo) { - return $foo; - }, -); - -?> - - 1, - ]; -$c = 2; - -class foo -{ - public function get() - { - $foo = ['b' => 'c', - 'd' => [ - ['e' => 'f'] - ]]; - echo '42'; - - $foo = array('b' => 'c', - 'd' => array( - array('e' => 'f') - )); - echo '42'; - } -} - -switch ($foo) { - case 1: - return array(); - case 2: - return ''; - case 3: - return $function(); - case 4: - return $functionCall($param[0]); - case 5: - return array() + array(); // Array Merge - case 6: - // String connect - return $functionReturningString('') . $functionReturningString(array()); - case 7: - return functionCall( - $withMultiLineParam[0], - array(), - $functionReturningString( - $withMultiLineParam[1] - ) - ); - case 8: - return $param[0][0]; -} - -class Test { - - public - $foo - ,$bar - ,$baz = [ ] - ; - - public function wtfindent() { - } -} - -switch ($x) { - case 1: - return [1]; - default: - return [2]; -} - -switch ($foo) { - case self::FOO: - return $this->bar($gfoo, function ($id) { - return FOO::bar($id); - }, $values); - case self::BAR: - $values = $this->bar($foo, $values); - break; -} - -$var = array( - 'long description' => - array(0, 'something'), - 'another long description' => - array(1, "something else") -); - -$services = array( - 'service 1' => - Mockery::mock('class 1') - ->shouldReceive('setFilter')->once() - ->shouldReceive('getNbResults')->atLeast()->once() - ->shouldReceive('getSlice')->once()->andReturn(array()) - ->getMock(), - 'service 2' => - Mockery::mock('class 2') - ->shouldReceive('__invoke')->once() - ->getMock() -); - -class Foo -{ - public function setUp() - { - $this->foo = new class { - public $name = 'Some value'; - }; - } -} - -try { - foo(); -} catch (\Exception $e) { - $foo = function() { - return 'foo'; - }; - - if (true) { - } -} - -if ($foo) { - foo(); -} else if ($e) { - $foo = function() { - return 'foo'; - }; - - if (true) { - } -} else { - $foo = function() { - return 'foo'; - }; - - if (true) { - } -} - -switch ($parameter) { - case null: - return [ - 'foo' => in_array( - 'foo', - [] - ), - ]; - - default: - return []; -} - -class SomeClass -{ - public function someFunc() - { - a(function () { - echo "a"; - })->b(function () { - echo "b"; - }); - - if (true) { - echo "c"; - } - echo "d"; - } -} - -$params = self::validate_parameters(self::read_competency_framework_parameters(), - array( - 'id' => $id, - )); - -$framework = api::read_framework($params['id']); -self::validate_context($framework->get_context()); -$output = $PAGE->get_renderer('tool_lp'); - -class Test123 -{ - protected static - $prop1 = [ - 'testA' => 123, - ], - $prop2 = [ - 'testB' => 456, - ]; - - protected static - $prop3 = array( - 'testA' => 123, - ), - $prop4 = array( - 'testB' => 456, - ); - - protected static $prop5; -} - -$foo = foo( - function () { - $foo->debug( - $a, - $b - ); - - if ($a) { - $b = $a; - } - } -); - -if (somethingIsTrue()) { - ?> -
    - -
    - bar(foo(function () { - }), foo(function () { - })); - -echo 'foo'; - -class Test { - - public function a() { - ?>adebug( - $a, - $b - ); - - if ($a) { - $b = $a; - } - } -); - -function test() -{ - $array = []; - foreach ($array as $data) { - [ - 'key1' => $var1, - 'key2' => $var2, - ] = $data; - foreach ($var1 as $method) { - echo $method . $var2; - } - } -} - -switch ($a) { - case 0: - $a = function () { - }; - case 1: - break; -} - -class Test -{ - public function __construct() - { - if (false) { - echo 0; - } - } -} - -return [ - 'veryLongKeySoIWantToMakeALineBreak' - => 'veryLonValueSoIWantToMakeALineBreak', - - 'someOtherKey' => [ - 'someValue' - ], - - 'arrayWithArraysInThere' => [ - ['Value1', 'Value1'] - ], -]; - -switch ($sContext) { - case 'SOMETHING': - case 'CONSTANT': - do_something(); - break; - case 'GLOBAL': - case 'GLOBAL1': - do_something(); - // Fall through - default: - { - do_something(); - } -} - -array_map( - static function ( $item ) { - echo $item; - }, - $some_array -); - -/** - * Comment. - */ -$a(function () use ($app) { - echo 'hi'; -})(); - -$app->run(); - -function foo() -{ - $foo('some - long description', function () { - }); - - $foo('some - long - description', function () { - }); - - $foo( - 'some long description', function () { - }); -} - -switch ( $a ) { - case 'a': - $b = 2; - /** - * A comment. - */ - apply_filter( 'something', $b ); - break; - - case 'aa': - $b = 2; - /* - * A comment. - */ - apply_filter( 'something', $b ); - break; - - case 'b': - $b = 3; - ?> - - - - - -
    - -
    - -
    - -
    - - -
    - - - -
    - [ - ], - 'b' => <<<'FOO' -foo; -FOO - ], - $a, -]; - -$query = Model::query() - ->when($a, function () { - static $b = ''; - }); - -$result = array_map( - static fn(int $number) : int => $number + 1, - $numbers -); - -$a = $a === true ? [ - 'a' => 1, - ] : [ - 'a' => 100, -]; - -return [ - Url::make('View Song', fn($song) => $song->url()) - ->onlyOnDetail(), - - new Panel('Information', [ - Text::make('Title') - ]), -]; - -echo $string?->append('foo') - ?->outputUsing(); - -// phpcs:set Generic.WhiteSpace.ScopeIndent exact true -echo $string?->append('foo') - ?->outputUsing(); -// phpcs:set Generic.WhiteSpace.ScopeIndent exact false - -if (true) { - ?> null, - false => false, - 1, 2, 3 => true, - default => $value, -}; - -$value = match ($value) { - '' => null, - false => false, - 1, 2, 3 => true, - default => $value, -}; - -$value = match ( - $value - ) { - '' => null, - false - => false, - 1, - 2, - 3 => true, - default => - $value, -}; - -function toString(): string -{ - return sprintf( - '%s', - match ($type) { - 'foo' => 'bar', - }, - ); -} - -$list = [ - 'fn' => function ($a) { - if ($a === true) { - echo 'hi'; - } - }, - 'fn' => function ($a) { - if ($a === true) { - echo 'hi'; - $list2 = [ - 'fn' => function ($a) { - if ($a === true) { - echo 'hi'; - } - } - ]; - } - } -]; - -$foo = match ($type) { - 'a' => [ - 'aa' => 'DESC', - 'ab' => 'DESC', - ], - 'b' => [ - 'ba' => 'DESC', - 'bb' => 'DESC', - ], - default => [ - 'da' => 'DESC', - ], -}; - -$a = [ - 'a' => [ - 'a' => fn () => foo() - ], - 'a' => [ - 'a' => 'a', - ] -]; - -/* ADD NEW TESTS ABOVE THIS LINE AND MAKE SURE THAT THE 1 (space-based) AND 2 (tab-based) FILES ARE IN SYNC! */ -?> - - - - - - - <<<'INTRO' - lorem ipsum - INTRO, - 'em' => [ - [ - '', - ], - ], - 'abc' => [ - 'a' => 'wop wop', - 'b' => 'ola ola.', - ], -]; - -echo "" diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.3.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.3.inc deleted file mode 100644 index 55d1a06..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.3.inc +++ /dev/null @@ -1,28 +0,0 @@ -phpcs:set Generic.WhiteSpace.ScopeIndent tabIndent false -phpcs:set Generic.WhiteSpace.ScopeIndent exact true - $enabled, - 'compression' => $compression, - ] = $options; -} - -$this->foo() - ->bar() - ->baz(); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.3.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.3.inc.fixed deleted file mode 100644 index e9ae5ff..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.3.inc.fixed +++ /dev/null @@ -1,28 +0,0 @@ -phpcs:set Generic.WhiteSpace.ScopeIndent tabIndent false -phpcs:set Generic.WhiteSpace.ScopeIndent exact true - $enabled, - 'compression' => $compression, - ] = $options; -} - -$this->foo() - ->bar() - ->baz(); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.4.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.4.inc deleted file mode 100644 index e58dc4d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.4.inc +++ /dev/null @@ -1,6 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ScopeIndentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Get a list of CLI values to set before the file is tested. - * - * @param string $testFile The name of the file being tested. - * @param \PHP_CodeSniffer\Config $config The config data for the test run. - * - * @return void - */ - public function setCliValues($testFile, $config) - { - // Tab width setting is only needed for the tabbed file. - if ($testFile === 'ScopeIndentUnitTest.2.inc') { - $config->tabWidth = 4; - } else { - $config->tabWidth = 0; - } - - }//end setCliValues() - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='ScopeIndentUnitTest.inc') - { - if ($testFile === 'ScopeIndentUnitTest.1.js') { - return [ - 6 => 1, - 14 => 1, - 21 => 1, - 30 => 1, - 32 => 1, - 33 => 1, - 34 => 1, - 39 => 1, - 42 => 1, - 59 => 1, - 60 => 1, - 75 => 1, - 120 => 1, - 121 => 1, - 122 => 1, - 123 => 1, - 141 => 1, - 142 => 1, - 155 => 1, - 156 => 1, - 168 => 1, - 184 => 1, - ]; - }//end if - - if ($testFile === 'ScopeIndentUnitTest.3.inc') { - return [ - 6 => 1, - 7 => 1, - 10 => 1, - ]; - } - - if ($testFile === 'ScopeIndentUnitTest.4.inc') { - return []; - } - - return [ - 7 => 1, - 10 => 1, - 13 => 1, - 17 => 1, - 20 => 1, - 24 => 1, - 25 => 1, - 27 => 1, - 28 => 1, - 29 => 1, - 30 => 1, - 58 => 1, - 123 => 1, - 224 => 1, - 225 => 1, - 279 => 1, - 280 => 1, - 281 => 1, - 282 => 1, - 283 => 1, - 284 => 1, - 285 => 1, - 286 => 1, - 336 => 1, - 349 => 1, - 380 => 1, - 386 => 1, - 387 => 1, - 388 => 1, - 389 => 1, - 390 => 1, - 397 => 1, - 419 => 1, - 420 => 1, - 465 => 1, - 467 => 1, - 472 => 1, - 473 => 1, - 474 => 1, - 496 => 1, - 498 => 1, - 500 => 1, - 524 => 1, - 526 => 1, - 544 => 1, - 545 => 1, - 546 => 1, - 639 => 1, - 660 => 1, - 662 => 1, - 802 => 1, - 803 => 1, - 823 => 1, - 858 => 1, - 879 => 1, - 1163 => 1, - 1197 => 1, - 1198 => 1, - 1259 => 1, - 1264 => 1, - 1265 => 1, - 1266 => 1, - 1269 => 1, - 1272 => 1, - 1273 => 1, - 1274 => 1, - 1275 => 1, - 1276 => 1, - 1277 => 1, - 1280 => 1, - 1281 => 1, - 1282 => 1, - 1284 => 1, - 1285 => 1, - 1288 => 1, - 1289 => 1, - 1290 => 1, - 1292 => 1, - 1293 => 1, - 1310 => 1, - 1312 => 1, - 1327 => 1, - 1328 => 1, - 1329 => 1, - 1330 => 1, - 1331 => 1, - 1332 => 1, - 1335 => 1, - 1340 => 1, - 1342 => 1, - 1345 => 1, - 1488 => 1, - 1489 => 1, - 1500 => 1, - 1503 => 1, - 1518 => 1, - 1520 => 1, - 1527 => 1, - 1529 => 1, - 1530 => 1, - 1567 => 1, - 1568 => 1, - 1569 => 1, - 1570 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/SpreadOperatorSpacingAfterUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/SpreadOperatorSpacingAfterUnitTest.inc deleted file mode 100644 index edce4dc..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/SpreadOperatorSpacingAfterUnitTest.inc +++ /dev/null @@ -1,73 +0,0 @@ - - * @copyright 2019 Juliette Reinders Folmer. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class SpreadOperatorSpacingAfterUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 12 => 1, - 13 => 1, - 20 => 2, - 40 => 1, - 41 => 1, - 46 => 2, - 60 => 1, - 61 => 1, - 66 => 2, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/ruleset.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/ruleset.xml deleted file mode 100644 index 728426e..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/ruleset.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - A collection of generic sniffs. This standard is not designed to be used to check code. - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/CSS/BrowserSpecificStylesSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/CSS/BrowserSpecificStylesSniff.php deleted file mode 100644 index 9575398..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/CSS/BrowserSpecificStylesSniff.php +++ /dev/null @@ -1,87 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Sniffs\CSS; - -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Files\File; - -class BrowserSpecificStylesSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['CSS']; - - /** - * A list of specific stylesheet suffixes we allow. - * - * These stylesheets contain browser specific styles - * so this sniff ignore them files in the form: - * *_moz.css and *_ie7.css etc. - * - * @var array - */ - protected $specificStylesheets = [ - 'moz' => true, - 'ie' => true, - 'ie7' => true, - 'ie8' => true, - 'webkit' => true, - ]; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return int[] - */ - public function register() - { - return [T_STYLE]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - // Ignore files with browser-specific suffixes. - $filename = $phpcsFile->getFilename(); - $breakChar = strrpos($filename, '_'); - if ($breakChar !== false && substr($filename, -4) === '.css') { - $specific = substr($filename, ($breakChar + 1), -4); - if (isset($this->specificStylesheets[$specific]) === true) { - return; - } - } - - $tokens = $phpcsFile->getTokens(); - $content = $tokens[$stackPtr]['content']; - - if ($content[0] === '-') { - $error = 'Browser-specific styles are not allowed'; - $phpcsFile->addError($error, $stackPtr, 'ForbiddenStyle'); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/DisallowSelfActionsSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/DisallowSelfActionsSniff.php deleted file mode 100644 index 81b7f1b..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/DisallowSelfActionsSniff.php +++ /dev/null @@ -1,125 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Channels; - -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Util\Tokens; - -class DisallowSelfActionsSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_CLASS]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // We are not interested in abstract classes. - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); - if ($prev !== false && $tokens[$prev]['code'] === T_ABSTRACT) { - return; - } - - // We are only interested in Action classes. - $classNameToken = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - $className = $tokens[$classNameToken]['content']; - if (substr($className, -7) !== 'Actions') { - return; - } - - $foundFunctions = []; - $foundCalls = []; - - // Find all static method calls in the form self::method() in the class. - $classEnd = $tokens[$stackPtr]['scope_closer']; - for ($i = ($classNameToken + 1); $i < $classEnd; $i++) { - if ($tokens[$i]['code'] !== T_DOUBLE_COLON) { - if ($tokens[$i]['code'] === T_FUNCTION) { - // Cache the function information. - $funcName = $phpcsFile->findNext(T_STRING, ($i + 1)); - $funcScope = $phpcsFile->findPrevious(Tokens::$scopeModifiers, ($i - 1)); - - $foundFunctions[$tokens[$funcName]['content']] = strtolower($tokens[$funcScope]['content']); - } - - continue; - } - - $prevToken = $phpcsFile->findPrevious(T_WHITESPACE, ($i - 1), null, true); - if ($tokens[$prevToken]['content'] !== 'self' - && $tokens[$prevToken]['content'] !== 'static' - ) { - continue; - } - - $funcNameToken = $phpcsFile->findNext(T_WHITESPACE, ($i + 1), null, true); - if ($tokens[$funcNameToken]['code'] === T_VARIABLE) { - // We are only interested in function calls. - continue; - } - - $funcName = $tokens[$funcNameToken]['content']; - - // We've found the function, now we need to find it and see if it is - // public, private or protected. If it starts with an underscore we - // can assume it is private. - if ($funcName[0] === '_') { - continue; - } - - $foundCalls[$i] = [ - 'name' => $funcName, - 'type' => strtolower($tokens[$prevToken]['content']), - ]; - }//end for - - $errorClassName = substr($className, 0, -7); - - foreach ($foundCalls as $token => $funcData) { - if (isset($foundFunctions[$funcData['name']]) === false) { - // Function was not in this class, might have come from the parent. - // Either way, we can't really check this. - continue; - } else if ($foundFunctions[$funcData['name']] === 'public') { - $type = $funcData['type']; - $error = "Static calls to public methods in Action classes must not use the $type keyword; use %s::%s() instead"; - $data = [ - $errorClassName, - $funcName, - ]; - $phpcsFile->addError($error, $token, 'Found'.ucfirst($funcData['type']), $data); - } - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/IncludeOwnSystemSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/IncludeOwnSystemSniff.php deleted file mode 100644 index 2d56261..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/IncludeOwnSystemSniff.php +++ /dev/null @@ -1,98 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Channels; - -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Files\File; - -class IncludeOwnSystemSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_DOUBLE_COLON]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $fileName = $phpcsFile->getFilename(); - $matches = []; - if (preg_match('|/systems/(.*)/([^/]+)?actions.inc$|i', $fileName, $matches) === 0) { - // Not an actions file. - return; - } - - $ownClass = $matches[2]; - $tokens = $phpcsFile->getTokens(); - - $typeName = $phpcsFile->findNext(T_CONSTANT_ENCAPSED_STRING, ($stackPtr + 2), null, false, true); - $typeName = trim($tokens[$typeName]['content'], " '"); - switch (strtolower($tokens[($stackPtr + 1)]['content'])) { - case 'includesystem' : - $included = strtolower($typeName); - break; - case 'includeasset' : - $included = strtolower($typeName).'assettype'; - break; - case 'includewidget' : - $included = strtolower($typeName).'widgettype'; - break; - default: - return; - } - - if ($included === strtolower($ownClass)) { - $error = "You do not need to include \"%s\" from within the system's own actions file"; - $data = [$ownClass]; - $phpcsFile->addError($error, $stackPtr, 'NotRequired', $data); - } - - }//end process() - - - /** - * Determines the included class name from given token. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param array $tokens The array of file tokens. - * @param int $stackPtr The position in the tokens array of the - * potentially included class. - * - * @return string - */ - protected function getIncludedClassFromToken( - $phpcsFile, - array $tokens, - $stackPtr - ) { - - return false; - - }//end getIncludedClassFromToken() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/IncludeSystemSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/IncludeSystemSniff.php deleted file mode 100644 index 8bbd91e..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/IncludeSystemSniff.php +++ /dev/null @@ -1,314 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Channels; - -use PHP_CodeSniffer\Sniffs\AbstractScopeSniff; -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Util\Tokens; - -class IncludeSystemSniff extends AbstractScopeSniff -{ - - /** - * A list of classes that don't need to be included. - * - * @var string[] - */ - private $ignore = [ - 'self' => true, - 'static' => true, - 'parent' => true, - 'channels' => true, - 'basesystem' => true, - 'dal' => true, - 'init' => true, - 'pdo' => true, - 'util' => true, - 'ziparchive' => true, - 'phpunit_framework_assert' => true, - 'abstractmysourceunittest' => true, - 'abstractdatacleanunittest' => true, - 'exception' => true, - 'abstractwidgetwidgettype' => true, - 'domdocument' => true, - ]; - - - /** - * Constructs an AbstractScopeSniff. - */ - public function __construct() - { - parent::__construct([T_FUNCTION], [T_DOUBLE_COLON, T_EXTENDS], true); - - }//end __construct() - - - /** - * Processes the function tokens within the class. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param integer $stackPtr The position where the token was found. - * @param integer $currScope The current scope opener token. - * - * @return void - */ - protected function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScope) - { - $tokens = $phpcsFile->getTokens(); - - // Determine the name of the class that the static function - // is being called on. - $classNameToken = $phpcsFile->findPrevious( - T_WHITESPACE, - ($stackPtr - 1), - null, - true - ); - - // Don't process class names represented by variables as this can be - // an inexact science. - if ($tokens[$classNameToken]['code'] === T_VARIABLE) { - return; - } - - $className = $tokens[$classNameToken]['content']; - if (isset($this->ignore[strtolower($className)]) === true) { - return; - } - - $includedClasses = []; - - $fileName = strtolower($phpcsFile->getFilename()); - $matches = []; - if (preg_match('|/systems/(.*)/([^/]+)?actions.inc$|', $fileName, $matches) !== 0) { - // This is an actions file, which means we don't - // have to include the system in which it exists. - $includedClasses[$matches[2]] = true; - - // Or a system it implements. - $class = $phpcsFile->getCondition($stackPtr, T_CLASS); - $implements = $phpcsFile->findNext(T_IMPLEMENTS, $class, ($class + 10)); - if ($implements !== false) { - $implementsClass = $phpcsFile->findNext(T_STRING, $implements); - $implementsClassName = strtolower($tokens[$implementsClass]['content']); - if (substr($implementsClassName, -7) === 'actions') { - $includedClasses[substr($implementsClassName, 0, -7)] = true; - } - } - } - - // Go searching for includeSystem and includeAsset calls within this - // function, or the inclusion of .inc files, which - // would be library files. - for ($i = ($currScope + 1); $i < $stackPtr; $i++) { - $name = $this->getIncludedClassFromToken($phpcsFile, $tokens, $i); - if ($name !== false) { - $includedClasses[$name] = true; - // Special case for Widgets cause they are, well, special. - } else if (strtolower($tokens[$i]['content']) === 'includewidget') { - $typeName = $phpcsFile->findNext(T_CONSTANT_ENCAPSED_STRING, ($i + 1)); - $typeName = trim($tokens[$typeName]['content'], " '"); - $includedClasses[strtolower($typeName).'widgettype'] = true; - } - } - - // Now go searching for includeSystem, includeAsset or require/include - // calls outside our scope. If we are in a class, look outside the - // class. If we are not, look outside the function. - $condPtr = $currScope; - if ($phpcsFile->hasCondition($stackPtr, T_CLASS) === true) { - foreach ($tokens[$stackPtr]['conditions'] as $condPtr => $condType) { - if ($condType === T_CLASS) { - break; - } - } - } - - for ($i = 0; $i < $condPtr; $i++) { - // Skip other scopes. - if (isset($tokens[$i]['scope_closer']) === true) { - $i = $tokens[$i]['scope_closer']; - continue; - } - - $name = $this->getIncludedClassFromToken($phpcsFile, $tokens, $i); - if ($name !== false) { - $includedClasses[$name] = true; - } - } - - // If we are in a testing class, we might have also included - // some systems and classes in our setUp() method. - $setupFunction = null; - if ($phpcsFile->hasCondition($stackPtr, T_CLASS) === true) { - foreach ($tokens[$stackPtr]['conditions'] as $condPtr => $condType) { - if ($condType === T_CLASS) { - // Is this is a testing class? - $name = $phpcsFile->findNext(T_STRING, $condPtr); - $name = $tokens[$name]['content']; - if (substr($name, -8) === 'UnitTest') { - // Look for a method called setUp(). - $end = $tokens[$condPtr]['scope_closer']; - $function = $phpcsFile->findNext(T_FUNCTION, ($condPtr + 1), $end); - while ($function !== false) { - $name = $phpcsFile->findNext(T_STRING, $function); - if ($tokens[$name]['content'] === 'setUp') { - $setupFunction = $function; - break; - } - - $function = $phpcsFile->findNext(T_FUNCTION, ($function + 1), $end); - } - } - } - }//end foreach - }//end if - - if ($setupFunction !== null) { - $start = ($tokens[$setupFunction]['scope_opener'] + 1); - $end = $tokens[$setupFunction]['scope_closer']; - for ($i = $start; $i < $end; $i++) { - $name = $this->getIncludedClassFromToken($phpcsFile, $tokens, $i); - if ($name !== false) { - $includedClasses[$name] = true; - } - } - }//end if - - if (isset($includedClasses[strtolower($className)]) === false) { - $error = 'Static method called on non-included class or system "%s"; include system with Channels::includeSystem() or include class with require_once'; - $data = [$className]; - $phpcsFile->addError($error, $stackPtr, 'NotIncludedCall', $data); - } - - }//end processTokenWithinScope() - - - /** - * Processes a token within the scope that this test is listening to. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * this token was found. - * - * @return void - */ - protected function processTokenOutsideScope(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if ($tokens[$stackPtr]['code'] === T_EXTENDS) { - // Find the class name. - $classNameToken = $phpcsFile->findNext(T_STRING, ($stackPtr + 1)); - $className = $tokens[$classNameToken]['content']; - } else { - // Determine the name of the class that the static function - // is being called on. But don't process class names represented by - // variables as this can be an inexact science. - $classNameToken = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); - if ($tokens[$classNameToken]['code'] === T_VARIABLE) { - return; - } - - $className = $tokens[$classNameToken]['content']; - } - - // Some systems are always available. - if (isset($this->ignore[strtolower($className)]) === true) { - return; - } - - $includedClasses = []; - - $fileName = strtolower($phpcsFile->getFilename()); - $matches = []; - if (preg_match('|/systems/([^/]+)/([^/]+)?actions.inc$|', $fileName, $matches) !== 0) { - // This is an actions file, which means we don't - // have to include the system in which it exists - // We know the system from the path. - $includedClasses[$matches[1]] = true; - } - - // Go searching for includeSystem, includeAsset or require/include - // calls outside our scope. - for ($i = 0; $i < $stackPtr; $i++) { - // Skip classes and functions as will we never get - // into their scopes when including this file, although - // we have a chance of getting into IF, WHILE etc. - if (($tokens[$i]['code'] === T_CLASS - || $tokens[$i]['code'] === T_INTERFACE - || $tokens[$i]['code'] === T_FUNCTION) - && isset($tokens[$i]['scope_closer']) === true - ) { - $i = $tokens[$i]['scope_closer']; - continue; - } - - $name = $this->getIncludedClassFromToken($phpcsFile, $tokens, $i); - if ($name !== false) { - $includedClasses[$name] = true; - // Special case for Widgets cause they are, well, special. - } else if (strtolower($tokens[$i]['content']) === 'includewidget') { - $typeName = $phpcsFile->findNext(T_CONSTANT_ENCAPSED_STRING, ($i + 1)); - $typeName = trim($tokens[$typeName]['content'], " '"); - $includedClasses[strtolower($typeName).'widgettype'] = true; - } - }//end for - - if (isset($includedClasses[strtolower($className)]) === false) { - if ($tokens[$stackPtr]['code'] === T_EXTENDS) { - $error = 'Class extends non-included class or system "%s"; include system with Channels::includeSystem() or include class with require_once'; - $data = [$className]; - $phpcsFile->addError($error, $stackPtr, 'NotIncludedExtends', $data); - } else { - $error = 'Static method called on non-included class or system "%s"; include system with Channels::includeSystem() or include class with require_once'; - $data = [$className]; - $phpcsFile->addError($error, $stackPtr, 'NotIncludedCall', $data); - } - } - - }//end processTokenOutsideScope() - - - /** - * Determines the included class name from given token. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param array $tokens The array of file tokens. - * @param int $stackPtr The position in the tokens array of the - * potentially included class. - * - * @return string - */ - protected function getIncludedClassFromToken(File $phpcsFile, array $tokens, $stackPtr) - { - if (strtolower($tokens[$stackPtr]['content']) === 'includesystem') { - $systemName = $phpcsFile->findNext(T_CONSTANT_ENCAPSED_STRING, ($stackPtr + 1)); - $systemName = trim($tokens[$systemName]['content'], " '"); - return strtolower($systemName); - } else if (strtolower($tokens[$stackPtr]['content']) === 'includeasset') { - $typeName = $phpcsFile->findNext(T_CONSTANT_ENCAPSED_STRING, ($stackPtr + 1)); - $typeName = trim($tokens[$typeName]['content'], " '"); - return strtolower($typeName).'assettype'; - } else if (isset(Tokens::$includeTokens[$tokens[$stackPtr]['code']]) === true) { - $filePath = $phpcsFile->findNext(T_CONSTANT_ENCAPSED_STRING, ($stackPtr + 1)); - $filePath = $tokens[$filePath]['content']; - $filePath = trim($filePath, " '"); - $filePath = basename($filePath, '.inc'); - return strtolower($filePath); - } - - return false; - - }//end getIncludedClassFromToken() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/UnusedSystemSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/UnusedSystemSniff.php deleted file mode 100644 index 6b10cd3..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/UnusedSystemSniff.php +++ /dev/null @@ -1,141 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Channels; - -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Files\File; - -class UnusedSystemSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_DOUBLE_COLON]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Check if this is a call to includeSystem, includeAsset or includeWidget. - $methodName = strtolower($tokens[($stackPtr + 1)]['content']); - if ($methodName === 'includesystem' - || $methodName === 'includeasset' - || $methodName === 'includewidget' - ) { - $systemName = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 3), null, true); - if ($systemName === false || $tokens[$systemName]['code'] !== T_CONSTANT_ENCAPSED_STRING) { - // Must be using a variable instead of a specific system name. - // We can't accurately check that. - return; - } - - $systemName = trim($tokens[$systemName]['content'], " '"); - } else { - return; - } - - if ($methodName === 'includeasset') { - $systemName .= 'assettype'; - } else if ($methodName === 'includewidget') { - $systemName .= 'widgettype'; - } - - $systemName = strtolower($systemName); - - // Now check if this system is used anywhere in this scope. - $level = $tokens[$stackPtr]['level']; - for ($i = ($stackPtr + 1); $i < $phpcsFile->numTokens; $i++) { - if ($tokens[$i]['level'] < $level) { - // We have gone out of scope. - // If the original include was inside an IF statement that - // is checking if the system exists, check the outer scope - // as well. - if ($tokens[$stackPtr]['level'] === $level) { - // We are still in the base level, so this is the first - // time we have got here. - $conditions = array_keys($tokens[$stackPtr]['conditions']); - if (empty($conditions) === false) { - $cond = array_pop($conditions); - if ($tokens[$cond]['code'] === T_IF) { - $i = $tokens[$cond]['scope_closer']; - $level--; - continue; - } - } - } - - break; - }//end if - - if ($tokens[$i]['code'] !== T_DOUBLE_COLON - && $tokens[$i]['code'] !== T_EXTENDS - && $tokens[$i]['code'] !== T_IMPLEMENTS - ) { - continue; - } - - switch ($tokens[$i]['code']) { - case T_DOUBLE_COLON: - $usedName = strtolower($tokens[($i - 1)]['content']); - if ($usedName === $systemName) { - // The included system was used, so it is fine. - return; - } - break; - case T_EXTENDS: - $classNameToken = $phpcsFile->findNext(T_STRING, ($i + 1)); - $className = strtolower($tokens[$classNameToken]['content']); - if ($className === $systemName) { - // The included system was used, so it is fine. - return; - } - break; - case T_IMPLEMENTS: - $endImplements = $phpcsFile->findNext([T_EXTENDS, T_OPEN_CURLY_BRACKET], ($i + 1)); - for ($x = ($i + 1); $x < $endImplements; $x++) { - if ($tokens[$x]['code'] === T_STRING) { - $className = strtolower($tokens[$x]['content']); - if ($className === $systemName) { - // The included system was used, so it is fine. - return; - } - } - } - break; - }//end switch - }//end for - - // If we get to here, the system was not use. - $error = 'Included system "%s" is never used'; - $data = [$systemName]; - $phpcsFile->addError($error, $stackPtr, 'Found', $data); - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Commenting/FunctionCommentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Commenting/FunctionCommentSniff.php deleted file mode 100644 index fd75bcb..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Commenting/FunctionCommentSniff.php +++ /dev/null @@ -1,84 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Commenting; - -use PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\FunctionCommentSniff as SquizFunctionCommentSniff; -use PHP_CodeSniffer\Util\Tokens; -use PHP_CodeSniffer\Files\File; - -class FunctionCommentSniff extends SquizFunctionCommentSniff -{ - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - parent::process($phpcsFile, $stackPtr); - - $tokens = $phpcsFile->getTokens(); - $find = Tokens::$methodPrefixes; - $find[] = T_WHITESPACE; - - $commentEnd = $phpcsFile->findPrevious($find, ($stackPtr - 1), null, true); - if ($tokens[$commentEnd]['code'] !== T_DOC_COMMENT_CLOSE_TAG) { - return; - } - - $commentStart = $tokens[$commentEnd]['comment_opener']; - $hasApiTag = false; - foreach ($tokens[$commentStart]['comment_tags'] as $tag) { - if ($tokens[$tag]['content'] === '@api') { - if ($hasApiTag === true) { - // We've come across an API tag already, which means - // we were not the first tag in the API list. - $error = 'The @api tag must come first in the @api tag list in a function comment'; - $phpcsFile->addError($error, $tag, 'ApiNotFirst'); - } - - $hasApiTag = true; - - // There needs to be a blank line before the @api tag. - $prev = $phpcsFile->findPrevious([T_DOC_COMMENT_STRING, T_DOC_COMMENT_TAG], ($tag - 1)); - if ($tokens[$prev]['line'] !== ($tokens[$tag]['line'] - 2)) { - $error = 'There must be one blank line before the @api tag in a function comment'; - $phpcsFile->addError($error, $tag, 'ApiSpacing'); - } - } else if (substr($tokens[$tag]['content'], 0, 5) === '@api-') { - $hasApiTag = true; - - $prev = $phpcsFile->findPrevious([T_DOC_COMMENT_STRING, T_DOC_COMMENT_TAG], ($tag - 1)); - if ($tokens[$prev]['line'] !== ($tokens[$tag]['line'] - 1)) { - $error = 'There must be no blank line before the @%s tag in a function comment'; - $data = [$tokens[$tag]['content']]; - $phpcsFile->addError($error, $tag, 'ApiTagSpacing', $data); - } - }//end if - }//end foreach - - if ($hasApiTag === true && substr($tokens[$tag]['content'], 0, 4) !== '@api') { - // API tags must be the last tags in a function comment. - $error = 'The @api tags must be the last tags in a function comment'; - $phpcsFile->addError($error, $commentEnd, 'ApiNotLast'); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Debug/DebugCodeSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Debug/DebugCodeSniff.php deleted file mode 100644 index eccf6fe..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Debug/DebugCodeSniff.php +++ /dev/null @@ -1,55 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Debug; - -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Files\File; - -class DebugCodeSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_DOUBLE_COLON]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $className = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); - if (strtolower($tokens[$className]['content']) === 'debug') { - $method = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - $error = 'Call to debug function Debug::%s() must be removed'; - $data = [$tokens[$method]['content']]; - $phpcsFile->addError($error, $stackPtr, 'Found', $data); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Debug/FirebugConsoleSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Debug/FirebugConsoleSniff.php deleted file mode 100644 index 3115bac..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Debug/FirebugConsoleSniff.php +++ /dev/null @@ -1,64 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Debug; - -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Files\File; - -class FirebugConsoleSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['JS']; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_STRING, - T_PROPERTY, - T_LABEL, - T_OBJECT, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (strtolower($tokens[$stackPtr]['content']) === 'console') { - $error = 'Variables, functions and labels must not be named "console"; name may conflict with Firebug internal variable'; - $phpcsFile->addError($error, $stackPtr, 'ConflictFound'); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/AssignThisSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/AssignThisSniff.php deleted file mode 100644 index 0a3c9cf..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/AssignThisSniff.php +++ /dev/null @@ -1,81 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Objects; - -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Files\File; - -class AssignThisSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['JS']; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_THIS]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Ignore this.something and other uses of "this" that are not - // direct assignments. - $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($tokens[$next]['code'] !== T_SEMICOLON) { - if ($tokens[$next]['line'] === $tokens[$stackPtr]['line']) { - return; - } - } - - // Something must be assigned to "this". - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); - if ($tokens[$prev]['code'] !== T_EQUAL) { - return; - } - - // A variable needs to be assigned to "this". - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($prev - 1), null, true); - if ($tokens[$prev]['code'] !== T_STRING) { - return; - } - - // We can only assign "this" to a var called "self". - if ($tokens[$prev]['content'] !== 'self' && $tokens[$prev]['content'] !== '_self') { - $error = 'Keyword "this" can only be assigned to a variable called "self" or "_self"'; - $phpcsFile->addError($error, $prev, 'NotSelf'); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/CreateWidgetTypeCallbackSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/CreateWidgetTypeCallbackSniff.php deleted file mode 100644 index 8fb8937..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/CreateWidgetTypeCallbackSniff.php +++ /dev/null @@ -1,218 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Objects; - -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Util\Tokens; - -class CreateWidgetTypeCallbackSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['JS']; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_OBJECT]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $className = $phpcsFile->findPrevious(T_STRING, ($stackPtr - 1)); - if (substr(strtolower($tokens[$className]['content']), -10) !== 'widgettype') { - return; - } - - // Search for a create method. - $create = $phpcsFile->findNext(T_PROPERTY, $stackPtr, $tokens[$stackPtr]['bracket_closer'], null, 'create'); - if ($create === false) { - return; - } - - $function = $phpcsFile->findNext([T_WHITESPACE, T_COLON], ($create + 1), null, true); - if ($tokens[$function]['code'] !== T_FUNCTION - && $tokens[$function]['code'] !== T_CLOSURE - ) { - return; - } - - $start = ($tokens[$function]['scope_opener'] + 1); - $end = ($tokens[$function]['scope_closer'] - 1); - - // Check that the first argument is called "callback". - $arg = $phpcsFile->findNext(T_WHITESPACE, ($tokens[$function]['parenthesis_opener'] + 1), null, true); - if ($tokens[$arg]['content'] !== 'callback') { - $error = 'The first argument of the create() method of a widget type must be called "callback"'; - $phpcsFile->addError($error, $arg, 'FirstArgNotCallback'); - } - - /* - Look for return statements within the function. They cannot return - anything and must be preceded by the callback.call() line. The - callback itself must contain "self" or "this" as the first argument - and there needs to be a call to the callback function somewhere - in the create method. All calls to the callback function must be - followed by a return statement or the end of the method. - */ - - $foundCallback = false; - $passedCallback = false; - $nestedFunction = null; - for ($i = $start; $i <= $end; $i++) { - // Keep track of nested functions. - if ($nestedFunction !== null) { - if ($i === $nestedFunction) { - $nestedFunction = null; - continue; - } - } else if (($tokens[$i]['code'] === T_FUNCTION - || $tokens[$i]['code'] === T_CLOSURE) - && isset($tokens[$i]['scope_closer']) === true - ) { - $nestedFunction = $tokens[$i]['scope_closer']; - continue; - } - - if ($nestedFunction === null && $tokens[$i]['code'] === T_RETURN) { - // Make sure return statements are not returning anything. - if ($tokens[($i + 1)]['code'] !== T_SEMICOLON) { - $error = 'The create() method of a widget type must not return a value'; - $phpcsFile->addError($error, $i, 'ReturnValue'); - } - - continue; - } else if ($tokens[$i]['code'] !== T_STRING - || $tokens[$i]['content'] !== 'callback' - ) { - continue; - } - - // If this is the form "callback.call(" then it is a call - // to the callback function. - if ($tokens[($i + 1)]['code'] !== T_OBJECT_OPERATOR - || $tokens[($i + 2)]['content'] !== 'call' - || $tokens[($i + 3)]['code'] !== T_OPEN_PARENTHESIS - ) { - // One last chance; this might be the callback function - // being passed to another function, like this - // "this.init(something, callback, something)". - if (isset($tokens[$i]['nested_parenthesis']) === false) { - continue; - } - - // Just make sure those brackets don't belong to anyone, - // like an IF or FOR statement. - foreach ($tokens[$i]['nested_parenthesis'] as $bracket) { - if (isset($tokens[$bracket]['parenthesis_owner']) === true) { - continue(2); - } - } - - // Note that we use this endBracket down further when checking - // for a RETURN statement. - $nestedParens = $tokens[$i]['nested_parenthesis']; - $endBracket = end($nestedParens); - $bracket = key($nestedParens); - - $prev = $phpcsFile->findPrevious( - Tokens::$emptyTokens, - ($bracket - 1), - null, - true - ); - - if ($tokens[$prev]['code'] !== T_STRING) { - // This is not a function passing the callback. - continue; - } - - $passedCallback = true; - }//end if - - $foundCallback = true; - - if ($passedCallback === false) { - // The first argument must be "this" or "self". - $arg = $phpcsFile->findNext(T_WHITESPACE, ($i + 4), null, true); - if ($tokens[$arg]['content'] !== 'this' - && $tokens[$arg]['content'] !== 'self' - ) { - $error = 'The first argument passed to the callback function must be "this" or "self"'; - $phpcsFile->addError($error, $arg, 'FirstArgNotSelf'); - } - } - - // Now it must be followed by a return statement or the end of the function. - if ($passedCallback === false) { - $endBracket = $tokens[($i + 3)]['parenthesis_closer']; - } - - for ($next = $endBracket; $next <= $end; $next++) { - // Skip whitespace so we find the next content after the call. - if (isset(Tokens::$emptyTokens[$tokens[$next]['code']]) === true) { - continue; - } - - // Skip closing braces like END IF because it is not executable code. - if ($tokens[$next]['code'] === T_CLOSE_CURLY_BRACKET) { - continue; - } - - // We don't care about anything on the current line, like a - // semicolon. It doesn't matter if there are other statements on the - // line because another sniff will check for those. - if ($tokens[$next]['line'] === $tokens[$endBracket]['line']) { - continue; - } - - break; - } - - if ($next !== $tokens[$function]['scope_closer'] - && $tokens[$next]['code'] !== T_RETURN - ) { - $error = 'The call to the callback function must be followed by a return statement if it is not the last statement in the create() method'; - $phpcsFile->addError($error, $i, 'NoReturn'); - } - }//end for - - if ($foundCallback === false) { - $error = 'The create() method of a widget type must call the callback function'; - $phpcsFile->addError($error, $create, 'CallbackNotCalled'); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/DisallowNewWidgetSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/DisallowNewWidgetSniff.php deleted file mode 100644 index cae7c08..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/DisallowNewWidgetSniff.php +++ /dev/null @@ -1,59 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Objects; - -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Files\File; - -class DisallowNewWidgetSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_NEW]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $className = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($tokens[$className]['code'] !== T_STRING) { - return; - } - - if (substr(strtolower($tokens[$className]['content']), -10) === 'widgettype') { - $widgetType = substr($tokens[$className]['content'], 0, -10); - $error = 'Manual creation of widget objects is banned; use Widget::getWidget(\'%s\'); instead'; - $data = [$widgetType]; - $phpcsFile->addError($error, $stackPtr, 'Found', $data); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/AjaxNullComparisonSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/AjaxNullComparisonSniff.php deleted file mode 100644 index 3914b7b..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/AjaxNullComparisonSniff.php +++ /dev/null @@ -1,103 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Sniffs\PHP; - -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Files\File; - -class AjaxNullComparisonSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_FUNCTION]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Make sure it is an API function. We know this by the doc comment. - $commentEnd = $phpcsFile->findPrevious(T_DOC_COMMENT_CLOSE_TAG, $stackPtr); - $commentStart = $phpcsFile->findPrevious(T_DOC_COMMENT_OPEN_TAG, ($commentEnd - 1)); - // If function doesn't contain any doc comments - skip it. - if ($commentEnd === false || $commentStart === false) { - return; - } - - $comment = $phpcsFile->getTokensAsString($commentStart, ($commentEnd - $commentStart)); - if (strpos($comment, '* @api') === false) { - return; - } - - // Find all the vars passed in as we are only interested in comparisons - // to NULL for these specific variables. - $foundVars = []; - $open = $tokens[$stackPtr]['parenthesis_opener']; - $close = $tokens[$stackPtr]['parenthesis_closer']; - for ($i = ($open + 1); $i < $close; $i++) { - if ($tokens[$i]['code'] === T_VARIABLE) { - $foundVars[$tokens[$i]['content']] = true; - } - } - - if (empty($foundVars) === true) { - return; - } - - $start = $tokens[$stackPtr]['scope_opener']; - $end = $tokens[$stackPtr]['scope_closer']; - for ($i = ($start + 1); $i < $end; $i++) { - if ($tokens[$i]['code'] !== T_VARIABLE - || isset($foundVars[$tokens[$i]['content']]) === false - ) { - continue; - } - - $operator = $phpcsFile->findNext(T_WHITESPACE, ($i + 1), null, true); - if ($tokens[$operator]['code'] !== T_IS_IDENTICAL - && $tokens[$operator]['code'] !== T_IS_NOT_IDENTICAL - ) { - continue; - } - - $nullValue = $phpcsFile->findNext(T_WHITESPACE, ($operator + 1), null, true); - if ($tokens[$nullValue]['code'] !== T_NULL) { - continue; - } - - $error = 'Values submitted via Ajax requests should not be compared directly to NULL; use empty() instead'; - $phpcsFile->addWarning($error, $nullValue, 'Found'); - }//end for - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/EvalObjectFactorySniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/EvalObjectFactorySniff.php deleted file mode 100644 index 67b3572..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/EvalObjectFactorySniff.php +++ /dev/null @@ -1,114 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Sniffs\PHP; - -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Util\Tokens; - -class EvalObjectFactorySniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_EVAL]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - /* - We need to find all strings that will be in the eval - to determine if the "new" keyword is being used. - */ - - $openBracket = $phpcsFile->findNext(T_OPEN_PARENTHESIS, ($stackPtr + 1)); - $closeBracket = $tokens[$openBracket]['parenthesis_closer']; - - $strings = []; - $vars = []; - - for ($i = ($openBracket + 1); $i < $closeBracket; $i++) { - if (isset(Tokens::$stringTokens[$tokens[$i]['code']]) === true) { - $strings[$i] = $tokens[$i]['content']; - } else if ($tokens[$i]['code'] === T_VARIABLE) { - $vars[$i] = $tokens[$i]['content']; - } - } - - /* - We now have some variables that we need to expand into - the strings that were assigned to them, if any. - */ - - foreach ($vars as $varPtr => $varName) { - while (($prev = $phpcsFile->findPrevious(T_VARIABLE, ($varPtr - 1))) !== false) { - // Make sure this is an assignment of the variable. That means - // it will be the first thing on the line. - $prevContent = $phpcsFile->findPrevious(T_WHITESPACE, ($prev - 1), null, true); - if ($tokens[$prevContent]['line'] === $tokens[$prev]['line']) { - $varPtr = $prevContent; - continue; - } - - if ($tokens[$prev]['content'] !== $varName) { - // This variable has a different name. - $varPtr = $prevContent; - continue; - } - - // We found one. - break; - }//end while - - if ($prev !== false) { - // Find all strings on the line. - $lineEnd = $phpcsFile->findNext(T_SEMICOLON, ($prev + 1)); - for ($i = ($prev + 1); $i < $lineEnd; $i++) { - if (isset(Tokens::$stringTokens[$tokens[$i]['code']]) === true) { - $strings[$i] = $tokens[$i]['content']; - } - } - } - }//end foreach - - foreach ($strings as $string) { - // If the string has "new" in it, it is not allowed. - // We don't bother checking if the word "new" is printed to screen - // because that is unlikely to happen. We assume the use - // of "new" is for object instantiation. - if (strstr($string, ' new ') !== false) { - $error = 'Do not use eval() to create objects dynamically; use reflection instead'; - $phpcsFile->addWarning($error, $stackPtr, 'Found'); - } - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/GetRequestDataSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/GetRequestDataSniff.php deleted file mode 100644 index 82419fc..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/GetRequestDataSniff.php +++ /dev/null @@ -1,106 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Sniffs\PHP; - -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Files\File; - -class GetRequestDataSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_VARIABLE]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $varName = $tokens[$stackPtr]['content']; - if ($varName !== '$_REQUEST' - && $varName !== '$_GET' - && $varName !== '$_POST' - && $varName !== '$_FILES' - ) { - return; - } - - // The only place these super globals can be accessed directly is - // in the getRequestData() method of the Security class. - $inClass = false; - foreach ($tokens[$stackPtr]['conditions'] as $i => $type) { - if ($tokens[$i]['code'] === T_CLASS) { - $className = $phpcsFile->findNext(T_STRING, $i); - $className = $tokens[$className]['content']; - if (strtolower($className) === 'security') { - $inClass = true; - } else { - // We don't have nested classes. - break; - } - } else if ($inClass === true && $tokens[$i]['code'] === T_FUNCTION) { - $funcName = $phpcsFile->findNext(T_STRING, $i); - $funcName = $tokens[$funcName]['content']; - if (strtolower($funcName) === 'getrequestdata') { - // This is valid. - return; - } else { - // We don't have nested functions. - break; - } - }//end if - }//end foreach - - // If we get to here, the super global was used incorrectly. - // First find out how it is being used. - $globalName = strtolower(substr($varName, 2)); - $usedVar = ''; - - $openBracket = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($tokens[$openBracket]['code'] === T_OPEN_SQUARE_BRACKET) { - $closeBracket = $tokens[$openBracket]['bracket_closer']; - $usedVar = $phpcsFile->getTokensAsString(($openBracket + 1), ($closeBracket - $openBracket - 1)); - } - - $type = 'SuperglobalAccessed'; - $error = 'The %s super global must not be accessed directly; use Security::getRequestData('; - $data = [$varName]; - if ($usedVar !== '') { - $type .= 'WithVar'; - $error .= '%s, \'%s\''; - $data[] = $usedVar; - $data[] = $globalName; - } - - $error .= ') instead'; - $phpcsFile->addError($error, $stackPtr, $type, $data); - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/ReturnFunctionValueSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/ReturnFunctionValueSniff.php deleted file mode 100644 index 9b2029a..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/ReturnFunctionValueSniff.php +++ /dev/null @@ -1,63 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Sniffs\PHP; - -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Files\File; - -class ReturnFunctionValueSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_RETURN]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $functionName = $phpcsFile->findNext(T_STRING, ($stackPtr + 1), null, false, null, true); - - while ($functionName !== false) { - // Check if this is really a function. - $bracket = $phpcsFile->findNext(T_WHITESPACE, ($functionName + 1), null, true); - if ($tokens[$bracket]['code'] !== T_OPEN_PARENTHESIS) { - // Not a function call. - $functionName = $phpcsFile->findNext(T_STRING, ($functionName + 1), null, false, null, true); - continue; - } - - $error = 'The result of a function call should be assigned to a variable before being returned'; - $phpcsFile->addWarning($error, $stackPtr, 'NotAssigned'); - break; - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Strings/JoinStringsSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Strings/JoinStringsSniff.php deleted file mode 100644 index 311cf68..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Strings/JoinStringsSniff.php +++ /dev/null @@ -1,76 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Strings; - -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Util\Tokens; - -class JoinStringsSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['JS']; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_STRING]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param integer $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if ($tokens[$stackPtr]['content'] !== 'join') { - return; - } - - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if ($tokens[$prev]['code'] !== T_OBJECT_OPERATOR) { - return; - } - - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prev - 1), null, true); - if ($tokens[$prev]['code'] === T_CLOSE_SQUARE_BRACKET) { - $opener = $tokens[$prev]['bracket_opener']; - if ($tokens[($opener - 1)]['code'] !== T_STRING) { - // This means the array is declared inline, like x = [a,b,c].join() - // and not elsewhere, like x = y[a].join() - // The first is not allowed while the second is. - $error = 'Joining strings using inline arrays is not allowed; use the + operator instead'; - $phpcsFile->addError($error, $stackPtr, 'ArrayNotAllowed'); - } - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/CSS/BrowserSpecificStylesUnitTest.css b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/CSS/BrowserSpecificStylesUnitTest.css deleted file mode 100644 index 339ee15..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/CSS/BrowserSpecificStylesUnitTest.css +++ /dev/null @@ -1,13 +0,0 @@ -.SettingsTabPaneWidgetType-tab-mid { - background: transparent url(tab_inact_mid.png) repeat-x; - line-height: -25px; - cursor: pointer; - -moz-user-select: none; -} - -.AssetLineageWidgetType-item { - float: left; - list-style: none; - height: 22px; - cursor: pointer; -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/CSS/BrowserSpecificStylesUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/CSS/BrowserSpecificStylesUnitTest.php deleted file mode 100644 index 2135349..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/CSS/BrowserSpecificStylesUnitTest.php +++ /dev/null @@ -1,48 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Tests\CSS; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class BrowserSpecificStylesUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [5 => 1]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/DisallowSelfActionsUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/DisallowSelfActionsUnitTest.inc deleted file mode 100644 index 95fd04b..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/DisallowSelfActionsUnitTest.inc +++ /dev/null @@ -1,51 +0,0 @@ - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/DisallowSelfActionsUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/DisallowSelfActionsUnitTest.php deleted file mode 100644 index d29bf5c..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/DisallowSelfActionsUnitTest.php +++ /dev/null @@ -1,53 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Tests\Channels; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class DisallowSelfActionsUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 12 => 1, - 13 => 1, - 28 => 1, - 29 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/IncludeSystemUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/IncludeSystemUnitTest.inc deleted file mode 100644 index ccb0273..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/IncludeSystemUnitTest.inc +++ /dev/null @@ -1,112 +0,0 @@ -fetch(PDO::FETCH_NUM) -BaseSystem::getDataDir(); -Util::getArrayIndex(array(), ''); - - -Channels::includeSystem('Widget'); -Widget::includeWidget('AbstractContainer'); -class MyWidget extends AbstractContainerWidgetType {} -class MyOtherWidget extends BookWidgetType {} - -$zip = new ZipArchive(); -$res = $zip->open($path, ZipArchive::CREATE); - -class AssetListingUnitTest extends AbstractMySourceUnitTest -{ - function setUp() { - parent::setUp(); - Channels::includeSystem('MySystem2'); - include_once 'Libs/FileSystem.inc'; - } - - function two() { - $siteid = MySystem2::getCurrentSiteId(); - $parserFiles = FileSystem::listDirectory(); - } - - function three() { - $siteid = MySystem3::getCurrentSiteId(); - $parserFiles = FileSystem::listDirectory(); - } -} - -if (Channels::systemExists('Log') === TRUE) { - Channels::includeSystem('Log'); -} else { - return; -} - -Log::addProjectLog('metadata.field.update', $msg); - -function two() { - Widget::includeWidget('CacheAdminScreen'); - $barChart = CacheAdminScreenWidgetType::constructBarchart($data); -} - -$adjustDialog->setOrientation(AbstractWidgetWidgetType::CENTER); - -$className = 'SquizPerspective'.ucfirst($property['type']).'PropertyType'; -Channels::includeSystem($className); -$className::setValue($assetid, $propertyid, $perspectives, $value, (array) $property['settings']); -?> diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/IncludeSystemUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/IncludeSystemUnitTest.php deleted file mode 100644 index 0320038..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/IncludeSystemUnitTest.php +++ /dev/null @@ -1,60 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Tests\Channels; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class IncludeSystemUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 9 => 1, - 14 => 1, - 24 => 1, - 27 => 1, - 28 => 1, - 31 => 1, - 36 => 1, - 41 => 1, - 61 => 1, - 70 => 1, - 89 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/UnusedSystemUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/UnusedSystemUnitTest.inc deleted file mode 100644 index c7bd473..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/UnusedSystemUnitTest.inc +++ /dev/null @@ -1,67 +0,0 @@ - \ No newline at end of file diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/UnusedSystemUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/UnusedSystemUnitTest.php deleted file mode 100644 index fbc0ac7..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/UnusedSystemUnitTest.php +++ /dev/null @@ -1,55 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Tests\Channels; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class UnusedSystemUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 2 => 1, - 5 => 1, - 8 => 1, - 24 => 1, - 34 => 1, - 54 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Commenting/FunctionCommentUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Commenting/FunctionCommentUnitTest.inc deleted file mode 100644 index 19d5c5d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Commenting/FunctionCommentUnitTest.inc +++ /dev/null @@ -1,101 +0,0 @@ - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Commenting/FunctionCommentUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Commenting/FunctionCommentUnitTest.php deleted file mode 100644 index 5cc43b6..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Commenting/FunctionCommentUnitTest.php +++ /dev/null @@ -1,54 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Tests\Commenting; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class FunctionCommentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 28 => 1, - 36 => 1, - 37 => 2, - 49 => 1, - 58 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/DebugCodeUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/DebugCodeUnitTest.inc deleted file mode 100644 index 3490161..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/DebugCodeUnitTest.inc +++ /dev/null @@ -1,4 +0,0 @@ - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/DebugCodeUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/DebugCodeUnitTest.php deleted file mode 100644 index 78da9c9..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/DebugCodeUnitTest.php +++ /dev/null @@ -1,51 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Tests\Debug; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class DebugCodeUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 2 => 1, - 3 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/FirebugConsoleUnitTest.js b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/FirebugConsoleUnitTest.js deleted file mode 100644 index d5e3df5..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/FirebugConsoleUnitTest.js +++ /dev/null @@ -1,8 +0,0 @@ -console.info(); -console.warn(); -console.test(); -con.sole(); -var console = { - console: 'string'; -}; -function console() {} \ No newline at end of file diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/FirebugConsoleUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/FirebugConsoleUnitTest.php deleted file mode 100644 index 3a9c235..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/FirebugConsoleUnitTest.php +++ /dev/null @@ -1,61 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Tests\Debug; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class FirebugConsoleUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='FirebugConsoleUnitTest.js') - { - if ($testFile !== 'FirebugConsoleUnitTest.js') { - return []; - } - - return [ - 1 => 1, - 2 => 1, - 3 => 1, - 5 => 1, - 6 => 1, - 8 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/AssignThisUnitTest.js b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/AssignThisUnitTest.js deleted file mode 100644 index 747a100..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/AssignThisUnitTest.js +++ /dev/null @@ -1,20 +0,0 @@ -var self = this; -buttonWidget.addClickEvent(function() { - self.addDynamicSouce(); -}); - -var x = self; -var y = this; - -var test = ''; -if (true) { - test = this -} - -var itemid = this.items[i].getAttribute('itemid'); - -for (var x = this; y < 10; y++) { - var x = this + 1; -} - -var _self = this; \ No newline at end of file diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/AssignThisUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/AssignThisUnitTest.php deleted file mode 100644 index f28dff1..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/AssignThisUnitTest.php +++ /dev/null @@ -1,58 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Tests\Objects; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class AssignThisUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='AssignThisUnitTest.js') - { - if ($testFile !== 'AssignThisUnitTest.js') { - return []; - } - - return [ - 7 => 1, - 11 => 1, - 16 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/CreateWidgetTypeCallbackUnitTest.js b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/CreateWidgetTypeCallbackUnitTest.js deleted file mode 100644 index 22822d3..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/CreateWidgetTypeCallbackUnitTest.js +++ /dev/null @@ -1,186 +0,0 @@ -SampleWidgetType.prototype = { - - create: function(callback) - { - if (x === 1) { - return; - } - - if (y === 1) { - callback.call(this); - // A comment here to explain the return is okay. - return; - } - - if (a === 1) { - // Cant return value even after calling callback. - callback.call(this); - return something; - } - - if (a === 1) { - // Need to pass self or this to callback function. - callback.call(a); - } - - callback.call(self); - - var self = this; - this.createChildren(null, function() { - callback.call(self, div); - }); - - // Never good to return a value. - return something; - - callback.call(self); - } - -}; - -AnotherSampleWidgetType.prototype = { - - create: function(input) - { - return; - } - - getSomething: function(input) - { - return 1; - } - -}; - - -NoCreateWidgetType.prototype = { - - getSomething: function(input) - { - return; - } - -}; - - -SomeRandom.prototype = { - - create: function(input) - { - return; - } - -}; - -SampleWidgetType.prototype = { - - create: function(callback) - { - if (a === 1) { - // This is ok because it is the last statement, - // even though it is conditional. - callback.call(self); - } - - } - -}; - -SampleWidgetType.prototype = { - - create: function(callback) - { - var something = callback; - - } - -}; - -SampleWidgetType.prototype = { - - create: function(callback) - { - // Also valid because we are passing the callback to - // someone else to call. - if (y === 1) { - this.something(callback); - return; - } - - this.init(callback); - - } - -}; - -SampleWidgetType.prototype = { - - create: function(callback) - { - // Also valid because we are passing the callback to - // someone else to call. - if (y === 1) { - this.something(callback); - } - - this.init(callback); - - } - -}; - -SampleWidgetType.prototype = { - - create: function(callback) - { - if (a === 1) { - // This is ok because it is the last statement, - // even though it is conditional. - this.something(callback); - } - - } - -}; - - -SampleWidgetType.prototype = { - - create: function(callback) - { - if (dfx.isFn(callback) === true) { - callback.call(this, cont); - return; - } - } - -}; - - -SampleWidgetType.prototype = { - - create: function(callback) - { - dfx.foreach(items, function(item) { - return true; - }); - - if (dfx.isFn(callback) === true) { - callback.call(this); - } - } - -}; - -SampleWidgetType.prototype = { - - create: function(callback) - { - var self = this; - this.createChildren(null, function() { - callback.call(self, div); - return; - }); - } - -}; \ No newline at end of file diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/CreateWidgetTypeCallbackUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/CreateWidgetTypeCallbackUnitTest.php deleted file mode 100644 index a3c55bf..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/CreateWidgetTypeCallbackUnitTest.php +++ /dev/null @@ -1,59 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Tests\Objects; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class CreateWidgetTypeCallbackUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='CreateWidgetTypeCallbackUnitTest.js') - { - return [ - 18 => 1, - 23 => 2, - 26 => 1, - 30 => 1, - 34 => 1, - 43 => 2, - 91 => 1, - 123 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/DisallowNewWidgetUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/DisallowNewWidgetUnitTest.inc deleted file mode 100644 index acf9baf..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/DisallowNewWidgetUnitTest.inc +++ /dev/null @@ -1,6 +0,0 @@ - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/DisallowNewWidgetUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/DisallowNewWidgetUnitTest.php deleted file mode 100644 index 333952f..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/DisallowNewWidgetUnitTest.php +++ /dev/null @@ -1,48 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Tests\Objects; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class DisallowNewWidgetUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [4 => 1]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/AjaxNullComparisonUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/AjaxNullComparisonUnitTest.inc deleted file mode 100644 index 337914a..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/AjaxNullComparisonUnitTest.inc +++ /dev/null @@ -1,182 +0,0 @@ -getMessage()); - }//end try - - if ($something === NULL) { - if ($bar !== NULL) { - } - } - - return $issueid; - -}//end addIssue() - -/** - * Adds a new issue. - * - * Returns the new issue id. - * - * @param string $title Title of the new issue. - * @param string $description The description of the issue. - * @param string $reporter Asset id of the reporter. - * @param integer $projectid Id of the project that the issue belongs to. - * @param array $tags Array of tags. - * @param string $status The status of the issue. - * @param string $assignedTo The asset id of the user that the issue is - * assigned to. - * @param string $reportedDate If set then this date will be used instead of the - * current date and time. - * @param integer $reportedMilestone Reported milestone. - * - * @return integer - * @throws ChannelException If there is an error. - * - */ -public static function addIssue( - $title, - $description, - $reporter=NULL, - $projectid=NULL, - array $tags=array(), - $status=NULL, - $assignedTo=NULL, - $reportedDate=NULL, - $reportedMilestone=NULL -) { - // Get current projectid if not specified. - if ($projectid === NULL) { - Channels::includeSystem('Project'); - $projectid = Project::getCurrentProjectId(); - Channels::modifyBasket('project', $projectid); - } - -}//end addIssue() diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/AjaxNullComparisonUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/AjaxNullComparisonUnitTest.php deleted file mode 100644 index 315808b..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/AjaxNullComparisonUnitTest.php +++ /dev/null @@ -1,55 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class AjaxNullComparisonUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return []; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return [ - 41 => 1, - 53 => 1, - 64 => 1, - 77 => 1, - 92 => 1, - 122 => 1, - ]; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/EvalObjectFactoryUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/EvalObjectFactoryUnitTest.inc deleted file mode 100644 index 992a7dc..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/EvalObjectFactoryUnitTest.inc +++ /dev/null @@ -1,26 +0,0 @@ - \ No newline at end of file diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/EvalObjectFactoryUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/EvalObjectFactoryUnitTest.php deleted file mode 100644 index 423f242..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/EvalObjectFactoryUnitTest.php +++ /dev/null @@ -1,52 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class EvalObjectFactoryUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return []; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return [ - 4 => 1, - 12 => 1, - 21 => 1, - ]; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/GetRequestDataUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/GetRequestDataUnitTest.inc deleted file mode 100644 index 7999763..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/GetRequestDataUnitTest.inc +++ /dev/null @@ -1,30 +0,0 @@ - \ No newline at end of file diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/GetRequestDataUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/GetRequestDataUnitTest.php deleted file mode 100644 index 16e4cfb..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/GetRequestDataUnitTest.php +++ /dev/null @@ -1,56 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class GetRequestDataUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 2 => 1, - 5 => 1, - 8 => 1, - 21 => 1, - 26 => 1, - 27 => 1, - 28 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/ReturnFunctionValueUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/ReturnFunctionValueUnitTest.inc deleted file mode 100644 index f9148a7..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/ReturnFunctionValueUnitTest.inc +++ /dev/null @@ -1,9 +0,0 @@ -myFunction(); -return $obj->variable; -return MyClass::VARIABLE; -return $variable; -return ($var + 1); -?> \ No newline at end of file diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/ReturnFunctionValueUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/ReturnFunctionValueUnitTest.php deleted file mode 100644 index 3236378..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/ReturnFunctionValueUnitTest.php +++ /dev/null @@ -1,52 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ReturnFunctionValueUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return []; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return [ - 2 => 1, - 3 => 1, - 4 => 1, - ]; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Strings/JoinStringsUnitTest.js b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Strings/JoinStringsUnitTest.js deleted file mode 100644 index 46d90cf..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Strings/JoinStringsUnitTest.js +++ /dev/null @@ -1,18 +0,0 @@ -one = (1 + 2); -two = (one + 2); -two = (one + one); -three = ('1' + 2); - -four = ['1', two].join(); -four = ['1', two].join(''); -four = ['1', [one, two].join(',')].join(' '); -four = ['1', [one, two].join()].join(' '); -four = ['1', [one, two].join()].join(); - -five = 'string' + ['1', [one, two].join()].join() + 'string'; - -six = myArray.join(' '); -six = [arrayOne, arrayTwo].join(); - -// This is fine because the array is not created inline. -var x = 'x' + test[x].join('p') + 't'; \ No newline at end of file diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Strings/JoinStringsUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Strings/JoinStringsUnitTest.php deleted file mode 100644 index ecd490a..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Strings/JoinStringsUnitTest.php +++ /dev/null @@ -1,62 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Tests\Strings; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class JoinStringsUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='JoinStringsUnitTest.js') - { - if ($testFile !== 'JoinStringsUnitTest.js') { - return []; - } - - return [ - 6 => 1, - 7 => 1, - 8 => 2, - 9 => 2, - 10 => 2, - 12 => 2, - 15 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/ruleset.xml b/vendor/squizlabs/php_codesniffer/src/Standards/MySource/ruleset.xml deleted file mode 100644 index 9240795..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/MySource/ruleset.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - The MySource coding standard builds on the Squiz coding standard. Currently used for MySource Mini development. - - */Tests/* - */Oven/* - */data/* - */jquery.js - */jquery.*.js - */viper/* - DALConf.inc - - - - - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Classes/ClassDeclarationStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Classes/ClassDeclarationStandard.xml deleted file mode 100644 index b5d53fd..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Classes/ClassDeclarationStandard.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - { -} - ]]> - - - { -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Commenting/ClassCommentStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Commenting/ClassCommentStandard.xml deleted file mode 100644 index fe81620..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Commenting/ClassCommentStandard.xml +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - /** - * The Foo class. - */ -class Foo -{ -} - ]]> - - - - - - - - /** - * The Foo class. - */ -class Foo -{ -} - ]]> - - - - - - - - /** - * The Foo class. - */ -class Foo -{ -} - ]]> - - - /** - * The Foo class. - */ - -class Foo -{ -} - ]]> - - - - - The Foo class. - */ -class Foo -{ -} - ]]> - - - The Foo class. - */ -class Foo -{ -} - ]]> - - - - - - * A helper for the Bar class. - * - * @see Bar - */ -class Foo -{ -} - ]]> - - - - * - * A helper for the Bar class. - * - * - * @see Bar - */ -class Foo -{ -} - ]]> - - - - - - * @see Bar - */ -class Foo -{ -} - ]]> - - - - * - * @see Bar - */ -class Foo -{ -} - ]]> - - - - - Release: 1.0 - */ -class Foo -{ -} - ]]> - - - 1.0 - */ -class Foo -{ -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Commenting/FileCommentStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Commenting/FileCommentStandard.xml deleted file mode 100644 index eef0b4e..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Commenting/FileCommentStandard.xml +++ /dev/null @@ -1,286 +0,0 @@ - - - - - - - /** - * Short description here. - * - * PHP version 5 - * - * @category Foo - * @package Foo_Helpers - * @author Marty McFly - * @copyright 2013-2014 Foo Inc. - * @license MIT License - * @link http://example.com - */ - ]]> - - - - ]]> - - - - - Short description here. - * - * PHP version 5 - * - * @category Foo - * @package Foo_Helpers - * @author Marty McFly - * @copyright 2013-2014 Foo Inc. - * @license MIT License - * @link http://example.com - */ - ]]> - - - - * Short description here. - * - * PHP version 5 - * - * @category Foo - * @package Foo_Helpers - * @author Marty McFly - * @copyright 2013-2014 Foo Inc. - * @license MIT License - * @link http://example.com - */ - ]]> - - - - - - * PHP version 5 - * - * @category Foo - * @package Foo_Helpers - * @author Marty McFly - * @copyright 2013-2014 Foo Inc. - * @license MIT License - * @link http://example.com - */ - ]]> - - - - * - * PHP version 5 - * - * - * @category Foo - * @package Foo_Helpers - * @author Marty McFly - * @copyright 2013-2014 Foo Inc. - * @license MIT License - * @link http://example.com - */ - ]]> - - - - - - * @category Foo - * @package Foo_Helpers - * @author Marty McFly - * @copyright 2013-2014 Foo Inc. - * @license MIT License - * @link http://example.com - */ - ]]> - - - - * - * @category Foo - * @package Foo_Helpers - * @author Marty McFly - * @copyright 2013-2014 Foo Inc. - * @license MIT License - * @link http://example.com - */ - ]]> - - - - - @category Foo - * @package Foo_Helpers - * @author Marty McFly - * @copyright 2013-2014 Foo Inc. - * @license MIT License - * @link http://example.com - */ - ]]> - - - - - - - - @category Foo - * @package Foo_Helpers - * @author Marty McFly - * @copyright 2013-2014 Foo Inc. - * @license MIT License - * @link http://example.com - */ - ]]> - - - @category Foo - * @category Bar - * @package Foo_Helpers - * @author Marty McFly - * @copyright 2013-2014 Foo Inc. - * @license MIT License - * @link http://example.com - */ - ]]> - - - - - PHP version 5 - * - * @category Foo - * @package Foo_Helpers - * @author Marty McFly - * @copyright 2013-2014 Foo Inc. - * @license MIT License - * @link http://example.com - */ - ]]> - - - @package Foo_Helpers - * @category Foo - * @author Marty McFly - * @copyright 2013-2014 Foo Inc. - * @license MIT License - * @link http://example.com - */ - ]]> - - - - - - * @copyright 2013-2014 Foo Inc. - * @license MIT License - * @link http://example.com - */ - ]]> - - - - * @copyright 2013-2014 Foo Inc. - * @license MIT License - * @link http://example.com - */ - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Commenting/FunctionCommentStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Commenting/FunctionCommentStandard.xml deleted file mode 100644 index 621649f..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Commenting/FunctionCommentStandard.xml +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - /** - * Short description here. - * - * @return void - */ - function foo() - { - } - ]]> - - - - - - - - Short description here. - * - * @return void - */ - function foo() - { - } - ]]> - - - - * Short description here. - * - * @return void - */ - function foo() - { - } - ]]> - - - - - - * Long description here. - * - * @return void - */ - function foo() - { - } - ]]> - - - - * - * Long description here. - * - * - * @return void - */ - function foo() - { - } - ]]> - - - - - - * @return void - */ - function foo() - { - } - ]]> - - - - * - * @return void - */ - function foo() - { - } - ]]> - - - - - FooException - */ - function foo() - { - } - ]]> - - - @throws - */ - function foo() - { - } - ]]> - - - - - @return void - */ - function foo() - { - } - ]]> - - - - - - - - $foo Foo parameter - * @param string $bar Bar parameter - * @return void - */ - function foo($foo, $bar) - { - } - ]]> - - - $qux Bar parameter - * @return void - */ - function foo($foo, $bar) - { - } - ]]> - - - - - $foo Foo parameter - * @param string $bar Bar parameter - * @return void - */ - function foo($foo, $bar) - { - } - ]]> - - - $bar Bar parameter - * @param string $foo Foo parameter - * @return void - */ - function foo($foo, $bar) - { - } - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Commenting/InlineCommentStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Commenting/InlineCommentStandard.xml deleted file mode 100644 index 53056e2..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Commenting/InlineCommentStandard.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - // A comment. - ]]> - - - # A comment. - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/ControlStructures/ControlSignatureStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/ControlStructures/ControlSignatureStandard.xml deleted file mode 100644 index ce430fb..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/ControlStructures/ControlSignatureStandard.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - ($foo) { -} - ]]> - - - ($foo){ -} - ]]> - - - - - { -} - ]]> - - - { -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/ControlStructures/MultiLineConditionStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/ControlStructures/MultiLineConditionStandard.xml deleted file mode 100644 index 96d451d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/ControlStructures/MultiLineConditionStandard.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - && $bar -) { -} - ]]> - - - && $bar -) { -} - ]]> - - - - - && $bar -) { -} - ]]> - - - && - $bar -) { -} - ]]> - - - - - ) { -} - ]]> - - - ) { -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Files/IncludingFileStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Files/IncludingFileStandard.xml deleted file mode 100644 index 6d115be..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Files/IncludingFileStandard.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - require_once. Anywhere you are conditionally including a class file (for example, factory methods), use include_once. Either of these will ensure that class files are included only once. They share the same file list, so you don't need to worry about mixing them - a file included with require_once will not be included again by include_once. - ]]> - - - include_once and require_once are statements, not functions. Parentheses should not surround the subject filename. - ]]> - - - - - - - ('PHP/CodeSniffer.php'); - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Files/LineLengthStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Files/LineLengthStandard.xml deleted file mode 100644 index e4911ef..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Files/LineLengthStandard.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Formatting/MultiLineAssignmentStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Formatting/MultiLineAssignmentStandard.xml deleted file mode 100644 index e825c55..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Formatting/MultiLineAssignmentStandard.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - = $bar; - ]]> - - - = - $bar; - ]]> - - - - - = $bar; - ]]> - - - = $bar; - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Functions/FunctionCallSignatureStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Functions/FunctionCallSignatureStandard.xml deleted file mode 100644 index f874227..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Functions/FunctionCallSignatureStandard.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - ( $bar, $baz, $quux ) ; - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Functions/FunctionDeclarationStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Functions/FunctionDeclarationStandard.xml deleted file mode 100644 index ced9ae2..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Functions/FunctionDeclarationStandard.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - () use ($bar) { -}; - ]]> - - - ()use($bar){ -}; - ]]> - - - - - $bar, - $baz -) { -}; - ]]> - - - $bar, -$baz) -{ -}; - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Functions/ValidDefaultValueStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Functions/ValidDefaultValueStandard.xml deleted file mode 100644 index 56196cb..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Functions/ValidDefaultValueStandard.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - $persistent = false) -{ - ... -} - ]]> - - - $persistent = false, $dsn) -{ - ... -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/NamingConventions/ValidClassNameStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/NamingConventions/ValidClassNameStandard.xml deleted file mode 100644 index d160879..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/NamingConventions/ValidClassNameStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/NamingConventions/ValidFunctionNameStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/NamingConventions/ValidFunctionNameStandard.xml deleted file mode 100644 index 60841dd..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/NamingConventions/ValidFunctionNameStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/NamingConventions/ValidVariableNameStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/NamingConventions/ValidVariableNameStandard.xml deleted file mode 100644 index 4c707bd..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/NamingConventions/ValidVariableNameStandard.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - publicVar; - protected $protectedVar; - private $_privateVar; -} - ]]> - - - _publicVar; - protected $_protectedVar; - private $privateVar; -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/WhiteSpace/ObjectOperatorIndentStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/WhiteSpace/ObjectOperatorIndentStandard.xml deleted file mode 100644 index 9dee905..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/WhiteSpace/ObjectOperatorIndentStandard.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - ->bar() - ->baz(); - ]]> - - - -> - bar()-> - baz(); - ]]> - - - - - ->bar() - ->baz(); - ]]> - - - ->bar() -->baz(); - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/WhiteSpace/ScopeClosingBraceStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/WhiteSpace/ScopeClosingBraceStandard.xml deleted file mode 100644 index c8d6e27..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/WhiteSpace/ScopeClosingBraceStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - } - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/WhiteSpace/ScopeIndentStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/WhiteSpace/ScopeIndentStandard.xml deleted file mode 100644 index fafa07a..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/WhiteSpace/ScopeIndentStandard.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - if ($test) { - $var = 1; - } -} - ]]> - - - if ($test) { -$var = 1; -} -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Classes/ClassDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Classes/ClassDeclarationSniff.php deleted file mode 100644 index a5b07a9..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Classes/ClassDeclarationSniff.php +++ /dev/null @@ -1,149 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\Classes; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class ClassDeclarationSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_CLASS, - T_INTERFACE, - T_TRAIT, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param integer $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $errorData = [strtolower($tokens[$stackPtr]['content'])]; - - if (isset($tokens[$stackPtr]['scope_opener']) === false) { - $error = 'Possible parse error: %s missing opening or closing brace'; - $phpcsFile->addWarning($error, $stackPtr, 'MissingBrace', $errorData); - return; - } - - $curlyBrace = $tokens[$stackPtr]['scope_opener']; - $lastContent = $phpcsFile->findPrevious(T_WHITESPACE, ($curlyBrace - 1), $stackPtr, true); - $classLine = $tokens[$lastContent]['line']; - $braceLine = $tokens[$curlyBrace]['line']; - if ($braceLine === $classLine) { - $phpcsFile->recordMetric($stackPtr, 'Class opening brace placement', 'same line'); - $error = 'Opening brace of a %s must be on the line after the definition'; - $fix = $phpcsFile->addFixableError($error, $curlyBrace, 'OpenBraceNewLine', $errorData); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - if ($tokens[($curlyBrace - 1)]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->replaceToken(($curlyBrace - 1), ''); - } - - $phpcsFile->fixer->addNewlineBefore($curlyBrace); - $phpcsFile->fixer->endChangeset(); - } - - return; - } else { - $phpcsFile->recordMetric($stackPtr, 'Class opening brace placement', 'new line'); - - if ($braceLine > ($classLine + 1)) { - $error = 'Opening brace of a %s must be on the line following the %s declaration; found %s line(s)'; - $data = [ - $tokens[$stackPtr]['content'], - $tokens[$stackPtr]['content'], - ($braceLine - $classLine - 1), - ]; - $fix = $phpcsFile->addFixableError($error, $curlyBrace, 'OpenBraceWrongLine', $data); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($curlyBrace - 1); $i > $lastContent; $i--) { - if ($tokens[$i]['line'] === ($tokens[$curlyBrace]['line'] + 1)) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - - return; - }//end if - }//end if - - if ($tokens[($curlyBrace + 1)]['content'] !== $phpcsFile->eolChar) { - $error = 'Opening %s brace must be on a line by itself'; - - $nextNonWhitespace = $phpcsFile->findNext(T_WHITESPACE, ($curlyBrace + 1), null, true); - if ($tokens[$nextNonWhitespace]['code'] === T_PHPCS_IGNORE) { - // Don't auto-fix if the next thing is a PHPCS ignore annotation. - $phpcsFile->addError($error, $curlyBrace, 'OpenBraceNotAlone', $errorData); - } else { - $fix = $phpcsFile->addFixableError($error, $curlyBrace, 'OpenBraceNotAlone', $errorData); - if ($fix === true) { - $phpcsFile->fixer->addNewline($curlyBrace); - } - } - } - - if ($tokens[($curlyBrace - 1)]['code'] === T_WHITESPACE) { - $prevContent = $tokens[($curlyBrace - 1)]['content']; - if ($prevContent === $phpcsFile->eolChar) { - $spaces = 0; - } else { - $spaces = $tokens[($curlyBrace - 1)]['length']; - } - - $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $stackPtr, true); - $expected = ($tokens[$first]['column'] - 1); - if ($spaces !== $expected) { - $error = 'Expected %s spaces before opening brace; %s found'; - $data = [ - $expected, - $spaces, - ]; - - $fix = $phpcsFile->addFixableError($error, $curlyBrace, 'SpaceBeforeBrace', $data); - if ($fix === true) { - $indent = str_repeat(' ', $expected); - if ($spaces === 0) { - $phpcsFile->fixer->addContentBefore($curlyBrace, $indent); - } else { - $phpcsFile->fixer->replaceToken(($curlyBrace - 1), $indent); - } - } - } - }//end if - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/ClassCommentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/ClassCommentSniff.php deleted file mode 100644 index ac3351e..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/ClassCommentSniff.php +++ /dev/null @@ -1,118 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\Commenting; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Util\Tokens; - -class ClassCommentSniff extends FileCommentSniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_CLASS, - T_INTERFACE, - T_TRAIT, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $type = strtolower($tokens[$stackPtr]['content']); - $errorData = [$type]; - - $find = Tokens::$methodPrefixes; - $find[T_WHITESPACE] = T_WHITESPACE; - - for ($commentEnd = ($stackPtr - 1); $commentEnd >= 0; $commentEnd--) { - if (isset($find[$tokens[$commentEnd]['code']]) === true) { - continue; - } - - if ($tokens[$commentEnd]['code'] === T_ATTRIBUTE_END - && isset($tokens[$commentEnd]['attribute_opener']) === true - ) { - $commentEnd = $tokens[$commentEnd]['attribute_opener']; - continue; - } - - break; - } - - if ($tokens[$commentEnd]['code'] !== T_DOC_COMMENT_CLOSE_TAG - && $tokens[$commentEnd]['code'] !== T_COMMENT - ) { - $errorData[] = $phpcsFile->getDeclarationName($stackPtr); - $phpcsFile->addError('Missing doc comment for %s %s', $stackPtr, 'Missing', $errorData); - $phpcsFile->recordMetric($stackPtr, 'Class has doc comment', 'no'); - return; - } - - $phpcsFile->recordMetric($stackPtr, 'Class has doc comment', 'yes'); - - if ($tokens[$commentEnd]['code'] === T_COMMENT) { - $phpcsFile->addError('You must use "/**" style comments for a %s comment', $stackPtr, 'WrongStyle', $errorData); - return; - } - - // Check each tag. - $this->processTags($phpcsFile, $stackPtr, $tokens[$commentEnd]['comment_opener']); - - }//end process() - - - /** - * Process the version tag. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param array $tags The tokens for these tags. - * - * @return void - */ - protected function processVersion($phpcsFile, array $tags) - { - $tokens = $phpcsFile->getTokens(); - foreach ($tags as $tag) { - if ($tokens[($tag + 2)]['code'] !== T_DOC_COMMENT_STRING) { - // No content. - continue; - } - - $content = $tokens[($tag + 2)]['content']; - if ((strstr($content, 'Release:') === false)) { - $error = 'Invalid version "%s" in doc comment; consider "Release: " instead'; - $data = [$content]; - $phpcsFile->addWarning($error, $tag, 'InvalidVersion', $data); - } - } - - }//end processVersion() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php deleted file mode 100644 index e0672ff..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php +++ /dev/null @@ -1,581 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\Commenting; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Common; - -class FileCommentSniff implements Sniff -{ - - /** - * Tags in correct order and related info. - * - * @var array - */ - protected $tags = [ - '@category' => [ - 'required' => true, - 'allow_multiple' => false, - ], - '@package' => [ - 'required' => true, - 'allow_multiple' => false, - ], - '@subpackage' => [ - 'required' => false, - 'allow_multiple' => false, - ], - '@author' => [ - 'required' => true, - 'allow_multiple' => true, - ], - '@copyright' => [ - 'required' => false, - 'allow_multiple' => true, - ], - '@license' => [ - 'required' => true, - 'allow_multiple' => false, - ], - '@version' => [ - 'required' => false, - 'allow_multiple' => false, - ], - '@link' => [ - 'required' => true, - 'allow_multiple' => true, - ], - '@see' => [ - 'required' => false, - 'allow_multiple' => true, - ], - '@since' => [ - 'required' => false, - 'allow_multiple' => false, - ], - '@deprecated' => [ - 'required' => false, - 'allow_multiple' => false, - ], - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_OPEN_TAG]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return int - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Find the next non whitespace token. - $commentStart = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - - // Allow declare() statements at the top of the file. - if ($tokens[$commentStart]['code'] === T_DECLARE) { - $semicolon = $phpcsFile->findNext(T_SEMICOLON, ($commentStart + 1)); - $commentStart = $phpcsFile->findNext(T_WHITESPACE, ($semicolon + 1), null, true); - } - - // Ignore vim header. - if ($tokens[$commentStart]['code'] === T_COMMENT) { - if (strstr($tokens[$commentStart]['content'], 'vim:') !== false) { - $commentStart = $phpcsFile->findNext( - T_WHITESPACE, - ($commentStart + 1), - null, - true - ); - } - } - - $errorToken = ($stackPtr + 1); - if (isset($tokens[$errorToken]) === false) { - $errorToken--; - } - - if ($tokens[$commentStart]['code'] === T_CLOSE_TAG) { - // We are only interested if this is the first open tag. - return ($phpcsFile->numTokens + 1); - } else if ($tokens[$commentStart]['code'] === T_COMMENT) { - $error = 'You must use "/**" style comments for a file comment'; - $phpcsFile->addError($error, $errorToken, 'WrongStyle'); - $phpcsFile->recordMetric($stackPtr, 'File has doc comment', 'yes'); - return ($phpcsFile->numTokens + 1); - } else if ($commentStart === false - || $tokens[$commentStart]['code'] !== T_DOC_COMMENT_OPEN_TAG - ) { - $phpcsFile->addError('Missing file doc comment', $errorToken, 'Missing'); - $phpcsFile->recordMetric($stackPtr, 'File has doc comment', 'no'); - return ($phpcsFile->numTokens + 1); - } - - $commentEnd = $tokens[$commentStart]['comment_closer']; - - for ($nextToken = ($commentEnd + 1); $nextToken < $phpcsFile->numTokens; $nextToken++) { - if ($tokens[$nextToken]['code'] === T_WHITESPACE) { - continue; - } - - if ($tokens[$nextToken]['code'] === T_ATTRIBUTE - && isset($tokens[$nextToken]['attribute_closer']) === true - ) { - $nextToken = $tokens[$nextToken]['attribute_closer']; - continue; - } - - break; - } - - if ($nextToken === $phpcsFile->numTokens) { - $nextToken--; - } - - $ignore = [ - T_CLASS, - T_INTERFACE, - T_TRAIT, - T_FUNCTION, - T_CLOSURE, - T_PUBLIC, - T_PRIVATE, - T_PROTECTED, - T_FINAL, - T_STATIC, - T_ABSTRACT, - T_CONST, - T_PROPERTY, - ]; - - if (in_array($tokens[$nextToken]['code'], $ignore, true) === true) { - $phpcsFile->addError('Missing file doc comment', $stackPtr, 'Missing'); - $phpcsFile->recordMetric($stackPtr, 'File has doc comment', 'no'); - return ($phpcsFile->numTokens + 1); - } - - $phpcsFile->recordMetric($stackPtr, 'File has doc comment', 'yes'); - - // Check the PHP Version, which should be in some text before the first tag. - $found = false; - for ($i = ($commentStart + 1); $i < $commentEnd; $i++) { - if ($tokens[$i]['code'] === T_DOC_COMMENT_TAG) { - break; - } else if ($tokens[$i]['code'] === T_DOC_COMMENT_STRING - && strstr(strtolower($tokens[$i]['content']), 'php version') !== false - ) { - $found = true; - break; - } - } - - if ($found === false) { - $error = 'PHP version not specified'; - $phpcsFile->addWarning($error, $commentEnd, 'MissingVersion'); - } - - // Check each tag. - $this->processTags($phpcsFile, $stackPtr, $commentStart); - - // Ignore the rest of the file. - return ($phpcsFile->numTokens + 1); - - }//end process() - - - /** - * Processes each required or optional tag. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * @param int $commentStart Position in the stack where the comment started. - * - * @return void - */ - protected function processTags($phpcsFile, $stackPtr, $commentStart) - { - $tokens = $phpcsFile->getTokens(); - - if (get_class($this) === 'PHP_CodeSniffer\Standards\PEAR\Sniffs\Commenting\FileCommentSniff') { - $docBlock = 'file'; - } else { - $docBlock = 'class'; - } - - $commentEnd = $tokens[$commentStart]['comment_closer']; - - $foundTags = []; - $tagTokens = []; - foreach ($tokens[$commentStart]['comment_tags'] as $tag) { - $name = $tokens[$tag]['content']; - if (isset($this->tags[$name]) === false) { - continue; - } - - if ($this->tags[$name]['allow_multiple'] === false && isset($tagTokens[$name]) === true) { - $error = 'Only one %s tag is allowed in a %s comment'; - $data = [ - $name, - $docBlock, - ]; - $phpcsFile->addError($error, $tag, 'Duplicate'.ucfirst(substr($name, 1)).'Tag', $data); - } - - $foundTags[] = $name; - $tagTokens[$name][] = $tag; - - $string = $phpcsFile->findNext(T_DOC_COMMENT_STRING, $tag, $commentEnd); - if ($string === false || $tokens[$string]['line'] !== $tokens[$tag]['line']) { - $error = 'Content missing for %s tag in %s comment'; - $data = [ - $name, - $docBlock, - ]; - $phpcsFile->addError($error, $tag, 'Empty'.ucfirst(substr($name, 1)).'Tag', $data); - continue; - } - }//end foreach - - // Check if the tags are in the correct position. - $pos = 0; - foreach ($this->tags as $tag => $tagData) { - if (isset($tagTokens[$tag]) === false) { - if ($tagData['required'] === true) { - $error = 'Missing %s tag in %s comment'; - $data = [ - $tag, - $docBlock, - ]; - $phpcsFile->addError($error, $commentEnd, 'Missing'.ucfirst(substr($tag, 1)).'Tag', $data); - } - - continue; - } else { - $method = 'process'.substr($tag, 1); - if (method_exists($this, $method) === true) { - // Process each tag if a method is defined. - call_user_func([$this, $method], $phpcsFile, $tagTokens[$tag]); - } - } - - if (isset($foundTags[$pos]) === false) { - break; - } - - if ($foundTags[$pos] !== $tag) { - $error = 'The tag in position %s should be the %s tag'; - $data = [ - ($pos + 1), - $tag, - ]; - $phpcsFile->addError($error, $tokens[$commentStart]['comment_tags'][$pos], ucfirst(substr($tag, 1)).'TagOrder', $data); - } - - // Account for multiple tags. - $pos++; - while (isset($foundTags[$pos]) === true && $foundTags[$pos] === $tag) { - $pos++; - } - }//end foreach - - }//end processTags() - - - /** - * Process the category tag. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param array $tags The tokens for these tags. - * - * @return void - */ - protected function processCategory($phpcsFile, array $tags) - { - $tokens = $phpcsFile->getTokens(); - foreach ($tags as $tag) { - if ($tokens[($tag + 2)]['code'] !== T_DOC_COMMENT_STRING) { - // No content. - continue; - } - - $content = $tokens[($tag + 2)]['content']; - if (Common::isUnderscoreName($content) !== true) { - $newContent = str_replace(' ', '_', $content); - $nameBits = explode('_', $newContent); - $firstBit = array_shift($nameBits); - $newName = ucfirst($firstBit).'_'; - foreach ($nameBits as $bit) { - if ($bit !== '') { - $newName .= ucfirst($bit).'_'; - } - } - - $error = 'Category name "%s" is not valid; consider "%s" instead'; - $validName = trim($newName, '_'); - $data = [ - $content, - $validName, - ]; - $phpcsFile->addError($error, $tag, 'InvalidCategory', $data); - } - }//end foreach - - }//end processCategory() - - - /** - * Process the package tag. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param array $tags The tokens for these tags. - * - * @return void - */ - protected function processPackage($phpcsFile, array $tags) - { - $tokens = $phpcsFile->getTokens(); - foreach ($tags as $tag) { - if ($tokens[($tag + 2)]['code'] !== T_DOC_COMMENT_STRING) { - // No content. - continue; - } - - $content = $tokens[($tag + 2)]['content']; - if (Common::isUnderscoreName($content) === true) { - continue; - } - - $newContent = str_replace(' ', '_', $content); - $newContent = trim($newContent, '_'); - $newContent = preg_replace('/[^A-Za-z_]/', '', $newContent); - - if ($newContent === '') { - $error = 'Package name "%s" is not valid'; - $data = [$content]; - $phpcsFile->addError($error, $tag, 'InvalidPackageValue', $data); - } else { - $nameBits = explode('_', $newContent); - $firstBit = array_shift($nameBits); - $newName = strtoupper($firstBit[0]).substr($firstBit, 1).'_'; - foreach ($nameBits as $bit) { - if ($bit !== '') { - $newName .= strtoupper($bit[0]).substr($bit, 1).'_'; - } - } - - $error = 'Package name "%s" is not valid; consider "%s" instead'; - $validName = trim($newName, '_'); - $data = [ - $content, - $validName, - ]; - $phpcsFile->addError($error, $tag, 'InvalidPackage', $data); - }//end if - }//end foreach - - }//end processPackage() - - - /** - * Process the subpackage tag. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param array $tags The tokens for these tags. - * - * @return void - */ - protected function processSubpackage($phpcsFile, array $tags) - { - $tokens = $phpcsFile->getTokens(); - foreach ($tags as $tag) { - if ($tokens[($tag + 2)]['code'] !== T_DOC_COMMENT_STRING) { - // No content. - continue; - } - - $content = $tokens[($tag + 2)]['content']; - if (Common::isUnderscoreName($content) === true) { - continue; - } - - $newContent = str_replace(' ', '_', $content); - $nameBits = explode('_', $newContent); - $firstBit = array_shift($nameBits); - $newName = strtoupper($firstBit[0]).substr($firstBit, 1).'_'; - foreach ($nameBits as $bit) { - if ($bit !== '') { - $newName .= strtoupper($bit[0]).substr($bit, 1).'_'; - } - } - - $error = 'Subpackage name "%s" is not valid; consider "%s" instead'; - $validName = trim($newName, '_'); - $data = [ - $content, - $validName, - ]; - $phpcsFile->addError($error, $tag, 'InvalidSubpackage', $data); - }//end foreach - - }//end processSubpackage() - - - /** - * Process the author tag(s) that this header comment has. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param array $tags The tokens for these tags. - * - * @return void - */ - protected function processAuthor($phpcsFile, array $tags) - { - $tokens = $phpcsFile->getTokens(); - foreach ($tags as $tag) { - if ($tokens[($tag + 2)]['code'] !== T_DOC_COMMENT_STRING) { - // No content. - continue; - } - - $content = $tokens[($tag + 2)]['content']; - $local = '\da-zA-Z-_+'; - // Dot character cannot be the first or last character in the local-part. - $localMiddle = $local.'.\w'; - if (preg_match('/^([^<]*)\s+<(['.$local.'](['.$localMiddle.']*['.$local.'])*@[\da-zA-Z][-.\w]*[\da-zA-Z]\.[a-zA-Z]{2,})>$/', $content) === 0) { - $error = 'Content of the @author tag must be in the form "Display Name "'; - $phpcsFile->addError($error, $tag, 'InvalidAuthors'); - } - } - - }//end processAuthor() - - - /** - * Process the copyright tags. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param array $tags The tokens for these tags. - * - * @return void - */ - protected function processCopyright($phpcsFile, array $tags) - { - $tokens = $phpcsFile->getTokens(); - foreach ($tags as $tag) { - if ($tokens[($tag + 2)]['code'] !== T_DOC_COMMENT_STRING) { - // No content. - continue; - } - - $content = $tokens[($tag + 2)]['content']; - $matches = []; - if (preg_match('/^([0-9]{4})((.{1})([0-9]{4}))? (.+)$/', $content, $matches) !== 0) { - // Check earliest-latest year order. - if ($matches[3] !== '' && $matches[3] !== null) { - if ($matches[3] !== '-') { - $error = 'A hyphen must be used between the earliest and latest year'; - $phpcsFile->addError($error, $tag, 'CopyrightHyphen'); - } - - if ($matches[4] !== '' && $matches[4] !== null && $matches[4] < $matches[1]) { - $error = "Invalid year span \"$matches[1]$matches[3]$matches[4]\" found; consider \"$matches[4]-$matches[1]\" instead"; - $phpcsFile->addWarning($error, $tag, 'InvalidCopyright'); - } - } - } else { - $error = '@copyright tag must contain a year and the name of the copyright holder'; - $phpcsFile->addError($error, $tag, 'IncompleteCopyright'); - } - }//end foreach - - }//end processCopyright() - - - /** - * Process the license tag. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param array $tags The tokens for these tags. - * - * @return void - */ - protected function processLicense($phpcsFile, array $tags) - { - $tokens = $phpcsFile->getTokens(); - foreach ($tags as $tag) { - if ($tokens[($tag + 2)]['code'] !== T_DOC_COMMENT_STRING) { - // No content. - continue; - } - - $content = $tokens[($tag + 2)]['content']; - $matches = []; - preg_match('/^([^\s]+)\s+(.*)/', $content, $matches); - if (count($matches) !== 3) { - $error = '@license tag must contain a URL and a license name'; - $phpcsFile->addError($error, $tag, 'IncompleteLicense'); - } - } - - }//end processLicense() - - - /** - * Process the version tag. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param array $tags The tokens for these tags. - * - * @return void - */ - protected function processVersion($phpcsFile, array $tags) - { - $tokens = $phpcsFile->getTokens(); - foreach ($tags as $tag) { - if ($tokens[($tag + 2)]['code'] !== T_DOC_COMMENT_STRING) { - // No content. - continue; - } - - $content = $tokens[($tag + 2)]['content']; - if (strstr($content, 'CVS:') === false - && strstr($content, 'SVN:') === false - && strstr($content, 'GIT:') === false - && strstr($content, 'HG:') === false - ) { - $error = 'Invalid version "%s" in file comment; consider "CVS: " or "SVN: " or "GIT: " or "HG: " instead'; - $data = [$content]; - $phpcsFile->addWarning($error, $tag, 'InvalidVersion', $data); - } - } - - }//end processVersion() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php deleted file mode 100644 index 408856f..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php +++ /dev/null @@ -1,525 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\Commenting; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class FunctionCommentSniff implements Sniff -{ - - /** - * Disable the check for functions with a lower visibility than the value given. - * - * Allowed values are public, protected, and private. - * - * @var string - */ - public $minimumVisibility = 'private'; - - /** - * Array of methods which do not require a return type. - * - * @var array - */ - public $specialMethods = [ - '__construct', - '__destruct', - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_FUNCTION]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $scopeModifier = $phpcsFile->getMethodProperties($stackPtr)['scope']; - if ($scopeModifier === 'protected' - && $this->minimumVisibility === 'public' - || $scopeModifier === 'private' - && ($this->minimumVisibility === 'public' || $this->minimumVisibility === 'protected') - ) { - return; - } - - $tokens = $phpcsFile->getTokens(); - $ignore = Tokens::$methodPrefixes; - $ignore[T_WHITESPACE] = T_WHITESPACE; - - for ($commentEnd = ($stackPtr - 1); $commentEnd >= 0; $commentEnd--) { - if (isset($ignore[$tokens[$commentEnd]['code']]) === true) { - continue; - } - - if ($tokens[$commentEnd]['code'] === T_ATTRIBUTE_END - && isset($tokens[$commentEnd]['attribute_opener']) === true - ) { - $commentEnd = $tokens[$commentEnd]['attribute_opener']; - continue; - } - - break; - } - - if ($tokens[$commentEnd]['code'] === T_COMMENT) { - // Inline comments might just be closing comments for - // control structures or functions instead of function comments - // using the wrong comment type. If there is other code on the line, - // assume they relate to that code. - $prev = $phpcsFile->findPrevious($ignore, ($commentEnd - 1), null, true); - if ($prev !== false && $tokens[$prev]['line'] === $tokens[$commentEnd]['line']) { - $commentEnd = $prev; - } - } - - if ($tokens[$commentEnd]['code'] !== T_DOC_COMMENT_CLOSE_TAG - && $tokens[$commentEnd]['code'] !== T_COMMENT - ) { - $function = $phpcsFile->getDeclarationName($stackPtr); - $phpcsFile->addError( - 'Missing doc comment for function %s()', - $stackPtr, - 'Missing', - [$function] - ); - $phpcsFile->recordMetric($stackPtr, 'Function has doc comment', 'no'); - return; - } else { - $phpcsFile->recordMetric($stackPtr, 'Function has doc comment', 'yes'); - } - - if ($tokens[$commentEnd]['code'] === T_COMMENT) { - $phpcsFile->addError('You must use "/**" style comments for a function comment', $stackPtr, 'WrongStyle'); - return; - } - - if ($tokens[$commentEnd]['line'] !== ($tokens[$stackPtr]['line'] - 1)) { - for ($i = ($commentEnd + 1); $i < $stackPtr; $i++) { - if ($tokens[$i]['column'] !== 1) { - continue; - } - - if ($tokens[$i]['code'] === T_WHITESPACE - && $tokens[$i]['line'] !== $tokens[($i + 1)]['line'] - ) { - $error = 'There must be no blank lines after the function comment'; - $phpcsFile->addError($error, $commentEnd, 'SpacingAfter'); - break; - } - } - } - - $commentStart = $tokens[$commentEnd]['comment_opener']; - foreach ($tokens[$commentStart]['comment_tags'] as $tag) { - if ($tokens[$tag]['content'] === '@see') { - // Make sure the tag isn't empty. - $string = $phpcsFile->findNext(T_DOC_COMMENT_STRING, $tag, $commentEnd); - if ($string === false || $tokens[$string]['line'] !== $tokens[$tag]['line']) { - $error = 'Content missing for @see tag in function comment'; - $phpcsFile->addError($error, $tag, 'EmptySees'); - } - } - } - - $this->processReturn($phpcsFile, $stackPtr, $commentStart); - $this->processThrows($phpcsFile, $stackPtr, $commentStart); - $this->processParams($phpcsFile, $stackPtr, $commentStart); - - }//end process() - - - /** - * Process the return comment of this function comment. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * @param int $commentStart The position in the stack where the comment started. - * - * @return void - */ - protected function processReturn(File $phpcsFile, $stackPtr, $commentStart) - { - $tokens = $phpcsFile->getTokens(); - - // Skip constructor and destructor. - $methodName = $phpcsFile->getDeclarationName($stackPtr); - $isSpecialMethod = in_array($methodName, $this->specialMethods, true); - - $return = null; - foreach ($tokens[$commentStart]['comment_tags'] as $tag) { - if ($tokens[$tag]['content'] === '@return') { - if ($return !== null) { - $error = 'Only 1 @return tag is allowed in a function comment'; - $phpcsFile->addError($error, $tag, 'DuplicateReturn'); - return; - } - - $return = $tag; - } - } - - if ($return !== null) { - $content = $tokens[($return + 2)]['content']; - if (empty($content) === true || $tokens[($return + 2)]['code'] !== T_DOC_COMMENT_STRING) { - $error = 'Return type missing for @return tag in function comment'; - $phpcsFile->addError($error, $return, 'MissingReturnType'); - } - } else { - if ($isSpecialMethod === true) { - return; - } - - $error = 'Missing @return tag in function comment'; - $phpcsFile->addError($error, $tokens[$commentStart]['comment_closer'], 'MissingReturn'); - }//end if - - }//end processReturn() - - - /** - * Process any throw tags that this function comment has. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * @param int $commentStart The position in the stack where the comment started. - * - * @return void - */ - protected function processThrows(File $phpcsFile, $stackPtr, $commentStart) - { - $tokens = $phpcsFile->getTokens(); - - foreach ($tokens[$commentStart]['comment_tags'] as $tag) { - if ($tokens[$tag]['content'] !== '@throws') { - continue; - } - - $exception = null; - if ($tokens[($tag + 2)]['code'] === T_DOC_COMMENT_STRING) { - $matches = []; - preg_match('/([^\s]+)(?:\s+(.*))?/', $tokens[($tag + 2)]['content'], $matches); - $exception = $matches[1]; - } - - if ($exception === null) { - $error = 'Exception type missing for @throws tag in function comment'; - $phpcsFile->addError($error, $tag, 'InvalidThrows'); - } - }//end foreach - - }//end processThrows() - - - /** - * Process the function parameter comments. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * @param int $commentStart The position in the stack where the comment started. - * - * @return void - */ - protected function processParams(File $phpcsFile, $stackPtr, $commentStart) - { - $tokens = $phpcsFile->getTokens(); - - $params = []; - $maxType = 0; - $maxVar = 0; - foreach ($tokens[$commentStart]['comment_tags'] as $pos => $tag) { - if ($tokens[$tag]['content'] !== '@param') { - continue; - } - - $type = ''; - $typeSpace = 0; - $var = ''; - $varSpace = 0; - $comment = ''; - $commentEnd = 0; - $commentTokens = []; - - if ($tokens[($tag + 2)]['code'] === T_DOC_COMMENT_STRING) { - $matches = []; - preg_match('/((?:(?![$.]|&(?=\$)).)*)(?:((?:\.\.\.)?(?:\$|&)[^\s]+)(?:(\s+)(.*))?)?/', $tokens[($tag + 2)]['content'], $matches); - - if (empty($matches) === false) { - $typeLen = strlen($matches[1]); - $type = trim($matches[1]); - $typeSpace = ($typeLen - strlen($type)); - $typeLen = strlen($type); - if ($typeLen > $maxType) { - $maxType = $typeLen; - } - } - - if (isset($matches[2]) === true) { - $var = $matches[2]; - $varLen = strlen($var); - if ($varLen > $maxVar) { - $maxVar = $varLen; - } - - if (isset($matches[4]) === true) { - $varSpace = strlen($matches[3]); - $comment = $matches[4]; - - // Any strings until the next tag belong to this comment. - if (isset($tokens[$commentStart]['comment_tags'][($pos + 1)]) === true) { - $end = $tokens[$commentStart]['comment_tags'][($pos + 1)]; - } else { - $end = $tokens[$commentStart]['comment_closer']; - } - - for ($i = ($tag + 3); $i < $end; $i++) { - if ($tokens[$i]['code'] === T_DOC_COMMENT_STRING) { - $comment .= ' '.$tokens[$i]['content']; - $commentEnd = $i; - $commentTokens[] = $i; - } - } - } else { - $error = 'Missing parameter comment'; - $phpcsFile->addError($error, $tag, 'MissingParamComment'); - }//end if - } else { - $error = 'Missing parameter name'; - $phpcsFile->addError($error, $tag, 'MissingParamName'); - }//end if - } else { - $error = 'Missing parameter type'; - $phpcsFile->addError($error, $tag, 'MissingParamType'); - }//end if - - $params[] = [ - 'tag' => $tag, - 'type' => $type, - 'var' => $var, - 'comment' => $comment, - 'comment_end' => $commentEnd, - 'comment_tokens' => $commentTokens, - 'type_space' => $typeSpace, - 'var_space' => $varSpace, - ]; - }//end foreach - - $realParams = $phpcsFile->getMethodParameters($stackPtr); - $foundParams = []; - - // We want to use ... for all variable length arguments, so add - // this prefix to the variable name so comparisons are easier. - foreach ($realParams as $pos => $param) { - if ($param['variable_length'] === true) { - $realParams[$pos]['name'] = '...'.$realParams[$pos]['name']; - } - } - - foreach ($params as $pos => $param) { - if ($param['var'] === '') { - continue; - } - - $foundParams[] = $param['var']; - - if (trim($param['type']) !== '') { - // Check number of spaces after the type. - $spaces = ($maxType - strlen($param['type']) + 1); - if ($param['type_space'] !== $spaces) { - $error = 'Expected %s spaces after parameter type; %s found'; - $data = [ - $spaces, - $param['type_space'], - ]; - - $fix = $phpcsFile->addFixableError($error, $param['tag'], 'SpacingAfterParamType', $data); - if ($fix === true) { - $commentToken = ($param['tag'] + 2); - - $content = $param['type']; - $content .= str_repeat(' ', $spaces); - $content .= $param['var']; - $content .= str_repeat(' ', $param['var_space']); - - $wrapLength = ($tokens[$commentToken]['length'] - $param['type_space'] - $param['var_space'] - strlen($param['type']) - strlen($param['var'])); - - $star = $phpcsFile->findPrevious(T_DOC_COMMENT_STAR, $param['tag']); - $spaceLength = (strlen($content) + $tokens[($commentToken - 1)]['length'] + $tokens[($commentToken - 2)]['length']); - - $padding = str_repeat(' ', ($tokens[$star]['column'] - 1)); - $padding .= '* '; - $padding .= str_repeat(' ', $spaceLength); - - $content .= wordwrap( - $param['comment'], - $wrapLength, - $phpcsFile->eolChar.$padding - ); - - $phpcsFile->fixer->replaceToken($commentToken, $content); - for ($i = ($commentToken + 1); $i <= $param['comment_end']; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - }//end if - }//end if - }//end if - - // Make sure the param name is correct. - if (isset($realParams[$pos]) === true) { - $realName = $realParams[$pos]['name']; - if ($realName !== $param['var']) { - $code = 'ParamNameNoMatch'; - $data = [ - $param['var'], - $realName, - ]; - - $error = 'Doc comment for parameter %s does not match '; - if (strtolower($param['var']) === strtolower($realName)) { - $error .= 'case of '; - $code = 'ParamNameNoCaseMatch'; - } - - $error .= 'actual variable name %s'; - - $phpcsFile->addError($error, $param['tag'], $code, $data); - } - } else if (substr($param['var'], -4) !== ',...') { - // We must have an extra parameter comment. - $error = 'Superfluous parameter comment'; - $phpcsFile->addError($error, $param['tag'], 'ExtraParamComment'); - }//end if - - if ($param['comment'] === '') { - continue; - } - - // Check number of spaces after the param name. - $spaces = ($maxVar - strlen($param['var']) + 1); - if ($param['var_space'] !== $spaces) { - $error = 'Expected %s spaces after parameter name; %s found'; - $data = [ - $spaces, - $param['var_space'], - ]; - - $fix = $phpcsFile->addFixableError($error, $param['tag'], 'SpacingAfterParamName', $data); - if ($fix === true) { - $commentToken = ($param['tag'] + 2); - - $content = $param['type']; - $content .= str_repeat(' ', $param['type_space']); - $content .= $param['var']; - $content .= str_repeat(' ', $spaces); - - $wrapLength = ($tokens[$commentToken]['length'] - $param['type_space'] - $param['var_space'] - strlen($param['type']) - strlen($param['var'])); - - $star = $phpcsFile->findPrevious(T_DOC_COMMENT_STAR, $param['tag']); - $spaceLength = (strlen($content) + $tokens[($commentToken - 1)]['length'] + $tokens[($commentToken - 2)]['length']); - - $padding = str_repeat(' ', ($tokens[$star]['column'] - 1)); - $padding .= '* '; - $padding .= str_repeat(' ', $spaceLength); - - $content .= wordwrap( - $param['comment'], - $wrapLength, - $phpcsFile->eolChar.$padding - ); - - $phpcsFile->fixer->replaceToken($commentToken, $content); - for ($i = ($commentToken + 1); $i <= $param['comment_end']; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - }//end if - }//end if - - // Check the alignment of multi-line param comments. - if ($param['tag'] !== $param['comment_end']) { - $wrapLength = ($tokens[($param['tag'] + 2)]['length'] - $param['type_space'] - $param['var_space'] - strlen($param['type']) - strlen($param['var'])); - - $startColumn = ($tokens[($param['tag'] + 2)]['column'] + $tokens[($param['tag'] + 2)]['length'] - $wrapLength); - - $star = $phpcsFile->findPrevious(T_DOC_COMMENT_STAR, $param['tag']); - $expected = ($startColumn - $tokens[$star]['column'] - 1); - - foreach ($param['comment_tokens'] as $commentToken) { - if ($tokens[$commentToken]['column'] === $startColumn) { - continue; - } - - $found = 0; - if ($tokens[($commentToken - 1)]['code'] === T_DOC_COMMENT_WHITESPACE) { - $found = $tokens[($commentToken - 1)]['length']; - } - - $error = 'Parameter comment not aligned correctly; expected %s spaces but found %s'; - $data = [ - $expected, - $found, - ]; - - if ($found < $expected) { - $code = 'ParamCommentAlignment'; - } else { - $code = 'ParamCommentAlignmentExceeded'; - } - - $fix = $phpcsFile->addFixableError($error, $commentToken, $code, $data); - if ($fix === true) { - $padding = str_repeat(' ', $expected); - if ($tokens[($commentToken - 1)]['code'] === T_DOC_COMMENT_WHITESPACE) { - $phpcsFile->fixer->replaceToken(($commentToken - 1), $padding); - } else { - $phpcsFile->fixer->addContentBefore($commentToken, $padding); - } - } - }//end foreach - }//end if - }//end foreach - - $realNames = []; - foreach ($realParams as $realParam) { - $realNames[] = $realParam['name']; - } - - // Report missing comments. - $diff = array_diff($realNames, $foundParams); - foreach ($diff as $neededParam) { - $error = 'Doc comment for parameter "%s" missing'; - $data = [$neededParam]; - $phpcsFile->addError($error, $commentStart, 'MissingParamTag', $data); - } - - }//end processParams() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/InlineCommentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/InlineCommentSniff.php deleted file mode 100644 index aa9f375..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/InlineCommentSniff.php +++ /dev/null @@ -1,68 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\Commenting; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class InlineCommentSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_COMMENT]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if ($tokens[$stackPtr]['content'][0] === '#') { - $phpcsFile->recordMetric($stackPtr, 'Inline comment style', '# ...'); - - $error = 'Perl-style comments are not allowed. Use "// Comment."'; - $error .= ' or "/* comment */" instead.'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'WrongStyle'); - if ($fix === true) { - $newComment = ltrim($tokens[$stackPtr]['content'], '# '); - $newComment = '// '.$newComment; - $phpcsFile->fixer->replaceToken($stackPtr, $newComment); - } - } else if ($tokens[$stackPtr]['content'][0] === '/' - && $tokens[$stackPtr]['content'][1] === '/' - ) { - $phpcsFile->recordMetric($stackPtr, 'Inline comment style', '// ...'); - } else if ($tokens[$stackPtr]['content'][0] === '/' - && $tokens[$stackPtr]['content'][1] === '*' - ) { - $phpcsFile->recordMetric($stackPtr, 'Inline comment style', '/* ... */'); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/ControlStructures/ControlSignatureSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/ControlStructures/ControlSignatureSniff.php deleted file mode 100644 index edd2d6b..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/ControlStructures/ControlSignatureSniff.php +++ /dev/null @@ -1,48 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\ControlStructures; - -use PHP_CodeSniffer\Sniffs\AbstractPatternSniff; - -class ControlSignatureSniff extends AbstractPatternSniff -{ - - /** - * If true, comments will be ignored if they are found in the code. - * - * @var boolean - */ - public $ignoreComments = true; - - - /** - * Returns the patterns that this test wishes to verify. - * - * @return string[] - */ - protected function getPatterns() - { - return [ - 'do {EOL...} while (...);EOL', - 'while (...) {EOL', - 'for (...) {EOL', - 'if (...) {EOL', - 'foreach (...) {EOL', - '} else if (...) {EOL', - '} elseif (...) {EOL', - '} else {EOL', - 'do {EOL', - 'match (...) {EOL', - ]; - - }//end getPatterns() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/ControlStructures/MultiLineConditionSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/ControlStructures/MultiLineConditionSniff.php deleted file mode 100644 index fff62bb..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/ControlStructures/MultiLineConditionSniff.php +++ /dev/null @@ -1,283 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\ControlStructures; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class MultiLineConditionSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - /** - * The number of spaces code should be indented. - * - * @var integer - */ - public $indent = 4; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_IF, - T_ELSEIF, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]['parenthesis_opener']) === false) { - return; - } - - $openBracket = $tokens[$stackPtr]['parenthesis_opener']; - $closeBracket = $tokens[$stackPtr]['parenthesis_closer']; - $spaceAfterOpen = 0; - if ($tokens[($openBracket + 1)]['code'] === T_WHITESPACE) { - if (strpos($tokens[($openBracket + 1)]['content'], $phpcsFile->eolChar) !== false) { - $spaceAfterOpen = 'newline'; - } else { - $spaceAfterOpen = $tokens[($openBracket + 1)]['length']; - } - } - - if ($spaceAfterOpen !== 0) { - $error = 'First condition of a multi-line IF statement must directly follow the opening parenthesis'; - $fix = $phpcsFile->addFixableError($error, ($openBracket + 1), 'SpacingAfterOpenBrace'); - if ($fix === true) { - if ($spaceAfterOpen === 'newline') { - $phpcsFile->fixer->replaceToken(($openBracket + 1), ''); - } else { - $phpcsFile->fixer->replaceToken(($openBracket + 1), ''); - } - } - } - - // We need to work out how far indented the if statement - // itself is, so we can work out how far to indent conditions. - $statementIndent = 0; - for ($i = ($stackPtr - 1); $i >= 0; $i--) { - if ($tokens[$i]['line'] !== $tokens[$stackPtr]['line']) { - $i++; - break; - } - } - - if ($i >= 0 && $tokens[$i]['code'] === T_WHITESPACE) { - $statementIndent = $tokens[$i]['length']; - } - - // Each line between the parenthesis should be indented 4 spaces - // and start with an operator, unless the line is inside a - // function call, in which case it is ignored. - $prevLine = $tokens[$openBracket]['line']; - for ($i = ($openBracket + 1); $i <= $closeBracket; $i++) { - if ($i === $closeBracket && $tokens[$openBracket]['line'] !== $tokens[$i]['line']) { - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($i - 1), null, true); - if ($tokens[$prev]['line'] === $tokens[$i]['line']) { - // Closing bracket is on the same line as a condition. - $error = 'Closing parenthesis of a multi-line IF statement must be on a new line'; - $fix = $phpcsFile->addFixableError($error, $closeBracket, 'CloseBracketNewLine'); - if ($fix === true) { - // Account for a comment at the end of the line. - $next = $phpcsFile->findNext(T_WHITESPACE, ($closeBracket + 1), null, true); - if ($tokens[$next]['code'] !== T_COMMENT - && isset(Tokens::$phpcsCommentTokens[$tokens[$next]['code']]) === false - ) { - $phpcsFile->fixer->addNewlineBefore($closeBracket); - } else { - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($next + 1), null, true); - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($closeBracket, ''); - $phpcsFile->fixer->addContentBefore($next, ')'); - $phpcsFile->fixer->endChangeset(); - } - } - } - }//end if - - if ($tokens[$i]['line'] !== $prevLine) { - if ($tokens[$i]['line'] === $tokens[$closeBracket]['line']) { - $next = $phpcsFile->findNext(T_WHITESPACE, $i, null, true); - if ($next !== $closeBracket) { - $expectedIndent = ($statementIndent + $this->indent); - } else { - // Closing brace needs to be indented to the same level - // as the statement. - $expectedIndent = $statementIndent; - }//end if - } else { - $expectedIndent = ($statementIndent + $this->indent); - }//end if - - if ($tokens[$i]['code'] === T_COMMENT - || isset(Tokens::$phpcsCommentTokens[$tokens[$i]['code']]) === true - ) { - $prevLine = $tokens[$i]['line']; - continue; - } - - // We changed lines, so this should be a whitespace indent token. - if ($tokens[$i]['code'] !== T_WHITESPACE) { - $foundIndent = 0; - } else { - $foundIndent = $tokens[$i]['length']; - } - - if ($expectedIndent !== $foundIndent) { - $error = 'Multi-line IF statement not indented correctly; expected %s spaces but found %s'; - $data = [ - $expectedIndent, - $foundIndent, - ]; - - $fix = $phpcsFile->addFixableError($error, $i, 'Alignment', $data); - if ($fix === true) { - $spaces = str_repeat(' ', $expectedIndent); - if ($foundIndent === 0) { - $phpcsFile->fixer->addContentBefore($i, $spaces); - } else { - $phpcsFile->fixer->replaceToken($i, $spaces); - } - } - } - - $next = $phpcsFile->findNext(Tokens::$emptyTokens, $i, null, true); - if ($next !== $closeBracket && $tokens[$next]['line'] === $tokens[$i]['line']) { - if (isset(Tokens::$booleanOperators[$tokens[$next]['code']]) === false) { - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($i - 1), $openBracket, true); - $fixable = true; - if (isset(Tokens::$booleanOperators[$tokens[$prev]['code']]) === false - && $phpcsFile->findNext(T_WHITESPACE, ($prev + 1), $next, true) !== false - ) { - // Condition spread over multi-lines interspersed with comments. - $fixable = false; - } - - $error = 'Each line in a multi-line IF statement must begin with a boolean operator'; - if ($fixable === false) { - $phpcsFile->addError($error, $next, 'StartWithBoolean'); - } else { - $fix = $phpcsFile->addFixableError($error, $next, 'StartWithBoolean'); - if ($fix === true) { - if (isset(Tokens::$booleanOperators[$tokens[$prev]['code']]) === true) { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($prev, ''); - $phpcsFile->fixer->addContentBefore($next, $tokens[$prev]['content'].' '); - $phpcsFile->fixer->endChangeset(); - } else { - for ($x = ($prev + 1); $x < $next; $x++) { - $phpcsFile->fixer->replaceToken($x, ''); - } - } - } - } - }//end if - }//end if - - $prevLine = $tokens[$i]['line']; - }//end if - - if ($tokens[$i]['code'] === T_STRING) { - $next = $phpcsFile->findNext(T_WHITESPACE, ($i + 1), null, true); - if ($tokens[$next]['code'] === T_OPEN_PARENTHESIS) { - // This is a function call, so skip to the end as they - // have their own indentation rules. - $i = $tokens[$next]['parenthesis_closer']; - $prevLine = $tokens[$i]['line']; - continue; - } - } - }//end for - - // From here on, we are checking the spacing of the opening and closing - // braces. If this IF statement does not use braces, we end here. - if (isset($tokens[$stackPtr]['scope_opener']) === false) { - return; - } - - // The opening brace needs to be one space away from the closing parenthesis. - $openBrace = $tokens[$stackPtr]['scope_opener']; - $next = $phpcsFile->findNext(T_WHITESPACE, ($closeBracket + 1), $openBrace, true); - if ($next !== false) { - // Probably comments in between tokens, so don't check. - return; - } - - if ($tokens[$openBrace]['line'] > $tokens[$closeBracket]['line']) { - $length = -1; - } else if ($openBrace === ($closeBracket + 1)) { - $length = 0; - } else if ($openBrace === ($closeBracket + 2) - && $tokens[($closeBracket + 1)]['code'] === T_WHITESPACE - ) { - $length = $tokens[($closeBracket + 1)]['length']; - } else { - // Confused, so don't check. - $length = 1; - } - - if ($length === 1) { - return; - } - - $data = [$length]; - $code = 'SpaceBeforeOpenBrace'; - - $error = 'There must be a single space between the closing parenthesis and the opening brace of a multi-line IF statement; found '; - if ($length === -1) { - $error .= 'newline'; - $code = 'NewlineBeforeOpenBrace'; - } else { - $error .= '%s spaces'; - } - - $fix = $phpcsFile->addFixableError($error, ($closeBracket + 1), $code, $data); - if ($fix === true) { - if ($length === 0) { - $phpcsFile->fixer->addContent($closeBracket, ' '); - } else { - $phpcsFile->fixer->replaceToken(($closeBracket + 1), ' '); - } - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Files/IncludingFileSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Files/IncludingFileSniff.php deleted file mode 100644 index 04f208d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Files/IncludingFileSniff.php +++ /dev/null @@ -1,136 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\Files; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class IncludingFileSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_INCLUDE_ONCE, - T_REQUIRE_ONCE, - T_REQUIRE, - T_INCLUDE, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $nextToken = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($tokens[$nextToken]['code'] === T_OPEN_PARENTHESIS) { - $error = '"%s" is a statement not a function; no parentheses are required'; - $data = [$tokens[$stackPtr]['content']]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'BracketsNotRequired', $data); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($tokens[$nextToken]['parenthesis_closer'], ''); - if ($tokens[($nextToken - 1)]['code'] !== T_WHITESPACE) { - $phpcsFile->fixer->replaceToken($nextToken, ' '); - } else { - $phpcsFile->fixer->replaceToken($nextToken, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } - - if (count($tokens[$stackPtr]['conditions']) !== 0) { - $inCondition = true; - } else { - $inCondition = false; - } - - // Check to see if this including statement is within the parenthesis - // of a condition. If that's the case then we need to process it as being - // within a condition, as they are checking the return value. - if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) { - foreach ($tokens[$stackPtr]['nested_parenthesis'] as $left => $right) { - if (isset($tokens[$left]['parenthesis_owner']) === true) { - $inCondition = true; - } - } - } - - // Check to see if they are assigning the return value of this - // including call. If they are then they are probably checking it, so - // it's conditional. - $previous = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if (isset(Tokens::$assignmentTokens[$tokens[$previous]['code']]) === true) { - // The have assigned the return value to it, so its conditional. - $inCondition = true; - } - - $tokenCode = $tokens[$stackPtr]['code']; - if ($inCondition === true) { - // We are inside a conditional statement. We need an include_once. - if ($tokenCode === T_REQUIRE_ONCE) { - $error = 'File is being conditionally included; '; - $error .= 'use "include_once" instead'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'UseIncludeOnce'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($stackPtr, 'include_once'); - } - } else if ($tokenCode === T_REQUIRE) { - $error = 'File is being conditionally included; '; - $error .= 'use "include" instead'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'UseInclude'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($stackPtr, 'include'); - } - } - } else { - // We are unconditionally including, we need a require_once. - if ($tokenCode === T_INCLUDE_ONCE) { - $error = 'File is being unconditionally included; '; - $error .= 'use "require_once" instead'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'UseRequireOnce'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($stackPtr, 'require_once'); - } - } else if ($tokenCode === T_INCLUDE) { - $error = 'File is being unconditionally included; '; - $error .= 'use "require" instead'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'UseRequire'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($stackPtr, 'require'); - } - } - }//end if - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Formatting/MultiLineAssignmentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Formatting/MultiLineAssignmentSniff.php deleted file mode 100644 index 0a7ff7d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Formatting/MultiLineAssignmentSniff.php +++ /dev/null @@ -1,106 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\Formatting; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class MultiLineAssignmentSniff implements Sniff -{ - - /** - * The number of spaces code should be indented. - * - * @var integer - */ - public $indent = 4; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_EQUAL]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Equal sign can't be the last thing on the line. - $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($next === false) { - // Bad assignment. - return; - } - - if ($tokens[$next]['line'] !== $tokens[$stackPtr]['line']) { - $error = 'Multi-line assignments must have the equal sign on the second line'; - $phpcsFile->addError($error, $stackPtr, 'EqualSignLine'); - return; - } - - // Make sure it is the first thing on the line, otherwise we ignore it. - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), false, true); - if ($prev === false) { - // Bad assignment. - return; - } - - if ($tokens[$prev]['line'] === $tokens[$stackPtr]['line']) { - return; - } - - // Find the required indent based on the ident of the previous line. - $assignmentIndent = 0; - $prevLine = $tokens[$prev]['line']; - for ($i = ($prev - 1); $i >= 0; $i--) { - if ($tokens[$i]['line'] !== $prevLine) { - $i++; - break; - } - } - - if ($tokens[$i]['code'] === T_WHITESPACE) { - $assignmentIndent = $tokens[$i]['length']; - } - - // Find the actual indent. - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1)); - - $expectedIndent = ($assignmentIndent + $this->indent); - $foundIndent = $tokens[$prev]['length']; - if ($foundIndent !== $expectedIndent) { - $error = 'Multi-line assignment not indented correctly; expected %s spaces but found %s'; - $data = [ - $expectedIndent, - $foundIndent, - ]; - $phpcsFile->addError($error, $stackPtr, 'Indent', $data); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php deleted file mode 100644 index 3a339ab..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php +++ /dev/null @@ -1,628 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class FunctionCallSignatureSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - /** - * The number of spaces code should be indented. - * - * @var integer - */ - public $indent = 4; - - /** - * If TRUE, multiple arguments can be defined per line in a multi-line call. - * - * @var boolean - */ - public $allowMultipleArguments = true; - - /** - * How many spaces should follow the opening bracket. - * - * @var integer - */ - public $requiredSpacesAfterOpen = 0; - - /** - * How many spaces should precede the closing bracket. - * - * @var integer - */ - public $requiredSpacesBeforeClose = 0; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - $tokens = Tokens::$functionNameTokens; - - $tokens[] = T_VARIABLE; - $tokens[] = T_CLOSE_CURLY_BRACKET; - $tokens[] = T_CLOSE_SQUARE_BRACKET; - $tokens[] = T_CLOSE_PARENTHESIS; - - return $tokens; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $this->requiredSpacesAfterOpen = (int) $this->requiredSpacesAfterOpen; - $this->requiredSpacesBeforeClose = (int) $this->requiredSpacesBeforeClose; - $tokens = $phpcsFile->getTokens(); - - if ($tokens[$stackPtr]['code'] === T_CLOSE_CURLY_BRACKET - && isset($tokens[$stackPtr]['scope_condition']) === true - ) { - // Not a function call. - return; - } - - // Find the next non-empty token. - $openBracket = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - - if ($tokens[$openBracket]['code'] !== T_OPEN_PARENTHESIS) { - // Not a function call. - return; - } - - if (isset($tokens[$openBracket]['parenthesis_closer']) === false) { - // Not a function call. - return; - } - - // Find the previous non-empty token. - $search = Tokens::$emptyTokens; - $search[] = T_BITWISE_AND; - $previous = $phpcsFile->findPrevious($search, ($stackPtr - 1), null, true); - if ($tokens[$previous]['code'] === T_FUNCTION) { - // It's a function definition, not a function call. - return; - } - - $closeBracket = $tokens[$openBracket]['parenthesis_closer']; - - if (($stackPtr + 1) !== $openBracket) { - // Checking this: $value = my_function[*](...). - $error = 'Space before opening parenthesis of function call prohibited'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceBeforeOpenBracket'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($stackPtr + 1); $i < $openBracket; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - // Modify the bracket as well to ensure a conflict if the bracket - // has been changed in some way by another sniff. - $phpcsFile->fixer->replaceToken($openBracket, '('); - $phpcsFile->fixer->endChangeset(); - } - } - - $next = $phpcsFile->findNext(T_WHITESPACE, ($closeBracket + 1), null, true); - if ($tokens[$next]['code'] === T_SEMICOLON) { - if (isset(Tokens::$emptyTokens[$tokens[($closeBracket + 1)]['code']]) === true) { - $error = 'Space after closing parenthesis of function call prohibited'; - $fix = $phpcsFile->addFixableError($error, $closeBracket, 'SpaceAfterCloseBracket'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($closeBracket + 1); $i < $next; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - // Modify the bracket as well to ensure a conflict if the bracket - // has been changed in some way by another sniff. - $phpcsFile->fixer->replaceToken($closeBracket, ')'); - $phpcsFile->fixer->endChangeset(); - } - } - } - - // Check if this is a single line or multi-line function call. - if ($this->isMultiLineCall($phpcsFile, $stackPtr, $openBracket, $tokens) === true) { - $this->processMultiLineCall($phpcsFile, $stackPtr, $openBracket, $tokens); - } else { - $this->processSingleLineCall($phpcsFile, $stackPtr, $openBracket, $tokens); - } - - }//end process() - - - /** - * Determine if this is a multi-line function call. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * @param int $openBracket The position of the opening bracket - * in the stack passed in $tokens. - * @param array $tokens The stack of tokens that make up - * the file. - * - * @return bool - */ - public function isMultiLineCall(File $phpcsFile, $stackPtr, $openBracket, $tokens) - { - $closeBracket = $tokens[$openBracket]['parenthesis_closer']; - if ($tokens[$openBracket]['line'] !== $tokens[$closeBracket]['line']) { - return true; - } - - return false; - - }//end isMultiLineCall() - - - /** - * Processes single-line calls. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * @param int $openBracket The position of the opening bracket - * in the stack passed in $tokens. - * @param array $tokens The stack of tokens that make up - * the file. - * - * @return void - */ - public function processSingleLineCall(File $phpcsFile, $stackPtr, $openBracket, $tokens) - { - $closer = $tokens[$openBracket]['parenthesis_closer']; - if ($openBracket === ($closer - 1)) { - return; - } - - // If the function call has no arguments or comments, enforce 0 spaces. - $next = $phpcsFile->findNext(T_WHITESPACE, ($openBracket + 1), $closer, true); - if ($next === false) { - $requiredSpacesAfterOpen = 0; - $requiredSpacesBeforeClose = 0; - } else { - $requiredSpacesAfterOpen = $this->requiredSpacesAfterOpen; - $requiredSpacesBeforeClose = $this->requiredSpacesBeforeClose; - } - - if ($requiredSpacesAfterOpen === 0 && $tokens[($openBracket + 1)]['code'] === T_WHITESPACE) { - // Checking this: $value = my_function([*]...). - $error = 'Space after opening parenthesis of function call prohibited'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterOpenBracket'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($openBracket + 1), ''); - } - } else if ($requiredSpacesAfterOpen > 0) { - $spaceAfterOpen = 0; - if ($tokens[($openBracket + 1)]['code'] === T_WHITESPACE) { - $spaceAfterOpen = $tokens[($openBracket + 1)]['length']; - } - - if ($spaceAfterOpen !== $requiredSpacesAfterOpen) { - $error = 'Expected %s spaces after opening parenthesis; %s found'; - $data = [ - $requiredSpacesAfterOpen, - $spaceAfterOpen, - ]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterOpenBracket', $data); - if ($fix === true) { - $padding = str_repeat(' ', $requiredSpacesAfterOpen); - if ($spaceAfterOpen === 0) { - $phpcsFile->fixer->addContent($openBracket, $padding); - } else { - $phpcsFile->fixer->replaceToken(($openBracket + 1), $padding); - } - } - } - }//end if - - // Checking this: $value = my_function(...[*]). - $spaceBeforeClose = 0; - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($closer - 1), $openBracket, true); - if ($tokens[$prev]['code'] === T_END_HEREDOC || $tokens[$prev]['code'] === T_END_NOWDOC) { - // Need a newline after these tokens, so ignore this rule. - return; - } - - if ($tokens[$prev]['line'] !== $tokens[$closer]['line']) { - $spaceBeforeClose = 'newline'; - } else if ($tokens[($closer - 1)]['code'] === T_WHITESPACE) { - $spaceBeforeClose = $tokens[($closer - 1)]['length']; - } - - if ($spaceBeforeClose !== $requiredSpacesBeforeClose) { - $error = 'Expected %s spaces before closing parenthesis; %s found'; - $data = [ - $requiredSpacesBeforeClose, - $spaceBeforeClose, - ]; - $fix = $phpcsFile->addFixableError($error, $closer, 'SpaceBeforeCloseBracket', $data); - if ($fix === true) { - $padding = str_repeat(' ', $requiredSpacesBeforeClose); - - if ($spaceBeforeClose === 0) { - $phpcsFile->fixer->addContentBefore($closer, $padding); - } else if ($spaceBeforeClose === 'newline') { - $phpcsFile->fixer->beginChangeset(); - - $closingContent = ')'; - - $next = $phpcsFile->findNext(T_WHITESPACE, ($closer + 1), null, true); - if ($tokens[$next]['code'] === T_SEMICOLON) { - $closingContent .= ';'; - for ($i = ($closer + 1); $i <= $next; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - } - - // We want to jump over any whitespace or inline comment and - // move the closing parenthesis after any other token. - $prev = ($closer - 1); - while (isset(Tokens::$emptyTokens[$tokens[$prev]['code']]) === true) { - if (($tokens[$prev]['code'] === T_COMMENT) - && (strpos($tokens[$prev]['content'], '*/') !== false) - ) { - break; - } - - $prev--; - } - - $phpcsFile->fixer->addContent($prev, $padding.$closingContent); - - $prevNonWhitespace = $phpcsFile->findPrevious(T_WHITESPACE, ($closer - 1), null, true); - for ($i = ($prevNonWhitespace + 1); $i <= $closer; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } else { - $phpcsFile->fixer->replaceToken(($closer - 1), $padding); - }//end if - }//end if - }//end if - - }//end processSingleLineCall() - - - /** - * Processes multi-line calls. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * @param int $openBracket The position of the opening bracket - * in the stack passed in $tokens. - * @param array $tokens The stack of tokens that make up - * the file. - * - * @return void - */ - public function processMultiLineCall(File $phpcsFile, $stackPtr, $openBracket, $tokens) - { - // We need to work out how far indented the function - // call itself is, so we can work out how far to - // indent the arguments. - $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $stackPtr, true); - if ($tokens[$first]['code'] === T_CONSTANT_ENCAPSED_STRING - && $tokens[($first - 1)]['code'] === T_CONSTANT_ENCAPSED_STRING - ) { - // We are in a multi-line string, so find the start and use - // the indent from there. - $prev = $phpcsFile->findPrevious(T_CONSTANT_ENCAPSED_STRING, ($first - 2), null, true); - $first = $phpcsFile->findFirstOnLine(Tokens::$emptyTokens, $prev, true); - if ($first === false) { - $first = ($prev + 1); - } - } - - $foundFunctionIndent = 0; - if ($first !== false) { - if ($tokens[$first]['code'] === T_INLINE_HTML - || ($tokens[$first]['code'] === T_CONSTANT_ENCAPSED_STRING - && $tokens[($first - 1)]['code'] === T_CONSTANT_ENCAPSED_STRING) - ) { - $trimmed = ltrim($tokens[$first]['content']); - if ($trimmed === '') { - $foundFunctionIndent = strlen($tokens[$first]['content']); - } else { - $foundFunctionIndent = (strlen($tokens[$first]['content']) - strlen($trimmed)); - } - } else { - $foundFunctionIndent = ($tokens[$first]['column'] - 1); - } - } - - // Make sure the function indent is divisible by the indent size. - // We round down here because this accounts for times when the - // surrounding code is indented a little too far in, and not correctly - // at a tab stop. Without this, the function will be indented a further - // $indent spaces to the right. - $functionIndent = (int) (floor($foundFunctionIndent / $this->indent) * $this->indent); - $adjustment = 0; - - if ($foundFunctionIndent !== $functionIndent) { - $error = 'Opening statement of multi-line function call not indented correctly; expected %s spaces but found %s'; - $data = [ - $functionIndent, - $foundFunctionIndent, - ]; - - $fix = $phpcsFile->addFixableError($error, $first, 'OpeningIndent', $data); - if ($fix === true) { - $adjustment = ($functionIndent - $foundFunctionIndent); - $padding = str_repeat(' ', $functionIndent); - if ($foundFunctionIndent === 0) { - $phpcsFile->fixer->addContentBefore($first, $padding); - } else { - $phpcsFile->fixer->replaceToken(($first - 1), $padding); - } - } - } - - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($openBracket + 1), null, true); - if ($tokens[$next]['line'] === $tokens[$openBracket]['line']) { - $error = 'Opening parenthesis of a multi-line function call must be the last content on the line'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'ContentAfterOpenBracket'); - if ($fix === true) { - $phpcsFile->fixer->addContent( - $openBracket, - $phpcsFile->eolChar.str_repeat(' ', ($foundFunctionIndent + $this->indent)) - ); - } - } - - $closeBracket = $tokens[$openBracket]['parenthesis_closer']; - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($closeBracket - 1), null, true); - if ($tokens[$prev]['line'] === $tokens[$closeBracket]['line']) { - $error = 'Closing parenthesis of a multi-line function call must be on a line by itself'; - $fix = $phpcsFile->addFixableError($error, $closeBracket, 'CloseBracketLine'); - if ($fix === true) { - $phpcsFile->fixer->addContentBefore( - $closeBracket, - $phpcsFile->eolChar.str_repeat(' ', ($foundFunctionIndent + $this->indent)) - ); - } - } - - // Each line between the parenthesis should be indented n spaces. - $lastLine = ($tokens[$openBracket]['line'] - 1); - $argStart = null; - $argEnd = null; - - // Start processing at the first argument. - $i = $phpcsFile->findNext(T_WHITESPACE, ($openBracket + 1), null, true); - - if ($tokens[$i]['line'] > ($tokens[$openBracket]['line'] + 1)) { - $error = 'The first argument in a multi-line function call must be on the line after the opening parenthesis'; - $fix = $phpcsFile->addFixableError($error, $i, 'FirstArgumentPosition'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($x = ($openBracket + 1); $x < $i; $x++) { - if ($tokens[$x]['line'] === $tokens[$openBracket]['line']) { - continue; - } - - if ($tokens[$x]['line'] === $tokens[$i]['line']) { - break; - } - - $phpcsFile->fixer->replaceToken($x, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - }//end if - - $i = $phpcsFile->findNext(Tokens::$emptyTokens, ($openBracket + 1), null, true); - - if ($tokens[($i - 1)]['code'] === T_WHITESPACE - && $tokens[($i - 1)]['line'] === $tokens[$i]['line'] - ) { - // Make sure we check the indent. - $i--; - } - - for ($i; $i < $closeBracket; $i++) { - if ($i > $argStart && $i < $argEnd) { - $inArg = true; - } else { - $inArg = false; - } - - if ($tokens[$i]['line'] !== $lastLine) { - $lastLine = $tokens[$i]['line']; - - // Ignore heredoc indentation. - if (isset(Tokens::$heredocTokens[$tokens[$i]['code']]) === true) { - continue; - } - - // Ignore multi-line string indentation. - if (isset(Tokens::$stringTokens[$tokens[$i]['code']]) === true - && $tokens[$i]['code'] === $tokens[($i - 1)]['code'] - ) { - continue; - } - - // Ignore inline HTML. - if ($tokens[$i]['code'] === T_INLINE_HTML) { - continue; - } - - if ($tokens[$i]['line'] !== $tokens[$openBracket]['line']) { - // We changed lines, so this should be a whitespace indent token, but first make - // sure it isn't a blank line because we don't need to check indent unless there - // is actually some code to indent. - if ($tokens[$i]['code'] === T_WHITESPACE) { - $nextCode = $phpcsFile->findNext(T_WHITESPACE, ($i + 1), ($closeBracket + 1), true); - if ($tokens[$nextCode]['line'] !== $lastLine) { - if ($inArg === false) { - $error = 'Empty lines are not allowed in multi-line function calls'; - $fix = $phpcsFile->addFixableError($error, $i, 'EmptyLine'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($i, ''); - } - } - - continue; - } - } else { - $nextCode = $i; - } - - if ($tokens[$nextCode]['line'] === $tokens[$closeBracket]['line']) { - // Closing brace needs to be indented to the same level - // as the function call. - $inArg = false; - $expectedIndent = ($foundFunctionIndent + $adjustment); - } else { - $expectedIndent = ($foundFunctionIndent + $this->indent + $adjustment); - } - - if ($tokens[$i]['code'] !== T_WHITESPACE - && $tokens[$i]['code'] !== T_DOC_COMMENT_WHITESPACE - ) { - // Just check if it is a multi-line block comment. If so, we can - // calculate the indent from the whitespace before the content. - if ($tokens[$i]['code'] === T_COMMENT - && $tokens[($i - 1)]['code'] === T_COMMENT - ) { - $trimmedLength = strlen(ltrim($tokens[$i]['content'])); - if ($trimmedLength === 0) { - // This is a blank comment line, so indenting it is - // pointless. - continue; - } - - $foundIndent = (strlen($tokens[$i]['content']) - $trimmedLength); - } else { - $foundIndent = 0; - } - } else { - $foundIndent = $tokens[$i]['length']; - } - - if ($foundIndent < $expectedIndent - || ($inArg === false - && $expectedIndent !== $foundIndent) - ) { - $error = 'Multi-line function call not indented correctly; expected %s spaces but found %s'; - $data = [ - $expectedIndent, - $foundIndent, - ]; - - $fix = $phpcsFile->addFixableError($error, $i, 'Indent', $data); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - - $padding = str_repeat(' ', $expectedIndent); - if ($foundIndent === 0) { - $phpcsFile->fixer->addContentBefore($i, $padding); - if (isset($tokens[$i]['scope_opener']) === true) { - $phpcsFile->fixer->changeCodeBlockIndent($i, $tokens[$i]['scope_closer'], $expectedIndent); - } - } else { - if ($tokens[$i]['code'] === T_COMMENT) { - $comment = $padding.ltrim($tokens[$i]['content']); - $phpcsFile->fixer->replaceToken($i, $comment); - } else { - $phpcsFile->fixer->replaceToken($i, $padding); - } - - if (isset($tokens[($i + 1)]['scope_opener']) === true) { - $phpcsFile->fixer->changeCodeBlockIndent(($i + 1), $tokens[($i + 1)]['scope_closer'], ($expectedIndent - $foundIndent)); - } - } - - $phpcsFile->fixer->endChangeset(); - }//end if - }//end if - } else { - $nextCode = $i; - }//end if - - if ($inArg === false) { - $argStart = $nextCode; - $argEnd = $phpcsFile->findEndOfStatement($nextCode, [T_COLON]); - } - }//end if - - // If we are within an argument we should be ignoring commas - // as these are not signalling the end of an argument. - if ($inArg === false && $tokens[$i]['code'] === T_COMMA) { - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($i + 1), $closeBracket, true); - if ($next === false) { - continue; - } - - if ($this->allowMultipleArguments === false) { - // Comma has to be the last token on the line. - if ($tokens[$i]['line'] === $tokens[$next]['line']) { - $error = 'Only one argument is allowed per line in a multi-line function call'; - $fix = $phpcsFile->addFixableError($error, $next, 'MultipleArguments'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($x = ($next - 1); $x > $i; $x--) { - if ($tokens[$x]['code'] !== T_WHITESPACE) { - break; - } - - $phpcsFile->fixer->replaceToken($x, ''); - } - - $phpcsFile->fixer->addContentBefore( - $next, - $phpcsFile->eolChar.str_repeat(' ', ($foundFunctionIndent + $this->indent)) - ); - $phpcsFile->fixer->endChangeset(); - } - } - }//end if - - $argStart = $next; - $argEnd = $phpcsFile->findEndOfStatement($next, [T_COLON]); - }//end if - }//end for - - }//end processMultiLineCall() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php deleted file mode 100644 index bd59a7c..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php +++ /dev/null @@ -1,522 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Standards\Generic\Sniffs\Functions\OpeningFunctionBraceBsdAllmanSniff; -use PHP_CodeSniffer\Standards\Generic\Sniffs\Functions\OpeningFunctionBraceKernighanRitchieSniff; -use PHP_CodeSniffer\Util\Tokens; - -class FunctionDeclarationSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - /** - * The number of spaces code should be indented. - * - * @var integer - */ - public $indent = 4; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_FUNCTION, - T_CLOSURE, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]['parenthesis_opener']) === false - || isset($tokens[$stackPtr]['parenthesis_closer']) === false - || $tokens[$stackPtr]['parenthesis_opener'] === null - || $tokens[$stackPtr]['parenthesis_closer'] === null - ) { - return; - } - - $openBracket = $tokens[$stackPtr]['parenthesis_opener']; - $closeBracket = $tokens[$stackPtr]['parenthesis_closer']; - - if (strtolower($tokens[$stackPtr]['content']) === 'function') { - // Must be one space after the FUNCTION keyword. - if ($tokens[($stackPtr + 1)]['content'] === $phpcsFile->eolChar) { - $spaces = 'newline'; - } else if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE) { - $spaces = $tokens[($stackPtr + 1)]['length']; - } else { - $spaces = 0; - } - - if ($spaces !== 1) { - $error = 'Expected 1 space after FUNCTION keyword; %s found'; - $data = [$spaces]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterFunction', $data); - if ($fix === true) { - if ($spaces === 0) { - $phpcsFile->fixer->addContent($stackPtr, ' '); - } else { - $phpcsFile->fixer->replaceToken(($stackPtr + 1), ' '); - } - } - } - }//end if - - // Must be no space before the opening parenthesis. For closures, this is - // enforced by the previous check because there is no content between the keywords - // and the opening parenthesis. - // Unfinished closures are tokenized as T_FUNCTION however, and can be excluded - // by checking for the scope_opener. - if ($tokens[$stackPtr]['code'] === T_FUNCTION - && (isset($tokens[$stackPtr]['scope_opener']) === true || $phpcsFile->getMethodProperties($stackPtr)['has_body'] === false) - ) { - if ($tokens[($openBracket - 1)]['content'] === $phpcsFile->eolChar) { - $spaces = 'newline'; - } else if ($tokens[($openBracket - 1)]['code'] === T_WHITESPACE) { - $spaces = $tokens[($openBracket - 1)]['length']; - } else { - $spaces = 0; - } - - if ($spaces !== 0) { - $error = 'Expected 0 spaces before opening parenthesis; %s found'; - $data = [$spaces]; - $fix = $phpcsFile->addFixableError($error, $openBracket, 'SpaceBeforeOpenParen', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($openBracket - 1), ''); - } - } - - // Must be no space before semicolon in abstract/interface methods. - if ($phpcsFile->getMethodProperties($stackPtr)['has_body'] === false) { - $end = $phpcsFile->findNext(T_SEMICOLON, $closeBracket); - if ($tokens[($end - 1)]['content'] === $phpcsFile->eolChar) { - $spaces = 'newline'; - } else if ($tokens[($end - 1)]['code'] === T_WHITESPACE) { - $spaces = $tokens[($end - 1)]['length']; - } else { - $spaces = 0; - } - - if ($spaces !== 0) { - $error = 'Expected 0 spaces before semicolon; %s found'; - $data = [$spaces]; - $fix = $phpcsFile->addFixableError($error, $end, 'SpaceBeforeSemicolon', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($end - 1), ''); - } - } - } - }//end if - - // Must be one space before and after USE keyword for closures. - if ($tokens[$stackPtr]['code'] === T_CLOSURE) { - $use = $phpcsFile->findNext(T_USE, ($closeBracket + 1), $tokens[$stackPtr]['scope_opener']); - if ($use !== false) { - if ($tokens[($use + 1)]['code'] !== T_WHITESPACE) { - $length = 0; - } else if ($tokens[($use + 1)]['content'] === "\t") { - $length = '\t'; - } else { - $length = $tokens[($use + 1)]['length']; - } - - if ($length !== 1) { - $error = 'Expected 1 space after USE keyword; found %s'; - $data = [$length]; - $fix = $phpcsFile->addFixableError($error, $use, 'SpaceAfterUse', $data); - if ($fix === true) { - if ($length === 0) { - $phpcsFile->fixer->addContent($use, ' '); - } else { - $phpcsFile->fixer->replaceToken(($use + 1), ' '); - } - } - } - - if ($tokens[($use - 1)]['code'] !== T_WHITESPACE) { - $length = 0; - } else if ($tokens[($use - 1)]['content'] === "\t") { - $length = '\t'; - } else { - $length = $tokens[($use - 1)]['length']; - } - - if ($length !== 1) { - $error = 'Expected 1 space before USE keyword; found %s'; - $data = [$length]; - $fix = $phpcsFile->addFixableError($error, $use, 'SpaceBeforeUse', $data); - if ($fix === true) { - if ($length === 0) { - $phpcsFile->fixer->addContentBefore($use, ' '); - } else { - $phpcsFile->fixer->replaceToken(($use - 1), ' '); - } - } - } - }//end if - }//end if - - if ($this->isMultiLineDeclaration($phpcsFile, $stackPtr, $openBracket, $tokens) === true) { - $this->processMultiLineDeclaration($phpcsFile, $stackPtr, $tokens); - } else { - $this->processSingleLineDeclaration($phpcsFile, $stackPtr, $tokens); - } - - }//end process() - - - /** - * Determine if this is a multi-line function declaration. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * @param int $openBracket The position of the opening bracket - * in the stack passed in $tokens. - * @param array $tokens The stack of tokens that make up - * the file. - * - * @return bool - */ - public function isMultiLineDeclaration($phpcsFile, $stackPtr, $openBracket, $tokens) - { - $closeBracket = $tokens[$openBracket]['parenthesis_closer']; - if ($tokens[$openBracket]['line'] !== $tokens[$closeBracket]['line']) { - return true; - } - - // Closures may use the USE keyword and so be multi-line in this way. - if ($tokens[$stackPtr]['code'] === T_CLOSURE) { - $use = $phpcsFile->findNext(T_USE, ($closeBracket + 1), $tokens[$stackPtr]['scope_opener']); - if ($use !== false) { - // If the opening and closing parenthesis of the use statement - // are also on the same line, this is a single line declaration. - $open = $phpcsFile->findNext(T_OPEN_PARENTHESIS, ($use + 1)); - $close = $tokens[$open]['parenthesis_closer']; - if ($tokens[$open]['line'] !== $tokens[$close]['line']) { - return true; - } - } - } - - return false; - - }//end isMultiLineDeclaration() - - - /** - * Processes single-line declarations. - * - * Just uses the Generic BSD-Allman brace sniff. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * @param array $tokens The stack of tokens that make up - * the file. - * - * @return void - */ - public function processSingleLineDeclaration($phpcsFile, $stackPtr, $tokens) - { - if ($tokens[$stackPtr]['code'] === T_CLOSURE) { - $sniff = new OpeningFunctionBraceKernighanRitchieSniff(); - } else { - $sniff = new OpeningFunctionBraceBsdAllmanSniff(); - } - - $sniff->checkClosures = true; - $sniff->process($phpcsFile, $stackPtr); - - }//end processSingleLineDeclaration() - - - /** - * Processes multi-line declarations. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * @param array $tokens The stack of tokens that make up - * the file. - * - * @return void - */ - public function processMultiLineDeclaration($phpcsFile, $stackPtr, $tokens) - { - $this->processArgumentList($phpcsFile, $stackPtr, $this->indent); - - $closeBracket = $tokens[$stackPtr]['parenthesis_closer']; - if ($tokens[$stackPtr]['code'] === T_CLOSURE) { - $use = $phpcsFile->findNext(T_USE, ($closeBracket + 1), $tokens[$stackPtr]['scope_opener']); - if ($use !== false) { - $open = $phpcsFile->findNext(T_OPEN_PARENTHESIS, ($use + 1)); - $closeBracket = $tokens[$open]['parenthesis_closer']; - } - } - - if (isset($tokens[$stackPtr]['scope_opener']) === false) { - return; - } - - // The opening brace needs to be one space away from the closing parenthesis. - $opener = $tokens[$stackPtr]['scope_opener']; - if ($tokens[$opener]['line'] !== $tokens[$closeBracket]['line']) { - $error = 'The closing parenthesis and the opening brace of a multi-line function declaration must be on the same line'; - $fix = $phpcsFile->addFixableError($error, $opener, 'NewlineBeforeOpenBrace'); - if ($fix === true) { - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($opener - 1), $closeBracket, true); - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->addContent($prev, ' {'); - - // If the opener is on a line by itself, removing it will create - // an empty line, so just remove the entire line instead. - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($opener - 1), $closeBracket, true); - $next = $phpcsFile->findNext(T_WHITESPACE, ($opener + 1), null, true); - - if ($tokens[$prev]['line'] < $tokens[$opener]['line'] - && $tokens[$next]['line'] > $tokens[$opener]['line'] - ) { - // Clear the whole line. - for ($i = ($prev + 1); $i < $next; $i++) { - if ($tokens[$i]['line'] === $tokens[$opener]['line']) { - $phpcsFile->fixer->replaceToken($i, ''); - } - } - } else { - // Just remove the opener. - $phpcsFile->fixer->replaceToken($opener, ''); - if ($tokens[$next]['line'] === $tokens[$opener]['line']) { - $phpcsFile->fixer->replaceToken(($opener + 1), ''); - } - } - - $phpcsFile->fixer->endChangeset(); - }//end if - } else { - $prev = $tokens[($opener - 1)]; - if ($prev['code'] !== T_WHITESPACE) { - $length = 0; - } else { - $length = strlen($prev['content']); - } - - if ($length !== 1) { - $error = 'There must be a single space between the closing parenthesis and the opening brace of a multi-line function declaration; found %s spaces'; - $fix = $phpcsFile->addFixableError($error, ($opener - 1), 'SpaceBeforeOpenBrace', [$length]); - if ($fix === true) { - if ($length === 0) { - $phpcsFile->fixer->addContentBefore($opener, ' '); - } else { - $phpcsFile->fixer->replaceToken(($opener - 1), ' '); - } - } - - return; - }//end if - }//end if - - }//end processMultiLineDeclaration() - - - /** - * Processes multi-line argument list declarations. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * @param int $indent The number of spaces code should be indented. - * @param string $type The type of the token the brackets - * belong to. - * - * @return void - */ - public function processArgumentList($phpcsFile, $stackPtr, $indent, $type='function') - { - $tokens = $phpcsFile->getTokens(); - - // We need to work out how far indented the function - // declaration itself is, so we can work out how far to - // indent parameters. - $functionIndent = 0; - for ($i = ($stackPtr - 1); $i >= 0; $i--) { - if ($tokens[$i]['line'] !== $tokens[$stackPtr]['line']) { - break; - } - } - - // Move $i back to the line the function is or to 0. - $i++; - - if ($tokens[$i]['code'] === T_WHITESPACE) { - $functionIndent = $tokens[$i]['length']; - } - - // The closing parenthesis must be on a new line, even - // when checking abstract function definitions. - $closeBracket = $tokens[$stackPtr]['parenthesis_closer']; - $prev = $phpcsFile->findPrevious( - T_WHITESPACE, - ($closeBracket - 1), - null, - true - ); - - if ($tokens[$closeBracket]['line'] !== $tokens[$tokens[$closeBracket]['parenthesis_opener']]['line'] - && $tokens[$prev]['line'] === $tokens[$closeBracket]['line'] - ) { - $error = 'The closing parenthesis of a multi-line '.$type.' declaration must be on a new line'; - $fix = $phpcsFile->addFixableError($error, $closeBracket, 'CloseBracketLine'); - if ($fix === true) { - $phpcsFile->fixer->addNewlineBefore($closeBracket); - } - } - - // If this is a closure and is using a USE statement, the closing - // parenthesis we need to look at from now on is the closing parenthesis - // of the USE statement. - if ($tokens[$stackPtr]['code'] === T_CLOSURE) { - $use = $phpcsFile->findNext(T_USE, ($closeBracket + 1), $tokens[$stackPtr]['scope_opener']); - if ($use !== false) { - $open = $phpcsFile->findNext(T_OPEN_PARENTHESIS, ($use + 1)); - $closeBracket = $tokens[$open]['parenthesis_closer']; - - $prev = $phpcsFile->findPrevious( - T_WHITESPACE, - ($closeBracket - 1), - null, - true - ); - - if ($tokens[$closeBracket]['line'] !== $tokens[$tokens[$closeBracket]['parenthesis_opener']]['line'] - && $tokens[$prev]['line'] === $tokens[$closeBracket]['line'] - ) { - $error = 'The closing parenthesis of a multi-line use declaration must be on a new line'; - $fix = $phpcsFile->addFixableError($error, $closeBracket, 'UseCloseBracketLine'); - if ($fix === true) { - $phpcsFile->fixer->addNewlineBefore($closeBracket); - } - } - }//end if - }//end if - - // Each line between the parenthesis should be indented 4 spaces. - $openBracket = $tokens[$stackPtr]['parenthesis_opener']; - $lastLine = $tokens[$openBracket]['line']; - for ($i = ($openBracket + 1); $i < $closeBracket; $i++) { - if ($tokens[$i]['line'] !== $lastLine) { - if ($i === $tokens[$stackPtr]['parenthesis_closer'] - || ($tokens[$i]['code'] === T_WHITESPACE - && (($i + 1) === $closeBracket - || ($i + 1) === $tokens[$stackPtr]['parenthesis_closer'])) - ) { - // Closing braces need to be indented to the same level - // as the function. - $expectedIndent = $functionIndent; - } else { - $expectedIndent = ($functionIndent + $indent); - } - - // We changed lines, so this should be a whitespace indent token. - $foundIndent = 0; - if ($tokens[$i]['code'] === T_WHITESPACE - && $tokens[$i]['line'] !== $tokens[($i + 1)]['line'] - ) { - $error = 'Blank lines are not allowed in a multi-line '.$type.' declaration'; - $fix = $phpcsFile->addFixableError($error, $i, 'EmptyLine'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - // This is an empty line, so don't check the indent. - continue; - } else if ($tokens[$i]['code'] === T_WHITESPACE) { - $foundIndent = $tokens[$i]['length']; - } else if ($tokens[$i]['code'] === T_DOC_COMMENT_WHITESPACE) { - $foundIndent = $tokens[$i]['length']; - ++$expectedIndent; - } - - if ($expectedIndent !== $foundIndent) { - $error = 'Multi-line '.$type.' declaration not indented correctly; expected %s spaces but found %s'; - $data = [ - $expectedIndent, - $foundIndent, - ]; - - $fix = $phpcsFile->addFixableError($error, $i, 'Indent', $data); - if ($fix === true) { - $spaces = str_repeat(' ', $expectedIndent); - if ($foundIndent === 0) { - $phpcsFile->fixer->addContentBefore($i, $spaces); - } else { - $phpcsFile->fixer->replaceToken($i, $spaces); - } - } - } - - $lastLine = $tokens[$i]['line']; - }//end if - - if ($tokens[$i]['code'] === T_ARRAY || $tokens[$i]['code'] === T_OPEN_SHORT_ARRAY) { - // Skip arrays as they have their own indentation rules. - if ($tokens[$i]['code'] === T_OPEN_SHORT_ARRAY) { - $i = $tokens[$i]['bracket_closer']; - } else { - $i = $tokens[$i]['parenthesis_closer']; - } - - $lastLine = $tokens[$i]['line']; - continue; - } - - if ($tokens[$i]['code'] === T_ATTRIBUTE) { - // Skip attributes as they have their own indentation rules. - $i = $tokens[$i]['attribute_closer']; - $lastLine = $tokens[$i]['line']; - continue; - } - }//end for - - }//end processArgumentList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/ValidDefaultValueSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/ValidDefaultValueSniff.php deleted file mode 100644 index f134707..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/ValidDefaultValueSniff.php +++ /dev/null @@ -1,78 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class ValidDefaultValueSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return int[] - */ - public function register() - { - return [ - T_FUNCTION, - T_CLOSURE, - T_FN, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - // Flag for when we have found a default in our arg list. - // If there is a value without a default after this, it is an error. - $defaultFound = false; - - $params = $phpcsFile->getMethodParameters($stackPtr); - foreach ($params as $param) { - if ($param['variable_length'] === true) { - continue; - } - - if (array_key_exists('default', $param) === true) { - $defaultFound = true; - // Check if the arg is type hinted and using NULL for the default. - // This does not make the argument optional - it just allows NULL - // to be passed in. - if ($param['type_hint'] !== '' && strtolower($param['default']) === 'null') { - $defaultFound = false; - } - - continue; - } - - if ($defaultFound === true) { - $error = 'Arguments with default values must be at the end of the argument list'; - $phpcsFile->addError($error, $param['token'], 'NotAtEnd'); - return; - } - }//end foreach - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidClassNameSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidClassNameSniff.php deleted file mode 100644 index 34ca283..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidClassNameSniff.php +++ /dev/null @@ -1,97 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\NamingConventions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class ValidClassNameSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_CLASS, - T_INTERFACE, - T_TRAIT, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being processed. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $className = $phpcsFile->findNext(T_STRING, $stackPtr); - $name = trim($tokens[$className]['content']); - $errorData = [ucfirst($tokens[$stackPtr]['content'])]; - - // Make sure the first letter is a capital. - if (preg_match('|^[A-Z]|', $name) === 0) { - $error = '%s name must begin with a capital letter'; - $phpcsFile->addError($error, $stackPtr, 'StartWithCapital', $errorData); - } - - // Check that each new word starts with a capital as well, but don't - // check the first word, as it is checked above. - $validName = true; - $nameBits = explode('_', $name); - $firstBit = array_shift($nameBits); - foreach ($nameBits as $bit) { - if ($bit === '' || $bit[0] !== strtoupper($bit[0])) { - $validName = false; - break; - } - } - - if ($validName === false) { - // Strip underscores because they cause the suggested name - // to be incorrect. - $nameBits = explode('_', trim($name, '_')); - $firstBit = array_shift($nameBits); - if ($firstBit === '') { - $error = '%s name is not valid'; - $phpcsFile->addError($error, $stackPtr, 'Invalid', $errorData); - } else { - $newName = strtoupper($firstBit[0]).substr($firstBit, 1).'_'; - foreach ($nameBits as $bit) { - if ($bit !== '') { - $newName .= strtoupper($bit[0]).substr($bit, 1).'_'; - } - } - - $newName = rtrim($newName, '_'); - $error = '%s name is not valid; consider %s instead'; - $data = $errorData; - $data[] = $newName; - $phpcsFile->addError($error, $stackPtr, 'Invalid', $data); - } - }//end if - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidFunctionNameSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidFunctionNameSniff.php deleted file mode 100644 index e7f87d4..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidFunctionNameSniff.php +++ /dev/null @@ -1,284 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\NamingConventions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\AbstractScopeSniff; -use PHP_CodeSniffer\Util\Common; -use PHP_CodeSniffer\Util\Tokens; - -class ValidFunctionNameSniff extends AbstractScopeSniff -{ - - /** - * A list of all PHP magic methods. - * - * @var array - */ - protected $magicMethods = [ - 'construct' => true, - 'destruct' => true, - 'call' => true, - 'callstatic' => true, - 'get' => true, - 'set' => true, - 'isset' => true, - 'unset' => true, - 'sleep' => true, - 'wakeup' => true, - 'serialize' => true, - 'unserialize' => true, - 'tostring' => true, - 'invoke' => true, - 'set_state' => true, - 'clone' => true, - 'debuginfo' => true, - ]; - - /** - * A list of all PHP magic functions. - * - * @var array - */ - protected $magicFunctions = ['autoload' => true]; - - - /** - * Constructs a PEAR_Sniffs_NamingConventions_ValidFunctionNameSniff. - */ - public function __construct() - { - parent::__construct(Tokens::$ooScopeTokens, [T_FUNCTION], true); - - }//end __construct() - - - /** - * Processes the tokens within the scope. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being processed. - * @param int $stackPtr The position where this token was - * found. - * @param int $currScope The position of the current scope. - * - * @return void - */ - protected function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScope) - { - $tokens = $phpcsFile->getTokens(); - - // Determine if this is a function which needs to be examined. - $conditions = $tokens[$stackPtr]['conditions']; - end($conditions); - $deepestScope = key($conditions); - if ($deepestScope !== $currScope) { - return; - } - - $methodName = $phpcsFile->getDeclarationName($stackPtr); - if ($methodName === null) { - // Ignore closures. - return; - } - - $className = $phpcsFile->getDeclarationName($currScope); - if (isset($className) === false) { - $className = '[Anonymous Class]'; - } - - $errorData = [$className.'::'.$methodName]; - - $methodNameLc = strtolower($methodName); - $classNameLc = strtolower($className); - - // Is this a magic method. i.e., is prefixed with "__" ? - if (preg_match('|^__[^_]|', $methodName) !== 0) { - $magicPart = substr($methodNameLc, 2); - if (isset($this->magicMethods[$magicPart]) === true) { - return; - } - - $error = 'Method name "%s" is invalid; only PHP magic methods should be prefixed with a double underscore'; - $phpcsFile->addError($error, $stackPtr, 'MethodDoubleUnderscore', $errorData); - } - - // PHP4 constructors are allowed to break our rules. - if ($methodNameLc === $classNameLc) { - return; - } - - // PHP4 destructors are allowed to break our rules. - if ($methodNameLc === '_'.$classNameLc) { - return; - } - - $methodProps = $phpcsFile->getMethodProperties($stackPtr); - $scope = $methodProps['scope']; - $scopeSpecified = $methodProps['scope_specified']; - - if ($methodProps['scope'] === 'private') { - $isPublic = false; - } else { - $isPublic = true; - } - - // If it's a private method, it must have an underscore on the front. - if ($isPublic === false) { - if ($methodName[0] !== '_') { - $error = 'Private method name "%s" must be prefixed with an underscore'; - $phpcsFile->addError($error, $stackPtr, 'PrivateNoUnderscore', $errorData); - $phpcsFile->recordMetric($stackPtr, 'Private method prefixed with underscore', 'no'); - } else { - $phpcsFile->recordMetric($stackPtr, 'Private method prefixed with underscore', 'yes'); - } - } - - // If it's not a private method, it must not have an underscore on the front. - if ($isPublic === true && $scopeSpecified === true && $methodName[0] === '_') { - $error = '%s method name "%s" must not be prefixed with an underscore'; - $data = [ - ucfirst($scope), - $errorData[0], - ]; - $phpcsFile->addError($error, $stackPtr, 'PublicUnderscore', $data); - } - - $testMethodName = ltrim($methodName, '_'); - - if (Common::isCamelCaps($testMethodName, false, true, false) === false) { - if ($scopeSpecified === true) { - $error = '%s method name "%s" is not in camel caps format'; - $data = [ - ucfirst($scope), - $errorData[0], - ]; - $phpcsFile->addError($error, $stackPtr, 'ScopeNotCamelCaps', $data); - } else { - $error = 'Method name "%s" is not in camel caps format'; - $phpcsFile->addError($error, $stackPtr, 'NotCamelCaps', $errorData); - } - } - - }//end processTokenWithinScope() - - - /** - * Processes the tokens outside the scope. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being processed. - * @param int $stackPtr The position where this token was - * found. - * - * @return void - */ - protected function processTokenOutsideScope(File $phpcsFile, $stackPtr) - { - $functionName = $phpcsFile->getDeclarationName($stackPtr); - if ($functionName === null) { - // Ignore closures. - return; - } - - if (ltrim($functionName, '_') === '') { - // Ignore special functions. - return; - } - - $errorData = [$functionName]; - - // Is this a magic function. i.e., it is prefixed with "__". - if (preg_match('|^__[^_]|', $functionName) !== 0) { - $magicPart = strtolower(substr($functionName, 2)); - if (isset($this->magicFunctions[$magicPart]) === true) { - return; - } - - $error = 'Function name "%s" is invalid; only PHP magic methods should be prefixed with a double underscore'; - $phpcsFile->addError($error, $stackPtr, 'FunctionDoubleUnderscore', $errorData); - } - - // Function names can be in two parts; the package name and - // the function name. - $packagePart = ''; - $underscorePos = strrpos($functionName, '_'); - if ($underscorePos === false) { - $camelCapsPart = $functionName; - } else { - $packagePart = substr($functionName, 0, $underscorePos); - $camelCapsPart = substr($functionName, ($underscorePos + 1)); - - // We don't care about _'s on the front. - $packagePart = ltrim($packagePart, '_'); - } - - // If it has a package part, make sure the first letter is a capital. - if ($packagePart !== '') { - if ($functionName[0] === '_') { - $error = 'Function name "%s" is invalid; only private methods should be prefixed with an underscore'; - $phpcsFile->addError($error, $stackPtr, 'FunctionUnderscore', $errorData); - } - - if ($functionName[0] !== strtoupper($functionName[0])) { - $error = 'Function name "%s" is prefixed with a package name but does not begin with a capital letter'; - $phpcsFile->addError($error, $stackPtr, 'FunctionNoCapital', $errorData); - } - } - - // If it doesn't have a camel caps part, it's not valid. - if (trim($camelCapsPart) === '') { - $error = 'Function name "%s" is not valid; name appears incomplete'; - $phpcsFile->addError($error, $stackPtr, 'FunctionInvalid', $errorData); - return; - } - - $validName = true; - $newPackagePart = $packagePart; - $newCamelCapsPart = $camelCapsPart; - - // Every function must have a camel caps part, so check that first. - if (Common::isCamelCaps($camelCapsPart, false, true, false) === false) { - $validName = false; - $newCamelCapsPart = strtolower($camelCapsPart[0]).substr($camelCapsPart, 1); - } - - if ($packagePart !== '') { - // Check that each new word starts with a capital. - $nameBits = explode('_', $packagePart); - $nameBits = array_filter($nameBits); - foreach ($nameBits as $bit) { - if ($bit[0] !== strtoupper($bit[0])) { - $newPackagePart = ''; - foreach ($nameBits as $bit) { - $newPackagePart .= strtoupper($bit[0]).substr($bit, 1).'_'; - } - - $validName = false; - break; - } - } - } - - if ($validName === false) { - if ($newPackagePart === '') { - $newName = $newCamelCapsPart; - } else { - $newName = rtrim($newPackagePart, '_').'_'.$newCamelCapsPart; - } - - $error = 'Function name "%s" is invalid; consider "%s" instead'; - $data = $errorData; - $data[] = $newName; - $phpcsFile->addError($error, $stackPtr, 'FunctionNameInvalid', $data); - } - - }//end processTokenOutsideScope() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidVariableNameSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidVariableNameSniff.php deleted file mode 100644 index 89af5df..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidVariableNameSniff.php +++ /dev/null @@ -1,103 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\NamingConventions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\AbstractVariableSniff; - -class ValidVariableNameSniff extends AbstractVariableSniff -{ - - - /** - * Processes class member variables. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - protected function processMemberVar(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $memberProps = $phpcsFile->getMemberProperties($stackPtr); - if (empty($memberProps) === true) { - return; - } - - $memberName = ltrim($tokens[$stackPtr]['content'], '$'); - $scope = $memberProps['scope']; - $scopeSpecified = $memberProps['scope_specified']; - - if ($memberProps['scope'] === 'private') { - $isPublic = false; - } else { - $isPublic = true; - } - - // If it's a private member, it must have an underscore on the front. - if ($isPublic === false && $memberName[0] !== '_') { - $error = 'Private member variable "%s" must be prefixed with an underscore'; - $data = [$memberName]; - $phpcsFile->addError($error, $stackPtr, 'PrivateNoUnderscore', $data); - return; - } - - // If it's not a private member, it must not have an underscore on the front. - if ($isPublic === true && $scopeSpecified === true && $memberName[0] === '_') { - $error = '%s member variable "%s" must not be prefixed with an underscore'; - $data = [ - ucfirst($scope), - $memberName, - ]; - $phpcsFile->addError($error, $stackPtr, 'PublicUnderscore', $data); - return; - } - - }//end processMemberVar() - - - /** - * Processes normal variables. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position where the token was found. - * - * @return void - */ - protected function processVariable(File $phpcsFile, $stackPtr) - { - /* - We don't care about normal variables. - */ - - }//end processVariable() - - - /** - * Processes variables in double quoted strings. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position where the token was found. - * - * @return void - */ - protected function processVariableInString(File $phpcsFile, $stackPtr) - { - /* - We don't care about normal variables. - */ - - }//end processVariableInString() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php deleted file mode 100644 index fb1b79a..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php +++ /dev/null @@ -1,204 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\WhiteSpace; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class ObjectOperatorIndentSniff implements Sniff -{ - - /** - * The number of spaces code should be indented. - * - * @var integer - */ - public $indent = 4; - - /** - * Indicates whether multilevel indenting is allowed. - * - * @var boolean - */ - public $multilevel = false; - - /** - * Tokens to listen for. - * - * @var array - */ - private $targets = [ - T_OBJECT_OPERATOR, - T_NULLSAFE_OBJECT_OPERATOR, - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return int[] - */ - public function register() - { - return $this->targets; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile All the tokens found in the document. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Make sure this is the first object operator in a chain of them. - $start = $phpcsFile->findStartOfStatement($stackPtr); - $prev = $phpcsFile->findPrevious($this->targets, ($stackPtr - 1), $start); - if ($prev !== false) { - return; - } - - // Make sure this is a chained call. - $end = $phpcsFile->findEndOfStatement($stackPtr); - $next = $phpcsFile->findNext($this->targets, ($stackPtr + 1), $end); - if ($next === false) { - // Not a chained call. - return; - } - - // Determine correct indent. - for ($i = ($start - 1); $i >= 0; $i--) { - if ($tokens[$i]['line'] !== $tokens[$start]['line']) { - $i++; - break; - } - } - - $baseIndent = 0; - if ($i >= 0 && $tokens[$i]['code'] === T_WHITESPACE) { - $baseIndent = $tokens[$i]['length']; - } - - $baseIndent += $this->indent; - - // Determine the scope of the original object operator. - $origBrackets = null; - if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) { - $origBrackets = $tokens[$stackPtr]['nested_parenthesis']; - } - - $origConditions = null; - if (isset($tokens[$stackPtr]['conditions']) === true) { - $origConditions = $tokens[$stackPtr]['conditions']; - } - - // Check indentation of each object operator in the chain. - // If the first object operator is on a different line than - // the variable, make sure we check its indentation too. - if ($tokens[$stackPtr]['line'] > $tokens[$start]['line']) { - $next = $stackPtr; - } - - $previousIndent = $baseIndent; - - while ($next !== false) { - // Make sure it is in the same scope, otherwise don't check indent. - $brackets = null; - if (isset($tokens[$next]['nested_parenthesis']) === true) { - $brackets = $tokens[$next]['nested_parenthesis']; - } - - $conditions = null; - if (isset($tokens[$next]['conditions']) === true) { - $conditions = $tokens[$next]['conditions']; - } - - if ($origBrackets === $brackets && $origConditions === $conditions) { - // Make sure it starts a line, otherwise don't check indent. - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($next - 1), $stackPtr, true); - $indent = $tokens[($next - 1)]; - if ($tokens[$prev]['line'] !== $tokens[$next]['line'] - && $indent['code'] === T_WHITESPACE - ) { - if ($indent['line'] === $tokens[$next]['line']) { - $foundIndent = strlen($indent['content']); - } else { - $foundIndent = 0; - } - - $minIndent = $previousIndent; - $maxIndent = $previousIndent; - $expectedIndent = $previousIndent; - - if ($this->multilevel === true) { - $minIndent = max(($previousIndent - $this->indent), $baseIndent); - $maxIndent = ($previousIndent + $this->indent); - $expectedIndent = min(max($foundIndent, $minIndent), $maxIndent); - } - - if ($foundIndent < $minIndent || $foundIndent > $maxIndent) { - $error = 'Object operator not indented correctly; expected %s spaces but found %s'; - $data = [ - $expectedIndent, - $foundIndent, - ]; - - $fix = $phpcsFile->addFixableError($error, $next, 'Incorrect', $data); - if ($fix === true) { - $spaces = str_repeat(' ', $expectedIndent); - if ($foundIndent === 0) { - $phpcsFile->fixer->addContentBefore($next, $spaces); - } else { - $phpcsFile->fixer->replaceToken(($next - 1), $spaces); - } - } - } - - $previousIndent = $expectedIndent; - }//end if - - // It cant be the last thing on the line either. - $content = $phpcsFile->findNext(T_WHITESPACE, ($next + 1), null, true); - if ($tokens[$content]['line'] !== $tokens[$next]['line']) { - $error = 'Object operator must be at the start of the line, not the end'; - $fix = $phpcsFile->addFixableError($error, $next, 'StartOfLine'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($x = ($next + 1); $x < $content; $x++) { - $phpcsFile->fixer->replaceToken($x, ''); - } - - $phpcsFile->fixer->addNewlineBefore($next); - $phpcsFile->fixer->endChangeset(); - } - } - }//end if - - $next = $phpcsFile->findNext( - $this->targets, - ($next + 1), - null, - false, - null, - true - ); - }//end while - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php deleted file mode 100644 index 097754e..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php +++ /dev/null @@ -1,179 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\WhiteSpace; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class ScopeClosingBraceSniff implements Sniff -{ - - /** - * The number of spaces code should be indented. - * - * @var integer - */ - public $indent = 4; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return int[] - */ - public function register() - { - return Tokens::$scopeOpeners; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile All the tokens found in the document. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // If this is an inline condition (ie. there is no scope opener), then - // return, as this is not a new scope. - if (isset($tokens[$stackPtr]['scope_closer']) === false) { - return; - } - - $scopeStart = $tokens[$stackPtr]['scope_opener']; - $scopeEnd = $tokens[$stackPtr]['scope_closer']; - - // If the scope closer doesn't think it belongs to this scope opener - // then the opener is sharing its closer with other tokens. We only - // want to process the closer once, so skip this one. - if (isset($tokens[$scopeEnd]['scope_condition']) === false - || $tokens[$scopeEnd]['scope_condition'] !== $stackPtr - ) { - return; - } - - // We need to actually find the first piece of content on this line, - // because if this is a method with tokens before it (public, static etc) - // or an if with an else before it, then we need to start the scope - // checking from there, rather than the current token. - $lineStart = ($stackPtr - 1); - for ($lineStart; $lineStart > 0; $lineStart--) { - if (strpos($tokens[$lineStart]['content'], $phpcsFile->eolChar) !== false) { - break; - } - } - - $lineStart++; - - $startColumn = 1; - if ($tokens[$lineStart]['code'] === T_WHITESPACE) { - $startColumn = $tokens[($lineStart + 1)]['column']; - } else if ($tokens[$lineStart]['code'] === T_INLINE_HTML) { - $trimmed = ltrim($tokens[$lineStart]['content']); - if ($trimmed === '') { - $startColumn = $tokens[($lineStart + 1)]['column']; - } else { - $startColumn = (strlen($tokens[$lineStart]['content']) - strlen($trimmed)); - } - } - - // Check that the closing brace is on it's own line. - $lastContent = $phpcsFile->findPrevious( - [ - T_WHITESPACE, - T_INLINE_HTML, - T_OPEN_TAG, - ], - ($scopeEnd - 1), - $scopeStart, - true - ); - - if ($tokens[$lastContent]['line'] === $tokens[$scopeEnd]['line']) { - $error = 'Closing brace must be on a line by itself'; - $fix = $phpcsFile->addFixableError($error, $scopeEnd, 'Line'); - if ($fix === true) { - $phpcsFile->fixer->addNewlineBefore($scopeEnd); - } - - return; - } - - // Check now that the closing brace is lined up correctly. - $lineStart = ($scopeEnd - 1); - for ($lineStart; $lineStart > 0; $lineStart--) { - if (strpos($tokens[$lineStart]['content'], $phpcsFile->eolChar) !== false) { - break; - } - } - - $lineStart++; - - $braceIndent = 0; - if ($tokens[$lineStart]['code'] === T_WHITESPACE) { - $braceIndent = ($tokens[($lineStart + 1)]['column'] - 1); - } else if ($tokens[$lineStart]['code'] === T_INLINE_HTML) { - $trimmed = ltrim($tokens[$lineStart]['content']); - if ($trimmed === '') { - $braceIndent = ($tokens[($lineStart + 1)]['column'] - 1); - } else { - $braceIndent = (strlen($tokens[$lineStart]['content']) - strlen($trimmed) - 1); - } - } - - $fix = false; - if ($tokens[$stackPtr]['code'] === T_CASE - || $tokens[$stackPtr]['code'] === T_DEFAULT - ) { - // BREAK statements should be indented n spaces from the - // CASE or DEFAULT statement. - $expectedIndent = ($startColumn + $this->indent - 1); - if ($braceIndent !== $expectedIndent) { - $error = 'Case breaking statement indented incorrectly; expected %s spaces, found %s'; - $data = [ - $expectedIndent, - $braceIndent, - ]; - $fix = $phpcsFile->addFixableError($error, $scopeEnd, 'BreakIndent', $data); - } - } else { - $expectedIndent = max(0, ($startColumn - 1)); - if ($braceIndent !== $expectedIndent) { - $error = 'Closing brace indented incorrectly; expected %s spaces, found %s'; - $data = [ - $expectedIndent, - $braceIndent, - ]; - $fix = $phpcsFile->addFixableError($error, $scopeEnd, 'Indent', $data); - } - }//end if - - if ($fix === true) { - $spaces = str_repeat(' ', $expectedIndent); - if ($braceIndent === 0) { - $phpcsFile->fixer->addContentBefore($lineStart, $spaces); - } else { - $phpcsFile->fixer->replaceToken($lineStart, ltrim($tokens[$lineStart]['content'])); - $phpcsFile->fixer->addContentBefore($lineStart, $spaces); - } - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ScopeIndentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ScopeIndentSniff.php deleted file mode 100644 index 2620d20..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ScopeIndentSniff.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\WhiteSpace; - -use PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\ScopeIndentSniff as GenericScopeIndentSniff; - -class ScopeIndentSniff extends GenericScopeIndentSniff -{ - - /** - * Any scope openers that should not cause an indent. - * - * @var int[] - */ - protected $nonIndentingScopes = [T_SWITCH]; - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.1.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.1.inc deleted file mode 100644 index d97ef4d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.1.inc +++ /dev/null @@ -1,112 +0,0 @@ -setLogger(new class {}); - -var_dump(new class(10) extends SomeClass implements SomeInterface { - private $num; - - public function __construct($num) - { - $this->num = $num; - } - - use SomeTrait; -}); - -class IncorrectClassDeclarationWithCommentAtEnd extends correctClassDeclaration /* Comment */ { -} - -class CorrectClassDeclarationWithCommentAtEnd extends correctClassDeclaration -/* Comment */ -{ -} - -// Don't move phpcs:ignore comments. -class PHPCSIgnoreAnnotationAfterOpeningBrace -{ // phpcs:ignore Standard.Cat.Sniff -- for reasons. -} - -// Moving any of the other trailing phpcs: comments is ok. -class PHPCSAnnotationAfterOpeningBrace -{ // phpcs:disable Standard.Cat.Sniff -- for reasons. -} - -if (!class_exists('ClassOpeningBraceShouldBeIndented')) { - abstract class ClassOpeningBraceShouldBeIndented -{ -} -} - -if (!class_exists('ClassOpeningBraceTooMuchIndentation')) { - final class ClassOpeningBraceTooMuchIndentation - { - } -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.1.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.1.inc.fixed deleted file mode 100644 index 5b0a2f9..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.1.inc.fixed +++ /dev/null @@ -1,121 +0,0 @@ -setLogger(new class {}); - -var_dump(new class(10) extends SomeClass implements SomeInterface { - private $num; - - public function __construct($num) - { - $this->num = $num; - } - - use SomeTrait; -}); - -class IncorrectClassDeclarationWithCommentAtEnd extends correctClassDeclaration /* Comment */ -{ -} - -class CorrectClassDeclarationWithCommentAtEnd extends correctClassDeclaration -/* Comment */ -{ -} - -// Don't move phpcs:ignore comments. -class PHPCSIgnoreAnnotationAfterOpeningBrace -{ // phpcs:ignore Standard.Cat.Sniff -- for reasons. -} - -// Moving any of the other trailing phpcs: comments is ok. -class PHPCSAnnotationAfterOpeningBrace -{ - // phpcs:disable Standard.Cat.Sniff -- for reasons. -} - -if (!class_exists('ClassOpeningBraceShouldBeIndented')) { - abstract class ClassOpeningBraceShouldBeIndented - { -} -} - -if (!class_exists('ClassOpeningBraceTooMuchIndentation')) { - final class ClassOpeningBraceTooMuchIndentation - { - } -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.2.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.2.inc deleted file mode 100644 index ac71fc9..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.2.inc +++ /dev/null @@ -1,11 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Tests\Classes; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ClassDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Get a list of CLI values to set before the file is tested. - * - * @param string $testFile The name of the file being tested. - * @param \PHP_CodeSniffer\Config $config The config data for the test run. - * - * @return void - */ - public function setCliValues($testFile, $config) - { - if ($testFile === 'ClassDeclarationUnitTest.1.inc') { - return; - } - - $config->tabWidth = 4; - - }//end setCliValues() - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'ClassDeclarationUnitTest.1.inc': - return [ - 21 => 1, - 22 => 1, - 23 => 1, - 27 => 1, - 33 => 1, - 38 => 1, - 49 => 1, - 84 => 1, - 94 => 1, - 99 => 1, - 104 => 1, - 110 => 1, - ]; - - default: - return []; - }//end switch - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getWarningList($testFile='') - { - if ($testFile === 'ClassDeclarationUnitTest.2.inc') { - return [11 => 1]; - } - - return[]; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/ClassCommentUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/ClassCommentUnitTest.inc deleted file mode 100644 index 8414efb..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/ClassCommentUnitTest.inc +++ /dev/null @@ -1,135 +0,0 @@ - - * @copyright 2006-2014 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * @version Release: 1.0 - * @link http://pear.php.net/package/PHP_CodeSniffer - */ -class Extra_Description_Newlines -{ - -}//end class - - -/** - * Sample class comment - * @category PHP - * @package PHP_CodeSniffer - * @author Greg Sherwood - * @copyright 2006-2014 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * @version - * @link http://pear.php.net/package/PHP_CodeSniffer - */ -class Missing_Newlines_Before_Tags -{ - -}//end class - - -/** - * Simple class comment - * - * @category _wrong_category - * @package PHP_CodeSniffer - * @package ADDITIONAL PACKAGE TAG - * @subpackage SUBPACKAGE TAG - * @author Original Author - * @author Greg Sherwood gsherwood@squiz.net - * @author Mr T - * @author - * @copyright 1997~1994 The PHP Group - * @license http://www.php.net/license/3_0.txt - * @version INVALID VERSION CONTENT - * @see - * @see - * @link sdfsdf - * @see Net_Sample::Net_Sample() - * @see Net_Other - * @deprecated asd - * @unknown Unknown tag - * @since Class available since Release 1.2.0 - */ -class Checking_Tags -{ - class Sub_Class { - - }//end class - - -}//end class - - -/** - * - * - */ -class Empty_Class_Doc -{ - -}//end class - - -/** - * - * - */ -interface Empty_Interface_Doc -{ - -}//end interface - - -/** - * - * - */ -trait Empty_Trait_Doc -{ - -}//end trait - - -/** - * Sample class comment - * - * @category PHP - * @package PHP_CodeSniffer - * @author Greg Sherwood - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * @link http://pear.php.net/package/PHP_CodeSniffer - */ -#[Authenticate('admin_logged_in')] -class TodoController extends AbstractController implements MustBeLoggedInInterface -{ -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/ClassCommentUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/ClassCommentUnitTest.php deleted file mode 100644 index 9a4bcf7..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/ClassCommentUnitTest.php +++ /dev/null @@ -1,70 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Tests\Commenting; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ClassCommentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 4 => 1, - 15 => 1, - 51 => 1, - 63 => 1, - 65 => 2, - 66 => 1, - 68 => 1, - 70 => 1, - 71 => 1, - 72 => 1, - 74 => 2, - 75 => 1, - 76 => 1, - 77 => 1, - 85 => 1, - 96 => 5, - 106 => 5, - 116 => 5, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return [ - 71 => 1, - 73 => 1, - ]; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FileCommentUnitTest.1.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FileCommentUnitTest.1.inc deleted file mode 100644 index 0b18fa3..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FileCommentUnitTest.1.inc +++ /dev/null @@ -1,53 +0,0 @@ - -* @author Greg Sherwood gsherwood@squiz.net -* @author Mr T -* @author -* @copyright 1997~1994 The PHP Group -* @copyright 1997~1994 The PHP Group -* @license http://www.php.net/license/3_0.txt -* @see -* @see -* @version INVALID VERSION CONTENT -* @see Net_Sample::Net_Sample() -* @see Net_Other -* @deprecated asd -* @since Class available since Release 1.2.0 -* @summary An unknown summary tag -* @package '' -* @subpackage !! -* @author Code AUthor -*/ -require_once '/some/path.php'; -?> - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FileCommentUnitTest.2.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FileCommentUnitTest.2.inc deleted file mode 100644 index 8845eb1..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FileCommentUnitTest.2.inc +++ /dev/null @@ -1,9 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Tests\Commenting; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class FileCommentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='FileCommentUnitTest.inc') - { - switch ($testFile) { - case 'FileCommentUnitTest.1.inc': - return [ - 21 => 1, - 23 => 2, - 24 => 1, - 26 => 1, - 28 => 1, - 29 => 1, - 30 => 1, - 31 => 1, - 32 => 2, - 33 => 1, - 34 => 1, - 35 => 1, - 40 => 2, - 41 => 2, - 43 => 1, - ]; - - case 'FileCommentUnitTest.2.inc': - return [1 => 1]; - - default: - return []; - }//end switch - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getWarningList($testFile='FileCommentUnitTest.inc') - { - switch ($testFile) { - case 'FileCommentUnitTest.1.inc': - return [ - 29 => 1, - 30 => 1, - 34 => 1, - 43 => 1, - ]; - - default: - return []; - }//end switch - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.inc deleted file mode 100644 index 5c3295f..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.inc +++ /dev/null @@ -1,478 +0,0 @@ - line numbers for each token. - * - * @param array $tokens The array of tokens to process. - * @param object $tokenizer The tokenizer being used to process this file. - * @param string $eolChar The EOL character to use for splitting strings. - * - * @return void - */ -function foo(&$tokens, $tokenizer, $eolChar) -{ - -}//end foo() - -/** - * Gettext. - * - */ -function _() { - return $foo; -} - -class Baz { - /** - * The PHP5 constructor - * - * No return tag - */ - public function __construct() { - - } -} - -/** - * Complete a step. - * - * @param string $status Status of step to complete. - * @param array $array Array. - * @param string $note Optional note. - * - * @return void - */ -function completeStep($status, array $array = [Class1::class, 'test'], $note = '') { - echo 'foo'; -} - -/** - * Variadic function. - * - * @param string $name1 Comment. - * @param string ...$name2 Comment. - * - * @return void - */ -function myFunction(string $name1, string ...$name2) { -} - - -/** - * Variadic function. - * - * @param string $name1 Comment. - * @param string $name2 Comment. - * - * @return void - */ -function myFunction(string $name1, string ...$name2) { -} - -/** - * Completely invalid format, but should not cause PHP notices. - * - * @param $bar - * Comment here. - * @param ... - * Additional arguments here. - * - * @return - * Return value - * - */ -function foo($bar) { -} - -/** - * Processes the test. - * - * @param PHP_CodeSniffer\Files\File $phpcsFile The PHP_CodeSniffer file where the - * token occurred. - * @param int $stackPtr The position in the tokens stack - * where the listening token type - * was found. - * - * @return void - * @see register() - */ -function process(File $phpcsFile, $stackPtr) -{ - -}//end process() - -/** - * Processes the test. - * - * @param int $phpcsFile The PHP_CodeSniffer - * file where the - * token occurred. - * @param int $stackPtr The position in the tokens stack - * where the listening token type - * was found. - * - * @return void - * @see register() - */ -function process(File $phpcsFile, $stackPtr) -{ - -}//end process() - -/** - * @param (Foo&Bar)|null $a Comment. - * @param string $b Comment. - * - * @return void - */ -public function setTranslator($a, &$b): void -{ - $this->translator = $translator; -} - -// phpcs:set PEAR.Commenting.FunctionComment minimumVisibility protected -private function setTranslator2($a, &$b): void -{ - $this->translator = $translator; -} - -// phpcs:set PEAR.Commenting.FunctionComment minimumVisibility public -protected function setTranslator3($a, &$b): void -{ - $this->translator = $translator; -} - -private function setTranslator4($a, &$b): void -{ - $this->translator = $translator; -} - -class Bar { - /** - * The PHP5 constructor - * - * @return - */ - public function __construct() { - - } -} - -// phpcs:set PEAR.Commenting.FunctionComment specialMethods[] -class Bar { - /** - * The PHP5 constructor - */ - public function __construct() { - - } -} - -// phpcs:set PEAR.Commenting.FunctionComment specialMethods[] ignored -/** - * Should be ok - */ -public function ignored() { - -} - -// phpcs:set PEAR.Commenting.FunctionComment specialMethods[] __construct,__destruct - -class Something implements JsonSerializable { - /** - * Single attribute. - * - * @return mixed - */ - #[ReturnTypeWillChange] - public function jsonSerialize() {} - - /** - * Multiple attributes. - * - * @return Something - */ - #[AttributeA] - #[AttributeB] - public function methodName() {} - - /** - * Blank line between docblock and attribute. - * - * @return mixed - */ - - #[ReturnTypeWillChange] - public function blankLineDetectionA() {} - - /** - * Blank line between attribute and function declaration. - * - * @return mixed - */ - #[ReturnTypeWillChange] - - public function blankLineDetectionB() {} - - /** - * Blank line between both docblock and attribute and attribute and function declaration. - * - * @return mixed - */ - - #[ReturnTypeWillChange] - - public function blankLineDetectionC() {} -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.inc.fixed deleted file mode 100644 index 751b09c..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.inc.fixed +++ /dev/null @@ -1,478 +0,0 @@ - line numbers for each token. - * - * @param array $tokens The array of tokens to process. - * @param object $tokenizer The tokenizer being used to process this file. - * @param string $eolChar The EOL character to use for splitting strings. - * - * @return void - */ -function foo(&$tokens, $tokenizer, $eolChar) -{ - -}//end foo() - -/** - * Gettext. - * - */ -function _() { - return $foo; -} - -class Baz { - /** - * The PHP5 constructor - * - * No return tag - */ - public function __construct() { - - } -} - -/** - * Complete a step. - * - * @param string $status Status of step to complete. - * @param array $array Array. - * @param string $note Optional note. - * - * @return void - */ -function completeStep($status, array $array = [Class1::class, 'test'], $note = '') { - echo 'foo'; -} - -/** - * Variadic function. - * - * @param string $name1 Comment. - * @param string ...$name2 Comment. - * - * @return void - */ -function myFunction(string $name1, string ...$name2) { -} - - -/** - * Variadic function. - * - * @param string $name1 Comment. - * @param string $name2 Comment. - * - * @return void - */ -function myFunction(string $name1, string ...$name2) { -} - -/** - * Completely invalid format, but should not cause PHP notices. - * - * @param $bar - * Comment here. - * @param ... - * Additional arguments here. - * - * @return - * Return value - * - */ -function foo($bar) { -} - -/** - * Processes the test. - * - * @param PHP_CodeSniffer\Files\File $phpcsFile The PHP_CodeSniffer file where the - * token occurred. - * @param int $stackPtr The position in the tokens stack - * where the listening token type - * was found. - * - * @return void - * @see register() - */ -function process(File $phpcsFile, $stackPtr) -{ - -}//end process() - -/** - * Processes the test. - * - * @param int $phpcsFile The PHP_CodeSniffer - * file where the - * token occurred. - * @param int $stackPtr The position in the tokens stack - * where the listening token type - * was found. - * - * @return void - * @see register() - */ -function process(File $phpcsFile, $stackPtr) -{ - -}//end process() - -/** - * @param (Foo&Bar)|null $a Comment. - * @param string $b Comment. - * - * @return void - */ -public function setTranslator($a, &$b): void -{ - $this->translator = $translator; -} - -// phpcs:set PEAR.Commenting.FunctionComment minimumVisibility protected -private function setTranslator2($a, &$b): void -{ - $this->translator = $translator; -} - -// phpcs:set PEAR.Commenting.FunctionComment minimumVisibility public -protected function setTranslator3($a, &$b): void -{ - $this->translator = $translator; -} - -private function setTranslator4($a, &$b): void -{ - $this->translator = $translator; -} - -class Bar { - /** - * The PHP5 constructor - * - * @return - */ - public function __construct() { - - } -} - -// phpcs:set PEAR.Commenting.FunctionComment specialMethods[] -class Bar { - /** - * The PHP5 constructor - */ - public function __construct() { - - } -} - -// phpcs:set PEAR.Commenting.FunctionComment specialMethods[] ignored -/** - * Should be ok - */ -public function ignored() { - -} - -// phpcs:set PEAR.Commenting.FunctionComment specialMethods[] __construct,__destruct - -class Something implements JsonSerializable { - /** - * Single attribute. - * - * @return mixed - */ - #[ReturnTypeWillChange] - public function jsonSerialize() {} - - /** - * Multiple attributes. - * - * @return Something - */ - #[AttributeA] - #[AttributeB] - public function methodName() {} - - /** - * Blank line between docblock and attribute. - * - * @return mixed - */ - - #[ReturnTypeWillChange] - public function blankLineDetectionA() {} - - /** - * Blank line between attribute and function declaration. - * - * @return mixed - */ - #[ReturnTypeWillChange] - - public function blankLineDetectionB() {} - - /** - * Blank line between both docblock and attribute and attribute and function declaration. - * - * @return mixed - */ - - #[ReturnTypeWillChange] - - public function blankLineDetectionC() {} -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.php deleted file mode 100644 index 734ff73..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.php +++ /dev/null @@ -1,96 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Tests\Commenting; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class FunctionCommentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 5 => 1, - 10 => 1, - 12 => 1, - 13 => 1, - 14 => 1, - 15 => 1, - 28 => 1, - 76 => 1, - 87 => 1, - 103 => 1, - 109 => 1, - 112 => 1, - 122 => 1, - 123 => 2, - 124 => 2, - 125 => 1, - 126 => 1, - 137 => 1, - 138 => 1, - 139 => 1, - 152 => 1, - 155 => 1, - 165 => 1, - 172 => 1, - 183 => 1, - 190 => 2, - 206 => 1, - 234 => 1, - 272 => 1, - 313 => 1, - 317 => 1, - 327 => 1, - 329 => 1, - 332 => 1, - 344 => 1, - 343 => 1, - 345 => 1, - 346 => 1, - 360 => 1, - 361 => 1, - 363 => 1, - 364 => 1, - 406 => 1, - 417 => 1, - 455 => 1, - 464 => 1, - 473 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/InlineCommentUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/InlineCommentUnitTest.inc deleted file mode 100644 index 187228c..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/InlineCommentUnitTest.inc +++ /dev/null @@ -1,29 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Tests\Commenting; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class InlineCommentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 15 => 1, - 24 => 1, - 25 => 1, - 27 => 1, - 28 => 1, - 29 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/ControlSignatureUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/ControlSignatureUnitTest.inc deleted file mode 100644 index cc9903a..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/ControlSignatureUnitTest.inc +++ /dev/null @@ -1,165 +0,0 @@ - 0); - -do -{ - echo $i; -} while ($i > 0); - -do -{ - echo $i; -} -while ($i > 0); - -do { echo $i; } while ($i > 0); - -do{ - echo $i; -}while($i > 0); - - -// while -while ($i < 1) { - echo $i; -} - -while($i < 1){ - echo $i; -} - -while ($i < 1) { echo $i; } - - -// for -for ($i = 1; $i < 1; $i++) { - echo $i; -} - -for($i = 1; $i < 1; $i++){ - echo $i; -} - -for ($i = 1; $i < 1; $i++) { echo $i; } - - -// foreach -foreach ($items as $item) { - echo $item; -} - -foreach($items as $item){ - echo $item; -} - -foreach ($items as $item) { echo $item; } - - -// if -if ($i == 0) { - $i = 1; -} - -if($i == 0){ - $i = 1; -} - -if ($i == 0) { $i = 1; } - - -// else -if ($i == 0) { - $i = 1; -} else { - $i = 0; -} - -if ($i == 0) { - $i = 1; -}else{ - $i = 0; -} - -if ($i == 0) { $i = 1; } else { $i = 0; } - - -// else -if ($i == 0) { - $i = 1; -} else { - $i = 0; -} - -if ($i == 0) { - $i = 1; -}else{ - $i = 0; -} - -if ($i == 0) { $i = 1; } else { $i = 0; } - - -// else if -if ($i == 0) { - $i = 1; -} else if ($i == 2) { - $i = 0; -} - -if ($i == 0) { - $i = 1; -} elseif ($i == 2) { - $i = 0; -} - -if ($i == 0) { - $i = 1; -}else if($i == 2){ - $i = 0; -} - -if ($i == 0) { - $i = 1; -}elseif($i == 2){ - $i = 0; -} - -if ($i == 0) { $i = 1; } else if ($i == 2) { $i = 0; } -if ($i == 0) { $i = 1; } elseif ($i == 2) { $i = 0; } - -if ($i == 0) { // this is ok because comments are allowed - $i = 1; -} - -if ($i == 0) {// this is ok because comments are allowed - $i = 1; -} - -if ($i == 0) { /* this is ok because comments are allowed*/ - $i = 1; -} - -if ($i == 0) -{ // this is not ok - $i = 1; -} - -if ($i == 0) /* this is ok */ { -} - -if ($i == 0) { -} -else { -} - -// match -$r = match ($x) { - 1 => 1, -}; - -$r = match( $x ){ 1 => 1 }; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/ControlSignatureUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/ControlSignatureUnitTest.php deleted file mode 100644 index 98c3463..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/ControlSignatureUnitTest.php +++ /dev/null @@ -1,72 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Tests\ControlStructures; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ControlSignatureUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 9 => 1, - 14 => 1, - 20 => 1, - 22 => 1, - 32 => 1, - 36 => 1, - 44 => 1, - 48 => 1, - 56 => 1, - 60 => 1, - 68 => 1, - 72 => 1, - 84 => 1, - 88 => 2, - 100 => 1, - 104 => 2, - 122 => 2, - 128 => 1, - 132 => 3, - 133 => 2, - 147 => 1, - 157 => 1, - 165 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.inc deleted file mode 100644 index a7a3c69..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.inc +++ /dev/null @@ -1,251 +0,0 @@ - -

    some text

    -errorCode() == 401 || // comment - $IPP->errorCode() == 3200) /* long comment - here - */ -{ - return false; -} - -if ($IPP->errorCode() == 401 || // comment - $IPP->errorCode() == 3200) // long comment here -{ - return false; -} - -if ($IPP->errorCode() == 401 - // Comment explaining the next condition here. - || $IPP->errorCode() == 3200 -) { - return false; -} - -function bar() { - if ($a - && $b -) { - return false; - } -} - -if ($a - && foo( - 'a', - 'b' - )) { - return false; -} - -?> - - - - - -errorCode() == 401 || // phpcs:ignore Standard.Category.Sniff -- for reasons. - $IPP->errorCode() == 3200) /* - phpcs:ignore Standard.Category.Sniff -- for reasons. - */ -{ - return false; -} - -if ($IPP->errorCode() == 401 || // phpcs:disable Standard.Category.Sniff -- for reasons. - $IPP->errorCode() == 3200) // phpcs:enable -{ - return false; -} - -if ($IPP->errorCode() == 401 - // phpcs:ignore Standard.Category.Sniff -- for reasons. - || $IPP->errorCode() == 3200 -) { - return false; -} - - if ($IPP->errorCode() == 401 || - /* - * phpcs:disable Standard.Category.Sniff -- for reasons. - */ - $IPP->errorCode() == 3200 - ) { - return false; - } - -if ($IPP->errorCode() == 401 - || $IPP->errorCode() == 3200 - // phpcs:ignore Standard.Category.Sniff -- for reasons. -) { - return false; -} - -if ($IPP->errorCode() == 401 - || $IPP->errorCode() - === 'someverylongexpectedoutput' -) { - return false; -} - -if ($IPP->errorCode() == 401 - || $IPP->errorCode() - // A comment. - === 'someverylongexpectedoutput' -) { - return false; -} - -if ($IPP->errorCode() == 401 - || $IPP->errorCode() - // phpcs:ignore Standard.Category.Sniff -- for reasons. - === 'someverylongexpectedoutput' -) { - return false; -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.inc.fixed deleted file mode 100644 index 7d56c46..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.inc.fixed +++ /dev/null @@ -1,247 +0,0 @@ - -

    some text

    -errorCode() == 401 // comment - || $IPP->errorCode() == 3200 /* long comment - here - */ -) { - return false; -} - -if ($IPP->errorCode() == 401 // comment - || $IPP->errorCode() == 3200 // long comment here -) { - return false; -} - -if ($IPP->errorCode() == 401 - // Comment explaining the next condition here. - || $IPP->errorCode() == 3200 -) { - return false; -} - -function bar() { - if ($a - && $b - ) { - return false; - } -} - -if ($a - && foo( - 'a', - 'b' - ) -) { - return false; -} - -?> - - - - - -errorCode() == 401 // phpcs:ignore Standard.Category.Sniff -- for reasons. - || $IPP->errorCode() == 3200 /* - phpcs:ignore Standard.Category.Sniff -- for reasons. - */ -) { - return false; -} - -if ($IPP->errorCode() == 401 // phpcs:disable Standard.Category.Sniff -- for reasons. - || $IPP->errorCode() == 3200 // phpcs:enable -) { - return false; -} - -if ($IPP->errorCode() == 401 - // phpcs:ignore Standard.Category.Sniff -- for reasons. - || $IPP->errorCode() == 3200 -) { - return false; -} - - if ($IPP->errorCode() == 401 - /* - * phpcs:disable Standard.Category.Sniff -- for reasons. - */ - || $IPP->errorCode() == 3200 - ) { - return false; - } - -if ($IPP->errorCode() == 401 - || $IPP->errorCode() == 3200 - // phpcs:ignore Standard.Category.Sniff -- for reasons. -) { - return false; -} - -if ($IPP->errorCode() == 401 - || $IPP->errorCode() === 'someverylongexpectedoutput' -) { - return false; -} - -if ($IPP->errorCode() == 401 - || $IPP->errorCode() - // A comment. - === 'someverylongexpectedoutput' -) { - return false; -} - -if ($IPP->errorCode() == 401 - || $IPP->errorCode() - // phpcs:ignore Standard.Category.Sniff -- for reasons. - === 'someverylongexpectedoutput' -) { - return false; -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.js b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.js deleted file mode 100644 index 064d7ff..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.js +++ /dev/null @@ -1,251 +0,0 @@ -if (blah(param)) { - -} - -if ((condition1 - || condition2) - && condition3 - && condition4 - && condition5 -) { -} - -if ((condition1 || condition2) && condition3 && condition4 && condition5) { -} - -if ((condition1 || condition2) - && condition3 -) { -} - -if ( - (condition1 || condition2) - && condition3 -) { -} - -if ((condition1 - || condition2) -) { -} - -if ((condition1 - || condition2) - && condition3 && - condition4 -) { -} - -if ((condition1 - || condition2) - && condition3 - && condition4 - && condition5 -) { -} - -if (($condition1 - || $condition2) -) { -} - -if ((condition1 - || condition2) - ) { -} - -if ( - ( - condition1 - || condition2 - ) - && condition3 -) { -} - - -if ( condition1 - || condition2 - || condition3 -) { -} - -if (condition1 - || condition2 - || condition3 -) { -} else if (condition1 - || condition2 - || condition3 -) { -} - -if (condition1 - || condition2 - || condition3 -) { -} else if ( - condition1 - || condition2 && - condition3 -) { -} - -if (condition1 - || condition2 -|| condition3) { -} - -if (condition1 - || condition2 || condition3 -){ -} - -if (condition1) - console.info('bar'); - -if (condition1 - || condition2 -|| condition3) - console.info('bar'); - - -if (condition1 - || condition2 || condition3 -) - console.info('bar'); - -if (!a(post) - && (!a(context.header) - ^ a(context.header, 'Content-Type')) -) { -// ... -} - -if (foo) -{ - console.info('bar'); -} - -// Should be no errors even though lines are -// not exactly aligned together. Multi-line function -// call takes precedence. -if (array_key_exists(key, value) - && foo.bar.baz( - key, value2 - ) -) { -} - -if (true) { - foo = true; -}; - -if (foo == 401 || // comment - bar == 3200) /* long comment - here - */ -{ - return false; -} - -if (foo == 401 || // comment - bar == 3200) // long comment here -{ - return false; -} - -if (IPP.errorCode() == 401 - // Comment explaining the next condition here. - || IPP.errorCode() == 3200 -) { - return false; -} - -function bar() { - if (a - && b -) { - return false; - } -} - -if (a - && foo( - 'a', - 'b' - )) { - return false; -} - - - - - - - - - - - - - -if (foo == 401 || // phpcs:ignore Standard.Category.Sniff -- for reasons. - bar == 3200) /* - phpcs:ignore Standard.Category.Sniff -- for reasons. - */ -{ - return false; -} - -if (foo == 401 || // phpcs:disable Standard.Category.Sniff -- for reasons. - bar == 3200) // phpcs:enable -{ - return false; -} - -if (IPP.errorCode() == 401 - // phpcs:ignore Standard.Category.Sniff -- for reasons. - || IPP.errorCode() == 3200 -) { - return false; -} - - if (foo == 401 || - /* - * phpcs:disable Standard.Category.Sniff -- for reasons. - */ - bar == 3200 - ) { - return false; - } - -if (IPP.errorCode() == 401 - || IPP.errorCode() == 3200 - // phpcs:ignore Standard.Category.Sniff -- for reasons. -) { - return false; -} - -if (foo == 401 - || bar - == 'someverylongexpectedoutput' -) { - return false; -} - -if (IPP.errorCode() == 401 - || bar - // A comment. - == 'someverylongexpectedoutput' -) { - return false; -} - -if (foo == 401 - || IPP.errorCode() - // phpcs:ignore Standard.Category.Sniff -- for reasons. - == 'someverylongexpectedoutput' -) { - return false; -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.js.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.js.fixed deleted file mode 100644 index cfde75d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.js.fixed +++ /dev/null @@ -1,247 +0,0 @@ -if (blah(param)) { - -} - -if ((condition1 - || condition2) - && condition3 - && condition4 - && condition5 -) { -} - -if ((condition1 || condition2) && condition3 && condition4 && condition5) { -} - -if ((condition1 || condition2) - && condition3 -) { -} - -if ((condition1 || condition2) - && condition3 -) { -} - -if ((condition1 - || condition2) -) { -} - -if ((condition1 - || condition2) - && condition3 - && condition4 -) { -} - -if ((condition1 - || condition2) - && condition3 - && condition4 - && condition5 -) { -} - -if (($condition1 - || $condition2) -) { -} - -if ((condition1 - || condition2) -) { -} - -if ((condition1 - || condition2) - && condition3 -) { -} - - -if (condition1 - || condition2 - || condition3 -) { -} - -if (condition1 - || condition2 - || condition3 -) { -} else if (condition1 - || condition2 - || condition3 -) { -} - -if (condition1 - || condition2 - || condition3 -) { -} else if (condition1 - || condition2 - && condition3 -) { -} - -if (condition1 - || condition2 - || condition3 -) { -} - -if (condition1 - || condition2 || condition3 -) { -} - -if (condition1) - console.info('bar'); - -if (condition1 - || condition2 - || condition3 -) - console.info('bar'); - - -if (condition1 - || condition2 || condition3 -) - console.info('bar'); - -if (!a(post) - && (!a(context.header) - ^ a(context.header, 'Content-Type')) -) { -// ... -} - -if (foo) { - console.info('bar'); -} - -// Should be no errors even though lines are -// not exactly aligned together. Multi-line function -// call takes precedence. -if (array_key_exists(key, value) - && foo.bar.baz( - key, value2 - ) -) { -} - -if (true) { - foo = true; -}; - -if (foo == 401 // comment - || bar == 3200 /* long comment - here - */ -) { - return false; -} - -if (foo == 401 // comment - || bar == 3200 // long comment here -) { - return false; -} - -if (IPP.errorCode() == 401 - // Comment explaining the next condition here. - || IPP.errorCode() == 3200 -) { - return false; -} - -function bar() { - if (a - && b - ) { - return false; - } -} - -if (a - && foo( - 'a', - 'b' - ) -) { - return false; -} - - - - - - - - - - - - - -if (foo == 401 // phpcs:ignore Standard.Category.Sniff -- for reasons. - || bar == 3200 /* - phpcs:ignore Standard.Category.Sniff -- for reasons. - */ -) { - return false; -} - -if (foo == 401 // phpcs:disable Standard.Category.Sniff -- for reasons. - || bar == 3200 // phpcs:enable -) { - return false; -} - -if (IPP.errorCode() == 401 - // phpcs:ignore Standard.Category.Sniff -- for reasons. - || IPP.errorCode() == 3200 -) { - return false; -} - - if (foo == 401 - /* - * phpcs:disable Standard.Category.Sniff -- for reasons. - */ - || bar == 3200 - ) { - return false; - } - -if (IPP.errorCode() == 401 - || IPP.errorCode() == 3200 - // phpcs:ignore Standard.Category.Sniff -- for reasons. -) { - return false; -} - -if (foo == 401 - || bar == 'someverylongexpectedoutput' -) { - return false; -} - -if (IPP.errorCode() == 401 - || bar - // A comment. - == 'someverylongexpectedoutput' -) { - return false; -} - -if (foo == 401 - || IPP.errorCode() - // phpcs:ignore Standard.Category.Sniff -- for reasons. - == 'someverylongexpectedoutput' -) { - return false; -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.php deleted file mode 100644 index f78b4e3..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.php +++ /dev/null @@ -1,91 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Tests\ControlStructures; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class MultiLineConditionUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='MultiLineConditionUnitTest.inc') - { - $errors = [ - 21 => 1, - 22 => 1, - 35 => 1, - 40 => 1, - 41 => 1, - 42 => 1, - 43 => 1, - 49 => 1, - 54 => 1, - 57 => 1, - 58 => 1, - 59 => 1, - 61 => 1, - 67 => 1, - 87 => 1, - 88 => 1, - 89 => 1, - 90 => 1, - 96 => 2, - 101 => 1, - 109 => 2, - 125 => 1, - 145 => 2, - 153 => 2, - 168 => 1, - 177 => 1, - 194 => 2, - 202 => 2, - 215 => 1, - 218 => 2, - 232 => 2, - 239 => 1, - 240 => 2, - 248 => 2, - ]; - - if ($testFile === 'MultiLineConditionUnitTest.inc') { - $errors[183] = 1; - } - - return $errors; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Files/IncludingFileUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Files/IncludingFileUnitTest.inc deleted file mode 100644 index dadfe92..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Files/IncludingFileUnitTest.inc +++ /dev/null @@ -1,99 +0,0 @@ - -
    -Some content goes here.
    -
    -
    - -
    -    Some content goes here.
    -    
    -    
    - -
    -Some content goes here.
    -
    -
    - -
    -    Some content goes here.
    -    
    -    
    - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Tests\Files; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class IncludingFileUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 4 => 1, - 5 => 1, - 11 => 1, - 12 => 1, - 16 => 1, - 17 => 1, - 33 => 1, - 34 => 1, - 47 => 1, - 48 => 1, - 64 => 1, - 65 => 1, - 73 => 1, - 74 => 1, - 85 => 1, - 86 => 1, - 98 => 1, - 99 => 2, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Formatting/MultiLineAssignmentUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Formatting/MultiLineAssignmentUnitTest.inc deleted file mode 100644 index fc6aea0..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Formatting/MultiLineAssignmentUnitTest.inc +++ /dev/null @@ -1,22 +0,0 @@ -additionalHeaderData[$this->strApplicationName] - = $this->xajax->getJavascript(t3lib_extMgm::siteRelPath('nr_xajax')); - -$GLOBALS['TSFE']->additionalHeaderData[$this->strApplicationName] - = $this->xajax->getJavascript(t3lib_extMgm::siteRelPath('nr_xajax')); - -$GLOBALS['TSFE']->additionalHeaderData[$this->strApplicationName] = - $this->xajax->getJavascript(t3lib_extMgm::siteRelPath('nr_xajax')); - -$GLOBALS['TSFE']->additionalHeaderData[$this->strApplicationName] - = $this->xajax->getJavascript(t3lib_extMgm::siteRelPath('nr_xajax')); -$GLOBALS['TSFE']->additionalHeaderData[$this->strApplicationName] = 'boo'; - -$var='string'; - -function getInstalledStandards( - $includeGeneric=false, - $standardsDir='' -) { -} -?> diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Formatting/MultiLineAssignmentUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Formatting/MultiLineAssignmentUnitTest.php deleted file mode 100644 index 734d4fc..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Formatting/MultiLineAssignmentUnitTest.php +++ /dev/null @@ -1,52 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Tests\Formatting; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class MultiLineAssignmentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 3 => 1, - 6 => 1, - 8 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc deleted file mode 100644 index ed3d2c4..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc +++ /dev/null @@ -1,550 +0,0 @@ -getFoo() - ->doBar( - $this->getX() // no comma here - ->doY() // this is still the first method argument - ->doZ() // this is still the first method argument - ); -} - -$var = myFunction( -$foo, -$bar -); - -// phpcs:set PEAR.Functions.FunctionCallSignature allowMultipleArguments false - -fputs( - STDOUT, - "Examples: - $ {$app} , --all - $ {$app} --all", $something -); - -$array = array(); -array_map( - function($x) - { - return trim($x, $y); - }, $foo, - $array -); - -$bar = new stdClass( - 4, /* thanks */ 5, /* PSR-2 */ 6 -); - -function doSomething() -{ - return $this->getFoo() - ->doBar( - $this->getX() // no comma here - ->doY() // this is still the first method argument - ->doZ() // this is still the first method argument - ); -} - -doError( - 404, // status code - 'Not Found', // error name - 'Check your id' // fix -); - -// phpcs:set PEAR.Functions.FunctionCallSignature allowMultipleArguments true - -// Don't report errors for closing braces. Leave that to other sniffs. -foo( - [ - 'this', - 'is', - 'an', - 'array' - ], -[ - 'this', - 'is', - 'an', - 'array' - ], - array( - 'this', - 'is', -'an', -'array' - ), - array( - 'this', - 'is', - 'an', - 'array' - ), - function($x) - { - echo 'wee'; - - return trim($x); - } -); - -function foo() -{ - myFunction( - 'string'. - // comment - // comment - 'string'. - /* comment - * comment - */ - 'string' - ); -} - -// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesAfterOpen 1 -// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesBeforeClose 1 -test($arg, $arg2); -test( $arg, $arg2 ); -test( $arg, $arg2 ); -test(); -test( ); -test( ); -// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesAfterOpen 0 -// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesBeforeClose 0 - -?> - - - -
  • - log(// ... - 'error', - sprintf( - 'Message: %s', - isset($e->getData()['object']['evidence_details']) - ? $e->getData()['object']['evidence_details']['due_by'] - : '' - ), - array($e->getData()['object']) -); - -?> -
    - $class - ] - ); ?> -
    - - function ($x) { - return true; - }, - 'baz' => false - ) -); -$qux = array_filter( - $quux, function ($x) { - return $x; - } -); - -array_filter( - [1, 2], - function ($i) : bool { - return $i === 0; - } -); - -foo(array( - 'callback' => function () { - $foo = 'foo'; - return; - }, -)); - -foo( - $a, - /* - $c, - - $d, - */ - $e -); - -test( - 1,2,3,4 - ); - -class Test -{ - public function getInstance() - { - return new static( - 'arg', - 'foo' - ); - } - - public function getSelf() - { - return new self( - 'a','b', 'c' - ); - } -} - -$x = $var('y', -'x'); - -$obj->{$x}(1, - 2); - -return (function ($a, $b) { - return function ($c, $d) use ($a, $b) { - echo $a, $b, $c, $d; - }; -})( - 'a','b' -)('c', - 'd'); - -class Foo -{ - public function bar($a, $b) - { - if (!$a || !$b) { - return; - } - - (new stdClass())->a = $a; - } -} - -return (function ($a, $b) { - return function ($c, $d) use ($a, $b) { - echo $a, $b, $c, $d; - }; -})('a','b')('c','d'); - -function foo() -{ - Bar( - function () { - } - ); -} - -$deprecated_functions = [ - 'the_category_ID' - => function_call( // 7 spaces, not 8. This is the problem line. - $a, - $b - ), -]; - -$deprecated_functions = [ - 'the_category_ID' - => function_call( // 9 spaces, not 8. This is the problem line. - $a, - $b - ), -]; - -// phpcs:set PEAR.Functions.FunctionCallSignature allowMultipleArguments false - -printf( - '', - $obj->getName(), // Trailing comment. - $obj->getID(), // phpcs:ignore Standard.Category.SniffName -- for reasons. - $option -); - -// Handling of PHP 7.3 trailing comma's. -functionCall($args, $foo,); -functionCall( - $args, $foo, -); -functionCall( - $args, - $foo, -); - -// phpcs:set PEAR.Functions.FunctionCallSignature allowMultipleArguments true - -$this->foo( - - ['a','b'], - true - -); - -$this->foo( - - // Comment - ['a','b'], - true - -); - -function m() -{ - $t = ' - ' . (empty(true) ? ' - ' . f( - '1', - '2', - ) . ' - ' : ''); -} - -class C -{ - - public function m() - { - $a = []; - $t = - "SELECT * FROM t -WHERE f IN(" . implode( - ",", - $a - ) . ")"; - } -} - -$notices = array( - 'index' => sprintf( - translation_function('a text string with %s placeholder'), - 'replacement' - ), -); - -$componentType = $this->componentTypeRepository->findByType($this->identifier) ?: - $this->componentTypeFactory->createForType( - $this->identifier, - $this->className, - true, - $this->isPrototypal - ); - -return [ - 'export-path' => 'exports/database/' - . env( - 'APP_CUSTOMER', - 'not-configured' - ) - . '/' . env( - 'APP_IDENTIFIER', - 'not-configured' - ), -]; - -$methods .= - str_replace( - array_keys($replacements), - array_values($replacements), - $methodTemplate - ) - . PHP_EOL . PHP_EOL . str_repeat(' ', 4); - -$rangeValues['min'] = - $this->adjustLowerThreshold( - $this->normalizeRatingForFilter($rangeValues['min']) - ); - -$salesOrderThresholdTransfer->fromArray($salesOrderThresholdEntity->toArray(), true) - ->setSalesOrderThresholdValue( - $this->mapSalesOrderThresholdValueTransfer($salesOrderThresholdTransfer, $salesOrderThresholdEntity) - )->setCurrency( - (new CurrencyTransfer())->fromArray($salesOrderThresholdEntity->getCurrency()->toArray(), true) - )->setStore( - (new StoreTransfer())->fromArray($salesOrderThresholdEntity->getStore()->toArray(), true) - ); - -return trim(preg_replace_callback( - // sprintf replaces IGNORED_CHARS multiple times: for %s as well as %1$s (argument numbering) - // /[%s]*([^%1$s]+)/ results in /[IGNORED_CHARS]*([^IGNORED_CHARS]+)/ - sprintf('/[%s]*([^%1$s]+)/', self::IGNORED_CHARS), - function (array $term) use ($mode): string { - // query pieces have to bigger than one char, otherwise they are too expensive for the search - if (mb_strlen($term[1], 'UTF-8') > 1) { - // in boolean search mode '' (empty) means OR, '-' means NOT - return sprintf('%s%s ', $mode === 'AND' ? '+' : '', self::extractUmlauts($term[1])); - } - - return ''; - }, - $search - )); - -$a = ['a' => function ($b) { return $b; }]; -$a['a']( 1 ); - -// PHP 8.0 named parameters. -array_fill_keys( - keys: range( - 1, - 12, - ), - value: true, -); - -array_fill_keys( - keys: range( 1, - 12, - ), value: true, -); - -// phpcs:set PEAR.Functions.FunctionCallSignature allowMultipleArguments false -array_fill_keys( - keys: range( 1, - 12, - ), value: true, -); -// phpcs:set PEAR.Functions.FunctionCallSignature allowMultipleArguments true diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc.fixed deleted file mode 100644 index 8d02e74..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc.fixed +++ /dev/null @@ -1,565 +0,0 @@ -getFoo() - ->doBar( - $this->getX() // no comma here - ->doY() // this is still the first method argument - ->doZ() // this is still the first method argument - ); -} - -$var = myFunction( - $foo, - $bar -); - -// phpcs:set PEAR.Functions.FunctionCallSignature allowMultipleArguments false - -fputs( - STDOUT, - "Examples: - $ {$app} , --all - $ {$app} --all", - $something -); - -$array = array(); -array_map( - function($x) - { - return trim($x, $y); - }, - $foo, - $array -); - -$bar = new stdClass( - 4, /* thanks */ - 5, /* PSR-2 */ - 6 -); - -function doSomething() -{ - return $this->getFoo() - ->doBar( - $this->getX() // no comma here - ->doY() // this is still the first method argument - ->doZ() // this is still the first method argument - ); -} - -doError( - 404, // status code - 'Not Found', // error name - 'Check your id' // fix -); - -// phpcs:set PEAR.Functions.FunctionCallSignature allowMultipleArguments true - -// Don't report errors for closing braces. Leave that to other sniffs. -foo( - [ - 'this', - 'is', - 'an', - 'array' - ], - [ - 'this', - 'is', - 'an', - 'array' - ], - array( - 'this', - 'is', - 'an', - 'array' - ), - array( - 'this', - 'is', - 'an', - 'array' - ), - function($x) - { - echo 'wee'; - - return trim($x); - } -); - -function foo() -{ - myFunction( - 'string'. - // comment - // comment - 'string'. - /* comment - * comment - */ - 'string' - ); -} - -// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesAfterOpen 1 -// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesBeforeClose 1 -test( $arg, $arg2 ); -test( $arg, $arg2 ); -test( $arg, $arg2 ); -test(); -test(); -test(); -// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesAfterOpen 0 -// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesBeforeClose 0 - -?> - - - -
  • - log(// ... - 'error', - sprintf( - 'Message: %s', - isset($e->getData()['object']['evidence_details']) - ? $e->getData()['object']['evidence_details']['due_by'] - : '' - ), - array($e->getData()['object']) -); - -?> -
    - $class - ] - ); ?> -
    - - function ($x) { - return true; - }, - 'baz' => false - ) -); -$qux = array_filter( - $quux, function ($x) { - return $x; - } -); - -array_filter( - [1, 2], - function ($i) : bool { - return $i === 0; - } -); - -foo( - array( - 'callback' => function () { - $foo = 'foo'; - return; - }, - ) -); - -foo( - $a, - /* - $c, - - $d, - */ - $e -); - -test( - 1,2,3,4 -); - -class Test -{ - public function getInstance() - { - return new static( - 'arg', - 'foo' - ); - } - - public function getSelf() - { - return new self( - 'a','b', 'c' - ); - } -} - -$x = $var( - 'y', - 'x' -); - -$obj->{$x}( - 1, - 2 -); - -return (function ($a, $b) { - return function ($c, $d) use ($a, $b) { - echo $a, $b, $c, $d; - }; -})( - 'a','b' -)( - 'c', - 'd' -); - -class Foo -{ - public function bar($a, $b) - { - if (!$a || !$b) { - return; - } - - (new stdClass())->a = $a; - } -} - -return (function ($a, $b) { - return function ($c, $d) use ($a, $b) { - echo $a, $b, $c, $d; - }; -})('a','b')('c','d'); - -function foo() -{ - Bar( - function () { - } - ); -} - -$deprecated_functions = [ - 'the_category_ID' - => function_call( // 7 spaces, not 8. This is the problem line. - $a, - $b - ), -]; - -$deprecated_functions = [ - 'the_category_ID' - => function_call( // 9 spaces, not 8. This is the problem line. - $a, - $b - ), -]; - -// phpcs:set PEAR.Functions.FunctionCallSignature allowMultipleArguments false - -printf( - '', - $obj->getName(), // Trailing comment. - $obj->getID(), // phpcs:ignore Standard.Category.SniffName -- for reasons. - $option -); - -// Handling of PHP 7.3 trailing comma's. -functionCall($args, $foo,); -functionCall( - $args, - $foo, -); -functionCall( - $args, - $foo, -); - -// phpcs:set PEAR.Functions.FunctionCallSignature allowMultipleArguments true - -$this->foo( - ['a','b'], - true -); - -$this->foo( - // Comment - ['a','b'], - true -); - -function m() -{ - $t = ' - ' . (empty(true) ? ' - ' . f( - '1', - '2', - ) . ' - ' : ''); -} - -class C -{ - - public function m() - { - $a = []; - $t = - "SELECT * FROM t -WHERE f IN(" . implode( - ",", - $a - ) . ")"; - } -} - -$notices = array( - 'index' => sprintf( - translation_function('a text string with %s placeholder'), - 'replacement' - ), -); - -$componentType = $this->componentTypeRepository->findByType($this->identifier) ?: - $this->componentTypeFactory->createForType( - $this->identifier, - $this->className, - true, - $this->isPrototypal - ); - -return [ - 'export-path' => 'exports/database/' - . env( - 'APP_CUSTOMER', - 'not-configured' - ) - . '/' . env( - 'APP_IDENTIFIER', - 'not-configured' - ), -]; - -$methods .= - str_replace( - array_keys($replacements), - array_values($replacements), - $methodTemplate - ) - . PHP_EOL . PHP_EOL . str_repeat(' ', 4); - -$rangeValues['min'] = - $this->adjustLowerThreshold( - $this->normalizeRatingForFilter($rangeValues['min']) - ); - -$salesOrderThresholdTransfer->fromArray($salesOrderThresholdEntity->toArray(), true) - ->setSalesOrderThresholdValue( - $this->mapSalesOrderThresholdValueTransfer($salesOrderThresholdTransfer, $salesOrderThresholdEntity) - )->setCurrency( - (new CurrencyTransfer())->fromArray($salesOrderThresholdEntity->getCurrency()->toArray(), true) - )->setStore( - (new StoreTransfer())->fromArray($salesOrderThresholdEntity->getStore()->toArray(), true) - ); - -return trim( - preg_replace_callback( - // sprintf replaces IGNORED_CHARS multiple times: for %s as well as %1$s (argument numbering) - // /[%s]*([^%1$s]+)/ results in /[IGNORED_CHARS]*([^IGNORED_CHARS]+)/ - sprintf('/[%s]*([^%1$s]+)/', self::IGNORED_CHARS), - function (array $term) use ($mode): string { - // query pieces have to bigger than one char, otherwise they are too expensive for the search - if (mb_strlen($term[1], 'UTF-8') > 1) { - // in boolean search mode '' (empty) means OR, '-' means NOT - return sprintf('%s%s ', $mode === 'AND' ? '+' : '', self::extractUmlauts($term[1])); - } - - return ''; - }, - $search - ) -); - -$a = ['a' => function ($b) { return $b; }]; -$a['a'](1); - -// PHP 8.0 named parameters. -array_fill_keys( - keys: range( - 1, - 12, - ), - value: true, -); - -array_fill_keys( - keys: range( - 1, - 12, - ), value: true, -); - -// phpcs:set PEAR.Functions.FunctionCallSignature allowMultipleArguments false -array_fill_keys( - keys: range( - 1, - 12, - ), - value: true, -); -// phpcs:set PEAR.Functions.FunctionCallSignature allowMultipleArguments true diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.js b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.js deleted file mode 100644 index 5e77e57..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.js +++ /dev/null @@ -1,80 +0,0 @@ -test( -); -test(); -test(arg, arg2); -test (); -test( ); -test() ; -test( arg); -test( arg ); -test ( arg ); - -if (foo(arg) === true) { - -} - -var something = get(arg1, arg2); -var something = get(arg1, arg2) ; -var something = get(arg1, arg2) ; - -make_foo(string/*the string*/, true/*test*/); -make_foo(string/*the string*/, true/*test*/ ); -make_foo(string /*the string*/, true /*test*/); -make_foo(/*the string*/string, /*test*/true); -make_foo( /*the string*/string, /*test*/true); - -// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesAfterOpen 1 -// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesBeforeClose 1 -test(arg, arg2); -test( arg, arg2 ); -test( arg, arg2 ); -// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesAfterOpen 0 -// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesBeforeClose 0 - -this.init = function(data) { - a.b('').a(function(itemid, target) { - b( - itemid, - target, - { - reviewData: _reviewData, - pageid: itemid - }, - '', - function() { - var _showAspectItems = function(itemid) { - a.a(a.c(''), ''); - a.b(a.c('-' + itemid), ''); - }; - a.foo(function(itemid, target) { - _foo(itemid); - }); - } - ); - }); -}; - -a.prototype = { - - a: function() - { - this.addItem( - { - /** - * @return void - */ - a: function() - { - - }, - /** - * @return void - */ - a: function() - { - - }, - } - ); - } -}; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.js.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.js.fixed deleted file mode 100644 index 7855ac6..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.js.fixed +++ /dev/null @@ -1,84 +0,0 @@ -test( -); -test(); -test(arg, arg2); -test(); -test(); -test(); -test(arg); -test(arg); -test(arg); - -if (foo(arg) === true) { - -} - -var something = get(arg1, arg2); -var something = get(arg1, arg2); -var something = get(arg1, arg2); - -make_foo(string/*the string*/, true/*test*/); -make_foo(string/*the string*/, true/*test*/); -make_foo(string /*the string*/, true /*test*/); -make_foo(/*the string*/string, /*test*/true); -make_foo(/*the string*/string, /*test*/true); - -// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesAfterOpen 1 -// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesBeforeClose 1 -test( arg, arg2 ); -test( arg, arg2 ); -test( arg, arg2 ); -// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesAfterOpen 0 -// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesBeforeClose 0 - -this.init = function(data) { - a.b('').a( - function(itemid, target) { - b( - itemid, - target, - { - reviewData: _reviewData, - pageid: itemid - }, - '', - function() { - var _showAspectItems = function(itemid) { - a.a(a.c(''), ''); - a.b(a.c('-' + itemid), ''); - }; - a.foo( - function(itemid, target) { - _foo(itemid); - } - ); - } - ); - } - ); -}; - -a.prototype = { - - a: function() - { - this.addItem( - { - /** - * @return void - */ - a: function() - { - - }, - /** - * @return void - */ - a: function() - { - - }, - } - ); - } -}; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.php deleted file mode 100644 index 1dd5918..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.php +++ /dev/null @@ -1,154 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Tests\Functions; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class FunctionCallSignatureUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='FunctionCallSignatureUnitTest.inc') - { - if ($testFile === 'FunctionCallSignatureUnitTest.js') { - return [ - 5 => 1, - 6 => 2, - 7 => 1, - 8 => 1, - 9 => 2, - 10 => 3, - 17 => 1, - 18 => 1, - 21 => 1, - 24 => 1, - 28 => 2, - 30 => 2, - 35 => 1, - 49 => 1, - 51 => 1, - 54 => 1, - 70 => 1, - 71 => 1, - ]; - }//end if - - return [ - 5 => 1, - 6 => 2, - 7 => 1, - 8 => 1, - 9 => 2, - 10 => 3, - 17 => 1, - 18 => 1, - 31 => 1, - 34 => 1, - 43 => 2, - 57 => 1, - 59 => 1, - 63 => 1, - 64 => 1, - 82 => 1, - 93 => 1, - 100 => 1, - 106 => 2, - 119 => 1, - 120 => 1, - 129 => 1, - 137 => 1, - 142 => 2, - 171 => 1, - 180 => 1, - 181 => 1, - 194 => 1, - 213 => 2, - 215 => 2, - 217 => 2, - 218 => 2, - 277 => 1, - 278 => 1, - 303 => 1, - 308 => 1, - 321 => 1, - 322 => 1, - 329 => 1, - 330 => 1, - 337 => 1, - 342 => 1, - 343 => 1, - 345 => 1, - 346 => 2, - 353 => 1, - 354 => 1, - 355 => 2, - 377 => 1, - 378 => 1, - 379 => 1, - 380 => 1, - 385 => 1, - 386 => 1, - 387 => 1, - 388 => 1, - 393 => 1, - 394 => 1, - 395 => 1, - 396 => 1, - 411 => 1, - 422 => 1, - 424 => 1, - 429 => 1, - 432 => 1, - 440 => 1, - 441 => 1, - 442 => 1, - 464 => 1, - 510 => 1, - 513 => 1, - 514 => 1, - 523 => 1, - 524 => 3, - 527 => 2, - 539 => 1, - 540 => 1, - 546 => 1, - 547 => 1, - 548 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionDeclarationUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionDeclarationUnitTest.inc deleted file mode 100644 index 02e0a20..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionDeclarationUnitTest.inc +++ /dev/null @@ -1,420 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Tests\Functions; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class FunctionDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='FunctionDeclarationUnitTest.inc') - { - if ($testFile === 'FunctionDeclarationUnitTest.inc') { - $errors = [ - 3 => 1, - 4 => 1, - 5 => 1, - 9 => 1, - 10 => 1, - 11 => 1, - 14 => 1, - 17 => 1, - 44 => 1, - 52 => 1, - 61 => 2, - 98 => 1, - 110 => 2, - 120 => 3, - 121 => 1, - 140 => 1, - 145 => 1, - 161 => 2, - 162 => 2, - 164 => 2, - 167 => 2, - 171 => 1, - 173 => 1, - 201 => 1, - 206 => 1, - 208 => 1, - 216 => 1, - 223 => 1, - 230 => 1, - 237 => 1, - 243 => 1, - 247 => 1, - 251 => 2, - 253 => 2, - 257 => 2, - 259 => 1, - 263 => 1, - 265 => 1, - 269 => 1, - 273 => 1, - 277 => 1, - 278 => 1, - 283 => 1, - 287 => 2, - 289 => 2, - 293 => 2, - 295 => 1, - 299 => 1, - 301 => 1, - 305 => 1, - 309 => 1, - 313 => 1, - 314 => 1, - 350 => 1, - 351 => 1, - 352 => 1, - 353 => 1, - 361 => 1, - 362 => 1, - 363 => 1, - 364 => 1, - 365 => 1, - 366 => 1, - 367 => 1, - 368 => 1, - 369 => 1, - 370 => 1, - 371 => 1, - 402 => 1, - 406 => 1, - ]; - } else { - $errors = [ - 3 => 1, - 4 => 1, - 5 => 1, - 9 => 1, - 10 => 1, - 11 => 1, - 14 => 1, - 17 => 1, - 41 => 1, - 48 => 1, - ]; - }//end if - - return $errors; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/ValidDefaultValueUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/ValidDefaultValueUnitTest.inc deleted file mode 100644 index 8f8d64a..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/ValidDefaultValueUnitTest.inc +++ /dev/null @@ -1,119 +0,0 @@ - $a[] = $b; - -class OnlyConstructorPropertyPromotion { - public function __construct( - public string $name = '', - protected $bar - ) {} -} - -class ConstructorPropertyPromotionMixedWithNormalParams { - public function __construct( - public string $name = '', - ?int $optionalParam = 0, - mixed $requiredParam, - ) {} -} - -// Intentional syntax error. Must be last thing in the file. -function diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/ValidDefaultValueUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/ValidDefaultValueUnitTest.php deleted file mode 100644 index 60d261c..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/ValidDefaultValueUnitTest.php +++ /dev/null @@ -1,60 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Tests\Functions; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ValidDefaultValueUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 29 => 1, - 34 => 1, - 39 => 1, - 71 => 1, - 76 => 1, - 81 => 1, - 91 => 1, - 99 => 1, - 101 => 1, - 106 => 1, - 114 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidClassNameUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidClassNameUnitTest.inc deleted file mode 100644 index c6d15df..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidClassNameUnitTest.inc +++ /dev/null @@ -1,68 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Tests\NamingConventions; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ValidClassNameUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 5 => 1, - 7 => 2, - 9 => 1, - 19 => 1, - 24 => 1, - 26 => 2, - 28 => 1, - 38 => 1, - 40 => 2, - 42 => 2, - 44 => 1, - 46 => 1, - 50 => 1, - 52 => 2, - 54 => 1, - 64 => 1, - 66 => 2, - 68 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidFunctionNameUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidFunctionNameUnitTest.inc deleted file mode 100644 index 78280cd..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidFunctionNameUnitTest.inc +++ /dev/null @@ -1,222 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Tests\NamingConventions; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ValidFunctionNameUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 11 => 1, - 12 => 1, - 13 => 1, - 14 => 1, - 15 => 1, - 16 => 1, - 17 => 2, - 18 => 2, - 19 => 2, - 20 => 2, - 24 => 1, - 25 => 1, - 26 => 1, - 27 => 1, - 28 => 1, - 29 => 1, - 30 => 2, - 31 => 2, - 32 => 2, - 33 => 2, - 35 => 1, - 36 => 1, - 37 => 2, - 38 => 2, - 39 => 2, - 40 => 2, - 43 => 1, - 44 => 1, - 45 => 1, - 46 => 1, - 50 => 1, - 51 => 1, - 52 => 1, - 53 => 1, - 56 => 1, - 57 => 1, - 58 => 1, - 59 => 1, - 67 => 1, - 68 => 1, - 69 => 1, - 70 => 1, - 71 => 1, - 72 => 1, - 73 => 2, - 74 => 2, - 75 => 2, - 76 => 2, - 80 => 1, - 81 => 1, - 82 => 1, - 83 => 1, - 86 => 1, - 87 => 1, - 88 => 1, - 89 => 1, - 95 => 1, - 96 => 1, - 97 => 1, - 98 => 1, - 99 => 1, - 100 => 1, - 101 => 2, - 102 => 2, - 103 => 2, - 104 => 2, - 123 => 1, - 125 => 1, - 126 => 2, - 129 => 1, - 130 => 1, - 131 => 1, - 132 => 1, - 133 => 1, - 134 => 1, - 135 => 1, - 136 => 1, - 137 => 1, - 138 => 1, - 139 => 1, - 140 => 3, - 141 => 1, - 143 => 1, - 144 => 1, - 145 => 3, - 147 => 2, - 148 => 1, - 149 => 1, - 181 => 1, - 201 => 1, - 203 => 1, - 204 => 2, - 207 => 2, - 212 => 1, - 213 => 1, - 214 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidVariableNameUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidVariableNameUnitTest.inc deleted file mode 100644 index 3c03da3..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidVariableNameUnitTest.inc +++ /dev/null @@ -1,101 +0,0 @@ -def["POP_{$cc}_A"]}' - and POP_{$cc}_B = -'{$this->def["POP_{$cc}_B"]}')"; - } -} - -class mpgResponse{ - var $term_id; - var $currentTag; - function characterHandler($parser,$data){ - switch($this->currentTag) - { - case "term_id": { - $this->term_id=$data; - break; - } - } - }//end characterHandler -}//end class mpgResponse - -class foo -{ - const bar = <<setLogger( - new class { - private $varName = 'hello'; - private $_varName = 'hello'; -}); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidVariableNameUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidVariableNameUnitTest.php deleted file mode 100644 index 834852c..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidVariableNameUnitTest.php +++ /dev/null @@ -1,56 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Tests\NamingConventions; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ValidVariableNameUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 12 => 1, - 17 => 1, - 22 => 1, - 92 => 1, - 93 => 1, - 94 => 1, - 99 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ObjectOperatorIndentUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ObjectOperatorIndentUnitTest.inc deleted file mode 100644 index b1b09d9..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ObjectOperatorIndentUnitTest.inc +++ /dev/null @@ -1,142 +0,0 @@ -someFunction("some", "parameter") -->someOtherFunc(23, 42)-> - someOtherFunc2($one, $two) - - ->someOtherFunc3(23, 42) - ->andAThirdFunction(); - - $someObject->someFunction("some", "parameter") - ->someOtherFunc(23, 42); - -$someObject->someFunction("some", "parameter")->someOtherFunc(23, 42); - -$someObject->someFunction("some", "parameter") - ->someOtherFunc(23, 42); - -func( - $bar->foo() -) - ->bar(); - -func( - $bar->foo() -) - ->bar( - $bar->foo() - ->bar() - ->func() - ); - -$object - ->setBar($foo) - ->setFoo($bar); - -if ($bar) { - $object - ->setBar($foo) - ->setFoo($bar); -} - -$response -> CompletedTrackDetails -> TrackDetails -> Events; -$response - -> CompletedTrackDetails - -> TrackDetails - -> Events; - -$response - -> CompletedTrackDetails --> TrackDetails - -> Events; - -$var = get_object( - $foo->something() - ->query() -)->two() - ->three(); - -$foo->one( - $foo - ->two() -); - -get_object()->one() - ->two() - ->three(); - -someclass::one() - ->two() - ->three(); - -(new someclass())->one() - ->two() - ->three(); - -// phpcs:set PEAR.WhiteSpace.ObjectOperatorIndent multilevel true - -$someObject - ->startSomething() - ->someOtherFunc(23, 42) -->endSomething() -->doSomething(23, 42) -->endEverything(); - -$rootNode - ->one() - ->two() - ->three() - ->four() - ->five(); - -$rootNode - ->one() - ->two() - ->three() - ->four() - ->five(); - -$rootNode - ->one() - ->two() - ->three() - ->four() -->five(); - -$rootNode - ->one() - ->two() - ->three() - ->four() - ->five(); - -// phpcs:set PEAR.WhiteSpace.ObjectOperatorIndent multilevel false - -$object - ?->setBar($foo) - ?->setFoo($bar); - -$someObject?->someFunction("some", "parameter") -->someOtherFunc(23, 42)?-> - someOtherFunc2($one, $two) - -->someOtherFunc3(23, 42) - ?->andAThirdFunction(); - -// phpcs:set PEAR.WhiteSpace.ObjectOperatorIndent multilevel true -$object - ?->setBar($foo) - ?->setFoo($bar); - -$someObject?->someFunction("some", "parameter") -->someOtherFunc(23, 42) - ?->someOtherFunc2($one, $two) - -->someOtherFunc3(23, 42) - ?->andAThirdFunction(); -// phpcs:set PEAR.WhiteSpace.ObjectOperatorIndent multilevel false - -$someObject - ->startSomething(paramName: $value) - ->someOtherFunc(nameA: 23, nameB: 42) -->endSomething($value, name: $value) -->endEverything(); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ObjectOperatorIndentUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ObjectOperatorIndentUnitTest.inc.fixed deleted file mode 100644 index 5d5b77b..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ObjectOperatorIndentUnitTest.inc.fixed +++ /dev/null @@ -1,142 +0,0 @@ -someFunction("some", "parameter") - ->someOtherFunc(23, 42) - ->someOtherFunc2($one, $two) - - ->someOtherFunc3(23, 42) - ->andAThirdFunction(); - - $someObject->someFunction("some", "parameter") - ->someOtherFunc(23, 42); - -$someObject->someFunction("some", "parameter")->someOtherFunc(23, 42); - -$someObject->someFunction("some", "parameter") - ->someOtherFunc(23, 42); - -func( - $bar->foo() -) - ->bar(); - -func( - $bar->foo() -) - ->bar( - $bar->foo() - ->bar() - ->func() - ); - -$object - ->setBar($foo) - ->setFoo($bar); - -if ($bar) { - $object - ->setBar($foo) - ->setFoo($bar); -} - -$response -> CompletedTrackDetails -> TrackDetails -> Events; -$response - -> CompletedTrackDetails - -> TrackDetails - -> Events; - -$response - -> CompletedTrackDetails - -> TrackDetails - -> Events; - -$var = get_object( - $foo->something() - ->query() -)->two() - ->three(); - -$foo->one( - $foo - ->two() -); - -get_object()->one() - ->two() - ->three(); - -someclass::one() - ->two() - ->three(); - -(new someclass())->one() - ->two() - ->three(); - -// phpcs:set PEAR.WhiteSpace.ObjectOperatorIndent multilevel true - -$someObject - ->startSomething() - ->someOtherFunc(23, 42) - ->endSomething() - ->doSomething(23, 42) - ->endEverything(); - -$rootNode - ->one() - ->two() - ->three() - ->four() - ->five(); - -$rootNode - ->one() - ->two() - ->three() - ->four() - ->five(); - -$rootNode - ->one() - ->two() - ->three() - ->four() - ->five(); - -$rootNode - ->one() - ->two() - ->three() - ->four() - ->five(); - -// phpcs:set PEAR.WhiteSpace.ObjectOperatorIndent multilevel false - -$object - ?->setBar($foo) - ?->setFoo($bar); - -$someObject?->someFunction("some", "parameter") - ->someOtherFunc(23, 42) - ?->someOtherFunc2($one, $two) - - ->someOtherFunc3(23, 42) - ?->andAThirdFunction(); - -// phpcs:set PEAR.WhiteSpace.ObjectOperatorIndent multilevel true -$object - ?->setBar($foo) - ?->setFoo($bar); - -$someObject?->someFunction("some", "parameter") - ->someOtherFunc(23, 42) - ?->someOtherFunc2($one, $two) - - ->someOtherFunc3(23, 42) - ?->andAThirdFunction(); -// phpcs:set PEAR.WhiteSpace.ObjectOperatorIndent multilevel false - -$someObject - ->startSomething(paramName: $value) - ->someOtherFunc(nameA: 23, nameB: 42) - ->endSomething($value, name: $value) - ->endEverything(); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ObjectOperatorIndentUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ObjectOperatorIndentUnitTest.php deleted file mode 100644 index 0cad3ef..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ObjectOperatorIndentUnitTest.php +++ /dev/null @@ -1,74 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ObjectOperatorIndentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 3 => 2, - 6 => 1, - 15 => 1, - 27 => 1, - 37 => 1, - 38 => 1, - 48 => 1, - 49 => 1, - 50 => 1, - 65 => 1, - 69 => 1, - 73 => 1, - 79 => 1, - 80 => 1, - 81 => 1, - 82 => 1, - 95 => 1, - 103 => 1, - 119 => 2, - 122 => 1, - 131 => 1, - 134 => 1, - 140 => 1, - 141 => 1, - 142 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeClosingBraceUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeClosingBraceUnitTest.inc deleted file mode 100644 index c520237..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeClosingBraceUnitTest.inc +++ /dev/null @@ -1,154 +0,0 @@ -{$property} =& new $class_name($this->db_index); - $this->modules[$module] =& $this->{$property}; -} - -foreach ($elements as $element) { - if ($something) { - // Do IF. - } else if ($somethingElse) { - // Do ELSE. - } -} - -switch ($foo) { -case 1: - switch ($bar) { - default: - if ($something) { - echo $string{1}; - } else if ($else) { - switch ($else) { - case 1: - // Do something. - break; - default: - // Do something. - break; - } - } - } -break; -case 2: - // Do something; - break; -} - -switch ($httpResponseCode) { - case 100: - case 101: - case 102: - default: - return 'Unknown'; -} - -switch ($httpResponseCode) { - case 100: - case 101: - case 102: - return 'Processing.'; - default: - return 'Unknown'; -} - -switch($i) { -case 1: {} -} - -switch ($httpResponseCode) { - case 100: - case 101: - case 102: - exit; - default: - exit; -} - -if ($foo): - if ($bar): - $foo = 1; - elseif ($baz): - $foo = 2; - endif; -endif; - -if ($foo): -elseif ($baz): $foo = 2; -endif; - -?> -
      - -
    • - -
    -
      - -
    • - -
    -
      - -
    • - -
    - -getSummaryCount(); ?> -
    class="empty"> - - 'a', 2 => 'b' }; - -$match = match ($test) { - 1 => 'a', - 2 => 'b' - }; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeClosingBraceUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeClosingBraceUnitTest.inc.fixed deleted file mode 100644 index 23156e4..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeClosingBraceUnitTest.inc.fixed +++ /dev/null @@ -1,159 +0,0 @@ -{$property} =& new $class_name($this->db_index); - $this->modules[$module] =& $this->{$property}; -} - -foreach ($elements as $element) { - if ($something) { - // Do IF. - } else if ($somethingElse) { - // Do ELSE. - } -} - -switch ($foo) { -case 1: - switch ($bar) { - default: - if ($something) { - echo $string{1}; - } else if ($else) { - switch ($else) { - case 1: - // Do something. - break; - default: - // Do something. - break; - } - } - } - break; -case 2: - // Do something; - break; -} - -switch ($httpResponseCode) { - case 100: - case 101: - case 102: - default: - return 'Unknown'; -} - -switch ($httpResponseCode) { - case 100: - case 101: - case 102: - return 'Processing.'; - default: - return 'Unknown'; -} - -switch($i) { -case 1: { - } -} - -switch ($httpResponseCode) { - case 100: - case 101: - case 102: - exit; - default: - exit; -} - -if ($foo): - if ($bar): - $foo = 1; - elseif ($baz): - $foo = 2; - endif; -endif; - -if ($foo): -elseif ($baz): $foo = 2; -endif; - -?> -
      - -
    • - -
    -
      - -
    • - -
    -
      - -
    • - -
    - -getSummaryCount(); ?> -
    class="empty"> - - 'a', 2 => 'b' -}; - -$match = match ($test) { - 1 => 'a', - 2 => 'b' -}; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeClosingBraceUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeClosingBraceUnitTest.php deleted file mode 100644 index 1b01ee9..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeClosingBraceUnitTest.php +++ /dev/null @@ -1,65 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ScopeClosingBraceUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 11 => 1, - 13 => 1, - 24 => 1, - 30 => 1, - 61 => 1, - 65 => 1, - 85 => 1, - 89 => 1, - 98 => 1, - 122 => 1, - 127 => 1, - 135 => 1, - 141 => 1, - 146 => 1, - 149 => 1, - 154 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeIndentUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeIndentUnitTest.inc deleted file mode 100644 index b122a14..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeIndentUnitTest.inc +++ /dev/null @@ -1,314 +0,0 @@ -hello(); // error here - } - - function hello() // error here - { // no error here as brackets can be put anywhere in the pear standard - echo 'hello'; - } - - function hello2() - { - if (TRUE) { // error here - echo 'hello'; // no error here as its more than 4 spaces. - } else { - echo 'bye'; // error here - } - - while (TRUE) { - echo 'hello'; // error here - } - - do { // error here - echo 'hello'; // error here - } while (TRUE); - } - - function hello3() - { - switch ($hello) { - case 'hello': - break; - } - } - -} - -?> -
    -
    -
    -validate()) {
    -    $safe = $form->getSubmitValues();
    -}
    -?>
    -
    -open(); // error here - } - - public function open() - { - // Some inline stuff that shouldn't error - if (TRUE) echo 'hello'; - foreach ($tokens as $token) echo $token; - } - - /** - * This is a comment 1. - * This is a comment 2. - * This is a comment 3. - * This is a comment 4. - */ - public function close() - { - // All ok. - if (TRUE) { - if (TRUE) { - } else if (FALSE) { - foreach ($tokens as $token) { - switch ($token) { - case '1': - case '2': - if (true) { - if (false) { - if (false) { - if (false) { - echo 'hello'; - } - } - } - } - break; - case '5': - break; - } - do { - while (true) { - foreach ($tokens as $token) { - for ($i = 0; $i < $token; $i++) { - echo 'hello'; - } - } - } - } while (true); - } - } - } - } - - /* - This is another c style comment 1. - This is another c style comment 2. - This is another c style comment 3. - This is another c style comment 4. - This is another c style comment 5. - */ - - /* - * - * - * - */ - - /** - */ - - /* - This comment has a newline in it. - - */ - - public function read() - { - echo 'hello'; - - // no errors below. - $array = array( - 'this', - 'that' => array( - 'hello', - 'hello again' => array( - 'hello', - ), - ), - ); - } -} - -abstract class Test3 -{ - public function parse() - { - - foreach ($t as $ndx => $token) { - if (is_array($token)) { - echo 'here'; - } else { - $ts[] = array("token" => $token, "value" => ''); - - $last = count($ts) - 1; - - switch ($token) { - case '(': - - if ($last >= 3 && - $ts[0]['token'] != T_CLASS && - $ts[$last - 2]['token'] == T_OBJECT_OPERATOR && - $ts[$last - 3]['token'] == T_VARIABLE ) { - - - if (true) { - echo 'hello'; - } - } - array_push($braces, $token); - break; - } - } - } - } -} - -function test() -{ - $o = << - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ScopeIndentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 7 => 1, - 10 => 1, - 17 => 1, - 20 => 1, - 24 => 1, - 25 => 1, - 27 => 1, - 28 => 1, - 29 => 1, - 30 => 1, - 58 => 1, - 123 => 1, - 224 => 1, - 225 => 1, - 279 => 1, - 284 => 1, - 311 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/ruleset.xml b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/ruleset.xml deleted file mode 100644 index 1bf94ca..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/ruleset.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - The PEAR coding standard. - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - - - - - - - - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Docs/Classes/ClassDeclarationStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Docs/Classes/ClassDeclarationStandard.xml deleted file mode 100644 index eaae99b..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Docs/Classes/ClassDeclarationStandard.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - class Bar { -} - ]]> - - - class Bar { -} - -class Baz { -} - ]]> - - - - - namespace Foo; - -class Bar { -} - ]]> - - - - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Docs/Files/SideEffectsStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Docs/Files/SideEffectsStandard.xml deleted file mode 100644 index 0ed04a0..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Docs/Files/SideEffectsStandard.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - echo "Class Foo loaded." - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Docs/Methods/CamelCapsMethodNameStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Docs/Methods/CamelCapsMethodNameStandard.xml deleted file mode 100644 index 8db899d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Docs/Methods/CamelCapsMethodNameStandard.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - doBar() - { - } -} - ]]> - - - do_bar() - { - } -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Sniffs/Classes/ClassDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Sniffs/Classes/ClassDeclarationSniff.php deleted file mode 100644 index ac6407d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Sniffs/Classes/ClassDeclarationSniff.php +++ /dev/null @@ -1,74 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR1\Sniffs\Classes; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class ClassDeclarationSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_CLASS, - T_INTERFACE, - T_TRAIT, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param integer $stackPtr The position of the current token in - * the token stack. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - if (isset($tokens[$stackPtr]['scope_closer']) === false) { - return; - } - - $errorData = [strtolower($tokens[$stackPtr]['content'])]; - - $nextClass = $phpcsFile->findNext([T_CLASS, T_INTERFACE, T_TRAIT], ($tokens[$stackPtr]['scope_closer'] + 1)); - if ($nextClass !== false) { - $error = 'Each %s must be in a file by itself'; - $phpcsFile->addError($error, $nextClass, 'MultipleClasses', $errorData); - $phpcsFile->recordMetric($stackPtr, 'One class per file', 'no'); - } else { - $phpcsFile->recordMetric($stackPtr, 'One class per file', 'yes'); - } - - $namespace = $phpcsFile->findNext([T_NAMESPACE, T_CLASS, T_INTERFACE, T_TRAIT], 0); - if ($tokens[$namespace]['code'] !== T_NAMESPACE) { - $error = 'Each %s must be in a namespace of at least one level (a top-level vendor name)'; - $phpcsFile->addError($error, $stackPtr, 'MissingNamespace', $errorData); - $phpcsFile->recordMetric($stackPtr, 'Class defined in namespace', 'no'); - } else { - $phpcsFile->recordMetric($stackPtr, 'Class defined in namespace', 'yes'); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Sniffs/Files/SideEffectsSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Sniffs/Files/SideEffectsSniff.php deleted file mode 100644 index 27454cc..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Sniffs/Files/SideEffectsSniff.php +++ /dev/null @@ -1,298 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR1\Sniffs\Files; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class SideEffectsSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_OPEN_TAG]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the token stack. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $result = $this->searchForConflict($phpcsFile, 0, ($phpcsFile->numTokens - 1), $tokens); - - if ($result['symbol'] !== null && $result['effect'] !== null) { - $error = 'A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line %s and the first side effect is on line %s.'; - $data = [ - $tokens[$result['symbol']]['line'], - $tokens[$result['effect']]['line'], - ]; - $phpcsFile->addWarning($error, 0, 'FoundWithSymbols', $data); - $phpcsFile->recordMetric($stackPtr, 'Declarations and side effects mixed', 'yes'); - } else { - $phpcsFile->recordMetric($stackPtr, 'Declarations and side effects mixed', 'no'); - } - - // Ignore the rest of the file. - return ($phpcsFile->numTokens + 1); - - }//end process() - - - /** - * Searches for symbol declarations and side effects. - * - * Returns the positions of both the first symbol declared and the first - * side effect in the file. A NULL value for either indicates nothing was - * found. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $start The token to start searching from. - * @param int $end The token to search to. - * @param array $tokens The stack of tokens that make up - * the file. - * - * @return array - */ - private function searchForConflict($phpcsFile, $start, $end, $tokens) - { - $symbols = [ - T_CLASS => T_CLASS, - T_INTERFACE => T_INTERFACE, - T_TRAIT => T_TRAIT, - T_FUNCTION => T_FUNCTION, - ]; - - $conditions = [ - T_IF => T_IF, - T_ELSE => T_ELSE, - T_ELSEIF => T_ELSEIF, - ]; - - $checkAnnotations = $phpcsFile->config->annotations; - - $firstSymbol = null; - $firstEffect = null; - for ($i = $start; $i <= $end; $i++) { - // Respect phpcs:disable comments. - if ($checkAnnotations === true - && $tokens[$i]['code'] === T_PHPCS_DISABLE - && (empty($tokens[$i]['sniffCodes']) === true - || isset($tokens[$i]['sniffCodes']['PSR1']) === true - || isset($tokens[$i]['sniffCodes']['PSR1.Files']) === true - || isset($tokens[$i]['sniffCodes']['PSR1.Files.SideEffects']) === true) - ) { - do { - $i = $phpcsFile->findNext(T_PHPCS_ENABLE, ($i + 1)); - } while ($i !== false - && empty($tokens[$i]['sniffCodes']) === false - && isset($tokens[$i]['sniffCodes']['PSR1']) === false - && isset($tokens[$i]['sniffCodes']['PSR1.Files']) === false - && isset($tokens[$i]['sniffCodes']['PSR1.Files.SideEffects']) === false); - - if ($i === false) { - // The entire rest of the file is disabled, - // so return what we have so far. - break; - } - - continue; - } - - // Ignore whitespace and comments. - if (isset(Tokens::$emptyTokens[$tokens[$i]['code']]) === true) { - continue; - } - - // Ignore PHP tags. - if ($tokens[$i]['code'] === T_OPEN_TAG - || $tokens[$i]['code'] === T_CLOSE_TAG - ) { - continue; - } - - // Ignore shebang. - if (substr($tokens[$i]['content'], 0, 2) === '#!') { - continue; - } - - // Ignore logical operators. - if (isset(Tokens::$booleanOperators[$tokens[$i]['code']]) === true) { - continue; - } - - // Ignore entire namespace, declare, const and use statements. - if ($tokens[$i]['code'] === T_NAMESPACE - || $tokens[$i]['code'] === T_USE - || $tokens[$i]['code'] === T_DECLARE - || $tokens[$i]['code'] === T_CONST - ) { - if (isset($tokens[$i]['scope_opener']) === true) { - $i = $tokens[$i]['scope_closer']; - if ($tokens[$i]['code'] === T_ENDDECLARE) { - $semicolon = $phpcsFile->findNext(Tokens::$emptyTokens, ($i + 1), null, true); - if ($semicolon !== false && $tokens[$semicolon]['code'] === T_SEMICOLON) { - $i = $semicolon; - } - } - } else { - $semicolon = $phpcsFile->findNext(T_SEMICOLON, ($i + 1)); - if ($semicolon !== false) { - $i = $semicolon; - } - } - - continue; - } - - // Ignore function/class prefixes. - if (isset(Tokens::$methodPrefixes[$tokens[$i]['code']]) === true) { - continue; - } - - // Ignore anon classes. - if ($tokens[$i]['code'] === T_ANON_CLASS) { - $i = $tokens[$i]['scope_closer']; - continue; - } - - // Ignore attributes. - if ($tokens[$i]['code'] === T_ATTRIBUTE - && isset($tokens[$i]['attribute_closer']) === true - ) { - $i = $tokens[$i]['attribute_closer']; - continue; - } - - // Detect and skip over symbols. - if (isset($symbols[$tokens[$i]['code']]) === true - && isset($tokens[$i]['scope_closer']) === true - ) { - if ($firstSymbol === null) { - $firstSymbol = $i; - } - - $i = $tokens[$i]['scope_closer']; - continue; - } else if ($tokens[$i]['code'] === T_STRING - && strtolower($tokens[$i]['content']) === 'define' - ) { - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($i - 1), null, true); - if ($tokens[$prev]['code'] !== T_OBJECT_OPERATOR - && $tokens[$prev]['code'] !== T_NULLSAFE_OBJECT_OPERATOR - && $tokens[$prev]['code'] !== T_DOUBLE_COLON - && $tokens[$prev]['code'] !== T_FUNCTION - ) { - if ($firstSymbol === null) { - $firstSymbol = $i; - } - - $semicolon = $phpcsFile->findNext(T_SEMICOLON, ($i + 1)); - if ($semicolon !== false) { - $i = $semicolon; - } - - continue; - } - }//end if - - // Special case for defined() as it can be used to see - // if a constant (a symbol) should be defined or not and - // doesn't need to use a full conditional block. - if ($tokens[$i]['code'] === T_STRING - && strtolower($tokens[$i]['content']) === 'defined' - ) { - $openBracket = $phpcsFile->findNext(Tokens::$emptyTokens, ($i + 1), null, true); - if ($openBracket !== false - && $tokens[$openBracket]['code'] === T_OPEN_PARENTHESIS - && isset($tokens[$openBracket]['parenthesis_closer']) === true - ) { - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($i - 1), null, true); - if ($tokens[$prev]['code'] !== T_OBJECT_OPERATOR - && $tokens[$prev]['code'] !== T_NULLSAFE_OBJECT_OPERATOR - && $tokens[$prev]['code'] !== T_DOUBLE_COLON - && $tokens[$prev]['code'] !== T_FUNCTION - ) { - $i = $tokens[$openBracket]['parenthesis_closer']; - continue; - } - } - }//end if - - // Conditional statements are allowed in symbol files as long as the - // contents is only a symbol definition. So don't count these as effects - // in this case. - if (isset($conditions[$tokens[$i]['code']]) === true) { - if (isset($tokens[$i]['scope_opener']) === false) { - // Probably an "else if", so just ignore. - continue; - } - - $result = $this->searchForConflict( - $phpcsFile, - ($tokens[$i]['scope_opener'] + 1), - ($tokens[$i]['scope_closer'] - 1), - $tokens - ); - - if ($result['symbol'] !== null) { - if ($firstSymbol === null) { - $firstSymbol = $result['symbol']; - } - - if ($result['effect'] !== null) { - // Found a conflict. - $firstEffect = $result['effect']; - break; - } - } - - if ($firstEffect === null) { - $firstEffect = $result['effect']; - } - - $i = $tokens[$i]['scope_closer']; - continue; - }//end if - - if ($firstEffect === null) { - $firstEffect = $i; - } - - if ($firstSymbol !== null) { - // We have a conflict we have to report, so no point continuing. - break; - } - }//end for - - return [ - 'symbol' => $firstSymbol, - 'effect' => $firstEffect, - ]; - - }//end searchForConflict() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Sniffs/Methods/CamelCapsMethodNameSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Sniffs/Methods/CamelCapsMethodNameSniff.php deleted file mode 100644 index 2d13814..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Sniffs/Methods/CamelCapsMethodNameSniff.php +++ /dev/null @@ -1,91 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR1\Sniffs\Methods; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\CamelCapsFunctionNameSniff as GenericCamelCapsFunctionNameSniff; -use PHP_CodeSniffer\Util\Common; - -class CamelCapsMethodNameSniff extends GenericCamelCapsFunctionNameSniff -{ - - - /** - * Processes the tokens within the scope. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being processed. - * @param int $stackPtr The position where this token was - * found. - * @param int $currScope The position of the current scope. - * - * @return void - */ - protected function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScope) - { - $tokens = $phpcsFile->getTokens(); - - // Determine if this is a function which needs to be examined. - $conditions = $tokens[$stackPtr]['conditions']; - end($conditions); - $deepestScope = key($conditions); - if ($deepestScope !== $currScope) { - return; - } - - $methodName = $phpcsFile->getDeclarationName($stackPtr); - if ($methodName === null) { - // Ignore closures. - return; - } - - // Ignore magic methods. - if (preg_match('|^__[^_]|', $methodName) !== 0) { - $magicPart = strtolower(substr($methodName, 2)); - if (isset($this->magicMethods[$magicPart]) === true - || isset($this->methodsDoubleUnderscore[$magicPart]) === true - ) { - return; - } - } - - $testName = ltrim($methodName, '_'); - if ($testName !== '' && Common::isCamelCaps($testName, false, true, false) === false) { - $error = 'Method name "%s" is not in camel caps format'; - $className = $phpcsFile->getDeclarationName($currScope); - if (isset($className) === false) { - $className = '[Anonymous Class]'; - } - - $errorData = [$className.'::'.$methodName]; - $phpcsFile->addError($error, $stackPtr, 'NotCamelCaps', $errorData); - $phpcsFile->recordMetric($stackPtr, 'CamelCase method name', 'no'); - } else { - $phpcsFile->recordMetric($stackPtr, 'CamelCase method name', 'yes'); - } - - }//end processTokenWithinScope() - - - /** - * Processes the tokens outside the scope. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being processed. - * @param int $stackPtr The position where this token was - * found. - * - * @return void - */ - protected function processTokenOutsideScope(File $phpcsFile, $stackPtr) - { - - }//end processTokenOutsideScope() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Classes/ClassDeclarationUnitTest.1.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Classes/ClassDeclarationUnitTest.1.inc deleted file mode 100644 index 58cb85e..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Classes/ClassDeclarationUnitTest.1.inc +++ /dev/null @@ -1,3 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR1\Tests\Classes; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ClassDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - if ($testFile === 'ClassDeclarationUnitTest.2.inc') { - return []; - } - - return [ - 2 => 1, - 3 => 2, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.1.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.1.inc deleted file mode 100644 index 596d6cf..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.1.inc +++ /dev/null @@ -1,73 +0,0 @@ - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.10.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.10.inc deleted file mode 100644 index 63f256d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.10.inc +++ /dev/null @@ -1,8 +0,0 @@ -define("MAXSIZE", 100); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.14.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.14.inc deleted file mode 100644 index 9499885..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.14.inc +++ /dev/null @@ -1,2 +0,0 @@ -define("MAXSIZE", 100); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.15.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.15.inc deleted file mode 100644 index 0500d10..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.15.inc +++ /dev/null @@ -1,2 +0,0 @@ -defined('MINSIZE') or define("MAXSIZE", 100); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.16.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.16.inc deleted file mode 100644 index 588ece5..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.16.inc +++ /dev/null @@ -1,2 +0,0 @@ -defined('MINSIZE') or define("MAXSIZE", 100); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.2.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.2.inc deleted file mode 100644 index 4c9b8e6..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.2.inc +++ /dev/null @@ -1,24 +0,0 @@ -define(); -echo $object -> define(); -Foo::define(); - -$c = new class extends Something{ - - public function someMethod() - { - // ... - } - -}; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.3.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.3.inc deleted file mode 100644 index d4ae77e..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.3.inc +++ /dev/null @@ -1,6 +0,0 @@ - -'; -} - -printHead(); -?> - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.5.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.5.inc deleted file mode 100644 index 7265c63..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.5.inc +++ /dev/null @@ -1,2 +0,0 @@ - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.6.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.6.inc deleted file mode 100644 index e02fed4..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.6.inc +++ /dev/null @@ -1,9 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR1\Tests\Files; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class SideEffectsUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Set CLI values before the file is tested. - * - * @param string $testFile The name of the file being tested. - * @param \PHP_CodeSniffer\Config $config The config data for the test run. - * - * @return void - */ - public function setCliValues($testFile, $config) - { - if ($testFile === 'SideEffectsUnitTest.12.inc') { - $config->annotations = false; - } - - }//end setCliValues() - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - return []; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getWarningList($testFile='') - { - switch ($testFile) { - case 'SideEffectsUnitTest.3.inc': - case 'SideEffectsUnitTest.4.inc': - case 'SideEffectsUnitTest.5.inc': - case 'SideEffectsUnitTest.10.inc': - case 'SideEffectsUnitTest.12.inc': - case 'SideEffectsUnitTest.15.inc': - case 'SideEffectsUnitTest.16.inc': - return [1 => 1]; - default: - return []; - }//end switch - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Methods/CamelCapsMethodNameUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Methods/CamelCapsMethodNameUnitTest.inc deleted file mode 100644 index 7381517..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Methods/CamelCapsMethodNameUnitTest.inc +++ /dev/null @@ -1,81 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR1\Tests\Methods; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class CamelCapsMethodNameUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 6 => 1, - 7 => 1, - 11 => 1, - 12 => 1, - 13 => 1, - 17 => 1, - 21 => 1, - 25 => 1, - 26 => 1, - 77 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/ruleset.xml b/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/ruleset.xml deleted file mode 100644 index 65cbe20..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/ruleset.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - The PSR1 coding standard. - - - - - - - - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Classes/ClassInstantiationStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Classes/ClassInstantiationStandard.xml deleted file mode 100644 index ae24611..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Classes/ClassInstantiationStandard.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Functions/NullableTypeDeclarationStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Functions/NullableTypeDeclarationStandard.xml deleted file mode 100644 index 2032c9a..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Functions/NullableTypeDeclarationStandard.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Keywords/ShortFormTypeKeywordsStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Keywords/ShortFormTypeKeywordsStandard.xml deleted file mode 100644 index 9bb5a8a..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Keywords/ShortFormTypeKeywordsStandard.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - (boolean) $isValid; - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Namespaces/CompoundNamespaceDepthStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Namespaces/CompoundNamespaceDepthStandard.xml deleted file mode 100644 index b74e8b4..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Namespaces/CompoundNamespaceDepthStandard.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - SubnamespaceOne\AnotherNamespace\ClassA, - SubnamespaceOne\ClassB, - ClassZ, -}; - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Operators/OperatorSpacingStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Operators/OperatorSpacingStandard.xml deleted file mode 100644 index 981b1d9..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Operators/OperatorSpacingStandard.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - $b) { - $variable = $foo ? 'foo' : 'bar'; -} - ]]> - - - $b) { - $variable=$foo?'foo':'bar'; -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/AnonClassDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/AnonClassDeclarationSniff.php deleted file mode 100644 index 7a33bd9..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/AnonClassDeclarationSniff.php +++ /dev/null @@ -1,242 +0,0 @@ - - * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Classes; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Standards\Generic\Sniffs\Functions\FunctionCallArgumentSpacingSniff; -use PHP_CodeSniffer\Standards\PSR2\Sniffs\Classes\ClassDeclarationSniff; -use PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\MultiLineFunctionDeclarationSniff; -use PHP_CodeSniffer\Util\Tokens; - -class AnonClassDeclarationSniff extends ClassDeclarationSniff -{ - - /** - * The PSR2 MultiLineFunctionDeclarations sniff. - * - * @var MultiLineFunctionDeclarationSniff - */ - private $multiLineSniff = null; - - /** - * The Generic FunctionCallArgumentSpacing sniff. - * - * @var FunctionCallArgumentSpacingSniff - */ - private $functionCallSniff = null; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_ANON_CLASS]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - if (isset($tokens[$stackPtr]['scope_opener']) === false) { - return; - } - - $this->multiLineSniff = new MultiLineFunctionDeclarationSniff(); - $this->functionCallSniff = new FunctionCallArgumentSpacingSniff(); - - $this->processOpen($phpcsFile, $stackPtr); - $this->processClose($phpcsFile, $stackPtr); - - if (isset($tokens[$stackPtr]['parenthesis_opener']) === true) { - $openBracket = $tokens[$stackPtr]['parenthesis_opener']; - if ($this->multiLineSniff->isMultiLineDeclaration($phpcsFile, $stackPtr, $openBracket, $tokens) === true) { - $this->processMultiLineArgumentList($phpcsFile, $stackPtr); - } else { - $this->processSingleLineArgumentList($phpcsFile, $stackPtr); - } - - $this->functionCallSniff->checkSpacing($phpcsFile, $stackPtr, $openBracket); - } - - $opener = $tokens[$stackPtr]['scope_opener']; - if ($tokens[$opener]['line'] === $tokens[$stackPtr]['line']) { - return; - } - - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($opener - 1), $stackPtr, true); - - $implements = $phpcsFile->findPrevious(T_IMPLEMENTS, ($opener - 1), $stackPtr); - if ($implements !== false - && $tokens[$opener]['line'] !== $tokens[$implements]['line'] - && $tokens[$opener]['line'] === $tokens[$prev]['line'] - ) { - // Opening brace must be on a new line as implements list wraps. - $error = 'Opening brace must be on the line after the last implemented interface'; - $fix = $phpcsFile->addFixableError($error, $opener, 'OpenBraceSameLine'); - if ($fix === true) { - $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $stackPtr, true); - $indent = str_repeat(' ', ($tokens[$first]['column'] - 1)); - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken(($prev + 1), ''); - $phpcsFile->fixer->addNewline($prev); - $phpcsFile->fixer->addContentBefore($opener, $indent); - $phpcsFile->fixer->endChangeset(); - } - } - - if ($tokens[$opener]['line'] > ($tokens[$prev]['line'] + 1)) { - // Opening brace is on a new line, so there must be no blank line before it. - $error = 'Opening brace must not be preceded by a blank line'; - $fix = $phpcsFile->addFixableError($error, $opener, 'OpenBraceLine'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($x = ($prev + 1); $x < $opener; $x++) { - if ($tokens[$x]['line'] === $tokens[$prev]['line']) { - // Maintain existing newline. - continue; - } - - if ($tokens[$x]['line'] === $tokens[$opener]['line']) { - // Maintain existing indent. - break; - } - - $phpcsFile->fixer->replaceToken($x, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - }//end if - - }//end process() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function processSingleLineArgumentList(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $openBracket = $tokens[$stackPtr]['parenthesis_opener']; - $closeBracket = $tokens[$openBracket]['parenthesis_closer']; - if ($openBracket === ($closeBracket - 1)) { - return; - } - - if ($tokens[($openBracket + 1)]['code'] === T_WHITESPACE) { - $error = 'Space after opening parenthesis of single-line argument list prohibited'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterOpenBracket'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($openBracket + 1), ''); - } - } - - $spaceBeforeClose = 0; - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($closeBracket - 1), $openBracket, true); - if ($tokens[$prev]['code'] === T_END_HEREDOC || $tokens[$prev]['code'] === T_END_NOWDOC) { - // Need a newline after these tokens, so ignore this rule. - return; - } - - if ($tokens[$prev]['line'] !== $tokens[$closeBracket]['line']) { - $spaceBeforeClose = 'newline'; - } else if ($tokens[($closeBracket - 1)]['code'] === T_WHITESPACE) { - $spaceBeforeClose = $tokens[($closeBracket - 1)]['length']; - } - - if ($spaceBeforeClose !== 0) { - $error = 'Space before closing parenthesis of single-line argument list prohibited'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceBeforeCloseBracket'); - if ($fix === true) { - if ($spaceBeforeClose === 'newline') { - $phpcsFile->fixer->beginChangeset(); - - $closingContent = ')'; - - $next = $phpcsFile->findNext(T_WHITESPACE, ($closeBracket + 1), null, true); - if ($tokens[$next]['code'] === T_SEMICOLON) { - $closingContent .= ';'; - for ($i = ($closeBracket + 1); $i <= $next; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - } - - // We want to jump over any whitespace or inline comment and - // move the closing parenthesis after any other token. - $prev = ($closeBracket - 1); - while (isset(Tokens::$emptyTokens[$tokens[$prev]['code']]) === true) { - if (($tokens[$prev]['code'] === T_COMMENT) - && (strpos($tokens[$prev]['content'], '*/') !== false) - ) { - break; - } - - $prev--; - } - - $phpcsFile->fixer->addContent($prev, $closingContent); - - $prevNonWhitespace = $phpcsFile->findPrevious(T_WHITESPACE, ($closeBracket - 1), null, true); - for ($i = ($prevNonWhitespace + 1); $i <= $closeBracket; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } else { - $phpcsFile->fixer->replaceToken(($closeBracket - 1), ''); - }//end if - }//end if - }//end if - - }//end processSingleLineArgumentList() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function processMultiLineArgumentList(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $openBracket = $tokens[$stackPtr]['parenthesis_opener']; - - $this->multiLineSniff->processBracket($phpcsFile, $openBracket, $tokens, 'argument'); - $this->multiLineSniff->processArgumentList($phpcsFile, $stackPtr, $this->indent, 'argument'); - - }//end processMultiLineArgumentList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/ClassInstantiationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/ClassInstantiationSniff.php deleted file mode 100644 index e4ebd57..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/ClassInstantiationSniff.php +++ /dev/null @@ -1,114 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Classes; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class ClassInstantiationSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_NEW]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Find the class name. - $allowed = [ - T_STRING => T_STRING, - T_NS_SEPARATOR => T_NS_SEPARATOR, - T_SELF => T_SELF, - T_STATIC => T_STATIC, - T_VARIABLE => T_VARIABLE, - T_DOLLAR => T_DOLLAR, - T_OBJECT_OPERATOR => T_OBJECT_OPERATOR, - T_NULLSAFE_OBJECT_OPERATOR => T_NULLSAFE_OBJECT_OPERATOR, - T_DOUBLE_COLON => T_DOUBLE_COLON, - ]; - - $allowed += Tokens::$emptyTokens; - - $classNameEnd = null; - for ($i = ($stackPtr + 1); $i < $phpcsFile->numTokens; $i++) { - if (isset($allowed[$tokens[$i]['code']]) === true) { - continue; - } - - // Skip over potential attributes for anonymous classes. - if ($tokens[$i]['code'] === T_ATTRIBUTE - && isset($tokens[$i]['attribute_closer']) === true - ) { - $i = $tokens[$i]['attribute_closer']; - continue; - } - - if ($tokens[$i]['code'] === T_OPEN_SQUARE_BRACKET - || $tokens[$i]['code'] === T_OPEN_CURLY_BRACKET - ) { - $i = $tokens[$i]['bracket_closer']; - continue; - } - - $classNameEnd = $i; - break; - }//end for - - if ($classNameEnd === null) { - return; - } - - if ($tokens[$classNameEnd]['code'] === T_ANON_CLASS) { - // Ignore anon classes. - return; - } - - if ($tokens[$classNameEnd]['code'] === T_OPEN_PARENTHESIS) { - // Using parenthesis. - return; - } - - if ($classNameEnd === $stackPtr) { - // Failed to find the class name. - return; - } - - $error = 'Parentheses must be used when instantiating a new class'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'MissingParentheses'); - if ($fix === true) { - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($classNameEnd - 1), null, true); - $phpcsFile->fixer->addContent($prev, '()'); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/ClosingBraceSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/ClosingBraceSniff.php deleted file mode 100644 index 0f9752b..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/ClosingBraceSniff.php +++ /dev/null @@ -1,66 +0,0 @@ - - * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Classes; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class ClosingBraceSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_CLASS, - T_INTERFACE, - T_TRAIT, - T_FUNCTION, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - if (isset($tokens[$stackPtr]['scope_closer']) === false) { - return; - } - - $closer = $tokens[$stackPtr]['scope_closer']; - $next = $phpcsFile->findNext(T_WHITESPACE, ($closer + 1), null, true); - if ($next === false - || $tokens[$next]['line'] !== $tokens[$closer]['line'] - ) { - return; - } - - $error = 'Closing brace must not be followed by any comment or statement on the same line'; - $phpcsFile->addError($error, $closer, 'StatementAfter'); - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/OpeningBraceSpaceSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/OpeningBraceSpaceSniff.php deleted file mode 100644 index 83ffda4..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/OpeningBraceSpaceSniff.php +++ /dev/null @@ -1,80 +0,0 @@ - - * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Classes; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class OpeningBraceSpaceSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return Tokens::$ooScopeTokens; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - if (isset($tokens[$stackPtr]['scope_opener']) === false) { - return; - } - - $opener = $tokens[$stackPtr]['scope_opener']; - $next = $phpcsFile->findNext(T_WHITESPACE, ($opener + 1), null, true); - if ($next === false - || $tokens[$next]['line'] <= ($tokens[$opener]['line'] + 1) - ) { - return; - } - - $error = 'Opening brace must not be followed by a blank line'; - $fix = $phpcsFile->addFixableError($error, $opener, 'Found'); - if ($fix === false) { - return; - } - - $phpcsFile->fixer->beginChangeset(); - for ($i = ($opener + 1); $i < $next; $i++) { - if ($tokens[$i]['line'] === $tokens[$opener]['line']) { - continue; - } - - if ($tokens[$i]['line'] === $tokens[$next]['line']) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/ControlStructures/BooleanOperatorPlacementSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/ControlStructures/BooleanOperatorPlacementSniff.php deleted file mode 100644 index b87c339..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/ControlStructures/BooleanOperatorPlacementSniff.php +++ /dev/null @@ -1,229 +0,0 @@ - - * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\ControlStructures; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class BooleanOperatorPlacementSniff implements Sniff -{ - - /** - * Used to restrict the placement of the boolean operator. - * - * Allowed value are "first" or "last". - * - * @var string|null - */ - public $allowOnly = null; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_IF, - T_WHILE, - T_SWITCH, - T_ELSEIF, - T_MATCH, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]['parenthesis_opener']) === false - || isset($tokens[$stackPtr]['parenthesis_closer']) === false - ) { - return; - } - - $parenOpener = $tokens[$stackPtr]['parenthesis_opener']; - $parenCloser = $tokens[$stackPtr]['parenthesis_closer']; - - if ($tokens[$parenOpener]['line'] === $tokens[$parenCloser]['line']) { - // Conditions are all on the same line. - return; - } - - $find = [ - T_BOOLEAN_AND, - T_BOOLEAN_OR, - ]; - - if ($this->allowOnly === 'first' || $this->allowOnly === 'last') { - $position = $this->allowOnly; - } else { - $position = null; - } - - $operator = $parenOpener; - $error = false; - $operators = []; - - do { - $operator = $phpcsFile->findNext($find, ($operator + 1), $parenCloser); - if ($operator === false) { - break; - } - - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($operator - 1), $parenOpener, true); - if ($prev === false) { - // Parse error. - return; - } - - $next = $phpcsFile->findNext(T_WHITESPACE, ($operator + 1), $parenCloser, true); - if ($next === false) { - // Parse error. - return; - } - - $firstOnLine = false; - $lastOnLine = false; - - if ($tokens[$prev]['line'] < $tokens[$operator]['line']) { - // The boolean operator is the first content on the line. - $firstOnLine = true; - } - - if ($tokens[$next]['line'] > $tokens[$operator]['line']) { - // The boolean operator is the last content on the line. - $lastOnLine = true; - } - - if ($firstOnLine === true && $lastOnLine === true) { - // The operator is the only content on the line. - // Don't record it because we can't determine - // placement information from looking at it. - continue; - } - - $operators[] = $operator; - - if ($firstOnLine === false && $lastOnLine === false) { - // It's in the middle of content, so we can't determine - // placement information from looking at it, but we may - // still need to process it. - continue; - } - - if ($firstOnLine === true) { - if ($position === null) { - $position = 'first'; - } - - if ($position !== 'first') { - $error = true; - } - } else { - if ($position === null) { - $position = 'last'; - } - - if ($position !== 'last') { - $error = true; - } - } - } while ($operator !== false); - - if ($error === false) { - return; - } - - switch ($this->allowOnly) { - case 'first': - $error = 'Boolean operators between conditions must be at the beginning of the line'; - break; - case 'last': - $error = 'Boolean operators between conditions must be at the end of the line'; - break; - default: - $error = 'Boolean operators between conditions must be at the beginning or end of the line, but not both'; - } - - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'FoundMixed'); - if ($fix === false) { - return; - } - - $phpcsFile->fixer->beginChangeset(); - foreach ($operators as $operator) { - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($operator - 1), $parenOpener, true); - $next = $phpcsFile->findNext(T_WHITESPACE, ($operator + 1), $parenCloser, true); - - if ($position === 'last') { - if ($tokens[$next]['line'] === $tokens[$operator]['line']) { - if ($tokens[$prev]['line'] === $tokens[$operator]['line']) { - // Move the content after the operator to the next line. - if ($tokens[($operator + 1)]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->replaceToken(($operator + 1), ''); - } - - $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $operator, true); - $padding = str_repeat(' ', ($tokens[$first]['column'] - 1)); - $phpcsFile->fixer->addContent($operator, $phpcsFile->eolChar.$padding); - } else { - // Move the operator to the end of the previous line. - if ($tokens[($operator + 1)]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->replaceToken(($operator + 1), ''); - } - - $phpcsFile->fixer->addContent($prev, ' '.$tokens[$operator]['content']); - $phpcsFile->fixer->replaceToken($operator, ''); - } - }//end if - } else { - if ($tokens[$prev]['line'] === $tokens[$operator]['line']) { - if ($tokens[$next]['line'] === $tokens[$operator]['line']) { - // Move the operator, and the rest of the expression, to the next line. - if ($tokens[($operator - 1)]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->replaceToken(($operator - 1), ''); - } - - $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $operator, true); - $padding = str_repeat(' ', ($tokens[$first]['column'] - 1)); - $phpcsFile->fixer->addContentBefore($operator, $phpcsFile->eolChar.$padding); - } else { - // Move the operator to the start of the next line. - if ($tokens[($operator - 1)]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->replaceToken(($operator - 1), ''); - } - - $phpcsFile->fixer->addContentBefore($next, $tokens[$operator]['content'].' '); - $phpcsFile->fixer->replaceToken($operator, ''); - } - }//end if - }//end if - }//end foreach - - $phpcsFile->fixer->endChangeset(); - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/ControlStructures/ControlStructureSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/ControlStructures/ControlStructureSpacingSniff.php deleted file mode 100644 index 3d29c4a..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/ControlStructures/ControlStructureSpacingSniff.php +++ /dev/null @@ -1,192 +0,0 @@ - - * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\ControlStructures; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Standards\PSR2\Sniffs\ControlStructures\ControlStructureSpacingSniff as PSR2Spacing; -use PHP_CodeSniffer\Util\Tokens; - -class ControlStructureSpacingSniff implements Sniff -{ - - /** - * The number of spaces code should be indented. - * - * @var integer - */ - public $indent = 4; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_IF, - T_WHILE, - T_FOREACH, - T_FOR, - T_SWITCH, - T_ELSE, - T_ELSEIF, - T_CATCH, - T_MATCH, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]['parenthesis_opener']) === false - || isset($tokens[$stackPtr]['parenthesis_closer']) === false - ) { - return; - } - - $parenOpener = $tokens[$stackPtr]['parenthesis_opener']; - $parenCloser = $tokens[$stackPtr]['parenthesis_closer']; - - if ($tokens[$parenOpener]['line'] === $tokens[$parenCloser]['line']) { - // Conditions are all on the same line, so follow PSR2. - $sniff = new PSR2Spacing(); - return $sniff->process($phpcsFile, $stackPtr); - } - - $next = $phpcsFile->findNext(T_WHITESPACE, ($parenOpener + 1), $parenCloser, true); - if ($next === false) { - // No conditions; parse error. - return; - } - - // Check the first expression. - if ($tokens[$next]['line'] !== ($tokens[$parenOpener]['line'] + 1)) { - $error = 'The first expression of a multi-line control structure must be on the line after the opening parenthesis'; - $fix = $phpcsFile->addFixableError($error, $next, 'FirstExpressionLine'); - if ($fix === true) { - $phpcsFile->fixer->addNewline($parenOpener); - } - } - - // Check the indent of each line. - $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $stackPtr, true); - $requiredIndent = ($tokens[$first]['column'] + $this->indent - 1); - for ($i = $parenOpener; $i < $parenCloser; $i++) { - if ($tokens[$i]['column'] !== 1 - || $tokens[($i + 1)]['line'] > $tokens[$i]['line'] - || isset(Tokens::$commentTokens[$tokens[$i]['code']]) === true - ) { - continue; - } - - if (($i + 1) === $parenCloser) { - break; - } - - // Leave indentation inside multi-line strings. - if (isset(Tokens::$textStringTokens[$tokens[$i]['code']]) === true - || isset(Tokens::$heredocTokens[$tokens[$i]['code']]) === true - ) { - continue; - } - - if ($tokens[$i]['code'] !== T_WHITESPACE) { - $foundIndent = 0; - } else { - $foundIndent = $tokens[$i]['length']; - } - - if ($foundIndent < $requiredIndent) { - $error = 'Each line in a multi-line control structure must be indented at least once; expected at least %s spaces, but found %s'; - $data = [ - $requiredIndent, - $foundIndent, - ]; - $fix = $phpcsFile->addFixableError($error, $i, 'LineIndent', $data); - if ($fix === true) { - $padding = str_repeat(' ', $requiredIndent); - if ($foundIndent === 0) { - $phpcsFile->fixer->addContentBefore($i, $padding); - } else { - $phpcsFile->fixer->replaceToken($i, $padding); - } - } - } - }//end for - - // Check the closing parenthesis. - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($parenCloser - 1), $parenOpener, true); - if ($tokens[$parenCloser]['line'] !== ($tokens[$prev]['line'] + 1)) { - $error = 'The closing parenthesis of a multi-line control structure must be on the line after the last expression'; - $fix = $phpcsFile->addFixableError($error, $parenCloser, 'CloseParenthesisLine'); - if ($fix === true) { - if ($tokens[$parenCloser]['line'] === $tokens[$prev]['line']) { - $phpcsFile->fixer->addNewlineBefore($parenCloser); - } else { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($prev + 1); $i < $parenCloser; $i++) { - // Maintain existing newline. - if ($tokens[$i]['line'] === $tokens[$prev]['line']) { - continue; - } - - // Maintain existing indent. - if ($tokens[$i]['line'] === $tokens[$parenCloser]['line']) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - }//end if - }//end if - - if ($tokens[$parenCloser]['line'] !== $tokens[$prev]['line']) { - $requiredIndent = ($tokens[$first]['column'] - 1); - $foundIndent = ($tokens[$parenCloser]['column'] - 1); - if ($foundIndent !== $requiredIndent) { - $error = 'The closing parenthesis of a multi-line control structure must be indented to the same level as start of the control structure; expected %s spaces but found %s'; - $data = [ - $requiredIndent, - $foundIndent, - ]; - $fix = $phpcsFile->addFixableError($error, $parenCloser, 'CloseParenthesisIndent', $data); - if ($fix === true) { - $padding = str_repeat(' ', $requiredIndent); - if ($foundIndent === 0) { - $phpcsFile->fixer->addContentBefore($parenCloser, $padding); - } else { - $phpcsFile->fixer->replaceToken(($parenCloser - 1), $padding); - } - } - } - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/DeclareStatementSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/DeclareStatementSniff.php deleted file mode 100644 index 67776c3..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/DeclareStatementSniff.php +++ /dev/null @@ -1,256 +0,0 @@ - - * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Files; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class DeclareStatementSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_DECLARE]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - // Allow a byte-order mark. - $tokens = $phpcsFile->getTokens(); - - // There should be no space between declare keyword and opening parenthesis. - $parenthesis = ($stackPtr + 1); - if ($tokens[($stackPtr + 1)]['type'] !== 'T_OPEN_PARENTHESIS') { - $parenthesis = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - $error = 'Expected no space between declare keyword and opening parenthesis in a declare statement'; - - if ($tokens[$parenthesis]['type'] === 'T_OPEN_PARENTHESIS') { - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceFoundAfterDeclare'); - - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($stackPtr + 1), ''); - } - } else { - $phpcsFile->addError($error, $parenthesis, 'SpaceFoundAfterDeclare'); - $parenthesis = $phpcsFile->findNext(T_OPEN_PARENTHESIS, ($parenthesis + 1)); - } - } - - // There should be no space between open parenthesis and the directive. - $string = $phpcsFile->findNext(T_WHITESPACE, ($parenthesis + 1), null, true); - if ($parenthesis !== false) { - if ($tokens[($parenthesis + 1)]['type'] !== 'T_STRING') { - $error = 'Expected no space between opening parenthesis and directive in a declare statement'; - - if ($tokens[$string]['type'] === 'T_STRING') { - $fix = $phpcsFile->addFixableError($error, $parenthesis, 'SpaceFoundBeforeDirective'); - - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($parenthesis + 1), ''); - } - } else { - $phpcsFile->addError($error, $string, 'SpaceFoundBeforeDirective'); - $string = $phpcsFile->findNext(T_STRING, ($string + 1)); - } - } - } - - // There should be no space between directive and the equal sign. - $equals = $phpcsFile->findNext(T_WHITESPACE, ($string + 1), null, true); - if ($string !== false) { - // The directive must be in lowercase. - if ($tokens[$string]['content'] !== strtolower($tokens[$string]['content'])) { - $error = 'The directive of a declare statement must be in lowercase'; - $fix = $phpcsFile->addFixableError($error, $string, 'DirectiveNotLowercase'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($string, strtolower($tokens[$string]['content'])); - } - } - - if ($tokens[($string + 1)]['type'] !== 'T_EQUAL') { - $error = 'Expected no space between directive and the equals sign in a declare statement'; - - if ($tokens[$equals]['type'] === 'T_EQUAL') { - $fix = $phpcsFile->addFixableError($error, $equals, 'SpaceFoundAfterDirective'); - - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($string + 1), ''); - } - } else { - $phpcsFile->addError($error, $equals, 'SpaceFoundAfterDirective'); - $equals = $phpcsFile->findNext(T_EQUAL, ($equals + 1)); - } - } - }//end if - - // There should be no space between equal sign and directive value. - $value = $phpcsFile->findNext(T_WHITESPACE, ($equals + 1), null, true); - if ($equals !== false) { - if ($tokens[($equals + 1)]['type'] !== 'T_LNUMBER') { - $error = 'Expected no space between equal sign and the directive value in a declare statement'; - - if ($tokens[$value]['type'] === 'T_LNUMBER') { - $fix = $phpcsFile->addFixableError($error, $value, 'SpaceFoundBeforeDirectiveValue'); - - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($equals + 1), ''); - } - } else { - $phpcsFile->addError($error, $value, 'SpaceFoundBeforeDirectiveValue'); - $value = $phpcsFile->findNext(T_LNUMBER, ($value + 1)); - } - } - } - - $parenthesis = $phpcsFile->findNext(T_WHITESPACE, ($value + 1), null, true); - if ($value !== false) { - if ($tokens[($value + 1)]['type'] !== 'T_CLOSE_PARENTHESIS') { - $error = 'Expected no space between the directive value and closing parenthesis in a declare statement'; - - if ($tokens[$parenthesis]['type'] === 'T_CLOSE_PARENTHESIS') { - $fix = $phpcsFile->addFixableError($error, $parenthesis, 'SpaceFoundAfterDirectiveValue'); - - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($value + 1), ''); - } - } else { - $phpcsFile->addError($error, $parenthesis, 'SpaceFoundAfterDirectiveValue'); - $parenthesis = $phpcsFile->findNext(T_CLOSE_PARENTHESIS, ($parenthesis + 1)); - } - } - } - - // Check for semicolon. - $curlyBracket = false; - if ($tokens[($parenthesis + 1)]['type'] !== 'T_SEMICOLON') { - $token = $phpcsFile->findNext(T_WHITESPACE, ($parenthesis + 1), null, true); - - if ($tokens[$token]['type'] === 'T_OPEN_CURLY_BRACKET') { - // Block declaration. - $curlyBracket = $token; - } else if ($tokens[$token]['type'] === 'T_SEMICOLON') { - $error = 'Expected no space between the closing parenthesis and the semicolon in a declare statement'; - $fix = $phpcsFile->addFixableError($error, $parenthesis, 'SpaceFoundBeforeSemicolon'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($parenthesis + 1), ''); - } - } else if ($tokens[$token]['type'] === 'T_CLOSE_TAG') { - if ($tokens[($parenthesis)]['line'] !== $tokens[$token]['line']) { - // Close tag must be on the same line.. - $error = 'The close tag must be on the same line as the declare statement'; - $fix = $phpcsFile->addFixableError($error, $parenthesis, 'CloseTagOnNewLine'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($parenthesis + 1), ' '); - } - } - } else { - $error = 'Expected no space between the closing parenthesis and the semicolon in a declare statement'; - $phpcsFile->addError($error, $parenthesis, 'SpaceFoundBeforeSemicolon'); - - // See if there is a semicolon or curly bracket after this token. - $token = $phpcsFile->findNext([T_WHITESPACE, T_COMMENT], ($token + 1), null, true); - if ($tokens[$token]['type'] === 'T_OPEN_CURLY_BRACKET') { - $curlyBracket = $token; - } - }//end if - }//end if - - if ($curlyBracket !== false) { - $prevToken = $phpcsFile->findPrevious(T_WHITESPACE, ($curlyBracket - 1), null, true); - $error = 'Expected one space between closing parenthesis and opening curly bracket in a declare statement'; - - // The opening curly bracket must on the same line with a single space between closing bracket. - if ($tokens[$prevToken]['type'] !== 'T_CLOSE_PARENTHESIS') { - $phpcsFile->addError($error, $curlyBracket, 'ExtraSpaceFoundAfterBracket'); - } else if ($phpcsFile->getTokensAsString(($prevToken + 1), ($curlyBracket - $prevToken - 1)) !== ' ') { - $fix = $phpcsFile->addFixableError($error, $curlyBracket, 'ExtraSpaceFoundAfterBracket'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken(($prevToken + 1), ' '); - $nextToken = ($prevToken + 2); - while ($nextToken !== $curlyBracket) { - $phpcsFile->fixer->replaceToken($nextToken, ''); - $nextToken++; - } - - $phpcsFile->fixer->endChangeset(); - } - }//end if - - $closeCurlyBracket = $tokens[$curlyBracket]['bracket_closer']; - - $prevToken = $phpcsFile->findPrevious(T_WHITESPACE, ($closeCurlyBracket - 1), null, true); - $nextToken = $phpcsFile->findNext([T_WHITESPACE, T_COMMENT], ($closeCurlyBracket + 1), null, true); - $line = $tokens[$closeCurlyBracket]['line']; - - // The closing curly bracket must be on a new line. - if ($tokens[$prevToken]['line'] === $line || $tokens[$nextToken]['line'] === $line) { - if ($tokens[$prevToken]['line'] === $line) { - $error = 'The closing curly bracket of a declare statement must be on a new line'; - $fix = $phpcsFile->addFixableError($error, $prevToken, 'CurlyBracketNotOnNewLine'); - if ($fix === true) { - $phpcsFile->fixer->addNewline($prevToken); - } - } - }//end if - - // Closing curly bracket must align with the declare keyword. - if ($tokens[$stackPtr]['column'] !== $tokens[$closeCurlyBracket]['column']) { - $error = 'The closing curly bracket of a declare statements must be aligned with the declare keyword'; - - $fix = $phpcsFile->addFixableError($error, $closeCurlyBracket, 'CloseBracketNotAligned'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($closeCurlyBracket - 1), str_repeat(' ', ($tokens[$stackPtr]['column'] - 1))); - } - } - - // The open curly bracket must be the last code on the line. - $token = $phpcsFile->findNext(Tokens::$emptyTokens, ($curlyBracket + 1), null, true); - if ($tokens[$curlyBracket]['line'] === $tokens[$token]['line']) { - $error = 'The open curly bracket of a declare statement must be the last code on the line'; - $fix = $phpcsFile->addFixableError($error, $token, 'CodeFoundAfterCurlyBracket'); - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $prevToken = $phpcsFile->findPrevious(T_WHITESPACE, ($token - 1), null, true); - - for ($i = ($prevToken + 1); $i < $token; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->addNewLineBefore($token); - - $phpcsFile->fixer->endChangeset(); - } - } - }//end if - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/FileHeaderSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/FileHeaderSniff.php deleted file mode 100644 index 8a8255c..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/FileHeaderSniff.php +++ /dev/null @@ -1,428 +0,0 @@ - - * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Files; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class FileHeaderSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_OPEN_TAG]; - - }//end register() - - - /** - * Processes this sniff when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current - * token in the stack. - * - * @return int|null - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $possibleHeaders = []; - - $searchFor = Tokens::$ooScopeTokens; - $searchFor[T_OPEN_TAG] = T_OPEN_TAG; - - $openTag = $stackPtr; - do { - $headerLines = $this->getHeaderLines($phpcsFile, $openTag); - if (empty($headerLines) === true && $openTag === $stackPtr) { - // No content in the file. - return; - } - - $possibleHeaders[$openTag] = $headerLines; - if (count($headerLines) > 1) { - break; - } - - $next = $phpcsFile->findNext($searchFor, ($openTag + 1)); - if (isset(Tokens::$ooScopeTokens[$tokens[$next]['code']]) === true) { - // Once we find an OO token, the file content has - // definitely started. - break; - } - - $openTag = $next; - } while ($openTag !== false); - - if ($openTag === false) { - // We never found a proper file header. - // If the file has multiple PHP open tags, we know - // that it must be a mix of PHP and HTML (or similar) - // so the header rules do not apply. - if (count($possibleHeaders) > 1) { - return $phpcsFile->numTokens; - } - - // There is only one possible header. - // If it is the first content in the file, it technically - // serves as the file header, and the open tag needs to - // have a newline after it. Otherwise, ignore it. - if ($stackPtr > 0) { - return $phpcsFile->numTokens; - } - - $openTag = $stackPtr; - } else if (count($possibleHeaders) > 1) { - // There are other PHP blocks before the file header. - $error = 'The file header must be the first content in the file'; - $phpcsFile->addError($error, $openTag, 'HeaderPosition'); - } else { - // The first possible header was the file header block, - // so make sure it is the first content in the file. - if ($openTag !== 0) { - // Allow for hashbang lines. - $hashbang = false; - if ($tokens[($openTag - 1)]['code'] === T_INLINE_HTML) { - $content = trim($tokens[($openTag - 1)]['content']); - if (substr($content, 0, 2) === '#!') { - $hashbang = true; - } - } - - if ($hashbang === false) { - $error = 'The file header must be the first content in the file'; - $phpcsFile->addError($error, $openTag, 'HeaderPosition'); - } - } - }//end if - - $this->processHeaderLines($phpcsFile, $possibleHeaders[$openTag]); - - return $phpcsFile->numTokens; - - }//end process() - - - /** - * Gather information about the statements inside a possible file header. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current - * token in the stack. - * - * @return array - */ - public function getHeaderLines(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($next === false) { - return []; - } - - $headerLines = []; - $headerLines[] = [ - 'type' => 'tag', - 'start' => $stackPtr, - 'end' => $stackPtr, - ]; - - $foundDocblock = false; - - $commentOpeners = Tokens::$scopeOpeners; - unset($commentOpeners[T_NAMESPACE]); - unset($commentOpeners[T_DECLARE]); - unset($commentOpeners[T_USE]); - unset($commentOpeners[T_IF]); - unset($commentOpeners[T_WHILE]); - unset($commentOpeners[T_FOR]); - unset($commentOpeners[T_FOREACH]); - unset($commentOpeners[T_DO]); - unset($commentOpeners[T_TRY]); - - do { - switch ($tokens[$next]['code']) { - case T_DOC_COMMENT_OPEN_TAG: - if ($foundDocblock === true) { - // Found a second docblock, so start of code. - break(2); - } - - // Make sure this is not a code-level docblock. - $end = $tokens[$next]['comment_closer']; - for ($docToken = ($end + 1); $docToken < $phpcsFile->numTokens; $docToken++) { - if (isset(Tokens::$emptyTokens[$tokens[$docToken]['code']]) === true) { - continue; - } - - if ($tokens[$docToken]['code'] === T_ATTRIBUTE - && isset($tokens[$docToken]['attribute_closer']) === true - ) { - $docToken = $tokens[$docToken]['attribute_closer']; - continue; - } - - break; - } - - if ($docToken === $phpcsFile->numTokens) { - $docToken--; - } - - if (isset($commentOpeners[$tokens[$docToken]['code']]) === false - && isset(Tokens::$methodPrefixes[$tokens[$docToken]['code']]) === false - ) { - // Check for an @var annotation. - $annotation = false; - for ($i = $next; $i < $end; $i++) { - if ($tokens[$i]['code'] === T_DOC_COMMENT_TAG - && strtolower($tokens[$i]['content']) === '@var' - ) { - $annotation = true; - break; - } - } - - if ($annotation === false) { - $foundDocblock = true; - $headerLines[] = [ - 'type' => 'docblock', - 'start' => $next, - 'end' => $end, - ]; - } - }//end if - - $next = $end; - break; - case T_DECLARE: - case T_NAMESPACE: - if (isset($tokens[$next]['scope_opener']) === true) { - // If this statement is using bracketed syntax, it doesn't - // apply to the entire files and so is not part of header. - // The header has now ended and the main code block begins. - break(2); - } - - $end = $phpcsFile->findEndOfStatement($next); - - $headerLines[] = [ - 'type' => substr(strtolower($tokens[$next]['type']), 2), - 'start' => $next, - 'end' => $end, - ]; - - $next = $end; - break; - case T_USE: - $type = 'use'; - $useType = $phpcsFile->findNext(Tokens::$emptyTokens, ($next + 1), null, true); - if ($useType !== false && $tokens[$useType]['code'] === T_STRING) { - $content = strtolower($tokens[$useType]['content']); - if ($content === 'function' || $content === 'const') { - $type .= ' '.$content; - } - } - - $end = $phpcsFile->findEndOfStatement($next); - - $headerLines[] = [ - 'type' => $type, - 'start' => $next, - 'end' => $end, - ]; - - $next = $end; - break; - default: - // Skip comments as PSR-12 doesn't say if these are allowed or not. - if (isset(Tokens::$commentTokens[$tokens[$next]['code']]) === true) { - $next = $phpcsFile->findNext(Tokens::$commentTokens, ($next + 1), null, true); - if ($next === false) { - // We reached the end of the file. - break(2); - } - - $next--; - break; - } - - // We found the start of the main code block. - break(2); - }//end switch - - $next = $phpcsFile->findNext(T_WHITESPACE, ($next + 1), null, true); - } while ($next !== false); - - return $headerLines; - - }//end getHeaderLines() - - - /** - * Check the spacing and grouping of the statements inside each header block. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param array $headerLines Header information, as sourced - * from getHeaderLines(). - * - * @return int|null - */ - public function processHeaderLines(File $phpcsFile, $headerLines) - { - $tokens = $phpcsFile->getTokens(); - - $found = []; - - foreach ($headerLines as $i => $line) { - if (isset($headerLines[($i + 1)]) === false - || $headerLines[($i + 1)]['type'] !== $line['type'] - ) { - // We're at the end of the current header block. - // Make sure there is a single blank line after - // this block. - $next = $phpcsFile->findNext(T_WHITESPACE, ($line['end'] + 1), null, true); - if ($next !== false && $tokens[$next]['line'] !== ($tokens[$line['end']]['line'] + 2)) { - $error = 'Header blocks must be separated by a single blank line'; - $fix = $phpcsFile->addFixableError($error, $line['end'], 'SpacingAfterBlock'); - if ($fix === true) { - if ($tokens[$next]['line'] === $tokens[$line['end']]['line']) { - $phpcsFile->fixer->addContentBefore($next, $phpcsFile->eolChar.$phpcsFile->eolChar); - } else if ($tokens[$next]['line'] === ($tokens[$line['end']]['line'] + 1)) { - $phpcsFile->fixer->addNewline($line['end']); - } else { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($line['end'] + 1); $i < $next; $i++) { - if ($tokens[$i]['line'] === ($tokens[$line['end']]['line'] + 2)) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - }//end if - }//end if - - // Make sure we haven't seen this next block before. - if (isset($headerLines[($i + 1)]) === true - && isset($found[$headerLines[($i + 1)]['type']]) === true - ) { - $error = 'Similar statements must be grouped together inside header blocks; '; - $error .= 'the first "%s" statement was found on line %s'; - $data = [ - $headerLines[($i + 1)]['type'], - $tokens[$found[$headerLines[($i + 1)]['type']]['start']]['line'], - ]; - $phpcsFile->addError($error, $headerLines[($i + 1)]['start'], 'IncorrectGrouping', $data); - } - } else if ($headerLines[($i + 1)]['type'] === $line['type']) { - // Still in the same block, so make sure there is no - // blank line after this statement. - $next = $phpcsFile->findNext(T_WHITESPACE, ($line['end'] + 1), null, true); - if ($tokens[$next]['line'] > ($tokens[$line['end']]['line'] + 1)) { - $error = 'Header blocks must not contain blank lines'; - $fix = $phpcsFile->addFixableError($error, $line['end'], 'SpacingInsideBlock'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($line['end'] + 1); $i < $next; $i++) { - if ($tokens[$i]['line'] === $tokens[$line['end']]['line']) { - continue; - } - - if ($tokens[$i]['line'] === $tokens[$next]['line']) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } - }//end if - - if (isset($found[$line['type']]) === false) { - $found[$line['type']] = $line; - } - }//end foreach - - /* - Next, check that the order of the header blocks - is correct: - Opening php tag. - File-level docblock. - One or more declare statements. - The namespace declaration of the file. - One or more class-based use import statements. - One or more function-based use import statements. - One or more constant-based use import statements. - */ - - $blockOrder = [ - 'tag' => 'opening PHP tag', - 'docblock' => 'file-level docblock', - 'declare' => 'declare statements', - 'namespace' => 'namespace declaration', - 'use' => 'class-based use imports', - 'use function' => 'function-based use imports', - 'use const' => 'constant-based use imports', - ]; - - foreach (array_keys($found) as $type) { - if ($type === 'tag') { - // The opening tag is always in the correct spot. - continue; - } - - do { - $orderedType = next($blockOrder); - } while ($orderedType !== false && key($blockOrder) !== $type); - - if ($orderedType === false) { - // We didn't find the block type in the rest of the - // ordered array, so it is out of place. - // Error and reset the array to the correct position - // so we can check the next block. - reset($blockOrder); - $prevValidType = 'tag'; - do { - $orderedType = next($blockOrder); - if (isset($found[key($blockOrder)]) === true - && key($blockOrder) !== $type - ) { - $prevValidType = key($blockOrder); - } - } while ($orderedType !== false && key($blockOrder) !== $type); - - $error = 'The %s must follow the %s in the file header'; - $data = [ - $blockOrder[$type], - $blockOrder[$prevValidType], - ]; - $phpcsFile->addError($error, $found[$type]['start'], 'IncorrectOrder', $data); - }//end if - }//end foreach - - }//end processHeaderLines() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/ImportStatementSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/ImportStatementSniff.php deleted file mode 100644 index 176aef0..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/ImportStatementSniff.php +++ /dev/null @@ -1,77 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Files; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class ImportStatementSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_USE]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Make sure this is not a closure USE group. - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($tokens[$next]['code'] === T_OPEN_PARENTHESIS) { - return; - } - - if ($phpcsFile->hasCondition($stackPtr, Tokens::$ooScopeTokens) === true) { - // This rule only applies to import statements. - return; - } - - if ($tokens[$next]['code'] === T_STRING - && (strtolower($tokens[$next]['content']) === 'function' - || strtolower($tokens[$next]['content']) === 'const') - ) { - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($next + 1), null, true); - } - - if ($tokens[$next]['code'] !== T_NS_SEPARATOR) { - return; - } - - $error = 'Import statements must not begin with a leading backslash'; - $fix = $phpcsFile->addFixableError($error, $next, 'LeadingSlash'); - - if ($fix === true) { - $phpcsFile->fixer->replaceToken($next, ''); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/OpenTagSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/OpenTagSniff.php deleted file mode 100644 index 4371bee..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/OpenTagSniff.php +++ /dev/null @@ -1,73 +0,0 @@ - - * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Files; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class OpenTagSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_OPEN_TAG]; - - }//end register() - - - /** - * Processes this sniff when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current - * token in the stack. - * - * @return int - */ - public function process(File $phpcsFile, $stackPtr) - { - if ($stackPtr !== 0) { - // This rule only applies if the open tag is on the first line of the file. - return $phpcsFile->numTokens; - } - - $next = $phpcsFile->findNext(T_INLINE_HTML, 0); - if ($next !== false) { - // This rule only applies to PHP-only files. - return $phpcsFile->numTokens; - } - - $tokens = $phpcsFile->getTokens(); - $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($next === false) { - // Empty file. - return; - } - - if ($tokens[$next]['line'] === $tokens[$stackPtr]['line']) { - $error = 'Opening PHP tag must be on a line by itself'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NotAlone'); - if ($fix === true) { - $phpcsFile->fixer->addNewline($stackPtr); - } - } - - return $phpcsFile->numTokens; - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Functions/NullableTypeDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Functions/NullableTypeDeclarationSniff.php deleted file mode 100644 index 8d90734..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Functions/NullableTypeDeclarationSniff.php +++ /dev/null @@ -1,91 +0,0 @@ - - * @copyright 2006-2018 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Functions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class NullableTypeDeclarationSniff implements Sniff -{ - - /** - * An array of valid tokens after `T_NULLABLE` occurrences. - * - * @var array - */ - private $validTokens = [ - T_STRING => true, - T_NS_SEPARATOR => true, - T_CALLABLE => true, - T_SELF => true, - T_PARENT => true, - T_STATIC => true, - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_NULLABLE]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $nextNonEmptyPtr = $phpcsFile->findNext([T_WHITESPACE], ($stackPtr + 1), null, true); - if ($nextNonEmptyPtr === false) { - // Parse error or live coding. - return; - } - - $tokens = $phpcsFile->getTokens(); - $nextNonEmptyCode = $tokens[$nextNonEmptyPtr]['code']; - $validTokenFound = isset($this->validTokens[$nextNonEmptyCode]); - - if ($validTokenFound === true && $nextNonEmptyPtr === ($stackPtr + 1)) { - // Valid structure. - return; - } - - $error = 'There must not be a space between the question mark and the type in nullable type declarations'; - - if ($validTokenFound === true) { - // No other tokens then whitespace tokens found; fixable. - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'WhitespaceFound'); - if ($fix === true) { - for ($i = ($stackPtr + 1); $i < $nextNonEmptyPtr; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - } - - return; - } - - // Non-whitespace tokens found; trigger error but don't fix. - $phpcsFile->addError($error, $stackPtr, 'UnexpectedCharactersFound'); - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Functions/ReturnTypeDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Functions/ReturnTypeDeclarationSniff.php deleted file mode 100644 index 14d91e2..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Functions/ReturnTypeDeclarationSniff.php +++ /dev/null @@ -1,110 +0,0 @@ - - * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Functions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class ReturnTypeDeclarationSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_FUNCTION, - T_CLOSURE, - T_FN, - ]; - - }//end register() - - - /** - * Processes this test when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]['parenthesis_opener']) === false - || isset($tokens[$stackPtr]['parenthesis_closer']) === false - || $tokens[$stackPtr]['parenthesis_opener'] === null - || $tokens[$stackPtr]['parenthesis_closer'] === null - ) { - return; - } - - $methodProperties = $phpcsFile->getMethodProperties($stackPtr); - if ($methodProperties['return_type'] === '') { - return; - } - - $returnType = $methodProperties['return_type_token']; - if ($methodProperties['nullable_return_type'] === true) { - $returnType = $phpcsFile->findPrevious(T_NULLABLE, ($returnType - 1)); - } - - if ($tokens[($returnType - 1)]['code'] !== T_WHITESPACE - || $tokens[($returnType - 1)]['content'] !== ' ' - || $tokens[($returnType - 2)]['code'] !== T_COLON - ) { - $error = 'There must be a single space between the colon and type in a return type declaration'; - if ($tokens[($returnType - 1)]['code'] === T_WHITESPACE - && $tokens[($returnType - 2)]['code'] === T_COLON - ) { - $fix = $phpcsFile->addFixableError($error, $returnType, 'SpaceBeforeReturnType'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($returnType - 1), ' '); - } - } else if ($tokens[($returnType - 1)]['code'] === T_COLON) { - $fix = $phpcsFile->addFixableError($error, $returnType, 'SpaceBeforeReturnType'); - if ($fix === true) { - $phpcsFile->fixer->addContentBefore($returnType, ' '); - } - } else { - $phpcsFile->addError($error, $returnType, 'SpaceBeforeReturnType'); - } - } - - $colon = $phpcsFile->findPrevious(T_COLON, $returnType); - if ($tokens[($colon - 1)]['code'] !== T_CLOSE_PARENTHESIS) { - $error = 'There must not be a space before the colon in a return type declaration'; - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($colon - 1), null, true); - if ($tokens[$prev]['code'] === T_CLOSE_PARENTHESIS) { - $fix = $phpcsFile->addFixableError($error, $colon, 'SpaceBeforeColon'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($x = ($prev + 1); $x < $colon; $x++) { - $phpcsFile->fixer->replaceToken($x, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } else { - $phpcsFile->addError($error, $colon, 'SpaceBeforeColon'); - } - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Keywords/ShortFormTypeKeywordsSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Keywords/ShortFormTypeKeywordsSniff.php deleted file mode 100644 index adf04d9..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Keywords/ShortFormTypeKeywordsSniff.php +++ /dev/null @@ -1,75 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Keywords; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class ShortFormTypeKeywordsSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_BOOL_CAST, - T_INT_CAST, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $typecast = str_replace(' ', '', $tokens[$stackPtr]['content']); - $typecast = str_replace("\t", '', $typecast); - $typecast = trim($typecast, '()'); - $typecastLc = strtolower($typecast); - - if (($tokens[$stackPtr]['code'] === T_BOOL_CAST - && $typecastLc === 'bool') - || ($tokens[$stackPtr]['code'] === T_INT_CAST - && $typecastLc === 'int') - ) { - return; - } - - $error = 'Short form type keywords must be used. Found: %s'; - $data = [$tokens[$stackPtr]['content']]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'LongFound', $data); - if ($fix === true) { - if ($tokens[$stackPtr]['code'] === T_BOOL_CAST) { - $replacement = str_replace($typecast, 'bool', $tokens[$stackPtr]['content']); - } else { - $replacement = str_replace($typecast, 'int', $tokens[$stackPtr]['content']); - } - - $phpcsFile->fixer->replaceToken($stackPtr, $replacement); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Namespaces/CompoundNamespaceDepthSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Namespaces/CompoundNamespaceDepthSniff.php deleted file mode 100644 index 725fbde..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Namespaces/CompoundNamespaceDepthSniff.php +++ /dev/null @@ -1,80 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Namespaces; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class CompoundNamespaceDepthSniff implements Sniff -{ - - /** - * The max depth for compound namespaces. - * - * @var integer - */ - public $maxDepth = 2; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_OPEN_USE_GROUP]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $this->maxDepth = (int) $this->maxDepth; - - $tokens = $phpcsFile->getTokens(); - - $end = $phpcsFile->findNext(T_CLOSE_USE_GROUP, ($stackPtr + 1)); - if ($end === false) { - return; - } - - $depth = 1; - for ($i = ($stackPtr + 1); $i <= $end; $i++) { - if ($tokens[$i]['code'] === T_NS_SEPARATOR) { - $depth++; - continue; - } - - if ($i === $end || $tokens[$i]['code'] === T_COMMA) { - // End of a namespace. - if ($depth > $this->maxDepth) { - $error = 'Compound namespaces cannot have a depth more than %s'; - $data = [$this->maxDepth]; - $phpcsFile->addError($error, $i, 'TooDeep', $data); - } - - $depth = 1; - } - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Operators/OperatorSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Operators/OperatorSpacingSniff.php deleted file mode 100644 index 8757e05..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Operators/OperatorSpacingSniff.php +++ /dev/null @@ -1,112 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Operators; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\OperatorSpacingSniff as SquizOperatorSpacingSniff; -use PHP_CodeSniffer\Util\Tokens; - -class OperatorSpacingSniff extends SquizOperatorSpacingSniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - parent::register(); - - $targets = Tokens::$comparisonTokens; - $targets += Tokens::$operators; - $targets += Tokens::$assignmentTokens; - $targets += Tokens::$booleanOperators; - $targets[] = T_INLINE_THEN; - $targets[] = T_INLINE_ELSE; - $targets[] = T_STRING_CONCAT; - $targets[] = T_INSTANCEOF; - - return $targets; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being checked. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if ($this->isOperator($phpcsFile, $stackPtr) === false) { - return; - } - - $operator = $tokens[$stackPtr]['content']; - - $checkBefore = true; - $checkAfter = true; - - // Skip short ternary. - if ($tokens[($stackPtr)]['code'] === T_INLINE_ELSE - && $tokens[($stackPtr - 1)]['code'] === T_INLINE_THEN - ) { - $checkBefore = false; - } - - // Skip operator with comment on previous line. - if ($tokens[($stackPtr - 1)]['code'] === T_COMMENT - && $tokens[($stackPtr - 1)]['line'] < $tokens[$stackPtr]['line'] - ) { - $checkBefore = false; - } - - if (isset($tokens[($stackPtr + 1)]) === true) { - // Skip short ternary. - if ($tokens[$stackPtr]['code'] === T_INLINE_THEN - && $tokens[($stackPtr + 1)]['code'] === T_INLINE_ELSE - ) { - $checkAfter = false; - } - } else { - // Skip partial files. - $checkAfter = false; - } - - if ($checkBefore === true && $tokens[($stackPtr - 1)]['code'] !== T_WHITESPACE) { - $error = 'Expected at least 1 space before "%s"; 0 found'; - $data = [$operator]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceBefore', $data); - if ($fix === true) { - $phpcsFile->fixer->addContentBefore($stackPtr, ' '); - } - } - - if ($checkAfter === true && $tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { - $error = 'Expected at least 1 space after "%s"; 0 found'; - $data = [$operator]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceAfter', $data); - if ($fix === true) { - $phpcsFile->fixer->addContent($stackPtr, ' '); - } - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Properties/ConstantVisibilitySniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Properties/ConstantVisibilitySniff.php deleted file mode 100644 index 8a1000f..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Properties/ConstantVisibilitySniff.php +++ /dev/null @@ -1,61 +0,0 @@ - - * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Properties; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class ConstantVisibilitySniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_CONST]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Make sure this is a class constant. - if ($phpcsFile->hasCondition($stackPtr, Tokens::$ooScopeTokens) === false) { - return; - } - - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if (isset(Tokens::$scopeModifiers[$tokens[$prev]['code']]) === true) { - return; - } - - $error = 'Visibility must be declared on all constants if your project supports PHP 7.1 or later'; - $phpcsFile->addWarning($error, $stackPtr, 'NotFound'); - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php deleted file mode 100644 index 113e8b9..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php +++ /dev/null @@ -1,700 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Traits; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class UseDeclarationSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_USE]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Needs to be a use statement directly inside a class. - $conditions = $tokens[$stackPtr]['conditions']; - end($conditions); - if (isset(Tokens::$ooScopeTokens[current($conditions)]) === false) { - return; - } - - $ooToken = key($conditions); - $opener = $tokens[$ooToken]['scope_opener']; - - // Figure out where all the use statements are. - $useTokens = [$stackPtr]; - for ($i = ($stackPtr + 1); $i < $tokens[$ooToken]['scope_closer']; $i++) { - if ($tokens[$i]['code'] === T_USE) { - $useTokens[] = $i; - } - - if (isset($tokens[$i]['scope_closer']) === true) { - $i = $tokens[$i]['scope_closer']; - } - } - - $numUseTokens = count($useTokens); - foreach ($useTokens as $usePos => $useToken) { - if ($usePos === 0) { - /* - This is the first use statement. - */ - - // The first non-comment line must be the use line. - $lastValidContent = $useToken; - for ($i = ($useToken - 1); $i > $opener; $i--) { - if ($tokens[$i]['code'] === T_WHITESPACE - && ($tokens[($i - 1)]['line'] === $tokens[$i]['line'] - || $tokens[($i + 1)]['line'] === $tokens[$i]['line']) - ) { - continue; - } - - if (isset(Tokens::$commentTokens[$tokens[$i]['code']]) === true) { - if ($tokens[$i]['code'] === T_DOC_COMMENT_CLOSE_TAG) { - // Skip past the comment. - $i = $tokens[$i]['comment_opener']; - } - - $lastValidContent = $i; - - continue; - } - - break; - }//end for - - if ($tokens[$lastValidContent]['line'] !== ($tokens[$opener]['line'] + 1)) { - $error = 'The first trait import statement must be declared on the first non-comment line after the %s opening brace'; - $data = [strtolower($tokens[$ooToken]['content'])]; - - // Figure out if we can fix this error. - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($useToken - 1), ($opener - 1), true); - if ($tokens[$prev]['line'] === $tokens[$opener]['line']) { - $fix = $phpcsFile->addFixableError($error, $useToken, 'UseAfterBrace', $data); - if ($fix === true) { - // We know that the USE statements is the first non-comment content - // in the class, so we just need to remove blank lines. - $phpcsFile->fixer->beginChangeset(); - for ($i = ($useToken - 1); $i > $opener; $i--) { - if ($tokens[$i]['line'] === $tokens[$opener]['line']) { - break; - } - - if ($tokens[$i]['line'] === $tokens[$useToken]['line']) { - continue; - } - - if ($tokens[$i]['code'] === T_WHITESPACE - && $tokens[($i - 1)]['line'] !== $tokens[$i]['line'] - && $tokens[($i + 1)]['line'] !== $tokens[$i]['line'] - ) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - if (isset(Tokens::$commentTokens[$tokens[$i]['code']]) === true) { - if ($tokens[$i]['code'] === T_DOC_COMMENT_CLOSE_TAG) { - // Skip past the comment. - $i = $tokens[$i]['comment_opener']; - } - - $lastValidContent = $i; - } - }//end for - - $phpcsFile->fixer->endChangeset(); - }//end if - } else { - $phpcsFile->addError($error, $useToken, 'UseAfterBrace', $data); - }//end if - }//end if - } else { - // Make sure this use statement is not on the same line as the previous one. - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($useToken - 1), null, true); - if ($prev !== false && $tokens[$prev]['line'] === $tokens[$useToken]['line']) { - $error = 'Each imported trait must be on its own line'; - $prevNonWs = $phpcsFile->findPrevious(T_WHITESPACE, ($useToken - 1), null, true); - if ($prevNonWs !== $prev) { - $phpcsFile->addError($error, $useToken, 'SpacingBeforeImport'); - } else { - $fix = $phpcsFile->addFixableError($error, $useToken, 'SpacingBeforeImport'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($x = ($useToken - 1); $x > $prev; $x--) { - if ($tokens[$x]['line'] === $tokens[$useToken]['line'] - ) { - // Preserve indent. - continue; - } - - $phpcsFile->fixer->replaceToken($x, ''); - } - - $phpcsFile->fixer->addNewline($prev); - if ($tokens[$prev]['line'] === $tokens[$useToken]['line']) { - if ($tokens[($useToken - 1)]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->replaceToken(($useToken - 1), ''); - } - - $padding = str_repeat(' ', ($tokens[$useTokens[0]]['column'] - 1)); - $phpcsFile->fixer->addContent($prev, $padding); - } - - $phpcsFile->fixer->endChangeset(); - }//end if - }//end if - }//end if - }//end if - - // Check the formatting of the statement. - if (isset($tokens[$useToken]['scope_opener']) === true) { - $this->processUseGroup($phpcsFile, $useToken); - $end = $tokens[$useToken]['scope_closer']; - } else { - $this->processUseStatement($phpcsFile, $useToken); - $end = $phpcsFile->findNext(T_SEMICOLON, ($useToken + 1)); - if ($end === false) { - // Syntax error. - return; - } - } - - if ($usePos === ($numUseTokens - 1)) { - /* - This is the last use statement. - */ - - $next = $phpcsFile->findNext(T_WHITESPACE, ($end + 1), null, true); - if ($next === $tokens[$ooToken]['scope_closer']) { - // Last content in the class. - $closer = $tokens[$ooToken]['scope_closer']; - if ($tokens[$closer]['line'] > ($tokens[$end]['line'] + 1)) { - $error = 'There must be no blank line after the last trait import statement at the bottom of a %s'; - $data = [strtolower($tokens[$ooToken]['content'])]; - $fix = $phpcsFile->addFixableError($error, $end, 'BlankLineAfterLastUse', $data); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($end + 1); $i < $closer; $i++) { - if ($tokens[$i]['line'] === $tokens[$end]['line']) { - continue; - } - - if ($tokens[$i]['line'] === $tokens[$closer]['line']) { - // Don't remove indents. - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - }//end if - } else if ($tokens[$next]['code'] !== T_USE) { - // Comments are allowed on the same line as the use statement, so make sure - // we don't error for those. - for ($next = ($end + 1); $next < $tokens[$ooToken]['scope_closer']; $next++) { - if ($tokens[$next]['code'] === T_WHITESPACE) { - continue; - } - - if (isset(Tokens::$commentTokens[$tokens[$next]['code']]) === true - && $tokens[$next]['line'] === $tokens[$end]['line'] - ) { - continue; - } - - break; - } - - if ($tokens[$next]['line'] <= ($tokens[$end]['line'] + 1)) { - $error = 'There must be a blank line following the last trait import statement'; - $fix = $phpcsFile->addFixableError($error, $end, 'NoBlankLineAfterUse'); - if ($fix === true) { - if ($tokens[$next]['line'] === $tokens[$useToken]['line']) { - $phpcsFile->fixer->addContentBefore($next, $phpcsFile->eolChar.$phpcsFile->eolChar); - } else { - for ($i = ($next - 1); $i > $end; $i--) { - if ($tokens[$i]['line'] !== $tokens[$next]['line']) { - break; - } - } - - $phpcsFile->fixer->addNewlineBefore(($i + 1)); - } - } - } - }//end if - } else { - // Ensure use statements are grouped. - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($end + 1), null, true); - if ($next !== $useTokens[($usePos + 1)]) { - $error = 'Imported traits must be grouped together'; - $phpcsFile->addError($error, $useTokens[($usePos + 1)], 'NotGrouped'); - } - }//end if - }//end foreach - - return $tokens[$ooToken]['scope_closer']; - - }//end process() - - - /** - * Processes a group use statement. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - protected function processUseGroup(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $opener = $tokens[$stackPtr]['scope_opener']; - $closer = $tokens[$stackPtr]['scope_closer']; - - if ($tokens[$opener]['line'] !== $tokens[$stackPtr]['line']) { - $error = 'The opening brace of a trait import statement must be on the same line as the USE keyword'; - // Figure out if we can fix this error. - $canFix = true; - for ($i = ($stackPtr + 1); $i < $opener; $i++) { - if ($tokens[$i]['line'] !== $tokens[($i + 1)]['line'] - && $tokens[$i]['code'] !== T_WHITESPACE - ) { - $canFix = false; - break; - } - } - - if ($canFix === true) { - $fix = $phpcsFile->addFixableError($error, $opener, 'OpenBraceNewLine'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($stackPtr + 1); $i < $opener; $i++) { - if ($tokens[$i]['line'] !== $tokens[($i + 1)]['line']) { - // Everything should have a single space around it. - $phpcsFile->fixer->replaceToken($i, ' '); - } - } - - $phpcsFile->fixer->endChangeset(); - } - } else { - $phpcsFile->addError($error, $opener, 'OpenBraceNewLine'); - } - }//end if - - $error = 'Expected 1 space before opening brace in trait import statement; %s found'; - if ($tokens[($opener - 1)]['code'] !== T_WHITESPACE) { - $data = ['0']; - $fix = $phpcsFile->addFixableError($error, $opener, 'SpaceBeforeOpeningBrace', $data); - if ($fix === true) { - $phpcsFile->fixer->addContentBefore($opener, ' '); - } - } else if ($tokens[($opener - 1)]['content'] !== ' ') { - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($opener - 1), null, true); - if ($tokens[$prev]['line'] !== $tokens[$opener]['line']) { - $found = 'newline'; - } else { - $found = $tokens[($opener - 1)]['length']; - } - - $data = [$found]; - $fix = $phpcsFile->addFixableError($error, $opener, 'SpaceBeforeOpeningBrace', $data); - if ($fix === true) { - if ($found === 'newline') { - $phpcsFile->fixer->beginChangeset(); - for ($x = ($opener - 1); $x > $prev; $x--) { - $phpcsFile->fixer->replaceToken($x, ''); - } - - $phpcsFile->fixer->addContentBefore($opener, ' '); - $phpcsFile->fixer->endChangeset(); - } else { - $phpcsFile->fixer->replaceToken(($opener - 1), ' '); - } - } - }//end if - - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($opener + 1), ($closer - 1), true); - if ($next !== false && $tokens[$next]['line'] !== ($tokens[$opener]['line'] + 1)) { - $error = 'First trait conflict resolution statement must be on the line after the opening brace'; - $nextNonWs = $phpcsFile->findNext(T_WHITESPACE, ($opener + 1), ($closer - 1), true); - if ($nextNonWs !== $next) { - $phpcsFile->addError($error, $opener, 'SpaceAfterOpeningBrace'); - } else { - $fix = $phpcsFile->addFixableError($error, $opener, 'SpaceAfterOpeningBrace'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($x = ($opener + 1); $x < $next; $x++) { - if ($tokens[$x]['line'] === $tokens[$next]['line']) { - // Preserve indent. - break; - } - - $phpcsFile->fixer->replaceToken($x, ''); - } - - $phpcsFile->fixer->addNewline($opener); - $phpcsFile->fixer->endChangeset(); - } - } - }//end if - - for ($i = ($stackPtr + 1); $i < $opener; $i++) { - if ($tokens[$i]['code'] !== T_COMMA) { - continue; - } - - if ($tokens[($i - 1)]['code'] === T_WHITESPACE) { - $error = 'Expected no space before comma in trait import statement; %s found'; - $data = [$tokens[($i - 1)]['length']]; - $fix = $phpcsFile->addFixableError($error, $i, 'SpaceBeforeComma', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($i - 1), ''); - } - } - - $error = 'Expected 1 space after comma in trait import statement; %s found'; - if ($tokens[($i + 1)]['code'] !== T_WHITESPACE) { - $data = ['0']; - $fix = $phpcsFile->addFixableError($error, $i, 'SpaceAfterComma', $data); - if ($fix === true) { - $phpcsFile->fixer->addContent($i, ' '); - } - } else if ($tokens[($i + 1)]['content'] !== ' ') { - $next = $phpcsFile->findNext(T_WHITESPACE, ($i + 1), $opener, true); - if ($tokens[$next]['line'] !== $tokens[$i]['line']) { - $found = 'newline'; - } else { - $found = $tokens[($i + 1)]['length']; - } - - $data = [$found]; - $fix = $phpcsFile->addFixableError($error, $i, 'SpaceAfterComma', $data); - if ($fix === true) { - if ($found === 'newline') { - $phpcsFile->fixer->beginChangeset(); - for ($x = ($i + 1); $x < $next; $x++) { - $phpcsFile->fixer->replaceToken($x, ''); - } - - $phpcsFile->fixer->addContent($i, ' '); - $phpcsFile->fixer->endChangeset(); - } else { - $phpcsFile->fixer->replaceToken(($i + 1), ' '); - } - } - }//end if - }//end for - - for ($i = ($opener + 1); $i < $closer; $i++) { - if ($tokens[$i]['code'] === T_INSTEADOF) { - $error = 'Expected 1 space before INSTEADOF in trait import statement; %s found'; - if ($tokens[($i - 1)]['code'] !== T_WHITESPACE) { - $data = ['0']; - $fix = $phpcsFile->addFixableError($error, $i, 'SpaceBeforeInsteadof', $data); - if ($fix === true) { - $phpcsFile->fixer->addContentBefore($i, ' '); - } - } else if ($tokens[($i - 1)]['content'] !== ' ') { - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($i - 1), $opener, true); - if ($tokens[$prev]['line'] !== $tokens[$i]['line']) { - $found = 'newline'; - } else { - $found = $tokens[($i - 1)]['length']; - } - - $data = [$found]; - - $prevNonWs = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($i - 1), $opener, true); - if ($prevNonWs !== $prev) { - $phpcsFile->addError($error, $i, 'SpaceBeforeInsteadof', $data); - } else { - $fix = $phpcsFile->addFixableError($error, $i, 'SpaceBeforeInsteadof', $data); - if ($fix === true) { - if ($found === 'newline') { - $phpcsFile->fixer->beginChangeset(); - for ($x = ($i - 1); $x > $prev; $x--) { - $phpcsFile->fixer->replaceToken($x, ''); - } - - $phpcsFile->fixer->addContentBefore($i, ' '); - $phpcsFile->fixer->endChangeset(); - } else { - $phpcsFile->fixer->replaceToken(($i - 1), ' '); - } - } - } - }//end if - - $error = 'Expected 1 space after INSTEADOF in trait import statement; %s found'; - if ($tokens[($i + 1)]['code'] !== T_WHITESPACE) { - $data = ['0']; - $fix = $phpcsFile->addFixableError($error, $i, 'SpaceAfterInsteadof', $data); - if ($fix === true) { - $phpcsFile->fixer->addContent($i, ' '); - } - } else if ($tokens[($i + 1)]['content'] !== ' ') { - $next = $phpcsFile->findNext(T_WHITESPACE, ($i + 1), $closer, true); - if ($tokens[$next]['line'] !== $tokens[$i]['line']) { - $found = 'newline'; - } else { - $found = $tokens[($i + 1)]['length']; - } - - $data = [$found]; - - $nextNonWs = $phpcsFile->findNext(Tokens::$emptyTokens, ($i + 1), $closer, true); - if ($nextNonWs !== $next) { - $phpcsFile->addError($error, $i, 'SpaceAfterInsteadof', $data); - } else { - $fix = $phpcsFile->addFixableError($error, $i, 'SpaceAfterInsteadof', $data); - if ($fix === true) { - if ($found === 'newline') { - $phpcsFile->fixer->beginChangeset(); - for ($x = ($i + 1); $x < $next; $x++) { - $phpcsFile->fixer->replaceToken($x, ''); - } - - $phpcsFile->fixer->addContent($i, ' '); - $phpcsFile->fixer->endChangeset(); - } else { - $phpcsFile->fixer->replaceToken(($i + 1), ' '); - } - } - } - }//end if - }//end if - - if ($tokens[$i]['code'] === T_AS) { - $error = 'Expected 1 space before AS in trait import statement; %s found'; - if ($tokens[($i - 1)]['code'] !== T_WHITESPACE) { - $data = ['0']; - $fix = $phpcsFile->addFixableError($error, $i, 'SpaceBeforeAs', $data); - if ($fix === true) { - $phpcsFile->fixer->addContentBefore($i, ' '); - } - } else if ($tokens[($i - 1)]['content'] !== ' ') { - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($i - 1), $opener, true); - if ($tokens[$prev]['line'] !== $tokens[$i]['line']) { - $found = 'newline'; - } else { - $found = $tokens[($i - 1)]['length']; - } - - $data = [$found]; - - $prevNonWs = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($i - 1), $opener, true); - if ($prevNonWs !== $prev) { - $phpcsFile->addError($error, $i, 'SpaceBeforeAs', $data); - } else { - $fix = $phpcsFile->addFixableError($error, $i, 'SpaceBeforeAs', $data); - if ($fix === true) { - if ($found === 'newline') { - $phpcsFile->fixer->beginChangeset(); - for ($x = ($i - 1); $x > $prev; $x--) { - $phpcsFile->fixer->replaceToken($x, ''); - } - - $phpcsFile->fixer->addContentBefore($i, ' '); - $phpcsFile->fixer->endChangeset(); - } else { - $phpcsFile->fixer->replaceToken(($i - 1), ' '); - } - } - } - }//end if - - $error = 'Expected 1 space after AS in trait import statement; %s found'; - if ($tokens[($i + 1)]['code'] !== T_WHITESPACE) { - $data = ['0']; - $fix = $phpcsFile->addFixableError($error, $i, 'SpaceAfterAs', $data); - if ($fix === true) { - $phpcsFile->fixer->addContent($i, ' '); - } - } else if ($tokens[($i + 1)]['content'] !== ' ') { - $next = $phpcsFile->findNext(T_WHITESPACE, ($i + 1), $closer, true); - if ($tokens[$next]['line'] !== $tokens[$i]['line']) { - $found = 'newline'; - } else { - $found = $tokens[($i + 1)]['length']; - } - - $data = [$found]; - - $nextNonWs = $phpcsFile->findNext(Tokens::$emptyTokens, ($i + 1), $closer, true); - if ($nextNonWs !== $next) { - $phpcsFile->addError($error, $i, 'SpaceAfterAs', $data); - } else { - $fix = $phpcsFile->addFixableError($error, $i, 'SpaceAfterAs', $data); - if ($fix === true) { - if ($found === 'newline') { - $phpcsFile->fixer->beginChangeset(); - for ($x = ($i + 1); $x < $next; $x++) { - $phpcsFile->fixer->replaceToken($x, ''); - } - - $phpcsFile->fixer->addContent($i, ' '); - $phpcsFile->fixer->endChangeset(); - } else { - $phpcsFile->fixer->replaceToken(($i + 1), ' '); - } - } - } - }//end if - }//end if - - if ($tokens[$i]['code'] === T_SEMICOLON) { - if ($tokens[($i - 1)]['code'] === T_WHITESPACE) { - $error = 'Expected no space before semicolon in trait import statement; %s found'; - $data = [$tokens[($i - 1)]['length']]; - $fix = $phpcsFile->addFixableError($error, $i, 'SpaceBeforeSemicolon', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($i - 1), ''); - } - } - - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($i + 1), ($closer - 1), true); - if ($next !== false && $tokens[$next]['line'] === $tokens[$i]['line']) { - $error = 'Each trait conflict resolution statement must be on a line by itself'; - $nextNonWs = $phpcsFile->findNext(T_WHITESPACE, ($i + 1), ($closer - 1), true); - if ($nextNonWs !== $next) { - $phpcsFile->addError($error, $i, 'ConflictSameLine'); - } else { - $fix = $phpcsFile->addFixableError($error, $i, 'ConflictSameLine'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - if ($tokens[($i + 1)]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->replaceToken(($i + 1), ''); - } - - $phpcsFile->fixer->addNewline($i); - $phpcsFile->fixer->endChangeset(); - } - } - } - }//end if - }//end for - - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($closer - 1), ($opener + 1), true); - if ($prev !== false && $tokens[$prev]['line'] !== ($tokens[$closer]['line'] - 1)) { - $error = 'Closing brace must be on the line after the last trait conflict resolution statement'; - $prevNonWs = $phpcsFile->findPrevious(T_WHITESPACE, ($closer - 1), ($opener + 1), true); - if ($prevNonWs !== $prev) { - $phpcsFile->addError($error, $closer, 'SpaceBeforeClosingBrace'); - } else { - $fix = $phpcsFile->addFixableError($error, $closer, 'SpaceBeforeClosingBrace'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($x = ($closer - 1); $x > $prev; $x--) { - if ($tokens[$x]['line'] === $tokens[$closer]['line']) { - // Preserve indent. - continue; - } - - $phpcsFile->fixer->replaceToken($x, ''); - } - - $phpcsFile->fixer->addNewline($prev); - $phpcsFile->fixer->endChangeset(); - } - } - }//end if - - }//end processUseGroup() - - - /** - * Processes a single use statement. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - protected function processUseStatement(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $error = 'Expected 1 space after USE in trait import statement; %s found'; - if ($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { - $data = ['0']; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterAs', $data); - if ($fix === true) { - $phpcsFile->fixer->addContent($stackPtr, ' '); - } - } else if ($tokens[($stackPtr + 1)]['content'] !== ' ') { - $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($tokens[$next]['line'] !== $tokens[$stackPtr]['line']) { - $found = 'newline'; - } else { - $found = $tokens[($stackPtr + 1)]['length']; - } - - $data = [$found]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterAs', $data); - if ($fix === true) { - if ($found === 'newline') { - $phpcsFile->fixer->beginChangeset(); - for ($x = ($stackPtr + 1); $x < $next; $x++) { - $phpcsFile->fixer->replaceToken($x, ''); - } - - $phpcsFile->fixer->addContent($stackPtr, ' '); - $phpcsFile->fixer->endChangeset(); - } else { - $phpcsFile->fixer->replaceToken(($stackPtr + 1), ' '); - } - } - }//end if - - $next = $phpcsFile->findNext([T_COMMA, T_SEMICOLON], ($stackPtr + 1)); - if ($next !== false && $tokens[$next]['code'] === T_COMMA) { - $error = 'Each imported trait must have its own "use" import statement'; - $fix = $phpcsFile->addFixableError($error, $next, 'MultipleImport'); - if ($fix === true) { - $padding = str_repeat(' ', ($tokens[$stackPtr]['column'] - 1)); - $phpcsFile->fixer->replaceToken($next, ';'.$phpcsFile->eolChar.$padding.'use '); - } - } - - }//end processUseStatement() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.inc deleted file mode 100644 index e132b54..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.inc +++ /dev/null @@ -1,84 +0,0 @@ -bar( - new class implements Bar { - // ... - }, -); - -foo(new class { -}); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.inc.fixed deleted file mode 100644 index 921dcc0..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.inc.fixed +++ /dev/null @@ -1,86 +0,0 @@ -bar( - new class implements Bar { - // ... - }, -); - -foo(new class { -}); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.php deleted file mode 100644 index cc162b2..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.php +++ /dev/null @@ -1,71 +0,0 @@ - - * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Tests\Classes; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class AnonClassDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 28 => 3, - 30 => 1, - 31 => 4, - 32 => 1, - 33 => 1, - 34 => 1, - 35 => 1, - 36 => 1, - 37 => 3, - 39 => 1, - 40 => 1, - 43 => 3, - 44 => 4, - 45 => 1, - 48 => 1, - 52 => 3, - 53 => 1, - 54 => 1, - 55 => 1, - 56 => 2, - 63 => 1, - 75 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.inc deleted file mode 100644 index d933ee2..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.inc +++ /dev/null @@ -1,44 +0,0 @@ -bar(); -echo (new Foo)->bar(); -echo (new Foo((new Bar)->getBaz()))->bar(); -$foo = (new Foo)::$bar; - -echo (new Foo((new Bar//comment -)->getBaz(new Baz /* comment */)))->bar(); - -$foo = new $bar['a'](); -$foo = new $bar['a']['b'](); -$foo = new $bar['a'][$baz['a']['b']]['b'](); -$foo = new $bar['a'] [$baz['a']/* comment */ ['b']]['b']; - -$a = new self::$transport[$cap_string]; -$renderer = new $this->inline_diff_renderer; -$a = new ${$varHoldingClassName}; - -$class = new $obj?->classname(); -$class = new $obj?->classname; -$class = new ${$obj?->classname}; - -// Issue 3456. -// Anon classes should be skipped, even when there is an attribute between the new and the class keywords. -$anonWithAttribute = new #[SomeAttribute('summary')] class { - public const SOME_STUFF = 'foo'; -}; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.inc.fixed deleted file mode 100644 index 02e3544..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.inc.fixed +++ /dev/null @@ -1,44 +0,0 @@ -bar(); -echo (new Foo())->bar(); -echo (new Foo((new Bar())->getBaz()))->bar(); -$foo = (new Foo())::$bar; - -echo (new Foo((new Bar()//comment -)->getBaz(new Baz() /* comment */)))->bar(); - -$foo = new $bar['a'](); -$foo = new $bar['a']['b'](); -$foo = new $bar['a'][$baz['a']['b']]['b'](); -$foo = new $bar['a'] [$baz['a']/* comment */ ['b']]['b'](); - -$a = new self::$transport[$cap_string](); -$renderer = new $this->inline_diff_renderer(); -$a = new ${$varHoldingClassName}(); - -$class = new $obj?->classname(); -$class = new $obj?->classname(); -$class = new ${$obj?->classname}(); - -// Issue 3456. -// Anon classes should be skipped, even when there is an attribute between the new and the class keywords. -$anonWithAttribute = new #[SomeAttribute('summary')] class { - public const SOME_STUFF = 'foo'; -}; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.php deleted file mode 100644 index 3fb1ab9..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.php +++ /dev/null @@ -1,66 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Tests\Classes; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ClassInstantiationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 3 => 1, - 4 => 1, - 9 => 1, - 11 => 1, - 14 => 1, - 16 => 1, - 20 => 1, - 21 => 1, - 22 => 1, - 24 => 1, - 25 => 1, - 30 => 1, - 32 => 1, - 33 => 1, - 34 => 1, - 37 => 1, - 38 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClosingBraceUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClosingBraceUnitTest.inc deleted file mode 100644 index 1d2e92c..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClosingBraceUnitTest.inc +++ /dev/null @@ -1,47 +0,0 @@ -bar( - $arg1, - function ($arg2) use ($var1) { - // body - }, - $arg3 -); - -$instance = new class extends \Foo implements \HandleableInterface { - // Class content -}; - -$app->get('/hello/{name}', function ($name) use ($app) { - return 'Hello ' . $app->escape($name); -}); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClosingBraceUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClosingBraceUnitTest.php deleted file mode 100644 index 1deac1c..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClosingBraceUnitTest.php +++ /dev/null @@ -1,54 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Tests\Classes; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ClosingBraceUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 13 => 1, - 14 => 1, - 19 => 1, - 24 => 1, - 31 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/OpeningBraceSpaceUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/OpeningBraceSpaceUnitTest.inc deleted file mode 100644 index 509c48c..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/OpeningBraceSpaceUnitTest.inc +++ /dev/null @@ -1,49 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Tests\Classes; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class OpeningBraceSpaceUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 10 => 1, - 18 => 1, - 24 => 1, - 34 => 1, - 41 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/BooleanOperatorPlacementUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/BooleanOperatorPlacementUnitTest.inc deleted file mode 100644 index 4bc2ece..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/BooleanOperatorPlacementUnitTest.inc +++ /dev/null @@ -1,131 +0,0 @@ - 0 && $n < 10) - || ($n > 10 && $n < 20) - || ($n > 20 && $n < 30) -) { - return $n; -} - -if ( - ( - $expr1 - && $expr2 - && $expr3 - && $expr4 - && $expr5 - && $expr6 - ) - || ($n > 100 && $n < 200) - || ($n > 200 && $n < 300) -) { - return $n; -} - -// phpcs:set PSR12.ControlStructures.BooleanOperatorPlacement allowOnly first -if ( - $expr1 - && $expr2 - && ($expr3 - || $expr4) - && $expr5 -) { - // if body -} elseif ( - $expr1 && - ($expr3 || $expr4) - && $expr5 -) { - // elseif body -} elseif ( - $expr1 - && ($expr3 || $expr4) && - $expr5 -) { - // elseif body -} - -// phpcs:set PSR12.ControlStructures.BooleanOperatorPlacement allowOnly last -if ( - $expr1 - && $expr2 - && ($expr3 - || $expr4) - && $expr5 -) { - // if body -} elseif ( - $expr1 && - ($expr3 || $expr4) - && $expr5 -) { - // elseif body -} elseif ( - $expr1 - && ($expr3 || $expr4) && - $expr5 -) { - // elseif body -} - -if ( - ($value == 1 || - $value == 2) - && - ($value == 3 || - $value == 4) -) { - return 5; -} - -// Reset to default. -// phpcs:set PSR12.ControlStructures.BooleanOperatorPlacement allowOnly - -match ( - $expr1 - && $expr2 && - $expr3 -) { - // structure body -}; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/BooleanOperatorPlacementUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/BooleanOperatorPlacementUnitTest.inc.fixed deleted file mode 100644 index 5f4d223..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/BooleanOperatorPlacementUnitTest.inc.fixed +++ /dev/null @@ -1,141 +0,0 @@ - 0 && $n < 10) - || ($n > 10 && $n < 20) - || ($n > 20 && $n < 30) -) { - return $n; -} - -if ( - ( - $expr1 - && $expr2 - && $expr3 - && $expr4 - && $expr5 - && $expr6 - ) - || ($n > 100 && $n < 200) - || ($n > 200 && $n < 300) -) { - return $n; -} - -// phpcs:set PSR12.ControlStructures.BooleanOperatorPlacement allowOnly first -if ( - $expr1 - && $expr2 - && ($expr3 - || $expr4) - && $expr5 -) { - // if body -} elseif ( - $expr1 - && ($expr3 - || $expr4) - && $expr5 -) { - // elseif body -} elseif ( - $expr1 - && ($expr3 - || $expr4) - && $expr5 -) { - // elseif body -} - -// phpcs:set PSR12.ControlStructures.BooleanOperatorPlacement allowOnly last -if ( - $expr1 && - $expr2 && - ($expr3 || - $expr4) && - $expr5 -) { - // if body -} elseif ( - $expr1 && - ($expr3 || - $expr4) && - $expr5 -) { - // elseif body -} elseif ( - $expr1 && - ($expr3 || - $expr4) && - $expr5 -) { - // elseif body -} - -if ( - ($value == 1 || - $value == 2) - && - ($value == 3 || - $value == 4) -) { - return 5; -} - -// Reset to default. -// phpcs:set PSR12.ControlStructures.BooleanOperatorPlacement allowOnly - -match ( - $expr1 - && $expr2 - && $expr3 -) { - // structure body -}; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/BooleanOperatorPlacementUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/BooleanOperatorPlacementUnitTest.php deleted file mode 100644 index 3eeaeeb..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/BooleanOperatorPlacementUnitTest.php +++ /dev/null @@ -1,59 +0,0 @@ - - * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Tests\ControlStructures; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class BooleanOperatorPlacementUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 10 => 1, - 16 => 1, - 28 => 1, - 34 => 1, - 75 => 1, - 81 => 1, - 90 => 1, - 98 => 1, - 104 => 1, - 125 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/ControlStructureSpacingUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/ControlStructureSpacingUnitTest.inc deleted file mode 100644 index 9c037d6..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/ControlStructureSpacingUnitTest.inc +++ /dev/null @@ -1,100 +0,0 @@ - $foo - /* - * A multi-line comment. - */ - && $foo === true - ) { - break; - } - -match ( - $expr1 && - $expr2 && - $expr3 - ) { - // structure body -}; - -match ($expr1 && -$expr2 && - $expr3) { - // structure body -}; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/ControlStructureSpacingUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/ControlStructureSpacingUnitTest.inc.fixed deleted file mode 100644 index 7ea61b1..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/ControlStructureSpacingUnitTest.inc.fixed +++ /dev/null @@ -1,103 +0,0 @@ - $foo - /* - * A multi-line comment. - */ - && $foo === true - ) { - break; - } - -match ( - $expr1 && - $expr2 && - $expr3 -) { - // structure body -}; - -match ( - $expr1 && - $expr2 && - $expr3 -) { - // structure body -}; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/ControlStructureSpacingUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/ControlStructureSpacingUnitTest.php deleted file mode 100644 index 6ee076f..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/ControlStructureSpacingUnitTest.php +++ /dev/null @@ -1,68 +0,0 @@ - - * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Tests\ControlStructures; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ControlStructureSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 2 => 2, - 16 => 1, - 17 => 1, - 18 => 1, - 22 => 1, - 23 => 1, - 32 => 1, - 33 => 1, - 34 => 1, - 37 => 1, - 38 => 1, - 39 => 1, - 48 => 2, - 58 => 1, - 59 => 1, - 92 => 1, - 96 => 1, - 97 => 1, - 98 => 2, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/DeclareStatementUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/DeclareStatementUnitTest.inc deleted file mode 100644 index f21daaf..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/DeclareStatementUnitTest.inc +++ /dev/null @@ -1,50 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Tests\Files; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class DeclareStatementUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 2 => 1, - 3 => 1, - 4 => 1, - 5 => 2, - 6 => 1, - 7 => 1, - 9 => 2, - 10 => 1, - 11 => 3, - 12 => 2, - 13 => 1, - 14 => 2, - 16 => 3, - 19 => 3, - 22 => 1, - 24 => 1, - 26 => 3, - 28 => 3, - 34 => 2, - 43 => 1, - 46 => 1, - 47 => 1, - 49 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.1.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.1.inc deleted file mode 100644 index 1298ed7..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.1.inc +++ /dev/null @@ -1,29 +0,0 @@ - - -

    - - - -

    - - - - -

    Demo

    - - -
  • My page
  • -
  • Write
  • -
  • Sign out
  • - -
  • Sign in
  • - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.15.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.15.inc deleted file mode 100644 index 11102be..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.15.inc +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.16.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.16.inc deleted file mode 100644 index 5c3df1f..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.16.inc +++ /dev/null @@ -1,13 +0,0 @@ - - - * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Tests\Files; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class FileHeaderUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'FileHeaderUnitTest.2.inc': - return [ - 1 => 1, - 6 => 1, - 7 => 1, - 18 => 1, - 20 => 1, - 24 => 1, - ]; - case 'FileHeaderUnitTest.3.inc': - return [ - 9 => 1, - 18 => 1, - ]; - case 'FileHeaderUnitTest.4.inc': - return [ - 1 => 1, - 2 => 1, - 3 => 1, - 7 => 1, - ]; - case 'FileHeaderUnitTest.5.inc': - return [4 => 1]; - case 'FileHeaderUnitTest.7.inc': - case 'FileHeaderUnitTest.10.inc': - case 'FileHeaderUnitTest.11.inc': - return [1 => 1]; - case 'FileHeaderUnitTest.12.inc': - return [4 => 2]; - default: - return []; - }//end switch - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/ImportStatementUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/ImportStatementUnitTest.inc deleted file mode 100644 index 904e3f4..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/ImportStatementUnitTest.inc +++ /dev/null @@ -1,19 +0,0 @@ - - * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Tests\Files; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ImportStatementUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 2 => 1, - 4 => 1, - 7 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/OpenTagUnitTest.1.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/OpenTagUnitTest.1.inc deleted file mode 100644 index 0dbdf01..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/OpenTagUnitTest.1.inc +++ /dev/null @@ -1,3 +0,0 @@ - -hi diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/OpenTagUnitTest.4.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/OpenTagUnitTest.4.inc deleted file mode 100644 index 09be8fb..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/OpenTagUnitTest.4.inc +++ /dev/null @@ -1,2 +0,0 @@ - - - * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Tests\Files; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class OpenTagUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'OpenTagUnitTest.2.inc': - return [1 => 1]; - default: - return []; - }//end switch - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/NullableTypeDeclarationUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/NullableTypeDeclarationUnitTest.inc deleted file mode 100644 index e3a5a77..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/NullableTypeDeclarationUnitTest.inc +++ /dev/null @@ -1,87 +0,0 @@ - - * @copyright 2006-2018 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Tests\Functions; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class NullableTypeDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - protected function getErrorList() - { - return [ - 23 => 1, - 24 => 1, - 25 => 1, - 30 => 1, - 31 => 1, - 32 => 1, - 43 => 2, - 48 => 1, - 50 => 1, - 51 => 1, - 53 => 1, - 57 => 2, - 58 => 2, - 59 => 2, - 87 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - protected function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/ReturnTypeDeclarationUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/ReturnTypeDeclarationUnitTest.inc deleted file mode 100644 index 59ab1aa..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/ReturnTypeDeclarationUnitTest.inc +++ /dev/null @@ -1,66 +0,0 @@ - $arg; - -return (!$a ? [ new class { public function b(): c {} } ] : []); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/ReturnTypeDeclarationUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/ReturnTypeDeclarationUnitTest.inc.fixed deleted file mode 100644 index cd79f78..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/ReturnTypeDeclarationUnitTest.inc.fixed +++ /dev/null @@ -1,62 +0,0 @@ - $arg; - -return (!$a ? [ new class { public function b(): c {} } ] : []); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/ReturnTypeDeclarationUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/ReturnTypeDeclarationUnitTest.php deleted file mode 100644 index fc6b5e1..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/ReturnTypeDeclarationUnitTest.php +++ /dev/null @@ -1,61 +0,0 @@ - - * @copyright 2006-2018 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Tests\Functions; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ReturnTypeDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - protected function getErrorList() - { - return [ - 27 => 1, - 28 => 1, - 35 => 2, - 41 => 2, - 48 => 2, - 52 => 1, - 55 => 1, - 56 => 1, - 59 => 1, - 60 => 1, - 62 => 1, - 64 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - protected function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Keywords/ShortFormTypeKeywordsUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Keywords/ShortFormTypeKeywordsUnitTest.inc deleted file mode 100644 index 6ce930d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Keywords/ShortFormTypeKeywordsUnitTest.inc +++ /dev/null @@ -1,14 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Tests\Keywords; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ShortFormTypeKeywordsUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 3 => 1, - 5 => 1, - 7 => 1, - 13 => 1, - 14 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Namespaces/CompoundNamespaceDepthUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Namespaces/CompoundNamespaceDepthUnitTest.inc deleted file mode 100644 index 3336fc2..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Namespaces/CompoundNamespaceDepthUnitTest.inc +++ /dev/null @@ -1,31 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Tests\Namespaces; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class CompoundNamespaceDepthUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 10 => 1, - 18 => 1, - 21 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Operators/OperatorSpacingUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Operators/OperatorSpacingUnitTest.inc deleted file mode 100644 index c067e6a..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Operators/OperatorSpacingUnitTest.inc +++ /dev/null @@ -1,77 +0,0 @@ - $b) { - $variable =$foo ? 'foo' :'bar'; - $variable.='text'.'text'; -} - -$foo+= $a&$b; -$foo = $a|$b; -$foo =$a^$b; -$foo = ~$a; -$foo *=$a<<$b; -$foo = $a>>$b; - -function foo(&$a,& $b) {} - -$foo = $a and$b; -$foo = $a or $b; -$foo = $a xor$b; -$foo = !$a; -$foo = $a&&$b; -$foo = $a||$b; - -$foo = $a instanceof Foo; -$foo = $a instanceof$b; - -$foo .= 'hi' - .= 'there'; - -$foo .= 'hi' -.= 'there'; - -$foo .= 'hi' // comment -.= 'there'; - -$foo/*comment*/=/*comment*/$a/*comment*/and/*comment*/$b; - -$foo .=//comment -'string' .=/*comment*/ -'string'; - -$foo = $foo ?: 'bar'; -$foo = $foo?:'bar'; - -try { -} catch (ExceptionType1|ExceptionType2 $e) { -} - -if (strpos($tokenContent, 'b"') === 0 && substr($tokenContent, -1) === '"') {} - -$oldConstructorPos = +1; -return -$content; - -function name($a = -1) {} - -$a =& $ref; -$a = [ 'a' => &$something ]; - -$fn = fn(array &$one) => 1; -$fn = fn(array & $one) => 1; - -$fn = static fn(DateTime $a, DateTime $b): int => -($a->getTimestamp() <=> $b->getTimestamp()); - -function issue3267(string|int ...$values) {} - -function setDefault(#[ImportValue( - constraints: [ - [ - Assert\Type::class, - ['type' => 'bool'], - ], - ] - )] ?bool $value = null): void - { - // Do something - } diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Operators/OperatorSpacingUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Operators/OperatorSpacingUnitTest.inc.fixed deleted file mode 100644 index 7676429..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Operators/OperatorSpacingUnitTest.inc.fixed +++ /dev/null @@ -1,77 +0,0 @@ - $b) { - $variable = $foo ? 'foo' : 'bar'; - $variable .= 'text' . 'text'; -} - -$foo += $a & $b; -$foo = $a | $b; -$foo = $a ^ $b; -$foo = ~$a; -$foo *= $a << $b; -$foo = $a >> $b; - -function foo(&$a,& $b) {} - -$foo = $a and $b; -$foo = $a or $b; -$foo = $a xor $b; -$foo = !$a; -$foo = $a && $b; -$foo = $a || $b; - -$foo = $a instanceof Foo; -$foo = $a instanceof $b; - -$foo .= 'hi' - .= 'there'; - -$foo .= 'hi' -.= 'there'; - -$foo .= 'hi' // comment -.= 'there'; - -$foo/*comment*/ = /*comment*/$a/*comment*/ and /*comment*/$b; - -$foo .= //comment -'string' .= /*comment*/ -'string'; - -$foo = $foo ?: 'bar'; -$foo = $foo ?: 'bar'; - -try { -} catch (ExceptionType1 | ExceptionType2 $e) { -} - -if (strpos($tokenContent, 'b"') === 0 && substr($tokenContent, -1) === '"') {} - -$oldConstructorPos = +1; -return -$content; - -function name($a = -1) {} - -$a =& $ref; -$a = [ 'a' => &$something ]; - -$fn = fn(array &$one) => 1; -$fn = fn(array & $one) => 1; - -$fn = static fn(DateTime $a, DateTime $b): int => -($a->getTimestamp() <=> $b->getTimestamp()); - -function issue3267(string|int ...$values) {} - -function setDefault(#[ImportValue( - constraints: [ - [ - Assert\Type::class, - ['type' => 'bool'], - ], - ] - )] ?bool $value = null): void - { - // Do something - } diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Operators/OperatorSpacingUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Operators/OperatorSpacingUnitTest.php deleted file mode 100644 index e23fd96..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Operators/OperatorSpacingUnitTest.php +++ /dev/null @@ -1,69 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Tests\Operators; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class OperatorSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 2 => 1, - 3 => 2, - 4 => 1, - 5 => 2, - 6 => 4, - 9 => 3, - 10 => 2, - 11 => 3, - 13 => 3, - 14 => 2, - 18 => 1, - 20 => 1, - 22 => 2, - 23 => 2, - 26 => 1, - 37 => 4, - 39 => 1, - 40 => 1, - 44 => 2, - 47 => 2, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Properties/ConstantVisibilityUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Properties/ConstantVisibilityUnitTest.inc deleted file mode 100644 index c07b1b9..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Properties/ConstantVisibilityUnitTest.inc +++ /dev/null @@ -1,7 +0,0 @@ - - * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Tests\Properties; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ConstantVisibilityUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return []; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return [4 => 1]; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Traits/UseDeclarationUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Traits/UseDeclarationUnitTest.inc deleted file mode 100644 index e62489f..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Traits/UseDeclarationUnitTest.inc +++ /dev/null @@ -1,209 +0,0 @@ - - * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Tests\Traits; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class UseDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 15 => 1, - 29 => 2, - 30 => 1, - 42 => 1, - 57 => 3, - 59 => 3, - 61 => 1, - 63 => 5, - 65 => 1, - 71 => 1, - 73 => 2, - 76 => 1, - 86 => 2, - 103 => 1, - 112 => 1, - 122 => 1, - 132 => 1, - 157 => 1, - 165 => 1, - 170 => 1, - 208 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/ruleset.xml b/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/ruleset.xml deleted file mode 100644 index ce8b71a..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/ruleset.xml +++ /dev/null @@ -1,347 +0,0 @@ - - - The PSR-12 coding standard. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - - - 0 - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - error - Method name "%s" must not be prefixed with an underscore to indicate visibility - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - - - 0 - - - - - - - - - - - - - - - - - 0 - - - 0 - - - - - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Classes/ClassDeclarationStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Classes/ClassDeclarationStandard.xml deleted file mode 100644 index 4e56bc0..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Classes/ClassDeclarationStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - class Foo -{ -} - ]]> - - - class Foo -{ -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Classes/PropertyDeclarationStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Classes/PropertyDeclarationStandard.xml deleted file mode 100644 index 042c0c6..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Classes/PropertyDeclarationStandard.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - bar; -} - ]]> - - - _bar; -} - ]]> - - - - - private $bar; -} - ]]> - - - var $bar; -} - ]]> - - - - - - - - $bar, $baz; -} - ]]> - - - - - static $bar; - private $baz; -} - ]]> - - - static protected $bar; -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/ControlStructures/ControlStructureSpacingStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/ControlStructures/ControlStructureSpacingStandard.xml deleted file mode 100644 index dcbe98f..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/ControlStructures/ControlStructureSpacingStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - $foo) { - $var = 1; -} - ]]> - - - $foo ) { - $var = 1; -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/ControlStructures/ElseIfDeclarationStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/ControlStructures/ElseIfDeclarationStandard.xml deleted file mode 100644 index a22dd17..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/ControlStructures/ElseIfDeclarationStandard.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - elseif ($bar) { - $var = 2; -} - ]]> - - - else if ($bar) { - $var = 2; -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/ControlStructures/SwitchDeclarationStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/ControlStructures/SwitchDeclarationStandard.xml deleted file mode 100644 index 1d6d053..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/ControlStructures/SwitchDeclarationStandard.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - case 'bar': - break; -} - ]]> - - - case 'bar': - break; -} - ]]> - - - - - 'bar': - break; -} - ]]> - - - 'bar': - break; -} - ]]> - - - - - : - break; - default: - break; -} - ]]> - - - : - break; - default : - break; -} - ]]> - - - - - break; -} - ]]> - - - break; -} - ]]> - - - - - // no break - default: - break; -} - ]]> - - - : - break; -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Files/EndFileNewlineStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Files/EndFileNewlineStandard.xml deleted file mode 100644 index d6d3aad..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Files/EndFileNewlineStandard.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Methods/MethodDeclarationStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Methods/MethodDeclarationStandard.xml deleted file mode 100644 index e45469e..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Methods/MethodDeclarationStandard.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - bar() - { - } -} - ]]> - - - _bar() - { - } -} - ]]> - - - - - final public static function bar() - { - } -} - ]]> - - - static public final function bar() - { - } -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Namespaces/NamespaceDeclarationStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Namespaces/NamespaceDeclarationStandard.xml deleted file mode 100644 index 1f4d389..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Namespaces/NamespaceDeclarationStandard.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - -use \Baz; - ]]> - - - - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Namespaces/UseDeclarationStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Namespaces/UseDeclarationStandard.xml deleted file mode 100644 index 4082603..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Namespaces/UseDeclarationStandard.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - \Foo, \Bar; - ]]> - - - - - - - - - - - - - -class Baz -{ -} - ]]> - - - - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Classes/ClassDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Classes/ClassDeclarationSniff.php deleted file mode 100644 index f96b004..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Classes/ClassDeclarationSniff.php +++ /dev/null @@ -1,528 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\Classes; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Standards\PEAR\Sniffs\Classes\ClassDeclarationSniff as PEARClassDeclarationSniff; -use PHP_CodeSniffer\Util\Tokens; - -class ClassDeclarationSniff extends PEARClassDeclarationSniff -{ - - /** - * The number of spaces code should be indented. - * - * @var integer - */ - public $indent = 4; - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - // We want all the errors from the PEAR standard, plus some of our own. - parent::process($phpcsFile, $stackPtr); - - // Just in case. - $tokens = $phpcsFile->getTokens(); - if (isset($tokens[$stackPtr]['scope_opener']) === false) { - return; - } - - $this->processOpen($phpcsFile, $stackPtr); - $this->processClose($phpcsFile, $stackPtr); - - }//end process() - - - /** - * Processes the opening section of a class declaration. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function processOpen(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $stackPtrType = strtolower($tokens[$stackPtr]['content']); - - // Check alignment of the keyword and braces. - if ($tokens[($stackPtr - 1)]['code'] === T_WHITESPACE) { - $prevContent = $tokens[($stackPtr - 1)]['content']; - if ($prevContent !== $phpcsFile->eolChar) { - $blankSpace = substr($prevContent, strpos($prevContent, $phpcsFile->eolChar)); - $spaces = strlen($blankSpace); - - if (in_array($tokens[($stackPtr - 2)]['code'], [T_ABSTRACT, T_FINAL], true) === true - && $spaces !== 1 - ) { - $prevContent = strtolower($tokens[($stackPtr - 2)]['content']); - $error = 'Expected 1 space between %s and %s keywords; %s found'; - $data = [ - $prevContent, - $stackPtrType, - $spaces, - ]; - - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceBeforeKeyword', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($stackPtr - 1), ' '); - } - } - } else if ($tokens[($stackPtr - 2)]['code'] === T_ABSTRACT - || $tokens[($stackPtr - 2)]['code'] === T_FINAL - ) { - $prevContent = strtolower($tokens[($stackPtr - 2)]['content']); - $error = 'Expected 1 space between %s and %s keywords; newline found'; - $data = [ - $prevContent, - $stackPtrType, - ]; - - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NewlineBeforeKeyword', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($stackPtr - 1), ' '); - } - }//end if - }//end if - - // We'll need the indent of the class/interface declaration for later. - $classIndent = 0; - for ($i = ($stackPtr - 1); $i > 0; $i--) { - if ($tokens[$i]['line'] === $tokens[$stackPtr]['line']) { - continue; - } - - // We changed lines. - if ($tokens[($i + 1)]['code'] === T_WHITESPACE) { - $classIndent = $tokens[($i + 1)]['length']; - } - - break; - } - - $className = null; - $checkSpacing = true; - - if ($tokens[$stackPtr]['code'] !== T_ANON_CLASS) { - $className = $phpcsFile->findNext(T_STRING, $stackPtr); - } else { - // Ignore the spacing check if this is a simple anon class. - $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($next === $tokens[$stackPtr]['scope_opener'] - && $tokens[$next]['line'] > $tokens[$stackPtr]['line'] - ) { - $checkSpacing = false; - } - } - - if ($checkSpacing === true) { - // Spacing of the keyword. - if ($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { - $gap = 0; - } else if ($tokens[($stackPtr + 2)]['line'] !== $tokens[$stackPtr]['line']) { - $gap = 'newline'; - } else { - $gap = $tokens[($stackPtr + 1)]['length']; - } - - if ($gap !== 1) { - $error = 'Expected 1 space after %s keyword; %s found'; - $data = [ - $stackPtrType, - $gap, - ]; - - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterKeyword', $data); - if ($fix === true) { - if ($gap === 0) { - $phpcsFile->fixer->addContent($stackPtr, ' '); - } else { - $phpcsFile->fixer->replaceToken(($stackPtr + 1), ' '); - } - } - } - }//end if - - // Check after the class/interface name. - if ($className !== null - && $tokens[($className + 2)]['line'] === $tokens[$className]['line'] - ) { - $gap = $tokens[($className + 1)]['content']; - if (strlen($gap) !== 1) { - $found = strlen($gap); - $error = 'Expected 1 space after %s name; %s found'; - $data = [ - $stackPtrType, - $found, - ]; - - $fix = $phpcsFile->addFixableError($error, $className, 'SpaceAfterName', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($className + 1), ' '); - } - } - } - - $openingBrace = $tokens[$stackPtr]['scope_opener']; - - // Check positions of the extends and implements keywords. - $compareToken = $stackPtr; - $compareType = 'name'; - if ($tokens[$stackPtr]['code'] === T_ANON_CLASS) { - if (isset($tokens[$stackPtr]['parenthesis_opener']) === true) { - $compareToken = $tokens[$stackPtr]['parenthesis_closer']; - $compareType = 'closing parenthesis'; - } else { - $compareType = 'keyword'; - } - } - - foreach (['extends', 'implements'] as $keywordType) { - $keyword = $phpcsFile->findNext(constant('T_'.strtoupper($keywordType)), ($compareToken + 1), $openingBrace); - if ($keyword !== false) { - if ($tokens[$keyword]['line'] !== $tokens[$compareToken]['line']) { - $error = 'The '.$keywordType.' keyword must be on the same line as the %s '.$compareType; - $data = [$stackPtrType]; - $fix = $phpcsFile->addFixableError($error, $keyword, ucfirst($keywordType).'Line', $data); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $comments = []; - - for ($i = ($compareToken + 1); $i < $keyword; ++$i) { - if ($tokens[$i]['code'] === T_COMMENT) { - $comments[] = trim($tokens[$i]['content']); - } - - if ($tokens[$i]['code'] === T_WHITESPACE - || $tokens[$i]['code'] === T_COMMENT - ) { - $phpcsFile->fixer->replaceToken($i, ' '); - } - } - - $phpcsFile->fixer->addContent($compareToken, ' '); - if (empty($comments) === false) { - $i = $keyword; - while ($tokens[($i + 1)]['line'] === $tokens[$keyword]['line']) { - ++$i; - } - - $phpcsFile->fixer->addContentBefore($i, ' '.implode(' ', $comments)); - } - - $phpcsFile->fixer->endChangeset(); - }//end if - } else { - // Check the whitespace before. Whitespace after is checked - // later by looking at the whitespace before the first class name - // in the list. - $gap = $tokens[($keyword - 1)]['length']; - if ($gap !== 1) { - $error = 'Expected 1 space before '.$keywordType.' keyword; %s found'; - $data = [$gap]; - $fix = $phpcsFile->addFixableError($error, $keyword, 'SpaceBefore'.ucfirst($keywordType), $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($keyword - 1), ' '); - } - } - }//end if - }//end if - }//end foreach - - // Check each of the extends/implements class names. If the extends/implements - // keyword is the last content on the line, it means we need to check for - // the multi-line format, so we do not include the class names - // from the extends/implements list in the following check. - // Note that classes can only extend one other class, so they can't use a - // multi-line extends format, whereas an interface can extend multiple - // other interfaces, and so uses a multi-line extends format. - if ($tokens[$stackPtr]['code'] === T_INTERFACE) { - $keywordTokenType = T_EXTENDS; - } else { - $keywordTokenType = T_IMPLEMENTS; - } - - $implements = $phpcsFile->findNext($keywordTokenType, ($stackPtr + 1), $openingBrace); - $multiLineImplements = false; - if ($implements !== false) { - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($openingBrace - 1), $implements, true); - if ($tokens[$prev]['line'] !== $tokens[$implements]['line']) { - $multiLineImplements = true; - } - } - - $find = [ - T_STRING, - $keywordTokenType, - ]; - - if ($className !== null) { - $start = $className; - } else if (isset($tokens[$stackPtr]['parenthesis_closer']) === true) { - $start = $tokens[$stackPtr]['parenthesis_closer']; - } else { - $start = $stackPtr; - } - - $classNames = []; - $nextClass = $phpcsFile->findNext($find, ($start + 2), ($openingBrace - 1)); - while ($nextClass !== false) { - $classNames[] = $nextClass; - $nextClass = $phpcsFile->findNext($find, ($nextClass + 1), ($openingBrace - 1)); - } - - $classCount = count($classNames); - $checkingImplements = false; - $implementsToken = null; - foreach ($classNames as $n => $className) { - if ($tokens[$className]['code'] === $keywordTokenType) { - $checkingImplements = true; - $implementsToken = $className; - - continue; - } - - if ($checkingImplements === true - && $multiLineImplements === true - && ($tokens[($className - 1)]['code'] !== T_NS_SEPARATOR - || $tokens[($className - 2)]['code'] !== T_STRING) - ) { - $prev = $phpcsFile->findPrevious( - [ - T_NS_SEPARATOR, - T_WHITESPACE, - ], - ($className - 1), - $implements, - true - ); - - if ($prev === $implementsToken && $tokens[$className]['line'] !== ($tokens[$prev]['line'] + 1)) { - if ($keywordTokenType === T_EXTENDS) { - $error = 'The first item in a multi-line extends list must be on the line following the extends keyword'; - $fix = $phpcsFile->addFixableError($error, $className, 'FirstExtendsInterfaceSameLine'); - } else { - $error = 'The first item in a multi-line implements list must be on the line following the implements keyword'; - $fix = $phpcsFile->addFixableError($error, $className, 'FirstInterfaceSameLine'); - } - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($prev + 1); $i < $className; $i++) { - if ($tokens[$i]['code'] !== T_WHITESPACE) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->addNewline($prev); - $phpcsFile->fixer->endChangeset(); - } - } else if ($tokens[$prev]['line'] !== ($tokens[$className]['line'] - 1)) { - if ($keywordTokenType === T_EXTENDS) { - $error = 'Only one interface may be specified per line in a multi-line extends declaration'; - $fix = $phpcsFile->addFixableError($error, $className, 'ExtendsInterfaceSameLine'); - } else { - $error = 'Only one interface may be specified per line in a multi-line implements declaration'; - $fix = $phpcsFile->addFixableError($error, $className, 'InterfaceSameLine'); - } - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($prev + 1); $i < $className; $i++) { - if ($tokens[$i]['code'] !== T_WHITESPACE) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->addNewline($prev); - $phpcsFile->fixer->endChangeset(); - } - } else { - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($className - 1), $implements); - if ($tokens[$prev]['line'] !== $tokens[$className]['line']) { - $found = 0; - } else { - $found = $tokens[$prev]['length']; - } - - $expected = ($classIndent + $this->indent); - if ($found !== $expected) { - $error = 'Expected %s spaces before interface name; %s found'; - $data = [ - $expected, - $found, - ]; - $fix = $phpcsFile->addFixableError($error, $className, 'InterfaceWrongIndent', $data); - if ($fix === true) { - $padding = str_repeat(' ', $expected); - if ($found === 0) { - $phpcsFile->fixer->addContent($prev, $padding); - } else { - $phpcsFile->fixer->replaceToken($prev, $padding); - } - } - } - }//end if - } else if ($tokens[($className - 1)]['code'] !== T_NS_SEPARATOR - || $tokens[($className - 2)]['code'] !== T_STRING - ) { - // Not part of a longer fully qualified class name. - if ($tokens[($className - 1)]['code'] === T_COMMA - || ($tokens[($className - 1)]['code'] === T_NS_SEPARATOR - && $tokens[($className - 2)]['code'] === T_COMMA) - ) { - $error = 'Expected 1 space before "%s"; 0 found'; - $data = [$tokens[$className]['content']]; - $fix = $phpcsFile->addFixableError($error, ($nextComma + 1), 'NoSpaceBeforeName', $data); - if ($fix === true) { - $phpcsFile->fixer->addContentBefore(($nextComma + 1), ' '); - } - } else { - if ($tokens[($className - 1)]['code'] === T_NS_SEPARATOR) { - $prev = ($className - 2); - } else { - $prev = ($className - 1); - } - - $last = $phpcsFile->findPrevious(T_WHITESPACE, $prev, null, true); - $content = $phpcsFile->getTokensAsString(($last + 1), ($prev - $last)); - if ($content !== ' ') { - $found = strlen($content); - - $error = 'Expected 1 space before "%s"; %s found'; - $data = [ - $tokens[$className]['content'], - $found, - ]; - - $fix = $phpcsFile->addFixableError($error, $className, 'SpaceBeforeName', $data); - if ($fix === true) { - if ($tokens[$prev]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($prev, ' '); - while ($tokens[--$prev]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->replaceToken($prev, ' '); - } - - $phpcsFile->fixer->endChangeset(); - } else { - $phpcsFile->fixer->addContent($prev, ' '); - } - } - }//end if - }//end if - }//end if - - if ($checkingImplements === true - && $tokens[($className + 1)]['code'] !== T_NS_SEPARATOR - && $tokens[($className + 1)]['code'] !== T_COMMA - ) { - if ($n !== ($classCount - 1)) { - // This is not the last class name, and the comma - // is not where we expect it to be. - if ($tokens[($className + 2)]['code'] !== $keywordTokenType) { - $error = 'Expected 0 spaces between "%s" and comma; %s found'; - $data = [ - $tokens[$className]['content'], - $tokens[($className + 1)]['length'], - ]; - - $fix = $phpcsFile->addFixableError($error, $className, 'SpaceBeforeComma', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($className + 1), ''); - } - } - } - - $nextComma = $phpcsFile->findNext(T_COMMA, $className); - } else { - $nextComma = ($className + 1); - }//end if - }//end foreach - - }//end processOpen() - - - /** - * Processes the closing section of a class declaration. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function processClose(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Check that the closing brace comes right after the code body. - $closeBrace = $tokens[$stackPtr]['scope_closer']; - $prevContent = $phpcsFile->findPrevious(T_WHITESPACE, ($closeBrace - 1), null, true); - if ($prevContent !== $tokens[$stackPtr]['scope_opener'] - && $tokens[$prevContent]['line'] !== ($tokens[$closeBrace]['line'] - 1) - ) { - $error = 'The closing brace for the %s must go on the next line after the body'; - $data = [$tokens[$stackPtr]['content']]; - $fix = $phpcsFile->addFixableError($error, $closeBrace, 'CloseBraceAfterBody', $data); - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($prevContent + 1); $i < $closeBrace; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - if (strpos($tokens[$prevContent]['content'], $phpcsFile->eolChar) === false) { - $phpcsFile->fixer->replaceToken($closeBrace, $phpcsFile->eolChar.$tokens[$closeBrace]['content']); - } - - $phpcsFile->fixer->endChangeset(); - } - }//end if - - if ($tokens[$stackPtr]['code'] !== T_ANON_CLASS) { - // Check the closing brace is on it's own line, but allow - // for comments like "//end class". - $ignoreTokens = Tokens::$phpcsCommentTokens; - $ignoreTokens[] = T_WHITESPACE; - $ignoreTokens[] = T_COMMENT; - $ignoreTokens[] = T_SEMICOLON; - $ignoreTokens[] = T_COMMA; - $nextContent = $phpcsFile->findNext($ignoreTokens, ($closeBrace + 1), null, true); - if ($tokens[$nextContent]['content'] !== $phpcsFile->eolChar - && $tokens[$nextContent]['line'] === $tokens[$closeBrace]['line'] - ) { - $type = strtolower($tokens[$stackPtr]['content']); - $error = 'Closing %s brace must be on a line by itself'; - $data = [$type]; - $phpcsFile->addError($error, $closeBrace, 'CloseBraceSameLine', $data); - } - } - - }//end processClose() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Classes/PropertyDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Classes/PropertyDeclarationSniff.php deleted file mode 100644 index 8a158d9..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Classes/PropertyDeclarationSniff.php +++ /dev/null @@ -1,184 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\Classes; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\AbstractVariableSniff; -use PHP_CodeSniffer\Util\Tokens; - -class PropertyDeclarationSniff extends AbstractVariableSniff -{ - - - /** - * Processes the function tokens within the class. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position where the token was found. - * - * @return void - */ - protected function processMemberVar(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if ($tokens[$stackPtr]['content'][1] === '_') { - $error = 'Property name "%s" should not be prefixed with an underscore to indicate visibility'; - $data = [$tokens[$stackPtr]['content']]; - $phpcsFile->addWarning($error, $stackPtr, 'Underscore', $data); - } - - // Detect multiple properties defined at the same time. Throw an error - // for this, but also only process the first property in the list so we don't - // repeat errors. - $find = Tokens::$scopeModifiers; - $find[] = T_VARIABLE; - $find[] = T_VAR; - $find[] = T_SEMICOLON; - $find[] = T_OPEN_CURLY_BRACKET; - - $prev = $phpcsFile->findPrevious($find, ($stackPtr - 1)); - if ($tokens[$prev]['code'] === T_VARIABLE) { - return; - } - - if ($tokens[$prev]['code'] === T_VAR) { - $error = 'The var keyword must not be used to declare a property'; - $phpcsFile->addError($error, $stackPtr, 'VarUsed'); - } - - $next = $phpcsFile->findNext([T_VARIABLE, T_SEMICOLON], ($stackPtr + 1)); - if ($next !== false && $tokens[$next]['code'] === T_VARIABLE) { - $error = 'There must not be more than one property declared per statement'; - $phpcsFile->addError($error, $stackPtr, 'Multiple'); - } - - try { - $propertyInfo = $phpcsFile->getMemberProperties($stackPtr); - if (empty($propertyInfo) === true) { - return; - } - } catch (\Exception $e) { - // Turns out not to be a property after all. - return; - } - - if ($propertyInfo['type'] !== '') { - $typeToken = $propertyInfo['type_end_token']; - $error = 'There must be 1 space after the property type declaration; %s found'; - if ($tokens[($typeToken + 1)]['code'] !== T_WHITESPACE) { - $data = ['0']; - $fix = $phpcsFile->addFixableError($error, $typeToken, 'SpacingAfterType', $data); - if ($fix === true) { - $phpcsFile->fixer->addContent($typeToken, ' '); - } - } else if ($tokens[($typeToken + 1)]['content'] !== ' ') { - $next = $phpcsFile->findNext(T_WHITESPACE, ($typeToken + 1), null, true); - if ($tokens[$next]['line'] !== $tokens[$typeToken]['line']) { - $found = 'newline'; - } else { - $found = $tokens[($typeToken + 1)]['length']; - } - - $data = [$found]; - - $nextNonWs = $phpcsFile->findNext(Tokens::$emptyTokens, ($typeToken + 1), null, true); - if ($nextNonWs !== $next) { - $phpcsFile->addError($error, $typeToken, 'SpacingAfterType', $data); - } else { - $fix = $phpcsFile->addFixableError($error, $typeToken, 'SpacingAfterType', $data); - if ($fix === true) { - if ($found === 'newline') { - $phpcsFile->fixer->beginChangeset(); - for ($x = ($typeToken + 1); $x < $next; $x++) { - $phpcsFile->fixer->replaceToken($x, ''); - } - - $phpcsFile->fixer->addContent($typeToken, ' '); - $phpcsFile->fixer->endChangeset(); - } else { - $phpcsFile->fixer->replaceToken(($typeToken + 1), ' '); - } - } - } - }//end if - }//end if - - if ($propertyInfo['scope_specified'] === false) { - $error = 'Visibility must be declared on property "%s"'; - $data = [$tokens[$stackPtr]['content']]; - $phpcsFile->addError($error, $stackPtr, 'ScopeMissing', $data); - } - - if ($propertyInfo['scope_specified'] === true && $propertyInfo['is_static'] === true) { - $scopePtr = $phpcsFile->findPrevious(Tokens::$scopeModifiers, ($stackPtr - 1)); - $staticPtr = $phpcsFile->findPrevious(T_STATIC, ($stackPtr - 1)); - if ($scopePtr < $staticPtr) { - return; - } - - $error = 'The static declaration must come after the visibility declaration'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'StaticBeforeVisibility'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - - for ($i = ($scopePtr + 1); $scopePtr < $stackPtr; $i++) { - if ($tokens[$i]['code'] !== T_WHITESPACE) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->replaceToken($scopePtr, ''); - $phpcsFile->fixer->addContentBefore($staticPtr, $propertyInfo['scope'].' '); - - $phpcsFile->fixer->endChangeset(); - } - }//end if - - }//end processMemberVar() - - - /** - * Processes normal variables. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position where the token was found. - * - * @return void - */ - protected function processVariable(File $phpcsFile, $stackPtr) - { - /* - We don't care about normal variables. - */ - - }//end processVariable() - - - /** - * Processes variables in double quoted strings. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position where the token was found. - * - * @return void - */ - protected function processVariableInString(File $phpcsFile, $stackPtr) - { - /* - We don't care about normal variables. - */ - - }//end processVariableInString() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/ControlStructureSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/ControlStructureSpacingSniff.php deleted file mode 100644 index 09d2c14..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/ControlStructureSpacingSniff.php +++ /dev/null @@ -1,142 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\ControlStructures; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class ControlStructureSpacingSniff implements Sniff -{ - - /** - * How many spaces should follow the opening bracket. - * - * @var integer - */ - public $requiredSpacesAfterOpen = 0; - - /** - * How many spaces should precede the closing bracket. - * - * @var integer - */ - public $requiredSpacesBeforeClose = 0; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_IF, - T_WHILE, - T_FOREACH, - T_FOR, - T_SWITCH, - T_ELSE, - T_ELSEIF, - T_CATCH, - T_MATCH, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $this->requiredSpacesAfterOpen = (int) $this->requiredSpacesAfterOpen; - $this->requiredSpacesBeforeClose = (int) $this->requiredSpacesBeforeClose; - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]['parenthesis_opener']) === false - || isset($tokens[$stackPtr]['parenthesis_closer']) === false - ) { - return; - } - - $parenOpener = $tokens[$stackPtr]['parenthesis_opener']; - $parenCloser = $tokens[$stackPtr]['parenthesis_closer']; - $nextContent = $phpcsFile->findNext(T_WHITESPACE, ($parenOpener + 1), null, true); - if (in_array($tokens[$nextContent]['code'], Tokens::$commentTokens, true) === false) { - $spaceAfterOpen = 0; - if ($tokens[($parenOpener + 1)]['code'] === T_WHITESPACE) { - if (strpos($tokens[($parenOpener + 1)]['content'], $phpcsFile->eolChar) !== false) { - $spaceAfterOpen = 'newline'; - } else { - $spaceAfterOpen = $tokens[($parenOpener + 1)]['length']; - } - } - - $phpcsFile->recordMetric($stackPtr, 'Spaces after control structure open parenthesis', $spaceAfterOpen); - - if ($spaceAfterOpen !== $this->requiredSpacesAfterOpen) { - $error = 'Expected %s spaces after opening bracket; %s found'; - $data = [ - $this->requiredSpacesAfterOpen, - $spaceAfterOpen, - ]; - $fix = $phpcsFile->addFixableError($error, ($parenOpener + 1), 'SpacingAfterOpenBrace', $data); - if ($fix === true) { - $padding = str_repeat(' ', $this->requiredSpacesAfterOpen); - if ($spaceAfterOpen === 0) { - $phpcsFile->fixer->addContent($parenOpener, $padding); - } else if ($spaceAfterOpen === 'newline') { - $phpcsFile->fixer->replaceToken(($parenOpener + 1), ''); - } else { - $phpcsFile->fixer->replaceToken(($parenOpener + 1), $padding); - } - } - } - }//end if - - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($parenCloser - 1), $parenOpener, true); - if ($tokens[$prev]['line'] === $tokens[$parenCloser]['line']) { - $spaceBeforeClose = 0; - if ($tokens[($parenCloser - 1)]['code'] === T_WHITESPACE) { - $spaceBeforeClose = strlen(ltrim($tokens[($parenCloser - 1)]['content'], $phpcsFile->eolChar)); - } - - $phpcsFile->recordMetric($stackPtr, 'Spaces before control structure close parenthesis', $spaceBeforeClose); - - if ($spaceBeforeClose !== $this->requiredSpacesBeforeClose) { - $error = 'Expected %s spaces before closing bracket; %s found'; - $data = [ - $this->requiredSpacesBeforeClose, - $spaceBeforeClose, - ]; - $fix = $phpcsFile->addFixableError($error, ($parenCloser - 1), 'SpaceBeforeCloseBrace', $data); - if ($fix === true) { - $padding = str_repeat(' ', $this->requiredSpacesBeforeClose); - if ($spaceBeforeClose === 0) { - $phpcsFile->fixer->addContentBefore($parenCloser, $padding); - } else { - $phpcsFile->fixer->replaceToken(($parenCloser - 1), $padding); - } - } - } - }//end if - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/ElseIfDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/ElseIfDeclarationSniff.php deleted file mode 100644 index 9f97684..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/ElseIfDeclarationSniff.php +++ /dev/null @@ -1,72 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\ControlStructures; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class ElseIfDeclarationSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_ELSE, - T_ELSEIF, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if ($tokens[$stackPtr]['code'] === T_ELSEIF) { - $phpcsFile->recordMetric($stackPtr, 'Use of ELSE IF or ELSEIF', 'elseif'); - return; - } - - $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($tokens[$next]['code'] === T_IF) { - $phpcsFile->recordMetric($stackPtr, 'Use of ELSE IF or ELSEIF', 'else if'); - $error = 'Usage of ELSE IF is discouraged; use ELSEIF instead'; - $fix = $phpcsFile->addFixableWarning($error, $stackPtr, 'NotAllowed'); - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($stackPtr, 'elseif'); - for ($i = ($stackPtr + 1); $i <= $next; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/SwitchDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/SwitchDeclarationSniff.php deleted file mode 100644 index e36b134..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/SwitchDeclarationSniff.php +++ /dev/null @@ -1,396 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\ControlStructures; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class SwitchDeclarationSniff implements Sniff -{ - - /** - * The number of spaces code should be indented. - * - * @var integer - */ - public $indent = 4; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_SWITCH]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // We can't process SWITCH statements unless we know where they start and end. - if (isset($tokens[$stackPtr]['scope_opener']) === false - || isset($tokens[$stackPtr]['scope_closer']) === false - ) { - return; - } - - $switch = $tokens[$stackPtr]; - $nextCase = $stackPtr; - $caseAlignment = ($switch['column'] + $this->indent); - - while (($nextCase = $this->findNextCase($phpcsFile, ($nextCase + 1), $switch['scope_closer'])) !== false) { - if ($tokens[$nextCase]['code'] === T_DEFAULT) { - $type = 'default'; - } else { - $type = 'case'; - } - - if ($tokens[$nextCase]['content'] !== strtolower($tokens[$nextCase]['content'])) { - $expected = strtolower($tokens[$nextCase]['content']); - $error = strtoupper($type).' keyword must be lowercase; expected "%s" but found "%s"'; - $data = [ - $expected, - $tokens[$nextCase]['content'], - ]; - - $fix = $phpcsFile->addFixableError($error, $nextCase, $type.'NotLower', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($nextCase, $expected); - } - } - - if ($type === 'case' - && ($tokens[($nextCase + 1)]['code'] !== T_WHITESPACE - || $tokens[($nextCase + 1)]['content'] !== ' ') - ) { - $error = 'CASE keyword must be followed by a single space'; - $fix = $phpcsFile->addFixableError($error, $nextCase, 'SpacingAfterCase'); - if ($fix === true) { - if ($tokens[($nextCase + 1)]['code'] !== T_WHITESPACE) { - $phpcsFile->fixer->addContent($nextCase, ' '); - } else { - $phpcsFile->fixer->replaceToken(($nextCase + 1), ' '); - } - } - } - - $opener = $tokens[$nextCase]['scope_opener']; - $nextCloser = $tokens[$nextCase]['scope_closer']; - if ($tokens[$opener]['code'] === T_COLON) { - if ($tokens[($opener - 1)]['code'] === T_WHITESPACE) { - $error = 'There must be no space before the colon in a '.strtoupper($type).' statement'; - $fix = $phpcsFile->addFixableError($error, $nextCase, 'SpaceBeforeColon'.strtoupper($type)); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($opener - 1), ''); - } - } - - for ($next = ($opener + 1); $next < $nextCloser; $next++) { - if (isset(Tokens::$emptyTokens[$tokens[$next]['code']]) === false - || (isset(Tokens::$commentTokens[$tokens[$next]['code']]) === true - && $tokens[$next]['line'] !== $tokens[$opener]['line']) - ) { - break; - } - } - - if ($tokens[$next]['line'] !== ($tokens[$opener]['line'] + 1)) { - $error = 'The '.strtoupper($type).' body must start on the line following the statement'; - $fix = $phpcsFile->addFixableError($error, $nextCase, 'BodyOnNextLine'.strtoupper($type)); - if ($fix === true) { - if ($tokens[$next]['line'] === $tokens[$opener]['line']) { - $padding = str_repeat(' ', ($caseAlignment + $this->indent - 1)); - $phpcsFile->fixer->addContentBefore($next, $phpcsFile->eolChar.$padding); - } else { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($opener + 1); $i < $next; $i++) { - if ($tokens[$i]['line'] === $tokens[$opener]['line']) { - // Ignore trailing comments. - continue; - } - - if ($tokens[$i]['line'] === $tokens[$next]['line']) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - }//end if - }//end if - - if ($tokens[$nextCloser]['scope_condition'] === $nextCase) { - // Only need to check some things once, even if the - // closer is shared between multiple case statements, or even - // the default case. - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($nextCloser - 1), $nextCase, true); - if ($tokens[$prev]['line'] === $tokens[$nextCloser]['line']) { - $error = 'Terminating statement must be on a line by itself'; - $fix = $phpcsFile->addFixableError($error, $nextCloser, 'BreakNotNewLine'); - if ($fix === true) { - $phpcsFile->fixer->addNewLine($prev); - $phpcsFile->fixer->replaceToken($nextCloser, trim($tokens[$nextCloser]['content'])); - } - } else { - $diff = ($tokens[$nextCase]['column'] + $this->indent - $tokens[$nextCloser]['column']); - if ($diff !== 0) { - $error = 'Terminating statement must be indented to the same level as the CASE body'; - $fix = $phpcsFile->addFixableError($error, $nextCloser, 'BreakIndent'); - if ($fix === true) { - if ($diff > 0) { - $phpcsFile->fixer->addContentBefore($nextCloser, str_repeat(' ', $diff)); - } else { - $phpcsFile->fixer->substrToken(($nextCloser - 1), 0, $diff); - } - } - } - }//end if - }//end if - } else { - $error = strtoupper($type).' statements must be defined using a colon'; - $phpcsFile->addError($error, $nextCase, 'WrongOpener'.$type); - }//end if - - // We only want cases from here on in. - if ($type !== 'case') { - continue; - } - - $nextCode = $phpcsFile->findNext(T_WHITESPACE, ($opener + 1), $nextCloser, true); - - if ($tokens[$nextCode]['code'] !== T_CASE && $tokens[$nextCode]['code'] !== T_DEFAULT) { - // This case statement has content. If the next case or default comes - // before the closer, it means we don't have an obvious terminating - // statement and need to make some more effort to find one. If we - // don't, we do need a comment. - $nextCode = $this->findNextCase($phpcsFile, ($opener + 1), $nextCloser); - if ($nextCode !== false) { - $prevCode = $phpcsFile->findPrevious(T_WHITESPACE, ($nextCode - 1), $nextCase, true); - if (isset(Tokens::$commentTokens[$tokens[$prevCode]['code']]) === false - && $this->findNestedTerminator($phpcsFile, ($opener + 1), $nextCode) === false - ) { - $error = 'There must be a comment when fall-through is intentional in a non-empty case body'; - $phpcsFile->addError($error, $nextCase, 'TerminatingComment'); - } - } - } - }//end while - - }//end process() - - - /** - * Find the next CASE or DEFAULT statement from a point in the file. - * - * Note that nested switches are ignored. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position to start looking at. - * @param int $end The position to stop looking at. - * - * @return int|false - */ - private function findNextCase($phpcsFile, $stackPtr, $end) - { - $tokens = $phpcsFile->getTokens(); - while (($stackPtr = $phpcsFile->findNext([T_CASE, T_DEFAULT, T_SWITCH], $stackPtr, $end)) !== false) { - // Skip nested SWITCH statements; they are handled on their own. - if ($tokens[$stackPtr]['code'] === T_SWITCH) { - $stackPtr = $tokens[$stackPtr]['scope_closer']; - continue; - } - - break; - } - - return $stackPtr; - - }//end findNextCase() - - - /** - * Returns the position of the nested terminating statement. - * - * Returns false if no terminating statement was found. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position to start looking at. - * @param int $end The position to stop looking at. - * - * @return int|false - */ - private function findNestedTerminator($phpcsFile, $stackPtr, $end) - { - $tokens = $phpcsFile->getTokens(); - - $lastToken = $phpcsFile->findPrevious(T_WHITESPACE, ($end - 1), $stackPtr, true); - if ($lastToken === false) { - return false; - } - - if ($tokens[$lastToken]['code'] === T_CLOSE_CURLY_BRACKET) { - // We found a closing curly bracket and want to check if its block - // belongs to a SWITCH, IF, ELSEIF or ELSE, TRY, CATCH OR FINALLY clause. - // If yes, we continue searching for a terminating statement within that - // block. Note that we have to make sure that every block of - // the entire if/else/switch statement has a terminating statement. - // For a try/catch/finally statement, either the finally block has - // to have a terminating statement or every try/catch block has to have one. - $currentCloser = $lastToken; - $hasElseBlock = false; - $hasCatchWithoutTerminator = false; - do { - $scopeOpener = $tokens[$currentCloser]['scope_opener']; - $scopeCloser = $tokens[$currentCloser]['scope_closer']; - - $prevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($scopeOpener - 1), $stackPtr, true); - if ($prevToken === false) { - return false; - } - - // SWITCH, IF, ELSEIF, CATCH clauses possess a condition we have to account for. - if ($tokens[$prevToken]['code'] === T_CLOSE_PARENTHESIS) { - $prevToken = $tokens[$prevToken]['parenthesis_owner']; - } - - if ($tokens[$prevToken]['code'] === T_IF) { - // If we have not encountered an ELSE clause by now, we cannot - // be sure that the whole statement terminates in every case. - if ($hasElseBlock === false) { - return false; - } - - return $this->findNestedTerminator($phpcsFile, ($scopeOpener + 1), $scopeCloser); - } else if ($tokens[$prevToken]['code'] === T_ELSEIF - || $tokens[$prevToken]['code'] === T_ELSE - ) { - // If we find a terminating statement within this block, - // we continue with the previous ELSEIF or IF clause. - $hasTerminator = $this->findNestedTerminator($phpcsFile, ($scopeOpener + 1), $scopeCloser); - if ($hasTerminator === false) { - return false; - } - - $currentCloser = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prevToken - 1), $stackPtr, true); - if ($tokens[$prevToken]['code'] === T_ELSE) { - $hasElseBlock = true; - } - } else if ($tokens[$prevToken]['code'] === T_FINALLY) { - // If we find a terminating statement within this block, - // the whole try/catch/finally statement is covered. - $hasTerminator = $this->findNestedTerminator($phpcsFile, ($scopeOpener + 1), $scopeCloser); - if ($hasTerminator !== false) { - return $hasTerminator; - } - - // Otherwise, we continue with the previous TRY or CATCH clause. - $currentCloser = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prevToken - 1), $stackPtr, true); - } else if ($tokens[$prevToken]['code'] === T_TRY) { - // If we've seen CATCH blocks without terminator statement and - // have not seen a FINALLY *with* a terminator statement, we - // don't even need to bother checking the TRY. - if ($hasCatchWithoutTerminator === true) { - return false; - } - - return $this->findNestedTerminator($phpcsFile, ($scopeOpener + 1), $scopeCloser); - } else if ($tokens[$prevToken]['code'] === T_CATCH) { - // Keep track of seen catch statements without terminating statement, - // but don't bow out yet as there may still be a FINALLY clause - // with a terminating statement before the CATCH. - $hasTerminator = $this->findNestedTerminator($phpcsFile, ($scopeOpener + 1), $scopeCloser); - if ($hasTerminator === false) { - $hasCatchWithoutTerminator = true; - } - - $currentCloser = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prevToken - 1), $stackPtr, true); - } else if ($tokens[$prevToken]['code'] === T_SWITCH) { - $hasDefaultBlock = false; - $endOfSwitch = $tokens[$prevToken]['scope_closer']; - $nextCase = $prevToken; - - // We look for a terminating statement within every blocks. - while (($nextCase = $this->findNextCase($phpcsFile, ($nextCase + 1), $endOfSwitch)) !== false) { - if ($tokens[$nextCase]['code'] === T_DEFAULT) { - $hasDefaultBlock = true; - } - - $opener = $tokens[$nextCase]['scope_opener']; - - $nextCode = $phpcsFile->findNext(Tokens::$emptyTokens, ($opener + 1), $endOfSwitch, true); - if ($tokens[$nextCode]['code'] === T_CASE || $tokens[$nextCode]['code'] === T_DEFAULT) { - // This case statement has no content, so skip it. - continue; - } - - $endOfCase = $this->findNextCase($phpcsFile, ($opener + 1), $endOfSwitch); - if ($endOfCase === false) { - $endOfCase = $endOfSwitch; - } - - $hasTerminator = $this->findNestedTerminator($phpcsFile, ($opener + 1), $endOfCase); - if ($hasTerminator === false) { - return false; - } - }//end while - - // If we have not encountered a DEFAULT block by now, we cannot - // be sure that the whole statement terminates in every case. - if ($hasDefaultBlock === false) { - return false; - } - - return $hasTerminator; - } else { - return false; - }//end if - } while ($currentCloser !== false && $tokens[$currentCloser]['code'] === T_CLOSE_CURLY_BRACKET); - - return true; - } else if ($tokens[$lastToken]['code'] === T_SEMICOLON) { - // We found the last statement of the CASE. Now we want to - // check whether it is a terminating one. - $terminators = [ - T_RETURN => T_RETURN, - T_BREAK => T_BREAK, - T_CONTINUE => T_CONTINUE, - T_THROW => T_THROW, - T_EXIT => T_EXIT, - ]; - - $terminator = $phpcsFile->findStartOfStatement(($lastToken - 1)); - if (isset($terminators[$tokens[$terminator]['code']]) === true) { - return $terminator; - } - }//end if - - return false; - - }//end findNestedTerminator() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Files/ClosingTagSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Files/ClosingTagSniff.php deleted file mode 100644 index 39834b3..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Files/ClosingTagSniff.php +++ /dev/null @@ -1,89 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\Files; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class ClosingTagSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_OPEN_TAG]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return int - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Make sure this file only contains PHP code. - for ($i = 0; $i < $phpcsFile->numTokens; $i++) { - if ($tokens[$i]['code'] === T_INLINE_HTML - && trim($tokens[$i]['content']) !== '' - ) { - return $phpcsFile->numTokens; - } - } - - // Find the last non-empty token. - for ($last = ($phpcsFile->numTokens - 1); $last > 0; $last--) { - if (trim($tokens[$last]['content']) !== '') { - break; - } - } - - if ($tokens[$last]['code'] === T_CLOSE_TAG) { - $error = 'A closing tag is not permitted at the end of a PHP file'; - $fix = $phpcsFile->addFixableError($error, $last, 'NotAllowed'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($last, $phpcsFile->eolChar); - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($last - 1), null, true); - if ($tokens[$prev]['code'] !== T_SEMICOLON - && $tokens[$prev]['code'] !== T_CLOSE_CURLY_BRACKET - && $tokens[$prev]['code'] !== T_OPEN_TAG - ) { - $phpcsFile->fixer->addContent($prev, ';'); - } - - $phpcsFile->fixer->endChangeset(); - } - - $phpcsFile->recordMetric($stackPtr, 'PHP closing tag at end of PHP-only file', 'yes'); - } else { - $phpcsFile->recordMetric($stackPtr, 'PHP closing tag at end of PHP-only file', 'no'); - }//end if - - // Ignore the rest of the file. - return $phpcsFile->numTokens; - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Files/EndFileNewlineSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Files/EndFileNewlineSniff.php deleted file mode 100644 index aed461f..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Files/EndFileNewlineSniff.php +++ /dev/null @@ -1,107 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\Files; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class EndFileNewlineSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_OPEN_TAG, - T_OPEN_TAG_WITH_ECHO, - ]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - if ($phpcsFile->findNext(T_INLINE_HTML, ($stackPtr + 1)) !== false) { - return ($phpcsFile->numTokens + 1); - } - - // Skip to the end of the file. - $tokens = $phpcsFile->getTokens(); - $lastToken = ($phpcsFile->numTokens - 1); - - if ($tokens[$lastToken]['content'] === '') { - $lastToken--; - } - - // Hard-coding the expected \n in this sniff as it is PSR-2 specific and - // PSR-2 enforces the use of unix style newlines. - if (substr($tokens[$lastToken]['content'], -1) !== "\n") { - $error = 'Expected 1 newline at end of file; 0 found'; - $fix = $phpcsFile->addFixableError($error, $lastToken, 'NoneFound'); - if ($fix === true) { - $phpcsFile->fixer->addNewline($lastToken); - } - - $phpcsFile->recordMetric($stackPtr, 'Number of newlines at EOF', '0'); - return ($phpcsFile->numTokens + 1); - } - - // Go looking for the last non-empty line. - $lastLine = $tokens[$lastToken]['line']; - if ($tokens[$lastToken]['code'] === T_WHITESPACE - || $tokens[$lastToken]['code'] === T_DOC_COMMENT_WHITESPACE - ) { - $lastCode = $phpcsFile->findPrevious([T_WHITESPACE, T_DOC_COMMENT_WHITESPACE], ($lastToken - 1), null, true); - } else { - $lastCode = $lastToken; - } - - $lastCodeLine = $tokens[$lastCode]['line']; - $blankLines = ($lastLine - $lastCodeLine + 1); - $phpcsFile->recordMetric($stackPtr, 'Number of newlines at EOF', $blankLines); - - if ($blankLines > 1) { - $error = 'Expected 1 blank line at end of file; %s found'; - $data = [$blankLines]; - $fix = $phpcsFile->addFixableError($error, $lastCode, 'TooMany', $data); - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($lastCode, rtrim($tokens[$lastCode]['content'])); - for ($i = ($lastCode + 1); $i < $lastToken; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->replaceToken($lastToken, $phpcsFile->eolChar); - $phpcsFile->fixer->endChangeset(); - } - } - - // Skip the rest of the file. - return ($phpcsFile->numTokens + 1); - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/FunctionCallSignatureSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/FunctionCallSignatureSniff.php deleted file mode 100644 index 406f279..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/FunctionCallSignatureSniff.php +++ /dev/null @@ -1,79 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions\FunctionCallSignatureSniff as PEARFunctionCallSignatureSniff; -use PHP_CodeSniffer\Util\Tokens; - -class FunctionCallSignatureSniff extends PEARFunctionCallSignatureSniff -{ - - /** - * If TRUE, multiple arguments can be defined per line in a multi-line call. - * - * @var boolean - */ - public $allowMultipleArguments = false; - - - /** - * Processes single-line calls. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * @param int $openBracket The position of the opening bracket - * in the stack passed in $tokens. - * @param array $tokens The stack of tokens that make up - * the file. - * - * @return void - */ - public function isMultiLineCall(File $phpcsFile, $stackPtr, $openBracket, $tokens) - { - // If the first argument is on a new line, this is a multi-line - // function call, even if there is only one argument. - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($openBracket + 1), null, true); - if ($tokens[$next]['line'] !== $tokens[$stackPtr]['line']) { - return true; - } - - $closeBracket = $tokens[$openBracket]['parenthesis_closer']; - - $end = $phpcsFile->findEndOfStatement(($openBracket + 1), [T_COLON]); - while ($tokens[$end]['code'] === T_COMMA) { - // If the next bit of code is not on the same line, this is a - // multi-line function call. - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($end + 1), $closeBracket, true); - if ($next === false) { - return false; - } - - if ($tokens[$next]['line'] !== $tokens[$end]['line']) { - return true; - } - - $end = $phpcsFile->findEndOfStatement($next, [T_COLON]); - } - - // We've reached the last argument, so see if the next content - // (should be the close bracket) is also on the same line. - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($end + 1), $closeBracket, true); - if ($next !== false && $tokens[$next]['line'] !== $tokens[$end]['line']) { - return true; - } - - return false; - - }//end isMultiLineCall() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/FunctionClosingBraceSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/FunctionClosingBraceSniff.php deleted file mode 100644 index 1e11f02..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/FunctionClosingBraceSniff.php +++ /dev/null @@ -1,91 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class FunctionClosingBraceSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_FUNCTION, - T_CLOSURE, - ]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]['scope_closer']) === false) { - // Probably an interface method. - return; - } - - $closeBrace = $tokens[$stackPtr]['scope_closer']; - $prevContent = $phpcsFile->findPrevious(T_WHITESPACE, ($closeBrace - 1), null, true); - $found = ($tokens[$closeBrace]['line'] - $tokens[$prevContent]['line'] - 1); - - if ($found < 0) { - // Brace isn't on a new line, so not handled by us. - return; - } - - if ($found === 0) { - // All is good. - return; - } - - $error = 'Function closing brace must go on the next line following the body; found %s blank lines before brace'; - $data = [$found]; - $fix = $phpcsFile->addFixableError($error, $closeBrace, 'SpacingBeforeClose', $data); - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($prevContent + 1); $i < $closeBrace; $i++) { - if ($tokens[$i]['line'] === $tokens[$prevContent]['line']) { - continue; - } - - // Don't remove any indentation before the brace. - if ($tokens[$i]['line'] === $tokens[$closeBrace]['line']) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/MethodDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/MethodDeclarationSniff.php deleted file mode 100644 index d23b8be..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/MethodDeclarationSniff.php +++ /dev/null @@ -1,162 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\AbstractScopeSniff; -use PHP_CodeSniffer\Util\Tokens; - -class MethodDeclarationSniff extends AbstractScopeSniff -{ - - - /** - * Constructs a Squiz_Sniffs_Scope_MethodScopeSniff. - */ - public function __construct() - { - parent::__construct(Tokens::$ooScopeTokens, [T_FUNCTION]); - - }//end __construct() - - - /** - * Processes the function tokens within the class. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position where the token was found. - * @param int $currScope The current scope opener token. - * - * @return void - */ - protected function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScope) - { - $tokens = $phpcsFile->getTokens(); - - // Determine if this is a function which needs to be examined. - $conditions = $tokens[$stackPtr]['conditions']; - end($conditions); - $deepestScope = key($conditions); - if ($deepestScope !== $currScope) { - return; - } - - $methodName = $phpcsFile->getDeclarationName($stackPtr); - if ($methodName === null) { - // Ignore closures. - return; - } - - if ($methodName[0] === '_' && isset($methodName[1]) === true && $methodName[1] !== '_') { - $error = 'Method name "%s" should not be prefixed with an underscore to indicate visibility'; - $data = [$methodName]; - $phpcsFile->addWarning($error, $stackPtr, 'Underscore', $data); - } - - $visibility = 0; - $static = 0; - $abstract = 0; - $final = 0; - - $find = (Tokens::$methodPrefixes + Tokens::$emptyTokens); - $prev = $phpcsFile->findPrevious($find, ($stackPtr - 1), null, true); - - $prefix = $stackPtr; - while (($prefix = $phpcsFile->findPrevious(Tokens::$methodPrefixes, ($prefix - 1), $prev)) !== false) { - switch ($tokens[$prefix]['code']) { - case T_STATIC: - $static = $prefix; - break; - case T_ABSTRACT: - $abstract = $prefix; - break; - case T_FINAL: - $final = $prefix; - break; - default: - $visibility = $prefix; - break; - } - } - - $fixes = []; - - if ($visibility !== 0 && $final > $visibility) { - $error = 'The final declaration must precede the visibility declaration'; - $fix = $phpcsFile->addFixableError($error, $final, 'FinalAfterVisibility'); - if ($fix === true) { - $fixes[$final] = ''; - $fixes[($final + 1)] = ''; - if (isset($fixes[$visibility]) === true) { - $fixes[$visibility] = 'final '.$fixes[$visibility]; - } else { - $fixes[$visibility] = 'final '.$tokens[$visibility]['content']; - } - } - } - - if ($visibility !== 0 && $abstract > $visibility) { - $error = 'The abstract declaration must precede the visibility declaration'; - $fix = $phpcsFile->addFixableError($error, $abstract, 'AbstractAfterVisibility'); - if ($fix === true) { - $fixes[$abstract] = ''; - $fixes[($abstract + 1)] = ''; - if (isset($fixes[$visibility]) === true) { - $fixes[$visibility] = 'abstract '.$fixes[$visibility]; - } else { - $fixes[$visibility] = 'abstract '.$tokens[$visibility]['content']; - } - } - } - - if ($static !== 0 && $static < $visibility) { - $error = 'The static declaration must come after the visibility declaration'; - $fix = $phpcsFile->addFixableError($error, $static, 'StaticBeforeVisibility'); - if ($fix === true) { - $fixes[$static] = ''; - $fixes[($static + 1)] = ''; - if (isset($fixes[$visibility]) === true) { - $fixes[$visibility] .= ' static'; - } else { - $fixes[$visibility] = $tokens[$visibility]['content'].' static'; - } - } - } - - // Batch all the fixes together to reduce the possibility of conflicts. - if (empty($fixes) === false) { - $phpcsFile->fixer->beginChangeset(); - foreach ($fixes as $stackPtr => $content) { - $phpcsFile->fixer->replaceToken($stackPtr, $content); - } - - $phpcsFile->fixer->endChangeset(); - } - - }//end processTokenWithinScope() - - - /** - * Processes a token that is found within the scope that this test is - * listening to. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position in the stack where this - * token was found. - * - * @return void - */ - protected function processTokenOutsideScope(File $phpcsFile, $stackPtr) - { - - }//end processTokenOutsideScope() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Namespaces/NamespaceDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Namespaces/NamespaceDeclarationSniff.php deleted file mode 100644 index bf37af0..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Namespaces/NamespaceDeclarationSniff.php +++ /dev/null @@ -1,100 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\Namespaces; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class NamespaceDeclarationSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_NAMESPACE]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($tokens[$nextNonEmpty]['code'] === T_NS_SEPARATOR) { - // Namespace keyword as operator. Not a declaration. - return; - } - - $end = $phpcsFile->findEndOfStatement($stackPtr); - for ($i = ($end + 1); $i < ($phpcsFile->numTokens - 1); $i++) { - if ($tokens[$i]['line'] === $tokens[$end]['line']) { - continue; - } - - break; - } - - // The $i var now points to the first token on the line after the - // namespace declaration, which must be a blank line. - $next = $phpcsFile->findNext(T_WHITESPACE, $i, $phpcsFile->numTokens, true); - if ($next === false) { - return; - } - - $diff = ($tokens[$next]['line'] - $tokens[$i]['line']); - if ($diff === 1) { - return; - } - - if ($diff < 0) { - $diff = 0; - } - - $error = 'There must be one blank line after the namespace declaration'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'BlankLineAfter'); - - if ($fix === true) { - if ($diff === 0) { - $phpcsFile->fixer->addNewlineBefore($i); - } else { - $phpcsFile->fixer->beginChangeset(); - for ($x = $i; $x < $next; $x++) { - if ($tokens[$x]['line'] === $tokens[$next]['line']) { - break; - } - - $phpcsFile->fixer->replaceToken($x, ''); - } - - $phpcsFile->fixer->addNewline($i); - $phpcsFile->fixer->endChangeset(); - } - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Namespaces/UseDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Namespaces/UseDeclarationSniff.php deleted file mode 100644 index 21a9dbe..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Namespaces/UseDeclarationSniff.php +++ /dev/null @@ -1,297 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\Namespaces; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class UseDeclarationSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_USE]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - if ($this->shouldIgnoreUse($phpcsFile, $stackPtr) === true) { - return; - } - - $tokens = $phpcsFile->getTokens(); - - // One space after the use keyword. - if ($tokens[($stackPtr + 1)]['content'] !== ' ') { - $error = 'There must be a single space after the USE keyword'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterUse'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($stackPtr + 1), ' '); - } - } - - // Only one USE declaration allowed per statement. - $next = $phpcsFile->findNext([T_COMMA, T_SEMICOLON, T_OPEN_USE_GROUP, T_CLOSE_TAG], ($stackPtr + 1)); - if ($next !== false - && $tokens[$next]['code'] !== T_SEMICOLON - && $tokens[$next]['code'] !== T_CLOSE_TAG - ) { - $error = 'There must be one USE keyword per declaration'; - - if ($tokens[$next]['code'] === T_COMMA) { - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'MultipleDeclarations'); - if ($fix === true) { - switch ($tokens[($stackPtr + 2)]['content']) { - case 'const': - $baseUse = 'use const'; - break; - case 'function': - $baseUse = 'use function'; - break; - default: - $baseUse = 'use'; - } - - if ($tokens[($next + 1)]['code'] !== T_WHITESPACE) { - $baseUse .= ' '; - } - - $phpcsFile->fixer->replaceToken($next, ';'.$phpcsFile->eolChar.$baseUse); - } - } else { - $closingCurly = $phpcsFile->findNext(T_CLOSE_USE_GROUP, ($next + 1)); - if ($closingCurly === false) { - // Parse error or live coding. Not auto-fixable. - $phpcsFile->addError($error, $stackPtr, 'MultipleDeclarations'); - } else { - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'MultipleDeclarations'); - if ($fix === true) { - $baseUse = rtrim($phpcsFile->getTokensAsString($stackPtr, ($next - $stackPtr))); - $lastNonWhitespace = $phpcsFile->findPrevious(T_WHITESPACE, ($closingCurly - 1), null, true); - - $phpcsFile->fixer->beginChangeset(); - - // Remove base use statement. - for ($i = $stackPtr; $i <= $next; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - if (preg_match('`^[\r\n]+$`', $tokens[($next + 1)]['content']) === 1) { - $phpcsFile->fixer->replaceToken(($next + 1), ''); - } - - // Convert grouped use statements into full use statements. - do { - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($next + 1), $closingCurly, true); - if ($next === false) { - // Group use statement with trailing comma after last item. - break; - } - - $nonWhitespace = $phpcsFile->findPrevious(T_WHITESPACE, ($next - 1), null, true); - for ($i = ($nonWhitespace + 1); $i < $next; $i++) { - if (preg_match('`^[\r\n]+$`', $tokens[$i]['content']) === 1) { - // Preserve new lines. - continue; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - if ($tokens[$next]['content'] === 'const' || $tokens[$next]['content'] === 'function') { - $phpcsFile->fixer->addContentBefore($next, 'use '); - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($next + 1), $closingCurly, true); - $phpcsFile->fixer->addContentBefore($next, str_replace('use ', '', $baseUse)); - } else { - $phpcsFile->fixer->addContentBefore($next, $baseUse); - } - - $next = $phpcsFile->findNext(T_COMMA, ($next + 1), $closingCurly); - if ($next !== false) { - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($next + 1), $closingCurly, true); - if ($nextNonEmpty !== false && $tokens[$nextNonEmpty]['line'] === $tokens[$next]['line']) { - $prevNonWhitespace = $phpcsFile->findPrevious(T_WHITESPACE, ($nextNonEmpty - 1), $next, true); - if ($prevNonWhitespace === $next) { - $phpcsFile->fixer->replaceToken($next, ';'.$phpcsFile->eolChar); - } else { - $phpcsFile->fixer->replaceToken($next, ';'); - $phpcsFile->fixer->addNewline($prevNonWhitespace); - } - } else { - // Last item with trailing comma or next item already on new line. - $phpcsFile->fixer->replaceToken($next, ';'); - } - } else { - // Last item without trailing comma. - $phpcsFile->fixer->addContent($lastNonWhitespace, ';'); - } - } while ($next !== false); - - // Remove closing curly,semi-colon and any whitespace between last child and closing curly. - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($closingCurly + 1), null, true); - if ($next === false || $tokens[$next]['code'] !== T_SEMICOLON) { - // Parse error, forgotten semi-colon. - $next = $closingCurly; - } - - for ($i = ($lastNonWhitespace + 1); $i <= $next; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - }//end if - }//end if - }//end if - }//end if - - // Make sure this USE comes after the first namespace declaration. - $prev = $phpcsFile->findPrevious(T_NAMESPACE, ($stackPtr - 1)); - if ($prev === false) { - $next = $phpcsFile->findNext(T_NAMESPACE, ($stackPtr + 1)); - if ($next !== false) { - $error = 'USE declarations must go after the namespace declaration'; - $phpcsFile->addError($error, $stackPtr, 'UseBeforeNamespace'); - } - } - - // Only interested in the last USE statement from here onwards. - $nextUse = $phpcsFile->findNext(T_USE, ($stackPtr + 1)); - while ($this->shouldIgnoreUse($phpcsFile, $nextUse) === true) { - $nextUse = $phpcsFile->findNext(T_USE, ($nextUse + 1)); - if ($nextUse === false) { - break; - } - } - - if ($nextUse !== false) { - return; - } - - $end = $phpcsFile->findNext([T_SEMICOLON, T_CLOSE_USE_GROUP, T_CLOSE_TAG], ($stackPtr + 1)); - if ($end === false) { - return; - } - - if ($tokens[$end]['code'] === T_CLOSE_USE_GROUP) { - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($end + 1), null, true); - if ($tokens[$nextNonEmpty]['code'] === T_SEMICOLON) { - $end = $nextNonEmpty; - } - } - - // Find either the start of the next line or the beginning of the next statement, - // whichever comes first. - for ($end = ++$end; $end < $phpcsFile->numTokens; $end++) { - if (isset(Tokens::$emptyTokens[$tokens[$end]['code']]) === false) { - break; - } - - if ($tokens[$end]['column'] === 1) { - // Reached the next line. - break; - } - } - - --$end; - - if (($tokens[$end]['code'] === T_COMMENT - || isset(Tokens::$phpcsCommentTokens[$tokens[$end]['code']]) === true) - && substr($tokens[$end]['content'], 0, 2) === '/*' - && substr($tokens[$end]['content'], -2) !== '*/' - ) { - // Multi-line block comments are not allowed as trailing comment after a use statement. - --$end; - } - - $next = $phpcsFile->findNext(T_WHITESPACE, ($end + 1), null, true); - - if ($next === false || $tokens[$next]['code'] === T_CLOSE_TAG) { - return; - } - - $diff = ($tokens[$next]['line'] - $tokens[$end]['line'] - 1); - if ($diff !== 1) { - if ($diff < 0) { - $diff = 0; - } - - $error = 'There must be one blank line after the last USE statement; %s found;'; - $data = [$diff]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterLastUse', $data); - if ($fix === true) { - if ($diff === 0) { - $phpcsFile->fixer->addNewline($end); - } else { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($end + 1); $i < $next; $i++) { - if ($tokens[$i]['line'] === $tokens[$next]['line']) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->addNewline($end); - $phpcsFile->fixer->endChangeset(); - } - } - }//end if - - }//end process() - - - /** - * Check if this use statement is part of the namespace block. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return bool - */ - private function shouldIgnoreUse($phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Ignore USE keywords inside closures and during live coding. - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($next === false || $tokens[$next]['code'] === T_OPEN_PARENTHESIS) { - return true; - } - - // Ignore USE keywords for traits. - if ($phpcsFile->hasCondition($stackPtr, [T_CLASS, T_TRAIT]) === true) { - return true; - } - - return false; - - }//end shouldIgnoreUse() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.inc deleted file mode 100644 index 13e596e..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.inc +++ /dev/null @@ -1,241 +0,0 @@ -anonymous = new class extends ArrayObject - { - public function __construct() - { - parent::__construct(['a' => 1, 'b' => 2]); - } - }; - } -} - -class A extends B - implements C -{ -} - -class C2 -{ - -} // phpcs:ignore Standard.Category.Sniff - -interface I1 extends - Foo -{ -} - -interface I2 extends - Bar -{ -} - -interface I3 extends - Foo, - Bar -{ -} - -class C1 extends - Foo -{ -} - -class C2 extends - Bar -{ -} - -class C3 extends Foo implements - Bar -{ -} - -class C4 extends Foo implements - Bar -{ -} - -class C5 extends Foo implements - Bar, - Baz -{ -} - -class C6 extends \Foo\Bar implements - \Baz\Bar -{ -} - -interface I4 extends - \Baz - \Bar -{ -} - -interface I5 extends /* comment */ - \Foo\Bar -{ -} - -interface I6 extends // comment - \Foo\Bar -{ -} - -class C7 extends // comment - \Foo\Bar implements \Baz\Bar -{ -} - -class -C8 -{ -} - -foo(new class { -}); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.inc.fixed deleted file mode 100644 index 3ee394e..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.inc.fixed +++ /dev/null @@ -1,234 +0,0 @@ -anonymous = new class extends ArrayObject - { - public function __construct() - { - parent::__construct(['a' => 1, 'b' => 2]); - } - }; - } -} - -class A extends B implements C -{ -} - -class C2 -{ - -} // phpcs:ignore Standard.Category.Sniff - -interface I1 extends - Foo -{ -} - -interface I2 extends - Bar -{ -} - -interface I3 extends - Foo, - Bar -{ -} - -class C1 extends Foo -{ -} - -class C2 extends Bar -{ -} - -class C3 extends Foo implements - Bar -{ -} - -class C4 extends Foo implements - Bar -{ -} - -class C5 extends Foo implements - Bar, - Baz -{ -} - -class C6 extends \Foo\Bar implements - \Baz\Bar -{ -} - -interface I4 extends - \Baz\Bar -{ -} - -interface I5 extends /* comment */ - \Foo\Bar -{ -} - -interface I6 extends // comment - \Foo\Bar -{ -} - -class C7 extends \Foo\Bar implements \Baz\Bar // comment -{ -} - -class C8 -{ -} - -foo(new class { -}); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.php deleted file mode 100644 index 635ac71..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.php +++ /dev/null @@ -1,86 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Tests\Classes; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ClassDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 2 => 1, - 7 => 3, - 12 => 1, - 13 => 1, - 17 => 1, - 19 => 2, - 20 => 1, - 21 => 1, - 22 => 1, - 25 => 1, - 27 => 2, - 34 => 1, - 35 => 2, - 44 => 1, - 45 => 1, - 63 => 1, - 95 => 1, - 116 => 1, - 118 => 1, - 119 => 1, - 124 => 1, - 130 => 2, - 131 => 1, - 158 => 1, - 168 => 1, - 178 => 1, - 179 => 1, - 184 => 1, - 189 => 1, - 194 => 1, - 204 => 1, - 205 => 1, - 210 => 1, - 215 => 2, - 216 => 1, - 231 => 2, - 235 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/PropertyDeclarationUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/PropertyDeclarationUnitTest.inc deleted file mode 100644 index 031d2a8..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/PropertyDeclarationUnitTest.inc +++ /dev/null @@ -1,73 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Tests\Classes; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class PropertyDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 7 => 1, - 9 => 2, - 10 => 1, - 11 => 1, - 17 => 1, - 18 => 1, - 23 => 1, - 38 => 1, - 41 => 1, - 42 => 1, - 50 => 2, - 51 => 1, - 55 => 1, - 56 => 1, - 61 => 1, - 62 => 1, - 68 => 1, - 69 => 1, - 71 => 1, - 72 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return [ - 13 => 1, - 14 => 1, - 15 => 1, - 53 => 1, - ]; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ControlStructureSpacingUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ControlStructureSpacingUnitTest.inc deleted file mode 100644 index 542ab3c..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ControlStructureSpacingUnitTest.inc +++ /dev/null @@ -1,81 +0,0 @@ - $that) {} -foreach ( $something as $blah => $that ) {} -foreach ( $something as $blah => $that ) {} -// phpcs:set PSR2.ControlStructures.ControlStructureSpacing requiredSpacesAfterOpen 0 -// phpcs:set PSR2.ControlStructures.ControlStructureSpacing requiredSpacesBeforeClose 0 - -$binary = b"binary string"; - -if ($expr1 - && $expr2 ) { -} - -if ($expr1 - && $expr2 /* comment */ ) { -} - -if ($expr1 - && $expr2 - /* comment */ ) { -} - -$r = match ($x) {}; -$r = match ( $x ) {}; - -// phpcs:set PSR2.ControlStructures.ControlStructureSpacing requiredSpacesAfterOpen 1 -// phpcs:set PSR2.ControlStructures.ControlStructureSpacing requiredSpacesBeforeClose 1 -$r = match ($x) {}; -$r = match ( $x ) {}; -$r = match ( $x ) {}; -// phpcs:set PSR2.ControlStructures.ControlStructureSpacing requiredSpacesAfterOpen 0 -// phpcs:set PSR2.ControlStructures.ControlStructureSpacing requiredSpacesBeforeClose 0 diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ControlStructureSpacingUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ControlStructureSpacingUnitTest.inc.fixed deleted file mode 100644 index a29534b..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ControlStructureSpacingUnitTest.inc.fixed +++ /dev/null @@ -1,80 +0,0 @@ - $that ) {} -foreach ( $something as $blah => $that ) {} -foreach ( $something as $blah => $that ) {} -// phpcs:set PSR2.ControlStructures.ControlStructureSpacing requiredSpacesAfterOpen 0 -// phpcs:set PSR2.ControlStructures.ControlStructureSpacing requiredSpacesBeforeClose 0 - -$binary = b"binary string"; - -if ($expr1 - && $expr2) { -} - -if ($expr1 - && $expr2 /* comment */) { -} - -if ($expr1 - && $expr2 - /* comment */) { -} - -$r = match ($x) {}; -$r = match ($x) {}; - -// phpcs:set PSR2.ControlStructures.ControlStructureSpacing requiredSpacesAfterOpen 1 -// phpcs:set PSR2.ControlStructures.ControlStructureSpacing requiredSpacesBeforeClose 1 -$r = match ( $x ) {}; -$r = match ( $x ) {}; -$r = match ( $x ) {}; -// phpcs:set PSR2.ControlStructures.ControlStructureSpacing requiredSpacesAfterOpen 0 -// phpcs:set PSR2.ControlStructures.ControlStructureSpacing requiredSpacesBeforeClose 0 diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ControlStructureSpacingUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ControlStructureSpacingUnitTest.php deleted file mode 100644 index 35d5e51..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ControlStructureSpacingUnitTest.php +++ /dev/null @@ -1,62 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Tests\ControlStructures; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ControlStructureSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 4 => 1, - 14 => 2, - 26 => 2, - 27 => 2, - 31 => 1, - 51 => 2, - 53 => 2, - 60 => 1, - 64 => 1, - 69 => 1, - 73 => 2, - 77 => 2, - 79 => 2, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ElseIfDeclarationUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ElseIfDeclarationUnitTest.inc deleted file mode 100644 index 778659c..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ElseIfDeclarationUnitTest.inc +++ /dev/null @@ -1,17 +0,0 @@ - \ No newline at end of file diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ElseIfDeclarationUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ElseIfDeclarationUnitTest.inc.fixed deleted file mode 100644 index 4a7bfdc..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ElseIfDeclarationUnitTest.inc.fixed +++ /dev/null @@ -1,17 +0,0 @@ - \ No newline at end of file diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ElseIfDeclarationUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ElseIfDeclarationUnitTest.php deleted file mode 100644 index 935205b..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ElseIfDeclarationUnitTest.php +++ /dev/null @@ -1,51 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Tests\ControlStructures; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ElseIfDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return []; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return [ - 4 => 1, - 12 => 1, - ]; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/SwitchDeclarationUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/SwitchDeclarationUnitTest.inc deleted file mode 100644 index c425a1f..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/SwitchDeclarationUnitTest.inc +++ /dev/null @@ -1,586 +0,0 @@ - 0) { - return 0; - } else { - return 1; - } - case 2: - return 2; -} - -// ERROR: No else clause -switch ($foo) { - case 1: - if ($bar > 0) { - return 0; - } elseif ($bar < 0) { - return 1; - } - case 2: - return 2; -} - -// OK: No fall-through present -switch ($foo) { - case 1: - if ($bar > 0) { - return 0; - } elseif ($bar < 0) { - return 1; - } -} - -// ERROR: No else clause (nested) -switch ($foo) { - case 1: - if ($bar > 0) { - return 0; - } else { - if ($foo > $bar) { - continue; - } - } - case 2: - return 2; -} - -// OK: Every clause terminates -switch ($foo) { - case 1: - if ($bar > 0) { - return 0; - } else { - if ($foo > $bar) { - continue; - } else { - break; - } - } - case 2: - return 2; -} - -// ERROR: Non-termination IF clause -switch ($foo) { - case 1: - if ($bar > 0) { - $offset = 0; - } else { - break; - } - case 2: - return 2; -} - -// ERROR: Non-termination IF clause (nested) -switch ($foo) { - case 1: - if ($bar > 0) { - continue; - } else { - if ($foo > $bar) { - $offset = 0; - } else { - break; - } - } - case 2: - return 2; -} - -switch ($sContext) -{ - case 'SOMETHING': - case 'CONSTANT': - do_something(); - break; - case 'GLOBAL': - case 'GLOBAL1': - do_something(); - // Fall through - default: - { - do_something(); - } -} - -$foo = $foo ? - function () { - switch ($a) { - case 'a': - break; - } - } : - null; - -switch ($foo) { -case Foo::INTERFACE: - echo '1'; - return self::INTERFACE; -case Foo::TRAIT: -case Foo::ARRAY: - echo '1'; - return self::VALUE; -} - -// OK: Every clause terminates -switch ($foo) { - case 1: - switch ($bar) { - case 1: - return 1; - default: - return 3; - } - case 2: - return 2; -} - -// KO: Not every clause terminates -switch ($foo) { - case 1: - switch ($bar) { - case 1: - return; - } - case 2: - return 2; -} - -// KO: Not every clause terminates -switch ($foo) { - case 1: - switch ($bar) { - case 1: - return; - default: - $a = 1; - } - case 2: - return 2; -} - -// OK: Every clause terminates -switch ($foo) { - case 1: - switch ($bar) { - case 1: - return 1; - default: - throw new \Exception(); - } - case 2: - return 2; -} - -switch ($foo) { - case 1: - // phpcs:ignore - case 2: - return 1; - case 3: - return 2; -} - -// Issue 3352. -switch ( $test ) { - case 2: // comment followed by empty line - - break; - - case 3: /* phpcs:ignore Stnd.Cat.SniffName -- Verify correct handling of ignore comments. */ - - - - break; - - case 4: /** inline docblock */ - - - - break; - - case 5: /* checking how it handles */ /* two trailing comments */ - - break; - - case 6: - // Comment as first content of the body. - - break; - - case 7: - /* phpcs:ignore Stnd.Cat.SniffName -- Verify correct handling of ignore comments at start of body. */ - - break; - - case 8: - /** inline docblock */ - - break; -} - -// Handle comments correctly. -switch ($foo) { - case 1: - if ($bar > 0) { - doSomething(); - } - // Comment - else { - return 1; - } - case 2: - return 2; -} - -switch ($foo) { - case 1: - if ($bar > 0) /*comment*/ { - return doSomething(); - } - else { - return 1; - } - case 2: - return 2; -} - -// Issue #3297. -// Okay - finally will always be executed, so all branches are covered by the `return` in finally. -switch ( $a ) { - case 1: - try { - doSomething(); - } catch (Exception $e) { - doSomething(); - } catch (AnotherException $e) { - doSomething(); - } finally { - return true; - } - default: - $other = $code; - break; -} - -// Okay - all - non-finally - branches have a terminating statement. -switch ( $a ) { - case 1: - try { - return false; - } catch (Exception $e) /*comment*/ { - return true; - } - // Comment - catch (AnotherException $e) { - return true; - } finally { - doSomething(); - } - default: - $other = $code; - break; -} - -// Okay - finally will always be executed, so all branches are covered by the `return` in finally. -// Non-standard structure order. -switch ( $a ) { - case 1: - try { - doSomething(); - } catch (Exception $e) { - doSomething(); - } finally { - return true; - } catch (AnotherException $e) { - doSomething(); - } - default: - $other = $code; - break; -} - -// Okay - all - non-finally - branches have a terminating statement. -// Non-standard structure order. -switch ( $a ) { - case 1: - try { - return false; - } finally { - doSomething(); - } catch (MyException $e) { - return true; - } catch (AnotherException $e) { - return true; - } - default: - $other = $code; - break; -} - -// All okay, no finally. Any exception still uncaught will terminate the case anyhow, so we're good. -switch ( $a ) { - case 1: - try { - return false; - } catch (MyException $e) { - return true; - } catch (AnotherException $e) { - return true; - } - default: - $other = $code; - break; -} - -// All okay, no catch -switch ( $a ) { - case 1: - try { - return true; - } finally { - doSomething(); - } - case 2: - $other = $code; - break; -} - -// All okay, try-catch nested in if. -switch ( $a ) { - case 1: - if ($a) { - try { - return true; - } catch (MyException $e) { - throw new Exception($e->getMessage()); - } - } else { - return true; - } - case 2: - $other = $code; - break; -} - -// Missing fall-through comment. -switch ( $a ) { - case 1: - try { - doSomething(); - } finally { - doSomething(); - } - case 2: - $other = $code; - break; -} - -// Missing fall-through comment. One of the catches does not have a terminating statement. -switch ( $a ) { - case 1: - try { - return false; - } catch (Exception $e) { - doSomething(); - } catch (AnotherException $e) { - return true; - } finally { - doSomething(); - } - default: - $other = $code; - break; -} - -// Missing fall-through comment. Try does not have a terminating statement. -switch ( $a ) { - case 1: - try { - doSomething(); - } finally { - doSomething(); - } catch (Exception $e) { - return true; - } catch (AnotherException $e) { - return true; - } - default: - $other = $code; - break; -} - -// Missing fall-through comment. One of the catches does not have a terminating statement. -switch ( $a ) { - case 1: - try { - return false; - } catch (Exception $e) { - doSomething(); - } catch (AnotherException $e) { - return true; - } - default: - $other = $code; - break; -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/SwitchDeclarationUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/SwitchDeclarationUnitTest.inc.fixed deleted file mode 100644 index 47ae8d3..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/SwitchDeclarationUnitTest.inc.fixed +++ /dev/null @@ -1,581 +0,0 @@ - 0) { - return 0; - } else { - return 1; - } - case 2: - return 2; -} - -// ERROR: No else clause -switch ($foo) { - case 1: - if ($bar > 0) { - return 0; - } elseif ($bar < 0) { - return 1; - } - case 2: - return 2; -} - -// OK: No fall-through present -switch ($foo) { - case 1: - if ($bar > 0) { - return 0; - } elseif ($bar < 0) { - return 1; - } -} - -// ERROR: No else clause (nested) -switch ($foo) { - case 1: - if ($bar > 0) { - return 0; - } else { - if ($foo > $bar) { - continue; - } - } - case 2: - return 2; -} - -// OK: Every clause terminates -switch ($foo) { - case 1: - if ($bar > 0) { - return 0; - } else { - if ($foo > $bar) { - continue; - } else { - break; - } - } - case 2: - return 2; -} - -// ERROR: Non-termination IF clause -switch ($foo) { - case 1: - if ($bar > 0) { - $offset = 0; - } else { - break; - } - case 2: - return 2; -} - -// ERROR: Non-termination IF clause (nested) -switch ($foo) { - case 1: - if ($bar > 0) { - continue; - } else { - if ($foo > $bar) { - $offset = 0; - } else { - break; - } - } - case 2: - return 2; -} - -switch ($sContext) -{ - case 'SOMETHING': - case 'CONSTANT': - do_something(); - break; - case 'GLOBAL': - case 'GLOBAL1': - do_something(); - // Fall through - default: - { - do_something(); - } -} - -$foo = $foo ? - function () { - switch ($a) { - case 'a': - break; - } - } : - null; - -switch ($foo) { -case Foo::INTERFACE: - echo '1'; - return self::INTERFACE; -case Foo::TRAIT: -case Foo::ARRAY: - echo '1'; - return self::VALUE; -} - -// OK: Every clause terminates -switch ($foo) { - case 1: - switch ($bar) { - case 1: - return 1; - default: - return 3; - } - case 2: - return 2; -} - -// KO: Not every clause terminates -switch ($foo) { - case 1: - switch ($bar) { - case 1: - return; - } - case 2: - return 2; -} - -// KO: Not every clause terminates -switch ($foo) { - case 1: - switch ($bar) { - case 1: - return; - default: - $a = 1; - } - case 2: - return 2; -} - -// OK: Every clause terminates -switch ($foo) { - case 1: - switch ($bar) { - case 1: - return 1; - default: - throw new \Exception(); - } - case 2: - return 2; -} - -switch ($foo) { - case 1: - // phpcs:ignore - case 2: - return 1; - case 3: - return 2; -} - -// Issue 3352. -switch ( $test ) { - case 2: // comment followed by empty line - break; - - case 3: /* phpcs:ignore Stnd.Cat.SniffName -- Verify correct handling of ignore comments. */ - break; - - case 4: /** inline docblock */ - break; - - case 5: /* checking how it handles */ /* two trailing comments */ - break; - - case 6: - // Comment as first content of the body. - - break; - - case 7: - /* phpcs:ignore Stnd.Cat.SniffName -- Verify correct handling of ignore comments at start of body. */ - - break; - - case 8: - /** inline docblock */ - - break; -} - -// Handle comments correctly. -switch ($foo) { - case 1: - if ($bar > 0) { - doSomething(); - } - // Comment - else { - return 1; - } - case 2: - return 2; -} - -switch ($foo) { - case 1: - if ($bar > 0) /*comment*/ { - return doSomething(); - } - else { - return 1; - } - case 2: - return 2; -} - -// Issue #3297. -// Okay - finally will always be executed, so all branches are covered by the `return` in finally. -switch ( $a ) { - case 1: - try { - doSomething(); - } catch (Exception $e) { - doSomething(); - } catch (AnotherException $e) { - doSomething(); - } finally { - return true; - } - default: - $other = $code; - break; -} - -// Okay - all - non-finally - branches have a terminating statement. -switch ( $a ) { - case 1: - try { - return false; - } catch (Exception $e) /*comment*/ { - return true; - } - // Comment - catch (AnotherException $e) { - return true; - } finally { - doSomething(); - } - default: - $other = $code; - break; -} - -// Okay - finally will always be executed, so all branches are covered by the `return` in finally. -// Non-standard structure order. -switch ( $a ) { - case 1: - try { - doSomething(); - } catch (Exception $e) { - doSomething(); - } finally { - return true; - } catch (AnotherException $e) { - doSomething(); - } - default: - $other = $code; - break; -} - -// Okay - all - non-finally - branches have a terminating statement. -// Non-standard structure order. -switch ( $a ) { - case 1: - try { - return false; - } finally { - doSomething(); - } catch (MyException $e) { - return true; - } catch (AnotherException $e) { - return true; - } - default: - $other = $code; - break; -} - -// All okay, no finally. Any exception still uncaught will terminate the case anyhow, so we're good. -switch ( $a ) { - case 1: - try { - return false; - } catch (MyException $e) { - return true; - } catch (AnotherException $e) { - return true; - } - default: - $other = $code; - break; -} - -// All okay, no catch -switch ( $a ) { - case 1: - try { - return true; - } finally { - doSomething(); - } - case 2: - $other = $code; - break; -} - -// All okay, try-catch nested in if. -switch ( $a ) { - case 1: - if ($a) { - try { - return true; - } catch (MyException $e) { - throw new Exception($e->getMessage()); - } - } else { - return true; - } - case 2: - $other = $code; - break; -} - -// Missing fall-through comment. -switch ( $a ) { - case 1: - try { - doSomething(); - } finally { - doSomething(); - } - case 2: - $other = $code; - break; -} - -// Missing fall-through comment. One of the catches does not have a terminating statement. -switch ( $a ) { - case 1: - try { - return false; - } catch (Exception $e) { - doSomething(); - } catch (AnotherException $e) { - return true; - } finally { - doSomething(); - } - default: - $other = $code; - break; -} - -// Missing fall-through comment. Try does not have a terminating statement. -switch ( $a ) { - case 1: - try { - doSomething(); - } finally { - doSomething(); - } catch (Exception $e) { - return true; - } catch (AnotherException $e) { - return true; - } - default: - $other = $code; - break; -} - -// Missing fall-through comment. One of the catches does not have a terminating statement. -switch ( $a ) { - case 1: - try { - return false; - } catch (Exception $e) { - doSomething(); - } catch (AnotherException $e) { - return true; - } - default: - $other = $code; - break; -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/SwitchDeclarationUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/SwitchDeclarationUnitTest.php deleted file mode 100644 index 0cd946d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/SwitchDeclarationUnitTest.php +++ /dev/null @@ -1,81 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Tests\ControlStructures; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class SwitchDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 10 => 1, - 11 => 1, - 14 => 1, - 16 => 1, - 20 => 1, - 23 => 1, - 29 => 1, - 33 => 1, - 37 => 2, - 108 => 2, - 109 => 1, - 111 => 1, - 113 => 2, - 114 => 1, - 128 => 1, - 141 => 1, - 172 => 1, - 194 => 1, - 224 => 1, - 236 => 1, - 260 => 1, - 300 => 1, - 311 => 1, - 346 => 1, - 350 => 1, - 356 => 1, - 362 => 1, - 384 => 1, - 528 => 1, - 541 => 1, - 558 => 1, - 575 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.1.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.1.inc deleted file mode 100644 index 738e70e..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.1.inc +++ /dev/null @@ -1,12 +0,0 @@ - - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.1.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.1.inc.fixed deleted file mode 100644 index f70b9eb..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.1.inc.fixed +++ /dev/null @@ -1,12 +0,0 @@ - - -
    - -
    \ No newline at end of file diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.3.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.3.inc deleted file mode 100644 index d6a8617..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.3.inc +++ /dev/null @@ -1,7 +0,0 @@ - - -A: -B: -C: \ No newline at end of file diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.4.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.4.inc deleted file mode 100644 index dd103cd..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.4.inc +++ /dev/null @@ -1 +0,0 @@ - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.4.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.4.inc.fixed deleted file mode 100644 index 1058f1f..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.4.inc.fixed +++ /dev/null @@ -1 +0,0 @@ - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.5.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.5.inc.fixed deleted file mode 100644 index 93d55fb..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.5.inc.fixed +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.6.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.6.inc.fixed deleted file mode 100644 index 534574d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.6.inc.fixed +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.7.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.7.inc.fixed deleted file mode 100644 index 68e7d8c..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.7.inc.fixed +++ /dev/null @@ -1,5 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Tests\Files; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ClosingTagUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'ClosingTagUnitTest.1.inc': - return [11 => 1]; - - case 'ClosingTagUnitTest.4.inc': - case 'ClosingTagUnitTest.5.inc': - return [1 => 1]; - - case 'ClosingTagUnitTest.6.inc': - case 'ClosingTagUnitTest.7.inc': - return [5 => 1]; - - default: - return []; - } - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.1.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.1.inc deleted file mode 100644 index ca2a749..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.1.inc +++ /dev/null @@ -1,3 +0,0 @@ - \ No newline at end of file diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.12.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.12.inc.fixed deleted file mode 100644 index d3c19fe..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.12.inc.fixed +++ /dev/null @@ -1 +0,0 @@ - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.13.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.13.inc deleted file mode 100644 index fa2f476..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.13.inc +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.2.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.2.inc deleted file mode 100644 index 1254e4a..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.2.inc +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.5.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.5.inc deleted file mode 100644 index c3a59b6..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.5.inc +++ /dev/null @@ -1,6 +0,0 @@ - - - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Tests\Files; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class EndFileNewlineUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'EndFileNewlineUnitTest.1.inc': - case 'EndFileNewlineUnitTest.3.inc': - case 'EndFileNewlineUnitTest.6.inc': - case 'EndFileNewlineUnitTest.7.inc': - case 'EndFileNewlineUnitTest.9.inc': - case 'EndFileNewlineUnitTest.10.inc': - return [2 => 1]; - case 'EndFileNewlineUnitTest.11.inc': - case 'EndFileNewlineUnitTest.12.inc': - case 'EndFileNewlineUnitTest.13.inc': - return [1 => 1]; - default: - return []; - }//end switch - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getWarningList($testFile='') - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionCallSignatureUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionCallSignatureUnitTest.inc deleted file mode 100644 index 1ca477d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionCallSignatureUnitTest.inc +++ /dev/null @@ -1,267 +0,0 @@ -get('/hello/{name}', function ($name) use ($app) { - return 'Hello '.$app->escape($name); -}, array( - '1', - '2', - '3', -)); - -// error -somefunction2($foo, $bar, [ - // ... - ], -$baz); - -// ok -somefunction3(// ... - $foo, - $bar, - [ - // ... - ], - $baz -); - -// ok -somefunction4(' - this should not - give an error - because it\'s actually - one line call - with multi-line string -'); - -// ok -somefunction5("hey, -multi-line string with some -extra args", $foo, 12); - -// error -somefunction6(' - but args in a new line - are not ok… - ', - $foo -); - -$this->setFoo(true - ? 1 - : 2, false, array( - 'value', - 'more')); - -$this->setFoo('some' - . 'long' - . 'text', 'string'); - -foo(bar(), $a); -foo();bar(); - -foo( - true -); - -myFunction(<< function ($x) { - return true; - }, - 'baz' => false - ) -); -$qux = array_filter( - $quux, function ($x) { - return $x; - } -); - -$this->listeners[] = $events->getSharedManager()->attach( - 'Zend\Mvc\Application', MvcEvent::EVENT_DISPATCH, [$this, 'selectLayout'], 100 -); - -// phpcs:set PSR2.Methods.FunctionCallSignature requiredSpacesBeforeClose 1 -foo('Testing - multiline text' - ); - -foo('Testing - multiline text: ' // . $text - ); - -foo('Testing - multiline text: ' /* . $text */ - ); - -foo('Testing - multiline text: ' /* . $text */ - // . $other_text - ); - -foo('Testing - multiline text: ' /* - . $text -// . $text2 - */ - ); -// phpcs:set PSR2.Methods.FunctionCallSignature requiredSpacesBeforeClose 0 - -foo('Testing - multiline text' -); - -foo('Testing - multiline text' - ); - -foo('Testing - multiline text' // hello -); - -foo('Testing - multiline text' /* hello */ -); - -foo('Testing - multiline text' - // hello -); - -foo('Testing - multiline text' - /* hello */ -); - -$var = foo('Testing - multiline' - // hi - ) + foo('Testing - multiline' - // hi - ) -; - -class Test -{ - public function getInstance() - { - return new static( - 'arg', - 'foo' - ); - } - - public function getSelf() - { - return new self( - 'a', 'b', 'c' - ); - } -} - -$x = $var('y', - 'x'); - -$obj->{$x}(1, -2); - -(function ($a, $b) { - return function ($c, $d) use ($a, $b) { - echo $a, $b, $c, $d; - }; -})( - 'a','b' -)('c', - 'd'); - -return trim(preg_replace_callback( - // sprintf replaces IGNORED_CHARS multiple times: for %s as well as %1$s (argument numbering) - // /[%s]*([^%1$s]+)/ results in /[IGNORED_CHARS]*([^IGNORED_CHARS]+)/ - sprintf('/[%s]*([^%1$s]+)/', self::IGNORED_CHARS), - function (array $term) use ($mode): string { - // query pieces have to bigger than one char, otherwise they are too expensive for the search - if (mb_strlen($term[1], 'UTF-8') > 1) { - // in boolean search mode '' (empty) means OR, '-' means NOT - return sprintf('%s%s ', $mode === 'AND' ? '+' : '', self::extractUmlauts($term[1])); - } - - return ''; - }, - $search - )); - -return trim(preg_replace_callback( -// sprintf replaces IGNORED_CHARS multiple times: for %s as well as %1$s (argument numbering) -// /[%s]*([^%1$s]+)/ results in /[IGNORED_CHARS]*([^IGNORED_CHARS]+)/ -sprintf('/[%s]*([^%1$s]+)/', self::IGNORED_CHARS), -function (array $term) use ($mode): string { - // query pieces have to bigger than one char, otherwise they are too expensive for the search - if (mb_strlen($term[1], 'UTF-8') > 1) { - // in boolean search mode '' (empty) means OR, '-' means NOT - return sprintf('%s%s ', $mode === 'AND' ? '+' : '', self::extractUmlauts($term[1])); - } - - return ''; -}, -$search -)); - -// PHP 8.0 named parameters. -array_fill_keys( - keys: range( - 1, - 12, - ), - value: true, -); - -array_fill_keys( - keys: range( 1, - 12, - ), value: true, -); - -// phpcs:set PSR2.Methods.FunctionCallSignature allowMultipleArguments true -array_fill_keys( - keys: range( 1, - 12, - ), value: true, -); -// phpcs:set PSR2.Methods.FunctionCallSignature allowMultipleArguments false diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionCallSignatureUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionCallSignatureUnitTest.inc.fixed deleted file mode 100644 index dc383ed..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionCallSignatureUnitTest.inc.fixed +++ /dev/null @@ -1,283 +0,0 @@ -get('/hello/{name}', function ($name) use ($app) { - return 'Hello '.$app->escape($name); -}, array( - '1', - '2', - '3', -)); - -// error -somefunction2( - $foo, - $bar, - [ - // ... - ], - $baz -); - -// ok -somefunction3(// ... - $foo, - $bar, - [ - // ... - ], - $baz -); - -// ok -somefunction4(' - this should not - give an error - because it\'s actually - one line call - with multi-line string -'); - -// ok -somefunction5("hey, -multi-line string with some -extra args", $foo, 12); - -// error -somefunction6( - ' - but args in a new line - are not ok… - ', - $foo -); - -$this->setFoo(true - ? 1 - : 2, false, array( - 'value', - 'more')); - -$this->setFoo('some' - . 'long' - . 'text', 'string'); - -foo(bar(), $a); -foo();bar(); - -foo( - true -); - -myFunction(<< function ($x) { - return true; - }, - 'baz' => false - ) -); -$qux = array_filter( - $quux, - function ($x) { - return $x; - } -); - -$this->listeners[] = $events->getSharedManager()->attach( - 'Zend\Mvc\Application', - MvcEvent::EVENT_DISPATCH, - [$this, 'selectLayout'], - 100 -); - -// phpcs:set PSR2.Methods.FunctionCallSignature requiredSpacesBeforeClose 1 -foo('Testing - multiline text' ); - -foo('Testing - multiline text: ' ); // . $text - - -foo('Testing - multiline text: ' /* . $text */ ); - -foo('Testing - multiline text: ' /* . $text */ ); - // . $other_text - - -foo('Testing - multiline text: ' /* - . $text -// . $text2 - */ ); -// phpcs:set PSR2.Methods.FunctionCallSignature requiredSpacesBeforeClose 0 - -foo('Testing - multiline text'); - -foo('Testing - multiline text'); - -foo('Testing - multiline text'); // hello - - -foo('Testing - multiline text' /* hello */); - -foo('Testing - multiline text'); - // hello - - -foo('Testing - multiline text' - /* hello */); - -$var = foo('Testing - multiline') - // hi - + foo('Testing - multiline'); - // hi - - -class Test -{ - public function getInstance() - { - return new static( - 'arg', - 'foo' - ); - } - - public function getSelf() - { - return new self( - 'a', - 'b', - 'c' - ); - } -} - -$x = $var( - 'y', - 'x' -); - -$obj->{$x}( - 1, - 2 -); - -(function ($a, $b) { - return function ($c, $d) use ($a, $b) { - echo $a, $b, $c, $d; - }; -})( - 'a', - 'b' -)( - 'c', - 'd' -); - -return trim(preg_replace_callback( - // sprintf replaces IGNORED_CHARS multiple times: for %s as well as %1$s (argument numbering) - // /[%s]*([^%1$s]+)/ results in /[IGNORED_CHARS]*([^IGNORED_CHARS]+)/ - sprintf('/[%s]*([^%1$s]+)/', self::IGNORED_CHARS), - function (array $term) use ($mode): string { - // query pieces have to bigger than one char, otherwise they are too expensive for the search - if (mb_strlen($term[1], 'UTF-8') > 1) { - // in boolean search mode '' (empty) means OR, '-' means NOT - return sprintf('%s%s ', $mode === 'AND' ? '+' : '', self::extractUmlauts($term[1])); - } - - return ''; - }, - $search -)); - -return trim(preg_replace_callback( -// sprintf replaces IGNORED_CHARS multiple times: for %s as well as %1$s (argument numbering) -// /[%s]*([^%1$s]+)/ results in /[IGNORED_CHARS]*([^IGNORED_CHARS]+)/ - sprintf('/[%s]*([^%1$s]+)/', self::IGNORED_CHARS), - function (array $term) use ($mode): string { - // query pieces have to bigger than one char, otherwise they are too expensive for the search - if (mb_strlen($term[1], 'UTF-8') > 1) { - // in boolean search mode '' (empty) means OR, '-' means NOT - return sprintf('%s%s ', $mode === 'AND' ? '+' : '', self::extractUmlauts($term[1])); - } - - return ''; - }, - $search -)); - -// PHP 8.0 named parameters. -array_fill_keys( - keys: range( - 1, - 12, - ), - value: true, -); - -array_fill_keys( - keys: range( - 1, - 12, - ), - value: true, -); - -// phpcs:set PSR2.Methods.FunctionCallSignature allowMultipleArguments true -array_fill_keys( - keys: range( - 1, - 12, - ), value: true, -); -// phpcs:set PSR2.Methods.FunctionCallSignature allowMultipleArguments false diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionCallSignatureUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionCallSignatureUnitTest.php deleted file mode 100644 index 1d87825..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionCallSignatureUnitTest.php +++ /dev/null @@ -1,94 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Tests\Methods; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class FunctionCallSignatureUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 18 => 3, - 21 => 1, - 48 => 1, - 87 => 1, - 90 => 1, - 91 => 1, - 103 => 1, - 111 => 1, - 117 => 4, - 123 => 1, - 127 => 1, - 131 => 1, - 136 => 1, - 143 => 1, - 148 => 1, - 152 => 1, - 156 => 1, - 160 => 1, - 165 => 1, - 170 => 1, - 175 => 1, - 178 => 2, - 186 => 1, - 187 => 1, - 194 => 3, - 199 => 1, - 200 => 2, - 202 => 1, - 203 => 1, - 210 => 2, - 211 => 1, - 212 => 2, - 217 => 1, - 218 => 1, - 227 => 1, - 228 => 1, - 233 => 1, - 234 => 1, - 242 => 1, - 243 => 1, - 256 => 1, - 257 => 1, - 258 => 1, - 263 => 1, - 264 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionClosingBraceUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionClosingBraceUnitTest.inc deleted file mode 100644 index 7bf667e..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionClosingBraceUnitTest.inc +++ /dev/null @@ -1,70 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Tests\Methods; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class FunctionClosingBraceUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 16 => 1, - 23 => 1, - 40 => 1, - 47 => 1, - 63 => 1, - 70 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/MethodDeclarationUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/MethodDeclarationUnitTest.inc deleted file mode 100644 index 21c0311..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/MethodDeclarationUnitTest.inc +++ /dev/null @@ -1,66 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Tests\Methods; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class MethodDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 9 => 1, - 11 => 1, - 13 => 1, - 15 => 3, - 24 => 1, - 34 => 1, - 36 => 1, - 38 => 1, - 40 => 3, - 50 => 1, - 52 => 1, - 54 => 1, - 56 => 3, - 63 => 2, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return [ - 5 => 1, - 21 => 1, - 30 => 1, - 46 => 1, - 63 => 1, - ]; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/NamespaceDeclarationUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/NamespaceDeclarationUnitTest.inc deleted file mode 100644 index 7033933..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/NamespaceDeclarationUnitTest.inc +++ /dev/null @@ -1,26 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Tests\Namespaces; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class NamespaceDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 6 => 1, - 9 => 1, - 17 => 1, - 19 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.1.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.1.inc deleted file mode 100644 index c4e83da..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.1.inc +++ /dev/null @@ -1,38 +0,0 @@ - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.2.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.2.inc.fixed deleted file mode 100644 index 6579613..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.2.inc.fixed +++ /dev/null @@ -1,27 +0,0 @@ - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.3.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.3.inc deleted file mode 100644 index 8b29095..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.3.inc +++ /dev/null @@ -1,16 +0,0 @@ - -

    diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.5.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.5.inc deleted file mode 100644 index 1fdaccd..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.5.inc +++ /dev/null @@ -1,47 +0,0 @@ - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.7.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.7.inc deleted file mode 100644 index dee5686..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.7.inc +++ /dev/null @@ -1 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Tests\Namespaces; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class UseDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'UseDeclarationUnitTest.2.inc': - return [ - 4 => 1, - 5 => 1, - 6 => 1, - 7 => 1, - 9 => 1, - 10 => 1, - 11 => 1, - 16 => 1, - ]; - case 'UseDeclarationUnitTest.3.inc': - return [ - 4 => 1, - 6 => 1, - ]; - case 'UseDeclarationUnitTest.5.inc': - return [ - 5 => 1, - 6 => 1, - 8 => 1, - 14 => 1, - 17 => 1, - 18 => 1, - 19 => 1, - 21 => 1, - 28 => 1, - 30 => 1, - 35 => 1, - ]; - case 'UseDeclarationUnitTest.10.inc': - case 'UseDeclarationUnitTest.11.inc': - case 'UseDeclarationUnitTest.12.inc': - case 'UseDeclarationUnitTest.13.inc': - case 'UseDeclarationUnitTest.14.inc': - case 'UseDeclarationUnitTest.16.inc': - case 'UseDeclarationUnitTest.17.inc': - return [2 => 1]; - case 'UseDeclarationUnitTest.15.inc': - return [ - 3 => 1, - 4 => 1, - 5 => 1, - ]; - default: - return []; - }//end switch - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/ruleset.xml b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/ruleset.xml deleted file mode 100644 index ba5bd4e..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/ruleset.xml +++ /dev/null @@ -1,218 +0,0 @@ - - - The PSR-2 coding standard. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - - - 0 - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - - - - - - - - - - - - - - - - - - - 0 - - - 0 - - - - - - - - - - - - - 0 - - - 0 - - - - - - - 0 - - - - - 0 - - - 0 - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Arrays/ArrayBracketSpacingStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Arrays/ArrayBracketSpacingStandard.xml deleted file mode 100644 index fc6ccbd..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Arrays/ArrayBracketSpacingStandard.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - ['bar']; -]]> - - - [ 'bar' ]; -]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Arrays/ArrayDeclarationStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Arrays/ArrayDeclarationStandard.xml deleted file mode 100644 index ce4b9ae..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Arrays/ArrayDeclarationStandard.xml +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - array keyword must be lowercase. - ]]> - - - - - - - - - - - array keyword. - ]]> - - - - 'value1', - 'key2' => 'value2', - ); - ]]> - - - 'value1', - 'key2' => 'value2', - ); - ]]> - - - - array keyword. The closing parenthesis must be aligned with the start of the array keyword. - ]]> - - - - 'key1' => 'value1', - 'key2' => 'value2', - ); - ]]> - - - 'key1' => 'value1', - 'key2' => 'value2', -); - ]]> - - - - - - - - => 'ValueTen', - 'keyTwenty' => 'ValueTwenty', - ); - ]]> - - - => 'ValueTen', - 'keyTwenty' => 'ValueTwenty', - ); - ]]> - - - - - - - - 'value1', - 'key2' => 'value2', - 'key3' => 'value3', - ); - ]]> - - - 'value1', - 'key2' => 'value2', - 'key3' => 'value3' - ); - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Classes/LowercaseClassKeywordsStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Classes/LowercaseClassKeywordsStandard.xml deleted file mode 100644 index 89fcb5d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Classes/LowercaseClassKeywordsStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - final class Foo extends Bar -{ -} -]]> - - - Final Class Foo Extends Bar -{ -} -]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Classes/SelfMemberReferenceStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Classes/SelfMemberReferenceStandard.xml deleted file mode 100644 index 59d193f..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Classes/SelfMemberReferenceStandard.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - self::foo(); -]]> - - - SELF::foo(); -]]> - - - - - ::foo(); -]]> - - - :: foo(); -]]> - - - - - self::bar(); - } -} -]]> - - - Foo -{ - public static function bar() - { - } - - public static function baz() - { - Foo::bar(); - } -} -]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Commenting/DocCommentAlignmentStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Commenting/DocCommentAlignmentStandard.xml deleted file mode 100644 index 414b89a..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Commenting/DocCommentAlignmentStandard.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - * @see foo() - */ -]]> - - - * @see foo() -*/ -]]> - - - - - @see foo() - */ -]]> - - - @see foo() - */ -]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Commenting/FunctionCommentThrowTagStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Commenting/FunctionCommentThrowTagStandard.xml deleted file mode 100644 index 81df2e3..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Commenting/FunctionCommentThrowTagStandard.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - @throws Exception all the time - * @return void - */ -function foo() -{ - throw new Exception('Danger!'); -} -]]> - - - - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/ControlStructures/ForEachLoopDeclarationStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/ControlStructures/ForEachLoopDeclarationStandard.xml deleted file mode 100644 index 87c6181..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/ControlStructures/ForEachLoopDeclarationStandard.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - $foo as $bar => $baz) { - echo $baz; -} -]]> - - - $foo as $bar=>$baz ) { - echo $baz; -} -]]> - - - - - as $bar => $baz) { - echo $baz; -} -]]> - - - AS $bar => $baz) { - echo $baz; -} -]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/ControlStructures/ForLoopDeclarationStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/ControlStructures/ForLoopDeclarationStandard.xml deleted file mode 100644 index bbc4392..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/ControlStructures/ForLoopDeclarationStandard.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - $i = 0; $i < 10; $i++) { - echo $i; -} -]]> - - - $i = 0; $i < 10; $i++ ) { - echo $i; -} -]]> - - - - - ; $i < 10; $i++) { - echo $i; -} -]]> - - - ; $i < 10 ; $i++) { - echo $i; -} -]]> - - - - - $i < 10; $i++) { - echo $i; -} -]]> - - - $i < 10;$i++) { - echo $i; -} -]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/ControlStructures/LowercaseDeclarationStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/ControlStructures/LowercaseDeclarationStandard.xml deleted file mode 100644 index 699f1f0..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/ControlStructures/LowercaseDeclarationStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - if ($foo) { - $bar = true; -} -]]> - - - IF ($foo) { - $bar = true; -} -]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Functions/FunctionDuplicateArgumentStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Functions/FunctionDuplicateArgumentStandard.xml deleted file mode 100644 index a890aba..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Functions/FunctionDuplicateArgumentStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - isset($foo)) { - echo $foo; -} -]]> - - - isSet($foo)) { - echo $foo; -} -]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Functions/LowercaseFunctionKeywordsStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Functions/LowercaseFunctionKeywordsStandard.xml deleted file mode 100644 index 46e8a8f..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Functions/LowercaseFunctionKeywordsStandard.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - function foo() -{ - return true; -} -]]> - - - FUNCTION foo() -{ - return true; -} -]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Scope/StaticThisUsageStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Scope/StaticThisUsageStandard.xml deleted file mode 100644 index 3c97f54..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Scope/StaticThisUsageStandard.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - static function bar() - { - return self::$staticMember; - } -} -]]> - - - static function bar() - { - return $this->$staticMember; - } -} -]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Strings/EchoedStringsStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Strings/EchoedStringsStandard.xml deleted file mode 100644 index 030f2a6..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Strings/EchoedStringsStandard.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - "Hello"; -]]> - - - ("Hello"); -]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/CastSpacingStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/CastSpacingStandard.xml deleted file mode 100644 index 0fb195c..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/CastSpacingStandard.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - int)'42'; -]]> - - - int )'42'; -]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/FunctionOpeningBraceStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/FunctionOpeningBraceStandard.xml deleted file mode 100644 index d2bc264..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/FunctionOpeningBraceStandard.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - { -} -]]> - - - { -} -]]> - - - - - return 42; -} -]]> - - - - return 42; -} -]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/LanguageConstructSpacingStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/LanguageConstructSpacingStandard.xml deleted file mode 100644 index 608bed0..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/LanguageConstructSpacingStandard.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - "hi"; -]]> - - - "hi"; -]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/ObjectOperatorSpacingStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/ObjectOperatorSpacingStandard.xml deleted file mode 100644 index c6194d7..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/ObjectOperatorSpacingStandard.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - ) should not have any space around it. - ]]> - - - - ->bar(); -]]> - - - -> bar(); -]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/ScopeKeywordSpacingStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/ScopeKeywordSpacingStandard.xml deleted file mode 100644 index 8cadf66..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/ScopeKeywordSpacingStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - static function foo() -{ -} -]]> - - - static function foo() -{ -} -]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/SemicolonSpacingStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/SemicolonSpacingStandard.xml deleted file mode 100644 index 7b22795..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/SemicolonSpacingStandard.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - ; -]]> - - - ; -]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Arrays/ArrayBracketSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Arrays/ArrayBracketSpacingSniff.php deleted file mode 100644 index ee63dea..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Arrays/ArrayBracketSpacingSniff.php +++ /dev/null @@ -1,95 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Arrays; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class ArrayBracketSpacingSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_OPEN_SQUARE_BRACKET, - T_CLOSE_SQUARE_BRACKET, - ]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being checked. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (($tokens[$stackPtr]['code'] === T_OPEN_SQUARE_BRACKET - && isset($tokens[$stackPtr]['bracket_closer']) === false) - || ($tokens[$stackPtr]['code'] === T_CLOSE_SQUARE_BRACKET - && isset($tokens[$stackPtr]['bracket_opener']) === false) - ) { - // Bow out for parse error/during live coding. - return; - } - - // Square brackets can not have a space before them. - $prevType = $tokens[($stackPtr - 1)]['code']; - if ($prevType === T_WHITESPACE) { - $nonSpace = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 2), null, true); - $expected = $tokens[$nonSpace]['content'].$tokens[$stackPtr]['content']; - $found = $phpcsFile->getTokensAsString($nonSpace, ($stackPtr - $nonSpace)).$tokens[$stackPtr]['content']; - $error = 'Space found before square bracket; expected "%s" but found "%s"'; - $data = [ - $expected, - $found, - ]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceBeforeBracket', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($stackPtr - 1), ''); - } - } - - // Open square brackets can't ever have spaces after them. - if ($tokens[$stackPtr]['code'] === T_OPEN_SQUARE_BRACKET) { - $nextType = $tokens[($stackPtr + 1)]['code']; - if ($nextType === T_WHITESPACE) { - $nonSpace = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 2), null, true); - $expected = $tokens[$stackPtr]['content'].$tokens[$nonSpace]['content']; - $found = $phpcsFile->getTokensAsString($stackPtr, ($nonSpace - $stackPtr + 1)); - $error = 'Space found after square bracket; expected "%s" but found "%s"'; - $data = [ - $expected, - $found, - ]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterBracket', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($stackPtr + 1), ''); - } - } - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php deleted file mode 100644 index 17991bd..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php +++ /dev/null @@ -1,894 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Arrays; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class ArrayDeclarationSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_ARRAY, - T_OPEN_SHORT_ARRAY, - ]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being checked. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if ($tokens[$stackPtr]['code'] === T_ARRAY) { - $phpcsFile->recordMetric($stackPtr, 'Short array syntax used', 'no'); - - // Array keyword should be lower case. - if ($tokens[$stackPtr]['content'] !== strtolower($tokens[$stackPtr]['content'])) { - if ($tokens[$stackPtr]['content'] === strtoupper($tokens[$stackPtr]['content'])) { - $phpcsFile->recordMetric($stackPtr, 'Array keyword case', 'upper'); - } else { - $phpcsFile->recordMetric($stackPtr, 'Array keyword case', 'mixed'); - } - - $error = 'Array keyword should be lower case; expected "array" but found "%s"'; - $data = [$tokens[$stackPtr]['content']]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NotLowerCase', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($stackPtr, 'array'); - } - } else { - $phpcsFile->recordMetric($stackPtr, 'Array keyword case', 'lower'); - } - - $arrayStart = $tokens[$stackPtr]['parenthesis_opener']; - if (isset($tokens[$arrayStart]['parenthesis_closer']) === false) { - return; - } - - $arrayEnd = $tokens[$arrayStart]['parenthesis_closer']; - - if ($arrayStart !== ($stackPtr + 1)) { - $error = 'There must be no space between the "array" keyword and the opening parenthesis'; - - $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), $arrayStart, true); - if (isset(Tokens::$commentTokens[$tokens[$next]['code']]) === true) { - // We don't have anywhere to put the comment, so don't attempt to fix it. - $phpcsFile->addError($error, $stackPtr, 'SpaceAfterKeyword'); - } else { - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterKeyword'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($stackPtr + 1); $i < $arrayStart; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } - } - } else { - $phpcsFile->recordMetric($stackPtr, 'Short array syntax used', 'yes'); - $arrayStart = $stackPtr; - $arrayEnd = $tokens[$stackPtr]['bracket_closer']; - }//end if - - // Check for empty arrays. - $content = $phpcsFile->findNext(T_WHITESPACE, ($arrayStart + 1), ($arrayEnd + 1), true); - if ($content === $arrayEnd) { - // Empty array, but if the brackets aren't together, there's a problem. - if (($arrayEnd - $arrayStart) !== 1) { - $error = 'Empty array declaration must have no space between the parentheses'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceInEmptyArray'); - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($arrayStart + 1); $i < $arrayEnd; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } - - // We can return here because there is nothing else to check. All code - // below can assume that the array is not empty. - return; - } - - if ($tokens[$arrayStart]['line'] === $tokens[$arrayEnd]['line']) { - $this->processSingleLineArray($phpcsFile, $stackPtr, $arrayStart, $arrayEnd); - } else { - $this->processMultiLineArray($phpcsFile, $stackPtr, $arrayStart, $arrayEnd); - } - - }//end process() - - - /** - * Processes a single-line array definition. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being checked. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * @param int $arrayStart The token that starts the array definition. - * @param int $arrayEnd The token that ends the array definition. - * - * @return void - */ - public function processSingleLineArray($phpcsFile, $stackPtr, $arrayStart, $arrayEnd) - { - $tokens = $phpcsFile->getTokens(); - - // Check if there are multiple values. If so, then it has to be multiple lines - // unless it is contained inside a function call or condition. - $valueCount = 0; - $commas = []; - for ($i = ($arrayStart + 1); $i < $arrayEnd; $i++) { - // Skip bracketed statements, like function calls. - if ($tokens[$i]['code'] === T_OPEN_PARENTHESIS) { - $i = $tokens[$i]['parenthesis_closer']; - continue; - } - - if ($tokens[$i]['code'] === T_COMMA) { - // Before counting this comma, make sure we are not - // at the end of the array. - $next = $phpcsFile->findNext(T_WHITESPACE, ($i + 1), $arrayEnd, true); - if ($next !== false) { - $valueCount++; - $commas[] = $i; - } else { - // There is a comma at the end of a single line array. - $error = 'Comma not allowed after last value in single-line array declaration'; - $fix = $phpcsFile->addFixableError($error, $i, 'CommaAfterLast'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($i, ''); - } - } - } - }//end for - - // Now check each of the double arrows (if any). - $nextArrow = $arrayStart; - while (($nextArrow = $phpcsFile->findNext(T_DOUBLE_ARROW, ($nextArrow + 1), $arrayEnd)) !== false) { - if ($tokens[($nextArrow - 1)]['code'] !== T_WHITESPACE) { - $content = $tokens[($nextArrow - 1)]['content']; - $error = 'Expected 1 space between "%s" and double arrow; 0 found'; - $data = [$content]; - $fix = $phpcsFile->addFixableError($error, $nextArrow, 'NoSpaceBeforeDoubleArrow', $data); - if ($fix === true) { - $phpcsFile->fixer->addContentBefore($nextArrow, ' '); - } - } else { - $spaceLength = $tokens[($nextArrow - 1)]['length']; - if ($spaceLength !== 1) { - $content = $tokens[($nextArrow - 2)]['content']; - $error = 'Expected 1 space between "%s" and double arrow; %s found'; - $data = [ - $content, - $spaceLength, - ]; - - $fix = $phpcsFile->addFixableError($error, $nextArrow, 'SpaceBeforeDoubleArrow', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($nextArrow - 1), ' '); - } - } - }//end if - - if ($tokens[($nextArrow + 1)]['code'] !== T_WHITESPACE) { - $content = $tokens[($nextArrow + 1)]['content']; - $error = 'Expected 1 space between double arrow and "%s"; 0 found'; - $data = [$content]; - $fix = $phpcsFile->addFixableError($error, $nextArrow, 'NoSpaceAfterDoubleArrow', $data); - if ($fix === true) { - $phpcsFile->fixer->addContent($nextArrow, ' '); - } - } else { - $spaceLength = $tokens[($nextArrow + 1)]['length']; - if ($spaceLength !== 1) { - $content = $tokens[($nextArrow + 2)]['content']; - $error = 'Expected 1 space between double arrow and "%s"; %s found'; - $data = [ - $content, - $spaceLength, - ]; - - $fix = $phpcsFile->addFixableError($error, $nextArrow, 'SpaceAfterDoubleArrow', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($nextArrow + 1), ' '); - } - } - }//end if - }//end while - - if ($valueCount > 0) { - $nestedParenthesis = false; - if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) { - $nested = $tokens[$stackPtr]['nested_parenthesis']; - $nestedParenthesis = array_pop($nested); - } - - if ($nestedParenthesis === false - || $tokens[$nestedParenthesis]['line'] !== $tokens[$stackPtr]['line'] - ) { - $error = 'Array with multiple values cannot be declared on a single line'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SingleLineNotAllowed'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->addNewline($arrayStart); - - if ($tokens[($arrayEnd - 1)]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->replaceToken(($arrayEnd - 1), $phpcsFile->eolChar); - } else { - $phpcsFile->fixer->addNewlineBefore($arrayEnd); - } - - $phpcsFile->fixer->endChangeset(); - } - - return; - } - - // We have a multiple value array that is inside a condition or - // function. Check its spacing is correct. - foreach ($commas as $comma) { - if ($tokens[($comma + 1)]['code'] !== T_WHITESPACE) { - $content = $tokens[($comma + 1)]['content']; - $error = 'Expected 1 space between comma and "%s"; 0 found'; - $data = [$content]; - $fix = $phpcsFile->addFixableError($error, $comma, 'NoSpaceAfterComma', $data); - if ($fix === true) { - $phpcsFile->fixer->addContent($comma, ' '); - } - } else { - $spaceLength = $tokens[($comma + 1)]['length']; - if ($spaceLength !== 1) { - $content = $tokens[($comma + 2)]['content']; - $error = 'Expected 1 space between comma and "%s"; %s found'; - $data = [ - $content, - $spaceLength, - ]; - - $fix = $phpcsFile->addFixableError($error, $comma, 'SpaceAfterComma', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($comma + 1), ' '); - } - } - }//end if - - if ($tokens[($comma - 1)]['code'] === T_WHITESPACE) { - $content = $tokens[($comma - 2)]['content']; - $spaceLength = $tokens[($comma - 1)]['length']; - $error = 'Expected 0 spaces between "%s" and comma; %s found'; - $data = [ - $content, - $spaceLength, - ]; - - $fix = $phpcsFile->addFixableError($error, $comma, 'SpaceBeforeComma', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($comma - 1), ''); - } - } - }//end foreach - }//end if - - }//end processSingleLineArray() - - - /** - * Processes a multi-line array definition. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being checked. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * @param int $arrayStart The token that starts the array definition. - * @param int $arrayEnd The token that ends the array definition. - * - * @return void - */ - public function processMultiLineArray($phpcsFile, $stackPtr, $arrayStart, $arrayEnd) - { - $tokens = $phpcsFile->getTokens(); - $keywordStart = $tokens[$stackPtr]['column']; - - // Check the closing bracket is on a new line. - $lastContent = $phpcsFile->findPrevious(T_WHITESPACE, ($arrayEnd - 1), $arrayStart, true); - if ($tokens[$lastContent]['line'] === $tokens[$arrayEnd]['line']) { - $error = 'Closing parenthesis of array declaration must be on a new line'; - $fix = $phpcsFile->addFixableError($error, $arrayEnd, 'CloseBraceNewLine'); - if ($fix === true) { - $phpcsFile->fixer->addNewlineBefore($arrayEnd); - } - } else if ($tokens[$arrayEnd]['column'] !== $keywordStart) { - // Check the closing bracket is lined up under the "a" in array. - $expected = ($keywordStart - 1); - $found = ($tokens[$arrayEnd]['column'] - 1); - $error = 'Closing parenthesis not aligned correctly; expected %s space(s) but found %s'; - $data = [ - $expected, - $found, - ]; - - $fix = $phpcsFile->addFixableError($error, $arrayEnd, 'CloseBraceNotAligned', $data); - if ($fix === true) { - if ($found === 0) { - $phpcsFile->fixer->addContent(($arrayEnd - 1), str_repeat(' ', $expected)); - } else { - $phpcsFile->fixer->replaceToken(($arrayEnd - 1), str_repeat(' ', $expected)); - } - } - }//end if - - $keyUsed = false; - $singleUsed = false; - $indices = []; - $maxLength = 0; - - if ($tokens[$stackPtr]['code'] === T_ARRAY) { - $lastToken = $tokens[$stackPtr]['parenthesis_opener']; - } else { - $lastToken = $stackPtr; - } - - // Find all the double arrows that reside in this scope. - for ($nextToken = ($stackPtr + 1); $nextToken < $arrayEnd; $nextToken++) { - // Skip bracketed statements, like function calls. - if ($tokens[$nextToken]['code'] === T_OPEN_PARENTHESIS - && (isset($tokens[$nextToken]['parenthesis_owner']) === false - || $tokens[$nextToken]['parenthesis_owner'] !== $stackPtr) - ) { - $nextToken = $tokens[$nextToken]['parenthesis_closer']; - continue; - } - - if ($tokens[$nextToken]['code'] === T_ARRAY - || $tokens[$nextToken]['code'] === T_OPEN_SHORT_ARRAY - || $tokens[$nextToken]['code'] === T_CLOSURE - || $tokens[$nextToken]['code'] === T_FN - ) { - // Let subsequent calls of this test handle nested arrays. - if ($tokens[$lastToken]['code'] !== T_DOUBLE_ARROW) { - $indices[] = ['value' => $nextToken]; - $lastToken = $nextToken; - } - - if ($tokens[$nextToken]['code'] === T_ARRAY) { - $nextToken = $tokens[$tokens[$nextToken]['parenthesis_opener']]['parenthesis_closer']; - } else if ($tokens[$nextToken]['code'] === T_OPEN_SHORT_ARRAY) { - $nextToken = $tokens[$nextToken]['bracket_closer']; - } else { - // T_CLOSURE. - $nextToken = $tokens[$nextToken]['scope_closer']; - } - - $nextToken = $phpcsFile->findNext(T_WHITESPACE, ($nextToken + 1), null, true); - if ($tokens[$nextToken]['code'] !== T_COMMA) { - $nextToken--; - } else { - $lastToken = $nextToken; - } - - continue; - }//end if - - if ($tokens[$nextToken]['code'] !== T_DOUBLE_ARROW && $tokens[$nextToken]['code'] !== T_COMMA) { - continue; - } - - $currentEntry = []; - - if ($tokens[$nextToken]['code'] === T_COMMA) { - $stackPtrCount = 0; - if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) { - $stackPtrCount = count($tokens[$stackPtr]['nested_parenthesis']); - } - - $commaCount = 0; - if (isset($tokens[$nextToken]['nested_parenthesis']) === true) { - $commaCount = count($tokens[$nextToken]['nested_parenthesis']); - if ($tokens[$stackPtr]['code'] === T_ARRAY) { - // Remove parenthesis that are used to define the array. - $commaCount--; - } - } - - if ($commaCount > $stackPtrCount) { - // This comma is inside more parenthesis than the ARRAY keyword, - // then there it is actually a comma used to separate arguments - // in a function call. - continue; - } - - if ($keyUsed === true && $tokens[$lastToken]['code'] === T_COMMA) { - $error = 'No key specified for array entry; first entry specifies key'; - $phpcsFile->addError($error, $nextToken, 'NoKeySpecified'); - return; - } - - if ($keyUsed === false) { - if ($tokens[($nextToken - 1)]['code'] === T_WHITESPACE) { - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($nextToken - 1), null, true); - if (($tokens[$prev]['code'] !== T_END_HEREDOC - && $tokens[$prev]['code'] !== T_END_NOWDOC) - || $tokens[($nextToken - 1)]['line'] === $tokens[$nextToken]['line'] - ) { - if ($tokens[($nextToken - 1)]['content'] === $phpcsFile->eolChar) { - $spaceLength = 'newline'; - } else { - $spaceLength = $tokens[($nextToken - 1)]['length']; - } - - $error = 'Expected 0 spaces before comma; %s found'; - $data = [$spaceLength]; - - // The error is only fixable if there is only whitespace between the tokens. - if ($prev === $phpcsFile->findPrevious(T_WHITESPACE, ($nextToken - 1), null, true)) { - $fix = $phpcsFile->addFixableError($error, $nextToken, 'SpaceBeforeComma', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($nextToken - 1), ''); - } - } else { - $phpcsFile->addError($error, $nextToken, 'SpaceBeforeComma', $data); - } - } - }//end if - - $valueContent = $phpcsFile->findNext( - Tokens::$emptyTokens, - ($lastToken + 1), - $nextToken, - true - ); - - $indices[] = ['value' => $valueContent]; - $singleUsed = true; - }//end if - - $lastToken = $nextToken; - continue; - }//end if - - if ($tokens[$nextToken]['code'] === T_DOUBLE_ARROW) { - if ($singleUsed === true) { - $error = 'Key specified for array entry; first entry has no key'; - $phpcsFile->addError($error, $nextToken, 'KeySpecified'); - return; - } - - $currentEntry['arrow'] = $nextToken; - $keyUsed = true; - - // Find the start of index that uses this double arrow. - $indexEnd = $phpcsFile->findPrevious(T_WHITESPACE, ($nextToken - 1), $arrayStart, true); - $indexStart = $phpcsFile->findStartOfStatement($indexEnd); - - if ($indexStart === $indexEnd) { - $currentEntry['index'] = $indexEnd; - $currentEntry['index_content'] = $tokens[$indexEnd]['content']; - $currentEntry['index_length'] = $tokens[$indexEnd]['length']; - } else { - $currentEntry['index'] = $indexStart; - $currentEntry['index_content'] = ''; - $currentEntry['index_length'] = 0; - for ($i = $indexStart; $i <= $indexEnd; $i++) { - $currentEntry['index_content'] .= $tokens[$i]['content']; - $currentEntry['index_length'] += $tokens[$i]['length']; - } - } - - if ($maxLength < $currentEntry['index_length']) { - $maxLength = $currentEntry['index_length']; - } - - // Find the value of this index. - $nextContent = $phpcsFile->findNext( - Tokens::$emptyTokens, - ($nextToken + 1), - $arrayEnd, - true - ); - - $currentEntry['value'] = $nextContent; - $indices[] = $currentEntry; - $lastToken = $nextToken; - }//end if - }//end for - - // Check for multi-line arrays that should be single-line. - $singleValue = false; - - if (empty($indices) === true) { - $singleValue = true; - } else if (count($indices) === 1 && $tokens[$lastToken]['code'] === T_COMMA) { - // There may be another array value without a comma. - $exclude = Tokens::$emptyTokens; - $exclude[] = T_COMMA; - $nextContent = $phpcsFile->findNext($exclude, ($indices[0]['value'] + 1), $arrayEnd, true); - if ($nextContent === false) { - $singleValue = true; - } - } - - if ($singleValue === true) { - // Before we complain, make sure the single value isn't a here/nowdoc. - $next = $phpcsFile->findNext(Tokens::$heredocTokens, ($arrayStart + 1), ($arrayEnd - 1)); - if ($next === false) { - // Array cannot be empty, so this is a multi-line array with - // a single value. It should be defined on single line. - $error = 'Multi-line array contains a single value; use single-line array instead'; - $errorCode = 'MultiLineNotAllowed'; - - $find = Tokens::$phpcsCommentTokens; - $find[] = T_COMMENT; - $comment = $phpcsFile->findNext($find, ($arrayStart + 1), $arrayEnd); - if ($comment === false) { - $fix = $phpcsFile->addFixableError($error, $stackPtr, $errorCode); - } else { - $fix = false; - $phpcsFile->addError($error, $stackPtr, $errorCode); - } - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($arrayStart + 1); $i < $arrayEnd; $i++) { - if ($tokens[$i]['code'] !== T_WHITESPACE) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - for ($i = ($arrayEnd - 1); $i > $arrayStart; $i--) { - if ($tokens[$i]['code'] !== T_WHITESPACE) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - - return; - }//end if - }//end if - - /* - This section checks for arrays that don't specify keys. - - Arrays such as: - array( - 'aaa', - 'bbb', - 'd', - ); - */ - - if ($keyUsed === false && empty($indices) === false) { - $count = count($indices); - $lastIndex = $indices[($count - 1)]['value']; - - $trailingContent = $phpcsFile->findPrevious( - Tokens::$emptyTokens, - ($arrayEnd - 1), - $lastIndex, - true - ); - - if ($tokens[$trailingContent]['code'] !== T_COMMA) { - $phpcsFile->recordMetric($stackPtr, 'Array end comma', 'no'); - $error = 'Comma required after last value in array declaration'; - $fix = $phpcsFile->addFixableError($error, $trailingContent, 'NoCommaAfterLast'); - if ($fix === true) { - $phpcsFile->fixer->addContent($trailingContent, ','); - } - } else { - $phpcsFile->recordMetric($stackPtr, 'Array end comma', 'yes'); - } - - foreach ($indices as $valuePosition => $value) { - if (empty($value['value']) === true) { - // Array was malformed and we couldn't figure out - // the array value correctly, so we have to ignore it. - // Other parts of this sniff will correct the error. - continue; - } - - $valuePointer = $value['value']; - - $ignoreTokens = [ - T_WHITESPACE => T_WHITESPACE, - T_COMMA => T_COMMA, - ]; - $ignoreTokens += Tokens::$castTokens; - - if ($tokens[$valuePointer]['code'] === T_CLOSURE - || $tokens[$valuePointer]['code'] === T_FN - ) { - $ignoreTokens += [T_STATIC => T_STATIC]; - } - - $previous = $phpcsFile->findPrevious($ignoreTokens, ($valuePointer - 1), ($arrayStart + 1), true); - if ($previous === false) { - $previous = $stackPtr; - } - - $previousIsWhitespace = $tokens[($valuePointer - 1)]['code'] === T_WHITESPACE; - if ($tokens[$previous]['line'] === $tokens[$valuePointer]['line']) { - $error = 'Each value in a multi-line array must be on a new line'; - if ($valuePosition === 0) { - $error = 'The first value in a multi-value array must be on a new line'; - } - - $fix = $phpcsFile->addFixableError($error, $valuePointer, 'ValueNoNewline'); - if ($fix === true) { - if ($previousIsWhitespace === true) { - $phpcsFile->fixer->replaceToken(($valuePointer - 1), $phpcsFile->eolChar); - } else { - $phpcsFile->fixer->addNewlineBefore($valuePointer); - } - } - } else if ($previousIsWhitespace === true) { - $expected = $keywordStart; - - $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $valuePointer, true); - $found = ($tokens[$first]['column'] - 1); - if ($found !== $expected) { - $error = 'Array value not aligned correctly; expected %s spaces but found %s'; - $data = [ - $expected, - $found, - ]; - - $fix = $phpcsFile->addFixableError($error, $first, 'ValueNotAligned', $data); - if ($fix === true) { - if ($found === 0) { - $phpcsFile->fixer->addContent(($first - 1), str_repeat(' ', $expected)); - } else { - $phpcsFile->fixer->replaceToken(($first - 1), str_repeat(' ', $expected)); - } - } - } - }//end if - }//end foreach - }//end if - - /* - Below the actual indentation of the array is checked. - Errors will be thrown when a key is not aligned, when - a double arrow is not aligned, and when a value is not - aligned correctly. - If an error is found in one of the above areas, then errors - are not reported for the rest of the line to avoid reporting - spaces and columns incorrectly. Often fixing the first - problem will fix the other 2 anyway. - - For example: - - $a = array( - 'index' => '2', - ); - - or - - $a = [ - 'index' => '2', - ]; - - In this array, the double arrow is indented too far, but this - will also cause an error in the value's alignment. If the arrow were - to be moved back one space however, then both errors would be fixed. - */ - - $indicesStart = ($keywordStart + 1); - foreach ($indices as $valuePosition => $index) { - $valuePointer = $index['value']; - if ($valuePointer === false) { - // Syntax error or live coding. - continue; - } - - if (isset($index['index']) === false) { - // Array value only. - continue; - } - - $indexPointer = $index['index']; - $indexLine = $tokens[$indexPointer]['line']; - - $previous = $phpcsFile->findPrevious([T_WHITESPACE, T_COMMA], ($indexPointer - 1), ($arrayStart + 1), true); - if ($previous === false) { - $previous = $stackPtr; - } - - if ($tokens[$previous]['line'] === $indexLine) { - $error = 'Each index in a multi-line array must be on a new line'; - if ($valuePosition === 0) { - $error = 'The first index in a multi-value array must be on a new line'; - } - - $fix = $phpcsFile->addFixableError($error, $indexPointer, 'IndexNoNewline'); - if ($fix === true) { - if ($tokens[($indexPointer - 1)]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->replaceToken(($indexPointer - 1), $phpcsFile->eolChar); - } else { - $phpcsFile->fixer->addNewlineBefore($indexPointer); - } - } - - continue; - } - - if ($tokens[$indexPointer]['column'] !== $indicesStart && ($indexPointer - 1) !== $arrayStart) { - $expected = ($indicesStart - 1); - $found = ($tokens[$indexPointer]['column'] - 1); - $error = 'Array key not aligned correctly; expected %s spaces but found %s'; - $data = [ - $expected, - $found, - ]; - - $fix = $phpcsFile->addFixableError($error, $indexPointer, 'KeyNotAligned', $data); - if ($fix === true) { - if ($found === 0 || $tokens[($indexPointer - 1)]['code'] !== T_WHITESPACE) { - $phpcsFile->fixer->addContent(($indexPointer - 1), str_repeat(' ', $expected)); - } else { - $phpcsFile->fixer->replaceToken(($indexPointer - 1), str_repeat(' ', $expected)); - } - } - } - - $arrowStart = ($tokens[$indexPointer]['column'] + $maxLength + 1); - if ($tokens[$index['arrow']]['column'] !== $arrowStart) { - $expected = ($arrowStart - ($index['index_length'] + $tokens[$indexPointer]['column'])); - $found = ($tokens[$index['arrow']]['column'] - ($index['index_length'] + $tokens[$indexPointer]['column'])); - $error = 'Array double arrow not aligned correctly; expected %s space(s) but found %s'; - $data = [ - $expected, - $found, - ]; - - $fix = $phpcsFile->addFixableError($error, $index['arrow'], 'DoubleArrowNotAligned', $data); - if ($fix === true) { - if ($found === 0) { - $phpcsFile->fixer->addContent(($index['arrow'] - 1), str_repeat(' ', $expected)); - } else { - $phpcsFile->fixer->replaceToken(($index['arrow'] - 1), str_repeat(' ', $expected)); - } - } - - continue; - } - - $valueStart = ($arrowStart + 3); - if ($tokens[$valuePointer]['column'] !== $valueStart) { - $expected = ($valueStart - ($tokens[$index['arrow']]['length'] + $tokens[$index['arrow']]['column'])); - $found = ($tokens[$valuePointer]['column'] - ($tokens[$index['arrow']]['length'] + $tokens[$index['arrow']]['column'])); - if ($found < 0) { - $found = 'newline'; - } - - $error = 'Array value not aligned correctly; expected %s space(s) but found %s'; - $data = [ - $expected, - $found, - ]; - - $fix = $phpcsFile->addFixableError($error, $index['arrow'], 'ValueNotAligned', $data); - if ($fix === true) { - if ($found === 'newline') { - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($valuePointer - 1), null, true); - $phpcsFile->fixer->beginChangeset(); - for ($i = ($prev + 1); $i < $valuePointer; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->replaceToken(($valuePointer - 1), str_repeat(' ', $expected)); - $phpcsFile->fixer->endChangeset(); - } else if ($found === 0) { - $phpcsFile->fixer->addContent(($valuePointer - 1), str_repeat(' ', $expected)); - } else { - $phpcsFile->fixer->replaceToken(($valuePointer - 1), str_repeat(' ', $expected)); - } - } - }//end if - - // Check each line ends in a comma. - $valueStart = $valuePointer; - $nextComma = false; - - $end = $phpcsFile->findEndOfStatement($valueStart); - if ($end === false) { - $valueEnd = $valueStart; - } else if ($tokens[$end]['code'] === T_COMMA) { - $valueEnd = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($end - 1), $valueStart, true); - $nextComma = $end; - } else { - $valueEnd = $end; - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($end + 1), $arrayEnd, true); - if ($next !== false && $tokens[$next]['code'] === T_COMMA) { - $nextComma = $next; - } - } - - $valueLine = $tokens[$valueEnd]['line']; - if ($tokens[$valueEnd]['code'] === T_END_HEREDOC || $tokens[$valueEnd]['code'] === T_END_NOWDOC) { - $valueLine++; - } - - if ($nextComma === false || ($tokens[$nextComma]['line'] !== $valueLine)) { - $error = 'Each line in an array declaration must end in a comma'; - $fix = $phpcsFile->addFixableError($error, $valuePointer, 'NoComma'); - - if ($fix === true) { - // Find the end of the line and put a comma there. - for ($i = ($valuePointer + 1); $i <= $arrayEnd; $i++) { - if ($tokens[$i]['line'] > $valueLine) { - break; - } - } - - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->addContentBefore(($i - 1), ','); - if ($nextComma !== false) { - $phpcsFile->fixer->replaceToken($nextComma, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - }//end if - - // Check that there is no space before the comma. - if ($nextComma !== false && $tokens[($nextComma - 1)]['code'] === T_WHITESPACE) { - // Here/nowdoc closing tags must have the comma on the next line. - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($nextComma - 1), null, true); - if ($tokens[$prev]['code'] !== T_END_HEREDOC && $tokens[$prev]['code'] !== T_END_NOWDOC) { - $content = $tokens[($nextComma - 2)]['content']; - $spaceLength = $tokens[($nextComma - 1)]['length']; - $error = 'Expected 0 spaces between "%s" and comma; %s found'; - $data = [ - $content, - $spaceLength, - ]; - - $fix = $phpcsFile->addFixableError($error, $nextComma, 'SpaceBeforeComma', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($nextComma - 1), ''); - } - } - } - }//end foreach - - }//end processMultiLineArray() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionClosingBraceSpaceSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionClosingBraceSpaceSniff.php deleted file mode 100644 index a9a55fa..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionClosingBraceSpaceSniff.php +++ /dev/null @@ -1,134 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class ClassDefinitionClosingBraceSpaceSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['CSS']; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return int[] - */ - public function register() - { - return [T_CLOSE_CURLY_BRACKET]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $next = $stackPtr; - while (true) { - $next = $phpcsFile->findNext(T_WHITESPACE, ($next + 1), null, true); - if ($next === false) { - return; - } - - if (isset(Tokens::$emptyTokens[$tokens[$next]['code']]) === true - && $tokens[$next]['line'] === $tokens[$stackPtr]['line'] - ) { - // Trailing comment. - continue; - } - - break; - } - - if ($tokens[$next]['code'] !== T_CLOSE_TAG) { - $found = (($tokens[$next]['line'] - $tokens[$stackPtr]['line']) - 1); - if ($found !== 1) { - $error = 'Expected one blank line after closing brace of class definition; %s found'; - $data = [max(0, $found)]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingAfterClose', $data); - - if ($fix === true) { - $firstOnLine = $next; - while ($tokens[$firstOnLine]['column'] !== 1) { - --$firstOnLine; - } - - if ($found < 0) { - // Next statement on same line as the closing brace. - $phpcsFile->fixer->addContentBefore($next, $phpcsFile->eolChar.$phpcsFile->eolChar); - } else if ($found === 0) { - // Next statement on next line, no blank line. - $phpcsFile->fixer->addContentBefore($firstOnLine, $phpcsFile->eolChar); - } else { - // Too many blank lines. - $phpcsFile->fixer->beginChangeset(); - for ($i = ($firstOnLine - 1); $i > $stackPtr; $i--) { - if ($tokens[$i]['code'] !== T_WHITESPACE) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->addContentBefore($firstOnLine, $phpcsFile->eolChar.$phpcsFile->eolChar); - $phpcsFile->fixer->endChangeset(); - } - }//end if - }//end if - }//end if - - // Ignore nested style definitions from here on. The spacing before the closing brace - // (a single blank line) will be enforced by the above check, which ensures there is a - // blank line after the last nested class. - $found = $phpcsFile->findPrevious( - T_CLOSE_CURLY_BRACKET, - ($stackPtr - 1), - $tokens[$stackPtr]['bracket_opener'] - ); - - if ($found !== false) { - return; - } - - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if ($prev === false) { - return; - } - - if ($tokens[$prev]['line'] === $tokens[$stackPtr]['line']) { - $error = 'Closing brace of class definition must be on new line'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'ContentBeforeClose'); - if ($fix === true) { - $phpcsFile->fixer->addNewlineBefore($stackPtr); - } - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionNameSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionNameSpacingSniff.php deleted file mode 100644 index 4b7efd9..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionNameSpacingSniff.php +++ /dev/null @@ -1,111 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class ClassDefinitionNameSpacingSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['CSS']; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return int[] - */ - public function register() - { - return [T_OPEN_CURLY_BRACKET]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]['bracket_closer']) === false) { - // Syntax error or live coding, bow out. - return; - } - - // Do not check nested style definitions as, for example, in @media style rules. - $nested = $phpcsFile->findNext(T_OPEN_CURLY_BRACKET, ($stackPtr + 1), $tokens[$stackPtr]['bracket_closer']); - if ($nested !== false) { - return; - } - - // Find the first blank line before this opening brace, unless we get - // to another style definition, comment or the start of the file. - $endTokens = [ - T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET, - T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET, - T_OPEN_TAG => T_OPEN_TAG, - ]; - $endTokens += Tokens::$commentTokens; - - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - - $foundContent = false; - $currentLine = $tokens[$prev]['line']; - for ($i = ($stackPtr - 1); $i >= 0; $i--) { - if (isset($endTokens[$tokens[$i]['code']]) === true) { - break; - } - - if ($tokens[$i]['line'] === $currentLine) { - if ($tokens[$i]['code'] !== T_WHITESPACE) { - $foundContent = true; - } - - continue; - } - - // We changed lines. - if ($foundContent === false) { - // Before we throw an error, make sure we are not looking - // at a gap before the style definition. - $prev = $phpcsFile->findPrevious(T_WHITESPACE, $i, null, true); - if ($prev !== false - && isset($endTokens[$tokens[$prev]['code']]) === false - ) { - $error = 'Blank lines are not allowed between class names'; - $phpcsFile->addError($error, ($i + 1), 'BlankLinesFound'); - } - - break; - } - - $foundContent = false; - $currentLine = $tokens[$i]['line']; - }//end for - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionOpeningBraceSpaceSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionOpeningBraceSpaceSniff.php deleted file mode 100644 index e56dad7..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionOpeningBraceSpaceSniff.php +++ /dev/null @@ -1,176 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class ClassDefinitionOpeningBraceSpaceSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['CSS']; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return int[] - */ - public function register() - { - return [T_OPEN_CURLY_BRACKET]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $prevNonWhitespace = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); - - if ($prevNonWhitespace !== false) { - $length = 0; - if ($tokens[$stackPtr]['line'] !== $tokens[$prevNonWhitespace]['line']) { - $length = 'newline'; - } else if ($tokens[($stackPtr - 1)]['code'] === T_WHITESPACE) { - if (strpos($tokens[($stackPtr - 1)]['content'], "\t") !== false) { - $length = 'tab'; - } else { - $length = $tokens[($stackPtr - 1)]['length']; - } - } - - if ($length === 0) { - $error = 'Expected 1 space before opening brace of class definition; 0 found'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoneBefore'); - if ($fix === true) { - $phpcsFile->fixer->addContentBefore($stackPtr, ' '); - } - } else if ($length !== 1) { - $error = 'Expected 1 space before opening brace of class definition; %s found'; - $data = [$length]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Before', $data); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - - for ($i = ($stackPtr - 1); $i > $prevNonWhitespace; $i--) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->addContentBefore($stackPtr, ' '); - $phpcsFile->fixer->endChangeset(); - } - }//end if - }//end if - - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($nextNonEmpty === false) { - return; - } - - if ($tokens[$nextNonEmpty]['line'] === $tokens[$stackPtr]['line']) { - $error = 'Opening brace should be the last content on the line'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'ContentBefore'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->addNewline($stackPtr); - - // Remove potentially left over trailing whitespace. - if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->replaceToken(($stackPtr + 1), ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } else { - if (isset($tokens[$stackPtr]['bracket_closer']) === false) { - // Syntax error or live coding, bow out. - return; - } - - // Check for nested class definitions. - $found = $phpcsFile->findNext( - T_OPEN_CURLY_BRACKET, - ($stackPtr + 1), - $tokens[$stackPtr]['bracket_closer'] - ); - - if ($found === false) { - // Not nested. - return; - } - - $lastOnLine = $stackPtr; - for ($lastOnLine; $lastOnLine < $tokens[$stackPtr]['bracket_closer']; $lastOnLine++) { - if ($tokens[$lastOnLine]['line'] !== $tokens[($lastOnLine + 1)]['line']) { - break; - } - } - - $nextNonWhiteSpace = $phpcsFile->findNext(T_WHITESPACE, ($lastOnLine + 1), null, true); - if ($nextNonWhiteSpace === false) { - return; - } - - $foundLines = ($tokens[$nextNonWhiteSpace]['line'] - $tokens[$stackPtr]['line'] - 1); - if ($foundLines !== 1) { - $error = 'Expected 1 blank line after opening brace of nesting class definition; %s found'; - $data = [max(0, $foundLines)]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'AfterNesting', $data); - - if ($fix === true) { - $firstOnNextLine = $nextNonWhiteSpace; - while ($tokens[$firstOnNextLine]['column'] !== 1) { - --$firstOnNextLine; - } - - if ($found < 0) { - // First statement on same line as the opening brace. - $phpcsFile->fixer->addContentBefore($nextNonWhiteSpace, $phpcsFile->eolChar.$phpcsFile->eolChar); - } else if ($found === 0) { - // Next statement on next line, no blank line. - $phpcsFile->fixer->addNewlineBefore($firstOnNextLine); - } else { - // Too many blank lines. - $phpcsFile->fixer->beginChangeset(); - for ($i = ($firstOnNextLine - 1); $i > $stackPtr; $i--) { - if ($tokens[$i]['code'] !== T_WHITESPACE) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->addContentBefore($firstOnNextLine, $phpcsFile->eolChar.$phpcsFile->eolChar); - $phpcsFile->fixer->endChangeset(); - } - }//end if - }//end if - }//end if - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ColonSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ColonSpacingSniff.php deleted file mode 100644 index 8548a72..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ColonSpacingSniff.php +++ /dev/null @@ -1,107 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class ColonSpacingSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['CSS']; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return int[] - */ - public function register() - { - return [T_COLON]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if ($tokens[$prev]['code'] !== T_STYLE) { - // The colon is not part of a style definition. - return; - } - - if ($tokens[$prev]['content'] === 'progid') { - // Special case for IE filters. - return; - } - - if ($tokens[($stackPtr - 1)]['code'] === T_WHITESPACE) { - $error = 'There must be no space before a colon in a style definition'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Before'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($stackPtr - 1), ''); - } - } - - $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($tokens[$next]['code'] === T_SEMICOLON || $tokens[$next]['code'] === T_STYLE) { - // Empty style definition, ignore it. - return; - } - - if ($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { - $error = 'Expected 1 space after colon in style definition; 0 found'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoneAfter'); - if ($fix === true) { - $phpcsFile->fixer->addContent($stackPtr, ' '); - } - } else { - $content = $tokens[($stackPtr + 1)]['content']; - if (strpos($content, $phpcsFile->eolChar) === false) { - $length = strlen($content); - if ($length !== 1) { - $error = 'Expected 1 space after colon in style definition; %s found'; - $data = [$length]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'After', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($stackPtr + 1), ' '); - } - } - } else { - $error = 'Expected 1 space after colon in style definition; newline found'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'AfterNewline'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($stackPtr + 1), ' '); - } - } - }//end if - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ColourDefinitionSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ColourDefinitionSniff.php deleted file mode 100644 index 6b071ea..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ColourDefinitionSniff.php +++ /dev/null @@ -1,88 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class ColourDefinitionSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['CSS']; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return int[] - */ - public function register() - { - return [T_COLOUR]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $colour = $tokens[$stackPtr]['content']; - - $expected = strtoupper($colour); - if ($colour !== $expected) { - $error = 'CSS colours must be defined in uppercase; expected %s but found %s'; - $data = [ - $expected, - $colour, - ]; - - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NotUpper', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($stackPtr, $expected); - } - } - - // Now check if shorthand can be used. - if (strlen($colour) !== 7) { - return; - } - - if ($colour[1] === $colour[2] && $colour[3] === $colour[4] && $colour[5] === $colour[6]) { - $expected = '#'.$colour[1].$colour[3].$colour[5]; - $error = 'CSS colours must use shorthand if available; expected %s but found %s'; - $data = [ - $expected, - $colour, - ]; - - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Shorthand', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($stackPtr, $expected); - } - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DisallowMultipleStyleDefinitionsSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DisallowMultipleStyleDefinitionsSniff.php deleted file mode 100644 index def95c1..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DisallowMultipleStyleDefinitionsSniff.php +++ /dev/null @@ -1,71 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class DisallowMultipleStyleDefinitionsSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['CSS']; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return int[] - */ - public function register() - { - return [T_STYLE]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $next = $phpcsFile->findNext(T_STYLE, ($stackPtr + 1)); - if ($next === false) { - return; - } - - if ($tokens[$next]['content'] === 'progid') { - // Special case for IE filters. - return; - } - - if ($tokens[$next]['line'] === $tokens[$stackPtr]['line']) { - $error = 'Each style definition must be on a line by itself'; - $fix = $phpcsFile->addFixableError($error, $next, 'Found'); - if ($fix === true) { - $phpcsFile->fixer->addNewlineBefore($next); - } - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DuplicateClassDefinitionSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DuplicateClassDefinitionSniff.php deleted file mode 100644 index d489cb1..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DuplicateClassDefinitionSniff.php +++ /dev/null @@ -1,116 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class DuplicateClassDefinitionSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['CSS']; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return int[] - */ - public function register() - { - return [T_OPEN_TAG]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Find the content of each class definition name. - $classNames = []; - $next = $phpcsFile->findNext(T_OPEN_CURLY_BRACKET, ($stackPtr + 1)); - if ($next === false) { - // No class definitions in the file. - return; - } - - // Save the class names in a "scope", - // to prevent false positives with @media blocks. - $scope = 'main'; - - $find = [ - T_CLOSE_CURLY_BRACKET, - T_OPEN_CURLY_BRACKET, - T_OPEN_TAG, - ]; - - while ($next !== false) { - $prev = $phpcsFile->findPrevious($find, ($next - 1)); - - // Check if an inner block was closed. - $beforePrev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prev - 1), null, true); - if ($beforePrev !== false - && $tokens[$beforePrev]['code'] === T_CLOSE_CURLY_BRACKET - ) { - $scope = 'main'; - } - - // Create a sorted name for the class so we can compare classes - // even when the individual names are all over the place. - $name = ''; - for ($i = ($prev + 1); $i < $next; $i++) { - $name .= $tokens[$i]['content']; - } - - $name = trim($name); - $name = str_replace("\n", ' ', $name); - $name = preg_replace('|[\s]+|', ' ', $name); - $name = preg_replace('|\s*/\*.*\*/\s*|', '', $name); - $name = str_replace(', ', ',', $name); - - $names = explode(',', $name); - sort($names); - $name = implode(',', $names); - - if ($name[0] === '@') { - // Media block has its own "scope". - $scope = $name; - } else if (isset($classNames[$scope][$name]) === true) { - $first = $classNames[$scope][$name]; - $error = 'Duplicate class definition found; first defined on line %s'; - $data = [$tokens[$first]['line']]; - $phpcsFile->addError($error, $next, 'Found', $data); - } else { - $classNames[$scope][$name] = $next; - } - - $next = $phpcsFile->findNext(T_OPEN_CURLY_BRACKET, ($next + 1)); - }//end while - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DuplicateStyleDefinitionSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DuplicateStyleDefinitionSniff.php deleted file mode 100644 index c747975..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DuplicateStyleDefinitionSniff.php +++ /dev/null @@ -1,88 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class DuplicateStyleDefinitionSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['CSS']; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return int[] - */ - public function register() - { - return [T_OPEN_CURLY_BRACKET]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]['bracket_closer']) === false) { - // Syntax error or live coding, bow out. - return; - } - - // Find the content of each style definition name. - $styleNames = []; - - $next = $stackPtr; - $end = $tokens[$stackPtr]['bracket_closer']; - - do { - $next = $phpcsFile->findNext([T_STYLE, T_OPEN_CURLY_BRACKET], ($next + 1), $end); - if ($next === false) { - // Class definition is empty. - break; - } - - if ($tokens[$next]['code'] === T_OPEN_CURLY_BRACKET) { - $next = $tokens[$next]['bracket_closer']; - continue; - } - - $name = $tokens[$next]['content']; - if (isset($styleNames[$name]) === true) { - $first = $styleNames[$name]; - $error = 'Duplicate style definition found; first defined on line %s'; - $data = [$tokens[$first]['line']]; - $phpcsFile->addError($error, $next, 'Found', $data); - } else { - $styleNames[$name] = $next; - } - } while ($next !== false); - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/EmptyClassDefinitionSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/EmptyClassDefinitionSniff.php deleted file mode 100644 index d3bb969..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/EmptyClassDefinitionSniff.php +++ /dev/null @@ -1,61 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class EmptyClassDefinitionSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['CSS']; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return int[] - */ - public function register() - { - return [T_OPEN_CURLY_BRACKET]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - - if ($next === false || $tokens[$next]['code'] === T_CLOSE_CURLY_BRACKET) { - $error = 'Class definition is empty'; - $phpcsFile->addError($error, $stackPtr, 'Found'); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/EmptyStyleDefinitionSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/EmptyStyleDefinitionSniff.php deleted file mode 100644 index 05f2e51..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/EmptyStyleDefinitionSniff.php +++ /dev/null @@ -1,64 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class EmptyStyleDefinitionSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['CSS']; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return int[] - */ - public function register() - { - return [T_STYLE]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $ignore = Tokens::$emptyTokens; - $ignore[] = T_COLON; - - $next = $phpcsFile->findNext($ignore, ($stackPtr + 1), null, true); - if ($next === false || $tokens[$next]['code'] === T_SEMICOLON || $tokens[$next]['line'] !== $tokens[$stackPtr]['line']) { - $error = 'Style definition is empty'; - $phpcsFile->addError($error, $stackPtr, 'Found'); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ForbiddenStylesSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ForbiddenStylesSniff.php deleted file mode 100644 index d8585dc..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ForbiddenStylesSniff.php +++ /dev/null @@ -1,177 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class ForbiddenStylesSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['CSS']; - - /** - * A list of forbidden styles with their alternatives. - * - * The value is NULL if no alternative exists. i.e., the - * style should just not be used. - * - * @var array - */ - protected $forbiddenStyles = [ - '-moz-border-radius' => 'border-radius', - '-webkit-border-radius' => 'border-radius', - '-moz-border-radius-topleft' => 'border-top-left-radius', - '-moz-border-radius-topright' => 'border-top-right-radius', - '-moz-border-radius-bottomright' => 'border-bottom-right-radius', - '-moz-border-radius-bottomleft' => 'border-bottom-left-radius', - '-moz-box-shadow' => 'box-shadow', - '-webkit-box-shadow' => 'box-shadow', - ]; - - /** - * A cache of forbidden style names, for faster lookups. - * - * @var string[] - */ - protected $forbiddenStyleNames = []; - - /** - * If true, forbidden styles will be considered regular expressions. - * - * @var boolean - */ - protected $patternMatch = false; - - /** - * If true, an error will be thrown; otherwise a warning. - * - * @var boolean - */ - public $error = true; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - $this->forbiddenStyleNames = array_keys($this->forbiddenStyles); - - if ($this->patternMatch === true) { - foreach ($this->forbiddenStyleNames as $i => $name) { - $this->forbiddenStyleNames[$i] = '/'.$name.'/i'; - } - } - - return [T_STYLE]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $style = strtolower($tokens[$stackPtr]['content']); - $pattern = null; - - if ($this->patternMatch === true) { - $count = 0; - $pattern = preg_replace( - $this->forbiddenStyleNames, - $this->forbiddenStyleNames, - $style, - 1, - $count - ); - - if ($count === 0) { - return; - } - - // Remove the pattern delimiters and modifier. - $pattern = substr($pattern, 1, -2); - } else { - if (in_array($style, $this->forbiddenStyleNames, true) === false) { - return; - } - }//end if - - $this->addError($phpcsFile, $stackPtr, $style, $pattern); - - }//end process() - - - /** - * Generates the error or warning for this sniff. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the forbidden style - * in the token array. - * @param string $style The name of the forbidden style. - * @param string $pattern The pattern used for the match. - * - * @return void - */ - protected function addError($phpcsFile, $stackPtr, $style, $pattern=null) - { - $data = [$style]; - $error = 'The use of style %s is '; - if ($this->error === true) { - $type = 'Found'; - $error .= 'forbidden'; - } else { - $type = 'Discouraged'; - $error .= 'discouraged'; - } - - if ($pattern === null) { - $pattern = $style; - } - - if ($this->forbiddenStyles[$pattern] !== null) { - $data[] = $this->forbiddenStyles[$pattern]; - if ($this->error === true) { - $fix = $phpcsFile->addFixableError($error.'; use %s instead', $stackPtr, $type.'WithAlternative', $data); - } else { - $fix = $phpcsFile->addFixableWarning($error.'; use %s instead', $stackPtr, $type.'WithAlternative', $data); - } - - if ($fix === true) { - $phpcsFile->fixer->replaceToken($stackPtr, $this->forbiddenStyles[$pattern]); - } - } else { - if ($this->error === true) { - $phpcsFile->addError($error, $stackPtr, $type, $data); - } else { - $phpcsFile->addWarning($error, $stackPtr, $type, $data); - } - } - - }//end addError() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/IndentationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/IndentationSniff.php deleted file mode 100644 index 5e35f4e..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/IndentationSniff.php +++ /dev/null @@ -1,150 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class IndentationSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['CSS']; - - /** - * The number of spaces code should be indented. - * - * @var integer - */ - public $indent = 4; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return int[] - */ - public function register() - { - return [T_OPEN_TAG]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $numTokens = (count($tokens) - 2); - $indentLevel = 0; - $nestingLevel = 0; - for ($i = 1; $i < $numTokens; $i++) { - if ($tokens[$i]['code'] === T_COMMENT - || isset(Tokens::$phpcsCommentTokens[$tokens[$i]['code']]) === true - ) { - // Don't check the indent of comments. - continue; - } - - if ($tokens[$i]['code'] === T_OPEN_CURLY_BRACKET) { - $indentLevel++; - - if (isset($tokens[$i]['bracket_closer']) === false) { - // Syntax error or live coding. - // Anything after this would receive incorrect fixes, so bow out. - return; - } - - // Check for nested class definitions. - $found = $phpcsFile->findNext( - T_OPEN_CURLY_BRACKET, - ($i + 1), - $tokens[$i]['bracket_closer'] - ); - - if ($found !== false) { - $nestingLevel = $indentLevel; - } - } - - if (($tokens[$i]['code'] === T_CLOSE_CURLY_BRACKET - && $tokens[$i]['line'] !== $tokens[($i - 1)]['line']) - || ($tokens[($i + 1)]['code'] === T_CLOSE_CURLY_BRACKET - && $tokens[$i]['line'] === $tokens[($i + 1)]['line']) - ) { - $indentLevel--; - if ($indentLevel === 0) { - $nestingLevel = 0; - } - } - - if ($tokens[$i]['column'] !== 1 - || $tokens[$i]['code'] === T_OPEN_CURLY_BRACKET - || $tokens[$i]['code'] === T_CLOSE_CURLY_BRACKET - ) { - continue; - } - - // We started a new line, so check indent. - if ($tokens[$i]['code'] === T_WHITESPACE) { - $content = str_replace($phpcsFile->eolChar, '', $tokens[$i]['content']); - $foundIndent = strlen($content); - } else { - $foundIndent = 0; - } - - $expectedIndent = ($indentLevel * $this->indent); - if ($expectedIndent > 0 - && strpos($tokens[$i]['content'], $phpcsFile->eolChar) !== false - ) { - if ($nestingLevel !== $indentLevel) { - $error = 'Blank lines are not allowed in class definitions'; - $fix = $phpcsFile->addFixableError($error, $i, 'BlankLine'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($i, ''); - } - } - } else if ($foundIndent !== $expectedIndent) { - $error = 'Line indented incorrectly; expected %s spaces, found %s'; - $data = [ - $expectedIndent, - $foundIndent, - ]; - - $fix = $phpcsFile->addFixableError($error, $i, 'Incorrect', $data); - if ($fix === true) { - $indent = str_repeat(' ', $expectedIndent); - if ($foundIndent === 0) { - $phpcsFile->fixer->addContentBefore($i, $indent); - } else { - $phpcsFile->fixer->replaceToken($i, $indent); - } - } - }//end if - }//end for - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/LowercaseStyleDefinitionSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/LowercaseStyleDefinitionSniff.php deleted file mode 100644 index c80a639..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/LowercaseStyleDefinitionSniff.php +++ /dev/null @@ -1,97 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class LowercaseStyleDefinitionSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['CSS']; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return int[] - */ - public function register() - { - return [T_OPEN_CURLY_BRACKET]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $start = ($stackPtr + 1); - $end = ($tokens[$stackPtr]['bracket_closer'] - 1); - $inStyle = null; - - for ($i = $start; $i <= $end; $i++) { - // Skip nested definitions as they are checked individually. - if ($tokens[$i]['code'] === T_OPEN_CURLY_BRACKET) { - $i = $tokens[$i]['bracket_closer']; - continue; - } - - if ($tokens[$i]['code'] === T_STYLE) { - $inStyle = $tokens[$i]['content']; - } - - if ($tokens[$i]['code'] === T_SEMICOLON) { - $inStyle = null; - } - - if ($inStyle === 'progid') { - // Special case for IE filters. - continue; - } - - if ($tokens[$i]['code'] === T_STYLE - || ($inStyle !== null - && $tokens[$i]['code'] === T_STRING) - ) { - $expected = strtolower($tokens[$i]['content']); - if ($expected !== $tokens[$i]['content']) { - $error = 'Style definitions must be lowercase; expected %s but found %s'; - $data = [ - $expected, - $tokens[$i]['content'], - ]; - - $fix = $phpcsFile->addFixableError($error, $i, 'FoundUpper', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($i, $expected); - } - } - } - }//end for - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/MissingColonSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/MissingColonSniff.php deleted file mode 100644 index dbf7d6c..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/MissingColonSniff.php +++ /dev/null @@ -1,91 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class MissingColonSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['CSS']; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return int[] - */ - public function register() - { - return [T_OPEN_CURLY_BRACKET]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]['bracket_closer']) === false) { - // Syntax error or live coding, bow out. - return; - } - - $lastLine = $tokens[$stackPtr]['line']; - $end = $tokens[$stackPtr]['bracket_closer']; - - // Do not check nested style definitions as, for example, in @media style rules. - $nested = $phpcsFile->findNext(T_OPEN_CURLY_BRACKET, ($stackPtr + 1), $end); - if ($nested !== false) { - return; - } - - $foundColon = false; - $foundString = false; - for ($i = ($stackPtr + 1); $i <= $end; $i++) { - if ($tokens[$i]['line'] !== $lastLine) { - // We changed lines. - if ($foundColon === false && $foundString !== false) { - // We didn't find a colon on the previous line. - $error = 'No style definition found on line; check for missing colon'; - $phpcsFile->addError($error, $foundString, 'Found'); - } - - $foundColon = false; - $foundString = false; - $lastLine = $tokens[$i]['line']; - } - - if ($tokens[$i]['code'] === T_STRING) { - $foundString = $i; - } else if ($tokens[$i]['code'] === T_COLON) { - $foundColon = $i; - } - }//end for - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/NamedColoursSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/NamedColoursSniff.php deleted file mode 100644 index 0a51f50..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/NamedColoursSniff.php +++ /dev/null @@ -1,93 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class NamedColoursSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['CSS']; - - /** - * A list of named colours. - * - * This is the list of standard colours defined in the CSS specification. - * - * @var array - */ - protected $colourNames = [ - 'aqua' => 'aqua', - 'black' => 'black', - 'blue' => 'blue', - 'fuchsia' => 'fuchsia', - 'gray' => 'gray', - 'green' => 'green', - 'lime' => 'lime', - 'maroon' => 'maroon', - 'navy' => 'navy', - 'olive' => 'olive', - 'orange' => 'orange', - 'purple' => 'purple', - 'red' => 'red', - 'silver' => 'silver', - 'teal' => 'teal', - 'white' => 'white', - 'yellow' => 'yellow', - ]; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return int[] - */ - public function register() - { - return [T_STRING]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if ($tokens[($stackPtr - 1)]['code'] === T_HASH - || $tokens[($stackPtr - 1)]['code'] === T_STRING_CONCAT - ) { - // Class name. - return; - } - - if (isset($this->colourNames[strtolower($tokens[$stackPtr]['content'])]) === true) { - $error = 'Named colours are forbidden; use hex, rgb, or rgba values instead'; - $phpcsFile->addError($error, $stackPtr, 'Forbidden'); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/OpacitySniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/OpacitySniff.php deleted file mode 100644 index 1dfbcf6..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/OpacitySniff.php +++ /dev/null @@ -1,101 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class OpacitySniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['CSS']; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return int[] - */ - public function register() - { - return [T_STYLE]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if ($tokens[$stackPtr]['content'] !== 'opacity') { - return; - } - - $ignore = Tokens::$emptyTokens; - $ignore[] = T_COLON; - - $next = $phpcsFile->findNext($ignore, ($stackPtr + 1), null, true); - - if ($next === false - || ($tokens[$next]['code'] !== T_DNUMBER - && $tokens[$next]['code'] !== T_LNUMBER) - ) { - return; - } - - $value = $tokens[$next]['content']; - if ($tokens[$next]['code'] === T_LNUMBER) { - if ($value !== '0' && $value !== '1') { - $error = 'Opacity values must be between 0 and 1'; - $phpcsFile->addError($error, $next, 'Invalid'); - } - } else { - if (strlen($value) > 3) { - $error = 'Opacity values must have a single value after the decimal point'; - $phpcsFile->addError($error, $next, 'DecimalPrecision'); - } else if ($value === '0.0' || $value === '1.0') { - $error = 'Opacity value does not require decimal point; use %s instead'; - $data = [$value[0]]; - $fix = $phpcsFile->addFixableError($error, $next, 'PointNotRequired', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($next, $value[0]); - } - } else if ($value[0] === '.') { - $error = 'Opacity values must not start with a decimal point; use 0%s instead'; - $data = [$value]; - $fix = $phpcsFile->addFixableError($error, $next, 'StartWithPoint', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($next, '0'.$value); - } - } else if ($value[0] !== '0') { - $error = 'Opacity values must be between 0 and 1'; - $phpcsFile->addError($error, $next, 'Invalid'); - }//end if - }//end if - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/SemicolonSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/SemicolonSpacingSniff.php deleted file mode 100644 index fdc168e..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/SemicolonSpacingSniff.php +++ /dev/null @@ -1,103 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class SemicolonSpacingSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['CSS']; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return int[] - */ - public function register() - { - return [T_STYLE]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $nextStatement = $phpcsFile->findNext([T_STYLE, T_CLOSE_CURLY_BRACKET], ($stackPtr + 1)); - if ($nextStatement === false) { - return; - } - - $ignore = Tokens::$emptyTokens; - if ($tokens[$nextStatement]['code'] === T_STYLE) { - // Allow for star-prefix hack. - $ignore[] = T_MULTIPLY; - } - - $endOfThisStatement = $phpcsFile->findPrevious($ignore, ($nextStatement - 1), null, true); - if ($tokens[$endOfThisStatement]['code'] !== T_SEMICOLON) { - $error = 'Style definitions must end with a semicolon'; - $phpcsFile->addError($error, $endOfThisStatement, 'NotAtEnd'); - return; - } - - if ($tokens[($endOfThisStatement - 1)]['code'] !== T_WHITESPACE) { - return; - } - - // There is a semi-colon, so now find the last token in the statement. - $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($endOfThisStatement - 1), null, true); - $found = $tokens[($endOfThisStatement - 1)]['length']; - if ($tokens[$prevNonEmpty]['line'] !== $tokens[$endOfThisStatement]['line']) { - $found = 'newline'; - } - - $error = 'Expected 0 spaces before semicolon in style definition; %s found'; - $data = [$found]; - $fix = $phpcsFile->addFixableError($error, $prevNonEmpty, 'SpaceFound', $data); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->addContent($prevNonEmpty, ';'); - $phpcsFile->fixer->replaceToken($endOfThisStatement, ''); - - for ($i = ($endOfThisStatement - 1); $i > $prevNonEmpty; $i--) { - if ($tokens[$i]['code'] !== T_WHITESPACE) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ShorthandSizeSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ShorthandSizeSniff.php deleted file mode 100644 index 8f2d9aa..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ShorthandSizeSniff.php +++ /dev/null @@ -1,181 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class ShorthandSizeSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['CSS']; - - /** - * A list of styles that we shouldn't check. - * - * These have values that looks like sizes, but are not. - * - * @var array - */ - protected $excludeStyles = [ - 'background-position' => 'background-position', - 'box-shadow' => 'box-shadow', - 'transform-origin' => 'transform-origin', - '-webkit-transform-origin' => '-webkit-transform-origin', - '-ms-transform-origin' => '-ms-transform-origin', - ]; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return int[] - */ - public function register() - { - return [T_STYLE]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Some styles look like shorthand but are not actually a set of 4 sizes. - $style = strtolower($tokens[$stackPtr]['content']); - if (isset($this->excludeStyles[$style]) === true) { - return; - } - - $end = $phpcsFile->findNext(T_SEMICOLON, ($stackPtr + 1)); - if ($end === false) { - // Live coding or parse error. - return; - } - - // Get the whole style content. - $origContent = $phpcsFile->getTokensAsString(($stackPtr + 1), ($end - $stackPtr - 1)); - $origContent = trim($origContent, ':'); - $origContent = trim($origContent); - - // Account for a !important annotation. - $content = $origContent; - if (substr($content, -10) === '!important') { - $content = substr($content, 0, -10); - $content = trim($content); - } - - // Check if this style value is a set of numbers with optional prefixes. - $content = preg_replace('/\s+/', ' ', $content); - $values = []; - $num = preg_match_all( - '/(?:[0-9]+)(?:[a-zA-Z]{2}\s+|%\s+|\s+)/', - $content.' ', - $values, - PREG_SET_ORDER - ); - - // Only interested in styles that have multiple sizes defined. - if ($num < 2) { - return; - } - - // Rebuild the content we matched to ensure we got everything. - $matched = ''; - foreach ($values as $value) { - $matched .= $value[0]; - } - - if ($content !== trim($matched)) { - return; - } - - if ($num === 3) { - $expected = trim($content.' '.$values[1][0]); - $error = 'Shorthand syntax not allowed here; use %s instead'; - $data = [$expected]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NotAllowed', $data); - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - if (substr($origContent, -10) === '!important') { - $expected .= ' !important'; - } - - $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 2), null, true); - $phpcsFile->fixer->replaceToken($next, $expected); - for ($next++; $next < $end; $next++) { - $phpcsFile->fixer->replaceToken($next, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - - return; - }//end if - - if ($num === 2) { - if ($values[0][0] !== $values[1][0]) { - // Both values are different, so it is already shorthand. - return; - } - } else if ($values[0][0] !== $values[2][0] || $values[1][0] !== $values[3][0]) { - // Can't shorthand this. - return; - } - - if ($values[0][0] === $values[1][0]) { - // All values are the same. - $expected = trim($values[0][0]); - } else { - $expected = trim($values[0][0]).' '.trim($values[1][0]); - } - - $error = 'Size definitions must use shorthand if available; expected "%s" but found "%s"'; - $data = [ - $expected, - $content, - ]; - - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NotUsed', $data); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - if (substr($origContent, -10) === '!important') { - $expected .= ' !important'; - } - - $next = $phpcsFile->findNext(T_COLON, ($stackPtr + 1)); - $phpcsFile->fixer->addContent($next, ' '.$expected); - for ($next++; $next < $end; $next++) { - $phpcsFile->fixer->replaceToken($next, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ClassDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ClassDeclarationSniff.php deleted file mode 100644 index 3d2c4db..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ClassDeclarationSniff.php +++ /dev/null @@ -1,206 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Standards\PSR2\Sniffs\Classes\ClassDeclarationSniff as PSR2ClassDeclarationSniff; -use PHP_CodeSniffer\Util\Tokens; - -class ClassDeclarationSniff extends PSR2ClassDeclarationSniff -{ - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - // We want all the errors from the PSR2 standard, plus some of our own. - parent::process($phpcsFile, $stackPtr); - - // Check that this is the only class or interface in the file. - $nextClass = $phpcsFile->findNext([T_CLASS, T_INTERFACE], ($stackPtr + 1)); - if ($nextClass !== false) { - // We have another, so an error is thrown. - $error = 'Only one interface or class is allowed in a file'; - $phpcsFile->addError($error, $nextClass, 'MultipleClasses'); - } - - }//end process() - - - /** - * Processes the opening section of a class declaration. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function processOpen(File $phpcsFile, $stackPtr) - { - parent::processOpen($phpcsFile, $stackPtr); - - $tokens = $phpcsFile->getTokens(); - - if ($tokens[($stackPtr - 1)]['code'] === T_WHITESPACE) { - $prevContent = $tokens[($stackPtr - 1)]['content']; - if ($prevContent !== $phpcsFile->eolChar) { - $blankSpace = substr($prevContent, strpos($prevContent, $phpcsFile->eolChar)); - $spaces = strlen($blankSpace); - - if ($tokens[($stackPtr - 2)]['code'] !== T_ABSTRACT - && $tokens[($stackPtr - 2)]['code'] !== T_FINAL - ) { - if ($spaces !== 0) { - $type = strtolower($tokens[$stackPtr]['content']); - $error = 'Expected 0 spaces before %s keyword; %s found'; - $data = [ - $type, - $spaces, - ]; - - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceBeforeKeyword', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($stackPtr - 1), ''); - } - } - } - }//end if - }//end if - - }//end processOpen() - - - /** - * Processes the closing section of a class declaration. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function processClose(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - if (isset($tokens[$stackPtr]['scope_closer']) === false) { - return; - } - - $closeBrace = $tokens[$stackPtr]['scope_closer']; - - // Check that the closing brace has one blank line after it. - for ($nextContent = ($closeBrace + 1); $nextContent < $phpcsFile->numTokens; $nextContent++) { - // Ignore comments on the same line as the brace. - if ($tokens[$nextContent]['line'] === $tokens[$closeBrace]['line'] - && ($tokens[$nextContent]['code'] === T_WHITESPACE - || $tokens[$nextContent]['code'] === T_COMMENT - || isset(Tokens::$phpcsCommentTokens[$tokens[$nextContent]['code']]) === true) - ) { - continue; - } - - if ($tokens[$nextContent]['code'] !== T_WHITESPACE) { - break; - } - } - - if ($nextContent === $phpcsFile->numTokens) { - // Ignore the line check as this is the very end of the file. - $difference = 1; - } else { - $difference = ($tokens[$nextContent]['line'] - $tokens[$closeBrace]['line'] - 1); - } - - $lastContent = $phpcsFile->findPrevious(T_WHITESPACE, ($closeBrace - 1), $stackPtr, true); - - if ($difference === -1 - || $tokens[$lastContent]['line'] === $tokens[$closeBrace]['line'] - ) { - $error = 'Closing %s brace must be on a line by itself'; - $data = [$tokens[$stackPtr]['content']]; - $fix = $phpcsFile->addFixableError($error, $closeBrace, 'CloseBraceSameLine', $data); - if ($fix === true) { - if ($difference === -1) { - $phpcsFile->fixer->addNewlineBefore($nextContent); - } - - if ($tokens[$lastContent]['line'] === $tokens[$closeBrace]['line']) { - $phpcsFile->fixer->addNewlineBefore($closeBrace); - } - } - } else if ($tokens[($closeBrace - 1)]['code'] === T_WHITESPACE) { - $prevContent = $tokens[($closeBrace - 1)]['content']; - if ($prevContent !== $phpcsFile->eolChar) { - $blankSpace = substr($prevContent, strpos($prevContent, $phpcsFile->eolChar)); - $spaces = strlen($blankSpace); - if ($spaces !== 0) { - if ($tokens[($closeBrace - 1)]['line'] !== $tokens[$closeBrace]['line']) { - $error = 'Expected 0 spaces before closing brace; newline found'; - $phpcsFile->addError($error, $closeBrace, 'NewLineBeforeCloseBrace'); - } else { - $error = 'Expected 0 spaces before closing brace; %s found'; - $data = [$spaces]; - $fix = $phpcsFile->addFixableError($error, $closeBrace, 'SpaceBeforeCloseBrace', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($closeBrace - 1), ''); - } - } - } - } - }//end if - - if ($difference !== -1 && $difference !== 1) { - if ($tokens[$nextContent]['code'] === T_DOC_COMMENT_OPEN_TAG) { - $next = $phpcsFile->findNext(T_WHITESPACE, ($tokens[$nextContent]['comment_closer'] + 1), null, true); - if ($next !== false && $tokens[$next]['code'] === T_FUNCTION) { - return; - } - } - - $error = 'Closing brace of a %s must be followed by a single blank line; found %s'; - $data = [ - $tokens[$stackPtr]['content'], - $difference, - ]; - $fix = $phpcsFile->addFixableError($error, $closeBrace, 'NewlinesAfterCloseBrace', $data); - if ($fix === true) { - if ($difference === 0) { - $first = $phpcsFile->findFirstOnLine([], $nextContent, true); - $phpcsFile->fixer->addNewlineBefore($first); - } else { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($closeBrace + 1); $i < $nextContent; $i++) { - if ($tokens[$i]['line'] <= ($tokens[$closeBrace]['line'] + 1)) { - continue; - } else if ($tokens[$i]['line'] === $tokens[$nextContent]['line']) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } - }//end if - - }//end processClose() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ClassFileNameSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ClassFileNameSniff.php deleted file mode 100644 index afbec4f..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ClassFileNameSniff.php +++ /dev/null @@ -1,69 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class ClassFileNameSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_CLASS, - T_INTERFACE, - T_TRAIT, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $fullPath = basename($phpcsFile->getFilename()); - $fileName = substr($fullPath, 0, strrpos($fullPath, '.')); - if ($fileName === '') { - // No filename probably means STDIN, so we can't do this check. - return; - } - - $tokens = $phpcsFile->getTokens(); - $decName = $phpcsFile->findNext(T_STRING, $stackPtr); - - if ($tokens[$decName]['content'] !== $fileName) { - $error = '%s name doesn\'t match filename; expected "%s %s"'; - $data = [ - ucfirst($tokens[$stackPtr]['content']), - $tokens[$stackPtr]['content'], - $fileName, - ]; - $phpcsFile->addError($error, $stackPtr, 'NoMatch', $data); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/DuplicatePropertySniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/DuplicatePropertySniff.php deleted file mode 100644 index a632f81..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/DuplicatePropertySniff.php +++ /dev/null @@ -1,82 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class DuplicatePropertySniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['JS']; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_OBJECT]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being processed. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $properties = []; - $wantedTokens = [ - T_PROPERTY, - T_OBJECT, - ]; - - $next = $phpcsFile->findNext($wantedTokens, ($stackPtr + 1), $tokens[$stackPtr]['bracket_closer']); - while ($next !== false && $next < $tokens[$stackPtr]['bracket_closer']) { - if ($tokens[$next]['code'] === T_OBJECT) { - // Skip nested objects. - $next = $tokens[$next]['bracket_closer']; - } else { - $propName = $tokens[$next]['content']; - if (isset($properties[$propName]) === true) { - $error = 'Duplicate property definition found for "%s"; previously defined on line %s'; - $data = [ - $propName, - $tokens[$properties[$propName]]['line'], - ]; - $phpcsFile->addError($error, $next, 'Found', $data); - } - - $properties[$propName] = $next; - }//end if - - $next = $phpcsFile->findNext($wantedTokens, ($next + 1), $tokens[$stackPtr]['bracket_closer']); - }//end while - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/LowercaseClassKeywordsSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/LowercaseClassKeywordsSniff.php deleted file mode 100644 index 5f4f78c..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/LowercaseClassKeywordsSniff.php +++ /dev/null @@ -1,72 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class LowercaseClassKeywordsSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - $targets = Tokens::$ooScopeTokens; - $targets[] = T_EXTENDS; - $targets[] = T_IMPLEMENTS; - $targets[] = T_ABSTRACT; - $targets[] = T_FINAL; - $targets[] = T_VAR; - $targets[] = T_CONST; - - return $targets; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $content = $tokens[$stackPtr]['content']; - $contentLc = strtolower($content); - if ($content !== $contentLc) { - $error = '%s keyword must be lowercase; expected "%s" but found "%s"'; - $data = [ - strtoupper($content), - $contentLc, - $content, - ]; - - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'FoundUppercase', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($stackPtr, $contentLc); - } - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/SelfMemberReferenceSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/SelfMemberReferenceSniff.php deleted file mode 100644 index d17ca44..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/SelfMemberReferenceSniff.php +++ /dev/null @@ -1,240 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\AbstractScopeSniff; -use PHP_CodeSniffer\Util\Tokens; - -class SelfMemberReferenceSniff extends AbstractScopeSniff -{ - - - /** - * Constructs a Squiz_Sniffs_Classes_SelfMemberReferenceSniff. - */ - public function __construct() - { - parent::__construct([T_CLASS], [T_DOUBLE_COLON]); - - }//end __construct() - - - /** - * Processes the function tokens within the class. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position where the token was found. - * @param int $currScope The current scope opener token. - * - * @return void - */ - protected function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScope) - { - $tokens = $phpcsFile->getTokens(); - - // Determine if this is a double colon which needs to be examined. - $conditions = $tokens[$stackPtr]['conditions']; - $conditions = array_reverse($conditions, true); - foreach ($conditions as $conditionToken => $tokenCode) { - if ($tokenCode === T_CLASS || $tokenCode === T_ANON_CLASS || $tokenCode === T_CLOSURE) { - break; - } - } - - if ($conditionToken !== $currScope) { - return; - } - - $calledClassName = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if ($calledClassName === false) { - // Parse error. - return; - } - - if ($tokens[$calledClassName]['code'] === T_SELF) { - if ($tokens[$calledClassName]['content'] !== 'self') { - $error = 'Must use "self::" for local static member reference; found "%s::"'; - $data = [$tokens[$calledClassName]['content']]; - $fix = $phpcsFile->addFixableError($error, $calledClassName, 'IncorrectCase', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($calledClassName, 'self'); - } - - return; - } - } else if ($tokens[$calledClassName]['code'] === T_STRING) { - // If the class is called with a namespace prefix, build fully qualified - // namespace calls for both current scope class and requested class. - $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($calledClassName - 1), null, true); - if ($prevNonEmpty !== false && $tokens[$prevNonEmpty]['code'] === T_NS_SEPARATOR) { - $declarationName = $this->getDeclarationNameWithNamespace($tokens, $calledClassName); - $declarationName = ltrim($declarationName, '\\'); - $fullQualifiedClassName = $this->getNamespaceOfScope($phpcsFile, $currScope); - if ($fullQualifiedClassName === '\\') { - $fullQualifiedClassName = ''; - } else { - $fullQualifiedClassName .= '\\'; - } - - $fullQualifiedClassName .= $phpcsFile->getDeclarationName($currScope); - } else { - $declarationName = $phpcsFile->getDeclarationName($currScope); - $fullQualifiedClassName = $tokens[$calledClassName]['content']; - } - - if ($declarationName === $fullQualifiedClassName) { - // Class name is the same as the current class, which is not allowed. - $error = 'Must use "self::" for local static member reference'; - $fix = $phpcsFile->addFixableError($error, $calledClassName, 'NotUsed'); - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - - $currentPointer = ($stackPtr - 1); - while ($tokens[$currentPointer]['code'] === T_NS_SEPARATOR - || $tokens[$currentPointer]['code'] === T_STRING - || isset(Tokens::$emptyTokens[$tokens[$currentPointer]['code']]) === true - ) { - if (isset(Tokens::$emptyTokens[$tokens[$currentPointer]['code']]) === true) { - --$currentPointer; - continue; - } - - $phpcsFile->fixer->replaceToken($currentPointer, ''); - --$currentPointer; - } - - $phpcsFile->fixer->replaceToken($stackPtr, 'self::'); - $phpcsFile->fixer->endChangeset(); - - // Fix potential whitespace issues in the next loop. - return; - }//end if - }//end if - }//end if - - if ($tokens[($stackPtr - 1)]['code'] === T_WHITESPACE) { - $found = $tokens[($stackPtr - 1)]['length']; - $error = 'Expected 0 spaces before double colon; %s found'; - $data = [$found]; - $fix = $phpcsFile->addFixableError($error, ($stackPtr - 1), 'SpaceBefore', $data); - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - - for ($i = ($stackPtr - 1); $tokens[$i]['code'] === T_WHITESPACE; $i--) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } - - if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE) { - $found = $tokens[($stackPtr + 1)]['length']; - $error = 'Expected 0 spaces after double colon; %s found'; - $data = [$found]; - $fix = $phpcsFile->addFixableError($error, ($stackPtr - 1), 'SpaceAfter', $data); - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - - for ($i = ($stackPtr + 1); $tokens[$i]['code'] === T_WHITESPACE; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } - - }//end processTokenWithinScope() - - - /** - * Processes a token that is found within the scope that this test is - * listening to. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position in the stack where this - * token was found. - * - * @return void - */ - protected function processTokenOutsideScope(File $phpcsFile, $stackPtr) - { - - }//end processTokenOutsideScope() - - - /** - * Returns the declaration names for classes/interfaces/functions with a namespace. - * - * @param array $tokens Token stack for this file - * @param int $stackPtr The position where the namespace building will start. - * - * @return string - */ - protected function getDeclarationNameWithNamespace(array $tokens, $stackPtr) - { - $nameParts = []; - $currentPointer = $stackPtr; - while ($tokens[$currentPointer]['code'] === T_NS_SEPARATOR - || $tokens[$currentPointer]['code'] === T_STRING - || isset(Tokens::$emptyTokens[$tokens[$currentPointer]['code']]) === true - ) { - if (isset(Tokens::$emptyTokens[$tokens[$currentPointer]['code']]) === true) { - --$currentPointer; - continue; - } - - $nameParts[] = $tokens[$currentPointer]['content']; - --$currentPointer; - } - - $nameParts = array_reverse($nameParts); - return implode('', $nameParts); - - }//end getDeclarationNameWithNamespace() - - - /** - * Returns the namespace declaration of a file. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position where the search for the - * namespace declaration will start. - * - * @return string - */ - protected function getNamespaceOfScope(File $phpcsFile, $stackPtr) - { - $namespace = '\\'; - $namespaceDeclaration = $phpcsFile->findPrevious(T_NAMESPACE, $stackPtr); - - if ($namespaceDeclaration !== false) { - $endOfNamespaceDeclaration = $phpcsFile->findNext([T_SEMICOLON, T_OPEN_CURLY_BRACKET], $namespaceDeclaration); - $namespace = $this->getDeclarationNameWithNamespace( - $phpcsFile->getTokens(), - ($endOfNamespaceDeclaration - 1) - ); - } - - return $namespace; - - }//end getNamespaceOfScope() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ValidClassNameSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ValidClassNameSniff.php deleted file mode 100644 index 10de719..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ValidClassNameSniff.php +++ /dev/null @@ -1,86 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Common; - -class ValidClassNameSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_CLASS, - T_INTERFACE, - T_TRAIT, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being processed. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]['scope_opener']) === false) { - $error = 'Possible parse error: %s missing opening or closing brace'; - $data = [$tokens[$stackPtr]['content']]; - $phpcsFile->addWarning($error, $stackPtr, 'MissingBrace', $data); - return; - } - - // Determine the name of the class or interface. Note that we cannot - // simply look for the first T_STRING because a class name - // starting with the number will be multiple tokens. - $opener = $tokens[$stackPtr]['scope_opener']; - $nameStart = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), $opener, true); - $nameEnd = $phpcsFile->findNext(T_WHITESPACE, $nameStart, $opener); - if ($nameEnd === false) { - $name = $tokens[$nameStart]['content']; - } else { - $name = trim($phpcsFile->getTokensAsString($nameStart, ($nameEnd - $nameStart))); - } - - // Check for PascalCase format. - $valid = Common::isCamelCaps($name, true, true, false); - if ($valid === false) { - $type = ucfirst($tokens[$stackPtr]['content']); - $error = '%s name "%s" is not in PascalCase format'; - $data = [ - $type, - $name, - ]; - $phpcsFile->addError($error, $stackPtr, 'NotCamelCaps', $data); - $phpcsFile->recordMetric($stackPtr, 'PascalCase class name', 'no'); - } else { - $phpcsFile->recordMetric($stackPtr, 'PascalCase class name', 'yes'); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/BlockCommentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/BlockCommentSniff.php deleted file mode 100644 index 6a12bb7..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/BlockCommentSniff.php +++ /dev/null @@ -1,399 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class BlockCommentSniff implements Sniff -{ - - /** - * The --tab-width CLI value that is being used. - * - * @var integer - */ - private $tabWidth = null; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_COMMENT, - T_DOC_COMMENT_OPEN_TAG, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - if ($this->tabWidth === null) { - if (isset($phpcsFile->config->tabWidth) === false || $phpcsFile->config->tabWidth === 0) { - // We have no idea how wide tabs are, so assume 4 spaces for fixing. - $this->tabWidth = 4; - } else { - $this->tabWidth = $phpcsFile->config->tabWidth; - } - } - - $tokens = $phpcsFile->getTokens(); - - // If it's an inline comment, return. - if (substr($tokens[$stackPtr]['content'], 0, 2) !== '/*') { - return; - } - - // If this is a function/class/interface doc block comment, skip it. - // We are only interested in inline doc block comments. - if ($tokens[$stackPtr]['code'] === T_DOC_COMMENT_OPEN_TAG) { - $nextToken = $stackPtr; - do { - $nextToken = $phpcsFile->findNext(Tokens::$emptyTokens, ($nextToken + 1), null, true); - if ($tokens[$nextToken]['code'] === T_ATTRIBUTE) { - $nextToken = $tokens[$nextToken]['attribute_closer']; - continue; - } - - break; - } while (true); - - $ignore = [ - T_CLASS => true, - T_INTERFACE => true, - T_TRAIT => true, - T_FUNCTION => true, - T_PUBLIC => true, - T_PRIVATE => true, - T_FINAL => true, - T_PROTECTED => true, - T_STATIC => true, - T_ABSTRACT => true, - T_CONST => true, - T_VAR => true, - ]; - if (isset($ignore[$tokens[$nextToken]['code']]) === true) { - return; - } - - $prevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if ($tokens[$prevToken]['code'] === T_OPEN_TAG) { - return; - } - - $error = 'Block comments must be started with /*'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'WrongStart'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($stackPtr, '/*'); - } - - $end = $tokens[$stackPtr]['comment_closer']; - if ($tokens[$end]['content'] !== '*/') { - $error = 'Block comments must be ended with */'; - $fix = $phpcsFile->addFixableError($error, $end, 'WrongEnd'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($end, '*/'); - } - } - - return; - }//end if - - $commentLines = [$stackPtr]; - $nextComment = $stackPtr; - $lastLine = $tokens[$stackPtr]['line']; - $commentString = $tokens[$stackPtr]['content']; - - // Construct the comment into an array. - while (($nextComment = $phpcsFile->findNext(T_WHITESPACE, ($nextComment + 1), null, true)) !== false) { - if ($tokens[$nextComment]['code'] !== $tokens[$stackPtr]['code'] - && isset(Tokens::$phpcsCommentTokens[$tokens[$nextComment]['code']]) === false - ) { - // Found the next bit of code. - break; - } - - if (($tokens[$nextComment]['line'] - 1) !== $lastLine) { - // Not part of the block. - break; - } - - $lastLine = $tokens[$nextComment]['line']; - $commentLines[] = $nextComment; - $commentString .= $tokens[$nextComment]['content']; - if ($tokens[$nextComment]['code'] === T_DOC_COMMENT_CLOSE_TAG - || substr($tokens[$nextComment]['content'], -2) === '*/' - ) { - break; - } - }//end while - - $commentText = str_replace($phpcsFile->eolChar, '', $commentString); - $commentText = trim($commentText, "/* \t"); - if ($commentText === '') { - $error = 'Empty block comment not allowed'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Empty'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($stackPtr, ''); - $lastToken = array_pop($commentLines); - for ($i = ($stackPtr + 1); $i <= $lastToken; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - - return; - } - - if (count($commentLines) === 1) { - $error = 'Single line block comment not allowed; use inline ("// text") comment instead'; - - // Only fix comments when they are the last token on a line. - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($tokens[$stackPtr]['line'] !== $tokens[$nextNonEmpty]['line']) { - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SingleLine'); - if ($fix === true) { - $comment = '// '.$commentText.$phpcsFile->eolChar; - $phpcsFile->fixer->replaceToken($stackPtr, $comment); - } - } else { - $phpcsFile->addError($error, $stackPtr, 'SingleLine'); - } - - return; - } - - $content = trim($tokens[$stackPtr]['content']); - if ($content !== '/*' && $content !== '/**') { - $error = 'Block comment text must start on a new line'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoNewLine'); - if ($fix === true) { - $indent = ''; - if ($tokens[($stackPtr - 1)]['code'] === T_WHITESPACE) { - if (isset($tokens[($stackPtr - 1)]['orig_content']) === true) { - $indent = $tokens[($stackPtr - 1)]['orig_content']; - } else { - $indent = $tokens[($stackPtr - 1)]['content']; - } - } - - $comment = preg_replace( - '/^(\s*\/\*\*?)/', - '$1'.$phpcsFile->eolChar.$indent, - $tokens[$stackPtr]['content'], - 1 - ); - $phpcsFile->fixer->replaceToken($stackPtr, $comment); - } - - return; - }//end if - - $starColumn = $tokens[$stackPtr]['column']; - $hasStars = false; - - // Make sure first line isn't blank. - if (trim($tokens[$commentLines[1]]['content']) === '') { - $error = 'Empty line not allowed at start of comment'; - $fix = $phpcsFile->addFixableError($error, $commentLines[1], 'HasEmptyLine'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($commentLines[1], ''); - } - } else { - // Check indentation of first line. - $content = $tokens[$commentLines[1]]['content']; - $commentText = ltrim($content); - $leadingSpace = (strlen($content) - strlen($commentText)); - - $expected = ($starColumn + 3); - if ($commentText[0] === '*') { - $expected = $starColumn; - $hasStars = true; - } - - if ($leadingSpace !== $expected) { - $expectedTxt = $expected.' space'; - if ($expected !== 1) { - $expectedTxt .= 's'; - } - - $data = [ - $expectedTxt, - $leadingSpace, - ]; - - $error = 'First line of comment not aligned correctly; expected %s but found %s'; - $fix = $phpcsFile->addFixableError($error, $commentLines[1], 'FirstLineIndent', $data); - if ($fix === true) { - if (isset($tokens[$commentLines[1]]['orig_content']) === true - && $tokens[$commentLines[1]]['orig_content'][0] === "\t" - ) { - // Line is indented using tabs. - $padding = str_repeat("\t", floor($expected / $this->tabWidth)); - $padding .= str_repeat(' ', ($expected % $this->tabWidth)); - } else { - $padding = str_repeat(' ', $expected); - } - - $phpcsFile->fixer->replaceToken($commentLines[1], $padding.$commentText); - } - }//end if - - if (preg_match('/^\p{Ll}/u', $commentText) === 1) { - $error = 'Block comments must start with a capital letter'; - $phpcsFile->addError($error, $commentLines[1], 'NoCapital'); - } - }//end if - - // Check that each line of the comment is indented past the star. - foreach ($commentLines as $line) { - // First and last lines (comment opener and closer) are handled separately. - if ($line === $commentLines[(count($commentLines) - 1)] || $line === $commentLines[0]) { - continue; - } - - // First comment line was handled above. - if ($line === $commentLines[1]) { - continue; - } - - // If it's empty, continue. - if (trim($tokens[$line]['content']) === '') { - continue; - } - - $commentText = ltrim($tokens[$line]['content']); - $leadingSpace = (strlen($tokens[$line]['content']) - strlen($commentText)); - - $expected = ($starColumn + 3); - if ($commentText[0] === '*') { - $expected = $starColumn; - $hasStars = true; - } - - if ($leadingSpace < $expected) { - $expectedTxt = $expected.' space'; - if ($expected !== 1) { - $expectedTxt .= 's'; - } - - $data = [ - $expectedTxt, - $leadingSpace, - ]; - - $error = 'Comment line indented incorrectly; expected at least %s but found %s'; - $fix = $phpcsFile->addFixableError($error, $line, 'LineIndent', $data); - if ($fix === true) { - if (isset($tokens[$line]['orig_content']) === true - && $tokens[$line]['orig_content'][0] === "\t" - ) { - // Line is indented using tabs. - $padding = str_repeat("\t", floor($expected / $this->tabWidth)); - $padding .= str_repeat(' ', ($expected % $this->tabWidth)); - } else { - $padding = str_repeat(' ', $expected); - } - - $phpcsFile->fixer->replaceToken($line, $padding.$commentText); - } - }//end if - }//end foreach - - // Finally, test the last line is correct. - $lastIndex = (count($commentLines) - 1); - $content = $tokens[$commentLines[$lastIndex]]['content']; - $commentText = ltrim($content); - if ($commentText !== '*/' && $commentText !== '**/') { - $error = 'Comment closer must be on a new line'; - $phpcsFile->addError($error, $commentLines[$lastIndex], 'CloserSameLine'); - } else { - $leadingSpace = (strlen($content) - strlen($commentText)); - - $expected = ($starColumn - 1); - if ($hasStars === true) { - $expected = $starColumn; - } - - if ($leadingSpace !== $expected) { - $expectedTxt = $expected.' space'; - if ($expected !== 1) { - $expectedTxt .= 's'; - } - - $data = [ - $expectedTxt, - $leadingSpace, - ]; - - $error = 'Last line of comment aligned incorrectly; expected %s but found %s'; - $fix = $phpcsFile->addFixableError($error, $commentLines[$lastIndex], 'LastLineIndent', $data); - if ($fix === true) { - if (isset($tokens[$line]['orig_content']) === true - && $tokens[$line]['orig_content'][0] === "\t" - ) { - // Line is indented using tabs. - $padding = str_repeat("\t", floor($expected / $this->tabWidth)); - $padding .= str_repeat(' ', ($expected % $this->tabWidth)); - } else { - $padding = str_repeat(' ', $expected); - } - - $phpcsFile->fixer->replaceToken($commentLines[$lastIndex], $padding.$commentText); - } - }//end if - }//end if - - // Check that the lines before and after this comment are blank. - $contentBefore = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); - if ((isset($tokens[$contentBefore]['scope_closer']) === true - && $tokens[$contentBefore]['scope_opener'] === $contentBefore) - || $tokens[$contentBefore]['code'] === T_OPEN_TAG - || $tokens[$contentBefore]['code'] === T_OPEN_TAG_WITH_ECHO - ) { - if (($tokens[$stackPtr]['line'] - $tokens[$contentBefore]['line']) !== 1) { - $error = 'Empty line not required before block comment'; - $phpcsFile->addError($error, $stackPtr, 'HasEmptyLineBefore'); - } - } else { - if (($tokens[$stackPtr]['line'] - $tokens[$contentBefore]['line']) < 2) { - $error = 'Empty line required before block comment'; - $phpcsFile->addError($error, $stackPtr, 'NoEmptyLineBefore'); - } - } - - $commentCloser = $commentLines[$lastIndex]; - $contentAfter = $phpcsFile->findNext(T_WHITESPACE, ($commentCloser + 1), null, true); - if ($contentAfter !== false && ($tokens[$contentAfter]['line'] - $tokens[$commentCloser]['line']) < 2) { - $error = 'Empty line required after block comment'; - $phpcsFile->addError($error, $commentCloser, 'NoEmptyLineAfter'); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/ClassCommentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/ClassCommentSniff.php deleted file mode 100644 index 0da4ef2..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/ClassCommentSniff.php +++ /dev/null @@ -1,106 +0,0 @@ - - *
  • A class doc comment exists.
  • - *
  • The comment uses the correct docblock style.
  • - *
  • There are no blank lines after the class comment.
  • - *
  • No tags are used in the docblock.
  • - * - * - * @author Greg Sherwood - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class ClassCommentSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_CLASS]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $find = Tokens::$methodPrefixes; - $find[T_WHITESPACE] = T_WHITESPACE; - - $previousContent = null; - for ($commentEnd = ($stackPtr - 1); $commentEnd >= 0; $commentEnd--) { - if (isset($find[$tokens[$commentEnd]['code']]) === true) { - continue; - } - - if ($previousContent === null) { - $previousContent = $commentEnd; - } - - if ($tokens[$commentEnd]['code'] === T_ATTRIBUTE_END - && isset($tokens[$commentEnd]['attribute_opener']) === true - ) { - $commentEnd = $tokens[$commentEnd]['attribute_opener']; - continue; - } - - break; - } - - if ($tokens[$commentEnd]['code'] !== T_DOC_COMMENT_CLOSE_TAG - && $tokens[$commentEnd]['code'] !== T_COMMENT - ) { - $class = $phpcsFile->getDeclarationName($stackPtr); - $phpcsFile->addError('Missing doc comment for class %s', $stackPtr, 'Missing', [$class]); - $phpcsFile->recordMetric($stackPtr, 'Class has doc comment', 'no'); - return; - } - - $phpcsFile->recordMetric($stackPtr, 'Class has doc comment', 'yes'); - - if ($tokens[$commentEnd]['code'] === T_COMMENT) { - $phpcsFile->addError('You must use "/**" style comments for a class comment', $stackPtr, 'WrongStyle'); - return; - } - - if ($tokens[$previousContent]['line'] !== ($tokens[$stackPtr]['line'] - 1)) { - $error = 'There must be no blank lines after the class comment'; - $phpcsFile->addError($error, $commentEnd, 'SpacingAfter'); - } - - $commentStart = $tokens[$commentEnd]['comment_opener']; - foreach ($tokens[$commentStart]['comment_tags'] as $tag) { - $error = '%s tag is not allowed in class comment'; - $data = [$tokens[$tag]['content']]; - $phpcsFile->addWarning($error, $tag, 'TagNotAllowed', $data); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/ClosingDeclarationCommentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/ClosingDeclarationCommentSniff.php deleted file mode 100644 index 6ab6280..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/ClosingDeclarationCommentSniff.php +++ /dev/null @@ -1,129 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class ClosingDeclarationCommentSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_FUNCTION, - T_CLASS, - T_INTERFACE, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens.. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if ($tokens[$stackPtr]['code'] === T_FUNCTION) { - $methodProps = $phpcsFile->getMethodProperties($stackPtr); - - // Abstract methods do not require a closing comment. - if ($methodProps['is_abstract'] === true) { - return; - } - - // If this function is in an interface then we don't require - // a closing comment. - if ($phpcsFile->hasCondition($stackPtr, T_INTERFACE) === true) { - return; - } - - if (isset($tokens[$stackPtr]['scope_closer']) === false) { - $error = 'Possible parse error: non-abstract method defined as abstract'; - $phpcsFile->addWarning($error, $stackPtr, 'Abstract'); - return; - } - - $decName = $phpcsFile->getDeclarationName($stackPtr); - $comment = '//end '.$decName.'()'; - } else if ($tokens[$stackPtr]['code'] === T_CLASS) { - $comment = '//end class'; - } else { - $comment = '//end interface'; - }//end if - - if (isset($tokens[$stackPtr]['scope_closer']) === false) { - $error = 'Possible parse error: %s missing opening or closing brace'; - $data = [$tokens[$stackPtr]['content']]; - $phpcsFile->addWarning($error, $stackPtr, 'MissingBrace', $data); - return; - } - - $closingBracket = $tokens[$stackPtr]['scope_closer']; - - if ($closingBracket === null) { - // Possible inline structure. Other tests will handle it. - return; - } - - $data = [$comment]; - if (isset($tokens[($closingBracket + 1)]) === false || $tokens[($closingBracket + 1)]['code'] !== T_COMMENT) { - $next = $phpcsFile->findNext(T_WHITESPACE, ($closingBracket + 1), null, true); - if (rtrim($tokens[$next]['content']) === $comment) { - // The comment isn't really missing; it is just in the wrong place. - $fix = $phpcsFile->addFixableError('Expected %s directly after closing brace', $closingBracket, 'Misplaced', $data); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($closingBracket + 1); $i < $next; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - // Just in case, because indentation fixes can add indents onto - // these comments and cause us to be unable to fix them. - $phpcsFile->fixer->replaceToken($next, $comment.$phpcsFile->eolChar); - $phpcsFile->fixer->endChangeset(); - } - } else { - $fix = $phpcsFile->addFixableError('Expected %s', $closingBracket, 'Missing', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($closingBracket, '}'.$comment.$phpcsFile->eolChar); - } - } - - return; - }//end if - - if (rtrim($tokens[($closingBracket + 1)]['content']) !== $comment) { - $fix = $phpcsFile->addFixableError('Expected %s', $closingBracket, 'Incorrect', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($closingBracket + 1), $comment.$phpcsFile->eolChar); - } - - return; - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/DocCommentAlignmentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/DocCommentAlignmentSniff.php deleted file mode 100644 index 2624bc2..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/DocCommentAlignmentSniff.php +++ /dev/null @@ -1,158 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class DocCommentAlignmentSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_DOC_COMMENT_OPEN_TAG]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // We are only interested in function/class/interface doc block comments. - $ignore = Tokens::$emptyTokens; - if ($phpcsFile->tokenizerType === 'JS') { - $ignore[] = T_EQUAL; - $ignore[] = T_STRING; - $ignore[] = T_OBJECT_OPERATOR; - } - - $nextToken = $phpcsFile->findNext($ignore, ($stackPtr + 1), null, true); - $ignore = [ - T_CLASS => true, - T_INTERFACE => true, - T_FUNCTION => true, - T_PUBLIC => true, - T_PRIVATE => true, - T_PROTECTED => true, - T_STATIC => true, - T_ABSTRACT => true, - T_PROPERTY => true, - T_OBJECT => true, - T_PROTOTYPE => true, - T_VAR => true, - ]; - - if ($nextToken === false || isset($ignore[$tokens[$nextToken]['code']]) === false) { - // Could be a file comment. - $prevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if ($tokens[$prevToken]['code'] !== T_OPEN_TAG) { - return; - } - } - - // There must be one space after each star (unless it is an empty comment line) - // and all the stars must be aligned correctly. - $requiredColumn = ($tokens[$stackPtr]['column'] + 1); - $endComment = $tokens[$stackPtr]['comment_closer']; - for ($i = ($stackPtr + 1); $i <= $endComment; $i++) { - if ($tokens[$i]['code'] !== T_DOC_COMMENT_STAR - && $tokens[$i]['code'] !== T_DOC_COMMENT_CLOSE_TAG - ) { - continue; - } - - if ($tokens[$i]['code'] === T_DOC_COMMENT_CLOSE_TAG) { - if (trim($tokens[$i]['content']) === '') { - // Don't process an unfinished docblock close tag during live coding. - continue; - } - - // Can't process the close tag if it is not the first thing on the line. - $prev = $phpcsFile->findPrevious(T_DOC_COMMENT_WHITESPACE, ($i - 1), $stackPtr, true); - if ($tokens[$prev]['line'] === $tokens[$i]['line']) { - continue; - } - } - - if ($tokens[$i]['column'] !== $requiredColumn) { - $error = 'Expected %s space(s) before asterisk; %s found'; - $data = [ - ($requiredColumn - 1), - ($tokens[$i]['column'] - 1), - ]; - $fix = $phpcsFile->addFixableError($error, $i, 'SpaceBeforeStar', $data); - if ($fix === true) { - $padding = str_repeat(' ', ($requiredColumn - 1)); - if ($tokens[$i]['column'] === 1) { - $phpcsFile->fixer->addContentBefore($i, $padding); - } else { - $phpcsFile->fixer->replaceToken(($i - 1), $padding); - } - } - } - - if ($tokens[$i]['code'] !== T_DOC_COMMENT_STAR) { - continue; - } - - if ($tokens[($i + 2)]['line'] !== $tokens[$i]['line']) { - // Line is empty. - continue; - } - - if ($tokens[($i + 1)]['code'] !== T_DOC_COMMENT_WHITESPACE) { - $error = 'Expected 1 space after asterisk; 0 found'; - $fix = $phpcsFile->addFixableError($error, $i, 'NoSpaceAfterStar'); - if ($fix === true) { - $phpcsFile->fixer->addContent($i, ' '); - } - } else if ($tokens[($i + 2)]['code'] === T_DOC_COMMENT_TAG - && $tokens[($i + 1)]['content'] !== ' ' - ) { - $error = 'Expected 1 space after asterisk; %s found'; - $data = [$tokens[($i + 1)]['length']]; - $fix = $phpcsFile->addFixableError($error, $i, 'SpaceAfterStar', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($i + 1), ' '); - } - } - }//end for - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/EmptyCatchCommentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/EmptyCatchCommentSniff.php deleted file mode 100644 index 4fc2521..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/EmptyCatchCommentSniff.php +++ /dev/null @@ -1,55 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class EmptyCatchCommentSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_CATCH]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile All the tokens found in the document. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $scopeStart = $tokens[$stackPtr]['scope_opener']; - $firstContent = $phpcsFile->findNext(T_WHITESPACE, ($scopeStart + 1), $tokens[$stackPtr]['scope_closer'], true); - - if ($firstContent === false) { - $error = 'Empty CATCH statement must have a comment to explain why the exception is not handled'; - $phpcsFile->addError($error, $scopeStart, 'Missing'); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FileCommentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FileCommentSniff.php deleted file mode 100644 index 2685854..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FileCommentSniff.php +++ /dev/null @@ -1,226 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class FileCommentSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_OPEN_TAG]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return int - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $commentStart = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - - if ($tokens[$commentStart]['code'] === T_COMMENT) { - $phpcsFile->addError('You must use "/**" style comments for a file comment', $commentStart, 'WrongStyle'); - $phpcsFile->recordMetric($stackPtr, 'File has doc comment', 'yes'); - return ($phpcsFile->numTokens + 1); - } else if ($commentStart === false || $tokens[$commentStart]['code'] !== T_DOC_COMMENT_OPEN_TAG) { - $phpcsFile->addError('Missing file doc comment', $stackPtr, 'Missing'); - $phpcsFile->recordMetric($stackPtr, 'File has doc comment', 'no'); - return ($phpcsFile->numTokens + 1); - } - - if (isset($tokens[$commentStart]['comment_closer']) === false - || ($tokens[$tokens[$commentStart]['comment_closer']]['content'] === '' - && $tokens[$commentStart]['comment_closer'] === ($phpcsFile->numTokens - 1)) - ) { - // Don't process an unfinished file comment during live coding. - return ($phpcsFile->numTokens + 1); - } - - $commentEnd = $tokens[$commentStart]['comment_closer']; - - for ($nextToken = ($commentEnd + 1); $nextToken < $phpcsFile->numTokens; $nextToken++) { - if ($tokens[$nextToken]['code'] === T_WHITESPACE) { - continue; - } - - if ($tokens[$nextToken]['code'] === T_ATTRIBUTE - && isset($tokens[$nextToken]['attribute_closer']) === true - ) { - $nextToken = $tokens[$nextToken]['attribute_closer']; - continue; - } - - break; - } - - if ($nextToken === $phpcsFile->numTokens) { - $nextToken--; - } - - $ignore = [ - T_CLASS, - T_INTERFACE, - T_TRAIT, - T_FUNCTION, - T_CLOSURE, - T_PUBLIC, - T_PRIVATE, - T_PROTECTED, - T_FINAL, - T_STATIC, - T_ABSTRACT, - T_CONST, - T_PROPERTY, - T_INCLUDE, - T_INCLUDE_ONCE, - T_REQUIRE, - T_REQUIRE_ONCE, - ]; - - if (in_array($tokens[$nextToken]['code'], $ignore, true) === true) { - $phpcsFile->addError('Missing file doc comment', $stackPtr, 'Missing'); - $phpcsFile->recordMetric($stackPtr, 'File has doc comment', 'no'); - return ($phpcsFile->numTokens + 1); - } - - $phpcsFile->recordMetric($stackPtr, 'File has doc comment', 'yes'); - - // No blank line between the open tag and the file comment. - if ($tokens[$commentStart]['line'] > ($tokens[$stackPtr]['line'] + 1)) { - $error = 'There must be no blank lines before the file comment'; - $phpcsFile->addError($error, $stackPtr, 'SpacingAfterOpen'); - } - - // Exactly one blank line after the file comment. - $next = $phpcsFile->findNext(T_WHITESPACE, ($commentEnd + 1), null, true); - if ($next !== false && $tokens[$next]['line'] !== ($tokens[$commentEnd]['line'] + 2)) { - $error = 'There must be exactly one blank line after the file comment'; - $phpcsFile->addError($error, $commentEnd, 'SpacingAfterComment'); - } - - // Required tags in correct order. - $required = [ - '@package' => true, - '@subpackage' => true, - '@author' => true, - '@copyright' => true, - ]; - - $foundTags = []; - foreach ($tokens[$commentStart]['comment_tags'] as $tag) { - $name = $tokens[$tag]['content']; - $isRequired = isset($required[$name]); - - if ($isRequired === true && in_array($name, $foundTags, true) === true) { - $error = 'Only one %s tag is allowed in a file comment'; - $data = [$name]; - $phpcsFile->addError($error, $tag, 'Duplicate'.ucfirst(substr($name, 1)).'Tag', $data); - } - - $foundTags[] = $name; - - if ($isRequired === false) { - continue; - } - - $string = $phpcsFile->findNext(T_DOC_COMMENT_STRING, $tag, $commentEnd); - if ($string === false || $tokens[$string]['line'] !== $tokens[$tag]['line']) { - $error = 'Content missing for %s tag in file comment'; - $data = [$name]; - $phpcsFile->addError($error, $tag, 'Empty'.ucfirst(substr($name, 1)).'Tag', $data); - continue; - } - - if ($name === '@author') { - if ($tokens[$string]['content'] !== 'Squiz Pty Ltd ') { - $error = 'Expected "Squiz Pty Ltd " for author tag'; - $fix = $phpcsFile->addFixableError($error, $tag, 'IncorrectAuthor'); - if ($fix === true) { - $expected = 'Squiz Pty Ltd '; - $phpcsFile->fixer->replaceToken($string, $expected); - } - } - } else if ($name === '@copyright') { - if (preg_match('/^([0-9]{4})(-[0-9]{4})? (Squiz Pty Ltd \(ABN 77 084 670 600\))$/', $tokens[$string]['content']) === 0) { - $error = 'Expected "xxxx-xxxx Squiz Pty Ltd (ABN 77 084 670 600)" for copyright declaration'; - $fix = $phpcsFile->addFixableError($error, $tag, 'IncorrectCopyright'); - if ($fix === true) { - $matches = []; - preg_match('/^(([0-9]{4})(-[0-9]{4})?)?.*$/', $tokens[$string]['content'], $matches); - if (isset($matches[1]) === false) { - $matches[1] = date('Y'); - } - - $expected = $matches[1].' Squiz Pty Ltd (ABN 77 084 670 600)'; - $phpcsFile->fixer->replaceToken($string, $expected); - } - } - }//end if - }//end foreach - - // Check if the tags are in the correct position. - $pos = 0; - foreach ($required as $tag => $true) { - if (in_array($tag, $foundTags, true) === false) { - $error = 'Missing %s tag in file comment'; - $data = [$tag]; - $phpcsFile->addError($error, $commentEnd, 'Missing'.ucfirst(substr($tag, 1)).'Tag', $data); - } - - if (isset($foundTags[$pos]) === false) { - break; - } - - if ($foundTags[$pos] !== $tag) { - $error = 'The tag in position %s should be the %s tag'; - $data = [ - ($pos + 1), - $tag, - ]; - $phpcsFile->addError($error, $tokens[$commentStart]['comment_tags'][$pos], ucfirst(substr($tag, 1)).'TagOrder', $data); - } - - $pos++; - }//end foreach - - // Ignore the rest of the file. - return ($phpcsFile->numTokens + 1); - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php deleted file mode 100644 index a23032e..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php +++ /dev/null @@ -1,766 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting; - -use PHP_CodeSniffer\Config; -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Standards\PEAR\Sniffs\Commenting\FunctionCommentSniff as PEARFunctionCommentSniff; -use PHP_CodeSniffer\Util\Common; - -class FunctionCommentSniff extends PEARFunctionCommentSniff -{ - - /** - * Whether to skip inheritdoc comments. - * - * @var boolean - */ - public $skipIfInheritdoc = false; - - /** - * The current PHP version. - * - * @var integer - */ - private $phpVersion = null; - - - /** - * Process the return comment of this function comment. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * @param int $commentStart The position in the stack where the comment started. - * - * @return void - */ - protected function processReturn(File $phpcsFile, $stackPtr, $commentStart) - { - $tokens = $phpcsFile->getTokens(); - $return = null; - - if ($this->skipIfInheritdoc === true) { - if ($this->checkInheritdoc($phpcsFile, $stackPtr, $commentStart) === true) { - return; - } - } - - foreach ($tokens[$commentStart]['comment_tags'] as $tag) { - if ($tokens[$tag]['content'] === '@return') { - if ($return !== null) { - $error = 'Only 1 @return tag is allowed in a function comment'; - $phpcsFile->addError($error, $tag, 'DuplicateReturn'); - return; - } - - $return = $tag; - } - } - - // Skip constructor and destructor. - $methodName = $phpcsFile->getDeclarationName($stackPtr); - $isSpecialMethod = in_array($methodName, $this->specialMethods, true); - - if ($return !== null) { - $content = $tokens[($return + 2)]['content']; - if (empty($content) === true || $tokens[($return + 2)]['code'] !== T_DOC_COMMENT_STRING) { - $error = 'Return type missing for @return tag in function comment'; - $phpcsFile->addError($error, $return, 'MissingReturnType'); - } else { - // Support both a return type and a description. - preg_match('`^((?:\|?(?:array\([^\)]*\)|[\\\\a-z0-9\[\]]+))*)( .*)?`i', $content, $returnParts); - if (isset($returnParts[1]) === false) { - return; - } - - $returnType = $returnParts[1]; - - // Check return type (can be multiple, separated by '|'). - $typeNames = explode('|', $returnType); - $suggestedNames = []; - foreach ($typeNames as $i => $typeName) { - $suggestedName = Common::suggestType($typeName); - if (in_array($suggestedName, $suggestedNames, true) === false) { - $suggestedNames[] = $suggestedName; - } - } - - $suggestedType = implode('|', $suggestedNames); - if ($returnType !== $suggestedType) { - $error = 'Expected "%s" but found "%s" for function return type'; - $data = [ - $suggestedType, - $returnType, - ]; - $fix = $phpcsFile->addFixableError($error, $return, 'InvalidReturn', $data); - if ($fix === true) { - $replacement = $suggestedType; - if (empty($returnParts[2]) === false) { - $replacement .= $returnParts[2]; - } - - $phpcsFile->fixer->replaceToken(($return + 2), $replacement); - unset($replacement); - } - } - - // If the return type is void, make sure there is - // no return statement in the function. - if ($returnType === 'void') { - if (isset($tokens[$stackPtr]['scope_closer']) === true) { - $endToken = $tokens[$stackPtr]['scope_closer']; - for ($returnToken = $stackPtr; $returnToken < $endToken; $returnToken++) { - if ($tokens[$returnToken]['code'] === T_CLOSURE - || $tokens[$returnToken]['code'] === T_ANON_CLASS - ) { - $returnToken = $tokens[$returnToken]['scope_closer']; - continue; - } - - if ($tokens[$returnToken]['code'] === T_RETURN - || $tokens[$returnToken]['code'] === T_YIELD - || $tokens[$returnToken]['code'] === T_YIELD_FROM - ) { - break; - } - } - - if ($returnToken !== $endToken) { - // If the function is not returning anything, just - // exiting, then there is no problem. - $semicolon = $phpcsFile->findNext(T_WHITESPACE, ($returnToken + 1), null, true); - if ($tokens[$semicolon]['code'] !== T_SEMICOLON) { - $error = 'Function return type is void, but function contains return statement'; - $phpcsFile->addError($error, $return, 'InvalidReturnVoid'); - } - } - }//end if - } else if ($returnType !== 'mixed' && in_array('void', $typeNames, true) === false) { - // If return type is not void, there needs to be a return statement - // somewhere in the function that returns something. - if (isset($tokens[$stackPtr]['scope_closer']) === true) { - $endToken = $tokens[$stackPtr]['scope_closer']; - for ($returnToken = $stackPtr; $returnToken < $endToken; $returnToken++) { - if ($tokens[$returnToken]['code'] === T_CLOSURE - || $tokens[$returnToken]['code'] === T_ANON_CLASS - ) { - $returnToken = $tokens[$returnToken]['scope_closer']; - continue; - } - - if ($tokens[$returnToken]['code'] === T_RETURN - || $tokens[$returnToken]['code'] === T_YIELD - || $tokens[$returnToken]['code'] === T_YIELD_FROM - ) { - break; - } - } - - if ($returnToken === $endToken) { - $error = 'Function return type is not void, but function has no return statement'; - $phpcsFile->addError($error, $return, 'InvalidNoReturn'); - } else { - $semicolon = $phpcsFile->findNext(T_WHITESPACE, ($returnToken + 1), null, true); - if ($tokens[$semicolon]['code'] === T_SEMICOLON) { - $error = 'Function return type is not void, but function is returning void here'; - $phpcsFile->addError($error, $returnToken, 'InvalidReturnNotVoid'); - } - } - }//end if - }//end if - }//end if - } else { - if ($isSpecialMethod === true) { - return; - } - - $error = 'Missing @return tag in function comment'; - $phpcsFile->addError($error, $tokens[$commentStart]['comment_closer'], 'MissingReturn'); - }//end if - - }//end processReturn() - - - /** - * Process any throw tags that this function comment has. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * @param int $commentStart The position in the stack where the comment started. - * - * @return void - */ - protected function processThrows(File $phpcsFile, $stackPtr, $commentStart) - { - $tokens = $phpcsFile->getTokens(); - - if ($this->skipIfInheritdoc === true) { - if ($this->checkInheritdoc($phpcsFile, $stackPtr, $commentStart) === true) { - return; - } - } - - foreach ($tokens[$commentStart]['comment_tags'] as $pos => $tag) { - if ($tokens[$tag]['content'] !== '@throws') { - continue; - } - - $exception = null; - $comment = null; - if ($tokens[($tag + 2)]['code'] === T_DOC_COMMENT_STRING) { - $matches = []; - preg_match('/([^\s]+)(?:\s+(.*))?/', $tokens[($tag + 2)]['content'], $matches); - $exception = $matches[1]; - if (isset($matches[2]) === true && trim($matches[2]) !== '') { - $comment = $matches[2]; - } - } - - if ($exception === null) { - $error = 'Exception type and comment missing for @throws tag in function comment'; - $phpcsFile->addError($error, $tag, 'InvalidThrows'); - } else if ($comment === null) { - $error = 'Comment missing for @throws tag in function comment'; - $phpcsFile->addError($error, $tag, 'EmptyThrows'); - } else { - // Any strings until the next tag belong to this comment. - if (isset($tokens[$commentStart]['comment_tags'][($pos + 1)]) === true) { - $end = $tokens[$commentStart]['comment_tags'][($pos + 1)]; - } else { - $end = $tokens[$commentStart]['comment_closer']; - } - - for ($i = ($tag + 3); $i < $end; $i++) { - if ($tokens[$i]['code'] === T_DOC_COMMENT_STRING) { - $comment .= ' '.$tokens[$i]['content']; - } - } - - // Starts with a capital letter and ends with a fullstop. - $firstChar = $comment[0]; - if (strtoupper($firstChar) !== $firstChar) { - $error = '@throws tag comment must start with a capital letter'; - $phpcsFile->addError($error, ($tag + 2), 'ThrowsNotCapital'); - } - - $lastChar = substr($comment, -1); - if ($lastChar !== '.') { - $error = '@throws tag comment must end with a full stop'; - $phpcsFile->addError($error, ($tag + 2), 'ThrowsNoFullStop'); - } - }//end if - }//end foreach - - }//end processThrows() - - - /** - * Process the function parameter comments. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * @param int $commentStart The position in the stack where the comment started. - * - * @return void - */ - protected function processParams(File $phpcsFile, $stackPtr, $commentStart) - { - if ($this->phpVersion === null) { - $this->phpVersion = Config::getConfigData('php_version'); - if ($this->phpVersion === null) { - $this->phpVersion = PHP_VERSION_ID; - } - } - - $tokens = $phpcsFile->getTokens(); - - if ($this->skipIfInheritdoc === true) { - if ($this->checkInheritdoc($phpcsFile, $stackPtr, $commentStart) === true) { - return; - } - } - - $params = []; - $maxType = 0; - $maxVar = 0; - foreach ($tokens[$commentStart]['comment_tags'] as $pos => $tag) { - if ($tokens[$tag]['content'] !== '@param') { - continue; - } - - $type = ''; - $typeSpace = 0; - $var = ''; - $varSpace = 0; - $comment = ''; - $commentLines = []; - if ($tokens[($tag + 2)]['code'] === T_DOC_COMMENT_STRING) { - $matches = []; - preg_match('/([^$&.]+)(?:((?:\.\.\.)?(?:\$|&)[^\s]+)(?:(\s+)(.*))?)?/', $tokens[($tag + 2)]['content'], $matches); - - if (empty($matches) === false) { - $typeLen = strlen($matches[1]); - $type = trim($matches[1]); - $typeSpace = ($typeLen - strlen($type)); - $typeLen = strlen($type); - if ($typeLen > $maxType) { - $maxType = $typeLen; - } - } - - if (isset($matches[2]) === true) { - $var = $matches[2]; - $varLen = strlen($var); - if ($varLen > $maxVar) { - $maxVar = $varLen; - } - - if (isset($matches[4]) === true) { - $varSpace = strlen($matches[3]); - $comment = $matches[4]; - $commentLines[] = [ - 'comment' => $comment, - 'token' => ($tag + 2), - 'indent' => $varSpace, - ]; - - // Any strings until the next tag belong to this comment. - if (isset($tokens[$commentStart]['comment_tags'][($pos + 1)]) === true) { - $end = $tokens[$commentStart]['comment_tags'][($pos + 1)]; - } else { - $end = $tokens[$commentStart]['comment_closer']; - } - - for ($i = ($tag + 3); $i < $end; $i++) { - if ($tokens[$i]['code'] === T_DOC_COMMENT_STRING) { - $indent = 0; - if ($tokens[($i - 1)]['code'] === T_DOC_COMMENT_WHITESPACE) { - $indent = $tokens[($i - 1)]['length']; - } - - $comment .= ' '.$tokens[$i]['content']; - $commentLines[] = [ - 'comment' => $tokens[$i]['content'], - 'token' => $i, - 'indent' => $indent, - ]; - } - } - } else { - $error = 'Missing parameter comment'; - $phpcsFile->addError($error, $tag, 'MissingParamComment'); - $commentLines[] = ['comment' => '']; - }//end if - } else { - $error = 'Missing parameter name'; - $phpcsFile->addError($error, $tag, 'MissingParamName'); - }//end if - } else { - $error = 'Missing parameter type'; - $phpcsFile->addError($error, $tag, 'MissingParamType'); - }//end if - - $params[] = [ - 'tag' => $tag, - 'type' => $type, - 'var' => $var, - 'comment' => $comment, - 'commentLines' => $commentLines, - 'type_space' => $typeSpace, - 'var_space' => $varSpace, - ]; - }//end foreach - - $realParams = $phpcsFile->getMethodParameters($stackPtr); - $foundParams = []; - - // We want to use ... for all variable length arguments, so added - // this prefix to the variable name so comparisons are easier. - foreach ($realParams as $pos => $param) { - if ($param['variable_length'] === true) { - $realParams[$pos]['name'] = '...'.$realParams[$pos]['name']; - } - } - - foreach ($params as $pos => $param) { - // If the type is empty, the whole line is empty. - if ($param['type'] === '') { - continue; - } - - // Check the param type value. - $typeNames = explode('|', $param['type']); - $suggestedTypeNames = []; - - foreach ($typeNames as $typeName) { - // Strip nullable operator. - if ($typeName[0] === '?') { - $typeName = substr($typeName, 1); - } - - $suggestedName = Common::suggestType($typeName); - $suggestedTypeNames[] = $suggestedName; - - if (count($typeNames) > 1) { - continue; - } - - // Check type hint for array and custom type. - $suggestedTypeHint = ''; - if (strpos($suggestedName, 'array') !== false || substr($suggestedName, -2) === '[]') { - $suggestedTypeHint = 'array'; - } else if (strpos($suggestedName, 'callable') !== false) { - $suggestedTypeHint = 'callable'; - } else if (strpos($suggestedName, 'callback') !== false) { - $suggestedTypeHint = 'callable'; - } else if (in_array($suggestedName, Common::$allowedTypes, true) === false) { - $suggestedTypeHint = $suggestedName; - } - - if ($this->phpVersion >= 70000) { - if ($suggestedName === 'string') { - $suggestedTypeHint = 'string'; - } else if ($suggestedName === 'int' || $suggestedName === 'integer') { - $suggestedTypeHint = 'int'; - } else if ($suggestedName === 'float') { - $suggestedTypeHint = 'float'; - } else if ($suggestedName === 'bool' || $suggestedName === 'boolean') { - $suggestedTypeHint = 'bool'; - } - } - - if ($this->phpVersion >= 70200) { - if ($suggestedName === 'object') { - $suggestedTypeHint = 'object'; - } - } - - if ($this->phpVersion >= 80000) { - if ($suggestedName === 'mixed') { - $suggestedTypeHint = 'mixed'; - } - } - - if ($suggestedTypeHint !== '' && isset($realParams[$pos]) === true) { - $typeHint = $realParams[$pos]['type_hint']; - - // Remove namespace prefixes when comparing. - $compareTypeHint = substr($suggestedTypeHint, (strlen($typeHint) * -1)); - - if ($typeHint === '') { - $error = 'Type hint "%s" missing for %s'; - $data = [ - $suggestedTypeHint, - $param['var'], - ]; - - $errorCode = 'TypeHintMissing'; - if ($suggestedTypeHint === 'string' - || $suggestedTypeHint === 'int' - || $suggestedTypeHint === 'float' - || $suggestedTypeHint === 'bool' - ) { - $errorCode = 'Scalar'.$errorCode; - } - - $phpcsFile->addError($error, $stackPtr, $errorCode, $data); - } else if ($typeHint !== $compareTypeHint && $typeHint !== '?'.$compareTypeHint) { - $error = 'Expected type hint "%s"; found "%s" for %s'; - $data = [ - $suggestedTypeHint, - $typeHint, - $param['var'], - ]; - $phpcsFile->addError($error, $stackPtr, 'IncorrectTypeHint', $data); - }//end if - } else if ($suggestedTypeHint === '' && isset($realParams[$pos]) === true) { - $typeHint = $realParams[$pos]['type_hint']; - if ($typeHint !== '') { - $error = 'Unknown type hint "%s" found for %s'; - $data = [ - $typeHint, - $param['var'], - ]; - $phpcsFile->addError($error, $stackPtr, 'InvalidTypeHint', $data); - } - }//end if - }//end foreach - - $suggestedType = implode('|', $suggestedTypeNames); - if ($param['type'] !== $suggestedType) { - $error = 'Expected "%s" but found "%s" for parameter type'; - $data = [ - $suggestedType, - $param['type'], - ]; - - $fix = $phpcsFile->addFixableError($error, $param['tag'], 'IncorrectParamVarName', $data); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - - $content = $suggestedType; - $content .= str_repeat(' ', $param['type_space']); - $content .= $param['var']; - $content .= str_repeat(' ', $param['var_space']); - if (isset($param['commentLines'][0]) === true) { - $content .= $param['commentLines'][0]['comment']; - } - - $phpcsFile->fixer->replaceToken(($param['tag'] + 2), $content); - - // Fix up the indent of additional comment lines. - foreach ($param['commentLines'] as $lineNum => $line) { - if ($lineNum === 0 - || $param['commentLines'][$lineNum]['indent'] === 0 - ) { - continue; - } - - $diff = (strlen($param['type']) - strlen($suggestedType)); - $newIndent = ($param['commentLines'][$lineNum]['indent'] - $diff); - $phpcsFile->fixer->replaceToken( - ($param['commentLines'][$lineNum]['token'] - 1), - str_repeat(' ', $newIndent) - ); - } - - $phpcsFile->fixer->endChangeset(); - }//end if - }//end if - - if ($param['var'] === '') { - continue; - } - - $foundParams[] = $param['var']; - - // Check number of spaces after the type. - $this->checkSpacingAfterParamType($phpcsFile, $param, $maxType); - - // Make sure the param name is correct. - if (isset($realParams[$pos]) === true) { - $realName = $realParams[$pos]['name']; - if ($realName !== $param['var']) { - $code = 'ParamNameNoMatch'; - $data = [ - $param['var'], - $realName, - ]; - - $error = 'Doc comment for parameter %s does not match '; - if (strtolower($param['var']) === strtolower($realName)) { - $error .= 'case of '; - $code = 'ParamNameNoCaseMatch'; - } - - $error .= 'actual variable name %s'; - - $phpcsFile->addError($error, $param['tag'], $code, $data); - } - } else if (substr($param['var'], -4) !== ',...') { - // We must have an extra parameter comment. - $error = 'Superfluous parameter comment'; - $phpcsFile->addError($error, $param['tag'], 'ExtraParamComment'); - }//end if - - if ($param['comment'] === '') { - continue; - } - - // Check number of spaces after the var name. - $this->checkSpacingAfterParamName($phpcsFile, $param, $maxVar); - - // Param comments must start with a capital letter and end with a full stop. - if (preg_match('/^(\p{Ll}|\P{L})/u', $param['comment']) === 1) { - $error = 'Parameter comment must start with a capital letter'; - $phpcsFile->addError($error, $param['tag'], 'ParamCommentNotCapital'); - } - - $lastChar = substr($param['comment'], -1); - if ($lastChar !== '.') { - $error = 'Parameter comment must end with a full stop'; - $phpcsFile->addError($error, $param['tag'], 'ParamCommentFullStop'); - } - }//end foreach - - $realNames = []; - foreach ($realParams as $realParam) { - $realNames[] = $realParam['name']; - } - - // Report missing comments. - $diff = array_diff($realNames, $foundParams); - foreach ($diff as $neededParam) { - $error = 'Doc comment for parameter "%s" missing'; - $data = [$neededParam]; - $phpcsFile->addError($error, $commentStart, 'MissingParamTag', $data); - } - - }//end processParams() - - - /** - * Check the spacing after the type of a parameter. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param array $param The parameter to be checked. - * @param int $maxType The maxlength of the longest parameter type. - * @param int $spacing The number of spaces to add after the type. - * - * @return void - */ - protected function checkSpacingAfterParamType(File $phpcsFile, $param, $maxType, $spacing=1) - { - // Check number of spaces after the type. - $spaces = ($maxType - strlen($param['type']) + $spacing); - if ($param['type_space'] !== $spaces) { - $error = 'Expected %s spaces after parameter type; %s found'; - $data = [ - $spaces, - $param['type_space'], - ]; - - $fix = $phpcsFile->addFixableError($error, $param['tag'], 'SpacingAfterParamType', $data); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - - $content = $param['type']; - $content .= str_repeat(' ', $spaces); - $content .= $param['var']; - $content .= str_repeat(' ', $param['var_space']); - $content .= $param['commentLines'][0]['comment']; - $phpcsFile->fixer->replaceToken(($param['tag'] + 2), $content); - - // Fix up the indent of additional comment lines. - $diff = ($param['type_space'] - $spaces); - foreach ($param['commentLines'] as $lineNum => $line) { - if ($lineNum === 0 - || $param['commentLines'][$lineNum]['indent'] === 0 - ) { - continue; - } - - $newIndent = ($param['commentLines'][$lineNum]['indent'] - $diff); - if ($newIndent <= 0) { - continue; - } - - $phpcsFile->fixer->replaceToken( - ($param['commentLines'][$lineNum]['token'] - 1), - str_repeat(' ', $newIndent) - ); - } - - $phpcsFile->fixer->endChangeset(); - }//end if - }//end if - - }//end checkSpacingAfterParamType() - - - /** - * Check the spacing after the name of a parameter. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param array $param The parameter to be checked. - * @param int $maxVar The maxlength of the longest parameter name. - * @param int $spacing The number of spaces to add after the type. - * - * @return void - */ - protected function checkSpacingAfterParamName(File $phpcsFile, $param, $maxVar, $spacing=1) - { - // Check number of spaces after the var name. - $spaces = ($maxVar - strlen($param['var']) + $spacing); - if ($param['var_space'] !== $spaces) { - $error = 'Expected %s spaces after parameter name; %s found'; - $data = [ - $spaces, - $param['var_space'], - ]; - - $fix = $phpcsFile->addFixableError($error, $param['tag'], 'SpacingAfterParamName', $data); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - - $content = $param['type']; - $content .= str_repeat(' ', $param['type_space']); - $content .= $param['var']; - $content .= str_repeat(' ', $spaces); - $content .= $param['commentLines'][0]['comment']; - $phpcsFile->fixer->replaceToken(($param['tag'] + 2), $content); - - // Fix up the indent of additional comment lines. - foreach ($param['commentLines'] as $lineNum => $line) { - if ($lineNum === 0 - || $param['commentLines'][$lineNum]['indent'] === 0 - ) { - continue; - } - - $diff = ($param['var_space'] - $spaces); - $newIndent = ($param['commentLines'][$lineNum]['indent'] - $diff); - if ($newIndent <= 0) { - continue; - } - - $phpcsFile->fixer->replaceToken( - ($param['commentLines'][$lineNum]['token'] - 1), - str_repeat(' ', $newIndent) - ); - } - - $phpcsFile->fixer->endChangeset(); - }//end if - }//end if - - }//end checkSpacingAfterParamName() - - - /** - * Determines whether the whole comment is an inheritdoc comment. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * @param int $commentStart The position in the stack where the comment started. - * - * @return boolean TRUE if the docblock contains only {@inheritdoc} (case-insensitive). - */ - protected function checkInheritdoc(File $phpcsFile, $stackPtr, $commentStart) - { - $tokens = $phpcsFile->getTokens(); - - $allowedTokens = [ - T_DOC_COMMENT_OPEN_TAG, - T_DOC_COMMENT_WHITESPACE, - T_DOC_COMMENT_STAR, - ]; - for ($i = $commentStart; $i <= $tokens[$commentStart]['comment_closer']; $i++) { - if (in_array($tokens[$i]['code'], $allowedTokens) === false) { - $trimmedContent = strtolower(trim($tokens[$i]['content'])); - - if ($trimmedContent === '{@inheritdoc}') { - return true; - } else { - return false; - } - } - } - - return false; - - }//end checkInheritdoc() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentThrowTagSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentThrowTagSniff.php deleted file mode 100644 index a168bfe..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentThrowTagSniff.php +++ /dev/null @@ -1,233 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class FunctionCommentThrowTagSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_FUNCTION]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]['scope_closer']) === false) { - // Abstract or incomplete. - return; - } - - $find = Tokens::$methodPrefixes; - $find[] = T_WHITESPACE; - - $commentEnd = $phpcsFile->findPrevious($find, ($stackPtr - 1), null, true); - if ($tokens[$commentEnd]['code'] !== T_DOC_COMMENT_CLOSE_TAG) { - // Function doesn't have a doc comment or is using the wrong type of comment. - return; - } - - $stackPtrEnd = $tokens[$stackPtr]['scope_closer']; - - // Find all the exception type tokens within the current scope. - $thrownExceptions = []; - $currPos = $stackPtr; - $foundThrows = false; - $unknownCount = 0; - do { - $currPos = $phpcsFile->findNext([T_THROW, T_ANON_CLASS, T_CLOSURE], ($currPos + 1), $stackPtrEnd); - if ($currPos === false) { - break; - } - - if ($tokens[$currPos]['code'] !== T_THROW) { - $currPos = $tokens[$currPos]['scope_closer']; - continue; - } - - $foundThrows = true; - - /* - If we can't find a NEW, we are probably throwing - a variable or calling a method. - - If we're throwing a variable, and it's the same variable as the - exception container from the nearest 'catch' block, we take that exception - as it is likely to be a re-throw. - - If we can't find a matching catch block, or the variable name - is different, it's probably a different variable, so we ignore it, - but they still need to provide at least one @throws tag, even through we - don't know the exception class. - */ - - $nextToken = $phpcsFile->findNext(T_WHITESPACE, ($currPos + 1), null, true); - if ($tokens[$nextToken]['code'] === T_NEW - || $tokens[$nextToken]['code'] === T_NS_SEPARATOR - || $tokens[$nextToken]['code'] === T_STRING - ) { - if ($tokens[$nextToken]['code'] === T_NEW) { - $currException = $phpcsFile->findNext( - [ - T_NS_SEPARATOR, - T_STRING, - ], - $currPos, - $stackPtrEnd, - false, - null, - true - ); - } else { - $currException = $nextToken; - } - - if ($currException !== false) { - $endException = $phpcsFile->findNext( - [ - T_NS_SEPARATOR, - T_STRING, - ], - ($currException + 1), - $stackPtrEnd, - true, - null, - true - ); - - if ($endException === false) { - $thrownExceptions[] = $tokens[$currException]['content']; - } else { - $thrownExceptions[] = $phpcsFile->getTokensAsString($currException, ($endException - $currException)); - } - }//end if - } else if ($tokens[$nextToken]['code'] === T_VARIABLE) { - // Find the nearest catch block in this scope and, if the caught var - // matches our re-thrown var, use the exception types being caught as - // exception types that are being thrown as well. - $catch = $phpcsFile->findPrevious( - T_CATCH, - $currPos, - $tokens[$stackPtr]['scope_opener'], - false, - null, - false - ); - - if ($catch !== false) { - $thrownVar = $phpcsFile->findPrevious( - T_VARIABLE, - ($tokens[$catch]['parenthesis_closer'] - 1), - $tokens[$catch]['parenthesis_opener'] - ); - - if ($tokens[$thrownVar]['content'] === $tokens[$nextToken]['content']) { - $exceptions = explode('|', $phpcsFile->getTokensAsString(($tokens[$catch]['parenthesis_opener'] + 1), ($thrownVar - $tokens[$catch]['parenthesis_opener'] - 1))); - foreach ($exceptions as $exception) { - $thrownExceptions[] = trim($exception); - } - } - } - } else { - ++$unknownCount; - }//end if - } while ($currPos < $stackPtrEnd && $currPos !== false); - - if ($foundThrows === false) { - return; - } - - // Only need one @throws tag for each type of exception thrown. - $thrownExceptions = array_unique($thrownExceptions); - - $throwTags = []; - $commentStart = $tokens[$commentEnd]['comment_opener']; - foreach ($tokens[$commentStart]['comment_tags'] as $tag) { - if ($tokens[$tag]['content'] !== '@throws') { - continue; - } - - if ($tokens[($tag + 2)]['code'] === T_DOC_COMMENT_STRING) { - $exception = $tokens[($tag + 2)]['content']; - $space = strpos($exception, ' '); - if ($space !== false) { - $exception = substr($exception, 0, $space); - } - - $throwTags[$exception] = true; - } - } - - if (empty($throwTags) === true) { - $error = 'Missing @throws tag in function comment'; - $phpcsFile->addError($error, $commentEnd, 'Missing'); - return; - } else if (empty($thrownExceptions) === true) { - // If token count is zero, it means that only variables are being - // thrown, so we need at least one @throws tag (checked above). - // Nothing more to do. - return; - } - - // Make sure @throws tag count matches thrown count. - $thrownCount = (count($thrownExceptions) + $unknownCount); - $tagCount = count($throwTags); - if ($thrownCount !== $tagCount) { - $error = 'Expected %s @throws tag(s) in function comment; %s found'; - $data = [ - $thrownCount, - $tagCount, - ]; - $phpcsFile->addError($error, $commentEnd, 'WrongNumber', $data); - return; - } - - foreach ($thrownExceptions as $throw) { - if (isset($throwTags[$throw]) === true) { - continue; - } - - foreach ($throwTags as $tag => $ignore) { - if (strrpos($tag, $throw) === (strlen($tag) - strlen($throw))) { - continue 2; - } - } - - $error = 'Missing @throws tag for "%s" exception'; - $data = [$throw]; - $phpcsFile->addError($error, $commentEnd, 'Missing', $data); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/InlineCommentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/InlineCommentSniff.php deleted file mode 100644 index 7d7ee40..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/InlineCommentSniff.php +++ /dev/null @@ -1,347 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class InlineCommentSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_COMMENT, - T_DOC_COMMENT_OPEN_TAG, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // If this is a function/class/interface doc block comment, skip it. - // We are only interested in inline doc block comments, which are - // not allowed. - if ($tokens[$stackPtr]['code'] === T_DOC_COMMENT_OPEN_TAG) { - $nextToken = $stackPtr; - do { - $nextToken = $phpcsFile->findNext(Tokens::$emptyTokens, ($nextToken + 1), null, true); - if ($tokens[$nextToken]['code'] === T_ATTRIBUTE) { - $nextToken = $tokens[$nextToken]['attribute_closer']; - continue; - } - - break; - } while (true); - - $ignore = [ - T_CLASS, - T_INTERFACE, - T_TRAIT, - T_FUNCTION, - T_CLOSURE, - T_PUBLIC, - T_PRIVATE, - T_PROTECTED, - T_FINAL, - T_STATIC, - T_ABSTRACT, - T_CONST, - T_PROPERTY, - T_INCLUDE, - T_INCLUDE_ONCE, - T_REQUIRE, - T_REQUIRE_ONCE, - ]; - - if (in_array($tokens[$nextToken]['code'], $ignore, true) === true) { - return; - } - - if ($phpcsFile->tokenizerType === 'JS') { - // We allow block comments if a function or object - // is being assigned to a variable. - $ignore = Tokens::$emptyTokens; - $ignore[] = T_EQUAL; - $ignore[] = T_STRING; - $ignore[] = T_OBJECT_OPERATOR; - $nextToken = $phpcsFile->findNext($ignore, ($nextToken + 1), null, true); - if ($tokens[$nextToken]['code'] === T_FUNCTION - || $tokens[$nextToken]['code'] === T_CLOSURE - || $tokens[$nextToken]['code'] === T_OBJECT - || $tokens[$nextToken]['code'] === T_PROTOTYPE - ) { - return; - } - } - - $prevToken = $phpcsFile->findPrevious( - Tokens::$emptyTokens, - ($stackPtr - 1), - null, - true - ); - - if ($tokens[$prevToken]['code'] === T_OPEN_TAG) { - return; - } - - if ($tokens[$stackPtr]['content'] === '/**') { - $error = 'Inline doc block comments are not allowed; use "/* Comment */" or "// Comment" instead'; - $phpcsFile->addError($error, $stackPtr, 'DocBlock'); - } - }//end if - - if ($tokens[$stackPtr]['content'][0] === '#') { - $error = 'Perl-style comments are not allowed; use "// Comment" instead'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'WrongStyle'); - if ($fix === true) { - $comment = ltrim($tokens[$stackPtr]['content'], "# \t"); - $phpcsFile->fixer->replaceToken($stackPtr, "// $comment"); - } - } - - // We don't want end of block comments. Check if the last token before the - // comment is a closing curly brace. - $previousContent = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); - if ($tokens[$previousContent]['line'] === $tokens[$stackPtr]['line']) { - if ($tokens[$previousContent]['code'] === T_CLOSE_CURLY_BRACKET) { - return; - } - - // Special case for JS files. - if ($tokens[$previousContent]['code'] === T_COMMA - || $tokens[$previousContent]['code'] === T_SEMICOLON - ) { - $lastContent = $phpcsFile->findPrevious(T_WHITESPACE, ($previousContent - 1), null, true); - if ($tokens[$lastContent]['code'] === T_CLOSE_CURLY_BRACKET) { - return; - } - } - } - - // Only want inline comments. - if (substr($tokens[$stackPtr]['content'], 0, 2) !== '//') { - return; - } - - $commentTokens = [$stackPtr]; - - $nextComment = $stackPtr; - $lastComment = $stackPtr; - while (($nextComment = $phpcsFile->findNext(T_COMMENT, ($nextComment + 1), null, false)) !== false) { - if ($tokens[$nextComment]['line'] !== ($tokens[$lastComment]['line'] + 1)) { - break; - } - - // Only want inline comments. - if (substr($tokens[$nextComment]['content'], 0, 2) !== '//') { - break; - } - - // There is a comment on the very next line. If there is - // no code between the comments, they are part of the same - // comment block. - $prevNonWhitespace = $phpcsFile->findPrevious(T_WHITESPACE, ($nextComment - 1), $lastComment, true); - if ($prevNonWhitespace !== $lastComment) { - break; - } - - $commentTokens[] = $nextComment; - $lastComment = $nextComment; - }//end while - - $commentText = ''; - foreach ($commentTokens as $lastCommentToken) { - $comment = rtrim($tokens[$lastCommentToken]['content']); - - if (trim(substr($comment, 2)) === '') { - continue; - } - - $spaceCount = 0; - $tabFound = false; - - $commentLength = strlen($comment); - for ($i = 2; $i < $commentLength; $i++) { - if ($comment[$i] === "\t") { - $tabFound = true; - break; - } - - if ($comment[$i] !== ' ') { - break; - } - - $spaceCount++; - } - - $fix = false; - if ($tabFound === true) { - $error = 'Tab found before comment text; expected "// %s" but found "%s"'; - $data = [ - ltrim(substr($comment, 2)), - $comment, - ]; - $fix = $phpcsFile->addFixableError($error, $lastCommentToken, 'TabBefore', $data); - } else if ($spaceCount === 0) { - $error = 'No space found before comment text; expected "// %s" but found "%s"'; - $data = [ - substr($comment, 2), - $comment, - ]; - $fix = $phpcsFile->addFixableError($error, $lastCommentToken, 'NoSpaceBefore', $data); - } else if ($spaceCount > 1) { - $error = 'Expected 1 space before comment text but found %s; use block comment if you need indentation'; - $data = [ - $spaceCount, - substr($comment, (2 + $spaceCount)), - $comment, - ]; - $fix = $phpcsFile->addFixableError($error, $lastCommentToken, 'SpacingBefore', $data); - }//end if - - if ($fix === true) { - $newComment = '// '.ltrim($tokens[$lastCommentToken]['content'], "/\t "); - $phpcsFile->fixer->replaceToken($lastCommentToken, $newComment); - } - - $commentText .= trim(substr($tokens[$lastCommentToken]['content'], 2)); - }//end foreach - - if ($commentText === '') { - $error = 'Blank comments are not allowed'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Empty'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($stackPtr, ''); - } - - return ($lastCommentToken + 1); - } - - if (preg_match('/^\p{Ll}/u', $commentText) === 1) { - $error = 'Inline comments must start with a capital letter'; - $phpcsFile->addError($error, $stackPtr, 'NotCapital'); - } - - // Only check the end of comment character if the start of the comment - // is a letter, indicating that the comment is just standard text. - if (preg_match('/^\p{L}/u', $commentText) === 1) { - $commentCloser = $commentText[(strlen($commentText) - 1)]; - $acceptedClosers = [ - 'full-stops' => '.', - 'exclamation marks' => '!', - 'or question marks' => '?', - ]; - - if (in_array($commentCloser, $acceptedClosers, true) === false) { - $error = 'Inline comments must end in %s'; - $ender = ''; - foreach ($acceptedClosers as $closerName => $symbol) { - $ender .= ' '.$closerName.','; - } - - $ender = trim($ender, ' ,'); - $data = [$ender]; - $phpcsFile->addError($error, $lastCommentToken, 'InvalidEndChar', $data); - } - } - - // Finally, the line below the last comment cannot be empty if this inline - // comment is on a line by itself. - if ($tokens[$previousContent]['line'] < $tokens[$stackPtr]['line']) { - $next = $phpcsFile->findNext(T_WHITESPACE, ($lastCommentToken + 1), null, true); - if ($next === false) { - // Ignore if the comment is the last non-whitespace token in a file. - return ($lastCommentToken + 1); - } - - if ($tokens[$next]['code'] === T_DOC_COMMENT_OPEN_TAG) { - // If this inline comment is followed by a docblock, - // ignore spacing as docblock/function etc spacing rules - // are likely to conflict with our rules. - return ($lastCommentToken + 1); - } - - $errorCode = 'SpacingAfter'; - - if (isset($tokens[$stackPtr]['conditions']) === true) { - $conditions = $tokens[$stackPtr]['conditions']; - $type = end($conditions); - $conditionPtr = key($conditions); - - if (($type === T_FUNCTION || $type === T_CLOSURE) - && $tokens[$conditionPtr]['scope_closer'] === $next - ) { - $errorCode = 'SpacingAfterAtFunctionEnd'; - } - } - - for ($i = ($lastCommentToken + 1); $i < $phpcsFile->numTokens; $i++) { - if ($tokens[$i]['line'] === ($tokens[$lastCommentToken]['line'] + 1)) { - if ($tokens[$i]['code'] !== T_WHITESPACE) { - return ($lastCommentToken + 1); - } - } else if ($tokens[$i]['line'] > ($tokens[$lastCommentToken]['line'] + 1)) { - break; - } - } - - $error = 'There must be no blank line following an inline comment'; - $fix = $phpcsFile->addFixableError($error, $lastCommentToken, $errorCode); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($lastCommentToken + 1); $i < $next; $i++) { - if ($tokens[$i]['line'] === $tokens[$next]['line']) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - }//end if - - return ($lastCommentToken + 1); - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/LongConditionClosingCommentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/LongConditionClosingCommentSniff.php deleted file mode 100644 index 103d90f..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/LongConditionClosingCommentSniff.php +++ /dev/null @@ -1,218 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class LongConditionClosingCommentSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - /** - * The openers that we are interested in. - * - * @var integer[] - */ - private static $openers = [ - T_SWITCH, - T_IF, - T_FOR, - T_FOREACH, - T_WHILE, - T_TRY, - T_CASE, - T_MATCH, - ]; - - /** - * The length that a code block must be before - * requiring a closing comment. - * - * @var integer - */ - public $lineLimit = 20; - - /** - * The format the end comment should be in. - * - * The placeholder %s will be replaced with the type of condition opener. - * - * @var string - */ - public $commentFormat = '//end %s'; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_CLOSE_CURLY_BRACKET]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]['scope_condition']) === false) { - // No scope condition. It is a function closer. - return; - } - - $startCondition = $tokens[$tokens[$stackPtr]['scope_condition']]; - $startBrace = $tokens[$tokens[$stackPtr]['scope_opener']]; - $endBrace = $tokens[$stackPtr]; - - // We are only interested in some code blocks. - if (in_array($startCondition['code'], self::$openers, true) === false) { - return; - } - - if ($startCondition['code'] === T_IF) { - // If this is actually an ELSE IF, skip it as the brace - // will be checked by the original IF. - $else = $phpcsFile->findPrevious(T_WHITESPACE, ($tokens[$stackPtr]['scope_condition'] - 1), null, true); - if ($tokens[$else]['code'] === T_ELSE) { - return; - } - - // IF statements that have an ELSE block need to use - // "end if" rather than "end else" or "end elseif". - do { - $nextToken = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($tokens[$nextToken]['code'] === T_ELSE || $tokens[$nextToken]['code'] === T_ELSEIF) { - // Check for ELSE IF (2 tokens) as opposed to ELSEIF (1 token). - if ($tokens[$nextToken]['code'] === T_ELSE - && isset($tokens[$nextToken]['scope_closer']) === false - ) { - $nextToken = $phpcsFile->findNext(T_WHITESPACE, ($nextToken + 1), null, true); - if ($tokens[$nextToken]['code'] !== T_IF - || isset($tokens[$nextToken]['scope_closer']) === false - ) { - // Not an ELSE IF or is an inline ELSE IF. - break; - } - } - - if (isset($tokens[$nextToken]['scope_closer']) === false) { - // There isn't going to be anywhere to print the "end if" comment - // because there is no closer. - return; - } - - // The end brace becomes the ELSE's end brace. - $stackPtr = $tokens[$nextToken]['scope_closer']; - $endBrace = $tokens[$stackPtr]; - } else { - break; - }//end if - } while (isset($tokens[$nextToken]['scope_closer']) === true); - }//end if - - if ($startCondition['code'] === T_TRY) { - // TRY statements need to check until the end of all CATCH statements. - do { - $nextToken = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($tokens[$nextToken]['code'] === T_CATCH - || $tokens[$nextToken]['code'] === T_FINALLY - ) { - // The end brace becomes the CATCH end brace. - $stackPtr = $tokens[$nextToken]['scope_closer']; - $endBrace = $tokens[$stackPtr]; - } else { - break; - } - } while (isset($tokens[$nextToken]['scope_closer']) === true); - } - - if ($startCondition['code'] === T_MATCH) { - // Move the stackPtr to after the semi-colon/comma if there is one. - $nextToken = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($nextToken !== false - && ($tokens[$nextToken]['code'] === T_SEMICOLON - || $tokens[$nextToken]['code'] === T_COMMA) - ) { - $stackPtr = $nextToken; - } - } - - $lineDifference = ($endBrace['line'] - $startBrace['line']); - - $expected = sprintf($this->commentFormat, $startCondition['content']); - $comment = $phpcsFile->findNext([T_COMMENT], $stackPtr, null, false); - - if (($comment === false) || ($tokens[$comment]['line'] !== $endBrace['line'])) { - if ($lineDifference >= $this->lineLimit) { - $error = 'End comment for long condition not found; expected "%s"'; - $data = [$expected]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Missing', $data); - - if ($fix === true) { - $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($next !== false && $tokens[$next]['line'] === $tokens[$stackPtr]['line']) { - $expected .= $phpcsFile->eolChar; - } - - $phpcsFile->fixer->addContent($stackPtr, $expected); - } - } - - return; - } - - if (($comment - $stackPtr) !== 1) { - $error = 'Space found before closing comment; expected "%s"'; - $data = [$expected]; - $phpcsFile->addError($error, $stackPtr, 'SpacingBefore', $data); - } - - if (trim($tokens[$comment]['content']) !== $expected) { - $found = trim($tokens[$comment]['content']); - $error = 'Incorrect closing comment; expected "%s" but found "%s"'; - $data = [ - $expected, - $found, - ]; - - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Invalid', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($comment, $expected.$phpcsFile->eolChar); - } - - return; - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/PostStatementCommentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/PostStatementCommentSniff.php deleted file mode 100644 index ce19d5c..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/PostStatementCommentSniff.php +++ /dev/null @@ -1,121 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class PostStatementCommentSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - /** - * Exceptions to the rule. - * - * If post statement comments are found within the condition - * parenthesis of these structures, leave them alone. - * - * @var array - */ - private $controlStructureExceptions = [ - T_IF => true, - T_ELSEIF => true, - T_SWITCH => true, - T_WHILE => true, - T_FOR => true, - T_FOREACH => true, - T_MATCH => true, - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_COMMENT]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (substr($tokens[$stackPtr]['content'], 0, 2) !== '//') { - return; - } - - $commentLine = $tokens[$stackPtr]['line']; - $lastContent = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); - - if ($lastContent === false - || $tokens[$lastContent]['line'] !== $commentLine - || $tokens[$stackPtr]['column'] === 1 - ) { - return; - } - - if ($tokens[$lastContent]['code'] === T_CLOSE_CURLY_BRACKET) { - return; - } - - // Special case for JS files and PHP closures. - if ($tokens[$lastContent]['code'] === T_COMMA - || $tokens[$lastContent]['code'] === T_SEMICOLON - ) { - $lastContent = $phpcsFile->findPrevious(T_WHITESPACE, ($lastContent - 1), null, true); - if ($lastContent === false || $tokens[$lastContent]['code'] === T_CLOSE_CURLY_BRACKET) { - return; - } - } - - // Special case for (trailing) comments within multi-line control structures. - if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) { - $nestedParens = $tokens[$stackPtr]['nested_parenthesis']; - foreach ($nestedParens as $open => $close) { - if (isset($tokens[$open]['parenthesis_owner']) === true - && isset($this->controlStructureExceptions[$tokens[$tokens[$open]['parenthesis_owner']]['code']]) === true - ) { - return; - } - } - } - - $error = 'Comments may not appear after statements'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Found'); - if ($fix === true) { - $phpcsFile->fixer->addNewlineBefore($stackPtr); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/VariableCommentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/VariableCommentSniff.php deleted file mode 100644 index a7731bb..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/VariableCommentSniff.php +++ /dev/null @@ -1,192 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\AbstractVariableSniff; -use PHP_CodeSniffer\Util\Common; - -class VariableCommentSniff extends AbstractVariableSniff -{ - - - /** - * Called to process class member vars. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function processMemberVar(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $ignore = [ - T_PUBLIC => T_PUBLIC, - T_PRIVATE => T_PRIVATE, - T_PROTECTED => T_PROTECTED, - T_VAR => T_VAR, - T_STATIC => T_STATIC, - T_WHITESPACE => T_WHITESPACE, - T_STRING => T_STRING, - T_NS_SEPARATOR => T_NS_SEPARATOR, - T_NULLABLE => T_NULLABLE, - ]; - - for ($commentEnd = ($stackPtr - 1); $commentEnd >= 0; $commentEnd--) { - if (isset($ignore[$tokens[$commentEnd]['code']]) === true) { - continue; - } - - if ($tokens[$commentEnd]['code'] === T_ATTRIBUTE_END - && isset($tokens[$commentEnd]['attribute_opener']) === true - ) { - $commentEnd = $tokens[$commentEnd]['attribute_opener']; - continue; - } - - break; - } - - if ($commentEnd === false - || ($tokens[$commentEnd]['code'] !== T_DOC_COMMENT_CLOSE_TAG - && $tokens[$commentEnd]['code'] !== T_COMMENT) - ) { - $phpcsFile->addError('Missing member variable doc comment', $stackPtr, 'Missing'); - return; - } - - if ($tokens[$commentEnd]['code'] === T_COMMENT) { - $phpcsFile->addError('You must use "/**" style comments for a member variable comment', $stackPtr, 'WrongStyle'); - return; - } - - $commentStart = $tokens[$commentEnd]['comment_opener']; - - $foundVar = null; - foreach ($tokens[$commentStart]['comment_tags'] as $tag) { - if ($tokens[$tag]['content'] === '@var') { - if ($foundVar !== null) { - $error = 'Only one @var tag is allowed in a member variable comment'; - $phpcsFile->addError($error, $tag, 'DuplicateVar'); - } else { - $foundVar = $tag; - } - } else if ($tokens[$tag]['content'] === '@see') { - // Make sure the tag isn't empty. - $string = $phpcsFile->findNext(T_DOC_COMMENT_STRING, $tag, $commentEnd); - if ($string === false || $tokens[$string]['line'] !== $tokens[$tag]['line']) { - $error = 'Content missing for @see tag in member variable comment'; - $phpcsFile->addError($error, $tag, 'EmptySees'); - } - } else { - $error = '%s tag is not allowed in member variable comment'; - $data = [$tokens[$tag]['content']]; - $phpcsFile->addWarning($error, $tag, 'TagNotAllowed', $data); - }//end if - }//end foreach - - // The @var tag is the only one we require. - if ($foundVar === null) { - $error = 'Missing @var tag in member variable comment'; - $phpcsFile->addError($error, $commentEnd, 'MissingVar'); - return; - } - - $firstTag = $tokens[$commentStart]['comment_tags'][0]; - if ($foundVar !== null && $tokens[$firstTag]['content'] !== '@var') { - $error = 'The @var tag must be the first tag in a member variable comment'; - $phpcsFile->addError($error, $foundVar, 'VarOrder'); - } - - // Make sure the tag isn't empty and has the correct padding. - $string = $phpcsFile->findNext(T_DOC_COMMENT_STRING, $foundVar, $commentEnd); - if ($string === false || $tokens[$string]['line'] !== $tokens[$foundVar]['line']) { - $error = 'Content missing for @var tag in member variable comment'; - $phpcsFile->addError($error, $foundVar, 'EmptyVar'); - return; - } - - // Support both a var type and a description. - preg_match('`^((?:\|?(?:array\([^\)]*\)|[\\\\a-z0-9\[\]]+))*)( .*)?`i', $tokens[($foundVar + 2)]['content'], $varParts); - if (isset($varParts[1]) === false) { - return; - } - - $varType = $varParts[1]; - - // Check var type (can be multiple, separated by '|'). - $typeNames = explode('|', $varType); - $suggestedNames = []; - foreach ($typeNames as $i => $typeName) { - $suggestedName = Common::suggestType($typeName); - if (in_array($suggestedName, $suggestedNames, true) === false) { - $suggestedNames[] = $suggestedName; - } - } - - $suggestedType = implode('|', $suggestedNames); - if ($varType !== $suggestedType) { - $error = 'Expected "%s" but found "%s" for @var tag in member variable comment'; - $data = [ - $suggestedType, - $varType, - ]; - $fix = $phpcsFile->addFixableError($error, $foundVar, 'IncorrectVarType', $data); - if ($fix === true) { - $replacement = $suggestedType; - if (empty($varParts[2]) === false) { - $replacement .= $varParts[2]; - } - - $phpcsFile->fixer->replaceToken(($foundVar + 2), $replacement); - unset($replacement); - } - } - - }//end processMemberVar() - - - /** - * Called to process a normal variable. - * - * Not required for this sniff. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The PHP_CodeSniffer file where this token was found. - * @param int $stackPtr The position where the double quoted - * string was found. - * - * @return void - */ - protected function processVariable(File $phpcsFile, $stackPtr) - { - - }//end processVariable() - - - /** - * Called to process variables found in double quoted strings. - * - * Not required for this sniff. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The PHP_CodeSniffer file where this token was found. - * @param int $stackPtr The position where the double quoted - * string was found. - * - * @return void - */ - protected function processVariableInString(File $phpcsFile, $stackPtr) - { - - }//end processVariableInString() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ControlSignatureSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ControlSignatureSniff.php deleted file mode 100644 index 8a56b23..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ControlSignatureSniff.php +++ /dev/null @@ -1,325 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class ControlSignatureSniff implements Sniff -{ - - /** - * How many spaces should precede the colon if using alternative syntax. - * - * @var integer - */ - public $requiredSpacesBeforeColon = 1; - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return int[] - */ - public function register() - { - return [ - T_TRY, - T_CATCH, - T_FINALLY, - T_DO, - T_WHILE, - T_FOR, - T_IF, - T_FOREACH, - T_ELSE, - T_ELSEIF, - T_SWITCH, - T_MATCH, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($nextNonEmpty === false) { - return; - } - - $isAlternative = false; - if (isset($tokens[$stackPtr]['scope_opener']) === true - && $tokens[$tokens[$stackPtr]['scope_opener']]['code'] === T_COLON - ) { - $isAlternative = true; - } - - // Single space after the keyword. - $expected = 1; - if (isset($tokens[$stackPtr]['parenthesis_closer']) === false && $isAlternative === true) { - // Catching cases like: - // if (condition) : ... else: ... endif - // where there is no condition. - $expected = (int) $this->requiredSpacesBeforeColon; - } - - $found = 1; - if ($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { - $found = 0; - } else if ($tokens[($stackPtr + 1)]['content'] !== ' ') { - if (strpos($tokens[($stackPtr + 1)]['content'], $phpcsFile->eolChar) !== false) { - $found = 'newline'; - } else { - $found = $tokens[($stackPtr + 1)]['length']; - } - } - - if ($found !== $expected) { - $error = 'Expected %s space(s) after %s keyword; %s found'; - $data = [ - $expected, - strtoupper($tokens[$stackPtr]['content']), - $found, - ]; - - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterKeyword', $data); - if ($fix === true) { - if ($found === 0) { - $phpcsFile->fixer->addContent($stackPtr, str_repeat(' ', $expected)); - } else { - $phpcsFile->fixer->replaceToken(($stackPtr + 1), str_repeat(' ', $expected)); - } - } - } - - // Single space after closing parenthesis. - if (isset($tokens[$stackPtr]['parenthesis_closer']) === true - && isset($tokens[$stackPtr]['scope_opener']) === true - ) { - $expected = 1; - if ($isAlternative === true) { - $expected = (int) $this->requiredSpacesBeforeColon; - } - - $closer = $tokens[$stackPtr]['parenthesis_closer']; - $opener = $tokens[$stackPtr]['scope_opener']; - $content = $phpcsFile->getTokensAsString(($closer + 1), ($opener - $closer - 1)); - - if (trim($content) === '') { - if (strpos($content, $phpcsFile->eolChar) !== false) { - $found = 'newline'; - } else { - $found = strlen($content); - } - } else { - $found = '"'.str_replace($phpcsFile->eolChar, '\n', $content).'"'; - } - - if ($found !== $expected) { - $error = 'Expected %s space(s) after closing parenthesis; found %s'; - $data = [ - $expected, - $found, - ]; - - $fix = $phpcsFile->addFixableError($error, $closer, 'SpaceAfterCloseParenthesis', $data); - if ($fix === true) { - $padding = str_repeat(' ', $expected); - if ($closer === ($opener - 1)) { - $phpcsFile->fixer->addContent($closer, $padding); - } else { - $phpcsFile->fixer->beginChangeset(); - if (trim($content) === '') { - $phpcsFile->fixer->addContent($closer, $padding); - if ($found !== 0) { - for ($i = ($closer + 1); $i < $opener; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - } - } else { - $phpcsFile->fixer->addContent($closer, $padding.$tokens[$opener]['content']); - $phpcsFile->fixer->replaceToken($opener, ''); - - if ($tokens[$opener]['line'] !== $tokens[$closer]['line']) { - $next = $phpcsFile->findNext(T_WHITESPACE, ($opener + 1), null, true); - if ($tokens[$next]['line'] !== $tokens[$opener]['line']) { - for ($i = ($opener + 1); $i < $next; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - } - } - } - - $phpcsFile->fixer->endChangeset(); - }//end if - }//end if - }//end if - }//end if - - // Single newline after opening brace. - if (isset($tokens[$stackPtr]['scope_opener']) === true) { - $opener = $tokens[$stackPtr]['scope_opener']; - for ($next = ($opener + 1); $next < $phpcsFile->numTokens; $next++) { - $code = $tokens[$next]['code']; - - if ($code === T_WHITESPACE - || ($code === T_INLINE_HTML - && trim($tokens[$next]['content']) === '') - ) { - continue; - } - - // Skip all empty tokens on the same line as the opener. - if ($tokens[$next]['line'] === $tokens[$opener]['line'] - && (isset(Tokens::$emptyTokens[$code]) === true - || $code === T_CLOSE_TAG) - ) { - continue; - } - - // We found the first bit of a code, or a comment on the - // following line. - break; - }//end for - - if ($tokens[$next]['line'] === $tokens[$opener]['line']) { - $error = 'Newline required after opening brace'; - $fix = $phpcsFile->addFixableError($error, $opener, 'NewlineAfterOpenBrace'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($opener + 1); $i < $next; $i++) { - if (trim($tokens[$i]['content']) !== '') { - break; - } - - // Remove whitespace. - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->addContent($opener, $phpcsFile->eolChar); - $phpcsFile->fixer->endChangeset(); - } - }//end if - } else if ($tokens[$stackPtr]['code'] === T_WHILE) { - // Zero spaces after parenthesis closer, but only if followed by a semicolon. - $closer = $tokens[$stackPtr]['parenthesis_closer']; - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($closer + 1), null, true); - if ($nextNonEmpty !== false && $tokens[$nextNonEmpty]['code'] === T_SEMICOLON) { - $found = 0; - if ($tokens[($closer + 1)]['code'] === T_WHITESPACE) { - if (strpos($tokens[($closer + 1)]['content'], $phpcsFile->eolChar) !== false) { - $found = 'newline'; - } else { - $found = $tokens[($closer + 1)]['length']; - } - } - - if ($found !== 0) { - $error = 'Expected 0 spaces before semicolon; %s found'; - $data = [$found]; - $fix = $phpcsFile->addFixableError($error, $closer, 'SpaceBeforeSemicolon', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($closer + 1), ''); - } - } - } - }//end if - - // Only want to check multi-keyword structures from here on. - if ($tokens[$stackPtr]['code'] === T_WHILE) { - if (isset($tokens[$stackPtr]['scope_closer']) !== false) { - return; - } - - $closer = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if ($closer === false - || $tokens[$closer]['code'] !== T_CLOSE_CURLY_BRACKET - || $tokens[$tokens[$closer]['scope_condition']]['code'] !== T_DO - ) { - return; - } - } else if ($tokens[$stackPtr]['code'] === T_ELSE - || $tokens[$stackPtr]['code'] === T_ELSEIF - || $tokens[$stackPtr]['code'] === T_CATCH - || $tokens[$stackPtr]['code'] === T_FINALLY - ) { - if (isset($tokens[$stackPtr]['scope_opener']) === true - && $tokens[$tokens[$stackPtr]['scope_opener']]['code'] === T_COLON - ) { - // Special case for alternate syntax, where this token is actually - // the closer for the previous block, so there is no spacing to check. - return; - } - - $closer = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if ($closer === false || $tokens[$closer]['code'] !== T_CLOSE_CURLY_BRACKET) { - return; - } - } else { - return; - }//end if - - // Single space after closing brace. - $found = 1; - if ($tokens[($closer + 1)]['code'] !== T_WHITESPACE) { - $found = 0; - } else if ($tokens[$closer]['line'] !== $tokens[$stackPtr]['line']) { - $found = 'newline'; - } else if ($tokens[($closer + 1)]['content'] !== ' ') { - $found = $tokens[($closer + 1)]['length']; - } - - if ($found !== 1) { - $error = 'Expected 1 space after closing brace; %s found'; - $data = [$found]; - - if ($phpcsFile->findNext(Tokens::$commentTokens, ($closer + 1), $stackPtr) !== false) { - // Comment found between closing brace and keyword, don't auto-fix. - $phpcsFile->addError($error, $closer, 'SpaceAfterCloseBrace', $data); - return; - } - - $fix = $phpcsFile->addFixableError($error, $closer, 'SpaceAfterCloseBrace', $data); - if ($fix === true) { - if ($found === 0) { - $phpcsFile->fixer->addContent($closer, ' '); - } else { - $phpcsFile->fixer->replaceToken(($closer + 1), ' '); - } - } - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ElseIfDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ElseIfDeclarationSniff.php deleted file mode 100644 index 8abb8fb..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ElseIfDeclarationSniff.php +++ /dev/null @@ -1,51 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class ElseIfDeclarationSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_ELSEIF]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $error = 'Usage of ELSEIF not allowed; use ELSE IF instead'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NotAllowed'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($stackPtr, 'else if'); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php deleted file mode 100644 index c5f22e2..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php +++ /dev/null @@ -1,236 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class ForEachLoopDeclarationSniff implements Sniff -{ - - /** - * How many spaces should follow the opening bracket. - * - * @var integer - */ - public $requiredSpacesAfterOpen = 0; - - /** - * How many spaces should precede the closing bracket. - * - * @var integer - */ - public $requiredSpacesBeforeClose = 0; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_FOREACH]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $this->requiredSpacesAfterOpen = (int) $this->requiredSpacesAfterOpen; - $this->requiredSpacesBeforeClose = (int) $this->requiredSpacesBeforeClose; - $tokens = $phpcsFile->getTokens(); - - $openingBracket = $phpcsFile->findNext(T_OPEN_PARENTHESIS, $stackPtr); - if ($openingBracket === false) { - $error = 'Possible parse error: FOREACH has no opening parenthesis'; - $phpcsFile->addWarning($error, $stackPtr, 'MissingOpenParenthesis'); - return; - } - - if (isset($tokens[$openingBracket]['parenthesis_closer']) === false) { - $error = 'Possible parse error: FOREACH has no closing parenthesis'; - $phpcsFile->addWarning($error, $stackPtr, 'MissingCloseParenthesis'); - return; - } - - $closingBracket = $tokens[$openingBracket]['parenthesis_closer']; - - if ($this->requiredSpacesAfterOpen === 0 && $tokens[($openingBracket + 1)]['code'] === T_WHITESPACE) { - $error = 'Space found after opening bracket of FOREACH loop'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterOpen'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($openingBracket + 1), ''); - } - } else if ($this->requiredSpacesAfterOpen > 0) { - $spaceAfterOpen = 0; - if ($tokens[($openingBracket + 1)]['code'] === T_WHITESPACE) { - $spaceAfterOpen = $tokens[($openingBracket + 1)]['length']; - } - - if ($spaceAfterOpen !== $this->requiredSpacesAfterOpen) { - $error = 'Expected %s spaces after opening bracket; %s found'; - $data = [ - $this->requiredSpacesAfterOpen, - $spaceAfterOpen, - ]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingAfterOpen', $data); - if ($fix === true) { - $padding = str_repeat(' ', $this->requiredSpacesAfterOpen); - if ($spaceAfterOpen === 0) { - $phpcsFile->fixer->addContent($openingBracket, $padding); - } else { - $phpcsFile->fixer->replaceToken(($openingBracket + 1), $padding); - } - } - } - }//end if - - if ($this->requiredSpacesBeforeClose === 0 && $tokens[($closingBracket - 1)]['code'] === T_WHITESPACE) { - $error = 'Space found before closing bracket of FOREACH loop'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceBeforeClose'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($closingBracket - 1), ''); - } - } else if ($this->requiredSpacesBeforeClose > 0) { - $spaceBeforeClose = 0; - if ($tokens[($closingBracket - 1)]['code'] === T_WHITESPACE) { - $spaceBeforeClose = $tokens[($closingBracket - 1)]['length']; - } - - if ($spaceBeforeClose !== $this->requiredSpacesBeforeClose) { - $error = 'Expected %s spaces before closing bracket; %s found'; - $data = [ - $this->requiredSpacesBeforeClose, - $spaceBeforeClose, - ]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceBeforeClose', $data); - if ($fix === true) { - $padding = str_repeat(' ', $this->requiredSpacesBeforeClose); - if ($spaceBeforeClose === 0) { - $phpcsFile->fixer->addContentBefore($closingBracket, $padding); - } else { - $phpcsFile->fixer->replaceToken(($closingBracket - 1), $padding); - } - } - } - }//end if - - $asToken = $phpcsFile->findNext(T_AS, $openingBracket); - if ($asToken === false) { - $error = 'Possible parse error: FOREACH has no AS statement'; - $phpcsFile->addWarning($error, $stackPtr, 'MissingAs'); - return; - } - - $content = $tokens[$asToken]['content']; - if ($content !== strtolower($content)) { - $expected = strtolower($content); - $error = 'AS keyword must be lowercase; expected "%s" but found "%s"'; - $data = [ - $expected, - $content, - ]; - - $fix = $phpcsFile->addFixableError($error, $asToken, 'AsNotLower', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($asToken, $expected); - } - } - - $doubleArrow = $phpcsFile->findNext(T_DOUBLE_ARROW, $asToken, $closingBracket); - - if ($doubleArrow !== false) { - if ($tokens[($doubleArrow - 1)]['code'] !== T_WHITESPACE) { - $error = 'Expected 1 space before "=>"; 0 found'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceBeforeArrow'); - if ($fix === true) { - $phpcsFile->fixer->addContentBefore($doubleArrow, ' '); - } - } else { - if ($tokens[($doubleArrow - 1)]['length'] !== 1) { - $spaces = $tokens[($doubleArrow - 1)]['length']; - $error = 'Expected 1 space before "=>"; %s found'; - $data = [$spaces]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingBeforeArrow', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($doubleArrow - 1), ' '); - } - } - } - - if ($tokens[($doubleArrow + 1)]['code'] !== T_WHITESPACE) { - $error = 'Expected 1 space after "=>"; 0 found'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceAfterArrow'); - if ($fix === true) { - $phpcsFile->fixer->addContent($doubleArrow, ' '); - } - } else { - if ($tokens[($doubleArrow + 1)]['length'] !== 1) { - $spaces = $tokens[($doubleArrow + 1)]['length']; - $error = 'Expected 1 space after "=>"; %s found'; - $data = [$spaces]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingAfterArrow', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($doubleArrow + 1), ' '); - } - } - } - }//end if - - if ($tokens[($asToken - 1)]['code'] !== T_WHITESPACE) { - $error = 'Expected 1 space before "as"; 0 found'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceBeforeAs'); - if ($fix === true) { - $phpcsFile->fixer->addContentBefore($asToken, ' '); - } - } else { - if ($tokens[($asToken - 1)]['length'] !== 1) { - $spaces = $tokens[($asToken - 1)]['length']; - $error = 'Expected 1 space before "as"; %s found'; - $data = [$spaces]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingBeforeAs', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($asToken - 1), ' '); - } - } - } - - if ($tokens[($asToken + 1)]['code'] !== T_WHITESPACE) { - $error = 'Expected 1 space after "as"; 0 found'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceAfterAs'); - if ($fix === true) { - $phpcsFile->fixer->addContent($asToken, ' '); - } - } else { - if ($tokens[($asToken + 1)]['length'] !== 1) { - $spaces = $tokens[($asToken + 1)]['length']; - $error = 'Expected 1 space after "as"; %s found'; - $data = [$spaces]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingAfterAs', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($asToken + 1), ' '); - } - } - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ForLoopDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ForLoopDeclarationSniff.php deleted file mode 100644 index 6803f9a..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ForLoopDeclarationSniff.php +++ /dev/null @@ -1,316 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class ForLoopDeclarationSniff implements Sniff -{ - - /** - * How many spaces should follow the opening bracket. - * - * @var integer - */ - public $requiredSpacesAfterOpen = 0; - - /** - * How many spaces should precede the closing bracket. - * - * @var integer - */ - public $requiredSpacesBeforeClose = 0; - - /** - * Allow newlines instead of spaces. - * - * @var boolean - */ - public $ignoreNewlines = false; - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_FOR]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $this->requiredSpacesAfterOpen = (int) $this->requiredSpacesAfterOpen; - $this->requiredSpacesBeforeClose = (int) $this->requiredSpacesBeforeClose; - $tokens = $phpcsFile->getTokens(); - - $openingBracket = $phpcsFile->findNext(T_OPEN_PARENTHESIS, $stackPtr); - if ($openingBracket === false) { - $error = 'Possible parse error: no opening parenthesis for FOR keyword'; - $phpcsFile->addWarning($error, $stackPtr, 'NoOpenBracket'); - return; - } - - $closingBracket = $tokens[$openingBracket]['parenthesis_closer']; - - if ($this->requiredSpacesAfterOpen === 0 - && $tokens[($openingBracket + 1)]['code'] === T_WHITESPACE - ) { - $nextNonWhiteSpace = $phpcsFile->findNext(T_WHITESPACE, ($openingBracket + 1), $closingBracket, true); - if ($this->ignoreNewlines === false - || $tokens[$nextNonWhiteSpace]['line'] === $tokens[$openingBracket]['line'] - ) { - $error = 'Whitespace found after opening bracket of FOR loop'; - $fix = $phpcsFile->addFixableError($error, $openingBracket, 'SpacingAfterOpen'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($openingBracket + 1); $i < $closingBracket; $i++) { - if ($tokens[$i]['code'] !== T_WHITESPACE) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } - } else if ($this->requiredSpacesAfterOpen > 0) { - $nextNonWhiteSpace = $phpcsFile->findNext(T_WHITESPACE, ($openingBracket + 1), $closingBracket, true); - $spaceAfterOpen = 0; - if ($tokens[$openingBracket]['line'] !== $tokens[$nextNonWhiteSpace]['line']) { - $spaceAfterOpen = 'newline'; - } else if ($tokens[($openingBracket + 1)]['code'] === T_WHITESPACE) { - $spaceAfterOpen = $tokens[($openingBracket + 1)]['length']; - } - - if ($spaceAfterOpen !== $this->requiredSpacesAfterOpen - && ($this->ignoreNewlines === false - || $spaceAfterOpen !== 'newline') - ) { - $error = 'Expected %s spaces after opening bracket; %s found'; - $data = [ - $this->requiredSpacesAfterOpen, - $spaceAfterOpen, - ]; - $fix = $phpcsFile->addFixableError($error, $openingBracket, 'SpacingAfterOpen', $data); - if ($fix === true) { - $padding = str_repeat(' ', $this->requiredSpacesAfterOpen); - if ($spaceAfterOpen === 0) { - $phpcsFile->fixer->addContent($openingBracket, $padding); - } else { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken(($openingBracket + 1), $padding); - for ($i = ($openingBracket + 2); $i < $nextNonWhiteSpace; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } - }//end if - }//end if - - $prevNonWhiteSpace = $phpcsFile->findPrevious(T_WHITESPACE, ($closingBracket - 1), $openingBracket, true); - $beforeClosefixable = true; - if ($tokens[$prevNonWhiteSpace]['line'] !== $tokens[$closingBracket]['line'] - && isset(Tokens::$emptyTokens[$tokens[$prevNonWhiteSpace]['code']]) === true - ) { - $beforeClosefixable = false; - } - - if ($this->requiredSpacesBeforeClose === 0 - && $tokens[($closingBracket - 1)]['code'] === T_WHITESPACE - && ($this->ignoreNewlines === false - || $tokens[$prevNonWhiteSpace]['line'] === $tokens[$closingBracket]['line']) - ) { - $error = 'Whitespace found before closing bracket of FOR loop'; - - if ($beforeClosefixable === false) { - $phpcsFile->addError($error, $closingBracket, 'SpacingBeforeClose'); - } else { - $fix = $phpcsFile->addFixableError($error, $closingBracket, 'SpacingBeforeClose'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($closingBracket - 1); $i > $openingBracket; $i--) { - if ($tokens[$i]['code'] !== T_WHITESPACE) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } - } else if ($this->requiredSpacesBeforeClose > 0) { - $spaceBeforeClose = 0; - if ($tokens[$closingBracket]['line'] !== $tokens[$prevNonWhiteSpace]['line']) { - $spaceBeforeClose = 'newline'; - } else if ($tokens[($closingBracket - 1)]['code'] === T_WHITESPACE) { - $spaceBeforeClose = $tokens[($closingBracket - 1)]['length']; - } - - if ($this->requiredSpacesBeforeClose !== $spaceBeforeClose - && ($this->ignoreNewlines === false - || $spaceBeforeClose !== 'newline') - ) { - $error = 'Expected %s spaces before closing bracket; %s found'; - $data = [ - $this->requiredSpacesBeforeClose, - $spaceBeforeClose, - ]; - - if ($beforeClosefixable === false) { - $phpcsFile->addError($error, $closingBracket, 'SpacingBeforeClose', $data); - } else { - $fix = $phpcsFile->addFixableError($error, $closingBracket, 'SpacingBeforeClose', $data); - if ($fix === true) { - $padding = str_repeat(' ', $this->requiredSpacesBeforeClose); - if ($spaceBeforeClose === 0) { - $phpcsFile->fixer->addContentBefore($closingBracket, $padding); - } else { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken(($closingBracket - 1), $padding); - for ($i = ($closingBracket - 2); $i > $prevNonWhiteSpace; $i--) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } - } - }//end if - }//end if - - /* - * Check whitespace around each of the semicolon tokens. - */ - - $semicolonCount = 0; - $semicolon = $openingBracket; - $targetNestinglevel = 0; - if (isset($tokens[$openingBracket]['conditions']) === true) { - $targetNestinglevel += count($tokens[$openingBracket]['conditions']); - } - - do { - $semicolon = $phpcsFile->findNext(T_SEMICOLON, ($semicolon + 1), $closingBracket); - if ($semicolon === false) { - break; - } - - if (isset($tokens[$semicolon]['conditions']) === true - && count($tokens[$semicolon]['conditions']) > $targetNestinglevel - ) { - // Semicolon doesn't belong to the for(). - continue; - } - - ++$semicolonCount; - - $humanReadableCount = 'first'; - if ($semicolonCount !== 1) { - $humanReadableCount = 'second'; - } - - $humanReadableCode = ucfirst($humanReadableCount); - $data = [$humanReadableCount]; - - // Only examine the space before the first semicolon if the first expression is not empty. - // If it *is* empty, leave it up to the `SpacingAfterOpen` logic. - $prevNonWhiteSpace = $phpcsFile->findPrevious(T_WHITESPACE, ($semicolon - 1), $openingBracket, true); - if ($semicolonCount !== 1 || $prevNonWhiteSpace !== $openingBracket) { - if ($tokens[($semicolon - 1)]['code'] === T_WHITESPACE) { - $error = 'Whitespace found before %s semicolon of FOR loop'; - $errorCode = 'SpacingBefore'.$humanReadableCode; - $fix = $phpcsFile->addFixableError($error, $semicolon, $errorCode, $data); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($semicolon - 1); $i > $prevNonWhiteSpace; $i--) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } - } - - // Only examine the space after the second semicolon if the last expression is not empty. - // If it *is* empty, leave it up to the `SpacingBeforeClose` logic. - $nextNonWhiteSpace = $phpcsFile->findNext(T_WHITESPACE, ($semicolon + 1), ($closingBracket + 1), true); - if ($semicolonCount !== 2 || $nextNonWhiteSpace !== $closingBracket) { - if ($tokens[($semicolon + 1)]['code'] !== T_WHITESPACE - && $tokens[($semicolon + 1)]['code'] !== T_SEMICOLON - ) { - $error = 'Expected 1 space after %s semicolon of FOR loop; 0 found'; - $errorCode = 'NoSpaceAfter'.$humanReadableCode; - $fix = $phpcsFile->addFixableError($error, $semicolon, $errorCode, $data); - if ($fix === true) { - $phpcsFile->fixer->addContent($semicolon, ' '); - } - } else if ($tokens[($semicolon + 1)]['code'] === T_WHITESPACE - && $tokens[$nextNonWhiteSpace]['code'] !== T_SEMICOLON - ) { - $spaces = $tokens[($semicolon + 1)]['length']; - if ($tokens[$semicolon]['line'] !== $tokens[$nextNonWhiteSpace]['line']) { - $spaces = 'newline'; - } - - if ($spaces !== 1 - && ($this->ignoreNewlines === false - || $spaces !== 'newline') - ) { - $error = 'Expected 1 space after %s semicolon of FOR loop; %s found'; - $errorCode = 'SpacingAfter'.$humanReadableCode; - $data[] = $spaces; - $fix = $phpcsFile->addFixableError($error, $semicolon, $errorCode, $data); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken(($semicolon + 1), ' '); - for ($i = ($semicolon + 2); $i < $nextNonWhiteSpace; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } - }//end if - }//end if - } while ($semicolonCount < 2); - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/InlineIfDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/InlineIfDeclarationSniff.php deleted file mode 100644 index 2844379..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/InlineIfDeclarationSniff.php +++ /dev/null @@ -1,155 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class InlineIfDeclarationSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_INLINE_THEN]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $openBracket = null; - $closeBracket = null; - if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) { - $parens = $tokens[$stackPtr]['nested_parenthesis']; - $openBracket = array_pop($parens); - $closeBracket = $tokens[$openBracket]['parenthesis_closer']; - } - - // Find the beginning of the statement. If we don't find a - // semicolon (end of statement) or comma (end of array value) - // then assume the content before the closing parenthesis is the end. - $else = $phpcsFile->findNext(T_INLINE_ELSE, ($stackPtr + 1)); - $statementEnd = $phpcsFile->findNext([T_SEMICOLON, T_COMMA], ($else + 1), $closeBracket); - if ($statementEnd === false) { - $statementEnd = $phpcsFile->findPrevious(T_WHITESPACE, ($closeBracket - 1), null, true); - } - - // Make sure it's all on the same line. - if ($tokens[$statementEnd]['line'] !== $tokens[$stackPtr]['line']) { - $error = 'Inline shorthand IF statement must be declared on a single line'; - $phpcsFile->addError($error, $stackPtr, 'NotSingleLine'); - return; - } - - // Make sure there are spaces around the question mark. - $contentBefore = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); - $contentAfter = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($tokens[$contentBefore]['code'] !== T_CLOSE_PARENTHESIS) { - $error = 'Inline shorthand IF statement requires brackets around comparison'; - $phpcsFile->addError($error, $stackPtr, 'NoBrackets'); - } - - $spaceBefore = ($tokens[$stackPtr]['column'] - ($tokens[$contentBefore]['column'] + $tokens[$contentBefore]['length'])); - if ($spaceBefore !== 1) { - $error = 'Inline shorthand IF statement requires 1 space before THEN; %s found'; - $data = [$spaceBefore]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingBeforeThen', $data); - if ($fix === true) { - if ($spaceBefore === 0) { - $phpcsFile->fixer->addContentBefore($stackPtr, ' '); - } else { - $phpcsFile->fixer->replaceToken(($stackPtr - 1), ' '); - } - } - } - - // If there is no content between the ? and the : operators, then they are - // trying to replicate an elvis operator, even though PHP doesn't have one. - // In this case, we want no spaces between the two operators so ?: looks like - // an operator itself. - $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($tokens[$next]['code'] === T_INLINE_ELSE) { - $inlineElse = $next; - if ($inlineElse !== ($stackPtr + 1)) { - $error = 'Inline shorthand IF statement without THEN statement requires 0 spaces between THEN and ELSE'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'ElvisSpacing'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($stackPtr + 1), ''); - } - } - } else { - $spaceAfter = (($tokens[$contentAfter]['column']) - ($tokens[$stackPtr]['column'] + 1)); - if ($spaceAfter !== 1) { - $error = 'Inline shorthand IF statement requires 1 space after THEN; %s found'; - $data = [$spaceAfter]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingAfterThen', $data); - if ($fix === true) { - if ($spaceAfter === 0) { - $phpcsFile->fixer->addContent($stackPtr, ' '); - } else { - $phpcsFile->fixer->replaceToken(($stackPtr + 1), ' '); - } - } - } - - // Make sure the ELSE has the correct spacing. - $inlineElse = $phpcsFile->findNext(T_INLINE_ELSE, ($stackPtr + 1), $statementEnd, false); - $contentBefore = $phpcsFile->findPrevious(T_WHITESPACE, ($inlineElse - 1), null, true); - $spaceBefore = ($tokens[$inlineElse]['column'] - ($tokens[$contentBefore]['column'] + $tokens[$contentBefore]['length'])); - if ($spaceBefore !== 1) { - $error = 'Inline shorthand IF statement requires 1 space before ELSE; %s found'; - $data = [$spaceBefore]; - $fix = $phpcsFile->addFixableError($error, $inlineElse, 'SpacingBeforeElse', $data); - if ($fix === true) { - if ($spaceBefore === 0) { - $phpcsFile->fixer->addContentBefore($inlineElse, ' '); - } else { - $phpcsFile->fixer->replaceToken(($inlineElse - 1), ' '); - } - } - } - }//end if - - $contentAfter = $phpcsFile->findNext(T_WHITESPACE, ($inlineElse + 1), null, true); - $spaceAfter = (($tokens[$contentAfter]['column']) - ($tokens[$inlineElse]['column'] + 1)); - if ($spaceAfter !== 1) { - $error = 'Inline shorthand IF statement requires 1 space after ELSE; %s found'; - $data = [$spaceAfter]; - $fix = $phpcsFile->addFixableError($error, $inlineElse, 'SpacingAfterElse', $data); - if ($fix === true) { - if ($spaceAfter === 0) { - $phpcsFile->fixer->addContent($inlineElse, ' '); - } else { - $phpcsFile->fixer->replaceToken(($inlineElse + 1), ' '); - } - } - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/LowercaseDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/LowercaseDeclarationSniff.php deleted file mode 100644 index cba0768..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/LowercaseDeclarationSniff.php +++ /dev/null @@ -1,75 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class LowercaseDeclarationSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_IF, - T_ELSE, - T_ELSEIF, - T_FOREACH, - T_FOR, - T_DO, - T_SWITCH, - T_WHILE, - T_TRY, - T_CATCH, - T_MATCH, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $content = $tokens[$stackPtr]['content']; - $contentLc = strtolower($content); - if ($content !== $contentLc) { - $error = '%s keyword must be lowercase; expected "%s" but found "%s"'; - $data = [ - strtoupper($content), - $contentLc, - $content, - ]; - - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'FoundUppercase', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($stackPtr, $contentLc); - } - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/SwitchDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/SwitchDeclarationSniff.php deleted file mode 100644 index a5f3769..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/SwitchDeclarationSniff.php +++ /dev/null @@ -1,304 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class SwitchDeclarationSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - /** - * The number of spaces code should be indented. - * - * @var integer - */ - public $indent = 4; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_SWITCH]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // We can't process SWITCH statements unless we know where they start and end. - if (isset($tokens[$stackPtr]['scope_opener']) === false - || isset($tokens[$stackPtr]['scope_closer']) === false - ) { - return; - } - - $switch = $tokens[$stackPtr]; - $nextCase = $stackPtr; - $caseAlignment = ($switch['column'] + $this->indent); - $caseCount = 0; - $foundDefault = false; - - while (($nextCase = $phpcsFile->findNext([T_CASE, T_DEFAULT, T_SWITCH], ($nextCase + 1), $switch['scope_closer'])) !== false) { - // Skip nested SWITCH statements; they are handled on their own. - if ($tokens[$nextCase]['code'] === T_SWITCH) { - $nextCase = $tokens[$nextCase]['scope_closer']; - continue; - } - - if ($tokens[$nextCase]['code'] === T_DEFAULT) { - $type = 'Default'; - $foundDefault = true; - } else { - $type = 'Case'; - $caseCount++; - } - - if ($tokens[$nextCase]['content'] !== strtolower($tokens[$nextCase]['content'])) { - $expected = strtolower($tokens[$nextCase]['content']); - $error = strtoupper($type).' keyword must be lowercase; expected "%s" but found "%s"'; - $data = [ - $expected, - $tokens[$nextCase]['content'], - ]; - - $fix = $phpcsFile->addFixableError($error, $nextCase, $type.'NotLower', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($nextCase, $expected); - } - } - - if ($tokens[$nextCase]['column'] !== $caseAlignment) { - $error = strtoupper($type).' keyword must be indented '.$this->indent.' spaces from SWITCH keyword'; - $fix = $phpcsFile->addFixableError($error, $nextCase, $type.'Indent'); - - if ($fix === true) { - $padding = str_repeat(' ', ($caseAlignment - 1)); - if ($tokens[$nextCase]['column'] === 1 - || $tokens[($nextCase - 1)]['code'] !== T_WHITESPACE - ) { - $phpcsFile->fixer->addContentBefore($nextCase, $padding); - } else { - $phpcsFile->fixer->replaceToken(($nextCase - 1), $padding); - } - } - } - - if ($type === 'Case' - && ($tokens[($nextCase + 1)]['type'] !== 'T_WHITESPACE' - || $tokens[($nextCase + 1)]['content'] !== ' ') - ) { - $error = 'CASE keyword must be followed by a single space'; - $fix = $phpcsFile->addFixableError($error, $nextCase, 'SpacingAfterCase'); - if ($fix === true) { - if ($tokens[($nextCase + 1)]['type'] !== 'T_WHITESPACE') { - $phpcsFile->fixer->addContent($nextCase, ' '); - } else { - $phpcsFile->fixer->replaceToken(($nextCase + 1), ' '); - } - } - } - - if (isset($tokens[$nextCase]['scope_opener']) === false) { - $error = 'Possible parse error: CASE missing opening colon'; - $phpcsFile->addWarning($error, $nextCase, 'MissingColon'); - continue; - } - - $opener = $tokens[$nextCase]['scope_opener']; - if ($tokens[($opener - 1)]['type'] === 'T_WHITESPACE') { - $error = 'There must be no space before the colon in a '.strtoupper($type).' statement'; - $fix = $phpcsFile->addFixableError($error, $nextCase, 'SpaceBeforeColon'.$type); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($opener - 1), ''); - } - } - - $nextBreak = $tokens[$nextCase]['scope_closer']; - if ($tokens[$nextBreak]['code'] === T_BREAK - || $tokens[$nextBreak]['code'] === T_RETURN - || $tokens[$nextBreak]['code'] === T_CONTINUE - || $tokens[$nextBreak]['code'] === T_THROW - || $tokens[$nextBreak]['code'] === T_EXIT - ) { - if ($tokens[$nextBreak]['scope_condition'] === $nextCase) { - // Only need to check a couple of things once, even if the - // break is shared between multiple case statements, or even - // the default case. - if ($tokens[$nextBreak]['column'] !== $caseAlignment) { - $error = 'Case breaking statement must be indented '.$this->indent.' spaces from SWITCH keyword'; - $fix = $phpcsFile->addFixableError($error, $nextBreak, 'BreakIndent'); - - if ($fix === true) { - $padding = str_repeat(' ', ($caseAlignment - 1)); - if ($tokens[$nextBreak]['column'] === 1 - || $tokens[($nextBreak - 1)]['code'] !== T_WHITESPACE - ) { - $phpcsFile->fixer->addContentBefore($nextBreak, $padding); - } else { - $phpcsFile->fixer->replaceToken(($nextBreak - 1), $padding); - } - } - } - - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($nextBreak - 1), $stackPtr, true); - if ($tokens[$prev]['line'] !== ($tokens[$nextBreak]['line'] - 1)) { - $error = 'Blank lines are not allowed before case breaking statements'; - $phpcsFile->addError($error, $nextBreak, 'SpacingBeforeBreak'); - } - - $nextLine = $tokens[$tokens[$stackPtr]['scope_closer']]['line']; - $semicolon = $phpcsFile->findEndOfStatement($nextBreak); - for ($i = ($semicolon + 1); $i < $tokens[$stackPtr]['scope_closer']; $i++) { - if ($tokens[$i]['type'] !== 'T_WHITESPACE') { - $nextLine = $tokens[$i]['line']; - break; - } - } - - if ($type === 'Case') { - // Ensure the BREAK statement is followed by - // a single blank line, or the end switch brace. - if ($nextLine !== ($tokens[$semicolon]['line'] + 2) && $i !== $tokens[$stackPtr]['scope_closer']) { - $error = 'Case breaking statements must be followed by a single blank line'; - $fix = $phpcsFile->addFixableError($error, $nextBreak, 'SpacingAfterBreak'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($semicolon + 1); $i <= $tokens[$stackPtr]['scope_closer']; $i++) { - if ($tokens[$i]['line'] === $nextLine) { - $phpcsFile->fixer->addNewlineBefore($i); - break; - } - - if ($tokens[$i]['line'] === $tokens[$semicolon]['line']) { - continue; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - }//end if - } else { - // Ensure the BREAK statement is not followed by a blank line. - if ($nextLine !== ($tokens[$semicolon]['line'] + 1)) { - $error = 'Blank lines are not allowed after the DEFAULT case\'s breaking statement'; - $phpcsFile->addError($error, $nextBreak, 'SpacingAfterDefaultBreak'); - } - }//end if - - $caseLine = $tokens[$nextCase]['line']; - $nextLine = $tokens[$nextBreak]['line']; - for ($i = ($opener + 1); $i < $nextBreak; $i++) { - if ($tokens[$i]['type'] !== 'T_WHITESPACE') { - $nextLine = $tokens[$i]['line']; - break; - } - } - - if ($nextLine !== ($caseLine + 1)) { - $error = 'Blank lines are not allowed after '.strtoupper($type).' statements'; - $phpcsFile->addError($error, $nextCase, 'SpacingAfter'.$type); - } - }//end if - - if ($tokens[$nextBreak]['code'] === T_BREAK) { - if ($type === 'Case') { - // Ensure empty CASE statements are not allowed. - // They must have some code content in them. A comment is not enough. - // But count RETURN statements as valid content if they also - // happen to close the CASE statement. - $foundContent = false; - for ($i = ($tokens[$nextCase]['scope_opener'] + 1); $i < $nextBreak; $i++) { - if ($tokens[$i]['code'] === T_CASE) { - $i = $tokens[$i]['scope_opener']; - continue; - } - - if (isset(Tokens::$emptyTokens[$tokens[$i]['code']]) === false) { - $foundContent = true; - break; - } - } - - if ($foundContent === false) { - $error = 'Empty CASE statements are not allowed'; - $phpcsFile->addError($error, $nextCase, 'EmptyCase'); - } - } else { - // Ensure empty DEFAULT statements are not allowed. - // They must (at least) have a comment describing why - // the default case is being ignored. - $foundContent = false; - for ($i = ($tokens[$nextCase]['scope_opener'] + 1); $i < $nextBreak; $i++) { - if ($tokens[$i]['type'] !== 'T_WHITESPACE') { - $foundContent = true; - break; - } - } - - if ($foundContent === false) { - $error = 'Comment required for empty DEFAULT case'; - $phpcsFile->addError($error, $nextCase, 'EmptyDefault'); - } - }//end if - }//end if - } else if ($type === 'Default') { - $error = 'DEFAULT case must have a breaking statement'; - $phpcsFile->addError($error, $nextCase, 'DefaultNoBreak'); - }//end if - }//end while - - if ($foundDefault === false) { - $error = 'All SWITCH statements must contain a DEFAULT case'; - $phpcsFile->addError($error, $stackPtr, 'MissingDefault'); - } - - if ($tokens[$switch['scope_closer']]['column'] !== $switch['column']) { - $error = 'Closing brace of SWITCH statement must be aligned with SWITCH keyword'; - $phpcsFile->addError($error, $switch['scope_closer'], 'CloseBraceAlign'); - } - - if ($caseCount === 0) { - $error = 'SWITCH statements must contain at least one CASE statement'; - $phpcsFile->addError($error, $stackPtr, 'MissingCase'); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Debug/JSLintSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Debug/JSLintSniff.php deleted file mode 100644 index 49dfc2c..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Debug/JSLintSniff.php +++ /dev/null @@ -1,86 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Debug; - -use PHP_CodeSniffer\Config; -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Common; - -class JSLintSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['JS']; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return int[] - */ - public function register() - { - return [T_OPEN_TAG]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If jslint.js could not be run - */ - public function process(File $phpcsFile, $stackPtr) - { - $rhinoPath = Config::getExecutablePath('rhino'); - $jslintPath = Config::getExecutablePath('jslint'); - if ($rhinoPath === null || $jslintPath === null) { - return; - } - - $fileName = $phpcsFile->getFilename(); - - $rhinoPath = Common::escapeshellcmd($rhinoPath); - $jslintPath = Common::escapeshellcmd($jslintPath); - - $cmd = "$rhinoPath \"$jslintPath\" ".escapeshellarg($fileName); - exec($cmd, $output, $retval); - - if (is_array($output) === true) { - foreach ($output as $finding) { - $matches = []; - $numMatches = preg_match('/Lint at line ([0-9]+).*:(.*)$/', $finding, $matches); - if ($numMatches === 0) { - continue; - } - - $line = (int) $matches[1]; - $message = 'jslint says: '.trim($matches[2]); - $phpcsFile->addWarningOnLine($message, $line, 'ExternalTool'); - } - } - - // Ignore the rest of the file. - return ($phpcsFile->numTokens + 1); - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Debug/JavaScriptLintSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Debug/JavaScriptLintSniff.php deleted file mode 100644 index 30dca67..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Debug/JavaScriptLintSniff.php +++ /dev/null @@ -1,89 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Debug; - -use PHP_CodeSniffer\Config; -use PHP_CodeSniffer\Exceptions\RuntimeException; -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Common; - -class JavaScriptLintSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['JS']; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return int[] - */ - public function register() - { - return [T_OPEN_TAG]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If Javascript Lint ran into trouble. - */ - public function process(File $phpcsFile, $stackPtr) - { - $jslPath = Config::getExecutablePath('jsl'); - if ($jslPath === null) { - return; - } - - $fileName = $phpcsFile->getFilename(); - - $cmd = '"'.Common::escapeshellcmd($jslPath).'" -nologo -nofilelisting -nocontext -nosummary -output-format __LINE__:__ERROR__ -process '.escapeshellarg($fileName); - $msg = exec($cmd, $output, $retval); - - // Variable $exitCode is the last line of $output if no error occurs, on - // error it is numeric. Try to handle various error conditions and - // provide useful error reporting. - if ($retval === 2 || $retval === 4) { - if (is_array($output) === true) { - $msg = join('\n', $output); - } - - throw new RuntimeException("Failed invoking JavaScript Lint, retval was [$retval], output was [$msg]"); - } - - if (is_array($output) === true) { - foreach ($output as $finding) { - $split = strpos($finding, ':'); - $line = substr($finding, 0, $split); - $message = substr($finding, ($split + 1)); - $phpcsFile->addWarningOnLine(trim($message), $line, 'ExternalTool'); - } - } - - // Ignore the rest of the file. - return ($phpcsFile->numTokens + 1); - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Files/FileExtensionSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Files/FileExtensionSniff.php deleted file mode 100644 index bae8821..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Files/FileExtensionSniff.php +++ /dev/null @@ -1,68 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Files; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class FileExtensionSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_OPEN_TAG]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return int - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $fileName = $phpcsFile->getFilename(); - $extension = substr($fileName, strrpos($fileName, '.')); - $nextClass = $phpcsFile->findNext([T_CLASS, T_INTERFACE, T_TRAIT], $stackPtr); - - if ($nextClass !== false) { - $phpcsFile->recordMetric($stackPtr, 'File extension for class files', $extension); - if ($extension === '.php') { - $error = '%s found in ".php" file; use ".inc" extension instead'; - $data = [ucfirst($tokens[$nextClass]['content'])]; - $phpcsFile->addError($error, $stackPtr, 'ClassFound', $data); - } - } else { - $phpcsFile->recordMetric($stackPtr, 'File extension for non-class files', $extension); - if ($extension === '.inc') { - $error = 'No interface or class found in ".inc" file; use ".php" extension instead'; - $phpcsFile->addError($error, $stackPtr, 'NoClass'); - } - } - - // Ignore the rest of the file. - return ($phpcsFile->numTokens + 1); - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Formatting/OperatorBracketSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Formatting/OperatorBracketSniff.php deleted file mode 100644 index 60b113d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Formatting/OperatorBracketSniff.php +++ /dev/null @@ -1,393 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Formatting; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class OperatorBracketSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return Tokens::$operators; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if ($phpcsFile->tokenizerType === 'JS' && $tokens[$stackPtr]['code'] === T_PLUS) { - // JavaScript uses the plus operator for string concatenation as well - // so we cannot accurately determine if it is a string concat or addition. - // So just ignore it. - return; - } - - // If the & is a reference, then we don't want to check for brackets. - if ($tokens[$stackPtr]['code'] === T_BITWISE_AND && $phpcsFile->isReference($stackPtr) === true) { - return; - } - - // There is one instance where brackets aren't needed, which involves - // the minus sign being used to assign a negative number to a variable. - if ($tokens[$stackPtr]['code'] === T_MINUS) { - // Check to see if we are trying to return -n. - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if ($tokens[$prev]['code'] === T_RETURN) { - return; - } - - $number = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($tokens[$number]['code'] === T_LNUMBER || $tokens[$number]['code'] === T_DNUMBER) { - $previous = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); - if ($previous !== false) { - $isAssignment = isset(Tokens::$assignmentTokens[$tokens[$previous]['code']]); - $isEquality = isset(Tokens::$equalityTokens[$tokens[$previous]['code']]); - $isComparison = isset(Tokens::$comparisonTokens[$tokens[$previous]['code']]); - $isUnary = isset(Tokens::$operators[$tokens[$previous]['code']]); - if ($isAssignment === true || $isEquality === true || $isComparison === true || $isUnary === true) { - // This is a negative assignment or comparison. - // We need to check that the minus and the number are - // adjacent. - if (($number - $stackPtr) !== 1) { - $error = 'No space allowed between minus sign and number'; - $phpcsFile->addError($error, $stackPtr, 'SpacingAfterMinus'); - } - - return; - } - } - } - }//end if - - $previousToken = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true, null, true); - if ($previousToken !== false) { - // A list of tokens that indicate that the token is not - // part of an arithmetic operation. - $invalidTokens = [ - T_COMMA => true, - T_COLON => true, - T_OPEN_PARENTHESIS => true, - T_OPEN_SQUARE_BRACKET => true, - T_OPEN_CURLY_BRACKET => true, - T_OPEN_SHORT_ARRAY => true, - T_CASE => true, - T_EXIT => true, - ]; - - if (isset($invalidTokens[$tokens[$previousToken]['code']]) === true) { - return; - } - } - - if ($tokens[$stackPtr]['code'] === T_BITWISE_OR - && isset($tokens[$stackPtr]['nested_parenthesis']) === true - ) { - $brackets = $tokens[$stackPtr]['nested_parenthesis']; - $lastBracket = array_pop($brackets); - if (isset($tokens[$lastBracket]['parenthesis_owner']) === true - && $tokens[$tokens[$lastBracket]['parenthesis_owner']]['code'] === T_CATCH - ) { - // This is a pipe character inside a catch statement, so it is acting - // as an exception type separator and not an arithmetic operation. - return; - } - } - - // Tokens that are allowed inside a bracketed operation. - $allowed = [ - T_VARIABLE, - T_LNUMBER, - T_DNUMBER, - T_STRING, - T_WHITESPACE, - T_NS_SEPARATOR, - T_THIS, - T_SELF, - T_STATIC, - T_OBJECT_OPERATOR, - T_NULLSAFE_OBJECT_OPERATOR, - T_DOUBLE_COLON, - T_OPEN_SQUARE_BRACKET, - T_CLOSE_SQUARE_BRACKET, - T_MODULUS, - T_NONE, - T_BITWISE_NOT, - ]; - - $allowed += Tokens::$operators; - - $lastBracket = false; - if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) { - $parenthesis = array_reverse($tokens[$stackPtr]['nested_parenthesis'], true); - foreach ($parenthesis as $bracket => $endBracket) { - $prevToken = $phpcsFile->findPrevious(T_WHITESPACE, ($bracket - 1), null, true); - $prevCode = $tokens[$prevToken]['code']; - - if ($prevCode === T_ISSET) { - // This operation is inside an isset() call, but has - // no bracket of it's own. - break; - } - - if ($prevCode === T_STRING || $prevCode === T_SWITCH || $prevCode === T_MATCH) { - // We allow simple operations to not be bracketed. - // For example, ceil($one / $two). - for ($prev = ($stackPtr - 1); $prev > $bracket; $prev--) { - if (in_array($tokens[$prev]['code'], $allowed, true) === true) { - continue; - } - - if ($tokens[$prev]['code'] === T_CLOSE_PARENTHESIS) { - $prev = $tokens[$prev]['parenthesis_opener']; - } else { - break; - } - } - - if ($prev !== $bracket) { - break; - } - - for ($next = ($stackPtr + 1); $next < $endBracket; $next++) { - if (in_array($tokens[$next]['code'], $allowed, true) === true) { - continue; - } - - if ($tokens[$next]['code'] === T_OPEN_PARENTHESIS) { - $next = $tokens[$next]['parenthesis_closer']; - } else { - break; - } - } - - if ($next !== $endBracket) { - break; - } - }//end if - - if (in_array($prevCode, Tokens::$scopeOpeners, true) === true) { - // This operation is inside a control structure like FOREACH - // or IF, but has no bracket of it's own. - // The only control structures allowed to do this are SWITCH and MATCH. - if ($prevCode !== T_SWITCH && $prevCode !== T_MATCH) { - break; - } - } - - if ($prevCode === T_OPEN_PARENTHESIS) { - // These are two open parenthesis in a row. If the current - // one doesn't enclose the operator, go to the previous one. - if ($endBracket < $stackPtr) { - continue; - } - } - - $lastBracket = $bracket; - break; - }//end foreach - }//end if - - if ($lastBracket === false) { - // It is not in a bracketed statement at all. - $this->addMissingBracketsError($phpcsFile, $stackPtr); - return; - } else if ($tokens[$lastBracket]['parenthesis_closer'] < $stackPtr) { - // There are a set of brackets in front of it that don't include it. - $this->addMissingBracketsError($phpcsFile, $stackPtr); - return; - } else { - // We are enclosed in a set of bracket, so the last thing to - // check is that we are not also enclosed in square brackets - // like this: ($array[$index + 1]), which is invalid. - $brackets = [ - T_OPEN_SQUARE_BRACKET, - T_CLOSE_SQUARE_BRACKET, - ]; - - $squareBracket = $phpcsFile->findPrevious($brackets, ($stackPtr - 1), $lastBracket); - if ($squareBracket !== false && $tokens[$squareBracket]['code'] === T_OPEN_SQUARE_BRACKET) { - $closeSquareBracket = $phpcsFile->findNext($brackets, ($stackPtr + 1)); - if ($closeSquareBracket !== false && $tokens[$closeSquareBracket]['code'] === T_CLOSE_SQUARE_BRACKET) { - $this->addMissingBracketsError($phpcsFile, $stackPtr); - } - } - - return; - }//end if - - $lastAssignment = $phpcsFile->findPrevious(Tokens::$assignmentTokens, $stackPtr, null, false, null, true); - if ($lastAssignment !== false && $lastAssignment > $lastBracket) { - $this->addMissingBracketsError($phpcsFile, $stackPtr); - } - - }//end process() - - - /** - * Add and fix the missing brackets error. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function addMissingBracketsError($phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $allowed = [ - T_VARIABLE => true, - T_LNUMBER => true, - T_DNUMBER => true, - T_STRING => true, - T_CONSTANT_ENCAPSED_STRING => true, - T_DOUBLE_QUOTED_STRING => true, - T_WHITESPACE => true, - T_NS_SEPARATOR => true, - T_THIS => true, - T_SELF => true, - T_STATIC => true, - T_OBJECT_OPERATOR => true, - T_NULLSAFE_OBJECT_OPERATOR => true, - T_DOUBLE_COLON => true, - T_MODULUS => true, - T_ISSET => true, - T_ARRAY => true, - T_NONE => true, - T_BITWISE_NOT => true, - ]; - - // Find the first token in the expression. - for ($before = ($stackPtr - 1); $before > 0; $before--) { - // Special case for plus operators because we can't tell if they are used - // for addition or string contact. So assume string concat to be safe. - if ($phpcsFile->tokenizerType === 'JS' && $tokens[$before]['code'] === T_PLUS) { - break; - } - - if (isset(Tokens::$emptyTokens[$tokens[$before]['code']]) === true - || isset(Tokens::$operators[$tokens[$before]['code']]) === true - || isset(Tokens::$castTokens[$tokens[$before]['code']]) === true - || isset($allowed[$tokens[$before]['code']]) === true - ) { - continue; - } - - if ($tokens[$before]['code'] === T_CLOSE_PARENTHESIS) { - $before = $tokens[$before]['parenthesis_opener']; - continue; - } - - if ($tokens[$before]['code'] === T_CLOSE_SQUARE_BRACKET) { - $before = $tokens[$before]['bracket_opener']; - continue; - } - - if ($tokens[$before]['code'] === T_CLOSE_SHORT_ARRAY) { - $before = $tokens[$before]['bracket_opener']; - continue; - } - - break; - }//end for - - $before = $phpcsFile->findNext(Tokens::$emptyTokens, ($before + 1), null, true); - - // A few extra tokens are allowed to be on the right side of the expression. - $allowed[T_EQUAL] = true; - $allowed[T_NEW] = true; - - // Find the last token in the expression. - for ($after = ($stackPtr + 1); $after < $phpcsFile->numTokens; $after++) { - // Special case for plus operators because we can't tell if they are used - // for addition or string concat. So assume string concat to be safe. - if ($phpcsFile->tokenizerType === 'JS' && $tokens[$after]['code'] === T_PLUS) { - break; - } - - if (isset(Tokens::$emptyTokens[$tokens[$after]['code']]) === true - || isset(Tokens::$operators[$tokens[$after]['code']]) === true - || isset(Tokens::$castTokens[$tokens[$after]['code']]) === true - || isset($allowed[$tokens[$after]['code']]) === true - ) { - continue; - } - - if ($tokens[$after]['code'] === T_OPEN_PARENTHESIS) { - $after = $tokens[$after]['parenthesis_closer']; - continue; - } - - if ($tokens[$after]['code'] === T_OPEN_SQUARE_BRACKET) { - $after = $tokens[$after]['bracket_closer']; - continue; - } - - if ($tokens[$after]['code'] === T_OPEN_SHORT_ARRAY) { - $after = $tokens[$after]['bracket_closer']; - continue; - } - - break; - }//end for - - $after = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($after - 1), null, true); - - $error = 'Operation must be bracketed'; - if ($before === $after || $before === $stackPtr || $after === $stackPtr) { - $phpcsFile->addError($error, $stackPtr, 'MissingBrackets'); - return; - } - - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'MissingBrackets'); - if ($fix === true) { - // Can only fix this error if both tokens are available for fixing. - // Adding one bracket without the other will create parse errors. - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($before, '('.$tokens[$before]['content']); - $phpcsFile->fixer->replaceToken($after, $tokens[$after]['content'].')'); - $phpcsFile->fixer->endChangeset(); - } - - }//end addMissingBracketsError() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php deleted file mode 100644 index e696d80..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php +++ /dev/null @@ -1,398 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class FunctionDeclarationArgumentSpacingSniff implements Sniff -{ - - /** - * How many spaces should surround the equals signs. - * - * @var integer - */ - public $equalsSpacing = 0; - - /** - * How many spaces should follow the opening bracket. - * - * @var integer - */ - public $requiredSpacesAfterOpen = 0; - - /** - * How many spaces should precede the closing bracket. - * - * @var integer - */ - public $requiredSpacesBeforeClose = 0; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_FUNCTION, - T_CLOSURE, - T_FN, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]['parenthesis_opener']) === false - || isset($tokens[$stackPtr]['parenthesis_closer']) === false - || $tokens[$stackPtr]['parenthesis_opener'] === null - || $tokens[$stackPtr]['parenthesis_closer'] === null - ) { - return; - } - - $this->equalsSpacing = (int) $this->equalsSpacing; - $this->requiredSpacesAfterOpen = (int) $this->requiredSpacesAfterOpen; - $this->requiredSpacesBeforeClose = (int) $this->requiredSpacesBeforeClose; - - $this->processBracket($phpcsFile, $tokens[$stackPtr]['parenthesis_opener']); - - if ($tokens[$stackPtr]['code'] === T_CLOSURE) { - $use = $phpcsFile->findNext(T_USE, ($tokens[$stackPtr]['parenthesis_closer'] + 1), $tokens[$stackPtr]['scope_opener']); - if ($use !== false) { - $openBracket = $phpcsFile->findNext(T_OPEN_PARENTHESIS, ($use + 1), null); - $this->processBracket($phpcsFile, $openBracket); - } - } - - }//end process() - - - /** - * Processes the contents of a single set of brackets. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $openBracket The position of the open bracket - * in the stack. - * - * @return void - */ - public function processBracket($phpcsFile, $openBracket) - { - $tokens = $phpcsFile->getTokens(); - $closeBracket = $tokens[$openBracket]['parenthesis_closer']; - $multiLine = ($tokens[$openBracket]['line'] !== $tokens[$closeBracket]['line']); - - if (isset($tokens[$openBracket]['parenthesis_owner']) === true) { - $stackPtr = $tokens[$openBracket]['parenthesis_owner']; - } else { - $stackPtr = $phpcsFile->findPrevious(T_USE, ($openBracket - 1)); - } - - $params = $phpcsFile->getMethodParameters($stackPtr); - - if (empty($params) === true) { - // Check spacing around parenthesis. - $next = $phpcsFile->findNext(T_WHITESPACE, ($openBracket + 1), $closeBracket, true); - if ($next === false) { - if (($closeBracket - $openBracket) !== 1) { - if ($tokens[$openBracket]['line'] !== $tokens[$closeBracket]['line']) { - $found = 'newline'; - } else { - $found = $tokens[($openBracket + 1)]['length']; - } - - $error = 'Expected 0 spaces between parenthesis of function declaration; %s found'; - $data = [$found]; - $fix = $phpcsFile->addFixableError($error, $openBracket, 'SpacingBetween', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($openBracket + 1), ''); - } - } - - // No params, so we don't check normal spacing rules. - return; - } - }//end if - - foreach ($params as $paramNumber => $param) { - if ($param['pass_by_reference'] === true) { - $refToken = $param['reference_token']; - - $gap = 0; - if ($tokens[($refToken + 1)]['code'] === T_WHITESPACE) { - $gap = $tokens[($refToken + 1)]['length']; - } - - if ($gap !== 0) { - $error = 'Expected 0 spaces after reference operator for argument "%s"; %s found'; - $data = [ - $param['name'], - $gap, - ]; - $fix = $phpcsFile->addFixableError($error, $refToken, 'SpacingAfterReference', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($refToken + 1), ''); - } - } - }//end if - - if ($param['variable_length'] === true) { - $variadicToken = $param['variadic_token']; - - $gap = 0; - if ($tokens[($variadicToken + 1)]['code'] === T_WHITESPACE) { - $gap = $tokens[($variadicToken + 1)]['length']; - } - - if ($gap !== 0) { - $error = 'Expected 0 spaces after variadic operator for argument "%s"; %s found'; - $data = [ - $param['name'], - $gap, - ]; - $fix = $phpcsFile->addFixableError($error, $variadicToken, 'SpacingAfterVariadic', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($variadicToken + 1), ''); - } - } - }//end if - - if (isset($param['default_equal_token']) === true) { - $equalToken = $param['default_equal_token']; - - $spacesBefore = 0; - if (($equalToken - $param['token']) > 1) { - $spacesBefore = $tokens[($param['token'] + 1)]['length']; - } - - if ($spacesBefore !== $this->equalsSpacing) { - $error = 'Incorrect spacing between argument "%s" and equals sign; expected '.$this->equalsSpacing.' but found %s'; - $data = [ - $param['name'], - $spacesBefore, - ]; - - $fix = $phpcsFile->addFixableError($error, $equalToken, 'SpaceBeforeEquals', $data); - if ($fix === true) { - $padding = str_repeat(' ', $this->equalsSpacing); - if ($spacesBefore === 0) { - $phpcsFile->fixer->addContentBefore($equalToken, $padding); - } else { - $phpcsFile->fixer->replaceToken(($equalToken - 1), $padding); - } - } - }//end if - - $spacesAfter = 0; - if ($tokens[($equalToken + 1)]['code'] === T_WHITESPACE) { - $spacesAfter = $tokens[($equalToken + 1)]['length']; - } - - if ($spacesAfter !== $this->equalsSpacing) { - $error = 'Incorrect spacing between default value and equals sign for argument "%s"; expected '.$this->equalsSpacing.' but found %s'; - $data = [ - $param['name'], - $spacesAfter, - ]; - - $fix = $phpcsFile->addFixableError($error, $equalToken, 'SpaceAfterEquals', $data); - if ($fix === true) { - $padding = str_repeat(' ', $this->equalsSpacing); - if ($spacesAfter === 0) { - $phpcsFile->fixer->addContent($equalToken, $padding); - } else { - $phpcsFile->fixer->replaceToken(($equalToken + 1), $padding); - } - } - }//end if - }//end if - - if ($param['type_hint_token'] !== false) { - $typeHintToken = $param['type_hint_end_token']; - - $gap = 0; - if ($tokens[($typeHintToken + 1)]['code'] === T_WHITESPACE) { - $gap = $tokens[($typeHintToken + 1)]['length']; - } - - if ($gap !== 1) { - $error = 'Expected 1 space between type hint and argument "%s"; %s found'; - $data = [ - $param['name'], - $gap, - ]; - $fix = $phpcsFile->addFixableError($error, $typeHintToken, 'SpacingAfterHint', $data); - if ($fix === true) { - if ($gap === 0) { - $phpcsFile->fixer->addContent($typeHintToken, ' '); - } else { - $phpcsFile->fixer->replaceToken(($typeHintToken + 1), ' '); - } - } - } - }//end if - - $commaToken = false; - if ($paramNumber > 0 && $params[($paramNumber - 1)]['comma_token'] !== false) { - $commaToken = $params[($paramNumber - 1)]['comma_token']; - } - - if ($commaToken !== false) { - if ($tokens[($commaToken - 1)]['code'] === T_WHITESPACE) { - $error = 'Expected 0 spaces between argument "%s" and comma; %s found'; - $data = [ - $params[($paramNumber - 1)]['name'], - $tokens[($commaToken - 1)]['length'], - ]; - - $fix = $phpcsFile->addFixableError($error, $commaToken, 'SpaceBeforeComma', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($commaToken - 1), ''); - } - } - - // Don't check spacing after the comma if it is the last content on the line. - $checkComma = true; - if ($multiLine === true) { - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($commaToken + 1), $closeBracket, true); - if ($tokens[$next]['line'] !== $tokens[$commaToken]['line']) { - $checkComma = false; - } - } - - if ($checkComma === true) { - if ($param['type_hint_token'] === false) { - $spacesAfter = 0; - if ($tokens[($commaToken + 1)]['code'] === T_WHITESPACE) { - $spacesAfter = $tokens[($commaToken + 1)]['length']; - } - - if ($spacesAfter === 0) { - $error = 'Expected 1 space between comma and argument "%s"; 0 found'; - $data = [$param['name']]; - $fix = $phpcsFile->addFixableError($error, $commaToken, 'NoSpaceBeforeArg', $data); - if ($fix === true) { - $phpcsFile->fixer->addContent($commaToken, ' '); - } - } else if ($spacesAfter !== 1) { - $error = 'Expected 1 space between comma and argument "%s"; %s found'; - $data = [ - $param['name'], - $spacesAfter, - ]; - - $fix = $phpcsFile->addFixableError($error, $commaToken, 'SpacingBeforeArg', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($commaToken + 1), ' '); - } - }//end if - } else { - $hint = $phpcsFile->getTokensAsString($param['type_hint_token'], (($param['type_hint_end_token'] - $param['type_hint_token']) + 1)); - if ($param['nullable_type'] === true) { - $hint = '?'.$hint; - } - - if ($tokens[($commaToken + 1)]['code'] !== T_WHITESPACE) { - $error = 'Expected 1 space between comma and type hint "%s"; 0 found'; - $data = [$hint]; - $fix = $phpcsFile->addFixableError($error, $commaToken, 'NoSpaceBeforeHint', $data); - if ($fix === true) { - $phpcsFile->fixer->addContent($commaToken, ' '); - } - } else { - $gap = $tokens[($commaToken + 1)]['length']; - if ($gap !== 1) { - $error = 'Expected 1 space between comma and type hint "%s"; %s found'; - $data = [ - $hint, - $gap, - ]; - $fix = $phpcsFile->addFixableError($error, $commaToken, 'SpacingBeforeHint', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($commaToken + 1), ' '); - } - } - }//end if - }//end if - }//end if - }//end if - }//end foreach - - // Only check spacing around parenthesis for single line definitions. - if ($multiLine === true) { - return; - } - - $gap = 0; - if ($tokens[($closeBracket - 1)]['code'] === T_WHITESPACE) { - $gap = $tokens[($closeBracket - 1)]['length']; - } - - if ($gap !== $this->requiredSpacesBeforeClose) { - $error = 'Expected %s spaces before closing parenthesis; %s found'; - $data = [ - $this->requiredSpacesBeforeClose, - $gap, - ]; - $fix = $phpcsFile->addFixableError($error, $closeBracket, 'SpacingBeforeClose', $data); - if ($fix === true) { - $padding = str_repeat(' ', $this->requiredSpacesBeforeClose); - if ($gap === 0) { - $phpcsFile->fixer->addContentBefore($closeBracket, $padding); - } else { - $phpcsFile->fixer->replaceToken(($closeBracket - 1), $padding); - } - } - } - - $gap = 0; - if ($tokens[($openBracket + 1)]['code'] === T_WHITESPACE) { - $gap = $tokens[($openBracket + 1)]['length']; - } - - if ($gap !== $this->requiredSpacesAfterOpen) { - $error = 'Expected %s spaces after opening parenthesis; %s found'; - $data = [ - $this->requiredSpacesAfterOpen, - $gap, - ]; - $fix = $phpcsFile->addFixableError($error, $openBracket, 'SpacingAfterOpen', $data); - if ($fix === true) { - $padding = str_repeat(' ', $this->requiredSpacesAfterOpen); - if ($gap === 0) { - $phpcsFile->fixer->addContent($openBracket, $padding); - } else { - $phpcsFile->fixer->replaceToken(($openBracket + 1), $padding); - } - } - } - - }//end processBracket() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationSniff.php deleted file mode 100644 index 4b6a6ac..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationSniff.php +++ /dev/null @@ -1,34 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions; - -use PHP_CodeSniffer\Sniffs\AbstractPatternSniff; - -class FunctionDeclarationSniff extends AbstractPatternSniff -{ - - - /** - * Returns an array of patterns to check are correct. - * - * @return array - */ - protected function getPatterns() - { - return [ - 'function abc(...);', - 'function abc(...)', - 'abstract function abc(...);', - ]; - - }//end getPatterns() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDuplicateArgumentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDuplicateArgumentSniff.php deleted file mode 100644 index f6fc383..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDuplicateArgumentSniff.php +++ /dev/null @@ -1,64 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class FunctionDuplicateArgumentSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_FUNCTION]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $openBracket = $tokens[$stackPtr]['parenthesis_opener']; - $closeBracket = $tokens[$stackPtr]['parenthesis_closer']; - - $foundVariables = []; - for ($i = ($openBracket + 1); $i < $closeBracket; $i++) { - if ($tokens[$i]['code'] === T_VARIABLE) { - $variable = $tokens[$i]['content']; - if (in_array($variable, $foundVariables, true) === true) { - $error = 'Variable "%s" appears more than once in function declaration'; - $data = [$variable]; - $phpcsFile->addError($error, $i, 'Found', $data); - } else { - $foundVariables[] = $variable; - } - } - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/GlobalFunctionSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/GlobalFunctionSniff.php deleted file mode 100644 index 24588a9..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/GlobalFunctionSniff.php +++ /dev/null @@ -1,61 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class GlobalFunctionSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_FUNCTION]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (empty($tokens[$stackPtr]['conditions']) === true) { - $functionName = $phpcsFile->getDeclarationName($stackPtr); - if ($functionName === null) { - return; - } - - // Special exception for __autoload as it needs to be global. - if ($functionName !== '__autoload') { - $error = 'Consider putting global function "%s" in a static class'; - $data = [$functionName]; - $phpcsFile->addWarning($error, $stackPtr, 'Found', $data); - } - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/LowercaseFunctionKeywordsSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/LowercaseFunctionKeywordsSniff.php deleted file mode 100644 index 2357960..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/LowercaseFunctionKeywordsSniff.php +++ /dev/null @@ -1,69 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class LowercaseFunctionKeywordsSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - $tokens = Tokens::$methodPrefixes; - $tokens[] = T_FUNCTION; - $tokens[] = T_CLOSURE; - $tokens[] = T_FN; - - return $tokens; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $content = $tokens[$stackPtr]['content']; - $contentLc = strtolower($content); - if ($content !== $contentLc) { - $error = '%s keyword must be lowercase; expected "%s" but found "%s"'; - $data = [ - strtoupper($content), - $contentLc, - $content, - ]; - - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'FoundUppercase', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($stackPtr, $contentLc); - } - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/MultiLineFunctionDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/MultiLineFunctionDeclarationSniff.php deleted file mode 100644 index c12bd0c..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/MultiLineFunctionDeclarationSniff.php +++ /dev/null @@ -1,258 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions; - -use PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions\FunctionDeclarationSniff as PEARFunctionDeclarationSniff; -use PHP_CodeSniffer\Util\Tokens; - -class MultiLineFunctionDeclarationSniff extends PEARFunctionDeclarationSniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - - /** - * Determine if this is a multi-line function declaration. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * @param int $openBracket The position of the opening bracket - * in the stack passed in $tokens. - * @param array $tokens The stack of tokens that make up - * the file. - * - * @return void - */ - public function isMultiLineDeclaration($phpcsFile, $stackPtr, $openBracket, $tokens) - { - $bracketsToCheck = [$stackPtr => $openBracket]; - - // Closures may use the USE keyword and so be multi-line in this way. - if ($tokens[$stackPtr]['code'] === T_CLOSURE) { - $use = $phpcsFile->findNext(T_USE, ($tokens[$openBracket]['parenthesis_closer'] + 1), $tokens[$stackPtr]['scope_opener']); - if ($use !== false) { - $open = $phpcsFile->findNext(T_OPEN_PARENTHESIS, ($use + 1)); - if ($open !== false) { - $bracketsToCheck[$use] = $open; - } - } - } - - foreach ($bracketsToCheck as $stackPtr => $openBracket) { - // If the first argument is on a new line, this is a multi-line - // function declaration, even if there is only one argument. - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($openBracket + 1), null, true); - if ($tokens[$next]['line'] !== $tokens[$stackPtr]['line']) { - return true; - } - - $closeBracket = $tokens[$openBracket]['parenthesis_closer']; - - $end = $phpcsFile->findEndOfStatement($openBracket + 1); - while ($tokens[$end]['code'] === T_COMMA) { - // If the next bit of code is not on the same line, this is a - // multi-line function declaration. - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($end + 1), $closeBracket, true); - if ($next === false) { - continue(2); - } - - if ($tokens[$next]['line'] !== $tokens[$end]['line']) { - return true; - } - - $end = $phpcsFile->findEndOfStatement($next); - } - - // We've reached the last argument, so see if the next content - // (should be the close bracket) is also on the same line. - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($end + 1), $closeBracket, true); - if ($next !== false && $tokens[$next]['line'] !== $tokens[$end]['line']) { - return true; - } - }//end foreach - - return false; - - }//end isMultiLineDeclaration() - - - /** - * Processes single-line declarations. - * - * Just uses the Generic BSD-Allman brace sniff. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * @param array $tokens The stack of tokens that make up - * the file. - * - * @return void - */ - public function processSingleLineDeclaration($phpcsFile, $stackPtr, $tokens) - { - // We do everything the parent sniff does, and a bit more because we - // define multi-line declarations a bit differently. - parent::processSingleLineDeclaration($phpcsFile, $stackPtr, $tokens); - - $openingBracket = $tokens[$stackPtr]['parenthesis_opener']; - $closingBracket = $tokens[$stackPtr]['parenthesis_closer']; - - $prevNonWhiteSpace = $phpcsFile->findPrevious(T_WHITESPACE, ($closingBracket - 1), $openingBracket, true); - if ($tokens[$prevNonWhiteSpace]['line'] !== $tokens[$closingBracket]['line']) { - $error = 'There must not be a newline before the closing parenthesis of a single-line function declaration'; - - if (isset(Tokens::$emptyTokens[$tokens[$prevNonWhiteSpace]['code']]) === true) { - $phpcsFile->addError($error, $closingBracket, 'CloseBracketNewLine'); - } else { - $fix = $phpcsFile->addFixableError($error, $closingBracket, 'CloseBracketNewLine'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($closingBracket - 1); $i > $openingBracket; $i--) { - if ($tokens[$i]['code'] !== T_WHITESPACE) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } - }//end if - - }//end processSingleLineDeclaration() - - - /** - * Processes multi-line declarations. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * @param array $tokens The stack of tokens that make up - * the file. - * - * @return void - */ - public function processMultiLineDeclaration($phpcsFile, $stackPtr, $tokens) - { - // We do everything the parent sniff does, and a bit more. - parent::processMultiLineDeclaration($phpcsFile, $stackPtr, $tokens); - - $openBracket = $tokens[$stackPtr]['parenthesis_opener']; - $this->processBracket($phpcsFile, $openBracket, $tokens, 'function'); - - if ($tokens[$stackPtr]['code'] !== T_CLOSURE) { - return; - } - - $use = $phpcsFile->findNext(T_USE, ($tokens[$stackPtr]['parenthesis_closer'] + 1), $tokens[$stackPtr]['scope_opener']); - if ($use === false) { - return; - } - - $openBracket = $phpcsFile->findNext(T_OPEN_PARENTHESIS, ($use + 1), null); - $this->processBracket($phpcsFile, $openBracket, $tokens, 'use'); - - }//end processMultiLineDeclaration() - - - /** - * Processes the contents of a single set of brackets. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $openBracket The position of the open bracket - * in the stack passed in $tokens. - * @param array $tokens The stack of tokens that make up - * the file. - * @param string $type The type of the token the brackets - * belong to (function or use). - * - * @return void - */ - public function processBracket($phpcsFile, $openBracket, $tokens, $type='function') - { - $errorPrefix = ''; - if ($type === 'use') { - $errorPrefix = 'Use'; - } - - $closeBracket = $tokens[$openBracket]['parenthesis_closer']; - - // The open bracket should be the last thing on the line. - if ($tokens[$openBracket]['line'] !== $tokens[$closeBracket]['line']) { - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($openBracket + 1), null, true); - if ($tokens[$next]['line'] === $tokens[$openBracket]['line']) { - $error = 'The first parameter of a multi-line '.$type.' declaration must be on the line after the opening bracket'; - $fix = $phpcsFile->addFixableError($error, $next, $errorPrefix.'FirstParamSpacing'); - if ($fix === true) { - if ($tokens[$next]['line'] === $tokens[$openBracket]['line']) { - $phpcsFile->fixer->addNewline($openBracket); - } else { - $phpcsFile->fixer->beginChangeset(); - for ($x = $openBracket; $x < $next; $x++) { - if ($tokens[$x]['line'] === $tokens[$openBracket]['line']) { - continue; - } - - if ($tokens[$x]['line'] === $tokens[$next]['line']) { - break; - } - } - - $phpcsFile->fixer->endChangeset(); - } - } - }//end if - }//end if - - // Each line between the brackets should contain a single parameter. - $lastComma = null; - for ($i = ($openBracket + 1); $i < $closeBracket; $i++) { - // Skip brackets, like arrays, as they can contain commas. - if (isset($tokens[$i]['bracket_opener']) === true) { - $i = $tokens[$i]['bracket_closer']; - continue; - } - - if (isset($tokens[$i]['parenthesis_opener']) === true) { - $i = $tokens[$i]['parenthesis_closer']; - continue; - } - - if ($tokens[$i]['code'] !== T_COMMA) { - continue; - } - - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($i + 1), null, true); - if ($tokens[$next]['line'] === $tokens[$i]['line']) { - $error = 'Multi-line '.$type.' declarations must define one parameter per line'; - $fix = $phpcsFile->addFixableError($error, $next, $errorPrefix.'OneParamPerLine'); - if ($fix === true) { - $phpcsFile->fixer->addNewline($i); - } - } - }//end for - - }//end processBracket() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/NamingConventions/ValidFunctionNameSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/NamingConventions/ValidFunctionNameSniff.php deleted file mode 100644 index 878035e..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/NamingConventions/ValidFunctionNameSniff.php +++ /dev/null @@ -1,54 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\NamingConventions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Standards\PEAR\Sniffs\NamingConventions\ValidFunctionNameSniff as PEARValidFunctionNameSniff; -use PHP_CodeSniffer\Util\Common; - -class ValidFunctionNameSniff extends PEARValidFunctionNameSniff -{ - - - /** - * Processes the tokens outside the scope. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being processed. - * @param int $stackPtr The position where this token was - * found. - * - * @return void - */ - protected function processTokenOutsideScope(File $phpcsFile, $stackPtr) - { - $functionName = $phpcsFile->getDeclarationName($stackPtr); - if ($functionName === null) { - return; - } - - $errorData = [$functionName]; - - // Does this function claim to be magical? - if (preg_match('|^__[^_]|', $functionName) !== 0) { - $error = 'Function name "%s" is invalid; only PHP magic methods should be prefixed with a double underscore'; - $phpcsFile->addError($error, $stackPtr, 'DoubleUnderscore', $errorData); - - $functionName = ltrim($functionName, '_'); - } - - if (Common::isCamelCaps($functionName, false, true, false) === false) { - $error = 'Function name "%s" is not in camel caps format'; - $phpcsFile->addError($error, $stackPtr, 'NotCamelCaps', $errorData); - } - - }//end processTokenOutsideScope() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/NamingConventions/ValidVariableNameSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/NamingConventions/ValidVariableNameSniff.php deleted file mode 100644 index 5c3a749..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/NamingConventions/ValidVariableNameSniff.php +++ /dev/null @@ -1,190 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\NamingConventions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\AbstractVariableSniff; -use PHP_CodeSniffer\Util\Common; -use PHP_CodeSniffer\Util\Tokens; - -class ValidVariableNameSniff extends AbstractVariableSniff -{ - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - protected function processVariable(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $varName = ltrim($tokens[$stackPtr]['content'], '$'); - - // If it's a php reserved var, then its ok. - if (isset($this->phpReservedVars[$varName]) === true) { - return; - } - - $objOperator = $phpcsFile->findNext([T_WHITESPACE], ($stackPtr + 1), null, true); - if ($tokens[$objOperator]['code'] === T_OBJECT_OPERATOR - || $tokens[$objOperator]['code'] === T_NULLSAFE_OBJECT_OPERATOR - ) { - // Check to see if we are using a variable from an object. - $var = $phpcsFile->findNext([T_WHITESPACE], ($objOperator + 1), null, true); - if ($tokens[$var]['code'] === T_STRING) { - $bracket = $phpcsFile->findNext([T_WHITESPACE], ($var + 1), null, true); - if ($tokens[$bracket]['code'] !== T_OPEN_PARENTHESIS) { - $objVarName = $tokens[$var]['content']; - - // There is no way for us to know if the var is public or - // private, so we have to ignore a leading underscore if there is - // one and just check the main part of the variable name. - $originalVarName = $objVarName; - if (substr($objVarName, 0, 1) === '_') { - $objVarName = substr($objVarName, 1); - } - - if (Common::isCamelCaps($objVarName, false, true, false) === false) { - $error = 'Member variable "%s" is not in valid camel caps format'; - $data = [$originalVarName]; - $phpcsFile->addError($error, $var, 'MemberNotCamelCaps', $data); - } - }//end if - }//end if - }//end if - - $objOperator = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); - if ($tokens[$objOperator]['code'] === T_DOUBLE_COLON) { - // The variable lives within a class, and is referenced like - // this: MyClass::$_variable, so we don't know its scope. - $objVarName = $varName; - if (substr($objVarName, 0, 1) === '_') { - $objVarName = substr($objVarName, 1); - } - - if (Common::isCamelCaps($objVarName, false, true, false) === false) { - $error = 'Member variable "%s" is not in valid camel caps format'; - $data = [$tokens[$stackPtr]['content']]; - $phpcsFile->addError($error, $stackPtr, 'MemberNotCamelCaps', $data); - } - - return; - } - - // There is no way for us to know if the var is public or private, - // so we have to ignore a leading underscore if there is one and just - // check the main part of the variable name. - $originalVarName = $varName; - if (substr($varName, 0, 1) === '_') { - $inClass = $phpcsFile->hasCondition($stackPtr, Tokens::$ooScopeTokens); - if ($inClass === true) { - $varName = substr($varName, 1); - } - } - - if (Common::isCamelCaps($varName, false, true, false) === false) { - $error = 'Variable "%s" is not in valid camel caps format'; - $data = [$originalVarName]; - $phpcsFile->addError($error, $stackPtr, 'NotCamelCaps', $data); - } - - }//end processVariable() - - - /** - * Processes class member variables. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - protected function processMemberVar(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $varName = ltrim($tokens[$stackPtr]['content'], '$'); - $memberProps = $phpcsFile->getMemberProperties($stackPtr); - if (empty($memberProps) === true) { - // Couldn't get any info about this variable, which - // generally means it is invalid or possibly has a parse - // error. Any errors will be reported by the core, so - // we can ignore it. - return; - } - - $public = ($memberProps['scope'] !== 'private'); - $errorData = [$varName]; - - if ($public === true) { - if (substr($varName, 0, 1) === '_') { - $error = '%s member variable "%s" must not contain a leading underscore'; - $data = [ - ucfirst($memberProps['scope']), - $errorData[0], - ]; - $phpcsFile->addError($error, $stackPtr, 'PublicHasUnderscore', $data); - } - } else { - if (substr($varName, 0, 1) !== '_') { - $error = 'Private member variable "%s" must contain a leading underscore'; - $phpcsFile->addError($error, $stackPtr, 'PrivateNoUnderscore', $errorData); - } - } - - // Remove a potential underscore prefix for testing CamelCaps. - $varName = ltrim($varName, '_'); - - if (Common::isCamelCaps($varName, false, true, false) === false) { - $error = 'Member variable "%s" is not in valid camel caps format'; - $phpcsFile->addError($error, $stackPtr, 'MemberNotCamelCaps', $errorData); - } - - }//end processMemberVar() - - - /** - * Processes the variable found within a double quoted string. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the double quoted - * string. - * - * @return void - */ - protected function processVariableInString(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (preg_match_all('|[^\\\]\${?([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)|', $tokens[$stackPtr]['content'], $matches) !== 0) { - foreach ($matches[1] as $varName) { - // If it's a php reserved var, then its ok. - if (isset($this->phpReservedVars[$varName]) === true) { - continue; - } - - if (Common::isCamelCaps($varName, false, true, false) === false) { - $error = 'Variable "%s" is not in valid camel caps format'; - $data = [$varName]; - $phpcsFile->addError($error, $stackPtr, 'StringNotCamelCaps', $data); - } - } - } - - }//end processVariableInString() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Objects/DisallowObjectStringIndexSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Objects/DisallowObjectStringIndexSniff.php deleted file mode 100644 index c324e20..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Objects/DisallowObjectStringIndexSniff.php +++ /dev/null @@ -1,85 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Objects; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class DisallowObjectStringIndexSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['JS']; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_OPEN_SQUARE_BRACKET]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Check if the next non whitespace token is a string. - $index = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($tokens[$index]['code'] !== T_CONSTANT_ENCAPSED_STRING) { - return; - } - - // Make sure it is the only thing in the square brackets. - $next = $phpcsFile->findNext(T_WHITESPACE, ($index + 1), null, true); - if ($tokens[$next]['code'] !== T_CLOSE_SQUARE_BRACKET) { - return; - } - - // Allow indexes that have dots in them because we can't write - // them in dot notation. - $content = trim($tokens[$index]['content'], '"\' '); - if (strpos($content, '.') !== false) { - return; - } - - // Also ignore reserved words. - if ($content === 'super') { - return; - } - - // Token before the opening square bracket cannot be a var name. - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); - if ($tokens[$prev]['code'] === T_STRING) { - $error = 'Object indexes must be written in dot notation'; - $phpcsFile->addError($error, $prev, 'Found'); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Objects/ObjectInstantiationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Objects/ObjectInstantiationSniff.php deleted file mode 100644 index 84facf0..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Objects/ObjectInstantiationSniff.php +++ /dev/null @@ -1,85 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Objects; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class ObjectInstantiationSniff implements Sniff -{ - - - /** - * Registers the token types that this sniff wishes to listen to. - * - * @return array - */ - public function register() - { - return [T_NEW]; - - }//end register() - - - /** - * Process the tokens that this sniff is listening for. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $allowedTokens = Tokens::$emptyTokens; - $allowedTokens[] = T_BITWISE_AND; - - $prev = $phpcsFile->findPrevious($allowedTokens, ($stackPtr - 1), null, true); - - $allowedTokens = [ - T_EQUAL => T_EQUAL, - T_COALESCE_EQUAL => T_COALESCE_EQUAL, - T_DOUBLE_ARROW => T_DOUBLE_ARROW, - T_FN_ARROW => T_FN_ARROW, - T_MATCH_ARROW => T_MATCH_ARROW, - T_THROW => T_THROW, - T_RETURN => T_RETURN, - ]; - - if (isset($allowedTokens[$tokens[$prev]['code']]) === true) { - return; - } - - $ternaryLikeTokens = [ - T_COALESCE => true, - T_INLINE_THEN => true, - T_INLINE_ELSE => true, - ]; - - // For ternary like tokens, walk a little further back to see if it is preceded by - // one of the allowed tokens (within the same statement). - if (isset($ternaryLikeTokens[$tokens[$prev]['code']]) === true) { - $hasAllowedBefore = $phpcsFile->findPrevious($allowedTokens, ($prev - 1), null, false, null, true); - if ($hasAllowedBefore !== false) { - return; - } - } - - $error = 'New objects must be assigned to a variable'; - $phpcsFile->addError($error, $stackPtr, 'NotAssigned'); - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Objects/ObjectMemberCommaSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Objects/ObjectMemberCommaSniff.php deleted file mode 100644 index 787d3fc..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Objects/ObjectMemberCommaSniff.php +++ /dev/null @@ -1,64 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Objects; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class ObjectMemberCommaSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['JS']; - - - /** - * Registers the token types that this sniff wishes to listen to. - * - * @return array - */ - public function register() - { - return [T_CLOSE_OBJECT]; - - }//end register() - - - /** - * Process the tokens that this sniff is listening for. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if ($tokens[$prev]['code'] === T_COMMA) { - $error = 'Last member of object must not be followed by a comma'; - $fix = $phpcsFile->addFixableError($error, $prev, 'Found'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($prev, ''); - } - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/ComparisonOperatorUsageSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/ComparisonOperatorUsageSniff.php deleted file mode 100644 index 85e9825..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/ComparisonOperatorUsageSniff.php +++ /dev/null @@ -1,235 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Operators; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class ComparisonOperatorUsageSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - /** - * A list of valid comparison operators. - * - * @var array - */ - private static $validOps = [ - T_IS_IDENTICAL => true, - T_IS_NOT_IDENTICAL => true, - T_LESS_THAN => true, - T_GREATER_THAN => true, - T_IS_GREATER_OR_EQUAL => true, - T_IS_SMALLER_OR_EQUAL => true, - T_INSTANCEOF => true, - ]; - - /** - * A list of invalid operators with their alternatives. - * - * @var array - */ - private static $invalidOps = [ - 'PHP' => [ - T_IS_EQUAL => '===', - T_IS_NOT_EQUAL => '!==', - T_BOOLEAN_NOT => '=== FALSE', - ], - 'JS' => [ - T_IS_EQUAL => '===', - T_IS_NOT_EQUAL => '!==', - ], - ]; - - - /** - * Registers the token types that this sniff wishes to listen to. - * - * @return array - */ - public function register() - { - return [ - T_IF, - T_ELSEIF, - T_INLINE_THEN, - T_WHILE, - T_FOR, - ]; - - }//end register() - - - /** - * Process the tokens that this sniff is listening for. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where the token - * was found. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $tokenizer = $phpcsFile->tokenizerType; - - if ($tokens[$stackPtr]['code'] === T_INLINE_THEN) { - $end = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if ($tokens[$end]['code'] !== T_CLOSE_PARENTHESIS) { - // This inline IF statement does not have its condition - // bracketed, so we need to guess where it starts. - for ($i = ($end - 1); $i >= 0; $i--) { - if ($tokens[$i]['code'] === T_SEMICOLON) { - // Stop here as we assume it is the end - // of the previous statement. - break; - } else if ($tokens[$i]['code'] === T_OPEN_TAG) { - // Stop here as this is the start of the file. - break; - } else if ($tokens[$i]['code'] === T_CLOSE_CURLY_BRACKET) { - // Stop if this is the closing brace of - // a code block. - if (isset($tokens[$i]['scope_opener']) === true) { - break; - } - } else if ($tokens[$i]['code'] === T_OPEN_CURLY_BRACKET) { - // Stop if this is the opening brace of - // a code block. - if (isset($tokens[$i]['scope_closer']) === true) { - break; - } - } else if ($tokens[$i]['code'] === T_OPEN_PARENTHESIS) { - // Stop if this is the start of a pair of - // parentheses that surrounds the inline - // IF statement. - if (isset($tokens[$i]['parenthesis_closer']) === true - && $tokens[$i]['parenthesis_closer'] >= $stackPtr - ) { - break; - } - }//end if - }//end for - - $start = $phpcsFile->findNext(Tokens::$emptyTokens, ($i + 1), null, true); - } else { - if (isset($tokens[$end]['parenthesis_opener']) === false) { - return; - } - - $start = $tokens[$end]['parenthesis_opener']; - }//end if - } else if ($tokens[$stackPtr]['code'] === T_FOR) { - if (isset($tokens[$stackPtr]['parenthesis_opener']) === false) { - return; - } - - $openingBracket = $tokens[$stackPtr]['parenthesis_opener']; - $closingBracket = $tokens[$stackPtr]['parenthesis_closer']; - - $start = $phpcsFile->findNext(T_SEMICOLON, $openingBracket, $closingBracket); - $end = $phpcsFile->findNext(T_SEMICOLON, ($start + 1), $closingBracket); - if ($start === false || $end === false) { - return; - } - } else { - if (isset($tokens[$stackPtr]['parenthesis_opener']) === false) { - return; - } - - $start = $tokens[$stackPtr]['parenthesis_opener']; - $end = $tokens[$stackPtr]['parenthesis_closer']; - }//end if - - $requiredOps = 0; - $foundOps = 0; - $foundBooleans = 0; - - $lastNonEmpty = $start; - - for ($i = $start; $i <= $end; $i++) { - $type = $tokens[$i]['code']; - if (isset(self::$invalidOps[$tokenizer][$type]) === true) { - $error = 'Operator %s prohibited; use %s instead'; - $data = [ - $tokens[$i]['content'], - self::$invalidOps[$tokenizer][$type], - ]; - $phpcsFile->addError($error, $i, 'NotAllowed', $data); - $foundOps++; - } else if (isset(self::$validOps[$type]) === true) { - $foundOps++; - } - - if ($type === T_OPEN_PARENTHESIS - && isset($tokens[$i]['parenthesis_closer']) === true - && isset(Tokens::$functionNameTokens[$tokens[$lastNonEmpty]['code']]) === true - ) { - $i = $tokens[$i]['parenthesis_closer']; - $lastNonEmpty = $i; - continue; - } - - if ($tokens[$i]['code'] === T_TRUE || $tokens[$i]['code'] === T_FALSE) { - $foundBooleans++; - } - - if ($phpcsFile->tokenizerType !== 'JS' - && ($tokens[$i]['code'] === T_BOOLEAN_AND - || $tokens[$i]['code'] === T_BOOLEAN_OR) - ) { - $requiredOps++; - - // When the instanceof operator is used with another operator - // like ===, you can get more ops than are required. - if ($foundOps > $requiredOps) { - $foundOps = $requiredOps; - } - - // If we get to here and we have not found the right number of - // comparison operators, then we must have had an implicit - // true operation i.e., if ($a) instead of the required - // if ($a === true), so let's add an error. - if ($requiredOps !== $foundOps) { - $error = 'Implicit true comparisons prohibited; use === TRUE instead'; - $phpcsFile->addError($error, $stackPtr, 'ImplicitTrue'); - $foundOps++; - } - } - - if (isset(Tokens::$emptyTokens[$type]) === false) { - $lastNonEmpty = $i; - } - }//end for - - $requiredOps++; - - if ($phpcsFile->tokenizerType !== 'JS' - && $foundOps < $requiredOps - && ($requiredOps !== $foundBooleans) - ) { - $error = 'Implicit true comparisons prohibited; use === TRUE instead'; - $phpcsFile->addError($error, $stackPtr, 'ImplicitTrue'); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/IncrementDecrementUsageSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/IncrementDecrementUsageSniff.php deleted file mode 100644 index cb37784..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/IncrementDecrementUsageSniff.php +++ /dev/null @@ -1,225 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Operators; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class IncrementDecrementUsageSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_EQUAL, - T_PLUS_EQUAL, - T_MINUS_EQUAL, - T_INC, - T_DEC, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if ($tokens[$stackPtr]['code'] === T_INC || $tokens[$stackPtr]['code'] === T_DEC) { - $this->processIncDec($phpcsFile, $stackPtr); - } else { - $this->processAssignment($phpcsFile, $stackPtr); - } - - }//end process() - - - /** - * Checks to ensure increment and decrement operators are not confusing. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - protected function processIncDec($phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Work out where the variable is so we know where to - // start looking for other operators. - if ($tokens[($stackPtr - 1)]['code'] === T_VARIABLE - || ($tokens[($stackPtr - 1)]['code'] === T_STRING - && ($tokens[($stackPtr - 2)]['code'] === T_OBJECT_OPERATOR - || $tokens[($stackPtr - 2)]['code'] === T_NULLSAFE_OBJECT_OPERATOR)) - ) { - $start = ($stackPtr + 1); - } else { - $start = ($stackPtr + 2); - } - - $next = $phpcsFile->findNext(Tokens::$emptyTokens, $start, null, true); - if ($next === false) { - return; - } - - if (isset(Tokens::$arithmeticTokens[$tokens[$next]['code']]) === true) { - $error = 'Increment and decrement operators cannot be used in an arithmetic operation'; - $phpcsFile->addError($error, $stackPtr, 'NotAllowed'); - return; - } - - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($start - 3), null, true); - if ($prev === false) { - return; - } - - // Check if this is in a string concat. - if ($tokens[$next]['code'] === T_STRING_CONCAT || $tokens[$prev]['code'] === T_STRING_CONCAT) { - $error = 'Increment and decrement operators must be bracketed when used in string concatenation'; - $phpcsFile->addError($error, $stackPtr, 'NoBrackets'); - } - - }//end processIncDec() - - - /** - * Checks to ensure increment and decrement operators are used. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - protected function processAssignment($phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $assignedVar = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); - // Not an assignment, return. - if ($tokens[$assignedVar]['code'] !== T_VARIABLE) { - return; - } - - $statementEnd = $phpcsFile->findNext([T_SEMICOLON, T_CLOSE_PARENTHESIS, T_CLOSE_SQUARE_BRACKET, T_CLOSE_CURLY_BRACKET], $stackPtr); - - // If there is anything other than variables, numbers, spaces or operators we need to return. - $noiseTokens = $phpcsFile->findNext([T_LNUMBER, T_VARIABLE, T_WHITESPACE, T_PLUS, T_MINUS, T_OPEN_PARENTHESIS], ($stackPtr + 1), $statementEnd, true); - - if ($noiseTokens !== false) { - return; - } - - // If we are already using += or -=, we need to ignore - // the statement if a variable is being used. - if ($tokens[$stackPtr]['code'] !== T_EQUAL) { - $nextVar = $phpcsFile->findNext(T_VARIABLE, ($stackPtr + 1), $statementEnd); - if ($nextVar !== false) { - return; - } - } - - if ($tokens[$stackPtr]['code'] === T_EQUAL) { - $nextVar = ($stackPtr + 1); - $previousVariable = ($stackPtr + 1); - $variableCount = 0; - while (($nextVar = $phpcsFile->findNext(T_VARIABLE, ($nextVar + 1), $statementEnd)) !== false) { - $previousVariable = $nextVar; - $variableCount++; - } - - if ($variableCount !== 1) { - return; - } - - $nextVar = $previousVariable; - if ($tokens[$nextVar]['content'] !== $tokens[$assignedVar]['content']) { - return; - } - } - - // We have only one variable, and it's the same as what is being assigned, - // so we need to check what is being added or subtracted. - $nextNumber = ($stackPtr + 1); - $previousNumber = ($stackPtr + 1); - $numberCount = 0; - while (($nextNumber = $phpcsFile->findNext([T_LNUMBER], ($nextNumber + 1), $statementEnd, false)) !== false) { - $previousNumber = $nextNumber; - $numberCount++; - } - - if ($numberCount !== 1) { - return; - } - - $nextNumber = $previousNumber; - if ($tokens[$nextNumber]['content'] === '1') { - if ($tokens[$stackPtr]['code'] === T_EQUAL) { - $opToken = $phpcsFile->findNext([T_PLUS, T_MINUS], ($nextVar + 1), $statementEnd); - if ($opToken === false) { - // Operator was before the variable, like: - // $var = 1 + $var; - // So we ignore it. - return; - } - - $operator = $tokens[$opToken]['content']; - } else { - $operator = substr($tokens[$stackPtr]['content'], 0, 1); - } - - // If we are adding or subtracting negative value, the operator - // needs to be reversed. - if ($tokens[$stackPtr]['code'] !== T_EQUAL) { - $negative = $phpcsFile->findPrevious(T_MINUS, ($nextNumber - 1), $stackPtr); - if ($negative !== false) { - if ($operator === '+') { - $operator = '-'; - } else { - $operator = '+'; - } - } - } - - $expected = $operator.$operator.$tokens[$assignedVar]['content']; - $found = $phpcsFile->getTokensAsString($assignedVar, ($statementEnd - $assignedVar + 1)); - - if ($operator === '+') { - $error = 'Increment'; - } else { - $error = 'Decrement'; - } - - $error .= " operators should be used where possible; found \"$found\" but expected \"$expected\""; - $phpcsFile->addError($error, $stackPtr, 'Found'); - }//end if - - }//end processAssignment() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/ValidLogicalOperatorsSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/ValidLogicalOperatorsSniff.php deleted file mode 100644 index f9ea620..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/ValidLogicalOperatorsSniff.php +++ /dev/null @@ -1,67 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Operators; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class ValidLogicalOperatorsSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_LOGICAL_AND, - T_LOGICAL_OR, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $replacements = [ - 'and' => '&&', - 'or' => '||', - ]; - - $operator = strtolower($tokens[$stackPtr]['content']); - if (isset($replacements[$operator]) === false) { - return; - } - - $error = 'Logical operator "%s" is prohibited; use "%s" instead'; - $data = [ - $operator, - $replacements[$operator], - ]; - $phpcsFile->addError($error, $stackPtr, 'NotAllowed', $data); - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/CommentedOutCodeSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/CommentedOutCodeSniff.php deleted file mode 100644 index 04d0633..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/CommentedOutCodeSniff.php +++ /dev/null @@ -1,288 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP; - -use PHP_CodeSniffer\Exceptions\TokenizerException; -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class CommentedOutCodeSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'CSS', - ]; - - /** - * If a comment is more than $maxPercentage% code, a warning will be shown. - * - * @var integer - */ - public $maxPercentage = 35; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_COMMENT]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Ignore comments at the end of code blocks. - if (substr($tokens[$stackPtr]['content'], 0, 6) === '//end ') { - return; - } - - $content = ''; - $lastLineSeen = $tokens[$stackPtr]['line']; - $commentStyle = 'line'; - if (strpos($tokens[$stackPtr]['content'], '/*') === 0) { - $commentStyle = 'block'; - } - - $lastCommentBlockToken = $stackPtr; - for ($i = $stackPtr; $i < $phpcsFile->numTokens; $i++) { - if (isset(Tokens::$emptyTokens[$tokens[$i]['code']]) === false) { - break; - } - - if ($tokens[$i]['code'] === T_WHITESPACE) { - continue; - } - - if (isset(Tokens::$phpcsCommentTokens[$tokens[$i]['code']]) === true) { - $lastLineSeen = $tokens[$i]['line']; - continue; - } - - if ($commentStyle === 'line' - && ($lastLineSeen + 1) <= $tokens[$i]['line'] - && strpos($tokens[$i]['content'], '/*') === 0 - ) { - // First non-whitespace token on a new line is start of a different style comment. - break; - } - - if ($commentStyle === 'line' - && ($lastLineSeen + 1) < $tokens[$i]['line'] - ) { - // Blank line breaks a '//' style comment block. - break; - } - - /* - Trim as much off the comment as possible so we don't - have additional whitespace tokens or comment tokens - */ - - $tokenContent = trim($tokens[$i]['content']); - $break = false; - - if ($commentStyle === 'line') { - if (substr($tokenContent, 0, 2) === '//') { - $tokenContent = substr($tokenContent, 2); - } - - if (substr($tokenContent, 0, 1) === '#') { - $tokenContent = substr($tokenContent, 1); - } - } else { - if (substr($tokenContent, 0, 3) === '/**') { - $tokenContent = substr($tokenContent, 3); - } - - if (substr($tokenContent, 0, 2) === '/*') { - $tokenContent = substr($tokenContent, 2); - } - - if (substr($tokenContent, -2) === '*/') { - $tokenContent = substr($tokenContent, 0, -2); - $break = true; - } - - if (substr($tokenContent, 0, 1) === '*') { - $tokenContent = substr($tokenContent, 1); - } - }//end if - - $content .= $tokenContent.$phpcsFile->eolChar; - $lastLineSeen = $tokens[$i]['line']; - - $lastCommentBlockToken = $i; - - if ($break === true) { - // Closer of a block comment found. - break; - } - }//end for - - // Ignore typical warning suppression annotations from other tools. - if (preg_match('`^\s*@[A-Za-z()\._-]+\s*$`', $content) === 1) { - return ($lastCommentBlockToken + 1); - } - - // Quite a few comments use multiple dashes, equals signs etc - // to frame comments and licence headers. - $content = preg_replace('/[-=#*]{2,}/', '-', $content); - - // Random numbers sitting inside the content can throw parse errors - // for invalid literals in PHP7+, so strip those. - $content = preg_replace('/\d+/', '', $content); - - $content = trim($content); - - if ($content === '') { - return ($lastCommentBlockToken + 1); - } - - if ($phpcsFile->tokenizerType === 'PHP') { - $content = ''; - } - - // Because we are not really parsing code, the tokenizer can throw all sorts - // of errors that don't mean anything, so ignore them. - $oldErrors = ini_get('error_reporting'); - ini_set('error_reporting', 0); - try { - $tokenizerClass = get_class($phpcsFile->tokenizer); - $tokenizer = new $tokenizerClass($content, $phpcsFile->config, $phpcsFile->eolChar); - $stringTokens = $tokenizer->getTokens(); - } catch (TokenizerException $e) { - // We couldn't check the comment, so ignore it. - ini_set('error_reporting', $oldErrors); - return ($lastCommentBlockToken + 1); - } - - ini_set('error_reporting', $oldErrors); - - $numTokens = count($stringTokens); - - /* - We know what the first two and last two tokens should be - (because we put them there) so ignore this comment if those - tokens were not parsed correctly. It obviously means this is not - valid code. - */ - - // First token is always the opening tag. - if ($stringTokens[0]['code'] !== T_OPEN_TAG) { - return ($lastCommentBlockToken + 1); - } else { - array_shift($stringTokens); - --$numTokens; - } - - // Last token is always the closing tag, unless something went wrong. - if (isset($stringTokens[($numTokens - 1)]) === false - || $stringTokens[($numTokens - 1)]['code'] !== T_CLOSE_TAG - ) { - return ($lastCommentBlockToken + 1); - } else { - array_pop($stringTokens); - --$numTokens; - } - - // Second last token is always whitespace or a comment, depending - // on the code inside the comment. - if ($phpcsFile->tokenizerType === 'PHP') { - if (isset(Tokens::$emptyTokens[$stringTokens[($numTokens - 1)]['code']]) === false) { - return ($lastCommentBlockToken + 1); - } - - if ($stringTokens[($numTokens - 1)]['code'] === T_WHITESPACE) { - array_pop($stringTokens); - --$numTokens; - } - } - - $emptyTokens = [ - T_WHITESPACE => true, - T_STRING => true, - T_STRING_CONCAT => true, - T_ENCAPSED_AND_WHITESPACE => true, - T_NONE => true, - T_COMMENT => true, - ]; - $emptyTokens += Tokens::$phpcsCommentTokens; - - $numComment = 0; - $numPossible = 0; - $numCode = 0; - $numNonWhitespace = 0; - - for ($i = 0; $i < $numTokens; $i++) { - if (isset($emptyTokens[$stringTokens[$i]['code']]) === true) { - // Looks like comment. - $numComment++; - } else if (isset(Tokens::$comparisonTokens[$stringTokens[$i]['code']]) === true - || isset(Tokens::$arithmeticTokens[$stringTokens[$i]['code']]) === true - || $stringTokens[$i]['code'] === T_GOTO_LABEL - ) { - // Commented out HTML/XML and other docs contain a lot of these - // characters, so it is best to not use them directly. - $numPossible++; - } else { - // Looks like code. - $numCode++; - } - - if ($stringTokens[$i]['code'] !== T_WHITESPACE) { - ++$numNonWhitespace; - } - } - - // Ignore comments with only two or less non-whitespace tokens. - // Sample size too small for a reliably determination. - if ($numNonWhitespace <= 2) { - return ($lastCommentBlockToken + 1); - } - - $percentCode = ceil((($numCode / $numTokens) * 100)); - if ($percentCode > $this->maxPercentage) { - // Just in case. - $percentCode = min(100, $percentCode); - - $error = 'This comment is %s%% valid code; is this commented out code?'; - $data = [$percentCode]; - $phpcsFile->addWarning($error, $stackPtr, 'Found', $data); - } - - return ($lastCommentBlockToken + 1); - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowBooleanStatementSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowBooleanStatementSniff.php deleted file mode 100644 index 9d8077f..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowBooleanStatementSniff.php +++ /dev/null @@ -1,59 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class DisallowBooleanStatementSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return Tokens::$booleanOperators; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) { - foreach ($tokens[$stackPtr]['nested_parenthesis'] as $open => $close) { - if (isset($tokens[$open]['parenthesis_owner']) === true) { - // Any owner means we are not just a simple statement. - return; - } - } - } - - $error = 'Boolean operators are not allowed outside of control structure conditions'; - $phpcsFile->addError($error, $stackPtr, 'Found'); - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowComparisonAssignmentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowComparisonAssignmentSniff.php deleted file mode 100644 index 7c7e224..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowComparisonAssignmentSniff.php +++ /dev/null @@ -1,111 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class DisallowComparisonAssignmentSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_EQUAL]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Ignore default value assignments in function definitions. - $function = $phpcsFile->findPrevious(T_FUNCTION, ($stackPtr - 1), null, false, null, true); - if ($function !== false) { - $opener = $tokens[$function]['parenthesis_opener']; - $closer = $tokens[$function]['parenthesis_closer']; - if ($opener < $stackPtr && $closer > $stackPtr) { - return; - } - } - - // Ignore values in array definitions. - $array = $phpcsFile->findNext( - T_ARRAY, - ($stackPtr + 1), - null, - false, - null, - true - ); - - if ($array !== false) { - return; - } - - // Ignore function calls. - $ignore = [ - T_NULLSAFE_OBJECT_OPERATOR, - T_OBJECT_OPERATOR, - T_STRING, - T_VARIABLE, - T_WHITESPACE, - ]; - - $next = $phpcsFile->findNext($ignore, ($stackPtr + 1), null, true); - if ($tokens[$next]['code'] === T_CLOSURE - || ($tokens[$next]['code'] === T_OPEN_PARENTHESIS - && $tokens[($next - 1)]['code'] === T_STRING) - ) { - // Code will look like: $var = myFunction( - // and will be ignored. - return; - } - - $endStatement = $phpcsFile->findEndOfStatement($stackPtr); - for ($i = ($stackPtr + 1); $i < $endStatement; $i++) { - if ((isset(Tokens::$comparisonTokens[$tokens[$i]['code']]) === true - && $tokens[$i]['code'] !== T_COALESCE) - || $tokens[$i]['code'] === T_INLINE_THEN - ) { - $error = 'The value of a comparison must not be assigned to a variable'; - $phpcsFile->addError($error, $stackPtr, 'AssignedComparison'); - break; - } - - if (isset(Tokens::$booleanOperators[$tokens[$i]['code']]) === true - || $tokens[$i]['code'] === T_BOOLEAN_NOT - ) { - $error = 'The value of a boolean operation must not be assigned to a variable'; - $phpcsFile->addError($error, $stackPtr, 'AssignedBool'); - break; - } - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowInlineIfSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowInlineIfSniff.php deleted file mode 100644 index 60b0c37..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowInlineIfSniff.php +++ /dev/null @@ -1,57 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class DisallowInlineIfSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_INLINE_THEN]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $phpcsFile->addError('Inline IF statements are not allowed', $stackPtr, 'Found'); - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowMultipleAssignmentsSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowMultipleAssignmentsSniff.php deleted file mode 100644 index 4448d24..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowMultipleAssignmentsSniff.php +++ /dev/null @@ -1,186 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class DisallowMultipleAssignmentsSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_EQUAL]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Ignore default value assignments in function definitions. - $function = $phpcsFile->findPrevious([T_FUNCTION, T_CLOSURE, T_FN], ($stackPtr - 1), null, false, null, true); - if ($function !== false) { - $opener = $tokens[$function]['parenthesis_opener']; - $closer = $tokens[$function]['parenthesis_closer']; - if ($opener < $stackPtr && $closer > $stackPtr) { - return; - } - } - - // Ignore assignments in WHILE loop conditions. - if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) { - $nested = $tokens[$stackPtr]['nested_parenthesis']; - foreach ($nested as $opener => $closer) { - if (isset($tokens[$opener]['parenthesis_owner']) === true - && $tokens[$tokens[$opener]['parenthesis_owner']]['code'] === T_WHILE - ) { - return; - } - } - } - - // Ignore member var definitions. - if (empty($tokens[$stackPtr]['conditions']) === false) { - $conditions = $tokens[$stackPtr]['conditions']; - end($conditions); - $deepestScope = key($conditions); - if (isset(Tokens::$ooScopeTokens[$tokens[$deepestScope]['code']]) === true) { - return; - } - } - - /* - The general rule is: - Find an equal sign and go backwards along the line. If you hit an - end bracket, skip to the opening bracket. When you find a variable, - stop. That variable must be the first non-empty token on the line - or in the statement. If not, throw an error. - */ - - for ($varToken = ($stackPtr - 1); $varToken >= 0; $varToken--) { - if (in_array($tokens[$varToken]['code'], [T_SEMICOLON, T_OPEN_CURLY_BRACKET], true) === true) { - // We've reached the next statement, so we - // didn't find a variable. - return; - } - - // Skip brackets. - if (isset($tokens[$varToken]['parenthesis_opener']) === true && $tokens[$varToken]['parenthesis_opener'] < $varToken) { - $varToken = $tokens[$varToken]['parenthesis_opener']; - continue; - } - - if (isset($tokens[$varToken]['bracket_opener']) === true) { - $varToken = $tokens[$varToken]['bracket_opener']; - continue; - } - - if ($tokens[$varToken]['code'] === T_VARIABLE) { - // We found our variable. - break; - } - }//end for - - if ($varToken <= 0) { - // Didn't find a variable. - return; - } - - $start = $phpcsFile->findStartOfStatement($varToken); - - $allowed = Tokens::$emptyTokens; - - $allowed[T_STRING] = T_STRING; - $allowed[T_NS_SEPARATOR] = T_NS_SEPARATOR; - $allowed[T_DOUBLE_COLON] = T_DOUBLE_COLON; - $allowed[T_OBJECT_OPERATOR] = T_OBJECT_OPERATOR; - $allowed[T_ASPERAND] = T_ASPERAND; - $allowed[T_DOLLAR] = T_DOLLAR; - $allowed[T_SELF] = T_SELF; - $allowed[T_PARENT] = T_PARENT; - $allowed[T_STATIC] = T_STATIC; - - $varToken = $phpcsFile->findPrevious($allowed, ($varToken - 1), null, true); - - if ($varToken < $start - && $tokens[$varToken]['code'] !== T_OPEN_PARENTHESIS - && $tokens[$varToken]['code'] !== T_OPEN_SQUARE_BRACKET - ) { - $varToken = $start; - } - - // Ignore the first part of FOR loops as we are allowed to - // assign variables there even though the variable is not the - // first thing on the line. - if ($tokens[$varToken]['code'] === T_OPEN_PARENTHESIS && isset($tokens[$varToken]['parenthesis_owner']) === true) { - $owner = $tokens[$varToken]['parenthesis_owner']; - if ($tokens[$owner]['code'] === T_FOR) { - return; - } - } - - if ($tokens[$varToken]['code'] === T_VARIABLE - || $tokens[$varToken]['code'] === T_OPEN_TAG - || $tokens[$varToken]['code'] === T_GOTO_LABEL - || $tokens[$varToken]['code'] === T_INLINE_THEN - || $tokens[$varToken]['code'] === T_INLINE_ELSE - || $tokens[$varToken]['code'] === T_SEMICOLON - || $tokens[$varToken]['code'] === T_CLOSE_PARENTHESIS - || isset($allowed[$tokens[$varToken]['code']]) === true - ) { - return; - } - - $error = 'Assignments must be the first block of code on a line'; - $errorCode = 'Found'; - - if (isset($nested) === true) { - $controlStructures = [ - T_IF => T_IF, - T_ELSEIF => T_ELSEIF, - T_SWITCH => T_SWITCH, - T_CASE => T_CASE, - T_FOR => T_FOR, - T_MATCH => T_MATCH, - ]; - foreach ($nested as $opener => $closer) { - if (isset($tokens[$opener]['parenthesis_owner']) === true - && isset($controlStructures[$tokens[$tokens[$opener]['parenthesis_owner']]['code']]) === true - ) { - $errorCode .= 'InControlStructure'; - break; - } - } - } - - $phpcsFile->addError($error, $stackPtr, $errorCode); - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowSizeFunctionsInLoopsSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowSizeFunctionsInLoopsSniff.php deleted file mode 100644 index a0f1161..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowSizeFunctionsInLoopsSniff.php +++ /dev/null @@ -1,116 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class DisallowSizeFunctionsInLoopsSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - /** - * An array of functions we don't want in the condition of loops. - * - * @var array - */ - protected $forbiddenFunctions = [ - 'PHP' => [ - 'sizeof' => true, - 'strlen' => true, - 'count' => true, - ], - 'JS' => ['length' => true], - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_WHILE, - T_FOR, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $tokenizer = $phpcsFile->tokenizerType; - $openBracket = $tokens[$stackPtr]['parenthesis_opener']; - $closeBracket = $tokens[$stackPtr]['parenthesis_closer']; - - if ($tokens[$stackPtr]['code'] === T_FOR) { - // We only want to check the condition in FOR loops. - $start = $phpcsFile->findNext(T_SEMICOLON, ($openBracket + 1)); - $end = $phpcsFile->findPrevious(T_SEMICOLON, ($closeBracket - 1)); - } else { - $start = $openBracket; - $end = $closeBracket; - } - - for ($i = ($start + 1); $i < $end; $i++) { - if ($tokens[$i]['code'] === T_STRING - && isset($this->forbiddenFunctions[$tokenizer][$tokens[$i]['content']]) === true - ) { - $functionName = $tokens[$i]['content']; - if ($tokenizer === 'JS') { - // Needs to be in the form object.function to be valid. - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($i - 1), null, true); - if ($prev === false || $tokens[$prev]['code'] !== T_OBJECT_OPERATOR) { - continue; - } - - $functionName = 'object.'.$functionName; - } else { - // Make sure it isn't a member var. - if ($tokens[($i - 1)]['code'] === T_OBJECT_OPERATOR - || $tokens[($i - 1)]['code'] === T_NULLSAFE_OBJECT_OPERATOR - ) { - continue; - } - - $functionName .= '()'; - } - - $error = 'The use of %s inside a loop condition is not allowed; assign the return value to a variable and use the variable in the loop condition instead'; - $data = [$functionName]; - $phpcsFile->addError($error, $i, 'Found', $data); - }//end if - }//end for - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DiscouragedFunctionsSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DiscouragedFunctionsSniff.php deleted file mode 100644 index 9f86a17..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DiscouragedFunctionsSniff.php +++ /dev/null @@ -1,38 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP; - -use PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\ForbiddenFunctionsSniff as GenericForbiddenFunctionsSniff; - -class DiscouragedFunctionsSniff extends GenericForbiddenFunctionsSniff -{ - - /** - * A list of forbidden functions with their alternatives. - * - * The value is NULL if no alternative exists. IE, the - * function should just not be used. - * - * @var array - */ - public $forbiddenFunctions = [ - 'error_log' => null, - 'print_r' => null, - 'var_dump' => null, - ]; - - /** - * If true, an error will be thrown; otherwise a warning. - * - * @var boolean - */ - public $error = false; - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/EmbeddedPhpSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/EmbeddedPhpSniff.php deleted file mode 100644 index ef11aa6..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/EmbeddedPhpSniff.php +++ /dev/null @@ -1,402 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class EmbeddedPhpSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_OPEN_TAG]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // If the close php tag is on the same line as the opening - // then we have an inline embedded PHP block. - $closeTag = $phpcsFile->findNext(T_CLOSE_TAG, $stackPtr); - if ($closeTag === false || $tokens[$stackPtr]['line'] !== $tokens[$closeTag]['line']) { - $this->validateMultilineEmbeddedPhp($phpcsFile, $stackPtr); - } else { - $this->validateInlineEmbeddedPhp($phpcsFile, $stackPtr); - } - - }//end process() - - - /** - * Validates embedded PHP that exists on multiple lines. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - private function validateMultilineEmbeddedPhp($phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $prevTag = $phpcsFile->findPrevious(T_OPEN_TAG, ($stackPtr - 1)); - if ($prevTag === false) { - // This is the first open tag. - return; - } - - $firstContent = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - $closingTag = $phpcsFile->findNext(T_CLOSE_TAG, $stackPtr); - if ($closingTag !== false) { - $nextContent = $phpcsFile->findNext(T_WHITESPACE, ($closingTag + 1), $phpcsFile->numTokens, true); - if ($nextContent === false) { - // Final closing tag. It will be handled elsewhere. - return; - } - - // We have an opening and a closing tag, that lie within other content. - if ($firstContent === $closingTag) { - $error = 'Empty embedded PHP tag found'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Empty'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = $stackPtr; $i <= $closingTag; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - - return; - } - }//end if - - if ($tokens[$firstContent]['line'] === $tokens[$stackPtr]['line']) { - $error = 'Opening PHP tag must be on a line by itself'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'ContentAfterOpen'); - if ($fix === true) { - $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $stackPtr, true); - $padding = (strlen($tokens[$first]['content']) - strlen(ltrim($tokens[$first]['content']))); - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->addNewline($stackPtr); - $phpcsFile->fixer->addContent($stackPtr, str_repeat(' ', $padding)); - $phpcsFile->fixer->endChangeset(); - } - } else { - // Check the indent of the first line, except if it is a scope closer. - if (isset($tokens[$firstContent]['scope_closer']) === false - || $tokens[$firstContent]['scope_closer'] !== $firstContent - ) { - // Check for a blank line at the top. - if ($tokens[$firstContent]['line'] > ($tokens[$stackPtr]['line'] + 1)) { - // Find a token on the blank line to throw the error on. - $i = $stackPtr; - do { - $i++; - } while ($tokens[$i]['line'] !== ($tokens[$stackPtr]['line'] + 1)); - - $error = 'Blank line found at start of embedded PHP content'; - $fix = $phpcsFile->addFixableError($error, $i, 'SpacingBefore'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($stackPtr + 1); $i < $firstContent; $i++) { - if ($tokens[$i]['line'] === $tokens[$firstContent]['line'] - || $tokens[$i]['line'] === $tokens[$stackPtr]['line'] - ) { - continue; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - }//end if - - $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $stackPtr); - if ($first === false) { - $first = $phpcsFile->findFirstOnLine(T_INLINE_HTML, $stackPtr); - $indent = (strlen($tokens[$first]['content']) - strlen(ltrim($tokens[$first]['content']))); - } else { - $indent = ($tokens[($first + 1)]['column'] - 1); - } - - $contentColumn = ($tokens[$firstContent]['column'] - 1); - if ($contentColumn !== $indent) { - $error = 'First line of embedded PHP code must be indented %s spaces; %s found'; - $data = [ - $indent, - $contentColumn, - ]; - $fix = $phpcsFile->addFixableError($error, $firstContent, 'Indent', $data); - if ($fix === true) { - $padding = str_repeat(' ', $indent); - if ($contentColumn === 0) { - $phpcsFile->fixer->addContentBefore($firstContent, $padding); - } else { - $phpcsFile->fixer->replaceToken(($firstContent - 1), $padding); - } - } - } - }//end if - }//end if - - $lastContent = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); - if ($tokens[$lastContent]['line'] === $tokens[$stackPtr]['line'] - && trim($tokens[$lastContent]['content']) !== '' - ) { - $error = 'Opening PHP tag must be on a line by itself'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'ContentBeforeOpen'); - if ($fix === true) { - $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $stackPtr); - if ($first === false) { - $first = $phpcsFile->findFirstOnLine(T_INLINE_HTML, $stackPtr); - $padding = (strlen($tokens[$first]['content']) - strlen(ltrim($tokens[$first]['content']))); - } else { - $padding = ($tokens[($first + 1)]['column'] - 1); - } - - $phpcsFile->fixer->addContentBefore($stackPtr, $phpcsFile->eolChar.str_repeat(' ', $padding)); - } - } else { - // Find the first token on the first non-empty line we find. - for ($first = ($stackPtr - 1); $first > 0; $first--) { - if ($tokens[$first]['line'] === $tokens[$stackPtr]['line']) { - continue; - } else if (trim($tokens[$first]['content']) !== '') { - $first = $phpcsFile->findFirstOnLine([], $first, true); - break; - } - } - - $expected = 0; - if ($tokens[$first]['code'] === T_INLINE_HTML - && trim($tokens[$first]['content']) !== '' - ) { - $expected = (strlen($tokens[$first]['content']) - strlen(ltrim($tokens[$first]['content']))); - } else if ($tokens[$first]['code'] === T_WHITESPACE) { - $expected = ($tokens[($first + 1)]['column'] - 1); - } - - $expected += 4; - $found = ($tokens[$stackPtr]['column'] - 1); - if ($found > $expected) { - $error = 'Opening PHP tag indent incorrect; expected no more than %s spaces but found %s'; - $data = [ - $expected, - $found, - ]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'OpenTagIndent', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($stackPtr - 1), str_repeat(' ', $expected)); - } - } - }//end if - - if ($closingTag === false) { - return; - } - - $lastContent = $phpcsFile->findPrevious(T_WHITESPACE, ($closingTag - 1), ($stackPtr + 1), true); - $nextContent = $phpcsFile->findNext(T_WHITESPACE, ($closingTag + 1), null, true); - - if ($tokens[$lastContent]['line'] === $tokens[$closingTag]['line']) { - $error = 'Closing PHP tag must be on a line by itself'; - $fix = $phpcsFile->addFixableError($error, $closingTag, 'ContentBeforeEnd'); - if ($fix === true) { - $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $closingTag, true); - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->addContentBefore($closingTag, str_repeat(' ', ($tokens[$first]['column'] - 1))); - $phpcsFile->fixer->addNewlineBefore($closingTag); - $phpcsFile->fixer->endChangeset(); - } - } else if ($tokens[$nextContent]['line'] === $tokens[$closingTag]['line']) { - $error = 'Closing PHP tag must be on a line by itself'; - $fix = $phpcsFile->addFixableError($error, $closingTag, 'ContentAfterEnd'); - if ($fix === true) { - $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $closingTag, true); - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->addNewline($closingTag); - $phpcsFile->fixer->addContent($closingTag, str_repeat(' ', ($tokens[$first]['column'] - 1))); - $phpcsFile->fixer->endChangeset(); - } - }//end if - - $next = $phpcsFile->findNext(T_OPEN_TAG, ($closingTag + 1)); - if ($next === false) { - return; - } - - // Check for a blank line at the bottom. - if ((isset($tokens[$lastContent]['scope_closer']) === false - || $tokens[$lastContent]['scope_closer'] !== $lastContent) - && $tokens[$lastContent]['line'] < ($tokens[$closingTag]['line'] - 1) - ) { - // Find a token on the blank line to throw the error on. - $i = $closingTag; - do { - $i--; - } while ($tokens[$i]['line'] !== ($tokens[$closingTag]['line'] - 1)); - - $error = 'Blank line found at end of embedded PHP content'; - $fix = $phpcsFile->addFixableError($error, $i, 'SpacingAfter'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($lastContent + 1); $i < $closingTag; $i++) { - if ($tokens[$i]['line'] === $tokens[$lastContent]['line'] - || $tokens[$i]['line'] === $tokens[$closingTag]['line'] - ) { - continue; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - }//end if - - }//end validateMultilineEmbeddedPhp() - - - /** - * Validates embedded PHP that exists on one line. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - private function validateInlineEmbeddedPhp($phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // We only want one line PHP sections, so return if the closing tag is - // on the next line. - $closeTag = $phpcsFile->findNext(T_CLOSE_TAG, $stackPtr, null, false); - if ($tokens[$stackPtr]['line'] !== $tokens[$closeTag]['line']) { - return; - } - - // Check that there is one, and only one space at the start of the statement. - $firstContent = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), $closeTag, true); - - if ($firstContent === false) { - $error = 'Empty embedded PHP tag found'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Empty'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = $stackPtr; $i <= $closeTag; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - - return; - } - - // The open tag token always contains a single space after it. - $leadingSpace = 1; - if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE) { - $leadingSpace = ($tokens[($stackPtr + 1)]['length'] + 1); - } - - if ($leadingSpace !== 1) { - $error = 'Expected 1 space after opening PHP tag; %s found'; - $data = [$leadingSpace]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingAfterOpen', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($stackPtr + 1), ''); - } - } - - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($closeTag - 1), $stackPtr, true); - if ($prev !== $stackPtr) { - if ((isset($tokens[$prev]['scope_opener']) === false - || $tokens[$prev]['scope_opener'] !== $prev) - && (isset($tokens[$prev]['scope_closer']) === false - || $tokens[$prev]['scope_closer'] !== $prev) - && $tokens[$prev]['code'] !== T_SEMICOLON - ) { - $error = 'Inline PHP statement must end with a semicolon'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSemicolon'); - if ($fix === true) { - $phpcsFile->fixer->addContent($prev, ';'); - } - } else if ($tokens[$prev]['code'] === T_SEMICOLON) { - $statementCount = 1; - for ($i = ($stackPtr + 1); $i < $prev; $i++) { - if ($tokens[$i]['code'] === T_SEMICOLON) { - $statementCount++; - } - } - - if ($statementCount > 1) { - $error = 'Inline PHP statement must contain a single statement; %s found'; - $data = [$statementCount]; - $phpcsFile->addError($error, $stackPtr, 'MultipleStatements', $data); - } - } - }//end if - - $trailingSpace = 0; - if ($tokens[($closeTag - 1)]['code'] === T_WHITESPACE) { - $trailingSpace = $tokens[($closeTag - 1)]['length']; - } else if (($tokens[($closeTag - 1)]['code'] === T_COMMENT - || isset(Tokens::$phpcsCommentTokens[$tokens[($closeTag - 1)]['code']]) === true) - && substr($tokens[($closeTag - 1)]['content'], -1) === ' ' - ) { - $trailingSpace = (strlen($tokens[($closeTag - 1)]['content']) - strlen(rtrim($tokens[($closeTag - 1)]['content']))); - } - - if ($trailingSpace !== 1) { - $error = 'Expected 1 space before closing PHP tag; %s found'; - $data = [$trailingSpace]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingBeforeClose', $data); - if ($fix === true) { - if ($trailingSpace === 0) { - $phpcsFile->fixer->addContentBefore($closeTag, ' '); - } else if ($tokens[($closeTag - 1)]['code'] === T_COMMENT - || isset(Tokens::$phpcsCommentTokens[$tokens[($closeTag - 1)]['code']]) === true - ) { - $phpcsFile->fixer->replaceToken(($closeTag - 1), rtrim($tokens[($closeTag - 1)]['content']).' '); - } else { - $phpcsFile->fixer->replaceToken(($closeTag - 1), ' '); - } - } - } - - }//end validateInlineEmbeddedPhp() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/EvalSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/EvalSniff.php deleted file mode 100644 index 3162c14..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/EvalSniff.php +++ /dev/null @@ -1,48 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class EvalSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_EVAL]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $error = 'Use of eval() is discouraged'; - $phpcsFile->addWarning($error, $stackPtr, 'Discouraged'); - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/GlobalKeywordSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/GlobalKeywordSniff.php deleted file mode 100644 index 024eff8..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/GlobalKeywordSniff.php +++ /dev/null @@ -1,53 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class GlobalKeywordSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_GLOBAL]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $nextVar = $tokens[$phpcsFile->findNext([T_VARIABLE], $stackPtr)]; - $varName = str_replace('$', '', $nextVar['content']); - $error = 'Use of the "global" keyword is forbidden; use "$GLOBALS[\'%s\']" instead'; - $data = [$varName]; - $phpcsFile->addError($error, $stackPtr, 'NotAllowed', $data); - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/HeredocSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/HeredocSniff.php deleted file mode 100644 index 67369cb..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/HeredocSniff.php +++ /dev/null @@ -1,51 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class HeredocSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_START_HEREDOC, - T_START_NOWDOC, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $error = 'Use of heredoc and nowdoc syntax ("<<<") is not allowed; use standard strings or inline HTML instead'; - $phpcsFile->addError($error, $stackPtr, 'NotAllowed'); - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/InnerFunctionsSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/InnerFunctionsSniff.php deleted file mode 100644 index 4e3ee21..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/InnerFunctionsSniff.php +++ /dev/null @@ -1,68 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class InnerFunctionsSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_FUNCTION]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $function = $phpcsFile->getCondition($stackPtr, T_FUNCTION); - if ($function === false) { - // Not a nested function. - return; - } - - $class = $phpcsFile->getCondition($stackPtr, T_ANON_CLASS, false); - if ($class !== false && $class > $function) { - // Ignore methods in anon classes. - return; - } - - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); - if ($tokens[$prev]['code'] === T_EQUAL) { - // Ignore closures. - return; - } - - $error = 'The use of inner functions is forbidden'; - $phpcsFile->addError($error, $stackPtr, 'NotAllowed'); - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/LowercasePHPFunctionsSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/LowercasePHPFunctionsSniff.php deleted file mode 100644 index 519b7f6..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/LowercasePHPFunctionsSniff.php +++ /dev/null @@ -1,162 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class LowercasePHPFunctionsSniff implements Sniff -{ - - /** - * String -> int hash map of all php built in function names - * - * @var array - */ - private $builtInFunctions; - - - /** - * Construct the LowercasePHPFunctionSniff - */ - public function __construct() - { - - $allFunctions = get_defined_functions(); - $this->builtInFunctions = array_flip($allFunctions['internal']); - - }//end __construct() - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_STRING]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $content = $tokens[$stackPtr]['content']; - $contentLc = strtolower($content); - if ($content === $contentLc) { - return; - } - - // Make sure it is an inbuilt PHP function. - // PHP_CodeSniffer can possibly include user defined functions - // through the use of vendor/autoload.php. - if (isset($this->builtInFunctions[$contentLc]) === false) { - return; - } - - // Make sure this is a function call or a use statement. - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($next === false) { - // Not a function call. - return; - } - - $ignore = Tokens::$emptyTokens; - $ignore[] = T_BITWISE_AND; - $prev = $phpcsFile->findPrevious($ignore, ($stackPtr - 1), null, true); - $prevPrev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prev - 1), null, true); - - if ($tokens[$next]['code'] !== T_OPEN_PARENTHESIS) { - // Is this a use statement importing a PHP native function ? - if ($tokens[$next]['code'] !== T_NS_SEPARATOR - && $tokens[$prev]['code'] === T_STRING - && $tokens[$prev]['content'] === 'function' - && $prevPrev !== false - && $tokens[$prevPrev]['code'] === T_USE - ) { - $error = 'Use statements for PHP native functions must be lowercase; expected "%s" but found "%s"'; - $data = [ - $contentLc, - $content, - ]; - - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'UseStatementUppercase', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($stackPtr, $contentLc); - } - } - - // No open parenthesis; not a "use function" statement nor a function call. - return; - }//end if - - if ($tokens[$prev]['code'] === T_FUNCTION) { - // Function declaration, not a function call. - return; - } - - if ($tokens[$prev]['code'] === T_NS_SEPARATOR) { - if ($prevPrev !== false - && ($tokens[$prevPrev]['code'] === T_STRING - || $tokens[$prevPrev]['code'] === T_NAMESPACE - || $tokens[$prevPrev]['code'] === T_NEW) - ) { - // Namespaced class/function, not an inbuilt function. - // Could potentially give false negatives for non-namespaced files - // when namespace\functionName() is encountered. - return; - } - } - - if ($tokens[$prev]['code'] === T_NEW) { - // Object creation, not an inbuilt function. - return; - } - - if ($tokens[$prev]['code'] === T_OBJECT_OPERATOR - || $tokens[$prev]['code'] === T_NULLSAFE_OBJECT_OPERATOR - ) { - // Not an inbuilt function. - return; - } - - if ($tokens[$prev]['code'] === T_DOUBLE_COLON) { - // Not an inbuilt function. - return; - } - - $error = 'Calls to PHP native functions must be lowercase; expected "%s" but found "%s"'; - $data = [ - $contentLc, - $content, - ]; - - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'CallUppercase', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($stackPtr, $contentLc); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/NonExecutableCodeSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/NonExecutableCodeSniff.php deleted file mode 100644 index 343d9b2..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/NonExecutableCodeSniff.php +++ /dev/null @@ -1,277 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class NonExecutableCodeSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_BREAK, - T_CONTINUE, - T_RETURN, - T_THROW, - T_EXIT, - T_GOTO, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // If this token is preceded with an "or", it only relates to one line - // and should be ignored. For example: fopen() or die(). - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if ($tokens[$prev]['code'] === T_LOGICAL_OR || $tokens[$prev]['code'] === T_BOOLEAN_OR) { - return; - } - - // Check if this token is actually part of a one-line IF or ELSE statement. - for ($i = ($stackPtr - 1); $i > 0; $i--) { - if ($tokens[$i]['code'] === T_CLOSE_PARENTHESIS) { - $i = $tokens[$i]['parenthesis_opener']; - continue; - } else if (isset(Tokens::$emptyTokens[$tokens[$i]['code']]) === true) { - continue; - } - - break; - } - - if ($tokens[$i]['code'] === T_IF - || $tokens[$i]['code'] === T_ELSE - || $tokens[$i]['code'] === T_ELSEIF - ) { - return; - } - - if ($tokens[$stackPtr]['code'] === T_RETURN) { - $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($tokens[$next]['code'] === T_SEMICOLON) { - $next = $phpcsFile->findNext(T_WHITESPACE, ($next + 1), null, true); - if ($tokens[$next]['code'] === T_CLOSE_CURLY_BRACKET) { - // If this is the closing brace of a function - // then this return statement doesn't return anything - // and is not required anyway. - $owner = $tokens[$next]['scope_condition']; - if ($tokens[$owner]['code'] === T_FUNCTION) { - $warning = 'Empty return statement not required here'; - $phpcsFile->addWarning($warning, $stackPtr, 'ReturnNotRequired'); - return; - } - } - } - } - - if (isset($tokens[$stackPtr]['scope_opener']) === true) { - $owner = $tokens[$stackPtr]['scope_condition']; - if ($tokens[$owner]['code'] === T_CASE || $tokens[$owner]['code'] === T_DEFAULT) { - // This token closes the scope of a CASE or DEFAULT statement - // so any code between this statement and the next CASE, DEFAULT or - // end of SWITCH token will not be executable. - $end = $phpcsFile->findEndOfStatement($stackPtr); - $next = $phpcsFile->findNext( - [ - T_CASE, - T_DEFAULT, - T_CLOSE_CURLY_BRACKET, - T_ENDSWITCH, - ], - ($end + 1) - ); - - if ($next !== false) { - $lastLine = $tokens[$end]['line']; - for ($i = ($stackPtr + 1); $i < $next; $i++) { - if (isset(Tokens::$emptyTokens[$tokens[$i]['code']]) === true) { - continue; - } - - $line = $tokens[$i]['line']; - if ($line > $lastLine) { - $type = substr($tokens[$stackPtr]['type'], 2); - $warning = 'Code after the %s statement on line %s cannot be executed'; - $data = [ - $type, - $tokens[$stackPtr]['line'], - ]; - $phpcsFile->addWarning($warning, $i, 'Unreachable', $data); - $lastLine = $line; - } - } - }//end if - - // That's all we have to check for these types of statements. - return; - }//end if - }//end if - - // This token may be part of an inline condition. - // If we find a closing parenthesis that belongs to a condition - // we should ignore this token. - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if (isset($tokens[$prev]['parenthesis_owner']) === true) { - $owner = $tokens[$prev]['parenthesis_owner']; - $ignore = [ - T_IF => true, - T_ELSE => true, - T_ELSEIF => true, - ]; - if (isset($ignore[$tokens[$owner]['code']]) === true) { - return; - } - } - - $ourConditions = array_keys($tokens[$stackPtr]['conditions']); - - if (empty($ourConditions) === false) { - $condition = array_pop($ourConditions); - - if (isset($tokens[$condition]['scope_closer']) === false) { - return; - } - - // Special case for BREAK statements sitting directly inside SWITCH - // statements. If we get to this point, we know the BREAK is not being - // used to close a CASE statement, so it is most likely non-executable - // code itself (as is the case when you put return; break; at the end of - // a case). So we need to ignore this token. - if ($tokens[$condition]['code'] === T_SWITCH - && $tokens[$stackPtr]['code'] === T_BREAK - ) { - return; - } - - $closer = $tokens[$condition]['scope_closer']; - - // If the closer for our condition is shared with other openers, - // we will need to throw errors from this token to the next - // shared opener (if there is one), not to the scope closer. - $nextOpener = null; - for ($i = ($stackPtr + 1); $i < $closer; $i++) { - if (isset($tokens[$i]['scope_closer']) === true) { - if ($tokens[$i]['scope_closer'] === $closer) { - // We found an opener that shares the same - // closing token as us. - $nextOpener = $i; - break; - } - } - }//end for - - if ($nextOpener === null) { - $end = $closer; - } else { - $end = ($nextOpener - 1); - } - } else { - // This token is in the global scope. - if ($tokens[$stackPtr]['code'] === T_BREAK) { - return; - } - - // Throw an error for all lines until the end of the file. - $end = ($phpcsFile->numTokens - 1); - }//end if - - // Find the semicolon that ends this statement, skipping - // nested statements like FOR loops and closures. - for ($start = ($stackPtr + 1); $start < $phpcsFile->numTokens; $start++) { - if ($start === $end) { - break; - } - - if (isset($tokens[$start]['parenthesis_closer']) === true - && $tokens[$start]['code'] === T_OPEN_PARENTHESIS - ) { - $start = $tokens[$start]['parenthesis_closer']; - continue; - } - - if (isset($tokens[$start]['bracket_closer']) === true - && $tokens[$start]['code'] === T_OPEN_CURLY_BRACKET - ) { - $start = $tokens[$start]['bracket_closer']; - continue; - } - - if ($tokens[$start]['code'] === T_SEMICOLON) { - break; - } - }//end for - - if (isset($tokens[$start]) === false) { - return; - } - - $lastLine = $tokens[$start]['line']; - for ($i = ($start + 1); $i < $end; $i++) { - if (isset(Tokens::$emptyTokens[$tokens[$i]['code']]) === true - || isset(Tokens::$bracketTokens[$tokens[$i]['code']]) === true - || $tokens[$i]['code'] === T_SEMICOLON - ) { - continue; - } - - // Skip whole functions and classes/interfaces because they are not - // technically executed code, but rather declarations that may be used. - if (isset(Tokens::$ooScopeTokens[$tokens[$i]['code']]) === true - || $tokens[$i]['code'] === T_FUNCTION - || $tokens[$i]['code'] === T_CLOSURE - ) { - if (isset($tokens[$i]['scope_closer']) === false) { - // Parse error/Live coding. - return; - } - - $i = $tokens[$i]['scope_closer']; - continue; - } - - $line = $tokens[$i]['line']; - if ($line > $lastLine) { - $type = substr($tokens[$stackPtr]['type'], 2); - $warning = 'Code after the %s statement on line %s cannot be executed'; - $data = [ - $type, - $tokens[$stackPtr]['line'], - ]; - $phpcsFile->addWarning($warning, $i, 'Unreachable', $data); - $lastLine = $line; - } - }//end for - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/MemberVarScopeSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/MemberVarScopeSniff.php deleted file mode 100644 index 5239b64..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/MemberVarScopeSniff.php +++ /dev/null @@ -1,77 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Scope; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\AbstractVariableSniff; - -class MemberVarScopeSniff extends AbstractVariableSniff -{ - - - /** - * Processes the function tokens within the class. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position where the token was found. - * - * @return void - */ - protected function processMemberVar(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $properties = $phpcsFile->getMemberProperties($stackPtr); - - if ($properties === [] || $properties['scope_specified'] !== false) { - return; - } - - $error = 'Scope modifier not specified for member variable "%s"'; - $data = [$tokens[$stackPtr]['content']]; - $phpcsFile->addError($error, $stackPtr, 'Missing', $data); - - }//end processMemberVar() - - - /** - * Processes normal variables. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position where the token was found. - * - * @return void - */ - protected function processVariable(File $phpcsFile, $stackPtr) - { - /* - We don't care about normal variables. - */ - - }//end processVariable() - - - /** - * Processes variables in double quoted strings. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position where the token was found. - * - * @return void - */ - protected function processVariableInString(File $phpcsFile, $stackPtr) - { - /* - We don't care about normal variables. - */ - - }//end processVariableInString() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/MethodScopeSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/MethodScopeSniff.php deleted file mode 100644 index 8c60208..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/MethodScopeSniff.php +++ /dev/null @@ -1,92 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Scope; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\AbstractScopeSniff; -use PHP_CodeSniffer\Util\Tokens; - -class MethodScopeSniff extends AbstractScopeSniff -{ - - - /** - * Constructs a Squiz_Sniffs_Scope_MethodScopeSniff. - */ - public function __construct() - { - parent::__construct(Tokens::$ooScopeTokens, [T_FUNCTION]); - - }//end __construct() - - - /** - * Processes the function tokens within the class. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position where the token was found. - * @param int $currScope The current scope opener token. - * - * @return void - */ - protected function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScope) - { - $tokens = $phpcsFile->getTokens(); - - // Determine if this is a function which needs to be examined. - $conditions = $tokens[$stackPtr]['conditions']; - end($conditions); - $deepestScope = key($conditions); - if ($deepestScope !== $currScope) { - return; - } - - $methodName = $phpcsFile->getDeclarationName($stackPtr); - if ($methodName === null) { - // Ignore closures. - return; - } - - $modifier = null; - for ($i = ($stackPtr - 1); $i > 0; $i--) { - if ($tokens[$i]['line'] < $tokens[$stackPtr]['line']) { - break; - } else if (isset(Tokens::$scopeModifiers[$tokens[$i]['code']]) === true) { - $modifier = $i; - break; - } - } - - if ($modifier === null) { - $error = 'Visibility must be declared on method "%s"'; - $data = [$methodName]; - $phpcsFile->addError($error, $stackPtr, 'Missing', $data); - } - - }//end processTokenWithinScope() - - - /** - * Processes a token that is found within the scope that this test is - * listening to. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position in the stack where this - * token was found. - * - * @return void - */ - protected function processTokenOutsideScope(File $phpcsFile, $stackPtr) - { - - }//end processTokenOutsideScope() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/StaticThisUsageSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/StaticThisUsageSniff.php deleted file mode 100644 index 0bafbf4..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/StaticThisUsageSniff.php +++ /dev/null @@ -1,128 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Scope; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\AbstractScopeSniff; -use PHP_CodeSniffer\Util\Tokens; - -class StaticThisUsageSniff extends AbstractScopeSniff -{ - - - /** - * Constructs the test with the tokens it wishes to listen for. - */ - public function __construct() - { - parent::__construct([T_CLASS, T_TRAIT, T_ANON_CLASS], [T_FUNCTION]); - - }//end __construct() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * @param int $currScope A pointer to the start of the scope. - * - * @return void - */ - public function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScope) - { - $tokens = $phpcsFile->getTokens(); - - // Determine if this is a function which needs to be examined. - $conditions = $tokens[$stackPtr]['conditions']; - end($conditions); - $deepestScope = key($conditions); - if ($deepestScope !== $currScope) { - return; - } - - // Ignore abstract functions. - if (isset($tokens[$stackPtr]['scope_closer']) === false) { - return; - } - - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($next === false || $tokens[$next]['code'] !== T_STRING) { - // Not a function declaration, or incomplete. - return; - } - - $methodProps = $phpcsFile->getMethodProperties($stackPtr); - if ($methodProps['is_static'] === false) { - return; - } - - $next = $stackPtr; - $end = $tokens[$stackPtr]['scope_closer']; - - $this->checkThisUsage($phpcsFile, $next, $end); - - }//end processTokenWithinScope() - - - /** - * Check for $this variable usage between $next and $end tokens. - * - * @param File $phpcsFile The current file being scanned. - * @param int $next The position of the next token to check. - * @param int $end The position of the last token to check. - * - * @return void - */ - private function checkThisUsage(File $phpcsFile, $next, $end) - { - $tokens = $phpcsFile->getTokens(); - - do { - $next = $phpcsFile->findNext([T_VARIABLE, T_ANON_CLASS], ($next + 1), $end); - if ($next === false) { - continue; - } - - if ($tokens[$next]['code'] === T_ANON_CLASS) { - $this->checkThisUsage($phpcsFile, $next, $tokens[$next]['scope_opener']); - $next = $tokens[$next]['scope_closer']; - continue; - } - - if ($tokens[$next]['content'] !== '$this') { - continue; - } - - $error = 'Usage of "$this" in static methods will cause runtime errors'; - $phpcsFile->addError($error, $next, 'Found'); - } while ($next !== false); - - }//end checkThisUsage() - - - /** - * Processes a token that is found within the scope that this test is - * listening to. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position in the stack where this - * token was found. - * - * @return void - */ - protected function processTokenOutsideScope(File $phpcsFile, $stackPtr) - { - - }//end processTokenOutsideScope() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Strings/ConcatenationSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Strings/ConcatenationSpacingSniff.php deleted file mode 100644 index 9d32e54..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Strings/ConcatenationSpacingSniff.php +++ /dev/null @@ -1,164 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Strings; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class ConcatenationSpacingSniff implements Sniff -{ - - /** - * The number of spaces before and after a string concat. - * - * @var integer - */ - public $spacing = 0; - - /** - * Allow newlines instead of spaces. - * - * @var boolean - */ - public $ignoreNewlines = false; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_STRING_CONCAT]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - if (isset($tokens[($stackPtr + 2)]) === false) { - // Syntax error or live coding, bow out. - return; - } - - $ignoreBefore = false; - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if ($tokens[$prev]['code'] === T_END_HEREDOC || $tokens[$prev]['code'] === T_END_NOWDOC) { - // Spacing before must be preserved due to the here/nowdoc closing tag. - $ignoreBefore = true; - } - - $this->spacing = (int) $this->spacing; - - if ($ignoreBefore === false) { - if ($tokens[($stackPtr - 1)]['code'] !== T_WHITESPACE) { - $before = 0; - } else { - if ($tokens[($stackPtr - 2)]['line'] !== $tokens[$stackPtr]['line']) { - $before = 'newline'; - } else { - $before = $tokens[($stackPtr - 1)]['length']; - } - } - - $phpcsFile->recordMetric($stackPtr, 'Spacing before string concat', $before); - } - - if ($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { - $after = 0; - } else { - if ($tokens[($stackPtr + 2)]['line'] !== $tokens[$stackPtr]['line']) { - $after = 'newline'; - } else { - $after = $tokens[($stackPtr + 1)]['length']; - } - } - - $phpcsFile->recordMetric($stackPtr, 'Spacing after string concat', $after); - - if (($ignoreBefore === true - || $before === $this->spacing - || ($before === 'newline' - && $this->ignoreNewlines === true)) - && ($after === $this->spacing - || ($after === 'newline' - && $this->ignoreNewlines === true)) - ) { - return; - } - - if ($this->spacing === 0) { - $message = 'Concat operator must not be surrounded by spaces'; - $data = []; - } else { - if ($this->spacing > 1) { - $message = 'Concat operator must be surrounded by %s spaces'; - } else { - $message = 'Concat operator must be surrounded by a single space'; - } - - $data = [$this->spacing]; - } - - $fix = $phpcsFile->addFixableError($message, $stackPtr, 'PaddingFound', $data); - - if ($fix === true) { - $padding = str_repeat(' ', $this->spacing); - if ($ignoreBefore === false && ($before !== 'newline' || $this->ignoreNewlines === false)) { - if ($tokens[($stackPtr - 1)]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken(($stackPtr - 1), $padding); - if ($this->spacing === 0 - && ($tokens[($stackPtr - 2)]['code'] === T_LNUMBER - || $tokens[($stackPtr - 2)]['code'] === T_DNUMBER) - ) { - $phpcsFile->fixer->replaceToken(($stackPtr - 2), '('.$tokens[($stackPtr - 2)]['content'].')'); - } - - $phpcsFile->fixer->endChangeset(); - } else if ($this->spacing > 0) { - $phpcsFile->fixer->addContent(($stackPtr - 1), $padding); - } - } - - if ($after !== 'newline' || $this->ignoreNewlines === false) { - if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken(($stackPtr + 1), $padding); - if ($this->spacing === 0 - && ($tokens[($stackPtr + 2)]['code'] === T_LNUMBER - || $tokens[($stackPtr + 2)]['code'] === T_DNUMBER) - ) { - $phpcsFile->fixer->replaceToken(($stackPtr + 2), '('.$tokens[($stackPtr + 2)]['content'].')'); - } - - $phpcsFile->fixer->endChangeset(); - } else if ($this->spacing > 0) { - $phpcsFile->fixer->addContent($stackPtr, $padding); - } - } - }//end if - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Strings/DoubleQuoteUsageSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Strings/DoubleQuoteUsageSniff.php deleted file mode 100644 index 1ff99b9..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Strings/DoubleQuoteUsageSniff.php +++ /dev/null @@ -1,144 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Strings; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class DoubleQuoteUsageSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_CONSTANT_ENCAPSED_STRING, - T_DOUBLE_QUOTED_STRING, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // If tabs are being converted to spaces by the tokeniser, the - // original content should be used instead of the converted content. - if (isset($tokens[$stackPtr]['orig_content']) === true) { - $workingString = $tokens[$stackPtr]['orig_content']; - } else { - $workingString = $tokens[$stackPtr]['content']; - } - - $lastStringToken = $stackPtr; - - $i = ($stackPtr + 1); - if (isset($tokens[$i]) === true) { - while ($i < $phpcsFile->numTokens - && $tokens[$i]['code'] === $tokens[$stackPtr]['code'] - ) { - if (isset($tokens[$i]['orig_content']) === true) { - $workingString .= $tokens[$i]['orig_content']; - } else { - $workingString .= $tokens[$i]['content']; - } - - $lastStringToken = $i; - $i++; - } - } - - $skipTo = ($lastStringToken + 1); - - // Check if it's a double quoted string. - if ($workingString[0] !== '"' || substr($workingString, -1) !== '"') { - return $skipTo; - } - - // The use of variables in double quoted strings is not allowed. - if ($tokens[$stackPtr]['code'] === T_DOUBLE_QUOTED_STRING) { - $stringTokens = token_get_all('addError($error, $stackPtr, 'ContainsVar', $data); - } - } - - return $skipTo; - }//end if - - $allowedChars = [ - '\0', - '\1', - '\2', - '\3', - '\4', - '\5', - '\6', - '\7', - '\n', - '\r', - '\f', - '\t', - '\v', - '\x', - '\b', - '\e', - '\u', - '\'', - ]; - - foreach ($allowedChars as $testChar) { - if (strpos($workingString, $testChar) !== false) { - return $skipTo; - } - } - - $error = 'String %s does not require double quotes; use single quotes instead'; - $data = [str_replace(["\r", "\n"], ['\r', '\n'], $workingString)]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NotRequired', $data); - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $innerContent = substr($workingString, 1, -1); - $innerContent = str_replace('\"', '"', $innerContent); - $innerContent = str_replace('\\$', '$', $innerContent); - $phpcsFile->fixer->replaceToken($stackPtr, "'$innerContent'"); - while ($lastStringToken !== $stackPtr) { - $phpcsFile->fixer->replaceToken($lastStringToken, ''); - $lastStringToken--; - } - - $phpcsFile->fixer->endChangeset(); - } - - return $skipTo; - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Strings/EchoedStringsSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Strings/EchoedStringsSniff.php deleted file mode 100644 index 512d878..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Strings/EchoedStringsSniff.php +++ /dev/null @@ -1,88 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Strings; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class EchoedStringsSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_ECHO]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $firstContent = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - // If the first non-whitespace token is not an opening parenthesis, then we are not concerned. - if ($tokens[$firstContent]['code'] !== T_OPEN_PARENTHESIS) { - $phpcsFile->recordMetric($stackPtr, 'Brackets around echoed strings', 'no'); - return; - } - - $end = $phpcsFile->findNext([T_SEMICOLON, T_CLOSE_TAG], $stackPtr, null, false); - - // If the token before the semi-colon is not a closing parenthesis, then we are not concerned. - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($end - 1), null, true); - if ($tokens[$prev]['code'] !== T_CLOSE_PARENTHESIS) { - $phpcsFile->recordMetric($stackPtr, 'Brackets around echoed strings', 'no'); - return; - } - - // If the parenthesis don't match, then we are not concerned. - if ($tokens[$firstContent]['parenthesis_closer'] !== $prev) { - $phpcsFile->recordMetric($stackPtr, 'Brackets around echoed strings', 'no'); - return; - } - - $phpcsFile->recordMetric($stackPtr, 'Brackets around echoed strings', 'yes'); - - if (($phpcsFile->findNext(Tokens::$operators, $stackPtr, $end, false)) === false) { - // There are no arithmetic operators in this. - $error = 'Echoed strings should not be bracketed'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'HasBracket'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($firstContent, ''); - if ($tokens[($firstContent - 1)]['code'] !== T_WHITESPACE) { - $phpcsFile->fixer->addContent(($firstContent - 1), ' '); - } - - $phpcsFile->fixer->replaceToken($prev, ''); - $phpcsFile->fixer->endChangeset(); - } - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/CastSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/CastSpacingSniff.php deleted file mode 100644 index 95f95ed..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/CastSpacingSniff.php +++ /dev/null @@ -1,65 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class CastSpacingSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return Tokens::$castTokens; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $content = $tokens[$stackPtr]['content']; - $expected = str_replace(' ', '', $content); - $expected = str_replace("\t", '', $expected); - - if ($content !== $expected) { - $error = 'Cast statements must not contain whitespace; expected "%s" but found "%s"'; - $data = [ - $expected, - $content, - ]; - - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'ContainsWhiteSpace', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($stackPtr, $expected); - } - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php deleted file mode 100644 index f38fd0e..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php +++ /dev/null @@ -1,358 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class ControlStructureSpacingSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_IF, - T_WHILE, - T_FOREACH, - T_FOR, - T_SWITCH, - T_DO, - T_ELSE, - T_ELSEIF, - T_TRY, - T_CATCH, - T_FINALLY, - T_MATCH, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]['parenthesis_opener']) === true - && isset($tokens[$stackPtr]['parenthesis_closer']) === true - ) { - $parenOpener = $tokens[$stackPtr]['parenthesis_opener']; - $parenCloser = $tokens[$stackPtr]['parenthesis_closer']; - if ($tokens[($parenOpener + 1)]['code'] === T_WHITESPACE) { - $gap = $tokens[($parenOpener + 1)]['length']; - - if ($gap === 0) { - $phpcsFile->recordMetric($stackPtr, 'Spaces after control structure open parenthesis', 'newline'); - $gap = 'newline'; - } else { - $phpcsFile->recordMetric($stackPtr, 'Spaces after control structure open parenthesis', $gap); - } - - $error = 'Expected 0 spaces after opening bracket; %s found'; - $data = [$gap]; - $fix = $phpcsFile->addFixableError($error, ($parenOpener + 1), 'SpacingAfterOpenBrace', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($parenOpener + 1), ''); - } - } else { - $phpcsFile->recordMetric($stackPtr, 'Spaces after control structure open parenthesis', 0); - } - - if ($tokens[$parenOpener]['line'] === $tokens[$parenCloser]['line'] - && $tokens[($parenCloser - 1)]['code'] === T_WHITESPACE - ) { - $gap = $tokens[($parenCloser - 1)]['length']; - $error = 'Expected 0 spaces before closing bracket; %s found'; - $data = [$gap]; - $fix = $phpcsFile->addFixableError($error, ($parenCloser - 1), 'SpaceBeforeCloseBrace', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($parenCloser - 1), ''); - } - - if ($gap === 0) { - $phpcsFile->recordMetric($stackPtr, 'Spaces before control structure close parenthesis', 'newline'); - } else { - $phpcsFile->recordMetric($stackPtr, 'Spaces before control structure close parenthesis', $gap); - } - } else { - $phpcsFile->recordMetric($stackPtr, 'Spaces before control structure close parenthesis', 0); - } - }//end if - - if (isset($tokens[$stackPtr]['scope_closer']) === false) { - return; - } - - $scopeOpener = $tokens[$stackPtr]['scope_opener']; - $scopeCloser = $tokens[$stackPtr]['scope_closer']; - - for ($firstContent = ($scopeOpener + 1); $firstContent < $phpcsFile->numTokens; $firstContent++) { - $code = $tokens[$firstContent]['code']; - - if ($code === T_WHITESPACE - || ($code === T_INLINE_HTML - && trim($tokens[$firstContent]['content']) === '') - ) { - continue; - } - - // Skip all empty tokens on the same line as the opener. - if ($tokens[$firstContent]['line'] === $tokens[$scopeOpener]['line'] - && (isset(Tokens::$emptyTokens[$code]) === true - || $code === T_CLOSE_TAG) - ) { - continue; - } - - break; - } - - // We ignore spacing for some structures that tend to have their own rules. - $ignore = [ - T_FUNCTION => true, - T_CLASS => true, - T_INTERFACE => true, - T_TRAIT => true, - T_DOC_COMMENT_OPEN_TAG => true, - ]; - - if (isset($ignore[$tokens[$firstContent]['code']]) === false - && $tokens[$firstContent]['line'] >= ($tokens[$scopeOpener]['line'] + 2) - ) { - $gap = ($tokens[$firstContent]['line'] - $tokens[$scopeOpener]['line'] - 1); - $phpcsFile->recordMetric($stackPtr, 'Blank lines at start of control structure', $gap); - - $error = 'Blank line found at start of control structure'; - $fix = $phpcsFile->addFixableError($error, $scopeOpener, 'SpacingAfterOpen'); - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $i = ($scopeOpener + 1); - while ($tokens[$i]['line'] !== $tokens[$firstContent]['line']) { - // Start removing content from the line after the opener. - if ($tokens[$i]['line'] !== $tokens[$scopeOpener]['line']) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $i++; - } - - $phpcsFile->fixer->endChangeset(); - } - } else { - $phpcsFile->recordMetric($stackPtr, 'Blank lines at start of control structure', 0); - }//end if - - if ($firstContent !== $scopeCloser) { - $lastContent = $phpcsFile->findPrevious( - T_WHITESPACE, - ($scopeCloser - 1), - null, - true - ); - - $lastNonEmptyContent = $phpcsFile->findPrevious( - Tokens::$emptyTokens, - ($scopeCloser - 1), - null, - true - ); - - $checkToken = $lastContent; - if (isset($tokens[$lastNonEmptyContent]['scope_condition']) === true) { - $checkToken = $tokens[$lastNonEmptyContent]['scope_condition']; - } - - if (isset($ignore[$tokens[$checkToken]['code']]) === false - && $tokens[$lastContent]['line'] <= ($tokens[$scopeCloser]['line'] - 2) - ) { - $errorToken = $scopeCloser; - for ($i = ($scopeCloser - 1); $i > $lastContent; $i--) { - if ($tokens[$i]['line'] < $tokens[$scopeCloser]['line']) { - $errorToken = $i; - break; - } - } - - $gap = ($tokens[$scopeCloser]['line'] - $tokens[$lastContent]['line'] - 1); - $phpcsFile->recordMetric($stackPtr, 'Blank lines at end of control structure', $gap); - - $error = 'Blank line found at end of control structure'; - $fix = $phpcsFile->addFixableError($error, $errorToken, 'SpacingBeforeClose'); - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($scopeCloser - 1); $i > $lastContent; $i--) { - if ($tokens[$i]['line'] === $tokens[$scopeCloser]['line']) { - continue; - } - - if ($tokens[$i]['line'] === $tokens[$lastContent]['line']) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } else { - $phpcsFile->recordMetric($stackPtr, 'Blank lines at end of control structure', 0); - }//end if - }//end if - - if ($tokens[$stackPtr]['code'] === T_MATCH) { - // Move the scope closer to the semicolon/comma. - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($scopeCloser + 1), null, true); - if ($next !== false - && ($tokens[$next]['code'] === T_SEMICOLON || $tokens[$next]['code'] === T_COMMA) - ) { - $scopeCloser = $next; - } - } - - $trailingContent = $phpcsFile->findNext( - T_WHITESPACE, - ($scopeCloser + 1), - null, - true - ); - - if ($tokens[$trailingContent]['code'] === T_COMMENT - || isset(Tokens::$phpcsCommentTokens[$tokens[$trailingContent]['code']]) === true - ) { - // Special exception for code where the comment about - // an ELSE or ELSEIF is written between the control structures. - $nextCode = $phpcsFile->findNext( - Tokens::$emptyTokens, - ($scopeCloser + 1), - null, - true - ); - - if ($tokens[$nextCode]['code'] === T_ELSE - || $tokens[$nextCode]['code'] === T_ELSEIF - || $tokens[$trailingContent]['line'] === $tokens[$scopeCloser]['line'] - ) { - $trailingContent = $nextCode; - } - }//end if - - if ($tokens[$trailingContent]['code'] === T_ELSE) { - if ($tokens[$stackPtr]['code'] === T_IF) { - // IF with ELSE. - return; - } - } - - if ($tokens[$trailingContent]['code'] === T_WHILE - && $tokens[$stackPtr]['code'] === T_DO - ) { - // DO with WHILE. - return; - } - - if ($tokens[$trailingContent]['code'] === T_CLOSE_TAG) { - // At the end of the script or embedded code. - return; - } - - if (isset($tokens[$trailingContent]['scope_condition']) === true - && $tokens[$trailingContent]['scope_condition'] !== $trailingContent - && isset($tokens[$trailingContent]['scope_opener']) === true - && $tokens[$trailingContent]['scope_opener'] !== $trailingContent - ) { - // Another control structure's closing brace. - $owner = $tokens[$trailingContent]['scope_condition']; - if ($tokens[$owner]['code'] === T_FUNCTION) { - // The next content is the closing brace of a function - // so normal function rules apply and we can ignore it. - return; - } - - if ($tokens[$owner]['code'] === T_CLOSURE - && ($phpcsFile->hasCondition($stackPtr, [T_FUNCTION, T_CLOSURE]) === true - || isset($tokens[$stackPtr]['nested_parenthesis']) === true) - ) { - return; - } - - if ($tokens[$trailingContent]['line'] !== ($tokens[$scopeCloser]['line'] + 1)) { - $error = 'Blank line found after control structure'; - $fix = $phpcsFile->addFixableError($error, $scopeCloser, 'LineAfterClose'); - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $i = ($scopeCloser + 1); - while ($tokens[$i]['line'] !== $tokens[$trailingContent]['line']) { - $phpcsFile->fixer->replaceToken($i, ''); - $i++; - } - - $phpcsFile->fixer->addNewline($scopeCloser); - $phpcsFile->fixer->endChangeset(); - } - } - } else if ($tokens[$trailingContent]['code'] !== T_ELSE - && $tokens[$trailingContent]['code'] !== T_ELSEIF - && $tokens[$trailingContent]['code'] !== T_CATCH - && $tokens[$trailingContent]['code'] !== T_FINALLY - && $tokens[$trailingContent]['line'] === ($tokens[$scopeCloser]['line'] + 1) - ) { - $error = 'No blank line found after control structure'; - $fix = $phpcsFile->addFixableError($error, $scopeCloser, 'NoLineAfterClose'); - if ($fix === true) { - $trailingContent = $phpcsFile->findNext( - T_WHITESPACE, - ($scopeCloser + 1), - null, - true - ); - - if (($tokens[$trailingContent]['code'] === T_COMMENT - || isset(Tokens::$phpcsCommentTokens[$tokens[$trailingContent]['code']]) === true) - && $tokens[$trailingContent]['line'] === $tokens[$scopeCloser]['line'] - ) { - $phpcsFile->fixer->addNewline($trailingContent); - } else { - $phpcsFile->fixer->addNewline($scopeCloser); - } - } - }//end if - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionClosingBraceSpaceSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionClosingBraceSpaceSniff.php deleted file mode 100644 index 6887199..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionClosingBraceSpaceSniff.php +++ /dev/null @@ -1,164 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class FunctionClosingBraceSpaceSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_FUNCTION, - T_CLOSURE, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]['scope_closer']) === false) { - // Probably an interface method. - return; - } - - $closeBrace = $tokens[$stackPtr]['scope_closer']; - $prevContent = $phpcsFile->findPrevious(T_WHITESPACE, ($closeBrace - 1), null, true); - - // Special case for empty JS functions. - if ($phpcsFile->tokenizerType === 'JS' && $prevContent === $tokens[$stackPtr]['scope_opener']) { - // In this case, the opening and closing brace must be - // right next to each other. - if ($tokens[$stackPtr]['scope_closer'] !== ($tokens[$stackPtr]['scope_opener'] + 1)) { - $error = 'The opening and closing braces of empty functions must be directly next to each other; e.g., function () {}'; - $fix = $phpcsFile->addFixableError($error, $closeBrace, 'SpacingBetween'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($tokens[$stackPtr]['scope_opener'] + 1); $i < $closeBrace; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } - - return; - } - - $nestedFunction = false; - if ($phpcsFile->hasCondition($stackPtr, [T_FUNCTION, T_CLOSURE]) === true - || isset($tokens[$stackPtr]['nested_parenthesis']) === true - ) { - $nestedFunction = true; - } - - $braceLine = $tokens[$closeBrace]['line']; - $prevLine = $tokens[$prevContent]['line']; - $found = ($braceLine - $prevLine - 1); - - if ($nestedFunction === true) { - if ($found < 0) { - $error = 'Closing brace of nested function must be on a new line'; - $fix = $phpcsFile->addFixableError($error, $closeBrace, 'ContentBeforeClose'); - if ($fix === true) { - $phpcsFile->fixer->addNewlineBefore($closeBrace); - } - } else if ($found > 0) { - $error = 'Expected 0 blank lines before closing brace of nested function; %s found'; - $data = [$found]; - $fix = $phpcsFile->addFixableError($error, $closeBrace, 'SpacingBeforeNestedClose', $data); - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $changeMade = false; - for ($i = ($prevContent + 1); $i < $closeBrace; $i++) { - // Try and maintain indentation. - if ($tokens[$i]['line'] === ($braceLine - 1)) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - $changeMade = true; - } - - // Special case for when the last content contains the newline - // token as well, like with a comment. - if ($changeMade === false) { - $phpcsFile->fixer->replaceToken(($prevContent + 1), ''); - } - - $phpcsFile->fixer->endChangeset(); - }//end if - }//end if - } else { - if ($found !== 1) { - if ($found < 0) { - $found = 0; - } - - $error = 'Expected 1 blank line before closing function brace; %s found'; - $data = [$found]; - $fix = $phpcsFile->addFixableError($error, $closeBrace, 'SpacingBeforeClose', $data); - - if ($fix === true) { - if ($found > 1) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($prevContent + 1); $i < ($closeBrace - 1); $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->replaceToken($i, $phpcsFile->eolChar); - $phpcsFile->fixer->endChangeset(); - } else { - // Try and maintain indentation. - if ($tokens[($closeBrace - 1)]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->addNewlineBefore($closeBrace - 1); - } else { - $phpcsFile->fixer->addNewlineBefore($closeBrace); - } - } - } - }//end if - }//end if - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionOpeningBraceSpaceSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionOpeningBraceSpaceSniff.php deleted file mode 100644 index 09c5a48..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionOpeningBraceSpaceSniff.php +++ /dev/null @@ -1,98 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class FunctionOpeningBraceSpaceSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_FUNCTION, - T_CLOSURE, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]['scope_opener']) === false) { - // Probably an interface or abstract method. - return; - } - - $openBrace = $tokens[$stackPtr]['scope_opener']; - $nextContent = $phpcsFile->findNext(T_WHITESPACE, ($openBrace + 1), null, true); - - if ($nextContent === $tokens[$stackPtr]['scope_closer']) { - // The next bit of content is the closing brace, so this - // is an empty function and should have a blank line - // between the opening and closing braces. - return; - } - - $braceLine = $tokens[$openBrace]['line']; - $nextLine = $tokens[$nextContent]['line']; - - $found = ($nextLine - $braceLine - 1); - if ($found > 0) { - $error = 'Expected 0 blank lines after opening function brace; %s found'; - $data = [$found]; - $fix = $phpcsFile->addFixableError($error, $openBrace, 'SpacingAfter', $data); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($openBrace + 1); $i < $nextContent; $i++) { - if ($tokens[$i]['line'] === $nextLine) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->addNewline($openBrace); - $phpcsFile->fixer->endChangeset(); - } - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionSpacingSniff.php deleted file mode 100644 index 1f4704b..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionSpacingSniff.php +++ /dev/null @@ -1,367 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class FunctionSpacingSniff implements Sniff -{ - - /** - * The number of blank lines between functions. - * - * @var integer - */ - public $spacing = 2; - - /** - * The number of blank lines before the first function in a class. - * - * @var integer - */ - public $spacingBeforeFirst = 2; - - /** - * The number of blank lines after the last function in a class. - * - * @var integer - */ - public $spacingAfterLast = 2; - - /** - * Original properties as set in a custom ruleset (if any). - * - * @var array|null - */ - private $rulesetProperties = null; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_FUNCTION]; - - }//end register() - - - /** - * Processes this sniff when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $previousNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if ($previousNonEmpty !== false - && $tokens[$previousNonEmpty]['code'] === T_OPEN_TAG - && $tokens[$previousNonEmpty]['line'] !== 1 - ) { - // Ignore functions at the start of an embedded PHP block. - return; - } - - // If the ruleset has only overridden the spacing property, use - // that value for all spacing rules. - if ($this->rulesetProperties === null) { - $this->rulesetProperties = []; - if (isset($phpcsFile->ruleset->ruleset['Squiz.WhiteSpace.FunctionSpacing']) === true - && isset($phpcsFile->ruleset->ruleset['Squiz.WhiteSpace.FunctionSpacing']['properties']) === true - ) { - $this->rulesetProperties = $phpcsFile->ruleset->ruleset['Squiz.WhiteSpace.FunctionSpacing']['properties']; - if (isset($this->rulesetProperties['spacing']) === true) { - if (isset($this->rulesetProperties['spacingBeforeFirst']) === false) { - $this->spacingBeforeFirst = $this->spacing; - } - - if (isset($this->rulesetProperties['spacingAfterLast']) === false) { - $this->spacingAfterLast = $this->spacing; - } - } - } - } - - $this->spacing = (int) $this->spacing; - $this->spacingBeforeFirst = (int) $this->spacingBeforeFirst; - $this->spacingAfterLast = (int) $this->spacingAfterLast; - - if (isset($tokens[$stackPtr]['scope_closer']) === false) { - // Must be an interface method, so the closer is the semicolon. - $closer = $phpcsFile->findNext(T_SEMICOLON, $stackPtr); - } else { - $closer = $tokens[$stackPtr]['scope_closer']; - } - - $isFirst = false; - $isLast = false; - - $ignore = ([T_WHITESPACE => T_WHITESPACE] + Tokens::$methodPrefixes); - - $prev = $phpcsFile->findPrevious($ignore, ($stackPtr - 1), null, true); - - while ($tokens[$prev]['code'] === T_ATTRIBUTE_END) { - // Skip past function attributes. - $prev = $phpcsFile->findPrevious($ignore, ($tokens[$prev]['attribute_opener'] - 1), null, true); - } - - if ($tokens[$prev]['code'] === T_DOC_COMMENT_CLOSE_TAG) { - // Skip past function docblocks. - $prev = $phpcsFile->findPrevious($ignore, ($tokens[$prev]['comment_opener'] - 1), null, true); - } - - if ($tokens[$prev]['code'] === T_OPEN_CURLY_BRACKET) { - $isFirst = true; - } - - $next = $phpcsFile->findNext($ignore, ($closer + 1), null, true); - if (isset(Tokens::$emptyTokens[$tokens[$next]['code']]) === true - && $tokens[$next]['line'] === $tokens[$closer]['line'] - ) { - // Skip past "end" comments. - $next = $phpcsFile->findNext($ignore, ($next + 1), null, true); - } - - if ($tokens[$next]['code'] === T_CLOSE_CURLY_BRACKET) { - $isLast = true; - } - - /* - Check the number of blank lines - after the function. - */ - - // Allow for comments on the same line as the closer. - for ($nextLineToken = ($closer + 1); $nextLineToken < $phpcsFile->numTokens; $nextLineToken++) { - if ($tokens[$nextLineToken]['line'] !== $tokens[$closer]['line']) { - break; - } - } - - $requiredSpacing = $this->spacing; - $errorCode = 'After'; - if ($isLast === true) { - $requiredSpacing = $this->spacingAfterLast; - $errorCode = 'AfterLast'; - } - - $foundLines = 0; - if ($nextLineToken === ($phpcsFile->numTokens - 1)) { - // We are at the end of the file. - // Don't check spacing after the function because this - // should be done by an EOF sniff. - $foundLines = $requiredSpacing; - } else { - $nextContent = $phpcsFile->findNext(T_WHITESPACE, $nextLineToken, null, true); - if ($nextContent === false) { - // We are at the end of the file. - // Don't check spacing after the function because this - // should be done by an EOF sniff. - $foundLines = $requiredSpacing; - } else { - $foundLines = ($tokens[$nextContent]['line'] - $tokens[$nextLineToken]['line']); - } - } - - if ($isLast === true) { - $phpcsFile->recordMetric($stackPtr, 'Function spacing after last', $foundLines); - } else { - $phpcsFile->recordMetric($stackPtr, 'Function spacing after', $foundLines); - } - - if ($foundLines !== $requiredSpacing) { - $error = 'Expected %s blank line'; - if ($requiredSpacing !== 1) { - $error .= 's'; - } - - $error .= ' after function; %s found'; - $data = [ - $requiredSpacing, - $foundLines, - ]; - - $fix = $phpcsFile->addFixableError($error, $closer, $errorCode, $data); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = $nextLineToken; $i <= $nextContent; $i++) { - if ($tokens[$i]['line'] === $tokens[$nextContent]['line']) { - $phpcsFile->fixer->addContentBefore($i, str_repeat($phpcsFile->eolChar, $requiredSpacing)); - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - }//end if - }//end if - - /* - Check the number of blank lines - before the function. - */ - - $prevLineToken = null; - for ($i = $stackPtr; $i >= 0; $i--) { - if ($tokens[$i]['line'] === $tokens[$stackPtr]['line']) { - continue; - } - - $prevLineToken = $i; - break; - } - - if ($prevLineToken === null) { - // Never found the previous line, which means - // there are 0 blank lines before the function. - $foundLines = 0; - $prevContent = 0; - $prevLineToken = 0; - } else { - $currentLine = $tokens[$stackPtr]['line']; - - $prevContent = $phpcsFile->findPrevious(T_WHITESPACE, $prevLineToken, null, true); - - if ($tokens[$prevContent]['code'] === T_COMMENT - || isset(Tokens::$phpcsCommentTokens[$tokens[$prevContent]['code']]) === true - ) { - // Ignore comments as they can have different spacing rules, and this - // isn't a proper function comment anyway. - return; - } - - while ($tokens[$prevContent]['code'] === T_ATTRIBUTE_END - && $tokens[$prevContent]['line'] === ($currentLine - 1) - ) { - // Account for function attributes. - $currentLine = $tokens[$tokens[$prevContent]['attribute_opener']]['line']; - $prevContent = $phpcsFile->findPrevious(T_WHITESPACE, ($tokens[$prevContent]['attribute_opener'] - 1), null, true); - } - - if ($tokens[$prevContent]['code'] === T_DOC_COMMENT_CLOSE_TAG - && $tokens[$prevContent]['line'] === ($currentLine - 1) - ) { - // Account for function comments. - $prevContent = $phpcsFile->findPrevious(T_WHITESPACE, ($tokens[$prevContent]['comment_opener'] - 1), null, true); - } - - $prevLineToken = $prevContent; - - // Before we throw an error, check that we are not throwing an error - // for another function. We don't want to error for no blank lines after - // the previous function and no blank lines before this one as well. - $prevLine = ($tokens[$prevContent]['line'] - 1); - $i = ($stackPtr - 1); - $foundLines = 0; - - $stopAt = 0; - if (isset($tokens[$stackPtr]['conditions']) === true) { - $conditions = $tokens[$stackPtr]['conditions']; - $conditions = array_keys($conditions); - $stopAt = array_pop($conditions); - } - - while ($currentLine !== $prevLine && $currentLine > 1 && $i > $stopAt) { - if ($tokens[$i]['code'] === T_FUNCTION) { - // Found another interface or abstract function. - return; - } - - if ($tokens[$i]['code'] === T_CLOSE_CURLY_BRACKET - && $tokens[$tokens[$i]['scope_condition']]['code'] === T_FUNCTION - ) { - // Found a previous function. - return; - } - - $currentLine = $tokens[$i]['line']; - if ($currentLine === $prevLine) { - break; - } - - if ($tokens[($i - 1)]['line'] < $currentLine && $tokens[($i + 1)]['line'] > $currentLine) { - // This token is on a line by itself. If it is whitespace, the line is empty. - if ($tokens[$i]['code'] === T_WHITESPACE) { - $foundLines++; - } - } - - $i--; - }//end while - }//end if - - $requiredSpacing = $this->spacing; - $errorCode = 'Before'; - if ($isFirst === true) { - $requiredSpacing = $this->spacingBeforeFirst; - $errorCode = 'BeforeFirst'; - - $phpcsFile->recordMetric($stackPtr, 'Function spacing before first', $foundLines); - } else { - $phpcsFile->recordMetric($stackPtr, 'Function spacing before', $foundLines); - } - - if ($foundLines !== $requiredSpacing) { - $error = 'Expected %s blank line'; - if ($requiredSpacing !== 1) { - $error .= 's'; - } - - $error .= ' before function; %s found'; - $data = [ - $requiredSpacing, - $foundLines, - ]; - - $fix = $phpcsFile->addFixableError($error, $stackPtr, $errorCode, $data); - if ($fix === true) { - $nextSpace = $phpcsFile->findNext(T_WHITESPACE, ($prevContent + 1), $stackPtr); - if ($nextSpace === false) { - $nextSpace = ($stackPtr - 1); - } - - if ($foundLines < $requiredSpacing) { - $padding = str_repeat($phpcsFile->eolChar, ($requiredSpacing - $foundLines)); - $phpcsFile->fixer->addContent($prevLineToken, $padding); - } else { - $nextContent = $phpcsFile->findNext(T_WHITESPACE, ($nextSpace + 1), null, true); - $phpcsFile->fixer->beginChangeset(); - for ($i = $nextSpace; $i < $nextContent; $i++) { - if ($tokens[$i]['line'] === $tokens[$prevContent]['line']) { - continue; - } - - if ($tokens[$i]['line'] === $tokens[$nextContent]['line']) { - $phpcsFile->fixer->addContentBefore($i, str_repeat($phpcsFile->eolChar, $requiredSpacing)); - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - }//end if - }//end if - }//end if - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/LanguageConstructSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/LanguageConstructSpacingSniff.php deleted file mode 100644 index c1492bf..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/LanguageConstructSpacingSniff.php +++ /dev/null @@ -1,89 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util; - -class LanguageConstructSpacingSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_ECHO, - T_PRINT, - T_RETURN, - T_INCLUDE, - T_INCLUDE_ONCE, - T_REQUIRE, - T_REQUIRE_ONCE, - T_NEW, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[($stackPtr + 1)]) === false) { - // Skip if there is no next token. - return; - } - - if ($tokens[($stackPtr + 1)]['code'] === T_SEMICOLON) { - // No content for this language construct. - return; - } - - if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE) { - $content = $tokens[($stackPtr + 1)]['content']; - if ($content !== ' ') { - $error = 'Language constructs must be followed by a single space; expected 1 space but found "%s"'; - $data = [Util\Common::prepareForOutput($content)]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'IncorrectSingle', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($stackPtr + 1), ' '); - } - } - } else if ($tokens[($stackPtr + 1)]['code'] !== T_OPEN_PARENTHESIS) { - $error = 'Language constructs must be followed by a single space; expected "%s" but found "%s"'; - $data = [ - $tokens[$stackPtr]['content'].' '.$tokens[($stackPtr + 1)]['content'], - $tokens[$stackPtr]['content'].$tokens[($stackPtr + 1)]['content'], - ]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Incorrect', $data); - if ($fix === true) { - $phpcsFile->fixer->addContent($stackPtr, ' '); - } - }//end if - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/LogicalOperatorSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/LogicalOperatorSpacingSniff.php deleted file mode 100644 index a89a02a..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/LogicalOperatorSpacingSniff.php +++ /dev/null @@ -1,102 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class LogicalOperatorSpacingSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return Tokens::$booleanOperators; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being checked. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Check there is one space before the operator. - if ($tokens[($stackPtr - 1)]['code'] !== T_WHITESPACE) { - $error = 'Expected 1 space before logical operator; 0 found'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceBefore'); - if ($fix === true) { - $phpcsFile->fixer->addContentBefore($stackPtr, ' '); - } - } else { - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); - if ($tokens[$stackPtr]['line'] === $tokens[$prev]['line'] - && $tokens[($stackPtr - 1)]['length'] !== 1 - ) { - $found = $tokens[($stackPtr - 1)]['length']; - $error = 'Expected 1 space before logical operator; %s found'; - $data = [$found]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'TooMuchSpaceBefore', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($stackPtr - 1), ' '); - } - } - } - - // Check there is one space after the operator. - if ($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { - $error = 'Expected 1 space after logical operator; 0 found'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceAfter'); - if ($fix === true) { - $phpcsFile->fixer->addContent($stackPtr, ' '); - } - } else { - $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($tokens[$stackPtr]['line'] === $tokens[$next]['line'] - && $tokens[($stackPtr + 1)]['length'] !== 1 - ) { - $found = $tokens[($stackPtr + 1)]['length']; - $error = 'Expected 1 space after logical operator; %s found'; - $data = [$found]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'TooMuchSpaceAfter', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($stackPtr + 1), ' '); - } - } - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/MemberVarSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/MemberVarSpacingSniff.php deleted file mode 100644 index 0ece1ac..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/MemberVarSpacingSniff.php +++ /dev/null @@ -1,254 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\AbstractVariableSniff; -use PHP_CodeSniffer\Util\Tokens; - -class MemberVarSpacingSniff extends AbstractVariableSniff -{ - - /** - * The number of blank lines between member vars. - * - * @var integer - */ - public $spacing = 1; - - /** - * The number of blank lines before the first member var. - * - * @var integer - */ - public $spacingBeforeFirst = 1; - - - /** - * Processes the function tokens within the class. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position where the token was found. - * - * @return void|int Optionally returns a stack pointer. The sniff will not be - * called again on the current file until the returned stack - * pointer is reached. - */ - protected function processMemberVar(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $validPrefixes = Tokens::$methodPrefixes; - $validPrefixes[] = T_VAR; - - $startOfStatement = $phpcsFile->findPrevious($validPrefixes, ($stackPtr - 1), null, false, null, true); - if ($startOfStatement === false) { - return; - } - - $endOfStatement = $phpcsFile->findNext(T_SEMICOLON, ($stackPtr + 1), null, false, null, true); - - $ignore = $validPrefixes; - $ignore[T_WHITESPACE] = T_WHITESPACE; - - $start = $startOfStatement; - for ($prev = ($startOfStatement - 1); $prev >= 0; $prev--) { - if (isset($ignore[$tokens[$prev]['code']]) === true) { - continue; - } - - if ($tokens[$prev]['code'] === T_ATTRIBUTE_END - && isset($tokens[$prev]['attribute_opener']) === true - ) { - $prev = $tokens[$prev]['attribute_opener']; - $start = $prev; - continue; - } - - break; - } - - if (isset(Tokens::$commentTokens[$tokens[$prev]['code']]) === true) { - // Assume the comment belongs to the member var if it is on a line by itself. - $prevContent = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prev - 1), null, true); - if ($tokens[$prevContent]['line'] !== $tokens[$prev]['line']) { - // Check the spacing, but then skip it. - $foundLines = ($tokens[$startOfStatement]['line'] - $tokens[$prev]['line'] - 1); - if ($foundLines > 0) { - for ($i = ($prev + 1); $i < $startOfStatement; $i++) { - if ($tokens[$i]['column'] !== 1) { - continue; - } - - if ($tokens[$i]['code'] === T_WHITESPACE - && $tokens[$i]['line'] !== $tokens[($i + 1)]['line'] - ) { - $error = 'Expected 0 blank lines after member var comment; %s found'; - $data = [$foundLines]; - $fix = $phpcsFile->addFixableError($error, $prev, 'AfterComment', $data); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - // Inline comments have the newline included in the content but - // docblocks do not. - if ($tokens[$prev]['code'] === T_COMMENT) { - $phpcsFile->fixer->replaceToken($prev, rtrim($tokens[$prev]['content'])); - } - - for ($i = ($prev + 1); $i <= $startOfStatement; $i++) { - if ($tokens[$i]['line'] === $tokens[$startOfStatement]['line']) { - break; - } - - // Remove the newline after the docblock, and any entirely - // empty lines before the member var. - if ($tokens[$i]['code'] === T_WHITESPACE - && $tokens[$i]['line'] === $tokens[$prev]['line'] - || ($tokens[$i]['column'] === 1 - && $tokens[$i]['line'] !== $tokens[($i + 1)]['line']) - ) { - $phpcsFile->fixer->replaceToken($i, ''); - } - } - - $phpcsFile->fixer->addNewline($prev); - $phpcsFile->fixer->endChangeset(); - }//end if - - break; - }//end if - }//end for - }//end if - - $start = $prev; - }//end if - }//end if - - // There needs to be n blank lines before the var, not counting comments. - if ($start === $startOfStatement) { - // No comment found. - $first = $phpcsFile->findFirstOnLine(Tokens::$emptyTokens, $start, true); - if ($first === false) { - $first = $start; - } - } else if ($tokens[$start]['code'] === T_DOC_COMMENT_CLOSE_TAG) { - $first = $tokens[$start]['comment_opener']; - } else { - $first = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($start - 1), null, true); - $first = $phpcsFile->findNext(array_merge(Tokens::$commentTokens, [T_ATTRIBUTE]), ($first + 1)); - } - - // Determine if this is the first member var. - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($first - 1), null, true); - if ($tokens[$prev]['code'] === T_CLOSE_CURLY_BRACKET - && isset($tokens[$prev]['scope_condition']) === true - && $tokens[$tokens[$prev]['scope_condition']]['code'] === T_FUNCTION - ) { - return; - } - - if ($tokens[$prev]['code'] === T_OPEN_CURLY_BRACKET - && isset(Tokens::$ooScopeTokens[$tokens[$tokens[$prev]['scope_condition']]['code']]) === true - ) { - $errorMsg = 'Expected %s blank line(s) before first member var; %s found'; - $errorCode = 'FirstIncorrect'; - $spacing = (int) $this->spacingBeforeFirst; - } else { - $errorMsg = 'Expected %s blank line(s) before member var; %s found'; - $errorCode = 'Incorrect'; - $spacing = (int) $this->spacing; - } - - $foundLines = ($tokens[$first]['line'] - $tokens[$prev]['line'] - 1); - - if ($errorCode === 'FirstIncorrect') { - $phpcsFile->recordMetric($stackPtr, 'Member var spacing before first', $foundLines); - } else { - $phpcsFile->recordMetric($stackPtr, 'Member var spacing before', $foundLines); - } - - if ($foundLines === $spacing) { - if ($endOfStatement !== false) { - return $endOfStatement; - } - - return; - } - - $data = [ - $spacing, - $foundLines, - ]; - - $fix = $phpcsFile->addFixableError($errorMsg, $startOfStatement, $errorCode, $data); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($prev + 1); $i < $first; $i++) { - if ($tokens[$i]['line'] === $tokens[$prev]['line']) { - continue; - } - - if ($tokens[$i]['line'] === $tokens[$first]['line']) { - for ($x = 1; $x <= $spacing; $x++) { - $phpcsFile->fixer->addNewlineBefore($i); - } - - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - }//end if - - if ($endOfStatement !== false) { - return $endOfStatement; - } - - return; - - }//end processMemberVar() - - - /** - * Processes normal variables. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position where the token was found. - * - * @return void - */ - protected function processVariable(File $phpcsFile, $stackPtr) - { - /* - We don't care about normal variables. - */ - - }//end processVariable() - - - /** - * Processes variables in double quoted strings. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position where the token was found. - * - * @return void - */ - protected function processVariableInString(File $phpcsFile, $stackPtr) - { - /* - We don't care about normal variables. - */ - - }//end processVariableInString() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php deleted file mode 100644 index cc5db16..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php +++ /dev/null @@ -1,167 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class ObjectOperatorSpacingSniff implements Sniff -{ - - /** - * Allow newlines instead of spaces. - * - * @var boolean - */ - public $ignoreNewlines = false; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_OBJECT_OPERATOR, - T_DOUBLE_COLON, - T_NULLSAFE_OBJECT_OPERATOR, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - if ($tokens[($stackPtr - 1)]['code'] !== T_WHITESPACE) { - $before = 0; - } else { - if ($tokens[($stackPtr - 2)]['line'] !== $tokens[$stackPtr]['line']) { - $before = 'newline'; - } else { - $before = $tokens[($stackPtr - 1)]['length']; - } - } - - $phpcsFile->recordMetric($stackPtr, 'Spacing before object operator', $before); - $this->checkSpacingBeforeOperator($phpcsFile, $stackPtr, $before); - - if (isset($tokens[($stackPtr + 1)]) === false - || isset($tokens[($stackPtr + 2)]) === false - ) { - return; - } - - if ($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { - $after = 0; - } else { - if ($tokens[($stackPtr + 2)]['line'] !== $tokens[$stackPtr]['line']) { - $after = 'newline'; - } else { - $after = $tokens[($stackPtr + 1)]['length']; - } - } - - $phpcsFile->recordMetric($stackPtr, 'Spacing after object operator', $after); - $this->checkSpacingAfterOperator($phpcsFile, $stackPtr, $after); - - }//end process() - - - /** - * Check the spacing before the operator. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * @param mixed $before The number of spaces found before the - * operator or the string 'newline'. - * - * @return boolean true if there was no error, false otherwise. - */ - protected function checkSpacingBeforeOperator(File $phpcsFile, $stackPtr, $before) - { - if ($before !== 0 - && ($before !== 'newline' || $this->ignoreNewlines === false) - ) { - $error = 'Space found before object operator'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Before'); - if ($fix === true) { - $tokens = $phpcsFile->getTokens(); - $curPos = ($stackPtr - 1); - - $phpcsFile->fixer->beginChangeset(); - while ($tokens[$curPos]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->replaceToken($curPos, ''); - --$curPos; - } - - $phpcsFile->fixer->endChangeset(); - } - - return false; - } - - return true; - - }//end checkSpacingBeforeOperator() - - - /** - * Check the spacing after the operator. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * @param mixed $after The number of spaces found after the - * operator or the string 'newline'. - * - * @return boolean true if there was no error, false otherwise. - */ - protected function checkSpacingAfterOperator(File $phpcsFile, $stackPtr, $after) - { - if ($after !== 0 - && ($after !== 'newline' || $this->ignoreNewlines === false) - ) { - $error = 'Space found after object operator'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'After'); - if ($fix === true) { - $tokens = $phpcsFile->getTokens(); - $curPos = ($stackPtr + 1); - - $phpcsFile->fixer->beginChangeset(); - while ($tokens[$curPos]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->replaceToken($curPos, ''); - ++$curPos; - } - - $phpcsFile->fixer->endChangeset(); - } - - return false; - } - - return true; - - }//end checkSpacingAfterOperator() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php deleted file mode 100644 index 2627d10..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php +++ /dev/null @@ -1,381 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class OperatorSpacingSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - /** - * Allow newlines instead of spaces. - * - * @var boolean - */ - public $ignoreNewlines = false; - - /** - * Don't check spacing for assignment operators. - * - * This allows multiple assignment statements to be aligned. - * - * @var boolean - */ - public $ignoreSpacingBeforeAssignments = true; - - /** - * A list of tokens that aren't considered as operands. - * - * @var string[] - */ - private $nonOperandTokens = []; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - /* - First we setup an array of all the tokens that can come before - a T_MINUS or T_PLUS token to indicate that the token is not being - used as an operator. - */ - - // Trying to operate on a negative value; eg. ($var * -1). - $this->nonOperandTokens = Tokens::$operators; - - // Trying to compare a negative value; eg. ($var === -1). - $this->nonOperandTokens += Tokens::$comparisonTokens; - - // Trying to compare a negative value; eg. ($var || -1 === $b). - $this->nonOperandTokens += Tokens::$booleanOperators; - - // Trying to assign a negative value; eg. ($var = -1). - $this->nonOperandTokens += Tokens::$assignmentTokens; - - // Returning/printing a negative value; eg. (return -1). - $this->nonOperandTokens += [ - T_RETURN => T_RETURN, - T_ECHO => T_ECHO, - T_EXIT => T_EXIT, - T_PRINT => T_PRINT, - T_YIELD => T_YIELD, - T_FN_ARROW => T_FN_ARROW, - ]; - - // Trying to use a negative value; eg. myFunction($var, -2). - $this->nonOperandTokens += [ - T_CASE => T_CASE, - T_COLON => T_COLON, - T_COMMA => T_COMMA, - T_INLINE_ELSE => T_INLINE_ELSE, - T_INLINE_THEN => T_INLINE_THEN, - T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET, - T_OPEN_PARENTHESIS => T_OPEN_PARENTHESIS, - T_OPEN_SHORT_ARRAY => T_OPEN_SHORT_ARRAY, - T_OPEN_SQUARE_BRACKET => T_OPEN_SQUARE_BRACKET, - T_STRING_CONCAT => T_STRING_CONCAT, - ]; - - // Casting a negative value; eg. (array) -$a. - $this->nonOperandTokens += Tokens::$castTokens; - - /* - These are the tokens the sniff is looking for. - */ - - $targets = Tokens::$comparisonTokens; - $targets += Tokens::$operators; - $targets += Tokens::$assignmentTokens; - $targets[] = T_INLINE_THEN; - $targets[] = T_INLINE_ELSE; - $targets[] = T_INSTANCEOF; - - return $targets; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being checked. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if ($this->isOperator($phpcsFile, $stackPtr) === false) { - return; - } - - if ($tokens[$stackPtr]['code'] === T_BITWISE_AND) { - // Check there is one space before the & operator. - if ($tokens[($stackPtr - 1)]['code'] !== T_WHITESPACE) { - $error = 'Expected 1 space before "&" operator; 0 found'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceBeforeAmp'); - if ($fix === true) { - $phpcsFile->fixer->addContentBefore($stackPtr, ' '); - } - - $phpcsFile->recordMetric($stackPtr, 'Space before operator', 0); - } else { - if ($tokens[($stackPtr - 2)]['line'] !== $tokens[$stackPtr]['line']) { - $found = 'newline'; - } else { - $found = $tokens[($stackPtr - 1)]['length']; - } - - $phpcsFile->recordMetric($stackPtr, 'Space before operator', $found); - if ($found !== 1 - && ($found !== 'newline' || $this->ignoreNewlines === false) - ) { - $error = 'Expected 1 space before "&" operator; %s found'; - $data = [$found]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingBeforeAmp', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($stackPtr - 1), ' '); - } - } - }//end if - - $hasNext = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($hasNext === false) { - // Live coding/parse error at end of file. - return; - } - - // Check there is one space after the & operator. - if ($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { - $error = 'Expected 1 space after "&" operator; 0 found'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceAfterAmp'); - if ($fix === true) { - $phpcsFile->fixer->addContent($stackPtr, ' '); - } - - $phpcsFile->recordMetric($stackPtr, 'Space after operator', 0); - } else { - if ($tokens[($stackPtr + 2)]['line'] !== $tokens[$stackPtr]['line']) { - $found = 'newline'; - } else { - $found = $tokens[($stackPtr + 1)]['length']; - } - - $phpcsFile->recordMetric($stackPtr, 'Space after operator', $found); - if ($found !== 1 - && ($found !== 'newline' || $this->ignoreNewlines === false) - ) { - $error = 'Expected 1 space after "&" operator; %s found'; - $data = [$found]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingAfterAmp', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($stackPtr + 1), ' '); - } - } - }//end if - - return; - }//end if - - $operator = $tokens[$stackPtr]['content']; - - if ($tokens[($stackPtr - 1)]['code'] !== T_WHITESPACE - && (($tokens[($stackPtr - 1)]['code'] === T_INLINE_THEN - && $tokens[($stackPtr)]['code'] === T_INLINE_ELSE) === false) - ) { - $error = "Expected 1 space before \"$operator\"; 0 found"; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceBefore'); - if ($fix === true) { - $phpcsFile->fixer->addContentBefore($stackPtr, ' '); - } - - $phpcsFile->recordMetric($stackPtr, 'Space before operator', 0); - } else if (isset(Tokens::$assignmentTokens[$tokens[$stackPtr]['code']]) === false - || $this->ignoreSpacingBeforeAssignments === false - ) { - // Throw an error for assignments only if enabled using the sniff property - // because other standards allow multiple spaces to align assignments. - if ($tokens[($stackPtr - 2)]['line'] !== $tokens[$stackPtr]['line']) { - $found = 'newline'; - } else { - $found = $tokens[($stackPtr - 1)]['length']; - } - - $phpcsFile->recordMetric($stackPtr, 'Space before operator', $found); - if ($found !== 1 - && ($found !== 'newline' || $this->ignoreNewlines === false) - ) { - $error = 'Expected 1 space before "%s"; %s found'; - $data = [ - $operator, - $found, - ]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingBefore', $data); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - if ($found === 'newline') { - $i = ($stackPtr - 2); - while ($tokens[$i]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->replaceToken($i, ''); - $i--; - } - } - - $phpcsFile->fixer->replaceToken(($stackPtr - 1), ' '); - $phpcsFile->fixer->endChangeset(); - } - }//end if - }//end if - - $hasNext = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($hasNext === false) { - // Live coding/parse error at end of file. - return; - } - - if ($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { - // Skip short ternary such as: "$foo = $bar ?: true;". - if (($tokens[$stackPtr]['code'] === T_INLINE_THEN - && $tokens[($stackPtr + 1)]['code'] === T_INLINE_ELSE) - ) { - return; - } - - $error = "Expected 1 space after \"$operator\"; 0 found"; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceAfter'); - if ($fix === true) { - $phpcsFile->fixer->addContent($stackPtr, ' '); - } - - $phpcsFile->recordMetric($stackPtr, 'Space after operator', 0); - } else { - if (isset($tokens[($stackPtr + 2)]) === true - && $tokens[($stackPtr + 2)]['line'] !== $tokens[$stackPtr]['line'] - ) { - $found = 'newline'; - } else { - $found = $tokens[($stackPtr + 1)]['length']; - } - - $phpcsFile->recordMetric($stackPtr, 'Space after operator', $found); - if ($found !== 1 - && ($found !== 'newline' || $this->ignoreNewlines === false) - ) { - $error = 'Expected 1 space after "%s"; %s found'; - $data = [ - $operator, - $found, - ]; - - $nextNonWhitespace = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($nextNonWhitespace !== false - && isset(Tokens::$commentTokens[$tokens[$nextNonWhitespace]['code']]) === true - && $found === 'newline' - ) { - // Don't auto-fix when it's a comment or PHPCS annotation on a new line as - // it causes fixer conflicts and can cause the meaning of annotations to change. - $phpcsFile->addError($error, $stackPtr, 'SpacingAfter', $data); - } else { - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingAfter', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($stackPtr + 1), ' '); - } - } - }//end if - }//end if - - }//end process() - - - /** - * Checks if an operator is actually a different type of token in the current context. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being checked. - * @param int $stackPtr The position of the operator in - * the stack. - * - * @return boolean - */ - protected function isOperator(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Skip default values in function declarations. - // Skip declare statements. - if ($tokens[$stackPtr]['code'] === T_EQUAL - || $tokens[$stackPtr]['code'] === T_MINUS - ) { - if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) { - $parenthesis = array_keys($tokens[$stackPtr]['nested_parenthesis']); - $bracket = array_pop($parenthesis); - if (isset($tokens[$bracket]['parenthesis_owner']) === true) { - $function = $tokens[$bracket]['parenthesis_owner']; - if ($tokens[$function]['code'] === T_FUNCTION - || $tokens[$function]['code'] === T_CLOSURE - || $tokens[$function]['code'] === T_FN - || $tokens[$function]['code'] === T_DECLARE - ) { - return false; - } - } - } - } - - if ($tokens[$stackPtr]['code'] === T_EQUAL) { - // Skip for '=&' case. - if (isset($tokens[($stackPtr + 1)]) === true - && $tokens[($stackPtr + 1)]['code'] === T_BITWISE_AND - ) { - return false; - } - } - - if ($tokens[$stackPtr]['code'] === T_BITWISE_AND) { - // If it's not a reference, then we expect one space either side of the - // bitwise operator. - if ($phpcsFile->isReference($stackPtr) === true) { - return false; - } - } - - if ($tokens[$stackPtr]['code'] === T_MINUS || $tokens[$stackPtr]['code'] === T_PLUS) { - // Check minus spacing, but make sure we aren't just assigning - // a minus value or returning one. - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if (isset($this->nonOperandTokens[$tokens[$prev]['code']]) === true) { - return false; - } - }//end if - - return true; - - }//end isOperator() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/PropertyLabelSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/PropertyLabelSpacingSniff.php deleted file mode 100644 index 198460d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/PropertyLabelSpacingSniff.php +++ /dev/null @@ -1,79 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class PropertyLabelSpacingSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['JS']; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_PROPERTY, - T_LABEL, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $colon = $phpcsFile->findNext(T_COLON, ($stackPtr + 1)); - - if ($colon !== ($stackPtr + 1)) { - $error = 'There must be no space before the colon in a property/label declaration'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Before'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($stackPtr + 1), ''); - } - } - - if ($tokens[($colon + 1)]['code'] !== T_WHITESPACE || $tokens[($colon + 1)]['content'] !== ' ') { - $error = 'There must be a single space after the colon in a property/label declaration'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'After'); - if ($fix === true) { - if ($tokens[($colon + 1)]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->replaceToken(($colon + 1), ' '); - } else { - $phpcsFile->fixer->addContent($colon, ' '); - } - } - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php deleted file mode 100644 index fd03875..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php +++ /dev/null @@ -1,114 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class ScopeClosingBraceSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return Tokens::$scopeOpeners; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile All the tokens found in the document. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // If this is an inline condition (ie. there is no scope opener), then - // return, as this is not a new scope. - if (isset($tokens[$stackPtr]['scope_closer']) === false) { - return; - } - - // We need to actually find the first piece of content on this line, - // as if this is a method with tokens before it (public, static etc) - // or an if with an else before it, then we need to start the scope - // checking from there, rather than the current token. - $lineStart = $phpcsFile->findFirstOnLine([T_WHITESPACE, T_INLINE_HTML], $stackPtr, true); - while ($tokens[$lineStart]['code'] === T_CONSTANT_ENCAPSED_STRING - && $tokens[($lineStart - 1)]['code'] === T_CONSTANT_ENCAPSED_STRING - ) { - $lineStart = $phpcsFile->findFirstOnLine([T_WHITESPACE, T_INLINE_HTML], ($lineStart - 1), true); - } - - $startColumn = $tokens[$lineStart]['column']; - $scopeStart = $tokens[$stackPtr]['scope_opener']; - $scopeEnd = $tokens[$stackPtr]['scope_closer']; - - // Check that the closing brace is on it's own line. - $lastContent = $phpcsFile->findPrevious([T_INLINE_HTML, T_WHITESPACE, T_OPEN_TAG], ($scopeEnd - 1), $scopeStart, true); - for ($lineStart = $scopeEnd; $tokens[$lineStart]['column'] > 1; $lineStart--); - - if ($tokens[$lastContent]['line'] === $tokens[$scopeEnd]['line'] - || ($tokens[$lineStart]['code'] === T_INLINE_HTML - && trim($tokens[$lineStart]['content']) !== '') - ) { - $error = 'Closing brace must be on a line by itself'; - $fix = $phpcsFile->addFixableError($error, $scopeEnd, 'ContentBefore'); - if ($fix === true) { - if ($tokens[$lastContent]['line'] === $tokens[$scopeEnd]['line']) { - $phpcsFile->fixer->addNewlineBefore($scopeEnd); - } else { - $phpcsFile->fixer->addNewlineBefore(($lineStart + 1)); - } - } - - return; - } - - // Check now that the closing brace is lined up correctly. - $lineStart = $phpcsFile->findFirstOnLine([T_WHITESPACE, T_INLINE_HTML], $scopeEnd, true); - $braceIndent = $tokens[$lineStart]['column']; - if ($tokens[$stackPtr]['code'] !== T_DEFAULT - && $tokens[$stackPtr]['code'] !== T_CASE - && $braceIndent !== $startColumn - ) { - $error = 'Closing brace indented incorrectly; expected %s spaces, found %s'; - $data = [ - ($startColumn - 1), - ($braceIndent - 1), - ]; - - $fix = $phpcsFile->addFixableError($error, $scopeEnd, 'Indent', $data); - if ($fix === true) { - $diff = ($startColumn - $braceIndent); - if ($diff > 0) { - $phpcsFile->fixer->addContentBefore($lineStart, str_repeat(' ', $diff)); - } else { - $phpcsFile->fixer->substrToken(($lineStart - 1), 0, $diff); - } - } - }//end if - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ScopeKeywordSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ScopeKeywordSpacingSniff.php deleted file mode 100644 index ad995dc..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ScopeKeywordSpacingSniff.php +++ /dev/null @@ -1,168 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class ScopeKeywordSpacingSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - $register = Tokens::$scopeModifiers; - $register[] = T_STATIC; - return $register; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[($stackPtr + 1)]) === false) { - return; - } - - $prevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - $nextToken = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - - if ($tokens[$stackPtr]['code'] === T_STATIC) { - if (($nextToken === false || $tokens[$nextToken]['code'] === T_DOUBLE_COLON) - || $tokens[$prevToken]['code'] === T_NEW - ) { - // Late static binding, e.g., static:: OR new static() usage or live coding. - return; - } - - if ($prevToken !== false - && $tokens[$prevToken]['code'] === T_TYPE_UNION - ) { - // Not a scope keyword, but a union return type. - return; - } - - if ($prevToken !== false - && $tokens[$prevToken]['code'] === T_NULLABLE - ) { - // Not a scope keyword, but a return type. - return; - } - - if ($prevToken !== false - && $tokens[$prevToken]['code'] === T_COLON - ) { - $prevPrevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prevToken - 1), null, true); - if ($prevPrevToken !== false - && $tokens[$prevPrevToken]['code'] === T_CLOSE_PARENTHESIS - ) { - // Not a scope keyword, but a return type. - return; - } - } - }//end if - - if ($tokens[$prevToken]['code'] === T_AS) { - // Trait visibility change, e.g., "use HelloWorld { sayHello as private; }". - return; - } - - $isInFunctionDeclaration = false; - if (empty($tokens[$stackPtr]['nested_parenthesis']) === false) { - // Check if this is PHP 8.0 constructor property promotion. - // In that case, we can't have multi-property definitions. - $nestedParens = $tokens[$stackPtr]['nested_parenthesis']; - $lastCloseParens = end($nestedParens); - if (isset($tokens[$lastCloseParens]['parenthesis_owner']) === true - && $tokens[$tokens[$lastCloseParens]['parenthesis_owner']]['code'] === T_FUNCTION - ) { - $isInFunctionDeclaration = true; - } - } - - if ($nextToken !== false - && $tokens[$nextToken]['code'] === T_VARIABLE - && $isInFunctionDeclaration === false - ) { - $endOfStatement = $phpcsFile->findNext(T_SEMICOLON, ($nextToken + 1)); - if ($endOfStatement === false) { - // Live coding. - return; - } - - $multiProperty = $phpcsFile->findNext(T_VARIABLE, ($nextToken + 1), $endOfStatement); - if ($multiProperty !== false - && $tokens[$stackPtr]['line'] !== $tokens[$nextToken]['line'] - && $tokens[$nextToken]['line'] !== $tokens[$endOfStatement]['line'] - ) { - // Allow for multiple properties definitions to each be on their own line. - return; - } - } - - if ($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { - $spacing = 0; - } else { - if ($tokens[($stackPtr + 2)]['line'] !== $tokens[$stackPtr]['line']) { - $spacing = 'newline'; - } else { - $spacing = $tokens[($stackPtr + 1)]['length']; - } - } - - if ($spacing !== 1) { - $error = 'Scope keyword "%s" must be followed by a single space; found %s'; - $data = [ - $tokens[$stackPtr]['content'], - $spacing, - ]; - - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Incorrect', $data); - if ($fix === true) { - if ($spacing === 0) { - $phpcsFile->fixer->addContent($stackPtr, ' '); - } else { - $phpcsFile->fixer->beginChangeset(); - - for ($i = ($stackPtr + 2); $i < $phpcsFile->numTokens; $i++) { - if (isset($tokens[$i]) === false || $tokens[$i]['code'] !== T_WHITESPACE) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->replaceToken(($stackPtr + 1), ' '); - $phpcsFile->fixer->endChangeset(); - } - }//end if - }//end if - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/SemicolonSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/SemicolonSpacingSniff.php deleted file mode 100644 index bdcf9a5..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/SemicolonSpacingSniff.php +++ /dev/null @@ -1,116 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class SemicolonSpacingSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_SEMICOLON]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $prevType = $tokens[($stackPtr - 1)]['code']; - if (isset(Tokens::$emptyTokens[$prevType]) === false) { - return; - } - - $nonSpace = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 2), null, true); - - // Detect whether this is a semi-colon for a condition in a `for()` control structure. - $forCondition = false; - if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) { - $nestedParens = $tokens[$stackPtr]['nested_parenthesis']; - $closeParenthesis = end($nestedParens); - - if (isset($tokens[$closeParenthesis]['parenthesis_owner']) === true) { - $owner = $tokens[$closeParenthesis]['parenthesis_owner']; - - if ($tokens[$owner]['code'] === T_FOR) { - $forCondition = true; - $nonSpace = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 2), null, true); - } - } - } - - if ($tokens[$nonSpace]['code'] === T_SEMICOLON - || ($forCondition === true && $nonSpace === $tokens[$owner]['parenthesis_opener']) - || (isset($tokens[$nonSpace]['scope_opener']) === true - && $tokens[$nonSpace]['scope_opener'] === $nonSpace) - ) { - // Empty statement. - return; - } - - $expected = $tokens[$nonSpace]['content'].';'; - $found = $phpcsFile->getTokensAsString($nonSpace, ($stackPtr - $nonSpace)).';'; - $found = str_replace("\n", '\n', $found); - $found = str_replace("\r", '\r', $found); - $found = str_replace("\t", '\t', $found); - $error = 'Space found before semicolon; expected "%s" but found "%s"'; - $data = [ - $expected, - $found, - ]; - - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Incorrect', $data); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $i = ($stackPtr - 1); - while (($tokens[$i]['code'] === T_WHITESPACE) && ($i > $nonSpace)) { - $phpcsFile->fixer->replaceToken($i, ''); - $i--; - } - - $phpcsFile->fixer->addContent($nonSpace, ';'); - $phpcsFile->fixer->replaceToken($stackPtr, ''); - - $phpcsFile->fixer->endChangeset(); - } - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/SuperfluousWhitespaceSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/SuperfluousWhitespaceSniff.php deleted file mode 100644 index e99d829..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/SuperfluousWhitespaceSniff.php +++ /dev/null @@ -1,265 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class SuperfluousWhitespaceSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - 'CSS', - ]; - - /** - * If TRUE, whitespace rules are not checked for blank lines. - * - * Blank lines are those that contain only whitespace. - * - * @var boolean - */ - public $ignoreBlankLines = false; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_OPEN_TAG, - T_OPEN_TAG_WITH_ECHO, - T_CLOSE_TAG, - T_WHITESPACE, - T_COMMENT, - T_DOC_COMMENT_WHITESPACE, - T_CLOSURE, - ]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if ($tokens[$stackPtr]['code'] === T_OPEN_TAG) { - /* - Check for start of file whitespace. - */ - - if ($phpcsFile->tokenizerType !== 'PHP') { - // The first token is always the open tag inserted when tokenized - // and the second token is always the first piece of content in - // the file. If the second token is whitespace, there was - // whitespace at the start of the file. - if ($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { - return; - } - - if ($phpcsFile->fixer->enabled === true) { - $stackPtr = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - } - } else { - // If it's the first token, then there is no space. - if ($stackPtr === 0) { - return; - } - - $beforeOpen = ''; - - for ($i = ($stackPtr - 1); $i >= 0; $i--) { - // If we find something that isn't inline html then there is something previous in the file. - if ($tokens[$i]['type'] !== 'T_INLINE_HTML') { - return; - } - - $beforeOpen .= $tokens[$i]['content']; - } - - // If we have ended up with inline html make sure it isn't just whitespace. - if (preg_match('`^[\pZ\s]+$`u', $beforeOpen) !== 1) { - return; - } - }//end if - - $fix = $phpcsFile->addFixableError('Additional whitespace found at start of file', $stackPtr, 'StartFile'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = 0; $i < $stackPtr; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } else if ($tokens[$stackPtr]['code'] === T_CLOSE_TAG) { - /* - Check for end of file whitespace. - */ - - if ($phpcsFile->tokenizerType === 'PHP') { - if (isset($tokens[($stackPtr + 1)]) === false) { - // The close PHP token is the last in the file. - return; - } - - $afterClose = ''; - - for ($i = ($stackPtr + 1); $i < $phpcsFile->numTokens; $i++) { - // If we find something that isn't inline HTML then there - // is more to the file. - if ($tokens[$i]['type'] !== 'T_INLINE_HTML') { - return; - } - - $afterClose .= $tokens[$i]['content']; - } - - // If we have ended up with inline html make sure it isn't just whitespace. - if (preg_match('`^[\pZ\s]+$`u', $afterClose) !== 1) { - return; - } - } else { - // The last token is always the close tag inserted when tokenized - // and the second last token is always the last piece of content in - // the file. If the second last token is whitespace, there was - // whitespace at the end of the file. - $stackPtr--; - - // The pointer is now looking at the last content in the file and - // not the fake PHP end tag the tokenizer inserted. - if ($tokens[$stackPtr]['code'] !== T_WHITESPACE) { - return; - } - - // Allow a single newline at the end of the last line in the file. - if ($tokens[($stackPtr - 1)]['code'] !== T_WHITESPACE - && $tokens[$stackPtr]['content'] === $phpcsFile->eolChar - ) { - return; - } - }//end if - - $fix = $phpcsFile->addFixableError('Additional whitespace found at end of file', $stackPtr, 'EndFile'); - if ($fix === true) { - if ($phpcsFile->tokenizerType !== 'PHP') { - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); - $stackPtr = ($prev + 1); - } - - $phpcsFile->fixer->beginChangeset(); - for ($i = ($stackPtr + 1); $i < $phpcsFile->numTokens; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } else { - /* - Check for end of line whitespace. - */ - - // Ignore whitespace that is not at the end of a line. - if (isset($tokens[($stackPtr + 1)]['line']) === true - && $tokens[($stackPtr + 1)]['line'] === $tokens[$stackPtr]['line'] - ) { - return; - } - - // Ignore blank lines if required. - if ($this->ignoreBlankLines === true - && $tokens[$stackPtr]['code'] === T_WHITESPACE - && $tokens[($stackPtr - 1)]['line'] !== $tokens[$stackPtr]['line'] - ) { - return; - } - - $tokenContent = rtrim($tokens[$stackPtr]['content'], $phpcsFile->eolChar); - if (empty($tokenContent) === false) { - if ($tokenContent !== rtrim($tokenContent)) { - $fix = $phpcsFile->addFixableError('Whitespace found at end of line', $stackPtr, 'EndLine'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($stackPtr, rtrim($tokenContent).$phpcsFile->eolChar); - } - } - } else if ($tokens[($stackPtr - 1)]['content'] !== rtrim($tokens[($stackPtr - 1)]['content']) - && $tokens[($stackPtr - 1)]['line'] === $tokens[$stackPtr]['line'] - ) { - $fix = $phpcsFile->addFixableError('Whitespace found at end of line', ($stackPtr - 1), 'EndLine'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($stackPtr - 1), rtrim($tokens[($stackPtr - 1)]['content'])); - } - } - - /* - Check for multiple blank lines in a function. - */ - - if (($phpcsFile->hasCondition($stackPtr, [T_FUNCTION, T_CLOSURE]) === true) - && $tokens[($stackPtr - 1)]['line'] < $tokens[$stackPtr]['line'] - && $tokens[($stackPtr - 2)]['line'] === $tokens[($stackPtr - 1)]['line'] - ) { - // Properties and functions in nested classes have their own rules for spacing. - $conditions = $tokens[$stackPtr]['conditions']; - $deepestScope = end($conditions); - if ($deepestScope === T_ANON_CLASS) { - return; - } - - // This is an empty line and the line before this one is not - // empty, so this could be the start of a multiple empty - // line block. - $next = $phpcsFile->findNext(T_WHITESPACE, $stackPtr, null, true); - $lines = ($tokens[$next]['line'] - $tokens[$stackPtr]['line']); - if ($lines > 1) { - $error = 'Functions must not contain multiple empty lines in a row; found %s empty lines'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'EmptyLines', [$lines]); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $i = $stackPtr; - while ($tokens[$i]['line'] !== $tokens[$next]['line']) { - $phpcsFile->fixer->replaceToken($i, ''); - $i++; - } - - $phpcsFile->fixer->addNewlineBefore($i); - $phpcsFile->fixer->endChangeset(); - } - } - }//end if - }//end if - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayBracketSpacingUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayBracketSpacingUnitTest.inc deleted file mode 100644 index 8ffc868..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayBracketSpacingUnitTest.inc +++ /dev/null @@ -1,31 +0,0 @@ - 'bar', - 'bar' => 'foo', -]; - -if ($foo) {} -[$a, $b] = $c; - -echo foo()[ 1 ]; - -echo $this->addedCustomFunctions['nonce']; -echo $this->deprecated_functions[ $function_name ]['version']; - -echo [ 1,2,3 ][0]; -echo [ 1,2,3 ][ 0 ]; -echo 'PHP'[ 0 ]; - -$array = []; -$var = $var[$var[$var]]]; // Syntax error -$var = $var[$var[$var]; // Syntax error - -$myArray[ /* key start */'key'] = $value; -$myArray[ /* key start */'key'/* key end */ ] = $value; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayBracketSpacingUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayBracketSpacingUnitTest.inc.fixed deleted file mode 100644 index 41d6640..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayBracketSpacingUnitTest.inc.fixed +++ /dev/null @@ -1,31 +0,0 @@ - 'bar', - 'bar' => 'foo', -]; - -if ($foo) {} -[$a, $b] = $c; - -echo foo()[1]; - -echo $this->addedCustomFunctions['nonce']; -echo $this->deprecated_functions[$function_name]['version']; - -echo [ 1,2,3 ][0]; -echo [ 1,2,3 ][0]; -echo 'PHP'[0]; - -$array = []; -$var = $var[$var[$var]]]; // Syntax error -$var = $var[$var[$var]; // Syntax error - -$myArray[/* key start */'key'] = $value; -$myArray[/* key start */'key'/* key end */] = $value; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayBracketSpacingUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayBracketSpacingUnitTest.php deleted file mode 100644 index 304a0d4..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayBracketSpacingUnitTest.php +++ /dev/null @@ -1,57 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Arrays; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ArrayBracketSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 5 => 3, - 7 => 3, - 17 => 2, - 20 => 2, - 23 => 2, - 24 => 2, - 30 => 1, - 31 => 2, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.1.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.1.inc deleted file mode 100644 index 750aaeb..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.1.inc +++ /dev/null @@ -1,481 +0,0 @@ - 1, - ); -} - -class TestClass -{ - public $good = array( - 'width' => '', - 'height' => '', - ); - - private $_bad = Array( - 'width' => '', - 'height' => '' - ); - - - public function test() - { - $truck = array( - 'width' => '', - 'height' => '', - ); - - $plane = Array( - 'width' => '', - 'height' => '', - ); - - $car = array( - 'width' => '', - 'height' => '', - ); - - $bus = array( - 'width' => '', - 'height' => '' - ); - - $train = array ( - TRUE, - FALSE, - 'aaa' - ); - - $inline = array('aaa', 'bbb', 'ccc'); - $inline = array('aaa'); - $inline = Array('aaa'); - - $bigone = array( - 'name' => 'bigone', - 'children' => Array( - '1a' => 'child', - '11b' => 'child', - '111c' => 'child', - 'children' => Array( - 'child' => 'aaa', - ), - ), - 'short_name' => 'big' - ); - } - -}//end class - -$value = array ( ); -$value = array( ); -$value = array('1'=>$one, '2' => $two, '3'=> $three, '4' =>$four); -$value = array('1'=>$one); - -if (in_array('1', array('1','2','3')) === TRUE) { - $value = in_array('1', array('1' , '2', '3','4')); -} - -$value = array( - '1'=> TRUE, - FALSE, - '3' => 'aaa',); - -$value = array( - '1'=> TRUE, - FALSE, - ); - -$value = array( - TRUE, - '1' => FALSE, - ); - -$value = array(1, - 2 , - 3 , - ); - -$value = array(1 => $one, - 2 => $two , - 3 => $three , - ); - -$value = array( - 'tag' => $tag, - 'space' => $this->_getIndentation($tag, $tagElement), - ); - -$expected = array( - array( - '1' => 1, - '1' => 2, - ), - ); - -$expected = array( - array( - '1' => 1, - '1' => 2 - ) - ); - -// Space in second arg. -$args = array( - '"'.$this->id.'"', - (int) $hasSessions, - ); - -// No errors. -$paths = array( - Init::ROOT_DIR.'/Systems' => 'Systems', - Init::ROOT_DIR.'/Installer' => 'Systems', - ); - -$x = array( - ); - -$x = array('test' - ); -$x = array('test', - ); -$x = array('name' => 'test', - ); - -$x = array( - $x, - ); - -$func = array( - $x, - 'get'.$x.'Replacement' - ); - -$array = array( - 'input_one' => 'one', - 'inputTwo' => 'two', - 'input_3' => 3, - ); - -$array = array( - 'input_one', - 'inputTwo', - 'input_3', - ); - -// Malformed -$foo = array(1 -, 2); - -$listItems[$aliasPath] = array('itemContent' => implode('
    ', $aliases)); - -$listItems[$aliasPath] = array( - 'itemContent' => implode('
    ', $aliases) - ); - -$x = array - ( - $x, - $y, - ); - -$x = array -( - $x, - $y, - ); - -$x = array( - - $x, - $y, - ); - -$test = array( - 'test' => TestFunction::blah( - $value1, - $value2 - ), - ); - -$c = array('a' => 1,); - -function b() -{ - $a = array( - 'a' => a('a'), - - ); - -} - -$foo = Array('[',']',':',"\n","\r"); -$bar = Array('[',']',':',' ',' '); - -function foo() -{ - return array($a, $b->screen); -} - -$array = array( - 'name' => 'contactSubject', - 'required' => TRUE, - 'validators' => array( - new \Zend\Validator\InArray(array('haystack' => array_keys($aSubjects))), - ), - ); - -$var = array( - 'ViewHelper', - array('Foo'), - 'Errors', - ); - -$data = array( - 'first', - 'second', - 'third', - // Add more here - ); - -$data = array( - 'first', - 'second', - //'third', - ); - -$data = array( - 'first', - 'second' - //'third', - ); - -$foo = array( - $this->getViewName() . '.id' => 'value', - $this->getViewName() . '.title' => 'value', - ); - -$foo = array( - $this->getViewName() . '.id', - $this->getViewName() . '.title', - ); - -$weightings = array( - T_CLOSURE => 100, - - /* - Conditions. - */ - - T_WHILE => 50, - - /* - Operators and arithmetic. - */ - - T_BITWISE_AND => 8, - - T_BOOLEAN_AND => 5, - - /* - Equality. - */ - - T_IS_GREATER_OR_EQUAL => 5, - ); - -foreach (array( - 'foo' => 'bar', - 'foobaz' => 'bazzy', - ) as $key => $value) { -} - -$ids = array( - '1', // Foo. - '13', // Bar. - ); - -array( - 'key1' => function($bar) { - return $bar; - }, - 'key2' => function($foo) { - return $foo; - }, - 'key3' => function($bar) { - return $bar; - } -); - -array( - 'key1' => array( - '1', - '2', - ) -); - -$var = array( - 'tab_template' => ' -
  • %s
  • ', - 'panel_template' => ' -
    - %s -
    ', - ); - -function test() : array -{ - return []; -} - -$fields = array( - 'id' => array('type' => 'INT'), - 'value' => array('type' => 'VARCHAR')); - -get_current_screen()->add_help_tab( array( - 'id' => << false); - -$x = array( - 'xxxx' => array('aaaaaaaaaa' => 'ccccccccccc', - 'bbbbbbbb' => false), -); - -$foo = array - ('foo' => array - ('bar1' => 1 - ,'bar2' => 1 - ,'bar3' => 1 - ,'bar4' => 1 - ,'bar5' => 1 - ) - ); - -$foo = array( - '1' => $row['status'] === 'rejected' - ? self::REJECTED_CODE - : self::VERIFIED_CODE, - '2' => in_array($row['status'], array('notverified', 'unverified'), true) - ? self::STATUS_PENDING - : self::STATUS_VERIFIED, - '3' => strtotime($row['date']), - ); - -$foo = foo( - array( - // comment - ) -); - -$foo = array( - << lorem( - 1 - ), 2 => 2, -); - -$foo = array( - 'тип' => 'авто', - 'цвет' => 'синий', - ); - -$paths = array( - Init::ROOT_DIR.'/тип' => 'авто', - Init::ROOT_DIR.'/цвет' => 'синий', - ); - -$foo = array(<< fn() => return 1, - 'bb' => fn() => return 2, - 'ccc' => ( true ) ? - fn() => return 1 : - fn() => return 2, - ); - -$array = array( - 1 => '1', - 2 => fn ($x) => yield 'a' => $x, - 3 => '3', - ); - -$foo = array( - $this->fn => 'value', - $foo->fn => 'value', - ); - -array($a, $b, -$c); - -array('a' => $a, 'b' => $b, -'c' => $c); - -array( - static function() { - return null; - }, - (array) array(), - (bool) array(), - (double) array(), - (int) array(), - (object) array(), - (string) array(), - (unset) array(), -); - -array( - 'foo', - 'bar' - // This is a non-fixable error. - , -); - -yield array( - static fn () : string => '', -); - -yield array( - static fn () : string => '', - ); - -// Intentional syntax error. -$a = array( - 'a' => - ); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.1.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.1.inc.fixed deleted file mode 100644 index 3ecc091..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.1.inc.fixed +++ /dev/null @@ -1,517 +0,0 @@ - 1); -} - -class TestClass -{ - public $good = array( - 'width' => '', - 'height' => '', - ); - - private $_bad = array( - 'width' => '', - 'height' => '', - ); - - - public function test() - { - $truck = array( - 'width' => '', - 'height' => '', - ); - - $plane = array( - 'width' => '', - 'height' => '', - ); - - $car = array( - 'width' => '', - 'height' => '', - ); - - $bus = array( - 'width' => '', - 'height' => '', - ); - - $train = array( - TRUE, - FALSE, - 'aaa', - ); - - $inline = array( - 'aaa', - 'bbb', - 'ccc', - ); - $inline = array('aaa'); - $inline = array('aaa'); - - $bigone = array( - 'name' => 'bigone', - 'children' => array( - '1a' => 'child', - '11b' => 'child', - '111c' => 'child', - 'children' => array('child' => 'aaa'), - ), - 'short_name' => 'big', - ); - } - -}//end class - -$value = array(); -$value = array(); -$value = array( - '1' => $one, - '2' => $two, - '3' => $three, - '4' => $four, - ); -$value = array('1' => $one); - -if (in_array('1', array('1', '2', '3')) === TRUE) { - $value = in_array('1', array('1', '2', '3', '4')); -} - -$value = array( - '1'=> TRUE, - FALSE, - '3' => 'aaa', - ); - -$value = array( - '1'=> TRUE, - FALSE, - ); - -$value = array( - TRUE, - '1' => FALSE, - ); - -$value = array( - 1, - 2, - 3, - ); - -$value = array( - 1 => $one, - 2 => $two, - 3 => $three, - ); - -$value = array( - 'tag' => $tag, - 'space' => $this->_getIndentation($tag, $tagElement), - ); - -$expected = array( - array( - '1' => 1, - '1' => 2, - ), - ); - -$expected = array( - array( - '1' => 1, - '1' => 2, - ), - ); - -// Space in second arg. -$args = array( - '"'.$this->id.'"', - (int) $hasSessions, - ); - -// No errors. -$paths = array( - Init::ROOT_DIR.'/Systems' => 'Systems', - Init::ROOT_DIR.'/Installer' => 'Systems', - ); - -$x = array(); - -$x = array('test'); -$x = array('test'); -$x = array('name' => 'test'); - -$x = array($x); - -$func = array( - $x, - 'get'.$x.'Replacement', - ); - -$array = array( - 'input_one' => 'one', - 'inputTwo' => 'two', - 'input_3' => 3, - ); - -$array = array( - 'input_one', - 'inputTwo', - 'input_3', - ); - -// Malformed -$foo = array( - 1, - 2, - ); - -$listItems[$aliasPath] = array('itemContent' => implode('
    ', $aliases)); - -$listItems[$aliasPath] = array( - 'itemContent' => implode('
    ', $aliases), - ); - -$x = array( - $x, - $y, - ); - -$x = array( - $x, - $y, - ); - -$x = array( - - $x, - $y, - ); - -$test = array( - 'test' => TestFunction::blah( - $value1, - $value2 - ), - ); - -$c = array('a' => 1); - -function b() -{ - $a = array( - 'a' => a('a'), - - ); - -} - -$foo = array( - '[', - ']', - ':', - "\n", - "\r", - ); -$bar = array( - '[', - ']', - ':', - ' ', - ' ', - ); - -function foo() -{ - return array( - $a, - $b->screen, - ); -} - -$array = array( - 'name' => 'contactSubject', - 'required' => TRUE, - 'validators' => array( - new \Zend\Validator\InArray(array('haystack' => array_keys($aSubjects))), - ), - ); - -$var = array( - 'ViewHelper', - array('Foo'), - 'Errors', - ); - -$data = array( - 'first', - 'second', - 'third', - // Add more here - ); - -$data = array( - 'first', - 'second', - //'third', - ); - -$data = array( - 'first', - 'second', - //'third', - ); - -$foo = array( - $this->getViewName() . '.id' => 'value', - $this->getViewName() . '.title' => 'value', - ); - -$foo = array( - $this->getViewName() . '.id', - $this->getViewName() . '.title', - ); - -$weightings = array( - T_CLOSURE => 100, - - /* - Conditions. - */ - - T_WHILE => 50, - - /* - Operators and arithmetic. - */ - - T_BITWISE_AND => 8, - - T_BOOLEAN_AND => 5, - - /* - Equality. - */ - - T_IS_GREATER_OR_EQUAL => 5, - ); - -foreach (array( - 'foo' => 'bar', - 'foobaz' => 'bazzy', - ) as $key => $value) { -} - -$ids = array( - '1', // Foo. - '13', // Bar. - ); - -array( - 'key1' => function($bar) { - return $bar; - }, - 'key2' => function($foo) { - return $foo; - }, - 'key3' => function($bar) { - return $bar; - }, -); - -array( - 'key1' => array( - '1', - '2', - ), -); - -$var = array( - 'tab_template' => ' -
  • %s
  • ', - 'panel_template' => ' -
    - %s -
    ', - ); - -function test() : array -{ - return []; -} - -$fields = array( - 'id' => array('type' => 'INT'), - 'value' => array('type' => 'VARCHAR'), - ); - -get_current_screen()->add_help_tab( array( - 'id' => << false); - -$x = array( - 'xxxx' => array( - 'aaaaaaaaaa' => 'ccccccccccc', - 'bbbbbbbb' => false, - ), - ); - -$foo = array( - 'foo' => array( - 'bar1' => 1, - 'bar2' => 1, - 'bar3' => 1, - 'bar4' => 1, - 'bar5' => 1, - ), - ); - -$foo = array( - '1' => $row['status'] === 'rejected' - ? self::REJECTED_CODE - : self::VERIFIED_CODE, - '2' => in_array($row['status'], array('notverified', 'unverified'), true) - ? self::STATUS_PENDING - : self::STATUS_VERIFIED, - '3' => strtotime($row['date']), - ); - -$foo = foo( - array( - // comment - ) -); - -$foo = array( - << lorem( - 1 - ), - 2 => 2, -); - -$foo = array( - 'тип' => 'авто', - 'цвет' => 'синий', - ); - -$paths = array( - Init::ROOT_DIR.'/тип' => 'авто', - Init::ROOT_DIR.'/цвет' => 'синий', - ); - -$foo = array(<< fn() => return 1, - 'bb' => fn() => return 2, - 'ccc' => ( true ) ? - fn() => return 1 : - fn() => return 2, - ); - -$array = array( - 1 => '1', - 2 => fn ($x) => yield 'a' => $x, - 3 => '3', - ); - -$foo = array( - $this->fn => 'value', - $foo->fn => 'value', - ); - -array( - $a, - $b, - $c, -); - -array( - 'a' => $a, - 'b' => $b, - 'c' => $c, -); - -array( - static function() { - return null; - }, - (array) array(), - (bool) array(), - (double) array(), - (int) array(), - (object) array(), - (string) array(), - (unset) array(), -); - -array( - 'foo', - 'bar' - // This is a non-fixable error. - , -); - -yield array( - static fn () : string => '', - ); - -yield array( - static fn () : string => '', - ); - -// Intentional syntax error. -$a = array( - 'a' => - ); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.2.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.2.inc deleted file mode 100644 index 621970f..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.2.inc +++ /dev/null @@ -1,470 +0,0 @@ - 1, - ]; -} - -class TestClass -{ - public $good = [ - 'width' => '', - 'height' => '', - ]; - - private $_bad = [ - 'width' => '', - 'height' => '' - ]; - - - public function test() - { - $truck = [ - 'width' => '', - 'height' => '', - ]; - - $plane = [ - 'width' => '', - 'height' => '', - ]; - - $car = [ - 'width' => '', - 'height' => '', - ]; - - $bus = [ - 'width' => '', - 'height' => '' - ]; - - $train = [ - TRUE, - FALSE, - 'aaa' - ]; - - $inline = ['aaa', 'bbb', 'ccc']; - $inline = ['aaa']; - $inline = ['aaa']; - - $bigone = [ - 'name' => 'bigone', - 'children' => [ - '1a' => 'child', - '11b' => 'child', - '111c' => 'child', - 'children' => [ - 'child' => 'aaa', - ], - ], - 'short_name' => 'big' - ]; - } - -}//end class - -$value = [ ]; -$value = [ ]; -$value = ['1'=>$one, '2' => $two, '3'=> $three, '4' =>$four]; -$value = ['1'=>$one]; - -if (in_array('1', ['1','2','3']) === TRUE) { - $value = in_array('1', ['1' , '2', '3','4']); -} - -$value = [ - '1'=> TRUE, - FALSE, - '3' => 'aaa',]; - -$value = [ - '1'=> TRUE, - FALSE, - ]; - -$value = [ - TRUE, - '1' => FALSE, - ]; - -$value = [1, - 2 , - 3 , - ]; - -$value = [1 => $one, - 2 => $two , - 3 => $three , - ]; - -$value = [ - 'tag' => $tag, - 'space' => $this->_getIndentation($tag, $tagElement), - ]; - -$expected = [ - [ - '1' => 1, - '1' => 2, - ], - ]; - -$expected = [ - [ - '1' => 1, - '1' => 2 - ] - ]; - -// Space in second arg. -$args = [ - '"'.$this->id.'"', - (int) $hasSessions, - ]; - -// No errors. -$paths = [ - Init::ROOT_DIR.'/Systems' => 'Systems', - Init::ROOT_DIR.'/Installer' => 'Systems', - ]; - -$x = [ - ]; - -$x = ['test' - ]; -$x = ['test', - ]; -$x = ['name' => 'test', - ]; - -$x = [ - $x, - ]; - -$func = [ - $x, - 'get'.$x.'Replacement' - ]; - -$array = [ - 'input_one' => 'one', - 'inputTwo' => 'two', - 'input_3' => 3, - ]; - -$array = [ - 'input_one', - 'inputTwo', - 'input_3', - ]; - -// Malformed -$foo = [1 -, 2]; - -$listItems[$aliasPath] = ['itemContent' => implode('
    ', $aliases)]; - -$listItems[$aliasPath] = [ - 'itemContent' => implode('
    ', $aliases) - ]; - -$x = - [ - $x, - $y, - ]; - -$x = -[ - $x, - $y, - ]; - -$x = [ - - $x, - $y, - ]; - -$test = [ - 'test' => TestFunction::blah( - $value1, - $value2 - ), - ]; - -$c = ['a' => 1,]; -$c->{$var}[ ] = 2; - -$foo = ['[',']',':',"\n","\r"]; -$bar = ['[',']',':',' ',' ']; - -function foo() -{ - return [$a, $b->screen]; -} - -$array = [ - 'name' => 'contactSubject', - 'required' => TRUE, - 'validators' => [ - new \Zend\Validator\InArray(['haystack' => array_keys($aSubjects)]), - ], - ]; - -$var = [ - 'ViewHelper', - ['Foo'], - 'Errors', - ]; - -$data = [ - 'first', - 'second', - 'third', - // Add more here - ]; - -$data = [ - 'first', - 'second', - //'third', - ]; - -$data = [ - 'first', - 'second' - //'third', - ]; - -$foo = [ - $this->getViewName() . '.id' => 'value', - $this->getViewName() . '.title' => 'value', - ]; - -$foo = [ - $this->getViewName() . '.id', - $this->getViewName() . '.title', - ]; - -$weightings = [ - T_CLOSURE => 100, - - /* - Conditions. - */ - - T_WHILE => 50, - - /* - Operators and arithmetic. - */ - - T_BITWISE_AND => 8, - - T_BOOLEAN_AND => 5, - - /* - Equality. - */ - - T_IS_GREATER_OR_EQUAL => 5, - ]; - -foreach ([ - 'foo' => 'bar', - 'foobaz' => 'bazzy', - ] as $key => $value) { -} - -$ids = [ - '1', // Foo. - '13', // Bar. - ]; - -[ - 'key1' => function($bar) { - return $bar; - }, - 'key2' => function($foo) { - return $foo; - }, - 'key3' => function($bar) { - return $bar; - } -]; - -[ - 'key1' => [ - '1', - '2', - ] -]; - -$var = [ - 'tab_template' => ' -
  • %s
  • ', - 'panel_template' => ' -
    - %s -
    ', - ]; - -function test() : array -{ - return []; -} - -$fields = [ - 'id' => ['type' => 'INT'], - 'value' => ['type' => 'VARCHAR']]; - -get_current_screen()->add_help_tab( [ - 'id' => << false]; - -$x = [ - 'xxxx' => ['aaaaaaaaaa' => 'ccccccccccc', - 'bbbbbbbb' => false], -]; - -$foo = ['foo' => ['bar1' => 1 - ,'bar2' => 1 - ,'bar3' => 1 - ,'bar4' => 1 - ,'bar5' => 1 - ] - ]; - -$foo = [ - '1' => $row['status'] === 'rejected' - ? self::REJECTED_CODE - : self::VERIFIED_CODE, - '2' => in_array($row['status'], ['notverified', 'unverified'], true) - ? self::STATUS_PENDING - : self::STATUS_VERIFIED, - '3' => strtotime($row['date']), - ]; - - -$foo = foo( - [ - // comment - ] -); - -$foo = [ - << lorem( - 1 - ), 2 => 2, -]; - -$foo = [ - 'тип' => 'авто', - 'цвет' => 'синий', - ]; - -$paths = [ - Init::ROOT_DIR.'/тип' => 'авто', - Init::ROOT_DIR.'/цвет' => 'синий', - ]; - -$foo = [<< fn() => return 1, - 'bb' => fn() => return 2, - 'ccc' => ( true ) ? - fn() => return 1 : - fn() => return 2, - ]; - -$array = [ - 1 => '1', - 2 => fn ($x) => yield 'a' => $x, - 3 => '3', - ]; - -$foo = [ - $this->fn => 'value', - $foo->fn => 'value', - ]; - -[$a, $b, -$c]; - -['a' => $a, 'b' => $b, -'c' => $c]; - -[ - static function() { - return null; - }, - (array) [], - (bool) [], - (double) [], - (int) [], - (object) [], - (string) [], - (unset) [], -]; - -[ - 'foo', - 'bar' - // This is a non-fixable error. - , -]; - -yield [ - static fn () : string => '', -]; - -yield [ - static fn () : string => '', - ]; - -// Intentional syntax error. -$a = [ - 'a' => - ]; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.2.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.2.inc.fixed deleted file mode 100644 index efe4c45..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.2.inc.fixed +++ /dev/null @@ -1,504 +0,0 @@ - 1]; -} - -class TestClass -{ - public $good = [ - 'width' => '', - 'height' => '', - ]; - - private $_bad = [ - 'width' => '', - 'height' => '', - ]; - - - public function test() - { - $truck = [ - 'width' => '', - 'height' => '', - ]; - - $plane = [ - 'width' => '', - 'height' => '', - ]; - - $car = [ - 'width' => '', - 'height' => '', - ]; - - $bus = [ - 'width' => '', - 'height' => '', - ]; - - $train = [ - TRUE, - FALSE, - 'aaa', - ]; - - $inline = [ - 'aaa', - 'bbb', - 'ccc', - ]; - $inline = ['aaa']; - $inline = ['aaa']; - - $bigone = [ - 'name' => 'bigone', - 'children' => [ - '1a' => 'child', - '11b' => 'child', - '111c' => 'child', - 'children' => ['child' => 'aaa'], - ], - 'short_name' => 'big', - ]; - } - -}//end class - -$value = []; -$value = []; -$value = [ - '1' => $one, - '2' => $two, - '3' => $three, - '4' => $four, - ]; -$value = ['1' => $one]; - -if (in_array('1', ['1', '2', '3']) === TRUE) { - $value = in_array('1', ['1', '2', '3', '4']); -} - -$value = [ - '1'=> TRUE, - FALSE, - '3' => 'aaa', - ]; - -$value = [ - '1'=> TRUE, - FALSE, - ]; - -$value = [ - TRUE, - '1' => FALSE, - ]; - -$value = [ - 1, - 2, - 3, - ]; - -$value = [ - 1 => $one, - 2 => $two, - 3 => $three, - ]; - -$value = [ - 'tag' => $tag, - 'space' => $this->_getIndentation($tag, $tagElement), - ]; - -$expected = [ - [ - '1' => 1, - '1' => 2, - ], - ]; - -$expected = [ - [ - '1' => 1, - '1' => 2, - ], - ]; - -// Space in second arg. -$args = [ - '"'.$this->id.'"', - (int) $hasSessions, - ]; - -// No errors. -$paths = [ - Init::ROOT_DIR.'/Systems' => 'Systems', - Init::ROOT_DIR.'/Installer' => 'Systems', - ]; - -$x = []; - -$x = ['test']; -$x = ['test']; -$x = ['name' => 'test']; - -$x = [$x]; - -$func = [ - $x, - 'get'.$x.'Replacement', - ]; - -$array = [ - 'input_one' => 'one', - 'inputTwo' => 'two', - 'input_3' => 3, - ]; - -$array = [ - 'input_one', - 'inputTwo', - 'input_3', - ]; - -// Malformed -$foo = [ - 1, - 2, - ]; - -$listItems[$aliasPath] = ['itemContent' => implode('
    ', $aliases)]; - -$listItems[$aliasPath] = [ - 'itemContent' => implode('
    ', $aliases), - ]; - -$x = - [ - $x, - $y, - ]; - -$x = -[ - $x, - $y, -]; - -$x = [ - - $x, - $y, - ]; - -$test = [ - 'test' => TestFunction::blah( - $value1, - $value2 - ), - ]; - -$c = ['a' => 1]; -$c->{$var}[ ] = 2; - -$foo = [ - '[', - ']', - ':', - "\n", - "\r", - ]; -$bar = [ - '[', - ']', - ':', - ' ', - ' ', - ]; - -function foo() -{ - return [ - $a, - $b->screen, - ]; -} - -$array = [ - 'name' => 'contactSubject', - 'required' => TRUE, - 'validators' => [ - new \Zend\Validator\InArray(['haystack' => array_keys($aSubjects)]), - ], - ]; - -$var = [ - 'ViewHelper', - ['Foo'], - 'Errors', - ]; - -$data = [ - 'first', - 'second', - 'third', - // Add more here - ]; - -$data = [ - 'first', - 'second', - //'third', - ]; - -$data = [ - 'first', - 'second', - //'third', - ]; - -$foo = [ - $this->getViewName() . '.id' => 'value', - $this->getViewName() . '.title' => 'value', - ]; - -$foo = [ - $this->getViewName() . '.id', - $this->getViewName() . '.title', - ]; - -$weightings = [ - T_CLOSURE => 100, - - /* - Conditions. - */ - - T_WHILE => 50, - - /* - Operators and arithmetic. - */ - - T_BITWISE_AND => 8, - - T_BOOLEAN_AND => 5, - - /* - Equality. - */ - - T_IS_GREATER_OR_EQUAL => 5, - ]; - -foreach ([ - 'foo' => 'bar', - 'foobaz' => 'bazzy', - ] as $key => $value) { -} - -$ids = [ - '1', // Foo. - '13', // Bar. - ]; - -[ - 'key1' => function($bar) { - return $bar; - }, - 'key2' => function($foo) { - return $foo; - }, - 'key3' => function($bar) { - return $bar; - }, -]; - -[ - 'key1' => [ - '1', - '2', - ], -]; - -$var = [ - 'tab_template' => ' -
  • %s
  • ', - 'panel_template' => ' -
    - %s -
    ', - ]; - -function test() : array -{ - return []; -} - -$fields = [ - 'id' => ['type' => 'INT'], - 'value' => ['type' => 'VARCHAR'], - ]; - -get_current_screen()->add_help_tab( [ - 'id' => << false]; - -$x = [ - 'xxxx' => [ - 'aaaaaaaaaa' => 'ccccccccccc', - 'bbbbbbbb' => false, - ], - ]; - -$foo = [ - 'foo' => [ - 'bar1' => 1, - 'bar2' => 1, - 'bar3' => 1, - 'bar4' => 1, - 'bar5' => 1, - ], - ]; - -$foo = [ - '1' => $row['status'] === 'rejected' - ? self::REJECTED_CODE - : self::VERIFIED_CODE, - '2' => in_array($row['status'], ['notverified', 'unverified'], true) - ? self::STATUS_PENDING - : self::STATUS_VERIFIED, - '3' => strtotime($row['date']), - ]; - - -$foo = foo( - [ - // comment - ] -); - -$foo = [ - << lorem( - 1 - ), - 2 => 2, -]; - -$foo = [ - 'тип' => 'авто', - 'цвет' => 'синий', - ]; - -$paths = [ - Init::ROOT_DIR.'/тип' => 'авто', - Init::ROOT_DIR.'/цвет' => 'синий', - ]; - -$foo = [<< fn() => return 1, - 'bb' => fn() => return 2, - 'ccc' => ( true ) ? - fn() => return 1 : - fn() => return 2, - ]; - -$array = [ - 1 => '1', - 2 => fn ($x) => yield 'a' => $x, - 3 => '3', - ]; - -$foo = [ - $this->fn => 'value', - $foo->fn => 'value', - ]; - -[ - $a, - $b, - $c, -]; - -[ - 'a' => $a, - 'b' => $b, - 'c' => $c, -]; - -[ - static function() { - return null; - }, - (array) [], - (bool) [], - (double) [], - (int) [], - (object) [], - (string) [], - (unset) [], -]; - -[ - 'foo', - 'bar' - // This is a non-fixable error. - , -]; - -yield [ - static fn () : string => '', - ]; - -yield [ - static fn () : string => '', - ]; - -// Intentional syntax error. -$a = [ - 'a' => - ]; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.php deleted file mode 100644 index 15ce074..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.php +++ /dev/null @@ -1,236 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Arrays; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ArrayDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'ArrayDeclarationUnitTest.1.inc': - return [ - 2 => 1, - 8 => 2, - 10 => 2, - 22 => 1, - 23 => 2, - 24 => 2, - 25 => 1, - 31 => 2, - 35 => 1, - 36 => 2, - 41 => 1, - 46 => 1, - 47 => 1, - 50 => 1, - 51 => 1, - 53 => 1, - 56 => 1, - 58 => 1, - 61 => 1, - 62 => 1, - 63 => 1, - 64 => 1, - 65 => 1, - 66 => 3, - 70 => 1, - 76 => 2, - 77 => 1, - 78 => 7, - 79 => 2, - 81 => 2, - 82 => 4, - 87 => 1, - 88 => 1, - 92 => 1, - 97 => 1, - 100 => 1, - 101 => 1, - 102 => 1, - 105 => 1, - 106 => 1, - 107 => 1, - 125 => 1, - 126 => 1, - 141 => 1, - 144 => 1, - 146 => 1, - 148 => 1, - 151 => 1, - 157 => 1, - 173 => 1, - 174 => 3, - 179 => 1, - 182 => 1, - 188 => 1, - 207 => 1, - 212 => 2, - 214 => 1, - 218 => 2, - 219 => 2, - 223 => 1, - 255 => 1, - 294 => 1, - 295 => 1, - 296 => 1, - 311 => 1, - 317 => 1, - 339 => 2, - 348 => 2, - 352 => 2, - 355 => 3, - 358 => 3, - 359 => 2, - 360 => 1, - 362 => 1, - 363 => 2, - 364 => 1, - 365 => 2, - 366 => 2, - 367 => 2, - 368 => 2, - 369 => 1, - 370 => 1, - 383 => 1, - 394 => 1, - 400 => 1, - 406 => 1, - 441 => 1, - 444 => 2, - 445 => 2, - 447 => 2, - 448 => 3, - 467 => 1, - 471 => 1, - 472 => 1, - ]; - case 'ArrayDeclarationUnitTest.2.inc': - return [ - 2 => 1, - 10 => 1, - 23 => 2, - 24 => 2, - 25 => 1, - 31 => 2, - 36 => 2, - 41 => 1, - 46 => 1, - 47 => 1, - 51 => 1, - 53 => 1, - 56 => 1, - 61 => 1, - 63 => 1, - 64 => 1, - 65 => 1, - 66 => 2, - 70 => 1, - 76 => 1, - 77 => 1, - 78 => 7, - 79 => 2, - 81 => 2, - 82 => 4, - 87 => 1, - 88 => 1, - 92 => 1, - 97 => 1, - 100 => 1, - 101 => 1, - 102 => 1, - 105 => 1, - 106 => 1, - 107 => 1, - 125 => 1, - 126 => 1, - 141 => 1, - 144 => 1, - 146 => 1, - 148 => 1, - 151 => 1, - 157 => 1, - 173 => 1, - 174 => 3, - 179 => 1, - 190 => 1, - 191 => 1, - 192 => 1, - 207 => 1, - 210 => 1, - 211 => 1, - 215 => 1, - 247 => 1, - 286 => 1, - 287 => 1, - 288 => 1, - 303 => 1, - 309 => 1, - 331 => 2, - 345 => 3, - 348 => 3, - 349 => 2, - 350 => 1, - 352 => 2, - 353 => 2, - 354 => 2, - 355 => 2, - 356 => 2, - 357 => 1, - 358 => 1, - 372 => 1, - 383 => 1, - 389 => 1, - 395 => 1, - 430 => 1, - 433 => 2, - 434 => 2, - 436 => 2, - 437 => 3, - 456 => 1, - 460 => 1, - 461 => 1, - ]; - default: - return []; - }//end switch - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionClosingBraceSpaceUnitTest.css b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionClosingBraceSpaceUnitTest.css deleted file mode 100644 index 39abce2..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionClosingBraceSpaceUnitTest.css +++ /dev/null @@ -1,81 +0,0 @@ -.my-style { -} - - -.my-style { -} - -/* Comment */ - -.my-style { -} - - -/* Comment */ - -.my-style { - float: left; - -} - -.AssetLineageWidgetType-item { - color: #CCC; -} - -/*.AssetLineageWidgetType-item2 .selected, -.AssetLineageWidgetType-item .selected { -}*/ - -.AssetLineageWidgetType-item.selected { -} - -@media screen and (max-device-width: 769px) { - - header #logo img { - max-width: 100%; - } - -} - -@media screen and (max-device-width: 769px) { - - header #logo img { - max-width: 100%; - } -} - -.GUITextBox.container:after {} - -@media screen and (max-device-width: 769px) { - .no-blank-line-after { - } - .no-blank-line-after-second-def { - } .my-style { - } - - .no-blank-line-and-trailing-comment { - } /* end long class */ - .too-many-blank-lines-and-trailing-comment-extra-whitespace-after-brace { - } /* end long class */ - - - - .has-blank-line-and-trailing-comment { - } /* end long class */ - - .no-blank-line-and-annotation { - } /* phpcs:ignore Standard.Cat.SniffName -- for reasons */ - .too-many-blank-lines-annotation { - } /* phpcs:ignore Standard.Cat.SniffName -- for reasons */ - - - - .has-blank-line-and-annotation { - } /* phpcs:ignore Standard.Cat.SniffName -- for reasons */ - -} - -@media screen and (max-device-width: 769px) { - - header #logo img { - max-width: 100%;}} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionClosingBraceSpaceUnitTest.css.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionClosingBraceSpaceUnitTest.css.fixed deleted file mode 100644 index ca77e83..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionClosingBraceSpaceUnitTest.css.fixed +++ /dev/null @@ -1,85 +0,0 @@ -.my-style { -} - -.my-style { -} - -/* Comment */ - -.my-style { -} - -/* Comment */ - -.my-style { - float: left; - -} - -.AssetLineageWidgetType-item { - color: #CCC; -} - -/*.AssetLineageWidgetType-item2 .selected, -.AssetLineageWidgetType-item .selected { -}*/ - -.AssetLineageWidgetType-item.selected { -} - -@media screen and (max-device-width: 769px) { - - header #logo img { - max-width: 100%; - } - -} - -@media screen and (max-device-width: 769px) { - - header #logo img { - max-width: 100%; - } - -} - -.GUITextBox.container:after { -} - -@media screen and (max-device-width: 769px) { - .no-blank-line-after { - } - - .no-blank-line-after-second-def { - } - -.my-style { - } - - .no-blank-line-and-trailing-comment { - } /* end long class */ - - .too-many-blank-lines-and-trailing-comment-extra-whitespace-after-brace { - } /* end long class */ - - .has-blank-line-and-trailing-comment { - } /* end long class */ - - .no-blank-line-and-annotation { - } /* phpcs:ignore Standard.Cat.SniffName -- for reasons */ - - .too-many-blank-lines-annotation { - } /* phpcs:ignore Standard.Cat.SniffName -- for reasons */ - - .has-blank-line-and-annotation { - } /* phpcs:ignore Standard.Cat.SniffName -- for reasons */ - -} - -@media screen and (max-device-width: 769px) { - - header #logo img { - max-width: 100%; -} - -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionClosingBraceSpaceUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionClosingBraceSpaceUnitTest.php deleted file mode 100644 index 528fcfd..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionClosingBraceSpaceUnitTest.php +++ /dev/null @@ -1,60 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ClassDefinitionClosingBraceSpaceUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 2 => 1, - 11 => 1, - 44 => 1, - 47 => 1, - 51 => 1, - 53 => 1, - 57 => 1, - 59 => 1, - 67 => 1, - 69 => 1, - 81 => 2, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionNameSpacingUnitTest.css b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionNameSpacingUnitTest.css deleted file mode 100644 index 6496cb8..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionNameSpacingUnitTest.css +++ /dev/null @@ -1,66 +0,0 @@ -.AssetListingEditWidgetType-BottomPanel select, -#EditEditingModeWidgetType-assetEditor-filters-assetTypes-addNew { - float: left; -} - -.AssetListingEditWidgetType-BottomPanel select, - -#EditEditingModeWidgetType-assetEditor-filters-assetTypes-addNew { - float: left; -} - -.AssetListingEditWidgetType-BottomPanel select, -/*.AssetListingEditWidgetType-BottomPanel ul,*/ -#EditEditingModeWidgetType-assetEditor-filters-assetTypes-addNew { - float: left; -} - -.AssetListingEditWidgetType-BottomPanel select, - -.AssetListingEditWidgetType-BottomPanel ul, -#EditEditingModeWidgetType-assetEditor-filters-assetTypes-addNew { - float: left; -} - -#SuperUsersSystemConfigScreen-table { - display: block; - left: 50%; - margin-left: -500px; - margin-top: 180px; - position: relative; - width: 1000px; -} - -/** - * More styles below here. - */ - -td.TableWidgetType-header.TableWidgetType-header-lastLogin, -td.TableWidgetType-header.TableWidgetType-header-remove, -td.TableWidgetType-header.TableWidgetType-header-email, -td.TableWidgetType-header.TableWidgetType-header-userName { - background: url(images/ScreenImages/table_header_bg.png) repeat-x; - border-top: 1px solid #D4D4D4; - color: #787878; - height: 33px; - padding-left: 12px; - width: 150px; -} - -@media screen and (max-device-width: 769px) { - - header #logo img { - max-width: 100%; - padding: 20px; - margin: 40px; - } -} - -.foo -{ - border: none; -} - -/* Live coding. Has to be the last test in the file. */ -.intentional-parse-error { - float: left diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionNameSpacingUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionNameSpacingUnitTest.php deleted file mode 100644 index 41202bc..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionNameSpacingUnitTest.php +++ /dev/null @@ -1,51 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ClassDefinitionNameSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 7 => 1, - 19 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.css b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.css deleted file mode 100644 index 98c8fa5..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.css +++ /dev/null @@ -1,108 +0,0 @@ -.HelpWidgetType-new-bug-title { - float: left; -} -.HelpWidgetType-new-bug-title { - float: left; -} -.HelpWidgetType-new-bug-title { - float: left; -} -.HelpWidgetType-new-bug-title{ - float: left; -} -.HelpWidgetType-new-bug-title { - - float: left; -} - -@media screen and (max-device-width: 769px) { - - header #logo img { - max-width: 100%; - } - -} - -@media screen and (max-device-width: 769px) { - header #logo img { - max-width: 100%; - } - -} - -@media screen and (max-device-width: 769px) { - - - - header #logo img { - max-width: 100%; - } - -} - -.GUITextBox.container:after {} - -.single-line {float: left;} - -#opening-brace-on-different-line - - -{ - color: #FFFFFF; -} - -#opening-brace-on-different-line-and-inline-style - - -{color: #FFFFFF;} - -@media screen and (max-device-width: 769px) { .everything-on-one-line { float: left; } } - -/* Document handling of comments in various places */ -.no-space-before-opening-with-comment /* comment*/{ - float: left; -} - -.space-before-opening-with-comment-on-next-line -/* comment*/ { - float: left; -} - -#opening-brace-on-different-line-with-comment-between -/*comment*/ -{ - padding: 0; -} - -.single-line-with-comment { /* comment*/ float: left; } - -.multi-line-with-trailing-comment { /* comment*/ - float: left; -} - - -@media screen and (max-device-width: 769px) { - /*comment*/ - .comment-line-after-nesting-class-opening { - } -} - -@media screen and (max-device-width: 769px) { - - /*comment*/ - .blank-line-and-comment-line-after-nesting-class-opening { - } -} - -@media screen and (max-device-width: 769px) { - - - - /* phpcs:ignore Standard.Category.Sniffname -- for reasons */ - .blank-line-and-annotation-after-nesting-class-opening { - } -} - -/* Live coding. Has to be the last test in the file. */ -.intentional-parse-error { - float: left diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.css.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.css.fixed deleted file mode 100644 index b3f48a5..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.css.fixed +++ /dev/null @@ -1,106 +0,0 @@ -.HelpWidgetType-new-bug-title { - float: left; -} -.HelpWidgetType-new-bug-title { - float: left; -} -.HelpWidgetType-new-bug-title { - float: left; -} -.HelpWidgetType-new-bug-title { - float: left; -} -.HelpWidgetType-new-bug-title { - - float: left; -} - -@media screen and (max-device-width: 769px) { - - header #logo img { - max-width: 100%; - } - -} - -@media screen and (max-device-width: 769px) { - - header #logo img { - max-width: 100%; - } - -} - -@media screen and (max-device-width: 769px) { - - header #logo img { - max-width: 100%; - } - -} - -.GUITextBox.container:after { -} - -.single-line { -float: left;} - -#opening-brace-on-different-line { - color: #FFFFFF; -} - -#opening-brace-on-different-line-and-inline-style { -color: #FFFFFF;} - -@media screen and (max-device-width: 769px) { - -.everything-on-one-line { -float: left; } } - -/* Document handling of comments in various places */ -.no-space-before-opening-with-comment /* comment*/ { - float: left; -} - -.space-before-opening-with-comment-on-next-line -/* comment*/ { - float: left; -} - -#opening-brace-on-different-line-with-comment-between -/*comment*/ { - padding: 0; -} - -.single-line-with-comment { -/* comment*/ float: left; } - -.multi-line-with-trailing-comment { /* comment*/ - float: left; -} - - -@media screen and (max-device-width: 769px) { - - /*comment*/ - .comment-line-after-nesting-class-opening { - } -} - -@media screen and (max-device-width: 769px) { - - /*comment*/ - .blank-line-and-comment-line-after-nesting-class-opening { - } -} - -@media screen and (max-device-width: 769px) { - - /* phpcs:ignore Standard.Category.Sniffname -- for reasons */ - .blank-line-and-annotation-after-nesting-class-opening { - } -} - -/* Live coding. Has to be the last test in the file. */ -.intentional-parse-error { - float: left diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.php deleted file mode 100644 index d1e4421..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.php +++ /dev/null @@ -1,64 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ClassDefinitionOpeningBraceSpaceUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 4 => 1, - 7 => 1, - 10 => 1, - 26 => 1, - 33 => 1, - 43 => 1, - 45 => 1, - 50 => 1, - 57 => 2, - 59 => 2, - 62 => 1, - 73 => 1, - 77 => 1, - 84 => 1, - 97 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColonSpacingUnitTest.css b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColonSpacingUnitTest.css deleted file mode 100644 index 391bc85..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColonSpacingUnitTest.css +++ /dev/null @@ -1,42 +0,0 @@ -body { -font-family: Arial, Helvetica, sans-serif; -margin : 40px 0 0 0; -padding : 0; -background: #8FB7DB url(diag_lines_bg.gif) top left; -margin-top: -10px; -margin-bottom: -0px; -} - -.TableWidgetType .recover:hover { - background-color: #FFF; -} - -#clearCache-settings:rootNodes-list_0 { - border-top: none; -} - -.LookupEditScreenWidgetType-urls a, .LookupEditScreenWidgetType-urls a:visited { - text-decoration: none; - color: #444; -} - -/* checking embedded PHP */ -li { - background:url(/images//bullet.gif) left px no-repeat; - margin:0px; - padding-left:10px; - margin-bottom:px; - margin-top: px; - line-height:13px; - filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#2e62a8, endColorstr=#123363); -} - -/* Empty style defs. */ -.p { - margin:; - margin-right: - margin-left: 10px; - float:/* Some comment. */ ; -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColonSpacingUnitTest.css.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColonSpacingUnitTest.css.fixed deleted file mode 100644 index e68bddc..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColonSpacingUnitTest.css.fixed +++ /dev/null @@ -1,40 +0,0 @@ -body { -font-family: Arial, Helvetica, sans-serif; -margin: 40px 0 0 0; -padding: 0; -background: #8FB7DB url(diag_lines_bg.gif) top left; -margin-top: 10px; -margin-bottom: 0px; -} - -.TableWidgetType .recover:hover { - background-color: #FFF; -} - -#clearCache-settings:rootNodes-list_0 { - border-top: none; -} - -.LookupEditScreenWidgetType-urls a, .LookupEditScreenWidgetType-urls a:visited { - text-decoration: none; - color: #444; -} - -/* checking embedded PHP */ -li { - background: url(/images//bullet.gif) left px no-repeat; - margin: 0px; - padding-left: 10px; - margin-bottom: px; - margin-top: px; - line-height: 13px; - filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#2e62a8, endColorstr=#123363); -} - -/* Empty style defs. */ -.p { - margin:; - margin-right: - margin-left: 10px; - float: /* Some comment. */ ; -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColonSpacingUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColonSpacingUnitTest.php deleted file mode 100644 index 9b8aa10..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColonSpacingUnitTest.php +++ /dev/null @@ -1,60 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ColonSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 3 => 1, - 4 => 2, - 5 => 1, - 6 => 1, - 8 => 1, - 27 => 1, - 28 => 1, - 29 => 1, - 30 => 1, - 32 => 1, - 41 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColourDefinitionUnitTest.css b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColourDefinitionUnitTest.css deleted file mode 100644 index 2dfd22a..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColourDefinitionUnitTest.css +++ /dev/null @@ -1,16 +0,0 @@ -#title-bar-bottom-right { - background-color: #333333; - padding: 10px; - border-bottom: 1px dotted #F0F0F0; - border-top: 1px dotted #FF00FF; - background: #08f7db url(diag_lines_bg.gif) top left; - - /* The sniff only deals with HEX colours. */ - color: DarkSlateGray; - background-color: rgb(255, 0, 0); - background-color: rgba(0, 0, 255, 0.3); - background-color: hsl(120, 100%, 50%); -} - -#add-new-comment { -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColourDefinitionUnitTest.css.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColourDefinitionUnitTest.css.fixed deleted file mode 100644 index 039209d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColourDefinitionUnitTest.css.fixed +++ /dev/null @@ -1,16 +0,0 @@ -#title-bar-bottom-right { - background-color: #333; - padding: 10px; - border-bottom: 1px dotted #F0F0F0; - border-top: 1px dotted #F0F; - background: #08F7DB url(diag_lines_bg.gif) top left; - - /* The sniff only deals with HEX colours. */ - color: DarkSlateGray; - background-color: rgb(255, 0, 0); - background-color: rgba(0, 0, 255, 0.3); - background-color: hsl(120, 100%, 50%); -} - -#add-new-comment { -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColourDefinitionUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColourDefinitionUnitTest.php deleted file mode 100644 index d535fdc..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColourDefinitionUnitTest.php +++ /dev/null @@ -1,52 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ColourDefinitionUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 2 => 1, - 5 => 1, - 6 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DisallowMultipleStyleDefinitionsUnitTest.css b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DisallowMultipleStyleDefinitionsUnitTest.css deleted file mode 100644 index 4c11bea..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DisallowMultipleStyleDefinitionsUnitTest.css +++ /dev/null @@ -1,17 +0,0 @@ -.SettingsTabPaneWidgetType-tab-mid { - background: transparent url(tab_inact_mid.png) repeat-x; - height: 100%;float: left; - line-height: -25px; - cursor: pointer; margin: 10px; float: right; -} - -/* testing embedded PHP */ -li { - background:url(/images//bullet.gif) left px no-repeat; margin:0px; padding-left:10px; margin-bottom:px; line-height:13px; - filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#2e62a8, endColorstr=#123363); -} - -/* Document handling of comments and annotations. */ -div#annotations {-webkit-tap-highlight-color:transparent;/* phpcs:disable Standard.Cat.SniffName */-webkit-touch-callout:none;/*phpcs:enable*/-webkit-user-select:none;} - -div#comments {height:100%;/*comment*/width:100%;} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DisallowMultipleStyleDefinitionsUnitTest.css.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DisallowMultipleStyleDefinitionsUnitTest.css.fixed deleted file mode 100644 index 93a7815..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DisallowMultipleStyleDefinitionsUnitTest.css.fixed +++ /dev/null @@ -1,27 +0,0 @@ -.SettingsTabPaneWidgetType-tab-mid { - background: transparent url(tab_inact_mid.png) repeat-x; - height: 100%; -float: left; - line-height: -25px; - cursor: pointer; -margin: 10px; -float: right; -} - -/* testing embedded PHP */ -li { - background:url(/images//bullet.gif) left px no-repeat; -margin:0px; -padding-left:10px; -margin-bottom:px; -line-height:13px; - filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#2e62a8, endColorstr=#123363); -} - -/* Document handling of comments and annotations. */ -div#annotations {-webkit-tap-highlight-color:transparent;/* phpcs:disable Standard.Cat.SniffName */ --webkit-touch-callout:none;/*phpcs:enable*/ --webkit-user-select:none;} - -div#comments {height:100%;/*comment*/ -width:100%;} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DisallowMultipleStyleDefinitionsUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DisallowMultipleStyleDefinitionsUnitTest.php deleted file mode 100644 index 8e3b487..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DisallowMultipleStyleDefinitionsUnitTest.php +++ /dev/null @@ -1,54 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class DisallowMultipleStyleDefinitionsUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 3 => 1, - 5 => 2, - 10 => 4, - 15 => 2, - 17 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateClassDefinitionUnitTest.css b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateClassDefinitionUnitTest.css deleted file mode 100644 index 8ac9501..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateClassDefinitionUnitTest.css +++ /dev/null @@ -1,103 +0,0 @@ -.AssetLineageWidgetType-item { - color: #FFF; -} - -.AssetLineageWidgetType-title { - color: #CCC; -} - -.AssetLineageWidgetType-item { - color: #CCC; -} - -.AssetLineageWidgetType-item .selected { -} - -.AssetLineageWidgetType-item.selected { -} - -#Blah .AssetLineageWidgetType-item { -} - -#X.selected, -.AssetLineageWidgetType-item { -} - -.MyClass, .YourClass { -} - -.YourClass, .MyClass { -} - -.YourClass, .MyClass, .OurClass { -} - - -.ClassAtTopOfMediaBlock { -} - -@media print { - .ClassAtTopOfMediaBlock { - } - - .ClassInMultipleMediaBlocks { - } -} - -.ClassNotAtTopOfMediaBlock { -} - -@media handheld { - .SameClassInMediaBlock { - } - - .ClassNotAtTopOfMediaBlock { - } - - .SameClassInMediaBlock { - } -} - -@media braille { - .PlaceholderClass { - } - - .ClassNotAtTopOfMediaBlock { - } - - .ClassInMultipleMediaBlocks { - } -} - -.foo /* any comment */ -{ color: red; } - -/* print comment */ -@media print { - /* comment1 */ - td { - } - - /* comment2 */ - img { - } - - /* comment3 */ - td { - } -} - -@media handheld /* handheld comment */ -{ - td /* comment1 */ - { - } - - img /* comment2 */ - { - } - - td /* comment3 */ - { - } -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateClassDefinitionUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateClassDefinitionUnitTest.php deleted file mode 100644 index 2a95971..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateClassDefinitionUnitTest.php +++ /dev/null @@ -1,54 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class DuplicateClassDefinitionUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 9 => 1, - 29 => 1, - 57 => 1, - 86 => 1, - 101 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateStyleDefinitionUnitTest.css b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateStyleDefinitionUnitTest.css deleted file mode 100644 index c9c849f..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateStyleDefinitionUnitTest.css +++ /dev/null @@ -1,27 +0,0 @@ -.ViperSubToolbar-wrapper { - height: 34px; - left: 0; - position: fixed; - top: 60px; - z-index: 997; - left: 50%; -} - -.expandable { - -moz-transition-property: margin-left, margin-right; - -moz-transition-duration: 0.2s; - -moz-transition-timing-function: ease; - -webkit-transition-property: margin-left, margin-right; - -webkit-transition-duration: 0.2s; - -webkit-transition-timing-function: ease; - z-index: 2; -} - -@media only screen and (max-width: 480px) { - header nav.meta a { display: none; } - header nav.meta a.search { display: block; } -} - -/* Live coding. Has to be the last test in the file. */ -.intentional-parse-error { - float: left diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateStyleDefinitionUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateStyleDefinitionUnitTest.php deleted file mode 100644 index c555461..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateStyleDefinitionUnitTest.php +++ /dev/null @@ -1,48 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class DuplicateStyleDefinitionUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [7 => 1]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyClassDefinitionUnitTest.css b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyClassDefinitionUnitTest.css deleted file mode 100644 index 801dcda..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyClassDefinitionUnitTest.css +++ /dev/null @@ -1,15 +0,0 @@ -.HelpWidgetType-new-bug-title {} -.HelpWidgetType-new-bug-title { -} -.HelpWidgetType-new-bug-title { - -} -.HelpWidgetType-new-bug-title { - -} -.HelpWidgetType-new-bug-title { - /* Nothing to see here */ -} -.HelpWidgetType-new-bug-title { - float: left; -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyClassDefinitionUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyClassDefinitionUnitTest.php deleted file mode 100644 index b3fd318..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyClassDefinitionUnitTest.php +++ /dev/null @@ -1,54 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class EmptyClassDefinitionUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 1 => 1, - 2 => 1, - 4 => 1, - 7 => 1, - 10 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyStyleDefinitionUnitTest.css b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyStyleDefinitionUnitTest.css deleted file mode 100644 index 24910b7..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyStyleDefinitionUnitTest.css +++ /dev/null @@ -1,11 +0,0 @@ -#MetadataAdminScreen-addField-fieldType { - margin-left: 10px; - margin-right: - float: ; -} - -#MetadataAdminScreen-addField-fieldType li { - margin-right: /* @todo */ - margin-left: 10px; - float: /* Some comment. */ ; -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyStyleDefinitionUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyStyleDefinitionUnitTest.php deleted file mode 100644 index f5bc858..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyStyleDefinitionUnitTest.php +++ /dev/null @@ -1,53 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class EmptyStyleDefinitionUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 3 => 1, - 4 => 1, - 8 => 1, - 10 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ForbiddenStylesUnitTest.css b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ForbiddenStylesUnitTest.css deleted file mode 100644 index dbd5487..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ForbiddenStylesUnitTest.css +++ /dev/null @@ -1,18 +0,0 @@ -#add-new-comment { - -moz-border-radius: 1px; - -webkit-border-radius: 1px; - border-radius: 1px; - - -moz-border-radius-topleft: 1px; - -moz-border-radius-topright: 1px; - -moz-border-radius-bottomright: 1px; - -moz-border-radius-bottomleft: 1px; - border-top-left-radius: 1px; - border-top-right-radius: 1px; - border-bottom-right-radius: 1px; - border-bottom-left-radius: 1px; - - -moz-box-shadow: 1px; - -webkit-box-shadow: 1px; - box-shadow: 1px; -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ForbiddenStylesUnitTest.css.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ForbiddenStylesUnitTest.css.fixed deleted file mode 100644 index a8ea270..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ForbiddenStylesUnitTest.css.fixed +++ /dev/null @@ -1,18 +0,0 @@ -#add-new-comment { - border-radius: 1px; - border-radius: 1px; - border-radius: 1px; - - border-top-left-radius: 1px; - border-top-right-radius: 1px; - border-bottom-right-radius: 1px; - border-bottom-left-radius: 1px; - border-top-left-radius: 1px; - border-top-right-radius: 1px; - border-bottom-right-radius: 1px; - border-bottom-left-radius: 1px; - - box-shadow: 1px; - box-shadow: 1px; - box-shadow: 1px; -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ForbiddenStylesUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ForbiddenStylesUnitTest.php deleted file mode 100644 index 28aa8ec..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ForbiddenStylesUnitTest.php +++ /dev/null @@ -1,57 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ForbiddenStylesUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 2 => 1, - 3 => 1, - 6 => 1, - 7 => 1, - 8 => 1, - 9 => 1, - 15 => 1, - 16 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.1.css b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.1.css deleted file mode 100644 index 216f00e..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.1.css +++ /dev/null @@ -1,79 +0,0 @@ -body { - - font-family: Arial, Helvetica, sans-serif; - margin: 40px 0 0 0; -padding: 0; - background: #8FB7DB url(diag_lines_bg.gif) top left; - -} - -td { - margin: 40px; - - padding: 20px; -} - -/* -#AdminScreenModeWidgetType-tab_pane-containers .TabPaneWidgetType-tab-selected-left { - background: transparent url(images/ScreenImages/tab_on_left.png) no-repeat; -} -#AdminScreenModeWidgetType-tab_pane-containers .TabPaneWidgetType-tab-selected-right { - background: transparent url(images/ScreenImages/tab_on_right.png) no-repeat; -} -*/ - -.GUITextBox.container:after {} - -@media screen and (max-device-width: 769px) { - - header #logo img { - max-width: 100%; - padding: 20px; - margin: 40px; - } -} - -@media screen and (max-device-width: 769px) { - - header #logo img { - max-width: 100%; - } - - header #logo img { - min-width: 100%; - } - -} - -td { - margin: 40px; - - padding: 20px; - - -} - -.GUIFileUpload { -/* opacity: 0.25; */ -} - -.foo -{ - border: none; -} - -.mortgage-calculator h2 { - background: #072237; - color: #fff; - font-weight: normal; - height: 50px; - line-height: 50px; - padding: 0 0 0 30px; - } - -.WhitelistCommentIndentationShouldBeIgnored { -/* phpcs:disable Standard.Category.Sniff -- for reasons. */ -} - -/* syntax error */ ---------------------------------------------- */ diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.1.css.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.1.css.fixed deleted file mode 100644 index 1fd128a..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.1.css.fixed +++ /dev/null @@ -1,73 +0,0 @@ -body { - font-family: Arial, Helvetica, sans-serif; - margin: 40px 0 0 0; - padding: 0; - background: #8FB7DB url(diag_lines_bg.gif) top left; -} - -td { - margin: 40px; - padding: 20px; -} - -/* -#AdminScreenModeWidgetType-tab_pane-containers .TabPaneWidgetType-tab-selected-left { - background: transparent url(images/ScreenImages/tab_on_left.png) no-repeat; -} -#AdminScreenModeWidgetType-tab_pane-containers .TabPaneWidgetType-tab-selected-right { - background: transparent url(images/ScreenImages/tab_on_right.png) no-repeat; -} -*/ - -.GUITextBox.container:after {} - -@media screen and (max-device-width: 769px) { - - header #logo img { - max-width: 100%; - padding: 20px; - margin: 40px; - } -} - -@media screen and (max-device-width: 769px) { - - header #logo img { - max-width: 100%; - } - - header #logo img { - min-width: 100%; - } - -} - -td { - margin: 40px; - padding: 20px; -} - -.GUIFileUpload { -/* opacity: 0.25; */ -} - -.foo -{ - border: none; -} - -.mortgage-calculator h2 { - background: #072237; - color: #fff; - font-weight: normal; - height: 50px; - line-height: 50px; - padding: 0 0 0 30px; -} - -.WhitelistCommentIndentationShouldBeIgnored { -/* phpcs:disable Standard.Category.Sniff -- for reasons. */ -} - -/* syntax error */ ---------------------------------------------- */ diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.2.css b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.2.css deleted file mode 100644 index 48b22f6..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.2.css +++ /dev/null @@ -1,3 +0,0 @@ -/* Live coding. Has to be the last (only) test in the file. */ -.intentional-parse-error { - float: left diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.php deleted file mode 100644 index 9413b4f..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.php +++ /dev/null @@ -1,75 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class IndentationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'IndentationUnitTest.1.css': - return [ - 2 => 1, - 3 => 1, - 5 => 1, - 6 => 1, - 7 => 1, - 12 => 1, - 30 => 1, - 32 => 1, - 50 => 1, - 52 => 1, - 53 => 1, - 66 => 1, - 67 => 1, - 68 => 1, - 69 => 1, - 70 => 1, - 71 => 1, - 72 => 1, - ]; - - default: - return []; - }//end switch - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/LowercaseStyleDefinitionUnitTest.css b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/LowercaseStyleDefinitionUnitTest.css deleted file mode 100644 index d0f2982..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/LowercaseStyleDefinitionUnitTest.css +++ /dev/null @@ -1,14 +0,0 @@ -.SettingsTabPaneWidgetType-tab-mid { - font-family: Arial; - Font-Family: arial; - background-color: #DA9393; - BACKGROUND-IMAGE: URL(Warning_Close.png); -} - -@media screen and (max-device-width: 769px) { - - .SettingsTabPaneWidgetType-tab-mid { - Font-Family: arial; - filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#2e62a8, endColorstr=#123363); - } -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/LowercaseStyleDefinitionUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/LowercaseStyleDefinitionUnitTest.php deleted file mode 100644 index 1a25aaa..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/LowercaseStyleDefinitionUnitTest.php +++ /dev/null @@ -1,53 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class LowercaseStyleDefinitionUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 2 => 1, - 3 => 1, - 5 => 2, - 11 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/MissingColonUnitTest.css b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/MissingColonUnitTest.css deleted file mode 100644 index 6c947e5..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/MissingColonUnitTest.css +++ /dev/null @@ -1,21 +0,0 @@ -.my-style { - margin-right 15px; - float: left; - margin-left 15px; - margin-top: 15px; - margin-bottom 15px; -} - -@media screen and (max-device-width: 769px) { - header #logo img { - max-width: 100%; - margin-bottom 15px; - } -} - -#foo { background-color: #FF0000; -} - -/* Live coding. Has to be the last test in the file. */ -.intentional-parse-error { - float diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/MissingColonUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/MissingColonUnitTest.php deleted file mode 100644 index dc0809e..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/MissingColonUnitTest.php +++ /dev/null @@ -1,53 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class MissingColonUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 2 => 1, - 4 => 1, - 6 => 1, - 12 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/NamedColoursUnitTest.css b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/NamedColoursUnitTest.css deleted file mode 100644 index 05637a6..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/NamedColoursUnitTest.css +++ /dev/null @@ -1,25 +0,0 @@ -#red { - background-color: red; -} - -.red { - border-bottom: 1px dotted black; - border-top: 1px dotted gray; -} - -#red.yellow { - background: yellow url(diag_lines_bg.gif) top left; - text-shadow: 0 1px 0 white; -} - -.something--white { - border: 0; -} - -.something--------------white { - border: 0; -} - -.-white { - border: 0; -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/NamedColoursUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/NamedColoursUnitTest.php deleted file mode 100644 index a8032fa..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/NamedColoursUnitTest.php +++ /dev/null @@ -1,54 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class NamedColoursUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 2 => 1, - 6 => 1, - 7 => 1, - 11 => 1, - 12 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/OpacityUnitTest.css b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/OpacityUnitTest.css deleted file mode 100644 index c656c78..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/OpacityUnitTest.css +++ /dev/null @@ -1,35 +0,0 @@ -.my-style { - opacity: 0; - opacity: 0.0; - opacity: 1; - opacity: 1.0; - opacity: 1.5; - opacity: .5; - opacity: 0.5; - opacity: 2; - opacity: -1; - opacity: 0.55; -} - -div { - font-size: 1.2em; - background: linear-gradient(to bottom, #00F, #0F0) repeat scroll 50% 50% #EEE; - min-width: 250px; - max-width: 100%; - padding-bottom: 50px; - box-shadow: 2px -3px 3px rgba(100, 100, 100, 0.33); - border-left: 1px solid #000; - border-right: 1px solid #000; - border-top: 1px solid #000; - border-bottom: 1px dotted #000; - background: url(../1/2/3/4-5-6_7_100x100.png) repeat scroll 50% 50% #EEE; - opacity: -1; -} - -.my-commented-style { - opacity: /*comment*/ 0; - opacity: /* phpcs:ignore Standard.Cat.Sniff -- for reasons */ - 0.0; - opacity: /*comment*/ 1.0; - opacity: /*comment*/ .5; -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/OpacityUnitTest.css.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/OpacityUnitTest.css.fixed deleted file mode 100644 index 257e41a..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/OpacityUnitTest.css.fixed +++ /dev/null @@ -1,35 +0,0 @@ -.my-style { - opacity: 0; - opacity: 0; - opacity: 1; - opacity: 1; - opacity: 1.5; - opacity: 0.5; - opacity: 0.5; - opacity: 2; - opacity: -1; - opacity: 0.55; -} - -div { - font-size: 1.2em; - background: linear-gradient(to bottom, #00F, #0F0) repeat scroll 50% 50% #EEE; - min-width: 250px; - max-width: 100%; - padding-bottom: 50px; - box-shadow: 2px -3px 3px rgba(100, 100, 100, 0.33); - border-left: 1px solid #000; - border-right: 1px solid #000; - border-top: 1px solid #000; - border-bottom: 1px dotted #000; - background: url(../1/2/3/4-5-6_7_100x100.png) repeat scroll 50% 50% #EEE; - opacity: -1; -} - -.my-commented-style { - opacity: /*comment*/ 0; - opacity: /* phpcs:ignore Standard.Cat.Sniff -- for reasons */ - 0; - opacity: /*comment*/ 1; - opacity: /*comment*/ 0.5; -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/OpacityUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/OpacityUnitTest.php deleted file mode 100644 index 9fe839d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/OpacityUnitTest.php +++ /dev/null @@ -1,60 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class OpacityUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 3 => 1, - 5 => 1, - 6 => 1, - 7 => 1, - 9 => 1, - 10 => 1, - 11 => 1, - 26 => 1, - 32 => 1, - 33 => 1, - 34 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/SemicolonSpacingUnitTest.css b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/SemicolonSpacingUnitTest.css deleted file mode 100644 index 3ccb162..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/SemicolonSpacingUnitTest.css +++ /dev/null @@ -1,61 +0,0 @@ -.HelpWidgetType-new-bug-title { - width: 308px - float: left; -} - -#MetadataAdminScreen-addField-add { - float: left ; -} - -.TableWidgetType .recover:hover { - background-color: #FFF; -} - -#clearCache-settings:rootNodes-list_0 { - border-top: none; -} - -.HelpWidgetType-list { - list-style-image: url(); -} - -@media (min-width: 320px) and (max-width: 961px) { - .tooltipsrt:hover span.tltp, - .tooltipstp:hover span.tltp { - visibility: hidden; - } -} - -#single-line-multi-statement-no-semicolon { - padding: 0 border: 20; -} - -#multi-line-style-no-semicolon { - padding: 0 /* phpcs:ignore Standard.Cat.Sniff -- for reasons */ - border: - 20 - margin: - 0px /* top */ - 10px /* right + left */ -} - -#multi-line-style-whitespace { - padding: 0 /* phpcs:ignore Standard.Cat.Sniff -- for reasons */ ; - border: - 20 ; - margin: - 10px /* top */ - 0px /* right + left */ - - - ; -} - -.allow-for-star-hack { - cursor: pointer; - *cursor: hand; -} - -/* Live coding. Has to be the last test in the file. */ -.intentional-parse-error { - float: left diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/SemicolonSpacingUnitTest.css.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/SemicolonSpacingUnitTest.css.fixed deleted file mode 100644 index 7efef58..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/SemicolonSpacingUnitTest.css.fixed +++ /dev/null @@ -1,58 +0,0 @@ -.HelpWidgetType-new-bug-title { - width: 308px - float: left; -} - -#MetadataAdminScreen-addField-add { - float: left; -} - -.TableWidgetType .recover:hover { - background-color: #FFF; -} - -#clearCache-settings:rootNodes-list_0 { - border-top: none; -} - -.HelpWidgetType-list { - list-style-image: url(); -} - -@media (min-width: 320px) and (max-width: 961px) { - .tooltipsrt:hover span.tltp, - .tooltipstp:hover span.tltp { - visibility: hidden; - } -} - -#single-line-multi-statement-no-semicolon { - padding: 0 border: 20; -} - -#multi-line-style-no-semicolon { - padding: 0 /* phpcs:ignore Standard.Cat.Sniff -- for reasons */ - border: - 20 - margin: - 0px /* top */ - 10px /* right + left */ -} - -#multi-line-style-whitespace { - padding: 0; /* phpcs:ignore Standard.Cat.Sniff -- for reasons */ - border: - 20; - margin: - 10px /* top */ - 0px; /* right + left */ -} - -.allow-for-star-hack { - cursor: pointer; - *cursor: hand; -} - -/* Live coding. Has to be the last test in the file. */ -.intentional-parse-error { - float: left diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/SemicolonSpacingUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/SemicolonSpacingUnitTest.php deleted file mode 100644 index 897df65..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/SemicolonSpacingUnitTest.php +++ /dev/null @@ -1,58 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class SemicolonSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 2 => 1, - 7 => 1, - 30 => 1, - 34 => 1, - 36 => 1, - 39 => 1, - 43 => 1, - 45 => 1, - 48 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.css b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.css deleted file mode 100644 index cfc4503..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.css +++ /dev/null @@ -1,45 +0,0 @@ -#add-new-comment { - background-color: #333333; - padding: 10px; - border-bottom: 1px dotted #F0F0F0; - border-top: 1px dotted #FF00FF; - background: #8fb7db url(diag_lines_bg.gif) top left; - tab-size: 1; - margin: 8px 8px 8px 8px; - margin: 8px 8px; - margin: 0 0 0 0; - margin: 0 8px 0 8px; - margin: 8px 4px 8px 4px; - margin: 8px 4% 8px 4%; - margin: 6px 2px 9px 2px; - margin: 6px 2px 9px; - border-radius: 2px 2px 2px 2px !important; - border-width: 2px 2px 2px 2px; - border-width: 1px 2px 2px 4px; - margin: 97px auto 0 auto; - text-shadow: 0 1px 0 #fff; - border-width: - 2px - 4px - 2px - 4px; - - /* These are style names excluded from this rule. */ - background-position: 0 0; - box-shadow: 2px 2px 2px 2px; - transform-origin: 0 110% 0; - - /* Sizes with comments between them will be ignored for the purposes of this sniff. */ - margin: 8px /*top*/ 8px /*right*/ 8px /*bottom*/ 8px /*left*/; - - /* Same with PHPCS annotations. */ - border-width: - 2px /* phpcs:ignore Standard.Category.SniffName -- for reasons */ - 4px - 2px /* phpcs:disable Standard.Category.SniffName -- for reasons */ - 4px; -} - -/* Intentional parse error. Live coding resilience. This has to be the last test in the file. */ -#live-coding { - margin: 8px 8px 8px 8px diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.css.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.css.fixed deleted file mode 100644 index 3472cb1..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.css.fixed +++ /dev/null @@ -1,41 +0,0 @@ -#add-new-comment { - background-color: #333333; - padding: 10px; - border-bottom: 1px dotted #F0F0F0; - border-top: 1px dotted #FF00FF; - background: #8fb7db url(diag_lines_bg.gif) top left; - tab-size: 1; - margin: 8px; - margin: 8px; - margin: 0; - margin: 0 8px; - margin: 8px 4px; - margin: 8px 4%; - margin: 6px 2px 9px 2px; - margin: 6px 2px 9px 2px; - border-radius: 2px !important; - border-width: 2px; - border-width: 1px 2px 2px 4px; - margin: 97px auto 0 auto; - text-shadow: 0 1px 0 #fff; - border-width: 2px 4px; - - /* These are style names excluded from this rule. */ - background-position: 0 0; - box-shadow: 2px 2px 2px 2px; - transform-origin: 0 110% 0; - - /* Sizes with comments between them will be ignored for the purposes of this sniff. */ - margin: 8px /*top*/ 8px /*right*/ 8px /*bottom*/ 8px /*left*/; - - /* Same with PHPCS annotations. */ - border-width: - 2px /* phpcs:ignore Standard.Category.SniffName -- for reasons */ - 4px - 2px /* phpcs:disable Standard.Category.SniffName -- for reasons */ - 4px; -} - -/* Intentional parse error. Live coding resilience. This has to be the last test in the file. */ -#live-coding { - margin: 8px 8px 8px 8px diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.php deleted file mode 100644 index 3d0baaa..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.php +++ /dev/null @@ -1,59 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ShorthandSizeUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 8 => 1, - 9 => 1, - 10 => 1, - 11 => 1, - 12 => 1, - 13 => 1, - 15 => 1, - 16 => 1, - 17 => 1, - 21 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassDeclarationUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassDeclarationUnitTest.inc deleted file mode 100644 index 43ef6c9..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassDeclarationUnitTest.inc +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Classes; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ClassDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 5 => 1, - 6 => 1, - 10 => 1, - 15 => 2, - 18 => 1, - 22 => 4, - 23 => 4, - 24 => 4, - 27 => 2, - 30 => 2, - 34 => 1, - 35 => 1, - 39 => 1, - 42 => 1, - 45 => 1, - 48 => 1, - 50 => 2, - 51 => 1, - 55 => 1, - 59 => 4, - 63 => 1, - 65 => 1, - 69 => 3, - 74 => 2, - 77 => 1, - 80 => 1, - 85 => 3, - 89 => 1, - 92 => 1, - 97 => 1, - 108 => 1, - 114 => 1, - 116 => 1, - 118 => 1, - 121 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassFileNameUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassFileNameUnitTest.inc deleted file mode 100644 index a346a00..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassFileNameUnitTest.inc +++ /dev/null @@ -1,37 +0,0 @@ - \ No newline at end of file diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassFileNameUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassFileNameUnitTest.php deleted file mode 100644 index b229a2f..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassFileNameUnitTest.php +++ /dev/null @@ -1,70 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Classes; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ClassFileNameUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 11 => 1, - 12 => 1, - 13 => 1, - 14 => 1, - 15 => 1, - 16 => 1, - 17 => 1, - 18 => 1, - 19 => 1, - 23 => 1, - 24 => 1, - 25 => 1, - 26 => 1, - 27 => 1, - 28 => 1, - 29 => 1, - 30 => 1, - 31 => 1, - 32 => 1, - 33 => 1, - 34 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/DuplicatePropertyUnitTest.js b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/DuplicatePropertyUnitTest.js deleted file mode 100644 index 04126f8..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/DuplicatePropertyUnitTest.js +++ /dev/null @@ -1,45 +0,0 @@ -var x = { - abc: 1, - zyz: 2, - abc: 5, - mno: { - abc: 4 - }, - abc: 5 - - this.request({ - action: 'getSubmissions' - }); - - this.request({ - action: 'deleteSubmission' - }); -} - - -LinkingEditScreenWidgetType.prototype = { - - _addDeleteButtonEvent: function(parentid) - { - var params = { - screen: 'LinkingEditScreenWidget', - assetid: self.assetid, - parentid: parentid, - assetid: parentid, - op: 'deleteLink' - }; - - }, - - saveDesignEdit: function() - { - var params = { - screen: [this.id, 'Widget'].join(''), - assetid: this.assetid, - changes: dfx.jsonEncode(this.currnetLinksWdgt.getChanges()), - op: 'saveLinkEdit' - }; - - } - -}; \ No newline at end of file diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/DuplicatePropertyUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/DuplicatePropertyUnitTest.php deleted file mode 100644 index 1b71eb2..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/DuplicatePropertyUnitTest.php +++ /dev/null @@ -1,52 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Classes; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class DuplicatePropertyUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 4 => 1, - 8 => 1, - 28 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.inc deleted file mode 100644 index 511bbe4..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.inc +++ /dev/null @@ -1,13 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Classes; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class LowercaseClassKeywordsUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - $errors = [ - 2 => 3, - 3 => 3, - 4 => 1, - 5 => 1, - 9 => 1, - 10 => 1, - 13 => 1, - ]; - - return $errors; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/SelfMemberReferenceUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/SelfMemberReferenceUnitTest.inc deleted file mode 100644 index 0a0729a..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/SelfMemberReferenceUnitTest.inc +++ /dev/null @@ -1,174 +0,0 @@ -testResults; - - - // Correct call to self. - $testResults[] = self::selfMemberReferenceUnitTestFunction(); - $testResults[] = parent::selfMemberReferenceUnitTestFunction(); - - // Incorrect case. - $testResults[] = Self::selfMemberReferenceUnitTestFunction(); - $testResults[] = SELF::selfMemberReferenceUnitTestFunction(); - $testResults[] = SelfMemberReferenceUnitTestExample::selfMemberReferenceUnitTestFunction(); - - - // Incorrect spacing. - $testResults[] = self ::selfMemberReferenceUnitTestFunction(); - $testResults[] = self:: selfMemberReferenceUnitTestFunction(); - $testResults[] = self :: selfMemberReferenceUnitTestFunction(); - - // Remove ALL the newlines - $testResults[] = self - - - - - :: - - - - - selfMemberReferenceUnitTestFunction(); - - } - - - function selfMemberReferenceUnitTestFunction() - { - $this->testCount = $this->testCount + 1; - return $this->testCount; - - } - - -} - - -class MyClass { - - public static function test($value) { - echo "$value\n"; - } - - public static function walk() { - $callback = function($value, $key) { - // This is valid because you can't use self:: in a closure. - MyClass::test($value); - }; - - $array = array(1,2,3); - array_walk($array, $callback); - } -} - -MyClass::walk(); - -class Controller -{ - public function Action() - { - Doctrine\Common\Util\Debug::dump(); - } -} - -class Foo -{ - public static function bar() - { - \Foo::baz(); - } -} - -namespace TYPO3\CMS\Reports; - -class Status { - const NOTICE = -2; - const INFO = -1; - const OK = 0; - const WARNING = 1; - const ERROR = 2; -} - -namespace TYPO3\CMS\Reports\Report\Status; - -class Status implements \TYPO3\CMS\Reports\ReportInterface { - public function getHighestSeverity(array $statusCollection) { - $highestSeverity = \TYPO3\CMS\Reports\Status::NOTICE; - } -} - -namespace Foo; - -class Bar { - - function myFunction() - { - \Foo\Whatever::something(); - \Foo\Bar::something(); - } -} - -namespace Foo\Bar; - -class Baz { - - function myFunction() - { - \Foo\Bar\Whatever::something(); - \Foo\Bar\Baz::something(); - } -} - -class Nested_Anon_Class { - public function getAnonymousClass() { - // Spacing/comments should not cause false negatives for the NotUsed error. - Nested_Anon_Class :: $prop; - Nested_Anon_Class - /* some comment */ - - :: - - // phpcs:ignore Standard.Category.SniffName -- for reasons. - Bar(); - - // Anonymous class is a different scope. - return new class() { - public function nested_function() { - Nested_Anon_Class::$prop; - Nested_Anon_Class::BAR; - } - }; - } -} - -// Test dealing with scoped namespaces. -namespace Foo\Baz { - class BarFoo { - public function foo() { - echo Foo\Baz\BarFoo::$prop; - } - } -} - -// Prevent false negative when namespace has whitespace/comments. -namespace Foo /*comment*/ \ Bah { - class BarFoo { - public function foo() { - echo Foo \ /*comment*/ Bah\BarFoo::$prop; - } - } -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/SelfMemberReferenceUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/SelfMemberReferenceUnitTest.inc.fixed deleted file mode 100644 index f2c1731..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/SelfMemberReferenceUnitTest.inc.fixed +++ /dev/null @@ -1,162 +0,0 @@ -testResults; - - - // Correct call to self. - $testResults[] = self::selfMemberReferenceUnitTestFunction(); - $testResults[] = parent::selfMemberReferenceUnitTestFunction(); - - // Incorrect case. - $testResults[] = self::selfMemberReferenceUnitTestFunction(); - $testResults[] = self::selfMemberReferenceUnitTestFunction(); - $testResults[] = self::selfMemberReferenceUnitTestFunction(); - - - // Incorrect spacing. - $testResults[] = self::selfMemberReferenceUnitTestFunction(); - $testResults[] = self::selfMemberReferenceUnitTestFunction(); - $testResults[] = self::selfMemberReferenceUnitTestFunction(); - - // Remove ALL the newlines - $testResults[] = self::selfMemberReferenceUnitTestFunction(); - - } - - - function selfMemberReferenceUnitTestFunction() - { - $this->testCount = $this->testCount + 1; - return $this->testCount; - - } - - -} - - -class MyClass { - - public static function test($value) { - echo "$value\n"; - } - - public static function walk() { - $callback = function($value, $key) { - // This is valid because you can't use self:: in a closure. - MyClass::test($value); - }; - - $array = array(1,2,3); - array_walk($array, $callback); - } -} - -MyClass::walk(); - -class Controller -{ - public function Action() - { - Doctrine\Common\Util\Debug::dump(); - } -} - -class Foo -{ - public static function bar() - { - self::baz(); - } -} - -namespace TYPO3\CMS\Reports; - -class Status { - const NOTICE = -2; - const INFO = -1; - const OK = 0; - const WARNING = 1; - const ERROR = 2; -} - -namespace TYPO3\CMS\Reports\Report\Status; - -class Status implements \TYPO3\CMS\Reports\ReportInterface { - public function getHighestSeverity(array $statusCollection) { - $highestSeverity = \TYPO3\CMS\Reports\Status::NOTICE; - } -} - -namespace Foo; - -class Bar { - - function myFunction() - { - \Foo\Whatever::something(); - self::something(); - } -} - -namespace Foo\Bar; - -class Baz { - - function myFunction() - { - \Foo\Bar\Whatever::something(); - self::something(); - } -} - -class Nested_Anon_Class { - public function getAnonymousClass() { - // Spacing/comments should not cause false negatives for the NotUsed error. - self::$prop; - - /* some comment */ - - self::// phpcs:ignore Standard.Category.SniffName -- for reasons. - Bar(); - - // Anonymous class is a different scope. - return new class() { - public function nested_function() { - Nested_Anon_Class::$prop; - Nested_Anon_Class::BAR; - } - }; - } -} - -// Test dealing with scoped namespaces. -namespace Foo\Baz { - class BarFoo { - public function foo() { - echo self::$prop; - } - } -} - -// Prevent false negative when namespace has whitespace/comments. -namespace Foo /*comment*/ \ Bah { - class BarFoo { - public function foo() { - echo /*comment*/ self::$prop; - } - } -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/SelfMemberReferenceUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/SelfMemberReferenceUnitTest.php deleted file mode 100644 index ea493d3..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/SelfMemberReferenceUnitTest.php +++ /dev/null @@ -1,64 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Classes; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class SelfMemberReferenceUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 24 => 1, - 25 => 1, - 26 => 1, - 30 => 1, - 31 => 1, - 32 => 2, - 40 => 2, - 92 => 1, - 121 => 1, - 132 => 1, - 139 => 3, - 140 => 1, - 143 => 2, - 162 => 1, - 171 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ValidClassNameUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ValidClassNameUnitTest.inc deleted file mode 100644 index aadbab5..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ValidClassNameUnitTest.inc +++ /dev/null @@ -1,147 +0,0 @@ -anonymous = new class extends ArrayObject - { - public function __construct() - { - parent::__construct(['a' => 1, 'b' => 2]); - } - }; - } -} - -// Valid interface name. -interface ValidCamelCaseClass extends MyClass {} - - -// Incorrect usage of camel case. -interface invalidCamelCaseClass extends MyClass {} -interface Invalid_Camel_Case_Class_With_Underscores implements MyClass {} - - -// All lowercase. -interface invalidlowercaseclass extends MyClass {} -interface invalid_lowercase_class_with_underscores extends MyClass {} - - -// All uppercase. -interface VALIDUPPERCASECLASS extends MyClass {} -interface INVALID_UPPERCASE_CLASS_WITH_UNDERSCORES extends MyClass {} - - -// Mix camel case with uppercase. -interface ValidCamelCaseClassWithUPPERCASE extends MyClass {} - - -// Usage of numeric characters. -interface ValidCamelCaseClassWith1Number extends MyClass {} -interface ValidCamelCaseClassWith12345Numbers extends MyClass {} -interface 5InvalidCamelCaseClassStartingWithNumber extends MyClass {} -interface ValidCamelCaseClassEndingWithNumber5 extends MyClass {} -interface 12345 extends MyClass {} - -interface Testing{} - -interface Base -{ - protected $anonymous; - - public function __construct(); -} - - -// Valid trait name. -trait ValidCamelCaseClass extends MyClass {} - - -// Incorrect usage of camel case. -trait invalidCamelCaseClass extends MyClass {} -trait Invalid_Camel_Case_Class_With_Underscores implements MyClass {} - - -// All lowercase. -trait invalidlowercaseclass extends MyClass {} -trait invalid_lowercase_class_with_underscores extends MyClass {} - - -// All uppercase. -trait VALIDUPPERCASECLASS extends MyClass {} -trait INVALID_UPPERCASE_CLASS_WITH_UNDERSCORES extends MyClass {} - - -// Mix camel case with uppercase. -trait ValidCamelCaseClassWithUPPERCASE extends MyClass {} - - -// Usage of numeric characters. -trait ValidCamelCaseClassWith1Number extends MyClass {} -trait ValidCamelCaseClassWith12345Numbers extends MyClass {} -trait 5InvalidCamelCaseClassStartingWithNumber extends MyClass {} -trait ValidCamelCaseClassEndingWithNumber5 extends MyClass {} -trait 12345 extends MyClass {} - -trait Testing{} - -trait Base -{ - protected $anonymous; - - public function __construct() - { - $this->anonymous = new class extends ArrayObject - { - public function __construct() - { - parent::__construct(['a' => 1, 'b' => 2]); - } - }; - } -} - -if ( class_exists( Test :: class ) ) {} -if ( class_exists( Test2 ::class ) ) {} - -$foo = new class( - new class implements Countable { - } -) extends DateTime { -}; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ValidClassNameUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ValidClassNameUnitTest.php deleted file mode 100644 index 70777c5..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ValidClassNameUnitTest.php +++ /dev/null @@ -1,70 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Classes; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ValidClassNameUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 9 => 1, - 10 => 1, - 14 => 1, - 15 => 1, - 20 => 1, - 30 => 1, - 32 => 1, - 57 => 1, - 58 => 1, - 62 => 1, - 63 => 1, - 68 => 1, - 78 => 1, - 80 => 1, - 97 => 1, - 98 => 1, - 102 => 1, - 103 => 1, - 108 => 1, - 118 => 1, - 120 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/BlockCommentUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/BlockCommentUnitTest.inc deleted file mode 100644 index eed554b..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/BlockCommentUnitTest.inc +++ /dev/null @@ -1,290 +0,0 @@ - - - - - - - - - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class BlockCommentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Get a list of CLI values to set before the file is tested. - * - * @param string $testFile The name of the file being tested. - * @param \PHP_CodeSniffer\Config $config The config data for the test run. - * - * @return void - */ - public function setCliValues($testFile, $config) - { - $config->tabWidth = 4; - - }//end setCliValues() - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - $errors = [ - 3 => 1, - 8 => 1, - 20 => 1, - 24 => 1, - 30 => 1, - 31 => 1, - 34 => 1, - 40 => 1, - 45 => 1, - 49 => 1, - 51 => 1, - 53 => 1, - 57 => 1, - 60 => 1, - 61 => 1, - 63 => 1, - 65 => 1, - 68 => 1, - 70 => 1, - 72 => 1, - 75 => 1, - 84 => 1, - 87 => 1, - 89 => 1, - 92 => 1, - 111 => 1, - 159 => 1, - 181 => 1, - 188 => 1, - 208 => 1, - 214 => 1, - 226 => 1, - 227 => 1, - 232 => 1, - 233 => 1, - 256 => 1, - 271 => 1, - 273 => 1, - ]; - - return $errors; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClassCommentUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClassCommentUnitTest.inc deleted file mode 100644 index 28aff22..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClassCommentUnitTest.inc +++ /dev/null @@ -1,133 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ClassCommentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 2 => 1, - 15 => 1, - 31 => 1, - 54 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return [ - 29 => 1, - 30 => 1, - 50 => 1, - 66 => 1, - 67 => 1, - ]; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.inc deleted file mode 100644 index 9c3255c..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.inc +++ /dev/null @@ -1,82 +0,0 @@ - \ No newline at end of file diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.php deleted file mode 100644 index cdc89ba..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.php +++ /dev/null @@ -1,57 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ClosingDeclarationCommentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 13 => 1, - 17 => 1, - 31 => 1, - 41 => 1, - 59 => 1, - 63 => 1, - 67 => 1, - 79 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return [71 => 1]; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.inc deleted file mode 100644 index e7d880d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.inc +++ /dev/null @@ -1,83 +0,0 @@ - line numbers for each token. - * - * Long description with some points: - * - one - * - two - * - three - * - * @param array &$tokens The array of tokens to process. - * @param object $tokenizer The tokenizer being used to - * process this file. - * @param string $eolChar The EOL character to use for splitting strings. - * - * @return void - */ -function myFunction() {} - -class MyClass2 -{ - /** - * Some info about the variable here. - */ - var $x; -} - -/** ************************************************************************ - * Example with no errors. - **************************************************************************/ -function example() {} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.inc.fixed deleted file mode 100644 index 4d8cb39..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.inc.fixed +++ /dev/null @@ -1,83 +0,0 @@ - line numbers for each token. - * - * Long description with some points: - * - one - * - two - * - three - * - * @param array &$tokens The array of tokens to process. - * @param object $tokenizer The tokenizer being used to - * process this file. - * @param string $eolChar The EOL character to use for splitting strings. - * - * @return void - */ -function myFunction() {} - -class MyClass2 -{ - /** - * Some info about the variable here. - */ - var $x; -} - -/** ************************************************************************ - * Example with no errors. - **************************************************************************/ -function example() {} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.js b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.js deleted file mode 100644 index 6e1a878..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.js +++ /dev/null @@ -1,76 +0,0 @@ - -/** -* Some info about the class here - * - */ -foo.prototype = { - - /** - * Some info about the function here. - * - *@return void - */ - bar: function() {} -} - -/** - * Some info about the class here - * - */ -foo.prototype = { - - /** - *Some info about the function here. - * - * @return void - */ - bar: function() {} -} - -/** - * Some info about the class here - * -*/ -foo.prototype = { - - /** - * Some info about the function here. - * - * @return void - */ - bar: function() {} -} - -/** @var Database $mockedDatabase */ -/** @var Container $mockedContainer */ - -function myFunction() -{ - console.info('hi'); - /** - Comment here. - */ -} - -/** - * Creates a map of tokens => line numbers for each token. - * - * Long description with some points: - * - one - * - two - * - three - * - * @param array &$tokens The array of tokens to process. - * @param object $tokenizer The tokenizer being used to - * process this file. - * @param string $eolChar The EOL character to use for splitting strings. - * - * @return void - */ -function myFunction() {} - -$.extend(Datepicker.prototype, { - _widgetDatepicker: function() { - }, - /* Action for selecting a new month/year. */ -}); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.js.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.js.fixed deleted file mode 100644 index 9edb4cc..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.js.fixed +++ /dev/null @@ -1,76 +0,0 @@ - -/** - * Some info about the class here - * - */ -foo.prototype = { - - /** - * Some info about the function here. - * - * @return void - */ - bar: function() {} -} - -/** - * Some info about the class here - * - */ -foo.prototype = { - - /** - * Some info about the function here. - * - * @return void - */ - bar: function() {} -} - -/** - * Some info about the class here - * - */ -foo.prototype = { - - /** - * Some info about the function here. - * - * @return void - */ - bar: function() {} -} - -/** @var Database $mockedDatabase */ -/** @var Container $mockedContainer */ - -function myFunction() -{ - console.info('hi'); - /** - Comment here. - */ -} - -/** - * Creates a map of tokens => line numbers for each token. - * - * Long description with some points: - * - one - * - two - * - three - * - * @param array &$tokens The array of tokens to process. - * @param object $tokenizer The tokenizer being used to - * process this file. - * @param string $eolChar The EOL character to use for splitting strings. - * - * @return void - */ -function myFunction() {} - -$.extend(Datepicker.prototype, { - _widgetDatepicker: function() { - }, - /* Action for selecting a new month/year. */ -}); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.php deleted file mode 100644 index 974951c..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.php +++ /dev/null @@ -1,70 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class DocCommentAlignmentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='DocCommentAlignmentUnitTest.inc') - { - $errors = [ - 3 => 1, - 11 => 1, - 17 => 1, - 18 => 1, - 19 => 1, - 23 => 2, - 24 => 1, - 25 => 2, - 26 => 1, - 32 => 1, - 33 => 1, - 38 => 1, - 39 => 1, - ]; - - if ($testFile === 'DocCommentAlignmentUnitTest.inc') { - $errors[75] = 1; - } - - return $errors; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/EmptyCatchCommentUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/EmptyCatchCommentUnitTest.inc deleted file mode 100644 index cde6e46..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/EmptyCatchCommentUnitTest.inc +++ /dev/null @@ -1,55 +0,0 @@ - \ No newline at end of file diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/EmptyCatchCommentUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/EmptyCatchCommentUnitTest.php deleted file mode 100644 index 3c1668e..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/EmptyCatchCommentUnitTest.php +++ /dev/null @@ -1,55 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class EmptyCatchCommentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 13 => 1, - 33 => 1, - 49 => 1, - 50 => 1, - 51 => 1, - 52 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.inc deleted file mode 100644 index 1db2861..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.inc +++ /dev/null @@ -1,43 +0,0 @@ - -* @author -* @copyright 1997~1994 The PHP Group -* @copyright 1994-1997 The PHP Group -* @copyright The PHP Group -* @license http://www.php.net/license/3_0.txt -* @summary An unknown summary tag -* -*/ - - -?> - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.inc.fixed deleted file mode 100644 index 5cc4764..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.inc.fixed +++ /dev/null @@ -1,43 +0,0 @@ - -* @author -* @copyright 1997 Squiz Pty Ltd (ABN 77 084 670 600) -* @copyright 1994-1997 Squiz Pty Ltd (ABN 77 084 670 600) -* @copyright 2021 Squiz Pty Ltd (ABN 77 084 670 600) -* @license http://www.php.net/license/3_0.txt -* @summary An unknown summary tag -* -*/ - - -?> - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.js b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.js deleted file mode 100644 index 57d8d37..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.js +++ /dev/null @@ -1,40 +0,0 @@ - - - - -/** -* -* 0Multi-line short description without full stop -* -* -* asdasd -* long description for file (if any) -* asdasdadada -* -* PHP versio -* -* LICENSE: This source file is subject to version 3.0 of the PHP license -* that is available through the world-wide-web at the following URI: -* http://www.php.net/license/3_0.txt. If you did not receive a copy of -* the PHP License and are unable to obtain it through the web, please -* send a note to license@php.net so we can mail you a copy immediately. -* @package SquizCMS -* @package ADDITIONAL PACKAGE TAG -* @subpkg not_camelcased -* @author Antônio Carlos Venâncio Júnior -* @author -* @copyright 1997~1994 The PHP Group -* @copyright 1994-1997 The PHP Group -* @copyright The PHP Group -* @license http://www.php.net/license/3_0.txt -* @summary An unknown summary tag -* -*/ - - -/** -* This bit here is not qualified as file comment -* -* as it is not the first comment in the file -* -*/ diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.js.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.js.fixed deleted file mode 100644 index b2b071f..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.js.fixed +++ /dev/null @@ -1,40 +0,0 @@ - - - - -/** -* -* 0Multi-line short description without full stop -* -* -* asdasd -* long description for file (if any) -* asdasdadada -* -* PHP versio -* -* LICENSE: This source file is subject to version 3.0 of the PHP license -* that is available through the world-wide-web at the following URI: -* http://www.php.net/license/3_0.txt. If you did not receive a copy of -* the PHP License and are unable to obtain it through the web, please -* send a note to license@php.net so we can mail you a copy immediately. -* @package SquizCMS -* @package ADDITIONAL PACKAGE TAG -* @subpkg not_camelcased -* @author Squiz Pty Ltd -* @author -* @copyright 1997 Squiz Pty Ltd (ABN 77 084 670 600) -* @copyright 1994-1997 Squiz Pty Ltd (ABN 77 084 670 600) -* @copyright 2021 Squiz Pty Ltd (ABN 77 084 670 600) -* @license http://www.php.net/license/3_0.txt -* @summary An unknown summary tag -* -*/ - - -/** -* This bit here is not qualified as file comment -* -* as it is not the first comment in the file -* -*/ diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.2.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.2.inc deleted file mode 100644 index 520d349..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.2.inc +++ /dev/null @@ -1,11 +0,0 @@ - - * @copyright 2010-2014 Squiz Pty Ltd (ABN 77 084 670 600) - */ - -echo 'hi'; \ No newline at end of file diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.2.js b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.2.js deleted file mode 100644 index 4bb4d50..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.2.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * File comment. - * - * @package Package - * @subpackage Subpackage - * @author Squiz Pty Ltd - * @copyright 2010-2014 Squiz Pty Ltd (ABN 77 084 670 600) - */ - -print 'hi'; \ No newline at end of file diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.3.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.3.inc deleted file mode 100644 index b47603f..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.3.inc +++ /dev/null @@ -1,9 +0,0 @@ - - * @copyright 2010-2014 Squiz Pty Ltd (ABN 77 084 670 600) - * diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.4.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.4.inc deleted file mode 100644 index 2fdeeba..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.4.inc +++ /dev/null @@ -1,3 +0,0 @@ - - * @copyright 2010-2014 Squiz Pty Ltd (ABN 77 084 670 600) - */ - -class Foo { -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.7.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.7.inc deleted file mode 100644 index 7074dac..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.7.inc +++ /dev/null @@ -1,12 +0,0 @@ - - * @copyright 2010-2014 Squiz Pty Ltd (ABN 77 084 670 600) - */ -#[Attribute] -class Foo { -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.8.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.8.inc deleted file mode 100644 index 5ef90f2..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.8.inc +++ /dev/null @@ -1,9 +0,0 @@ - - * @copyright 2010-2014 Squiz Pty Ltd (ABN 77 084 670 600) - */ diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.php deleted file mode 100644 index 080df3a..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.php +++ /dev/null @@ -1,75 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class FileCommentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='FileCommentUnitTest.inc') - { - switch ($testFile) { - case 'FileCommentUnitTest.1.inc': - case 'FileCommentUnitTest.1.js': - return [ - 1 => 1, - 22 => 2, - 23 => 1, - 24 => 2, - 25 => 2, - 26 => 1, - 27 => 2, - 28 => 2, - 32 => 2, - ]; - - case 'FileCommentUnitTest.4.inc': - case 'FileCommentUnitTest.6.inc': - case 'FileCommentUnitTest.7.inc': - return [1 => 1]; - - case 'FileCommentUnitTest.5.inc': - return [2 => 1]; - - default: - return []; - }//end switch - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentThrowTagUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentThrowTagUnitTest.inc deleted file mode 100644 index 7e94bb2..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentThrowTagUnitTest.inc +++ /dev/null @@ -1,511 +0,0 @@ -callSomeFunction(); - - }//end okFunction() - - - /** - * Comment inside function. - * - * @throws Exception - */ - function okFunction() - { - /** - * @var FooClass - */ - $foo = FooFactory::factory(); - throw new Exception; - - }//end okFunction - - /** - * Needs at throws tag for rethrown exception, - * even though we have one throws tag. - * - * @throws PHP_Exception1 - */ - public function notOkVariableRethrown() - { - throw new PHP_Exception1('Error'); - - try { - // Do something. - } catch (PHP_Exception2 $e) { - logError(); - throw $e; - } - - }//end notOkVariableRethrown() - - /** - * Needs at throws tag for rethrown exception, - * even though we have one throws tag. - * - * @throws PHP_Exception1 - */ - public function notOkVariableRethrown() - { - throw new PHP_Exception1('Error'); - - try { - // Do something. - } catch (PHP_Exception1 | PHP_Exception2 $e) { - logError(); - throw $e; - } - - }//end notOkVariableRethrown() - - /** - * Has correct throws tags for all exceptions - * - * @throws PHP_Exception1 - * @throws PHP_Exception2 - */ - public function okVariableRethrown() - { - throw new PHP_Exception1('Error'); - - try { - // Do something. - } catch (PHP_Exception2 $e) { - logError(); - throw $e; - } - - }//end okVariableRethrown() - - /** - * Has correct throws tags for all exceptions - * - * @throws PHP_Exception1 - * @throws PHP_Exception2 - */ - public function okVariableMultiRethrown() - { - try { - // Do something. - } catch (PHP_Exception1 | PHP_Exception2 $e) { - logError(); - throw $e; - } - - }//end okVariableMultiRethrown() -}//end class - -class NamespacedException { - /** - * @throws \Exception - */ - public function foo() { - throw new \Exception(); - } - - /** - * @throws \Foo\Bar\FooBarException - */ - public function fooBar2() { - throw new \Foo\Bar\FooBarException(); - } - - /** - * @throws FooBarException - */ - public function fooBar2() { - throw new \Foo\Bar\FooBarException(); - } -} - -class Foo { - /** - * Comment - */ - public function foo() { - }//end foo() - - public function bar() { - throw new Exception(); - } - - /** - * Returns information for a test. - * - * This info includes parameters, their valid values. - * - * @param integer $projectid Id of the project. - * - * @return array - * @throws ChannelException If the project is invalid. - */ - public static function getTestInfo($projectid=NULL) - { - try { - DAL::beginTransaction(); - DAL::commit(); - } catch (DALException $e) { - DAL::rollBack(); - throw new ChannelException($e); - } - } -} - -class Test -{ - /** - * Folder name. - * - * @var string - */ - protected $folderName; - - protected function setUp() - { - parent::setUp(); - - if ( !strlen($this->folderName) ) { - throw new \RuntimeException('The $this->folderName must be specified before proceeding.'); - } - } - - /* - * - */ - protected function foo() - { - } - - /** - * @return Closure - */ - public function getStuff() - { - return function () { - throw new RuntimeException("bam!"); - }; - } -} - -/** - * Class comment. - */ -class A -{ - /** - * Function B. - */ - public function b() - { - return new class { - public function c() - { - throw new \Exception(); - } - } - } -} - -/** - * Class comment. - */ -class A -{ - /** - * Function B. - */ - public function b() - { - return new class { - /** - * Tag and token number mismatch. - * - * @throws PHP_Exception1 - * @throws PHP_Exception2 - */ - public function oneLessThrowsTagNeeded() - { - throw new PHP_Exception1('Error'); - - }//end oneLessThrowsTagNeeded() - } - } -} - -abstract class SomeClass { - /** - * Comment here. - */ - abstract public function getGroups(); -} - -class SomeClass { - /** - * Validates something. - * - * @param string $method The set method parameter. - * - * @return string The validated method. - * - * @throws Prefix_Invalid_Argument_Exception The invalid argument exception. - * @throws InvalidArgumentException The invalid argument exception. - */ - protected function validate_something( $something ) { - if ( ! Prefix_Validator::is_string( $something ) ) { - throw Prefix_Invalid_Argument_Exception::invalid_string_parameter( $something, 'something' ); - } - - if ( ! in_array( $something, $this->valid_http_something, true ) ) { - throw new InvalidArgumentException( sprintf( '%s is not a valid HTTP something', $something ) ); - } - - return $something; - } - - /** - * Comment - * - * @throws Exception1 Comment. - * @throws Exception2 Comment. - * @throws Exception3 Comment. - */ - public function foo() { - switch ($foo) { - case 1: - throw Exception1::a(); - case 2: - throw Exception1::b(); - case 3: - throw Exception1::c(); - case 4: - throw Exception2::a(); - case 5: - throw Exception2::b(); - default: - throw new Exception3; - - } - } -} - -namespace Test\Admin { - class NameSpacedClass { - /** - * @throws \ExceptionFromGlobalNamespace - */ - public function ExceptionInGlobalNamespace() { - throw new \ExceptionFromGlobalNamespace(); - } - - /** - * @throws ExceptionFromSameNamespace - */ - public function ExceptionInSameNamespace() { - throw new ExceptionFromSameNamespace(); - } - - /** - * @throws \Test\Admin\ExceptionFromSameNamespace - */ - public function ExceptionInSameNamespaceToo() { - throw new ExceptionFromSameNamespace(); - } - - /** - * @throws \Different\NameSpaceName\ExceptionFromDifferentNamespace - */ - public function ExceptionInSameNamespaceToo() { - throw new \Different\NameSpaceName\ExceptionFromDifferentNamespace(); - } - } -} - -namespace { - class GlobalNameSpaceClass { - /** - * @throws SomeGlobalException - */ - public function ThrowGlobalException() { - throw new SomeGlobalException(); - } - - /** - * @throws \SomeGlobalException - */ - public function ThrowGlobalExceptionToo() { - throw new SomeGlobalException(); - } - } -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentThrowTagUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentThrowTagUnitTest.php deleted file mode 100644 index 1e2d07f..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentThrowTagUnitTest.php +++ /dev/null @@ -1,60 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class FunctionCommentThrowTagUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 9 => 1, - 21 => 1, - 35 => 1, - 47 => 1, - 61 => 2, - 106 => 1, - 123 => 1, - 200 => 1, - 219 => 1, - 287 => 1, - 397 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc deleted file mode 100644 index deaa966..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc +++ /dev/null @@ -1,1043 +0,0 @@ -MyClass) - */ -public function caseSensitive($a1, $a2, $a3, arRay $a4, $a5, $a6, myclas $a7) -{ - -}//end caseSensitive() - - -/** - * More type hint check for custom type and array. - * - * @param array $a1 Comment here. - * @param array $a2 Comment here. - * @param MyClass $a3 Comment here. - * @param MyClass $a4 Comment here. - * - * @return array(int => MyClass) - */ -public function typeHint(MyClass $a1, $a2, myclass $a3, $a4) -{ - return (3 => 'myclass obj'); - -}//end typeHint() - - -/** - * Mixed variable type separated by a '|'. - * - * @param array|string $a1 Comment here. - * @param mixed $a2 Comment here. - * @param string|array $a3 Comment here. - * @param MyClass|int $a4 Comment here. - * - * @return bool - */ -public function mixedType($a1, $a2, $a3, $a4) -{ - return true; - -}//end mixedType() - - -/** - * Array type. - * - * @param array(MyClass) $a1 OK. - * @param array() $a2 Invalid type. - * @param array( $a3 Typo. - * @param array(int) $a4 Use 'array(integer)' instead. - * @param array(int => integer) $a5 Use 'array(integer => integer)' instead. - * @param array(integer => bool) $a6 Use 'array(integer => boolean)' instead. - * @param aRRay $a7 Use 'array' instead. - * @param string $a8 String with unknown type hint. - * - * @return int - */ -public function mixedArrayType($a1, $a2, array $a3, $a4, $a5, $a6, $a7, unknownTypeHint $a8) -{ - return 1; - -}//end mixedArrayType() - - -/** - */ -function empty1() -{ -}//end empty1() - - -/** - * - */ -function empty2() -{ -}//end empty2() - - -/** - * - * - * - */ -function empty3() -{ -}//end empty3 - - -/** - * @return boolean - */ -public function missingShortDescriptionInFunctionComment() -{ - return true; - -}//end missingShortDescriptionInFunctionComment() - - -class Another_Class -{ - - /** - * Destructor should not include a return tag. - * - * @return void - */ - function __destruct() - { - return; - } - - /** - * Constructor should not include a return tag. - * - * @return void - */ - function __construct() - { - return; - } - -}//end class - - -/** - * Comment param alignment test. - * - * @param string $varrr1 Comment1.. - * @param string $vr2 Comment2. - * @param string $var3 Comment3.. - * - * @return void - */ -public static function paramAlign($varrr1, $vr2, $var3) -{ - -}//end paramAlign() - - -/** - * Comment. - * - * @param string $id Comment. - * @param array $design Comment. - * - * @return void - */ -public static function paint($id, array $design) -{ - -}//end paint() - - -/** - * Adds specified class name to class attribute of this widget. - * - * @since 4.0.0 - * @return string - */ -public function myFunction() -{ - if ($condition === FALSE) { - echo 'hi'; - } - -}//end myFunction() - - -/** - * Adds specified class name to class attribute of this widget. - * - * @return string - */ -public function myFunction() -{ - if ($condition === FALSE) { - echo 'hi'; - return; - } - - return 'blah'; - -}//end myFunction() - - -/** - * Adds specified class name to class attribute of this widget. - * - * @return string - */ -public function myFunction() -{ - if ($condition === FALSE) { - echo 'hi'; - } - - return 'blah'; - -}//end myFunction() - -/** - * Test function. - * - * @param string $arg1 An argument - * - * @access public - * @return bool - */ - -echo $blah; - -function myFunction($arg1) {} - -class MyClass() { - /** - * An abstract function. - * - * @return string[] - */ - abstract final protected function myFunction(); -} - -/** - * Comment. - * - * @param mixed $test An argument. - * - * @return mixed - */ -function test($test) -{ - if ($test === TRUE) { - return; - } - - return $test; - -}//end test() - - -/** Comment. - * - * @return mixed - * - */ -function test() -{ - -}//end test() - -/** - * Comment. - * - * @param \other\ns\item $test An argument. - * - * @return mixed - */ -function test(\other\ns\item $test) -{ - return $test; - -}//end test() - -/** - * Comment. - * - * @param item $test An argument. - * - * @return mixed - */ -function test(\other\ns\item $test) -{ - return $test; - -}//end test() - -/** - * Comment. - * - * @param \first\ns\item $test An argument. - * - * @return mixed - */ -function test(\first\ns\item $test = \second\ns::CONSTANT) -{ - return $test; - -}//end test() - -/** - * Comment. - * - * @param \first\item $test An argument. - * - * @return mixed - */ -function test(\first\ns\item $test = \second\ns::CONSTANT) -{ - return $test; - -}//end test() - -// Closures should be ignored. -preg_replace_callback( - '~-([a-z])~', - function ($match) { - return strtoupper($match[1]); - }, - 'hello-world' -); - -$callback = function ($bar) use ($foo) - { - $bar += $foo; - }; - -/** - * Comment should end with '*', not '**' before the slash. - **/ -function test123() { - -} - -/** - * Cant use resource for type hint. - * - * @param resource $test An argument. - * - * @return mixed - */ -function test($test) -{ - return $test; - -}//end test() - -/** - * Variable number of args. - * - * @param string $a1 Comment here. - * @param string $a2 Comment here. - * @param string $a2,... Comment here. - * - * @return boolean - */ -public function variableArgs($a1, $a2) -{ - return true; - -}//end variableArgs() - -/** - * Contains closure. - * - * @return void - */ -public function containsClosure() -{ - function ($e) { - return new Event($e); - }, - -}//end containsClosure() - -/** - * 这是一条测试评论. - * - * @return void - */ -public function test() -{ - -}//end variableArgs() - -/** - * Uses callable. - * - * @param callable $cb Test parameter. - * - * @return void - */ -public function usesCallable(callable $cb) { - $cb(); -}//end usesCallable() - -/** - * Creates a map of tokens => line numbers for each token. - * - * @param array $tokens The array of tokens to process. - * @param object $tokenizer The tokenizer being used to process this file. - * @param string $eolChar The EOL character - * to use for splitting strings. - * - * @return void - * @throws Exception If something really bad - * happens while doing foo. - */ -public function foo(array &$tokens, $tokenizer, $eolChar) -{ - -}//end foo() - -/** - * Some description. - * - * @param \Vendor\Package\SomeClass $someclass Some class. - * @param \OtherVendor\Package\SomeClass2 $someclass2 Some class. - * @param \OtherVendor\Package\SomeClass2 $someclass3 Some class. - * - * @return void - */ -public function foo(SomeClass $someclass, \OtherVendor\Package\SomeClass2 $someclass2, SomeClass3 $someclass3) -{ -} - -/** - * Gettext. - * - * @return string - */ -public function _() { - return $foo; -} - -class Baz { - /** - * The PHP5 constructor - * - * No return tag - */ - public function __construct() { - - } -} - -/** - * Test - * - * @return void - * @throws E - */ -function myFunction() {} - -/** - * Yield test - * - * @return integer - */ -function yieldTest() -{ - for ($i = 0; $i < 5; $i++) { - yield $i; - } -} - -/** - * Yield test - * - * @return void - */ -function yieldTest() -{ - for ($i = 0; $i < 5; $i++) { - yield $i; - } -} - -/** - * Using "array" as a type hint should satisfy a specified array parameter type. - * - * @param MyClass[] $values An array of MyClass objects. - * - * @return void - */ -public function specifiedArray(array $values) { - -}// end specifiedArray() - -/** - * Using "callable" as a type hint should satisfy a "callback" parameter type. - * - * @param callback $cb A callback. - * - * @return void - */ -public function callableCallback(callable $cb) { - -}// end callableCallback() - -/** - * PHP7 type hints. - * - * @param string $name1 Comment. - * @param integer $name2 Comment. - * @param float $name3 Comment. - * @param boolean $name4 Comment. - * - * @return void - */ -public function myFunction (string $name1, int $name2, float $name3, bool $name4) { -} - -/** - * Variadic function. - * - * @param string $name1 Comment. - * @param string ...$name2 Comment. - * - * @return void - */ -public function myFunction(string $name1, string ...$name2) { -} - - -/** - * Variadic function. - * - * @param string $name1 Comment. - * @param string $name2 Comment. - * - * @return void - */ -public function myFunction(string $name1, string ...$name2) { -} - -/** - * Return description function + correct type. - * - * @return integer This is a description. - */ -public function myFunction() { - return 5; -} - -/** - * Return description function + incorrect type. - * - * @return int This is a description. - */ -public function myFunction() { - return 5; -} - -/** - * Return description function + no return. - * - * @return void This is a description. - */ -public function myFunction() { -} - -/** - * Return description function + mixed return. - * - * @return mixed This is a description. - */ -public function myFunction() { -} - -/** - * Function comment. - * - * @param $bar - * Comment here. - * @param ... - * Additional arguments here. - * - * @return - * Return value - * - */ -function foo($bar) { -} - -/** - * Do something. - * - * @return void - */ -public function someFunc(): void -{ - $class = new class - { - /** - * Do something. - * - * @return string - */ - public function getString(): string - { - return 'some string'; - } - }; -} - -/** - * Return description function + mixed return types. - * - * @return bool|int This is a description. - */ -function returnTypeWithDescriptionA() -{ - return 5; - -}//end returnTypeWithDescriptionA() - - -/** - * Return description function + mixed return types. - * - * @return real|bool This is a description. - */ -function returnTypeWithDescriptionB() -{ - return 5; - -}//end returnTypeWithDescriptionB() - - -/** - * Return description function + lots of different mixed return types. - * - * @return int|object|string[]|real|double|float|bool|array(int=>MyClass)|callable And here we have a description - */ -function returnTypeWithDescriptionC() -{ - return 5; - -}//end returnTypeWithDescriptionC() - - -/** - * Return description function + lots of different mixed return types. - * - * @return array(int=>bool)|\OtherVendor\Package\SomeClass2|MyClass[]|void And here we have a description - */ -function returnTypeWithDescriptionD() -{ - -}//end returnTypeWithDescriptionD() - -/** - * Yield from test - * - * @return int[] - */ -function yieldFromTest() -{ - yield from foo(); -} - -/** - * Audio - * - * Generates an audio element to embed sounds - * - * @param mixed $src Either a source string or - * an array of sources. - * @param mixed $unsupportedMessage The message to display - * if the media tag is not supported by the browser. - * @param mixed $attributes HTML attributes. - * @return string - */ -function audio( - $src, - $unsupportedMessage = '', - $attributes = '', -) -{ - return 'test'; -} - -/** - * Test function - * - * @return array - */ -function returnArrayWithClosure() -{ - function () { - return; - }; - - return []; -} - -/** - * Test function - * - * @return array - */ -function returnArrayWithAnonymousClass() -{ - new class { - /** - * @return void - */ - public function test() { - return; - } - }; - - return []; -} - -/** - * @return void - */ -function returnVoidWithClosure() -{ - function () { - return 1; - }; -} - -/** - * @return void - */ -function returnVoidWithAnonymousClass() -{ - new class { - /** - * @return integer - */ - public function test() - { - return 1; - } - }; -} - -class TestReturnVoid -{ - /** - * @return void - */ - public function test() - { - function () { - return 4; - }; - } -} - -/** - * Comment here. - * - * @param integer $a This is A. - * @param ?array $b This is B. - * - * @return void - */ -public static function foo(?int $a, ?array $b) {} - -/** - * Comment here. - * - * @param object $a This is A. - * @param object $b This is B. - * - * @return void - */ -public function foo(object $a, ?object $b) {} - -/** - * Prepares given PHP class method for later code building. - * - * @param integer $foo Comment. - * - Additional comment. - * - * @return void - */ -function foo($foo) {} - -/** - * {@inheritDoc} - */ -public function foo($a, $b) {} - -// phpcs:set Squiz.Commenting.FunctionComment skipIfInheritdoc true - -/** - * {@inheritDoc} - */ -public function foo($a, $b) {} - -/** - * Foo. - * - * @param mixed $a Comment. - * - * @return mixed - */ -public function foo(mixed $a): mixed {} - -// phpcs:set Squiz.Commenting.FunctionComment specialMethods[] -class Bar { - /** - * The PHP5 constructor - */ - public function __construct() { - - } -} - -// phpcs:set Squiz.Commenting.FunctionComment specialMethods[] ignored -/** - * Should be ok - */ -public function ignored() { - -} - -// phpcs:set Squiz.Commenting.FunctionComment specialMethods[] __construct,__destruct diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc.fixed deleted file mode 100644 index b46df26..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc.fixed +++ /dev/null @@ -1,1043 +0,0 @@ - MyClass) - */ -public function caseSensitive($a1, $a2, $a3, arRay $a4, $a5, $a6, myclas $a7) -{ - -}//end caseSensitive() - - -/** - * More type hint check for custom type and array. - * - * @param array $a1 Comment here. - * @param array $a2 Comment here. - * @param MyClass $a3 Comment here. - * @param MyClass $a4 Comment here. - * - * @return array(integer => MyClass) - */ -public function typeHint(MyClass $a1, $a2, myclass $a3, $a4) -{ - return (3 => 'myclass obj'); - -}//end typeHint() - - -/** - * Mixed variable type separated by a '|'. - * - * @param array|string $a1 Comment here. - * @param mixed $a2 Comment here. - * @param string|array $a3 Comment here. - * @param MyClass|integer $a4 Comment here. - * - * @return boolean - */ -public function mixedType($a1, $a2, $a3, $a4) -{ - return true; - -}//end mixedType() - - -/** - * Array type. - * - * @param array(MyClass) $a1 OK. - * @param array $a2 Invalid type. - * @param array $a3 Typo. - * @param array(integer) $a4 Use 'array(integer)' instead. - * @param array(integer => integer) $a5 Use 'array(integer => integer)' instead. - * @param array(integer => boolean) $a6 Use 'array(integer => boolean)' instead. - * @param array $a7 Use 'array' instead. - * @param string $a8 String with unknown type hint. - * - * @return integer - */ -public function mixedArrayType($a1, $a2, array $a3, $a4, $a5, $a6, $a7, unknownTypeHint $a8) -{ - return 1; - -}//end mixedArrayType() - - -/** - */ -function empty1() -{ -}//end empty1() - - -/** - * - */ -function empty2() -{ -}//end empty2() - - -/** - * - * - * - */ -function empty3() -{ -}//end empty3 - - -/** - * @return boolean - */ -public function missingShortDescriptionInFunctionComment() -{ - return true; - -}//end missingShortDescriptionInFunctionComment() - - -class Another_Class -{ - - /** - * Destructor should not include a return tag. - * - * @return void - */ - function __destruct() - { - return; - } - - /** - * Constructor should not include a return tag. - * - * @return void - */ - function __construct() - { - return; - } - -}//end class - - -/** - * Comment param alignment test. - * - * @param string $varrr1 Comment1.. - * @param string $vr2 Comment2. - * @param string $var3 Comment3.. - * - * @return void - */ -public static function paramAlign($varrr1, $vr2, $var3) -{ - -}//end paramAlign() - - -/** - * Comment. - * - * @param string $id Comment. - * @param array $design Comment. - * - * @return void - */ -public static function paint($id, array $design) -{ - -}//end paint() - - -/** - * Adds specified class name to class attribute of this widget. - * - * @since 4.0.0 - * @return string - */ -public function myFunction() -{ - if ($condition === FALSE) { - echo 'hi'; - } - -}//end myFunction() - - -/** - * Adds specified class name to class attribute of this widget. - * - * @return string - */ -public function myFunction() -{ - if ($condition === FALSE) { - echo 'hi'; - return; - } - - return 'blah'; - -}//end myFunction() - - -/** - * Adds specified class name to class attribute of this widget. - * - * @return string - */ -public function myFunction() -{ - if ($condition === FALSE) { - echo 'hi'; - } - - return 'blah'; - -}//end myFunction() - -/** - * Test function. - * - * @param string $arg1 An argument - * - * @access public - * @return bool - */ - -echo $blah; - -function myFunction($arg1) {} - -class MyClass() { - /** - * An abstract function. - * - * @return string[] - */ - abstract final protected function myFunction(); -} - -/** - * Comment. - * - * @param mixed $test An argument. - * - * @return mixed - */ -function test($test) -{ - if ($test === TRUE) { - return; - } - - return $test; - -}//end test() - - -/** Comment. - * - * @return mixed - * - */ -function test() -{ - -}//end test() - -/** - * Comment. - * - * @param \other\ns\item $test An argument. - * - * @return mixed - */ -function test(\other\ns\item $test) -{ - return $test; - -}//end test() - -/** - * Comment. - * - * @param item $test An argument. - * - * @return mixed - */ -function test(\other\ns\item $test) -{ - return $test; - -}//end test() - -/** - * Comment. - * - * @param \first\ns\item $test An argument. - * - * @return mixed - */ -function test(\first\ns\item $test = \second\ns::CONSTANT) -{ - return $test; - -}//end test() - -/** - * Comment. - * - * @param \first\item $test An argument. - * - * @return mixed - */ -function test(\first\ns\item $test = \second\ns::CONSTANT) -{ - return $test; - -}//end test() - -// Closures should be ignored. -preg_replace_callback( - '~-([a-z])~', - function ($match) { - return strtoupper($match[1]); - }, - 'hello-world' -); - -$callback = function ($bar) use ($foo) - { - $bar += $foo; - }; - -/** - * Comment should end with '*', not '**' before the slash. - **/ -function test123() { - -} - -/** - * Cant use resource for type hint. - * - * @param resource $test An argument. - * - * @return mixed - */ -function test($test) -{ - return $test; - -}//end test() - -/** - * Variable number of args. - * - * @param string $a1 Comment here. - * @param string $a2 Comment here. - * @param string $a2,... Comment here. - * - * @return boolean - */ -public function variableArgs($a1, $a2) -{ - return true; - -}//end variableArgs() - -/** - * Contains closure. - * - * @return void - */ -public function containsClosure() -{ - function ($e) { - return new Event($e); - }, - -}//end containsClosure() - -/** - * 这是一条测试评论. - * - * @return void - */ -public function test() -{ - -}//end variableArgs() - -/** - * Uses callable. - * - * @param callable $cb Test parameter. - * - * @return void - */ -public function usesCallable(callable $cb) { - $cb(); -}//end usesCallable() - -/** - * Creates a map of tokens => line numbers for each token. - * - * @param array $tokens The array of tokens to process. - * @param object $tokenizer The tokenizer being used to process this file. - * @param string $eolChar The EOL character - * to use for splitting strings. - * - * @return void - * @throws Exception If something really bad - * happens while doing foo. - */ -public function foo(array &$tokens, $tokenizer, $eolChar) -{ - -}//end foo() - -/** - * Some description. - * - * @param \Vendor\Package\SomeClass $someclass Some class. - * @param \OtherVendor\Package\SomeClass2 $someclass2 Some class. - * @param \OtherVendor\Package\SomeClass2 $someclass3 Some class. - * - * @return void - */ -public function foo(SomeClass $someclass, \OtherVendor\Package\SomeClass2 $someclass2, SomeClass3 $someclass3) -{ -} - -/** - * Gettext. - * - * @return string - */ -public function _() { - return $foo; -} - -class Baz { - /** - * The PHP5 constructor - * - * No return tag - */ - public function __construct() { - - } -} - -/** - * Test - * - * @return void - * @throws E - */ -function myFunction() {} - -/** - * Yield test - * - * @return integer - */ -function yieldTest() -{ - for ($i = 0; $i < 5; $i++) { - yield $i; - } -} - -/** - * Yield test - * - * @return void - */ -function yieldTest() -{ - for ($i = 0; $i < 5; $i++) { - yield $i; - } -} - -/** - * Using "array" as a type hint should satisfy a specified array parameter type. - * - * @param MyClass[] $values An array of MyClass objects. - * - * @return void - */ -public function specifiedArray(array $values) { - -}// end specifiedArray() - -/** - * Using "callable" as a type hint should satisfy a "callback" parameter type. - * - * @param callback $cb A callback. - * - * @return void - */ -public function callableCallback(callable $cb) { - -}// end callableCallback() - -/** - * PHP7 type hints. - * - * @param string $name1 Comment. - * @param integer $name2 Comment. - * @param float $name3 Comment. - * @param boolean $name4 Comment. - * - * @return void - */ -public function myFunction (string $name1, int $name2, float $name3, bool $name4) { -} - -/** - * Variadic function. - * - * @param string $name1 Comment. - * @param string ...$name2 Comment. - * - * @return void - */ -public function myFunction(string $name1, string ...$name2) { -} - - -/** - * Variadic function. - * - * @param string $name1 Comment. - * @param string $name2 Comment. - * - * @return void - */ -public function myFunction(string $name1, string ...$name2) { -} - -/** - * Return description function + correct type. - * - * @return integer This is a description. - */ -public function myFunction() { - return 5; -} - -/** - * Return description function + incorrect type. - * - * @return integer This is a description. - */ -public function myFunction() { - return 5; -} - -/** - * Return description function + no return. - * - * @return void This is a description. - */ -public function myFunction() { -} - -/** - * Return description function + mixed return. - * - * @return mixed This is a description. - */ -public function myFunction() { -} - -/** - * Function comment. - * - * @param $bar - * Comment here. - * @param ... - * Additional arguments here. - * - * @return - * Return value - * - */ -function foo($bar) { -} - -/** - * Do something. - * - * @return void - */ -public function someFunc(): void -{ - $class = new class - { - /** - * Do something. - * - * @return string - */ - public function getString(): string - { - return 'some string'; - } - }; -} - -/** - * Return description function + mixed return types. - * - * @return boolean|integer This is a description. - */ -function returnTypeWithDescriptionA() -{ - return 5; - -}//end returnTypeWithDescriptionA() - - -/** - * Return description function + mixed return types. - * - * @return float|boolean This is a description. - */ -function returnTypeWithDescriptionB() -{ - return 5; - -}//end returnTypeWithDescriptionB() - - -/** - * Return description function + lots of different mixed return types. - * - * @return integer|object|string[]|float|boolean|array(integer => MyClass)|callable And here we have a description - */ -function returnTypeWithDescriptionC() -{ - return 5; - -}//end returnTypeWithDescriptionC() - - -/** - * Return description function + lots of different mixed return types. - * - * @return array(integer => boolean)|\OtherVendor\Package\SomeClass2|MyClass[]|void And here we have a description - */ -function returnTypeWithDescriptionD() -{ - -}//end returnTypeWithDescriptionD() - -/** - * Yield from test - * - * @return int[] - */ -function yieldFromTest() -{ - yield from foo(); -} - -/** - * Audio - * - * Generates an audio element to embed sounds - * - * @param mixed $src Either a source string or - * an array of sources. - * @param mixed $unsupportedMessage The message to display - * if the media tag is not supported by the browser. - * @param mixed $attributes HTML attributes. - * @return string - */ -function audio( - $src, - $unsupportedMessage = '', - $attributes = '', -) -{ - return 'test'; -} - -/** - * Test function - * - * @return array - */ -function returnArrayWithClosure() -{ - function () { - return; - }; - - return []; -} - -/** - * Test function - * - * @return array - */ -function returnArrayWithAnonymousClass() -{ - new class { - /** - * @return void - */ - public function test() { - return; - } - }; - - return []; -} - -/** - * @return void - */ -function returnVoidWithClosure() -{ - function () { - return 1; - }; -} - -/** - * @return void - */ -function returnVoidWithAnonymousClass() -{ - new class { - /** - * @return integer - */ - public function test() - { - return 1; - } - }; -} - -class TestReturnVoid -{ - /** - * @return void - */ - public function test() - { - function () { - return 4; - }; - } -} - -/** - * Comment here. - * - * @param integer $a This is A. - * @param array $b This is B. - * - * @return void - */ -public static function foo(?int $a, ?array $b) {} - -/** - * Comment here. - * - * @param object $a This is A. - * @param object $b This is B. - * - * @return void - */ -public function foo(object $a, ?object $b) {} - -/** - * Prepares given PHP class method for later code building. - * - * @param integer $foo Comment. - * - Additional comment. - * - * @return void - */ -function foo($foo) {} - -/** - * {@inheritDoc} - */ -public function foo($a, $b) {} - -// phpcs:set Squiz.Commenting.FunctionComment skipIfInheritdoc true - -/** - * {@inheritDoc} - */ -public function foo($a, $b) {} - -/** - * Foo. - * - * @param mixed $a Comment. - * - * @return mixed - */ -public function foo(mixed $a): mixed {} - -// phpcs:set Squiz.Commenting.FunctionComment specialMethods[] -class Bar { - /** - * The PHP5 constructor - */ - public function __construct() { - - } -} - -// phpcs:set Squiz.Commenting.FunctionComment specialMethods[] ignored -/** - * Should be ok - */ -public function ignored() { - -} - -// phpcs:set Squiz.Commenting.FunctionComment specialMethods[] __construct,__destruct diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.php deleted file mode 100644 index 632b7c5..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.php +++ /dev/null @@ -1,177 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class FunctionCommentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - $errors = [ - 5 => 1, - 10 => 3, - 12 => 2, - 13 => 2, - 14 => 1, - 15 => 1, - 28 => 1, - 43 => 1, - 76 => 1, - 87 => 1, - 103 => 1, - 109 => 1, - 112 => 1, - 122 => 1, - 123 => 3, - 124 => 2, - 125 => 1, - 126 => 1, - 137 => 4, - 138 => 4, - 139 => 4, - 143 => 2, - 152 => 1, - 155 => 2, - 159 => 1, - 166 => 1, - 173 => 1, - 183 => 1, - 190 => 2, - 193 => 2, - 196 => 1, - 199 => 2, - 210 => 1, - 211 => 1, - 222 => 1, - 223 => 1, - 224 => 1, - 225 => 1, - 226 => 1, - 227 => 1, - 230 => 2, - 232 => 2, - 246 => 1, - 248 => 4, - 261 => 1, - 263 => 1, - 276 => 1, - 277 => 1, - 278 => 1, - 279 => 1, - 280 => 1, - 281 => 1, - 284 => 1, - 286 => 7, - 294 => 1, - 302 => 1, - 312 => 1, - 358 => 1, - 359 => 2, - 372 => 1, - 373 => 1, - 387 => 1, - 407 => 1, - 441 => 1, - 500 => 1, - 526 => 1, - 548 => 1, - 641 => 1, - 669 => 1, - 688 => 1, - 744 => 1, - 748 => 1, - 767 => 1, - 789 => 1, - 792 => 1, - 794 => 1, - 797 => 1, - 801 => 1, - 828 => 1, - 840 => 1, - 852 => 1, - 864 => 1, - 886 => 1, - 888 => 1, - 890 => 1, - 978 => 1, - 997 => 1, - 1004 => 2, - 1006 => 1, - 1029 => 1, - ]; - - // Scalar type hints only work from PHP 7 onwards. - if (PHP_VERSION_ID >= 70000) { - $errors[17] = 3; - $errors[128] = 1; - $errors[143] = 3; - $errors[161] = 2; - $errors[201] = 1; - $errors[232] = 7; - $errors[363] = 3; - $errors[377] = 1; - $errors[575] = 2; - $errors[627] = 1; - $errors[1002] = 1; - } else { - $errors[729] = 4; - $errors[740] = 2; - $errors[752] = 2; - $errors[982] = 1; - } - - // Object type hints only work from PHP 7.2 onwards. - if (PHP_VERSION_ID >= 70200) { - $errors[627] = 2; - } else { - $errors[992] = 2; - } - - // Mixed type hints only work from PHP 8.0 onwards. - if (PHP_VERSION_ID >= 80000) { - $errors[265] = 1; - $errors[459] = 1; - $errors[893] = 3; - } else { - $errors[1023] = 1; - } - - return $errors; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.inc deleted file mode 100644 index 1b97af0..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.inc +++ /dev/null @@ -1,175 +0,0 @@ - One -// -> One.One -// -> Two - -/* - Here is some inline example code: - -> One - -> One.One - -> Two -*/ - -/** - * Comment should be ignored in PHP 5.4. - * - */ -trait MyTrait { - -} - -$foo = 'foo'; // Var set to foo. - -echo $foo; - -// Comment here. -echo $foo; - -/** - * Comments about the include - */ -include_once($blah); - -// some comment without capital or full stop -echo $foo; // An unrelated comment. - -// An unrelated comment. -echo $foo; // some comment without capital or full stop - -class Foo -{ - // This is fine. - - /** - * Spacing is ignored above. - */ - function bar(){} -} - -if ($foo) { -}//end if -// Another comment here. -$foo++; - -if ($foo) { -}//end if -// another comment here. -$foo++; - -/** - * Comment should be ignored, even though there is an attribute between the docblock and the class declaration. - */ - -#[AttributeA] - -final class MyClass -{ - /** - * Comment should be ignored, even though there is an attribute between the docblock and the function declaration - */ - #[AttributeA] - #[AttributeB] - final public function test() {} -} - -/* - * N.B.: The below test line must be the last test in the file. - * Testing that a new line after an inline comment when it's the last non-whitespace - * token in a file, does *not* throw an error as this would conflict with the common - * "new line required at end of file" rule. - */ - -// For this test line having an empty line below it, is fine. diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.inc.fixed deleted file mode 100644 index 6b66624..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.inc.fixed +++ /dev/null @@ -1,168 +0,0 @@ - One -// -> One.One -// -> Two -/* - Here is some inline example code: - -> One - -> One.One - -> Two -*/ - -/** - * Comment should be ignored in PHP 5.4. - * - */ -trait MyTrait { - -} - -$foo = 'foo'; // Var set to foo. - -echo $foo; - -// Comment here. -echo $foo; - -/** - * Comments about the include - */ -include_once($blah); - -// some comment without capital or full stop -echo $foo; // An unrelated comment. - -// An unrelated comment. -echo $foo; // some comment without capital or full stop - -class Foo -{ - // This is fine. - - /** - * Spacing is ignored above. - */ - function bar(){} -} - -if ($foo) { -}//end if -// Another comment here. -$foo++; - -if ($foo) { -}//end if -// another comment here. -$foo++; - -/** - * Comment should be ignored, even though there is an attribute between the docblock and the class declaration. - */ - -#[AttributeA] - -final class MyClass -{ - /** - * Comment should be ignored, even though there is an attribute between the docblock and the function declaration - */ - #[AttributeA] - #[AttributeB] - final public function test() {} -} - -/* - * N.B.: The below test line must be the last test in the file. - * Testing that a new line after an inline comment when it's the last non-whitespace - * token in a file, does *not* throw an error as this would conflict with the common - * "new line required at end of file" rule. - */ - -// For this test line having an empty line below it, is fine. diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.js b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.js deleted file mode 100644 index 6b1093e..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.js +++ /dev/null @@ -1,129 +0,0 @@ -// Some content here. -var code = 'hello'; - -// This comment contains # multiple -// hash signs (#). -code = 'hello'; - -/** - * This is the first line of a function comment. - * This is the second line. - */ -function testFunction() -{ - // Callback methods which are added by external objects. - this.callbacks = {}; - -}//end testFunction() - -/** - * This is the first line of a class comment. - * This is the second line. - */ -myClass.prototype = { - - /** - * This is the first line of a method comment. - * This is the second line. - */ - load: function(url, callback) - { - // Some code here. - - } -}; - -// some code goes here! - -/* - A longer comment goes here. - It spans multiple lines!! - Or does it? -*/ - -// 0This is a simple multi-line -// comment! -code = 'hello'; - -//This is not valid. -code = 'hello'; - -// Neither is this! -code = 'hello'; - -// -code = 'hello'; - -/** Neither is this! **/ -code = 'hello'; - -/** - * This is the first line of a function comment. - * This is the second line. - */ -var myFunction = function() { -} - -/** - * This is the first line of a function comment. - * This is the second line. - */ -myFunction = function() { -} - -/** - * This is the first line of a function comment. - * This is the second line. - */ -myClass.myFunction = function() { -} - -dfx.getIframeDocument = function(iframe) -{ - return doc; - -};//end dfx.getIframeDocument() - -mig.Gallery.prototype = { - - init: function(cb) - { - - },//end init() - - imageClicked: function(id) - { - - }//end imageClicked() - -}; - -// Here is some inline example code: -// -> One -// -> One.One -// -> Two - -/* - Here is some inline example code: - -> One - -> One.One - -> Two -*/ - - -var foo = 'foo'; // Var set to foo. - -console.info(foo); - -// Comment here. -console.info(foo); - -//** -* invalid comment -*/ - -// some comment without capital or full stop -console.log(foo); // An unrelated comment. - -// An unrelated comment. -console.log(foo); // some comment without capital or full stop diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.js.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.js.fixed deleted file mode 100644 index 20e5041..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.js.fixed +++ /dev/null @@ -1,125 +0,0 @@ -// Some content here. -var code = 'hello'; - -// This comment contains # multiple -// hash signs (#). -code = 'hello'; - -/** - * This is the first line of a function comment. - * This is the second line. - */ -function testFunction() -{ - // Callback methods which are added by external objects. - this.callbacks = {}; - -}//end testFunction() - -/** - * This is the first line of a class comment. - * This is the second line. - */ -myClass.prototype = { - - /** - * This is the first line of a method comment. - * This is the second line. - */ - load: function(url, callback) - { - // Some code here. - } -}; - -// some code goes here! -/* - A longer comment goes here. - It spans multiple lines!! - Or does it? -*/ - -// 0This is a simple multi-line -// comment! -code = 'hello'; - -// This is not valid. -code = 'hello'; - -// Neither is this! -code = 'hello'; - -code = 'hello'; - -/** Neither is this! **/ -code = 'hello'; - -/** - * This is the first line of a function comment. - * This is the second line. - */ -var myFunction = function() { -} - -/** - * This is the first line of a function comment. - * This is the second line. - */ -myFunction = function() { -} - -/** - * This is the first line of a function comment. - * This is the second line. - */ -myClass.myFunction = function() { -} - -dfx.getIframeDocument = function(iframe) -{ - return doc; - -};//end dfx.getIframeDocument() - -mig.Gallery.prototype = { - - init: function(cb) - { - - },//end init() - - imageClicked: function(id) - { - - }//end imageClicked() - -}; - -// Here is some inline example code: -// -> One -// -> One.One -// -> Two -/* - Here is some inline example code: - -> One - -> One.One - -> Two -*/ - - -var foo = 'foo'; // Var set to foo. - -console.info(foo); - -// Comment here. -console.info(foo); - -// ** -* invalid comment -*/ - -// some comment without capital or full stop -console.log(foo); // An unrelated comment. - -// An unrelated comment. -console.log(foo); // some comment without capital or full stop diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.php deleted file mode 100644 index e4a5298..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.php +++ /dev/null @@ -1,91 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class InlineCommentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='InlineCommentUnitTest.inc') - { - switch ($testFile) { - case 'InlineCommentUnitTest.inc': - $errors = [ - 17 => 1, - 27 => 1, - 28 => 1, - 32 => 2, - 36 => 1, - 44 => 2, - 58 => 1, - 61 => 1, - 64 => 1, - 67 => 1, - 95 => 1, - 96 => 1, - 97 => 3, - 118 => 1, - 126 => 2, - 130 => 2, - 149 => 1, - ]; - - return $errors; - case 'InlineCommentUnitTest.js': - return [ - 31 => 1, - 36 => 2, - 48 => 1, - 51 => 1, - 54 => 1, - 57 => 1, - 102 => 1, - 103 => 1, - 104 => 3, - 118 => 1, - 121 => 1, - 125 => 2, - 129 => 2, - ]; - default: - return []; - }//end switch - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.inc deleted file mode 100644 index d6c4cf6..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.inc +++ /dev/null @@ -1,1033 +0,0 @@ - match ($foo) { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - // Line 10 - // Line 11 - // Line 12 - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 - }, -]; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.inc.fixed deleted file mode 100644 index 176cfe2..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.inc.fixed +++ /dev/null @@ -1,1033 +0,0 @@ - match ($foo) { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - // Line 10 - // Line 11 - // Line 12 - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 - },//end match -]; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.js b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.js deleted file mode 100644 index c0cf282..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.js +++ /dev/null @@ -1,444 +0,0 @@ -function long_function() -{ - if (longFunction) { - // This is a long - // IF statement - // that does - // not have - // an ELSE - // block on it - variable = 'hello'; - - if (variable === 'hello') { - // This is a short - // IF statement - } - - if (variable === 'hello') { - // This is a short - // IF statement - } else { - // This is a short ELSE - // statement - } - }//end if - - if (longFunction) { - // This is a long - // IF statement - // that does - // not have - // an ELSE - // block on it - variable = 'hello'; - - if (variable === 'hello') { - // This is a short - // IF statement - } - - if (variable === 'hello') { - // This is a short - // IF statement - } else { - // This is a short ELSE - // statement - } - } - - if (longFunction) { - // This is a long - // IF statement - // that does - // not have - // an ELSE - // block on it - variable = 'hello'; - - if (variable === 'hello') { - // This is a short - // IF statement - } - - if (variable === 'hello') { - // This is a short - // IF statement - } else { - // This is a short ELSE - // statement - } - } else { - // Short ELSE - }//end if - - if (longFunction) { - // This is a long - // IF statement - // that does - // not have - // an ELSE - // block on it - variable = 'hello'; - - if (variable === 'hello') { - // This is a short - // IF statement - } - - if (variable === 'hello') { - // This is a short - // IF statement - } else { - // This is a short ELSE - // statement - } - } else { - // Short ELSE - } -} - -for (variable=1; variable < 20; variable++) { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - // Line 10 - // Line 11 - // Line 12 - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 -}//end for - -for (variable=1; variable < 20; variable++) { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - for (val =1; val < 20; val++) { - // Short for. - } - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 -} - -while (variable < 20) { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - // Line 10 - // Line 11 - // Line 12 - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 -}//end while - -while (variable < 20) { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - while (something) { - // Short while. - } - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 -} - -if (longFunction) { - // This is a long - // IF statement - // that does - // not have - // an ELSE - // block on it - variable = 'hello'; - - if (variable === 'hello') { - // This is a short - // IF statement - } - - if (variable === 'hello') { - // This is a short - // IF statement - } else { - // This is a short ELSE - // statement - } -} //end if - -if (longFunction) { - // This is a long - // IF statement - // that does - // not have - // an ELSE - // block on it - variable = 'hello'; - - if (variable === 'hello') { - // This is a short - // IF statement - } - - if (variable === 'hello') { - // This is a short - // IF statement - } else { - // This is a short ELSE - // statement - } -} else { - // Short ELSE -} //end if - -for (variable=1; variable < 20; variable++) { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - // Line 10 - // Line 11 - // Line 12 - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 -} //end for - -while (variable < 20) { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - // Line 10 - // Line 11 - // Line 12 - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 -} //end while - -while (variable < 20) { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - // Line 10 - // Line 11 - // Line 12 - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 -}//end for - -if (true) { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - // Line 10 - // Line 11 - // Line 12 - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 -} else if (condition) { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - // Line 10 - // Line 11 - // Line 12 - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 -} else { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - // Line 10 - // Line 11 - // Line 12 - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 -}//end if - -if (something) { - // Line 1 - // Line 2 -} else if (somethingElse) { - // Line 1 - // Line 2 -} else { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - // Line 10 - // Line 11 - // Line 12 - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 -} - -switch (something) { - case '1': - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - break; - case '2': - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - break; - case '3': - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - break; - case '4': - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - break; - case '5': - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - break; -} - -// Wrong comment -if (condition) { - condition = true; -}//end foreach diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.js.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.js.fixed deleted file mode 100644 index 231b51c..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.js.fixed +++ /dev/null @@ -1,444 +0,0 @@ -function long_function() -{ - if (longFunction) { - // This is a long - // IF statement - // that does - // not have - // an ELSE - // block on it - variable = 'hello'; - - if (variable === 'hello') { - // This is a short - // IF statement - } - - if (variable === 'hello') { - // This is a short - // IF statement - } else { - // This is a short ELSE - // statement - } - }//end if - - if (longFunction) { - // This is a long - // IF statement - // that does - // not have - // an ELSE - // block on it - variable = 'hello'; - - if (variable === 'hello') { - // This is a short - // IF statement - } - - if (variable === 'hello') { - // This is a short - // IF statement - } else { - // This is a short ELSE - // statement - } - }//end if - - if (longFunction) { - // This is a long - // IF statement - // that does - // not have - // an ELSE - // block on it - variable = 'hello'; - - if (variable === 'hello') { - // This is a short - // IF statement - } - - if (variable === 'hello') { - // This is a short - // IF statement - } else { - // This is a short ELSE - // statement - } - } else { - // Short ELSE - }//end if - - if (longFunction) { - // This is a long - // IF statement - // that does - // not have - // an ELSE - // block on it - variable = 'hello'; - - if (variable === 'hello') { - // This is a short - // IF statement - } - - if (variable === 'hello') { - // This is a short - // IF statement - } else { - // This is a short ELSE - // statement - } - } else { - // Short ELSE - }//end if -} - -for (variable=1; variable < 20; variable++) { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - // Line 10 - // Line 11 - // Line 12 - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 -}//end for - -for (variable=1; variable < 20; variable++) { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - for (val =1; val < 20; val++) { - // Short for. - } - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 -}//end for - -while (variable < 20) { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - // Line 10 - // Line 11 - // Line 12 - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 -}//end while - -while (variable < 20) { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - while (something) { - // Short while. - } - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 -}//end while - -if (longFunction) { - // This is a long - // IF statement - // that does - // not have - // an ELSE - // block on it - variable = 'hello'; - - if (variable === 'hello') { - // This is a short - // IF statement - } - - if (variable === 'hello') { - // This is a short - // IF statement - } else { - // This is a short ELSE - // statement - } -} //end if - -if (longFunction) { - // This is a long - // IF statement - // that does - // not have - // an ELSE - // block on it - variable = 'hello'; - - if (variable === 'hello') { - // This is a short - // IF statement - } - - if (variable === 'hello') { - // This is a short - // IF statement - } else { - // This is a short ELSE - // statement - } -} else { - // Short ELSE -} //end if - -for (variable=1; variable < 20; variable++) { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - // Line 10 - // Line 11 - // Line 12 - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 -} //end for - -while (variable < 20) { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - // Line 10 - // Line 11 - // Line 12 - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 -} //end while - -while (variable < 20) { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - // Line 10 - // Line 11 - // Line 12 - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 -}//end while - -if (true) { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - // Line 10 - // Line 11 - // Line 12 - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 -} else if (condition) { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - // Line 10 - // Line 11 - // Line 12 - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 -} else { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - // Line 10 - // Line 11 - // Line 12 - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 -}//end if - -if (something) { - // Line 1 - // Line 2 -} else if (somethingElse) { - // Line 1 - // Line 2 -} else { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - // Line 10 - // Line 11 - // Line 12 - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 -}//end if - -switch (something) { - case '1': - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - break; - case '2': - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - break; - case '3': - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - break; - case '4': - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - break; - case '5': - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - break; -}//end switch - -// Wrong comment -if (condition) { - condition = true; -}//end if diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.php deleted file mode 100644 index 5b61612..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.php +++ /dev/null @@ -1,103 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class LongConditionClosingCommentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='LongConditionClosingCommentUnitTest.inc') - { - switch ($testFile) { - case 'LongConditionClosingCommentUnitTest.inc': - return [ - 49 => 1, - 99 => 1, - 146 => 1, - 192 => 1, - 215 => 1, - 238 => 1, - 261 => 1, - 286 => 1, - 309 => 1, - 332 => 1, - 355 => 1, - 378 => 1, - 493 => 1, - 531 => 1, - 536 => 1, - 540 => 1, - 562 => 1, - 601 => 1, - 629 => 1, - 663 => 1, - 765 => 1, - 798 => 1, - 811 => 1, - 897 => 1, - 931 => 1, - 962 => 1, - 985 => 2, - 1008 => 1, - 1032 => 1, - ]; - break; - case 'LongConditionClosingCommentUnitTest.js': - return [ - 47 => 1, - 97 => 1, - 144 => 1, - 190 => 1, - 213 => 1, - 238 => 1, - 261 => 1, - 284 => 1, - 307 => 1, - 401 => 1, - 439 => 1, - 444 => 1, - ]; - break; - default: - return []; - break; - }//end switch - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.1.js b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.1.js deleted file mode 100644 index 6de6421..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.1.js +++ /dev/null @@ -1,36 +0,0 @@ -function test(id, buttons) // cool function -{ - alert('hello'); - alert('hello again'); // And again. - // Valid comment. - -}//end test() - -var good = true; // Indeed. - -mig.Gallery.prototype = { - - init: function(cb) - { - - },//end init() - - imageClicked: function(id) - { - - }//end imageClicked() - -}; - -dfx.getIframeDocument = function(iframe) -{ - - return doc; - -};//end dfx.getIframeDocument() - -// Verify that multi-line control structure with comments and annotations are left alone. -if (condition // comment - && anotherCondition) { - condition = true; -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.1.js.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.1.js.fixed deleted file mode 100644 index 1953760..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.1.js.fixed +++ /dev/null @@ -1,39 +0,0 @@ -function test(id, buttons) -// cool function -{ - alert('hello'); - alert('hello again'); -// And again. - // Valid comment. - -}//end test() - -var good = true; -// Indeed. - -mig.Gallery.prototype = { - - init: function(cb) - { - - },//end init() - - imageClicked: function(id) - { - - }//end imageClicked() - -}; - -dfx.getIframeDocument = function(iframe) -{ - - return doc; - -};//end dfx.getIframeDocument() - -// Verify that multi-line control structure with comments and annotations are left alone. -if (condition // comment - && anotherCondition) { - condition = true; -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.2.js b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.2.js deleted file mode 100644 index 88d0e7d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.2.js +++ /dev/null @@ -1,2 +0,0 @@ -// Comment as first thing in a JS file. -var i = 100; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.inc deleted file mode 100644 index b834696..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.inc +++ /dev/null @@ -1,54 +0,0 @@ - function($b) { - }, // comment. - 'key' => 'value', // phpcs:ignore Standard.Category.SniffName -- for reasons. - 'key' => 'value', // comment. -]; - -// Verify that multi-line control structure with comments and annotations are left alone. -for ( - $i = 0; /* Start */ - $i < 10; /* phpcs:ignore Standard.Category.SniffName -- for reasons. */ - $i++ // comment - -) {} - -if ( $condition === true // comment - && $anotherCondition === false -) {} - -$match = match($foo // comment - && $bar -) { - 1 => 1, // comment -}; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.inc.fixed deleted file mode 100644 index 21a4bbe..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.inc.fixed +++ /dev/null @@ -1,59 +0,0 @@ - function($b) { - }, // comment. - 'key' => 'value', // phpcs:ignore Standard.Category.SniffName -- for reasons. - 'key' => 'value', -// comment. -]; - -// Verify that multi-line control structure with comments and annotations are left alone. -for ( - $i = 0; /* Start */ - $i < 10; /* phpcs:ignore Standard.Category.SniffName -- for reasons. */ - $i++ // comment - -) {} - -if ( $condition === true // comment - && $anotherCondition === false -) {} - -$match = match($foo // comment - && $bar -) { - 1 => 1, -// comment -}; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.php deleted file mode 100644 index a04426f..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.php +++ /dev/null @@ -1,69 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class PostStatementCommentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='PostStatementCommentUnitTest.inc') - { - switch ($testFile) { - case 'PostStatementCommentUnitTest.inc': - return [ - 6 => 1, - 10 => 1, - 18 => 1, - 35 => 1, - 53 => 1, - ]; - - case 'PostStatementCommentUnitTest.1.js': - return [ - 1 => 1, - 4 => 1, - 9 => 1, - ]; - - default: - return []; - }//end switch - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.inc deleted file mode 100644 index c2046b1..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.inc +++ /dev/null @@ -1,385 +0,0 @@ - $content) { - echo $content; - } - - return $var1; - - }//end checkVariable() - - - /** - * - * - */ - $emptyVarDoc = ''; - - /** - * Var type checking (int v.s. integer). - * - * @var int - */ - private $_varSimpleTypeCheck; - - - /** - * Var type checking (array(int => string) v.s. array(int => string)). - * - * @var array(int => string) - */ - private $_varArrayTypeCheck; - - - /** - * Boolean @var tag Capitalized - * - * @var Boolean - */ - public $CapBoolTag = true; - - - /** - * Boolean @var tag Capitalized - * - * @var BOOLEAN - */ - public $CapBoolTag2 = true; - - - /** - * Double @var tag Capitalized - * - * @var Double - */ - public $CapDoubleTag = 1; - - - /** - * Double @var tag Capitalized - * - * @var DOUBLE - */ - public $CapDoubleTag2 = 1; - - - /** - * Real @var tag Capitalized - * - * @var Real - */ - public $CapRealTag = 1; - - - /** - * Real @var tag Capitalized - * - * @var REAL - */ - public $CapRealTag2 = 1; - - - /** - * Float @var tag Capitalized - * - * @var Float - */ - public $CapFloatTag = 1; - - - /** - * Float @var tag Capitalized - * - * @var FLOAT - */ - public $CapFloatTag2 = 1; - - - /** - * Int @var tag Capitalized - * - * @var Int - */ - public $CapIntTag = 1; - - - /** - * Int @var tag Capitalized - * - * @var INT - */ - public $CapIntTag2 = 1; - - - /** - * Integer @var tag Capitalized - * - * @var Integer - */ - public $CapIntTag3 = 1; - - - /** - * Integer @var tag Capitalized - * - * @var INTEGER - */ - public $CapIntTag4 = 1; - - - /** - * Array @var tag Capitalized - * - * @var Array - */ - public $CapVarTag = []; - - - /** - * Array @var tag All Caps - * - * @var ARRAY - */ - public $CapVarTag2 = []; - - - /** - * Array @var tag Capitalized - * - * @var Array() - */ - public $CapVarTag3 = []; - - - /** - * Array @var tag All Caps - * - * @var ARRAY() - */ - public $CapVarTag4 = []; - - - /** - * Var type checking (STRING v.s. string). - * - * @var STRING - */ - private $_varCaseTypeCheck; - - - /** - * @var integer - */ - private $_varWithNoShortComment; - - protected $noComment2 = ''; - - - /** - * @var int Var type checking (int v.s. integer) with single-line comment. - */ - private $_varSimpleTypeCheckSingleLine; - - -}//end class - - -/** - * VariableCommentUnitTest2. - * - * Long description goes here. - * - */ -class VariableCommentUnitTest2 -{ - - public $hello; - - /** Comment starts here. - * - * @var string - * - */ - private $_varCaseTypeCheck; - - /** - * 这是一条测试评论. - * - * @var string - */ - public $foo; - -}//end class - - -/* - * Class comment - */ -class Foo -{ - - protected $bar; - - /** - * Short description of the member variable. - * - * @var array - */ - public static array $variableName = array(); - -} - -class Foo -{ - - /** - * Short description of the member variable. - * - * @var array - */ - public array $variableName = array(); - - - // Not "/**" style comment. - // - // @var string - private ?Folder\ClassName $_incorrectCommentStyle = null; - - - var int $noComment = 1; - } - -class HasAttributes -{ - /** - * Short description of the member variable. - * - * @var array - */ - #[ORM\Id]#[ORM\Column("integer")] - private $id; - - /** - * Short description of the member variable. - * - * @var array - */ - #[ORM\GeneratedValue] - #[ORM\Column(ORM\Column::T_INTEGER)] - protected $height; -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.inc.fixed deleted file mode 100644 index 37ca1ce..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.inc.fixed +++ /dev/null @@ -1,385 +0,0 @@ - $content) { - echo $content; - } - - return $var1; - - }//end checkVariable() - - - /** - * - * - */ - $emptyVarDoc = ''; - - /** - * Var type checking (int v.s. integer). - * - * @var integer - */ - private $_varSimpleTypeCheck; - - - /** - * Var type checking (array(int => string) v.s. array(int => string)). - * - * @var array(integer => string) - */ - private $_varArrayTypeCheck; - - - /** - * Boolean @var tag Capitalized - * - * @var boolean - */ - public $CapBoolTag = true; - - - /** - * Boolean @var tag Capitalized - * - * @var boolean - */ - public $CapBoolTag2 = true; - - - /** - * Double @var tag Capitalized - * - * @var float - */ - public $CapDoubleTag = 1; - - - /** - * Double @var tag Capitalized - * - * @var float - */ - public $CapDoubleTag2 = 1; - - - /** - * Real @var tag Capitalized - * - * @var float - */ - public $CapRealTag = 1; - - - /** - * Real @var tag Capitalized - * - * @var float - */ - public $CapRealTag2 = 1; - - - /** - * Float @var tag Capitalized - * - * @var float - */ - public $CapFloatTag = 1; - - - /** - * Float @var tag Capitalized - * - * @var float - */ - public $CapFloatTag2 = 1; - - - /** - * Int @var tag Capitalized - * - * @var integer - */ - public $CapIntTag = 1; - - - /** - * Int @var tag Capitalized - * - * @var integer - */ - public $CapIntTag2 = 1; - - - /** - * Integer @var tag Capitalized - * - * @var integer - */ - public $CapIntTag3 = 1; - - - /** - * Integer @var tag Capitalized - * - * @var integer - */ - public $CapIntTag4 = 1; - - - /** - * Array @var tag Capitalized - * - * @var array - */ - public $CapVarTag = []; - - - /** - * Array @var tag All Caps - * - * @var array - */ - public $CapVarTag2 = []; - - - /** - * Array @var tag Capitalized - * - * @var array - */ - public $CapVarTag3 = []; - - - /** - * Array @var tag All Caps - * - * @var array - */ - public $CapVarTag4 = []; - - - /** - * Var type checking (STRING v.s. string). - * - * @var string - */ - private $_varCaseTypeCheck; - - - /** - * @var integer - */ - private $_varWithNoShortComment; - - protected $noComment2 = ''; - - - /** - * @var integer Var type checking (int v.s. integer) with single-line comment. - */ - private $_varSimpleTypeCheckSingleLine; - - -}//end class - - -/** - * VariableCommentUnitTest2. - * - * Long description goes here. - * - */ -class VariableCommentUnitTest2 -{ - - public $hello; - - /** Comment starts here. - * - * @var string - * - */ - private $_varCaseTypeCheck; - - /** - * 这是一条测试评论. - * - * @var string - */ - public $foo; - -}//end class - - -/* - * Class comment - */ -class Foo -{ - - protected $bar; - - /** - * Short description of the member variable. - * - * @var array - */ - public static array $variableName = array(); - -} - -class Foo -{ - - /** - * Short description of the member variable. - * - * @var array - */ - public array $variableName = array(); - - - // Not "/**" style comment. - // - // @var string - private ?Folder\ClassName $_incorrectCommentStyle = null; - - - var int $noComment = 1; - } - -class HasAttributes -{ - /** - * Short description of the member variable. - * - * @var array - */ - #[ORM\Id]#[ORM\Column("integer")] - private $id; - - /** - * Short description of the member variable. - * - * @var array - */ - #[ORM\GeneratedValue] - #[ORM\Column(ORM\Column::T_INTEGER)] - protected $height; -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.php deleted file mode 100644 index f3ee3c7..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.php +++ /dev/null @@ -1,81 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class VariableCommentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 21 => 1, - 24 => 1, - 56 => 1, - 64 => 1, - 73 => 1, - 84 => 1, - 130 => 1, - 136 => 1, - 144 => 1, - 152 => 1, - 160 => 1, - 168 => 1, - 176 => 1, - 184 => 1, - 192 => 1, - 200 => 1, - 208 => 1, - 216 => 1, - 224 => 1, - 232 => 1, - 240 => 1, - 248 => 1, - 256 => 1, - 264 => 1, - 272 => 1, - 280 => 1, - 290 => 1, - 294 => 1, - 311 => 1, - 336 => 1, - 361 => 1, - 364 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return [93 => 1]; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.inc deleted file mode 100644 index 8eaf1b0..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.inc +++ /dev/null @@ -1,310 +0,0 @@ - 0); - -do -{ - echo $i; -} while ($i > 0); - -do -{ - echo $i; -} -while ($i > 0); - -do { echo $i; } while ($i > 0); - -do{ - echo $i; -}while($i > 0); - -while ($i < 1) { - echo $i; -} - -while($i < 1){ - echo $i; -} - -while ($i < 1) { echo $i; } - -for ($i = 1; $i < 1; $i++) { - echo $i; -} - -for($i = 1; $i < 1; $i++){ - echo $i; -} - -for ($i = 1; $i < 1; $i++) { echo $i; } - -if ($i == 0) { - $i = 1; -} - -if($i == 0){ - $i = 1; -} - -if ($i == 0) { $i = 1; } - -if ($i == 0) { - $i = 1; -} else { - $i = 0; -} - -if ($i == 0) { - $i = 1; -}else{ - $i = 0; -} - -if ($i == 0) { $i = 1; } else { $i = 0; } - -if ($i == 0) { - $i = 1; -} else if ($i == 2) { - $i = 0; -} - -if ($i == 0) { - $i = 1; -}else if($i == 2){ - $i = 0; -} - -if ($i == 0) { $i = 1; } else if ($i == 2) { $i = 0; } - -if ($i == 0) { // comments are allowed - $i = 1; -} - -if ($i == 0) {// comments are allowed - $i = 1; -} - -if ($i == 0) { /* comments are allowed*/ - $i = 1; -} - -if ($i == 0) -{ // this is ok - $i = 1; -} - -if ($i == 0) /* this is ok */ { -} - -try { - $code = 'this'; -} catch (Exception $e) { - // Caught! -} - -try { $code = 'this'; } catch (Exception $e) { - // Caught! -} - -do { echo $i; -} while ($i > 0); - -if ($i === 0) { - - $i = 1 -} - -if ($a) { - -} -elseif ($b) { -} - -foreach ($items as $item) { - echo $item; -} - -foreach($items as $item){ - echo $item; -} - -if ($a && $b) // && $c) -{ -} - -if ($a == 5) : - echo "a equals 5"; - echo "..."; -elseif ($a == 6) : - echo "a equals 6"; - echo "!!!"; -else : - echo "a is neither 5 nor 6"; -endif; - -try { - // try body -} -catch (FirstExceptionType $e) { - // catch body -} -catch (OtherExceptionType $e) { - // catch body -} - -switch($foo) { - - case 'bar': - break; - -} - -if ($foo) : -endif; - -?> - -getRow()): ?> -

    - - - -
    - -
    - - - - - - - hello - - - - hello - - - - -getRow()) : ?> -

    - - - - - - - - hello - - - - hello - - 1, -}; - -$r = match($x){1 => 1}; - -// Intentional parse error. This should be the last test in the file. -foreach - // Some unrelated comment. diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.inc.fixed deleted file mode 100644 index dc5233d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.inc.fixed +++ /dev/null @@ -1,314 +0,0 @@ - 0); - -do { - echo $i; -} while ($i > 0); - -do { - echo $i; -} while ($i > 0); - -do { -echo $i; } while ($i > 0); - -do { - echo $i; -} while ($i > 0); - -while ($i < 1) { - echo $i; -} - -while ($i < 1) { - echo $i; -} - -while ($i < 1) { -echo $i; } - -for ($i = 1; $i < 1; $i++) { - echo $i; -} - -for ($i = 1; $i < 1; $i++) { - echo $i; -} - -for ($i = 1; $i < 1; $i++) { -echo $i; } - -if ($i == 0) { - $i = 1; -} - -if ($i == 0) { - $i = 1; -} - -if ($i == 0) { -$i = 1; } - -if ($i == 0) { - $i = 1; -} else { - $i = 0; -} - -if ($i == 0) { - $i = 1; -} else { - $i = 0; -} - -if ($i == 0) { -$i = 1; } else { -$i = 0; } - -if ($i == 0) { - $i = 1; -} else if ($i == 2) { - $i = 0; -} - -if ($i == 0) { - $i = 1; -} else if ($i == 2) { - $i = 0; -} - -if ($i == 0) { -$i = 1; } else if ($i == 2) { -$i = 0; } - -if ($i == 0) { // comments are allowed - $i = 1; -} - -if ($i == 0) {// comments are allowed - $i = 1; -} - -if ($i == 0) { /* comments are allowed*/ - $i = 1; -} - -if ($i == 0) { // this is ok - $i = 1; -} - -if ($i == 0) { /* this is ok */ -} - -try { - $code = 'this'; -} catch (Exception $e) { - // Caught! -} - -try { -$code = 'this'; } catch (Exception $e) { - // Caught! -} - -do { -echo $i; -} while ($i > 0); - -if ($i === 0) { - - $i = 1 -} - -if ($a) { - -} elseif ($b) { -} - -foreach ($items as $item) { - echo $item; -} - -foreach ($items as $item) { - echo $item; -} - -if ($a && $b) { // && $c) -} - -if ($a == 5) : - echo "a equals 5"; - echo "..."; -elseif ($a == 6) : - echo "a equals 6"; - echo "!!!"; -else : - echo "a is neither 5 nor 6"; -endif; - -try { - // try body -} catch (FirstExceptionType $e) { - // catch body -} catch (OtherExceptionType $e) { - // catch body -} - -switch ($foo) { - - case 'bar': - break; - -} - -if ($foo) : -endif; - -?> - -getRow()) : ?> -

    - - - -
    - -
    - - - - - - - hello - - - - hello - - - - -getRow()): ?> -

    - - - - - - - - hello - - - - hello - - 1, -}; - -$r = match ($x) { -1 => 1}; - -// Intentional parse error. This should be the last test in the file. -foreach - // Some unrelated comment. diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.js b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.js deleted file mode 100644 index 6c2e9ff..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.js +++ /dev/null @@ -1,135 +0,0 @@ - -i = 0; -do { - i = 0; -} while (i > 0); - -do -{ - i = 0; -} while (i > 0); - -do -{ - i = 0; -} -while (i > 0); - -do { i = 0; } while (i > 0); - -do{ - i = 0; -}while(i > 0); - -while (i < 1) { - i = 0; -} - -while(i < 1){ - i = 0; -} - -while (i < 1) { i = 0; } - -for (i = 1; i < 1; i++) { - i = 0; -} - -for(i = 1; i < 1; i++){ - i = 0; -} - -for (i = 1; i < 1; i++) { i = 0; } - -if (i == 0) { - i = 1; -} - -if(i == 0){ - i = 1; -} - -if (i == 0) { i = 1; } - -if (i == 0) { - i = 1; -} else { - i = 0; -} - -if (i == 0) { - i = 1; -}else{ - i = 0; -} - -if (i == 0) { i = 1; } else { i = 0; } - -if (i == 0) { - i = 1; -} else if (i == 2) { - i = 0; -} - -if (i == 0) { - i = 1; -}else if(i == 2){ - i = 0; -} - -if (i == 0) { i = 1; } else if (i == 2) { i = 0; } - -if (i == 0) { // comments are allowed - i = 1; -} - -if (i == 0) {// comments are allowed - i = 1; -} - -if (i == 0) { /* comments are allowed*/ - i = 1; -} - -if (i == 0) -{ // this is ok - i = 1; -} - -if (i == 0) /* this is ok */ { -} - -try { - code = 'this'; -} catch (e) { - // Caught! -} - -try { code = 'this'; } catch (e) { - // Caught! -} - -do { i = 0; -} while (i > 0); - -if (i === 0) { - - i = 1 -} - -if (window.jQuery)(function($) { - $.fn.reset = function() { - return this.each(function() { - try { - this.reset(); - } catch (e) { - } - }); - }; -})(jQuery); - -if ($("#myid").rotationDegrees()=='90') - $('.modal').css({'transform': 'rotate(90deg)'}); - -if ($("#myid").rotationDegrees()=='90') - $foo = {'transform': 'rotate(90deg)'}; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.js.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.js.fixed deleted file mode 100644 index e3ed6de..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.js.fixed +++ /dev/null @@ -1,141 +0,0 @@ - -i = 0; -do { - i = 0; -} while (i > 0); - -do { - i = 0; -} while (i > 0); - -do { - i = 0; -} while (i > 0); - -do { -i = 0; } while (i > 0); - -do { - i = 0; -} while (i > 0); - -while (i < 1) { - i = 0; -} - -while (i < 1) { - i = 0; -} - -while (i < 1) { -i = 0; } - -for (i = 1; i < 1; i++) { - i = 0; -} - -for (i = 1; i < 1; i++) { - i = 0; -} - -for (i = 1; i < 1; i++) { -i = 0; } - -if (i == 0) { - i = 1; -} - -if (i == 0) { - i = 1; -} - -if (i == 0) { -i = 1; } - -if (i == 0) { - i = 1; -} else { - i = 0; -} - -if (i == 0) { - i = 1; -} else { - i = 0; -} - -if (i == 0) { -i = 1; } else { -i = 0; } - -if (i == 0) { - i = 1; -} else if (i == 2) { - i = 0; -} - -if (i == 0) { - i = 1; -} else if (i == 2) { - i = 0; -} - -if (i == 0) { -i = 1; } else if (i == 2) { -i = 0; } - -if (i == 0) { // comments are allowed - i = 1; -} - -if (i == 0) {// comments are allowed - i = 1; -} - -if (i == 0) { /* comments are allowed*/ - i = 1; -} - -if (i == 0) { // this is ok - i = 1; -} - -if (i == 0) { /* this is ok */ -} - -try { - code = 'this'; -} catch (e) { - // Caught! -} - -try { -code = 'this'; } catch (e) { - // Caught! -} - -do { -i = 0; -} while (i > 0); - -if (i === 0) { - - i = 1 -} - -if (window.jQuery)(function($) { - $.fn.reset = function() { - return this.each(function() { - try { - this.reset(); - } catch (e) { - } - }); - }; -})(jQuery); - -if ($("#myid").rotationDegrees()=='90') - $('.modal').css({'transform': 'rotate(90deg)'}); - -if ($("#myid").rotationDegrees()=='90') - $foo = {'transform': 'rotate(90deg)'}; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.php deleted file mode 100644 index 92427f0..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.php +++ /dev/null @@ -1,102 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\ControlStructures; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ControlSignatureUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='ControlSignatureUnitTest.inc') - { - $errors = [ - 7 => 1, - 12 => 1, - 15 => 1, - 18 => 1, - 20 => 1, - 22 => 2, - 28 => 2, - 32 => 1, - 38 => 2, - 42 => 1, - 48 => 2, - 52 => 1, - 62 => 2, - 66 => 2, - 76 => 4, - 80 => 2, - 94 => 1, - 99 => 1, - 108 => 1, - 112 => 1, - ]; - - if ($testFile === 'ControlSignatureUnitTest.inc') { - $errors[122] = 1; - $errors[130] = 2; - $errors[134] = 1; - $errors[150] = 1; - $errors[153] = 1; - $errors[158] = 1; - $errors[165] = 1; - $errors[170] = 2; - $errors[185] = 1; - $errors[190] = 2; - $errors[191] = 2; - $errors[195] = 1; - $errors[227] = 1; - $errors[234] = 1; - $errors[239] = 2; - $errors[243] = 2; - $errors[244] = 2; - $errors[248] = 1; - $errors[259] = 1; - $errors[262] = 1; - $errors[267] = 1; - $errors[269] = 1; - $errors[276] = 1; - $errors[279] = 1; - $errors[283] = 1; - $errors[306] = 3; - }//end if - - return $errors; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ElseIfDeclarationUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ElseIfDeclarationUnitTest.inc deleted file mode 100644 index 91d0a23..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ElseIfDeclarationUnitTest.inc +++ /dev/null @@ -1,14 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\ControlStructures; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ElseIfDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 8 => 1, - 13 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForEachLoopDeclarationUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForEachLoopDeclarationUnitTest.inc deleted file mode 100644 index 4709923..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForEachLoopDeclarationUnitTest.inc +++ /dev/null @@ -1,36 +0,0 @@ - $that) { -} - -// Invalid. -foreach ( $something as $blah => $that ) { -} - -foreach ($something as $blah => $that) { -} - -foreach ($something as $blah => $that) { -} - -foreach (${something}AS$blah=>$that) { -} - -// The works. -foreach ( $something aS $blah => $that ) { -} - -// phpcs:set Squiz.ControlStructures.ForEachLoopDeclaration requiredSpacesAfterOpen 1 -// phpcs:set Squiz.ControlStructures.ForEachLoopDeclaration requiredSpacesBeforeClose 1 -foreach ($something as $blah => $that) {} -foreach ( $something as $blah => $that ) {} -foreach ( $something as $blah => $that ) {} -// phpcs:set Squiz.ControlStructures.ForEachLoopDeclaration requiredSpacesAfterOpen 0 -// phpcs:set Squiz.ControlStructures.ForEachLoopDeclaration requiredSpacesBeforeClose 0 - -foreach ([ - 'foo' => 'bar', - 'foobaz' => 'bazzy', - ] as $key => $value) { -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForEachLoopDeclarationUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForEachLoopDeclarationUnitTest.inc.fixed deleted file mode 100644 index b0de6eb..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForEachLoopDeclarationUnitTest.inc.fixed +++ /dev/null @@ -1,36 +0,0 @@ - $that) { -} - -// Invalid. -foreach ($something as $blah => $that) { -} - -foreach ($something as $blah => $that) { -} - -foreach ($something as $blah => $that) { -} - -foreach (${something} as $blah => $that) { -} - -// The works. -foreach ($something as $blah => $that) { -} - -// phpcs:set Squiz.ControlStructures.ForEachLoopDeclaration requiredSpacesAfterOpen 1 -// phpcs:set Squiz.ControlStructures.ForEachLoopDeclaration requiredSpacesBeforeClose 1 -foreach ( $something as $blah => $that ) {} -foreach ( $something as $blah => $that ) {} -foreach ( $something as $blah => $that ) {} -// phpcs:set Squiz.ControlStructures.ForEachLoopDeclaration requiredSpacesAfterOpen 0 -// phpcs:set Squiz.ControlStructures.ForEachLoopDeclaration requiredSpacesBeforeClose 0 - -foreach ([ - 'foo' => 'bar', - 'foobaz' => 'bazzy', - ] as $key => $value) { -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForEachLoopDeclarationUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForEachLoopDeclarationUnitTest.php deleted file mode 100644 index 6957ff6..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForEachLoopDeclarationUnitTest.php +++ /dev/null @@ -1,56 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\ControlStructures; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ForEachLoopDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 8 => 2, - 11 => 2, - 14 => 2, - 17 => 5, - 21 => 7, - 26 => 2, - 28 => 2, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.inc deleted file mode 100644 index 5022e74..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.inc +++ /dev/null @@ -1,129 +0,0 @@ -i ; }; $i < function() { return $this->max; }; $i++) {} -for ($i = function() { return $this->i; }; $i < function() { return $this->max; } ; $i++) {} - -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration ignoreNewlines true -for ( - $i = 0; - $i < 5; - $i++ -) { - // body here -} -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration ignoreNewlines false - -// This test has to be the last one in the file! Intentional parse error check. -for diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.inc.fixed deleted file mode 100644 index 6a1e763..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.inc.fixed +++ /dev/null @@ -1,95 +0,0 @@ -i ; }; $i < function() { return $this->max; }; $i++) {} -for ($i = function() { return $this->i; }; $i < function() { return $this->max; }; $i++) {} - -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration ignoreNewlines true -for ( - $i = 0; - $i < 5; - $i++ -) { - // body here -} -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration ignoreNewlines false - -// This test has to be the last one in the file! Intentional parse error check. -for diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.js b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.js deleted file mode 100644 index cfda6c1..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.js +++ /dev/null @@ -1,125 +0,0 @@ -// Valid. -for (var i = 0; i < 10; i++) { -} - -// Invalid. -for ( i = 0; i < 10; i++ ) { -} - -for (i = 0; i < 10; i++) { -} - -for (var i = 0 ; i < 10 ; i++) { -} - -for (i = 0;i < 10;i++) { -} - -// The works. -for ( var i = 0 ; i < 10 ; i++ ) { -} - -this.formats = {}; -dfx.inherits('ContentFormat', 'Widget'); - -for (var widgetid in this.loadedContents) { - if (dfx.isset(widget) === true) { - widget.loadAutoSaveCWidgetStore.setData('activeScreen', null);widget.getContents(this.loadedContents[widgetid], function() {self.widgetLoaded(widget.id);}); - } -} - -for (var i = 0; i < 10;) { -} -for (var i = 0; i < 10; ) { -} - -for (var i = 0; ; i++) { -} -for (var i = 0;; i++) { -} - -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 1 -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 1 -for (var i = 0; i < 10; i++) {} -for ( var i = 0; i < 10; i++ ) {} -for ( var i = 0; i < 10; i++ ) {} -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 0 -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 0 - -for ( ; i < 10; i++) {} -for (; i < 10; i++) {} - -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 1 -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 1 -for ( ; i < 10; i++ ) {} -for ( ; i < 10; i++ ) {} -for (; i < 10; i++ ) {} - -for ( i = 0; i < 10; ) {} -for ( i = 0; i < 10;) {} -for ( i = 0; i < 10; ) {} -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 0 -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 0 - -// Test handling of comments and inline annotations. -for ( /*phpcs:enable*/ i = 0 /*start*/ ; /*end*/i < 10/*comment*/; i++ /*comment*/ ) {} - -// Test multi-line FOR control structure. -for ( - i = 0; - i < 10; - i++ -) {} - -// Test multi-line FOR control structure with comments and annotations. -for ( - i = 0; /* Start */ - i < 10; /* phpcs:ignore Standard.Category.SniffName -- for reasons. */ - i++ // comment - -) {} - -// Test fixing each error in one go. Note: lines 84 + 88 contain trailing whitespace on purpose. -for ( - - - i = 0 - - ; - - i < 10 - - ; - - i++ - - -) {} - -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 1 -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 1 -for ( - - - - i = 0 - - ; - - i < 10 - - ; - - i++ - - -) {} -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 0 -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 0 - -// Test with semi-colon not belonging to for. -for (i = function() {self.widgetLoaded(widget.id) ; }; i < function() {self.widgetLoaded(widget.id);}; i++) {} -for (i = function() {self.widgetLoaded(widget.id);}; i < function() {self.widgetLoaded(widget.id);} ; i++) {} - -// This test has to be the last one in the file! Intentional parse error check. -for diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.js.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.js.fixed deleted file mode 100644 index 00ced64..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.js.fixed +++ /dev/null @@ -1,91 +0,0 @@ -// Valid. -for (var i = 0; i < 10; i++) { -} - -// Invalid. -for (i = 0; i < 10; i++) { -} - -for (i = 0; i < 10; i++) { -} - -for (var i = 0; i < 10; i++) { -} - -for (i = 0; i < 10; i++) { -} - -// The works. -for (var i = 0; i < 10; i++) { -} - -this.formats = {}; -dfx.inherits('ContentFormat', 'Widget'); - -for (var widgetid in this.loadedContents) { - if (dfx.isset(widget) === true) { - widget.loadAutoSaveCWidgetStore.setData('activeScreen', null);widget.getContents(this.loadedContents[widgetid], function() {self.widgetLoaded(widget.id);}); - } -} - -for (var i = 0; i < 10;) { -} -for (var i = 0; i < 10;) { -} - -for (var i = 0;; i++) { -} -for (var i = 0;; i++) { -} - -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 1 -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 1 -for ( var i = 0; i < 10; i++ ) {} -for ( var i = 0; i < 10; i++ ) {} -for ( var i = 0; i < 10; i++ ) {} -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 0 -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 0 - -for (; i < 10; i++) {} -for (; i < 10; i++) {} - -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 1 -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 1 -for ( ; i < 10; i++ ) {} -for ( ; i < 10; i++ ) {} -for ( ; i < 10; i++ ) {} - -for ( i = 0; i < 10; ) {} -for ( i = 0; i < 10; ) {} -for ( i = 0; i < 10; ) {} -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 0 -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 0 - -// Test handling of comments and inline annotations. -for (/*phpcs:enable*/ i = 0 /*start*/; /*end*/i < 10/*comment*/; i++ /*comment*/) {} - -// Test multi-line FOR control structure. -for (i = 0; i < 10; i++) {} - -// Test multi-line FOR control structure with comments and annotations. -for (i = 0; /* Start */ - i < 10; /* phpcs:ignore Standard.Category.SniffName -- for reasons. */ - i++ // comment - -) {} - -// Test fixing each error in one go. Note: lines 84 + 88 contain trailing whitespace on purpose. -for (i = 0; i < 10; i++) {} - -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 1 -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 1 -for ( i = 0; i < 10; i++ ) {} -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 0 -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 0 - -// Test with semi-colon not belonging to for. -for (i = function() {self.widgetLoaded(widget.id) ; }; i < function() {self.widgetLoaded(widget.id);}; i++) {} -for (i = function() {self.widgetLoaded(widget.id);}; i < function() {self.widgetLoaded(widget.id);}; i++) {} - -// This test has to be the last one in the file! Intentional parse error check. -for diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.php deleted file mode 100644 index 5163886..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.php +++ /dev/null @@ -1,132 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\ControlStructures; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ForLoopDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='ForLoopDeclarationUnitTest.inc') - { - switch ($testFile) { - case 'ForLoopDeclarationUnitTest.inc': - return [ - 8 => 2, - 11 => 2, - 14 => 2, - 17 => 2, - 21 => 6, - 27 => 1, - 30 => 1, - 37 => 2, - 39 => 2, - 43 => 1, - 49 => 1, - 50 => 1, - 53 => 1, - 54 => 1, - 59 => 4, - 62 => 1, - 63 => 1, - 64 => 1, - 66 => 1, - 69 => 1, - 74 => 1, - 77 => 1, - 82 => 2, - 86 => 2, - 91 => 1, - 95 => 1, - 101 => 2, - 105 => 2, - 110 => 1, - 116 => 2, - ]; - - case 'ForLoopDeclarationUnitTest.js': - return [ - 6 => 2, - 9 => 2, - 12 => 2, - 15 => 2, - 19 => 6, - 33 => 1, - 36 => 1, - 43 => 2, - 45 => 2, - 49 => 1, - 55 => 1, - 56 => 1, - 59 => 1, - 60 => 1, - 65 => 4, - 68 => 1, - 69 => 1, - 70 => 1, - 72 => 1, - 75 => 1, - 80 => 1, - 83 => 1, - 88 => 2, - 92 => 2, - 97 => 1, - 101 => 1, - 107 => 2, - 111 => 2, - 116 => 1, - 122 => 2, - ]; - - default: - return []; - }//end switch - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getWarningList($testFile='ForLoopDeclarationUnitTest.inc') - { - switch ($testFile) { - case 'ForLoopDeclarationUnitTest.inc': - return [129 => 1]; - - case 'ForLoopDeclarationUnitTest.js': - return [125 => 1]; - - default: - return []; - }//end switch - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.inc deleted file mode 100644 index f54ed8a..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.inc +++ /dev/null @@ -1,48 +0,0 @@ -id.'"', - '"'.$this->stepInfo['title'].'"', - '"'.((isset($this->stepInfo['description']) === TRUE) ? $this->stepInfo['description'] : '').'"', - '"'.(isset($this->stepInfo['description']) === TRUE ? $this->stepInfo['description'] : '').'"', - '"'.$this->stepInfo['title'].'"', - ); - -echo (TRUE)?'Hello':'Bye'; - -$array = array( - 'one' => ($test == 1) ? true : false, - 'two' => (($test == 1) ? true : false), - 'three' => (($test == 1) ? true : false) -); -$var = ($test == 1) ? true : false; -$var = (myFunc(1,2,3) == 1) ? true : false; - -set('config', function() { - $foo = ($bar === "on") ? "1" : "2"; -}); - -$config = function() { - $foo = ($bar === "on") ? "1" : "2"; -}; - -rand(0, 1) ? 'ěščřžýáí' : NULL; - -$c = ($argv[1]) ? : ""; -$filepath = realpath($argv[1]) ?: $argv[1]; -$c = ($argv[1]) ? /* comment */ : ""; -$c = ($argv[1]) ? -: ""; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.inc.fixed deleted file mode 100644 index f7aa1d6..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.inc.fixed +++ /dev/null @@ -1,48 +0,0 @@ -id.'"', - '"'.$this->stepInfo['title'].'"', - '"'.((isset($this->stepInfo['description']) === TRUE) ? $this->stepInfo['description'] : '').'"', - '"'.(isset($this->stepInfo['description']) === TRUE ? $this->stepInfo['description'] : '').'"', - '"'.$this->stepInfo['title'].'"', - ); - -echo (TRUE) ? 'Hello' : 'Bye'; - -$array = array( - 'one' => ($test == 1) ? true : false, - 'two' => (($test == 1) ? true : false), - 'three' => (($test == 1) ? true : false) -); -$var = ($test == 1) ? true : false; -$var = (myFunc(1,2,3) == 1) ? true : false; - -set('config', function() { - $foo = ($bar === "on") ? "1" : "2"; -}); - -$config = function() { - $foo = ($bar === "on") ? "1" : "2"; -}; - -rand(0, 1) ? 'ěščřžýáí' : NULL; - -$c = ($argv[1]) ?: ""; -$filepath = realpath($argv[1]) ?: $argv[1]; -$c = ($argv[1]) ? /* comment */ : ""; -$c = ($argv[1]) ? -: ""; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.php deleted file mode 100644 index 97212db..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.php +++ /dev/null @@ -1,75 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\ControlStructures; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class InlineIfDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Get a list of CLI values to set before the file is tested. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getCliValues($testFile) - { - return ['--encoding=utf-8']; - - }//end getCliValues() - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 4 => 1, - 5 => 1, - 6 => 1, - 7 => 1, - 8 => 1, - 9 => 1, - 10 => 1, - 13 => 1, - 20 => 1, - 24 => 4, - 44 => 1, - 47 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/LowercaseDeclarationUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/LowercaseDeclarationUnitTest.inc deleted file mode 100644 index 1acf3ea..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/LowercaseDeclarationUnitTest.inc +++ /dev/null @@ -1,24 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\ControlStructures; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class LowercaseDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 3 => 1, - 5 => 1, - 7 => 1, - 9 => 1, - 10 => 1, - 12 => 1, - 14 => 1, - 15 => 1, - 16 => 1, - 20 => 1, - 21 => 1, - 24 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/SwitchDeclarationUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/SwitchDeclarationUnitTest.inc deleted file mode 100644 index cf39760..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/SwitchDeclarationUnitTest.inc +++ /dev/null @@ -1,333 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\ControlStructures; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class SwitchDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='SwitchDeclarationUnitTest.inc') - { - switch ($testFile) { - case 'SwitchDeclarationUnitTest.inc': - return [ - 27 => 1, - 29 => 1, - 34 => 1, - 36 => 1, - 44 => 1, - 48 => 1, - 52 => 1, - 54 => 1, - 55 => 1, - 56 => 1, - 58 => 1, - 59 => 1, - 61 => 1, - 62 => 1, - 79 => 1, - 85 => 2, - 88 => 2, - 89 => 2, - 92 => 1, - 95 => 3, - 99 => 1, - 116 => 1, - 122 => 1, - 127 => 2, - 134 => 2, - 135 => 1, - 138 => 1, - 143 => 1, - 144 => 1, - 147 => 1, - 165 => 1, - 172 => 1, - 176 => 2, - 180 => 1, - 192 => 2, - 196 => 1, - 223 => 1, - 266 => 1, - 282 => 1, - 284 => 2, - 322 => 1, - 323 => 1, - 327 => 1, - 329 => 1, - 330 => 1, - ]; - - case 'SwitchDeclarationUnitTest.js': - return [ - 27 => 1, - 29 => 1, - 34 => 1, - 36 => 1, - 44 => 1, - 48 => 1, - 52 => 1, - 54 => 1, - 55 => 1, - 56 => 1, - 58 => 1, - 59 => 1, - 61 => 1, - 62 => 1, - 79 => 1, - 85 => 2, - 88 => 2, - 89 => 2, - 92 => 1, - 95 => 3, - 99 => 1, - 116 => 1, - 122 => 1, - 127 => 2, - 134 => 2, - 135 => 1, - 138 => 1, - 143 => 1, - 144 => 1, - 147 => 1, - 165 => 1, - 172 => 1, - 176 => 2, - 180 => 1, - 192 => 2, - 196 => 1, - 223 => 1, - 266 => 1, - 282 => 1, - 284 => 2, - ]; - - default: - return []; - }//end switch - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getWarningList($testFile='SwitchDeclarationUnitTest.inc') - { - if ($testFile === 'SwitchDeclarationUnitTest.js') { - return [273 => 1]; - } - - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JSLintUnitTest.js b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JSLintUnitTest.js deleted file mode 100644 index 797e0ee..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JSLintUnitTest.js +++ /dev/null @@ -1,2 +0,0 @@ -alert('hi') -alert('hi'); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JSLintUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JSLintUnitTest.php deleted file mode 100644 index 7ccfe1a..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JSLintUnitTest.php +++ /dev/null @@ -1,69 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Debug; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; -use PHP_CodeSniffer\Config; - -class JSLintUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Should this test be skipped for some reason. - * - * @return void - */ - protected function shouldSkipTest() - { - $jslPath = Config::getExecutablePath('jslint'); - if ($jslPath === null) { - return true; - } - - return false; - - }//end shouldSkipTest() - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return []; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return [ - 1 => 2, - 2 => 1, - ]; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JavaScriptLintUnitTest.js b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JavaScriptLintUnitTest.js deleted file mode 100644 index 797e0ee..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JavaScriptLintUnitTest.js +++ /dev/null @@ -1,2 +0,0 @@ -alert('hi') -alert('hi'); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JavaScriptLintUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JavaScriptLintUnitTest.php deleted file mode 100644 index 1e83f1f..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JavaScriptLintUnitTest.php +++ /dev/null @@ -1,66 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Debug; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; -use PHP_CodeSniffer\Config; - -class JavaScriptLintUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Should this test be skipped for some reason. - * - * @return void - */ - protected function shouldSkipTest() - { - $jslPath = Config::getExecutablePath('jsl'); - if ($jslPath === null) { - return true; - } - - return false; - - }//end shouldSkipTest() - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return []; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return [2 => 1]; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.1.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.1.inc deleted file mode 100644 index 3279edb..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.1.inc +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.2.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.2.inc deleted file mode 100644 index 05be633..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.2.inc +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.3.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.3.inc deleted file mode 100644 index ec1b023..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.3.inc +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.4.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.4.inc deleted file mode 100644 index ed04564..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.4.inc +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.php deleted file mode 100644 index 7e613b3..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.php +++ /dev/null @@ -1,55 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Files; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class FileExtensionUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'FileExtensionUnitTest.1.inc': - return [1 => 1]; - default: - return []; - } - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.inc deleted file mode 100644 index 2a480bb..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.inc +++ /dev/null @@ -1,195 +0,0 @@ -words[$wordPos-1]) || $this->words[$wordPos-1] !== ' ') { -} else if ($this->tokens[$pos + 1] === "\n") { -} - -if ($pos === count($this->tokens) - 1) { - $file = '...'.substr($file, (($padding * -1) + 3)); -} - -if (substr($basename, -5) !== 'Sniff') { - $i = ($this->_tokens[$i]['parenthesis_closer'] + 1); -} - -$pos = $this->_getShortCommentEndPos(); -if ($pos === -1) { - $stackPtr = ($tokens[$next][$to] - 1); - $stackPtr = ($tokens[$next][$pattern[$i]['to']] + 1); - $var = (($var1 + $var2) + $var3 + $var4) -} - -$commentStart = ($phpcsFile->findPrevious(T_DOC_COMMENT, ($commentEnd - 1), null, true) + 1); -$commentEnd = ($this->_phpcsFile->findNext(T_DOC_COMMENT, ($commentStart + 1), null, true) - 1); -$expected .= '...'.substr($tokens[($stackPtr - 2)]['content'], -5).$tokens[$stackPtr]['content']; - -if (($tokens[$nextToken - 1]['code']) !== T_WHITESPACE) { - $errorPos = ($params[(count($params) - 1)]->getLine() + $commentStart); -} - -while (($nextSpace = $phpcsFile->findNext(T_WHITESPACE, $nextSpace + 1, $nextBreak)) !== false) { -} - -foreach ($attributes as $id => &$attribute) { -} - -class MyClass -{ - - - public function &myFunction(array &$one, array &$two) - { - - }//end myFunction() - - -}//end class - -if ($index < -1) $index = 0; -if ($index < - 1) $index = 0; - -$three = ceil($one / $two); -$three = ceil(($one / $two) / $four); -$three = ceil($one / ($two / $four)); - -$four = -0.25; - -$three = ceil($one[1] / $two); - -switch ($number % 10) { - case -1: - $suffix = 'st'; - break; -} - -$expectedPermission = array( - 'granted' => 4, - 'denied' => 1, - 'cascade' => TRUE, - 'blockergranted' => 2, - 'blockerdenied' => - 3, - 'effective' => TRUE, - ); - -$value = (int) isset($blah) + 2; -$value = (int) isset($blah) + (int) isset($foo) + (int) isset($bar); - -doSomething(getValue($var, 2)) - $y; - -$codeFiles = array($global => $codeFiles[$global]) + $codeFiles; - -$var = array(-1); -$var = [-1]; -$var = [0, -1, -2]; - -$cntPages = ceil(count($items) / self::ON_PAGE); - -error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING); -error_reporting(E_ALL & ~E_NOTICE | ~E_WARNING); -$results = $stmt->fetchAll(\PDO::FETCH_ASSOC | \PDO::FETCH_GROUP | \PDO::FETCH_UNIQUE); -$di = new \RecursiveDirectoryIterator($path, \RecursiveDirectoryIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS); -foo(1 + 2 + 3); - -if (empty($foo[-1]) === true) { - $foo[-1] = 'foo'; -} - -try { -} catch (AException | BException $e) { -} - -$var = $foo['blah'] + []; - -$a = 2 * ${x} - ${minus}; - -$foo = $bar ?? $baz ?? ''; - -$foo = $myString{-1}; - -$value = (binary) $blah + b"binary $foo"; - -$test = (1 * static::TEST); -$test = myfunc(1 * static::TEST); - -$errorPos = $params[$x]?->getLine() + $commentStart; - -$foo = $this->gmail ?? $this->gmail = new Google_Service_Gmail($this->google); - -exit -1; - -$expr = match ($number - 10) { - -1 => 0, -}; - -$expr = match ($number % 10) { - 1 => 2 * $num, -}; - -$expr = match (true) { - $num * 100 > 500 => 'expression in key', -}; - -// PHP 8.0 named parameters. -if ($pos === count(value: $this->tokens) - 1) { - $file = '...'.substr(string: $file, offset: $padding * -1 + 3); -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.inc.fixed deleted file mode 100644 index 669b16b..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.inc.fixed +++ /dev/null @@ -1,195 +0,0 @@ -words[($wordPos-1)]) || $this->words[($wordPos-1)] !== ' ') { -} else if ($this->tokens[($pos + 1)] === "\n") { -} - -if ($pos === (count($this->tokens) - 1)) { - $file = '...'.substr($file, (($padding * -1) + 3)); -} - -if (substr($basename, -5) !== 'Sniff') { - $i = ($this->_tokens[$i]['parenthesis_closer'] + 1); -} - -$pos = $this->_getShortCommentEndPos(); -if ($pos === -1) { - $stackPtr = ($tokens[$next][$to] - 1); - $stackPtr = ($tokens[$next][$pattern[$i]['to']] + 1); - $var = (($var1 + $var2) + $var3 + $var4) -} - -$commentStart = ($phpcsFile->findPrevious(T_DOC_COMMENT, ($commentEnd - 1), null, true) + 1); -$commentEnd = ($this->_phpcsFile->findNext(T_DOC_COMMENT, ($commentStart + 1), null, true) - 1); -$expected .= '...'.substr($tokens[($stackPtr - 2)]['content'], -5).$tokens[$stackPtr]['content']; - -if (($tokens[($nextToken - 1)]['code']) !== T_WHITESPACE) { - $errorPos = ($params[(count($params) - 1)]->getLine() + $commentStart); -} - -while (($nextSpace = $phpcsFile->findNext(T_WHITESPACE, ($nextSpace + 1), $nextBreak)) !== false) { -} - -foreach ($attributes as $id => &$attribute) { -} - -class MyClass -{ - - - public function &myFunction(array &$one, array &$two) - { - - }//end myFunction() - - -}//end class - -if ($index < -1) $index = 0; -if ($index < - 1) $index = 0; - -$three = ceil($one / $two); -$three = ceil(($one / $two) / $four); -$three = ceil($one / ($two / $four)); - -$four = -0.25; - -$three = ceil($one[1] / $two); - -switch ($number % 10) { - case -1: - $suffix = 'st'; - break; -} - -$expectedPermission = array( - 'granted' => 4, - 'denied' => 1, - 'cascade' => TRUE, - 'blockergranted' => 2, - 'blockerdenied' => - 3, - 'effective' => TRUE, - ); - -$value = ((int) isset($blah) + 2); -$value = ((int) isset($blah) + (int) isset($foo) + (int) isset($bar)); - -(doSomething(getValue($var, 2)) - $y); - -$codeFiles = (array($global => $codeFiles[$global]) + $codeFiles); - -$var = array(-1); -$var = [-1]; -$var = [0, -1, -2]; - -$cntPages = ceil(count($items) / self::ON_PAGE); - -error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING); -error_reporting(E_ALL & ~E_NOTICE | ~E_WARNING); -$results = $stmt->fetchAll(\PDO::FETCH_ASSOC | \PDO::FETCH_GROUP | \PDO::FETCH_UNIQUE); -$di = new \RecursiveDirectoryIterator($path, (\RecursiveDirectoryIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS)); -foo(1 + 2 + 3); - -if (empty($foo[-1]) === true) { - $foo[-1] = 'foo'; -} - -try { -} catch (AException | BException $e) { -} - -$var = ($foo['blah'] + []); - -$a = 2 * ${x} - ${minus}; - -$foo = ($bar ?? $baz ?? ''); - -$foo = $myString{-1}; - -$value = ((binary) $blah + b"binary $foo"); - -$test = (1 * static::TEST); -$test = myfunc(1 * static::TEST); - -$errorPos = ($params[$x]?->getLine() + $commentStart); - -$foo = ($this->gmail ?? $this->gmail = new Google_Service_Gmail($this->google)); - -exit -1; - -$expr = match ($number - 10) { - -1 => 0, -}; - -$expr = match ($number % 10) { - 1 => (2 * $num), -}; - -$expr = match (true) { - ($num * 100) > 500 => 'expression in key', -}; - -// PHP 8.0 named parameters. -if ($pos === (count(value: $this->tokens) - 1)) { - $file = '...'.substr(string: $file, offset: ($padding * -1 + 3)); -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.js b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.js deleted file mode 100644 index 92ed803..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.js +++ /dev/null @@ -1,118 +0,0 @@ -value = (one + two); -value = one + two; - -value = (one - two); -value = one - two; - -value = (one * two); -value = one * two; - -value = (one / two); -value = one / two; - -value = (one % two); -value = one % two; - -value = (one + two + three); -value = one + two + three; -value = (one + (two + three)); -value = one + (two + three); - -value++; -value--; -value = -1; -value = - 1; - -value = (1 + 2); -value = 1 + 2; - -value = (1 - 2); -value = 1 - 2; - -value = (1 * 2); -value = 1 * 2; - -value = (1 / 2); -value = 1 / 2; - -value = (1 % 2); -value = 1 % 2; - -value = (1 + 2 + 3); -value = 1 + 2 + 3; -value = (1 + (2 + 3)); -value = 1 + (2 + 3); - -value = one + 2 + 3 - (four * five * (6 + 7)) + nine + 2; -value = myFunction(tokens[stackPtr - 1]); - -for (i = 1 + 2; i < 4 + 5; i++) { -} - -function myFunction() -{ - value = (one + 1) + (two + 2) + (myFunction() + 2); - value = myFunction() + 2; - value = (myFunction(mvar) + myFunction2(mvar)); - return -1; -} - -params['mode'] = id.replace(/WidgetType/, ''); - -if (index < -1) index = 0; -if (index < - 1) index = 0; - -var classN = prvId.replace(/\./g, '-'); - -three = myFunction(one / two); -three = myFunction((one / two) / four); -three = myFunction(one / (two / four)); - -four = -0.25; - -id = id.replace(/row\/:/gi, ''); -return /MSIE/.test(navigator.userAgent); - -var re = new RegExp(/<\/?(\w+)((\s+\w+(\s*=\s*(?:".*?"|'.*?'|[^'">\s]+))?)+\s*|\s*)\/?>/gim); - -var options = { - minVal: -1, - maxVal: -1 -}; - -stepWidth = Math.round(this.width / 5); - -date.setMonth(d[2] - 1); - -switch (number % 10) { - case -1: - suffix = 'st'; - break; -} - -var pathSplit = ipt.value.split(/\/|\\/); - -if (pairs[i].search(/=/) !== -1) { -} - -if (urlValue.search(/[a-zA-z]+:\/\//) !== 0) { -} - -if (urlValue.search(/[a-zA-z]+:\/\/*/) !== 0) { -} - -if (!value || /^\s*$/.test(value)) { - return true; -} - -parseInt(dfx.attr(selectors[idx], 'elemOffsetTop'), 10) - scrollCoords.y + 'px' - -if (something === true - ^ somethingElse === true -) { - return false; -} - -if (true === /^\d*\.?\d*$/.test(input)) return true; - -if ( ! /^(?:a|select)$/i.test( element.tagName ) ) return true; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.js.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.js.fixed deleted file mode 100644 index 04e35d9..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.js.fixed +++ /dev/null @@ -1,118 +0,0 @@ -value = (one + two); -value = one + two; - -value = (one - two); -value = (one - two); - -value = (one * two); -value = (one * two); - -value = (one / two); -value = (one / two); - -value = (one % two); -value = (one % two); - -value = (one + two + three); -value = one + two + three; -value = (one + (two + three)); -value = one + (two + three); - -value++; -value--; -value = -1; -value = - 1; - -value = (1 + 2); -value = 1 + 2; - -value = (1 - 2); -value = (1 - 2); - -value = (1 * 2); -value = (1 * 2); - -value = (1 / 2); -value = (1 / 2); - -value = (1 % 2); -value = (1 % 2); - -value = (1 + 2 + 3); -value = 1 + 2 + 3; -value = (1 + (2 + 3)); -value = 1 + (2 + 3); - -value = one + 2 + (3 - (four * five * (6 + 7))) + nine + 2; -value = myFunction(tokens[(stackPtr - 1)]); - -for (i = 1 + 2; i < 4 + 5; i++) { -} - -function myFunction() -{ - value = (one + 1) + (two + 2) + (myFunction() + 2); - value = myFunction() + 2; - value = (myFunction(mvar) + myFunction2(mvar)); - return -1; -} - -params['mode'] = id.replace(/WidgetType/, ''); - -if (index < -1) index = 0; -if (index < - 1) index = 0; - -var classN = prvId.replace(/\./g, '-'); - -three = myFunction(one / two); -three = myFunction((one / two) / four); -three = myFunction(one / (two / four)); - -four = -0.25; - -id = id.replace(/row\/:/gi, ''); -return /MSIE/.test(navigator.userAgent); - -var re = new RegExp(/<\/?(\w+)((\s+\w+(\s*=\s*(?:".*?"|'.*?'|[^'">\s]+))?)+\s*|\s*)\/?>/gim); - -var options = { - minVal: -1, - maxVal: -1 -}; - -stepWidth = Math.round(this.width / 5); - -date.setMonth(d[2] - 1); - -switch (number % 10) { - case -1: - suffix = 'st'; - break; -} - -var pathSplit = ipt.value.split(/\/|\\/); - -if (pairs[i].search(/=/) !== -1) { -} - -if (urlValue.search(/[a-zA-z]+:\/\//) !== 0) { -} - -if (urlValue.search(/[a-zA-z]+:\/\/*/) !== 0) { -} - -if (!value || /^\s*$/.test(value)) { - return true; -} - -(parseInt(dfx.attr(selectors[idx], 'elemOffsetTop'), 10) - scrollCoords.y) + 'px' - -if (something === true - ^ somethingElse === true -) { - return false; -} - -if (true === /^\d*\.?\d*$/.test(input)) return true; - -if ( ! /^(?:a|select)$/i.test( element.tagName ) ) return true; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.php deleted file mode 100644 index 4f04a6e..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.php +++ /dev/null @@ -1,117 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Formatting; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class OperatorBracketUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='OperatorBracketUnitTest.inc') - { - switch ($testFile) { - case 'OperatorBracketUnitTest.inc': - return [ - 3 => 1, - 6 => 1, - 9 => 1, - 12 => 1, - 15 => 1, - 18 => 2, - 20 => 1, - 25 => 1, - 28 => 1, - 31 => 1, - 34 => 1, - 37 => 1, - 40 => 1, - 43 => 2, - 45 => 1, - 47 => 5, - 48 => 1, - 50 => 2, - 55 => 2, - 56 => 1, - 63 => 2, - 64 => 1, - 67 => 1, - 86 => 1, - 90 => 1, - 109 => 1, - 130 => 1, - 134 => 1, - 135 => 2, - 137 => 1, - 139 => 1, - 150 => 1, - 161 => 1, - 163 => 2, - 165 => 2, - 169 => 1, - 174 => 1, - 176 => 1, - 185 => 1, - 189 => 1, - 193 => 1, - 194 => 2, - ]; - break; - case 'OperatorBracketUnitTest.js': - return [ - 5 => 1, - 8 => 1, - 11 => 1, - 14 => 1, - 24 => 1, - 30 => 1, - 33 => 1, - 36 => 1, - 39 => 1, - 46 => 1, - 47 => 1, - 63 => 1, - 108 => 1, - ]; - break; - default: - return []; - break; - }//end switch - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.inc deleted file mode 100644 index 33564e2..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.inc +++ /dev/null @@ -1,111 +0,0 @@ - $a($b); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.inc.fixed deleted file mode 100644 index 68fb1c1..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.inc.fixed +++ /dev/null @@ -1,111 +0,0 @@ - $a($b); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.php deleted file mode 100644 index 65e987d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.php +++ /dev/null @@ -1,86 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Functions; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class FunctionDeclarationArgumentSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 3 => 1, - 5 => 2, - 7 => 2, - 8 => 2, - 9 => 2, - 11 => 2, - 13 => 7, - 14 => 2, - 15 => 2, - 16 => 4, - 18 => 2, - 35 => 2, - 36 => 2, - 44 => 2, - 45 => 1, - 46 => 1, - 51 => 2, - 53 => 2, - 55 => 1, - 56 => 1, - 58 => 1, - 73 => 7, - 76 => 1, - 77 => 1, - 81 => 1, - 89 => 2, - 92 => 1, - 93 => 1, - 94 => 1, - 95 => 1, - 99 => 11, - 100 => 2, - 101 => 2, - 102 => 2, - 106 => 1, - 107 => 2, - 111 => 3, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationUnitTest.inc deleted file mode 100644 index 0cde113..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationUnitTest.inc +++ /dev/null @@ -1,75 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Functions; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class FunctionDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 55 => 1, - 68 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDuplicateArgumentUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDuplicateArgumentUnitTest.inc deleted file mode 100644 index 27102d0..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDuplicateArgumentUnitTest.inc +++ /dev/null @@ -1,6 +0,0 @@ - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDuplicateArgumentUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDuplicateArgumentUnitTest.php deleted file mode 100644 index da09cef..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDuplicateArgumentUnitTest.php +++ /dev/null @@ -1,52 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Functions; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class FunctionDuplicateArgumentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 2 => 1, - 4 => 2, - 5 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/GlobalFunctionUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/GlobalFunctionUnitTest.inc deleted file mode 100644 index b7b7f20..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/GlobalFunctionUnitTest.inc +++ /dev/null @@ -1,17 +0,0 @@ - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/GlobalFunctionUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/GlobalFunctionUnitTest.php deleted file mode 100644 index 7be7648..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/GlobalFunctionUnitTest.php +++ /dev/null @@ -1,48 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Functions; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class GlobalFunctionUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return []; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return [2 => 1]; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/LowercaseFunctionKeywordsUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/LowercaseFunctionKeywordsUnitTest.inc deleted file mode 100644 index 4e86833..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/LowercaseFunctionKeywordsUnitTest.inc +++ /dev/null @@ -1,28 +0,0 @@ - $x; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/LowercaseFunctionKeywordsUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/LowercaseFunctionKeywordsUnitTest.inc.fixed deleted file mode 100644 index 48c9977..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/LowercaseFunctionKeywordsUnitTest.inc.fixed +++ /dev/null @@ -1,28 +0,0 @@ - $x; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/LowercaseFunctionKeywordsUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/LowercaseFunctionKeywordsUnitTest.php deleted file mode 100644 index 1e1537b..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/LowercaseFunctionKeywordsUnitTest.php +++ /dev/null @@ -1,58 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Functions; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class LowercaseFunctionKeywordsUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 16 => 1, - 17 => 1, - 20 => 1, - 21 => 1, - 22 => 1, - 23 => 1, - 24 => 3, - 25 => 4, - 28 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.inc deleted file mode 100644 index fce0b23..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.inc +++ /dev/null @@ -1,257 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Functions; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class MultiLineFunctionDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='MultiLineFunctionDeclarationUnitTest.inc') - { - if ($testFile === 'MultiLineFunctionDeclarationUnitTest.inc') { - $errors = [ - 2 => 1, - 3 => 1, - 4 => 2, - 5 => 1, - 7 => 1, - 11 => 1, - 12 => 1, - 13 => 1, - 16 => 1, - 36 => 1, - 43 => 2, - 48 => 1, - 81 => 1, - 82 => 2, - 88 => 1, - 102 => 2, - 137 => 1, - 141 => 2, - 142 => 1, - 158 => 1, - 160 => 1, - 182 => 2, - 186 => 2, - 190 => 2, - 194 => 1, - 195 => 1, - 233 => 1, - 234 => 1, - 235 => 1, - 236 => 1, - 244 => 1, - 245 => 1, - 246 => 1, - 247 => 1, - 248 => 1, - 249 => 1, - 250 => 1, - 251 => 1, - 252 => 1, - 253 => 1, - 254 => 1, - ]; - } else { - $errors = [ - 2 => 1, - 3 => 1, - 4 => 2, - 5 => 1, - 7 => 1, - 11 => 1, - 12 => 1, - 13 => 1, - 16 => 1, - 26 => 1, - 36 => 1, - 43 => 2, - 48 => 1, - 65 => 1, - ]; - }//end if - - return $errors; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidFunctionNameUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidFunctionNameUnitTest.inc deleted file mode 100644 index aacef34..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidFunctionNameUnitTest.inc +++ /dev/null @@ -1,27 +0,0 @@ - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidFunctionNameUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidFunctionNameUnitTest.php deleted file mode 100644 index 77f13bb..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidFunctionNameUnitTest.php +++ /dev/null @@ -1,59 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\NamingConventions; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ValidFunctionNameUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 4 => 1, - 5 => 1, - 6 => 1, - 7 => 1, - 8 => 1, - 9 => 1, - 11 => 1, - 12 => 1, - 13 => 1, - 14 => 2, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidVariableNameUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidVariableNameUnitTest.inc deleted file mode 100644 index c7b8a2b..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidVariableNameUnitTest.inc +++ /dev/null @@ -1,148 +0,0 @@ -varName2; -echo $this->var_name2; -echo $this->varname2; -echo $this->_varName2; -echo $object->varName2; -echo $object->var_name2; -echo $object_name->varname2; -echo $object_name->_varName2; - -echo $this->myFunction($one, $two); -echo $object->myFunction($one_two); - -$error = "format is \$GLOBALS['$varName']"; - -echo $_SESSION['var_name']; -echo $_FILES['var_name']; -echo $_ENV['var_name']; -echo $_COOKIE['var_name']; - -$XML = 'hello'; -$myXML = 'hello'; -$XMLParser = 'hello'; -$xmlParser = 'hello'; - -echo "{$_SERVER['HOSTNAME']} $var_name"; - -// Need to be the last thing in this test file. -$obj->$classVar = $prefix.'-'.$type; - -class foo -{ - const bar = <<varName; -echo $obj?->var_name; -echo $obj?->varname; -echo $obj?->_varName; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidVariableNameUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidVariableNameUnitTest.php deleted file mode 100644 index aaa9d09..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidVariableNameUnitTest.php +++ /dev/null @@ -1,86 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\NamingConventions; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ValidVariableNameUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - $errors = [ - 3 => 1, - 5 => 1, - 10 => 1, - 12 => 1, - 15 => 1, - 17 => 1, - 20 => 1, - 22 => 1, - 25 => 1, - 27 => 1, - 31 => 1, - 33 => 1, - 36 => 1, - 37 => 1, - 39 => 1, - 42 => 1, - 44 => 1, - 53 => 1, - 58 => 1, - 62 => 1, - 63 => 1, - 64 => 1, - 67 => 1, - 81 => 1, - 106 => 1, - 107 => 2, - 108 => 1, - 111 => 1, - 112 => 1, - 113 => 1, - 114 => 1, - 123 => 1, - 138 => 1, - 141 => 1, - 146 => 1, - ]; - - return $errors; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/DisallowObjectStringIndexUnitTest.js b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/DisallowObjectStringIndexUnitTest.js deleted file mode 100644 index 1c61fbf..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/DisallowObjectStringIndexUnitTest.js +++ /dev/null @@ -1,37 +0,0 @@ -function test(id) -{ - - this.id = id; - -} -/**/ -test.prototype = { - init: function() - { - var x = {}; - x.name = 'test'; - x['phone'] = 123124324; - var t = ['test', 'this'].join(''); - var y = ['test'].join(''); - var a = x[0]; - var z = x[x['name']]; - var p = x[x.name]; - } - -}; - -function test() { - this.errors['step_' + step] = errors; - this.errors['test'] = x; - this.errors['test' + 10] = x; - this.errors['test' + y] = x; - this.errors['test' + 'blah'] = x; - this.errors[y] = x; - this.errors[y + z] = x; - this.permissions['workflow.cancel'] = x; -} - -if (child.prototype) { - above.prototype['constructor'] = parent; - child.prototype['super'] = new above(); -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/DisallowObjectStringIndexUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/DisallowObjectStringIndexUnitTest.php deleted file mode 100644 index cb2d58e..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/DisallowObjectStringIndexUnitTest.php +++ /dev/null @@ -1,59 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Objects; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class DisallowObjectStringIndexUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='DisallowObjectStringIndexUnitTest.js') - { - if ($testFile !== 'DisallowObjectStringIndexUnitTest.js') { - return []; - } - - return [ - 13 => 1, - 17 => 1, - 25 => 1, - 35 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectInstantiationUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectInstantiationUnitTest.inc deleted file mode 100644 index 41c8812..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectInstantiationUnitTest.inc +++ /dev/null @@ -1,46 +0,0 @@ - new MyClass()); -$object->myFunction(new MyClass()); - -throw new MyException($msg); - -function foo() { return new MyClass(); } - -$doodad = $x ? new Foo : new Bar; - -function returnFn() { - $fn = fn($x) => new MyClass(); -} - -function returnMatch() { - $match = match($x) { - 0 => new MyClass() - } -} - -// Issue 3333. -$time2 ??= new \DateTime(); -$time3 = $time1 ?? new \DateTime(); -$time3 = $time1 ?? $time2 ?? new \DateTime(); - -function_call($time1 ?? new \DateTime()); -$return = function_call($time1 ?? new \DateTime()); // False negative depending on interpretation of the sniff. - -function returnViaTernary() { - return ($y == false ) ? ($x === true ? new Foo : new Bar) : new FooBar; -} - -function nonAssignmentTernary() { - if (($x ? new Foo() : new Bar) instanceof FooBar) { - // Do something. - } -} - -// Intentional parse error. This must be the last test in the file. -function new -?> diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectInstantiationUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectInstantiationUnitTest.php deleted file mode 100644 index f9979fa..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectInstantiationUnitTest.php +++ /dev/null @@ -1,53 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Objects; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ObjectInstantiationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 5 => 1, - 8 => 1, - 31 => 1, - 39 => 2, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectMemberCommaUnitTest.js b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectMemberCommaUnitTest.js deleted file mode 100644 index 28bf85a..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectMemberCommaUnitTest.js +++ /dev/null @@ -1,47 +0,0 @@ -this.request({ action: 'getTypeFormatContents', }); - -addTypeFormatButton.addClickEvent(function() { - self.addNewTypeFormat(); -}); - -var x = {}; - -var y = { - VarOne : 'If you ask me, thats if you ask', - VarTwo : ['Alonzo played you', 'for a fool', 'esse'], - VarThree: function(arg) { - console.info(1); - } -}; - -var z = { - VarOne : 'If you ask me, thats if you ask', - VarTwo : ['Alonzo played you', 'for a fool', 'esse'], - VarThree: function(arg) { - console.info(1); - }, -}; - -var x = function() { - console.info(2); -}; - -AssetListingEditWidgetType.prototype = { - init: function(data, assetid, editables) - { - } -}; - -AssetListingEditWidgetType.prototype = { - init: function(data, assetid, editables) - { - }, -}; - -AssetListingEditWidgetType.prototype = { - // phpcs: disable Standard.Cat.SniffName -- testing annotation between closing brace and comma - init: function(data, assetid, editables) - { - }, - // phpcs:enable -}; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectMemberCommaUnitTest.js.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectMemberCommaUnitTest.js.fixed deleted file mode 100644 index df548c7..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectMemberCommaUnitTest.js.fixed +++ /dev/null @@ -1,47 +0,0 @@ -this.request({ action: 'getTypeFormatContents' }); - -addTypeFormatButton.addClickEvent(function() { - self.addNewTypeFormat(); -}); - -var x = {}; - -var y = { - VarOne : 'If you ask me, thats if you ask', - VarTwo : ['Alonzo played you', 'for a fool', 'esse'], - VarThree: function(arg) { - console.info(1); - } -}; - -var z = { - VarOne : 'If you ask me, thats if you ask', - VarTwo : ['Alonzo played you', 'for a fool', 'esse'], - VarThree: function(arg) { - console.info(1); - } -}; - -var x = function() { - console.info(2); -}; - -AssetListingEditWidgetType.prototype = { - init: function(data, assetid, editables) - { - } -}; - -AssetListingEditWidgetType.prototype = { - init: function(data, assetid, editables) - { - } -}; - -AssetListingEditWidgetType.prototype = { - // phpcs: disable Standard.Cat.SniffName -- testing annotation between closing brace and comma - init: function(data, assetid, editables) - { - } - // phpcs:enable -}; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectMemberCommaUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectMemberCommaUnitTest.php deleted file mode 100644 index ab1cf81..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectMemberCommaUnitTest.php +++ /dev/null @@ -1,53 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Objects; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ObjectMemberCommaUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 1 => 1, - 22 => 1, - 38 => 1, - 45 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.inc deleted file mode 100644 index 8522438..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.inc +++ /dev/null @@ -1,138 +0,0 @@ - - 0)) { -} - -myFunction($var1 === true ? "" : "foobar"); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.js b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.js deleted file mode 100644 index 048223b..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.js +++ /dev/null @@ -1,71 +0,0 @@ -if (value === TRUE) { -} else if (value === FALSE) { -} - -if (value == TRUE) { -} else if (value == FALSE) { -} - -if (value) { -} else if (!value) { -} - -if (value.isSomething === TRUE) { -} else if (myFunction(value) === FALSE) { -} - -if (value.isSomething == TRUE) { -} else if (myFunction(value) == FALSE) { -} - -if (value.isSomething) { -} else if (!myFunction(value)) { -} - -if (value === TRUE || other === FALSE) { -} - -if (value == TRUE || other == FALSE) { -} - -if (value || !other) { -} - -if (one === TRUE || two === TRUE || three === FALSE || four === TRUE) { -} - -if (one || two || !three || four) { -} - -while (one == true) { -} - -while (one === true) { -} - -do { -} while (one == true); - -do { -} while (one === true); - -for (one = 10; one != 0; one--) { -} - -for (one = 10; one !== 0; one--) { -} - -for (type in types) { -} - -variable = (variable2 === true) ? variable1 : "foobar"; - -variable = (variable2 == true) ? variable1 : "foobar"; - -variable = (variable2 === false) ? variable1 : "foobar"; - -variable = (variable2 == false) ? variable1 : "foobar"; - -variable = (variable2 === 0) ? variable1 : "foobar"; - -variable = (variable2 == 0) ? variable1 : "foobar"; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.php deleted file mode 100644 index 5618a7f..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.php +++ /dev/null @@ -1,101 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Operators; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ComparisonOperatorUsageUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='ComparisonOperatorUsageUnitTest.inc') - { - switch ($testFile) { - case 'ComparisonOperatorUsageUnitTest.inc': - return [ - 6 => 1, - 7 => 1, - 10 => 1, - 11 => 1, - 18 => 1, - 19 => 1, - 22 => 1, - 23 => 1, - 29 => 2, - 32 => 2, - 38 => 4, - 47 => 2, - 69 => 1, - 72 => 1, - 75 => 1, - 78 => 1, - 80 => 1, - 82 => 1, - 83 => 1, - 89 => 1, - 92 => 1, - 100 => 1, - 106 => 1, - 112 => 1, - 123 => 1, - 127 => 1, - 131 => 1, - 135 => 1, - ]; - break; - case 'ComparisonOperatorUsageUnitTest.js': - return [ - 5 => 1, - 6 => 1, - 17 => 1, - 18 => 1, - 28 => 2, - 40 => 1, - 47 => 1, - 52 => 1, - 63 => 1, - 67 => 1, - 71 => 1, - ]; - break; - default: - return []; - break; - }//end switch - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/IncrementDecrementUsageUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/IncrementDecrementUsageUnitTest.inc deleted file mode 100644 index a4f82d1..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/IncrementDecrementUsageUnitTest.inc +++ /dev/null @@ -1,42 +0,0 @@ -i++).$id; -$id = $obj?->i++.$id; -$id = $obj?->i++*10; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/IncrementDecrementUsageUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/IncrementDecrementUsageUnitTest.php deleted file mode 100644 index 3846905..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/IncrementDecrementUsageUnitTest.php +++ /dev/null @@ -1,60 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Operators; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class IncrementDecrementUsageUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 2 => 1, - 6 => 1, - 12 => 1, - 16 => 1, - 25 => 1, - 26 => 1, - 27 => 1, - 29 => 1, - 31 => 1, - 41 => 1, - 42 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ValidLogicalOperatorsUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ValidLogicalOperatorsUnitTest.inc deleted file mode 100644 index 328ccc5..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ValidLogicalOperatorsUnitTest.inc +++ /dev/null @@ -1,28 +0,0 @@ - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ValidLogicalOperatorsUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ValidLogicalOperatorsUnitTest.php deleted file mode 100644 index fc35131..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ValidLogicalOperatorsUnitTest.php +++ /dev/null @@ -1,52 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Operators; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ValidLogicalOperatorsUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 5 => 1, - 11 => 1, - 17 => 2, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.css b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.css deleted file mode 100644 index 94cc8f2..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.css +++ /dev/null @@ -1,23 +0,0 @@ -/* CSS Document */ - -body { -font-family: Arial, Helvetica, sans-serif; -margin : 40px 0 0 0; -padding : 0; -/*background: #8FB7DB url(login_glow_bg.jpg) no-repeat 30% 0;*/ -background: #8FB7DB url(diag_lines_bg.gif) top left; -} - -#login-container { - margin-left: -225px; - margin-top: -161px; - position:absolute; - top :50%; - /*left :50%;*/ - width:450px; -} - -#cacheConfig-dayLabel, #cacheConfig-hourLabel, #cacheConfig-minuteLabel { - float: left; - padding-right: 8px; -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.inc deleted file mode 100644 index 121240a..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.inc +++ /dev/null @@ -1,158 +0,0 @@ - - * - * Title - * Contents - * - * ... - * - * - * - * - * @return void - */ - -/* - [^\'"] -*/ - -// http://www.google.com - -// Base config function. - -// function () - -// T_STRING is not a function call or not listed in _getFunctionListWithCallableArgument(). - - // function myFunction( $param ) - // { - // do_something(); - // }//end myFunction() - // - -/* -function myFunction( $param ) -{ - // phpcs:disable Standard.Category.Sniff -- for reasons. - if ( preg_match( '`[abc]`', $param ) > 0 ) { - do_something(); - } - // phpcs:enable Standard.Category.Sniff -- for reasons. - -}//end myFunction() -*/ - - /* - * function myFunction( $param ) // @phpcs:ignore Standard.Category.Sniff -- for reasons. - * { - * - * }//end myFunction() - */ - - /* - * function myFunction( $param ) - * { - * // phpcs:disable Standard.Category.Sniff -- for reasons. - * if ( preg_match( '`[abc]`', $param ) > 0 ) { - * do_something(); - * } - * // phpcs:enable Standard.Category.Sniff -- for reasons. - * - * }//end myFunction() - */ - - // function myFunction( $param ) - // { - // phpcs:disable Standard.Category.Sniff -- for reasons. - // do_something(); - // phpcs:enable Standard.Category.Sniff -- for reasons. - // }//end myFunction() - // - -echo 'something'; // @codeCoverageIgnore -echo 'something'; // @codeCoverageIgnoreStart -echo 'something'; // @SuppressWarnings(PHPMD.UnusedLocalVariable) - -// Ok! - -/* Go! */ - -// ISO-639-3 - - // But override with a different text if any. - /* - $id = intval( str_replace( 'hook_name', '', $order_method['method_id'] ) ); - if ( ! empty( $id ) ) { - $info_text = get_post_meta( $location_id, 'meta_name' ); - - if ( ! empty( $info_text ) ) { - $text = $info_text; - } - - } - */ - // function() { $a = $b; }; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.php deleted file mode 100644 index 36c556d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.php +++ /dev/null @@ -1,76 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class CommentedOutCodeUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return []; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getWarningList($testFile='CommentedOutCodeUnitTest.inc') - { - switch ($testFile) { - case 'CommentedOutCodeUnitTest.inc': - return [ - 6 => 1, - 8 => 1, - 15 => 1, - 19 => 1, - 87 => 1, - 91 => 1, - 97 => 1, - 109 => 1, - 116 => 1, - 128 => 1, - 147 => 1, - 158 => 1, - ]; - break; - case 'CommentedOutCodeUnitTest.css': - return [ - 7 => 1, - 16 => 1, - ]; - break; - default: - return []; - break; - }//end switch - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowBooleanStatementUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowBooleanStatementUnitTest.inc deleted file mode 100644 index 4701c23..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowBooleanStatementUnitTest.inc +++ /dev/null @@ -1,27 +0,0 @@ - \ No newline at end of file diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowBooleanStatementUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowBooleanStatementUnitTest.php deleted file mode 100644 index 6439b63..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowBooleanStatementUnitTest.php +++ /dev/null @@ -1,53 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class DisallowBooleanStatementUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 3 => 1, - 8 => 1, - 13 => 1, - 15 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowComparisonAssignmentUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowComparisonAssignmentUnitTest.inc deleted file mode 100644 index 022aca7..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowComparisonAssignmentUnitTest.inc +++ /dev/null @@ -1,73 +0,0 @@ -nextSibling; $node; $node = $node->nextSibling) { - if ($node->nodeType !== XML_ELEMENT_NODE) { - continue; - } - - for ($node = $fields->nextSibling; $node; $node = $node->nextSibling) { - if ($node->nodeType !== XML_ELEMENT_NODE) { - continue; - } - } -} - -$a = $b ? $c : $d; -$a = $b === true ? $c : $d; - -$this->_args = $this->_getArgs(($_SERVER['argv'] ?? [])); -$args = ($_SERVER['argv'] ?? []); - -$a = [ - 'a' => ($foo) ? $foo : $bar, -]; - -$a = [ - 'a' => ($foo) ? fn() => return 1 : fn() => return 2, -]; - -$var = $foo->something(!$var); -$var = $foo?->something(!$var); - -$callback = function ($value) { - if ($value > 10) { - return false; - } -}; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowComparisonAssignmentUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowComparisonAssignmentUnitTest.php deleted file mode 100644 index c8d8b0b..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowComparisonAssignmentUnitTest.php +++ /dev/null @@ -1,59 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class DisallowComparisonAssignmentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 3 => 1, - 5 => 1, - 6 => 1, - 7 => 1, - 8 => 1, - 10 => 1, - 52 => 1, - 53 => 1, - 58 => 1, - 62 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.inc deleted file mode 100644 index f57e071..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.inc +++ /dev/null @@ -1,18 +0,0 @@ - $x; - -$b = fn ($b) => $b ? true : false; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.js b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.js deleted file mode 100644 index 56387c0..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.js +++ /dev/null @@ -1,2 +0,0 @@ -x = (x?a:x); -id = id.replace(/row\/:/gi, ''); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.php deleted file mode 100644 index 27083ce..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.php +++ /dev/null @@ -1,63 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class DisallowInlineIfUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='DisallowInlineIfUnitTest.inc') - { - switch ($testFile) { - case 'DisallowInlineIfUnitTest.inc': - return [ - 8 => 1, - 18 => 1, - ]; - break; - case 'DisallowInlineIfUnitTest.js': - return [1 => 1]; - break; - default: - return []; - break; - }//end switch - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowMultipleAssignmentsUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowMultipleAssignmentsUnitTest.inc deleted file mode 100644 index f657fb4..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowMultipleAssignmentsUnitTest.inc +++ /dev/null @@ -1,110 +0,0 @@ -fetch(PDO::FETCH_NUM)) { - $result[$row[0]] = array(); - $result[$row[0]][] = $current; - - self::$_inTransaction = TRUE; - parent::$_inTransaction = TRUE; - static::$_inTransaction = TRUE; - $$varName = $varValue; - } - -}//end getVar() - -class myClass -{ - private static $_dbh = NULL; - public $dbh = NULL; - protected $dbh = NULL; - var $dbh = NULL; // Old PHP4 compatible code. -} - -A::$a = 'b'; -\A::$a = 'c'; -\A\B\C::$d = 'd'; -B\C::$d = 'e'; - -@$a = 1; - -$a = []; -foreach ($a as $b) - $c = 'd'; - -$var = $var2; -list ($a, $b) = explode(',', $c); -$var1 ? $var2 = 0 : $var2 = 1; - -$obj->$classVar = $prefix.'-'.$type; - -$closureWithDefaultParamter = function(array $testArray=array()) {}; -?> - - - 10, - false => 0 - }, -]; - -$arrow_function = fn ($a = null) => $a; - -function ($html) { - $regEx = '/regexp/'; - - return preg_replace_callback($regEx, function ($matches) { - [$all] = $matches; - return $all; - }, $html); -}; - - -function () { - $a = false; - - some_label: - - $b = getB(); -}; - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowMultipleAssignmentsUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowMultipleAssignmentsUnitTest.php deleted file mode 100644 index 618d76e..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowMultipleAssignmentsUnitTest.php +++ /dev/null @@ -1,58 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class DisallowMultipleAssignmentsUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 4 => 1, - 5 => 2, - 7 => 1, - 9 => 1, - 12 => 1, - 14 => 1, - 15 => 1, - 79 => 1, - 85 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.inc deleted file mode 100644 index 56802e3..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.inc +++ /dev/null @@ -1,58 +0,0 @@ -children); $i++) { -} - - - -for ($i = 0; $i < sizeof($array); $i++) { -} - -$num = sizeof($array); - -while ($i < sizeof($array)) { -} - -do { -} while ($i < sizeof($array)); - -for ($i = 0; $i < sizeof($this->children); $i++) { -} - - - - -for ($i = 0; $i < strlen($string); $i++) { -} - -$num = strlen($string); - -while ($i < strlen($string)) { -} - -do { -} while ($i < strlen($string)); - -for ($i = 0; $i < strlen($this->string); $i++) { -} - -for ($i = sizeof($array); $i > 0; $i--) { -} - -do { - echo $a->count; - $a->count--; -} while($a->count); - -for ($i = 0; $i < $a->count; $i++) {} -for ($i = 0; $i < $a?->count; $i++) {} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.js b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.js deleted file mode 100644 index 8f7f7b9..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.js +++ /dev/null @@ -1,13 +0,0 @@ -for (var i = 0; i < permissions.length; i++) { - // Code here. -} - -var permLen = permissions.length; -for (var length = 0; i < permLen; i++) { - // Code here. -} - -var myArray = [1, 2, 3, 4]; -for (var i = myArray.length; i >= 0; i--) { - var x = i; -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.php deleted file mode 100644 index 21260ad..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.php +++ /dev/null @@ -1,73 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class DisallowSizeFunctionsInLoopsUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='DisallowSizeFunctionsInLoopsUnitTest.inc') - { - switch ($testFile) { - case 'DisallowSizeFunctionsInLoopsUnitTest.inc': - return [ - 2 => 1, - 7 => 1, - 11 => 1, - 13 => 1, - 18 => 1, - 23 => 1, - 27 => 1, - 29 => 1, - 35 => 1, - 40 => 1, - 44 => 1, - 46 => 1, - ]; - break; - case 'DisallowSizeFunctionsInLoopsUnitTest.js': - return [1 => 1]; - break; - default: - return []; - break; - }//end switch - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DiscouragedFunctionsUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DiscouragedFunctionsUnitTest.inc deleted file mode 100644 index ca457a2..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DiscouragedFunctionsUnitTest.inc +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DiscouragedFunctionsUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DiscouragedFunctionsUnitTest.php deleted file mode 100644 index 2b2ff5b..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DiscouragedFunctionsUnitTest.php +++ /dev/null @@ -1,52 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class DiscouragedFunctionsUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return []; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return [ - 2 => 1, - 3 => 1, - 4 => 1, - ]; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.inc deleted file mode 100644 index c61d5a3..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.inc +++ /dev/null @@ -1,119 +0,0 @@ - - - -<?php echo $title ?> - - - - - hello - - - - - - - - - - - - - - - - - - - - - -section as $section) { - ?> - - - - - - section as $section) { - ?> -
    - - - - - - - - -?> - - - - - - - - - - - - - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.inc.fixed deleted file mode 100644 index 5b43d84..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.inc.fixed +++ /dev/null @@ -1,119 +0,0 @@ - - - -<?php echo $title; ?> - - - - - hello - - - - - - - - - - - - - - - - - - - -section as $section) { - ?> -
    - - - - - section as $section) { - ?> -
    - - - - - - - - - - - - -?> - - - - - - - - - - - - - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.php deleted file mode 100644 index f8cf4cc..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.php +++ /dev/null @@ -1,78 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class EmbeddedPhpUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 7 => 1, - 12 => 1, - 18 => 1, - 19 => 2, - 20 => 1, - 21 => 1, - 22 => 3, - 24 => 1, - 26 => 1, - 29 => 1, - 30 => 1, - 31 => 1, - 34 => 1, - 36 => 1, - 40 => 1, - 41 => 1, - 44 => 1, - 45 => 1, - 49 => 1, - 59 => 1, - 63 => 1, - 93 => 1, - 94 => 2, - 100 => 1, - 102 => 1, - 112 => 1, - 113 => 1, - 116 => 1, - 117 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EvalUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EvalUnitTest.inc deleted file mode 100644 index ee4c73e..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EvalUnitTest.inc +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EvalUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EvalUnitTest.php deleted file mode 100644 index adee788..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EvalUnitTest.php +++ /dev/null @@ -1,51 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class EvalUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return []; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return [ - 2 => 1, - 4 => 1, - ]; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/GlobalKeywordUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/GlobalKeywordUnitTest.inc deleted file mode 100644 index 4b2a210..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/GlobalKeywordUnitTest.inc +++ /dev/null @@ -1,13 +0,0 @@ - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/GlobalKeywordUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/GlobalKeywordUnitTest.php deleted file mode 100644 index 52f6a00..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/GlobalKeywordUnitTest.php +++ /dev/null @@ -1,51 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class GlobalKeywordUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 8 => 1, - 9 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.inc deleted file mode 100644 index 56f4393..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.inc +++ /dev/null @@ -1,27 +0,0 @@ -foo. -Now, I am printing some {$foo->bar[1]}. -This should not print a capital 'A': \x41 -EOT; - -// The following function has a simulated git conflict for testing. -// This is not a merge conflict - it is a valid test case. -// Please do not remove. -function test() - { - $arr = array( - 'a' => 'a' -<<<<<<< HEAD - 'b' => 'b' -======= - 'c' => 'c' ->>>>>>> master - ); - } diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.php deleted file mode 100644 index 2f06f0b..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.php +++ /dev/null @@ -1,51 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class HeredocUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 2 => 1, - 8 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/InnerFunctionsUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/InnerFunctionsUnitTest.inc deleted file mode 100644 index dd85146..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/InnerFunctionsUnitTest.inc +++ /dev/null @@ -1,50 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class InnerFunctionsUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 5 => 1, - 46 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.inc deleted file mode 100644 index c67381a..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.inc +++ /dev/null @@ -1,43 +0,0 @@ -Count(); -$count = $object::Count(); -$count = $object->count(); -$count = $object::count(); -class MyClass { - public function Count() {} -} - -function &Sort() { - -} - -$connection = new Db\Adapter\Pdo\Mysql($config); - -namespace Strtolower\Silly; - -use function strToUpper as somethingElse; -use function MyClass\WordsToUpper as UCWords; // Intentional redeclared function error. -use function strToUpper\NotTheFunction; - -class ArrayUnique {} - -$sillyComments = strToLower /*comment*/ ($string); - -$callToGlobalFunction = \STR_REPEAT($a, 2); -$callToGlobalFunction = \ /*comment*/ str_Repeat($a, 2); - -$callToNamespacedFunction = MyNamespace /* phpcs:ignore Standard */ \STR_REPEAT($a, 2); -$callToNamespacedFunction = namespace\STR_REPEAT($a, 2); // Could potentially be false negative. - -$filePath = new \File($path); - -$count = $object?->Count(); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.inc.fixed deleted file mode 100644 index 40507c0..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.inc.fixed +++ /dev/null @@ -1,43 +0,0 @@ -Count(); -$count = $object::Count(); -$count = $object->count(); -$count = $object::count(); -class MyClass { - public function Count() {} -} - -function &Sort() { - -} - -$connection = new Db\Adapter\Pdo\Mysql($config); - -namespace Strtolower\Silly; - -use function strtoupper as somethingElse; -use function MyClass\WordsToUpper as UCWords; // Intentional redeclared function error. -use function strToUpper\NotTheFunction; - -class ArrayUnique {} - -$sillyComments = strtolower /*comment*/ ($string); - -$callToGlobalFunction = \str_repeat($a, 2); -$callToGlobalFunction = \ /*comment*/ str_repeat($a, 2); - -$callToNamespacedFunction = MyNamespace /* phpcs:ignore Standard */ \STR_REPEAT($a, 2); -$callToNamespacedFunction = namespace\STR_REPEAT($a, 2); // Could potentially be false negative. - -$filePath = new \File($path); - -$count = $object?->Count(); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.php deleted file mode 100644 index 708d01e..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.php +++ /dev/null @@ -1,55 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class LowercasePHPFunctionsUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 2 => 1, - 4 => 1, - 27 => 1, - 33 => 1, - 35 => 1, - 36 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.1.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.1.inc deleted file mode 100644 index ed7f011..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.1.inc +++ /dev/null @@ -1,301 +0,0 @@ -{$action . 'JsonAction'}(); -} - -switch (true) { - case 1: - return foo( - function () { - $foo = $bar; // when this is removed it works ok - return false; // from here on it reports unreachable - } - ); -} - -for($i=0,$j=50; $i<100; $i++) { - while($j--) { - if($j==17) { - goto end; - echo 'unreachable'; - } - } -} - -switch ($var) { - case '1': - goto end; - echo 'hi'; - - case '2': - case '3': - if ($something === true) { - goto end; - echo 'hi'; - } - break; - default: - goto end; - - if ($something === true) { - goto end; - echo 'hi'; - } -} - -end: -echo 'j hit 17'; - -// Issue 2512. -class TestAlternativeControlStructures { - - public function alternative_switch_in_function( $var ) { - - switch ( $var ) : - case 'value1': - do_something(); - break; - - default: - case 'value2': - do_something_else(); - break; - endswitch; - } - - public function various_alternative_control_structures() { - $_while = 1; - - for ( $a = 0; $a++ < 1; ) : - foreach ( [ 1 ] as $b ) : - while ( $_while-- ) : - if ( 1 ) : - switch ( 1 ) : - default: - echo 'yay, we made it!'; - break; - endswitch; - endif; - endwhile; - endforeach; - endfor; - } -} - -$var_after_class_in_global_space = 1; -do_something_else(); - -// Intentional syntax error. -return array_map( diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.2.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.2.inc deleted file mode 100644 index 407c474..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.2.inc +++ /dev/null @@ -1,55 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class NonExecutableCodeUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return []; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getWarningList($testFile='') - { - switch ($testFile) { - case 'NonExecutableCodeUnitTest.1.inc': - return [ - 5 => 1, - 11 => 1, - 17 => 1, - 18 => 1, - 19 => 2, - 28 => 1, - 32 => 1, - 33 => 2, - 34 => 2, - 42 => 1, - 45 => 1, - 54 => 1, - 58 => 1, - 73 => 1, - 83 => 1, - 95 => 1, - 105 => 1, - 123 => 1, - 147 => 1, - 150 => 1, - 153 => 1, - 166 => 1, - 180 => 1, - 232 => 1, - 240 => 1, - 246 => 1, - 252 => 1, - 253 => 1, - 254 => 2, - ]; - break; - case 'NonExecutableCodeUnitTest.2.inc': - return [ - 7 => 1, - 8 => 1, - 9 => 1, - 10 => 2, - 14 => 1, - 48 => 2, - ]; - break; - default: - return []; - break; - }//end switch - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/MemberVarScopeUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/MemberVarScopeUnitTest.inc deleted file mode 100644 index 6df12cc..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/MemberVarScopeUnitTest.inc +++ /dev/null @@ -1,72 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Scope; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class MemberVarScopeUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 7 => 1, - 25 => 1, - 29 => 1, - 33 => 1, - 39 => 1, - 41 => 1, - 66 => 2, - 67 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return [71 => 1]; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/MethodScopeUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/MethodScopeUnitTest.inc deleted file mode 100644 index cec0355..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/MethodScopeUnitTest.inc +++ /dev/null @@ -1,42 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Scope; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class MethodScopeUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 6 => 1, - 30 => 1, - 39 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/StaticThisUsageUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/StaticThisUsageUnitTest.inc deleted file mode 100644 index 38b443f..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/StaticThisUsageUnitTest.inc +++ /dev/null @@ -1,117 +0,0 @@ -func2()); - $result = $this->getValue($value); - return $this->setValue($result); - } - - public static function /* */ func1() - { - return $this->setValue($result); - } - - public static function - func1() - { - return $this->setValue($result); - } - - public function func1() - { - $value = 'hello'; - $newValue = array($this->func2()); - $result = $this->getValue($value); - return $this->setValue($result); - } - - function func1() - { - $value = 'hello'; - $newValue = array($this->func2()); - $result = $this->getValue($value); - return $this->setValue($result); - } - - public static function func1() { - return function() { - echo $this->name; - }; - } - - private static function func1(array $data) - { - return new class() - { - private $data; - - public function __construct(array $data) - { - $this->data = $data; - } - }; - } - - public function getAnonymousClass() { - return new class() { - public static function something() { - $this->doSomething(); - } - }; - } -} - -trait MyTrait { - public static function myFunc() { - $this->doSomething(); - } -} - -$b = new class() -{ - public static function myFunc() { - $this->doSomething(); - } - - public static function other() { - return fn () => $this->name; - } - - public static function anonClassUseThis() { - return new class($this) { - public function __construct($class) { - } - }; - } - - public static function anonClassAnotherThis() { - return new class() { - public function __construct() { - $this->id = 1; - } - }; - } - - public static function anonClassNestedUseThis() { - return new class(new class($this) {}) { - }; - } - - public static function anonClassNestedAnotherThis() { - return new class(new class() { - public function __construct() { - $this->id = 1; - } - }) { - }; - } - - public static function thisMustBeLowercase() { - $This = 'hey'; - - return $This; - } -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/StaticThisUsageUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/StaticThisUsageUnitTest.php deleted file mode 100644 index 2935241..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/StaticThisUsageUnitTest.php +++ /dev/null @@ -1,61 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Scope; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class StaticThisUsageUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 7 => 1, - 8 => 1, - 9 => 1, - 14 => 1, - 20 => 1, - 41 => 1, - 61 => 1, - 69 => 1, - 76 => 1, - 80 => 1, - 84 => 1, - 99 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/ConcatenationSpacingUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/ConcatenationSpacingUnitTest.inc deleted file mode 100644 index 3bf4186..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/ConcatenationSpacingUnitTest.inc +++ /dev/null @@ -1,49 +0,0 @@ -add_help_tab( array( -'id' => <<', -) ); - -// phpcs:set Squiz.Strings.ConcatenationSpacing spacing 1 - -$string = 'Hello'.$there.'. How are'.$you.$going. "today $okay"; -$string = 'Hello' . $there . '. How are' . $you . $going . "today $okay"; -$string = 'Hello'.$there; -$string = 'Hello'. $there; -$string = 'Hello' .$there; - -// phpcs:set Squiz.Strings.ConcatenationSpacing ignoreNewlines true -$y = '1' - . '2' - . '3'; - -$y = '1' . - '2' . - '3'; - -$y = '1' -. '2' -. '3'; - -$y = '1' - .'2'. - '3' - . '4'; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/ConcatenationSpacingUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/ConcatenationSpacingUnitTest.inc.fixed deleted file mode 100644 index b45f1a4..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/ConcatenationSpacingUnitTest.inc.fixed +++ /dev/null @@ -1,47 +0,0 @@ -add_help_tab( array( -'id' => <<', -) ); - -// phpcs:set Squiz.Strings.ConcatenationSpacing spacing 1 - -$string = 'Hello' . $there . '. How are' . $you . $going . "today $okay"; -$string = 'Hello' . $there . '. How are' . $you . $going . "today $okay"; -$string = 'Hello' . $there; -$string = 'Hello' . $there; -$string = 'Hello' . $there; - -// phpcs:set Squiz.Strings.ConcatenationSpacing ignoreNewlines true -$y = '1' - . '2' - . '3'; - -$y = '1' . - '2' . - '3'; - -$y = '1' -. '2' -. '3'; - -$y = '1' - . '2' . - '3' - . '4'; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/ConcatenationSpacingUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/ConcatenationSpacingUnitTest.php deleted file mode 100644 index 862af7d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/ConcatenationSpacingUnitTest.php +++ /dev/null @@ -1,66 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Strings; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ConcatenationSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 3 => 5, - 5 => 1, - 6 => 1, - 9 => 1, - 10 => 1, - 12 => 1, - 13 => 1, - 14 => 1, - 15 => 1, - 16 => 5, - 22 => 1, - 27 => 5, - 29 => 1, - 30 => 1, - 31 => 1, - 47 => 2, - 49 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/DoubleQuoteUsageUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/DoubleQuoteUsageUnitTest.inc deleted file mode 100644 index c8cc638..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/DoubleQuoteUsageUnitTest.inc +++ /dev/null @@ -1,37 +0,0 @@ -"; -$string = "Value: $var[test]"; -$string = "\0"; -$string = "\$var"; - -$x = "bar = '$z', -baz = '" . $a . "'...$x"; - -$string = "Hello -there"; -$string = 'Hello -there'; - -$string = "\123 \234"."\u123"."\e"; - -echo "window.location = \"".$url."\";\n"; -echo "" - -$string = "Hello - there"; - -function test() { - echo "It Worked'; -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/DoubleQuoteUsageUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/DoubleQuoteUsageUnitTest.inc.fixed deleted file mode 100644 index 9730919..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/DoubleQuoteUsageUnitTest.inc.fixed +++ /dev/null @@ -1,37 +0,0 @@ -"; -$string = "Value: $var[test]"; -$string = "\0"; -$string = '$var'; - -$x = "bar = '$z', -baz = '" . $a . "'...$x"; - -$string = 'Hello -there'; -$string = 'Hello -there'; - -$string = "\123 \234"."\u123"."\e"; - -echo 'window.location = "'.$url."\";\n"; -echo '' - -$string = 'Hello - there'; - -function test() { - echo "It Worked'; -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/DoubleQuoteUsageUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/DoubleQuoteUsageUnitTest.php deleted file mode 100644 index a95d188..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/DoubleQuoteUsageUnitTest.php +++ /dev/null @@ -1,62 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Strings; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class DoubleQuoteUsageUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 4 => 1, - 5 => 1, - 6 => 1, - 8 => 2, - 14 => 1, - 15 => 1, - 17 => 1, - 19 => 1, - 20 => 1, - 22 => 1, - 29 => 1, - 30 => 1, - 32 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/EchoedStringsUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/EchoedStringsUnitTest.inc deleted file mode 100644 index 9e0391d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/EchoedStringsUnitTest.inc +++ /dev/null @@ -1,13 +0,0 @@ -returndate == 0) ? 'Not returned' : date('d/m/Y', $loan_device->returndate); -?> -

    -

    diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/EchoedStringsUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/EchoedStringsUnitTest.inc.fixed deleted file mode 100644 index 37c7d24..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/EchoedStringsUnitTest.inc.fixed +++ /dev/null @@ -1,13 +0,0 @@ -returndate == 0) ? 'Not returned' : date('d/m/Y', $loan_device->returndate); -?> -

    -

    diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/EchoedStringsUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/EchoedStringsUnitTest.php deleted file mode 100644 index 0d9af1e..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/EchoedStringsUnitTest.php +++ /dev/null @@ -1,55 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Strings; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class EchoedStringsUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 5 => 1, - 6 => 1, - 7 => 1, - 8 => 1, - 9 => 1, - 13 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/CastSpacingUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/CastSpacingUnitTest.inc deleted file mode 100644 index fa65112..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/CastSpacingUnitTest.inc +++ /dev/null @@ -1,9 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class CastSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 3 => 1, - 4 => 1, - 5 => 1, - 6 => 1, - 9 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.inc deleted file mode 100644 index 0371ce4..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.inc +++ /dev/null @@ -1,263 +0,0 @@ - -
    - - - -
    - children as $child) { - // There should be no error after this - // foreach, because it is followed by a - // close PHP tag. - } - ?> -
    -children as $child) { - echo $child; - -} - -if ($defaultPageDesign === 0 - && $defaultCascade === TRUE - && $defaultChildDesign === 0 -) { - $settingsUpdated = FALSE; -} - -foreach ( $blah as $var ) { - if ( $blah ) { - } -} - -if ( - $defaultPageDesign === 0 - && $defaultCascade === TRUE - && $defaultChildDesign === 0 -) { - $settingsUpdated = FALSE; -} - -$moo = 'blar'; -switch ($moo) -{ - case 'blar': - if ($moo === 'blar2') { - $moo = 'blar' - } - return $moo; - - default: - $moo = 'moo'; - break; -} - -do { -} -while (true); - -try { - // Something -} catch (Exception $e) { - // Something -} - -try { - - // Something - -} catch (Exception $e) { - - // Something - -} - -if ($one) { -} -elseif ($two) { -} -// else if something -else if ($three) { -} // else do something -else { -} - -if ($one) { - -} - -do { - echo 'hi'; -} while ( $blah ); - -if ($one) { -} -// No blank line here. -if ($two) { -} - -switch ($moo) -{ - case 'blar': - if ($moo === 'blar2') { - $moo = 'blar' - } - - return $moo; -} - -try { - // Something -} -catch (Exception $e) { - // Something -} -finally { - // Something -} - -if ($foo) { - - - /** - * Comment - */ - function foo() { - // Code here - } - - - /** - * Comment - */ - class bar() { - - }//end class - - -} - -if (true) { // some comment goes here - - echo 'foo'; -} - -if (true) { echo 'foo'; - - echo 'foo'; -} - -if ($true) { - echo 'hi 2'; -}//end if -echo 'hi'; - -if ($true) { - echo 'hi 2'; -} // phpcs:enable Standard.Category.Sniff -- for reasons. -echo 'hi'; - -?> - - - - - - - 1, - 2 => 2, - -}; -echo $expr; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.inc.fixed deleted file mode 100644 index ad4505c..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.inc.fixed +++ /dev/null @@ -1,255 +0,0 @@ - - - - - -
    - children as $child) { - // There should be no error after this - // foreach, because it is followed by a - // close PHP tag. - } - ?> -
    -children as $child) { - echo $child; -} - -if ($defaultPageDesign === 0 - && $defaultCascade === TRUE - && $defaultChildDesign === 0 -) { - $settingsUpdated = FALSE; -} - -foreach ($blah as $var) { - if ($blah) { - } -} - -if ($defaultPageDesign === 0 - && $defaultCascade === TRUE - && $defaultChildDesign === 0 -) { - $settingsUpdated = FALSE; -} - -$moo = 'blar'; -switch ($moo) -{ - case 'blar': - if ($moo === 'blar2') { - $moo = 'blar' - } - return $moo; - - default: - $moo = 'moo'; - break; -} - -do { -} -while (true); - -try { - // Something -} catch (Exception $e) { - // Something -} - -try { - // Something -} catch (Exception $e) { - // Something -} - -if ($one) { -} -elseif ($two) { -} -// else if something -else if ($three) { -} // else do something -else { -} - -if ($one) { -} - -do { - echo 'hi'; -} while ($blah); - -if ($one) { -} - -// No blank line here. -if ($two) { -} - -switch ($moo) -{ - case 'blar': - if ($moo === 'blar2') { - $moo = 'blar' - } - return $moo; -} - -try { - // Something -} -catch (Exception $e) { - // Something -} -finally { - // Something -} - -if ($foo) { - - - /** - * Comment - */ - function foo() { - // Code here - } - - - /** - * Comment - */ - class bar() { - - }//end class - - -} - -if (true) { // some comment goes here - echo 'foo'; -} - -if (true) { echo 'foo'; - - echo 'foo'; -} - -if ($true) { - echo 'hi 2'; -}//end if - -echo 'hi'; - -if ($true) { - echo 'hi 2'; -} // phpcs:enable Standard.Category.Sniff -- for reasons. - -echo 'hi'; - -?> - - - - - - 1, - 2 => 2, -}; - -echo $expr; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.js b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.js deleted file mode 100644 index 1c889a1..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.js +++ /dev/null @@ -1,93 +0,0 @@ - -if (something) { -} -for (i = 0; i < 10; i++) { -} - -while (true) { - for (i = 0; i < 10; i++) { - } - if (something) { - } - - do { - } while (true); - -} - -if (one) { -} else (two) { -} else if (three) { -} -if (one) { -} else (two) { -} else if (three) { -} - -switch (blah) { - case 'one': - if (blah) { - // There are no spaces before break. - } - break; - - default: - if (blah) { - // There are no spaces before break. - } - break; -} - -switch (blah) { - case 'one': - if (blah) { - // There are no spaces before break. - } - break; - - default: - if (blah) { - // Code here. - } -} - -for (i = 0; i < 10; i++) { - if (blah) { - } - break; -} - -while (true) { - for (i = 0; i < 10; i++) { - - if (something) { - } - - } - - do { - - alert(i); - } while (true); -} - -for ( i = 0; i < 10; i++ ) { - if ( blah ) { - } -} - -var x = { - a: function () { - if (blah) { - } - - }, -}; - -if (one) { -} -// else if something -else if (two) { -} // else do something -else { -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.js.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.js.fixed deleted file mode 100644 index bb979bc..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.js.fixed +++ /dev/null @@ -1,93 +0,0 @@ - -if (something) { -} - -for (i = 0; i < 10; i++) { -} - -while (true) { - for (i = 0; i < 10; i++) { - } - - if (something) { - } - - do { - } while (true); -} - -if (one) { -} else (two) { -} else if (three) { -} - -if (one) { -} else (two) { -} else if (three) { -} - -switch (blah) { - case 'one': - if (blah) { - // There are no spaces before break. - } - break; - - default: - if (blah) { - // There are no spaces before break. - } - break; -} - -switch (blah) { - case 'one': - if (blah) { - // There are no spaces before break. - } - break; - - default: - if (blah) { - // Code here. - } -} - -for (i = 0; i < 10; i++) { - if (blah) { - } - - break; -} - -while (true) { - for (i = 0; i < 10; i++) { - if (something) { - } - } - - do { - alert(i); - } while (true); -} - -for (i = 0; i < 10; i++) { - if (blah) { - } -} - -var x = { - a: function () { - if (blah) { - } - - }, -}; - -if (one) { -} -// else if something -else if (two) { -} // else do something -else { -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.php deleted file mode 100644 index ac3f5d6..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.php +++ /dev/null @@ -1,103 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ControlStructureSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='ControlStructureSpacingUnitTest.inc') - { - switch ($testFile) { - case 'ControlStructureSpacingUnitTest.inc': - return [ - 3 => 1, - 5 => 1, - 8 => 1, - 15 => 1, - 23 => 1, - 74 => 1, - 79 => 1, - 82 => 1, - 83 => 1, - 87 => 1, - 103 => 1, - 113 => 2, - 114 => 2, - 118 => 1, - 150 => 1, - 153 => 1, - 154 => 1, - 157 => 1, - 170 => 1, - 176 => 2, - 179 => 1, - 189 => 1, - 225 => 1, - 237 => 1, - 242 => 1, - 246 => 1, - 248 => 1, - 257 => 3, - 261 => 1, - 262 => 1, - ]; - break; - case 'ControlStructureSpacingUnitTest.js': - return [ - 3 => 1, - 9 => 1, - 15 => 1, - 21 => 1, - 56 => 1, - 61 => 1, - 64 => 1, - 65 => 1, - 68 => 1, - 74 => 2, - 75 => 2, - ]; - break; - default: - return []; - break; - }//end switch - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionClosingBraceSpaceUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionClosingBraceSpaceUnitTest.inc deleted file mode 100644 index e831e25..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionClosingBraceSpaceUnitTest.inc +++ /dev/null @@ -1,39 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class FunctionClosingBraceSpaceUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='FunctionClosingBraceSpaceUnitTest.inc') - { - switch ($testFile) { - case 'FunctionClosingBraceSpaceUnitTest.inc': - return [ - 10 => 1, - 21 => 1, - 28 => 1, - 29 => 1, - 31 => 1, - 39 => 1, - ]; - break; - case 'FunctionClosingBraceSpaceUnitTest.js': - return [ - 13 => 1, - 25 => 1, - 32 => 1, - 53 => 1, - 59 => 1, - 67 => 1, - 84 => 1, - 128 => 1, - ]; - break; - default: - return []; - break; - }//end switch - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionOpeningBraceSpaceUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionOpeningBraceSpaceUnitTest.inc deleted file mode 100644 index fe2c903..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionOpeningBraceSpaceUnitTest.inc +++ /dev/null @@ -1,54 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class FunctionOpeningBraceSpaceUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='FunctionOpeningBraceSpaceUnitTest.inc') - { - switch ($testFile) { - case 'FunctionOpeningBraceSpaceUnitTest.inc': - return [ - 10 => 1, - 25 => 1, - 49 => 1, - ]; - - case 'FunctionOpeningBraceSpaceUnitTest.js': - return [ - 11 => 1, - 31 => 1, - 38 => 1, - 88 => 1, - ]; - - default: - return []; - }//end switch - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.1.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.1.inc deleted file mode 100644 index 36a287f..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.1.inc +++ /dev/null @@ -1,576 +0,0 @@ -setLogger(new class { - public function a(){} - private function b(){} - protected function c(){} -}); - -?> - -setLogger(new class { - - public function a(){} - - private function b(){} - - protected function c(){} - -}); - -?> - - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class FunctionSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'FunctionSpacingUnitTest.1.inc': - return [ - 26 => 1, - 35 => 1, - 44 => 1, - 51 => 1, - 55 => 1, - 61 => 1, - 64 => 1, - 66 => 1, - 81 => 1, - 100 => 1, - 111 => 1, - 113 => 1, - 119 => 2, - 141 => 1, - 160 => 1, - 173 => 2, - 190 => 1, - 224 => 2, - 281 => 1, - 282 => 1, - 295 => 1, - 297 => 1, - 303 => 1, - 327 => 1, - 329 => 1, - 338 => 1, - 344 => 1, - 345 => 1, - 354 => 2, - 355 => 1, - 356 => 1, - 360 => 2, - 361 => 1, - 362 => 1, - 385 => 1, - 399 => 1, - 411 => 2, - 418 => 2, - 426 => 2, - 432 => 1, - 437 => 1, - 438 => 1, - 442 => 2, - 444 => 1, - 449 => 1, - 458 => 2, - 459 => 1, - 460 => 1, - 465 => 2, - 466 => 1, - 467 => 1, - 471 => 1, - 473 => 2, - 475 => 1, - 478 => 2, - 479 => 1, - 483 => 2, - 495 => 1, - 529 => 1, - 539 => 1, - 547 => 2, - 551 => 1, - 553 => 1, - 560 => 1, - 566 => 1, - ]; - - case 'FunctionSpacingUnitTest.2.inc': - return [2 => 1]; - - case 'FunctionSpacingUnitTest.3.inc': - return [7 => 1]; - - case 'FunctionSpacingUnitTest.5.inc': - return [5 => 1]; - - case 'FunctionSpacingUnitTest.6.inc': - return [10 => 1]; - - default: - return []; - }//end switch - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.inc deleted file mode 100644 index e8f2eda..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.inc +++ /dev/null @@ -1,43 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class LanguageConstructSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 3 => 1, - 7 => 1, - 11 => 1, - 15 => 1, - 19 => 1, - 23 => 1, - 27 => 1, - 31 => 1, - 34 => 1, - 35 => 1, - 39 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LogicalOperatorSpacingUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LogicalOperatorSpacingUnitTest.inc deleted file mode 100644 index c2f4ec7..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LogicalOperatorSpacingUnitTest.inc +++ /dev/null @@ -1,19 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class LogicalOperatorSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='LogicalOperatorSpacingUnitTest.inc') - { - return [ - 4 => 2, - 5 => 3, - 6 => 3, - 15 => 1, - 17 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.inc deleted file mode 100644 index 038072d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.inc +++ /dev/null @@ -1,367 +0,0 @@ - 'a', 'b' => 'b' ), - $varQ = 'string', - $varR = 123; -} - -// Make sure the determination of whether a property is the first property or not is done correctly. -class ClassUsingSimpleTraits -{ - use HelloWorld; - - - /* comment */ - public $firstVar = array( 'a', 'b' ); - protected $secondVar = true; -} - -class ClassUsingComplexTraits -{ - use A, B { - B::smallTalk insteadof A; - A::bigTalk insteadof B; - } - - - - public $firstVar = array( 'a', 'b' ); - - - /* comment */ - protected $secondVar = true; -} - -class Foo -{ - - - private function foo() - { - } - - - /* no error here because after function */ - private $bar = false; -} - -class CommentedOutCodeAtStartOfClass { - - /** - * Description. - * - * @var bool - */ - //public $commented_out_property = true; - - /** - * Description. - * - * @var bool - */ - public $property = true; -} - -class CommentedOutCodeAtStartOfClassNoBlankLine { - - // phpcs:disable Stnd.Cat.Sniff -- For reasons. - /** - * Description. - * - * @var bool - */ - public $property = true; -} - -class HasAttributes -{ - /** - * Short description of the member variable. - * - * @var array - */ - - #[ORM\Id]#[ORM\Column("integer")] - - private $id; - - - /** - * Short description of the member variable. - * - * @var array - */ - #[ORM\GeneratedValue] - - #[ORM\Column(ORM\Column::T_INTEGER)] - protected $height; - - #[SingleAttribute] - protected $propertySingle; - - #[FirstAttribute] - #[SecondAttribute] - protected $propertyDouble; - #[ThirdAttribute] - protected $propertyWithoutSpacing; -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.inc.fixed deleted file mode 100644 index 3cb2ca3..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.inc.fixed +++ /dev/null @@ -1,352 +0,0 @@ - 'a', 'b' => 'b' ), - $varQ = 'string', - $varR = 123; -} - -// Make sure the determination of whether a property is the first property or not is done correctly. -class ClassUsingSimpleTraits -{ - use HelloWorld; - - /* comment */ - public $firstVar = array( 'a', 'b' ); - - protected $secondVar = true; -} - -class ClassUsingComplexTraits -{ - use A, B { - B::smallTalk insteadof A; - A::bigTalk insteadof B; - } - - public $firstVar = array( 'a', 'b' ); - - /* comment */ - protected $secondVar = true; -} - -class Foo -{ - - - private function foo() - { - } - - - /* no error here because after function */ - private $bar = false; -} - -class CommentedOutCodeAtStartOfClass { - - /** - * Description. - * - * @var bool - */ - //public $commented_out_property = true; - - /** - * Description. - * - * @var bool - */ - public $property = true; -} - -class CommentedOutCodeAtStartOfClassNoBlankLine { - - // phpcs:disable Stnd.Cat.Sniff -- For reasons. - - /** - * Description. - * - * @var bool - */ - public $property = true; -} - -class HasAttributes -{ - - /** - * Short description of the member variable. - * - * @var array - */ - #[ORM\Id]#[ORM\Column("integer")] - private $id; - - /** - * Short description of the member variable. - * - * @var array - */ - #[ORM\GeneratedValue] - #[ORM\Column(ORM\Column::T_INTEGER)] - protected $height; - - #[SingleAttribute] - protected $propertySingle; - - #[FirstAttribute] - #[SecondAttribute] - protected $propertyDouble; - - #[ThirdAttribute] - protected $propertyWithoutSpacing; -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.php deleted file mode 100644 index 9b40668..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.php +++ /dev/null @@ -1,85 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class MemberVarSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 4 => 1, - 7 => 1, - 20 => 1, - 30 => 1, - 35 => 1, - 44 => 1, - 50 => 1, - 73 => 1, - 86 => 1, - 106 => 1, - 115 => 1, - 150 => 1, - 160 => 1, - 165 => 1, - 177 => 1, - 186 => 1, - 200 => 1, - 209 => 1, - 211 => 1, - 224 => 1, - 229 => 1, - 241 => 1, - 246 => 1, - 252 => 1, - 254 => 1, - 261 => 1, - 275 => 1, - 276 => 1, - 288 => 1, - 292 => 1, - 333 => 1, - 342 => 1, - 346 => 1, - 353 => 1, - 357 => 1, - 366 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.inc deleted file mode 100644 index 67f8ee1..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.inc +++ /dev/null @@ -1,52 +0,0 @@ -testThis(); -$this-> testThis(); -$this -> testThis(); -$this-> /* comment here */testThis(); -$this/* comment here */ -> testThis(); -$this - ->testThis(); -$this-> - testThis(); - -// phpcs:set Squiz.WhiteSpace.ObjectOperatorSpacing ignoreNewlines true - -$this->testThis(); -$this-> testThis(); -$this -> testThis(); -$this->/* comment here */testThis(); -$this/* comment here */ -> testThis(); -$this - ->testThis(); -$this-> - testThis(); - -// phpcs:set Squiz.WhiteSpace.ObjectOperatorSpacing ignoreNewlines false - -thisObject::testThis(); -thisObject:: testThis(); -thisObject :: testThis(); -thisObject::/* comment here */testThis(); -thisObject/* comment here */ :: testThis(); -thisObject - ::testThis(); -thisObject:: - testThis(); - -// phpcs:set Squiz.WhiteSpace.ObjectOperatorSpacing ignoreNewlines true - -thisObject::testThis(); -thisObject:: testThis(); -thisObject :: testThis(); -thisObject::/* comment here */testThis(); -thisObject/* comment here */ :: testThis(); -thisObject - ::testThis(); -thisObject:: - testThis(); - -// phpcs:set Squiz.WhiteSpace.ObjectOperatorSpacing ignoreNewlines false - -$this?->testThis(); -$this?-> testThis(); -$this ?-> testThis(); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.inc.fixed deleted file mode 100644 index 730b8e4..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.inc.fixed +++ /dev/null @@ -1,48 +0,0 @@ -testThis(); -$this->testThis(); -$this->testThis(); -$this->/* comment here */testThis(); -$this/* comment here */->testThis(); -$this->testThis(); -$this->testThis(); - -// phpcs:set Squiz.WhiteSpace.ObjectOperatorSpacing ignoreNewlines true - -$this->testThis(); -$this->testThis(); -$this->testThis(); -$this->/* comment here */testThis(); -$this/* comment here */->testThis(); -$this - ->testThis(); -$this-> - testThis(); - -// phpcs:set Squiz.WhiteSpace.ObjectOperatorSpacing ignoreNewlines false - -thisObject::testThis(); -thisObject::testThis(); -thisObject::testThis(); -thisObject::/* comment here */testThis(); -thisObject/* comment here */::testThis(); -thisObject::testThis(); -thisObject::testThis(); - -// phpcs:set Squiz.WhiteSpace.ObjectOperatorSpacing ignoreNewlines true - -thisObject::testThis(); -thisObject::testThis(); -thisObject::testThis(); -thisObject::/* comment here */testThis(); -thisObject/* comment here */::testThis(); -thisObject - ::testThis(); -thisObject:: - testThis(); - -// phpcs:set Squiz.WhiteSpace.ObjectOperatorSpacing ignoreNewlines false - -$this?->testThis(); -$this?->testThis(); -$this?->testThis(); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.php deleted file mode 100644 index 82a4056..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.php +++ /dev/null @@ -1,68 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ObjectOperatorSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 3 => 1, - 4 => 2, - 5 => 1, - 6 => 2, - 8 => 1, - 9 => 1, - 15 => 1, - 16 => 2, - 18 => 2, - 27 => 1, - 28 => 2, - 30 => 2, - 32 => 1, - 33 => 1, - 39 => 1, - 40 => 2, - 42 => 2, - 51 => 1, - 52 => 2, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.inc deleted file mode 100644 index f89cf08..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.inc +++ /dev/null @@ -1,481 +0,0 @@ - $j && $k< $l && $m>= $n && $o<= $p && $q<> $r; - -$a ==$b && $c !=$d && $e ===$f && $g !==$h; -$i >$j && $k <$l && $m >=$n && $o <=$p && $q <>$r; - -function myFunction($variable=0, $var2='string') {} - -if (index > -1) { -} - -array_walk_recursive($array, function(&$item) use (&$something) { -}); - -$var = saveFile(&$model, &$foo); - -// This is all valid. -$boo = -$foo; -function foo($boo = -1) {} -$foo = array('boo' => -1); -$x = $test ? -1 : 1; -$y = $test ? 1 : -1; -$z = $test ?: false; - -$closureWithDefaultParameter = function (array $testArray=array()) {}; - -switch ($foo) { - case -1: - break; -} - -$y = 1 * -1; -$y = -1 * 1; -$y = -1 * $var; -$y = 10 / -2; -$y = -10 / 2; -$y = (-10 / 2); -$y = (-10 / $var); -$y = 10 + -2; -$y = -10 + 2; - -$a = $x?$y:$z; -$a = $x ? $y : $z; - -$y = 1 - + 2 - - 3; - -$y = 1 + - 2 - - 3; - -$y = 1 -+ 2 -- 3; - -// phpcs:set Squiz.WhiteSpace.OperatorSpacing ignoreNewlines true -$y = 1 - + 2 - - 3; - -$y = 1 + - 2 - - 3; - -$y = 1 -+ 2 -- 3; -// phpcs:set Squiz.WhiteSpace.OperatorSpacing ignoreNewlines false - -if (true || -1 == $b) { -} - -$var = array(-1); -$var = [-1]; -$var = [0, -1, -2]; - -$y = array(&$x); -$y = [&$x]; -$y = array(&$a, &$b, &$c); -$y = [&$a, &$b, &$c]; -$y = array(&$a => 1, 2 => &$b, &$c); -$y = [&$a => 1, 2 => &$b, &$c]; - -if ($a <=> $b) { -} - -if ($a <=>$b) { -} - -$a |= $b; -$a **= $b; -$a ??= $b; - -$a = +1; - -function bar($boo = +1) {} - -$username = $_GET['user']??'nobody'; - -function foo(string $bar, array $baz, ?MyClass $object) : MyClass {} - -declare(strict_types=1); - -function foo($c = ((BAR)?10:100)) {} - -$res = $a ?: $b; -$res = $a ?: $b; -$res = $a ?: $b; -$res = $a ?: $b; - -$res = $a ? : $b; -$res = $a ? : $b; -$res = $a ? : $b; -$res = $a ? : $b; - -function foo(string $a = '', ?string $b = ''): ?string {} - -// Issue #1605. -$text = preg_replace_callback( - self::CHAR_REFS_REGEX, - [ 'Sanitizer', 'decodeCharReferencesCallback' ], - $text, /* limit */ -1, $count ); - -if (true || /* test */ -1 == $b) {} -$y = 10 + /* test */ -2; - -// Issue #1604. -Hooks::run( 'ParserOptionsRegister', [ - &self::$defaults, - &self::$inCacheKey, - &self::$lazyOptions, -] ); - -$x = $foo ? function (): int { - return 1; -} : $bar; - -$x = $foo ? function ($foo) - // comment - : int { - return 1; -} : $bar; - -$x = $foo ? function ($foo) use /* comment */ ($bar): int { - return 1; -} : $bar; - -$x = !$foo ? $bar : function (): int { - return 1; -}; - -$a = - // Comment. - [ - 'a', - 'b', - ]; - -$a = -// phpcs:ignore Standard.Category.Sniff -- for reasons. -[ - 'a', - 'b', -]; - -$foo = is_array($bar) ? array_map( - function () {}, - $bar - ) : $bar; - -function bar(): array {} - -if ($line{-1} === ':') { - $line = substr($line, 0, -1); -} - -$a = $a instanceof $b; -$a = $a instanceof $b; -$a = ($a)instanceof$b; - -fn&($x) => $x; - -// phpcs:set Squiz.WhiteSpace.OperatorSpacing ignoreSpacingBeforeAssignments false -$a = 3; - -yield -1; -echo -1; -$a = -1; -func(-1); -$a = [-1]; -return -1; -print -1; -$a &= -1; -switch ($a) { - case -1: -} -$a = $a ?? -1; -$a .= -1; -$a /= -1; -$a = [1 => -1]; -$a = $a == -1; -$a = $a >= -1; -$a = $a === -1; -$a = $a != -1; -$a = $a !== -1; -$a = $a <= -1; -$a = $a <=> -1; -$a = $a and -1; -$a = $a or -1; -$a = $a xor -1; -$a -= -1; -$a %= -1; -$a *= -1; -$a |= -1; -$a += -1; -$a = $a ** -1; -$a **= -1; -$a = $a << -1; -$a <<= -1; -$a = $a >> -1; -$a >>= -1; -$a = (string) -1; -$a = (array) -1; -$a = (bool) -1; -$a = (object) -1; -$a = (unset) -1; -$a = (float) -1; -$a = (int) -1; -$a ^= -1; -$a = [$a, -1]; -$a = $a[-1]; -$a = $a ? -1 : -1; - -yield - 1; -echo - 1; -$a = - 1; -func(- 1); -$a = [- 1]; -return - 1; -print - 1; -$a &= - 1; -switch ($a) { - case - 1: -} -$a = $a ?? - 1; -$a .= - 1; -$a /= - 1; -$a = [1 => - 1]; -$a = $a == - 1; -$a = $a >= - 1; -$a = $a === - 1; -$a = $a != - 1; -$a = $a !== - 1; -$a = $a <= - 1; -$a = $a <=> - 1; -$a = $a and - 1; -$a = $a or - 1; -$a = $a xor - 1; -$a -= - 1; -$a %= - 1; -$a *= - 1; -$a |= - 1; -$a += - 1; -$a = $a ** - 1; -$a **= - 1; -$a = $a << - 1; -$a <<= - 1; -$a = $a >> - 1; -$a >>= - 1; -$a = (string) - 1; -$a = (array) - 1; -$a = (bool) - 1; -$a = (object) - 1; -$a = (unset) - 1; -$a = (float) - 1; -$a = (int) - 1; -$a ^= - 1; -$a = [$a, - 1]; -$a = $a[- 1]; -$a = $a ? - 1 : - 1; - - -yield -$b; -echo -$b; -$a = -$b; -func(-$b); -$a = [-$b]; -return -$b; -print -$b; -$a &= -$b; -switch ($a) { - case -$b: -} -$a = $a ?? -$b; -$a .= -$b; -$a /= -$b; -$a = [1 => -$b]; -$a = $a == -$b; -$a = $a >= -$b; -$a = $a === -$b; -$a = $a != -$b; -$a = $a !== -$b; -$a = $a <= -$b; -$a = $a <=> -$b; -$a = $a and -$b; -$a = $a or -$b; -$a = $a xor -$b; -$a -= -$b; -$a %= -$b; -$a *= -$b; -$a |= -$b; -$a += -$b; -$a = $a ** -$b; -$a **= -$b; -$a = $a << -$b; -$a <<= -$b; -$a = $a >> -$b; -$a >>= -$b; -$a = (string) -$b; -$a = (array) -$b; -$a = (bool) -$b; -$a = (object) -$b; -$a = (unset) -$b; -$a = (float) -$b; -$a = (int) -$b; -$a ^= -$b; -$a = [$a, -$b]; -$a = $a[-$b]; -$a = $a ? -$b : -$b; - -yield - $b; -echo - $b; -$a = - $b; -func(- $b); -$a = [- $b]; -return - $b; -print - $b; -$a &= - $b; -switch ($a) { - case - $b: -} -$a = $a ?? - $b; -$a .= - $b; -$a /= - $b; -$a = [1 => - $b]; -$a = $a == - $b; -$a = $a >= - $b; -$a = $a === - $b; -$a = $a != - $b; -$a = $a !== - $b; -$a = $a <= - $b; -$a = $a <=> - $b; -$a = $a and - $b; -$a = $a or - $b; -$a = $a xor - $b; -$a -= - $b; -$a %= - $b; -$a *= - $b; -$a |= - $b; -$a += - $b; -$a = $a ** - $b; -$a **= - $b; -$a = $a << - $b; -$a <<= - $b; -$a = $a >> - $b; -$a >>= - $b; -$a = (string) - $b; -$a = (array) - $b; -$a = (bool) - $b; -$a = (object) - $b; -$a = (unset) - $b; -$a = (float) - $b; -$a = (int) - $b; -$a ^= - $b; -$a = [$a, - $b]; -$a = $a[- $b]; -$a = $a ? - $b : - $b; - -exit -1; - -$cl = function ($boo =-1) {}; -$cl = function ($boo =+1) {}; -$fn = fn ($boo =-1) => $boo; -$fn = fn ($boo =+1) => $boo; - -$fn = static fn(DateTime $a, DateTime $b): int => -($a->getTimestamp() <=> $b->getTimestamp()); - -$a = 'a '.-MY_CONSTANT; -$a = 'a '.-$b; -$a = 'a '.- MY_CONSTANT; -$a = 'a '.- $b; - -/* Intentional parse error. This has to be the last test in the file. */ -$a = 10 + diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.inc.fixed deleted file mode 100644 index 138616e..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.inc.fixed +++ /dev/null @@ -1,475 +0,0 @@ - $j && $k < $l && $m >= $n && $o <= $p && $q <> $r; - -$a == $b && $c != $d && $e === $f && $g !== $h; -$i > $j && $k < $l && $m >= $n && $o <= $p && $q <> $r; - -function myFunction($variable=0, $var2='string') {} - -if (index > -1) { -} - -array_walk_recursive($array, function(&$item) use (&$something) { -}); - -$var = saveFile(&$model, &$foo); - -// This is all valid. -$boo = -$foo; -function foo($boo = -1) {} -$foo = array('boo' => -1); -$x = $test ? -1 : 1; -$y = $test ? 1 : -1; -$z = $test ?: false; - -$closureWithDefaultParameter = function (array $testArray=array()) {}; - -switch ($foo) { - case -1: - break; -} - -$y = 1 * -1; -$y = -1 * 1; -$y = -1 * $var; -$y = 10 / -2; -$y = -10 / 2; -$y = (-10 / 2); -$y = (-10 / $var); -$y = 10 + -2; -$y = -10 + 2; - -$a = $x ? $y : $z; -$a = $x ? $y : $z; - -$y = 1 + 2 - 3; - -$y = 1 + 2 - 3; - -$y = 1 + 2 - 3; - -// phpcs:set Squiz.WhiteSpace.OperatorSpacing ignoreNewlines true -$y = 1 - + 2 - - 3; - -$y = 1 + - 2 - - 3; - -$y = 1 -+ 2 -- 3; -// phpcs:set Squiz.WhiteSpace.OperatorSpacing ignoreNewlines false - -if (true || -1 == $b) { -} - -$var = array(-1); -$var = [-1]; -$var = [0, -1, -2]; - -$y = array(&$x); -$y = [&$x]; -$y = array(&$a, &$b, &$c); -$y = [&$a, &$b, &$c]; -$y = array(&$a => 1, 2 => &$b, &$c); -$y = [&$a => 1, 2 => &$b, &$c]; - -if ($a <=> $b) { -} - -if ($a <=> $b) { -} - -$a |= $b; -$a **= $b; -$a ??= $b; - -$a = +1; - -function bar($boo = +1) {} - -$username = $_GET['user'] ?? 'nobody'; - -function foo(string $bar, array $baz, ?MyClass $object) : MyClass {} - -declare(strict_types=1); - -function foo($c = ((BAR) ? 10 : 100)) {} - -$res = $a ?: $b; -$res = $a ?: $b; -$res = $a ?: $b; -$res = $a ?: $b; - -$res = $a ? : $b; -$res = $a ? : $b; -$res = $a ? : $b; -$res = $a ? : $b; - -function foo(string $a = '', ?string $b = ''): ?string {} - -// Issue #1605. -$text = preg_replace_callback( - self::CHAR_REFS_REGEX, - [ 'Sanitizer', 'decodeCharReferencesCallback' ], - $text, /* limit */ -1, $count ); - -if (true || /* test */ -1 == $b) {} -$y = 10 + /* test */ -2; - -// Issue #1604. -Hooks::run( 'ParserOptionsRegister', [ - &self::$defaults, - &self::$inCacheKey, - &self::$lazyOptions, -] ); - -$x = $foo ? function (): int { - return 1; -} : $bar; - -$x = $foo ? function ($foo) - // comment - : int { - return 1; -} : $bar; - -$x = $foo ? function ($foo) use /* comment */ ($bar): int { - return 1; -} : $bar; - -$x = !$foo ? $bar : function (): int { - return 1; -}; - -$a = - // Comment. - [ - 'a', - 'b', - ]; - -$a = -// phpcs:ignore Standard.Category.Sniff -- for reasons. -[ - 'a', - 'b', -]; - -$foo = is_array($bar) ? array_map( - function () {}, - $bar - ) : $bar; - -function bar(): array {} - -if ($line{-1} === ':') { - $line = substr($line, 0, -1); -} - -$a = $a instanceof $b; -$a = $a instanceof $b; -$a = ($a) instanceof $b; - -fn&($x) => $x; - -// phpcs:set Squiz.WhiteSpace.OperatorSpacing ignoreSpacingBeforeAssignments false -$a = 3; - -yield -1; -echo -1; -$a = -1; -func(-1); -$a = [-1]; -return -1; -print -1; -$a &= -1; -switch ($a) { - case -1: -} -$a = $a ?? -1; -$a .= -1; -$a /= -1; -$a = [1 => -1]; -$a = $a == -1; -$a = $a >= -1; -$a = $a === -1; -$a = $a != -1; -$a = $a !== -1; -$a = $a <= -1; -$a = $a <=> -1; -$a = $a and -1; -$a = $a or -1; -$a = $a xor -1; -$a -= -1; -$a %= -1; -$a *= -1; -$a |= -1; -$a += -1; -$a = $a ** -1; -$a **= -1; -$a = $a << -1; -$a <<= -1; -$a = $a >> -1; -$a >>= -1; -$a = (string) -1; -$a = (array) -1; -$a = (bool) -1; -$a = (object) -1; -$a = (unset) -1; -$a = (float) -1; -$a = (int) -1; -$a ^= -1; -$a = [$a, -1]; -$a = $a[-1]; -$a = $a ? -1 : -1; - -yield - 1; -echo - 1; -$a = - 1; -func(- 1); -$a = [- 1]; -return - 1; -print - 1; -$a &= - 1; -switch ($a) { - case - 1: -} -$a = $a ?? - 1; -$a .= - 1; -$a /= - 1; -$a = [1 => - 1]; -$a = $a == - 1; -$a = $a >= - 1; -$a = $a === - 1; -$a = $a != - 1; -$a = $a !== - 1; -$a = $a <= - 1; -$a = $a <=> - 1; -$a = $a and - 1; -$a = $a or - 1; -$a = $a xor - 1; -$a -= - 1; -$a %= - 1; -$a *= - 1; -$a |= - 1; -$a += - 1; -$a = $a ** - 1; -$a **= - 1; -$a = $a << - 1; -$a <<= - 1; -$a = $a >> - 1; -$a >>= - 1; -$a = (string) - 1; -$a = (array) - 1; -$a = (bool) - 1; -$a = (object) - 1; -$a = (unset) - 1; -$a = (float) - 1; -$a = (int) - 1; -$a ^= - 1; -$a = [$a, - 1]; -$a = $a[- 1]; -$a = $a ? - 1 : - 1; - - -yield -$b; -echo -$b; -$a = -$b; -func(-$b); -$a = [-$b]; -return -$b; -print -$b; -$a &= -$b; -switch ($a) { - case -$b: -} -$a = $a ?? -$b; -$a .= -$b; -$a /= -$b; -$a = [1 => -$b]; -$a = $a == -$b; -$a = $a >= -$b; -$a = $a === -$b; -$a = $a != -$b; -$a = $a !== -$b; -$a = $a <= -$b; -$a = $a <=> -$b; -$a = $a and -$b; -$a = $a or -$b; -$a = $a xor -$b; -$a -= -$b; -$a %= -$b; -$a *= -$b; -$a |= -$b; -$a += -$b; -$a = $a ** -$b; -$a **= -$b; -$a = $a << -$b; -$a <<= -$b; -$a = $a >> -$b; -$a >>= -$b; -$a = (string) -$b; -$a = (array) -$b; -$a = (bool) -$b; -$a = (object) -$b; -$a = (unset) -$b; -$a = (float) -$b; -$a = (int) -$b; -$a ^= -$b; -$a = [$a, -$b]; -$a = $a[-$b]; -$a = $a ? -$b : -$b; - -yield - $b; -echo - $b; -$a = - $b; -func(- $b); -$a = [- $b]; -return - $b; -print - $b; -$a &= - $b; -switch ($a) { - case - $b: -} -$a = $a ?? - $b; -$a .= - $b; -$a /= - $b; -$a = [1 => - $b]; -$a = $a == - $b; -$a = $a >= - $b; -$a = $a === - $b; -$a = $a != - $b; -$a = $a !== - $b; -$a = $a <= - $b; -$a = $a <=> - $b; -$a = $a and - $b; -$a = $a or - $b; -$a = $a xor - $b; -$a -= - $b; -$a %= - $b; -$a *= - $b; -$a |= - $b; -$a += - $b; -$a = $a ** - $b; -$a **= - $b; -$a = $a << - $b; -$a <<= - $b; -$a = $a >> - $b; -$a >>= - $b; -$a = (string) - $b; -$a = (array) - $b; -$a = (bool) - $b; -$a = (object) - $b; -$a = (unset) - $b; -$a = (float) - $b; -$a = (int) - $b; -$a ^= - $b; -$a = [$a, - $b]; -$a = $a[- $b]; -$a = $a ? - $b : - $b; - -exit -1; - -$cl = function ($boo =-1) {}; -$cl = function ($boo =+1) {}; -$fn = fn ($boo =-1) => $boo; -$fn = fn ($boo =+1) => $boo; - -$fn = static fn(DateTime $a, DateTime $b): int => -($a->getTimestamp() <=> $b->getTimestamp()); - -$a = 'a '.-MY_CONSTANT; -$a = 'a '.-$b; -$a = 'a '.- MY_CONSTANT; -$a = 'a '.- $b; - -/* Intentional parse error. This has to be the last test in the file. */ -$a = 10 + diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.js b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.js deleted file mode 100644 index 16eb130..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.js +++ /dev/null @@ -1,103 +0,0 @@ - - -result = 1 + 2; -result = 1 + 2; -result = 1 + 2; -result = 1 +2; -result = 1+ 2; -result = 1+2; - -result = 1 - 2; -result = 1 - 2; -result = 1 - 2; -result = 1 -2; -result = 1- 2; -result = 1-2; - -result = 1 * 2; -result = 1 * 2; -result = 1 * 2; -result = 1 *2; -result = 1* 2; -result = 1*2; - -result = 1 / 2; -result = 1 / 2; -result = 1 / 2; -result = 1 /2; -result = 1/ 2; -result = 1/2; - -result = 1 % 2; -result = 1 % 2; -result = 1 % 2; -result = 1 %2; -result = 1% 2; -result = 1%2; -result = '100%'; - -result += 4; -result+=4; -result -= 4; -result-=4; -result /= 4; -result/=4; -result *=4; -result*=4; - -$.localScroll({offset: {top: -32}}); - -switch (result) { - case -1: - break; -} - -result = x?y:z; -result = x ? y : z; - -if (something === true - ^ somethingElse === true -) { - return false; -} - -y = 1 - + 2 - - 3; - -y = 1 + - 2 - - 3; - -y = 1 -+ 2 -- 3; - -// phpcs:set Squiz.WhiteSpace.OperatorSpacing ignoreNewlines true -y = 1 - + 2 - - 3; - -y = 1 + - 2 - - 3; - -y = 1 -+ 2 -- 3; -// phpcs:set Squiz.WhiteSpace.OperatorSpacing ignoreNewlines false - -if (true || -1 == b) { -} - -x = x << y; -x <<= y; -x = x >> y; -x >>= y; -x = x >>> y; -x >>>= y; - -var foo = bar.map(baz=> baz.length); - -// phpcs:set Squiz.WhiteSpace.OperatorSpacing ignoreSpacingBeforeAssignments false -a = 3; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.js.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.js.fixed deleted file mode 100644 index 877db46..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.js.fixed +++ /dev/null @@ -1,97 +0,0 @@ - - -result = 1 + 2; -result = 1 + 2; -result = 1 + 2; -result = 1 + 2; -result = 1 + 2; -result = 1 + 2; - -result = 1 - 2; -result = 1 - 2; -result = 1 - 2; -result = 1 - 2; -result = 1 - 2; -result = 1 - 2; - -result = 1 * 2; -result = 1 * 2; -result = 1 * 2; -result = 1 * 2; -result = 1 * 2; -result = 1 * 2; - -result = 1 / 2; -result = 1 / 2; -result = 1 / 2; -result = 1 / 2; -result = 1 / 2; -result = 1 / 2; - -result = 1 % 2; -result = 1 % 2; -result = 1 % 2; -result = 1 % 2; -result = 1 % 2; -result = 1 % 2; -result = '100%'; - -result += 4; -result += 4; -result -= 4; -result -= 4; -result /= 4; -result /= 4; -result *= 4; -result *= 4; - -$.localScroll({offset: {top: -32}}); - -switch (result) { - case -1: - break; -} - -result = x ? y : z; -result = x ? y : z; - -if (something === true - ^ somethingElse === true -) { - return false; -} - -y = 1 + 2 - 3; - -y = 1 + 2 - 3; - -y = 1 + 2 - 3; - -// phpcs:set Squiz.WhiteSpace.OperatorSpacing ignoreNewlines true -y = 1 - + 2 - - 3; - -y = 1 + - 2 - - 3; - -y = 1 -+ 2 -- 3; -// phpcs:set Squiz.WhiteSpace.OperatorSpacing ignoreNewlines false - -if (true || -1 == b) { -} - -x = x << y; -x <<= y; -x = x >> y; -x >>= y; -x = x >>> y; -x >>>= y; - -var foo = bar.map(baz => baz.length); - -// phpcs:set Squiz.WhiteSpace.OperatorSpacing ignoreSpacingBeforeAssignments false -a = 3; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.php deleted file mode 100644 index 8e8ad98..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.php +++ /dev/null @@ -1,170 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class OperatorSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='OperatorSpacingUnitTest.inc') - { - switch ($testFile) { - case 'OperatorSpacingUnitTest.inc': - return [ - 4 => 1, - 5 => 2, - 6 => 1, - 7 => 1, - 8 => 2, - 11 => 1, - 12 => 2, - 13 => 1, - 14 => 1, - 15 => 2, - 18 => 1, - 19 => 2, - 20 => 1, - 21 => 1, - 22 => 2, - 25 => 1, - 26 => 2, - 27 => 1, - 28 => 1, - 29 => 2, - 32 => 1, - 33 => 2, - 34 => 1, - 35 => 1, - 36 => 2, - 40 => 2, - 42 => 2, - 44 => 2, - 45 => 1, - 46 => 2, - 53 => 4, - 54 => 3, - 59 => 10, - 64 => 1, - 77 => 4, - 78 => 1, - 79 => 1, - 80 => 2, - 81 => 1, - 84 => 6, - 85 => 6, - 87 => 4, - 88 => 5, - 90 => 4, - 91 => 5, - 128 => 4, - 132 => 1, - 133 => 1, - 135 => 1, - 136 => 1, - 140 => 1, - 141 => 1, - 174 => 1, - 177 => 1, - 178 => 1, - 179 => 1, - 185 => 2, - 191 => 4, - 194 => 1, - 195 => 1, - 196 => 2, - 199 => 1, - 200 => 1, - 201 => 2, - 239 => 1, - 246 => 1, - 265 => 2, - 266 => 2, - 271 => 2, - ]; - break; - case 'OperatorSpacingUnitTest.js': - return [ - 4 => 1, - 5 => 2, - 6 => 1, - 7 => 1, - 8 => 2, - 11 => 1, - 12 => 2, - 13 => 1, - 14 => 1, - 15 => 2, - 18 => 1, - 19 => 2, - 20 => 1, - 21 => 1, - 22 => 2, - 25 => 1, - 26 => 2, - 27 => 1, - 28 => 1, - 29 => 2, - 32 => 1, - 33 => 2, - 34 => 1, - 35 => 1, - 36 => 2, - 40 => 2, - 42 => 2, - 44 => 2, - 45 => 1, - 46 => 2, - 55 => 4, - 65 => 1, - 66 => 1, - 68 => 1, - 69 => 1, - 73 => 1, - 74 => 1, - 100 => 1, - 103 => 2, - ]; - break; - default: - return []; - break; - }//end switch - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/PropertyLabelSpacingUnitTest.js b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/PropertyLabelSpacingUnitTest.js deleted file mode 100644 index 15890b9..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/PropertyLabelSpacingUnitTest.js +++ /dev/null @@ -1,40 +0,0 @@ -var x = { - b: 'x', - xasd: x, - abc:x, - a: function () { - alert('thats right'); - x = (x?a:x); - }, - casdasd : 123123, - omgwtfbbq: { - a: 1, - b: 2 - } -}; - -id = id.replace(/row\/:/gi, ''); - -outer_loop: -for (i=0; i<3; i++) { - for (j=0; j<5; j++) { - if (j==x) - break outer_loop; - } -} -alert('hi'); - -even_number: if ((i % 2) == 0) { - if (i == 12) - break even_number; -} - -switch (blah) { - case dfx.DOM_VK_LEFT: - this.caretLeft(shiftKey); - break; - default: - if (blah) { - } - break; -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/PropertyLabelSpacingUnitTest.js.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/PropertyLabelSpacingUnitTest.js.fixed deleted file mode 100644 index f332878..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/PropertyLabelSpacingUnitTest.js.fixed +++ /dev/null @@ -1,39 +0,0 @@ -var x = { - b: 'x', - xasd: x, - abc: x, - a: function () { - alert('thats right'); - x = (x?a:x); - }, - casdasd: 123123, - omgwtfbbq: { - a: 1, - b: 2 - } -}; - -id = id.replace(/row\/:/gi, ''); - -outer_loop: for (i=0; i<3; i++) { - for (j=0; j<5; j++) { - if (j==x) - break outer_loop; - } -} -alert('hi'); - -even_number: if ((i % 2) == 0) { - if (i == 12) - break even_number; -} - -switch (blah) { - case dfx.DOM_VK_LEFT: - this.caretLeft(shiftKey); - break; - default: - if (blah) { - } - break; -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/PropertyLabelSpacingUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/PropertyLabelSpacingUnitTest.php deleted file mode 100644 index e80f936..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/PropertyLabelSpacingUnitTest.php +++ /dev/null @@ -1,55 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class PropertyLabelSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 2 => 1, - 4 => 1, - 9 => 2, - 10 => 1, - 12 => 1, - 18 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeClosingBraceUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeClosingBraceUnitTest.inc deleted file mode 100644 index ecd80b5..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeClosingBraceUnitTest.inc +++ /dev/null @@ -1,122 +0,0 @@ -{$property} =& new $class_name($this->db_index); - $this->modules[$module] =& $this->{$property}; -} - -foreach ($elements as $element) { - if ($something) { - // Do IF. - } else if ($somethingElse) { - // Do ELSE. - } -} - -if ($token['code'] === T_COMMENT - && $multiLineComment === false - && (substr($token['content'], 0, 2) === '//' - || $token['content']{0} === '#') -) { -} - -switch ($blah) { - case 'one': - echo 'one'; - break; - default: - echo 'another'; -} - -?> - -getRow()): ?> -

    - - - -
    - -

    o hai!

    - -
    - - - - - - - - - - - - $x + $y; - -$match = match ($test) { 1 => 'a', 2 => 'b' }; - -$match = match ($test) { - 1 => 'a', - 2 => 'b' - }; - -?> - -
    - -
    diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeClosingBraceUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeClosingBraceUnitTest.inc.fixed deleted file mode 100644 index a30dfd0..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeClosingBraceUnitTest.inc.fixed +++ /dev/null @@ -1,125 +0,0 @@ -{$property} =& new $class_name($this->db_index); - $this->modules[$module] =& $this->{$property}; -} - -foreach ($elements as $element) { - if ($something) { - // Do IF. - } else if ($somethingElse) { - // Do ELSE. - } -} - -if ($token['code'] === T_COMMENT - && $multiLineComment === false - && (substr($token['content'], 0, 2) === '//' - || $token['content']{0} === '#') -) { -} - -switch ($blah) { - case 'one': - echo 'one'; - break; - default: - echo 'another'; -} - -?> - -getRow()): ?> -

    - - - -
    - -

    o hai!

    - -
    - - - - - - - - - - - - $x + $y; - -$match = match ($test) { 1 => 'a', 2 => 'b' -}; - -$match = match ($test) { - 1 => 'a', - 2 => 'b' -}; - -?> - -
    - -
    - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeClosingBraceUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeClosingBraceUnitTest.php deleted file mode 100644 index 0df8603..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeClosingBraceUnitTest.php +++ /dev/null @@ -1,57 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ScopeClosingBraceUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 11 => 1, - 13 => 1, - 24 => 1, - 80 => 1, - 102 => 1, - 111 => 1, - 116 => 1, - 122 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.inc deleted file mode 100644 index 2213817..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.inc +++ /dev/null @@ -1,128 +0,0 @@ - 'a', 'b' => 'b' ), - $varQ = 'string', - $varR = 123; - - // Intentionally missing a semi-colon for testing. - public - $varS, - $varT -} - -// Issue #3188 - static as return type. -public static function fCreate($attributes = []): static -{ - return static::factory()->create($attributes); -} - -public static function fCreate($attributes = []): ?static -{ - return static::factory()->create($attributes); -} - -// Also account for static used within union types. -public function fCreate($attributes = []): object|static -{ -} - -// Ensure that static as a scope keyword when preceeded by a colon which is not for a type declaration is still handled. -$callback = $cond ? get_fn_name() : static function ($a) { return $a * 10; }; - -class TypedProperties { - public - int $var; - - protected string $stringA, $stringB; - - private bool - $boolA, - $boolB; -} - -// PHP 8.0 constructor property promotion. -class ConstructorPropertyPromotionTest { - public function __construct( - public $x = 0.0, - protected $y = '', - private $z = null, - $normalParam, - ) {} -} - -class ConstructorPropertyPromotionWithTypesTest { - public function __construct(protected float|int $x, public?string &$y = 'test', private mixed $z) {} -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.inc.fixed deleted file mode 100644 index e642f0c..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.inc.fixed +++ /dev/null @@ -1,122 +0,0 @@ - 'a', 'b' => 'b' ), - $varQ = 'string', - $varR = 123; - - // Intentionally missing a semi-colon for testing. - public - $varS, - $varT -} - -// Issue #3188 - static as return type. -public static function fCreate($attributes = []): static -{ - return static::factory()->create($attributes); -} - -public static function fCreate($attributes = []): ?static -{ - return static::factory()->create($attributes); -} - -// Also account for static used within union types. -public function fCreate($attributes = []): object|static -{ -} - -// Ensure that static as a scope keyword when preceeded by a colon which is not for a type declaration is still handled. -$callback = $cond ? get_fn_name() : static function ($a) { return $a * 10; }; - -class TypedProperties { - public int $var; - - protected string $stringA, $stringB; - - private bool - $boolA, - $boolB; -} - -// PHP 8.0 constructor property promotion. -class ConstructorPropertyPromotionTest { - public function __construct( - public $x = 0.0, - protected $y = '', - private $z = null, - $normalParam, - ) {} -} - -class ConstructorPropertyPromotionWithTypesTest { - public function __construct(protected float|int $x, public ?string &$y = 'test', private mixed $z) {} -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.php deleted file mode 100644 index de4697c..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.php +++ /dev/null @@ -1,67 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ScopeKeywordSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 7 => 2, - 8 => 1, - 13 => 1, - 14 => 1, - 15 => 1, - 17 => 2, - 26 => 1, - 28 => 1, - 29 => 1, - 64 => 1, - 67 => 1, - 71 => 1, - 103 => 1, - 106 => 1, - 111 => 1, - 119 => 1, - 121 => 1, - 127 => 2, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.inc deleted file mode 100644 index 393f484..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.inc +++ /dev/null @@ -1,42 +0,0 @@ -testThis(); -$test = $this->testThis() ; -$test = $this->testThis() ; -for ($var = 1 ; $var < 10 ; $var++) { - echo $var ; -} -$test = $this->testThis() /* comment here */; -$test = $this->testThis() /* comment here */ ; - -$hello ='foo'; -; - -$sum = $a /* + $b */; -$sum = $a // + $b -; -$sum = $a /* + $b - + $c */ ; - -/* - * Test that the sniff does *not* throw incorrect errors for semi-colons in - * "empty" parts of a `for` control structure. - */ -for ($i = 1; ; $i++) {} -for ( ; $ptr >= 0; $ptr-- ) {} -for ( ; ; ) {} - -// But it should when the semi-colon in a `for` follows a comment (but shouldn't move the semi-colon). -for ( /* Deliberately left empty. */ ; $ptr >= 0; $ptr-- ) {} -for ( $i = 1 ; /* Deliberately left empty. */ ; $i++ ) {} - -switch ($foo) { - case 'foo': - ; - break - ; -} - -// This is an empty statement and should be ignored. -if ($foo) { -; -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.inc.fixed deleted file mode 100644 index 0d06324..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.inc.fixed +++ /dev/null @@ -1,41 +0,0 @@ -testThis(); -$test = $this->testThis(); -$test = $this->testThis(); -for ($var = 1; $var < 10; $var++) { - echo $var; -} -$test = $this->testThis(); /* comment here */ -$test = $this->testThis(); /* comment here */ - -$hello ='foo'; -; - -$sum = $a; /* + $b */ -$sum = $a; // + $b - -$sum = $a; /* + $b - + $c */ - -/* - * Test that the sniff does *not* throw incorrect errors for semi-colons in - * "empty" parts of a `for` control structure. - */ -for ($i = 1; ; $i++) {} -for ( ; $ptr >= 0; $ptr-- ) {} -for ( ; ; ) {} - -// But it should when the semi-colon in a `for` follows a comment (but shouldn't move the semi-colon). -for ( /* Deliberately left empty. */; $ptr >= 0; $ptr-- ) {} -for ( $i = 1; /* Deliberately left empty. */; $i++ ) {} - -switch ($foo) { - case 'foo': - ; - break; -} - -// This is an empty statement and should be ignored. -if ($foo) { -; -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.js b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.js deleted file mode 100644 index 3aafd6d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.js +++ /dev/null @@ -1,25 +0,0 @@ -var x = { - a: function () { - alert('thats right') ; - x = (x?a:x) ; - }, -} ; - -id = id.replace(/row\/:;/gi, ''); - -for (i=0 ; i<3 ; i++) { - for (j=0; j<5 ; j++) { - if (j==x) - break ; - } -} -alert('hi'); -; - -var sum = a /* + b */; - -var sum = a // +b -; - -var sum = a /* +b - + c */ ; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.js.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.js.fixed deleted file mode 100644 index a547144..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.js.fixed +++ /dev/null @@ -1,25 +0,0 @@ -var x = { - a: function () { - alert('thats right'); - x = (x?a:x); - }, -}; - -id = id.replace(/row\/:;/gi, ''); - -for (i=0; i<3; i++) { - for (j=0; j<5; j++) { - if (j==x) - break; - } -} -alert('hi'); -; - -var sum = a; /* + b */ - -var sum = a; // +b - - -var sum = a; /* +b - + c */ diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.php deleted file mode 100644 index 72196f8..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.php +++ /dev/null @@ -1,83 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class SemicolonSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='SemicolonSpacingUnitTest.inc') - { - switch ($testFile) { - case 'SemicolonSpacingUnitTest.inc': - return [ - 3 => 1, - 4 => 1, - 5 => 2, - 6 => 1, - 8 => 1, - 9 => 1, - 14 => 1, - 16 => 1, - 18 => 1, - 29 => 1, - 30 => 2, - 36 => 1, - ]; - break; - case 'SemicolonSpacingUnitTest.js': - return [ - 3 => 1, - 4 => 1, - 6 => 1, - 10 => 2, - 11 => 1, - 13 => 1, - 19 => 1, - 22 => 1, - 25 => 1, - ]; - break; - default: - return []; - break; - }//end switch - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.css b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.css deleted file mode 100644 index 1dd1b6e..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.css +++ /dev/null @@ -1,25 +0,0 @@ - -.HelpWidgetType-new-bug-title { - float: left; -} -.HelpWidgetType-new-bug-title { - float: left; -} -.HelpWidgetType-new-bug-title { - float: left; -} - -.HelpWidgetType-new-bug-title{ - float: left; -} - -/* phpcs:set Squiz.WhiteSpace.SuperfluousWhitespace ignoreBlankLines true */ -.HelpWidgetType-new-bug-title{ - float: left; -} - -.HelpWidgetType-new-bug-title{ - float: left; -} -/* phpcs:set Squiz.WhiteSpace.SuperfluousWhitespace ignoreBlankLines false */ - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.css.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.css.fixed deleted file mode 100644 index 59ddddb..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.css.fixed +++ /dev/null @@ -1,23 +0,0 @@ -.HelpWidgetType-new-bug-title { - float: left; -} -.HelpWidgetType-new-bug-title { - float: left; -} -.HelpWidgetType-new-bug-title { - float: left; -} - -.HelpWidgetType-new-bug-title{ - float: left; -} - -/* phpcs:set Squiz.WhiteSpace.SuperfluousWhitespace ignoreBlankLines true */ -.HelpWidgetType-new-bug-title{ - float: left; -} - -.HelpWidgetType-new-bug-title{ - float: left; -} -/* phpcs:set Squiz.WhiteSpace.SuperfluousWhitespace ignoreBlankLines false */ diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.inc deleted file mode 100644 index f9dca29..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.inc +++ /dev/null @@ -1,74 +0,0 @@ - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.inc.fixed deleted file mode 100644 index 1d764eb..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.inc.fixed +++ /dev/null @@ -1,68 +0,0 @@ - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.js b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.js deleted file mode 100644 index be542e7..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.js +++ /dev/null @@ -1,56 +0,0 @@ - -alert('hi'); -alert('hello'); - -if (something) { - -} - - -function myFunction() -{ - alert('code here'); - - alert('code here'); - - - // Hello. - - /* - HI - */ - - -} - -function myFunction2() -{ - alert('code here'); - - - alert('code here'); - -} - -MyFunction = function() -{ - alert('code here'); - - - alert('code here'); - -}; - -// phpcs:set Squiz.WhiteSpace.SuperfluousWhitespace ignoreBlankLines true - -function myFunction2() -{ - alert('code here'); - - alert('code here'); - -} - -// phpcs:set Squiz.WhiteSpace.SuperfluousWhitespace ignoreBlankLines false - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.js.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.js.fixed deleted file mode 100644 index 960111a..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.js.fixed +++ /dev/null @@ -1,50 +0,0 @@ -alert('hi'); -alert('hello'); - -if (something) { - -} - - -function myFunction() -{ - alert('code here'); - - alert('code here'); - - // Hello. - - /* - HI - */ - -} - -function myFunction2() -{ - alert('code here'); - - alert('code here'); - -} - -MyFunction = function() -{ - alert('code here'); - - alert('code here'); - -}; - -// phpcs:set Squiz.WhiteSpace.SuperfluousWhitespace ignoreBlankLines true - -function myFunction2() -{ - alert('code here'); - - alert('code here'); - -} - -// phpcs:set Squiz.WhiteSpace.SuperfluousWhitespace ignoreBlankLines false - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.css b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.css deleted file mode 100644 index 2025eeb..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.css +++ /dev/null @@ -1,3 +0,0 @@ -.HelpWidgetType-new-bug-title { - float: left; -} \ No newline at end of file diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.css.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.css.fixed deleted file mode 100644 index 2025eeb..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.css.fixed +++ /dev/null @@ -1,3 +0,0 @@ -.HelpWidgetType-new-bug-title { - float: left; -} \ No newline at end of file diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.inc deleted file mode 100644 index a6e2b8a..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.inc +++ /dev/null @@ -1,9 +0,0 @@ - - -

    - -

    - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.inc.fixed deleted file mode 100644 index 78c4525..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.inc.fixed +++ /dev/null @@ -1,7 +0,0 @@ - -

    - -

    diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.js b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.js deleted file mode 100644 index 7b0c8ea..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.js +++ /dev/null @@ -1 +0,0 @@ -alert('hi'); \ No newline at end of file diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.js.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.js.fixed deleted file mode 100644 index 7b0c8ea..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.js.fixed +++ /dev/null @@ -1 +0,0 @@ -alert('hi'); \ No newline at end of file diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.css b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.css deleted file mode 100644 index 9f794a0..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.css +++ /dev/null @@ -1,3 +0,0 @@ -.HelpWidgetType-new-bug-title { - float: left; -} diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.css.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.css.fixed deleted file mode 100644 index 2025eeb..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.css.fixed +++ /dev/null @@ -1,3 +0,0 @@ -.HelpWidgetType-new-bug-title { - float: left; -} \ No newline at end of file diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.inc deleted file mode 100644 index 661ebda..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.inc +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.inc.fixed deleted file mode 100644 index 0cb9748..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.inc.fixed +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.js b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.js deleted file mode 100644 index 70f6719..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.js +++ /dev/null @@ -1 +0,0 @@ -alert('hi'); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.js.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.js.fixed deleted file mode 100644 index 70f6719..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.js.fixed +++ /dev/null @@ -1 +0,0 @@ -alert('hi'); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.4.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.4.inc deleted file mode 100644 index 96860ff..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.4.inc +++ /dev/null @@ -1,4 +0,0 @@ - \ No newline at end of file diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.4.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.4.inc.fixed deleted file mode 100644 index b26b5b2..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.4.inc.fixed +++ /dev/null @@ -1,4 +0,0 @@ - \ No newline at end of file diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.5.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.5.inc deleted file mode 100644 index 4d6f06b..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.5.inc +++ /dev/null @@ -1,5 +0,0 @@ -   -  \ No newline at end of file diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.5.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.5.inc.fixed deleted file mode 100644 index 8ec5f30..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.5.inc.fixed +++ /dev/null @@ -1,4 +0,0 @@ - \ No newline at end of file diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.php deleted file mode 100644 index b9ff96f..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.php +++ /dev/null @@ -1,113 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class SuperfluousWhitespaceUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='SuperfluousWhitespaceUnitTest.inc') - { - switch ($testFile) { - case 'SuperfluousWhitespaceUnitTest.1.inc': - return [ - 2 => 1, - 4 => 1, - 5 => 1, - 6 => 1, - 7 => 1, - 16 => 1, - 23 => 1, - 28 => 1, - 33 => 1, - 49 => 1, - 62 => 1, - 65 => 1, - 73 => 1, - ]; - break; - case 'SuperfluousWhitespaceUnitTest.2.inc': - return [ - 2 => 1, - 8 => 1, - ]; - break; - case 'SuperfluousWhitespaceUnitTest.3.inc': - return [ - 6 => 1, - 10 => 1, - ]; - break; - case 'SuperfluousWhitespaceUnitTest.4.inc': - case 'SuperfluousWhitespaceUnitTest.5.inc': - return [ - 1 => 1, - 4 => 1, - ]; - break; - case 'SuperfluousWhitespaceUnitTest.1.js': - return [ - 1 => 1, - 3 => 1, - 4 => 1, - 5 => 1, - 6 => 1, - 15 => 1, - 22 => 1, - 29 => 1, - 38 => 1, - 56 => 1, - ]; - break; - case 'SuperfluousWhitespaceUnitTest.1.css': - return [ - 1 => 1, - 8 => 1, - 9 => 1, - 11 => 1, - 25 => 1, - ]; - break; - default: - return []; - break; - }//end switch - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/ruleset.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/ruleset.xml deleted file mode 100644 index 87ab4c3..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/ruleset.xml +++ /dev/null @@ -1,132 +0,0 @@ - - - The Squiz coding standard. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - - - - - - - - - - - %2$s - - - - - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - - - - - - - - 0 - - - error - - - - - 0 - - - error - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Docs/Debug/CodeAnalyzerStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Docs/Debug/CodeAnalyzerStandard.xml deleted file mode 100644 index c462b4f..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Docs/Debug/CodeAnalyzerStandard.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - $bar + $baz; -} - ]]> - - - $bar + 2; -} - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Docs/Files/ClosingTagStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Docs/Files/ClosingTagStandard.xml deleted file mode 100644 index aa60b8a..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Docs/Files/ClosingTagStandard.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - ?> - ]]> - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Docs/NamingConventions/ValidVariableNameStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Docs/NamingConventions/ValidVariableNameStandard.xml deleted file mode 100644 index 5bcde4b..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Docs/NamingConventions/ValidVariableNameStandard.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - $testNumber = 1; - ]]> - - - $Test_Number = 1; - ]]> - - - - - _bar; -} - ]]> - - - - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/Debug/CodeAnalyzerSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/Debug/CodeAnalyzerSniff.php deleted file mode 100644 index 5df4b0f..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/Debug/CodeAnalyzerSniff.php +++ /dev/null @@ -1,98 +0,0 @@ - - * @author Greg Sherwood - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Zend\Sniffs\Debug; - -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Config; -use PHP_CodeSniffer\Exceptions\RuntimeException; -use PHP_CodeSniffer\Util\Common; - -class CodeAnalyzerSniff implements Sniff -{ - - - /** - * Returns the token types that this sniff is interested in. - * - * @return int[] - */ - public function register() - { - return [T_OPEN_TAG]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return int - * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If ZendCodeAnalyzer could not be run. - */ - public function process(File $phpcsFile, $stackPtr) - { - $analyzerPath = Config::getExecutablePath('zend_ca'); - if ($analyzerPath === null) { - return; - } - - $fileName = $phpcsFile->getFilename(); - - // In the command, 2>&1 is important because the code analyzer sends its - // findings to stderr. $output normally contains only stdout, so using 2>&1 - // will pipe even stderr to stdout. - $cmd = Common::escapeshellcmd($analyzerPath).' '.escapeshellarg($fileName).' 2>&1'; - - // There is the possibility to pass "--ide" as an option to the analyzer. - // This would result in an output format which would be easier to parse. - // The problem here is that no cleartext error messages are returned; only - // error-code-labels. So for a start we go for cleartext output. - $exitCode = exec($cmd, $output, $retval); - - // Variable $exitCode is the last line of $output if no error occurs, on - // error it is numeric. Try to handle various error conditions and - // provide useful error reporting. - if (is_numeric($exitCode) === true && $exitCode > 0) { - if (is_array($output) === true) { - $msg = join('\n', $output); - } - - throw new RuntimeException("Failed invoking ZendCodeAnalyzer, exitcode was [$exitCode], retval was [$retval], output was [$msg]"); - } - - if (is_array($output) === true) { - foreach ($output as $finding) { - // The first two lines of analyzer output contain - // something like this: - // > Zend Code Analyzer 1.2.2 - // > Analyzing ... - // So skip these... - $res = preg_match("/^.+\(line ([0-9]+)\):(.+)$/", $finding, $regs); - if (empty($regs) === true || $res === false) { - continue; - } - - $phpcsFile->addWarningOnLine(trim($regs[2]), $regs[1], 'ExternalTool'); - } - } - - // Ignore the rest of the file. - return ($phpcsFile->numTokens + 1); - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/Files/ClosingTagSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/Files/ClosingTagSniff.php deleted file mode 100644 index 0ed34d1..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/Files/ClosingTagSniff.php +++ /dev/null @@ -1,79 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Zend\Sniffs\Files; - -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Util\Tokens; - -class ClosingTagSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_OPEN_TAG]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - // Find the last non-empty token. - $tokens = $phpcsFile->getTokens(); - for ($last = ($phpcsFile->numTokens - 1); $last > 0; $last--) { - if (trim($tokens[$last]['content']) !== '') { - break; - } - } - - if ($tokens[$last]['code'] === T_CLOSE_TAG) { - $error = 'A closing tag is not permitted at the end of a PHP file'; - $fix = $phpcsFile->addFixableError($error, $last, 'NotAllowed'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($last, $phpcsFile->eolChar); - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($last - 1), null, true); - if ($tokens[$prev]['code'] !== T_SEMICOLON - && $tokens[$prev]['code'] !== T_CLOSE_CURLY_BRACKET - && $tokens[$prev]['code'] !== T_OPEN_TAG - ) { - $phpcsFile->fixer->addContent($prev, ';'); - } - - $phpcsFile->fixer->endChangeset(); - } - - $phpcsFile->recordMetric($stackPtr, 'PHP closing tag at EOF', 'yes'); - } else { - $phpcsFile->recordMetric($stackPtr, 'PHP closing tag at EOF', 'no'); - }//end if - - // Ignore the rest of the file. - return ($phpcsFile->numTokens + 1); - - }//end process() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/NamingConventions/ValidVariableNameSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/NamingConventions/ValidVariableNameSniff.php deleted file mode 100644 index 267cd0a..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/NamingConventions/ValidVariableNameSniff.php +++ /dev/null @@ -1,196 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Zend\Sniffs\NamingConventions; - -use PHP_CodeSniffer\Sniffs\AbstractVariableSniff; -use PHP_CodeSniffer\Util\Common; -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Util\Tokens; - -class ValidVariableNameSniff extends AbstractVariableSniff -{ - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - protected function processVariable(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $varName = ltrim($tokens[$stackPtr]['content'], '$'); - - // If it's a php reserved var, then its ok. - if (isset($this->phpReservedVars[$varName]) === true) { - return; - } - - $objOperator = $phpcsFile->findNext([T_WHITESPACE], ($stackPtr + 1), null, true); - if ($tokens[$objOperator]['code'] === T_OBJECT_OPERATOR - || $tokens[$objOperator]['code'] === T_NULLSAFE_OBJECT_OPERATOR - ) { - // Check to see if we are using a variable from an object. - $var = $phpcsFile->findNext([T_WHITESPACE], ($objOperator + 1), null, true); - if ($tokens[$var]['code'] === T_STRING) { - // Either a var name or a function call, so check for bracket. - $bracket = $phpcsFile->findNext([T_WHITESPACE], ($var + 1), null, true); - - if ($tokens[$bracket]['code'] !== T_OPEN_PARENTHESIS) { - $objVarName = $tokens[$var]['content']; - - // There is no way for us to know if the var is public or private, - // so we have to ignore a leading underscore if there is one and just - // check the main part of the variable name. - $originalVarName = $objVarName; - if (substr($objVarName, 0, 1) === '_') { - $objVarName = substr($objVarName, 1); - } - - if (Common::isCamelCaps($objVarName, false, true, false) === false) { - $error = 'Variable "%s" is not in valid camel caps format'; - $data = [$originalVarName]; - $phpcsFile->addError($error, $var, 'NotCamelCaps', $data); - } else if (preg_match('|\d|', $objVarName) === 1) { - $warning = 'Variable "%s" contains numbers but this is discouraged'; - $data = [$originalVarName]; - $phpcsFile->addWarning($warning, $stackPtr, 'ContainsNumbers', $data); - } - }//end if - }//end if - }//end if - - // There is no way for us to know if the var is public or private, - // so we have to ignore a leading underscore if there is one and just - // check the main part of the variable name. - $originalVarName = $varName; - if (substr($varName, 0, 1) === '_') { - $objOperator = $phpcsFile->findPrevious([T_WHITESPACE], ($stackPtr - 1), null, true); - if ($tokens[$objOperator]['code'] === T_DOUBLE_COLON) { - // The variable lives within a class, and is referenced like - // this: MyClass::$_variable, so we don't know its scope. - $inClass = true; - } else { - $inClass = $phpcsFile->hasCondition($stackPtr, Tokens::$ooScopeTokens); - } - - if ($inClass === true) { - $varName = substr($varName, 1); - } - } - - if (Common::isCamelCaps($varName, false, true, false) === false) { - $error = 'Variable "%s" is not in valid camel caps format'; - $data = [$originalVarName]; - $phpcsFile->addError($error, $stackPtr, 'NotCamelCaps', $data); - } else if (preg_match('|\d|', $varName) === 1) { - $warning = 'Variable "%s" contains numbers but this is discouraged'; - $data = [$originalVarName]; - $phpcsFile->addWarning($warning, $stackPtr, 'ContainsNumbers', $data); - } - - }//end processVariable() - - - /** - * Processes class member variables. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - protected function processMemberVar(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $varName = ltrim($tokens[$stackPtr]['content'], '$'); - $memberProps = $phpcsFile->getMemberProperties($stackPtr); - if (empty($memberProps) === true) { - // Exception encountered. - return; - } - - $public = ($memberProps['scope'] === 'public'); - - if ($public === true) { - if (substr($varName, 0, 1) === '_') { - $error = 'Public member variable "%s" must not contain a leading underscore'; - $data = [$varName]; - $phpcsFile->addError($error, $stackPtr, 'PublicHasUnderscore', $data); - } - } else { - if (substr($varName, 0, 1) !== '_') { - $scope = ucfirst($memberProps['scope']); - $error = '%s member variable "%s" must contain a leading underscore'; - $data = [ - $scope, - $varName, - ]; - $phpcsFile->addError($error, $stackPtr, 'PrivateNoUnderscore', $data); - } - } - - // Remove a potential underscore prefix for testing CamelCaps. - $varName = ltrim($varName, '_'); - - if (Common::isCamelCaps($varName, false, true, false) === false) { - $error = 'Member variable "%s" is not in valid camel caps format'; - $data = [$varName]; - $phpcsFile->addError($error, $stackPtr, 'MemberVarNotCamelCaps', $data); - } else if (preg_match('|\d|', $varName) === 1) { - $warning = 'Member variable "%s" contains numbers but this is discouraged'; - $data = [$varName]; - $phpcsFile->addWarning($warning, $stackPtr, 'MemberVarContainsNumbers', $data); - } - - }//end processMemberVar() - - - /** - * Processes the variable found within a double quoted string. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the double quoted - * string. - * - * @return void - */ - protected function processVariableInString(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (preg_match_all('|[^\\\]\$([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)|', $tokens[$stackPtr]['content'], $matches) !== 0) { - foreach ($matches[1] as $varName) { - // If it's a php reserved var, then its ok. - if (isset($this->phpReservedVars[$varName]) === true) { - continue; - } - - if (Common::isCamelCaps($varName, false, true, false) === false) { - $error = 'Variable "%s" is not in valid camel caps format'; - $data = [$varName]; - $phpcsFile->addError($error, $stackPtr, 'StringVarNotCamelCaps', $data); - } else if (preg_match('|\d|', $varName) === 1) { - $warning = 'Variable "%s" contains numbers but this is discouraged'; - $data = [$varName]; - $phpcsFile->addWarning($warning, $stackPtr, 'StringVarContainsNumbers', $data); - } - }//end foreach - }//end if - - }//end processVariableInString() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Debug/CodeAnalyzerUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Debug/CodeAnalyzerUnitTest.inc deleted file mode 100644 index c8d0499..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Debug/CodeAnalyzerUnitTest.inc +++ /dev/null @@ -1,6 +0,0 @@ - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Debug/CodeAnalyzerUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Debug/CodeAnalyzerUnitTest.php deleted file mode 100644 index efd3b90..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Debug/CodeAnalyzerUnitTest.php +++ /dev/null @@ -1,66 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Zend\Tests\Debug; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; -use PHP_CodeSniffer\Config; - -class CodeAnalyzerUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Should this test be skipped for some reason. - * - * @return void - */ - protected function shouldSkipTest() - { - $analyzerPath = Config::getExecutablePath('zend_ca'); - if ($analyzerPath === null) { - return true; - } - - return false; - - }//end shouldSkipTest() - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return []; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return [2 => 1]; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.1.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.1.inc deleted file mode 100644 index 7e7089d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.1.inc +++ /dev/null @@ -1,12 +0,0 @@ - - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.1.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.1.inc.fixed deleted file mode 100644 index caf3b38..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.1.inc.fixed +++ /dev/null @@ -1,12 +0,0 @@ - - -

    - -
    diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.3.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.3.inc deleted file mode 100644 index 63df04d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.3.inc +++ /dev/null @@ -1 +0,0 @@ -add('arg'))?> diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.3.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.3.inc.fixed deleted file mode 100644 index b4c4621..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.3.inc.fixed +++ /dev/null @@ -1 +0,0 @@ -add('arg')); diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.4.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.4.inc deleted file mode 100644 index 539365d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.4.inc +++ /dev/null @@ -1 +0,0 @@ -add('arg')) /* comment */ ?> diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.4.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.4.inc.fixed deleted file mode 100644 index 4cc31a5..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.4.inc.fixed +++ /dev/null @@ -1 +0,0 @@ -add('arg')); /* comment */ diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.5.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.5.inc deleted file mode 100644 index 09e4844..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.5.inc +++ /dev/null @@ -1 +0,0 @@ -add('arg')); } ?> diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.5.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.5.inc.fixed deleted file mode 100644 index 9ff112a..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.5.inc.fixed +++ /dev/null @@ -1 +0,0 @@ -add('arg')); } diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.6.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.6.inc deleted file mode 100644 index 48de7e0..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.6.inc +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.6.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.6.inc.fixed deleted file mode 100644 index 796727a..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.6.inc.fixed +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.7.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.7.inc.fixed deleted file mode 100644 index dc84e23..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.7.inc.fixed +++ /dev/null @@ -1 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Zend\Tests\Files; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ClosingTagUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'ClosingTagUnitTest.1.inc': - return [11 => 1]; - - case 'ClosingTagUnitTest.3.inc': - case 'ClosingTagUnitTest.4.inc': - case 'ClosingTagUnitTest.5.inc': - case 'ClosingTagUnitTest.7.inc': - return [1 => 1]; - - case 'ClosingTagUnitTest.6.inc': - return [3 => 1]; - - default: - return []; - } - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/NamingConventions/ValidVariableNameUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/NamingConventions/ValidVariableNameUnitTest.inc deleted file mode 100644 index 8ed8509..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/NamingConventions/ValidVariableNameUnitTest.inc +++ /dev/null @@ -1,122 +0,0 @@ -varName; -echo $this->var_name; -echo $this->varname; -echo $this->_varName; -echo $this->varName2; -echo $object->varName; -echo $object->var_name; -echo $object->varName2; -echo $object_name->varname; -echo $object_name->_varName; -echo $object_name->varName2; - -echo $this->myFunction($one, $two); -echo $object->myFunction($one_two, $var2); - -$error = "format is \$GLOBALS['$varName']"; -$error = "format is \$GLOBALS['$varName2']"; - -echo $_SESSION['var_name']; -echo $_FILES['var_name']; -echo $_ENV['var_name']; -echo $_COOKIE['var_name']; -echo $_COOKIE['var_name2']; - -$XML = 'hello'; -$myXML = 'hello'; -$XMLParser = 'hello'; -$xmlParser = 'hello'; -$xmlParser2 = 'hello'; - -echo "{$_SERVER['HOSTNAME']} $var_name"; - -$someObject->{$name}; -$someObject->my_function($var_name); - -var_dump($http_response_header); -var_dump($HTTP_RAW_POST_DATA); -var_dump($php_errormsg); - -interface Base -{ - protected $anonymous; - - public function __construct(); -} - -$anonClass = new class() { - public function foo($foo, $_foo, $foo_bar) { - $bar = 1; - $_bar = 2; - $bar_foo = 3; - } -}; - -echo $obj?->varName; -echo $obj?->var_name; -echo $obj?->varName; diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/NamingConventions/ValidVariableNameUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/NamingConventions/ValidVariableNameUnitTest.php deleted file mode 100644 index 916b334..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/NamingConventions/ValidVariableNameUnitTest.php +++ /dev/null @@ -1,94 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Zend\Tests\NamingConventions; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -class ValidVariableNameUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 3 => 1, - 5 => 1, - 11 => 1, - 13 => 1, - 17 => 1, - 19 => 1, - 23 => 1, - 25 => 1, - 29 => 1, - 31 => 1, - 36 => 1, - 38 => 1, - 42 => 1, - 44 => 1, - 48 => 1, - 50 => 1, - 61 => 1, - 67 => 1, - 72 => 1, - 74 => 1, - 75 => 1, - 76 => 1, - 79 => 1, - 96 => 1, - 99 => 1, - 113 => 1, - 116 => 1, - 121 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return [ - 6 => 1, - 14 => 1, - 20 => 1, - 26 => 1, - 32 => 1, - 39 => 1, - 45 => 1, - 51 => 1, - 64 => 1, - 70 => 1, - 73 => 1, - 76 => 1, - 79 => 1, - 82 => 1, - 94 => 1, - 107 => 1, - ]; - - }//end getWarningList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/ruleset.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/ruleset.xml deleted file mode 100644 index d10b103..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/ruleset.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - A coding standard based on an early Zend Framework coding standard. Note that this standard is out of date. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/squizlabs/php_codesniffer/src/Tokenizers/CSS.php b/vendor/squizlabs/php_codesniffer/src/Tokenizers/CSS.php deleted file mode 100644 index b7c2018..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Tokenizers/CSS.php +++ /dev/null @@ -1,537 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tokenizers; - -use PHP_CodeSniffer\Config; -use PHP_CodeSniffer\Exceptions\TokenizerException; -use PHP_CodeSniffer\Util; - -class CSS extends PHP -{ - - - /** - * Initialise the tokenizer. - * - * Pre-checks the content to see if it looks minified. - * - * @param string $content The content to tokenize, - * @param \PHP_CodeSniffer\Config $config The config data for the run. - * @param string $eolChar The EOL char used in the content. - * - * @return void - * @throws \PHP_CodeSniffer\Exceptions\TokenizerException If the file appears to be minified. - */ - public function __construct($content, Config $config, $eolChar='\n') - { - if ($this->isMinifiedContent($content, $eolChar) === true) { - throw new TokenizerException('File appears to be minified and cannot be processed'); - } - - parent::__construct($content, $config, $eolChar); - - }//end __construct() - - - /** - * Creates an array of tokens when given some CSS code. - * - * Uses the PHP tokenizer to do all the tricky work - * - * @param string $string The string to tokenize. - * - * @return array - */ - public function tokenize($string) - { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t*** START CSS TOKENIZING 1ST PASS ***".PHP_EOL; - } - - // If the content doesn't have an EOL char on the end, add one so - // the open and close tags we add are parsed correctly. - $eolAdded = false; - if (substr($string, (strlen($this->eolChar) * -1)) !== $this->eolChar) { - $string .= $this->eolChar; - $eolAdded = true; - } - - $string = str_replace('', '^PHPCS_CSS_T_CLOSE_TAG^', $string); - $tokens = parent::tokenize(''); - - $finalTokens = []; - $finalTokens[0] = [ - 'code' => T_OPEN_TAG, - 'type' => 'T_OPEN_TAG', - 'content' => '', - ]; - - $newStackPtr = 1; - $numTokens = count($tokens); - $multiLineComment = false; - for ($stackPtr = 1; $stackPtr < $numTokens; $stackPtr++) { - $token = $tokens[$stackPtr]; - - // CSS files don't have lists, breaks etc, so convert these to - // standard strings early so they can be converted into T_STYLE - // tokens and joined with other strings if needed. - if ($token['code'] === T_BREAK - || $token['code'] === T_LIST - || $token['code'] === T_DEFAULT - || $token['code'] === T_SWITCH - || $token['code'] === T_FOR - || $token['code'] === T_FOREACH - || $token['code'] === T_WHILE - || $token['code'] === T_DEC - || $token['code'] === T_NEW - ) { - $token['type'] = 'T_STRING'; - $token['code'] = T_STRING; - } - - $token['content'] = str_replace('^PHPCS_CSS_T_OPEN_TAG^', '', $token['content']); - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $token['type']; - $content = Util\Common::prepareForOutput($token['content']); - echo "\tProcess token $stackPtr: $type => $content".PHP_EOL; - } - - if ($token['code'] === T_BITWISE_XOR - && $tokens[($stackPtr + 1)]['content'] === 'PHPCS_CSS_T_OPEN_TAG' - ) { - $content = ''; - $stackPtr += 2; - break; - } else { - $content .= $tokens[$stackPtr]['content']; - } - } - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t=> Found embedded PHP code: "; - $cleanContent = Util\Common::prepareForOutput($content); - echo $cleanContent.PHP_EOL; - } - - $finalTokens[$newStackPtr] = [ - 'type' => 'T_EMBEDDED_PHP', - 'code' => T_EMBEDDED_PHP, - 'content' => $content, - ]; - - $newStackPtr++; - continue; - }//end if - - if ($token['code'] === T_GOTO_LABEL) { - // Convert these back to T_STRING followed by T_COLON so we can - // more easily process style definitions. - $finalTokens[$newStackPtr] = [ - 'type' => 'T_STRING', - 'code' => T_STRING, - 'content' => substr($token['content'], 0, -1), - ]; - $newStackPtr++; - $finalTokens[$newStackPtr] = [ - 'type' => 'T_COLON', - 'code' => T_COLON, - 'content' => ':', - ]; - $newStackPtr++; - continue; - } - - if ($token['code'] === T_FUNCTION) { - // There are no functions in CSS, so convert this to a string. - $finalTokens[$newStackPtr] = [ - 'type' => 'T_STRING', - 'code' => T_STRING, - 'content' => $token['content'], - ]; - - $newStackPtr++; - continue; - } - - if ($token['code'] === T_COMMENT - && substr($token['content'], 0, 2) === '/*' - ) { - // Multi-line comment. Record it so we can ignore other - // comment tags until we get out of this one. - $multiLineComment = true; - } - - if ($token['code'] === T_COMMENT - && $multiLineComment === false - && (substr($token['content'], 0, 2) === '//' - || $token['content'][0] === '#') - ) { - $content = ltrim($token['content'], '#/'); - - // Guard against PHP7+ syntax errors by stripping - // leading zeros so the content doesn't look like an invalid int. - $leadingZero = false; - if ($content[0] === '0') { - $content = '1'.$content; - $leadingZero = true; - } - - $commentTokens = parent::tokenize(''); - - // The first and last tokens are the open/close tags. - array_shift($commentTokens); - array_pop($commentTokens); - - if ($leadingZero === true) { - $commentTokens[0]['content'] = substr($commentTokens[0]['content'], 1); - $content = substr($content, 1); - } - - if ($token['content'][0] === '#') { - // The # character is not a comment in CSS files, so - // determine what it means in this context. - $firstContent = $commentTokens[0]['content']; - - // If the first content is just a number, it is probably a - // colour like 8FB7DB, which PHP splits into 8 and FB7DB. - if (($commentTokens[0]['code'] === T_LNUMBER - || $commentTokens[0]['code'] === T_DNUMBER) - && $commentTokens[1]['code'] === T_STRING - ) { - $firstContent .= $commentTokens[1]['content']; - array_shift($commentTokens); - } - - // If the first content looks like a colour and not a class - // definition, join the tokens together. - if (preg_match('/^[ABCDEF0-9]+$/i', $firstContent) === 1 - && $commentTokens[1]['content'] !== '-' - ) { - array_shift($commentTokens); - // Work out what we trimmed off above and remember to re-add it. - $trimmed = substr($token['content'], 0, (strlen($token['content']) - strlen($content))); - $finalTokens[$newStackPtr] = [ - 'type' => 'T_COLOUR', - 'code' => T_COLOUR, - 'content' => $trimmed.$firstContent, - ]; - } else { - $finalTokens[$newStackPtr] = [ - 'type' => 'T_HASH', - 'code' => T_HASH, - 'content' => '#', - ]; - } - } else { - $finalTokens[$newStackPtr] = [ - 'type' => 'T_STRING', - 'code' => T_STRING, - 'content' => '//', - ]; - }//end if - - $newStackPtr++; - - array_splice($tokens, $stackPtr, 1, $commentTokens); - $numTokens = count($tokens); - $stackPtr--; - continue; - }//end if - - if ($token['code'] === T_COMMENT - && substr($token['content'], -2) === '*/' - ) { - // Multi-line comment is done. - $multiLineComment = false; - } - - $finalTokens[$newStackPtr] = $token; - $newStackPtr++; - }//end for - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t*** END CSS TOKENIZING 1ST PASS ***".PHP_EOL; - echo "\t*** START CSS TOKENIZING 2ND PASS ***".PHP_EOL; - } - - // A flag to indicate if we are inside a style definition, - // which is defined using curly braces. - $inStyleDef = false; - - // A flag to indicate if an At-rule like "@media" is used, which will result - // in nested curly brackets. - $asperandStart = false; - - $numTokens = count($finalTokens); - for ($stackPtr = 0; $stackPtr < $numTokens; $stackPtr++) { - $token = $finalTokens[$stackPtr]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $token['type']; - $content = Util\Common::prepareForOutput($token['content']); - echo "\tProcess token $stackPtr: $type => $content".PHP_EOL; - } - - switch ($token['code']) { - case T_OPEN_CURLY_BRACKET: - // Opening curly brackets for an At-rule do not start a style - // definition. We also reset the asperand flag here because the next - // opening curly bracket could be indeed the start of a style - // definition. - if ($asperandStart === true) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - if ($inStyleDef === true) { - echo "\t\t* style definition closed *".PHP_EOL; - } - - if ($asperandStart === true) { - echo "\t\t* at-rule definition closed *".PHP_EOL; - } - } - - $inStyleDef = false; - $asperandStart = false; - } else { - $inStyleDef = true; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* style definition opened *".PHP_EOL; - } - } - break; - case T_CLOSE_CURLY_BRACKET: - if (PHP_CODESNIFFER_VERBOSITY > 1) { - if ($inStyleDef === true) { - echo "\t\t* style definition closed *".PHP_EOL; - } - - if ($asperandStart === true) { - echo "\t\t* at-rule definition closed *".PHP_EOL; - } - } - - $inStyleDef = false; - $asperandStart = false; - break; - case T_MINUS: - // Minus signs are often used instead of spaces inside - // class names, IDs and styles. - if ($finalTokens[($stackPtr + 1)]['code'] === T_STRING) { - if ($finalTokens[($stackPtr - 1)]['code'] === T_STRING) { - $newContent = $finalTokens[($stackPtr - 1)]['content'].'-'.$finalTokens[($stackPtr + 1)]['content']; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token is a string joiner; ignoring this and previous token".PHP_EOL; - $old = Util\Common::prepareForOutput($finalTokens[($stackPtr + 1)]['content']); - $new = Util\Common::prepareForOutput($newContent); - echo "\t\t=> token ".($stackPtr + 1)." content changed from \"$old\" to \"$new\"".PHP_EOL; - } - - $finalTokens[($stackPtr + 1)]['content'] = $newContent; - unset($finalTokens[$stackPtr]); - unset($finalTokens[($stackPtr - 1)]); - } else { - $newContent = '-'.$finalTokens[($stackPtr + 1)]['content']; - - $finalTokens[($stackPtr + 1)]['content'] = $newContent; - unset($finalTokens[$stackPtr]); - } - } else if ($finalTokens[($stackPtr + 1)]['code'] === T_LNUMBER) { - // They can also be used to provide negative numbers. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token is part of a negative number; adding content to next token and ignoring *".PHP_EOL; - $content = Util\Common::prepareForOutput($finalTokens[($stackPtr + 1)]['content']); - echo "\t\t=> token ".($stackPtr + 1)." content changed from \"$content\" to \"-$content\"".PHP_EOL; - } - - $finalTokens[($stackPtr + 1)]['content'] = '-'.$finalTokens[($stackPtr + 1)]['content']; - unset($finalTokens[$stackPtr]); - }//end if - break; - case T_COLON: - // Only interested in colons that are defining styles. - if ($inStyleDef === false) { - break; - } - - for ($x = ($stackPtr - 1); $x >= 0; $x--) { - if (isset(Util\Tokens::$emptyTokens[$finalTokens[$x]['code']]) === false) { - break; - } - } - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $finalTokens[$x]['type']; - echo "\t\t=> token $x changed from $type to T_STYLE".PHP_EOL; - } - - $finalTokens[$x]['type'] = 'T_STYLE'; - $finalTokens[$x]['code'] = T_STYLE; - break; - case T_STRING: - if (strtolower($token['content']) === 'url') { - // Find the next content. - for ($x = ($stackPtr + 1); $x < $numTokens; $x++) { - if (isset(Util\Tokens::$emptyTokens[$finalTokens[$x]['code']]) === false) { - break; - } - } - - // Needs to be in the format "url(" for it to be a URL. - if ($finalTokens[$x]['code'] !== T_OPEN_PARENTHESIS) { - continue 2; - } - - // Make sure the content isn't empty. - for ($y = ($x + 1); $y < $numTokens; $y++) { - if (isset(Util\Tokens::$emptyTokens[$finalTokens[$y]['code']]) === false) { - break; - } - } - - if ($finalTokens[$y]['code'] === T_CLOSE_PARENTHESIS) { - continue 2; - } - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - for ($i = ($stackPtr + 1); $i <= $y; $i++) { - $type = $finalTokens[$i]['type']; - $content = Util\Common::prepareForOutput($finalTokens[$i]['content']); - echo "\tProcess token $i: $type => $content".PHP_EOL; - } - - echo "\t\t* token starts a URL *".PHP_EOL; - } - - // Join all the content together inside the url() statement. - $newContent = ''; - for ($i = ($x + 2); $i < $numTokens; $i++) { - if ($finalTokens[$i]['code'] === T_CLOSE_PARENTHESIS) { - break; - } - - $newContent .= $finalTokens[$i]['content']; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $content = Util\Common::prepareForOutput($finalTokens[$i]['content']); - echo "\t\t=> token $i added to URL string and ignored: $content".PHP_EOL; - } - - unset($finalTokens[$i]); - } - - $stackPtr = $i; - - // If the content inside the "url()" is in double quotes - // there will only be one token and so we don't have to do - // anything except change its type. If it is not empty, - // we need to do some token merging. - $finalTokens[($x + 1)]['type'] = 'T_URL'; - $finalTokens[($x + 1)]['code'] = T_URL; - - if ($newContent !== '') { - $finalTokens[($x + 1)]['content'] .= $newContent; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $content = Util\Common::prepareForOutput($finalTokens[($x + 1)]['content']); - echo "\t\t=> token content changed to: $content".PHP_EOL; - } - } - } else if ($finalTokens[$stackPtr]['content'][0] === '-' - && $finalTokens[($stackPtr + 1)]['code'] === T_STRING - ) { - if (isset($finalTokens[($stackPtr - 1)]) === true - && $finalTokens[($stackPtr - 1)]['code'] === T_STRING - ) { - $newContent = $finalTokens[($stackPtr - 1)]['content'].$finalTokens[$stackPtr]['content'].$finalTokens[($stackPtr + 1)]['content']; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token is a string joiner; ignoring this and previous token".PHP_EOL; - $old = Util\Common::prepareForOutput($finalTokens[($stackPtr + 1)]['content']); - $new = Util\Common::prepareForOutput($newContent); - echo "\t\t=> token ".($stackPtr + 1)." content changed from \"$old\" to \"$new\"".PHP_EOL; - } - - $finalTokens[($stackPtr + 1)]['content'] = $newContent; - unset($finalTokens[$stackPtr]); - unset($finalTokens[($stackPtr - 1)]); - } else { - $newContent = $finalTokens[$stackPtr]['content'].$finalTokens[($stackPtr + 1)]['content']; - - $finalTokens[($stackPtr + 1)]['content'] = $newContent; - unset($finalTokens[$stackPtr]); - } - }//end if - break; - case T_ASPERAND: - $asperandStart = true; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* at-rule definition opened *".PHP_EOL; - } - break; - default: - // Nothing special to be done with this token. - break; - }//end switch - }//end for - - // Reset the array keys to avoid gaps. - $finalTokens = array_values($finalTokens); - $numTokens = count($finalTokens); - - // Blank out the content of the end tag. - $finalTokens[($numTokens - 1)]['content'] = ''; - - if ($eolAdded === true) { - // Strip off the extra EOL char we added for tokenizing. - $finalTokens[($numTokens - 2)]['content'] = substr( - $finalTokens[($numTokens - 2)]['content'], - 0, - (strlen($this->eolChar) * -1) - ); - - if ($finalTokens[($numTokens - 2)]['content'] === '') { - unset($finalTokens[($numTokens - 2)]); - $finalTokens = array_values($finalTokens); - $numTokens = count($finalTokens); - } - } - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t*** END CSS TOKENIZING 2ND PASS ***".PHP_EOL; - } - - return $finalTokens; - - }//end tokenize() - - - /** - * Performs additional processing after main tokenizing. - * - * @return void - */ - public function processAdditional() - { - /* - We override this method because we don't want the PHP version to - run during CSS processing because it is wasted processing time. - */ - - }//end processAdditional() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Tokenizers/Comment.php b/vendor/squizlabs/php_codesniffer/src/Tokenizers/Comment.php deleted file mode 100644 index beba53c..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Tokenizers/Comment.php +++ /dev/null @@ -1,277 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tokenizers; - -use PHP_CodeSniffer\Util; - -class Comment -{ - - - /** - * Creates an array of tokens when given some PHP code. - * - * Starts by using token_get_all() but does a lot of extra processing - * to insert information about the context of the token. - * - * @param string $string The string to tokenize. - * @param string $eolChar The EOL character to use for splitting strings. - * @param int $stackPtr The position of the first token in the file. - * - * @return array - */ - public function tokenizeString($string, $eolChar, $stackPtr) - { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t*** START COMMENT TOKENIZING ***".PHP_EOL; - } - - $tokens = []; - $numChars = strlen($string); - - /* - Doc block comments start with /*, but typically contain an - extra star when they are used for function and class comments. - */ - - $char = ($numChars - strlen(ltrim($string, '/*'))); - $openTag = substr($string, 0, $char); - $string = ltrim($string, '/*'); - - $tokens[$stackPtr] = [ - 'content' => $openTag, - 'code' => T_DOC_COMMENT_OPEN_TAG, - 'type' => 'T_DOC_COMMENT_OPEN_TAG', - 'comment_tags' => [], - ]; - - $openPtr = $stackPtr; - $stackPtr++; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $content = Util\Common::prepareForOutput($openTag); - echo "\t\tCreate comment token: T_DOC_COMMENT_OPEN_TAG => $content".PHP_EOL; - } - - /* - Strip off the close tag so it doesn't interfere with any - of our comment line processing. The token will be added to the - stack just before we return it. - */ - - $closeTag = [ - 'content' => substr($string, strlen(rtrim($string, '/*'))), - 'code' => T_DOC_COMMENT_CLOSE_TAG, - 'type' => 'T_DOC_COMMENT_CLOSE_TAG', - 'comment_opener' => $openPtr, - ]; - - if ($closeTag['content'] === false) { - $closeTag['content'] = ''; - } - - $string = rtrim($string, '/*'); - - /* - Process each line of the comment. - */ - - $lines = explode($eolChar, $string); - $numLines = count($lines); - foreach ($lines as $lineNum => $string) { - if ($lineNum !== ($numLines - 1)) { - $string .= $eolChar; - } - - $char = 0; - $numChars = strlen($string); - - // We've started a new line, so process the indent. - $space = $this->collectWhitespace($string, $char, $numChars); - if ($space !== null) { - $tokens[$stackPtr] = $space; - $stackPtr++; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $content = Util\Common::prepareForOutput($space['content']); - echo "\t\tCreate comment token: T_DOC_COMMENT_WHITESPACE => $content".PHP_EOL; - } - - $char += strlen($space['content']); - if ($char === $numChars) { - break; - } - } - - if ($string === '') { - continue; - } - - if ($lineNum > 0 && $string[$char] === '*') { - // This is a function or class doc block line. - $char++; - $tokens[$stackPtr] = [ - 'content' => '*', - 'code' => T_DOC_COMMENT_STAR, - 'type' => 'T_DOC_COMMENT_STAR', - ]; - - $stackPtr++; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\tCreate comment token: T_DOC_COMMENT_STAR => *".PHP_EOL; - } - } - - // Now we are ready to process the actual content of the line. - $lineTokens = $this->processLine($string, $eolChar, $char, $numChars); - foreach ($lineTokens as $lineToken) { - $tokens[$stackPtr] = $lineToken; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $content = Util\Common::prepareForOutput($lineToken['content']); - $type = $lineToken['type']; - echo "\t\tCreate comment token: $type => $content".PHP_EOL; - } - - if ($lineToken['code'] === T_DOC_COMMENT_TAG) { - $tokens[$openPtr]['comment_tags'][] = $stackPtr; - } - - $stackPtr++; - } - }//end foreach - - $tokens[$stackPtr] = $closeTag; - $tokens[$openPtr]['comment_closer'] = $stackPtr; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $content = Util\Common::prepareForOutput($closeTag['content']); - echo "\t\tCreate comment token: T_DOC_COMMENT_CLOSE_TAG => $content".PHP_EOL; - } - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t*** END COMMENT TOKENIZING ***".PHP_EOL; - } - - return $tokens; - - }//end tokenizeString() - - - /** - * Process a single line of a comment. - * - * @param string $string The comment string being tokenized. - * @param string $eolChar The EOL character to use for splitting strings. - * @param int $start The position in the string to start processing. - * @param int $end The position in the string to end processing. - * - * @return array - */ - private function processLine($string, $eolChar, $start, $end) - { - $tokens = []; - - // Collect content padding. - $space = $this->collectWhitespace($string, $start, $end); - if ($space !== null) { - $tokens[] = $space; - $start += strlen($space['content']); - } - - if (isset($string[$start]) === false) { - return $tokens; - } - - if ($string[$start] === '@') { - // The content up until the first whitespace is the tag name. - $matches = []; - preg_match('/@[^\s]+/', $string, $matches, 0, $start); - if (isset($matches[0]) === true - && substr(strtolower($matches[0]), 0, 7) !== '@phpcs:' - ) { - $tagName = $matches[0]; - $start += strlen($tagName); - $tokens[] = [ - 'content' => $tagName, - 'code' => T_DOC_COMMENT_TAG, - 'type' => 'T_DOC_COMMENT_TAG', - ]; - - // Then there will be some whitespace. - $space = $this->collectWhitespace($string, $start, $end); - if ($space !== null) { - $tokens[] = $space; - $start += strlen($space['content']); - } - } - }//end if - - // Process the rest of the line. - $eol = strpos($string, $eolChar, $start); - if ($eol === false) { - $eol = $end; - } - - if ($eol > $start) { - $tokens[] = [ - 'content' => substr($string, $start, ($eol - $start)), - 'code' => T_DOC_COMMENT_STRING, - 'type' => 'T_DOC_COMMENT_STRING', - ]; - } - - if ($eol !== $end) { - $tokens[] = [ - 'content' => substr($string, $eol, strlen($eolChar)), - 'code' => T_DOC_COMMENT_WHITESPACE, - 'type' => 'T_DOC_COMMENT_WHITESPACE', - ]; - } - - return $tokens; - - }//end processLine() - - - /** - * Collect consecutive whitespace into a single token. - * - * @param string $string The comment string being tokenized. - * @param int $start The position in the string to start processing. - * @param int $end The position in the string to end processing. - * - * @return array|null - */ - private function collectWhitespace($string, $start, $end) - { - $space = ''; - for ($start; $start < $end; $start++) { - if ($string[$start] !== ' ' && $string[$start] !== "\t") { - break; - } - - $space .= $string[$start]; - } - - if ($space === '') { - return null; - } - - $token = [ - 'content' => $space, - 'code' => T_DOC_COMMENT_WHITESPACE, - 'type' => 'T_DOC_COMMENT_WHITESPACE', - ]; - - return $token; - - }//end collectWhitespace() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Tokenizers/JS.php b/vendor/squizlabs/php_codesniffer/src/Tokenizers/JS.php deleted file mode 100644 index ee2f842..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Tokenizers/JS.php +++ /dev/null @@ -1,1256 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tokenizers; - -use PHP_CodeSniffer\Config; -use PHP_CodeSniffer\Exceptions\TokenizerException; -use PHP_CodeSniffer\Util; - -class JS extends Tokenizer -{ - - /** - * A list of tokens that are allowed to open a scope. - * - * This array also contains information about what kind of token the scope - * opener uses to open and close the scope, if the token strictly requires - * an opener, if the token can share a scope closer, and who it can be shared - * with. An example of a token that shares a scope closer is a CASE scope. - * - * @var array - */ - public $scopeOpeners = [ - T_IF => [ - 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], - 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], - 'strict' => false, - 'shared' => false, - 'with' => [], - ], - T_TRY => [ - 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], - 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], - 'strict' => true, - 'shared' => false, - 'with' => [], - ], - T_CATCH => [ - 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], - 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], - 'strict' => true, - 'shared' => false, - 'with' => [], - ], - T_ELSE => [ - 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], - 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], - 'strict' => false, - 'shared' => false, - 'with' => [], - ], - T_FOR => [ - 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], - 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], - 'strict' => false, - 'shared' => false, - 'with' => [], - ], - T_CLASS => [ - 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], - 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], - 'strict' => true, - 'shared' => false, - 'with' => [], - ], - T_FUNCTION => [ - 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], - 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], - 'strict' => false, - 'shared' => false, - 'with' => [], - ], - T_WHILE => [ - 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], - 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], - 'strict' => false, - 'shared' => false, - 'with' => [], - ], - T_DO => [ - 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], - 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], - 'strict' => true, - 'shared' => false, - 'with' => [], - ], - T_SWITCH => [ - 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], - 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], - 'strict' => true, - 'shared' => false, - 'with' => [], - ], - T_CASE => [ - 'start' => [T_COLON => T_COLON], - 'end' => [ - T_BREAK => T_BREAK, - T_RETURN => T_RETURN, - T_CONTINUE => T_CONTINUE, - T_THROW => T_THROW, - ], - 'strict' => true, - 'shared' => true, - 'with' => [ - T_DEFAULT => T_DEFAULT, - T_CASE => T_CASE, - T_SWITCH => T_SWITCH, - ], - ], - T_DEFAULT => [ - 'start' => [T_COLON => T_COLON], - 'end' => [ - T_BREAK => T_BREAK, - T_RETURN => T_RETURN, - T_CONTINUE => T_CONTINUE, - T_THROW => T_THROW, - ], - 'strict' => true, - 'shared' => true, - 'with' => [ - T_CASE => T_CASE, - T_SWITCH => T_SWITCH, - ], - ], - ]; - - /** - * A list of tokens that end the scope. - * - * This array is just a unique collection of the end tokens - * from the _scopeOpeners array. The data is duplicated here to - * save time during parsing of the file. - * - * @var array - */ - public $endScopeTokens = [ - T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET, - T_BREAK => T_BREAK, - ]; - - /** - * A list of special JS tokens and their types. - * - * @var array - */ - protected $tokenValues = [ - 'class' => 'T_CLASS', - 'function' => 'T_FUNCTION', - 'prototype' => 'T_PROTOTYPE', - 'try' => 'T_TRY', - 'catch' => 'T_CATCH', - 'return' => 'T_RETURN', - 'throw' => 'T_THROW', - 'break' => 'T_BREAK', - 'switch' => 'T_SWITCH', - 'continue' => 'T_CONTINUE', - 'if' => 'T_IF', - 'else' => 'T_ELSE', - 'do' => 'T_DO', - 'while' => 'T_WHILE', - 'for' => 'T_FOR', - 'var' => 'T_VAR', - 'case' => 'T_CASE', - 'default' => 'T_DEFAULT', - 'true' => 'T_TRUE', - 'false' => 'T_FALSE', - 'null' => 'T_NULL', - 'this' => 'T_THIS', - 'typeof' => 'T_TYPEOF', - '(' => 'T_OPEN_PARENTHESIS', - ')' => 'T_CLOSE_PARENTHESIS', - '{' => 'T_OPEN_CURLY_BRACKET', - '}' => 'T_CLOSE_CURLY_BRACKET', - '[' => 'T_OPEN_SQUARE_BRACKET', - ']' => 'T_CLOSE_SQUARE_BRACKET', - '?' => 'T_INLINE_THEN', - '.' => 'T_OBJECT_OPERATOR', - '+' => 'T_PLUS', - '-' => 'T_MINUS', - '*' => 'T_MULTIPLY', - '%' => 'T_MODULUS', - '/' => 'T_DIVIDE', - '^' => 'T_LOGICAL_XOR', - ',' => 'T_COMMA', - ';' => 'T_SEMICOLON', - ':' => 'T_COLON', - '<' => 'T_LESS_THAN', - '>' => 'T_GREATER_THAN', - '<<' => 'T_SL', - '>>' => 'T_SR', - '>>>' => 'T_ZSR', - '<<=' => 'T_SL_EQUAL', - '>>=' => 'T_SR_EQUAL', - '>>>=' => 'T_ZSR_EQUAL', - '<=' => 'T_IS_SMALLER_OR_EQUAL', - '>=' => 'T_IS_GREATER_OR_EQUAL', - '=>' => 'T_DOUBLE_ARROW', - '!' => 'T_BOOLEAN_NOT', - '||' => 'T_BOOLEAN_OR', - '&&' => 'T_BOOLEAN_AND', - '|' => 'T_BITWISE_OR', - '&' => 'T_BITWISE_AND', - '!=' => 'T_IS_NOT_EQUAL', - '!==' => 'T_IS_NOT_IDENTICAL', - '=' => 'T_EQUAL', - '==' => 'T_IS_EQUAL', - '===' => 'T_IS_IDENTICAL', - '-=' => 'T_MINUS_EQUAL', - '+=' => 'T_PLUS_EQUAL', - '*=' => 'T_MUL_EQUAL', - '/=' => 'T_DIV_EQUAL', - '%=' => 'T_MOD_EQUAL', - '++' => 'T_INC', - '--' => 'T_DEC', - '//' => 'T_COMMENT', - '/*' => 'T_COMMENT', - '/**' => 'T_DOC_COMMENT', - '*/' => 'T_COMMENT', - ]; - - /** - * A list string delimiters. - * - * @var array - */ - protected $stringTokens = [ - '\'' => '\'', - '"' => '"', - ]; - - /** - * A list tokens that start and end comments. - * - * @var array - */ - protected $commentTokens = [ - '//' => null, - '/*' => '*/', - '/**' => '*/', - ]; - - - /** - * Initialise the tokenizer. - * - * Pre-checks the content to see if it looks minified. - * - * @param string $content The content to tokenize, - * @param \PHP_CodeSniffer\Config $config The config data for the run. - * @param string $eolChar The EOL char used in the content. - * - * @return void - * @throws \PHP_CodeSniffer\Exceptions\TokenizerException If the file appears to be minified. - */ - public function __construct($content, Config $config, $eolChar='\n') - { - if ($this->isMinifiedContent($content, $eolChar) === true) { - throw new TokenizerException('File appears to be minified and cannot be processed'); - } - - parent::__construct($content, $config, $eolChar); - - }//end __construct() - - - /** - * Creates an array of tokens when given some JS code. - * - * @param string $string The string to tokenize. - * - * @return array - */ - public function tokenize($string) - { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t*** START JS TOKENIZING ***".PHP_EOL; - } - - $maxTokenLength = 0; - foreach ($this->tokenValues as $token => $values) { - if (strlen($token) > $maxTokenLength) { - $maxTokenLength = strlen($token); - } - } - - $tokens = []; - $inString = ''; - $stringChar = null; - $inComment = ''; - $buffer = ''; - $preStringBuffer = ''; - $cleanBuffer = false; - - $commentTokenizer = new Comment(); - - $tokens[] = [ - 'code' => T_OPEN_TAG, - 'type' => 'T_OPEN_TAG', - 'content' => '', - ]; - - // Convert newlines to single characters for ease of - // processing. We will change them back later. - $string = str_replace($this->eolChar, "\n", $string); - - $chars = str_split($string); - $numChars = count($chars); - for ($i = 0; $i < $numChars; $i++) { - $char = $chars[$i]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $content = Util\Common::prepareForOutput($char); - $bufferContent = Util\Common::prepareForOutput($buffer); - - if ($inString !== '') { - echo "\t"; - } - - if ($inComment !== '') { - echo "\t"; - } - - echo "\tProcess char $i => $content (buffer: $bufferContent)".PHP_EOL; - }//end if - - if ($inString === '' && $inComment === '' && $buffer !== '') { - // If the buffer only has whitespace and we are about to - // add a character, store the whitespace first. - if (trim($char) !== '' && trim($buffer) === '') { - $tokens[] = [ - 'code' => T_WHITESPACE, - 'type' => 'T_WHITESPACE', - 'content' => str_replace("\n", $this->eolChar, $buffer), - ]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $content = Util\Common::prepareForOutput($buffer); - echo "\t=> Added token T_WHITESPACE ($content)".PHP_EOL; - } - - $buffer = ''; - } - - // If the buffer is not whitespace and we are about to - // add a whitespace character, store the content first. - if ($inString === '' - && $inComment === '' - && trim($char) === '' - && trim($buffer) !== '' - ) { - $tokens[] = [ - 'code' => T_STRING, - 'type' => 'T_STRING', - 'content' => str_replace("\n", $this->eolChar, $buffer), - ]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $content = Util\Common::prepareForOutput($buffer); - echo "\t=> Added token T_STRING ($content)".PHP_EOL; - } - - $buffer = ''; - } - }//end if - - // Process strings. - if ($inComment === '' && isset($this->stringTokens[$char]) === true) { - if ($inString === $char) { - // This could be the end of the string, but make sure it - // is not escaped first. - $escapes = 0; - for ($x = ($i - 1); $x >= 0; $x--) { - if ($chars[$x] !== '\\') { - break; - } - - $escapes++; - } - - if ($escapes === 0 || ($escapes % 2) === 0) { - // There is an even number escape chars, - // so this is not escaped, it is the end of the string. - $tokens[] = [ - 'code' => T_CONSTANT_ENCAPSED_STRING, - 'type' => 'T_CONSTANT_ENCAPSED_STRING', - 'content' => str_replace("\n", $this->eolChar, $buffer).$char, - ]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* found end of string *".PHP_EOL; - $content = Util\Common::prepareForOutput($buffer.$char); - echo "\t=> Added token T_CONSTANT_ENCAPSED_STRING ($content)".PHP_EOL; - } - - $buffer = ''; - $preStringBuffer = ''; - $inString = ''; - $stringChar = null; - continue; - }//end if - } else if ($inString === '') { - $inString = $char; - $stringChar = $i; - $preStringBuffer = $buffer; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* looking for string closer *".PHP_EOL; - } - }//end if - }//end if - - if ($inString !== '' && $char === "\n") { - // Unless this newline character is escaped, the string did not - // end before the end of the line, which means it probably - // wasn't a string at all (maybe a regex). - if ($chars[($i - 1)] !== '\\') { - $i = $stringChar; - $buffer = $preStringBuffer; - $preStringBuffer = ''; - $inString = ''; - $stringChar = null; - $char = $chars[$i]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* found newline before end of string, bailing *".PHP_EOL; - } - } - } - - $buffer .= $char; - - // We don't look for special tokens inside strings, - // so if we are in a string, we can continue here now - // that the current char is in the buffer. - if ($inString !== '') { - continue; - } - - // Special case for T_DIVIDE which can actually be - // the start of a regular expression. - if ($buffer === $char && $char === '/' && $chars[($i + 1)] !== '*') { - $regex = $this->getRegexToken($i, $string, $chars, $tokens); - if ($regex !== null) { - $tokens[] = [ - 'code' => T_REGULAR_EXPRESSION, - 'type' => 'T_REGULAR_EXPRESSION', - 'content' => $regex['content'], - ]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $content = Util\Common::prepareForOutput($regex['content']); - echo "\t=> Added token T_REGULAR_EXPRESSION ($content)".PHP_EOL; - } - - $i = $regex['end']; - $buffer = ''; - $cleanBuffer = false; - continue; - }//end if - }//end if - - // Check for known tokens, but ignore tokens found that are not at - // the end of a string, like FOR and this.FORmat. - if (isset($this->tokenValues[strtolower($buffer)]) === true - && (preg_match('|[a-zA-z0-9_]|', $char) === 0 - || isset($chars[($i + 1)]) === false - || preg_match('|[a-zA-z0-9_]|', $chars[($i + 1)]) === 0) - ) { - $matchedToken = false; - $lookAheadLength = ($maxTokenLength - strlen($buffer)); - - if ($lookAheadLength > 0) { - // The buffer contains a token type, but we need - // to look ahead at the next chars to see if this is - // actually part of a larger token. For example, - // FOR and FOREACH. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* buffer possibly contains token, looking ahead $lookAheadLength chars *".PHP_EOL; - } - - $charBuffer = $buffer; - for ($x = 1; $x <= $lookAheadLength; $x++) { - if (isset($chars[($i + $x)]) === false) { - break; - } - - $charBuffer .= $chars[($i + $x)]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $content = Util\Common::prepareForOutput($charBuffer); - echo "\t\t=> Looking ahead $x chars => $content".PHP_EOL; - } - - if (isset($this->tokenValues[strtolower($charBuffer)]) === true) { - // We've found something larger that matches - // so we can ignore this char. Except for 1 very specific - // case where a comment like /**/ needs to tokenize as - // T_COMMENT and not T_DOC_COMMENT. - $oldType = $this->tokenValues[strtolower($buffer)]; - $newType = $this->tokenValues[strtolower($charBuffer)]; - if ($oldType === 'T_COMMENT' - && $newType === 'T_DOC_COMMENT' - && $chars[($i + $x + 1)] === '/' - ) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* look ahead ignored T_DOC_COMMENT, continuing *".PHP_EOL; - } - } else { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* look ahead found more specific token ($newType), ignoring $i *".PHP_EOL; - } - - $matchedToken = true; - break; - } - }//end if - }//end for - }//end if - - if ($matchedToken === false) { - if (PHP_CODESNIFFER_VERBOSITY > 1 && $lookAheadLength > 0) { - echo "\t\t* look ahead found nothing *".PHP_EOL; - } - - $value = $this->tokenValues[strtolower($buffer)]; - - if ($value === 'T_FUNCTION' && $buffer !== 'function') { - // The function keyword needs to be all lowercase or else - // it is just a function called "Function". - $value = 'T_STRING'; - } - - $tokens[] = [ - 'code' => constant($value), - 'type' => $value, - 'content' => $buffer, - ]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $content = Util\Common::prepareForOutput($buffer); - echo "\t=> Added token $value ($content)".PHP_EOL; - } - - $cleanBuffer = true; - }//end if - } else if (isset($this->tokenValues[strtolower($char)]) === true) { - // No matter what token we end up using, we don't - // need the content in the buffer any more because we have - // found a valid token. - $newContent = substr(str_replace("\n", $this->eolChar, $buffer), 0, -1); - if ($newContent !== '') { - $tokens[] = [ - 'code' => T_STRING, - 'type' => 'T_STRING', - 'content' => $newContent, - ]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $content = Util\Common::prepareForOutput(substr($buffer, 0, -1)); - echo "\t=> Added token T_STRING ($content)".PHP_EOL; - } - } - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* char is token, looking ahead ".($maxTokenLength - 1).' chars *'.PHP_EOL; - } - - // The char is a token type, but we need to look ahead at the - // next chars to see if this is actually part of a larger token. - // For example, = and ===. - $charBuffer = $char; - $matchedToken = false; - for ($x = 1; $x <= $maxTokenLength; $x++) { - if (isset($chars[($i + $x)]) === false) { - break; - } - - $charBuffer .= $chars[($i + $x)]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $content = Util\Common::prepareForOutput($charBuffer); - echo "\t\t=> Looking ahead $x chars => $content".PHP_EOL; - } - - if (isset($this->tokenValues[strtolower($charBuffer)]) === true) { - // We've found something larger that matches - // so we can ignore this char. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokenValues[strtolower($charBuffer)]; - echo "\t\t* look ahead found more specific token ($type), ignoring $i *".PHP_EOL; - } - - $matchedToken = true; - break; - } - }//end for - - if ($matchedToken === false) { - $value = $this->tokenValues[strtolower($char)]; - $tokens[] = [ - 'code' => constant($value), - 'type' => $value, - 'content' => $char, - ]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* look ahead found nothing *".PHP_EOL; - $content = Util\Common::prepareForOutput($char); - echo "\t=> Added token $value ($content)".PHP_EOL; - } - - $cleanBuffer = true; - } else { - $buffer = $char; - }//end if - }//end if - - // Keep track of content inside comments. - if ($inComment === '' - && array_key_exists($buffer, $this->commentTokens) === true - ) { - // This is not really a comment if the content - // looks like \// (i.e., it is escaped). - if (isset($chars[($i - 2)]) === true && $chars[($i - 2)] === '\\') { - $lastToken = array_pop($tokens); - $lastContent = $lastToken['content']; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $value = $this->tokenValues[strtolower($lastContent)]; - $content = Util\Common::prepareForOutput($lastContent); - echo "\t=> Removed token $value ($content)".PHP_EOL; - } - - $lastChars = str_split($lastContent); - $lastNumChars = count($lastChars); - for ($x = 0; $x < $lastNumChars; $x++) { - $lastChar = $lastChars[$x]; - $value = $this->tokenValues[strtolower($lastChar)]; - $tokens[] = [ - 'code' => constant($value), - 'type' => $value, - 'content' => $lastChar, - ]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $content = Util\Common::prepareForOutput($lastChar); - echo "\t=> Added token $value ($content)".PHP_EOL; - } - } - } else { - // We have started a comment. - $inComment = $buffer; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* looking for end of comment *".PHP_EOL; - } - }//end if - } else if ($inComment !== '') { - if ($this->commentTokens[$inComment] === null) { - // Comment ends at the next newline. - if (strpos($buffer, "\n") !== false) { - $inComment = ''; - } - } else { - if ($this->commentTokens[$inComment] === $buffer) { - $inComment = ''; - } - } - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - if ($inComment === '') { - echo "\t\t* found end of comment *".PHP_EOL; - } - } - - if ($inComment === '' && $cleanBuffer === false) { - $tokens[] = [ - 'code' => T_STRING, - 'type' => 'T_STRING', - 'content' => str_replace("\n", $this->eolChar, $buffer), - ]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $content = Util\Common::prepareForOutput($buffer); - echo "\t=> Added token T_STRING ($content)".PHP_EOL; - } - - $buffer = ''; - } - }//end if - - if ($cleanBuffer === true) { - $buffer = ''; - $cleanBuffer = false; - } - }//end for - - if (empty($buffer) === false) { - if ($inString !== '') { - // The string did not end before the end of the file, - // which means there was probably a syntax error somewhere. - $tokens[] = [ - 'code' => T_STRING, - 'type' => 'T_STRING', - 'content' => str_replace("\n", $this->eolChar, $buffer), - ]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $content = Util\Common::prepareForOutput($buffer); - echo "\t=> Added token T_STRING ($content)".PHP_EOL; - } - } else { - // Buffer contains whitespace from the end of the file. - $tokens[] = [ - 'code' => T_WHITESPACE, - 'type' => 'T_WHITESPACE', - 'content' => str_replace("\n", $this->eolChar, $buffer), - ]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $content = Util\Common::prepareForOutput($buffer); - echo "\t=> Added token T_WHITESPACE ($content)".PHP_EOL; - } - }//end if - }//end if - - $tokens[] = [ - 'code' => T_CLOSE_TAG, - 'type' => 'T_CLOSE_TAG', - 'content' => '', - ]; - - /* - Now that we have done some basic tokenizing, we need to - modify the tokens to join some together and split some apart - so they match what the PHP tokenizer does. - */ - - $finalTokens = []; - $newStackPtr = 0; - $numTokens = count($tokens); - for ($stackPtr = 0; $stackPtr < $numTokens; $stackPtr++) { - $token = $tokens[$stackPtr]; - - /* - Look for comments and join the tokens together. - */ - - if ($token['code'] === T_COMMENT || $token['code'] === T_DOC_COMMENT) { - $newContent = ''; - $tokenContent = $token['content']; - - $endContent = null; - if (isset($this->commentTokens[$tokenContent]) === true) { - $endContent = $this->commentTokens[$tokenContent]; - } - - while ($tokenContent !== $endContent) { - if ($endContent === null - && strpos($tokenContent, $this->eolChar) !== false - ) { - // A null end token means the comment ends at the end of - // the line so we look for newlines and split the token. - $tokens[$stackPtr]['content'] = substr( - $tokenContent, - (strpos($tokenContent, $this->eolChar) + strlen($this->eolChar)) - ); - - $tokenContent = substr( - $tokenContent, - 0, - (strpos($tokenContent, $this->eolChar) + strlen($this->eolChar)) - ); - - // If the substr failed, skip the token as the content - // will now be blank. - if ($tokens[$stackPtr]['content'] !== false - && $tokens[$stackPtr]['content'] !== '' - ) { - $stackPtr--; - } - - break; - }//end if - - $stackPtr++; - $newContent .= $tokenContent; - if (isset($tokens[$stackPtr]) === false) { - break; - } - - $tokenContent = $tokens[$stackPtr]['content']; - }//end while - - if ($token['code'] === T_DOC_COMMENT) { - $commentTokens = $commentTokenizer->tokenizeString($newContent.$tokenContent, $this->eolChar, $newStackPtr); - foreach ($commentTokens as $commentToken) { - $finalTokens[$newStackPtr] = $commentToken; - $newStackPtr++; - } - - continue; - } else { - // Save the new content in the current token so - // the code below can chop it up on newlines. - $token['content'] = $newContent.$tokenContent; - } - }//end if - - /* - If this token has newlines in its content, split each line up - and create a new token for each line. We do this so it's easier - to ascertain where errors occur on a line. - Note that $token[1] is the token's content. - */ - - if (strpos($token['content'], $this->eolChar) !== false) { - $tokenLines = explode($this->eolChar, $token['content']); - $numLines = count($tokenLines); - - for ($i = 0; $i < $numLines; $i++) { - $newToken = ['content' => $tokenLines[$i]]; - if ($i === ($numLines - 1)) { - if ($tokenLines[$i] === '') { - break; - } - } else { - $newToken['content'] .= $this->eolChar; - } - - $newToken['type'] = $token['type']; - $newToken['code'] = $token['code']; - $finalTokens[$newStackPtr] = $newToken; - $newStackPtr++; - } - } else { - $finalTokens[$newStackPtr] = $token; - $newStackPtr++; - }//end if - - // Convert numbers, including decimals. - if ($token['code'] === T_STRING - || $token['code'] === T_OBJECT_OPERATOR - ) { - $newContent = ''; - $oldStackPtr = $stackPtr; - while (preg_match('|^[0-9\.]+$|', $tokens[$stackPtr]['content']) !== 0) { - $newContent .= $tokens[$stackPtr]['content']; - $stackPtr++; - } - - if ($newContent !== '' && $newContent !== '.') { - $finalTokens[($newStackPtr - 1)]['content'] = $newContent; - if (ctype_digit($newContent) === true) { - $finalTokens[($newStackPtr - 1)]['code'] = constant('T_LNUMBER'); - $finalTokens[($newStackPtr - 1)]['type'] = 'T_LNUMBER'; - } else { - $finalTokens[($newStackPtr - 1)]['code'] = constant('T_DNUMBER'); - $finalTokens[($newStackPtr - 1)]['type'] = 'T_DNUMBER'; - } - - $stackPtr--; - continue; - } else { - $stackPtr = $oldStackPtr; - } - }//end if - - // Convert the token after an object operator into a string, in most cases. - if ($token['code'] === T_OBJECT_OPERATOR) { - for ($i = ($stackPtr + 1); $i < $numTokens; $i++) { - if (isset(Util\Tokens::$emptyTokens[$tokens[$i]['code']]) === true) { - continue; - } - - if ($tokens[$i]['code'] !== T_PROTOTYPE - && $tokens[$i]['code'] !== T_LNUMBER - && $tokens[$i]['code'] !== T_DNUMBER - ) { - $tokens[$i]['code'] = T_STRING; - $tokens[$i]['type'] = 'T_STRING'; - } - - break; - } - } - }//end for - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t*** END TOKENIZING ***".PHP_EOL; - } - - return $finalTokens; - - }//end tokenize() - - - /** - * Tokenizes a regular expression if one is found. - * - * If a regular expression is not found, NULL is returned. - * - * @param string $char The index of the possible regex start character. - * @param string $string The complete content of the string being tokenized. - * @param string $chars An array of characters being tokenized. - * @param string $tokens The current array of tokens found in the string. - * - * @return array|null - */ - public function getRegexToken($char, $string, $chars, $tokens) - { - $beforeTokens = [ - T_EQUAL => true, - T_IS_NOT_EQUAL => true, - T_IS_IDENTICAL => true, - T_IS_NOT_IDENTICAL => true, - T_OPEN_PARENTHESIS => true, - T_OPEN_SQUARE_BRACKET => true, - T_RETURN => true, - T_BOOLEAN_OR => true, - T_BOOLEAN_AND => true, - T_BOOLEAN_NOT => true, - T_BITWISE_OR => true, - T_BITWISE_AND => true, - T_COMMA => true, - T_COLON => true, - T_TYPEOF => true, - T_INLINE_THEN => true, - T_INLINE_ELSE => true, - ]; - - $afterTokens = [ - ',' => true, - ')' => true, - ']' => true, - ';' => true, - ' ' => true, - '.' => true, - ':' => true, - $this->eolChar => true, - ]; - - // Find the last non-whitespace token that was added - // to the tokens array. - $numTokens = count($tokens); - for ($prev = ($numTokens - 1); $prev >= 0; $prev--) { - if (isset(Util\Tokens::$emptyTokens[$tokens[$prev]['code']]) === false) { - break; - } - } - - if (isset($beforeTokens[$tokens[$prev]['code']]) === false) { - return null; - } - - // This is probably a regular expression, so look for the end of it. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t* token possibly starts a regular expression *".PHP_EOL; - } - - $numChars = count($chars); - for ($next = ($char + 1); $next < $numChars; $next++) { - if ($chars[$next] === '/') { - // Just make sure this is not escaped first. - if ($chars[($next - 1)] !== '\\') { - // In the simple form: /.../ so we found the end. - break; - } else if ($chars[($next - 2)] === '\\') { - // In the form: /...\\/ so we found the end. - break; - } - } else { - $possibleEolChar = substr($string, $next, strlen($this->eolChar)); - if ($possibleEolChar === $this->eolChar) { - // This is the last token on the line and regular - // expressions need to be defined on a single line, - // so this is not a regular expression. - break; - } - } - } - - if ($chars[$next] !== '/') { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t* could not find end of regular expression *".PHP_EOL; - } - - return null; - } - - while (preg_match('|[a-zA-Z]|', $chars[($next + 1)]) !== 0) { - // The token directly after the end of the regex can - // be modifiers like global and case insensitive - // (.e.g, /pattern/gi). - $next++; - } - - $regexEnd = $next; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t* found end of regular expression at token $regexEnd *".PHP_EOL; - } - - for ($next += 1; $next < $numChars; $next++) { - if ($chars[$next] !== ' ') { - break; - } else { - $possibleEolChar = substr($string, $next, strlen($this->eolChar)); - if ($possibleEolChar === $this->eolChar) { - // This is the last token on the line. - break; - } - } - } - - if (isset($afterTokens[$chars[$next]]) === false) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t* tokens after regular expression do not look correct *".PHP_EOL; - } - - return null; - } - - // This is a regular expression, so join all the tokens together. - $content = ''; - for ($x = $char; $x <= $regexEnd; $x++) { - $content .= $chars[$x]; - } - - $token = [ - 'start' => $char, - 'end' => $regexEnd, - 'content' => $content, - ]; - - return $token; - - }//end getRegexToken() - - - /** - * Performs additional processing after main tokenizing. - * - * This additional processing looks for properties, closures, labels and objects. - * - * @return void - */ - public function processAdditional() - { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t*** START ADDITIONAL JS PROCESSING ***".PHP_EOL; - } - - $numTokens = count($this->tokens); - $classStack = []; - - for ($i = 0; $i < $numTokens; $i++) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$i]['type']; - $content = Util\Common::prepareForOutput($this->tokens[$i]['content']); - - echo str_repeat("\t", count($classStack)); - echo "\tProcess token $i: $type => $content".PHP_EOL; - } - - // Looking for functions that are actually closures. - if ($this->tokens[$i]['code'] === T_FUNCTION && isset($this->tokens[$i]['scope_opener']) === true) { - for ($x = ($i + 1); $x < $numTokens; $x++) { - if (isset(Util\Tokens::$emptyTokens[$this->tokens[$x]['code']]) === false) { - break; - } - } - - if ($this->tokens[$x]['code'] === T_OPEN_PARENTHESIS) { - $this->tokens[$i]['code'] = T_CLOSURE; - $this->tokens[$i]['type'] = 'T_CLOSURE'; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $line = $this->tokens[$i]['line']; - echo str_repeat("\t", count($classStack)); - echo "\t* token $i on line $line changed from T_FUNCTION to T_CLOSURE *".PHP_EOL; - } - - for ($x = ($this->tokens[$i]['scope_opener'] + 1); $x < $this->tokens[$i]['scope_closer']; $x++) { - if (isset($this->tokens[$x]['conditions'][$i]) === false) { - continue; - } - - $this->tokens[$x]['conditions'][$i] = T_CLOSURE; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$x]['type']; - echo str_repeat("\t", count($classStack)); - echo "\t\t* cleaned $x ($type) *".PHP_EOL; - } - } - }//end if - - continue; - } else if ($this->tokens[$i]['code'] === T_OPEN_CURLY_BRACKET - && isset($this->tokens[$i]['scope_condition']) === false - && isset($this->tokens[$i]['bracket_closer']) === true - ) { - $condition = $this->tokens[$i]['conditions']; - $condition = end($condition); - if ($condition === T_CLASS) { - // Possibly an ES6 method. To be classified as one, the previous - // non-empty tokens need to be a set of parenthesis, and then a string - // (the method name). - for ($parenCloser = ($i - 1); $parenCloser > 0; $parenCloser--) { - if (isset(Util\Tokens::$emptyTokens[$this->tokens[$parenCloser]['code']]) === false) { - break; - } - } - - if ($this->tokens[$parenCloser]['code'] === T_CLOSE_PARENTHESIS) { - $parenOpener = $this->tokens[$parenCloser]['parenthesis_opener']; - for ($name = ($parenOpener - 1); $name > 0; $name--) { - if (isset(Util\Tokens::$emptyTokens[$this->tokens[$name]['code']]) === false) { - break; - } - } - - if ($this->tokens[$name]['code'] === T_STRING) { - // We found a method name. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $line = $this->tokens[$name]['line']; - echo str_repeat("\t", count($classStack)); - echo "\t* token $name on line $line changed from T_STRING to T_FUNCTION *".PHP_EOL; - } - - $closer = $this->tokens[$i]['bracket_closer']; - - $this->tokens[$name]['code'] = T_FUNCTION; - $this->tokens[$name]['type'] = 'T_FUNCTION'; - - foreach ([$name, $i, $closer] as $token) { - $this->tokens[$token]['scope_condition'] = $name; - $this->tokens[$token]['scope_opener'] = $i; - $this->tokens[$token]['scope_closer'] = $closer; - $this->tokens[$token]['parenthesis_opener'] = $parenOpener; - $this->tokens[$token]['parenthesis_closer'] = $parenCloser; - $this->tokens[$token]['parenthesis_owner'] = $name; - } - - $this->tokens[$parenOpener]['parenthesis_owner'] = $name; - $this->tokens[$parenCloser]['parenthesis_owner'] = $name; - - for ($x = ($i + 1); $x < $closer; $x++) { - $this->tokens[$x]['conditions'][$name] = T_FUNCTION; - ksort($this->tokens[$x]['conditions'], SORT_NUMERIC); - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$x]['type']; - echo str_repeat("\t", count($classStack)); - echo "\t\t* added T_FUNCTION condition to $x ($type) *".PHP_EOL; - } - } - - continue; - }//end if - }//end if - }//end if - - $classStack[] = $i; - - $closer = $this->tokens[$i]['bracket_closer']; - $this->tokens[$i]['code'] = T_OBJECT; - $this->tokens[$i]['type'] = 'T_OBJECT'; - $this->tokens[$closer]['code'] = T_CLOSE_OBJECT; - $this->tokens[$closer]['type'] = 'T_CLOSE_OBJECT'; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", count($classStack)); - echo "\t* token $i converted from T_OPEN_CURLY_BRACKET to T_OBJECT *".PHP_EOL; - echo str_repeat("\t", count($classStack)); - echo "\t* token $closer converted from T_CLOSE_CURLY_BRACKET to T_CLOSE_OBJECT *".PHP_EOL; - } - - for ($x = ($i + 1); $x < $closer; $x++) { - $this->tokens[$x]['conditions'][$i] = T_OBJECT; - ksort($this->tokens[$x]['conditions'], SORT_NUMERIC); - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$x]['type']; - echo str_repeat("\t", count($classStack)); - echo "\t\t* added T_OBJECT condition to $x ($type) *".PHP_EOL; - } - } - } else if ($this->tokens[$i]['code'] === T_CLOSE_OBJECT) { - $opener = array_pop($classStack); - } else if ($this->tokens[$i]['code'] === T_COLON) { - // If it is a scope opener, it belongs to a - // DEFAULT or CASE statement. - if (isset($this->tokens[$i]['scope_condition']) === true) { - continue; - } - - // Make sure this is not part of an inline IF statement. - for ($x = ($i - 1); $x >= 0; $x--) { - if ($this->tokens[$x]['code'] === T_INLINE_THEN) { - $this->tokens[$i]['code'] = T_INLINE_ELSE; - $this->tokens[$i]['type'] = 'T_INLINE_ELSE'; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", count($classStack)); - echo "\t* token $i converted from T_COLON to T_INLINE_THEN *".PHP_EOL; - } - - continue(2); - } else if ($this->tokens[$x]['line'] < $this->tokens[$i]['line']) { - break; - } - } - - // The string to the left of the colon is either a property or label. - for ($label = ($i - 1); $label >= 0; $label--) { - if (isset(Util\Tokens::$emptyTokens[$this->tokens[$label]['code']]) === false) { - break; - } - } - - if ($this->tokens[$label]['code'] !== T_STRING - && $this->tokens[$label]['code'] !== T_CONSTANT_ENCAPSED_STRING - ) { - continue; - } - - if (empty($classStack) === false) { - $this->tokens[$label]['code'] = T_PROPERTY; - $this->tokens[$label]['type'] = 'T_PROPERTY'; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", count($classStack)); - echo "\t* token $label converted from T_STRING to T_PROPERTY *".PHP_EOL; - } - } else { - $this->tokens[$label]['code'] = T_LABEL; - $this->tokens[$label]['type'] = 'T_LABEL'; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", count($classStack)); - echo "\t* token $label converted from T_STRING to T_LABEL *".PHP_EOL; - } - }//end if - }//end if - }//end for - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t*** END ADDITIONAL JS PROCESSING ***".PHP_EOL; - } - - }//end processAdditional() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Tokenizers/PHP.php b/vendor/squizlabs/php_codesniffer/src/Tokenizers/PHP.php deleted file mode 100644 index 1ba2636..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Tokenizers/PHP.php +++ /dev/null @@ -1,3289 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tokenizers; - -use PHP_CodeSniffer\Util; - -class PHP extends Tokenizer -{ - - /** - * A list of tokens that are allowed to open a scope. - * - * This array also contains information about what kind of token the scope - * opener uses to open and close the scope, if the token strictly requires - * an opener, if the token can share a scope closer, and who it can be shared - * with. An example of a token that shares a scope closer is a CASE scope. - * - * @var array - */ - public $scopeOpeners = [ - T_IF => [ - 'start' => [ - T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET, - T_COLON => T_COLON, - ], - 'end' => [ - T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET, - T_ENDIF => T_ENDIF, - T_ELSE => T_ELSE, - T_ELSEIF => T_ELSEIF, - ], - 'strict' => false, - 'shared' => false, - 'with' => [ - T_ELSE => T_ELSE, - T_ELSEIF => T_ELSEIF, - ], - ], - T_TRY => [ - 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], - 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], - 'strict' => true, - 'shared' => false, - 'with' => [], - ], - T_CATCH => [ - 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], - 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], - 'strict' => true, - 'shared' => false, - 'with' => [], - ], - T_FINALLY => [ - 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], - 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], - 'strict' => true, - 'shared' => false, - 'with' => [], - ], - T_ELSE => [ - 'start' => [ - T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET, - T_COLON => T_COLON, - ], - 'end' => [ - T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET, - T_ENDIF => T_ENDIF, - ], - 'strict' => false, - 'shared' => false, - 'with' => [ - T_IF => T_IF, - T_ELSEIF => T_ELSEIF, - ], - ], - T_ELSEIF => [ - 'start' => [ - T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET, - T_COLON => T_COLON, - ], - 'end' => [ - T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET, - T_ENDIF => T_ENDIF, - T_ELSE => T_ELSE, - T_ELSEIF => T_ELSEIF, - ], - 'strict' => false, - 'shared' => false, - 'with' => [ - T_IF => T_IF, - T_ELSE => T_ELSE, - ], - ], - T_FOR => [ - 'start' => [ - T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET, - T_COLON => T_COLON, - ], - 'end' => [ - T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET, - T_ENDFOR => T_ENDFOR, - ], - 'strict' => false, - 'shared' => false, - 'with' => [], - ], - T_FOREACH => [ - 'start' => [ - T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET, - T_COLON => T_COLON, - ], - 'end' => [ - T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET, - T_ENDFOREACH => T_ENDFOREACH, - ], - 'strict' => false, - 'shared' => false, - 'with' => [], - ], - T_INTERFACE => [ - 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], - 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], - 'strict' => true, - 'shared' => false, - 'with' => [], - ], - T_FUNCTION => [ - 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], - 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], - 'strict' => true, - 'shared' => false, - 'with' => [], - ], - T_CLASS => [ - 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], - 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], - 'strict' => true, - 'shared' => false, - 'with' => [], - ], - T_TRAIT => [ - 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], - 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], - 'strict' => true, - 'shared' => false, - 'with' => [], - ], - T_USE => [ - 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], - 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], - 'strict' => false, - 'shared' => false, - 'with' => [], - ], - T_DECLARE => [ - 'start' => [ - T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET, - T_COLON => T_COLON, - ], - 'end' => [ - T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET, - T_ENDDECLARE => T_ENDDECLARE, - ], - 'strict' => false, - 'shared' => false, - 'with' => [], - ], - T_NAMESPACE => [ - 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], - 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], - 'strict' => false, - 'shared' => false, - 'with' => [], - ], - T_WHILE => [ - 'start' => [ - T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET, - T_COLON => T_COLON, - ], - 'end' => [ - T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET, - T_ENDWHILE => T_ENDWHILE, - ], - 'strict' => false, - 'shared' => false, - 'with' => [], - ], - T_DO => [ - 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], - 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], - 'strict' => true, - 'shared' => false, - 'with' => [], - ], - T_SWITCH => [ - 'start' => [ - T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET, - T_COLON => T_COLON, - ], - 'end' => [ - T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET, - T_ENDSWITCH => T_ENDSWITCH, - ], - 'strict' => true, - 'shared' => false, - 'with' => [], - ], - T_CASE => [ - 'start' => [ - T_COLON => T_COLON, - T_SEMICOLON => T_SEMICOLON, - ], - 'end' => [ - T_BREAK => T_BREAK, - T_RETURN => T_RETURN, - T_CONTINUE => T_CONTINUE, - T_THROW => T_THROW, - T_EXIT => T_EXIT, - ], - 'strict' => true, - 'shared' => true, - 'with' => [ - T_DEFAULT => T_DEFAULT, - T_CASE => T_CASE, - T_SWITCH => T_SWITCH, - ], - ], - T_DEFAULT => [ - 'start' => [ - T_COLON => T_COLON, - T_SEMICOLON => T_SEMICOLON, - ], - 'end' => [ - T_BREAK => T_BREAK, - T_RETURN => T_RETURN, - T_CONTINUE => T_CONTINUE, - T_THROW => T_THROW, - T_EXIT => T_EXIT, - ], - 'strict' => true, - 'shared' => true, - 'with' => [ - T_CASE => T_CASE, - T_SWITCH => T_SWITCH, - ], - ], - T_MATCH => [ - 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], - 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], - 'strict' => true, - 'shared' => false, - 'with' => [], - ], - T_START_HEREDOC => [ - 'start' => [T_START_HEREDOC => T_START_HEREDOC], - 'end' => [T_END_HEREDOC => T_END_HEREDOC], - 'strict' => true, - 'shared' => false, - 'with' => [], - ], - T_START_NOWDOC => [ - 'start' => [T_START_NOWDOC => T_START_NOWDOC], - 'end' => [T_END_NOWDOC => T_END_NOWDOC], - 'strict' => true, - 'shared' => false, - 'with' => [], - ], - ]; - - /** - * A list of tokens that end the scope. - * - * This array is just a unique collection of the end tokens - * from the scopeOpeners array. The data is duplicated here to - * save time during parsing of the file. - * - * @var array - */ - public $endScopeTokens = [ - T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET, - T_ENDIF => T_ENDIF, - T_ENDFOR => T_ENDFOR, - T_ENDFOREACH => T_ENDFOREACH, - T_ENDWHILE => T_ENDWHILE, - T_ENDSWITCH => T_ENDSWITCH, - T_ENDDECLARE => T_ENDDECLARE, - T_BREAK => T_BREAK, - T_END_HEREDOC => T_END_HEREDOC, - T_END_NOWDOC => T_END_NOWDOC, - ]; - - /** - * Known lengths of tokens. - * - * @var array - */ - public $knownLengths = [ - T_ABSTRACT => 8, - T_AND_EQUAL => 2, - T_ARRAY => 5, - T_AS => 2, - T_BOOLEAN_AND => 2, - T_BOOLEAN_OR => 2, - T_BREAK => 5, - T_CALLABLE => 8, - T_CASE => 4, - T_CATCH => 5, - T_CLASS => 5, - T_CLASS_C => 9, - T_CLONE => 5, - T_CONCAT_EQUAL => 2, - T_CONST => 5, - T_CONTINUE => 8, - T_CURLY_OPEN => 2, - T_DEC => 2, - T_DECLARE => 7, - T_DEFAULT => 7, - T_DIR => 7, - T_DIV_EQUAL => 2, - T_DO => 2, - T_DOLLAR_OPEN_CURLY_BRACES => 2, - T_DOUBLE_ARROW => 2, - T_DOUBLE_COLON => 2, - T_ECHO => 4, - T_ELLIPSIS => 3, - T_ELSE => 4, - T_ELSEIF => 6, - T_EMPTY => 5, - T_ENDDECLARE => 10, - T_ENDFOR => 6, - T_ENDFOREACH => 10, - T_ENDIF => 5, - T_ENDSWITCH => 9, - T_ENDWHILE => 8, - T_EVAL => 4, - T_EXTENDS => 7, - T_FILE => 8, - T_FINAL => 5, - T_FINALLY => 7, - T_FN => 2, - T_FOR => 3, - T_FOREACH => 7, - T_FUNCTION => 8, - T_FUNC_C => 12, - T_GLOBAL => 6, - T_GOTO => 4, - T_HALT_COMPILER => 15, - T_IF => 2, - T_IMPLEMENTS => 10, - T_INC => 2, - T_INCLUDE => 7, - T_INCLUDE_ONCE => 12, - T_INSTANCEOF => 10, - T_INSTEADOF => 9, - T_INTERFACE => 9, - T_ISSET => 5, - T_IS_EQUAL => 2, - T_IS_GREATER_OR_EQUAL => 2, - T_IS_IDENTICAL => 3, - T_IS_NOT_EQUAL => 2, - T_IS_NOT_IDENTICAL => 3, - T_IS_SMALLER_OR_EQUAL => 2, - T_LINE => 8, - T_LIST => 4, - T_LOGICAL_AND => 3, - T_LOGICAL_OR => 2, - T_LOGICAL_XOR => 3, - T_MATCH => 5, - T_MATCH_ARROW => 2, - T_MATCH_DEFAULT => 7, - T_METHOD_C => 10, - T_MINUS_EQUAL => 2, - T_POW_EQUAL => 3, - T_MOD_EQUAL => 2, - T_MUL_EQUAL => 2, - T_NAMESPACE => 9, - T_NS_C => 13, - T_NS_SEPARATOR => 1, - T_NEW => 3, - T_NULLSAFE_OBJECT_OPERATOR => 3, - T_OBJECT_OPERATOR => 2, - T_OPEN_TAG_WITH_ECHO => 3, - T_OR_EQUAL => 2, - T_PLUS_EQUAL => 2, - T_PRINT => 5, - T_PRIVATE => 7, - T_PUBLIC => 6, - T_PROTECTED => 9, - T_REQUIRE => 7, - T_REQUIRE_ONCE => 12, - T_RETURN => 6, - T_STATIC => 6, - T_SWITCH => 6, - T_THROW => 5, - T_TRAIT => 5, - T_TRAIT_C => 9, - T_TRY => 3, - T_UNSET => 5, - T_USE => 3, - T_VAR => 3, - T_WHILE => 5, - T_XOR_EQUAL => 2, - T_YIELD => 5, - T_OPEN_CURLY_BRACKET => 1, - T_CLOSE_CURLY_BRACKET => 1, - T_OPEN_SQUARE_BRACKET => 1, - T_CLOSE_SQUARE_BRACKET => 1, - T_OPEN_PARENTHESIS => 1, - T_CLOSE_PARENTHESIS => 1, - T_COLON => 1, - T_STRING_CONCAT => 1, - T_INLINE_THEN => 1, - T_INLINE_ELSE => 1, - T_NULLABLE => 1, - T_NULL => 4, - T_FALSE => 5, - T_TRUE => 4, - T_SEMICOLON => 1, - T_EQUAL => 1, - T_MULTIPLY => 1, - T_DIVIDE => 1, - T_PLUS => 1, - T_MINUS => 1, - T_MODULUS => 1, - T_POW => 2, - T_SPACESHIP => 3, - T_COALESCE => 2, - T_COALESCE_EQUAL => 3, - T_BITWISE_AND => 1, - T_BITWISE_OR => 1, - T_BITWISE_XOR => 1, - T_SL => 2, - T_SR => 2, - T_SL_EQUAL => 3, - T_SR_EQUAL => 3, - T_GREATER_THAN => 1, - T_LESS_THAN => 1, - T_BOOLEAN_NOT => 1, - T_SELF => 4, - T_PARENT => 6, - T_COMMA => 1, - T_THIS => 4, - T_CLOSURE => 8, - T_BACKTICK => 1, - T_OPEN_SHORT_ARRAY => 1, - T_CLOSE_SHORT_ARRAY => 1, - T_TYPE_UNION => 1, - ]; - - /** - * Contexts in which keywords should always be tokenized as T_STRING. - * - * @var array - */ - protected $tstringContexts = [ - T_OBJECT_OPERATOR => true, - T_NULLSAFE_OBJECT_OPERATOR => true, - T_FUNCTION => true, - T_CLASS => true, - T_INTERFACE => true, - T_TRAIT => true, - T_EXTENDS => true, - T_IMPLEMENTS => true, - T_ATTRIBUTE => true, - T_NEW => true, - T_CONST => true, - T_NS_SEPARATOR => true, - T_USE => true, - T_NAMESPACE => true, - T_PAAMAYIM_NEKUDOTAYIM => true, - ]; - - /** - * A cache of different token types, resolved into arrays. - * - * @var array - * @see standardiseToken() - */ - private static $resolveTokenCache = []; - - - /** - * Creates an array of tokens when given some PHP code. - * - * Starts by using token_get_all() but does a lot of extra processing - * to insert information about the context of the token. - * - * @param string $string The string to tokenize. - * - * @return array - */ - protected function tokenize($string) - { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t*** START PHP TOKENIZING ***".PHP_EOL; - $isWin = false; - if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { - $isWin = true; - } - } - - $tokens = @token_get_all($string); - $finalTokens = []; - - $newStackPtr = 0; - $numTokens = count($tokens); - $lastNotEmptyToken = 0; - - $insideInlineIf = []; - $insideUseGroup = false; - - $commentTokenizer = new Comment(); - - for ($stackPtr = 0; $stackPtr < $numTokens; $stackPtr++) { - // Special case for tokens we have needed to blank out. - if ($tokens[$stackPtr] === null) { - continue; - } - - $token = (array) $tokens[$stackPtr]; - $tokenIsArray = isset($token[1]); - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - if ($tokenIsArray === true) { - $type = Util\Tokens::tokenName($token[0]); - $content = Util\Common::prepareForOutput($token[1]); - } else { - $newToken = self::resolveSimpleToken($token[0]); - $type = $newToken['type']; - $content = Util\Common::prepareForOutput($token[0]); - } - - echo "\tProcess token "; - if ($tokenIsArray === true) { - echo "[$stackPtr]"; - } else { - echo " $stackPtr "; - } - - echo ": $type => $content"; - }//end if - - if ($newStackPtr > 0 - && isset(Util\Tokens::$emptyTokens[$finalTokens[($newStackPtr - 1)]['code']]) === false - ) { - $lastNotEmptyToken = ($newStackPtr - 1); - } - - /* - If we are using \r\n newline characters, the \r and \n are sometimes - split over two tokens. This normally occurs after comments. We need - to merge these two characters together so that our line endings are - consistent for all lines. - */ - - if ($tokenIsArray === true && substr($token[1], -1) === "\r") { - if (isset($tokens[($stackPtr + 1)]) === true - && is_array($tokens[($stackPtr + 1)]) === true - && $tokens[($stackPtr + 1)][1][0] === "\n" - ) { - $token[1] .= "\n"; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - if ($isWin === true) { - echo '\n'; - } else { - echo "\033[30;1m\\n\033[0m"; - } - } - - if ($tokens[($stackPtr + 1)][1] === "\n") { - // This token's content has been merged into the previous, - // so we can skip it. - $tokens[($stackPtr + 1)] = ''; - } else { - $tokens[($stackPtr + 1)][1] = substr($tokens[($stackPtr + 1)][1], 1); - } - } - }//end if - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo PHP_EOL; - } - - /* - Parse doc blocks into something that can be easily iterated over. - */ - - if ($tokenIsArray === true - && ($token[0] === T_DOC_COMMENT - || ($token[0] === T_COMMENT && strpos($token[1], '/**') === 0)) - ) { - $commentTokens = $commentTokenizer->tokenizeString($token[1], $this->eolChar, $newStackPtr); - foreach ($commentTokens as $commentToken) { - $finalTokens[$newStackPtr] = $commentToken; - $newStackPtr++; - } - - continue; - } - - /* - PHP 8 tokenizes a new line after a slash and hash comment to the next whitespace token. - */ - - if (PHP_VERSION_ID >= 80000 - && $tokenIsArray === true - && ($token[0] === T_COMMENT && (strpos($token[1], '//') === 0 || strpos($token[1], '#') === 0)) - && isset($tokens[($stackPtr + 1)]) === true - && is_array($tokens[($stackPtr + 1)]) === true - && $tokens[($stackPtr + 1)][0] === T_WHITESPACE - ) { - $nextToken = $tokens[($stackPtr + 1)]; - - // If the next token is a single new line, merge it into the comment token - // and set to it up to be skipped. - if ($nextToken[1] === "\n" || $nextToken[1] === "\r\n" || $nextToken[1] === "\n\r") { - $token[1] .= $nextToken[1]; - $tokens[($stackPtr + 1)] = null; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* merged newline after comment into comment token $stackPtr".PHP_EOL; - } - } else { - // This may be a whitespace token consisting of multiple new lines. - if (strpos($nextToken[1], "\r\n") === 0) { - $token[1] .= "\r\n"; - $tokens[($stackPtr + 1)][1] = substr($nextToken[1], 2); - } else if (strpos($nextToken[1], "\n\r") === 0) { - $token[1] .= "\n\r"; - $tokens[($stackPtr + 1)][1] = substr($nextToken[1], 2); - } else if (strpos($nextToken[1], "\n") === 0) { - $token[1] .= "\n"; - $tokens[($stackPtr + 1)][1] = substr($nextToken[1], 1); - } - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* stripped first newline after comment and added it to comment token $stackPtr".PHP_EOL; - } - }//end if - }//end if - - /* - PHP 8.1 introduced two dedicated tokens for the & character. - Retokenizing both of these to T_BITWISE_AND, which is the - token PHPCS already tokenized them as. - */ - - if ($tokenIsArray === true - && ($token[0] === T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG - || $token[0] === T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG) - ) { - $finalTokens[$newStackPtr] = [ - 'code' => T_BITWISE_AND, - 'type' => 'T_BITWISE_AND', - 'content' => $token[1], - ]; - $newStackPtr++; - continue; - } - - /* - If this is a double quoted string, PHP will tokenize the whole - thing which causes problems with the scope map when braces are - within the string. So we need to merge the tokens together to - provide a single string. - */ - - if ($tokenIsArray === false && ($token[0] === '"' || $token[0] === 'b"')) { - // Binary casts need a special token. - if ($token[0] === 'b"') { - $finalTokens[$newStackPtr] = [ - 'code' => T_BINARY_CAST, - 'type' => 'T_BINARY_CAST', - 'content' => 'b', - ]; - $newStackPtr++; - } - - $tokenContent = '"'; - $nestedVars = []; - for ($i = ($stackPtr + 1); $i < $numTokens; $i++) { - $subToken = (array) $tokens[$i]; - $subTokenIsArray = isset($subToken[1]); - - if ($subTokenIsArray === true) { - $tokenContent .= $subToken[1]; - if ($subToken[1] === '{' - && $subToken[0] !== T_ENCAPSED_AND_WHITESPACE - ) { - $nestedVars[] = $i; - } - } else { - $tokenContent .= $subToken[0]; - if ($subToken[0] === '}') { - array_pop($nestedVars); - } - } - - if ($subTokenIsArray === false - && $subToken[0] === '"' - && empty($nestedVars) === true - ) { - // We found the other end of the double quoted string. - break; - } - }//end for - - $stackPtr = $i; - - // Convert each line within the double quoted string to a - // new token, so it conforms with other multiple line tokens. - $tokenLines = explode($this->eolChar, $tokenContent); - $numLines = count($tokenLines); - $newToken = []; - - for ($j = 0; $j < $numLines; $j++) { - $newToken['content'] = $tokenLines[$j]; - if ($j === ($numLines - 1)) { - if ($tokenLines[$j] === '') { - break; - } - } else { - $newToken['content'] .= $this->eolChar; - } - - $newToken['code'] = T_DOUBLE_QUOTED_STRING; - $newToken['type'] = 'T_DOUBLE_QUOTED_STRING'; - $finalTokens[$newStackPtr] = $newToken; - $newStackPtr++; - } - - // Continue, as we're done with this token. - continue; - }//end if - - /* - Detect binary casting and assign the casts their own token. - */ - - if ($tokenIsArray === true - && $token[0] === T_CONSTANT_ENCAPSED_STRING - && (substr($token[1], 0, 2) === 'b"' - || substr($token[1], 0, 2) === "b'") - ) { - $finalTokens[$newStackPtr] = [ - 'code' => T_BINARY_CAST, - 'type' => 'T_BINARY_CAST', - 'content' => 'b', - ]; - $newStackPtr++; - $token[1] = substr($token[1], 1); - } - - if ($tokenIsArray === true - && $token[0] === T_STRING_CAST - && preg_match('`^\(\s*binary\s*\)$`i', $token[1]) === 1 - ) { - $finalTokens[$newStackPtr] = [ - 'code' => T_BINARY_CAST, - 'type' => 'T_BINARY_CAST', - 'content' => $token[1], - ]; - $newStackPtr++; - continue; - } - - /* - If this is a heredoc, PHP will tokenize the whole - thing which causes problems when heredocs don't - contain real PHP code, which is almost never. - We want to leave the start and end heredoc tokens - alone though. - */ - - if ($tokenIsArray === true && $token[0] === T_START_HEREDOC) { - // Add the start heredoc token to the final array. - $finalTokens[$newStackPtr] = self::standardiseToken($token); - - // Check if this is actually a nowdoc and use a different token - // to help the sniffs. - $nowdoc = false; - if (strpos($token[1], "'") !== false) { - $finalTokens[$newStackPtr]['code'] = T_START_NOWDOC; - $finalTokens[$newStackPtr]['type'] = 'T_START_NOWDOC'; - $nowdoc = true; - } - - $tokenContent = ''; - for ($i = ($stackPtr + 1); $i < $numTokens; $i++) { - $subTokenIsArray = is_array($tokens[$i]); - if ($subTokenIsArray === true - && $tokens[$i][0] === T_END_HEREDOC - ) { - // We found the other end of the heredoc. - break; - } - - if ($subTokenIsArray === true) { - $tokenContent .= $tokens[$i][1]; - } else { - $tokenContent .= $tokens[$i]; - } - } - - if ($i === $numTokens) { - // We got to the end of the file and never - // found the closing token, so this probably wasn't - // a heredoc. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $finalTokens[$newStackPtr]['type']; - echo "\t\t* failed to find the end of the here/nowdoc".PHP_EOL; - echo "\t\t* token $stackPtr changed from $type to T_STRING".PHP_EOL; - } - - $finalTokens[$newStackPtr]['code'] = T_STRING; - $finalTokens[$newStackPtr]['type'] = 'T_STRING'; - $newStackPtr++; - continue; - } - - $stackPtr = $i; - $newStackPtr++; - - // Convert each line within the heredoc to a - // new token, so it conforms with other multiple line tokens. - $tokenLines = explode($this->eolChar, $tokenContent); - $numLines = count($tokenLines); - $newToken = []; - - for ($j = 0; $j < $numLines; $j++) { - $newToken['content'] = $tokenLines[$j]; - if ($j === ($numLines - 1)) { - if ($tokenLines[$j] === '') { - break; - } - } else { - $newToken['content'] .= $this->eolChar; - } - - if ($nowdoc === true) { - $newToken['code'] = T_NOWDOC; - $newToken['type'] = 'T_NOWDOC'; - } else { - $newToken['code'] = T_HEREDOC; - $newToken['type'] = 'T_HEREDOC'; - } - - $finalTokens[$newStackPtr] = $newToken; - $newStackPtr++; - }//end for - - // Add the end heredoc token to the final array. - $finalTokens[$newStackPtr] = self::standardiseToken($tokens[$stackPtr]); - - if ($nowdoc === true) { - $finalTokens[$newStackPtr]['code'] = T_END_NOWDOC; - $finalTokens[$newStackPtr]['type'] = 'T_END_NOWDOC'; - } - - $newStackPtr++; - - // Continue, as we're done with this token. - continue; - }//end if - - /* - As of PHP 8.0 fully qualified, partially qualified and namespace relative - identifier names are tokenized differently. - This "undoes" the new tokenization so the tokenization will be the same in - in PHP 5, 7 and 8. - */ - - if (PHP_VERSION_ID >= 80000 - && $tokenIsArray === true - && ($token[0] === T_NAME_QUALIFIED - || $token[0] === T_NAME_FULLY_QUALIFIED - || $token[0] === T_NAME_RELATIVE) - ) { - $name = $token[1]; - - if ($token[0] === T_NAME_FULLY_QUALIFIED) { - $newToken = []; - $newToken['code'] = T_NS_SEPARATOR; - $newToken['type'] = 'T_NS_SEPARATOR'; - $newToken['content'] = '\\'; - $finalTokens[$newStackPtr] = $newToken; - ++$newStackPtr; - - $name = ltrim($name, '\\'); - } - - if ($token[0] === T_NAME_RELATIVE) { - $newToken = []; - $newToken['code'] = T_NAMESPACE; - $newToken['type'] = 'T_NAMESPACE'; - $newToken['content'] = substr($name, 0, 9); - $finalTokens[$newStackPtr] = $newToken; - ++$newStackPtr; - - $newToken = []; - $newToken['code'] = T_NS_SEPARATOR; - $newToken['type'] = 'T_NS_SEPARATOR'; - $newToken['content'] = '\\'; - $finalTokens[$newStackPtr] = $newToken; - ++$newStackPtr; - - $name = substr($name, 10); - } - - $parts = explode('\\', $name); - $partCount = count($parts); - $lastPart = ($partCount - 1); - - foreach ($parts as $i => $part) { - $newToken = []; - $newToken['code'] = T_STRING; - $newToken['type'] = 'T_STRING'; - $newToken['content'] = $part; - $finalTokens[$newStackPtr] = $newToken; - ++$newStackPtr; - - if ($i !== $lastPart) { - $newToken = []; - $newToken['code'] = T_NS_SEPARATOR; - $newToken['type'] = 'T_NS_SEPARATOR'; - $newToken['content'] = '\\'; - $finalTokens[$newStackPtr] = $newToken; - ++$newStackPtr; - } - } - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = Util\Tokens::tokenName($token[0]); - $content = Util\Common::prepareForOutput($token[1]); - echo "\t\t* token $stackPtr split into individual tokens; was: $type => $content".PHP_EOL; - } - - continue; - }//end if - - /* - PHP 8.0 Attributes - */ - - if (PHP_VERSION_ID < 80000 - && $token[0] === T_COMMENT - && strpos($token[1], '#[') === 0 - ) { - $subTokens = $this->parsePhpAttribute($tokens, $stackPtr); - if ($subTokens !== null) { - array_splice($tokens, $stackPtr, 1, $subTokens); - $numTokens = count($tokens); - - $tokenIsArray = true; - $token = $tokens[$stackPtr]; - } else { - $token[0] = T_ATTRIBUTE; - } - } - - if ($tokenIsArray === true - && $token[0] === T_ATTRIBUTE - ) { - // Go looking for the close bracket. - $bracketCloser = $this->findCloser($tokens, ($stackPtr + 1), ['[', '#['], ']'); - - $newToken = []; - $newToken['code'] = T_ATTRIBUTE; - $newToken['type'] = 'T_ATTRIBUTE'; - $newToken['content'] = '#['; - $finalTokens[$newStackPtr] = $newToken; - - $tokens[$bracketCloser] = []; - $tokens[$bracketCloser][0] = T_ATTRIBUTE_END; - $tokens[$bracketCloser][1] = ']'; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token $bracketCloser changed from T_CLOSE_SQUARE_BRACKET to T_ATTRIBUTE_END".PHP_EOL; - } - - $newStackPtr++; - continue; - }//end if - - /* - Tokenize the parameter labels for PHP 8.0 named parameters as a special T_PARAM_NAME - token and ensure that the colon after it is always T_COLON. - */ - - if ($tokenIsArray === true - && ($token[0] === T_STRING - || preg_match('`^[a-zA-Z_\x80-\xff]`', $token[1]) === 1) - ) { - // Get the next non-empty token. - for ($i = ($stackPtr + 1); $i < $numTokens; $i++) { - if (is_array($tokens[$i]) === false - || isset(Util\Tokens::$emptyTokens[$tokens[$i][0]]) === false - ) { - break; - } - } - - if (isset($tokens[$i]) === true - && is_array($tokens[$i]) === false - && $tokens[$i] === ':' - ) { - // Get the previous non-empty token. - for ($j = ($stackPtr - 1); $j > 0; $j--) { - if (is_array($tokens[$j]) === false - || isset(Util\Tokens::$emptyTokens[$tokens[$j][0]]) === false - ) { - break; - } - } - - if (is_array($tokens[$j]) === false - && ($tokens[$j] === '(' - || $tokens[$j] === ',') - ) { - $newToken = []; - $newToken['code'] = T_PARAM_NAME; - $newToken['type'] = 'T_PARAM_NAME'; - $newToken['content'] = $token[1]; - $finalTokens[$newStackPtr] = $newToken; - - $newStackPtr++; - - // Modify the original token stack so that future checks, like - // determining T_COLON vs T_INLINE_ELSE can handle this correctly. - $tokens[$stackPtr][0] = T_PARAM_NAME; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = Util\Tokens::tokenName($token[0]); - echo "\t\t* token $stackPtr changed from $type to T_PARAM_NAME".PHP_EOL; - } - - continue; - } - }//end if - }//end if - - /* - Before PHP 7.0, the "yield from" was tokenized as - T_YIELD, T_WHITESPACE and T_STRING. So look for - and change this token in earlier versions. - */ - - if (PHP_VERSION_ID < 70000 - && PHP_VERSION_ID >= 50500 - && $tokenIsArray === true - && $token[0] === T_YIELD - && isset($tokens[($stackPtr + 1)]) === true - && isset($tokens[($stackPtr + 2)]) === true - && $tokens[($stackPtr + 1)][0] === T_WHITESPACE - && $tokens[($stackPtr + 2)][0] === T_STRING - && strtolower($tokens[($stackPtr + 2)][1]) === 'from' - ) { - // Could be multi-line, so adjust the token stack. - $token[0] = T_YIELD_FROM; - $token[1] .= $tokens[($stackPtr + 1)][1].$tokens[($stackPtr + 2)][1]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - for ($i = ($stackPtr + 1); $i <= ($stackPtr + 2); $i++) { - $type = Util\Tokens::tokenName($tokens[$i][0]); - $content = Util\Common::prepareForOutput($tokens[$i][1]); - echo "\t\t* token $i merged into T_YIELD_FROM; was: $type => $content".PHP_EOL; - } - } - - $tokens[($stackPtr + 1)] = null; - $tokens[($stackPtr + 2)] = null; - } - - /* - Before PHP 5.5, the yield keyword was tokenized as - T_STRING. So look for and change this token in - earlier versions. - Checks also if it is just "yield" or "yield from". - */ - - if (PHP_VERSION_ID < 50500 - && $tokenIsArray === true - && $token[0] === T_STRING - && strtolower($token[1]) === 'yield' - ) { - if (isset($tokens[($stackPtr + 1)]) === true - && isset($tokens[($stackPtr + 2)]) === true - && $tokens[($stackPtr + 1)][0] === T_WHITESPACE - && $tokens[($stackPtr + 2)][0] === T_STRING - && strtolower($tokens[($stackPtr + 2)][1]) === 'from' - ) { - // Could be multi-line, so just just the token stack. - $token[0] = T_YIELD_FROM; - $token[1] .= $tokens[($stackPtr + 1)][1].$tokens[($stackPtr + 2)][1]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - for ($i = ($stackPtr + 1); $i <= ($stackPtr + 2); $i++) { - $type = Util\Tokens::tokenName($tokens[$i][0]); - $content = Util\Common::prepareForOutput($tokens[$i][1]); - echo "\t\t* token $i merged into T_YIELD_FROM; was: $type => $content".PHP_EOL; - } - } - - $tokens[($stackPtr + 1)] = null; - $tokens[($stackPtr + 2)] = null; - } else { - $newToken = []; - $newToken['code'] = T_YIELD; - $newToken['type'] = 'T_YIELD'; - $newToken['content'] = $token[1]; - $finalTokens[$newStackPtr] = $newToken; - - $newStackPtr++; - continue; - }//end if - }//end if - - /* - Before PHP 5.6, the ... operator was tokenized as three - T_STRING_CONCAT tokens in a row. So look for and combine - these tokens in earlier versions. - */ - - if ($tokenIsArray === false - && $token[0] === '.' - && isset($tokens[($stackPtr + 1)]) === true - && isset($tokens[($stackPtr + 2)]) === true - && $tokens[($stackPtr + 1)] === '.' - && $tokens[($stackPtr + 2)] === '.' - ) { - $newToken = []; - $newToken['code'] = T_ELLIPSIS; - $newToken['type'] = 'T_ELLIPSIS'; - $newToken['content'] = '...'; - $finalTokens[$newStackPtr] = $newToken; - - $newStackPtr++; - $stackPtr += 2; - continue; - } - - /* - Before PHP 5.6, the ** operator was tokenized as two - T_MULTIPLY tokens in a row. So look for and combine - these tokens in earlier versions. - */ - - if ($tokenIsArray === false - && $token[0] === '*' - && isset($tokens[($stackPtr + 1)]) === true - && $tokens[($stackPtr + 1)] === '*' - ) { - $newToken = []; - $newToken['code'] = T_POW; - $newToken['type'] = 'T_POW'; - $newToken['content'] = '**'; - $finalTokens[$newStackPtr] = $newToken; - - $newStackPtr++; - $stackPtr++; - continue; - } - - /* - Before PHP 5.6, the **= operator was tokenized as - T_MULTIPLY followed by T_MUL_EQUAL. So look for and combine - these tokens in earlier versions. - */ - - if ($tokenIsArray === false - && $token[0] === '*' - && isset($tokens[($stackPtr + 1)]) === true - && is_array($tokens[($stackPtr + 1)]) === true - && $tokens[($stackPtr + 1)][1] === '*=' - ) { - $newToken = []; - $newToken['code'] = T_POW_EQUAL; - $newToken['type'] = 'T_POW_EQUAL'; - $newToken['content'] = '**='; - $finalTokens[$newStackPtr] = $newToken; - - $newStackPtr++; - $stackPtr++; - continue; - } - - /* - Before PHP 7, the ??= operator was tokenized as - T_INLINE_THEN, T_INLINE_THEN, T_EQUAL. - Between PHP 7.0 and 7.3, the ??= operator was tokenized as - T_COALESCE, T_EQUAL. - So look for and combine these tokens in earlier versions. - */ - - if (($tokenIsArray === false - && $token[0] === '?' - && isset($tokens[($stackPtr + 1)]) === true - && $tokens[($stackPtr + 1)][0] === '?' - && isset($tokens[($stackPtr + 2)]) === true - && $tokens[($stackPtr + 2)][0] === '=') - || ($tokenIsArray === true - && $token[0] === T_COALESCE - && isset($tokens[($stackPtr + 1)]) === true - && $tokens[($stackPtr + 1)][0] === '=') - ) { - $newToken = []; - $newToken['code'] = T_COALESCE_EQUAL; - $newToken['type'] = 'T_COALESCE_EQUAL'; - $newToken['content'] = '??='; - $finalTokens[$newStackPtr] = $newToken; - - $newStackPtr++; - $stackPtr++; - - if ($tokenIsArray === false) { - // Pre PHP 7. - $stackPtr++; - } - - continue; - } - - /* - Before PHP 7, the ?? operator was tokenized as - T_INLINE_THEN followed by T_INLINE_THEN. - So look for and combine these tokens in earlier versions. - */ - - if ($tokenIsArray === false - && $token[0] === '?' - && isset($tokens[($stackPtr + 1)]) === true - && $tokens[($stackPtr + 1)][0] === '?' - ) { - $newToken = []; - $newToken['code'] = T_COALESCE; - $newToken['type'] = 'T_COALESCE'; - $newToken['content'] = '??'; - $finalTokens[$newStackPtr] = $newToken; - - $newStackPtr++; - $stackPtr++; - continue; - } - - /* - Before PHP 8, the ?-> operator was tokenized as - T_INLINE_THEN followed by T_OBJECT_OPERATOR. - So look for and combine these tokens in earlier versions. - */ - - if ($tokenIsArray === false - && $token[0] === '?' - && isset($tokens[($stackPtr + 1)]) === true - && is_array($tokens[($stackPtr + 1)]) === true - && $tokens[($stackPtr + 1)][0] === T_OBJECT_OPERATOR - ) { - $newToken = []; - $newToken['code'] = T_NULLSAFE_OBJECT_OPERATOR; - $newToken['type'] = 'T_NULLSAFE_OBJECT_OPERATOR'; - $newToken['content'] = '?->'; - $finalTokens[$newStackPtr] = $newToken; - - $newStackPtr++; - $stackPtr++; - continue; - } - - /* - Before PHP 7.4, underscores inside T_LNUMBER and T_DNUMBER - tokens split the token with a T_STRING. So look for - and change these tokens in earlier versions. - */ - - if (PHP_VERSION_ID < 70400 - && ($tokenIsArray === true - && ($token[0] === T_LNUMBER - || $token[0] === T_DNUMBER) - && isset($tokens[($stackPtr + 1)]) === true - && is_array($tokens[($stackPtr + 1)]) === true - && $tokens[($stackPtr + 1)][0] === T_STRING - && $tokens[($stackPtr + 1)][1][0] === '_') - ) { - $newContent = $token[1]; - $newType = $token[0]; - for ($i = ($stackPtr + 1); $i < $numTokens; $i++) { - if (is_array($tokens[$i]) === false) { - break; - } - - if ($tokens[$i][0] === T_LNUMBER - || $tokens[$i][0] === T_DNUMBER - ) { - $newContent .= $tokens[$i][1]; - continue; - } - - if ($tokens[$i][0] === T_STRING - && $tokens[$i][1][0] === '_' - && ((strpos($newContent, '0x') === 0 - && preg_match('`^((? PHP_INT_MAX) - || (stripos($newContent, '0b') === 0 && bindec(str_replace('_', '', $newContent)) > PHP_INT_MAX) - || (stripos($newContent, '0x') !== 0 - && stripos($newContent, 'e') !== false || strpos($newContent, '.') !== false) - || (strpos($newContent, '0') === 0 && stripos($newContent, '0x') !== 0 - && stripos($newContent, '0b') !== 0 && octdec(str_replace('_', '', $newContent)) > PHP_INT_MAX) - || (strpos($newContent, '0') !== 0 && str_replace('_', '', $newContent) > PHP_INT_MAX)) - ) { - $newType = T_DNUMBER; - } - - $newToken = []; - $newToken['code'] = $newType; - $newToken['type'] = Util\Tokens::tokenName($newType); - $newToken['content'] = $newContent; - $finalTokens[$newStackPtr] = $newToken; - - $newStackPtr++; - $stackPtr = ($i - 1); - continue; - }//end if - - /* - Backfill the T_MATCH token for PHP versions < 8.0 and - do initial correction for non-match expression T_MATCH tokens - to T_STRING for PHP >= 8.0. - A final check for non-match expression T_MATCH tokens is done - in PHP::processAdditional(). - */ - - if ($tokenIsArray === true - && (($token[0] === T_STRING - && strtolower($token[1]) === 'match') - || $token[0] === T_MATCH) - ) { - $isMatch = false; - for ($x = ($stackPtr + 1); $x < $numTokens; $x++) { - if (isset($tokens[$x][0], Util\Tokens::$emptyTokens[$tokens[$x][0]]) === true) { - continue; - } - - if ($tokens[$x] !== '(') { - // This is not a match expression. - break; - } - - if (isset($this->tstringContexts[$finalTokens[$lastNotEmptyToken]['code']]) === true) { - // Also not a match expression. - break; - } - - $isMatch = true; - break; - }//end for - - if ($isMatch === true && $token[0] === T_STRING) { - $newToken = []; - $newToken['code'] = T_MATCH; - $newToken['type'] = 'T_MATCH'; - $newToken['content'] = $token[1]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token $stackPtr changed from T_STRING to T_MATCH".PHP_EOL; - } - - $finalTokens[$newStackPtr] = $newToken; - $newStackPtr++; - continue; - } else if ($isMatch === false && $token[0] === T_MATCH) { - // PHP 8.0, match keyword, but not a match expression. - $newToken = []; - $newToken['code'] = T_STRING; - $newToken['type'] = 'T_STRING'; - $newToken['content'] = $token[1]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token $stackPtr changed from T_MATCH to T_STRING".PHP_EOL; - } - - $finalTokens[$newStackPtr] = $newToken; - $newStackPtr++; - continue; - }//end if - }//end if - - /* - Retokenize the T_DEFAULT in match control structures as T_MATCH_DEFAULT - to prevent scope being set and the scope for switch default statements - breaking. - */ - - if ($tokenIsArray === true - && $token[0] === T_DEFAULT - ) { - if (isset($this->tstringContexts[$finalTokens[$lastNotEmptyToken]['code']]) === false) { - for ($x = ($stackPtr + 1); $x < $numTokens; $x++) { - if ($tokens[$x] === ',') { - // Skip over potential trailing comma (supported in PHP). - continue; - } - - if (is_array($tokens[$x]) === false - || isset(Util\Tokens::$emptyTokens[$tokens[$x][0]]) === false - ) { - // Non-empty, non-comma content. - break; - } - } - - if (isset($tokens[$x]) === true - && is_array($tokens[$x]) === true - && $tokens[$x][0] === T_DOUBLE_ARROW - ) { - // Modify the original token stack for the double arrow so that - // future checks can disregard the double arrow token more easily. - // For match expression "case" statements, this is handled - // in PHP::processAdditional(). - $tokens[$x][0] = T_MATCH_ARROW; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token $x changed from T_DOUBLE_ARROW to T_MATCH_ARROW".PHP_EOL; - } - - $newToken = []; - $newToken['code'] = T_MATCH_DEFAULT; - $newToken['type'] = 'T_MATCH_DEFAULT'; - $newToken['content'] = $token[1]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token $stackPtr changed from T_DEFAULT to T_MATCH_DEFAULT".PHP_EOL; - } - - $finalTokens[$newStackPtr] = $newToken; - $newStackPtr++; - continue; - }//end if - } else { - // Definitely not the "default" keyword. - $newToken = []; - $newToken['code'] = T_STRING; - $newToken['type'] = 'T_STRING'; - $newToken['content'] = $token[1]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token $stackPtr changed from T_DEFAULT to T_STRING".PHP_EOL; - } - - $finalTokens[$newStackPtr] = $newToken; - $newStackPtr++; - continue; - }//end if - }//end if - - /* - Convert ? to T_NULLABLE OR T_INLINE_THEN - */ - - if ($tokenIsArray === false && $token[0] === '?') { - $newToken = []; - $newToken['content'] = '?'; - - /* - * Check if the next non-empty token is one of the tokens which can be used - * in type declarations. If not, it's definitely a ternary. - * At this point, the only token types which need to be taken into consideration - * as potential type declarations are identifier names, T_ARRAY, T_CALLABLE and T_NS_SEPARATOR. - */ - - $lastRelevantNonEmpty = null; - - for ($i = ($stackPtr + 1); $i < $numTokens; $i++) { - if (is_array($tokens[$i]) === true) { - $tokenType = $tokens[$i][0]; - } else { - $tokenType = $tokens[$i]; - } - - if (isset(Util\Tokens::$emptyTokens[$tokenType]) === true) { - continue; - } - - if ($tokenType === T_STRING - || $tokenType === T_NAME_FULLY_QUALIFIED - || $tokenType === T_NAME_RELATIVE - || $tokenType === T_NAME_QUALIFIED - || $tokenType === T_ARRAY - || $tokenType === T_NAMESPACE - || $tokenType === T_NS_SEPARATOR - ) { - $lastRelevantNonEmpty = $tokenType; - continue; - } - - if (($tokenType !== T_CALLABLE - && isset($lastRelevantNonEmpty) === false) - || ($lastRelevantNonEmpty === T_ARRAY - && $tokenType === '(') - || (($lastRelevantNonEmpty === T_STRING - || $lastRelevantNonEmpty === T_NAME_FULLY_QUALIFIED - || $lastRelevantNonEmpty === T_NAME_RELATIVE - || $lastRelevantNonEmpty === T_NAME_QUALIFIED) - && ($tokenType === T_DOUBLE_COLON - || $tokenType === '(' - || $tokenType === ':')) - ) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token $stackPtr changed from ? to T_INLINE_THEN".PHP_EOL; - } - - $newToken['code'] = T_INLINE_THEN; - $newToken['type'] = 'T_INLINE_THEN'; - - $insideInlineIf[] = $stackPtr; - - $finalTokens[$newStackPtr] = $newToken; - $newStackPtr++; - continue 2; - } - - break; - }//end for - - /* - * This can still be a nullable type or a ternary. - * Do additional checking. - */ - - $prevNonEmpty = null; - $lastSeenNonEmpty = null; - - for ($i = ($stackPtr - 1); $i >= 0; $i--) { - if (is_array($tokens[$i]) === true) { - $tokenType = $tokens[$i][0]; - } else { - $tokenType = $tokens[$i]; - } - - if ($tokenType === T_STATIC - && ($lastSeenNonEmpty === T_DOUBLE_COLON - || $lastSeenNonEmpty === '(') - ) { - $lastSeenNonEmpty = $tokenType; - continue; - } - - if ($prevNonEmpty === null - && isset(Util\Tokens::$emptyTokens[$tokenType]) === false - ) { - // Found the previous non-empty token. - if ($tokenType === ':' || $tokenType === ',' || $tokenType === T_ATTRIBUTE_END) { - $newToken['code'] = T_NULLABLE; - $newToken['type'] = 'T_NULLABLE'; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token $stackPtr changed from ? to T_NULLABLE".PHP_EOL; - } - - break; - } - - $prevNonEmpty = $tokenType; - } - - if ($tokenType === T_FUNCTION - || $tokenType === T_FN - || isset(Util\Tokens::$methodPrefixes[$tokenType]) === true - || $tokenType === T_VAR - ) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token $stackPtr changed from ? to T_NULLABLE".PHP_EOL; - } - - $newToken['code'] = T_NULLABLE; - $newToken['type'] = 'T_NULLABLE'; - break; - } else if (in_array($tokenType, [T_DOUBLE_ARROW, T_OPEN_TAG, T_OPEN_TAG_WITH_ECHO, '=', '{', ';'], true) === true) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token $stackPtr changed from ? to T_INLINE_THEN".PHP_EOL; - } - - $newToken['code'] = T_INLINE_THEN; - $newToken['type'] = 'T_INLINE_THEN'; - - $insideInlineIf[] = $stackPtr; - break; - } - - if (isset(Util\Tokens::$emptyTokens[$tokenType]) === false) { - $lastSeenNonEmpty = $tokenType; - } - }//end for - - $finalTokens[$newStackPtr] = $newToken; - $newStackPtr++; - continue; - }//end if - - /* - Tokens after a double colon may look like scope openers, - such as when writing code like Foo::NAMESPACE, but they are - only ever variables or strings. - */ - - if ($stackPtr > 1 - && (is_array($tokens[($stackPtr - 1)]) === true - && $tokens[($stackPtr - 1)][0] === T_PAAMAYIM_NEKUDOTAYIM) - && $tokenIsArray === true - && $token[0] !== T_STRING - && $token[0] !== T_VARIABLE - && $token[0] !== T_DOLLAR - && isset(Util\Tokens::$emptyTokens[$token[0]]) === false - ) { - $newToken = []; - $newToken['code'] = T_STRING; - $newToken['type'] = 'T_STRING'; - $newToken['content'] = $token[1]; - $finalTokens[$newStackPtr] = $newToken; - - $newStackPtr++; - continue; - } - - /* - Backfill the T_FN token for PHP versions < 7.4. - */ - - if ($tokenIsArray === true - && $token[0] === T_STRING - && strtolower($token[1]) === 'fn' - ) { - // Modify the original token stack so that - // future checks (like looking for T_NULLABLE) can - // detect the T_FN token more easily. - $tokens[$stackPtr][0] = T_FN; - $token[0] = T_FN; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token $stackPtr changed from T_STRING to T_FN".PHP_EOL; - } - } - - /* - The string-like token after a function keyword should always be - tokenized as T_STRING even if it appears to be a different token, - such as when writing code like: function default(): foo - so go forward and change the token type before it is processed. - - Note: this should not be done for `function Level\Name` within a - group use statement for the PHP 8 identifier name tokens as it - would interfere with the re-tokenization of those. - */ - - if ($tokenIsArray === true - && ($token[0] === T_FUNCTION - || $token[0] === T_FN) - && $finalTokens[$lastNotEmptyToken]['code'] !== T_USE - ) { - if ($token[0] === T_FUNCTION) { - for ($x = ($stackPtr + 1); $x < $numTokens; $x++) { - if (is_array($tokens[$x]) === false - || (isset(Util\Tokens::$emptyTokens[$tokens[$x][0]]) === false - && $tokens[$x][1] !== '&') - ) { - // Non-empty content. - break; - } - } - - if ($x < $numTokens - && is_array($tokens[$x]) === true - && $tokens[$x][0] !== T_STRING - && $tokens[$x][0] !== T_NAME_QUALIFIED - ) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $oldType = Util\Tokens::tokenName($tokens[$x][0]); - echo "\t\t* token $x changed from $oldType to T_STRING".PHP_EOL; - } - - $tokens[$x][0] = T_STRING; - } - }//end if - - /* - This is a special condition for T_ARRAY tokens used for - function return types. We want to keep the parenthesis map clean, - so let's tag these tokens as T_STRING. - */ - - // Go looking for the colon to start the return type hint. - // Start by finding the closing parenthesis of the function. - $parenthesisStack = []; - $parenthesisCloser = false; - for ($x = ($stackPtr + 1); $x < $numTokens; $x++) { - if (is_array($tokens[$x]) === false && $tokens[$x] === '(') { - $parenthesisStack[] = $x; - } else if (is_array($tokens[$x]) === false && $tokens[$x] === ')') { - array_pop($parenthesisStack); - if (empty($parenthesisStack) === true) { - $parenthesisCloser = $x; - break; - } - } - } - - if ($parenthesisCloser !== false) { - for ($x = ($parenthesisCloser + 1); $x < $numTokens; $x++) { - if (is_array($tokens[$x]) === false - || isset(Util\Tokens::$emptyTokens[$tokens[$x][0]]) === false - ) { - // Non-empty content. - if (is_array($tokens[$x]) === true && $tokens[$x][0] === T_USE) { - // Found a use statements, so search ahead for the closing parenthesis. - for ($x += 1; $x < $numTokens; $x++) { - if (is_array($tokens[$x]) === false && $tokens[$x] === ')') { - continue(2); - } - } - } - - break; - } - } - - if (isset($tokens[$x]) === true - && is_array($tokens[$x]) === false - && $tokens[$x] === ':' - ) { - $allowed = [ - T_STRING => T_STRING, - T_NAME_FULLY_QUALIFIED => T_NAME_FULLY_QUALIFIED, - T_NAME_RELATIVE => T_NAME_RELATIVE, - T_NAME_QUALIFIED => T_NAME_QUALIFIED, - T_ARRAY => T_ARRAY, - T_CALLABLE => T_CALLABLE, - T_SELF => T_SELF, - T_PARENT => T_PARENT, - T_NAMESPACE => T_NAMESPACE, - T_STATIC => T_STATIC, - T_NS_SEPARATOR => T_NS_SEPARATOR, - ]; - - $allowed += Util\Tokens::$emptyTokens; - - // Find the start of the return type. - for ($x += 1; $x < $numTokens; $x++) { - if (is_array($tokens[$x]) === true - && isset(Util\Tokens::$emptyTokens[$tokens[$x][0]]) === true - ) { - // Whitespace or comments before the return type. - continue; - } - - if (is_array($tokens[$x]) === false && $tokens[$x] === '?') { - // Found a nullable operator, so skip it. - // But also convert the token to save the tokenizer - // a bit of time later on. - $tokens[$x] = [ - T_NULLABLE, - '?', - ]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token $x changed from ? to T_NULLABLE".PHP_EOL; - } - - continue; - } - - break; - }//end for - }//end if - }//end if - }//end if - - /* - Before PHP 7, the <=> operator was tokenized as - T_IS_SMALLER_OR_EQUAL followed by T_GREATER_THAN. - So look for and combine these tokens in earlier versions. - */ - - if ($tokenIsArray === true - && $token[0] === T_IS_SMALLER_OR_EQUAL - && isset($tokens[($stackPtr + 1)]) === true - && $tokens[($stackPtr + 1)][0] === '>' - ) { - $newToken = []; - $newToken['code'] = T_SPACESHIP; - $newToken['type'] = 'T_SPACESHIP'; - $newToken['content'] = '<=>'; - $finalTokens[$newStackPtr] = $newToken; - - $newStackPtr++; - $stackPtr++; - continue; - } - - /* - PHP doesn't assign a token to goto labels, so we have to. - These are just string tokens with a single colon after them. Double - colons are already tokenized and so don't interfere with this check. - But we do have to account for CASE statements, that look just like - goto labels. - */ - - if ($tokenIsArray === true - && $token[0] === T_STRING - && isset($tokens[($stackPtr + 1)]) === true - && $tokens[($stackPtr + 1)] === ':' - && (is_array($tokens[($stackPtr - 1)]) === false - || $tokens[($stackPtr - 1)][0] !== T_PAAMAYIM_NEKUDOTAYIM) - ) { - $stopTokens = [ - T_CASE => true, - T_SEMICOLON => true, - T_OPEN_TAG => true, - T_OPEN_CURLY_BRACKET => true, - T_INLINE_THEN => true, - ]; - - for ($x = ($newStackPtr - 1); $x > 0; $x--) { - if (isset($stopTokens[$finalTokens[$x]['code']]) === true) { - break; - } - } - - if ($finalTokens[$x]['code'] !== T_CASE - && $finalTokens[$x]['code'] !== T_INLINE_THEN - ) { - $finalTokens[$newStackPtr] = [ - 'content' => $token[1].':', - 'code' => T_GOTO_LABEL, - 'type' => 'T_GOTO_LABEL', - ]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token $stackPtr changed from T_STRING to T_GOTO_LABEL".PHP_EOL; - echo "\t\t* skipping T_COLON token ".($stackPtr + 1).PHP_EOL; - } - - $newStackPtr++; - $stackPtr++; - continue; - } - }//end if - - /* - If this token has newlines in its content, split each line up - and create a new token for each line. We do this so it's easier - to ascertain where errors occur on a line. - Note that $token[1] is the token's content. - */ - - if ($tokenIsArray === true && strpos($token[1], $this->eolChar) !== false) { - $tokenLines = explode($this->eolChar, $token[1]); - $numLines = count($tokenLines); - $newToken = [ - 'type' => Util\Tokens::tokenName($token[0]), - 'code' => $token[0], - 'content' => '', - ]; - - for ($i = 0; $i < $numLines; $i++) { - $newToken['content'] = $tokenLines[$i]; - if ($i === ($numLines - 1)) { - if ($tokenLines[$i] === '') { - break; - } - } else { - $newToken['content'] .= $this->eolChar; - } - - $finalTokens[$newStackPtr] = $newToken; - $newStackPtr++; - } - } else { - if ($tokenIsArray === true && $token[0] === T_STRING) { - // Some T_STRING tokens should remain that way - // due to their context. - if (isset($this->tstringContexts[$finalTokens[$lastNotEmptyToken]['code']]) === true) { - // Special case for syntax like: return new self - // where self should not be a string. - if ($finalTokens[$lastNotEmptyToken]['code'] === T_NEW - && strtolower($token[1]) === 'self' - ) { - $finalTokens[$newStackPtr] = [ - 'content' => $token[1], - 'code' => T_SELF, - 'type' => 'T_SELF', - ]; - } else { - $finalTokens[$newStackPtr] = [ - 'content' => $token[1], - 'code' => T_STRING, - 'type' => 'T_STRING', - ]; - } - - $newStackPtr++; - continue; - }//end if - }//end if - - $newToken = null; - if ($tokenIsArray === false) { - if (isset(self::$resolveTokenCache[$token[0]]) === true) { - $newToken = self::$resolveTokenCache[$token[0]]; - } - } else { - $cacheKey = null; - if ($token[0] === T_STRING) { - $cacheKey = strtolower($token[1]); - } else if ($token[0] !== T_CURLY_OPEN) { - $cacheKey = $token[0]; - } - - if ($cacheKey !== null && isset(self::$resolveTokenCache[$cacheKey]) === true) { - $newToken = self::$resolveTokenCache[$cacheKey]; - $newToken['content'] = $token[1]; - } - } - - if ($newToken === null) { - $newToken = self::standardiseToken($token); - } - - // Convert colons that are actually the ELSE component of an - // inline IF statement. - if (empty($insideInlineIf) === false && $newToken['code'] === T_COLON) { - $isInlineIf = true; - - // Make sure this isn't a named parameter label. - // Get the previous non-empty token. - for ($i = ($stackPtr - 1); $i > 0; $i--) { - if (is_array($tokens[$i]) === false - || isset(Util\Tokens::$emptyTokens[$tokens[$i][0]]) === false - ) { - break; - } - } - - if ($tokens[$i][0] === T_PARAM_NAME) { - $isInlineIf = false; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token is parameter label, not T_INLINE_ELSE".PHP_EOL; - } - } - - if ($isInlineIf === true) { - // Make sure this isn't a return type separator. - for ($i = ($stackPtr - 1); $i > 0; $i--) { - if (is_array($tokens[$i]) === false - || ($tokens[$i][0] !== T_DOC_COMMENT - && $tokens[$i][0] !== T_COMMENT - && $tokens[$i][0] !== T_WHITESPACE) - ) { - break; - } - } - - if ($tokens[$i] === ')') { - $parenCount = 1; - for ($i--; $i > 0; $i--) { - if ($tokens[$i] === '(') { - $parenCount--; - if ($parenCount === 0) { - break; - } - } else if ($tokens[$i] === ')') { - $parenCount++; - } - } - - // We've found the open parenthesis, so if the previous - // non-empty token is FUNCTION or USE, this is a return type. - // Note that we need to skip T_STRING tokens here as these - // can be function names. - for ($i--; $i > 0; $i--) { - if (is_array($tokens[$i]) === false - || ($tokens[$i][0] !== T_DOC_COMMENT - && $tokens[$i][0] !== T_COMMENT - && $tokens[$i][0] !== T_WHITESPACE - && $tokens[$i][0] !== T_STRING) - ) { - break; - } - } - - if ($tokens[$i][0] === T_FUNCTION || $tokens[$i][0] === T_FN || $tokens[$i][0] === T_USE) { - $isInlineIf = false; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token is return type, not T_INLINE_ELSE".PHP_EOL; - } - } - }//end if - }//end if - - // Check to see if this is a CASE or DEFAULT opener. - if ($isInlineIf === true) { - $inlineIfToken = $insideInlineIf[(count($insideInlineIf) - 1)]; - for ($i = $stackPtr; $i > $inlineIfToken; $i--) { - if (is_array($tokens[$i]) === true - && ($tokens[$i][0] === T_CASE - || $tokens[$i][0] === T_DEFAULT) - ) { - $isInlineIf = false; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token is T_CASE or T_DEFAULT opener, not T_INLINE_ELSE".PHP_EOL; - } - - break; - } - - if (is_array($tokens[$i]) === false - && ($tokens[$i] === ';' - || $tokens[$i] === '{') - ) { - break; - } - } - }//end if - - if ($isInlineIf === true) { - array_pop($insideInlineIf); - $newToken['code'] = T_INLINE_ELSE; - $newToken['type'] = 'T_INLINE_ELSE'; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token changed from T_COLON to T_INLINE_ELSE".PHP_EOL; - } - } - }//end if - - // This is a special condition for T_ARRAY tokens used for anything else - // but array declarations, like type hinting function arguments as - // being arrays. - // We want to keep the parenthesis map clean, so let's tag these tokens as - // T_STRING. - if ($newToken['code'] === T_ARRAY) { - for ($i = ($stackPtr + 1); $i < $numTokens; $i++) { - if (is_array($tokens[$i]) === false - || isset(Util\Tokens::$emptyTokens[$tokens[$i][0]]) === false - ) { - // Non-empty content. - break; - } - } - - if ($tokens[$i] !== '(' && $i !== $numTokens) { - $newToken['code'] = T_STRING; - $newToken['type'] = 'T_STRING'; - } - } - - // This is a special case when checking PHP 5.5+ code in PHP < 5.5 - // where "finally" should be T_FINALLY instead of T_STRING. - if ($newToken['code'] === T_STRING - && strtolower($newToken['content']) === 'finally' - && $finalTokens[$lastNotEmptyToken]['code'] === T_CLOSE_CURLY_BRACKET - ) { - $newToken['code'] = T_FINALLY; - $newToken['type'] = 'T_FINALLY'; - } - - // This is a special case for the PHP 5.5 classname::class syntax - // where "class" should be T_STRING instead of T_CLASS. - if (($newToken['code'] === T_CLASS - || $newToken['code'] === T_FUNCTION) - && $finalTokens[$lastNotEmptyToken]['code'] === T_DOUBLE_COLON - ) { - $newToken['code'] = T_STRING; - $newToken['type'] = 'T_STRING'; - } - - // This is a special case for PHP 5.6 use function and use const - // where "function" and "const" should be T_STRING instead of T_FUNCTION - // and T_CONST. - if (($newToken['code'] === T_FUNCTION - || $newToken['code'] === T_CONST) - && ($finalTokens[$lastNotEmptyToken]['code'] === T_USE || $insideUseGroup === true) - ) { - $newToken['code'] = T_STRING; - $newToken['type'] = 'T_STRING'; - } - - // This is a special case for use groups in PHP 7+ where leaving - // the curly braces as their normal tokens would confuse - // the scope map and sniffs. - if ($newToken['code'] === T_OPEN_CURLY_BRACKET - && $finalTokens[$lastNotEmptyToken]['code'] === T_NS_SEPARATOR - ) { - $newToken['code'] = T_OPEN_USE_GROUP; - $newToken['type'] = 'T_OPEN_USE_GROUP'; - $insideUseGroup = true; - } - - if ($insideUseGroup === true && $newToken['code'] === T_CLOSE_CURLY_BRACKET) { - $newToken['code'] = T_CLOSE_USE_GROUP; - $newToken['type'] = 'T_CLOSE_USE_GROUP'; - $insideUseGroup = false; - } - - $finalTokens[$newStackPtr] = $newToken; - $newStackPtr++; - }//end if - }//end for - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t*** END PHP TOKENIZING ***".PHP_EOL; - } - - return $finalTokens; - - }//end tokenize() - - - /** - * Performs additional processing after main tokenizing. - * - * This additional processing checks for CASE statements that are using curly - * braces for scope openers and closers. It also turns some T_FUNCTION tokens - * into T_CLOSURE when they are not standard function definitions. It also - * detects short array syntax and converts those square brackets into new tokens. - * It also corrects some usage of the static and class keywords. It also - * assigns tokens to function return types. - * - * @return void - */ - protected function processAdditional() - { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t*** START ADDITIONAL PHP PROCESSING ***".PHP_EOL; - } - - $this->createAttributesNestingMap(); - - $numTokens = count($this->tokens); - for ($i = ($numTokens - 1); $i >= 0; $i--) { - // Check for any unset scope conditions due to alternate IF/ENDIF syntax. - if (isset($this->tokens[$i]['scope_opener']) === true - && isset($this->tokens[$i]['scope_condition']) === false - ) { - $this->tokens[$i]['scope_condition'] = $this->tokens[$this->tokens[$i]['scope_opener']]['scope_condition']; - } - - if ($this->tokens[$i]['code'] === T_FUNCTION) { - /* - Detect functions that are actually closures and - assign them a different token. - */ - - if (isset($this->tokens[$i]['scope_opener']) === true) { - for ($x = ($i + 1); $x < $numTokens; $x++) { - if (isset(Util\Tokens::$emptyTokens[$this->tokens[$x]['code']]) === false - && $this->tokens[$x]['code'] !== T_BITWISE_AND - ) { - break; - } - } - - if ($this->tokens[$x]['code'] === T_OPEN_PARENTHESIS) { - $this->tokens[$i]['code'] = T_CLOSURE; - $this->tokens[$i]['type'] = 'T_CLOSURE'; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $line = $this->tokens[$i]['line']; - echo "\t* token $i on line $line changed from T_FUNCTION to T_CLOSURE".PHP_EOL; - } - - for ($x = ($this->tokens[$i]['scope_opener'] + 1); $x < $this->tokens[$i]['scope_closer']; $x++) { - if (isset($this->tokens[$x]['conditions'][$i]) === false) { - continue; - } - - $this->tokens[$x]['conditions'][$i] = T_CLOSURE; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$x]['type']; - echo "\t\t* cleaned $x ($type) *".PHP_EOL; - } - } - } - }//end if - - continue; - } else if ($this->tokens[$i]['code'] === T_CLASS && isset($this->tokens[$i]['scope_opener']) === true) { - /* - Detect anonymous classes and assign them a different token. - */ - - for ($x = ($i + 1); $x < $numTokens; $x++) { - if (isset(Util\Tokens::$emptyTokens[$this->tokens[$x]['code']]) === false) { - break; - } - } - - if ($this->tokens[$x]['code'] === T_OPEN_PARENTHESIS - || $this->tokens[$x]['code'] === T_OPEN_CURLY_BRACKET - || $this->tokens[$x]['code'] === T_EXTENDS - || $this->tokens[$x]['code'] === T_IMPLEMENTS - ) { - $this->tokens[$i]['code'] = T_ANON_CLASS; - $this->tokens[$i]['type'] = 'T_ANON_CLASS'; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $line = $this->tokens[$i]['line']; - echo "\t* token $i on line $line changed from T_CLASS to T_ANON_CLASS".PHP_EOL; - } - - if ($this->tokens[$x]['code'] === T_OPEN_PARENTHESIS - && isset($this->tokens[$x]['parenthesis_closer']) === true - ) { - $closer = $this->tokens[$x]['parenthesis_closer']; - - $this->tokens[$i]['parenthesis_opener'] = $x; - $this->tokens[$i]['parenthesis_closer'] = $closer; - $this->tokens[$i]['parenthesis_owner'] = $i; - $this->tokens[$x]['parenthesis_owner'] = $i; - $this->tokens[$closer]['parenthesis_owner'] = $i; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $line = $this->tokens[$i]['line']; - echo "\t\t* added parenthesis keys to T_ANON_CLASS token $i on line $line".PHP_EOL; - } - } - - for ($x = ($this->tokens[$i]['scope_opener'] + 1); $x < $this->tokens[$i]['scope_closer']; $x++) { - if (isset($this->tokens[$x]['conditions'][$i]) === false) { - continue; - } - - $this->tokens[$x]['conditions'][$i] = T_ANON_CLASS; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$x]['type']; - echo "\t\t* cleaned $x ($type) *".PHP_EOL; - } - } - }//end if - - continue; - } else if ($this->tokens[$i]['code'] === T_FN && isset($this->tokens[($i + 1)]) === true) { - // Possible arrow function. - for ($x = ($i + 1); $x < $numTokens; $x++) { - if (isset(Util\Tokens::$emptyTokens[$this->tokens[$x]['code']]) === false - && $this->tokens[$x]['code'] !== T_BITWISE_AND - ) { - // Non-whitespace content. - break; - } - } - - if (isset($this->tokens[$x]) === true && $this->tokens[$x]['code'] === T_OPEN_PARENTHESIS) { - $ignore = Util\Tokens::$emptyTokens; - $ignore += [ - T_ARRAY => T_ARRAY, - T_CALLABLE => T_CALLABLE, - T_COLON => T_COLON, - T_NAMESPACE => T_NAMESPACE, - T_NS_SEPARATOR => T_NS_SEPARATOR, - T_NULL => T_NULL, - T_NULLABLE => T_NULLABLE, - T_PARENT => T_PARENT, - T_SELF => T_SELF, - T_STATIC => T_STATIC, - T_STRING => T_STRING, - T_TYPE_UNION => T_TYPE_UNION, - ]; - - $closer = $this->tokens[$x]['parenthesis_closer']; - for ($arrow = ($closer + 1); $arrow < $numTokens; $arrow++) { - if (isset($ignore[$this->tokens[$arrow]['code']]) === false) { - break; - } - } - - if ($this->tokens[$arrow]['code'] === T_DOUBLE_ARROW) { - $endTokens = [ - T_COLON => true, - T_COMMA => true, - T_SEMICOLON => true, - T_CLOSE_PARENTHESIS => true, - T_CLOSE_SQUARE_BRACKET => true, - T_CLOSE_CURLY_BRACKET => true, - T_CLOSE_SHORT_ARRAY => true, - T_OPEN_TAG => true, - T_CLOSE_TAG => true, - ]; - - $inTernary = false; - $lastEndToken = null; - - for ($scopeCloser = ($arrow + 1); $scopeCloser < $numTokens; $scopeCloser++) { - // Arrow function closer should never be shared with the closer of a match - // control structure. - if (isset($this->tokens[$scopeCloser]['scope_closer'], $this->tokens[$scopeCloser]['scope_condition']) === true - && $scopeCloser === $this->tokens[$scopeCloser]['scope_closer'] - && $this->tokens[$this->tokens[$scopeCloser]['scope_condition']]['code'] === T_MATCH - ) { - if ($arrow < $this->tokens[$scopeCloser]['scope_condition']) { - // Match in return value of arrow function. Move on to the next token. - continue; - } - - // Arrow function as return value for the last match case without trailing comma. - if ($lastEndToken !== null) { - $scopeCloser = $lastEndToken; - break; - } - - for ($lastNonEmpty = ($scopeCloser - 1); $lastNonEmpty > $arrow; $lastNonEmpty--) { - if (isset(Util\Tokens::$emptyTokens[$this->tokens[$lastNonEmpty]['code']]) === false) { - $scopeCloser = $lastNonEmpty; - break 2; - } - } - } - - if (isset($endTokens[$this->tokens[$scopeCloser]['code']]) === true) { - if ($lastEndToken !== null - && ((isset($this->tokens[$scopeCloser]['parenthesis_opener']) === true - && $this->tokens[$scopeCloser]['parenthesis_opener'] < $arrow) - || (isset($this->tokens[$scopeCloser]['bracket_opener']) === true - && $this->tokens[$scopeCloser]['bracket_opener'] < $arrow)) - ) { - for ($lastNonEmpty = ($scopeCloser - 1); $lastNonEmpty > $arrow; $lastNonEmpty--) { - if (isset(Util\Tokens::$emptyTokens[$this->tokens[$lastNonEmpty]['code']]) === false) { - $scopeCloser = $lastNonEmpty; - break; - } - } - } - - break; - } - - if ($inTernary === false - && isset($this->tokens[$scopeCloser]['scope_closer'], $this->tokens[$scopeCloser]['scope_condition']) === true - && $scopeCloser === $this->tokens[$scopeCloser]['scope_closer'] - && $this->tokens[$this->tokens[$scopeCloser]['scope_condition']]['code'] === T_FN - ) { - // Found a nested arrow function that already has the closer set and is in - // the same scope as us, so we can use its closer. - break; - } - - if (isset($this->tokens[$scopeCloser]['scope_closer']) === true - && $this->tokens[$scopeCloser]['code'] !== T_INLINE_ELSE - && $this->tokens[$scopeCloser]['code'] !== T_END_HEREDOC - && $this->tokens[$scopeCloser]['code'] !== T_END_NOWDOC - ) { - // We minus 1 here in case the closer can be shared with us. - $scopeCloser = ($this->tokens[$scopeCloser]['scope_closer'] - 1); - continue; - } - - if (isset($this->tokens[$scopeCloser]['parenthesis_closer']) === true) { - $scopeCloser = $this->tokens[$scopeCloser]['parenthesis_closer']; - $lastEndToken = $scopeCloser; - continue; - } - - if (isset($this->tokens[$scopeCloser]['bracket_closer']) === true) { - $scopeCloser = $this->tokens[$scopeCloser]['bracket_closer']; - $lastEndToken = $scopeCloser; - continue; - } - - if ($this->tokens[$scopeCloser]['code'] === T_INLINE_THEN) { - $inTernary = true; - continue; - } - - if ($this->tokens[$scopeCloser]['code'] === T_INLINE_ELSE) { - if ($inTernary === false) { - break; - } - - $inTernary = false; - continue; - } - }//end for - - if ($scopeCloser !== $numTokens) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $line = $this->tokens[$i]['line']; - echo "\t=> token $i on line $line processed as arrow function".PHP_EOL; - echo "\t\t* scope opener set to $arrow *".PHP_EOL; - echo "\t\t* scope closer set to $scopeCloser *".PHP_EOL; - echo "\t\t* parenthesis opener set to $x *".PHP_EOL; - echo "\t\t* parenthesis closer set to $closer *".PHP_EOL; - } - - $this->tokens[$i]['code'] = T_FN; - $this->tokens[$i]['type'] = 'T_FN'; - $this->tokens[$i]['scope_condition'] = $i; - $this->tokens[$i]['scope_opener'] = $arrow; - $this->tokens[$i]['scope_closer'] = $scopeCloser; - $this->tokens[$i]['parenthesis_owner'] = $i; - $this->tokens[$i]['parenthesis_opener'] = $x; - $this->tokens[$i]['parenthesis_closer'] = $closer; - - $this->tokens[$arrow]['code'] = T_FN_ARROW; - $this->tokens[$arrow]['type'] = 'T_FN_ARROW'; - - $this->tokens[$arrow]['scope_condition'] = $i; - $this->tokens[$arrow]['scope_opener'] = $arrow; - $this->tokens[$arrow]['scope_closer'] = $scopeCloser; - $this->tokens[$scopeCloser]['scope_condition'] = $i; - $this->tokens[$scopeCloser]['scope_opener'] = $arrow; - $this->tokens[$scopeCloser]['scope_closer'] = $scopeCloser; - - $opener = $this->tokens[$i]['parenthesis_opener']; - $closer = $this->tokens[$i]['parenthesis_closer']; - $this->tokens[$opener]['parenthesis_owner'] = $i; - $this->tokens[$closer]['parenthesis_owner'] = $i; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $line = $this->tokens[$arrow]['line']; - echo "\t\t* token $arrow on line $line changed from T_DOUBLE_ARROW to T_FN_ARROW".PHP_EOL; - } - }//end if - }//end if - }//end if - - // If after all that, the extra tokens are not set, this is not an arrow function. - if (isset($this->tokens[$i]['scope_closer']) === false) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $line = $this->tokens[$i]['line']; - echo "\t=> token $i on line $line is not an arrow function".PHP_EOL; - echo "\t\t* token changed from T_FN to T_STRING".PHP_EOL; - } - - $this->tokens[$i]['code'] = T_STRING; - $this->tokens[$i]['type'] = 'T_STRING'; - } - } else if ($this->tokens[$i]['code'] === T_OPEN_SQUARE_BRACKET) { - if (isset($this->tokens[$i]['bracket_closer']) === false) { - continue; - } - - // Unless there is a variable or a bracket before this token, - // it is the start of an array being defined using the short syntax. - $isShortArray = false; - $allowed = [ - T_CLOSE_SQUARE_BRACKET => T_CLOSE_SQUARE_BRACKET, - T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET, - T_CLOSE_PARENTHESIS => T_CLOSE_PARENTHESIS, - T_VARIABLE => T_VARIABLE, - T_OBJECT_OPERATOR => T_OBJECT_OPERATOR, - T_NULLSAFE_OBJECT_OPERATOR => T_NULLSAFE_OBJECT_OPERATOR, - T_STRING => T_STRING, - T_CONSTANT_ENCAPSED_STRING => T_CONSTANT_ENCAPSED_STRING, - T_DOUBLE_QUOTED_STRING => T_DOUBLE_QUOTED_STRING, - ]; - $allowed += Util\Tokens::$magicConstants; - - for ($x = ($i - 1); $x >= 0; $x--) { - // If we hit a scope opener, the statement has ended - // without finding anything, so it's probably an array - // using PHP 7.1 short list syntax. - if (isset($this->tokens[$x]['scope_opener']) === true) { - $isShortArray = true; - break; - } - - if (isset(Util\Tokens::$emptyTokens[$this->tokens[$x]['code']]) === false) { - if (isset($allowed[$this->tokens[$x]['code']]) === false) { - $isShortArray = true; - } - - break; - } - } - - if ($isShortArray === true) { - $this->tokens[$i]['code'] = T_OPEN_SHORT_ARRAY; - $this->tokens[$i]['type'] = 'T_OPEN_SHORT_ARRAY'; - - $closer = $this->tokens[$i]['bracket_closer']; - $this->tokens[$closer]['code'] = T_CLOSE_SHORT_ARRAY; - $this->tokens[$closer]['type'] = 'T_CLOSE_SHORT_ARRAY'; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $line = $this->tokens[$i]['line']; - echo "\t* token $i on line $line changed from T_OPEN_SQUARE_BRACKET to T_OPEN_SHORT_ARRAY".PHP_EOL; - $line = $this->tokens[$closer]['line']; - echo "\t* token $closer on line $line changed from T_CLOSE_SQUARE_BRACKET to T_CLOSE_SHORT_ARRAY".PHP_EOL; - } - } - - continue; - } else if ($this->tokens[$i]['code'] === T_MATCH) { - if (isset($this->tokens[$i]['scope_opener'], $this->tokens[$i]['scope_closer']) === false) { - // Not a match expression after all. - $this->tokens[$i]['code'] = T_STRING; - $this->tokens[$i]['type'] = 'T_STRING'; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token $i changed from T_MATCH to T_STRING".PHP_EOL; - } - - if (isset($this->tokens[$i]['parenthesis_opener'], $this->tokens[$i]['parenthesis_closer']) === true) { - $opener = $this->tokens[$i]['parenthesis_opener']; - $closer = $this->tokens[$i]['parenthesis_closer']; - unset( - $this->tokens[$opener]['parenthesis_owner'], - $this->tokens[$closer]['parenthesis_owner'] - ); - unset( - $this->tokens[$i]['parenthesis_opener'], - $this->tokens[$i]['parenthesis_closer'], - $this->tokens[$i]['parenthesis_owner'] - ); - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* cleaned parenthesis of token $i *".PHP_EOL; - } - } - } else { - // Retokenize the double arrows for match expression cases to `T_MATCH_ARROW`. - $searchFor = [ - T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET, - T_OPEN_SQUARE_BRACKET => T_OPEN_SQUARE_BRACKET, - T_OPEN_PARENTHESIS => T_OPEN_PARENTHESIS, - T_OPEN_SHORT_ARRAY => T_OPEN_SHORT_ARRAY, - T_DOUBLE_ARROW => T_DOUBLE_ARROW, - ]; - $searchFor += Util\Tokens::$scopeOpeners; - - for ($x = ($this->tokens[$i]['scope_opener'] + 1); $x < $this->tokens[$i]['scope_closer']; $x++) { - if (isset($searchFor[$this->tokens[$x]['code']]) === false) { - continue; - } - - if (isset($this->tokens[$x]['scope_closer']) === true) { - $x = $this->tokens[$x]['scope_closer']; - continue; - } - - if (isset($this->tokens[$x]['parenthesis_closer']) === true) { - $x = $this->tokens[$x]['parenthesis_closer']; - continue; - } - - if (isset($this->tokens[$x]['bracket_closer']) === true) { - $x = $this->tokens[$x]['bracket_closer']; - continue; - } - - // This must be a double arrow, but make sure anyhow. - if ($this->tokens[$x]['code'] === T_DOUBLE_ARROW) { - $this->tokens[$x]['code'] = T_MATCH_ARROW; - $this->tokens[$x]['type'] = 'T_MATCH_ARROW'; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token $x changed from T_DOUBLE_ARROW to T_MATCH_ARROW".PHP_EOL; - } - } - }//end for - }//end if - - continue; - } else if ($this->tokens[$i]['code'] === T_BITWISE_OR) { - /* - Convert "|" to T_TYPE_UNION or leave as T_BITWISE_OR. - */ - - $allowed = [ - T_STRING => T_STRING, - T_CALLABLE => T_CALLABLE, - T_SELF => T_SELF, - T_PARENT => T_PARENT, - T_STATIC => T_STATIC, - T_FALSE => T_FALSE, - T_NULL => T_NULL, - T_NAMESPACE => T_NAMESPACE, - T_NS_SEPARATOR => T_NS_SEPARATOR, - ]; - - $suspectedType = null; - $typeTokenCount = 0; - - for ($x = ($i + 1); $x < $numTokens; $x++) { - if (isset(Util\Tokens::$emptyTokens[$this->tokens[$x]['code']]) === true) { - continue; - } - - if (isset($allowed[$this->tokens[$x]['code']]) === true) { - ++$typeTokenCount; - continue; - } - - if ($typeTokenCount > 0 - && ($this->tokens[$x]['code'] === T_BITWISE_AND - || $this->tokens[$x]['code'] === T_ELLIPSIS) - ) { - // Skip past reference and variadic indicators for parameter types. - continue; - } - - if ($this->tokens[$x]['code'] === T_VARIABLE) { - // Parameter/Property defaults can not contain variables, so this could be a type. - $suspectedType = 'property or parameter'; - break; - } - - if ($this->tokens[$x]['code'] === T_DOUBLE_ARROW) { - // Possible arrow function. - $suspectedType = 'return'; - break; - } - - if ($this->tokens[$x]['code'] === T_SEMICOLON) { - // Possible abstract method or interface method. - $suspectedType = 'return'; - break; - } - - if ($this->tokens[$x]['code'] === T_OPEN_CURLY_BRACKET - && isset($this->tokens[$x]['scope_condition']) === true - && $this->tokens[$this->tokens[$x]['scope_condition']]['code'] === T_FUNCTION - ) { - $suspectedType = 'return'; - } - - break; - }//end for - - if ($typeTokenCount === 0 || isset($suspectedType) === false) { - // Definitely not a union type, move on. - continue; - } - - $typeTokenCount = 0; - $unionOperators = [$i]; - $confirmed = false; - - for ($x = ($i - 1); $x >= 0; $x--) { - if (isset(Util\Tokens::$emptyTokens[$this->tokens[$x]['code']]) === true) { - continue; - } - - if (isset($allowed[$this->tokens[$x]['code']]) === true) { - ++$typeTokenCount; - continue; - } - - // Union types can't use the nullable operator, but be tolerant to parse errors. - if ($typeTokenCount > 0 && $this->tokens[$x]['code'] === T_NULLABLE) { - continue; - } - - if ($this->tokens[$x]['code'] === T_BITWISE_OR) { - $unionOperators[] = $x; - continue; - } - - if ($suspectedType === 'return' && $this->tokens[$x]['code'] === T_COLON) { - $confirmed = true; - break; - } - - if ($suspectedType === 'property or parameter' - && (isset(Util\Tokens::$scopeModifiers[$this->tokens[$x]['code']]) === true - || $this->tokens[$x]['code'] === T_VAR) - ) { - // This will also confirm constructor property promotion parameters, but that's fine. - $confirmed = true; - } - - break; - }//end for - - if ($confirmed === false - && $suspectedType === 'property or parameter' - && isset($this->tokens[$i]['nested_parenthesis']) === true - ) { - $parens = $this->tokens[$i]['nested_parenthesis']; - $last = end($parens); - - if (isset($this->tokens[$last]['parenthesis_owner']) === true - && $this->tokens[$this->tokens[$last]['parenthesis_owner']]['code'] === T_FUNCTION - ) { - $confirmed = true; - } else { - // No parenthesis owner set, this may be an arrow function which has not yet - // had additional processing done. - if (isset($this->tokens[$last]['parenthesis_opener']) === true) { - for ($x = ($this->tokens[$last]['parenthesis_opener'] - 1); $x >= 0; $x--) { - if (isset(Util\Tokens::$emptyTokens[$this->tokens[$x]['code']]) === true) { - continue; - } - - break; - } - - if ($this->tokens[$x]['code'] === T_FN) { - for (--$x; $x >= 0; $x--) { - if (isset(Util\Tokens::$emptyTokens[$this->tokens[$x]['code']]) === true - || $this->tokens[$x]['code'] === T_BITWISE_AND - ) { - continue; - } - - break; - } - - if ($this->tokens[$x]['code'] !== T_FUNCTION) { - $confirmed = true; - } - } - }//end if - }//end if - - unset($parens, $last); - }//end if - - if ($confirmed === false) { - // Not a union type after all, move on. - continue; - } - - foreach ($unionOperators as $x) { - $this->tokens[$x]['code'] = T_TYPE_UNION; - $this->tokens[$x]['type'] = 'T_TYPE_UNION'; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $line = $this->tokens[$x]['line']; - echo "\t* token $x on line $line changed from T_BITWISE_OR to T_TYPE_UNION".PHP_EOL; - } - } - - continue; - } else if ($this->tokens[$i]['code'] === T_STATIC) { - for ($x = ($i - 1); $x > 0; $x--) { - if (isset(Util\Tokens::$emptyTokens[$this->tokens[$x]['code']]) === false) { - break; - } - } - - if ($this->tokens[$x]['code'] === T_INSTANCEOF) { - $this->tokens[$i]['code'] = T_STRING; - $this->tokens[$i]['type'] = 'T_STRING'; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $line = $this->tokens[$i]['line']; - echo "\t* token $i on line $line changed from T_STATIC to T_STRING".PHP_EOL; - } - } - - continue; - } else if ($this->tokens[$i]['code'] === T_TRUE - || $this->tokens[$i]['code'] === T_FALSE - || $this->tokens[$i]['code'] === T_NULL - ) { - for ($x = ($i + 1); $i < $numTokens; $x++) { - if (isset(Util\Tokens::$emptyTokens[$this->tokens[$x]['code']]) === false) { - // Non-whitespace content. - break; - } - } - - if (isset($this->tstringContexts[$this->tokens[$x]['code']]) === true) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $line = $this->tokens[$i]['line']; - $type = $this->tokens[$i]['type']; - echo "\t* token $i on line $line changed from $type to T_STRING".PHP_EOL; - } - - $this->tokens[$i]['code'] = T_STRING; - $this->tokens[$i]['type'] = 'T_STRING'; - } - } else if ($this->tokens[$i]['code'] === T_CONST) { - // Context sensitive keywords support. - for ($x = ($i + 1); $i < $numTokens; $x++) { - if (isset(Util\Tokens::$emptyTokens[$this->tokens[$x]['code']]) === false) { - // Non-whitespace content. - break; - } - } - - if ($this->tokens[$x]['code'] !== T_STRING) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $line = $this->tokens[$x]['line']; - $type = $this->tokens[$x]['type']; - echo "\t* token $x on line $line changed from $type to T_STRING".PHP_EOL; - } - - $this->tokens[$x]['code'] = T_STRING; - $this->tokens[$x]['type'] = 'T_STRING'; - } - }//end if - - if (($this->tokens[$i]['code'] !== T_CASE - && $this->tokens[$i]['code'] !== T_DEFAULT) - || isset($this->tokens[$i]['scope_opener']) === false - ) { - // Only interested in CASE and DEFAULT statements from here on in. - continue; - } - - $scopeOpener = $this->tokens[$i]['scope_opener']; - $scopeCloser = $this->tokens[$i]['scope_closer']; - - // If the first char after the opener is a curly brace - // and that brace has been ignored, it is actually - // opening this case statement and the opener and closer are - // probably set incorrectly. - for ($x = ($scopeOpener + 1); $x < $numTokens; $x++) { - if (isset(Util\Tokens::$emptyTokens[$this->tokens[$x]['code']]) === false) { - // Non-whitespace content. - break; - } - } - - if ($this->tokens[$x]['code'] === T_CASE || $this->tokens[$x]['code'] === T_DEFAULT) { - // Special case for multiple CASE statements that share the same - // closer. Because we are going backwards through the file, this next - // CASE statement is already fixed, so just use its closer and don't - // worry about fixing anything. - $newCloser = $this->tokens[$x]['scope_closer']; - $this->tokens[$i]['scope_closer'] = $newCloser; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $oldType = $this->tokens[$scopeCloser]['type']; - $newType = $this->tokens[$newCloser]['type']; - $line = $this->tokens[$i]['line']; - echo "\t* token $i (T_CASE) on line $line closer changed from $scopeCloser ($oldType) to $newCloser ($newType)".PHP_EOL; - } - - continue; - } - - if ($this->tokens[$x]['code'] !== T_OPEN_CURLY_BRACKET - || isset($this->tokens[$x]['scope_condition']) === true - ) { - // Not a CASE/DEFAULT with a curly brace opener. - continue; - } - - // The closer for this CASE/DEFAULT should be the closing curly brace and - // not whatever it already is. The opener needs to be the opening curly - // brace so everything matches up. - $newCloser = $this->tokens[$x]['bracket_closer']; - foreach ([$i, $x, $newCloser] as $index) { - $this->tokens[$index]['scope_condition'] = $i; - $this->tokens[$index]['scope_opener'] = $x; - $this->tokens[$index]['scope_closer'] = $newCloser; - } - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $line = $this->tokens[$i]['line']; - $tokenType = $this->tokens[$i]['type']; - - $oldType = $this->tokens[$scopeOpener]['type']; - $newType = $this->tokens[$x]['type']; - echo "\t* token $i ($tokenType) on line $line opener changed from $scopeOpener ($oldType) to $x ($newType)".PHP_EOL; - - $oldType = $this->tokens[$scopeCloser]['type']; - $newType = $this->tokens[$newCloser]['type']; - echo "\t* token $i ($tokenType) on line $line closer changed from $scopeCloser ($oldType) to $newCloser ($newType)".PHP_EOL; - } - - if ($this->tokens[$scopeOpener]['scope_condition'] === $i) { - unset($this->tokens[$scopeOpener]['scope_condition']); - unset($this->tokens[$scopeOpener]['scope_opener']); - unset($this->tokens[$scopeOpener]['scope_closer']); - } - - if ($this->tokens[$scopeCloser]['scope_condition'] === $i) { - unset($this->tokens[$scopeCloser]['scope_condition']); - unset($this->tokens[$scopeCloser]['scope_opener']); - unset($this->tokens[$scopeCloser]['scope_closer']); - } else { - // We were using a shared closer. All tokens that were - // sharing this closer with us, except for the scope condition - // and it's opener, need to now point to the new closer. - $condition = $this->tokens[$scopeCloser]['scope_condition']; - $start = ($this->tokens[$condition]['scope_opener'] + 1); - for ($y = $start; $y < $scopeCloser; $y++) { - if (isset($this->tokens[$y]['scope_closer']) === true - && $this->tokens[$y]['scope_closer'] === $scopeCloser - ) { - $this->tokens[$y]['scope_closer'] = $newCloser; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $line = $this->tokens[$y]['line']; - $tokenType = $this->tokens[$y]['type']; - $oldType = $this->tokens[$scopeCloser]['type']; - $newType = $this->tokens[$newCloser]['type']; - echo "\t\t* token $y ($tokenType) on line $line closer changed from $scopeCloser ($oldType) to $newCloser ($newType)".PHP_EOL; - } - } - } - }//end if - - unset($this->tokens[$x]['bracket_opener']); - unset($this->tokens[$x]['bracket_closer']); - unset($this->tokens[$newCloser]['bracket_opener']); - unset($this->tokens[$newCloser]['bracket_closer']); - $this->tokens[$scopeCloser]['conditions'][] = $i; - - // Now fix up all the tokens that think they are - // inside the CASE/DEFAULT statement when they are really outside. - for ($x = $newCloser; $x < $scopeCloser; $x++) { - foreach ($this->tokens[$x]['conditions'] as $num => $oldCond) { - if ($oldCond === $this->tokens[$i]['code']) { - $oldConditions = $this->tokens[$x]['conditions']; - unset($this->tokens[$x]['conditions'][$num]); - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$x]['type']; - $oldConds = ''; - foreach ($oldConditions as $condition) { - $oldConds .= Util\Tokens::tokenName($condition).','; - } - - $oldConds = rtrim($oldConds, ','); - - $newConds = ''; - foreach ($this->tokens[$x]['conditions'] as $condition) { - $newConds .= Util\Tokens::tokenName($condition).','; - } - - $newConds = rtrim($newConds, ','); - - echo "\t\t* cleaned $x ($type) *".PHP_EOL; - echo "\t\t\t=> conditions changed from $oldConds to $newConds".PHP_EOL; - } - - break; - }//end if - }//end foreach - }//end for - }//end for - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t*** END ADDITIONAL PHP PROCESSING ***".PHP_EOL; - } - - }//end processAdditional() - - - /** - * Takes a token produced from token_get_all() and produces a - * more uniform token. - * - * @param string|array $token The token to convert. - * - * @return array The new token. - */ - public static function standardiseToken($token) - { - if (isset($token[1]) === false) { - if (isset(self::$resolveTokenCache[$token[0]]) === true) { - return self::$resolveTokenCache[$token[0]]; - } - } else { - $cacheKey = null; - if ($token[0] === T_STRING) { - $cacheKey = strtolower($token[1]); - } else if ($token[0] !== T_CURLY_OPEN) { - $cacheKey = $token[0]; - } - - if ($cacheKey !== null && isset(self::$resolveTokenCache[$cacheKey]) === true) { - $newToken = self::$resolveTokenCache[$cacheKey]; - $newToken['content'] = $token[1]; - return $newToken; - } - } - - if (isset($token[1]) === false) { - return self::resolveSimpleToken($token[0]); - } - - if ($token[0] === T_STRING) { - switch ($cacheKey) { - case 'false': - $newToken['type'] = 'T_FALSE'; - break; - case 'true': - $newToken['type'] = 'T_TRUE'; - break; - case 'null': - $newToken['type'] = 'T_NULL'; - break; - case 'self': - $newToken['type'] = 'T_SELF'; - break; - case 'parent': - $newToken['type'] = 'T_PARENT'; - break; - default: - $newToken['type'] = 'T_STRING'; - break; - } - - $newToken['code'] = constant($newToken['type']); - - self::$resolveTokenCache[$cacheKey] = $newToken; - } else if ($token[0] === T_CURLY_OPEN) { - $newToken = [ - 'code' => T_OPEN_CURLY_BRACKET, - 'type' => 'T_OPEN_CURLY_BRACKET', - ]; - } else { - $newToken = [ - 'code' => $token[0], - 'type' => Util\Tokens::tokenName($token[0]), - ]; - - self::$resolveTokenCache[$token[0]] = $newToken; - }//end if - - $newToken['content'] = $token[1]; - return $newToken; - - }//end standardiseToken() - - - /** - * Converts simple tokens into a format that conforms to complex tokens - * produced by token_get_all(). - * - * Simple tokens are tokens that are not in array form when produced from - * token_get_all(). - * - * @param string $token The simple token to convert. - * - * @return array The new token in array format. - */ - public static function resolveSimpleToken($token) - { - $newToken = []; - - switch ($token) { - case '{': - $newToken['type'] = 'T_OPEN_CURLY_BRACKET'; - break; - case '}': - $newToken['type'] = 'T_CLOSE_CURLY_BRACKET'; - break; - case '[': - $newToken['type'] = 'T_OPEN_SQUARE_BRACKET'; - break; - case ']': - $newToken['type'] = 'T_CLOSE_SQUARE_BRACKET'; - break; - case '(': - $newToken['type'] = 'T_OPEN_PARENTHESIS'; - break; - case ')': - $newToken['type'] = 'T_CLOSE_PARENTHESIS'; - break; - case ':': - $newToken['type'] = 'T_COLON'; - break; - case '.': - $newToken['type'] = 'T_STRING_CONCAT'; - break; - case ';': - $newToken['type'] = 'T_SEMICOLON'; - break; - case '=': - $newToken['type'] = 'T_EQUAL'; - break; - case '*': - $newToken['type'] = 'T_MULTIPLY'; - break; - case '/': - $newToken['type'] = 'T_DIVIDE'; - break; - case '+': - $newToken['type'] = 'T_PLUS'; - break; - case '-': - $newToken['type'] = 'T_MINUS'; - break; - case '%': - $newToken['type'] = 'T_MODULUS'; - break; - case '^': - $newToken['type'] = 'T_BITWISE_XOR'; - break; - case '&': - $newToken['type'] = 'T_BITWISE_AND'; - break; - case '|': - $newToken['type'] = 'T_BITWISE_OR'; - break; - case '~': - $newToken['type'] = 'T_BITWISE_NOT'; - break; - case '<': - $newToken['type'] = 'T_LESS_THAN'; - break; - case '>': - $newToken['type'] = 'T_GREATER_THAN'; - break; - case '!': - $newToken['type'] = 'T_BOOLEAN_NOT'; - break; - case ',': - $newToken['type'] = 'T_COMMA'; - break; - case '@': - $newToken['type'] = 'T_ASPERAND'; - break; - case '$': - $newToken['type'] = 'T_DOLLAR'; - break; - case '`': - $newToken['type'] = 'T_BACKTICK'; - break; - default: - $newToken['type'] = 'T_NONE'; - break; - }//end switch - - $newToken['code'] = constant($newToken['type']); - $newToken['content'] = $token; - - self::$resolveTokenCache[$token] = $newToken; - return $newToken; - - }//end resolveSimpleToken() - - - /** - * Finds a "closer" token (closing parenthesis or square bracket for example) - * Handle parenthesis balancing while searching for closing token - * - * @param array $tokens The list of tokens to iterate searching the closing token (as returned by token_get_all) - * @param int $start The starting position - * @param string|string[] $openerTokens The opening character - * @param string $closerChar The closing character - * - * @return int|null The position of the closing token, if found. NULL otherwise. - */ - private function findCloser(array &$tokens, $start, $openerTokens, $closerChar) - { - $numTokens = count($tokens); - $stack = [0]; - $closer = null; - $openerTokens = (array) $openerTokens; - - for ($x = $start; $x < $numTokens; $x++) { - if (in_array($tokens[$x], $openerTokens, true) === true - || (is_array($tokens[$x]) === true && in_array($tokens[$x][1], $openerTokens, true) === true) - ) { - $stack[] = $x; - } else if ($tokens[$x] === $closerChar) { - array_pop($stack); - if (empty($stack) === true) { - $closer = $x; - break; - } - } - } - - return $closer; - - }//end findCloser() - - - /** - * PHP 8 attributes parser for PHP < 8 - * Handles single-line and multiline attributes. - * - * @param array $tokens The original array of tokens (as returned by token_get_all) - * @param int $stackPtr The current position in token array - * - * @return array|null The array of parsed attribute tokens - */ - private function parsePhpAttribute(array &$tokens, $stackPtr) - { - - $token = $tokens[$stackPtr]; - - $commentBody = substr($token[1], 2); - $subTokens = @token_get_all(' $subToken) { - if (is_array($subToken) === true - && $subToken[0] === T_COMMENT - && strpos($subToken[1], '#[') === 0 - ) { - $reparsed = $this->parsePhpAttribute($subTokens, $i); - if ($reparsed !== null) { - array_splice($subTokens, $i, 1, $reparsed); - } else { - $subToken[0] = T_ATTRIBUTE; - } - } - } - - array_splice($subTokens, 0, 1, [[T_ATTRIBUTE, '#[']]); - - // Go looking for the close bracket. - $bracketCloser = $this->findCloser($subTokens, 1, '[', ']'); - if (PHP_VERSION_ID < 80000 && $bracketCloser === null) { - foreach (array_slice($tokens, ($stackPtr + 1)) as $token) { - if (is_array($token) === true) { - $commentBody .= $token[1]; - } else { - $commentBody .= $token; - } - } - - $subTokens = @token_get_all('findCloser($subTokens, 1, '[', ']'); - if ($bracketCloser !== null) { - array_splice($tokens, ($stackPtr + 1), count($tokens), array_slice($subTokens, ($bracketCloser + 1))); - $subTokens = array_slice($subTokens, 0, ($bracketCloser + 1)); - } - } - - if ($bracketCloser === null) { - return null; - } - - return $subTokens; - - }//end parsePhpAttribute() - - - /** - * Creates a map for the attributes tokens that surround other tokens. - * - * @return void - */ - private function createAttributesNestingMap() - { - $map = []; - for ($i = 0; $i < $this->numTokens; $i++) { - if (isset($this->tokens[$i]['attribute_opener']) === true - && $i === $this->tokens[$i]['attribute_opener'] - ) { - if (empty($map) === false) { - $this->tokens[$i]['nested_attributes'] = $map; - } - - if (isset($this->tokens[$i]['attribute_closer']) === true) { - $map[$this->tokens[$i]['attribute_opener']] - = $this->tokens[$i]['attribute_closer']; - } - } else if (isset($this->tokens[$i]['attribute_closer']) === true - && $i === $this->tokens[$i]['attribute_closer'] - ) { - array_pop($map); - if (empty($map) === false) { - $this->tokens[$i]['nested_attributes'] = $map; - } - } else { - if (empty($map) === false) { - $this->tokens[$i]['nested_attributes'] = $map; - } - }//end if - }//end for - - }//end createAttributesNestingMap() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Tokenizers/Tokenizer.php b/vendor/squizlabs/php_codesniffer/src/Tokenizers/Tokenizer.php deleted file mode 100644 index c79323c..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Tokenizers/Tokenizer.php +++ /dev/null @@ -1,1732 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tokenizers; - -use PHP_CodeSniffer\Exceptions\TokenizerException; -use PHP_CodeSniffer\Util; - -abstract class Tokenizer -{ - - /** - * The config data for the run. - * - * @var \PHP_CodeSniffer\Config - */ - protected $config = null; - - /** - * The EOL char used in the content. - * - * @var string - */ - protected $eolChar = []; - - /** - * A token-based representation of the content. - * - * @var array - */ - protected $tokens = []; - - /** - * The number of tokens in the tokens array. - * - * @var integer - */ - protected $numTokens = 0; - - /** - * A list of tokens that are allowed to open a scope. - * - * @var array - */ - public $scopeOpeners = []; - - /** - * A list of tokens that end the scope. - * - * @var array - */ - public $endScopeTokens = []; - - /** - * Known lengths of tokens. - * - * @var array - */ - public $knownLengths = []; - - /** - * A list of lines being ignored due to error suppression comments. - * - * @var array - */ - public $ignoredLines = []; - - - /** - * Initialise and run the tokenizer. - * - * @param string $content The content to tokenize, - * @param \PHP_CodeSniffer\Config | null $config The config data for the run. - * @param string $eolChar The EOL char used in the content. - * - * @return void - * @throws \PHP_CodeSniffer\Exceptions\TokenizerException If the file appears to be minified. - */ - public function __construct($content, $config, $eolChar='\n') - { - $this->eolChar = $eolChar; - - $this->config = $config; - $this->tokens = $this->tokenize($content); - - if ($config === null) { - return; - } - - $this->createPositionMap(); - $this->createTokenMap(); - $this->createParenthesisNestingMap(); - $this->createScopeMap(); - $this->createLevelMap(); - - // Allow the tokenizer to do additional processing if required. - $this->processAdditional(); - - }//end __construct() - - - /** - * Checks the content to see if it looks minified. - * - * @param string $content The content to tokenize. - * @param string $eolChar The EOL char used in the content. - * - * @return boolean - */ - protected function isMinifiedContent($content, $eolChar='\n') - { - // Minified files often have a very large number of characters per line - // and cause issues when tokenizing. - $numChars = strlen($content); - $numLines = (substr_count($content, $eolChar) + 1); - $average = ($numChars / $numLines); - if ($average > 100) { - return true; - } - - return false; - - }//end isMinifiedContent() - - - /** - * Gets the array of tokens. - * - * @return array - */ - public function getTokens() - { - return $this->tokens; - - }//end getTokens() - - - /** - * Creates an array of tokens when given some content. - * - * @param string $string The string to tokenize. - * - * @return array - */ - abstract protected function tokenize($string); - - - /** - * Performs additional processing after main tokenizing. - * - * @return void - */ - abstract protected function processAdditional(); - - - /** - * Sets token position information. - * - * Can also convert tabs into spaces. Each tab can represent between - * 1 and $width spaces, so this cannot be a straight string replace. - * - * @return void - */ - private function createPositionMap() - { - $currColumn = 1; - $lineNumber = 1; - $eolLen = strlen($this->eolChar); - $ignoring = null; - $inTests = defined('PHP_CODESNIFFER_IN_TESTS'); - - $checkEncoding = false; - if (function_exists('iconv_strlen') === true) { - $checkEncoding = true; - } - - $checkAnnotations = $this->config->annotations; - $encoding = $this->config->encoding; - $tabWidth = $this->config->tabWidth; - - $tokensWithTabs = [ - T_WHITESPACE => true, - T_COMMENT => true, - T_DOC_COMMENT => true, - T_DOC_COMMENT_WHITESPACE => true, - T_DOC_COMMENT_STRING => true, - T_CONSTANT_ENCAPSED_STRING => true, - T_DOUBLE_QUOTED_STRING => true, - T_HEREDOC => true, - T_NOWDOC => true, - T_INLINE_HTML => true, - ]; - - $this->numTokens = count($this->tokens); - for ($i = 0; $i < $this->numTokens; $i++) { - $this->tokens[$i]['line'] = $lineNumber; - $this->tokens[$i]['column'] = $currColumn; - - if (isset($this->knownLengths[$this->tokens[$i]['code']]) === true) { - // There are no tabs in the tokens we know the length of. - $length = $this->knownLengths[$this->tokens[$i]['code']]; - $currColumn += $length; - } else if ($tabWidth === 0 - || isset($tokensWithTabs[$this->tokens[$i]['code']]) === false - || strpos($this->tokens[$i]['content'], "\t") === false - ) { - // There are no tabs in this content, or we aren't replacing them. - if ($checkEncoding === true) { - // Not using the default encoding, so take a bit more care. - $oldLevel = error_reporting(); - error_reporting(0); - $length = iconv_strlen($this->tokens[$i]['content'], $encoding); - error_reporting($oldLevel); - - if ($length === false) { - // String contained invalid characters, so revert to default. - $length = strlen($this->tokens[$i]['content']); - } - } else { - $length = strlen($this->tokens[$i]['content']); - } - - $currColumn += $length; - } else { - $this->replaceTabsInToken($this->tokens[$i]); - $length = $this->tokens[$i]['length']; - $currColumn += $length; - }//end if - - $this->tokens[$i]['length'] = $length; - - if (isset($this->knownLengths[$this->tokens[$i]['code']]) === false - && strpos($this->tokens[$i]['content'], $this->eolChar) !== false - ) { - $lineNumber++; - $currColumn = 1; - - // Newline chars are not counted in the token length. - $this->tokens[$i]['length'] -= $eolLen; - } - - if ($this->tokens[$i]['code'] === T_COMMENT - || $this->tokens[$i]['code'] === T_DOC_COMMENT_STRING - || $this->tokens[$i]['code'] === T_DOC_COMMENT_TAG - || ($inTests === true && $this->tokens[$i]['code'] === T_INLINE_HTML) - ) { - $commentText = ltrim($this->tokens[$i]['content'], " \t/*#"); - $commentText = rtrim($commentText, " */\t\r\n"); - $commentTextLower = strtolower($commentText); - if (strpos($commentText, '@codingStandards') !== false) { - // If this comment is the only thing on the line, it tells us - // to ignore the following line. If the line contains other content - // then we are just ignoring this one single line. - $ownLine = false; - if ($i > 0) { - for ($prev = ($i - 1); $prev >= 0; $prev--) { - if ($this->tokens[$prev]['code'] === T_WHITESPACE) { - continue; - } - - break; - } - - if ($this->tokens[$prev]['line'] !== $this->tokens[$i]['line']) { - $ownLine = true; - } - } - - if ($ignoring === null - && strpos($commentText, '@codingStandardsIgnoreStart') !== false - ) { - $ignoring = ['.all' => true]; - if ($ownLine === true) { - $this->ignoredLines[$this->tokens[$i]['line']] = $ignoring; - } - } else if ($ignoring !== null - && strpos($commentText, '@codingStandardsIgnoreEnd') !== false - ) { - if ($ownLine === true) { - $this->ignoredLines[$this->tokens[$i]['line']] = ['.all' => true]; - } else { - $this->ignoredLines[$this->tokens[$i]['line']] = $ignoring; - } - - $ignoring = null; - } else if ($ignoring === null - && strpos($commentText, '@codingStandardsIgnoreLine') !== false - ) { - $ignoring = ['.all' => true]; - if ($ownLine === true) { - $this->ignoredLines[$this->tokens[$i]['line']] = $ignoring; - $this->ignoredLines[($this->tokens[$i]['line'] + 1)] = $ignoring; - } else { - $this->ignoredLines[$this->tokens[$i]['line']] = $ignoring; - } - - $ignoring = null; - }//end if - } else if (substr($commentTextLower, 0, 6) === 'phpcs:' - || substr($commentTextLower, 0, 7) === '@phpcs:' - ) { - // If the @phpcs: syntax is being used, strip the @ to make - // comparisons easier. - if ($commentText[0] === '@') { - $commentText = substr($commentText, 1); - $commentTextLower = strtolower($commentText); - } - - // If there is a comment on the end, strip it off. - $commentStart = strpos($commentTextLower, ' --'); - if ($commentStart !== false) { - $commentText = substr($commentText, 0, $commentStart); - $commentTextLower = strtolower($commentText); - } - - // If this comment is the only thing on the line, it tells us - // to ignore the following line. If the line contains other content - // then we are just ignoring this one single line. - $lineHasOtherContent = false; - $lineHasOtherTokens = false; - if ($i > 0) { - for ($prev = ($i - 1); $prev > 0; $prev--) { - if ($this->tokens[$prev]['line'] !== $this->tokens[$i]['line']) { - // Changed lines. - break; - } - - if ($this->tokens[$prev]['code'] === T_WHITESPACE - || $this->tokens[$prev]['code'] === T_DOC_COMMENT_WHITESPACE - || ($this->tokens[$prev]['code'] === T_INLINE_HTML - && trim($this->tokens[$prev]['content']) === '') - ) { - continue; - } - - $lineHasOtherTokens = true; - - if ($this->tokens[$prev]['code'] === T_OPEN_TAG - || $this->tokens[$prev]['code'] === T_DOC_COMMENT_STAR - ) { - continue; - } - - $lineHasOtherContent = true; - break; - }//end for - - $changedLines = false; - for ($next = $i; $next < $this->numTokens; $next++) { - if ($changedLines === true) { - // Changed lines. - break; - } - - if (isset($this->knownLengths[$this->tokens[$next]['code']]) === false - && strpos($this->tokens[$next]['content'], $this->eolChar) !== false - ) { - // Last token on the current line. - $changedLines = true; - } - - if ($next === $i) { - continue; - } - - if ($this->tokens[$next]['code'] === T_WHITESPACE - || $this->tokens[$next]['code'] === T_DOC_COMMENT_WHITESPACE - || ($this->tokens[$next]['code'] === T_INLINE_HTML - && trim($this->tokens[$next]['content']) === '') - ) { - continue; - } - - $lineHasOtherTokens = true; - - if ($this->tokens[$next]['code'] === T_CLOSE_TAG) { - continue; - } - - $lineHasOtherContent = true; - break; - }//end for - }//end if - - if (substr($commentTextLower, 0, 9) === 'phpcs:set') { - // Ignore standards for complete lines that change sniff settings. - if ($lineHasOtherTokens === false) { - $this->ignoredLines[$this->tokens[$i]['line']] = ['.all' => true]; - } - - // Need to maintain case here, to get the correct sniff code. - $parts = explode(' ', substr($commentText, 10)); - if (count($parts) >= 2) { - $sniffParts = explode('.', $parts[0]); - if (count($sniffParts) >= 3) { - $this->tokens[$i]['sniffCode'] = array_shift($parts); - $this->tokens[$i]['sniffProperty'] = array_shift($parts); - $this->tokens[$i]['sniffPropertyValue'] = rtrim(implode(' ', $parts), " */\r\n"); - } - } - - $this->tokens[$i]['code'] = T_PHPCS_SET; - $this->tokens[$i]['type'] = 'T_PHPCS_SET'; - } else if (substr($commentTextLower, 0, 16) === 'phpcs:ignorefile') { - // The whole file will be ignored, but at least set the correct token. - $this->tokens[$i]['code'] = T_PHPCS_IGNORE_FILE; - $this->tokens[$i]['type'] = 'T_PHPCS_IGNORE_FILE'; - } else if (substr($commentTextLower, 0, 13) === 'phpcs:disable') { - if ($lineHasOtherContent === false) { - // Completely ignore the comment line. - $this->ignoredLines[$this->tokens[$i]['line']] = ['.all' => true]; - } - - if ($ignoring === null) { - $ignoring = []; - } - - $disabledSniffs = []; - - $additionalText = substr($commentText, 14); - if (empty($additionalText) === true) { - $ignoring = ['.all' => true]; - } else { - $parts = explode(',', $additionalText); - foreach ($parts as $sniffCode) { - $sniffCode = trim($sniffCode); - $disabledSniffs[$sniffCode] = true; - $ignoring[$sniffCode] = true; - - // This newly disabled sniff might be disabling an existing - // enabled exception that we are tracking. - if (isset($ignoring['.except']) === true) { - foreach (array_keys($ignoring['.except']) as $ignoredSniffCode) { - if ($ignoredSniffCode === $sniffCode - || strpos($ignoredSniffCode, $sniffCode.'.') === 0 - ) { - unset($ignoring['.except'][$ignoredSniffCode]); - } - } - - if (empty($ignoring['.except']) === true) { - unset($ignoring['.except']); - } - } - }//end foreach - }//end if - - $this->tokens[$i]['code'] = T_PHPCS_DISABLE; - $this->tokens[$i]['type'] = 'T_PHPCS_DISABLE'; - $this->tokens[$i]['sniffCodes'] = $disabledSniffs; - } else if (substr($commentTextLower, 0, 12) === 'phpcs:enable') { - if ($ignoring !== null) { - $enabledSniffs = []; - - $additionalText = substr($commentText, 13); - if (empty($additionalText) === true) { - $ignoring = null; - } else { - $parts = explode(',', $additionalText); - foreach ($parts as $sniffCode) { - $sniffCode = trim($sniffCode); - $enabledSniffs[$sniffCode] = true; - - // This new enabled sniff might remove previously disabled - // sniffs if it is actually a standard or category of sniffs. - foreach (array_keys($ignoring) as $ignoredSniffCode) { - if ($ignoredSniffCode === $sniffCode - || strpos($ignoredSniffCode, $sniffCode.'.') === 0 - ) { - unset($ignoring[$ignoredSniffCode]); - } - } - - // This new enabled sniff might be able to clear up - // previously enabled sniffs if it is actually a standard or - // category of sniffs. - if (isset($ignoring['.except']) === true) { - foreach (array_keys($ignoring['.except']) as $ignoredSniffCode) { - if ($ignoredSniffCode === $sniffCode - || strpos($ignoredSniffCode, $sniffCode.'.') === 0 - ) { - unset($ignoring['.except'][$ignoredSniffCode]); - } - } - } - }//end foreach - - if (empty($ignoring) === true) { - $ignoring = null; - } else { - if (isset($ignoring['.except']) === true) { - $ignoring['.except'] += $enabledSniffs; - } else { - $ignoring['.except'] = $enabledSniffs; - } - } - }//end if - - if ($lineHasOtherContent === false) { - // Completely ignore the comment line. - $this->ignoredLines[$this->tokens[$i]['line']] = ['.all' => true]; - } else { - // The comment is on the same line as the code it is ignoring, - // so respect the new ignore rules. - $this->ignoredLines[$this->tokens[$i]['line']] = $ignoring; - } - - $this->tokens[$i]['sniffCodes'] = $enabledSniffs; - }//end if - - $this->tokens[$i]['code'] = T_PHPCS_ENABLE; - $this->tokens[$i]['type'] = 'T_PHPCS_ENABLE'; - } else if (substr($commentTextLower, 0, 12) === 'phpcs:ignore') { - $ignoreRules = []; - - $additionalText = substr($commentText, 13); - if (empty($additionalText) === true) { - $ignoreRules = ['.all' => true]; - } else { - $parts = explode(',', $additionalText); - foreach ($parts as $sniffCode) { - $ignoreRules[trim($sniffCode)] = true; - } - } - - $this->tokens[$i]['code'] = T_PHPCS_IGNORE; - $this->tokens[$i]['type'] = 'T_PHPCS_IGNORE'; - $this->tokens[$i]['sniffCodes'] = $ignoreRules; - - if ($ignoring !== null) { - $ignoreRules += $ignoring; - } - - if ($lineHasOtherContent === false) { - // Completely ignore the comment line, and set the following - // line to include the ignore rules we've set. - $this->ignoredLines[$this->tokens[$i]['line']] = ['.all' => true]; - $this->ignoredLines[($this->tokens[$i]['line'] + 1)] = $ignoreRules; - } else { - // The comment is on the same line as the code it is ignoring, - // so respect the ignore rules it set. - $this->ignoredLines[$this->tokens[$i]['line']] = $ignoreRules; - } - }//end if - }//end if - }//end if - - if ($ignoring !== null && isset($this->ignoredLines[$this->tokens[$i]['line']]) === false) { - $this->ignoredLines[$this->tokens[$i]['line']] = $ignoring; - } - }//end for - - // If annotations are being ignored, we clear out all the ignore rules - // but leave the annotations tokenized as normal. - if ($checkAnnotations === false) { - $this->ignoredLines = []; - } - - }//end createPositionMap() - - - /** - * Replaces tabs in original token content with spaces. - * - * Each tab can represent between 1 and $config->tabWidth spaces, - * so this cannot be a straight string replace. The original content - * is placed into an orig_content index and the new token length is also - * set in the length index. - * - * @param array $token The token to replace tabs inside. - * @param string $prefix The character to use to represent the start of a tab. - * @param string $padding The character to use to represent the end of a tab. - * @param int $tabWidth The number of spaces each tab represents. - * - * @return void - */ - public function replaceTabsInToken(&$token, $prefix=' ', $padding=' ', $tabWidth=null) - { - $checkEncoding = false; - if (function_exists('iconv_strlen') === true) { - $checkEncoding = true; - } - - $currColumn = $token['column']; - if ($tabWidth === null) { - $tabWidth = $this->config->tabWidth; - if ($tabWidth === 0) { - $tabWidth = 1; - } - } - - if (rtrim($token['content'], "\t") === '') { - // String only contains tabs, so we can shortcut the process. - $numTabs = strlen($token['content']); - - $firstTabSize = ($tabWidth - (($currColumn - 1) % $tabWidth)); - $length = ($firstTabSize + ($tabWidth * ($numTabs - 1))); - $newContent = $prefix.str_repeat($padding, ($length - 1)); - } else { - // We need to determine the length of each tab. - $tabs = explode("\t", $token['content']); - - $numTabs = (count($tabs) - 1); - $tabNum = 0; - $newContent = ''; - $length = 0; - - foreach ($tabs as $content) { - if ($content !== '') { - $newContent .= $content; - if ($checkEncoding === true) { - // Not using the default encoding, so take a bit more care. - $oldLevel = error_reporting(); - error_reporting(0); - $contentLength = iconv_strlen($content, $this->config->encoding); - error_reporting($oldLevel); - if ($contentLength === false) { - // String contained invalid characters, so revert to default. - $contentLength = strlen($content); - } - } else { - $contentLength = strlen($content); - } - - $currColumn += $contentLength; - $length += $contentLength; - } - - // The last piece of content does not have a tab after it. - if ($tabNum === $numTabs) { - break; - } - - // Process the tab that comes after the content. - $tabNum++; - - // Move the pointer to the next tab stop. - $pad = ($tabWidth - ($currColumn + $tabWidth - 1) % $tabWidth); - $currColumn += $pad; - $length += $pad; - $newContent .= $prefix.str_repeat($padding, ($pad - 1)); - }//end foreach - }//end if - - $token['orig_content'] = $token['content']; - $token['content'] = $newContent; - $token['length'] = $length; - - }//end replaceTabsInToken() - - - /** - * Creates a map of brackets positions. - * - * @return void - */ - private function createTokenMap() - { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t*** START TOKEN MAP ***".PHP_EOL; - } - - $squareOpeners = []; - $curlyOpeners = []; - $this->numTokens = count($this->tokens); - - $openers = []; - $openOwner = null; - - for ($i = 0; $i < $this->numTokens; $i++) { - /* - Parenthesis mapping. - */ - - if (isset(Util\Tokens::$parenthesisOpeners[$this->tokens[$i]['code']]) === true) { - $this->tokens[$i]['parenthesis_opener'] = null; - $this->tokens[$i]['parenthesis_closer'] = null; - $this->tokens[$i]['parenthesis_owner'] = $i; - $openOwner = $i; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", (count($openers) + 1)); - echo "=> Found parenthesis owner at $i".PHP_EOL; - } - } else if ($this->tokens[$i]['code'] === T_OPEN_PARENTHESIS) { - $openers[] = $i; - $this->tokens[$i]['parenthesis_opener'] = $i; - if ($openOwner !== null) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", count($openers)); - echo "=> Found parenthesis opener at $i for $openOwner".PHP_EOL; - } - - $this->tokens[$openOwner]['parenthesis_opener'] = $i; - $this->tokens[$i]['parenthesis_owner'] = $openOwner; - $openOwner = null; - } else if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", count($openers)); - echo "=> Found unowned parenthesis opener at $i".PHP_EOL; - } - } else if ($this->tokens[$i]['code'] === T_CLOSE_PARENTHESIS) { - // Did we set an owner for this set of parenthesis? - $numOpeners = count($openers); - if ($numOpeners !== 0) { - $opener = array_pop($openers); - if (isset($this->tokens[$opener]['parenthesis_owner']) === true) { - $owner = $this->tokens[$opener]['parenthesis_owner']; - - $this->tokens[$owner]['parenthesis_closer'] = $i; - $this->tokens[$i]['parenthesis_owner'] = $owner; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", (count($openers) + 1)); - echo "=> Found parenthesis closer at $i for $owner".PHP_EOL; - } - } else if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", (count($openers) + 1)); - echo "=> Found unowned parenthesis closer at $i for $opener".PHP_EOL; - } - - $this->tokens[$i]['parenthesis_opener'] = $opener; - $this->tokens[$i]['parenthesis_closer'] = $i; - $this->tokens[$opener]['parenthesis_closer'] = $i; - }//end if - } else if ($this->tokens[$i]['code'] === T_ATTRIBUTE) { - $openers[] = $i; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", count($openers)); - echo "=> Found attribute opener at $i".PHP_EOL; - } - - $this->tokens[$i]['attribute_opener'] = $i; - $this->tokens[$i]['attribute_closer'] = null; - } else if ($this->tokens[$i]['code'] === T_ATTRIBUTE_END) { - $numOpeners = count($openers); - if ($numOpeners !== 0) { - $opener = array_pop($openers); - if (isset($this->tokens[$opener]['attribute_opener']) === true) { - $this->tokens[$opener]['attribute_closer'] = $i; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", (count($openers) + 1)); - echo "=> Found attribute closer at $i for $opener".PHP_EOL; - } - - for ($x = ($opener + 1); $x <= $i; ++$x) { - if (isset($this->tokens[$x]['attribute_closer']) === true) { - continue; - } - - $this->tokens[$x]['attribute_opener'] = $opener; - $this->tokens[$x]['attribute_closer'] = $i; - } - } else if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", (count($openers) + 1)); - echo "=> Found unowned attribute closer at $i for $opener".PHP_EOL; - } - }//end if - }//end if - - /* - Bracket mapping. - */ - - switch ($this->tokens[$i]['code']) { - case T_OPEN_SQUARE_BRACKET: - $squareOpeners[] = $i; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", count($squareOpeners)); - echo str_repeat("\t", count($curlyOpeners)); - echo "=> Found square bracket opener at $i".PHP_EOL; - } - break; - case T_OPEN_CURLY_BRACKET: - if (isset($this->tokens[$i]['scope_closer']) === false) { - $curlyOpeners[] = $i; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", count($squareOpeners)); - echo str_repeat("\t", count($curlyOpeners)); - echo "=> Found curly bracket opener at $i".PHP_EOL; - } - } - break; - case T_CLOSE_SQUARE_BRACKET: - if (empty($squareOpeners) === false) { - $opener = array_pop($squareOpeners); - $this->tokens[$i]['bracket_opener'] = $opener; - $this->tokens[$i]['bracket_closer'] = $i; - $this->tokens[$opener]['bracket_opener'] = $opener; - $this->tokens[$opener]['bracket_closer'] = $i; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", count($squareOpeners)); - echo str_repeat("\t", count($curlyOpeners)); - echo "\t=> Found square bracket closer at $i for $opener".PHP_EOL; - } - } - break; - case T_CLOSE_CURLY_BRACKET: - if (empty($curlyOpeners) === false - && isset($this->tokens[$i]['scope_opener']) === false - ) { - $opener = array_pop($curlyOpeners); - $this->tokens[$i]['bracket_opener'] = $opener; - $this->tokens[$i]['bracket_closer'] = $i; - $this->tokens[$opener]['bracket_opener'] = $opener; - $this->tokens[$opener]['bracket_closer'] = $i; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", count($squareOpeners)); - echo str_repeat("\t", count($curlyOpeners)); - echo "\t=> Found curly bracket closer at $i for $opener".PHP_EOL; - } - } - break; - default: - continue 2; - }//end switch - }//end for - - // Cleanup for any openers that we didn't find closers for. - // This typically means there was a syntax error breaking things. - foreach ($openers as $opener) { - unset($this->tokens[$opener]['parenthesis_opener']); - unset($this->tokens[$opener]['parenthesis_owner']); - } - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t*** END TOKEN MAP ***".PHP_EOL; - } - - }//end createTokenMap() - - - /** - * Creates a map for the parenthesis tokens that surround other tokens. - * - * @return void - */ - private function createParenthesisNestingMap() - { - $map = []; - for ($i = 0; $i < $this->numTokens; $i++) { - if (isset($this->tokens[$i]['parenthesis_opener']) === true - && $i === $this->tokens[$i]['parenthesis_opener'] - ) { - if (empty($map) === false) { - $this->tokens[$i]['nested_parenthesis'] = $map; - } - - if (isset($this->tokens[$i]['parenthesis_closer']) === true) { - $map[$this->tokens[$i]['parenthesis_opener']] - = $this->tokens[$i]['parenthesis_closer']; - } - } else if (isset($this->tokens[$i]['parenthesis_closer']) === true - && $i === $this->tokens[$i]['parenthesis_closer'] - ) { - array_pop($map); - if (empty($map) === false) { - $this->tokens[$i]['nested_parenthesis'] = $map; - } - } else { - if (empty($map) === false) { - $this->tokens[$i]['nested_parenthesis'] = $map; - } - }//end if - }//end for - - }//end createParenthesisNestingMap() - - - /** - * Creates a scope map of tokens that open scopes. - * - * @return void - * @see recurseScopeMap() - */ - private function createScopeMap() - { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t*** START SCOPE MAP ***".PHP_EOL; - } - - for ($i = 0; $i < $this->numTokens; $i++) { - // Check to see if the current token starts a new scope. - if (isset($this->scopeOpeners[$this->tokens[$i]['code']]) === true) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$i]['type']; - $content = Util\Common::prepareForOutput($this->tokens[$i]['content']); - echo "\tStart scope map at $i:$type => $content".PHP_EOL; - } - - if (isset($this->tokens[$i]['scope_condition']) === true) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t* already processed, skipping *".PHP_EOL; - } - - continue; - } - - $i = $this->recurseScopeMap($i); - }//end if - }//end for - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t*** END SCOPE MAP ***".PHP_EOL; - } - - }//end createScopeMap() - - - /** - * Recurses though the scope openers to build a scope map. - * - * @param int $stackPtr The position in the stack of the token that - * opened the scope (eg. an IF token or FOR token). - * @param int $depth How many scope levels down we are. - * @param int $ignore How many curly braces we are ignoring. - * - * @return int The position in the stack that closed the scope. - * @throws \PHP_CodeSniffer\Exceptions\TokenizerException If the nesting level gets too deep. - */ - private function recurseScopeMap($stackPtr, $depth=1, &$ignore=0) - { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo "=> Begin scope map recursion at token $stackPtr with depth $depth".PHP_EOL; - } - - $opener = null; - $currType = $this->tokens[$stackPtr]['code']; - $startLine = $this->tokens[$stackPtr]['line']; - - // We will need this to restore the value if we end up - // returning a token ID that causes our calling function to go back - // over already ignored braces. - $originalIgnore = $ignore; - - // If the start token for this scope opener is the same as - // the scope token, we have already found our opener. - if (isset($this->scopeOpeners[$currType]['start'][$currType]) === true) { - $opener = $stackPtr; - } - - for ($i = ($stackPtr + 1); $i < $this->numTokens; $i++) { - $tokenType = $this->tokens[$i]['code']; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$i]['type']; - $line = $this->tokens[$i]['line']; - $content = Util\Common::prepareForOutput($this->tokens[$i]['content']); - - echo str_repeat("\t", $depth); - echo "Process token $i on line $line ["; - if ($opener !== null) { - echo "opener:$opener;"; - } - - if ($ignore > 0) { - echo "ignore=$ignore;"; - } - - echo "]: $type => $content".PHP_EOL; - }//end if - - // Very special case for IF statements in PHP that can be defined without - // scope tokens. E.g., if (1) 1; 1 ? (1 ? 1 : 1) : 1; - // If an IF statement below this one has an opener but no - // keyword, the opener will be incorrectly assigned to this IF statement. - // The same case also applies to USE statements, which don't have to have - // openers, so a following USE statement can cause an incorrect brace match. - if (($currType === T_IF || $currType === T_ELSE || $currType === T_USE) - && $opener === null - && ($this->tokens[$i]['code'] === T_SEMICOLON - || $this->tokens[$i]['code'] === T_CLOSE_TAG) - ) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$stackPtr]['type']; - echo str_repeat("\t", $depth); - if ($this->tokens[$i]['code'] === T_SEMICOLON) { - $closerType = 'semicolon'; - } else { - $closerType = 'close tag'; - } - - echo "=> Found $closerType before scope opener for $stackPtr:$type, bailing".PHP_EOL; - } - - return $i; - } - - // Special case for PHP control structures that have no braces. - // If we find a curly brace closer before we find the opener, - // we're not going to find an opener. That closer probably belongs to - // a control structure higher up. - if ($opener === null - && $ignore === 0 - && $tokenType === T_CLOSE_CURLY_BRACKET - && isset($this->scopeOpeners[$currType]['end'][$tokenType]) === true - ) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$stackPtr]['type']; - echo str_repeat("\t", $depth); - echo "=> Found curly brace closer before scope opener for $stackPtr:$type, bailing".PHP_EOL; - } - - return ($i - 1); - } - - if ($opener !== null - && (isset($this->tokens[$i]['scope_opener']) === false - || $this->scopeOpeners[$this->tokens[$stackPtr]['code']]['shared'] === true) - && isset($this->scopeOpeners[$currType]['end'][$tokenType]) === true - ) { - if ($ignore > 0 && $tokenType === T_CLOSE_CURLY_BRACKET) { - // The last opening bracket must have been for a string - // offset or alike, so let's ignore it. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo '* finished ignoring curly brace *'.PHP_EOL; - } - - $ignore--; - continue; - } else if ($this->tokens[$opener]['code'] === T_OPEN_CURLY_BRACKET - && $tokenType !== T_CLOSE_CURLY_BRACKET - ) { - // The opener is a curly bracket so the closer must be a curly bracket as well. - // We ignore this closer to handle cases such as T_ELSE or T_ELSEIF being considered - // a closer of T_IF when it should not. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$stackPtr]['type']; - echo str_repeat("\t", $depth); - echo "=> Ignoring non-curly scope closer for $stackPtr:$type".PHP_EOL; - } - } else { - $scopeCloser = $i; - $todo = [ - $stackPtr, - $opener, - ]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$stackPtr]['type']; - $closerType = $this->tokens[$scopeCloser]['type']; - echo str_repeat("\t", $depth); - echo "=> Found scope closer ($scopeCloser:$closerType) for $stackPtr:$type".PHP_EOL; - } - - $validCloser = true; - if (($this->tokens[$stackPtr]['code'] === T_IF || $this->tokens[$stackPtr]['code'] === T_ELSEIF) - && ($tokenType === T_ELSE || $tokenType === T_ELSEIF) - ) { - // To be a closer, this token must have an opener. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo "* closer needs to be tested *".PHP_EOL; - } - - $i = self::recurseScopeMap($i, ($depth + 1), $ignore); - - if (isset($this->tokens[$scopeCloser]['scope_opener']) === false) { - $validCloser = false; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo "* closer is not valid (no opener found) *".PHP_EOL; - } - } else if ($this->tokens[$this->tokens[$scopeCloser]['scope_opener']]['code'] !== $this->tokens[$opener]['code']) { - $validCloser = false; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - $type = $this->tokens[$this->tokens[$scopeCloser]['scope_opener']]['type']; - $openerType = $this->tokens[$opener]['type']; - echo "* closer is not valid (mismatched opener type; $type != $openerType) *".PHP_EOL; - } - } else if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo "* closer was valid *".PHP_EOL; - } - } else { - // The closer was not processed, so we need to - // complete that token as well. - $todo[] = $scopeCloser; - }//end if - - if ($validCloser === true) { - foreach ($todo as $token) { - $this->tokens[$token]['scope_condition'] = $stackPtr; - $this->tokens[$token]['scope_opener'] = $opener; - $this->tokens[$token]['scope_closer'] = $scopeCloser; - } - - if ($this->scopeOpeners[$this->tokens[$stackPtr]['code']]['shared'] === true) { - // As we are going back to where we started originally, restore - // the ignore value back to its original value. - $ignore = $originalIgnore; - return $opener; - } else if ($scopeCloser === $i - && isset($this->scopeOpeners[$tokenType]) === true - ) { - // Unset scope_condition here or else the token will appear to have - // already been processed, and it will be skipped. Normally we want that, - // but in this case, the token is both a closer and an opener, so - // it needs to act like an opener. This is also why we return the - // token before this one; so the closer has a chance to be processed - // a second time, but as an opener. - unset($this->tokens[$scopeCloser]['scope_condition']); - return ($i - 1); - } else { - return $i; - } - } else { - continue; - }//end if - }//end if - }//end if - - // Is this an opening condition ? - if (isset($this->scopeOpeners[$tokenType]) === true) { - if ($opener === null) { - if ($tokenType === T_USE) { - // PHP use keywords are special because they can be - // used as blocks but also inline in function definitions. - // So if we find them nested inside another opener, just skip them. - continue; - } - - if ($tokenType === T_NAMESPACE) { - // PHP namespace keywords are special because they can be - // used as blocks but also inline as operators. - // So if we find them nested inside another opener, just skip them. - continue; - } - - if ($tokenType === T_FUNCTION - && $this->tokens[$stackPtr]['code'] !== T_FUNCTION - ) { - // Probably a closure, so process it manually. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$stackPtr]['type']; - echo str_repeat("\t", $depth); - echo "=> Found function before scope opener for $stackPtr:$type, processing manually".PHP_EOL; - } - - if (isset($this->tokens[$i]['scope_closer']) === true) { - // We've already processed this closure. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo '* already processed, skipping *'.PHP_EOL; - } - - $i = $this->tokens[$i]['scope_closer']; - continue; - } - - $i = self::recurseScopeMap($i, ($depth + 1), $ignore); - continue; - }//end if - - if ($tokenType === T_CLASS) { - // Probably an anonymous class inside another anonymous class, - // so process it manually. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$stackPtr]['type']; - echo str_repeat("\t", $depth); - echo "=> Found class before scope opener for $stackPtr:$type, processing manually".PHP_EOL; - } - - if (isset($this->tokens[$i]['scope_closer']) === true) { - // We've already processed this anon class. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo '* already processed, skipping *'.PHP_EOL; - } - - $i = $this->tokens[$i]['scope_closer']; - continue; - } - - $i = self::recurseScopeMap($i, ($depth + 1), $ignore); - continue; - }//end if - - // Found another opening condition but still haven't - // found our opener, so we are never going to find one. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$stackPtr]['type']; - echo str_repeat("\t", $depth); - echo "=> Found new opening condition before scope opener for $stackPtr:$type, "; - } - - if (($this->tokens[$stackPtr]['code'] === T_IF - || $this->tokens[$stackPtr]['code'] === T_ELSEIF - || $this->tokens[$stackPtr]['code'] === T_ELSE) - && ($this->tokens[$i]['code'] === T_ELSE - || $this->tokens[$i]['code'] === T_ELSEIF) - ) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "continuing".PHP_EOL; - } - - return ($i - 1); - } else { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "backtracking".PHP_EOL; - } - - return $stackPtr; - } - }//end if - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo '* token is an opening condition *'.PHP_EOL; - } - - $isShared = ($this->scopeOpeners[$tokenType]['shared'] === true); - - if (isset($this->tokens[$i]['scope_condition']) === true) { - // We've been here before. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo '* already processed, skipping *'.PHP_EOL; - } - - if ($isShared === false - && isset($this->tokens[$i]['scope_closer']) === true - ) { - $i = $this->tokens[$i]['scope_closer']; - } - - continue; - } else if ($currType === $tokenType - && $isShared === false - && $opener === null - ) { - // We haven't yet found our opener, but we have found another - // scope opener which is the same type as us, and we don't - // share openers, so we will never find one. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo '* it was another token\'s opener, bailing *'.PHP_EOL; - } - - return $stackPtr; - } else { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo '* searching for opener *'.PHP_EOL; - } - - if (isset($this->scopeOpeners[$tokenType]['end'][T_CLOSE_CURLY_BRACKET]) === true) { - $oldIgnore = $ignore; - $ignore = 0; - } - - // PHP has a max nesting level for functions. Stop before we hit that limit - // because too many loops means we've run into trouble anyway. - if ($depth > 50) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo '* reached maximum nesting level; aborting *'.PHP_EOL; - } - - throw new TokenizerException('Maximum nesting level reached; file could not be processed'); - } - - $oldDepth = $depth; - if ($isShared === true - && isset($this->scopeOpeners[$tokenType]['with'][$currType]) === true - ) { - // Don't allow the depth to increment because this is - // possibly not a true nesting if we are sharing our closer. - // This can happen, for example, when a SWITCH has a large - // number of CASE statements with the same shared BREAK. - $depth--; - } - - $i = self::recurseScopeMap($i, ($depth + 1), $ignore); - $depth = $oldDepth; - - if (isset($this->scopeOpeners[$tokenType]['end'][T_CLOSE_CURLY_BRACKET]) === true) { - $ignore = $oldIgnore; - } - }//end if - }//end if - - if (isset($this->scopeOpeners[$currType]['start'][$tokenType]) === true - && $opener === null - ) { - if ($tokenType === T_OPEN_CURLY_BRACKET) { - if (isset($this->tokens[$stackPtr]['parenthesis_closer']) === true - && $i < $this->tokens[$stackPtr]['parenthesis_closer'] - ) { - // We found a curly brace inside the condition of the - // current scope opener, so it must be a string offset. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo '* ignoring curly brace inside condition *'.PHP_EOL; - } - - $ignore++; - } else { - // Make sure this is actually an opener and not a - // string offset (e.g., $var{0}). - for ($x = ($i - 1); $x > 0; $x--) { - if (isset(Util\Tokens::$emptyTokens[$this->tokens[$x]['code']]) === true) { - continue; - } else { - // If the first non-whitespace/comment token looks like this - // brace is a string offset, or this brace is mid-way through - // a new statement, it isn't a scope opener. - $disallowed = Util\Tokens::$assignmentTokens; - $disallowed += [ - T_DOLLAR => true, - T_VARIABLE => true, - T_OBJECT_OPERATOR => true, - T_NULLSAFE_OBJECT_OPERATOR => true, - T_COMMA => true, - T_OPEN_PARENTHESIS => true, - ]; - - if (isset($disallowed[$this->tokens[$x]['code']]) === true) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo '* ignoring curly brace *'.PHP_EOL; - } - - $ignore++; - } - - break; - }//end if - }//end for - }//end if - }//end if - - if ($ignore === 0 || $tokenType !== T_OPEN_CURLY_BRACKET) { - $openerNested = isset($this->tokens[$i]['nested_parenthesis']); - $ownerNested = isset($this->tokens[$stackPtr]['nested_parenthesis']); - - if (($openerNested === true && $ownerNested === false) - || ($openerNested === false && $ownerNested === true) - || ($openerNested === true - && $this->tokens[$i]['nested_parenthesis'] !== $this->tokens[$stackPtr]['nested_parenthesis']) - ) { - // We found the a token that looks like the opener, but it's nested differently. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$i]['type']; - echo str_repeat("\t", $depth); - echo "* ignoring possible opener $i:$type as nested parenthesis don't match *".PHP_EOL; - } - } else { - // We found the opening scope token for $currType. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$stackPtr]['type']; - echo str_repeat("\t", $depth); - echo "=> Found scope opener for $stackPtr:$type".PHP_EOL; - } - - $opener = $i; - } - }//end if - } else if ($tokenType === T_SEMICOLON - && $opener === null - && (isset($this->tokens[$stackPtr]['parenthesis_closer']) === false - || $i > $this->tokens[$stackPtr]['parenthesis_closer']) - ) { - // Found the end of a statement but still haven't - // found our opener, so we are never going to find one. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$stackPtr]['type']; - echo str_repeat("\t", $depth); - echo "=> Found end of statement before scope opener for $stackPtr:$type, continuing".PHP_EOL; - } - - return ($i - 1); - } else if ($tokenType === T_OPEN_PARENTHESIS) { - if (isset($this->tokens[$i]['parenthesis_owner']) === true) { - $owner = $this->tokens[$i]['parenthesis_owner']; - if (isset(Util\Tokens::$scopeOpeners[$this->tokens[$owner]['code']]) === true - && isset($this->tokens[$i]['parenthesis_closer']) === true - ) { - // If we get into here, then we opened a parenthesis for - // a scope (eg. an if or else if) so we need to update the - // start of the line so that when we check to see - // if the closing parenthesis is more than n lines away from - // the statement, we check from the closing parenthesis. - $startLine = $this->tokens[$this->tokens[$i]['parenthesis_closer']]['line']; - } - } - } else if ($tokenType === T_OPEN_CURLY_BRACKET && $opener !== null) { - // We opened something that we don't have a scope opener for. - // Examples of this are curly brackets for string offsets etc. - // We want to ignore this so that we don't have an invalid scope - // map. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo '* ignoring curly brace *'.PHP_EOL; - } - - $ignore++; - } else if ($tokenType === T_CLOSE_CURLY_BRACKET && $ignore > 0) { - // We found the end token for the opener we were ignoring. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo '* finished ignoring curly brace *'.PHP_EOL; - } - - $ignore--; - } else if ($opener === null - && isset($this->scopeOpeners[$currType]) === true - ) { - // If we still haven't found the opener after 30 lines, - // we're not going to find it, unless we know it requires - // an opener (in which case we better keep looking) or the last - // token was empty (in which case we'll just confirm there is - // more code in this file and not just a big comment). - if ($this->tokens[$i]['line'] >= ($startLine + 30) - && isset(Util\Tokens::$emptyTokens[$this->tokens[($i - 1)]['code']]) === false - ) { - if ($this->scopeOpeners[$currType]['strict'] === true) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$stackPtr]['type']; - $lines = ($this->tokens[$i]['line'] - $startLine); - echo str_repeat("\t", $depth); - echo "=> Still looking for $stackPtr:$type scope opener after $lines lines".PHP_EOL; - } - } else { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$stackPtr]['type']; - echo str_repeat("\t", $depth); - echo "=> Couldn't find scope opener for $stackPtr:$type, bailing".PHP_EOL; - } - - return $stackPtr; - } - } - } else if ($opener !== null - && $tokenType !== T_BREAK - && isset($this->endScopeTokens[$tokenType]) === true - ) { - if (isset($this->tokens[$i]['scope_condition']) === false) { - if ($ignore > 0) { - // We found the end token for the opener we were ignoring. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo '* finished ignoring curly brace *'.PHP_EOL; - } - - $ignore--; - } else { - // We found a token that closes the scope but it doesn't - // have a condition, so it belongs to another token and - // our token doesn't have a closer, so pretend this is - // the closer. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$stackPtr]['type']; - echo str_repeat("\t", $depth); - echo "=> Found (unexpected) scope closer for $stackPtr:$type".PHP_EOL; - } - - foreach ([$stackPtr, $opener] as $token) { - $this->tokens[$token]['scope_condition'] = $stackPtr; - $this->tokens[$token]['scope_opener'] = $opener; - $this->tokens[$token]['scope_closer'] = $i; - } - - return ($i - 1); - }//end if - }//end if - }//end if - }//end for - - return $stackPtr; - - }//end recurseScopeMap() - - - /** - * Constructs the level map. - * - * The level map adds a 'level' index to each token which indicates the - * depth that a token within a set of scope blocks. It also adds a - * 'conditions' index which is an array of the scope conditions that opened - * each of the scopes - position 0 being the first scope opener. - * - * @return void - */ - private function createLevelMap() - { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t*** START LEVEL MAP ***".PHP_EOL; - } - - $this->numTokens = count($this->tokens); - $level = 0; - $conditions = []; - $lastOpener = null; - $openers = []; - - for ($i = 0; $i < $this->numTokens; $i++) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$i]['type']; - $line = $this->tokens[$i]['line']; - $len = $this->tokens[$i]['length']; - $col = $this->tokens[$i]['column']; - - $content = Util\Common::prepareForOutput($this->tokens[$i]['content']); - - echo str_repeat("\t", ($level + 1)); - echo "Process token $i on line $line [col:$col;len:$len;lvl:$level;"; - if (empty($conditions) !== true) { - $conditionString = 'conds;'; - foreach ($conditions as $condition) { - $conditionString .= Util\Tokens::tokenName($condition).','; - } - - echo rtrim($conditionString, ',').';'; - } - - echo "]: $type => $content".PHP_EOL; - }//end if - - $this->tokens[$i]['level'] = $level; - $this->tokens[$i]['conditions'] = $conditions; - - if (isset($this->tokens[$i]['scope_condition']) === true) { - // Check to see if this token opened the scope. - if ($this->tokens[$i]['scope_opener'] === $i) { - $stackPtr = $this->tokens[$i]['scope_condition']; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$stackPtr]['type']; - echo str_repeat("\t", ($level + 1)); - echo "=> Found scope opener for $stackPtr:$type".PHP_EOL; - } - - $stackPtr = $this->tokens[$i]['scope_condition']; - - // If we find a scope opener that has a shared closer, - // then we need to go back over the condition map that we - // just created and fix ourselves as we just added some - // conditions where there was none. This happens for T_CASE - // statements that are using the same break statement. - if ($lastOpener !== null && $this->tokens[$lastOpener]['scope_closer'] === $this->tokens[$i]['scope_closer']) { - // This opener shares its closer with the previous opener, - // but we still need to check if the two openers share their - // closer with each other directly (like CASE and DEFAULT) - // or if they are just sharing because one doesn't have a - // closer (like CASE with no BREAK using a SWITCHes closer). - $thisType = $this->tokens[$this->tokens[$i]['scope_condition']]['code']; - $opener = $this->tokens[$lastOpener]['scope_condition']; - - $isShared = isset($this->scopeOpeners[$thisType]['with'][$this->tokens[$opener]['code']]); - - reset($this->scopeOpeners[$thisType]['end']); - reset($this->scopeOpeners[$this->tokens[$opener]['code']]['end']); - $sameEnd = (current($this->scopeOpeners[$thisType]['end']) === current($this->scopeOpeners[$this->tokens[$opener]['code']]['end'])); - - if ($isShared === true && $sameEnd === true) { - $badToken = $opener; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$badToken]['type']; - echo str_repeat("\t", ($level + 1)); - echo "* shared closer, cleaning up $badToken:$type *".PHP_EOL; - } - - for ($x = $this->tokens[$i]['scope_condition']; $x <= $i; $x++) { - $oldConditions = $this->tokens[$x]['conditions']; - $oldLevel = $this->tokens[$x]['level']; - $this->tokens[$x]['level']--; - unset($this->tokens[$x]['conditions'][$badToken]); - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$x]['type']; - $oldConds = ''; - foreach ($oldConditions as $condition) { - $oldConds .= Util\Tokens::tokenName($condition).','; - } - - $oldConds = rtrim($oldConds, ','); - - $newConds = ''; - foreach ($this->tokens[$x]['conditions'] as $condition) { - $newConds .= Util\Tokens::tokenName($condition).','; - } - - $newConds = rtrim($newConds, ','); - - $newLevel = $this->tokens[$x]['level']; - echo str_repeat("\t", ($level + 1)); - echo "* cleaned $x:$type *".PHP_EOL; - echo str_repeat("\t", ($level + 2)); - echo "=> level changed from $oldLevel to $newLevel".PHP_EOL; - echo str_repeat("\t", ($level + 2)); - echo "=> conditions changed from $oldConds to $newConds".PHP_EOL; - }//end if - }//end for - - unset($conditions[$badToken]); - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$badToken]['type']; - echo str_repeat("\t", ($level + 1)); - echo "* token $badToken:$type removed from conditions array *".PHP_EOL; - } - - unset($openers[$lastOpener]); - - $level--; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", ($level + 2)); - echo '* level decreased *'.PHP_EOL; - } - }//end if - }//end if - - $level++; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", ($level + 1)); - echo '* level increased *'.PHP_EOL; - } - - $conditions[$stackPtr] = $this->tokens[$stackPtr]['code']; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$stackPtr]['type']; - echo str_repeat("\t", ($level + 1)); - echo "* token $stackPtr:$type added to conditions array *".PHP_EOL; - } - - $lastOpener = $this->tokens[$i]['scope_opener']; - if ($lastOpener !== null) { - $openers[$lastOpener] = $lastOpener; - } - } else if ($lastOpener !== null && $this->tokens[$lastOpener]['scope_closer'] === $i) { - foreach (array_reverse($openers) as $opener) { - if ($this->tokens[$opener]['scope_closer'] === $i) { - $oldOpener = array_pop($openers); - if (empty($openers) === false) { - $lastOpener = array_pop($openers); - $openers[$lastOpener] = $lastOpener; - } else { - $lastOpener = null; - } - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$oldOpener]['type']; - echo str_repeat("\t", ($level + 1)); - echo "=> Found scope closer for $oldOpener:$type".PHP_EOL; - } - - $oldCondition = array_pop($conditions); - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", ($level + 1)); - echo '* token '.Util\Tokens::tokenName($oldCondition).' removed from conditions array *'.PHP_EOL; - } - - // Make sure this closer actually belongs to us. - // Either the condition also has to think this is the - // closer, or it has to allow sharing with us. - $condition = $this->tokens[$this->tokens[$i]['scope_condition']]['code']; - if ($condition !== $oldCondition) { - if (isset($this->scopeOpeners[$oldCondition]['with'][$condition]) === false) { - $badToken = $this->tokens[$oldOpener]['scope_condition']; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = Util\Tokens::tokenName($oldCondition); - echo str_repeat("\t", ($level + 1)); - echo "* scope closer was bad, cleaning up $badToken:$type *".PHP_EOL; - } - - for ($x = ($oldOpener + 1); $x <= $i; $x++) { - $oldConditions = $this->tokens[$x]['conditions']; - $oldLevel = $this->tokens[$x]['level']; - $this->tokens[$x]['level']--; - unset($this->tokens[$x]['conditions'][$badToken]); - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$x]['type']; - $oldConds = ''; - foreach ($oldConditions as $condition) { - $oldConds .= Util\Tokens::tokenName($condition).','; - } - - $oldConds = rtrim($oldConds, ','); - - $newConds = ''; - foreach ($this->tokens[$x]['conditions'] as $condition) { - $newConds .= Util\Tokens::tokenName($condition).','; - } - - $newConds = rtrim($newConds, ','); - - $newLevel = $this->tokens[$x]['level']; - echo str_repeat("\t", ($level + 1)); - echo "* cleaned $x:$type *".PHP_EOL; - echo str_repeat("\t", ($level + 2)); - echo "=> level changed from $oldLevel to $newLevel".PHP_EOL; - echo str_repeat("\t", ($level + 2)); - echo "=> conditions changed from $oldConds to $newConds".PHP_EOL; - }//end if - }//end for - }//end if - }//end if - - $level--; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", ($level + 2)); - echo '* level decreased *'.PHP_EOL; - } - - $this->tokens[$i]['level'] = $level; - $this->tokens[$i]['conditions'] = $conditions; - }//end if - }//end foreach - }//end if - }//end if - }//end for - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t*** END LEVEL MAP ***".PHP_EOL; - } - - }//end createLevelMap() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Util/Cache.php b/vendor/squizlabs/php_codesniffer/src/Util/Cache.php deleted file mode 100644 index 68abef5..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Util/Cache.php +++ /dev/null @@ -1,351 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Util; - -use PHP_CodeSniffer\Autoload; -use PHP_CodeSniffer\Config; -use PHP_CodeSniffer\Ruleset; - -class Cache -{ - - /** - * The filesystem location of the cache file. - * - * @var void - */ - private static $path = ''; - - /** - * The cached data. - * - * @var array - */ - private static $cache = []; - - - /** - * Loads existing cache data for the run, if any. - * - * @param \PHP_CodeSniffer\Ruleset $ruleset The ruleset used for the run. - * @param \PHP_CodeSniffer\Config $config The config data for the run. - * - * @return void - */ - public static function load(Ruleset $ruleset, Config $config) - { - // Look at every loaded sniff class so far and use their file contents - // to generate a hash for the code used during the run. - // At this point, the loaded class list contains the core PHPCS code - // and all sniffs that have been loaded as part of the run. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo PHP_EOL."\tGenerating loaded file list for code hash".PHP_EOL; - } - - $codeHashFiles = []; - - $classes = array_keys(Autoload::getLoadedClasses()); - sort($classes); - - $installDir = dirname(__DIR__); - $installDirLen = strlen($installDir); - $standardDir = $installDir.DIRECTORY_SEPARATOR.'Standards'; - $standardDirLen = strlen($standardDir); - foreach ($classes as $file) { - if (substr($file, 0, $standardDirLen) !== $standardDir) { - if (substr($file, 0, $installDirLen) === $installDir) { - // We are only interested in sniffs here. - continue; - } - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t=> external file: $file".PHP_EOL; - } - } else if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t=> internal sniff: $file".PHP_EOL; - } - - $codeHashFiles[] = $file; - } - - // Add the content of the used rulesets to the hash so that sniff setting - // changes in the ruleset invalidate the cache. - $rulesets = $ruleset->paths; - sort($rulesets); - foreach ($rulesets as $file) { - if (substr($file, 0, $standardDirLen) !== $standardDir) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t=> external ruleset: $file".PHP_EOL; - } - } else if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t=> internal ruleset: $file".PHP_EOL; - } - - $codeHashFiles[] = $file; - } - - // Go through the core PHPCS code and add those files to the file - // hash. This ensures that core PHPCS changes will also invalidate the cache. - // Note that we ignore sniffs here, and any files that don't affect - // the outcome of the run. - $di = new \RecursiveDirectoryIterator( - $installDir, - (\FilesystemIterator::KEY_AS_PATHNAME | \FilesystemIterator::CURRENT_AS_FILEINFO | \FilesystemIterator::SKIP_DOTS) - ); - $filter = new \RecursiveCallbackFilterIterator( - $di, - function ($file, $key, $iterator) { - // Skip non-php files. - $filename = $file->getFilename(); - if ($file->isFile() === true && substr($filename, -4) !== '.php') { - return false; - } - - $filePath = Common::realpath($key); - if ($filePath === false) { - return false; - } - - if ($iterator->hasChildren() === true - && ($filename === 'Standards' - || $filename === 'Exceptions' - || $filename === 'Reports' - || $filename === 'Generators') - ) { - return false; - } - - return true; - } - ); - - $iterator = new \RecursiveIteratorIterator($filter); - foreach ($iterator as $file) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t=> core file: $file".PHP_EOL; - } - - $codeHashFiles[] = $file->getPathname(); - } - - $codeHash = ''; - sort($codeHashFiles); - foreach ($codeHashFiles as $file) { - $codeHash .= md5_file($file); - } - - $codeHash = md5($codeHash); - - // Along with the code hash, use various settings that can affect - // the results of a run to create a new hash. This hash will be used - // in the cache file name. - $rulesetHash = md5(var_export($ruleset->ignorePatterns, true).var_export($ruleset->includePatterns, true)); - $phpExtensionsHash = md5(var_export(get_loaded_extensions(), true)); - $configData = [ - 'phpVersion' => PHP_VERSION_ID, - 'phpExtensions' => $phpExtensionsHash, - 'tabWidth' => $config->tabWidth, - 'encoding' => $config->encoding, - 'recordErrors' => $config->recordErrors, - 'annotations' => $config->annotations, - 'configData' => Config::getAllConfigData(), - 'codeHash' => $codeHash, - 'rulesetHash' => $rulesetHash, - ]; - - $configString = var_export($configData, true); - $cacheHash = substr(sha1($configString), 0, 12); - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\tGenerating cache key data".PHP_EOL; - foreach ($configData as $key => $value) { - if (is_array($value) === true) { - echo "\t\t=> $key:".PHP_EOL; - foreach ($value as $subKey => $subValue) { - echo "\t\t\t=> $subKey: $subValue".PHP_EOL; - } - - continue; - } - - if ($value === true || $value === false) { - $value = (int) $value; - } - - echo "\t\t=> $key: $value".PHP_EOL; - } - - echo "\t\t=> cacheHash: $cacheHash".PHP_EOL; - }//end if - - if ($config->cacheFile !== null) { - $cacheFile = $config->cacheFile; - } else { - // Determine the common paths for all files being checked. - // We can use this to locate an existing cache file, or to - // determine where to create a new one. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\tChecking possible cache file paths".PHP_EOL; - } - - $paths = []; - foreach ($config->files as $file) { - $file = Common::realpath($file); - while ($file !== DIRECTORY_SEPARATOR) { - if (isset($paths[$file]) === false) { - $paths[$file] = 1; - } else { - $paths[$file]++; - } - - $lastFile = $file; - $file = dirname($file); - if ($file === $lastFile) { - // Just in case something went wrong, - // we don't want to end up in an infinite loop. - break; - } - } - } - - ksort($paths); - $paths = array_reverse($paths); - - $numFiles = count($config->files); - - $cacheFile = null; - $cacheDir = getenv('XDG_CACHE_HOME'); - if ($cacheDir === false || is_dir($cacheDir) === false) { - $cacheDir = sys_get_temp_dir(); - } - - foreach ($paths as $file => $count) { - if ($count !== $numFiles) { - unset($paths[$file]); - continue; - } - - $fileHash = substr(sha1($file), 0, 12); - $testFile = $cacheDir.DIRECTORY_SEPARATOR."phpcs.$fileHash.$cacheHash.cache"; - if ($cacheFile === null) { - // This will be our default location if we can't find - // an existing file. - $cacheFile = $testFile; - } - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t=> $testFile".PHP_EOL; - echo "\t\t\t * based on shared location: $file *".PHP_EOL; - } - - if (file_exists($testFile) === true) { - $cacheFile = $testFile; - break; - } - }//end foreach - - if ($cacheFile === null) { - // Unlikely, but just in case $paths is empty for some reason. - $cacheFile = $cacheDir.DIRECTORY_SEPARATOR."phpcs.$cacheHash.cache"; - } - }//end if - - self::$path = $cacheFile; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t=> Using cache file: ".self::$path.PHP_EOL; - } - - if (file_exists(self::$path) === true) { - self::$cache = json_decode(file_get_contents(self::$path), true); - - // Verify the contents of the cache file. - if (self::$cache['config'] !== $configData) { - self::$cache = []; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t* cache was invalid and has been cleared *".PHP_EOL; - } - } - } else if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t* cache file does not exist *".PHP_EOL; - } - - self::$cache['config'] = $configData; - - }//end load() - - - /** - * Saves the current cache to the filesystem. - * - * @return void - */ - public static function save() - { - file_put_contents(self::$path, json_encode(self::$cache)); - - }//end save() - - - /** - * Retrieves a single entry from the cache. - * - * @param string $key The key of the data to get. If NULL, - * everything in the cache is returned. - * - * @return mixed - */ - public static function get($key=null) - { - if ($key === null) { - return self::$cache; - } - - if (isset(self::$cache[$key]) === true) { - return self::$cache[$key]; - } - - return false; - - }//end get() - - - /** - * Retrieves a single entry from the cache. - * - * @param string $key The key of the data to set. If NULL, - * sets the entire cache. - * @param mixed $value The value to set. - * - * @return void - */ - public static function set($key, $value) - { - if ($key === null) { - self::$cache = $value; - } else { - self::$cache[$key] = $value; - } - - }//end set() - - - /** - * Retrieves the number of cache entries. - * - * @return int - */ - public static function getSize() - { - return (count(self::$cache) - 1); - - }//end getSize() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Util/Common.php b/vendor/squizlabs/php_codesniffer/src/Util/Common.php deleted file mode 100644 index 204f44d..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Util/Common.php +++ /dev/null @@ -1,570 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Util; - -class Common -{ - - /** - * An array of variable types for param/var we will check. - * - * @var string[] - */ - public static $allowedTypes = [ - 'array', - 'boolean', - 'float', - 'integer', - 'mixed', - 'object', - 'string', - 'resource', - 'callable', - ]; - - - /** - * Return TRUE if the path is a PHAR file. - * - * @param string $path The path to use. - * - * @return mixed - */ - public static function isPharFile($path) - { - if (strpos($path, 'phar://') === 0) { - return true; - } - - return false; - - }//end isPharFile() - - - /** - * Checks if a file is readable. - * - * Addresses PHP bug related to reading files from network drives on Windows. - * e.g. when using WSL2. - * - * @param string $path The path to the file. - * - * @return boolean - */ - public static function isReadable($path) - { - if (@is_readable($path) === true) { - return true; - } - - if (@file_exists($path) === true && @is_file($path) === true) { - $f = @fopen($path, 'rb'); - if (fclose($f) === true) { - return true; - } - } - - return false; - - }//end isReadable() - - - /** - * CodeSniffer alternative for realpath. - * - * Allows for PHAR support. - * - * @param string $path The path to use. - * - * @return mixed - */ - public static function realpath($path) - { - // Support the path replacement of ~ with the user's home directory. - if (substr($path, 0, 2) === '~/') { - $homeDir = getenv('HOME'); - if ($homeDir !== false) { - $path = $homeDir.substr($path, 1); - } - } - - // Check for process substitution. - if (strpos($path, '/dev/fd') === 0) { - return str_replace('/dev/fd', 'php://fd', $path); - } - - // No extra work needed if this is not a phar file. - if (self::isPharFile($path) === false) { - return realpath($path); - } - - // Before trying to break down the file path, - // check if it exists first because it will mostly not - // change after running the below code. - if (file_exists($path) === true) { - return $path; - } - - $phar = \Phar::running(false); - $extra = str_replace('phar://'.$phar, '', $path); - $path = realpath($phar); - if ($path === false) { - return false; - } - - $path = 'phar://'.$path.$extra; - if (file_exists($path) === true) { - return $path; - } - - return false; - - }//end realpath() - - - /** - * Removes a base path from the front of a file path. - * - * @param string $path The path of the file. - * @param string $basepath The base path to remove. This should not end - * with a directory separator. - * - * @return string - */ - public static function stripBasepath($path, $basepath) - { - if (empty($basepath) === true) { - return $path; - } - - $basepathLen = strlen($basepath); - if (substr($path, 0, $basepathLen) === $basepath) { - $path = substr($path, $basepathLen); - } - - $path = ltrim($path, DIRECTORY_SEPARATOR); - if ($path === '') { - $path = '.'; - } - - return $path; - - }//end stripBasepath() - - - /** - * Detects the EOL character being used in a string. - * - * @param string $contents The contents to check. - * - * @return string - */ - public static function detectLineEndings($contents) - { - if (preg_match("/\r\n?|\n/", $contents, $matches) !== 1) { - // Assume there are no newlines. - $eolChar = "\n"; - } else { - $eolChar = $matches[0]; - } - - return $eolChar; - - }//end detectLineEndings() - - - /** - * Check if STDIN is a TTY. - * - * @return boolean - */ - public static function isStdinATTY() - { - // The check is slow (especially calling `tty`) so we static - // cache the result. - static $isTTY = null; - - if ($isTTY !== null) { - return $isTTY; - } - - if (defined('STDIN') === false) { - return false; - } - - // If PHP has the POSIX extensions we will use them. - if (function_exists('posix_isatty') === true) { - $isTTY = (posix_isatty(STDIN) === true); - return $isTTY; - } - - // Next try is detecting whether we have `tty` installed and use that. - if (defined('PHP_WINDOWS_VERSION_PLATFORM') === true) { - $devnull = 'NUL'; - $which = 'where'; - } else { - $devnull = '/dev/null'; - $which = 'which'; - } - - $tty = trim(shell_exec("$which tty 2> $devnull")); - if (empty($tty) === false) { - exec("tty -s 2> $devnull", $output, $returnValue); - $isTTY = ($returnValue === 0); - return $isTTY; - } - - // Finally we will use fstat. The solution borrowed from - // https://stackoverflow.com/questions/11327367/detect-if-a-php-script-is-being-run-interactively-or-not - // This doesn't work on Mingw/Cygwin/... using Mintty but they - // have `tty` installed. - $type = [ - 'S_IFMT' => 0170000, - 'S_IFIFO' => 0010000, - ]; - - $stat = fstat(STDIN); - $mode = ($stat['mode'] & $type['S_IFMT']); - $isTTY = ($mode !== $type['S_IFIFO']); - - return $isTTY; - - }//end isStdinATTY() - - - /** - * Escape a path to a system command. - * - * @param string $cmd The path to the system command. - * - * @return string - */ - public static function escapeshellcmd($cmd) - { - $cmd = escapeshellcmd($cmd); - - if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { - // Spaces are not escaped by escapeshellcmd on Windows, but need to be - // for the command to be able to execute. - $cmd = preg_replace('`(? 0) { - return false; - } - - if ($strict === true) { - // Check that there are not two capital letters next to each other. - $length = strlen($string); - $lastCharWasCaps = $classFormat; - - for ($i = 1; $i < $length; $i++) { - $ascii = ord($string[$i]); - if ($ascii >= 48 && $ascii <= 57) { - // The character is a number, so it cant be a capital. - $isCaps = false; - } else { - if (strtoupper($string[$i]) === $string[$i]) { - $isCaps = true; - } else { - $isCaps = false; - } - } - - if ($isCaps === true && $lastCharWasCaps === true) { - return false; - } - - $lastCharWasCaps = $isCaps; - } - }//end if - - return true; - - }//end isCamelCaps() - - - /** - * Returns true if the specified string is in the underscore caps format. - * - * @param string $string The string to verify. - * - * @return boolean - */ - public static function isUnderscoreName($string) - { - // If there are space in the name, it can't be valid. - if (strpos($string, ' ') !== false) { - return false; - } - - $validName = true; - $nameBits = explode('_', $string); - - if (preg_match('|^[A-Z]|', $string) === 0) { - // Name does not begin with a capital letter. - $validName = false; - } else { - foreach ($nameBits as $bit) { - if ($bit === '') { - continue; - } - - if ($bit[0] !== strtoupper($bit[0])) { - $validName = false; - break; - } - } - } - - return $validName; - - }//end isUnderscoreName() - - - /** - * Returns a valid variable type for param/var tags. - * - * If type is not one of the standard types, it must be a custom type. - * Returns the correct type name suggestion if type name is invalid. - * - * @param string $varType The variable type to process. - * - * @return string - */ - public static function suggestType($varType) - { - if ($varType === '') { - return ''; - } - - if (in_array($varType, self::$allowedTypes, true) === true) { - return $varType; - } else { - $lowerVarType = strtolower($varType); - switch ($lowerVarType) { - case 'bool': - case 'boolean': - return 'boolean'; - case 'double': - case 'real': - case 'float': - return 'float'; - case 'int': - case 'integer': - return 'integer'; - case 'array()': - case 'array': - return 'array'; - }//end switch - - if (strpos($lowerVarType, 'array(') !== false) { - // Valid array declaration: - // array, array(type), array(type1 => type2). - $matches = []; - $pattern = '/^array\(\s*([^\s^=^>]*)(\s*=>\s*(.*))?\s*\)/i'; - if (preg_match($pattern, $varType, $matches) !== 0) { - $type1 = ''; - if (isset($matches[1]) === true) { - $type1 = $matches[1]; - } - - $type2 = ''; - if (isset($matches[3]) === true) { - $type2 = $matches[3]; - } - - $type1 = self::suggestType($type1); - $type2 = self::suggestType($type2); - if ($type2 !== '') { - $type2 = ' => '.$type2; - } - - return "array($type1$type2)"; - } else { - return 'array'; - }//end if - } else if (in_array($lowerVarType, self::$allowedTypes, true) === true) { - // A valid type, but not lower cased. - return $lowerVarType; - } else { - // Must be a custom type name. - return $varType; - }//end if - }//end if - - }//end suggestType() - - - /** - * Given a sniff class name, returns the code for the sniff. - * - * @param string $sniffClass The fully qualified sniff class name. - * - * @return string - */ - public static function getSniffCode($sniffClass) - { - $parts = explode('\\', $sniffClass); - $sniff = array_pop($parts); - - if (substr($sniff, -5) === 'Sniff') { - // Sniff class name. - $sniff = substr($sniff, 0, -5); - } else { - // Unit test class name. - $sniff = substr($sniff, 0, -8); - } - - $category = array_pop($parts); - $sniffDir = array_pop($parts); - $standard = array_pop($parts); - $code = $standard.'.'.$category.'.'.$sniff; - return $code; - - }//end getSniffCode() - - - /** - * Removes project-specific information from a sniff class name. - * - * @param string $sniffClass The fully qualified sniff class name. - * - * @return string - */ - public static function cleanSniffClass($sniffClass) - { - $newName = strtolower($sniffClass); - - $sniffPos = strrpos($newName, '\sniffs\\'); - if ($sniffPos === false) { - // Nothing we can do as it isn't in a known format. - return $newName; - } - - $end = (strlen($newName) - $sniffPos + 1); - $start = strrpos($newName, '\\', ($end * -1)); - - if ($start === false) { - // Nothing needs to be cleaned. - return $newName; - } - - $newName = substr($newName, ($start + 1)); - return $newName; - - }//end cleanSniffClass() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Util/Standards.php b/vendor/squizlabs/php_codesniffer/src/Util/Standards.php deleted file mode 100644 index 50f58f0..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Util/Standards.php +++ /dev/null @@ -1,334 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Util; - -use PHP_CodeSniffer\Config; - -class Standards -{ - - - /** - * Get a list of paths where standards are installed. - * - * Unresolvable relative paths will be excluded from the results. - * - * @return array - */ - public static function getInstalledStandardPaths() - { - $ds = DIRECTORY_SEPARATOR; - - $installedPaths = [dirname(dirname(__DIR__)).$ds.'src'.$ds.'Standards']; - $configPaths = Config::getConfigData('installed_paths'); - if ($configPaths !== null) { - $installedPaths = array_merge($installedPaths, explode(',', $configPaths)); - } - - $resolvedInstalledPaths = []; - foreach ($installedPaths as $installedPath) { - if (substr($installedPath, 0, 1) === '.') { - $installedPath = Common::realPath(__DIR__.$ds.'..'.$ds.'..'.$ds.$installedPath); - if ($installedPath === false) { - continue; - } - } - - $resolvedInstalledPaths[] = $installedPath; - } - - return $resolvedInstalledPaths; - - }//end getInstalledStandardPaths() - - - /** - * Get the details of all coding standards installed. - * - * Coding standards are directories located in the - * CodeSniffer/Standards directory. Valid coding standards - * include a Sniffs subdirectory. - * - * The details returned for each standard are: - * - path: the path to the coding standard's main directory - * - name: the name of the coding standard, as sourced from the ruleset.xml file - * - namespace: the namespace used by the coding standard, as sourced from the ruleset.xml file - * - * If you only need the paths to the installed standards, - * use getInstalledStandardPaths() instead as it performs less work to - * retrieve coding standard names. - * - * @param boolean $includeGeneric If true, the special "Generic" - * coding standard will be included - * if installed. - * @param string $standardsDir A specific directory to look for standards - * in. If not specified, PHP_CodeSniffer will - * look in its default locations. - * - * @return array - * @see getInstalledStandardPaths() - */ - public static function getInstalledStandardDetails( - $includeGeneric=false, - $standardsDir='' - ) { - $rulesets = []; - - if ($standardsDir === '') { - $installedPaths = self::getInstalledStandardPaths(); - } else { - $installedPaths = [$standardsDir]; - } - - foreach ($installedPaths as $standardsDir) { - // Check if the installed dir is actually a standard itself. - $csFile = $standardsDir.'/ruleset.xml'; - if (is_file($csFile) === true) { - $rulesets[] = $csFile; - continue; - } - - if (is_dir($standardsDir) === false) { - continue; - } - - $di = new \DirectoryIterator($standardsDir); - foreach ($di as $file) { - if ($file->isDir() === true && $file->isDot() === false) { - $filename = $file->getFilename(); - - // Ignore the special "Generic" standard. - if ($includeGeneric === false && $filename === 'Generic') { - continue; - } - - // Valid coding standard dirs include a ruleset. - $csFile = $file->getPathname().'/ruleset.xml'; - if (is_file($csFile) === true) { - $rulesets[] = $csFile; - } - } - } - }//end foreach - - $installedStandards = []; - - foreach ($rulesets as $rulesetPath) { - $ruleset = @simplexml_load_string(file_get_contents($rulesetPath)); - if ($ruleset === false) { - continue; - } - - $standardName = (string) $ruleset['name']; - $dirname = basename(dirname($rulesetPath)); - - if (isset($ruleset['namespace']) === true) { - $namespace = (string) $ruleset['namespace']; - } else { - $namespace = $dirname; - } - - $installedStandards[$dirname] = [ - 'path' => dirname($rulesetPath), - 'name' => $standardName, - 'namespace' => $namespace, - ]; - }//end foreach - - return $installedStandards; - - }//end getInstalledStandardDetails() - - - /** - * Get a list of all coding standards installed. - * - * Coding standards are directories located in the - * CodeSniffer/Standards directory. Valid coding standards - * include a Sniffs subdirectory. - * - * @param boolean $includeGeneric If true, the special "Generic" - * coding standard will be included - * if installed. - * @param string $standardsDir A specific directory to look for standards - * in. If not specified, PHP_CodeSniffer will - * look in its default locations. - * - * @return array - * @see isInstalledStandard() - */ - public static function getInstalledStandards( - $includeGeneric=false, - $standardsDir='' - ) { - $installedStandards = []; - - if ($standardsDir === '') { - $installedPaths = self::getInstalledStandardPaths(); - } else { - $installedPaths = [$standardsDir]; - } - - foreach ($installedPaths as $standardsDir) { - // Check if the installed dir is actually a standard itself. - $csFile = $standardsDir.'/ruleset.xml'; - if (is_file($csFile) === true) { - $installedStandards[] = basename($standardsDir); - continue; - } - - if (is_dir($standardsDir) === false) { - // Doesn't exist. - continue; - } - - $di = new \DirectoryIterator($standardsDir); - foreach ($di as $file) { - if ($file->isDir() === true && $file->isDot() === false) { - $filename = $file->getFilename(); - - // Ignore the special "Generic" standard. - if ($includeGeneric === false && $filename === 'Generic') { - continue; - } - - // Valid coding standard dirs include a ruleset. - $csFile = $file->getPathname().'/ruleset.xml'; - if (is_file($csFile) === true) { - $installedStandards[] = $filename; - } - } - } - }//end foreach - - return $installedStandards; - - }//end getInstalledStandards() - - - /** - * Determine if a standard is installed. - * - * Coding standards are directories located in the - * CodeSniffer/Standards directory. Valid coding standards - * include a ruleset.xml file. - * - * @param string $standard The name of the coding standard. - * - * @return boolean - * @see getInstalledStandards() - */ - public static function isInstalledStandard($standard) - { - $path = self::getInstalledStandardPath($standard); - if ($path !== null && strpos($path, 'ruleset.xml') !== false) { - return true; - } else { - // This could be a custom standard, installed outside our - // standards directory. - $standard = Common::realPath($standard); - if ($standard === false) { - return false; - } - - // Might be an actual ruleset file itUtil. - // If it has an XML extension, let's at least try it. - if (is_file($standard) === true - && (substr(strtolower($standard), -4) === '.xml' - || substr(strtolower($standard), -9) === '.xml.dist') - ) { - return true; - } - - // If it is a directory with a ruleset.xml file in it, - // it is a standard. - $ruleset = rtrim($standard, ' /\\').DIRECTORY_SEPARATOR.'ruleset.xml'; - if (is_file($ruleset) === true) { - return true; - } - }//end if - - return false; - - }//end isInstalledStandard() - - - /** - * Return the path of an installed coding standard. - * - * Coding standards are directories located in the - * CodeSniffer/Standards directory. Valid coding standards - * include a ruleset.xml file. - * - * @param string $standard The name of the coding standard. - * - * @return string|null - */ - public static function getInstalledStandardPath($standard) - { - if (strpos($standard, '.') !== false) { - return null; - } - - $installedPaths = self::getInstalledStandardPaths(); - foreach ($installedPaths as $installedPath) { - $standardPath = $installedPath.DIRECTORY_SEPARATOR.$standard; - if (file_exists($standardPath) === false) { - if (basename($installedPath) !== $standard) { - continue; - } - - $standardPath = $installedPath; - } - - $path = Common::realpath($standardPath.DIRECTORY_SEPARATOR.'ruleset.xml'); - - if ($path !== false && is_file($path) === true) { - return $path; - } else if (Common::isPharFile($standardPath) === true) { - $path = Common::realpath($standardPath); - if ($path !== false) { - return $path; - } - } - }//end foreach - - return null; - - }//end getInstalledStandardPath() - - - /** - * Prints out a list of installed coding standards. - * - * @return void - */ - public static function printInstalledStandards() - { - $installedStandards = self::getInstalledStandards(); - $numStandards = count($installedStandards); - - if ($numStandards === 0) { - echo 'No coding standards are installed.'.PHP_EOL; - } else { - $lastStandard = array_pop($installedStandards); - if ($numStandards === 1) { - echo "The only coding standard installed is $lastStandard".PHP_EOL; - } else { - $standardList = implode(', ', $installedStandards); - $standardList .= ' and '.$lastStandard; - echo 'The installed coding standards are '.$standardList.PHP_EOL; - } - } - - }//end printInstalledStandards() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Util/Timing.php b/vendor/squizlabs/php_codesniffer/src/Util/Timing.php deleted file mode 100644 index 95ee852..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Util/Timing.php +++ /dev/null @@ -1,86 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Util; - -class Timing -{ - - /** - * The start time of the run. - * - * @var float - */ - private static $startTime; - - /** - * Used to make sure we only print the run time once per run. - * - * @var boolean - */ - private static $printed = false; - - - /** - * Start recording time for the run. - * - * @return void - */ - public static function startTiming() - { - - self::$startTime = microtime(true); - - }//end startTiming() - - - /** - * Print information about the run. - * - * @param boolean $force If TRUE, prints the output even if it has - * already been printed during the run. - * - * @return void - */ - public static function printRunTime($force=false) - { - if ($force === false && self::$printed === true) { - // A double call. - return; - } - - if (self::$startTime === null) { - // Timing was never started. - return; - } - - $time = ((microtime(true) - self::$startTime) * 1000); - - if ($time > 60000) { - $mins = floor($time / 60000); - $secs = round((fmod($time, 60000) / 1000), 2); - $time = $mins.' mins'; - if ($secs !== 0) { - $time .= ", $secs secs"; - } - } else if ($time > 1000) { - $time = round(($time / 1000), 2).' secs'; - } else { - $time = round($time).'ms'; - } - - $mem = round((memory_get_peak_usage(true) / (1024 * 1024)), 2).'MB'; - echo "Time: $time; Memory: $mem".PHP_EOL.PHP_EOL; - - self::$printed = true; - - }//end printRunTime() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/src/Util/Tokens.php b/vendor/squizlabs/php_codesniffer/src/Util/Tokens.php deleted file mode 100644 index f501c7f..0000000 --- a/vendor/squizlabs/php_codesniffer/src/Util/Tokens.php +++ /dev/null @@ -1,716 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Util; - -define('T_NONE', 'PHPCS_T_NONE'); -define('T_OPEN_CURLY_BRACKET', 'PHPCS_T_OPEN_CURLY_BRACKET'); -define('T_CLOSE_CURLY_BRACKET', 'PHPCS_T_CLOSE_CURLY_BRACKET'); -define('T_OPEN_SQUARE_BRACKET', 'PHPCS_T_OPEN_SQUARE_BRACKET'); -define('T_CLOSE_SQUARE_BRACKET', 'PHPCS_T_CLOSE_SQUARE_BRACKET'); -define('T_OPEN_PARENTHESIS', 'PHPCS_T_OPEN_PARENTHESIS'); -define('T_CLOSE_PARENTHESIS', 'PHPCS_T_CLOSE_PARENTHESIS'); -define('T_COLON', 'PHPCS_T_COLON'); -define('T_NULLABLE', 'PHPCS_T_NULLABLE'); -define('T_STRING_CONCAT', 'PHPCS_T_STRING_CONCAT'); -define('T_INLINE_THEN', 'PHPCS_T_INLINE_THEN'); -define('T_INLINE_ELSE', 'PHPCS_T_INLINE_ELSE'); -define('T_NULL', 'PHPCS_T_NULL'); -define('T_FALSE', 'PHPCS_T_FALSE'); -define('T_TRUE', 'PHPCS_T_TRUE'); -define('T_SEMICOLON', 'PHPCS_T_SEMICOLON'); -define('T_EQUAL', 'PHPCS_T_EQUAL'); -define('T_MULTIPLY', 'PHPCS_T_MULTIPLY'); -define('T_DIVIDE', 'PHPCS_T_DIVIDE'); -define('T_PLUS', 'PHPCS_T_PLUS'); -define('T_MINUS', 'PHPCS_T_MINUS'); -define('T_MODULUS', 'PHPCS_T_MODULUS'); -define('T_BITWISE_AND', 'PHPCS_T_BITWISE_AND'); -define('T_BITWISE_OR', 'PHPCS_T_BITWISE_OR'); -define('T_BITWISE_XOR', 'PHPCS_T_BITWISE_XOR'); -define('T_BITWISE_NOT', 'PHPCS_T_BITWISE_NOT'); -define('T_ARRAY_HINT', 'PHPCS_T_ARRAY_HINT'); -define('T_GREATER_THAN', 'PHPCS_T_GREATER_THAN'); -define('T_LESS_THAN', 'PHPCS_T_LESS_THAN'); -define('T_BOOLEAN_NOT', 'PHPCS_T_BOOLEAN_NOT'); -define('T_SELF', 'PHPCS_T_SELF'); -define('T_PARENT', 'PHPCS_T_PARENT'); -define('T_DOUBLE_QUOTED_STRING', 'PHPCS_T_DOUBLE_QUOTED_STRING'); -define('T_COMMA', 'PHPCS_T_COMMA'); -define('T_HEREDOC', 'PHPCS_T_HEREDOC'); -define('T_PROTOTYPE', 'PHPCS_T_PROTOTYPE'); -define('T_THIS', 'PHPCS_T_THIS'); -define('T_REGULAR_EXPRESSION', 'PHPCS_T_REGULAR_EXPRESSION'); -define('T_PROPERTY', 'PHPCS_T_PROPERTY'); -define('T_LABEL', 'PHPCS_T_LABEL'); -define('T_OBJECT', 'PHPCS_T_OBJECT'); -define('T_CLOSE_OBJECT', 'PHPCS_T_CLOSE_OBJECT'); -define('T_COLOUR', 'PHPCS_T_COLOUR'); -define('T_HASH', 'PHPCS_T_HASH'); -define('T_URL', 'PHPCS_T_URL'); -define('T_STYLE', 'PHPCS_T_STYLE'); -define('T_ASPERAND', 'PHPCS_T_ASPERAND'); -define('T_DOLLAR', 'PHPCS_T_DOLLAR'); -define('T_TYPEOF', 'PHPCS_T_TYPEOF'); -define('T_CLOSURE', 'PHPCS_T_CLOSURE'); -define('T_ANON_CLASS', 'PHPCS_T_ANON_CLASS'); -define('T_BACKTICK', 'PHPCS_T_BACKTICK'); -define('T_START_NOWDOC', 'PHPCS_T_START_NOWDOC'); -define('T_NOWDOC', 'PHPCS_T_NOWDOC'); -define('T_END_NOWDOC', 'PHPCS_T_END_NOWDOC'); -define('T_OPEN_SHORT_ARRAY', 'PHPCS_T_OPEN_SHORT_ARRAY'); -define('T_CLOSE_SHORT_ARRAY', 'PHPCS_T_CLOSE_SHORT_ARRAY'); -define('T_GOTO_LABEL', 'PHPCS_T_GOTO_LABEL'); -define('T_BINARY_CAST', 'PHPCS_T_BINARY_CAST'); -define('T_EMBEDDED_PHP', 'PHPCS_T_EMBEDDED_PHP'); -define('T_RETURN_TYPE', 'PHPCS_T_RETURN_TYPE'); -define('T_OPEN_USE_GROUP', 'PHPCS_T_OPEN_USE_GROUP'); -define('T_CLOSE_USE_GROUP', 'PHPCS_T_CLOSE_USE_GROUP'); -define('T_ZSR', 'PHPCS_T_ZSR'); -define('T_ZSR_EQUAL', 'PHPCS_T_ZSR_EQUAL'); -define('T_FN_ARROW', 'PHPCS_T_FN_ARROW'); -define('T_TYPE_UNION', 'PHPCS_T_TYPE_UNION'); -define('T_PARAM_NAME', 'PHPCS_T_PARAM_NAME'); -define('T_MATCH_ARROW', 'PHPCS_T_MATCH_ARROW'); -define('T_MATCH_DEFAULT', 'PHPCS_T_MATCH_DEFAULT'); -define('T_ATTRIBUTE_END', 'PHPCS_T_ATTRIBUTE_END'); - -// Some PHP 5.5 tokens, replicated for lower versions. -if (defined('T_FINALLY') === false) { - define('T_FINALLY', 'PHPCS_T_FINALLY'); -} - -if (defined('T_YIELD') === false) { - define('T_YIELD', 'PHPCS_T_YIELD'); -} - -// Some PHP 5.6 tokens, replicated for lower versions. -if (defined('T_ELLIPSIS') === false) { - define('T_ELLIPSIS', 'PHPCS_T_ELLIPSIS'); -} - -if (defined('T_POW') === false) { - define('T_POW', 'PHPCS_T_POW'); -} - -if (defined('T_POW_EQUAL') === false) { - define('T_POW_EQUAL', 'PHPCS_T_POW_EQUAL'); -} - -// Some PHP 7 tokens, replicated for lower versions. -if (defined('T_SPACESHIP') === false) { - define('T_SPACESHIP', 'PHPCS_T_SPACESHIP'); -} - -if (defined('T_COALESCE') === false) { - define('T_COALESCE', 'PHPCS_T_COALESCE'); -} - -if (defined('T_COALESCE_EQUAL') === false) { - define('T_COALESCE_EQUAL', 'PHPCS_T_COALESCE_EQUAL'); -} - -if (defined('T_YIELD_FROM') === false) { - define('T_YIELD_FROM', 'PHPCS_T_YIELD_FROM'); -} - -// Some PHP 7.4 tokens, replicated for lower versions. -if (defined('T_BAD_CHARACTER') === false) { - define('T_BAD_CHARACTER', 'PHPCS_T_BAD_CHARACTER'); -} - -if (defined('T_FN') === false) { - define('T_FN', 'PHPCS_T_FN'); -} - -// Some PHP 8.0 tokens, replicated for lower versions. -if (defined('T_NULLSAFE_OBJECT_OPERATOR') === false) { - define('T_NULLSAFE_OBJECT_OPERATOR', 'PHPCS_T_NULLSAFE_OBJECT_OPERATOR'); -} - -if (defined('T_NAME_QUALIFIED') === false) { - define('T_NAME_QUALIFIED', 'PHPCS_T_NAME_QUALIFIED'); -} - -if (defined('T_NAME_FULLY_QUALIFIED') === false) { - define('T_NAME_FULLY_QUALIFIED', 'PHPCS_T_NAME_FULLY_QUALIFIED'); -} - -if (defined('T_NAME_RELATIVE') === false) { - define('T_NAME_RELATIVE', 'PHPCS_T_NAME_RELATIVE'); -} - -if (defined('T_MATCH') === false) { - define('T_MATCH', 'PHPCS_T_MATCH'); -} - -if (defined('T_ATTRIBUTE') === false) { - define('T_ATTRIBUTE', 'PHPCS_T_ATTRIBUTE'); -} - -// Some PHP 8.1 tokens, replicated for lower versions. -if (defined('T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG') === false) { - define('T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG', 'PHPCS_T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG'); -} - -if (defined('T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG') === false) { - define('T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG', 'PHPCS_T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG'); -} - -// Tokens used for parsing doc blocks. -define('T_DOC_COMMENT_STAR', 'PHPCS_T_DOC_COMMENT_STAR'); -define('T_DOC_COMMENT_WHITESPACE', 'PHPCS_T_DOC_COMMENT_WHITESPACE'); -define('T_DOC_COMMENT_TAG', 'PHPCS_T_DOC_COMMENT_TAG'); -define('T_DOC_COMMENT_OPEN_TAG', 'PHPCS_T_DOC_COMMENT_OPEN_TAG'); -define('T_DOC_COMMENT_CLOSE_TAG', 'PHPCS_T_DOC_COMMENT_CLOSE_TAG'); -define('T_DOC_COMMENT_STRING', 'PHPCS_T_DOC_COMMENT_STRING'); - -// Tokens used for PHPCS instruction comments. -define('T_PHPCS_ENABLE', 'PHPCS_T_PHPCS_ENABLE'); -define('T_PHPCS_DISABLE', 'PHPCS_T_PHPCS_DISABLE'); -define('T_PHPCS_SET', 'PHPCS_T_PHPCS_SET'); -define('T_PHPCS_IGNORE', 'PHPCS_T_PHPCS_IGNORE'); -define('T_PHPCS_IGNORE_FILE', 'PHPCS_T_PHPCS_IGNORE_FILE'); - -final class Tokens -{ - - /** - * The token weightings. - * - * @var array - */ - public static $weightings = [ - T_CLASS => 1000, - T_INTERFACE => 1000, - T_TRAIT => 1000, - T_NAMESPACE => 1000, - T_FUNCTION => 100, - T_CLOSURE => 100, - - /* - * Conditions. - */ - - T_WHILE => 50, - T_FOR => 50, - T_FOREACH => 50, - T_IF => 50, - T_ELSE => 50, - T_ELSEIF => 50, - T_DO => 50, - T_TRY => 50, - T_CATCH => 50, - T_FINALLY => 50, - T_SWITCH => 50, - T_MATCH => 50, - - T_SELF => 25, - T_PARENT => 25, - - /* - * Operators and arithmetic. - */ - - T_BITWISE_AND => 8, - T_BITWISE_OR => 8, - T_BITWISE_XOR => 8, - - T_MULTIPLY => 5, - T_DIVIDE => 5, - T_PLUS => 5, - T_MINUS => 5, - T_MODULUS => 5, - T_POW => 5, - T_SPACESHIP => 5, - T_COALESCE => 5, - T_COALESCE_EQUAL => 5, - - T_SL => 5, - T_SR => 5, - T_SL_EQUAL => 5, - T_SR_EQUAL => 5, - - T_EQUAL => 5, - T_AND_EQUAL => 5, - T_CONCAT_EQUAL => 5, - T_DIV_EQUAL => 5, - T_MINUS_EQUAL => 5, - T_MOD_EQUAL => 5, - T_MUL_EQUAL => 5, - T_OR_EQUAL => 5, - T_PLUS_EQUAL => 5, - T_XOR_EQUAL => 5, - - T_BOOLEAN_AND => 5, - T_BOOLEAN_OR => 5, - - /* - * Equality. - */ - - T_IS_EQUAL => 5, - T_IS_NOT_EQUAL => 5, - T_IS_IDENTICAL => 5, - T_IS_NOT_IDENTICAL => 5, - T_IS_SMALLER_OR_EQUAL => 5, - T_IS_GREATER_OR_EQUAL => 5, - ]; - - /** - * Tokens that represent assignments. - * - * @var array - */ - public static $assignmentTokens = [ - T_EQUAL => T_EQUAL, - T_AND_EQUAL => T_AND_EQUAL, - T_OR_EQUAL => T_OR_EQUAL, - T_CONCAT_EQUAL => T_CONCAT_EQUAL, - T_DIV_EQUAL => T_DIV_EQUAL, - T_MINUS_EQUAL => T_MINUS_EQUAL, - T_POW_EQUAL => T_POW_EQUAL, - T_MOD_EQUAL => T_MOD_EQUAL, - T_MUL_EQUAL => T_MUL_EQUAL, - T_PLUS_EQUAL => T_PLUS_EQUAL, - T_XOR_EQUAL => T_XOR_EQUAL, - T_DOUBLE_ARROW => T_DOUBLE_ARROW, - T_SL_EQUAL => T_SL_EQUAL, - T_SR_EQUAL => T_SR_EQUAL, - T_COALESCE_EQUAL => T_COALESCE_EQUAL, - T_ZSR_EQUAL => T_ZSR_EQUAL, - ]; - - /** - * Tokens that represent equality comparisons. - * - * @var array - */ - public static $equalityTokens = [ - T_IS_EQUAL => T_IS_EQUAL, - T_IS_NOT_EQUAL => T_IS_NOT_EQUAL, - T_IS_IDENTICAL => T_IS_IDENTICAL, - T_IS_NOT_IDENTICAL => T_IS_NOT_IDENTICAL, - T_IS_SMALLER_OR_EQUAL => T_IS_SMALLER_OR_EQUAL, - T_IS_GREATER_OR_EQUAL => T_IS_GREATER_OR_EQUAL, - ]; - - /** - * Tokens that represent comparison operator. - * - * @var array - */ - public static $comparisonTokens = [ - T_IS_EQUAL => T_IS_EQUAL, - T_IS_IDENTICAL => T_IS_IDENTICAL, - T_IS_NOT_EQUAL => T_IS_NOT_EQUAL, - T_IS_NOT_IDENTICAL => T_IS_NOT_IDENTICAL, - T_LESS_THAN => T_LESS_THAN, - T_GREATER_THAN => T_GREATER_THAN, - T_IS_SMALLER_OR_EQUAL => T_IS_SMALLER_OR_EQUAL, - T_IS_GREATER_OR_EQUAL => T_IS_GREATER_OR_EQUAL, - T_SPACESHIP => T_SPACESHIP, - T_COALESCE => T_COALESCE, - ]; - - /** - * Tokens that represent arithmetic operators. - * - * @var array - */ - public static $arithmeticTokens = [ - T_PLUS => T_PLUS, - T_MINUS => T_MINUS, - T_MULTIPLY => T_MULTIPLY, - T_DIVIDE => T_DIVIDE, - T_MODULUS => T_MODULUS, - T_POW => T_POW, - ]; - - /** - * Tokens that perform operations. - * - * @var array - */ - public static $operators = [ - T_MINUS => T_MINUS, - T_PLUS => T_PLUS, - T_MULTIPLY => T_MULTIPLY, - T_DIVIDE => T_DIVIDE, - T_MODULUS => T_MODULUS, - T_POW => T_POW, - T_SPACESHIP => T_SPACESHIP, - T_COALESCE => T_COALESCE, - T_BITWISE_AND => T_BITWISE_AND, - T_BITWISE_OR => T_BITWISE_OR, - T_BITWISE_XOR => T_BITWISE_XOR, - T_SL => T_SL, - T_SR => T_SR, - ]; - - /** - * Tokens that perform boolean operations. - * - * @var array - */ - public static $booleanOperators = [ - T_BOOLEAN_AND => T_BOOLEAN_AND, - T_BOOLEAN_OR => T_BOOLEAN_OR, - T_LOGICAL_AND => T_LOGICAL_AND, - T_LOGICAL_OR => T_LOGICAL_OR, - T_LOGICAL_XOR => T_LOGICAL_XOR, - ]; - - /** - * Tokens that represent casting. - * - * @var array - */ - public static $castTokens = [ - T_INT_CAST => T_INT_CAST, - T_STRING_CAST => T_STRING_CAST, - T_DOUBLE_CAST => T_DOUBLE_CAST, - T_ARRAY_CAST => T_ARRAY_CAST, - T_BOOL_CAST => T_BOOL_CAST, - T_OBJECT_CAST => T_OBJECT_CAST, - T_UNSET_CAST => T_UNSET_CAST, - T_BINARY_CAST => T_BINARY_CAST, - ]; - - /** - * Token types that open parenthesis. - * - * @var array - */ - public static $parenthesisOpeners = [ - T_ARRAY => T_ARRAY, - T_LIST => T_LIST, - T_FUNCTION => T_FUNCTION, - T_CLOSURE => T_CLOSURE, - T_ANON_CLASS => T_ANON_CLASS, - T_WHILE => T_WHILE, - T_FOR => T_FOR, - T_FOREACH => T_FOREACH, - T_SWITCH => T_SWITCH, - T_IF => T_IF, - T_ELSEIF => T_ELSEIF, - T_CATCH => T_CATCH, - T_DECLARE => T_DECLARE, - T_MATCH => T_MATCH, - ]; - - /** - * Tokens that are allowed to open scopes. - * - * @var array - */ - public static $scopeOpeners = [ - T_CLASS => T_CLASS, - T_ANON_CLASS => T_ANON_CLASS, - T_INTERFACE => T_INTERFACE, - T_TRAIT => T_TRAIT, - T_NAMESPACE => T_NAMESPACE, - T_FUNCTION => T_FUNCTION, - T_CLOSURE => T_CLOSURE, - T_IF => T_IF, - T_SWITCH => T_SWITCH, - T_CASE => T_CASE, - T_DECLARE => T_DECLARE, - T_DEFAULT => T_DEFAULT, - T_WHILE => T_WHILE, - T_ELSE => T_ELSE, - T_ELSEIF => T_ELSEIF, - T_FOR => T_FOR, - T_FOREACH => T_FOREACH, - T_DO => T_DO, - T_TRY => T_TRY, - T_CATCH => T_CATCH, - T_FINALLY => T_FINALLY, - T_PROPERTY => T_PROPERTY, - T_OBJECT => T_OBJECT, - T_USE => T_USE, - T_MATCH => T_MATCH, - ]; - - /** - * Tokens that represent scope modifiers. - * - * @var array - */ - public static $scopeModifiers = [ - T_PRIVATE => T_PRIVATE, - T_PUBLIC => T_PUBLIC, - T_PROTECTED => T_PROTECTED, - ]; - - /** - * Tokens that can prefix a method name - * - * @var array - */ - public static $methodPrefixes = [ - T_PRIVATE => T_PRIVATE, - T_PUBLIC => T_PUBLIC, - T_PROTECTED => T_PROTECTED, - T_ABSTRACT => T_ABSTRACT, - T_STATIC => T_STATIC, - T_FINAL => T_FINAL, - ]; - - /** - * Tokens that open code blocks. - * - * @var array - */ - public static $blockOpeners = [ - T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET, - T_OPEN_SQUARE_BRACKET => T_OPEN_SQUARE_BRACKET, - T_OPEN_PARENTHESIS => T_OPEN_PARENTHESIS, - T_OBJECT => T_OBJECT, - ]; - - /** - * Tokens that don't represent code. - * - * @var array - */ - public static $emptyTokens = [ - T_WHITESPACE => T_WHITESPACE, - T_COMMENT => T_COMMENT, - T_DOC_COMMENT => T_DOC_COMMENT, - T_DOC_COMMENT_STAR => T_DOC_COMMENT_STAR, - T_DOC_COMMENT_WHITESPACE => T_DOC_COMMENT_WHITESPACE, - T_DOC_COMMENT_TAG => T_DOC_COMMENT_TAG, - T_DOC_COMMENT_OPEN_TAG => T_DOC_COMMENT_OPEN_TAG, - T_DOC_COMMENT_CLOSE_TAG => T_DOC_COMMENT_CLOSE_TAG, - T_DOC_COMMENT_STRING => T_DOC_COMMENT_STRING, - T_PHPCS_ENABLE => T_PHPCS_ENABLE, - T_PHPCS_DISABLE => T_PHPCS_DISABLE, - T_PHPCS_SET => T_PHPCS_SET, - T_PHPCS_IGNORE => T_PHPCS_IGNORE, - T_PHPCS_IGNORE_FILE => T_PHPCS_IGNORE_FILE, - ]; - - /** - * Tokens that are comments. - * - * @var array - */ - public static $commentTokens = [ - T_COMMENT => T_COMMENT, - T_DOC_COMMENT => T_DOC_COMMENT, - T_DOC_COMMENT_STAR => T_DOC_COMMENT_STAR, - T_DOC_COMMENT_WHITESPACE => T_DOC_COMMENT_WHITESPACE, - T_DOC_COMMENT_TAG => T_DOC_COMMENT_TAG, - T_DOC_COMMENT_OPEN_TAG => T_DOC_COMMENT_OPEN_TAG, - T_DOC_COMMENT_CLOSE_TAG => T_DOC_COMMENT_CLOSE_TAG, - T_DOC_COMMENT_STRING => T_DOC_COMMENT_STRING, - T_PHPCS_ENABLE => T_PHPCS_ENABLE, - T_PHPCS_DISABLE => T_PHPCS_DISABLE, - T_PHPCS_SET => T_PHPCS_SET, - T_PHPCS_IGNORE => T_PHPCS_IGNORE, - T_PHPCS_IGNORE_FILE => T_PHPCS_IGNORE_FILE, - ]; - - /** - * Tokens that are comments containing PHPCS instructions. - * - * @var array - */ - public static $phpcsCommentTokens = [ - T_PHPCS_ENABLE => T_PHPCS_ENABLE, - T_PHPCS_DISABLE => T_PHPCS_DISABLE, - T_PHPCS_SET => T_PHPCS_SET, - T_PHPCS_IGNORE => T_PHPCS_IGNORE, - T_PHPCS_IGNORE_FILE => T_PHPCS_IGNORE_FILE, - ]; - - /** - * Tokens that represent strings. - * - * Note that T_STRINGS are NOT represented in this list. - * - * @var array - */ - public static $stringTokens = [ - T_CONSTANT_ENCAPSED_STRING => T_CONSTANT_ENCAPSED_STRING, - T_DOUBLE_QUOTED_STRING => T_DOUBLE_QUOTED_STRING, - ]; - - /** - * Tokens that represent text strings. - * - * @var array - */ - public static $textStringTokens = [ - T_CONSTANT_ENCAPSED_STRING => T_CONSTANT_ENCAPSED_STRING, - T_DOUBLE_QUOTED_STRING => T_DOUBLE_QUOTED_STRING, - T_INLINE_HTML => T_INLINE_HTML, - T_HEREDOC => T_HEREDOC, - T_NOWDOC => T_NOWDOC, - ]; - - /** - * Tokens that represent brackets and parenthesis. - * - * @var array - */ - public static $bracketTokens = [ - T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET, - T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET, - T_OPEN_SQUARE_BRACKET => T_OPEN_SQUARE_BRACKET, - T_CLOSE_SQUARE_BRACKET => T_CLOSE_SQUARE_BRACKET, - T_OPEN_PARENTHESIS => T_OPEN_PARENTHESIS, - T_CLOSE_PARENTHESIS => T_CLOSE_PARENTHESIS, - ]; - - /** - * Tokens that include files. - * - * @var array - */ - public static $includeTokens = [ - T_REQUIRE_ONCE => T_REQUIRE_ONCE, - T_REQUIRE => T_REQUIRE, - T_INCLUDE_ONCE => T_INCLUDE_ONCE, - T_INCLUDE => T_INCLUDE, - ]; - - /** - * Tokens that make up a heredoc string. - * - * @var array - */ - public static $heredocTokens = [ - T_START_HEREDOC => T_START_HEREDOC, - T_END_HEREDOC => T_END_HEREDOC, - T_HEREDOC => T_HEREDOC, - T_START_NOWDOC => T_START_NOWDOC, - T_END_NOWDOC => T_END_NOWDOC, - T_NOWDOC => T_NOWDOC, - ]; - - /** - * Tokens that represent the names of called functions. - * - * Mostly, these are just strings. But PHP tokenizes some language - * constructs and functions using their own tokens. - * - * @var array - */ - public static $functionNameTokens = [ - T_STRING => T_STRING, - T_EVAL => T_EVAL, - T_EXIT => T_EXIT, - T_INCLUDE => T_INCLUDE, - T_INCLUDE_ONCE => T_INCLUDE_ONCE, - T_REQUIRE => T_REQUIRE, - T_REQUIRE_ONCE => T_REQUIRE_ONCE, - T_ISSET => T_ISSET, - T_UNSET => T_UNSET, - T_EMPTY => T_EMPTY, - T_SELF => T_SELF, - T_STATIC => T_STATIC, - ]; - - /** - * Tokens that open class and object scopes. - * - * @var array - */ - public static $ooScopeTokens = [ - T_CLASS => T_CLASS, - T_ANON_CLASS => T_ANON_CLASS, - T_INTERFACE => T_INTERFACE, - T_TRAIT => T_TRAIT, - ]; - - /** - * Tokens representing PHP magic constants. - * - * @var array => - * - * @link https://www.php.net/language.constants.predefined PHP Manual on magic constants - */ - public static $magicConstants = [ - T_CLASS_C => T_CLASS_C, - T_DIR => T_DIR, - T_FILE => T_FILE, - T_FUNC_C => T_FUNC_C, - T_LINE => T_LINE, - T_METHOD_C => T_METHOD_C, - T_NS_C => T_NS_C, - T_TRAIT_C => T_TRAIT_C, - ]; - - - /** - * Given a token, returns the name of the token. - * - * If passed an integer, the token name is sourced from PHP's token_name() - * function. If passed a string, it is assumed to be a PHPCS-supplied token - * that begins with PHPCS_T_, so the name is sourced from the token value itself. - * - * @param int|string $token The token to get the name for. - * - * @return string - */ - public static function tokenName($token) - { - if (is_string($token) === false) { - // PHP-supplied token name. - return token_name($token); - } - - return substr($token, 6); - - }//end tokenName() - - - /** - * Returns the highest weighted token type. - * - * Tokens are weighted by their approximate frequency of appearance in code - * - the less frequently they appear in the code, the higher the weighting. - * For example T_CLASS tokens appear very infrequently in a file, and - * therefore have a high weighting. - * - * Returns false if there are no weightings for any of the specified tokens. - * - * @param array $tokens The token types to get the highest weighted - * type for. - * - * @return int|false The highest weighted token. - */ - public static function getHighestWeightedToken(array $tokens) - { - $highest = -1; - $highestType = false; - - $weights = self::$weightings; - - foreach ($tokens as $token) { - if (isset($weights[$token]) === true) { - $weight = $weights[$token]; - } else { - $weight = 0; - } - - if ($weight > $highest) { - $highest = $weight; - $highestType = $token; - } - } - - return $highestType; - - }//end getHighestWeightedToken() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/AllTests.php b/vendor/squizlabs/php_codesniffer/tests/AllTests.php deleted file mode 100644 index 9d099c1..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/AllTests.php +++ /dev/null @@ -1,64 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tests; - -if ($GLOBALS['PHP_CODESNIFFER_PEAR'] === false) { - include_once 'Core/AllTests.php'; - include_once 'Standards/AllSniffs.php'; -} else { - include_once 'CodeSniffer/Core/AllTests.php'; - include_once 'CodeSniffer/Standards/AllSniffs.php'; - include_once 'FileList.php'; -} - -// PHPUnit 7 made the TestSuite run() method incompatible with -// older PHPUnit versions due to return type hints, so maintain -// two different suite objects. -$phpunit7 = false; -if (class_exists('\PHPUnit\Runner\Version') === true) { - $version = \PHPUnit\Runner\Version::id(); - if ($version[0] === '7') { - $phpunit7 = true; - } -} - -if ($phpunit7 === true) { - include_once 'TestSuite7.php'; -} else { - include_once 'TestSuite.php'; -} - -class PHP_CodeSniffer_AllTests -{ - - - /** - * Add all PHP_CodeSniffer test suites into a single test suite. - * - * @return \PHPUnit\Framework\TestSuite - */ - public static function suite() - { - $GLOBALS['PHP_CODESNIFFER_STANDARD_DIRS'] = []; - $GLOBALS['PHP_CODESNIFFER_TEST_DIRS'] = []; - - // Use a special PHP_CodeSniffer test suite so that we can - // unset our autoload function after the run. - $suite = new TestSuite('PHP CodeSniffer'); - - $suite->addTest(Core\AllTests::suite()); - $suite->addTest(Standards\AllSniffs::suite()); - - return $suite; - - }//end suite() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/AbstractMethodUnitTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/AbstractMethodUnitTest.php deleted file mode 100644 index 4d4f546..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/AbstractMethodUnitTest.php +++ /dev/null @@ -1,140 +0,0 @@ - - * @copyright 2018-2019 Juliette Reinders Folmer. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tests\Core; - -use PHP_CodeSniffer\Config; -use PHP_CodeSniffer\Ruleset; -use PHP_CodeSniffer\Files\DummyFile; -use PHPUnit\Framework\TestCase; - -abstract class AbstractMethodUnitTest extends TestCase -{ - - /** - * The file extension of the test case file (without leading dot). - * - * This allows child classes to overrule the default `inc` with, for instance, - * `js` or `css` when applicable. - * - * @var string - */ - protected static $fileExtension = 'inc'; - - /** - * The \PHP_CodeSniffer\Files\File object containing the parsed contents of the test case file. - * - * @var \PHP_CodeSniffer\Files\File - */ - protected static $phpcsFile; - - - /** - * Initialize & tokenize \PHP_CodeSniffer\Files\File with code from the test case file. - * - * The test case file for a unit test class has to be in the same directory - * directory and use the same file name as the test class, using the .inc extension. - * - * @return void - */ - public static function setUpBeforeClass() - { - $config = new Config(); - $config->standards = ['PSR1']; - - $ruleset = new Ruleset($config); - - // Default to a file with the same name as the test class. Extension is property based. - $relativeCN = str_replace(__NAMESPACE__, '', get_called_class()); - $relativePath = str_replace('\\', DIRECTORY_SEPARATOR, $relativeCN); - $pathToTestFile = realpath(__DIR__).$relativePath.'.'.static::$fileExtension; - - // Make sure the file gets parsed correctly based on the file type. - $contents = 'phpcs_input_file: '.$pathToTestFile.PHP_EOL; - $contents .= file_get_contents($pathToTestFile); - - self::$phpcsFile = new DummyFile($contents, $ruleset, $config); - self::$phpcsFile->process(); - - }//end setUpBeforeClass() - - - /** - * Clean up after finished test. - * - * @return void - */ - public static function tearDownAfterClass() - { - self::$phpcsFile = null; - - }//end tearDownAfterClass() - - - /** - * Get the token pointer for a target token based on a specific comment found on the line before. - * - * Note: the test delimiter comment MUST start with "/* test" to allow this function to - * distinguish between comments used *in* a test and test delimiters. - * - * @param string $commentString The delimiter comment to look for. - * @param int|string|array $tokenType The type of token(s) to look for. - * @param string $tokenContent Optional. The token content for the target token. - * - * @return int - */ - public function getTargetToken($commentString, $tokenType, $tokenContent=null) - { - $start = (self::$phpcsFile->numTokens - 1); - $comment = self::$phpcsFile->findPrevious( - T_COMMENT, - $start, - null, - false, - $commentString - ); - - $tokens = self::$phpcsFile->getTokens(); - $end = ($start + 1); - - // Limit the token finding to between this and the next delimiter comment. - for ($i = ($comment + 1); $i < $end; $i++) { - if ($tokens[$i]['code'] !== T_COMMENT) { - continue; - } - - if (stripos($tokens[$i]['content'], '/* test') === 0) { - $end = $i; - break; - } - } - - $target = self::$phpcsFile->findNext( - $tokenType, - ($comment + 1), - $end, - false, - $tokenContent - ); - - if ($target === false) { - $msg = 'Failed to find test target token for comment string: '.$commentString; - if ($tokenContent !== null) { - $msg .= ' With token content: '.$tokenContent; - } - - $this->assertFalse(true, $msg); - } - - return $target; - - }//end getTargetToken() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/AllTests.php b/vendor/squizlabs/php_codesniffer/tests/Core/AllTests.php deleted file mode 100644 index 304690e..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/AllTests.php +++ /dev/null @@ -1,63 +0,0 @@ - - * @author Juliette Reinders Folmer - * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tests\Core; - -use PHP_CodeSniffer\Tests\FileList; -use PHPUnit\TextUI\TestRunner; -use PHPUnit\Framework\TestSuite; - -class AllTests -{ - - - /** - * Prepare the test runner. - * - * @return void - */ - public static function main() - { - TestRunner::run(self::suite()); - - }//end main() - - - /** - * Add all core unit tests into a test suite. - * - * @return \PHPUnit\Framework\TestSuite - */ - public static function suite() - { - $suite = new TestSuite('PHP CodeSniffer Core'); - - $testFileIterator = new FileList(__DIR__, '', '`Test\.php$`Di'); - foreach ($testFileIterator->fileIterator as $file) { - if (strpos($file, 'AbstractMethodUnitTest.php') !== false) { - continue; - } - - include_once $file; - - $class = str_replace(__DIR__, '', $file); - $class = str_replace('.php', '', $class); - $class = str_replace('/', '\\', $class); - $class = 'PHP_CodeSniffer\Tests\Core'.$class; - - $suite->addTestSuite($class); - } - - return $suite; - - }//end suite() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Autoloader/DetermineLoadedClassTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Autoloader/DetermineLoadedClassTest.php deleted file mode 100644 index 65542b6..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Autoloader/DetermineLoadedClassTest.php +++ /dev/null @@ -1,118 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tests\Core\Autoloader; - -use PHPUnit\Framework\TestCase; - -class DetermineLoadedClassTest extends TestCase -{ - - - /** - * Load the test files. - * - * @return void - */ - public static function setUpBeforeClass() - { - include __DIR__.'/TestFiles/Sub/C.inc'; - - }//end setUpBeforeClass() - - - /** - * Test for when class list is ordered. - * - * @return void - */ - public function testOrdered() - { - $classesBeforeLoad = [ - 'classes' => [], - 'interfaces' => [], - 'traits' => [], - ]; - - $classesAfterLoad = [ - 'classes' => [ - 'PHP_CodeSniffer\Tests\Core\Autoloader\A', - 'PHP_CodeSniffer\Tests\Core\Autoloader\B', - 'PHP_CodeSniffer\Tests\Core\Autoloader\C', - 'PHP_CodeSniffer\Tests\Core\Autoloader\Sub\C', - ], - 'interfaces' => [], - 'traits' => [], - ]; - - $className = \PHP_CodeSniffer\Autoload::determineLoadedClass($classesBeforeLoad, $classesAfterLoad); - $this->assertEquals('PHP_CodeSniffer\Tests\Core\Autoloader\Sub\C', $className); - - }//end testOrdered() - - - /** - * Test for when class list is out of order. - * - * @return void - */ - public function testUnordered() - { - $classesBeforeLoad = [ - 'classes' => [], - 'interfaces' => [], - 'traits' => [], - ]; - - $classesAfterLoad = [ - 'classes' => [ - 'PHP_CodeSniffer\Tests\Core\Autoloader\A', - 'PHP_CodeSniffer\Tests\Core\Autoloader\Sub\C', - 'PHP_CodeSniffer\Tests\Core\Autoloader\C', - 'PHP_CodeSniffer\Tests\Core\Autoloader\B', - ], - 'interfaces' => [], - 'traits' => [], - ]; - - $className = \PHP_CodeSniffer\Autoload::determineLoadedClass($classesBeforeLoad, $classesAfterLoad); - $this->assertEquals('PHP_CodeSniffer\Tests\Core\Autoloader\Sub\C', $className); - - $classesAfterLoad = [ - 'classes' => [ - 'PHP_CodeSniffer\Tests\Core\Autoloader\A', - 'PHP_CodeSniffer\Tests\Core\Autoloader\C', - 'PHP_CodeSniffer\Tests\Core\Autoloader\Sub\C', - 'PHP_CodeSniffer\Tests\Core\Autoloader\B', - ], - 'interfaces' => [], - 'traits' => [], - ]; - - $className = \PHP_CodeSniffer\Autoload::determineLoadedClass($classesBeforeLoad, $classesAfterLoad); - $this->assertEquals('PHP_CodeSniffer\Tests\Core\Autoloader\Sub\C', $className); - - $classesAfterLoad = [ - 'classes' => [ - 'PHP_CodeSniffer\Tests\Core\Autoloader\Sub\C', - 'PHP_CodeSniffer\Tests\Core\Autoloader\A', - 'PHP_CodeSniffer\Tests\Core\Autoloader\C', - 'PHP_CodeSniffer\Tests\Core\Autoloader\B', - ], - 'interfaces' => [], - 'traits' => [], - ]; - - $className = \PHP_CodeSniffer\Autoload::determineLoadedClass($classesBeforeLoad, $classesAfterLoad); - $this->assertEquals('PHP_CodeSniffer\Tests\Core\Autoloader\Sub\C', $className); - - }//end testUnordered() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Autoloader/TestFiles/A.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Autoloader/TestFiles/A.inc deleted file mode 100644 index c143371..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Autoloader/TestFiles/A.inc +++ /dev/null @@ -1,3 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tests\Core; - -use PHP_CodeSniffer\Config; -use PHP_CodeSniffer\Ruleset; -use PHP_CodeSniffer\Files\DummyFile; -use PHPUnit\Framework\TestCase; - -class ErrorSuppressionTest extends TestCase -{ - - - /** - * Test suppressing a single error. - * - * @param string $before Annotation to place before the code. - * @param string $after Annotation to place after the code. - * @param int $expectedErrors Optional. Number of errors expected. - * Defaults to 0. - * - * @dataProvider dataSuppressError - * @covers PHP_CodeSniffer\Tokenizers\Tokenizer::createPositionMap - * - * @return void - */ - public function testSuppressError($before, $after, $expectedErrors=0) - { - static $config, $ruleset; - - if (isset($config, $ruleset) === false) { - $config = new Config(); - $config->standards = ['Generic']; - $config->sniffs = ['Generic.PHP.LowerCaseConstant']; - - $ruleset = new Ruleset($config); - } - - $content = 'process(); - - $this->assertSame($expectedErrors, $file->getErrorCount()); - $this->assertCount($expectedErrors, $file->getErrors()); - - }//end testSuppressError() - - - /** - * Data provider. - * - * @see testSuppressError() - * - * @return array - */ - public function dataSuppressError() - { - return [ - 'no suppression' => [ - 'before' => '', - 'after' => '', - 'expectedErrors' => 1, - ], - - // Inline slash comments. - 'disable/enable: slash comment' => [ - 'before' => '// phpcs:disable'.PHP_EOL, - 'after' => '// phpcs:enable', - ], - 'disable/enable: multi-line slash comment, tab indented' => [ - 'before' => "\t".'// For reasons'.PHP_EOL."\t".'// phpcs:disable'.PHP_EOL."\t", - 'after' => "\t".'// phpcs:enable', - ], - 'disable/enable: slash comment, with @' => [ - 'before' => '// @phpcs:disable'.PHP_EOL, - 'after' => '// @phpcs:enable', - ], - 'disable/enable: slash comment, mixed case' => [ - 'before' => '// PHPCS:Disable'.PHP_EOL, - 'after' => '// pHPcs:enabLE', - ], - - // Inline hash comments. - 'disable/enable: hash comment' => [ - 'before' => '# phpcs:disable'.PHP_EOL, - 'after' => '# phpcs:enable', - ], - 'disable/enable: multi-line hash comment, tab indented' => [ - 'before' => "\t".'# For reasons'.PHP_EOL."\t".'# phpcs:disable'.PHP_EOL."\t", - 'after' => "\t".'# phpcs:enable', - ], - 'disable/enable: hash comment, with @' => [ - 'before' => '# @phpcs:disable'.PHP_EOL, - 'after' => '# @phpcs:enable', - ], - 'disable/enable: hash comment, mixed case' => [ - 'before' => '# PHPCS:Disable'.PHP_EOL, - 'after' => '# pHPcs:enabLE', - ], - - // Inline star (block) comments. - 'disable/enable: star comment' => [ - 'before' => '/* phpcs:disable */'.PHP_EOL, - 'after' => '/* phpcs:enable */', - ], - 'disable/enable: multi-line star comment' => [ - 'before' => '/*'.PHP_EOL.' phpcs:disable'.PHP_EOL.' */'.PHP_EOL, - 'after' => '/*'.PHP_EOL.' phpcs:enable'.PHP_EOL.' */', - ], - 'disable/enable: multi-line star comment, each line starred' => [ - 'before' => '/*'.PHP_EOL.' * phpcs:disable'.PHP_EOL.' */'.PHP_EOL, - 'after' => '/*'.PHP_EOL.' * phpcs:enable'.PHP_EOL.' */', - ], - 'disable/enable: multi-line star comment, each line starred, tab indented' => [ - 'before' => "\t".'/*'.PHP_EOL."\t".' * phpcs:disable'.PHP_EOL."\t".' */'.PHP_EOL."\t", - 'after' => "\t".'/*'.PHP_EOL.' * phpcs:enable'.PHP_EOL.' */', - ], - - // Docblock comments. - 'disable/enable: single line docblock comment' => [ - 'before' => '/** phpcs:disable */'.PHP_EOL, - 'after' => '/** phpcs:enable */', - ], - - // Deprecated syntax. - 'old style: slash comment' => [ - 'before' => '// @codingStandardsIgnoreStart'.PHP_EOL, - 'after' => '// @codingStandardsIgnoreEnd', - ], - 'old style: star comment' => [ - 'before' => '/* @codingStandardsIgnoreStart */'.PHP_EOL, - 'after' => '/* @codingStandardsIgnoreEnd */', - ], - 'old style: multi-line star comment' => [ - 'before' => '/*'.PHP_EOL.' @codingStandardsIgnoreStart'.PHP_EOL.' */'.PHP_EOL, - 'after' => '/*'.PHP_EOL.' @codingStandardsIgnoreEnd'.PHP_EOL.' */', - ], - 'old style: single line docblock comment' => [ - 'before' => '/** @codingStandardsIgnoreStart */'.PHP_EOL, - 'after' => '/** @codingStandardsIgnoreEnd */', - ], - ]; - - }//end dataSuppressError() - - - /** - * Test suppressing 1 out of 2 errors. - * - * @param string $before Annotation to place before the code. - * @param string $between Annotation to place between the code. - * @param int $expectedErrors Optional. Number of errors expected. - * Defaults to 1. - * - * @dataProvider dataSuppressSomeErrors - * @covers PHP_CodeSniffer\Tokenizers\Tokenizer::createPositionMap - * - * @return void - */ - public function testSuppressSomeErrors($before, $between, $expectedErrors=1) - { - static $config, $ruleset; - - if (isset($config, $ruleset) === false) { - $config = new Config(); - $config->standards = ['Generic']; - $config->sniffs = ['Generic.PHP.LowerCaseConstant']; - - $ruleset = new Ruleset($config); - } - - $content = <<process(); - - $this->assertSame($expectedErrors, $file->getErrorCount()); - $this->assertCount($expectedErrors, $file->getErrors()); - - }//end testSuppressSomeErrors() - - - /** - * Data provider. - * - * @see testSuppressSomeErrors() - * - * @return array - */ - public function dataSuppressSomeErrors() - { - return [ - 'no suppression' => [ - 'before' => '', - 'between' => '', - 'expectedErrors' => 2, - ], - - // With suppression. - 'disable/enable: slash comment' => [ - 'before' => '// phpcs:disable', - 'between' => '// phpcs:enable', - ], - 'disable/enable: slash comment, with @' => [ - 'before' => '// @phpcs:disable', - 'between' => '// @phpcs:enable', - ], - 'disable/enable: hash comment' => [ - 'before' => '# phpcs:disable', - 'between' => '# phpcs:enable', - ], - 'disable/enable: hash comment, with @' => [ - 'before' => '# @phpcs:disable', - 'between' => '# @phpcs:enable', - ], - 'disable/enable: single line docblock comment' => [ - 'before' => '/** phpcs:disable */', - 'between' => '/** phpcs:enable */', - ], - - // Deprecated syntax. - 'old style: slash comment' => [ - 'before' => '// @codingStandardsIgnoreStart', - 'between' => '// @codingStandardsIgnoreEnd', - ], - 'old style: single line docblock comment' => [ - 'before' => '/** @codingStandardsIgnoreStart */', - 'between' => '/** @codingStandardsIgnoreEnd */', - ], - ]; - - }//end dataSuppressSomeErrors() - - - /** - * Test suppressing a single warning. - * - * @param string $before Annotation to place before the code. - * @param string $after Annotation to place after the code. - * @param int $expectedWarnings Optional. Number of warnings expected. - * Defaults to 0. - * - * @dataProvider dataSuppressWarning - * @covers PHP_CodeSniffer\Tokenizers\Tokenizer::createPositionMap - * - * @return void - */ - public function testSuppressWarning($before, $after, $expectedWarnings=0) - { - static $config, $ruleset; - - if (isset($config, $ruleset) === false) { - $config = new Config(); - $config->standards = ['Generic']; - $config->sniffs = ['Generic.Commenting.Todo']; - - $ruleset = new Ruleset($config); - } - - $content = <<process(); - - $this->assertSame($expectedWarnings, $file->getWarningCount()); - $this->assertCount($expectedWarnings, $file->getWarnings()); - - }//end testSuppressWarning() - - - /** - * Data provider. - * - * @see testSuppressWarning() - * - * @return array - */ - public function dataSuppressWarning() - { - return [ - 'no suppression' => [ - 'before' => '', - 'after' => '', - 'expectedWarnings' => 1, - ], - - // With suppression. - 'disable/enable: slash comment' => [ - 'before' => '// phpcs:disable', - 'after' => '// phpcs:enable', - ], - 'disable/enable: slash comment, with @' => [ - 'before' => '// @phpcs:disable', - 'after' => '// @phpcs:enable', - ], - 'disable/enable: single line docblock comment' => [ - 'before' => '/** phpcs:disable */', - 'after' => '/** phpcs:enable */', - ], - - // Deprecated syntax. - 'old style: slash comment' => [ - 'before' => '// @codingStandardsIgnoreStart', - 'after' => '// @codingStandardsIgnoreEnd', - ], - 'old style: single line docblock comment' => [ - 'before' => '/** @codingStandardsIgnoreStart */', - 'after' => '/** @codingStandardsIgnoreEnd */', - ], - ]; - - }//end dataSuppressWarning() - - - /** - * Test suppressing a single error using a single line ignore. - * - * @param string $before Annotation to place before the code. - * @param string $after Optional. Annotation to place after the code. - * Defaults to an empty string. - * @param int $expectedErrors Optional. Number of errors expected. - * Defaults to 1. - * - * @dataProvider dataSuppressLine - * @covers PHP_CodeSniffer\Tokenizers\Tokenizer::createPositionMap - * - * @return void - */ - public function testSuppressLine($before, $after='', $expectedErrors=1) - { - static $config, $ruleset; - - if (isset($config, $ruleset) === false) { - $config = new Config(); - $config->standards = ['Generic']; - $config->sniffs = ['Generic.PHP.LowerCaseConstant']; - - $ruleset = new Ruleset($config); - } - - $content = <<process(); - - $this->assertSame($expectedErrors, $file->getErrorCount()); - $this->assertCount($expectedErrors, $file->getErrors()); - - }//end testSuppressLine() - - - /** - * Data provider. - * - * @see testSuppressLine() - * - * @return array - */ - public function dataSuppressLine() - { - return [ - 'no suppression' => [ - 'before' => '', - 'after' => '', - 'expectedErrors' => 2, - ], - - // With suppression on line before. - 'ignore: line before, slash comment' => ['before' => '// phpcs:ignore'], - 'ignore: line before, slash comment, with @' => ['before' => '// @phpcs:ignore'], - 'ignore: line before, hash comment' => ['before' => '# phpcs:ignore'], - 'ignore: line before, hash comment, with @' => ['before' => '# @phpcs:ignore'], - 'ignore: line before, star comment' => ['before' => '/* phpcs:ignore */'], - 'ignore: line before, star comment, with @' => ['before' => '/* @phpcs:ignore */'], - - // With suppression as trailing comment on code line. - 'ignore: end of line, slash comment' => [ - 'before' => '', - 'after' => ' // phpcs:ignore', - ], - 'ignore: end of line, slash comment, with @' => [ - 'before' => '', - 'after' => ' // @phpcs:ignore', - ], - 'ignore: end of line, hash comment' => [ - 'before' => '', - 'after' => ' # phpcs:ignore', - ], - 'ignore: end of line, hash comment, with @' => [ - 'before' => '', - 'after' => ' # @phpcs:ignore', - ], - - // Deprecated syntax. - 'old style: line before, slash comment' => ['before' => '// @codingStandardsIgnoreLine'], - 'old style: end of line, slash comment' => [ - 'before' => '', - 'after' => ' // @codingStandardsIgnoreLine', - ], - ]; - - }//end dataSuppressLine() - - - /** - * Test suppressing a single error using a single line ignore in the middle of a line. - * - * @covers PHP_CodeSniffer\Tokenizers\Tokenizer::createPositionMap - * - * @return void - */ - public function testSuppressLineMidLine() - { - $config = new Config(); - $config->standards = ['Generic']; - $config->sniffs = ['Generic.PHP.LowerCaseConstant']; - - $ruleset = new Ruleset($config); - - $content = 'process(); - - $this->assertSame(0, $file->getErrorCount()); - $this->assertCount(0, $file->getErrors()); - - }//end testSuppressLineMidLine() - - - /** - * Test suppressing a single error using a single line ignore within a docblock. - * - * @covers PHP_CodeSniffer\Tokenizers\Tokenizer::createPositionMap - * - * @return void - */ - public function testSuppressLineWithinDocblock() - { - $config = new Config(); - $config->standards = ['Generic']; - $config->sniffs = ['Generic.Files.LineLength']; - - $ruleset = new Ruleset($config); - - // Process with @ suppression on line before inside docblock. - $comment = str_repeat('a ', 50); - $content = <<process(); - - $this->assertSame(0, $file->getErrorCount()); - $this->assertCount(0, $file->getErrors()); - - }//end testSuppressLineWithinDocblock() - - - /** - * Test that using a single line ignore does not interfere with other suppressions. - * - * @param string $before Annotation to place before the code. - * @param string $after Annotation to place after the code. - * - * @dataProvider dataNestedSuppressLine - * @covers PHP_CodeSniffer\Tokenizers\Tokenizer::createPositionMap - * - * @return void - */ - public function testNestedSuppressLine($before, $after) - { - static $config, $ruleset; - - if (isset($config, $ruleset) === false) { - $config = new Config(); - $config->standards = ['Generic']; - $config->sniffs = ['Generic.PHP.LowerCaseConstant']; - - $ruleset = new Ruleset($config); - } - - $content = <<process(); - - $this->assertSame(0, $file->getErrorCount()); - $this->assertCount(0, $file->getErrors()); - - }//end testNestedSuppressLine() - - - /** - * Data provider. - * - * @see testNestedSuppressLine() - * - * @return array - */ - public function dataNestedSuppressLine() - { - return [ - // Process with disable/enable suppression and no single line suppression. - 'disable/enable: slash comment, no single line suppression' => [ - 'before' => '// phpcs:disable', - 'after' => '// phpcs:enable', - ], - 'disable/enable: slash comment, with @, no single line suppression' => [ - 'before' => '// @phpcs:disable', - 'after' => '// @phpcs:enable', - ], - 'disable/enable: hash comment, no single line suppression' => [ - 'before' => '# phpcs:disable', - 'after' => '# phpcs:enable', - ], - 'old style: slash comment, no single line suppression' => [ - 'before' => '// @codingStandardsIgnoreStart', - 'after' => '// @codingStandardsIgnoreEnd', - ], - - // Process with line suppression nested within disable/enable suppression. - 'disable/enable: slash comment, next line nested single line suppression' => [ - 'before' => '// phpcs:disable'.PHP_EOL.'// phpcs:ignore', - 'after' => '// phpcs:enable', - ], - 'disable/enable: slash comment, with @, next line nested single line suppression' => [ - 'before' => '// @phpcs:disable'.PHP_EOL.'// @phpcs:ignore', - 'after' => '// @phpcs:enable', - ], - 'disable/enable: hash comment, next line nested single line suppression' => [ - 'before' => '# @phpcs:disable'.PHP_EOL.'# @phpcs:ignore', - 'after' => '# @phpcs:enable', - ], - 'old style: slash comment, next line nested single line suppression' => [ - 'before' => '// @codingStandardsIgnoreStart'.PHP_EOL.'// @codingStandardsIgnoreLine', - 'after' => '// @codingStandardsIgnoreEnd', - ], - ]; - - }//end dataNestedSuppressLine() - - - /** - * Test suppressing a scope opener. - * - * @param string $before Annotation to place before the scope opener. - * @param string $after Annotation to place after the scope opener. - * @param int $expectedErrors Optional. Number of errors expected. - * Defaults to 0. - * - * @dataProvider dataSuppressScope - * @covers PHP_CodeSniffer\Tokenizers\Tokenizer::createPositionMap - * - * @return void - */ - public function testSuppressScope($before, $after, $expectedErrors=0) - { - static $config, $ruleset; - - if (isset($config, $ruleset) === false) { - $config = new Config(); - $config->standards = ['PEAR']; - $config->sniffs = ['PEAR.Functions.FunctionDeclaration']; - - $ruleset = new Ruleset($config); - } - - $content = 'foo(); - } -} -EOD; - $file = new DummyFile($content, $ruleset, $config); - $file->process(); - - $this->assertSame($expectedErrors, $file->getErrorCount()); - $this->assertCount($expectedErrors, $file->getErrors()); - - }//end testSuppressScope() - - - /** - * Data provider. - * - * @see testSuppressScope() - * - * @return array - */ - public function dataSuppressScope() - { - return [ - 'no suppression' => [ - 'before' => '', - 'after' => '', - 'expectedErrors' => 1, - ], - - // Process with suppression. - 'disable/enable: slash comment' => [ - 'before' => '//phpcs:disable', - 'after' => '//phpcs:enable', - ], - 'disable/enable: slash comment, with @' => [ - 'before' => '//@phpcs:disable', - 'after' => '//@phpcs:enable', - ], - 'disable/enable: hash comment' => [ - 'before' => '#phpcs:disable', - 'after' => '#phpcs:enable', - ], - 'disable/enable: single line docblock comment' => [ - 'before' => '/** phpcs:disable */', - 'after' => '/** phpcs:enable */', - ], - 'disable/enable: single line docblock comment, with @' => [ - 'before' => '/** @phpcs:disable */', - 'after' => '/** @phpcs:enable */', - ], - - // Deprecated syntax. - 'old style: start/end, slash comment' => [ - 'before' => '//@codingStandardsIgnoreStart', - 'after' => '//@codingStandardsIgnoreEnd', - ], - 'old style: start/end, single line docblock comment' => [ - 'before' => '/** @codingStandardsIgnoreStart */', - 'after' => '/** @codingStandardsIgnoreEnd */', - ], - ]; - - }//end dataSuppressScope() - - - /** - * Test suppressing a whole file. - * - * @param string $before Annotation to place before the code. - * @param string $after Optional. Annotation to place after the code. - * Defaults to an empty string. - * @param int $expectedWarnings Optional. Number of warnings expected. - * Defaults to 0. - * - * @dataProvider dataSuppressFile - * @covers PHP_CodeSniffer\Tokenizers\Tokenizer::createPositionMap - * - * @return void - */ - public function testSuppressFile($before, $after='', $expectedWarnings=0) - { - static $config, $ruleset; - - if (isset($config, $ruleset) === false) { - $config = new Config(); - $config->standards = ['Generic']; - $config->sniffs = ['Generic.Commenting.Todo']; - - $ruleset = new Ruleset($config); - } - - $content = <<process(); - - $this->assertSame($expectedWarnings, $file->getWarningCount()); - $this->assertCount($expectedWarnings, $file->getWarnings()); - - }//end testSuppressFile() - - - /** - * Data provider. - * - * @see testSuppressFile() - * - * @return array - */ - public function dataSuppressFile() - { - return [ - 'no suppression' => [ - 'before' => '', - 'after' => '', - 'expectedErrors' => 1, - ], - - // Process with suppression. - 'ignoreFile: start of file, slash comment' => ['before' => '// phpcs:ignoreFile'], - 'ignoreFile: start of file, slash comment, with @' => ['before' => '// @phpcs:ignoreFile'], - 'ignoreFile: start of file, slash comment, mixed case' => ['before' => '// PHPCS:Ignorefile'], - 'ignoreFile: start of file, hash comment' => ['before' => '# phpcs:ignoreFile'], - 'ignoreFile: start of file, hash comment, with @' => ['before' => '# @phpcs:ignoreFile'], - 'ignoreFile: start of file, single-line star comment' => ['before' => '/* phpcs:ignoreFile */'], - 'ignoreFile: start of file, multi-line star comment' => [ - 'before' => '/*'.PHP_EOL.' phpcs:ignoreFile'.PHP_EOL.' */', - ], - 'ignoreFile: start of file, single-line docblock comment' => ['before' => '/** phpcs:ignoreFile */'], - - // Process late comment. - 'ignoreFile: late comment, slash comment' => [ - 'before' => '', - 'after' => '// phpcs:ignoreFile', - ], - - // Deprecated syntax. - 'old style: start of file, slash comment' => ['before' => '// @codingStandardsIgnoreFile'], - 'old style: start of file, single-line star comment' => ['before' => '/* @codingStandardsIgnoreFile */'], - 'old style: start of file, multi-line star comment' => [ - 'before' => '/*'.PHP_EOL.' @codingStandardsIgnoreFile'.PHP_EOL.' */', - ], - 'old style: start of file, single-line docblock comment' => ['before' => '/** @codingStandardsIgnoreFile */'], - - // Deprecated syntax, late comment. - 'old style: late comment, slash comment' => [ - 'before' => '', - 'after' => '// @codingStandardsIgnoreFile', - ], - ]; - - }//end dataSuppressFile() - - - /** - * Test disabling specific sniffs. - * - * @param string $before Annotation to place before the code. - * @param int $expectedErrors Optional. Number of errors expected. - * Defaults to 0. - * @param int $expectedWarnings Optional. Number of warnings expected. - * Defaults to 0. - * - * @dataProvider dataDisableSelected - * @covers PHP_CodeSniffer\Tokenizers\Tokenizer::createPositionMap - * - * @return void - */ - public function testDisableSelected($before, $expectedErrors=0, $expectedWarnings=0) - { - static $config, $ruleset; - - if (isset($config, $ruleset) === false) { - $config = new Config(); - $config->standards = ['Generic']; - $config->sniffs = [ - 'Generic.PHP.LowerCaseConstant', - 'Generic.Commenting.Todo', - ]; - - $ruleset = new Ruleset($config); - } - - $content = <<process(); - - $this->assertSame($expectedErrors, $file->getErrorCount()); - $this->assertCount($expectedErrors, $file->getErrors()); - - $this->assertSame($expectedWarnings, $file->getWarningCount()); - $this->assertCount($expectedWarnings, $file->getWarnings()); - - }//end testDisableSelected() - - - /** - * Data provider. - * - * @see testDisableSelected() - * - * @return array - */ - public function dataDisableSelected() - { - return [ - // Single sniff. - 'disable: single sniff' => [ - 'before' => '// phpcs:disable Generic.Commenting.Todo', - 'expectedErrors' => 1, - ], - 'disable: single sniff with reason' => [ - 'before' => '# phpcs:disable Generic.Commenting.Todo -- for reasons', - 'expectedErrors' => 1, - ], - 'disable: single sniff, docblock' => [ - 'before' => '/**'.PHP_EOL.' * phpcs:disable Generic.Commenting.Todo'.PHP_EOL.' */ ', - 'expectedErrors' => 1, - ], - 'disable: single sniff, docblock, with @' => [ - 'before' => '/**'.PHP_EOL.' * @phpcs:disable Generic.Commenting.Todo'.PHP_EOL.' */ ', - 'expectedErrors' => 1, - ], - - // Multiple sniffs. - 'disable: multiple sniffs in one comment' => ['before' => '// phpcs:disable Generic.Commenting.Todo,Generic.PHP.LowerCaseConstant'], - 'disable: multiple sniff in multiple comments' => [ - 'before' => '// phpcs:disable Generic.Commenting.Todo'.PHP_EOL.'// phpcs:disable Generic.PHP.LowerCaseConstant', - ], - - // Selectiveness variations. - 'disable: complete category' => [ - 'before' => '// phpcs:disable Generic.Commenting', - 'expectedErrors' => 1, - ], - 'disable: whole standard' => ['before' => '// phpcs:disable Generic'], - 'disable: single errorcode' => [ - 'before' => '# @phpcs:disable Generic.Commenting.Todo.TaskFound', - 'expectedErrors' => 1, - ], - 'disable: single errorcode and a category' => ['before' => '// phpcs:disable Generic.PHP.LowerCaseConstant.Found,Generic.Commenting'], - - // Wrong category/sniff/code. - 'disable: wrong error code and category' => [ - 'before' => '/**'.PHP_EOL.' * phpcs:disable Generic.PHP.LowerCaseConstant.Upper,Generic.Comments'.PHP_EOL.' */ ', - 'expectedErrors' => 1, - 'expectedWarnings' => 1, - ], - 'disable: wrong category, docblock' => [ - 'before' => '/**'.PHP_EOL.' * phpcs:disable Generic.Files'.PHP_EOL.' */ ', - 'expectedErrors' => 1, - 'expectedWarnings' => 1, - ], - 'disable: wrong category, docblock, with @' => [ - 'before' => '/**'.PHP_EOL.' * @phpcs:disable Generic.Files'.PHP_EOL.' */ ', - 'expectedErrors' => 1, - 'expectedWarnings' => 1, - ], - ]; - - }//end dataDisableSelected() - - - /** - * Test re-enabling specific sniffs that have been disabled. - * - * @param string $code Code pattern to check. - * @param int $expectedErrors Number of errors expected. - * @param int $expectedWarnings Number of warnings expected. - * - * @dataProvider dataEnableSelected - * @covers PHP_CodeSniffer\Tokenizers\Tokenizer::createPositionMap - * - * @return void - */ - public function testEnableSelected($code, $expectedErrors, $expectedWarnings) - { - static $config, $ruleset; - - if (isset($config, $ruleset) === false) { - $config = new Config(); - $config->standards = ['Generic']; - $config->sniffs = [ - 'Generic.PHP.LowerCaseConstant', - 'Generic.Commenting.Todo', - ]; - - $ruleset = new Ruleset($config); - } - - $content = 'process(); - - $this->assertSame($expectedErrors, $file->getErrorCount()); - $this->assertCount($expectedErrors, $file->getErrors()); - - $this->assertSame($expectedWarnings, $file->getWarningCount()); - $this->assertCount($expectedWarnings, $file->getWarnings()); - - }//end testEnableSelected() - - - /** - * Data provider. - * - * @see testEnableSelected() - * - * @return array - */ - public function dataEnableSelected() - { - return [ - 'disable/enable: a single sniff' => [ - 'code' => ' - // phpcs:disable Generic.Commenting.Todo - $var = FALSE; - //TODO: write some code - // phpcs:enable Generic.Commenting.Todo - //TODO: write some code', - 'expectedErrors' => 1, - 'expectedWarnings' => 1, - ], - 'disable/enable: multiple sniffs' => [ - 'code' => ' - // phpcs:disable Generic.Commenting.Todo,Generic.PHP.LowerCaseConstant - $var = FALSE; - //TODO: write some code - // phpcs:enable Generic.Commenting.Todo,Generic.PHP.LowerCaseConstant - //TODO: write some code - $var = FALSE;', - 'expectedErrors' => 1, - 'expectedWarnings' => 1, - ], - 'disable: multiple sniffs; enable: one' => [ - 'code' => ' - # phpcs:disable Generic.Commenting.Todo,Generic.PHP.LowerCaseConstant - $var = FALSE; - //TODO: write some code - # phpcs:enable Generic.Commenting.Todo - //TODO: write some code - $var = FALSE;', - 'expectedErrors' => 0, - 'expectedWarnings' => 1, - ], - 'disable/enable: complete category' => [ - 'code' => ' - // phpcs:disable Generic.Commenting - $var = FALSE; - //TODO: write some code - // phpcs:enable Generic.Commenting - //TODO: write some code', - 'expectedErrors' => 1, - 'expectedWarnings' => 1, - ], - 'disable/enable: whole standard' => [ - 'code' => ' - // phpcs:disable Generic - $var = FALSE; - //TODO: write some code - // phpcs:enable Generic - //TODO: write some code', - 'expectedErrors' => 0, - 'expectedWarnings' => 1, - ], - 'disable: whole standard; enable: category from the standard' => [ - 'code' => ' - // phpcs:disable Generic - $var = FALSE; - //TODO: write some code - // phpcs:enable Generic.Commenting - //TODO: write some code', - 'expectedErrors' => 0, - 'expectedWarnings' => 1, - ], - 'disable: a category; enable: the whole standard containing the category' => [ - 'code' => ' - # phpcs:disable Generic.Commenting - $var = FALSE; - //TODO: write some code - # phpcs:enable Generic - //TODO: write some code', - 'expectedErrors' => 1, - 'expectedWarnings' => 1, - ], - 'disable: single sniff; enable: the category containing the sniff' => [ - 'code' => ' - // phpcs:disable Generic.Commenting.Todo - $var = FALSE; - //TODO: write some code - // phpcs:enable Generic.Commenting - //TODO: write some code', - 'expectedErrors' => 1, - 'expectedWarnings' => 1, - ], - 'disable: whole standard; enable: single sniff from the standard' => [ - 'code' => ' - // phpcs:disable Generic - $var = FALSE; - //TODO: write some code - // phpcs:enable Generic.Commenting.Todo - //TODO: write some code', - 'expectedErrors' => 0, - 'expectedWarnings' => 1, - ], - 'disable: whole standard; enable: single sniff from the standard; disable: that same sniff; enable: everything' => [ - 'code' => ' - // phpcs:disable Generic - $var = FALSE; - //TODO: write some code - // phpcs:enable Generic.Commenting.Todo - //TODO: write some code - // phpcs:disable Generic.Commenting.Todo - //TODO: write some code - // phpcs:enable - //TODO: write some code', - 'expectedErrors' => 0, - 'expectedWarnings' => 2, - ], - 'disable: whole standard; enable: single sniff from the standard; enable: other sniff from the standard' => [ - 'code' => ' - // phpcs:disable Generic - $var = FALSE; - //TODO: write some code - // phpcs:enable Generic.Commenting.Todo - //TODO: write some code - $var = FALSE; - // phpcs:enable Generic.PHP.LowerCaseConstant - //TODO: write some code - $var = FALSE;', - 'expectedErrors' => 1, - 'expectedWarnings' => 2, - ], - ]; - - }//end dataEnableSelected() - - - /** - * Test ignoring specific sniffs. - * - * @param string $before Annotation to place before the code. - * @param int $expectedErrors Number of errors expected. - * @param int $expectedWarnings Number of warnings expected. - * - * @dataProvider dataIgnoreSelected - * @covers PHP_CodeSniffer\Tokenizers\Tokenizer::createPositionMap - * - * @return void - */ - public function testIgnoreSelected($before, $expectedErrors, $expectedWarnings) - { - static $config, $ruleset; - - if (isset($config, $ruleset) === false) { - $config = new Config(); - $config->standards = ['Generic']; - $config->sniffs = [ - 'Generic.PHP.LowerCaseConstant', - 'Generic.Commenting.Todo', - ]; - - $ruleset = new Ruleset($config); - } - - $content = <<process(); - - $this->assertSame($expectedErrors, $file->getErrorCount()); - $this->assertCount($expectedErrors, $file->getErrors()); - - $this->assertSame($expectedWarnings, $file->getWarningCount()); - $this->assertCount($expectedWarnings, $file->getWarnings()); - - }//end testIgnoreSelected() - - - /** - * Data provider. - * - * @see testIgnoreSelected() - * - * @return array - */ - public function dataIgnoreSelected() - { - return [ - 'no suppression' => [ - 'before' => '', - 'expectedErrors' => 2, - 'expectedWarnings' => 2, - ], - - // With suppression. - 'ignore: single sniff' => [ - 'before' => '// phpcs:ignore Generic.Commenting.Todo', - 'expectedErrors' => 2, - 'expectedWarnings' => 1, - ], - 'ignore: multiple sniffs' => [ - 'before' => '// phpcs:ignore Generic.Commenting.Todo,Generic.PHP.LowerCaseConstant', - 'expectedErrors' => 1, - 'expectedWarnings' => 1, - ], - 'disable: single sniff; ignore: single sniff' => [ - 'before' => '// phpcs:disable Generic.Commenting.Todo'.PHP_EOL.'// phpcs:ignore Generic.PHP.LowerCaseConstant', - 'expectedErrors' => 1, - 'expectedWarnings' => 0, - ], - 'ignore: category of sniffs' => [ - 'before' => '# phpcs:ignore Generic.Commenting', - 'expectedErrors' => 2, - 'expectedWarnings' => 1, - ], - 'ignore: whole standard' => [ - 'before' => '// phpcs:ignore Generic', - 'expectedErrors' => 1, - 'expectedWarnings' => 1, - ], - ]; - - }//end dataIgnoreSelected() - - - /** - * Test ignoring specific sniffs. - * - * @param string $code Code pattern to check. - * @param int $expectedErrors Number of errors expected. - * @param int $expectedWarnings Number of warnings expected. - * - * @dataProvider dataCommenting - * @covers PHP_CodeSniffer\Tokenizers\Tokenizer::createPositionMap - * - * @return void - */ - public function testCommenting($code, $expectedErrors, $expectedWarnings) - { - static $config, $ruleset; - - if (isset($config, $ruleset) === false) { - $config = new Config(); - $config->standards = ['Generic']; - $config->sniffs = [ - 'Generic.PHP.LowerCaseConstant', - 'Generic.Commenting.Todo', - ]; - - $ruleset = new Ruleset($config); - } - - $content = 'process(); - - $this->assertSame($expectedErrors, $file->getErrorCount()); - $this->assertCount($expectedErrors, $file->getErrors()); - - $this->assertSame($expectedWarnings, $file->getWarningCount()); - $this->assertCount($expectedWarnings, $file->getWarnings()); - - }//end testCommenting() - - - /** - * Data provider. - * - * @see testCommenting() - * - * @return array - */ - public function dataCommenting() - { - return [ - 'ignore: single sniff' => [ - 'code' => ' - // phpcs:ignore Generic.Commenting.Todo -- Because reasons - $var = FALSE; //TODO: write some code - $var = FALSE; //TODO: write some code', - 'expectedErrors' => 2, - 'expectedWarnings' => 1, - ], - 'disable: single sniff; enable: same sniff - test whitespace handling around reason delimiter' => [ - 'code' => ' - // phpcs:disable Generic.Commenting.Todo --Because reasons - $var = FALSE; - //TODO: write some code - // phpcs:enable Generic.Commenting.Todo -- Because reasons - //TODO: write some code', - 'expectedErrors' => 1, - 'expectedWarnings' => 1, - ], - 'disable: single sniff, multi-line comment' => [ - 'code' => ' - /* - Disable some checks - phpcs:disable Generic.Commenting.Todo - */ - $var = FALSE; - //TODO: write some code', - 'expectedErrors' => 1, - 'expectedWarnings' => 0, - ], - 'ignore: single sniff, multi-line slash comment' => [ - 'code' => ' - // Turn off a check for the next line of code. - // phpcs:ignore Generic.Commenting.Todo - $var = FALSE; //TODO: write some code - $var = FALSE; //TODO: write some code', - 'expectedErrors' => 2, - 'expectedWarnings' => 1, - ], - 'enable before disable, sniff not in standard' => [ - 'code' => ' - // phpcs:enable Generic.PHP.NoSilencedErrors -- Because reasons - $var = @delete( $filename ); - ', - 'expectedErrors' => 0, - 'expectedWarnings' => 0, - ], - ]; - - }//end dataCommenting() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/FindEndOfStatementTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/File/FindEndOfStatementTest.inc deleted file mode 100644 index 6dfd0a2..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/File/FindEndOfStatementTest.inc +++ /dev/null @@ -1,105 +0,0 @@ - fn() => return 1, - 'b' => fn() => return 1, -]; - -/* testStaticArrowFunction */ -static fn ($a) => $a; - -/* testArrowFunctionReturnValue */ -fn(): array => [a($a, $b)]; - -/* testArrowFunctionAsArgument */ -$foo = foo( - fn() => bar() -); - -/* testArrowFunctionWithArrayAsArgument */ -$foo = foo( - fn() => [$row[0], $row[3]] -); - -$match = match ($a) { - /* testMatchCase */ - 1 => 'foo', - /* testMatchDefault */ - default => 'bar' -}; - -$match = match ($a) { - /* testMatchMultipleCase */ - 1, 2, => $a * $b, - /* testMatchDefaultComma */ - default, => 'something' -}; - -match ($pressedKey) { - /* testMatchFunctionCall */ - Key::RETURN_ => save($value, $user) -}; - -$result = match (true) { - /* testMatchFunctionCallArm */ - str_contains($text, 'Welcome') || str_contains($text, 'Hello') => 'en', - str_contains($text, 'Bienvenue') || str_contains($text, 'Bonjour') => 'fr', - default => 'pl' -}; - -/* testMatchClosure */ -$result = match ($key) { - 1 => function($a, $b) {}, - 2 => function($b, $c) {}, -}; - -/* testMatchArray */ -$result = match ($key) { - 1 => [1,2,3], - 2 => [1 => one(), 2 => two()], -}; - -/* testNestedMatch */ -$result = match ($key) { - 1 => match ($key) { - 1 => 'one', - 2 => 'two', - }, - 2 => match ($key) { - 1 => 'two', - 2 => 'one', - }, -}; - -return 0; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/FindEndOfStatementTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/File/FindEndOfStatementTest.php deleted file mode 100644 index 7bff26b..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/File/FindEndOfStatementTest.php +++ /dev/null @@ -1,415 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tests\Core\File; - -use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest; - -class FindEndOfStatementTest extends AbstractMethodUnitTest -{ - - - /** - * Test a simple assignment. - * - * @return void - */ - public function testSimpleAssignment() - { - $start = $this->getTargetToken('/* testSimpleAssignment */', T_VARIABLE); - $found = self::$phpcsFile->findEndOfStatement($start); - - $this->assertSame(($start + 5), $found); - - }//end testSimpleAssignment() - - - /** - * Test a direct call to a control structure. - * - * @return void - */ - public function testControlStructure() - { - $start = $this->getTargetToken('/* testControlStructure */', T_WHILE); - $found = self::$phpcsFile->findEndOfStatement($start); - - $this->assertSame(($start + 6), $found); - - }//end testControlStructure() - - - /** - * Test the assignment of a closure. - * - * @return void - */ - public function testClosureAssignment() - { - $start = $this->getTargetToken('/* testClosureAssignment */', T_VARIABLE, '$a'); - $found = self::$phpcsFile->findEndOfStatement($start); - - $this->assertSame(($start + 13), $found); - - }//end testClosureAssignment() - - - /** - * Test using a heredoc in a function argument. - * - * @return void - */ - public function testHeredocFunctionArg() - { - // Find the end of the function. - $start = $this->getTargetToken('/* testHeredocFunctionArg */', T_STRING, 'myFunction'); - $found = self::$phpcsFile->findEndOfStatement($start); - - $this->assertSame(($start + 10), $found); - - // Find the end of the heredoc. - $start += 2; - $found = self::$phpcsFile->findEndOfStatement($start); - - $this->assertSame(($start + 4), $found); - - // Find the end of the last arg. - $start = ($found + 2); - $found = self::$phpcsFile->findEndOfStatement($start); - - $this->assertSame($start, $found); - - }//end testHeredocFunctionArg() - - - /** - * Test parts of a switch statement. - * - * @return void - */ - public function testSwitch() - { - // Find the end of the switch. - $start = $this->getTargetToken('/* testSwitch */', T_SWITCH); - $found = self::$phpcsFile->findEndOfStatement($start); - - $this->assertSame(($start + 28), $found); - - // Find the end of the case. - $start += 9; - $found = self::$phpcsFile->findEndOfStatement($start); - - $this->assertSame(($start + 8), $found); - - // Find the end of default case. - $start += 11; - $found = self::$phpcsFile->findEndOfStatement($start); - - $this->assertSame(($start + 6), $found); - - }//end testSwitch() - - - /** - * Test statements that are array values. - * - * @return void - */ - public function testStatementAsArrayValue() - { - // Test short array syntax. - $start = $this->getTargetToken('/* testStatementAsArrayValue */', T_NEW); - $found = self::$phpcsFile->findEndOfStatement($start); - - $this->assertSame(($start + 2), $found); - - // Test long array syntax. - $start += 12; - $found = self::$phpcsFile->findEndOfStatement($start); - - $this->assertSame(($start + 2), $found); - - // Test same statement outside of array. - $start += 10; - $found = self::$phpcsFile->findEndOfStatement($start); - - $this->assertSame(($start + 3), $found); - - }//end testStatementAsArrayValue() - - - /** - * Test a use group. - * - * @return void - */ - public function testUseGroup() - { - $start = $this->getTargetToken('/* testUseGroup */', T_USE); - $found = self::$phpcsFile->findEndOfStatement($start); - - $this->assertSame(($start + 23), $found); - - }//end testUseGroup() - - - /** - * Test arrow function as array value. - * - * @return void - */ - public function testArrowFunctionArrayValue() - { - $start = $this->getTargetToken('/* testArrowFunctionArrayValue */', T_FN); - $found = self::$phpcsFile->findEndOfStatement($start); - - $this->assertSame(($start + 9), $found); - - }//end testArrowFunctionArrayValue() - - - /** - * Test static arrow function. - * - * @return void - */ - public function testStaticArrowFunction() - { - $static = $this->getTargetToken('/* testStaticArrowFunction */', T_STATIC); - $fn = $this->getTargetToken('/* testStaticArrowFunction */', T_FN); - - $endOfStatementStatic = self::$phpcsFile->findEndOfStatement($static); - $endOfStatementFn = self::$phpcsFile->findEndOfStatement($fn); - - $this->assertSame($endOfStatementFn, $endOfStatementStatic); - - }//end testStaticArrowFunction() - - - /** - * Test arrow function with return value. - * - * @return void - */ - public function testArrowFunctionReturnValue() - { - $start = $this->getTargetToken('/* testArrowFunctionReturnValue */', T_FN); - $found = self::$phpcsFile->findEndOfStatement($start); - - $this->assertSame(($start + 18), $found); - - }//end testArrowFunctionReturnValue() - - - /** - * Test arrow function used as a function argument. - * - * @return void - */ - public function testArrowFunctionAsArgument() - { - $start = $this->getTargetToken('/* testArrowFunctionAsArgument */', T_FN); - $found = self::$phpcsFile->findEndOfStatement($start); - - $this->assertSame(($start + 8), $found); - - }//end testArrowFunctionAsArgument() - - - /** - * Test arrow function with arrays used as a function argument. - * - * @return void - */ - public function testArrowFunctionWithArrayAsArgument() - { - $start = $this->getTargetToken('/* testArrowFunctionWithArrayAsArgument */', T_FN); - $found = self::$phpcsFile->findEndOfStatement($start); - - $this->assertSame(($start + 17), $found); - - }//end testArrowFunctionWithArrayAsArgument() - - - /** - * Test simple match expression case. - * - * @return void - */ - public function testMatchCase() - { - $start = $this->getTargetToken('/* testMatchCase */', T_LNUMBER); - $found = self::$phpcsFile->findEndOfStatement($start); - - $this->assertSame(($start + 5), $found); - - $start = $this->getTargetToken('/* testMatchCase */', T_CONSTANT_ENCAPSED_STRING); - $found = self::$phpcsFile->findEndOfStatement($start); - - $this->assertSame(($start + 1), $found); - - }//end testMatchCase() - - - /** - * Test simple match expression default case. - * - * @return void - */ - public function testMatchDefault() - { - $start = $this->getTargetToken('/* testMatchDefault */', T_MATCH_DEFAULT); - $found = self::$phpcsFile->findEndOfStatement($start); - - $this->assertSame(($start + 4), $found); - - $start = $this->getTargetToken('/* testMatchDefault */', T_CONSTANT_ENCAPSED_STRING); - $found = self::$phpcsFile->findEndOfStatement($start); - - $this->assertSame($start, $found); - - }//end testMatchDefault() - - - /** - * Test multiple comma-separated match expression case values. - * - * @return void - */ - public function testMatchMultipleCase() - { - $start = $this->getTargetToken('/* testMatchMultipleCase */', T_LNUMBER); - $found = self::$phpcsFile->findEndOfStatement($start); - $this->assertSame(($start + 13), $found); - - $start += 6; - $found = self::$phpcsFile->findEndOfStatement($start); - $this->assertSame(($start + 7), $found); - - }//end testMatchMultipleCase() - - - /** - * Test match expression default case with trailing comma. - * - * @return void - */ - public function testMatchDefaultComma() - { - $start = $this->getTargetToken('/* testMatchDefaultComma */', T_MATCH_DEFAULT); - $found = self::$phpcsFile->findEndOfStatement($start); - - $this->assertSame(($start + 5), $found); - - }//end testMatchDefaultComma() - - - /** - * Test match expression with function call. - * - * @return void - */ - public function testMatchFunctionCall() - { - $start = $this->getTargetToken('/* testMatchFunctionCall */', T_STRING); - $found = self::$phpcsFile->findEndOfStatement($start); - - $this->assertSame(($start + 12), $found); - - $start += 8; - $found = self::$phpcsFile->findEndOfStatement($start); - - $this->assertSame(($start + 1), $found); - - }//end testMatchFunctionCall() - - - /** - * Test match expression with function call in the arm. - * - * @return void - */ - public function testMatchFunctionCallArm() - { - // Check the first case. - $start = $this->getTargetToken('/* testMatchFunctionCallArm */', T_STRING); - $found = self::$phpcsFile->findEndOfStatement($start); - - $this->assertSame(($start + 21), $found); - - // Check the second case. - $start += 24; - $found = self::$phpcsFile->findEndOfStatement($start); - - $this->assertSame(($start + 21), $found); - - }//end testMatchFunctionCallArm() - - - /** - * Test match expression with closure. - * - * @return void - */ - public function testMatchClosure() - { - $start = $this->getTargetToken('/* testMatchClosure */', T_LNUMBER); - $found = self::$phpcsFile->findEndOfStatement($start); - - $this->assertSame(($start + 14), $found); - - $start += 17; - $found = self::$phpcsFile->findEndOfStatement($start); - - $this->assertSame(($start + 14), $found); - - }//end testMatchClosure() - - - /** - * Test match expression with array declaration. - * - * @return void - */ - public function testMatchArray() - { - $start = $this->getTargetToken('/* testMatchArray */', T_LNUMBER); - $found = self::$phpcsFile->findEndOfStatement($start); - - $this->assertSame(($start + 11), $found); - - $start += 14; - $found = self::$phpcsFile->findEndOfStatement($start); - - $this->assertSame(($start + 22), $found); - - }//end testMatchArray() - - - /** - * Test nested match expressions. - * - * @return void - */ - public function testNestedMatch() - { - $start = $this->getTargetToken('/* testNestedMatch */', T_LNUMBER); - $found = self::$phpcsFile->findEndOfStatement($start); - - $this->assertSame(($start + 30), $found); - - $start += 21; - $found = self::$phpcsFile->findEndOfStatement($start); - - $this->assertSame(($start + 5), $found); - - }//end testNestedMatch() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/FindExtendedClassNameTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/File/FindExtendedClassNameTest.inc deleted file mode 100644 index aead06c..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/File/FindExtendedClassNameTest.inc +++ /dev/null @@ -1,37 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tests\Core\File; - -use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest; - -class FindExtendedClassNameTest extends AbstractMethodUnitTest -{ - - - /** - * Test retrieving the name of the class being extended by another class - * (or interface). - * - * @param string $identifier Comment which precedes the test case. - * @param bool $expected Expected function output. - * - * @dataProvider dataExtendedClass - * - * @return void - */ - public function testFindExtendedClassName($identifier, $expected) - { - $OOToken = $this->getTargetToken($identifier, [T_CLASS, T_ANON_CLASS, T_INTERFACE]); - $result = self::$phpcsFile->findExtendedClassName($OOToken); - $this->assertSame($expected, $result); - - }//end testFindExtendedClassName() - - - /** - * Data provider for the FindExtendedClassName test. - * - * @see testFindExtendedClassName() - * - * @return array - */ - public function dataExtendedClass() - { - return [ - [ - '/* testExtendedClass */', - 'testFECNClass', - ], - [ - '/* testNamespacedClass */', - '\PHP_CodeSniffer\Tests\Core\File\testFECNClass', - ], - [ - '/* testNonExtendedClass */', - false, - ], - [ - '/* testInterface */', - false, - ], - [ - '/* testInterfaceThatExtendsInterface */', - 'testFECNInterface', - ], - [ - '/* testInterfaceThatExtendsFQCNInterface */', - '\PHP_CodeSniffer\Tests\Core\File\testFECNInterface', - ], - [ - '/* testNestedExtendedClass */', - false, - ], - [ - '/* testNestedExtendedAnonClass */', - 'testFECNAnonClass', - ], - [ - '/* testClassThatExtendsAndImplements */', - 'testFECNClass', - ], - [ - '/* testClassThatImplementsAndExtends */', - 'testFECNClass', - ], - ]; - - }//end dataExtendedClass() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/FindImplementedInterfaceNamesTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/File/FindImplementedInterfaceNamesTest.inc deleted file mode 100644 index 3885b27..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/File/FindImplementedInterfaceNamesTest.inc +++ /dev/null @@ -1,26 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tests\Core\File; - -use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest; - -class FindImplementedInterfaceNamesTest extends AbstractMethodUnitTest -{ - - - /** - * Test retrieving the name(s) of the interfaces being implemented by a class. - * - * @param string $identifier Comment which precedes the test case. - * @param bool $expected Expected function output. - * - * @dataProvider dataImplementedInterface - * - * @return void - */ - public function testFindImplementedInterfaceNames($identifier, $expected) - { - $OOToken = $this->getTargetToken($identifier, [T_CLASS, T_ANON_CLASS, T_INTERFACE]); - $result = self::$phpcsFile->findImplementedInterfaceNames($OOToken); - $this->assertSame($expected, $result); - - }//end testFindImplementedInterfaceNames() - - - /** - * Data provider for the FindImplementedInterfaceNames test. - * - * @see testFindImplementedInterfaceNames() - * - * @return array - */ - public function dataImplementedInterface() - { - return [ - [ - '/* testImplementedClass */', - ['testFIINInterface'], - ], - [ - '/* testMultiImplementedClass */', - [ - 'testFIINInterface', - 'testFIINInterface2', - ], - ], - [ - '/* testNamespacedClass */', - ['\PHP_CodeSniffer\Tests\Core\File\testFIINInterface'], - ], - [ - '/* testNonImplementedClass */', - false, - ], - [ - '/* testInterface */', - false, - ], - [ - '/* testClassThatExtendsAndImplements */', - [ - 'InterfaceA', - '\NameSpaced\Cat\InterfaceB', - ], - ], - [ - '/* testClassThatImplementsAndExtends */', - [ - '\InterfaceA', - 'InterfaceB', - ], - ], - ]; - - }//end dataImplementedInterface() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/FindStartOfStatementTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/File/FindStartOfStatementTest.inc deleted file mode 100644 index ce9dfad..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/File/FindStartOfStatementTest.inc +++ /dev/null @@ -1,123 +0,0 @@ - $foo + $bar, 'b' => true]; - -/* testUseGroup */ -use Vendor\Package\{ClassA as A, ClassB, ClassC as C}; - -$a = [ - /* testArrowFunctionArrayValue */ - 'a' => fn() => return 1, - 'b' => fn() => return 1, -]; - -/* testStaticArrowFunction */ -static fn ($a) => $a; - -/* testArrowFunctionReturnValue */ -fn(): array => [a($a, $b)]; - -/* testArrowFunctionAsArgument */ -$foo = foo( - fn() => bar() -); - -/* testArrowFunctionWithArrayAsArgument */ -$foo = foo( - fn() => [$row[0], $row[3]] -); - -$match = match ($a) { - /* testMatchCase */ - 1 => 'foo', - /* testMatchDefault */ - default => 'bar' -}; - -$match = match ($a) { - /* testMatchMultipleCase */ - 1, 2, => $a * $b, - /* testMatchDefaultComma */ - default, => 'something' -}; - -match ($pressedKey) { - /* testMatchFunctionCall */ - Key::RETURN_ => save($value, $user) -}; - -$result = match (true) { - /* testMatchFunctionCallArm */ - str_contains($text, 'Welcome') || str_contains($text, 'Hello') => 'en', - str_contains($text, 'Bienvenue') || str_contains($text, 'Bonjour') => 'fr', - default => 'pl' -}; - -/* testMatchClosure */ -$result = match ($key) { - 1 => function($a, $b) {}, - 2 => function($b, $c) {}, -}; - -/* testMatchArray */ -$result = match ($key) { - 1 => [1,2,3], - 2 => [1 => one($a, $b), 2 => two($b, $c)], - 3 => [], -}; - -/* testNestedMatch */ -$result = match ($key) { - 1 => match ($key) { - 1 => 'one', - 2 => 'two', - }, - 2 => match ($key) { - 1 => 'two', - 2 => 'one', - }, -}; - -return 0; - -/* testOpenTag */ -?> -

    Test

    -', foo(), ''; - -/* testOpenTagWithEcho */ -?> -

    Test

    -', foo(), ''; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/FindStartOfStatementTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/File/FindStartOfStatementTest.php deleted file mode 100644 index 464021f..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/File/FindStartOfStatementTest.php +++ /dev/null @@ -1,503 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tests\Core\File; - -use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest; - -class FindStartOfStatementTest extends AbstractMethodUnitTest -{ - - - /** - * Test a simple assignment. - * - * @return void - */ - public function testSimpleAssignment() - { - $start = $this->getTargetToken('/* testSimpleAssignment */', T_SEMICOLON); - $found = self::$phpcsFile->findStartOfStatement($start); - - $this->assertSame(($start - 5), $found); - - }//end testSimpleAssignment() - - - /** - * Test a function call. - * - * @return void - */ - public function testFunctionCall() - { - $start = $this->getTargetToken('/* testFunctionCall */', T_CLOSE_PARENTHESIS); - $found = self::$phpcsFile->findStartOfStatement($start); - - $this->assertSame(($start - 6), $found); - - }//end testFunctionCall() - - - /** - * Test a function call. - * - * @return void - */ - public function testFunctionCallArgument() - { - $start = $this->getTargetToken('/* testFunctionCallArgument */', T_VARIABLE, '$b'); - $found = self::$phpcsFile->findStartOfStatement($start); - - $this->assertSame($start, $found); - - }//end testFunctionCallArgument() - - - /** - * Test a direct call to a control structure. - * - * @return void - */ - public function testControlStructure() - { - $start = $this->getTargetToken('/* testControlStructure */', T_CLOSE_CURLY_BRACKET); - $found = self::$phpcsFile->findStartOfStatement($start); - - $this->assertSame(($start - 6), $found); - - }//end testControlStructure() - - - /** - * Test the assignment of a closure. - * - * @return void - */ - public function testClosureAssignment() - { - $start = $this->getTargetToken('/* testClosureAssignment */', T_CLOSE_CURLY_BRACKET); - $found = self::$phpcsFile->findStartOfStatement($start); - - $this->assertSame(($start - 12), $found); - - }//end testClosureAssignment() - - - /** - * Test using a heredoc in a function argument. - * - * @return void - */ - public function testHeredocFunctionArg() - { - // Find the start of the function. - $start = $this->getTargetToken('/* testHeredocFunctionArg */', T_SEMICOLON); - $found = self::$phpcsFile->findStartOfStatement($start); - - $this->assertSame(($start - 10), $found); - - // Find the start of the heredoc. - $start -= 4; - $found = self::$phpcsFile->findStartOfStatement($start); - - $this->assertSame(($start - 4), $found); - - // Find the start of the last arg. - $start += 2; - $found = self::$phpcsFile->findStartOfStatement($start); - - $this->assertSame($start, $found); - - }//end testHeredocFunctionArg() - - - /** - * Test parts of a switch statement. - * - * @return void - */ - public function testSwitch() - { - // Find the start of the switch. - $start = $this->getTargetToken('/* testSwitch */', T_CLOSE_CURLY_BRACKET); - $found = self::$phpcsFile->findStartOfStatement($start); - - $this->assertSame(($start - 47), $found); - - // Find the start of default case. - $start -= 5; - $found = self::$phpcsFile->findStartOfStatement($start); - - $this->assertSame(($start - 6), $found); - - // Find the start of the second case. - $start -= 12; - $found = self::$phpcsFile->findStartOfStatement($start); - - $this->assertSame(($start - 5), $found); - - // Find the start of the first case. - $start -= 13; - $found = self::$phpcsFile->findStartOfStatement($start); - - $this->assertSame(($start - 8), $found); - - // Test inside the first case. - $start--; - $found = self::$phpcsFile->findStartOfStatement($start); - - $this->assertSame(($start - 1), $found); - - }//end testSwitch() - - - /** - * Test statements that are array values. - * - * @return void - */ - public function testStatementAsArrayValue() - { - // Test short array syntax. - $start = $this->getTargetToken('/* testStatementAsArrayValue */', T_STRING, 'Datetime'); - $found = self::$phpcsFile->findStartOfStatement($start); - - $this->assertSame(($start - 2), $found); - - // Test long array syntax. - $start += 12; - $found = self::$phpcsFile->findStartOfStatement($start); - - $this->assertSame(($start - 2), $found); - - // Test same statement outside of array. - $start++; - $found = self::$phpcsFile->findStartOfStatement($start); - - $this->assertSame(($start - 9), $found); - - // Test with an array index. - $start += 17; - $found = self::$phpcsFile->findStartOfStatement($start); - - $this->assertSame(($start - 5), $found); - - }//end testStatementAsArrayValue() - - - /** - * Test a use group. - * - * @return void - */ - public function testUseGroup() - { - $start = $this->getTargetToken('/* testUseGroup */', T_SEMICOLON); - $found = self::$phpcsFile->findStartOfStatement($start); - - $this->assertSame(($start - 23), $found); - - }//end testUseGroup() - - - /** - * Test arrow function as array value. - * - * @return void - */ - public function testArrowFunctionArrayValue() - { - $start = $this->getTargetToken('/* testArrowFunctionArrayValue */', T_COMMA); - $found = self::$phpcsFile->findStartOfStatement($start); - - $this->assertSame(($start - 9), $found); - - }//end testArrowFunctionArrayValue() - - - /** - * Test static arrow function. - * - * @return void - */ - public function testStaticArrowFunction() - { - $start = $this->getTargetToken('/* testStaticArrowFunction */', T_SEMICOLON); - $found = self::$phpcsFile->findStartOfStatement($start); - - $this->assertSame(($start - 11), $found); - - }//end testStaticArrowFunction() - - - /** - * Test arrow function with return value. - * - * @return void - */ - public function testArrowFunctionReturnValue() - { - $start = $this->getTargetToken('/* testArrowFunctionReturnValue */', T_SEMICOLON); - $found = self::$phpcsFile->findStartOfStatement($start); - - $this->assertSame(($start - 18), $found); - - }//end testArrowFunctionReturnValue() - - - /** - * Test arrow function used as a function argument. - * - * @return void - */ - public function testArrowFunctionAsArgument() - { - $start = $this->getTargetToken('/* testArrowFunctionAsArgument */', T_FN); - $start += 8; - $found = self::$phpcsFile->findStartOfStatement($start); - - $this->assertSame(($start - 8), $found); - - }//end testArrowFunctionAsArgument() - - - /** - * Test arrow function with arrays used as a function argument. - * - * @return void - */ - public function testArrowFunctionWithArrayAsArgument() - { - $start = $this->getTargetToken('/* testArrowFunctionWithArrayAsArgument */', T_FN); - $start += 17; - $found = self::$phpcsFile->findStartOfStatement($start); - - $this->assertSame(($start - 17), $found); - - }//end testArrowFunctionWithArrayAsArgument() - - - /** - * Test simple match expression case. - * - * @return void - */ - public function testMatchCase() - { - $start = $this->getTargetToken('/* testMatchCase */', T_COMMA); - $found = self::$phpcsFile->findStartOfStatement($start); - - $this->assertSame(($start - 1), $found); - - }//end testMatchCase() - - - /** - * Test simple match expression default case. - * - * @return void - */ - public function testMatchDefault() - { - $start = $this->getTargetToken('/* testMatchDefault */', T_CONSTANT_ENCAPSED_STRING, "'bar'"); - $found = self::$phpcsFile->findStartOfStatement($start); - - $this->assertSame($start, $found); - - }//end testMatchDefault() - - - /** - * Test multiple comma-separated match expression case values. - * - * @return void - */ - public function testMatchMultipleCase() - { - $start = $this->getTargetToken('/* testMatchMultipleCase */', T_MATCH_ARROW); - $found = self::$phpcsFile->findStartOfStatement($start); - - $this->assertSame(($start - 6), $found); - - $start += 6; - $found = self::$phpcsFile->findStartOfStatement($start); - - $this->assertSame(($start - 4), $found); - - }//end testMatchMultipleCase() - - - /** - * Test match expression default case with trailing comma. - * - * @return void - */ - public function testMatchDefaultComma() - { - $start = $this->getTargetToken('/* testMatchDefaultComma */', T_MATCH_ARROW); - $found = self::$phpcsFile->findStartOfStatement($start); - - $this->assertSame(($start - 3), $found); - - $start += 2; - $found = self::$phpcsFile->findStartOfStatement($start); - - $this->assertSame($start, $found); - - }//end testMatchDefaultComma() - - - /** - * Test match expression with function call. - * - * @return void - */ - public function testMatchFunctionCall() - { - $start = $this->getTargetToken('/* testMatchFunctionCall */', T_CLOSE_PARENTHESIS); - $found = self::$phpcsFile->findStartOfStatement($start); - - $this->assertSame(($start - 6), $found); - - }//end testMatchFunctionCall() - - - /** - * Test match expression with function call in the arm. - * - * @return void - */ - public function testMatchFunctionCallArm() - { - // Check the first case. - $start = $this->getTargetToken('/* testMatchFunctionCallArm */', T_MATCH_ARROW); - $found = self::$phpcsFile->findStartOfStatement($start); - - $this->assertSame(($start - 18), $found); - - // Check the second case. - $start += 24; - $found = self::$phpcsFile->findStartOfStatement($start); - - $this->assertSame(($start - 18), $found); - - }//end testMatchFunctionCallArm() - - - /** - * Test match expression with closure. - * - * @return void - */ - public function testMatchClosure() - { - $start = $this->getTargetToken('/* testMatchClosure */', T_LNUMBER); - $start += 14; - $found = self::$phpcsFile->findStartOfStatement($start); - - $this->assertSame(($start - 10), $found); - - $start += 17; - $found = self::$phpcsFile->findStartOfStatement($start); - - $this->assertSame(($start - 10), $found); - - }//end testMatchClosure() - - - /** - * Test match expression with array declaration. - * - * @return void - */ - public function testMatchArray() - { - // Start of first case statement. - $start = $this->getTargetToken('/* testMatchArray */', T_LNUMBER); - $found = self::$phpcsFile->findStartOfStatement($start); - $this->assertSame($start, $found); - - // Comma after first statement. - $start += 11; - $found = self::$phpcsFile->findStartOfStatement($start); - $this->assertSame(($start - 7), $found); - - // Start of second case statement. - $start += 3; - $found = self::$phpcsFile->findStartOfStatement($start); - $this->assertSame($start, $found); - - // Comma after first statement. - $start += 30; - $found = self::$phpcsFile->findStartOfStatement($start); - $this->assertSame(($start - 26), $found); - - }//end testMatchArray() - - - /** - * Test nested match expressions. - * - * @return void - */ - public function testNestedMatch() - { - $start = $this->getTargetToken('/* testNestedMatch */', T_LNUMBER); - $start += 30; - $found = self::$phpcsFile->findStartOfStatement($start); - - $this->assertSame(($start - 26), $found); - - $start -= 4; - $found = self::$phpcsFile->findStartOfStatement($start); - - $this->assertSame(($start - 1), $found); - - $start -= 3; - $found = self::$phpcsFile->findStartOfStatement($start); - - $this->assertSame(($start - 2), $found); - - }//end testNestedMatch() - - - /** - * Test nested match expressions. - * - * @return void - */ - public function testOpenTag() - { - $start = $this->getTargetToken('/* testOpenTag */', T_OPEN_TAG); - $start += 2; - $found = self::$phpcsFile->findStartOfStatement($start); - - $this->assertSame(($start - 1), $found); - - }//end testOpenTag() - - - /** - * Test nested match expressions. - * - * @return void - */ - public function testOpenTagWithEcho() - { - $start = $this->getTargetToken('/* testOpenTagWithEcho */', T_OPEN_TAG_WITH_ECHO); - $start += 3; - $found = self::$phpcsFile->findStartOfStatement($start); - - $this->assertSame(($start - 1), $found); - - }//end testOpenTagWithEcho() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMemberPropertiesTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMemberPropertiesTest.inc deleted file mode 100644 index ea47e9f..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMemberPropertiesTest.inc +++ /dev/null @@ -1,258 +0,0 @@ - 'a', 'b' => 'b' ), - /* testGroupPrivate 3 */ - $varQ = 'string', - /* testGroupPrivate 4 */ - $varR = 123, - /* testGroupPrivate 5 */ - $varS = ONE / self::THREE, - /* testGroupPrivate 6 */ - $varT = [ - 'a' => 'a', - 'b' => 'b' - ], - /* testGroupPrivate 7 */ - $varU = __DIR__ . "/base"; - - - /* testMethodParam */ - public function methodName($param) { - /* testImportedGlobal */ - global $importedGlobal = true; - - /* testLocalVariable */ - $localVariable = true; - } - - /* testPropertyAfterMethod */ - private static $varV = true; - - /* testMessyNullableType */ - public /* comment - */ ? //comment - array $foo = []; - - /* testNamespaceType */ - public \MyNamespace\MyClass $foo; - - /* testNullableNamespaceType 1 */ - private ?ClassName $nullableClassType; - - /* testNullableNamespaceType 2 */ - protected ?Folder\ClassName $nullableClassType2; - - /* testMultilineNamespaceType */ - public \MyNamespace /** comment *\/ comment */ - \MyClass /* comment */ - \Foo $foo; - -} - -interface Base -{ - /* testInterfaceProperty */ - protected $anonymous; -} - -/* testGlobalVariable */ -$globalVariable = true; - -/* testNotAVariable */ -return; - -$a = ( $foo == $bar ? new stdClass() : - new class() { - /* testNestedProperty 1 */ - public $var = true; - - /* testNestedMethodParam 1 */ - public function something($var = false) {} - } -); - -function_call( 'param', new class { - /* testNestedProperty 2 */ - public $year = 2017; - - /* testNestedMethodParam 2 */ - public function __construct( $open, $post_id ) {} -}, 10, 2 ); - -class PHP8Mixed { - /* testPHP8MixedTypeHint */ - public static miXed $mixed; - - /* testPHP8MixedTypeHintNullable */ - // Intentional fatal error - nullability is not allowed with mixed, but that's not the concern of the method. - private ?mixed $nullableMixed; -} - -class NSOperatorInType { - /* testNamespaceOperatorTypeHint */ - public ?namespace\Name $prop; -} - -$anon = class() { - /* testPHP8UnionTypesSimple */ - public int|float $unionTypeSimple; - - /* testPHP8UnionTypesTwoClasses */ - private MyClassA|\Package\MyClassB $unionTypesTwoClasses; - - /* testPHP8UnionTypesAllBaseTypes */ - protected array|bool|int|float|NULL|object|string $unionTypesAllBaseTypes; - - /* testPHP8UnionTypesAllPseudoTypes */ - // Intentional fatal error - mixing types which cannot be combined, but that's not the concern of the method. - var false|mixed|self|parent|iterable|Resource $unionTypesAllPseudoTypes; - - /* testPHP8UnionTypesIllegalTypes */ - // Intentional fatal error - types which are not allowed for properties, but that's not the concern of the method. - public callable|static|void $unionTypesIllegalTypes; - - /* testPHP8UnionTypesNullable */ - // Intentional fatal error - nullability is not allowed with union types, but that's not the concern of the method. - public ?int|float $unionTypesNullable; - - /* testPHP8PseudoTypeNull */ - // Intentional fatal error - null pseudotype is only allowed in union types, but that's not the concern of the method. - public null $pseudoTypeNull; - - /* testPHP8PseudoTypeFalse */ - // Intentional fatal error - false pseudotype is only allowed in union types, but that's not the concern of the method. - public false $pseudoTypeFalse; - - /* testPHP8PseudoTypeFalseAndBool */ - // Intentional fatal error - false pseudotype is not allowed in combination with bool, but that's not the concern of the method. - public bool|FALSE $pseudoTypeFalseAndBool; - - /* testPHP8ObjectAndClass */ - // Intentional fatal error - object is not allowed in combination with class name, but that's not the concern of the method. - public object|ClassName $objectAndClass; - - /* testPHP8PseudoTypeIterableAndArray */ - // Intentional fatal error - iterable pseudotype is not allowed in combination with array or Traversable, but that's not the concern of the method. - public iterable|array|Traversable $pseudoTypeIterableAndArray; - - /* testPHP8DuplicateTypeInUnionWhitespaceAndComment */ - // Intentional fatal error - duplicate types are not allowed in union types, but that's not the concern of the method. - public int |string| /*comment*/ INT $duplicateTypeInUnion; -}; - -$anon = class { - /* testPHP8PropertySingleAttribute */ - #[PropertyWithAttribute] - public string $foo; - - /* testPHP8PropertyMultipleAttributes */ - #[PropertyWithAttribute(foo: 'bar'), MyAttribute] - protected ?int|float $bar; - - /* testPHP8PropertyMultilineAttribute */ - #[ - PropertyWithAttribute(/* comment */ 'baz') - ] - private mixed $baz; -}; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMemberPropertiesTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMemberPropertiesTest.php deleted file mode 100644 index 0af0437..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMemberPropertiesTest.php +++ /dev/null @@ -1,705 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tests\Core\File; - -use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest; - -class GetMemberPropertiesTest extends AbstractMethodUnitTest -{ - - - /** - * Test the getMemberProperties() method. - * - * @param string $identifier Comment which precedes the test case. - * @param bool $expected Expected function output. - * - * @dataProvider dataGetMemberProperties - * - * @return void - */ - public function testGetMemberProperties($identifier, $expected) - { - $variable = $this->getTargetToken($identifier, T_VARIABLE); - $result = self::$phpcsFile->getMemberProperties($variable); - - $this->assertArraySubset($expected, $result, true); - - }//end testGetMemberProperties() - - - /** - * Data provider for the GetMemberProperties test. - * - * @see testGetMemberProperties() - * - * @return array - */ - public function dataGetMemberProperties() - { - return [ - [ - '/* testVar */', - [ - 'scope' => 'public', - 'scope_specified' => false, - 'is_static' => false, - 'type' => '', - 'nullable_type' => false, - ], - ], - [ - '/* testVarType */', - [ - 'scope' => 'public', - 'scope_specified' => false, - 'is_static' => false, - 'type' => '?int', - 'nullable_type' => true, - ], - ], - [ - '/* testPublic */', - [ - 'scope' => 'public', - 'scope_specified' => true, - 'is_static' => false, - 'type' => '', - 'nullable_type' => false, - ], - ], - [ - '/* testPublicType */', - [ - 'scope' => 'public', - 'scope_specified' => true, - 'is_static' => false, - 'type' => 'string', - 'nullable_type' => false, - ], - ], - [ - '/* testProtected */', - [ - 'scope' => 'protected', - 'scope_specified' => true, - 'is_static' => false, - 'type' => '', - 'nullable_type' => false, - ], - ], - [ - '/* testProtectedType */', - [ - 'scope' => 'protected', - 'scope_specified' => true, - 'is_static' => false, - 'type' => 'bool', - 'nullable_type' => false, - ], - ], - [ - '/* testPrivate */', - [ - 'scope' => 'private', - 'scope_specified' => true, - 'is_static' => false, - 'type' => '', - 'nullable_type' => false, - ], - ], - [ - '/* testPrivateType */', - [ - 'scope' => 'private', - 'scope_specified' => true, - 'is_static' => false, - 'type' => 'array', - 'nullable_type' => false, - ], - ], - [ - '/* testStatic */', - [ - 'scope' => 'public', - 'scope_specified' => false, - 'is_static' => true, - 'type' => '', - 'nullable_type' => false, - ], - ], - [ - '/* testStaticType */', - [ - 'scope' => 'public', - 'scope_specified' => false, - 'is_static' => true, - 'type' => '?string', - 'nullable_type' => true, - ], - ], - [ - '/* testStaticVar */', - [ - 'scope' => 'public', - 'scope_specified' => false, - 'is_static' => true, - 'type' => '', - 'nullable_type' => false, - ], - ], - [ - '/* testVarStatic */', - [ - 'scope' => 'public', - 'scope_specified' => false, - 'is_static' => true, - 'type' => '', - 'nullable_type' => false, - ], - ], - [ - '/* testPublicStatic */', - [ - 'scope' => 'public', - 'scope_specified' => true, - 'is_static' => true, - 'type' => '', - 'nullable_type' => false, - ], - ], - [ - '/* testProtectedStatic */', - [ - 'scope' => 'protected', - 'scope_specified' => true, - 'is_static' => true, - 'type' => '', - 'nullable_type' => false, - ], - ], - [ - '/* testPrivateStatic */', - [ - 'scope' => 'private', - 'scope_specified' => true, - 'is_static' => true, - 'type' => '', - 'nullable_type' => false, - ], - ], - [ - '/* testPublicStaticWithDocblock */', - [ - 'scope' => 'public', - 'scope_specified' => true, - 'is_static' => true, - 'type' => '', - 'nullable_type' => false, - ], - ], - [ - '/* testProtectedStaticWithDocblock */', - [ - 'scope' => 'protected', - 'scope_specified' => true, - 'is_static' => true, - 'type' => '', - 'nullable_type' => false, - ], - ], - [ - '/* testPrivateStaticWithDocblock */', - [ - 'scope' => 'private', - 'scope_specified' => true, - 'is_static' => true, - 'type' => '', - 'nullable_type' => false, - ], - ], - [ - '/* testGroupType 1 */', - [ - 'scope' => 'public', - 'scope_specified' => true, - 'is_static' => false, - 'type' => 'float', - 'nullable_type' => false, - ], - ], - [ - '/* testGroupType 2 */', - [ - 'scope' => 'public', - 'scope_specified' => true, - 'is_static' => false, - 'type' => 'float', - 'nullable_type' => false, - ], - ], - [ - '/* testGroupNullableType 1 */', - [ - 'scope' => 'public', - 'scope_specified' => true, - 'is_static' => true, - 'type' => '?string', - 'nullable_type' => true, - ], - ], - [ - '/* testGroupNullableType 2 */', - [ - 'scope' => 'public', - 'scope_specified' => true, - 'is_static' => true, - 'type' => '?string', - 'nullable_type' => true, - ], - ], - [ - '/* testNoPrefix */', - [ - 'scope' => 'public', - 'scope_specified' => false, - 'is_static' => false, - 'type' => '', - 'nullable_type' => false, - ], - ], - [ - '/* testGroupProtectedStatic 1 */', - [ - 'scope' => 'protected', - 'scope_specified' => true, - 'is_static' => true, - 'type' => '', - 'nullable_type' => false, - ], - ], - [ - '/* testGroupProtectedStatic 2 */', - [ - 'scope' => 'protected', - 'scope_specified' => true, - 'is_static' => true, - 'type' => '', - 'nullable_type' => false, - ], - ], - [ - '/* testGroupProtectedStatic 3 */', - [ - 'scope' => 'protected', - 'scope_specified' => true, - 'is_static' => true, - 'type' => '', - 'nullable_type' => false, - ], - ], - [ - '/* testGroupPrivate 1 */', - [ - 'scope' => 'private', - 'scope_specified' => true, - 'is_static' => false, - 'type' => '', - 'nullable_type' => false, - ], - ], - [ - '/* testGroupPrivate 2 */', - [ - 'scope' => 'private', - 'scope_specified' => true, - 'is_static' => false, - 'type' => '', - 'nullable_type' => false, - ], - ], - [ - '/* testGroupPrivate 3 */', - [ - 'scope' => 'private', - 'scope_specified' => true, - 'is_static' => false, - 'type' => '', - 'nullable_type' => false, - ], - ], - [ - '/* testGroupPrivate 4 */', - [ - 'scope' => 'private', - 'scope_specified' => true, - 'is_static' => false, - 'type' => '', - 'nullable_type' => false, - ], - ], - [ - '/* testGroupPrivate 5 */', - [ - 'scope' => 'private', - 'scope_specified' => true, - 'is_static' => false, - 'type' => '', - 'nullable_type' => false, - ], - ], - [ - '/* testGroupPrivate 6 */', - [ - 'scope' => 'private', - 'scope_specified' => true, - 'is_static' => false, - 'type' => '', - 'nullable_type' => false, - ], - ], - [ - '/* testGroupPrivate 7 */', - [ - 'scope' => 'private', - 'scope_specified' => true, - 'is_static' => false, - 'type' => '', - 'nullable_type' => false, - ], - ], - [ - '/* testMessyNullableType */', - [ - 'scope' => 'public', - 'scope_specified' => true, - 'is_static' => false, - 'type' => '?array', - 'nullable_type' => true, - ], - ], - [ - '/* testNamespaceType */', - [ - 'scope' => 'public', - 'scope_specified' => true, - 'is_static' => false, - 'type' => '\MyNamespace\MyClass', - 'nullable_type' => false, - ], - ], - [ - '/* testNullableNamespaceType 1 */', - [ - 'scope' => 'private', - 'scope_specified' => true, - 'is_static' => false, - 'type' => '?ClassName', - 'nullable_type' => true, - ], - ], - [ - '/* testNullableNamespaceType 2 */', - [ - 'scope' => 'protected', - 'scope_specified' => true, - 'is_static' => false, - 'type' => '?Folder\ClassName', - 'nullable_type' => true, - ], - ], - [ - '/* testMultilineNamespaceType */', - [ - 'scope' => 'public', - 'scope_specified' => true, - 'is_static' => false, - 'type' => '\MyNamespace\MyClass\Foo', - 'nullable_type' => false, - ], - ], - [ - '/* testPropertyAfterMethod */', - [ - 'scope' => 'private', - 'scope_specified' => true, - 'is_static' => true, - 'type' => '', - 'nullable_type' => false, - ], - ], - [ - '/* testInterfaceProperty */', - [], - ], - [ - '/* testNestedProperty 1 */', - [ - 'scope' => 'public', - 'scope_specified' => true, - 'is_static' => false, - 'type' => '', - 'nullable_type' => false, - ], - ], - [ - '/* testNestedProperty 2 */', - [ - 'scope' => 'public', - 'scope_specified' => true, - 'is_static' => false, - 'type' => '', - 'nullable_type' => false, - ], - ], - [ - '/* testPHP8MixedTypeHint */', - [ - 'scope' => 'public', - 'scope_specified' => true, - 'is_static' => true, - 'type' => 'miXed', - 'nullable_type' => false, - ], - ], - [ - '/* testPHP8MixedTypeHintNullable */', - [ - 'scope' => 'private', - 'scope_specified' => true, - 'is_static' => false, - 'type' => '?mixed', - 'nullable_type' => true, - ], - ], - [ - '/* testNamespaceOperatorTypeHint */', - [ - 'scope' => 'public', - 'scope_specified' => true, - 'is_static' => false, - 'type' => '?namespace\Name', - 'nullable_type' => true, - ], - ], - [ - '/* testPHP8UnionTypesSimple */', - [ - 'scope' => 'public', - 'scope_specified' => true, - 'is_static' => false, - 'type' => 'int|float', - 'nullable_type' => false, - ], - ], - [ - '/* testPHP8UnionTypesTwoClasses */', - [ - 'scope' => 'private', - 'scope_specified' => true, - 'is_static' => false, - 'type' => 'MyClassA|\Package\MyClassB', - 'nullable_type' => false, - ], - ], - [ - '/* testPHP8UnionTypesAllBaseTypes */', - [ - 'scope' => 'protected', - 'scope_specified' => true, - 'is_static' => false, - 'type' => 'array|bool|int|float|NULL|object|string', - 'nullable_type' => false, - ], - ], - [ - '/* testPHP8UnionTypesAllPseudoTypes */', - [ - 'scope' => 'public', - 'scope_specified' => false, - 'is_static' => false, - 'type' => 'false|mixed|self|parent|iterable|Resource', - 'nullable_type' => false, - ], - ], - [ - '/* testPHP8UnionTypesIllegalTypes */', - [ - 'scope' => 'public', - 'scope_specified' => true, - 'is_static' => false, - // Missing static, but that's OK as not an allowed syntax. - 'type' => 'callable||void', - 'nullable_type' => false, - ], - ], - [ - '/* testPHP8UnionTypesNullable */', - [ - 'scope' => 'public', - 'scope_specified' => true, - 'is_static' => false, - 'type' => '?int|float', - 'nullable_type' => true, - ], - ], - [ - '/* testPHP8PseudoTypeNull */', - [ - 'scope' => 'public', - 'scope_specified' => true, - 'is_static' => false, - 'type' => 'null', - 'nullable_type' => false, - ], - ], - [ - '/* testPHP8PseudoTypeFalse */', - [ - 'scope' => 'public', - 'scope_specified' => true, - 'is_static' => false, - 'type' => 'false', - 'nullable_type' => false, - ], - ], - [ - '/* testPHP8PseudoTypeFalseAndBool */', - [ - 'scope' => 'public', - 'scope_specified' => true, - 'is_static' => false, - 'type' => 'bool|FALSE', - 'nullable_type' => false, - ], - ], - [ - '/* testPHP8ObjectAndClass */', - [ - 'scope' => 'public', - 'scope_specified' => true, - 'is_static' => false, - 'type' => 'object|ClassName', - 'nullable_type' => false, - ], - ], - [ - '/* testPHP8PseudoTypeIterableAndArray */', - [ - 'scope' => 'public', - 'scope_specified' => true, - 'is_static' => false, - 'type' => 'iterable|array|Traversable', - 'nullable_type' => false, - ], - ], - [ - '/* testPHP8DuplicateTypeInUnionWhitespaceAndComment */', - [ - 'scope' => 'public', - 'scope_specified' => true, - 'is_static' => false, - 'type' => 'int|string|INT', - 'nullable_type' => false, - ], - ], - [ - '/* testPHP8PropertySingleAttribute */', - [ - 'scope' => 'public', - 'scope_specified' => true, - 'is_static' => false, - 'type' => 'string', - 'nullable_type' => false, - ], - ], - [ - '/* testPHP8PropertyMultipleAttributes */', - [ - 'scope' => 'protected', - 'scope_specified' => true, - 'is_static' => false, - 'type' => '?int|float', - 'nullable_type' => true, - ], - ], - [ - '/* testPHP8PropertyMultilineAttribute */', - [ - 'scope' => 'private', - 'scope_specified' => true, - 'is_static' => false, - 'type' => 'mixed', - 'nullable_type' => false, - ], - ], - ]; - - }//end dataGetMemberProperties() - - - /** - * Test receiving an expected exception when a non property is passed. - * - * @param string $identifier Comment which precedes the test case. - * - * @expectedException PHP_CodeSniffer\Exceptions\RuntimeException - * @expectedExceptionMessage $stackPtr is not a class member var - * - * @dataProvider dataNotClassProperty - * - * @return void - */ - public function testNotClassPropertyException($identifier) - { - $variable = $this->getTargetToken($identifier, T_VARIABLE); - $result = self::$phpcsFile->getMemberProperties($variable); - - }//end testNotClassPropertyException() - - - /** - * Data provider for the NotClassPropertyException test. - * - * @see testNotClassPropertyException() - * - * @return array - */ - public function dataNotClassProperty() - { - return [ - ['/* testMethodParam */'], - ['/* testImportedGlobal */'], - ['/* testLocalVariable */'], - ['/* testGlobalVariable */'], - ['/* testNestedMethodParam 1 */'], - ['/* testNestedMethodParam 2 */'], - ]; - - }//end dataNotClassProperty() - - - /** - * Test receiving an expected exception when a non variable is passed. - * - * @expectedException PHP_CodeSniffer\Exceptions\RuntimeException - * @expectedExceptionMessage $stackPtr must be of type T_VARIABLE - * - * @return void - */ - public function testNotAVariableException() - { - $next = $this->getTargetToken('/* testNotAVariable */', T_RETURN); - $result = self::$phpcsFile->getMemberProperties($next); - - }//end testNotAVariableException() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodParametersTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodParametersTest.inc deleted file mode 100644 index ed1762e..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodParametersTest.inc +++ /dev/null @@ -1,142 +0,0 @@ - $b; - -/* testPHP8MixedTypeHint */ -function mixedTypeHint(mixed &...$var1) {} - -/* testPHP8MixedTypeHintNullable */ -// Intentional fatal error - nullability is not allowed with mixed, but that's not the concern of the method. -function mixedTypeHintNullable(?Mixed $var1) {} - -/* testNamespaceOperatorTypeHint */ -function namespaceOperatorTypeHint(?namespace\Name $var1) {} - -/* testPHP8UnionTypesSimple */ -function unionTypeSimple(int|float $number, self|parent &...$obj) {} - -/* testPHP8UnionTypesWithSpreadOperatorAndReference */ -function globalFunctionWithSpreadAndReference(float|null &$paramA, string|int ...$paramB) {} - -/* testPHP8UnionTypesSimpleWithBitwiseOrInDefault */ -$fn = fn(int|float $var = CONSTANT_A | CONSTANT_B) => $var; - -/* testPHP8UnionTypesTwoClasses */ -function unionTypesTwoClasses(MyClassA|\Package\MyClassB $var) {} - -/* testPHP8UnionTypesAllBaseTypes */ -function unionTypesAllBaseTypes(array|bool|callable|int|float|null|object|string $var) {} - -/* testPHP8UnionTypesAllPseudoTypes */ -// Intentional fatal error - mixing types which cannot be combined, but that's not the concern of the method. -function unionTypesAllPseudoTypes(false|mixed|self|parent|iterable|Resource $var) {} - -/* testPHP8UnionTypesNullable */ -// Intentional fatal error - nullability is not allowed with union types, but that's not the concern of the method. -$closure = function (?int|float $number) {}; - -/* testPHP8PseudoTypeNull */ -// Intentional fatal error - null pseudotype is only allowed in union types, but that's not the concern of the method. -function pseudoTypeNull(null $var = null) {} - -/* testPHP8PseudoTypeFalse */ -// Intentional fatal error - false pseudotype is only allowed in union types, but that's not the concern of the method. -function pseudoTypeFalse(false $var = false) {} - -/* testPHP8PseudoTypeFalseAndBool */ -// Intentional fatal error - false pseudotype is not allowed in combination with bool, but that's not the concern of the method. -function pseudoTypeFalseAndBool(bool|false $var = false) {} - -/* testPHP8ObjectAndClass */ -// Intentional fatal error - object is not allowed in combination with class name, but that's not the concern of the method. -function objectAndClass(object|ClassName $var) {} - -/* testPHP8PseudoTypeIterableAndArray */ -// Intentional fatal error - iterable pseudotype is not allowed in combination with array or Traversable, but that's not the concern of the method. -function pseudoTypeIterableAndArray(iterable|array|Traversable $var) {} - -/* testPHP8DuplicateTypeInUnionWhitespaceAndComment */ -// Intentional fatal error - duplicate types are not allowed in union types, but that's not the concern of the method. -function duplicateTypeInUnion( int | string /*comment*/ | INT $var) {} - -class ConstructorPropertyPromotionNoTypes { - /* testPHP8ConstructorPropertyPromotionNoTypes */ - public function __construct( - public $x = 0.0, - protected $y = '', - private $z = null, - ) {} -} - -class ConstructorPropertyPromotionWithTypes { - /* testPHP8ConstructorPropertyPromotionWithTypes */ - public function __construct(protected float|int $x, public ?string &$y = 'test', private mixed $z) {} -} - -class ConstructorPropertyPromotionAndNormalParams { - /* testPHP8ConstructorPropertyPromotionAndNormalParam */ - public function __construct(public int $promotedProp, ?int $normalArg) {} -} - -/* testPHP8ConstructorPropertyPromotionGlobalFunction */ -// Intentional fatal error. Property promotion not allowed in non-constructor, but that's not the concern of this method. -function globalFunction(private $x) {} - -abstract class ConstructorPropertyPromotionAbstractMethod { - /* testPHP8ConstructorPropertyPromotionAbstractMethod */ - // Intentional fatal error. - // 1. Property promotion not allowed in abstract method, but that's not the concern of this method. - // 2. Variadic arguments not allowed in property promotion, but that's not the concern of this method. - // 3. The callable type is not supported for properties, but that's not the concern of this method. - abstract public function __construct(public callable $y, private ...$x); -} - -/* testCommentsInParameter */ -function commentsInParams( - // Leading comment. - ?MyClass /*-*/ & /*-*/.../*-*/ $param /*-*/ = /*-*/ 'default value' . /*-*/ 'second part' // Trailing comment. -) {} - -/* testParameterAttributesInFunctionDeclaration */ -class ParametersWithAttributes( - public function __construct( - #[\MyExample\MyAttribute] private string $constructorPropPromTypedParamSingleAttribute, - #[MyAttr([1, 2])] - Type|false - $typedParamSingleAttribute, - #[MyAttribute(1234), MyAttribute(5678)] ?int $nullableTypedParamMultiAttribute, - #[WithoutArgument] #[SingleArgument(0)] $nonTypedParamTwoAttributes, - #[MyAttribute(array("key" => "value"))] - &...$otherParam, - ) {} -} diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodParametersTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodParametersTest.php deleted file mode 100644 index e7692a7..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodParametersTest.php +++ /dev/null @@ -1,969 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tests\Core\File; - -use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest; - -class GetMethodParametersTest extends AbstractMethodUnitTest -{ - - - /** - * Verify pass-by-reference parsing. - * - * @return void - */ - public function testPassByReference() - { - $expected = []; - $expected[0] = [ - 'name' => '$var', - 'content' => '&$var', - 'has_attributes' => false, - 'pass_by_reference' => true, - 'variable_length' => false, - 'type_hint' => '', - 'nullable_type' => false, - ]; - - $this->getMethodParametersTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testPassByReference() - - - /** - * Verify array hint parsing. - * - * @return void - */ - public function testArrayHint() - { - $expected = []; - $expected[0] = [ - 'name' => '$var', - 'content' => 'array $var', - 'has_attributes' => false, - 'pass_by_reference' => false, - 'variable_length' => false, - 'type_hint' => 'array', - 'nullable_type' => false, - ]; - - $this->getMethodParametersTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testArrayHint() - - - /** - * Verify type hint parsing. - * - * @return void - */ - public function testTypeHint() - { - $expected = []; - $expected[0] = [ - 'name' => '$var1', - 'content' => 'foo $var1', - 'has_attributes' => false, - 'pass_by_reference' => false, - 'variable_length' => false, - 'type_hint' => 'foo', - 'nullable_type' => false, - ]; - - $expected[1] = [ - 'name' => '$var2', - 'content' => 'bar $var2', - 'has_attributes' => false, - 'pass_by_reference' => false, - 'variable_length' => false, - 'type_hint' => 'bar', - 'nullable_type' => false, - ]; - - $this->getMethodParametersTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testTypeHint() - - - /** - * Verify self type hint parsing. - * - * @return void - */ - public function testSelfTypeHint() - { - $expected = []; - $expected[0] = [ - 'name' => '$var', - 'content' => 'self $var', - 'has_attributes' => false, - 'pass_by_reference' => false, - 'variable_length' => false, - 'type_hint' => 'self', - 'nullable_type' => false, - ]; - - $this->getMethodParametersTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testSelfTypeHint() - - - /** - * Verify nullable type hint parsing. - * - * @return void - */ - public function testNullableTypeHint() - { - $expected = []; - $expected[0] = [ - 'name' => '$var1', - 'content' => '?int $var1', - 'has_attributes' => false, - 'pass_by_reference' => false, - 'variable_length' => false, - 'type_hint' => '?int', - 'nullable_type' => true, - ]; - - $expected[1] = [ - 'name' => '$var2', - 'content' => '?\bar $var2', - 'has_attributes' => false, - 'pass_by_reference' => false, - 'variable_length' => false, - 'type_hint' => '?\bar', - 'nullable_type' => true, - ]; - - $this->getMethodParametersTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testNullableTypeHint() - - - /** - * Verify variable. - * - * @return void - */ - public function testVariable() - { - $expected = []; - $expected[0] = [ - 'name' => '$var', - 'content' => '$var', - 'has_attributes' => false, - 'pass_by_reference' => false, - 'variable_length' => false, - 'type_hint' => '', - 'nullable_type' => false, - ]; - - $this->getMethodParametersTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testVariable() - - - /** - * Verify default value parsing with a single function param. - * - * @return void - */ - public function testSingleDefaultValue() - { - $expected = []; - $expected[0] = [ - 'name' => '$var1', - 'content' => '$var1=self::CONSTANT', - 'has_attributes' => false, - 'default' => 'self::CONSTANT', - 'pass_by_reference' => false, - 'variable_length' => false, - 'type_hint' => '', - 'nullable_type' => false, - ]; - - $this->getMethodParametersTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testSingleDefaultValue() - - - /** - * Verify default value parsing. - * - * @return void - */ - public function testDefaultValues() - { - $expected = []; - $expected[0] = [ - 'name' => '$var1', - 'content' => '$var1=1', - 'has_attributes' => false, - 'default' => '1', - 'pass_by_reference' => false, - 'variable_length' => false, - 'type_hint' => '', - 'nullable_type' => false, - ]; - $expected[1] = [ - 'name' => '$var2', - 'content' => "\$var2='value'", - 'has_attributes' => false, - 'default' => "'value'", - 'pass_by_reference' => false, - 'variable_length' => false, - 'type_hint' => '', - 'nullable_type' => false, - ]; - - $this->getMethodParametersTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testDefaultValues() - - - /** - * Verify "bitwise and" in default value !== pass-by-reference. - * - * @return void - */ - public function testBitwiseAndConstantExpressionDefaultValue() - { - $expected = []; - $expected[0] = [ - 'name' => '$a', - 'content' => '$a = 10 & 20', - 'default' => '10 & 20', - 'has_attributes' => false, - 'pass_by_reference' => false, - 'variable_length' => false, - 'type_hint' => '', - 'nullable_type' => false, - ]; - - $this->getMethodParametersTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testBitwiseAndConstantExpressionDefaultValue() - - - /** - * Verify that arrow functions are supported. - * - * @return void - */ - public function testArrowFunction() - { - $expected = []; - $expected[0] = [ - 'name' => '$a', - 'content' => 'int $a', - 'has_attributes' => false, - 'pass_by_reference' => false, - 'variable_length' => false, - 'type_hint' => 'int', - 'nullable_type' => false, - ]; - - $expected[1] = [ - 'name' => '$b', - 'content' => '...$b', - 'has_attributes' => false, - 'pass_by_reference' => false, - 'variable_length' => true, - 'type_hint' => '', - 'nullable_type' => false, - ]; - - $this->getMethodParametersTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testArrowFunction() - - - /** - * Verify recognition of PHP8 mixed type declaration. - * - * @return void - */ - public function testPHP8MixedTypeHint() - { - $expected = []; - $expected[0] = [ - 'name' => '$var1', - 'content' => 'mixed &...$var1', - 'has_attributes' => false, - 'pass_by_reference' => true, - 'variable_length' => true, - 'type_hint' => 'mixed', - 'nullable_type' => false, - ]; - - $this->getMethodParametersTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testPHP8MixedTypeHint() - - - /** - * Verify recognition of PHP8 mixed type declaration with nullability. - * - * @return void - */ - public function testPHP8MixedTypeHintNullable() - { - $expected = []; - $expected[0] = [ - 'name' => '$var1', - 'content' => '?Mixed $var1', - 'has_attributes' => false, - 'pass_by_reference' => false, - 'variable_length' => false, - 'type_hint' => '?Mixed', - 'nullable_type' => true, - ]; - - $this->getMethodParametersTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testPHP8MixedTypeHintNullable() - - - /** - * Verify recognition of type declarations using the namespace operator. - * - * @return void - */ - public function testNamespaceOperatorTypeHint() - { - $expected = []; - $expected[0] = [ - 'name' => '$var1', - 'content' => '?namespace\Name $var1', - 'has_attributes' => false, - 'pass_by_reference' => false, - 'variable_length' => false, - 'type_hint' => '?namespace\Name', - 'nullable_type' => true, - ]; - - $this->getMethodParametersTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testNamespaceOperatorTypeHint() - - - /** - * Verify recognition of PHP8 union type declaration. - * - * @return void - */ - public function testPHP8UnionTypesSimple() - { - $expected = []; - $expected[0] = [ - 'name' => '$number', - 'content' => 'int|float $number', - 'has_attributes' => false, - 'pass_by_reference' => false, - 'variable_length' => false, - 'type_hint' => 'int|float', - 'nullable_type' => false, - ]; - $expected[1] = [ - 'name' => '$obj', - 'content' => 'self|parent &...$obj', - 'has_attributes' => false, - 'pass_by_reference' => true, - 'variable_length' => true, - 'type_hint' => 'self|parent', - 'nullable_type' => false, - ]; - - $this->getMethodParametersTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testPHP8UnionTypesSimple() - - - /** - * Verify recognition of PHP8 union type declaration when the variable has either a spread operator or a reference. - * - * @return void - */ - public function testPHP8UnionTypesWithSpreadOperatorAndReference() - { - $expected = []; - $expected[0] = [ - 'name' => '$paramA', - 'content' => 'float|null &$paramA', - 'has_attributes' => false, - 'pass_by_reference' => true, - 'variable_length' => false, - 'type_hint' => 'float|null', - 'nullable_type' => false, - ]; - $expected[1] = [ - 'name' => '$paramB', - 'content' => 'string|int ...$paramB', - 'has_attributes' => false, - 'pass_by_reference' => false, - 'variable_length' => true, - 'type_hint' => 'string|int', - 'nullable_type' => false, - ]; - - $this->getMethodParametersTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testPHP8UnionTypesWithSpreadOperatorAndReference() - - - /** - * Verify recognition of PHP8 union type declaration with a bitwise or in the default value. - * - * @return void - */ - public function testPHP8UnionTypesSimpleWithBitwiseOrInDefault() - { - $expected = []; - $expected[0] = [ - 'name' => '$var', - 'content' => 'int|float $var = CONSTANT_A | CONSTANT_B', - 'default' => 'CONSTANT_A | CONSTANT_B', - 'has_attributes' => false, - 'pass_by_reference' => false, - 'variable_length' => false, - 'type_hint' => 'int|float', - 'nullable_type' => false, - ]; - - $this->getMethodParametersTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testPHP8UnionTypesSimpleWithBitwiseOrInDefault() - - - /** - * Verify recognition of PHP8 union type declaration with two classes. - * - * @return void - */ - public function testPHP8UnionTypesTwoClasses() - { - $expected = []; - $expected[0] = [ - 'name' => '$var', - 'content' => 'MyClassA|\Package\MyClassB $var', - 'has_attributes' => false, - 'pass_by_reference' => false, - 'variable_length' => false, - 'type_hint' => 'MyClassA|\Package\MyClassB', - 'nullable_type' => false, - ]; - - $this->getMethodParametersTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testPHP8UnionTypesTwoClasses() - - - /** - * Verify recognition of PHP8 union type declaration with all base types. - * - * @return void - */ - public function testPHP8UnionTypesAllBaseTypes() - { - $expected = []; - $expected[0] = [ - 'name' => '$var', - 'content' => 'array|bool|callable|int|float|null|object|string $var', - 'has_attributes' => false, - 'pass_by_reference' => false, - 'variable_length' => false, - 'type_hint' => 'array|bool|callable|int|float|null|object|string', - 'nullable_type' => false, - ]; - - $this->getMethodParametersTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testPHP8UnionTypesAllBaseTypes() - - - /** - * Verify recognition of PHP8 union type declaration with all pseudo types. - * - * @return void - */ - public function testPHP8UnionTypesAllPseudoTypes() - { - $expected = []; - $expected[0] = [ - 'name' => '$var', - 'content' => 'false|mixed|self|parent|iterable|Resource $var', - 'has_attributes' => false, - 'pass_by_reference' => false, - 'variable_length' => false, - 'type_hint' => 'false|mixed|self|parent|iterable|Resource', - 'nullable_type' => false, - ]; - - $this->getMethodParametersTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testPHP8UnionTypesAllPseudoTypes() - - - /** - * Verify recognition of PHP8 union type declaration with (illegal) nullability. - * - * @return void - */ - public function testPHP8UnionTypesNullable() - { - $expected = []; - $expected[0] = [ - 'name' => '$number', - 'content' => '?int|float $number', - 'has_attributes' => false, - 'pass_by_reference' => false, - 'variable_length' => false, - 'type_hint' => '?int|float', - 'nullable_type' => true, - ]; - - $this->getMethodParametersTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testPHP8UnionTypesNullable() - - - /** - * Verify recognition of PHP8 type declaration with (illegal) single type null. - * - * @return void - */ - public function testPHP8PseudoTypeNull() - { - $expected = []; - $expected[0] = [ - 'name' => '$var', - 'content' => 'null $var = null', - 'default' => 'null', - 'has_attributes' => false, - 'pass_by_reference' => false, - 'variable_length' => false, - 'type_hint' => 'null', - 'nullable_type' => false, - ]; - - $this->getMethodParametersTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testPHP8PseudoTypeNull() - - - /** - * Verify recognition of PHP8 type declaration with (illegal) single type false. - * - * @return void - */ - public function testPHP8PseudoTypeFalse() - { - $expected = []; - $expected[0] = [ - 'name' => '$var', - 'content' => 'false $var = false', - 'default' => 'false', - 'has_attributes' => false, - 'pass_by_reference' => false, - 'variable_length' => false, - 'type_hint' => 'false', - 'nullable_type' => false, - ]; - - $this->getMethodParametersTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testPHP8PseudoTypeFalse() - - - /** - * Verify recognition of PHP8 type declaration with (illegal) type false combined with type bool. - * - * @return void - */ - public function testPHP8PseudoTypeFalseAndBool() - { - $expected = []; - $expected[0] = [ - 'name' => '$var', - 'content' => 'bool|false $var = false', - 'default' => 'false', - 'has_attributes' => false, - 'pass_by_reference' => false, - 'variable_length' => false, - 'type_hint' => 'bool|false', - 'nullable_type' => false, - ]; - - $this->getMethodParametersTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testPHP8PseudoTypeFalseAndBool() - - - /** - * Verify recognition of PHP8 type declaration with (illegal) type object combined with a class name. - * - * @return void - */ - public function testPHP8ObjectAndClass() - { - $expected = []; - $expected[0] = [ - 'name' => '$var', - 'content' => 'object|ClassName $var', - 'has_attributes' => false, - 'pass_by_reference' => false, - 'variable_length' => false, - 'type_hint' => 'object|ClassName', - 'nullable_type' => false, - ]; - - $this->getMethodParametersTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testPHP8ObjectAndClass() - - - /** - * Verify recognition of PHP8 type declaration with (illegal) type iterable combined with array/Traversable. - * - * @return void - */ - public function testPHP8PseudoTypeIterableAndArray() - { - $expected = []; - $expected[0] = [ - 'name' => '$var', - 'content' => 'iterable|array|Traversable $var', - 'has_attributes' => false, - 'pass_by_reference' => false, - 'variable_length' => false, - 'type_hint' => 'iterable|array|Traversable', - 'nullable_type' => false, - ]; - - $this->getMethodParametersTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testPHP8PseudoTypeIterableAndArray() - - - /** - * Verify recognition of PHP8 type declaration with (illegal) duplicate types. - * - * @return void - */ - public function testPHP8DuplicateTypeInUnionWhitespaceAndComment() - { - $expected = []; - $expected[0] = [ - 'name' => '$var', - 'content' => 'int | string /*comment*/ | INT $var', - 'has_attributes' => false, - 'pass_by_reference' => false, - 'variable_length' => false, - 'type_hint' => 'int|string|INT', - 'nullable_type' => false, - ]; - - $this->getMethodParametersTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testPHP8DuplicateTypeInUnionWhitespaceAndComment() - - - /** - * Verify recognition of PHP8 constructor property promotion without type declaration, with defaults. - * - * @return void - */ - public function testPHP8ConstructorPropertyPromotionNoTypes() - { - $expected = []; - $expected[0] = [ - 'name' => '$x', - 'content' => 'public $x = 0.0', - 'default' => '0.0', - 'has_attributes' => false, - 'pass_by_reference' => false, - 'variable_length' => false, - 'type_hint' => '', - 'nullable_type' => false, - 'property_visibility' => 'public', - ]; - $expected[1] = [ - 'name' => '$y', - 'content' => 'protected $y = \'\'', - 'default' => "''", - 'has_attributes' => false, - 'pass_by_reference' => false, - 'variable_length' => false, - 'type_hint' => '', - 'nullable_type' => false, - 'property_visibility' => 'protected', - ]; - $expected[2] = [ - 'name' => '$z', - 'content' => 'private $z = null', - 'default' => 'null', - 'has_attributes' => false, - 'pass_by_reference' => false, - 'variable_length' => false, - 'type_hint' => '', - 'nullable_type' => false, - 'property_visibility' => 'private', - ]; - - $this->getMethodParametersTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testPHP8ConstructorPropertyPromotionNoTypes() - - - /** - * Verify recognition of PHP8 constructor property promotion with type declarations. - * - * @return void - */ - public function testPHP8ConstructorPropertyPromotionWithTypes() - { - $expected = []; - $expected[0] = [ - 'name' => '$x', - 'content' => 'protected float|int $x', - 'has_attributes' => false, - 'pass_by_reference' => false, - 'variable_length' => false, - 'type_hint' => 'float|int', - 'nullable_type' => false, - 'property_visibility' => 'protected', - ]; - $expected[1] = [ - 'name' => '$y', - 'content' => 'public ?string &$y = \'test\'', - 'default' => "'test'", - 'has_attributes' => false, - 'pass_by_reference' => true, - 'variable_length' => false, - 'type_hint' => '?string', - 'nullable_type' => true, - 'property_visibility' => 'public', - ]; - $expected[2] = [ - 'name' => '$z', - 'content' => 'private mixed $z', - 'has_attributes' => false, - 'pass_by_reference' => false, - 'variable_length' => false, - 'type_hint' => 'mixed', - 'nullable_type' => false, - 'property_visibility' => 'private', - ]; - - $this->getMethodParametersTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testPHP8ConstructorPropertyPromotionWithTypes() - - - /** - * Verify recognition of PHP8 constructor with both property promotion as well as normal parameters. - * - * @return void - */ - public function testPHP8ConstructorPropertyPromotionAndNormalParam() - { - $expected = []; - $expected[0] = [ - 'name' => '$promotedProp', - 'content' => 'public int $promotedProp', - 'has_attributes' => false, - 'pass_by_reference' => false, - 'variable_length' => false, - 'type_hint' => 'int', - 'nullable_type' => false, - 'property_visibility' => 'public', - ]; - $expected[1] = [ - 'name' => '$normalArg', - 'content' => '?int $normalArg', - 'has_attributes' => false, - 'pass_by_reference' => false, - 'variable_length' => false, - 'type_hint' => '?int', - 'nullable_type' => true, - ]; - - $this->getMethodParametersTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testPHP8ConstructorPropertyPromotionAndNormalParam() - - - /** - * Verify behaviour when a non-constructor function uses PHP 8 property promotion syntax. - * - * @return void - */ - public function testPHP8ConstructorPropertyPromotionGlobalFunction() - { - $expected = []; - $expected[0] = [ - 'name' => '$x', - 'content' => 'private $x', - 'has_attributes' => false, - 'pass_by_reference' => false, - 'variable_length' => false, - 'type_hint' => '', - 'nullable_type' => false, - 'property_visibility' => 'private', - ]; - - $this->getMethodParametersTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testPHP8ConstructorPropertyPromotionGlobalFunction() - - - /** - * Verify behaviour when an abstract constructor uses PHP 8 property promotion syntax. - * - * @return void - */ - public function testPHP8ConstructorPropertyPromotionAbstractMethod() - { - $expected = []; - $expected[0] = [ - 'name' => '$y', - 'content' => 'public callable $y', - 'has_attributes' => false, - 'pass_by_reference' => false, - 'variable_length' => false, - 'type_hint' => 'callable', - 'nullable_type' => false, - 'property_visibility' => 'public', - ]; - $expected[1] = [ - 'name' => '$x', - 'content' => 'private ...$x', - 'has_attributes' => false, - 'pass_by_reference' => false, - 'variable_length' => true, - 'type_hint' => '', - 'nullable_type' => false, - 'property_visibility' => 'private', - ]; - - $this->getMethodParametersTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testPHP8ConstructorPropertyPromotionAbstractMethod() - - - /** - * Verify and document behaviour when there are comments within a parameter declaration. - * - * @return void - */ - public function testCommentsInParameter() - { - $expected = []; - $expected[0] = [ - 'name' => '$param', - 'content' => '// Leading comment. - ?MyClass /*-*/ & /*-*/.../*-*/ $param /*-*/ = /*-*/ \'default value\' . /*-*/ \'second part\' // Trailing comment.', - 'has_attributes' => false, - 'pass_by_reference' => true, - 'variable_length' => true, - 'type_hint' => '?MyClass', - 'nullable_type' => true, - ]; - - $this->getMethodParametersTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testCommentsInParameter() - - - /** - * Verify behaviour when parameters have attributes attached. - * - * @return void - */ - public function testParameterAttributesInFunctionDeclaration() - { - $expected = []; - $expected[0] = [ - 'name' => '$constructorPropPromTypedParamSingleAttribute', - 'content' => '#[\MyExample\MyAttribute] private string $constructorPropPromTypedParamSingleAttribute', - 'has_attributes' => true, - 'pass_by_reference' => false, - 'variable_length' => false, - 'type_hint' => 'string', - 'nullable_type' => false, - 'property_visibility' => 'private', - ]; - $expected[1] = [ - 'name' => '$typedParamSingleAttribute', - 'content' => '#[MyAttr([1, 2])] - Type|false - $typedParamSingleAttribute', - 'has_attributes' => true, - 'pass_by_reference' => false, - 'variable_length' => false, - 'type_hint' => 'Type|false', - 'nullable_type' => false, - ]; - $expected[2] = [ - 'name' => '$nullableTypedParamMultiAttribute', - 'content' => '#[MyAttribute(1234), MyAttribute(5678)] ?int $nullableTypedParamMultiAttribute', - 'has_attributes' => true, - 'pass_by_reference' => false, - 'variable_length' => false, - 'type_hint' => '?int', - 'nullable_type' => true, - ]; - $expected[3] = [ - 'name' => '$nonTypedParamTwoAttributes', - 'content' => '#[WithoutArgument] #[SingleArgument(0)] $nonTypedParamTwoAttributes', - 'has_attributes' => true, - 'pass_by_reference' => false, - 'variable_length' => false, - 'type_hint' => '', - 'nullable_type' => false, - ]; - $expected[4] = [ - 'name' => '$otherParam', - 'content' => '#[MyAttribute(array("key" => "value"))] - &...$otherParam', - 'has_attributes' => true, - 'pass_by_reference' => true, - 'variable_length' => true, - 'type_hint' => '', - 'nullable_type' => false, - ]; - - $this->getMethodParametersTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testParameterAttributesInFunctionDeclaration() - - - /** - * Test helper. - * - * @param string $commentString The comment which preceeds the test. - * @param array $expected The expected function output. - * - * @return void - */ - private function getMethodParametersTestHelper($commentString, $expected) - { - $function = $this->getTargetToken($commentString, [T_FUNCTION, T_CLOSURE, T_FN]); - $found = self::$phpcsFile->getMethodParameters($function); - - $this->assertArraySubset($expected, $found, true); - - }//end getMethodParametersTestHelper() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodPropertiesTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodPropertiesTest.inc deleted file mode 100644 index 3e9682d..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodPropertiesTest.inc +++ /dev/null @@ -1,128 +0,0 @@ - $number + 1, - $numbers -); - -class ReturnMe { - /* testReturnTypeStatic */ - private function myFunction(): static { - return $this; - } -} - -/* testPHP8MixedTypeHint */ -function mixedTypeHint() :mixed {} - -/* testPHP8MixedTypeHintNullable */ -// Intentional fatal error - nullability is not allowed with mixed, but that's not the concern of the method. -function mixedTypeHintNullable(): ?mixed {} - -/* testNamespaceOperatorTypeHint */ -function namespaceOperatorTypeHint() : ?namespace\Name {} - -/* testPHP8UnionTypesSimple */ -function unionTypeSimple($number) : int|float {} - -/* testPHP8UnionTypesTwoClasses */ -$fn = fn($var): MyClassA|\Package\MyClassB => $var; - -/* testPHP8UnionTypesAllBaseTypes */ -function unionTypesAllBaseTypes() : array|bool|callable|int|float|null|Object|string {} - -/* testPHP8UnionTypesAllPseudoTypes */ -// Intentional fatal error - mixing types which cannot be combined, but that's not the concern of the method. -function unionTypesAllPseudoTypes($var) : false|MIXED|self|parent|static|iterable|Resource|void {} - -/* testPHP8UnionTypesNullable */ -// Intentional fatal error - nullability is not allowed with union types, but that's not the concern of the method. -$closure = function () use($a) :?int|float {}; - -/* testPHP8PseudoTypeNull */ -// Intentional fatal error - null pseudotype is only allowed in union types, but that's not the concern of the method. -function pseudoTypeNull(): null {} - -/* testPHP8PseudoTypeFalse */ -// Intentional fatal error - false pseudotype is only allowed in union types, but that's not the concern of the method. -function pseudoTypeFalse(): false {} - -/* testPHP8PseudoTypeFalseAndBool */ -// Intentional fatal error - false pseudotype is not allowed in combination with bool, but that's not the concern of the method. -function pseudoTypeFalseAndBool(): bool|false {} - -/* testPHP8ObjectAndClass */ -// Intentional fatal error - object is not allowed in combination with class name, but that's not the concern of the method. -function objectAndClass(): object|ClassName {} - -/* testPHP8PseudoTypeIterableAndArray */ -// Intentional fatal error - iterable pseudotype is not allowed in combination with array or Traversable, but that's not the concern of the method. -interface FooBar { - public function pseudoTypeIterableAndArray(): iterable|array|Traversable; -} - -/* testPHP8DuplicateTypeInUnionWhitespaceAndComment */ -// Intentional fatal error - duplicate types are not allowed in union types, but that's not the concern of the method. -function duplicateTypeInUnion(): int | /*comment*/ string | INT {} diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodPropertiesTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodPropertiesTest.php deleted file mode 100644 index d912d6b..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodPropertiesTest.php +++ /dev/null @@ -1,749 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tests\Core\File; - -use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest; - -class GetMethodPropertiesTest extends AbstractMethodUnitTest -{ - - - /** - * Test a basic function. - * - * @return void - */ - public function testBasicFunction() - { - $expected = [ - 'scope' => 'public', - 'scope_specified' => false, - 'return_type' => '', - 'nullable_return_type' => false, - 'is_abstract' => false, - 'is_final' => false, - 'is_static' => false, - 'has_body' => true, - ]; - - $this->getMethodPropertiesTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testBasicFunction() - - - /** - * Test a function with a return type. - * - * @return void - */ - public function testReturnFunction() - { - $expected = [ - 'scope' => 'public', - 'scope_specified' => false, - 'return_type' => 'array', - 'nullable_return_type' => false, - 'is_abstract' => false, - 'is_final' => false, - 'is_static' => false, - 'has_body' => true, - ]; - - $this->getMethodPropertiesTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testReturnFunction() - - - /** - * Test a closure used as a function argument. - * - * @return void - */ - public function testNestedClosure() - { - $expected = [ - 'scope' => 'public', - 'scope_specified' => false, - 'return_type' => 'int', - 'nullable_return_type' => false, - 'is_abstract' => false, - 'is_final' => false, - 'is_static' => false, - 'has_body' => true, - ]; - - $this->getMethodPropertiesTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testNestedClosure() - - - /** - * Test a basic method. - * - * @return void - */ - public function testBasicMethod() - { - $expected = [ - 'scope' => 'public', - 'scope_specified' => false, - 'return_type' => '', - 'nullable_return_type' => false, - 'is_abstract' => false, - 'is_final' => false, - 'is_static' => false, - 'has_body' => true, - ]; - - $this->getMethodPropertiesTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testBasicMethod() - - - /** - * Test a private static method. - * - * @return void - */ - public function testPrivateStaticMethod() - { - $expected = [ - 'scope' => 'private', - 'scope_specified' => true, - 'return_type' => '', - 'nullable_return_type' => false, - 'is_abstract' => false, - 'is_final' => false, - 'is_static' => true, - 'has_body' => true, - ]; - - $this->getMethodPropertiesTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testPrivateStaticMethod() - - - /** - * Test a basic final method. - * - * @return void - */ - public function testFinalMethod() - { - $expected = [ - 'scope' => 'public', - 'scope_specified' => true, - 'return_type' => '', - 'nullable_return_type' => false, - 'is_abstract' => false, - 'is_final' => true, - 'is_static' => false, - 'has_body' => true, - ]; - - $this->getMethodPropertiesTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testFinalMethod() - - - /** - * Test a protected method with a return type. - * - * @return void - */ - public function testProtectedReturnMethod() - { - $expected = [ - 'scope' => 'protected', - 'scope_specified' => true, - 'return_type' => 'int', - 'nullable_return_type' => false, - 'is_abstract' => false, - 'is_final' => false, - 'is_static' => false, - 'has_body' => true, - ]; - - $this->getMethodPropertiesTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testProtectedReturnMethod() - - - /** - * Test a public method with a return type. - * - * @return void - */ - public function testPublicReturnMethod() - { - $expected = [ - 'scope' => 'public', - 'scope_specified' => true, - 'return_type' => 'array', - 'nullable_return_type' => false, - 'is_abstract' => false, - 'is_final' => false, - 'is_static' => false, - 'has_body' => true, - ]; - - $this->getMethodPropertiesTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testPublicReturnMethod() - - - /** - * Test a public method with a nullable return type. - * - * @return void - */ - public function testNullableReturnMethod() - { - $expected = [ - 'scope' => 'public', - 'scope_specified' => true, - 'return_type' => '?array', - 'nullable_return_type' => true, - 'is_abstract' => false, - 'is_final' => false, - 'is_static' => false, - 'has_body' => true, - ]; - - $this->getMethodPropertiesTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testNullableReturnMethod() - - - /** - * Test a public method with a nullable return type. - * - * @return void - */ - public function testMessyNullableReturnMethod() - { - $expected = [ - 'scope' => 'public', - 'scope_specified' => true, - 'return_type' => '?array', - 'nullable_return_type' => true, - 'is_abstract' => false, - 'is_final' => false, - 'is_static' => false, - 'has_body' => true, - ]; - - $this->getMethodPropertiesTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testMessyNullableReturnMethod() - - - /** - * Test a method with a namespaced return type. - * - * @return void - */ - public function testReturnNamespace() - { - $expected = [ - 'scope' => 'public', - 'scope_specified' => false, - 'return_type' => '\MyNamespace\MyClass', - 'nullable_return_type' => false, - 'is_abstract' => false, - 'is_final' => false, - 'is_static' => false, - 'has_body' => true, - ]; - - $this->getMethodPropertiesTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testReturnNamespace() - - - /** - * Test a method with a messy namespaces return type. - * - * @return void - */ - public function testReturnMultilineNamespace() - { - $expected = [ - 'scope' => 'public', - 'scope_specified' => false, - 'return_type' => '\MyNamespace\MyClass\Foo', - 'nullable_return_type' => false, - 'is_abstract' => false, - 'is_final' => false, - 'is_static' => false, - 'has_body' => true, - ]; - - $this->getMethodPropertiesTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testReturnMultilineNamespace() - - - /** - * Test a basic abstract method. - * - * @return void - */ - public function testAbstractMethod() - { - $expected = [ - 'scope' => 'public', - 'scope_specified' => false, - 'return_type' => '', - 'nullable_return_type' => false, - 'is_abstract' => true, - 'is_final' => false, - 'is_static' => false, - 'has_body' => false, - ]; - - $this->getMethodPropertiesTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testAbstractMethod() - - - /** - * Test an abstract method with a return type. - * - * @return void - */ - public function testAbstractReturnMethod() - { - $expected = [ - 'scope' => 'protected', - 'scope_specified' => true, - 'return_type' => 'bool', - 'nullable_return_type' => false, - 'is_abstract' => true, - 'is_final' => false, - 'is_static' => false, - 'has_body' => false, - ]; - - $this->getMethodPropertiesTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testAbstractReturnMethod() - - - /** - * Test a basic interface method. - * - * @return void - */ - public function testInterfaceMethod() - { - $expected = [ - 'scope' => 'public', - 'scope_specified' => false, - 'return_type' => '', - 'nullable_return_type' => false, - 'is_abstract' => false, - 'is_final' => false, - 'is_static' => false, - 'has_body' => false, - ]; - - $this->getMethodPropertiesTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testInterfaceMethod() - - - /** - * Test a static arrow function. - * - * @return void - */ - public function testArrowFunction() - { - $expected = [ - 'scope' => 'public', - 'scope_specified' => false, - 'return_type' => 'int', - 'nullable_return_type' => false, - 'is_abstract' => false, - 'is_final' => false, - 'is_static' => true, - 'has_body' => true, - ]; - - $this->getMethodPropertiesTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testArrowFunction() - - - /** - * Test a function with return type "static". - * - * @return void - */ - public function testReturnTypeStatic() - { - $expected = [ - 'scope' => 'private', - 'scope_specified' => true, - 'return_type' => 'static', - 'nullable_return_type' => false, - 'is_abstract' => false, - 'is_final' => false, - 'is_static' => false, - 'has_body' => true, - ]; - - $this->getMethodPropertiesTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testReturnTypeStatic() - - - /** - * Test a function with return type "mixed". - * - * @return void - */ - public function testPHP8MixedTypeHint() - { - $expected = [ - 'scope' => 'public', - 'scope_specified' => false, - 'return_type' => 'mixed', - 'nullable_return_type' => false, - 'is_abstract' => false, - 'is_final' => false, - 'is_static' => false, - 'has_body' => true, - ]; - - $this->getMethodPropertiesTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testPHP8MixedTypeHint() - - - /** - * Test a function with return type "mixed" and nullability. - * - * @return void - */ - public function testPHP8MixedTypeHintNullable() - { - $expected = [ - 'scope' => 'public', - 'scope_specified' => false, - 'return_type' => '?mixed', - 'nullable_return_type' => true, - 'is_abstract' => false, - 'is_final' => false, - 'is_static' => false, - 'has_body' => true, - ]; - - $this->getMethodPropertiesTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testPHP8MixedTypeHintNullable() - - - /** - * Test a function with return type using the namespace operator. - * - * @return void - */ - public function testNamespaceOperatorTypeHint() - { - $expected = [ - 'scope' => 'public', - 'scope_specified' => false, - 'return_type' => '?namespace\Name', - 'nullable_return_type' => true, - 'is_abstract' => false, - 'is_final' => false, - 'is_static' => false, - 'has_body' => true, - ]; - - $this->getMethodPropertiesTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testNamespaceOperatorTypeHint() - - - /** - * Verify recognition of PHP8 union type declaration. - * - * @return void - */ - public function testPHP8UnionTypesSimple() - { - $expected = [ - 'scope' => 'public', - 'scope_specified' => false, - 'return_type' => 'int|float', - 'nullable_return_type' => false, - 'is_abstract' => false, - 'is_final' => false, - 'is_static' => false, - 'has_body' => true, - ]; - - $this->getMethodPropertiesTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testPHP8UnionTypesSimple() - - - /** - * Verify recognition of PHP8 union type declaration with two classes. - * - * @return void - */ - public function testPHP8UnionTypesTwoClasses() - { - $expected = [ - 'scope' => 'public', - 'scope_specified' => false, - 'return_type' => 'MyClassA|\Package\MyClassB', - 'nullable_return_type' => false, - 'is_abstract' => false, - 'is_final' => false, - 'is_static' => false, - 'has_body' => true, - ]; - - $this->getMethodPropertiesTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testPHP8UnionTypesTwoClasses() - - - /** - * Verify recognition of PHP8 union type declaration with all base types. - * - * @return void - */ - public function testPHP8UnionTypesAllBaseTypes() - { - $expected = [ - 'scope' => 'public', - 'scope_specified' => false, - 'return_type' => 'array|bool|callable|int|float|null|Object|string', - 'nullable_return_type' => false, - 'is_abstract' => false, - 'is_final' => false, - 'is_static' => false, - 'has_body' => true, - ]; - - $this->getMethodPropertiesTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testPHP8UnionTypesAllBaseTypes() - - - /** - * Verify recognition of PHP8 union type declaration with all pseudo types. - * - * @return void - */ - public function testPHP8UnionTypesAllPseudoTypes() - { - $expected = [ - 'scope' => 'public', - 'scope_specified' => false, - 'return_type' => 'false|MIXED|self|parent|static|iterable|Resource|void', - 'nullable_return_type' => false, - 'is_abstract' => false, - 'is_final' => false, - 'is_static' => false, - 'has_body' => true, - ]; - - $this->getMethodPropertiesTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testPHP8UnionTypesAllPseudoTypes() - - - /** - * Verify recognition of PHP8 union type declaration with (illegal) nullability. - * - * @return void - */ - public function testPHP8UnionTypesNullable() - { - $expected = [ - 'scope' => 'public', - 'scope_specified' => false, - 'return_type' => '?int|float', - 'nullable_return_type' => true, - 'is_abstract' => false, - 'is_final' => false, - 'is_static' => false, - 'has_body' => true, - ]; - - $this->getMethodPropertiesTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testPHP8UnionTypesNullable() - - - /** - * Verify recognition of PHP8 type declaration with (illegal) single type null. - * - * @return void - */ - public function testPHP8PseudoTypeNull() - { - $expected = [ - 'scope' => 'public', - 'scope_specified' => false, - 'return_type' => 'null', - 'nullable_return_type' => false, - 'is_abstract' => false, - 'is_final' => false, - 'is_static' => false, - 'has_body' => true, - ]; - - $this->getMethodPropertiesTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testPHP8PseudoTypeNull() - - - /** - * Verify recognition of PHP8 type declaration with (illegal) single type false. - * - * @return void - */ - public function testPHP8PseudoTypeFalse() - { - $expected = [ - 'scope' => 'public', - 'scope_specified' => false, - 'return_type' => 'false', - 'nullable_return_type' => false, - 'is_abstract' => false, - 'is_final' => false, - 'is_static' => false, - 'has_body' => true, - ]; - - $this->getMethodPropertiesTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testPHP8PseudoTypeFalse() - - - /** - * Verify recognition of PHP8 type declaration with (illegal) type false combined with type bool. - * - * @return void - */ - public function testPHP8PseudoTypeFalseAndBool() - { - $expected = [ - 'scope' => 'public', - 'scope_specified' => false, - 'return_type' => 'bool|false', - 'nullable_return_type' => false, - 'is_abstract' => false, - 'is_final' => false, - 'is_static' => false, - 'has_body' => true, - ]; - - $this->getMethodPropertiesTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testPHP8PseudoTypeFalseAndBool() - - - /** - * Verify recognition of PHP8 type declaration with (illegal) type object combined with a class name. - * - * @return void - */ - public function testPHP8ObjectAndClass() - { - $expected = [ - 'scope' => 'public', - 'scope_specified' => false, - 'return_type' => 'object|ClassName', - 'nullable_return_type' => false, - 'is_abstract' => false, - 'is_final' => false, - 'is_static' => false, - 'has_body' => true, - ]; - - $this->getMethodPropertiesTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testPHP8ObjectAndClass() - - - /** - * Verify recognition of PHP8 type declaration with (illegal) type iterable combined with array/Traversable. - * - * @return void - */ - public function testPHP8PseudoTypeIterableAndArray() - { - $expected = [ - 'scope' => 'public', - 'scope_specified' => true, - 'return_type' => 'iterable|array|Traversable', - 'nullable_return_type' => false, - 'is_abstract' => false, - 'is_final' => false, - 'is_static' => false, - 'has_body' => false, - ]; - - $this->getMethodPropertiesTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testPHP8PseudoTypeIterableAndArray() - - - /** - * Verify recognition of PHP8 type declaration with (illegal) duplicate types. - * - * @return void - */ - public function testPHP8DuplicateTypeInUnionWhitespaceAndComment() - { - $expected = [ - 'scope' => 'public', - 'scope_specified' => false, - 'return_type' => 'int|string|INT', - 'nullable_return_type' => false, - 'is_abstract' => false, - 'is_final' => false, - 'is_static' => false, - 'has_body' => true, - ]; - - $this->getMethodPropertiesTestHelper('/* '.__FUNCTION__.' */', $expected); - - }//end testPHP8DuplicateTypeInUnionWhitespaceAndComment() - - - /** - * Test helper. - * - * @param string $commentString The comment which preceeds the test. - * @param array $expected The expected function output. - * - * @return void - */ - private function getMethodPropertiesTestHelper($commentString, $expected) - { - $function = $this->getTargetToken($commentString, [T_FUNCTION, T_CLOSURE, T_FN]); - $found = self::$phpcsFile->getMethodProperties($function); - - $this->assertArraySubset($expected, $found, true); - - }//end getMethodPropertiesTestHelper() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/IsReferenceTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/File/IsReferenceTest.inc deleted file mode 100644 index cd40ed3..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/File/IsReferenceTest.inc +++ /dev/null @@ -1,150 +0,0 @@ - $first, 'b' => $something & $somethingElse ]; - -/* testBitwiseAndF */ -$a = array( 'a' => $first, 'b' => $something & \MyClass::$somethingElse ); - -/* testBitwiseAndG */ -$a = $something & $somethingElse; - -/* testBitwiseAndH */ -function myFunction($a = 10 & 20) {} - -/* testBitwiseAndI */ -$closure = function ($a = MY_CONSTANT & parent::OTHER_CONSTANT) {}; - -/* testFunctionReturnByReference */ -function &myFunction() {} - -/* testFunctionPassByReferenceA */ -function myFunction( &$a ) {} - -/* testFunctionPassByReferenceB */ -function myFunction( $a, &$b ) {} - -/* testFunctionPassByReferenceC */ -$closure = function ( &$a ) {}; - -/* testFunctionPassByReferenceD */ -$closure = function ( $a, &$b ) {}; - -/* testFunctionPassByReferenceE */ -function myFunction(array &$one) {} - -/* testFunctionPassByReferenceF */ -$closure = function (\MyClass &$one) {}; - -/* testFunctionPassByReferenceG */ -$closure = function myFunc($param, &...$moreParams) {}; - -/* testForeachValueByReference */ -foreach( $array as $key => &$value ) {} - -/* testForeachKeyByReference */ -foreach( $array as &$key => $value ) {} - -/* testArrayValueByReferenceA */ -$a = [ 'a' => &$something ]; - -/* testArrayValueByReferenceB */ -$a = [ 'a' => $something, 'b' => &$somethingElse ]; - -/* testArrayValueByReferenceC */ -$a = [ &$something ]; - -/* testArrayValueByReferenceD */ -$a = [ $something, &$somethingElse ]; - -/* testArrayValueByReferenceE */ -$a = array( 'a' => &$something ); - -/* testArrayValueByReferenceF */ -$a = array( 'a' => $something, 'b' => &$somethingElse ); - -/* testArrayValueByReferenceG */ -$a = array( &$something ); - -/* testArrayValueByReferenceH */ -$a = array( $something, &$somethingElse ); - -/* testAssignByReferenceA */ -$b = &$something; - -/* testAssignByReferenceB */ -$b =& $something; - -/* testAssignByReferenceC */ -$b .= &$something; - -/* testAssignByReferenceD */ -$myValue = &$obj->getValue(); - -/* testAssignByReferenceE */ -$collection = &collector(); - -/* testPassByReferenceA */ -functionCall(&$something, $somethingElse); - -/* testPassByReferenceB */ -functionCall($something, &$somethingElse); - -/* testPassByReferenceC */ -functionCall($something, &$this->somethingElse); - -/* testPassByReferenceD */ -functionCall($something, &self::$somethingElse); - -/* testPassByReferenceE */ -functionCall($something, &parent::$somethingElse); - -/* testPassByReferenceF */ -functionCall($something, &static::$somethingElse); - -/* testPassByReferenceG */ -functionCall($something, &SomeClass::$somethingElse); - -/* testPassByReferenceH */ -functionCall(&\SomeClass::$somethingElse); - -/* testPassByReferenceI */ -functionCall($something, &\SomeNS\SomeClass::$somethingElse); - -/* testPassByReferenceJ */ -functionCall($something, &namespace\SomeClass::$somethingElse); - -/* testNewByReferenceA */ -$foobar2 = &new Foobar(); - -/* testNewByReferenceB */ -functionCall( $something , &new Foobar() ); - -/* testUseByReference */ -$closure = function() use (&$var){}; - -/* testArrowFunctionReturnByReference */ -fn&($x) => $x; - -/* testArrowFunctionPassByReferenceA */ -$fn = fn(array &$one) => 1; - -/* testArrowFunctionPassByReferenceB */ -$fn = fn($param, &...$moreParams) => 1; - -/* testClosureReturnByReference */ -$closure = function &($param) use ($value) {}; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/IsReferenceTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/File/IsReferenceTest.php deleted file mode 100644 index ea2dddb..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/File/IsReferenceTest.php +++ /dev/null @@ -1,248 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tests\Core\File; - -use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest; - -class IsReferenceTest extends AbstractMethodUnitTest -{ - - - /** - * Test correctly identifying whether a "bitwise and" token is a reference or not. - * - * @param string $identifier Comment which precedes the test case. - * @param bool $expected Expected function output. - * - * @dataProvider dataIsReference - * - * @return void - */ - public function testIsReference($identifier, $expected) - { - $bitwiseAnd = $this->getTargetToken($identifier, T_BITWISE_AND); - $result = self::$phpcsFile->isReference($bitwiseAnd); - $this->assertSame($expected, $result); - - }//end testIsReference() - - - /** - * Data provider for the IsReference test. - * - * @see testIsReference() - * - * @return array - */ - public function dataIsReference() - { - return [ - [ - '/* testBitwiseAndA */', - false, - ], - [ - '/* testBitwiseAndB */', - false, - ], - [ - '/* testBitwiseAndC */', - false, - ], - [ - '/* testBitwiseAndD */', - false, - ], - [ - '/* testBitwiseAndE */', - false, - ], - [ - '/* testBitwiseAndF */', - false, - ], - [ - '/* testBitwiseAndG */', - false, - ], - [ - '/* testBitwiseAndH */', - false, - ], - [ - '/* testBitwiseAndI */', - false, - ], - [ - '/* testFunctionReturnByReference */', - true, - ], - [ - '/* testFunctionPassByReferenceA */', - true, - ], - [ - '/* testFunctionPassByReferenceB */', - true, - ], - [ - '/* testFunctionPassByReferenceC */', - true, - ], - [ - '/* testFunctionPassByReferenceD */', - true, - ], - [ - '/* testFunctionPassByReferenceE */', - true, - ], - [ - '/* testFunctionPassByReferenceF */', - true, - ], - [ - '/* testFunctionPassByReferenceG */', - true, - ], - [ - '/* testForeachValueByReference */', - true, - ], - [ - '/* testForeachKeyByReference */', - true, - ], - [ - '/* testArrayValueByReferenceA */', - true, - ], - [ - '/* testArrayValueByReferenceB */', - true, - ], - [ - '/* testArrayValueByReferenceC */', - true, - ], - [ - '/* testArrayValueByReferenceD */', - true, - ], - [ - '/* testArrayValueByReferenceE */', - true, - ], - [ - '/* testArrayValueByReferenceF */', - true, - ], - [ - '/* testArrayValueByReferenceG */', - true, - ], - [ - '/* testArrayValueByReferenceH */', - true, - ], - [ - '/* testAssignByReferenceA */', - true, - ], - [ - '/* testAssignByReferenceB */', - true, - ], - [ - '/* testAssignByReferenceC */', - true, - ], - [ - '/* testAssignByReferenceD */', - true, - ], - [ - '/* testAssignByReferenceE */', - true, - ], - [ - '/* testPassByReferenceA */', - true, - ], - [ - '/* testPassByReferenceB */', - true, - ], - [ - '/* testPassByReferenceC */', - true, - ], - [ - '/* testPassByReferenceD */', - true, - ], - [ - '/* testPassByReferenceE */', - true, - ], - [ - '/* testPassByReferenceF */', - true, - ], - [ - '/* testPassByReferenceG */', - true, - ], - [ - '/* testPassByReferenceH */', - true, - ], - [ - '/* testPassByReferenceI */', - true, - ], - [ - '/* testPassByReferenceJ */', - true, - ], - [ - '/* testNewByReferenceA */', - true, - ], - [ - '/* testNewByReferenceB */', - true, - ], - [ - '/* testUseByReference */', - true, - ], - [ - '/* testArrowFunctionReturnByReference */', - true, - ], - [ - '/* testArrowFunctionPassByReferenceA */', - true, - ], - [ - '/* testArrowFunctionPassByReferenceB */', - true, - ], - [ - '/* testClosureReturnByReference */', - true, - ], - ]; - - }//end dataIsReference() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Filters/Filter/AcceptTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Filters/Filter/AcceptTest.php deleted file mode 100644 index 2c9f57c..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Filters/Filter/AcceptTest.php +++ /dev/null @@ -1,154 +0,0 @@ - - * @author Juliette Reinders Folmer - * @copyright 2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tests\Core\Filters\Filter; - -use PHP_CodeSniffer\Config; -use PHP_CodeSniffer\Filters\Filter; -use PHP_CodeSniffer\Ruleset; -use PHPUnit\Framework\TestCase; - -class AcceptTest extends TestCase -{ - - /** - * The Config object. - * - * @var \PHP_CodeSniffer\Config - */ - protected static $config; - - /** - * The Ruleset object. - * - * @var \PHP_CodeSniffer\Ruleset - */ - protected static $ruleset; - - - /** - * Initialize the test. - * - * @return void - */ - public function setUp() - { - if ($GLOBALS['PHP_CODESNIFFER_PEAR'] === true) { - // PEAR installs test and sniff files into different locations - // so these tests will not pass as they directly reference files - // by relative location. - $this->markTestSkipped('Test cannot run from a PEAR install'); - } - - }//end setUp() - - - /** - * Initialize the config and ruleset objects based on the `AcceptTest.xml` ruleset file. - * - * @return void - */ - public static function setUpBeforeClass() - { - if ($GLOBALS['PHP_CODESNIFFER_PEAR'] === true) { - // This test will be skipped. - return; - } - - $standard = __DIR__.'/'.basename(__FILE__, '.php').'.xml'; - self::$config = new Config(["--standard=$standard", "--ignore=*/somethingelse/*"]); - self::$ruleset = new Ruleset(self::$config); - - }//end setUpBeforeClass() - - - /** - * Test filtering a file list for excluded paths. - * - * @param array $inputPaths List of file paths to be filtered. - * @param array $expectedOutput Expected filtering result. - * - * @dataProvider dataExcludePatterns - * - * @return void - */ - public function testExcludePatterns($inputPaths, $expectedOutput) - { - $fakeDI = new \RecursiveArrayIterator($inputPaths); - $filter = new Filter($fakeDI, '/', self::$config, self::$ruleset); - $iterator = new \RecursiveIteratorIterator($filter); - $files = []; - - foreach ($iterator as $file) { - $files[] = $file; - } - - $this->assertEquals($expectedOutput, $files); - - }//end testExcludePatterns() - - - /** - * Data provider. - * - * @see testExcludePatterns - * - * @return array - */ - public function dataExcludePatterns() - { - $testCases = [ - // Test top-level exclude patterns. - [ - [ - '/path/to/src/Main.php', - '/path/to/src/Something/Main.php', - '/path/to/src/Somethingelse/Main.php', - '/path/to/src/SomethingelseEvenLonger/Main.php', - '/path/to/src/Other/Main.php', - ], - [ - '/path/to/src/Main.php', - '/path/to/src/SomethingelseEvenLonger/Main.php', - ], - ], - - // Test ignoring standard/sniff specific exclude patterns. - [ - [ - '/path/to/src/generic-project/Main.php', - '/path/to/src/generic/Main.php', - '/path/to/src/anything-generic/Main.php', - ], - [ - '/path/to/src/generic-project/Main.php', - '/path/to/src/generic/Main.php', - '/path/to/src/anything-generic/Main.php', - ], - ], - ]; - - // Allow these tests to work on Windows as well. - if (DIRECTORY_SEPARATOR === '\\') { - foreach ($testCases as $key => $case) { - foreach ($case as $nr => $param) { - foreach ($param as $file => $value) { - $testCases[$key][$nr][$file] = strtr($value, '/', '\\'); - } - } - } - } - - return $testCases; - - }//end dataExcludePatterns() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Filters/Filter/AcceptTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Filters/Filter/AcceptTest.xml deleted file mode 100644 index 3d3e1de..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Filters/Filter/AcceptTest.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - Ruleset to test the filtering based on exclude patterns. - - - */something/* - - */Other/Main\.php$ - - - - /anything/* - - /YetAnother/Main\.php - - diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/IsCamelCapsTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/IsCamelCapsTest.php deleted file mode 100644 index b60d524..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/IsCamelCapsTest.php +++ /dev/null @@ -1,135 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tests\Core; - -use PHP_CodeSniffer\Util\Common; -use PHPUnit\Framework\TestCase; - -class IsCamelCapsTest extends TestCase -{ - - - /** - * Test valid public function/method names. - * - * @return void - */ - public function testValidNotClassFormatPublic() - { - $this->assertTrue(Common::isCamelCaps('thisIsCamelCaps', false, true, true)); - $this->assertTrue(Common::isCamelCaps('thisISCamelCaps', false, true, false)); - - }//end testValidNotClassFormatPublic() - - - /** - * Test invalid public function/method names. - * - * @return void - */ - public function testInvalidNotClassFormatPublic() - { - $this->assertFalse(Common::isCamelCaps('_thisIsCamelCaps', false, true, true)); - $this->assertFalse(Common::isCamelCaps('thisISCamelCaps', false, true, true)); - $this->assertFalse(Common::isCamelCaps('ThisIsCamelCaps', false, true, true)); - - $this->assertFalse(Common::isCamelCaps('3thisIsCamelCaps', false, true, true)); - $this->assertFalse(Common::isCamelCaps('*thisIsCamelCaps', false, true, true)); - $this->assertFalse(Common::isCamelCaps('-thisIsCamelCaps', false, true, true)); - - $this->assertFalse(Common::isCamelCaps('this*IsCamelCaps', false, true, true)); - $this->assertFalse(Common::isCamelCaps('this-IsCamelCaps', false, true, true)); - $this->assertFalse(Common::isCamelCaps('this_IsCamelCaps', false, true, true)); - $this->assertFalse(Common::isCamelCaps('this_is_camel_caps', false, true, true)); - - }//end testInvalidNotClassFormatPublic() - - - /** - * Test valid private method names. - * - * @return void - */ - public function testValidNotClassFormatPrivate() - { - $this->assertTrue(Common::isCamelCaps('_thisIsCamelCaps', false, false, true)); - $this->assertTrue(Common::isCamelCaps('_thisISCamelCaps', false, false, false)); - $this->assertTrue(Common::isCamelCaps('_i18N', false, false, true)); - $this->assertTrue(Common::isCamelCaps('_i18n', false, false, true)); - - }//end testValidNotClassFormatPrivate() - - - /** - * Test invalid private method names. - * - * @return void - */ - public function testInvalidNotClassFormatPrivate() - { - $this->assertFalse(Common::isCamelCaps('thisIsCamelCaps', false, false, true)); - $this->assertFalse(Common::isCamelCaps('_thisISCamelCaps', false, false, true)); - $this->assertFalse(Common::isCamelCaps('_ThisIsCamelCaps', false, false, true)); - $this->assertFalse(Common::isCamelCaps('__thisIsCamelCaps', false, false, true)); - $this->assertFalse(Common::isCamelCaps('__thisISCamelCaps', false, false, false)); - - $this->assertFalse(Common::isCamelCaps('3thisIsCamelCaps', false, false, true)); - $this->assertFalse(Common::isCamelCaps('*thisIsCamelCaps', false, false, true)); - $this->assertFalse(Common::isCamelCaps('-thisIsCamelCaps', false, false, true)); - $this->assertFalse(Common::isCamelCaps('_this_is_camel_caps', false, false, true)); - - }//end testInvalidNotClassFormatPrivate() - - - /** - * Test valid class names. - * - * @return void - */ - public function testValidClassFormatPublic() - { - $this->assertTrue(Common::isCamelCaps('ThisIsCamelCaps', true, true, true)); - $this->assertTrue(Common::isCamelCaps('ThisISCamelCaps', true, true, false)); - $this->assertTrue(Common::isCamelCaps('This3IsCamelCaps', true, true, false)); - - }//end testValidClassFormatPublic() - - - /** - * Test invalid class names. - * - * @return void - */ - public function testInvalidClassFormat() - { - $this->assertFalse(Common::isCamelCaps('thisIsCamelCaps', true)); - $this->assertFalse(Common::isCamelCaps('This-IsCamelCaps', true)); - $this->assertFalse(Common::isCamelCaps('This_Is_Camel_Caps', true)); - - }//end testInvalidClassFormat() - - - /** - * Test invalid class names with the private flag set. - * - * Note that the private flag is ignored if the class format - * flag is set, so these names are all invalid. - * - * @return void - */ - public function testInvalidClassFormatPrivate() - { - $this->assertFalse(Common::isCamelCaps('_ThisIsCamelCaps', true, true)); - $this->assertFalse(Common::isCamelCaps('_ThisIsCamelCaps', true, false)); - - }//end testInvalidClassFormatPrivate() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionAbsoluteLinuxTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionAbsoluteLinuxTest.php deleted file mode 100644 index 8b138e0..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionAbsoluteLinuxTest.php +++ /dev/null @@ -1,118 +0,0 @@ - - * @copyright 2019 Juliette Reinders Folmer. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tests\Core\Ruleset; - -use PHP_CodeSniffer\Config; -use PHP_CodeSniffer\Ruleset; -use PHPUnit\Framework\TestCase; - -class RuleInclusionAbsoluteLinuxTest extends TestCase -{ - - /** - * The Ruleset object. - * - * @var \PHP_CodeSniffer\Ruleset - */ - protected $ruleset; - - /** - * Path to the ruleset file. - * - * @var string - */ - private $standard = ''; - - /** - * The original content of the ruleset. - * - * @var string - */ - private $contents = ''; - - - /** - * Initialize the config and ruleset objects. - * - * @return void - */ - public function setUp() - { - if ($GLOBALS['PHP_CODESNIFFER_PEAR'] === true) { - // PEAR installs test and sniff files into different locations - // so these tests will not pass as they directly reference files - // by relative location. - $this->markTestSkipped('Test cannot run from a PEAR install'); - } - - $this->standard = __DIR__.'/'.basename(__FILE__, '.php').'.xml'; - $repoRootDir = dirname(dirname(dirname(__DIR__))); - - // On-the-fly adjust the ruleset test file to be able to test sniffs included with absolute paths. - $contents = file_get_contents($this->standard); - $this->contents = $contents; - - $newPath = $repoRootDir; - if (DIRECTORY_SEPARATOR === '\\') { - $newPath = str_replace('\\', '/', $repoRootDir); - } - - $adjusted = str_replace('%path_slash_forward%', $newPath, $contents); - - if (file_put_contents($this->standard, $adjusted) === false) { - $this->markTestSkipped('On the fly ruleset adjustment failed'); - } - - // Initialize the config and ruleset objects for the test. - $config = new Config(["--standard={$this->standard}"]); - $this->ruleset = new Ruleset($config); - - }//end setUp() - - - /** - * Reset ruleset file. - * - * @return void - */ - public function tearDown() - { - file_put_contents($this->standard, $this->contents); - - }//end tearDown() - - - /** - * Test that sniffs registed with a Linux absolute path are correctly recognized and that - * properties are correctly set for them. - * - * @return void - */ - public function testLinuxStylePathRuleInclusion() - { - // Test that the sniff is correctly registered. - $this->assertObjectHasAttribute('sniffCodes', $this->ruleset); - $this->assertCount(1, $this->ruleset->sniffCodes); - $this->assertArrayHasKey('Generic.Formatting.SpaceAfterNot', $this->ruleset->sniffCodes); - $this->assertSame( - 'PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\SpaceAfterNotSniff', - $this->ruleset->sniffCodes['Generic.Formatting.SpaceAfterNot'] - ); - - // Test that the sniff properties are correctly set. - $this->assertSame( - '10', - $this->ruleset->sniffs['PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\SpaceAfterNotSniff']->spacing - ); - - }//end testLinuxStylePathRuleInclusion() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionAbsoluteLinuxTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionAbsoluteLinuxTest.xml deleted file mode 100644 index 64d1aae..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionAbsoluteLinuxTest.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionAbsoluteWindowsTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionAbsoluteWindowsTest.php deleted file mode 100644 index f8e3255..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionAbsoluteWindowsTest.php +++ /dev/null @@ -1,119 +0,0 @@ - - * @copyright 2019 Juliette Reinders Folmer. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tests\Core\Ruleset; - -use PHP_CodeSniffer\Config; -use PHP_CodeSniffer\Ruleset; -use PHPUnit\Framework\TestCase; - -class RuleInclusionAbsoluteWindowsTest extends TestCase -{ - - /** - * The Ruleset object. - * - * @var \PHP_CodeSniffer\Ruleset - */ - protected $ruleset; - - /** - * Path to the ruleset file. - * - * @var string - */ - private $standard = ''; - - /** - * The original content of the ruleset. - * - * @var string - */ - private $contents = ''; - - - /** - * Initialize the config and ruleset objects. - * - * @return void - */ - public function setUp() - { - if (DIRECTORY_SEPARATOR === '/') { - $this->markTestSkipped('Windows specific test'); - } - - if ($GLOBALS['PHP_CODESNIFFER_PEAR'] === true) { - // PEAR installs test and sniff files into different locations - // so these tests will not pass as they directly reference files - // by relative location. - $this->markTestSkipped('Test cannot run from a PEAR install'); - } - - $this->standard = __DIR__.'/'.basename(__FILE__, '.php').'.xml'; - $repoRootDir = dirname(dirname(dirname(__DIR__))); - - // On-the-fly adjust the ruleset test file to be able to test sniffs included with absolute paths. - $contents = file_get_contents($this->standard); - $this->contents = $contents; - - $adjusted = str_replace('%path_slash_back%', $repoRootDir, $contents); - - if (file_put_contents($this->standard, $adjusted) === false) { - $this->markTestSkipped('On the fly ruleset adjustment failed'); - } - - // Initialize the config and ruleset objects for the test. - $config = new Config(["--standard={$this->standard}"]); - $this->ruleset = new Ruleset($config); - - }//end setUp() - - - /** - * Reset ruleset file. - * - * @return void - */ - public function tearDown() - { - if (DIRECTORY_SEPARATOR !== '/') { - file_put_contents($this->standard, $this->contents); - } - - }//end tearDown() - - - /** - * Test that sniffs registed with a Windows absolute path are correctly recognized and that - * properties are correctly set for them. - * - * @return void - */ - public function testWindowsStylePathRuleInclusion() - { - // Test that the sniff is correctly registered. - $this->assertObjectHasAttribute('sniffCodes', $this->ruleset); - $this->assertCount(1, $this->ruleset->sniffCodes); - $this->assertArrayHasKey('Generic.Formatting.SpaceAfterCast', $this->ruleset->sniffCodes); - $this->assertSame( - 'PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\SpaceAfterCastSniff', - $this->ruleset->sniffCodes['Generic.Formatting.SpaceAfterCast'] - ); - - // Test that the sniff property is correctly set. - $this->assertSame( - '10', - $this->ruleset->sniffs['PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\SpaceAfterCastSniff']->spacing - ); - - }//end testWindowsStylePathRuleInclusion() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionAbsoluteWindowsTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionAbsoluteWindowsTest.xml deleted file mode 100644 index 15710d2..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionAbsoluteWindowsTest.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionTest-include.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionTest-include.xml deleted file mode 100644 index ca116d4..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionTest-include.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionTest.php deleted file mode 100644 index 24abe8d..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionTest.php +++ /dev/null @@ -1,297 +0,0 @@ - - * @copyright 2019 Juliette Reinders Folmer. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tests\Core\Ruleset; - -use PHP_CodeSniffer\Config; -use PHP_CodeSniffer\Ruleset; -use PHPUnit\Framework\TestCase; - -class RuleInclusionTest extends TestCase -{ - - /** - * The Ruleset object. - * - * @var \PHP_CodeSniffer\Ruleset - */ - protected static $ruleset; - - /** - * Path to the ruleset file. - * - * @var string - */ - private static $standard = ''; - - /** - * The original content of the ruleset. - * - * @var string - */ - private static $contents = ''; - - - /** - * Initialize the test. - * - * @return void - */ - public function setUp() - { - if ($GLOBALS['PHP_CODESNIFFER_PEAR'] === true) { - // PEAR installs test and sniff files into different locations - // so these tests will not pass as they directly reference files - // by relative location. - $this->markTestSkipped('Test cannot run from a PEAR install'); - } - - }//end setUp() - - - /** - * Initialize the config and ruleset objects based on the `RuleInclusionTest.xml` ruleset file. - * - * @return void - */ - public static function setUpBeforeClass() - { - if ($GLOBALS['PHP_CODESNIFFER_PEAR'] === true) { - // This test will be skipped. - return; - } - - $standard = __DIR__.'/'.basename(__FILE__, '.php').'.xml'; - self::$standard = $standard; - - // On-the-fly adjust the ruleset test file to be able to test - // sniffs included with relative paths. - $contents = file_get_contents($standard); - self::$contents = $contents; - - $repoRootDir = basename(dirname(dirname(dirname(__DIR__)))); - - $newPath = $repoRootDir; - if (DIRECTORY_SEPARATOR === '\\') { - $newPath = str_replace('\\', '/', $repoRootDir); - } - - $adjusted = str_replace('%path_root_dir%', $newPath, $contents); - - if (file_put_contents($standard, $adjusted) === false) { - self::markTestSkipped('On the fly ruleset adjustment failed'); - } - - $config = new Config(["--standard=$standard"]); - self::$ruleset = new Ruleset($config); - - }//end setUpBeforeClass() - - - /** - * Reset ruleset file. - * - * @return void - */ - public function tearDown() - { - file_put_contents(self::$standard, self::$contents); - - }//end tearDown() - - - /** - * Test that sniffs are registered. - * - * @return void - */ - public function testHasSniffCodes() - { - $this->assertObjectHasAttribute('sniffCodes', self::$ruleset); - $this->assertCount(14, self::$ruleset->sniffCodes); - - }//end testHasSniffCodes() - - - /** - * Test that sniffs are correctly registered, independently on the syntax used to include the sniff. - * - * @param string $key Expected array key. - * @param string $value Expected array value. - * - * @dataProvider dataRegisteredSniffCodes - * - * @return void - */ - public function testRegisteredSniffCodes($key, $value) - { - $this->assertArrayHasKey($key, self::$ruleset->sniffCodes); - $this->assertSame($value, self::$ruleset->sniffCodes[$key]); - - }//end testRegisteredSniffCodes() - - - /** - * Data provider. - * - * @see self::testRegisteredSniffCodes() - * - * @return array - */ - public function dataRegisteredSniffCodes() - { - return [ - [ - 'PSR1.Classes.ClassDeclaration', - 'PHP_CodeSniffer\Standards\PSR1\Sniffs\Classes\ClassDeclarationSniff', - ], - [ - 'PSR1.Files.SideEffects', - 'PHP_CodeSniffer\Standards\PSR1\Sniffs\Files\SideEffectsSniff', - ], - [ - 'PSR1.Methods.CamelCapsMethodName', - 'PHP_CodeSniffer\Standards\PSR1\Sniffs\Methods\CamelCapsMethodNameSniff', - ], - [ - 'Generic.PHP.DisallowAlternativePHPTags', - 'PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowAlternativePHPTagsSniff', - ], - [ - 'Generic.PHP.DisallowShortOpenTag', - 'PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowShortOpenTagSniff', - ], - [ - 'Generic.Files.ByteOrderMark', - 'PHP_CodeSniffer\Standards\Generic\Sniffs\Files\ByteOrderMarkSniff', - ], - [ - 'Squiz.Classes.ValidClassName', - 'PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\ValidClassNameSniff', - ], - [ - 'Generic.NamingConventions.UpperCaseConstantName', - 'PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\UpperCaseConstantNameSniff', - ], - [ - 'Zend.NamingConventions.ValidVariableName', - 'PHP_CodeSniffer\Standards\Zend\Sniffs\NamingConventions\ValidVariableNameSniff', - ], - [ - 'Generic.Arrays.ArrayIndent', - 'PHP_CodeSniffer\Standards\Generic\Sniffs\Arrays\ArrayIndentSniff', - ], - [ - 'Generic.Metrics.CyclomaticComplexity', - 'PHP_CodeSniffer\Standards\Generic\Sniffs\Metrics\CyclomaticComplexitySniff', - ], - [ - 'Generic.Files.LineLength', - 'PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineLengthSniff', - ], - [ - 'Generic.NamingConventions.CamelCapsFunctionName', - 'PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\CamelCapsFunctionNameSniff', - ], - [ - 'Generic.Metrics.NestingLevel', - 'PHP_CodeSniffer\Standards\Generic\Sniffs\Metrics\NestingLevelSniff', - ], - ]; - - }//end dataRegisteredSniffCodes() - - - /** - * Test that setting properties for standards, categories, sniffs works for all supported rule - * inclusion methods. - * - * @param string $sniffClass The name of the sniff class. - * @param string $propertyName The name of the changed property. - * @param mixed $expectedValue The value expected for the property. - * - * @dataProvider dataSettingProperties - * - * @return void - */ - public function testSettingProperties($sniffClass, $propertyName, $expectedValue) - { - $this->assertObjectHasAttribute('sniffs', self::$ruleset); - $this->assertArrayHasKey($sniffClass, self::$ruleset->sniffs); - $this->assertObjectHasAttribute($propertyName, self::$ruleset->sniffs[$sniffClass]); - - $actualValue = self::$ruleset->sniffs[$sniffClass]->$propertyName; - $this->assertSame($expectedValue, $actualValue); - - }//end testSettingProperties() - - - /** - * Data provider. - * - * @see self::testSettingProperties() - * - * @return array - */ - public function dataSettingProperties() - { - return [ - 'ClassDeclarationSniff' => [ - 'PHP_CodeSniffer\Standards\PSR1\Sniffs\Classes\ClassDeclarationSniff', - 'setforallsniffs', - true, - ], - 'SideEffectsSniff' => [ - 'PHP_CodeSniffer\Standards\PSR1\Sniffs\Files\SideEffectsSniff', - 'setforallsniffs', - true, - ], - 'ValidVariableNameSniff' => [ - 'PHP_CodeSniffer\Standards\Zend\Sniffs\NamingConventions\ValidVariableNameSniff', - 'setforallincategory', - true, - ], - 'ArrayIndentSniff' => [ - 'PHP_CodeSniffer\Standards\Generic\Sniffs\Arrays\ArrayIndentSniff', - 'indent', - '2', - ], - 'LineLengthSniff' => [ - 'PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineLengthSniff', - 'lineLimit', - '10', - ], - 'CamelCapsFunctionNameSniff' => [ - 'PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\CamelCapsFunctionNameSniff', - 'strict', - false, - ], - 'NestingLevelSniff-nestingLevel' => [ - 'PHP_CodeSniffer\Standards\Generic\Sniffs\Metrics\NestingLevelSniff', - 'nestingLevel', - '2', - ], - 'NestingLevelSniff-setforsniffsinincludedruleset' => [ - 'PHP_CodeSniffer\Standards\Generic\Sniffs\Metrics\NestingLevelSniff', - 'setforsniffsinincludedruleset', - true, - ], - - // Testing that setting a property at error code level does *not* work. - 'CyclomaticComplexitySniff' => [ - 'PHP_CodeSniffer\Standards\Generic\Sniffs\Metrics\CyclomaticComplexitySniff', - 'complexity', - 10, - ], - ]; - - }//end dataSettingProperties() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionTest.xml deleted file mode 100644 index 06ce040..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionTest.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Sniffs/AbstractArraySniffTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Sniffs/AbstractArraySniffTest.inc deleted file mode 100644 index 4882295..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Sniffs/AbstractArraySniffTest.inc +++ /dev/null @@ -1,51 +0,0 @@ -1,'2'=>2,'3'=>3]; - -/* testMissingKeys */ -$foo = ['1'=>1,2,'3'=>3]; - -/* testMultiTokenKeys */ -$paths = array( - Init::ROOT_DIR.'/a' => 'a', - Init::ROOT_DIR.'/b' => 'b', -); - -/* testMissingKeysCoalesceTernary */ -return [ - $a => static function () { return [1,2,3]; }, - $b ?? $c, - $d ? [$e] : [$f], -]; - -/* testTernaryValues */ -$foo = [ - '1' => $row['status'] === 'rejected' - ? self::REJECTED_CODE - : self::VERIFIED_CODE, - '2' => in_array($row['status'], array('notverified', 'unverified'), true) - ? self::STATUS_PENDING - : self::STATUS_VERIFIED, - '3' => strtotime($row['date']), -]; - -/* testHeredocValues */ -$foo = array( - << '1', - 2 => fn ($x) => yield 'a' => $x, - 3 => '3', -); diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Sniffs/AbstractArraySniffTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Sniffs/AbstractArraySniffTest.php deleted file mode 100644 index 20c28d6..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Sniffs/AbstractArraySniffTest.php +++ /dev/null @@ -1,290 +0,0 @@ - - * @copyright 2006-2020 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tests\Core\Sniffs; - -use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest; - -class AbstractArraySniffTest extends AbstractMethodUnitTest -{ - - /** - * The sniff objects we are testing. - * - * This extends the \PHP_CodeSniffer\Sniffs\AbstractArraySniff class to make the - * internal workings of the sniff observable. - * - * @var \PHP_CodeSniffer\Sniffs\AbstractArraySniffTestable - */ - protected static $sniff; - - - /** - * Initialize & tokenize \PHP_CodeSniffer\Files\File with code from the test case file. - * - * The test case file for a unit test class has to be in the same directory - * directory and use the same file name as the test class, using the .inc extension. - * - * @return void - */ - public static function setUpBeforeClass() - { - self::$sniff = new AbstractArraySniffTestable(); - parent::setUpBeforeClass(); - - }//end setUpBeforeClass() - - - /** - * Test an array of simple values only. - * - * @return void - */ - public function testSimpleValues() - { - $token = $this->getTargetToken('/* testSimpleValues */', T_OPEN_SHORT_ARRAY); - self::$sniff->process(self::$phpcsFile, $token); - - $expected = [ - 0 => ['value_start' => ($token + 1)], - 1 => ['value_start' => ($token + 3)], - 2 => ['value_start' => ($token + 5)], - ]; - - $this->assertSame($expected, self::$sniff->indicies); - - }//end testSimpleValues() - - - /** - * Test an array of simple keys and values. - * - * @return void - */ - public function testSimpleKeyValues() - { - $token = $this->getTargetToken('/* testSimpleKeyValues */', T_OPEN_SHORT_ARRAY); - self::$sniff->process(self::$phpcsFile, $token); - - $expected = [ - 0 => [ - 'index_start' => ($token + 1), - 'index_end' => ($token + 1), - 'arrow' => ($token + 2), - 'value_start' => ($token + 3), - ], - 1 => [ - 'index_start' => ($token + 5), - 'index_end' => ($token + 5), - 'arrow' => ($token + 6), - 'value_start' => ($token + 7), - ], - 2 => [ - 'index_start' => ($token + 9), - 'index_end' => ($token + 9), - 'arrow' => ($token + 10), - 'value_start' => ($token + 11), - ], - ]; - - $this->assertSame($expected, self::$sniff->indicies); - - }//end testSimpleKeyValues() - - - /** - * Test an array of simple keys and values. - * - * @return void - */ - public function testMissingKeys() - { - $token = $this->getTargetToken('/* testMissingKeys */', T_OPEN_SHORT_ARRAY); - self::$sniff->process(self::$phpcsFile, $token); - - $expected = [ - 0 => [ - 'index_start' => ($token + 1), - 'index_end' => ($token + 1), - 'arrow' => ($token + 2), - 'value_start' => ($token + 3), - ], - 1 => [ - 'value_start' => ($token + 5), - ], - 2 => [ - 'index_start' => ($token + 7), - 'index_end' => ($token + 7), - 'arrow' => ($token + 8), - 'value_start' => ($token + 9), - ], - ]; - - $this->assertSame($expected, self::$sniff->indicies); - - }//end testMissingKeys() - - - /** - * Test an array with keys that span multiple tokens. - * - * @return void - */ - public function testMultiTokenKeys() - { - $token = $this->getTargetToken('/* testMultiTokenKeys */', T_ARRAY); - self::$sniff->process(self::$phpcsFile, $token); - - $expected = [ - 0 => [ - 'index_start' => ($token + 4), - 'index_end' => ($token + 8), - 'arrow' => ($token + 10), - 'value_start' => ($token + 12), - ], - 1 => [ - 'index_start' => ($token + 16), - 'index_end' => ($token + 20), - 'arrow' => ($token + 22), - 'value_start' => ($token + 24), - ], - ]; - - $this->assertSame($expected, self::$sniff->indicies); - - }//end testMultiTokenKeys() - - - /** - * Test an array of simple keys and values. - * - * @return void - */ - public function testMissingKeysCoalesceTernary() - { - $token = $this->getTargetToken('/* testMissingKeysCoalesceTernary */', T_OPEN_SHORT_ARRAY); - self::$sniff->process(self::$phpcsFile, $token); - - $expected = [ - 0 => [ - 'index_start' => ($token + 3), - 'index_end' => ($token + 3), - 'arrow' => ($token + 5), - 'value_start' => ($token + 7), - ], - 1 => [ - 'value_start' => ($token + 31), - ], - 2 => [ - 'value_start' => ($token + 39), - ], - ]; - - $this->assertSame($expected, self::$sniff->indicies); - - }//end testMissingKeysCoalesceTernary() - - - /** - * Test an array of ternary values. - * - * @return void - */ - public function testTernaryValues() - { - $token = $this->getTargetToken('/* testTernaryValues */', T_OPEN_SHORT_ARRAY); - self::$sniff->process(self::$phpcsFile, $token); - - $expected = [ - 0 => [ - 'index_start' => ($token + 3), - 'index_end' => ($token + 3), - 'arrow' => ($token + 5), - 'value_start' => ($token + 7), - ], - 1 => [ - 'index_start' => ($token + 32), - 'index_end' => ($token + 32), - 'arrow' => ($token + 34), - 'value_start' => ($token + 36), - ], - 2 => [ - 'index_start' => ($token + 72), - 'index_end' => ($token + 72), - 'arrow' => ($token + 74), - 'value_start' => ($token + 76), - ], - ]; - - $this->assertSame($expected, self::$sniff->indicies); - - }//end testTernaryValues() - - - /** - * Test an array of heredocs. - * - * @return void - */ - public function testHeredocValues() - { - $token = $this->getTargetToken('/* testHeredocValues */', T_ARRAY); - self::$sniff->process(self::$phpcsFile, $token); - - $expected = [ - 0 => [ - 'value_start' => ($token + 4), - ], - 1 => [ - 'value_start' => ($token + 10), - ], - ]; - - $this->assertSame($expected, self::$sniff->indicies); - - }//end testHeredocValues() - - - /** - * Test an array of with an arrow function as a value. - * - * @return void - */ - public function testArrowFunctionValue() - { - $token = $this->getTargetToken('/* testArrowFunctionValue */', T_ARRAY); - self::$sniff->process(self::$phpcsFile, $token); - - $expected = [ - 0 => [ - 'index_start' => ($token + 4), - 'index_end' => ($token + 4), - 'arrow' => ($token + 6), - 'value_start' => ($token + 8), - ], - 1 => [ - 'index_start' => ($token + 12), - 'index_end' => ($token + 12), - 'arrow' => ($token + 14), - 'value_start' => ($token + 16), - ], - 2 => [ - 'index_start' => ($token + 34), - 'index_end' => ($token + 34), - 'arrow' => ($token + 36), - 'value_start' => ($token + 38), - ], - ]; - - $this->assertSame($expected, self::$sniff->indicies); - - }//end testArrowFunctionValue() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Sniffs/AbstractArraySniffTestable.php b/vendor/squizlabs/php_codesniffer/tests/Core/Sniffs/AbstractArraySniffTestable.php deleted file mode 100644 index a224012..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Sniffs/AbstractArraySniffTestable.php +++ /dev/null @@ -1,65 +0,0 @@ - - * @copyright 2006-2020 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tests\Core\Sniffs; - -use PHP_CodeSniffer\Sniffs\AbstractArraySniff; - -class AbstractArraySniffTestable extends AbstractArraySniff -{ - - /** - * The array indicies that were found during processing. - * - * @var array - */ - public $indicies = []; - - - /** - * Processes a single-line array definition. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being checked. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * @param int $arrayStart The token that starts the array definition. - * @param int $arrayEnd The token that ends the array definition. - * @param array $indices An array of token positions for the array keys, - * double arrows, and values. - * - * @return void - */ - public function processSingleLineArray($phpcsFile, $stackPtr, $arrayStart, $arrayEnd, $indices) - { - $this->indicies = $indices; - - }//end processSingleLineArray() - - - /** - * Processes a multi-line array definition. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being checked. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * @param int $arrayStart The token that starts the array definition. - * @param int $arrayEnd The token that ends the array definition. - * @param array $indices An array of token positions for the array keys, - * double arrows, and values. - * - * @return void - */ - public function processMultiLineArray($phpcsFile, $stackPtr, $arrayStart, $arrayEnd, $indices) - { - $this->indicies = $indices; - - }//end processMultiLineArray() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/AnonClassParenthesisOwnerTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/AnonClassParenthesisOwnerTest.inc deleted file mode 100644 index 5867691..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/AnonClassParenthesisOwnerTest.inc +++ /dev/null @@ -1,19 +0,0 @@ - - * @copyright 2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tests\Core\Tokenizer; - -use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest; - -class AnonClassParenthesisOwnerTest extends AbstractMethodUnitTest -{ - - - /** - * Test that anonymous class tokens without parenthesis do not get assigned a parenthesis owner. - * - * @param string $testMarker The comment which prefaces the target token in the test file. - * - * @dataProvider dataAnonClassNoParentheses - * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional - * - * @return void - */ - public function testAnonClassNoParentheses($testMarker) - { - $tokens = self::$phpcsFile->getTokens(); - - $anonClass = $this->getTargetToken($testMarker, T_ANON_CLASS); - $this->assertFalse(array_key_exists('parenthesis_owner', $tokens[$anonClass])); - $this->assertFalse(array_key_exists('parenthesis_opener', $tokens[$anonClass])); - $this->assertFalse(array_key_exists('parenthesis_closer', $tokens[$anonClass])); - - }//end testAnonClassNoParentheses() - - - /** - * Test that the next open/close parenthesis after an anonymous class without parenthesis - * do not get assigned the anonymous class as a parenthesis owner. - * - * @param string $testMarker The comment which prefaces the target token in the test file. - * - * @dataProvider dataAnonClassNoParentheses - * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional - * - * @return void - */ - public function testAnonClassNoParenthesesNextOpenClose($testMarker) - { - $tokens = self::$phpcsFile->getTokens(); - $function = $this->getTargetToken($testMarker, T_FUNCTION); - - $opener = $this->getTargetToken($testMarker, T_OPEN_PARENTHESIS); - $this->assertTrue(array_key_exists('parenthesis_owner', $tokens[$opener])); - $this->assertSame($function, $tokens[$opener]['parenthesis_owner']); - - $closer = $this->getTargetToken($testMarker, T_CLOSE_PARENTHESIS); - $this->assertTrue(array_key_exists('parenthesis_owner', $tokens[$closer])); - $this->assertSame($function, $tokens[$closer]['parenthesis_owner']); - - }//end testAnonClassNoParenthesesNextOpenClose() - - - /** - * Data provider. - * - * @see testAnonClassNoParentheses() - * @see testAnonClassNoParenthesesNextOpenClose() - * - * @return array - */ - public function dataAnonClassNoParentheses() - { - return [ - ['/* testNoParentheses */'], - ['/* testNoParenthesesAndEmptyTokens */'], - ]; - - }//end dataAnonClassNoParentheses() - - - /** - * Test that anonymous class tokens with parenthesis get assigned a parenthesis owner, - * opener and closer; and that the opener/closer get the anonymous class assigned as owner. - * - * @param string $testMarker The comment which prefaces the target token in the test file. - * - * @dataProvider dataAnonClassWithParentheses - * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional - * - * @return void - */ - public function testAnonClassWithParentheses($testMarker) - { - $tokens = self::$phpcsFile->getTokens(); - $anonClass = $this->getTargetToken($testMarker, T_ANON_CLASS); - $opener = $this->getTargetToken($testMarker, T_OPEN_PARENTHESIS); - $closer = $this->getTargetToken($testMarker, T_CLOSE_PARENTHESIS); - - $this->assertTrue(array_key_exists('parenthesis_owner', $tokens[$anonClass])); - $this->assertTrue(array_key_exists('parenthesis_opener', $tokens[$anonClass])); - $this->assertTrue(array_key_exists('parenthesis_closer', $tokens[$anonClass])); - $this->assertSame($anonClass, $tokens[$anonClass]['parenthesis_owner']); - $this->assertSame($opener, $tokens[$anonClass]['parenthesis_opener']); - $this->assertSame($closer, $tokens[$anonClass]['parenthesis_closer']); - - $this->assertTrue(array_key_exists('parenthesis_owner', $tokens[$opener])); - $this->assertTrue(array_key_exists('parenthesis_opener', $tokens[$opener])); - $this->assertTrue(array_key_exists('parenthesis_closer', $tokens[$opener])); - $this->assertSame($anonClass, $tokens[$opener]['parenthesis_owner']); - $this->assertSame($opener, $tokens[$opener]['parenthesis_opener']); - $this->assertSame($closer, $tokens[$opener]['parenthesis_closer']); - - $this->assertTrue(array_key_exists('parenthesis_owner', $tokens[$closer])); - $this->assertTrue(array_key_exists('parenthesis_opener', $tokens[$closer])); - $this->assertTrue(array_key_exists('parenthesis_closer', $tokens[$closer])); - $this->assertSame($anonClass, $tokens[$closer]['parenthesis_owner']); - $this->assertSame($opener, $tokens[$closer]['parenthesis_opener']); - $this->assertSame($closer, $tokens[$closer]['parenthesis_closer']); - - }//end testAnonClassWithParentheses() - - - /** - * Data provider. - * - * @see testAnonClassWithParentheses() - * - * @return array - */ - public function dataAnonClassWithParentheses() - { - return [ - ['/* testWithParentheses */'], - ['/* testWithParenthesesAndEmptyTokens */'], - ]; - - }//end dataAnonClassWithParentheses() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ArrayKeywordTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ArrayKeywordTest.inc deleted file mode 100644 index ce5c553..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ArrayKeywordTest.inc +++ /dev/null @@ -1,35 +0,0 @@ - 10); - -/* testArrayWithComment */ -$var = Array /*comment*/ (1 => 10); - -/* testNestingArray */ -$var = array( - /* testNestedArray */ - array( - 'key' => 'value', - - /* testClosureReturnType */ - 'closure' => function($a) use($global) : Array {}, - ), -); - -/* testFunctionDeclarationParamType */ -function foo(array $a) {} - -/* testFunctionDeclarationReturnType */ -function foo($a) : int|array|null {} - -class Bar { - /* testClassConst */ - const ARRAY = []; - - /* testClassMethod */ - public function array() {} -} diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ArrayKeywordTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ArrayKeywordTest.php deleted file mode 100644 index 237258a..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ArrayKeywordTest.php +++ /dev/null @@ -1,170 +0,0 @@ - - * @copyright 2021 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tests\Core\Tokenizer; - -use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest; - -class ArrayKeywordTest extends AbstractMethodUnitTest -{ - - - /** - * Test that the array keyword is correctly tokenized as `T_ARRAY`. - * - * @param string $testMarker The comment prefacing the target token. - * @param string $testContent Optional. The token content to look for. - * - * @dataProvider dataArrayKeyword - * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize - * @covers PHP_CodeSniffer\Tokenizers\Tokenizer::createTokenMap - * - * @return void - */ - public function testArrayKeyword($testMarker, $testContent='array') - { - $tokens = self::$phpcsFile->getTokens(); - - $token = $this->getTargetToken($testMarker, [T_ARRAY, T_STRING], $testContent); - $tokenArray = $tokens[$token]; - - $this->assertSame(T_ARRAY, $tokenArray['code'], 'Token tokenized as '.$tokenArray['type'].', not T_ARRAY (code)'); - $this->assertSame('T_ARRAY', $tokenArray['type'], 'Token tokenized as '.$tokenArray['type'].', not T_ARRAY (type)'); - - $this->assertArrayHasKey('parenthesis_owner', $tokenArray, 'Parenthesis owner is not set'); - $this->assertArrayHasKey('parenthesis_opener', $tokenArray, 'Parenthesis opener is not set'); - $this->assertArrayHasKey('parenthesis_closer', $tokenArray, 'Parenthesis closer is not set'); - - }//end testArrayKeyword() - - - /** - * Data provider. - * - * @see testArrayKeyword() - * - * @return array - */ - public function dataArrayKeyword() - { - return [ - 'empty array' => ['/* testEmptyArray */'], - 'array with space before parenthesis' => ['/* testArrayWithSpace */'], - 'array with comment before parenthesis' => [ - '/* testArrayWithComment */', - 'Array', - ], - 'nested: outer array' => ['/* testNestingArray */'], - 'nested: inner array' => ['/* testNestedArray */'], - ]; - - }//end dataArrayKeyword() - - - /** - * Test that the array keyword when used in a type declaration is correctly tokenized as `T_STRING`. - * - * @param string $testMarker The comment prefacing the target token. - * @param string $testContent Optional. The token content to look for. - * - * @dataProvider dataArrayType - * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize - * @covers PHP_CodeSniffer\Tokenizers\Tokenizer::createTokenMap - * - * @return void - */ - public function testArrayType($testMarker, $testContent='array') - { - $tokens = self::$phpcsFile->getTokens(); - - $token = $this->getTargetToken($testMarker, [T_ARRAY, T_STRING], $testContent); - $tokenArray = $tokens[$token]; - - $this->assertSame(T_STRING, $tokenArray['code'], 'Token tokenized as '.$tokenArray['type'].', not T_STRING (code)'); - $this->assertSame('T_STRING', $tokenArray['type'], 'Token tokenized as '.$tokenArray['type'].', not T_STRING (type)'); - - $this->assertArrayNotHasKey('parenthesis_owner', $tokenArray, 'Parenthesis owner is set'); - $this->assertArrayNotHasKey('parenthesis_opener', $tokenArray, 'Parenthesis opener is set'); - $this->assertArrayNotHasKey('parenthesis_closer', $tokenArray, 'Parenthesis closer is set'); - - }//end testArrayType() - - - /** - * Data provider. - * - * @see testArrayType() - * - * @return array - */ - public function dataArrayType() - { - return [ - 'closure return type' => [ - '/* testClosureReturnType */', - 'Array', - ], - 'function param type' => ['/* testFunctionDeclarationParamType */'], - 'function union return type' => ['/* testFunctionDeclarationReturnType */'], - ]; - - }//end dataArrayType() - - - /** - * Verify that the retokenization of `T_ARRAY` tokens to `T_STRING` is handled correctly - * for tokens with the contents 'array' which aren't in actual fact the array keyword. - * - * @param string $testMarker The comment prefacing the target token. - * @param string $testContent The token content to look for. - * - * @dataProvider dataNotArrayKeyword - * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize - * @covers PHP_CodeSniffer\Tokenizers\Tokenizer::createTokenMap - * - * @return void - */ - public function testNotArrayKeyword($testMarker, $testContent='array') - { - $tokens = self::$phpcsFile->getTokens(); - - $token = $this->getTargetToken($testMarker, [T_ARRAY, T_STRING], $testContent); - $tokenArray = $tokens[$token]; - - $this->assertSame(T_STRING, $tokenArray['code'], 'Token tokenized as '.$tokenArray['type'].', not T_STRING (code)'); - $this->assertSame('T_STRING', $tokenArray['type'], 'Token tokenized as '.$tokenArray['type'].', not T_STRING (type)'); - - $this->assertArrayNotHasKey('parenthesis_owner', $tokenArray, 'Parenthesis owner is set'); - $this->assertArrayNotHasKey('parenthesis_opener', $tokenArray, 'Parenthesis opener is set'); - $this->assertArrayNotHasKey('parenthesis_closer', $tokenArray, 'Parenthesis closer is set'); - - }//end testNotArrayKeyword() - - - /** - * Data provider. - * - * @see testNotArrayKeyword() - * - * @return array - */ - public function dataNotArrayKeyword() - { - return [ - 'class-constant-name' => [ - '/* testClassConst */', - 'ARRAY', - ], - 'class-method-name' => ['/* testClassMethod */'], - ]; - - }//end dataNotArrayKeyword() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/AttributesTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/AttributesTest.inc deleted file mode 100644 index e539adf..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/AttributesTest.inc +++ /dev/null @@ -1,90 +0,0 @@ - 'foobar'])] -function attribute_with_params_on_function_test() {} - -/* testAttributeWithShortClosureParameter */ -#[AttributeWithParams(static fn ($value) => ! $value)] -function attribute_with_short_closure_param_test() {} - -/* testTwoAttributeOnTheSameLine */ -#[CustomAttribute] #[AttributeWithParams('foo')] -function two_attribute_on_same_line_test() {} - -/* testAttributeAndCommentOnTheSameLine */ -#[CustomAttribute] // This is a comment -function attribute_and_line_comment_on_same_line_test() {} - -/* testAttributeGrouping */ -#[CustomAttribute, AttributeWithParams('foo'), AttributeWithParams('foo', bar: ['bar' => 'foobar'])] -function attribute_grouping_test() {} - -/* testAttributeMultiline */ -#[ - CustomAttribute, - AttributeWithParams('foo'), - AttributeWithParams('foo', bar: ['bar' => 'foobar']) -] -function attribute_multiline_test() {} - -/* testAttributeMultilineWithComment */ -#[ - CustomAttribute, // comment - AttributeWithParams(/* another comment */ 'foo'), - AttributeWithParams('foo', bar: ['bar' => 'foobar']) -] -function attribute_multiline_with_comment_test() {} - -/* testSingleAttributeOnParameter */ -function single_attribute_on_parameter_test(#[ParamAttribute] int $param) {} - -/* testMultipleAttributesOnParameter */ -function multiple_attributes_on_parameter_test(#[ParamAttribute, AttributeWithParams(/* another comment */ 'foo')] int $param) {} - -/* testFqcnAttribute */ -#[Boo\QualifiedName, \Foo\FullyQualifiedName('foo')] -function fqcn_attrebute_test() {} - -/* testNestedAttributes */ -#[Boo\QualifiedName(fn (#[AttributeOne('boo')] $value) => (string) $value)] -function nested_attributes_test() {} - -/* testMultilineAttributesOnParameter */ -function multiline_attributes_on_parameter_test(#[ - AttributeWithParams( - 'foo' - ) - ] int $param) {} - -/* testAttributeContainingTextLookingLikeCloseTag */ -#[DeprecationReason('reason: ')] -function attribute_containing_text_looking_like_close_tag() {} - -/* testAttributeContainingMultilineTextLookingLikeCloseTag */ -#[DeprecationReason( - 'reason: ' -)] -function attribute_containing_mulitline_text_looking_like_close_tag() {} - -/* testInvalidAttribute */ -#[ThisIsNotAnAttribute -function invalid_attribute_test() {} diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/AttributesTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/AttributesTest.php deleted file mode 100644 index b10a1ef..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/AttributesTest.php +++ /dev/null @@ -1,659 +0,0 @@ - - * @copyright 2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tests\Core\Tokenizer; - -use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest; -use PHP_CodeSniffer\Util\Tokens; - -class AttributesTest extends AbstractMethodUnitTest -{ - - - /** - * Test that attributes are parsed correctly. - * - * @param string $testMarker The comment which prefaces the target token in the test file. - * @param int $length The number of tokens between opener and closer. - * @param array $tokenCodes The codes of tokens inside the attributes. - * - * @dataProvider dataAttribute - * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize - * @covers PHP_CodeSniffer\Tokenizers\PHP::findCloser - * @covers PHP_CodeSniffer\Tokenizers\PHP::parsePhpAttribute - * - * @return void - */ - public function testAttribute($testMarker, $length, $tokenCodes) - { - $tokens = self::$phpcsFile->getTokens(); - - $attribute = $this->getTargetToken($testMarker, T_ATTRIBUTE); - $this->assertArrayHasKey('attribute_closer', $tokens[$attribute]); - - $closer = $tokens[$attribute]['attribute_closer']; - $this->assertSame(($attribute + $length), $closer); - - $this->assertSame(T_ATTRIBUTE_END, $tokens[$closer]['code']); - - $this->assertSame($tokens[$attribute]['attribute_opener'], $tokens[$closer]['attribute_opener']); - $this->assertSame($tokens[$attribute]['attribute_closer'], $tokens[$closer]['attribute_closer']); - - $map = array_map( - function ($token) use ($attribute, $length) { - $this->assertArrayHasKey('attribute_closer', $token); - $this->assertSame(($attribute + $length), $token['attribute_closer']); - - return $token['code']; - }, - array_slice($tokens, ($attribute + 1), ($length - 1)) - ); - - $this->assertSame($tokenCodes, $map); - - }//end testAttribute() - - - /** - * Data provider. - * - * @see testAttribute() - * - * @return array - */ - public function dataAttribute() - { - return [ - [ - '/* testAttribute */', - 2, - [ T_STRING ], - ], - [ - '/* testAttributeWithParams */', - 7, - [ - T_STRING, - T_OPEN_PARENTHESIS, - T_STRING, - T_DOUBLE_COLON, - T_STRING, - T_CLOSE_PARENTHESIS, - ], - ], - [ - '/* testAttributeWithNamedParam */', - 10, - [ - T_STRING, - T_OPEN_PARENTHESIS, - T_PARAM_NAME, - T_COLON, - T_WHITESPACE, - T_STRING, - T_DOUBLE_COLON, - T_STRING, - T_CLOSE_PARENTHESIS, - ], - ], - [ - '/* testAttributeOnFunction */', - 2, - [ T_STRING ], - ], - [ - '/* testAttributeOnFunctionWithParams */', - 17, - [ - T_STRING, - T_OPEN_PARENTHESIS, - T_CONSTANT_ENCAPSED_STRING, - T_COMMA, - T_WHITESPACE, - T_PARAM_NAME, - T_COLON, - T_WHITESPACE, - T_OPEN_SHORT_ARRAY, - T_CONSTANT_ENCAPSED_STRING, - T_WHITESPACE, - T_DOUBLE_ARROW, - T_WHITESPACE, - T_CONSTANT_ENCAPSED_STRING, - T_CLOSE_SHORT_ARRAY, - T_CLOSE_PARENTHESIS, - ], - ], - [ - '/* testAttributeWithShortClosureParameter */', - 17, - [ - T_STRING, - T_OPEN_PARENTHESIS, - T_STATIC, - T_WHITESPACE, - T_FN, - T_WHITESPACE, - T_OPEN_PARENTHESIS, - T_VARIABLE, - T_CLOSE_PARENTHESIS, - T_WHITESPACE, - T_FN_ARROW, - T_WHITESPACE, - T_BOOLEAN_NOT, - T_WHITESPACE, - T_VARIABLE, - T_CLOSE_PARENTHESIS, - ], - ], - [ - '/* testAttributeGrouping */', - 26, - [ - T_STRING, - T_COMMA, - T_WHITESPACE, - T_STRING, - T_OPEN_PARENTHESIS, - T_CONSTANT_ENCAPSED_STRING, - T_CLOSE_PARENTHESIS, - T_COMMA, - T_WHITESPACE, - T_STRING, - T_OPEN_PARENTHESIS, - T_CONSTANT_ENCAPSED_STRING, - T_COMMA, - T_WHITESPACE, - T_PARAM_NAME, - T_COLON, - T_WHITESPACE, - T_OPEN_SHORT_ARRAY, - T_CONSTANT_ENCAPSED_STRING, - T_WHITESPACE, - T_DOUBLE_ARROW, - T_WHITESPACE, - T_CONSTANT_ENCAPSED_STRING, - T_CLOSE_SHORT_ARRAY, - T_CLOSE_PARENTHESIS, - ], - ], - [ - '/* testAttributeMultiline */', - 31, - [ - T_WHITESPACE, - T_WHITESPACE, - T_STRING, - T_COMMA, - T_WHITESPACE, - T_WHITESPACE, - T_STRING, - T_OPEN_PARENTHESIS, - T_CONSTANT_ENCAPSED_STRING, - T_CLOSE_PARENTHESIS, - T_COMMA, - T_WHITESPACE, - T_WHITESPACE, - T_STRING, - T_OPEN_PARENTHESIS, - T_CONSTANT_ENCAPSED_STRING, - T_COMMA, - T_WHITESPACE, - T_PARAM_NAME, - T_COLON, - T_WHITESPACE, - T_OPEN_SHORT_ARRAY, - T_CONSTANT_ENCAPSED_STRING, - T_WHITESPACE, - T_DOUBLE_ARROW, - T_WHITESPACE, - T_CONSTANT_ENCAPSED_STRING, - T_CLOSE_SHORT_ARRAY, - T_CLOSE_PARENTHESIS, - T_WHITESPACE, - ], - ], - [ - '/* testFqcnAttribute */', - 13, - [ - T_STRING, - T_NS_SEPARATOR, - T_STRING, - T_COMMA, - T_WHITESPACE, - T_NS_SEPARATOR, - T_STRING, - T_NS_SEPARATOR, - T_STRING, - T_OPEN_PARENTHESIS, - T_CONSTANT_ENCAPSED_STRING, - T_CLOSE_PARENTHESIS, - ], - ], - ]; - - }//end dataAttribute() - - - /** - * Test that multiple attributes on the same line are parsed correctly. - * - * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize - * @covers PHP_CodeSniffer\Tokenizers\PHP::findCloser - * @covers PHP_CodeSniffer\Tokenizers\PHP::parsePhpAttribute - * - * @return void - */ - public function testTwoAttributesOnTheSameLine() - { - $tokens = self::$phpcsFile->getTokens(); - - $attribute = $this->getTargetToken('/* testTwoAttributeOnTheSameLine */', T_ATTRIBUTE); - $this->assertArrayHasKey('attribute_closer', $tokens[$attribute]); - - $closer = $tokens[$attribute]['attribute_closer']; - $this->assertSame(T_WHITESPACE, $tokens[($closer + 1)]['code']); - $this->assertSame(T_ATTRIBUTE, $tokens[($closer + 2)]['code']); - $this->assertArrayHasKey('attribute_closer', $tokens[($closer + 2)]); - - }//end testTwoAttributesOnTheSameLine() - - - /** - * Test that attribute followed by a line comment is parsed correctly. - * - * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize - * @covers PHP_CodeSniffer\Tokenizers\PHP::findCloser - * @covers PHP_CodeSniffer\Tokenizers\PHP::parsePhpAttribute - * - * @return void - */ - public function testAttributeAndLineComment() - { - $tokens = self::$phpcsFile->getTokens(); - - $attribute = $this->getTargetToken('/* testAttributeAndCommentOnTheSameLine */', T_ATTRIBUTE); - $this->assertArrayHasKey('attribute_closer', $tokens[$attribute]); - - $closer = $tokens[$attribute]['attribute_closer']; - $this->assertSame(T_WHITESPACE, $tokens[($closer + 1)]['code']); - $this->assertSame(T_COMMENT, $tokens[($closer + 2)]['code']); - - }//end testAttributeAndLineComment() - - - /** - * Test that attribute followed by a line comment is parsed correctly. - * - * @param string $testMarker The comment which prefaces the target token in the test file. - * @param int $position The token position (starting from T_FUNCTION) of T_ATTRIBUTE token. - * @param int $length The number of tokens between opener and closer. - * @param array $tokenCodes The codes of tokens inside the attributes. - * - * @dataProvider dataAttributeOnParameters - * - * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize - * @covers PHP_CodeSniffer\Tokenizers\PHP::findCloser - * @covers PHP_CodeSniffer\Tokenizers\PHP::parsePhpAttribute - * - * @return void - */ - public function testAttributeOnParameters($testMarker, $position, $length, array $tokenCodes) - { - $tokens = self::$phpcsFile->getTokens(); - - $function = $this->getTargetToken($testMarker, T_FUNCTION); - $attribute = ($function + $position); - - $this->assertSame(T_ATTRIBUTE, $tokens[$attribute]['code']); - $this->assertArrayHasKey('attribute_closer', $tokens[$attribute]); - - $this->assertSame(($attribute + $length), $tokens[$attribute]['attribute_closer']); - - $closer = $tokens[$attribute]['attribute_closer']; - $this->assertSame(T_WHITESPACE, $tokens[($closer + 1)]['code']); - $this->assertSame(T_STRING, $tokens[($closer + 2)]['code']); - $this->assertSame('int', $tokens[($closer + 2)]['content']); - - $this->assertSame(T_VARIABLE, $tokens[($closer + 4)]['code']); - $this->assertSame('$param', $tokens[($closer + 4)]['content']); - - $map = array_map( - function ($token) use ($attribute, $length) { - $this->assertArrayHasKey('attribute_closer', $token); - $this->assertSame(($attribute + $length), $token['attribute_closer']); - - return $token['code']; - }, - array_slice($tokens, ($attribute + 1), ($length - 1)) - ); - - $this->assertSame($tokenCodes, $map); - - }//end testAttributeOnParameters() - - - /** - * Data provider. - * - * @see testAttributeOnParameters() - * - * @return array - */ - public function dataAttributeOnParameters() - { - return [ - [ - '/* testSingleAttributeOnParameter */', - 4, - 2, - [T_STRING], - ], - [ - '/* testMultipleAttributesOnParameter */', - 4, - 10, - [ - T_STRING, - T_COMMA, - T_WHITESPACE, - T_STRING, - T_OPEN_PARENTHESIS, - T_COMMENT, - T_WHITESPACE, - T_CONSTANT_ENCAPSED_STRING, - T_CLOSE_PARENTHESIS, - ], - ], - [ - '/* testMultilineAttributesOnParameter */', - 4, - 13, - [ - T_WHITESPACE, - T_WHITESPACE, - T_STRING, - T_OPEN_PARENTHESIS, - T_WHITESPACE, - T_WHITESPACE, - T_CONSTANT_ENCAPSED_STRING, - T_WHITESPACE, - T_WHITESPACE, - T_CLOSE_PARENTHESIS, - T_WHITESPACE, - T_WHITESPACE, - ], - ], - ]; - - }//end dataAttributeOnParameters() - - - /** - * Test that an attribute containing text which looks like a PHP close tag is tokenized correctly. - * - * @param string $testMarker The comment which prefaces the target token in the test file. - * @param int $length The number of tokens between opener and closer. - * @param array $expectedTokensAttribute The codes of tokens inside the attributes. - * @param array $expectedTokensAfter The codes of tokens after the attributes. - * - * @covers PHP_CodeSniffer\Tokenizers\PHP::parsePhpAttribute - * - * @dataProvider dataAttributeOnTextLookingLikeCloseTag - * - * @return void - */ - public function testAttributeContainingTextLookingLikeCloseTag($testMarker, $length, array $expectedTokensAttribute, array $expectedTokensAfter) - { - $tokens = self::$phpcsFile->getTokens(); - - $attribute = $this->getTargetToken($testMarker, T_ATTRIBUTE); - - $this->assertSame('T_ATTRIBUTE', $tokens[$attribute]['type']); - $this->assertArrayHasKey('attribute_closer', $tokens[$attribute]); - - $closer = $tokens[$attribute]['attribute_closer']; - $this->assertSame(($attribute + $length), $closer); - $this->assertSame(T_ATTRIBUTE_END, $tokens[$closer]['code']); - $this->assertSame('T_ATTRIBUTE_END', $tokens[$closer]['type']); - - $this->assertSame($tokens[$attribute]['attribute_opener'], $tokens[$closer]['attribute_opener']); - $this->assertSame($tokens[$attribute]['attribute_closer'], $tokens[$closer]['attribute_closer']); - - $i = ($attribute + 1); - foreach ($expectedTokensAttribute as $item) { - list($expectedType, $expectedContents) = $item; - $this->assertSame($expectedType, $tokens[$i]['type']); - $this->assertSame($expectedContents, $tokens[$i]['content']); - $this->assertArrayHasKey('attribute_opener', $tokens[$i]); - $this->assertArrayHasKey('attribute_closer', $tokens[$i]); - ++$i; - } - - $i = ($closer + 1); - foreach ($expectedTokensAfter as $expectedCode) { - $this->assertSame($expectedCode, $tokens[$i]['code']); - ++$i; - } - - }//end testAttributeContainingTextLookingLikeCloseTag() - - - /** - * Data provider. - * - * @see dataAttributeOnTextLookingLikeCloseTag() - * - * @return array - */ - public function dataAttributeOnTextLookingLikeCloseTag() - { - return [ - [ - '/* testAttributeContainingTextLookingLikeCloseTag */', - 5, - [ - [ - 'T_STRING', - 'DeprecationReason', - ], - [ - 'T_OPEN_PARENTHESIS', - '(', - ], - [ - 'T_CONSTANT_ENCAPSED_STRING', - "'reason: '", - ], - [ - 'T_CLOSE_PARENTHESIS', - ')', - ], - [ - 'T_ATTRIBUTE_END', - ']', - ], - ], - [ - T_WHITESPACE, - T_FUNCTION, - T_WHITESPACE, - T_STRING, - T_OPEN_PARENTHESIS, - T_CLOSE_PARENTHESIS, - T_WHITESPACE, - T_OPEN_CURLY_BRACKET, - T_CLOSE_CURLY_BRACKET, - ], - ], - [ - '/* testAttributeContainingMultilineTextLookingLikeCloseTag */', - 8, - [ - [ - 'T_STRING', - 'DeprecationReason', - ], - [ - 'T_OPEN_PARENTHESIS', - '(', - ], - [ - 'T_WHITESPACE', - "\n", - ], - [ - 'T_WHITESPACE', - " ", - ], - [ - 'T_CONSTANT_ENCAPSED_STRING', - "'reason: '", - ], - [ - 'T_WHITESPACE', - "\n", - ], - [ - 'T_CLOSE_PARENTHESIS', - ')', - ], - [ - 'T_ATTRIBUTE_END', - ']', - ], - ], - [ - T_WHITESPACE, - T_FUNCTION, - T_WHITESPACE, - T_STRING, - T_OPEN_PARENTHESIS, - T_CLOSE_PARENTHESIS, - T_WHITESPACE, - T_OPEN_CURLY_BRACKET, - T_CLOSE_CURLY_BRACKET, - ], - ], - ]; - - }//end dataAttributeOnTextLookingLikeCloseTag() - - - /** - * Test that invalid attribute (or comment starting with #[ and without ]) are parsed correctly. - * - * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize - * @covers PHP_CodeSniffer\Tokenizers\PHP::findCloser - * @covers PHP_CodeSniffer\Tokenizers\PHP::parsePhpAttribute - * - * @return void - */ - public function testInvalidAttribute() - { - $tokens = self::$phpcsFile->getTokens(); - - $attribute = $this->getTargetToken('/* testInvalidAttribute */', T_ATTRIBUTE); - - $this->assertArrayHasKey('attribute_closer', $tokens[$attribute]); - $this->assertNull($tokens[$attribute]['attribute_closer']); - - }//end testInvalidAttribute() - - - /** - * Test that nested attributes are parsed correctly. - * - * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize - * @covers PHP_CodeSniffer\Tokenizers\PHP::findCloser - * @covers PHP_CodeSniffer\Tokenizers\PHP::parsePhpAttribute - * - * @return void - */ - public function testNestedAttributes() - { - $tokens = self::$phpcsFile->getTokens(); - $tokenCodes = [ - T_STRING, - T_NS_SEPARATOR, - T_STRING, - T_OPEN_PARENTHESIS, - T_FN, - T_WHITESPACE, - T_OPEN_PARENTHESIS, - T_ATTRIBUTE, - T_STRING, - T_OPEN_PARENTHESIS, - T_CONSTANT_ENCAPSED_STRING, - T_CLOSE_PARENTHESIS, - T_ATTRIBUTE_END, - T_WHITESPACE, - T_VARIABLE, - T_CLOSE_PARENTHESIS, - T_WHITESPACE, - T_FN_ARROW, - T_WHITESPACE, - T_STRING_CAST, - T_WHITESPACE, - T_VARIABLE, - T_CLOSE_PARENTHESIS, - ]; - - $attribute = $this->getTargetToken('/* testNestedAttributes */', T_ATTRIBUTE); - $this->assertArrayHasKey('attribute_closer', $tokens[$attribute]); - - $closer = $tokens[$attribute]['attribute_closer']; - $this->assertSame(($attribute + 24), $closer); - - $this->assertSame(T_ATTRIBUTE_END, $tokens[$closer]['code']); - - $this->assertSame($tokens[$attribute]['attribute_opener'], $tokens[$closer]['attribute_opener']); - $this->assertSame($tokens[$attribute]['attribute_closer'], $tokens[$closer]['attribute_closer']); - - $this->assertArrayNotHasKey('nested_attributes', $tokens[$attribute]); - $this->assertArrayHasKey('nested_attributes', $tokens[($attribute + 8)]); - $this->assertSame([$attribute => ($attribute + 24)], $tokens[($attribute + 8)]['nested_attributes']); - - $test = function (array $tokens, $length, $nestedMap) use ($attribute) { - foreach ($tokens as $token) { - $this->assertArrayHasKey('attribute_closer', $token); - $this->assertSame(($attribute + $length), $token['attribute_closer']); - $this->assertSame($nestedMap, $token['nested_attributes']); - } - }; - - $test(array_slice($tokens, ($attribute + 1), 7), 24, [$attribute => $attribute + 24]); - $test(array_slice($tokens, ($attribute + 8), 1), 8 + 5, [$attribute => $attribute + 24]); - - // Length here is 8 (nested attribute offset) + 5 (real length). - $test( - array_slice($tokens, ($attribute + 9), 4), - 8 + 5, - [ - $attribute => $attribute + 24, - $attribute + 8 => $attribute + 13, - ] - ); - - $test(array_slice($tokens, ($attribute + 13), 1), 8 + 5, [$attribute => $attribute + 24]); - $test(array_slice($tokens, ($attribute + 14), 10), 24, [$attribute => $attribute + 24]); - - $map = array_map( - static function ($token) { - return $token['code']; - }, - array_slice($tokens, ($attribute + 1), 23) - ); - - $this->assertSame($tokenCodes, $map); - - }//end testNestedAttributes() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillFnTokenTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillFnTokenTest.inc deleted file mode 100644 index 13f165b..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillFnTokenTest.inc +++ /dev/null @@ -1,198 +0,0 @@ - $x + $y; - -/* testMixedCase */ -$fn1 = Fn($x) => $x + $y; - -/* testWhitespace */ -$fn1 = fn ($x) => $x + $y; - -/* testComment */ -$fn1 = fn /* comment here */ ($x) => $x + $y; - -/* testHeredoc */ -$fn1 = fn() => << /* testNestedInner */ fn($y) => $x * $y + $z; - -/* testNestedSharedCloserOuter */ -$foo = foo(fn() => /* testNestedSharedCloserInner */ fn() => bar() === true); - -/* testFunctionCall */ -$extended = fn($c) => $callable($factory($c), $c); - -/* testChainedFunctionCall */ -$result = Collection::from([1, 2]) - ->map(fn($v) => $v * 2) - ->reduce(/* testFunctionArgument */ fn($tmp, $v) => $tmp + $v, 0); - -/* testClosure */ -$extended = fn($c) => $callable(function() { - for ($x = 1; $x < 10; $x++) { - echo $x; - } - - echo 'done'; -}, $c); - -/* testArrayIndex */ -$found = in_array_cb($needle, $haystack, fn($array, $needle) => $array[2] === $needle); - -$result = array_map( - /* testReturnType */ - static fn(int $number) : int => $number + 1, - $numbers -); - -/* testReference */ -fn&($x) => $x; - -/* testGrouped */ -(fn($x) => $x) + $y; - -/* testArrayValue */ -$a = [ - 'a' => fn() => return 1, -]; - -/* testArrayValueNoTrailingComma */ -$a = [ - 'a' => fn() => foo() -]; - -/* testYield */ -$a = fn($x) => yield 'k' => $x; - -/* testNullableNamespace */ -$a = fn(?\DateTime $x) : ?\DateTime => $x; - -/* testNamespaceOperatorInTypes */ -$fn = fn(namespace\Foo $a) : ?namespace\Foo => $a; - -/* testSelfReturnType */ -fn(self $a) : self => $a; - -/* testParentReturnType */ -fn(parent $a) : parent => $a; - -/* testCallableReturnType */ -fn(callable $a) : callable => $a; - -/* testArrayReturnType */ -fn(array $a) : array => $a; - -/* testStaticReturnType */ -fn(array $a) : static => $a; - -/* testUnionParamType */ -$arrowWithUnionParam = fn(int|float $param) : SomeClass => new SomeClass($param); - -/* testUnionReturnType */ -$arrowWithUnionReturn = fn($param) : int|float => $param | 10; - -/* testTernary */ -$fn = fn($a) => $a ? /* testTernaryThen */ fn() : string => 'a' : /* testTernaryElse */ fn() : string => 'b'; - -/* testTernaryWithTypes */ -$fn = fn(int|null $a) : array|null => $a ? null : []; - -function matchInArrow($x) { - /* testWithMatchValue */ - $fn = fn($x) => match(true) { - 1, 2, 3, 4, 5 => 'foo', - default => 'bar', - }; -} - -function matchInArrowAndMore($x) { - /* testWithMatchValueAndMore */ - $fn = fn($x) => match(true) { - 1, 2, 3, 4, 5 => 'foo', - default => 'bar', - } . 'suffix'; -} - -function arrowFunctionInMatchWithTrailingComma($x) { - return match ($x) { - /* testInMatchNotLastValue */ - 1 => fn($y) => callMe($y), - /* testInMatchLastValueWithTrailingComma */ - default => fn($y) => callThem($y), - }; -} - -function arrowFunctionInMatchNoTrailingComma1($x) { - return match ($x) { - 1 => fn($y) => callMe($y), - /* testInMatchLastValueNoTrailingComma1 */ - default => fn($y) => callThem($y) - }; -} - -function arrowFunctionInMatchNoTrailingComma2($x) { - return match ($x) { - /* testInMatchLastValueNoTrailingComma2 */ - default => fn($y) => 5 * $y - }; -} - -/* testConstantDeclaration */ -const FN = 'a'; - -/* testConstantDeclarationLower */ -const fn = 'a'; - -class Foo { - /* testStaticMethodName */ - public static function fn($param) { - /* testNestedInMethod */ - $fn = fn($c) => $callable($factory($c), $c); - } - - public function foo() { - /* testPropertyAssignment */ - $this->fn = 'a'; - } -} - -$anon = new class() { - /* testAnonClassMethodName */ - protected function fN($param) { - } -} - -/* testNonArrowStaticMethodCall */ -$a = Foo::fn($param); - -/* testNonArrowConstantAccess */ -$a = MyClass::FN; - -/* testNonArrowConstantAccessMixed */ -$a = MyClass::Fn; - -/* testNonArrowObjectMethodCall */ -$a = $obj->fn($param); - -/* testNonArrowObjectMethodCallUpper */ -$a = $obj->FN($param); - -/* testNonArrowNamespacedFunctionCall */ -$a = MyNS\Sub\Fn($param); - -/* testNonArrowNamespaceOperatorFunctionCall */ -$a = namespace\fn($param); - -/* testNonArrowFunctionNameWithUnionTypes */ -function fn(int|float $param) : string|null {} - -/* testLiveCoding */ -// Intentional parse error. This has to be the last test in the file. -$fn = fn diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillFnTokenTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillFnTokenTest.php deleted file mode 100644 index 4d0f4c0..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillFnTokenTest.php +++ /dev/null @@ -1,802 +0,0 @@ - - * @copyright 2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tests\Core\Tokenizer; - -use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest; - -class BackfillFnTokenTest extends AbstractMethodUnitTest -{ - - - /** - * Test simple arrow functions. - * - * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional - * - * @return void - */ - public function testSimple() - { - foreach (['/* testStandard */', '/* testMixedCase */'] as $comment) { - $token = $this->getTargetToken($comment, T_FN); - $this->backfillHelper($token); - $this->scopePositionTestHelper($token, 5, 12); - } - - }//end testSimple() - - - /** - * Test whitespace inside arrow function definitions. - * - * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional - * - * @return void - */ - public function testWhitespace() - { - $token = $this->getTargetToken('/* testWhitespace */', T_FN); - $this->backfillHelper($token); - $this->scopePositionTestHelper($token, 6, 13); - - }//end testWhitespace() - - - /** - * Test comments inside arrow function definitions. - * - * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional - * - * @return void - */ - public function testComment() - { - $token = $this->getTargetToken('/* testComment */', T_FN); - $this->backfillHelper($token); - $this->scopePositionTestHelper($token, 8, 15); - - }//end testComment() - - - /** - * Test heredocs inside arrow function definitions. - * - * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional - * - * @return void - */ - public function testHeredoc() - { - $token = $this->getTargetToken('/* testHeredoc */', T_FN); - $this->backfillHelper($token); - $this->scopePositionTestHelper($token, 4, 9); - - }//end testHeredoc() - - - /** - * Test nested arrow functions. - * - * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional - * - * @return void - */ - public function testNestedOuter() - { - $token = $this->getTargetToken('/* testNestedOuter */', T_FN); - $this->backfillHelper($token); - $this->scopePositionTestHelper($token, 5, 25); - - }//end testNestedOuter() - - - /** - * Test nested arrow functions. - * - * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional - * - * @return void - */ - public function testNestedInner() - { - $tokens = self::$phpcsFile->getTokens(); - - $token = $this->getTargetToken('/* testNestedInner */', T_FN); - $this->backfillHelper($token, true); - - $expectedScopeOpener = ($token + 5); - $expectedScopeCloser = ($token + 16); - - $this->assertSame($expectedScopeOpener, $tokens[$token]['scope_opener'], 'Scope opener is not the arrow token'); - $this->assertSame($expectedScopeCloser, $tokens[$token]['scope_closer'], 'Scope closer is not the semicolon token'); - - $opener = $tokens[$token]['scope_opener']; - $this->assertSame($expectedScopeOpener, $tokens[$opener]['scope_opener'], 'Opener scope opener is not the arrow token'); - $this->assertSame($expectedScopeCloser, $tokens[$opener]['scope_closer'], 'Opener scope closer is not the semicolon token'); - - $closer = $tokens[$token]['scope_closer']; - $this->assertSame(($token - 4), $tokens[$closer]['scope_opener'], 'Closer scope opener is not the arrow token of the "outer" arrow function (shared scope closer)'); - $this->assertSame($expectedScopeCloser, $tokens[$closer]['scope_closer'], 'Closer scope closer is not the semicolon token'); - - }//end testNestedInner() - - - /** - * Test nested arrow functions with a shared closer. - * - * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional - * - * @return void - */ - public function testNestedSharedCloser() - { - $tokens = self::$phpcsFile->getTokens(); - - $token = $this->getTargetToken('/* testNestedSharedCloserOuter */', T_FN); - $this->backfillHelper($token); - $this->scopePositionTestHelper($token, 4, 20); - - $token = $this->getTargetToken('/* testNestedSharedCloserInner */', T_FN); - $this->backfillHelper($token, true); - - $expectedScopeOpener = ($token + 4); - $expectedScopeCloser = ($token + 12); - - $this->assertSame($expectedScopeOpener, $tokens[$token]['scope_opener'], 'Scope opener for "inner" arrow function is not the arrow token'); - $this->assertSame($expectedScopeCloser, $tokens[$token]['scope_closer'], 'Scope closer for "inner" arrow function is not the TRUE token'); - - $opener = $tokens[$token]['scope_opener']; - $this->assertSame($expectedScopeOpener, $tokens[$opener]['scope_opener'], 'Opener scope opener for "inner" arrow function is not the arrow token'); - $this->assertSame($expectedScopeCloser, $tokens[$opener]['scope_closer'], 'Opener scope closer for "inner" arrow function is not the semicolon token'); - - $closer = $tokens[$token]['scope_closer']; - $this->assertSame(($token - 4), $tokens[$closer]['scope_opener'], 'Closer scope opener for "inner" arrow function is not the arrow token of the "outer" arrow function (shared scope closer)'); - $this->assertSame($expectedScopeCloser, $tokens[$closer]['scope_closer'], 'Closer scope closer for "inner" arrow function is not the TRUE token'); - - }//end testNestedSharedCloser() - - - /** - * Test arrow functions that call functions. - * - * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional - * - * @return void - */ - public function testFunctionCall() - { - $token = $this->getTargetToken('/* testFunctionCall */', T_FN); - $this->backfillHelper($token); - $this->scopePositionTestHelper($token, 5, 17); - - }//end testFunctionCall() - - - /** - * Test arrow functions that are included in chained calls. - * - * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional - * - * @return void - */ - public function testChainedFunctionCall() - { - $token = $this->getTargetToken('/* testChainedFunctionCall */', T_FN); - $this->backfillHelper($token); - $this->scopePositionTestHelper($token, 5, 12, 'bracket'); - - }//end testChainedFunctionCall() - - - /** - * Test arrow functions that are used as function arguments. - * - * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional - * - * @return void - */ - public function testFunctionArgument() - { - $token = $this->getTargetToken('/* testFunctionArgument */', T_FN); - $this->backfillHelper($token); - $this->scopePositionTestHelper($token, 8, 15, 'comma'); - - }//end testFunctionArgument() - - - /** - * Test arrow functions that use closures. - * - * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional - * - * @return void - */ - public function testClosure() - { - $token = $this->getTargetToken('/* testClosure */', T_FN); - $this->backfillHelper($token); - $this->scopePositionTestHelper($token, 5, 60, 'comma'); - - }//end testClosure() - - - /** - * Test arrow functions using an array index. - * - * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional - * - * @return void - */ - public function testArrayIndex() - { - $token = $this->getTargetToken('/* testArrayIndex */', T_FN); - $this->backfillHelper($token); - $this->scopePositionTestHelper($token, 8, 17, 'comma'); - - }//end testArrayIndex() - - - /** - * Test arrow functions with a return type. - * - * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional - * - * @return void - */ - public function testReturnType() - { - $token = $this->getTargetToken('/* testReturnType */', T_FN); - $this->backfillHelper($token); - $this->scopePositionTestHelper($token, 11, 18, 'comma'); - - }//end testReturnType() - - - /** - * Test arrow functions that return a reference. - * - * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional - * - * @return void - */ - public function testReference() - { - $token = $this->getTargetToken('/* testReference */', T_FN); - $this->backfillHelper($token); - $this->scopePositionTestHelper($token, 6, 9); - - }//end testReference() - - - /** - * Test arrow functions that are grouped by parenthesis. - * - * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional - * - * @return void - */ - public function testGrouped() - { - $token = $this->getTargetToken('/* testGrouped */', T_FN); - $this->backfillHelper($token); - $this->scopePositionTestHelper($token, 5, 8); - - }//end testGrouped() - - - /** - * Test arrow functions that are used as array values. - * - * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional - * - * @return void - */ - public function testArrayValue() - { - $token = $this->getTargetToken('/* testArrayValue */', T_FN); - $this->backfillHelper($token); - $this->scopePositionTestHelper($token, 4, 9, 'comma'); - - }//end testArrayValue() - - - /** - * Test arrow functions that are used as array values with no trailing comma. - * - * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional - * - * @return void - */ - public function testArrayValueNoTrailingComma() - { - $token = $this->getTargetToken('/* testArrayValueNoTrailingComma */', T_FN); - $this->backfillHelper($token); - $this->scopePositionTestHelper($token, 4, 8, 'closing parenthesis'); - - }//end testArrayValueNoTrailingComma() - - - /** - * Test arrow functions that use the yield keyword. - * - * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional - * - * @return void - */ - public function testYield() - { - $token = $this->getTargetToken('/* testYield */', T_FN); - $this->backfillHelper($token); - $this->scopePositionTestHelper($token, 5, 14); - - }//end testYield() - - - /** - * Test arrow functions that use nullable namespace types. - * - * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional - * - * @return void - */ - public function testNullableNamespace() - { - $token = $this->getTargetToken('/* testNullableNamespace */', T_FN); - $this->backfillHelper($token); - $this->scopePositionTestHelper($token, 15, 18); - - }//end testNullableNamespace() - - - /** - * Test arrow functions that use the namespace operator in the return type. - * - * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional - * - * @return void - */ - public function testNamespaceOperatorInTypes() - { - $token = $this->getTargetToken('/* testNamespaceOperatorInTypes */', T_FN); - $this->backfillHelper($token); - $this->scopePositionTestHelper($token, 16, 19); - - }//end testNamespaceOperatorInTypes() - - - /** - * Test arrow functions that use self/parent/callable/array/static return types. - * - * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional - * - * @return void - */ - public function testKeywordReturnTypes() - { - $tokens = self::$phpcsFile->getTokens(); - - $testMarkers = [ - 'Self', - 'Parent', - 'Callable', - 'Array', - 'Static', - ]; - - foreach ($testMarkers as $marker) { - $token = $this->getTargetToken('/* test'.$marker.'ReturnType */', T_FN); - $this->backfillHelper($token); - - $expectedScopeOpener = ($token + 11); - $expectedScopeCloser = ($token + 14); - - $this->assertSame($expectedScopeOpener, $tokens[$token]['scope_opener'], "Scope opener is not the arrow token (for $marker)"); - $this->assertSame($expectedScopeCloser, $tokens[$token]['scope_closer'], "Scope closer is not the semicolon token(for $marker)"); - - $opener = $tokens[$token]['scope_opener']; - $this->assertSame($expectedScopeOpener, $tokens[$opener]['scope_opener'], "Opener scope opener is not the arrow token(for $marker)"); - $this->assertSame($expectedScopeCloser, $tokens[$opener]['scope_closer'], "Opener scope closer is not the semicolon token(for $marker)"); - - $closer = $tokens[$token]['scope_closer']; - $this->assertSame($expectedScopeOpener, $tokens[$closer]['scope_opener'], "Closer scope opener is not the arrow token(for $marker)"); - $this->assertSame($expectedScopeCloser, $tokens[$closer]['scope_closer'], "Closer scope closer is not the semicolon token(for $marker)"); - } - - }//end testKeywordReturnTypes() - - - /** - * Test arrow function with a union parameter type. - * - * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional - * - * @return void - */ - public function testUnionParamType() - { - $token = $this->getTargetToken('/* testUnionParamType */', T_FN); - $this->backfillHelper($token); - $this->scopePositionTestHelper($token, 13, 21); - - }//end testUnionParamType() - - - /** - * Test arrow function with a union return type. - * - * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional - * - * @return void - */ - public function testUnionReturnType() - { - $token = $this->getTargetToken('/* testUnionReturnType */', T_FN); - $this->backfillHelper($token); - $this->scopePositionTestHelper($token, 11, 18); - - }//end testUnionReturnType() - - - /** - * Test arrow functions used in ternary operators. - * - * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional - * - * @return void - */ - public function testTernary() - { - $tokens = self::$phpcsFile->getTokens(); - - $token = $this->getTargetToken('/* testTernary */', T_FN); - $this->backfillHelper($token); - $this->scopePositionTestHelper($token, 5, 40); - - $token = $this->getTargetToken('/* testTernaryThen */', T_FN); - $this->backfillHelper($token); - - $expectedScopeOpener = ($token + 8); - $expectedScopeCloser = ($token + 12); - - $this->assertSame($expectedScopeOpener, $tokens[$token]['scope_opener'], 'Scope opener for THEN is not the arrow token'); - $this->assertSame($expectedScopeCloser, $tokens[$token]['scope_closer'], 'Scope closer for THEN is not the semicolon token'); - - $opener = $tokens[$token]['scope_opener']; - $this->assertSame($expectedScopeOpener, $tokens[$opener]['scope_opener'], 'Opener scope opener for THEN is not the arrow token'); - $this->assertSame($expectedScopeCloser, $tokens[$opener]['scope_closer'], 'Opener scope closer for THEN is not the semicolon token'); - - $closer = $tokens[$token]['scope_closer']; - $this->assertSame($expectedScopeOpener, $tokens[$closer]['scope_opener'], 'Closer scope opener for THEN is not the arrow token'); - $this->assertSame($expectedScopeCloser, $tokens[$closer]['scope_closer'], 'Closer scope closer for THEN is not the semicolon token'); - - $token = $this->getTargetToken('/* testTernaryElse */', T_FN); - $this->backfillHelper($token, true); - - $expectedScopeOpener = ($token + 8); - $expectedScopeCloser = ($token + 11); - - $this->assertSame($expectedScopeOpener, $tokens[$token]['scope_opener'], 'Scope opener for ELSE is not the arrow token'); - $this->assertSame($expectedScopeCloser, $tokens[$token]['scope_closer'], 'Scope closer for ELSE is not the semicolon token'); - - $opener = $tokens[$token]['scope_opener']; - $this->assertSame($expectedScopeOpener, $tokens[$opener]['scope_opener'], 'Opener scope opener for ELSE is not the arrow token'); - $this->assertSame($expectedScopeCloser, $tokens[$opener]['scope_closer'], 'Opener scope closer for ELSE is not the semicolon token'); - - $closer = $tokens[$token]['scope_closer']; - $this->assertSame(($token - 24), $tokens[$closer]['scope_opener'], 'Closer scope opener for ELSE is not the arrow token of the "outer" arrow function (shared scope closer)'); - $this->assertSame($expectedScopeCloser, $tokens[$closer]['scope_closer'], 'Closer scope closer for ELSE is not the semicolon token'); - - }//end testTernary() - - - /** - * Test typed arrow functions used in ternary operators. - * - * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional - * - * @return void - */ - public function testTernaryWithTypes() - { - $tokens = self::$phpcsFile->getTokens(); - - $token = $this->getTargetToken('/* testTernaryWithTypes */', T_FN); - $this->backfillHelper($token); - $this->scopePositionTestHelper($token, 15, 27); - - }//end testTernaryWithTypes() - - - /** - * Test arrow function returning a match control structure. - * - * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional - * - * @return void - */ - public function testWithMatchValue() - { - $token = $this->getTargetToken('/* testWithMatchValue */', T_FN); - $this->backfillHelper($token); - $this->scopePositionTestHelper($token, 5, 44); - - }//end testWithMatchValue() - - - /** - * Test arrow function returning a match control structure with something behind it. - * - * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional - * - * @return void - */ - public function testWithMatchValueAndMore() - { - $token = $this->getTargetToken('/* testWithMatchValueAndMore */', T_FN); - $this->backfillHelper($token); - $this->scopePositionTestHelper($token, 5, 48); - - }//end testWithMatchValueAndMore() - - - /** - * Test match control structure returning arrow functions. - * - * @param string $testMarker The comment prefacing the target token. - * @param int $openerOffset The expected offset of the scope opener in relation to the testMarker. - * @param int $closerOffset The expected offset of the scope closer in relation to the testMarker. - * @param string $expectedCloserType The type of token expected for the scope closer. - * @param string $expectedCloserFriendlyName A friendly name for the type of token expected for the scope closer - * to be used in the error message for failing tests. - * - * @dataProvider dataInMatchValue - * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional - * - * @return void - */ - public function testInMatchValue($testMarker, $openerOffset, $closerOffset, $expectedCloserType, $expectedCloserFriendlyName) - { - $tokens = self::$phpcsFile->getTokens(); - - $token = $this->getTargetToken($testMarker, T_FN); - $this->backfillHelper($token); - $this->scopePositionTestHelper($token, $openerOffset, $closerOffset, $expectedCloserFriendlyName); - - $this->assertSame($expectedCloserType, $tokens[($token + $closerOffset)]['type'], 'Mismatched scope closer type'); - - }//end testInMatchValue() - - - /** - * Data provider. - * - * @see testInMatchValue() - * - * @return array - */ - public function dataInMatchValue() - { - return [ - 'not_last_value' => [ - '/* testInMatchNotLastValue */', - 5, - 11, - 'T_COMMA', - 'comma', - ], - 'last_value_with_trailing_comma' => [ - '/* testInMatchLastValueWithTrailingComma */', - 5, - 11, - 'T_COMMA', - 'comma', - ], - 'last_value_without_trailing_comma_1' => [ - '/* testInMatchLastValueNoTrailingComma1 */', - 5, - 10, - 'T_CLOSE_PARENTHESIS', - 'close parenthesis', - ], - 'last_value_without_trailing_comma_2' => [ - '/* testInMatchLastValueNoTrailingComma2 */', - 5, - 11, - 'T_VARIABLE', - '$y variable', - ], - ]; - - }//end dataInMatchValue() - - - /** - * Test arrow function nested within a method declaration. - * - * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional - * - * @return void - */ - public function testNestedInMethod() - { - $token = $this->getTargetToken('/* testNestedInMethod */', T_FN); - $this->backfillHelper($token); - $this->scopePositionTestHelper($token, 5, 17); - - }//end testNestedInMethod() - - - /** - * Verify that "fn" keywords which are not arrow functions get tokenized as T_STRING and don't - * have the extra token array indexes. - * - * @param string $testMarker The comment prefacing the target token. - * @param string $testContent The token content to look for. - * - * @dataProvider dataNotAnArrowFunction - * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional - * - * @return void - */ - public function testNotAnArrowFunction($testMarker, $testContent='fn') - { - $tokens = self::$phpcsFile->getTokens(); - - $token = $this->getTargetToken($testMarker, [T_STRING, T_FN], $testContent); - $tokenArray = $tokens[$token]; - - $this->assertSame('T_STRING', $tokenArray['type'], 'Token tokenized as '.$tokenArray['type'].', not T_STRING'); - - $this->assertArrayNotHasKey('scope_condition', $tokenArray, 'Scope condition is set'); - $this->assertArrayNotHasKey('scope_opener', $tokenArray, 'Scope opener is set'); - $this->assertArrayNotHasKey('scope_closer', $tokenArray, 'Scope closer is set'); - $this->assertArrayNotHasKey('parenthesis_owner', $tokenArray, 'Parenthesis owner is set'); - $this->assertArrayNotHasKey('parenthesis_opener', $tokenArray, 'Parenthesis opener is set'); - $this->assertArrayNotHasKey('parenthesis_closer', $tokenArray, 'Parenthesis closer is set'); - - }//end testNotAnArrowFunction() - - - /** - * Data provider. - * - * @see testNotAnArrowFunction() - * - * @return array - */ - public function dataNotAnArrowFunction() - { - return [ - ['/* testFunctionName */'], - [ - '/* testConstantDeclaration */', - 'FN', - ], - [ - '/* testConstantDeclarationLower */', - 'fn', - ], - ['/* testStaticMethodName */'], - ['/* testPropertyAssignment */'], - [ - '/* testAnonClassMethodName */', - 'fN', - ], - ['/* testNonArrowStaticMethodCall */'], - [ - '/* testNonArrowConstantAccess */', - 'FN', - ], - [ - '/* testNonArrowConstantAccessMixed */', - 'Fn', - ], - ['/* testNonArrowObjectMethodCall */'], - [ - '/* testNonArrowObjectMethodCallUpper */', - 'FN', - ], - [ - '/* testNonArrowNamespacedFunctionCall */', - 'Fn', - ], - ['/* testNonArrowNamespaceOperatorFunctionCall */'], - ['/* testNonArrowFunctionNameWithUnionTypes */'], - ['/* testLiveCoding */'], - ]; - - }//end dataNotAnArrowFunction() - - - /** - * Helper function to check that all token keys are correctly set for T_FN tokens. - * - * @param int $token The T_FN token to check. - * @param bool $skipScopeCloserCheck Whether to skip the scope closer check. - * This should be set to "true" when testing nested arrow functions, - * where the "inner" arrow function shares a scope closer with the - * "outer" arrow function, as the 'scope_condition' for the scope closer - * of the "inner" arrow function will point to the "outer" arrow function. - * - * @return void - */ - private function backfillHelper($token, $skipScopeCloserCheck=false) - { - $tokens = self::$phpcsFile->getTokens(); - - $this->assertTrue(array_key_exists('scope_condition', $tokens[$token]), 'Scope condition is not set'); - $this->assertTrue(array_key_exists('scope_opener', $tokens[$token]), 'Scope opener is not set'); - $this->assertTrue(array_key_exists('scope_closer', $tokens[$token]), 'Scope closer is not set'); - $this->assertSame($tokens[$token]['scope_condition'], $token, 'Scope condition is not the T_FN token'); - $this->assertTrue(array_key_exists('parenthesis_owner', $tokens[$token]), 'Parenthesis owner is not set'); - $this->assertTrue(array_key_exists('parenthesis_opener', $tokens[$token]), 'Parenthesis opener is not set'); - $this->assertTrue(array_key_exists('parenthesis_closer', $tokens[$token]), 'Parenthesis closer is not set'); - $this->assertSame($tokens[$token]['parenthesis_owner'], $token, 'Parenthesis owner is not the T_FN token'); - - $opener = $tokens[$token]['scope_opener']; - $this->assertTrue(array_key_exists('scope_condition', $tokens[$opener]), 'Opener scope condition is not set'); - $this->assertTrue(array_key_exists('scope_opener', $tokens[$opener]), 'Opener scope opener is not set'); - $this->assertTrue(array_key_exists('scope_closer', $tokens[$opener]), 'Opener scope closer is not set'); - $this->assertSame($tokens[$opener]['scope_condition'], $token, 'Opener scope condition is not the T_FN token'); - $this->assertSame(T_FN_ARROW, $tokens[$opener]['code'], 'Arrow scope opener not tokenized as T_FN_ARROW (code)'); - $this->assertSame('T_FN_ARROW', $tokens[$opener]['type'], 'Arrow scope opener not tokenized as T_FN_ARROW (type)'); - - $closer = $tokens[$token]['scope_closer']; - $this->assertTrue(array_key_exists('scope_condition', $tokens[$closer]), 'Closer scope condition is not set'); - $this->assertTrue(array_key_exists('scope_opener', $tokens[$closer]), 'Closer scope opener is not set'); - $this->assertTrue(array_key_exists('scope_closer', $tokens[$closer]), 'Closer scope closer is not set'); - if ($skipScopeCloserCheck === false) { - $this->assertSame($tokens[$closer]['scope_condition'], $token, 'Closer scope condition is not the T_FN token'); - } - - $opener = $tokens[$token]['parenthesis_opener']; - $this->assertTrue(array_key_exists('parenthesis_owner', $tokens[$opener]), 'Opening parenthesis owner is not set'); - $this->assertSame($tokens[$opener]['parenthesis_owner'], $token, 'Opening parenthesis owner is not the T_FN token'); - - $closer = $tokens[$token]['parenthesis_closer']; - $this->assertTrue(array_key_exists('parenthesis_owner', $tokens[$closer]), 'Closing parenthesis owner is not set'); - $this->assertSame($tokens[$closer]['parenthesis_owner'], $token, 'Closing parenthesis owner is not the T_FN token'); - - }//end backfillHelper() - - - /** - * Helper function to check that the scope opener/closer positions are correctly set for T_FN tokens. - * - * @param int $token The T_FN token to check. - * @param int $openerOffset The expected offset of the scope opener in relation to - * the fn keyword. - * @param int $closerOffset The expected offset of the scope closer in relation to - * the fn keyword. - * @param string $expectedCloserType Optional. The type of token expected for the scope closer. - * - * @return void - */ - private function scopePositionTestHelper($token, $openerOffset, $closerOffset, $expectedCloserType='semicolon') - { - $tokens = self::$phpcsFile->getTokens(); - $expectedScopeOpener = ($token + $openerOffset); - $expectedScopeCloser = ($token + $closerOffset); - - $this->assertSame($expectedScopeOpener, $tokens[$token]['scope_opener'], 'Scope opener is not the arrow token'); - $this->assertSame($expectedScopeCloser, $tokens[$token]['scope_closer'], 'Scope closer is not the '.$expectedCloserType.' token'); - - $opener = $tokens[$token]['scope_opener']; - $this->assertSame($expectedScopeOpener, $tokens[$opener]['scope_opener'], 'Opener scope opener is not the arrow token'); - $this->assertSame($expectedScopeCloser, $tokens[$opener]['scope_closer'], 'Opener scope closer is not the '.$expectedCloserType.' token'); - - $closer = $tokens[$token]['scope_closer']; - $this->assertSame($expectedScopeOpener, $tokens[$closer]['scope_opener'], 'Closer scope opener is not the arrow token'); - $this->assertSame($expectedScopeCloser, $tokens[$closer]['scope_closer'], 'Closer scope closer is not the '.$expectedCloserType.' token'); - - }//end scopePositionTestHelper() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillMatchTokenTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillMatchTokenTest.inc deleted file mode 100644 index 095a4d7..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillMatchTokenTest.inc +++ /dev/null @@ -1,319 +0,0 @@ - 'Zero', - 1 => 'One', - 2 => 'Two', - }; -} - -function matchNoTrailingComma($bool) { - /* testMatchNoTrailingComma */ - echo match ($bool) { - true => "true\n", - false => "false\n" - }; -} - -function matchWithDefault($i) { - /* testMatchWithDefault */ - return match ($i) { - 1 => 1, - 2 => 2, - default => 'default', - }; -} - -function matchExpressionInCondition($i) { - /* testMatchExpressionInCondition */ - return match (true) { - $i >= 50 => '50+', - $i >= 40 => '40-50', - $i >= 30 => '30-40', - $i >= 20 => '20-30', - $i >= 10 => '10-20', - default => '0-10', - }; -} - -function matchMultiCase($day) { - /* testMatchMultiCase */ - return match ($day) { - 1, 7 => false, - 2, 3, 4, 5, 6 => true, - }; -} - -function matchMultiCaseTrailingCommaInCase($bool) { - /* testMatchMultiCaseTrailingCommaInCase */ - echo match ($bool) { - false, - 0, - => "false\n", - true, - 1, - => "true\n", - default, - => "not bool\n", - }; -} - -assert((function () { - /* testMatchInClosureNotLowercase */ - Match ('foo') { - 'foo', 'bar' => false, - 'baz' => 'a', - default => 'b', - }; -})()); - -function matchInArrowFunction($x) { - /* testMatchInArrowFunction */ - $fn = fn($x) => match(true) { - 1, 2, 3, 4, 5 => 'foo', - default => 'bar', - }; -} - -function arrowFunctionInMatchNoTrailingComma($x) { - /* testArrowFunctionInMatchNoTrailingComma */ - return match ($x) { - 1 => fn($y) => callMe($y), - default => fn($y) => callThem($y) - }; -} - -/* testMatchInFunctionCallParamNotLowercase */ -var_dump(MATCH ( 'foo' ) { - 'foo' => dump_and_return('foo'), - 'bar' => dump_and_return('bar'), -}); - -/* testMatchInMethodCallParam */ -Test::usesValue(match(true) { true => $i }); - -/* testMatchDiscardResult */ -match (1) { - 1 => print "Executed\n", -}; - -/* testMatchWithDuplicateConditionsWithComments */ -echo match /*comment*/ ( $value /*comment*/ ) { - // Comment. - 2, 1 => '2, 1', - 1 => 1, - 3 => 3, - 4 => 4, - 5 => 5, -}; - -/* testNestedMatchOuter */ -$x = match ($y) { - /* testNestedMatchInner */ - default => match ($z) { 1 => 1 }, -}; - -/* testMatchInTernaryCondition */ -$x = match ($test) { 1 => 'a', 2 => 'b' } ? - /* testMatchInTernaryThen */ match ($test) { 1 => 'a', 2 => 'b' } : - /* testMatchInTernaryElse */ match ($notTest) { 3 => 'a', 4 => 'b' }; - -/* testMatchInArrayValue */ -$array = array( - match ($test) { 1 => 'a', 2 => 'b' }, -); - -/* testMatchInArrayKey */ -$array = [ - match ($test) { 1 => 'a', 2 => 'b' } => 'dynamic keys, woho!', -]; - -/* testMatchreturningArray */ -$matcher = match ($x) { - 0 => array( 0 => 1, 'a' => 2, 'b' => 3 ), - 1 => [1, 2, 3], - 2 => array( 1, [1, 2, 3], 2, 3), - 3 => [ 0 => 1, 'a' => array(1, 2, 3), 'b' => 2, 3], -}; - -/* testSwitchContainingMatch */ -switch ($something) { - /* testMatchWithDefaultNestedInSwitchCase1 */ - case 'foo': - $var = [1, 2, 3]; - $var = match ($i) { - 1 => 1, - default => 'default', - }; - continue 2; - - /* testMatchWithDefaultNestedInSwitchCase2 */ - case 'bar' ; - $i = callMe($a, $b); - return match ($i) { - 1 => 1, - default => 'default', - }; - - /* testMatchWithDefaultNestedInSwitchDefault */ - default: - echo 'something', match ($i) { - 1 => 1, - default => 'default', - }; - break; -} - -/* testMatchContainingSwitch */ -$x = match ($y) { - 5, 8 => function($z) { - /* testSwitchNestedInMatch1 */ - switch($z) { - case 'a': - $var = [1, 2, 3]; - return 'a'; - /* testSwitchDefaultNestedInMatchCase */ - default: - $i = callMe($a, $b); - return 'default1'; - } - }, - default => function($z) { - /* testSwitchNestedInMatch2 */ - switch($z) { - case 'a'; - $i = callMe($a, $b); - return 'b'; - /* testSwitchDefaultNestedInMatchDefault */ - default; - $var = [1, 2, 3]; - return 'default2'; - } - } -}; - -/* testMatchNoCases */ -// Intentional fatal error. -$x = match (true) {}; - -/* testMatchMultiDefault */ -// Intentional fatal error. -echo match (1) { - default => 'foo', - 1 => 'bar', - 2 => 'baz', - default => 'qux', -}; - -/* testNoMatchStaticMethodCall */ -$a = Foo::match($param); - -/* testNoMatchClassConstantAccess */ -$a = MyClass::MATCH; - -/* testNoMatchClassConstantArrayAccessMixedCase */ -$a = MyClass::Match[$a]; - -/* testNoMatchMethodCall */ -$a = $obj->match($param); - -/* testNoMatchMethodCallUpper */ -$a = $obj??->MATCH()->chain($param); - -/* testNoMatchPropertyAccess */ -$a = $obj->match; - -/* testNoMatchNamespacedFunctionCall */ -// Intentional fatal error. -$a = MyNS\Sub\match($param); - -/* testNoMatchNamespaceOperatorFunctionCall */ -// Intentional fatal error. -$a = namespace\match($param); - -interface MatchInterface { - /* testNoMatchInterfaceMethodDeclaration */ - public static function match($param); -} - -class MatchClass { - /* testNoMatchClassConstantDeclarationLower */ - const match = 'a'; - - /* testNoMatchClassMethodDeclaration */ - public static function match($param) { - /* testNoMatchPropertyAssignment */ - $this->match = 'a'; - } -} - -/* testNoMatchClassInstantiation */ -$obj = new Match(); - -$anon = new class() { - /* testNoMatchAnonClassMethodDeclaration */ - protected function maTCH($param) { - } -}; - -/* testNoMatchClassDeclaration */ -// Intentional fatal error. Match is now a reserved keyword. -class Match {} - -/* testNoMatchInterfaceDeclaration */ -// Intentional fatal error. Match is now a reserved keyword. -interface Match {} - -/* testNoMatchTraitDeclaration */ -// Intentional fatal error. Match is now a reserved keyword. -trait Match {} - -/* testNoMatchConstantDeclaration */ -// Intentional fatal error. Match is now a reserved keyword. -const MATCH = '1'; - -/* testNoMatchFunctionDeclaration */ -// Intentional fatal error. Match is now a reserved keyword. -function match() {} - -/* testNoMatchNamespaceDeclaration */ -// Intentional fatal error. Match is now a reserved keyword. -namespace Match {} - -/* testNoMatchExtendedClassDeclaration */ -// Intentional fatal error. Match is now a reserved keyword. -class Foo extends Match {} - -/* testNoMatchImplementedClassDeclaration */ -// Intentional fatal error. Match is now a reserved keyword. -class Bar implements Match {} - -/* testNoMatchInUseStatement */ -// Intentional fatal error in PHP < 8. Match is now a reserved keyword. -use Match\me; - -function brokenMatchNoCurlies($x) { - /* testNoMatchMissingCurlies */ - // Intentional fatal error. New control structure is not supported without curly braces. - return match ($x) - 0 => 'Zero', - 1 => 'One', - 2 => 'Two', - ; -} - -function brokenMatchAlternativeSyntax($x) { - /* testNoMatchAlternativeSyntax */ - // Intentional fatal error. Alternative syntax is not supported. - return match ($x) : - 0 => 'Zero', - 1 => 'One', - 2 => 'Two', - endmatch; -} - -/* testLiveCoding */ -// Intentional parse error. This has to be the last test in the file. -echo match diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillMatchTokenTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillMatchTokenTest.php deleted file mode 100644 index 80f909a..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillMatchTokenTest.php +++ /dev/null @@ -1,529 +0,0 @@ - - * @copyright 2020-2021 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tests\Core\Tokenizer; - -use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest; -use PHP_CodeSniffer\Util\Tokens; - -class BackfillMatchTokenTest extends AbstractMethodUnitTest -{ - - - /** - * Test tokenization of match expressions. - * - * @param string $testMarker The comment prefacing the target token. - * @param int $openerOffset The expected offset of the scope opener in relation to the testMarker. - * @param int $closerOffset The expected offset of the scope closer in relation to the testMarker. - * @param string $testContent The token content to look for. - * - * @dataProvider dataMatchExpression - * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize - * - * @return void - */ - public function testMatchExpression($testMarker, $openerOffset, $closerOffset, $testContent='match') - { - $tokens = self::$phpcsFile->getTokens(); - - $token = $this->getTargetToken($testMarker, [T_STRING, T_MATCH], $testContent); - $tokenArray = $tokens[$token]; - - $this->assertSame(T_MATCH, $tokenArray['code'], 'Token tokenized as '.$tokenArray['type'].', not T_MATCH (code)'); - $this->assertSame('T_MATCH', $tokenArray['type'], 'Token tokenized as '.$tokenArray['type'].', not T_MATCH (type)'); - - $this->scopeTestHelper($token, $openerOffset, $closerOffset); - $this->parenthesisTestHelper($token); - - }//end testMatchExpression() - - - /** - * Data provider. - * - * @see testMatchExpression() - * - * @return array - */ - public function dataMatchExpression() - { - return [ - 'simple_match' => [ - '/* testMatchSimple */', - 6, - 33, - ], - 'no_trailing_comma' => [ - '/* testMatchNoTrailingComma */', - 6, - 24, - ], - 'with_default_case' => [ - '/* testMatchWithDefault */', - 6, - 33, - ], - 'expression_in_condition' => [ - '/* testMatchExpressionInCondition */', - 6, - 77, - ], - 'multicase' => [ - '/* testMatchMultiCase */', - 6, - 40, - ], - 'multicase_trailing_comma_in_case' => [ - '/* testMatchMultiCaseTrailingCommaInCase */', - 6, - 47, - ], - 'in_closure_not_lowercase' => [ - '/* testMatchInClosureNotLowercase */', - 6, - 36, - 'Match', - ], - 'in_arrow_function' => [ - '/* testMatchInArrowFunction */', - 5, - 36, - ], - 'arrow_function_in_match_no_trailing_comma' => [ - '/* testArrowFunctionInMatchNoTrailingComma */', - 6, - 44, - ], - 'in_function_call_param_not_lowercase' => [ - '/* testMatchInFunctionCallParamNotLowercase */', - 8, - 32, - 'MATCH', - ], - 'in_method_call_param' => [ - '/* testMatchInMethodCallParam */', - 5, - 13, - ], - 'discard_result' => [ - '/* testMatchDiscardResult */', - 6, - 18, - ], - 'duplicate_conditions_and_comments' => [ - '/* testMatchWithDuplicateConditionsWithComments */', - 12, - 59, - ], - 'nested_match_outer' => [ - '/* testNestedMatchOuter */', - 6, - 33, - ], - 'nested_match_inner' => [ - '/* testNestedMatchInner */', - 6, - 14, - ], - 'ternary_condition' => [ - '/* testMatchInTernaryCondition */', - 6, - 21, - ], - 'ternary_then' => [ - '/* testMatchInTernaryThen */', - 6, - 21, - ], - 'ternary_else' => [ - '/* testMatchInTernaryElse */', - 6, - 21, - ], - 'array_value' => [ - '/* testMatchInArrayValue */', - 6, - 21, - ], - 'array_key' => [ - '/* testMatchInArrayKey */', - 6, - 21, - ], - 'returning_array' => [ - '/* testMatchreturningArray */', - 6, - 125, - ], - 'nested_in_switch_case_1' => [ - '/* testMatchWithDefaultNestedInSwitchCase1 */', - 6, - 25, - ], - 'nested_in_switch_case_2' => [ - '/* testMatchWithDefaultNestedInSwitchCase2 */', - 6, - 25, - ], - 'nested_in_switch_default' => [ - '/* testMatchWithDefaultNestedInSwitchDefault */', - 6, - 25, - ], - 'match_with_nested_switch' => [ - '/* testMatchContainingSwitch */', - 6, - 180, - ], - 'no_cases' => [ - '/* testMatchNoCases */', - 6, - 7, - ], - 'multi_default' => [ - '/* testMatchMultiDefault */', - 6, - 40, - ], - ]; - - }//end dataMatchExpression() - - - /** - * Verify that "match" keywords which are not match control structures get tokenized as T_STRING - * and don't have the extra token array indexes. - * - * @param string $testMarker The comment prefacing the target token. - * @param string $testContent The token content to look for. - * - * @dataProvider dataNotAMatchStructure - * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize - * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional - * - * @return void - */ - public function testNotAMatchStructure($testMarker, $testContent='match') - { - $tokens = self::$phpcsFile->getTokens(); - - $token = $this->getTargetToken($testMarker, [T_STRING, T_MATCH], $testContent); - $tokenArray = $tokens[$token]; - - $this->assertSame(T_STRING, $tokenArray['code'], 'Token tokenized as '.$tokenArray['type'].', not T_STRING (code)'); - $this->assertSame('T_STRING', $tokenArray['type'], 'Token tokenized as '.$tokenArray['type'].', not T_STRING (type)'); - - $this->assertArrayNotHasKey('scope_condition', $tokenArray, 'Scope condition is set'); - $this->assertArrayNotHasKey('scope_opener', $tokenArray, 'Scope opener is set'); - $this->assertArrayNotHasKey('scope_closer', $tokenArray, 'Scope closer is set'); - $this->assertArrayNotHasKey('parenthesis_owner', $tokenArray, 'Parenthesis owner is set'); - $this->assertArrayNotHasKey('parenthesis_opener', $tokenArray, 'Parenthesis opener is set'); - $this->assertArrayNotHasKey('parenthesis_closer', $tokenArray, 'Parenthesis closer is set'); - - $next = self::$phpcsFile->findNext(Tokens::$emptyTokens, ($token + 1), null, true); - if ($next !== false && $tokens[$next]['code'] === T_OPEN_PARENTHESIS) { - $this->assertArrayNotHasKey('parenthesis_owner', $tokenArray, 'Parenthesis owner is set for opener after'); - } - - }//end testNotAMatchStructure() - - - /** - * Data provider. - * - * @see testNotAMatchStructure() - * - * @return array - */ - public function dataNotAMatchStructure() - { - return [ - 'static_method_call' => ['/* testNoMatchStaticMethodCall */'], - 'class_constant_access' => [ - '/* testNoMatchClassConstantAccess */', - 'MATCH', - ], - 'class_constant_array_access' => [ - '/* testNoMatchClassConstantArrayAccessMixedCase */', - 'Match', - ], - 'method_call' => ['/* testNoMatchMethodCall */'], - 'method_call_uppercase' => [ - '/* testNoMatchMethodCallUpper */', - 'MATCH', - ], - 'property_access' => ['/* testNoMatchPropertyAccess */'], - 'namespaced_function_call' => ['/* testNoMatchNamespacedFunctionCall */'], - 'namespace_operator_function_call' => ['/* testNoMatchNamespaceOperatorFunctionCall */'], - 'interface_method_declaration' => ['/* testNoMatchInterfaceMethodDeclaration */'], - 'class_constant_declaration' => ['/* testNoMatchClassConstantDeclarationLower */'], - 'class_method_declaration' => ['/* testNoMatchClassMethodDeclaration */'], - 'property_assigment' => ['/* testNoMatchPropertyAssignment */'], - 'class_instantiation' => [ - '/* testNoMatchClassInstantiation */', - 'Match', - ], - 'anon_class_method_declaration' => [ - '/* testNoMatchAnonClassMethodDeclaration */', - 'maTCH', - ], - 'class_declaration' => [ - '/* testNoMatchClassDeclaration */', - 'Match', - ], - 'interface_declaration' => [ - '/* testNoMatchInterfaceDeclaration */', - 'Match', - ], - 'trait_declaration' => [ - '/* testNoMatchTraitDeclaration */', - 'Match', - ], - 'constant_declaration' => [ - '/* testNoMatchConstantDeclaration */', - 'MATCH', - ], - 'function_declaration' => ['/* testNoMatchFunctionDeclaration */'], - 'namespace_declaration' => [ - '/* testNoMatchNamespaceDeclaration */', - 'Match', - ], - 'class_extends_declaration' => [ - '/* testNoMatchExtendedClassDeclaration */', - 'Match', - ], - 'class_implements_declaration' => [ - '/* testNoMatchImplementedClassDeclaration */', - 'Match', - ], - 'use_statement' => [ - '/* testNoMatchInUseStatement */', - 'Match', - ], - 'unsupported_inline_control_structure' => ['/* testNoMatchMissingCurlies */'], - 'unsupported_alternative_syntax' => ['/* testNoMatchAlternativeSyntax */'], - 'live_coding' => ['/* testLiveCoding */'], - ]; - - }//end dataNotAMatchStructure() - - - /** - * Verify that the tokenization of switch structures is not affected by the backfill. - * - * @param string $testMarker The comment prefacing the target token. - * @param int $openerOffset The expected offset of the scope opener in relation to the testMarker. - * @param int $closerOffset The expected offset of the scope closer in relation to the testMarker. - * - * @dataProvider dataSwitchExpression - * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize - * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional - * - * @return void - */ - public function testSwitchExpression($testMarker, $openerOffset, $closerOffset) - { - $token = $this->getTargetToken($testMarker, T_SWITCH); - - $this->scopeTestHelper($token, $openerOffset, $closerOffset); - $this->parenthesisTestHelper($token); - - }//end testSwitchExpression() - - - /** - * Data provider. - * - * @see testSwitchExpression() - * - * @return array - */ - public function dataSwitchExpression() - { - return [ - 'switch_containing_match' => [ - '/* testSwitchContainingMatch */', - 6, - 174, - ], - 'match_containing_switch_1' => [ - '/* testSwitchNestedInMatch1 */', - 5, - 63, - ], - 'match_containing_switch_2' => [ - '/* testSwitchNestedInMatch2 */', - 5, - 63, - ], - ]; - - }//end dataSwitchExpression() - - - /** - * Verify that the tokenization of a switch case/default structure containing a match structure - * or contained *in* a match structure is not affected by the backfill. - * - * @param string $testMarker The comment prefacing the target token. - * @param int $openerOffset The expected offset of the scope opener in relation to the testMarker. - * @param int $closerOffset The expected offset of the scope closer in relation to the testMarker. - * - * @dataProvider dataSwitchCaseVersusMatch - * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize - * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional - * - * @return void - */ - public function testSwitchCaseVersusMatch($testMarker, $openerOffset, $closerOffset) - { - $token = $this->getTargetToken($testMarker, [T_CASE, T_DEFAULT]); - - $this->scopeTestHelper($token, $openerOffset, $closerOffset); - - }//end testSwitchCaseVersusMatch() - - - /** - * Data provider. - * - * @see testSwitchCaseVersusMatch() - * - * @return array - */ - public function dataSwitchCaseVersusMatch() - { - return [ - 'switch_with_nested_match_case_1' => [ - '/* testMatchWithDefaultNestedInSwitchCase1 */', - 3, - 55, - ], - 'switch_with_nested_match_case_2' => [ - '/* testMatchWithDefaultNestedInSwitchCase2 */', - 4, - 21, - ], - 'switch_with_nested_match_default_case' => [ - '/* testMatchWithDefaultNestedInSwitchDefault */', - 1, - 38, - ], - 'match_with_nested_switch_case' => [ - '/* testSwitchDefaultNestedInMatchCase */', - 1, - 18, - ], - 'match_with_nested_switch_default_case' => [ - '/* testSwitchDefaultNestedInMatchDefault */', - 1, - 20, - ], - ]; - - }//end dataSwitchCaseVersusMatch() - - - /** - * Helper function to verify that all scope related array indexes for a control structure - * are set correctly. - * - * @param string $token The control structure token to check. - * @param int $openerOffset The expected offset of the scope opener in relation to - * the control structure token. - * @param int $closerOffset The expected offset of the scope closer in relation to - * the control structure token. - * @param bool $skipScopeCloserCheck Whether to skip the scope closer check. - * This should be set to "true" when testing nested arrow functions, - * where the "inner" arrow function shares a scope closer with the - * "outer" arrow function, as the 'scope_condition' for the scope closer - * of the "inner" arrow function will point to the "outer" arrow function. - * - * @return void - */ - private function scopeTestHelper($token, $openerOffset, $closerOffset, $skipScopeCloserCheck=false) - { - $tokens = self::$phpcsFile->getTokens(); - $tokenArray = $tokens[$token]; - $tokenType = $tokenArray['type']; - $expectedScopeOpener = ($token + $openerOffset); - $expectedScopeCloser = ($token + $closerOffset); - - $this->assertArrayHasKey('scope_condition', $tokenArray, 'Scope condition is not set'); - $this->assertArrayHasKey('scope_opener', $tokenArray, 'Scope opener is not set'); - $this->assertArrayHasKey('scope_closer', $tokenArray, 'Scope closer is not set'); - $this->assertSame($token, $tokenArray['scope_condition'], 'Scope condition is not the '.$tokenType.' token'); - $this->assertSame($expectedScopeOpener, $tokenArray['scope_opener'], 'Scope opener of the '.$tokenType.' token incorrect'); - $this->assertSame($expectedScopeCloser, $tokenArray['scope_closer'], 'Scope closer of the '.$tokenType.' token incorrect'); - - $opener = $tokenArray['scope_opener']; - $this->assertArrayHasKey('scope_condition', $tokens[$opener], 'Opener scope condition is not set'); - $this->assertArrayHasKey('scope_opener', $tokens[$opener], 'Opener scope opener is not set'); - $this->assertArrayHasKey('scope_closer', $tokens[$opener], 'Opener scope closer is not set'); - $this->assertSame($token, $tokens[$opener]['scope_condition'], 'Opener scope condition is not the '.$tokenType.' token'); - $this->assertSame($expectedScopeOpener, $tokens[$opener]['scope_opener'], $tokenType.' opener scope opener token incorrect'); - $this->assertSame($expectedScopeCloser, $tokens[$opener]['scope_closer'], $tokenType.' opener scope closer token incorrect'); - - $closer = $tokenArray['scope_closer']; - $this->assertArrayHasKey('scope_condition', $tokens[$closer], 'Closer scope condition is not set'); - $this->assertArrayHasKey('scope_opener', $tokens[$closer], 'Closer scope opener is not set'); - $this->assertArrayHasKey('scope_closer', $tokens[$closer], 'Closer scope closer is not set'); - if ($skipScopeCloserCheck === false) { - $this->assertSame($token, $tokens[$closer]['scope_condition'], 'Closer scope condition is not the '.$tokenType.' token'); - } - - $this->assertSame($expectedScopeOpener, $tokens[$closer]['scope_opener'], $tokenType.' closer scope opener token incorrect'); - $this->assertSame($expectedScopeCloser, $tokens[$closer]['scope_closer'], $tokenType.' closer scope closer token incorrect'); - - if (($opener + 1) !== $closer) { - for ($i = ($opener + 1); $i < $closer; $i++) { - $this->assertArrayHasKey( - $token, - $tokens[$i]['conditions'], - $tokenType.' condition not added for token belonging to the '.$tokenType.' structure' - ); - } - } - - }//end scopeTestHelper() - - - /** - * Helper function to verify that all parenthesis related array indexes for a control structure - * token are set correctly. - * - * @param int $token The position of the control structure token. - * - * @return void - */ - private function parenthesisTestHelper($token) - { - $tokens = self::$phpcsFile->getTokens(); - $tokenArray = $tokens[$token]; - $tokenType = $tokenArray['type']; - - $this->assertArrayHasKey('parenthesis_owner', $tokenArray, 'Parenthesis owner is not set'); - $this->assertArrayHasKey('parenthesis_opener', $tokenArray, 'Parenthesis opener is not set'); - $this->assertArrayHasKey('parenthesis_closer', $tokenArray, 'Parenthesis closer is not set'); - $this->assertSame($token, $tokenArray['parenthesis_owner'], 'Parenthesis owner is not the '.$tokenType.' token'); - - $opener = $tokenArray['parenthesis_opener']; - $this->assertArrayHasKey('parenthesis_owner', $tokens[$opener], 'Opening parenthesis owner is not set'); - $this->assertSame($token, $tokens[$opener]['parenthesis_owner'], 'Opening parenthesis owner is not the '.$tokenType.' token'); - - $closer = $tokenArray['parenthesis_closer']; - $this->assertArrayHasKey('parenthesis_owner', $tokens[$closer], 'Closing parenthesis owner is not set'); - $this->assertSame($token, $tokens[$closer]['parenthesis_owner'], 'Closing parenthesis owner is not the '.$tokenType.' token'); - - }//end parenthesisTestHelper() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillNumericSeparatorTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillNumericSeparatorTest.inc deleted file mode 100644 index eef53f5..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BackfillNumericSeparatorTest.inc +++ /dev/null @@ -1,82 +0,0 @@ - - * @copyright 2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tests\Core\Tokenizer; - -use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest; - -class BackfillNumericSeparatorTest extends AbstractMethodUnitTest -{ - - - /** - * Test that numbers using numeric separators are tokenized correctly. - * - * @param array $testData The data required for the specific test case. - * - * @dataProvider dataTestBackfill - * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize - * - * @return void - */ - public function testBackfill($testData) - { - $tokens = self::$phpcsFile->getTokens(); - $number = $this->getTargetToken($testData['marker'], [T_LNUMBER, T_DNUMBER]); - - $this->assertSame(constant($testData['type']), $tokens[$number]['code']); - $this->assertSame($testData['type'], $tokens[$number]['type']); - $this->assertSame($testData['value'], $tokens[$number]['content']); - - }//end testBackfill() - - - /** - * Data provider. - * - * @see testBackfill() - * - * @return array - */ - public function dataTestBackfill() - { - $testHexType = 'T_LNUMBER'; - if (PHP_INT_MAX < 0xCAFEF00D) { - $testHexType = 'T_DNUMBER'; - } - - $testHexMultipleType = 'T_LNUMBER'; - if (PHP_INT_MAX < 0x42726F776E) { - $testHexMultipleType = 'T_DNUMBER'; - } - - $testIntMoreThanMaxType = 'T_LNUMBER'; - if (PHP_INT_MAX < 10223372036854775807) { - $testIntMoreThanMaxType = 'T_DNUMBER'; - } - - return [ - [ - [ - 'marker' => '/* testSimpleLNumber */', - 'type' => 'T_LNUMBER', - 'value' => '1_000_000_000', - ], - ], - [ - [ - 'marker' => '/* testSimpleDNumber */', - 'type' => 'T_DNUMBER', - 'value' => '107_925_284.88', - ], - ], - [ - [ - 'marker' => '/* testFloat */', - 'type' => 'T_DNUMBER', - 'value' => '6.674_083e-11', - ], - ], - [ - [ - 'marker' => '/* testFloat2 */', - 'type' => 'T_DNUMBER', - 'value' => '6.674_083e+11', - ], - ], - [ - [ - 'marker' => '/* testFloat3 */', - 'type' => 'T_DNUMBER', - 'value' => '1_2.3_4e1_23', - ], - ], - [ - [ - 'marker' => '/* testHex */', - 'type' => $testHexType, - 'value' => '0xCAFE_F00D', - ], - ], - [ - [ - 'marker' => '/* testHexMultiple */', - 'type' => $testHexMultipleType, - 'value' => '0x42_72_6F_77_6E', - ], - ], - [ - [ - 'marker' => '/* testHexInt */', - 'type' => 'T_LNUMBER', - 'value' => '0x42_72_6F', - ], - ], - [ - [ - 'marker' => '/* testBinary */', - 'type' => 'T_LNUMBER', - 'value' => '0b0101_1111', - ], - ], - [ - [ - 'marker' => '/* testOctal */', - 'type' => 'T_LNUMBER', - 'value' => '0137_041', - ], - ], - [ - [ - 'marker' => '/* testIntMoreThanMax */', - 'type' => $testIntMoreThanMaxType, - 'value' => '10_223_372_036_854_775_807', - ], - ], - ]; - - }//end dataTestBackfill() - - - /** - * Test that numbers using numeric separators which are considered parse errors and/or - * which aren't relevant to the backfill, do not incorrectly trigger the backfill anyway. - * - * @param string $testMarker The comment which prefaces the target token in the test file. - * @param array $expectedTokens The token type and content of the expected token sequence. - * - * @dataProvider dataNoBackfill - * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize - * - * @return void - */ - public function testNoBackfill($testMarker, $expectedTokens) - { - $tokens = self::$phpcsFile->getTokens(); - $number = $this->getTargetToken($testMarker, [T_LNUMBER, T_DNUMBER]); - - foreach ($expectedTokens as $key => $expectedToken) { - $i = ($number + $key); - $this->assertSame($expectedToken['code'], $tokens[$i]['code']); - $this->assertSame($expectedToken['content'], $tokens[$i]['content']); - } - - }//end testNoBackfill() - - - /** - * Data provider. - * - * @see testBackfill() - * - * @return array - */ - public function dataNoBackfill() - { - return [ - [ - '/* testInvalid1 */', - [ - [ - 'code' => T_LNUMBER, - 'content' => '100', - ], - [ - 'code' => T_STRING, - 'content' => '_', - ], - ], - ], - [ - '/* testInvalid2 */', - [ - [ - 'code' => T_LNUMBER, - 'content' => '1', - ], - [ - 'code' => T_STRING, - 'content' => '__1', - ], - ], - ], - [ - '/* testInvalid3 */', - [ - [ - 'code' => T_LNUMBER, - 'content' => '1', - ], - [ - 'code' => T_STRING, - 'content' => '_', - ], - [ - 'code' => T_DNUMBER, - 'content' => '.0', - ], - ], - ], - [ - '/* testInvalid4 */', - [ - [ - 'code' => T_DNUMBER, - 'content' => '1.', - ], - [ - 'code' => T_STRING, - 'content' => '_0', - ], - ], - ], - [ - '/* testInvalid5 */', - [ - [ - 'code' => T_LNUMBER, - 'content' => '0', - ], - [ - 'code' => T_STRING, - 'content' => 'x_123', - ], - ], - ], - [ - '/* testInvalid6 */', - [ - [ - 'code' => T_LNUMBER, - 'content' => '0', - ], - [ - 'code' => T_STRING, - 'content' => 'b_101', - ], - ], - ], - [ - '/* testInvalid7 */', - [ - [ - 'code' => T_LNUMBER, - 'content' => '1', - ], - [ - 'code' => T_STRING, - 'content' => '_e2', - ], - ], - ], - [ - '/* testInvalid8 */', - [ - [ - 'code' => T_LNUMBER, - 'content' => '1', - ], - [ - 'code' => T_STRING, - 'content' => 'e_2', - ], - ], - ], - [ - '/* testInvalid9 */', - [ - [ - 'code' => T_LNUMBER, - 'content' => '107_925_284', - ], - [ - 'code' => T_WHITESPACE, - 'content' => ' ', - ], - [ - 'code' => T_DNUMBER, - 'content' => '.88', - ], - ], - ], - [ - '/* testInvalid10 */', - [ - [ - 'code' => T_LNUMBER, - 'content' => '107_925_284', - ], - [ - 'code' => T_COMMENT, - 'content' => '/*comment*/', - ], - [ - 'code' => T_DNUMBER, - 'content' => '.88', - ], - ], - ], - [ - '/* testCalc1 */', - [ - [ - 'code' => T_LNUMBER, - 'content' => '667_083', - ], - [ - 'code' => T_WHITESPACE, - 'content' => ' ', - ], - [ - 'code' => T_MINUS, - 'content' => '-', - ], - [ - 'code' => T_WHITESPACE, - 'content' => ' ', - ], - [ - 'code' => T_LNUMBER, - 'content' => '11', - ], - ], - ], - [ - '/* test Calc2 */', - [ - [ - 'code' => T_DNUMBER, - 'content' => '6.674_08e3', - ], - [ - 'code' => T_WHITESPACE, - 'content' => ' ', - ], - [ - 'code' => T_PLUS, - 'content' => '+', - ], - [ - 'code' => T_WHITESPACE, - 'content' => ' ', - ], - [ - 'code' => T_LNUMBER, - 'content' => '11', - ], - ], - ], - ]; - - }//end dataNoBackfill() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BitwiseOrTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BitwiseOrTest.inc deleted file mode 100644 index 2af0eca..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BitwiseOrTest.inc +++ /dev/null @@ -1,119 +0,0 @@ - $param | $int; - -/* testTypeUnionArrowReturnType */ -$arrowWithReturnType = fn ($param) : int|null => $param * 10; - -/* testBitwiseOrInArrayKey */ -$array = array( - A | B => /* testBitwiseOrInArrayValue */ B | C -); - -/* testBitwiseOrInShortArrayKey */ -$array = [ - A | B => /* testBitwiseOrInShortArrayValue */ B | C -]; - -/* testBitwiseOrTryCatch */ -try { -} catch ( ExceptionA | ExceptionB $e ) { -} - -/* testBitwiseOrNonArrowFnFunctionCall */ -$obj->fn($something | $else); - -/* testTypeUnionNonArrowFunctionDeclaration */ -function &fn(int|false $something) {} - -/* testLiveCoding */ -// Intentional parse error. This has to be the last test in the file. -return function( type| diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BitwiseOrTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BitwiseOrTest.php deleted file mode 100644 index d4a27bd..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/BitwiseOrTest.php +++ /dev/null @@ -1,133 +0,0 @@ - - * @copyright 2020 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tests\Core\Tokenizer; - -use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest; - -class BitwiseOrTest extends AbstractMethodUnitTest -{ - - - /** - * Test that non-union type bitwise or tokens are still tokenized as bitwise or. - * - * @param string $testMarker The comment which prefaces the target token in the test file. - * - * @dataProvider dataBitwiseOr - * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional - * - * @return void - */ - public function testBitwiseOr($testMarker) - { - $tokens = self::$phpcsFile->getTokens(); - - $opener = $this->getTargetToken($testMarker, [T_BITWISE_OR, T_TYPE_UNION]); - $this->assertSame(T_BITWISE_OR, $tokens[$opener]['code']); - $this->assertSame('T_BITWISE_OR', $tokens[$opener]['type']); - - }//end testBitwiseOr() - - - /** - * Data provider. - * - * @see testBitwiseOr() - * - * @return array - */ - public function dataBitwiseOr() - { - return [ - ['/* testBitwiseOr1 */'], - ['/* testBitwiseOr2 */'], - ['/* testBitwiseOrPropertyDefaultValue */'], - ['/* testBitwiseOrParamDefaultValue */'], - ['/* testBitwiseOr3 */'], - ['/* testBitwiseOrClosureParamDefault */'], - ['/* testBitwiseOrArrowParamDefault */'], - ['/* testBitwiseOrArrowExpression */'], - ['/* testBitwiseOrInArrayKey */'], - ['/* testBitwiseOrInArrayValue */'], - ['/* testBitwiseOrInShortArrayKey */'], - ['/* testBitwiseOrInShortArrayValue */'], - ['/* testBitwiseOrTryCatch */'], - ['/* testBitwiseOrNonArrowFnFunctionCall */'], - ['/* testLiveCoding */'], - ]; - - }//end dataBitwiseOr() - - - /** - * Test that bitwise or tokens when used as part of a union type are tokenized as `T_TYPE_UNION`. - * - * @param string $testMarker The comment which prefaces the target token in the test file. - * - * @dataProvider dataTypeUnion - * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional - * - * @return void - */ - public function testTypeUnion($testMarker) - { - $tokens = self::$phpcsFile->getTokens(); - - $opener = $this->getTargetToken($testMarker, [T_BITWISE_OR, T_TYPE_UNION]); - $this->assertSame(T_TYPE_UNION, $tokens[$opener]['code']); - $this->assertSame('T_TYPE_UNION', $tokens[$opener]['type']); - - }//end testTypeUnion() - - - /** - * Data provider. - * - * @see testTypeUnion() - * - * @return array - */ - public function dataTypeUnion() - { - return [ - ['/* testTypeUnionPropertySimple */'], - ['/* testTypeUnionPropertyReverseModifierOrder */'], - ['/* testTypeUnionPropertyMulti1 */'], - ['/* testTypeUnionPropertyMulti2 */'], - ['/* testTypeUnionPropertyMulti3 */'], - ['/* testTypeUnionPropertyNamespaceRelative */'], - ['/* testTypeUnionPropertyPartiallyQualified */'], - ['/* testTypeUnionPropertyFullyQualified */'], - ['/* testTypeUnionParam1 */'], - ['/* testTypeUnionParam2 */'], - ['/* testTypeUnionParam3 */'], - ['/* testTypeUnionParamNamespaceRelative */'], - ['/* testTypeUnionParamPartiallyQualified */'], - ['/* testTypeUnionParamFullyQualified */'], - ['/* testTypeUnionReturnType */'], - ['/* testTypeUnionConstructorPropertyPromotion */'], - ['/* testTypeUnionAbstractMethodReturnType1 */'], - ['/* testTypeUnionAbstractMethodReturnType2 */'], - ['/* testTypeUnionReturnTypeNamespaceRelative */'], - ['/* testTypeUnionReturnPartiallyQualified */'], - ['/* testTypeUnionReturnFullyQualified */'], - ['/* testTypeUnionClosureParamIllegalNullable */'], - ['/* testTypeUnionWithReference */'], - ['/* testTypeUnionWithSpreadOperator */'], - ['/* testTypeUnionClosureReturn */'], - ['/* testTypeUnionArrowParam */'], - ['/* testTypeUnionArrowReturnType */'], - ['/* testTypeUnionNonArrowFunctionDeclaration */'], - ]; - - }//end dataTypeUnion() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/DefaultKeywordTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/DefaultKeywordTest.inc deleted file mode 100644 index 648149d..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/DefaultKeywordTest.inc +++ /dev/null @@ -1,203 +0,0 @@ - 1, - 2 => 2, - /* testSimpleMatchDefault */ - default => 'default', - }; -} - -function switchWithDefault($i) { - switch ($i) { - case 1: - return 1; - case 2: - return 2; - /* testSimpleSwitchDefault */ - default: - return 'default'; - } -} - -function switchWithDefaultAndCurlies($i) { - switch ($i) { - case 1: - return 1; - case 2: - return 2; - /* testSimpleSwitchDefaultWithCurlies */ - default: { - return 'default'; - } - } -} - -function matchWithDefaultInSwitch() { - switch ($something) { - case 'foo': - $var = [1, 2, 3]; - $var = match ($i) { - 1 => 1, - /* testMatchDefaultNestedInSwitchCase1 */ - default => 'default', - }; - continue; - - case 'bar' : - $i = callMe($a, $b); - return match ($i) { - 1 => 1, - /* testMatchDefaultNestedInSwitchCase2 */ - default => 'default', - }; - - /* testSwitchDefault */ - default; - echo 'something', match ($i) { - 1, => 1, - /* testMatchDefaultNestedInSwitchDefault */ - default, => 'default', - }; - break; - } -} - -function switchWithDefaultInMatch() { - $x = match ($y) { - 5, 8 => function($z) { - switch($z) { - case 'a'; - $var = [1, 2, 3]; - return 'a'; - /* testSwitchDefaultNestedInMatchCase */ - default: - $var = [1, 2, 3]; - return 'default1'; - } - }, - /* testMatchDefault */ - default => function($z) { - switch($z) { - case 'a': - $i = callMe($a, $b); - return 'b'; - /* testSwitchDefaultNestedInMatchDefault */ - default: - $i = callMe($a, $b); - return 'default2'; - } - } - }; -} - -function shortArrayWithConstantKey() { - $arr = [ - /* testClassConstantAsShortArrayKey */ - SomeClass::DEFAULT => 1, - /* testClassPropertyAsShortArrayKey */ - SomeClass->DEFAULT => 1, - /* testNamespacedConstantAsShortArrayKey */ - // Intentional parse error PHP < 8.0. Reserved keyword used as namespaced constant. - SomeNamespace\DEFAULT => 1, - /* testFQNGlobalConstantAsShortArrayKey */ - // Intentional parse error in PHP < 8.0. Reserved keyword used as global constant. - \DEFAULT => 1, - ]; -} - -function longArrayWithConstantKey() { - $arr = array( - /* testClassConstantAsLongArrayKey */ - SomeClass::DEFAULT => 1, - ); -} - -function yieldWithConstantKey() { - /* testClassConstantAsYieldKey */ - yield SomeClass::DEFAULT => 1; -} - -function longArrayWithConstantKeyNestedInMatch() { - return match($x) { - /* testMatchDefaultWithNestedLongArrayWithClassConstantKey */ - DEFAULT => array( - /* testClassConstantAsLongArrayKeyNestedInMatch */ - SomeClass::DEFAULT => match($x) { - /* testMatchDefaultWithNestedLongArrayWithClassConstantKeyLevelDown */ - DEFAULT => array( - /* testClassConstantAsLongArrayKeyNestedInMatchLevelDown */ - SomeClass::DEFAULT => 1, - ), - }, - ), - }; -} - -function shortArrayWithConstantKeyNestedInMatch() { - return match($x) { - /* testMatchDefaultWithNestedShortArrayWithClassConstantKey */ - DEFAULT => [ - /* testClassConstantAsShortArrayKeyNestedInMatch */ - SomeClass::DEFAULT => match($x) { - /* testMatchDefaultWithNestedShortArrayWithClassConstantKeyLevelDown */ - DEFAULT => [ - /* testClassConstantAsShortArrayKeyNestedInMatchLevelDown */ - SomeClass::DEFAULT => 1, - ], - }, - ], - }; -} - - -function longArrayWithConstantKeyWithNestedMatch() { - return array( - /* testClassConstantAsLongArrayKeyWithNestedMatch */ - SomeClass::DEFAULT => match($x) { - /* testMatchDefaultNestedInLongArray */ - DEFAULT => 'foo' - }, - ); -} - -function shortArrayWithConstantKeyWithNestedMatch() { - return [ - /* testClassConstantAsShortArrayKeyWithNestedMatch */ - SomeClass::DEFAULT => match($x) { - /* testMatchDefaultNestedInShortArray */ - DEFAULT => 'foo' - }, - ]; -} - -function switchWithConstantNonDefault($i) { - switch ($i) { - /* testClassConstantInSwitchCase */ - case SomeClass::DEFAULT: - return 1; - - /* testClassPropertyInSwitchCase */ - case SomeClass->DEFAULT: - return 2; - - /* testNamespacedConstantInSwitchCase */ - // Intentional parse error PHP < 8.0. Reserved keyword used as constant. - case SomeNamespace\DEFAULT: - return 2; - - /* testNamespaceRelativeConstantInSwitchCase */ - // Intentional parse error PHP < 8.0. Reserved keyword used as global constant. - case namespace\DEFAULT: - return 2; - } -} - -class Foo { - /* testClassConstant */ - const DEFAULT = 'foo'; - - /* testMethodDeclaration */ - public function default() {} -} diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/DefaultKeywordTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/DefaultKeywordTest.php deleted file mode 100644 index 9a5b061..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/DefaultKeywordTest.php +++ /dev/null @@ -1,302 +0,0 @@ - - * @copyright 2020-2021 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tests\Core\Tokenizer; - -use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest; - -class DefaultKeywordTest extends AbstractMethodUnitTest -{ - - - /** - * Test the retokenization of the `default` keyword for match structure to `T_MATCH_DEFAULT`. - * - * Note: Cases and default structures within a match structure do *NOT* get case/default scope - * conditions, in contrast to case and default structures in switch control structures. - * - * @param string $testMarker The comment prefacing the target token. - * @param string $testContent The token content to look for. - * - * @dataProvider dataMatchDefault - * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize - * @covers PHP_CodeSniffer\Tokenizers\Tokenizer::recurseScopeMap - * - * @return void - */ - public function testMatchDefault($testMarker, $testContent='default') - { - $tokens = self::$phpcsFile->getTokens(); - - $token = $this->getTargetToken($testMarker, [T_MATCH_DEFAULT, T_DEFAULT, T_STRING], $testContent); - $tokenArray = $tokens[$token]; - - $this->assertSame(T_MATCH_DEFAULT, $tokenArray['code'], 'Token tokenized as '.$tokenArray['type'].', not T_MATCH_DEFAULT (code)'); - $this->assertSame('T_MATCH_DEFAULT', $tokenArray['type'], 'Token tokenized as '.$tokenArray['type'].', not T_MATCH_DEFAULT (type)'); - - $this->assertArrayNotHasKey('scope_condition', $tokenArray, 'Scope condition is set'); - $this->assertArrayNotHasKey('scope_opener', $tokenArray, 'Scope opener is set'); - $this->assertArrayNotHasKey('scope_closer', $tokenArray, 'Scope closer is set'); - - }//end testMatchDefault() - - - /** - * Data provider. - * - * @see testMatchDefault() - * - * @return array - */ - public function dataMatchDefault() - { - return [ - 'simple_match_default' => ['/* testSimpleMatchDefault */'], - 'match_default_in_switch_case_1' => ['/* testMatchDefaultNestedInSwitchCase1 */'], - 'match_default_in_switch_case_2' => ['/* testMatchDefaultNestedInSwitchCase2 */'], - 'match_default_in_switch_default' => ['/* testMatchDefaultNestedInSwitchDefault */'], - 'match_default_containing_switch' => ['/* testMatchDefault */'], - - 'match_default_with_nested_long_array_and_default_key' => [ - '/* testMatchDefaultWithNestedLongArrayWithClassConstantKey */', - 'DEFAULT', - ], - 'match_default_with_nested_long_array_and_default_key_2' => [ - '/* testMatchDefaultWithNestedLongArrayWithClassConstantKeyLevelDown */', - 'DEFAULT', - ], - 'match_default_with_nested_short_array_and_default_key' => [ - '/* testMatchDefaultWithNestedShortArrayWithClassConstantKey */', - 'DEFAULT', - ], - 'match_default_with_nested_short_array_and_default_key_2' => [ - '/* testMatchDefaultWithNestedShortArrayWithClassConstantKeyLevelDown */', - 'DEFAULT', - ], - 'match_default_in_long_array' => [ - '/* testMatchDefaultNestedInLongArray */', - 'DEFAULT', - ], - 'match_default_in_short_array' => [ - '/* testMatchDefaultNestedInShortArray */', - 'DEFAULT', - ], - ]; - - }//end dataMatchDefault() - - - /** - * Verify that the retokenization of `T_DEFAULT` tokens in match constructs, doesn't negatively - * impact the tokenization of `T_DEFAULT` tokens in switch control structures. - * - * Note: Cases and default structures within a switch control structure *do* get case/default scope - * conditions. - * - * @param string $testMarker The comment prefacing the target token. - * @param int $openerOffset The expected offset of the scope opener in relation to the testMarker. - * @param int $closerOffset The expected offset of the scope closer in relation to the testMarker. - * @param int|null $conditionStop The expected offset at which tokens stop having T_DEFAULT as a scope condition. - * @param string $testContent The token content to look for. - * - * @dataProvider dataSwitchDefault - * @covers PHP_CodeSniffer\Tokenizers\Tokenizer::recurseScopeMap - * - * @return void - */ - public function testSwitchDefault($testMarker, $openerOffset, $closerOffset, $conditionStop=null, $testContent='default') - { - $tokens = self::$phpcsFile->getTokens(); - - $token = $this->getTargetToken($testMarker, [T_MATCH_DEFAULT, T_DEFAULT, T_STRING], $testContent); - $tokenArray = $tokens[$token]; - $expectedScopeOpener = ($token + $openerOffset); - $expectedScopeCloser = ($token + $closerOffset); - - $this->assertSame(T_DEFAULT, $tokenArray['code'], 'Token tokenized as '.$tokenArray['type'].', not T_DEFAULT (code)'); - $this->assertSame('T_DEFAULT', $tokenArray['type'], 'Token tokenized as '.$tokenArray['type'].', not T_DEFAULT (type)'); - - $this->assertArrayHasKey('scope_condition', $tokenArray, 'Scope condition is not set'); - $this->assertArrayHasKey('scope_opener', $tokenArray, 'Scope opener is not set'); - $this->assertArrayHasKey('scope_closer', $tokenArray, 'Scope closer is not set'); - $this->assertSame($token, $tokenArray['scope_condition'], 'Scope condition is not the T_DEFAULT token'); - $this->assertSame($expectedScopeOpener, $tokenArray['scope_opener'], 'Scope opener of the T_DEFAULT token incorrect'); - $this->assertSame($expectedScopeCloser, $tokenArray['scope_closer'], 'Scope closer of the T_DEFAULT token incorrect'); - - $opener = $tokenArray['scope_opener']; - $this->assertArrayHasKey('scope_condition', $tokens[$opener], 'Opener scope condition is not set'); - $this->assertArrayHasKey('scope_opener', $tokens[$opener], 'Opener scope opener is not set'); - $this->assertArrayHasKey('scope_closer', $tokens[$opener], 'Opener scope closer is not set'); - $this->assertSame($token, $tokens[$opener]['scope_condition'], 'Opener scope condition is not the T_DEFAULT token'); - $this->assertSame($expectedScopeOpener, $tokens[$opener]['scope_opener'], 'T_DEFAULT opener scope opener token incorrect'); - $this->assertSame($expectedScopeCloser, $tokens[$opener]['scope_closer'], 'T_DEFAULT opener scope closer token incorrect'); - - $closer = $tokenArray['scope_closer']; - $this->assertArrayHasKey('scope_condition', $tokens[$closer], 'Closer scope condition is not set'); - $this->assertArrayHasKey('scope_opener', $tokens[$closer], 'Closer scope opener is not set'); - $this->assertArrayHasKey('scope_closer', $tokens[$closer], 'Closer scope closer is not set'); - $this->assertSame($token, $tokens[$closer]['scope_condition'], 'Closer scope condition is not the T_DEFAULT token'); - $this->assertSame($expectedScopeOpener, $tokens[$closer]['scope_opener'], 'T_DEFAULT closer scope opener token incorrect'); - $this->assertSame($expectedScopeCloser, $tokens[$closer]['scope_closer'], 'T_DEFAULT closer scope closer token incorrect'); - - if (($opener + 1) !== $closer) { - $end = $closer; - if (isset($conditionStop) === true) { - $end = $conditionStop; - } - - for ($i = ($opener + 1); $i < $end; $i++) { - $this->assertArrayHasKey( - $token, - $tokens[$i]['conditions'], - 'T_DEFAULT condition not added for token belonging to the T_DEFAULT structure' - ); - } - } - - }//end testSwitchDefault() - - - /** - * Data provider. - * - * @see testSwitchDefault() - * - * @return array - */ - public function dataSwitchDefault() - { - return [ - 'simple_switch_default' => [ - '/* testSimpleSwitchDefault */', - 1, - 4, - ], - 'simple_switch_default_with_curlies' => [ - // For a default structure with curly braces, the scope opener - // will be the open curly and the closer the close curly. - // However, scope conditions will not be set for open to close, - // but only for the open token up to the "break/return/continue" etc. - '/* testSimpleSwitchDefaultWithCurlies */', - 3, - 12, - 6, - ], - 'switch_default_toplevel' => [ - '/* testSwitchDefault */', - 1, - 43, - ], - 'switch_default_nested_in_match_case' => [ - '/* testSwitchDefaultNestedInMatchCase */', - 1, - 20, - ], - 'switch_default_nested_in_match_default' => [ - '/* testSwitchDefaultNestedInMatchDefault */', - 1, - 18, - ], - ]; - - }//end dataSwitchDefault() - - - /** - * Verify that the retokenization of `T_DEFAULT` tokens in match constructs, doesn't negatively - * impact the tokenization of `T_STRING` tokens with the contents 'default' which aren't in - * actual fact the default keyword. - * - * @param string $testMarker The comment prefacing the target token. - * @param string $testContent The token content to look for. - * - * @dataProvider dataNotDefaultKeyword - * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional - * - * @return void - */ - public function testNotDefaultKeyword($testMarker, $testContent='DEFAULT') - { - $tokens = self::$phpcsFile->getTokens(); - - $token = $this->getTargetToken($testMarker, [T_MATCH_DEFAULT, T_DEFAULT, T_STRING], $testContent); - $tokenArray = $tokens[$token]; - - $this->assertSame(T_STRING, $tokenArray['code'], 'Token tokenized as '.$tokenArray['type'].', not T_STRING (code)'); - $this->assertSame('T_STRING', $tokenArray['type'], 'Token tokenized as '.$tokenArray['type'].', not T_STRING (type)'); - - $this->assertArrayNotHasKey('scope_condition', $tokenArray, 'Scope condition is set'); - $this->assertArrayNotHasKey('scope_opener', $tokenArray, 'Scope opener is set'); - $this->assertArrayNotHasKey('scope_closer', $tokenArray, 'Scope closer is set'); - - }//end testNotDefaultKeyword() - - - /** - * Data provider. - * - * @see testNotDefaultKeyword() - * - * @return array - */ - public function dataNotDefaultKeyword() - { - return [ - 'class-constant-as-short-array-key' => ['/* testClassConstantAsShortArrayKey */'], - 'class-property-as-short-array-key' => ['/* testClassPropertyAsShortArrayKey */'], - 'namespaced-constant-as-short-array-key' => ['/* testNamespacedConstantAsShortArrayKey */'], - 'fqn-global-constant-as-short-array-key' => ['/* testFQNGlobalConstantAsShortArrayKey */'], - 'class-constant-as-long-array-key' => ['/* testClassConstantAsLongArrayKey */'], - 'class-constant-as-yield-key' => ['/* testClassConstantAsYieldKey */'], - - 'class-constant-as-long-array-key-nested-in-match' => ['/* testClassConstantAsLongArrayKeyNestedInMatch */'], - 'class-constant-as-long-array-key-nested-in-match-2' => ['/* testClassConstantAsLongArrayKeyNestedInMatchLevelDown */'], - 'class-constant-as-short-array-key-nested-in-match' => ['/* testClassConstantAsShortArrayKeyNestedInMatch */'], - 'class-constant-as-short-array-key-nested-in-match-2' => ['/* testClassConstantAsShortArrayKeyNestedInMatchLevelDown */'], - 'class-constant-as-long-array-key-with-nested-match' => ['/* testClassConstantAsLongArrayKeyWithNestedMatch */'], - 'class-constant-as-short-array-key-with-nested-match' => ['/* testClassConstantAsShortArrayKeyWithNestedMatch */'], - - 'class-constant-in-switch-case' => ['/* testClassConstantInSwitchCase */'], - 'class-property-in-switch-case' => ['/* testClassPropertyInSwitchCase */'], - 'namespaced-constant-in-switch-case' => ['/* testNamespacedConstantInSwitchCase */'], - 'namespace-relative-constant-in-switch-case' => ['/* testNamespaceRelativeConstantInSwitchCase */'], - - 'class-constant-declaration' => ['/* testClassConstant */'], - 'class-method-declaration' => [ - '/* testMethodDeclaration */', - 'default', - ], - ]; - - }//end dataNotDefaultKeyword() - - - /** - * Test a specific edge case where a scope opener would be incorrectly set. - * - * @link https://github.com/squizlabs/PHP_CodeSniffer/issues/3326 - * - * @return void - */ - public function testIssue3326() - { - $tokens = self::$phpcsFile->getTokens(); - - $token = $this->getTargetToken('/* testClassConstant */', [T_SEMICOLON]); - $tokenArray = $tokens[$token]; - - $this->assertArrayNotHasKey('scope_condition', $tokenArray, 'Scope condition is set'); - $this->assertArrayNotHasKey('scope_opener', $tokenArray, 'Scope opener is set'); - $this->assertArrayNotHasKey('scope_closer', $tokenArray, 'Scope closer is set'); - - }//end testIssue3326() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/DoubleArrowTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/DoubleArrowTest.inc deleted file mode 100644 index b67b066..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/DoubleArrowTest.inc +++ /dev/null @@ -1,281 +0,0 @@ - 'Zero', - ); -} - -function simpleShortArray($x) { - return [ - /* testShortArrayArrowSimple */ - 0 => 'Zero', - ]; -} - -function simpleLongList($x) { - list( - /* testLongListArrowSimple */ - 0 => $a, - ) = $x; -} - -function simpleShortList($x) { - [ - /* testShortListArrowSimple */ - 0 => $a, - ] = $x; -} - -function simpleYield($x) { - $i = 0; - foreach (explode("\n", $x) as $line) { - /* testYieldArrowSimple */ - yield ++$i => $line; - } -} - -function simpleForeach($x) { - /* testForeachArrowSimple */ - foreach ($x as $k => $value) {} -} - -function simpleMatch($x) { - return match ($x) { - /* testMatchArrowSimpleSingleCase */ - 0 => 'Zero', - /* testMatchArrowSimpleMultiCase */ - 2, 4, 6 => 'Zero', - /* testMatchArrowSimpleSingleCaseWithTrailingComma */ - 1, => 'Zero', - /* testMatchArrowSimpleMultiCaseWithTrailingComma */ - 3, 5, => 'Zero', - }; -} - -function simpleArrowFunction($y) { - /* testFnArrowSimple */ - return fn ($y) => callMe($y); -} - -function matchNestedInMatch() { - $x = match ($y) { - /* testMatchArrowNestedMatchOuter */ - default, => match ($z) { - /* testMatchArrowNestedMatchInner */ - 1 => 1 - }, - }; -} - -function matchNestedInLongArrayValue() { - $array = array( - /* testLongArrayArrowWithNestedMatchValue1 */ - 'a' => match ($test) { - /* testMatchArrowInLongArrayValue1 */ - 1 => 'a', - /* testMatchArrowInLongArrayValue2 */ - 2 => 'b' - }, - /* testLongArrayArrowWithNestedMatchValue2 */ - $i => match ($test) { - /* testMatchArrowInLongArrayValue3 */ - 1 => 'a', - }, - ); -} - -function matchNestedInShortArrayValue() { - $array = [ - /* testShortArrayArrowWithNestedMatchValue1 */ - 'a' => match ($test) { - /* testMatchArrowInShortArrayValue1 */ - 1 => 'a', - /* testMatchArrowInShortArrayValue2 */ - 2 => 'b' - }, - /* testShortArrayArrowWithNestedMatchValue2 */ - $i => match ($test) { - /* testMatchArrowInShortArrayValue3 */ - 1 => 'a', - }, - ]; -} - -function matchNestedInLongArrayKey() { - $array = array( - match ($test) { /* testMatchArrowInLongArrayKey1 */ 1 => 'a', /* testMatchArrowInLongArrayKey2 */ 2 => 'b' } - /* testLongArrayArrowWithMatchKey */ - => 'dynamic keys, woho!', - ); -} - -function matchNestedInShortArrayKey() { - $array = [ - match ($test) { /* testMatchArrowInShortArrayKey1 */ 1 => 'a', /* testMatchArrowInShortArrayKey2 */ 2 => 'b' } - /* testShortArrayArrowWithMatchKey */ - => 'dynamic keys, woho!', - ]; -} - -function arraysNestedInMatch() { - $matcher = match ($x) { - /* testMatchArrowWithLongArrayBodyWithKeys */ - 0 => array( - /* testLongArrayArrowInMatchBody1 */ - 0 => 1, - /* testLongArrayArrowInMatchBody2 */ - 'a' => 2, - /* testLongArrayArrowInMatchBody3 */ - 'b' => 3 - ), - /* testMatchArrowWithShortArrayBodyWithoutKeys */ - 1 => [1, 2, 3], - /* testMatchArrowWithLongArrayBodyWithoutKeys */ - 2 => array( 1, [1, 2, 3], 2, 3), - /* testMatchArrowWithShortArrayBodyWithKeys */ - 3 => [ - /* testShortArrayArrowInMatchBody1 */ - 0 => 1, - /* testShortArrayArrowInMatchBody2 */ - 'a' => array(1, 2, 3), - /* testShortArrayArrowInMatchBody3 */ - 'b' => 2, - 3 - ], - /* testShortArrayArrowinMatchCase1 */ - [4 => 'a', /* testShortArrayArrowinMatchCase2 */ 5 => 6] - /* testMatchArrowWithShortArrayWithKeysAsCase */ - => 'match with array as case value', - /* testShortArrayArrowinMatchCase3 */ - [4 => 'a'], /* testLongArrayArrowinMatchCase4 */ array(5 => 6), - /* testMatchArrowWithMultipleArraysWithKeysAsCase */ - => 'match with multiple arrays as case value', - }; -} - -function matchNestedInArrowFunction($x) { - /* testFnArrowWithMatchInValue */ - $fn = fn($x) => match(true) { - /* testMatchArrowInFnBody1 */ - 1, 2, 3, 4, 5 => 'foo', - /* testMatchArrowInFnBody2 */ - default => 'bar', - }; -} - -function arrowFunctionsNestedInMatch($x) { - return match ($x) { - /* testMatchArrowWithFnBody1 */ - 1 => /* testFnArrowInMatchBody1 */ fn($y) => callMe($y), - /* testMatchArrowWithFnBody2 */ - default => /* testFnArrowInMatchBody2 */ fn($y) => callThem($y) - }; -} - -function matchShortArrayMismash() { - $array = [ - match ($test) { - /* testMatchArrowInComplexShortArrayKey1 */ - 1 => [ /* testShortArrayArrowInComplexMatchValueinShortArrayKey */ 1 => 'a'], - /* testMatchArrowInComplexShortArrayKey2 */ - 2 => 'b' - /* testShortArrayArrowInComplexMatchArrayMismash */ - } => match ($test) { - /* testMatchArrowInComplexShortArrayValue1 */ - 1 => [ /* testShortArrayArrowInComplexMatchValueinShortArrayValue */ 1 => 'a'], - /* testMatchArrowInComplexShortArrayValue2 */ - 2 => /* testFnArrowInComplexMatchValueInShortArrayValue */ fn($y) => callMe($y) - }, - ]; -} - - -function longListInMatch($x, $y) { - return match($x) { - /* testMatchArrowWithLongListBody */ - 1 => list('a' => $a, /* testLongListArrowInMatchBody */ 'b' => $b, 'c' => list('d' => $c)) = $y, - /* testLongListArrowInMatchCase */ - list('a' => $a, 'b' => $b) = $y /* testMatchArrowWithLongListInCase */ => 'something' - }; -} - -function shortListInMatch($x, $y) { - return match($x) { - /* testMatchArrowWithShortListBody */ - 1 => ['a' => $a, 'b' => $b, 'c' => /* testShortListArrowInMatchBody */ ['d' => $c]] = $y, - /* testShortListArrowInMatchCase */ - ['a' => $a, 'b' => $b] = $y /* testMatchArrowWithShortListInCase */ => 'something' - }; -} - -function matchInLongList() { - /* testMatchArrowInLongListKey */ - list(match($x) {1 => 1, 2 => 2} /* testLongListArrowWithMatchInKey */ => $a) = $array; -} - -function matchInShortList() { - /* testMatchArrowInShortListKey */ - [match($x) {1 => 1, 2 => 2} /* testShortListArrowWithMatchInKey */ => $a] = $array; -} - -function longArrayWithConstantKey() { - $arr = array( - /* testLongArrayArrowWithClassConstantKey */ - SomeClass::DEFAULT => 1, - ); -} - -function shortArrayWithConstantKey() { - $arr = [ - /* testShortArrayArrowWithClassConstantKey */ - SomeClass::DEFAULT => 1, - ]; -} - -function yieldWithConstantKey() { - /* testYieldArrowWithClassConstantKey */ - yield SomeClass::DEFAULT => 1; -} - -function longArrayWithConstantKeyNestedInMatch() { - return match($x) { - /* testMatchArrowWithNestedLongArrayWithClassConstantKey */ - default => array( - /* testLongArrayArrowWithClassConstantKeyNestedInMatch */ - SomeClass::DEFAULT => 1, - ), - }; -} - -function shortArrayWithConstantKeyNestedInMatch() { - return match($x) { - /* testMatchArrowWithNestedShortArrayWithClassConstantKey */ - default => [ - /* testShortArrayArrowWithClassConstantKeyNestedInMatch */ - SomeClass::DEFAULT => 1, - ], - }; -} - - -function longArrayWithConstantKeyWithNestedMatch() { - return array( - /* testLongArrayArrowWithClassConstantKeyWithNestedMatch */ - SomeClass::DEFAULT => match($x) { - /* testMatchArrowNestedInLongArrayWithClassConstantKey */ - default => 'foo' - }, - ); -} - -function shortArrayWithConstantKeyWithNestedMatch() { - return [ - /* testShortArrayArrowWithClassConstantKeyWithNestedMatch */ - SomeClass::DEFAULT => match($x) { - /* testMatchArrowNestedInShortArrayWithClassConstantKey */ - default => 'foo' - }, - ]; -} diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/DoubleArrowTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/DoubleArrowTest.php deleted file mode 100644 index ad1a411..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/DoubleArrowTest.php +++ /dev/null @@ -1,237 +0,0 @@ - - * @copyright 2020-2021 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tests\Core\Tokenizer; - -use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest; - -class DoubleArrowTest extends AbstractMethodUnitTest -{ - - - /** - * Test that "normal" double arrows are correctly tokenized as `T_DOUBLE_ARROW`. - * - * @param string $testMarker The comment prefacing the target token. - * - * @dataProvider dataDoubleArrow - * @coversNothing - * - * @return void - */ - public function testDoubleArrow($testMarker) - { - $tokens = self::$phpcsFile->getTokens(); - - $token = $this->getTargetToken($testMarker, [T_DOUBLE_ARROW, T_MATCH_ARROW, T_FN_ARROW]); - $tokenArray = $tokens[$token]; - - $this->assertSame(T_DOUBLE_ARROW, $tokenArray['code'], 'Token tokenized as '.$tokenArray['type'].', not T_DOUBLE_ARROW (code)'); - $this->assertSame('T_DOUBLE_ARROW', $tokenArray['type'], 'Token tokenized as '.$tokenArray['type'].', not T_DOUBLE_ARROW (type)'); - - }//end testDoubleArrow() - - - /** - * Data provider. - * - * @see testDoubleArrow() - * - * @return array - */ - public function dataDoubleArrow() - { - return [ - 'simple_long_array' => ['/* testLongArrayArrowSimple */'], - 'simple_short_array' => ['/* testShortArrayArrowSimple */'], - 'simple_long_list' => ['/* testLongListArrowSimple */'], - 'simple_short_list' => ['/* testShortListArrowSimple */'], - 'simple_yield' => ['/* testYieldArrowSimple */'], - 'simple_foreach' => ['/* testForeachArrowSimple */'], - - 'long_array_with_match_value_1' => ['/* testLongArrayArrowWithNestedMatchValue1 */'], - 'long_array_with_match_value_2' => ['/* testLongArrayArrowWithNestedMatchValue2 */'], - 'short_array_with_match_value_1' => ['/* testShortArrayArrowWithNestedMatchValue1 */'], - 'short_array_with_match_value_2' => ['/* testShortArrayArrowWithNestedMatchValue2 */'], - - 'long_array_with_match_key' => ['/* testLongArrayArrowWithMatchKey */'], - 'short_array_with_match_key' => ['/* testShortArrayArrowWithMatchKey */'], - - 'long_array_in_match_body_1' => ['/* testLongArrayArrowInMatchBody1 */'], - 'long_array_in_match_body_2' => ['/* testLongArrayArrowInMatchBody2 */'], - 'long_array_in_match_body_3' => ['/* testLongArrayArrowInMatchBody3 */'], - 'short_array_in_match_body_1' => ['/* testShortArrayArrowInMatchBody1 */'], - 'short_array_in_match_body_2' => ['/* testShortArrayArrowInMatchBody2 */'], - 'short_array_in_match_body_3' => ['/* testShortArrayArrowInMatchBody3 */'], - - 'short_array_in_match_case_1' => ['/* testShortArrayArrowinMatchCase1 */'], - 'short_array_in_match_case_2' => ['/* testShortArrayArrowinMatchCase2 */'], - 'short_array_in_match_case_3' => ['/* testShortArrayArrowinMatchCase3 */'], - 'long_array_in_match_case_4' => ['/* testLongArrayArrowinMatchCase4 */'], - - 'in_complex_short_array_key_match_value' => ['/* testShortArrayArrowInComplexMatchValueinShortArrayKey */'], - 'in_complex_short_array_toplevel' => ['/* testShortArrayArrowInComplexMatchArrayMismash */'], - 'in_complex_short_array_value_match_value' => ['/* testShortArrayArrowInComplexMatchValueinShortArrayValue */'], - - 'long_list_in_match_body' => ['/* testLongListArrowInMatchBody */'], - 'long_list_in_match_case' => ['/* testLongListArrowInMatchCase */'], - 'short_list_in_match_body' => ['/* testShortListArrowInMatchBody */'], - 'short_list_in_match_case' => ['/* testShortListArrowInMatchCase */'], - 'long_list_with_match_in_key' => ['/* testLongListArrowWithMatchInKey */'], - 'short_list_with_match_in_key' => ['/* testShortListArrowWithMatchInKey */'], - - 'long_array_with_constant_default_in_key' => ['/* testLongArrayArrowWithClassConstantKey */'], - 'short_array_with_constant_default_in_key' => ['/* testShortArrayArrowWithClassConstantKey */'], - 'yield_with_constant_default_in_key' => ['/* testYieldArrowWithClassConstantKey */'], - - 'long_array_with_default_in_key_in_match' => ['/* testLongArrayArrowWithClassConstantKeyNestedInMatch */'], - 'short_array_with_default_in_key_in_match' => ['/* testShortArrayArrowWithClassConstantKeyNestedInMatch */'], - 'long_array_with_default_in_key_with_match' => ['/* testLongArrayArrowWithClassConstantKeyWithNestedMatch */'], - 'short_array_with_default_in_key_with_match' => ['/* testShortArrayArrowWithClassConstantKeyWithNestedMatch */'], - ]; - - }//end dataDoubleArrow() - - - /** - * Test that double arrows in match expressions which are the demarkation between a case and the return value - * are correctly tokenized as `T_MATCH_ARROW`. - * - * @param string $testMarker The comment prefacing the target token. - * - * @dataProvider dataMatchArrow - * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional - * - * @return void - */ - public function testMatchArrow($testMarker) - { - $tokens = self::$phpcsFile->getTokens(); - - $token = $this->getTargetToken($testMarker, [T_DOUBLE_ARROW, T_MATCH_ARROW, T_FN_ARROW]); - $tokenArray = $tokens[$token]; - - $this->assertSame(T_MATCH_ARROW, $tokenArray['code'], 'Token tokenized as '.$tokenArray['type'].', not T_MATCH_ARROW (code)'); - $this->assertSame('T_MATCH_ARROW', $tokenArray['type'], 'Token tokenized as '.$tokenArray['type'].', not T_MATCH_ARROW (type)'); - - }//end testMatchArrow() - - - /** - * Data provider. - * - * @see testMatchArrow() - * - * @return array - */ - public function dataMatchArrow() - { - return [ - 'single_case' => ['/* testMatchArrowSimpleSingleCase */'], - 'multi_case' => ['/* testMatchArrowSimpleMultiCase */'], - 'single_case_with_trailing_comma' => ['/* testMatchArrowSimpleSingleCaseWithTrailingComma */'], - 'multi_case_with_trailing_comma' => ['/* testMatchArrowSimpleMultiCaseWithTrailingComma */'], - 'match_nested_outer' => ['/* testMatchArrowNestedMatchOuter */'], - 'match_nested_inner' => ['/* testMatchArrowNestedMatchInner */'], - - 'in_long_array_value_1' => ['/* testMatchArrowInLongArrayValue1 */'], - 'in_long_array_value_2' => ['/* testMatchArrowInLongArrayValue2 */'], - 'in_long_array_value_3' => ['/* testMatchArrowInLongArrayValue3 */'], - 'in_short_array_value_1' => ['/* testMatchArrowInShortArrayValue1 */'], - 'in_short_array_value_2' => ['/* testMatchArrowInShortArrayValue2 */'], - 'in_short_array_value_3' => ['/* testMatchArrowInShortArrayValue3 */'], - - 'in_long_array_key_1' => ['/* testMatchArrowInLongArrayKey1 */'], - 'in_long_array_key_2' => ['/* testMatchArrowInLongArrayKey2 */'], - 'in_short_array_key_1' => ['/* testMatchArrowInShortArrayKey1 */'], - 'in_short_array_key_2' => ['/* testMatchArrowInShortArrayKey2 */'], - - 'with_long_array_value_with_keys' => ['/* testMatchArrowWithLongArrayBodyWithKeys */'], - 'with_short_array_value_without_keys' => ['/* testMatchArrowWithShortArrayBodyWithoutKeys */'], - 'with_long_array_value_without_keys' => ['/* testMatchArrowWithLongArrayBodyWithoutKeys */'], - 'with_short_array_value_with_keys' => ['/* testMatchArrowWithShortArrayBodyWithKeys */'], - - 'with_short_array_with_keys_as_case' => ['/* testMatchArrowWithShortArrayWithKeysAsCase */'], - 'with_multiple_arrays_with_keys_as_case' => ['/* testMatchArrowWithMultipleArraysWithKeysAsCase */'], - - 'in_fn_body_case' => ['/* testMatchArrowInFnBody1 */'], - 'in_fn_body_default' => ['/* testMatchArrowInFnBody2 */'], - 'with_fn_body_case' => ['/* testMatchArrowWithFnBody1 */'], - 'with_fn_body_default' => ['/* testMatchArrowWithFnBody2 */'], - - 'in_complex_short_array_key_1' => ['/* testMatchArrowInComplexShortArrayKey1 */'], - 'in_complex_short_array_key_2' => ['/* testMatchArrowInComplexShortArrayKey2 */'], - 'in_complex_short_array_value_1' => ['/* testMatchArrowInComplexShortArrayValue1 */'], - 'in_complex_short_array_value_2' => ['/* testMatchArrowInComplexShortArrayValue2 */'], - - 'with_long_list_in_body' => ['/* testMatchArrowWithLongListBody */'], - 'with_long_list_in_case' => ['/* testMatchArrowWithLongListInCase */'], - 'with_short_list_in_body' => ['/* testMatchArrowWithShortListBody */'], - 'with_short_list_in_case' => ['/* testMatchArrowWithShortListInCase */'], - 'in_long_list_key' => ['/* testMatchArrowInLongListKey */'], - 'in_short_list_key' => ['/* testMatchArrowInShortListKey */'], - - 'with_long_array_value_with_default_key' => ['/* testMatchArrowWithNestedLongArrayWithClassConstantKey */'], - 'with_short_array_value_with_default_key' => ['/* testMatchArrowWithNestedShortArrayWithClassConstantKey */'], - 'in_long_array_value_with_default_key' => ['/* testMatchArrowNestedInLongArrayWithClassConstantKey */'], - 'in_short_array_value_with_default_key' => ['/* testMatchArrowNestedInShortArrayWithClassConstantKey */'], - ]; - - }//end dataMatchArrow() - - - /** - * Test that double arrows used as the scope opener for an arrow function - * are correctly tokenized as `T_FN_ARROW`. - * - * @param string $testMarker The comment prefacing the target token. - * - * @dataProvider dataFnArrow - * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional - * - * @return void - */ - public function testFnArrow($testMarker) - { - $tokens = self::$phpcsFile->getTokens(); - - $token = $this->getTargetToken($testMarker, [T_DOUBLE_ARROW, T_MATCH_ARROW, T_FN_ARROW]); - $tokenArray = $tokens[$token]; - - $this->assertSame(T_FN_ARROW, $tokenArray['code'], 'Token tokenized as '.$tokenArray['type'].', not T_FN_ARROW (code)'); - $this->assertSame('T_FN_ARROW', $tokenArray['type'], 'Token tokenized as '.$tokenArray['type'].', not T_FN_ARROW (type)'); - - }//end testFnArrow() - - - /** - * Data provider. - * - * @see testFnArrow() - * - * @return array - */ - public function dataFnArrow() - { - return [ - 'simple_fn' => ['/* testFnArrowSimple */'], - - 'with_match_as_value' => ['/* testFnArrowWithMatchInValue */'], - 'in_match_value_case' => ['/* testFnArrowInMatchBody1 */'], - 'in_match_value_default' => ['/* testFnArrowInMatchBody2 */'], - - 'in_complex_match_value_in_short_array' => ['/* testFnArrowInComplexMatchValueInShortArrayValue */'], - ]; - - }//end dataFnArrow() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/FinallyTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/FinallyTest.inc deleted file mode 100644 index e65600b..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/FinallyTest.inc +++ /dev/null @@ -1,40 +0,0 @@ -finally = 'foo'; - } -} diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/FinallyTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/FinallyTest.php deleted file mode 100644 index 2b28bc5..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/FinallyTest.php +++ /dev/null @@ -1,96 +0,0 @@ - - * @copyright 2021 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tests\Core\Tokenizer; - -use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest; - -class FinallyTest extends AbstractMethodUnitTest -{ - - - /** - * Test that the finally keyword is tokenized as such. - * - * @param string $testMarker The comment which prefaces the target token in the test file. - * - * @dataProvider dataFinallyKeyword - * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize - * - * @return void - */ - public function testFinallyKeyword($testMarker) - { - $tokens = self::$phpcsFile->getTokens(); - - $target = $this->getTargetToken($testMarker, [T_FINALLY, T_STRING]); - $this->assertSame(T_FINALLY, $tokens[$target]['code']); - $this->assertSame('T_FINALLY', $tokens[$target]['type']); - - }//end testFinallyKeyword() - - - /** - * Data provider. - * - * @see testFinallyKeyword() - * - * @return array - */ - public function dataFinallyKeyword() - { - return [ - ['/* testTryCatchFinally */'], - ['/* testTryFinallyCatch */'], - ['/* testTryFinally */'], - ]; - - }//end dataFinallyKeyword() - - - /** - * Test that 'finally' when not used as the reserved keyword is tokenized as `T_STRING`. - * - * @param string $testMarker The comment which prefaces the target token in the test file. - * - * @dataProvider dataFinallyNonKeyword - * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize - * - * @return void - */ - public function testFinallyNonKeyword($testMarker) - { - $tokens = self::$phpcsFile->getTokens(); - - $target = $this->getTargetToken($testMarker, [T_FINALLY, T_STRING]); - $this->assertSame(T_STRING, $tokens[$target]['code']); - $this->assertSame('T_STRING', $tokens[$target]['type']); - - }//end testFinallyNonKeyword() - - - /** - * Data provider. - * - * @see testFinallyNonKeyword() - * - * @return array - */ - public function dataFinallyNonKeyword() - { - return [ - ['/* testFinallyUsedAsClassConstantName */'], - ['/* testFinallyUsedAsMethodName */'], - ['/* testFinallyUsedAsPropertyName */'], - ]; - - }//end dataFinallyNonKeyword() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/GotoLabelTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/GotoLabelTest.inc deleted file mode 100644 index f6920f5..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/GotoLabelTest.inc +++ /dev/null @@ -1,53 +0,0 @@ - -
    - -property: - // Do something. - break; -} - -switch (true) { - /* testNotGotoDeclarationGlobalConstantInTernary */ - case $x === ($cond) ? CONST_A : CONST_B: - // Do something. - break; -} diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/GotoLabelTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/GotoLabelTest.php deleted file mode 100644 index fa6f8cf..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/GotoLabelTest.php +++ /dev/null @@ -1,171 +0,0 @@ - - * @copyright 2020 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tests\Core\Tokenizer; - -use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest; - -class GotoLabelTest extends AbstractMethodUnitTest -{ - - - /** - * Verify that the label in a goto statement is tokenized as T_STRING. - * - * @param string $testMarker The comment prefacing the target token. - * @param string $testContent The token content to expect. - * - * @dataProvider dataGotoStatement - * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize - * - * @return void - */ - public function testGotoStatement($testMarker, $testContent) - { - $tokens = self::$phpcsFile->getTokens(); - - $label = $this->getTargetToken($testMarker, T_STRING); - - $this->assertInternalType('int', $label); - $this->assertSame($testContent, $tokens[$label]['content']); - - }//end testGotoStatement() - - - /** - * Data provider. - * - * @see testGotoStatement() - * - * @return array - */ - public function dataGotoStatement() - { - return [ - [ - '/* testGotoStatement */', - 'marker', - ], - [ - '/* testGotoStatementInLoop */', - 'end', - ], - ]; - - }//end dataGotoStatement() - - - /** - * Verify that the label in a goto declaration is tokenized as T_GOTO_LABEL. - * - * @param string $testMarker The comment prefacing the target token. - * @param string $testContent The token content to expect. - * - * @dataProvider dataGotoDeclaration - * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize - * - * @return void - */ - public function testGotoDeclaration($testMarker, $testContent) - { - $tokens = self::$phpcsFile->getTokens(); - - $label = $this->getTargetToken($testMarker, T_GOTO_LABEL); - - $this->assertInternalType('int', $label); - $this->assertSame($testContent, $tokens[$label]['content']); - - }//end testGotoDeclaration() - - - /** - * Data provider. - * - * @see testGotoDeclaration() - * - * @return array - */ - public function dataGotoDeclaration() - { - return [ - [ - '/* testGotoDeclaration */', - 'marker:', - ], - [ - '/* testGotoDeclarationOutsideLoop */', - 'end:', - ], - ]; - - }//end dataGotoDeclaration() - - - /** - * Verify that the constant used in a switch - case statement is not confused with a goto label. - * - * @param string $testMarker The comment prefacing the target token. - * @param string $testContent The token content to expect. - * - * @dataProvider dataNotAGotoDeclaration - * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize - * - * @return void - */ - public function testNotAGotoDeclaration($testMarker, $testContent) - { - $tokens = self::$phpcsFile->getTokens(); - $target = $this->getTargetToken($testMarker, [T_GOTO_LABEL, T_STRING], $testContent); - - $this->assertSame(T_STRING, $tokens[$target]['code']); - $this->assertSame('T_STRING', $tokens[$target]['type']); - - }//end testNotAGotoDeclaration() - - - /** - * Data provider. - * - * @see testNotAGotoDeclaration() - * - * @return array - */ - public function dataNotAGotoDeclaration() - { - return [ - [ - '/* testNotGotoDeclarationGlobalConstant */', - 'CONSTANT', - ], - [ - '/* testNotGotoDeclarationNamespacedConstant */', - 'CONSTANT', - ], - [ - '/* testNotGotoDeclarationClassConstant */', - 'CONSTANT', - ], - [ - '/* testNotGotoDeclarationClassProperty */', - 'property', - ], - [ - '/* testNotGotoDeclarationGlobalConstantInTernary */', - 'CONST_A', - ], - [ - '/* testNotGotoDeclarationGlobalConstantInTernary */', - 'CONST_B', - ], - ]; - - }//end dataNotAGotoDeclaration() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/NamedFunctionCallArgumentsTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/NamedFunctionCallArgumentsTest.inc deleted file mode 100644 index d05d27d..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/NamedFunctionCallArgumentsTest.inc +++ /dev/null @@ -1,398 +0,0 @@ -getPos(skip: false), - count: count(array_or_countable: $array), - value: 50 -); - -array_fill( - start_index: /* testNestedFunctionCallInner1 */ $obj->getPos(skip: false), - count: /* testNestedFunctionCallInner2 */ count(array_or_countable: $array), - value: 50 -); - -/* testNamespaceOperatorFunction */ -namespace\function_name(label:$string, more: false); - -/* testNamespaceRelativeFunction */ -Partially\Qualified\function_name(label:$string, more: false); - -/* testNamespacedFQNFunction */ -\Fully\Qualified\function_name(label: $string, more:false); - -/* testVariableFunction */ -$fn(label: $string, more:false); - -/* testVariableVariableFunction */ -${$fn}(label: $string, more:false); - -/* testMethodCall */ -$obj->methodName(label: $foo, more: $bar); - -/* testVariableMethodCall */ -$obj->{$var}(label: $foo, more: $bar); - -/* testClassInstantiation */ -$obj = new MyClass(label: $string, more:false); - -/* testClassInstantiationSelf */ -$obj = new self(label: $string, more:true); - -/* testClassInstantiationStatic */ -$obj = new static(label: $string, more:false); - -/* testAnonClass */ -$anon = new class(label: $string, more: false) { - public function __construct($label, $more) {} -}; - -function myfoo( $💩💩💩, $Пасха, $_valid) {} -/* testNonAsciiNames */ -foo(💩💩💩: [], Пасха: 'text', _valid: 123); - -/* testMixedPositionalAndNamedArgsWithTernary */ -foo( $cond ? true : false, name: $value2 ); - -/* testNamedArgWithTernary */ -foo( label: $cond ? true : false, more: $cond ? CONSTANT_A : CONSTANT_B ); - -/* testTernaryWithFunctionCallsInThenElse */ -echo $cond ? foo( label: $something ) : foo( more: $something_else ); - -/* testTernaryWithConstantsInThenElse */ -echo $cond ? CONSTANT_NAME : OTHER_CONSTANT; - -switch ($s) { - /* testSwitchCaseWithConstant */ - case MY_CONSTANT: - // Do something. - break; - - /* testSwitchCaseWithClassProperty */ - case $obj->property: - // Do something. - break; - - /* testSwitchDefault */ - default: - // Do something. - break; -} - -/* testTernaryWithClosuresAndReturnTypes */ -$closure = $cond ? function() : bool {return true;} : function() : int {return 123;}; - -/* testTernaryWithArrowFunctionsAndReturnTypes */ -$fn = $cond ? fn() : bool => true : fn() : int => 123; - - -/* testCompileErrorNamedBeforePositional */ -// Not the concern of PHPCS. Should still be handled. -test(param: $bar, $foo); - -/* testDuplicateName1 */ -// Error Exception, but not the concern of PHPCS. Should still be handled. -test(param: 1, /* testDuplicateName2 */ param: 2); - -/* testIncorrectOrderWithVariadic */ -// Error Exception, but not the concern of PHPCS. Should still be handled. -array_fill(start_index: 0, ...[100, 50]); - -/* testCompileErrorIncorrectOrderWithVariadic */ -// Not the concern of PHPCS. Should still be handled. -test(...$values, param: $value); // Compile-time error - -/* testParseErrorNoValue */ -// Not the concern of PHPCS. Should still be handled. -test(param1:, param2:); - -/* testParseErrorDynamicName */ -// Parse error. Ignore. -function_name($variableStoringParamName: $value); - -/* testParseErrorExit */ -// Exit is a language construct, not a function. Named params not supported, handle it anyway. -exit(status: $value); - -/* testParseErrorEmpty */ -// Empty is a language construct, not a function. Named params not supported, handle it anyway. -empty(variable: $value); - -/* testParseErrorEval */ -// Eval is a language construct, not a function. Named params not supported, handle it anyway. -eval(code: $value); - -/* testParseErrorArbitraryParentheses */ -// Parse error. Not named param, handle it anyway. -$calc = (something: $value / $other); - - -/* testReservedKeywordAbstract1 */ -foobar(abstract: $value, /* testReservedKeywordAbstract2 */ abstract: $value); - -/* testReservedKeywordAnd1 */ -foobar(and: $value, /* testReservedKeywordAnd2 */ and: $value); - -/* testReservedKeywordArray1 */ -foobar(array: $value, /* testReservedKeywordArray2 */ array: $value); - -/* testReservedKeywordAs1 */ -foobar(as: $value, /* testReservedKeywordAs2 */ as: $value); - -/* testReservedKeywordBreak1 */ -foobar(break: $value, /* testReservedKeywordBreak2 */ break: $value); - -/* testReservedKeywordCallable1 */ -foobar(callable: $value, /* testReservedKeywordCallable2 */ callable: $value); - -/* testReservedKeywordCase1 */ -foobar(case: $value, /* testReservedKeywordCase2 */ case: $value); - -/* testReservedKeywordCatch1 */ -foobar(catch: $value, /* testReservedKeywordCatch2 */ catch: $value); - -/* testReservedKeywordClass1 */ -foobar(class: $value, /* testReservedKeywordClass2 */ class: $value); - -/* testReservedKeywordClone1 */ -foobar(clone: $value, /* testReservedKeywordClone2 */ clone: $value); - -/* testReservedKeywordConst1 */ -foobar(const: $value, /* testReservedKeywordConst2 */ const: $value); - -/* testReservedKeywordContinue1 */ -foobar(continue: $value, /* testReservedKeywordContinue2 */ continue: $value); - -/* testReservedKeywordDeclare1 */ -foobar(declare: $value, /* testReservedKeywordDeclare2 */ declare: $value); - -/* testReservedKeywordDefault1 */ -foobar(default: $value, /* testReservedKeywordDefault2 */ default: $value); - -/* testReservedKeywordDie1 */ -foobar(die: $value, /* testReservedKeywordDie2 */ die: $value); - -/* testReservedKeywordDo1 */ -foobar(do: $value, /* testReservedKeywordDo2 */ do: $value); - -/* testReservedKeywordEcho1 */ -foobar(echo: $value, /* testReservedKeywordEcho2 */ echo: $value); - -/* testReservedKeywordElse1 */ -foobar(else: $value, /* testReservedKeywordElse2 */ else: $value); - -/* testReservedKeywordElseif1 */ -foobar(elseif: $value, /* testReservedKeywordElseif2 */ elseif: $value); - -/* testReservedKeywordEmpty1 */ -foobar(empty: $value, /* testReservedKeywordEmpty2 */ empty: $value); - -/* testReservedKeywordEnddeclare1 */ -foobar(enddeclare: $value, /* testReservedKeywordEnddeclare2 */ enddeclare: $value); - -/* testReservedKeywordEndfor1 */ -foobar(endfor: $value, /* testReservedKeywordEndfor2 */ endfor: $value); - -/* testReservedKeywordEndforeach1 */ -foobar(endforeach: $value, /* testReservedKeywordEndforeach2 */ endforeach: $value); - -/* testReservedKeywordEndif1 */ -foobar(endif: $value, /* testReservedKeywordEndif2 */ endif: $value); - -/* testReservedKeywordEndswitch1 */ -foobar(endswitch: $value, /* testReservedKeywordEndswitch2 */ endswitch: $value); - -/* testReservedKeywordEndwhile1 */ -foobar(endwhile: $value, /* testReservedKeywordEndwhile2 */ endwhile: $value); - -/* testReservedKeywordEval1 */ -foobar(eval: $value, /* testReservedKeywordEval2 */ eval: $value); - -/* testReservedKeywordExit1 */ -foobar(exit: $value, /* testReservedKeywordExit2 */ exit: $value); - -/* testReservedKeywordExtends1 */ -foobar(extends: $value, /* testReservedKeywordExtends2 */ extends: $value); - -/* testReservedKeywordFinal1 */ -foobar(final: $value, /* testReservedKeywordFinal2 */ final: $value); - -/* testReservedKeywordFinally1 */ -foobar(finally: $value, /* testReservedKeywordFinally2 */ finally: $value); - -/* testReservedKeywordFn1 */ -foobar(fn: $value, /* testReservedKeywordFn2 */ fn: $value); - -/* testReservedKeywordFor1 */ -foobar(for: $value, /* testReservedKeywordFor2 */ for: $value); - -/* testReservedKeywordForeach1 */ -foobar(foreach: $value, /* testReservedKeywordForeach2 */ foreach: $value); - -/* testReservedKeywordFunction1 */ -foobar(function: $value, /* testReservedKeywordFunction2 */ function: $value); - -/* testReservedKeywordGlobal1 */ -foobar(global: $value, /* testReservedKeywordGlobal2 */ global: $value); - -/* testReservedKeywordGoto1 */ -foobar(goto: $value, /* testReservedKeywordGoto2 */ goto: $value); - -/* testReservedKeywordIf1 */ -foobar(if: $value, /* testReservedKeywordIf2 */ if: $value); - -/* testReservedKeywordImplements1 */ -foobar(implements: $value, /* testReservedKeywordImplements2 */ implements: $value); - -/* testReservedKeywordInclude1 */ -foobar(include: $value, /* testReservedKeywordInclude2 */ include: $value); - -/* testReservedKeywordInclude_once1 */ -foobar(include_once: $value, /* testReservedKeywordInclude_once2 */ include_once: $value); - -/* testReservedKeywordInstanceof1 */ -foobar(instanceof: $value, /* testReservedKeywordInstanceof2 */ instanceof: $value); - -/* testReservedKeywordInsteadof1 */ -foobar(insteadof: $value, /* testReservedKeywordInsteadof2 */ insteadof: $value); - -/* testReservedKeywordInterface1 */ -foobar(interface: $value, /* testReservedKeywordInterface2 */ interface: $value); - -/* testReservedKeywordIsset1 */ -foobar(isset: $value, /* testReservedKeywordIsset2 */ isset: $value); - -/* testReservedKeywordList1 */ -foobar(list: $value, /* testReservedKeywordList2 */ list: $value); - -/* testReservedKeywordMatch1 */ -foobar(match: $value, /* testReservedKeywordMatch2 */ match: $value); - -/* testReservedKeywordNamespace1 */ -foobar(namespace: $value, /* testReservedKeywordNamespace2 */ namespace: $value); - -/* testReservedKeywordNew1 */ -foobar(new: $value, /* testReservedKeywordNew2 */ new: $value); - -/* testReservedKeywordOr1 */ -foobar(or: $value, /* testReservedKeywordOr2 */ or: $value); - -/* testReservedKeywordPrint1 */ -foobar(print: $value, /* testReservedKeywordPrint2 */ print: $value); - -/* testReservedKeywordPrivate1 */ -foobar(private: $value, /* testReservedKeywordPrivate2 */ private: $value); - -/* testReservedKeywordProtected1 */ -foobar(protected: $value, /* testReservedKeywordProtected2 */ protected: $value); - -/* testReservedKeywordPublic1 */ -foobar(public: $value, /* testReservedKeywordPublic2 */ public: $value); - -/* testReservedKeywordRequire1 */ -foobar(require: $value, /* testReservedKeywordRequire2 */ require: $value); - -/* testReservedKeywordRequire_once1 */ -foobar(require_once: $value, /* testReservedKeywordRequire_once2 */ require_once: $value); - -/* testReservedKeywordReturn1 */ -foobar(return: $value, /* testReservedKeywordReturn2 */ return: $value); - -/* testReservedKeywordStatic1 */ -foobar(static: $value, /* testReservedKeywordStatic2 */ static: $value); - -/* testReservedKeywordSwitch1 */ -foobar(switch: $value, /* testReservedKeywordSwitch2 */ switch: $value); - -/* testReservedKeywordThrow1 */ -foobar(throw: $value, /* testReservedKeywordThrow2 */ throw: $value); - -/* testReservedKeywordTrait1 */ -foobar(trait: $value, /* testReservedKeywordTrait2 */ trait: $value); - -/* testReservedKeywordTry1 */ -foobar(try: $value, /* testReservedKeywordTry2 */ try: $value); - -/* testReservedKeywordUnset1 */ -foobar(unset: $value, /* testReservedKeywordUnset2 */ unset: $value); - -/* testReservedKeywordUse1 */ -foobar(use: $value, /* testReservedKeywordUse2 */ use: $value); - -/* testReservedKeywordVar1 */ -foobar(var: $value, /* testReservedKeywordVar2 */ var: $value); - -/* testReservedKeywordWhile1 */ -foobar(while: $value, /* testReservedKeywordWhile2 */ while: $value); - -/* testReservedKeywordXor1 */ -foobar(xor: $value, /* testReservedKeywordXor2 */ xor: $value); - -/* testReservedKeywordYield1 */ -foobar(yield: $value, /* testReservedKeywordYield2 */ yield: $value); - -/* testReservedKeywordInt1 */ -foobar(int: $value, /* testReservedKeywordInt2 */ int: $value); - -/* testReservedKeywordFloat1 */ -foobar(float: $value, /* testReservedKeywordFloat2 */ float: $value); - -/* testReservedKeywordBool1 */ -foobar(bool: $value, /* testReservedKeywordBool2 */ bool: $value); - -/* testReservedKeywordString1 */ -foobar(string: $value, /* testReservedKeywordString2 */ string: $value); - -/* testReservedKeywordTrue1 */ -foobar(true: $value, /* testReservedKeywordTrue2 */ true: $value); - -/* testReservedKeywordFalse1 */ -foobar(false: $value, /* testReservedKeywordFalse2 */ false: $value); - -/* testReservedKeywordNull1 */ -foobar(null: $value, /* testReservedKeywordNull2 */ null: $value); - -/* testReservedKeywordVoid1 */ -foobar(void: $value, /* testReservedKeywordVoid2 */ void: $value); - -/* testReservedKeywordIterable1 */ -foobar(iterable: $value, /* testReservedKeywordIterable2 */ iterable: $value); - -/* testReservedKeywordObject1 */ -foobar(object: $value, /* testReservedKeywordObject2 */ object: $value); - -/* testReservedKeywordResource1 */ -foobar(resource: $value, /* testReservedKeywordResource2 */ resource: $value); - -/* testReservedKeywordMixed1 */ -foobar(mixed: $value, /* testReservedKeywordMixed2 */ mixed: $value); - -/* testReservedKeywordNumeric1 */ -foobar(numeric: $value, /* testReservedKeywordNumeric2 */ numeric: $value); - -/* testReservedKeywordParent1 */ -foobar(parent: $value, /* testReservedKeywordParent2 */ parent: $value); - -/* testReservedKeywordSelf1 */ -foobar(self: $value, /* testReservedKeywordSelf2 */ self: $value); diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/NamedFunctionCallArgumentsTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/NamedFunctionCallArgumentsTest.php deleted file mode 100644 index 52845ac..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/NamedFunctionCallArgumentsTest.php +++ /dev/null @@ -1,882 +0,0 @@ - - * @copyright 2020 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tests\Core\Tokenizer; - -use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest; -use PHP_CodeSniffer\Util\Tokens; - -class NamedFunctionCallArgumentsTest extends AbstractMethodUnitTest -{ - - - /** - * Verify that parameter labels are tokenized as T_PARAM_NAME and that - * the colon after it is tokenized as a T_COLON. - * - * @param string $testMarker The comment prefacing the target token. - * @param array $parameters The token content for each parameter label to look for. - * - * @dataProvider dataNamedFunctionCallArguments - * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize - * - * @return void - */ - public function testNamedFunctionCallArguments($testMarker, $parameters) - { - $tokens = self::$phpcsFile->getTokens(); - - foreach ($parameters as $content) { - $label = $this->getTargetToken($testMarker, [T_STRING, T_PARAM_NAME], $content); - - $this->assertSame( - T_PARAM_NAME, - $tokens[$label]['code'], - 'Token tokenized as '.$tokens[$label]['type'].', not T_PARAM_NAME (code)' - ); - $this->assertSame( - 'T_PARAM_NAME', - $tokens[$label]['type'], - 'Token tokenized as '.$tokens[$label]['type'].', not T_PARAM_NAME (type)' - ); - - // Get the next non-empty token. - $colon = self::$phpcsFile->findNext(Tokens::$emptyTokens, ($label + 1), null, true); - - $this->assertSame( - ':', - $tokens[$colon]['content'], - 'Next token after parameter name is not a colon. Found: '.$tokens[$colon]['content'] - ); - $this->assertSame( - T_COLON, - $tokens[$colon]['code'], - 'Token tokenized as '.$tokens[$colon]['type'].', not T_COLON (code)' - ); - $this->assertSame( - 'T_COLON', - $tokens[$colon]['type'], - 'Token tokenized as '.$tokens[$colon]['type'].', not T_COLON (type)' - ); - }//end foreach - - }//end testNamedFunctionCallArguments() - - - /** - * Data provider. - * - * @see testNamedFunctionCallArguments() - * - * @return array - */ - public function dataNamedFunctionCallArguments() - { - return [ - [ - '/* testNamedArgs */', - [ - 'start_index', - 'count', - 'value', - ], - ], - [ - '/* testNamedArgsMultiline */', - [ - 'start_index', - 'count', - 'value', - ], - ], - [ - '/* testNamedArgsWithWhitespaceAndComments */', - [ - 'start_index', - 'count', - 'value', - ], - ], - [ - '/* testMixedPositionalAndNamedArgs */', - ['double_encode'], - ], - [ - '/* testNestedFunctionCallOuter */', - [ - 'start_index', - 'count', - 'value', - ], - ], - [ - '/* testNestedFunctionCallInner1 */', - ['skip'], - ], - [ - '/* testNestedFunctionCallInner2 */', - ['array_or_countable'], - ], - [ - '/* testNamespaceOperatorFunction */', - [ - 'label', - 'more', - ], - ], - [ - '/* testNamespaceRelativeFunction */', - [ - 'label', - 'more', - ], - ], - [ - '/* testNamespacedFQNFunction */', - [ - 'label', - 'more', - ], - ], - [ - '/* testVariableFunction */', - [ - 'label', - 'more', - ], - ], - [ - '/* testVariableVariableFunction */', - [ - 'label', - 'more', - ], - ], - [ - '/* testMethodCall */', - [ - 'label', - 'more', - ], - ], - [ - '/* testVariableMethodCall */', - [ - 'label', - 'more', - ], - ], - [ - '/* testClassInstantiation */', - [ - 'label', - 'more', - ], - ], - [ - '/* testClassInstantiationSelf */', - [ - 'label', - 'more', - ], - ], - [ - '/* testClassInstantiationStatic */', - [ - 'label', - 'more', - ], - ], - [ - '/* testAnonClass */', - [ - 'label', - 'more', - ], - ], - [ - '/* testNonAsciiNames */', - [ - '💩💩💩', - 'Пасха', - '_valid', - ], - ], - - // Coding errors which should still be handled. - [ - '/* testCompileErrorNamedBeforePositional */', - ['param'], - ], - [ - '/* testDuplicateName1 */', - ['param'], - ], - [ - '/* testDuplicateName2 */', - ['param'], - ], - [ - '/* testIncorrectOrderWithVariadic */', - ['start_index'], - ], - [ - '/* testCompileErrorIncorrectOrderWithVariadic */', - ['param'], - ], - [ - '/* testParseErrorNoValue */', - [ - 'param1', - 'param2', - ], - ], - [ - '/* testParseErrorExit */', - ['status'], - ], - [ - '/* testParseErrorEmpty */', - ['variable'], - ], - [ - '/* testParseErrorEval */', - ['code'], - ], - [ - '/* testParseErrorArbitraryParentheses */', - ['something'], - ], - ]; - - }//end dataNamedFunctionCallArguments() - - - /** - * Verify that other T_STRING tokens within a function call are still tokenized as T_STRING. - * - * @param string $testMarker The comment prefacing the target token. - * @param string $content The token content to look for. - * - * @dataProvider dataOtherTstringInFunctionCall - * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize - * - * @return void - */ - public function testOtherTstringInFunctionCall($testMarker, $content) - { - $tokens = self::$phpcsFile->getTokens(); - - $label = $this->getTargetToken($testMarker, [T_STRING, T_PARAM_NAME], $content); - - $this->assertSame( - T_STRING, - $tokens[$label]['code'], - 'Token tokenized as '.$tokens[$label]['type'].', not T_STRING (code)' - ); - $this->assertSame( - 'T_STRING', - $tokens[$label]['type'], - 'Token tokenized as '.$tokens[$label]['type'].', not T_STRING (type)' - ); - - }//end testOtherTstringInFunctionCall() - - - /** - * Data provider. - * - * @see testOtherTstringInFunctionCall() - * - * @return array - */ - public function dataOtherTstringInFunctionCall() - { - return [ - [ - '/* testPositionalArgs */', - 'START_INDEX', - ], - [ - '/* testPositionalArgs */', - 'COUNT', - ], - [ - '/* testPositionalArgs */', - 'VALUE', - ], - [ - '/* testNestedFunctionCallInner2 */', - 'count', - ], - ]; - - }//end dataOtherTstringInFunctionCall() - - - /** - * Verify whether the colons are tokenized correctly when a ternary is used in a mixed - * positional and named arguments function call. - * - * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize - * - * @return void - */ - public function testMixedPositionalAndNamedArgsWithTernary() - { - $tokens = self::$phpcsFile->getTokens(); - - $true = $this->getTargetToken('/* testMixedPositionalAndNamedArgsWithTernary */', T_TRUE); - - // Get the next non-empty token. - $colon = self::$phpcsFile->findNext(Tokens::$emptyTokens, ($true + 1), null, true); - - $this->assertSame( - T_INLINE_ELSE, - $tokens[$colon]['code'], - 'Token tokenized as '.$tokens[$colon]['type'].', not T_INLINE_ELSE (code)' - ); - $this->assertSame( - 'T_INLINE_ELSE', - $tokens[$colon]['type'], - 'Token tokenized as '.$tokens[$colon]['type'].', not T_INLINE_ELSE (type)' - ); - - $label = $this->getTargetToken('/* testMixedPositionalAndNamedArgsWithTernary */', T_PARAM_NAME, 'name'); - - // Get the next non-empty token. - $colon = self::$phpcsFile->findNext(Tokens::$emptyTokens, ($label + 1), null, true); - - $this->assertSame( - ':', - $tokens[$colon]['content'], - 'Next token after parameter name is not a colon. Found: '.$tokens[$colon]['content'] - ); - $this->assertSame( - T_COLON, - $tokens[$colon]['code'], - 'Token tokenized as '.$tokens[$colon]['type'].', not T_COLON (code)' - ); - $this->assertSame( - 'T_COLON', - $tokens[$colon]['type'], - 'Token tokenized as '.$tokens[$colon]['type'].', not T_COLON (type)' - ); - - }//end testMixedPositionalAndNamedArgsWithTernary() - - - /** - * Verify whether the colons are tokenized correctly when a ternary is used - * in a named arguments function call. - * - * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize - * - * @return void - */ - public function testNamedArgWithTernary() - { - $tokens = self::$phpcsFile->getTokens(); - - /* - * First argument. - */ - - $label = $this->getTargetToken('/* testNamedArgWithTernary */', T_PARAM_NAME, 'label'); - - // Get the next non-empty token. - $colon = self::$phpcsFile->findNext(Tokens::$emptyTokens, ($label + 1), null, true); - - $this->assertSame( - ':', - $tokens[$colon]['content'], - 'First arg: Next token after parameter name is not a colon. Found: '.$tokens[$colon]['content'] - ); - $this->assertSame( - T_COLON, - $tokens[$colon]['code'], - 'First arg: Token tokenized as '.$tokens[$colon]['type'].', not T_COLON (code)' - ); - $this->assertSame( - 'T_COLON', - $tokens[$colon]['type'], - 'First arg: Token tokenized as '.$tokens[$colon]['type'].', not T_COLON (type)' - ); - - $true = $this->getTargetToken('/* testNamedArgWithTernary */', T_TRUE); - - // Get the next non-empty token. - $colon = self::$phpcsFile->findNext(Tokens::$emptyTokens, ($true + 1), null, true); - - $this->assertSame( - T_INLINE_ELSE, - $tokens[$colon]['code'], - 'First arg ternary: Token tokenized as '.$tokens[$colon]['type'].', not T_INLINE_ELSE (code)' - ); - $this->assertSame( - 'T_INLINE_ELSE', - $tokens[$colon]['type'], - 'First arg ternary: Token tokenized as '.$tokens[$colon]['type'].', not T_INLINE_ELSE (type)' - ); - - /* - * Second argument. - */ - - $label = $this->getTargetToken('/* testNamedArgWithTernary */', T_PARAM_NAME, 'more'); - - // Get the next non-empty token. - $colon = self::$phpcsFile->findNext(Tokens::$emptyTokens, ($label + 1), null, true); - - $this->assertSame( - ':', - $tokens[$colon]['content'], - 'Second arg: Next token after parameter name is not a colon. Found: '.$tokens[$colon]['content'] - ); - $this->assertSame( - T_COLON, - $tokens[$colon]['code'], - 'Second arg: Token tokenized as '.$tokens[$colon]['type'].', not T_COLON (code)' - ); - $this->assertSame( - 'T_COLON', - $tokens[$colon]['type'], - 'Second arg: Token tokenized as '.$tokens[$colon]['type'].', not T_COLON (type)' - ); - - $true = $this->getTargetToken('/* testNamedArgWithTernary */', T_STRING, 'CONSTANT_A'); - - // Get the next non-empty token. - $colon = self::$phpcsFile->findNext(Tokens::$emptyTokens, ($true + 1), null, true); - - $this->assertSame( - T_INLINE_ELSE, - $tokens[$colon]['code'], - 'Second arg ternary: Token tokenized as '.$tokens[$colon]['type'].', not T_INLINE_ELSE (code)' - ); - $this->assertSame( - 'T_INLINE_ELSE', - $tokens[$colon]['type'], - 'Second arg ternary: Token tokenized as '.$tokens[$colon]['type'].', not T_INLINE_ELSE (type)' - ); - - }//end testNamedArgWithTernary() - - - /** - * Verify whether the colons are tokenized correctly when named arguments - * function calls are used in a ternary. - * - * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize - * - * @return void - */ - public function testTernaryWithFunctionCallsInThenElse() - { - $tokens = self::$phpcsFile->getTokens(); - - /* - * Then. - */ - - $label = $this->getTargetToken('/* testTernaryWithFunctionCallsInThenElse */', T_PARAM_NAME, 'label'); - - // Get the next non-empty token. - $colon = self::$phpcsFile->findNext(Tokens::$emptyTokens, ($label + 1), null, true); - - $this->assertSame( - ':', - $tokens[$colon]['content'], - 'Function in then: Next token after parameter name is not a colon. Found: '.$tokens[$colon]['content'] - ); - $this->assertSame( - T_COLON, - $tokens[$colon]['code'], - 'Function in then: Token tokenized as '.$tokens[$colon]['type'].', not T_COLON (code)' - ); - $this->assertSame( - 'T_COLON', - $tokens[$colon]['type'], - 'Function in then: Token tokenized as '.$tokens[$colon]['type'].', not T_COLON (type)' - ); - - $closeParens = $this->getTargetToken('/* testTernaryWithFunctionCallsInThenElse */', T_CLOSE_PARENTHESIS); - - // Get the next non-empty token. - $colon = self::$phpcsFile->findNext(Tokens::$emptyTokens, ($closeParens + 1), null, true); - - $this->assertSame( - T_INLINE_ELSE, - $tokens[$colon]['code'], - 'Token tokenized as '.$tokens[$colon]['type'].', not T_INLINE_ELSE (code)' - ); - $this->assertSame( - 'T_INLINE_ELSE', - $tokens[$colon]['type'], - 'Token tokenized as '.$tokens[$colon]['type'].', not T_INLINE_ELSE (type)' - ); - - /* - * Else. - */ - - $label = $this->getTargetToken('/* testTernaryWithFunctionCallsInThenElse */', T_PARAM_NAME, 'more'); - - // Get the next non-empty token. - $colon = self::$phpcsFile->findNext(Tokens::$emptyTokens, ($label + 1), null, true); - - $this->assertSame( - ':', - $tokens[$colon]['content'], - 'Function in else: Next token after parameter name is not a colon. Found: '.$tokens[$colon]['content'] - ); - $this->assertSame( - T_COLON, - $tokens[$colon]['code'], - 'Function in else: Token tokenized as '.$tokens[$colon]['type'].', not T_COLON (code)' - ); - $this->assertSame( - 'T_COLON', - $tokens[$colon]['type'], - 'Function in else: Token tokenized as '.$tokens[$colon]['type'].', not T_COLON (type)' - ); - - }//end testTernaryWithFunctionCallsInThenElse() - - - /** - * Verify whether the colons are tokenized correctly when constants are used in a ternary. - * - * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize - * - * @return void - */ - public function testTernaryWithConstantsInThenElse() - { - $tokens = self::$phpcsFile->getTokens(); - - $constant = $this->getTargetToken('/* testTernaryWithConstantsInThenElse */', T_STRING, 'CONSTANT_NAME'); - - // Get the next non-empty token. - $colon = self::$phpcsFile->findNext(Tokens::$emptyTokens, ($constant + 1), null, true); - - $this->assertSame( - T_INLINE_ELSE, - $tokens[$colon]['code'], - 'Token tokenized as '.$tokens[$colon]['type'].', not T_INLINE_ELSE (code)' - ); - $this->assertSame( - 'T_INLINE_ELSE', - $tokens[$colon]['type'], - 'Token tokenized as '.$tokens[$colon]['type'].', not T_INLINE_ELSE (type)' - ); - - }//end testTernaryWithConstantsInThenElse() - - - /** - * Verify whether the colons are tokenized correctly in a switch statement. - * - * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize - * - * @return void - */ - public function testSwitchStatement() - { - $tokens = self::$phpcsFile->getTokens(); - - $label = $this->getTargetToken('/* testSwitchCaseWithConstant */', T_STRING, 'MY_CONSTANT'); - - // Get the next non-empty token. - $colon = self::$phpcsFile->findNext(Tokens::$emptyTokens, ($label + 1), null, true); - - $this->assertSame( - T_COLON, - $tokens[$colon]['code'], - 'First case: Token tokenized as '.$tokens[$colon]['type'].', not T_COLON (code)' - ); - $this->assertSame( - 'T_COLON', - $tokens[$colon]['type'], - 'First case: Token tokenized as '.$tokens[$colon]['type'].', not T_COLON (type)' - ); - - $label = $this->getTargetToken('/* testSwitchCaseWithClassProperty */', T_STRING, 'property'); - - // Get the next non-empty token. - $colon = self::$phpcsFile->findNext(Tokens::$emptyTokens, ($label + 1), null, true); - - $this->assertSame( - T_COLON, - $tokens[$colon]['code'], - 'Second case: Token tokenized as '.$tokens[$colon]['type'].', not T_COLON (code)' - ); - $this->assertSame( - 'T_COLON', - $tokens[$colon]['type'], - 'Second case: Token tokenized as '.$tokens[$colon]['type'].', not T_COLON (type)' - ); - - $default = $this->getTargetToken('/* testSwitchDefault */', T_DEFAULT); - - // Get the next non-empty token. - $colon = self::$phpcsFile->findNext(Tokens::$emptyTokens, ($default + 1), null, true); - - $this->assertSame( - T_COLON, - $tokens[$colon]['code'], - 'Default case: Token tokenized as '.$tokens[$colon]['type'].', not T_COLON (code)' - ); - $this->assertSame( - 'T_COLON', - $tokens[$colon]['type'], - 'Default case: Token tokenized as '.$tokens[$colon]['type'].', not T_COLON (type)' - ); - - }//end testSwitchStatement() - - - /** - * Verify that a variable parameter label (parse error) is still tokenized as T_VARIABLE. - * - * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize - * - * @return void - */ - public function testParseErrorVariableLabel() - { - $tokens = self::$phpcsFile->getTokens(); - - $label = $this->getTargetToken('/* testParseErrorDynamicName */', [T_VARIABLE, T_PARAM_NAME], '$variableStoringParamName'); - - $this->assertSame( - T_VARIABLE, - $tokens[$label]['code'], - 'Token tokenized as '.$tokens[$label]['type'].', not T_VARIABLE (code)' - ); - $this->assertSame( - 'T_VARIABLE', - $tokens[$label]['type'], - 'Token tokenized as '.$tokens[$label]['type'].', not T_VARIABLE (type)' - ); - - // Get the next non-empty token. - $colon = self::$phpcsFile->findNext(Tokens::$emptyTokens, ($label + 1), null, true); - - $this->assertSame( - ':', - $tokens[$colon]['content'], - 'Next token after parameter name is not a colon. Found: '.$tokens[$colon]['content'] - ); - $this->assertSame( - T_COLON, - $tokens[$colon]['code'], - 'Token tokenized as '.$tokens[$colon]['type'].', not T_COLON (code)' - ); - $this->assertSame( - 'T_COLON', - $tokens[$colon]['type'], - 'Token tokenized as '.$tokens[$colon]['type'].', not T_COLON (type)' - ); - - }//end testParseErrorVariableLabel() - - - /** - * Verify that reserved keywords used as a parameter label are tokenized as T_PARAM_NAME - * and that the colon after it is tokenized as a T_COLON. - * - * @param string $testMarker The comment prefacing the target token. - * @param array $tokenTypes The token codes to look for. - * @param string $tokenContent The token content to look for. - * - * @dataProvider dataReservedKeywordsAsName - * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize - * - * @return void - */ - public function testReservedKeywordsAsName($testMarker, $tokenTypes, $tokenContent) - { - $tokens = self::$phpcsFile->getTokens(); - $label = $this->getTargetToken($testMarker, $tokenTypes, $tokenContent); - - $this->assertSame( - T_PARAM_NAME, - $tokens[$label]['code'], - 'Token tokenized as '.$tokens[$label]['type'].', not T_PARAM_NAME (code)' - ); - $this->assertSame( - 'T_PARAM_NAME', - $tokens[$label]['type'], - 'Token tokenized as '.$tokens[$label]['type'].', not T_PARAM_NAME (type)' - ); - - // Get the next non-empty token. - $colon = self::$phpcsFile->findNext(Tokens::$emptyTokens, ($label + 1), null, true); - - $this->assertSame( - ':', - $tokens[$colon]['content'], - 'Next token after parameter name is not a colon. Found: '.$tokens[$colon]['content'] - ); - $this->assertSame( - T_COLON, - $tokens[$colon]['code'], - 'Token tokenized as '.$tokens[$colon]['type'].', not T_COLON (code)' - ); - $this->assertSame( - 'T_COLON', - $tokens[$colon]['type'], - 'Token tokenized as '.$tokens[$colon]['type'].', not T_COLON (type)' - ); - - }//end testReservedKeywordsAsName() - - - /** - * Data provider. - * - * @see testReservedKeywordsAsName() - * - * @return array - */ - public function dataReservedKeywordsAsName() - { - $reservedKeywords = [ - // '__halt_compiler', NOT TESTABLE - 'abstract', - 'and', - 'array', - 'as', - 'break', - 'callable', - 'case', - 'catch', - 'class', - 'clone', - 'const', - 'continue', - 'declare', - 'default', - 'die', - 'do', - 'echo', - 'else', - 'elseif', - 'empty', - 'enddeclare', - 'endfor', - 'endforeach', - 'endif', - 'endswitch', - 'endwhile', - 'eval', - 'exit', - 'extends', - 'final', - 'finally', - 'fn', - 'for', - 'foreach', - 'function', - 'global', - 'goto', - 'if', - 'implements', - 'include', - 'include_once', - 'instanceof', - 'insteadof', - 'interface', - 'isset', - 'list', - 'match', - 'namespace', - 'new', - 'or', - 'print', - 'private', - 'protected', - 'public', - 'require', - 'require_once', - 'return', - 'static', - 'switch', - 'throw', - 'trait', - 'try', - 'unset', - 'use', - 'var', - 'while', - 'xor', - 'yield', - 'int', - 'float', - 'bool', - 'string', - 'true', - 'false', - 'null', - 'void', - 'iterable', - 'object', - 'resource', - 'mixed', - 'numeric', - - // Not reserved keyword, but do have their own token in PHPCS. - 'parent', - 'self', - ]; - - $data = []; - - foreach ($reservedKeywords as $keyword) { - $tokensTypes = [ - T_PARAM_NAME, - T_STRING, - T_GOTO_LABEL, - ]; - $tokenName = 'T_'.strtoupper($keyword); - - if ($keyword === 'and') { - $tokensTypes[] = T_LOGICAL_AND; - } else if ($keyword === 'die') { - $tokensTypes[] = T_EXIT; - } else if ($keyword === 'or') { - $tokensTypes[] = T_LOGICAL_OR; - } else if ($keyword === 'xor') { - $tokensTypes[] = T_LOGICAL_XOR; - } else if ($keyword === '__halt_compiler') { - $tokensTypes[] = T_HALT_COMPILER; - } else if (defined($tokenName) === true) { - $tokensTypes[] = constant($tokenName); - } - - $data[$keyword.'FirstParam'] = [ - '/* testReservedKeyword'.ucfirst($keyword).'1 */', - $tokensTypes, - $keyword, - ]; - - $data[$keyword.'SecondParam'] = [ - '/* testReservedKeyword'.ucfirst($keyword).'2 */', - $tokensTypes, - $keyword, - ]; - }//end foreach - - return $data; - - }//end dataReservedKeywordsAsName() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/NullsafeObjectOperatorTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/NullsafeObjectOperatorTest.inc deleted file mode 100644 index 982841e..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/NullsafeObjectOperatorTest.inc +++ /dev/null @@ -1,29 +0,0 @@ -foo; - -/* testNullsafeObjectOperator */ -echo $obj?->foo; - -/* testNullsafeObjectOperatorWriteContext */ -// Intentional parse error, but not the concern of the tokenizer. -$foo?->bar->baz = 'baz'; - -/* testTernaryThen */ -echo $obj ? $obj->prop : $other->prop; - -/* testParseErrorWhitespaceNotAllowed */ -echo $obj ? - -> foo; - -/* testParseErrorCommentNotAllowed */ -echo $obj ?/*comment*/-> foo; - -/* testLiveCoding */ -// Intentional parse error. This has to be the last test in the file. -echo $obj? diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/NullsafeObjectOperatorTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/NullsafeObjectOperatorTest.php deleted file mode 100644 index 8e465a3..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/NullsafeObjectOperatorTest.php +++ /dev/null @@ -1,140 +0,0 @@ -= 8.0 nullsafe object operator. - * - * @author Juliette Reinders Folmer - * @copyright 2020 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tests\Core\Tokenizer; - -use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest; -use PHP_CodeSniffer\Util\Tokens; - -class NullsafeObjectOperatorTest extends AbstractMethodUnitTest -{ - - /** - * Tokens to search for. - * - * @var array - */ - protected $find = [ - T_NULLSAFE_OBJECT_OPERATOR, - T_OBJECT_OPERATOR, - T_INLINE_THEN, - ]; - - - /** - * Test that a normal object operator is still tokenized as such. - * - * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize - * - * @return void - */ - public function testObjectOperator() - { - $tokens = self::$phpcsFile->getTokens(); - - $operator = $this->getTargetToken('/* testObjectOperator */', $this->find); - $this->assertSame(T_OBJECT_OPERATOR, $tokens[$operator]['code'], 'Failed asserting code is object operator'); - $this->assertSame('T_OBJECT_OPERATOR', $tokens[$operator]['type'], 'Failed asserting type is object operator'); - - }//end testObjectOperator() - - - /** - * Test that a nullsafe object operator is tokenized as such. - * - * @param string $testMarker The comment which prefaces the target token in the test file. - * - * @dataProvider dataNullsafeObjectOperator - * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize - * - * @return void - */ - public function testNullsafeObjectOperator($testMarker) - { - $tokens = self::$phpcsFile->getTokens(); - - $operator = $this->getTargetToken($testMarker, $this->find); - $this->assertSame(T_NULLSAFE_OBJECT_OPERATOR, $tokens[$operator]['code'], 'Failed asserting code is nullsafe object operator'); - $this->assertSame('T_NULLSAFE_OBJECT_OPERATOR', $tokens[$operator]['type'], 'Failed asserting type is nullsafe object operator'); - - }//end testNullsafeObjectOperator() - - - /** - * Data provider. - * - * @see testNullsafeObjectOperator() - * - * @return array - */ - public function dataNullsafeObjectOperator() - { - return [ - ['/* testNullsafeObjectOperator */'], - ['/* testNullsafeObjectOperatorWriteContext */'], - ]; - - }//end dataNullsafeObjectOperator() - - - /** - * Test that a question mark not followed by an object operator is tokenized as T_TERNARY_THEN. - * - * @param string $testMarker The comment which prefaces the target token in the test file. - * @param bool $testObjectOperator Whether to test for the next non-empty token being tokenized - * as an object operator. - * - * @dataProvider dataTernaryThen - * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize - * - * @return void - */ - public function testTernaryThen($testMarker, $testObjectOperator=false) - { - $tokens = self::$phpcsFile->getTokens(); - - $operator = $this->getTargetToken($testMarker, $this->find); - $this->assertSame(T_INLINE_THEN, $tokens[$operator]['code'], 'Failed asserting code is inline then'); - $this->assertSame('T_INLINE_THEN', $tokens[$operator]['type'], 'Failed asserting type is inline then'); - - if ($testObjectOperator === true) { - $next = self::$phpcsFile->findNext(Tokens::$emptyTokens, ($operator + 1), null, true); - $this->assertSame(T_OBJECT_OPERATOR, $tokens[$next]['code'], 'Failed asserting code is object operator'); - $this->assertSame('T_OBJECT_OPERATOR', $tokens[$next]['type'], 'Failed asserting type is object operator'); - } - - }//end testTernaryThen() - - - /** - * Data provider. - * - * @see testTernaryThen() - * - * @return array - */ - public function dataTernaryThen() - { - return [ - ['/* testTernaryThen */'], - [ - '/* testParseErrorWhitespaceNotAllowed */', - true, - ], - [ - '/* testParseErrorCommentNotAllowed */', - true, - ], - ['/* testLiveCoding */'], - ]; - - }//end dataTernaryThen() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ScopeSettingWithNamespaceOperatorTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ScopeSettingWithNamespaceOperatorTest.inc deleted file mode 100644 index e2d61bb..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ScopeSettingWithNamespaceOperatorTest.inc +++ /dev/null @@ -1,19 +0,0 @@ - new namespace\Baz; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ScopeSettingWithNamespaceOperatorTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ScopeSettingWithNamespaceOperatorTest.php deleted file mode 100644 index 23cbd98..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ScopeSettingWithNamespaceOperatorTest.php +++ /dev/null @@ -1,98 +0,0 @@ - - * @copyright 2020 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tests\Core\Tokenizer; - -use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest; - -class ScopeSettingWithNamespaceOperatorTest extends AbstractMethodUnitTest -{ - - - /** - * Test that the scope opener/closers are set correctly when the namespace keyword is encountered as an operator. - * - * @param string $testMarker The comment which prefaces the target tokens in the test file. - * @param int|string[] $tokenTypes The token type to search for. - * @param int|string[] $open Optional. The token type for the scope opener. - * @param int|string[] $close Optional. The token type for the scope closer. - * - * @dataProvider dataScopeSetting - * @covers PHP_CodeSniffer\Tokenizers\Tokenizer::recurseScopeMap - * - * @return void - */ - public function testScopeSetting($testMarker, $tokenTypes, $open=T_OPEN_CURLY_BRACKET, $close=T_CLOSE_CURLY_BRACKET) - { - $tokens = self::$phpcsFile->getTokens(); - - $target = $this->getTargetToken($testMarker, $tokenTypes); - $opener = $this->getTargetToken($testMarker, $open); - $closer = $this->getTargetToken($testMarker, $close); - - $this->assertArrayHasKey('scope_opener', $tokens[$target], 'Scope opener missing'); - $this->assertArrayHasKey('scope_closer', $tokens[$target], 'Scope closer missing'); - $this->assertSame($opener, $tokens[$target]['scope_opener'], 'Scope opener not same'); - $this->assertSame($closer, $tokens[$target]['scope_closer'], 'Scope closer not same'); - - $this->assertArrayHasKey('scope_opener', $tokens[$opener], 'Scope opener missing for open curly'); - $this->assertArrayHasKey('scope_closer', $tokens[$opener], 'Scope closer missing for open curly'); - $this->assertSame($opener, $tokens[$opener]['scope_opener'], 'Scope opener not same for open curly'); - $this->assertSame($closer, $tokens[$opener]['scope_closer'], 'Scope closer not same for open curly'); - - $this->assertArrayHasKey('scope_opener', $tokens[$closer], 'Scope opener missing for close curly'); - $this->assertArrayHasKey('scope_closer', $tokens[$closer], 'Scope closer missing for close curly'); - $this->assertSame($opener, $tokens[$closer]['scope_opener'], 'Scope opener not same for close curly'); - $this->assertSame($closer, $tokens[$closer]['scope_closer'], 'Scope closer not same for close curly'); - - }//end testScopeSetting() - - - /** - * Data provider. - * - * @see testScopeSetting() - * - * @return array - */ - public function dataScopeSetting() - { - return [ - [ - '/* testClassExtends */', - [T_CLASS], - ], - [ - '/* testClassImplements */', - [T_ANON_CLASS], - ], - [ - '/* testInterfaceExtends */', - [T_INTERFACE], - ], - [ - '/* testFunctionReturnType */', - [T_FUNCTION], - ], - [ - '/* testClosureReturnType */', - [T_CLOSURE], - ], - [ - '/* testArrowFunctionReturnType */', - [T_FN], - [T_FN_ARROW], - [T_SEMICOLON], - ], - ]; - - }//end dataScopeSetting() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ShortArrayTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ShortArrayTest.inc deleted file mode 100644 index 54065f2..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ShortArrayTest.inc +++ /dev/null @@ -1,97 +0,0 @@ -function_call()[$x]; - -/* testStaticMethodCallDereferencing */ -$var = ClassName::function_call()[$x]; - -/* testPropertyDereferencing */ -$var = $obj->property[2]; - -/* testPropertyDereferencingWithInaccessibleName */ -$var = $ref->{'ref-type'}[1]; - -/* testStaticPropertyDereferencing */ -$var ClassName::$property[2]; - -/* testStringDereferencing */ -$var = 'PHP'[1]; - -/* testStringDereferencingDoubleQuoted */ -$var = "PHP"[$y]; - -/* testConstantDereferencing */ -$var = MY_CONSTANT[1]; - -/* testClassConstantDereferencing */ -$var ClassName::CONSTANT_NAME[2]; - -/* testMagicConstantDereferencing */ -$var = __FILE__[0]; - -/* testArrayAccessCurlyBraces */ -$var = $array{'key'}['key']; - -/* testArrayLiteralDereferencing */ -echo array(1, 2, 3)[0]; - -echo [1, 2, 3]/* testShortArrayLiteralDereferencing */[0]; - -/* testClassMemberDereferencingOnInstantiation1 */ -(new foo)[0]; - -/* testClassMemberDereferencingOnInstantiation2 */ -$a = (new Foo( array(1, array(4, 5), 3) ))[1][0]; - -/* testClassMemberDereferencingOnClone */ -echo (clone $iterable)[20]; - -/* testNullsafeMethodCallDereferencing */ -$var = $obj?->function_call()[$x]; - -/* testInterpolatedStringDereferencing */ -$var = "PHP{$rocks}"[1]; - -/* - * Short array brackets. - */ - -/* testShortArrayDeclarationEmpty */ -$array = []; - -/* testShortArrayDeclarationWithOneValue */ -$array = [1]; - -/* testShortArrayDeclarationWithMultipleValues */ -$array = [1, 2, 3]; - -/* testShortArrayDeclarationWithDereferencing */ -echo [1, 2, 3][0]; - -/* testShortListDeclaration */ -[ $a, $b ] = $array; - -[ $a, $b, /* testNestedListDeclaration */, [$c, $d]] = $array; - -/* testArrayWithinFunctionCall */ -$var = functionCall([$x, $y]); - -/* testLiveCoding */ -// Intentional parse error. This has to be the last test in the file. -$array = [ diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ShortArrayTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ShortArrayTest.php deleted file mode 100644 index 0484d4f..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ShortArrayTest.php +++ /dev/null @@ -1,132 +0,0 @@ - - * @copyright 2020 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tests\Core\Tokenizer; - -use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest; - -class ShortArrayTest extends AbstractMethodUnitTest -{ - - - /** - * Test that real square brackets are still tokenized as square brackets. - * - * @param string $testMarker The comment which prefaces the target token in the test file. - * - * @dataProvider dataSquareBrackets - * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional - * - * @return void - */ - public function testSquareBrackets($testMarker) - { - $tokens = self::$phpcsFile->getTokens(); - - $opener = $this->getTargetToken($testMarker, [T_OPEN_SQUARE_BRACKET, T_OPEN_SHORT_ARRAY]); - $this->assertSame(T_OPEN_SQUARE_BRACKET, $tokens[$opener]['code']); - $this->assertSame('T_OPEN_SQUARE_BRACKET', $tokens[$opener]['type']); - - if (isset($tokens[$opener]['bracket_closer']) === true) { - $closer = $tokens[$opener]['bracket_closer']; - $this->assertSame(T_CLOSE_SQUARE_BRACKET, $tokens[$closer]['code']); - $this->assertSame('T_CLOSE_SQUARE_BRACKET', $tokens[$closer]['type']); - } - - }//end testSquareBrackets() - - - /** - * Data provider. - * - * @see testSquareBrackets() - * - * @return array - */ - public function dataSquareBrackets() - { - return [ - ['/* testArrayAccess1 */'], - ['/* testArrayAccess2 */'], - ['/* testArrayAssignment */'], - ['/* testFunctionCallDereferencing */'], - ['/* testMethodCallDereferencing */'], - ['/* testStaticMethodCallDereferencing */'], - ['/* testPropertyDereferencing */'], - ['/* testPropertyDereferencingWithInaccessibleName */'], - ['/* testStaticPropertyDereferencing */'], - ['/* testStringDereferencing */'], - ['/* testStringDereferencingDoubleQuoted */'], - ['/* testConstantDereferencing */'], - ['/* testClassConstantDereferencing */'], - ['/* testMagicConstantDereferencing */'], - ['/* testArrayAccessCurlyBraces */'], - ['/* testArrayLiteralDereferencing */'], - ['/* testShortArrayLiteralDereferencing */'], - ['/* testClassMemberDereferencingOnInstantiation1 */'], - ['/* testClassMemberDereferencingOnInstantiation2 */'], - ['/* testClassMemberDereferencingOnClone */'], - ['/* testNullsafeMethodCallDereferencing */'], - ['/* testInterpolatedStringDereferencing */'], - ['/* testLiveCoding */'], - ]; - - }//end dataSquareBrackets() - - - /** - * Test that short arrays and short lists are still tokenized as short arrays. - * - * @param string $testMarker The comment which prefaces the target token in the test file. - * - * @dataProvider dataShortArrays - * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional - * - * @return void - */ - public function testShortArrays($testMarker) - { - $tokens = self::$phpcsFile->getTokens(); - - $opener = $this->getTargetToken($testMarker, [T_OPEN_SQUARE_BRACKET, T_OPEN_SHORT_ARRAY]); - $this->assertSame(T_OPEN_SHORT_ARRAY, $tokens[$opener]['code']); - $this->assertSame('T_OPEN_SHORT_ARRAY', $tokens[$opener]['type']); - - if (isset($tokens[$opener]['bracket_closer']) === true) { - $closer = $tokens[$opener]['bracket_closer']; - $this->assertSame(T_CLOSE_SHORT_ARRAY, $tokens[$closer]['code']); - $this->assertSame('T_CLOSE_SHORT_ARRAY', $tokens[$closer]['type']); - } - - }//end testShortArrays() - - - /** - * Data provider. - * - * @see testShortArrays() - * - * @return array - */ - public function dataShortArrays() - { - return [ - ['/* testShortArrayDeclarationEmpty */'], - ['/* testShortArrayDeclarationWithOneValue */'], - ['/* testShortArrayDeclarationWithMultipleValues */'], - ['/* testShortArrayDeclarationWithDereferencing */'], - ['/* testShortListDeclaration */'], - ['/* testNestedListDeclaration */'], - ['/* testArrayWithinFunctionCall */'], - ]; - - }//end dataShortArrays() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/StableCommentWhitespaceTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/StableCommentWhitespaceTest.inc deleted file mode 100644 index 3bf013c..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/StableCommentWhitespaceTest.inc +++ /dev/null @@ -1,139 +0,0 @@ - - - - * @copyright 2020 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tests\Core\Tokenizer; - -use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest; -use PHP_CodeSniffer\Util\Tokens; - -class StableCommentWhitespaceTest extends AbstractMethodUnitTest -{ - - - /** - * Test that comment tokenization with new lines at the end of the comment is stable. - * - * @param string $testMarker The comment prefacing the test. - * @param array $expectedTokens The tokenization expected. - * - * @dataProvider dataCommentTokenization - * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize - * - * @return void - */ - public function testCommentTokenization($testMarker, $expectedTokens) - { - $tokens = self::$phpcsFile->getTokens(); - $comment = $this->getTargetToken($testMarker, Tokens::$commentTokens); - - foreach ($expectedTokens as $key => $tokenInfo) { - $this->assertSame(constant($tokenInfo['type']), $tokens[$comment]['code']); - $this->assertSame($tokenInfo['type'], $tokens[$comment]['type']); - $this->assertSame($tokenInfo['content'], $tokens[$comment]['content']); - - ++$comment; - } - - }//end testCommentTokenization() - - - /** - * Data provider. - * - * @see testCommentTokenization() - * - * @return array - */ - public function dataCommentTokenization() - { - return [ - [ - '/* testSingleLineSlashComment */', - [ - [ - 'type' => 'T_COMMENT', - 'content' => '// Comment -', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - ], - ], - [ - '/* testSingleLineSlashCommentTrailing */', - [ - [ - 'type' => 'T_COMMENT', - 'content' => '// Comment -', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - ], - ], - [ - '/* testSingleLineSlashAnnotation */', - [ - [ - 'type' => 'T_PHPCS_DISABLE', - 'content' => '// phpcs:disable Stnd.Cat -', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - ], - ], - [ - '/* testMultiLineSlashComment */', - [ - [ - 'type' => 'T_COMMENT', - 'content' => '// Comment1 -', - ], - [ - 'type' => 'T_COMMENT', - 'content' => '// Comment2 -', - ], - [ - 'type' => 'T_COMMENT', - 'content' => '// Comment3 -', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - ], - ], - [ - '/* testMultiLineSlashCommentWithIndent */', - [ - [ - 'type' => 'T_COMMENT', - 'content' => '// Comment1 -', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_COMMENT', - 'content' => '// Comment2 -', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_COMMENT', - 'content' => '// Comment3 -', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - ], - ], - [ - '/* testMultiLineSlashCommentWithAnnotationStart */', - [ - [ - 'type' => 'T_PHPCS_IGNORE', - 'content' => '// phpcs:ignore Stnd.Cat -', - ], - [ - 'type' => 'T_COMMENT', - 'content' => '// Comment2 -', - ], - [ - 'type' => 'T_COMMENT', - 'content' => '// Comment3 -', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - ], - ], - [ - '/* testMultiLineSlashCommentWithAnnotationMiddle */', - [ - [ - 'type' => 'T_COMMENT', - 'content' => '// Comment1 -', - ], - [ - 'type' => 'T_PHPCS_IGNORE', - 'content' => '// @phpcs:ignore Stnd.Cat -', - ], - [ - 'type' => 'T_COMMENT', - 'content' => '// Comment3 -', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - ], - ], - [ - '/* testMultiLineSlashCommentWithAnnotationEnd */', - [ - [ - 'type' => 'T_COMMENT', - 'content' => '// Comment1 -', - ], - [ - 'type' => 'T_COMMENT', - 'content' => '// Comment2 -', - ], - [ - 'type' => 'T_PHPCS_IGNORE', - 'content' => '// phpcs:ignore Stnd.Cat -', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - ], - ], - [ - '/* testSingleLineStarComment */', - [ - [ - 'type' => 'T_COMMENT', - 'content' => '/* Single line star comment */', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - ], - ], - [ - '/* testSingleLineStarCommentTrailing */', - [ - [ - 'type' => 'T_COMMENT', - 'content' => '/* Comment */', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - ], - ], - [ - '/* testSingleLineStarAnnotation */', - [ - [ - 'type' => 'T_PHPCS_IGNORE', - 'content' => '/* phpcs:ignore Stnd.Cat */', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - ], - ], - [ - '/* testMultiLineStarComment */', - [ - [ - 'type' => 'T_COMMENT', - 'content' => '/* Comment1 -', - ], - [ - 'type' => 'T_COMMENT', - 'content' => ' * Comment2 -', - ], - [ - 'type' => 'T_COMMENT', - 'content' => ' * Comment3 */', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - ], - ], - [ - '/* testMultiLineStarCommentWithIndent */', - [ - [ - 'type' => 'T_COMMENT', - 'content' => '/* Comment1 -', - ], - [ - 'type' => 'T_COMMENT', - 'content' => ' * Comment2 -', - ], - [ - 'type' => 'T_COMMENT', - 'content' => ' * Comment3 */', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - ], - ], - [ - '/* testMultiLineStarCommentWithAnnotationStart */', - [ - [ - 'type' => 'T_PHPCS_IGNORE', - 'content' => '/* @phpcs:ignore Stnd.Cat -', - ], - [ - 'type' => 'T_COMMENT', - 'content' => ' * Comment2 -', - ], - [ - 'type' => 'T_COMMENT', - 'content' => ' * Comment3 */', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - ], - ], - [ - '/* testMultiLineStarCommentWithAnnotationMiddle */', - [ - [ - 'type' => 'T_COMMENT', - 'content' => '/* Comment1 -', - ], - [ - 'type' => 'T_PHPCS_IGNORE', - 'content' => ' * phpcs:ignore Stnd.Cat -', - ], - [ - 'type' => 'T_COMMENT', - 'content' => ' * Comment3 */', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - ], - ], - [ - '/* testMultiLineStarCommentWithAnnotationEnd */', - [ - [ - 'type' => 'T_COMMENT', - 'content' => '/* Comment1 -', - ], - [ - 'type' => 'T_COMMENT', - 'content' => ' * Comment2 -', - ], - [ - 'type' => 'T_PHPCS_IGNORE', - 'content' => ' * phpcs:ignore Stnd.Cat */', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - ], - ], - - [ - '/* testSingleLineDocblockComment */', - [ - [ - 'type' => 'T_DOC_COMMENT_OPEN_TAG', - 'content' => '/**', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_DOC_COMMENT_STRING', - 'content' => 'Comment ', - ], - [ - 'type' => 'T_DOC_COMMENT_CLOSE_TAG', - 'content' => '*/', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - ], - ], - [ - '/* testSingleLineDocblockCommentTrailing */', - [ - [ - 'type' => 'T_DOC_COMMENT_OPEN_TAG', - 'content' => '/**', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_DOC_COMMENT_STRING', - 'content' => 'Comment ', - ], - [ - 'type' => 'T_DOC_COMMENT_CLOSE_TAG', - 'content' => '*/', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - ], - ], - [ - '/* testSingleLineDocblockAnnotation */', - [ - [ - 'type' => 'T_DOC_COMMENT_OPEN_TAG', - 'content' => '/**', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_PHPCS_IGNORE', - 'content' => 'phpcs:ignore Stnd.Cat.Sniff ', - ], - [ - 'type' => 'T_DOC_COMMENT_CLOSE_TAG', - 'content' => '*/', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - ], - ], - - [ - '/* testMultiLineDocblockComment */', - [ - [ - 'type' => 'T_DOC_COMMENT_OPEN_TAG', - 'content' => '/**', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' -', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_DOC_COMMENT_STAR', - 'content' => '*', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_DOC_COMMENT_STRING', - 'content' => 'Comment1', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' -', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_DOC_COMMENT_STAR', - 'content' => '*', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_DOC_COMMENT_STRING', - 'content' => 'Comment2', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' -', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_DOC_COMMENT_STAR', - 'content' => '*', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' -', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_DOC_COMMENT_STAR', - 'content' => '*', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_DOC_COMMENT_TAG', - 'content' => '@tag', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_DOC_COMMENT_STRING', - 'content' => 'Comment', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' -', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_DOC_COMMENT_CLOSE_TAG', - 'content' => '*/', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - ], - ], - [ - '/* testMultiLineDocblockCommentWithIndent */', - [ - [ - 'type' => 'T_DOC_COMMENT_OPEN_TAG', - 'content' => '/**', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' -', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_DOC_COMMENT_STAR', - 'content' => '*', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_DOC_COMMENT_STRING', - 'content' => 'Comment1', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' -', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_DOC_COMMENT_STAR', - 'content' => '*', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_DOC_COMMENT_STRING', - 'content' => 'Comment2', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' -', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_DOC_COMMENT_STAR', - 'content' => '*', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' -', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_DOC_COMMENT_STAR', - 'content' => '*', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_DOC_COMMENT_TAG', - 'content' => '@tag', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_DOC_COMMENT_STRING', - 'content' => 'Comment', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' -', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_DOC_COMMENT_CLOSE_TAG', - 'content' => '*/', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - ], - ], - [ - '/* testMultiLineDocblockCommentWithAnnotation */', - [ - [ - 'type' => 'T_DOC_COMMENT_OPEN_TAG', - 'content' => '/**', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' -', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_DOC_COMMENT_STAR', - 'content' => '*', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_DOC_COMMENT_STRING', - 'content' => 'Comment', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' -', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_DOC_COMMENT_STAR', - 'content' => '*', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' -', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_DOC_COMMENT_STAR', - 'content' => '*', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_PHPCS_IGNORE', - 'content' => 'phpcs:ignore Stnd.Cat', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' -', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_DOC_COMMENT_STAR', - 'content' => '*', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_DOC_COMMENT_TAG', - 'content' => '@tag', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_DOC_COMMENT_STRING', - 'content' => 'Comment', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' -', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_DOC_COMMENT_CLOSE_TAG', - 'content' => '*/', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - ], - ], - [ - '/* testMultiLineDocblockCommentWithTagAnnotation */', - [ - [ - 'type' => 'T_DOC_COMMENT_OPEN_TAG', - 'content' => '/**', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' -', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_DOC_COMMENT_STAR', - 'content' => '*', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_DOC_COMMENT_STRING', - 'content' => 'Comment', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' -', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_DOC_COMMENT_STAR', - 'content' => '*', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' -', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_DOC_COMMENT_STAR', - 'content' => '*', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_PHPCS_IGNORE', - 'content' => '@phpcs:ignore Stnd.Cat', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' -', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_DOC_COMMENT_STAR', - 'content' => '*', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_DOC_COMMENT_TAG', - 'content' => '@tag', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_DOC_COMMENT_STRING', - 'content' => 'Comment', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' -', - ], - [ - 'type' => 'T_DOC_COMMENT_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_DOC_COMMENT_CLOSE_TAG', - 'content' => '*/', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - ], - ], - [ - '/* testSingleLineHashComment */', - [ - [ - 'type' => 'T_COMMENT', - 'content' => '# Comment -', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - ], - ], - [ - '/* testSingleLineHashCommentTrailing */', - [ - [ - 'type' => 'T_COMMENT', - 'content' => '# Comment -', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - ], - ], - [ - '/* testMultiLineHashComment */', - [ - [ - 'type' => 'T_COMMENT', - 'content' => '# Comment1 -', - ], - [ - 'type' => 'T_COMMENT', - 'content' => '# Comment2 -', - ], - [ - 'type' => 'T_COMMENT', - 'content' => '# Comment3 -', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - ], - ], - [ - '/* testMultiLineHashCommentWithIndent */', - [ - [ - 'type' => 'T_COMMENT', - 'content' => '# Comment1 -', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_COMMENT', - 'content' => '# Comment2 -', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_COMMENT', - 'content' => '# Comment3 -', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - ], - ], - [ - '/* testSingleLineSlashCommentNoNewLineAtEnd */', - [ - [ - 'type' => 'T_COMMENT', - 'content' => '// Slash ', - ], - [ - 'type' => 'T_CLOSE_TAG', - 'content' => '?> -', - ], - ], - ], - [ - '/* testSingleLineHashCommentNoNewLineAtEnd */', - [ - [ - 'type' => 'T_COMMENT', - 'content' => '# Hash ', - ], - [ - 'type' => 'T_CLOSE_TAG', - 'content' => '?> -', - ], - ], - ], - [ - '/* testCommentAtEndOfFile */', - [ - [ - 'type' => 'T_COMMENT', - 'content' => '/* Comment', - ], - ], - ], - ]; - - }//end dataCommentTokenization() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/StableCommentWhitespaceWinTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/StableCommentWhitespaceWinTest.inc deleted file mode 100644 index dc98eb0..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/StableCommentWhitespaceWinTest.inc +++ /dev/null @@ -1,63 +0,0 @@ - - - - * @copyright 2020 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tests\Core\Tokenizer; - -use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest; -use PHP_CodeSniffer\Util\Tokens; - -class StableCommentWhitespaceWinTest extends AbstractMethodUnitTest -{ - - - /** - * Test that comment tokenization with new lines at the end of the comment is stable. - * - * @param string $testMarker The comment prefacing the test. - * @param array $expectedTokens The tokenization expected. - * - * @dataProvider dataCommentTokenization - * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize - * - * @return void - */ - public function testCommentTokenization($testMarker, $expectedTokens) - { - $tokens = self::$phpcsFile->getTokens(); - $comment = $this->getTargetToken($testMarker, Tokens::$commentTokens); - - foreach ($expectedTokens as $key => $tokenInfo) { - $this->assertSame(constant($tokenInfo['type']), $tokens[$comment]['code']); - $this->assertSame($tokenInfo['type'], $tokens[$comment]['type']); - $this->assertSame($tokenInfo['content'], $tokens[$comment]['content']); - - ++$comment; - } - - }//end testCommentTokenization() - - - /** - * Data provider. - * - * @see testCommentTokenization() - * - * @return array - */ - public function dataCommentTokenization() - { - return [ - [ - '/* testSingleLineSlashComment */', - [ - [ - 'type' => 'T_COMMENT', - 'content' => '// Comment -', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - ], - ], - [ - '/* testSingleLineSlashCommentTrailing */', - [ - [ - 'type' => 'T_COMMENT', - 'content' => '// Comment -', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - ], - ], - [ - '/* testSingleLineSlashAnnotation */', - [ - [ - 'type' => 'T_PHPCS_DISABLE', - 'content' => '// phpcs:disable Stnd.Cat -', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - ], - ], - [ - '/* testMultiLineSlashComment */', - [ - [ - 'type' => 'T_COMMENT', - 'content' => '// Comment1 -', - ], - [ - 'type' => 'T_COMMENT', - 'content' => '// Comment2 -', - ], - [ - 'type' => 'T_COMMENT', - 'content' => '// Comment3 -', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - ], - ], - [ - '/* testMultiLineSlashCommentWithIndent */', - [ - [ - 'type' => 'T_COMMENT', - 'content' => '// Comment1 -', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_COMMENT', - 'content' => '// Comment2 -', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_COMMENT', - 'content' => '// Comment3 -', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - ], - ], - [ - '/* testMultiLineSlashCommentWithAnnotationStart */', - [ - [ - 'type' => 'T_PHPCS_IGNORE', - 'content' => '// phpcs:ignore Stnd.Cat -', - ], - [ - 'type' => 'T_COMMENT', - 'content' => '// Comment2 -', - ], - [ - 'type' => 'T_COMMENT', - 'content' => '// Comment3 -', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - ], - ], - [ - '/* testMultiLineSlashCommentWithAnnotationMiddle */', - [ - [ - 'type' => 'T_COMMENT', - 'content' => '// Comment1 -', - ], - [ - 'type' => 'T_PHPCS_IGNORE', - 'content' => '// @phpcs:ignore Stnd.Cat -', - ], - [ - 'type' => 'T_COMMENT', - 'content' => '// Comment3 -', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - ], - ], - [ - '/* testMultiLineSlashCommentWithAnnotationEnd */', - [ - [ - 'type' => 'T_COMMENT', - 'content' => '// Comment1 -', - ], - [ - 'type' => 'T_COMMENT', - 'content' => '// Comment2 -', - ], - [ - 'type' => 'T_PHPCS_IGNORE', - 'content' => '// phpcs:ignore Stnd.Cat -', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - ], - ], - [ - '/* testSingleLineSlashCommentNoNewLineAtEnd */', - [ - [ - 'type' => 'T_COMMENT', - 'content' => '// Slash ', - ], - [ - 'type' => 'T_CLOSE_TAG', - 'content' => '?> -', - ], - ], - ], - [ - '/* testSingleLineHashComment */', - [ - [ - 'type' => 'T_COMMENT', - 'content' => '# Comment -', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - ], - ], - [ - '/* testSingleLineHashCommentTrailing */', - [ - [ - 'type' => 'T_COMMENT', - 'content' => '# Comment -', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - ], - ], - [ - '/* testMultiLineHashComment */', - [ - [ - 'type' => 'T_COMMENT', - 'content' => '# Comment1 -', - ], - [ - 'type' => 'T_COMMENT', - 'content' => '# Comment2 -', - ], - [ - 'type' => 'T_COMMENT', - 'content' => '# Comment3 -', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - ], - ], - [ - '/* testMultiLineHashCommentWithIndent */', - [ - [ - 'type' => 'T_COMMENT', - 'content' => '# Comment1 -', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_COMMENT', - 'content' => '# Comment2 -', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_COMMENT', - 'content' => '# Comment3 -', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - ], - ], - [ - '/* testSingleLineHashCommentNoNewLineAtEnd */', - [ - [ - 'type' => 'T_COMMENT', - 'content' => '# Hash ', - ], - [ - 'type' => 'T_CLOSE_TAG', - 'content' => '?> -', - ], - ], - ], - [ - '/* testCommentAtEndOfFile */', - [ - [ - 'type' => 'T_COMMENT', - 'content' => '/* Comment', - ], - ], - ], - ]; - - }//end dataCommentTokenization() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/UndoNamespacedNameSingleTokenTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/UndoNamespacedNameSingleTokenTest.inc deleted file mode 100644 index 540f72c..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/UndoNamespacedNameSingleTokenTest.inc +++ /dev/null @@ -1,147 +0,0 @@ - - * @copyright 2020 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tests\Core\Tokenizer; - -use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest; - -class UndoNamespacedNameSingleTokenTest extends AbstractMethodUnitTest -{ - - - /** - * Test that identifier names are tokenized the same across PHP versions, based on the PHP 5/7 tokenization. - * - * @param string $testMarker The comment prefacing the test. - * @param array $expectedTokens The tokenization expected. - * - * @dataProvider dataIdentifierTokenization - * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize - * - * @return void - */ - public function testIdentifierTokenization($testMarker, $expectedTokens) - { - $tokens = self::$phpcsFile->getTokens(); - $identifier = $this->getTargetToken($testMarker, constant($expectedTokens[0]['type'])); - - foreach ($expectedTokens as $key => $tokenInfo) { - $this->assertSame(constant($tokenInfo['type']), $tokens[$identifier]['code']); - $this->assertSame($tokenInfo['type'], $tokens[$identifier]['type']); - $this->assertSame($tokenInfo['content'], $tokens[$identifier]['content']); - - ++$identifier; - } - - }//end testIdentifierTokenization() - - - /** - * Data provider. - * - * @see testIdentifierTokenization() - * - * @return array - */ - public function dataIdentifierTokenization() - { - return [ - [ - '/* testNamespaceDeclaration */', - [ - [ - 'type' => 'T_STRING', - 'content' => 'Package', - ], - [ - 'type' => 'T_SEMICOLON', - 'content' => ';', - ], - ], - ], - [ - '/* testNamespaceDeclarationWithLevels */', - [ - [ - 'type' => 'T_STRING', - 'content' => 'Vendor', - ], - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'SubLevel', - ], - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'Domain', - ], - [ - 'type' => 'T_SEMICOLON', - 'content' => ';', - ], - ], - ], - [ - '/* testUseStatement */', - [ - [ - 'type' => 'T_STRING', - 'content' => 'ClassName', - ], - [ - 'type' => 'T_SEMICOLON', - 'content' => ';', - ], - ], - ], - [ - '/* testUseStatementWithLevels */', - [ - [ - 'type' => 'T_STRING', - 'content' => 'Vendor', - ], - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'Level', - ], - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'Domain', - ], - [ - 'type' => 'T_SEMICOLON', - 'content' => ';', - ], - ], - ], - [ - '/* testFunctionUseStatement */', - [ - [ - 'type' => 'T_STRING', - 'content' => 'function', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_STRING', - 'content' => 'function_name', - ], - [ - 'type' => 'T_SEMICOLON', - 'content' => ';', - ], - ], - ], - [ - '/* testFunctionUseStatementWithLevels */', - [ - [ - 'type' => 'T_STRING', - 'content' => 'function', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_STRING', - 'content' => 'Vendor', - ], - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'Level', - ], - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'function_in_ns', - ], - [ - 'type' => 'T_SEMICOLON', - 'content' => ';', - ], - ], - ], - [ - '/* testConstantUseStatement */', - [ - [ - 'type' => 'T_STRING', - 'content' => 'const', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_STRING', - 'content' => 'CONSTANT_NAME', - ], - [ - 'type' => 'T_SEMICOLON', - 'content' => ';', - ], - ], - ], - [ - '/* testConstantUseStatementWithLevels */', - [ - [ - 'type' => 'T_STRING', - 'content' => 'const', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_STRING', - 'content' => 'Vendor', - ], - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'Level', - ], - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'OTHER_CONSTANT', - ], - [ - 'type' => 'T_SEMICOLON', - 'content' => ';', - ], - ], - ], - [ - '/* testMultiUseUnqualified */', - [ - [ - 'type' => 'T_STRING', - 'content' => 'UnqualifiedClassName', - ], - [ - 'type' => 'T_COMMA', - 'content' => ',', - ], - ], - ], - [ - '/* testMultiUsePartiallyQualified */', - [ - [ - 'type' => 'T_STRING', - 'content' => 'Sublevel', - ], - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'PartiallyClassName', - ], - [ - 'type' => 'T_SEMICOLON', - 'content' => ';', - ], - ], - ], - [ - '/* testGroupUseStatement */', - [ - [ - 'type' => 'T_STRING', - 'content' => 'Vendor', - ], - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'Level', - ], - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_OPEN_USE_GROUP', - 'content' => '{', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_STRING', - 'content' => 'AnotherDomain', - ], - [ - 'type' => 'T_COMMA', - 'content' => ',', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_STRING', - 'content' => 'function', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_STRING', - 'content' => 'function_grouped', - ], - [ - 'type' => 'T_COMMA', - 'content' => ',', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_STRING', - 'content' => 'const', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_STRING', - 'content' => 'CONSTANT_GROUPED', - ], - [ - 'type' => 'T_COMMA', - 'content' => ',', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_STRING', - 'content' => 'Sub', - ], - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'YetAnotherDomain', - ], - [ - 'type' => 'T_COMMA', - 'content' => ',', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_STRING', - 'content' => 'function', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_STRING', - 'content' => 'SubLevelA', - ], - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'function_grouped_too', - ], - [ - 'type' => 'T_COMMA', - 'content' => ',', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_STRING', - 'content' => 'const', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_STRING', - 'content' => 'SubLevelB', - ], - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'CONSTANT_GROUPED_TOO', - ], - [ - 'type' => 'T_COMMA', - 'content' => ',', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - [ - 'type' => 'T_CLOSE_USE_GROUP', - 'content' => '}', - ], - [ - 'type' => 'T_SEMICOLON', - 'content' => ';', - ], - ], - ], - [ - '/* testClassName */', - [ - [ - 'type' => 'T_STRING', - 'content' => 'MyClass', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - ], - ], - [ - '/* testExtendedFQN */', - [ - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'Vendor', - ], - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'Level', - ], - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'FQN', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - ], - ], - [ - '/* testImplementsRelative */', - [ - [ - 'type' => 'T_NAMESPACE', - 'content' => 'namespace', - ], - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'Name', - ], - [ - 'type' => 'T_COMMA', - 'content' => ',', - ], - ], - ], - [ - '/* testImplementsFQN */', - [ - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'Fully', - ], - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'Qualified', - ], - [ - 'type' => 'T_COMMA', - 'content' => ',', - ], - ], - ], - [ - '/* testImplementsUnqualified */', - [ - [ - 'type' => 'T_STRING', - 'content' => 'Unqualified', - ], - [ - 'type' => 'T_COMMA', - 'content' => ',', - ], - ], - ], - [ - '/* testImplementsPartiallyQualified */', - [ - [ - 'type' => 'T_STRING', - 'content' => 'Sub', - ], - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'Level', - ], - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'Name', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - ], - ], - [ - '/* testFunctionName */', - [ - [ - 'type' => 'T_STRING', - 'content' => 'function_name', - ], - [ - 'type' => 'T_OPEN_PARENTHESIS', - 'content' => '(', - ], - ], - ], - [ - '/* testTypeDeclarationRelative */', - [ - [ - 'type' => 'T_NAMESPACE', - 'content' => 'namespace', - ], - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'Name', - ], - [ - 'type' => 'T_TYPE_UNION', - 'content' => '|', - ], - [ - 'type' => 'T_STRING', - 'content' => 'object', - ], - ], - ], - [ - '/* testTypeDeclarationFQN */', - [ - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'Fully', - ], - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'Qualified', - ], - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'Name', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' ', - ], - ], - ], - [ - '/* testTypeDeclarationUnqualified */', - [ - [ - 'type' => 'T_STRING', - 'content' => 'Unqualified', - ], - [ - 'type' => 'T_TYPE_UNION', - 'content' => '|', - ], - [ - 'type' => 'T_FALSE', - 'content' => 'false', - ], - ], - ], - [ - '/* testTypeDeclarationPartiallyQualified */', - [ - [ - 'type' => 'T_NULLABLE', - 'content' => '?', - ], - [ - 'type' => 'T_STRING', - 'content' => 'Sublevel', - ], - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'Name', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' ', - ], - ], - ], - [ - '/* testReturnTypeFQN */', - [ - [ - 'type' => 'T_NULLABLE', - 'content' => '?', - ], - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'Name', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' ', - ], - ], - ], - [ - '/* testFunctionCallRelative */', - [ - [ - 'type' => 'T_NAMESPACE', - 'content' => 'NameSpace', - ], - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'function_name', - ], - [ - 'type' => 'T_OPEN_PARENTHESIS', - 'content' => '(', - ], - ], - ], - [ - '/* testFunctionCallFQN */', - [ - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'Vendor', - ], - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'Package', - ], - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'function_name', - ], - [ - 'type' => 'T_OPEN_PARENTHESIS', - 'content' => '(', - ], - ], - ], - [ - '/* testFunctionCallUnqualified */', - [ - [ - 'type' => 'T_STRING', - 'content' => 'function_name', - ], - [ - 'type' => 'T_OPEN_PARENTHESIS', - 'content' => '(', - ], - ], - ], - [ - '/* testFunctionPartiallyQualified */', - [ - [ - 'type' => 'T_STRING', - 'content' => 'Level', - ], - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'function_name', - ], - [ - 'type' => 'T_OPEN_PARENTHESIS', - 'content' => '(', - ], - ], - ], - [ - '/* testCatchRelative */', - [ - [ - 'type' => 'T_NAMESPACE', - 'content' => 'namespace', - ], - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'SubLevel', - ], - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'Exception', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' ', - ], - ], - ], - [ - '/* testCatchFQN */', - [ - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'Exception', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' ', - ], - ], - ], - [ - '/* testCatchUnqualified */', - [ - [ - 'type' => 'T_STRING', - 'content' => 'Exception', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' ', - ], - ], - ], - [ - '/* testCatchPartiallyQualified */', - [ - [ - 'type' => 'T_STRING', - 'content' => 'Level', - ], - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'Exception', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' ', - ], - ], - ], - [ - '/* testNewRelative */', - [ - [ - 'type' => 'T_NAMESPACE', - 'content' => 'namespace', - ], - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'ClassName', - ], - [ - 'type' => 'T_OPEN_PARENTHESIS', - 'content' => '(', - ], - ], - ], - [ - '/* testNewFQN */', - [ - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'Vendor', - ], - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'ClassName', - ], - [ - 'type' => 'T_OPEN_PARENTHESIS', - 'content' => '(', - ], - ], - ], - [ - '/* testNewUnqualified */', - [ - [ - 'type' => 'T_STRING', - 'content' => 'ClassName', - ], - [ - 'type' => 'T_SEMICOLON', - 'content' => ';', - ], - ], - ], - [ - '/* testNewPartiallyQualified */', - [ - [ - 'type' => 'T_STRING', - 'content' => 'Level', - ], - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'ClassName', - ], - [ - 'type' => 'T_SEMICOLON', - 'content' => ';', - ], - ], - ], - [ - '/* testDoubleColonRelative */', - [ - [ - 'type' => 'T_NAMESPACE', - 'content' => 'namespace', - ], - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'ClassName', - ], - [ - 'type' => 'T_DOUBLE_COLON', - 'content' => '::', - ], - ], - ], - [ - '/* testDoubleColonFQN */', - [ - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'ClassName', - ], - [ - 'type' => 'T_DOUBLE_COLON', - 'content' => '::', - ], - ], - ], - [ - '/* testDoubleColonUnqualified */', - [ - [ - 'type' => 'T_STRING', - 'content' => 'ClassName', - ], - [ - 'type' => 'T_DOUBLE_COLON', - 'content' => '::', - ], - ], - ], - [ - '/* testDoubleColonPartiallyQualified */', - [ - [ - 'type' => 'T_STRING', - 'content' => 'Level', - ], - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'ClassName', - ], - [ - 'type' => 'T_DOUBLE_COLON', - 'content' => '::', - ], - ], - ], - [ - '/* testInstanceOfRelative */', - [ - [ - 'type' => 'T_NAMESPACE', - 'content' => 'namespace', - ], - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'ClassName', - ], - [ - 'type' => 'T_SEMICOLON', - 'content' => ';', - ], - ], - ], - [ - '/* testInstanceOfFQN */', - [ - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'Full', - ], - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'ClassName', - ], - [ - 'type' => 'T_CLOSE_PARENTHESIS', - 'content' => ')', - ], - ], - ], - [ - '/* testInstanceOfUnqualified */', - [ - [ - 'type' => 'T_STRING', - 'content' => 'ClassName', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' ', - ], - ], - ], - [ - '/* testInstanceOfPartiallyQualified */', - [ - [ - 'type' => 'T_STRING', - 'content' => 'Partially', - ], - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'ClassName', - ], - [ - 'type' => 'T_SEMICOLON', - 'content' => ';', - ], - ], - ], - [ - '/* testInvalidInPHP8Whitespace */', - [ - [ - 'type' => 'T_NAMESPACE', - 'content' => 'namespace', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_STRING', - 'content' => 'Sublevel', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_STRING', - 'content' => 'function_name', - ], - [ - 'type' => 'T_OPEN_PARENTHESIS', - 'content' => '(', - ], - ], - ], - [ - '/* testInvalidInPHP8Comments */', - [ - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'Fully', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_PHPCS_IGNORE', - 'content' => '// phpcs:ignore Stnd.Cat.Sniff -- for reasons -', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'Qualified', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_COMMENT', - 'content' => '/* comment */', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' ', - ], - [ - 'type' => 'T_NS_SEPARATOR', - 'content' => '\\', - ], - [ - 'type' => 'T_STRING', - 'content' => 'Name', - ], - [ - 'type' => 'T_WHITESPACE', - 'content' => ' -', - ], - ], - ], - ]; - - }//end dataIdentifierTokenization() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/FileList.php b/vendor/squizlabs/php_codesniffer/tests/FileList.php deleted file mode 100644 index 8ef57b7..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/FileList.php +++ /dev/null @@ -1,94 +0,0 @@ - - * @copyright 2019 Juliette Reinders Folmer. All rights reserved. - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tests; - -class FileList -{ - - /** - * The path to the project root directory. - * - * @var string - */ - protected $rootPath; - - /** - * Recursive directory iterator. - * - * @var \DirectoryIterator - */ - public $fileIterator; - - /** - * Base regex to use if no filter regex is provided. - * - * Matches based on: - * - File path starts with the project root (replacement done in constructor). - * - Don't match .git/ files. - * - Don't match dot files, i.e. "." or "..". - * - Don't match backup files. - * - Match everything else in a case-insensitive manner. - * - * @var string - */ - private $baseRegex = '`^%s(?!\.git/)(?!(.*/)?\.+$)(?!.*\.(bak|orig)).*$`Dix'; - - - /** - * Constructor. - * - * @param string $directory The directory to examine. - * @param string $rootPath Path to the project root. - * @param string $filter PCRE regular expression to filter the file list with. - */ - public function __construct($directory, $rootPath='', $filter='') - { - $this->rootPath = $rootPath; - - $directory = new \RecursiveDirectoryIterator( - $directory, - \RecursiveDirectoryIterator::UNIX_PATHS - ); - $flattened = new \RecursiveIteratorIterator( - $directory, - \RecursiveIteratorIterator::LEAVES_ONLY, - \RecursiveIteratorIterator::CATCH_GET_CHILD - ); - - if ($filter === '') { - $filter = sprintf($this->baseRegex, preg_quote($this->rootPath)); - } - - $this->fileIterator = new \RegexIterator($flattened, $filter); - - return $this; - - }//end __construct() - - - /** - * Retrieve the filtered file list as an array. - * - * @return array - */ - public function getList() - { - $fileList = []; - - foreach ($this->fileIterator as $file) { - $fileList[] = str_replace($this->rootPath, '', $file); - } - - return $fileList; - - }//end getList() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Standards/AbstractSniffUnitTest.php b/vendor/squizlabs/php_codesniffer/tests/Standards/AbstractSniffUnitTest.php deleted file mode 100644 index c050a0c..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Standards/AbstractSniffUnitTest.php +++ /dev/null @@ -1,461 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tests\Standards; - -use PHP_CodeSniffer\Config; -use PHP_CodeSniffer\Exceptions\RuntimeException; -use PHP_CodeSniffer\Ruleset; -use PHP_CodeSniffer\Files\LocalFile; -use PHP_CodeSniffer\Util\Common; -use PHPUnit\Framework\TestCase; - -abstract class AbstractSniffUnitTest extends TestCase -{ - - /** - * Enable or disable the backup and restoration of the $GLOBALS array. - * Overwrite this attribute in a child class of TestCase. - * Setting this attribute in setUp() has no effect! - * - * @var boolean - */ - protected $backupGlobals = false; - - /** - * The path to the standard's main directory. - * - * @var string - */ - public $standardsDir = null; - - /** - * The path to the standard's test directory. - * - * @var string - */ - public $testsDir = null; - - - /** - * Sets up this unit test. - * - * @return void - */ - protected function setUp() - { - $class = get_class($this); - $this->standardsDir = $GLOBALS['PHP_CODESNIFFER_STANDARD_DIRS'][$class]; - $this->testsDir = $GLOBALS['PHP_CODESNIFFER_TEST_DIRS'][$class]; - - }//end setUp() - - - /** - * Get a list of all test files to check. - * - * These will have the same base as the sniff name but different extensions. - * We ignore the .php file as it is the class. - * - * @param string $testFileBase The base path that the unit tests files will have. - * - * @return string[] - */ - protected function getTestFiles($testFileBase) - { - $testFiles = []; - - $dir = substr($testFileBase, 0, strrpos($testFileBase, DIRECTORY_SEPARATOR)); - $di = new \DirectoryIterator($dir); - - foreach ($di as $file) { - $path = $file->getPathname(); - if (substr($path, 0, strlen($testFileBase)) === $testFileBase) { - if ($path !== $testFileBase.'php' && substr($path, -5) !== 'fixed' && substr($path, -4) !== '.bak') { - $testFiles[] = $path; - } - } - } - - // Put them in order. - sort($testFiles); - - return $testFiles; - - }//end getTestFiles() - - - /** - * Should this test be skipped for some reason. - * - * @return boolean - */ - protected function shouldSkipTest() - { - return false; - - }//end shouldSkipTest() - - - /** - * Tests the extending classes Sniff class. - * - * @return void - * @throws \PHPUnit\Framework\Exception - */ - final public function testSniff() - { - // Skip this test if we can't run in this environment. - if ($this->shouldSkipTest() === true) { - $this->markTestSkipped(); - } - - $sniffCode = Common::getSniffCode(get_class($this)); - list($standardName, $categoryName, $sniffName) = explode('.', $sniffCode); - - $testFileBase = $this->testsDir.$categoryName.DIRECTORY_SEPARATOR.$sniffName.'UnitTest.'; - - // Get a list of all test files to check. - $testFiles = $this->getTestFiles($testFileBase); - $GLOBALS['PHP_CODESNIFFER_SNIFF_CASE_FILES'][] = $testFiles; - - if (isset($GLOBALS['PHP_CODESNIFFER_CONFIG']) === true) { - $config = $GLOBALS['PHP_CODESNIFFER_CONFIG']; - } else { - $config = new Config(); - $config->cache = false; - $GLOBALS['PHP_CODESNIFFER_CONFIG'] = $config; - } - - $config->standards = [$standardName]; - $config->sniffs = [$sniffCode]; - $config->ignored = []; - - if (isset($GLOBALS['PHP_CODESNIFFER_RULESETS']) === false) { - $GLOBALS['PHP_CODESNIFFER_RULESETS'] = []; - } - - if (isset($GLOBALS['PHP_CODESNIFFER_RULESETS'][$standardName]) === false) { - $ruleset = new Ruleset($config); - $GLOBALS['PHP_CODESNIFFER_RULESETS'][$standardName] = $ruleset; - } - - $ruleset = $GLOBALS['PHP_CODESNIFFER_RULESETS'][$standardName]; - - $sniffFile = $this->standardsDir.DIRECTORY_SEPARATOR.'Sniffs'.DIRECTORY_SEPARATOR.$categoryName.DIRECTORY_SEPARATOR.$sniffName.'Sniff.php'; - - $sniffClassName = substr(get_class($this), 0, -8).'Sniff'; - $sniffClassName = str_replace('\Tests\\', '\Sniffs\\', $sniffClassName); - $sniffClassName = Common::cleanSniffClass($sniffClassName); - - $restrictions = [strtolower($sniffClassName) => true]; - $ruleset->registerSniffs([$sniffFile], $restrictions, []); - $ruleset->populateTokenListeners(); - - $failureMessages = []; - foreach ($testFiles as $testFile) { - $filename = basename($testFile); - $oldConfig = $config->getSettings(); - - try { - $this->setCliValues($filename, $config); - $phpcsFile = new LocalFile($testFile, $ruleset, $config); - $phpcsFile->process(); - } catch (RuntimeException $e) { - $this->fail('An unexpected exception has been caught: '.$e->getMessage()); - } - - $failures = $this->generateFailureMessages($phpcsFile); - $failureMessages = array_merge($failureMessages, $failures); - - if ($phpcsFile->getFixableCount() > 0) { - // Attempt to fix the errors. - $phpcsFile->fixer->fixFile(); - $fixable = $phpcsFile->getFixableCount(); - if ($fixable > 0) { - $failureMessages[] = "Failed to fix $fixable fixable violations in $filename"; - } - - // Check for a .fixed file to check for accuracy of fixes. - $fixedFile = $testFile.'.fixed'; - if (file_exists($fixedFile) === true) { - $diff = $phpcsFile->fixer->generateDiff($fixedFile); - if (trim($diff) !== '') { - $filename = basename($testFile); - $fixedFilename = basename($fixedFile); - $failureMessages[] = "Fixed version of $filename does not match expected version in $fixedFilename; the diff is\n$diff"; - } - } - } - - // Restore the config. - $config->setSettings($oldConfig); - }//end foreach - - if (empty($failureMessages) === false) { - $this->fail(implode(PHP_EOL, $failureMessages)); - } - - }//end testSniff() - - - /** - * Generate a list of test failures for a given sniffed file. - * - * @param \PHP_CodeSniffer\Files\LocalFile $file The file being tested. - * - * @return array - * @throws \PHP_CodeSniffer\Exceptions\RuntimeException - */ - public function generateFailureMessages(LocalFile $file) - { - $testFile = $file->getFilename(); - - $foundErrors = $file->getErrors(); - $foundWarnings = $file->getWarnings(); - $expectedErrors = $this->getErrorList(basename($testFile)); - $expectedWarnings = $this->getWarningList(basename($testFile)); - - if (is_array($expectedErrors) === false) { - throw new RuntimeException('getErrorList() must return an array'); - } - - if (is_array($expectedWarnings) === false) { - throw new RuntimeException('getWarningList() must return an array'); - } - - /* - We merge errors and warnings together to make it easier - to iterate over them and produce the errors string. In this way, - we can report on errors and warnings in the same line even though - it's not really structured to allow that. - */ - - $allProblems = []; - $failureMessages = []; - - foreach ($foundErrors as $line => $lineErrors) { - foreach ($lineErrors as $column => $errors) { - if (isset($allProblems[$line]) === false) { - $allProblems[$line] = [ - 'expected_errors' => 0, - 'expected_warnings' => 0, - 'found_errors' => [], - 'found_warnings' => [], - ]; - } - - $foundErrorsTemp = []; - foreach ($allProblems[$line]['found_errors'] as $foundError) { - $foundErrorsTemp[] = $foundError; - } - - $errorsTemp = []; - foreach ($errors as $foundError) { - $errorsTemp[] = $foundError['message'].' ('.$foundError['source'].')'; - - $source = $foundError['source']; - if (in_array($source, $GLOBALS['PHP_CODESNIFFER_SNIFF_CODES'], true) === false) { - $GLOBALS['PHP_CODESNIFFER_SNIFF_CODES'][] = $source; - } - - if ($foundError['fixable'] === true - && in_array($source, $GLOBALS['PHP_CODESNIFFER_FIXABLE_CODES'], true) === false - ) { - $GLOBALS['PHP_CODESNIFFER_FIXABLE_CODES'][] = $source; - } - } - - $allProblems[$line]['found_errors'] = array_merge($foundErrorsTemp, $errorsTemp); - }//end foreach - - if (isset($expectedErrors[$line]) === true) { - $allProblems[$line]['expected_errors'] = $expectedErrors[$line]; - } else { - $allProblems[$line]['expected_errors'] = 0; - } - - unset($expectedErrors[$line]); - }//end foreach - - foreach ($expectedErrors as $line => $numErrors) { - if (isset($allProblems[$line]) === false) { - $allProblems[$line] = [ - 'expected_errors' => 0, - 'expected_warnings' => 0, - 'found_errors' => [], - 'found_warnings' => [], - ]; - } - - $allProblems[$line]['expected_errors'] = $numErrors; - } - - foreach ($foundWarnings as $line => $lineWarnings) { - foreach ($lineWarnings as $column => $warnings) { - if (isset($allProblems[$line]) === false) { - $allProblems[$line] = [ - 'expected_errors' => 0, - 'expected_warnings' => 0, - 'found_errors' => [], - 'found_warnings' => [], - ]; - } - - $foundWarningsTemp = []; - foreach ($allProblems[$line]['found_warnings'] as $foundWarning) { - $foundWarningsTemp[] = $foundWarning; - } - - $warningsTemp = []; - foreach ($warnings as $warning) { - $warningsTemp[] = $warning['message'].' ('.$warning['source'].')'; - - $source = $warning['source']; - if (in_array($source, $GLOBALS['PHP_CODESNIFFER_SNIFF_CODES'], true) === false) { - $GLOBALS['PHP_CODESNIFFER_SNIFF_CODES'][] = $source; - } - - if ($warning['fixable'] === true - && in_array($source, $GLOBALS['PHP_CODESNIFFER_FIXABLE_CODES'], true) === false - ) { - $GLOBALS['PHP_CODESNIFFER_FIXABLE_CODES'][] = $source; - } - } - - $allProblems[$line]['found_warnings'] = array_merge($foundWarningsTemp, $warningsTemp); - }//end foreach - - if (isset($expectedWarnings[$line]) === true) { - $allProblems[$line]['expected_warnings'] = $expectedWarnings[$line]; - } else { - $allProblems[$line]['expected_warnings'] = 0; - } - - unset($expectedWarnings[$line]); - }//end foreach - - foreach ($expectedWarnings as $line => $numWarnings) { - if (isset($allProblems[$line]) === false) { - $allProblems[$line] = [ - 'expected_errors' => 0, - 'expected_warnings' => 0, - 'found_errors' => [], - 'found_warnings' => [], - ]; - } - - $allProblems[$line]['expected_warnings'] = $numWarnings; - } - - // Order the messages by line number. - ksort($allProblems); - - foreach ($allProblems as $line => $problems) { - $numErrors = count($problems['found_errors']); - $numWarnings = count($problems['found_warnings']); - $expectedErrors = $problems['expected_errors']; - $expectedWarnings = $problems['expected_warnings']; - - $errors = ''; - $foundString = ''; - - if ($expectedErrors !== $numErrors || $expectedWarnings !== $numWarnings) { - $lineMessage = "[LINE $line]"; - $expectedMessage = 'Expected '; - $foundMessage = 'in '.basename($testFile).' but found '; - - if ($expectedErrors !== $numErrors) { - $expectedMessage .= "$expectedErrors error(s)"; - $foundMessage .= "$numErrors error(s)"; - if ($numErrors !== 0) { - $foundString .= 'error(s)'; - $errors .= implode(PHP_EOL.' -> ', $problems['found_errors']); - } - - if ($expectedWarnings !== $numWarnings) { - $expectedMessage .= ' and '; - $foundMessage .= ' and '; - if ($numWarnings !== 0) { - if ($foundString !== '') { - $foundString .= ' and '; - } - } - } - } - - if ($expectedWarnings !== $numWarnings) { - $expectedMessage .= "$expectedWarnings warning(s)"; - $foundMessage .= "$numWarnings warning(s)"; - if ($numWarnings !== 0) { - $foundString .= 'warning(s)'; - if (empty($errors) === false) { - $errors .= PHP_EOL.' -> '; - } - - $errors .= implode(PHP_EOL.' -> ', $problems['found_warnings']); - } - } - - $fullMessage = "$lineMessage $expectedMessage $foundMessage."; - if ($errors !== '') { - $fullMessage .= " The $foundString found were:".PHP_EOL." -> $errors"; - } - - $failureMessages[] = $fullMessage; - }//end if - }//end foreach - - return $failureMessages; - - }//end generateFailureMessages() - - - /** - * Get a list of CLI values to set before the file is tested. - * - * @param string $filename The name of the file being tested. - * @param \PHP_CodeSniffer\Config $config The config data for the run. - * - * @return void - */ - public function setCliValues($filename, $config) - { - return; - - }//end setCliValues() - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - abstract protected function getErrorList(); - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - abstract protected function getWarningList(); - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Standards/AllSniffs.php b/vendor/squizlabs/php_codesniffer/tests/Standards/AllSniffs.php deleted file mode 100644 index 24527dd..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/Standards/AllSniffs.php +++ /dev/null @@ -1,123 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tests\Standards; - -use PHP_CodeSniffer\Util\Standards; -use PHP_CodeSniffer\Autoload; -use PHPUnit\TextUI\TestRunner; -use PHPUnit\Framework\TestSuite; - -class AllSniffs -{ - - - /** - * Prepare the test runner. - * - * @return void - */ - public static function main() - { - TestRunner::run(self::suite()); - - }//end main() - - - /** - * Add all sniff unit tests into a test suite. - * - * Sniff unit tests are found by recursing through the 'Tests' directory - * of each installed coding standard. - * - * @return \PHPUnit\Framework\TestSuite - */ - public static function suite() - { - $GLOBALS['PHP_CODESNIFFER_SNIFF_CODES'] = []; - $GLOBALS['PHP_CODESNIFFER_FIXABLE_CODES'] = []; - $GLOBALS['PHP_CODESNIFFER_SNIFF_CASE_FILES'] = []; - - $suite = new TestSuite('PHP CodeSniffer Standards'); - - $isInstalled = !is_file(__DIR__.'/../../autoload.php'); - - // Optionally allow for ignoring the tests for one or more standards. - $ignoreTestsForStandards = getenv('PHPCS_IGNORE_TESTS'); - if ($ignoreTestsForStandards === false) { - $ignoreTestsForStandards = []; - } else { - $ignoreTestsForStandards = explode(',', $ignoreTestsForStandards); - } - - $installedStandards = self::getInstalledStandardDetails(); - - foreach ($installedStandards as $standard => $details) { - Autoload::addSearchPath($details['path'], $details['namespace']); - - // If the test is running PEAR installed, the built-in standards - // are split into different directories; one for the sniffs and - // a different file system location for tests. - if ($isInstalled === true && is_dir(dirname($details['path']).DIRECTORY_SEPARATOR.'Generic') === true) { - $testPath = realpath(__DIR__.'/../../src/Standards/'.$standard); - } else { - $testPath = $details['path']; - } - - if (in_array($standard, $ignoreTestsForStandards, true) === true) { - continue; - } - - $testsDir = $testPath.DIRECTORY_SEPARATOR.'Tests'.DIRECTORY_SEPARATOR; - if (is_dir($testsDir) === false) { - // No tests for this standard. - continue; - } - - $di = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($testsDir)); - - foreach ($di as $file) { - // Skip hidden files. - if (substr($file->getFilename(), 0, 1) === '.') { - continue; - } - - // Tests must have the extension 'php'. - $parts = explode('.', $file); - $ext = array_pop($parts); - if ($ext !== 'php') { - continue; - } - - $className = Autoload::loadFile($file->getPathname()); - $GLOBALS['PHP_CODESNIFFER_STANDARD_DIRS'][$className] = $details['path']; - $GLOBALS['PHP_CODESNIFFER_TEST_DIRS'][$className] = $testsDir; - $suite->addTestSuite($className); - } - }//end foreach - - return $suite; - - }//end suite() - - - /** - * Get the details of all coding standards installed. - * - * @return array - * @see Standards::getInstalledStandardDetails() - */ - protected static function getInstalledStandardDetails() - { - return Standards::getInstalledStandardDetails(true); - - }//end getInstalledStandardDetails() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/TestSuite.php b/vendor/squizlabs/php_codesniffer/tests/TestSuite.php deleted file mode 100644 index 9eb269f..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/TestSuite.php +++ /dev/null @@ -1,35 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tests; - -use PHPUnit\Framework\TestSuite as PHPUnit_TestSuite; -use PHPUnit\Framework\TestResult; - -class TestSuite extends PHPUnit_TestSuite -{ - - - /** - * Runs the tests and collects their result in a TestResult. - * - * @param \PHPUnit\Framework\TestResult $result A test result. - * - * @return \PHPUnit\Framework\TestResult - */ - public function run(TestResult $result=null) - { - $result = parent::run($result); - printPHPCodeSnifferTestOutput(); - return $result; - - }//end run() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/TestSuite7.php b/vendor/squizlabs/php_codesniffer/tests/TestSuite7.php deleted file mode 100644 index 43db293..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/TestSuite7.php +++ /dev/null @@ -1,35 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tests; - -use PHPUnit\Framework\TestSuite as PHPUnit_TestSuite; -use PHPUnit\Framework\TestResult; - -class TestSuite extends PHPUnit_TestSuite -{ - - - /** - * Runs the tests and collects their result in a TestResult. - * - * @param \PHPUnit\Framework\TestResult $result A test result. - * - * @return \PHPUnit\Framework\TestResult - */ - public function run(TestResult $result=null): TestResult - { - $result = parent::run($result); - printPHPCodeSnifferTestOutput(); - return $result; - - }//end run() - - -}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/bootstrap.php b/vendor/squizlabs/php_codesniffer/tests/bootstrap.php deleted file mode 100644 index 47084d1..0000000 --- a/vendor/squizlabs/php_codesniffer/tests/bootstrap.php +++ /dev/null @@ -1,91 +0,0 @@ - - * @copyright 2006-2017 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -if (defined('PHP_CODESNIFFER_IN_TESTS') === false) { - define('PHP_CODESNIFFER_IN_TESTS', true); -} - -if (defined('PHP_CODESNIFFER_CBF') === false) { - define('PHP_CODESNIFFER_CBF', false); -} - -if (defined('PHP_CODESNIFFER_VERBOSITY') === false) { - define('PHP_CODESNIFFER_VERBOSITY', 0); -} - -if (is_file(__DIR__.'/../autoload.php') === true) { - include_once __DIR__.'/../autoload.php'; -} else { - include_once 'PHP/CodeSniffer/autoload.php'; -} - -$tokens = new \PHP_CodeSniffer\Util\Tokens(); - -// Compatibility for PHPUnit < 6 and PHPUnit 6+. -if (class_exists('PHPUnit_Framework_TestSuite') === true && class_exists('PHPUnit\Framework\TestSuite') === false) { - class_alias('PHPUnit_Framework_TestSuite', 'PHPUnit'.'\Framework\TestSuite'); -} - -if (class_exists('PHPUnit_Framework_TestCase') === true && class_exists('PHPUnit\Framework\TestCase') === false) { - class_alias('PHPUnit_Framework_TestCase', 'PHPUnit'.'\Framework\TestCase'); -} - -if (class_exists('PHPUnit_TextUI_TestRunner') === true && class_exists('PHPUnit\TextUI\TestRunner') === false) { - class_alias('PHPUnit_TextUI_TestRunner', 'PHPUnit'.'\TextUI\TestRunner'); -} - -if (class_exists('PHPUnit_Framework_TestResult') === true && class_exists('PHPUnit\Framework\TestResult') === false) { - class_alias('PHPUnit_Framework_TestResult', 'PHPUnit'.'\Framework\TestResult'); -} - -// Determine whether this is a PEAR install or not. -$GLOBALS['PHP_CODESNIFFER_PEAR'] = false; - -if (is_file(__DIR__.'/../autoload.php') === false) { - $GLOBALS['PHP_CODESNIFFER_PEAR'] = true; -} - - -/** - * A global util function to help print unit test fixing data. - * - * @return void - */ -function printPHPCodeSnifferTestOutput() -{ - echo PHP_EOL.PHP_EOL; - - $output = 'The test files'; - $data = []; - - $codeCount = count($GLOBALS['PHP_CODESNIFFER_SNIFF_CODES']); - if (empty($GLOBALS['PHP_CODESNIFFER_SNIFF_CASE_FILES']) === false) { - $files = call_user_func_array('array_merge', $GLOBALS['PHP_CODESNIFFER_SNIFF_CASE_FILES']); - $files = array_unique($files); - $fileCount = count($files); - - $output = '%d sniff test files'; - $data[] = $fileCount; - } - - $output .= ' generated %d unique error codes'; - $data[] = $codeCount; - - if ($codeCount > 0) { - $fixes = count($GLOBALS['PHP_CODESNIFFER_FIXABLE_CODES']); - $percent = round(($fixes / $codeCount * 100), 2); - - $output .= '; %d were fixable (%d%%)'; - $data[] = $fixes; - $data[] = $percent; - } - - vprintf($output, $data); - -}//end printPHPCodeSnifferTestOutput() diff --git a/vendor/symfony/console/Application.php b/vendor/symfony/console/Application.php deleted file mode 100644 index 15d537d..0000000 --- a/vendor/symfony/console/Application.php +++ /dev/null @@ -1,1278 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Command\HelpCommand; -use Symfony\Component\Console\Command\ListCommand; -use Symfony\Component\Console\CommandLoader\CommandLoaderInterface; -use Symfony\Component\Console\Event\ConsoleCommandEvent; -use Symfony\Component\Console\Event\ConsoleErrorEvent; -use Symfony\Component\Console\Event\ConsoleTerminateEvent; -use Symfony\Component\Console\Exception\CommandNotFoundException; -use Symfony\Component\Console\Exception\ExceptionInterface; -use Symfony\Component\Console\Exception\LogicException; -use Symfony\Component\Console\Exception\NamespaceNotFoundException; -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Helper\DebugFormatterHelper; -use Symfony\Component\Console\Helper\FormatterHelper; -use Symfony\Component\Console\Helper\Helper; -use Symfony\Component\Console\Helper\HelperSet; -use Symfony\Component\Console\Helper\ProcessHelper; -use Symfony\Component\Console\Helper\QuestionHelper; -use Symfony\Component\Console\Input\ArgvInput; -use Symfony\Component\Console\Input\ArrayInput; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputAwareInterface; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\ConsoleOutput; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Style\SymfonyStyle; -use Symfony\Component\Debug\ErrorHandler as LegacyErrorHandler; -use Symfony\Component\Debug\Exception\FatalThrowableError; -use Symfony\Component\ErrorHandler\ErrorHandler; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; -use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy; -use Symfony\Contracts\Service\ResetInterface; - -/** - * An Application is the container for a collection of commands. - * - * It is the main entry point of a Console application. - * - * This class is optimized for a standard CLI environment. - * - * Usage: - * - * $app = new Application('myapp', '1.0 (stable)'); - * $app->add(new SimpleCommand()); - * $app->run(); - * - * @author Fabien Potencier - */ -class Application implements ResetInterface -{ - private $commands = []; - private $wantHelps = false; - private $runningCommand; - private $name; - private $version; - private $commandLoader; - private $catchExceptions = true; - private $autoExit = true; - private $definition; - private $helperSet; - private $dispatcher; - private $terminal; - private $defaultCommand; - private $singleCommand = false; - private $initialized; - - /** - * @param string $name The name of the application - * @param string $version The version of the application - */ - public function __construct(string $name = 'UNKNOWN', string $version = 'UNKNOWN') - { - $this->name = $name; - $this->version = $version; - $this->terminal = new Terminal(); - $this->defaultCommand = 'list'; - } - - /** - * @final since Symfony 4.3, the type-hint will be updated to the interface from symfony/contracts in 5.0 - */ - public function setDispatcher(EventDispatcherInterface $dispatcher) - { - $this->dispatcher = LegacyEventDispatcherProxy::decorate($dispatcher); - } - - public function setCommandLoader(CommandLoaderInterface $commandLoader) - { - $this->commandLoader = $commandLoader; - } - - /** - * Runs the current application. - * - * @return int 0 if everything went fine, or an error code - * - * @throws \Exception When running fails. Bypass this when {@link setCatchExceptions()}. - */ - public function run(InputInterface $input = null, OutputInterface $output = null) - { - if (\function_exists('putenv')) { - @putenv('LINES='.$this->terminal->getHeight()); - @putenv('COLUMNS='.$this->terminal->getWidth()); - } - - if (null === $input) { - $input = new ArgvInput(); - } - - if (null === $output) { - $output = new ConsoleOutput(); - } - - $renderException = function (\Throwable $e) use ($output) { - if ($output instanceof ConsoleOutputInterface) { - $this->renderThrowable($e, $output->getErrorOutput()); - } else { - $this->renderThrowable($e, $output); - } - }; - if ($phpHandler = set_exception_handler($renderException)) { - restore_exception_handler(); - if (!\is_array($phpHandler) || (!$phpHandler[0] instanceof ErrorHandler && !$phpHandler[0] instanceof LegacyErrorHandler)) { - $errorHandler = true; - } elseif ($errorHandler = $phpHandler[0]->setExceptionHandler($renderException)) { - $phpHandler[0]->setExceptionHandler($errorHandler); - } - } - - $this->configureIO($input, $output); - - try { - $exitCode = $this->doRun($input, $output); - } catch (\Exception $e) { - if (!$this->catchExceptions) { - throw $e; - } - - $renderException($e); - - $exitCode = $e->getCode(); - if (is_numeric($exitCode)) { - $exitCode = (int) $exitCode; - if (0 === $exitCode) { - $exitCode = 1; - } - } else { - $exitCode = 1; - } - } finally { - // if the exception handler changed, keep it - // otherwise, unregister $renderException - if (!$phpHandler) { - if (set_exception_handler($renderException) === $renderException) { - restore_exception_handler(); - } - restore_exception_handler(); - } elseif (!$errorHandler) { - $finalHandler = $phpHandler[0]->setExceptionHandler(null); - if ($finalHandler !== $renderException) { - $phpHandler[0]->setExceptionHandler($finalHandler); - } - } - } - - if ($this->autoExit) { - if ($exitCode > 255) { - $exitCode = 255; - } - - exit($exitCode); - } - - return $exitCode; - } - - /** - * Runs the current application. - * - * @return int 0 if everything went fine, or an error code - */ - public function doRun(InputInterface $input, OutputInterface $output) - { - if (true === $input->hasParameterOption(['--version', '-V'], true)) { - $output->writeln($this->getLongVersion()); - - return 0; - } - - try { - // Makes ArgvInput::getFirstArgument() able to distinguish an option from an argument. - $input->bind($this->getDefinition()); - } catch (ExceptionInterface $e) { - // Errors must be ignored, full binding/validation happens later when the command is known. - } - - $name = $this->getCommandName($input); - if (true === $input->hasParameterOption(['--help', '-h'], true)) { - if (!$name) { - $name = 'help'; - $input = new ArrayInput(['command_name' => $this->defaultCommand]); - } else { - $this->wantHelps = true; - } - } - - if (!$name) { - $name = $this->defaultCommand; - $definition = $this->getDefinition(); - $definition->setArguments(array_merge( - $definition->getArguments(), - [ - 'command' => new InputArgument('command', InputArgument::OPTIONAL, $definition->getArgument('command')->getDescription(), $name), - ] - )); - } - - try { - $this->runningCommand = null; - // the command name MUST be the first element of the input - $command = $this->find($name); - } catch (\Throwable $e) { - if (!($e instanceof CommandNotFoundException && !$e instanceof NamespaceNotFoundException) || 1 !== \count($alternatives = $e->getAlternatives()) || !$input->isInteractive()) { - if (null !== $this->dispatcher) { - $event = new ConsoleErrorEvent($input, $output, $e); - $this->dispatcher->dispatch($event, ConsoleEvents::ERROR); - - if (0 === $event->getExitCode()) { - return 0; - } - - $e = $event->getError(); - } - - throw $e; - } - - $alternative = $alternatives[0]; - - $style = new SymfonyStyle($input, $output); - $style->block(sprintf("\nCommand \"%s\" is not defined.\n", $name), null, 'error'); - if (!$style->confirm(sprintf('Do you want to run "%s" instead? ', $alternative), false)) { - if (null !== $this->dispatcher) { - $event = new ConsoleErrorEvent($input, $output, $e); - $this->dispatcher->dispatch($event, ConsoleEvents::ERROR); - - return $event->getExitCode(); - } - - return 1; - } - - $command = $this->find($alternative); - } - - $this->runningCommand = $command; - $exitCode = $this->doRunCommand($command, $input, $output); - $this->runningCommand = null; - - return $exitCode; - } - - /** - * {@inheritdoc} - */ - public function reset() - { - } - - public function setHelperSet(HelperSet $helperSet) - { - $this->helperSet = $helperSet; - } - - /** - * Get the helper set associated with the command. - * - * @return HelperSet The HelperSet instance associated with this command - */ - public function getHelperSet() - { - if (!$this->helperSet) { - $this->helperSet = $this->getDefaultHelperSet(); - } - - return $this->helperSet; - } - - public function setDefinition(InputDefinition $definition) - { - $this->definition = $definition; - } - - /** - * Gets the InputDefinition related to this Application. - * - * @return InputDefinition The InputDefinition instance - */ - public function getDefinition() - { - if (!$this->definition) { - $this->definition = $this->getDefaultInputDefinition(); - } - - if ($this->singleCommand) { - $inputDefinition = $this->definition; - $inputDefinition->setArguments(); - - return $inputDefinition; - } - - return $this->definition; - } - - /** - * Gets the help message. - * - * @return string A help message - */ - public function getHelp() - { - return $this->getLongVersion(); - } - - /** - * Gets whether to catch exceptions or not during commands execution. - * - * @return bool Whether to catch exceptions or not during commands execution - */ - public function areExceptionsCaught() - { - return $this->catchExceptions; - } - - /** - * Sets whether to catch exceptions or not during commands execution. - * - * @param bool $boolean Whether to catch exceptions or not during commands execution - */ - public function setCatchExceptions($boolean) - { - $this->catchExceptions = (bool) $boolean; - } - - /** - * Gets whether to automatically exit after a command execution or not. - * - * @return bool Whether to automatically exit after a command execution or not - */ - public function isAutoExitEnabled() - { - return $this->autoExit; - } - - /** - * Sets whether to automatically exit after a command execution or not. - * - * @param bool $boolean Whether to automatically exit after a command execution or not - */ - public function setAutoExit($boolean) - { - $this->autoExit = (bool) $boolean; - } - - /** - * Gets the name of the application. - * - * @return string The application name - */ - public function getName() - { - return $this->name; - } - - /** - * Sets the application name. - * - * @param string $name The application name - */ - public function setName($name) - { - $this->name = $name; - } - - /** - * Gets the application version. - * - * @return string The application version - */ - public function getVersion() - { - return $this->version; - } - - /** - * Sets the application version. - * - * @param string $version The application version - */ - public function setVersion($version) - { - $this->version = $version; - } - - /** - * Returns the long version of the application. - * - * @return string The long application version - */ - public function getLongVersion() - { - if ('UNKNOWN' !== $this->getName()) { - if ('UNKNOWN' !== $this->getVersion()) { - return sprintf('%s %s', $this->getName(), $this->getVersion()); - } - - return $this->getName(); - } - - return 'Console Tool'; - } - - /** - * Registers a new command. - * - * @param string $name The command name - * - * @return Command The newly created command - */ - public function register($name) - { - return $this->add(new Command($name)); - } - - /** - * Adds an array of command objects. - * - * If a Command is not enabled it will not be added. - * - * @param Command[] $commands An array of commands - */ - public function addCommands(array $commands) - { - foreach ($commands as $command) { - $this->add($command); - } - } - - /** - * Adds a command object. - * - * If a command with the same name already exists, it will be overridden. - * If the command is not enabled it will not be added. - * - * @return Command|null The registered command if enabled or null - */ - public function add(Command $command) - { - $this->init(); - - $command->setApplication($this); - - if (!$command->isEnabled()) { - $command->setApplication(null); - - return null; - } - - // Will throw if the command is not correctly initialized. - $command->getDefinition(); - - if (!$command->getName()) { - throw new LogicException(sprintf('The command defined in "%s" cannot have an empty name.', \get_class($command))); - } - - $this->commands[$command->getName()] = $command; - - foreach ($command->getAliases() as $alias) { - $this->commands[$alias] = $command; - } - - return $command; - } - - /** - * Returns a registered command by name or alias. - * - * @param string $name The command name or alias - * - * @return Command A Command object - * - * @throws CommandNotFoundException When given command name does not exist - */ - public function get($name) - { - $this->init(); - - if (!$this->has($name)) { - throw new CommandNotFoundException(sprintf('The command "%s" does not exist.', $name)); - } - - // When the command has a different name than the one used at the command loader level - if (!isset($this->commands[$name])) { - throw new CommandNotFoundException(sprintf('The "%s" command cannot be found because it is registered under multiple names. Make sure you don\'t set a different name via constructor or "setName()".', $name)); - } - - $command = $this->commands[$name]; - - if ($this->wantHelps) { - $this->wantHelps = false; - - $helpCommand = $this->get('help'); - $helpCommand->setCommand($command); - - return $helpCommand; - } - - return $command; - } - - /** - * Returns true if the command exists, false otherwise. - * - * @param string $name The command name or alias - * - * @return bool true if the command exists, false otherwise - */ - public function has($name) - { - $this->init(); - - return isset($this->commands[$name]) || ($this->commandLoader && $this->commandLoader->has($name) && $this->add($this->commandLoader->get($name))); - } - - /** - * Returns an array of all unique namespaces used by currently registered commands. - * - * It does not return the global namespace which always exists. - * - * @return string[] An array of namespaces - */ - public function getNamespaces() - { - $namespaces = []; - foreach ($this->all() as $command) { - if ($command->isHidden()) { - continue; - } - - $namespaces = array_merge($namespaces, $this->extractAllNamespaces($command->getName())); - - foreach ($command->getAliases() as $alias) { - $namespaces = array_merge($namespaces, $this->extractAllNamespaces($alias)); - } - } - - return array_values(array_unique(array_filter($namespaces))); - } - - /** - * Finds a registered namespace by a name or an abbreviation. - * - * @param string $namespace A namespace or abbreviation to search for - * - * @return string A registered namespace - * - * @throws NamespaceNotFoundException When namespace is incorrect or ambiguous - */ - public function findNamespace($namespace) - { - $allNamespaces = $this->getNamespaces(); - $expr = preg_replace_callback('{([^:]+|)}', function ($matches) { return preg_quote($matches[1]).'[^:]*'; }, $namespace); - $namespaces = preg_grep('{^'.$expr.'}', $allNamespaces); - - if (empty($namespaces)) { - $message = sprintf('There are no commands defined in the "%s" namespace.', $namespace); - - if ($alternatives = $this->findAlternatives($namespace, $allNamespaces)) { - if (1 == \count($alternatives)) { - $message .= "\n\nDid you mean this?\n "; - } else { - $message .= "\n\nDid you mean one of these?\n "; - } - - $message .= implode("\n ", $alternatives); - } - - throw new NamespaceNotFoundException($message, $alternatives); - } - - $exact = \in_array($namespace, $namespaces, true); - if (\count($namespaces) > 1 && !$exact) { - throw new NamespaceNotFoundException(sprintf("The namespace \"%s\" is ambiguous.\nDid you mean one of these?\n%s.", $namespace, $this->getAbbreviationSuggestions(array_values($namespaces))), array_values($namespaces)); - } - - return $exact ? $namespace : reset($namespaces); - } - - /** - * Finds a command by name or alias. - * - * Contrary to get, this command tries to find the best - * match if you give it an abbreviation of a name or alias. - * - * @param string $name A command name or a command alias - * - * @return Command A Command instance - * - * @throws CommandNotFoundException When command name is incorrect or ambiguous - */ - public function find($name) - { - $this->init(); - - $aliases = []; - - foreach ($this->commands as $command) { - foreach ($command->getAliases() as $alias) { - if (!$this->has($alias)) { - $this->commands[$alias] = $command; - } - } - } - - if ($this->has($name)) { - return $this->get($name); - } - - $allCommands = $this->commandLoader ? array_merge($this->commandLoader->getNames(), array_keys($this->commands)) : array_keys($this->commands); - $expr = preg_replace_callback('{([^:]+|)}', function ($matches) { return preg_quote($matches[1]).'[^:]*'; }, $name); - $commands = preg_grep('{^'.$expr.'}', $allCommands); - - if (empty($commands)) { - $commands = preg_grep('{^'.$expr.'}i', $allCommands); - } - - // if no commands matched or we just matched namespaces - if (empty($commands) || \count(preg_grep('{^'.$expr.'$}i', $commands)) < 1) { - if (false !== $pos = strrpos($name, ':')) { - // check if a namespace exists and contains commands - $this->findNamespace(substr($name, 0, $pos)); - } - - $message = sprintf('Command "%s" is not defined.', $name); - - if ($alternatives = $this->findAlternatives($name, $allCommands)) { - // remove hidden commands - $alternatives = array_filter($alternatives, function ($name) { - return !$this->get($name)->isHidden(); - }); - - if (1 == \count($alternatives)) { - $message .= "\n\nDid you mean this?\n "; - } else { - $message .= "\n\nDid you mean one of these?\n "; - } - $message .= implode("\n ", $alternatives); - } - - throw new CommandNotFoundException($message, array_values($alternatives)); - } - - // filter out aliases for commands which are already on the list - if (\count($commands) > 1) { - $commandList = $this->commandLoader ? array_merge(array_flip($this->commandLoader->getNames()), $this->commands) : $this->commands; - $commands = array_unique(array_filter($commands, function ($nameOrAlias) use (&$commandList, $commands, &$aliases) { - if (!$commandList[$nameOrAlias] instanceof Command) { - $commandList[$nameOrAlias] = $this->commandLoader->get($nameOrAlias); - } - - $commandName = $commandList[$nameOrAlias]->getName(); - - $aliases[$nameOrAlias] = $commandName; - - return $commandName === $nameOrAlias || !\in_array($commandName, $commands); - })); - } - - if (\count($commands) > 1) { - $usableWidth = $this->terminal->getWidth() - 10; - $abbrevs = array_values($commands); - $maxLen = 0; - foreach ($abbrevs as $abbrev) { - $maxLen = max(Helper::strlen($abbrev), $maxLen); - } - $abbrevs = array_map(function ($cmd) use ($commandList, $usableWidth, $maxLen, &$commands) { - if ($commandList[$cmd]->isHidden()) { - unset($commands[array_search($cmd, $commands)]); - - return false; - } - - $abbrev = str_pad($cmd, $maxLen, ' ').' '.$commandList[$cmd]->getDescription(); - - return Helper::strlen($abbrev) > $usableWidth ? Helper::substr($abbrev, 0, $usableWidth - 3).'...' : $abbrev; - }, array_values($commands)); - - if (\count($commands) > 1) { - $suggestions = $this->getAbbreviationSuggestions(array_filter($abbrevs)); - - throw new CommandNotFoundException(sprintf("Command \"%s\" is ambiguous.\nDid you mean one of these?\n%s.", $name, $suggestions), array_values($commands)); - } - } - - $command = $this->get(reset($commands)); - - if ($command->isHidden()) { - @trigger_error(sprintf('Command "%s" is hidden, finding it using an abbreviation is deprecated since Symfony 4.4, use its full name instead.', $command->getName()), \E_USER_DEPRECATED); - } - - return $command; - } - - /** - * Gets the commands (registered in the given namespace if provided). - * - * The array keys are the full names and the values the command instances. - * - * @param string $namespace A namespace name - * - * @return Command[] An array of Command instances - */ - public function all($namespace = null) - { - $this->init(); - - if (null === $namespace) { - if (!$this->commandLoader) { - return $this->commands; - } - - $commands = $this->commands; - foreach ($this->commandLoader->getNames() as $name) { - if (!isset($commands[$name]) && $this->has($name)) { - $commands[$name] = $this->get($name); - } - } - - return $commands; - } - - $commands = []; - foreach ($this->commands as $name => $command) { - if ($namespace === $this->extractNamespace($name, substr_count($namespace, ':') + 1)) { - $commands[$name] = $command; - } - } - - if ($this->commandLoader) { - foreach ($this->commandLoader->getNames() as $name) { - if (!isset($commands[$name]) && $namespace === $this->extractNamespace($name, substr_count($namespace, ':') + 1) && $this->has($name)) { - $commands[$name] = $this->get($name); - } - } - } - - return $commands; - } - - /** - * Returns an array of possible abbreviations given a set of names. - * - * @param array $names An array of names - * - * @return array An array of abbreviations - */ - public static function getAbbreviations($names) - { - $abbrevs = []; - foreach ($names as $name) { - for ($len = \strlen($name); $len > 0; --$len) { - $abbrev = substr($name, 0, $len); - $abbrevs[$abbrev][] = $name; - } - } - - return $abbrevs; - } - - /** - * Renders a caught exception. - * - * @deprecated since Symfony 4.4, use "renderThrowable()" instead - */ - public function renderException(\Exception $e, OutputInterface $output) - { - @trigger_error(sprintf('The "%s::renderException()" method is deprecated since Symfony 4.4, use "renderThrowable()" instead.', __CLASS__), \E_USER_DEPRECATED); - - $output->writeln('', OutputInterface::VERBOSITY_QUIET); - - $this->doRenderException($e, $output); - - $this->finishRenderThrowableOrException($output); - } - - public function renderThrowable(\Throwable $e, OutputInterface $output): void - { - if (__CLASS__ !== static::class && __CLASS__ === (new \ReflectionMethod($this, 'renderThrowable'))->getDeclaringClass()->getName() && __CLASS__ !== (new \ReflectionMethod($this, 'renderException'))->getDeclaringClass()->getName()) { - @trigger_error(sprintf('The "%s::renderException()" method is deprecated since Symfony 4.4, use "renderThrowable()" instead.', __CLASS__), \E_USER_DEPRECATED); - - if (!$e instanceof \Exception) { - $e = class_exists(FatalThrowableError::class) ? new FatalThrowableError($e) : new \ErrorException($e->getMessage(), $e->getCode(), \E_ERROR, $e->getFile(), $e->getLine()); - } - - $this->renderException($e, $output); - - return; - } - - $output->writeln('', OutputInterface::VERBOSITY_QUIET); - - $this->doRenderThrowable($e, $output); - - $this->finishRenderThrowableOrException($output); - } - - private function finishRenderThrowableOrException(OutputInterface $output): void - { - if (null !== $this->runningCommand) { - $output->writeln(sprintf('%s', OutputFormatter::escape(sprintf($this->runningCommand->getSynopsis(), $this->getName()))), OutputInterface::VERBOSITY_QUIET); - $output->writeln('', OutputInterface::VERBOSITY_QUIET); - } - } - - /** - * @deprecated since Symfony 4.4, use "doRenderThrowable()" instead - */ - protected function doRenderException(\Exception $e, OutputInterface $output) - { - @trigger_error(sprintf('The "%s::doRenderException()" method is deprecated since Symfony 4.4, use "doRenderThrowable()" instead.', __CLASS__), \E_USER_DEPRECATED); - - $this->doActuallyRenderThrowable($e, $output); - } - - protected function doRenderThrowable(\Throwable $e, OutputInterface $output): void - { - if (__CLASS__ !== static::class && __CLASS__ === (new \ReflectionMethod($this, 'doRenderThrowable'))->getDeclaringClass()->getName() && __CLASS__ !== (new \ReflectionMethod($this, 'doRenderException'))->getDeclaringClass()->getName()) { - @trigger_error(sprintf('The "%s::doRenderException()" method is deprecated since Symfony 4.4, use "doRenderThrowable()" instead.', __CLASS__), \E_USER_DEPRECATED); - - if (!$e instanceof \Exception) { - $e = class_exists(FatalThrowableError::class) ? new FatalThrowableError($e) : new \ErrorException($e->getMessage(), $e->getCode(), \E_ERROR, $e->getFile(), $e->getLine()); - } - - $this->doRenderException($e, $output); - - return; - } - - $this->doActuallyRenderThrowable($e, $output); - } - - private function doActuallyRenderThrowable(\Throwable $e, OutputInterface $output): void - { - do { - $message = trim($e->getMessage()); - if ('' === $message || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { - $class = get_debug_type($e); - $title = sprintf(' [%s%s] ', $class, 0 !== ($code = $e->getCode()) ? ' ('.$code.')' : ''); - $len = Helper::strlen($title); - } else { - $len = 0; - } - - if (str_contains($message, "@anonymous\0")) { - $message = preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) { - return class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0]; - }, $message); - } - - $width = $this->terminal->getWidth() ? $this->terminal->getWidth() - 1 : \PHP_INT_MAX; - $lines = []; - foreach ('' !== $message ? preg_split('/\r?\n/', $message) : [] as $line) { - foreach ($this->splitStringByWidth($line, $width - 4) as $line) { - // pre-format lines to get the right string length - $lineLength = Helper::strlen($line) + 4; - $lines[] = [$line, $lineLength]; - - $len = max($lineLength, $len); - } - } - - $messages = []; - if (!$e instanceof ExceptionInterface || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { - $messages[] = sprintf('%s', OutputFormatter::escape(sprintf('In %s line %s:', basename($e->getFile()) ?: 'n/a', $e->getLine() ?: 'n/a'))); - } - $messages[] = $emptyLine = sprintf('%s', str_repeat(' ', $len)); - if ('' === $message || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { - $messages[] = sprintf('%s%s', $title, str_repeat(' ', max(0, $len - Helper::strlen($title)))); - } - foreach ($lines as $line) { - $messages[] = sprintf(' %s %s', OutputFormatter::escape($line[0]), str_repeat(' ', $len - $line[1])); - } - $messages[] = $emptyLine; - $messages[] = ''; - - $output->writeln($messages, OutputInterface::VERBOSITY_QUIET); - - if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { - $output->writeln('Exception trace:', OutputInterface::VERBOSITY_QUIET); - - // exception related properties - $trace = $e->getTrace(); - - array_unshift($trace, [ - 'function' => '', - 'file' => $e->getFile() ?: 'n/a', - 'line' => $e->getLine() ?: 'n/a', - 'args' => [], - ]); - - for ($i = 0, $count = \count($trace); $i < $count; ++$i) { - $class = $trace[$i]['class'] ?? ''; - $type = $trace[$i]['type'] ?? ''; - $function = $trace[$i]['function'] ?? ''; - $file = $trace[$i]['file'] ?? 'n/a'; - $line = $trace[$i]['line'] ?? 'n/a'; - - $output->writeln(sprintf(' %s%s at %s:%s', $class, $function ? $type.$function.'()' : '', $file, $line), OutputInterface::VERBOSITY_QUIET); - } - - $output->writeln('', OutputInterface::VERBOSITY_QUIET); - } - } while ($e = $e->getPrevious()); - } - - /** - * Configures the input and output instances based on the user arguments and options. - */ - protected function configureIO(InputInterface $input, OutputInterface $output) - { - if (true === $input->hasParameterOption(['--ansi'], true)) { - $output->setDecorated(true); - } elseif (true === $input->hasParameterOption(['--no-ansi'], true)) { - $output->setDecorated(false); - } - - if (true === $input->hasParameterOption(['--no-interaction', '-n'], true)) { - $input->setInteractive(false); - } - - switch ($shellVerbosity = (int) getenv('SHELL_VERBOSITY')) { - case -1: $output->setVerbosity(OutputInterface::VERBOSITY_QUIET); break; - case 1: $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE); break; - case 2: $output->setVerbosity(OutputInterface::VERBOSITY_VERY_VERBOSE); break; - case 3: $output->setVerbosity(OutputInterface::VERBOSITY_DEBUG); break; - default: $shellVerbosity = 0; break; - } - - if (true === $input->hasParameterOption(['--quiet', '-q'], true)) { - $output->setVerbosity(OutputInterface::VERBOSITY_QUIET); - $shellVerbosity = -1; - } else { - if ($input->hasParameterOption('-vvv', true) || $input->hasParameterOption('--verbose=3', true) || 3 === $input->getParameterOption('--verbose', false, true)) { - $output->setVerbosity(OutputInterface::VERBOSITY_DEBUG); - $shellVerbosity = 3; - } elseif ($input->hasParameterOption('-vv', true) || $input->hasParameterOption('--verbose=2', true) || 2 === $input->getParameterOption('--verbose', false, true)) { - $output->setVerbosity(OutputInterface::VERBOSITY_VERY_VERBOSE); - $shellVerbosity = 2; - } elseif ($input->hasParameterOption('-v', true) || $input->hasParameterOption('--verbose=1', true) || $input->hasParameterOption('--verbose', true) || $input->getParameterOption('--verbose', false, true)) { - $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE); - $shellVerbosity = 1; - } - } - - if (-1 === $shellVerbosity) { - $input->setInteractive(false); - } - - if (\function_exists('putenv')) { - @putenv('SHELL_VERBOSITY='.$shellVerbosity); - } - $_ENV['SHELL_VERBOSITY'] = $shellVerbosity; - $_SERVER['SHELL_VERBOSITY'] = $shellVerbosity; - } - - /** - * Runs the current command. - * - * If an event dispatcher has been attached to the application, - * events are also dispatched during the life-cycle of the command. - * - * @return int 0 if everything went fine, or an error code - */ - protected function doRunCommand(Command $command, InputInterface $input, OutputInterface $output) - { - foreach ($command->getHelperSet() as $helper) { - if ($helper instanceof InputAwareInterface) { - $helper->setInput($input); - } - } - - if (null === $this->dispatcher) { - return $command->run($input, $output); - } - - // bind before the console.command event, so the listeners have access to input options/arguments - try { - $command->mergeApplicationDefinition(); - $input->bind($command->getDefinition()); - } catch (ExceptionInterface $e) { - // ignore invalid options/arguments for now, to allow the event listeners to customize the InputDefinition - } - - $event = new ConsoleCommandEvent($command, $input, $output); - $e = null; - - try { - $this->dispatcher->dispatch($event, ConsoleEvents::COMMAND); - - if ($event->commandShouldRun()) { - $exitCode = $command->run($input, $output); - } else { - $exitCode = ConsoleCommandEvent::RETURN_CODE_DISABLED; - } - } catch (\Throwable $e) { - $event = new ConsoleErrorEvent($input, $output, $e, $command); - $this->dispatcher->dispatch($event, ConsoleEvents::ERROR); - $e = $event->getError(); - - if (0 === $exitCode = $event->getExitCode()) { - $e = null; - } - } - - $event = new ConsoleTerminateEvent($command, $input, $output, $exitCode); - $this->dispatcher->dispatch($event, ConsoleEvents::TERMINATE); - - if (null !== $e) { - throw $e; - } - - return $event->getExitCode(); - } - - /** - * Gets the name of the command based on input. - * - * @return string|null - */ - protected function getCommandName(InputInterface $input) - { - return $this->singleCommand ? $this->defaultCommand : $input->getFirstArgument(); - } - - /** - * Gets the default input definition. - * - * @return InputDefinition An InputDefinition instance - */ - protected function getDefaultInputDefinition() - { - return new InputDefinition([ - new InputArgument('command', InputArgument::REQUIRED, 'The command to execute'), - - new InputOption('--help', '-h', InputOption::VALUE_NONE, 'Display this help message'), - new InputOption('--quiet', '-q', InputOption::VALUE_NONE, 'Do not output any message'), - new InputOption('--verbose', '-v|vv|vvv', InputOption::VALUE_NONE, 'Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug'), - new InputOption('--version', '-V', InputOption::VALUE_NONE, 'Display this application version'), - new InputOption('--ansi', '', InputOption::VALUE_NONE, 'Force ANSI output'), - new InputOption('--no-ansi', '', InputOption::VALUE_NONE, 'Disable ANSI output'), - new InputOption('--no-interaction', '-n', InputOption::VALUE_NONE, 'Do not ask any interactive question'), - ]); - } - - /** - * Gets the default commands that should always be available. - * - * @return Command[] An array of default Command instances - */ - protected function getDefaultCommands() - { - return [new HelpCommand(), new ListCommand()]; - } - - /** - * Gets the default helper set with the helpers that should always be available. - * - * @return HelperSet A HelperSet instance - */ - protected function getDefaultHelperSet() - { - return new HelperSet([ - new FormatterHelper(), - new DebugFormatterHelper(), - new ProcessHelper(), - new QuestionHelper(), - ]); - } - - /** - * Returns abbreviated suggestions in string format. - */ - private function getAbbreviationSuggestions(array $abbrevs): string - { - return ' '.implode("\n ", $abbrevs); - } - - /** - * Returns the namespace part of the command name. - * - * This method is not part of public API and should not be used directly. - * - * @param string $name The full name of the command - * @param string $limit The maximum number of parts of the namespace - * - * @return string The namespace of the command - */ - public function extractNamespace($name, $limit = null) - { - $parts = explode(':', $name, -1); - - return implode(':', null === $limit ? $parts : \array_slice($parts, 0, $limit)); - } - - /** - * Finds alternative of $name among $collection, - * if nothing is found in $collection, try in $abbrevs. - * - * @return string[] A sorted array of similar string - */ - private function findAlternatives(string $name, iterable $collection): array - { - $threshold = 1e3; - $alternatives = []; - - $collectionParts = []; - foreach ($collection as $item) { - $collectionParts[$item] = explode(':', $item); - } - - foreach (explode(':', $name) as $i => $subname) { - foreach ($collectionParts as $collectionName => $parts) { - $exists = isset($alternatives[$collectionName]); - if (!isset($parts[$i]) && $exists) { - $alternatives[$collectionName] += $threshold; - continue; - } elseif (!isset($parts[$i])) { - continue; - } - - $lev = levenshtein($subname, $parts[$i]); - if ($lev <= \strlen($subname) / 3 || '' !== $subname && str_contains($parts[$i], $subname)) { - $alternatives[$collectionName] = $exists ? $alternatives[$collectionName] + $lev : $lev; - } elseif ($exists) { - $alternatives[$collectionName] += $threshold; - } - } - } - - foreach ($collection as $item) { - $lev = levenshtein($name, $item); - if ($lev <= \strlen($name) / 3 || str_contains($item, $name)) { - $alternatives[$item] = isset($alternatives[$item]) ? $alternatives[$item] - $lev : $lev; - } - } - - $alternatives = array_filter($alternatives, function ($lev) use ($threshold) { return $lev < 2 * $threshold; }); - ksort($alternatives, \SORT_NATURAL | \SORT_FLAG_CASE); - - return array_keys($alternatives); - } - - /** - * Sets the default Command name. - * - * @param string $commandName The Command name - * @param bool $isSingleCommand Set to true if there is only one command in this application - * - * @return self - */ - public function setDefaultCommand($commandName, $isSingleCommand = false) - { - $this->defaultCommand = $commandName; - - if ($isSingleCommand) { - // Ensure the command exist - $this->find($commandName); - - $this->singleCommand = true; - } - - return $this; - } - - /** - * @internal - */ - public function isSingleCommand(): bool - { - return $this->singleCommand; - } - - private function splitStringByWidth(string $string, int $width): array - { - // str_split is not suitable for multi-byte characters, we should use preg_split to get char array properly. - // additionally, array_slice() is not enough as some character has doubled width. - // we need a function to split string not by character count but by string width - if (false === $encoding = mb_detect_encoding($string, null, true)) { - return str_split($string, $width); - } - - $utf8String = mb_convert_encoding($string, 'utf8', $encoding); - $lines = []; - $line = ''; - - $offset = 0; - while (preg_match('/.{1,10000}/u', $utf8String, $m, 0, $offset)) { - $offset += \strlen($m[0]); - - foreach (preg_split('//u', $m[0]) as $char) { - // test if $char could be appended to current line - if (mb_strwidth($line.$char, 'utf8') <= $width) { - $line .= $char; - continue; - } - // if not, push current line to array and make new line - $lines[] = str_pad($line, $width); - $line = $char; - } - } - - $lines[] = \count($lines) ? str_pad($line, $width) : $line; - - mb_convert_variables($encoding, 'utf8', $lines); - - return $lines; - } - - /** - * Returns all namespaces of the command name. - * - * @return string[] The namespaces of the command - */ - private function extractAllNamespaces(string $name): array - { - // -1 as third argument is needed to skip the command short name when exploding - $parts = explode(':', $name, -1); - $namespaces = []; - - foreach ($parts as $part) { - if (\count($namespaces)) { - $namespaces[] = end($namespaces).':'.$part; - } else { - $namespaces[] = $part; - } - } - - return $namespaces; - } - - private function init() - { - if ($this->initialized) { - return; - } - $this->initialized = true; - - foreach ($this->getDefaultCommands() as $command) { - $this->add($command); - } - } -} diff --git a/vendor/symfony/console/CHANGELOG.md b/vendor/symfony/console/CHANGELOG.md deleted file mode 100644 index 5159244..0000000 --- a/vendor/symfony/console/CHANGELOG.md +++ /dev/null @@ -1,162 +0,0 @@ -CHANGELOG -========= - -4.4.0 ------ - - * deprecated finding hidden commands using an abbreviation, use the full name instead - * added `Question::setTrimmable` default to true to allow the answer to be trimmed - * added method `minSecondsBetweenRedraws()` and `maxSecondsBetweenRedraws()` on `ProgressBar` - * `Application` implements `ResetInterface` - * marked all dispatched event classes as `@final` - * added support for displaying table horizontally - * deprecated returning `null` from `Command::execute()`, return `0` instead - * Deprecated the `Application::renderException()` and `Application::doRenderException()` methods, - use `renderThrowable()` and `doRenderThrowable()` instead. - * added support for the `NO_COLOR` env var (https://no-color.org/) - -4.3.0 ------ - - * added support for hyperlinks - * added `ProgressBar::iterate()` method that simplify updating the progress bar when iterating - * added `Question::setAutocompleterCallback()` to provide a callback function - that dynamically generates suggestions as the user types - -4.2.0 ------ - - * allowed passing commands as `[$process, 'ENV_VAR' => 'value']` to - `ProcessHelper::run()` to pass environment variables - * deprecated passing a command as a string to `ProcessHelper::run()`, - pass it the command as an array of its arguments instead - * made the `ProcessHelper` class final - * added `WrappableOutputFormatterInterface::formatAndWrap()` (implemented in `OutputFormatter`) - * added `capture_stderr_separately` option to `CommandTester::execute()` - -4.1.0 ------ - - * added option to run suggested command if command is not found and only 1 alternative is available - * added option to modify console output and print multiple modifiable sections - * added support for iterable messages in output `write` and `writeln` methods - -4.0.0 ------ - - * `OutputFormatter` throws an exception when unknown options are used - * removed `QuestionHelper::setInputStream()/getInputStream()` - * removed `Application::getTerminalWidth()/getTerminalHeight()` and - `Application::setTerminalDimensions()/getTerminalDimensions()` - * removed `ConsoleExceptionEvent` - * removed `ConsoleEvents::EXCEPTION` - -3.4.0 ------ - - * added `SHELL_VERBOSITY` env var to control verbosity - * added `CommandLoaderInterface`, `FactoryCommandLoader` and PSR-11 - `ContainerCommandLoader` for commands lazy-loading - * added a case-insensitive command name matching fallback - * added static `Command::$defaultName/getDefaultName()`, allowing for - commands to be registered at compile time in the application command loader. - Setting the `$defaultName` property avoids the need for filling the `command` - attribute on the `console.command` tag when using `AddConsoleCommandPass`. - -3.3.0 ------ - - * added `ExceptionListener` - * added `AddConsoleCommandPass` (originally in FrameworkBundle) - * [BC BREAK] `Input::getOption()` no longer returns the default value for options - with value optional explicitly passed empty - * added console.error event to catch exceptions thrown by other listeners - * deprecated console.exception event in favor of console.error - * added ability to handle `CommandNotFoundException` through the - `console.error` event - * deprecated default validation in `SymfonyQuestionHelper::ask` - -3.2.0 ------- - - * added `setInputs()` method to CommandTester for ease testing of commands expecting inputs - * added `setStream()` and `getStream()` methods to Input (implement StreamableInputInterface) - * added StreamableInputInterface - * added LockableTrait - -3.1.0 ------ - - * added truncate method to FormatterHelper - * added setColumnWidth(s) method to Table - -2.8.3 ------ - - * remove readline support from the question helper as it caused issues - -2.8.0 ------ - - * use readline for user input in the question helper when available to allow - the use of arrow keys - -2.6.0 ------ - - * added a Process helper - * added a DebugFormatter helper - -2.5.0 ------ - - * deprecated the dialog helper (use the question helper instead) - * deprecated TableHelper in favor of Table - * deprecated ProgressHelper in favor of ProgressBar - * added ConsoleLogger - * added a question helper - * added a way to set the process name of a command - * added a way to set a default command instead of `ListCommand` - -2.4.0 ------ - - * added a way to force terminal dimensions - * added a convenient method to detect verbosity level - * [BC BREAK] made descriptors use output instead of returning a string - -2.3.0 ------ - - * added multiselect support to the select dialog helper - * added Table Helper for tabular data rendering - * added support for events in `Application` - * added a way to normalize EOLs in `ApplicationTester::getDisplay()` and `CommandTester::getDisplay()` - * added a way to set the progress bar progress via the `setCurrent` method - * added support for multiple InputOption shortcuts, written as `'-a|-b|-c'` - * added two additional verbosity levels, VERBOSITY_VERY_VERBOSE and VERBOSITY_DEBUG - -2.2.0 ------ - - * added support for colorization on Windows via ConEmu - * add a method to Dialog Helper to ask for a question and hide the response - * added support for interactive selections in console (DialogHelper::select()) - * added support for autocompletion as you type in Dialog Helper - -2.1.0 ------ - - * added ConsoleOutputInterface - * added the possibility to disable a command (Command::isEnabled()) - * added suggestions when a command does not exist - * added a --raw option to the list command - * added support for STDERR in the console output class (errors are now sent - to STDERR) - * made the defaults (helper set, commands, input definition) in Application - more easily customizable - * added support for the shell even if readline is not available - * added support for process isolation in Symfony shell via - `--process-isolation` switch - * added support for `--`, which disables options parsing after that point - (tokens will be parsed as arguments) diff --git a/vendor/symfony/console/Command/Command.php b/vendor/symfony/console/Command/Command.php deleted file mode 100644 index da9b9f6..0000000 --- a/vendor/symfony/console/Command/Command.php +++ /dev/null @@ -1,667 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Command; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Exception\ExceptionInterface; -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\LogicException; -use Symfony\Component\Console\Helper\HelperSet; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Base class for all commands. - * - * @author Fabien Potencier - */ -class Command -{ - /** - * @var string|null The default command name - */ - protected static $defaultName; - - private $application; - private $name; - private $processTitle; - private $aliases = []; - private $definition; - private $hidden = false; - private $help = ''; - private $description = ''; - private $ignoreValidationErrors = false; - private $applicationDefinitionMerged = false; - private $applicationDefinitionMergedWithArgs = false; - private $code; - private $synopsis = []; - private $usages = []; - private $helperSet; - - /** - * @return string|null The default command name or null when no default name is set - */ - public static function getDefaultName() - { - $class = static::class; - $r = new \ReflectionProperty($class, 'defaultName'); - - return $class === $r->class ? static::$defaultName : null; - } - - /** - * @param string|null $name The name of the command; passing null means it must be set in configure() - * - * @throws LogicException When the command name is empty - */ - public function __construct(string $name = null) - { - $this->definition = new InputDefinition(); - - if (null !== $name || null !== $name = static::getDefaultName()) { - $this->setName($name); - } - - $this->configure(); - } - - /** - * Ignores validation errors. - * - * This is mainly useful for the help command. - */ - public function ignoreValidationErrors() - { - $this->ignoreValidationErrors = true; - } - - public function setApplication(Application $application = null) - { - $this->application = $application; - if ($application) { - $this->setHelperSet($application->getHelperSet()); - } else { - $this->helperSet = null; - } - } - - public function setHelperSet(HelperSet $helperSet) - { - $this->helperSet = $helperSet; - } - - /** - * Gets the helper set. - * - * @return HelperSet|null A HelperSet instance - */ - public function getHelperSet() - { - return $this->helperSet; - } - - /** - * Gets the application instance for this command. - * - * @return Application|null An Application instance - */ - public function getApplication() - { - return $this->application; - } - - /** - * Checks whether the command is enabled or not in the current environment. - * - * Override this to check for x or y and return false if the command can not - * run properly under the current conditions. - * - * @return bool - */ - public function isEnabled() - { - return true; - } - - /** - * Configures the current command. - */ - protected function configure() - { - } - - /** - * Executes the current command. - * - * This method is not abstract because you can use this class - * as a concrete class. In this case, instead of defining the - * execute() method, you set the code to execute by passing - * a Closure to the setCode() method. - * - * @return int 0 if everything went fine, or an exit code - * - * @throws LogicException When this abstract method is not implemented - * - * @see setCode() - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - throw new LogicException('You must override the execute() method in the concrete command class.'); - } - - /** - * Interacts with the user. - * - * This method is executed before the InputDefinition is validated. - * This means that this is the only place where the command can - * interactively ask for values of missing required arguments. - */ - protected function interact(InputInterface $input, OutputInterface $output) - { - } - - /** - * Initializes the command after the input has been bound and before the input - * is validated. - * - * This is mainly useful when a lot of commands extends one main command - * where some things need to be initialized based on the input arguments and options. - * - * @see InputInterface::bind() - * @see InputInterface::validate() - */ - protected function initialize(InputInterface $input, OutputInterface $output) - { - } - - /** - * Runs the command. - * - * The code to execute is either defined directly with the - * setCode() method or by overriding the execute() method - * in a sub-class. - * - * @return int The command exit code - * - * @throws \Exception When binding input fails. Bypass this by calling {@link ignoreValidationErrors()}. - * - * @see setCode() - * @see execute() - */ - public function run(InputInterface $input, OutputInterface $output) - { - // force the creation of the synopsis before the merge with the app definition - $this->getSynopsis(true); - $this->getSynopsis(false); - - // add the application arguments and options - $this->mergeApplicationDefinition(); - - // bind the input against the command specific arguments/options - try { - $input->bind($this->definition); - } catch (ExceptionInterface $e) { - if (!$this->ignoreValidationErrors) { - throw $e; - } - } - - $this->initialize($input, $output); - - if (null !== $this->processTitle) { - if (\function_exists('cli_set_process_title')) { - if (!@cli_set_process_title($this->processTitle)) { - if ('Darwin' === \PHP_OS) { - $output->writeln('Running "cli_set_process_title" as an unprivileged user is not supported on MacOS.', OutputInterface::VERBOSITY_VERY_VERBOSE); - } else { - cli_set_process_title($this->processTitle); - } - } - } elseif (\function_exists('setproctitle')) { - setproctitle($this->processTitle); - } elseif (OutputInterface::VERBOSITY_VERY_VERBOSE === $output->getVerbosity()) { - $output->writeln('Install the proctitle PECL to be able to change the process title.'); - } - } - - if ($input->isInteractive()) { - $this->interact($input, $output); - } - - // The command name argument is often omitted when a command is executed directly with its run() method. - // It would fail the validation if we didn't make sure the command argument is present, - // since it's required by the application. - if ($input->hasArgument('command') && null === $input->getArgument('command')) { - $input->setArgument('command', $this->getName()); - } - - $input->validate(); - - if ($this->code) { - $statusCode = ($this->code)($input, $output); - } else { - $statusCode = $this->execute($input, $output); - - if (!\is_int($statusCode)) { - @trigger_error(sprintf('Return value of "%s::execute()" should always be of the type int since Symfony 4.4, %s returned.', static::class, \gettype($statusCode)), \E_USER_DEPRECATED); - } - } - - return is_numeric($statusCode) ? (int) $statusCode : 0; - } - - /** - * Sets the code to execute when running this command. - * - * If this method is used, it overrides the code defined - * in the execute() method. - * - * @param callable $code A callable(InputInterface $input, OutputInterface $output) - * - * @return $this - * - * @throws InvalidArgumentException - * - * @see execute() - */ - public function setCode(callable $code) - { - if ($code instanceof \Closure) { - $r = new \ReflectionFunction($code); - if (null === $r->getClosureThis()) { - set_error_handler(static function () {}); - try { - if ($c = \Closure::bind($code, $this)) { - $code = $c; - } - } finally { - restore_error_handler(); - } - } - } - - $this->code = $code; - - return $this; - } - - /** - * Merges the application definition with the command definition. - * - * This method is not part of public API and should not be used directly. - * - * @param bool $mergeArgs Whether to merge or not the Application definition arguments to Command definition arguments - */ - public function mergeApplicationDefinition($mergeArgs = true) - { - if (null === $this->application || (true === $this->applicationDefinitionMerged && ($this->applicationDefinitionMergedWithArgs || !$mergeArgs))) { - return; - } - - $this->definition->addOptions($this->application->getDefinition()->getOptions()); - - $this->applicationDefinitionMerged = true; - - if ($mergeArgs) { - $currentArguments = $this->definition->getArguments(); - $this->definition->setArguments($this->application->getDefinition()->getArguments()); - $this->definition->addArguments($currentArguments); - - $this->applicationDefinitionMergedWithArgs = true; - } - } - - /** - * Sets an array of argument and option instances. - * - * @param array|InputDefinition $definition An array of argument and option instances or a definition instance - * - * @return $this - */ - public function setDefinition($definition) - { - if ($definition instanceof InputDefinition) { - $this->definition = $definition; - } else { - $this->definition->setDefinition($definition); - } - - $this->applicationDefinitionMerged = false; - - return $this; - } - - /** - * Gets the InputDefinition attached to this Command. - * - * @return InputDefinition An InputDefinition instance - */ - public function getDefinition() - { - if (null === $this->definition) { - throw new LogicException(sprintf('Command class "%s" is not correctly initialized. You probably forgot to call the parent constructor.', static::class)); - } - - return $this->definition; - } - - /** - * Gets the InputDefinition to be used to create representations of this Command. - * - * Can be overridden to provide the original command representation when it would otherwise - * be changed by merging with the application InputDefinition. - * - * This method is not part of public API and should not be used directly. - * - * @return InputDefinition An InputDefinition instance - */ - public function getNativeDefinition() - { - return $this->getDefinition(); - } - - /** - * Adds an argument. - * - * @param string $name The argument name - * @param int|null $mode The argument mode: InputArgument::REQUIRED or InputArgument::OPTIONAL - * @param string $description A description text - * @param mixed $default The default value (for InputArgument::OPTIONAL mode only) - * - * @throws InvalidArgumentException When argument mode is not valid - * - * @return $this - */ - public function addArgument($name, $mode = null, $description = '', $default = null) - { - $this->definition->addArgument(new InputArgument($name, $mode, $description, $default)); - - return $this; - } - - /** - * Adds an option. - * - * @param string $name The option name - * @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts - * @param int|null $mode The option mode: One of the InputOption::VALUE_* constants - * @param string $description A description text - * @param mixed $default The default value (must be null for InputOption::VALUE_NONE) - * - * @throws InvalidArgumentException If option mode is invalid or incompatible - * - * @return $this - */ - public function addOption($name, $shortcut = null, $mode = null, $description = '', $default = null) - { - $this->definition->addOption(new InputOption($name, $shortcut, $mode, $description, $default)); - - return $this; - } - - /** - * Sets the name of the command. - * - * This method can set both the namespace and the name if - * you separate them by a colon (:) - * - * $command->setName('foo:bar'); - * - * @param string $name The command name - * - * @return $this - * - * @throws InvalidArgumentException When the name is invalid - */ - public function setName($name) - { - $this->validateName($name); - - $this->name = $name; - - return $this; - } - - /** - * Sets the process title of the command. - * - * This feature should be used only when creating a long process command, - * like a daemon. - * - * @param string $title The process title - * - * @return $this - */ - public function setProcessTitle($title) - { - $this->processTitle = $title; - - return $this; - } - - /** - * Returns the command name. - * - * @return string|null - */ - public function getName() - { - return $this->name; - } - - /** - * @param bool $hidden Whether or not the command should be hidden from the list of commands - * - * @return $this - */ - public function setHidden($hidden) - { - $this->hidden = (bool) $hidden; - - return $this; - } - - /** - * @return bool whether the command should be publicly shown or not - */ - public function isHidden() - { - return $this->hidden; - } - - /** - * Sets the description for the command. - * - * @param string $description The description for the command - * - * @return $this - */ - public function setDescription($description) - { - $this->description = $description; - - return $this; - } - - /** - * Returns the description for the command. - * - * @return string The description for the command - */ - public function getDescription() - { - return $this->description; - } - - /** - * Sets the help for the command. - * - * @param string $help The help for the command - * - * @return $this - */ - public function setHelp($help) - { - $this->help = $help; - - return $this; - } - - /** - * Returns the help for the command. - * - * @return string The help for the command - */ - public function getHelp() - { - return $this->help; - } - - /** - * Returns the processed help for the command replacing the %command.name% and - * %command.full_name% patterns with the real values dynamically. - * - * @return string The processed help for the command - */ - public function getProcessedHelp() - { - $name = $this->name; - $isSingleCommand = $this->application && $this->application->isSingleCommand(); - - $placeholders = [ - '%command.name%', - '%command.full_name%', - ]; - $replacements = [ - $name, - $isSingleCommand ? $_SERVER['PHP_SELF'] : $_SERVER['PHP_SELF'].' '.$name, - ]; - - return str_replace($placeholders, $replacements, $this->getHelp() ?: $this->getDescription()); - } - - /** - * Sets the aliases for the command. - * - * @param string[] $aliases An array of aliases for the command - * - * @return $this - * - * @throws InvalidArgumentException When an alias is invalid - */ - public function setAliases($aliases) - { - if (!\is_array($aliases) && !$aliases instanceof \Traversable) { - throw new InvalidArgumentException('$aliases must be an array or an instance of \Traversable.'); - } - - foreach ($aliases as $alias) { - $this->validateName($alias); - } - - $this->aliases = $aliases; - - return $this; - } - - /** - * Returns the aliases for the command. - * - * @return array An array of aliases for the command - */ - public function getAliases() - { - return $this->aliases; - } - - /** - * Returns the synopsis for the command. - * - * @param bool $short Whether to show the short version of the synopsis (with options folded) or not - * - * @return string The synopsis - */ - public function getSynopsis($short = false) - { - $key = $short ? 'short' : 'long'; - - if (!isset($this->synopsis[$key])) { - $this->synopsis[$key] = trim(sprintf('%s %s', $this->name, $this->definition->getSynopsis($short))); - } - - return $this->synopsis[$key]; - } - - /** - * Add a command usage example. - * - * @param string $usage The usage, it'll be prefixed with the command name - * - * @return $this - */ - public function addUsage($usage) - { - if (!str_starts_with($usage, $this->name)) { - $usage = sprintf('%s %s', $this->name, $usage); - } - - $this->usages[] = $usage; - - return $this; - } - - /** - * Returns alternative usages of the command. - * - * @return array - */ - public function getUsages() - { - return $this->usages; - } - - /** - * Gets a helper instance by name. - * - * @param string $name The helper name - * - * @return mixed The helper value - * - * @throws LogicException if no HelperSet is defined - * @throws InvalidArgumentException if the helper is not defined - */ - public function getHelper($name) - { - if (null === $this->helperSet) { - throw new LogicException(sprintf('Cannot retrieve helper "%s" because there is no HelperSet defined. Did you forget to add your command to the application or to set the application on the command using the setApplication() method? You can also set the HelperSet directly using the setHelperSet() method.', $name)); - } - - return $this->helperSet->get($name); - } - - /** - * Validates a command name. - * - * It must be non-empty and parts can optionally be separated by ":". - * - * @throws InvalidArgumentException When the name is invalid - */ - private function validateName(string $name) - { - if (!preg_match('/^[^\:]++(\:[^\:]++)*$/', $name)) { - throw new InvalidArgumentException(sprintf('Command name "%s" is invalid.', $name)); - } - } -} diff --git a/vendor/symfony/console/Command/HelpCommand.php b/vendor/symfony/console/Command/HelpCommand.php deleted file mode 100644 index cece782..0000000 --- a/vendor/symfony/console/Command/HelpCommand.php +++ /dev/null @@ -1,83 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Command; - -use Symfony\Component\Console\Helper\DescriptorHelper; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * HelpCommand displays the help for a given command. - * - * @author Fabien Potencier - */ -class HelpCommand extends Command -{ - private $command; - - /** - * {@inheritdoc} - */ - protected function configure() - { - $this->ignoreValidationErrors(); - - $this - ->setName('help') - ->setDefinition([ - new InputArgument('command_name', InputArgument::OPTIONAL, 'The command name', 'help'), - new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt'), - new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command help'), - ]) - ->setDescription('Display help for a command') - ->setHelp(<<<'EOF' -The %command.name% command displays help for a given command: - - php %command.full_name% list - -You can also output the help in other formats by using the --format option: - - php %command.full_name% --format=xml list - -To display the list of available commands, please use the list command. -EOF - ) - ; - } - - public function setCommand(Command $command) - { - $this->command = $command; - } - - /** - * {@inheritdoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - if (null === $this->command) { - $this->command = $this->getApplication()->find($input->getArgument('command_name')); - } - - $helper = new DescriptorHelper(); - $helper->describe($output, $this->command, [ - 'format' => $input->getOption('format'), - 'raw_text' => $input->getOption('raw'), - ]); - - $this->command = null; - - return 0; - } -} diff --git a/vendor/symfony/console/Command/ListCommand.php b/vendor/symfony/console/Command/ListCommand.php deleted file mode 100644 index 44324a5..0000000 --- a/vendor/symfony/console/Command/ListCommand.php +++ /dev/null @@ -1,89 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Command; - -use Symfony\Component\Console\Helper\DescriptorHelper; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * ListCommand displays the list of all available commands for the application. - * - * @author Fabien Potencier - */ -class ListCommand extends Command -{ - /** - * {@inheritdoc} - */ - protected function configure() - { - $this - ->setName('list') - ->setDefinition($this->createDefinition()) - ->setDescription('List commands') - ->setHelp(<<<'EOF' -The %command.name% command lists all commands: - - php %command.full_name% - -You can also display the commands for a specific namespace: - - php %command.full_name% test - -You can also output the information in other formats by using the --format option: - - php %command.full_name% --format=xml - -It's also possible to get raw list of commands (useful for embedding command runner): - - php %command.full_name% --raw -EOF - ) - ; - } - - /** - * {@inheritdoc} - */ - public function getNativeDefinition() - { - return $this->createDefinition(); - } - - /** - * {@inheritdoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - $helper = new DescriptorHelper(); - $helper->describe($output, $this->getApplication(), [ - 'format' => $input->getOption('format'), - 'raw_text' => $input->getOption('raw'), - 'namespace' => $input->getArgument('namespace'), - ]); - - return 0; - } - - private function createDefinition(): InputDefinition - { - return new InputDefinition([ - new InputArgument('namespace', InputArgument::OPTIONAL, 'The namespace name'), - new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command list'), - new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt'), - ]); - } -} diff --git a/vendor/symfony/console/Command/LockableTrait.php b/vendor/symfony/console/Command/LockableTrait.php deleted file mode 100644 index 60cfe36..0000000 --- a/vendor/symfony/console/Command/LockableTrait.php +++ /dev/null @@ -1,69 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Command; - -use Symfony\Component\Console\Exception\LogicException; -use Symfony\Component\Lock\Lock; -use Symfony\Component\Lock\LockFactory; -use Symfony\Component\Lock\Store\FlockStore; -use Symfony\Component\Lock\Store\SemaphoreStore; - -/** - * Basic lock feature for commands. - * - * @author Geoffrey Brier - */ -trait LockableTrait -{ - /** @var Lock */ - private $lock; - - /** - * Locks a command. - */ - private function lock(string $name = null, bool $blocking = false): bool - { - if (!class_exists(SemaphoreStore::class)) { - throw new LogicException('To enable the locking feature you must install the symfony/lock component.'); - } - - if (null !== $this->lock) { - throw new LogicException('A lock is already in place.'); - } - - if (SemaphoreStore::isSupported()) { - $store = new SemaphoreStore(); - } else { - $store = new FlockStore(); - } - - $this->lock = (new LockFactory($store))->createLock($name ?: $this->getName()); - if (!$this->lock->acquire($blocking)) { - $this->lock = null; - - return false; - } - - return true; - } - - /** - * Releases the command lock if there is one. - */ - private function release() - { - if ($this->lock) { - $this->lock->release(); - $this->lock = null; - } - } -} diff --git a/vendor/symfony/console/CommandLoader/CommandLoaderInterface.php b/vendor/symfony/console/CommandLoader/CommandLoaderInterface.php deleted file mode 100644 index ca1029c..0000000 --- a/vendor/symfony/console/CommandLoader/CommandLoaderInterface.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\CommandLoader; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Exception\CommandNotFoundException; - -/** - * @author Robin Chalas - */ -interface CommandLoaderInterface -{ - /** - * Loads a command. - * - * @param string $name - * - * @return Command - * - * @throws CommandNotFoundException - */ - public function get($name); - - /** - * Checks if a command exists. - * - * @param string $name - * - * @return bool - */ - public function has($name); - - /** - * @return string[] All registered command names - */ - public function getNames(); -} diff --git a/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php b/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php deleted file mode 100644 index 50e5950..0000000 --- a/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php +++ /dev/null @@ -1,63 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\CommandLoader; - -use Psr\Container\ContainerInterface; -use Symfony\Component\Console\Exception\CommandNotFoundException; - -/** - * Loads commands from a PSR-11 container. - * - * @author Robin Chalas - */ -class ContainerCommandLoader implements CommandLoaderInterface -{ - private $container; - private $commandMap; - - /** - * @param array $commandMap An array with command names as keys and service ids as values - */ - public function __construct(ContainerInterface $container, array $commandMap) - { - $this->container = $container; - $this->commandMap = $commandMap; - } - - /** - * {@inheritdoc} - */ - public function get($name) - { - if (!$this->has($name)) { - throw new CommandNotFoundException(sprintf('Command "%s" does not exist.', $name)); - } - - return $this->container->get($this->commandMap[$name]); - } - - /** - * {@inheritdoc} - */ - public function has($name) - { - return isset($this->commandMap[$name]) && $this->container->has($this->commandMap[$name]); - } - - /** - * {@inheritdoc} - */ - public function getNames() - { - return array_keys($this->commandMap); - } -} diff --git a/vendor/symfony/console/CommandLoader/FactoryCommandLoader.php b/vendor/symfony/console/CommandLoader/FactoryCommandLoader.php deleted file mode 100644 index d9c2055..0000000 --- a/vendor/symfony/console/CommandLoader/FactoryCommandLoader.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\CommandLoader; - -use Symfony\Component\Console\Exception\CommandNotFoundException; - -/** - * A simple command loader using factories to instantiate commands lazily. - * - * @author Maxime Steinhausser - */ -class FactoryCommandLoader implements CommandLoaderInterface -{ - private $factories; - - /** - * @param callable[] $factories Indexed by command names - */ - public function __construct(array $factories) - { - $this->factories = $factories; - } - - /** - * {@inheritdoc} - */ - public function has($name) - { - return isset($this->factories[$name]); - } - - /** - * {@inheritdoc} - */ - public function get($name) - { - if (!isset($this->factories[$name])) { - throw new CommandNotFoundException(sprintf('Command "%s" does not exist.', $name)); - } - - $factory = $this->factories[$name]; - - return $factory(); - } - - /** - * {@inheritdoc} - */ - public function getNames() - { - return array_keys($this->factories); - } -} diff --git a/vendor/symfony/console/ConsoleEvents.php b/vendor/symfony/console/ConsoleEvents.php deleted file mode 100644 index 99b423c..0000000 --- a/vendor/symfony/console/ConsoleEvents.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console; - -/** - * Contains all events dispatched by an Application. - * - * @author Francesco Levorato - */ -final class ConsoleEvents -{ - /** - * The COMMAND event allows you to attach listeners before any command is - * executed by the console. It also allows you to modify the command, input and output - * before they are handed to the command. - * - * @Event("Symfony\Component\Console\Event\ConsoleCommandEvent") - */ - public const COMMAND = 'console.command'; - - /** - * The TERMINATE event allows you to attach listeners after a command is - * executed by the console. - * - * @Event("Symfony\Component\Console\Event\ConsoleTerminateEvent") - */ - public const TERMINATE = 'console.terminate'; - - /** - * The ERROR event occurs when an uncaught exception or error appears. - * - * This event allows you to deal with the exception/error or - * to modify the thrown exception. - * - * @Event("Symfony\Component\Console\Event\ConsoleErrorEvent") - */ - public const ERROR = 'console.error'; -} diff --git a/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php b/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php deleted file mode 100644 index 666c8fa..0000000 --- a/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php +++ /dev/null @@ -1,98 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\DependencyInjection; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\CommandLoader\ContainerCommandLoader; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; -use Symfony\Component\DependencyInjection\TypedReference; - -/** - * Registers console commands. - * - * @author Grégoire Pineau - */ -class AddConsoleCommandPass implements CompilerPassInterface -{ - private $commandLoaderServiceId; - private $commandTag; - - public function __construct(string $commandLoaderServiceId = 'console.command_loader', string $commandTag = 'console.command') - { - $this->commandLoaderServiceId = $commandLoaderServiceId; - $this->commandTag = $commandTag; - } - - public function process(ContainerBuilder $container) - { - $commandServices = $container->findTaggedServiceIds($this->commandTag, true); - $lazyCommandMap = []; - $lazyCommandRefs = []; - $serviceIds = []; - - foreach ($commandServices as $id => $tags) { - $definition = $container->getDefinition($id); - $class = $container->getParameterBag()->resolveValue($definition->getClass()); - - if (isset($tags[0]['command'])) { - $commandName = $tags[0]['command']; - } else { - if (!$r = $container->getReflectionClass($class)) { - throw new InvalidArgumentException(sprintf('Class "%s" used for service "%s" cannot be found.', $class, $id)); - } - if (!$r->isSubclassOf(Command::class)) { - throw new InvalidArgumentException(sprintf('The service "%s" tagged "%s" must be a subclass of "%s".', $id, $this->commandTag, Command::class)); - } - $commandName = $class::getDefaultName(); - } - - if (null === $commandName) { - if (!$definition->isPublic() || $definition->isPrivate()) { - $commandId = 'console.command.public_alias.'.$id; - $container->setAlias($commandId, $id)->setPublic(true); - $id = $commandId; - } - $serviceIds[] = $id; - - continue; - } - - unset($tags[0]); - $lazyCommandMap[$commandName] = $id; - $lazyCommandRefs[$id] = new TypedReference($id, $class); - $aliases = []; - - foreach ($tags as $tag) { - if (isset($tag['command'])) { - $aliases[] = $tag['command']; - $lazyCommandMap[$tag['command']] = $id; - } - } - - $definition->addMethodCall('setName', [$commandName]); - - if ($aliases) { - $definition->addMethodCall('setAliases', [$aliases]); - } - } - - $container - ->register($this->commandLoaderServiceId, ContainerCommandLoader::class) - ->setPublic(true) - ->setArguments([ServiceLocatorTagPass::register($container, $lazyCommandRefs), $lazyCommandMap]); - - $container->setParameter('console.command.ids', $serviceIds); - } -} diff --git a/vendor/symfony/console/Descriptor/ApplicationDescription.php b/vendor/symfony/console/Descriptor/ApplicationDescription.php deleted file mode 100644 index 3970b90..0000000 --- a/vendor/symfony/console/Descriptor/ApplicationDescription.php +++ /dev/null @@ -1,143 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Descriptor; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Exception\CommandNotFoundException; - -/** - * @author Jean-François Simon - * - * @internal - */ -class ApplicationDescription -{ - public const GLOBAL_NAMESPACE = '_global'; - - private $application; - private $namespace; - private $showHidden; - - /** - * @var array - */ - private $namespaces; - - /** - * @var Command[] - */ - private $commands; - - /** - * @var Command[] - */ - private $aliases; - - public function __construct(Application $application, string $namespace = null, bool $showHidden = false) - { - $this->application = $application; - $this->namespace = $namespace; - $this->showHidden = $showHidden; - } - - public function getNamespaces(): array - { - if (null === $this->namespaces) { - $this->inspectApplication(); - } - - return $this->namespaces; - } - - /** - * @return Command[] - */ - public function getCommands(): array - { - if (null === $this->commands) { - $this->inspectApplication(); - } - - return $this->commands; - } - - /** - * @throws CommandNotFoundException - */ - public function getCommand(string $name): Command - { - if (!isset($this->commands[$name]) && !isset($this->aliases[$name])) { - throw new CommandNotFoundException(sprintf('Command "%s" does not exist.', $name)); - } - - return $this->commands[$name] ?? $this->aliases[$name]; - } - - private function inspectApplication() - { - $this->commands = []; - $this->namespaces = []; - - $all = $this->application->all($this->namespace ? $this->application->findNamespace($this->namespace) : null); - foreach ($this->sortCommands($all) as $namespace => $commands) { - $names = []; - - /** @var Command $command */ - foreach ($commands as $name => $command) { - if (!$command->getName() || (!$this->showHidden && $command->isHidden())) { - continue; - } - - if ($command->getName() === $name) { - $this->commands[$name] = $command; - } else { - $this->aliases[$name] = $command; - } - - $names[] = $name; - } - - $this->namespaces[$namespace] = ['id' => $namespace, 'commands' => $names]; - } - } - - private function sortCommands(array $commands): array - { - $namespacedCommands = []; - $globalCommands = []; - $sortedCommands = []; - foreach ($commands as $name => $command) { - $key = $this->application->extractNamespace($name, 1); - if (\in_array($key, ['', self::GLOBAL_NAMESPACE], true)) { - $globalCommands[$name] = $command; - } else { - $namespacedCommands[$key][$name] = $command; - } - } - - if ($globalCommands) { - ksort($globalCommands); - $sortedCommands[self::GLOBAL_NAMESPACE] = $globalCommands; - } - - if ($namespacedCommands) { - ksort($namespacedCommands); - foreach ($namespacedCommands as $key => $commandsSet) { - ksort($commandsSet); - $sortedCommands[$key] = $commandsSet; - } - } - - return $sortedCommands; - } -} diff --git a/vendor/symfony/console/Descriptor/Descriptor.php b/vendor/symfony/console/Descriptor/Descriptor.php deleted file mode 100644 index 9c3878d..0000000 --- a/vendor/symfony/console/Descriptor/Descriptor.php +++ /dev/null @@ -1,97 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Descriptor; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * @author Jean-François Simon - * - * @internal - */ -abstract class Descriptor implements DescriptorInterface -{ - /** - * @var OutputInterface - */ - protected $output; - - /** - * {@inheritdoc} - */ - public function describe(OutputInterface $output, $object, array $options = []) - { - $this->output = $output; - - switch (true) { - case $object instanceof InputArgument: - $this->describeInputArgument($object, $options); - break; - case $object instanceof InputOption: - $this->describeInputOption($object, $options); - break; - case $object instanceof InputDefinition: - $this->describeInputDefinition($object, $options); - break; - case $object instanceof Command: - $this->describeCommand($object, $options); - break; - case $object instanceof Application: - $this->describeApplication($object, $options); - break; - default: - throw new InvalidArgumentException(sprintf('Object of type "%s" is not describable.', \get_class($object))); - } - } - - /** - * Writes content to output. - * - * @param string $content - * @param bool $decorated - */ - protected function write($content, $decorated = false) - { - $this->output->write($content, false, $decorated ? OutputInterface::OUTPUT_NORMAL : OutputInterface::OUTPUT_RAW); - } - - /** - * Describes an InputArgument instance. - */ - abstract protected function describeInputArgument(InputArgument $argument, array $options = []); - - /** - * Describes an InputOption instance. - */ - abstract protected function describeInputOption(InputOption $option, array $options = []); - - /** - * Describes an InputDefinition instance. - */ - abstract protected function describeInputDefinition(InputDefinition $definition, array $options = []); - - /** - * Describes a Command instance. - */ - abstract protected function describeCommand(Command $command, array $options = []); - - /** - * Describes an Application instance. - */ - abstract protected function describeApplication(Application $application, array $options = []); -} diff --git a/vendor/symfony/console/Descriptor/DescriptorInterface.php b/vendor/symfony/console/Descriptor/DescriptorInterface.php deleted file mode 100644 index e3184a6..0000000 --- a/vendor/symfony/console/Descriptor/DescriptorInterface.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Descriptor; - -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Descriptor interface. - * - * @author Jean-François Simon - */ -interface DescriptorInterface -{ - /** - * Describes an object if supported. - * - * @param object $object - */ - public function describe(OutputInterface $output, $object, array $options = []); -} diff --git a/vendor/symfony/console/Descriptor/JsonDescriptor.php b/vendor/symfony/console/Descriptor/JsonDescriptor.php deleted file mode 100644 index 4c09e12..0000000 --- a/vendor/symfony/console/Descriptor/JsonDescriptor.php +++ /dev/null @@ -1,156 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Descriptor; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputOption; - -/** - * JSON descriptor. - * - * @author Jean-François Simon - * - * @internal - */ -class JsonDescriptor extends Descriptor -{ - /** - * {@inheritdoc} - */ - protected function describeInputArgument(InputArgument $argument, array $options = []) - { - $this->writeData($this->getInputArgumentData($argument), $options); - } - - /** - * {@inheritdoc} - */ - protected function describeInputOption(InputOption $option, array $options = []) - { - $this->writeData($this->getInputOptionData($option), $options); - } - - /** - * {@inheritdoc} - */ - protected function describeInputDefinition(InputDefinition $definition, array $options = []) - { - $this->writeData($this->getInputDefinitionData($definition), $options); - } - - /** - * {@inheritdoc} - */ - protected function describeCommand(Command $command, array $options = []) - { - $this->writeData($this->getCommandData($command), $options); - } - - /** - * {@inheritdoc} - */ - protected function describeApplication(Application $application, array $options = []) - { - $describedNamespace = $options['namespace'] ?? null; - $description = new ApplicationDescription($application, $describedNamespace, true); - $commands = []; - - foreach ($description->getCommands() as $command) { - $commands[] = $this->getCommandData($command); - } - - $data = []; - if ('UNKNOWN' !== $application->getName()) { - $data['application']['name'] = $application->getName(); - if ('UNKNOWN' !== $application->getVersion()) { - $data['application']['version'] = $application->getVersion(); - } - } - - $data['commands'] = $commands; - - if ($describedNamespace) { - $data['namespace'] = $describedNamespace; - } else { - $data['namespaces'] = array_values($description->getNamespaces()); - } - - $this->writeData($data, $options); - } - - /** - * Writes data as json. - */ - private function writeData(array $data, array $options) - { - $flags = $options['json_encoding'] ?? 0; - - $this->write(json_encode($data, $flags)); - } - - private function getInputArgumentData(InputArgument $argument): array - { - return [ - 'name' => $argument->getName(), - 'is_required' => $argument->isRequired(), - 'is_array' => $argument->isArray(), - 'description' => preg_replace('/\s*[\r\n]\s*/', ' ', $argument->getDescription()), - 'default' => \INF === $argument->getDefault() ? 'INF' : $argument->getDefault(), - ]; - } - - private function getInputOptionData(InputOption $option): array - { - return [ - 'name' => '--'.$option->getName(), - 'shortcut' => $option->getShortcut() ? '-'.str_replace('|', '|-', $option->getShortcut()) : '', - 'accept_value' => $option->acceptValue(), - 'is_value_required' => $option->isValueRequired(), - 'is_multiple' => $option->isArray(), - 'description' => preg_replace('/\s*[\r\n]\s*/', ' ', $option->getDescription()), - 'default' => \INF === $option->getDefault() ? 'INF' : $option->getDefault(), - ]; - } - - private function getInputDefinitionData(InputDefinition $definition): array - { - $inputArguments = []; - foreach ($definition->getArguments() as $name => $argument) { - $inputArguments[$name] = $this->getInputArgumentData($argument); - } - - $inputOptions = []; - foreach ($definition->getOptions() as $name => $option) { - $inputOptions[$name] = $this->getInputOptionData($option); - } - - return ['arguments' => $inputArguments, 'options' => $inputOptions]; - } - - private function getCommandData(Command $command): array - { - $command->getSynopsis(); - $command->mergeApplicationDefinition(false); - - return [ - 'name' => $command->getName(), - 'usage' => array_merge([$command->getSynopsis()], $command->getUsages(), $command->getAliases()), - 'description' => $command->getDescription(), - 'help' => $command->getProcessedHelp(), - 'definition' => $this->getInputDefinitionData($command->getNativeDefinition()), - 'hidden' => $command->isHidden(), - ]; - } -} diff --git a/vendor/symfony/console/Descriptor/MarkdownDescriptor.php b/vendor/symfony/console/Descriptor/MarkdownDescriptor.php deleted file mode 100644 index 9a9d280..0000000 --- a/vendor/symfony/console/Descriptor/MarkdownDescriptor.php +++ /dev/null @@ -1,182 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Descriptor; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Helper\Helper; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Markdown descriptor. - * - * @author Jean-François Simon - * - * @internal - */ -class MarkdownDescriptor extends Descriptor -{ - /** - * {@inheritdoc} - */ - public function describe(OutputInterface $output, $object, array $options = []) - { - $decorated = $output->isDecorated(); - $output->setDecorated(false); - - parent::describe($output, $object, $options); - - $output->setDecorated($decorated); - } - - /** - * {@inheritdoc} - */ - protected function write($content, $decorated = true) - { - parent::write($content, $decorated); - } - - /** - * {@inheritdoc} - */ - protected function describeInputArgument(InputArgument $argument, array $options = []) - { - $this->write( - '#### `'.($argument->getName() ?: '')."`\n\n" - .($argument->getDescription() ? preg_replace('/\s*[\r\n]\s*/', "\n", $argument->getDescription())."\n\n" : '') - .'* Is required: '.($argument->isRequired() ? 'yes' : 'no')."\n" - .'* Is array: '.($argument->isArray() ? 'yes' : 'no')."\n" - .'* Default: `'.str_replace("\n", '', var_export($argument->getDefault(), true)).'`' - ); - } - - /** - * {@inheritdoc} - */ - protected function describeInputOption(InputOption $option, array $options = []) - { - $name = '--'.$option->getName(); - if ($option->getShortcut()) { - $name .= '|-'.str_replace('|', '|-', $option->getShortcut()).''; - } - - $this->write( - '#### `'.$name.'`'."\n\n" - .($option->getDescription() ? preg_replace('/\s*[\r\n]\s*/', "\n", $option->getDescription())."\n\n" : '') - .'* Accept value: '.($option->acceptValue() ? 'yes' : 'no')."\n" - .'* Is value required: '.($option->isValueRequired() ? 'yes' : 'no')."\n" - .'* Is multiple: '.($option->isArray() ? 'yes' : 'no')."\n" - .'* Default: `'.str_replace("\n", '', var_export($option->getDefault(), true)).'`' - ); - } - - /** - * {@inheritdoc} - */ - protected function describeInputDefinition(InputDefinition $definition, array $options = []) - { - if ($showArguments = \count($definition->getArguments()) > 0) { - $this->write('### Arguments'); - foreach ($definition->getArguments() as $argument) { - $this->write("\n\n"); - $this->write($this->describeInputArgument($argument)); - } - } - - if (\count($definition->getOptions()) > 0) { - if ($showArguments) { - $this->write("\n\n"); - } - - $this->write('### Options'); - foreach ($definition->getOptions() as $option) { - $this->write("\n\n"); - $this->write($this->describeInputOption($option)); - } - } - } - - /** - * {@inheritdoc} - */ - protected function describeCommand(Command $command, array $options = []) - { - $command->getSynopsis(); - $command->mergeApplicationDefinition(false); - - $this->write( - '`'.$command->getName()."`\n" - .str_repeat('-', Helper::strlen($command->getName()) + 2)."\n\n" - .($command->getDescription() ? $command->getDescription()."\n\n" : '') - .'### Usage'."\n\n" - .array_reduce(array_merge([$command->getSynopsis()], $command->getAliases(), $command->getUsages()), function ($carry, $usage) { - return $carry.'* `'.$usage.'`'."\n"; - }) - ); - - if ($help = $command->getProcessedHelp()) { - $this->write("\n"); - $this->write($help); - } - - if ($command->getNativeDefinition()) { - $this->write("\n\n"); - $this->describeInputDefinition($command->getNativeDefinition()); - } - } - - /** - * {@inheritdoc} - */ - protected function describeApplication(Application $application, array $options = []) - { - $describedNamespace = $options['namespace'] ?? null; - $description = new ApplicationDescription($application, $describedNamespace); - $title = $this->getApplicationTitle($application); - - $this->write($title."\n".str_repeat('=', Helper::strlen($title))); - - foreach ($description->getNamespaces() as $namespace) { - if (ApplicationDescription::GLOBAL_NAMESPACE !== $namespace['id']) { - $this->write("\n\n"); - $this->write('**'.$namespace['id'].':**'); - } - - $this->write("\n\n"); - $this->write(implode("\n", array_map(function ($commandName) use ($description) { - return sprintf('* [`%s`](#%s)', $commandName, str_replace(':', '', $description->getCommand($commandName)->getName())); - }, $namespace['commands']))); - } - - foreach ($description->getCommands() as $command) { - $this->write("\n\n"); - $this->write($this->describeCommand($command)); - } - } - - private function getApplicationTitle(Application $application): string - { - if ('UNKNOWN' !== $application->getName()) { - if ('UNKNOWN' !== $application->getVersion()) { - return sprintf('%s %s', $application->getName(), $application->getVersion()); - } - - return $application->getName(); - } - - return 'Console Tool'; - } -} diff --git a/vendor/symfony/console/Descriptor/TextDescriptor.php b/vendor/symfony/console/Descriptor/TextDescriptor.php deleted file mode 100644 index 7d4d5f0..0000000 --- a/vendor/symfony/console/Descriptor/TextDescriptor.php +++ /dev/null @@ -1,342 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Descriptor; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Helper\Helper; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputOption; - -/** - * Text descriptor. - * - * @author Jean-François Simon - * - * @internal - */ -class TextDescriptor extends Descriptor -{ - /** - * {@inheritdoc} - */ - protected function describeInputArgument(InputArgument $argument, array $options = []) - { - if (null !== $argument->getDefault() && (!\is_array($argument->getDefault()) || \count($argument->getDefault()))) { - $default = sprintf(' [default: %s]', $this->formatDefaultValue($argument->getDefault())); - } else { - $default = ''; - } - - $totalWidth = $options['total_width'] ?? Helper::strlen($argument->getName()); - $spacingWidth = $totalWidth - \strlen($argument->getName()); - - $this->writeText(sprintf(' %s %s%s%s', - $argument->getName(), - str_repeat(' ', $spacingWidth), - // + 4 = 2 spaces before , 2 spaces after - preg_replace('/\s*[\r\n]\s*/', "\n".str_repeat(' ', $totalWidth + 4), $argument->getDescription()), - $default - ), $options); - } - - /** - * {@inheritdoc} - */ - protected function describeInputOption(InputOption $option, array $options = []) - { - if ($option->acceptValue() && null !== $option->getDefault() && (!\is_array($option->getDefault()) || \count($option->getDefault()))) { - $default = sprintf(' [default: %s]', $this->formatDefaultValue($option->getDefault())); - } else { - $default = ''; - } - - $value = ''; - if ($option->acceptValue()) { - $value = '='.strtoupper($option->getName()); - - if ($option->isValueOptional()) { - $value = '['.$value.']'; - } - } - - $totalWidth = $options['total_width'] ?? $this->calculateTotalWidthForOptions([$option]); - $synopsis = sprintf('%s%s', - $option->getShortcut() ? sprintf('-%s, ', $option->getShortcut()) : ' ', - sprintf('--%s%s', $option->getName(), $value) - ); - - $spacingWidth = $totalWidth - Helper::strlen($synopsis); - - $this->writeText(sprintf(' %s %s%s%s%s', - $synopsis, - str_repeat(' ', $spacingWidth), - // + 4 = 2 spaces before , 2 spaces after - preg_replace('/\s*[\r\n]\s*/', "\n".str_repeat(' ', $totalWidth + 4), $option->getDescription()), - $default, - $option->isArray() ? ' (multiple values allowed)' : '' - ), $options); - } - - /** - * {@inheritdoc} - */ - protected function describeInputDefinition(InputDefinition $definition, array $options = []) - { - $totalWidth = $this->calculateTotalWidthForOptions($definition->getOptions()); - foreach ($definition->getArguments() as $argument) { - $totalWidth = max($totalWidth, Helper::strlen($argument->getName())); - } - - if ($definition->getArguments()) { - $this->writeText('Arguments:', $options); - $this->writeText("\n"); - foreach ($definition->getArguments() as $argument) { - $this->describeInputArgument($argument, array_merge($options, ['total_width' => $totalWidth])); - $this->writeText("\n"); - } - } - - if ($definition->getArguments() && $definition->getOptions()) { - $this->writeText("\n"); - } - - if ($definition->getOptions()) { - $laterOptions = []; - - $this->writeText('Options:', $options); - foreach ($definition->getOptions() as $option) { - if (\strlen($option->getShortcut() ?? '') > 1) { - $laterOptions[] = $option; - continue; - } - $this->writeText("\n"); - $this->describeInputOption($option, array_merge($options, ['total_width' => $totalWidth])); - } - foreach ($laterOptions as $option) { - $this->writeText("\n"); - $this->describeInputOption($option, array_merge($options, ['total_width' => $totalWidth])); - } - } - } - - /** - * {@inheritdoc} - */ - protected function describeCommand(Command $command, array $options = []) - { - $command->getSynopsis(true); - $command->getSynopsis(false); - $command->mergeApplicationDefinition(false); - - if ($description = $command->getDescription()) { - $this->writeText('Description:', $options); - $this->writeText("\n"); - $this->writeText(' '.$description); - $this->writeText("\n\n"); - } - - $this->writeText('Usage:', $options); - foreach (array_merge([$command->getSynopsis(true)], $command->getAliases(), $command->getUsages()) as $usage) { - $this->writeText("\n"); - $this->writeText(' '.OutputFormatter::escape($usage), $options); - } - $this->writeText("\n"); - - $definition = $command->getNativeDefinition(); - if ($definition->getOptions() || $definition->getArguments()) { - $this->writeText("\n"); - $this->describeInputDefinition($definition, $options); - $this->writeText("\n"); - } - - $help = $command->getProcessedHelp(); - if ($help && $help !== $description) { - $this->writeText("\n"); - $this->writeText('Help:', $options); - $this->writeText("\n"); - $this->writeText(' '.str_replace("\n", "\n ", $help), $options); - $this->writeText("\n"); - } - } - - /** - * {@inheritdoc} - */ - protected function describeApplication(Application $application, array $options = []) - { - $describedNamespace = $options['namespace'] ?? null; - $description = new ApplicationDescription($application, $describedNamespace); - - if (isset($options['raw_text']) && $options['raw_text']) { - $width = $this->getColumnWidth($description->getCommands()); - - foreach ($description->getCommands() as $command) { - $this->writeText(sprintf("%-{$width}s %s", $command->getName(), $command->getDescription()), $options); - $this->writeText("\n"); - } - } else { - if ('' != $help = $application->getHelp()) { - $this->writeText("$help\n\n", $options); - } - - $this->writeText("Usage:\n", $options); - $this->writeText(" command [options] [arguments]\n\n", $options); - - $this->describeInputDefinition(new InputDefinition($application->getDefinition()->getOptions()), $options); - - $this->writeText("\n"); - $this->writeText("\n"); - - $commands = $description->getCommands(); - $namespaces = $description->getNamespaces(); - if ($describedNamespace && $namespaces) { - // make sure all alias commands are included when describing a specific namespace - $describedNamespaceInfo = reset($namespaces); - foreach ($describedNamespaceInfo['commands'] as $name) { - $commands[$name] = $description->getCommand($name); - } - } - - // calculate max. width based on available commands per namespace - $width = $this->getColumnWidth(array_merge(...array_values(array_map(function ($namespace) use ($commands) { - return array_intersect($namespace['commands'], array_keys($commands)); - }, array_values($namespaces))))); - - if ($describedNamespace) { - $this->writeText(sprintf('Available commands for the "%s" namespace:', $describedNamespace), $options); - } else { - $this->writeText('Available commands:', $options); - } - - foreach ($namespaces as $namespace) { - $namespace['commands'] = array_filter($namespace['commands'], function ($name) use ($commands) { - return isset($commands[$name]); - }); - - if (!$namespace['commands']) { - continue; - } - - if (!$describedNamespace && ApplicationDescription::GLOBAL_NAMESPACE !== $namespace['id']) { - $this->writeText("\n"); - $this->writeText(' '.$namespace['id'].'', $options); - } - - foreach ($namespace['commands'] as $name) { - $this->writeText("\n"); - $spacingWidth = $width - Helper::strlen($name); - $command = $commands[$name]; - $commandAliases = $name === $command->getName() ? $this->getCommandAliasesText($command) : ''; - $this->writeText(sprintf(' %s%s%s', $name, str_repeat(' ', $spacingWidth), $commandAliases.$command->getDescription()), $options); - } - } - - $this->writeText("\n"); - } - } - - /** - * {@inheritdoc} - */ - private function writeText(string $content, array $options = []) - { - $this->write( - isset($options['raw_text']) && $options['raw_text'] ? strip_tags($content) : $content, - isset($options['raw_output']) ? !$options['raw_output'] : true - ); - } - - /** - * Formats command aliases to show them in the command description. - */ - private function getCommandAliasesText(Command $command): string - { - $text = ''; - $aliases = $command->getAliases(); - - if ($aliases) { - $text = '['.implode('|', $aliases).'] '; - } - - return $text; - } - - /** - * Formats input option/argument default value. - * - * @param mixed $default - */ - private function formatDefaultValue($default): string - { - if (\INF === $default) { - return 'INF'; - } - - if (\is_string($default)) { - $default = OutputFormatter::escape($default); - } elseif (\is_array($default)) { - foreach ($default as $key => $value) { - if (\is_string($value)) { - $default[$key] = OutputFormatter::escape($value); - } - } - } - - return str_replace('\\\\', '\\', json_encode($default, \JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE)); - } - - /** - * @param array $commands - */ - private function getColumnWidth(array $commands): int - { - $widths = []; - - foreach ($commands as $command) { - if ($command instanceof Command) { - $widths[] = Helper::strlen($command->getName()); - foreach ($command->getAliases() as $alias) { - $widths[] = Helper::strlen($alias); - } - } else { - $widths[] = Helper::strlen($command); - } - } - - return $widths ? max($widths) + 2 : 0; - } - - /** - * @param InputOption[] $options - */ - private function calculateTotalWidthForOptions(array $options): int - { - $totalWidth = 0; - foreach ($options as $option) { - // "-" + shortcut + ", --" + name - $nameLength = 1 + max(Helper::strlen($option->getShortcut()), 1) + 4 + Helper::strlen($option->getName()); - - if ($option->acceptValue()) { - $valueLength = 1 + Helper::strlen($option->getName()); // = + value - $valueLength += $option->isValueOptional() ? 2 : 0; // [ + ] - - $nameLength += $valueLength; - } - $totalWidth = max($totalWidth, $nameLength); - } - - return $totalWidth; - } -} diff --git a/vendor/symfony/console/Descriptor/XmlDescriptor.php b/vendor/symfony/console/Descriptor/XmlDescriptor.php deleted file mode 100644 index e0ed53a..0000000 --- a/vendor/symfony/console/Descriptor/XmlDescriptor.php +++ /dev/null @@ -1,231 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Descriptor; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputOption; - -/** - * XML descriptor. - * - * @author Jean-François Simon - * - * @internal - */ -class XmlDescriptor extends Descriptor -{ - public function getInputDefinitionDocument(InputDefinition $definition): \DOMDocument - { - $dom = new \DOMDocument('1.0', 'UTF-8'); - $dom->appendChild($definitionXML = $dom->createElement('definition')); - - $definitionXML->appendChild($argumentsXML = $dom->createElement('arguments')); - foreach ($definition->getArguments() as $argument) { - $this->appendDocument($argumentsXML, $this->getInputArgumentDocument($argument)); - } - - $definitionXML->appendChild($optionsXML = $dom->createElement('options')); - foreach ($definition->getOptions() as $option) { - $this->appendDocument($optionsXML, $this->getInputOptionDocument($option)); - } - - return $dom; - } - - public function getCommandDocument(Command $command): \DOMDocument - { - $dom = new \DOMDocument('1.0', 'UTF-8'); - $dom->appendChild($commandXML = $dom->createElement('command')); - - $command->getSynopsis(); - $command->mergeApplicationDefinition(false); - - $commandXML->setAttribute('id', $command->getName()); - $commandXML->setAttribute('name', $command->getName()); - $commandXML->setAttribute('hidden', $command->isHidden() ? 1 : 0); - - $commandXML->appendChild($usagesXML = $dom->createElement('usages')); - - foreach (array_merge([$command->getSynopsis()], $command->getAliases(), $command->getUsages()) as $usage) { - $usagesXML->appendChild($dom->createElement('usage', $usage)); - } - - $commandXML->appendChild($descriptionXML = $dom->createElement('description')); - $descriptionXML->appendChild($dom->createTextNode(str_replace("\n", "\n ", $command->getDescription()))); - - $commandXML->appendChild($helpXML = $dom->createElement('help')); - $helpXML->appendChild($dom->createTextNode(str_replace("\n", "\n ", $command->getProcessedHelp()))); - - $definitionXML = $this->getInputDefinitionDocument($command->getNativeDefinition()); - $this->appendDocument($commandXML, $definitionXML->getElementsByTagName('definition')->item(0)); - - return $dom; - } - - public function getApplicationDocument(Application $application, string $namespace = null): \DOMDocument - { - $dom = new \DOMDocument('1.0', 'UTF-8'); - $dom->appendChild($rootXml = $dom->createElement('symfony')); - - if ('UNKNOWN' !== $application->getName()) { - $rootXml->setAttribute('name', $application->getName()); - if ('UNKNOWN' !== $application->getVersion()) { - $rootXml->setAttribute('version', $application->getVersion()); - } - } - - $rootXml->appendChild($commandsXML = $dom->createElement('commands')); - - $description = new ApplicationDescription($application, $namespace, true); - - if ($namespace) { - $commandsXML->setAttribute('namespace', $namespace); - } - - foreach ($description->getCommands() as $command) { - $this->appendDocument($commandsXML, $this->getCommandDocument($command)); - } - - if (!$namespace) { - $rootXml->appendChild($namespacesXML = $dom->createElement('namespaces')); - - foreach ($description->getNamespaces() as $namespaceDescription) { - $namespacesXML->appendChild($namespaceArrayXML = $dom->createElement('namespace')); - $namespaceArrayXML->setAttribute('id', $namespaceDescription['id']); - - foreach ($namespaceDescription['commands'] as $name) { - $namespaceArrayXML->appendChild($commandXML = $dom->createElement('command')); - $commandXML->appendChild($dom->createTextNode($name)); - } - } - } - - return $dom; - } - - /** - * {@inheritdoc} - */ - protected function describeInputArgument(InputArgument $argument, array $options = []) - { - $this->writeDocument($this->getInputArgumentDocument($argument)); - } - - /** - * {@inheritdoc} - */ - protected function describeInputOption(InputOption $option, array $options = []) - { - $this->writeDocument($this->getInputOptionDocument($option)); - } - - /** - * {@inheritdoc} - */ - protected function describeInputDefinition(InputDefinition $definition, array $options = []) - { - $this->writeDocument($this->getInputDefinitionDocument($definition)); - } - - /** - * {@inheritdoc} - */ - protected function describeCommand(Command $command, array $options = []) - { - $this->writeDocument($this->getCommandDocument($command)); - } - - /** - * {@inheritdoc} - */ - protected function describeApplication(Application $application, array $options = []) - { - $this->writeDocument($this->getApplicationDocument($application, $options['namespace'] ?? null)); - } - - /** - * Appends document children to parent node. - */ - private function appendDocument(\DOMNode $parentNode, \DOMNode $importedParent) - { - foreach ($importedParent->childNodes as $childNode) { - $parentNode->appendChild($parentNode->ownerDocument->importNode($childNode, true)); - } - } - - /** - * Writes DOM document. - */ - private function writeDocument(\DOMDocument $dom) - { - $dom->formatOutput = true; - $this->write($dom->saveXML()); - } - - private function getInputArgumentDocument(InputArgument $argument): \DOMDocument - { - $dom = new \DOMDocument('1.0', 'UTF-8'); - - $dom->appendChild($objectXML = $dom->createElement('argument')); - $objectXML->setAttribute('name', $argument->getName()); - $objectXML->setAttribute('is_required', $argument->isRequired() ? 1 : 0); - $objectXML->setAttribute('is_array', $argument->isArray() ? 1 : 0); - $objectXML->appendChild($descriptionXML = $dom->createElement('description')); - $descriptionXML->appendChild($dom->createTextNode($argument->getDescription())); - - $objectXML->appendChild($defaultsXML = $dom->createElement('defaults')); - $defaults = \is_array($argument->getDefault()) ? $argument->getDefault() : (\is_bool($argument->getDefault()) ? [var_export($argument->getDefault(), true)] : ($argument->getDefault() ? [$argument->getDefault()] : [])); - foreach ($defaults as $default) { - $defaultsXML->appendChild($defaultXML = $dom->createElement('default')); - $defaultXML->appendChild($dom->createTextNode($default)); - } - - return $dom; - } - - private function getInputOptionDocument(InputOption $option): \DOMDocument - { - $dom = new \DOMDocument('1.0', 'UTF-8'); - - $dom->appendChild($objectXML = $dom->createElement('option')); - $objectXML->setAttribute('name', '--'.$option->getName()); - $pos = strpos($option->getShortcut() ?? '', '|'); - if (false !== $pos) { - $objectXML->setAttribute('shortcut', '-'.substr($option->getShortcut(), 0, $pos)); - $objectXML->setAttribute('shortcuts', '-'.str_replace('|', '|-', $option->getShortcut())); - } else { - $objectXML->setAttribute('shortcut', $option->getShortcut() ? '-'.$option->getShortcut() : ''); - } - $objectXML->setAttribute('accept_value', $option->acceptValue() ? 1 : 0); - $objectXML->setAttribute('is_value_required', $option->isValueRequired() ? 1 : 0); - $objectXML->setAttribute('is_multiple', $option->isArray() ? 1 : 0); - $objectXML->appendChild($descriptionXML = $dom->createElement('description')); - $descriptionXML->appendChild($dom->createTextNode($option->getDescription())); - - if ($option->acceptValue()) { - $defaults = \is_array($option->getDefault()) ? $option->getDefault() : (\is_bool($option->getDefault()) ? [var_export($option->getDefault(), true)] : ($option->getDefault() ? [$option->getDefault()] : [])); - $objectXML->appendChild($defaultsXML = $dom->createElement('defaults')); - - if (!empty($defaults)) { - foreach ($defaults as $default) { - $defaultsXML->appendChild($defaultXML = $dom->createElement('default')); - $defaultXML->appendChild($dom->createTextNode($default)); - } - } - } - - return $dom; - } -} diff --git a/vendor/symfony/console/Event/ConsoleCommandEvent.php b/vendor/symfony/console/Event/ConsoleCommandEvent.php deleted file mode 100644 index 9691db6..0000000 --- a/vendor/symfony/console/Event/ConsoleCommandEvent.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Event; - -/** - * Allows to do things before the command is executed, like skipping the command or changing the input. - * - * @author Fabien Potencier - * - * @final since Symfony 4.4 - */ -class ConsoleCommandEvent extends ConsoleEvent -{ - /** - * The return code for skipped commands, this will also be passed into the terminate event. - */ - public const RETURN_CODE_DISABLED = 113; - - /** - * Indicates if the command should be run or skipped. - */ - private $commandShouldRun = true; - - /** - * Disables the command, so it won't be run. - * - * @return bool - */ - public function disableCommand() - { - return $this->commandShouldRun = false; - } - - /** - * Enables the command. - * - * @return bool - */ - public function enableCommand() - { - return $this->commandShouldRun = true; - } - - /** - * Returns true if the command is runnable, false otherwise. - * - * @return bool - */ - public function commandShouldRun() - { - return $this->commandShouldRun; - } -} diff --git a/vendor/symfony/console/Event/ConsoleErrorEvent.php b/vendor/symfony/console/Event/ConsoleErrorEvent.php deleted file mode 100644 index 57d9b38..0000000 --- a/vendor/symfony/console/Event/ConsoleErrorEvent.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Event; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Allows to handle throwables thrown while running a command. - * - * @author Wouter de Jong - */ -final class ConsoleErrorEvent extends ConsoleEvent -{ - private $error; - private $exitCode; - - public function __construct(InputInterface $input, OutputInterface $output, \Throwable $error, Command $command = null) - { - parent::__construct($command, $input, $output); - - $this->error = $error; - } - - public function getError(): \Throwable - { - return $this->error; - } - - public function setError(\Throwable $error): void - { - $this->error = $error; - } - - public function setExitCode(int $exitCode): void - { - $this->exitCode = $exitCode; - - $r = new \ReflectionProperty($this->error, 'code'); - $r->setAccessible(true); - $r->setValue($this->error, $this->exitCode); - } - - public function getExitCode(): int - { - return $this->exitCode ?? (\is_int($this->error->getCode()) && 0 !== $this->error->getCode() ? $this->error->getCode() : 1); - } -} diff --git a/vendor/symfony/console/Event/ConsoleEvent.php b/vendor/symfony/console/Event/ConsoleEvent.php deleted file mode 100644 index 400eb57..0000000 --- a/vendor/symfony/console/Event/ConsoleEvent.php +++ /dev/null @@ -1,67 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Event; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\EventDispatcher\Event; - -/** - * Allows to inspect input and output of a command. - * - * @author Francesco Levorato - */ -class ConsoleEvent extends Event -{ - protected $command; - - private $input; - private $output; - - public function __construct(?Command $command, InputInterface $input, OutputInterface $output) - { - $this->command = $command; - $this->input = $input; - $this->output = $output; - } - - /** - * Gets the command that is executed. - * - * @return Command|null A Command instance - */ - public function getCommand() - { - return $this->command; - } - - /** - * Gets the input instance. - * - * @return InputInterface An InputInterface instance - */ - public function getInput() - { - return $this->input; - } - - /** - * Gets the output instance. - * - * @return OutputInterface An OutputInterface instance - */ - public function getOutput() - { - return $this->output; - } -} diff --git a/vendor/symfony/console/Event/ConsoleTerminateEvent.php b/vendor/symfony/console/Event/ConsoleTerminateEvent.php deleted file mode 100644 index 43d0f8a..0000000 --- a/vendor/symfony/console/Event/ConsoleTerminateEvent.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Event; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Allows to manipulate the exit code of a command after its execution. - * - * @author Francesco Levorato - * - * @final since Symfony 4.4 - */ -class ConsoleTerminateEvent extends ConsoleEvent -{ - private $exitCode; - - public function __construct(Command $command, InputInterface $input, OutputInterface $output, int $exitCode) - { - parent::__construct($command, $input, $output); - - $this->setExitCode($exitCode); - } - - /** - * Sets the exit code. - * - * @param int $exitCode The command exit code - */ - public function setExitCode($exitCode) - { - $this->exitCode = (int) $exitCode; - } - - /** - * Gets the exit code. - * - * @return int The command exit code - */ - public function getExitCode() - { - return $this->exitCode; - } -} diff --git a/vendor/symfony/console/EventListener/ErrorListener.php b/vendor/symfony/console/EventListener/ErrorListener.php deleted file mode 100644 index 897d985..0000000 --- a/vendor/symfony/console/EventListener/ErrorListener.php +++ /dev/null @@ -1,95 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\EventListener; - -use Psr\Log\LoggerInterface; -use Symfony\Component\Console\ConsoleEvents; -use Symfony\Component\Console\Event\ConsoleErrorEvent; -use Symfony\Component\Console\Event\ConsoleEvent; -use Symfony\Component\Console\Event\ConsoleTerminateEvent; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; - -/** - * @author James Halsall - * @author Robin Chalas - */ -class ErrorListener implements EventSubscriberInterface -{ - private $logger; - - public function __construct(LoggerInterface $logger = null) - { - $this->logger = $logger; - } - - public function onConsoleError(ConsoleErrorEvent $event) - { - if (null === $this->logger) { - return; - } - - $error = $event->getError(); - - if (!$inputString = $this->getInputString($event)) { - $this->logger->critical('An error occurred while using the console. Message: "{message}"', ['exception' => $error, 'message' => $error->getMessage()]); - - return; - } - - $this->logger->critical('Error thrown while running command "{command}". Message: "{message}"', ['exception' => $error, 'command' => $inputString, 'message' => $error->getMessage()]); - } - - public function onConsoleTerminate(ConsoleTerminateEvent $event) - { - if (null === $this->logger) { - return; - } - - $exitCode = $event->getExitCode(); - - if (0 === $exitCode) { - return; - } - - if (!$inputString = $this->getInputString($event)) { - $this->logger->debug('The console exited with code "{code}"', ['code' => $exitCode]); - - return; - } - - $this->logger->debug('Command "{command}" exited with code "{code}"', ['command' => $inputString, 'code' => $exitCode]); - } - - public static function getSubscribedEvents() - { - return [ - ConsoleEvents::ERROR => ['onConsoleError', -128], - ConsoleEvents::TERMINATE => ['onConsoleTerminate', -128], - ]; - } - - private static function getInputString(ConsoleEvent $event): ?string - { - $commandName = $event->getCommand() ? $event->getCommand()->getName() : null; - $input = $event->getInput(); - - if (method_exists($input, '__toString')) { - if ($commandName) { - return str_replace(["'$commandName'", "\"$commandName\""], $commandName, (string) $input); - } - - return (string) $input; - } - - return $commandName; - } -} diff --git a/vendor/symfony/console/Exception/CommandNotFoundException.php b/vendor/symfony/console/Exception/CommandNotFoundException.php deleted file mode 100644 index 590a71c..0000000 --- a/vendor/symfony/console/Exception/CommandNotFoundException.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Exception; - -/** - * Represents an incorrect command name typed in the console. - * - * @author Jérôme Tamarelle - */ -class CommandNotFoundException extends \InvalidArgumentException implements ExceptionInterface -{ - private $alternatives; - - /** - * @param string $message Exception message to throw - * @param string[] $alternatives List of similar defined names - * @param int $code Exception code - * @param \Throwable|null $previous Previous exception used for the exception chaining - */ - public function __construct(string $message, array $alternatives = [], int $code = 0, \Throwable $previous = null) - { - parent::__construct($message, $code, $previous); - - $this->alternatives = $alternatives; - } - - /** - * @return string[] A list of similar defined names - */ - public function getAlternatives() - { - return $this->alternatives; - } -} diff --git a/vendor/symfony/console/Exception/ExceptionInterface.php b/vendor/symfony/console/Exception/ExceptionInterface.php deleted file mode 100644 index 1624e13..0000000 --- a/vendor/symfony/console/Exception/ExceptionInterface.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Exception; - -/** - * ExceptionInterface. - * - * @author Jérôme Tamarelle - */ -interface ExceptionInterface extends \Throwable -{ -} diff --git a/vendor/symfony/console/Exception/InvalidArgumentException.php b/vendor/symfony/console/Exception/InvalidArgumentException.php deleted file mode 100644 index 07cc0b6..0000000 --- a/vendor/symfony/console/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Exception; - -/** - * @author Jérôme Tamarelle - */ -class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/console/Exception/InvalidOptionException.php b/vendor/symfony/console/Exception/InvalidOptionException.php deleted file mode 100644 index b2eec61..0000000 --- a/vendor/symfony/console/Exception/InvalidOptionException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Exception; - -/** - * Represents an incorrect option name typed in the console. - * - * @author Jérôme Tamarelle - */ -class InvalidOptionException extends \InvalidArgumentException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/console/Exception/LogicException.php b/vendor/symfony/console/Exception/LogicException.php deleted file mode 100644 index fc37b8d..0000000 --- a/vendor/symfony/console/Exception/LogicException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Exception; - -/** - * @author Jérôme Tamarelle - */ -class LogicException extends \LogicException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/console/Exception/MissingInputException.php b/vendor/symfony/console/Exception/MissingInputException.php deleted file mode 100644 index 04f02ad..0000000 --- a/vendor/symfony/console/Exception/MissingInputException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Exception; - -/** - * Represents failure to read input from stdin. - * - * @author Gabriel Ostrolucký - */ -class MissingInputException extends RuntimeException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/console/Exception/NamespaceNotFoundException.php b/vendor/symfony/console/Exception/NamespaceNotFoundException.php deleted file mode 100644 index dd16e45..0000000 --- a/vendor/symfony/console/Exception/NamespaceNotFoundException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Exception; - -/** - * Represents an incorrect namespace typed in the console. - * - * @author Pierre du Plessis - */ -class NamespaceNotFoundException extends CommandNotFoundException -{ -} diff --git a/vendor/symfony/console/Exception/RuntimeException.php b/vendor/symfony/console/Exception/RuntimeException.php deleted file mode 100644 index 51d7d80..0000000 --- a/vendor/symfony/console/Exception/RuntimeException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Exception; - -/** - * @author Jérôme Tamarelle - */ -class RuntimeException extends \RuntimeException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/console/Formatter/OutputFormatter.php b/vendor/symfony/console/Formatter/OutputFormatter.php deleted file mode 100644 index 0f969c7..0000000 --- a/vendor/symfony/console/Formatter/OutputFormatter.php +++ /dev/null @@ -1,285 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Formatter; - -use Symfony\Component\Console\Exception\InvalidArgumentException; - -/** - * Formatter class for console output. - * - * @author Konstantin Kudryashov - * @author Roland Franssen - */ -class OutputFormatter implements WrappableOutputFormatterInterface -{ - private $decorated; - private $styles = []; - private $styleStack; - - public function __clone() - { - $this->styleStack = clone $this->styleStack; - foreach ($this->styles as $key => $value) { - $this->styles[$key] = clone $value; - } - } - - /** - * Escapes "<" special char in given text. - * - * @param string $text Text to escape - * - * @return string Escaped text - */ - public static function escape($text) - { - $text = preg_replace('/([^\\\\]?) FormatterStyle" instances - */ - public function __construct(bool $decorated = false, array $styles = []) - { - $this->decorated = $decorated; - - $this->setStyle('error', new OutputFormatterStyle('white', 'red')); - $this->setStyle('info', new OutputFormatterStyle('green')); - $this->setStyle('comment', new OutputFormatterStyle('yellow')); - $this->setStyle('question', new OutputFormatterStyle('black', 'cyan')); - - foreach ($styles as $name => $style) { - $this->setStyle($name, $style); - } - - $this->styleStack = new OutputFormatterStyleStack(); - } - - /** - * {@inheritdoc} - */ - public function setDecorated($decorated) - { - $this->decorated = (bool) $decorated; - } - - /** - * {@inheritdoc} - */ - public function isDecorated() - { - return $this->decorated; - } - - /** - * {@inheritdoc} - */ - public function setStyle($name, OutputFormatterStyleInterface $style) - { - $this->styles[strtolower($name)] = $style; - } - - /** - * {@inheritdoc} - */ - public function hasStyle($name) - { - return isset($this->styles[strtolower($name)]); - } - - /** - * {@inheritdoc} - */ - public function getStyle($name) - { - if (!$this->hasStyle($name)) { - throw new InvalidArgumentException(sprintf('Undefined style: "%s".', $name)); - } - - return $this->styles[strtolower($name)]; - } - - /** - * {@inheritdoc} - */ - public function format($message) - { - return $this->formatAndWrap((string) $message, 0); - } - - /** - * {@inheritdoc} - */ - public function formatAndWrap(string $message, int $width) - { - $offset = 0; - $output = ''; - $tagRegex = '[a-z][^<>]*+'; - $currentLineLength = 0; - preg_match_all("#<(($tagRegex) | /($tagRegex)?)>#ix", $message, $matches, \PREG_OFFSET_CAPTURE); - foreach ($matches[0] as $i => $match) { - $pos = $match[1]; - $text = $match[0]; - - if (0 != $pos && '\\' == $message[$pos - 1]) { - continue; - } - - // add the text up to the next tag - $output .= $this->applyCurrentStyle(substr($message, $offset, $pos - $offset), $output, $width, $currentLineLength); - $offset = $pos + \strlen($text); - - // opening tag? - if ($open = '/' != $text[1]) { - $tag = $matches[1][$i][0]; - } else { - $tag = $matches[3][$i][0] ?? ''; - } - - if (!$open && !$tag) { - // - $this->styleStack->pop(); - } elseif (null === $style = $this->createStyleFromString($tag)) { - $output .= $this->applyCurrentStyle($text, $output, $width, $currentLineLength); - } elseif ($open) { - $this->styleStack->push($style); - } else { - $this->styleStack->pop($style); - } - } - - $output .= $this->applyCurrentStyle(substr($message, $offset), $output, $width, $currentLineLength); - - if (str_contains($output, "\0")) { - return strtr($output, ["\0" => '\\', '\\<' => '<']); - } - - return str_replace('\\<', '<', $output); - } - - /** - * @return OutputFormatterStyleStack - */ - public function getStyleStack() - { - return $this->styleStack; - } - - /** - * Tries to create new style instance from string. - */ - private function createStyleFromString(string $string): ?OutputFormatterStyleInterface - { - if (isset($this->styles[$string])) { - return $this->styles[$string]; - } - - if (!preg_match_all('/([^=]+)=([^;]+)(;|$)/', $string, $matches, \PREG_SET_ORDER)) { - return null; - } - - $style = new OutputFormatterStyle(); - foreach ($matches as $match) { - array_shift($match); - $match[0] = strtolower($match[0]); - - if ('fg' == $match[0]) { - $style->setForeground(strtolower($match[1])); - } elseif ('bg' == $match[0]) { - $style->setBackground(strtolower($match[1])); - } elseif ('href' === $match[0]) { - $style->setHref($match[1]); - } elseif ('options' === $match[0]) { - preg_match_all('([^,;]+)', strtolower($match[1]), $options); - $options = array_shift($options); - foreach ($options as $option) { - $style->setOption($option); - } - } else { - return null; - } - } - - return $style; - } - - /** - * Applies current style from stack to text, if must be applied. - */ - private function applyCurrentStyle(string $text, string $current, int $width, int &$currentLineLength): string - { - if ('' === $text) { - return ''; - } - - if (!$width) { - return $this->isDecorated() ? $this->styleStack->getCurrent()->apply($text) : $text; - } - - if (!$currentLineLength && '' !== $current) { - $text = ltrim($text); - } - - if ($currentLineLength) { - $prefix = substr($text, 0, $i = $width - $currentLineLength)."\n"; - $text = substr($text, $i); - } else { - $prefix = ''; - } - - preg_match('~(\\n)$~', $text, $matches); - $text = $prefix.preg_replace('~([^\\n]{'.$width.'})\\ *~', "\$1\n", $text); - $text = rtrim($text, "\n").($matches[1] ?? ''); - - if (!$currentLineLength && '' !== $current && "\n" !== substr($current, -1)) { - $text = "\n".$text; - } - - $lines = explode("\n", $text); - - foreach ($lines as $line) { - $currentLineLength += \strlen($line); - if ($width <= $currentLineLength) { - $currentLineLength = 0; - } - } - - if ($this->isDecorated()) { - foreach ($lines as $i => $line) { - $lines[$i] = $this->styleStack->getCurrent()->apply($line); - } - } - - return implode("\n", $lines); - } -} diff --git a/vendor/symfony/console/Formatter/OutputFormatterInterface.php b/vendor/symfony/console/Formatter/OutputFormatterInterface.php deleted file mode 100644 index 22f40a3..0000000 --- a/vendor/symfony/console/Formatter/OutputFormatterInterface.php +++ /dev/null @@ -1,70 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Formatter; - -/** - * Formatter interface for console output. - * - * @author Konstantin Kudryashov - */ -interface OutputFormatterInterface -{ - /** - * Sets the decorated flag. - * - * @param bool $decorated Whether to decorate the messages or not - */ - public function setDecorated($decorated); - - /** - * Gets the decorated flag. - * - * @return bool true if the output will decorate messages, false otherwise - */ - public function isDecorated(); - - /** - * Sets a new style. - * - * @param string $name The style name - */ - public function setStyle($name, OutputFormatterStyleInterface $style); - - /** - * Checks if output formatter has style with specified name. - * - * @param string $name - * - * @return bool - */ - public function hasStyle($name); - - /** - * Gets style options from style with specified name. - * - * @param string $name - * - * @return OutputFormatterStyleInterface - * - * @throws \InvalidArgumentException When style isn't defined - */ - public function getStyle($name); - - /** - * Formats a message according to the given styles. - * - * @param string $message The message to style - * - * @return string The styled message - */ - public function format($message); -} diff --git a/vendor/symfony/console/Formatter/OutputFormatterStyle.php b/vendor/symfony/console/Formatter/OutputFormatterStyle.php deleted file mode 100644 index 7cb6116..0000000 --- a/vendor/symfony/console/Formatter/OutputFormatterStyle.php +++ /dev/null @@ -1,197 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Formatter; - -use Symfony\Component\Console\Exception\InvalidArgumentException; - -/** - * Formatter style class for defining styles. - * - * @author Konstantin Kudryashov - */ -class OutputFormatterStyle implements OutputFormatterStyleInterface -{ - private static $availableForegroundColors = [ - 'black' => ['set' => 30, 'unset' => 39], - 'red' => ['set' => 31, 'unset' => 39], - 'green' => ['set' => 32, 'unset' => 39], - 'yellow' => ['set' => 33, 'unset' => 39], - 'blue' => ['set' => 34, 'unset' => 39], - 'magenta' => ['set' => 35, 'unset' => 39], - 'cyan' => ['set' => 36, 'unset' => 39], - 'white' => ['set' => 37, 'unset' => 39], - 'default' => ['set' => 39, 'unset' => 39], - ]; - private static $availableBackgroundColors = [ - 'black' => ['set' => 40, 'unset' => 49], - 'red' => ['set' => 41, 'unset' => 49], - 'green' => ['set' => 42, 'unset' => 49], - 'yellow' => ['set' => 43, 'unset' => 49], - 'blue' => ['set' => 44, 'unset' => 49], - 'magenta' => ['set' => 45, 'unset' => 49], - 'cyan' => ['set' => 46, 'unset' => 49], - 'white' => ['set' => 47, 'unset' => 49], - 'default' => ['set' => 49, 'unset' => 49], - ]; - private static $availableOptions = [ - 'bold' => ['set' => 1, 'unset' => 22], - 'underscore' => ['set' => 4, 'unset' => 24], - 'blink' => ['set' => 5, 'unset' => 25], - 'reverse' => ['set' => 7, 'unset' => 27], - 'conceal' => ['set' => 8, 'unset' => 28], - ]; - - private $foreground; - private $background; - private $href; - private $options = []; - private $handlesHrefGracefully; - - /** - * Initializes output formatter style. - * - * @param string|null $foreground The style foreground color name - * @param string|null $background The style background color name - */ - public function __construct(string $foreground = null, string $background = null, array $options = []) - { - if (null !== $foreground) { - $this->setForeground($foreground); - } - if (null !== $background) { - $this->setBackground($background); - } - if (\count($options)) { - $this->setOptions($options); - } - } - - /** - * {@inheritdoc} - */ - public function setForeground($color = null) - { - if (null === $color) { - $this->foreground = null; - - return; - } - - if (!isset(static::$availableForegroundColors[$color])) { - throw new InvalidArgumentException(sprintf('Invalid foreground color specified: "%s". Expected one of (%s).', $color, implode(', ', array_keys(static::$availableForegroundColors)))); - } - - $this->foreground = static::$availableForegroundColors[$color]; - } - - /** - * {@inheritdoc} - */ - public function setBackground($color = null) - { - if (null === $color) { - $this->background = null; - - return; - } - - if (!isset(static::$availableBackgroundColors[$color])) { - throw new InvalidArgumentException(sprintf('Invalid background color specified: "%s". Expected one of (%s).', $color, implode(', ', array_keys(static::$availableBackgroundColors)))); - } - - $this->background = static::$availableBackgroundColors[$color]; - } - - public function setHref(string $url): void - { - $this->href = $url; - } - - /** - * {@inheritdoc} - */ - public function setOption($option) - { - if (!isset(static::$availableOptions[$option])) { - throw new InvalidArgumentException(sprintf('Invalid option specified: "%s". Expected one of (%s).', $option, implode(', ', array_keys(static::$availableOptions)))); - } - - if (!\in_array(static::$availableOptions[$option], $this->options)) { - $this->options[] = static::$availableOptions[$option]; - } - } - - /** - * {@inheritdoc} - */ - public function unsetOption($option) - { - if (!isset(static::$availableOptions[$option])) { - throw new InvalidArgumentException(sprintf('Invalid option specified: "%s". Expected one of (%s).', $option, implode(', ', array_keys(static::$availableOptions)))); - } - - $pos = array_search(static::$availableOptions[$option], $this->options); - if (false !== $pos) { - unset($this->options[$pos]); - } - } - - /** - * {@inheritdoc} - */ - public function setOptions(array $options) - { - $this->options = []; - - foreach ($options as $option) { - $this->setOption($option); - } - } - - /** - * {@inheritdoc} - */ - public function apply($text) - { - $setCodes = []; - $unsetCodes = []; - - if (null === $this->handlesHrefGracefully) { - $this->handlesHrefGracefully = 'JetBrains-JediTerm' !== getenv('TERMINAL_EMULATOR') - && (!getenv('KONSOLE_VERSION') || (int) getenv('KONSOLE_VERSION') > 201100); - } - - if (null !== $this->foreground) { - $setCodes[] = $this->foreground['set']; - $unsetCodes[] = $this->foreground['unset']; - } - if (null !== $this->background) { - $setCodes[] = $this->background['set']; - $unsetCodes[] = $this->background['unset']; - } - - foreach ($this->options as $option) { - $setCodes[] = $option['set']; - $unsetCodes[] = $option['unset']; - } - - if (null !== $this->href && $this->handlesHrefGracefully) { - $text = "\033]8;;$this->href\033\\$text\033]8;;\033\\"; - } - - if (0 === \count($setCodes)) { - return $text; - } - - return sprintf("\033[%sm%s\033[%sm", implode(';', $setCodes), $text, implode(';', $unsetCodes)); - } -} diff --git a/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php b/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php deleted file mode 100644 index af171c2..0000000 --- a/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Formatter; - -/** - * Formatter style interface for defining styles. - * - * @author Konstantin Kudryashov - */ -interface OutputFormatterStyleInterface -{ - /** - * Sets style foreground color. - * - * @param string|null $color The color name - */ - public function setForeground($color = null); - - /** - * Sets style background color. - * - * @param string $color The color name - */ - public function setBackground($color = null); - - /** - * Sets some specific style option. - * - * @param string $option The option name - */ - public function setOption($option); - - /** - * Unsets some specific style option. - * - * @param string $option The option name - */ - public function unsetOption($option); - - /** - * Sets multiple style options at once. - */ - public function setOptions(array $options); - - /** - * Applies the style to a given text. - * - * @param string $text The text to style - * - * @return string - */ - public function apply($text); -} diff --git a/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php b/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php deleted file mode 100644 index fc48dc0..0000000 --- a/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php +++ /dev/null @@ -1,110 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Formatter; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Contracts\Service\ResetInterface; - -/** - * @author Jean-François Simon - */ -class OutputFormatterStyleStack implements ResetInterface -{ - /** - * @var OutputFormatterStyleInterface[] - */ - private $styles; - - private $emptyStyle; - - public function __construct(OutputFormatterStyleInterface $emptyStyle = null) - { - $this->emptyStyle = $emptyStyle ?? new OutputFormatterStyle(); - $this->reset(); - } - - /** - * Resets stack (ie. empty internal arrays). - */ - public function reset() - { - $this->styles = []; - } - - /** - * Pushes a style in the stack. - */ - public function push(OutputFormatterStyleInterface $style) - { - $this->styles[] = $style; - } - - /** - * Pops a style from the stack. - * - * @return OutputFormatterStyleInterface - * - * @throws InvalidArgumentException When style tags incorrectly nested - */ - public function pop(OutputFormatterStyleInterface $style = null) - { - if (empty($this->styles)) { - return $this->emptyStyle; - } - - if (null === $style) { - return array_pop($this->styles); - } - - foreach (array_reverse($this->styles, true) as $index => $stackedStyle) { - if ($style->apply('') === $stackedStyle->apply('')) { - $this->styles = \array_slice($this->styles, 0, $index); - - return $stackedStyle; - } - } - - throw new InvalidArgumentException('Incorrectly nested style tag found.'); - } - - /** - * Computes current style with stacks top codes. - * - * @return OutputFormatterStyle - */ - public function getCurrent() - { - if (empty($this->styles)) { - return $this->emptyStyle; - } - - return $this->styles[\count($this->styles) - 1]; - } - - /** - * @return $this - */ - public function setEmptyStyle(OutputFormatterStyleInterface $emptyStyle) - { - $this->emptyStyle = $emptyStyle; - - return $this; - } - - /** - * @return OutputFormatterStyleInterface - */ - public function getEmptyStyle() - { - return $this->emptyStyle; - } -} diff --git a/vendor/symfony/console/Formatter/WrappableOutputFormatterInterface.php b/vendor/symfony/console/Formatter/WrappableOutputFormatterInterface.php deleted file mode 100644 index 6694053..0000000 --- a/vendor/symfony/console/Formatter/WrappableOutputFormatterInterface.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Formatter; - -/** - * Formatter interface for console output that supports word wrapping. - * - * @author Roland Franssen - */ -interface WrappableOutputFormatterInterface extends OutputFormatterInterface -{ - /** - * Formats a message according to the given styles, wrapping at `$width` (0 means no wrapping). - */ - public function formatAndWrap(string $message, int $width); -} diff --git a/vendor/symfony/console/Helper/DebugFormatterHelper.php b/vendor/symfony/console/Helper/DebugFormatterHelper.php deleted file mode 100644 index 1653ede..0000000 --- a/vendor/symfony/console/Helper/DebugFormatterHelper.php +++ /dev/null @@ -1,122 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -/** - * Helps outputting debug information when running an external program from a command. - * - * An external program can be a Process, an HTTP request, or anything else. - * - * @author Fabien Potencier - */ -class DebugFormatterHelper extends Helper -{ - private $colors = ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white', 'default']; - private $started = []; - private $count = -1; - - /** - * Starts a debug formatting session. - * - * @param string $id The id of the formatting session - * @param string $message The message to display - * @param string $prefix The prefix to use - * - * @return string - */ - public function start($id, $message, $prefix = 'RUN') - { - $this->started[$id] = ['border' => ++$this->count % \count($this->colors)]; - - return sprintf("%s %s %s\n", $this->getBorder($id), $prefix, $message); - } - - /** - * Adds progress to a formatting session. - * - * @param string $id The id of the formatting session - * @param string $buffer The message to display - * @param bool $error Whether to consider the buffer as error - * @param string $prefix The prefix for output - * @param string $errorPrefix The prefix for error output - * - * @return string - */ - public function progress($id, $buffer, $error = false, $prefix = 'OUT', $errorPrefix = 'ERR') - { - $message = ''; - - if ($error) { - if (isset($this->started[$id]['out'])) { - $message .= "\n"; - unset($this->started[$id]['out']); - } - if (!isset($this->started[$id]['err'])) { - $message .= sprintf('%s %s ', $this->getBorder($id), $errorPrefix); - $this->started[$id]['err'] = true; - } - - $message .= str_replace("\n", sprintf("\n%s %s ", $this->getBorder($id), $errorPrefix), $buffer); - } else { - if (isset($this->started[$id]['err'])) { - $message .= "\n"; - unset($this->started[$id]['err']); - } - if (!isset($this->started[$id]['out'])) { - $message .= sprintf('%s %s ', $this->getBorder($id), $prefix); - $this->started[$id]['out'] = true; - } - - $message .= str_replace("\n", sprintf("\n%s %s ", $this->getBorder($id), $prefix), $buffer); - } - - return $message; - } - - /** - * Stops a formatting session. - * - * @param string $id The id of the formatting session - * @param string $message The message to display - * @param bool $successful Whether to consider the result as success - * @param string $prefix The prefix for the end output - * - * @return string - */ - public function stop($id, $message, $successful, $prefix = 'RES') - { - $trailingEOL = isset($this->started[$id]['out']) || isset($this->started[$id]['err']) ? "\n" : ''; - - if ($successful) { - return sprintf("%s%s %s %s\n", $trailingEOL, $this->getBorder($id), $prefix, $message); - } - - $message = sprintf("%s%s %s %s\n", $trailingEOL, $this->getBorder($id), $prefix, $message); - - unset($this->started[$id]['out'], $this->started[$id]['err']); - - return $message; - } - - private function getBorder(string $id): string - { - return sprintf(' ', $this->colors[$this->started[$id]['border']]); - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return 'debug_formatter'; - } -} diff --git a/vendor/symfony/console/Helper/DescriptorHelper.php b/vendor/symfony/console/Helper/DescriptorHelper.php deleted file mode 100644 index 3055bae..0000000 --- a/vendor/symfony/console/Helper/DescriptorHelper.php +++ /dev/null @@ -1,91 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Descriptor\DescriptorInterface; -use Symfony\Component\Console\Descriptor\JsonDescriptor; -use Symfony\Component\Console\Descriptor\MarkdownDescriptor; -use Symfony\Component\Console\Descriptor\TextDescriptor; -use Symfony\Component\Console\Descriptor\XmlDescriptor; -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * This class adds helper method to describe objects in various formats. - * - * @author Jean-François Simon - */ -class DescriptorHelper extends Helper -{ - /** - * @var DescriptorInterface[] - */ - private $descriptors = []; - - public function __construct() - { - $this - ->register('txt', new TextDescriptor()) - ->register('xml', new XmlDescriptor()) - ->register('json', new JsonDescriptor()) - ->register('md', new MarkdownDescriptor()) - ; - } - - /** - * Describes an object if supported. - * - * Available options are: - * * format: string, the output format name - * * raw_text: boolean, sets output type as raw - * - * @param object $object - * - * @throws InvalidArgumentException when the given format is not supported - */ - public function describe(OutputInterface $output, $object, array $options = []) - { - $options = array_merge([ - 'raw_text' => false, - 'format' => 'txt', - ], $options); - - if (!isset($this->descriptors[$options['format']])) { - throw new InvalidArgumentException(sprintf('Unsupported format "%s".', $options['format'])); - } - - $descriptor = $this->descriptors[$options['format']]; - $descriptor->describe($output, $object, $options); - } - - /** - * Registers a descriptor. - * - * @param string $format - * - * @return $this - */ - public function register($format, DescriptorInterface $descriptor) - { - $this->descriptors[$format] = $descriptor; - - return $this; - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return 'descriptor'; - } -} diff --git a/vendor/symfony/console/Helper/Dumper.php b/vendor/symfony/console/Helper/Dumper.php deleted file mode 100644 index b013b6c..0000000 --- a/vendor/symfony/console/Helper/Dumper.php +++ /dev/null @@ -1,64 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\VarDumper\Cloner\ClonerInterface; -use Symfony\Component\VarDumper\Cloner\VarCloner; -use Symfony\Component\VarDumper\Dumper\CliDumper; - -/** - * @author Roland Franssen - */ -final class Dumper -{ - private $output; - private $dumper; - private $cloner; - private $handler; - - public function __construct(OutputInterface $output, CliDumper $dumper = null, ClonerInterface $cloner = null) - { - $this->output = $output; - $this->dumper = $dumper; - $this->cloner = $cloner; - - if (class_exists(CliDumper::class)) { - $this->handler = function ($var): string { - $dumper = $this->dumper ?? $this->dumper = new CliDumper(null, null, CliDumper::DUMP_LIGHT_ARRAY | CliDumper::DUMP_COMMA_SEPARATOR); - $dumper->setColors($this->output->isDecorated()); - - return rtrim($dumper->dump(($this->cloner ?? $this->cloner = new VarCloner())->cloneVar($var)->withRefHandles(false), true)); - }; - } else { - $this->handler = function ($var): string { - switch (true) { - case null === $var: - return 'null'; - case true === $var: - return 'true'; - case false === $var: - return 'false'; - case \is_string($var): - return '"'.$var.'"'; - default: - return rtrim(print_r($var, true)); - } - }; - } - } - - public function __invoke($var): string - { - return ($this->handler)($var); - } -} diff --git a/vendor/symfony/console/Helper/FormatterHelper.php b/vendor/symfony/console/Helper/FormatterHelper.php deleted file mode 100644 index d6eccee..0000000 --- a/vendor/symfony/console/Helper/FormatterHelper.php +++ /dev/null @@ -1,102 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Formatter\OutputFormatter; - -/** - * The Formatter class provides helpers to format messages. - * - * @author Fabien Potencier - */ -class FormatterHelper extends Helper -{ - /** - * Formats a message within a section. - * - * @param string $section The section name - * @param string $message The message - * @param string $style The style to apply to the section - * - * @return string The format section - */ - public function formatSection($section, $message, $style = 'info') - { - return sprintf('<%s>[%s] %s', $style, $section, $style, $message); - } - - /** - * Formats a message as a block of text. - * - * @param string|array $messages The message to write in the block - * @param string $style The style to apply to the whole block - * @param bool $large Whether to return a large block - * - * @return string The formatter message - */ - public function formatBlock($messages, $style, $large = false) - { - if (!\is_array($messages)) { - $messages = [$messages]; - } - - $len = 0; - $lines = []; - foreach ($messages as $message) { - $message = OutputFormatter::escape($message); - $lines[] = sprintf($large ? ' %s ' : ' %s ', $message); - $len = max(self::strlen($message) + ($large ? 4 : 2), $len); - } - - $messages = $large ? [str_repeat(' ', $len)] : []; - for ($i = 0; isset($lines[$i]); ++$i) { - $messages[] = $lines[$i].str_repeat(' ', $len - self::strlen($lines[$i])); - } - if ($large) { - $messages[] = str_repeat(' ', $len); - } - - for ($i = 0; isset($messages[$i]); ++$i) { - $messages[$i] = sprintf('<%s>%s', $style, $messages[$i], $style); - } - - return implode("\n", $messages); - } - - /** - * Truncates a message to the given length. - * - * @param string $message - * @param int $length - * @param string $suffix - * - * @return string - */ - public function truncate($message, $length, $suffix = '...') - { - $computedLength = $length - self::strlen($suffix); - - if ($computedLength > self::strlen($message)) { - return $message; - } - - return self::substr($message, 0, $length).$suffix; - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return 'formatter'; - } -} diff --git a/vendor/symfony/console/Helper/Helper.php b/vendor/symfony/console/Helper/Helper.php deleted file mode 100644 index 0521aaf..0000000 --- a/vendor/symfony/console/Helper/Helper.php +++ /dev/null @@ -1,142 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Formatter\OutputFormatterInterface; - -/** - * Helper is the base class for all helper classes. - * - * @author Fabien Potencier - */ -abstract class Helper implements HelperInterface -{ - protected $helperSet = null; - - /** - * {@inheritdoc} - */ - public function setHelperSet(HelperSet $helperSet = null) - { - $this->helperSet = $helperSet; - } - - /** - * {@inheritdoc} - */ - public function getHelperSet() - { - return $this->helperSet; - } - - /** - * Returns the length of a string, using mb_strwidth if it is available. - * - * @param string $string The string to check its length - * - * @return int The length of the string - */ - public static function strlen($string) - { - $string = (string) $string; - - if (false === $encoding = mb_detect_encoding($string, null, true)) { - return \strlen($string); - } - - return mb_strwidth($string, $encoding); - } - - /** - * Returns the subset of a string, using mb_substr if it is available. - * - * @param string $string String to subset - * @param int $from Start offset - * @param int|null $length Length to read - * - * @return string The string subset - */ - public static function substr($string, $from, $length = null) - { - $string = (string) $string; - - if (false === $encoding = mb_detect_encoding($string, null, true)) { - return substr($string, $from, $length); - } - - return mb_substr($string, $from, $length, $encoding); - } - - public static function formatTime($secs) - { - static $timeFormats = [ - [0, '< 1 sec'], - [1, '1 sec'], - [2, 'secs', 1], - [60, '1 min'], - [120, 'mins', 60], - [3600, '1 hr'], - [7200, 'hrs', 3600], - [86400, '1 day'], - [172800, 'days', 86400], - ]; - - foreach ($timeFormats as $index => $format) { - if ($secs >= $format[0]) { - if ((isset($timeFormats[$index + 1]) && $secs < $timeFormats[$index + 1][0]) - || $index == \count($timeFormats) - 1 - ) { - if (2 == \count($format)) { - return $format[1]; - } - - return floor($secs / $format[2]).' '.$format[1]; - } - } - } - } - - public static function formatMemory($memory) - { - if ($memory >= 1024 * 1024 * 1024) { - return sprintf('%.1f GiB', $memory / 1024 / 1024 / 1024); - } - - if ($memory >= 1024 * 1024) { - return sprintf('%.1f MiB', $memory / 1024 / 1024); - } - - if ($memory >= 1024) { - return sprintf('%d KiB', $memory / 1024); - } - - return sprintf('%d B', $memory); - } - - public static function strlenWithoutDecoration(OutputFormatterInterface $formatter, $string) - { - return self::strlen(self::removeDecoration($formatter, $string)); - } - - public static function removeDecoration(OutputFormatterInterface $formatter, $string) - { - $isDecorated = $formatter->isDecorated(); - $formatter->setDecorated(false); - // remove <...> formatting - $string = $formatter->format($string); - // remove already formatted characters - $string = preg_replace("/\033\[[^m]*m/", '', $string); - $formatter->setDecorated($isDecorated); - - return $string; - } -} diff --git a/vendor/symfony/console/Helper/HelperInterface.php b/vendor/symfony/console/Helper/HelperInterface.php deleted file mode 100644 index 1ce8235..0000000 --- a/vendor/symfony/console/Helper/HelperInterface.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -/** - * HelperInterface is the interface all helpers must implement. - * - * @author Fabien Potencier - */ -interface HelperInterface -{ - /** - * Sets the helper set associated with this helper. - */ - public function setHelperSet(HelperSet $helperSet = null); - - /** - * Gets the helper set associated with this helper. - * - * @return HelperSet A HelperSet instance - */ - public function getHelperSet(); - - /** - * Returns the canonical name of this helper. - * - * @return string The canonical name - */ - public function getName(); -} diff --git a/vendor/symfony/console/Helper/HelperSet.php b/vendor/symfony/console/Helper/HelperSet.php deleted file mode 100644 index 9aa1e67..0000000 --- a/vendor/symfony/console/Helper/HelperSet.php +++ /dev/null @@ -1,108 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Exception\InvalidArgumentException; - -/** - * HelperSet represents a set of helpers to be used with a command. - * - * @author Fabien Potencier - */ -class HelperSet implements \IteratorAggregate -{ - /** - * @var Helper[] - */ - private $helpers = []; - private $command; - - /** - * @param Helper[] $helpers An array of helper - */ - public function __construct(array $helpers = []) - { - foreach ($helpers as $alias => $helper) { - $this->set($helper, \is_int($alias) ? null : $alias); - } - } - - /** - * Sets a helper. - * - * @param string $alias An alias - */ - public function set(HelperInterface $helper, $alias = null) - { - $this->helpers[$helper->getName()] = $helper; - if (null !== $alias) { - $this->helpers[$alias] = $helper; - } - - $helper->setHelperSet($this); - } - - /** - * Returns true if the helper if defined. - * - * @param string $name The helper name - * - * @return bool true if the helper is defined, false otherwise - */ - public function has($name) - { - return isset($this->helpers[$name]); - } - - /** - * Gets a helper value. - * - * @param string $name The helper name - * - * @return HelperInterface The helper instance - * - * @throws InvalidArgumentException if the helper is not defined - */ - public function get($name) - { - if (!$this->has($name)) { - throw new InvalidArgumentException(sprintf('The helper "%s" is not defined.', $name)); - } - - return $this->helpers[$name]; - } - - public function setCommand(Command $command = null) - { - $this->command = $command; - } - - /** - * Gets the command associated with this helper set. - * - * @return Command A Command instance - */ - public function getCommand() - { - return $this->command; - } - - /** - * @return \Traversable - */ - #[\ReturnTypeWillChange] - public function getIterator() - { - return new \ArrayIterator($this->helpers); - } -} diff --git a/vendor/symfony/console/Helper/InputAwareHelper.php b/vendor/symfony/console/Helper/InputAwareHelper.php deleted file mode 100644 index 0d0dba2..0000000 --- a/vendor/symfony/console/Helper/InputAwareHelper.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Input\InputAwareInterface; -use Symfony\Component\Console\Input\InputInterface; - -/** - * An implementation of InputAwareInterface for Helpers. - * - * @author Wouter J - */ -abstract class InputAwareHelper extends Helper implements InputAwareInterface -{ - protected $input; - - /** - * {@inheritdoc} - */ - public function setInput(InputInterface $input) - { - $this->input = $input; - } -} diff --git a/vendor/symfony/console/Helper/ProcessHelper.php b/vendor/symfony/console/Helper/ProcessHelper.php deleted file mode 100644 index 862d09f..0000000 --- a/vendor/symfony/console/Helper/ProcessHelper.php +++ /dev/null @@ -1,154 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Process\Exception\ProcessFailedException; -use Symfony\Component\Process\Process; - -/** - * The ProcessHelper class provides helpers to run external processes. - * - * @author Fabien Potencier - * - * @final since Symfony 4.2 - */ -class ProcessHelper extends Helper -{ - /** - * Runs an external process. - * - * @param array|Process $cmd An instance of Process or an array of the command and arguments - * @param string|null $error An error message that must be displayed if something went wrong - * @param callable|null $callback A PHP callback to run whenever there is some - * output available on STDOUT or STDERR - * @param int $verbosity The threshold for verbosity - * - * @return Process The process that ran - */ - public function run(OutputInterface $output, $cmd, $error = null, callable $callback = null, $verbosity = OutputInterface::VERBOSITY_VERY_VERBOSE) - { - if (!class_exists(Process::class)) { - throw new \LogicException('The ProcessHelper cannot be run as the Process component is not installed. Try running "compose require symfony/process".'); - } - - if ($output instanceof ConsoleOutputInterface) { - $output = $output->getErrorOutput(); - } - - $formatter = $this->getHelperSet()->get('debug_formatter'); - - if ($cmd instanceof Process) { - $cmd = [$cmd]; - } - - if (!\is_array($cmd)) { - @trigger_error(sprintf('Passing a command as a string to "%s()" is deprecated since Symfony 4.2, pass it the command as an array of arguments instead.', __METHOD__), \E_USER_DEPRECATED); - $cmd = [method_exists(Process::class, 'fromShellCommandline') ? Process::fromShellCommandline($cmd) : new Process($cmd)]; - } - - if (\is_string($cmd[0] ?? null)) { - $process = new Process($cmd); - $cmd = []; - } elseif (($cmd[0] ?? null) instanceof Process) { - $process = $cmd[0]; - unset($cmd[0]); - } else { - throw new \InvalidArgumentException(sprintf('Invalid command provided to "%s()": the command should be an array whose first element is either the path to the binary to run or a "Process" object.', __METHOD__)); - } - - if ($verbosity <= $output->getVerbosity()) { - $output->write($formatter->start(spl_object_hash($process), $this->escapeString($process->getCommandLine()))); - } - - if ($output->isDebug()) { - $callback = $this->wrapCallback($output, $process, $callback); - } - - $process->run($callback, $cmd); - - if ($verbosity <= $output->getVerbosity()) { - $message = $process->isSuccessful() ? 'Command ran successfully' : sprintf('%s Command did not run successfully', $process->getExitCode()); - $output->write($formatter->stop(spl_object_hash($process), $message, $process->isSuccessful())); - } - - if (!$process->isSuccessful() && null !== $error) { - $output->writeln(sprintf('%s', $this->escapeString($error))); - } - - return $process; - } - - /** - * Runs the process. - * - * This is identical to run() except that an exception is thrown if the process - * exits with a non-zero exit code. - * - * @param array|Process $cmd An instance of Process or a command to run - * @param string|null $error An error message that must be displayed if something went wrong - * @param callable|null $callback A PHP callback to run whenever there is some - * output available on STDOUT or STDERR - * - * @return Process The process that ran - * - * @throws ProcessFailedException - * - * @see run() - */ - public function mustRun(OutputInterface $output, $cmd, $error = null, callable $callback = null) - { - $process = $this->run($output, $cmd, $error, $callback); - - if (!$process->isSuccessful()) { - throw new ProcessFailedException($process); - } - - return $process; - } - - /** - * Wraps a Process callback to add debugging output. - * - * @return callable - */ - public function wrapCallback(OutputInterface $output, Process $process, callable $callback = null) - { - if ($output instanceof ConsoleOutputInterface) { - $output = $output->getErrorOutput(); - } - - $formatter = $this->getHelperSet()->get('debug_formatter'); - - return function ($type, $buffer) use ($output, $process, $callback, $formatter) { - $output->write($formatter->progress(spl_object_hash($process), $this->escapeString($buffer), Process::ERR === $type)); - - if (null !== $callback) { - $callback($type, $buffer); - } - }; - } - - private function escapeString(string $str): string - { - return str_replace('<', '\\<', $str); - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return 'process'; - } -} diff --git a/vendor/symfony/console/Helper/ProgressBar.php b/vendor/symfony/console/Helper/ProgressBar.php deleted file mode 100644 index 1de9b7b..0000000 --- a/vendor/symfony/console/Helper/ProgressBar.php +++ /dev/null @@ -1,599 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Exception\LogicException; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\ConsoleSectionOutput; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Terminal; - -/** - * The ProgressBar provides helpers to display progress output. - * - * @author Fabien Potencier - * @author Chris Jones - */ -final class ProgressBar -{ - private $barWidth = 28; - private $barChar; - private $emptyBarChar = '-'; - private $progressChar = '>'; - private $format; - private $internalFormat; - private $redrawFreq = 1; - private $writeCount; - private $lastWriteTime; - private $minSecondsBetweenRedraws = 0; - private $maxSecondsBetweenRedraws = 1; - private $output; - private $step = 0; - private $max; - private $startTime; - private $stepWidth; - private $percent = 0.0; - private $formatLineCount; - private $messages = []; - private $overwrite = true; - private $terminal; - private $previousMessage; - - private static $formatters; - private static $formats; - - /** - * @param int $max Maximum steps (0 if unknown) - */ - public function __construct(OutputInterface $output, int $max = 0, float $minSecondsBetweenRedraws = 0.1) - { - if ($output instanceof ConsoleOutputInterface) { - $output = $output->getErrorOutput(); - } - - $this->output = $output; - $this->setMaxSteps($max); - $this->terminal = new Terminal(); - - if (0 < $minSecondsBetweenRedraws) { - $this->redrawFreq = null; - $this->minSecondsBetweenRedraws = $minSecondsBetweenRedraws; - } - - if (!$this->output->isDecorated()) { - // disable overwrite when output does not support ANSI codes. - $this->overwrite = false; - - // set a reasonable redraw frequency so output isn't flooded - $this->redrawFreq = null; - } - - $this->startTime = time(); - } - - /** - * Sets a placeholder formatter for a given name. - * - * This method also allow you to override an existing placeholder. - * - * @param string $name The placeholder name (including the delimiter char like %) - * @param callable $callable A PHP callable - */ - public static function setPlaceholderFormatterDefinition(string $name, callable $callable): void - { - if (!self::$formatters) { - self::$formatters = self::initPlaceholderFormatters(); - } - - self::$formatters[$name] = $callable; - } - - /** - * Gets the placeholder formatter for a given name. - * - * @param string $name The placeholder name (including the delimiter char like %) - * - * @return callable|null A PHP callable - */ - public static function getPlaceholderFormatterDefinition(string $name): ?callable - { - if (!self::$formatters) { - self::$formatters = self::initPlaceholderFormatters(); - } - - return self::$formatters[$name] ?? null; - } - - /** - * Sets a format for a given name. - * - * This method also allow you to override an existing format. - * - * @param string $name The format name - * @param string $format A format string - */ - public static function setFormatDefinition(string $name, string $format): void - { - if (!self::$formats) { - self::$formats = self::initFormats(); - } - - self::$formats[$name] = $format; - } - - /** - * Gets the format for a given name. - * - * @param string $name The format name - * - * @return string|null A format string - */ - public static function getFormatDefinition(string $name): ?string - { - if (!self::$formats) { - self::$formats = self::initFormats(); - } - - return self::$formats[$name] ?? null; - } - - /** - * Associates a text with a named placeholder. - * - * The text is displayed when the progress bar is rendered but only - * when the corresponding placeholder is part of the custom format line - * (by wrapping the name with %). - * - * @param string $message The text to associate with the placeholder - * @param string $name The name of the placeholder - */ - public function setMessage(string $message, string $name = 'message') - { - $this->messages[$name] = $message; - } - - public function getMessage(string $name = 'message') - { - return $this->messages[$name]; - } - - public function getStartTime(): int - { - return $this->startTime; - } - - public function getMaxSteps(): int - { - return $this->max; - } - - public function getProgress(): int - { - return $this->step; - } - - private function getStepWidth(): int - { - return $this->stepWidth; - } - - public function getProgressPercent(): float - { - return $this->percent; - } - - public function getBarOffset(): int - { - return floor($this->max ? $this->percent * $this->barWidth : (null === $this->redrawFreq ? (int) (min(5, $this->barWidth / 15) * $this->writeCount) : $this->step) % $this->barWidth); - } - - public function setBarWidth(int $size) - { - $this->barWidth = max(1, $size); - } - - public function getBarWidth(): int - { - return $this->barWidth; - } - - public function setBarCharacter(string $char) - { - $this->barChar = $char; - } - - public function getBarCharacter(): string - { - if (null === $this->barChar) { - return $this->max ? '=' : $this->emptyBarChar; - } - - return $this->barChar; - } - - public function setEmptyBarCharacter(string $char) - { - $this->emptyBarChar = $char; - } - - public function getEmptyBarCharacter(): string - { - return $this->emptyBarChar; - } - - public function setProgressCharacter(string $char) - { - $this->progressChar = $char; - } - - public function getProgressCharacter(): string - { - return $this->progressChar; - } - - public function setFormat(string $format) - { - $this->format = null; - $this->internalFormat = $format; - } - - /** - * Sets the redraw frequency. - * - * @param int|null $freq The frequency in steps - */ - public function setRedrawFrequency(?int $freq) - { - $this->redrawFreq = null !== $freq ? max(1, $freq) : null; - } - - public function minSecondsBetweenRedraws(float $seconds): void - { - $this->minSecondsBetweenRedraws = $seconds; - } - - public function maxSecondsBetweenRedraws(float $seconds): void - { - $this->maxSecondsBetweenRedraws = $seconds; - } - - /** - * Returns an iterator that will automatically update the progress bar when iterated. - * - * @param int|null $max Number of steps to complete the bar (0 if indeterminate), if null it will be inferred from $iterable - */ - public function iterate(iterable $iterable, int $max = null): iterable - { - $this->start($max ?? (is_countable($iterable) ? \count($iterable) : 0)); - - foreach ($iterable as $key => $value) { - yield $key => $value; - - $this->advance(); - } - - $this->finish(); - } - - /** - * Starts the progress output. - * - * @param int|null $max Number of steps to complete the bar (0 if indeterminate), null to leave unchanged - */ - public function start(int $max = null) - { - $this->startTime = time(); - $this->step = 0; - $this->percent = 0.0; - - if (null !== $max) { - $this->setMaxSteps($max); - } - - $this->display(); - } - - /** - * Advances the progress output X steps. - * - * @param int $step Number of steps to advance - */ - public function advance(int $step = 1) - { - $this->setProgress($this->step + $step); - } - - /** - * Sets whether to overwrite the progressbar, false for new line. - */ - public function setOverwrite(bool $overwrite) - { - $this->overwrite = $overwrite; - } - - public function setProgress(int $step) - { - if ($this->max && $step > $this->max) { - $this->max = $step; - } elseif ($step < 0) { - $step = 0; - } - - $redrawFreq = $this->redrawFreq ?? (($this->max ?: 10) / 10); - $prevPeriod = (int) ($this->step / $redrawFreq); - $currPeriod = (int) ($step / $redrawFreq); - $this->step = $step; - $this->percent = $this->max ? (float) $this->step / $this->max : 0; - $timeInterval = microtime(true) - $this->lastWriteTime; - - // Draw regardless of other limits - if ($this->max === $step) { - $this->display(); - - return; - } - - // Throttling - if ($timeInterval < $this->minSecondsBetweenRedraws) { - return; - } - - // Draw each step period, but not too late - if ($prevPeriod !== $currPeriod || $timeInterval >= $this->maxSecondsBetweenRedraws) { - $this->display(); - } - } - - public function setMaxSteps(int $max) - { - $this->format = null; - $this->max = max(0, $max); - $this->stepWidth = $this->max ? Helper::strlen((string) $this->max) : 4; - } - - /** - * Finishes the progress output. - */ - public function finish(): void - { - if (!$this->max) { - $this->max = $this->step; - } - - if ($this->step === $this->max && !$this->overwrite) { - // prevent double 100% output - return; - } - - $this->setProgress($this->max); - } - - /** - * Outputs the current progress string. - */ - public function display(): void - { - if (OutputInterface::VERBOSITY_QUIET === $this->output->getVerbosity()) { - return; - } - - if (null === $this->format) { - $this->setRealFormat($this->internalFormat ?: $this->determineBestFormat()); - } - - $this->overwrite($this->buildLine()); - } - - /** - * Removes the progress bar from the current line. - * - * This is useful if you wish to write some output - * while a progress bar is running. - * Call display() to show the progress bar again. - */ - public function clear(): void - { - if (!$this->overwrite) { - return; - } - - if (null === $this->format) { - $this->setRealFormat($this->internalFormat ?: $this->determineBestFormat()); - } - - $this->overwrite(''); - } - - private function setRealFormat(string $format) - { - // try to use the _nomax variant if available - if (!$this->max && null !== self::getFormatDefinition($format.'_nomax')) { - $this->format = self::getFormatDefinition($format.'_nomax'); - } elseif (null !== self::getFormatDefinition($format)) { - $this->format = self::getFormatDefinition($format); - } else { - $this->format = $format; - } - - $this->formatLineCount = substr_count($this->format, "\n"); - } - - /** - * Overwrites a previous message to the output. - */ - private function overwrite(string $message): void - { - if ($this->previousMessage === $message) { - return; - } - - $originalMessage = $message; - - if ($this->overwrite) { - if (null !== $this->previousMessage) { - if ($this->output instanceof ConsoleSectionOutput) { - $messageLines = explode("\n", $message); - $lineCount = \count($messageLines); - foreach ($messageLines as $messageLine) { - $messageLineLength = Helper::strlenWithoutDecoration($this->output->getFormatter(), $messageLine); - if ($messageLineLength > $this->terminal->getWidth()) { - $lineCount += floor($messageLineLength / $this->terminal->getWidth()); - } - } - $this->output->clear($lineCount); - } else { - // Erase previous lines - if ($this->formatLineCount > 0) { - $message = str_repeat("\x1B[1A\x1B[2K", $this->formatLineCount).$message; - } - - // Move the cursor to the beginning of the line and erase the line - $message = "\x0D\x1B[2K$message"; - } - } - } elseif ($this->step > 0) { - $message = \PHP_EOL.$message; - } - - $this->previousMessage = $originalMessage; - $this->lastWriteTime = microtime(true); - - $this->output->write($message); - ++$this->writeCount; - } - - private function determineBestFormat(): string - { - switch ($this->output->getVerbosity()) { - // OutputInterface::VERBOSITY_QUIET: display is disabled anyway - case OutputInterface::VERBOSITY_VERBOSE: - return $this->max ? 'verbose' : 'verbose_nomax'; - case OutputInterface::VERBOSITY_VERY_VERBOSE: - return $this->max ? 'very_verbose' : 'very_verbose_nomax'; - case OutputInterface::VERBOSITY_DEBUG: - return $this->max ? 'debug' : 'debug_nomax'; - default: - return $this->max ? 'normal' : 'normal_nomax'; - } - } - - private static function initPlaceholderFormatters(): array - { - return [ - 'bar' => function (self $bar, OutputInterface $output) { - $completeBars = $bar->getBarOffset(); - $display = str_repeat($bar->getBarCharacter(), $completeBars); - if ($completeBars < $bar->getBarWidth()) { - $emptyBars = $bar->getBarWidth() - $completeBars - Helper::strlenWithoutDecoration($output->getFormatter(), $bar->getProgressCharacter()); - $display .= $bar->getProgressCharacter().str_repeat($bar->getEmptyBarCharacter(), $emptyBars); - } - - return $display; - }, - 'elapsed' => function (self $bar) { - return Helper::formatTime(time() - $bar->getStartTime()); - }, - 'remaining' => function (self $bar) { - if (!$bar->getMaxSteps()) { - throw new LogicException('Unable to display the remaining time if the maximum number of steps is not set.'); - } - - if (!$bar->getProgress()) { - $remaining = 0; - } else { - $remaining = round((time() - $bar->getStartTime()) / $bar->getProgress() * ($bar->getMaxSteps() - $bar->getProgress())); - } - - return Helper::formatTime($remaining); - }, - 'estimated' => function (self $bar) { - if (!$bar->getMaxSteps()) { - throw new LogicException('Unable to display the estimated time if the maximum number of steps is not set.'); - } - - if (!$bar->getProgress()) { - $estimated = 0; - } else { - $estimated = round((time() - $bar->getStartTime()) / $bar->getProgress() * $bar->getMaxSteps()); - } - - return Helper::formatTime($estimated); - }, - 'memory' => function (self $bar) { - return Helper::formatMemory(memory_get_usage(true)); - }, - 'current' => function (self $bar) { - return str_pad($bar->getProgress(), $bar->getStepWidth(), ' ', \STR_PAD_LEFT); - }, - 'max' => function (self $bar) { - return $bar->getMaxSteps(); - }, - 'percent' => function (self $bar) { - return floor($bar->getProgressPercent() * 100); - }, - ]; - } - - private static function initFormats(): array - { - return [ - 'normal' => ' %current%/%max% [%bar%] %percent:3s%%', - 'normal_nomax' => ' %current% [%bar%]', - - 'verbose' => ' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%', - 'verbose_nomax' => ' %current% [%bar%] %elapsed:6s%', - - 'very_verbose' => ' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s%', - 'very_verbose_nomax' => ' %current% [%bar%] %elapsed:6s%', - - 'debug' => ' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s% %memory:6s%', - 'debug_nomax' => ' %current% [%bar%] %elapsed:6s% %memory:6s%', - ]; - } - - private function buildLine(): string - { - $regex = "{%([a-z\-_]+)(?:\:([^%]+))?%}i"; - $callback = function ($matches) { - if ($formatter = $this::getPlaceholderFormatterDefinition($matches[1])) { - $text = $formatter($this, $this->output); - } elseif (isset($this->messages[$matches[1]])) { - $text = $this->messages[$matches[1]]; - } else { - return $matches[0]; - } - - if (isset($matches[2])) { - $text = sprintf('%'.$matches[2], $text); - } - - return $text; - }; - $line = preg_replace_callback($regex, $callback, $this->format); - - // gets string length for each sub line with multiline format - $linesLength = array_map(function ($subLine) { - return Helper::strlenWithoutDecoration($this->output->getFormatter(), rtrim($subLine, "\r")); - }, explode("\n", $line)); - - $linesWidth = max($linesLength); - - $terminalWidth = $this->terminal->getWidth(); - if ($linesWidth <= $terminalWidth) { - return $line; - } - - $this->setBarWidth($this->barWidth - $linesWidth + $terminalWidth); - - return preg_replace_callback($regex, $callback, $this->format); - } -} diff --git a/vendor/symfony/console/Helper/ProgressIndicator.php b/vendor/symfony/console/Helper/ProgressIndicator.php deleted file mode 100644 index dc37148..0000000 --- a/vendor/symfony/console/Helper/ProgressIndicator.php +++ /dev/null @@ -1,266 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\LogicException; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * @author Kevin Bond - */ -class ProgressIndicator -{ - private $output; - private $startTime; - private $format; - private $message; - private $indicatorValues; - private $indicatorCurrent; - private $indicatorChangeInterval; - private $indicatorUpdateTime; - private $started = false; - - private static $formatters; - private static $formats; - - /** - * @param string|null $format Indicator format - * @param int $indicatorChangeInterval Change interval in milliseconds - * @param array|null $indicatorValues Animated indicator characters - */ - public function __construct(OutputInterface $output, string $format = null, int $indicatorChangeInterval = 100, array $indicatorValues = null) - { - $this->output = $output; - - if (null === $format) { - $format = $this->determineBestFormat(); - } - - if (null === $indicatorValues) { - $indicatorValues = ['-', '\\', '|', '/']; - } - - $indicatorValues = array_values($indicatorValues); - - if (2 > \count($indicatorValues)) { - throw new InvalidArgumentException('Must have at least 2 indicator value characters.'); - } - - $this->format = self::getFormatDefinition($format); - $this->indicatorChangeInterval = $indicatorChangeInterval; - $this->indicatorValues = $indicatorValues; - $this->startTime = time(); - } - - /** - * Sets the current indicator message. - * - * @param string|null $message - */ - public function setMessage($message) - { - $this->message = $message; - - $this->display(); - } - - /** - * Starts the indicator output. - * - * @param $message - */ - public function start($message) - { - if ($this->started) { - throw new LogicException('Progress indicator already started.'); - } - - $this->message = $message; - $this->started = true; - $this->startTime = time(); - $this->indicatorUpdateTime = $this->getCurrentTimeInMilliseconds() + $this->indicatorChangeInterval; - $this->indicatorCurrent = 0; - - $this->display(); - } - - /** - * Advances the indicator. - */ - public function advance() - { - if (!$this->started) { - throw new LogicException('Progress indicator has not yet been started.'); - } - - if (!$this->output->isDecorated()) { - return; - } - - $currentTime = $this->getCurrentTimeInMilliseconds(); - - if ($currentTime < $this->indicatorUpdateTime) { - return; - } - - $this->indicatorUpdateTime = $currentTime + $this->indicatorChangeInterval; - ++$this->indicatorCurrent; - - $this->display(); - } - - /** - * Finish the indicator with message. - * - * @param $message - */ - public function finish($message) - { - if (!$this->started) { - throw new LogicException('Progress indicator has not yet been started.'); - } - - $this->message = $message; - $this->display(); - $this->output->writeln(''); - $this->started = false; - } - - /** - * Gets the format for a given name. - * - * @param string $name The format name - * - * @return string|null A format string - */ - public static function getFormatDefinition($name) - { - if (!self::$formats) { - self::$formats = self::initFormats(); - } - - return self::$formats[$name] ?? null; - } - - /** - * Sets a placeholder formatter for a given name. - * - * This method also allow you to override an existing placeholder. - * - * @param string $name The placeholder name (including the delimiter char like %) - * @param callable $callable A PHP callable - */ - public static function setPlaceholderFormatterDefinition($name, $callable) - { - if (!self::$formatters) { - self::$formatters = self::initPlaceholderFormatters(); - } - - self::$formatters[$name] = $callable; - } - - /** - * Gets the placeholder formatter for a given name. - * - * @param string $name The placeholder name (including the delimiter char like %) - * - * @return callable|null A PHP callable - */ - public static function getPlaceholderFormatterDefinition($name) - { - if (!self::$formatters) { - self::$formatters = self::initPlaceholderFormatters(); - } - - return self::$formatters[$name] ?? null; - } - - private function display() - { - if (OutputInterface::VERBOSITY_QUIET === $this->output->getVerbosity()) { - return; - } - - $this->overwrite(preg_replace_callback("{%([a-z\-_]+)(?:\:([^%]+))?%}i", function ($matches) { - if ($formatter = self::getPlaceholderFormatterDefinition($matches[1])) { - return $formatter($this); - } - - return $matches[0]; - }, $this->format ?? '')); - } - - private function determineBestFormat(): string - { - switch ($this->output->getVerbosity()) { - // OutputInterface::VERBOSITY_QUIET: display is disabled anyway - case OutputInterface::VERBOSITY_VERBOSE: - return $this->output->isDecorated() ? 'verbose' : 'verbose_no_ansi'; - case OutputInterface::VERBOSITY_VERY_VERBOSE: - case OutputInterface::VERBOSITY_DEBUG: - return $this->output->isDecorated() ? 'very_verbose' : 'very_verbose_no_ansi'; - default: - return $this->output->isDecorated() ? 'normal' : 'normal_no_ansi'; - } - } - - /** - * Overwrites a previous message to the output. - */ - private function overwrite(string $message) - { - if ($this->output->isDecorated()) { - $this->output->write("\x0D\x1B[2K"); - $this->output->write($message); - } else { - $this->output->writeln($message); - } - } - - private function getCurrentTimeInMilliseconds(): float - { - return round(microtime(true) * 1000); - } - - private static function initPlaceholderFormatters(): array - { - return [ - 'indicator' => function (self $indicator) { - return $indicator->indicatorValues[$indicator->indicatorCurrent % \count($indicator->indicatorValues)]; - }, - 'message' => function (self $indicator) { - return $indicator->message; - }, - 'elapsed' => function (self $indicator) { - return Helper::formatTime(time() - $indicator->startTime); - }, - 'memory' => function () { - return Helper::formatMemory(memory_get_usage(true)); - }, - ]; - } - - private static function initFormats(): array - { - return [ - 'normal' => ' %indicator% %message%', - 'normal_no_ansi' => ' %message%', - - 'verbose' => ' %indicator% %message% (%elapsed:6s%)', - 'verbose_no_ansi' => ' %message% (%elapsed:6s%)', - - 'very_verbose' => ' %indicator% %message% (%elapsed:6s%, %memory:6s%)', - 'very_verbose_no_ansi' => ' %message% (%elapsed:6s%, %memory:6s%)', - ]; - } -} diff --git a/vendor/symfony/console/Helper/QuestionHelper.php b/vendor/symfony/console/Helper/QuestionHelper.php deleted file mode 100644 index 0516545..0000000 --- a/vendor/symfony/console/Helper/QuestionHelper.php +++ /dev/null @@ -1,540 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Exception\MissingInputException; -use Symfony\Component\Console\Exception\RuntimeException; -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Formatter\OutputFormatterStyle; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\StreamableInputInterface; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\ConsoleSectionOutput; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Question\ChoiceQuestion; -use Symfony\Component\Console\Question\Question; -use Symfony\Component\Console\Terminal; - -/** - * The QuestionHelper class provides helpers to interact with the user. - * - * @author Fabien Potencier - */ -class QuestionHelper extends Helper -{ - private $inputStream; - private static $shell; - private static $stty = true; - private static $stdinIsInteractive; - - /** - * Asks a question to the user. - * - * @return mixed The user answer - * - * @throws RuntimeException If there is no data to read in the input stream - */ - public function ask(InputInterface $input, OutputInterface $output, Question $question) - { - if ($output instanceof ConsoleOutputInterface) { - $output = $output->getErrorOutput(); - } - - if (!$input->isInteractive()) { - return $this->getDefaultAnswer($question); - } - - if ($input instanceof StreamableInputInterface && $stream = $input->getStream()) { - $this->inputStream = $stream; - } - - try { - if (!$question->getValidator()) { - return $this->doAsk($output, $question); - } - - $interviewer = function () use ($output, $question) { - return $this->doAsk($output, $question); - }; - - return $this->validateAttempts($interviewer, $output, $question); - } catch (MissingInputException $exception) { - $input->setInteractive(false); - - if (null === $fallbackOutput = $this->getDefaultAnswer($question)) { - throw $exception; - } - - return $fallbackOutput; - } - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return 'question'; - } - - /** - * Prevents usage of stty. - */ - public static function disableStty() - { - self::$stty = false; - } - - /** - * Asks the question to the user. - * - * @return mixed - * - * @throws RuntimeException In case the fallback is deactivated and the response cannot be hidden - */ - private function doAsk(OutputInterface $output, Question $question) - { - $this->writePrompt($output, $question); - - $inputStream = $this->inputStream ?: \STDIN; - $autocomplete = $question->getAutocompleterCallback(); - - if (null === $autocomplete || !self::$stty || !Terminal::hasSttyAvailable()) { - $ret = false; - if ($question->isHidden()) { - try { - $hiddenResponse = $this->getHiddenResponse($output, $inputStream, $question->isTrimmable()); - $ret = $question->isTrimmable() ? trim($hiddenResponse) : $hiddenResponse; - } catch (RuntimeException $e) { - if (!$question->isHiddenFallback()) { - throw $e; - } - } - } - - if (false === $ret) { - $cp = $this->setIOCodepage(); - $ret = fgets($inputStream, 4096); - $ret = $this->resetIOCodepage($cp, $ret); - if (false === $ret) { - throw new MissingInputException('Aborted.'); - } - if ($question->isTrimmable()) { - $ret = trim($ret); - } - } - } else { - $autocomplete = $this->autocomplete($output, $question, $inputStream, $autocomplete); - $ret = $question->isTrimmable() ? trim($autocomplete) : $autocomplete; - } - - if ($output instanceof ConsoleSectionOutput) { - $output->addContent($ret); - } - - $ret = \strlen($ret) > 0 ? $ret : $question->getDefault(); - - if ($normalizer = $question->getNormalizer()) { - return $normalizer($ret); - } - - return $ret; - } - - /** - * @return mixed - */ - private function getDefaultAnswer(Question $question) - { - $default = $question->getDefault(); - - if (null === $default) { - return $default; - } - - if ($validator = $question->getValidator()) { - return \call_user_func($question->getValidator(), $default); - } elseif ($question instanceof ChoiceQuestion) { - $choices = $question->getChoices(); - - if (!$question->isMultiselect()) { - return $choices[$default] ?? $default; - } - - $default = explode(',', $default); - foreach ($default as $k => $v) { - $v = $question->isTrimmable() ? trim($v) : $v; - $default[$k] = $choices[$v] ?? $v; - } - } - - return $default; - } - - /** - * Outputs the question prompt. - */ - protected function writePrompt(OutputInterface $output, Question $question) - { - $message = $question->getQuestion(); - - if ($question instanceof ChoiceQuestion) { - $output->writeln(array_merge([ - $question->getQuestion(), - ], $this->formatChoiceQuestionChoices($question, 'info'))); - - $message = $question->getPrompt(); - } - - $output->write($message); - } - - /** - * @param string $tag - * - * @return string[] - */ - protected function formatChoiceQuestionChoices(ChoiceQuestion $question, $tag) - { - $messages = []; - - $maxWidth = max(array_map([__CLASS__, 'strlen'], array_keys($choices = $question->getChoices()))); - - foreach ($choices as $key => $value) { - $padding = str_repeat(' ', $maxWidth - self::strlen($key)); - - $messages[] = sprintf(" [<$tag>%s$padding] %s", $key, $value); - } - - return $messages; - } - - /** - * Outputs an error message. - */ - protected function writeError(OutputInterface $output, \Exception $error) - { - if (null !== $this->getHelperSet() && $this->getHelperSet()->has('formatter')) { - $message = $this->getHelperSet()->get('formatter')->formatBlock($error->getMessage(), 'error'); - } else { - $message = ''.$error->getMessage().''; - } - - $output->writeln($message); - } - - /** - * Autocompletes a question. - * - * @param resource $inputStream - */ - private function autocomplete(OutputInterface $output, Question $question, $inputStream, callable $autocomplete): string - { - $fullChoice = ''; - $ret = ''; - - $i = 0; - $ofs = -1; - $matches = $autocomplete($ret); - $numMatches = \count($matches); - - $sttyMode = shell_exec('stty -g'); - - // Disable icanon (so we can fread each keypress) and echo (we'll do echoing here instead) - shell_exec('stty -icanon -echo'); - - // Add highlighted text style - $output->getFormatter()->setStyle('hl', new OutputFormatterStyle('black', 'white')); - - // Read a keypress - while (!feof($inputStream)) { - $c = fread($inputStream, 1); - - // as opposed to fgets(), fread() returns an empty string when the stream content is empty, not false. - if (false === $c || ('' === $ret && '' === $c && null === $question->getDefault())) { - shell_exec(sprintf('stty %s', $sttyMode)); - throw new MissingInputException('Aborted.'); - } elseif ("\177" === $c) { // Backspace Character - if (0 === $numMatches && 0 !== $i) { - --$i; - $fullChoice = self::substr($fullChoice, 0, $i); - // Move cursor backwards - $output->write("\033[1D"); - } - - if (0 === $i) { - $ofs = -1; - $matches = $autocomplete($ret); - $numMatches = \count($matches); - } else { - $numMatches = 0; - } - - // Pop the last character off the end of our string - $ret = self::substr($ret, 0, $i); - } elseif ("\033" === $c) { - // Did we read an escape sequence? - $c .= fread($inputStream, 2); - - // A = Up Arrow. B = Down Arrow - if (isset($c[2]) && ('A' === $c[2] || 'B' === $c[2])) { - if ('A' === $c[2] && -1 === $ofs) { - $ofs = 0; - } - - if (0 === $numMatches) { - continue; - } - - $ofs += ('A' === $c[2]) ? -1 : 1; - $ofs = ($numMatches + $ofs) % $numMatches; - } - } elseif (\ord($c) < 32) { - if ("\t" === $c || "\n" === $c) { - if ($numMatches > 0 && -1 !== $ofs) { - $ret = (string) $matches[$ofs]; - // Echo out remaining chars for current match - $remainingCharacters = substr($ret, \strlen(trim($this->mostRecentlyEnteredValue($fullChoice)))); - $output->write($remainingCharacters); - $fullChoice .= $remainingCharacters; - $i = (false === $encoding = mb_detect_encoding($fullChoice, null, true)) ? \strlen($fullChoice) : mb_strlen($fullChoice, $encoding); - - $matches = array_filter( - $autocomplete($ret), - function ($match) use ($ret) { - return '' === $ret || str_starts_with($match, $ret); - } - ); - $numMatches = \count($matches); - $ofs = -1; - } - - if ("\n" === $c) { - $output->write($c); - break; - } - - $numMatches = 0; - } - - continue; - } else { - if ("\x80" <= $c) { - $c .= fread($inputStream, ["\xC0" => 1, "\xD0" => 1, "\xE0" => 2, "\xF0" => 3][$c & "\xF0"]); - } - - $output->write($c); - $ret .= $c; - $fullChoice .= $c; - ++$i; - - $tempRet = $ret; - - if ($question instanceof ChoiceQuestion && $question->isMultiselect()) { - $tempRet = $this->mostRecentlyEnteredValue($fullChoice); - } - - $numMatches = 0; - $ofs = 0; - - foreach ($autocomplete($ret) as $value) { - // If typed characters match the beginning chunk of value (e.g. [AcmeDe]moBundle) - if (str_starts_with($value, $tempRet)) { - $matches[$numMatches++] = $value; - } - } - } - - // Erase characters from cursor to end of line - $output->write("\033[K"); - - if ($numMatches > 0 && -1 !== $ofs) { - // Save cursor position - $output->write("\0337"); - // Write highlighted text, complete the partially entered response - $charactersEntered = \strlen(trim($this->mostRecentlyEnteredValue($fullChoice))); - $output->write(''.OutputFormatter::escapeTrailingBackslash(substr($matches[$ofs], $charactersEntered)).''); - // Restore cursor position - $output->write("\0338"); - } - } - - // Reset stty so it behaves normally again - shell_exec(sprintf('stty %s', $sttyMode)); - - return $fullChoice; - } - - private function mostRecentlyEnteredValue(string $entered): string - { - // Determine the most recent value that the user entered - if (!str_contains($entered, ',')) { - return $entered; - } - - $choices = explode(',', $entered); - if ('' !== $lastChoice = trim($choices[\count($choices) - 1])) { - return $lastChoice; - } - - return $entered; - } - - /** - * Gets a hidden response from user. - * - * @param resource $inputStream The handler resource - * @param bool $trimmable Is the answer trimmable - * - * @throws RuntimeException In case the fallback is deactivated and the response cannot be hidden - */ - private function getHiddenResponse(OutputInterface $output, $inputStream, bool $trimmable = true): string - { - if ('\\' === \DIRECTORY_SEPARATOR) { - $exe = __DIR__.'/../Resources/bin/hiddeninput.exe'; - - // handle code running from a phar - if ('phar:' === substr(__FILE__, 0, 5)) { - $tmpExe = sys_get_temp_dir().'/hiddeninput.exe'; - copy($exe, $tmpExe); - $exe = $tmpExe; - } - - $sExec = shell_exec('"'.$exe.'"'); - $value = $trimmable ? rtrim($sExec) : $sExec; - $output->writeln(''); - - if (isset($tmpExe)) { - unlink($tmpExe); - } - - return $value; - } - - if (self::$stty && Terminal::hasSttyAvailable()) { - $sttyMode = shell_exec('stty -g'); - shell_exec('stty -echo'); - } elseif ($this->isInteractiveInput($inputStream)) { - throw new RuntimeException('Unable to hide the response.'); - } - - $value = fgets($inputStream, 4096); - - if (self::$stty && Terminal::hasSttyAvailable()) { - shell_exec(sprintf('stty %s', $sttyMode)); - } - - if (false === $value) { - throw new MissingInputException('Aborted.'); - } - if ($trimmable) { - $value = trim($value); - } - $output->writeln(''); - - return $value; - } - - /** - * Validates an attempt. - * - * @param callable $interviewer A callable that will ask for a question and return the result - * - * @return mixed The validated response - * - * @throws \Exception In case the max number of attempts has been reached and no valid response has been given - */ - private function validateAttempts(callable $interviewer, OutputInterface $output, Question $question) - { - $error = null; - $attempts = $question->getMaxAttempts(); - - while (null === $attempts || $attempts--) { - if (null !== $error) { - $this->writeError($output, $error); - } - - try { - return $question->getValidator()($interviewer()); - } catch (RuntimeException $e) { - throw $e; - } catch (\Exception $error) { - } - } - - throw $error; - } - - private function isInteractiveInput($inputStream): bool - { - if ('php://stdin' !== (stream_get_meta_data($inputStream)['uri'] ?? null)) { - return false; - } - - if (null !== self::$stdinIsInteractive) { - return self::$stdinIsInteractive; - } - - if (\function_exists('stream_isatty')) { - return self::$stdinIsInteractive = stream_isatty(fopen('php://stdin', 'r')); - } - - if (\function_exists('posix_isatty')) { - return self::$stdinIsInteractive = posix_isatty(fopen('php://stdin', 'r')); - } - - if (!\function_exists('exec')) { - return self::$stdinIsInteractive = true; - } - - exec('stty 2> /dev/null', $output, $status); - - return self::$stdinIsInteractive = 1 !== $status; - } - - /** - * Sets console I/O to the host code page. - * - * @return int Previous code page in IBM/EBCDIC format - */ - private function setIOCodepage(): int - { - if (\function_exists('sapi_windows_cp_set')) { - $cp = sapi_windows_cp_get(); - sapi_windows_cp_set(sapi_windows_cp_get('oem')); - - return $cp; - } - - return 0; - } - - /** - * Sets console I/O to the specified code page and converts the user input. - * - * @param string|false $input - * - * @return string|false - */ - private function resetIOCodepage(int $cp, $input) - { - if (0 !== $cp) { - sapi_windows_cp_set($cp); - - if (false !== $input && '' !== $input) { - $input = sapi_windows_cp_conv(sapi_windows_cp_get('oem'), $cp, $input); - } - } - - return $input; - } -} diff --git a/vendor/symfony/console/Helper/SymfonyQuestionHelper.php b/vendor/symfony/console/Helper/SymfonyQuestionHelper.php deleted file mode 100644 index ace5e18..0000000 --- a/vendor/symfony/console/Helper/SymfonyQuestionHelper.php +++ /dev/null @@ -1,96 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Question\ChoiceQuestion; -use Symfony\Component\Console\Question\ConfirmationQuestion; -use Symfony\Component\Console\Question\Question; -use Symfony\Component\Console\Style\SymfonyStyle; - -/** - * Symfony Style Guide compliant question helper. - * - * @author Kevin Bond - */ -class SymfonyQuestionHelper extends QuestionHelper -{ - /** - * {@inheritdoc} - */ - protected function writePrompt(OutputInterface $output, Question $question) - { - $text = OutputFormatter::escapeTrailingBackslash($question->getQuestion()); - $default = $question->getDefault(); - - switch (true) { - case null === $default: - $text = sprintf(' %s:', $text); - - break; - - case $question instanceof ConfirmationQuestion: - $text = sprintf(' %s (yes/no) [%s]:', $text, $default ? 'yes' : 'no'); - - break; - - case $question instanceof ChoiceQuestion && $question->isMultiselect(): - $choices = $question->getChoices(); - $default = explode(',', $default); - - foreach ($default as $key => $value) { - $default[$key] = $choices[trim($value)]; - } - - $text = sprintf(' %s [%s]:', $text, OutputFormatter::escape(implode(', ', $default))); - - break; - - case $question instanceof ChoiceQuestion: - $choices = $question->getChoices(); - $text = sprintf(' %s [%s]:', $text, OutputFormatter::escape($choices[$default] ?? $default)); - - break; - - default: - $text = sprintf(' %s [%s]:', $text, OutputFormatter::escape($default)); - } - - $output->writeln($text); - - $prompt = ' > '; - - if ($question instanceof ChoiceQuestion) { - $output->writeln($this->formatChoiceQuestionChoices($question, 'comment')); - - $prompt = $question->getPrompt(); - } - - $output->write($prompt); - } - - /** - * {@inheritdoc} - */ - protected function writeError(OutputInterface $output, \Exception $error) - { - if ($output instanceof SymfonyStyle) { - $output->newLine(); - $output->error($error->getMessage()); - - return; - } - - parent::writeError($output, $error); - } -} diff --git a/vendor/symfony/console/Helper/Table.php b/vendor/symfony/console/Helper/Table.php deleted file mode 100644 index 1d0a22b..0000000 --- a/vendor/symfony/console/Helper/Table.php +++ /dev/null @@ -1,854 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\RuntimeException; -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Formatter\WrappableOutputFormatterInterface; -use Symfony\Component\Console\Output\ConsoleSectionOutput; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Provides helpers to display a table. - * - * @author Fabien Potencier - * @author Саша Стаменковић - * @author Abdellatif Ait boudad - * @author Max Grigorian - * @author Dany Maillard - */ -class Table -{ - private const SEPARATOR_TOP = 0; - private const SEPARATOR_TOP_BOTTOM = 1; - private const SEPARATOR_MID = 2; - private const SEPARATOR_BOTTOM = 3; - private const BORDER_OUTSIDE = 0; - private const BORDER_INSIDE = 1; - - private $headerTitle; - private $footerTitle; - - /** - * Table headers. - */ - private $headers = []; - - /** - * Table rows. - */ - private $rows = []; - private $horizontal = false; - - /** - * Column widths cache. - */ - private $effectiveColumnWidths = []; - - /** - * Number of columns cache. - * - * @var int - */ - private $numberOfColumns; - - /** - * @var OutputInterface - */ - private $output; - - /** - * @var TableStyle - */ - private $style; - - /** - * @var array - */ - private $columnStyles = []; - - /** - * User set column widths. - * - * @var array - */ - private $columnWidths = []; - private $columnMaxWidths = []; - - private static $styles; - - private $rendered = false; - - public function __construct(OutputInterface $output) - { - $this->output = $output; - - if (!self::$styles) { - self::$styles = self::initStyles(); - } - - $this->setStyle('default'); - } - - /** - * Sets a style definition. - * - * @param string $name The style name - */ - public static function setStyleDefinition($name, TableStyle $style) - { - if (!self::$styles) { - self::$styles = self::initStyles(); - } - - self::$styles[$name] = $style; - } - - /** - * Gets a style definition by name. - * - * @param string $name The style name - * - * @return TableStyle - */ - public static function getStyleDefinition($name) - { - if (!self::$styles) { - self::$styles = self::initStyles(); - } - - if (isset(self::$styles[$name])) { - return self::$styles[$name]; - } - - throw new InvalidArgumentException(sprintf('Style "%s" is not defined.', $name)); - } - - /** - * Sets table style. - * - * @param TableStyle|string $name The style name or a TableStyle instance - * - * @return $this - */ - public function setStyle($name) - { - $this->style = $this->resolveStyle($name); - - return $this; - } - - /** - * Gets the current table style. - * - * @return TableStyle - */ - public function getStyle() - { - return $this->style; - } - - /** - * Sets table column style. - * - * @param int $columnIndex Column index - * @param TableStyle|string $name The style name or a TableStyle instance - * - * @return $this - */ - public function setColumnStyle($columnIndex, $name) - { - $columnIndex = (int) $columnIndex; - - $this->columnStyles[$columnIndex] = $this->resolveStyle($name); - - return $this; - } - - /** - * Gets the current style for a column. - * - * If style was not set, it returns the global table style. - * - * @param int $columnIndex Column index - * - * @return TableStyle - */ - public function getColumnStyle($columnIndex) - { - return $this->columnStyles[$columnIndex] ?? $this->getStyle(); - } - - /** - * Sets the minimum width of a column. - * - * @param int $columnIndex Column index - * @param int $width Minimum column width in characters - * - * @return $this - */ - public function setColumnWidth($columnIndex, $width) - { - $this->columnWidths[(int) $columnIndex] = (int) $width; - - return $this; - } - - /** - * Sets the minimum width of all columns. - * - * @return $this - */ - public function setColumnWidths(array $widths) - { - $this->columnWidths = []; - foreach ($widths as $index => $width) { - $this->setColumnWidth($index, $width); - } - - return $this; - } - - /** - * Sets the maximum width of a column. - * - * Any cell within this column which contents exceeds the specified width will be wrapped into multiple lines, while - * formatted strings are preserved. - * - * @return $this - */ - public function setColumnMaxWidth(int $columnIndex, int $width): self - { - if (!$this->output->getFormatter() instanceof WrappableOutputFormatterInterface) { - throw new \LogicException(sprintf('Setting a maximum column width is only supported when using a "%s" formatter, got "%s".', WrappableOutputFormatterInterface::class, \get_class($this->output->getFormatter()))); - } - - $this->columnMaxWidths[$columnIndex] = $width; - - return $this; - } - - public function setHeaders(array $headers) - { - $headers = array_values($headers); - if (!empty($headers) && !\is_array($headers[0])) { - $headers = [$headers]; - } - - $this->headers = $headers; - - return $this; - } - - public function setRows(array $rows) - { - $this->rows = []; - - return $this->addRows($rows); - } - - public function addRows(array $rows) - { - foreach ($rows as $row) { - $this->addRow($row); - } - - return $this; - } - - public function addRow($row) - { - if ($row instanceof TableSeparator) { - $this->rows[] = $row; - - return $this; - } - - if (!\is_array($row)) { - throw new InvalidArgumentException('A row must be an array or a TableSeparator instance.'); - } - - $this->rows[] = array_values($row); - - return $this; - } - - /** - * Adds a row to the table, and re-renders the table. - */ - public function appendRow($row): self - { - if (!$this->output instanceof ConsoleSectionOutput) { - throw new RuntimeException(sprintf('Output should be an instance of "%s" when calling "%s".', ConsoleSectionOutput::class, __METHOD__)); - } - - if ($this->rendered) { - $this->output->clear($this->calculateRowCount()); - } - - $this->addRow($row); - $this->render(); - - return $this; - } - - public function setRow($column, array $row) - { - $this->rows[$column] = $row; - - return $this; - } - - public function setHeaderTitle(?string $title): self - { - $this->headerTitle = $title; - - return $this; - } - - public function setFooterTitle(?string $title): self - { - $this->footerTitle = $title; - - return $this; - } - - public function setHorizontal(bool $horizontal = true): self - { - $this->horizontal = $horizontal; - - return $this; - } - - /** - * Renders table to output. - * - * Example: - * - * +---------------+-----------------------+------------------+ - * | ISBN | Title | Author | - * +---------------+-----------------------+------------------+ - * | 99921-58-10-7 | Divine Comedy | Dante Alighieri | - * | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | - * | 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien | - * +---------------+-----------------------+------------------+ - */ - public function render() - { - $divider = new TableSeparator(); - if ($this->horizontal) { - $rows = []; - foreach ($this->headers[0] ?? [] as $i => $header) { - $rows[$i] = [$header]; - foreach ($this->rows as $row) { - if ($row instanceof TableSeparator) { - continue; - } - if (isset($row[$i])) { - $rows[$i][] = $row[$i]; - } elseif ($rows[$i][0] instanceof TableCell && $rows[$i][0]->getColspan() >= 2) { - // Noop, there is a "title" - } else { - $rows[$i][] = null; - } - } - } - } else { - $rows = array_merge($this->headers, [$divider], $this->rows); - } - - $this->calculateNumberOfColumns($rows); - - $rows = $this->buildTableRows($rows); - $this->calculateColumnsWidth($rows); - - $isHeader = !$this->horizontal; - $isFirstRow = $this->horizontal; - $hasTitle = (bool) $this->headerTitle; - foreach ($rows as $row) { - if ($divider === $row) { - $isHeader = false; - $isFirstRow = true; - - continue; - } - if ($row instanceof TableSeparator) { - $this->renderRowSeparator(); - - continue; - } - if (!$row) { - continue; - } - - if ($isHeader || $isFirstRow) { - $this->renderRowSeparator( - $isHeader ? self::SEPARATOR_TOP : self::SEPARATOR_TOP_BOTTOM, - $hasTitle ? $this->headerTitle : null, - $hasTitle ? $this->style->getHeaderTitleFormat() : null - ); - $isFirstRow = false; - $hasTitle = false; - } - if ($this->horizontal) { - $this->renderRow($row, $this->style->getCellRowFormat(), $this->style->getCellHeaderFormat()); - } else { - $this->renderRow($row, $isHeader ? $this->style->getCellHeaderFormat() : $this->style->getCellRowFormat()); - } - } - $this->renderRowSeparator(self::SEPARATOR_BOTTOM, $this->footerTitle, $this->style->getFooterTitleFormat()); - - $this->cleanup(); - $this->rendered = true; - } - - /** - * Renders horizontal header separator. - * - * Example: - * - * +-----+-----------+-------+ - */ - private function renderRowSeparator(int $type = self::SEPARATOR_MID, string $title = null, string $titleFormat = null) - { - if (0 === $count = $this->numberOfColumns) { - return; - } - - $borders = $this->style->getBorderChars(); - if (!$borders[0] && !$borders[2] && !$this->style->getCrossingChar()) { - return; - } - - $crossings = $this->style->getCrossingChars(); - if (self::SEPARATOR_MID === $type) { - [$horizontal, $leftChar, $midChar, $rightChar] = [$borders[2], $crossings[8], $crossings[0], $crossings[4]]; - } elseif (self::SEPARATOR_TOP === $type) { - [$horizontal, $leftChar, $midChar, $rightChar] = [$borders[0], $crossings[1], $crossings[2], $crossings[3]]; - } elseif (self::SEPARATOR_TOP_BOTTOM === $type) { - [$horizontal, $leftChar, $midChar, $rightChar] = [$borders[0], $crossings[9], $crossings[10], $crossings[11]]; - } else { - [$horizontal, $leftChar, $midChar, $rightChar] = [$borders[0], $crossings[7], $crossings[6], $crossings[5]]; - } - - $markup = $leftChar; - for ($column = 0; $column < $count; ++$column) { - $markup .= str_repeat($horizontal, $this->effectiveColumnWidths[$column]); - $markup .= $column === $count - 1 ? $rightChar : $midChar; - } - - if (null !== $title) { - $titleLength = Helper::strlenWithoutDecoration($formatter = $this->output->getFormatter(), $formattedTitle = sprintf($titleFormat, $title)); - $markupLength = Helper::strlen($markup); - if ($titleLength > $limit = $markupLength - 4) { - $titleLength = $limit; - $formatLength = Helper::strlenWithoutDecoration($formatter, sprintf($titleFormat, '')); - $formattedTitle = sprintf($titleFormat, Helper::substr($title, 0, $limit - $formatLength - 3).'...'); - } - - $titleStart = intdiv($markupLength - $titleLength, 2); - if (false === mb_detect_encoding($markup, null, true)) { - $markup = substr_replace($markup, $formattedTitle, $titleStart, $titleLength); - } else { - $markup = mb_substr($markup, 0, $titleStart).$formattedTitle.mb_substr($markup, $titleStart + $titleLength); - } - } - - $this->output->writeln(sprintf($this->style->getBorderFormat(), $markup)); - } - - /** - * Renders vertical column separator. - */ - private function renderColumnSeparator(int $type = self::BORDER_OUTSIDE): string - { - $borders = $this->style->getBorderChars(); - - return sprintf($this->style->getBorderFormat(), self::BORDER_OUTSIDE === $type ? $borders[1] : $borders[3]); - } - - /** - * Renders table row. - * - * Example: - * - * | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | - */ - private function renderRow(array $row, string $cellFormat, string $firstCellFormat = null) - { - $rowContent = $this->renderColumnSeparator(self::BORDER_OUTSIDE); - $columns = $this->getRowColumns($row); - $last = \count($columns) - 1; - foreach ($columns as $i => $column) { - if ($firstCellFormat && 0 === $i) { - $rowContent .= $this->renderCell($row, $column, $firstCellFormat); - } else { - $rowContent .= $this->renderCell($row, $column, $cellFormat); - } - $rowContent .= $this->renderColumnSeparator($last === $i ? self::BORDER_OUTSIDE : self::BORDER_INSIDE); - } - $this->output->writeln($rowContent); - } - - /** - * Renders table cell with padding. - */ - private function renderCell(array $row, int $column, string $cellFormat): string - { - $cell = $row[$column] ?? ''; - $width = $this->effectiveColumnWidths[$column]; - if ($cell instanceof TableCell && $cell->getColspan() > 1) { - // add the width of the following columns(numbers of colspan). - foreach (range($column + 1, $column + $cell->getColspan() - 1) as $nextColumn) { - $width += $this->getColumnSeparatorWidth() + $this->effectiveColumnWidths[$nextColumn]; - } - } - - // str_pad won't work properly with multi-byte strings, we need to fix the padding - if (false !== $encoding = mb_detect_encoding($cell, null, true)) { - $width += \strlen($cell) - mb_strwidth($cell, $encoding); - } - - $style = $this->getColumnStyle($column); - - if ($cell instanceof TableSeparator) { - return sprintf($style->getBorderFormat(), str_repeat($style->getBorderChars()[2], $width)); - } - - $width += Helper::strlen($cell) - Helper::strlenWithoutDecoration($this->output->getFormatter(), $cell); - $content = sprintf($style->getCellRowContentFormat(), $cell); - - return sprintf($cellFormat, str_pad($content, $width, $style->getPaddingChar(), $style->getPadType())); - } - - /** - * Calculate number of columns for this table. - */ - private function calculateNumberOfColumns(array $rows) - { - $columns = [0]; - foreach ($rows as $row) { - if ($row instanceof TableSeparator) { - continue; - } - - $columns[] = $this->getNumberOfColumns($row); - } - - $this->numberOfColumns = max($columns); - } - - private function buildTableRows(array $rows): TableRows - { - /** @var WrappableOutputFormatterInterface $formatter */ - $formatter = $this->output->getFormatter(); - $unmergedRows = []; - for ($rowKey = 0; $rowKey < \count($rows); ++$rowKey) { - $rows = $this->fillNextRows($rows, $rowKey); - - // Remove any new line breaks and replace it with a new line - foreach ($rows[$rowKey] as $column => $cell) { - $colspan = $cell instanceof TableCell ? $cell->getColspan() : 1; - - if (isset($this->columnMaxWidths[$column]) && Helper::strlenWithoutDecoration($formatter, $cell) > $this->columnMaxWidths[$column]) { - $cell = $formatter->formatAndWrap($cell, $this->columnMaxWidths[$column] * $colspan); - } - if (!strstr($cell ?? '', "\n")) { - continue; - } - $escaped = implode("\n", array_map([OutputFormatter::class, 'escapeTrailingBackslash'], explode("\n", $cell))); - $cell = $cell instanceof TableCell ? new TableCell($escaped, ['colspan' => $cell->getColspan()]) : $escaped; - $lines = explode("\n", str_replace("\n", "\n", $cell)); - foreach ($lines as $lineKey => $line) { - if ($colspan > 1) { - $line = new TableCell($line, ['colspan' => $colspan]); - } - if (0 === $lineKey) { - $rows[$rowKey][$column] = $line; - } else { - if (!\array_key_exists($rowKey, $unmergedRows) || !\array_key_exists($lineKey, $unmergedRows[$rowKey])) { - $unmergedRows[$rowKey][$lineKey] = $this->copyRow($rows, $rowKey); - } - $unmergedRows[$rowKey][$lineKey][$column] = $line; - } - } - } - } - - return new TableRows(function () use ($rows, $unmergedRows): \Traversable { - foreach ($rows as $rowKey => $row) { - yield $row instanceof TableSeparator ? $row : $this->fillCells($row); - - if (isset($unmergedRows[$rowKey])) { - foreach ($unmergedRows[$rowKey] as $row) { - yield $row instanceof TableSeparator ? $row : $this->fillCells($row); - } - } - } - }); - } - - private function calculateRowCount(): int - { - $numberOfRows = \count(iterator_to_array($this->buildTableRows(array_merge($this->headers, [new TableSeparator()], $this->rows)))); - - if ($this->headers) { - ++$numberOfRows; // Add row for header separator - } - - if (\count($this->rows) > 0) { - ++$numberOfRows; // Add row for footer separator - } - - return $numberOfRows; - } - - /** - * fill rows that contains rowspan > 1. - * - * @throws InvalidArgumentException - */ - private function fillNextRows(array $rows, int $line): array - { - $unmergedRows = []; - foreach ($rows[$line] as $column => $cell) { - if (null !== $cell && !$cell instanceof TableCell && !is_scalar($cell) && !(\is_object($cell) && method_exists($cell, '__toString'))) { - throw new InvalidArgumentException(sprintf('A cell must be a TableCell, a scalar or an object implementing "__toString()", "%s" given.', \gettype($cell))); - } - if ($cell instanceof TableCell && $cell->getRowspan() > 1) { - $nbLines = $cell->getRowspan() - 1; - $lines = [$cell]; - if (strstr($cell, "\n")) { - $lines = explode("\n", str_replace("\n", "\n", $cell)); - $nbLines = \count($lines) > $nbLines ? substr_count($cell, "\n") : $nbLines; - - $rows[$line][$column] = new TableCell($lines[0], ['colspan' => $cell->getColspan()]); - unset($lines[0]); - } - - // create a two dimensional array (rowspan x colspan) - $unmergedRows = array_replace_recursive(array_fill($line + 1, $nbLines, []), $unmergedRows); - foreach ($unmergedRows as $unmergedRowKey => $unmergedRow) { - $value = $lines[$unmergedRowKey - $line] ?? ''; - $unmergedRows[$unmergedRowKey][$column] = new TableCell($value, ['colspan' => $cell->getColspan()]); - if ($nbLines === $unmergedRowKey - $line) { - break; - } - } - } - } - - foreach ($unmergedRows as $unmergedRowKey => $unmergedRow) { - // we need to know if $unmergedRow will be merged or inserted into $rows - if (isset($rows[$unmergedRowKey]) && \is_array($rows[$unmergedRowKey]) && ($this->getNumberOfColumns($rows[$unmergedRowKey]) + $this->getNumberOfColumns($unmergedRows[$unmergedRowKey]) <= $this->numberOfColumns)) { - foreach ($unmergedRow as $cellKey => $cell) { - // insert cell into row at cellKey position - array_splice($rows[$unmergedRowKey], $cellKey, 0, [$cell]); - } - } else { - $row = $this->copyRow($rows, $unmergedRowKey - 1); - foreach ($unmergedRow as $column => $cell) { - if (!empty($cell)) { - $row[$column] = $unmergedRow[$column]; - } - } - array_splice($rows, $unmergedRowKey, 0, [$row]); - } - } - - return $rows; - } - - /** - * fill cells for a row that contains colspan > 1. - */ - private function fillCells(iterable $row) - { - $newRow = []; - - foreach ($row as $column => $cell) { - $newRow[] = $cell; - if ($cell instanceof TableCell && $cell->getColspan() > 1) { - foreach (range($column + 1, $column + $cell->getColspan() - 1) as $position) { - // insert empty value at column position - $newRow[] = ''; - } - } - } - - return $newRow ?: $row; - } - - private function copyRow(array $rows, int $line): array - { - $row = $rows[$line]; - foreach ($row as $cellKey => $cellValue) { - $row[$cellKey] = ''; - if ($cellValue instanceof TableCell) { - $row[$cellKey] = new TableCell('', ['colspan' => $cellValue->getColspan()]); - } - } - - return $row; - } - - /** - * Gets number of columns by row. - */ - private function getNumberOfColumns(array $row): int - { - $columns = \count($row); - foreach ($row as $column) { - $columns += $column instanceof TableCell ? ($column->getColspan() - 1) : 0; - } - - return $columns; - } - - /** - * Gets list of columns for the given row. - */ - private function getRowColumns(array $row): array - { - $columns = range(0, $this->numberOfColumns - 1); - foreach ($row as $cellKey => $cell) { - if ($cell instanceof TableCell && $cell->getColspan() > 1) { - // exclude grouped columns. - $columns = array_diff($columns, range($cellKey + 1, $cellKey + $cell->getColspan() - 1)); - } - } - - return $columns; - } - - /** - * Calculates columns widths. - */ - private function calculateColumnsWidth(iterable $rows) - { - for ($column = 0; $column < $this->numberOfColumns; ++$column) { - $lengths = []; - foreach ($rows as $row) { - if ($row instanceof TableSeparator) { - continue; - } - - foreach ($row as $i => $cell) { - if ($cell instanceof TableCell) { - $textContent = Helper::removeDecoration($this->output->getFormatter(), $cell); - $textLength = Helper::strlen($textContent); - if ($textLength > 0) { - $contentColumns = str_split($textContent, ceil($textLength / $cell->getColspan())); - foreach ($contentColumns as $position => $content) { - $row[$i + $position] = $content; - } - } - } - } - - $lengths[] = $this->getCellWidth($row, $column); - } - - $this->effectiveColumnWidths[$column] = max($lengths) + Helper::strlen($this->style->getCellRowContentFormat()) - 2; - } - } - - private function getColumnSeparatorWidth(): int - { - return Helper::strlen(sprintf($this->style->getBorderFormat(), $this->style->getBorderChars()[3])); - } - - private function getCellWidth(array $row, int $column): int - { - $cellWidth = 0; - - if (isset($row[$column])) { - $cell = $row[$column]; - $cellWidth = Helper::strlenWithoutDecoration($this->output->getFormatter(), $cell); - } - - $columnWidth = $this->columnWidths[$column] ?? 0; - $cellWidth = max($cellWidth, $columnWidth); - - return isset($this->columnMaxWidths[$column]) ? min($this->columnMaxWidths[$column], $cellWidth) : $cellWidth; - } - - /** - * Called after rendering to cleanup cache data. - */ - private function cleanup() - { - $this->effectiveColumnWidths = []; - $this->numberOfColumns = null; - } - - private static function initStyles(): array - { - $borderless = new TableStyle(); - $borderless - ->setHorizontalBorderChars('=') - ->setVerticalBorderChars(' ') - ->setDefaultCrossingChar(' ') - ; - - $compact = new TableStyle(); - $compact - ->setHorizontalBorderChars('') - ->setVerticalBorderChars(' ') - ->setDefaultCrossingChar('') - ->setCellRowContentFormat('%s') - ; - - $styleGuide = new TableStyle(); - $styleGuide - ->setHorizontalBorderChars('-') - ->setVerticalBorderChars(' ') - ->setDefaultCrossingChar(' ') - ->setCellHeaderFormat('%s') - ; - - $box = (new TableStyle()) - ->setHorizontalBorderChars('─') - ->setVerticalBorderChars('│') - ->setCrossingChars('┼', '┌', '┬', '┐', '┤', '┘', '┴', '└', '├') - ; - - $boxDouble = (new TableStyle()) - ->setHorizontalBorderChars('═', '─') - ->setVerticalBorderChars('║', '│') - ->setCrossingChars('┼', '╔', '╤', '╗', '╢', '╝', '╧', '╚', '╟', '╠', '╪', '╣') - ; - - return [ - 'default' => new TableStyle(), - 'borderless' => $borderless, - 'compact' => $compact, - 'symfony-style-guide' => $styleGuide, - 'box' => $box, - 'box-double' => $boxDouble, - ]; - } - - private function resolveStyle($name): TableStyle - { - if ($name instanceof TableStyle) { - return $name; - } - - if (isset(self::$styles[$name])) { - return self::$styles[$name]; - } - - throw new InvalidArgumentException(sprintf('Style "%s" is not defined.', $name)); - } -} diff --git a/vendor/symfony/console/Helper/TableCell.php b/vendor/symfony/console/Helper/TableCell.php deleted file mode 100644 index 5b6af4a..0000000 --- a/vendor/symfony/console/Helper/TableCell.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Exception\InvalidArgumentException; - -/** - * @author Abdellatif Ait boudad - */ -class TableCell -{ - private $value; - private $options = [ - 'rowspan' => 1, - 'colspan' => 1, - ]; - - public function __construct(string $value = '', array $options = []) - { - $this->value = $value; - - // check option names - if ($diff = array_diff(array_keys($options), array_keys($this->options))) { - throw new InvalidArgumentException(sprintf('The TableCell does not support the following options: \'%s\'.', implode('\', \'', $diff))); - } - - $this->options = array_merge($this->options, $options); - } - - /** - * Returns the cell value. - * - * @return string - */ - public function __toString() - { - return $this->value; - } - - /** - * Gets number of colspan. - * - * @return int - */ - public function getColspan() - { - return (int) $this->options['colspan']; - } - - /** - * Gets number of rowspan. - * - * @return int - */ - public function getRowspan() - { - return (int) $this->options['rowspan']; - } -} diff --git a/vendor/symfony/console/Helper/TableRows.php b/vendor/symfony/console/Helper/TableRows.php deleted file mode 100644 index 16aabb3..0000000 --- a/vendor/symfony/console/Helper/TableRows.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -/** - * @internal - */ -class TableRows implements \IteratorAggregate -{ - private $generator; - - public function __construct(callable $generator) - { - $this->generator = $generator; - } - - public function getIterator(): \Traversable - { - $g = $this->generator; - - return $g(); - } -} diff --git a/vendor/symfony/console/Helper/TableSeparator.php b/vendor/symfony/console/Helper/TableSeparator.php deleted file mode 100644 index e541c53..0000000 --- a/vendor/symfony/console/Helper/TableSeparator.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -/** - * Marks a row as being a separator. - * - * @author Fabien Potencier - */ -class TableSeparator extends TableCell -{ - public function __construct(array $options = []) - { - parent::__construct('', $options); - } -} diff --git a/vendor/symfony/console/Helper/TableStyle.php b/vendor/symfony/console/Helper/TableStyle.php deleted file mode 100644 index a8df59b..0000000 --- a/vendor/symfony/console/Helper/TableStyle.php +++ /dev/null @@ -1,458 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\LogicException; - -/** - * Defines the styles for a Table. - * - * @author Fabien Potencier - * @author Саша Стаменковић - * @author Dany Maillard - */ -class TableStyle -{ - private $paddingChar = ' '; - private $horizontalOutsideBorderChar = '-'; - private $horizontalInsideBorderChar = '-'; - private $verticalOutsideBorderChar = '|'; - private $verticalInsideBorderChar = '|'; - private $crossingChar = '+'; - private $crossingTopRightChar = '+'; - private $crossingTopMidChar = '+'; - private $crossingTopLeftChar = '+'; - private $crossingMidRightChar = '+'; - private $crossingBottomRightChar = '+'; - private $crossingBottomMidChar = '+'; - private $crossingBottomLeftChar = '+'; - private $crossingMidLeftChar = '+'; - private $crossingTopLeftBottomChar = '+'; - private $crossingTopMidBottomChar = '+'; - private $crossingTopRightBottomChar = '+'; - private $headerTitleFormat = ' %s '; - private $footerTitleFormat = ' %s '; - private $cellHeaderFormat = '%s'; - private $cellRowFormat = '%s'; - private $cellRowContentFormat = ' %s '; - private $borderFormat = '%s'; - private $padType = \STR_PAD_RIGHT; - - /** - * Sets padding character, used for cell padding. - * - * @param string $paddingChar - * - * @return $this - */ - public function setPaddingChar($paddingChar) - { - if (!$paddingChar) { - throw new LogicException('The padding char must not be empty.'); - } - - $this->paddingChar = $paddingChar; - - return $this; - } - - /** - * Gets padding character, used for cell padding. - * - * @return string - */ - public function getPaddingChar() - { - return $this->paddingChar; - } - - /** - * Sets horizontal border characters. - * - * - * ╔═══════════════╤══════════════════════════╤══════════════════╗ - * 1 ISBN 2 Title │ Author ║ - * ╠═══════════════╪══════════════════════════╪══════════════════╣ - * ║ 99921-58-10-7 │ Divine Comedy │ Dante Alighieri ║ - * ║ 9971-5-0210-0 │ A Tale of Two Cities │ Charles Dickens ║ - * ║ 960-425-059-0 │ The Lord of the Rings │ J. R. R. Tolkien ║ - * ║ 80-902734-1-6 │ And Then There Were None │ Agatha Christie ║ - * ╚═══════════════╧══════════════════════════╧══════════════════╝ - * - * - * @param string $outside Outside border char (see #1 of example) - * @param string|null $inside Inside border char (see #2 of example), equals $outside if null - */ - public function setHorizontalBorderChars(string $outside, string $inside = null): self - { - $this->horizontalOutsideBorderChar = $outside; - $this->horizontalInsideBorderChar = $inside ?? $outside; - - return $this; - } - - /** - * Sets horizontal border character. - * - * @param string $horizontalBorderChar - * - * @return $this - * - * @deprecated since Symfony 4.1, use {@link setHorizontalBorderChars()} instead. - */ - public function setHorizontalBorderChar($horizontalBorderChar) - { - @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use setHorizontalBorderChars() instead.', __METHOD__), \E_USER_DEPRECATED); - - return $this->setHorizontalBorderChars($horizontalBorderChar, $horizontalBorderChar); - } - - /** - * Gets horizontal border character. - * - * @return string - * - * @deprecated since Symfony 4.1, use {@link getBorderChars()} instead. - */ - public function getHorizontalBorderChar() - { - @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use getBorderChars() instead.', __METHOD__), \E_USER_DEPRECATED); - - return $this->horizontalOutsideBorderChar; - } - - /** - * Sets vertical border characters. - * - * - * ╔═══════════════╤══════════════════════════╤══════════════════╗ - * ║ ISBN │ Title │ Author ║ - * ╠═══════1═══════╪══════════════════════════╪══════════════════╣ - * ║ 99921-58-10-7 │ Divine Comedy │ Dante Alighieri ║ - * ║ 9971-5-0210-0 │ A Tale of Two Cities │ Charles Dickens ║ - * ╟───────2───────┼──────────────────────────┼──────────────────╢ - * ║ 960-425-059-0 │ The Lord of the Rings │ J. R. R. Tolkien ║ - * ║ 80-902734-1-6 │ And Then There Were None │ Agatha Christie ║ - * ╚═══════════════╧══════════════════════════╧══════════════════╝ - * - * - * @param string $outside Outside border char (see #1 of example) - * @param string|null $inside Inside border char (see #2 of example), equals $outside if null - */ - public function setVerticalBorderChars(string $outside, string $inside = null): self - { - $this->verticalOutsideBorderChar = $outside; - $this->verticalInsideBorderChar = $inside ?? $outside; - - return $this; - } - - /** - * Sets vertical border character. - * - * @param string $verticalBorderChar - * - * @return $this - * - * @deprecated since Symfony 4.1, use {@link setVerticalBorderChars()} instead. - */ - public function setVerticalBorderChar($verticalBorderChar) - { - @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use setVerticalBorderChars() instead.', __METHOD__), \E_USER_DEPRECATED); - - return $this->setVerticalBorderChars($verticalBorderChar, $verticalBorderChar); - } - - /** - * Gets vertical border character. - * - * @return string - * - * @deprecated since Symfony 4.1, use {@link getBorderChars()} instead. - */ - public function getVerticalBorderChar() - { - @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use getBorderChars() instead.', __METHOD__), \E_USER_DEPRECATED); - - return $this->verticalOutsideBorderChar; - } - - /** - * Gets border characters. - * - * @internal - */ - public function getBorderChars(): array - { - return [ - $this->horizontalOutsideBorderChar, - $this->verticalOutsideBorderChar, - $this->horizontalInsideBorderChar, - $this->verticalInsideBorderChar, - ]; - } - - /** - * Sets crossing characters. - * - * Example: - * - * 1═══════════════2══════════════════════════2══════════════════3 - * ║ ISBN │ Title │ Author ║ - * 8'══════════════0'═════════════════════════0'═════════════════4' - * ║ 99921-58-10-7 │ Divine Comedy │ Dante Alighieri ║ - * ║ 9971-5-0210-0 │ A Tale of Two Cities │ Charles Dickens ║ - * 8───────────────0──────────────────────────0──────────────────4 - * ║ 960-425-059-0 │ The Lord of the Rings │ J. R. R. Tolkien ║ - * ║ 80-902734-1-6 │ And Then There Were None │ Agatha Christie ║ - * 7═══════════════6══════════════════════════6══════════════════5 - * - * - * @param string $cross Crossing char (see #0 of example) - * @param string $topLeft Top left char (see #1 of example) - * @param string $topMid Top mid char (see #2 of example) - * @param string $topRight Top right char (see #3 of example) - * @param string $midRight Mid right char (see #4 of example) - * @param string $bottomRight Bottom right char (see #5 of example) - * @param string $bottomMid Bottom mid char (see #6 of example) - * @param string $bottomLeft Bottom left char (see #7 of example) - * @param string $midLeft Mid left char (see #8 of example) - * @param string|null $topLeftBottom Top left bottom char (see #8' of example), equals to $midLeft if null - * @param string|null $topMidBottom Top mid bottom char (see #0' of example), equals to $cross if null - * @param string|null $topRightBottom Top right bottom char (see #4' of example), equals to $midRight if null - */ - public function setCrossingChars(string $cross, string $topLeft, string $topMid, string $topRight, string $midRight, string $bottomRight, string $bottomMid, string $bottomLeft, string $midLeft, string $topLeftBottom = null, string $topMidBottom = null, string $topRightBottom = null): self - { - $this->crossingChar = $cross; - $this->crossingTopLeftChar = $topLeft; - $this->crossingTopMidChar = $topMid; - $this->crossingTopRightChar = $topRight; - $this->crossingMidRightChar = $midRight; - $this->crossingBottomRightChar = $bottomRight; - $this->crossingBottomMidChar = $bottomMid; - $this->crossingBottomLeftChar = $bottomLeft; - $this->crossingMidLeftChar = $midLeft; - $this->crossingTopLeftBottomChar = $topLeftBottom ?? $midLeft; - $this->crossingTopMidBottomChar = $topMidBottom ?? $cross; - $this->crossingTopRightBottomChar = $topRightBottom ?? $midRight; - - return $this; - } - - /** - * Sets default crossing character used for each cross. - * - * @see {@link setCrossingChars()} for setting each crossing individually. - */ - public function setDefaultCrossingChar(string $char): self - { - return $this->setCrossingChars($char, $char, $char, $char, $char, $char, $char, $char, $char); - } - - /** - * Sets crossing character. - * - * @param string $crossingChar - * - * @return $this - * - * @deprecated since Symfony 4.1. Use {@link setDefaultCrossingChar()} instead. - */ - public function setCrossingChar($crossingChar) - { - @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1. Use setDefaultCrossingChar() instead.', __METHOD__), \E_USER_DEPRECATED); - - return $this->setDefaultCrossingChar($crossingChar); - } - - /** - * Gets crossing character. - * - * @return string - */ - public function getCrossingChar() - { - return $this->crossingChar; - } - - /** - * Gets crossing characters. - * - * @internal - */ - public function getCrossingChars(): array - { - return [ - $this->crossingChar, - $this->crossingTopLeftChar, - $this->crossingTopMidChar, - $this->crossingTopRightChar, - $this->crossingMidRightChar, - $this->crossingBottomRightChar, - $this->crossingBottomMidChar, - $this->crossingBottomLeftChar, - $this->crossingMidLeftChar, - $this->crossingTopLeftBottomChar, - $this->crossingTopMidBottomChar, - $this->crossingTopRightBottomChar, - ]; - } - - /** - * Sets header cell format. - * - * @param string $cellHeaderFormat - * - * @return $this - */ - public function setCellHeaderFormat($cellHeaderFormat) - { - $this->cellHeaderFormat = $cellHeaderFormat; - - return $this; - } - - /** - * Gets header cell format. - * - * @return string - */ - public function getCellHeaderFormat() - { - return $this->cellHeaderFormat; - } - - /** - * Sets row cell format. - * - * @param string $cellRowFormat - * - * @return $this - */ - public function setCellRowFormat($cellRowFormat) - { - $this->cellRowFormat = $cellRowFormat; - - return $this; - } - - /** - * Gets row cell format. - * - * @return string - */ - public function getCellRowFormat() - { - return $this->cellRowFormat; - } - - /** - * Sets row cell content format. - * - * @param string $cellRowContentFormat - * - * @return $this - */ - public function setCellRowContentFormat($cellRowContentFormat) - { - $this->cellRowContentFormat = $cellRowContentFormat; - - return $this; - } - - /** - * Gets row cell content format. - * - * @return string - */ - public function getCellRowContentFormat() - { - return $this->cellRowContentFormat; - } - - /** - * Sets table border format. - * - * @param string $borderFormat - * - * @return $this - */ - public function setBorderFormat($borderFormat) - { - $this->borderFormat = $borderFormat; - - return $this; - } - - /** - * Gets table border format. - * - * @return string - */ - public function getBorderFormat() - { - return $this->borderFormat; - } - - /** - * Sets cell padding type. - * - * @param int $padType STR_PAD_* - * - * @return $this - */ - public function setPadType($padType) - { - if (!\in_array($padType, [\STR_PAD_LEFT, \STR_PAD_RIGHT, \STR_PAD_BOTH], true)) { - throw new InvalidArgumentException('Invalid padding type. Expected one of (STR_PAD_LEFT, STR_PAD_RIGHT, STR_PAD_BOTH).'); - } - - $this->padType = $padType; - - return $this; - } - - /** - * Gets cell padding type. - * - * @return int - */ - public function getPadType() - { - return $this->padType; - } - - public function getHeaderTitleFormat(): string - { - return $this->headerTitleFormat; - } - - public function setHeaderTitleFormat(string $format): self - { - $this->headerTitleFormat = $format; - - return $this; - } - - public function getFooterTitleFormat(): string - { - return $this->footerTitleFormat; - } - - public function setFooterTitleFormat(string $format): self - { - $this->footerTitleFormat = $format; - - return $this; - } -} diff --git a/vendor/symfony/console/Input/ArgvInput.php b/vendor/symfony/console/Input/ArgvInput.php deleted file mode 100644 index 63f40f2..0000000 --- a/vendor/symfony/console/Input/ArgvInput.php +++ /dev/null @@ -1,350 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -use Symfony\Component\Console\Exception\RuntimeException; - -/** - * ArgvInput represents an input coming from the CLI arguments. - * - * Usage: - * - * $input = new ArgvInput(); - * - * By default, the `$_SERVER['argv']` array is used for the input values. - * - * This can be overridden by explicitly passing the input values in the constructor: - * - * $input = new ArgvInput($_SERVER['argv']); - * - * If you pass it yourself, don't forget that the first element of the array - * is the name of the running application. - * - * When passing an argument to the constructor, be sure that it respects - * the same rules as the argv one. It's almost always better to use the - * `StringInput` when you want to provide your own input. - * - * @author Fabien Potencier - * - * @see http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html - * @see http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html#tag_12_02 - */ -class ArgvInput extends Input -{ - private $tokens; - private $parsed; - - /** - * @param array|null $argv An array of parameters from the CLI (in the argv format) - */ - public function __construct(array $argv = null, InputDefinition $definition = null) - { - $argv = $argv ?? $_SERVER['argv'] ?? []; - - // strip the application name - array_shift($argv); - - $this->tokens = $argv; - - parent::__construct($definition); - } - - protected function setTokens(array $tokens) - { - $this->tokens = $tokens; - } - - /** - * {@inheritdoc} - */ - protected function parse() - { - $parseOptions = true; - $this->parsed = $this->tokens; - while (null !== $token = array_shift($this->parsed)) { - if ($parseOptions && '' == $token) { - $this->parseArgument($token); - } elseif ($parseOptions && '--' == $token) { - $parseOptions = false; - } elseif ($parseOptions && str_starts_with($token, '--')) { - $this->parseLongOption($token); - } elseif ($parseOptions && '-' === $token[0] && '-' !== $token) { - $this->parseShortOption($token); - } else { - $this->parseArgument($token); - } - } - } - - /** - * Parses a short option. - */ - private function parseShortOption(string $token) - { - $name = substr($token, 1); - - if (\strlen($name) > 1) { - if ($this->definition->hasShortcut($name[0]) && $this->definition->getOptionForShortcut($name[0])->acceptValue()) { - // an option with a value (with no space) - $this->addShortOption($name[0], substr($name, 1)); - } else { - $this->parseShortOptionSet($name); - } - } else { - $this->addShortOption($name, null); - } - } - - /** - * Parses a short option set. - * - * @throws RuntimeException When option given doesn't exist - */ - private function parseShortOptionSet(string $name) - { - $len = \strlen($name); - for ($i = 0; $i < $len; ++$i) { - if (!$this->definition->hasShortcut($name[$i])) { - $encoding = mb_detect_encoding($name, null, true); - throw new RuntimeException(sprintf('The "-%s" option does not exist.', false === $encoding ? $name[$i] : mb_substr($name, $i, 1, $encoding))); - } - - $option = $this->definition->getOptionForShortcut($name[$i]); - if ($option->acceptValue()) { - $this->addLongOption($option->getName(), $i === $len - 1 ? null : substr($name, $i + 1)); - - break; - } else { - $this->addLongOption($option->getName(), null); - } - } - } - - /** - * Parses a long option. - */ - private function parseLongOption(string $token) - { - $name = substr($token, 2); - - if (false !== $pos = strpos($name, '=')) { - if ('' === $value = substr($name, $pos + 1)) { - array_unshift($this->parsed, $value); - } - $this->addLongOption(substr($name, 0, $pos), $value); - } else { - $this->addLongOption($name, null); - } - } - - /** - * Parses an argument. - * - * @throws RuntimeException When too many arguments are given - */ - private function parseArgument(string $token) - { - $c = \count($this->arguments); - - // if input is expecting another argument, add it - if ($this->definition->hasArgument($c)) { - $arg = $this->definition->getArgument($c); - $this->arguments[$arg->getName()] = $arg->isArray() ? [$token] : $token; - - // if last argument isArray(), append token to last argument - } elseif ($this->definition->hasArgument($c - 1) && $this->definition->getArgument($c - 1)->isArray()) { - $arg = $this->definition->getArgument($c - 1); - $this->arguments[$arg->getName()][] = $token; - - // unexpected argument - } else { - $all = $this->definition->getArguments(); - if (\count($all)) { - throw new RuntimeException(sprintf('Too many arguments, expected arguments "%s".', implode('" "', array_keys($all)))); - } - - throw new RuntimeException(sprintf('No arguments expected, got "%s".', $token)); - } - } - - /** - * Adds a short option value. - * - * @throws RuntimeException When option given doesn't exist - */ - private function addShortOption(string $shortcut, $value) - { - if (!$this->definition->hasShortcut($shortcut)) { - throw new RuntimeException(sprintf('The "-%s" option does not exist.', $shortcut)); - } - - $this->addLongOption($this->definition->getOptionForShortcut($shortcut)->getName(), $value); - } - - /** - * Adds a long option value. - * - * @throws RuntimeException When option given doesn't exist - */ - private function addLongOption(string $name, $value) - { - if (!$this->definition->hasOption($name)) { - throw new RuntimeException(sprintf('The "--%s" option does not exist.', $name)); - } - - $option = $this->definition->getOption($name); - - if (null !== $value && !$option->acceptValue()) { - throw new RuntimeException(sprintf('The "--%s" option does not accept a value.', $name)); - } - - if (\in_array($value, ['', null], true) && $option->acceptValue() && \count($this->parsed)) { - // if option accepts an optional or mandatory argument - // let's see if there is one provided - $next = array_shift($this->parsed); - if ((isset($next[0]) && '-' !== $next[0]) || \in_array($next, ['', null], true)) { - $value = $next; - } else { - array_unshift($this->parsed, $next); - } - } - - if (null === $value) { - if ($option->isValueRequired()) { - throw new RuntimeException(sprintf('The "--%s" option requires a value.', $name)); - } - - if (!$option->isArray() && !$option->isValueOptional()) { - $value = true; - } - } - - if ($option->isArray()) { - $this->options[$name][] = $value; - } else { - $this->options[$name] = $value; - } - } - - /** - * {@inheritdoc} - */ - public function getFirstArgument() - { - $isOption = false; - foreach ($this->tokens as $i => $token) { - if ($token && '-' === $token[0]) { - if (str_contains($token, '=') || !isset($this->tokens[$i + 1])) { - continue; - } - - // If it's a long option, consider that everything after "--" is the option name. - // Otherwise, use the last char (if it's a short option set, only the last one can take a value with space separator) - $name = '-' === $token[1] ? substr($token, 2) : substr($token, -1); - if (!isset($this->options[$name]) && !$this->definition->hasShortcut($name)) { - // noop - } elseif ((isset($this->options[$name]) || isset($this->options[$name = $this->definition->shortcutToName($name)])) && $this->tokens[$i + 1] === $this->options[$name]) { - $isOption = true; - } - - continue; - } - - if ($isOption) { - $isOption = false; - continue; - } - - return $token; - } - - return null; - } - - /** - * {@inheritdoc} - */ - public function hasParameterOption($values, $onlyParams = false) - { - $values = (array) $values; - - foreach ($this->tokens as $token) { - if ($onlyParams && '--' === $token) { - return false; - } - foreach ($values as $value) { - // Options with values: - // For long options, test for '--option=' at beginning - // For short options, test for '-o' at beginning - $leading = str_starts_with($value, '--') ? $value.'=' : $value; - if ($token === $value || '' !== $leading && str_starts_with($token, $leading)) { - return true; - } - } - } - - return false; - } - - /** - * {@inheritdoc} - */ - public function getParameterOption($values, $default = false, $onlyParams = false) - { - $values = (array) $values; - $tokens = $this->tokens; - - while (0 < \count($tokens)) { - $token = array_shift($tokens); - if ($onlyParams && '--' === $token) { - return $default; - } - - foreach ($values as $value) { - if ($token === $value) { - return array_shift($tokens); - } - // Options with values: - // For long options, test for '--option=' at beginning - // For short options, test for '-o' at beginning - $leading = str_starts_with($value, '--') ? $value.'=' : $value; - if ('' !== $leading && str_starts_with($token, $leading)) { - return substr($token, \strlen($leading)); - } - } - } - - return $default; - } - - /** - * Returns a stringified representation of the args passed to the command. - * - * @return string - */ - public function __toString() - { - $tokens = array_map(function ($token) { - if (preg_match('{^(-[^=]+=)(.+)}', $token, $match)) { - return $match[1].$this->escapeToken($match[2]); - } - - if ($token && '-' !== $token[0]) { - return $this->escapeToken($token); - } - - return $token; - }, $this->tokens); - - return implode(' ', $tokens); - } -} diff --git a/vendor/symfony/console/Input/ArrayInput.php b/vendor/symfony/console/Input/ArrayInput.php deleted file mode 100644 index 30bd205..0000000 --- a/vendor/symfony/console/Input/ArrayInput.php +++ /dev/null @@ -1,203 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\InvalidOptionException; - -/** - * ArrayInput represents an input provided as an array. - * - * Usage: - * - * $input = new ArrayInput(['command' => 'foo:bar', 'foo' => 'bar', '--bar' => 'foobar']); - * - * @author Fabien Potencier - */ -class ArrayInput extends Input -{ - private $parameters; - - public function __construct(array $parameters, InputDefinition $definition = null) - { - $this->parameters = $parameters; - - parent::__construct($definition); - } - - /** - * {@inheritdoc} - */ - public function getFirstArgument() - { - foreach ($this->parameters as $param => $value) { - if ($param && \is_string($param) && '-' === $param[0]) { - continue; - } - - return $value; - } - - return null; - } - - /** - * {@inheritdoc} - */ - public function hasParameterOption($values, $onlyParams = false) - { - $values = (array) $values; - - foreach ($this->parameters as $k => $v) { - if (!\is_int($k)) { - $v = $k; - } - - if ($onlyParams && '--' === $v) { - return false; - } - - if (\in_array($v, $values)) { - return true; - } - } - - return false; - } - - /** - * {@inheritdoc} - */ - public function getParameterOption($values, $default = false, $onlyParams = false) - { - $values = (array) $values; - - foreach ($this->parameters as $k => $v) { - if ($onlyParams && ('--' === $k || (\is_int($k) && '--' === $v))) { - return $default; - } - - if (\is_int($k)) { - if (\in_array($v, $values)) { - return true; - } - } elseif (\in_array($k, $values)) { - return $v; - } - } - - return $default; - } - - /** - * Returns a stringified representation of the args passed to the command. - * - * @return string - */ - public function __toString() - { - $params = []; - foreach ($this->parameters as $param => $val) { - if ($param && \is_string($param) && '-' === $param[0]) { - $glue = ('-' === $param[1]) ? '=' : ' '; - if (\is_array($val)) { - foreach ($val as $v) { - $params[] = $param.('' != $v ? $glue.$this->escapeToken($v) : ''); - } - } else { - $params[] = $param.('' != $val ? $glue.$this->escapeToken($val) : ''); - } - } else { - $params[] = \is_array($val) ? implode(' ', array_map([$this, 'escapeToken'], $val)) : $this->escapeToken($val); - } - } - - return implode(' ', $params); - } - - /** - * {@inheritdoc} - */ - protected function parse() - { - foreach ($this->parameters as $key => $value) { - if ('--' === $key) { - return; - } - if (str_starts_with($key, '--')) { - $this->addLongOption(substr($key, 2), $value); - } elseif (str_starts_with($key, '-')) { - $this->addShortOption(substr($key, 1), $value); - } else { - $this->addArgument($key, $value); - } - } - } - - /** - * Adds a short option value. - * - * @throws InvalidOptionException When option given doesn't exist - */ - private function addShortOption(string $shortcut, $value) - { - if (!$this->definition->hasShortcut($shortcut)) { - throw new InvalidOptionException(sprintf('The "-%s" option does not exist.', $shortcut)); - } - - $this->addLongOption($this->definition->getOptionForShortcut($shortcut)->getName(), $value); - } - - /** - * Adds a long option value. - * - * @throws InvalidOptionException When option given doesn't exist - * @throws InvalidOptionException When a required value is missing - */ - private function addLongOption(string $name, $value) - { - if (!$this->definition->hasOption($name)) { - throw new InvalidOptionException(sprintf('The "--%s" option does not exist.', $name)); - } - - $option = $this->definition->getOption($name); - - if (null === $value) { - if ($option->isValueRequired()) { - throw new InvalidOptionException(sprintf('The "--%s" option requires a value.', $name)); - } - - if (!$option->isValueOptional()) { - $value = true; - } - } - - $this->options[$name] = $value; - } - - /** - * Adds an argument value. - * - * @param string|int $name The argument name - * @param mixed $value The value for the argument - * - * @throws InvalidArgumentException When argument given doesn't exist - */ - private function addArgument($name, $value) - { - if (!$this->definition->hasArgument($name)) { - throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); - } - - $this->arguments[$name] = $value; - } -} diff --git a/vendor/symfony/console/Input/Input.php b/vendor/symfony/console/Input/Input.php deleted file mode 100644 index d7f2907..0000000 --- a/vendor/symfony/console/Input/Input.php +++ /dev/null @@ -1,203 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\RuntimeException; - -/** - * Input is the base class for all concrete Input classes. - * - * Three concrete classes are provided by default: - * - * * `ArgvInput`: The input comes from the CLI arguments (argv) - * * `StringInput`: The input is provided as a string - * * `ArrayInput`: The input is provided as an array - * - * @author Fabien Potencier - */ -abstract class Input implements InputInterface, StreamableInputInterface -{ - protected $definition; - protected $stream; - protected $options = []; - protected $arguments = []; - protected $interactive = true; - - public function __construct(InputDefinition $definition = null) - { - if (null === $definition) { - $this->definition = new InputDefinition(); - } else { - $this->bind($definition); - $this->validate(); - } - } - - /** - * {@inheritdoc} - */ - public function bind(InputDefinition $definition) - { - $this->arguments = []; - $this->options = []; - $this->definition = $definition; - - $this->parse(); - } - - /** - * Processes command line arguments. - */ - abstract protected function parse(); - - /** - * {@inheritdoc} - */ - public function validate() - { - $definition = $this->definition; - $givenArguments = $this->arguments; - - $missingArguments = array_filter(array_keys($definition->getArguments()), function ($argument) use ($definition, $givenArguments) { - return !\array_key_exists($argument, $givenArguments) && $definition->getArgument($argument)->isRequired(); - }); - - if (\count($missingArguments) > 0) { - throw new RuntimeException(sprintf('Not enough arguments (missing: "%s").', implode(', ', $missingArguments))); - } - } - - /** - * {@inheritdoc} - */ - public function isInteractive() - { - return $this->interactive; - } - - /** - * {@inheritdoc} - */ - public function setInteractive($interactive) - { - $this->interactive = (bool) $interactive; - } - - /** - * {@inheritdoc} - */ - public function getArguments() - { - return array_merge($this->definition->getArgumentDefaults(), $this->arguments); - } - - /** - * {@inheritdoc} - */ - public function getArgument($name) - { - if (!$this->definition->hasArgument((string) $name)) { - throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); - } - - return $this->arguments[$name] ?? $this->definition->getArgument($name)->getDefault(); - } - - /** - * {@inheritdoc} - */ - public function setArgument($name, $value) - { - if (!$this->definition->hasArgument((string) $name)) { - throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); - } - - $this->arguments[$name] = $value; - } - - /** - * {@inheritdoc} - */ - public function hasArgument($name) - { - return $this->definition->hasArgument((string) $name); - } - - /** - * {@inheritdoc} - */ - public function getOptions() - { - return array_merge($this->definition->getOptionDefaults(), $this->options); - } - - /** - * {@inheritdoc} - */ - public function getOption($name) - { - if (!$this->definition->hasOption($name)) { - throw new InvalidArgumentException(sprintf('The "%s" option does not exist.', $name)); - } - - return \array_key_exists($name, $this->options) ? $this->options[$name] : $this->definition->getOption($name)->getDefault(); - } - - /** - * {@inheritdoc} - */ - public function setOption($name, $value) - { - if (!$this->definition->hasOption($name)) { - throw new InvalidArgumentException(sprintf('The "%s" option does not exist.', $name)); - } - - $this->options[$name] = $value; - } - - /** - * {@inheritdoc} - */ - public function hasOption($name) - { - return $this->definition->hasOption($name); - } - - /** - * Escapes a token through escapeshellarg if it contains unsafe chars. - * - * @param string $token - * - * @return string - */ - public function escapeToken($token) - { - return preg_match('{^[\w-]+$}', $token) ? $token : escapeshellarg($token); - } - - /** - * {@inheritdoc} - */ - public function setStream($stream) - { - $this->stream = $stream; - } - - /** - * {@inheritdoc} - */ - public function getStream() - { - return $this->stream; - } -} diff --git a/vendor/symfony/console/Input/InputArgument.php b/vendor/symfony/console/Input/InputArgument.php deleted file mode 100644 index 085aca5..0000000 --- a/vendor/symfony/console/Input/InputArgument.php +++ /dev/null @@ -1,129 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\LogicException; - -/** - * Represents a command line argument. - * - * @author Fabien Potencier - */ -class InputArgument -{ - public const REQUIRED = 1; - public const OPTIONAL = 2; - public const IS_ARRAY = 4; - - private $name; - private $mode; - private $default; - private $description; - - /** - * @param string $name The argument name - * @param int|null $mode The argument mode: self::REQUIRED or self::OPTIONAL - * @param string $description A description text - * @param string|bool|int|float|array|null $default The default value (for self::OPTIONAL mode only) - * - * @throws InvalidArgumentException When argument mode is not valid - */ - public function __construct(string $name, int $mode = null, string $description = '', $default = null) - { - if (null === $mode) { - $mode = self::OPTIONAL; - } elseif ($mode > 7 || $mode < 1) { - throw new InvalidArgumentException(sprintf('Argument mode "%s" is not valid.', $mode)); - } - - $this->name = $name; - $this->mode = $mode; - $this->description = $description; - - $this->setDefault($default); - } - - /** - * Returns the argument name. - * - * @return string The argument name - */ - public function getName() - { - return $this->name; - } - - /** - * Returns true if the argument is required. - * - * @return bool true if parameter mode is self::REQUIRED, false otherwise - */ - public function isRequired() - { - return self::REQUIRED === (self::REQUIRED & $this->mode); - } - - /** - * Returns true if the argument can take multiple values. - * - * @return bool true if mode is self::IS_ARRAY, false otherwise - */ - public function isArray() - { - return self::IS_ARRAY === (self::IS_ARRAY & $this->mode); - } - - /** - * Sets the default value. - * - * @param string|bool|int|float|array|null $default - * - * @throws LogicException When incorrect default value is given - */ - public function setDefault($default = null) - { - if (self::REQUIRED === $this->mode && null !== $default) { - throw new LogicException('Cannot set a default value except for InputArgument::OPTIONAL mode.'); - } - - if ($this->isArray()) { - if (null === $default) { - $default = []; - } elseif (!\is_array($default)) { - throw new LogicException('A default value for an array argument must be an array.'); - } - } - - $this->default = $default; - } - - /** - * Returns the default value. - * - * @return string|bool|int|float|array|null - */ - public function getDefault() - { - return $this->default; - } - - /** - * Returns the description text. - * - * @return string The description text - */ - public function getDescription() - { - return $this->description; - } -} diff --git a/vendor/symfony/console/Input/InputAwareInterface.php b/vendor/symfony/console/Input/InputAwareInterface.php deleted file mode 100644 index 5a288de..0000000 --- a/vendor/symfony/console/Input/InputAwareInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -/** - * InputAwareInterface should be implemented by classes that depends on the - * Console Input. - * - * @author Wouter J - */ -interface InputAwareInterface -{ - /** - * Sets the Console Input. - */ - public function setInput(InputInterface $input); -} diff --git a/vendor/symfony/console/Input/InputDefinition.php b/vendor/symfony/console/Input/InputDefinition.php deleted file mode 100644 index e2cd6d7..0000000 --- a/vendor/symfony/console/Input/InputDefinition.php +++ /dev/null @@ -1,396 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\LogicException; - -/** - * A InputDefinition represents a set of valid command line arguments and options. - * - * Usage: - * - * $definition = new InputDefinition([ - * new InputArgument('name', InputArgument::REQUIRED), - * new InputOption('foo', 'f', InputOption::VALUE_REQUIRED), - * ]); - * - * @author Fabien Potencier - */ -class InputDefinition -{ - private $arguments; - private $requiredCount; - private $hasAnArrayArgument = false; - private $hasOptional; - private $options; - private $shortcuts; - - /** - * @param array $definition An array of InputArgument and InputOption instance - */ - public function __construct(array $definition = []) - { - $this->setDefinition($definition); - } - - /** - * Sets the definition of the input. - */ - public function setDefinition(array $definition) - { - $arguments = []; - $options = []; - foreach ($definition as $item) { - if ($item instanceof InputOption) { - $options[] = $item; - } else { - $arguments[] = $item; - } - } - - $this->setArguments($arguments); - $this->setOptions($options); - } - - /** - * Sets the InputArgument objects. - * - * @param InputArgument[] $arguments An array of InputArgument objects - */ - public function setArguments($arguments = []) - { - $this->arguments = []; - $this->requiredCount = 0; - $this->hasOptional = false; - $this->hasAnArrayArgument = false; - $this->addArguments($arguments); - } - - /** - * Adds an array of InputArgument objects. - * - * @param InputArgument[] $arguments An array of InputArgument objects - */ - public function addArguments($arguments = []) - { - if (null !== $arguments) { - foreach ($arguments as $argument) { - $this->addArgument($argument); - } - } - } - - /** - * @throws LogicException When incorrect argument is given - */ - public function addArgument(InputArgument $argument) - { - if (isset($this->arguments[$argument->getName()])) { - throw new LogicException(sprintf('An argument with name "%s" already exists.', $argument->getName())); - } - - if ($this->hasAnArrayArgument) { - throw new LogicException('Cannot add an argument after an array argument.'); - } - - if ($argument->isRequired() && $this->hasOptional) { - throw new LogicException('Cannot add a required argument after an optional one.'); - } - - if ($argument->isArray()) { - $this->hasAnArrayArgument = true; - } - - if ($argument->isRequired()) { - ++$this->requiredCount; - } else { - $this->hasOptional = true; - } - - $this->arguments[$argument->getName()] = $argument; - } - - /** - * Returns an InputArgument by name or by position. - * - * @param string|int $name The InputArgument name or position - * - * @return InputArgument An InputArgument object - * - * @throws InvalidArgumentException When argument given doesn't exist - */ - public function getArgument($name) - { - if (!$this->hasArgument($name)) { - throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); - } - - $arguments = \is_int($name) ? array_values($this->arguments) : $this->arguments; - - return $arguments[$name]; - } - - /** - * Returns true if an InputArgument object exists by name or position. - * - * @param string|int $name The InputArgument name or position - * - * @return bool true if the InputArgument object exists, false otherwise - */ - public function hasArgument($name) - { - $arguments = \is_int($name) ? array_values($this->arguments) : $this->arguments; - - return isset($arguments[$name]); - } - - /** - * Gets the array of InputArgument objects. - * - * @return InputArgument[] An array of InputArgument objects - */ - public function getArguments() - { - return $this->arguments; - } - - /** - * Returns the number of InputArguments. - * - * @return int The number of InputArguments - */ - public function getArgumentCount() - { - return $this->hasAnArrayArgument ? \PHP_INT_MAX : \count($this->arguments); - } - - /** - * Returns the number of required InputArguments. - * - * @return int The number of required InputArguments - */ - public function getArgumentRequiredCount() - { - return $this->requiredCount; - } - - /** - * @return array - */ - public function getArgumentDefaults() - { - $values = []; - foreach ($this->arguments as $argument) { - $values[$argument->getName()] = $argument->getDefault(); - } - - return $values; - } - - /** - * Sets the InputOption objects. - * - * @param InputOption[] $options An array of InputOption objects - */ - public function setOptions($options = []) - { - $this->options = []; - $this->shortcuts = []; - $this->addOptions($options); - } - - /** - * Adds an array of InputOption objects. - * - * @param InputOption[] $options An array of InputOption objects - */ - public function addOptions($options = []) - { - foreach ($options as $option) { - $this->addOption($option); - } - } - - /** - * @throws LogicException When option given already exist - */ - public function addOption(InputOption $option) - { - if (isset($this->options[$option->getName()]) && !$option->equals($this->options[$option->getName()])) { - throw new LogicException(sprintf('An option named "%s" already exists.', $option->getName())); - } - - if ($option->getShortcut()) { - foreach (explode('|', $option->getShortcut()) as $shortcut) { - if (isset($this->shortcuts[$shortcut]) && !$option->equals($this->options[$this->shortcuts[$shortcut]])) { - throw new LogicException(sprintf('An option with shortcut "%s" already exists.', $shortcut)); - } - } - } - - $this->options[$option->getName()] = $option; - if ($option->getShortcut()) { - foreach (explode('|', $option->getShortcut()) as $shortcut) { - $this->shortcuts[$shortcut] = $option->getName(); - } - } - } - - /** - * Returns an InputOption by name. - * - * @param string $name The InputOption name - * - * @return InputOption A InputOption object - * - * @throws InvalidArgumentException When option given doesn't exist - */ - public function getOption($name) - { - if (!$this->hasOption($name)) { - throw new InvalidArgumentException(sprintf('The "--%s" option does not exist.', $name)); - } - - return $this->options[$name]; - } - - /** - * Returns true if an InputOption object exists by name. - * - * This method can't be used to check if the user included the option when - * executing the command (use getOption() instead). - * - * @param string $name The InputOption name - * - * @return bool true if the InputOption object exists, false otherwise - */ - public function hasOption($name) - { - return isset($this->options[$name]); - } - - /** - * Gets the array of InputOption objects. - * - * @return InputOption[] An array of InputOption objects - */ - public function getOptions() - { - return $this->options; - } - - /** - * Returns true if an InputOption object exists by shortcut. - * - * @param string $name The InputOption shortcut - * - * @return bool true if the InputOption object exists, false otherwise - */ - public function hasShortcut($name) - { - return isset($this->shortcuts[$name]); - } - - /** - * Gets an InputOption by shortcut. - * - * @param string $shortcut The Shortcut name - * - * @return InputOption An InputOption object - */ - public function getOptionForShortcut($shortcut) - { - return $this->getOption($this->shortcutToName($shortcut)); - } - - /** - * @return array - */ - public function getOptionDefaults() - { - $values = []; - foreach ($this->options as $option) { - $values[$option->getName()] = $option->getDefault(); - } - - return $values; - } - - /** - * Returns the InputOption name given a shortcut. - * - * @throws InvalidArgumentException When option given does not exist - * - * @internal - */ - public function shortcutToName(string $shortcut): string - { - if (!isset($this->shortcuts[$shortcut])) { - throw new InvalidArgumentException(sprintf('The "-%s" option does not exist.', $shortcut)); - } - - return $this->shortcuts[$shortcut]; - } - - /** - * Gets the synopsis. - * - * @param bool $short Whether to return the short version (with options folded) or not - * - * @return string The synopsis - */ - public function getSynopsis($short = false) - { - $elements = []; - - if ($short && $this->getOptions()) { - $elements[] = '[options]'; - } elseif (!$short) { - foreach ($this->getOptions() as $option) { - $value = ''; - if ($option->acceptValue()) { - $value = sprintf( - ' %s%s%s', - $option->isValueOptional() ? '[' : '', - strtoupper($option->getName()), - $option->isValueOptional() ? ']' : '' - ); - } - - $shortcut = $option->getShortcut() ? sprintf('-%s|', $option->getShortcut()) : ''; - $elements[] = sprintf('[%s--%s%s]', $shortcut, $option->getName(), $value); - } - } - - if (\count($elements) && $this->getArguments()) { - $elements[] = '[--]'; - } - - $tail = ''; - foreach ($this->getArguments() as $argument) { - $element = '<'.$argument->getName().'>'; - if ($argument->isArray()) { - $element .= '...'; - } - - if (!$argument->isRequired()) { - $element = '['.$element; - $tail .= ']'; - } - - $elements[] = $element; - } - - return implode(' ', $elements).$tail; - } -} diff --git a/vendor/symfony/console/Input/InputInterface.php b/vendor/symfony/console/Input/InputInterface.php deleted file mode 100644 index 8efc623..0000000 --- a/vendor/symfony/console/Input/InputInterface.php +++ /dev/null @@ -1,163 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\RuntimeException; - -/** - * InputInterface is the interface implemented by all input classes. - * - * @author Fabien Potencier - */ -interface InputInterface -{ - /** - * Returns the first argument from the raw parameters (not parsed). - * - * @return string|null The value of the first argument or null otherwise - */ - public function getFirstArgument(); - - /** - * Returns true if the raw parameters (not parsed) contain a value. - * - * This method is to be used to introspect the input parameters - * before they have been validated. It must be used carefully. - * Does not necessarily return the correct result for short options - * when multiple flags are combined in the same option. - * - * @param string|array $values The values to look for in the raw parameters (can be an array) - * @param bool $onlyParams Only check real parameters, skip those following an end of options (--) signal - * - * @return bool true if the value is contained in the raw parameters - */ - public function hasParameterOption($values, $onlyParams = false); - - /** - * Returns the value of a raw option (not parsed). - * - * This method is to be used to introspect the input parameters - * before they have been validated. It must be used carefully. - * Does not necessarily return the correct result for short options - * when multiple flags are combined in the same option. - * - * @param string|array $values The value(s) to look for in the raw parameters (can be an array) - * @param string|bool|int|float|array|null $default The default value to return if no result is found - * @param bool $onlyParams Only check real parameters, skip those following an end of options (--) signal - * - * @return mixed The option value - */ - public function getParameterOption($values, $default = false, $onlyParams = false); - - /** - * Binds the current Input instance with the given arguments and options. - * - * @throws RuntimeException - */ - public function bind(InputDefinition $definition); - - /** - * Validates the input. - * - * @throws RuntimeException When not enough arguments are given - */ - public function validate(); - - /** - * Returns all the given arguments merged with the default values. - * - * @return array - */ - public function getArguments(); - - /** - * Returns the argument value for a given argument name. - * - * @param string $name The argument name - * - * @return mixed - * - * @throws InvalidArgumentException When argument given doesn't exist - */ - public function getArgument($name); - - /** - * Sets an argument value by name. - * - * @param string $name The argument name - * @param mixed $value The argument value - * - * @throws InvalidArgumentException When argument given doesn't exist - */ - public function setArgument($name, $value); - - /** - * Returns true if an InputArgument object exists by name or position. - * - * @param string $name The argument name - * - * @return bool true if the InputArgument object exists, false otherwise - */ - public function hasArgument($name); - - /** - * Returns all the given options merged with the default values. - * - * @return array - */ - public function getOptions(); - - /** - * Returns the option value for a given option name. - * - * @param string $name The option name - * - * @return mixed - * - * @throws InvalidArgumentException When option given doesn't exist - */ - public function getOption($name); - - /** - * Sets an option value by name. - * - * @param string $name The option name - * @param mixed $value The option value - * - * @throws InvalidArgumentException When option given doesn't exist - */ - public function setOption($name, $value); - - /** - * Returns true if an InputOption object exists by name. - * - * @param string $name The InputOption name - * - * @return bool true if the InputOption object exists, false otherwise - */ - public function hasOption($name); - - /** - * Is this input means interactive? - * - * @return bool - */ - public function isInteractive(); - - /** - * Sets the input interactivity. - * - * @param bool $interactive If the input should be interactive - */ - public function setInteractive($interactive); -} diff --git a/vendor/symfony/console/Input/InputOption.php b/vendor/symfony/console/Input/InputOption.php deleted file mode 100644 index c7729db..0000000 --- a/vendor/symfony/console/Input/InputOption.php +++ /dev/null @@ -1,219 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\LogicException; - -/** - * Represents a command line option. - * - * @author Fabien Potencier - */ -class InputOption -{ - /** - * Do not accept input for the option (e.g. --yell). This is the default behavior of options. - */ - public const VALUE_NONE = 1; - - /** - * A value must be passed when the option is used (e.g. --iterations=5 or -i5). - */ - public const VALUE_REQUIRED = 2; - - /** - * The option may or may not have a value (e.g. --yell or --yell=loud). - */ - public const VALUE_OPTIONAL = 4; - - /** - * The option accepts multiple values (e.g. --dir=/foo --dir=/bar). - */ - public const VALUE_IS_ARRAY = 8; - - private $name; - private $shortcut; - private $mode; - private $default; - private $description; - - /** - * @param string $name The option name - * @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts - * @param int|null $mode The option mode: One of the VALUE_* constants - * @param string $description A description text - * @param string|bool|int|float|array|null $default The default value (must be null for self::VALUE_NONE) - * - * @throws InvalidArgumentException If option mode is invalid or incompatible - */ - public function __construct(string $name, $shortcut = null, int $mode = null, string $description = '', $default = null) - { - if (str_starts_with($name, '--')) { - $name = substr($name, 2); - } - - if (empty($name)) { - throw new InvalidArgumentException('An option name cannot be empty.'); - } - - if (empty($shortcut)) { - $shortcut = null; - } - - if (null !== $shortcut) { - if (\is_array($shortcut)) { - $shortcut = implode('|', $shortcut); - } - $shortcuts = preg_split('{(\|)-?}', ltrim($shortcut, '-')); - $shortcuts = array_filter($shortcuts); - $shortcut = implode('|', $shortcuts); - - if (empty($shortcut)) { - throw new InvalidArgumentException('An option shortcut cannot be empty.'); - } - } - - if (null === $mode) { - $mode = self::VALUE_NONE; - } elseif ($mode > 15 || $mode < 1) { - throw new InvalidArgumentException(sprintf('Option mode "%s" is not valid.', $mode)); - } - - $this->name = $name; - $this->shortcut = $shortcut; - $this->mode = $mode; - $this->description = $description; - - if ($this->isArray() && !$this->acceptValue()) { - throw new InvalidArgumentException('Impossible to have an option mode VALUE_IS_ARRAY if the option does not accept a value.'); - } - - $this->setDefault($default); - } - - /** - * Returns the option shortcut. - * - * @return string|null The shortcut - */ - public function getShortcut() - { - return $this->shortcut; - } - - /** - * Returns the option name. - * - * @return string The name - */ - public function getName() - { - return $this->name; - } - - /** - * Returns true if the option accepts a value. - * - * @return bool true if value mode is not self::VALUE_NONE, false otherwise - */ - public function acceptValue() - { - return $this->isValueRequired() || $this->isValueOptional(); - } - - /** - * Returns true if the option requires a value. - * - * @return bool true if value mode is self::VALUE_REQUIRED, false otherwise - */ - public function isValueRequired() - { - return self::VALUE_REQUIRED === (self::VALUE_REQUIRED & $this->mode); - } - - /** - * Returns true if the option takes an optional value. - * - * @return bool true if value mode is self::VALUE_OPTIONAL, false otherwise - */ - public function isValueOptional() - { - return self::VALUE_OPTIONAL === (self::VALUE_OPTIONAL & $this->mode); - } - - /** - * Returns true if the option can take multiple values. - * - * @return bool true if mode is self::VALUE_IS_ARRAY, false otherwise - */ - public function isArray() - { - return self::VALUE_IS_ARRAY === (self::VALUE_IS_ARRAY & $this->mode); - } - - /** - * @param string|bool|int|float|array|null $default - */ - public function setDefault($default = null) - { - if (self::VALUE_NONE === (self::VALUE_NONE & $this->mode) && null !== $default) { - throw new LogicException('Cannot set a default value when using InputOption::VALUE_NONE mode.'); - } - - if ($this->isArray()) { - if (null === $default) { - $default = []; - } elseif (!\is_array($default)) { - throw new LogicException('A default value for an array option must be an array.'); - } - } - - $this->default = $this->acceptValue() ? $default : false; - } - - /** - * Returns the default value. - * - * @return string|bool|int|float|array|null - */ - public function getDefault() - { - return $this->default; - } - - /** - * Returns the description text. - * - * @return string The description text - */ - public function getDescription() - { - return $this->description; - } - - /** - * Checks whether the given option equals this one. - * - * @return bool - */ - public function equals(self $option) - { - return $option->getName() === $this->getName() - && $option->getShortcut() === $this->getShortcut() - && $option->getDefault() === $this->getDefault() - && $option->isArray() === $this->isArray() - && $option->isValueRequired() === $this->isValueRequired() - && $option->isValueOptional() === $this->isValueOptional() - ; - } -} diff --git a/vendor/symfony/console/Input/StreamableInputInterface.php b/vendor/symfony/console/Input/StreamableInputInterface.php deleted file mode 100644 index d7e462f..0000000 --- a/vendor/symfony/console/Input/StreamableInputInterface.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -/** - * StreamableInputInterface is the interface implemented by all input classes - * that have an input stream. - * - * @author Robin Chalas - */ -interface StreamableInputInterface extends InputInterface -{ - /** - * Sets the input stream to read from when interacting with the user. - * - * This is mainly useful for testing purpose. - * - * @param resource $stream The input stream - */ - public function setStream($stream); - - /** - * Returns the input stream. - * - * @return resource|null - */ - public function getStream(); -} diff --git a/vendor/symfony/console/Input/StringInput.php b/vendor/symfony/console/Input/StringInput.php deleted file mode 100644 index eb5c07f..0000000 --- a/vendor/symfony/console/Input/StringInput.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -use Symfony\Component\Console\Exception\InvalidArgumentException; - -/** - * StringInput represents an input provided as a string. - * - * Usage: - * - * $input = new StringInput('foo --bar="foobar"'); - * - * @author Fabien Potencier - */ -class StringInput extends ArgvInput -{ - public const REGEX_STRING = '([^\s]+?)(?:\s|(?setTokens($this->tokenize($input)); - } - - /** - * Tokenizes a string. - * - * @throws InvalidArgumentException When unable to parse input (should never happen) - */ - private function tokenize(string $input): array - { - $tokens = []; - $length = \strlen($input); - $cursor = 0; - while ($cursor < $length) { - if (preg_match('/\s+/A', $input, $match, 0, $cursor)) { - } elseif (preg_match('/([^="\'\s]+?)(=?)('.self::REGEX_QUOTED_STRING.'+)/A', $input, $match, 0, $cursor)) { - $tokens[] = $match[1].$match[2].stripcslashes(str_replace(['"\'', '\'"', '\'\'', '""'], '', substr($match[3], 1, -1))); - } elseif (preg_match('/'.self::REGEX_QUOTED_STRING.'/A', $input, $match, 0, $cursor)) { - $tokens[] = stripcslashes(substr($match[0], 1, -1)); - } elseif (preg_match('/'.self::REGEX_STRING.'/A', $input, $match, 0, $cursor)) { - $tokens[] = stripcslashes($match[1]); - } else { - // should never happen - throw new InvalidArgumentException(sprintf('Unable to parse input near "... %s ...".', substr($input, $cursor, 10))); - } - - $cursor += \strlen($match[0]); - } - - return $tokens; - } -} diff --git a/vendor/symfony/console/LICENSE b/vendor/symfony/console/LICENSE deleted file mode 100644 index 9ff2d0d..0000000 --- a/vendor/symfony/console/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-2021 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/console/Logger/ConsoleLogger.php b/vendor/symfony/console/Logger/ConsoleLogger.php deleted file mode 100644 index c9ee035..0000000 --- a/vendor/symfony/console/Logger/ConsoleLogger.php +++ /dev/null @@ -1,126 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Logger; - -use Psr\Log\AbstractLogger; -use Psr\Log\InvalidArgumentException; -use Psr\Log\LogLevel; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * PSR-3 compliant console logger. - * - * @author Kévin Dunglas - * - * @see https://www.php-fig.org/psr/psr-3/ - */ -class ConsoleLogger extends AbstractLogger -{ - public const INFO = 'info'; - public const ERROR = 'error'; - - private $output; - private $verbosityLevelMap = [ - LogLevel::EMERGENCY => OutputInterface::VERBOSITY_NORMAL, - LogLevel::ALERT => OutputInterface::VERBOSITY_NORMAL, - LogLevel::CRITICAL => OutputInterface::VERBOSITY_NORMAL, - LogLevel::ERROR => OutputInterface::VERBOSITY_NORMAL, - LogLevel::WARNING => OutputInterface::VERBOSITY_NORMAL, - LogLevel::NOTICE => OutputInterface::VERBOSITY_VERBOSE, - LogLevel::INFO => OutputInterface::VERBOSITY_VERY_VERBOSE, - LogLevel::DEBUG => OutputInterface::VERBOSITY_DEBUG, - ]; - private $formatLevelMap = [ - LogLevel::EMERGENCY => self::ERROR, - LogLevel::ALERT => self::ERROR, - LogLevel::CRITICAL => self::ERROR, - LogLevel::ERROR => self::ERROR, - LogLevel::WARNING => self::INFO, - LogLevel::NOTICE => self::INFO, - LogLevel::INFO => self::INFO, - LogLevel::DEBUG => self::INFO, - ]; - private $errored = false; - - public function __construct(OutputInterface $output, array $verbosityLevelMap = [], array $formatLevelMap = []) - { - $this->output = $output; - $this->verbosityLevelMap = $verbosityLevelMap + $this->verbosityLevelMap; - $this->formatLevelMap = $formatLevelMap + $this->formatLevelMap; - } - - /** - * {@inheritdoc} - * - * @return void - */ - public function log($level, $message, array $context = []) - { - if (!isset($this->verbosityLevelMap[$level])) { - throw new InvalidArgumentException(sprintf('The log level "%s" does not exist.', $level)); - } - - $output = $this->output; - - // Write to the error output if necessary and available - if (self::ERROR === $this->formatLevelMap[$level]) { - if ($this->output instanceof ConsoleOutputInterface) { - $output = $output->getErrorOutput(); - } - $this->errored = true; - } - - // the if condition check isn't necessary -- it's the same one that $output will do internally anyway. - // We only do it for efficiency here as the message formatting is relatively expensive. - if ($output->getVerbosity() >= $this->verbosityLevelMap[$level]) { - $output->writeln(sprintf('<%1$s>[%2$s] %3$s', $this->formatLevelMap[$level], $level, $this->interpolate($message, $context)), $this->verbosityLevelMap[$level]); - } - } - - /** - * Returns true when any messages have been logged at error levels. - * - * @return bool - */ - public function hasErrored() - { - return $this->errored; - } - - /** - * Interpolates context values into the message placeholders. - * - * @author PHP Framework Interoperability Group - */ - private function interpolate(string $message, array $context): string - { - if (!str_contains($message, '{')) { - return $message; - } - - $replacements = []; - foreach ($context as $key => $val) { - if (null === $val || is_scalar($val) || (\is_object($val) && method_exists($val, '__toString'))) { - $replacements["{{$key}}"] = $val; - } elseif ($val instanceof \DateTimeInterface) { - $replacements["{{$key}}"] = $val->format(\DateTime::RFC3339); - } elseif (\is_object($val)) { - $replacements["{{$key}}"] = '[object '.\get_class($val).']'; - } else { - $replacements["{{$key}}"] = '['.\gettype($val).']'; - } - } - - return strtr($message, $replacements); - } -} diff --git a/vendor/symfony/console/Output/BufferedOutput.php b/vendor/symfony/console/Output/BufferedOutput.php deleted file mode 100644 index fefaac2..0000000 --- a/vendor/symfony/console/Output/BufferedOutput.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -/** - * @author Jean-François Simon - */ -class BufferedOutput extends Output -{ - private $buffer = ''; - - /** - * Empties buffer and returns its content. - * - * @return string - */ - public function fetch() - { - $content = $this->buffer; - $this->buffer = ''; - - return $content; - } - - /** - * {@inheritdoc} - */ - protected function doWrite($message, $newline) - { - $this->buffer .= $message; - - if ($newline) { - $this->buffer .= \PHP_EOL; - } - } -} diff --git a/vendor/symfony/console/Output/ConsoleOutput.php b/vendor/symfony/console/Output/ConsoleOutput.php deleted file mode 100644 index 966fca0..0000000 --- a/vendor/symfony/console/Output/ConsoleOutput.php +++ /dev/null @@ -1,166 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -use Symfony\Component\Console\Formatter\OutputFormatterInterface; - -/** - * ConsoleOutput is the default class for all CLI output. It uses STDOUT and STDERR. - * - * This class is a convenient wrapper around `StreamOutput` for both STDOUT and STDERR. - * - * $output = new ConsoleOutput(); - * - * This is equivalent to: - * - * $output = new StreamOutput(fopen('php://stdout', 'w')); - * $stdErr = new StreamOutput(fopen('php://stderr', 'w')); - * - * @author Fabien Potencier - */ -class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface -{ - private $stderr; - private $consoleSectionOutputs = []; - - /** - * @param int $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface) - * @param bool|null $decorated Whether to decorate messages (null for auto-guessing) - * @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter) - */ - public function __construct(int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = null, OutputFormatterInterface $formatter = null) - { - parent::__construct($this->openOutputStream(), $verbosity, $decorated, $formatter); - - if (null === $formatter) { - // for BC reasons, stdErr has it own Formatter only when user don't inject a specific formatter. - $this->stderr = new StreamOutput($this->openErrorStream(), $verbosity, $decorated); - - return; - } - - $actualDecorated = $this->isDecorated(); - $this->stderr = new StreamOutput($this->openErrorStream(), $verbosity, $decorated, $this->getFormatter()); - - if (null === $decorated) { - $this->setDecorated($actualDecorated && $this->stderr->isDecorated()); - } - } - - /** - * Creates a new output section. - */ - public function section(): ConsoleSectionOutput - { - return new ConsoleSectionOutput($this->getStream(), $this->consoleSectionOutputs, $this->getVerbosity(), $this->isDecorated(), $this->getFormatter()); - } - - /** - * {@inheritdoc} - */ - public function setDecorated($decorated) - { - parent::setDecorated($decorated); - $this->stderr->setDecorated($decorated); - } - - /** - * {@inheritdoc} - */ - public function setFormatter(OutputFormatterInterface $formatter) - { - parent::setFormatter($formatter); - $this->stderr->setFormatter($formatter); - } - - /** - * {@inheritdoc} - */ - public function setVerbosity($level) - { - parent::setVerbosity($level); - $this->stderr->setVerbosity($level); - } - - /** - * {@inheritdoc} - */ - public function getErrorOutput() - { - return $this->stderr; - } - - /** - * {@inheritdoc} - */ - public function setErrorOutput(OutputInterface $error) - { - $this->stderr = $error; - } - - /** - * Returns true if current environment supports writing console output to - * STDOUT. - * - * @return bool - */ - protected function hasStdoutSupport() - { - return false === $this->isRunningOS400(); - } - - /** - * Returns true if current environment supports writing console output to - * STDERR. - * - * @return bool - */ - protected function hasStderrSupport() - { - return false === $this->isRunningOS400(); - } - - /** - * Checks if current executing environment is IBM iSeries (OS400), which - * doesn't properly convert character-encodings between ASCII to EBCDIC. - */ - private function isRunningOS400(): bool - { - $checks = [ - \function_exists('php_uname') ? php_uname('s') : '', - getenv('OSTYPE'), - \PHP_OS, - ]; - - return false !== stripos(implode(';', $checks), 'OS400'); - } - - /** - * @return resource - */ - private function openOutputStream() - { - if (!$this->hasStdoutSupport()) { - return fopen('php://output', 'w'); - } - - return @fopen('php://stdout', 'w') ?: fopen('php://output', 'w'); - } - - /** - * @return resource - */ - private function openErrorStream() - { - return fopen($this->hasStderrSupport() ? 'php://stderr' : 'php://output', 'w'); - } -} diff --git a/vendor/symfony/console/Output/ConsoleOutputInterface.php b/vendor/symfony/console/Output/ConsoleOutputInterface.php deleted file mode 100644 index f4c2fa6..0000000 --- a/vendor/symfony/console/Output/ConsoleOutputInterface.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -/** - * ConsoleOutputInterface is the interface implemented by ConsoleOutput class. - * This adds information about stderr and section output stream. - * - * @author Dariusz Górecki - * - * @method ConsoleSectionOutput section() Creates a new output section - */ -interface ConsoleOutputInterface extends OutputInterface -{ - /** - * Gets the OutputInterface for errors. - * - * @return OutputInterface - */ - public function getErrorOutput(); - - public function setErrorOutput(OutputInterface $error); -} diff --git a/vendor/symfony/console/Output/ConsoleSectionOutput.php b/vendor/symfony/console/Output/ConsoleSectionOutput.php deleted file mode 100644 index c19edbf..0000000 --- a/vendor/symfony/console/Output/ConsoleSectionOutput.php +++ /dev/null @@ -1,143 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -use Symfony\Component\Console\Formatter\OutputFormatterInterface; -use Symfony\Component\Console\Helper\Helper; -use Symfony\Component\Console\Terminal; - -/** - * @author Pierre du Plessis - * @author Gabriel Ostrolucký - */ -class ConsoleSectionOutput extends StreamOutput -{ - private $content = []; - private $lines = 0; - private $sections; - private $terminal; - - /** - * @param resource $stream - * @param ConsoleSectionOutput[] $sections - */ - public function __construct($stream, array &$sections, int $verbosity, bool $decorated, OutputFormatterInterface $formatter) - { - parent::__construct($stream, $verbosity, $decorated, $formatter); - array_unshift($sections, $this); - $this->sections = &$sections; - $this->terminal = new Terminal(); - } - - /** - * Clears previous output for this section. - * - * @param int $lines Number of lines to clear. If null, then the entire output of this section is cleared - */ - public function clear(int $lines = null) - { - if (empty($this->content) || !$this->isDecorated()) { - return; - } - - if ($lines) { - array_splice($this->content, -($lines * 2)); // Multiply lines by 2 to cater for each new line added between content - } else { - $lines = $this->lines; - $this->content = []; - } - - $this->lines -= $lines; - - parent::doWrite($this->popStreamContentUntilCurrentSection($lines), false); - } - - /** - * Overwrites the previous output with a new message. - * - * @param array|string $message - */ - public function overwrite($message) - { - $this->clear(); - $this->writeln($message); - } - - public function getContent(): string - { - return implode('', $this->content); - } - - /** - * @internal - */ - public function addContent(string $input) - { - foreach (explode(\PHP_EOL, $input) as $lineContent) { - $this->lines += ceil($this->getDisplayLength($lineContent) / $this->terminal->getWidth()) ?: 1; - $this->content[] = $lineContent; - $this->content[] = \PHP_EOL; - } - } - - /** - * {@inheritdoc} - */ - protected function doWrite($message, $newline) - { - if (!$this->isDecorated()) { - parent::doWrite($message, $newline); - - return; - } - - $erasedContent = $this->popStreamContentUntilCurrentSection(); - - $this->addContent($message); - - parent::doWrite($message, true); - parent::doWrite($erasedContent, false); - } - - /** - * At initial stage, cursor is at the end of stream output. This method makes cursor crawl upwards until it hits - * current section. Then it erases content it crawled through. Optionally, it erases part of current section too. - */ - private function popStreamContentUntilCurrentSection(int $numberOfLinesToClearFromCurrentSection = 0): string - { - $numberOfLinesToClear = $numberOfLinesToClearFromCurrentSection; - $erasedContent = []; - - foreach ($this->sections as $section) { - if ($section === $this) { - break; - } - - $numberOfLinesToClear += $section->lines; - $erasedContent[] = $section->getContent(); - } - - if ($numberOfLinesToClear > 0) { - // move cursor up n lines - parent::doWrite(sprintf("\x1b[%dA", $numberOfLinesToClear), false); - // erase to end of screen - parent::doWrite("\x1b[0J", false); - } - - return implode('', array_reverse($erasedContent)); - } - - private function getDisplayLength(string $text): string - { - return Helper::strlenWithoutDecoration($this->getFormatter(), str_replace("\t", ' ', $text)); - } -} diff --git a/vendor/symfony/console/Output/NullOutput.php b/vendor/symfony/console/Output/NullOutput.php deleted file mode 100644 index 218f285..0000000 --- a/vendor/symfony/console/Output/NullOutput.php +++ /dev/null @@ -1,123 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Formatter\OutputFormatterInterface; - -/** - * NullOutput suppresses all output. - * - * $output = new NullOutput(); - * - * @author Fabien Potencier - * @author Tobias Schultze - */ -class NullOutput implements OutputInterface -{ - /** - * {@inheritdoc} - */ - public function setFormatter(OutputFormatterInterface $formatter) - { - // do nothing - } - - /** - * {@inheritdoc} - */ - public function getFormatter() - { - // to comply with the interface we must return a OutputFormatterInterface - return new OutputFormatter(); - } - - /** - * {@inheritdoc} - */ - public function setDecorated($decorated) - { - // do nothing - } - - /** - * {@inheritdoc} - */ - public function isDecorated() - { - return false; - } - - /** - * {@inheritdoc} - */ - public function setVerbosity($level) - { - // do nothing - } - - /** - * {@inheritdoc} - */ - public function getVerbosity() - { - return self::VERBOSITY_QUIET; - } - - /** - * {@inheritdoc} - */ - public function isQuiet() - { - return true; - } - - /** - * {@inheritdoc} - */ - public function isVerbose() - { - return false; - } - - /** - * {@inheritdoc} - */ - public function isVeryVerbose() - { - return false; - } - - /** - * {@inheritdoc} - */ - public function isDebug() - { - return false; - } - - /** - * {@inheritdoc} - */ - public function writeln($messages, $options = self::OUTPUT_NORMAL) - { - // do nothing - } - - /** - * {@inheritdoc} - */ - public function write($messages, $newline = false, $options = self::OUTPUT_NORMAL) - { - // do nothing - } -} diff --git a/vendor/symfony/console/Output/Output.php b/vendor/symfony/console/Output/Output.php deleted file mode 100644 index fb838f0..0000000 --- a/vendor/symfony/console/Output/Output.php +++ /dev/null @@ -1,177 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Formatter\OutputFormatterInterface; - -/** - * Base class for output classes. - * - * There are five levels of verbosity: - * - * * normal: no option passed (normal output) - * * verbose: -v (more output) - * * very verbose: -vv (highly extended output) - * * debug: -vvv (all debug output) - * * quiet: -q (no output) - * - * @author Fabien Potencier - */ -abstract class Output implements OutputInterface -{ - private $verbosity; - private $formatter; - - /** - * @param int $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface) - * @param bool $decorated Whether to decorate messages - * @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter) - */ - public function __construct(?int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = false, OutputFormatterInterface $formatter = null) - { - $this->verbosity = null === $verbosity ? self::VERBOSITY_NORMAL : $verbosity; - $this->formatter = $formatter ?? new OutputFormatter(); - $this->formatter->setDecorated($decorated); - } - - /** - * {@inheritdoc} - */ - public function setFormatter(OutputFormatterInterface $formatter) - { - $this->formatter = $formatter; - } - - /** - * {@inheritdoc} - */ - public function getFormatter() - { - return $this->formatter; - } - - /** - * {@inheritdoc} - */ - public function setDecorated($decorated) - { - $this->formatter->setDecorated($decorated); - } - - /** - * {@inheritdoc} - */ - public function isDecorated() - { - return $this->formatter->isDecorated(); - } - - /** - * {@inheritdoc} - */ - public function setVerbosity($level) - { - $this->verbosity = (int) $level; - } - - /** - * {@inheritdoc} - */ - public function getVerbosity() - { - return $this->verbosity; - } - - /** - * {@inheritdoc} - */ - public function isQuiet() - { - return self::VERBOSITY_QUIET === $this->verbosity; - } - - /** - * {@inheritdoc} - */ - public function isVerbose() - { - return self::VERBOSITY_VERBOSE <= $this->verbosity; - } - - /** - * {@inheritdoc} - */ - public function isVeryVerbose() - { - return self::VERBOSITY_VERY_VERBOSE <= $this->verbosity; - } - - /** - * {@inheritdoc} - */ - public function isDebug() - { - return self::VERBOSITY_DEBUG <= $this->verbosity; - } - - /** - * {@inheritdoc} - */ - public function writeln($messages, $options = self::OUTPUT_NORMAL) - { - $this->write($messages, true, $options); - } - - /** - * {@inheritdoc} - */ - public function write($messages, $newline = false, $options = self::OUTPUT_NORMAL) - { - if (!is_iterable($messages)) { - $messages = [$messages]; - } - - $types = self::OUTPUT_NORMAL | self::OUTPUT_RAW | self::OUTPUT_PLAIN; - $type = $types & $options ?: self::OUTPUT_NORMAL; - - $verbosities = self::VERBOSITY_QUIET | self::VERBOSITY_NORMAL | self::VERBOSITY_VERBOSE | self::VERBOSITY_VERY_VERBOSE | self::VERBOSITY_DEBUG; - $verbosity = $verbosities & $options ?: self::VERBOSITY_NORMAL; - - if ($verbosity > $this->getVerbosity()) { - return; - } - - foreach ($messages as $message) { - switch ($type) { - case OutputInterface::OUTPUT_NORMAL: - $message = $this->formatter->format($message); - break; - case OutputInterface::OUTPUT_RAW: - break; - case OutputInterface::OUTPUT_PLAIN: - $message = strip_tags($this->formatter->format($message)); - break; - } - - $this->doWrite($message ?? '', $newline); - } - } - - /** - * Writes a message to the output. - * - * @param string $message A message to write to the output - * @param bool $newline Whether to add a newline or not - */ - abstract protected function doWrite($message, $newline); -} diff --git a/vendor/symfony/console/Output/OutputInterface.php b/vendor/symfony/console/Output/OutputInterface.php deleted file mode 100644 index 671d5bd..0000000 --- a/vendor/symfony/console/Output/OutputInterface.php +++ /dev/null @@ -1,114 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -use Symfony\Component\Console\Formatter\OutputFormatterInterface; - -/** - * OutputInterface is the interface implemented by all Output classes. - * - * @author Fabien Potencier - */ -interface OutputInterface -{ - public const VERBOSITY_QUIET = 16; - public const VERBOSITY_NORMAL = 32; - public const VERBOSITY_VERBOSE = 64; - public const VERBOSITY_VERY_VERBOSE = 128; - public const VERBOSITY_DEBUG = 256; - - public const OUTPUT_NORMAL = 1; - public const OUTPUT_RAW = 2; - public const OUTPUT_PLAIN = 4; - - /** - * Writes a message to the output. - * - * @param string|iterable $messages The message as an iterable of strings or a single string - * @param bool $newline Whether to add a newline - * @param int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL - */ - public function write($messages, $newline = false, $options = 0); - - /** - * Writes a message to the output and adds a newline at the end. - * - * @param string|iterable $messages The message as an iterable of strings or a single string - * @param int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL - */ - public function writeln($messages, $options = 0); - - /** - * Sets the verbosity of the output. - * - * @param int $level The level of verbosity (one of the VERBOSITY constants) - */ - public function setVerbosity($level); - - /** - * Gets the current verbosity of the output. - * - * @return int The current level of verbosity (one of the VERBOSITY constants) - */ - public function getVerbosity(); - - /** - * Returns whether verbosity is quiet (-q). - * - * @return bool true if verbosity is set to VERBOSITY_QUIET, false otherwise - */ - public function isQuiet(); - - /** - * Returns whether verbosity is verbose (-v). - * - * @return bool true if verbosity is set to VERBOSITY_VERBOSE, false otherwise - */ - public function isVerbose(); - - /** - * Returns whether verbosity is very verbose (-vv). - * - * @return bool true if verbosity is set to VERBOSITY_VERY_VERBOSE, false otherwise - */ - public function isVeryVerbose(); - - /** - * Returns whether verbosity is debug (-vvv). - * - * @return bool true if verbosity is set to VERBOSITY_DEBUG, false otherwise - */ - public function isDebug(); - - /** - * Sets the decorated flag. - * - * @param bool $decorated Whether to decorate the messages - */ - public function setDecorated($decorated); - - /** - * Gets the decorated flag. - * - * @return bool true if the output will decorate messages, false otherwise - */ - public function isDecorated(); - - public function setFormatter(OutputFormatterInterface $formatter); - - /** - * Returns current output formatter instance. - * - * @return OutputFormatterInterface - */ - public function getFormatter(); -} diff --git a/vendor/symfony/console/Output/StreamOutput.php b/vendor/symfony/console/Output/StreamOutput.php deleted file mode 100644 index 9c22436..0000000 --- a/vendor/symfony/console/Output/StreamOutput.php +++ /dev/null @@ -1,125 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Formatter\OutputFormatterInterface; - -/** - * StreamOutput writes the output to a given stream. - * - * Usage: - * - * $output = new StreamOutput(fopen('php://stdout', 'w')); - * - * As `StreamOutput` can use any stream, you can also use a file: - * - * $output = new StreamOutput(fopen('/path/to/output.log', 'a', false)); - * - * @author Fabien Potencier - */ -class StreamOutput extends Output -{ - private $stream; - - /** - * @param resource $stream A stream resource - * @param int $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface) - * @param bool|null $decorated Whether to decorate messages (null for auto-guessing) - * @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter) - * - * @throws InvalidArgumentException When first argument is not a real stream - */ - public function __construct($stream, int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = null, OutputFormatterInterface $formatter = null) - { - if (!\is_resource($stream) || 'stream' !== get_resource_type($stream)) { - throw new InvalidArgumentException('The StreamOutput class needs a stream as its first argument.'); - } - - $this->stream = $stream; - - if (null === $decorated) { - $decorated = $this->hasColorSupport(); - } - - parent::__construct($verbosity, $decorated, $formatter); - } - - /** - * Gets the stream attached to this StreamOutput instance. - * - * @return resource A stream resource - */ - public function getStream() - { - return $this->stream; - } - - /** - * {@inheritdoc} - */ - protected function doWrite($message, $newline) - { - if ($newline) { - $message .= \PHP_EOL; - } - - @fwrite($this->stream, $message); - - fflush($this->stream); - } - - /** - * Returns true if the stream supports colorization. - * - * Colorization is disabled if not supported by the stream: - * - * This is tricky on Windows, because Cygwin, Msys2 etc emulate pseudo - * terminals via named pipes, so we can only check the environment. - * - * Reference: Composer\XdebugHandler\Process::supportsColor - * https://github.com/composer/xdebug-handler - * - * @return bool true if the stream supports colorization, false otherwise - */ - protected function hasColorSupport() - { - // Follow https://no-color.org/ - if (isset($_SERVER['NO_COLOR']) || false !== getenv('NO_COLOR')) { - return false; - } - - if ('Hyper' === getenv('TERM_PROGRAM')) { - return true; - } - - if (\DIRECTORY_SEPARATOR === '\\') { - return (\function_exists('sapi_windows_vt100_support') - && @sapi_windows_vt100_support($this->stream)) - || false !== getenv('ANSICON') - || 'ON' === getenv('ConEmuANSI') - || 'xterm' === getenv('TERM'); - } - - if (\function_exists('stream_isatty')) { - return @stream_isatty($this->stream); - } - - if (\function_exists('posix_isatty')) { - return @posix_isatty($this->stream); - } - - $stat = @fstat($this->stream); - // Check if formatted mode is S_IFCHR - return $stat ? 0020000 === ($stat['mode'] & 0170000) : false; - } -} diff --git a/vendor/symfony/console/Output/TrimmedBufferOutput.php b/vendor/symfony/console/Output/TrimmedBufferOutput.php deleted file mode 100644 index 87c04a8..0000000 --- a/vendor/symfony/console/Output/TrimmedBufferOutput.php +++ /dev/null @@ -1,63 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Formatter\OutputFormatterInterface; - -/** - * A BufferedOutput that keeps only the last N chars. - * - * @author Jérémy Derussé - */ -class TrimmedBufferOutput extends Output -{ - private $maxLength; - private $buffer = ''; - - public function __construct(int $maxLength, ?int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = false, OutputFormatterInterface $formatter = null) - { - if ($maxLength <= 0) { - throw new InvalidArgumentException(sprintf('"%s()" expects a strictly positive maxLength. Got %d.', __METHOD__, $maxLength)); - } - - parent::__construct($verbosity, $decorated, $formatter); - $this->maxLength = $maxLength; - } - - /** - * Empties buffer and returns its content. - * - * @return string - */ - public function fetch() - { - $content = $this->buffer; - $this->buffer = ''; - - return $content; - } - - /** - * {@inheritdoc} - */ - protected function doWrite($message, $newline) - { - $this->buffer .= $message; - - if ($newline) { - $this->buffer .= \PHP_EOL; - } - - $this->buffer = substr($this->buffer, 0 - $this->maxLength); - } -} diff --git a/vendor/symfony/console/Question/ChoiceQuestion.php b/vendor/symfony/console/Question/ChoiceQuestion.php deleted file mode 100644 index 72703fb..0000000 --- a/vendor/symfony/console/Question/ChoiceQuestion.php +++ /dev/null @@ -1,188 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Question; - -use Symfony\Component\Console\Exception\InvalidArgumentException; - -/** - * Represents a choice question. - * - * @author Fabien Potencier - */ -class ChoiceQuestion extends Question -{ - private $choices; - private $multiselect = false; - private $prompt = ' > '; - private $errorMessage = 'Value "%s" is invalid'; - - /** - * @param string $question The question to ask to the user - * @param array $choices The list of available choices - * @param mixed $default The default answer to return - */ - public function __construct(string $question, array $choices, $default = null) - { - if (!$choices) { - throw new \LogicException('Choice question must have at least 1 choice available.'); - } - - parent::__construct($question, $default); - - $this->choices = $choices; - $this->setValidator($this->getDefaultValidator()); - $this->setAutocompleterValues($choices); - } - - /** - * Returns available choices. - * - * @return array - */ - public function getChoices() - { - return $this->choices; - } - - /** - * Sets multiselect option. - * - * When multiselect is set to true, multiple choices can be answered. - * - * @param bool $multiselect - * - * @return $this - */ - public function setMultiselect($multiselect) - { - $this->multiselect = $multiselect; - $this->setValidator($this->getDefaultValidator()); - - return $this; - } - - /** - * Returns whether the choices are multiselect. - * - * @return bool - */ - public function isMultiselect() - { - return $this->multiselect; - } - - /** - * Gets the prompt for choices. - * - * @return string - */ - public function getPrompt() - { - return $this->prompt; - } - - /** - * Sets the prompt for choices. - * - * @param string $prompt - * - * @return $this - */ - public function setPrompt($prompt) - { - $this->prompt = $prompt; - - return $this; - } - - /** - * Sets the error message for invalid values. - * - * The error message has a string placeholder (%s) for the invalid value. - * - * @param string $errorMessage - * - * @return $this - */ - public function setErrorMessage($errorMessage) - { - $this->errorMessage = $errorMessage; - $this->setValidator($this->getDefaultValidator()); - - return $this; - } - - private function getDefaultValidator(): callable - { - $choices = $this->choices; - $errorMessage = $this->errorMessage; - $multiselect = $this->multiselect; - $isAssoc = $this->isAssoc($choices); - - return function ($selected) use ($choices, $errorMessage, $multiselect, $isAssoc) { - if ($multiselect) { - // Check for a separated comma values - if (!preg_match('/^[^,]+(?:,[^,]+)*$/', $selected, $matches)) { - throw new InvalidArgumentException(sprintf($errorMessage, $selected)); - } - - $selectedChoices = explode(',', $selected); - } else { - $selectedChoices = [$selected]; - } - - if ($this->isTrimmable()) { - foreach ($selectedChoices as $k => $v) { - $selectedChoices[$k] = trim($v); - } - } - - $multiselectChoices = []; - foreach ($selectedChoices as $value) { - $results = []; - foreach ($choices as $key => $choice) { - if ($choice === $value) { - $results[] = $key; - } - } - - if (\count($results) > 1) { - throw new InvalidArgumentException(sprintf('The provided answer is ambiguous. Value should be one of "%s".', implode('" or "', $results))); - } - - $result = array_search($value, $choices); - - if (!$isAssoc) { - if (false !== $result) { - $result = $choices[$result]; - } elseif (isset($choices[$value])) { - $result = $choices[$value]; - } - } elseif (false === $result && isset($choices[$value])) { - $result = $value; - } - - if (false === $result) { - throw new InvalidArgumentException(sprintf($errorMessage, $value)); - } - - $multiselectChoices[] = (string) $result; - } - - if ($multiselect) { - return $multiselectChoices; - } - - return current($multiselectChoices); - }; - } -} diff --git a/vendor/symfony/console/Question/ConfirmationQuestion.php b/vendor/symfony/console/Question/ConfirmationQuestion.php deleted file mode 100644 index 4228521..0000000 --- a/vendor/symfony/console/Question/ConfirmationQuestion.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Question; - -/** - * Represents a yes/no question. - * - * @author Fabien Potencier - */ -class ConfirmationQuestion extends Question -{ - private $trueAnswerRegex; - - /** - * @param string $question The question to ask to the user - * @param bool $default The default answer to return, true or false - * @param string $trueAnswerRegex A regex to match the "yes" answer - */ - public function __construct(string $question, bool $default = true, string $trueAnswerRegex = '/^y/i') - { - parent::__construct($question, $default); - - $this->trueAnswerRegex = $trueAnswerRegex; - $this->setNormalizer($this->getDefaultNormalizer()); - } - - /** - * Returns the default answer normalizer. - */ - private function getDefaultNormalizer(): callable - { - $default = $this->getDefault(); - $regex = $this->trueAnswerRegex; - - return function ($answer) use ($default, $regex) { - if (\is_bool($answer)) { - return $answer; - } - - $answerIsTrue = (bool) preg_match($regex, $answer); - if (false === $default) { - return $answer && $answerIsTrue; - } - - return '' === $answer || $answerIsTrue; - }; - } -} diff --git a/vendor/symfony/console/Question/Question.php b/vendor/symfony/console/Question/Question.php deleted file mode 100644 index cc10801..0000000 --- a/vendor/symfony/console/Question/Question.php +++ /dev/null @@ -1,292 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Question; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\LogicException; - -/** - * Represents a Question. - * - * @author Fabien Potencier - */ -class Question -{ - private $question; - private $attempts; - private $hidden = false; - private $hiddenFallback = true; - private $autocompleterCallback; - private $validator; - private $default; - private $normalizer; - private $trimmable = true; - - /** - * @param string $question The question to ask to the user - * @param string|bool|int|float|null $default The default answer to return if the user enters nothing - */ - public function __construct(string $question, $default = null) - { - $this->question = $question; - $this->default = $default; - } - - /** - * Returns the question. - * - * @return string - */ - public function getQuestion() - { - return $this->question; - } - - /** - * Returns the default answer. - * - * @return string|bool|int|float|null - */ - public function getDefault() - { - return $this->default; - } - - /** - * Returns whether the user response must be hidden. - * - * @return bool - */ - public function isHidden() - { - return $this->hidden; - } - - /** - * Sets whether the user response must be hidden or not. - * - * @param bool $hidden - * - * @return $this - * - * @throws LogicException In case the autocompleter is also used - */ - public function setHidden($hidden) - { - if ($this->autocompleterCallback) { - throw new LogicException('A hidden question cannot use the autocompleter.'); - } - - $this->hidden = (bool) $hidden; - - return $this; - } - - /** - * In case the response can not be hidden, whether to fallback on non-hidden question or not. - * - * @return bool - */ - public function isHiddenFallback() - { - return $this->hiddenFallback; - } - - /** - * Sets whether to fallback on non-hidden question if the response can not be hidden. - * - * @param bool $fallback - * - * @return $this - */ - public function setHiddenFallback($fallback) - { - $this->hiddenFallback = (bool) $fallback; - - return $this; - } - - /** - * Gets values for the autocompleter. - * - * @return iterable|null - */ - public function getAutocompleterValues() - { - $callback = $this->getAutocompleterCallback(); - - return $callback ? $callback('') : null; - } - - /** - * Sets values for the autocompleter. - * - * @param iterable|null $values - * - * @return $this - * - * @throws InvalidArgumentException - * @throws LogicException - */ - public function setAutocompleterValues($values) - { - if (\is_array($values)) { - $values = $this->isAssoc($values) ? array_merge(array_keys($values), array_values($values)) : array_values($values); - - $callback = static function () use ($values) { - return $values; - }; - } elseif ($values instanceof \Traversable) { - $valueCache = null; - $callback = static function () use ($values, &$valueCache) { - return $valueCache ?? $valueCache = iterator_to_array($values, false); - }; - } elseif (null === $values) { - $callback = null; - } else { - throw new InvalidArgumentException('Autocompleter values can be either an array, "null" or a "Traversable" object.'); - } - - return $this->setAutocompleterCallback($callback); - } - - /** - * Gets the callback function used for the autocompleter. - */ - public function getAutocompleterCallback(): ?callable - { - return $this->autocompleterCallback; - } - - /** - * Sets the callback function used for the autocompleter. - * - * The callback is passed the user input as argument and should return an iterable of corresponding suggestions. - * - * @return $this - */ - public function setAutocompleterCallback(callable $callback = null): self - { - if ($this->hidden && null !== $callback) { - throw new LogicException('A hidden question cannot use the autocompleter.'); - } - - $this->autocompleterCallback = $callback; - - return $this; - } - - /** - * Sets a validator for the question. - * - * @return $this - */ - public function setValidator(callable $validator = null) - { - $this->validator = $validator; - - return $this; - } - - /** - * Gets the validator for the question. - * - * @return callable|null - */ - public function getValidator() - { - return $this->validator; - } - - /** - * Sets the maximum number of attempts. - * - * Null means an unlimited number of attempts. - * - * @param int|null $attempts - * - * @return $this - * - * @throws InvalidArgumentException in case the number of attempts is invalid - */ - public function setMaxAttempts($attempts) - { - if (null !== $attempts) { - $attempts = (int) $attempts; - if ($attempts < 1) { - throw new InvalidArgumentException('Maximum number of attempts must be a positive value.'); - } - } - - $this->attempts = $attempts; - - return $this; - } - - /** - * Gets the maximum number of attempts. - * - * Null means an unlimited number of attempts. - * - * @return int|null - */ - public function getMaxAttempts() - { - return $this->attempts; - } - - /** - * Sets a normalizer for the response. - * - * The normalizer can be a callable (a string), a closure or a class implementing __invoke. - * - * @return $this - */ - public function setNormalizer(callable $normalizer) - { - $this->normalizer = $normalizer; - - return $this; - } - - /** - * Gets the normalizer for the response. - * - * The normalizer can ba a callable (a string), a closure or a class implementing __invoke. - * - * @return callable|null - */ - public function getNormalizer() - { - return $this->normalizer; - } - - protected function isAssoc($array) - { - return (bool) \count(array_filter(array_keys($array), 'is_string')); - } - - public function isTrimmable(): bool - { - return $this->trimmable; - } - - /** - * @return $this - */ - public function setTrimmable(bool $trimmable): self - { - $this->trimmable = $trimmable; - - return $this; - } -} diff --git a/vendor/symfony/console/README.md b/vendor/symfony/console/README.md deleted file mode 100644 index c89b4a1..0000000 --- a/vendor/symfony/console/README.md +++ /dev/null @@ -1,20 +0,0 @@ -Console Component -================= - -The Console component eases the creation of beautiful and testable command line -interfaces. - -Resources ---------- - - * [Documentation](https://symfony.com/doc/current/components/console.html) - * [Contributing](https://symfony.com/doc/current/contributing/index.html) - * [Report issues](https://github.com/symfony/symfony/issues) and - [send Pull Requests](https://github.com/symfony/symfony/pulls) - in the [main Symfony repository](https://github.com/symfony/symfony) - -Credits -------- - -`Resources/bin/hiddeninput.exe` is a third party binary provided within this -component. Find sources and license at https://github.com/Seldaek/hidden-input. diff --git a/vendor/symfony/console/Resources/bin/hiddeninput.exe b/vendor/symfony/console/Resources/bin/hiddeninput.exe deleted file mode 100644 index c8cf65e..0000000 Binary files a/vendor/symfony/console/Resources/bin/hiddeninput.exe and /dev/null differ diff --git a/vendor/symfony/console/Style/OutputStyle.php b/vendor/symfony/console/Style/OutputStyle.php deleted file mode 100644 index 14d2d60..0000000 --- a/vendor/symfony/console/Style/OutputStyle.php +++ /dev/null @@ -1,155 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Style; - -use Symfony\Component\Console\Formatter\OutputFormatterInterface; -use Symfony\Component\Console\Helper\ProgressBar; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Decorates output to add console style guide helpers. - * - * @author Kevin Bond - */ -abstract class OutputStyle implements OutputInterface, StyleInterface -{ - private $output; - - public function __construct(OutputInterface $output) - { - $this->output = $output; - } - - /** - * {@inheritdoc} - */ - public function newLine($count = 1) - { - $this->output->write(str_repeat(\PHP_EOL, $count)); - } - - /** - * @param int $max - * - * @return ProgressBar - */ - public function createProgressBar($max = 0) - { - return new ProgressBar($this->output, $max); - } - - /** - * {@inheritdoc} - */ - public function write($messages, $newline = false, $type = self::OUTPUT_NORMAL) - { - $this->output->write($messages, $newline, $type); - } - - /** - * {@inheritdoc} - */ - public function writeln($messages, $type = self::OUTPUT_NORMAL) - { - $this->output->writeln($messages, $type); - } - - /** - * {@inheritdoc} - */ - public function setVerbosity($level) - { - $this->output->setVerbosity($level); - } - - /** - * {@inheritdoc} - */ - public function getVerbosity() - { - return $this->output->getVerbosity(); - } - - /** - * {@inheritdoc} - */ - public function setDecorated($decorated) - { - $this->output->setDecorated($decorated); - } - - /** - * {@inheritdoc} - */ - public function isDecorated() - { - return $this->output->isDecorated(); - } - - /** - * {@inheritdoc} - */ - public function setFormatter(OutputFormatterInterface $formatter) - { - $this->output->setFormatter($formatter); - } - - /** - * {@inheritdoc} - */ - public function getFormatter() - { - return $this->output->getFormatter(); - } - - /** - * {@inheritdoc} - */ - public function isQuiet() - { - return $this->output->isQuiet(); - } - - /** - * {@inheritdoc} - */ - public function isVerbose() - { - return $this->output->isVerbose(); - } - - /** - * {@inheritdoc} - */ - public function isVeryVerbose() - { - return $this->output->isVeryVerbose(); - } - - /** - * {@inheritdoc} - */ - public function isDebug() - { - return $this->output->isDebug(); - } - - protected function getErrorOutput() - { - if (!$this->output instanceof ConsoleOutputInterface) { - return $this->output; - } - - return $this->output->getErrorOutput(); - } -} diff --git a/vendor/symfony/console/Style/StyleInterface.php b/vendor/symfony/console/Style/StyleInterface.php deleted file mode 100644 index 3b5b8af..0000000 --- a/vendor/symfony/console/Style/StyleInterface.php +++ /dev/null @@ -1,153 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Style; - -/** - * Output style helpers. - * - * @author Kevin Bond - */ -interface StyleInterface -{ - /** - * Formats a command title. - * - * @param string $message - */ - public function title($message); - - /** - * Formats a section title. - * - * @param string $message - */ - public function section($message); - - /** - * Formats a list. - */ - public function listing(array $elements); - - /** - * Formats informational text. - * - * @param string|array $message - */ - public function text($message); - - /** - * Formats a success result bar. - * - * @param string|array $message - */ - public function success($message); - - /** - * Formats an error result bar. - * - * @param string|array $message - */ - public function error($message); - - /** - * Formats an warning result bar. - * - * @param string|array $message - */ - public function warning($message); - - /** - * Formats a note admonition. - * - * @param string|array $message - */ - public function note($message); - - /** - * Formats a caution admonition. - * - * @param string|array $message - */ - public function caution($message); - - /** - * Formats a table. - */ - public function table(array $headers, array $rows); - - /** - * Asks a question. - * - * @param string $question - * @param string|null $default - * @param callable|null $validator - * - * @return mixed - */ - public function ask($question, $default = null, $validator = null); - - /** - * Asks a question with the user input hidden. - * - * @param string $question - * @param callable|null $validator - * - * @return mixed - */ - public function askHidden($question, $validator = null); - - /** - * Asks for confirmation. - * - * @param string $question - * @param bool $default - * - * @return bool - */ - public function confirm($question, $default = true); - - /** - * Asks a choice question. - * - * @param string $question - * @param string|int|null $default - * - * @return mixed - */ - public function choice($question, array $choices, $default = null); - - /** - * Add newline(s). - * - * @param int $count The number of newlines - */ - public function newLine($count = 1); - - /** - * Starts the progress output. - * - * @param int $max Maximum steps (0 if unknown) - */ - public function progressStart($max = 0); - - /** - * Advances the progress output X steps. - * - * @param int $step Number of steps to advance - */ - public function progressAdvance($step = 1); - - /** - * Finishes the progress output. - */ - public function progressFinish(); -} diff --git a/vendor/symfony/console/Style/SymfonyStyle.php b/vendor/symfony/console/Style/SymfonyStyle.php deleted file mode 100644 index 66db3ad..0000000 --- a/vendor/symfony/console/Style/SymfonyStyle.php +++ /dev/null @@ -1,508 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Style; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\RuntimeException; -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Helper\Helper; -use Symfony\Component\Console\Helper\ProgressBar; -use Symfony\Component\Console\Helper\SymfonyQuestionHelper; -use Symfony\Component\Console\Helper\Table; -use Symfony\Component\Console\Helper\TableCell; -use Symfony\Component\Console\Helper\TableSeparator; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Output\TrimmedBufferOutput; -use Symfony\Component\Console\Question\ChoiceQuestion; -use Symfony\Component\Console\Question\ConfirmationQuestion; -use Symfony\Component\Console\Question\Question; -use Symfony\Component\Console\Terminal; - -/** - * Output decorator helpers for the Symfony Style Guide. - * - * @author Kevin Bond - */ -class SymfonyStyle extends OutputStyle -{ - public const MAX_LINE_LENGTH = 120; - - private $input; - private $questionHelper; - private $progressBar; - private $lineLength; - private $bufferedOutput; - - public function __construct(InputInterface $input, OutputInterface $output) - { - $this->input = $input; - $this->bufferedOutput = new TrimmedBufferOutput(\DIRECTORY_SEPARATOR === '\\' ? 4 : 2, $output->getVerbosity(), false, clone $output->getFormatter()); - // Windows cmd wraps lines as soon as the terminal width is reached, whether there are following chars or not. - $width = (new Terminal())->getWidth() ?: self::MAX_LINE_LENGTH; - $this->lineLength = min($width - (int) (\DIRECTORY_SEPARATOR === '\\'), self::MAX_LINE_LENGTH); - - parent::__construct($output); - } - - /** - * Formats a message as a block of text. - * - * @param string|array $messages The message to write in the block - * @param string|null $type The block type (added in [] on first line) - * @param string|null $style The style to apply to the whole block - * @param string $prefix The prefix for the block - * @param bool $padding Whether to add vertical padding - * @param bool $escape Whether to escape the message - */ - public function block($messages, $type = null, $style = null, $prefix = ' ', $padding = false, $escape = true) - { - $messages = \is_array($messages) ? array_values($messages) : [$messages]; - - $this->autoPrependBlock(); - $this->writeln($this->createBlock($messages, $type, $style, $prefix, $padding, $escape)); - $this->newLine(); - } - - /** - * {@inheritdoc} - */ - public function title($message) - { - $this->autoPrependBlock(); - $this->writeln([ - sprintf('%s', OutputFormatter::escapeTrailingBackslash($message)), - sprintf('%s', str_repeat('=', Helper::strlenWithoutDecoration($this->getFormatter(), $message))), - ]); - $this->newLine(); - } - - /** - * {@inheritdoc} - */ - public function section($message) - { - $this->autoPrependBlock(); - $this->writeln([ - sprintf('%s', OutputFormatter::escapeTrailingBackslash($message)), - sprintf('%s', str_repeat('-', Helper::strlenWithoutDecoration($this->getFormatter(), $message))), - ]); - $this->newLine(); - } - - /** - * {@inheritdoc} - */ - public function listing(array $elements) - { - $this->autoPrependText(); - $elements = array_map(function ($element) { - return sprintf(' * %s', $element); - }, $elements); - - $this->writeln($elements); - $this->newLine(); - } - - /** - * {@inheritdoc} - */ - public function text($message) - { - $this->autoPrependText(); - - $messages = \is_array($message) ? array_values($message) : [$message]; - foreach ($messages as $message) { - $this->writeln(sprintf(' %s', $message)); - } - } - - /** - * Formats a command comment. - * - * @param string|array $message - */ - public function comment($message) - { - $this->block($message, null, null, ' // ', false, false); - } - - /** - * {@inheritdoc} - */ - public function success($message) - { - $this->block($message, 'OK', 'fg=black;bg=green', ' ', true); - } - - /** - * {@inheritdoc} - */ - public function error($message) - { - $this->block($message, 'ERROR', 'fg=white;bg=red', ' ', true); - } - - /** - * {@inheritdoc} - */ - public function warning($message) - { - $this->block($message, 'WARNING', 'fg=black;bg=yellow', ' ', true); - } - - /** - * {@inheritdoc} - */ - public function note($message) - { - $this->block($message, 'NOTE', 'fg=yellow', ' ! '); - } - - /** - * {@inheritdoc} - */ - public function caution($message) - { - $this->block($message, 'CAUTION', 'fg=white;bg=red', ' ! ', true); - } - - /** - * {@inheritdoc} - */ - public function table(array $headers, array $rows) - { - $style = clone Table::getStyleDefinition('symfony-style-guide'); - $style->setCellHeaderFormat('%s'); - - $table = new Table($this); - $table->setHeaders($headers); - $table->setRows($rows); - $table->setStyle($style); - - $table->render(); - $this->newLine(); - } - - /** - * Formats a horizontal table. - */ - public function horizontalTable(array $headers, array $rows) - { - $style = clone Table::getStyleDefinition('symfony-style-guide'); - $style->setCellHeaderFormat('%s'); - - $table = new Table($this); - $table->setHeaders($headers); - $table->setRows($rows); - $table->setStyle($style); - $table->setHorizontal(true); - - $table->render(); - $this->newLine(); - } - - /** - * Formats a list of key/value horizontally. - * - * Each row can be one of: - * * 'A title' - * * ['key' => 'value'] - * * new TableSeparator() - * - * @param string|array|TableSeparator ...$list - */ - public function definitionList(...$list) - { - $style = clone Table::getStyleDefinition('symfony-style-guide'); - $style->setCellHeaderFormat('%s'); - - $table = new Table($this); - $headers = []; - $row = []; - foreach ($list as $value) { - if ($value instanceof TableSeparator) { - $headers[] = $value; - $row[] = $value; - continue; - } - if (\is_string($value)) { - $headers[] = new TableCell($value, ['colspan' => 2]); - $row[] = null; - continue; - } - if (!\is_array($value)) { - throw new InvalidArgumentException('Value should be an array, string, or an instance of TableSeparator.'); - } - $headers[] = key($value); - $row[] = current($value); - } - - $table->setHeaders($headers); - $table->setRows([$row]); - $table->setHorizontal(); - $table->setStyle($style); - - $table->render(); - $this->newLine(); - } - - /** - * {@inheritdoc} - */ - public function ask($question, $default = null, $validator = null) - { - $question = new Question($question, $default); - $question->setValidator($validator); - - return $this->askQuestion($question); - } - - /** - * {@inheritdoc} - */ - public function askHidden($question, $validator = null) - { - $question = new Question($question); - - $question->setHidden(true); - $question->setValidator($validator); - - return $this->askQuestion($question); - } - - /** - * {@inheritdoc} - */ - public function confirm($question, $default = true) - { - return $this->askQuestion(new ConfirmationQuestion($question, $default)); - } - - /** - * {@inheritdoc} - */ - public function choice($question, array $choices, $default = null) - { - if (null !== $default) { - $values = array_flip($choices); - $default = $values[$default] ?? $default; - } - - return $this->askQuestion(new ChoiceQuestion($question, $choices, $default)); - } - - /** - * {@inheritdoc} - */ - public function progressStart($max = 0) - { - $this->progressBar = $this->createProgressBar($max); - $this->progressBar->start(); - } - - /** - * {@inheritdoc} - */ - public function progressAdvance($step = 1) - { - $this->getProgressBar()->advance($step); - } - - /** - * {@inheritdoc} - */ - public function progressFinish() - { - $this->getProgressBar()->finish(); - $this->newLine(2); - $this->progressBar = null; - } - - /** - * {@inheritdoc} - */ - public function createProgressBar($max = 0) - { - $progressBar = parent::createProgressBar($max); - - if ('\\' !== \DIRECTORY_SEPARATOR || 'Hyper' === getenv('TERM_PROGRAM')) { - $progressBar->setEmptyBarCharacter('░'); // light shade character \u2591 - $progressBar->setProgressCharacter(''); - $progressBar->setBarCharacter('▓'); // dark shade character \u2593 - } - - return $progressBar; - } - - /** - * @return mixed - */ - public function askQuestion(Question $question) - { - if ($this->input->isInteractive()) { - $this->autoPrependBlock(); - } - - if (!$this->questionHelper) { - $this->questionHelper = new SymfonyQuestionHelper(); - } - - $answer = $this->questionHelper->ask($this->input, $this, $question); - - if ($this->input->isInteractive()) { - $this->newLine(); - $this->bufferedOutput->write("\n"); - } - - return $answer; - } - - /** - * {@inheritdoc} - */ - public function writeln($messages, $type = self::OUTPUT_NORMAL) - { - if (!is_iterable($messages)) { - $messages = [$messages]; - } - - foreach ($messages as $message) { - parent::writeln($message, $type); - $this->writeBuffer($message, true, $type); - } - } - - /** - * {@inheritdoc} - */ - public function write($messages, $newline = false, $type = self::OUTPUT_NORMAL) - { - if (!is_iterable($messages)) { - $messages = [$messages]; - } - - foreach ($messages as $message) { - parent::write($message, $newline, $type); - $this->writeBuffer($message, $newline, $type); - } - } - - /** - * {@inheritdoc} - */ - public function newLine($count = 1) - { - parent::newLine($count); - $this->bufferedOutput->write(str_repeat("\n", $count)); - } - - /** - * Returns a new instance which makes use of stderr if available. - * - * @return self - */ - public function getErrorStyle() - { - return new self($this->input, $this->getErrorOutput()); - } - - private function getProgressBar(): ProgressBar - { - if (!$this->progressBar) { - throw new RuntimeException('The ProgressBar is not started.'); - } - - return $this->progressBar; - } - - private function autoPrependBlock(): void - { - $chars = substr(str_replace(\PHP_EOL, "\n", $this->bufferedOutput->fetch()), -2); - - if (!isset($chars[0])) { - $this->newLine(); //empty history, so we should start with a new line. - - return; - } - //Prepend new line for each non LF chars (This means no blank line was output before) - $this->newLine(2 - substr_count($chars, "\n")); - } - - private function autoPrependText(): void - { - $fetched = $this->bufferedOutput->fetch(); - //Prepend new line if last char isn't EOL: - if (!str_ends_with($fetched, "\n")) { - $this->newLine(); - } - } - - private function writeBuffer(string $message, bool $newLine, int $type): void - { - // We need to know if the last chars are PHP_EOL - $this->bufferedOutput->write($message, $newLine, $type); - } - - private function createBlock(iterable $messages, string $type = null, string $style = null, string $prefix = ' ', bool $padding = false, bool $escape = false): array - { - $indentLength = 0; - $prefixLength = Helper::strlenWithoutDecoration($this->getFormatter(), $prefix); - $lines = []; - - if (null !== $type) { - $type = sprintf('[%s] ', $type); - $indentLength = \strlen($type); - $lineIndentation = str_repeat(' ', $indentLength); - } - - // wrap and add newlines for each element - foreach ($messages as $key => $message) { - if ($escape) { - $message = OutputFormatter::escape($message); - } - - $decorationLength = Helper::strlen($message) - Helper::strlenWithoutDecoration($this->getFormatter(), $message); - $messageLineLength = min($this->lineLength - $prefixLength - $indentLength + $decorationLength, $this->lineLength); - $messageLines = explode(\PHP_EOL, wordwrap($message, $messageLineLength, \PHP_EOL, true)); - foreach ($messageLines as $messageLine) { - $lines[] = $messageLine; - } - - if (\count($messages) > 1 && $key < \count($messages) - 1) { - $lines[] = ''; - } - } - - $firstLineIndex = 0; - if ($padding && $this->isDecorated()) { - $firstLineIndex = 1; - array_unshift($lines, ''); - $lines[] = ''; - } - - foreach ($lines as $i => &$line) { - if (null !== $type) { - $line = $firstLineIndex === $i ? $type.$line : $lineIndentation.$line; - } - - $line = $prefix.$line; - $line .= str_repeat(' ', max($this->lineLength - Helper::strlenWithoutDecoration($this->getFormatter(), $line), 0)); - - if ($style) { - $line = sprintf('<%s>%s', $style, $line); - } - } - - return $lines; - } -} diff --git a/vendor/symfony/console/Terminal.php b/vendor/symfony/console/Terminal.php deleted file mode 100644 index 5e5a3c2..0000000 --- a/vendor/symfony/console/Terminal.php +++ /dev/null @@ -1,174 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console; - -class Terminal -{ - private static $width; - private static $height; - private static $stty; - - /** - * Gets the terminal width. - * - * @return int - */ - public function getWidth() - { - $width = getenv('COLUMNS'); - if (false !== $width) { - return (int) trim($width); - } - - if (null === self::$width) { - self::initDimensions(); - } - - return self::$width ?: 80; - } - - /** - * Gets the terminal height. - * - * @return int - */ - public function getHeight() - { - $height = getenv('LINES'); - if (false !== $height) { - return (int) trim($height); - } - - if (null === self::$height) { - self::initDimensions(); - } - - return self::$height ?: 50; - } - - /** - * @internal - * - * @return bool - */ - public static function hasSttyAvailable() - { - if (null !== self::$stty) { - return self::$stty; - } - - // skip check if exec function is disabled - if (!\function_exists('exec')) { - return false; - } - - exec('stty 2>&1', $output, $exitcode); - - return self::$stty = 0 === $exitcode; - } - - private static function initDimensions() - { - if ('\\' === \DIRECTORY_SEPARATOR) { - if (preg_match('/^(\d+)x(\d+)(?: \((\d+)x(\d+)\))?$/', trim(getenv('ANSICON')), $matches)) { - // extract [w, H] from "wxh (WxH)" - // or [w, h] from "wxh" - self::$width = (int) $matches[1]; - self::$height = isset($matches[4]) ? (int) $matches[4] : (int) $matches[2]; - } elseif (!self::hasVt100Support() && self::hasSttyAvailable()) { - // only use stty on Windows if the terminal does not support vt100 (e.g. Windows 7 + git-bash) - // testing for stty in a Windows 10 vt100-enabled console will implicitly disable vt100 support on STDOUT - self::initDimensionsUsingStty(); - } elseif (null !== $dimensions = self::getConsoleMode()) { - // extract [w, h] from "wxh" - self::$width = (int) $dimensions[0]; - self::$height = (int) $dimensions[1]; - } - } else { - self::initDimensionsUsingStty(); - } - } - - /** - * Returns whether STDOUT has vt100 support (some Windows 10+ configurations). - */ - private static function hasVt100Support(): bool - { - return \function_exists('sapi_windows_vt100_support') && sapi_windows_vt100_support(fopen('php://stdout', 'w')); - } - - /** - * Initializes dimensions using the output of an stty columns line. - */ - private static function initDimensionsUsingStty() - { - if ($sttyString = self::getSttyColumns()) { - if (preg_match('/rows.(\d+);.columns.(\d+);/i', $sttyString, $matches)) { - // extract [w, h] from "rows h; columns w;" - self::$width = (int) $matches[2]; - self::$height = (int) $matches[1]; - } elseif (preg_match('/;.(\d+).rows;.(\d+).columns/i', $sttyString, $matches)) { - // extract [w, h] from "; h rows; w columns" - self::$width = (int) $matches[2]; - self::$height = (int) $matches[1]; - } - } - } - - /** - * Runs and parses mode CON if it's available, suppressing any error output. - * - * @return int[]|null An array composed of the width and the height or null if it could not be parsed - */ - private static function getConsoleMode(): ?array - { - $info = self::readFromProcess('mode CON'); - - if (null === $info || !preg_match('/--------+\r?\n.+?(\d+)\r?\n.+?(\d+)\r?\n/', $info, $matches)) { - return null; - } - - return [(int) $matches[2], (int) $matches[1]]; - } - - /** - * Runs and parses stty -a if it's available, suppressing any error output. - */ - private static function getSttyColumns(): ?string - { - return self::readFromProcess('stty -a | grep columns'); - } - - private static function readFromProcess(string $command): ?string - { - if (!\function_exists('proc_open')) { - return null; - } - - $descriptorspec = [ - 1 => ['pipe', 'w'], - 2 => ['pipe', 'w'], - ]; - - $process = proc_open($command, $descriptorspec, $pipes, null, null, ['suppress_errors' => true]); - if (!\is_resource($process)) { - return null; - } - - $info = stream_get_contents($pipes[1]); - fclose($pipes[1]); - fclose($pipes[2]); - proc_close($process); - - return $info; - } -} diff --git a/vendor/symfony/console/Tester/ApplicationTester.php b/vendor/symfony/console/Tester/ApplicationTester.php deleted file mode 100644 index 4f99da1..0000000 --- a/vendor/symfony/console/Tester/ApplicationTester.php +++ /dev/null @@ -1,70 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tester; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Input\ArrayInput; - -/** - * Eases the testing of console applications. - * - * When testing an application, don't forget to disable the auto exit flag: - * - * $application = new Application(); - * $application->setAutoExit(false); - * - * @author Fabien Potencier - */ -class ApplicationTester -{ - use TesterTrait; - - private $application; - private $input; - private $statusCode; - - public function __construct(Application $application) - { - $this->application = $application; - } - - /** - * Executes the application. - * - * Available options: - * - * * interactive: Sets the input interactive flag - * * decorated: Sets the output decorated flag - * * verbosity: Sets the output verbosity flag - * * capture_stderr_separately: Make output of stdOut and stdErr separately available - * - * @param array $input An array of arguments and options - * @param array $options An array of options - * - * @return int The command exit code - */ - public function run(array $input, $options = []) - { - $this->input = new ArrayInput($input); - if (isset($options['interactive'])) { - $this->input->setInteractive($options['interactive']); - } - - if ($this->inputs) { - $this->input->setStream(self::createStream($this->inputs)); - } - - $this->initOutput($options); - - return $this->statusCode = $this->application->run($this->input, $this->output); - } -} diff --git a/vendor/symfony/console/Tester/CommandTester.php b/vendor/symfony/console/Tester/CommandTester.php deleted file mode 100644 index 57efc9a..0000000 --- a/vendor/symfony/console/Tester/CommandTester.php +++ /dev/null @@ -1,78 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tester; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\ArrayInput; - -/** - * Eases the testing of console commands. - * - * @author Fabien Potencier - * @author Robin Chalas - */ -class CommandTester -{ - use TesterTrait; - - private $command; - private $input; - private $statusCode; - - public function __construct(Command $command) - { - $this->command = $command; - } - - /** - * Executes the command. - * - * Available execution options: - * - * * interactive: Sets the input interactive flag - * * decorated: Sets the output decorated flag - * * verbosity: Sets the output verbosity flag - * * capture_stderr_separately: Make output of stdOut and stdErr separately available - * - * @param array $input An array of command arguments and options - * @param array $options An array of execution options - * - * @return int The command exit code - */ - public function execute(array $input, array $options = []) - { - // set the command name automatically if the application requires - // this argument and no command name was passed - if (!isset($input['command']) - && (null !== $application = $this->command->getApplication()) - && $application->getDefinition()->hasArgument('command') - ) { - $input = array_merge(['command' => $this->command->getName()], $input); - } - - $this->input = new ArrayInput($input); - // Use an in-memory input stream even if no inputs are set so that QuestionHelper::ask() does not rely on the blocking STDIN. - $this->input->setStream(self::createStream($this->inputs)); - - if (isset($options['interactive'])) { - $this->input->setInteractive($options['interactive']); - } - - if (!isset($options['decorated'])) { - $options['decorated'] = false; - } - - $this->initOutput($options); - - return $this->statusCode = $this->command->run($this->input, $this->output); - } -} diff --git a/vendor/symfony/console/Tester/TesterTrait.php b/vendor/symfony/console/Tester/TesterTrait.php deleted file mode 100644 index 27d5985..0000000 --- a/vendor/symfony/console/Tester/TesterTrait.php +++ /dev/null @@ -1,180 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tester; - -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\ConsoleOutput; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Output\StreamOutput; - -/** - * @author Amrouche Hamza - */ -trait TesterTrait -{ - /** @var StreamOutput */ - private $output; - private $inputs = []; - private $captureStreamsIndependently = false; - - /** - * Gets the display returned by the last execution of the command or application. - * - * @param bool $normalize Whether to normalize end of lines to \n or not - * - * @return string The display - */ - public function getDisplay($normalize = false) - { - if (null === $this->output) { - throw new \RuntimeException('Output not initialized, did you execute the command before requesting the display?'); - } - - rewind($this->output->getStream()); - - $display = stream_get_contents($this->output->getStream()); - - if ($normalize) { - $display = str_replace(\PHP_EOL, "\n", $display); - } - - return $display; - } - - /** - * Gets the output written to STDERR by the application. - * - * @param bool $normalize Whether to normalize end of lines to \n or not - * - * @return string - */ - public function getErrorOutput($normalize = false) - { - if (!$this->captureStreamsIndependently) { - throw new \LogicException('The error output is not available when the tester is run without "capture_stderr_separately" option set.'); - } - - rewind($this->output->getErrorOutput()->getStream()); - - $display = stream_get_contents($this->output->getErrorOutput()->getStream()); - - if ($normalize) { - $display = str_replace(\PHP_EOL, "\n", $display); - } - - return $display; - } - - /** - * Gets the input instance used by the last execution of the command or application. - * - * @return InputInterface The current input instance - */ - public function getInput() - { - return $this->input; - } - - /** - * Gets the output instance used by the last execution of the command or application. - * - * @return OutputInterface The current output instance - */ - public function getOutput() - { - return $this->output; - } - - /** - * Gets the status code returned by the last execution of the command or application. - * - * @return int The status code - */ - public function getStatusCode() - { - return $this->statusCode; - } - - /** - * Sets the user inputs. - * - * @param array $inputs An array of strings representing each input - * passed to the command input stream - * - * @return $this - */ - public function setInputs(array $inputs) - { - $this->inputs = $inputs; - - return $this; - } - - /** - * Initializes the output property. - * - * Available options: - * - * * decorated: Sets the output decorated flag - * * verbosity: Sets the output verbosity flag - * * capture_stderr_separately: Make output of stdOut and stdErr separately available - */ - private function initOutput(array $options) - { - $this->captureStreamsIndependently = \array_key_exists('capture_stderr_separately', $options) && $options['capture_stderr_separately']; - if (!$this->captureStreamsIndependently) { - $this->output = new StreamOutput(fopen('php://memory', 'w', false)); - if (isset($options['decorated'])) { - $this->output->setDecorated($options['decorated']); - } - if (isset($options['verbosity'])) { - $this->output->setVerbosity($options['verbosity']); - } - } else { - $this->output = new ConsoleOutput( - $options['verbosity'] ?? ConsoleOutput::VERBOSITY_NORMAL, - $options['decorated'] ?? null - ); - - $errorOutput = new StreamOutput(fopen('php://memory', 'w', false)); - $errorOutput->setFormatter($this->output->getFormatter()); - $errorOutput->setVerbosity($this->output->getVerbosity()); - $errorOutput->setDecorated($this->output->isDecorated()); - - $reflectedOutput = new \ReflectionObject($this->output); - $strErrProperty = $reflectedOutput->getProperty('stderr'); - $strErrProperty->setAccessible(true); - $strErrProperty->setValue($this->output, $errorOutput); - - $reflectedParent = $reflectedOutput->getParentClass(); - $streamProperty = $reflectedParent->getProperty('stream'); - $streamProperty->setAccessible(true); - $streamProperty->setValue($this->output, fopen('php://memory', 'w', false)); - } - } - - /** - * @return resource - */ - private static function createStream(array $inputs) - { - $stream = fopen('php://memory', 'r+', false); - - foreach ($inputs as $input) { - fwrite($stream, $input.\PHP_EOL); - } - - rewind($stream); - - return $stream; - } -} diff --git a/vendor/symfony/console/composer.json b/vendor/symfony/console/composer.json deleted file mode 100644 index 90cbd24..0000000 --- a/vendor/symfony/console/composer.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "name": "symfony/console", - "type": "library", - "description": "Eases the creation of beautiful and testable command line interfaces", - "keywords": [], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "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" - }, - "require-dev": { - "symfony/config": "^3.4|^4.0|^5.0", - "symfony/event-dispatcher": "^4.3", - "symfony/dependency-injection": "^3.4|^4.0|^5.0", - "symfony/lock": "^4.4|^5.0", - "symfony/process": "^3.4|^4.0|^5.0", - "symfony/var-dumper": "^4.3|^5.0", - "psr/log": "^1|^2" - }, - "provide": { - "psr/log-implementation": "1.0|2.0" - }, - "suggest": { - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "", - "psr/log": "For using the console logger" - }, - "conflict": { - "psr/log": ">=3", - "symfony/dependency-injection": "<3.4", - "symfony/event-dispatcher": "<4.3|>=5", - "symfony/lock": "<4.4", - "symfony/process": "<3.3" - }, - "autoload": { - "psr-4": { "Symfony\\Component\\Console\\": "" }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "minimum-stability": "dev" -} diff --git a/vendor/symfony/deprecation-contracts/.gitignore b/vendor/symfony/deprecation-contracts/.gitignore deleted file mode 100644 index c49a5d8..0000000 --- a/vendor/symfony/deprecation-contracts/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -vendor/ -composer.lock -phpunit.xml diff --git a/vendor/symfony/deprecation-contracts/CHANGELOG.md b/vendor/symfony/deprecation-contracts/CHANGELOG.md deleted file mode 100644 index 7932e26..0000000 --- a/vendor/symfony/deprecation-contracts/CHANGELOG.md +++ /dev/null @@ -1,5 +0,0 @@ -CHANGELOG -========= - -The changelog is maintained for all Symfony contracts at the following URL: -https://github.com/symfony/contracts/blob/main/CHANGELOG.md diff --git a/vendor/symfony/deprecation-contracts/LICENSE b/vendor/symfony/deprecation-contracts/LICENSE deleted file mode 100644 index ad85e17..0000000 --- a/vendor/symfony/deprecation-contracts/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020-2021 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/deprecation-contracts/README.md b/vendor/symfony/deprecation-contracts/README.md deleted file mode 100644 index 4957933..0000000 --- a/vendor/symfony/deprecation-contracts/README.md +++ /dev/null @@ -1,26 +0,0 @@ -Symfony Deprecation Contracts -============================= - -A generic function and convention to trigger deprecation notices. - -This package provides a single global function named `trigger_deprecation()` that triggers silenced deprecation notices. - -By using a custom PHP error handler such as the one provided by the Symfony ErrorHandler component, -the triggered deprecations can be caught and logged for later discovery, both on dev and prod environments. - -The function requires at least 3 arguments: - - the name of the Composer package that is triggering the deprecation - - the version of the package that introduced the deprecation - - the message of the deprecation - - more arguments can be provided: they will be inserted in the message using `printf()` formatting - -Example: -```php -trigger_deprecation('symfony/blockchain', '8.9', 'Using "%s" is deprecated, use "%s" instead.', 'bitcoin', 'fabcoin'); -``` - -This will generate the following message: -`Since symfony/blockchain 8.9: Using "bitcoin" is deprecated, use "fabcoin" instead.` - -While not necessarily recommended, the deprecation notices can be completely ignored by declaring an empty -`function trigger_deprecation() {}` in your application. diff --git a/vendor/symfony/deprecation-contracts/composer.json b/vendor/symfony/deprecation-contracts/composer.json deleted file mode 100644 index cc7cc12..0000000 --- a/vendor/symfony/deprecation-contracts/composer.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "symfony/deprecation-contracts", - "type": "library", - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.1" - }, - "autoload": { - "files": [ - "function.php" - ] - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - } -} diff --git a/vendor/symfony/deprecation-contracts/function.php b/vendor/symfony/deprecation-contracts/function.php deleted file mode 100644 index d437150..0000000 --- a/vendor/symfony/deprecation-contracts/function.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (!function_exists('trigger_deprecation')) { - /** - * Triggers a silenced deprecation notice. - * - * @param string $package The name of the Composer package that is triggering the deprecation - * @param string $version The version of the package that introduced the deprecation - * @param string $message The message of the deprecation - * @param mixed ...$args Values to insert in the message using printf() formatting - * - * @author Nicolas Grekas - */ - function trigger_deprecation(string $package, string $version, string $message, ...$args): void - { - @trigger_error(($package || $version ? "Since $package $version: " : '').($args ? vsprintf($message, $args) : $message), \E_USER_DEPRECATED); - } -} diff --git a/vendor/symfony/finder/CHANGELOG.md b/vendor/symfony/finder/CHANGELOG.md deleted file mode 100644 index 2045184..0000000 --- a/vendor/symfony/finder/CHANGELOG.md +++ /dev/null @@ -1,74 +0,0 @@ -CHANGELOG -========= - -4.3.0 ------ - - * added Finder::ignoreVCSIgnored() to ignore files based on rules listed in .gitignore - -4.2.0 ------ - - * added $useNaturalSort option to Finder::sortByName() method - * the `Finder::sortByName()` method will have a new `$useNaturalSort` - argument in version 5.0, not defining it is deprecated - * added `Finder::reverseSorting()` to reverse the sorting - -4.0.0 ------ - - * removed `ExceptionInterface` - * removed `Symfony\Component\Finder\Iterator\FilterIterator` - -3.4.0 ------ - - * deprecated `Symfony\Component\Finder\Iterator\FilterIterator` - * added Finder::hasResults() method to check if any results were found - -3.3.0 ------ - - * added double-star matching to Glob::toRegex() - -3.0.0 ------ - - * removed deprecated classes - -2.8.0 ------ - - * deprecated adapters and related classes - -2.5.0 ------ - * added support for GLOB_BRACE in the paths passed to Finder::in() - -2.3.0 ------ - - * added a way to ignore unreadable directories (via Finder::ignoreUnreadableDirs()) - * unified the way subfolders that are not executable are handled by always throwing an AccessDeniedException exception - -2.2.0 ------ - - * added Finder::path() and Finder::notPath() methods - * added finder adapters to improve performance on specific platforms - * added support for wildcard characters (glob patterns) in the paths passed - to Finder::in() - -2.1.0 ------ - - * added Finder::sortByAccessedTime(), Finder::sortByChangedTime(), and - Finder::sortByModifiedTime() - * added Countable to Finder - * added support for an array of directories as an argument to - Finder::exclude() - * added searching based on the file content via Finder::contains() and - Finder::notContains() - * added support for the != operator in the Comparator - * [BC BREAK] filter expressions (used for file name and content) are no more - considered as regexps but glob patterns when they are enclosed in '*' or '?' diff --git a/vendor/symfony/finder/Comparator/Comparator.php b/vendor/symfony/finder/Comparator/Comparator.php deleted file mode 100644 index 6aee21c..0000000 --- a/vendor/symfony/finder/Comparator/Comparator.php +++ /dev/null @@ -1,98 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Comparator; - -/** - * Comparator. - * - * @author Fabien Potencier - */ -class Comparator -{ - private $target; - private $operator = '=='; - - /** - * Gets the target value. - * - * @return string The target value - */ - public function getTarget() - { - return $this->target; - } - - /** - * Sets the target value. - * - * @param string $target The target value - */ - public function setTarget($target) - { - $this->target = $target; - } - - /** - * Gets the comparison operator. - * - * @return string The operator - */ - public function getOperator() - { - return $this->operator; - } - - /** - * Sets the comparison operator. - * - * @param string $operator A valid operator - * - * @throws \InvalidArgumentException - */ - public function setOperator($operator) - { - if (!$operator) { - $operator = '=='; - } - - if (!\in_array($operator, ['>', '<', '>=', '<=', '==', '!='])) { - throw new \InvalidArgumentException(sprintf('Invalid operator "%s".', $operator)); - } - - $this->operator = $operator; - } - - /** - * Tests against the target. - * - * @param mixed $test A test value - * - * @return bool - */ - public function test($test) - { - switch ($this->operator) { - case '>': - return $test > $this->target; - case '>=': - return $test >= $this->target; - case '<': - return $test < $this->target; - case '<=': - return $test <= $this->target; - case '!=': - return $test != $this->target; - } - - return $test == $this->target; - } -} diff --git a/vendor/symfony/finder/Comparator/DateComparator.php b/vendor/symfony/finder/Comparator/DateComparator.php deleted file mode 100644 index ae22c6c..0000000 --- a/vendor/symfony/finder/Comparator/DateComparator.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Comparator; - -/** - * DateCompare compiles date comparisons. - * - * @author Fabien Potencier - */ -class DateComparator extends Comparator -{ - /** - * @param string $test A comparison string - * - * @throws \InvalidArgumentException If the test is not understood - */ - public function __construct(string $test) - { - if (!preg_match('#^\s*(==|!=|[<>]=?|after|since|before|until)?\s*(.+?)\s*$#i', $test, $matches)) { - throw new \InvalidArgumentException(sprintf('Don\'t understand "%s" as a date test.', $test)); - } - - try { - $date = new \DateTime($matches[2]); - $target = $date->format('U'); - } catch (\Exception $e) { - throw new \InvalidArgumentException(sprintf('"%s" is not a valid date.', $matches[2])); - } - - $operator = $matches[1] ?? '=='; - if ('since' === $operator || 'after' === $operator) { - $operator = '>'; - } - - if ('until' === $operator || 'before' === $operator) { - $operator = '<'; - } - - $this->setOperator($operator); - $this->setTarget($target); - } -} diff --git a/vendor/symfony/finder/Comparator/NumberComparator.php b/vendor/symfony/finder/Comparator/NumberComparator.php deleted file mode 100644 index 657118f..0000000 --- a/vendor/symfony/finder/Comparator/NumberComparator.php +++ /dev/null @@ -1,79 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Comparator; - -/** - * NumberComparator compiles a simple comparison to an anonymous - * subroutine, which you can call with a value to be tested again. - * - * Now this would be very pointless, if NumberCompare didn't understand - * magnitudes. - * - * The target value may use magnitudes of kilobytes (k, ki), - * megabytes (m, mi), or gigabytes (g, gi). Those suffixed - * with an i use the appropriate 2**n version in accordance with the - * IEC standard: http://physics.nist.gov/cuu/Units/binary.html - * - * Based on the Perl Number::Compare module. - * - * @author Fabien Potencier PHP port - * @author Richard Clamp Perl version - * @copyright 2004-2005 Fabien Potencier - * @copyright 2002 Richard Clamp - * - * @see http://physics.nist.gov/cuu/Units/binary.html - */ -class NumberComparator extends Comparator -{ - /** - * @param string|int $test A comparison string or an integer - * - * @throws \InvalidArgumentException If the test is not understood - */ - public function __construct(?string $test) - { - if (null === $test || !preg_match('#^\s*(==|!=|[<>]=?)?\s*([0-9\.]+)\s*([kmg]i?)?\s*$#i', $test, $matches)) { - throw new \InvalidArgumentException(sprintf('Don\'t understand "%s" as a number test.', $test ?? 'null')); - } - - $target = $matches[2]; - if (!is_numeric($target)) { - throw new \InvalidArgumentException(sprintf('Invalid number "%s".', $target)); - } - if (isset($matches[3])) { - // magnitude - switch (strtolower($matches[3])) { - case 'k': - $target *= 1000; - break; - case 'ki': - $target *= 1024; - break; - case 'm': - $target *= 1000000; - break; - case 'mi': - $target *= 1024 * 1024; - break; - case 'g': - $target *= 1000000000; - break; - case 'gi': - $target *= 1024 * 1024 * 1024; - break; - } - } - - $this->setTarget($target); - $this->setOperator($matches[1] ?? '=='); - } -} diff --git a/vendor/symfony/finder/Exception/AccessDeniedException.php b/vendor/symfony/finder/Exception/AccessDeniedException.php deleted file mode 100644 index ee195ea..0000000 --- a/vendor/symfony/finder/Exception/AccessDeniedException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Exception; - -/** - * @author Jean-François Simon - */ -class AccessDeniedException extends \UnexpectedValueException -{ -} diff --git a/vendor/symfony/finder/Exception/DirectoryNotFoundException.php b/vendor/symfony/finder/Exception/DirectoryNotFoundException.php deleted file mode 100644 index c6cc0f2..0000000 --- a/vendor/symfony/finder/Exception/DirectoryNotFoundException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Exception; - -/** - * @author Andreas Erhard - */ -class DirectoryNotFoundException extends \InvalidArgumentException -{ -} diff --git a/vendor/symfony/finder/Finder.php b/vendor/symfony/finder/Finder.php deleted file mode 100644 index e1194ed..0000000 --- a/vendor/symfony/finder/Finder.php +++ /dev/null @@ -1,823 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder; - -use Symfony\Component\Finder\Comparator\DateComparator; -use Symfony\Component\Finder\Comparator\NumberComparator; -use Symfony\Component\Finder\Exception\DirectoryNotFoundException; -use Symfony\Component\Finder\Iterator\CustomFilterIterator; -use Symfony\Component\Finder\Iterator\DateRangeFilterIterator; -use Symfony\Component\Finder\Iterator\DepthRangeFilterIterator; -use Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator; -use Symfony\Component\Finder\Iterator\FilecontentFilterIterator; -use Symfony\Component\Finder\Iterator\FilenameFilterIterator; -use Symfony\Component\Finder\Iterator\LazyIterator; -use Symfony\Component\Finder\Iterator\SizeRangeFilterIterator; -use Symfony\Component\Finder\Iterator\SortableIterator; - -/** - * Finder allows to build rules to find files and directories. - * - * It is a thin wrapper around several specialized iterator classes. - * - * All rules may be invoked several times. - * - * All methods return the current Finder object to allow chaining: - * - * $finder = Finder::create()->files()->name('*.php')->in(__DIR__); - * - * @author Fabien Potencier - */ -class Finder implements \IteratorAggregate, \Countable -{ - public const IGNORE_VCS_FILES = 1; - public const IGNORE_DOT_FILES = 2; - public const IGNORE_VCS_IGNORED_FILES = 4; - - private $mode = 0; - private $names = []; - private $notNames = []; - private $exclude = []; - private $filters = []; - private $depths = []; - private $sizes = []; - private $followLinks = false; - private $reverseSorting = false; - private $sort = false; - private $ignore = 0; - private $dirs = []; - private $dates = []; - private $iterators = []; - private $contains = []; - private $notContains = []; - private $paths = []; - private $notPaths = []; - private $ignoreUnreadableDirs = false; - - private static $vcsPatterns = ['.svn', '_svn', 'CVS', '_darcs', '.arch-params', '.monotone', '.bzr', '.git', '.hg']; - - public function __construct() - { - $this->ignore = static::IGNORE_VCS_FILES | static::IGNORE_DOT_FILES; - } - - /** - * Creates a new Finder. - * - * @return static - */ - public static function create() - { - return new static(); - } - - /** - * Restricts the matching to directories only. - * - * @return $this - */ - public function directories() - { - $this->mode = Iterator\FileTypeFilterIterator::ONLY_DIRECTORIES; - - return $this; - } - - /** - * Restricts the matching to files only. - * - * @return $this - */ - public function files() - { - $this->mode = Iterator\FileTypeFilterIterator::ONLY_FILES; - - return $this; - } - - /** - * Adds tests for the directory depth. - * - * Usage: - * - * $finder->depth('> 1') // the Finder will start matching at level 1. - * $finder->depth('< 3') // the Finder will descend at most 3 levels of directories below the starting point. - * $finder->depth(['>= 1', '< 3']) - * - * @param string|int|string[]|int[] $levels The depth level expression or an array of depth levels - * - * @return $this - * - * @see DepthRangeFilterIterator - * @see NumberComparator - */ - public function depth($levels) - { - foreach ((array) $levels as $level) { - $this->depths[] = new Comparator\NumberComparator($level); - } - - return $this; - } - - /** - * Adds tests for file dates (last modified). - * - * The date must be something that strtotime() is able to parse: - * - * $finder->date('since yesterday'); - * $finder->date('until 2 days ago'); - * $finder->date('> now - 2 hours'); - * $finder->date('>= 2005-10-15'); - * $finder->date(['>= 2005-10-15', '<= 2006-05-27']); - * - * @param string|string[] $dates A date range string or an array of date ranges - * - * @return $this - * - * @see strtotime - * @see DateRangeFilterIterator - * @see DateComparator - */ - public function date($dates) - { - foreach ((array) $dates as $date) { - $this->dates[] = new Comparator\DateComparator($date); - } - - return $this; - } - - /** - * Adds rules that files must match. - * - * You can use patterns (delimited with / sign), globs or simple strings. - * - * $finder->name('*.php') - * $finder->name('/\.php$/') // same as above - * $finder->name('test.php') - * $finder->name(['test.py', 'test.php']) - * - * @param string|string[] $patterns A pattern (a regexp, a glob, or a string) or an array of patterns - * - * @return $this - * - * @see FilenameFilterIterator - */ - public function name($patterns) - { - $this->names = array_merge($this->names, (array) $patterns); - - return $this; - } - - /** - * Adds rules that files must not match. - * - * @param string|string[] $patterns A pattern (a regexp, a glob, or a string) or an array of patterns - * - * @return $this - * - * @see FilenameFilterIterator - */ - public function notName($patterns) - { - $this->notNames = array_merge($this->notNames, (array) $patterns); - - return $this; - } - - /** - * Adds tests that file contents must match. - * - * Strings or PCRE patterns can be used: - * - * $finder->contains('Lorem ipsum') - * $finder->contains('/Lorem ipsum/i') - * $finder->contains(['dolor', '/ipsum/i']) - * - * @param string|string[] $patterns A pattern (string or regexp) or an array of patterns - * - * @return $this - * - * @see FilecontentFilterIterator - */ - public function contains($patterns) - { - $this->contains = array_merge($this->contains, (array) $patterns); - - return $this; - } - - /** - * Adds tests that file contents must not match. - * - * Strings or PCRE patterns can be used: - * - * $finder->notContains('Lorem ipsum') - * $finder->notContains('/Lorem ipsum/i') - * $finder->notContains(['lorem', '/dolor/i']) - * - * @param string|string[] $patterns A pattern (string or regexp) or an array of patterns - * - * @return $this - * - * @see FilecontentFilterIterator - */ - public function notContains($patterns) - { - $this->notContains = array_merge($this->notContains, (array) $patterns); - - return $this; - } - - /** - * Adds rules that filenames must match. - * - * You can use patterns (delimited with / sign) or simple strings. - * - * $finder->path('some/special/dir') - * $finder->path('/some\/special\/dir/') // same as above - * $finder->path(['some dir', 'another/dir']) - * - * Use only / as dirname separator. - * - * @param string|string[] $patterns A pattern (a regexp or a string) or an array of patterns - * - * @return $this - * - * @see FilenameFilterIterator - */ - public function path($patterns) - { - $this->paths = array_merge($this->paths, (array) $patterns); - - return $this; - } - - /** - * Adds rules that filenames must not match. - * - * You can use patterns (delimited with / sign) or simple strings. - * - * $finder->notPath('some/special/dir') - * $finder->notPath('/some\/special\/dir/') // same as above - * $finder->notPath(['some/file.txt', 'another/file.log']) - * - * Use only / as dirname separator. - * - * @param string|string[] $patterns A pattern (a regexp or a string) or an array of patterns - * - * @return $this - * - * @see FilenameFilterIterator - */ - public function notPath($patterns) - { - $this->notPaths = array_merge($this->notPaths, (array) $patterns); - - return $this; - } - - /** - * Adds tests for file sizes. - * - * $finder->size('> 10K'); - * $finder->size('<= 1Ki'); - * $finder->size(4); - * $finder->size(['> 10K', '< 20K']) - * - * @param string|int|string[]|int[] $sizes A size range string or an integer or an array of size ranges - * - * @return $this - * - * @see SizeRangeFilterIterator - * @see NumberComparator - */ - public function size($sizes) - { - foreach ((array) $sizes as $size) { - $this->sizes[] = new Comparator\NumberComparator($size); - } - - return $this; - } - - /** - * Excludes directories. - * - * Directories passed as argument must be relative to the ones defined with the `in()` method. For example: - * - * $finder->in(__DIR__)->exclude('ruby'); - * - * @param string|array $dirs A directory path or an array of directories - * - * @return $this - * - * @see ExcludeDirectoryFilterIterator - */ - public function exclude($dirs) - { - $this->exclude = array_merge($this->exclude, (array) $dirs); - - return $this; - } - - /** - * Excludes "hidden" directories and files (starting with a dot). - * - * This option is enabled by default. - * - * @param bool $ignoreDotFiles Whether to exclude "hidden" files or not - * - * @return $this - * - * @see ExcludeDirectoryFilterIterator - */ - public function ignoreDotFiles($ignoreDotFiles) - { - if ($ignoreDotFiles) { - $this->ignore |= static::IGNORE_DOT_FILES; - } else { - $this->ignore &= ~static::IGNORE_DOT_FILES; - } - - return $this; - } - - /** - * Forces the finder to ignore version control directories. - * - * This option is enabled by default. - * - * @param bool $ignoreVCS Whether to exclude VCS files or not - * - * @return $this - * - * @see ExcludeDirectoryFilterIterator - */ - public function ignoreVCS($ignoreVCS) - { - if ($ignoreVCS) { - $this->ignore |= static::IGNORE_VCS_FILES; - } else { - $this->ignore &= ~static::IGNORE_VCS_FILES; - } - - return $this; - } - - /** - * Forces Finder to obey .gitignore and ignore files based on rules listed there. - * - * This option is disabled by default. - * - * @return $this - */ - public function ignoreVCSIgnored(bool $ignoreVCSIgnored) - { - if ($ignoreVCSIgnored) { - $this->ignore |= static::IGNORE_VCS_IGNORED_FILES; - } else { - $this->ignore &= ~static::IGNORE_VCS_IGNORED_FILES; - } - - return $this; - } - - /** - * Adds VCS patterns. - * - * @see ignoreVCS() - * - * @param string|string[] $pattern VCS patterns to ignore - */ - public static function addVCSPattern($pattern) - { - foreach ((array) $pattern as $p) { - self::$vcsPatterns[] = $p; - } - - self::$vcsPatterns = array_unique(self::$vcsPatterns); - } - - /** - * Sorts files and directories by an anonymous function. - * - * The anonymous function receives two \SplFileInfo instances to compare. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sort(\Closure $closure) - { - $this->sort = $closure; - - return $this; - } - - /** - * Sorts files and directories by name. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @param bool $useNaturalSort Whether to use natural sort or not, disabled by default - * - * @return $this - * - * @see SortableIterator - */ - public function sortByName(/* bool $useNaturalSort = false */) - { - if (\func_num_args() < 1 && __CLASS__ !== static::class && __CLASS__ !== (new \ReflectionMethod($this, __FUNCTION__))->getDeclaringClass()->getName() && !$this instanceof \PHPUnit\Framework\MockObject\MockObject && !$this instanceof \Prophecy\Prophecy\ProphecySubjectInterface && !$this instanceof \Mockery\MockInterface) { - @trigger_error(sprintf('The "%s()" method will have a new "bool $useNaturalSort = false" argument in version 5.0, not defining it is deprecated since Symfony 4.2.', __METHOD__), \E_USER_DEPRECATED); - } - $useNaturalSort = 0 < \func_num_args() && func_get_arg(0); - - $this->sort = $useNaturalSort ? Iterator\SortableIterator::SORT_BY_NAME_NATURAL : Iterator\SortableIterator::SORT_BY_NAME; - - return $this; - } - - /** - * Sorts files and directories by type (directories before files), then by name. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sortByType() - { - $this->sort = Iterator\SortableIterator::SORT_BY_TYPE; - - return $this; - } - - /** - * Sorts files and directories by the last accessed time. - * - * This is the time that the file was last accessed, read or written to. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sortByAccessedTime() - { - $this->sort = Iterator\SortableIterator::SORT_BY_ACCESSED_TIME; - - return $this; - } - - /** - * Reverses the sorting. - * - * @return $this - */ - public function reverseSorting() - { - $this->reverseSorting = true; - - return $this; - } - - /** - * Sorts files and directories by the last inode changed time. - * - * This is the time that the inode information was last modified (permissions, owner, group or other metadata). - * - * On Windows, since inode is not available, changed time is actually the file creation time. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sortByChangedTime() - { - $this->sort = Iterator\SortableIterator::SORT_BY_CHANGED_TIME; - - return $this; - } - - /** - * Sorts files and directories by the last modified time. - * - * This is the last time the actual contents of the file were last modified. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sortByModifiedTime() - { - $this->sort = Iterator\SortableIterator::SORT_BY_MODIFIED_TIME; - - return $this; - } - - /** - * Filters the iterator with an anonymous function. - * - * The anonymous function receives a \SplFileInfo and must return false - * to remove files. - * - * @return $this - * - * @see CustomFilterIterator - */ - public function filter(\Closure $closure) - { - $this->filters[] = $closure; - - return $this; - } - - /** - * Forces the following of symlinks. - * - * @return $this - */ - public function followLinks() - { - $this->followLinks = true; - - return $this; - } - - /** - * Tells finder to ignore unreadable directories. - * - * By default, scanning unreadable directories content throws an AccessDeniedException. - * - * @param bool $ignore - * - * @return $this - */ - public function ignoreUnreadableDirs($ignore = true) - { - $this->ignoreUnreadableDirs = (bool) $ignore; - - return $this; - } - - /** - * Searches files and directories which match defined rules. - * - * @param string|string[] $dirs A directory path or an array of directories - * - * @return $this - * - * @throws DirectoryNotFoundException if one of the directories does not exist - */ - public function in($dirs) - { - $resolvedDirs = []; - - foreach ((array) $dirs as $dir) { - if (is_dir($dir)) { - $resolvedDirs[] = $this->normalizeDir($dir); - } elseif ($glob = glob($dir, (\defined('GLOB_BRACE') ? \GLOB_BRACE : 0) | \GLOB_ONLYDIR | \GLOB_NOSORT)) { - sort($glob); - $resolvedDirs = array_merge($resolvedDirs, array_map([$this, 'normalizeDir'], $glob)); - } else { - throw new DirectoryNotFoundException(sprintf('The "%s" directory does not exist.', $dir)); - } - } - - $this->dirs = array_merge($this->dirs, $resolvedDirs); - - return $this; - } - - /** - * Returns an Iterator for the current Finder configuration. - * - * This method implements the IteratorAggregate interface. - * - * @return \Iterator|SplFileInfo[] An iterator - * - * @throws \LogicException if the in() method has not been called - */ - #[\ReturnTypeWillChange] - public function getIterator() - { - if (0 === \count($this->dirs) && 0 === \count($this->iterators)) { - throw new \LogicException('You must call one of in() or append() methods before iterating over a Finder.'); - } - - if (1 === \count($this->dirs) && 0 === \count($this->iterators)) { - $iterator = $this->searchInDirectory($this->dirs[0]); - - if ($this->sort || $this->reverseSorting) { - $iterator = (new Iterator\SortableIterator($iterator, $this->sort, $this->reverseSorting))->getIterator(); - } - - return $iterator; - } - - $iterator = new \AppendIterator(); - foreach ($this->dirs as $dir) { - $iterator->append(new \IteratorIterator(new LazyIterator(function () use ($dir) { - return $this->searchInDirectory($dir); - }))); - } - - foreach ($this->iterators as $it) { - $iterator->append($it); - } - - if ($this->sort || $this->reverseSorting) { - $iterator = (new Iterator\SortableIterator($iterator, $this->sort, $this->reverseSorting))->getIterator(); - } - - return $iterator; - } - - /** - * Appends an existing set of files/directories to the finder. - * - * The set can be another Finder, an Iterator, an IteratorAggregate, or even a plain array. - * - * @param iterable $iterator - * - * @return $this - * - * @throws \InvalidArgumentException when the given argument is not iterable - */ - public function append($iterator) - { - if ($iterator instanceof \IteratorAggregate) { - $this->iterators[] = $iterator->getIterator(); - } elseif ($iterator instanceof \Iterator) { - $this->iterators[] = $iterator; - } elseif (is_iterable($iterator)) { - $it = new \ArrayIterator(); - foreach ($iterator as $file) { - $file = $file instanceof \SplFileInfo ? $file : new \SplFileInfo($file); - $it[$file->getPathname()] = $file; - } - $this->iterators[] = $it; - } else { - throw new \InvalidArgumentException('Finder::append() method wrong argument type.'); - } - - return $this; - } - - /** - * Check if any results were found. - * - * @return bool - */ - public function hasResults() - { - foreach ($this->getIterator() as $_) { - return true; - } - - return false; - } - - /** - * Counts all the results collected by the iterators. - * - * @return int - */ - #[\ReturnTypeWillChange] - public function count() - { - return iterator_count($this->getIterator()); - } - - private function searchInDirectory(string $dir): \Iterator - { - $exclude = $this->exclude; - $notPaths = $this->notPaths; - - if (static::IGNORE_VCS_FILES === (static::IGNORE_VCS_FILES & $this->ignore)) { - $exclude = array_merge($exclude, self::$vcsPatterns); - } - - if (static::IGNORE_DOT_FILES === (static::IGNORE_DOT_FILES & $this->ignore)) { - $notPaths[] = '#(^|/)\..+(/|$)#'; - } - - if (static::IGNORE_VCS_IGNORED_FILES === (static::IGNORE_VCS_IGNORED_FILES & $this->ignore)) { - $gitignoreFilePath = sprintf('%s/.gitignore', $dir); - if (!is_readable($gitignoreFilePath)) { - throw new \RuntimeException(sprintf('The "ignoreVCSIgnored" option cannot be used by the Finder as the "%s" file is not readable.', $gitignoreFilePath)); - } - $notPaths = array_merge($notPaths, [Gitignore::toRegex(file_get_contents($gitignoreFilePath))]); - } - - $minDepth = 0; - $maxDepth = \PHP_INT_MAX; - - foreach ($this->depths as $comparator) { - switch ($comparator->getOperator()) { - case '>': - $minDepth = $comparator->getTarget() + 1; - break; - case '>=': - $minDepth = $comparator->getTarget(); - break; - case '<': - $maxDepth = $comparator->getTarget() - 1; - break; - case '<=': - $maxDepth = $comparator->getTarget(); - break; - default: - $minDepth = $maxDepth = $comparator->getTarget(); - } - } - - $flags = \RecursiveDirectoryIterator::SKIP_DOTS; - - if ($this->followLinks) { - $flags |= \RecursiveDirectoryIterator::FOLLOW_SYMLINKS; - } - - $iterator = new Iterator\RecursiveDirectoryIterator($dir, $flags, $this->ignoreUnreadableDirs); - - if ($exclude) { - $iterator = new Iterator\ExcludeDirectoryFilterIterator($iterator, $exclude); - } - - $iterator = new \RecursiveIteratorIterator($iterator, \RecursiveIteratorIterator::SELF_FIRST); - - if ($minDepth > 0 || $maxDepth < \PHP_INT_MAX) { - $iterator = new Iterator\DepthRangeFilterIterator($iterator, $minDepth, $maxDepth); - } - - if ($this->mode) { - $iterator = new Iterator\FileTypeFilterIterator($iterator, $this->mode); - } - - if ($this->names || $this->notNames) { - $iterator = new Iterator\FilenameFilterIterator($iterator, $this->names, $this->notNames); - } - - if ($this->contains || $this->notContains) { - $iterator = new Iterator\FilecontentFilterIterator($iterator, $this->contains, $this->notContains); - } - - if ($this->sizes) { - $iterator = new Iterator\SizeRangeFilterIterator($iterator, $this->sizes); - } - - if ($this->dates) { - $iterator = new Iterator\DateRangeFilterIterator($iterator, $this->dates); - } - - if ($this->filters) { - $iterator = new Iterator\CustomFilterIterator($iterator, $this->filters); - } - - if ($this->paths || $notPaths) { - $iterator = new Iterator\PathFilterIterator($iterator, $this->paths, $notPaths); - } - - return $iterator; - } - - /** - * Normalizes given directory names by removing trailing slashes. - * - * Excluding: (s)ftp:// or ssh2.(s)ftp:// wrapper - */ - private function normalizeDir(string $dir): string - { - if ('/' === $dir) { - return $dir; - } - - $dir = rtrim($dir, '/'.\DIRECTORY_SEPARATOR); - - if (preg_match('#^(ssh2\.)?s?ftp://#', $dir)) { - $dir .= '/'; - } - - return $dir; - } -} diff --git a/vendor/symfony/finder/Gitignore.php b/vendor/symfony/finder/Gitignore.php deleted file mode 100644 index 491f588..0000000 --- a/vendor/symfony/finder/Gitignore.php +++ /dev/null @@ -1,83 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder; - -/** - * Gitignore matches against text. - * - * @author Michael Voříšek - * @author Ahmed Abdou - */ -class Gitignore -{ - /** - * Returns a regexp which is the equivalent of the gitignore pattern. - * - * Format specification: https://git-scm.com/docs/gitignore#_pattern_format - */ - public static function toRegex(string $gitignoreFileContent): string - { - $gitignoreFileContent = preg_replace('~(? $line) { - $line = preg_replace('~(? - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder; - -/** - * Glob matches globbing patterns against text. - * - * if match_glob("foo.*", "foo.bar") echo "matched\n"; - * - * // prints foo.bar and foo.baz - * $regex = glob_to_regex("foo.*"); - * for (['foo.bar', 'foo.baz', 'foo', 'bar'] as $t) - * { - * if (/$regex/) echo "matched: $car\n"; - * } - * - * Glob implements glob(3) style matching that can be used to match - * against text, rather than fetching names from a filesystem. - * - * Based on the Perl Text::Glob module. - * - * @author Fabien Potencier PHP port - * @author Richard Clamp Perl version - * @copyright 2004-2005 Fabien Potencier - * @copyright 2002 Richard Clamp - */ -class Glob -{ - /** - * Returns a regexp which is the equivalent of the glob pattern. - * - * @param string $glob The glob pattern - * @param bool $strictLeadingDot - * @param bool $strictWildcardSlash - * @param string $delimiter Optional delimiter - * - * @return string regex The regexp - */ - public static function toRegex($glob, $strictLeadingDot = true, $strictWildcardSlash = true, $delimiter = '#') - { - $firstByte = true; - $escaping = false; - $inCurlies = 0; - $regex = ''; - $sizeGlob = \strlen($glob); - for ($i = 0; $i < $sizeGlob; ++$i) { - $car = $glob[$i]; - if ($firstByte && $strictLeadingDot && '.' !== $car) { - $regex .= '(?=[^\.])'; - } - - $firstByte = '/' === $car; - - if ($firstByte && $strictWildcardSlash && isset($glob[$i + 2]) && '**' === $glob[$i + 1].$glob[$i + 2] && (!isset($glob[$i + 3]) || '/' === $glob[$i + 3])) { - $car = '[^/]++/'; - if (!isset($glob[$i + 3])) { - $car .= '?'; - } - - if ($strictLeadingDot) { - $car = '(?=[^\.])'.$car; - } - - $car = '/(?:'.$car.')*'; - $i += 2 + isset($glob[$i + 3]); - - if ('/' === $delimiter) { - $car = str_replace('/', '\\/', $car); - } - } - - if ($delimiter === $car || '.' === $car || '(' === $car || ')' === $car || '|' === $car || '+' === $car || '^' === $car || '$' === $car) { - $regex .= "\\$car"; - } elseif ('*' === $car) { - $regex .= $escaping ? '\\*' : ($strictWildcardSlash ? '[^/]*' : '.*'); - } elseif ('?' === $car) { - $regex .= $escaping ? '\\?' : ($strictWildcardSlash ? '[^/]' : '.'); - } elseif ('{' === $car) { - $regex .= $escaping ? '\\{' : '('; - if (!$escaping) { - ++$inCurlies; - } - } elseif ('}' === $car && $inCurlies) { - $regex .= $escaping ? '}' : ')'; - if (!$escaping) { - --$inCurlies; - } - } elseif (',' === $car && $inCurlies) { - $regex .= $escaping ? ',' : '|'; - } elseif ('\\' === $car) { - if ($escaping) { - $regex .= '\\\\'; - $escaping = false; - } else { - $escaping = true; - } - - continue; - } else { - $regex .= $car; - } - $escaping = false; - } - - return $delimiter.'^'.$regex.'$'.$delimiter; - } -} diff --git a/vendor/symfony/finder/Iterator/CustomFilterIterator.php b/vendor/symfony/finder/Iterator/CustomFilterIterator.php deleted file mode 100644 index f85cb7b..0000000 --- a/vendor/symfony/finder/Iterator/CustomFilterIterator.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * CustomFilterIterator filters files by applying anonymous functions. - * - * The anonymous function receives a \SplFileInfo and must return false - * to remove files. - * - * @author Fabien Potencier - */ -class CustomFilterIterator extends \FilterIterator -{ - private $filters = []; - - /** - * @param \Iterator $iterator The Iterator to filter - * @param callable[] $filters An array of PHP callbacks - * - * @throws \InvalidArgumentException - */ - public function __construct(\Iterator $iterator, array $filters) - { - foreach ($filters as $filter) { - if (!\is_callable($filter)) { - throw new \InvalidArgumentException('Invalid PHP callback.'); - } - } - $this->filters = $filters; - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - * - * @return bool true if the value should be kept, false otherwise - */ - #[\ReturnTypeWillChange] - public function accept() - { - $fileinfo = $this->current(); - - foreach ($this->filters as $filter) { - if (false === $filter($fileinfo)) { - return false; - } - } - - return true; - } -} diff --git a/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php b/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php deleted file mode 100644 index 90616f4..0000000 --- a/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -use Symfony\Component\Finder\Comparator\DateComparator; - -/** - * DateRangeFilterIterator filters out files that are not in the given date range (last modified dates). - * - * @author Fabien Potencier - */ -class DateRangeFilterIterator extends \FilterIterator -{ - private $comparators = []; - - /** - * @param \Iterator $iterator The Iterator to filter - * @param DateComparator[] $comparators An array of DateComparator instances - */ - public function __construct(\Iterator $iterator, array $comparators) - { - $this->comparators = $comparators; - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - * - * @return bool true if the value should be kept, false otherwise - */ - #[\ReturnTypeWillChange] - public function accept() - { - $fileinfo = $this->current(); - - if (!file_exists($fileinfo->getPathname())) { - return false; - } - - $filedate = $fileinfo->getMTime(); - foreach ($this->comparators as $compare) { - if (!$compare->test($filedate)) { - return false; - } - } - - return true; - } -} diff --git a/vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php b/vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php deleted file mode 100644 index e96fefd..0000000 --- a/vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * DepthRangeFilterIterator limits the directory depth. - * - * @author Fabien Potencier - */ -class DepthRangeFilterIterator extends \FilterIterator -{ - private $minDepth = 0; - - /** - * @param \RecursiveIteratorIterator $iterator The Iterator to filter - * @param int $minDepth The min depth - * @param int $maxDepth The max depth - */ - public function __construct(\RecursiveIteratorIterator $iterator, int $minDepth = 0, int $maxDepth = \PHP_INT_MAX) - { - $this->minDepth = $minDepth; - $iterator->setMaxDepth(\PHP_INT_MAX === $maxDepth ? -1 : $maxDepth); - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - * - * @return bool true if the value should be kept, false otherwise - */ - #[\ReturnTypeWillChange] - public function accept() - { - return $this->getInnerIterator()->getDepth() >= $this->minDepth; - } -} diff --git a/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php b/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php deleted file mode 100644 index cf9e678..0000000 --- a/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php +++ /dev/null @@ -1,93 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * ExcludeDirectoryFilterIterator filters out directories. - * - * @author Fabien Potencier - */ -class ExcludeDirectoryFilterIterator extends \FilterIterator implements \RecursiveIterator -{ - private $iterator; - private $isRecursive; - private $excludedDirs = []; - private $excludedPattern; - - /** - * @param \Iterator $iterator The Iterator to filter - * @param string[] $directories An array of directories to exclude - */ - public function __construct(\Iterator $iterator, array $directories) - { - $this->iterator = $iterator; - $this->isRecursive = $iterator instanceof \RecursiveIterator; - $patterns = []; - foreach ($directories as $directory) { - $directory = rtrim($directory, '/'); - if (!$this->isRecursive || str_contains($directory, '/')) { - $patterns[] = preg_quote($directory, '#'); - } else { - $this->excludedDirs[$directory] = true; - } - } - if ($patterns) { - $this->excludedPattern = '#(?:^|/)(?:'.implode('|', $patterns).')(?:/|$)#'; - } - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - * - * @return bool True if the value should be kept, false otherwise - */ - #[\ReturnTypeWillChange] - public function accept() - { - if ($this->isRecursive && isset($this->excludedDirs[$this->getFilename()]) && $this->isDir()) { - return false; - } - - if ($this->excludedPattern) { - $path = $this->isDir() ? $this->current()->getRelativePathname() : $this->current()->getRelativePath(); - $path = str_replace('\\', '/', $path); - - return !preg_match($this->excludedPattern, $path); - } - - return true; - } - - /** - * @return bool - */ - #[\ReturnTypeWillChange] - public function hasChildren() - { - return $this->isRecursive && $this->iterator->hasChildren(); - } - - /** - * @return self - */ - #[\ReturnTypeWillChange] - public function getChildren() - { - $children = new self($this->iterator->getChildren(), []); - $children->excludedDirs = $this->excludedDirs; - $children->excludedPattern = $this->excludedPattern; - - return $children; - } -} diff --git a/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php b/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php deleted file mode 100644 index d054cef..0000000 --- a/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * FileTypeFilterIterator only keeps files, directories, or both. - * - * @author Fabien Potencier - */ -class FileTypeFilterIterator extends \FilterIterator -{ - public const ONLY_FILES = 1; - public const ONLY_DIRECTORIES = 2; - - private $mode; - - /** - * @param \Iterator $iterator The Iterator to filter - * @param int $mode The mode (self::ONLY_FILES or self::ONLY_DIRECTORIES) - */ - public function __construct(\Iterator $iterator, int $mode) - { - $this->mode = $mode; - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - * - * @return bool true if the value should be kept, false otherwise - */ - #[\ReturnTypeWillChange] - public function accept() - { - $fileinfo = $this->current(); - if (self::ONLY_DIRECTORIES === (self::ONLY_DIRECTORIES & $this->mode) && $fileinfo->isFile()) { - return false; - } elseif (self::ONLY_FILES === (self::ONLY_FILES & $this->mode) && $fileinfo->isDir()) { - return false; - } - - return true; - } -} diff --git a/vendor/symfony/finder/Iterator/FilecontentFilterIterator.php b/vendor/symfony/finder/Iterator/FilecontentFilterIterator.php deleted file mode 100644 index 41eb767..0000000 --- a/vendor/symfony/finder/Iterator/FilecontentFilterIterator.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * FilecontentFilterIterator filters files by their contents using patterns (regexps or strings). - * - * @author Fabien Potencier - * @author Włodzimierz Gajda - */ -class FilecontentFilterIterator extends MultiplePcreFilterIterator -{ - /** - * Filters the iterator values. - * - * @return bool true if the value should be kept, false otherwise - */ - #[\ReturnTypeWillChange] - public function accept() - { - if (!$this->matchRegexps && !$this->noMatchRegexps) { - return true; - } - - $fileinfo = $this->current(); - - if ($fileinfo->isDir() || !$fileinfo->isReadable()) { - return false; - } - - $content = $fileinfo->getContents(); - if (!$content) { - return false; - } - - return $this->isAccepted($content); - } - - /** - * Converts string to regexp if necessary. - * - * @param string $str Pattern: string or regexp - * - * @return string regexp corresponding to a given string or regexp - */ - protected function toRegex($str) - { - return $this->isRegex($str) ? $str : '/'.preg_quote($str, '/').'/'; - } -} diff --git a/vendor/symfony/finder/Iterator/FilenameFilterIterator.php b/vendor/symfony/finder/Iterator/FilenameFilterIterator.php deleted file mode 100644 index 8365756..0000000 --- a/vendor/symfony/finder/Iterator/FilenameFilterIterator.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -use Symfony\Component\Finder\Glob; - -/** - * FilenameFilterIterator filters files by patterns (a regexp, a glob, or a string). - * - * @author Fabien Potencier - */ -class FilenameFilterIterator extends MultiplePcreFilterIterator -{ - /** - * Filters the iterator values. - * - * @return bool true if the value should be kept, false otherwise - */ - #[\ReturnTypeWillChange] - public function accept() - { - return $this->isAccepted($this->current()->getFilename()); - } - - /** - * Converts glob to regexp. - * - * PCRE patterns are left unchanged. - * Glob strings are transformed with Glob::toRegex(). - * - * @param string $str Pattern: glob or regexp - * - * @return string regexp corresponding to a given glob or regexp - */ - protected function toRegex($str) - { - return $this->isRegex($str) ? $str : Glob::toRegex($str); - } -} diff --git a/vendor/symfony/finder/Iterator/LazyIterator.php b/vendor/symfony/finder/Iterator/LazyIterator.php deleted file mode 100644 index 32cc37f..0000000 --- a/vendor/symfony/finder/Iterator/LazyIterator.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * @author Jérémy Derussé - * - * @internal - */ -class LazyIterator implements \IteratorAggregate -{ - private $iteratorFactory; - - public function __construct(callable $iteratorFactory) - { - $this->iteratorFactory = $iteratorFactory; - } - - public function getIterator(): \Traversable - { - yield from ($this->iteratorFactory)(); - } -} diff --git a/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php b/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php deleted file mode 100644 index 18b082e..0000000 --- a/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php +++ /dev/null @@ -1,112 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * MultiplePcreFilterIterator filters files using patterns (regexps, globs or strings). - * - * @author Fabien Potencier - */ -abstract class MultiplePcreFilterIterator extends \FilterIterator -{ - protected $matchRegexps = []; - protected $noMatchRegexps = []; - - /** - * @param \Iterator $iterator The Iterator to filter - * @param array $matchPatterns An array of patterns that need to match - * @param array $noMatchPatterns An array of patterns that need to not match - */ - public function __construct(\Iterator $iterator, array $matchPatterns, array $noMatchPatterns) - { - foreach ($matchPatterns as $pattern) { - $this->matchRegexps[] = $this->toRegex($pattern); - } - - foreach ($noMatchPatterns as $pattern) { - $this->noMatchRegexps[] = $this->toRegex($pattern); - } - - parent::__construct($iterator); - } - - /** - * Checks whether the string is accepted by the regex filters. - * - * If there is no regexps defined in the class, this method will accept the string. - * Such case can be handled by child classes before calling the method if they want to - * apply a different behavior. - * - * @param string $string The string to be matched against filters - * - * @return bool - */ - protected function isAccepted($string) - { - // should at least not match one rule to exclude - foreach ($this->noMatchRegexps as $regex) { - if (preg_match($regex, $string)) { - return false; - } - } - - // should at least match one rule - if ($this->matchRegexps) { - foreach ($this->matchRegexps as $regex) { - if (preg_match($regex, $string)) { - return true; - } - } - - return false; - } - - // If there is no match rules, the file is accepted - return true; - } - - /** - * Checks whether the string is a regex. - * - * @param string $str - * - * @return bool Whether the given string is a regex - */ - protected function isRegex($str) - { - if (preg_match('/^(.{3,}?)[imsxuADU]*$/', $str, $m)) { - $start = substr($m[1], 0, 1); - $end = substr($m[1], -1); - - if ($start === $end) { - return !preg_match('/[*?[:alnum:] \\\\]/', $start); - } - - foreach ([['{', '}'], ['(', ')'], ['[', ']'], ['<', '>']] as $delimiters) { - if ($start === $delimiters[0] && $end === $delimiters[1]) { - return true; - } - } - } - - return false; - } - - /** - * Converts string into regexp. - * - * @param string $str Pattern - * - * @return string regexp corresponding to a given string - */ - abstract protected function toRegex($str); -} diff --git a/vendor/symfony/finder/Iterator/PathFilterIterator.php b/vendor/symfony/finder/Iterator/PathFilterIterator.php deleted file mode 100644 index f4aaa1f..0000000 --- a/vendor/symfony/finder/Iterator/PathFilterIterator.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * PathFilterIterator filters files by path patterns (e.g. some/special/dir). - * - * @author Fabien Potencier - * @author Włodzimierz Gajda - */ -class PathFilterIterator extends MultiplePcreFilterIterator -{ - /** - * Filters the iterator values. - * - * @return bool true if the value should be kept, false otherwise - */ - #[\ReturnTypeWillChange] - public function accept() - { - $filename = $this->current()->getRelativePathname(); - - if ('\\' === \DIRECTORY_SEPARATOR) { - $filename = str_replace('\\', '/', $filename); - } - - return $this->isAccepted($filename); - } - - /** - * Converts strings to regexp. - * - * PCRE patterns are left unchanged. - * - * Default conversion: - * 'lorem/ipsum/dolor' ==> 'lorem\/ipsum\/dolor/' - * - * Use only / as directory separator (on Windows also). - * - * @param string $str Pattern: regexp or dirname - * - * @return string regexp corresponding to a given string or regexp - */ - protected function toRegex($str) - { - return $this->isRegex($str) ? $str : '/'.preg_quote($str, '/').'/'; - } -} diff --git a/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php b/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php deleted file mode 100644 index 8508ab7..0000000 --- a/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php +++ /dev/null @@ -1,149 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -use Symfony\Component\Finder\Exception\AccessDeniedException; -use Symfony\Component\Finder\SplFileInfo; - -/** - * Extends the \RecursiveDirectoryIterator to support relative paths. - * - * @author Victor Berchet - */ -class RecursiveDirectoryIterator extends \RecursiveDirectoryIterator -{ - /** - * @var bool - */ - private $ignoreUnreadableDirs; - - /** - * @var bool - */ - private $rewindable; - - // these 3 properties take part of the performance optimization to avoid redoing the same work in all iterations - private $rootPath; - private $subPath; - private $directorySeparator = '/'; - - /** - * @throws \RuntimeException - */ - public function __construct(string $path, int $flags, bool $ignoreUnreadableDirs = false) - { - if ($flags & (self::CURRENT_AS_PATHNAME | self::CURRENT_AS_SELF)) { - throw new \RuntimeException('This iterator only support returning current as fileinfo.'); - } - - parent::__construct($path, $flags); - $this->ignoreUnreadableDirs = $ignoreUnreadableDirs; - $this->rootPath = $path; - if ('/' !== \DIRECTORY_SEPARATOR && !($flags & self::UNIX_PATHS)) { - $this->directorySeparator = \DIRECTORY_SEPARATOR; - } - } - - /** - * Return an instance of SplFileInfo with support for relative paths. - * - * @return SplFileInfo File information - */ - #[\ReturnTypeWillChange] - public function current() - { - // the logic here avoids redoing the same work in all iterations - - if (null === $subPathname = $this->subPath) { - $subPathname = $this->subPath = $this->getSubPath(); - } - if ('' !== $subPathname) { - $subPathname .= $this->directorySeparator; - } - $subPathname .= $this->getFilename(); - - if ('/' !== $basePath = $this->rootPath) { - $basePath .= $this->directorySeparator; - } - - return new SplFileInfo($basePath.$subPathname, $this->subPath, $subPathname); - } - - /** - * @return \RecursiveIterator - * - * @throws AccessDeniedException - */ - #[\ReturnTypeWillChange] - public function getChildren() - { - try { - $children = parent::getChildren(); - - if ($children instanceof self) { - // parent method will call the constructor with default arguments, so unreadable dirs won't be ignored anymore - $children->ignoreUnreadableDirs = $this->ignoreUnreadableDirs; - - // performance optimization to avoid redoing the same work in all children - $children->rewindable = &$this->rewindable; - $children->rootPath = $this->rootPath; - } - - return $children; - } catch (\UnexpectedValueException $e) { - if ($this->ignoreUnreadableDirs) { - // If directory is unreadable and finder is set to ignore it, a fake empty content is returned. - return new \RecursiveArrayIterator([]); - } else { - throw new AccessDeniedException($e->getMessage(), $e->getCode(), $e); - } - } - } - - /** - * Do nothing for non rewindable stream. - * - * @return void - */ - #[\ReturnTypeWillChange] - public function rewind() - { - if (false === $this->isRewindable()) { - return; - } - - parent::rewind(); - } - - /** - * Checks if the stream is rewindable. - * - * @return bool true when the stream is rewindable, false otherwise - */ - public function isRewindable() - { - if (null !== $this->rewindable) { - return $this->rewindable; - } - - if (false !== $stream = @opendir($this->getPath())) { - $infos = stream_get_meta_data($stream); - closedir($stream); - - if ($infos['seekable']) { - return $this->rewindable = true; - } - } - - return $this->rewindable = false; - } -} diff --git a/vendor/symfony/finder/Iterator/SizeRangeFilterIterator.php b/vendor/symfony/finder/Iterator/SizeRangeFilterIterator.php deleted file mode 100644 index 4078f36..0000000 --- a/vendor/symfony/finder/Iterator/SizeRangeFilterIterator.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -use Symfony\Component\Finder\Comparator\NumberComparator; - -/** - * SizeRangeFilterIterator filters out files that are not in the given size range. - * - * @author Fabien Potencier - */ -class SizeRangeFilterIterator extends \FilterIterator -{ - private $comparators = []; - - /** - * @param \Iterator $iterator The Iterator to filter - * @param NumberComparator[] $comparators An array of NumberComparator instances - */ - public function __construct(\Iterator $iterator, array $comparators) - { - $this->comparators = $comparators; - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - * - * @return bool true if the value should be kept, false otherwise - */ - #[\ReturnTypeWillChange] - public function accept() - { - $fileinfo = $this->current(); - if (!$fileinfo->isFile()) { - return true; - } - - $filesize = $fileinfo->getSize(); - foreach ($this->comparators as $compare) { - if (!$compare->test($filesize)) { - return false; - } - } - - return true; - } -} diff --git a/vendor/symfony/finder/Iterator/SortableIterator.php b/vendor/symfony/finder/Iterator/SortableIterator.php deleted file mode 100644 index adc7e99..0000000 --- a/vendor/symfony/finder/Iterator/SortableIterator.php +++ /dev/null @@ -1,101 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * SortableIterator applies a sort on a given Iterator. - * - * @author Fabien Potencier - */ -class SortableIterator implements \IteratorAggregate -{ - public const SORT_BY_NONE = 0; - public const SORT_BY_NAME = 1; - public const SORT_BY_TYPE = 2; - public const SORT_BY_ACCESSED_TIME = 3; - public const SORT_BY_CHANGED_TIME = 4; - public const SORT_BY_MODIFIED_TIME = 5; - public const SORT_BY_NAME_NATURAL = 6; - - private $iterator; - private $sort; - - /** - * @param int|callable $sort The sort type (SORT_BY_NAME, SORT_BY_TYPE, or a PHP callback) - * - * @throws \InvalidArgumentException - */ - public function __construct(\Traversable $iterator, $sort, bool $reverseOrder = false) - { - $this->iterator = $iterator; - $order = $reverseOrder ? -1 : 1; - - if (self::SORT_BY_NAME === $sort) { - $this->sort = static function ($a, $b) use ($order) { - return $order * strcmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); - }; - } elseif (self::SORT_BY_NAME_NATURAL === $sort) { - $this->sort = static function ($a, $b) use ($order) { - return $order * strnatcmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); - }; - } elseif (self::SORT_BY_TYPE === $sort) { - $this->sort = static function ($a, $b) use ($order) { - if ($a->isDir() && $b->isFile()) { - return -$order; - } elseif ($a->isFile() && $b->isDir()) { - return $order; - } - - return $order * strcmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); - }; - } elseif (self::SORT_BY_ACCESSED_TIME === $sort) { - $this->sort = static function ($a, $b) use ($order) { - return $order * ($a->getATime() - $b->getATime()); - }; - } elseif (self::SORT_BY_CHANGED_TIME === $sort) { - $this->sort = static function ($a, $b) use ($order) { - return $order * ($a->getCTime() - $b->getCTime()); - }; - } elseif (self::SORT_BY_MODIFIED_TIME === $sort) { - $this->sort = static function ($a, $b) use ($order) { - return $order * ($a->getMTime() - $b->getMTime()); - }; - } elseif (self::SORT_BY_NONE === $sort) { - $this->sort = $order; - } elseif (\is_callable($sort)) { - $this->sort = $reverseOrder ? static function ($a, $b) use ($sort) { return -$sort($a, $b); } : $sort; - } else { - throw new \InvalidArgumentException('The SortableIterator takes a PHP callable or a valid built-in sort algorithm as an argument.'); - } - } - - /** - * @return \Traversable - */ - #[\ReturnTypeWillChange] - public function getIterator() - { - if (1 === $this->sort) { - return $this->iterator; - } - - $array = iterator_to_array($this->iterator, true); - - if (-1 === $this->sort) { - $array = array_reverse($array); - } else { - uasort($array, $this->sort); - } - - return new \ArrayIterator($array); - } -} diff --git a/vendor/symfony/finder/LICENSE b/vendor/symfony/finder/LICENSE deleted file mode 100644 index 9ff2d0d..0000000 --- a/vendor/symfony/finder/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-2021 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/finder/README.md b/vendor/symfony/finder/README.md deleted file mode 100644 index 22bdeb9..0000000 --- a/vendor/symfony/finder/README.md +++ /dev/null @@ -1,14 +0,0 @@ -Finder Component -================ - -The Finder component finds files and directories via an intuitive fluent -interface. - -Resources ---------- - - * [Documentation](https://symfony.com/doc/current/components/finder.html) - * [Contributing](https://symfony.com/doc/current/contributing/index.html) - * [Report issues](https://github.com/symfony/symfony/issues) and - [send Pull Requests](https://github.com/symfony/symfony/pulls) - in the [main Symfony repository](https://github.com/symfony/symfony) diff --git a/vendor/symfony/finder/SplFileInfo.php b/vendor/symfony/finder/SplFileInfo.php deleted file mode 100644 index 62c9faa..0000000 --- a/vendor/symfony/finder/SplFileInfo.php +++ /dev/null @@ -1,85 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder; - -/** - * Extends \SplFileInfo to support relative paths. - * - * @author Fabien Potencier - */ -class SplFileInfo extends \SplFileInfo -{ - private $relativePath; - private $relativePathname; - - /** - * @param string $file The file name - * @param string $relativePath The relative path - * @param string $relativePathname The relative path name - */ - public function __construct(string $file, string $relativePath, string $relativePathname) - { - parent::__construct($file); - $this->relativePath = $relativePath; - $this->relativePathname = $relativePathname; - } - - /** - * Returns the relative path. - * - * This path does not contain the file name. - * - * @return string the relative path - */ - public function getRelativePath() - { - return $this->relativePath; - } - - /** - * Returns the relative path name. - * - * This path contains the file name. - * - * @return string the relative path name - */ - public function getRelativePathname() - { - return $this->relativePathname; - } - - public function getFilenameWithoutExtension(): string - { - $filename = $this->getFilename(); - - return pathinfo($filename, \PATHINFO_FILENAME); - } - - /** - * Returns the contents of the file. - * - * @return string the contents of the file - * - * @throws \RuntimeException - */ - public function getContents() - { - set_error_handler(function ($type, $msg) use (&$error) { $error = $msg; }); - $content = file_get_contents($this->getPathname()); - restore_error_handler(); - if (false === $content) { - throw new \RuntimeException($error); - } - - return $content; - } -} diff --git a/vendor/symfony/finder/composer.json b/vendor/symfony/finder/composer.json deleted file mode 100644 index 5ccd80c..0000000 --- a/vendor/symfony/finder/composer.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "symfony/finder", - "type": "library", - "description": "Finds files and directories via an intuitive fluent interface", - "keywords": [], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.1.3", - "symfony/polyfill-php80": "^1.16" - }, - "autoload": { - "psr-4": { "Symfony\\Component\\Finder\\": "" }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "minimum-stability": "dev" -} diff --git a/vendor/symfony/polyfill-ctype/Ctype.php b/vendor/symfony/polyfill-ctype/Ctype.php deleted file mode 100644 index 58414dc..0000000 --- a/vendor/symfony/polyfill-ctype/Ctype.php +++ /dev/null @@ -1,227 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Ctype; - -/** - * Ctype implementation through regex. - * - * @internal - * - * @author Gert de Pagter - */ -final class Ctype -{ - /** - * Returns TRUE if every character in text is either a letter or a digit, FALSE otherwise. - * - * @see https://php.net/ctype-alnum - * - * @param string|int $text - * - * @return bool - */ - public static function ctype_alnum($text) - { - $text = self::convert_int_to_char_for_ctype($text); - - return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z0-9]/', $text); - } - - /** - * Returns TRUE if every character in text is a letter, FALSE otherwise. - * - * @see https://php.net/ctype-alpha - * - * @param string|int $text - * - * @return bool - */ - public static function ctype_alpha($text) - { - $text = self::convert_int_to_char_for_ctype($text); - - return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z]/', $text); - } - - /** - * Returns TRUE if every character in text is a control character from the current locale, FALSE otherwise. - * - * @see https://php.net/ctype-cntrl - * - * @param string|int $text - * - * @return bool - */ - public static function ctype_cntrl($text) - { - $text = self::convert_int_to_char_for_ctype($text); - - return \is_string($text) && '' !== $text && !preg_match('/[^\x00-\x1f\x7f]/', $text); - } - - /** - * Returns TRUE if every character in the string text is a decimal digit, FALSE otherwise. - * - * @see https://php.net/ctype-digit - * - * @param string|int $text - * - * @return bool - */ - public static function ctype_digit($text) - { - $text = self::convert_int_to_char_for_ctype($text); - - return \is_string($text) && '' !== $text && !preg_match('/[^0-9]/', $text); - } - - /** - * Returns TRUE if every character in text is printable and actually creates visible output (no white space), FALSE otherwise. - * - * @see https://php.net/ctype-graph - * - * @param string|int $text - * - * @return bool - */ - public static function ctype_graph($text) - { - $text = self::convert_int_to_char_for_ctype($text); - - return \is_string($text) && '' !== $text && !preg_match('/[^!-~]/', $text); - } - - /** - * Returns TRUE if every character in text is a lowercase letter. - * - * @see https://php.net/ctype-lower - * - * @param string|int $text - * - * @return bool - */ - public static function ctype_lower($text) - { - $text = self::convert_int_to_char_for_ctype($text); - - return \is_string($text) && '' !== $text && !preg_match('/[^a-z]/', $text); - } - - /** - * Returns TRUE if every character in text will actually create output (including blanks). Returns FALSE if text contains control characters or characters that do not have any output or control function at all. - * - * @see https://php.net/ctype-print - * - * @param string|int $text - * - * @return bool - */ - public static function ctype_print($text) - { - $text = self::convert_int_to_char_for_ctype($text); - - return \is_string($text) && '' !== $text && !preg_match('/[^ -~]/', $text); - } - - /** - * Returns TRUE if every character in text is printable, but neither letter, digit or blank, FALSE otherwise. - * - * @see https://php.net/ctype-punct - * - * @param string|int $text - * - * @return bool - */ - public static function ctype_punct($text) - { - $text = self::convert_int_to_char_for_ctype($text); - - return \is_string($text) && '' !== $text && !preg_match('/[^!-\/\:-@\[-`\{-~]/', $text); - } - - /** - * Returns TRUE if every character in text creates some sort of white space, FALSE otherwise. Besides the blank character this also includes tab, vertical tab, line feed, carriage return and form feed characters. - * - * @see https://php.net/ctype-space - * - * @param string|int $text - * - * @return bool - */ - public static function ctype_space($text) - { - $text = self::convert_int_to_char_for_ctype($text); - - return \is_string($text) && '' !== $text && !preg_match('/[^\s]/', $text); - } - - /** - * Returns TRUE if every character in text is an uppercase letter. - * - * @see https://php.net/ctype-upper - * - * @param string|int $text - * - * @return bool - */ - public static function ctype_upper($text) - { - $text = self::convert_int_to_char_for_ctype($text); - - return \is_string($text) && '' !== $text && !preg_match('/[^A-Z]/', $text); - } - - /** - * Returns TRUE if every character in text is a hexadecimal 'digit', that is a decimal digit or a character from [A-Fa-f] , FALSE otherwise. - * - * @see https://php.net/ctype-xdigit - * - * @param string|int $text - * - * @return bool - */ - public static function ctype_xdigit($text) - { - $text = self::convert_int_to_char_for_ctype($text); - - return \is_string($text) && '' !== $text && !preg_match('/[^A-Fa-f0-9]/', $text); - } - - /** - * Converts integers to their char versions according to normal ctype behaviour, if needed. - * - * If an integer between -128 and 255 inclusive is provided, - * it is interpreted as the ASCII value of a single character - * (negative values have 256 added in order to allow characters in the Extended ASCII range). - * Any other integer is interpreted as a string containing the decimal digits of the integer. - * - * @param string|int $int - * - * @return mixed - */ - private static function convert_int_to_char_for_ctype($int) - { - if (!\is_int($int)) { - return $int; - } - - if ($int < -128 || $int > 255) { - return (string) $int; - } - - if ($int < 0) { - $int += 256; - } - - return \chr($int); - } -} diff --git a/vendor/symfony/polyfill-ctype/LICENSE b/vendor/symfony/polyfill-ctype/LICENSE deleted file mode 100644 index 3f853aa..0000000 --- a/vendor/symfony/polyfill-ctype/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2018-2019 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/polyfill-ctype/README.md b/vendor/symfony/polyfill-ctype/README.md deleted file mode 100644 index 8add1ab..0000000 --- a/vendor/symfony/polyfill-ctype/README.md +++ /dev/null @@ -1,12 +0,0 @@ -Symfony Polyfill / Ctype -======================== - -This component provides `ctype_*` functions to users who run php versions without the ctype extension. - -More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). - -License -======= - -This library is released under the [MIT license](LICENSE). diff --git a/vendor/symfony/polyfill-ctype/bootstrap.php b/vendor/symfony/polyfill-ctype/bootstrap.php deleted file mode 100644 index d54524b..0000000 --- a/vendor/symfony/polyfill-ctype/bootstrap.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Ctype as p; - -if (\PHP_VERSION_ID >= 80000) { - return require __DIR__.'/bootstrap80.php'; -} - -if (!function_exists('ctype_alnum')) { - function ctype_alnum($text) { return p\Ctype::ctype_alnum($text); } -} -if (!function_exists('ctype_alpha')) { - function ctype_alpha($text) { return p\Ctype::ctype_alpha($text); } -} -if (!function_exists('ctype_cntrl')) { - function ctype_cntrl($text) { return p\Ctype::ctype_cntrl($text); } -} -if (!function_exists('ctype_digit')) { - function ctype_digit($text) { return p\Ctype::ctype_digit($text); } -} -if (!function_exists('ctype_graph')) { - function ctype_graph($text) { return p\Ctype::ctype_graph($text); } -} -if (!function_exists('ctype_lower')) { - function ctype_lower($text) { return p\Ctype::ctype_lower($text); } -} -if (!function_exists('ctype_print')) { - function ctype_print($text) { return p\Ctype::ctype_print($text); } -} -if (!function_exists('ctype_punct')) { - function ctype_punct($text) { return p\Ctype::ctype_punct($text); } -} -if (!function_exists('ctype_space')) { - function ctype_space($text) { return p\Ctype::ctype_space($text); } -} -if (!function_exists('ctype_upper')) { - function ctype_upper($text) { return p\Ctype::ctype_upper($text); } -} -if (!function_exists('ctype_xdigit')) { - function ctype_xdigit($text) { return p\Ctype::ctype_xdigit($text); } -} diff --git a/vendor/symfony/polyfill-ctype/bootstrap80.php b/vendor/symfony/polyfill-ctype/bootstrap80.php deleted file mode 100644 index ab2f861..0000000 --- a/vendor/symfony/polyfill-ctype/bootstrap80.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Ctype as p; - -if (!function_exists('ctype_alnum')) { - function ctype_alnum(mixed $text): bool { return p\Ctype::ctype_alnum($text); } -} -if (!function_exists('ctype_alpha')) { - function ctype_alpha(mixed $text): bool { return p\Ctype::ctype_alpha($text); } -} -if (!function_exists('ctype_cntrl')) { - function ctype_cntrl(mixed $text): bool { return p\Ctype::ctype_cntrl($text); } -} -if (!function_exists('ctype_digit')) { - function ctype_digit(mixed $text): bool { return p\Ctype::ctype_digit($text); } -} -if (!function_exists('ctype_graph')) { - function ctype_graph(mixed $text): bool { return p\Ctype::ctype_graph($text); } -} -if (!function_exists('ctype_lower')) { - function ctype_lower(mixed $text): bool { return p\Ctype::ctype_lower($text); } -} -if (!function_exists('ctype_print')) { - function ctype_print(mixed $text): bool { return p\Ctype::ctype_print($text); } -} -if (!function_exists('ctype_punct')) { - function ctype_punct(mixed $text): bool { return p\Ctype::ctype_punct($text); } -} -if (!function_exists('ctype_space')) { - function ctype_space(mixed $text): bool { return p\Ctype::ctype_space($text); } -} -if (!function_exists('ctype_upper')) { - function ctype_upper(mixed $text): bool { return p\Ctype::ctype_upper($text); } -} -if (!function_exists('ctype_xdigit')) { - function ctype_xdigit(mixed $text): bool { return p\Ctype::ctype_xdigit($text); } -} diff --git a/vendor/symfony/polyfill-ctype/composer.json b/vendor/symfony/polyfill-ctype/composer.json deleted file mode 100644 index f0621a3..0000000 --- a/vendor/symfony/polyfill-ctype/composer.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "symfony/polyfill-ctype", - "type": "library", - "description": "Symfony polyfill for ctype functions", - "keywords": ["polyfill", "compatibility", "portable", "ctype"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.1" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Ctype\\": "" }, - "files": [ "bootstrap.php" ] - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - } -} diff --git a/vendor/symfony/polyfill-mbstring/LICENSE b/vendor/symfony/polyfill-mbstring/LICENSE deleted file mode 100644 index 4cd8bdd..0000000 --- a/vendor/symfony/polyfill-mbstring/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2015-2019 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/polyfill-mbstring/Mbstring.php b/vendor/symfony/polyfill-mbstring/Mbstring.php deleted file mode 100644 index b599095..0000000 --- a/vendor/symfony/polyfill-mbstring/Mbstring.php +++ /dev/null @@ -1,870 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Mbstring; - -/** - * Partial mbstring implementation in PHP, iconv based, UTF-8 centric. - * - * Implemented: - * - mb_chr - Returns a specific character from its Unicode code point - * - mb_convert_encoding - Convert character encoding - * - mb_convert_variables - Convert character code in variable(s) - * - mb_decode_mimeheader - Decode string in MIME header field - * - mb_encode_mimeheader - Encode string for MIME header XXX NATIVE IMPLEMENTATION IS REALLY BUGGED - * - mb_decode_numericentity - Decode HTML numeric string reference to character - * - mb_encode_numericentity - Encode character to HTML numeric string reference - * - mb_convert_case - Perform case folding on a string - * - mb_detect_encoding - Detect character encoding - * - mb_get_info - Get internal settings of mbstring - * - mb_http_input - Detect HTTP input character encoding - * - mb_http_output - Set/Get HTTP output character encoding - * - mb_internal_encoding - Set/Get internal character encoding - * - mb_list_encodings - Returns an array of all supported encodings - * - mb_ord - Returns the Unicode code point of a character - * - mb_output_handler - Callback function converts character encoding in output buffer - * - mb_scrub - Replaces ill-formed byte sequences with substitute characters - * - mb_strlen - Get string length - * - mb_strpos - Find position of first occurrence of string in a string - * - mb_strrpos - Find position of last occurrence of a string in a string - * - mb_str_split - Convert a string to an array - * - mb_strtolower - Make a string lowercase - * - mb_strtoupper - Make a string uppercase - * - mb_substitute_character - Set/Get substitution character - * - mb_substr - Get part of string - * - mb_stripos - Finds position of first occurrence of a string within another, case insensitive - * - mb_stristr - Finds first occurrence of a string within another, case insensitive - * - mb_strrchr - Finds the last occurrence of a character in a string within another - * - mb_strrichr - Finds the last occurrence of a character in a string within another, case insensitive - * - mb_strripos - Finds position of last occurrence of a string within another, case insensitive - * - mb_strstr - Finds first occurrence of a string within another - * - mb_strwidth - Return width of string - * - mb_substr_count - Count the number of substring occurrences - * - * Not implemented: - * - mb_convert_kana - Convert "kana" one from another ("zen-kaku", "han-kaku" and more) - * - mb_ereg_* - Regular expression with multibyte support - * - mb_parse_str - Parse GET/POST/COOKIE data and set global variable - * - mb_preferred_mime_name - Get MIME charset string - * - mb_regex_encoding - Returns current encoding for multibyte regex as string - * - mb_regex_set_options - Set/Get the default options for mbregex functions - * - mb_send_mail - Send encoded mail - * - mb_split - Split multibyte string using regular expression - * - mb_strcut - Get part of string - * - mb_strimwidth - Get truncated string with specified width - * - * @author Nicolas Grekas - * - * @internal - */ -final class Mbstring -{ - public const MB_CASE_FOLD = \PHP_INT_MAX; - - private const CASE_FOLD = [ - ['µ', 'ſ', "\xCD\x85", 'ς', "\xCF\x90", "\xCF\x91", "\xCF\x95", "\xCF\x96", "\xCF\xB0", "\xCF\xB1", "\xCF\xB5", "\xE1\xBA\x9B", "\xE1\xBE\xBE"], - ['μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "\xE1\xB9\xA1", 'ι'], - ]; - - private static $encodingList = ['ASCII', 'UTF-8']; - private static $language = 'neutral'; - private static $internalEncoding = 'UTF-8'; - - public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null) - { - if (\is_array($fromEncoding) || false !== strpos($fromEncoding, ',')) { - $fromEncoding = self::mb_detect_encoding($s, $fromEncoding); - } else { - $fromEncoding = self::getEncoding($fromEncoding); - } - - $toEncoding = self::getEncoding($toEncoding); - - if ('BASE64' === $fromEncoding) { - $s = base64_decode($s); - $fromEncoding = $toEncoding; - } - - if ('BASE64' === $toEncoding) { - return base64_encode($s); - } - - if ('HTML-ENTITIES' === $toEncoding || 'HTML' === $toEncoding) { - if ('HTML-ENTITIES' === $fromEncoding || 'HTML' === $fromEncoding) { - $fromEncoding = 'Windows-1252'; - } - if ('UTF-8' !== $fromEncoding) { - $s = \iconv($fromEncoding, 'UTF-8//IGNORE', $s); - } - - return preg_replace_callback('/[\x80-\xFF]+/', [__CLASS__, 'html_encoding_callback'], $s); - } - - if ('HTML-ENTITIES' === $fromEncoding) { - $s = html_entity_decode($s, \ENT_COMPAT, 'UTF-8'); - $fromEncoding = 'UTF-8'; - } - - return \iconv($fromEncoding, $toEncoding.'//IGNORE', $s); - } - - public static function mb_convert_variables($toEncoding, $fromEncoding, &...$vars) - { - $ok = true; - array_walk_recursive($vars, function (&$v) use (&$ok, $toEncoding, $fromEncoding) { - if (false === $v = self::mb_convert_encoding($v, $toEncoding, $fromEncoding)) { - $ok = false; - } - }); - - return $ok ? $fromEncoding : false; - } - - public static function mb_decode_mimeheader($s) - { - return \iconv_mime_decode($s, 2, self::$internalEncoding); - } - - public static function mb_encode_mimeheader($s, $charset = null, $transferEncoding = null, $linefeed = null, $indent = null) - { - trigger_error('mb_encode_mimeheader() is bugged. Please use iconv_mime_encode() instead', \E_USER_WARNING); - } - - public static function mb_decode_numericentity($s, $convmap, $encoding = null) - { - if (null !== $s && !is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) { - trigger_error('mb_decode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_WARNING); - - return null; - } - - if (!\is_array($convmap) || (80000 > \PHP_VERSION_ID && !$convmap)) { - return false; - } - - if (null !== $encoding && !is_scalar($encoding)) { - trigger_error('mb_decode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_WARNING); - - return ''; // Instead of null (cf. mb_encode_numericentity). - } - - $s = (string) $s; - if ('' === $s) { - return ''; - } - - $encoding = self::getEncoding($encoding); - - if ('UTF-8' === $encoding) { - $encoding = null; - if (!preg_match('//u', $s)) { - $s = @\iconv('UTF-8', 'UTF-8//IGNORE', $s); - } - } else { - $s = \iconv($encoding, 'UTF-8//IGNORE', $s); - } - - $cnt = floor(\count($convmap) / 4) * 4; - - for ($i = 0; $i < $cnt; $i += 4) { - // collector_decode_htmlnumericentity ignores $convmap[$i + 3] - $convmap[$i] += $convmap[$i + 2]; - $convmap[$i + 1] += $convmap[$i + 2]; - } - - $s = preg_replace_callback('/&#(?:0*([0-9]+)|x0*([0-9a-fA-F]+))(?!&);?/', function (array $m) use ($cnt, $convmap) { - $c = isset($m[2]) ? (int) hexdec($m[2]) : $m[1]; - for ($i = 0; $i < $cnt; $i += 4) { - if ($c >= $convmap[$i] && $c <= $convmap[$i + 1]) { - return self::mb_chr($c - $convmap[$i + 2]); - } - } - - return $m[0]; - }, $s); - - if (null === $encoding) { - return $s; - } - - return \iconv('UTF-8', $encoding.'//IGNORE', $s); - } - - public static function mb_encode_numericentity($s, $convmap, $encoding = null, $is_hex = false) - { - if (null !== $s && !is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) { - trigger_error('mb_encode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_WARNING); - - return null; - } - - if (!\is_array($convmap) || (80000 > \PHP_VERSION_ID && !$convmap)) { - return false; - } - - if (null !== $encoding && !is_scalar($encoding)) { - trigger_error('mb_encode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_WARNING); - - return null; // Instead of '' (cf. mb_decode_numericentity). - } - - if (null !== $is_hex && !is_scalar($is_hex)) { - trigger_error('mb_encode_numericentity() expects parameter 4 to be boolean, '.\gettype($s).' given', \E_USER_WARNING); - - return null; - } - - $s = (string) $s; - if ('' === $s) { - return ''; - } - - $encoding = self::getEncoding($encoding); - - if ('UTF-8' === $encoding) { - $encoding = null; - if (!preg_match('//u', $s)) { - $s = @\iconv('UTF-8', 'UTF-8//IGNORE', $s); - } - } else { - $s = \iconv($encoding, 'UTF-8//IGNORE', $s); - } - - static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4]; - - $cnt = floor(\count($convmap) / 4) * 4; - $i = 0; - $len = \strlen($s); - $result = ''; - - while ($i < $len) { - $ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xF0"]; - $uchr = substr($s, $i, $ulen); - $i += $ulen; - $c = self::mb_ord($uchr); - - for ($j = 0; $j < $cnt; $j += 4) { - if ($c >= $convmap[$j] && $c <= $convmap[$j + 1]) { - $cOffset = ($c + $convmap[$j + 2]) & $convmap[$j + 3]; - $result .= $is_hex ? sprintf('&#x%X;', $cOffset) : '&#'.$cOffset.';'; - continue 2; - } - } - $result .= $uchr; - } - - if (null === $encoding) { - return $result; - } - - return \iconv('UTF-8', $encoding.'//IGNORE', $result); - } - - public static function mb_convert_case($s, $mode, $encoding = null) - { - $s = (string) $s; - if ('' === $s) { - return ''; - } - - $encoding = self::getEncoding($encoding); - - if ('UTF-8' === $encoding) { - $encoding = null; - if (!preg_match('//u', $s)) { - $s = @\iconv('UTF-8', 'UTF-8//IGNORE', $s); - } - } else { - $s = \iconv($encoding, 'UTF-8//IGNORE', $s); - } - - if (\MB_CASE_TITLE == $mode) { - static $titleRegexp = null; - if (null === $titleRegexp) { - $titleRegexp = self::getData('titleCaseRegexp'); - } - $s = preg_replace_callback($titleRegexp, [__CLASS__, 'title_case'], $s); - } else { - if (\MB_CASE_UPPER == $mode) { - static $upper = null; - if (null === $upper) { - $upper = self::getData('upperCase'); - } - $map = $upper; - } else { - if (self::MB_CASE_FOLD === $mode) { - $s = str_replace(self::CASE_FOLD[0], self::CASE_FOLD[1], $s); - } - - static $lower = null; - if (null === $lower) { - $lower = self::getData('lowerCase'); - } - $map = $lower; - } - - static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4]; - - $i = 0; - $len = \strlen($s); - - while ($i < $len) { - $ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xF0"]; - $uchr = substr($s, $i, $ulen); - $i += $ulen; - - if (isset($map[$uchr])) { - $uchr = $map[$uchr]; - $nlen = \strlen($uchr); - - if ($nlen == $ulen) { - $nlen = $i; - do { - $s[--$nlen] = $uchr[--$ulen]; - } while ($ulen); - } else { - $s = substr_replace($s, $uchr, $i - $ulen, $ulen); - $len += $nlen - $ulen; - $i += $nlen - $ulen; - } - } - } - } - - if (null === $encoding) { - return $s; - } - - return \iconv('UTF-8', $encoding.'//IGNORE', $s); - } - - public static function mb_internal_encoding($encoding = null) - { - if (null === $encoding) { - return self::$internalEncoding; - } - - $normalizedEncoding = self::getEncoding($encoding); - - if ('UTF-8' === $normalizedEncoding || false !== @\iconv($normalizedEncoding, $normalizedEncoding, ' ')) { - self::$internalEncoding = $normalizedEncoding; - - return true; - } - - if (80000 > \PHP_VERSION_ID) { - return false; - } - - throw new \ValueError(sprintf('Argument #1 ($encoding) must be a valid encoding, "%s" given', $encoding)); - } - - public static function mb_language($lang = null) - { - if (null === $lang) { - return self::$language; - } - - switch ($normalizedLang = strtolower($lang)) { - case 'uni': - case 'neutral': - self::$language = $normalizedLang; - - return true; - } - - if (80000 > \PHP_VERSION_ID) { - return false; - } - - throw new \ValueError(sprintf('Argument #1 ($language) must be a valid language, "%s" given', $lang)); - } - - public static function mb_list_encodings() - { - return ['UTF-8']; - } - - public static function mb_encoding_aliases($encoding) - { - switch (strtoupper($encoding)) { - case 'UTF8': - case 'UTF-8': - return ['utf8']; - } - - return false; - } - - public static function mb_check_encoding($var = null, $encoding = null) - { - if (null === $encoding) { - if (null === $var) { - return false; - } - $encoding = self::$internalEncoding; - } - - return self::mb_detect_encoding($var, [$encoding]) || false !== @\iconv($encoding, $encoding, $var); - } - - public static function mb_detect_encoding($str, $encodingList = null, $strict = false) - { - if (null === $encodingList) { - $encodingList = self::$encodingList; - } else { - if (!\is_array($encodingList)) { - $encodingList = array_map('trim', explode(',', $encodingList)); - } - $encodingList = array_map('strtoupper', $encodingList); - } - - foreach ($encodingList as $enc) { - switch ($enc) { - case 'ASCII': - if (!preg_match('/[\x80-\xFF]/', $str)) { - return $enc; - } - break; - - case 'UTF8': - case 'UTF-8': - if (preg_match('//u', $str)) { - return 'UTF-8'; - } - break; - - default: - if (0 === strncmp($enc, 'ISO-8859-', 9)) { - return $enc; - } - } - } - - return false; - } - - public static function mb_detect_order($encodingList = null) - { - if (null === $encodingList) { - return self::$encodingList; - } - - if (!\is_array($encodingList)) { - $encodingList = array_map('trim', explode(',', $encodingList)); - } - $encodingList = array_map('strtoupper', $encodingList); - - foreach ($encodingList as $enc) { - switch ($enc) { - default: - if (strncmp($enc, 'ISO-8859-', 9)) { - return false; - } - // no break - case 'ASCII': - case 'UTF8': - case 'UTF-8': - } - } - - self::$encodingList = $encodingList; - - return true; - } - - public static function mb_strlen($s, $encoding = null) - { - $encoding = self::getEncoding($encoding); - if ('CP850' === $encoding || 'ASCII' === $encoding) { - return \strlen($s); - } - - return @\iconv_strlen($s, $encoding); - } - - public static function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) - { - $encoding = self::getEncoding($encoding); - if ('CP850' === $encoding || 'ASCII' === $encoding) { - return strpos($haystack, $needle, $offset); - } - - $needle = (string) $needle; - if ('' === $needle) { - if (80000 > \PHP_VERSION_ID) { - trigger_error(__METHOD__.': Empty delimiter', \E_USER_WARNING); - - return false; - } - - return 0; - } - - return \iconv_strpos($haystack, $needle, $offset, $encoding); - } - - public static function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) - { - $encoding = self::getEncoding($encoding); - if ('CP850' === $encoding || 'ASCII' === $encoding) { - return strrpos($haystack, $needle, $offset); - } - - if ($offset != (int) $offset) { - $offset = 0; - } elseif ($offset = (int) $offset) { - if ($offset < 0) { - if (0 > $offset += self::mb_strlen($needle)) { - $haystack = self::mb_substr($haystack, 0, $offset, $encoding); - } - $offset = 0; - } else { - $haystack = self::mb_substr($haystack, $offset, 2147483647, $encoding); - } - } - - $pos = '' !== $needle || 80000 > \PHP_VERSION_ID - ? \iconv_strrpos($haystack, $needle, $encoding) - : self::mb_strlen($haystack, $encoding); - - return false !== $pos ? $offset + $pos : false; - } - - public static function mb_str_split($string, $split_length = 1, $encoding = null) - { - if (null !== $string && !is_scalar($string) && !(\is_object($string) && method_exists($string, '__toString'))) { - trigger_error('mb_str_split() expects parameter 1 to be string, '.\gettype($string).' given', \E_USER_WARNING); - - return null; - } - - if (1 > $split_length = (int) $split_length) { - if (80000 > \PHP_VERSION_ID) { - trigger_error('The length of each segment must be greater than zero', \E_USER_WARNING); - return false; - } - - throw new \ValueError('Argument #2 ($length) must be greater than 0'); - } - - if (null === $encoding) { - $encoding = mb_internal_encoding(); - } - - if ('UTF-8' === $encoding = self::getEncoding($encoding)) { - $rx = '/('; - while (65535 < $split_length) { - $rx .= '.{65535}'; - $split_length -= 65535; - } - $rx .= '.{'.$split_length.'})/us'; - - return preg_split($rx, $string, null, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY); - } - - $result = []; - $length = mb_strlen($string, $encoding); - - for ($i = 0; $i < $length; $i += $split_length) { - $result[] = mb_substr($string, $i, $split_length, $encoding); - } - - return $result; - } - - public static function mb_strtolower($s, $encoding = null) - { - return self::mb_convert_case($s, \MB_CASE_LOWER, $encoding); - } - - public static function mb_strtoupper($s, $encoding = null) - { - return self::mb_convert_case($s, \MB_CASE_UPPER, $encoding); - } - - public static function mb_substitute_character($c = null) - { - if (null === $c) { - return 'none'; - } - if (0 === strcasecmp($c, 'none')) { - return true; - } - if (80000 > \PHP_VERSION_ID) { - return false; - } - - throw new \ValueError('Argument #1 ($substitute_character) must be "none", "long", "entity" or a valid codepoint'); - } - - public static function mb_substr($s, $start, $length = null, $encoding = null) - { - $encoding = self::getEncoding($encoding); - if ('CP850' === $encoding || 'ASCII' === $encoding) { - return (string) substr($s, $start, null === $length ? 2147483647 : $length); - } - - if ($start < 0) { - $start = \iconv_strlen($s, $encoding) + $start; - if ($start < 0) { - $start = 0; - } - } - - if (null === $length) { - $length = 2147483647; - } elseif ($length < 0) { - $length = \iconv_strlen($s, $encoding) + $length - $start; - if ($length < 0) { - return ''; - } - } - - return (string) \iconv_substr($s, $start, $length, $encoding); - } - - public static function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) - { - $haystack = self::mb_convert_case($haystack, self::MB_CASE_FOLD, $encoding); - $needle = self::mb_convert_case($needle, self::MB_CASE_FOLD, $encoding); - - return self::mb_strpos($haystack, $needle, $offset, $encoding); - } - - public static function mb_stristr($haystack, $needle, $part = false, $encoding = null) - { - $pos = self::mb_stripos($haystack, $needle, 0, $encoding); - - return self::getSubpart($pos, $part, $haystack, $encoding); - } - - public static function mb_strrchr($haystack, $needle, $part = false, $encoding = null) - { - $encoding = self::getEncoding($encoding); - if ('CP850' === $encoding || 'ASCII' === $encoding) { - $pos = strrpos($haystack, $needle); - } else { - $needle = self::mb_substr($needle, 0, 1, $encoding); - $pos = \iconv_strrpos($haystack, $needle, $encoding); - } - - return self::getSubpart($pos, $part, $haystack, $encoding); - } - - public static function mb_strrichr($haystack, $needle, $part = false, $encoding = null) - { - $needle = self::mb_substr($needle, 0, 1, $encoding); - $pos = self::mb_strripos($haystack, $needle, $encoding); - - return self::getSubpart($pos, $part, $haystack, $encoding); - } - - public static function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) - { - $haystack = self::mb_convert_case($haystack, self::MB_CASE_FOLD, $encoding); - $needle = self::mb_convert_case($needle, self::MB_CASE_FOLD, $encoding); - - return self::mb_strrpos($haystack, $needle, $offset, $encoding); - } - - public static function mb_strstr($haystack, $needle, $part = false, $encoding = null) - { - $pos = strpos($haystack, $needle); - if (false === $pos) { - return false; - } - if ($part) { - return substr($haystack, 0, $pos); - } - - return substr($haystack, $pos); - } - - public static function mb_get_info($type = 'all') - { - $info = [ - 'internal_encoding' => self::$internalEncoding, - 'http_output' => 'pass', - 'http_output_conv_mimetypes' => '^(text/|application/xhtml\+xml)', - 'func_overload' => 0, - 'func_overload_list' => 'no overload', - 'mail_charset' => 'UTF-8', - 'mail_header_encoding' => 'BASE64', - 'mail_body_encoding' => 'BASE64', - 'illegal_chars' => 0, - 'encoding_translation' => 'Off', - 'language' => self::$language, - 'detect_order' => self::$encodingList, - 'substitute_character' => 'none', - 'strict_detection' => 'Off', - ]; - - if ('all' === $type) { - return $info; - } - if (isset($info[$type])) { - return $info[$type]; - } - - return false; - } - - public static function mb_http_input($type = '') - { - return false; - } - - public static function mb_http_output($encoding = null) - { - return null !== $encoding ? 'pass' === $encoding : 'pass'; - } - - public static function mb_strwidth($s, $encoding = null) - { - $encoding = self::getEncoding($encoding); - - if ('UTF-8' !== $encoding) { - $s = \iconv($encoding, 'UTF-8//IGNORE', $s); - } - - $s = preg_replace('/[\x{1100}-\x{115F}\x{2329}\x{232A}\x{2E80}-\x{303E}\x{3040}-\x{A4CF}\x{AC00}-\x{D7A3}\x{F900}-\x{FAFF}\x{FE10}-\x{FE19}\x{FE30}-\x{FE6F}\x{FF00}-\x{FF60}\x{FFE0}-\x{FFE6}\x{20000}-\x{2FFFD}\x{30000}-\x{3FFFD}]/u', '', $s, -1, $wide); - - return ($wide << 1) + \iconv_strlen($s, 'UTF-8'); - } - - public static function mb_substr_count($haystack, $needle, $encoding = null) - { - return substr_count($haystack, $needle); - } - - public static function mb_output_handler($contents, $status) - { - return $contents; - } - - public static function mb_chr($code, $encoding = null) - { - if (0x80 > $code %= 0x200000) { - $s = \chr($code); - } elseif (0x800 > $code) { - $s = \chr(0xC0 | $code >> 6).\chr(0x80 | $code & 0x3F); - } elseif (0x10000 > $code) { - $s = \chr(0xE0 | $code >> 12).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); - } else { - $s = \chr(0xF0 | $code >> 18).\chr(0x80 | $code >> 12 & 0x3F).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); - } - - if ('UTF-8' !== $encoding = self::getEncoding($encoding)) { - $s = mb_convert_encoding($s, $encoding, 'UTF-8'); - } - - return $s; - } - - public static function mb_ord($s, $encoding = null) - { - if ('UTF-8' !== $encoding = self::getEncoding($encoding)) { - $s = mb_convert_encoding($s, 'UTF-8', $encoding); - } - - if (1 === \strlen($s)) { - return \ord($s); - } - - $code = ($s = unpack('C*', substr($s, 0, 4))) ? $s[1] : 0; - if (0xF0 <= $code) { - return (($code - 0xF0) << 18) + (($s[2] - 0x80) << 12) + (($s[3] - 0x80) << 6) + $s[4] - 0x80; - } - if (0xE0 <= $code) { - return (($code - 0xE0) << 12) + (($s[2] - 0x80) << 6) + $s[3] - 0x80; - } - if (0xC0 <= $code) { - return (($code - 0xC0) << 6) + $s[2] - 0x80; - } - - return $code; - } - - private static function getSubpart($pos, $part, $haystack, $encoding) - { - if (false === $pos) { - return false; - } - if ($part) { - return self::mb_substr($haystack, 0, $pos, $encoding); - } - - return self::mb_substr($haystack, $pos, null, $encoding); - } - - private static function html_encoding_callback(array $m) - { - $i = 1; - $entities = ''; - $m = unpack('C*', htmlentities($m[0], \ENT_COMPAT, 'UTF-8')); - - while (isset($m[$i])) { - if (0x80 > $m[$i]) { - $entities .= \chr($m[$i++]); - continue; - } - if (0xF0 <= $m[$i]) { - $c = (($m[$i++] - 0xF0) << 18) + (($m[$i++] - 0x80) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80; - } elseif (0xE0 <= $m[$i]) { - $c = (($m[$i++] - 0xE0) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80; - } else { - $c = (($m[$i++] - 0xC0) << 6) + $m[$i++] - 0x80; - } - - $entities .= '&#'.$c.';'; - } - - return $entities; - } - - private static function title_case(array $s) - { - return self::mb_convert_case($s[1], \MB_CASE_UPPER, 'UTF-8').self::mb_convert_case($s[2], \MB_CASE_LOWER, 'UTF-8'); - } - - private static function getData($file) - { - if (file_exists($file = __DIR__.'/Resources/unidata/'.$file.'.php')) { - return require $file; - } - - return false; - } - - private static function getEncoding($encoding) - { - if (null === $encoding) { - return self::$internalEncoding; - } - - if ('UTF-8' === $encoding) { - return 'UTF-8'; - } - - $encoding = strtoupper($encoding); - - if ('8BIT' === $encoding || 'BINARY' === $encoding) { - return 'CP850'; - } - - if ('UTF8' === $encoding) { - return 'UTF-8'; - } - - return $encoding; - } -} diff --git a/vendor/symfony/polyfill-mbstring/README.md b/vendor/symfony/polyfill-mbstring/README.md deleted file mode 100644 index 4efb599..0000000 --- a/vendor/symfony/polyfill-mbstring/README.md +++ /dev/null @@ -1,13 +0,0 @@ -Symfony Polyfill / Mbstring -=========================== - -This component provides a partial, native PHP implementation for the -[Mbstring](https://php.net/mbstring) extension. - -More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). - -License -======= - -This library is released under the [MIT license](LICENSE). diff --git a/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php b/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php deleted file mode 100644 index fac60b0..0000000 --- a/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php +++ /dev/null @@ -1,1397 +0,0 @@ - 'a', - 'B' => 'b', - 'C' => 'c', - 'D' => 'd', - 'E' => 'e', - 'F' => 'f', - 'G' => 'g', - 'H' => 'h', - 'I' => 'i', - 'J' => 'j', - 'K' => 'k', - 'L' => 'l', - 'M' => 'm', - 'N' => 'n', - 'O' => 'o', - 'P' => 'p', - 'Q' => 'q', - 'R' => 'r', - 'S' => 's', - 'T' => 't', - 'U' => 'u', - 'V' => 'v', - 'W' => 'w', - 'X' => 'x', - 'Y' => 'y', - 'Z' => 'z', - 'À' => 'à', - 'Á' => 'á', - 'Â' => 'â', - 'Ã' => 'ã', - 'Ä' => 'ä', - 'Å' => 'å', - 'Æ' => 'æ', - 'Ç' => 'ç', - 'È' => 'è', - 'É' => 'é', - 'Ê' => 'ê', - 'Ë' => 'ë', - 'Ì' => 'ì', - 'Í' => 'í', - 'Î' => 'î', - 'Ï' => 'ï', - 'Ð' => 'ð', - 'Ñ' => 'ñ', - 'Ò' => 'ò', - 'Ó' => 'ó', - 'Ô' => 'ô', - 'Õ' => 'õ', - 'Ö' => 'ö', - 'Ø' => 'ø', - 'Ù' => 'ù', - 'Ú' => 'ú', - 'Û' => 'û', - 'Ü' => 'ü', - 'Ý' => 'ý', - 'Þ' => 'þ', - 'Ā' => 'ā', - 'Ă' => 'ă', - 'Ą' => 'ą', - 'Ć' => 'ć', - 'Ĉ' => 'ĉ', - 'Ċ' => 'ċ', - 'Č' => 'č', - 'Ď' => 'ď', - 'Đ' => 'đ', - 'Ē' => 'ē', - 'Ĕ' => 'ĕ', - 'Ė' => 'ė', - 'Ę' => 'ę', - 'Ě' => 'ě', - 'Ĝ' => 'ĝ', - 'Ğ' => 'ğ', - 'Ġ' => 'ġ', - 'Ģ' => 'ģ', - 'Ĥ' => 'ĥ', - 'Ħ' => 'ħ', - 'Ĩ' => 'ĩ', - 'Ī' => 'ī', - 'Ĭ' => 'ĭ', - 'Į' => 'į', - 'İ' => 'i̇', - 'IJ' => 'ij', - 'Ĵ' => 'ĵ', - 'Ķ' => 'ķ', - 'Ĺ' => 'ĺ', - 'Ļ' => 'ļ', - 'Ľ' => 'ľ', - 'Ŀ' => 'ŀ', - 'Ł' => 'ł', - 'Ń' => 'ń', - 'Ņ' => 'ņ', - 'Ň' => 'ň', - 'Ŋ' => 'ŋ', - 'Ō' => 'ō', - 'Ŏ' => 'ŏ', - 'Ő' => 'ő', - 'Œ' => 'œ', - 'Ŕ' => 'ŕ', - 'Ŗ' => 'ŗ', - 'Ř' => 'ř', - 'Ś' => 'ś', - 'Ŝ' => 'ŝ', - 'Ş' => 'ş', - 'Š' => 'š', - 'Ţ' => 'ţ', - 'Ť' => 'ť', - 'Ŧ' => 'ŧ', - 'Ũ' => 'ũ', - 'Ū' => 'ū', - 'Ŭ' => 'ŭ', - 'Ů' => 'ů', - 'Ű' => 'ű', - 'Ų' => 'ų', - 'Ŵ' => 'ŵ', - 'Ŷ' => 'ŷ', - 'Ÿ' => 'ÿ', - 'Ź' => 'ź', - 'Ż' => 'ż', - 'Ž' => 'ž', - 'Ɓ' => 'ɓ', - 'Ƃ' => 'ƃ', - 'Ƅ' => 'ƅ', - 'Ɔ' => 'ɔ', - 'Ƈ' => 'ƈ', - 'Ɖ' => 'ɖ', - 'Ɗ' => 'ɗ', - 'Ƌ' => 'ƌ', - 'Ǝ' => 'ǝ', - 'Ə' => 'ə', - 'Ɛ' => 'ɛ', - 'Ƒ' => 'ƒ', - 'Ɠ' => 'ɠ', - 'Ɣ' => 'ɣ', - 'Ɩ' => 'ɩ', - 'Ɨ' => 'ɨ', - 'Ƙ' => 'ƙ', - 'Ɯ' => 'ɯ', - 'Ɲ' => 'ɲ', - 'Ɵ' => 'ɵ', - 'Ơ' => 'ơ', - 'Ƣ' => 'ƣ', - 'Ƥ' => 'ƥ', - 'Ʀ' => 'ʀ', - 'Ƨ' => 'ƨ', - 'Ʃ' => 'ʃ', - 'Ƭ' => 'ƭ', - 'Ʈ' => 'ʈ', - 'Ư' => 'ư', - 'Ʊ' => 'ʊ', - 'Ʋ' => 'ʋ', - 'Ƴ' => 'ƴ', - 'Ƶ' => 'ƶ', - 'Ʒ' => 'ʒ', - 'Ƹ' => 'ƹ', - 'Ƽ' => 'ƽ', - 'DŽ' => 'dž', - 'Dž' => 'dž', - 'LJ' => 'lj', - 'Lj' => 'lj', - 'NJ' => 'nj', - 'Nj' => 'nj', - 'Ǎ' => 'ǎ', - 'Ǐ' => 'ǐ', - 'Ǒ' => 'ǒ', - 'Ǔ' => 'ǔ', - 'Ǖ' => 'ǖ', - 'Ǘ' => 'ǘ', - 'Ǚ' => 'ǚ', - 'Ǜ' => 'ǜ', - 'Ǟ' => 'ǟ', - 'Ǡ' => 'ǡ', - 'Ǣ' => 'ǣ', - 'Ǥ' => 'ǥ', - 'Ǧ' => 'ǧ', - 'Ǩ' => 'ǩ', - 'Ǫ' => 'ǫ', - 'Ǭ' => 'ǭ', - 'Ǯ' => 'ǯ', - 'DZ' => 'dz', - 'Dz' => 'dz', - 'Ǵ' => 'ǵ', - 'Ƕ' => 'ƕ', - 'Ƿ' => 'ƿ', - 'Ǹ' => 'ǹ', - 'Ǻ' => 'ǻ', - 'Ǽ' => 'ǽ', - 'Ǿ' => 'ǿ', - 'Ȁ' => 'ȁ', - 'Ȃ' => 'ȃ', - 'Ȅ' => 'ȅ', - 'Ȇ' => 'ȇ', - 'Ȉ' => 'ȉ', - 'Ȋ' => 'ȋ', - 'Ȍ' => 'ȍ', - 'Ȏ' => 'ȏ', - 'Ȑ' => 'ȑ', - 'Ȓ' => 'ȓ', - 'Ȕ' => 'ȕ', - 'Ȗ' => 'ȗ', - 'Ș' => 'ș', - 'Ț' => 'ț', - 'Ȝ' => 'ȝ', - 'Ȟ' => 'ȟ', - 'Ƞ' => 'ƞ', - 'Ȣ' => 'ȣ', - 'Ȥ' => 'ȥ', - 'Ȧ' => 'ȧ', - 'Ȩ' => 'ȩ', - 'Ȫ' => 'ȫ', - 'Ȭ' => 'ȭ', - 'Ȯ' => 'ȯ', - 'Ȱ' => 'ȱ', - 'Ȳ' => 'ȳ', - 'Ⱥ' => 'ⱥ', - 'Ȼ' => 'ȼ', - 'Ƚ' => 'ƚ', - 'Ⱦ' => 'ⱦ', - 'Ɂ' => 'ɂ', - 'Ƀ' => 'ƀ', - 'Ʉ' => 'ʉ', - 'Ʌ' => 'ʌ', - 'Ɇ' => 'ɇ', - 'Ɉ' => 'ɉ', - 'Ɋ' => 'ɋ', - 'Ɍ' => 'ɍ', - 'Ɏ' => 'ɏ', - 'Ͱ' => 'ͱ', - 'Ͳ' => 'ͳ', - 'Ͷ' => 'ͷ', - 'Ϳ' => 'ϳ', - 'Ά' => 'ά', - 'Έ' => 'έ', - 'Ή' => 'ή', - 'Ί' => 'ί', - 'Ό' => 'ό', - 'Ύ' => 'ύ', - 'Ώ' => 'ώ', - 'Α' => 'α', - 'Β' => 'β', - 'Γ' => 'γ', - 'Δ' => 'δ', - 'Ε' => 'ε', - 'Ζ' => 'ζ', - 'Η' => 'η', - 'Θ' => 'θ', - 'Ι' => 'ι', - 'Κ' => 'κ', - 'Λ' => 'λ', - 'Μ' => 'μ', - 'Ν' => 'ν', - 'Ξ' => 'ξ', - 'Ο' => 'ο', - 'Π' => 'π', - 'Ρ' => 'ρ', - 'Σ' => 'σ', - 'Τ' => 'τ', - 'Υ' => 'υ', - 'Φ' => 'φ', - 'Χ' => 'χ', - 'Ψ' => 'ψ', - 'Ω' => 'ω', - 'Ϊ' => 'ϊ', - 'Ϋ' => 'ϋ', - 'Ϗ' => 'ϗ', - 'Ϙ' => 'ϙ', - 'Ϛ' => 'ϛ', - 'Ϝ' => 'ϝ', - 'Ϟ' => 'ϟ', - 'Ϡ' => 'ϡ', - 'Ϣ' => 'ϣ', - 'Ϥ' => 'ϥ', - 'Ϧ' => 'ϧ', - 'Ϩ' => 'ϩ', - 'Ϫ' => 'ϫ', - 'Ϭ' => 'ϭ', - 'Ϯ' => 'ϯ', - 'ϴ' => 'θ', - 'Ϸ' => 'ϸ', - 'Ϲ' => 'ϲ', - 'Ϻ' => 'ϻ', - 'Ͻ' => 'ͻ', - 'Ͼ' => 'ͼ', - 'Ͽ' => 'ͽ', - 'Ѐ' => 'ѐ', - 'Ё' => 'ё', - 'Ђ' => 'ђ', - 'Ѓ' => 'ѓ', - 'Є' => 'є', - 'Ѕ' => 'ѕ', - 'І' => 'і', - 'Ї' => 'ї', - 'Ј' => 'ј', - 'Љ' => 'љ', - 'Њ' => 'њ', - 'Ћ' => 'ћ', - 'Ќ' => 'ќ', - 'Ѝ' => 'ѝ', - 'Ў' => 'ў', - 'Џ' => 'џ', - 'А' => 'а', - 'Б' => 'б', - 'В' => 'в', - 'Г' => 'г', - 'Д' => 'д', - 'Е' => 'е', - 'Ж' => 'ж', - 'З' => 'з', - 'И' => 'и', - 'Й' => 'й', - 'К' => 'к', - 'Л' => 'л', - 'М' => 'м', - 'Н' => 'н', - 'О' => 'о', - 'П' => 'п', - 'Р' => 'р', - 'С' => 'с', - 'Т' => 'т', - 'У' => 'у', - 'Ф' => 'ф', - 'Х' => 'х', - 'Ц' => 'ц', - 'Ч' => 'ч', - 'Ш' => 'ш', - 'Щ' => 'щ', - 'Ъ' => 'ъ', - 'Ы' => 'ы', - 'Ь' => 'ь', - 'Э' => 'э', - 'Ю' => 'ю', - 'Я' => 'я', - 'Ѡ' => 'ѡ', - 'Ѣ' => 'ѣ', - 'Ѥ' => 'ѥ', - 'Ѧ' => 'ѧ', - 'Ѩ' => 'ѩ', - 'Ѫ' => 'ѫ', - 'Ѭ' => 'ѭ', - 'Ѯ' => 'ѯ', - 'Ѱ' => 'ѱ', - 'Ѳ' => 'ѳ', - 'Ѵ' => 'ѵ', - 'Ѷ' => 'ѷ', - 'Ѹ' => 'ѹ', - 'Ѻ' => 'ѻ', - 'Ѽ' => 'ѽ', - 'Ѿ' => 'ѿ', - 'Ҁ' => 'ҁ', - 'Ҋ' => 'ҋ', - 'Ҍ' => 'ҍ', - 'Ҏ' => 'ҏ', - 'Ґ' => 'ґ', - 'Ғ' => 'ғ', - 'Ҕ' => 'ҕ', - 'Җ' => 'җ', - 'Ҙ' => 'ҙ', - 'Қ' => 'қ', - 'Ҝ' => 'ҝ', - 'Ҟ' => 'ҟ', - 'Ҡ' => 'ҡ', - 'Ң' => 'ң', - 'Ҥ' => 'ҥ', - 'Ҧ' => 'ҧ', - 'Ҩ' => 'ҩ', - 'Ҫ' => 'ҫ', - 'Ҭ' => 'ҭ', - 'Ү' => 'ү', - 'Ұ' => 'ұ', - 'Ҳ' => 'ҳ', - 'Ҵ' => 'ҵ', - 'Ҷ' => 'ҷ', - 'Ҹ' => 'ҹ', - 'Һ' => 'һ', - 'Ҽ' => 'ҽ', - 'Ҿ' => 'ҿ', - 'Ӏ' => 'ӏ', - 'Ӂ' => 'ӂ', - 'Ӄ' => 'ӄ', - 'Ӆ' => 'ӆ', - 'Ӈ' => 'ӈ', - 'Ӊ' => 'ӊ', - 'Ӌ' => 'ӌ', - 'Ӎ' => 'ӎ', - 'Ӑ' => 'ӑ', - 'Ӓ' => 'ӓ', - 'Ӕ' => 'ӕ', - 'Ӗ' => 'ӗ', - 'Ә' => 'ә', - 'Ӛ' => 'ӛ', - 'Ӝ' => 'ӝ', - 'Ӟ' => 'ӟ', - 'Ӡ' => 'ӡ', - 'Ӣ' => 'ӣ', - 'Ӥ' => 'ӥ', - 'Ӧ' => 'ӧ', - 'Ө' => 'ө', - 'Ӫ' => 'ӫ', - 'Ӭ' => 'ӭ', - 'Ӯ' => 'ӯ', - 'Ӱ' => 'ӱ', - 'Ӳ' => 'ӳ', - 'Ӵ' => 'ӵ', - 'Ӷ' => 'ӷ', - 'Ӹ' => 'ӹ', - 'Ӻ' => 'ӻ', - 'Ӽ' => 'ӽ', - 'Ӿ' => 'ӿ', - 'Ԁ' => 'ԁ', - 'Ԃ' => 'ԃ', - 'Ԅ' => 'ԅ', - 'Ԇ' => 'ԇ', - 'Ԉ' => 'ԉ', - 'Ԋ' => 'ԋ', - 'Ԍ' => 'ԍ', - 'Ԏ' => 'ԏ', - 'Ԑ' => 'ԑ', - 'Ԓ' => 'ԓ', - 'Ԕ' => 'ԕ', - 'Ԗ' => 'ԗ', - 'Ԙ' => 'ԙ', - 'Ԛ' => 'ԛ', - 'Ԝ' => 'ԝ', - 'Ԟ' => 'ԟ', - 'Ԡ' => 'ԡ', - 'Ԣ' => 'ԣ', - 'Ԥ' => 'ԥ', - 'Ԧ' => 'ԧ', - 'Ԩ' => 'ԩ', - 'Ԫ' => 'ԫ', - 'Ԭ' => 'ԭ', - 'Ԯ' => 'ԯ', - 'Ա' => 'ա', - 'Բ' => 'բ', - 'Գ' => 'գ', - 'Դ' => 'դ', - 'Ե' => 'ե', - 'Զ' => 'զ', - 'Է' => 'է', - 'Ը' => 'ը', - 'Թ' => 'թ', - 'Ժ' => 'ժ', - 'Ի' => 'ի', - 'Լ' => 'լ', - 'Խ' => 'խ', - 'Ծ' => 'ծ', - 'Կ' => 'կ', - 'Հ' => 'հ', - 'Ձ' => 'ձ', - 'Ղ' => 'ղ', - 'Ճ' => 'ճ', - 'Մ' => 'մ', - 'Յ' => 'յ', - 'Ն' => 'ն', - 'Շ' => 'շ', - 'Ո' => 'ո', - 'Չ' => 'չ', - 'Պ' => 'պ', - 'Ջ' => 'ջ', - 'Ռ' => 'ռ', - 'Ս' => 'ս', - 'Վ' => 'վ', - 'Տ' => 'տ', - 'Ր' => 'ր', - 'Ց' => 'ց', - 'Ւ' => 'ւ', - 'Փ' => 'փ', - 'Ք' => 'ք', - 'Օ' => 'օ', - 'Ֆ' => 'ֆ', - 'Ⴀ' => 'ⴀ', - 'Ⴁ' => 'ⴁ', - 'Ⴂ' => 'ⴂ', - 'Ⴃ' => 'ⴃ', - 'Ⴄ' => 'ⴄ', - 'Ⴅ' => 'ⴅ', - 'Ⴆ' => 'ⴆ', - 'Ⴇ' => 'ⴇ', - 'Ⴈ' => 'ⴈ', - 'Ⴉ' => 'ⴉ', - 'Ⴊ' => 'ⴊ', - 'Ⴋ' => 'ⴋ', - 'Ⴌ' => 'ⴌ', - 'Ⴍ' => 'ⴍ', - 'Ⴎ' => 'ⴎ', - 'Ⴏ' => 'ⴏ', - 'Ⴐ' => 'ⴐ', - 'Ⴑ' => 'ⴑ', - 'Ⴒ' => 'ⴒ', - 'Ⴓ' => 'ⴓ', - 'Ⴔ' => 'ⴔ', - 'Ⴕ' => 'ⴕ', - 'Ⴖ' => 'ⴖ', - 'Ⴗ' => 'ⴗ', - 'Ⴘ' => 'ⴘ', - 'Ⴙ' => 'ⴙ', - 'Ⴚ' => 'ⴚ', - 'Ⴛ' => 'ⴛ', - 'Ⴜ' => 'ⴜ', - 'Ⴝ' => 'ⴝ', - 'Ⴞ' => 'ⴞ', - 'Ⴟ' => 'ⴟ', - 'Ⴠ' => 'ⴠ', - 'Ⴡ' => 'ⴡ', - 'Ⴢ' => 'ⴢ', - 'Ⴣ' => 'ⴣ', - 'Ⴤ' => 'ⴤ', - 'Ⴥ' => 'ⴥ', - 'Ⴧ' => 'ⴧ', - 'Ⴭ' => 'ⴭ', - 'Ꭰ' => 'ꭰ', - 'Ꭱ' => 'ꭱ', - 'Ꭲ' => 'ꭲ', - 'Ꭳ' => 'ꭳ', - 'Ꭴ' => 'ꭴ', - 'Ꭵ' => 'ꭵ', - 'Ꭶ' => 'ꭶ', - 'Ꭷ' => 'ꭷ', - 'Ꭸ' => 'ꭸ', - 'Ꭹ' => 'ꭹ', - 'Ꭺ' => 'ꭺ', - 'Ꭻ' => 'ꭻ', - 'Ꭼ' => 'ꭼ', - 'Ꭽ' => 'ꭽ', - 'Ꭾ' => 'ꭾ', - 'Ꭿ' => 'ꭿ', - 'Ꮀ' => 'ꮀ', - 'Ꮁ' => 'ꮁ', - 'Ꮂ' => 'ꮂ', - 'Ꮃ' => 'ꮃ', - 'Ꮄ' => 'ꮄ', - 'Ꮅ' => 'ꮅ', - 'Ꮆ' => 'ꮆ', - 'Ꮇ' => 'ꮇ', - 'Ꮈ' => 'ꮈ', - 'Ꮉ' => 'ꮉ', - 'Ꮊ' => 'ꮊ', - 'Ꮋ' => 'ꮋ', - 'Ꮌ' => 'ꮌ', - 'Ꮍ' => 'ꮍ', - 'Ꮎ' => 'ꮎ', - 'Ꮏ' => 'ꮏ', - 'Ꮐ' => 'ꮐ', - 'Ꮑ' => 'ꮑ', - 'Ꮒ' => 'ꮒ', - 'Ꮓ' => 'ꮓ', - 'Ꮔ' => 'ꮔ', - 'Ꮕ' => 'ꮕ', - 'Ꮖ' => 'ꮖ', - 'Ꮗ' => 'ꮗ', - 'Ꮘ' => 'ꮘ', - 'Ꮙ' => 'ꮙ', - 'Ꮚ' => 'ꮚ', - 'Ꮛ' => 'ꮛ', - 'Ꮜ' => 'ꮜ', - 'Ꮝ' => 'ꮝ', - 'Ꮞ' => 'ꮞ', - 'Ꮟ' => 'ꮟ', - 'Ꮠ' => 'ꮠ', - 'Ꮡ' => 'ꮡ', - 'Ꮢ' => 'ꮢ', - 'Ꮣ' => 'ꮣ', - 'Ꮤ' => 'ꮤ', - 'Ꮥ' => 'ꮥ', - 'Ꮦ' => 'ꮦ', - 'Ꮧ' => 'ꮧ', - 'Ꮨ' => 'ꮨ', - 'Ꮩ' => 'ꮩ', - 'Ꮪ' => 'ꮪ', - 'Ꮫ' => 'ꮫ', - 'Ꮬ' => 'ꮬ', - 'Ꮭ' => 'ꮭ', - 'Ꮮ' => 'ꮮ', - 'Ꮯ' => 'ꮯ', - 'Ꮰ' => 'ꮰ', - 'Ꮱ' => 'ꮱ', - 'Ꮲ' => 'ꮲ', - 'Ꮳ' => 'ꮳ', - 'Ꮴ' => 'ꮴ', - 'Ꮵ' => 'ꮵ', - 'Ꮶ' => 'ꮶ', - 'Ꮷ' => 'ꮷ', - 'Ꮸ' => 'ꮸ', - 'Ꮹ' => 'ꮹ', - 'Ꮺ' => 'ꮺ', - 'Ꮻ' => 'ꮻ', - 'Ꮼ' => 'ꮼ', - 'Ꮽ' => 'ꮽ', - 'Ꮾ' => 'ꮾ', - 'Ꮿ' => 'ꮿ', - 'Ᏸ' => 'ᏸ', - 'Ᏹ' => 'ᏹ', - 'Ᏺ' => 'ᏺ', - 'Ᏻ' => 'ᏻ', - 'Ᏼ' => 'ᏼ', - 'Ᏽ' => 'ᏽ', - 'Ა' => 'ა', - 'Ბ' => 'ბ', - 'Გ' => 'გ', - 'Დ' => 'დ', - 'Ე' => 'ე', - 'Ვ' => 'ვ', - 'Ზ' => 'ზ', - 'Თ' => 'თ', - 'Ი' => 'ი', - 'Კ' => 'კ', - 'Ლ' => 'ლ', - 'Მ' => 'მ', - 'Ნ' => 'ნ', - 'Ო' => 'ო', - 'Პ' => 'პ', - 'Ჟ' => 'ჟ', - 'Რ' => 'რ', - 'Ს' => 'ს', - 'Ტ' => 'ტ', - 'Უ' => 'უ', - 'Ფ' => 'ფ', - 'Ქ' => 'ქ', - 'Ღ' => 'ღ', - 'Ყ' => 'ყ', - 'Შ' => 'შ', - 'Ჩ' => 'ჩ', - 'Ც' => 'ც', - 'Ძ' => 'ძ', - 'Წ' => 'წ', - 'Ჭ' => 'ჭ', - 'Ხ' => 'ხ', - 'Ჯ' => 'ჯ', - 'Ჰ' => 'ჰ', - 'Ჱ' => 'ჱ', - 'Ჲ' => 'ჲ', - 'Ჳ' => 'ჳ', - 'Ჴ' => 'ჴ', - 'Ჵ' => 'ჵ', - 'Ჶ' => 'ჶ', - 'Ჷ' => 'ჷ', - 'Ჸ' => 'ჸ', - 'Ჹ' => 'ჹ', - 'Ჺ' => 'ჺ', - 'Ჽ' => 'ჽ', - 'Ჾ' => 'ჾ', - 'Ჿ' => 'ჿ', - 'Ḁ' => 'ḁ', - 'Ḃ' => 'ḃ', - 'Ḅ' => 'ḅ', - 'Ḇ' => 'ḇ', - 'Ḉ' => 'ḉ', - 'Ḋ' => 'ḋ', - 'Ḍ' => 'ḍ', - 'Ḏ' => 'ḏ', - 'Ḑ' => 'ḑ', - 'Ḓ' => 'ḓ', - 'Ḕ' => 'ḕ', - 'Ḗ' => 'ḗ', - 'Ḙ' => 'ḙ', - 'Ḛ' => 'ḛ', - 'Ḝ' => 'ḝ', - 'Ḟ' => 'ḟ', - 'Ḡ' => 'ḡ', - 'Ḣ' => 'ḣ', - 'Ḥ' => 'ḥ', - 'Ḧ' => 'ḧ', - 'Ḩ' => 'ḩ', - 'Ḫ' => 'ḫ', - 'Ḭ' => 'ḭ', - 'Ḯ' => 'ḯ', - 'Ḱ' => 'ḱ', - 'Ḳ' => 'ḳ', - 'Ḵ' => 'ḵ', - 'Ḷ' => 'ḷ', - 'Ḹ' => 'ḹ', - 'Ḻ' => 'ḻ', - 'Ḽ' => 'ḽ', - 'Ḿ' => 'ḿ', - 'Ṁ' => 'ṁ', - 'Ṃ' => 'ṃ', - 'Ṅ' => 'ṅ', - 'Ṇ' => 'ṇ', - 'Ṉ' => 'ṉ', - 'Ṋ' => 'ṋ', - 'Ṍ' => 'ṍ', - 'Ṏ' => 'ṏ', - 'Ṑ' => 'ṑ', - 'Ṓ' => 'ṓ', - 'Ṕ' => 'ṕ', - 'Ṗ' => 'ṗ', - 'Ṙ' => 'ṙ', - 'Ṛ' => 'ṛ', - 'Ṝ' => 'ṝ', - 'Ṟ' => 'ṟ', - 'Ṡ' => 'ṡ', - 'Ṣ' => 'ṣ', - 'Ṥ' => 'ṥ', - 'Ṧ' => 'ṧ', - 'Ṩ' => 'ṩ', - 'Ṫ' => 'ṫ', - 'Ṭ' => 'ṭ', - 'Ṯ' => 'ṯ', - 'Ṱ' => 'ṱ', - 'Ṳ' => 'ṳ', - 'Ṵ' => 'ṵ', - 'Ṷ' => 'ṷ', - 'Ṹ' => 'ṹ', - 'Ṻ' => 'ṻ', - 'Ṽ' => 'ṽ', - 'Ṿ' => 'ṿ', - 'Ẁ' => 'ẁ', - 'Ẃ' => 'ẃ', - 'Ẅ' => 'ẅ', - 'Ẇ' => 'ẇ', - 'Ẉ' => 'ẉ', - 'Ẋ' => 'ẋ', - 'Ẍ' => 'ẍ', - 'Ẏ' => 'ẏ', - 'Ẑ' => 'ẑ', - 'Ẓ' => 'ẓ', - 'Ẕ' => 'ẕ', - 'ẞ' => 'ß', - 'Ạ' => 'ạ', - 'Ả' => 'ả', - 'Ấ' => 'ấ', - 'Ầ' => 'ầ', - 'Ẩ' => 'ẩ', - 'Ẫ' => 'ẫ', - 'Ậ' => 'ậ', - 'Ắ' => 'ắ', - 'Ằ' => 'ằ', - 'Ẳ' => 'ẳ', - 'Ẵ' => 'ẵ', - 'Ặ' => 'ặ', - 'Ẹ' => 'ẹ', - 'Ẻ' => 'ẻ', - 'Ẽ' => 'ẽ', - 'Ế' => 'ế', - 'Ề' => 'ề', - 'Ể' => 'ể', - 'Ễ' => 'ễ', - 'Ệ' => 'ệ', - 'Ỉ' => 'ỉ', - 'Ị' => 'ị', - 'Ọ' => 'ọ', - 'Ỏ' => 'ỏ', - 'Ố' => 'ố', - 'Ồ' => 'ồ', - 'Ổ' => 'ổ', - 'Ỗ' => 'ỗ', - 'Ộ' => 'ộ', - 'Ớ' => 'ớ', - 'Ờ' => 'ờ', - 'Ở' => 'ở', - 'Ỡ' => 'ỡ', - 'Ợ' => 'ợ', - 'Ụ' => 'ụ', - 'Ủ' => 'ủ', - 'Ứ' => 'ứ', - 'Ừ' => 'ừ', - 'Ử' => 'ử', - 'Ữ' => 'ữ', - 'Ự' => 'ự', - 'Ỳ' => 'ỳ', - 'Ỵ' => 'ỵ', - 'Ỷ' => 'ỷ', - 'Ỹ' => 'ỹ', - 'Ỻ' => 'ỻ', - 'Ỽ' => 'ỽ', - 'Ỿ' => 'ỿ', - 'Ἀ' => 'ἀ', - 'Ἁ' => 'ἁ', - 'Ἂ' => 'ἂ', - 'Ἃ' => 'ἃ', - 'Ἄ' => 'ἄ', - 'Ἅ' => 'ἅ', - 'Ἆ' => 'ἆ', - 'Ἇ' => 'ἇ', - 'Ἐ' => 'ἐ', - 'Ἑ' => 'ἑ', - 'Ἒ' => 'ἒ', - 'Ἓ' => 'ἓ', - 'Ἔ' => 'ἔ', - 'Ἕ' => 'ἕ', - 'Ἠ' => 'ἠ', - 'Ἡ' => 'ἡ', - 'Ἢ' => 'ἢ', - 'Ἣ' => 'ἣ', - 'Ἤ' => 'ἤ', - 'Ἥ' => 'ἥ', - 'Ἦ' => 'ἦ', - 'Ἧ' => 'ἧ', - 'Ἰ' => 'ἰ', - 'Ἱ' => 'ἱ', - 'Ἲ' => 'ἲ', - 'Ἳ' => 'ἳ', - 'Ἴ' => 'ἴ', - 'Ἵ' => 'ἵ', - 'Ἶ' => 'ἶ', - 'Ἷ' => 'ἷ', - 'Ὀ' => 'ὀ', - 'Ὁ' => 'ὁ', - 'Ὂ' => 'ὂ', - 'Ὃ' => 'ὃ', - 'Ὄ' => 'ὄ', - 'Ὅ' => 'ὅ', - 'Ὑ' => 'ὑ', - 'Ὓ' => 'ὓ', - 'Ὕ' => 'ὕ', - 'Ὗ' => 'ὗ', - 'Ὠ' => 'ὠ', - 'Ὡ' => 'ὡ', - 'Ὢ' => 'ὢ', - 'Ὣ' => 'ὣ', - 'Ὤ' => 'ὤ', - 'Ὥ' => 'ὥ', - 'Ὦ' => 'ὦ', - 'Ὧ' => 'ὧ', - 'ᾈ' => 'ᾀ', - 'ᾉ' => 'ᾁ', - 'ᾊ' => 'ᾂ', - 'ᾋ' => 'ᾃ', - 'ᾌ' => 'ᾄ', - 'ᾍ' => 'ᾅ', - 'ᾎ' => 'ᾆ', - 'ᾏ' => 'ᾇ', - 'ᾘ' => 'ᾐ', - 'ᾙ' => 'ᾑ', - 'ᾚ' => 'ᾒ', - 'ᾛ' => 'ᾓ', - 'ᾜ' => 'ᾔ', - 'ᾝ' => 'ᾕ', - 'ᾞ' => 'ᾖ', - 'ᾟ' => 'ᾗ', - 'ᾨ' => 'ᾠ', - 'ᾩ' => 'ᾡ', - 'ᾪ' => 'ᾢ', - 'ᾫ' => 'ᾣ', - 'ᾬ' => 'ᾤ', - 'ᾭ' => 'ᾥ', - 'ᾮ' => 'ᾦ', - 'ᾯ' => 'ᾧ', - 'Ᾰ' => 'ᾰ', - 'Ᾱ' => 'ᾱ', - 'Ὰ' => 'ὰ', - 'Ά' => 'ά', - 'ᾼ' => 'ᾳ', - 'Ὲ' => 'ὲ', - 'Έ' => 'έ', - 'Ὴ' => 'ὴ', - 'Ή' => 'ή', - 'ῌ' => 'ῃ', - 'Ῐ' => 'ῐ', - 'Ῑ' => 'ῑ', - 'Ὶ' => 'ὶ', - 'Ί' => 'ί', - 'Ῠ' => 'ῠ', - 'Ῡ' => 'ῡ', - 'Ὺ' => 'ὺ', - 'Ύ' => 'ύ', - 'Ῥ' => 'ῥ', - 'Ὸ' => 'ὸ', - 'Ό' => 'ό', - 'Ὼ' => 'ὼ', - 'Ώ' => 'ώ', - 'ῼ' => 'ῳ', - 'Ω' => 'ω', - 'K' => 'k', - 'Å' => 'å', - 'Ⅎ' => 'ⅎ', - 'Ⅰ' => 'ⅰ', - 'Ⅱ' => 'ⅱ', - 'Ⅲ' => 'ⅲ', - 'Ⅳ' => 'ⅳ', - 'Ⅴ' => 'ⅴ', - 'Ⅵ' => 'ⅵ', - 'Ⅶ' => 'ⅶ', - 'Ⅷ' => 'ⅷ', - 'Ⅸ' => 'ⅸ', - 'Ⅹ' => 'ⅹ', - 'Ⅺ' => 'ⅺ', - 'Ⅻ' => 'ⅻ', - 'Ⅼ' => 'ⅼ', - 'Ⅽ' => 'ⅽ', - 'Ⅾ' => 'ⅾ', - 'Ⅿ' => 'ⅿ', - 'Ↄ' => 'ↄ', - 'Ⓐ' => 'ⓐ', - 'Ⓑ' => 'ⓑ', - 'Ⓒ' => 'ⓒ', - 'Ⓓ' => 'ⓓ', - 'Ⓔ' => 'ⓔ', - 'Ⓕ' => 'ⓕ', - 'Ⓖ' => 'ⓖ', - 'Ⓗ' => 'ⓗ', - 'Ⓘ' => 'ⓘ', - 'Ⓙ' => 'ⓙ', - 'Ⓚ' => 'ⓚ', - 'Ⓛ' => 'ⓛ', - 'Ⓜ' => 'ⓜ', - 'Ⓝ' => 'ⓝ', - 'Ⓞ' => 'ⓞ', - 'Ⓟ' => 'ⓟ', - 'Ⓠ' => 'ⓠ', - 'Ⓡ' => 'ⓡ', - 'Ⓢ' => 'ⓢ', - 'Ⓣ' => 'ⓣ', - 'Ⓤ' => 'ⓤ', - 'Ⓥ' => 'ⓥ', - 'Ⓦ' => 'ⓦ', - 'Ⓧ' => 'ⓧ', - 'Ⓨ' => 'ⓨ', - 'Ⓩ' => 'ⓩ', - 'Ⰰ' => 'ⰰ', - 'Ⰱ' => 'ⰱ', - 'Ⰲ' => 'ⰲ', - 'Ⰳ' => 'ⰳ', - 'Ⰴ' => 'ⰴ', - 'Ⰵ' => 'ⰵ', - 'Ⰶ' => 'ⰶ', - 'Ⰷ' => 'ⰷ', - 'Ⰸ' => 'ⰸ', - 'Ⰹ' => 'ⰹ', - 'Ⰺ' => 'ⰺ', - 'Ⰻ' => 'ⰻ', - 'Ⰼ' => 'ⰼ', - 'Ⰽ' => 'ⰽ', - 'Ⰾ' => 'ⰾ', - 'Ⰿ' => 'ⰿ', - 'Ⱀ' => 'ⱀ', - 'Ⱁ' => 'ⱁ', - 'Ⱂ' => 'ⱂ', - 'Ⱃ' => 'ⱃ', - 'Ⱄ' => 'ⱄ', - 'Ⱅ' => 'ⱅ', - 'Ⱆ' => 'ⱆ', - 'Ⱇ' => 'ⱇ', - 'Ⱈ' => 'ⱈ', - 'Ⱉ' => 'ⱉ', - 'Ⱊ' => 'ⱊ', - 'Ⱋ' => 'ⱋ', - 'Ⱌ' => 'ⱌ', - 'Ⱍ' => 'ⱍ', - 'Ⱎ' => 'ⱎ', - 'Ⱏ' => 'ⱏ', - 'Ⱐ' => 'ⱐ', - 'Ⱑ' => 'ⱑ', - 'Ⱒ' => 'ⱒ', - 'Ⱓ' => 'ⱓ', - 'Ⱔ' => 'ⱔ', - 'Ⱕ' => 'ⱕ', - 'Ⱖ' => 'ⱖ', - 'Ⱗ' => 'ⱗ', - 'Ⱘ' => 'ⱘ', - 'Ⱙ' => 'ⱙ', - 'Ⱚ' => 'ⱚ', - 'Ⱛ' => 'ⱛ', - 'Ⱜ' => 'ⱜ', - 'Ⱝ' => 'ⱝ', - 'Ⱞ' => 'ⱞ', - 'Ⱡ' => 'ⱡ', - 'Ɫ' => 'ɫ', - 'Ᵽ' => 'ᵽ', - 'Ɽ' => 'ɽ', - 'Ⱨ' => 'ⱨ', - 'Ⱪ' => 'ⱪ', - 'Ⱬ' => 'ⱬ', - 'Ɑ' => 'ɑ', - 'Ɱ' => 'ɱ', - 'Ɐ' => 'ɐ', - 'Ɒ' => 'ɒ', - 'Ⱳ' => 'ⱳ', - 'Ⱶ' => 'ⱶ', - 'Ȿ' => 'ȿ', - 'Ɀ' => 'ɀ', - 'Ⲁ' => 'ⲁ', - 'Ⲃ' => 'ⲃ', - 'Ⲅ' => 'ⲅ', - 'Ⲇ' => 'ⲇ', - 'Ⲉ' => 'ⲉ', - 'Ⲋ' => 'ⲋ', - 'Ⲍ' => 'ⲍ', - 'Ⲏ' => 'ⲏ', - 'Ⲑ' => 'ⲑ', - 'Ⲓ' => 'ⲓ', - 'Ⲕ' => 'ⲕ', - 'Ⲗ' => 'ⲗ', - 'Ⲙ' => 'ⲙ', - 'Ⲛ' => 'ⲛ', - 'Ⲝ' => 'ⲝ', - 'Ⲟ' => 'ⲟ', - 'Ⲡ' => 'ⲡ', - 'Ⲣ' => 'ⲣ', - 'Ⲥ' => 'ⲥ', - 'Ⲧ' => 'ⲧ', - 'Ⲩ' => 'ⲩ', - 'Ⲫ' => 'ⲫ', - 'Ⲭ' => 'ⲭ', - 'Ⲯ' => 'ⲯ', - 'Ⲱ' => 'ⲱ', - 'Ⲳ' => 'ⲳ', - 'Ⲵ' => 'ⲵ', - 'Ⲷ' => 'ⲷ', - 'Ⲹ' => 'ⲹ', - 'Ⲻ' => 'ⲻ', - 'Ⲽ' => 'ⲽ', - 'Ⲿ' => 'ⲿ', - 'Ⳁ' => 'ⳁ', - 'Ⳃ' => 'ⳃ', - 'Ⳅ' => 'ⳅ', - 'Ⳇ' => 'ⳇ', - 'Ⳉ' => 'ⳉ', - 'Ⳋ' => 'ⳋ', - 'Ⳍ' => 'ⳍ', - 'Ⳏ' => 'ⳏ', - 'Ⳑ' => 'ⳑ', - 'Ⳓ' => 'ⳓ', - 'Ⳕ' => 'ⳕ', - 'Ⳗ' => 'ⳗ', - 'Ⳙ' => 'ⳙ', - 'Ⳛ' => 'ⳛ', - 'Ⳝ' => 'ⳝ', - 'Ⳟ' => 'ⳟ', - 'Ⳡ' => 'ⳡ', - 'Ⳣ' => 'ⳣ', - 'Ⳬ' => 'ⳬ', - 'Ⳮ' => 'ⳮ', - 'Ⳳ' => 'ⳳ', - 'Ꙁ' => 'ꙁ', - 'Ꙃ' => 'ꙃ', - 'Ꙅ' => 'ꙅ', - 'Ꙇ' => 'ꙇ', - 'Ꙉ' => 'ꙉ', - 'Ꙋ' => 'ꙋ', - 'Ꙍ' => 'ꙍ', - 'Ꙏ' => 'ꙏ', - 'Ꙑ' => 'ꙑ', - 'Ꙓ' => 'ꙓ', - 'Ꙕ' => 'ꙕ', - 'Ꙗ' => 'ꙗ', - 'Ꙙ' => 'ꙙ', - 'Ꙛ' => 'ꙛ', - 'Ꙝ' => 'ꙝ', - 'Ꙟ' => 'ꙟ', - 'Ꙡ' => 'ꙡ', - 'Ꙣ' => 'ꙣ', - 'Ꙥ' => 'ꙥ', - 'Ꙧ' => 'ꙧ', - 'Ꙩ' => 'ꙩ', - 'Ꙫ' => 'ꙫ', - 'Ꙭ' => 'ꙭ', - 'Ꚁ' => 'ꚁ', - 'Ꚃ' => 'ꚃ', - 'Ꚅ' => 'ꚅ', - 'Ꚇ' => 'ꚇ', - 'Ꚉ' => 'ꚉ', - 'Ꚋ' => 'ꚋ', - 'Ꚍ' => 'ꚍ', - 'Ꚏ' => 'ꚏ', - 'Ꚑ' => 'ꚑ', - 'Ꚓ' => 'ꚓ', - 'Ꚕ' => 'ꚕ', - 'Ꚗ' => 'ꚗ', - 'Ꚙ' => 'ꚙ', - 'Ꚛ' => 'ꚛ', - 'Ꜣ' => 'ꜣ', - 'Ꜥ' => 'ꜥ', - 'Ꜧ' => 'ꜧ', - 'Ꜩ' => 'ꜩ', - 'Ꜫ' => 'ꜫ', - 'Ꜭ' => 'ꜭ', - 'Ꜯ' => 'ꜯ', - 'Ꜳ' => 'ꜳ', - 'Ꜵ' => 'ꜵ', - 'Ꜷ' => 'ꜷ', - 'Ꜹ' => 'ꜹ', - 'Ꜻ' => 'ꜻ', - 'Ꜽ' => 'ꜽ', - 'Ꜿ' => 'ꜿ', - 'Ꝁ' => 'ꝁ', - 'Ꝃ' => 'ꝃ', - 'Ꝅ' => 'ꝅ', - 'Ꝇ' => 'ꝇ', - 'Ꝉ' => 'ꝉ', - 'Ꝋ' => 'ꝋ', - 'Ꝍ' => 'ꝍ', - 'Ꝏ' => 'ꝏ', - 'Ꝑ' => 'ꝑ', - 'Ꝓ' => 'ꝓ', - 'Ꝕ' => 'ꝕ', - 'Ꝗ' => 'ꝗ', - 'Ꝙ' => 'ꝙ', - 'Ꝛ' => 'ꝛ', - 'Ꝝ' => 'ꝝ', - 'Ꝟ' => 'ꝟ', - 'Ꝡ' => 'ꝡ', - 'Ꝣ' => 'ꝣ', - 'Ꝥ' => 'ꝥ', - 'Ꝧ' => 'ꝧ', - 'Ꝩ' => 'ꝩ', - 'Ꝫ' => 'ꝫ', - 'Ꝭ' => 'ꝭ', - 'Ꝯ' => 'ꝯ', - 'Ꝺ' => 'ꝺ', - 'Ꝼ' => 'ꝼ', - 'Ᵹ' => 'ᵹ', - 'Ꝿ' => 'ꝿ', - 'Ꞁ' => 'ꞁ', - 'Ꞃ' => 'ꞃ', - 'Ꞅ' => 'ꞅ', - 'Ꞇ' => 'ꞇ', - 'Ꞌ' => 'ꞌ', - 'Ɥ' => 'ɥ', - 'Ꞑ' => 'ꞑ', - 'Ꞓ' => 'ꞓ', - 'Ꞗ' => 'ꞗ', - 'Ꞙ' => 'ꞙ', - 'Ꞛ' => 'ꞛ', - 'Ꞝ' => 'ꞝ', - 'Ꞟ' => 'ꞟ', - 'Ꞡ' => 'ꞡ', - 'Ꞣ' => 'ꞣ', - 'Ꞥ' => 'ꞥ', - 'Ꞧ' => 'ꞧ', - 'Ꞩ' => 'ꞩ', - 'Ɦ' => 'ɦ', - 'Ɜ' => 'ɜ', - 'Ɡ' => 'ɡ', - 'Ɬ' => 'ɬ', - 'Ɪ' => 'ɪ', - 'Ʞ' => 'ʞ', - 'Ʇ' => 'ʇ', - 'Ʝ' => 'ʝ', - 'Ꭓ' => 'ꭓ', - 'Ꞵ' => 'ꞵ', - 'Ꞷ' => 'ꞷ', - 'Ꞹ' => 'ꞹ', - 'Ꞻ' => 'ꞻ', - 'Ꞽ' => 'ꞽ', - 'Ꞿ' => 'ꞿ', - 'Ꟃ' => 'ꟃ', - 'Ꞔ' => 'ꞔ', - 'Ʂ' => 'ʂ', - 'Ᶎ' => 'ᶎ', - 'Ꟈ' => 'ꟈ', - 'Ꟊ' => 'ꟊ', - 'Ꟶ' => 'ꟶ', - 'A' => 'a', - 'B' => 'b', - 'C' => 'c', - 'D' => 'd', - 'E' => 'e', - 'F' => 'f', - 'G' => 'g', - 'H' => 'h', - 'I' => 'i', - 'J' => 'j', - 'K' => 'k', - 'L' => 'l', - 'M' => 'm', - 'N' => 'n', - 'O' => 'o', - 'P' => 'p', - 'Q' => 'q', - 'R' => 'r', - 'S' => 's', - 'T' => 't', - 'U' => 'u', - 'V' => 'v', - 'W' => 'w', - 'X' => 'x', - 'Y' => 'y', - 'Z' => 'z', - '𐐀' => '𐐨', - '𐐁' => '𐐩', - '𐐂' => '𐐪', - '𐐃' => '𐐫', - '𐐄' => '𐐬', - '𐐅' => '𐐭', - '𐐆' => '𐐮', - '𐐇' => '𐐯', - '𐐈' => '𐐰', - '𐐉' => '𐐱', - '𐐊' => '𐐲', - '𐐋' => '𐐳', - '𐐌' => '𐐴', - '𐐍' => '𐐵', - '𐐎' => '𐐶', - '𐐏' => '𐐷', - '𐐐' => '𐐸', - '𐐑' => '𐐹', - '𐐒' => '𐐺', - '𐐓' => '𐐻', - '𐐔' => '𐐼', - '𐐕' => '𐐽', - '𐐖' => '𐐾', - '𐐗' => '𐐿', - '𐐘' => '𐑀', - '𐐙' => '𐑁', - '𐐚' => '𐑂', - '𐐛' => '𐑃', - '𐐜' => '𐑄', - '𐐝' => '𐑅', - '𐐞' => '𐑆', - '𐐟' => '𐑇', - '𐐠' => '𐑈', - '𐐡' => '𐑉', - '𐐢' => '𐑊', - '𐐣' => '𐑋', - '𐐤' => '𐑌', - '𐐥' => '𐑍', - '𐐦' => '𐑎', - '𐐧' => '𐑏', - '𐒰' => '𐓘', - '𐒱' => '𐓙', - '𐒲' => '𐓚', - '𐒳' => '𐓛', - '𐒴' => '𐓜', - '𐒵' => '𐓝', - '𐒶' => '𐓞', - '𐒷' => '𐓟', - '𐒸' => '𐓠', - '𐒹' => '𐓡', - '𐒺' => '𐓢', - '𐒻' => '𐓣', - '𐒼' => '𐓤', - '𐒽' => '𐓥', - '𐒾' => '𐓦', - '𐒿' => '𐓧', - '𐓀' => '𐓨', - '𐓁' => '𐓩', - '𐓂' => '𐓪', - '𐓃' => '𐓫', - '𐓄' => '𐓬', - '𐓅' => '𐓭', - '𐓆' => '𐓮', - '𐓇' => '𐓯', - '𐓈' => '𐓰', - '𐓉' => '𐓱', - '𐓊' => '𐓲', - '𐓋' => '𐓳', - '𐓌' => '𐓴', - '𐓍' => '𐓵', - '𐓎' => '𐓶', - '𐓏' => '𐓷', - '𐓐' => '𐓸', - '𐓑' => '𐓹', - '𐓒' => '𐓺', - '𐓓' => '𐓻', - '𐲀' => '𐳀', - '𐲁' => '𐳁', - '𐲂' => '𐳂', - '𐲃' => '𐳃', - '𐲄' => '𐳄', - '𐲅' => '𐳅', - '𐲆' => '𐳆', - '𐲇' => '𐳇', - '𐲈' => '𐳈', - '𐲉' => '𐳉', - '𐲊' => '𐳊', - '𐲋' => '𐳋', - '𐲌' => '𐳌', - '𐲍' => '𐳍', - '𐲎' => '𐳎', - '𐲏' => '𐳏', - '𐲐' => '𐳐', - '𐲑' => '𐳑', - '𐲒' => '𐳒', - '𐲓' => '𐳓', - '𐲔' => '𐳔', - '𐲕' => '𐳕', - '𐲖' => '𐳖', - '𐲗' => '𐳗', - '𐲘' => '𐳘', - '𐲙' => '𐳙', - '𐲚' => '𐳚', - '𐲛' => '𐳛', - '𐲜' => '𐳜', - '𐲝' => '𐳝', - '𐲞' => '𐳞', - '𐲟' => '𐳟', - '𐲠' => '𐳠', - '𐲡' => '𐳡', - '𐲢' => '𐳢', - '𐲣' => '𐳣', - '𐲤' => '𐳤', - '𐲥' => '𐳥', - '𐲦' => '𐳦', - '𐲧' => '𐳧', - '𐲨' => '𐳨', - '𐲩' => '𐳩', - '𐲪' => '𐳪', - '𐲫' => '𐳫', - '𐲬' => '𐳬', - '𐲭' => '𐳭', - '𐲮' => '𐳮', - '𐲯' => '𐳯', - '𐲰' => '𐳰', - '𐲱' => '𐳱', - '𐲲' => '𐳲', - '𑢠' => '𑣀', - '𑢡' => '𑣁', - '𑢢' => '𑣂', - '𑢣' => '𑣃', - '𑢤' => '𑣄', - '𑢥' => '𑣅', - '𑢦' => '𑣆', - '𑢧' => '𑣇', - '𑢨' => '𑣈', - '𑢩' => '𑣉', - '𑢪' => '𑣊', - '𑢫' => '𑣋', - '𑢬' => '𑣌', - '𑢭' => '𑣍', - '𑢮' => '𑣎', - '𑢯' => '𑣏', - '𑢰' => '𑣐', - '𑢱' => '𑣑', - '𑢲' => '𑣒', - '𑢳' => '𑣓', - '𑢴' => '𑣔', - '𑢵' => '𑣕', - '𑢶' => '𑣖', - '𑢷' => '𑣗', - '𑢸' => '𑣘', - '𑢹' => '𑣙', - '𑢺' => '𑣚', - '𑢻' => '𑣛', - '𑢼' => '𑣜', - '𑢽' => '𑣝', - '𑢾' => '𑣞', - '𑢿' => '𑣟', - '𖹀' => '𖹠', - '𖹁' => '𖹡', - '𖹂' => '𖹢', - '𖹃' => '𖹣', - '𖹄' => '𖹤', - '𖹅' => '𖹥', - '𖹆' => '𖹦', - '𖹇' => '𖹧', - '𖹈' => '𖹨', - '𖹉' => '𖹩', - '𖹊' => '𖹪', - '𖹋' => '𖹫', - '𖹌' => '𖹬', - '𖹍' => '𖹭', - '𖹎' => '𖹮', - '𖹏' => '𖹯', - '𖹐' => '𖹰', - '𖹑' => '𖹱', - '𖹒' => '𖹲', - '𖹓' => '𖹳', - '𖹔' => '𖹴', - '𖹕' => '𖹵', - '𖹖' => '𖹶', - '𖹗' => '𖹷', - '𖹘' => '𖹸', - '𖹙' => '𖹹', - '𖹚' => '𖹺', - '𖹛' => '𖹻', - '𖹜' => '𖹼', - '𖹝' => '𖹽', - '𖹞' => '𖹾', - '𖹟' => '𖹿', - '𞤀' => '𞤢', - '𞤁' => '𞤣', - '𞤂' => '𞤤', - '𞤃' => '𞤥', - '𞤄' => '𞤦', - '𞤅' => '𞤧', - '𞤆' => '𞤨', - '𞤇' => '𞤩', - '𞤈' => '𞤪', - '𞤉' => '𞤫', - '𞤊' => '𞤬', - '𞤋' => '𞤭', - '𞤌' => '𞤮', - '𞤍' => '𞤯', - '𞤎' => '𞤰', - '𞤏' => '𞤱', - '𞤐' => '𞤲', - '𞤑' => '𞤳', - '𞤒' => '𞤴', - '𞤓' => '𞤵', - '𞤔' => '𞤶', - '𞤕' => '𞤷', - '𞤖' => '𞤸', - '𞤗' => '𞤹', - '𞤘' => '𞤺', - '𞤙' => '𞤻', - '𞤚' => '𞤼', - '𞤛' => '𞤽', - '𞤜' => '𞤾', - '𞤝' => '𞤿', - '𞤞' => '𞥀', - '𞤟' => '𞥁', - '𞤠' => '𞥂', - '𞤡' => '𞥃', -); diff --git a/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php b/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php deleted file mode 100644 index 2a8f6e7..0000000 --- a/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php +++ /dev/null @@ -1,5 +0,0 @@ - 'A', - 'b' => 'B', - 'c' => 'C', - 'd' => 'D', - 'e' => 'E', - 'f' => 'F', - 'g' => 'G', - 'h' => 'H', - 'i' => 'I', - 'j' => 'J', - 'k' => 'K', - 'l' => 'L', - 'm' => 'M', - 'n' => 'N', - 'o' => 'O', - 'p' => 'P', - 'q' => 'Q', - 'r' => 'R', - 's' => 'S', - 't' => 'T', - 'u' => 'U', - 'v' => 'V', - 'w' => 'W', - 'x' => 'X', - 'y' => 'Y', - 'z' => 'Z', - 'µ' => 'Μ', - 'à' => 'À', - 'á' => 'Á', - 'â' => 'Â', - 'ã' => 'Ã', - 'ä' => 'Ä', - 'å' => 'Å', - 'æ' => 'Æ', - 'ç' => 'Ç', - 'è' => 'È', - 'é' => 'É', - 'ê' => 'Ê', - 'ë' => 'Ë', - 'ì' => 'Ì', - 'í' => 'Í', - 'î' => 'Î', - 'ï' => 'Ï', - 'ð' => 'Ð', - 'ñ' => 'Ñ', - 'ò' => 'Ò', - 'ó' => 'Ó', - 'ô' => 'Ô', - 'õ' => 'Õ', - 'ö' => 'Ö', - 'ø' => 'Ø', - 'ù' => 'Ù', - 'ú' => 'Ú', - 'û' => 'Û', - 'ü' => 'Ü', - 'ý' => 'Ý', - 'þ' => 'Þ', - 'ÿ' => 'Ÿ', - 'ā' => 'Ā', - 'ă' => 'Ă', - 'ą' => 'Ą', - 'ć' => 'Ć', - 'ĉ' => 'Ĉ', - 'ċ' => 'Ċ', - 'č' => 'Č', - 'ď' => 'Ď', - 'đ' => 'Đ', - 'ē' => 'Ē', - 'ĕ' => 'Ĕ', - 'ė' => 'Ė', - 'ę' => 'Ę', - 'ě' => 'Ě', - 'ĝ' => 'Ĝ', - 'ğ' => 'Ğ', - 'ġ' => 'Ġ', - 'ģ' => 'Ģ', - 'ĥ' => 'Ĥ', - 'ħ' => 'Ħ', - 'ĩ' => 'Ĩ', - 'ī' => 'Ī', - 'ĭ' => 'Ĭ', - 'į' => 'Į', - 'ı' => 'I', - 'ij' => 'IJ', - 'ĵ' => 'Ĵ', - 'ķ' => 'Ķ', - 'ĺ' => 'Ĺ', - 'ļ' => 'Ļ', - 'ľ' => 'Ľ', - 'ŀ' => 'Ŀ', - 'ł' => 'Ł', - 'ń' => 'Ń', - 'ņ' => 'Ņ', - 'ň' => 'Ň', - 'ŋ' => 'Ŋ', - 'ō' => 'Ō', - 'ŏ' => 'Ŏ', - 'ő' => 'Ő', - 'œ' => 'Œ', - 'ŕ' => 'Ŕ', - 'ŗ' => 'Ŗ', - 'ř' => 'Ř', - 'ś' => 'Ś', - 'ŝ' => 'Ŝ', - 'ş' => 'Ş', - 'š' => 'Š', - 'ţ' => 'Ţ', - 'ť' => 'Ť', - 'ŧ' => 'Ŧ', - 'ũ' => 'Ũ', - 'ū' => 'Ū', - 'ŭ' => 'Ŭ', - 'ů' => 'Ů', - 'ű' => 'Ű', - 'ų' => 'Ų', - 'ŵ' => 'Ŵ', - 'ŷ' => 'Ŷ', - 'ź' => 'Ź', - 'ż' => 'Ż', - 'ž' => 'Ž', - 'ſ' => 'S', - 'ƀ' => 'Ƀ', - 'ƃ' => 'Ƃ', - 'ƅ' => 'Ƅ', - 'ƈ' => 'Ƈ', - 'ƌ' => 'Ƌ', - 'ƒ' => 'Ƒ', - 'ƕ' => 'Ƕ', - 'ƙ' => 'Ƙ', - 'ƚ' => 'Ƚ', - 'ƞ' => 'Ƞ', - 'ơ' => 'Ơ', - 'ƣ' => 'Ƣ', - 'ƥ' => 'Ƥ', - 'ƨ' => 'Ƨ', - 'ƭ' => 'Ƭ', - 'ư' => 'Ư', - 'ƴ' => 'Ƴ', - 'ƶ' => 'Ƶ', - 'ƹ' => 'Ƹ', - 'ƽ' => 'Ƽ', - 'ƿ' => 'Ƿ', - 'Dž' => 'DŽ', - 'dž' => 'DŽ', - 'Lj' => 'LJ', - 'lj' => 'LJ', - 'Nj' => 'NJ', - 'nj' => 'NJ', - 'ǎ' => 'Ǎ', - 'ǐ' => 'Ǐ', - 'ǒ' => 'Ǒ', - 'ǔ' => 'Ǔ', - 'ǖ' => 'Ǖ', - 'ǘ' => 'Ǘ', - 'ǚ' => 'Ǚ', - 'ǜ' => 'Ǜ', - 'ǝ' => 'Ǝ', - 'ǟ' => 'Ǟ', - 'ǡ' => 'Ǡ', - 'ǣ' => 'Ǣ', - 'ǥ' => 'Ǥ', - 'ǧ' => 'Ǧ', - 'ǩ' => 'Ǩ', - 'ǫ' => 'Ǫ', - 'ǭ' => 'Ǭ', - 'ǯ' => 'Ǯ', - 'Dz' => 'DZ', - 'dz' => 'DZ', - 'ǵ' => 'Ǵ', - 'ǹ' => 'Ǹ', - 'ǻ' => 'Ǻ', - 'ǽ' => 'Ǽ', - 'ǿ' => 'Ǿ', - 'ȁ' => 'Ȁ', - 'ȃ' => 'Ȃ', - 'ȅ' => 'Ȅ', - 'ȇ' => 'Ȇ', - 'ȉ' => 'Ȉ', - 'ȋ' => 'Ȋ', - 'ȍ' => 'Ȍ', - 'ȏ' => 'Ȏ', - 'ȑ' => 'Ȑ', - 'ȓ' => 'Ȓ', - 'ȕ' => 'Ȕ', - 'ȗ' => 'Ȗ', - 'ș' => 'Ș', - 'ț' => 'Ț', - 'ȝ' => 'Ȝ', - 'ȟ' => 'Ȟ', - 'ȣ' => 'Ȣ', - 'ȥ' => 'Ȥ', - 'ȧ' => 'Ȧ', - 'ȩ' => 'Ȩ', - 'ȫ' => 'Ȫ', - 'ȭ' => 'Ȭ', - 'ȯ' => 'Ȯ', - 'ȱ' => 'Ȱ', - 'ȳ' => 'Ȳ', - 'ȼ' => 'Ȼ', - 'ȿ' => 'Ȿ', - 'ɀ' => 'Ɀ', - 'ɂ' => 'Ɂ', - 'ɇ' => 'Ɇ', - 'ɉ' => 'Ɉ', - 'ɋ' => 'Ɋ', - 'ɍ' => 'Ɍ', - 'ɏ' => 'Ɏ', - 'ɐ' => 'Ɐ', - 'ɑ' => 'Ɑ', - 'ɒ' => 'Ɒ', - 'ɓ' => 'Ɓ', - 'ɔ' => 'Ɔ', - 'ɖ' => 'Ɖ', - 'ɗ' => 'Ɗ', - 'ə' => 'Ə', - 'ɛ' => 'Ɛ', - 'ɜ' => 'Ɜ', - 'ɠ' => 'Ɠ', - 'ɡ' => 'Ɡ', - 'ɣ' => 'Ɣ', - 'ɥ' => 'Ɥ', - 'ɦ' => 'Ɦ', - 'ɨ' => 'Ɨ', - 'ɩ' => 'Ɩ', - 'ɪ' => 'Ɪ', - 'ɫ' => 'Ɫ', - 'ɬ' => 'Ɬ', - 'ɯ' => 'Ɯ', - 'ɱ' => 'Ɱ', - 'ɲ' => 'Ɲ', - 'ɵ' => 'Ɵ', - 'ɽ' => 'Ɽ', - 'ʀ' => 'Ʀ', - 'ʂ' => 'Ʂ', - 'ʃ' => 'Ʃ', - 'ʇ' => 'Ʇ', - 'ʈ' => 'Ʈ', - 'ʉ' => 'Ʉ', - 'ʊ' => 'Ʊ', - 'ʋ' => 'Ʋ', - 'ʌ' => 'Ʌ', - 'ʒ' => 'Ʒ', - 'ʝ' => 'Ʝ', - 'ʞ' => 'Ʞ', - 'ͅ' => 'Ι', - 'ͱ' => 'Ͱ', - 'ͳ' => 'Ͳ', - 'ͷ' => 'Ͷ', - 'ͻ' => 'Ͻ', - 'ͼ' => 'Ͼ', - 'ͽ' => 'Ͽ', - 'ά' => 'Ά', - 'έ' => 'Έ', - 'ή' => 'Ή', - 'ί' => 'Ί', - 'α' => 'Α', - 'β' => 'Β', - 'γ' => 'Γ', - 'δ' => 'Δ', - 'ε' => 'Ε', - 'ζ' => 'Ζ', - 'η' => 'Η', - 'θ' => 'Θ', - 'ι' => 'Ι', - 'κ' => 'Κ', - 'λ' => 'Λ', - 'μ' => 'Μ', - 'ν' => 'Ν', - 'ξ' => 'Ξ', - 'ο' => 'Ο', - 'π' => 'Π', - 'ρ' => 'Ρ', - 'ς' => 'Σ', - 'σ' => 'Σ', - 'τ' => 'Τ', - 'υ' => 'Υ', - 'φ' => 'Φ', - 'χ' => 'Χ', - 'ψ' => 'Ψ', - 'ω' => 'Ω', - 'ϊ' => 'Ϊ', - 'ϋ' => 'Ϋ', - 'ό' => 'Ό', - 'ύ' => 'Ύ', - 'ώ' => 'Ώ', - 'ϐ' => 'Β', - 'ϑ' => 'Θ', - 'ϕ' => 'Φ', - 'ϖ' => 'Π', - 'ϗ' => 'Ϗ', - 'ϙ' => 'Ϙ', - 'ϛ' => 'Ϛ', - 'ϝ' => 'Ϝ', - 'ϟ' => 'Ϟ', - 'ϡ' => 'Ϡ', - 'ϣ' => 'Ϣ', - 'ϥ' => 'Ϥ', - 'ϧ' => 'Ϧ', - 'ϩ' => 'Ϩ', - 'ϫ' => 'Ϫ', - 'ϭ' => 'Ϭ', - 'ϯ' => 'Ϯ', - 'ϰ' => 'Κ', - 'ϱ' => 'Ρ', - 'ϲ' => 'Ϲ', - 'ϳ' => 'Ϳ', - 'ϵ' => 'Ε', - 'ϸ' => 'Ϸ', - 'ϻ' => 'Ϻ', - 'а' => 'А', - 'б' => 'Б', - 'в' => 'В', - 'г' => 'Г', - 'д' => 'Д', - 'е' => 'Е', - 'ж' => 'Ж', - 'з' => 'З', - 'и' => 'И', - 'й' => 'Й', - 'к' => 'К', - 'л' => 'Л', - 'м' => 'М', - 'н' => 'Н', - 'о' => 'О', - 'п' => 'П', - 'р' => 'Р', - 'с' => 'С', - 'т' => 'Т', - 'у' => 'У', - 'ф' => 'Ф', - 'х' => 'Х', - 'ц' => 'Ц', - 'ч' => 'Ч', - 'ш' => 'Ш', - 'щ' => 'Щ', - 'ъ' => 'Ъ', - 'ы' => 'Ы', - 'ь' => 'Ь', - 'э' => 'Э', - 'ю' => 'Ю', - 'я' => 'Я', - 'ѐ' => 'Ѐ', - 'ё' => 'Ё', - 'ђ' => 'Ђ', - 'ѓ' => 'Ѓ', - 'є' => 'Є', - 'ѕ' => 'Ѕ', - 'і' => 'І', - 'ї' => 'Ї', - 'ј' => 'Ј', - 'љ' => 'Љ', - 'њ' => 'Њ', - 'ћ' => 'Ћ', - 'ќ' => 'Ќ', - 'ѝ' => 'Ѝ', - 'ў' => 'Ў', - 'џ' => 'Џ', - 'ѡ' => 'Ѡ', - 'ѣ' => 'Ѣ', - 'ѥ' => 'Ѥ', - 'ѧ' => 'Ѧ', - 'ѩ' => 'Ѩ', - 'ѫ' => 'Ѫ', - 'ѭ' => 'Ѭ', - 'ѯ' => 'Ѯ', - 'ѱ' => 'Ѱ', - 'ѳ' => 'Ѳ', - 'ѵ' => 'Ѵ', - 'ѷ' => 'Ѷ', - 'ѹ' => 'Ѹ', - 'ѻ' => 'Ѻ', - 'ѽ' => 'Ѽ', - 'ѿ' => 'Ѿ', - 'ҁ' => 'Ҁ', - 'ҋ' => 'Ҋ', - 'ҍ' => 'Ҍ', - 'ҏ' => 'Ҏ', - 'ґ' => 'Ґ', - 'ғ' => 'Ғ', - 'ҕ' => 'Ҕ', - 'җ' => 'Җ', - 'ҙ' => 'Ҙ', - 'қ' => 'Қ', - 'ҝ' => 'Ҝ', - 'ҟ' => 'Ҟ', - 'ҡ' => 'Ҡ', - 'ң' => 'Ң', - 'ҥ' => 'Ҥ', - 'ҧ' => 'Ҧ', - 'ҩ' => 'Ҩ', - 'ҫ' => 'Ҫ', - 'ҭ' => 'Ҭ', - 'ү' => 'Ү', - 'ұ' => 'Ұ', - 'ҳ' => 'Ҳ', - 'ҵ' => 'Ҵ', - 'ҷ' => 'Ҷ', - 'ҹ' => 'Ҹ', - 'һ' => 'Һ', - 'ҽ' => 'Ҽ', - 'ҿ' => 'Ҿ', - 'ӂ' => 'Ӂ', - 'ӄ' => 'Ӄ', - 'ӆ' => 'Ӆ', - 'ӈ' => 'Ӈ', - 'ӊ' => 'Ӊ', - 'ӌ' => 'Ӌ', - 'ӎ' => 'Ӎ', - 'ӏ' => 'Ӏ', - 'ӑ' => 'Ӑ', - 'ӓ' => 'Ӓ', - 'ӕ' => 'Ӕ', - 'ӗ' => 'Ӗ', - 'ә' => 'Ә', - 'ӛ' => 'Ӛ', - 'ӝ' => 'Ӝ', - 'ӟ' => 'Ӟ', - 'ӡ' => 'Ӡ', - 'ӣ' => 'Ӣ', - 'ӥ' => 'Ӥ', - 'ӧ' => 'Ӧ', - 'ө' => 'Ө', - 'ӫ' => 'Ӫ', - 'ӭ' => 'Ӭ', - 'ӯ' => 'Ӯ', - 'ӱ' => 'Ӱ', - 'ӳ' => 'Ӳ', - 'ӵ' => 'Ӵ', - 'ӷ' => 'Ӷ', - 'ӹ' => 'Ӹ', - 'ӻ' => 'Ӻ', - 'ӽ' => 'Ӽ', - 'ӿ' => 'Ӿ', - 'ԁ' => 'Ԁ', - 'ԃ' => 'Ԃ', - 'ԅ' => 'Ԅ', - 'ԇ' => 'Ԇ', - 'ԉ' => 'Ԉ', - 'ԋ' => 'Ԋ', - 'ԍ' => 'Ԍ', - 'ԏ' => 'Ԏ', - 'ԑ' => 'Ԑ', - 'ԓ' => 'Ԓ', - 'ԕ' => 'Ԕ', - 'ԗ' => 'Ԗ', - 'ԙ' => 'Ԙ', - 'ԛ' => 'Ԛ', - 'ԝ' => 'Ԝ', - 'ԟ' => 'Ԟ', - 'ԡ' => 'Ԡ', - 'ԣ' => 'Ԣ', - 'ԥ' => 'Ԥ', - 'ԧ' => 'Ԧ', - 'ԩ' => 'Ԩ', - 'ԫ' => 'Ԫ', - 'ԭ' => 'Ԭ', - 'ԯ' => 'Ԯ', - 'ա' => 'Ա', - 'բ' => 'Բ', - 'գ' => 'Գ', - 'դ' => 'Դ', - 'ե' => 'Ե', - 'զ' => 'Զ', - 'է' => 'Է', - 'ը' => 'Ը', - 'թ' => 'Թ', - 'ժ' => 'Ժ', - 'ի' => 'Ի', - 'լ' => 'Լ', - 'խ' => 'Խ', - 'ծ' => 'Ծ', - 'կ' => 'Կ', - 'հ' => 'Հ', - 'ձ' => 'Ձ', - 'ղ' => 'Ղ', - 'ճ' => 'Ճ', - 'մ' => 'Մ', - 'յ' => 'Յ', - 'ն' => 'Ն', - 'շ' => 'Շ', - 'ո' => 'Ո', - 'չ' => 'Չ', - 'պ' => 'Պ', - 'ջ' => 'Ջ', - 'ռ' => 'Ռ', - 'ս' => 'Ս', - 'վ' => 'Վ', - 'տ' => 'Տ', - 'ր' => 'Ր', - 'ց' => 'Ց', - 'ւ' => 'Ւ', - 'փ' => 'Փ', - 'ք' => 'Ք', - 'օ' => 'Օ', - 'ֆ' => 'Ֆ', - 'ა' => 'Ა', - 'ბ' => 'Ბ', - 'გ' => 'Გ', - 'დ' => 'Დ', - 'ე' => 'Ე', - 'ვ' => 'Ვ', - 'ზ' => 'Ზ', - 'თ' => 'Თ', - 'ი' => 'Ი', - 'კ' => 'Კ', - 'ლ' => 'Ლ', - 'მ' => 'Მ', - 'ნ' => 'Ნ', - 'ო' => 'Ო', - 'პ' => 'Პ', - 'ჟ' => 'Ჟ', - 'რ' => 'Რ', - 'ს' => 'Ს', - 'ტ' => 'Ტ', - 'უ' => 'Უ', - 'ფ' => 'Ფ', - 'ქ' => 'Ქ', - 'ღ' => 'Ღ', - 'ყ' => 'Ყ', - 'შ' => 'Შ', - 'ჩ' => 'Ჩ', - 'ც' => 'Ც', - 'ძ' => 'Ძ', - 'წ' => 'Წ', - 'ჭ' => 'Ჭ', - 'ხ' => 'Ხ', - 'ჯ' => 'Ჯ', - 'ჰ' => 'Ჰ', - 'ჱ' => 'Ჱ', - 'ჲ' => 'Ჲ', - 'ჳ' => 'Ჳ', - 'ჴ' => 'Ჴ', - 'ჵ' => 'Ჵ', - 'ჶ' => 'Ჶ', - 'ჷ' => 'Ჷ', - 'ჸ' => 'Ჸ', - 'ჹ' => 'Ჹ', - 'ჺ' => 'Ჺ', - 'ჽ' => 'Ჽ', - 'ჾ' => 'Ჾ', - 'ჿ' => 'Ჿ', - 'ᏸ' => 'Ᏸ', - 'ᏹ' => 'Ᏹ', - 'ᏺ' => 'Ᏺ', - 'ᏻ' => 'Ᏻ', - 'ᏼ' => 'Ᏼ', - 'ᏽ' => 'Ᏽ', - 'ᲀ' => 'В', - 'ᲁ' => 'Д', - 'ᲂ' => 'О', - 'ᲃ' => 'С', - 'ᲄ' => 'Т', - 'ᲅ' => 'Т', - 'ᲆ' => 'Ъ', - 'ᲇ' => 'Ѣ', - 'ᲈ' => 'Ꙋ', - 'ᵹ' => 'Ᵹ', - 'ᵽ' => 'Ᵽ', - 'ᶎ' => 'Ᶎ', - 'ḁ' => 'Ḁ', - 'ḃ' => 'Ḃ', - 'ḅ' => 'Ḅ', - 'ḇ' => 'Ḇ', - 'ḉ' => 'Ḉ', - 'ḋ' => 'Ḋ', - 'ḍ' => 'Ḍ', - 'ḏ' => 'Ḏ', - 'ḑ' => 'Ḑ', - 'ḓ' => 'Ḓ', - 'ḕ' => 'Ḕ', - 'ḗ' => 'Ḗ', - 'ḙ' => 'Ḙ', - 'ḛ' => 'Ḛ', - 'ḝ' => 'Ḝ', - 'ḟ' => 'Ḟ', - 'ḡ' => 'Ḡ', - 'ḣ' => 'Ḣ', - 'ḥ' => 'Ḥ', - 'ḧ' => 'Ḧ', - 'ḩ' => 'Ḩ', - 'ḫ' => 'Ḫ', - 'ḭ' => 'Ḭ', - 'ḯ' => 'Ḯ', - 'ḱ' => 'Ḱ', - 'ḳ' => 'Ḳ', - 'ḵ' => 'Ḵ', - 'ḷ' => 'Ḷ', - 'ḹ' => 'Ḹ', - 'ḻ' => 'Ḻ', - 'ḽ' => 'Ḽ', - 'ḿ' => 'Ḿ', - 'ṁ' => 'Ṁ', - 'ṃ' => 'Ṃ', - 'ṅ' => 'Ṅ', - 'ṇ' => 'Ṇ', - 'ṉ' => 'Ṉ', - 'ṋ' => 'Ṋ', - 'ṍ' => 'Ṍ', - 'ṏ' => 'Ṏ', - 'ṑ' => 'Ṑ', - 'ṓ' => 'Ṓ', - 'ṕ' => 'Ṕ', - 'ṗ' => 'Ṗ', - 'ṙ' => 'Ṙ', - 'ṛ' => 'Ṛ', - 'ṝ' => 'Ṝ', - 'ṟ' => 'Ṟ', - 'ṡ' => 'Ṡ', - 'ṣ' => 'Ṣ', - 'ṥ' => 'Ṥ', - 'ṧ' => 'Ṧ', - 'ṩ' => 'Ṩ', - 'ṫ' => 'Ṫ', - 'ṭ' => 'Ṭ', - 'ṯ' => 'Ṯ', - 'ṱ' => 'Ṱ', - 'ṳ' => 'Ṳ', - 'ṵ' => 'Ṵ', - 'ṷ' => 'Ṷ', - 'ṹ' => 'Ṹ', - 'ṻ' => 'Ṻ', - 'ṽ' => 'Ṽ', - 'ṿ' => 'Ṿ', - 'ẁ' => 'Ẁ', - 'ẃ' => 'Ẃ', - 'ẅ' => 'Ẅ', - 'ẇ' => 'Ẇ', - 'ẉ' => 'Ẉ', - 'ẋ' => 'Ẋ', - 'ẍ' => 'Ẍ', - 'ẏ' => 'Ẏ', - 'ẑ' => 'Ẑ', - 'ẓ' => 'Ẓ', - 'ẕ' => 'Ẕ', - 'ẛ' => 'Ṡ', - 'ạ' => 'Ạ', - 'ả' => 'Ả', - 'ấ' => 'Ấ', - 'ầ' => 'Ầ', - 'ẩ' => 'Ẩ', - 'ẫ' => 'Ẫ', - 'ậ' => 'Ậ', - 'ắ' => 'Ắ', - 'ằ' => 'Ằ', - 'ẳ' => 'Ẳ', - 'ẵ' => 'Ẵ', - 'ặ' => 'Ặ', - 'ẹ' => 'Ẹ', - 'ẻ' => 'Ẻ', - 'ẽ' => 'Ẽ', - 'ế' => 'Ế', - 'ề' => 'Ề', - 'ể' => 'Ể', - 'ễ' => 'Ễ', - 'ệ' => 'Ệ', - 'ỉ' => 'Ỉ', - 'ị' => 'Ị', - 'ọ' => 'Ọ', - 'ỏ' => 'Ỏ', - 'ố' => 'Ố', - 'ồ' => 'Ồ', - 'ổ' => 'Ổ', - 'ỗ' => 'Ỗ', - 'ộ' => 'Ộ', - 'ớ' => 'Ớ', - 'ờ' => 'Ờ', - 'ở' => 'Ở', - 'ỡ' => 'Ỡ', - 'ợ' => 'Ợ', - 'ụ' => 'Ụ', - 'ủ' => 'Ủ', - 'ứ' => 'Ứ', - 'ừ' => 'Ừ', - 'ử' => 'Ử', - 'ữ' => 'Ữ', - 'ự' => 'Ự', - 'ỳ' => 'Ỳ', - 'ỵ' => 'Ỵ', - 'ỷ' => 'Ỷ', - 'ỹ' => 'Ỹ', - 'ỻ' => 'Ỻ', - 'ỽ' => 'Ỽ', - 'ỿ' => 'Ỿ', - 'ἀ' => 'Ἀ', - 'ἁ' => 'Ἁ', - 'ἂ' => 'Ἂ', - 'ἃ' => 'Ἃ', - 'ἄ' => 'Ἄ', - 'ἅ' => 'Ἅ', - 'ἆ' => 'Ἆ', - 'ἇ' => 'Ἇ', - 'ἐ' => 'Ἐ', - 'ἑ' => 'Ἑ', - 'ἒ' => 'Ἒ', - 'ἓ' => 'Ἓ', - 'ἔ' => 'Ἔ', - 'ἕ' => 'Ἕ', - 'ἠ' => 'Ἠ', - 'ἡ' => 'Ἡ', - 'ἢ' => 'Ἢ', - 'ἣ' => 'Ἣ', - 'ἤ' => 'Ἤ', - 'ἥ' => 'Ἥ', - 'ἦ' => 'Ἦ', - 'ἧ' => 'Ἧ', - 'ἰ' => 'Ἰ', - 'ἱ' => 'Ἱ', - 'ἲ' => 'Ἲ', - 'ἳ' => 'Ἳ', - 'ἴ' => 'Ἴ', - 'ἵ' => 'Ἵ', - 'ἶ' => 'Ἶ', - 'ἷ' => 'Ἷ', - 'ὀ' => 'Ὀ', - 'ὁ' => 'Ὁ', - 'ὂ' => 'Ὂ', - 'ὃ' => 'Ὃ', - 'ὄ' => 'Ὄ', - 'ὅ' => 'Ὅ', - 'ὑ' => 'Ὑ', - 'ὓ' => 'Ὓ', - 'ὕ' => 'Ὕ', - 'ὗ' => 'Ὗ', - 'ὠ' => 'Ὠ', - 'ὡ' => 'Ὡ', - 'ὢ' => 'Ὢ', - 'ὣ' => 'Ὣ', - 'ὤ' => 'Ὤ', - 'ὥ' => 'Ὥ', - 'ὦ' => 'Ὦ', - 'ὧ' => 'Ὧ', - 'ὰ' => 'Ὰ', - 'ά' => 'Ά', - 'ὲ' => 'Ὲ', - 'έ' => 'Έ', - 'ὴ' => 'Ὴ', - 'ή' => 'Ή', - 'ὶ' => 'Ὶ', - 'ί' => 'Ί', - 'ὸ' => 'Ὸ', - 'ό' => 'Ό', - 'ὺ' => 'Ὺ', - 'ύ' => 'Ύ', - 'ὼ' => 'Ὼ', - 'ώ' => 'Ώ', - 'ᾀ' => 'ἈΙ', - 'ᾁ' => 'ἉΙ', - 'ᾂ' => 'ἊΙ', - 'ᾃ' => 'ἋΙ', - 'ᾄ' => 'ἌΙ', - 'ᾅ' => 'ἍΙ', - 'ᾆ' => 'ἎΙ', - 'ᾇ' => 'ἏΙ', - 'ᾐ' => 'ἨΙ', - 'ᾑ' => 'ἩΙ', - 'ᾒ' => 'ἪΙ', - 'ᾓ' => 'ἫΙ', - 'ᾔ' => 'ἬΙ', - 'ᾕ' => 'ἭΙ', - 'ᾖ' => 'ἮΙ', - 'ᾗ' => 'ἯΙ', - 'ᾠ' => 'ὨΙ', - 'ᾡ' => 'ὩΙ', - 'ᾢ' => 'ὪΙ', - 'ᾣ' => 'ὫΙ', - 'ᾤ' => 'ὬΙ', - 'ᾥ' => 'ὭΙ', - 'ᾦ' => 'ὮΙ', - 'ᾧ' => 'ὯΙ', - 'ᾰ' => 'Ᾰ', - 'ᾱ' => 'Ᾱ', - 'ᾳ' => 'ΑΙ', - 'ι' => 'Ι', - 'ῃ' => 'ΗΙ', - 'ῐ' => 'Ῐ', - 'ῑ' => 'Ῑ', - 'ῠ' => 'Ῠ', - 'ῡ' => 'Ῡ', - 'ῥ' => 'Ῥ', - 'ῳ' => 'ΩΙ', - 'ⅎ' => 'Ⅎ', - 'ⅰ' => 'Ⅰ', - 'ⅱ' => 'Ⅱ', - 'ⅲ' => 'Ⅲ', - 'ⅳ' => 'Ⅳ', - 'ⅴ' => 'Ⅴ', - 'ⅵ' => 'Ⅵ', - 'ⅶ' => 'Ⅶ', - 'ⅷ' => 'Ⅷ', - 'ⅸ' => 'Ⅸ', - 'ⅹ' => 'Ⅹ', - 'ⅺ' => 'Ⅺ', - 'ⅻ' => 'Ⅻ', - 'ⅼ' => 'Ⅼ', - 'ⅽ' => 'Ⅽ', - 'ⅾ' => 'Ⅾ', - 'ⅿ' => 'Ⅿ', - 'ↄ' => 'Ↄ', - 'ⓐ' => 'Ⓐ', - 'ⓑ' => 'Ⓑ', - 'ⓒ' => 'Ⓒ', - 'ⓓ' => 'Ⓓ', - 'ⓔ' => 'Ⓔ', - 'ⓕ' => 'Ⓕ', - 'ⓖ' => 'Ⓖ', - 'ⓗ' => 'Ⓗ', - 'ⓘ' => 'Ⓘ', - 'ⓙ' => 'Ⓙ', - 'ⓚ' => 'Ⓚ', - 'ⓛ' => 'Ⓛ', - 'ⓜ' => 'Ⓜ', - 'ⓝ' => 'Ⓝ', - 'ⓞ' => 'Ⓞ', - 'ⓟ' => 'Ⓟ', - 'ⓠ' => 'Ⓠ', - 'ⓡ' => 'Ⓡ', - 'ⓢ' => 'Ⓢ', - 'ⓣ' => 'Ⓣ', - 'ⓤ' => 'Ⓤ', - 'ⓥ' => 'Ⓥ', - 'ⓦ' => 'Ⓦ', - 'ⓧ' => 'Ⓧ', - 'ⓨ' => 'Ⓨ', - 'ⓩ' => 'Ⓩ', - 'ⰰ' => 'Ⰰ', - 'ⰱ' => 'Ⰱ', - 'ⰲ' => 'Ⰲ', - 'ⰳ' => 'Ⰳ', - 'ⰴ' => 'Ⰴ', - 'ⰵ' => 'Ⰵ', - 'ⰶ' => 'Ⰶ', - 'ⰷ' => 'Ⰷ', - 'ⰸ' => 'Ⰸ', - 'ⰹ' => 'Ⰹ', - 'ⰺ' => 'Ⰺ', - 'ⰻ' => 'Ⰻ', - 'ⰼ' => 'Ⰼ', - 'ⰽ' => 'Ⰽ', - 'ⰾ' => 'Ⰾ', - 'ⰿ' => 'Ⰿ', - 'ⱀ' => 'Ⱀ', - 'ⱁ' => 'Ⱁ', - 'ⱂ' => 'Ⱂ', - 'ⱃ' => 'Ⱃ', - 'ⱄ' => 'Ⱄ', - 'ⱅ' => 'Ⱅ', - 'ⱆ' => 'Ⱆ', - 'ⱇ' => 'Ⱇ', - 'ⱈ' => 'Ⱈ', - 'ⱉ' => 'Ⱉ', - 'ⱊ' => 'Ⱊ', - 'ⱋ' => 'Ⱋ', - 'ⱌ' => 'Ⱌ', - 'ⱍ' => 'Ⱍ', - 'ⱎ' => 'Ⱎ', - 'ⱏ' => 'Ⱏ', - 'ⱐ' => 'Ⱐ', - 'ⱑ' => 'Ⱑ', - 'ⱒ' => 'Ⱒ', - 'ⱓ' => 'Ⱓ', - 'ⱔ' => 'Ⱔ', - 'ⱕ' => 'Ⱕ', - 'ⱖ' => 'Ⱖ', - 'ⱗ' => 'Ⱗ', - 'ⱘ' => 'Ⱘ', - 'ⱙ' => 'Ⱙ', - 'ⱚ' => 'Ⱚ', - 'ⱛ' => 'Ⱛ', - 'ⱜ' => 'Ⱜ', - 'ⱝ' => 'Ⱝ', - 'ⱞ' => 'Ⱞ', - 'ⱡ' => 'Ⱡ', - 'ⱥ' => 'Ⱥ', - 'ⱦ' => 'Ⱦ', - 'ⱨ' => 'Ⱨ', - 'ⱪ' => 'Ⱪ', - 'ⱬ' => 'Ⱬ', - 'ⱳ' => 'Ⱳ', - 'ⱶ' => 'Ⱶ', - 'ⲁ' => 'Ⲁ', - 'ⲃ' => 'Ⲃ', - 'ⲅ' => 'Ⲅ', - 'ⲇ' => 'Ⲇ', - 'ⲉ' => 'Ⲉ', - 'ⲋ' => 'Ⲋ', - 'ⲍ' => 'Ⲍ', - 'ⲏ' => 'Ⲏ', - 'ⲑ' => 'Ⲑ', - 'ⲓ' => 'Ⲓ', - 'ⲕ' => 'Ⲕ', - 'ⲗ' => 'Ⲗ', - 'ⲙ' => 'Ⲙ', - 'ⲛ' => 'Ⲛ', - 'ⲝ' => 'Ⲝ', - 'ⲟ' => 'Ⲟ', - 'ⲡ' => 'Ⲡ', - 'ⲣ' => 'Ⲣ', - 'ⲥ' => 'Ⲥ', - 'ⲧ' => 'Ⲧ', - 'ⲩ' => 'Ⲩ', - 'ⲫ' => 'Ⲫ', - 'ⲭ' => 'Ⲭ', - 'ⲯ' => 'Ⲯ', - 'ⲱ' => 'Ⲱ', - 'ⲳ' => 'Ⲳ', - 'ⲵ' => 'Ⲵ', - 'ⲷ' => 'Ⲷ', - 'ⲹ' => 'Ⲹ', - 'ⲻ' => 'Ⲻ', - 'ⲽ' => 'Ⲽ', - 'ⲿ' => 'Ⲿ', - 'ⳁ' => 'Ⳁ', - 'ⳃ' => 'Ⳃ', - 'ⳅ' => 'Ⳅ', - 'ⳇ' => 'Ⳇ', - 'ⳉ' => 'Ⳉ', - 'ⳋ' => 'Ⳋ', - 'ⳍ' => 'Ⳍ', - 'ⳏ' => 'Ⳏ', - 'ⳑ' => 'Ⳑ', - 'ⳓ' => 'Ⳓ', - 'ⳕ' => 'Ⳕ', - 'ⳗ' => 'Ⳗ', - 'ⳙ' => 'Ⳙ', - 'ⳛ' => 'Ⳛ', - 'ⳝ' => 'Ⳝ', - 'ⳟ' => 'Ⳟ', - 'ⳡ' => 'Ⳡ', - 'ⳣ' => 'Ⳣ', - 'ⳬ' => 'Ⳬ', - 'ⳮ' => 'Ⳮ', - 'ⳳ' => 'Ⳳ', - 'ⴀ' => 'Ⴀ', - 'ⴁ' => 'Ⴁ', - 'ⴂ' => 'Ⴂ', - 'ⴃ' => 'Ⴃ', - 'ⴄ' => 'Ⴄ', - 'ⴅ' => 'Ⴅ', - 'ⴆ' => 'Ⴆ', - 'ⴇ' => 'Ⴇ', - 'ⴈ' => 'Ⴈ', - 'ⴉ' => 'Ⴉ', - 'ⴊ' => 'Ⴊ', - 'ⴋ' => 'Ⴋ', - 'ⴌ' => 'Ⴌ', - 'ⴍ' => 'Ⴍ', - 'ⴎ' => 'Ⴎ', - 'ⴏ' => 'Ⴏ', - 'ⴐ' => 'Ⴐ', - 'ⴑ' => 'Ⴑ', - 'ⴒ' => 'Ⴒ', - 'ⴓ' => 'Ⴓ', - 'ⴔ' => 'Ⴔ', - 'ⴕ' => 'Ⴕ', - 'ⴖ' => 'Ⴖ', - 'ⴗ' => 'Ⴗ', - 'ⴘ' => 'Ⴘ', - 'ⴙ' => 'Ⴙ', - 'ⴚ' => 'Ⴚ', - 'ⴛ' => 'Ⴛ', - 'ⴜ' => 'Ⴜ', - 'ⴝ' => 'Ⴝ', - 'ⴞ' => 'Ⴞ', - 'ⴟ' => 'Ⴟ', - 'ⴠ' => 'Ⴠ', - 'ⴡ' => 'Ⴡ', - 'ⴢ' => 'Ⴢ', - 'ⴣ' => 'Ⴣ', - 'ⴤ' => 'Ⴤ', - 'ⴥ' => 'Ⴥ', - 'ⴧ' => 'Ⴧ', - 'ⴭ' => 'Ⴭ', - 'ꙁ' => 'Ꙁ', - 'ꙃ' => 'Ꙃ', - 'ꙅ' => 'Ꙅ', - 'ꙇ' => 'Ꙇ', - 'ꙉ' => 'Ꙉ', - 'ꙋ' => 'Ꙋ', - 'ꙍ' => 'Ꙍ', - 'ꙏ' => 'Ꙏ', - 'ꙑ' => 'Ꙑ', - 'ꙓ' => 'Ꙓ', - 'ꙕ' => 'Ꙕ', - 'ꙗ' => 'Ꙗ', - 'ꙙ' => 'Ꙙ', - 'ꙛ' => 'Ꙛ', - 'ꙝ' => 'Ꙝ', - 'ꙟ' => 'Ꙟ', - 'ꙡ' => 'Ꙡ', - 'ꙣ' => 'Ꙣ', - 'ꙥ' => 'Ꙥ', - 'ꙧ' => 'Ꙧ', - 'ꙩ' => 'Ꙩ', - 'ꙫ' => 'Ꙫ', - 'ꙭ' => 'Ꙭ', - 'ꚁ' => 'Ꚁ', - 'ꚃ' => 'Ꚃ', - 'ꚅ' => 'Ꚅ', - 'ꚇ' => 'Ꚇ', - 'ꚉ' => 'Ꚉ', - 'ꚋ' => 'Ꚋ', - 'ꚍ' => 'Ꚍ', - 'ꚏ' => 'Ꚏ', - 'ꚑ' => 'Ꚑ', - 'ꚓ' => 'Ꚓ', - 'ꚕ' => 'Ꚕ', - 'ꚗ' => 'Ꚗ', - 'ꚙ' => 'Ꚙ', - 'ꚛ' => 'Ꚛ', - 'ꜣ' => 'Ꜣ', - 'ꜥ' => 'Ꜥ', - 'ꜧ' => 'Ꜧ', - 'ꜩ' => 'Ꜩ', - 'ꜫ' => 'Ꜫ', - 'ꜭ' => 'Ꜭ', - 'ꜯ' => 'Ꜯ', - 'ꜳ' => 'Ꜳ', - 'ꜵ' => 'Ꜵ', - 'ꜷ' => 'Ꜷ', - 'ꜹ' => 'Ꜹ', - 'ꜻ' => 'Ꜻ', - 'ꜽ' => 'Ꜽ', - 'ꜿ' => 'Ꜿ', - 'ꝁ' => 'Ꝁ', - 'ꝃ' => 'Ꝃ', - 'ꝅ' => 'Ꝅ', - 'ꝇ' => 'Ꝇ', - 'ꝉ' => 'Ꝉ', - 'ꝋ' => 'Ꝋ', - 'ꝍ' => 'Ꝍ', - 'ꝏ' => 'Ꝏ', - 'ꝑ' => 'Ꝑ', - 'ꝓ' => 'Ꝓ', - 'ꝕ' => 'Ꝕ', - 'ꝗ' => 'Ꝗ', - 'ꝙ' => 'Ꝙ', - 'ꝛ' => 'Ꝛ', - 'ꝝ' => 'Ꝝ', - 'ꝟ' => 'Ꝟ', - 'ꝡ' => 'Ꝡ', - 'ꝣ' => 'Ꝣ', - 'ꝥ' => 'Ꝥ', - 'ꝧ' => 'Ꝧ', - 'ꝩ' => 'Ꝩ', - 'ꝫ' => 'Ꝫ', - 'ꝭ' => 'Ꝭ', - 'ꝯ' => 'Ꝯ', - 'ꝺ' => 'Ꝺ', - 'ꝼ' => 'Ꝼ', - 'ꝿ' => 'Ꝿ', - 'ꞁ' => 'Ꞁ', - 'ꞃ' => 'Ꞃ', - 'ꞅ' => 'Ꞅ', - 'ꞇ' => 'Ꞇ', - 'ꞌ' => 'Ꞌ', - 'ꞑ' => 'Ꞑ', - 'ꞓ' => 'Ꞓ', - 'ꞔ' => 'Ꞔ', - 'ꞗ' => 'Ꞗ', - 'ꞙ' => 'Ꞙ', - 'ꞛ' => 'Ꞛ', - 'ꞝ' => 'Ꞝ', - 'ꞟ' => 'Ꞟ', - 'ꞡ' => 'Ꞡ', - 'ꞣ' => 'Ꞣ', - 'ꞥ' => 'Ꞥ', - 'ꞧ' => 'Ꞧ', - 'ꞩ' => 'Ꞩ', - 'ꞵ' => 'Ꞵ', - 'ꞷ' => 'Ꞷ', - 'ꞹ' => 'Ꞹ', - 'ꞻ' => 'Ꞻ', - 'ꞽ' => 'Ꞽ', - 'ꞿ' => 'Ꞿ', - 'ꟃ' => 'Ꟃ', - 'ꟈ' => 'Ꟈ', - 'ꟊ' => 'Ꟊ', - 'ꟶ' => 'Ꟶ', - 'ꭓ' => 'Ꭓ', - 'ꭰ' => 'Ꭰ', - 'ꭱ' => 'Ꭱ', - 'ꭲ' => 'Ꭲ', - 'ꭳ' => 'Ꭳ', - 'ꭴ' => 'Ꭴ', - 'ꭵ' => 'Ꭵ', - 'ꭶ' => 'Ꭶ', - 'ꭷ' => 'Ꭷ', - 'ꭸ' => 'Ꭸ', - 'ꭹ' => 'Ꭹ', - 'ꭺ' => 'Ꭺ', - 'ꭻ' => 'Ꭻ', - 'ꭼ' => 'Ꭼ', - 'ꭽ' => 'Ꭽ', - 'ꭾ' => 'Ꭾ', - 'ꭿ' => 'Ꭿ', - 'ꮀ' => 'Ꮀ', - 'ꮁ' => 'Ꮁ', - 'ꮂ' => 'Ꮂ', - 'ꮃ' => 'Ꮃ', - 'ꮄ' => 'Ꮄ', - 'ꮅ' => 'Ꮅ', - 'ꮆ' => 'Ꮆ', - 'ꮇ' => 'Ꮇ', - 'ꮈ' => 'Ꮈ', - 'ꮉ' => 'Ꮉ', - 'ꮊ' => 'Ꮊ', - 'ꮋ' => 'Ꮋ', - 'ꮌ' => 'Ꮌ', - 'ꮍ' => 'Ꮍ', - 'ꮎ' => 'Ꮎ', - 'ꮏ' => 'Ꮏ', - 'ꮐ' => 'Ꮐ', - 'ꮑ' => 'Ꮑ', - 'ꮒ' => 'Ꮒ', - 'ꮓ' => 'Ꮓ', - 'ꮔ' => 'Ꮔ', - 'ꮕ' => 'Ꮕ', - 'ꮖ' => 'Ꮖ', - 'ꮗ' => 'Ꮗ', - 'ꮘ' => 'Ꮘ', - 'ꮙ' => 'Ꮙ', - 'ꮚ' => 'Ꮚ', - 'ꮛ' => 'Ꮛ', - 'ꮜ' => 'Ꮜ', - 'ꮝ' => 'Ꮝ', - 'ꮞ' => 'Ꮞ', - 'ꮟ' => 'Ꮟ', - 'ꮠ' => 'Ꮠ', - 'ꮡ' => 'Ꮡ', - 'ꮢ' => 'Ꮢ', - 'ꮣ' => 'Ꮣ', - 'ꮤ' => 'Ꮤ', - 'ꮥ' => 'Ꮥ', - 'ꮦ' => 'Ꮦ', - 'ꮧ' => 'Ꮧ', - 'ꮨ' => 'Ꮨ', - 'ꮩ' => 'Ꮩ', - 'ꮪ' => 'Ꮪ', - 'ꮫ' => 'Ꮫ', - 'ꮬ' => 'Ꮬ', - 'ꮭ' => 'Ꮭ', - 'ꮮ' => 'Ꮮ', - 'ꮯ' => 'Ꮯ', - 'ꮰ' => 'Ꮰ', - 'ꮱ' => 'Ꮱ', - 'ꮲ' => 'Ꮲ', - 'ꮳ' => 'Ꮳ', - 'ꮴ' => 'Ꮴ', - 'ꮵ' => 'Ꮵ', - 'ꮶ' => 'Ꮶ', - 'ꮷ' => 'Ꮷ', - 'ꮸ' => 'Ꮸ', - 'ꮹ' => 'Ꮹ', - 'ꮺ' => 'Ꮺ', - 'ꮻ' => 'Ꮻ', - 'ꮼ' => 'Ꮼ', - 'ꮽ' => 'Ꮽ', - 'ꮾ' => 'Ꮾ', - 'ꮿ' => 'Ꮿ', - 'a' => 'A', - 'b' => 'B', - 'c' => 'C', - 'd' => 'D', - 'e' => 'E', - 'f' => 'F', - 'g' => 'G', - 'h' => 'H', - 'i' => 'I', - 'j' => 'J', - 'k' => 'K', - 'l' => 'L', - 'm' => 'M', - 'n' => 'N', - 'o' => 'O', - 'p' => 'P', - 'q' => 'Q', - 'r' => 'R', - 's' => 'S', - 't' => 'T', - 'u' => 'U', - 'v' => 'V', - 'w' => 'W', - 'x' => 'X', - 'y' => 'Y', - 'z' => 'Z', - '𐐨' => '𐐀', - '𐐩' => '𐐁', - '𐐪' => '𐐂', - '𐐫' => '𐐃', - '𐐬' => '𐐄', - '𐐭' => '𐐅', - '𐐮' => '𐐆', - '𐐯' => '𐐇', - '𐐰' => '𐐈', - '𐐱' => '𐐉', - '𐐲' => '𐐊', - '𐐳' => '𐐋', - '𐐴' => '𐐌', - '𐐵' => '𐐍', - '𐐶' => '𐐎', - '𐐷' => '𐐏', - '𐐸' => '𐐐', - '𐐹' => '𐐑', - '𐐺' => '𐐒', - '𐐻' => '𐐓', - '𐐼' => '𐐔', - '𐐽' => '𐐕', - '𐐾' => '𐐖', - '𐐿' => '𐐗', - '𐑀' => '𐐘', - '𐑁' => '𐐙', - '𐑂' => '𐐚', - '𐑃' => '𐐛', - '𐑄' => '𐐜', - '𐑅' => '𐐝', - '𐑆' => '𐐞', - '𐑇' => '𐐟', - '𐑈' => '𐐠', - '𐑉' => '𐐡', - '𐑊' => '𐐢', - '𐑋' => '𐐣', - '𐑌' => '𐐤', - '𐑍' => '𐐥', - '𐑎' => '𐐦', - '𐑏' => '𐐧', - '𐓘' => '𐒰', - '𐓙' => '𐒱', - '𐓚' => '𐒲', - '𐓛' => '𐒳', - '𐓜' => '𐒴', - '𐓝' => '𐒵', - '𐓞' => '𐒶', - '𐓟' => '𐒷', - '𐓠' => '𐒸', - '𐓡' => '𐒹', - '𐓢' => '𐒺', - '𐓣' => '𐒻', - '𐓤' => '𐒼', - '𐓥' => '𐒽', - '𐓦' => '𐒾', - '𐓧' => '𐒿', - '𐓨' => '𐓀', - '𐓩' => '𐓁', - '𐓪' => '𐓂', - '𐓫' => '𐓃', - '𐓬' => '𐓄', - '𐓭' => '𐓅', - '𐓮' => '𐓆', - '𐓯' => '𐓇', - '𐓰' => '𐓈', - '𐓱' => '𐓉', - '𐓲' => '𐓊', - '𐓳' => '𐓋', - '𐓴' => '𐓌', - '𐓵' => '𐓍', - '𐓶' => '𐓎', - '𐓷' => '𐓏', - '𐓸' => '𐓐', - '𐓹' => '𐓑', - '𐓺' => '𐓒', - '𐓻' => '𐓓', - '𐳀' => '𐲀', - '𐳁' => '𐲁', - '𐳂' => '𐲂', - '𐳃' => '𐲃', - '𐳄' => '𐲄', - '𐳅' => '𐲅', - '𐳆' => '𐲆', - '𐳇' => '𐲇', - '𐳈' => '𐲈', - '𐳉' => '𐲉', - '𐳊' => '𐲊', - '𐳋' => '𐲋', - '𐳌' => '𐲌', - '𐳍' => '𐲍', - '𐳎' => '𐲎', - '𐳏' => '𐲏', - '𐳐' => '𐲐', - '𐳑' => '𐲑', - '𐳒' => '𐲒', - '𐳓' => '𐲓', - '𐳔' => '𐲔', - '𐳕' => '𐲕', - '𐳖' => '𐲖', - '𐳗' => '𐲗', - '𐳘' => '𐲘', - '𐳙' => '𐲙', - '𐳚' => '𐲚', - '𐳛' => '𐲛', - '𐳜' => '𐲜', - '𐳝' => '𐲝', - '𐳞' => '𐲞', - '𐳟' => '𐲟', - '𐳠' => '𐲠', - '𐳡' => '𐲡', - '𐳢' => '𐲢', - '𐳣' => '𐲣', - '𐳤' => '𐲤', - '𐳥' => '𐲥', - '𐳦' => '𐲦', - '𐳧' => '𐲧', - '𐳨' => '𐲨', - '𐳩' => '𐲩', - '𐳪' => '𐲪', - '𐳫' => '𐲫', - '𐳬' => '𐲬', - '𐳭' => '𐲭', - '𐳮' => '𐲮', - '𐳯' => '𐲯', - '𐳰' => '𐲰', - '𐳱' => '𐲱', - '𐳲' => '𐲲', - '𑣀' => '𑢠', - '𑣁' => '𑢡', - '𑣂' => '𑢢', - '𑣃' => '𑢣', - '𑣄' => '𑢤', - '𑣅' => '𑢥', - '𑣆' => '𑢦', - '𑣇' => '𑢧', - '𑣈' => '𑢨', - '𑣉' => '𑢩', - '𑣊' => '𑢪', - '𑣋' => '𑢫', - '𑣌' => '𑢬', - '𑣍' => '𑢭', - '𑣎' => '𑢮', - '𑣏' => '𑢯', - '𑣐' => '𑢰', - '𑣑' => '𑢱', - '𑣒' => '𑢲', - '𑣓' => '𑢳', - '𑣔' => '𑢴', - '𑣕' => '𑢵', - '𑣖' => '𑢶', - '𑣗' => '𑢷', - '𑣘' => '𑢸', - '𑣙' => '𑢹', - '𑣚' => '𑢺', - '𑣛' => '𑢻', - '𑣜' => '𑢼', - '𑣝' => '𑢽', - '𑣞' => '𑢾', - '𑣟' => '𑢿', - '𖹠' => '𖹀', - '𖹡' => '𖹁', - '𖹢' => '𖹂', - '𖹣' => '𖹃', - '𖹤' => '𖹄', - '𖹥' => '𖹅', - '𖹦' => '𖹆', - '𖹧' => '𖹇', - '𖹨' => '𖹈', - '𖹩' => '𖹉', - '𖹪' => '𖹊', - '𖹫' => '𖹋', - '𖹬' => '𖹌', - '𖹭' => '𖹍', - '𖹮' => '𖹎', - '𖹯' => '𖹏', - '𖹰' => '𖹐', - '𖹱' => '𖹑', - '𖹲' => '𖹒', - '𖹳' => '𖹓', - '𖹴' => '𖹔', - '𖹵' => '𖹕', - '𖹶' => '𖹖', - '𖹷' => '𖹗', - '𖹸' => '𖹘', - '𖹹' => '𖹙', - '𖹺' => '𖹚', - '𖹻' => '𖹛', - '𖹼' => '𖹜', - '𖹽' => '𖹝', - '𖹾' => '𖹞', - '𖹿' => '𖹟', - '𞤢' => '𞤀', - '𞤣' => '𞤁', - '𞤤' => '𞤂', - '𞤥' => '𞤃', - '𞤦' => '𞤄', - '𞤧' => '𞤅', - '𞤨' => '𞤆', - '𞤩' => '𞤇', - '𞤪' => '𞤈', - '𞤫' => '𞤉', - '𞤬' => '𞤊', - '𞤭' => '𞤋', - '𞤮' => '𞤌', - '𞤯' => '𞤍', - '𞤰' => '𞤎', - '𞤱' => '𞤏', - '𞤲' => '𞤐', - '𞤳' => '𞤑', - '𞤴' => '𞤒', - '𞤵' => '𞤓', - '𞤶' => '𞤔', - '𞤷' => '𞤕', - '𞤸' => '𞤖', - '𞤹' => '𞤗', - '𞤺' => '𞤘', - '𞤻' => '𞤙', - '𞤼' => '𞤚', - '𞤽' => '𞤛', - '𞤾' => '𞤜', - '𞤿' => '𞤝', - '𞥀' => '𞤞', - '𞥁' => '𞤟', - '𞥂' => '𞤠', - '𞥃' => '𞤡', - 'ß' => 'SS', - 'ff' => 'FF', - 'fi' => 'FI', - 'fl' => 'FL', - 'ffi' => 'FFI', - 'ffl' => 'FFL', - 'ſt' => 'ST', - 'st' => 'ST', - 'և' => 'ԵՒ', - 'ﬓ' => 'ՄՆ', - 'ﬔ' => 'ՄԵ', - 'ﬕ' => 'ՄԻ', - 'ﬖ' => 'ՎՆ', - 'ﬗ' => 'ՄԽ', - 'ʼn' => 'ʼN', - 'ΐ' => 'Ϊ́', - 'ΰ' => 'Ϋ́', - 'ǰ' => 'J̌', - 'ẖ' => 'H̱', - 'ẗ' => 'T̈', - 'ẘ' => 'W̊', - 'ẙ' => 'Y̊', - 'ẚ' => 'Aʾ', - 'ὐ' => 'Υ̓', - 'ὒ' => 'Υ̓̀', - 'ὔ' => 'Υ̓́', - 'ὖ' => 'Υ̓͂', - 'ᾶ' => 'Α͂', - 'ῆ' => 'Η͂', - 'ῒ' => 'Ϊ̀', - 'ΐ' => 'Ϊ́', - 'ῖ' => 'Ι͂', - 'ῗ' => 'Ϊ͂', - 'ῢ' => 'Ϋ̀', - 'ΰ' => 'Ϋ́', - 'ῤ' => 'Ρ̓', - 'ῦ' => 'Υ͂', - 'ῧ' => 'Ϋ͂', - 'ῶ' => 'Ω͂', - 'ᾈ' => 'ἈΙ', - 'ᾉ' => 'ἉΙ', - 'ᾊ' => 'ἊΙ', - 'ᾋ' => 'ἋΙ', - 'ᾌ' => 'ἌΙ', - 'ᾍ' => 'ἍΙ', - 'ᾎ' => 'ἎΙ', - 'ᾏ' => 'ἏΙ', - 'ᾘ' => 'ἨΙ', - 'ᾙ' => 'ἩΙ', - 'ᾚ' => 'ἪΙ', - 'ᾛ' => 'ἫΙ', - 'ᾜ' => 'ἬΙ', - 'ᾝ' => 'ἭΙ', - 'ᾞ' => 'ἮΙ', - 'ᾟ' => 'ἯΙ', - 'ᾨ' => 'ὨΙ', - 'ᾩ' => 'ὩΙ', - 'ᾪ' => 'ὪΙ', - 'ᾫ' => 'ὫΙ', - 'ᾬ' => 'ὬΙ', - 'ᾭ' => 'ὭΙ', - 'ᾮ' => 'ὮΙ', - 'ᾯ' => 'ὯΙ', - 'ᾼ' => 'ΑΙ', - 'ῌ' => 'ΗΙ', - 'ῼ' => 'ΩΙ', - 'ᾲ' => 'ᾺΙ', - 'ᾴ' => 'ΆΙ', - 'ῂ' => 'ῊΙ', - 'ῄ' => 'ΉΙ', - 'ῲ' => 'ῺΙ', - 'ῴ' => 'ΏΙ', - 'ᾷ' => 'Α͂Ι', - 'ῇ' => 'Η͂Ι', - 'ῷ' => 'Ω͂Ι', -); diff --git a/vendor/symfony/polyfill-mbstring/bootstrap.php b/vendor/symfony/polyfill-mbstring/bootstrap.php deleted file mode 100644 index 1fedd1f..0000000 --- a/vendor/symfony/polyfill-mbstring/bootstrap.php +++ /dev/null @@ -1,147 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Mbstring as p; - -if (\PHP_VERSION_ID >= 80000) { - return require __DIR__.'/bootstrap80.php'; -} - -if (!function_exists('mb_convert_encoding')) { - function mb_convert_encoding($string, $to_encoding, $from_encoding = null) { return p\Mbstring::mb_convert_encoding($string, $to_encoding, $from_encoding); } -} -if (!function_exists('mb_decode_mimeheader')) { - function mb_decode_mimeheader($string) { return p\Mbstring::mb_decode_mimeheader($string); } -} -if (!function_exists('mb_encode_mimeheader')) { - function mb_encode_mimeheader($string, $charset = null, $transfer_encoding = null, $newline = "\r\n", $indent = 0) { return p\Mbstring::mb_encode_mimeheader($string, $charset, $transfer_encoding, $newline, $indent); } -} -if (!function_exists('mb_decode_numericentity')) { - function mb_decode_numericentity($string, $map, $encoding = null) { return p\Mbstring::mb_decode_numericentity($string, $map, $encoding); } -} -if (!function_exists('mb_encode_numericentity')) { - function mb_encode_numericentity($string, $map, $encoding = null, $hex = false) { return p\Mbstring::mb_encode_numericentity($string, $map, $encoding, $hex); } -} -if (!function_exists('mb_convert_case')) { - function mb_convert_case($string, $mode, $encoding = null) { return p\Mbstring::mb_convert_case($string, $mode, $encoding); } -} -if (!function_exists('mb_internal_encoding')) { - function mb_internal_encoding($encoding = null) { return p\Mbstring::mb_internal_encoding($encoding); } -} -if (!function_exists('mb_language')) { - function mb_language($language = null) { return p\Mbstring::mb_language($language); } -} -if (!function_exists('mb_list_encodings')) { - function mb_list_encodings() { return p\Mbstring::mb_list_encodings(); } -} -if (!function_exists('mb_encoding_aliases')) { - function mb_encoding_aliases($encoding) { return p\Mbstring::mb_encoding_aliases($encoding); } -} -if (!function_exists('mb_check_encoding')) { - function mb_check_encoding($value = null, $encoding = null) { return p\Mbstring::mb_check_encoding($value, $encoding); } -} -if (!function_exists('mb_detect_encoding')) { - function mb_detect_encoding($string, $encodings = null, $strict = false) { return p\Mbstring::mb_detect_encoding($string, $encodings, $strict); } -} -if (!function_exists('mb_detect_order')) { - function mb_detect_order($encoding = null) { return p\Mbstring::mb_detect_order($encoding); } -} -if (!function_exists('mb_parse_str')) { - function mb_parse_str($string, &$result = []) { parse_str($string, $result); return (bool) $result; } -} -if (!function_exists('mb_strlen')) { - function mb_strlen($string, $encoding = null) { return p\Mbstring::mb_strlen($string, $encoding); } -} -if (!function_exists('mb_strpos')) { - function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strpos($haystack, $needle, $offset, $encoding); } -} -if (!function_exists('mb_strtolower')) { - function mb_strtolower($string, $encoding = null) { return p\Mbstring::mb_strtolower($string, $encoding); } -} -if (!function_exists('mb_strtoupper')) { - function mb_strtoupper($string, $encoding = null) { return p\Mbstring::mb_strtoupper($string, $encoding); } -} -if (!function_exists('mb_substitute_character')) { - function mb_substitute_character($substitute_character = null) { return p\Mbstring::mb_substitute_character($substitute_character); } -} -if (!function_exists('mb_substr')) { - function mb_substr($string, $start, $length = 2147483647, $encoding = null) { return p\Mbstring::mb_substr($string, $start, $length, $encoding); } -} -if (!function_exists('mb_stripos')) { - function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_stripos($haystack, $needle, $offset, $encoding); } -} -if (!function_exists('mb_stristr')) { - function mb_stristr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_stristr($haystack, $needle, $before_needle, $encoding); } -} -if (!function_exists('mb_strrchr')) { - function mb_strrchr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrchr($haystack, $needle, $before_needle, $encoding); } -} -if (!function_exists('mb_strrichr')) { - function mb_strrichr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrichr($haystack, $needle, $before_needle, $encoding); } -} -if (!function_exists('mb_strripos')) { - function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strripos($haystack, $needle, $offset, $encoding); } -} -if (!function_exists('mb_strrpos')) { - function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strrpos($haystack, $needle, $offset, $encoding); } -} -if (!function_exists('mb_strstr')) { - function mb_strstr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strstr($haystack, $needle, $before_needle, $encoding); } -} -if (!function_exists('mb_get_info')) { - function mb_get_info($type = 'all') { return p\Mbstring::mb_get_info($type); } -} -if (!function_exists('mb_http_output')) { - function mb_http_output($encoding = null) { return p\Mbstring::mb_http_output($encoding); } -} -if (!function_exists('mb_strwidth')) { - function mb_strwidth($string, $encoding = null) { return p\Mbstring::mb_strwidth($string, $encoding); } -} -if (!function_exists('mb_substr_count')) { - function mb_substr_count($haystack, $needle, $encoding = null) { return p\Mbstring::mb_substr_count($haystack, $needle, $encoding); } -} -if (!function_exists('mb_output_handler')) { - function mb_output_handler($string, $status) { return p\Mbstring::mb_output_handler($string, $status); } -} -if (!function_exists('mb_http_input')) { - function mb_http_input($type = null) { return p\Mbstring::mb_http_input($type); } -} - -if (!function_exists('mb_convert_variables')) { - function mb_convert_variables($to_encoding, $from_encoding, &...$vars) { return p\Mbstring::mb_convert_variables($to_encoding, $from_encoding, ...$vars); } -} - -if (!function_exists('mb_ord')) { - function mb_ord($string, $encoding = null) { return p\Mbstring::mb_ord($string, $encoding); } -} -if (!function_exists('mb_chr')) { - function mb_chr($codepoint, $encoding = null) { return p\Mbstring::mb_chr($codepoint, $encoding); } -} -if (!function_exists('mb_scrub')) { - function mb_scrub($string, $encoding = null) { $encoding = null === $encoding ? mb_internal_encoding() : $encoding; return mb_convert_encoding($string, $encoding, $encoding); } -} -if (!function_exists('mb_str_split')) { - function mb_str_split($string, $length = 1, $encoding = null) { return p\Mbstring::mb_str_split($string, $length, $encoding); } -} - -if (extension_loaded('mbstring')) { - return; -} - -if (!defined('MB_CASE_UPPER')) { - define('MB_CASE_UPPER', 0); -} -if (!defined('MB_CASE_LOWER')) { - define('MB_CASE_LOWER', 1); -} -if (!defined('MB_CASE_TITLE')) { - define('MB_CASE_TITLE', 2); -} diff --git a/vendor/symfony/polyfill-mbstring/bootstrap80.php b/vendor/symfony/polyfill-mbstring/bootstrap80.php deleted file mode 100644 index 82f5ac4..0000000 --- a/vendor/symfony/polyfill-mbstring/bootstrap80.php +++ /dev/null @@ -1,143 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Mbstring as p; - -if (!function_exists('mb_convert_encoding')) { - function mb_convert_encoding(array|string|null $string, ?string $to_encoding, array|string|null $from_encoding = null): array|string|false { return p\Mbstring::mb_convert_encoding($string ?? '', (string) $to_encoding, $from_encoding); } -} -if (!function_exists('mb_decode_mimeheader')) { - function mb_decode_mimeheader(?string $string): string { return p\Mbstring::mb_decode_mimeheader((string) $string); } -} -if (!function_exists('mb_encode_mimeheader')) { - function mb_encode_mimeheader(?string $string, ?string $charset = null, ?string $transfer_encoding = null, ?string $newline = "\r\n", ?int $indent = 0): string { return p\Mbstring::mb_encode_mimeheader((string) $string, $charset, $transfer_encoding, (string) $newline, (int) $indent); } -} -if (!function_exists('mb_decode_numericentity')) { - function mb_decode_numericentity(?string $string, array $map, ?string $encoding = null): string { return p\Mbstring::mb_decode_numericentity((string) $string, $map, $encoding); } -} -if (!function_exists('mb_encode_numericentity')) { - function mb_encode_numericentity(?string $string, array $map, ?string $encoding = null, ?bool $hex = false): string { return p\Mbstring::mb_encode_numericentity((string) $string, $map, $encoding, (bool) $hex); } -} -if (!function_exists('mb_convert_case')) { - function mb_convert_case(?string $string, ?int $mode, ?string $encoding = null): string { return p\Mbstring::mb_convert_case((string) $string, (int) $mode, $encoding); } -} -if (!function_exists('mb_internal_encoding')) { - function mb_internal_encoding(?string $encoding = null): string|bool { return p\Mbstring::mb_internal_encoding($encoding); } -} -if (!function_exists('mb_language')) { - function mb_language(?string $language = null): string|bool { return p\Mbstring::mb_language($language); } -} -if (!function_exists('mb_list_encodings')) { - function mb_list_encodings(): array { return p\Mbstring::mb_list_encodings(); } -} -if (!function_exists('mb_encoding_aliases')) { - function mb_encoding_aliases(?string $encoding): array { return p\Mbstring::mb_encoding_aliases((string) $encoding); } -} -if (!function_exists('mb_check_encoding')) { - function mb_check_encoding(array|string|null $value = null, ?string $encoding = null): bool { return p\Mbstring::mb_check_encoding($value, $encoding); } -} -if (!function_exists('mb_detect_encoding')) { - function mb_detect_encoding(?string $string, array|string|null $encodings = null, ?bool $strict = false): string|false { return p\Mbstring::mb_detect_encoding((string) $string, $encodings, (bool) $strict); } -} -if (!function_exists('mb_detect_order')) { - function mb_detect_order(array|string|null $encoding = null): array|bool { return p\Mbstring::mb_detect_order($encoding); } -} -if (!function_exists('mb_parse_str')) { - function mb_parse_str(?string $string, &$result = []): bool { parse_str((string) $string, $result); return (bool) $result; } -} -if (!function_exists('mb_strlen')) { - function mb_strlen(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strlen((string) $string, $encoding); } -} -if (!function_exists('mb_strpos')) { - function mb_strpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strpos((string) $haystack, (string) $needle, (int) $offset, $encoding); } -} -if (!function_exists('mb_strtolower')) { - function mb_strtolower(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtolower((string) $string, $encoding); } -} -if (!function_exists('mb_strtoupper')) { - function mb_strtoupper(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtoupper((string) $string, $encoding); } -} -if (!function_exists('mb_substitute_character')) { - function mb_substitute_character(string|int|null $substitute_character = null): string|int|bool { return p\Mbstring::mb_substitute_character($substitute_character); } -} -if (!function_exists('mb_substr')) { - function mb_substr(?string $string, ?int $start, ?int $length = null, ?string $encoding = null): string { return p\Mbstring::mb_substr((string) $string, (int) $start, $length, $encoding); } -} -if (!function_exists('mb_stripos')) { - function mb_stripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_stripos((string) $haystack, (string) $needle, (int) $offset, $encoding); } -} -if (!function_exists('mb_stristr')) { - function mb_stristr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_stristr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } -} -if (!function_exists('mb_strrchr')) { - function mb_strrchr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strrchr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } -} -if (!function_exists('mb_strrichr')) { - function mb_strrichr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strrichr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } -} -if (!function_exists('mb_strripos')) { - function mb_strripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strripos((string) $haystack, (string) $needle, (int) $offset, $encoding); } -} -if (!function_exists('mb_strrpos')) { - function mb_strrpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strrpos((string) $haystack, (string) $needle, (int) $offset, $encoding); } -} -if (!function_exists('mb_strstr')) { - function mb_strstr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strstr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } -} -if (!function_exists('mb_get_info')) { - function mb_get_info(?string $type = 'all'): array|string|int|false { return p\Mbstring::mb_get_info((string) $type); } -} -if (!function_exists('mb_http_output')) { - function mb_http_output(?string $encoding = null): string|bool { return p\Mbstring::mb_http_output($encoding); } -} -if (!function_exists('mb_strwidth')) { - function mb_strwidth(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strwidth((string) $string, $encoding); } -} -if (!function_exists('mb_substr_count')) { - function mb_substr_count(?string $haystack, ?string $needle, ?string $encoding = null): int { return p\Mbstring::mb_substr_count((string) $haystack, (string) $needle, $encoding); } -} -if (!function_exists('mb_output_handler')) { - function mb_output_handler(?string $string, ?int $status): string { return p\Mbstring::mb_output_handler((string) $string, (int) $status); } -} -if (!function_exists('mb_http_input')) { - function mb_http_input(?string $type = null): array|string|false { return p\Mbstring::mb_http_input($type); } -} - -if (!function_exists('mb_convert_variables')) { - function mb_convert_variables(?string $to_encoding, array|string|null $from_encoding, mixed &$var, mixed &...$vars): string|false { return p\Mbstring::mb_convert_variables((string) $to_encoding, $from_encoding ?? '', $var, ...$vars); } -} - -if (!function_exists('mb_ord')) { - function mb_ord(?string $string, ?string $encoding = null): int|false { return p\Mbstring::mb_ord((string) $string, $encoding); } -} -if (!function_exists('mb_chr')) { - function mb_chr(?int $codepoint, ?string $encoding = null): string|false { return p\Mbstring::mb_chr((int) $codepoint, $encoding); } -} -if (!function_exists('mb_scrub')) { - function mb_scrub(?string $string, ?string $encoding = null): string { $encoding ??= mb_internal_encoding(); return mb_convert_encoding((string) $string, $encoding, $encoding); } -} -if (!function_exists('mb_str_split')) { - function mb_str_split(?string $string, ?int $length = 1, ?string $encoding = null): array { return p\Mbstring::mb_str_split((string) $string, (int) $length, $encoding); } -} - -if (extension_loaded('mbstring')) { - return; -} - -if (!defined('MB_CASE_UPPER')) { - define('MB_CASE_UPPER', 0); -} -if (!defined('MB_CASE_LOWER')) { - define('MB_CASE_LOWER', 1); -} -if (!defined('MB_CASE_TITLE')) { - define('MB_CASE_TITLE', 2); -} diff --git a/vendor/symfony/polyfill-mbstring/composer.json b/vendor/symfony/polyfill-mbstring/composer.json deleted file mode 100644 index 2ed7a74..0000000 --- a/vendor/symfony/polyfill-mbstring/composer.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "symfony/polyfill-mbstring", - "type": "library", - "description": "Symfony polyfill for the Mbstring extension", - "keywords": ["polyfill", "shim", "compatibility", "portable", "mbstring"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.1" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Mbstring\\": "" }, - "files": [ "bootstrap.php" ] - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - } -} diff --git a/vendor/symfony/polyfill-php73/LICENSE b/vendor/symfony/polyfill-php73/LICENSE deleted file mode 100644 index 3f853aa..0000000 --- a/vendor/symfony/polyfill-php73/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2018-2019 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/polyfill-php73/Php73.php b/vendor/symfony/polyfill-php73/Php73.php deleted file mode 100644 index 65c35a6..0000000 --- a/vendor/symfony/polyfill-php73/Php73.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Php73; - -/** - * @author Gabriel Caruso - * @author Ion Bazan - * - * @internal - */ -final class Php73 -{ - public static $startAt = 1533462603; - - /** - * @param bool $asNum - * - * @return array|float|int - */ - public static function hrtime($asNum = false) - { - $ns = microtime(false); - $s = substr($ns, 11) - self::$startAt; - $ns = 1E9 * (float) $ns; - - if ($asNum) { - $ns += $s * 1E9; - - return \PHP_INT_SIZE === 4 ? $ns : (int) $ns; - } - - return [$s, (int) $ns]; - } -} diff --git a/vendor/symfony/polyfill-php73/README.md b/vendor/symfony/polyfill-php73/README.md deleted file mode 100644 index b3ebbce..0000000 --- a/vendor/symfony/polyfill-php73/README.md +++ /dev/null @@ -1,18 +0,0 @@ -Symfony Polyfill / Php73 -======================== - -This component provides functions added to PHP 7.3 core: - -- [`array_key_first`](https://php.net/array_key_first) -- [`array_key_last`](https://php.net/array_key_last) -- [`hrtime`](https://php.net/function.hrtime) -- [`is_countable`](https://php.net/is_countable) -- [`JsonException`](https://php.net/JsonException) - -More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). - -License -======= - -This library is released under the [MIT license](LICENSE). diff --git a/vendor/symfony/polyfill-php73/Resources/stubs/JsonException.php b/vendor/symfony/polyfill-php73/Resources/stubs/JsonException.php deleted file mode 100644 index 673d100..0000000 --- a/vendor/symfony/polyfill-php73/Resources/stubs/JsonException.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -class JsonException extends Exception -{ -} diff --git a/vendor/symfony/polyfill-php73/bootstrap.php b/vendor/symfony/polyfill-php73/bootstrap.php deleted file mode 100644 index d6b2153..0000000 --- a/vendor/symfony/polyfill-php73/bootstrap.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Php73 as p; - -if (\PHP_VERSION_ID >= 70300) { - return; -} - -if (!function_exists('is_countable')) { - function is_countable($value) { return is_array($value) || $value instanceof Countable || $value instanceof ResourceBundle || $value instanceof SimpleXmlElement; } -} -if (!function_exists('hrtime')) { - require_once __DIR__.'/Php73.php'; - p\Php73::$startAt = (int) microtime(true); - function hrtime($as_number = false) { return p\Php73::hrtime($as_number); } -} -if (!function_exists('array_key_first')) { - function array_key_first(array $array) { foreach ($array as $key => $value) { return $key; } } -} -if (!function_exists('array_key_last')) { - function array_key_last(array $array) { return key(array_slice($array, -1, 1, true)); } -} diff --git a/vendor/symfony/polyfill-php73/composer.json b/vendor/symfony/polyfill-php73/composer.json deleted file mode 100644 index a7fe478..0000000 --- a/vendor/symfony/polyfill-php73/composer.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "symfony/polyfill-php73", - "type": "library", - "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", - "keywords": ["polyfill", "shim", "compatibility", "portable"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.1" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Php73\\": "" }, - "files": [ "bootstrap.php" ], - "classmap": [ "Resources/stubs" ] - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - } -} diff --git a/vendor/symfony/polyfill-php80/LICENSE b/vendor/symfony/polyfill-php80/LICENSE deleted file mode 100644 index 5593b1d..0000000 --- a/vendor/symfony/polyfill-php80/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/polyfill-php80/Php80.php b/vendor/symfony/polyfill-php80/Php80.php deleted file mode 100644 index 5fef511..0000000 --- a/vendor/symfony/polyfill-php80/Php80.php +++ /dev/null @@ -1,105 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Php80; - -/** - * @author Ion Bazan - * @author Nico Oelgart - * @author Nicolas Grekas - * - * @internal - */ -final class Php80 -{ - public static function fdiv(float $dividend, float $divisor): float - { - return @($dividend / $divisor); - } - - public static function get_debug_type($value): string - { - switch (true) { - case null === $value: return 'null'; - case \is_bool($value): return 'bool'; - case \is_string($value): return 'string'; - case \is_array($value): return 'array'; - case \is_int($value): return 'int'; - case \is_float($value): return 'float'; - case \is_object($value): break; - case $value instanceof \__PHP_Incomplete_Class: return '__PHP_Incomplete_Class'; - default: - if (null === $type = @get_resource_type($value)) { - return 'unknown'; - } - - if ('Unknown' === $type) { - $type = 'closed'; - } - - return "resource ($type)"; - } - - $class = \get_class($value); - - if (false === strpos($class, '@')) { - return $class; - } - - return (get_parent_class($class) ?: key(class_implements($class)) ?: 'class').'@anonymous'; - } - - public static function get_resource_id($res): int - { - if (!\is_resource($res) && null === @get_resource_type($res)) { - throw new \TypeError(sprintf('Argument 1 passed to get_resource_id() must be of the type resource, %s given', get_debug_type($res))); - } - - return (int) $res; - } - - public static function preg_last_error_msg(): string - { - switch (preg_last_error()) { - case \PREG_INTERNAL_ERROR: - return 'Internal error'; - case \PREG_BAD_UTF8_ERROR: - return 'Malformed UTF-8 characters, possibly incorrectly encoded'; - case \PREG_BAD_UTF8_OFFSET_ERROR: - return 'The offset did not correspond to the beginning of a valid UTF-8 code point'; - case \PREG_BACKTRACK_LIMIT_ERROR: - return 'Backtrack limit exhausted'; - case \PREG_RECURSION_LIMIT_ERROR: - return 'Recursion limit exhausted'; - case \PREG_JIT_STACKLIMIT_ERROR: - return 'JIT stack limit exhausted'; - case \PREG_NO_ERROR: - return 'No error'; - default: - return 'Unknown error'; - } - } - - public static function str_contains(string $haystack, string $needle): bool - { - return '' === $needle || false !== strpos($haystack, $needle); - } - - public static function str_starts_with(string $haystack, string $needle): bool - { - return 0 === strncmp($haystack, $needle, \strlen($needle)); - } - - public static function str_ends_with(string $haystack, string $needle): bool - { - return '' === $needle || ('' !== $haystack && 0 === substr_compare($haystack, $needle, -\strlen($needle))); - } -} diff --git a/vendor/symfony/polyfill-php80/README.md b/vendor/symfony/polyfill-php80/README.md deleted file mode 100644 index 10b8ee4..0000000 --- a/vendor/symfony/polyfill-php80/README.md +++ /dev/null @@ -1,24 +0,0 @@ -Symfony Polyfill / Php80 -======================== - -This component provides features added to PHP 8.0 core: - -- `Stringable` interface -- [`fdiv`](https://php.net/fdiv) -- `ValueError` class -- `UnhandledMatchError` class -- `FILTER_VALIDATE_BOOL` constant -- [`get_debug_type`](https://php.net/get_debug_type) -- [`preg_last_error_msg`](https://php.net/preg_last_error_msg) -- [`str_contains`](https://php.net/str_contains) -- [`str_starts_with`](https://php.net/str_starts_with) -- [`str_ends_with`](https://php.net/str_ends_with) -- [`get_resource_id`](https://php.net/get_resource_id) - -More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). - -License -======= - -This library is released under the [MIT license](LICENSE). diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php b/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php deleted file mode 100644 index 7ea6d27..0000000 --- a/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php +++ /dev/null @@ -1,22 +0,0 @@ -flags = $flags; - } -} diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php b/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php deleted file mode 100644 index 77e037c..0000000 --- a/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php +++ /dev/null @@ -1,11 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Php80 as p; - -if (\PHP_VERSION_ID >= 80000) { - return; -} - -if (!defined('FILTER_VALIDATE_BOOL') && defined('FILTER_VALIDATE_BOOLEAN')) { - define('FILTER_VALIDATE_BOOL', \FILTER_VALIDATE_BOOLEAN); -} - -if (!function_exists('fdiv')) { - function fdiv(float $num1, float $num2): float { return p\Php80::fdiv($num1, $num2); } -} -if (!function_exists('preg_last_error_msg')) { - function preg_last_error_msg(): string { return p\Php80::preg_last_error_msg(); } -} -if (!function_exists('str_contains')) { - function str_contains(?string $haystack, ?string $needle): bool { return p\Php80::str_contains($haystack ?? '', $needle ?? ''); } -} -if (!function_exists('str_starts_with')) { - function str_starts_with(?string $haystack, ?string $needle): bool { return p\Php80::str_starts_with($haystack ?? '', $needle ?? ''); } -} -if (!function_exists('str_ends_with')) { - function str_ends_with(?string $haystack, ?string $needle): bool { return p\Php80::str_ends_with($haystack ?? '', $needle ?? ''); } -} -if (!function_exists('get_debug_type')) { - function get_debug_type($value): string { return p\Php80::get_debug_type($value); } -} -if (!function_exists('get_resource_id')) { - function get_resource_id($resource): int { return p\Php80::get_resource_id($resource); } -} diff --git a/vendor/symfony/polyfill-php80/composer.json b/vendor/symfony/polyfill-php80/composer.json deleted file mode 100644 index 5fe679d..0000000 --- a/vendor/symfony/polyfill-php80/composer.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "symfony/polyfill-php80", - "type": "library", - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "keywords": ["polyfill", "shim", "compatibility", "portable"], - "homepage": "https://symfony.com", - "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" - } - ], - "require": { - "php": ">=7.1" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Php80\\": "" }, - "files": [ "bootstrap.php" ], - "classmap": [ "Resources/stubs" ] - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - } -} diff --git a/vendor/symfony/service-contracts/.gitignore b/vendor/symfony/service-contracts/.gitignore deleted file mode 100644 index c49a5d8..0000000 --- a/vendor/symfony/service-contracts/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -vendor/ -composer.lock -phpunit.xml diff --git a/vendor/symfony/service-contracts/Attribute/Required.php b/vendor/symfony/service-contracts/Attribute/Required.php deleted file mode 100644 index 9df8511..0000000 --- a/vendor/symfony/service-contracts/Attribute/Required.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service\Attribute; - -/** - * A required dependency. - * - * This attribute indicates that a property holds a required dependency. The annotated property or method should be - * considered during the instantiation process of the containing class. - * - * @author Alexander M. Turek - */ -#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY)] -final class Required -{ -} diff --git a/vendor/symfony/service-contracts/Attribute/SubscribedService.php b/vendor/symfony/service-contracts/Attribute/SubscribedService.php deleted file mode 100644 index 10d1bc3..0000000 --- a/vendor/symfony/service-contracts/Attribute/SubscribedService.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service\Attribute; - -use Symfony\Contracts\Service\ServiceSubscriberTrait; - -/** - * Use with {@see ServiceSubscriberTrait} to mark a method's return type - * as a subscribed service. - * - * @author Kevin Bond - */ -#[\Attribute(\Attribute::TARGET_METHOD)] -final class SubscribedService -{ - /** - * @param string|null $key The key to use for the service - * If null, use "ClassName::methodName" - */ - public function __construct( - public ?string $key = null - ) { - } -} diff --git a/vendor/symfony/service-contracts/CHANGELOG.md b/vendor/symfony/service-contracts/CHANGELOG.md deleted file mode 100644 index 7932e26..0000000 --- a/vendor/symfony/service-contracts/CHANGELOG.md +++ /dev/null @@ -1,5 +0,0 @@ -CHANGELOG -========= - -The changelog is maintained for all Symfony contracts at the following URL: -https://github.com/symfony/contracts/blob/main/CHANGELOG.md diff --git a/vendor/symfony/service-contracts/LICENSE b/vendor/symfony/service-contracts/LICENSE deleted file mode 100644 index 2358414..0000000 --- a/vendor/symfony/service-contracts/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2018-2021 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/service-contracts/README.md b/vendor/symfony/service-contracts/README.md deleted file mode 100644 index 41e054a..0000000 --- a/vendor/symfony/service-contracts/README.md +++ /dev/null @@ -1,9 +0,0 @@ -Symfony Service Contracts -========================= - -A set of abstractions extracted out of the Symfony components. - -Can be used to build on semantics that the Symfony components proved useful - and -that already have battle tested implementations. - -See https://github.com/symfony/contracts/blob/main/README.md for more information. diff --git a/vendor/symfony/service-contracts/ResetInterface.php b/vendor/symfony/service-contracts/ResetInterface.php deleted file mode 100644 index 1af1075..0000000 --- a/vendor/symfony/service-contracts/ResetInterface.php +++ /dev/null @@ -1,30 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service; - -/** - * Provides a way to reset an object to its initial state. - * - * When calling the "reset()" method on an object, it should be put back to its - * initial state. This usually means clearing any internal buffers and forwarding - * the call to internal dependencies. All properties of the object should be put - * back to the same state it had when it was first ready to use. - * - * This method could be called, for example, to recycle objects that are used as - * services, so that they can be used to handle several requests in the same - * process loop (note that we advise making your services stateless instead of - * implementing this interface when possible.) - */ -interface ResetInterface -{ - public function reset(); -} diff --git a/vendor/symfony/service-contracts/ServiceLocatorTrait.php b/vendor/symfony/service-contracts/ServiceLocatorTrait.php deleted file mode 100644 index 74dfa43..0000000 --- a/vendor/symfony/service-contracts/ServiceLocatorTrait.php +++ /dev/null @@ -1,128 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service; - -use Psr\Container\ContainerExceptionInterface; -use Psr\Container\NotFoundExceptionInterface; - -// Help opcache.preload discover always-needed symbols -class_exists(ContainerExceptionInterface::class); -class_exists(NotFoundExceptionInterface::class); - -/** - * A trait to help implement ServiceProviderInterface. - * - * @author Robin Chalas - * @author Nicolas Grekas - */ -trait ServiceLocatorTrait -{ - private $factories; - private $loading = []; - private $providedTypes; - - /** - * @param callable[] $factories - */ - public function __construct(array $factories) - { - $this->factories = $factories; - } - - /** - * {@inheritdoc} - * - * @return bool - */ - public function has(string $id) - { - return isset($this->factories[$id]); - } - - /** - * {@inheritdoc} - * - * @return mixed - */ - public function get(string $id) - { - if (!isset($this->factories[$id])) { - throw $this->createNotFoundException($id); - } - - if (isset($this->loading[$id])) { - $ids = array_values($this->loading); - $ids = \array_slice($this->loading, array_search($id, $ids)); - $ids[] = $id; - - throw $this->createCircularReferenceException($id, $ids); - } - - $this->loading[$id] = $id; - try { - return $this->factories[$id]($this); - } finally { - unset($this->loading[$id]); - } - } - - /** - * {@inheritdoc} - */ - public function getProvidedServices(): array - { - if (null === $this->providedTypes) { - $this->providedTypes = []; - - foreach ($this->factories as $name => $factory) { - if (!\is_callable($factory)) { - $this->providedTypes[$name] = '?'; - } else { - $type = (new \ReflectionFunction($factory))->getReturnType(); - - $this->providedTypes[$name] = $type ? ($type->allowsNull() ? '?' : '').($type instanceof \ReflectionNamedType ? $type->getName() : $type) : '?'; - } - } - } - - return $this->providedTypes; - } - - private function createNotFoundException(string $id): NotFoundExceptionInterface - { - if (!$alternatives = array_keys($this->factories)) { - $message = 'is empty...'; - } else { - $last = array_pop($alternatives); - if ($alternatives) { - $message = sprintf('only knows about the "%s" and "%s" services.', implode('", "', $alternatives), $last); - } else { - $message = sprintf('only knows about the "%s" service.', $last); - } - } - - if ($this->loading) { - $message = sprintf('The service "%s" has a dependency on a non-existent service "%s". This locator %s', end($this->loading), $id, $message); - } else { - $message = sprintf('Service "%s" not found: the current service locator %s', $id, $message); - } - - return new class($message) extends \InvalidArgumentException implements NotFoundExceptionInterface { - }; - } - - private function createCircularReferenceException(string $id, array $path): ContainerExceptionInterface - { - return new class(sprintf('Circular reference detected for service "%s", path: "%s".', $id, implode(' -> ', $path))) extends \RuntimeException implements ContainerExceptionInterface { - }; - } -} diff --git a/vendor/symfony/service-contracts/ServiceProviderInterface.php b/vendor/symfony/service-contracts/ServiceProviderInterface.php deleted file mode 100644 index c60ad0b..0000000 --- a/vendor/symfony/service-contracts/ServiceProviderInterface.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service; - -use Psr\Container\ContainerInterface; - -/** - * A ServiceProviderInterface exposes the identifiers and the types of services provided by a container. - * - * @author Nicolas Grekas - * @author Mateusz Sip - */ -interface ServiceProviderInterface extends ContainerInterface -{ - /** - * Returns an associative array of service types keyed by the identifiers provided by the current container. - * - * Examples: - * - * * ['logger' => 'Psr\Log\LoggerInterface'] means the object provides a service named "logger" that implements Psr\Log\LoggerInterface - * * ['foo' => '?'] means the container provides service name "foo" of unspecified type - * * ['bar' => '?Bar\Baz'] means the container provides a service "bar" of type Bar\Baz|null - * - * @return string[] The provided service types, keyed by service names - */ - public function getProvidedServices(): array; -} diff --git a/vendor/symfony/service-contracts/ServiceSubscriberInterface.php b/vendor/symfony/service-contracts/ServiceSubscriberInterface.php deleted file mode 100644 index 098ab90..0000000 --- a/vendor/symfony/service-contracts/ServiceSubscriberInterface.php +++ /dev/null @@ -1,53 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service; - -/** - * A ServiceSubscriber exposes its dependencies via the static {@link getSubscribedServices} method. - * - * The getSubscribedServices method returns an array of service types required by such instances, - * optionally keyed by the service names used internally. Service types that start with an interrogation - * mark "?" are optional, while the other ones are mandatory service dependencies. - * - * The injected service locators SHOULD NOT allow access to any other services not specified by the method. - * - * It is expected that ServiceSubscriber instances consume PSR-11-based service locators internally. - * This interface does not dictate any injection method for these service locators, although constructor - * injection is recommended. - * - * @author Nicolas Grekas - */ -interface ServiceSubscriberInterface -{ - /** - * Returns an array of service types required by such instances, optionally keyed by the service names used internally. - * - * For mandatory dependencies: - * - * * ['logger' => 'Psr\Log\LoggerInterface'] means the objects use the "logger" name - * internally to fetch a service which must implement Psr\Log\LoggerInterface. - * * ['loggers' => 'Psr\Log\LoggerInterface[]'] means the objects use the "loggers" name - * internally to fetch an iterable of Psr\Log\LoggerInterface instances. - * * ['Psr\Log\LoggerInterface'] is a shortcut for - * * ['Psr\Log\LoggerInterface' => 'Psr\Log\LoggerInterface'] - * - * otherwise: - * - * * ['logger' => '?Psr\Log\LoggerInterface'] denotes an optional dependency - * * ['loggers' => '?Psr\Log\LoggerInterface[]'] denotes an optional iterable dependency - * * ['?Psr\Log\LoggerInterface'] is a shortcut for - * * ['Psr\Log\LoggerInterface' => '?Psr\Log\LoggerInterface'] - * - * @return string[] The required service types, optionally keyed by service names - */ - public static function getSubscribedServices(); -} diff --git a/vendor/symfony/service-contracts/ServiceSubscriberTrait.php b/vendor/symfony/service-contracts/ServiceSubscriberTrait.php deleted file mode 100644 index 46cd007..0000000 --- a/vendor/symfony/service-contracts/ServiceSubscriberTrait.php +++ /dev/null @@ -1,115 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service; - -use Psr\Container\ContainerInterface; -use Symfony\Contracts\Service\Attribute\SubscribedService; - -/** - * Implementation of ServiceSubscriberInterface that determines subscribed services from - * method return types. Service ids are available as "ClassName::methodName". - * - * @author Kevin Bond - */ -trait ServiceSubscriberTrait -{ - /** @var ContainerInterface */ - protected $container; - - /** - * {@inheritdoc} - */ - public static function getSubscribedServices(): array - { - static $services; - - if (null !== $services) { - return $services; - } - - $services = \is_callable(['parent', __FUNCTION__]) ? parent::getSubscribedServices() : []; - $attributeOptIn = false; - - if (\PHP_VERSION_ID >= 80000) { - foreach ((new \ReflectionClass(self::class))->getMethods() as $method) { - if (self::class !== $method->getDeclaringClass()->name) { - continue; - } - - if (!$attribute = $method->getAttributes(SubscribedService::class)[0] ?? null) { - continue; - } - - if ($method->isStatic() || $method->isAbstract() || $method->isGenerator() || $method->isInternal() || $method->getNumberOfRequiredParameters()) { - throw new \LogicException(sprintf('Cannot use "%s" on method "%s::%s()" (can only be used on non-static, non-abstract methods with no parameters).', SubscribedService::class, self::class, $method->name)); - } - - if (!$returnType = $method->getReturnType()) { - throw new \LogicException(sprintf('Cannot use "%s" on methods without a return type in "%s::%s()".', SubscribedService::class, $method->name, self::class)); - } - - $serviceId = $returnType instanceof \ReflectionNamedType ? $returnType->getName() : (string) $returnType; - - if ($returnType->allowsNull()) { - $serviceId = '?'.$serviceId; - } - - $services[$attribute->newInstance()->key ?? self::class.'::'.$method->name] = $serviceId; - $attributeOptIn = true; - } - } - - if (!$attributeOptIn) { - foreach ((new \ReflectionClass(self::class))->getMethods() as $method) { - if ($method->isStatic() || $method->isAbstract() || $method->isGenerator() || $method->isInternal() || $method->getNumberOfRequiredParameters()) { - continue; - } - - if (self::class !== $method->getDeclaringClass()->name) { - continue; - } - - if (!($returnType = $method->getReturnType()) instanceof \ReflectionNamedType) { - continue; - } - - if ($returnType->isBuiltin()) { - continue; - } - - if (\PHP_VERSION_ID >= 80000) { - trigger_deprecation('symfony/service-contracts', '2.5', 'Using "%s" in "%s" without using the "%s" attribute on any method is deprecated.', ServiceSubscriberTrait::class, self::class, SubscribedService::class); - } - - $services[self::class.'::'.$method->name] = '?'.($returnType instanceof \ReflectionNamedType ? $returnType->getName() : $returnType); - } - } - - return $services; - } - - /** - * @required - * - * @return ContainerInterface|null - */ - public function setContainer(ContainerInterface $container) - { - $this->container = $container; - - if (\is_callable(['parent', __FUNCTION__])) { - return parent::setContainer($container); - } - - return null; - } -} diff --git a/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php b/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php deleted file mode 100644 index 2a1b565..0000000 --- a/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php +++ /dev/null @@ -1,95 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service\Test; - -use PHPUnit\Framework\TestCase; -use Psr\Container\ContainerInterface; -use Symfony\Contracts\Service\ServiceLocatorTrait; - -abstract class ServiceLocatorTest extends TestCase -{ - /** - * @return ContainerInterface - */ - protected function getServiceLocator(array $factories) - { - return new class($factories) implements ContainerInterface { - use ServiceLocatorTrait; - }; - } - - public function testHas() - { - $locator = $this->getServiceLocator([ - 'foo' => function () { return 'bar'; }, - 'bar' => function () { return 'baz'; }, - function () { return 'dummy'; }, - ]); - - $this->assertTrue($locator->has('foo')); - $this->assertTrue($locator->has('bar')); - $this->assertFalse($locator->has('dummy')); - } - - public function testGet() - { - $locator = $this->getServiceLocator([ - 'foo' => function () { return 'bar'; }, - 'bar' => function () { return 'baz'; }, - ]); - - $this->assertSame('bar', $locator->get('foo')); - $this->assertSame('baz', $locator->get('bar')); - } - - public function testGetDoesNotMemoize() - { - $i = 0; - $locator = $this->getServiceLocator([ - 'foo' => function () use (&$i) { - ++$i; - - return 'bar'; - }, - ]); - - $this->assertSame('bar', $locator->get('foo')); - $this->assertSame('bar', $locator->get('foo')); - $this->assertSame(2, $i); - } - - public function testThrowsOnUndefinedInternalService() - { - if (!$this->getExpectedException()) { - $this->expectException(\Psr\Container\NotFoundExceptionInterface::class); - $this->expectExceptionMessage('The service "foo" has a dependency on a non-existent service "bar". This locator only knows about the "foo" service.'); - } - $locator = $this->getServiceLocator([ - 'foo' => function () use (&$locator) { return $locator->get('bar'); }, - ]); - - $locator->get('foo'); - } - - public function testThrowsOnCircularReference() - { - $this->expectException(\Psr\Container\ContainerExceptionInterface::class); - $this->expectExceptionMessage('Circular reference detected for service "bar", path: "bar -> baz -> bar".'); - $locator = $this->getServiceLocator([ - 'foo' => function () use (&$locator) { return $locator->get('bar'); }, - 'bar' => function () use (&$locator) { return $locator->get('baz'); }, - 'baz' => function () use (&$locator) { return $locator->get('bar'); }, - ]); - - $locator->get('foo'); - } -} diff --git a/vendor/symfony/service-contracts/composer.json b/vendor/symfony/service-contracts/composer.json deleted file mode 100644 index e680798..0000000 --- a/vendor/symfony/service-contracts/composer.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "symfony/service-contracts", - "type": "library", - "description": "Generic abstractions related to writing services", - "keywords": ["abstractions", "contracts", "decoupling", "interfaces", "interoperability", "standards"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.2.5", - "psr/container": "^1.1", - "symfony/deprecation-contracts": "^2.1" - }, - "conflict": { - "ext-psr": "<1.1|>=2" - }, - "suggest": { - "symfony/service-implementation": "" - }, - "autoload": { - "psr-4": { "Symfony\\Contracts\\Service\\": "" } - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - } -} diff --git a/vendor/theseer/tokenizer/.php_cs.dist b/vendor/theseer/tokenizer/.php_cs.dist deleted file mode 100644 index 8ac26d0..0000000 --- a/vendor/theseer/tokenizer/.php_cs.dist +++ /dev/null @@ -1,213 +0,0 @@ -registerCustomFixers([ - new \PharIo\CSFixer\PhpdocSingleLineVarFixer() - ]) - ->setRiskyAllowed(true) - ->setRules( - [ - 'PharIo/phpdoc_single_line_var_fixer' => true, - - 'align_multiline_comment' => true, - 'array_indentation' => true, - 'array_syntax' => ['syntax' => 'short'], - 'binary_operator_spaces' => [ - 'operators' => [ - '=' => 'align_single_space_minimal', - '=>' => 'align', - ], - ], - 'blank_line_after_namespace' => true, - 'blank_line_after_opening_tag' => false, - 'blank_line_before_statement' => [ - 'statements' => [ - 'break', - 'continue', - 'declare', - 'do', - 'for', - 'foreach', - 'if', - 'include', - 'include_once', - 'require', - 'require_once', - 'return', - 'switch', - 'throw', - 'try', - 'while', - 'yield', - ], - ], - 'braces' => [ - 'allow_single_line_closure' => false, - 'position_after_anonymous_constructs' => 'same', - 'position_after_control_structures' => 'same', - 'position_after_functions_and_oop_constructs' => 'same' - ], - 'cast_spaces' => ['space' => 'none'], - - // This fixer removes the blank line at class start, no way to disable that, so we disable the fixer :( - //'class_attributes_separation' => ['elements' => ['const', 'method', 'property']], - - 'combine_consecutive_issets' => true, - 'combine_consecutive_unsets' => true, - 'compact_nullable_typehint' => true, - 'concat_space' => ['spacing' => 'one'], - 'date_time_immutable' => true, - 'declare_equal_normalize' => ['space' => 'single'], - 'declare_strict_types' => true, - 'dir_constant' => true, - 'elseif' => true, - 'encoding' => true, - 'full_opening_tag' => true, - 'fully_qualified_strict_types' => true, - 'function_declaration' => [ - 'closure_function_spacing' => 'one' - ], - 'header_comment' => false, - 'indentation_type' => true, - 'is_null' => true, - 'line_ending' => true, - 'list_syntax' => ['syntax' => 'short'], - 'logical_operators' => true, - 'lowercase_cast' => true, - 'lowercase_constants' => true, - 'lowercase_keywords' => true, - 'lowercase_static_reference' => true, - 'magic_constant_casing' => true, - 'method_argument_space' => ['ensure_fully_multiline' => true], - 'modernize_types_casting' => true, - 'multiline_comment_opening_closing' => true, - 'multiline_whitespace_before_semicolons' => true, - 'native_constant_invocation' => true, - 'native_function_casing' => true, - 'native_function_invocation' => true, - 'new_with_braces' => false, - 'no_alias_functions' => true, - 'no_alternative_syntax' => true, - 'no_blank_lines_after_class_opening' => false, - 'no_blank_lines_after_phpdoc' => true, - 'no_blank_lines_before_namespace' => true, - 'no_closing_tag' => true, - 'no_empty_comment' => true, - 'no_empty_phpdoc' => true, - 'no_empty_statement' => true, - 'no_extra_blank_lines' => true, - 'no_homoglyph_names' => true, - 'no_leading_import_slash' => true, - 'no_leading_namespace_whitespace' => true, - 'no_mixed_echo_print' => ['use' => 'print'], - 'no_multiline_whitespace_around_double_arrow' => true, - 'no_null_property_initialization' => true, - 'no_php4_constructor' => true, - 'no_short_bool_cast' => true, - 'no_short_echo_tag' => true, - 'no_singleline_whitespace_before_semicolons' => true, - 'no_spaces_after_function_name' => true, - 'no_spaces_inside_parenthesis' => true, - 'no_superfluous_elseif' => true, - 'no_superfluous_phpdoc_tags' => true, - 'no_trailing_comma_in_list_call' => true, - 'no_trailing_comma_in_singleline_array' => true, - 'no_trailing_whitespace' => true, - 'no_trailing_whitespace_in_comment' => true, - 'no_unneeded_control_parentheses' => false, - 'no_unneeded_curly_braces' => false, - 'no_unneeded_final_method' => true, - 'no_unreachable_default_argument_value' => true, - 'no_unset_on_property' => true, - 'no_unused_imports' => true, - 'no_useless_else' => true, - 'no_useless_return' => true, - 'no_whitespace_before_comma_in_array' => true, - 'no_whitespace_in_blank_line' => true, - 'non_printable_character' => true, - 'normalize_index_brace' => true, - 'object_operator_without_whitespace' => true, - 'ordered_class_elements' => [ - 'order' => [ - 'use_trait', - 'constant_public', - 'constant_protected', - 'constant_private', - 'property_public_static', - 'property_protected_static', - 'property_private_static', - 'property_public', - 'property_protected', - 'property_private', - 'method_public_static', - 'construct', - 'destruct', - 'magic', - 'phpunit', - 'method_public', - 'method_protected', - 'method_private', - 'method_protected_static', - 'method_private_static', - ], - ], - 'ordered_imports' => true, - 'phpdoc_add_missing_param_annotation' => true, - 'phpdoc_align' => true, - 'phpdoc_annotation_without_dot' => true, - 'phpdoc_indent' => true, - 'phpdoc_no_access' => true, - 'phpdoc_no_empty_return' => true, - 'phpdoc_no_package' => true, - 'phpdoc_order' => true, - 'phpdoc_return_self_reference' => true, - 'phpdoc_scalar' => true, - 'phpdoc_separation' => true, - 'phpdoc_single_line_var_spacing' => true, - 'phpdoc_to_comment' => false, - 'phpdoc_trim' => true, - 'phpdoc_trim_consecutive_blank_line_separation' => true, - 'phpdoc_types' => ['groups' => ['simple', 'meta']], - 'phpdoc_types_order' => true, - 'phpdoc_to_return_type' => true, - 'phpdoc_var_without_name' => true, - 'pow_to_exponentiation' => true, - 'protected_to_private' => true, - 'return_assignment' => true, - 'return_type_declaration' => ['space_before' => 'none'], - 'self_accessor' => false, - 'semicolon_after_instruction' => true, - 'set_type_to_cast' => true, - 'short_scalar_cast' => true, - 'simplified_null_return' => true, - 'single_blank_line_at_eof' => true, - 'single_import_per_statement' => true, - 'single_line_after_imports' => true, - 'single_quote' => true, - 'standardize_not_equals' => true, - 'ternary_to_null_coalescing' => true, - 'trailing_comma_in_multiline_array' => false, - 'trim_array_spaces' => true, - 'unary_operator_spaces' => true, - 'visibility_required' => [ - 'elements' => [ - 'const', - 'method', - 'property', - ], - ], - 'void_return' => true, - 'whitespace_after_comma_in_array' => true, - 'yoda_style' => false - ] - ) - ->setFinder( - PhpCsFixer\Finder::create() - ->files() - ->in(__DIR__ . '/src') - ->in(__DIR__ . '/tests') - ->notName('*.phpt') - ->notName('autoload.php') - ); diff --git a/vendor/theseer/tokenizer/CHANGELOG.md b/vendor/theseer/tokenizer/CHANGELOG.md deleted file mode 100644 index 1eff383..0000000 --- a/vendor/theseer/tokenizer/CHANGELOG.md +++ /dev/null @@ -1,71 +0,0 @@ -# Changelog - -All notable changes to Tokenizer are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. - - -## [1.2.1] - 2021-07-28 - -### Fixed - -* [#13](https://github.com/theseer/tokenizer/issues/13): Fatal error when tokenizing files that contain only a single empty line - - -## [1.2.0] - 2020-07-13 - -This release is now PHP 8.0 compliant. - -### Fixed - -* Whitespace handling in general (only noticable in the intermediate `TokenCollection`) is now consitent - -### Changed - -* Updated `Tokenizer` to deal with changed whitespace handling in PHP 8.0 - The XMLSerializer was unaffected. - - -## [1.1.3] - 2019-06-14 - -### Changed - -* Ensure XMLSerializer can deal with empty token collections - -### Fixed - -* [#2](https://github.com/theseer/tokenizer/issues/2): Fatal error in infection / phpunit - - -## [1.1.2] - 2019-04-04 - -### Changed - -* Reverted PHPUnit 8 test update to stay PHP 7.0 compliant - - -## [1.1.1] - 2019-04-03 - -### Fixed - -* [#1](https://github.com/theseer/tokenizer/issues/1): Empty file causes invalid array read - -### Changed - -* Tests should now be PHPUnit 8 compliant - - -## [1.1.0] - 2017-04-07 - -### Added - -* Allow use of custom namespace for XML serialization - - -## [1.0.0] - 2017-04-05 - -Initial Release - -[1.1.3]: https://github.com/theseer/tokenizer/compare/1.1.2...1.1.3 -[1.1.2]: https://github.com/theseer/tokenizer/compare/1.1.1...1.1.2 -[1.1.1]: https://github.com/theseer/tokenizer/compare/1.1.0...1.1.1 -[1.1.0]: https://github.com/theseer/tokenizer/compare/1.0.0...1.1.0 -[1.0.0]: https://github.com/theseer/tokenizer/compare/b2493e57de80c1b7414219b28503fa5c6b4d0a98...1.0.0 diff --git a/vendor/theseer/tokenizer/LICENSE b/vendor/theseer/tokenizer/LICENSE deleted file mode 100644 index e9694ad..0000000 --- a/vendor/theseer/tokenizer/LICENSE +++ /dev/null @@ -1,30 +0,0 @@ -Tokenizer - -Copyright (c) 2017 Arne Blankerts and contributors -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the name of Arne Blankerts nor the names of contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, -OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/theseer/tokenizer/README.md b/vendor/theseer/tokenizer/README.md deleted file mode 100644 index e91ed89..0000000 --- a/vendor/theseer/tokenizer/README.md +++ /dev/null @@ -1,50 +0,0 @@ -# Tokenizer - -A small library for converting tokenized PHP source code into XML. - -[![Test](https://github.com/theseer/tokenizer/actions/workflows/ci.yml/badge.svg)](https://github.com/theseer/tokenizer/actions/workflows/ci.yml) -[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/theseer/tokenizer/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/theseer/tokenizer/?branch=master) -[![Code Coverage](https://scrutinizer-ci.com/g/theseer/tokenizer/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/theseer/tokenizer/?branch=master) -[![Build Status](https://scrutinizer-ci.com/g/theseer/tokenizer/badges/build.png?b=master)](https://scrutinizer-ci.com/g/theseer/tokenizer/build-status/master) - -## Installation - -You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): - - composer require theseer/tokenizer - -If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: - - composer require --dev theseer/tokenizer - -## Usage examples - -```php -$tokenizer = new TheSeer\Tokenizer\Tokenizer(); -$tokens = $tokenizer->parse(file_get_contents(__DIR__ . '/src/XMLSerializer.php')); - -$serializer = new TheSeer\Tokenizer\XMLSerializer(); -$xml = $serializer->toXML($tokens); - -echo $xml; -``` - -The generated XML structure looks something like this: - -```xml - - - - <?php - declare - ( - strict_types - - = - - 1 - ) - ; - - -``` diff --git a/vendor/theseer/tokenizer/composer.json b/vendor/theseer/tokenizer/composer.json deleted file mode 100644 index 3f452a9..0000000 --- a/vendor/theseer/tokenizer/composer.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "theseer/tokenizer", - "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - } - ], - "support": { - "issues": "https://github.com/theseer/tokenizer/issues" - }, - "require": { - "php": "^7.2 || ^8.0", - "ext-xmlwriter": "*", - "ext-dom": "*", - "ext-tokenizer": "*" - }, - "autoload": { - "classmap": [ - "src/" - ] - } -} - diff --git a/vendor/theseer/tokenizer/composer.lock b/vendor/theseer/tokenizer/composer.lock deleted file mode 100644 index 07fba9b..0000000 --- a/vendor/theseer/tokenizer/composer.lock +++ /dev/null @@ -1,22 +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": "b010f1b3d9d47d431ee1cb54ac1de755", - "packages": [], - "packages-dev": [], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": "^7.2 || ^8.0", - "ext-xmlwriter": "*", - "ext-dom": "*", - "ext-tokenizer": "*" - }, - "platform-dev": [] -} diff --git a/vendor/theseer/tokenizer/src/Exception.php b/vendor/theseer/tokenizer/src/Exception.php deleted file mode 100644 index 71fc117..0000000 --- a/vendor/theseer/tokenizer/src/Exception.php +++ /dev/null @@ -1,5 +0,0 @@ -ensureValidUri($value); - $this->value = $value; - } - - public function asString(): string { - return $this->value; - } - - private function ensureValidUri($value): void { - if (\strpos($value, ':') === false) { - throw new NamespaceUriException( - \sprintf("Namespace URI '%s' must contain at least one colon", $value) - ); - } - } -} diff --git a/vendor/theseer/tokenizer/src/NamespaceUriException.php b/vendor/theseer/tokenizer/src/NamespaceUriException.php deleted file mode 100644 index ab1c48d..0000000 --- a/vendor/theseer/tokenizer/src/NamespaceUriException.php +++ /dev/null @@ -1,5 +0,0 @@ -line = $line; - $this->name = $name; - $this->value = $value; - } - - public function getLine(): int { - return $this->line; - } - - public function getName(): string { - return $this->name; - } - - public function getValue(): string { - return $this->value; - } -} diff --git a/vendor/theseer/tokenizer/src/TokenCollection.php b/vendor/theseer/tokenizer/src/TokenCollection.php deleted file mode 100644 index e5e6e40..0000000 --- a/vendor/theseer/tokenizer/src/TokenCollection.php +++ /dev/null @@ -1,93 +0,0 @@ -tokens[] = $token; - } - - public function current(): Token { - return \current($this->tokens); - } - - public function key(): int { - return \key($this->tokens); - } - - public function next(): void { - \next($this->tokens); - $this->pos++; - } - - public function valid(): bool { - return $this->count() > $this->pos; - } - - public function rewind(): void { - \reset($this->tokens); - $this->pos = 0; - } - - public function count(): int { - return \count($this->tokens); - } - - public function offsetExists($offset): bool { - return isset($this->tokens[$offset]); - } - - /** - * @throws TokenCollectionException - */ - public function offsetGet($offset): Token { - if (!$this->offsetExists($offset)) { - throw new TokenCollectionException( - \sprintf('No Token at offest %s', $offset) - ); - } - - return $this->tokens[$offset]; - } - - /** - * @param Token $value - * - * @throws TokenCollectionException - */ - public function offsetSet($offset, $value): void { - if (!\is_int($offset)) { - $type = \gettype($offset); - - throw new TokenCollectionException( - \sprintf( - 'Offset must be of type integer, %s given', - $type === 'object' ? \get_class($value) : $type - ) - ); - } - - if (!$value instanceof Token) { - $type = \gettype($value); - - throw new TokenCollectionException( - \sprintf( - 'Value must be of type %s, %s given', - Token::class, - $type === 'object' ? \get_class($value) : $type - ) - ); - } - $this->tokens[$offset] = $value; - } - - public function offsetUnset($offset): void { - unset($this->tokens[$offset]); - } -} diff --git a/vendor/theseer/tokenizer/src/TokenCollectionException.php b/vendor/theseer/tokenizer/src/TokenCollectionException.php deleted file mode 100644 index 4291ce0..0000000 --- a/vendor/theseer/tokenizer/src/TokenCollectionException.php +++ /dev/null @@ -1,5 +0,0 @@ - 'T_OPEN_BRACKET', - ')' => 'T_CLOSE_BRACKET', - '[' => 'T_OPEN_SQUARE', - ']' => 'T_CLOSE_SQUARE', - '{' => 'T_OPEN_CURLY', - '}' => 'T_CLOSE_CURLY', - ';' => 'T_SEMICOLON', - '.' => 'T_DOT', - ',' => 'T_COMMA', - '=' => 'T_EQUAL', - '<' => 'T_LT', - '>' => 'T_GT', - '+' => 'T_PLUS', - '-' => 'T_MINUS', - '*' => 'T_MULT', - '/' => 'T_DIV', - '?' => 'T_QUESTION_MARK', - '!' => 'T_EXCLAMATION_MARK', - ':' => 'T_COLON', - '"' => 'T_DOUBLE_QUOTES', - '@' => 'T_AT', - '&' => 'T_AMPERSAND', - '%' => 'T_PERCENT', - '|' => 'T_PIPE', - '$' => 'T_DOLLAR', - '^' => 'T_CARET', - '~' => 'T_TILDE', - '`' => 'T_BACKTICK' - ]; - - public function parse(string $source): TokenCollection { - $result = new TokenCollection(); - - if ($source === '') { - return $result; - } - - $tokens = \token_get_all($source); - - $lastToken = new Token( - $tokens[0][2], - 'Placeholder', - '' - ); - - foreach ($tokens as $pos => $tok) { - if (\is_string($tok)) { - $token = new Token( - $lastToken->getLine(), - $this->map[$tok], - $tok - ); - $result->addToken($token); - $lastToken = $token; - - continue; - } - - $line = $tok[2]; - $values = \preg_split('/\R+/Uu', $tok[1]); - - foreach ($values as $v) { - $token = new Token( - $line, - \token_name($tok[0]), - $v - ); - $lastToken = $token; - $line++; - - if ($v === '') { - continue; - } - - $result->addToken($token); - } - } - - return $this->fillBlanks($result, $lastToken->getLine()); - } - - private function fillBlanks(TokenCollection $tokens, int $maxLine): TokenCollection { - $prev = new Token( - 0, - 'Placeholder', - '' - ); - - $final = new TokenCollection(); - - foreach ($tokens as $token) { - if ($prev === null) { - $final->addToken($token); - $prev = $token; - - continue; - } - - $gap = $token->getLine() - $prev->getLine(); - - while ($gap > 1) { - $linebreak = new Token( - $prev->getLine() + 1, - 'T_WHITESPACE', - '' - ); - $final->addToken($linebreak); - $prev = $linebreak; - $gap--; - } - - $final->addToken($token); - $prev = $token; - } - - $gap = $maxLine - $prev->getLine(); - - while ($gap > 0) { - $linebreak = new Token( - $prev->getLine() + 1, - 'T_WHITESPACE', - '' - ); - $final->addToken($linebreak); - $prev = $linebreak; - $gap--; - } - - return $final; - } -} diff --git a/vendor/theseer/tokenizer/src/XMLSerializer.php b/vendor/theseer/tokenizer/src/XMLSerializer.php deleted file mode 100644 index e67a7fe..0000000 --- a/vendor/theseer/tokenizer/src/XMLSerializer.php +++ /dev/null @@ -1,79 +0,0 @@ -xmlns = $xmlns; - } - - public function toDom(TokenCollection $tokens): DOMDocument { - $dom = new DOMDocument(); - $dom->preserveWhiteSpace = false; - $dom->loadXML($this->toXML($tokens)); - - return $dom; - } - - public function toXML(TokenCollection $tokens): string { - $this->writer = new \XMLWriter(); - $this->writer->openMemory(); - $this->writer->setIndent(true); - $this->writer->startDocument(); - $this->writer->startElement('source'); - $this->writer->writeAttribute('xmlns', $this->xmlns->asString()); - - if (\count($tokens) > 0) { - $this->writer->startElement('line'); - $this->writer->writeAttribute('no', '1'); - - $this->previousToken = $tokens[0]; - - foreach ($tokens as $token) { - $this->addToken($token); - } - } - - $this->writer->endElement(); - $this->writer->endElement(); - $this->writer->endDocument(); - - return $this->writer->outputMemory(); - } - - private function addToken(Token $token): void { - if ($this->previousToken->getLine() < $token->getLine()) { - $this->writer->endElement(); - - $this->writer->startElement('line'); - $this->writer->writeAttribute('no', (string)$token->getLine()); - $this->previousToken = $token; - } - - if ($token->getValue() !== '') { - $this->writer->startElement('token'); - $this->writer->writeAttribute('name', $token->getName()); - $this->writer->writeRaw(\htmlspecialchars($token->getValue(), \ENT_NOQUOTES | \ENT_DISALLOWED | \ENT_XML1)); - $this->writer->endElement(); - } - } -} diff --git a/vendor/webmozart/assert/.editorconfig b/vendor/webmozart/assert/.editorconfig deleted file mode 100644 index 384453b..0000000 --- a/vendor/webmozart/assert/.editorconfig +++ /dev/null @@ -1,12 +0,0 @@ -root = true - -[*] -charset=utf-8 -end_of_line=lf -trim_trailing_whitespace=true -insert_final_newline=true -indent_style=space -indent_size=4 - -[*.yml] -indent_size=2 diff --git a/vendor/webmozart/assert/CHANGELOG.md b/vendor/webmozart/assert/CHANGELOG.md deleted file mode 100644 index 6326a2d..0000000 --- a/vendor/webmozart/assert/CHANGELOG.md +++ /dev/null @@ -1,155 +0,0 @@ -Changelog -========= - -## UNRELEASED - - -## 1.8.0 - -### Added - -* added `Assert::notStartsWith()` -* added `Assert::notEndsWith()` -* added `Assert::inArray()` -* added `@psalm-pure` annotations to pure assertions - -### Fixed - -* Exception messages of comparisons between `DateTime(Immutalbe)` objects now display their date & time. -* Custom Exception messages for `Assert::count()` now use the values to render the exception message. - -## 1.7.0 (2020-02-14) - -### Added - -* added `Assert::notFalse()` -* added `Assert::isAOf()` -* added `Assert::isAnyOf()` -* added `Assert::isNotA()` - -## 1.6.0 (2019-11-24) - -### Added - -* added `Assert::validArrayKey()` -* added `Assert::isNonEmptyList()` -* added `Assert::isNonEmptyMap()` -* added `@throws InvalidArgumentException` annotations to all methods that throw. -* added `@psalm-assert` for the list type to the `isList` assertion. - -### Fixed - -* `ResourceBundle` & `SimpleXMLElement` now pass the `isCountable` assertions. -They are countable, without implementing the `Countable` interface. -* The doc block of `range` now has the proper variables. -* An empty array will now pass `isList` and `isMap`. As it is a valid form of both. -If a non empty variant is needed, use `isNonEmptyList` or `isNonEmptyMap`. - -### Changed - -* Removed some `@psalm-assert` annotations, that were 'side effect' assertions See: - * [#144](https://github.com/webmozart/assert/pull/144) - * [#145](https://github.com/webmozart/assert/issues/145) - * [#146](https://github.com/webmozart/assert/pull/146) - * [#150](https://github.com/webmozart/assert/pull/150) -* If you use psalm, the minimum version needed is `3.6.0`. Which is enforced through a composer conflict. -If you don't use psalm, then this has no impact. - -## 1.5.0 (2019-08-24) - -### Added - -* added `Assert::uniqueValues()` -* added `Assert::unicodeLetters()` -* added: `Assert::email()` -* added support for [Psalm](https://github.com/vimeo/psalm), by adding `@psalm-assert` annotations where appropriate. - -### Fixed - -* `Assert::endsWith()` would not give the correct result when dealing with multibyte suffix. -* `Assert::length(), minLength, maxLength, lengthBetween` would not give the correct result when dealing with multibyte characters. - -**NOTE**: These 2 changes may break your assertions if you relied on the fact that multibyte characters didn't behave correctly. - -### Changed - -* The names of some variables have been updated to better reflect what they are. -* All function calls are now in their FQN form, slightly increasing performance. -* Tests are now properly ran against HHVM-3.30 and PHP nightly. - -### Deprecation - -* deprecated `Assert::isTraversable()` in favor of `Assert::isIterable()` - * This was already done in 1.3.0, but it was only done through a silenced `trigger_error`. It is now annotated as well. - -## 1.4.0 (2018-12-25) - -### Added - -* added `Assert::ip()` -* added `Assert::ipv4()` -* added `Assert::ipv6()` -* added `Assert::notRegex()` -* added `Assert::interfaceExists()` -* added `Assert::isList()` -* added `Assert::isMap()` -* added polyfill for ctype - -### Fixed - -* Special case when comparing objects implementing `__toString()` - -## 1.3.0 (2018-01-29) - -### Added - -* added `Assert::minCount()` -* added `Assert::maxCount()` -* added `Assert::countBetween()` -* added `Assert::isCountable()` -* added `Assert::notWhitespaceOnly()` -* added `Assert::natural()` -* added `Assert::notContains()` -* added `Assert::isArrayAccessible()` -* added `Assert::isInstanceOfAny()` -* added `Assert::isIterable()` - -### Fixed - -* `stringNotEmpty` will no longer report "0" is an empty string - -### Deprecation - -* deprecated `Assert::isTraversable()` in favor of `Assert::isIterable()` - -## 1.2.0 (2016-11-23) - - * added `Assert::throws()` - * added `Assert::count()` - * added extension point `Assert::reportInvalidArgument()` for custom subclasses - -## 1.1.0 (2016-08-09) - - * added `Assert::object()` - * added `Assert::propertyExists()` - * added `Assert::propertyNotExists()` - * added `Assert::methodExists()` - * added `Assert::methodNotExists()` - * added `Assert::uuid()` - -## 1.0.2 (2015-08-24) - - * integrated Style CI - * add tests for minimum package dependencies on Travis CI - -## 1.0.1 (2015-05-12) - - * added support for PHP 5.3.3 - -## 1.0.0 (2015-05-12) - - * first stable release - -## 1.0.0-beta (2015-03-19) - - * first beta release diff --git a/vendor/webmozart/assert/LICENSE b/vendor/webmozart/assert/LICENSE deleted file mode 100644 index 9e2e307..0000000 --- a/vendor/webmozart/assert/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Bernhard Schussek - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/webmozart/assert/README.md b/vendor/webmozart/assert/README.md deleted file mode 100644 index e316d53..0000000 --- a/vendor/webmozart/assert/README.md +++ /dev/null @@ -1,283 +0,0 @@ -Webmozart Assert -================ - -[![Build Status](https://travis-ci.org/webmozart/assert.svg?branch=master)](https://travis-ci.org/webmozart/assert) -[![Build status](https://ci.appveyor.com/api/projects/status/lyg83bcsisrr94se/branch/master?svg=true)](https://ci.appveyor.com/project/webmozart/assert/branch/master) -[![Code Coverage](https://scrutinizer-ci.com/g/webmozart/assert/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/webmozart/assert/?branch=master) -[![Latest Stable Version](https://poser.pugx.org/webmozart/assert/v/stable.svg)](https://packagist.org/packages/webmozart/assert) -[![Total Downloads](https://poser.pugx.org/webmozart/assert/downloads.svg)](https://packagist.org/packages/webmozart/assert) - -This library contains efficient assertions to test the input and output of -your methods. With these assertions, you can greatly reduce the amount of coding -needed to write a safe implementation. - -All assertions in the [`Assert`] class throw an `\InvalidArgumentException` if -they fail. - -FAQ ---- - -**What's the difference to [beberlei/assert]?** - -This library is heavily inspired by Benjamin Eberlei's wonderful [assert package], -but fixes a usability issue with error messages that can't be fixed there without -breaking backwards compatibility. - -This package features usable error messages by default. However, you can also -easily write custom error messages: - -``` -Assert::string($path, 'The path is expected to be a string. Got: %s'); -``` - -In [beberlei/assert], the ordering of the `%s` placeholders is different for -every assertion. This package, on the contrary, provides consistent placeholder -ordering for all assertions: - -* `%s`: The tested value as string, e.g. `"/foo/bar"`. -* `%2$s`, `%3$s`, ...: Additional assertion-specific values, e.g. the - minimum/maximum length, allowed values, etc. - -Check the source code of the assertions to find out details about the additional -available placeholders. - -Installation ------------- - -Use [Composer] to install the package: - -``` -$ composer require webmozart/assert -``` - -Example -------- - -```php -use Webmozart\Assert\Assert; - -class Employee -{ - public function __construct($id) - { - Assert::integer($id, 'The employee ID must be an integer. Got: %s'); - Assert::greaterThan($id, 0, 'The employee ID must be a positive integer. Got: %s'); - } -} -``` - -If you create an employee with an invalid ID, an exception is thrown: - -```php -new Employee('foobar'); -// => InvalidArgumentException: -// The employee ID must be an integer. Got: string - -new Employee(-10); -// => InvalidArgumentException: -// The employee ID must be a positive integer. Got: -10 -``` - -Assertions ----------- - -The [`Assert`] class provides the following assertions: - -### Type Assertions - -Method | Description --------------------------------------------------------- | -------------------------------------------------- -`string($value, $message = '')` | Check that a value is a string -`stringNotEmpty($value, $message = '')` | Check that a value is a non-empty string -`integer($value, $message = '')` | Check that a value is an integer -`integerish($value, $message = '')` | Check that a value casts to an integer -`float($value, $message = '')` | Check that a value is a float -`numeric($value, $message = '')` | Check that a value is numeric -`natural($value, $message= ''')` | Check that a value is a non-negative integer -`boolean($value, $message = '')` | Check that a value is a boolean -`scalar($value, $message = '')` | Check that a value is a scalar -`object($value, $message = '')` | Check that a value is an object -`resource($value, $type = null, $message = '')` | Check that a value is a resource -`isCallable($value, $message = '')` | Check that a value is a callable -`isArray($value, $message = '')` | Check that a value is an array -`isTraversable($value, $message = '')` (deprecated) | Check that a value is an array or a `\Traversable` -`isIterable($value, $message = '')` | Check that a value is an array or a `\Traversable` -`isCountable($value, $message = '')` | Check that a value is an array or a `\Countable` -`isInstanceOf($value, $class, $message = '')` | Check that a value is an `instanceof` a class -`isInstanceOfAny($value, array $classes, $message = '')` | Check that a value is an `instanceof` a at least one class on the array of classes -`notInstanceOf($value, $class, $message = '')` | Check that a value is not an `instanceof` a class -`isAOf($value, $class, $message = '')` | Check that a value is of the class or has one of its parents -`isAnyOf($value, array $classes, $message = '')` | Check that a value a at least one of the class or has one of its parents -`isNotA($value, $class, $message = '')` | Check that a value is not of the class or has not one of its parents -`isArrayAccessible($value, $message = '')` | Check that a value can be accessed as an array -`uniqueValues($values, $message = '')` | Check that the given array contains unique values - -### Comparison Assertions - -Method | Description ------------------------------------------------ | ------------------------------------------------------------------ -`true($value, $message = '')` | Check that a value is `true` -`false($value, $message = '')` | Check that a value is `false` -`notFalse($value, $message = '')` | Check that a value is not `false` -`null($value, $message = '')` | Check that a value is `null` -`notNull($value, $message = '')` | Check that a value is not `null` -`isEmpty($value, $message = '')` | Check that a value is `empty()` -`notEmpty($value, $message = '')` | Check that a value is not `empty()` -`eq($value, $value2, $message = '')` | Check that a value equals another (`==`) -`notEq($value, $value2, $message = '')` | Check that a value does not equal another (`!=`) -`same($value, $value2, $message = '')` | Check that a value is identical to another (`===`) -`notSame($value, $value2, $message = '')` | Check that a value is not identical to another (`!==`) -`greaterThan($value, $value2, $message = '')` | Check that a value is greater than another -`greaterThanEq($value, $value2, $message = '')` | Check that a value is greater than or equal to another -`lessThan($value, $value2, $message = '')` | Check that a value is less than another -`lessThanEq($value, $value2, $message = '')` | Check that a value is less than or equal to another -`range($value, $min, $max, $message = '')` | Check that a value is within a range -`inArray($value, array $values, $message = '')` | Check that a value is one of a list of values -`oneOf($value, array $values, $message = '')` | Check that a value is one of a list of values (alias of `inArray`) - -### String Assertions - -You should check that a value is a string with `Assert::string()` before making -any of the following assertions. - -Method | Description ---------------------------------------------------- | ----------------------------------------------------------------- -`contains($value, $subString, $message = '')` | Check that a string contains a substring -`notContains($value, $subString, $message = '')` | Check that a string does not contains a substring -`startsWith($value, $prefix, $message = '')` | Check that a string has a prefix -`notStartsWith($value, $prefix, $message = '')` | Check that a string does not have a prefix -`startsWithLetter($value, $message = '')` | Check that a string starts with a letter -`endsWith($value, $suffix, $message = '')` | Check that a string has a suffix -`notEndsWith($value, $suffix, $message = '')` | Check that a string does not have a suffix -`regex($value, $pattern, $message = '')` | Check that a string matches a regular expression -`notRegex($value, $pattern, $message = '')` | Check that a string does not match a regular expression -`unicodeLetters($value, $message = '')` | Check that a string contains Unicode letters only -`alpha($value, $message = '')` | Check that a string contains letters only -`digits($value, $message = '')` | Check that a string contains digits only -`alnum($value, $message = '')` | Check that a string contains letters and digits only -`lower($value, $message = '')` | Check that a string contains lowercase characters only -`upper($value, $message = '')` | Check that a string contains uppercase characters only -`length($value, $length, $message = '')` | Check that a string has a certain number of characters -`minLength($value, $min, $message = '')` | Check that a string has at least a certain number of characters -`maxLength($value, $max, $message = '')` | Check that a string has at most a certain number of characters -`lengthBetween($value, $min, $max, $message = '')` | Check that a string has a length in the given range -`uuid($value, $message = '')` | Check that a string is a valid UUID -`ip($value, $message = '')` | Check that a string is a valid IP (either IPv4 or IPv6) -`ipv4($value, $message = '')` | Check that a string is a valid IPv4 -`ipv6($value, $message = '')` | Check that a string is a valid IPv6 -`email($value, $message = '')` | Check that a string is a valid e-mail address -`notWhitespaceOnly($value, $message = '')` | Check that a string contains at least one non-whitespace character - -### File Assertions - -Method | Description ------------------------------------ | -------------------------------------------------- -`fileExists($value, $message = '')` | Check that a value is an existing path -`file($value, $message = '')` | Check that a value is an existing file -`directory($value, $message = '')` | Check that a value is an existing directory -`readable($value, $message = '')` | Check that a value is a readable path -`writable($value, $message = '')` | Check that a value is a writable path - -### Object Assertions - -Method | Description ------------------------------------------------------ | -------------------------------------------------- -`classExists($value, $message = '')` | Check that a value is an existing class name -`subclassOf($value, $class, $message = '')` | Check that a class is a subclass of another -`interfaceExists($value, $message = '')` | Check that a value is an existing interface name -`implementsInterface($value, $class, $message = '')` | Check that a class implements an interface -`propertyExists($value, $property, $message = '')` | Check that a property exists in a class/object -`propertyNotExists($value, $property, $message = '')` | Check that a property does not exist in a class/object -`methodExists($value, $method, $message = '')` | Check that a method exists in a class/object -`methodNotExists($value, $method, $message = '')` | Check that a method does not exist in a class/object - -### Array Assertions - -Method | Description --------------------------------------------------- | ------------------------------------------------------------------ -`keyExists($array, $key, $message = '')` | Check that a key exists in an array -`keyNotExists($array, $key, $message = '')` | Check that a key does not exist in an array -`validArrayKey($key, $message = '')` | Check that a value is a valid array key (int or string) -`count($array, $number, $message = '')` | Check that an array contains a specific number of elements -`minCount($array, $min, $message = '')` | Check that an array contains at least a certain number of elements -`maxCount($array, $max, $message = '')` | Check that an array contains at most a certain number of elements -`countBetween($array, $min, $max, $message = '')` | Check that an array has a count in the given range -`isList($array, $message = '')` | Check that an array is a non-associative list -`isNonEmptyList($array, $message = '')` | Check that an array is a non-associative list, and not empty -`isMap($array, $message = '')` | Check that an array is associative and has strings as keys -`isNonEmptyMap($array, $message = '')` | Check that an array is associative and has strings as keys, and is not empty - -### Function Assertions - -Method | Description -------------------------------------------- | ----------------------------------------------------------------------------------------------------- -`throws($closure, $class, $message = '')` | Check that a function throws a certain exception. Subclasses of the exception class will be accepted. - -### Collection Assertions - -All of the above assertions can be prefixed with `all*()` to test the contents -of an array or a `\Traversable`: - -```php -Assert::allIsInstanceOf($employees, 'Acme\Employee'); -``` - -### Nullable Assertions - -All of the above assertions can be prefixed with `nullOr*()` to run the -assertion only if it the value is not `null`: - -```php -Assert::nullOrString($middleName, 'The middle name must be a string or null. Got: %s'); -``` - -### Extending Assert - -The `Assert` class comes with a few methods, which can be overridden to change the class behaviour. You can also extend it to -add your own assertions. - -#### Overriding methods - -Overriding the following methods in your assertion class allows you to change the behaviour of the assertions: - -* `public static function __callStatic($name, $arguments)` - * This method is used to 'create' the `nullOr` and `all` versions of the assertions. -* `protected static function valueToString($value)` - * This method is used for error messages, to convert the value to a string value for displaying. You could use this for representing a value object with a `__toString` method for example. -* `protected static function typeToString($value)` - * This method is used for error messages, to convert the a value to a string representing its type. -* `protected static function strlen($value)` - * This method is used to calculate string length for relevant methods, using the `mb_strlen` if available and useful. -* `protected static function reportInvalidArgument($message)` - * This method is called when an assertion fails, with the specified error message. Here you can throw your own exception, or log something. - - -Authors -------- - -* [Bernhard Schussek] a.k.a. [@webmozart] -* [The Community Contributors] - -Contribute ----------- - -Contributions to the package are always welcome! - -* Report any bugs or issues you find on the [issue tracker]. -* You can grab the source code at the package's [Git repository]. - -License -------- - -All contents of this package are licensed under the [MIT license]. - -[beberlei/assert]: https://github.com/beberlei/assert -[assert package]: https://github.com/beberlei/assert -[Composer]: https://getcomposer.org -[Bernhard Schussek]: https://webmozarts.com -[The Community Contributors]: https://github.com/webmozart/assert/graphs/contributors -[issue tracker]: https://github.com/webmozart/assert/issues -[Git repository]: https://github.com/webmozart/assert -[@webmozart]: https://twitter.com/webmozart -[MIT license]: LICENSE -[`Assert`]: src/Assert.php diff --git a/vendor/webmozart/assert/composer.json b/vendor/webmozart/assert/composer.json deleted file mode 100644 index 033a022..0000000 --- a/vendor/webmozart/assert/composer.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "webmozart/assert", - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "license": "MIT", - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "require": { - "php": "^5.3.3 || ^7.0", - "symfony/polyfill-ctype": "^1.8" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.36 || ^7.5.13" - }, - "conflict": { - "vimeo/psalm": "<3.9.1" - }, - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "Webmozart\\Assert\\Tests\\": "tests/" - } - } -} diff --git a/vendor/webmozart/assert/psalm.xml b/vendor/webmozart/assert/psalm.xml deleted file mode 100644 index ac9d4db..0000000 --- a/vendor/webmozart/assert/psalm.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - diff --git a/vendor/webmozart/assert/src/Assert.php b/vendor/webmozart/assert/src/Assert.php deleted file mode 100644 index 05970a7..0000000 --- a/vendor/webmozart/assert/src/Assert.php +++ /dev/null @@ -1,2226 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Webmozart\Assert; - -use ArrayAccess; -use BadMethodCallException; -use Closure; -use Countable; -use DateTime; -use DateTimeImmutable; -use Exception; -use InvalidArgumentException; -use ResourceBundle; -use SimpleXMLElement; -use Throwable; -use Traversable; - -/** - * Efficient assertions to validate the input/output of your methods. - * - * @method static void nullOrString($value, $message = '') - * @method static void nullOrStringNotEmpty($value, $message = '') - * @method static void nullOrInteger($value, $message = '') - * @method static void nullOrIntegerish($value, $message = '') - * @method static void nullOrFloat($value, $message = '') - * @method static void nullOrNumeric($value, $message = '') - * @method static void nullOrNatural($value, $message = '') - * @method static void nullOrBoolean($value, $message = '') - * @method static void nullOrScalar($value, $message = '') - * @method static void nullOrObject($value, $message = '') - * @method static void nullOrResource($value, $type = null, $message = '') - * @method static void nullOrIsCallable($value, $message = '') - * @method static void nullOrIsArray($value, $message = '') - * @method static void nullOrIsTraversable($value, $message = '') - * @method static void nullOrIsArrayAccessible($value, $message = '') - * @method static void nullOrIsCountable($value, $message = '') - * @method static void nullOrIsIterable($value, $message = '') - * @method static void nullOrIsInstanceOf($value, $class, $message = '') - * @method static void nullOrNotInstanceOf($value, $class, $message = '') - * @method static void nullOrIsInstanceOfAny($value, $classes, $message = '') - * @method static void nullOrIsAOf($value, $classes, $message = '') - * @method static void nullOrIsAnyOf($value, $classes, $message = '') - * @method static void nullOrIsNotA($value, $classes, $message = '') - * @method static void nullOrIsEmpty($value, $message = '') - * @method static void nullOrNotEmpty($value, $message = '') - * @method static void nullOrTrue($value, $message = '') - * @method static void nullOrFalse($value, $message = '') - * @method static void nullOrNotFalse($value, $message = '') - * @method static void nullOrIp($value, $message = '') - * @method static void nullOrIpv4($value, $message = '') - * @method static void nullOrIpv6($value, $message = '') - * @method static void nullOrEmail($value, $message = '') - * @method static void nullOrUniqueValues($values, $message = '') - * @method static void nullOrEq($value, $expect, $message = '') - * @method static void nullOrNotEq($value, $expect, $message = '') - * @method static void nullOrSame($value, $expect, $message = '') - * @method static void nullOrNotSame($value, $expect, $message = '') - * @method static void nullOrGreaterThan($value, $limit, $message = '') - * @method static void nullOrGreaterThanEq($value, $limit, $message = '') - * @method static void nullOrLessThan($value, $limit, $message = '') - * @method static void nullOrLessThanEq($value, $limit, $message = '') - * @method static void nullOrRange($value, $min, $max, $message = '') - * @method static void nullOrOneOf($value, $values, $message = '') - * @method static void nullOrInArray($value, $values, $message = '') - * @method static void nullOrContains($value, $subString, $message = '') - * @method static void nullOrNotContains($value, $subString, $message = '') - * @method static void nullOrNotWhitespaceOnly($value, $message = '') - * @method static void nullOrStartsWith($value, $prefix, $message = '') - * @method static void nullOrNotStartsWith($value, $prefix, $message = '') - * @method static void nullOrStartsWithLetter($value, $message = '') - * @method static void nullOrEndsWith($value, $suffix, $message = '') - * @method static void nullOrNotEndsWith($value, $suffix, $message = '') - * @method static void nullOrRegex($value, $pattern, $message = '') - * @method static void nullOrNotRegex($value, $pattern, $message = '') - * @method static void nullOrUnicodeLetters($value, $message = '') - * @method static void nullOrAlpha($value, $message = '') - * @method static void nullOrDigits($value, $message = '') - * @method static void nullOrAlnum($value, $message = '') - * @method static void nullOrLower($value, $message = '') - * @method static void nullOrUpper($value, $message = '') - * @method static void nullOrLength($value, $length, $message = '') - * @method static void nullOrMinLength($value, $min, $message = '') - * @method static void nullOrMaxLength($value, $max, $message = '') - * @method static void nullOrLengthBetween($value, $min, $max, $message = '') - * @method static void nullOrFileExists($value, $message = '') - * @method static void nullOrFile($value, $message = '') - * @method static void nullOrDirectory($value, $message = '') - * @method static void nullOrReadable($value, $message = '') - * @method static void nullOrWritable($value, $message = '') - * @method static void nullOrClassExists($value, $message = '') - * @method static void nullOrSubclassOf($value, $class, $message = '') - * @method static void nullOrInterfaceExists($value, $message = '') - * @method static void nullOrImplementsInterface($value, $interface, $message = '') - * @method static void nullOrPropertyExists($value, $property, $message = '') - * @method static void nullOrPropertyNotExists($value, $property, $message = '') - * @method static void nullOrMethodExists($value, $method, $message = '') - * @method static void nullOrMethodNotExists($value, $method, $message = '') - * @method static void nullOrKeyExists($value, $key, $message = '') - * @method static void nullOrKeyNotExists($value, $key, $message = '') - * @method static void nullOrValidArrayKey($value, $message = '') - * @method static void nullOrCount($value, $key, $message = '') - * @method static void nullOrMinCount($value, $min, $message = '') - * @method static void nullOrMaxCount($value, $max, $message = '') - * @method static void nullOrIsList($value, $message = '') - * @method static void nullOrIsNonEmptyList($value, $message = '') - * @method static void nullOrIsMap($value, $message = '') - * @method static void nullOrIsNonEmptyMap($value, $message = '') - * @method static void nullOrCountBetween($value, $min, $max, $message = '') - * @method static void nullOrUuid($values, $message = '') - * @method static void nullOrThrows($expression, $class = 'Exception', $message = '') - * @method static void allString($values, $message = '') - * @method static void allStringNotEmpty($values, $message = '') - * @method static void allInteger($values, $message = '') - * @method static void allIntegerish($values, $message = '') - * @method static void allFloat($values, $message = '') - * @method static void allNumeric($values, $message = '') - * @method static void allNatural($values, $message = '') - * @method static void allBoolean($values, $message = '') - * @method static void allScalar($values, $message = '') - * @method static void allObject($values, $message = '') - * @method static void allResource($values, $type = null, $message = '') - * @method static void allIsCallable($values, $message = '') - * @method static void allIsArray($values, $message = '') - * @method static void allIsTraversable($values, $message = '') - * @method static void allIsArrayAccessible($values, $message = '') - * @method static void allIsCountable($values, $message = '') - * @method static void allIsIterable($values, $message = '') - * @method static void allIsInstanceOf($values, $class, $message = '') - * @method static void allNotInstanceOf($values, $class, $message = '') - * @method static void allIsInstanceOfAny($values, $classes, $message = '') - * @method static void allIsAOf($values, $class, $message = '') - * @method static void allIsAnyOf($values, $class, $message = '') - * @method static void allIsNotA($values, $class, $message = '') - * @method static void allNull($values, $message = '') - * @method static void allNotNull($values, $message = '') - * @method static void allIsEmpty($values, $message = '') - * @method static void allNotEmpty($values, $message = '') - * @method static void allTrue($values, $message = '') - * @method static void allFalse($values, $message = '') - * @method static void allNotFalse($values, $message = '') - * @method static void allIp($values, $message = '') - * @method static void allIpv4($values, $message = '') - * @method static void allIpv6($values, $message = '') - * @method static void allEmail($values, $message = '') - * @method static void allUniqueValues($values, $message = '') - * @method static void allEq($values, $expect, $message = '') - * @method static void allNotEq($values, $expect, $message = '') - * @method static void allSame($values, $expect, $message = '') - * @method static void allNotSame($values, $expect, $message = '') - * @method static void allGreaterThan($values, $limit, $message = '') - * @method static void allGreaterThanEq($values, $limit, $message = '') - * @method static void allLessThan($values, $limit, $message = '') - * @method static void allLessThanEq($values, $limit, $message = '') - * @method static void allRange($values, $min, $max, $message = '') - * @method static void allOneOf($values, $values, $message = '') - * @method static void allInArray($values, $values, $message = '') - * @method static void allContains($values, $subString, $message = '') - * @method static void allNotContains($values, $subString, $message = '') - * @method static void allNotWhitespaceOnly($values, $message = '') - * @method static void allStartsWith($values, $prefix, $message = '') - * @method static void allNotStartsWith($values, $prefix, $message = '') - * @method static void allStartsWithLetter($values, $message = '') - * @method static void allEndsWith($values, $suffix, $message = '') - * @method static void allNotEndsWith($values, $suffix, $message = '') - * @method static void allRegex($values, $pattern, $message = '') - * @method static void allNotRegex($values, $pattern, $message = '') - * @method static void allUnicodeLetters($values, $message = '') - * @method static void allAlpha($values, $message = '') - * @method static void allDigits($values, $message = '') - * @method static void allAlnum($values, $message = '') - * @method static void allLower($values, $message = '') - * @method static void allUpper($values, $message = '') - * @method static void allLength($values, $length, $message = '') - * @method static void allMinLength($values, $min, $message = '') - * @method static void allMaxLength($values, $max, $message = '') - * @method static void allLengthBetween($values, $min, $max, $message = '') - * @method static void allFileExists($values, $message = '') - * @method static void allFile($values, $message = '') - * @method static void allDirectory($values, $message = '') - * @method static void allReadable($values, $message = '') - * @method static void allWritable($values, $message = '') - * @method static void allClassExists($values, $message = '') - * @method static void allSubclassOf($values, $class, $message = '') - * @method static void allInterfaceExists($values, $message = '') - * @method static void allImplementsInterface($values, $interface, $message = '') - * @method static void allPropertyExists($values, $property, $message = '') - * @method static void allPropertyNotExists($values, $property, $message = '') - * @method static void allMethodExists($values, $method, $message = '') - * @method static void allMethodNotExists($values, $method, $message = '') - * @method static void allKeyExists($values, $key, $message = '') - * @method static void allKeyNotExists($values, $key, $message = '') - * @method static void allValidArrayKey($values, $message = '') - * @method static void allCount($values, $key, $message = '') - * @method static void allMinCount($values, $min, $message = '') - * @method static void allMaxCount($values, $max, $message = '') - * @method static void allCountBetween($values, $min, $max, $message = '') - * @method static void allIsList($values, $message = '') - * @method static void allIsNonEmptyList($values, $message = '') - * @method static void allIsMap($values, $message = '') - * @method static void allIsNonEmptyMap($values, $message = '') - * @method static void allUuid($values, $message = '') - * @method static void allThrows($expressions, $class = 'Exception', $message = '') - * - * @since 1.0 - * - * @author Bernhard Schussek - */ -class Assert -{ - /** - * @psalm-pure - * @psalm-assert string $value - * - * @param mixed $value - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function string($value, $message = '') - { - if (!\is_string($value)) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected a string. Got: %s', - static::typeToString($value) - )); - } - } - - /** - * @psalm-pure - * @psalm-assert string $value - * @psalm-assert !empty $value - * - * @param mixed $value - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function stringNotEmpty($value, $message = '') - { - static::string($value, $message); - static::notEq($value, '', $message); - } - - /** - * @psalm-pure - * @psalm-assert int $value - * - * @param mixed $value - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function integer($value, $message = '') - { - if (!\is_int($value)) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected an integer. Got: %s', - static::typeToString($value) - )); - } - } - - /** - * @psalm-pure - * @psalm-assert numeric $value - * - * @param mixed $value - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function integerish($value, $message = '') - { - if (!\is_numeric($value) || $value != (int) $value) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected an integerish value. Got: %s', - static::typeToString($value) - )); - } - } - - /** - * @psalm-pure - * @psalm-assert float $value - * - * @param mixed $value - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function float($value, $message = '') - { - if (!\is_float($value)) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected a float. Got: %s', - static::typeToString($value) - )); - } - } - - /** - * @psalm-pure - * @psalm-assert numeric $value - * - * @param mixed $value - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function numeric($value, $message = '') - { - if (!\is_numeric($value)) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected a numeric. Got: %s', - static::typeToString($value) - )); - } - } - - /** - * @psalm-pure - * @psalm-assert int $value - * - * @param mixed $value - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function natural($value, $message = '') - { - if (!\is_int($value) || $value < 0) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected a non-negative integer. Got %s', - static::valueToString($value) - )); - } - } - - /** - * @psalm-pure - * @psalm-assert bool $value - * - * @param mixed $value - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function boolean($value, $message = '') - { - if (!\is_bool($value)) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected a boolean. Got: %s', - static::typeToString($value) - )); - } - } - - /** - * @psalm-pure - * @psalm-assert scalar $value - * - * @param mixed $value - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function scalar($value, $message = '') - { - if (!\is_scalar($value)) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected a scalar. Got: %s', - static::typeToString($value) - )); - } - } - - /** - * @psalm-pure - * @psalm-assert object $value - * - * @param mixed $value - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function object($value, $message = '') - { - if (!\is_object($value)) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected an object. Got: %s', - static::typeToString($value) - )); - } - } - - /** - * @psalm-pure - * @psalm-assert resource $value - * - * @param mixed $value - * @param string|null $type type of resource this should be. @see https://www.php.net/manual/en/function.get-resource-type.php - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function resource($value, $type = null, $message = '') - { - if (!\is_resource($value)) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected a resource. Got: %s', - static::typeToString($value) - )); - } - - if ($type && $type !== \get_resource_type($value)) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected a resource of type %2$s. Got: %s', - static::typeToString($value), - $type - )); - } - } - - /** - * @psalm-pure - * @psalm-assert callable $value - * - * @param mixed $value - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function isCallable($value, $message = '') - { - if (!\is_callable($value)) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected a callable. Got: %s', - static::typeToString($value) - )); - } - } - - /** - * @psalm-pure - * @psalm-assert array $value - * - * @param mixed $value - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function isArray($value, $message = '') - { - if (!\is_array($value)) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected an array. Got: %s', - static::typeToString($value) - )); - } - } - - /** - * @psalm-pure - * @psalm-assert iterable $value - * - * @deprecated use "isIterable" or "isInstanceOf" instead - * - * @param mixed $value - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function isTraversable($value, $message = '') - { - @\trigger_error( - \sprintf( - 'The "%s" assertion is deprecated. You should stop using it, as it will soon be removed in 2.0 version. Use "isIterable" or "isInstanceOf" instead.', - __METHOD__ - ), - \E_USER_DEPRECATED - ); - - if (!\is_array($value) && !($value instanceof Traversable)) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected a traversable. Got: %s', - static::typeToString($value) - )); - } - } - - /** - * @psalm-pure - * @psalm-assert array|ArrayAccess $value - * - * @param mixed $value - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function isArrayAccessible($value, $message = '') - { - if (!\is_array($value) && !($value instanceof ArrayAccess)) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected an array accessible. Got: %s', - static::typeToString($value) - )); - } - } - - /** - * @psalm-pure - * @psalm-assert countable $value - * - * @param mixed $value - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function isCountable($value, $message = '') - { - if ( - !\is_array($value) - && !($value instanceof Countable) - && !($value instanceof ResourceBundle) - && !($value instanceof SimpleXMLElement) - ) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected a countable. Got: %s', - static::typeToString($value) - )); - } - } - - /** - * @psalm-pure - * @psalm-assert iterable $value - * - * @param mixed $value - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function isIterable($value, $message = '') - { - if (!\is_array($value) && !($value instanceof Traversable)) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected an iterable. Got: %s', - static::typeToString($value) - )); - } - } - - /** - * @psalm-pure - * @psalm-template ExpectedType of object - * @psalm-param class-string $class - * @psalm-assert ExpectedType $value - * - * @param mixed $value - * @param string|object $class - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function isInstanceOf($value, $class, $message = '') - { - if (!($value instanceof $class)) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected an instance of %2$s. Got: %s', - static::typeToString($value), - $class - )); - } - } - - /** - * @psalm-pure - * @psalm-template ExpectedType of object - * @psalm-param class-string $class - * @psalm-assert !ExpectedType $value - * - * @param mixed $value - * @param string|object $class - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function notInstanceOf($value, $class, $message = '') - { - if ($value instanceof $class) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected an instance other than %2$s. Got: %s', - static::typeToString($value), - $class - )); - } - } - - /** - * @psalm-pure - * @psalm-param array $classes - * - * @param mixed $value - * @param array $classes - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function isInstanceOfAny($value, array $classes, $message = '') - { - foreach ($classes as $class) { - if ($value instanceof $class) { - return; - } - } - - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected an instance of any of %2$s. Got: %s', - static::typeToString($value), - \implode(', ', \array_map(array('static', 'valueToString'), $classes)) - )); - } - - /** - * @psalm-pure - * @psalm-template ExpectedType of object - * @psalm-param class-string $class - * @psalm-assert ExpectedType|class-string $value - * - * @param object|string $value - * @param string $class - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function isAOf($value, $class, $message = '') - { - static::string($class, 'Expected class as a string. Got: %s'); - - if (!\is_a($value, $class, \is_string($value))) { - static::reportInvalidArgument(sprintf( - $message ?: 'Expected an instance of this class or to this class among his parents %2$s. Got: %s', - static::typeToString($value), - $class - )); - } - } - - /** - * @psalm-pure - * @psalm-template UnexpectedType of object - * @psalm-param class-string $class - * @psalm-assert !UnexpectedType $value - * @psalm-assert !class-string $value - * - * @param object|string $value - * @param string $class - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function isNotA($value, $class, $message = '') - { - static::string($class, 'Expected class as a string. Got: %s'); - - if (\is_a($value, $class, \is_string($value))) { - static::reportInvalidArgument(sprintf( - $message ?: 'Expected an instance of this class or to this class among his parents other than %2$s. Got: %s', - static::typeToString($value), - $class - )); - } - } - - /** - * @psalm-pure - * @psalm-param array $classes - * - * @param object|string $value - * @param string[] $classes - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function isAnyOf($value, array $classes, $message = '') - { - foreach ($classes as $class) { - static::string($class, 'Expected class as a string. Got: %s'); - - if (\is_a($value, $class, \is_string($value))) { - return; - } - } - - static::reportInvalidArgument(sprintf( - $message ?: 'Expected an any of instance of this class or to this class among his parents other than %2$s. Got: %s', - static::typeToString($value), - \implode(', ', \array_map(array('static', 'valueToString'), $classes)) - )); - } - - /** - * @psalm-pure - * @psalm-assert empty $value - * - * @param mixed $value - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function isEmpty($value, $message = '') - { - if (!empty($value)) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected an empty value. Got: %s', - static::valueToString($value) - )); - } - } - - /** - * @psalm-pure - * @psalm-assert !empty $value - * - * @param mixed $value - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function notEmpty($value, $message = '') - { - if (empty($value)) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected a non-empty value. Got: %s', - static::valueToString($value) - )); - } - } - - /** - * @psalm-pure - * @psalm-assert null $value - * - * @param mixed $value - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function null($value, $message = '') - { - if (null !== $value) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected null. Got: %s', - static::valueToString($value) - )); - } - } - - /** - * @psalm-pure - * @psalm-assert !null $value - * - * @param mixed $value - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function notNull($value, $message = '') - { - if (null === $value) { - static::reportInvalidArgument( - $message ?: 'Expected a value other than null.' - ); - } - } - - /** - * @psalm-pure - * @psalm-assert true $value - * - * @param mixed $value - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function true($value, $message = '') - { - if (true !== $value) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected a value to be true. Got: %s', - static::valueToString($value) - )); - } - } - - /** - * @psalm-pure - * @psalm-assert false $value - * - * @param mixed $value - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function false($value, $message = '') - { - if (false !== $value) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected a value to be false. Got: %s', - static::valueToString($value) - )); - } - } - - /** - * @psalm-assert !false $value - * - * @param mixed $value - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function notFalse($value, $message = '') - { - if (false === $value) { - static::reportInvalidArgument( - $message ?: 'Expected a value other than false.' - ); - } - } - - /** - * @param mixed $value - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function ip($value, $message = '') - { - if (false === \filter_var($value, \FILTER_VALIDATE_IP)) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected a value to be an IP. Got: %s', - static::valueToString($value) - )); - } - } - - /** - * @param mixed $value - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function ipv4($value, $message = '') - { - if (false === \filter_var($value, \FILTER_VALIDATE_IP, \FILTER_FLAG_IPV4)) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected a value to be an IPv4. Got: %s', - static::valueToString($value) - )); - } - } - - /** - * @param mixed $value - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function ipv6($value, $message = '') - { - if (false === \filter_var($value, \FILTER_VALIDATE_IP, \FILTER_FLAG_IPV6)) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected a value to be an IPv6. Got %s', - static::valueToString($value) - )); - } - } - - /** - * @param mixed $value - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function email($value, $message = '') - { - if (false === \filter_var($value, FILTER_VALIDATE_EMAIL)) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected a value to be a valid e-mail address. Got %s', - static::valueToString($value) - )); - } - } - - /** - * Does non strict comparisons on the items, so ['3', 3] will not pass the assertion. - * - * @param array $values - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function uniqueValues(array $values, $message = '') - { - $allValues = \count($values); - $uniqueValues = \count(\array_unique($values)); - - if ($allValues !== $uniqueValues) { - $difference = $allValues - $uniqueValues; - - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected an array of unique values, but %s of them %s duplicated', - $difference, - (1 === $difference ? 'is' : 'are') - )); - } - } - - /** - * @param mixed $value - * @param mixed $expect - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function eq($value, $expect, $message = '') - { - if ($expect != $value) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected a value equal to %2$s. Got: %s', - static::valueToString($value), - static::valueToString($expect) - )); - } - } - - /** - * @param mixed $value - * @param mixed $expect - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function notEq($value, $expect, $message = '') - { - if ($expect == $value) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected a different value than %s.', - static::valueToString($expect) - )); - } - } - - /** - * @psalm-pure - * - * @param mixed $value - * @param mixed $expect - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function same($value, $expect, $message = '') - { - if ($expect !== $value) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected a value identical to %2$s. Got: %s', - static::valueToString($value), - static::valueToString($expect) - )); - } - } - - /** - * @psalm-pure - * - * @param mixed $value - * @param mixed $expect - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function notSame($value, $expect, $message = '') - { - if ($expect === $value) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected a value not identical to %s.', - static::valueToString($expect) - )); - } - } - - /** - * @psalm-pure - * - * @param mixed $value - * @param mixed $limit - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function greaterThan($value, $limit, $message = '') - { - if ($value <= $limit) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected a value greater than %2$s. Got: %s', - static::valueToString($value), - static::valueToString($limit) - )); - } - } - - /** - * @psalm-pure - * - * @param mixed $value - * @param mixed $limit - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function greaterThanEq($value, $limit, $message = '') - { - if ($value < $limit) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected a value greater than or equal to %2$s. Got: %s', - static::valueToString($value), - static::valueToString($limit) - )); - } - } - - /** - * @psalm-pure - * - * @param mixed $value - * @param mixed $limit - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function lessThan($value, $limit, $message = '') - { - if ($value >= $limit) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected a value less than %2$s. Got: %s', - static::valueToString($value), - static::valueToString($limit) - )); - } - } - - /** - * @psalm-pure - * - * @param mixed $value - * @param mixed $limit - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function lessThanEq($value, $limit, $message = '') - { - if ($value > $limit) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected a value less than or equal to %2$s. Got: %s', - static::valueToString($value), - static::valueToString($limit) - )); - } - } - - /** - * Inclusive range, so Assert::(3, 3, 5) passes. - * - * @psalm-pure - * - * @param mixed $value - * @param mixed $min - * @param mixed $max - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function range($value, $min, $max, $message = '') - { - if ($value < $min || $value > $max) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected a value between %2$s and %3$s. Got: %s', - static::valueToString($value), - static::valueToString($min), - static::valueToString($max) - )); - } - } - - /** - * A more human-readable alias of Assert::inArray(). - * - * @psalm-pure - * - * @param mixed $value - * @param array $values - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function oneOf($value, array $values, $message = '') - { - static::inArray($value, $values, $message); - } - - /** - * Does strict comparison, so Assert::inArray(3, ['3']) does not pass the assertion. - * - * @psalm-pure - * - * @param mixed $value - * @param array $values - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function inArray($value, array $values, $message = '') - { - if (!\in_array($value, $values, true)) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected one of: %2$s. Got: %s', - static::valueToString($value), - \implode(', ', \array_map(array('static', 'valueToString'), $values)) - )); - } - } - - /** - * @psalm-pure - * - * @param string $value - * @param string $subString - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function contains($value, $subString, $message = '') - { - if (false === \strpos($value, $subString)) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected a value to contain %2$s. Got: %s', - static::valueToString($value), - static::valueToString($subString) - )); - } - } - - /** - * @psalm-pure - * - * @param string $value - * @param string $subString - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function notContains($value, $subString, $message = '') - { - if (false !== \strpos($value, $subString)) { - static::reportInvalidArgument(\sprintf( - $message ?: '%2$s was not expected to be contained in a value. Got: %s', - static::valueToString($value), - static::valueToString($subString) - )); - } - } - - /** - * @psalm-pure - * - * @param string $value - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function notWhitespaceOnly($value, $message = '') - { - if (\preg_match('/^\s*$/', $value)) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected a non-whitespace string. Got: %s', - static::valueToString($value) - )); - } - } - - /** - * @psalm-pure - * - * @param string $value - * @param string $prefix - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function startsWith($value, $prefix, $message = '') - { - if (0 !== \strpos($value, $prefix)) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected a value to start with %2$s. Got: %s', - static::valueToString($value), - static::valueToString($prefix) - )); - } - } - - /** - * @psalm-pure - * - * @param string $value - * @param string $prefix - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function notStartsWith($value, $prefix, $message = '') - { - if (0 === \strpos($value, $prefix)) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected a value not to start with %2$s. Got: %s', - static::valueToString($value), - static::valueToString($prefix) - )); - } - } - - /** - * @psalm-pure - * - * @param mixed $value - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function startsWithLetter($value, $message = '') - { - static::string($value); - - $valid = isset($value[0]); - - if ($valid) { - $locale = \setlocale(LC_CTYPE, 0); - \setlocale(LC_CTYPE, 'C'); - $valid = \ctype_alpha($value[0]); - \setlocale(LC_CTYPE, $locale); - } - - if (!$valid) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected a value to start with a letter. Got: %s', - static::valueToString($value) - )); - } - } - - /** - * @psalm-pure - * - * @param string $value - * @param string $suffix - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function endsWith($value, $suffix, $message = '') - { - if ($suffix !== \substr($value, -\strlen($suffix))) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected a value to end with %2$s. Got: %s', - static::valueToString($value), - static::valueToString($suffix) - )); - } - } - - /** - * @psalm-pure - * - * @param string $value - * @param string $suffix - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function notEndsWith($value, $suffix, $message = '') - { - if ($suffix === \substr($value, -\strlen($suffix))) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected a value not to end with %2$s. Got: %s', - static::valueToString($value), - static::valueToString($suffix) - )); - } - } - - /** - * @psalm-pure - * - * @param string $value - * @param string $pattern - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function regex($value, $pattern, $message = '') - { - if (!\preg_match($pattern, $value)) { - static::reportInvalidArgument(\sprintf( - $message ?: 'The value %s does not match the expected pattern.', - static::valueToString($value) - )); - } - } - - /** - * @psalm-pure - * - * @param string $value - * @param string $pattern - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function notRegex($value, $pattern, $message = '') - { - if (\preg_match($pattern, $value, $matches, PREG_OFFSET_CAPTURE)) { - static::reportInvalidArgument(\sprintf( - $message ?: 'The value %s matches the pattern %s (at offset %d).', - static::valueToString($value), - static::valueToString($pattern), - $matches[0][1] - )); - } - } - - /** - * @psalm-pure - * - * @param mixed $value - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function unicodeLetters($value, $message = '') - { - static::string($value); - - if (!\preg_match('/^\p{L}+$/u', $value)) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected a value to contain only Unicode letters. Got: %s', - static::valueToString($value) - )); - } - } - - /** - * @psalm-pure - * - * @param mixed $value - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function alpha($value, $message = '') - { - static::string($value); - - $locale = \setlocale(LC_CTYPE, 0); - \setlocale(LC_CTYPE, 'C'); - $valid = !\ctype_alpha($value); - \setlocale(LC_CTYPE, $locale); - - if ($valid) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected a value to contain only letters. Got: %s', - static::valueToString($value) - )); - } - } - - /** - * @psalm-pure - * - * @param string $value - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function digits($value, $message = '') - { - $locale = \setlocale(LC_CTYPE, 0); - \setlocale(LC_CTYPE, 'C'); - $valid = !\ctype_digit($value); - \setlocale(LC_CTYPE, $locale); - - if ($valid) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected a value to contain digits only. Got: %s', - static::valueToString($value) - )); - } - } - - /** - * @psalm-pure - * - * @param string $value - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function alnum($value, $message = '') - { - $locale = \setlocale(LC_CTYPE, 0); - \setlocale(LC_CTYPE, 'C'); - $valid = !\ctype_alnum($value); - \setlocale(LC_CTYPE, $locale); - - if ($valid) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected a value to contain letters and digits only. Got: %s', - static::valueToString($value) - )); - } - } - - /** - * @psalm-pure - * @psalm-assert lowercase-string $value - * - * @param string $value - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function lower($value, $message = '') - { - $locale = \setlocale(LC_CTYPE, 0); - \setlocale(LC_CTYPE, 'C'); - $valid = !\ctype_lower($value); - \setlocale(LC_CTYPE, $locale); - - if ($valid) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected a value to contain lowercase characters only. Got: %s', - static::valueToString($value) - )); - } - } - - /** - * @psalm-pure - * @psalm-assert !lowercase-string $value - * - * @param string $value - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function upper($value, $message = '') - { - $locale = \setlocale(LC_CTYPE, 0); - \setlocale(LC_CTYPE, 'C'); - $valid = !\ctype_upper($value); - \setlocale(LC_CTYPE, $locale); - - if ($valid) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected a value to contain uppercase characters only. Got: %s', - static::valueToString($value) - )); - } - } - - /** - * @psalm-pure - * - * @param string $value - * @param int $length - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function length($value, $length, $message = '') - { - if ($length !== static::strlen($value)) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected a value to contain %2$s characters. Got: %s', - static::valueToString($value), - $length - )); - } - } - - /** - * Inclusive min. - * - * @psalm-pure - * - * @param string $value - * @param int|float $min - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function minLength($value, $min, $message = '') - { - if (static::strlen($value) < $min) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected a value to contain at least %2$s characters. Got: %s', - static::valueToString($value), - $min - )); - } - } - - /** - * Inclusive max. - * - * @psalm-pure - * - * @param string $value - * @param int|float $max - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function maxLength($value, $max, $message = '') - { - if (static::strlen($value) > $max) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected a value to contain at most %2$s characters. Got: %s', - static::valueToString($value), - $max - )); - } - } - - /** - * Inclusive , so Assert::lengthBetween('asd', 3, 5); passes the assertion. - * - * @psalm-pure - * - * @param string $value - * @param int|float $min - * @param int|float $max - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function lengthBetween($value, $min, $max, $message = '') - { - $length = static::strlen($value); - - if ($length < $min || $length > $max) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected a value to contain between %2$s and %3$s characters. Got: %s', - static::valueToString($value), - $min, - $max - )); - } - } - - /** - * Will also pass if $value is a directory, use Assert::file() instead if you need to be sure it is a file. - * - * @param mixed $value - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function fileExists($value, $message = '') - { - static::string($value); - - if (!\file_exists($value)) { - static::reportInvalidArgument(\sprintf( - $message ?: 'The file %s does not exist.', - static::valueToString($value) - )); - } - } - - /** - * @param mixed $value - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function file($value, $message = '') - { - static::fileExists($value, $message); - - if (!\is_file($value)) { - static::reportInvalidArgument(\sprintf( - $message ?: 'The path %s is not a file.', - static::valueToString($value) - )); - } - } - - /** - * @param mixed $value - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function directory($value, $message = '') - { - static::fileExists($value, $message); - - if (!\is_dir($value)) { - static::reportInvalidArgument(\sprintf( - $message ?: 'The path %s is no directory.', - static::valueToString($value) - )); - } - } - - /** - * @param string $value - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function readable($value, $message = '') - { - if (!\is_readable($value)) { - static::reportInvalidArgument(\sprintf( - $message ?: 'The path %s is not readable.', - static::valueToString($value) - )); - } - } - - /** - * @param string $value - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function writable($value, $message = '') - { - if (!\is_writable($value)) { - static::reportInvalidArgument(\sprintf( - $message ?: 'The path %s is not writable.', - static::valueToString($value) - )); - } - } - - /** - * @param mixed $value - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function classExists($value, $message = '') - { - if (!\class_exists($value)) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected an existing class name. Got: %s', - static::valueToString($value) - )); - } - } - - /** - * @psalm-pure - * @psalm-template ExpectedType of object - * @psalm-param class-string $class - * @psalm-assert class-string|ExpectedType $value - * - * @param mixed $value - * @param string|object $class - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function subclassOf($value, $class, $message = '') - { - if (!\is_subclass_of($value, $class)) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected a sub-class of %2$s. Got: %s', - static::valueToString($value), - static::valueToString($class) - )); - } - } - - /** - * @param mixed $value - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function interfaceExists($value, $message = '') - { - if (!\interface_exists($value)) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected an existing interface name. got %s', - static::valueToString($value) - )); - } - } - - /** - * @psalm-pure - * @psalm-template ExpectedType of object - * @psalm-param class-string $interface - * @psalm-assert class-string $value - * - * @param mixed $value - * @param mixed $interface - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function implementsInterface($value, $interface, $message = '') - { - if (!\in_array($interface, \class_implements($value))) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected an implementation of %2$s. Got: %s', - static::valueToString($value), - static::valueToString($interface) - )); - } - } - - /** - * @psalm-pure - * @psalm-param class-string|object $classOrObject - * - * @param string|object $classOrObject - * @param mixed $property - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function propertyExists($classOrObject, $property, $message = '') - { - if (!\property_exists($classOrObject, $property)) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected the property %s to exist.', - static::valueToString($property) - )); - } - } - - /** - * @psalm-pure - * @psalm-param class-string|object $classOrObject - * - * @param string|object $classOrObject - * @param mixed $property - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function propertyNotExists($classOrObject, $property, $message = '') - { - if (\property_exists($classOrObject, $property)) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected the property %s to not exist.', - static::valueToString($property) - )); - } - } - - /** - * @psalm-pure - * @psalm-param class-string|object $classOrObject - * - * @param string|object $classOrObject - * @param mixed $method - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function methodExists($classOrObject, $method, $message = '') - { - if (!\method_exists($classOrObject, $method)) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected the method %s to exist.', - static::valueToString($method) - )); - } - } - - /** - * @psalm-pure - * @psalm-param class-string|object $classOrObject - * - * @param string|object $classOrObject - * @param mixed $method - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function methodNotExists($classOrObject, $method, $message = '') - { - if (\method_exists($classOrObject, $method)) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected the method %s to not exist.', - static::valueToString($method) - )); - } - } - - /** - * @psalm-pure - * - * @param array $array - * @param string|int $key - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function keyExists($array, $key, $message = '') - { - if (!(isset($array[$key]) || \array_key_exists($key, $array))) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected the key %s to exist.', - static::valueToString($key) - )); - } - } - - /** - * @psalm-pure - * - * @param array $array - * @param string|int $key - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function keyNotExists($array, $key, $message = '') - { - if (isset($array[$key]) || \array_key_exists($key, $array)) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected the key %s to not exist.', - static::valueToString($key) - )); - } - } - - /** - * Checks if a value is a valid array key (int or string). - * - * @psalm-pure - * @psalm-assert array-key $value - * - * @param mixed $value - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function validArrayKey($value, $message = '') - { - if (!(\is_int($value) || \is_string($value))) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected string or integer. Got: %s', - static::typeToString($value) - )); - } - } - - /** - * Does not check if $array is countable, this can generate a warning on php versions after 7.2. - * - * @param Countable|array $array - * @param int $number - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function count($array, $number, $message = '') - { - static::eq( - \count($array), - $number, - \sprintf( - $message ?: 'Expected an array to contain %d elements. Got: %d.', - $number, - \count($array) - ) - ); - } - - /** - * Does not check if $array is countable, this can generate a warning on php versions after 7.2. - * - * @param Countable|array $array - * @param int|float $min - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function minCount($array, $min, $message = '') - { - if (\count($array) < $min) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected an array to contain at least %2$d elements. Got: %d', - \count($array), - $min - )); - } - } - - /** - * Does not check if $array is countable, this can generate a warning on php versions after 7.2. - * - * @param Countable|array $array - * @param int|float $max - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function maxCount($array, $max, $message = '') - { - if (\count($array) > $max) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected an array to contain at most %2$d elements. Got: %d', - \count($array), - $max - )); - } - } - - /** - * Does not check if $array is countable, this can generate a warning on php versions after 7.2. - * - * @param Countable|array $array - * @param int|float $min - * @param int|float $max - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function countBetween($array, $min, $max, $message = '') - { - $count = \count($array); - - if ($count < $min || $count > $max) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Expected an array to contain between %2$d and %3$d elements. Got: %d', - $count, - $min, - $max - )); - } - } - - /** - * @psalm-pure - * @psalm-assert list $array - * - * @param mixed $array - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function isList($array, $message = '') - { - if (!\is_array($array) || $array !== \array_values($array)) { - static::reportInvalidArgument( - $message ?: 'Expected list - non-associative array.' - ); - } - } - - /** - * @psalm-pure - * @psalm-assert list $array - * @psalm-assert !empty $array - * - * @param mixed $array - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function isNonEmptyList($array, $message = '') - { - static::isList($array, $message); - static::notEmpty($array, $message); - } - - /** - * @psalm-pure - * @psalm-template T - * @psalm-param mixed|array $array - * @psalm-assert array $array - * - * @param mixed $array - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function isMap($array, $message = '') - { - if ( - !\is_array($array) || - \array_keys($array) !== \array_filter(\array_keys($array), '\is_string') - ) { - static::reportInvalidArgument( - $message ?: 'Expected map - associative array with string keys.' - ); - } - } - - /** - * @psalm-pure - * @psalm-template T - * @psalm-param mixed|array $array - * @psalm-assert array $array - * @psalm-assert !empty $array - * - * @param mixed $array - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function isNonEmptyMap($array, $message = '') - { - static::isMap($array, $message); - static::notEmpty($array, $message); - } - - /** - * @psalm-pure - * - * @param string $value - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function uuid($value, $message = '') - { - $value = \str_replace(array('urn:', 'uuid:', '{', '}'), '', $value); - - // The nil UUID is special form of UUID that is specified to have all - // 128 bits set to zero. - if ('00000000-0000-0000-0000-000000000000' === $value) { - return; - } - - if (!\preg_match('/^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$/', $value)) { - static::reportInvalidArgument(\sprintf( - $message ?: 'Value %s is not a valid UUID.', - static::valueToString($value) - )); - } - } - - /** - * @psalm-param class-string - * - * @param Closure $expression - * @param string $class - * @param string $message - * - * @throws InvalidArgumentException - */ - public static function throws(Closure $expression, $class = 'Exception', $message = '') - { - static::string($class); - - $actual = 'none'; - - try { - $expression(); - } catch (Exception $e) { - $actual = \get_class($e); - if ($e instanceof $class) { - return; - } - } catch (Throwable $e) { - $actual = \get_class($e); - if ($e instanceof $class) { - return; - } - } - - static::reportInvalidArgument($message ?: \sprintf( - 'Expected to throw "%s", got "%s"', - $class, - $actual - )); - } - - /** - * @throws BadMethodCallException - */ - public static function __callStatic($name, $arguments) - { - if ('nullOr' === \substr($name, 0, 6)) { - if (null !== $arguments[0]) { - $method = \lcfirst(\substr($name, 6)); - \call_user_func_array(array('static', $method), $arguments); - } - - return; - } - - if ('all' === \substr($name, 0, 3)) { - static::isIterable($arguments[0]); - - $method = \lcfirst(\substr($name, 3)); - $args = $arguments; - - foreach ($arguments[0] as $entry) { - $args[0] = $entry; - - \call_user_func_array(array('static', $method), $args); - } - - return; - } - - throw new BadMethodCallException('No such method: '.$name); - } - - /** - * @param mixed $value - * - * @return string - */ - protected static function valueToString($value) - { - if (null === $value) { - return 'null'; - } - - if (true === $value) { - return 'true'; - } - - if (false === $value) { - return 'false'; - } - - if (\is_array($value)) { - return 'array'; - } - - if (\is_object($value)) { - if (\method_exists($value, '__toString')) { - return \get_class($value).': '.self::valueToString($value->__toString()); - } - - if ($value instanceof DateTime || $value instanceof DateTimeImmutable) { - return \get_class($value).': '.self::valueToString($value->format('c')); - } - - return \get_class($value); - } - - if (\is_resource($value)) { - return 'resource'; - } - - if (\is_string($value)) { - return '"'.$value.'"'; - } - - return (string) $value; - } - - /** - * @param mixed $value - * - * @return string - */ - protected static function typeToString($value) - { - return \is_object($value) ? \get_class($value) : \gettype($value); - } - - protected static function strlen($value) - { - if (!\function_exists('mb_detect_encoding')) { - return \strlen($value); - } - - if (false === $encoding = \mb_detect_encoding($value)) { - return \strlen($value); - } - - return \mb_strlen($value, $encoding); - } - - /** - * @param string $message - * - * @throws InvalidArgumentException - * - * @psalm-pure this method is not supposed to perform side-effects - */ - protected static function reportInvalidArgument($message) - { - throw new InvalidArgumentException($message); - } - - private function __construct() - { - } -}